From b68622bf8e6f4b2b3015bcb9c44646b8ece19491 Mon Sep 17 00:00:00 2001 From: mvertens Date: Sun, 26 Feb 2017 14:39:35 -0700 Subject: [PATCH 001/730] first pass at CLM sphinx documentation --- doc/Makefile | 20 + doc/source/conf.py | 164 +++++ doc/source/index.rst | 26 + ...w-Files-to-the-build-namelist-Database.rst | 24 + .../CLM-3.1-Managing-Your-Own-Data-files.rst | 73 ++ .../CLM-3.2-Adding-Resolution-Names.rst | 45 ++ ...3-Adding-or-Changing-Default-Filenames.rst | 40 + .../adding-new-resolutions/index.rst | 18 + doc/source/users_guide/index.rst | 23 + .../users_guide/overview/getting-help.rst | 117 +++ doc/source/users_guide/overview/index.rst | 18 + .../users_guide/overview/introduction.rst | 199 +++++ .../users_guide/overview/quickstart.rst | 114 +++ .../overview/scientific_validation.rst | 78 ++ .../running-PTCLM/adding-ptclm-site-data.rst | 109 +++ .../users_guide/running-PTCLM/index.rst | 18 + .../running-PTCLM/introduction-to-ptclm.rst | 139 ++++ .../running-PTCLM/ptclm-examples.rst | 70 ++ .../users_guide/running-PTCLM/using-ptclm.rst | 222 ++++++ .../running-single-points/index.rst | 18 + .../running-pts_mode-configurations.rst | 40 + .../running-single-point-configurations.rst | 218 ++++++ ...point-and-regional-grid-configurations.rst | 51 ++ ...tellite-Phenology-Model-(CLMSP-spinup).rst | 10 + ...CLM4.5-biogeochemistry-(CLMBGC-spinup).rst | 75 ++ ...tmospheric-forcing-to-spinup-the-model.rst | 31 + ...tmospheric-forcing-to-spinup-the-model.rst | 75 ++ ...transient-historical-CO2-concentration.rst | 138 ++++ .../running-special-cases/index.rst | 22 + .../running-the-prognostic-crop-model.rst | 31 + .../running-with-irrigation.rst | 33 + .../what-is-a-special-case.rst | 12 + .../choosing-a-compset.rst | 321 ++++++++ .../customizing-the-clm-configuration.rst | 688 ++++++++++++++++++ .../customizing-the-clm-namelist.rst | 251 +++++++ .../customizing-the-datm-namelist.rst | 109 +++ .../setting-up-and-running-a-case/index.rst | 19 + doc/source/users_guide/testing/index.rst | 18 + doc/source/users_guide/testing/testing.rst | 62 ++ .../users_guide/trouble-shooting/index.rst | 15 + .../trouble-shooting/trouble-shooting.rst | 395 ++++++++++ .../building-the-clm-tools.rst | 162 +++++ .../users_guide/using-clm-tools/cprnc.rst | 29 + .../using-clm-tools/creating-domain-files.rst | 27 + ...g-input-for-surface-dataset-generation.rst | 116 +++ .../creating-surface-datasets.rst | 376 ++++++++++ .../datasts-for-observational-sites.rst | 17 + .../users_guide/using-clm-tools/index.rst | 21 + .../observational-sites-datasets.rst | 18 + .../what-are-the-clm-tools.rst | 89 +++ 50 files changed, 5004 insertions(+) create mode 100644 doc/Makefile create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst create mode 100644 doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst create mode 100644 doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst create mode 100644 doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst create mode 100644 doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst create mode 100644 doc/source/users_guide/adding-new-resolutions/index.rst create mode 100644 doc/source/users_guide/index.rst create mode 100644 doc/source/users_guide/overview/getting-help.rst create mode 100644 doc/source/users_guide/overview/index.rst create mode 100644 doc/source/users_guide/overview/introduction.rst create mode 100644 doc/source/users_guide/overview/quickstart.rst create mode 100644 doc/source/users_guide/overview/scientific_validation.rst create mode 100644 doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst create mode 100644 doc/source/users_guide/running-PTCLM/index.rst create mode 100644 doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst create mode 100644 doc/source/users_guide/running-PTCLM/ptclm-examples.rst create mode 100644 doc/source/users_guide/running-PTCLM/using-ptclm.rst create mode 100644 doc/source/users_guide/running-single-points/index.rst create mode 100644 doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst create mode 100644 doc/source/users_guide/running-single-points/running-single-point-configurations.rst create mode 100644 doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst create mode 100644 doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst create mode 100644 doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst create mode 100644 doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst create mode 100644 doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst create mode 100644 doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst create mode 100644 doc/source/users_guide/running-special-cases/index.rst create mode 100644 doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst create mode 100644 doc/source/users_guide/running-special-cases/running-with-irrigation.rst create mode 100644 doc/source/users_guide/running-special-cases/what-is-a-special-case.rst create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst create mode 100644 doc/source/users_guide/setting-up-and-running-a-case/index.rst create mode 100644 doc/source/users_guide/testing/index.rst create mode 100644 doc/source/users_guide/testing/testing.rst create mode 100644 doc/source/users_guide/trouble-shooting/index.rst create mode 100644 doc/source/users_guide/trouble-shooting/trouble-shooting.rst create mode 100644 doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst create mode 100644 doc/source/users_guide/using-clm-tools/cprnc.rst create mode 100644 doc/source/users_guide/using-clm-tools/creating-domain-files.rst create mode 100644 doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst create mode 100644 doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst create mode 100644 doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst create mode 100644 doc/source/users_guide/using-clm-tools/index.rst create mode 100644 doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst create mode 100644 doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000..6d3ce5f50d --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = clmdoc +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000000..bdf2be569c --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,164 @@ +# -*- coding: utf-8 -*- +# +# clmdoc documentation build configuration file, created by +# sphinx-quickstart on Thu Feb 23 17:14:30 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.mathjax', + 'sphinx.ext.githubpages'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'clmdoc' +copyright = u'2017, Erik Kluzek, Bill Sacks, Ben Andre' +author = u'Erik Kluzek, Bill Sacks, Ben Andre' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'' +# The full version, including alpha/beta/rc tags. +release = u'' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'bizstyle' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'clmdocdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'clmdoc.tex', u'clmdoc Documentation', + u'Erik Kluzek, Bill Sacks, Ben Andre', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + author, 'clmdoc', 'One line description of project.', + 'Miscellaneous'), +] + + + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000000..a5ec1eb158 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,26 @@ +.. clmdoc documentation master file, created by + sphinx-quickstart on Tue Feb 21 13:37:07 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to the CLM documentation +================================== + +This document has one major sections. + +The :ref:`CLM user's guide ` is a basic guide in utilizing CLM. + +Table of contents +----------------- + +.. toctree:: + :maxdepth: 1 + + users_guide/index.rst + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst new file mode 100644 index 0000000000..de13570b3d --- /dev/null +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -0,0 +1,24 @@ +.. _adding-resolutions: + +======================== + Adding New Resolutions +======================== + +In the last chapter we gave the details on how to create new files for input into CLM. +These files could be either global resolutions, regional-grids or even a single grid point. +If you want to easily have these files available for continued use in your development you will then want to include them in the build-namelist database so that build-namelist can easily find them for you. +You can deal with them, just by putting the settings in the ``user_nl_clm namelist`` file, or by using ``CLM_USRDAT_NAME``. +Another way to deal with them is to enter them into the database for build-namelist, so that build-namelist can find them for you. +This keeps one central database for all your files, rather than having multiple locations to keep track of files. +If you have a LOT of files to keep track of it also might be easier than keeping track by hand, especially if you have to periodically update your files. +If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. + +There are two parts to adding files to the build-namelist database. +The first part is adding new resolution names which is done in the ``models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml`` file (and in the ``models/lnd/clm/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). +You can then use the new resolution by using ``CLM_USRDAT_NAME``. +If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``scripts/ccsm_utils/Case.template/config_grid.xml`` file. + +The second part is actually adding the new filenames which is done in the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml`` file (``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). +If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. + + diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst new file mode 100644 index 0000000000..a8ebc81ac8 --- /dev/null +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst @@ -0,0 +1,73 @@ +.. _managing-your-data-files: + +============================== + Managing Your Data Own Files +============================== + +If you are running on a supported machine (such as yellowstone or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `CESM1.2.0 Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. + +Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. + +``` +> cd scripts +# First make sure you have a inputdata location that you can write to +# You only need to do this step once, so you won't need to do this in the future +# (except to bring in any updated files in the original $CSMDATA location). +> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data +> ./link_dirtree $CSMDATA $MYCSMDATA +``` + +Then when you create a case you will change ``DIN_LOC_ROOT_CSMDATA`` to point to the location you linked to rather than the default location. + +``> ./xmlchange DIN_LOC_ROOT_CSMDATA=$MYCSMDATA`` + +In order to list the files that you have created you merely need to use the UNIX command find to find the files that are NOT softlinks. So for example executing the following command: + +``> find $MYCSMDATA -type f -print`` + +for me gives the following truncated list of CLM_USRDAT_NAME files that I have created. + +``` +/glade/p/work/erik/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-01.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-02.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-03.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-04.nc +``` + +You can also use **find** to list files that have a particular pattern in the name as well (using the -name option with wildcards). Also you can always rerun the **link_dirtree** command if any new files are added that you need to be linked into your directory tree. Since, the files are soft-links -- it doesn't take up much space other than the files that you add there. This way all of the files are kept in one place, they are organized by usage according to CESM standards, and you can easily find your own files, and CLM can find them as well. + + + +If you are running on a supported machine (such as yellowstone or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `CESM1.2.0 Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. + +Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. + +``` +> cd scripts +# First make sure you have a inputdata location that you can write to +# You only need to do this step once, so you won't need to do this in the future +# (except to bring in any updated files in the original $CSMDATA location). +> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data +> ./link_dirtree $CSMDATA $MYCSMDATA +``` + +Then when you create a case you will change ``DIN_LOC_ROOT_CSMDATA`` to point to the location you linked to rather than the default location. + +``> ./xmlchange DIN_LOC_ROOT_CSMDATA=$MYCSMDATA`` + +In order to list the files that you have created you merely need to use the UNIX command find to find the files that are NOT softlinks. So for example executing the following command: + +``> find $MYCSMDATA -type f -print`` + +for me gives the following truncated list of CLM_USRDAT_NAME files that I have created. + +``` +/glade/p/work/erik/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-01.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-02.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-03.nc +/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-04.nc +``` + +You can also use **find** to list files that have a particular pattern in the name as well (using the -name option with wildcards). Also you can always rerun the **link_dirtree** command if any new files are added that you need to be linked into your directory tree. Since, the files are soft-links -- it doesn't take up much space other than the files that you add there. This way all of the files are kept in one place, they are organized by usage according to CESM standards, and you can easily find your own files, and CLM can find them as well. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst new file mode 100644 index 0000000000..6d44f73b5b --- /dev/null +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst @@ -0,0 +1,45 @@ +.. _adding-resolution-names: + +========================= + Adding Resolution Names +========================= + +If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. +The list of valid resolutions is in the id="res" entry in the ``models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml`` file. +You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the id="res" entry. +The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. +The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. +The convention for unstructured HOMME grids is nenp4, where corresponds to the resolution. +The higher is the higher the resolution. +So for example, ne60np4 is roughly half-degree while ne240np4 is roughly a eighth degree. +For regional or single-point datasets the names have a grid size number_of_latitudes x number_of_longitudes followed by an underscore and then a descriptive name such as a City name followed by an abbreviation for the Country in caps. +The only hard requirement is that names be unique for different grid files. Here's what the entry for resolutions looks like in the file: +:: + + + Horizontal resolutions + Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min, and 0.33x0.33 are only used for CLM tools + + +As you can see you just add your new resolution names to the end of the valid_values list. + +When using PTCLM and adding supported single-point resolutions, you'll also want to add these resolutions to the ``models/lnd/clm/bld/config_files/config_definition.xml`` under the ``sitespf_pt`` name. +The entry in that file looks like: +:: + + + Flag to turn on site specific special configuration flags for supported single + point resolutions. See the specific config_defaults_*.xml file for the special + settings that are set for a particular site. + + +PTCLM assumes that any supported single-point resolutions are valid settings for ``sitespf_pt``. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst new file mode 100644 index 0000000000..c539d0fd8c --- /dev/null +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst @@ -0,0 +1,40 @@ +.. _changing-default-filenames: + +============================ + Changing Default Filenames +============================ + +To add or change the default filenames you edit the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml`` and either change an existing filename or add a new one. +Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. +Attributes include the: resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (rcp) for future scenarios, and the type of biogeochemistry (bgc) model used. +For example the fatmgrid for the 1.9x2.5 resolution is as follows: + +``` + +lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c130415.nc + +``` + +Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (crop) attributes. + + +To add or change the default filenames for CLM tools edit the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` and either change an existing filename or add a new one. +Editing this file is similar to the ``namelist_defaults_clm4_5.xml`` talked about above. + + +---------------------------- +What are the required files? +---------------------------- + +Different types of simulations and different types of configurations for CLM require different lists of files. +The CLM4.5-BGC or Carbon Nitrogen (cn) Biogeochemistry model for example requires ``stream_fldfilename_ndep`` files, which are NOT required by CLMSP. +Transient simulations also require transient datasets, and the names of these datasets are sometimes different from the static versions (sometimes both are required as in the dynamic PFT cases). + + +In the following table we list the different files used by CLM, they are listed in order of importance, dependencies, and customizing. +So the required files are all near the top, and the files used only under different conditions are listed later, and files with the fewest dependencies are near the top, as are the files that are least likely to be customized. + + +Table 3-1. Required Files for Different Configurations and Simulation Types +--------------------------------------------------------------------------- +Insert table 3-1 diff --git a/doc/source/users_guide/adding-new-resolutions/index.rst b/doc/source/users_guide/adding-new-resolutions/index.rst new file mode 100644 index 0000000000..c01aa36ca0 --- /dev/null +++ b/doc/source/users_guide/adding-new-resolutions/index.rst @@ -0,0 +1,18 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _adding-new-resolutions-section: + +##################################### +Adding New Resolutions +##################################### + +.. toctree:: + :maxdepth: 2 + + CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst + CLM-3.1-Managing-Your-Own-Data-files.rst + CLM-3.2-Adding-Resolution-Names.rst + CLM-3.3-Adding-or-Changing-Default-Filenames.rst diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst new file mode 100644 index 0000000000..510d4b22a2 --- /dev/null +++ b/doc/source/users_guide/index.rst @@ -0,0 +1,23 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _users-guide: + +##################################### +CLM User's Guide +##################################### + +.. toctree:: + :maxdepth: 2 + :numbered: + + overview/index.rst + setting-up-and-running-a-case/index.rst + using-clm-tools/index.rst + adding-new-resolutions/index.rst + running-special-cases/index.rst + running-single-points/index.rst + running-PTCLM/index.rst + trouble-shooting/index.rst diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst new file mode 100644 index 0000000000..fb5069226b --- /dev/null +++ b/doc/source/users_guide/overview/getting-help.rst @@ -0,0 +1,117 @@ +.. _getting-help: + +============== + Getting Help +============== +In addition to this users-guide there are several other resources that are available to help you use CLM4.5. The first one is the CESM1.2.0 User's-Guide, which documents the entire process of creating cases with CESM1.2.0. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in CESM1.2.0. + +--------------------------- +The CESM User's-Guide +--------------------------- + +CLM4.5 in CESM1.2.0 is always run from within the standard CESM1.2.0 build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the CESM1.2.0 scripts and understand how to work with them. User's-Guide documentation on the CESM1.2.0 scripts are available from the following web-page. The purpose of this CLM4.5 in CESM1.2.0 User's Guide is to give the CLM4.5 user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the CESM1.2.0 Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. + +`cesmrel; Scripts User's-Guide (http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html) `_ + +----------------------- +The CESM Bulletin Board +----------------------- + +There is a rich and diverse set of people that use the CESM, and often it is useful to be in contact with others to get help in solving problems or trying something new. To facilitate this we have an online Bulletin Board for questions on the CESM. There are also different sections in the Bulletin Board for the different component models or for different topics. + +`CESM Online Bulletin Board `_ + +----------------- +The CLM web pages +----------------- + +The main CLM web page contains information on the CLM, it's history, developers, as well as downloads for previous model versions. There are also documentation text files in the models/lnd/clm/doc directory that give some quick information on using CLM. + +`CLM web page `_ +`CLM Documentation Text Files `_ + +Also note that several of the XML database files can be viewed in a web browser to get a nice table of namelist options, namelist defaults, or compsets. Simply view them as a local file and bring up one of the following files: + +- `models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml `_ -- definition of CLM4.0 namelist items. +- `models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml `_ -- definition of CLM4.0 namelist items. +- `models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml `_ -- default values for CLM4.0 namelist items. +- `models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml `_ -- default values for CLM4.5 namelist items. +- `scripts/ccsm_utils/Case.template/config_definition.xml `_ -- definition of all env_*.xml items. +- `scripts/ccsm_utils/Case.template/config_compsets.xml `_ -- definition of all the compsets. +- `models/lnd/clm/bld/namelist_files/history_fields_clm4_0.xml `_ -- definition of CLM4.0 history fields. +- `models/lnd/clm/bld/namelist_files/history_fields_clm4_5.xml `_ -- definition of CLM4.5 history fields. + +------------------------ +Reporting bugs in CLM4.5 +------------------------ + +If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for CLM4.5 in CESM1.2.0 is in the models/lnd/clm/doc/KnownBugs file, and the list of issues for CESM1.2.0 is at... +`http://www.cesm.ucar.edu/models/cesm1.2//tags/cesm1_2_0/#PROBLEMS `_. + +--------------------------------------- +Some Acronym's and Terms We'll be Using +--------------------------------------- + +CAM + Community Atmosphere Model (CAM). The prognostically active atmosphere model component of CESM. + +CESM + Community Earth System Model (CESM). The coupled earth system model that CLM is a component of. + +CLM + Community Land Model (CLM). The prognostically active land model component of CESM. + +CLMBGC + Community Land Model (CLM4.5) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="phys clm4_5 -bgc cn -vsoilc_centbgc on -clm4me on"`` + +CLMCN + Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or CLM4.5) The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="-bgc cn" -append`` + +CLMSP + Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or CLM4.5) The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="-bgc none" -append`` + +CLMU + Community Land Model (CLM) Urban Model (either CLM4.0 or CLM4.5). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). + +CRUNCEP + The Climate Research Unit (CRU) analysis of the NCEP atmosphere reanalysis atmosphere forcing data. This can be used to drive CLM with atmosphere forcing from 1901 to 2010. We also DO expect to be able to update this dataset beyond 2010 as newer data becomes available. + +DATM + Data Atmosphere Model (DATM) the prescribed data atmosphere component for CESM. Forcing data that we provide are either the Qian or CRUNCEP forcing datasets (see below). + +DV + Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either CLM4.5-BGC or CLMCN for either CLM4.0 or CLM4.5). The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="-bgc cndv" -append`` + +ESMF + Earth System Modeling Framework (ESMF). They are a software project that provides a software library to support Earth System modeling. We provide interfaces for ESMF as well as use their regridding capabilities for offline CLM tools. + +NCAR + National Center for Atmospheric Research (NCAR). This is the research facility that maintains CLM with contributions from other national labs and Universities. + +NCEP + The National Center for Environmental Prediction (NCEP). In this document this normally refers to the reanalysis atmosphere data produced by NCEP. + +PFT + Plant Function Type (PFT). A type of vegetation that CLM parameterizes. + +PTCLM + PoinT CLM (PTCLM) a python script that operates on top of CLM for CLM4.5 to run single point simulations for CLM. + +Qian + The Qian et. al. analysis of the NCEP forcing data. This can be used to drive CLM with atmosphere forcing from 1948 to 2004. We do NOT expect to be able to update this dataset beyond 2004. + +SCRIP + Spherical Coordinate Remapping and Interpolation Package (SCRIP). We use it's file format for specifying both grid coordinates as well as mapping between different grids. + +VIC + Variable Infiltration Capacity (VIC) model for hydrology. This is an option to CLM4.5 in place of the standard CLM4.5 hydrology. The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="-vichydro on" -append`` diff --git a/doc/source/users_guide/overview/index.rst b/doc/source/users_guide/overview/index.rst new file mode 100644 index 0000000000..1f31037460 --- /dev/null +++ b/doc/source/users_guide/overview/index.rst @@ -0,0 +1,18 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _overview_section: + +##################################### +Overview +##################################### + +.. toctree:: + :maxdepth: 2 + + introduction.rst + quickstart.rst + scientific_validation.rst + getting-help.rst diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst new file mode 100644 index 0000000000..37eb0cb82d --- /dev/null +++ b/doc/source/users_guide/overview/introduction.rst @@ -0,0 +1,199 @@ +.. _introduction: + +============== +Introduction +============== + +The Community Land Model (CLM4.5 in CESM1.2.0) is the latest in a +series of global land models developed by t he CESM Land Model Working +Group (LMWG) and maintained at the National Center for Atmospheric +Research (NCAR). This guide is intended to instruct both the novice +and experienced user on running CLM. This guide pertains to the latest +version CLM4.5 in CESM1.2.0 available for download from the public +release subversion repository as a part of CESM1.2.0. Documentation +may be different if you are using an older version, you should either +use the documentation for that release version, update to the latest +version, or use the documentation inside your own source tree. There +is information in the ChangeLog file and in the `What is new with +CLM4.5 in CESM1.2.0 since previous public releases? `_ +regarding the changes from previous versions of CESM. + +.. note:: This release of CLM4.5 in CESM1.2.0 includes BOTH CLM4.0 + physics used in previous releases as well as the updated CLM4.5 + physics. Both CLM as well as CLM support tools allow you to trigger + between the two physics modes. Most often when we refer to CLM4.0 we + are referring to the CLM4.0 physics in CLM4.5 in CESM1.2.0 rather + than to a specific version of CLM4.0 (where we would give the exact + version). Likewise, when referring to CLM4.5 we are referring to the + CLM4.5 physics in CLM4.5 in CESM1.2.0. + +The novice user should read `Chapter 1 `_ in detail before +beginning work, while the expert user should read `What is new with +CLM4.5 in CESM1.2.0 since previous public releases? `_ and +`Quickstart to using CLM4.5 `_ chapters, and then use the +more detailed chapters as reference. Before novice users go onto more +technical problems covered in `Chapter 2 `_, `Chapter 3 +`_, `Chapter 4 `_, or `Chapter 5 `_ they +should know the material covered in `Chapter 1 `_ and be able +to replicate some of the examples given there. + +All users should read the `How to Use This Document `_ and +`Other resources to get help from `_ sections to understand +the document conventions and the various ways of getting help on using +CLM4.5. Users should also read the `What is scientifically validated +and functional in CLM4.5 in CESM1.2.0? `_ section to see if +their planned use of the model is something that has been +scientifically validated and well tested. Users that are NOT using +NCAR machines or our list of well tested machines should also read the +What are the UNIX utilities required to use CLM4.5? section to make +sure they have all the required UNIX utilities on the system they want +to do their work. + +Developers that are making changes to CLM either for their own +development or for development that they hope will eventually become a +part of the main CLM should read the `Chapter 8 `_ +chapter. We have a suite of test scripts that automatically test many +different model configurations and namelist options, as well as +ensuring things like restarts are bit-for-bit and the like. It's +helpful to use these scripts to ensure your changes are working +correctly. As well as being a required part of the process to bring in +new code developments. And it's far easier to use the automated +scripts rather than having to figure out, what to test, how to do it, +and then finally do it by hand. If you are using non supported +machines you may also want to use the test scripts to make sure your +machine is working correctly. + +.. _what-is-new-with-clm4.5: + +========================= + What is New with CLM4.5 +========================= + +The CESM1.2.0 `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. +More details are given in the `CLM ChangeLog file `_. + +Previous release pages give similar list of changes for previous versions of the model. +The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates for versions up to CLM4 in CESM1.0.5. + +.. _users-guide-overview: + +========================== + Overview of User's Guide +========================== + +In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. +The next section `What is new with CLM4.5 in CESM1.2.0 since previous public releases? `_ gives references to describe the differences between CLM4.5 in CESM1.2.0 and previous CESM releases both from a scientific as well as a software engineering point of view. +For information on previous releases of CLM4.5 before CLM4.5 in CESM1.2.0 see the CESM1.1.1 documentation. +The next section `Quickstart to using CLM4.5 `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use CLM4.5. +The next `What is scientifically validated and functional in CLM4.5 in CESM1.2.0? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. +`What are the UNIX utilities required to use CLM4.5? `_ lists the UNIX utilities required to use CLM4.5 and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. +Next we have `Important Notes and Best Practices for Usage of CLM4.5 `_ to detail some of the best practices for using CLM4.5 for science. +The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and CLM4.5. + +`Chapter 1 `_ goes into detail on how to setup and run simulations with CLM4.5 and especially how to customize cases. +Details of cesm_setup modes and build-namelist options as well as namelist options are given in this chapter. + +`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or CLM4.5 physics for creating input datasets for use by CLM, for the expert user. +There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. +Then each tool is described in detail along with different ways in which the tool might be used. +A final section on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. + +As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. +This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and CLM4.5 physics). + +In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. +For example, we give the protocol for spinning up the CLM4.5-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). +We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. +We also give instructions on running both the prognostic crop and irrigation models. +Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. + +`Chapter 5 `_ outlines how to do single-point or regional simulations using CLM4.5. +This is useful to either compare CLM4.5 simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. +There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into `Chapter 2 `_ and also `Chapter 3 `_ to add the files into the build-namelist XML database. +The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). +CLM4 in CESM1.0.5 has a fully working versions of PTCLM. + +Need `Chapter 6 `_ blurb... + +`Chapter 7 `_ gives some guidance on trouble-shooting problems when using CLM4.5. +It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. + +`Chapter 8 `_ goes over the automated testing scripts for validating that the CLM is working correctly. +The test scripts run many different configurations and options with CLM4.0 physics as well and CLM4.5 physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. +In general this is an activity important only for a developer of CLM4.5, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. + +In the appendices we talk about some issues that are useful for advanced users and developers of CLM4.5. + +Finally in `Appendix A `_ we give instructions on how to build the documentation associated with CLM4.5 (i.e. how to build this document). +This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. +This also could be useful for developers who need to update the documentation due to changes they have made. + +.. _best-practices-for-usage: + +================ + Best Practices +================ + +- CLM4.5 includes BOTH the old CLM4.0 physics AND the new CLM4.5 physics and you can toggle between two. + The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. + While the "standard" practice for CLM4.5 is to run with BGC on, and CRUNCEP atmospheric forcing. + "BGC" is the new CLM4.5 biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). + +- When running with CLMCN (either CLM4.0 or CLM4.5 physics) or CLM4.5-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for CLM4.5 or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). + Simulations without a proper spinup will effectively be starting from an unvegetated world. + See `the Section called Setting Your Initial Conditions File in Chapter 1 `_ for information on how to provide initial conditions for your simulation. + +- Initial condition files are provided for CLM4.0-CN as before, for fully coupled BCN and offline ICN cases for 1850 and 2000 at finite volume grids: 1deg (0.9x1.25), 2deg (1.9x2.5), and T31 resolutions. + We also have interpolated initial conditions for BCN for 1850 and 2000 for two finite volume grids: 10x15, 4x5 and two HOMME grids (ne30np4 and ne120np4). + There's also an initial condition file for ICN with the prognostic crop model for 2000 at 2deg resolution, and one with CLMSP for 2000 at 2deg resolution. + We also have initial conditions for offline CNDV for 1850. + The 1850 initial condition files are in 'reasonable' equilibrium. + The 2000 initial condition files represent the model state for the year 2000, and have been taken from transient simulations. + Therefore, by design the year 2000 initial condition files do not represent an equilibrium state. + Note also that spinning the 2000 initial conditions out to equilibrium will not reflect the best estimate of the real carbon/nitrogen state for the year 2000. + +- Initial condition files are also provided for CLM4.5 for several configurations and resolutions. + For CLM4.5-SP and CLM4.5-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. + The CLM4.5-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. + Also the CLM4.5-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg CLM4.5-BGC-DV and 2deg CLM4.5-BGC-Crop. + +- Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. + Interpolated initial condition files may no longer be in 'reasonable' equilibrium. + +- In CLM4.5 for both CLM4.5-CN and CLM4.5-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). + By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. + Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. + If you are running with an atmosphere model or forcing that is significantly different than present day -- the lightning frequency may NOT appropriately correspond to your atmosphere forcing and fire initiation would be inappropriate. + +- Aerosol deposition is a required field to both CLM4.0 and CLM4.5 physics, sent from the atmosphere model. + Simulations without aerosol deposition will exhibit unreasonably high snow albedos. + The model sends aerosol deposition from the atmospheric model (either CAM or DATM). + When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. + +.. _how-to-use-this-document: + +======================================================== +How To Use This Document +======================================================== + +Links to descriptions and definitions have been provided in the code below. We use the same conventions used in the CESM documentation as outlined below. + +:: + + Throughout the document this style is used to indicate shell + commands and options, fragments of code, namelist variables, etc. + Where examples from an interactive shell session are presented, lines + starting with > indicate the shell prompt. A backslash "\" at the end + of a line means the line continues onto the next one (as it does in + standard UNIX shell). Note that $EDITOR" is used to refer to the + text editor of your choice. $EDITOR is a standard UNIX environment + variable and should be set on most UNIX systems. Comment lines are + signaled with a "#" sign, which is the standard UNIX comment sign as well. + $CSMDATA is used to denote the path to the inputdata directory for + your CESM data. + + > This is a shell prompt with commands \ + that continues to the following line. + > $EDITOR filename # means you are using a text editor to edit "filename" + # This is a comment line + diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst new file mode 100644 index 0000000000..f6784da2ef --- /dev/null +++ b/doc/source/users_guide/overview/quickstart.rst @@ -0,0 +1,114 @@ +.. _quickstart: + +============ + Quickstart +============ + +Running the CLM requires a suite of UNIX utilities and programs and you should make sure you have all of these available before trying to go forward with using it. +If you are missing one of these you should contact the systems administrator for the machine you wish to run on and make sure they are installed. + +List of utilities required for CESM in the "CESM1.2.0 Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ +- UNIX bash shell (for some of the CLM tools scripts) +- NCL (for some of the offline tools for creating/modifying CLM input datasets see `Chapter 2 `_ for more information on NCL) +- Python (optional, needed for PTCLM) +- xsltproc, docbook and docbook utilities (optional, needed to build the Users-Guide) + +Before working with CLM4.5 read the QuickStart Guide in the `CESM1.2.0 Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. + +For some of the details of setting up cases for CLM4.5 read the README and text files available from the "models/lnd/clm/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. + +1. `README file `_ describing the directory structure. + +2. `Quickstart.userdatasets `_ file describing how to use your own datasets in the model (also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_). + +3. `models/lnd/clm/doc/KnownBugs `_ file describing known problems in CLM4.5 (that we expect to eventually fix). + +4. `models/lnd/clm/doc/KnownLimitationss `_ file describing known limitations in CLM4.5 and workarounds that we do NOT expect to fix. + +The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in CLM4.5 in CESM1.2.0?" `_. + +The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with CLM4.5 in CESM1.2.0 since previous public releases?" `_. + +Note other directories have README files that explain different components and tools used when running CLM and are useful in understanding how those parts of the model work and should be consulted when using tools in those directories. For more details on configuring and customizing a case with CLM see `Chapter 1 `_. + +The Quickstart.GUIDE (which can be found in ``models/lnd/clm/doc``) is repeated here. +:: + + Quick-Start to Using cpl7 Scripts for clm4_5 + + Assumptions: You want to use yellowstone with clm4_5 BGC + to do a clm simulation with data atmosphere and the + latest CRUNCEP atm forcing files and settings. You also want to cycle + the CRUNCEP atm data between 1901 to 1920 and you want to run at + 0.9x1.25 degree resolution. + + Process: + + # Create the case + + cd scripts + + ./create_newcase -case -mach yellowstone_intel -res f09_g16 -compset I1850CRUCLM45BGC + (./create_newcase -help -- to get help on the script) + + # Setup the case + + cd + ./xmlchange id1=val1,id2=val2 # to make changes to any settings in the env_*.xml files + ./cesm_setup + (./cesm_setup -help -- to get help on the script, this creates the ./.run \ + script) + + # Add any namelist changes to the user_nl_* files + + $EDITOR user_nl_* + + # Compile the code + + ./.build + + # Submit the run + + ./.submit + +Information on Compsets: + + "I" compsets are the ones with clm and datm7 without ice and ocean. They + specify either CLM4.0 physics or CLM4.5 physics. + Most of the "I" compsets for CLM4.0 use the CLM_QIAN data with solar following + the cosine of solar zenith angle, precipitation constant, and other + variables linear interpolated in time (and with appropriate time-stamps on + the date). Useful "I" compsets for CLM4.5 use the CRUNCEP data in place + of the CLM_QIAN data. + + To list all the compsets use: + ./create_newcase -list compsets + + Some of the CLM4.5 I compsets are: + + Alias Description + 1850CRUCLM45 CLM4.5 to simulate year=1850 with CLMN45SP (Satellite Phenology) + I1850CRUCLM45BGC CLM4.5 to simulate year=1850 with CLM45BGC biogeophysics model (BGC) + I20TRCRUCLM45BGC CLM4.5 with BGC on with transient PFT over 1850-2000 + + While some of the CLM4 I compsets are: + + Alias Description + ICN CLM4.0 to simulate year=2000 with Carbon-Nitrogen BGC model (CN) + I1850CN CLM4.0 to simulate year=1850 with Carbon-Nitrogen BGC model (CN) + I20TRCN CLM4.0 with CN on with transient PFT over 1850-2000 + IRCP26CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=2.6 scenario + IRCP45CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=4.5 scenario + IRCP60CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=6.0 scenario + IRCP85CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=8.5 scenario + +Automatically resubmitting jobs: + + After doing a short simulation that you believe is correct + + ./xmlchange CONTINUE_RUN=TRUE + + # Change RESUBMIT to number greater than 0, and CONTINUE_RUN to TRUE... + + ./.submit + diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst new file mode 100644 index 0000000000..6ad113adc5 --- /dev/null +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -0,0 +1,78 @@ +.. _scientific-validiation: + +======================== + Scientific Validiation +======================== + +In this section we go over what has been extensively tested and scientifically validated with CLM4.5, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. + +-------------------------------------------------------------- +Standard Configuration and Namelist Options that are Validated +-------------------------------------------------------------- + +See +`http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for CLM4.5. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. + +In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for CLM4.5 while others are for both CLM4.0 AND CLM4.5 we explicitly say which they apply to. + +--------------------------------------------------------------------------------------------------------------- +Configure Modes NOT scientifically validated, documented, supported or, in some cases, even advised to be used: +--------------------------------------------------------------------------------------------------------------- + +These are options that you would add to ``CLM_CONFIG_OPTS``. + +1. exlaklayers on[CLM4.5 only] This mode is NOT tested and may NOT be even functional. + +2. snicar_frc on[CLM4.0 AND CLM4.5] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. + +3. vichydro on[CLM4.5 only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. + +4. vsoilc_centbgc[CLM4.5 only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `models/lnd/clm/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. + +---------------------------------------------- +Namelist options that should NOT be exercised: +---------------------------------------------- + +---------------------------------------------------- +Build-Namelist options that should NOT be exercised: +---------------------------------------------------- +1. -irrig with -bgc cn and -phys clm4_0 We have only run the irrigation model with CLMSP (i.e. without the CN model). We recommend that if you want to run the irrigation model with CN, that you do a spinup. But, more than that you may need to make adjustments to irrig_factor in models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90. See the notes on this in the description of the irrigation model in the +`Technical Descriptions of the Interactive Crop Management and Interactive Irrigation Models `_. + +2. -irrig with -crop on and -phys clm4_0 Irrigation doesn't work with the prognostic crop model. Irrigation is only applied to generic crop currently, which negates it's practical usage. We also have a known problem when both are on (see bug 1326 in the `models/lnd/clm/doc/KnownBugs `_ file). If you try to run in this mode, the CLM build-namelist will return with an error. + +-------------------------------------------- +Namelist items that should NOT be exercised: +-------------------------------------------- + +suplnitro='ALL' The suplnitro namelist option to the CN Biogeochemistry model supplies unlimited nitrogen and therefore vegetation is over-productive in this mode. + +urban_traffic:Not currently functional + +allowlakeprod:Considered experimental. + +anoxia_wtsat:Considered experimental (deprecated will be removed). + +atm_c14_filename:Considered experimental (dataset not provided). + +exponential_rooting_profile:Considered experimental. + +fin_use_fsat:Considered experimental. + +glc_dyntopo:Not currently functional. + +lake_decomp_fact:Considered experimental. + +more_vertlayers:Considered experimental. + +no_frozen_nitrif_denitrif:Considered experimental. + +perchroot:Considered experimental. + +perchroot_alt:Considered experimental. + +replenishlakec:Considered experimental. + +use_c14_bombspike:Considered experimental (dataset not provided). + +usefrootc:Considered experimental. diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst new file mode 100644 index 0000000000..81f45a038f --- /dev/null +++ b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst @@ -0,0 +1,109 @@ +.. _adding-ptclm-site-data: + +====================== +Adding PTCLM Site Data +====================== + +The "sitegroupname" option to PTCLM1.110726 looks for groups of sites in the files in the ``PTCLM_sitedata`` directory under the PTCLM directory. +You can add new names available for this option including your own lists of sites, by adding more files in this directory. +There are three files for each "sitegroupname": ``$SITEGROUP_sitedata.txt``, ``$SITEGROUP_soildata.txt`` and ``$SITEGROUP_pftdata.txt`` (where ``$SITEGROUP`` is the name that would be entered as "sitegroupname" to PTCLM). +Each file needs to have the same list of sites, but gives different information: site data, PFT data, and soil data respectively. +Although the site codes need to be the same between the three files, the files do NOT have to be in the same order. +Each file has a one-line header that lists the contents of each column which are separated by commas. +The first column for each of the files is the "site_code" which must be consistent between the three files. +The site code can be any unique character string, but in general we use the AmeriFlux site code. + +Site data file:`` $SITEGROUP_sitedata.txt``): The header for this file is: +:: + + site_code,name,state,lon,lat,elev,startyear,endyear,alignyear + +The columns: name, state, and elevation are informational only. Name is a longer descriptive name of the site, and state is the state for U.S. sites or country for non U.S. sites. The columns: lon and lat are the longitude and latitude of the location in decimal degrees. The last three columns are the start and ending year for the data and the align year for an 1850 case for the data. The align year is currently unused. + +Soil data file: ``$SITEGROUP_soildata.txt``): The header for this file is: +:: + + site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% + +The first three fields after "site_code" are currently unused. The only two that are used are the percent sand and clay columns to set the soil texture. + +PFT data file: ``$SITEGROUP_pftdata.txt```): The header for this file is: +:: + + site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 + +This file gives the vegetation coverage for the different vegetation types for the site. The file only supports up to five PFT's at the same time. The columns with "pft_f" are the fractions for each PFT, and the columns with "pft_c" is the integer index of the given PFT. Look at the pft-physiology file to see what the PFT index for each PFT type is. + +---------------------------------------------- +Dynamic Land-Use Change Files for use by PTCLM +---------------------------------------------- + +There is a mechanism for giving site-specific land-use change in PTCLM. Adding site specific files to the ``PTCLM_sitedata`` directory under PTCLM allows you to specify the change in vegetation and change in harvesting (for the CN model) for that site. Files are named: ``$SITE_dynpftdata.txt``. There is a sample file for the US-Ha1 site called: ``US-Ha1_dynpftdata.txt``. The file has a one-line header with the information that the file has, and then one-line for each year with a transition. The header line is as follows: +:: + + trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze + +This file only requires a line for each year where a transition or harvest happens. As in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the PFT index, and only up to five vegetation types are allowed to co-exist. The last eight columns have to do with harvesting and grazing. The last two columns are whether to hold harvesting and/or grazing constant until the next transition year and will just be either 1 or 0. This file will be converted by the **PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl** script in the PTCLM directory to a format that **mksurfdata_map** can read that has an entry for each year for the range of years valid for the compset in question. + +------------------------------------------ +Converting AmeriFlux Data for use by PTCLM +------------------------------------------ + +AmeriFlux data comes in comma separated format and is available from: +`http://public.ornl.gov/ameriflux/dataproducts.shtml `_. Before you download the data you need to agree to the usage terms. + +Here is a copy of the usage terms from the web-site on June/13/2011. + +"The AmeriFlux data provided on this site are freely available and were furnished by individual AmeriFlux scientists who encourage their use. +Please kindly inform the appropriate AmeriFlux scientist(s) of how you are using the data and of any publication plans. +Please acknowledge the data source as a citation or in the acknowledgments if the data are not yet published. +If the AmeriFlux Principal Investigators (PIs) feel that they should be acknowledged or offered participation as authors, they will let you know and we assume that an agreement on such matters will be reached before publishing and/or use of the data for publication. +If your work directly competes with the PI's analysis they may ask that they have the opportunity to submit a manuscript before you submit one that uses unpublished data. +In addition, when publishing, please acknowledge the agency that supported the research. +Lastly, we kindly request that those publishing papers using AmeriFlux data provide preprints to the PIs providing the data and to the data archive at the Carbon Dioxide Information Analysis Center (CDIAC)." + +The above agreement applies to the "US-UMB" dataset imported into our repository as well, and Gil Bohrer is the PI on record for that dataset. + + +The CESM can NOT handle missing data, so we recommend using the "Level 4" Gap filled datasets. +The fields will also need to be renamed. +The "WS" column becomes "WIND", "PREC" becomes "PRECmms", "RH" stays as "RH", "TA" becomes "TBOT", "Rg" becomes "FSDS", "Rgl" becomes "FLDS", "PRESS" becomes "PSRF". +"ZBOT" can just be set to the constant of "30" (m). +The units of Temperature need to be converted from "Celsius" to "Kelvin" (use the value in ``SHR_CONST_TKFRZ`` in the file ``models/csm_share/shr/shr_const.F90`` of ``273.15``. +The units of Pressure also need to be converted from "kPa" to "Pa". LATIXY, and LONGXY should also be set to the latitude and longitude of the site. + + +----------------------------------------------------------- +Example: PTCLM transient example over a shorter time period +----------------------------------------------------------- + +This is an example of using PTCLM for Harvard Forest (AmeriFlux site code US-Ha1) for transient land use 1991-2006. +In order to do this we would've needed to have converted the AmeriFlux data into NetCDF format as show in the `the Section called Converting AmeriFlux Data for use by PTCLM `_ section above. +Also note that this site has a site-specific dynamic land-use change file for it ``PTCLM_sitedata/US-Ha1_dynpftdata.txt`` in the PTCLM directory and this file will be used for land-use change and harvesting rather than the global dataset. + +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + # We are going to use forcing data over 1991 to 2006, but we need to start with + # a transient compset to do so, so we use the 20th Century transient: 1850-2000 + # Note: When creating the fpftdyn dataset for this site it will use the + # PTCLM_sitedata/US-Ha1_dynpftdata.txt + # file for land-use change and harvesting + > ./PTCLM.py -m yellowstone_intel -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux -c I20TRCRUCLM45BGC + > mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 + > cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 + # Copy data in NetCDF format to this directory, filenames should be YYYY-MM.nc + # The fieldnames on the file should be: + # FLDS,FSDS,LATIXY, LONGXY, PRECTmms,PSRF,RH,TBOT,WIND,ZBOT + # With units + # W/m2,W/m2,degrees_N,degrees_E,mm/s, Pa, %, K, m/s, m + # The time coordinate units should be: days since YYYY-MM-DD 00:00:00 + > cd ../../../../../US-Ha1_I20TRCRUCLM45BGC + # Now we need to set the start date to 1991, and make sure the align year is for 1991 + > ./xmlchange RUN_STARTDATE=1991-01-01,DATM_CLMNCEP_YR_ALIGN=1991 + # Similarly for Nitrogen deposition data we cycle over: 1991 to 2006 + > cat << EOF >> user_nl_clm + model_year_align_ndep=1991,stream_year_first_ndep=1991,stream_year_last_ndep=2006 + EOF + # Now setup the case, and we'll edit the datm namelist for prescribed aerosols + > ./cesm_setup diff --git a/doc/source/users_guide/running-PTCLM/index.rst b/doc/source/users_guide/running-PTCLM/index.rst new file mode 100644 index 0000000000..d82b7f9624 --- /dev/null +++ b/doc/source/users_guide/running-PTCLM/index.rst @@ -0,0 +1,18 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _running-PTCLM: + +##################################### +Running PTCLM +##################################### + +.. toctree:: + :maxdepth: 2 + + introduction-to-ptclm.rst + using-ptclm.rst + ptclm-examples.rst + adding-ptclm-site-data.rst diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst new file mode 100644 index 0000000000..f710ed0bb4 --- /dev/null +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -0,0 +1,139 @@ +.. _introduction-to-ptclm.rst: + +.. _what-is-ptclm: + +=============== + What is PTCLM +=============== + +PTCLM (pronounced either as point clime or Pee-Tee clime) is a Python script to help you set up PoinT CLM simulations. + +It runs the CLM tools for you to get datasets set up, and copies them to a location you can use them according to the ``CLM_USRDAT_NAME`` naming convention. + +Then it runs **create_newcase** for you and modifies the env settings and namelist appropriately. + +PTCLM has a simple ASCII text file for storing basic information for your sites. + +We also have complete lists for AmeriFlux and Fluxnet-Canada sites, although we only have the meteorology data for one site. + +For other sites you will need to obtain the meteorology data and translate it to a format that the CESM datm model can use. + +But, even without meteorology data PTCLM is useful to setup datasets to run with standard ``CLM_QIAN`` data. + +The original authors of PTCLM are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) and R. Quinn Thomas at Cornell University. It was then modified fairly extensively by Erik Kluzek at NCAR. We want to thank all of these individuals for this contribution to the CESM effort. We also want to thank the folks at University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet station data and import it into our inputdata repository, especially Gil Bohrer the PI on record for this site. + + +.. _details-of-ptclm: + +================== + Details of PTCLM +================== + +To get help on PTCLM1.110726 use the "--help" option as follows. +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > ./PTCLM.py --help + +The output to the above command is as follows: +:: + + Usage: PTCLM.py [options] -d inputdatadir -m machine -s sitename + + Python script to create cases to run single point simulations with tower site data. + + Options: + --version show program's version number and exit + -h, --help show this help message and exit + + Required Options: + -d CCSM_INPUT, --csmdata=CCSM_INPUT + Location of CCSM input data + -m MYMACHINE, --machine=MYMACHINE + Machine, valid CESM script machine (-m list to list valid + machines) + -s MYSITE, --site=MYSITE + Site-code to run, FLUXNET code or CLM1PT name (-s list to list + valid names) + + Configure and Run Options: + -c MYCOMPSET, --compset=MYCOMPSET + Compset for CCSM simulation (Must be a valid 'I' compset [other + than IG compsets], use -c list to list valid compsets) + --coldstart Do a coldstart with arbitrary initial conditions + --caseidprefix=MYCASEID + Unique identifier to include as a prefix to the case name + --cesm_root=BASE_CESM + Root CESM directory (top level directory with models and scripts + subdirs) + --debug Flag to turn on debug mode so won't run, but display what would + happen + --finidat=FINIDAT Name of finidat initial conditions file to start CLM from + --list List all valid: sites, compsets, and machines + --namelist=NAMELIST + List of namelist items to add to CLM namelist (example: + --namelist="hist_fincl1='TG',hist_nhtfrq=-1" + --QIAN_tower_yrs Use the QIAN forcing data year that correspond to the tower + years + --rmold Remove the old case directory before starting + --run_n=MYRUN_N Number of time units to run simulation + --run_units=MYRUN_UNITS + Time units to run simulation (steps,days,years, etc.) + --quiet Print minimul information on what the script is doing + --sitegroupname=SITEGROUP + Name of the group of sites to search for you selected site in + (look for prefix group names in the PTCLM_sitedata directory) + --stdurbpt If you want to setup for standard urban namelist settings + --useQIAN use QIAN input forcing data instead of tower site meterology data + --verbose Print out extra information on what the script is doing + + Input data generation options: + These are options having to do with generation of input datasets. Note: When + running for supported CLM1PT single-point datasets you can NOT generate new + datasets. For supported CLM1PT single-point datasets, you MUST run with the + following settings: --nopointdata And you must NOT set any of these: --soilgrid + --pftgrid --owritesrf + + --nopointdata Do NOT make point data (use data already created) + --owritesrf Overwrite the existing surface datasets if they exist (normally + do NOT recreate them) + --pftgrid Use pft information from global gridded file (rather than site + data) + --soilgrid Use soil information from global gridded file (rather than site + data) + + Main Script Version Id: $Id: PTCLM.py 47576 2013-05-29 19:11:16Z erik $ Scripts URL: $HeadURL: https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM1_130529/PTCLM.py $: + +Here we give a simple example of using PTCLM1 for a straightforward case of running at the US-UMB Fluxnet site on yellowstone where we already have the meteorology data on the machine. +Note, see `the Section called Converting AmeriFlux Data for use by PTCLM `_ for permission information to use this data. + +Example 6-1. Example of running PTCLM1 for US-UMB on yellowstone +---------------------------------------------------------------- + +:: + + > setenv CSMDATA $CESMDATAROOT/inputdata + > setenv MYCSMDATA $HOME/inputdata + > setenv SITE US-UMB + > setenv MYMACH yellowstone_intel + > setenv MYCASE testPTCLM + # First link the standard input files to a location you have write access + > cd scripts + > ./link_dirtree $CSMDATA $MYCSMDATA + + # Next build all of the clm tools you will need + > cd ../models/lnd/clm/tools/clm4_5/mksurfdata_map + > gmake + > gmake clean + > cd ../../../../../../tools/mapping/gen_domain_files/src + > ../../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > gmake + > gmake clean + # next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) + > cd ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > ./PTCLM.py -m $MYMACH --case=$MYCASE --site=$SITE --csmdata=$MYCSMDATA --aerdepgrid --ndepgrid + # NOTE: we use --aerdepgrid --ndepgrid so that you use the global + # aerosol and Nitrogen deposition files rather than site-specific ones. + > cd ../../../../../$MYCASE + # Finally setup, build, and run the case as normal + diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst new file mode 100644 index 0000000000..e9a887e89c --- /dev/null +++ b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst @@ -0,0 +1,70 @@ +.. _ptclm-examples: + +========================= + Examples of using PTCLM +========================= + +Now let's give a few more complex examples using some of the options we have discussed above. + +In this first example, we'll demonstrate using a supported single point dataset, which then requires using the "nopointdata". We'll also demonstrate the compset option, "stdurbpt" and "caseidprefix" options. + +Example: Running PTCLM for the Mexicocity supported single point dataset +------------------------------------------------------------------------ +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > ./PTCLM.py -m yellowstone_intel -s 1x1_mexicocityMEX -d $CSMDATA --nopointdata \ + --stdurbpt -c ICRUCLM45 --caseidprefix `pwd`/myPTCLMcases/site + > cd myPTCLMcases/site_1x1_mexicocityMEX_I + > ./cesm_setup + # Now build and run normally + > ./site_1x1_mexicocityMEX_I.build + # Here we show running interactively + > ./site_1x1_mexicocityMEX_I.run + +Now, let's demonstrate using a different group list, doing a spinup, running with Qian global forcing data, but using tower years to set the years to run over. This uses the options: sitegroupname, useQIAN, and QIANtower_years. + +Example: Running PTCLM for a spinup simulation with Qian data for tower years. +------------------------------------------------------------------------------ +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > ./PTCLM.py -m yellowstone_intel -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --useQIAN --QIAN_tower_yrs + > cd ../../../../../US-Ha1_ICRUCLM45BGC_QIAN + > ./cesm_setup + # Now build and run normally + > ./US-Ha1_ICRUCLM45BGC_QIAN.build + # Here we show running interactively + > ./US-Ha1_ICRUCLM45BGC_QIAN.run + ``` + +Finally, let's demonstrate using a generic machine (which then requires the scratchroot option), using the global grid for PFT and soil types, and setting the run length to two months. + +Example: Running PTCLM on a user-defined machine with global PFT and soil types dataset +--------------------------------------------------------------------------------------- +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + # Note, see the the Section called Converting AmeriFlux Data for use by PTCLM with permission information + # to use the US-UMB data. + > ./PTCLM.py -m userdefined_intel -s US-UMB -d $CSMDATA --pftgrid --soilgrid \ + --scratchroot $HOME --run_n 2 --run_units nmonths + > cd ../../../../../US-UMB_ICRUCLM45BGC + # If userdefined is NOT set up for you Uncomment the following and set OS, NTASKS_PER_NODE, TMPDIR + # > ./xmlchange OS=$OS,MAX_TASKS_PER_NODE=$NTASKS_PER_NODE,MPILIB=mpi-serial + # > ./xmlchange RUNDIR=$TMPDIR/$USER/\$CASE/run,DIN_LOC_ROOT=$CSMDATA,COMPILER=intel + # > ./xmlchange EXEROOT=$TMPDIR/$USER/\$CASE + > ./cesm_setup + # Now build + > ./US-UMB_ICRUCLM45BGC.userdefined_intel.build + # To get the files from the svn server... + # First list the files from the streams text file + > ../ccsm_utils/Tools/listfilesin_streams \ + -t $HOME/US-UMB_ICRUCLM45BGC/run/clm1PT.1x1pt_US-UMB.stream.txt -l \ + > Buildconf/datm.input_data_list + # And now run the script to export data to your machine + > ../ccsm_utils/Tools/check_input_data -export + # Here we show running interactively + > ./US-UMB_ICRUCLM45BGC.userdefined_intel.run + +.. warning: Because of Bug 1364, when running this case as above we get a floating point error after reaching time-step 124 for the example exactly as above. Other machines or compilers probably won't have this problem. See the `models/lnd/clm/doc/KnownBugs `_ file for more information on this problem. diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst new file mode 100644 index 0000000000..b644337239 --- /dev/null +++ b/doc/source/users_guide/running-PTCLM/using-ptclm.rst @@ -0,0 +1,222 @@ +.. _using-ptclm.rst: + +************************** +Using PTCLM +************************** + +There are three types of options to PTCLM1: required, setup/run-time, and dataset generation options. +The three required options are the three settings that MUST be specified for PTCLM to work at all. The other settings have default values that will default to something useful. The setup/run-time options control how the simulation will be setup and run. The dataset generation options control the generation of datasets needed when PTCLM is run. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash (such as -m instead of --machine). + +The required options to PTCLM are: inputdata directory (-d), machine (-m) and site-name (-s). +Inputdata directory is the directory where you have the CESM inputdata files, you need to have write access to this directory, so if you are running on a machine that you do NOT have write access to the standard inputdata location (such as NCAR yellowstone or LBNL hopper) you need to link the standard files to a location you do have control over. We recommend using the ``scripts/link_dirtree`` tool to do that. "machine" is the scripts name for the machine/compiler you will be using for your case. And finally site-name is the name of the site that you want to run for. Site-name can either be a valid supported dataset name or a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). + +After PTCLM is run a case directory where you can then setup, build and run your CESM case as normal. +It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLM that were used to create it. + +After "help" the "list" option is one of the most useful options for getting help on using PTCLM. +This option gives you information about some of the other options to PTCLM. To get a list of the machine, sites, and compsets that can be used for PTCLM use the "--list" option as follows. +:: + + > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > ./PTCLM.py --list + +The output to the above command is as follows: +:: + + /bin/sh: line 1: PTCLM.py: command not found + +Steps in running PTCLM +========================= + +1. Setup Inputdata directory with write access (use link_dirtree script) + + You need to setup an inputdata directory where you have write access to it. + Normally, for NCAR machines the data is on an inputdata where the user does NOT have write access to it. + A way that you can get around this is to use the **link_dirtree** script to create softlinks from the normal location to a location you have write access to. + So for example on yellowstone: + :: + + > setenv CSMDATA $CESMDATAROOT/inputdata + > setenv MYCSMDATA $HOME/inputdata + > mkdir $MYCSMDATA + > cd scripts + > ./link_dirtree $CSMDATA $MYCSMDATA + + See `the Section called Managing Your Own Data-files in Chapter 3 `_ for more information on this. + +2. Build the CLM tools + Next you need to make sure all the CLM FORTRAN tools are built. + :: + + > cd models/lnd/clm/tools/clm4_5/mksurfdata_map + > gmake + > gmake clean + > cd ../../../../../../tools/mapping/gen_domain_files/src + > ../../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > gmake + > gmake clean + +3. Run PTCLM + Next you actually run PTCLM1 which does the different things listed below: + + a. PTCLM names your case based on your input + :: + + [Prefix_]SiteCode_Compset[_QIAN] + + Where: + ``Prefix`` is from the caseidprefix option (or blank if not used). + + ``SiteCode`` is the site name you entered with the -s option. + + ``Compset`` is the compset name you entered with the -c option. + + ``_QIAN`` is part of the name only if the useQIAN is used. + + For example, the casename for the following will be: + :: + + > cd scripts + > ./PTCLM.py -m yellowstone_intel -s US-UMB -d $MYCSMDATA -c ICRUCLM45BGC --use QIAN "US-UMB_I_2000_CN_QIAN" + + b. PTCLM creates datasets for you + It will populate $MYCSMDATA with new datasets it creates using the CLM tools. + + c. If a transient compset and PTCLM1 finds a _dynpftdata.txt file + If you are running a transient compset (such as the "I_1850-2000_CN" compset) AND you there is a file in the PTCLM_sitedata directory under the PTCLM directory called $SITE_dynpftdata.txt it will use this file for the land-use changes. + Otherwise it will leave land-use constant, unless you use the pftgrid option so it uses the global dataset for landuse changes. + See the Section called Dynamic Land-Use Change Files for use by PTCLM for more information on this. + There is a sample transient dataset called US-Ha1_dynpftdata.txt. + Transient compsets, are compsets that create transient land-use change and forcing conditions such as: 'I_1850-2000', 'I_1850-2000_CN', 'I_RCP8.5_CN', 'I_RCP6.0_CN', 'I_RCP4.5_CN', or 'I_RCP2.6_CN'. + + d. PTCLM creates a pft-physiology for you + PTCLM1 will create a local copy of the pft-physiology specific for your site that you could then customize with changes specific for that site. + + e. PTCLM creates a README.PTCLM for you + PTCLM1 will create a simple text file with the command line for it in a file called README.PTCLM in the case directory it creates for you. + +4. Customize, setup, build and run case as normal + You then customize your case as you would normally. See the Chapter 1 chapter for more information on doing this. + +PTCLM options +========================= + +Next we discuss the setup and run-time options, dividing them up into setup, initial condition (IC), and run-time options. + +Configure options include: + +- --compset=MYCOMPSET +- --caseidprefix=MYCASEID +- --cesm_root=BASE_CESM +- --namelist=NAMELIST +- --rmold +- --scratchroot=SCRATCHROOT +- --sitegroupname=SITEGROUP +- --QIAN_tower_yrs +- --useQIAN + +``--compset`` + The "-c" option is the most commonly used option after the required options, as it specifies the CESM scripts component set to use with PTCLM1. + The default compset is the "ICN" compset with CN on for present day conditions. + +``--caseidprefix`` + This option gives a prefix to include in the casename when the case is created, in case you want to customize your casenames a bit. + By default, casenames are figured out based on the other options. The argument to this option can either be a name to prefix casenames with and/or a pathname to include. + Hence, if you want cases to appear in a specific directory you can give the pathname to that directory with this option. + +``--cesm_root`` + This option is for running PTCLM1 with a different root directory to CESM than the version PTCLM exists in. Normally you do NOT need to use this option. + +``--namelist`` + This option adds any items given into the CLM user_nl_clm namelist. This allows you to add customizations to the namelist before the clm.buildnml.csh file is created for the case. + +``--rmold`` + This option will remove an old case directory of the same name if one exists. Otherwise, if an old case directory already exists and you try to run PTCLM it will return with an error. + +``--scratchroot`` + This option is ONLY valid when using one of the generic machines (the -m option). This passed onto **create_newcase** and gives the location where cases will be built and run. + +``--sitegroupname`` + In the PTCLM directory there is a subdirectory "PTCLM_sitedata" that contains files with the site, PFT and soil data information for groups of sites. + These site groups are all separate ASCII files with the same prefix followed by a "_*data.txt" name. See `the Section called PTCLM Group Site Lists `_ for more information on these files. By default we have provided three different valid group names: + +EXAMPLE +------- +AmeriFlux + +Fluxnet-Canada + +The EXAMPLE is the group used by default and ONLY includes the US-UMB site as that is the only site we have data provided for. +The other two site groups include the site information for all of both the AmeriFlux and Fluxnet-Canada sites. +You can use the "sitegroupname" option to use one of the other lists, or you can create your own lists using the EXAMPLE file as an example. +Your list of sites could be real world locations or could be theoretical "virtual" sites given to exercise CLM on differing biomes for example. +Note, see `the Section called Converting AmeriFlux Data for use by PTCLM `_ with permission information to use the US-UMB data. + +``--useQIAN`` + This option says to use the standard CLM global Qian T62 atmospheric forcing rather than any tower site forcing data available. Otherwise, PTCLM will try to find tower forcing data for the specific site entered. + +``--QIAN_tower_yrs`` + This option is used with the "useQIAN" option to set the years to cycle over for the Qian data. In this case Qian atmospheric forcing will be used, but the simulation will run over the same years that tower site is available for this site. + +**IC options include:** + +- --coldstart +- --finidat=FINIDAT + +The coldstart option says to startup with OUT an initial condition file, while the finidat option explicitly gives the initial condition file to use. Obviously, the coldstart and finidat options can NOT be used together. + +``--coldstart`` + This option ensures that a cold-start will be done with arbitrary initial conditions. + +``--finidat`` + This option sets the initial condition file to startup the simulation from. + +**Run-time options include:** + +- --debug +- --run_n=MYRUN_N +- --run_units=MYRUN_UNITS +- --stdurbpt +- --debug + +This option tells PTCLM to echo what it would do if it were run, but NOT actually run anything. So it will show you the dataset creation commands it would use. It does however, run **create_newcase**, but then it only displays the **xmlchange** commands and changes that it would do. Also note that if you give the "--rmold" option it won't delete the case directory beforehand. Primarily this is intended for debugging the operation of PTCLM. + +``--run_n`` + This option along with run_units is used to set the length for the simulation. "run_n" is the number of units to use. The default run length depends on the site, compset, and configuration. + +``--run_units`` + This option is the units of time to use for the length of the simulation. It is used along with "run_n" to set the length of the simulation. The default run length depends on the site, compset, and configuration. + +``--stdurbpt`` + This option turns on the "stdurbpt_pd" use-case for CLM_NML_USE_CASE. This option can NOT be used for compsets that set the use-case to something besides present-day. + +**The dataset generation options are:** + +- --pftgrid +- --soilgrid +- --nopointdata +- --owritesrfaer + +The options that with a "grid" suffix all mean to create datasets using the global gridded information rather than using the site specific point data. By default the site specific point data is used. The "nopointdata" and "owritesrfaer" options have to do with file creation. + +Because supported single-point datasets already have the data created for them, you MUST use the "nopointdata" and "ndepgrid" options when you are using a supported single-point site. You must use "ndepgrid" even for a compset without CN. You also can NOT use the options: "soilgrid", "pftgrid", "aerdepgrid", or "owritesrfaer". + +``--pftgrid`` + This option says to use the PFT values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_pftdata.txt file when creating the surface dataset. + This option must NOT be used when you you are using a site that is a supported single point dataset. + +``--soilgrid`` + This option says to use the soil values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_soildata.txt file when creating the surface dataset. + This option must NOT be used when you you are using a site that is a supported single point dataset. + +``--nopointdata`` + This option says to NOT create any input datasets -- assume this step has already been done. + If datasets weren't already created, your case will fail when you try to run it. + In general the first time you run PTCLM for a new site you want it to generate new datasets, but the next time and future times you want to use this option so that it doesn't waste a lot of time rebuilding datasets over again. + + .. note:: This option is required when you you are using a site that is a supported single point dataset. + +``--owritesrfaer`` + This option says to overwrite any surface and/or aerosol deposition datasets that were already created. + Otherwise, the creation of these files will be skipped if a file is already found (but it WILL create files if they don't exist). + This option must NOT be used when you you are using a site that is a supported single point dataset. diff --git a/doc/source/users_guide/running-single-points/index.rst b/doc/source/users_guide/running-single-points/index.rst new file mode 100644 index 0000000000..2c4ea71bdb --- /dev/null +++ b/doc/source/users_guide/running-single-points/index.rst @@ -0,0 +1,18 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _running-single-points: + +##################################### +Running Single Point Regional Cases +##################################### + +.. toctree:: + :maxdepth: 2 + + single-point-and-regional-grid-configurations.rst + running-pts_mode-configurations.rst + running-single-point-configurations.rst + diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst new file mode 100644 index 0000000000..56d70b1d7d --- /dev/null +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -0,0 +1,40 @@ +.. _pts_mode: + +**************************************************** +Running a single point using global data - PTS_MODE +**************************************************** + +``PTS_MODE`` enables you to run the model using global datasets, but just picking a single point from those datasets and operating on it. +It can be a very quick way to do fast simulations and get a quick turnaround. + +To setup a ``PTS_MODE`` simulation you use the "-pts_lat" and "-pts_lon" arguments to **create_newcase** to give the latitude and longitude of the point you want to simulate for (the code will pick the point on the global grid nearest to the point you give. Here's an example to setup a simulation for the nearest point at 2-degree resolution to Boulder Colorado. +:: + + > cd scripts + > ./create_newcase -case testPTS_MODE -res f19_g16 -compset I1850CRUCLM45BGC -pts_lat 40.0 -pts_lon -105 + > cd testPTS_MODE + + # We make sure the model will start up cold rather than using initial conditions + > ./xmlchange CLM_FORCE_COLDSTART=on,RUN_TYPE=startup + +Then setup, build and run as normal. We make sure initial conditions are NOT used since ``PTS_MODE`` currently CAN NOT run with initial conditions. + +.. note:: By default it sets up to run with MPILIB=mpi-serial (in the env_build.xml file) turned on, which allows you to run the model interactively. On some machines this mode is NOT supported and you may need to change it to FALSE before you are able to build. + +.. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. See bugs "1017 and 1025" in the `models/lnd/clm/doc/KnownLimitationss `_ file. + +.. note:: You can change the point you are simulating for at run-time by changing the values of ``PTS_LAT`` and ``PTS_LON`` in the ``env_run.xml`` file. + +================================== + Running on in a single processor +================================== + +Note, that when running with ``PTS_MODE`` the number of processors is automatically set to one. +When running a single grid point you can only use a single processor. +You might also want to set the ``env_build.xml`` variable: ``MPILIB=mpi-serial`` to ``TRUE`` so that you can also run interactively without having to use MPI to start up your job. + +On many machines, batch queues have a minimum number of nodes or processors that can be used. +On these machines you may have to change the queue and possibly the time-limits of the job, to get it to run in the batch queue. +On the NCAR machine, yellowstone, this is done for you automatically, and the "caldera" queue is used for such single-processor simulations. +Another way to get around this problem is to run the job interactively using ``MPILIB=mpi-serial`` so that you don't submit the job to the batch queue. +For single point mode you also may want to consider using a smaller workstation or cluster, rather than a super-computer, because you can't take advantage of the multi-processing power of the super-computer anyway. diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst new file mode 100644 index 0000000000..3445b0cab7 --- /dev/null +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -0,0 +1,218 @@ +.. _running-single-point-datasets: + +****************************************** + Running Single Point Configurations +****************************************** + +In addition to ``PTS_MODE``, CLM supports running using single-point or regional datasets that are customized to a particular region. +CLM supports a a small number of out-of-the-box single-point and regional datasets. +However, users can create their own dataset. + +To get the list of supported dataset resolutions do this: +:: + + > cd models/lnd/clm/doc + > ../bld/build-namelist -res list + + +Which results in the following: +:: + + CLM build-namelist - valid values for res (Horizontal resolutions + Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools): + Values: default 512x1024 360x720cru 128x256 64x128 48x96 32x64 8x16 94x192 \ + 0.23x0.31 0.47x0.63 0.9x1.25 1.9x2.5 2.5x3.33 4x5 10x15 5x5_amazon 1x1_tropicAtl 1x1_camdenNJ \ + 1x1_vancouverCAN 1x1_mexicocityMEX 1x1_asphaltjungleNJ 1x1_brazil 1x1_urbanc_alpha 1x1_numaIA \ + 1x1_smallvilleIA 0.1x0.1 0.5x0.5 3x3min 5x5min 10x10min 0.33x0.33 ne4np4 ne16np4 ne30np4 ne60np4 \ + ne120np4 ne240np4 wus12 us20 + Default = 1.9x2.5 + (NOTE: resolution and mask and other settings may influence what the default is) + +The resolution names that have an underscore in them ("_") are all single-point or regional resolutions. + +To run for the Brazil test site do the following: + +Example: Running CLM over a single-point test site in Brazil with the default Qian atmosphere data forcing. +-------------------------------------------------------------------------------------------------------------------------- +:: + + > cd scripts + > set SITE=1x1_brazil + > ./create_newcase -case testSPDATASET -res $SITE -compset I + > cd testSPDATASET + +Then setup, build and run normally. + +Then to run for the urban Mexico City Mexico test site that also has atmosphere forcing data, but to run it with the Qian forcing data, but over the period for which it's own forcing data is provided do the following: + +Example: Running CLM over the single-point of Mexicocity Mexico with the default Qian atmosphere data forcing. +------------------------------------------------------------------------------------------------------------------------- +:: + + > cd scripts + # Set a variable to the site you want to use (as it's used several times below) + > set SITE=1x1_mexicocityMEX + > ./create_newcase -case testSPDATASET -res $SITE -compset I + > cd testSPDATASET + # Set DATM prescribed aerosols to single-point dataset + # Will then use the dataset with just the point for this $SITE + > ./xmlchange DATM_PRESAERO=pt1_pt1 + +Then setup, build and run normally. + +**Important:** Just like PTS_MODE above, By default it sets up to run with ``MPILIB=mpi-serial`` (in the ``env_build.xml`` file) turned on, which allows you to run the model interactively. On some machines this mode is NOT supported and you may need to change it to FALSE before you are able to build. + +.. warning:: See `the Section called Warning about Running with a Single-Processor on a Batch Machine `_ for a warning about running single-point jobs on batch machines. + +.. note:: When running a ``pt1_pt1`` resolution the number of processors is automatically set to one. When running a single grid point you can only use a single processor. You might also want to set the ``env_build.xml`` variable: ``MPILIB=mpi-serial`` to TRUE so that you can also run interactively without having to use mpi to start up your job. + +Using Supported Single-point Datasets that have their own Atmospheric Forcing +================================================================================ + +Of the supported single-point datasets we have three that also have atmospheric forcing data that go with them: Mexico City (Mexico), Vancouver, (Canada, British Columbia), and ``urbanc_alpha`` (test data for an Urban inter-comparison project). +Mexico city and Vancouver also have "#ifdef" in the source code for them to work with modified urban data parameters that are particular to these locations. +They can be turned on by using the ``CLM_CONFIG_OPTS env_build.xml`` variable to set the "-sitespf_pt" option in the CLM **configure**. +To turn on the atmospheric forcing for these datasets, you set the ``env_run.xml DATM_MODE`` variable to ``CLM1PT``, and then the atmospheric forcing datasets will be used for the point picked. + +When running with datasets that have their own atmospheric forcing you need to be careful to run over the period that data is available. +If you have at least one year of forcing it will cycle over the available data over and over again no matter how long of a simulation you run. +However, if you have less than a years worth of data (or if the start date doesn't start at the beginning of the year, or the end date doesn't end at the end of the year) then you won't be able to run over anything but the data extent. +In this case you will need to carefully set the ``RUN_STARTDATE``, ``START_TOD`` and ``STOP_N/STOP_OPTION`` variables for your case to run over the entire time extent of your data. +For the supported data points, these values are in the XML database and you can use the **queryDefaultNamelist.pl** script to query the values and set them for your case (they are set for the three urban test cases: Mexicocity, Vancouver, and urbanc_alpha). + +In the example below we will show how to do this for the Vancouver, Canada point. + +Example: Running CLM over the single-point of Vancouver Canada with supplied atmospheric forcing data for Vancouver. +------------------------------------------------------------------------------------------------------------------------- +:: + + > cd scripts + + # Set a variable to the site you want to use (as it's used several times below) + > set SITE=1x1_vancouverCAN + + # Create a case at the single-point resolutions with their forcing + > ./create_newcase -case testSPDATASETnAtmForcing -res $SITE -compset I1PTCLM45 + > cd testSPDATASETnAtmForcing + + # Set namelist options for urban test site + > ./xmlchange CLM_NML_USE_CASE=stdurbpt_pd + + # Figure out the start and end date for this dataset + # You can do this by examining the datafile. + > set STOP_N=330 + > set START_YEAR=1992 + > set STARTDATE=${START_YEAR}-08-12 + > @ NDAYS = $STOP_N / 24 + > ./xmlchange RUN_STARTDATE=$STARTDATE,STOP_N=$STOP_N,STOP_OPTION=nsteps + + # Set the User namelist to set the output frequencies of the history files + # Setting the stdurbpt use-case option create three history file streams + # The frequencies and number of time-samples needs to be set + > cat << EOF > user_nl_clm + hist_mfilt = $NDAYS,$STOP_N,$STOP_N + hist_nhtfrq = -1,1,1 + EOF + + # Set DATM prescribed aerosols to single-point dataset + # Will then use the dataset with just the point for this site + > ./xmlchange DATM_PRESAERO=pt1_pt1 + > ./case.setup + + +.. warning:: If you don't set the start-year and run-length carefully as shown above the model will abort with a "dtlimit error" in the atmosphere model (see bug 1110 in the `models/lnd/clm/doc/KnownLimitationss `_ file for documentation on this). Since, the forcing data for this site (and the MexicoCity site) is less than a year, the model won't be able to run for a full year. The ``1x1_urbanc_alpha`` site has data for more than a full year, but neither year is complete hence, it has the same problem (see the problem for this site above). + +.. note:: Just like ``PTS_MODE`` above, By default it sets up to run with ``MPILIB=mpi-serial`` (in the env_build.xml file) turned on, which allows you to run the model interactively. + +.. note:: When running a ``pt1_pt1`` resolution the number of processors is automatically set to one. When running a single grid point you can only use a single processor. You might also want to set the ``env_build.xml`` variable: ``MPILIB=mpi-serial`` to ``TRUE`` so that you can also run interactively without having to use mpi to start up your job. + + +Creating your own single-point dataset +=================================================== + +The following provides an example of setting up a case using ``CLM_USRDAT_NAME`` where you rename the files according to the ``CLM_USRDAT_NAME`` convention. +We have an example of such datafiles in the repository for a specific region over Alaska (actually just a sub-set of the global f19 grid). + +Example: Using CLM_USRDAT_NAME to run a simulation using user datasets for a specific region over Alaska +----------------------------------------------------------------------------------------------------------------------- +:: + + > cd scripts + > ./create_newcase -case my_userdataset_test -res CLM_USRDAT -compset ICRUCLM45 + > cd my_userdataset_test/ + > set GRIDNAME=13x12pt_f19_alaskaUSA + > set LMASK=gx1v6 + > ./xmlchange CLM_USRDAT_NAME=$GRIDNAME,CLM_BLDNML_OPTS="-mask $LMASK" + > ./xmlchange ATM_DOMAIN_FILE=domain.lnd.${GRIDNAME}_$LMASK.nc + > ./xmlchange LND_DOMAIN_FILE=domain.lnd.${GRIDNAME}_$LMASK.nc + + # Make sure the file exists in your $CSMDATA or else use svn to download it there + > ls $CSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr2000.nc + + # If it doesn't exist, comment out the following... + #> setenv SVN_INP_URL https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/ + #> svn export $SVN_INP_URL/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr2000.nc $CSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr2000.nc + > ./case.setup + +The first step is to create the domain and surface datasets using the process outlined in `the Section called The File Creation Process in Chapter 2 `_. Below we show an example of the process. + +Example: Creating a surface dataset for a single point +--------------------------------------------------------------------- +:: + + # set the GRIDNAME and creation date that will be used later + > setenv GRIDNAME 1x1_boulderCO + > setenv CDATE `date +%y%m%d` + # Create the SCRIP grid file for the location and create a unity mapping file for it. + > cd models/lnd/clm/tools/shared/mkmapdata + > ./mknoocnmap.pl -p 40,255 -n $GRIDNAME + # Set pointer to MAPFILE just created that will be used later + > setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc + # create the mapping files needed by mksurfdata_map. + > cd ../../shared/mkmapdata + > setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc + > ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional + # create the domain file + > cd ../../../../tools/mapping/gen_domain_files/src + > ../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > gmake + > cd .. + > setenv OCNDOM domain.ocn_noocean.nc + > setenv ATMDOM domain.lnd.{$GRIDNAME}_noocean.nc + > ./gen_domain -m $MAPFILE -o $OCNDOM -l $ATMDOM + # Save the location where the domain file was created + > setenv GENDOM_PATH `pwd` + # Finally create the surface dataset + > cd ../../../../lnd/clm/tools/clm4_5/mksurfdata_map/src + > gmake + > cd .. + > ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE + +The next step is to create a case that points to the files you created above. We will still use the ``CLM_USRDAT_NAME`` option as a way to get a case setup without having to add the grid to scripts. + +Example: Setting up a case from the single-point surface dataset just created +-------------------------------------------------------------------------------------------- +:: + + # First setup an environment variable that points to the top of the CESM directory. + > setenv CESMROOT + # Next make sure you have a inputdata location that you can write to + # You only need to do this step once, so you won't need to do this in the future + > setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data + > ./link_dirtree $CSMDATA $MYCSMDATA + # Copy the file you created above to your new $MYCSMDATA location following the CLMUSRDAT + # naming convention (leave off the creation date) + > cp $CESMROOT/models/lnd/clm/tools/clm4_5/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ + $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc + > cd $CESMROOT/scripts + > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850CRUCLM45BGC \ + -mach yellowstone_intel + > cd my_usernldatasets_test + > ./xmlchange DIN_LOC_ROOT=$MYCSMDATA + # Set the path to the location of gen_domain set in the creation step above + > ./xmlchange ATM_DOMAIN_PATH=$GENDOM_PATH,LND_DOMAIN_PATH=$GENDOM_PATH + > ./xmlchange ATM_DOMAIN_FILE=$ATMDOM,LND_DOMAIN_FILE=$ATMDOM + > ./xmlchange CLM_USRDAT_NAME=$GRIDNAME + > ./case.setup + +.. note:: With this and previous versions of the model we recommended using ``CLM_USRDAT_NAME`` as a way to identify your own datasets without having to enter them into the XML database. This has two down-sides. First you can't include creation dates in your filenames, which means you can't keep track of different versions by date. It also means you HAVE to rename the files after you created them with **mksurfdata.pl**. And secondly, you have to use **linkdirtree** in order to place the files in a location outside of the usual ``DIN_LOC_ROOT`` (assuming you don't have write access to adding new files to the standard location on the machine you are using). Now, since ``user_nl`` files are supported for ALL model components, and the same domain files are read by both CLM and DATM and set using the envxml variables: ``ATM_DOMAIN_PATH``, ``ATM_DOMAIN_FILE``, ``LND_DOMAIN_PATH``, and ``LND_DOMAIN_FILE`` -- you can use this mechanism (``user_nl_clm`` and ``user_nl_datm`` and those envxml variables) to point to your datasets in any location. In the future we will deprecate ``CLM_USRDAT_NAME`` and recommend ``user_nl_clm`` and ``user_nl_datm`` and the ``DOMAIN`` envxml variables. diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst new file mode 100644 index 0000000000..a1514768ee --- /dev/null +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -0,0 +1,51 @@ +.. _single-point-configurations: + +***************************************** +Single and Regional Grid Configurations +***************************************** + +CLM allows you to set up and run cases with a single-point or a local region as well as global resolutions. +This is often useful for running quick cases for testing, evaluating specific vegetation types, or land-units, or running with observed data for a specific site. + +There are three different ways to do this for normal-supported site + +``PTS_MODE`` + runs for a single point using global datasets. + +``CLM_USRDAT_NAME`` + runs using your own datasets (single-point or regional). + +``PTCLM`` + easily setup simulations to run for tower sites.. + +.. note:: ``PTS_MODE`` and ``PTCLM`` only works for a single point, while the other two options can also work for regional datasets as well. + +.. _options-for-single-points: + +========================================= + Choosing the right single point options +========================================= + +Running for a *normal supported site* is a great solution, if one of the supported single-point/regional datasets, is your region of interest (see `the Section called Running Supported Single-point/Regional Datasets `_). +All the datasets are created for you, and you can easily select one and run, out of the box with it using a supported resolution from the top level of the CESM scripts. +The problem is that there is a very limited set of supported datasets. +You can also use this method for your own datasets, but you have to create the datasets, and add them to the XML database in scripts, CLM and to the DATM. This is worthwhile if you want to repeat many multiple cases for a given point or region. + +In general `the Section called Running PTS_MODE configurations `_ is the quick and dirty method that gets you started without having to create datasets -- but has limitations. +It's good for an initial attempt at seeing results for a point of interest, but since you can NOT restart with it, it's usage is limited. +It is the quickest method as you can create a case for it directly from **create_newcase**. Although you can't restart, running a single point is very fast, and you can run for long simulation times even without restarts. + +Next, ``CLM_USRDAT_NAME`` is the best way to setup cases quickly where you have to create your own datasets (see `the Section called Creating your own single-point/regional surface datasets `_). +With this method you don't have to change DATM or add files to the XML database -- but you have to follow a strict naming convention for files. +However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. +This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. + +Lastly *PTCLM* is a great way to easily create datasets, setup simulations and run simulations for tower sites. +It takes advantage of both normal supported site functionality and CLM_USRDAT_NAME internally. +A big advantage to it, is that it's one-stop shopping, it runs tools to create datasets, and runs **create_newcase** and sets the appropriate env variables for you. So you only have to learn how to run one tool, rather than work with many different ones. PTCLM is described in the next chapter `Chapter 6 `_. + +Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in `the Section called Running with your own atmosphere forcing `_. +You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. +You may also need to modify DATM to use your forcing data. +And you'll need to change your forcing data to be in a format that DATM can use. In the PTCLM chapter `the Section called Converting AmeriFlux Data for use by PTCLM in Chapter 6 `_ section tells you how to use AmeriFlux data for atmospheric forcing. + diff --git a/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst new file mode 100644 index 0000000000..7c8bd313c5 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst @@ -0,0 +1,10 @@ +.. _spinning-up-sp: + +=========================================== + Spinning up the Satellite Phenology Model +=========================================== + +To spin-up the CLMSP model you merely need to run CLMSP for 50 simulation years starting from arbitrary initial conditions. +You then use the final restart file for initial conditions in other simulations. +Because, this is a straight forward operation we will NOT give the details on how to do that here, but leave it as an exercise for the reader. +See the `Example 4-7 `_ as an example of doing this as the last step for CLMCN. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst new file mode 100644 index 0000000000..efb2f6b4aa --- /dev/null +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst @@ -0,0 +1,75 @@ +.. _spinning-up-clm45-bgc: + +====================== + Spinup of CLM4.5-BGC +====================== + +To get the CLM4.5-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. +After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). + +**1. 45_AD_SPINUP** + For the first step of running 1000+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: + +Example:: AD_SPINUP Simulation for CLM4.5-BGC +-------------------------------------------------------- +:: + + > cd scripts + > ./create_newcase -case BGC_spinup -res f19_g16 -compset I1850CRUCLM45BGC -mach yellowstone_intel + > cd BGC_spinup + # Append "-spinup on" to CLM_BLDNML_OPTS + > ./xmlchange CLM_BLDNML_OPTS="-bgc_spinup on" -append + # The following sets CLM_FORCE_COLDSTART to "on", and run-type to startup (you could also use an editor) + > ./xmlchange CLM_FORCE_COLDSTART=on,RUN_TYPE=startup + # Make the output history files only annual, by adding the following to the user_nl_clm namelist + > echo 'hist_nhtfrq = -8760' >> user_nl_clm + # Now setup + > ./cesm_setup -case + # Now build + > ./BGC_spinup.build + # The following sets RESUBMIT to 30 times in env_run.xml (you could also use an editor) + # The following sets STOP_DATE,STOP_N and STOP_OPTION to Jan/1/1001, 20, "nyears" in env_run.xml (you could also use an editor) + > ./xmlchange RESUBMIT=20,STOP_N=50,STOP_OPTION=nyears,STOP_DATE=10010101 + # Now run normally + > ./BGC_spinup.submit + +.. note:: This same procedure works for CLM4.5-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. + +Afterwards save the last restart file from this simulation to use in the next step. + +**2. Final spinup for CLM4.5-BGC** + Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 200+ years in normal mode. So do the following: + +Example: Final CLMBGC Spinup Simulation for CLM4.5-BGC +------------------------------------------------------------------ +:: + + > cd scripts + > ./create_newcase -case BGC_finalspinup -res f19_g16 -compset I1850CRUCLM45BGC -mach yellowstone_intel + > cd BGC_finalspinup + # Now, Copy the last CLM restart file from the earlier case into your run directory + > cp /ptmp/$LOGIN/archive/BGC_spinup/rest/BGC_spinup.clm*.r*.1002-01-01-00000.nc \ + /glade/scratch/$LOGIN/CN_finalspinup + # Set the runtype to startup + > ./xmlchange RUN_TYPE=startup + # And copy the rpointer files for datm and drv from the earlier case + > cp /glade/scratch/$LOGIN/archive/BGC_spinup/rest/rpointer.atm /ptmp/$LOGIN/CN_finalspinup + > cp /glade/scratch/$LOGIN/archive/BGC_spinup/rest/rpointer.drv /ptmp/$LOGIN/CN_finalspinup + # Set the finidat file to the last restart file saved in previous step + > echo ' finidat = "BGC_spinup.clm2.r.1002-01-01-00000.nc"' > user_nl_clm + # Now setup + > ./cesm_setup + > Now build + > ./BGC_finalspinup.build + # The following sets RESUBMIT to 4 times in env_run.xml (you could also use an editor) + # The following sets STOP_N and STOP_OPTION to 50 and "nyears" in env_run.xml (you could also use an editor) + > ./xmlchange RESUBMIT=4,STOP_OPTION=nyears,STOP_N=50 + > Now run as normal + > ./BGC_finalspinup.submit + +To assess if the model is spunup plot trends of CLMBGC variables of interest. If you see a trend, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. + +.. note:: This same final spinup procedure works for CLM4.5-CN as well, you can typically shorten the spinup time from 200 years to 50 though. + + + diff --git a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst new file mode 100644 index 0000000000..709a1b26a6 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -0,0 +1,31 @@ +.. _running-with-moar-data: + +======================== + Running with MOAR data +======================== + +Because it takes so long to spinup the CN model (as we just saw previously), if you are doing fully coupled simulations with active atmosphere and ocean, you will want to do the spinup portion of this "offline". +So instead of doing expensive fully coupled simulations for the spinup duration, you run CLM in a very cheap "I" compset using atmospheric forcing from a shorter fully coupled simulation (or a simulation run previously by someone else). + +In this example we will use the ``I1850SPINUPCN compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on yellowstone. +There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than yellowstone, but would need to download the data from the Earth System Grid and change the datapath similar to `Example 4-11 `_. + +Example: Simulation with MOAR Data on yellowstone +------------------------------------------------------------- +:: + + > cd scripts + > ./create_newcase -case MOARforce1850 -res f19_g16 -compset I1850SPINUPCN -mach yellowstone_intel + > cd MOARforce1850 + # The following sets the casename to point to for atm forcing (you could also use an editor) + > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a + # The following sets the align year and years to run over for atm forcing + # (you could also use an editor) + > ./xmlchange DATM_CPL_YR_ALIGN=1,DATM_CPL_YR_START=960,DATM_CPL_YR_END=1030 + > ./cesm_setup + # Now build and run as normal + > ./MOARforce1850.build + > ./MOARforce1850.submit + + +.. warning: Because of bug 1339 (see the `models/lnd/clm/doc/KnownBugs `_ file on this) you can't run with 83 or more years of forcing. If you do need to run with more years of forcing, you'll need to address the issue as outlined in the `models/lnd/clm/doc/KnownBugs `_ file. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst new file mode 100644 index 0000000000..7d523f7324 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -0,0 +1,75 @@ +.. _running-with-previous-simulation-forcing: + +============================================================= + Running with atmospheric forcing from a previous simulation +============================================================= + +Another way that you might want to spinup the model is to run your own simulation for a relatively short period (either a B, E, or F compset) and then use it as forcing for your "I" case later. +By only running 20 to 50 years for the fully coupled case, you'll save a substantial amount of computer time rather than running the entire spinup period with a fully coupled model. + +The first thing we need to do is to run a fully coupled case and save the atmospheric coupling fields on a three hourly basis. In this example, we will run on yellowstone and archive the data to a local disk that we can then use in the next simulation. + +Example: Fully Coupled Simulation to Create Data to Force Next Example Simulation +---------------------------------------------------------------------------------------------- +:: + + > cd scripts + > ./create_newcase -case myBCN1850 -res f09_g16 -compset B1850CN -mach yellowstone_intel + > cd myBCN1850 + > ./cesm_setup + # Set histaux_a2x3hr to .true. in your user_nl_cpl output from the atmosphere model + # will be saved 3 hourly + echo "histaux_a2x3hr=.true." >> user_nl_cpl + # edit the driver code in order to save the correct list of fields (see note below) + > cp ../../models/drv/driver/ccsm_comp_mod.F90 SourceMods/src.cpl + > $EDITOR SourceMods/src.cpl + # Now build + > ./myBCN1850.build + # The following sets the archival disk space (you could also use an editor) + > ./xmlchange DOUT_S_ROOT='/glade/home/$USER/$CASE' + # Make sure files are archived to disk, but NOT to long term storage + # (you could also use an editor) + > ./xmlchange DOUT_S=TRUE,DOUT_L_MS=FALSE + # Set the run length to run a total of 20 years (you could also use an editor) + > ./xmlchange RESUBMIT=9,STOP_OPTION=nyears,STOP_N=2 + # Now run as normal + > ./myBCN1850.submit + +.. warning:: Because of bug 1733 (see the `models/lnd/clm/doc/KnownBugs `_ file on this) you'll need to edit the driver code in order for it to produce the correct list of fields needed to run the model later. + +Now we run an I compset forced with the data from the previous simulation using the ``CPLHIST3HrWx`` option to DATM_MODE. See `the Section called CPLHIST3HrWx mode and it's DATM settings in Chapter 1 `_ for more information on the DATM settings for ``CPLHIST3HrWx`` mode. + +Example: Simulation Forced with Data from the Previous Simulation +------------------------------------------------------------------------------ +:: + + > cd scripts + > ./create_newcase -case frcwmyBCN1850 -res f09_g16 -compset I1850SPINUPCN -mach yellowstone_intel + > cd frcWmyBCN1850 + # The following sets the casename to point to for atm forcing (you could also use an editor) + > ./xmlchange DATM_CPLHIST_CASE="myBCN1850" + # The following sets the align year and years to run over for atm forcing + # (you could also use an editor) + > ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20 + # Set the strm_datdir in the namelist_defaults_datm.xml + # file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist + # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850SPINUPCN COMPSET CASES MADE AFTER THIS! + > $EDITOR ../../models/atm/datm/bld/namelist_files/namelist_defaults_datm.xml + > ./cesm_setup + # Now build and run as normal + > ./frcwmyBCN1850.build + > ./frcwmyBCN1850.submit + + +.. note:: We did this by editing the "namelist_defaults_datm.xml" which will change the settings for ALL future ``I1850SPINUPCN`` cases you run. You could also do this by editing the path in the resulting streams text files in the CaseDocs directory, and then create a "user\_" streams file with the correct path. This would change the streams file JUST for this case. The steps do it this way are: + +:: + + > ./preview_namelists + > cp CaseDocs/datm.streams.txt.CPLHIST3HrWx.Precip user_datm.streams.txt.CPLHIST3HrWx.Precip + > cp CaseDocs/datm.streams.txt.CPLHIST3HrWx.Solar user_datm.streams.txt.CPLHIST3HrWx.Solar + > cp CaseDocs/datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip user_datm.streams.txt.CPLHIST3HrWx.nonSolarNonPrecip + # Change the field to point to the correct directory i.e.: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist + > $EDITOR user_datm.streams.txt.CPLHIST3HrWx.* + > ./preview_namelists + # Then make sure the CaseDocs/datm.streams.txt.CPLHIST3HrWx.* files have the correct path diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst new file mode 100644 index 0000000000..854450ff12 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -0,0 +1,138 @@ +.. _running-with-historical-co2-forcing: + +===================================== + Running with historical CO2 forcing +===================================== + +In this case you want to run a simulation with stand-alone CLM responding to changes in CO2 for a historical period. +For this example, we will start with the "I_1850-2000_CN" compset that has transient: land-use, Nitrogen and Aerosol deposition already. +You could also use another compset if you didn't want these other features to be transient. +In order to get CO2 to be transient we need to add a new streams file and add it to the list of streams in the user_nl_datm file. +You also need a NetCDF datafile that datm can read that gives the variation. You could supply your own file, but we have a standard file that is used by CAM for this and our example will make use of this file. + +.. note:: Most everything here has to do with changing datm rather than CLM to allow this to happen. As such the user that wishes to do this should first become more familiar with datm and read the `CESM Data Model User's Guide `_ especially as it pertains to the datm. + +.. warning:: This section documents the process for doing something that is non-standard. There may be errors with the documentation and process, and you may have to do some work before all of this works for you. If that is the case, we recommend that you do further research into understanding the process and the files, as well as understanding the datm and how it works. You may have to read documentation found in the code for datm as well as "csm_share". + +The datm has "streams" files that have rough XML-like syntax and specify the location and file to get data from, as well as information on the variable names and the data locations of the grid points. +The datm expects specific variable names and the datm "maps" the expected variable names from the file to the names expected by datm. +The file we are working with here is a file with a single-point, that covers the entire globe (so the vertices go from -90 to 90 degrees in latitude and 0 to 360 degrees in longitude). +Since it's a single point it's a little easier to work with than datasets that may be at a given horizontal resolution. +The datm also expects that variables will be in certain units, and only expects a limited number of variables so arbitrary fields can NOT be exchanged this way. +However, the process would be similar for datasets that do contain more than one point. + +The three things that are needed: a domain file, a data file, and a streams text file. +The domain file is a CF-compliant NetCDF file that has information on the grid points (latitudes and longitudes for cell-centers and vertices, mask , fraction, and areas). +The datafile is a CF-compliant NetCDF file with the data that will be mapped. +The streams text file is the XML-like file that tells datm how to find the files and how to map the variables datm knows about to the variable names on the NetCDF files. Note, that in our case the domain file and the data file are the same file. In other cases, the domain file may be separate from the data file. + +First we are going to create a case, and we will edit the ``user_nl_datm`` so that we add a CO2 data stream in. +There is a streams text file available in ``models/lnd/clm/doc/UsersGuide/co2_streams.txt``, that includes file with a CO2 time-series from 1765 to 2007. + + +Example: Transient Simulation with Historical CO2 +-------------------------------------------------------------- +:: + + > cd scripts + > ./create_newcase -case DATM_CO2_TSERIES -res f19_g16 -compset I20TRCRUCLM45BGC + > cd DATM_CO2_TSERIES + + # Set CCSM_BGC to CO2A so that CO2 will be passed from atmosphere to land + # Set CLM_CO2_TYPE to diagnostic so that the land will use the value sent from the atmosphere + > ./xmlchange CCSM_BGC=CO2A,CLM_CO2_TYPE=diagnostic + > ./case.setup + + # Create the streams file for CO2 + > cat << EOF >> datm.streams.txt.co2tseries + + + + This is a streams file to pass historical CO2 from datm8 to the other + surface models. It reads in a historical dataset derived from data used + by CAM. The getco2_historical.ncl script in models/lnd/clm2/tools/ncl_scripts + was used to convert the CAM file to a streams compatible format (adding domain + information and making CO2 have latitude/longitude even if only for a single + point. + + + + Input stream description file for historical CO2 reconstruction data + + 04 March 2010: Converted to form that can be used by datm8 by Erik Kluzek + 18 December 2009: Prepared by B. Eaton using data provided by + Jean-Francois Lamarque. All variables except f11 are directly from + PRE2005_MIDYR_CONC.DAT. Data from 1765 to 2007 with 2006/2007 just + a repeat of 2005. + + + CLMNCEP + + + + time time + lonc lon + latc lat + area area + mask mask + + + $CSMDATA/atm/datm7/CO2 + + + fco2_datm_1765-2007_c100614.nc + + + + + CO2 co2diag + + + $CSMDATA/atm/datm7/CO2 + + + fco2_datm_1765-2007_c100614.nc + + + + + + EOF + + # And copy it to the run directory + > cp datm.streams.txt.co2tseries $RUNDIR + + # Run preview namelist so we have the namelist in CaseDocs + > ./preview_namelists + +The first thing we will do is to edit the ``user_nl_datm`` file to add a CO2 file stream in. +To do this we will copy a ``user_nl_datm`` in with the changes needed. The file ``addco2_user_nl_datm.user_nl`` is in ``models/lnd/clm/doc/UsersGuide`` and looks like this... +:: + + dtlimit = 1.5,1.5,1.5,1.5,1.5 + fillalgo = 'nn','nn','nn','nn','nn' + fillmask = 'nomask','nomask','nomask','nomask','nomask' + mapalgo = 'bilinear','bilinear','bilinear','bilinear','nn' + mapmask = 'nomask','nomask','nomask','nomask',nomask' + streams = "datm.streams.txt.CLM_QIAN.Solar 1895 1948 1972 ", "datm.streams.txt.CLM_QIAN.Precip 1895 1948 1972 ", + "datm.streams.txt.CLM_QIAN.TPQW 1895 1948 1972 ", "datm.streams.txt.presaero.trans_1850-2000 1849 1849 2006", + "datm.streams.txt.co2tseries 1766 1766 2005 " + taxmode = 'cycle','cycle','cycle','cycle','extend' + tintalgo = 'coszen','nearest','linear','linear','linear' + +You just copy this into your case directory. But, also compare it to the version in ``CaseDocs`` to make sure the changes are just to add in the new CO2 stream. Check to see that filenames, and start, end and align years are correct. +:: + + > cp ../../models/lnd/clm/doc/UsersGuide/addco2_user_nl_datm.user_nl user_nl_datm + > diff user_nl_datm CaseDocs/datm_atm_in + +Once, you've done that you can build and run your case normally. + +.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard CLM4.5 CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. + +.. note:: The intent of the ``user_nl_datm`` is to add an extra streams file for CO2 to the end of the streams variable, and other arrays associated with streams (adding mapalgo as a new array with bilinear for everything, but the CO2 file which should be "nn" for nearest neighbor). Other variables should be the same as the other stream values. + +.. warning:: The streams file above is hard-coded for the path of the file on NCAR computers. To use it on an outside machine you'll need to edit the filepath in the streams file to point to the location where you have the file. + +After going through these steps, you will have a case where you have datm reading in an extra streams text file that points to a data file with CO2 data on it that will send that data to the CLM. + diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst new file mode 100644 index 0000000000..af69b010da --- /dev/null +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -0,0 +1,22 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _running-special-cases-section: + +##################################### +Running Special Cases +##################################### + +.. toctree:: + :maxdepth: 2 + + what-is-a-special-case.rst + running-the-prognostic-crop-model.rst + running-with-irrigation.rst + CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst + CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst + CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst + CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst + CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst diff --git a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst new file mode 100644 index 0000000000..31691e721d --- /dev/null +++ b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst @@ -0,0 +1,31 @@ +.. running-prognostic-crop-model: + +=================================== + Running the prognostic crop model +=================================== + +The prognostic crop model is setup to work with CLM4.5-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. +In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. +To activate the crop model you can choose a compset that has "CROP" in the name such as "ICRUCLM45BGCCROP" or simply add "-crop on" to ``CLM_CONFIG_OPTS``. + +Example: Crop Simulation +------------------------------------ +:: + + > cd scripts + > ./create_newcase -case CROP -res f19_g16 -compset I1850CRUCLM45BGC + > cd CROP + + # Append "-crop on" to CLM_CONFIG_OPTS in env_build.xml (you could also use an editor) + > ./xmlchange CLM_CONFIG_OPTS="-crop on" -append + + # Change to startup type so uses spunup initial conditions file for crop if it exists + # By default the model will do a hybrid startup with an initial condition file + # incompatible with the crop surface dataset. + + > ./xmlchange RUN_TYPE=startup + > ./case.setup + + # Now build and run normally + > ./case.build + > ./case.submit diff --git a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst new file mode 100644 index 0000000000..4a39f6ec5f --- /dev/null +++ b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst @@ -0,0 +1,33 @@ +.. running-with-irrigation: + +=================================== + Running with irrigation +=================================== + +In CLM4.5 irrigation can ONLY be used WITH crop. +To turn on irrigation in CLM4.5 we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. +Just as in the crop example we also change ``RUN_TYPE`` to ``startup`` so that we don't use an initial condition file that is incompatible with irrigation. + +Example: Irrigation Simulation +------------------------------------------ +:: + + # Note here we do a CLMSP simulation as that is what has been validated + > cd scripts + > ./create_newcase -case IRRIG -res f19_g16 -compset I + > cd IRRIG + + # Append "-irrig" to CLM_BLDNML_OPTS in env_run.xml (you could also use an editor) + > ./xmlchange CLM_BLDNML_OPTS="-irrig" -append + + # Change to startup type so uses spunup initial conditions file for irrigation if it exists + # By default the model will do a hybrid startup with an initial condition file + # incompatible with the irrigation surface dataset. + > ./xmlchange RUN_TYPE=startup + > ./case.setup + + # Now build and run normally + > ./case.build + > ./case.submit + + diff --git a/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst b/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst new file mode 100644 index 0000000000..32daabafc6 --- /dev/null +++ b/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst @@ -0,0 +1,12 @@ +.. _what is a special case: + +========================= + What is a special case? +========================= + +All of the following special cases cases that take more than one step to do. +The straightforward cases have compsets and/or build-namelist use-cases setup for them or require simple editing of a single-case. +All of the cases here require you to do at least two simulations with different configurations, or require more complex editing of the case (changing the streams files). + +.. note:: The cases in this chapter are more sophisticated and require more technical knowledge and skill than cases in previous chapters. The user should be very familiar with doing simple cases before moving onto the cases described here. + diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst new file mode 100644 index 0000000000..806d76d966 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst @@ -0,0 +1,321 @@ +.. _choosing-a-compset: + +==================== + Choosing a compset +==================== + +When setting up a new case one of the first choices to make is which "component set" (or compset) to use. +The compset refers to which component models are used as well as specific settings for them. +We label the different types of compsets with a different letter of the alphabet from "A" (for all data model) to "X" (for all dead model). +The compsets of interest when working with CLM are the "I" compsets (which contain CLM with a data atmosphere model and a stub ocean, and stub sea-ice models), "E" and "F" compsets (which contain CLM with the active atmosphere model (CAM), prescribed sea-ice model, and a data ocean model), and "B" compsets which have all active components. +Below we go into details on the "I" compsets which emphasize CLM as the only active model, and just mention the two other categories. + +When working with CLM you usually want to start with a relevant "I" compset before moving to the more complex cases that involve other active model components. +The "I" compsets can exercise CLM in a way that is similar to the coupled modes, but with much lower computational cost and faster turnaround times. + +Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) +------------------------------------------------------------------------- + +`Supported CLM Configurations `_ are listed in `Table 1-1 `_ for the Scientifically Supported compsets (have been scientifically validated with long simulations) and in `Table 1-2 `_ for the Functionally Supported compsets (we've only checked that they function). + + +**Scientifically Supported I Compsets:** + ++------------+--------------+-----------+-----------------+----------------+ +| Short Name | Description | Atm. | Compset Alias | Period | +| | | Forcing | Name | | ++============+==============+===========+=================+================+ +| CLM4.5SP | Satellite | CRUNCEP | 1850CRUCLM45 | 1850 | +| | phenology | | | | +| | with new | | | | +| | biogeophys | | | | ++------------+--------------+-----------+-----------------+----------------+ +| CLM4.5SP | New | CRUNCEP | I1850CRUCLM45BGC| 1850 | +| | biogeophys | +-----------------+----------------+ +| | + CENTURY- | | I20TRCRUCLM45BGC| 20th Century | +| | like | | | | +| | vertically | | | | +| | resolved | | | | +| | soil | | | | +| | BGC + CH4 | | | | +| | emissions, | | | | +| | nitrogen | | | | +| | updates | | | | ++------------+--------------+-----------+-----------------+----------------+ +| CLM4.5CN | New | CRUNCEP | I1850CRUCLM45CN | 1850 | +| | biogeophys | | | | +| | + CN soil | | | | +| | BGC, updates | | | | ++------------+--------------+-----------+-----------------+----------------+ +| CLM4SP | As in | Qian | I1850 | 1850 | +| | CCSM4/CESM1 | +-----------------+----------------+ +| | release | | I | 2000 | +| | | +-----------------+----------------+ +| | | | I20TR | 20th Century | ++------------+--------------+-----------+-----------------+----------------+ +| CLM4CN | As in | Qian | I1850CN | 1850 | +| | CCSM4/CESM1 | +-----------------+----------------+ +| | release | | ICN | 2000 | +| | | +-----------------+----------------+ +| | | | I20TRCN | 20th Century | +| | | +-----------------+----------------+ +| | | | IRCP26CN | RCP 2.6 to 2100| +| | | +-----------------+----------------+ +| | | | IRCP45CN | RCP 4.5 to 2100| +| | | +-----------------+----------------+ +| | | | IRCP60CN | RCP 6.0 to 2100| +| | | +-----------------+----------------+ +| | | | IRCP85CN | RCP 8.5 to 2100| ++------------+--------------+-----------+-----------------+----------------+ + +**Functionally Supported I Compsets:** + ++------------+-------------------+-------------------+-----------------+--------+ +| Short Name | Description | Atm. | Compset Alias | Period | +| | | Forcing | Name | | ++============+===================+===================+=================+========+ +| CLM4.5BGC- | ICRUCLM45BGCCROP | New biogeophys + | CRUNCEP | 2000 | +| CROP | | CENTURY-like | | | +| | | vertically | | | +| | | resolved soil | | | +| | | BGC + CH4 | | | +| | | emissions, | | | +| | | nitrogen updates | | | +| | | with prognostic | | | +| | | CROP | | | +| | | | | | ++------------+-------------------+-------------------+-----------------+--------+ +| CLM4.5BGC- | I1850CRUCLM45BGCDV| New biogeophys | CRUNCEP | 1850 | +| DV | | + CENTURY-like | | | +| | | vertically | | | +| | | resolved soil | | | +| | | BGC + CH4 | | | +| | | emissions, | | | +| | | nitrogen updates | | | +| | | with DV | | | +| | | | | | +| | | | | | +| | | | | | ++------------+-------------------+-------------------+-----------------+--------+ +| CLM4.5SP- | ICLM45VIC | Satellite | Qian | 2000 | +| VIC | | phenology with new| | | +| | | biogeophys with | | | +| | | VIC hydrology | | | ++------------+-------------------+-------------------+-----------------+--------+ +|CLM4CN-CROP | ICNCROP | As in CCSM4/CESM1 | Qian | 2000 | +| | | release | | | ++------------+-------------------+-------------------+-----------------+--------+ +|CLM4CN-DV | ICNDV | As in CCSM4/CESM1 | Qian | 1850 | +| | | release | | | ++------------+-------------------+-------------------+-----------------+--------+ + +Here is the entire list of compsets available. +Note that using the "-user_compset" option even more combinations are possible. +In the list below we give the alias name and then the long name which describes each component in parenthesis. +Alias (Long-name with time-period and each component) + +1. ``I`` (2000_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850`` (1850_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CLM45`` (1850_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CLM45BGC`` (1850_DATM%QIA_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CLM45CN`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CLM45CNF`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM%FLOOD_SGLC_SWAV) + +#. ``I1850CN`` (1850_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRU`` (1850_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRUCLM45`` (1850_DATM%CRU_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRUCLM45BGC`` (1850_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRUCLM45BGCDV`` (1850_DATM%CRU_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRUCLM45CN`` (1850_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850CRUCN`` (1850_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850SPINUPCLM45BGC`` (1850_DATM%S1850_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1850SPINUPCN`` (1850_DATM%S1850_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1PT`` (2000_DATM%1PT_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I1PTCLM45`` (2000_DATM%1PT_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TR`` (20TR_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCLM45`` (20TR_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCLM45CN`` (20TR_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCN`` (20TR_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCRU`` (20TR_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCRUCLM45`` (20TR_DATM%CRU_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCRUCLM45BGC`` (20TR_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCRUCLM45CN`` (20TR_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I20TRCRUCN`` (20TR_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I4804`` (4804_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I4804CLM45`` (4804_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I4804CLM45CN`` (4804_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``I4804CN`` (4804_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45`` (2000_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45BGC`` (2000_DATM%QIA_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45BGCCROP`` (2000_DATM%QIA_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45BGCDV`` (2000_DATM%QIA_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45BGCDVCROP`` (2000_DATM%QIA_CLM45%BGCDV-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45BGCNoVS`` (2000_DATM%QIA_CLM45%NoVS_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45CN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45CNCROP`` (2000_DATM%QIA_CLM45%CN-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45CNDV`` (2000_DATM%QIA_CLM45%CNDV_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45CNTEST`` (2003_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV_TEST) + +#. ``ICLM45CRUBGC`` (2000_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45GLCMEC`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV_TEST) + +#. ``ICLM45SNCRFRC`` (2000_DATM%QIA_CLM45%SP-SNCR_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45USUMB`` (2000_DATM%1PT_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%1x1_US-UMB) + +#. ``ICLM45VIC`` (2000_DATM%QIA_CLM45%SP-VIC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICLM45alaskaCN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%13x12pt_f19_alaskaUSA) + +#. ``ICN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICNCROP`` (2000_DATM%QIA_CLM40%CN-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICNDV`` (2000_DATM%QIA_CLM40%CNDV_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICNDVCROP`` (2000_DATM%QIA_CLM40%CNDV-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICNTEST`` (2003_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV_TEST) + +#. ``ICRU`` (2000_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICRUCLM45`` (2000_DATM%CRU_CLM45_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICRUCLM45BGC`` (2000_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICRUCLM45BGCCROP`` (2000_DATM%CRU_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICRUCLM45BGCTEST`` (2003_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV_TEST) + +#. ``ICRUCLM45CN`` (2000_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ICRUCN`` (2000_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IG`` (2000_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG1850`` (1850_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG1850CLM45`` (1850_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG1850CLM45CN`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG1850CN`` (1850_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG20TR`` (20TR_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG20TRCLM45`` (20TR_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG20TRCLM45CN`` (20TR_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG20TRCN`` (20TR_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG4804`` (4804_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG4804CLM45`` (4804_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG4804CLM45CN`` (4804_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IG4804CN`` (4804_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGCLM45`` (2000_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGCLM45CN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGCN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGLCMEC`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV_TEST) + +#. ``IGRCP26CLM45CN`` (RCP2_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP26CN`` (RCP2_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP45CLM45CN`` (RCP4_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP45CN`` (RCP4_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP60CLM45CN`` (RCP6_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP60CN`` (RCP6_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP85CLM45CN`` (RCP8_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IGRCP85CN`` (RCP8_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) + +#. ``IRCP26CLM45CN`` (RCP2_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP26CN`` (RCP2_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP45CLM45CN`` (RCP4_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP45CN`` (RCP4_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP60CLM45CN`` (RCP6_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP60CN`` (RCP6_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP85CLM45CN`` (RCP8_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``IRCP85CN`` (RCP8_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ISNCRFRC`` (2000_DATM%QIA_CLM40%SP-SNCR_SICE_SOCN_RTM_SGLC_SWAV) + +#. ``ITEST`` (2003_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV_TEST) + +#. ``ITESTCLM45`` (2003_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV_TEST) + +#. ``IUSUMB`` (2000_DATM%1PT_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%1x1_US-UMB) + +#. ``IalaskaCN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%13x12pt_f19_alaskaUSA) + +Compsets coupled to active atmosphere with data ocean +----------------------------------------------------- +CAM compsets are compsets that start with "E" or "F" in the name. They are described more fully in the scripts documentation or the CAM documentation. "E" compsets have a slab ocean model while "F" compsets have a data ocean model. + +Fully coupled compsets with fully active ocean, sea-ice, and atmosphere +----------------------------------------------------------------------- +Fully coupled compsets are compsets that start with "B" in the name. They are described more fully in the scripts documentation. + +Conclusion to choosing a compset +-------------------------------- +We've introduced the basic type of compsets that use CLM and given some further details for the "standalone CLM" (or "I" compsets). +The `config_compsets.xml `_ lists all of the compsets and gives a full description of each of them. +In the next section we look into customizing the setup time options for compsets using CLM. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst new file mode 100644 index 0000000000..ed00d99483 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -0,0 +1,688 @@ +.. _configuring-clm: + +******************************* +Customizing CLM's Configuration +******************************* + +The "Creating a Case" section of the `CESM1.2.0 Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. + +For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called there are two steps that take place: + +1. The CLM "**configure**" script is called to setup the build-time configuration for CLM (more information on **configure** is given in `the Section called More information on the CLM configure script `_). The env variables for **configure** are locked after the **$CASE.build** step. So the results of the CLM **configure** are locked after the build has taken place. + +2. The CLM "**build-namelist**" script is called to generate the run-time namelist for CLM (more information on **build-namelist** is given below in `the Section called Definition of Namelist items and their default values `_. + +When customizing your case at the *8cesm_setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "models/lnd/clm/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. + +There are five different types of customization for the configuration that we will discuss: CLM4.5 in CESM1.2.0 build-time options, CLM4.5 in CESM1.2.0 run-time options, User Namelist, other noteworthy CESM1.2.0 configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. + +Information on all of the script, configuration, build and run items is found under ``scripts/ccsm_utils/Case.template`` in the `config_definition.xml `_ file. + +================================ + CLM Script configuration items +================================ + +Below we list each of the CESM configuration items that are specific to CLM. All of these are available in your: ``env_build.xml`` and ``env_run.xml`` files. +:: + + CLM_CONFIG_OPTS + CLM_BLDNML_OPTS + CLM_NAMELIST_OPTS + CLM_FORCE_COLDSTART + CLM_NML_USE_CASE + CLM_USRDAT_NAME + CLM_CO2_TYPE + +For the precedence of the different options to **build-namelist** see the section on precedence below. + +The first item ``CLM_CONFIG_OPTS`` has to do with customizing the CLM build-time options for your case, the rest all have to do with generating the namelist. + +CLM_CONFIG_OPTS + The option ``CLM_CONFIG_OPTS`` is all about passing command line arguments to the CLM **configure** script. + It is important to note that some compsets, may already put a value into the ``CLM_CONFIG_OPTS`` variable. + You can still add more options to your ``CLM_CONFIG_OPTS`` but make sure you add to what is already there rather than replacing it. + Hence, we recommend using the "-append" option to the xmlchange script. + In `the Section called More information on the CLM configure script `_ below we will go into more details on options that can be customized in the CLM "**configure**" script. + It's also important to note that the **clm.buildnml.csh** script may already invoke certain CLM **configure** options and as such those command line options are NOT going to be available to change at this step (nor would you want to change them). + The options to CLM **configure** are given with the "-help" option which is given in `the Section called More information on the CLM configure script `_. + .. note:: ``CLM_CONFIG_OPTS`` is locked after the **$CASE.build** script is run. If you want to change something in ``CLM_CONFIG_OPTS`` you'll need to clean the build and rerun **$CASE.build**. The other env variables can be changed at run-time so are never locked. + +CLM_NML_USE_CASE + ``CLM_NML_USE_CASE`` is used to set a particular set of conditions that set multiple namelist items, all centering around a particular usage of the model. To list the valid options do the following: + :: + + > cd models/lnd/clm/doc + > ../bld/build-namelist -use_case list + + The output of the above command is: + :: + + CLM build-namelist - use cases: 1850-2100_rcp2.6_glacierMEC_transient 1850-2100_rcp2.6_transient \ + 1850-2100_rcp4.5_glacierMEC_transient 1850-2100_rcp4.5_transient \ + 1850-2100_rcp6_glacierMEC_transient 1850-2100_rcp6_transient \ + 1850-2100_rcp8.5_glacierMEC_transient 1850-2100_rcp8.5_transient 1850_control \ + 1850_glacierMEC_control 2000-2100_rcp8.5_transient 2000_control 2000_glacierMEC_control \ + 20thC_glacierMEC_transient 20thC_transient glacierMEC_pd stdurbpt_pd + Use cases are:... + + 1850-2100_rcp2.6_glacierMEC_transient = Simulate transient land-use, and aerosol deposition changes \ + with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE + + 1850-2100_rcp2.6_transient = Simulate transient land-use, and aerosol deposition changes with \ + historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE + + 1850-2100_rcp4.5_glacierMEC_transient = Simulate transient land-use, and aerosol deposition changes \ + with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM + + 1850-2100_rcp4.5_transient = Simulate transient land-use, and aerosol deposition changes with \ + historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM + + 1850-2100_rcp6_glacierMEC_transient = Simulate transient land-use, and aerosol deposition changes \ + with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM + + 1850-2100_rcp6_transient = Simulate transient land-use, and aerosol deposition changes with \ + historical data from 1850 to 2005 and then with the RCP6 scenario from AIM + + 1850-2100_rcp8.5_glacierMEC_transient = Simulate transient land-use, and aerosol deposition changes \ + with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE + + 1850-2100_rcp8.5_transient = Simulate transient land-use, and aerosol deposition changes with \ + historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE + + 1850_control = Conditions to simulate 1850 land-use + 1850_glacierMEC_control = Running an IG case for 1850 conditions with the ice sheet model glimmer + 2000-2100_rcp8.5_transient = Simulate transient land-use, and aerosol deposition changes with \ + historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE + + 2000_control = Conditions to simulate 2000 land-use + 2000_glacierMEC_control = Running an IG case for 2000 conditions with the ice sheet model glimmer + 20thC_glacierMEC_transient = Simulate transient land-use, and aerosol deposition changes from 1850 \ + to 2005 + 20thC_transient = Simulate transient land-use, and aerosol deposition changes from 1850 to 2005 + glacierMEC_pd = Running an IG case with the ice sheet model glimmer + stdurbpt_pd = Standard Urban Point Namelist Settings + + .. note::See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + +CLM_BLDNML_OPTS + The option CLM_BLDNML_OPTS is for passing options to the CLM "build-namelist" script. + As with the CLM "configure" script the CLM clm.buildnml.csh may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the "build-namelist" script is to do + :: + + > cd models/lnd/clm/bld + > ./build-namelist -help + + Here is the output from the above. + :: + + ./SYNOPSIS + build-namelist [options] + + Create the namelist for CLM + OPTIONS + -[no-]chk_res Also check [do NOT check] to make sure the resolution and + land-mask is valid. + -clm_demand "list" List of variables to require on clm namelist besides the usuals. + "-clm_demand list" to list valid options. + (can include a list member "null" which does nothing) + -clm_startfile "file" CLM restart file to start from. + -clm_start_type "type" Start type of simulation + (default, cold, arb_ic, startup, continue, or branch) + (default=do the default type for this configuration) + (cold=always start with arbitrary initial conditions) + (arb_ic=start with arbitrary initial conditions if + initial conditions don't exist) + (startup=ensure that initial conditions are being used) + -clm_usr_name "name" Dataset resolution/descriptor for personal datasets. + Default: not used + Example: 1x1pt_boulderCO_c090722 to describe location, + number of pts, and date files created + -co2_type "value" Set CO2 the type of CO2 variation to use. + -co2_ppmv "value" Set CO2 concentration to use when co2_type is constant (ppmv). + -config "filepath" Read the given CLM configuration cache file. + Default: "config_cache.xml". + -csmdata "dir" Root directory of CESM input data. + Can also be set by using the CSMDATA environment variable. + -d "directory" Directory where output namelist file will be written + Default: current working directory. + -drydep Produce a drydep_inparm namelist that will go into the + "drv_flds_in" file for the driver to pass dry-deposition to the atm. + Default: -no-drydep + (Note: buildnml.csh copies the file for use by the driver) + -glc_grid "grid" Glacier model grid and resolution when glacier model, + Only used if glc_nec > 0 for determining fglcmask + Default: gland5UM + (i.e. gland20, gland10 etcetera) + -glc_nec Glacier number of elevation classes [0 | 3 | 5 | 10 | 36] + (default is 0) (standard option with land-ice model is 10) + -glc_smb Only used if glc_nec > 0 + If .true., pass surface mass balance info to GLC + If .false., pass positive-degree-day info to GLC + Default: true + -help [or -h] Print usage to STDOUT. + -ignore_ic_date Ignore the date on the initial condition files + when determining what input initial condition file to use. + -ignore_ic_year Ignore just the year part of the date on the initial condition files + when determining what input initial condition file to use. + -infile "filepath" Specify a file (or list of files) containing namelists to + read values from. + + If used with a CLM build with multiple ensembles (ninst_lnd>1) + and the filename entered is a directory to files of the + form filepath/filepath and filepath/filepath_$n where $n + is the ensemble member number. the "filepath/filepath" + input namelist file is the master input namelist file + that is applied to ALL ensemble members. + + (by default for CESM this is setup for files of the + form $CASEDIR/user_nl_clm/user_nl_clm_????) + -inputdata "filepath" Writes out a list containing pathnames for required input datasets in + + file specified. + -irrig "value" If .true. turn irrigation on with namelist logical irrigate (for CLM4.5 physics) + (requires crop to be on in the clm configuration) + Seek surface datasets with irrigation turned on. (for CLM4.0 physics) + Default: .false. + -l_ncpl "LND_NCPL" Number of CLM coupling time-steps in a day. + -lnd_frac "domainfile" Land fraction file (the input domain file) + -mask "landmask" Type of land-mask (default, navy, gx3v5, gx1v5 etc.) + "-mask list" to list valid land masks. + -namelist "namelist" Specify namelist settings directly on the commandline by supplying + a string containing FORTRAN namelist syntax, e.g., + -namelist "&clm_inparm dt=1800 /" + -no-megan DO NOT PRODUCE a megan_emis_nl namelist that will go into the + "drv_flds_in" file for the driver to pass VOCs to the atm. + MEGAN (Model of Emissions of Gases and Aerosols from Nature) + (Note: buildnml.csh copies the file for use by the driver) + -[no-]note Add note to output namelist [do NOT add note] about the + arguments to build-namelist. + -rcp "value" Representative concentration pathway (rcp) to use for + future scenarios. + "-rcp list" to list valid rcp settings. + -res "resolution" Specify horizontal grid. Use nlatxnlon for spectral grids; + dlatxdlon for fv grids (dlat and dlon are the grid cell size + in degrees for latitude and longitude respectively) + "-res list" to list valid resolutions. + -s Turns on silent mode - only fatal messages issued. + -sim_year "year" Year to simulate for input datasets + (i.e. 1850, 2000, 1850-2000, 1850-2100) + "-sim_year list" to list valid simulation years + -bgc_spinup "on|off" CLM 4.5 Only. For CLM 4.0, spinup is controlled from configure. + Turn on given spinup mode for BGC setting of CN + on : Turn on Accelerated Decomposition (spinup_state = 1) + off : run in normal mode (spinup_state = 0) + + Default is off. + + Spinup is now a two step procedure. First, run the model + with spinup = "on". Then run the model for a while with + spinup = "off". The exit spinup step happens automatically + on the first timestep when using a restart file from spinup + mode. + + The spinup state is saved to the restart file. + If the values match between the model and the restart + file it proceeds as directed. + + If the restart file is in spinup mode and the model is in + normal mode, then it performs the exit spinup step + and proceeds in normal mode after that. + + If the restart file has normal mode and the model is in + spinup, then it enters spinup. This is useful if you change + a parameter and want to rapidly re-equilibrate without doing + a cold start. + + -test Enable checking that input datasets exist on local filesystem. + -verbose [or -v] Turn on verbose echoing of informational messages. + -use_case "case" Specify a use case which will provide default values. + "-use_case list" to list valid use-cases. + -version Echo the SVN tag name used to check out this CLM distribution. + + + + Note: The precedence for setting the values of namelist variables is (highest to lowest): + 0. namelist values set by specific command-line options, like, -d, -sim_year + (i.e. CLM_BLDNML_OPTS env_run variable) + 1. values set on the command-line using the -namelist option, + (i.e. CLM_NAMELIST_OPTS env_run variable) + 2. values read from the file(s) specified by -infile, + (i.e. user_nl_clm files) + 3. datasets from the -clm_usr_name option, + (i.e. CLM_USRDAT_NAME env_run variable) + 4. values set from a use-case scenario, e.g., -use_case + (i.e. CLM_NML_USE_CASE env_run variable) + 5. values from the namelist defaults file. + + +The **clm.buildnml.csh** script already sets the resolution and mask as well as the CLM **configure** file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. +Hence only the following different options can be set: + +1. +-bgc_spinup + +#. -chk_res + +#. -clm_demand + +#. -drydep + +#. -ignore_ic_date + +#. -ignore_ic_year + +#. -irrig + +#. -no-megan + +#. -note + +#. -rcp + +#. -sim_year + +#. -verbose + + +"-bgc_spinup" is an option only available for CLM4.5 for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. + +"-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **$CASE.build** or **$CASE.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. + +"-clm_demand" asks the **build-namelist** step to require that the list of variables entered be set. Typically, this is used to require that optional filenames be used and ensure they are set before continuing. For example, you may want to require that fpftdyn be set to get dynamically changing vegetation types. To do this you would do the following. +:: + + > ./xmlchange CLM_BLDNML_OPTS="-clm_demand fpftdyn"`` + +To see a list of valid variables that you could set do this: +:: + + > cd models/lnd/clm/doc + > ../bld/build-namelist -clm_demand list + + +.. note:: Using a 20th-Century transient compset or the ``20thC_transient`` use-case using ``CLM_NML_USE_CASE`` would set this as well, but would also use dynamic nitrogen and aerosol deposition files, so using ``-clm_demand`` would be a way to get *just* dynamic vegetation types and NOT the other files as well. + +"-drydep" adds the dry-deposition namelist to the driver. This is a driver namelist, but adding the option here has CLM **build-namelist** create the ``drv_flds_in`` file that the driver will copy over and use. Invoking this option does have an impact on performance even for I compsets and will slow the model down. It's also only useful when running with an active atmosphere model that makes use of this information. + +"-ignore_ic_date" ignores the Initial Conditions (IC) date completely for finding initial condition files to startup from. Without this option or the "-ignore_ic_year" option below, the date of the file comes into play. + +"-ignore_ic_year" ignores the Initial Conditions (IC) year for finding initial condition files to startup from. The date is used, but the year is ignored. Without this option or the "-ignore_ic_date" option below, the date and year of the file comes into play. + +When "-irrig" is used **build-namelist** will try to find surface datasets that have the irrigation model enabled. + +"no-megan" means do NOT add the MEGAN model Biogenic Volatile Organic Compounds (BVOC) namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless "no-megan" is specified the CLM **build-namelist** will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). + +"-note" adds a note to the bottom of the namelist file, that gives the details of how **build-namelist** was called, giving the specific command-line options given to it. + +"-rcp" is used to set the representative concentration pathway for the future scenarios you want the data-sets to simulate conditions for, in the input datasets. To list the valid options do the following: +:: + + > cd models/lnd/clm/doc + > ../bld/build-namelist -rcp list + +"-sim_year" is used to set the simulation year you want the data-sets to simulate conditions for in the input datasets. The simulation "year" can also be a range of years in order to do simulations with changes in the dataset values as the simulation progresses. To list the valid options do the following: +:: + + > cd models/lnd/clm/doc + > ../bld/build-namelist -sim_year list + +``CLM_NAMELIST_OPTS`` + passes namelist items into one of the CLM namelists. + + .. note:: For character namelist items you need to use "'" as quotes for strings so that the scripts don't get confused with other quotes they use. + + Example, you want to set ``hist_dov2xy`` to ``.false.`` so that you get vector output to your history files. To do so edit ``env_run.xml`` and add a setting for ``hist_dov2xy``. So do the following: + :: + + > ./xmlchange CLM_NAMELIST_OPTS="hist_dov2xy=.false." + + Example, you want to set ``hist_fincl1`` to add the variable 'HK' to your history files. To do so edit ``env_run.xml`` and add a setting for ``hist_fincl1``. So do the following: + :: + + > ./xmlchange CLM_NAMELIST_OPTS="hist_fincl1='HK'" + + For a list of the history fields available see `CLM History Fields `_. + + .. note: See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + +``CLM_FORCE_COLDSTART`` + when set to on, *requires* that your simulation do a cold start from arbitrary initial conditions. If this is NOT set, it will use an initial condition file if it can find an appropriate one, and otherwise do a cold start. ``CLM_FORCE_COLDSTART`` is a good way to ensure that you are doing a cold start if that is what you want to do. + +``CLM_USRDAT_NAME`` + Provides a way to enter your own datasets into the namelist. + The files you create must be named with specific naming conventions outlined in: `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_. + To see what the expected names of the files are, use the **queryDefaultNamelist.pl** to see what the names will need to be. + For example if your ``CLM_USRDAT_NAME`` will be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, the following will list what your filenames should be: + :: + + > cd models/lnd/clm/bld + > queryDefaultNamelist.pl -usrname "1x1_boulderCO" -options mask=navy,sim_year=1850,sim_year_range="constant" -csmdata $CSMDATA + + An example of using ``CLM_USRDAT_NAME`` for a simulation is given in `Example 5-4 `_. + + .. note:: See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + +``CLM_CO2_TYPE`` + sets the type of input CO2 for either "constant", "diagnostic" or prognostic". + If "constant" the value from ``CCSM_CO2_PPMV`` will be used. + If "diagnostic" or "prognostic" the values MUST be sent from the atmosphere model. + For more information on how to send CO2 from the data atmosphere model see `the Section called Running stand-alone CLM with transient historical CO2 concentration in Chapter 4 `_. + +=============== + User Namelist +=============== + +``CLM_NAMELIST_OPTS`` as described above allows you to set any extra namelist items you would like to appear in your namelist. However, it only allows you a single line to enter namelist items, and strings must be quoted with ' which is a bit awkward. If you have a long list of namelist items you want to set (such as a long list of history fields) a convenient way to do it is to add to the ``user_nl_clm`` that is created after the **cesm_setup** command runs. The file needs to be in valid FORTRAN namelist format (with the exception that the namelist name &namelist and the end of namelist marker "/" are excluded". The **preview_namelist** or **$CASE.run** step will abort if there are syntax errors. All the variable names must be valid and the values must be valid for the datatype and any restrictions for valid values for that variable. Here's an example ``user_nl_clm`` namelist that sets a bunch of history file related items, to create output history files monthly, daily, every six and 1 hours. + +---------------------------------- +Example: user_nl_clm namelist file +---------------------------------- + +:: + + !---------------------------------------------------------------------------------- + ! Users should add all user specific namelist changes below in the form of + ! namelist_var = new_namelist_value + ! + ! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options + ! are set in the CLM_NAMELIST_OPTS env variable. + ! + ! EXCEPTIONS: + ! Set co2_ppmv with CCSM_CO2_PPMV option + ! Set dtime with L_NCPL option + ! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options + ! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases + ! (includes $inst_string for multi-ensemble cases) + ! Set glc_grid with GLC_GRID option + ! Set glc_smb with GLC_SMB option + ! Set maxpatch_glcmec with GLC_NEC option + !---------------------------------------------------------------------------------- + hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', + 'FSR','FSA','FGEV','FSH','FGR','TSOI', + 'ERRSOI','BUILDHEAT','SABV','SABG', + 'FSDSVD','FSDSND','FSDSVI','FSDSNI', + 'FSRVD','FSRND','FSRVI','FSRNI', + 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', + 'H2OSNO','SOILLIQ','SOILICE', + 'TSA_U', 'TSA_R', + 'TREFMNAV_U', 'TREFMNAV_R', + 'TREFMXAV_U', 'TREFMXAV_R', + 'TG_U', 'TG_R', + 'RH2M_U', 'RH2M_R', + 'QRUNOFF_U', 'QRUNOFF_R', + 'SoilAlpha_U', + 'Qanth', 'SWup', 'LWup', 'URBAN_AC', 'URBAN_HEAT' + hist_fincl3 = 'TG:I', 'FSA:I', 'SWup:I', 'URBAN_AC:I', 'URBAN_HEAT:I', + 'TG_U:I', 'TG_R:I', + hist_fincl4 = 'TG', 'FSA', 'SWup', 'URBAN_AC', 'URBAN_HEAT' + hist_mfilt = 1, 30, 28, 24 + hist_nhtfrq = 0, -24, -6, -1 + + +**Note:** The comments at the top are some guidance given in the default user_nl_clm and just give some guidance on how to set variables and use the file. + +**Note:** See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + +**Note:** You do NOT need to specify the namelist group that the variables are in because the CLM **build-namelist** knows the namelist that specific variable names belong to, and it puts them there. + +Obviously, all of this would be difficult to put in the CLM_NAMELIST_OPTS variable, especially having to put ' around all the character strings. For more information on the namelist variables being set here and what they mean, see the section on CLM namelists below, as well as the namelist definition that gives details on each variable. + +--------------------- +Precedence of Options +--------------------- + +Note: The precedence for setting the values of namelist variables with the different env_build.xml, env_run.xml options is (highest to lowest): + +1. Namelist values set by specific command-line options, like, -d, -sim_year (i.e. CLM_BLDNML_OPTS env_build.xml variable) + +#. Values set on the command-line using the -namelist option, (i.e. CLM_NAMELIST_OPTS env_run.xml variable) + +#. Values read from the file specified by -infile, (i.e. user_nl_clm file) + +#. Datasets from the -clm_usr_name option, (i.e. CLM_USRDAT_NAME env_run.xml variable) + +#. Values set from a use-case scenario, e.g., -use_case (i.e. CLM_NML_USE_CASE env_run.xml variable) + +#. Values from the namelist defaults file. + +Thus a setting in ``CLM_BLDNML_OPTS`` will override a setting for the same thing given in a use case with ``CLM_NML_USE_CASE``. Likewise, a setting in ``CLM_NAMELIST_OPTS`` will override a setting in ``user_nl_clm``. + +------------------------------------ +Setting Your Initial Conditions File +------------------------------------ + +Especially with CLMBGC and CLMCN starting from initial conditions is very important. Even with CLMSP it takes many simulation years to get the model fully spunup. There are a couple different ways to provide an initial condition file. + +- `the Section called Doing a hybrid simulation to provide initial conditions `_ +- `the Section called Doing a branch simulation to provide initial conditions `_ +- `the Section called Providing a finidat file in your user_nl_clm file `_ +- `the Section called Adding a finidat file to the XML database `_ + + **Note:** Your initial condition file MUST agree with the surface dataset you are using to run the simulation. If the two files do NOT agree you will get a run-time about a mis-match in PFT weights, or in the number of PFT's or columns. To get around this you'll need to use the `Section called Using interpinic to interpolate initial conditions to different resolutions in Chapter 2 `_ to interpolate your initial condition dataset. + +------------------------------------------------------- +Doing a hybrid simulation to provide initial conditions +------------------------------------------------------- + +The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup most cases, at the standard resolutions of "f09" or "f19" it will already do this for you. For example, if you run an "I2000CN" compset at "f09_g16" resolution the following settings will already be done for you. + +``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=I2000CN_f09_g16_c100503,RUN_REFDATE=0001-01-01,GET_REFCASE=TRUE`` + +Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the: ``$DIN_LOC_ROOT/ccsm4_init/I2000CN_f09_g16_c100503/0001-01-01`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. + +------------------------------------------------------- +Doing a branch simulation to provide initial conditions +------------------------------------------------------- + +The setup for running a branch simulation is essentially the same as for a hybrid. With the exception of setting ``RUN_TYPE`` to branch rather than hybrid. A branch simulation runs the case essentially as restarting from it's place before to exactly reproduce it (but possibly output more or different fields on the history files). While a hybrid simulation allows you to change the configuration or run-time options, as well as use a different code base than the original case that may have fewer fields on it than a full restart file. The ``GET_REFCASE`` option works similarly for a branch case as for a hybrid. + +------------------------------------------------- +Providing a finidat file in your user_nl_clm file +------------------------------------------------- + +Setting up a branch or hybrid simulation requires the initial condition file to follow a standard naming convention, and a standard input directory if you use the ``GET_REFCASE`` option. If you want to name your file willy nilly and place it anywhere, you can set it in your ``user_nl_clm`` file as in this example. +:: + + finidat = '/glade/home/$USER/myinitdata/clmi_I1850CN_f09_g16_0182-01-01.c120329.nc' + +Note, if you provide an initial condition file -- you can NOT set ``CLM_FORCE_COLDSTART`` to ``TRUE``. + +------------------------------------------- + Adding a finidat file to the XML database +------------------------------------------- + +Like other datasets, if you want to use a given initial condition file to be used for all (or most of) your cases you'll want to put it in the XML database so it will be used by default. The initial condition files, are resolution dependent, and dependent on the number of PFT's and other variables such as GLC_NEC or if irrigation is on or off. See Chapter 3 for more information on this. + +------------------------------------ +Other noteworthy configuration items +------------------------------------ + +For running "I" cases there are several other noteworthy configuration items that you may want to work with. +Most of these involve settings for the DATM, but one ``CCSM_CO2_PPMV`` applies to all models. +If you are running an B, E, or F case that doesn't use the DATM obviously the DATM_* settings will not be used. All of the settings below are in your ``env_build.xml`` and ``env_run.xml`` files +:: + + CCSM_CO2_PPMV + CCSM_VOC + DATM_MODE + DATM_PRESAERO + DATM_CLMNCEP_YR_ALIGN + DATM_CLMNCEP_YR_START + DATM_CLMNCEP_YR_END + DATM_CPL_CASE + DATM_CPL_YR_ALIGN + DATM_CPL_YR_START + DATM_CPL_YR_END + +``CCSM_CO2_PPMV`` + Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the CCSM_BGC variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item co2_type tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. + +``CCSM_VOC`` + Enables passing of the Volatile Organic Compounds (VOC) from CLM to the atmospheric model. This of course is only important if the atmosphere model is a fully active model that can use these fields in it's chemistry calculations. + +``DATM_MODE`` + Sets the mode that the DATM model should run in this determines how data is handled as well as what the source of the data will be. Many of the modes are setup specifically to be used for ocean and/or sea-ice modeling. The modes that are designed for use by CLM are: + :: + + CLMCRUNCEP + CLM_QIAN + CLM1PT> + CPLHIST3HrWx + +``CLMCRUNCEP`` + The standard mode for CLM4.5 of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. + See `the Section called CLMCRUNCEP mode and it's DATM settings `_ for more information on the DATM settings for ``CLMCRUNCEP`` mode. + +``CLM_QIAN`` + The standard mode for CLM4.0 of using global atmospheric data that was developed by Qian et. al. for CLM using NCEP data from 1948 to 2004. See the `Section called CLM_QIAN mode and it's DATM settings `_ for more information on the DATM settings for ``CLM_QIAN`` mode. ``CLM1PT`` is for the special cases where we have single-point tower data for particular sites. Right now we only have data for three urban locations: MexicoCity Mexico, Vancouver Canada, and the urban-c alpha site. And we have data for the US-UMB AmeriFlux tower site for University of Michigan Biological Station. See `the Section called CLM1PT mode and it's DATM settings `_ for more information on the DATM settings for ``CLM1PT`` mode. ``CPLHIST3HrWx`` is for running with atmospheric forcing from a previous CESM simulation. See `the Section called CPLHIST3HrWx mode and it's DATM settings `_ for more information on the DATM settings for ``CPLHIST3HrWx`` mode. + +``DATM_PRESAERO`` + sets the prescribed aerosol mode for the data atmosphere model. The list of valid options include: + + ``clim_1850`` = constant year 1850 conditions + + ``clim_2000`` = constant year 2000 conditions + + ``trans_1850-2000`` = transient 1850 to year 2000 conditions + + ``rcp2.6`` = transient conditions for the rcp=2.6 W/m2 future scenario + + ``rcp4.5`` = transient conditions for the rcp=4.5 W/m2 future scenario + + ``rcp6.0`` = transient conditions for the rcp=6.0 W/m2 future scenario + + ``rcp8.5`` = transient conditions for the rcp=8.5 W/m2 future scenario + + ``pt1_pt1`` = read in single-point or regional datasets + +DATM_CLMNCEP_YR_START + ``DATM_CLMNCEP_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. + +DATM_CLMNCEP_YR_END + ``DATM_CLMNCEP_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. + +DATM_CLMNCEP_YR_ALIGN + ``DATM_CLMNCEP_YR_START`` and ``DATM_CLMNCEP_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CLMNCEP_YR_ALIGN`` determines which year in that range of years the simulation will start with. + +DATM_CPL_CASE + ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHIST3HrWx`` mode. + +DATM_CPL_YR_START + ``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHIST3HrWx`` mode. + +DATM_CPL_YR_END + ``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHIST3HrWx`` mode. + +DATM_CPL_YR_ALIGN + ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CPL_YR_ALIGN`` determines which year in that range of years the simulation will start with. + +----------------------------- +Downloading DATM Forcing Data +----------------------------- + +In Chapter One of the `CESM User's Guide `_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well. + +The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of it's size you may also need to download it onto a separate disk space. We have done that on yellowstone for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use **check_input_data** to export the data. + +The ``CPLHIST3HrWx`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on yellowstone. The DATM assumes the path for the previous NCAR machine yellowstone of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. + +-------------------------------------- +Customizing via the build script files +-------------------------------------- + +The final thing that the user may wish to do before **cesm_setup** is run is to edit the build script files which determine the configuration and namelist. The variables in ``env_build.xml`` or ``env_run.xml`` typically mean you will NOT have to edit build script files. But, there are rare instances where it is useful to do so. The build script files are copied to your case directory and are available under Buildconf. The list of build script files you might wish to edit are: + +**clm.buildexe.csh** +**clm.buildnml.csh** +**datm.buildexe.csh** +**datm.buildnml.csh** + +-------------------------------------------- +More information on the CLM configure script +-------------------------------------------- + +The CLM **configure** script defines the details of a clm configuration and summarizes it into a ``config_cache.xml`` file. The ``config_cache.xml`` will be placed in your case directory under ``Buildconf/clmconf``. The `config_definition.xml `_ in ``models/lnd/clm/bld/config_files`` gives a definition of each CLM configuration item, it is viewable in a web-browser. Many of these items are things that you would NOT change, but looking through the list gives you the valid options, and a good description of each. Below we repeat the ``config_definition.xml`` files contents: + +Help on CLM configure +--------------------- + +Coupling this with looking at the options to CLM **configure** with "-help" as below will enable you to understand how to set the different options. +:: + + > cd models/lnd/clm/bld + > configure -help + +The output to the above command is as follows: +:: + + SYNOPSIS + configure [options] + + Configure CLM in preparation to be built. + OPTIONS + User supplied values are denoted in angle brackets (<>). Any value that contains + white-space must be quoted. Long option names may be supplied with either single + or double leading dashes. A consequence of this is that single letter options may + NOT be bundled. + + -bgc Build CLM with BGC package [ none | cn | cndv ] + (default is none). + -cache Name of output cache file (default: config_cache.xml). + -cachedir Name of directory where output cache file is written + (default: CLM build directory). + -clm4me Turn Methane model: [on | off] + Requires bgc=cn/cndv (Carbon Nitrogen model) + (ONLY valid for CLM4.5!) + -clm_root Root directory of clm source code + (default: directory above location of this script) + -cppdefs A string of user specified CPP defines. Appended to + Makefile defaults. e.g. -cppdefs '-DVAR1 -DVAR2' + -vichydro Turn VIC hydrologic parameterizations : [on | off] (default is off) + -crop Toggle for prognostic crop model. [on | off] (default is off) + (can ONLY be turned on when BGC type is CN or CNDV) + -comp_intf Component interface to use (ESMF or MCT) (default MCT) + -defaults Specify full path to a configuration file which will be used + to supply defaults instead of the defaults in bld/config_files. + This file is used to specify model configuration parameters only. + Parameters relating to the build which are system dependent will + be ignored. + -exlaklayers Turn on extra lake layers (25 layers instead of 10) [on | off] + (ONLY valid for CLM4.5!) + -help [or -h] Print usage to STDOUT. + -nofire Turn off wildfires for BGC setting of CN + (default includes fire for CN) + -noio Turn history output completely off (typically for testing). + -phys Value of clm4_0 or clm4_5 (default is clm4_0) + -silent [or -s] Turns on silent mode - only fatal messages issued. + -sitespf_pt Setup for the given site specific single-point resolution. + -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] + (default is off) + -spinup CLM 4.0 Only. For CLM 4.5, spinup is controlled from build-namelist. + Turn on given spinup mode for BGC setting of CN (level) + AD Turn on Accelerated Decomposition from (2) + bare-soil + exit Jump directly from AD spinup to normal mode (1) + normal Normal decomposition ("final spinup mode") (0) + (default) + The recommended sequence is 2-1-0 + -usr_src [,[,[...]]] + Directories containing user source code. + -verbose [or -v] Turn on verbose echoing of settings made by configure. + -version Echo the SVN tag name used to check out this CLM distribution. + -vsoilc_centbgc Turn on vertical soil Carbon profile, CENTURY model decomposition, \ + + split Nitrification/de-Nitrification into two mineral + pools for NO3 and NH4 (requires clm4me Methane model), and + eliminate inconsistent duplicate soil hydraulic + parameters used in soil biogeochem. + (requires either CN or CNDV) + (ONLY valid for CLM4.5!) + [on,off or colon delimited list of no options] (default off) + no-vert Turn vertical soil Carbon profile off + no-cent Turn CENTURY off + no-nitrif Turn the Nitrification/denitrification off + [no-vert,no-cent,no-nitrif,no-vert:no-cent] + + +We've given details on how to use the options in env_build.xml and env_run.xml to interact with the CLM "configure" and "build-namelist" scripts, as well as giving a good understanding of how these scripts work and the options to them. +In the next section we give further details on the CLM namelist. You could customize the namelist for these options after "cesm_setup" is run. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst new file mode 100644 index 0000000000..131078c648 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -0,0 +1,251 @@ +.. _customizing-a-case: + +============================ + Customizing CLM's namelist +============================ + +Once a case is **cesm_setup**, we can then customize the case further, by editing the run-time namelist for CLM. First let's list the definition of each namelist item and their valid values, and then we'll list the default values for them. Next for some of the most used or tricky namelist items we'll give examples of their use, and give you example namelists that highlight these features. + +In the following, various examples of namelists are provided that feature the use of different namelist options to customize a case for particular uses. +Most the examples revolve around how to customize the output history fields. +This should give you a good basis for setting up your own CLM namelist. + +----------------------------------------------------- +Definition of Namelist items and their default values +----------------------------------------------------- + +Here we point to you where you can find the definition of each namelist item and separately the default values for them. The default values may change depending on the resolution, land-mask, simulation-year and other attributes. Both of these files are viewable in your web browser, and then expand each in turn. + +1. `Definition of Namelists Relevant for CLM4.5 `_ + +2. `Default values of each CLM4.0 Namelist Item `_ + +3. `Default values of each CLM4.5 Namelist Item `_ + +List of fields that can be added to your output history files by namelist +------------------------------------------------------------------------- + +One set of the namelist items allows you to add fields to the output history files: ``hist_fincl1``, ``hist_fincl2``, ``hist_fincl3``, ``hist_fincl4``, ``hist_fincl5``, and ``hist_fincl6``. The following links for `CLM4.0 History Fields `_ and `CLM4.5 History Fields `_ documents all of the history fields available and gives the long-name and units for each. The table below lists all the CLM4.5 history fields. + +Definition of CLM history variables +----------------------------------- + +Included in the table are the following pieces of information: + +- Variable name. + +- Long name description. + +- units + + +Table 1-3. CLM History Fields +----------------------------- +Table goes here. + + +--------------------------------------------- +Examples of using different namelist features +--------------------------------------------- + +Below we will give examples of user namelists that activate different commonly used namelist features. We will discuss the namelist features in different examples and then show a user namelist that includes an example of the use of these features. First we will show the default namelist that doesn't activate any user options. + +The default namelist +-------------------- + +Here we give the default namelist as it would be created for an "I1850CRUCLM45BGC" compset at 0.9x1.25 resolution with a gx1v6 land-mask on yellowstone. To edit the namelist you would edit the ``user_nl_clm`` user namelist with just the items you want to change. For simplicity we will just show the CLM namelist and NOT the entire file. In the sections below, for simplicity we will just show the user namelist (``user_nl_clm``) that will add (or modify existing) namelist items to the namelist. + +Example 1-2. Default CLM Namelist +--------------------------------- +:: + + &clm_inparm + albice = 0.60,0.40 + co2_ppmv = 284.7 + co2_type = 'constant' + create_crop_landunit = .false. + dtime = 1800 + fatmlndfrc = '/glade/p/cesm/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' + finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850CRUCLM45BGC.0241-01-01.0.9x1.25_g1v6_simyr1850_c130531.nc' + fpftcon = '/glade/p/cesm/cseg/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc' + fsnowaging = '/glade/p/cesm/cseg/inputdata/lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc' + fsnowoptics = '/glade/p/cesm/cseg/inputdata/lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc' + fsurdat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c130415.nc' + maxpatch_glcmec = 0 + more_vertlayers = .false. + nsegspc = 20 + spinup_state = 0 + urban_hac = 'ON' + urban_traffic = .false. + / + &ndepdyn_nml + ndepmapalgo = 'bilinear' + stream_fldfilename_ndep = '/glade/p/cesm/cseg/inputdata/lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc' + stream_year_first_ndep = 1850 + stream_year_last_ndep = 1850 + / + &popd_streams + popdensmapalgo = 'bilinear' + stream_fldfilename_popdens = '$DIN_LOC_ROOT/lnd/clm2/firedata/clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc' + stream_year_first_popdens = 1850 + stream_year_last_popdens = 1850 + / + &light_streams + lightngmapalgo = 'bilinear' + stream_fldfilename_lightng = '/glade/p/cesm/cseg/inputdata/atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_c130327.nc' + stream_year_first_lightng = 0001 + stream_year_last_lightng = 0001 + / + &clm_hydrology1_inparm + / + &clm_soilhydrology_inparm + / + &ch4par_in + fin_use_fsat = .true. + / + +Adding/removing fields on your primary history file +--------------------------------------------------- + +The primary history files are output monthly, and contain an extensive list of fieldnames, but the list of fieldnames can be added to using ``hist_fincl1`` or removed from by adding fieldnames to ``hist_fexcl1``. +A sample user namelist ``user_nl_clm`` adding few new fields (cosine of solar zenith angle, and solar declination) and excluding a few standard fields is (ground temperature, vegetation temperature, soil temperature and soil water).: + +Example 1-3. Example user_nl_clm namelist adding and removing fields on primary history file +-------------------------------------------------------------------------------------------- +:: + + hist_fincl1 = 'COSZEN', 'DECL' + hist_fexcl1 = 'TG', 'TV', 'TSOI', 'H2OSOI' + + +Adding auxiliary history files and changing output frequency +------------------------------------------------------------ + +The ``hist_fincl2`` through ``hist_fincl6`` set of namelist variables add given history fieldnames to auxiliary history file "streams", and ``hist_fexcl2`` through ``hist_fexcl6`` set of namelist variables remove given history fieldnames from history file auxiliary "streams". +A history "stream" is a set of history files that are produced at a given frequency. +By default there is only one stream of monthly data files. +To add more streams you add history fieldnames to ``hist_fincl2`` through ``hist_fincl6``. +The output frequency and the way averaging is done can be different for each history file stream. +By default the primary history files are monthly and any others are daily. You can have up to six active history streams, but you need to activate them in order. So if you activate stream "6" by setting ``hist_fincl6``, but if any of ``hist_fincl2`` through ``hist_fincl5`` are unset, only the history streams up to the first blank one will be activated. + +The frequency of the history file streams is given by the namelist variable ``hist_nhtfrq`` which is an array of rank six for each history stream. The values of the array ``hist_nhtfrq`` must be integers, where the following values have the given meaning: + +*Positive value* means the output frequency is the number of model steps between output. +*Negative value* means the output frequency is the absolute value in hours given (i.e -1 would mean an hour and -24 would mean a full day). Daily (-24) is the default value for all auxiliary files. +*Zero* means the output frequency is monthly. This is the default for the primary history files. + +The number of samples on each history file stream is given by the namelist variable ``hist_mfilt`` which is an array of rank six for each history stream. The values of the array ``hist_mfilt`` must be positive integers. By default the primary history file stream has one time sample on it (i.e. output is to separate monthly files), and all other streams have thirty time samples on them. + +A sample user namelist ``user_nl_clm`` turning on four extra file streams for output: daily, six-hourly, hourly, and every time-step, leaving the primary history files as monthly, and changing the number of samples on the streams to: yearly (12), thirty, weekly (28), daily (24), and daily (48) is: + +Example: user_nl_clm namelist adding auxiliary history files and changing output frequency +------------------------------------------------------------------------------------------------------ +:: + + hist_fincl2 = 'TG', 'TV' + hist_fincl3 = 'TG', 'TV' + hist_fincl4 = 'TG', 'TV' + hist_fincl5 = 'TG', 'TV' + hist_nhtfrq = 0, -24, -6, -1, 1 + hist_mfilt = 12, 30, 28, 24, 48 + +Removing all history fields +--------------------------- + +Sometimes for various reasons you want to remove all the history fields either because you want to do testing without any output, or you only want a very small custom list of output fields rather than the default extensive list of fields. +By default only the primary history files are active, so technically using ``hist_fexcl1`` explained in the first example, you could list ALL of the history fields that are output in ``hist_fexcl1`` and then you wouldn't get any output. +However, as the list is very extensive this would be a cumbersome thing to do. +So to facilitate this ``hist_empty_htapes`` allows you to turn off all default output. +You can still use ``hist_fincl1`` to turn your own list of fields on, but you then start from a clean slate. +A sample user namelist ``user_nl_clm`` turning off all history fields and then activating just a few selected fields (ground and vegetation temperatures and absorbed solar radiation) is: + +Example 1-5. Example user_nl_clm namelist removing all history fields +--------------------------------------------------------------------- +:: + + hist_empty_htapes = .true. + hist_fincl1 = 'TG', 'TV', 'FSA' + + +Various ways to change history output averaging flags +----------------------------------------------------- + +There are two ways to change the averaging of output history fields. +The first is using ``hist_avgflag_pertape`` which gives a default value for each history stream, the second is when you add fields using ``hist_fincl*``, you add an averaging flag to the end of the field name after a colon (for example 'TSOI:X', would output the maximum of TSOI). +The types of averaging that can be done are: + +- *A* Average, over the output interval. +- *I* Instantaneous, output the value at the output interval. +- *X* Maximum, over the output interval. +- *M* Minimum, over the output interval. + +The default averaging depends on the specific fields, but for most fields is an average. +A sample user namelist ``user_nl_clm`` making the monthly output fields all averages (except TSOI for the first two streams and FIRE for the 5th stream), and adding auxiliary file streams for instantaneous (6-hourly), maximum (daily), minimum (daily), and average (daily). +For some of the fields we diverge from the per-tape value given and customize to some different type of optimization. + +Example: user_nl_clm namelist with various ways to average history fields +------------------------------------------------------------------------------------- +:: + + hist_empty_htapes = .true. + hist_fincl1 = 'TSOI:X', 'TG', 'TV', 'FIRE', 'FSR', 'FSH', + 'EFLX_LH_TOT', 'WT' + hist_fincl2 = 'TSOI:X', 'TG', 'TV', 'FIRE', 'FSR', 'FSH', + 'EFLX_LH_TOT', 'WT' + hist_fincl3 = 'TSOI', 'TG:I', 'TV', 'FIRE', 'FSR', 'FSH', + 'EFLX_LH_TOT', 'WT' + hist_fincl4 = 'TSOI', 'TG', 'TV:I', 'FIRE', 'FSR', 'FSH', + 'EFLX_LH_TOT', 'WT' + hist_fincl5 = 'TSOI', 'TG', 'TV', 'FIRE:I', 'FSR', 'FSH', + 'EFLX_LH_TOT', 'WT' + hist_avgflag_pertape = 'A', 'I', 'X', 'M', 'A' + hist_nhtfrq = 0, -6, -24, -24, -24 + +In the example we put the same list of fields on each of the tapes: soil-temperature, ground temperature, vegetation temperature, emitted longwave radiation, reflected solar radiation, sensible heat, total latent-heat, and total water storage. +We also modify the soil-temperature for the primary and secondary auxiliary tapes by outputting them for a maximum instead of the prescribed per-tape of average and instantaneous respectively. +For the tertiary auxiliary tape we output ground temperature instantaneous instead of as a maximum, and for the fourth auxiliary tape we output vegetation temperature instantaneous instead of as a minimum. +Finally, for the fifth auxiliary tapes we output ``FIRE`` instantaneously instead of as an average. + +.. note:: We also use ``hist_empty_htapes`` as in the previous example, so we can list ONLY the fields that we want on the primary history tapes. + +Outputting history files as a vector in order to analyze the plant function types within gridcells +-------------------------------------------------------------------------------------------------- + +By default the output to history files are the grid-cell average of all land-units, and vegetation types within that grid-cell, and output is on the full 2D latitude/longitude grid with ocean masked out. +Sometimes it's important to understand how different land-units or vegetation types are acting within a grid-cell. +The way to do this is to output history files as a 1D-vector of all land-units and vegetation types. +In order to display this, you'll need to do extensive post-processing to make sense of the output. +Often you may only be interested in a few points, so once you figure out the 1D indices for the grid-cells of interest, you can easily view that data. +1D vector output can also be useful for single point datasets, since it's then obvious that all data is for the same grid cell. + +To do this you use ``hist_dov2xy`` which is an array of rank six for each history stream. +Set it to ``.false.`` if you want one of the history streams to be a 1D vector. +You can also use ``hist_type1d_pertape`` if you want to average over all the: Plant-Function-Types, columns, land-units, or grid-cells. +A sample user namelist ``user_nl_clm`` leaving the primary monthly files as 2D, and then doing grid-cell (GRID), column (COLS), and no averaging over auxiliary tapes output daily for a single field (ground temperature) is: + +Example: user_nl_clm namelist outputting some files in 1D Vector format +----------------------------------------------------------------------- +:: + + hist_fincl2 = 'TG' + hist_fincl3 = 'TG' + hist_fincl4 = 'TG' + hist_fincl5 = 'TG' + hist_fincl6 = 'TG' + hist_dov2xy = .true., .false., .false., .false. + hist_type2d_pertape = ' ', 'GRID', 'COLS', ' ' + hist_nhtfrq = 0, -24, -24, -24 + +.. warning:: LAND and COLS are also options to the pertape averaging, but currently there is a bug with them and they fail to work. + +.. note:: Technically the default for hist_nhtfrq is for primary files output monthly and the other auxiliary tapes for daily, so we don't actually have to include hist_nhtfrq, we could use the default for it. Here we specify it for clarity. + +.. caution:: LAND and COLS are also options to the pertape averaging, but currently there is a bug with them and they fail to work. + +Visualizing global 1D vector files will take effort. +You'll probably want to do some post-processing and possibly just extract out single points of interest to see what is going on. +Since, the output is a 1D vector, of only land-points traditional plots won't be helpful. +The number of points per grid-cell will also vary for anything, but grid-cell averaging. +You'll need to use the output fields pfts1d_ixy, and pfts1d_jxy, to get the mapping of the fields to the global 2D array. +pfts1d_itype_veg gives you the PFT number for each PFT. +Most likely you'll want to do this analysis in a data processing tool (such as NCL, Matlab, Mathmatica, IDL, etcetera that is able to read and process NetCDF data files). diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst new file mode 100644 index 0000000000..8cf0916717 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst @@ -0,0 +1,109 @@ +.. customizing-the-datm-namelist: + +=============================== + Customizing the DATM namelist +=============================== + +When running "I" compsets with CLM you use the DATM model to give atmospheric forcing data to CLM. There are two ways to customize DATM: + +1. **DATM Main Namelist and Stream Namlist gorup** (``datm_in``) +2. **DATM stream files** + +The `Data Model Documentation `_ gives the details of all the options for the data models and for DATM specifically. +It goes into detail on all namelist items both for DATM and for DATM streams. +So here we won't list ALL of the DATM namelist options, nor go into great details about stream files. +But, we will talk about a few of the different options that are relevant for running with CLM. +All of the options for changing the namelists or stream files is done by editing the ``user_nl_datm`` file. + +Because, they aren't useful for work with CLM we will NOT discuss any of the options for the main DATM namelist. Use the DATM Users Guide at the link above to find details of that. For the streams namelist we will discuss three items: + +1. ``mapalgo`` +#. ``taxmode`` +#. ``tintalgo`` + +And for the streams file itself we will discuss: + +offset + Again everything else (and including the above items) are discussed in the Data Model User's Guide. Of the above the last three: offset, taxmode and tintalgo are all closely related and have to do with the time interpolation of the DATM data. + +mapalgo + ``mapalgo`` sets the spatial interpolation method to go from the DATM input data to the output DATM model grid. The default is ``bilinear``. For ``CLM1PT`` we set it to ``nn`` to just select the nearest neighbor. This saves time and we also had problems running the interpolation for single-point mode. + +taxmode + ``taxmode`` is the time axis mode. + For CLM we usually have it set to ``cycle`` which means that once the end of the data is reached it will start over at the beginning. + The extend modes is used have it use the last time-step of the forcing data once it reaches the end of forcing data (or use the first time-step before it reaches where the forcing data starts). See the warning below about the extend mode. + +.. warning:: *THE extend OPTION NEEDS TO BE USED WITH CAUTION!* It is only invoked by default for the CLM1PT mode and is only intended for the supported urban datasets to extend the data for a single time-step. If you have the model *run extensively through periods in this mode you will effectively be repeating that last time-step over that entire period*. This means the output of your simulation will be worthless. + +offset (in the stream file) + ``offset`` is the time offset in seconds to give to each stream of data. Normally it is NOT used because the time-stamps for data is set correctly for each stream of data. Note, the ``offset`` may NEED to be adjusted depending on the ``taxmode`` described above, or it may need to be adjusted to account for data that is time-stamped at the END of an interval rather than the middle or beginning of interval. The ``offset`` can is set in the stream file rather than on the stream namelist. For data with a ``taxmode`` method of ``coszen`` the time-stamp needs to be for the beginning of the interval, while for other data it should be the midpoint. The ``offset`` can be used to adjust the time-stamps to get the data to line up correctly. + +tintalgo + ``tintalgo`` is the time interpolation algorithm. For CLM we usually use one of three modes: ``coszen``, ``nearest``, or ``linear``. We use ``coszen`` for solar data, nearest for precipitation data, and linear for everything else. If your data is half-hourly or hourly, nearest will work fine for everything. The ``coszen`` scaling is useful for longer periods (three hours or more) to try to get the solar to match the cosine of the solar zenith angle over that longer period of time. If you use linear for longer intervals, the solar will cut out at night-time anyway, and the straight line will be a poor approximation of the cosine of the solar zenith angle of actual solar data. nearest likewise would be bad for longer periods where it would be much higher than the actual values. + +.. note:: For ``coszen`` the time-stamps of the data should correspond to the beginning of the interval the data is measured for. Either make sure the time-stamps on the datafiles is set this way, or use the ``offset`` described above to set it. + +.. note:: For nearest and linear the time-stamps of the data should correspond to the middle of the interval the data is measured for. Either make sure the time-stamps on the datafiles is set this way, or use the ``offset`` described above to set it. + +In the sections below we go over each of the relevant ``DATM_MODE`` options and what the above DATM settings are for each. This gives you examples of actual usage for the settings. We also describe in what ways you might want to customize them for your own case. + +-------------------------------------- +CLMCRUNCEP mode and it's DATM settings +-------------------------------------- + +In ``CLMCRUNCEP`` mode the CRUNCEP dataset is used and all of it's data is on a 6-hourly interval. +Like ``CLM_QIAN`` the dataset is divided into those three data streams: solar, precipitation, and everything else (temperature, pressure, humidity and wind). +The time-stamps of the data were also adjusted so that they are the beginning of the interval for solar, and the middle for the other two. +Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is: ``coszen``, ``nearest``, and ``linear`` for the solar, precipitation and other data respectively. +``taxmode`` is set to ``cycle`` and ``mapalgo`` is set to ``bilinear`` so that the data is spatially interpolated from the input exact half degree grid to the grid the atmosphere model is being run at (to run at this same model resolution use the 360x720cru_360x720cru resolution). + +.. note:: The "everything else" data stream (of temperature, pressure, humidity and wind) also includes the data for longwave downward forcing as well. Our simulations showed sensitivity to this field, so we backed off in using it, and let DATM calculate longwave down from the other fields. + +For more information on CRUNCEP forcing see `http://dods.extra.cea.fr/data/p529viov/cruncep/ `_. + +------------------------------------ +CLM_QIAN mode and it's DATM settings +------------------------------------ + +In ``CLM_QIAN`` mode the Qian dataset is used which has 6-hourly solar and precipitation data, and 3-hourly for everything else. +The dataset is divided into those three data streams: solar, precipitation, and everything else (temperature, pressure, humidity and wind). +The time-stamps of the data were also adjusted so that they are the beginning of the interval for solar, and the middle for the other two. +Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is: ``coszen``, ``nearest``, and ``linear`` for the solar, precipitation and other data respectively. +``taxmode`` is set to ``cycle`` and ``mapalgo`` is set to ``bilinear`` so that the data is spatially interpolated from the input T62 grid to the grid the atmosphere model is being run at. + +Normally you wouldn't customize the ``CLM_QIAN`` settings, but you might replicate it's use for your own global data that had similar temporal characteristics. + +---------------------------------- +CLM1PT mode and it's DATM settings +---------------------------------- + +In ``CLM1PT`` mode the model is assumed to have half-hourly or hourly data for a single-point. +For the supported datasets that is exactly what it has. +But, if you add your own data you may need to make adjustments accordingly. +Using the ``CLM_USRDAT_NAME`` resolution you can easily extend this mode for your own datasets that may be regional or even global and could be at different temporal frequencies. +If you do so you'll need to make adjustments to your DATM settings. +The dataset has all data in a single stream file. +The time-stamps of the data were also adjusted so that they are at the middle of the interval. +Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is set to ``nearest``. +``taxmode`` is set to ``extend`` and ``mapalgo`` is set to ``nn`` so that simply the nearest point is used. + +If you are using your own data for this mode and it's not at least hourly you'll want to adjust the DATM settings for it. If the data is three or six hourly, you'll need to divide it up into separate streams like in ``CLM_QIAN`` mode which will require fairly extensive changes to the DATM namelist and streams files. For an example of doing this see `Example 5-8 `_. + +---------------------------------------- +CPLHIST3HrWx mode and it's DATM settings +---------------------------------------- + +In ``CPLHIST3HrWx`` mode the model is assumed to have 3-hourly for a global grid from a previous CESM simulation. +Like ``CLM_QIAN`` mode the data is divided into three streams: one for precipitation, one for solar, and one for everything else. +The time-stamps for Coupler history files for CESM is at the end of the interval, so the ``offset`` needs to be set in order to adjust the time-stamps to what it needs to be for the ``tintalgo`` settings. +For precipitation ``taxmode`` is set to ``nearest`` so the ``offset`` is set to ``-5400`` seconds so that the ending time-step is adjusted by an hour and half to the middle of the interval. +For solar ``taxmode`` is set to ``coszen`` so the offset is set to ``-10800`` seconds so that the ending time-step is adjust by three hours to the beginning of the interval. +For everything else ``taxmode`` is set to ``linear`` so the offset is set to ``-5400`` seconds so that the ending time-step is adjusted by an hour and half to the middle of the interval. +For an example of such a case see `the Section called Running with MOAR data as atmospheric forcing to spinup the model in Chapter 4 `_. + + +Normally you wouldn't modify the DATM settings for this mode. +However, if you had data at a different frequency than 3-hours you would need to modify the ``offset`` and possibly the ``taxmode``. +The other two things that you might modify would be the path to the data or the domain file for the resolution (which is currently hardwired to f09). +For data at a different input resolution you would need to change the domain file in the streams file to use a domain file to the resolution that the data comes in on. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/index.rst b/doc/source/users_guide/setting-up-and-running-a-case/index.rst new file mode 100644 index 0000000000..a9c1cb7d13 --- /dev/null +++ b/doc/source/users_guide/setting-up-and-running-a-case/index.rst @@ -0,0 +1,19 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _customizing_section: + +##################################### +Setting Up and Running a Case +##################################### + +.. toctree:: + :maxdepth: 2 + + choosing-a-compset.rst + customizing-the-clm-configuration.rst + customizing-the-clm-namelist.rst + customizing-the-datm-namelist.rst + diff --git a/doc/source/users_guide/testing/index.rst b/doc/source/users_guide/testing/index.rst new file mode 100644 index 0000000000..18c418fca4 --- /dev/null +++ b/doc/source/users_guide/testing/index.rst @@ -0,0 +1,18 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _testing: + +##################################### +Testing +##################################### + +.. toctree:: + :maxdepth: 2 + :numbered: + + testing.rst + + diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst new file mode 100644 index 0000000000..91db57fc70 --- /dev/null +++ b/doc/source/users_guide/testing/testing.rst @@ -0,0 +1,62 @@ +.. _testing: + +******* +Testing +******* + +Technically, you could use the customization we gave in `Chapter 1 `_ to test various configuration and namelist options for CLM. +Sometimes, it's also useful to have automated tests though to test that restarts give exactly the same results as without a restart. +It's also useful to have automated tests to run over a wide variety of configurations, resolutions, and namelist options. +To do that we have several different types of scripts set up to make running comprehensive testing of CLM easy. +There are two types of testing scripts for CLM. +The first are the CESM test scripts, which utilize the **create_newcase** scripts that we shown how to use in this User's Guide. +The second are a set of stand-alone scripts that use the CLM **configure** and **build-namelist** scripts to build and test the model as well as testing the CLM tools as well. +Below we will go into further details of how to use both methods. + + +CIME Testing scripts +==================== + +We first introduce the test scripts that work for all CESM components. +The CIME script **create_test** runs a specific type of test, at a given resolution, for a given compset using a given machine. +There is a list of different tests, but the "ERI" tests do several things at once, running from startup, as well as doing exact branch and restart tests. +So to run "ERI" testing at 2-degree with the I1850CRUCLM45 compset on yellowstone_intel you do the following. +:: + + > cd scripts + > ./create_test -testname ERI.f19_g16.I1850CRUCLM45.yellowstone_intel + > cd ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id + > ./ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id.build + > ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id.submit + +When the test is done it will update the file TestStatus with either a PASS or FAIL message. + +We already have a standard list of tests for clm (the "aux_clm" list of tests). To run the CLM yellowstone intel compiler test list, for the same machine and compiler you would do the following: +:: + + > cd scripts + > ./create_test -xml_mach yellowstone -xml_compiler intel -xml_category aux_clm -mach yellowstone -compiler intel + # Normally it will submit the jobs as they are ready, but if it's interrupted you + # may need to submit by hand as follows... + # Submit the suite of tests (note $id refers to the integer job number for this job) + > ./cs.submit.$id.yellowstone + # Later check the tests with... + > ./cs.status.$id + # The above will give a PASS or FAIL message for each test. + +For more information on doing testing with the CESM scripts see the `CESM1.2.0 User's Guide `_ on testing. + +Testing PTCLM +============= + +There is a simple test script for PTCLM called ``testcases.csh`` in the PTCLM directory (``scripts/ccsm_utils/Tools/lnd/clm/PTCLM``). +The test script is setup to run on the machines: yellowstone, frankfurt, yong, and titan. +You simply run the script interactively. +The script will write out the status of tests to a file called: ``tc.job#.status``. + +There are a few environment variables that can be used with ``testcases.csh`` to change it's operation. + +``CESM_ROOT``: To test with a separate root to CESM code set this env variable to the root directory to use. +``CLM_SOFF``: If set to ``TRUE`` - stop on first failed test rather than continuing to run. +``CLM_RETAIN_FILES``: If set to ``FALSE`` - cleanup tools build first. +``DEBUG``: If set to ``TRUE`` - setup cases, but do not build or run. diff --git a/doc/source/users_guide/trouble-shooting/index.rst b/doc/source/users_guide/trouble-shooting/index.rst new file mode 100644 index 0000000000..f4c6d813fc --- /dev/null +++ b/doc/source/users_guide/trouble-shooting/index.rst @@ -0,0 +1,15 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _troubleshooting: + +##################################### +Troubleshooting +##################################### + +.. toctree:: + :maxdepth: 2 + + trouble-shooting.rst diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst new file mode 100644 index 0000000000..5a2fb07192 --- /dev/null +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -0,0 +1,395 @@ +.. _trouble-shooting: + +********************* +Trouble Shooting +********************* + +In this chapter we give some guidance on what to do when you encounter some of the most common problems. We can't cover all the problems that a user could potentially have, but we will try to help you recognize some of the most common situations. And we'll give you some suggestions on how to approach the problem to come up with a solution. + +In general you will run into one of three type of problems: + +1. *setup-time* +#. *build-time* +#. *run-time* + + +Setup Problems +============== + +The first type of problem happens when you invoke the **case.setup** command. +This indicates there is something wrong with your input datasets, or the details of what you are trying to setup the model to do. +There's also a trouble-shooting chapter in the `CESM1.2.0 Scripts User's Guide `_. +Many of the problems with configuration can be resolved with the guidelines given there. +Here we will restrict ourselves to problems from the input files. + +Example: Missing datasets +---------------------------------------------------------------- +:: + + > ./create_newcase -case ne60rcp6 -res ne60_g16 -compset IRCP60CN \ + -mach yellowstone_intel + > ./case.setup + +The following is what is displayed to the screen. +:: + + . + . + . + Running preview_namelist script + CLM configure done. + CLM adding use_case 1850-2100_rcp6_transient defaults for var clm_demand with val fpftdyn + CLM adding use_case 1850-2100_rcp6_transient defaults for var clm_start_type with val startup + CLM adding use_case 1850-2100_rcp6_transient defaults for var model_year_align_ndep with val 1850 + CLM adding use_case 1850-2100_rcp6_transient defaults for var rcp with val 6 + CLM adding use_case 1850-2100_rcp6_transient defaults for var sim_year with val 1850 + CLM adding use_case 1850-2100_rcp6_transient defaults for var sim_year_range with val 1850-2100 + CLM adding use_case 1850-2100_rcp6_transient defaults for var stream_year_first_ndep with val 1850 + CLM adding use_case 1850-2100_rcp6_transient defaults for var stream_year_last_ndep with val 2100 + CLM adding use_case 1850-2100_rcp6_transient defaults for var use_case_desc with val Simulate transient land-use, aerosol and Nitrogen deposition changes + with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM + + build-namelist - No default value found for fpftdyn. + Are defaults provided for this resolution and land mask? + ERROR: clm.buildnml.csh failed + ERROR: /Users/erik/clm_cesm1_1_1_rel/scripts/ne60rcp6/preview_namelists failed: 25344 + +The important thing to note here is the line: +:: + + ERROR: clm.buildnml.csh failed + +which tells us that the problem is in the land **clm.buildnml.csh**. It may also indicate problems in one of the other buildnml.csh files (atm, cesm, cpl, glc, ice, or ocn), in which case you should consult the appropriate model user's guide. + +In the example, the error is that the CLM XML database does NOT have a ``finidat`` for the given resolution, rcp scenario and ocean mask. That means you will need to create the file and then supply the file into your case. See `Chapter 2 `_ for more information on creating files, and see `Chapter 3 `_ for more information on adding files to the XML database. Alternatively, you can provide the file to your case by creating a user namelist as shown in `the Section called User Namelist in Chapter 1 `_. + +.. note:: The two most common problems from your **clm.buildnml.csh** will be errors from the CLM **configure** or **build-namelist**. For more information on these scripts see: `the Section called More information on the CLM configure script in Chapter 1 `_ and `the section on CLM_BLDNML_OPTS `_. + + +Build problems +================ + +The following is an example of running the build for a case and having it fail in the land model build. +As you can see it lists which model component is being built and the build log for that component. +:: + + CCSM BUILDEXE SCRIPT STARTING + - Build Libraries: mct pio csm_share + Sat Jun 19 21:21:19 MDT 2010 /ptmp/erik/test_build/mct/mct.bldlog.100619-212107 + Sat Jun 19 21:22:18 MDT 2010 /ptmp/erik/test_build/pio/pio.bldlog.100619-212107 + Sat Jun 19 21:23:18 MDT 2010 + /ptmp/erik/test_build/csm_share/csm_share.bldlog.100619-212107 + Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/cpl.bldlog.100619-212107 + Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/atm.bldlog.100619-212107 + Sat Jun 19 21:24:06 MDT 2010 /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 + ERROR: clm.buildexe.csh failed, see /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 + ERROR: cat /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 + +You can then examine the build log that failed and see what went wrong. Most compilers will give the full filepath and line number for the file that filed to compile. + +Run Time Problems +================= + +Tracking down problems while the model is running is much more difficult to do than setup or build problems. +In this section we will give some suggestions on how to find run time problems. +Below we show the log file results of a job that aborted while running. +:: + + CCSM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY + Sun Jun 20 18:24:06 MDT 2010 -- CSM EXECUTION BEGINS HERE + Sun Jun 20 18:24:35 MDT 2010 -- CSM EXECUTION HAS FINISHED + Model did not complete - see /ptmp/erik/test_run/run/cpl.log.100620-182358 + +In the next section we will talk about using the different log files to track down problems, and find out where the problem is coming from. In the section after that we give some general advice on debugging problems and some suggestions on ideas that may be helpful to track the problem down. Some of the examples below are from the `models/lnd/clm/doc/KnownBugs `_ file. + +Tracking Problems by Querying Log Files +--------------------------------------- + +The first thing to do when tracking down problems is to query the different log files to see if you can discover where the problem occurs, and any error messages about it. +It's important to figure out if the problem comes in at initialization or in the run phase of the model, and in which model component the problem happens. +There are different log files for the different major components, and they all end with the date and time in YYMMDD-HHMMSS format (2-digit: year, month, day, hour minute and second). +When the model runs to completion the log files will be copied to the logs directory in the script directory, but when the model fails they will remain in the run directory. +Here's an example list of log files from an "I" case where the model dies in the land model initialization. +For "I" cases the sea-ice and ocean components are just stubs and don't create log files (and unless running with the active land-ice model "glc" log files won't be created either). +:: + + atm.log.100620-182358 + cesm.log.100620-182358 + cpl.log.100620-182358 + lnd.log.100620-182358 + +The coupler log file +-------------------- + +The first log file to check is the coupler log file so that you can see where the model dies and which model component it fails in. When the model dies at initialization the last model component listed is the component that failed. + +Example of a case that fails in the CLM land model initialization. +:: + + (seq_timemgr_clockPrint) Prev Time = 00001201 00000 + (seq_timemgr_clockPrint) Next Time = 99991201 00000 + (seq_timemgr_clockPrint) Intervl yms = 9999 0 0 + + (seq_mct_drv) : Initialize each component: atm, lnd, ocn, and ice + (seq_mct_drv) : Initialize atm component + (seq_mct_drv) : Initialize lnd component + +The cesm log file +----------------- + +The cesm log files are to some extent the "garbage collection" of log output. +The CLM sends it's output from it's master processor, but sends other output and possibly errors to the cesm log file. +Because, of this, often error messages are somewhere in the cesm log file. +However, since there is so much other output it may be difficult to find. +For example, here is some output from an older version of CESM (CESM1.0.2) where the RTM river routing file (before it was converted to NetCDF) was not provided and the error on the open statement for the file was embedded near the end of the cesm log file. +:: + + NODE# NAME + ( 0) be1105en.ucar.edu + "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line + 239: 1525-155 The file name provided in the OPEN statement for unit 1 has zero length or + contains all blanks. The program will recover by ignoring the OPEN statement. + "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line + 241: 1525-001 The READ statement on the file fort.1 cannot be completed because the end + of the file was reached. The program will stop. + + Running: ./cesm.exe + Please wait... + + Memory usage for ./cesm.exe (task # 0) is: 51696 KB. Exit status: 1. Signal: 0 + +Although the example is from an earlier version of the model it still serves to illustrate finding problems from the cesm log file. + +When working with the cesm log file, for a run-time problem, you will need to be able to separate it's output into three categories: pre-crash, crash, and post-crash. +The pre-crash section is everything that is normal output for good operation of the model. +The crash section is the section where the model dies and reports on the actual problem. +the post-crash section is the cleanup and finalization after the model dies. +The most important part of this of course is the crash section. +The tricky part is distinguishing it from the other sections. +Also because the cesm log file most likely has duplicated output from multiple processors it is even more difficult to distinguish the different sections and to some extent the sections may be intertwined, as different processors reach the different sections at different times. +Because, of this reducing the number of processors for your simulation may help you sort out the output in the file (see `the Section called Run with a smaller set of processors `_). +Also much of the output from the cesm log file are system level information having to do with MPI multiprocessing. +Usually you can ignore this information, but it makes it more difficult to trudge through. + + +Sometimes the cesm log file is the ONLY file available, because the model terminates early in initialization. +In this case understanding the output in the cesm log file becomes even more important. +This also indicates the model did NOT advance far enough to reach the initialization of the individual model components. +This may mean that the initialization of the multiprocessing for MPI and/or OpenMP failed, or that the reading of the driver namelist file "drv_in" failed. + + +Here we show those three sections for a cesm log file where a two task job failed on reading the namelist file. +For a typical job with many tasks similar sections of this will be repeated not just twice but for each task and hence make it harder to read. + + +*Pre-crash section of the cesm log file* +:: + + ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. + + ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. + ATTENTION: 0031-378 MP_EUIDEVICE setting ignored when LoadLeveler is not being used. + ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. + 0:INFO: 0031-724 Executing program: + 1:INFO: 0031-724 Executing program: + 0:/contrib/bin/cesm_launch: process 401894 bound to logical CPU 0 on host be0310en.ucar.edu ... + 1:/contrib/bin/cesm_launch: process 439264 bound to logical CPU 1 on host be0310en.ucar.edu ... + 0:INFO: 0031-619 64bit(us, Packet striping on) ppe_rmas MPCI_MSG: MPI/MPCI library was compiled on Wed Aug 5 13:36:06 2009 + 0: + 1:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 + 1:. + 1:LAPI is using lightweight lock. + 0:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 + 0:. + 0:LAPI is using lightweight lock. + 0:Use health ping for failover/recovery + 1:Use health ping for failover/recovery + 0:Initial communication over instance 2. + 1:Initial communication over instance 0. + 1:IB RDMA initialization completed successfully + 1:The MPI shared memory protocol is used for the job + 0:IB RDMA initialization completed successfully + 0:LAPI job ID for this job is: 1684890719 + 0:The MPI shared memory protocol is used for the job + 0:(seq_comm_setcomm) initialize ID ( 7 GLOBAL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 2 ATM ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 1 LND ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 4 ICE ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 5 GLC ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 3 OCN ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_setcomm) initialize ID ( 6 CPL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_joincomm) initialize ID ( 8 CPLATM ) join IDs = 6 2 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_joincomm) initialize ID ( 9 CPLLND ) join IDs = 6 1 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_joincomm) initialize ID ( 10 CPLICE ) join IDs = 6 4 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_joincomm) initialize ID ( 11 CPLOCN ) join IDs = 6 3 ( npes = 2) ( nthreads = 1) + 0:(seq_comm_joincomm) initialize ID ( 12 CPLGLC ) join IDs = 6 5 ( npes = 2) ( nthreads = 1) + 0: + 0: (seq_comm_printcomms) ID layout : global pes vs local pe for each ID + 0: gpe LND ATM OCN ICE GLC CPL GLOBAL CPLATM CPLLND CPLICE CPLOCN CPLGLC nthrds + 0: --- ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ + 0: 0 : 0 0 0 0 0 0 0 0 0 0 0 0 1 + 1: 1 : 1 1 1 1 1 1 1 1 1 1 1 1 1 + 1: + 0: (t_initf) Read in prof_inparm namelist from: drv_in + 1: (seq_io_init) cpl_io_stride, iotasks or root out of bounds - resetting to defaults 4 0 1 + 0: piolib_mod.f90 1353 1 2 1 2 + 1: piolib_mod.f90 1353 1 2 1 2 + 0: pio_support::pio_die:: myrank= 0 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride + 1: pio_support::pio_die:: myrank= 1 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride + +*Crash section of the cesm log file* +:: + + 0: + 0: Traceback: + 1: + 1: Traceback: + 0: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in + 1: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in + 0: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 + 1: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 + 1: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 + 0: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 + 0: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 + 0: --- End of call chain --- + 1: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 + 1: --- End of call chain --- + +*Post-crash section of the cesm log file* +:: + + 1:Communication statistics of task 1 is associated with task key: 1684890719_1 + 0:Communication statistics of task 0 is associated with task key: 1684890719_0 + 0: + 0:Running: ./cesm.exe + 0:Please wait... + 0: + 0:Memory usage for ./cesm.exe (task # 0) is: 198892 KB. Exit status: 134. Signal: 0 + 1: + 1:Running: ./cesm.exe + 1:Please wait... + 1: + 1:Memory usage for ./cesm.exe (task # 0) is: 198572 KB. Exit status: 134. Signal: 0 + INFO: 0031-656 I/O file STDOUT closed by task 0 + INFO: 0031-656 I/O file STDERR closed by task 0 + ERROR: 0031-250 task 0: IOT/Abort trap + INFO: 0031-656 I/O file STDOUT closed by task 1 + INFO: 0031-656 I/O file STDERR closed by task 1 + ERROR: 0031-250 task 1: IOT/Abort trap + INFO: 0031-639 Exit status from pm_respond = 0 + ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. + Job /usr/local/lsf/7.0/aix5-64/bin/poejob /contrib/bin/ccsm_launch /contrib/bin/job_memusage.exe ./cesm.exe + + TID HOST_NAME COMMAND_LINE STATUS TERMINATION_TIME + ===== ========== ================ ======================= =================== + 00000 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 + 00001 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 + +The CLM log file +---------------- + +Of course when you are working with and making changes to CLM, most of your focus will be on the CLM log file and the errors it shows. +As already pointed out if you don't see errors in the ``lnd.log.*`` file you should look in the ``cesm.log.*`` to see if any errors showed up there. + +Here's an example of the ``lnd.log.*`` file when running ``PTS_MODE`` with initial conditions (this is bug 1025 in the `models/lnd/clm/doc/KnownLimitationss `_ file). +:: + + Successfully initialized variables for accumulation + + reading restart file I2000CN_f09_g16_c100503.clm2.r.0001-01-01-00000.nc + Reading restart dataset + ERROR - setlatlon.F:Cant get variable dim for lat or lsmlat + ENDRUN: called without a message string + +The DATM log file +----------------- + +When working with "I cases" the second most common problems after CLM problems are problems with the data atmosphere model. So examining the ``atm.log.*`` is important. + +Here's an example of a problem that occurs when the wrong prescribed aerosol file is given to a ``pt1_pt1`` simulation. +:: + + (datm_comp_init) atm mode = CLMNCEP + (shr_strdata_init) calling shr_dmodel_mapSet for fill + (shr_strdata_init) calling shr_dmodel_mapSet for remap + ('shr_map_getWts') ERROR: yd outside bounds 19.5000000000000000 + (shr_sys_abort) ERROR: ('shr_map_getWts') ERROR yd outside 90 degree bounds + (shr_sys_abort) WARNING: calling shr_mpi_abort() and stopping + +The batch log files +------------------- + +The names of the batch log files will depend on the batch system of the machine that is being used. They will normally be in the script directory. Usually, they don't contain important information, but they are a last resort place to look for error messages. On the NCAR system "yellowstone" the batch files are called with names that start with the batch submission script and then either "stderr.o" or "stdout.o", with the job number at the end. + +General Advice on Debugging Run time Problems +============================================= + +Here are some suggestions on how to track down a problem while running. In general if the problem still occurs for a simpler case, it will be easier to track down. + +1. *Run in DEBUG mode* +#. *Run with a smaller set of processors* +#. *Run in serial mode with a single processor* +#. *Run at a lower resolution* +#. *Run a simpler case* +#. *Run with a debugger* + +Run in DEBUG mode +----------------- + +The first thing to try is to run in DEBUG mode so that float point trapping will be triggered as well as array bounds checking and other things the compiler can turn on to help you find problems. +To do this edit the ``env_build.xml`` file and set DEBUG to TRUE as follows: +:: + + > ./xmlchange DEBUG=TRUE + + +Run with a smaller set of processors +------------------------------------ + +Another way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit the --env_mach_pes.xml--. For example, to run with four processors: +:: + + > ./case.setup -clean + > ./xmlchange NTASKS_ATM=4,NTASKS_LND=4,NTASKS_ICE=4,NTASKS_OCN=4,NTASKS_CPL=4,NTASKS_GLC=4 + > ./case.setup + +Another recommended simplification is to run without threading, so set the NTHRDS for each component to "1" if it isn't already. Sometimes, multiprocessing problems require a certain number of processors before they occur so you may not be able to debug the problem without enough processors. But, it's always good to reduce it to as low a number as possible to make it simpler. For threading problems you may have to have threading enabled to find the problem, but you can run with 1, 2, or 3 threads to see what happens. + +Run in serial mode with a single processor +------------------------------------------ + +Simplifying to one processor removes all multi-processing problems and makes the case as simple as possible. If you can enable ``MPILIB=mpi-serial`` you will also be able to run interactively rather than having to submit to a job queue, which sometimes makes it easier to run and debug. If you can use ``MPILIB=mpi-serial`` you can also use threading, but still run interactively in order to use more processors to make it faster if needed. +:: + + > ./case.setup -clean + # Set tasks and threads for each component to 1 + # You could also set threads to something > 1 for speed, but still + # run interactively if threading isn't an issue. + + > ./xmlchange NTASKS_ATM=1,NTHRDS_ATM=1,NTASKS_LND=1,NTHRDS_LND=1,NTASKS_ICE=1,NTHRDS_ICE=1 + > ./xmlchange NTASKS_OCN=1,NTHRDS_OCN=1,NTASKS_CPL=1,NTHRDS_CPL=1,NTASKS_GLC=1,NTHRDS_GLC=1 + # set MPILIB to mpi-serial so that you can run interactively + > ./xmlchange MPILIB=mpi-serial + > ./case.setup + # Then build your case + # And finally run, by running the *.run script interactively + +Run at a lower resolution +------------------------- + +If you can create a new case running at a lower resolution and replicate the problem it may be easier to solve. This of course requires creating a whole new case, and trying out different lower resolutions. + +Run a simpler case +------------------ + +Along the same lines, you might try running a simpler case, trying another compset with a simpler setup and see if you can replicate the problem and then debug from that simpler case. Again, of course you will need to create new cases to do this. + +Run with a debugger +------------------- + +Another suggestion is to run the model with a debugger such as: **dbx**, **gdb**, or **totalview**. +Often to run with a debugger you will need to reduce the number of processors as outlined above. +Some debuggers such as **dbx** will only work with one processor, while more advanced debuggers such as **totalview** can work with both MPI tasks and OMP threads. +Even simple debuggers though can be used to query core files, to see where the code was at when it died (for example using the **where** in **dbx** for a core file can be very helpful. +For help in running with a debugger you will need to contact your system administrators for the machine you are running on. + diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst new file mode 100644 index 0000000000..c2633e6522 --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -0,0 +1,162 @@ +======================== + Building the CLM tools +======================== + +The FORTRAN tools all have similar makefiles, and similar options for building. +All of the Makefiles use GNU Make extensions and thus require that you use GNU make to use them. +They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. +There are also environment variables that can be set to set things that must be customized. +All the tools use NetCDF and hence require the path to the NetCDF libraries and include files. +On some platforms (such as Linux) multiple compilers can be used, and hence there are env variables that can be set to change the FORTRAN and/or "C" compilers used. +The tools other than cprnc also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. +Finally the tools other than **cprnc** allow you to turn optimization on (which is off by default but on for the **mksurfdata_map** and **interpinic** programs) with the OPT flag so that the tool will run faster. +To get even faster performance, the **interpinic**, program allows you to also use the SMP to turn on multiple shared memory processors. +When ``SMP=TRUE`` you set the number of threads used by the program with the ``OMP_NUM_THREADS`` environment variable. + +Options used by all: **cprnc**, **interpinic**, and **mksurfdata_map** + +- ``LIB_NETCDF`` -- sets the location of the NetCDF library. +- ``INC_NETCDF`` -- sets the location of the NetCDF include files. +- ``USER_FC`` -- sets the name of the FORTRAN compiler. + +Options used by: **interpinic**, **mkprocdata_map**, **mkmapgrids**, and **mksurfdata_map** + +- ``MOD_NETCDF`` -- sets the location of the NetCDF FORTRAN module. +- ``USER_LINKER`` -- sets the name of the linker to use. +- ``USER_CPPDEFS`` -- adds any CPP defines to use. +- ``USER_CFLAGS`` -- add any "C" compiler flags to use. +- ``USER_FFLAGS`` -- add any FORTRAN compiler flags to use. +- ``USER_LDFLAGS`` -- add any linker flags to use. +- ``USER_CC`` -- sets the name of the "C" compiler to use. +- ``OPT`` -- set to TRUE to compile the code optimized (TRUE or FALSE) +- ``SMP`` -- set to TRUE to turn on shared memory parallelism (i.e. OpenMP) (TRUE or FALSE) +- ``Filepath`` -- list of directories to build source code from. +- ``Srcfiles`` -- list of source code filenames to build executable from. +- ``Makefile`` -- customized makefile options for this particular tool. +- ``mkDepends`` -- figure out dependencies between source files, so make can compile in order.. +- ``Makefile.common`` -- General tool Makefile that should be the same between all tools. + +Options used only by **cprnc**: + +- ``EXEDIR`` -- sets the location where the executable will be built. +- ``VPATH`` -- colon delimited path list to find the source files. + +More details on each environment variable. + +``LIB_NETCDF`` + This variable sets the path to the NetCDF library file (``libnetcdf.a``). If not set it defaults to ``/usr/local/lib``. In order to use the tools you need to build the NetCDF library and be able to link to it. In order to build the model with a particular compiler you may have to compile the NetCDF library with the same compiler (or at least a compatible one). + +``INC_NETCDF`` + This variable sets the path to the NetCDF include directory (in order to find the include file ``netcdf.inc``). if not set it defaults to ``/usr/local/include``. + +``MOD_NETCDF`` + This variable sets the path to the NetCDF module directory (in order to find the NetCDF FORTRAN-90 module file when NetCDF is used with a FORTRAN-90 **use statement**. When not set it defaults to the ``LIB_NETCDF`` value. + +``USER_FC`` + This variable sets the command name to the FORTRAN-90 compiler to use when compiling the tool. The default compiler to use depends on the platform. And for example, on the AIX platform this variable is NOT used + +``USER_LINKER`` + This variable sets the command name to the linker to use when linking the object files from the compiler together to build the executable. By default this is set to the value of the FORTRAN-90 compiler used to compile the source code. + +``USER_CPPDEFS`` + This variable adds additional optional values to define for the C preprocessor. Normally, there is no reason to do this as there are very few CPP tokens in the CLM tools. However, if you modify the tools there may be a reason to define new CPP tokens. + +``USER_CC`` + This variable sets the command name to the "C" compiler to use when compiling the tool. The default compiler to use depends on the platform. And for example, on the AIX platform this variable is NOT used + +``USER_CFLAGS`` + This variable adds additional compiler options for the "C" compiler to use when compiling the tool. By default the compiler options are picked according to the platform and compiler that will be used. + +``USER_FFLAGS`` + This variable adds additional compiler options for the FORTRAN-90 compiler to use when compiling the tool. By default the compiler options are picked according to the platform and compiler that will be used. + +``USER_LDFLAGS`` + This variable adds additional options to the linker that will be used when linking the object files into the executable. By default the linker options are picked according to the platform and compiler that is used. + +``SMP`` + This variable flags if shared memory parallelism (using OpenMP) should be used when compiling the tool. It can be set to either TRUE or FALSE, by default it is set to FALSE, so shared memory parallelism is NOT used. When set to TRUE you can set the number of threads by using the OMP_NUM_THREADS environment variable. Normally, the most you would set this to would be to the number of on-node CPU processors. Turning this on should make the tool run much faster. + +.. warning:: Note, that depending on the compiler answers may be different when SMP is activated. + +``OPT`` + This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to ``FALSE`` for **mkmapgrids** and ``TRUE`` for **mksurfdata_map**, **mkprocdata_map** and **interpinic**. Turning this on should make the tool run much faster. + +.. warning:: Note, you should expect that answers will be different when ``OPT`` is activated. + +``Filepath`` + All of the tools are stand-alone and don't need any outside code to operate. The Filepath is the list of directories needed to compile and hence is always simply "." the current directory. Several tools use copies of code outside their directory that is in the CESM distribution (either ``csm_share`` code or CLM source code). + +``Srcfiles`` + The ``Srcfiles`` lists the filenames of the source code to use when building the tool. + +``Makefile`` + The ``Makefile`` is the custom GNU Makefile for this particular tool. It will customize the ``EXENAME`` and the optimization settings for this particular tool. + +``Makefile.common`` + The ``Makefile.common`` is the copy of the general GNU Makefile for all the CLM tools. This file should be identical between the different tools. This file has different sections of compiler options for different Operating Systems and compilers. + +``mkDepends`` + The ``mkDepends`` is the copy of the perl script used by the ``Makefile.common`` to figure out the dependencies between the source files so that it can compile in the necessary order. This file should be identical between the different tools. + +``EXEDIR`` + The cprnc tool uses this variable to set the location of where the executable will be built. The default is the current directory. + +``VPATH`` + The **cprnc** tool uses this variable to set the colon delimited pathnames of where the source code exists. The default is the current directory. + +.. note:: There are several files that are copies of the original files from either models``/lnd/clm/src/util_share``, ``models/csm_share/shr``, or copies from other tool directories. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. + +The *README.filecopies* (which can be found in ``models/lnd/clm/tools``) is repeated here. +:: + + models/lnd/clm/tools/README.filecopies Jun/04/2013 + + There are several files that are copies of the original files from + either models/lnd/clm/src/main, models/csm_share/shr, + models/csm_share/unit_testers, or copies from other tool + directories. By having copies the tools can all be made stand-alone, + but any changes to the originals will have to be put into the tool + directories as well. + + I. Files that are IDENTICAL: + + 1. csm_share files copied that should be identical to models/csm_share/shr: + + shr_const_mod.F90 + shr_log_mod.F90 + shr_timer_mod.F90 + + 2. csm_share files copied that should be identical to models/csm_share/unit_testers: + + test_mod.F90 + + 3. clm/src files copied that should be identical to models/lnd/clm/src/util_share: + + nanMod.F90 + + II. Files with differences + + 1. csm_share files copied with differences: + + shr_kind_mod.F90 --- SHR_KIND_CXX is new + shr_sys_mod.F90 ---- Remove mpi abort and reference to shr_mpi_mod.F90. + shr_infnan_mod.F90 - Earlier version + shr_string_mod.F90 - Earlier version + shr_file_mod.F90 --- mkprocdata_map version is stripped down + clm_varctl.F90 ----- Earlier version + + 2. clm/src files with differences: + + fileutils.F90 --- Remove use of masterproc and spmdMod and endrun in abortutils. + + 4. Files in mkmapgrids + + domainMod.F90 ---- Highly customized based off an earlier version of clm code. + Remove use of abortutils, spmdMod. clm version uses latlon + this version uses domain in names. Distributed memory + parallelism is removed. + + 5. Files in mksurfdata_map + + mkvarpar.F90 --- clm4_0 and clm4_5 versions are different and different from main clm versions. + diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst new file mode 100644 index 0000000000..e921858b4c --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/cprnc.rst @@ -0,0 +1,29 @@ +.. comparing-history-files: + +========================= + Comparing History Files +========================= + +**cprnc** is a tool shared by both CAM and CLM to compare two NetCDF history files. +It differences every field that has a time-axis that is also shared on both files, and reports a summary of the difference. +The summary includes the three largest differences, as well as the root mean square (RMS) difference. +It also gives some summary information on the field as well. +You have to enter at least one file, and up to two files. +With one file it gives you summary information on the file, and with two it gives you information on the differences between the two. +At the end it will give you a summary of the fields compared and how many fields were different and how many were identical. + +Options: + +-m = do NOT align time-stamps before comparing + +-v = verbose output + +-ipr + +-jpr + +-kpr + +See the **cprnc** `README `_ file for more details. + +.. note:: To compare files with OUT a time axis you can use the **cprnc.ncl** NCL script in ``models/lnd/clm/tools/shared/ncl_scripts``. It won't give you the details on the differences but will report if the files are identical or different. diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst new file mode 100644 index 0000000000..6d4ec7bc12 --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -0,0 +1,27 @@ +.. _creating-domain-files: + +***************************** + Creating CLM domain files +***************************** + +*gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. `Figure 2-4 `_ shows the general flow for a general global case (or for a regional grid that DOES include ocean). `Figure 2-5 `_ shows the use of **mknoocnmap.pl** (see `the Section called Using mknocnmap.pl to create grid and maps for single-point regional grids `_) to create a regional or single-point map file that is then run through **gen_domain** to create the domain file for it. As stated before `Figure 2-2 `_ is the legend for both of these figures. See `the +tools/mapping/gen_domain_files/README `_ file for more help on **gen_domain**. + +Here we create domain files for a regular global domain. + +Figure 2-4. Global Domain file creation +======================================= + +Insert figure 2-4 + +Starting from SCRIP grid files for both your atmosphere and ocean, you use **tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see `Figure 2-5 `_. (See `Figure 2-2 `_ for the legend for this figure.) + +Note, that the SCRIP grid file used to start this process, is also used in **mkmapdata.sh** (see `the Section called Creating mapping files that mksurfdata_map will use `_). Next we create domain files for a single-point or regional domain. + +Figure 2-5. Domain file creation using mknoocnmap.pl +==================================================== +Insert figure 2-5 + +For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use **mknoocnmap.pl**. It creates a SCRIP grid file that can then be used as input to **mkmapdata.sh** as well as a SCRIP mapping file that is then input to **gen_domain**. The output of **gen_domain** is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See `Figure 2-2 `_ for the legend for this figure.) + +In this case the process creates both SCRIP grid files to be used by **mkmapdata.sh** as well as the domain files that will be used by both CLM and DATM. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst new file mode 100644 index 0000000000..332aa5bd65 --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -0,0 +1,116 @@ +.. _creating-maps-for-mksurfdata: + +********************************************* +Creating input for surface dataset generation +********************************************* + +1. Generating SCRIP grid files +================================== + +The utility ``mkmapdata.sh`` requires SCRIP format input files to describe the input and output grids that maps are generated for. CLM provides a utility, ``mkmapgrids`` that generates those files. +The program converts old formats of CAM or CLM grid files to SCRIP grid format. There is also a NCL script (``mkscripgrid.ncl``) to create regular latitude longitude regional or single-point grids at the resolution the user desires. + +SCRIP grid files for all the standard model resolutions and the raw surface datasets have already been done and the files are in the XML database. Hence, this step doesn't need to be done -- EXCEPT WHEN YOU ARE CREATING YOUR OWN GRIDS. If you have a CLM grid or CAM file from previous versions and you want to convert it you can use **mkmapgrids**. + +Using mknocnmap.pl to create grid and maps for single-point regional grids +-------------------------------------------------------------------------- + +If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use **mknoocnmap.pl** in ``models/lnd/clm/tools/shared/mkmapdata`` which will create both the SCRIP grid file you need (using ``models/lnd/clm/tools/shared/mkmapgrids/mkscripgrid.ncl`` AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use **ESMF_RegridWeightGen** to create the mapping file, and **gen_domain** to create the domain file. Like other tools, ``shared/mkmapdata/mknoocnmap.pl`` has a help option with the following: +:: + + SYNOPSIS + mknoocnmap.pl [options] Gets map and grid files for a single land-only point. + REQUIRED OPTIONS + -centerpoint [or -p] Center latitude,longitude of the grid to create. + -name [-or -n] Name to use to describe point + + OPTIONS + -dx Size of total grid in degrees in longitude direction + (default is 0.1) + -dy Size of total grid in degrees in latitude direction + (default is 0.1) + -silent [or -s] Make output silent + -help [or -h] Print usage to STDOUT. + -verbose [or -v] Make output more verbose. + -nx Number of longitudes (default is 1) + -ny Number of latitudes (default is 1) + +See `Figure 2-5 `_ for a visual representation of this process. + + +2. Creating mapping files for mksurfdata_map +============================================== + +``mkmapdata.sh`` uses the above SCRIP grid input files to create SCRIP mapping data files (uses ESMF). + +The bash shell script ``models/lnd/clm/tools/shared/mkmapgrids/mkmapdata.sh`` uses **ESMF_RegridWeightGen** to create a list of maps from the raw datasets that are input to **mksurfdata_map**. +Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. +Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each DIFFERENT raw dataset. +See `Figure 2-3 `_ for a visual representation of how this works. +The bash script figures out which mapping files it needs to create and then runs **ESMF_RegridWeightGen** for each one. +You can then either enter the datasets into the XML database (see `Chapter 3 `_ or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to **mksurfdata_map** (see `the Section called Running mksurfdata.pl `_ below). +Use the "-phys" option to specify if you are creating mapping files for clm4_0 or clm4_5 (the list of raw datafiles is somewhat different between the two). +mkmapdata.sh has a help option with the following +:: + + ../../tools/shared/mkmapdata/mkmapdata.sh + + ********************** + usage on yellowstone: + ./mkmapdata.sh + + valid arguments: + [-f|--gridfile ] + Full pathname of model SCRIP grid file to use + This variable should be set if this is not a supported grid + This variable will override the automatic generation of the + filename generated from the -res argument + the filename is generated ASSUMING that this is a supported + grid that has entries in the file namelist_defaults_clm.xml + the -r|--res argument MUST be specied if this argument is specified + [-r|--res ] + Model output resolution (default is 10x15) + [-t|--gridtype ] + Model output grid type + supported values are [regional,global], (default is global) + [-p|--phys ] + Whether to generate mapping files for clm4_0 or clm4_5 + supported values are [clm4_0,clm4_5], (default is clm4_5) + [-b|--batch] + Toggles batch mode usage. + If you want to run in batch mode + you need to have a separate batch script for a supported machine + that calls this script interactively - you cannot submit this + script directory to the batch system + [-l|--list] + List mapping files required (use check_input_data to get them) + also writes data to clm.input_data_list + [-d|--debug] + Toggles debug-only (don't actually run mkmapdata just echo what would happen) + [-h|--help] + Displays this help message + [-v|--verbose] + Toggle verbose usage -- log more information on what is happening + + You can also set the following env variables: + ESMFBIN_PATH - Path to ESMF binaries + (default is /contrib/esmf-5.3.0-64-O/bin) + CSMDATA ------ Path to CESM input data + (default is /glade/p/cesm/cseg/inputdata) + MPIEXEC ------ Name of mpirun executable + (default is mpirun.lsf) + REGRID_PROC -- Number of MPI processors to use + (default is 8) + + **pass environment variables by preceding above commands + with 'env var1=setting var2=setting ' + ********************** + + +.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is CLM4.5. + +Figure 2-3. Details of running mkmapdata.sh +------------------------------------------- +Insert figure 2-3 + +Each of the raw datasets for **mksurfdata_map** needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what **mkmapdata.sh** does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in **mksurfdata_map**. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into **mksurfdata_map** see `Figure 2-6 `_. diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst new file mode 100644 index 0000000000..e42a46f81f --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -0,0 +1,376 @@ +.. _creating-surface-datasets: + +=========================== + Creating Surface Datasets +=========================== + +When just creating a replacement file for an existing one, the relevant tool should be used directly to create the file. When you are creating a set of files for a new resolution there are some dependencies between the tools that you need to keep in mind when creating them. The main dependency is that you MUST create a SCRIP grid file first as the SCRIP grid dataset is then input into the other tools. Also look at `Table 3-1 `_ which gives information on the files required and when. `Figure 2-1 `_ shows an overview of the general data-flow for creation of the fsurdat datasets. + +Figure 2-1. Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files +-------------------------------------------------------------------------------- +Insert figure 2-1 + +Starting from a SCRIP grid file that describes the grid you will run the model on, you first run **mkmapdata.sh** to create a list of mapping files. See `Figure 2-3 `_ for a more detailed view of how **mkmapdata.sh** works. The mapping files tell **mksurfdata_map** how to map between the output grid and the raw datasets that it uses as input. The output of **mksurfdata_map** is a surface dataset that you then use for running the model. See `Figure 2-6 `_ for a more detailed view of how **mksurfdata_map** works. + +`Figure 2-2 `_ is the legend for this figure (`Figure 2-1 `_) and other figures in this chapter (`Figure 2-4 `_, `Figure 2-5 `_, and `Figure 2-6 `_). +Figure 2-2. Legend for Data Flow Figures +Insert figure 2-2 + +Green arrows define the input to a program, while red arrows define the output. Cylinders define files that are either created by a program or used as input for a program. Boxes are programs. + +You start with a description of a SCRIP grid file for your output grid file and then create mapping files from the raw datasets to it. Once, the mapping files are created **mksurfdata_map** is run to create the surface dataset to run the model. + +Creating a Complete Set of Files for Input to CLM +------------------------------------------------- + +1. Create SCRIP grid datasets (if NOT already done) + + First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: $CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc. The mkmapgrids and mkscripgrid.ncl NCL script in the models/lnd/clm/tools/shared/mkmapgrids directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. + +2. Create domain dataset (if NOT already done) + + Next use gen_domain to create a domain file for use by DATM and CLM. This is required, unless a domain file was already created. See the Section called Creating a domain file for CLM and DATM for more information on this. + +3. Create mapping files for mksurfdata_map (if NOT already done) + + Create mapping files for mksurfdata_map with mkmapdata.sh in models/lnd/clm/tools/shared/mkmapdata. See the Section called Creating mapping files that mksurfdata_map will use for more information on this. + +4. Create surface datasets + + Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or clm4_5 for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. + +5. Create some sort of initial condition dataset + + You then need to do one of the following three options to have an initial dataset to start from. + + a. Use spinup-procedures to create initial condition datasets + + The first option is to do the spinup procedures from arbitrary initial conditions to get good initial datasets. This is the most robust method to use. See the Section called Spinning up the Satellite Phenology Model (CLMSP spinup) in Chapter 4, the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4, or the Section called Spinning up the CLM4.0 Carbon-Nitrogen Dynamic Global Vegetation Model (CNDV spinup) in Chapter 4 for more information on this. + + b. Use interpinic to interpolate existing initial condition datasets + + The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or clm4_5 for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. + + c. Start up from arbitrary initial conditions + + The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using CLM4.5-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. + +.. warning:: This is NOT recommended as many fields in CLM take a long time to equilibrate. + +6. Enter the new datasets into the build-namelist XML database + The last optional thing to do is to enter the new datasets into the build-namelist XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. + +The ``models/lnd/clm/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: +:: + + models/lnd/clm/tools/README Jun/04/2013 + + CLM tools for analysis of CLM history files -- or for creation or + modification of CLM input files. + + I. General directory structure: + + clm4_0 + mksurfdata_map --- Create surface datasets. + interpinic ------- Interpolate initial datasets to a different resolution. + (has optimized and OMP options) + clm4_5 + mksurfdata_map --- Create surface datasets. + interpinic ------- Interpolate initial datasets to a different resolution. + (has optimized and OMP options) + + shared + mkmapgrids ------- Create SCRIP grid files needed by mkmapdata + [input is CLM grid files] + (deprecated) + mkmapdata -------- Create SCRIP mapping data from SCRIP grid files (uses ESMF) + gen_domain ------- Create data model domain datasets from SCRIP mapping datasets. + (also in the top level mapping directory [../../../../tools/mapping]) + mkprocdata_map --- Convert output unstructured grids into a 2D format that + can be plotted easily + ncl_scripts ------ NCL post or pre processing scripts. + + + Note that there are different versions of mksurfdata_map and interpinic for + CLM4.0 vs. CLM4.5. Other tools are shared between the two model + versions. + + However, note that mkmapdata makes mapping files for CLM4.5 by default; to + make mapping files for CLM4.0, run the tool with the option: + -p clm4_0 + + II. Notes on building/running for each of the above tools: + + Each tool that has FORTRAN source code has the following files: + + README -------------- Specific help for using the specific tool and help on specific + files in that directory. + src/Filepath -------- List of directories needed to build the tool + (some files in ../src directories are required). + src/Makefile -------- Customization of the make for the particular tool in question + src/Makefile.common - General GNU Makefile for creating FORTRAN tools + (these are identical between tools). + src/Srcfiles -------- List of source files that are needed. + src/Mkdepends ------- Dependency generator program + + mkmapdata and ncl_scripts only contain scripts so don't have the above build files. + + Most tools have copies of files from other directories -- see the README.filecopies + file for more information on this. + + Tools may also have files with the directory name followed by: namelist, or runoptions. + + .namelist ------ Namelist to create a global file. + .runoptions ---- Command line options to use the given tool. + + These files are also used by the test scripts to test the tools (see the + README.testing) file. + + NOTE: Be sure to change the path of the datasets references by these namelists to + point to where you have exported your CESM inputdata datasets. + + To build: + + cd + setenv INC_NETCDF + setenv LIB_NETCDF + gmake + + The process will create a file called "Depends" which has the dependencies + for the build of each file on other files. + + By default some codes may be compiled non-optimized + so that you can use the debugger, and with bounds-checking, and float trapping on. + To speed up do the following... + + gmake OPT=TRUE (by default already on for interpinic and mksurfdata_map) + + Also some of the tools allow for OpenMP shared memory parallelism + (such as interpinic) with + + gmake SMP=TRUE + + To run a program with a namelist: + + ./program < namelist + + To get help on running a program with command line options (e.g., interpinic): + + ./program + + To run a program built with SMP=TRUE: + + setenv OMP_NUM_THREADS= + + run normally as above + + III. Process sequence to create input datasets needed to run CLM + + NOTE: The following assumes you want to create files for CLM4.5. If you want to + use CLM4.0, you will need to do the following: + - In the following commands, change references to the clm4_5 directory to clm4_0 + - Add the option '-p clm4_0' to the mkmapdata.sh command. + + 1.) Create SCRIP grid files (if needed) + + a.) For standard resolutions these files will already be created. (done) + + b.) To create regular lat-lon regional/single-point grids run mknoocnmap.pl + + This will create both SCRIP grid files and a mapping file that will + be valid if the region includes NO ocean whatsoever (so you can skip step 2). + You can also use this script to create SCRIP grid files for a region + (or even a global grid) that DOES include ocean if you use step 2 to + create mapping files for it (simply discard the non-ocean map created by + this script). + + Example, for single-point over Boulder Colorado. + + cd shared/mkmapdata + ./mknoocnmap.pl -p 40,255 -n 1x1_boulderCO + + c.) General case + + You'll need to convert or create SCRIP grid files on your own (using scripts + or other tools) for the general case where you have an unstructured grid, or + a grid that is not regular in latitude and longitude. + + example format + ================== + netcdf fv1.9x2.5_090205 { + dimensions: + grid_size = 13824 ; + grid_corners = 4 ; + grid_rank = 2 ; + variables: + double grid_center_lat(grid_size) ; + grid_center_lat:units = "degrees" ; + double grid_center_lon(grid_size) ; + grid_center_lon:units = "degrees" ; + double grid_corner_lat(grid_size, grid_corners) ; + grid_corner_lat:units = "degrees" ; + double grid_corner_lon(grid_size, grid_corners) ; + grid_corner_lon:units = "degrees" ; + int grid_dims(grid_rank) ; + int grid_imask(grid_size) ; + grid_imask:units = "unitless" ; + + 2.) Create ocean to atmosphere mapping file (if needed) + + a.) Standard resolutions (done) + + If this is a standard resolution with a standard ocean resolution -- this + step is already done, the files already exist. + + b.) Region without Ocean (done in step 1.b) + + IF YOU RAN mknoocnmap.pl FOR A REGION WITHOUT OCEAN THIS STEP IS ALREADY DONE. + + c.) New atmosphere or ocean resolution + + If the region DOES include ocean, use gen_domain to create a + mapping file for it. + + Example: + + cd ../../../../tools/mapping/gen_domain_files/src + ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME + + + 3.) Add SCRIP grid file(s) created in (1) into XML database in CLM (optional) + + See the "Adding New Resolutions or New Files to the build-namelist Database" + Chapter in the CLM User's Guide + + http://www.cesm.ucar.edu/models/cesm1.0/clm/models/lnd/clm/doc/UsersGuide/book1.html + + If you don't do this step, you'll need to specify the file to mkmapdata + in step (3) using the "-f" option. + + 4.) Create mapping files for use by mksurfdata_map with mkmapdata + (See mkmapdata/README for more help on doing this) + + - this step uses the results of (1) that were entered into the XML database + by step (3). If you don't enter datasets in, you need to specify the + SCRIP grid file using the "-f" option to mkmapdata.sh. + + - note that mkmapdata generates maps for CLM4.5 by default; to generate + mapping files for CLM4.0, add the option '-p clm4_0' + + Example: to generate all necessary mapping files for the ne30np4 grid + + cd shared/mkmapdata + ./mkmapdata.sh -r ne30np4 + + 5.) Add mapping file(s) created in step (4) into XML database in CLM (optional) + + See notes on doing this in step (3) above. + Edit ../bld/namelist_files/namelist_defaults_clm.xml to incorporate new + mapping files. + + If you don't do this step, you'll need to specify the grid resolution name + and file creation dates to mksurfdata_map in step (5) below. + + 6.) Convert map of ocean to atm for use by DATM and CLM with gen_domain + (See tools/mapping/README for more help on doing this) + + - gen_domain uses the map from step (2) (or previously created CESM maps) + + Example: + + cd ../../../../tools/mapping/gen_domain_files/src + gmake + cd .. + setenv CDATE 090206 + setenv OCNGRIDNAME gx1v6 + setenv ATMGRIDNAME fv1.9x2.5 + setenv MAPFILE $CSMDATA/cpl/cpl6/map_${OCNGRIDNAME}_to_${ATMGRIDNAME}_aave_da_${CDATE}.nc + ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME + + Normally for I compsets running CLM only you will discard the ocean domain + file, and only use the atmosphere domain file for datm and as the fatmlndfrc + file for CLM. Output domain files will be named according to the input OCN/LND + gridnames. + + 7.) Create surface datasets with mksurfdata_map + (See mksurfdata_map/README for more help on doing this) + + - Run clm4_5/mksurfdata_map/mksurfdata.pl + - This step uses the results of step (4) entered into the XML database + in step (5). + - If datasets were NOT entered into the XML database, set the resolution + to "usrspec" and use the "-usr_gname", and "-usr_gdate" options. + + Example: for 0.9x1.25 resolution + + cd clm4_5/mksurfdata_map/src + gmake + cd .. + ./mksurfdata.pl -r 0.9x1.25 + + NOTE that surface dataset will be used by default for fatmgrid - and it will + contain the lat,lon,edges and area values for the atm grid - ASSUMING that + the atm and land grid are the same + + 8.) Interpolate initial conditions using interpinic (optional) + (See interpinic/README for more help on doing this) + IMPORTANT NOTE on interpinic!!!:: BE SURE TO USE NetCDF4.3 WHEN BUILDING! + If your template file was written using pnetcdf -- interpinic will corrupt + the resulting file and make it unusable! + + 9.) Add new files to XML data or using user_nl_clm (optional) + + See notes on doing this in step (3) above. + + IV. Example of creating single-point datasets without entering into XML database. + + Here we apply the process described in III. for a single-point dataset + where we don't enter the datasets into the XML database (thus skipping + steps 3, 5 and 9), but use the needed command line options to specify where the + files are. This also skips step (2) since step 1 creates the needed mapping file. + We also skip step (8) and do NOT create a finidat file. + + 0.) Set name of grid to use and the creation date to be used later... + setenv GRIDNAME 1x1_boulderCO + setenv CDATE `date +%y%m%d` + 1.) SCRIP grid and atm to ocn mapping file + cd shared/mkmapdata + ./mknoocnmap.pl -p 40,255 -n $GRIDNAME + # Set pointer to MAPFILE that will be used in step (6) + setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc + cd ../.. + 2.) skip + 3.) skip + 4.) Mapping files needed for mksurfdata_map + cd shared/mkmapdata + setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc + ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional + cd .. + 5.) skip + 6.) Generate domain file for datm and CLM + cd ../../../../tools/mapping/gen_domain_files/src + gmake + cd .. + setenv OCNDOM domain.ocn_noocean.nc + setenv ATMDOM domain.lnd.{$GRIDNAME}_noocean.nc + ./gen_domain -m $MAPFILE -o $OCNDOM -l $ATMDOM + cd ../../../../lnd/clm/tools + 7.) Create surface dataset for CLM + cd clm4_5/mksurfdata_map/src + gmake + cd .. + ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE + 8.) skip + 9.) skip + + V. Notes on which input datasets are needed for CLM + + global or regional/single-point grids + - need fsurdata and fatmlndfrc + + fsurdata ---- from mksurfdata_map in step (III.7) + fatmlndfrc -- use the domain.lnd file from gen_domain in step (III.6) + (NOTE: THIS FILE IS POINTED TO USING ATM_DOMAIN_PATH/ATM_DOMAIN_FILE/LND_DOMAIN_PATH/ \ + LND_DOMAIN_FILE + env_run.xml variables -- do NOT simply add this to your user_nl_clm as it will fail) + diff --git a/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst b/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst new file mode 100644 index 0000000000..d1824d432e --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst @@ -0,0 +1,17 @@ +================================== + Datasets for Observational Sites +================================== + +There are two ways to customize datasets for a particular observational site. +The first is to customize the input to the tools that create the dataset, and the second is to over-write the default data after you've created a given dataset. +Depending on the tool it might be easier to do it one way or the other. +In `Table 3-1 `_ we list the files that are most likely to be customized and the way they might be customized. +Of those files, the ones you are most likely to customize are: fatmlndfrc, fsurdat, faerdep (for DATM), and stream_fldfilename_ndep. +Note **mksurfdata_map** as documented previously has options to overwrite the vegetation and soil types. +For more information on this also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_. +And PTCLM uses these methods to customize datasets see `Chapter 6 `_. + + +Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets. +See `the Section called Running with your own atmosphere forcing in Chapter 5 `_ for more information on this. +Also the chapter on PTCLM in `the Section called Converting AmeriFlux Data for use by PTCLM in Chapter 6 `_ has information on using the AmeriFlux tower site data as atmospheric forcing. diff --git a/doc/source/users_guide/using-clm-tools/index.rst b/doc/source/users_guide/using-clm-tools/index.rst new file mode 100644 index 0000000000..583122cdcd --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/index.rst @@ -0,0 +1,21 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +.. _using-clm-tools-section: + +##################################### +Using CLM tools +##################################### + +.. toctree:: + :maxdepth: 2 + + what-are-the-clm-tools.rst + building-the-clm-tools.rst + creating-input-for-surface-dataset-generation.rst + creating-surface-datasets.rst + datasts-for-observational-sites.rst + creating-domain-files.rst + cprnc.rst diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst new file mode 100644 index 0000000000..b5e47e861f --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst @@ -0,0 +1,18 @@ +.. _observational-sites-datasets: + +******************************* +Observational Sites Datasets +******************************* + +There are two ways to customize datasets for a particular observational site. +The first is to customize the input to the tools that create the dataset, and the second is to over-write the default data after you've created a given dataset. +Depending on the tool it might be easier to do it one way or the other. +In `Table 3-1 `_ we list the files that are most likely to be customized and the way they might be customized. +Of those files, the ones you are most likely to customize are: fatmlndfrc, fsurdat, faerdep (for DATM), and stream_fldfilename_ndep. +Note **mksurfdata_map** as documented previously has options to overwrite the vegetation and soil types. +For more information on this also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_. +And PTCLM uses these methods to customize datasets see `Chapter 6 `_. + +Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets. +See `the Section called Running with your own atmosphere forcing in Chapter 5 `_ for more information on this. +Also the chapter on PTCLM in `the Section called Converting AmeriFlux Data for use by PTCLM in Chapter 6 `_ has information on using the AmeriFlux tower site data as atmospheric forcing. diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst new file mode 100644 index 0000000000..e71c97cf3d --- /dev/null +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -0,0 +1,89 @@ +.. _what-are-the-clm-tools: + +======================== + What are the CLM tools +======================== + +There are several tools provided with CLM that allow you to create your own input datasets at resolutions you choose, or to interpolate initial conditions to a different resolution, or used to compare CLM history files between different cases. +The tools are all available in the ``models/lnd/clm/tools`` directory. +Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``shared/ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. +Some of the NCL scripts are very specialized and not meant for general use, and we won't document them here. +They still contain documentation in the script itself and the README file in the tools directory. + +The tools are divided into three directories for three categories: clm4_0, clm4_5, and shared. +The first two are of course for tools that are designed to work with either the CLM4.0 or CLM4.5 versions of the model. +The last one are shared utilities that can be used by either, or have a "-phys" option so you can specify which version you want to use. + +The list of generally important scripts and programs are as follows. + +1. *tools/cprnc* (relative to top level directory) to compare NetCDF files with a time axis. + +#. *shared/mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``shared/mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. + +#. *shared/mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). + +#. *shared/gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. + +#. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and clm4_5 versions). + +#. *shared/mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or clm4_5. + +In the sections to come we will go into detailed description of how to use each of these tools in turn. +First, however we will discuss the common environment variables and options that are used by all of the FORTRAN tools. +Second, we go over the outline of the entire file creation process for all input files needed by CLM for a new resolution, then we turn to each tool. +In the last section we will discuss how to customize files for particular observational sites. + +The tools run either one of two ways, with a namelist to provide options, or with command line arguments (and NOT both). +**gen_domain** and **cprnc** run with command line arguments, and the other tools run with namelists. + +In the following sections, we will outline how to make these files available for build-namelist so that you can easily create simulations that include them. +In the chapter on single-point and regional datasets we also give an alternative way to enter new datasets without having to edit files. + +------------------------------------ +Running FORTRAN tools with namelists +------------------------------------ + +**mksurfdata_map** and **mkmapgrids** run with namelists that are read from standard input. +Hence, you create a namelist and then run them by redirecting the namelist file into standard input as follows: +:: + + ./program < namelist + +For programs with namelists there is at least one sample namelist with the name "program".namelist (i.e. +``mksurfdata_map.namelist`` for the **mksurfdata_map** program). +There may also be other sample namelists that end in a different name besides "namelist". +Namelists that you create should be similar to the example namelist. +The namelist values are also documented along with the other namelists in the: +:: + + models/lnd/clm/bld/namelist_files/namelist_definition.xml`` file + and default values in the: + models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml`` file. + +----------------------------------------------- +Running FORTRAN tools with command line options +----------------------------------------------- + +**gen_domain**, and **cprnc** run with command line arguments. +The detailed sections below will give you more information on the command line arguments specific to each tool. +Also running the tool without any arguments will give you a general synopsis on how to run the tool. + +----------------------------------------- +Running FORTRAN tools built with SMP=TRUE +----------------------------------------- + +When you enable ``SMP=TRUE`` on your build of one of the tools that make use of it, you are using OpenMP for shared memory parallelism (SMP). +In SMP loops are run in parallel with different threads run on different processors all of which access the same memory (called on-node). +Thus you can only usefully run up to the number of processors that are available on a single-node of the machine you are running on. +For example, on the NCAR machine yellowstone there are 16 processors per node, but the SMT hardware on the machine allows you to submit twice as many threads or 32 threads. + + +--------- +Using NCL +--------- + +In the tools directory ``models/lnd/clm/tools/shared/ncl_scripts`` and in a few other locations there are scripts that use NCAR Command Language (NCL). +Unlike the FORTRAN tools, you will need to get a copy of NCL in order to use them. +You also won't have to build an executable in order to use them, hence no Makefile is provided. +NCL is provided for free download as either binaries or source code from: `http://www.ncl.ucar.edu/ `_. +The NCL web-site also contains documentation on NCL and it's use. These scripts are stand-alone and at most use environment variables to control how to use them. In some cases there are perl scripts with command line arguments that call the NCL scripts to control what they do. From 945619d5c5c94ab85dc18f17ea08d20f52e4a4d4 Mon Sep 17 00:00:00 2001 From: mvertens Date: Sun, 26 Mar 2017 11:23:47 -0600 Subject: [PATCH 002/730] first pass at some rst additions --- .../CLM45_Tech_Note_Chpt_1_Introduction.rst | 832 +++++++ .../CLM45_Tech_Note_Chpt_10_Glacier.rst | 169 ++ .../CLM45_Tech_Note_Chpt_11_RTM.rst | 139 ++ .../CLM45_Tech_Note_Chpt_12_Urban.rst | 130 + ...Note_Chpt_13_CN_Allocation_Respiration.rst | 599 +++++ ...Tech_Note_Chpt_14_Vegetation_Phenology.rst | 887 +++++++ .../CLM45_Tech_Note_Chpt_15_Decomposition.rst | 797 ++++++ ...h_Note_Chpt_16_External_Nitrogen_Cycle.rst | 397 +++ ...LM45_Tech_Note_Chpt_17_Plant_Mortality.rst | 505 ++++ .../CLM45_Tech_Note_Chpt_18_Fire.rst | 659 +++++ .../CLM45_Tech_Note_Chpt_19_Methane.rst | 619 +++++ .../CLM45_Tech_Note_Chpt_2_Ecosystem.rst | 782 ++++++ ...LM45_Tech_Note_Chpt_20_Crop_Irrigation.rst | 722 ++++++ ..._Tech_Note_Chpt_21_Transient_Landcover.rst | 359 +++ .../CLM45_Tech_Note_Chpt_22_DGVM.rst | 155 ++ .../CLM45_Tech_Note_Chpt_23_BVOCs.rst | 66 + .../CLM45_Tech_Note_Chpt_24_Dust.rst | 212 ++ .../CLM45_Tech_Note_Chpt_25_Isotopes.rst | 256 ++ .../CLM45_Tech_Note_Chpt_26_Offline.rst | 210 ++ .../CLM45_Tech_Note_Chpt_27_References.rst | 1377 +++++++++++ ...CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst | 1137 +++++++++ ...LM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst | 289 +++ .../CLM45_Tech_Note_Chpt_5_Fluxes.rst | 1773 ++++++++++++++ ...ech_Note_Chpt_6_Soil_Snow_Temperatures.rst | 928 +++++++ .../CLM45_Tech_Note_Chpt_7_Hydrology.rst | 2167 +++++++++++++++++ .../CLM45_Tech_Note_Chpt_8_Photosynthesis.rst | 718 ++++++ .../CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst | 1189 +++++++++ 27 files changed, 18073 insertions(+) create mode 100644 doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst create mode 100644 doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst create mode 100644 doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst create mode 100644 doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst create mode 100644 doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst create mode 100644 doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst create mode 100644 doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst create mode 100644 doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst create mode 100644 doc/source/tech_note/CHAPTER_17/CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst create mode 100644 doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst create mode 100644 doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst create mode 100644 doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst create mode 100644 doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst create mode 100644 doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst create mode 100644 doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst create mode 100644 doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst create mode 100644 doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst create mode 100644 doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst create mode 100644 doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst create mode 100644 doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst create mode 100644 doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst create mode 100644 doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst create mode 100644 doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst create mode 100644 doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst create mode 100644 doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst create mode 100644 doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst create mode 100644 doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst diff --git a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst new file mode 100644 index 0000000000..1bcd54fca7 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst @@ -0,0 +1,832 @@ +.. math:: 188 + +**NCAR/TN-503+STR** + +**NCAR Technical Note** + +**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** + +**** + +**July 2013** + +**** + +**Technical Description of version 4.5 of the Community Land Model +(CLM)** + +***Coordinating Lead Authors*** + +**Keith W. Oleson, David M. Lawrence** + +**** + +***Lead Authors*** + +**Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel +Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, +Peter E. Thornton** + +**** + +***Contributing Authors*** + +**Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, +Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William +Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, +Jinyun Tang, Zong-Liang Yang** + +**** + +**** + +**** + +**NCAR Earth System Laboratory** + +**Climate and Global Dynamics +Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** + +**NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** + +**P. O. Box 3000** + +**BOULDER, COLORADO 80307-3000** + +**ISSN Print Edition 2153-2397** + +**ISSN Electronic Edition 2153-2400** + +**** + +**NCAR TECHNICAL NOTES** + +http://library.ucar.edu/research/publish-technote\ **** + +**** + +The Technical Notes series provides an outlet for a variety of NCAR +Manuscripts that contribute in specialized ways to the body of +scientific knowledge but that are not yet at a point of a formal +journal, monograph or book publication. Reports in this series are +issued by the NCAR scientific divisions, serviced by OpenSky and +operated through the NCAR Library. Designation symbols for the series +include: + +**EDD – Engineering, Design, or Development Reports** + +Equipment descriptions, test results, instrumentation, + +and operating and maintenance manuals. + +**IA – Instructional Aids** + +** Instruction manuals, bibliographies, film supplements, + +and other research or instructional aids. + +**PPR – Program Progress Reports** + +** Field program reports, interim and working reports, + +survey reports, and plans for experiments. + +**PROC – Proceedings** + +** Documentation or symposia, colloquia, conferences, + +workshops, and lectures. (Distribution maybe limited to + +attendees). + +**STR – Scientific and Technical Reports** + +Data compilations, theoretical and numerical + +investigations, and experimental results. + +The National Center for Atmospheric Research (NCAR) is operated by the +nonprofit University Corporation for Atmospheric Research (UCAR) under +the sponsorship of the National Science Foundation. Any opinions, +findings, conclusions, or recommendations expressed in this publication +are those of the author(s) and do not necessarily reflect the views of +the National Science Foundation. + +National Center for Atmospheric Research + +P. O. Box 3000 + +Boulder, Colorado 80307-300 + +**** + +ii + +**NCAR/TN-503+STR** + +**NCAR Technical Note** + +**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** + +**** + +**July 2013** + +**** + +**Technical Description of version 4.5 of the Community Land Model +(CLM)** + +***Coordinating Lead Authors*** + +**Keith W. Oleson, David M. Lawrence** + +**** + +***Lead Authors*** + +**Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel +Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, +Peter E. Thornton** + +**** + +***Contributing Authors*** + +**Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, +Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William +Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, +Jinyun Tang, Zong-Liang Yang** + +**** + +**** + +**** + +**NCAR Earth System Laboratory** + +**Climate and Global Dynamics +Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** + +**NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** + +**P. O. Box 3000** + +**BOULDER, COLORADO 80307-3000** + +**ISSN Print Edition 2153-2397** + +**ISSN Electronic Edition 2153-2400** + +xi + +**TABLE OF CONTENTS** + +**** + +**1. Introduction 11.1 Model History 11.1.1 Inception of CLM 11.1.2 CLM2 +31.1.3 CLM3 51.1.4 CLM3.5 61.1.5 CLM4 71.1.6 CLM4.5 81.2 Biogeophysical +and Biogeochemical Processes 112. Surface Characterization and Model +Input Requirements 142.1 Surface Characterization 142.1.1 Surface +Heterogeneity and Data Structure 142.1.2 Vegetation Composition 172.1.3 +Vegetation Structure 192.1.4 Phenology and vegetation burial by snow +212.2 Model Input Requirements 212.2.1 Atmospheric Coupling 212.2.2 +Initialization 272.2.3 Surface Data 282.2.4 Adjustable Parameters and +Physical Constants 353. Surface Albedos 373.1 Canopy Radiative Transfer +373.2 Ground Albedos 463.2.1 Snow Albedo 483.2.2 Snowpack Optical +Properties 523.2.3 Snow Aging 563.3 Solar Zenith Angle 594. Radiative +Fluxes 634.1 Solar Fluxes 634.2 Longwave Fluxes 675. Momentum, Sensible +Heat, and Latent Heat Fluxes 715.1 Monin-Obukhov Similarity Theory 735.2 +Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces 825.3 +Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces +885.3.1 Theory 885.3.2 Numerical Implementation 1025.4 Update of Ground +Sensible and Latent Heat Fluxes 1075.5 Saturation Vapor Pressure 1106. +Soil and Snow Temperatures 1136.1 Numerical Solution 1146.2 Phase Change +1256.2.1 Soil and Snow Layers 1256.2.2 Surface Water 1296.3 Soil and +Snow Thermal Properties 1307. Hydrology 1347.1 Canopy Water 1357.2 Snow +1377.2.1 Snow Covered Area Fraction 1397.2.2 Ice Content 1407.2.3 Water +Content 1427.2.4 Black and organic carbon and mineral dust within snow +1437.2.5 Initialization of snow layer 1467.2.6 Snow Compaction 1467.2.7 +Snow Layer Combination and Subdivision 1497.2.7.1 Combination 1497.2.7.2 +Subdivision 1527.3 Surface Runoff, Surface Water Storage, and +Infiltration 1537.3.1 Surface Runoff 1537.3.2 Surface Water Storage +1557.3.3 Infiltration 1567.4 Soil Water 1587.4.1 Hydraulic Properties +1607.4.2 Numerical Solution 1637.4.2.1 Equilibrium soil matric potential +and volumetric moisture 1697.4.2.2 Equation set for layer i=1 1717.4.2.3 +Equation set for layers i=2,…,N\ :sub:`levsoi` -1 1717.4.2.4 Equation +set for layers i=N\ :sub:`levsoi` ,…N\ :sub:`levsoi` +1 1727.5 Frozen +Soils and Perched Water Table 1747.6 Groundwater-Soil Water Interactions +1757.7 Runoff from glaciers and snow-capped surfaces 1787.8 The Variable +Infiltration Capacity parameterizations as a hydrologic option 1798. +Stomatal Resistance and Photosynthesis 1838.1 Stomatal resistance 1838.2 +Photosynthesis 1868.3 Vcmax25 and canopy scaling 1918.4 Soil water +stress 1938.5 Numerical implementation 1979. Lake Model 2009.1 +Discretization 2019.2 External Data 2029.3 Surface Albedo 2029.4 Surface +Fluxes and Surface Temperature 2039.4.1 Overview of Changes from CLM4 +2039.4.2 Surface Properties 2039.4.3 Surface Flux Solution 2059.5 Lake +Temperature 2119.5.1 Introduction 2119.5.2 Overview of Changes from CLM4 +2129.5.3 Boundary Conditions 2139.5.4 Eddy Diffusivity and Thermal +Conductivities 2139.5.5 Radiation Penetration 2169.5.6 Heat Capacities +2179.5.7 Crank-Nicholson Solution 2179.5.8 Phase Change 2199.5.9 +Convection 2209.5.10 Energy Conservation 2239.6 Lake Hydrology 2239.6.1 +Overview 2239.6.2 Water Balance 2249.6.3 Precipitation, Evaporation, and +Runoff 2259.6.4 Soil Hydrology 2269.6.5 Modifications to Snow Layer +Logic 22710. Glaciers 22910.1 Overview 22910.2 Multiple elevation class +scheme 23110.3 Computation of the surface mass balance 23211. River +Transport Model (RTM) 23512. Urban Model (CLMU) 23913. Carbon and +Nitrogen Pools, Allocation, and Respiration 24413.1 Introduction 24413.2 +Carbon Allocation for Maintenance Respiration Costs 24613.3 Carbon and +Nitrogen Stoichiometry of New Growth 24813.4 Deployment of +retranslocated nitrogen 25213.5 Plant nitrogen uptake from soil mineral +nitrogen pool 25313.6 Final carbon and nitrogen allocation 25313.7 +Autotrophic Respiration 25613.7.1 Maintenance Respiration 25613.7.2 +Growth Respiration 25714. Vegetation Phenology 25914.1 General Phenology +Flux Parameterization 25914.1.1 Onset Periods 26014.1.2 Offset Periods +26214.1.3 Background Onset Growth 26414.1.4 Background Litterfall +26514.1.5 Livewood Turnover 26614.2 Evergreen Phenology 26714.3 +Seasonal-Deciduous Phenology 26814.3.1 Seasonal-Deciduous Onset Trigger +26814.3.2 Seasonal-Deciduous Offset Trigger 27114.4 Stress-Deciduous +Phenology 27114.4.1 Stress-Deciduous Onset Triggers 27114.4.2 +Stress-Deciduous Offset Triggers 27314.4.3 Stress-Deciduous: Long +Growing Season 27414.5 Litterfall Fluxes Merged to the Column Level +27615. Decomposition 27815.1 CLM-CN Pool Structure, Rate Constants and +Parameters 28115.2 Century-based Pool Structure, Rate Constants and +Parameters 28515.3 Environmental modifiers on decomposition rate 28615.4 +N-limitation of Decomposition Fluxes 28915.5 N Competition between plant +uptake and soil immobilization fluxes 29215.6 Final Decomposition Fluxes +29315.7 Vertical Distribution and Transport of Decomposing C and N pools +29515.8 Model Equilibration 29616. External Nitrogen Cycle 29816.1 +Atmospheric Nitrogen Deposition 29816.2 Biological Nitrogen Fixation +29916.3 Nitrification and Denitrification Losses of Nitrogen 30116.3.1 +CLM-CN formulation 30116.3.2 Century-based formulation 30416.4 Leaching +Losses of Nitrogen 30516.5 Losses of Nitrogen Due to Fire 30717. Plant +Mortality 30817.1 Mortality Fluxes Leaving Vegetation Pools 30817.2 +Mortality Fluxes Merged to the Column Level 31118. Fire 31618.1 Non-peat +fires outside cropland and tropical closed forest 31618.1.1 Fire counts +31618.1.2 Average spread area of a fire 32018.1.3 Fire impact 32318.2 +Agricultural fires 32518.3 Deforestation fires 32618.4 Peat fires 32919. +Methane Model 33219.1 Methane Model Structure and Flow 33219.2 Governing +Mass-Balance Relationship 33319.3 CH4 Production 33419.4 Ebullition +33819.5 Aerenchyma Transport 33819.6 CH4 Oxidation 34019.7 Reactive +Transport Solution 34019.7.1 Competition for CH4 and O2 34119.7.2 CH4 +and O2 Source Terms 34119.7.3 Aqueous and Gaseous Diffusion 34219.7.4 +Boundary Conditions 34319.7.5 Crank-Nicholson Solution 34419.7.6 +Interface between water table and unsaturated zone 34519.8 Inundated +Fraction Prediction 34619.9 Seasonal Inundation 34720. Crops and +Irrigation 34820.1 Summary of CLM4.5 updates relative to the CLM4.0 +34820.2 The crop model 34820.2.1 Introduction 34820.2.2 Crop plant +functional types 34920.2.3 Phenology 35020.2.3.1 Planting 35120.2.3.2 +Leaf emergence 35220.2.3.3 Grain fill 35320.2.3.4 Harvest 35320.2.4 +Allocation 35320.2.4.1 Leaf emergence to grain fill 35420.2.4.2 Grain +fill to harvest 35420.2.5 General comments 35520.3 The irrigation model +36020.4 The details about what is new in CLM4.5 36120.4.1 Interactive +irrigation for corn, temperate cereals, and soybean 36120.4.2 +Interactive fertilization 36320.4.3 Biological nitrogen fixation for +soybeans 36420.4.4 Modified C:N ratios for crops 36520.4.5 Nitrogen +retranslocation for crops 36520.4.6 Separate reproductive pool 36721. +Transient Landcover Change 36921.1 Annual Transient Land Cover Data and +Time Interpolation 36921.2 Mass and Energy Conservation 37121.3 Annual +Transient Land Cover Dataset Development 37221.3.1 UNH Transient Land +Use and Land Cover Change Dataset 37221.3.2 Representing Land Use and +Land Cover Change in CLM 37421.3.3 Present Day PFT Dataset 37521.3.4 +Potential PFT Distribution 37621.3.5 Transient Land Cover Change Dataset +37721.3.6 Forest Harvest Dataset Changes 37822. Dynamic Global +Vegetation Model 38122.1 Establishment and survival 38222.2 Light +competition 38322.3 CN processes modified for the CNDV coupling 38323. +Biogenic Volatile Organic Compounds (BVOCs) 38624. Dust Model 38825. +Carbon Isotopes 39325.1 General Form for Calculating 13C and 14C Flux +39325.2 Isotope Symbols, Units, and Reference Standards 39425.3 Carbon +Isotope Discrimination During Photosynthesis 39625.4 14C radioactive +decay and historical atmospheric 14C concentrations 39826. Offline Mode +40027. References 405** + +**LIST OF FIGURES** + +Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes +simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). +13Figure 2.1. Configuration of the CLM subgrid hierarchy. 15Figure 4.1. +Schematic diagram of (a) direct beam radiation, (b) diffuse solar +radiation, and (c) longwave radiation absorbed, transmitted, and +reflected by vegetation and ground. 64Figure 5.1. Schematic diagram of +sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated +surfaces. 91Figure 5.2. Schematic diagram of water vapor fluxes for (a) +non-vegetated surfaces and (b) vegetated surfaces. 92Figure 6.1. +Schematic diagram of numerical scheme used to solve for soil +temperature. 119Figure 7.1. Hydrologic processes represented in CLM. +135Figure 7.2. Example of three layer snow pack (snl=-3). 137Figure 7.3. +Schematic diagram of numerical scheme used to solve for soil water +fluxes. 165Figure 12.1. Schematic representation of the urban land unit. +242Figure 12.2. Schematic of urban and atmospheric model coupling. +243Figure 13.1. Vegetation fluxes and pools. 245Figure 13.2: Carbon and +nitrogen pools. 246Figure 14.1. Example of annual phenology cycle for +seasonal deciduous. 260Figure 14.2. Example fluxes and pools sizes for +an onset growth period of 15 days, with initial transfer pool size of +100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool +(e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its +associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). +262Figure 14.3. Example fluxes and pool sizes for an offset (litterfall) +period of 15 days, with initial display pool size of 100 gC m-2 and a +timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon +content of display pool and litter pool through the litterfall period, +ignoring the losses from litter pool due to decomposition during this +period. 264Figure 15.1. Schematic of decomposition model in CLM. +279Figure 15.2. Pool structure, transitions, respired fractions (numbers +at end of arrows), and turnover times (numbers in boxes) for the 2 +alternate soil decomposition models included in CLM. 281Figure 16.1. +Biological nitrogen fixation as a function of annual net primary +production. 300Figure 19.1. Schematic representation of biological and +physical processes integrated in CLM that affect the net CH4 surface +flux. (left) Fully inundated portion of a CLM gridcell and (right) +variably saturated portion of a gridcell. 334Figure 21.1. Schematic of +land cover change impacts on CLM carbon pools and fluxes. 379Figure +21.2. Schematic of translation of annual UNH land units to CLM4 plant +functional types. 380Figure 25.1. Atmospheric +:math:`\mathrm{\Delta}`\ 14C used to drive 14C model over the historical +period. 399\ **** + +**LIST OF TABLES** + +Table 2.1. Plant functional types 18Table 2.2. Prescribed plant +functional type heights 20Table 2.3. Atmospheric input to land model +23Table 2.4. Land model output to atmospheric model 26Table 2.5. Surface +data required for CLM4.5 and their base spatial resolution 29Table 2.6. +Physical constants 36Table 3.1. Plant functional type optical properties +44Table 3.2. Intercepted snow optical properties 46Table 3.3. Dry and +saturated soil albedos 48Table 3.4. Spectral bands and weights used for +snow radiative transfer 51Table 3.5. Single-scatter albedo values used +for snowpack impurities and ice 54Table 3.6. Mass extinction values (m2 +kg-1) used for snowpack impurities and ice. 55Table 3.7. Asymmetry +scattering parameters used for snowpack impurities and ice. 56Table 3.8. +Orbital parameters 62Table 5.1. Plant functional type aerodynamic +parameters 101Table 5.2. Coefficients for e\ :sub:`sat`\ :sup:`T` +111Table 5.3. Coefficients for 112Table 6.1. Soil layer structure. +115Table 7.1. Meltwater scavenging efficiency for particles within snow +146Table 7.2. Minimum and maximum thickness of snow layers (m) 152Table +8.1. Plant functional type (PFT) photosynthetic parameters. 185Table +8.2. Temperature dependence parameters for C3 photosynthesis. 190Table +8.3. Plant functional type root distribution parameters. 196Table 13.1. +Allocation and carbon:nitrogen ratio parameters 250Table 15.1. +Decomposition rate constants for litter and SOM pools, C:N ratios, and +acceleration parameters (see section 15.8 for explanation) for the +CLM-CN decomposition pool structure. 283Table 15.2. Respiration +fractions for litter and SOM pools 284Table 15.3. Respiration fractions +for litter and SOM pools for Century-based structure 285Table 15.4. +Turnover times, C:N ratios, and acceleration parameters (see section +15.8 for explanation) for the Century-based decomposition cascade. +286Table 18.1. PFT-specific combustion completeness and fire mortality +factors. 331Table 19.1. Parameter descriptions and sensitivity analysis +ranges applied in the methane model. 337Table 19.2. Temperature +dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. +342Table 20.1. Crop plant functional types (pfts) in CLM4.5CNcrop and +their parameters relating to phenology and morphology. Numbers in the +first column correspond to the list of pfts in Table 2.1. 357Table 20.2. +Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. +Numbers in the first column correspond to the list of pfts in Table 2.1. +359Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, +fine root, and reproductive pools. 367Table 22.1. Plant functional type +(PFT) biogeography rules with respect to climate. 385Table 24.1. Mass +fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric +standard deviation :sub:`g, i` , per dust source mode i 392Table 24.2. +Minimum and maximum particle diameters in each dust transport bin j +392\ **** + +ACKNOWLEDGEMENTS + +The authors would like to acknowledge the substantial contributions of +the following members of the Land Model and Biogeochemistry Working +Groups to the development of the Community Land Model since its +inception in 1996: Benjamin Andre, Ian Baker, Michael Barlage, Mike +Bosilovich, Marcia Branstetter, Tony Craig, Aiguo Dai, Yongjiu Dai, Mark +Decker, Scott Denning, Robert Dickinson, Paul Dirmeyer, Jared Entin, Jay +Famiglietti, Johannes Feddema, Mark Flanner, Jon Foley, Andrew Fox, Inez +Fung, David Gochis, Alex Guenther, Tim Hoar, Forrest Hoffman, Paul +Houser, Trish Jackson, Brian Kauffman, Silvia Kloster, Natalie Mahowald, +Jiafu Mao, Lei Meng, Sheri Michelson, Guo-Yue Niu, Adam Phillips, Taotao +Qian, Jon Radakovich, James Randerson, Nan Rosenbloom, Steve Running, +Koichi Sakaguchi, Adam Schlosser, Andrew Slater, Reto Stöckli, Quinn +Thomas, Mariana Vertenstein, Nicholas Viovy, Aihui Wang, Guiling Wang, +Charlie Zender, Xiaodong Zeng, and Xubin Zeng. + +The authors also thank the following people for their review of this +document: Jonathan Buzan, Kyla Dahlin, Sanjiv Kumar, Hanna Lee, Danica +Lombardozzi, Quinn Thomas, and Will Wieder. + +Current affiliations for the authors are as follows: + +K.W. Oleson, D.M. Lawrence, G.B. Bonan, S. Levis, S.C. Swenson, R. +Fisher, E. Kluzek, J.-F. Lamarque, P.J. Lawrence, S. Muszala, and W. +Sacks (National Center for Atmospheric Research); B. Drewniak (Argonne +National Laboratory); M. Huang, L.R. Leung (Pacific Northwest National +Laboratory); C.D. Koven, W.J. Riley, and J. Tang (Lawrence Berkeley +National Laboratory); F. Li (Chinese Academy of Sciences); Z.M. Subin +(Princeton University); P.E. Thornton and D.M. Ricciuto (Oak Ridge +National Laboratory); A. Bozbiyik (Bern University); C. Heald +(Massachusetts Institute of Technology), W. Lipscomb (Los Alamos +National Laboratory); Ying Sun and Z.-L. Yang (University of Texas at +Austin) + +.. math:: 188 + +.. math:: 7 + +Introduction +=============== + +The purpose of this technical note is to describe the biogeophysical and +biogeochemical parameterizations and numerical implementation of version +4.5 of the Community Land Model (CLM4.5). Scientific justification and +evaluation of these parameterizations can be found in the referenced +scientific papers (Chapter 27). This technical note and the CLM4.5 +User’s Guide together provide the user with the scientific description +and operating instructions for CLM. + +Model History +--------------- + +Inception of CLM +^^^^^^^^^^^^^^^^^^^^^^ + +The early development of the Community Land Model can be described as +the merging of a community-developed land model focusing on +biogeophysics and a concurrent effort at NCAR to expand the NCAR Land +Surface Model (NCAR LSM, Bonan 1996) to include the carbon cycle, +vegetation dynamics, and river routing. The concept of a +community-developed land component of the Community Climate System Model +(CCSM) was initially proposed at the CCSM Land Model Working Group +(LMWG) meeting in February 1996. Initial software specifications and +development focused on evaluating the best features of three existing +land models: the NCAR LSM (Bonan 1996, 1998) used in the Community +Climate Model (CCM3) and the initial version of CCSM; the Institute of +Atmospheric Physics, Chinese Academy of Sciences land model (IAP94) (Dai +and Zeng 1997); and the Biosphere-Atmosphere Transfer Scheme (BATS) +(Dickinson et al. 1993) used with CCM2. A scientific steering committee +was formed to review the initial specifications of the design provided +by Robert Dickinson, Gordon Bonan, Xubin Zeng, and Yongjiu Dai and to +facilitate further development. Steering committee members were selected +so as to provide guidance and expertise in disciplines not generally +well-represented in land surface models (e.g., carbon cycling, +ecological modeling, hydrology, and river routing) and included +scientists from NCAR, the university community, and government +laboratories (R. Dickinson, G. Bonan, X. Zeng, Paul Dirmeyer, Jay +Famiglietti, Jon Foley, and Paul Houser). + +The specifications for the new model, designated the Common Land Model, +were discussed and agreed upon at the June 1998 CCSM Workshop LMWG +meeting. An initial code was developed by Y. Dai and was examined in +March 1999 by Mike Bosilovich, P. Dirmeyer, and P. Houser. At this point +an extensive period of code testing was initiated. Keith Oleson, Y. Dai, +Adam Schlosser, and P. Houser presented preliminary results of offline +1-dimensional testing at the June 1999 CCSM Workshop LMWG meeting. +Results from more extensive offline testing at plot, catchment, and +large scale (up to global) were presented by Y. Dai, A. Schlosser, K. +Oleson, M. Bosilovich, Zong-Liang Yang, Ian Baker, P. Houser, and P. +Dirmeyer at the LMWG meeting hosted by COLA (Center for +Ocean-Land-Atmosphere Studies) in November 1999. Field data used for +validation included sites adopted by the Project for Intercomparison of +Land-surface Parameterization Schemes (Henderson-Sellers et al. 1993) +(Cabauw, Valdai, Red-Arkansas river basin) and others [FIFE (Sellers et +al. 1988), BOREAS (Sellers et al. 1995), HAPEX-MOBILHY (André et al. +1986), ABRACOS (Gash et al. 1996), Sonoran Desert (Unland et al. 1996), +GSWP (Dirmeyer et al. 1999)]. Y. Dai also presented results from a +preliminary coupling of the Common Land Model to CCM3, indicating that +the land model could be successfully coupled to a climate model. + +Results of coupled simulations using CCM3 and the Common Land Model were +presented by X. Zeng at the June 2000 CCSM Workshop LMWG meeting. +Comparisons with the NCAR LSM and observations indicated major +improvements to the seasonality of runoff, substantial reduction of a +summer cold bias, and snow depth. Some deficiencies related to runoff +and albedo were noted, however, that were subsequently addressed. Z.-L. +Yang and I. Baker demonstrated improvements in the simulation of snow +and soil temperatures. Sam Levis reported on efforts to incorporate a +river routing model to deliver runoff to the ocean model in CCSM. Soon +after the workshop, the code was delivered to NCAR for implementation +into the CCSM framework. Documentation for the Common Land Model is +provided by Dai et al. (2001) while the coupling with CCM3 is described +in Zeng et al. (2002). The model was introduced to the modeling +community in Dai et al. (2003). + +CLM2 +^^^^^^^^^^ + +Concurrent with the development of the Common Land Model, the NCAR LSM +was undergoing further development at NCAR in the areas of carbon +cycling, vegetation dynamics, and river routing. The preservation of +these advancements necessitated several modifications to the Common Land +Model. The biome-type land cover classification scheme was replaced with +a plant functional type (PFT) representation with the specification of +PFTs and leaf area index from satellite data (Oleson and Bonan 2000; +Bonan et al. 2002a, b). This also required modifications to +parameterizations for vegetation albedo and vertical burying of +vegetation by snow. Changes were made to canopy scaling, leaf +physiology, and soil water limitations on photosynthesis to resolve +deficiencies indicated by the coupling to a dynamic vegetation model. +Vertical heterogeneity in soil texture was implemented to improve +coupling with a dust emission model. A river routing model was +incorporated to improve the fresh water balance over oceans. Numerous +modest changes were made to the parameterizations to conform to the +strict energy and water balance requirements of CCSM. Further +substantial software development was also required to meet coding +standards. The resulting model was adopted in May 2002 as the Community +Land Model (CLM2) for use with the Community Atmosphere Model (CAM2, the +successor to CCM3) and version 2 of the Community Climate System Model +(CCSM2). + +K. Oleson reported on initial results from a coupling of CCM3 with CLM2 +at the June 2001 CCSM Workshop LMWG meeting. Generally, the CLM2 +preserved most of the improvements seen in the Common Land Model, +particularly with respect to surface air temperature, runoff, and snow. +These simulations are documented in Bonan et al. (2002a). Further small +improvements to the biogeophysical parameterizations, ongoing software +development, and extensive analysis and validation within CAM2 and CCSM2 +culminated in the release of CLM2 to the community in May 2002. + +Following this release, Peter Thornton implemented changes to the model +structure required to represent carbon and nitrogen cycling in the +model. This involved changing data structures from a single vector of +spatially independent sub-grid patches to one that recognizes three +hierarchical scales within a model grid cell: land unit, snow/soil +column, and PFT. Furthermore, as an option, the model can be configured +so that PFTs can share a single soil column and thus “compete†for +water. This version of the model (CLM2.1) was released to the community +in February 2003. CLM2.1, without the compete option turned on, produced +only round off level changes when compared to CLM2. + +CLM3 +^^^^^^^^^^ + +CLM3 implemented further software improvements related to performance +and model output, a re-writing of the code to support vector-based +computational platforms, and improvements in biogeophysical +parameterizations to correct deficiencies in the coupled model climate. +Of these parameterization improvements, two were shown to have a +noticeable impact on simulated climate. A variable aerodynamic +resistance for heat/moisture transfer from ground to canopy air that +depends on canopy density was implemented. This reduced unrealistically +high surface temperatures in semi-arid regions. The second improvement +added stability corrections to the diagnostic 2-m air temperature +calculation which reduced biases in this temperature. Competition +between PFTs for water, in which PFTs share a single soil column, is the +default mode of operation in this model version. CLM3 was released to +the community in June 2004. Dickinson et al. (2006) describe the climate +statistics of CLM3 when coupled to CCSM3.0. Hack et al. (2006) provide +an analysis of selected features of the land hydrological cycle. +Lawrence et al. (2007) examine the impact of changes in CLM3 +hydrological parameterizations on partitioning of evapotranspiration +(ET) and its effect on the timescales of ET response to precipitation +events, interseasonal soil moisture storage, soil moisture memory, and +land-atmosphere coupling. Qian et al. (2006) evaluate CLM3’s performance +in simulating soil moisture content, runoff, and river discharge when +forced by observed precipitation, temperature and other atmospheric +data. + +CLM3.5 +^^^^^^^^^^^^ + +Although the simulation of land surface climate by CLM3 was in many ways +adequate, most of the unsatisfactory aspects of the simulated climate +noted by the above studies could be traced directly to deficiencies in +simulation of the hydrological cycle. In 2004, a project was initiated +to improve the hydrology in CLM3 as part of the development of CLM +version 3.5. A selected set of promising approaches to alleviating the +hydrologic biases in CLM3 were tested and implemented. These included +new surface datasets based on Moderate Resolution Imaging +Spectroradiometer (MODIS) products, new parameterizations for canopy +integration, canopy interception, frozen soil, soil water availability, +and soil evaporation, a TOPMODEL-based model for surface and subsurface +runoff, a groundwater model for determining water table depth, and the +introduction of a factor to simulate nitrogen limitation on plant +productivity. Oleson et al. (2008a) show that CLM3.5 exhibits +significant improvements over CLM3 in its partitioning of global ET +which result in wetter soils, less plant water stress, increased +transpiration and photosynthesis, and an improved annual cycle of total +water storage. Phase and amplitude of the runoff annual cycle is +generally improved. Dramatic improvements in vegetation biogeography +result when CLM3.5 is coupled to a dynamic global vegetation model. +Stöckli et al. (2008) examine the performance of CLM3.5 at local scales +by making use of a network of long-term ground-based ecosystem +observations [FLUXNET (Baldocchi et al. 2001)]. Data from 15 FLUXNET +sites were used to demonstrate significantly improved soil hydrology and +energy partitioning in CLM3.5. CLM3.5 was released to the community in +May, 2007. + +CLM4 +^^^^^^^^^^ + +The motivation for the next version of the model, CLM4, was to +incorporate several recent scientific advances in the understanding and +representation of land surface processes, expand model capabilities, and +improve surface and atmospheric forcing datasets (Lawrence et al. 2011). +Included in the first category are more sophisticated representations of +soil hydrology and snow processes. In particular, new treatments of soil +column-groundwater interactions, soil evaporation, aerodynamic +parameters for sparse/dense canopies, vertical burial of vegetation by +snow, snow cover fraction and aging, black carbon and dust deposition, +and vertical distribution of solar energy for snow were implemented. +Major new capabilities in the model include a representation of the +carbon-nitrogen cycle (CLM4CN, see next paragraph for additional +information), the ability to model land cover change in a transient +mode, inclusion of organic soil and deep soil into the existing mineral +soil treatment to enable more realistic modeling of permafrost, an urban +canyon model to contrast rural and urban energy balance and climate +(CLMU), and an updated biogenic volatile organic compounds (BVOC) model. +Other modifications of note include refinement of the global PFT, +wetland, and lake distributions, more realistic optical properties for +grasslands and croplands, and an improved diurnal cycle and spectral +distribution of incoming solar radiation to force the model in offline +mode. + +Many of the ideas incorporated into the carbon and nitrogen cycle +component of CLM4 derive from the earlier development of the offline +ecosystem process model Biome-BGC (Biome BioGeochemical Cycles), +originating at the Numerical Terradynamic Simulation Group (NTSG) at the +University of Montana, under the guidance of Prof. Steven Running. +Biome-BGC itself is an extension of an earlier model, Forest-BGC +**(Running and Coughlan, 1988; Running and Gower, 1991)**, which +simulates water, carbon, and, to a limited extent, nitrogen fluxes for +forest ecosystems. Forest-BGC was designed to be driven by remote +sensing inputs of vegetation structure, and so used a diagnostic +(prescribed) leaf area index, or, in the case of the dynamic allocation +version of the model **(Running and Gower, 1991)**, prescribed maximum +leaf area index. + +Biome-BGC expanded on the Forest-BGC logic by introducing a more +mechanistic calculation of leaf and canopy scale photosynthesis **(Hunt +and Running, 1992)**, and extending the physiological parameterizations +to include multiple woody and non-woody vegetation types **(Hunt et al. +1996; Running and Hunt, 1993)**. Later versions of Biome-BGC introduced +more mechanistic descriptions of belowground carbon and nitrogen cycles, +nitrogen controls on photosynthesis and decomposition, sunlit and shaded +canopies, vertical gradient in leaf morphology, and explicit treatment +of fire and harvest disturbance and regrowth dynamics **(Kimball et al. +1997; Thornton, 1998; Thornton et al. 2002; White et al. 2000)**. +Biome-BGC version 4.1.2 **(Thornton et al. 2002)** provided a point of +departure for integrating new biogeochemistry components into CLM4. + +CLM4 was released to the community in June, 2010 along with the +Community Climate System Model version 4 (CCSM4). CLM4 is used in CCSM4, +CESM1, CESM1.1, and remains available as the default land component +model option for coupled simulations in CESM1.2. + +CLM4.5 +^^^^^^^^^^^^ + +The motivations for the development of CLM4.5 (the model version +described in this Technical Description) were similar to those for CLM4: +incorporate several recent scientific advances in the understanding and +representation of land surface processes, expand model capabilities, and +improve surface and atmospheric forcing datasets. + +Specifically, several parameterizations were revised to reflect new +scientific understanding and in an attempt to reduce biases identified +in CLM4 simulations including low soil carbon stocks especially in the +Arctic, excessive tropical GPP and unrealistically low Arctic GPP, a dry +soil bias in Arctic soils, unrealistically high LAI in the tropics, a +transient 20\ :math:`{}^{th}` century carbon response that was +inconsistent with observational estimates, and several other more minor +problems or biases. + +The main modifications include updates to canopy processes including a +revised canopy radiation scheme and canopy scaling of leaf processes, +co-limitations on photosynthesis, revisions to photosynthetic parameters +(Bonan et al. 2011), **** temperature acclimation of photosynthesis, and +improved stability of the iterative solution in the photosynthesis and +stomatal conductance model (Sun et al. 2012). Hydrology updates include +modifications such that hydraulic properties of frozen soils are +determined by liquid water content only rather than total water content +and the introduction of an ice impedance function, and other corrections +that increase the consistency between soil water state and water table +position and allow for a perched water table above icy permafrost ground +(Swenson et al. 2012). A new snow cover fraction parameterization is +incorporated that reflects the hysteresis in fractional snow cover for a +given snow depth between accumulation and melt phases (Swenson and +Lawrence, 2012). The lake model in CLM4 is replaced with a completely +revised and more realistic lake model (Subin et al. 2012a). A surface +water store is introduced, replacing the wetland land unit and +permitting prognostic wetland distribution modeling, and the surface +energy fluxes are calculated separately (Swenson and Lawrence, 2012) for +snow-covered, water-covered, and snow/water-free portions of vegetated +and crop land units, and snow-covered and snow-free portions of glacier +land units. Globally constant river flow velocity is replaced with +variable flow velocity based on mean grid cell slope. A vertically +resolved soil biogeochemistry scheme is introduced with base +decomposition rates modified by soil temperature, water, and oxygen +limitations and also including vertical mixing of soil carbon and +nitrogen due to bioturbation, cryoturbation, and diffusion (Koven et al. +2013). The litter and soil carbon and nitrogen pool structure as well as +nitrification and denitrification are modified based on the Century +model and biological fixation is revised to distribute fixation more +realistically over the year (Koven et al. 2013). The fire model is +replaced with a model that includes representations of natural and +anthropogenic triggers and suppression as well as agricultural, +deforestation, and peat fires (Li et al. 2012a,b; Li et al. 2013a). The +biogenic volatile organic compounds model is updated to MEGAN2.1 +(Guenther et al. 2012). + +Additions to the model include a methane production, oxidation, and +emissions model (Riley et al. 2011a) and an extension of the crop model +to include interactive fertilization, organ pools (Drewniak et al. +2013), and irrigation (Sacks et al. 2009). Elements of the Variable +Infiltration Capacity (VIC) model are included as an alternative +optional runoff generation scheme (Li et al. 2011). There is also an +option to run with a multilayer canopy (Bonan et al. 2012). Multiple +urban density classes, rather than the single dominant urban density +class used in CLM4, are modeled in the urban land unit. Carbon +(:math:`{}^{13}`\ C and :math:`{}^{14}`\ C) isotopes are enabled (Koven +et al. 2013). Minor changes include a switch of the C3 Arctic grass and +shrub phenology from stress deciduous to seasonal deciduous and a change +in the glacier bare ice albedo to better reflect recent estimates. +Finally, the carbon and nitrogen cycle spinup is accelerated and +streamlined with a revised spinup method, though the spinup timescale +remains long. + +Finally, the predominantly low resolution input data for provided with +CLM4 to create CLM4 surface datasets is replaced with newer and higher +resolution input datasets where possible (see section 2.2.3 for +details). The default meteorological forcing dataset provided with CLM4 +(Qian et al. 2006) is replaced with the 1901-2010 CRUNCEP forcing +dataset (see Chapter 26) for CLM4.5, though users can also still use the +Qian et al. (2006) dataset or other alternative forcing datasets. + +CLM4.5 was released to the community in June 2013 along with the +Community Earth System Model version 1.2 (CESM1.2). + +Biogeophysical and Biogeochemical Processes +----------------------------------------------- + +Biogeophysical and biogeochemical processes are simulated for each +subgrid land unit, column, and plant functional type (PFT) independently +and each subgrid unit maintains its own prognostic variables (see +section 2.1.1 for definitions of subgrid units). The same atmospheric +forcing is used to force all subgrid units within a grid cell. The +surface variables and fluxes required by the atmosphere are obtained by +averaging the subgrid quantities weighted by their fractional areas. The +processes simulated include (Figure 1.1): + +#. Surface characterization including land type heterogeneity and + ecosystem structure (Chapter 2) + +#. Absorption, reflection, and transmittance of solar radiation (Chapter + 3, 4) + +#. Absorption and emission of longwave radiation (Chapter 4) + +#. Momentum, sensible heat (ground and canopy), and latent heat (ground + evaporation, canopy evaporation, transpiration) fluxes (Chapter 5) + +#. Heat transfer in soil and snow including phase change (Chapter 6) + +#. Canopy hydrology (interception, throughfall, and drip) (Chapter 7) + +#. Snow hydrology (snow accumulation and melt, compaction, water + transfer between snow layers) (Chapter 7) + +#. Soil hydrology (surface runoff, infiltration, redistribution of water + within the column, sub-surface drainage, groundwater) (Chapter 7) + +#. Stomatal physiology and photosynthesis (Chapter 8) + +#. place Lake temperatures and fluxes (Chapter 9) + +#. Glacier processes (Chapter 10) + +#. Routing of runoff from rivers to ocean (Chapter 11) + +#. Urban energy balance and climate (Chapter 12) + +#. Vegetation carbon and nitrogen allocation and respiration (Chapter + 13) + +#. Vegetation phenology (Chapter 14) + +#. Soil and litter carbon decomposition (Chapter 15) + +#. Nitrogen cycling including deposition, biological fixation, + denitrification, leaching, and losses due to fire (Chapter 16) + +#. Plant mortality (Chapter 17) + +#. Fire ignition and suppression, including natural, deforestation, and + agricultural fire (Chapter 18) + +#. Methane production, oxidation, and emissions (Chapter 19) + +#. Crop dynamics and irrigation (Chapter 20) + +#. Land cover and land use change including wood harvest (Chapter 21) + +#. Dynamic global vegetation distribution (Chapter 22) + +#. Biogenic volatile organic compound emissions (Chapter 23) + +#. Dust mobilization and deposition (Chapter 24) + +#. Carbon isotope fractionation (Chapter 25) + +Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes +simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). + +**|image|** + +.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst b/doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst new file mode 100644 index 0000000000..9bd3e1e11d --- /dev/null +++ b/doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst @@ -0,0 +1,169 @@ +Glaciers +============ + +This chapter describes features of CLM that are specific to coupling to +an ice sheet model (in the CESM context, this is the Glimmer-CISM model; +Lipscomb and Sacks (2012) provide documentation and user’s guide for +Glimmer-CISM). General information about glacier land units can be found +elsewhere in this document (see Chapter 2 for an overview). + +Overview +------------- + +CLM is responsible for computing three quantities that are passed to the +ice sheet model: + +#. Surface mass balance (SMB) – the net annual accumulation/ablation of + mass at the upper surface (section 10.3) + +#. Ground surface temperature, which serves as an upper boundary + condition for Glimmer-CISM’s temperature calculation + +#. Surface topography, which currently is fixed in time, and is provided + on CLM’s surface dataset + +The ice sheet model is typically run at much higher resolution than CLM +(e.g., :math:`\sim`\ 5 km rather than :math:`\sim`\ 100 km). To improve +the downscaling from CLM’s grid to the ice sheet grid, the glaciated +portion of each grid cell is divided into multiple elevation classes +(section 10.2). The above quantities are computed separately in each +elevation class. Glimmer-CISM then computes high-resolution quantities +via horizontal and vertical interpolation. + +There are several reasons for computing the SMB in CLM rather than in +Glimmer-CISM: + +#. It is much cheaper to compute the SMB in CLM for :math:`\sim`\ 10 + elevation classes than in Glimmer-CISM. For example, suppose we are + running CLM at a resolution of :math:`\sim`\ 50 km and Glimmer at + :math:`\sim`\ 5 km. Greenland has dimensions of about 1000 x 2000 km. + For CLM we would have 20 x 40 x 10 = 8,000 columns, whereas for + Glimmer we would have 200 x 400 = 80,000 columns. + +#. We can use the sophisticated snow physics parameterization already in + CLM instead of implementing a separate scheme for Glimmer-CISM. Any + improvements to the CLM are applied to ice sheets automatically. + +#. The atmosphere model can respond during runtime to ice-sheet surface + changes. As shown by Pritchard et al. (2008), runtime albedo feedback + from the ice sheet is critical for simulating ice-sheet retreat on + paleoclimate time scales. Without this feedback the atmosphere warms + much less, and the retreat is delayed. + +#. Mass is more nearly conserved, given that the rate of surface ice + growth or melting computed in CLM is equal to the rate seen by the + dynamic ice sheet model. (Mass conservation is not exact, however, + because of approximations made in interpolating from the CLM grid to + the ice-sheet grid.) + +#. The improved SMB is available in CLM for all glaciated grid cells + (e.g., in the Alps, Rockies, Andes, and Himalayas), not just those + which are part of ice sheets. + +The current coupling between CLM and Glimmer-CISM is one-way only. That +is, CLM sends the SMB and surface temperature to Glimmer-CISM but does +not do anything with the fields that are returned. The CLM glacier +fraction and surface topography are therefore fixed in time. One-way +coupling is reasonable for runs of :math:`\sim`\ 100 years or less, in +which ice-sheet elevation changes are modest. For longer runs with +larger elevation changes, two-way coupling is highly desirable. A +two-way coupling scheme is under development. + +Multiple elevation class scheme +------------------------------------ + +In the typical operation of CLM, the glacier land unit contains a single +column (section 2.1.1). However, when running CESM with an active ice +sheet model, the glacier land unit is replaced by a glacier\_mec land +unit, where “mec†denotes “multiple elevation classesâ€. In most ways, +glacier\_mec land units behave the same as standard glacier land units. +However, each glacier\_mec land unit is divided into a user-defined set +of columns based on surface elevation. The default is 10 elevation +classes whose lower limits are 0, 200, 400, 700, 1000, 1300, 1600, 2000, +2500, and 3000 m. Each column is characterized by a fractional area and +surface elevation that are read in during model initialization. Each +glacier\_mec column within a grid cell has distinct ice and snow +temperatures, snow water content, surface fluxes, and SMB. + +Glacier\_mec columns, like glacier columns, are initialized with a +temperature of 250 K. While glacier columns are initialized with a snow +liquid water equivalent (LWE) equal to the maximum allowed value of 1 m, +glacier\_mec columns begin with a snow LWE of 0.5 m so that they will +reach their equilibrium mean snow depth sooner. Glacier\_mec columns +typically require several decades of spin-up to equilibrate with a given +climate. + +The atmospheric surface temperature, potential temperature, specific +humidity, density, and pressure are downscaled from the mean grid cell +elevation to the glacier\_mec column elevation using a specified lapse +rate (typically 6.0 deg/km) and an assumption of uniform relative +humidity. At a given time, lower-elevation columns can undergo surface +melting while columns at higher elevations remain frozen. This gives a +more accurate simulation of summer melting, which is a highly nonlinear +function of air temperature. The precipitation rate and radiative fluxes +are not currently downscaled, but could be in the future if care were +taken to preserve the cell-integrated values. + +In contrast to most CLM subgrid units, glacier\_mec columns can be +active (i.e., have model calculations run there) even if their area is +zero. This is done because the ice sheet model may require a SMB even +for some grid cells where CLM does not have glacier land units. To allow +for this, grid overlap files have been pre-computed. For given +resolutions of CLM and Glimmer-CISM, these files identify all +land-covered grid cells that overlap any part of the ice sheet grid. In +these overlapping cells, glacier\_mec columns are defined in all +elevation classes. Some columns may have zero area and are called +“virtual†columns. These columns do not affect energy exchange between +the land and the atmosphere, but are included for potential forcing of +Glimmer-CISM. + +Computation of the surface mass balance +-------------------------------------------- + +The SMB of a glacier or ice sheet is the net annual +accumulation/ablation of mass at the upper surface. Ablation is defined +as the mass of water that runs off to the ocean. Not all the surface +meltwater runs off; some of the melt percolates into the snow and +refreezes. Accumulation is primarily by snowfall and deposition, and +ablation is primarily by melting and evaporation/sublimation. CLM uses a +surface-energy-balance (SEB) scheme to compute the SMB. In this scheme, +the melting depends on the sum of the radiative, turbulent, and +conductive fluxes reaching the surface, as described elsewhere in this +document. + +CLM has a somewhat unrealistic treatment of accumulation and melting for +standard glacier land units. The snow depth is limited to a prescribed +depth of 1 m liquid water equivalent, with any additional snow assumed +to run off to the ocean. (This amounts to a crude parameterization of +iceberg calving.) Snow melting is treated in a realistic fashion, with +meltwater percolating downward through snow layers as long as the snow +is unsaturated. Once the underlying snow is saturated, any additional +meltwater runs off. When glacier ice melts, however, the meltwater is +assumed to remain in place until it refreezes. In warm parts of the ice +sheet, the meltwater does not refreeze, but stays in place indefinitely. + +In the modified glacier\_mec columns, the treatment of melting and +freezing depends on the logical variable *glc\_dyntopo*. This variable +controls whether CLM surface topography changes dynamically as the ice +sheet evolves (i.e., whether the coupling is one-way or two-way). If +*glc\_dyntopo* is true, then CLM receives updated topographic +information from the ice sheet model. In this case, snow in excess of +the prescribed maximum depth is assumed to turn into ice, contributing a +positive SMB to the ice sheet model. Melting ice is assumed to run off +to the ocean, giving a negative SMB. The net SMB associated with ice +formation (by conversion from snow) and melting/runoff is computed for +each column, averaged over the coupling interval, and sent to the +coupler (*qice, mm/s*). If *glc\_dyntopo* is false, then surface runoff +for glacier\_mec land units is computed as for glacier land units: Any +snow in excess of 1 m LWE runs off to the ocean, and Melted ice remains +in place until it refreezes. Excess snow and melted ice still contribute +to positive and negative values, respectively, of *qice*, but only for +the purpose of forcing Glimmer-CISM. Currently, *glc\_dyntopo* = false +is the default, and the only supported option. + +Note that the SMB typically is defined as the total accumulation of ice +and snow, minus the total ablation. The *qice* flux passed to +Glimmer-CISM is the mass balance for ice alone, not snow. We can think +of CLM as owning the snow, whereas Glimmer-CISM owns the underlying ice. +Fluctuations in snow depth between 0 and 1 m LWE are not reflected in +the SMB passed to Glimmer-CISM. diff --git a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst new file mode 100644 index 0000000000..2f1fd04e7b --- /dev/null +++ b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst @@ -0,0 +1,139 @@ +River Transport Model (RTM) +=============================== + +The RTM was developed to route total runoff from the land surface model +to either the active ocean or marginal seas which enables the hydrologic +cycle to be closed (Branstetter 2001, Branstetter and Famiglietti 1999). +This is needed to model ocean convection and circulation, which is +affected by freshwater input. It also provides another method of +diagnosing the performance of the land model because the river flow can +be directly compared to gauging station data (e.g., Dai and Trenberth +2002). + +To improve global energy conservation when CLM is being run as part of +the Community Climate System Model, runoff is split into two streams, a +liquid water stream and an ice water stream (derived from excess +snowfall in snow-capped grid cells, section 7.7). The liquid and ice +streams are routed through the RTM, passed to, and dealt with by the +ocean separately. + +The RTM uses a linear transport scheme to route water from each grid +cell to its downstream neighboring grid cell. The change in storage +:math:`S` of river water, whether it be liquid or ice, within a RTM grid +cell (m\ :math:`{}^{3}` s\ :math:`{}^{-1}`) is + +.. math:: + :label: ZEqnNum723341 + + \frac{dS}{dt} =\sum F_{in} -F_{out} +R + +where :math:`\sum F_{in}` is the sum of inflows of water from +neighboring upstream grid cells (m\ :math:`{}^{3}` s\ :math:`{}^{-1}`), +:math:`F_{out}` is the flux of water leaving the grid cell in the +downstream direction (m :math:`{}^{3}` s\ :math:`{}^{-1}`), and :math:`R` +is the total runoff generated by the land model grid cell +(m\ :math:`{}^{3}` s\ :math:`{}^{-1}`). Downstream water flow direction in +each grid cell is determined as one of eight compass points (north, +northeast, east, southeast, south, southwest, west, and northwest) based +on the steepest downhill slope as determined from a digital elevation +model (Graham et al. 1999). The flux of water leaving the grid cell +:math:`F_{out}` is + +.. math:: + :label: 11.2) + + F_{out} =\frac{v}{d} S + +where :math:`v` is the effective water flow velocity (m +s\ :math:`{}^{-1}`), :math:`d` is the distance between centers of +neighboring grid cells (m), and :math:`S` is the volume of river water +stored within the grid cell (m\ :math:`{}^{3}`). The effective water flow +velocity can be estimated from Manning’s equation, which is a function +of surface water slope, the hydraulic radius of the river channel, and a +channel roughness coefficient (Dingman, 2002). However, hydraulic radius +and channel roughness data are not available globally, so a simplified +effective flow velocity expression is used in RTM + +.. math:: + :label: 11.2) + + v=\max \left(0.05,k\beta ^{1/2} \right) + +where :math:`\beta` is the grid cell mean topographic slope, and +:math:`k=1`. + +The distance :math:`d` between two grid cell centers depends on river +direction, latitude, and longitude as + +.. math:: + :label: 11.3) + + d=\sqrt{\Delta x^{2} +\Delta y^{2} } . + +The distance in the zonal direction :math:`\Delta x` (m) is + +.. math:: + :label: 11.4) + + \Delta x=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right)\left[0.5\left(\cos \phi _{i,\, j} +\cos \phi _{i*,\, j*} \right)\right] + +where :math:`\theta _{i,\, j}` and :math:`\theta _{i*,\, j*}` are the +latitudes (radians) of the upstream and downstream grid cells, +:math:`\phi _{i,\, j}` and :math:`\phi _{i*,\, j*}` are the longitudes +(radians) of the upstream and downstream grid cells, :math:`R_{e}` is +the radius of the earth (km) (Table 2.6), and :math:`i` and :math:`j` +are grid cell indices. The distance in the meridional direction +:math:`\Delta y` (m) is + +.. math:: + :label: 11.5) + + \Delta y=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right). + +The RTM is generally run at a time step greater than that of the CLM +because of computational constraints. The total runoff from the land +model at each time step is accumulated until the RTM is invoked. The +total liquid water runoff at the land model resolution (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is + +.. math:: + :label: 11.6) + + R_{liq} =q_{over} +q_{drai} +q_{rgwl} + +where :math:`q_{over}` is surface runoff (section 7.3), +:math:`q_{drai}` is sub-surface drainage (section 7.6), and +:math:`q_{rgwl}` is liquid runoff from glaciers, wetlands, and lakes +(all in kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) (sections 7.7 and +9.6.3). The total ice water runoff, also at the land model resolution is + +.. math:: + :label: 11.7) + + R_{ice} =q_{snwcp,ice} + +where :math:`q_{snwcp,ice}` is the ice runoff from snow-capped +surfaces (section 7.7). The runoff at the land model resolution is +interpolated to the resolution of RTM and converted to units of +m\ :math:`{}^{3}` s\ :math:`{}^{-1}` for use in equation by multiplying +by :math:`1\times 10^{-3} A` where :math:`A` is the area +(m\ :math:`{}^{2}`) of the RTM grid cell. + +The RTM grid cells that are at river mouths, hence providing freshwater +flux to the ocean, are identified by examining each RTM ocean grid cell +and determining if a RTM land grid cell flows to that ocean grid cell. +River mouth grid cells are also assigned if any overlapping grid cells +at the land model resolution contain land. When used as part of the +Community Climate System Model, the ocean freshwater liquid and ice +fluxes at the RTM resolution are passed to the flux coupler which +distributes the fluxes to the appropriate ocean grid cells. When used +with the Community Atmosphere Model or when run offline, RTM serves only +as a diagnostic tool. The river-routing scheme conserves water globally +as + +.. math:: + :label: 11.8) + + \sum _{i,\, j}\left(\frac{dS}{dt} \right) _{i,\, j} =\sum _{i,\, j}R_{i,\, j} . + + diff --git a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst new file mode 100644 index 0000000000..f4e74d3731 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst @@ -0,0 +1,130 @@ +Urban Model (CLMU) +====================== + +At the global scale, and at the coarse spatial resolution of current +climate models, urbanization has negligible impact on climate. However, +the urban parameterization (CLMU; Oleson et al. 2008b,c) allows +simulation of the urban environment within a climate model, and +particularly the temperature where people live. As such, the urban model +allows scientific study of how climate change affects the urban heat +island and possible urban planning and design strategies to mitigate +warming (e.g., white roofs). + +The urban model that was released as a component of CLM4.0 is separately +described in the urban technical note (Oleson et al. 2010b). Here, we +provide a brief overview of the urban model released as a component of +CLM4.5. The main changes in the urban model from CLM4.0 to CLM4.5 are 1) +an expansion of the single urban landunit to up to three landunits per +grid cell stratified by urban density types, 2) the number of urban +layers for roofs and walls is no longer constrained to be equal to the +number of ground layers, 3) space heating and air conditioning wasteheat +factors are now set to zero by default so that the user can customize +these factors for their own application, 4) the elevation threshold used +to eliminate urban areas in the surface dataset creation routines has +been changed from 2200 meters to 2600 meters, 5) hydrologic and thermal +calculations for the pervious road now follows CLM4.5 parameterizations. + +Urban areas in CLM are represented by up to three urban landunits per +gridcell according to density class. The urban landunit is based on the +“urban canyon†concept of Oke (1987) in which the canyon geometry is +described by building height (:math:`H`) and street width (:math:`W`) +(Figure 12.1). The canyon system consists of roofs, walls, and canyon +floor. Walls are further divided into shaded and sunlit components. The +canyon floor is divided into pervious (e.g., to represent residential +lawns, parks) and impervious (e.g., to represent roads, parking lots, +sidewalks) fractions. Vegetation is not explicitly modeled for the +pervious fraction; instead evaporation is parameterized by a simplified +bulk scheme. + +Each of the five urban surfaces is treated as a column within the +landunit (Figure 12.1). Radiation parameterizations account for trapping +of solar and longwave radiation inside the canyon. Momentum fluxes are +determined for the urban landunit using a roughness length and +displacement height appropriate for the urban canyon and stability +formulations from CLM. A one-dimensional heat conduction equation is +solved numerically for a multiple-layer (:math:`N_{levurb} =5`) column +to determine conduction fluxes into and out of canyon surfaces. The +interior boundary conditions for roofs and walls are determined by an +interior building temperature (:math:`T_{iB}` ) held between prescribed +maximum and minimum temperatures +(:math:`T_{iB,\, \max } ,\, T_{iB,\, \min }` ), thus explicitly +resolving space heating and air conditioning fluxes. Anthropogenic +sources of waste heat (:math:`Q_{H,\, waste}` ) from air conditioning +and space heating can be optionally incorporated as modifications to the +canyon energy budget. Turbulent [sensible heat (:math:`Q_{H,\, u}` ) and +latent heat (:math:`Q_{E,\, u}` )] and storage (:math:`Q_{S,\, u}` ) +heat fluxes and surface (:math:`T_{u,\, s}` ) and internal +(:math:`T_{u,\, i=1,\, N_{levgrnd} }` ) temperatures are determined for +each urban surface :math:`u`. Hydrology on the roof and canyon floor is +simulated and walls are hydrologically inactive. A snowpack can form on +the active surfaces. A certain amount of liquid water is allowed to pond +on these surfaces which supports evaporation. Water in excess of the +maximum ponding depth runs off +(:math:`R_{roof} ,\, R_{imprvrd} ,\, R_{prvrd}` ). + +The heat and moisture fluxes from each surface interact with each other +through a bulk air mass that represents air in the urban canopy layer +for which specific humidity (:math:`q_{ac}` ) and temperature +(:math:`T_{ac}` ) are prognosed (Figure 12.2). The air temperature can +be compared with that from surrounding vegetated/soil (rural) surfaces +in the model to ascertain heat island characteristics. As with other +landunits, the CLMU is forced either with output from a host atmospheric +model (e.g., the Community Atmosphere Model (stocktickerCAM)) or +observed forcing (e.g., reanalysis or field observations). The urban +model produces sensible, latent heat, and momentum fluxes, emitted +longwave, and reflected solar radiation, which are area-averaged with +fluxes from non-urban “landunits†(e.g., vegetation, lakes) to supply +grid cell averaged fluxes to the atmospheric model. + +Present day global urban extent and urban properties were developed by +Jackson et al. (2010). Urban extent, defined for four classes [tall +building district (TBD), and high, medium, and low density (HD, MD, +LD)], was derived from LandScan 2004, a population density dataset +derived from census data, nighttime lights satellite observations, road +proximity, and slope (Dobson et al. 2000). The urban extent data for +TBD, HD, and MD classes are aggregated from the original 1 km resolution +to both a 0.05\ :math:`{}^\circ` by 0.05\ :math:`{}^\circ` global grid +for high-resolution studies or a 0.5\ :math:`{}^\circ` by +0.5\ :math:`{}^\circ` grid. For the current implementation, the LD class +is not used because it is highly rural and better modeled as a +vegetated/soil surface. Although the TBD, HD, and MD classes are +represented as individual urban landunits, urban model history output is +currently a weighted average of the output for individual classes. + +For each of 33 distinct regions across the globe, thermal (e.g., heat +capacity and thermal conductivity), radiative (e.g., albedo and +emissivity) and morphological (e.g., height to width ratio, roof +fraction, average building height, and pervious fraction of the canyon +floor) properties are provided for each of the density classes. Building +interior minimum and maximum temperatures are prescribed based on +climate and socioeconomic considerations. The surface dataset creation +routines (see CLM4.5 User’s Guide) aggregate the data to the desired +resolution. + +Figure 12.1. Schematic representation of the urban land unit. + +See the text for description of notation. Incident, reflected, and net +solar and longwave radiation are calculated for each individual surface +but are not shown for clarity. + +.. image:: image1.png + +Figure 12.2. Schematic of urban and atmospheric model coupling. + +The urban model is forced by the atmospheric model wind +(:math:`u_{atm}` ), temperature (**:math:`T_{atm}` **), specific +humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar +(:math:`S_{atm} \, \downarrow` ) and longwave +(:math:`L_{atm} \, \downarrow` ) radiation at reference height +:math:`z'_{atm}` (section 2.2.1). Fluxes from the urban landunit to the +atmosphere are turbulent sensible (:math:`H`) and latent heat +(:math:`\lambda E`), momentum (:math:`\tau` ), albedo + +(:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and +absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature + +(:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed +(:math:`u_{c}` ) within the urban canopy layer are diagnosed by the +urban model. :math:`H` is the average building height. + +.. image:: image2.png diff --git a/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst b/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst new file mode 100644 index 0000000000..c4a4ab2345 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst @@ -0,0 +1,599 @@ +Carbon and Nitrogen Pools, Allocation, and Respiration +========================================================== + +Introduction +----------------- + +CLM includes a fully-prognostic treatment of the terrestrial carbon and +nitrogen cycles including interactions between these cycles as mediated +by biological mechanisms of plants and soil heterotrophs. The model is +fully prognostic with respect to all carbon and nitrogen state variables +in the vegetation, litter, and soil organic matter. The seasonal timing +of new vegetation growth and litterfall is also prognostic, responding +to soil and air temperature, soil water availability, and daylength, in +varying degrees depending on a specified phenology type for each PFT +(see Chapter 14). The prognostic LAI, SAI, and vegetation heights are +utilized by the biophysical model. + +Separate state variables for C and N are tracked for leaf, live stem, +dead stem, live coarse root, dead coarse root, and fine root pools +(Figure 13.1 and 13.2). Each of these pools has two corresponding +storage pools representing, respectively, short-term and long-term +storage of non-structural carbohydrates and labile nitrogen. There are +two additional carbon pools, one for the storage of growth respiration +reserves, and another used to meet excess demand for maintenance +respiration during periods with low photosynthesis. One additional +nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue +prior to abscission and litterfall. Altogether there are 20 state +variables for vegetation carbon, and 19 for vegetation nitrogen. + +Figure 13.1. Vegetation fluxes and pools. + +.. image:: image1.png + :width: 800px + :height: 800px + +Figure 13.2: Carbon and nitrogen pools. + +.. image:: image2.png + :width: 400px + :height: 400px + +Carbon Allocation for Maintenance Respiration Costs +-------------------------------------------------------- + +The carbon and nitrogen allocation routines in CLM determine the fate of +newly assimilated carbon, coming from the calculation of photosynthesis, +and available mineral nitrogen, coming from plant uptake of mineral +nitrogen in the soil or being drawn out of plant reserves. Allocation +fluxes are determined in three steps: first :math:`CF_{GPPpot}` is +used to evaluate the potential allocation of carbon and nitrogen +assuming an unlimited nitrogen supply, then the actual nitrogen supply +is compared against the demand, and finally allocation of carbon and +nitrogen are reduced, if necessary, to match nitrogen supply and demand. + +Allocation of available carbon on each time step is prioritized, with +first priority given to the demand for carbon to support maintenance +respiration of live tissues (section 13.7). Second priority is to +replenish the internal plant carbon pool that supports maintenance +respiration during times when maintenance respiration exceeds +photosynthesis (e.g. at night, during winter for perennial vegetation, +or during periods of drought stress) (Sprugel et al., 1995). Third +priority is to support growth of new tissues, including allocation to +storage pools from which new growth will be displayed in subsequent time +steps. + +The total maintenance respiration demand (:math:`CF_{mr}`, gC +m\ :sup:`-2` s\ :math:`{}^{-1}`) is calculated as a function of +tissue mass and nitrogen concentration, and temperature (section 13.7). +The carbon supply to support this demand is composed of fluxes allocated +from carbon assimilated in the current timestep +(:math:`CF_{GPP,mr}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) +and from a storage pool that is drawn down when total demand exceeds +photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` +s\ :math:`{}^{-1}`): + +.. math:: + :label: 13.1) + + CF_{mr} =CF_{GPP,mr} +CF_{xs,mr} + +.. math:: + :label: 13.2) + + CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. + +.. math:: + :label: 13.3) + + CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. + +The storage pool that supplies carbon for maintenance respiration in +excess of current :math:`CF_{GPPpot}` ( :math:`CS_{xs}`, gC +m\ :sup:`-2`) is permitted to run a deficit (negative state), and +the magnitude of this deficit determines an allocation demand which +gradually replenishes :math:`CS_{xs}`. The logic for allowing a +negative state for this pool is to eliminate the need to know in advance +what the total maintenance respiration demand will be for a particular +combination of climate and plant type. Using the deficit approach, the +allocation to alleviate the deficit increases as the deficit increases, +until the supply of carbon into the pool balances the demand for carbon +leaving the pool in a quasi-steady state, with variability driven by the +seasonal cycle, climate variation, disturbance, and internal dynamics of +the plant-litter-soil system. In cases where the combination of climate +and plant type are not suitable to sustained growth, the deficit in this +pool increases until the available carbon is being allocated mostly to +alleviate the deficit, and new growth approaches zero. The allocation +flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC +m\ :sup:`-2` s\ :math:`{}^{-1}`) is given as + +.. math:: + :label: 13.4) + + CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. + +.. math:: + :label: 13.5) + + CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. + +where :math:`\tau_{xs}` is the time constant (currently +set to 30 days) controlling the rate of replenishment of :math:`CS_{xs}`. + +Note that these two top-priority carbon allocation fluxes +(:math:`CF_{GPP,mr}` and :math:`CF_{GPP,xs}`) are not +stoichiometrically associated with any nitrogen fluxes, and so this +initial allocation step can proceed without reference to (or limitation +from) the available mineral nitrogen supply. + +Carbon and Nitrogen Stoichiometry of New Growth +---------------------------------------------------- + +After accounting for the carbon cost of maintenance respiration, the +remaining carbon flux from photosynthesis which can be allocated to new +growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) is + +.. math:: + :label: 13.6) + + CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . + +Potential allocation to new growth is calculated for all of the plant +carbon and nitrogen state variables based on specified C:N ratios for +each tissue type and allometric parameters that relate allocation +between various tissue types. The allometric parameters are defined as +follows: + +.. math:: + :label: ZEqnNum650137 + + \begin{array}{l} {a_{1} ={\rm \; ratio\; of\; new\; fine\; root\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{2} ={\rm \; ratio\; of\; new\; coarse\; root\; :\; new\; stem\; carbon\; allocation}} \\ {a_{3} ={\rm \; ratio\; of\; new\; stem\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{4} ={\rm \; ratio\; new\; live\; wood\; :\; new\; total\; wood\; allocation}} \\ {g_{1} ={\rm ratio\; of\; growth\; respiration\; carbon\; :\; new\; growth\; carbon.\; }} \end{array} + +Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined as constants for a given PFT (Table +13.1), while :math:`g_{l }` = 0.3 (unitless) is prescribed as a +constant for all PFTs, based on construction costs for a range of woody +and non-woody tissues (Larcher, 1995). + +The model includes a dynamic allocation scheme for woody vegetation +(parameter :math:`a_{3}` = -1, Table 13.1), in which case the +ratio for carbon allocation between new stem and new leaf increases with +increasing net primary production (NPP), as + +.. math:: + :label: 13.8) + + a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 + +where :math:`NPP_{ann}` is the annual sum of NPP from the previous +year. This mechanism has the effect of increasing woody allocation in +favorable growth environments (Allen et al., 2005; Vanninen and Makela, +2005) and during the phase of stand growth prior to canopy closure +(Axelsson and Axelsson, 1986). + +Table 13.1. Allocation and carbon:nitrogen ratio parameters + ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | ++==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ +| NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| NET Boreal | 1 | 0.3 | -1 | 0.1 | 40 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| NDT Boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BET Tropical | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BET temperate | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT tropical | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT temperate | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BES temperate | 1 | 0.3 | 0.2 | 0.5 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :math:`{}_{3}` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :math:`{}_{3}` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :math:`{}_{4}` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Crop I | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Corn R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Corn I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Temp Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Temp Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Winter Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Winter Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Soybean R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Soybean I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + +Carbon to nitrogen ratios are defined for different tissue types as +follows: + +.. math:: + :label: ZEqnNum413927 + + \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} + +where all C:N parameters are defined as constants for a given PFT (Table +13.1). + +Given values for the parameters in and , total carbon and nitrogen +allocation to new growth ( :math:`CF_{alloc}`, gC +m\ :sup:`-2` s\ :math:`{}^{-1}`, and :math:`NF_{alloc}`, gN +m\ :sup:`-2` s\ :math:`{}^{-1}`, respectively) can be expressed as +functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC +m\ :sup:`-2` s\ :math:`{}^{-1}`): + +.. math:: + :label: ZEqnNum555154 + + \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} + +where + +.. math:: + :label: 13.11) + + \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} + +.. math:: + :label: 13.12) + + N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. + +Since the C:N stoichiometry for new growth allocation is defined, from +Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation +(:math:`CF_{avail\_alloc}`) can be used to calculate the total +plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, +gN m\ :sup:`-2` s\ :math:`{}^{-1}`) as: + +.. math:: + :label: 13.13) + + NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . + +Deployment of retranslocated nitrogen +------------------------------------------ + +In many plants, some portion of the nitrogen used to construct new +tissues is mobilized from senescing tissues, especially leaves, and +retained within the plant when the tissues are lost as litter. This +store of retranslocated nitrogen is used to supply part of the nitrogen +demand for subsequent growth (Magill et al., 1997; Oikawa et al., 2005; +Son and Gower, 1991). CLM includes one pool of retranslocated nitrogen +(:math:`NS_{retrans}`, gN m\ :sup:`-2`), and the +availability of nitrogen from this pool to support new growth +(:math:`NF_{avail\_retrans}`, gN m\ :sup:`-2` +s\ :math:`{}^{-1}`) is proportional to the plant nitrogen demand, as: + +.. math:: + :label: 13.14) + + NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) + +where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :math:`{}^{-1}`) is the previous year’s annual sum of retranslocated +nitrogen extracted from senescing tissues, +:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :math:`{}^{-1}`) is the previous year’s annual sum of +:math:`NF_{plant\_demand}`, and :math:`\Delta`\ *t* (s) is the +model’s biogeochemistry time step. This formulation produces an annual +cycle in the extraction of nitrogen from :math:`NS_{retrans}` +which corresponds to the annual cycle of plant nitrogen demand, and +which is scaled to give :math:`NS_{retrans}` approximately a +one-year turnover time. The minimum function prevents extraction of more +than the remaining pool of retranslocated nitrogen, which can be an +important constraint under conditions where high rates of mortality are +modifying the size of the pool. During the first year of an initial +simulation, before :math:`NF_{plant\_demand\_ann}` and +:math:`NF_{retrans\_ann}` have valid values, +:math:`NF_{avail\_retrans}` is set to 0.0. + +The actual flux of nitrogen from the retranslocated N pool into +allocation of new growth (:math:`NF_{retrans,alloc}`, gN +m\ :sup:`-2` s\ :math:`{}^{-1}`) is never greater than the plant +demand for new nitrogen: + +.. math:: + :label: 13.15) + + NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) + +Plant nitrogen uptake from soil mineral nitrogen pool +---------------------------------------------------------- + +The total plant nitrogen demand is reduced by the nitrogen flux from +:math:`NS_{retrans}` to give the plant demand for mineral nitrogen +from the soil (:math:`NF_{plant\_demand\_soil}`, gN +m\ :sup:`-2` s\ :math:`{}^{-1}`): + +.. math:: + :label: ZEqnNum491412 + + NF_{plant\_ demand\_ soil} =NF_{plant\_ demand} -NF_{retrans,alloc} . + +The combined demand from all PFTs sharing space on a soil column and the +demand from the heterotrophic community in the soil (nitrogen +immobilization demand) compete for the available soil mineral nitrogen +pool. The result of this competition is passed back to the allocation +algorithm as :math:`f_{plant\_demand}`, the fraction (from 0 to 1) +of the plant nitrogen demand which can be met given the current soil +mineral nitrogen supply and competition with heterotrophs. Plant uptake +from the soil mineral nitrogen pool is then given as: + +.. math:: + :label: 13.17) + + NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} + +Final carbon and nitrogen allocation +----------------------------------------- + +The total flux of allocated nitrogen is given as: + +.. math:: + :label: 13.18) + + NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} + +From the stoichiometric relationship in Eq. , the associated carbon +allocation flux is: + +.. math:: + :label: 13.19) + + CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . + +The downregulation of photosynthesis can then be calculated as: + +.. math:: + :label: 13.20) + + f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . + +Total allocation to new leaf carbon +(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) is calculated as: + +.. math:: + :label: 13.21) + + CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . + +There are two carbon pools associated with each plant tissue – one which +represents the currently displayed tissue, and another which represents +carbon stored for display in a subsequent growth period. The nitrogen +pools follow this same organization. The model keeps track of stored +carbon according to which tissue type it will eventually be displayed +as, and the separation between display in the current timestep and +storage for later display depends on the parameter :math:`f_{cur}` +(values 0 to 1). Given :math:`CF_{alloc,leaf}` and :math:`f_{cur}`, the allocation fluxes of carbon to display and +storage pools (where storage is indicated with *\_stor*) for the various +tissue types are given as: + +.. math:: + :label: 13.22) + + CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} + +.. math:: + :label: 13.23) + + CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) + +.. math:: + :label: 13.24) + + CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} + +.. math:: + :label: 13.25) + + CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) + +.. math:: + :label: 13.26) + + CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} + +.. math:: + :label: 13.27) + + CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) + +.. math:: + :label: 13.28) + + CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} + +.. math:: + :label: 13.29) + + CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) + +.. math:: + :label: 13.30) + + CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} + +.. math:: + :label: 13.31) + + CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) + +.. math:: + :label: 13.32) + + CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} + +.. math:: + :label: 13.33) + + CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). + +The corresponding nitrogen allocation fluxes are given as: + +.. math:: + :label: 13.34) + + NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} + +.. math:: + :label: 13.35) + + NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) + +.. math:: + :label: 13.36) + + NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} + +.. math:: + :label: 13.37) + + NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) + +.. math:: + :label: 13.38) + + NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} + +.. math:: + :label: 13.39) + + NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + +.. math:: + :label: 13.40) + + NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + +.. math:: + :label: 13.41) + + NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) + +.. math:: + :label: 13.42) + + NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} + +.. math:: + :label: 13.43) + + NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + +.. math:: + :label: 13.44) + + NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + +.. math:: + :label: 13.45) + + NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). + +Autotrophic Respiration +---------------------------- + +The model treats maintenance and growth respiration fluxes separately, +even though it is difficult to measure them as separate fluxes (Lavigne +and Ryan, 1997; Sprugel et al., 1995). Maintenance respiration is +defined as the carbon cost to support the metabolic activity of existing +live tissue, while growth respiration is defined as the additional +carbon cost for the synthesis of new growth. + +13.7.1 Maintenance Respiration +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Under the assumption that tissue nitrogen content is a suitable index of +cellular metabolic rate, maintenance respiration costs for live tissues +(leaf, live stem, live coarse root, and fine root) are calculated as +functions tissue nitrogen content and the relevant temperature, +following the empirical relationship reported by Ryan (1991): + +.. math:: + :label: 13.46) + + CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 13.47) + + CF_{mr\_ livestem} \_ =NS_{livestem} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 13.48) + + CF_{mr\_ livecroot} \_ =NS_{livecroot} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 13.49) + + CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} + +where :math:`MR_{base}` (= 2.525e\ :sup:`-6` gC gN\ :sup:`-1` s\ :sup:`-1`) is the base rate of maintenance +respiration per unit nitrogen content, :math:`MR_{q10}` (= 2.0) is +the temperature sensitivity for maintenance respiration, +:math:`T_{2m}` (:math:`{}^\circ`\ C) is the air temperature at 2m +height, :math:`Ts_{j}`* (:math:`{}^\circ`\ C) is the soil +temperature at level *j*, and :math:`rootfr_{j}` is the fraction +of fine roots distributed in soil level *j*. + +Note that, for woody vegetation, maintenance respiration costs are not +calculated for the dead stem and dead coarse root components. These +components are assumed to consist of dead xylem cells, with no metabolic +function. By separating the small live component of the woody tissue +(ray parenchyma, phloem, and sheathing lateral meristem cells) from the +larger fraction of dead woody tissue, it is reasonable to assume a +common base maintenance respiration rate for all live tissue types. + +The total maintenance respiration cost is then given as: + +.. math:: + :label: 13.50) + + CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . + +13.7.2 Growth Respiration +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Growth respiration is calculated as a factor of 0.3 times the total +carbon in new growth on a given timestep, based on construction costs +for a range of woody and non-woody tissues (Larcher, 1995). For new +carbon and nitrogen allocation that enters storage pools for subsequent +display, it is not clear what fraction of the associated growth +respiration should occur at the time of initial allocation, and what +fraction should occur later, at the time of display of new growth from +storage. Eddy covariance estimates of carbon fluxes in forest ecosystems +suggest that the growth respiration associated with transfer of +allocated carbon and nitrogen from storage into displayed tissue is not +significant (Churkina et al., 2003), and so it is assumed in CLM that +all of the growth respiration cost is incurred at the time of initial +allocation, regardless of the fraction of allocation that is displayed +immediately (i.e. regardless of the value of :math:`f_{cur}`, +section 13.5). This behavior is parameterized in such a way that if +future research suggests that some fraction of the growth respiration +cost should be incurred at the time of display from storage, a simple +parameter modification will effect the change. [1]_ + +.. [1] + Parameter :math:`\text{grpnow}` in routines CNGResp and CNAllocation, currently set to 1.0, could be changed to a smaller + value to transfer some portion (1 - :math:`\text{grpnow}` ) of the growth respiration forward in time to occur at the time of growth + display from storage. + diff --git a/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst b/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst new file mode 100644 index 0000000000..65a0cf17a7 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst @@ -0,0 +1,887 @@ +.. math:: 10 + +Vegetation Phenology +======================== + +The CLM phenology model consists of several algorithms controlling the +transfer of stored carbon and nitrogen out of storage pools for the +display of new growth and into litter pools for losses of displayed +growth. PFTs are classified into three distinct phenological types that +are represented by separate algorithms: an evergreen type, for which +some fraction of annual leaf growth persists in the displayed pool for +longer than one year; a seasonal-deciduous type with a single growing +season per year, controlled mainly by temperature and daylength; and a +stress-deciduous type with the potential for multiple growing seasons +per year, controlled by temperature and soil moisture conditions. + +The three phenology types share a common set of control variables. The +calculation of the phenology fluxes is generalized, operating +identically for all three phenology types, given a specification of the +common control variables. The following sections describe first the +general flux parameterization, followed by the algorithms for setting +the control parameters for the three phenology types. + +General Phenology Flux Parameterization +-------------------------------------------- + +Fluxes of carbon and nitrogen from storage pools and into displayed +tissue pools pass through a special transfer pool (denoted *\_xfer*), +maintained as a separate state variable for each tissue type. Storage +(*\_stor*) and transfer (*\_xfer*) pools are maintained separately to +reduce the complexity of accounting for transfers into and out of +storage over the course of a single growing season. + +Figure 14.1. Example of annual phenology cycle for seasonal deciduous. + +|image| + +14.1.1 Onset Periods +^^^^^^^^^^^^^^^^^^^^ + +The deciduous phenology algorithms specify the occurrence of onset +growth periods (Figure 14.1). Carbon fluxes from the transfer pools into +displayed growth are calculated during these periods as: + +.. math:: + + \label{14.1)} + CF_{leaf\_ xfer,leaf} =r_{xfer\_ on} CS_{leaf\_ xfer} + +.. math:: + + \label{14.2)} + CF_{froot\_ xfer,froot} =r_{xfer\_ on} CS_{froot\_ xfer} + +.. math:: + + \label{14.3)} + CF_{livestem\_ xfer,livestem} =r_{xfer\_ on} CS_{livestem\_ xfer} + +.. math:: + + \label{14.4)} + CF_{deadstem\_ xfer,deadstem} =r_{xfer\_ on} CS_{deadstem\_ xfer} + +.. math:: + + \label{14.5)} + CF_{livecroot\_ xfer,livecroot} =r_{xfer\_ on} CS_{livecroot\_ xfer} + +.. math:: + + \label{14.6)} + CF_{deadcroot\_ xfer,deadcroot} =r_{xfer\_ on} CS_{deadcroot\_ xfer} , + +with corresponding nitrogen fluxes: + +.. math:: + + \label{14.7)} + NF_{leaf\_ xfer,leaf} =r_{xfer\_ on} NS_{leaf\_ xfer} + +.. math:: + + \label{14.8)} + NF_{froot\_ xfer,froot} =r_{xfer\_ on} NS_{froot\_ xfer} + +.. math:: + + \label{14.9)} + NF_{livestem\_ xfer,livestem} =r_{xfer\_ on} NS_{livestem\_ xfer} + +.. math:: + + \label{14.10)} + NF_{deadstem\_ xfer,deadstem} =r_{xfer\_ on} NS_{deadstem\_ xfer} + +.. math:: + + \label{14.11)} + NF_{livecroot\_ xfer,livecroot} =r_{xfer\_ on} NS_{livecroot\_ xfer} + +.. math:: + + \label{14.12)} + NF_{deadcroot\_ xfer,deadcroot} =r_{xfer\_ on} NS_{deadcroot\_ xfer} , + +where CF is the carbon flux, CS is stored carbon, NF is the nitrogen +flux, NS is stored nitrogen, *r\ :math:`{}_{xfer\_on}`* +(s:math:`{}^{-1}`) is a time-varying rate coefficient controlling flux +out of the transfer pool: + +.. math:: + + \label{ZEqnNum852972} + r_{xfer\_ on} =\left\{\begin{array}{l} {{2\mathord{\left/ {\vphantom {2 t_{onset} }} \right. \kern-\nulldelimiterspace} t_{onset} } \qquad {\rm for\; }t_{onset} \ne \Delta t} \\ {{1\mathord{\left/ {\vphantom {1 \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \qquad {\rm for\; }t_{onset} =\Delta t} \end{array}\right. + +and *t\ :math:`{}_{onset}`* (s) is the number of seconds remaining in +the current phenology onset growth period (Figure 14.1). The form of Eq. +produces a flux from the transfer pool which declines linearly over the +onset growth period, approaching zero flux in the final timestep. + +14.1.2 Offset Periods +^^^^^^^^^^^^^^^^^^^^^ + +The deciduous phenology algorithms also specify the occurrence of +litterfall during offset periods. In contrast to the onset periods, only +leaf and fine root state variables are subject to litterfall fluxes. +Carbon fluxes from display pools into litter are calculated during these +periods as: + +.. math:: + + \label{14.14)} + CF_{leaf,litter}^{n} =\left\{\begin{array}{l} {CF_{leaf,litter}^{n-1} +r_{xfer\_ off} \left(CS_{leaf} -CF_{leaf,litter}^{n-1} {\kern 1pt} t_{offset} \right)\qquad {\rm for\; }t_{offset} \ne \Delta t} \\ {\left({CS_{leaf} \mathord{\left/ {\vphantom {CS_{leaf} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \right)+CF_{alloc,leaf} \qquad \qquad \qquad \qquad {\rm for\; }t_{offset} =\Delta t} \end{array}\right. + +.. math:: + + \label{14.15)} + CF_{froot,litter}^{n} =\left\{\begin{array}{l} {CF_{froot,litter}^{n-1} +r_{xfer\_ off} \left(CS_{froot} -CF_{froot,litter}^{n-1} {\kern 1pt} t_{offset} \right)\qquad {\rm for\; }t_{offset} \ne \Delta t} \\ {\left({CS_{froot} \mathord{\left/ {\vphantom {CS_{froot} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \right)+CF_{alloc,\, froot} \qquad \qquad \qquad {\rm for\; }t_{offset} =\Delta t} \end{array}\right. + +.. math:: + + \label{14.16)} + r_{xfer\_ off} =\frac{2\Delta t}{t_{offset} ^{2} } + +where superscripts *n* and *n-1* refer to fluxes on the current and +previous timesteps, respectively. The rate coefficient +*r\ :math:`{}_{xfer\_off}`* varies with time to produce a linearly +increasing litterfall rate throughout the offset period, and the special +case for fluxes in the final litterfall timestep +(*t\ :math:`{}_{offset}`* = *:math:`\Delta`\ t*) ensures that all of the +displayed growth is sent to the litter pools for deciduous plant types. + +Corresponding nitrogen fluxes during litterfall take into account +retranslocation of nitrogen out of the displayed leaf pool prior to +litterfall (*NF\ :math:`{}_{leaf,retrans}`*, gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`). Retranslocation of nitrogen out of fine roots is +assumed to be negligible. The fluxes are: + +.. math:: + + \label{14.17)} + NF_{leaf,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf\_ litter} }} \right. \kern-\nulldelimiterspace} CN_{leaf\_ litter} } + +.. math:: + + \label{14.18)} + NF_{froot,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{froot} }} \right. \kern-\nulldelimiterspace} CN_{froot} } + +.. math:: + + \label{14.19)} + NF_{leaf,retrans} =\left({CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf} }} \right. \kern-\nulldelimiterspace} CN_{leaf} } \right)-NF_{leaf,litter} . + +where CN is C:N. + +14.1.3 Background Onset Growth +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The stress-deciduous phenology algorithm includes a provision for the +case when stress signals are absent, and the vegetation shifts from a +deciduous habit to an evergreen habit, until the next occurrence of an +offset stress trigger . In that case, the regular onset flux mechanism +is switched off and a background onset growth algorithm is invoked +(*r\ :math:`{}_{bgtr}`* :math:`>` 0). During this period, small fluxes +of carbon and nitrogen from the storage pools into the associated +transfer pools are calculated on each time step, and the entire contents +of the transfer pool are added to the associated displayed growth pool +on each time step. The carbon fluxes from transfer to display pools +under these conditions are: + +.. math:: + + \label{14.20)} + CF_{leaf\_ xfer,leaf} ={CS_{leaf\_ xfer} \mathord{\left/ {\vphantom {CS_{leaf\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.21)} + CF_{froot\_ xfer,froot} ={CS_{froot\_ xfer} \mathord{\left/ {\vphantom {CS_{froot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.22)} + CF_{livestem\_ xfer,livestem} ={CS_{livestem\_ xfer} \mathord{\left/ {\vphantom {CS_{livestem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.23)} + CF_{deadstem\_ xfer,deadstem} ={CS_{deadstem\_ xfer} \mathord{\left/ {\vphantom {CS_{deadstem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.24)} + CF_{livecroot\_ xfer,livecroot} ={CS_{livecroot\_ xfer} \mathord{\left/ {\vphantom {CS_{livecroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.25)} + CF_{deadcroot\_ xfer,deadcroot} ={CS_{deadcroot\_ xfer} \mathord{\left/ {\vphantom {CS_{deadcroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} , + +and the corresponding nitrogen fluxes are: + +.. math:: + + \label{14.26)} + NF_{leaf\_ xfer,leaf} ={NS_{leaf\_ xfer} \mathord{\left/ {\vphantom {NS_{leaf\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.27)} + NF_{froot\_ xfer,froot} ={NS_{froot\_ xfer} \mathord{\left/ {\vphantom {NS_{froot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.28)} + NF_{livestem\_ xfer,livestem} ={NS_{livestem\_ xfer} \mathord{\left/ {\vphantom {NS_{livestem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.29)} + NF_{deadstem\_ xfer,deadstem} ={NS_{deadstem\_ xfer} \mathord{\left/ {\vphantom {NS_{deadstem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.30)} + NF_{livecroot\_ xfer,livecroot} ={NS_{livecroot\_ xfer} \mathord{\left/ {\vphantom {NS_{livecroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.31)} + NF_{deadcroot\_ xfer,deadcroot} ={NS_{deadcroot\_ xfer} \mathord{\left/ {\vphantom {NS_{deadcroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} . + +14.1.4 Background Litterfall +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Both evergreen and stress-deciduous phenology algorithms can specify a +litterfall flux that is not associated with a specific offset period, +but which occurs instead at a slow rate over an extended period of time, +referred to as background litterfall. For evergreen types the background +litterfall is the only litterfall flux. For stress-deciduous types +either the offset period litterfall or the background litterfall +mechanism may be active, but not both at once. Given a specification of +the background litterfall rate (*r\ :math:`{}_{bglf}`*, +s\ :math:`{}^{-1}`), litterfall carbon fluxes are calculated as + +.. math:: + + \label{14.32)} + CF_{leaf,litter} =r_{bglf} CS_{leaf} + +.. math:: + + \label{14.33)} + CS_{froot,litter} =r_{bglf} CS_{froot} , + +with corresponding nitrogen litterfall and retranslocation fluxes: + +.. math:: + + \label{14.34)} + NF_{leaf,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf\_ litter} }} \right. \kern-\nulldelimiterspace} CN_{leaf\_ litter} } + +.. math:: + + \label{14.35)} + NF_{froot,litter} ={CF_{froot,litter} \mathord{\left/ {\vphantom {CF_{froot,litter} CN_{froot} }} \right. \kern-\nulldelimiterspace} CN_{froot} } + +.. math:: + + \label{14.36)} + NF_{leaf,retrans} =\left({CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf} }} \right. \kern-\nulldelimiterspace} CN_{leaf} } \right)-NF_{leaf,litter} . + +14.1.5 Livewood Turnover +^^^^^^^^^^^^^^^^^^^^^^^^ + +The conceptualization of live wood vs. dead wood fractions for stem and +coarse root pools is intended to capture the difference in maintenance +respiration rates between these two physiologically distinct tissue +types. Unlike displayed pools for leaf and fine root, which are lost to +litterfall, live wood cells reaching the end of their lifespan are +retained as a part of the dead woody structure of stems and coarse +roots. A mechanism is therefore included in the phenology routine to +effect the transfer of live wood to dead wood pools, which also takes +into account the different nitrogen concentrations typical of these +tissue types. + +A live wood turnover rate (*r\ :math:`{}_{lwt}`*, s\ :math:`{}^{-1}`) is +defined as + +.. math:: + + \label{14.37)} + r_{lwt} ={p_{lwt} \mathord{\left/ {\vphantom {p_{lwt} \left(365\cdot 86400\right)}} \right. \kern-\nulldelimiterspace} \left(365\cdot 86400\right)} + +where *p\ :math:`{}_{lwt}`* = 0.7 is the assumed annual live wood +turnover fraction. Carbon fluxes from live to dead wood pools are: + +.. math:: + + \label{14.38)} + CF_{livestem,deadstem} =CS_{livestem} r_{lwt} + +.. math:: + + \label{14.39)} + CF_{livecroot,deadcroot} =CS_{livecroot} r_{lwt} , + +and the associated nitrogen fluxes, including retranslocation of +nitrogen out of live wood during turnover, are: + +.. math:: + + \label{14.40)} + NF_{livestem,deadstem} ={CF_{livestem,deadstem} \mathord{\left/ {\vphantom {CF_{livestem,deadstem} CN_{dw} }} \right. \kern-\nulldelimiterspace} CN_{dw} } + +.. math:: + + \label{14.41)} + NF_{livestem,retrans} =\left({CF_{livestem,deadstem} \mathord{\left/ {\vphantom {CF_{livestem,deadstem} CN_{lw} }} \right. \kern-\nulldelimiterspace} CN_{lw} } \right)-NF_{livestem,deadstem} + +.. math:: + + \label{14.42)} + NF_{livecroot,deadcroot} ={CF_{livecroot,deadcroot} \mathord{\left/ {\vphantom {CF_{livecroot,deadcroot} CN_{dw} }} \right. \kern-\nulldelimiterspace} CN_{dw} } + +.. math:: + + \label{14.43)} + NF_{livecroot,retrans} =\left({CF_{livecroot,deadcroot} \mathord{\left/ {\vphantom {CF_{livecroot,deadcroot} CN_{lw} }} \right. \kern-\nulldelimiterspace} CN_{lw} } \right)-NF_{livecroot,deadcroot} . + +Evergreen Phenology +------------------------ + +The evergreen phenology algorithm is by far the simplest of the three +possible types. It is assumed for all evergreen types that all carbon +and nitrogen allocated for new growth in the current timestep goes +immediately to the displayed growth pools (i.e. *f\ :math:`{}_{cur}`* = +(Chapter 13)). As such, there is never an accumulation of carbon or +nitrogen in the storage or transfer pools, and so the onset growth and +background onset growth mechanisms are never invoked for this type. +Litterfall is specified to occur only through the background litterfall +mechanism – there are no distinct periods of litterfall for evergreen +types, but rather a continuous (slow) shedding of foliage and fine +roots. This is an obvious area for potential improvements in the model, +since it is known, at least for evergreen needleleaf trees in the +temperate and boreal zones, that there are distinct periods of higher +and lower leaf litterfall (Ferrari, 1999; Gholz et al., 1985). The rate +of background litterfall (*r\ :math:`{}_{bglf}`*, section 14.1.4) +depends on the specified leaf longevity +(*:math:`\tau`\ :math:`{}_{leaf}`*, y), as + +.. math:: + + \label{14.44)} + r_{bglf} =\frac{1}{\tau _{leaf} \cdot 365\cdot 86400} . + +Seasonal-Deciduous Phenology +--------------------------------- + +The seasonal-deciduous phenology algorithm derives directly from the +treatment used in the offline model Biome-BGC v. 4.1.2, (Thornton et +al., 2002), which in turn is based on the parameterizations for leaf +onset and offset for temperate deciduous broadleaf forest from White et +al. (1997). Initiation of leaf onset is triggered when a common +degree-day summation exceeds a critical value, and leaf litterfall is +initiated when daylength is shorter than a critical value. Because of +the dependence on daylength, the seasonal deciduous phenology algorithm +is only valid for latitudes outside of the tropical zone, defined here +as :math:`\left|{\rm latitude}\right|>19.5{\rm {}^\circ }`. Neither the +background onset nor background litterfall mechanism is invoked for the +seasonal-deciduous phenology algorithm. The algorithm allows a maximum +of one onset period and one offset period each year. + +The algorithms for initiation of onset and offset periods use the winter +and summer solstices as coordination signals. The period between winter +and summer solstice is identified as *dayl\ :math:`{}_{n}`* :math:`>` +*dayl\ :math:`{}_{n-1}`*, and the period between summer and winter +solstice is identified as *dayl\ :math:`{}_{n}`* :math:`<` +*dayl\ :math:`{}_{n-1}`*, where *dayl\ :math:`{}_{n}`* and +*dayl\ :math:`{}_{n-1}`* are the daylength (s) calculated for the +current and previous timesteps, respectively, using + +.. math:: + + \label{14.45)} + dayl=2\cdot 13750.9871\cdot acos\left(\frac{-\sin (lat)\sin (decl)}{\cos (lat)\cos (decl)} \right), + +where *lat* and *decl* are the latitude and solar declination (radians), +respectively, and the factor 13750.9871 is the number of seconds per +radian of hour-angle. + +14.3.1 Seasonal-Deciduous Onset Trigger +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The onset trigger for the seasonal-deciduous phenology algorithm is +based on an accumulated growing-degree-day approach (White et al., +1997). The growing-degree-day summation (*GDD\ :math:`{}_{sum}`*) is +initiated (*GDD\ :math:`{}_{sum}`* = 0) when the phenological state is +dormant and the model timestep crosses the winter solstice. Once these +conditions are met, *GDD\ :math:`{}_{sum}`* is updated on each timestep +as + +.. math:: + + \label{ZEqnNum510730} + GDD_{sum}^{n} =\left\{\begin{array}{l} {GDD_{sum}^{n-1} +\left(T_{s,3} -TKFRZ\right)f_{day} \qquad {\rm for\; }T_{s,3} >TKFRZ} \\ {GDD_{sum}^{n-1} \qquad \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \end{array}\right. + +where *T\ :math:`{}_{s,3}`* (K) is the temperature of the third soil +layer, and +:math:`f_{day} ={\Delta t\mathord{\left/ {\vphantom {\Delta t 86400}} \right. \kern-\nulldelimiterspace} 86400}` . +The onset period is initiated if :math:`GDD_{sum} >GDD_{sum\_ crit}` , +where + +.. math:: + + \label{ZEqnNum598907} + GDD_{sum\_ crit} =\exp \left(4.8+0.13{\kern 1pt} \left(T_{2m,ann\_ avg} -TKFRZ\right)\right) + +and where *T\ :math:`{}_{2m,ann\_avg}`* (K) is the annual average of +the 2m air temperature, and TKFRZ is the freezing point of water (273.15 +K). The following control variables are set when a new onset growth +period is initiated: + +.. math:: + + \label{14.48)} + GDD_{sum} =0 + +.. math:: + + \label{14.49)} + t_{onset} =86400\cdot n_{days\_ on} , + +where *n\ :math:`{}_{days\_on}`* is set to a constant value of 30 days. +Fluxes from storage into transfer pools occur in the timestep when a new +onset growth period is initiated. Carbon fluxes are: + +.. math:: + + \label{ZEqnNum904388} + CF_{leaf\_ stor,leaf\_ xfer} ={f_{stor,xfer} CS_{leaf\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{leaf\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.51)} + CF_{froot\_ stor,froot\_ xfer} ={f_{stor,xfer} CS_{froot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{froot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.52)} + CF_{livestem\_ stor,livestem\_ xfer} ={f_{stor,xfer} CS_{livestem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{livestem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.53)} + CF_{deadstem\_ stor,deadstem\_ xfer} ={f_{stor,xfer} CS_{deadstem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{deadstem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.54)} + CF_{livecroot\_ stor,livecroot\_ xfer} ={f_{stor,xfer} CS_{livecroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{livecroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.55)} + CF_{deadcroot\_ stor,deadcroot\_ xfer} ={f_{stor,xfer} CS_{deadcroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{deadcroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{ZEqnNum195642} + CF_{gresp\_ stor,gresp\_ xfer} ={f_{stor,xfer} CS_{gresp\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{gresp\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +and the associated nitrogen fluxes are: + +.. math:: + + \label{ZEqnNum812152} + NF_{leaf\_ stor,leaf\_ xfer} ={f_{stor,xfer} NS_{leaf\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{leaf\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.58)} + NF_{froot\_ stor,froot\_ xfer} ={f_{stor,xfer} NS_{froot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{froot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.59)} + NF_{livestem\_ stor,livestem\_ xfer} ={f_{stor,xfer} NS_{livestem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{livestem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.60)} + NF_{deadstem\_ stor,deadstem\_ xfer} ={f_{stor,xfer} NS_{deadstem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{deadstem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{14.61)} + NF_{livecroot\_ stor,livecroot\_ xfer} ={f_{stor,xfer} NS_{livecroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{livecroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{ZEqnNum605338} + NF_{deadcroot\_ stor,deadcroot\_ xfer} ={f_{stor,xfer} NS_{deadcroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{deadcroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +where *f\ :math:`{}_{stor,xfer}`* is the fraction of current storage +pool moved into the transfer pool for display over the incipient onset +period. This fraction is set to 0.5, based on the observation that +seasonal deciduous trees are capable of replacing their canopies from +storage reserves in the event of a severe early-season disturbance such +as frost damage or defoliation due to insect herbivory. + +If the onset criterion (*GDD\ :math:`{}_{sum}`* :math:`>` +*GDD\ :math:`{}_{sum\_crit}`*) is not met before the summer solstice, +then *GDD\ :math:`{}_{sum}`* is set to 0.0 and the growing-degree-day +accumulation will not start again until the following winter solstice. +This mechanism prevents the initiation of very short growing seasons +late in the summer in cold climates. The onset counter is decremented on +each time step after initiation of the onset period, until it reaches +zero, signaling the end of the onset period: + +.. math:: + + \label{14.63)} + t_{onfset}^{n} =t_{onfset}^{n-1} -\Delta t + +14.3.2 Seasonal-Deciduous Offset Trigger +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +After the completion of an onset period, and once past the summer +solstice, the offset (litterfall) period is triggered when daylength is +shorter than 39300 s. The offset counter is set at the initiation of the +offset period: :math:`t_{offset} =86400\cdot n_{days\_ off}` , where +*n\ :math:`{}_{days\_off}`* is set to a constant value of 15 days. The +offset counter is decremented on each time step after initiation of the +offset period, until it reaches zero, signaling the end of the offset +period: + +.. math:: + + \label{14.64)} + t_{offset}^{n} =t_{offset}^{n-1} -\Delta t + +Stress-Deciduous Phenology +------------------------------- + +The stress-deciduous phenology algorithm was developed specifically for +the CLM based in part on the grass phenology model proposed by White et +al. (1997). The algorithm handles phenology for vegetation types such as +grasses and tropical drought-deciduous trees that respond to both cold +and drought-stress signals, and that can have multiple growing seasons +per year. The algorithm also allows for the possibility that leaves +might persist year-round in the absence of a suitable stress trigger. In +that case the phenology switches to an evergreen habit, maintaining a +marginally-deciduous leaf longevity (one year) until the occurrence of +the next stress trigger. + +14.4.1 Stress-Deciduous Onset Triggers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In climates that are warm year-round, onset triggering depends on soil +water availability. At the beginning of a dormant period (end of +previous offset period), an accumulated soil water index +(*SWI\ :math:`{}_{sum}`*, d) is initialized (*SWI\ :math:`{}_{sum}`* = +0), with subsequent accumulation calculated as: + +.. math:: + + \label{ZEqnNum503826} + SWI_{sum}^{n} =\left\{\begin{array}{l} {SWI_{sum}^{n-1} +f_{day} \qquad {\rm for\; }\Psi _{s,3} \ge \Psi _{onset} } \\ {SWI_{sum}^{n-1} \qquad \qquad {\rm for\; }\Psi _{s,3} <\Psi _{onset} } \end{array}\right. + +where :math:`\Psi`\ *:math:`{}_{s,3}`* is the soil water potential (MPa) +in the third soil layer and :math:`\Psi`\ *:math:`{}_{onset}`* = -2 MPa +is the onset soil water potential threshold. Onset triggering is +possible once *SWI\ :math:`{}_{sum}`* :math:`>` 15. If the cold climate +growing degree-day accumulator is not active at the time when this +threshold is reached (see below), and if the daylength is greater than 6 +hours, then onset is triggered. Except as noted below, +*SWI\ :math:`{}_{sum}`* continues to accumulate according to Eq. during +the dormant period if the daylength criterion prevents onset triggering, +and onset is then triggered at the timestep when daylength exceeds 6 +hours. + +In climates with a cold season, onset triggering depends on both +accumulated soil temperature summation and adequate soil moisture. At +the beginning of a dormant period a freezing day accumulator +(*FD\ :math:`{}_{sum}`*, d) is initialized (*FD\ :math:`{}_{sum}`* = 0), +with subsequent accumulation calculated as: + +.. math:: + + \label{14.66)} + FD_{sum}^{n} =\left\{\begin{array}{l} {FD_{sum}^{n-1} +f_{day} \qquad {\rm for\; }T_{s,3} >TKFRZ} \\ {FD_{sum}^{n-1} \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \end{array}\right. . + +If *FD\ :math:`{}_{sum}`* :math:`>` 15 during the dormant period, then a +cold-climate onset triggering criterion is introduced, following exactly +the growing degree-day summation (*GDD\ :math:`{}_{sum}`*) logic of Eqs. +and . At that time *SWI\ :math:`{}_{sum}`* is reset +(*SWI\ :math:`{}_{sum}`* = 0). Onset triggering under these conditions +depends on meeting all three of the following criteria: +*SWI\ :math:`{}_{sum}`* :math:`>` 15, *GDD\ :math:`{}_{sum}`* :math:`>` +*GDD\ :math:`{}_{sum\_crit}`*, and daylength greater than 6 hrs. + +The following control variables are set when a new onset growth period +is initiated: *SWI\ :math:`{}_{sum}`* = 0, *FD\ :math:`{}_{sum}`* = 0, +*GDD\ :math:`{}_{sum}`* = 0, *n\ :math:`{}_{days\_active}`* = 0, and +:math:`t_{onset} =86400\cdot n_{days\_ on}` , where +*n\ :math:`{}_{days\_on}`* is set to a constant value of 30 days. Fluxes +from storage into transfer pools occur in the timestep when a new onset +growth period is initiated, and are handled identically to Eqs. - for +carbon fluxes, and to Eqs. - for nitrogen fluxes. The onset counter is +decremented on each time step after initiation of the onset period, +until it reaches zero, signaling the end of the onset period: + +.. math:: + + \label{14.67)} + t_{onfset}^{n} =t_{onfset}^{n-1} -\Delta t + +14.4.2 Stress-Deciduous Offset Triggers +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Any one of the following three conditions is sufficient to initiate an +offset period for the stress-deciduous phenology algorithm: sustained +period of dry soil, sustained period of cold temperature, or daylength +shorter than 6 hours. Offset triggering due to dry soil or cold +temperature conditions is only allowed once the most recent onset period +is complete. Dry soil condition is evaluated with an offset soil water +index accumulator (*OSWI\ :math:`{}_{sum}`*, d). To test for a sustained +period of dry soils, this control variable can increase or decrease, as +follows: + +.. math:: + + \label{14.68)} + OSWI_{sum}^{n} =\left\{\begin{array}{l} {OSWI_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }\Psi _{s,3} \le \Psi _{offset} } \\ {{\rm max}\left(OSWI_{sum}^{n-1} -f_{day} ,0\right)\qquad {\rm for\; }\Psi _{s,3} >\Psi _{onset} } \end{array}\right. + +where :math:`\Psi`\ *:math:`{}_{offset}`* = -2 MPa is the offset soil +water potential threshold. An offset period is triggered if the previous +onset period is complete and *OSWI\ :math:`{}_{sum}`* +:math:`\mathrm{\ge}` *OSWI\ :math:`{}_{sum\_crit}`*, where +*OSWI\ :math:`{}_{sum\_crit}`* = 15. + +The cold temperature trigger is calculated with an offset freezing day +accumulator (*OFD\ :math:`{}_{sum}`*, d). To test for a sustained period +of cold temperature, this variable can increase or decrease, as follows: + +.. math:: + + \label{14.69)} + OFD_{sum}^{n} =\left\{\begin{array}{l} {OFD_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \\ {{\rm max}\left(OFD_{sum}^{n-1} -f_{day} ,0\right)\qquad \qquad {\rm for\; }T_{s,3} >TKFRZ} \end{array}\right. + +An offset period is triggered if the previous onset period is complete +and *OFD\ :math:`{}_{sum}`* :math:`>` *OFD\ :math:`{}_{sum\_crit}`*, +where *OFD\ :math:`{}_{sum\_crit}`* = 15. + +The offset counter is set at the initiation of the offset period: +:math:`t_{offset} =86400\cdot n_{days\_ off}` , where +*n\ :math:`{}_{days\_off}`* is set to a constant value of 15 days. The +offset counter is decremented on each time step after initiation of the +offset period, until it reaches zero, signaling the end of the offset +period: + +.. math:: + + \label{14.70)} + t_{offset}^{n} =t_{offset}^{n-1} -\Delta t + +14.4.3 Stress-Deciduous: Long Growing Season +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Under conditions when the stress-deciduous conditions triggering offset +are not met for one year or longer, the stress-deciduous algorithm +shifts toward the evergreen behavior. This can happen in cases where a +stress-deciduous vegetation type is assigned in a climate where suitably +strong stresses occur less frequently than once per year. This condition +is evaluated by tracking the number of days since the beginning of the +most recent onset period (*n\ :math:`{}_{days\_active}`*, d). At the end +of an offset period *n\ :math:`{}_{days\_active}`* is reset to 0. A long +growing season control variable (*LGS*, range 0 to 1) is calculated as: + +.. math:: + + \label{14.71)} + LGS=\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }n_{days\_ active} <365} \\ {\left({n_{days\_ active} \mathord{\left/ {\vphantom {n_{days\_ active} 365}} \right. \kern-\nulldelimiterspace} 365} \right)-1\qquad {\rm for\; }365\le n_{days\_ active} <730} \\ {1\qquad \qquad \qquad {\rm for\; }n_{days\_ active} \ge 730} \end{array}\right. . + +The rate coefficient for background litterfall (*r\ :math:`{}_{bglf}`*, +s\ :math:`{}^{-1}`) is calculated as a function of *LGS*: + +.. math:: + + \label{14.72)} + r_{bglf} =\frac{LGS}{\tau _{leaf} \cdot 365\cdot 86400} + +where *:math:`\tau`\ :math:`{}_{leaf}`* is the leaf longevity. The +result is a shift to continuous litterfall as +*n\ :math:`{}_{days\_active}`* increases from 365 to 730. When a new +offset period is triggered *r\ :math:`{}_{bglf}`* is set to 0. + +The rate coefficient for background onset growth from the transfer pools +(*r\ :math:`{}_{bgtr}`*, s\ :math:`{}^{-1}`) also depends on *LGS*, as: + +.. math:: + + \label{14.73)} + r_{bgtr} =\frac{LGS}{365\cdot 86400} . + +On each timestep with *r\ :math:`{}_{bgtr}`* :math:`\neq` 0, carbon +fluxes from storage to transfer pools are calculated as: + +.. math:: + + \label{14.74)} + CF_{leaf\_ stor,leaf\_ xfer} =CS_{leaf\_ stor} r_{bgtr} + +.. math:: + + \label{14.75)} + CF_{froot\_ stor,froot\_ xfer} =CS_{froot\_ stor} r_{bgtr} + +.. math:: + + \label{14.76)} + CF_{livestem\_ stor,livestem\_ xfer} =CS_{livestem\_ stor} r_{bgtr} + +.. math:: + + \label{14.77)} + CF_{deadstem\_ stor,deadstem\_ xfer} =CS_{deadstem\_ stor} r_{bgtr} + +.. math:: + + \label{14.78)} + CF_{livecroot\_ stor,livecroot\_ xfer} =CS_{livecroot\_ stor} r_{bgtr} + +.. math:: + + \label{14.79)} + CF_{deadcroot\_ stor,deadcroot\_ xfer} =CS_{deadcroot\_ stor} r_{bgtr} , + +with corresponding nitrogen fluxes: + +.. math:: + + \label{14.80)} + NF_{leaf\_ stor,leaf\_ xfer} =NS_{leaf\_ stor} r_{bgtr} + +.. math:: + + \label{14.81)} + NF_{froot\_ stor,froot\_ xfer} =NS_{froot\_ stor} r_{bgtr} + +.. math:: + + \label{14.82)} + NF_{livestem\_ stor,livestem\_ xfer} =NS_{livestem\_ stor} r_{bgtr} + +.. math:: + + \label{14.83)} + NF_{deadstem\_ stor,deadstem\_ xfer} =NS_{deadstem\_ stor} r_{bgtr} + +.. math:: + + \label{14.84)} + NF_{livecroot\_ stor,livecroot\_ xfer} =NS_{livecroot\_ stor} r_{bgtr} + +.. math:: + + \label{14.85)} + NF_{deadcroot\_ stor,deadcroot\_ xfer} =NS_{deadcroot\_ stor} r_{bgtr} . + +The result, in conjunction with the treatment of background onset +growth, is a shift to continuous transfer from storage to display pools +at a rate that would result in complete turnover of the storage pools in +one year at steady state, once *LGS* reaches 1 (i.e. after two years +without stress-deciduous offset conditions). If and when conditions +cause stress-deciduous triggering again, *r\ :math:`{}_{bgtr}`* is rest +to 0. + +Litterfall Fluxes Merged to the Column Level +------------------------------------------------- + +CLM uses three litter pools, defined on the basis of commonly measured +chemical fractionation of fresh litter into labile (LIT1 = hot water and +alcohol soluble fraction), cellulose/hemicellulose (LIT2 = acid soluble +fraction) and remaining material, referred to here for convenience as +lignin (LIT3 = acid insoluble fraction) (Aber et al., 1990; Taylor et +al., 1989). While multiple plant functional types can coexist on a +single CLM soil column, each soil column includes a single instance of +the litter pools. Fluxes entering the litter pools due to litterfall are +calculated using a weighted average of the fluxes originating at the PFT +level. Carbon fluxes are calculated as: + +.. math:: + + \label{14.86)} + CF_{leaf,lit1} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.87)} + CF_{leaf,lit2} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.88)} + CF_{leaf,lit3} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.89)} + CF_{froot,lit1} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lab\_ froot,p} wcol_{p} + +.. math:: + + \label{14.90)} + CF_{froot,lit2} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{cel\_ froot,p} wcol_{p} + +.. math:: + + \label{14.91)} + CF_{froot,lit3} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lig\_ froot,p} wcol_{p} , + +where *f\ :math:`{}_{lab\_leaf,p}`*, *f\ :math:`{}_{cel\_leaf,p}`*, and +*f\ :math:`{}_{lig\_leaf,p}`* are the labile, cellulose/hemicellulose, +and lignin fractions of leaf litter for PFT *p*, +*f\ :math:`{}_{lab\_froot,p}`*, *f\ :math:`{}_{cel\_froot,p}`*, and +*f\ :math:`{}_{lig\_froot,p}`* are the labile, cellulose/hemicellulose, +and lignin fractions of fine root litter for PFT *p*, +*wtcol\ :math:`{}_{p}`* is the weight relative to the column for PFT +*p*, and *p* is an index through the plant functional types occurring on +a column. Nitrogen fluxes to the litter pools are assumed to follow the +C:N of the senescent tissue, and so are distributed using the same +fractions used for carbon fluxes: + +.. math:: + + \label{14.92)} + NF_{leaf,lit1} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.93)} + NF_{leaf,lit2} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.94)} + NF_{leaf,lit3} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} + +.. math:: + + \label{14.95)} + NF_{froot,lit1} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lab\_ froot,p} wcol_{p} + +.. math:: + + \label{14.96)} + NF_{froot,lit2} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{cel\_ froot,p} wcol_{p} + +.. math:: + + \label{14.97)} + NF_{froot,lit3} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lig\_ froot,p} wcol_{p} . + +.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst b/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst new file mode 100644 index 0000000000..eefab609fb --- /dev/null +++ b/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst @@ -0,0 +1,797 @@ +Decomposition +================= + +Decomposition of fresh litter material into progressively more +recalcitrant forms of soil organic matter is represented in CLM is +defined as a cascade of *k\ :math:`{}_{tras}`* transformations between +*m\ :math:`{}_{pool}`* decomposing coarse woody debris (CWD), litter, +and soil organic matter (SOM) pools, each defined at +*n\ :math:`{}_{lev}`* vertical levels. CLM allows the user to define, at +compile time, between 2 contrasting hypotheses of decomposition as +embodied by two separate decomposition submodels: the CLM-CN pool +structure used in CLM4.0, or a second pool structure, characterized by +slower decomposition rates, based on the Century model (Parton et al. +1988). In addition, the user can choose, at compile time, whether to +allow *n\ :math:`{}_{lev}`* to equal 1, as in CLM4.0, or to equal the +number of soil levels used for the soil hydrology (default 10). + +Figure 15.1. Schematic of decomposition model in CLM. + +Model is structured to allow different representations of the soil C and +N decomposition cascade, as well as a vertically-explicit treatment of +soil biogeochemistry. + +|image| + +For the single-level model structure, the fundamental equation for +carbon balance of the decomposing pools is: + +.. math:: + + \label{15.1)} + \frac{\partial C_{i} }{\partial t} =R_{i} +\sum _{j\ne i}\left(i-r_{j} \right)T_{ji} k_{j} C_{j} -k_{i} C_{i} + +where *C\ :math:`{}_{i}`* is the carbon content of pool *i*, +*R\ :math:`{}_{i}`* are the carbon inputs from plant tissues directly to +pool *i* (only non-zero for CWD and litter pools), *k\ :math:`{}_{i}`* +is the decay constant of pool *i*; *T\ :math:`{}_{ji}`* is the fraction +of carbon directed from pool *j* to pool *i* with fraction +*r\ :math:`{}_{j}`* lost as a respiration flux along the way. + +Adding the vertical dimension to the decomposing pools changes the +balance equation to the following: + +.. math:: + + \label{15.2)} + \begin{array}{l} {\frac{\partial C_{i} (z)}{\partial t} =R_{i} (z)+\sum _{i\ne j}\left(1-r_{j} \right)T_{ji} k_{j} (z)C_{j} (z) -k_{i} (z)C_{i} (z)} \\ {+\frac{\partial }{\partial z} \left(D(z)\frac{\partial C_{i} }{\partial z} \right)+\frac{\partial }{\partial z} \left(A(z)C_{i} \right)} \end{array} + +where *C\ :math:`{}_{i}`\ (z)* is now defined at each model level, and +in volumetric (gC m\ :math:`{}^{-3}`) rather than areal (gC +m\ :math:`{}^{-2}`) units, along with *R\ :math:`{}_{i}`\ (z)* and +*k\ :math:`{}_{j}`\ (z)*. In addition, vertical transport is handled by +the last two terms, for diffusive and advective transport. In the base +model, advective transport is set to zero, leaving only a diffusive flux +with diffusivity *D(z)* defined for all decomposing carbon and nitrogen +pools. Further discussion of the vertical distribution of carbon inputs +*R\ :math:`{}_{i}`\ (z)*, vertical turnover times +*k\ :math:`{}_{j}`\ (z)*, and vertical transport *D(z)* is below. +Discussion of the vertical model and analysis of both decomposition +structures is in Koven et al (2013). + +Figure 15.2. Pool structure, transitions, respired fractions (numbers at +end of arrows), and turnover times (numbers in boxes) for the 2 +alternate soil decomposition models included in CLM. + +|image| + +CLM-CN Pool Structure, Rate Constants and Parameters +--------------------------------------------------------- + +The CLM-CN structure in CLM45 uses three state variables for fresh +litter and four state variables for soil organic matter (SOM). The +masses of carbon and nitrogen in the live microbial community are not +modeled explicitly, but the activity of these organisms is represented +by decomposition fluxes transferring mass between the litter and SOM +pools, and heterotrophic respiration losses associated with these +transformations. The litter and SOM pools in CLM-CN are arranged as a +converging cascade (Figure 15.2), derived directly from the +implementation in Biome-BGC v4.1.2 (Thornton et al. 2002; Thornton and +Rosenbloom, 2005). + +Model parameters are estimated based on a synthesis of microcosm +decomposition studies using radio-labeled substrates (Degens and +Sparling, 1996; Ladd et al. 1992; Martin et al. 1980; Mary et al. 1993; +Saggar et al. 1994; Sørensen, 1981; van Veen et al. 1984). Multiple +exponential models are fitted to data from the microcosm studies to +estimate exponential decay rates and respiration fractions (Thornton, +1998). The microcosm experiments used for parameterization were all +conducted at constant temperature and under moist conditions with +relatively high mineral nitrogen concentrations, and so the resulting +rate constants are assumed not limited by the availability of water or +mineral nitrogen. Table 15.1 lists the base decomposition rates for each +litter and SOM pool, as well as a base rate for physical fragmentation +for the coarse woody debris pool (CWD). + +Table 15.1. Decomposition rate constants for litter and SOM pools, C:N +ratios, and acceleration parameters (see section 15.8 for explanation) +for the CLM-CN decomposition pool structure. + ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| | Biome-BGC | CLM-CN | | | ++==========================+================================================+===============================================+===============+=========================================+ +| | *k\ :math:`{}_{disc1 }`*\ (d:math:`{}^{-1}`) | *k\ :math:`{}_{disc2}`* (hr:math:`{}^{-1}`) | *C:N ratio* | *Acceleration term (a:math:`{}_{i}`)* | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{Lit1}`* | 0.7 | 0.04892 | - | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{Lit2}`* | 0.07 | 0.00302 | - | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{Lit3}`* | 0.014 | 0.00059 | - | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{SOM1}`* | 0.07 | 0.00302 | 12 | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{SOM2}`* | 0.014 | 0.00059 | 12 | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{SOM3}`* | 0.0014 | 0.00006 | 10 | 5 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{SOM4}`* | 0.0001 | 0.000004 | 10 | 70 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ +| *k\ :math:`{}_{CWD}`* | 0.001 | 0.00004 | - | 1 | ++--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + +The first column of Table 15.1 gives the rates as used for the Biome-BGC +model, which uses a discrete-time model with a daily timestep. The +second column of Table 15.1 shows the rates transformed for a one-hour +discrete timestep typical of CLM-CN. The transformation is based on the +conversion of the initial discrete-time value (*k\ :math:`{}_{disc1}`*) +first to a continuous time value (*k\ :math:`{}_{cont}`*), then to the +new discrete-time value with a different timestep +(*k\ :math:`{}_{disc2}`*) , following Olson (1963): + +.. math:: + + \label{ZEqnNum608251} + k_{cont} =-\log \left(1-k_{disc1} \right) + +.. math:: + + \label{ZEqnNum772630} + k_{disc2} =1-\exp \left(-k_{cont} \frac{\Delta t_{2} }{\Delta t_{1} } \right) + +where :math:`\Delta`\ *t\ :math:`{}_{1}`* (s) and +:math:`\Delta`\ *t\ :math:`{}_{2}`* (s) are the time steps of the +initial and new discrete-time models, respectively. + +Respiration fractions are parameterized for decomposition fluxes out of +each litter and SOM pool. The respiration fraction (*rf*, unitless) is +the fraction of the decomposition carbon flux leaving one of the litter +or SOM pools that is released as CO\ :math:`{}_{2}` due to heterotrophic +respiration. Respiration fractions and exponential decay rates are +estimated simultaneously from the results of microcosm decomposition +experiments (Thornton, 1998). The same values are used in CLM-CN and +Biome-BGC (Table 15.2). + +Table 15.2. Respiration fractions for litter and SOM pools + ++---------------------------+-----------------------+ +| Pool | *rf* | ++===========================+=======================+ +| *rf\ :math:`{}_{Lit1}`* | 0.39 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{Lit2}`* | 0.55 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{Lit3}`* | 0.29 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{SOM1}`* | 0.28 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{SOM2}`* | 0.46 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{SOM3}`* | 0.55 | ++---------------------------+-----------------------+ +| *rf\ :math:`{}_{SOM4}`* | 1.0\ :math:`{}^{a}` | ++---------------------------+-----------------------+ + +:math:`{}^{a}` The respiration fraction for pool SOM4 is 1.0 by +definition: since there is no pool downstream of SOM4, the entire carbon +flux leaving this pool is assumed to be respired as CO\ :math:`{}_{2}`. + +Century-based Pool Structure, Rate Constants and Parameters +---------------------------------------------------------------- + +The Century-based decomposition cascade is, like CLM-CN, a first-order +decay model; the two structures differ in the number of pools, the +connections between those pools, the turnover times of the pools, and +the respired fraction during each transition (Figure 15.2). The turnover +times are different for the Century-based pool structure, following +those described in Parton et al. (1988) (Table 15.3). + +Table 15.3. Turnover times, C:N ratios, and acceleration parameters (see +section 15.8 for explanation) for the Century-based decomposition +cascade. + ++------------+------------------------+-------------+-------------------------------------------+ +| | Turnover time (year) | C:N ratio | Acceleration term (*a\ :math:`{}_{i}`*) | ++============+========================+=============+===========================================+ +| CWD | 4.1 | - | 1 | ++------------+------------------------+-------------+-------------------------------------------+ +| Litter 1 | 0.066 | - | 1 | ++------------+------------------------+-------------+-------------------------------------------+ +| Litter 2 | 0.25 | - | 1 | ++------------+------------------------+-------------+-------------------------------------------+ +| Litter 3 | 0.25 | - | 1 | ++------------+------------------------+-------------+-------------------------------------------+ +| SOM 1 | 0.17 | 8 | 1 | ++------------+------------------------+-------------+-------------------------------------------+ +| SOM 2 | 6.1 | 11 | 15 | ++------------+------------------------+-------------+-------------------------------------------+ +| SOM 3 | 270 | 11 | 675 | ++------------+------------------------+-------------+-------------------------------------------+ + +Likewise, values for the respiration fraction of Century-based structure +are in Table 15.4. + +Table 15.4. Respiration fractions for litter and SOM pools for +Century-based structure + ++---------------------------+----------+ +| Pool | *rf* | ++===========================+==========+ +| *rf\ :math:`{}_{Lit1}`* | 0.55 | ++---------------------------+----------+ +| *rf\ :math:`{}_{Lit2}`* | 0.5 | ++---------------------------+----------+ +| *rf\ :math:`{}_{Lit3}`* | 0.5 | ++---------------------------+----------+ +| *rf\ :math:`{}_{SOM1}`* | f(txt) | ++---------------------------+----------+ +| *rf\ :math:`{}_{SOM2}`* | 0.55 | ++---------------------------+----------+ +| *rf\ :math:`{}_{SOM3}`* | 0.55 | ++---------------------------+----------+ + +Environmental modifiers on decomposition rate +-------------------------------------------------- + +These base rates are modified on each timestep by functions of the +current soil environment. For the single-level model, there are two rate +modifiers, temperature (*r\ :math:`{}_{tsoil}`*, unitless) and moisture +(*r\ :math:`{}_{water}`*, unitless), both of which are calculated using +the average environmental conditions of the top five model levels (top +29 cm of soil column). For the vertically-resolved model, two additional +environmental modifiers are calculated beyond the temperature and +moisture limitations: an oxygen scalar (*r\ :math:`{}_{oxygen}`*, +unitless), and a depth scalar (*r\ :math:`{}_{depth}`*, unitless). + +The Temperature scalar *r\ :math:`{}_{tsoil}`* is calculated in CLM +using a *Q\ :math:`{}_{10}`* approach, with *Q\ :math:`{}_{10}`\ =1.5:* + +.. math:: + + \label{15.5)} + r_{tsoil} =Q_{10} ^{\left(\frac{T_{soil,\, j} -T_{ref} }{10} \right)} + +where *j* is the soil layer index, *T\ :math:`{}_{soil,j}`* (K) is the +temperature of soil level *j*. The reference temperature +*T\ :math:`{}_{ref}`* = 25C. + +The rate scalar for soil water potential (*r\ :math:`{}_{water}`*, +unitless) is calculated using a relationship from Andrén and Paustian +(1987) and supported by additional data in Orchard and Cook (1983): + +.. math:: + + \label{15.6)} + r_{water} =\sum _{j=1}^{5}\left\{\begin{array}{l} {0\qquad {\rm for\; }\Psi _{j} <\Psi _{\min } } \\ {\frac{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{j} }} \right. \kern-\nulldelimiterspace} \Psi _{j} } \right)}{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{\max } }} \right. \kern-\nulldelimiterspace} \Psi _{\max } } \right)} w_{soil,\, j} \qquad {\rm for\; }\Psi _{\min } \le \Psi _{j} \le \Psi _{\max } } \\ {1\qquad {\rm for\; }\Psi _{j} >\Psi _{\max } \qquad \qquad } \end{array}\right\} + +where :math:`\Psi`\ *:math:`{}_{j}`* is the soil water potential in +layer *j*, :math:`\Psi`\ *:math:`{}_{min}`* is a lower limit for soil +water potential control on decomposition rate (set to -10 MPa). +:math:`\Psi`\ *:math:`{}_{sat,j}`* (MPa) is the saturated soil water +potential, calculated using the multivariate regression model from Cosby +et al. (1984): + +.. math:: + + \label{15.7)} + \Psi _{sat,\, j} =-\left(9.8e-5\right)\exp \left(\left(1.54-0.0095P_{sand,\, j} +0.0063\left(100-P_{sand,\, j} -P_{clay,\, j} \right)\right)\log \left(10\right)\right) + +where *P\ :math:`{}_{sand,j}`* and *P\ :math:`{}_{clay,j}`* are the +volume percentages of sand and clay in soil layer *j*. + +For frozen soils, the bulk of the rapid dropoff in decomposition with +decreasing temperature is due to the moisture limitation, since matric +potential is limited by temperature in the supercooled water formulation +of Niu and Yang (2006), + +.. math:: + + \label{15.8)} + \psi \left(T\right)=-\frac{L_{f} \left(T-T_{f} \right)}{10^{3} T} + +An additional frozen decomposition limitation can be specified using a +‘frozen Q\ :math:`{}_{10}`’ following Koven et al. (2011), however the +default value of this is the same as the unfrozen Q\ :math:`{}_{10}` +value, and therefore the basic hypothesis is that frozen respiration is +limited by liquid water availability, and can be modeled following the +same approach as thawed but dry soils. + +An additional rate scalar, *r\ :math:`{}_{oxygen}`* is enabled when the +CH\ :math:`{}_{4}` submodel is used (set equal to 1 for the single layer +model or when the CH\ :math:`{}_{4}` submodel is disabled). This limits +decomposition when there is insufficient molecular oxygen to satisfy +stoichiometric demand (1 mol O\ :math:`{}_{2}` consumed per mol +CO\ :math:`{}_{2}` produced) from heterotrophic decomposers, and supply +from diffusion through soil layers (unsaturated and saturated) or +aerenchyma (Chapter 19). A minimum value of *r\ :math:`{}_{oxygen}`* is +set at 0.2, with the assumption that oxygen within organic tissues can +supply the necessary stoichiometric demand at this rate. This value lies +between estimates of 0.025–0.1 (Frolking et al. 2001), and 0.35 (Wania +et al. 2009); the large range of these estimates poses a large +unresolved uncertainty. + +Lastly, a possible explicit depth dependence, *r\ :math:`{}_{depth}`*, +(set equal to 1 for the single layer model) can be applied to soil C +decomposition rates to account for processes other than temperature, +moisture, and anoxia that can limit decomposition. This depth dependence +of decomposition was shown by Jenkinson and Coleman (2008) to be an +important term in fitting total C and 14C profiles, and implies that +unresolved processes, such as priming effects, microscale anoxia, soil +mineral surface and/or aggregate stabilization may be important in +controlling the fate of carbon at depth (Koven et al. 2013). CLM +includes these unresolved depth controls via an exponential decrease in +the soil turnover time with depth: + +.. math:: + + \label{15.9)} + r_{depth} =\exp \left(-\frac{z}{z_{\tau } } \right) + +where *z\ :math:`{}_{\tau}`* is the e-folding depth for decomposition, +set by default to 0.5m. + +The combined decomposition rate scalar (*r\ :math:`{}_{total}`*, +unitless) is: + +.. math:: + + \label{15.10)} + r_{total} =r_{tsoil} r_{water} r_{oxygen} r_{depth} . + +N-limitation of Decomposition Fluxes +----------------------------------------- + +Decomposition rates can also be limited by the availability of mineral +nitrogen, but calculation of this limitation depends on first estimating +the potential rates of decomposition, assuming an unlimited mineral +nitrogen supply. The general case is described here first, referring to +a generic decomposition flux from an “upstream†pool (*u*) to a +“downstream†pool (*d*), with an intervening loss due to respiration. +The potential carbon flux out of the upstream pool +(*CF\ :math:`{}_{pot,u}`*, gC m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is: + +.. math:: + + \label{15.11)} + CF_{pot,\, u} =CS_{u} k_{u} + +where *CS\ :math:`{}_{u}`* (gC m\ :math:`{}^{-2}`) is the initial mass +in the upstream pool and *k\ :math:`{}_{u}`* is the decay rate constant +(s:math:`{}^{-1}`) for the upstream pool, adjusted for temperature and +moisture conditions. Depending on the C:N ratios of the upstream and +downstream pools and the amount of carbon lost in the transformation due +to respiration (the respiration fraction), the execution of this +potential carbon flux can generate either a source or a sink of new +mineral nitrogen +(*NF\ :math:`{}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}`*, +gN m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). The governing equation +(Thornton and Rosenbloom, 2005) is: + +.. math:: + + \label{15.12)} + NF_{pot\_ min,\, u\to d} =\frac{CF_{pot,\, u} \left(1-rf_{u} -\frac{CN_{d} }{CN_{u} } \right)}{CN_{d} } + +where *rf\ :math:`{}_{u}`* is the respiration fraction for fluxes +leaving the upstream pool, *CN\ :math:`{}_{u}`* and *CN\ :math:`{}_{d}`* +are the C:N ratios for upstream and downstream pools, respectively. +Negative values of +*NF\ :math:`{}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}`* +indicate that the decomposition flux results in a source of new mineral +nitrogen, while positive values indicate that the potential +decomposition flux results in a sink (demand) for mineral nitrogen. + +Following from the general case, potential carbon fluxes leaving +individual pools in the decomposition cascade, for the example of the +CLM-CN pool structure, are given as: + +.. math:: + + \label{15.13)} + CF_{pot,\, Lit1} ={CS_{Lit1} k_{Lit1} r_{total} \mathord{\left/ {\vphantom {CS_{Lit1} k_{Lit1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.14)} + CF_{pot,\, Lit2} ={CS_{Lit2} k_{Lit2} r_{total} \mathord{\left/ {\vphantom {CS_{Lit2} k_{Lit2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.15)} + CF_{pot,\, Lit3} ={CS_{Lit3} k_{Lit3} r_{total} \mathord{\left/ {\vphantom {CS_{Lit3} k_{Lit3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.16)} + CF_{pot,\, SOM1} ={CS_{SOM1} k_{SOM1} r_{total} \mathord{\left/ {\vphantom {CS_{SOM1} k_{SOM1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.17)} + CF_{pot,\, SOM2} ={CS_{SOM2} k_{SOM2} r_{total} \mathord{\left/ {\vphantom {CS_{SOM2} k_{SOM2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.18)} + CF_{pot,\, SOM3} ={CS_{SOM3} k_{SOM3} r_{total} \mathord{\left/ {\vphantom {CS_{SOM3} k_{SOM3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +.. math:: + + \label{15.19)} + CF_{pot,\, SOM4} ={CS_{SOM4} k_{SOM4} r_{total} \mathord{\left/ {\vphantom {CS_{SOM4} k_{SOM4} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} + +where the factor (1/:math:`\Delta`\ *t*) is included because the rate +constant is calculated for the entire timestep (Eqs. and ), but the +convention is to express all fluxes on a per-second basis. Potential +mineral nitrogen fluxes associated with these decomposition steps are, +again for the example of the CLM-CN pool structure (the CENTURY +structure will be similar but without the different terminal step): + +.. math:: + + \label{ZEqnNum934998} + NF_{pot\_ min,\, Lit1\to SOM1} ={CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right) CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } + +.. math:: + + \label{15.21)} + NF_{pot\_ min,\, Lit2\to SOM2} ={CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } + +.. math:: + + \label{15.22)} + NF_{pot\_ min,\, Lit3\to SOM3} ={CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } + +.. math:: + + \label{15.23)} + NF_{pot\_ min,\, SOM1\to SOM2} ={CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } + +.. math:: + + \label{15.24)} + NF_{pot\_ min,\, SOM2\to SOM3} ={CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } + +.. math:: + + \label{15.25)} + NF_{pot\_ min,\, SOM3\to SOM4} ={CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right) CN_{SOM4} }} \right. \kern-\nulldelimiterspace} CN_{SOM4} } + +.. math:: + + \label{ZEqnNum473594} + NF_{pot\_ min,\, SOM4} =-{CF_{pot,\, SOM4} \mathord{\left/ {\vphantom {CF_{pot,\, SOM4} CN_{SOM4} }} \right. \kern-\nulldelimiterspace} CN_{SOM4} } + +where the special form of Eq. arises because there is no SOM pool +downstream of SOM4 in the converging cascade: all carbon fluxes leaving +that pool are assumed to be in the form of respired CO\ :math:`{}_{2}`, +and all nitrogen fluxes leaving that pool are assumed to be sources of +new mineral nitrogen. + +Steps in the decomposition cascade that result in release of new mineral +nitrogen (mineralization fluxes) are allowed to proceed at their +potential rates, without modification for nitrogen availability. Steps +that result in an uptake of mineral nitrogen (immobilization fluxes) are +subject to rate limitation, depending on the availability of mineral +nitrogen, the total immobilization demand, and the total demand for soil +mineral nitrogen to support new plant growth. The potential mineral +nitrogen fluxes from Eqs. - are evaluated, summing all the positive +fluxes to generate the total potential nitrogen immobilization flux +(*NF\ :math:`{}_{immob\_demand}`*, gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`), and summing absolute values of all the negative +fluxes to generate the total nitrogen mineralization flux +(*NF\ :math:`{}_{gross\_nmin}`*, gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`). Since *NF\ :math:`{}_{griss\_nmin}`* is a source of +new mineral nitrogen to the soil mineral nitrogen pool it is not limited +by the availability of soil mineral nitrogen, and is therefore an actual +as opposed to a potential flux. + +N Competition between plant uptake and soil immobilization fluxes +---------------------------------------------------------------------- + +Once *NF\ :math:`{}_{immob\_demand }`* is known, the competition between +plant and microbial nitrogen demand can be resolved. Mineral nitrogen in +the soil pool (*NS\ :math:`{}_{sminn}`*, gN m\ :math:`{}^{-2}`) at the +beginning of the timestep is considered the available supply. Total +demand for mineral nitrogen from this pool +(*NF\ :math:`{}_{total\_demand}`*, gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) is: + +.. math:: + + \label{15.27)} + NF_{total\_ demand} =NF_{immob\_ demand} +NF_{plant\_ demand\_ soil} + +If *NF\ :math:`{}_{total\_demand}`*\ :math:`\Delta`\ *t* :math:`<` +*NS\ :math:`{}_{sminn}`*, then the available pool is large enough to +meet both plant and microbial demand, and neither plant growth nor +immobilization steps in the decomposition cascade are limited by +nitrogen availability in the timestep. In that case, the signaling +variables *f\ :math:`{}_{plant\_demand}`* and +*f\ :math:`{}_{immob\_demand}`* are both set to 1.0, where +*f\ :math:`{}_{plant\_demand}`* is defined and used in section 15.4, and +*f\ :math:`{}_{immob\_demand}`* is the fraction of potential +immobilization demand that can be met given current supply of mineral +nitrogen. + +If *NF\ :math:`{}_{total\_demand}`*\ :math:`\Delta`\ *t* +:math:`\mathrm{\ge}` *NS\ :math:`{}_{sminn}`*, then there is not enough +mineral nitrogen to meet the combined demands for plant growth and +heterotrophic immobilization, and both of these processes proceed at +lower-than-potential rates, defined by the fractions +*f\ :math:`{}_{plant\_demand}`* and *f\ :math:`{}_{immob\_demand}`*, +where: + +.. math:: + + \label{15.28)} + f_{plant\_ demand} =f_{immob\_ demand} =\frac{NS_{sminn} }{\Delta t\, NF_{total\_ demand} } + +This treatment of competition for nitrogen as a limiting resource is +referred to a demand-based competition, where the fraction of the +available resource that eventually flows to a particular process depends +on the demand from that process in comparison to the total demand from +all processes. Processes expressing a greater demand acquire a larger +fraction of the available resource. + +Final Decomposition Fluxes +------------------------------- + +With *f\ :math:`{}_{immob\_demand}`* known, final decomposition fluxes +can be calculated. Actual carbon fluxes leaving the individual litter +and SOM pools, again for the example of the CLM-CN pool structure (the +CENTURY structure will be similar but, again without the different +terminal step), are calculated as: + +.. math:: + + \label{15.29)} + CF_{Lit1} =\left\{\begin{array}{l} {CF_{pot,\, Lit1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {CF_{pot,\, Lit1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} + +.. math:: + + \label{15.30)} + CF_{Lit2} =\left\{\begin{array}{l} {CF_{pot,\, Lit2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {CF_{pot,\, Lit2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} + +.. math:: + + \label{15.31)} + CF_{Lit3} =\left\{\begin{array}{l} {CF_{pot,\, Lit3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {CF_{pot,\, Lit3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} + +.. math:: + + \label{15.32)} + CF_{SOM1} =\left\{\begin{array}{l} {CF_{pot,\, SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {CF_{pot,\, SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} + +.. math:: + + \label{15.33)} + CF_{SOM2} =\left\{\begin{array}{l} {CF_{pot,\, SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {CF_{pot,\, SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} + +.. math:: + + \label{15.34)} + CF_{SOM3} =\left\{\begin{array}{l} {CF_{pot,\, SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {CF_{pot,\, SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} + +.. math:: + + \label{15.35)} + CF_{SOM4} =CF_{pot,\, SOM4} + +Heterotrophic respiration fluxes (losses of carbon as +CO\ :math:`{}_{2}` to the atmosphere) are: + +.. math:: + + \label{15.36)} + CF_{Lit1,\, HR} =CF_{Lit1} rf_{Lit1} + +.. math:: + + \label{15.37)} + CF_{Lit2,\, HR} =CF_{Lit2} rf_{Lit2} + +.. math:: + + \label{15.38)} + CF_{Lit3,\, HR} =CF_{Lit3} rf_{Lit3} + +.. math:: + + \label{15.39)} + CF_{SOM1,\, HR} =CF_{SOM1} rf_{SOM1} + +.. math:: + + \label{15.40)} + CF_{SOM2,\, HR} =CF_{SOM2} rf_{SOM2} + +.. math:: + + \label{15.41)} + CF_{SOM3,\, HR} =CF_{SOM3} rf_{SOM3} + +.. math:: + + \label{15.42)} + CF_{SOM4,\, HR} =CF_{SOM4} rf_{SOM4} + +Transfers of carbon from upstream to downstream pools in the +decomposition cascade are given as: + +.. math:: + + \label{15.43)} + CF_{Lit1,\, SOM1} =CF_{Lit1} \left(1-rf_{Lit1} \right) + +.. math:: + + \label{15.44)} + CF_{Lit2,\, SOM2} =CF_{Lit2} \left(1-rf_{Lit2} \right) + +.. math:: + + \label{15.45)} + CF_{Lit3,\, SOM3} =CF_{Lit3} \left(1-rf_{Lit3} \right) + +.. math:: + + \label{15.46)} + CF_{SOM1,\, SOM2} =CF_{SOM1} \left(1-rf_{SOM1} \right) + +.. math:: + + \label{15.47)} + CF_{SOM2,\, SOM3} =CF_{SOM2} \left(1-rf_{SOM2} \right) + +.. math:: + + \label{15.48)} + CF_{SOM3,\, SOM4} =CF_{SOM3} \left(1-rf_{SOM3} \right) + +In accounting for the fluxes of nitrogen between pools in the +decomposition cascade and associated fluxes to or from the soil mineral +nitrogen pool, the model first calculates a flux of nitrogen from an +upstream pool to a downstream pool, then calculates a flux either from +the soil mineral nitrogen pool to the downstream pool (immobilization) +or from the downstream pool to the soil mineral nitrogen pool +(mineralization). Transfers of nitrogen from upstream to downstream +pools in the decomposition cascade are given as: + +.. math:: + + \label{15.49)} + NF_{Lit1,\, SOM1} ={CF_{Lit1} \mathord{\left/ {\vphantom {CF_{Lit1} CN_{Lit1} }} \right. \kern-\nulldelimiterspace} CN_{Lit1} } + +.. math:: + + \label{15.50)} + NF_{Lit2,\, SOM2} ={CF_{Lit2} \mathord{\left/ {\vphantom {CF_{Lit2} CN_{Lit2} }} \right. \kern-\nulldelimiterspace} CN_{Lit2} } + +.. math:: + + \label{15.51)} + NF_{Lit3,\, SOM3} ={CF_{Lit3} \mathord{\left/ {\vphantom {CF_{Lit3} CN_{Lit3} }} \right. \kern-\nulldelimiterspace} CN_{Lit3} } + +.. math:: + + \label{15.52)} + NF_{SOM1,\, SOM2} ={CF_{SOM1} \mathord{\left/ {\vphantom {CF_{SOM1} CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } + +.. math:: + + \label{15.53)} + NF_{SOM2,\, SOM3} ={CF_{SOM2} \mathord{\left/ {\vphantom {CF_{SOM2} CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } + +.. math:: + + \label{15.54)} + NF_{SOM3,\, SOM4} ={CF_{SOM3} \mathord{\left/ {\vphantom {CF_{SOM3} CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } + +Corresponding fluxes to or from the soil mineral nitrogen pool depend on +whether the decomposition step is an immobilization flux or a +mineralization flux: + +.. math:: + + \label{15.55)} + NF_{sminn,\, Lit1\to SOM1} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit1\to SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {NF_{pot\_ min,\, Lit1\to SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} + +.. math:: + + \label{15.56)} + NF_{sminn,\, Lit2\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit2\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {NF_{pot\_ min,\, Lit2\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} + +.. math:: + + \label{15.57)} + NF_{sminn,\, Lit3\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit3\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {NF_{pot\_ min,\, Lit3\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} + +.. math:: + + \label{15.58)} + NF_{sminn,SOM1\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM1\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {NF_{pot\_ min,\, SOM1\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} + +.. math:: + + \label{15.59)} + NF_{sminn,SOM2\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM2\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {NF_{pot\_ min,\, SOM2\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} + +.. math:: + + \label{15.60)} + NF_{sminn,SOM3\to SOM4} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM3\to SOM4} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {NF_{pot\_ min,\, SOM3\to SOM4} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} + +.. math:: + + \label{15.61)} + NF_{sminn,\, SOM4} =NF_{pot\_ min,\, SOM4} + +Vertical Distribution and Transport of Decomposing C and N pools +--------------------------------------------------------------------- + +Additional terms are needed to calculate the vertically-resolved soil C +and N budget: the initial vertical distribution of C and N from PFTs +delivered to the litter and CWD pools, and the vertical transport of C +and N pools. + +For initial vertical inputs, CLM uses separate profiles for aboveground +(leaf, stem) and belowground (root) inputs. Aboveground inputs are given +a single exponential with default e-folding depth = 0.1m. Belowground +inputs are distributed according to rooting profiles with default values +based on the Jackson et al. (1996) exponential parameterization. + +Vertical mixing is accomplished by an advection-diffusion equation. The +goal of this is to consider slow, soild- and adsorbed-phase transport +due to bioturbation, cryoturbation, and erosion. Faster aqueous-phase +transport is not included in CLM, but has been developed as part of the +CLM-BeTR suite of parameterizations (Tang and Riley 2013). The default +value of the advection term is 0 cm/yr, such that transport is purely +diffusive. Diffusive transport differs in rate between permafrost soils +(where cryoturbation is the dominant transport term) and non-permafrost +soils (where bioturbation dominates). For permafrost soils, a +parameterization based on that of Koven et al. (2009) is used: the +diffusivity parameter is constant through the active layer, and +decreases linearly from the base of the active layer to zero at a set +depth (default 3m); the default permafrost diffusivity is 5 +cm\ :math:`{}^{2}`/yr. For non-permafrost soils, the default diffusivity +is 1 cm\ :math:`{}^{2}`/yr. + +Model Equilibration +------------------------ + +Because of the coupling between the slowest SOM pools and productivity +through N downregulation of photosynthesis, equilibration of the model +for initialization purposes will take an extremely long time in the +standard mode. This is particularly true for the CENTURY-based +decomposition cascade, which includes a passive pool. In order to +rapidly equilibrate the model, a modified version of the “accelerated +decomposition†(Thornton and Rosenbloom, 2005) is used. The fundamental +idea of this approach is to allow fluxes between the various pools (both +turnover-defined and vertically-defined fluxes) adjust rapidly, while +keeping the pool sizes themselves small so that they can fill quickly. +To do this, the base decomposition rate *k\ :math:`{}_{i}`* for each +pool *i* is accelerated by a term *a\ :math:`{}_{i}`* such that the slow +pools are collapsed onto an approximately annual timescale (Koven et al. +2013). Accelerating the pools beyond this timescale distorts the +seasonal and/or diurnal cycles of decomposition and N mineralization, +thus leading to a substantially different ecosystem productivity than +the full model. For the vertical model, the vertical transport terms are +also accelerated by the same term *a\ :math:`{}_{i}`*, as is the +radioactive decay when :math:`{}^{14}`\ C is enabled, following the same +principle of keeping fluxes between pools (or fluxes lost to decay) +close to the full model while keeping the pools sizes small. When +leaving the accelerated decomposition mode, the concentration of C and N +in pools that had been accelerated are multiplied by the same term +*a\ :math:`{}_{i}`*, to bring the model into approximate equilibrium. +Note that in CLM, the model can also transition into accelerated +decomposition mode from the standard mode (by dividing the pools by +*a\ :math:`{}_{i}`*), and that the transitions into and out of +accelerated decomposition mode are handled automatically by CLM upon +loading from restart files (which preserve information about the mode of +the model when restart files were written). + +The acceleration terms for the two decomposition cascades are shown in +Tables 15.1 and 15.3. + +.. |image| image:: image1 +.. |image| image:: image2 diff --git a/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst b/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst new file mode 100644 index 0000000000..b6dd7a2b1a --- /dev/null +++ b/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst @@ -0,0 +1,397 @@ +.. math:: 1 + +.. math:: 1 + +External Nitrogen Cycle +=========================== + +In addition to the relatively rapid cycling of nitrogen within the plant +– litter – soil organic matter system, CLM also represents several slow +processes which couple the internal nitrogen cycle to external sources +and sinks. Inputs of new mineral nitrogen are from atmospheric +deposition and biological nitrogen fixation. Losses of mineral nitrogen +are due to nitrification, denitrification, leaching, and losses in fire. +While the short-term dynamics of nitrogen limitation depend on the +behavior of the internal nitrogen cycle, establishment of total +ecosystem nitrogen stocks depends on the balance between sources and +sinks in the external nitrogen cycle. + +CLM includes two separate treatments of the slow nitrogen cycle. The +first is the original CLM-CN formulations, which includes a single soil +mineral nitrogen pool to represent both +NO\ :math:`{}_{3}`\ :math:`{}^{-}` and +NH\ :math:`{}_{4}`\ :math:`{}^{+}`, and with nitrogen losses via +denitrification calculated as a constant fraction of mineralization plus +a fixed first-order loss of unutilized mineral nitrogen at the end of +every timestep. The second is based on the Century N-gas model; this +includes separate NH\ :math:`{}_{4}`\ :math:`{}^{+}` and +NO\ :math:`{}_{3}`\ :math:`{}^{-}`\ :math:`{}^{ }`\ pools, as well as +environmentally controlled nitrification and denitrification rates. Both +are described below. + +Atmospheric Nitrogen Deposition +------------------------------------ + +CLM uses a single variable to represent the total deposition of mineral +nitrogen onto the land surface, combining wet and dry deposition of +NO\ :math:`{}_{y}` and NH\ :math:`{}_{x}` as a single flux +(*NF\ :math:`{}_{ndep\_sminn}`*, gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`). This flux is intended to represent total reactive +nitrogen deposited to the land surface which originates from the +following natural and anthropogenic sources (Galloway et al. 2004): +formation of NO\ :math:`{}_{x}` during lightning, +NO\ :math:`{}_{x }`\ and NH\ :math:`{}_{3}` emission from wildfire, +NO\ :math:`{}_{x}` emission from natural soils, NH\ :math:`{}_{3}` +emission from natural soils, vegetation, and wild animals, +NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission during fossil fuel +combustion (both thermal and fuel NO\ :math:`{}_{x}` production), +NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission from other industrial +processes, NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission from fire +associated with deforestation, NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` +emission from agricultural burning, NO\ :math:`{}_{x}` emission from +agricultural soils, NH\ :math:`{}_{3}` emission from agricultural crops, +NH\ :math:`{}_{3}` emission from agricultural animal waste, and +NH\ :math:`{}_{3}` emission from human waste and waste water. The +deposition flux is provided as a spatially and (potentially) temporally +varying dataset (see section 2.2.3 for a description of the default +input dataset). + +In the CLM-CN mineral N pool model, the nitrogen deposition flux is +assumed to enter the soil mineral nitrogen pool +(*NS\ :math:`{}_{sminn}`*) directly; while in the Century-based model, +all of the nitrogen is assumed to enter the +NH\ :math:`{}_{4}`\ :math:`{}^{+}` pool. Real pathways for wet and dry +nitrogen deposition can be more complex than currently represented in +the CLM-CN, including release from melting snowpack and direct foliar +uptake of deposited NO\ :math:`{}_{y}` (e.g. Tye et al. 2005; Vallano +and Sparks, 2007). + +Biological Nitrogen Fixation +--------------------------------- + +The fixation of new reactive nitrogen from atmospheric N\ :math:`{}_{2}` +by soil microorganisms is an important component of both preindustrial +and modern-day nitrogen budgets, but a mechanistic understanding of +global-scale controls on biological nitrogen fixation (BNF) is still +only poorly developed (Cleveland et al. 1999; Galloway et al. 2004). +Cleveland et al. (1999) suggested empirical relationships that predict +BNF as a function of either evapotranspiration rate or net primary +productivity for natural vegetation. CLM assumes that BNF is a function +of net primary production (*CF\ :math:`{}_{ann\_NPP}`*, gC +m\ :math:`{}^{-2}` y\ :math:`{}^{-1}`). The rationale for choosing net +primary production over evapotranspiration as the predictor is that the +two are well-correlated (Parton et al. 1993; Running et al. 1989), and +the use of primary production also introduces a known dependence of BNF +on the carbon supply to nitrogen fixing microorganisms (Cleveland et al. +1999). The expression used is: + +.. math:: + + \label{ZEqnNum802819} + NF_{nfix,sminn} ={1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right)\mathord{\left/ {\vphantom {1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right) \left(86400\cdot 365\right)}} \right. \kern-\nulldelimiterspace} \left(86400\cdot 365\right)} + +where *NF\ :math:`{}_{nfix,sminn}`* (gN m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) is the rate of BNF. Eq. is plotted over a range of +annual NPP in Figure 16.1. + +Figure 16.1. Biological nitrogen fixation as a function of annual net +primary production. + +|image| + +Because of the empirical nature of this NPP-BNF relationship, the +timescale for calculating NPP and thus BNF is unconstrained. Using +annual NPP, as in CLM4.0, introduces an error at high latitudes because +the aseasonal BNF inputs mean that much of the nitrogen is added when +the vegetation is dormant and may be lost before it is ever taken up by +vegetation. Thus an option was added to CLM to allow for an exponential +relaxation (with default e-folding time of 10 days) calculation of NPP, +and BNF calculated from that using equation 16.1. + +As with Atmospheric N deposition, BNF N inputs are added directly to the +mineral N pools. In the CLM-CN N model, this is the single mineral N +pool; in the Century-based model, this is the +NH\ :math:`{}_{4}`\ :math:`{}^{+}` pool. + +Nitrification and Denitrification Losses of Nitrogen +--------------------------------------------------------- + +In order to better understand the structural uncertainty in +biogeochemical responses to climate change, CLM includes two alternate +representations of the mineral N transformations and losses that define +the slow N cycle. Each of these is described below. + +16.3.1 CLM-CN formulation +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Under aerobic conditions in the soil oxygen is the preferred electron +acceptor supporting the metabolism of heterotrophs, but anaerobic +conditions favor the activity of soil heterotrophs which use nitrate as +an electron acceptor (e.g. *Pseudomonas* and *Clostridium*) supporting +respiration. This process, known as denitrification, results in the +transformation of nitrate to gaseous N\ :math:`{}_{2}`, with smaller +associated production of NO\ :math:`{}_{x}` and N\ :math:`{}_{2}`\ O. It +is typically assumed that nitrogen fixation and denitrification were +approximately balanced in the preindustrial biosphere (Galloway et al. +2004). It is likely that denitrification can occur within anaerobic +microsites within an otherwise aerobic soil environment, leading to +large global denitrification fluxes even when fluxes per unit area are +rather low (Galloway et al. 2004). + +Because the vertical distribution of soil organic matter is not resolved +explicitly in CLM-CN, a simple denitrification parameterization is used +that treats denitrification as a constant fraction of gross nitrogen +mineralization. At each step in the decomposition cascade, if the +transformation from an upstream to a downstream pool is predicted to +mineralize (as opposed to immobilize) nitrogen, then a constant fraction +of the nitrogen mineralization flux is assumed to be lost via +denitrification. Due to large uncertainties in the mechanistic +understanding of the environmental controls on denitrification, no +modifications to the denitrification fraction are made for different +soil moisture conditions. This is identified as a high-priority area for +future model development. + +Denitrification fluxes associated with gross mineralization in the +decomposition cascade are calculated as follows: + +.. math:: + + \label{16.2)} + NF_{denit,Lit1\to SOM1} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} >0} \\ {-NF_{pot\_ min,Lit1\to SOM1} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} \le 0} \end{array}\right. + +.. math:: + + \label{16.3)} + NF_{denit,Lit2\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} >0} \\ {-NF_{pot\_ min,Lit2\to SOM2} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} \le 0} \end{array}\right. + +.. math:: + + \label{16.4)} + NF_{denit,Lit3\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} >0} \\ {-NF_{pot\_ min,Lit3\to SOM3} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} \le 0} \end{array}\right. + +.. math:: + + \label{16.5)} + NF_{denit,SOM1\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} >0} \\ {-NF_{pot\_ min,SOM1\to SOM2} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} \le 0} \end{array}\right. + +.. math:: + + \label{16.6)} + NF_{denit,SOM2\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} >0} \\ {-NF_{pot\_ min,SOM2\to SOM3} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} \le 0} \end{array}\right. + +.. math:: + + \label{16.7)} + NF_{denit,SOM3\to SOM4} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} >0} \\ {-NF_{pot\_ min,SOM3\to SOM4} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} \le 0} \end{array}\right. + +.. math:: + + \label{16.8)} + NF_{denit,SOM4} =-NF_{pot\_ min,SOM4} + +where *f\ :math:`{}_{denit}`* = 0.01 is the constant denitrification +fraction of gross mineralization, and the denitrification fluxes are +assumed to be leaving the soil mineral nitrogen pool +(*NS\ :math:`{}_{sminn}`*) and entering the atmosphere. The speciation +of gaseous nitrogen fluxes entering the atmosphere (e.g. +N\ :math:`{}_{2}` vs. NO\ :math:`{}_{x}` or N\ :math:`{}_{2}`\ O) is not +specified. Providing an explicit speciation of these nitrogen losses is +another high-priority area for future model development. + +The model includes one other denitrification pathway, intended to +represent the observed losses of mineral nitrogen in systems +experiencing nitrogen saturation. One reason this mechanism has been +included is in anticipation of an agricultural fertilization flux, +provided either through a prescribed dataset or through a prognostic +agricultural management routine. The model does not currently include an +explicit representation of the fertilization flux, but when it is +introduced, it will be necessary to account for the substantial +denitrification losses associated with high nitrate concentrations in +some heavily fertilized agricultural soils. Nitrogen saturation can also +occur in natural vegetation systems, especially under conditions of high +atmospheric nitrogen deposition, and so this mechanism plays a useful +role even prior to the introduction within the model of agricultural +fertilization. + +For the purpose of this calculation, nitrogen saturation is evaluated on +each timestep, by comparing the total demand for new mineral nitrogen +from plants and immobilization with the available soil mineral nitrogen +pool. The denitrification of excess soil mineral nitrogen is non-zero +whenever the supply of mineral nitrogen exceeds the demand: + +.. math:: + + \label{16.9)} + NF_{sminn,denit} =\left\{\begin{array}{l} {\left(\frac{NS_{sminn} }{\Delta t} \right)-NF_{total\_ demand} f_{dnx} \qquad {\rm for\; }NF_{total\_ demand} \Delta tB_{up} } \end{array} + +where :math:`B_{ag}` (g C m\ :math:`{}^{--2}`) is the aboveground +biomass of combined leaf, stem and aboveground litter (leaf litter and +woody debris) pools; :math:`B_{low}` \ =155 g C m\ :math:`{}^{--2 }`\ is +the lower fuel threshold below which fire does not occur; +:math:`B_{up}` \ = 1050 g C m\ :math:`{}^{--2}` is the upper fuel +threshold above which fire occurrence is not limited by fuel +availability. **** + +Fuel combustibility :math:`f_{m}` is estimated by + +.. math:: + + \label{18.7)} + f_{m} =f_{RH} f_{\theta } f_{T} + +where\ :math:`f_{RH}` , **:math:`f_{\theta }` **, :math:`f_{T}` +represent the dependence of fuel combustibility on relative humidity +*RH* (%), surface soil wetness :math:`\theta` , and surface air +temperature *T* (ºC), respectively.\ :math:`f_{RH}` is calculated by + +.. math:: + + \label{18.8)} + f_{RH} =\left\{\begin{array}{cccc} {1} & {} & {} & {RH\le RH_{low} } \\ {\frac{RH_{up} -RH}{RH_{up} -RH_{low} } ,} & {} & {} & {RH_{low} 0.1` person km\ :math:`{}^{-2}`, we parameterize the +fraction of anthropogenic and natural fires unsuppressed by human +activities as + +.. math:: + + \label{18.10)} + f_{se,o} =f_{d} f_{e} + +where *f\ :math:`{}_{d}`* and *:math:`{}_{ }`\ f\ :math:`{}_{e}`* are +the effects of the demographic and economic conditions on fire +occurrence. The demographic influence on fire occurrence is + +.. math:: + + \label{18.11)} + f_{d} =0.01+0.98\exp (-0.025D_{P} ). + +For shrub and grass PFTs, the economic influence on fire occurrence is +parameterized as a function of Gross Domestic Product GDP (k 1995US$ +capita\ :math:`{}^{-1}`): + +.. math:: + + \label{18.12)} + f_{e} =0.1+0.9\times \exp [-\pi (\frac{GDP}{8} )^{0.5} ] + +which captures 73% of the observed MODIS fire counts with variable GDP +in regions where shrub and grass PFTs are dominant (fractional coverage +of shrub and grass PFTs :math:`>` 50%). In regions outside tropical +closed forests and dominated by trees (fractional coverage of tree PFTs +:math:`>` 50%), we divide the MODIS fire counts into only two bins +(:math:`GDP\ge 20` k 1995US$ capita\ :math:`{}^{-1}`, and :math:`GDP<20` +k 1995US$ capita\ :math:`{}^{-1}`) and parameterize the economic +influence on fire occurrence for tree PFTs as + +.. math:: + + \label{18.13)} + f_{e} =\left\{\begin{array}{cc} {0.39,} & {GDP\ge 20} \\ {1} & {GDP<20} \end{array}\right. + +to reproduce that the MODIS fire counts in tree-dominated regions of +GDP\ :math:`\ge 20` k 1995US$ capita\ :math:`{}^{-1}` is 39% of that in +other **** tree-dominated regions. + +18.1.2 Average spread area of a fire +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Fire fighting capacity depends on socioeconomic conditions and affects +fire spread area. Due to a lack of observations, we consider the +socioeconomic impact on the average burned area rather than separately +on fire spread rate and fire duration: + +.. math:: + + \label{18.14)} + a=a^{*} F_{se} + +where :math:`a^{*}` is the average burned area of a fire without +anthropogenic suppression and :math:`F_{se}` is the socioeconomic +effect on fire spread area. + +Average burned area of a fire without anthropogenic suppression is +assumed elliptical in shape with the wind direction along the major axis +and the point of ignition at one of the foci. According to the area +formula for an ellipse, average burned area of a fire can be represented +as: + +.. math:: + + \label{18.15)} + a^{*} =\pi \frac{l}{2} \frac{w}{2} \times 10^{-6} =\frac{\pi u_{p}^{2} \tau ^{2} }{4L_{B} } (1+\frac{1}{H_{B} } )^{2} \times 10^{-6} + +where :math:`u_{p}` \ (m s\ :math:`{}^{--1}`) is the fire spread rate in +the downwind direction; :math:`\tau` \ (s) is average fire +duration;\ :math:`L_{B}` and :math:`H_{B}` are length-to-breadth ratio +and head-to-back ratio of the ellipse; 10\ :math:`{}^{-6 }`\ converts +m\ :math:`{}^{2}` to km\ :math:`{}^{2}`. + +According to Arora and Boer (2005), + +.. math:: + + \label{ZEqnNum696342} + L_{B} =1.0+10.0[1-\exp (-0.06W)] + +where :math:`W`\ (m s\ :math:`{}^{--1}`) is the wind speed. According to +the mathematical properties of the ellipse, the head-to-back ratio +:math:`H_{B}` is + +.. math:: + + \label{ZEqnNum179757} + H_{B} =\frac{u_{p} }{u_{b} } =\frac{L_{B} +(L_{B} ^{2} -1)^{0.5} }{L_{B} -(L_{B} ^{2} -1)^{0.5} } . + +The fire spread rate in the downwind direction is represented as + +.. math:: + + \label{18.18)} + u_{p} =u_{\max } C_{m} g(W) + + (Arora and Boer, 2005), where :math:`u_{\max }` (m +s\ :math:`{}^{--1}`) is the PFT-dependent average maximum fire spread +rate in natural vegetation regions; :math:`C_{m}` and :math:`g(W)` +represent the dependence of :math:`u_{p}` on fuel wetness and wind +speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.55 m +s\ :math:`{}^{--1 }`\ for grass PFTs, 0.46 m s\ :math:`{}^{--1}` for +shrub PFTs, 0.43 m s\ :math:`{}^{--1}` for\ :math:`{}^{ }`\ needleleaf +tree PFTs, and 0.40 m s\ :math:`{}^{--1}` for other tree PFTs. +:math:`C_{m} =C_{\beta } C_{RH}` is estimated by the dependence of +:math:`u_{p}` \ on root zone soil wetness (:math:`C_{\beta }` ) and +relative humidity (:math:`C_{RH}` ). Here,\ :math:`\beta` is a root +zone soil moisture limitation function. Due to a lack of observations to +calibrate :math:`C_{\beta }` , we adopt a simple linear function, where +:math:`\beta _{low}` \ =0.3 and :math:`\beta _{up}` \ =0.7 are the lower +and upper thresholds of root zone soil wetness, respectively. +**:math:`C_{RH}` ** is set equal to :math:`f_{RH}` . :math:`g(W)` is +derived from the mathematical properties of the ellipse and Eqs and + +.. math:: + + \label{18.19)} + g(W)=\frac{2L_{B} }{1+\frac{1}{H_{B} } } g(0). + +Since g(\ *W*)=1.0, and\ :math:`L_{B}` and :math:`H_{B}` are at their +maxima\ :math:`L_{B} ^{\max } =11.0`\ and :math:`H_{B} ^{\max } =482.0` +when :math:`W\to \infty` , g(0) can be derived as + +.. math:: + + \label{18.20)} + g(0)=\frac{1+\frac{1}{H_{B} ^{\max } } }{2L_{B} ^{\max } } =0.05. + +In the absence of globally gridded data on barriers to fire (e.g. +rivers, lakes, roads, firebreaks) and human fire-fighting efforts, +average fire duration is simply assumed equal to 1 which is the observed +2001–2004 mean persistence of most fires in the world (Giglio et al. +2006). + +As with the socioeconomic influence on fire occurrence, we assume that +the socioeconomic influence on fire spreading is negligible in regions +of\ :math:`D_{p} \le 0.1` person km\ :math:`{}^{-2}`, i.e., +:math:`F_{se} =1.0`. In regions of :math:`D_{p} >0.1` person +km\ :math:`{}^{-2}`, we parameterize such socioeconomic influence as: + +.. math:: + + \label{18.21)} + F_{se} =F_{d} F_{e} + +where *F\ :math:`{}_{d}`* and\ *:math:`{}_{ }`\ F\ :math:`{}_{e}`* are +effects of the demographic and economic conditions on the average spread +area of a fire, and are identified by maximizing the explained +variability of the GFED3 burned area fraction with both socioeconomic +indices in grid cells with various dominant vegetation types. For shrub +and grass PFTs, the demographic impact factor is + +.. math:: + + \label{ZEqnNum900584} + F_{d} =0.2+0.8\times \exp [-\pi (\frac{D_{p} }{450} )^{0.5} ] + +and the economic impact factor is + +.. math:: + + \label{ZEqnNum213480} + F_{e} =0.2+0.8\times \exp (-\pi \frac{GDP}{7} ). + +For tree PFTs outside tropical closed forests, the demographic and +economic impact factors are given as + +.. math:: + + \label{18.24)} + F_{d} =0.4+0.6\times \exp (-\pi \frac{D_{p} }{125} ) + +and + +.. math:: + + \label{ZEqnNum543524} + F_{e} =\left\{\begin{array}{cc} {0.62,} & {GDP>20} \\ {0.83,} & {8`\ *T\ :math:`{}_{f}`* if no agricultural fires occurred +earlier in the year; *f\ :math:`{}_{t}`* is set to 0 otherwise. Peak +month in this dataset correlates with the month after harvesting or the +month before planting. In CLM we use this dataset the same way whether +the CROP option is active or not, without regard to the CROP option’s +simulated planting and harvesting dates. + +In the post-fire region, fire impact is parameterized similar to section +18.1.3 but with combustion completeness factors and tissue mortality +factors for crop PFTs (Table 18.1). + +Deforestation fires +------------------------ + +CLM focuses on deforestation fires in tropical closed forests. Tropical +closed forests are defined as grid cells with tropical tree coverage +:math:`>`\ 60% according to the FAO classification. Deforestation fires +are defined as fires caused by deforestation, including escaped +deforestation fires, termed degradation fires. Deforestation and +degradation fires are assumed to occur outside of cropland areas in +these grid cells. Burned area is controlled by the deforestation rate +and climate: + +.. math:: + + \label{18.34)} + A_{b} =bf_{lu} f_{cli,d} A_{g} + +where *b* (time step)\ :math:`{}^{-1 }`\ is a global constant; +:math:`f_{lu}` (fraction) represents the effect of decreasing +fractional coverage of tree PFTs derived from land use data; and +:math:`f_{cli,d}` (fraction) represents the effect of climate +conditions on the burned area. + +Constants *b* and\ :math:`{}^{ }`\ :math:`{}^{f_{lu} }` are calibrated +based on observations and reanalysis datasets in the Amazon rainforest +(tropical closed forests within 15.5ºS\ :math:`\mathrm{-}`\ 10.5ºN, +30.5ºW\ :math:`\mathrm{-}`\ 91ºW). *b=*\ 0.035 d\ :math:`{}^{-1}` and +:math:`f_{lu}` is defined as + +.. math:: + + \label{18.35)} + f_{lu} =\max (0.0005,0.19D-0.0011) + +where :math:`D`\ (yr:math:`{}^{-1}`) is the annual loss of tree cover +based on CLM4’s land use and land cover change data. + +The effect of climate on deforestation fires is parameterized as: + +.. math:: + + \label{ZEqnNum336915} + \begin{array}{l} {f_{cli,d} =\max [0,\min (1,\frac{b_{2} -P_{60d} }{b_{2} } )]^{0.5} \max [0,\min (1,\frac{b_{3} -P_{10d} }{b_{3} } )]^{0.5} } \\ {\qquad \max [0,\min (1,\frac{0.25-P}{0.25} )]} \end{array} + +where\ :math:`P`\ (mm d\ :math:`{}^{-1}`) is instantaneous +precipitation, while :math:`P_{60d}` (mm d\ :math:`{}^{-1}`) and +:math:`P_{10d}` (mm d\ :math:`{}^{-1}`) are 60-day and 10-day running +means of precipitation, respectively; :math:`b_{2}` (mm +d\ :math:`{}^{-1}`) and :math:`b_{3}` (mm d\ :math:`{}^{-1}`) are the +grid-cell dependent thresholds of :math:`P_{60d}` and :math:`P_{10d}` ; +0.25 mm d\ :math:`{}^{-1}` is the maximum precipitation rate for +drizzle. Le Page et al. (2010) analyzed the relationship between +large-scale deforestation fire counts and precipitation during +2003\ :math:`\mathrm{-}`\ 2006 in southern Amazonia where tropical +evergreen trees (BET Tropical) are dominant. Figure 2 in Le Page et al. +(2010) showed that fires generally occurred if both :math:`P_{60d}` and +:math:`P_{10d}` were less than about 4.0 mm d\ :math:`{}^{-1}`, and +fires occurred more frequently in a drier environment. Based on the +30-yr (1985:math:`\mathrm{-}`\ 2004) precipitation data in Qian et al. +(2006), the climatological precipitation of dry months (P:math:`<`\ 4.0 +mm d\ :math:`{}^{-1}`) in a year over tropical deciduous tree (BDT +Tropical) dominated regions is 46% of that over BET Tropical dominated +regions, so we set the PFT-dependent thresholds of :math:`P_{60d}` and +:math:`P_{10d}` as 4.0 mm d\ :math:`{}^{-1}` for BET Tropical and 1.8 +mm d\ :math:`{}^{-1}` (= 4.0 mm d\ :math:`{}^{-1}` :math:`\times` 46%) +for BDT Tropical, and *b\ :math:`{}_{2}`* and *b\ :math:`{}_{3}`* are +the average of thresholds of BET Tropical and BDT Tropical weighted by +their coverage. + +The post-fire area due to deforestation is not limited to land-type +conversion regions. In the tree-reduced region, the maximum fire carbon +emissions are assumed to be 80% of the total conversion flux. According +to the fraction of conversion flux for tropical trees in the +tree-reduced region (60%) assigned by CLM, to reach the maximum fire +carbon emissions in a conversion region requires burning this region +about twice when we set PFT-dependent combustion completeness factors to +about 0.3 for stem [the mean of 0.2\ :math:`\mathrm{-}`\ 0.4 used in van +der Werf (2010)]. Therefore, when the burned area calculated from Eq. is +no more than twice the tree-reduced area, we assume no escaped fires +outside the land-type conversion region, and the fire-related fraction +of the total conversion flux is estimated as +:math:`\frac{A_{b} /A_{g} }{2D}` . Otherwise, 80% of the total +conversion flux is assumed to be fire carbon emissions, and the biomass +combustion and vegetation mortality outside the tree-reduced regions +with an area fraction of :math:`\frac{A_{b} }{A_{g} } -2D` are set as in +section 18.1.3. + +Peat fires +--------------- + +The burned area due to peat fires is given as *A\ :math:`{}_{b}`*: + +.. math:: + + \label{18.37)} + A_{b} =cf_{cli,p} f_{peat} (1-f_{sat} )A_{g} + +where *c* (time step)\ :math:`{}^{-1}` is a constant; :math:`f_{cli,p}` +represents the effect of climate on the burned area;\ :math:`f_{peat}` +is the fractional coverage of peatland in the grid cell; and +:math:`f_{sat}` is the fraction of the grid cell with a water table at +the surface or higher. *c*\ =1.0\ :math:`\times`\ 10\ :math:`{}^{-3}` +hr\ :math:`{}^{-1 }`\ for tropical peat fires and +*c*\ =4.2\ :math:`\times`\ 10\ :math:`{}^{-5}`\ :math:`{}^{ }`\ hr\ :math:`{}^{-1 }`\ for +boreal peat fires are derived using an inverse +method,\ :math:`{}^{ }`\ by matching simulations from an unreleased +CLM4.5 version driven by Qian et al. (2006) atmospheric forcing and +climatological lightning data to earlier studies: about 2.4 Mha peatland +was burned over Indonesia in 1997 (Page et al. 2002) and the average +burned area of peat fires in Western Canada was 0.2 Mha +yr\ :math:`{}^{-1}` for 1980\ :math:`\mathrm{-}`\ 1999 (Turestky et al. +2004). + +For tropical peat fires, :math:`f_{cli,p}` is set as a function of +long-term precipitation :math:`P_{60d}` : + +.. math:: + + \label{18.38)} + f_{cli,p} =\max [0,\min (1,\frac{4-P_{60d} }{4} )]^{2} . + +For boreal peat fires, :math:`f_{cli,p}` is set to + +.. math:: + + \label{18.39)} + f_{cli,p} =\exp (-\pi \frac{\theta _{17cm} }{0.3} )\cdot \max [0,\min (1,\frac{T_{17cm} -T_{f} }{10} )] + +where :math:`\theta _{17cm}` and :math:`T_{17cm}` are the wetness and +temperature of the top 17 cm of soil; :math:`T_{f}` \ =273.15 K is the +freezing temperature. + +Peat fires lead to peat combustion and the combustion and mortality of +vegetation in peatlands. For tropical peat fires, based on Page et al. +(2002), about 6% of the peat carbon loss from stored carbon is caused by +33.9% of the peatland burned. Carbon emissions due to peat combustion (g +C m\ :math:`{}^{-2}` (time step)\ :math:`{}^{-1}`) are therefore set as +the product of 6%/33.9%, by burned area fraction of peat fire ((time +step)\ :math:`{}^{-1}`), by soil organic carbon (g C +m\ :math:`{}^{-2}`). For boreal peat fires, the carbon emissions due to +peat combustion are set as 2.2 kg C +m\ :math:`{}^{-}`\ :math:`{}^{2 }`\ peat fire area (Turetsky et al. +2002). Biomass combustion and vegetation mortality in post-fire +peatlands are set the same as section 18.1.3 for non-crop PFTs and as +section 18.2 for crops PFTs. + +Table 18.1. PFT-specific combustion completeness and fire mortality +factors. + ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| PFT | *CC*\ :math:`{}_{leaf}` | *CC*\ :math:`{}_{stem}` | *CC*\ :math:`{}_{root}` | *CC*\ :math:`{}_{ts}` | *M*\ :math:`{}_{leaf}` | *M*\ :math:`{}_{livestem}` | *M*\ :math:`{}_{deadstem}` | *M*\ :math:`{}_{root}` | *M*\ :math:`{}_{ts}` | *M*\ :math:`{}_{livestem}` | *:math:`\xi`*\ :math:`{}_{j}` | ++==================================+===========================+===========================+===========================+=========================+==========================+==============================+==============================+==========================+========================+==============================+=================================+ +| NET Temperate | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| NET Boreal | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| NDT Boreal | - | - | - | - | - | - | - | - | - | - | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BET Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BET Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BDT Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BDT Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BDT Boreal | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BES Temperate | - | - | - | - | - | - | - | - | - | - | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BDS Temperate | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| BDS Boreal | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| C\ :math:`{}_{3}` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| C\ :math:`{}_{3}` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| C\ :math:`{}_{4}` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| Crop 1 | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +| Crop 2 | - | - | - | - | - | - | - | - | - | - | - | ++----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + +Leaves (:math:`CC_{{\rm leaf}}` ), stems (:math:`CC_{{\rm stem}}` ), +roots (:math:`CC_{{\rm root}}` ) , and transfer and storage carbon +(:math:`CC_{{\rm ts}}` ); mortality factors for leaves +(:math:`M_{{\rm leaf}}` ), live stems (:math:`M_{{\rm livestem,1}}` ), +dead stems (:math:`M_{{\rm deadstem}}` ), roots +(:math:`M_{{\rm root}}` ), and transfer and storage carbon +(:math:`M_{{\rm ts}}` ) related to the carbon transfers from these pools +to litter pool; mortality factors for live stems +(:math:`M_{{\rm livestem,2}}` ) related to the carbon transfer from live +stems to dead stems; whole-plant mortality factor (:math:`\xi _{j}` ). +Parameters are calibrated in an unreleased CLM4.5 version driven by Qian +et al. (2006) atmospheric forcing and climatological lightning data. diff --git a/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst b/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst new file mode 100644 index 0000000000..980ed65268 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst @@ -0,0 +1,619 @@ +Methane Model +================= + +The representation of processes in the methane biogeochemical model +integrated in CLM [CLM4Me; (Riley et al. 2011a)] is based on several +previously published models (Cao et al. 1996; Petrescu et al. 2010; Tian +et al. 2010; Walter et al. 2001; Wania et al. 2010; Zhang et al. 2002; +Zhuang et al. 2004). Although the model has similarities with these +precursor models, a number of new process representations and +parameterization have been integrated into CLM. + +Mechanistically modeling net surface CH\ :math:`{}_{4}` emissions +requires representing a complex and interacting series of processes. We +first (section 19.1) describe the overall model structure and flow of +information in the CH\ :math:`{}_{4}` model, then describe the methods +used to represent: CH\ :math:`{}_{4}` mass balance; CH\ :math:`{}_{4}` +production; ebullition; aerenchyma transport; CH\ :math:`{}_{4}` +oxidation; reactive transport solution, including boundary conditions, +numerical solution, water table interface, etc.; seasonal inundation +effects; and impact of seasonal inundation on CH\ :math:`{}_{4}` +production. + +Methane Model Structure and Flow +------------------------------------- + +The driver routine for the methane biogeochemistry calculations (ch4, in +ch4Mod.F) controls the initialization of boundary conditions, +inundation, and impact of redox conditions; calls to routines to +calculate CH\ :math:`{}_{4}` production, oxidation, transport through +aerenchyma, ebullition, and the overall mass balance (for unsaturated +and saturated soils and, if desired, lakes); resolves changes to +CH\ :math:`{}_{4}` calculations associated with a changing inundated +fraction; performs a mass balance check; and calculates the average +gridcell CH\ :math:`{}_{4}` production, oxidation, and exchanges with +the atmosphere. + +Governing Mass-Balance Relationship +---------------------------------------- + +The model (Figure 19.1) accounts for CH\ :math:`{}_{4}` production in +the anaerobic fraction of soil (*P*, mol m\ :math:`{}^{-3}` +s\ :math:`{}^{-1}`), ebullition (*E*, mol m\ :math:`{}^{-3}` +s\ :math:`{}^{-1}`), aerenchyma transport (*A*, mol m\ :math:`{}^{-3}` +s\ :math:`{}^{-1}`), aqueous and gaseous diffusion (*F\ :math:`{}_{D}`*, +mol m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), and oxidation (*O*, mol +m\ :math:`{}^{-3}` s\ :math:`{}^{-1}`) via a transient reaction +diffusion equation: + +.. math:: + + \label{ZEqnNum628535} + \frac{\partial \left(RC\right)}{\partial t} =\frac{\partial F_{D} }{\partial z} +P\left(z,t\right)-E\left(z,t\right)-A\left(z,t\right)-O\left(z,t\right) + +Here *z* (m) represents the vertical dimension, *t* (s) is time, and *R* +accounts for gas in both the aqueous and gaseous +phases:\ :math:`R=\varepsilon _{a} +K_{H}^{} \varepsilon _{w}` , with +*:math:`\epsilon`\ :math:`{}_{a}`*, *:math:`\epsilon`\ :math:`{}_{w}`,* +and :math:`K_{H}^{}` (-) the air-filled porosity, water-filled +porosity, and partitioning coefficient for the species of interest, +respectively, and :math:`C` represents CH\ :math:`{}_{4}` or +O\ :math:`{}_{2}` concentration with respect to water volume (mol +m\ :math:`{}^{-3}`). + +An analogous version of equation is concurrently solved for +O\ :math:`{}_{2}`, but with the following differences relative to +CH\ :math:`{}_{4}`: *P* = *E* = 0 (i.e., no production or ebullition), +and the oxidation sink includes the O\ :math:`{}_{2}` demanded by +methanotrophs, heterotroph decomposers, nitrifiers, and autotrophic root +respiration. + +As currently implemented, each gridcell contains an inundated and a +non-inundated fraction. Therefore, equation is solved four times for +each gridcell and time step: in the inundated and non-inundated +fractions, and for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`. If desired, +the CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` mass balance equation is +solved again for lakes (Chapter 9). For non-inundated areas, the water +table interface is defined at the deepest transition from greater than +95% saturated to less than 95% saturated that occurs above frozen soil +layers. The inundated fraction is allowed to change at each time step, +and the total soil CH\ :math:`{}_{4}` quantity is conserved by evolving +CH\ :math:`{}_{4}` to the atmosphere when the inundated fraction +decreases, and averaging a portion of the non-inundated concentration +into the inundated concentration when the inundated fraction increases. + +Figure 19.1. Schematic representation of biological and physical +processes integrated in CLM that affect the net CH\ :math:`{}_{4}` +surface flux (Riley et al. 2011a). (left) Fully inundated portion of a +CLM gridcell and (right) variably saturated portion of a gridcell. + +|image| + +19.3 CH\ :math:`{}_{4}` Production +---------------------------------- + +Because CLM does not currently specifically represent wetland plant +functional types or soil biogeochemical processes, we used +gridcell-averaged decomposition rates as proxies. Thus, the upland +(default) heterotrophic respiration is used to estimate the wetland +decomposition rate after first dividing off the O\ :math:`{}_{2}` +limitation. The O\ :math:`{}_{2}` consumption associated with anaerobic +decomposition is then set to the unlimited version so that it will be +reduced appropriately during O\ :math:`{}_{2}` competition. +CH\ :math:`{}_{4}` production at each soil level in the anaerobic +portion (i.e., below the water table) of the column is related to the +gridcell estimate of heterotrophic respiration from soil and litter +(*R\ :math:`{}_{H}`*; mol C m\ :math:`{}^{-2}` +s\ :math:`{}^{-}`\ :math:`{}^{1}`) corrected for its soil temperature +(*T\ :math:`{}_{s}`*) dependence, soil temperature through a +*Q*\ :math:`{}_{10}` factor (:math:`f_{T}` ), pH (:math:`f_{pH}` ), +redox potential (:math:`f_{pE}` ), and a factor accounting for the +seasonal inundation fraction (*S*, described below): + +.. math:: + + \label{ZEqnNum109798} + P=R_{H} f_{CH_{4} } f_{T} f_{pH} f_{pE} S. + +Here, :math:`f_{CH_{4} }` is the baseline ratio between +CO\ :math:`{}_{2}` and CH\ :math:`{}_{4}` production (all parameters +values are given in Table 19.1). Currently, :math:`f_{CH_{4} }` is +modified to account for our assumptions that methanogens may have a +higher Q\ :math:`{}_{10}` than aerobic decomposers; are not N limited; +and do not have a low-moisture limitation. + +When the single BGC soil level is used in CLM (Chapter 15), the +temperature factor, :math:`f_{T}` , is set to 0 for temperatures equal +to or below freezing, even though CLM allows heterotrophic respiration +below freezing. However, if the vertically resolved BGC soil column is +used, CH\ :math:`{}_{4}` production continues below freezing because +liquid water stress limits decomposition. The base temperature for the +*Q*\ :math:`{}_{10}` factor, *T\ :math:`{}_{B}`*, is 22 +:math:`{}^\circ`\ C and effectively modified the base +:math:`f_{CH_{4} }` value. + +For the single-layer BGC version, *R\ :math:`{}_{H}`* is distributed ** +among soil levels by assuming that 50% is associated with the roots +(using the CLM PFT-specific rooting distribution) and the rest is evenly +divided among the top 0.28 m of soil (to be consistent with CLM’s soil +decomposition algorithm). For the vertically resolved BGC version, the +prognosed distribution of *R\ :math:`{}_{H}`* is used to estimate +CH\ :math:`{}_{4}` production. + +The factor :math:`f_{pH}` is nominally set to 1, although a static +spatial map of *pH* can be used to determine this factor (Dunfield et +al. 1993) by applying: + +.. math:: + + \label{19.3)} + f_{pH} =10^{-0.2235pH^{2} +2.7727pH-8.6} . + +The :math:`f_{pE}` factor assumes that alternative electron acceptors +are reduced with an e-folding time of 30 days after inundation. The +default version of the model applies this factor to horizontal changes +in inundated area but not to vertical changes in the water table depth +in the upland fraction of the gridcell. We consider both :math:`f_{pH}` +and :math:`f_{pE}` to be poorly constrained in the model and identify +these controllers as important areas for model improvement. + +As a non-default option to account for CH\ :math:`{}_{4}` production in +anoxic microsites above the water table, we apply the Arah and Stephen +(1998) estimate of anaerobic fraction: + +.. math:: + + \label{19.4)} + \varphi =\frac{1}{1+\eta C_{O_{2} } } . + +Here, *:math:`\varphi`* is the factor by which production is inhibited +above the water table (compared to production as calculated in equation +, :math:`C_{O_{2} }` (mol m\ :math:`{}^{-3}`) is the bulk soil oxygen +concentration, and *:math:`\eta`* = 400 mol m\ :math:`{}^{-3}`. + +The O\ :math:`{}_{2}` required to facilitate the vertically resolved +heterotrophic decomposition and root respiration is estimated assuming 1 +mol O\ :math:`{}_{2}` is required per mol CO\ :math:`{}_{2}` produced. +The model also calculates the O\ :math:`{}_{2}` required during +nitrification, and the total O\ :math:`{}_{2}` demand is used in the +O\ :math:`{}_{2}` mass balance solution. + +Table 19.1. Parameter descriptions and sensitivity analysis ranges +applied in the methane model. + ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| Mechanism | Parameter | Baseline Value | Range for Sensitivity Analysis | Units | Description | ++==============+============================+==============================================+==================================================================================================+=============================================+============================================================================================+ +| Production | *Q\ :math:`{}_{10}`* | 2 | 1.5 – 4 | - | CH\ :math:`{}_{4}` production Q\ :math:`{}_{10}` | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | :math:`f_{pH}` | 1 | On, off | - | Impact of pH on CH\ :math:`{}_{4}` production | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | :math:`f_{pE}` | 1 | On, off | - | Impact of redox potential on CH\ :math:`{}_{4}` production | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| ** | *S* | Varies | NA | - | Seasonal inundation factor | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | *:math:`\beta`* | 0.2 | NA | - | Effect of anoxia on decomposition rate (used to calculate *S* only) | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | :math:`f_{CH_{4} }` | 0.2 | NA | - | Ratio between CH\ :math:`{}_{4}` and CO\ :math:`{}_{2}` production below the water table | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| Ebullition | *C\ :math:`{}_{e,max}`* | 0.15 | NA | mol m\ :math:`{}^{-3}` | CH\ :math:`{}_{4}` concentration to start ebullition | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| ** | *C\ :math:`{}_{e,min}`* | 0.15 | NA | - | CH\ :math:`{}_{4}` concentration to end ebullition | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| Diffusion | :math:`f_{D_{0} }` \ ** | 1 | 1, 10 | m\ :math:`{}^{2}` s\ :math:`{}^{-1}` | Diffusion coefficient multiplier (Table 19.2) | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| Aerenchyma | *p* | 0.3 | NA | - | Grass aerenchyma porosity | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| ** | *R* | 2.9\ :math:`\times`\ 10\ :math:`{}^{-3}` m | NA | m | Aerenchyma radius | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| ** | *r\ :math:`{}_{L}`* | 3 | NA | - | Root length to depth ratio | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | *F\ :math:`{}_{a}`* | 1 | 0.5 – 1.5 | - | Aerenchyma conductance multiplier | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| Oxidation | :math:`K_{CH_{4} }` | 5 x 10\ :math:`{}^{-3}` | 5\ :math:`\times`\ 10\ :math:`{}^{-4}`\ :math:`{}_{ }`- 5\ :math:`\times`\ 10\ :math:`{}^{-2}` | mol m\ :math:`{}^{-3}` | CH\ :math:`{}_{4}` half-saturation oxidation coefficient (wetlands) | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| ** | :math:`K_{O_{2} }` \ ** | 2 x 10\ :math:`{}^{-2}` | 2\ :math:`\times`\ 10\ :math:`{}^{-3}` - 2\ :math:`\times`\ 10\ :math:`{}^{-1}` | mol m\ :math:`{}^{-3}` | O\ :math:`{}_{2}` half-saturation oxidation coefficient | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +| | :math:`R_{o,\max }` \ ** | 1.25 x 10\ :math:`{}^{-5}` | 1.25\ :math:`\times`\ 10\ :math:`{}^{-6}` - 1.25\ :math:`\times`\ 10\ :math:`{}^{-4}` | mol m\ :math:`{}^{-3}` s\ :math:`{}^{-1}` | Maximum oxidation rate (wetlands) | ++--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + +.. math:: 8 + +.. math:: 17 + +Ebullition +--------------- + +Briefly, the simulated aqueous CH\ :math:`{}_{4}` concentration in each +soil level is used to estimate the expected equilibrium gaseous partial +pressure (:math:`C_{e}` ), as a function of temperature and depth below +the water table, by first estimating the Henry’s law partitioning +coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. +(2010): + +.. math:: + + \label{19.5)} + \log \left(\frac{1}{k_{H} } \right)=\log k_{H}^{s} -\frac{1}{C_{H} } \left(\frac{1}{T} -\frac{1}{T^{s} } \right) + +.. math:: + + \label{ZEqnNum493232} + k_{h}^{C} =Tk_{H} R_{g} + +.. math:: + + \label{19.7)} + C_{e} =\frac{C_{w} R_{g} T}{\theta _{s} k_{H}^{C} p} + +where :math:`C_{H}` \ is a constant, :math:`R_{g}` is the universal +gas constant, :math:`k_{H}^{s}` is Henry’s law partitioning coefficient +at standard temperature (:math:`T^{s}` ),\ :math:`C_{w}` \ is local +aqueous CH\ :math:`{}_{4}` concentration, and *p* is pressure. + +The local pressure is calculated as the sum of the ambient pressure, +water pressure down to the local depth, and pressure from surface +ponding (if applicable). When the CH\ :math:`{}_{4}` partial pressure +exceeds 15% of the local pressure (Baird et al. 2004; Strack et al. +2006; Wania et al. 2010), bubbling occurs to remove CH\ :math:`{}_{4}` +to below this value, modified by the fraction of CH\ :math:`{}_{4}` in +the bubbles [taken as 57%; (Kellner et al. 2006; Wania et al. 2010)]. +Bubbles are immediately added to the surface flux for saturated columns +and are placed immediately above the water table interface in +unsaturated columns. + +Aerenchyma Transport +------------------------- + +Aerenchyma transport is modeled in CLM as gaseous diffusion driven by a +concentration gradient between the specific soil layer and the +atmosphere and, if specified, by vertical advection with the +transpiration stream. There is evidence that pressure driven flow can +also occur, but we did not include that mechanism in the current model. + +The diffusive transport through aerenchyma (*A*, mol m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) from each soil layer is represented in the model as: + +.. math:: + + \label{ZEqnNum158128} + A=\frac{C\left(z\right)-C_{a} }{{\raise0.7ex\hbox{$ r_{L} z $}\!\mathord{\left/ {\vphantom {r_{L} z D}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ D $}} +r_{a} } pT\rho _{r} , + +where *D* is the free-air gas diffusion coefficient (m:math:`{}^{2}` +s\ :math:`{}^{-1}`); *C(z)* (mol m\ :math:`{}^{-3}`) is the gaseous +concentration at depth *z* (m); :math:`r_{L}` is the ratio of root +length to depth; *p* is the porosity (-); *T* is specific aerenchyma +area (m:math:`{}^{2}` m\ :math:`{}^{-2}`); *r\ :math:`{}_{a}`* is the +aerodynamic resistance between the surface and the atmospheric reference +height (s m:math:`{}^{-1}`); and :math:`\rho _{r}` is the rooting +density as a function of depth (-). The gaseous concentration is +calculated with Henry’s law as described in equation . + +Based on the ranges reported in Colmer (2003), we have chosen baseline +aerenchyma porosity values of 0.3 for grass and crop PFTs and 0.1 for +tree and shrub PFTs. The aerenchyma area varies over the course of the +growing season; we parameterize this dependency using the simulated leaf +area index *L* (m:math:`{}^{2}` m\ :math:`{}^{-2}`), as in Wania et al. +(2010): + +.. math:: + + \label{19.9)} + T=\frac{f_{N} N_{a} L}{0.22} \pi R^{2} . + +Here :math:`N_{a}` is annual net primary production (NPP, mol +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`); *R* is the aerenchyma radius +(2.9:math:`\times`\ 10\ :math:`{}^{-3}` m); *f\ :math:`{}_{N}`* is the +belowground fraction of annual NPP; and the 0.22 factor represents the +amount of C per tiller. O\ :math:`{}_{2}` can also diffuse in from the +atmosphere to the soil layer via the reverse of the same pathway, with +the same representation as Equation but with the gas diffusivity of +oxygen. + +CLM also simulates the direct emission of CH\ :math:`{}_{4}` from leaves +to the atmosphere via transpiration of dissolved methane. We calculate +this flux (:math:`F_{CH_{4} -T}` ; mol m\ :math:`{}^{-}`\ :math:`{}^{2}` +s\ :math:`{}^{-1}`) using the simulated soil water methane concentration +(:math:`C_{CH_{4} ,j}` (mol m\ :math:`{}^{-3}`)) in each soil layer *j* +and the CLM predicted transpiration (:math:`F_{T}` ) for each PFT, +assuming that no methane was oxidized inside the plant tissue: + +.. math:: + + \label{19.10)} + F_{CH_{4} -T} =\sum _{j}\rho _{r,j} F_{T} C_{CH_{4} ,j} . + +CH\ :math:`{}_{4}` Oxidation +--------------------------------- + +CLM represents CH\ :math:`{}_{4}` oxidation with double Michaelis-Menten +kinetics (Arah and Stephen 1998; Segers 1998), dependent on both the +gaseous CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` concentrations: + +.. math:: + + \label{19.11)} + R_{oxic} =R_{o,\max } \left[\frac{C_{CH_{4} } }{K_{CH_{4} } +C_{CH_{4} } } \right]\left[\frac{C_{O_{2} } }{K_{O_{2} } +C_{O_{2} } } \right]Q_{10} F_{\vartheta } + +where :math:`K_{CH_{4} }` and :math:`K_{O_{2} }` \ are the half +saturation coefficients (mol m\ :math:`{}^{-3}`) with respect to +CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` concentrations, respectively; +:math:`R_{o,\max }` is the maximum oxidation rate (mol +m\ :math:`{}^{-3}` s\ :math:`{}^{-1}`); and *Q\ :math:`{}_{10}`* +specifies the temperature dependence of the reaction with a base +temperature set to 12 :math:`{}^\circ`\ C. The soil moisture limitation +factor :math:`F_{\vartheta }` is applied above the water table to +represent water stress for methanotrophs. Based on the data in Schnell +and King (1996), we take :math:`F_{\vartheta } =e^{{\raise0.7ex\hbox{` +-P +:math:`}\!\mathord{\left/ {\vphantom {-P P_{c} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{` +P\ :sub:`c` :math:`}} }` , where *P* is the soil moisture potential and +*P\ :math:`{}_{c}`* = -2.4:math:`\times`\ 10\ :math:`{}^{5}` mm. + +Reactive Transport Solution +-------------------------------- + +The solution to equation is solved in several sequential steps: resolve +competition for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` (section +19.7.1); add the ebullition flux into the layer directly above the water +table or into the atmosphere; calculate the overall CH\ :math:`{}_{4}` +or O\ :math:`{}_{2}` source term based on production, aerenchyma +transport, ebullition, and oxidation; establish boundary conditions, +including surface conductance to account for snow, ponding, and +turbulent conductances and bottom flux condition (section 19.7.2); +calculate diffusivity (section 19.7.3); and solve the resulting mass +balance using a tridiagonal solver (section 19.7.5). + +19.7.1 Competition for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For each time step, the unlimited CH\ :math:`{}_{4}` and +O\ :math:`{}_{2}` demands in each model depth interval are computed. If +the total demand over a time step for one of the species exceeds the +amount available in a particular control volume, the demand from each +process associated with the sink is scaled by the fraction required to +ensure non-negative concentrations. Since the methanotrophs are limited +by both CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`, the stricter +limitation is applied to methanotroph oxidation, and then the +limitations are scaled back for the other processes. The competition is +designed so that the sinks must not exceed the available concentration +over the time step, and if any limitation exists, the sinks must sum to +this value. Because the sinks are calculated explicitly while the +transport is semi-implicit, negative concentrations can occur after the +tridiagonal solution. When this condition occurs for O\ :math:`{}_{2}`, +the concentrations are reset to zero; if it occurs for +CH\ :math:`{}_{4}`, the surface flux is adjusted and the concentration +is set to zero if the adjustment is not too large. + +19.7.2 CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` Source Terms +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The overall CH\ :math:`{}_{4}` net source term consists of production, +oxidation at the base of aerenchyma, transport through aerenchyma, +methanotrophic oxidation, and ebullition (either to the control volume +above the water table if unsaturated or directly to the atmosphere if +saturated). For O\ :math:`{}_{2}` below the top control volume, the net +source term consists of O\ :math:`{}_{2}` losses from methanotrophy, SOM +decomposition, and autotrophic respiration, and an O\ :math:`{}_{2}` +source through aerenchyma. + +19.7.3 Aqueous and Gaseous Diffusion +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For gaseous diffusion, we adopted the temperature dependence of +molecular free-air diffusion coefficients (*D\ :math:`{}_{0}`* +(m:math:`{}^{2}` s\ :math:`{}^{-1}`)) as described by Lerman et al. +(1979) and applied by Wania et al. (2010) (Table 19.2). + +Table 19.2. Temperature dependence of aqueous and gaseous diffusion +coefficients for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`. + ++----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ +| D\ :math:`{}_{0}` (m:math:`{}^{2}` s\ :math:`{}^{-1}`) | CH\ :math:`{}_{4}` | O\ :math:`{}_{2}` | ++==========================================================+==========================================================+========================================================+ +| Aqueous | 0.9798 + 0.02986\ *T* + 0.0004381\ *T*\ :math:`{}^{2}` | 1.172+ 0.03443\ *T* + 0.0005048\ *T*\ :math:`{}^{2}` | ++----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ +| Gaseous | 0.1875 + 0.0013\ *T* | 0.1759 + 0.0011\ *T* | ++----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ + +Gaseous diffusivity in soils also depends on the molecular diffusivity, +soil structure, porosity, and organic matter content. Moldrup et al. +(2003), using observations across a range of unsaturated mineral soils, +showed that the relationship between effective diffusivity +(:math:`D_{e}` (m:math:`{}^{2}` s\ :math:`{}^{-1}`)) and soil +properties can be represented as: + +.. math:: + + \label{ZEqnNum730978} + D_{e} =D_{0} \theta _{a}^{2} \left(\frac{\theta _{a} }{\theta _{s} } \right)^{{\raise0.7ex\hbox{$ 3 $}\!\mathord{\left/ {\vphantom {3 b}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ b $}} } , + +where :math:`\theta _{a}` and :math:`\theta _{s}` are the air-filled +and total (saturated water-filled) porosities (-), respectively, and *b* +is the slope of the water retention curve (-). However, Iiyama and +Hasegawa (2005) have shown that the original Millington-Quirk +(Millington and Quirk 1961) relationship matched measurements more +closely in unsaturated peat soils: + +.. math:: + + \label{ZEqnNum437147} + D_{e} =D_{0} \frac{\theta _{a} ^{{\raise0.7ex\hbox{$ 10 $}\!\mathord{\left/ {\vphantom {10 3}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ 3 $}} } }{\theta _{s} ^{2} } + +In CLM, we applied equation for soils with zero organic matter content +and equation for soils with more than 130 kg m\ :math:`{}^{-3}` organic +matter content. A linear interpolation between these two limits is +applied for soils with SOM content below 130 kg m\ :math:`{}^{-3}`. For +aqueous diffusion in the saturated part of the soil column, we applied +(Moldrup et al. 2003): + +.. math:: + + \label{19.14)} + D_{e} =D_{0} \theta _{s} ^{2} . + +To simplify the solution, we assumed that gaseous diffusion dominates +above the water table interface and aqueous diffusion below the water +table interface. Descriptions, baseline values, and dimensions for +parameters specific to the CH\ :math:`{}_{4}` model are given in Table +19.1. For freezing or frozen soils below the water table, diffusion is +limited to the remaining liquid (CLM allows for some freezing point +depression), and the diffusion coefficients are scaled by the +volume-fraction of liquid. For unsaturated soils, Henry’s law +equilibrium is assumed at the interface with the water table. + +19.7.4 Boundary Conditions +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We assume the CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` surface fluxes +can be calculated from an effective conductance and a gaseous +concentration gradient between the atmospheric concentration and either +the gaseous concentration in the first soil layer (unsaturated soils) or +in equilibrium with the water (saturated +soil\ :math:`w\left(C_{1}^{n} -C_{a} \right)` and +:math:`w\left(C_{1}^{n+1} -C_{a} \right)` for the fully explicit and +fully implicit cases, respectively (however, see Tang and Riley (2013) +for a more complete representation of this process). Here, *w* is the +surface boundary layer conductance as calculated in the existing CLM +surface latent heat calculations. If the top layer is not fully +saturated, the :math:`\frac{D_{m1} }{\Delta x_{m1} }` term is replaced +with a series combination: +:math:`\left[\frac{1}{w} +\frac{\Delta x_{1} }{D_{1} } \right]^{-1}` , +and if the top layer is saturated, this term is replaced with +:math:`\left[\frac{K_{H} }{w} +\frac{\frac{1}{2} \Delta x_{1} }{D_{1} } \right]^{-1}` , +where *K\ :math:`{}_{H}`* is the Henry’s law equilibrium constant. + +When snow is present, a resistance is added to account for diffusion +through the snow based on the Millington-Quirk expression (equation ) +and CLM’s prediction of the liquid water, ice, and air fractions of each +snow layer. When the soil is ponded, the diffusivity is assumed to be +that of methane in pure water, and the resistance as the ratio of the +ponding depth to diffusivity. The overall conductance is taken as the +series combination of surface, snow, and ponding resistances. We assume +a zero flux gradient at the bottom of the soil column. + +19.7.5 Crank-Nicholson Solution +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Equation is solved using a Crank-Nicholson solution (Press et al. 1992), +which combines fully explicit and implicit representations of the mass +balance. The fully explicit decomposition of equation can be written as + +.. math:: + + \label{ZEqnNum395184} + \frac{R_{j}^{n+1} C_{j}^{n+1} -R_{j}^{n} C_{j}^{n} }{\Delta t} =\frac{1}{\Delta x_{j} } \left[\frac{D_{p1}^{n} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{n} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+S_{j}^{n} , + +where *j* refers to the cell in the vertically discretized soil column +(increasing downward), *n* refers to the current time step, +*:math:`\Delta`\ t* is the time step (s), *p1* is *j+½*, *m1* is *j-½*, +and :math:`S_{j}^{n}` is the net source at time step *n* and position +*j*, i.e., +:math:`S_{j}^{n} =P\left(j,n\right)-E\left(j,n\right)-A\left(j,n\right)-O\left(j,n\right)`. +The diffusivity coefficients are calculated as harmonic means of values +from the adjacent cells. Equation is solved for gaseous and aqueous +concentrations above and below the water table, respectively. The *R* +term ensure the total mass balance in both phases is properly accounted +for. An analogous relationship can be generated for the fully implicit +case by replacing *n* by *n+1* on the *C* and *S* terms of equation . +Using an average of the fully implicit and fully explicit relationships +gives: + +.. math:: + + \label{ZEqnNum463314} + \begin{array}{l} {-\frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1}^{} } C_{j-1}^{n+1} +\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(\frac{D_{p1}^{} }{\Delta x_{p1}^{} } +\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \right)\right]C_{j}^{n+1} -\frac{1}{2\Delta x_{j} } \frac{D_{p1}^{} }{\Delta x_{p1}^{} } C_{j+1}^{n+1} =} \\ {\frac{R_{j}^{n} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right]} \end{array}, + +Equation is solved with a standard tridiagonal solver, i.e.: + +.. math:: + + \label{19.17)} + aC_{j-1}^{n+1} +bC_{j}^{n+1} +cC_{j+1}^{n+1} =r, + +with coefficients specified in equation . + +Two methane balance checks are performed at each timestep to insure that +the diffusion solution and the time-varying aggregation over inundated +and non-inundated areas strictly conserves methane molecules (except for +production minus consumption) and carbon atoms. + +19.7.6 Interface between water table and unsaturated zone +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +We assume Henry’s Law equilibrium at the interface between the saturated +and unsaturated zone and constant flux from the soil element below the +interface to the center of the soil element above the interface. In this +case, the coefficients are the same as described above, except for the +soil element above the interface: + +.. math:: \frac{D_{p1} }{\Delta x_{p1} } =\left[K_{H} \frac{\Delta x_{j} }{2D_{j} } +\frac{\Delta x_{j+1} }{2D_{j+1} } \right]^{-1} + +.. math:: b=\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(K_{H} \frac{D_{p1}^{} }{\Delta x_{p1} } +\frac{D_{m1}^{} }{\Delta x_{m1} } \right)\right] + +.. math:: + + \label{19.18)} + r=\frac{R_{j}^{n} }{\Delta t} C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -K_{H} C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] + +and the soil element below the interface: + +.. math:: \frac{D_{m1} }{\Delta x_{m1} } =\left[K_{H} \frac{\Delta x_{j-1} }{2D_{j-1} } +\frac{\Delta x_{j} }{2D_{j} } \right]^{-1} + +.. math:: a=-K_{H} \frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1} } + +.. math:: + + \label{19.19)} + r=\frac{R_{j}^{n} }{\Delta t} +C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -K_{H} C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] + +Inundated Fraction Prediction +---------------------------------- + +We developed a simplified dynamic representation of spatial inundation +based on recent work by Prigent et al. (2007), who described a +multi-satellite approach to estimate the global monthly inundated +fraction (*F\ :math:`{}_{i}`*) over an equal area grid +(0.25:math:`\circ`\ :math:`\times`\ 0.25\ :math:`\circ` at the equator) +from 1993 - 2000. They suggested that the IGBP estimate for inundation +could be used as a measure of sensitivity of their detection approach at +low inundation. We therefore used the sum of their satellite-derived +*F\ :math:`{}_{i}`* and the constant IGBP estimate when it was less than +10% to perform a simple inversion for the inundated fraction for methane +production (*f\ :math:`{}_{s}`*). The method optimized three parameters +(*p\ :math:`{}_{1}`*, *p\ :math:`{}_{2}`*, *p\ :math:`{}_{3}`*) for each +grid cell in a simple model based on simulated water table depth +(*z\ :math:`{}_{w}`*) and surface runoff (*Q\ :math:`{}_{r}`* (mm +s\ :math:`{}^{-1}`)): + +.. math:: + + \label{19.20)} + f_{s} =P_{1} e^{{\raise0.7ex\hbox{$ -z_{w} $}\!\mathord{\left/ {\vphantom {-z_{w} p_{2} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ p_{2} $}} } +p_{3} Q_{r} . + +These parameters were evaluated at the +0.5\ **:math:`\boldsymbol{{}^\circ}`** resolution, and aggregated for +coarser simulations. We expect that ongoing work in the hydrology +submodel of CLM will alleviate the need for this crude simplification of +inundated fraction in future model versions. + +Seasonal Inundation +------------------------ + +We have developed a simplified scaling factor to mimic the impact of +seasonal inundation on CH\ :math:`{}_{4}` production (see appendix B in +Riley et al. (2011a) for a discussion of this simplified expression): + +.. math:: + + \label{19.21)} + S=\frac{\beta \left(f-\bar{f}\right)+\bar{f}}{f} ,S\le 1. + +Here, *f* is the instantaneous inundated fraction, :math:`\bar{f}` is +the annual average inundated fraction (evaluated for the previous +calendar year) weighted by heterotrophic respiration, and +*:math:`\beta`* is the anoxia factor that relates the fully anoxic +decomposition rate to the fully oxygen-unlimited decomposition rate, all +other conditions being equal. + +.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst b/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst new file mode 100644 index 0000000000..0e29f00078 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst @@ -0,0 +1,782 @@ + +Surface Characterization and Model Input Requirements +======================================================== + +Surface Characterization +----------------------------- + +Surface Heterogeneity and Data Structure +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Spatial land surface heterogeneity in CLM is represented as a nested +subgrid hierarchy in which grid cells are composed of multiple land +units, snow/soil columns, and PFTs (Figure 2.1). Each grid cell can have +a different number of land units, each land unit can have a different +number of columns, and each column can have multiple PFTs. The first +subgrid level, the land unit, is intended to capture the broadest +spatial patterns of subgrid heterogeneity. The current land units are +glacier, lake, urban, vegetated, and crop (when the crop model option is +turned on). The land unit level can be used to further delineate these +patterns. For example, the urban land unit is divided into density +classes representing the tall building district, high density, and +medium density urban areas. + +The second subgrid level, the column, is intended to capture potential +variability in the soil and snow state variables within a single land +unit. For example, the vegetated land unit could contain several columns +with independently evolving vertical profiles of soil water and +temperature. Similarly, the managed vegetation land unit could be +divided into two columns, irrigated and non-irrigated. The snow/soil +column is represented by fifteen layers for soil and up to five layers +for snow, depending on snow depth. The central characteristic of the +column subgrid level is that this is where the state variables for water +and energy in the soil and snow are defined, as well as the fluxes of +these components within the soil and snow. Regardless of the number and +type of PFTs occupying space on the column, the column physics operates +with a single set of upper boundary fluxes, as well as a single set of +transpiration fluxes from multiple soil levels. These boundary fluxes +are weighted averages over all PFTs. Currently, for glacier, lake, and +vegetated land units, a single column is assigned to each land unit. The +crop land unit is split into irrigated and unirrigated columns with a +single crop occupying each column. The urban land units have five +columns (roof, sunlit walls and shaded walls, and pervious and +impervious canyon floor) (Oleson et al. 2010b). + +Figure 2.1. Configuration of the CLM subgrid hierarchy. + +Note that the Crop land unit is only used when the model is run with the +crop model active. Abbreviations: TBD – Tall Building District; HD – +High Density; MD – Medium Density, G – Glacier, L – Lake, U – Urban, C – +Crop, V – Vegetated, PFT – Plant Functional Type, I – Irrigated, U – +Unirrigated . + +.. image:: image1.png + +The third subgrid level is referred to as the PFT level, but it also +includes the treatment for bare ground. It is intended to capture the +biogeophysical and biogeochemical differences between broad categories +of plants in terms of their functional characteristics. On the vegetated +land unit, up to 16 possible PFTs that differ in physiology and +structure may coexist on a single column. All fluxes to and from the +surface are defined at the PFT level, as are the vegetation state +variables (e.g. vegetation temperature and canopy water storage). On the +crop land unit, several different crop types can be represented on each +crop land unit column (see Chapter 20 for details). + +In addition to state and flux variable data structures for conserved +components at each subgrid level (e.g., energy, water, carbon), each +subgrid level also has a physical state data structure for handling +quantities that are not involved in conservation checks (diagnostic +variables). For example, the urban canopy air temperature and humidity +are defined through physical state variables at the land unit level, the +number of snow layers and the soil roughness lengths are defined as +physical state variables at the column level, and the leaf area index +and the fraction of canopy that is wet are defined as physical state +variables at the PFT level. + +The standard configuration of the model subgrid hierarchy is illustrated +in Figure 2.1. Here, only four PFTs are shown associated with the single +column beneath the vegetated land unit but up to sixteen are possible. +The crop land unit is present only when the crop model is active. + +Note that the biogeophysical processes related to soil and snow require +PFT level properties to be aggregated to the column level. For example, +the net heat flux into the ground is required as a boundary condition +for the solution of snow/soil temperatures (Chapter 6). This column +level property must be determined by aggregating the net heat flux from +all PFTs sharing the column. This is generally accomplished in the model +by computing a weighted sum of the desired quantity over all PFTs whose +weighting depends on the PFT area relative to all PFTs, unless otherwise +noted in the text. + +Vegetation Composition +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Vegetated surfaces are comprised of up to 15 possible plant functional +types (PFTs) plus bare ground (Table 2.1). An additional PFT is +added if the irrigation model is active and six additional PFTs are +added if the crop model is active (Chapter 20). These plant types differ +in leaf and stem optical properties that determine reflection, +transmittance, and absorption of solar radiation (Table 3.1), root +distribution parameters that control the uptake of water from the soil +(Table 8.3), aerodynamic parameters that determine resistance to heat, +moisture, and momentum transfer (Table 5.1), and photosynthetic +parameters that determine stomatal resistance, photosynthesis, and +transpiration (Tables 8.1, 8.2). The composition and abundance of PFTs +within a grid cell can either be prescribed as time-invariant fields +(e.g., using the present day dataset described in section 21.3.3) or can +evolve with time if the model is run in transient landcover mode +(Chapter 21). + +Table 2.1. Plant functional types + ++--------------------------------------------------------------+-------------------+ +| Plant functional type | Acronym | ++==============================================================+===================+ +| Needleleaf evergreen tree – temperate | NET Temperate | ++--------------------------------------------------------------+-------------------+ +| Needleleaf evergreen tree - boreal | NET Boreal | ++--------------------------------------------------------------+-------------------+ +| Needleleaf deciduous tree – boreal | NDT Boreal | ++--------------------------------------------------------------+-------------------+ +| Broadleaf evergreen tree – tropical | BET Tropical | ++--------------------------------------------------------------+-------------------+ +| Broadleaf evergreen tree – temperate | BET Temperate | ++--------------------------------------------------------------+-------------------+ +| Broadleaf deciduous tree – tropical | BDT Tropical | ++--------------------------------------------------------------+-------------------+ +| Broadleaf deciduous tree – temperate | BDT Temperate | ++--------------------------------------------------------------+-------------------+ +| Broadleaf deciduous tree – boreal | BDT Boreal | ++--------------------------------------------------------------+-------------------+ +| Broadleaf evergreen shrub - temperate | BES Temperate | ++--------------------------------------------------------------+-------------------+ +| Broadleaf deciduous shrub – temperate | BDS Temperate | ++--------------------------------------------------------------+-------------------+ +| Broadleaf deciduous shrub – boreal | BDS Boreal | ++--------------------------------------------------------------+-------------------+ +| C\ :math:`{}_{3}` arctic grass | - | ++--------------------------------------------------------------+-------------------+ +| C\ :math:`{}_{3}` grass | - | ++--------------------------------------------------------------+-------------------+ +| C\ :math:`{}_{4}` grass | - | ++--------------------------------------------------------------+-------------------+ +| C\ :math:`{}_{3}` Unmanaged Rainfed Crop | Crop R | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{1}`\ C\ :math:`{}_{3}` Unmanaged Irrigated Crop | Crop I | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Rainfed Corn | Corn R | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Irrigated Corn | Corn I | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Rainfed Temperate Cereals | Temp Cereal R | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Irrigated Temperate Cereals | Temp Cereal I | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{3}`\ Rainfed Winter Cereals | Winter Cereal R | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{3}`\ Irrigated Winter Cereals | Winter Cereal I | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Rainfed Soybean | Soybean R | ++--------------------------------------------------------------+-------------------+ +| :math:`{}^{2}`\ Irrigated Soybean | Soybean I | ++--------------------------------------------------------------+-------------------+ + +:math:`{}^{1}`\ Only used if irrigation is active (Chapter 20). +:math:`{}^{2}`\ Only used if crop model is active (Chapter 20). +:math:`{}^{3}`\ Reserved for future implementations of crop model +(Chapter 20). + +Vegetation Structure +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Vegetation structure is defined by leaf and stem area indices +(:math:`L,\, S`) and canopy top and bottom heights +(:math:`z_{top}` ,\ :math:`z_{bot}` ) (Table 2.2). Separate leaf and +stem area indices and canopy heights are prescribed or calculated for +each PFT. Daily leaf and stem area indices are obtained from gridded +datasets of monthly values (section 2.2.3). Canopy top and bottom +heights are also obtained from gridded datasets. However, these are +currently invariant in space and time and were obtained from +PFT-specific values (Bonan et al. 2002a). When the biogeochemistry model +is active, vegetation state (LAI, SAI, canopy top and bottom heights) +are calculated prognostically (see Chapter 14). + +Table 2.2. Prescribed plant functional type heights + ++-----------------------------------+------------------------+------------------------+ +| Plant functional type | :math:`z_{top}` (m) | :math:`z_{bot}` (m) | ++===================================+========================+========================+ +| NET Temperate | 17 | 8.5 | ++-----------------------------------+------------------------+------------------------+ +| NET Boreal | 17 | 8.5 | ++-----------------------------------+------------------------+------------------------+ +| NDT Boreal | 14 | 7 | ++-----------------------------------+------------------------+------------------------+ +| BET Tropical | 35 | 1 | ++-----------------------------------+------------------------+------------------------+ +| BET temperate | 35 | 1 | ++-----------------------------------+------------------------+------------------------+ +| BDT tropical | 18 | 10 | ++-----------------------------------+------------------------+------------------------+ +| BDT temperate | 20 | 11.5 | ++-----------------------------------+------------------------+------------------------+ +| BDT boreal | 20 | 11.5 | ++-----------------------------------+------------------------+------------------------+ +| BES temperate | 0.5 | 0.1 | ++-----------------------------------+------------------------+------------------------+ +| BDS temperate | 0.5 | 0.1 | ++-----------------------------------+------------------------+------------------------+ +| BDS boreal | 0.5 | 0.1 | ++-----------------------------------+------------------------+------------------------+ +| C\ :math:`{}_{3}` arctic grass | 0.5 | 0.01 | ++-----------------------------------+------------------------+------------------------+ +| C\ :math:`{}_{3}` grass | 0.5 | 0.01 | ++-----------------------------------+------------------------+------------------------+ +| C\ :math:`{}_{4}` grass | 0.5 | 0.01 | ++-----------------------------------+------------------------+------------------------+ +| Crop R | 0.5 | 0.01 | ++-----------------------------------+------------------------+------------------------+ +| Crop I | 0.5 | 0.01 | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Corn R | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Corn I | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Temp Cereal R | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Temp Cereal I | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Winter Cereal R | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Winter Cereal I | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Soybean R | - | - | ++-----------------------------------+------------------------+------------------------+ +| :math:`{}^{1}`\ Soybean I | - | - | ++-----------------------------------+------------------------+------------------------+ + +:math:`{}^{1}`\ Determined by the crop model (Chapter 20) + +Phenology and vegetation burial by snow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When the biogeochemistry model is inactive, leaf and stem area indices +(m:math:`{}^{2}` leaf area m\ :math:`{}^{-2}` ground area) are updated +daily by linearly interpolating between monthly values. Monthly PFT leaf +area index values are developed from the 1-km MODIS-derived monthly grid +cell average leaf area index of Myneni et al. (2002), as described in +Lawrence and Chase (2007). Stem area index is calculated from the +monthly PFT leaf area index using the methods of Zeng et al. (2002). The +leaf and stem area indices are adjusted for vertical burying by snow +(Wang and Zeng 2009) as + +.. math:: + :label: 2.1 + + A=A^{*} ( 1-f_{veg}^{sno} ) + +where :math:`A^{\*}` is the leaf or stem area before adjustment for +snow, :math:`A` is the remaining exposed leaf or stem area, +:math:`f_{veg}^{sno}` is the vertical fraction of vegetation covered by snow + +.. math:: + :label: 2.2 + + {f_{veg}^{sno} = \frac{z_{sno} -z_{bot} }{z_{top} -z_{bot} } \qquad {\rm for\; tree\; and\; shrub}} \\ + {f_{veg}^{sno} = \frac{\min \left(z_{sno} ,\, z_{c} \right)}{z_{c} } \qquad {\rm for\; grass\; and\; crop}} + +where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, +:math:`z_{sno}` is the depth of snow (m) (section 7.2), and +:math:`z_{c} =0.2` is the snow depth when short vegetation is assumed to +be completely buried by snow (m). For numerical reasons, exposed leaf +and stem area are set to zero if less than 0.05. If the sum of exposed +leaf and stem area is zero, then the surface is treated as snow-covered +ground. + +Model Input Requirements +---------------------------- + +Atmospheric Coupling +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The current state of the atmosphere (Table 2.3) at a given time step is +used to force the land model. This atmospheric state is provided by an +atmospheric model in coupled mode or from an observed dataset in offline +mode (Chapter 26). The land model then initiates a full set of +calculations for surface energy, constituent, momentum, and radiative +fluxes. The land model calculations are implemented in two steps. The +land model proceeds with the calculation of surface energy, constituent, +momentum, and radiative fluxes using the snow and soil hydrologic states +from the previous time step. The land model then updates the soil and +snow hydrology calculations based on these fluxes. These fields are +passed to the atmosphere (Table 2.4). The albedos sent to the atmosphere +are for the solar zenith angle at the next time step but with surface +conditions from the current time step. + +Table 2.3. Atmospheric input to land model + ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Field | variable name | units | ++======================================================+================================================+=================================================+ +| :math:`{}^{1}`\ Reference height | :math:`z'_{atm}` | m | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Potential temperature | :math:`\overline{\theta _{atm} }` | K | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Specific humidity at :math:`z_{atm}` | :math:`q_{atm}` | kg kg\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Pressure at :math:`z_{atm}` | :math:`P_{atm}` | Pa | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Temperature at :math:`z_{atm}` | :math:`T_{atm}` | K | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Incident longwave radiation | :math:`L_{atm} \, \downarrow` | W m\ :math:`{}^{-2}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| :math:`{}^{2}`\ Liquid precipitation | :math:`q_{rain}` | mm s\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| :math:`{}^{2}`\ Solid precipitation | :math:`q_{sno}` | mm s\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Incident direct beam visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}^{\mu }` | W m\ :math:`{}^{-2}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Incident direct beam near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}^{\mu }` | W m\ :math:`{}^{-2}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Incident diffuse visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}` | W m\ :math:`{}^{-2}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :math:`{}^{-2}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| Carbon dioxide (CO:math:`{}_{2}`) concentration | :math:`c_{a}` | ppmv | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| :math:`{}^{3}`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| :math:`{}^{4}`\ Nitrogen deposition rate | :math:`NF_{ndep\_ s{\it min}n}` | g (N) m\ :math:`{}^{-2}` yr\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +| :math:`{}^{5}`\ Lightning frequency | :math:`I_{l}` | flash km\ :math:`{}^{-2}` hr\ :math:`{}^{-1}` | ++------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + +:math:`{}^{1}`\ The atmospheric reference height received from the +atmospheric model :math:`z'_{atm}` is assumed to be the height above +the surface as defined by the roughness length :math:`z_{0}` plus +displacement height :math:`d`. Thus, the reference height used for flux +computations (Chapter 5) is :math:`z_{atm} =z'_{atm} +z_{0} +d`. The +reference heights for temperature, wind, and specific humidity +(:math:`z_{atm,\, h}` , :math:`z_{atm,\, {\it m}}` , +:math:`z_{atm,\, w}` ) are required. These are set equal +to\ :math:`z_{atm}` . + +:math:`{}^{2}`\ The placeCAM provides convective and large-scale liquid +and solid precipitation, which are added to yield total liquid +precipitation :math:`q_{rain}` and solid precipitation +:math:`q_{sno}` . + +:math:`{}^{3}`\ There are 14 aerosol deposition rates required depending +on species and affinity for bonding with water; 8 of these are dust +deposition rates (dry and wet rates for 4 dust size bins, +:math:`D_{dst,\, dry1} ,\, D_{dst,\, dry2} ,\, D_{dst,\, dry3} ,\, D_{dst,\, dry4}` , +:math:`D_{dst,\, \, wet1} ,D_{dst,\, wet2} ,\, D_{dst,wet3} ,\, D_{dst,\, wet4}` ), +3 are black carbon deposition rates (dry and wet hydrophilic and dry +hydrophobic rates, +:math:`D_{bc,\, dryhphil} ,\, D_{bc,\, wethphil} ,\, D_{bc,\, dryhphob}` ), +and 3 are organic carbon deposition rates (dry and wet hydrophilic and +dry hydrophobic rates, +:math:`D_{oc,\, dryhphil} ,\, D_{oc,\, wethphil} ,\, D_{oc,\, dryhphob}` ). +These fluxes are computed interactively by the atmospheric model (when +prognostic aerosol representation is active) or are prescribed from a +time-varying (annual cycle or transient), globally-gridded deposition +file defined in the namelist (see the CLM4.5 User’s Guide). Aerosol +deposition rates were calculated in a transient 1850-2009 CAM simulation +(at a resolution of 1.9x2.5x26L) with interactive chemistry (troposphere +and stratosphere) driven by CCSM3 20\ :math:`{}^{th}` century +sea-surface temperatures and emissions (Lamarque et al. 2010) for +short-lived gases and aerosols; observed concentrations were specified +for methane, N\ :math:`{}_{2}`\ O, the ozone-depleting substances (CFCs) +,and CO\ :math:`{}_{2}`. The fluxes are used by the snow-related +parameterizations (Chapters 3 and 7). + +:math:`{}^{4}`\ The nitrogen deposition rate is required by the +biogeochemistry model when active and represents the total deposition of +mineral nitrogen onto the land surface, combining deposition of +NO\ :math:`{}_{y}` and NH\ :math:`{}_{x}`. The rate is supplied either +as a time-invariant spatially-varying annual mean rate or time-varying +for a transient simulation. Nitrogen deposition rates were calculated +from the same CAM chemistry simulation that generated the aerosol +deposition rates. + +:math:`{}^{5}`\ Climatological 3-hourly lightning frequency at +:math:`\sim`\ 1.8\ :math:`{}^{o}` resolution is provided, which was +calculated via bilinear interpolation from 1995-2011 NASA LIS/OTD grid +product v2.2 (http://ghrc.msfc.nasa.gov) 2-hourly, 2.5\ :math:`{}^{o}` +lightning frequency data. In future versions of the model, lightning +data may be obtained directly from the atmosphere model. + +Density of air (:math:`\rho _{atm}` ) (kg m\ :math:`{}^{-3}`) is also +required but is calculated directly from +:math:`\rho _{atm} =\frac{P_{atm} -0.378e_{atm} }{R_{da} T_{atm} }` +where :math:`P_{atm}` is atmospheric pressure (Pa), :math:`e_{atm}` is +atmospheric vapor pressure (Pa), :math:`R_{da}` is the gas constant for +dry air (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), and +:math:`T_{atm}` is the atmospheric temperature (K). The atmospheric +vapor pressure :math:`e_{atm}` is derived from atmospheric specific +humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`) as +:math:`e_{atm} =\frac{q_{atm} P_{atm} }{0.622+0.378q_{atm} }` . + +The O\ :math:`{}_{2}` partial pressure (Pa) is required but is +calculated from molar ratio and the atmospheric pressure +:math:`P_{atm}` as :math:`o_{i} =0.209P_{atm}` . + +Table 2.4. Land model output to atmospheric model + ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Field | Variable name | units | ++=======================================+================================================+==============================================================+ +| :math:`{}^{1}`\ Latent heat flux | :math:`\lambda _{vap} E_{v} +\lambda E_{g}` | W m\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Sensible heat flux | :math:`H_{v} +H_{g}` | W m\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Water vapor flux | :math:`E_{v} +E_{g}` | mm s\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Zonal momentum flux | :math:`\tau _{x}` | kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Meridional momentum flux | :math:`\tau _{y}` | kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Emitted longwave radiation | :math:`L\, \uparrow` | W m\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Direct beam visible albedo | :math:`I\, \uparrow _{vis}^{\mu }` | - | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Direct beam near-infrared albedo | :math:`I\, \uparrow _{nir}^{\mu }` | - | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Diffuse visible albedo | :math:`I\, \uparrow _{vis}` | - | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Diffuse near-infrared albedo | :math:`I\, \uparrow _{nir}` | - | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Absorbed solar radiation | :math:`\vec{S}` | W m\ :math:`{}^{-2}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Radiative temperature | :math:`T_{rad}` | K | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Temperature at 2 meter height | :math:`T_{2m}` | K | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Snow water equivalent | :math:`W_{sno}` | m | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Aerodynamic resistance | :math:`r_{am}` | s m\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Friction velocity | :math:`u_{*}` | m s\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| :math:`{}^{2}`\ Dust flux | :math:`F_{j}` | kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +| Net ecosystem exchange | NEE | kgCO\ :math:`{}_{2}` m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | ++---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + +:math:`{}^{1}`\ :math:`\lambda _{vap}` is the latent heat of +vaporization (J kg\ :math:`{}^{-1}`) (Table 2.6) and :math:`\lambda` is +either the latent heat of vaporization :math:`\lambda _{vap}` or latent +heat of sublimation :math:`\lambda _{sub}` (J kg\ :math:`{}^{-1}`) +(Table 2.6) depending on the liquid water and ice content of the top +snow/soil layer (section 5.4). + +:math:`{}^{2}`\ There are :math:`j=1,\ldots ,4` dust transport bins. + +Initialization +^^^^^^^^^^^^^^^^^^^^ + +Initialization of the land model (i.e., providing the model with initial +temperature and moisture states) depends on the type of run (startup or +restart) (see the CLM4.5 User’s Guide). A startup run starts the model +from either initial conditions that are set internally in the Fortran +code (referred to as arbitrary initial conditions) or from an initial +conditions dataset that enables the model to start from a spun up state +(i.e., where the land is in equilibrium with the simulated climate). In +restart runs, the model is continued from a previous simulation and +initialized from a restart file that ensures that the output is +bit-for-bit the same as if the previous simulation had not stopped. The +fields that are required from the restart or initial conditions files +can be obtained by examining the code. Arbitrary initial conditions are +specified as follows. + +Vegetated and glacier land units have fifteen vertical layers, while +lakes have ten. For soil points, temperature calculations are done over +all layers, :math:`N_{levgrnd} =15`, while hydrology calculations are +done over the top ten layers, :math:`N_{levsoi} =10`, the bottom five +layers being specified as bedrock. Soil points are initialized with +surface ground temperature :math:`T_{g}` and soil layer temperature +:math:`T_{i}` , for :math:`i=1,\ldots ,N_{levgrnd}` , of 274 K, +vegetation temperature :math:`T_{v}` of 283 K, no snow or canopy water +(:math:`W_{sno} =0`, :math:`W_{can} =0`), and volumetric soil water +content :math:`\theta _{i} =0.15` mm\ :math:`{}^{3}` mm\ :math:`{}^{-3}` +for layers :math:`i=1,\ldots ,N_{levsoi}` and :math:`\theta _{i} =0.0` +mm\ :math:`{}^{3}` mm\ :math:`{}^{-3}` for layers +:math:`i=N_{levsoi} +1,\ldots ,N_{levgrnd}` . placeLake temperatures +(:math:`T_{g}` and :math:`T_{i}` ) are initialized at 277 K and +:math:`W_{sno} =0`. + +Glacier temperatures (:math:`T_{g} =T_{snl+1}` and :math:`T_{i}` for +:math:`i=snl+1,\ldots ,N_{levgrnd}` where :math:`snl` is the negative +of the number of snow layers, i.e., :math:`snl` ranges from –5 to 0) are +initialized to 250 K with a snow water equivalent :math:`W_{sno} =1000` +mm, snow depth :math:`z_{sno} =\frac{W_{sno} }{\rho _{sno} }` (m) where +:math:`\rho _{sno} =250` kg m\ :math:`{}^{-3}` is an initial estimate +for the bulk density of snow, and :math:`\theta _{i}` \ =1.0 for +:math:`i=1,\ldots ,N_{levgrnd}` . The snow layer structure (e.g., number +of snow layers :math:`snl` and layer thickness) is initialized based on +the snow depth (section 6.1). The snow liquid water and ice contents (kg +m\ :math:`{}^{-2}`) are initialized as :math:`w_{liq,\, i} =0` and +:math:`w_{ice,\, i} =\Delta z_{i} \rho _{sno}` , respectively, where +:math:`i=snl+1,\ldots ,0` are the snow layers, and :math:`\Delta z_{i}` +is the thickness of snow layer :math:`i` (m). The soil liquid water and +ice contents are initialized as :math:`w_{liq,\, i} =0` and +:math:`w_{ice,\, i} =\Delta z_{i} \rho _{ice} \theta _{i}` for +:math:`T_{i} \le T_{f}` , and +:math:`w_{liq,\, i} =\Delta z_{i} \rho _{liq} \theta _{i}` and +:math:`w_{ice,\, i} =0` for :math:`T_{i} >T_{f}` , where +:math:`\rho _{ice}` and :math:`\rho _{liq}` are the densities of ice +and liquid water (kg m\ :math:`{}^{-3}`) (Table 2.6), and :math:`T_{f}` +is the freezing temperature of water (K) (Table 2.6). All vegetated and +glacier land units are initialized with water stored in the unconfined +aquifer and unsaturated soil :math:`W_{a} =4000` mm and water table +depth :math:`z_{\nabla }` at five meters below the soil column. + +Surface Data +^^^^^^^^^^^^^^^^^^ + +Required surface data for each land grid cell are listed in Table 2.5 +and include the glacier, lake, and urban fractions of the grid cell +(vegetated and crop occupy the remainder), the fractional cover of each +plant functional type (PFT), monthly leaf and stem area index and canopy +top and bottom heights for each PFT, soil color, soil texture, soil +organic matter density, maximum fractional saturated area, slope, +elevation, biogenic volatile organic compounds (BVOCs) emissions +factors, population density, gross domestic production, peat area +fraction, and peak month of agricultural burning. Optional surface data +include crop irrigation and managed crops. All fields are aggregated to +the model’s grid from high-resolution input datasets (Table 2.5) that +are obtained from a variety of sources described below. + +Table 2.5. Surface data required for CLM and their base spatial +resolution + ++--------------------------------------------+---------------------------+ +| Surface Field | Resolution | ++============================================+===========================+ +| Percent glacier | 0.05\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Percent lake and lake depth | 0.05\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Percent urban | 0.05\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Percent plant functional types (PFTs) | 0.05\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Monthly leaf and stem area index | 0.5\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Canopy height (top, bottom) | 0.5\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Soil color | 0.5\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Percent sand, percent clay | 0.083\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Soil organic matter density | 0.083\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Maximum fractional saturated area | 0.125\ :math:`\circ` | ++--------------------------------------------+---------------------------+ +| Elevation | 1km | ++--------------------------------------------+---------------------------+ +| Slope | 1km | ++--------------------------------------------+---------------------------+ +| Biogenic Volatile Organic Compounds | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Crop Irrigation | 0.083\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Managed crops | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Population density | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Gross domestic production | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Peat area fraction | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ +| Peak month of agricultural waste burning | 0.5\ :math:`{}^\circ` | ++--------------------------------------------+---------------------------+ + +At the base spatial resolution of 0.05\ :math:`\circ`, the percentage of +each PFT is defined with respect to the vegetated portion of the grid +cell and the sum of the PFTs is 100%. The percent lake, wetland, +glacier, and urban at their base resolution are specified with respect +to the entire grid cell. The surface dataset creation routines re-adjust +the PFT percentages to ensure that the sum of all land cover types in +the grid cell sum to 100%. A minimum threshold of 0.1% of the grid cell +by area is required for urban areas. + +The percentage glacier mask was derived from vector data of global +glacier and ice sheet spatial coverage. Vector data for glaciers (ice +caps, icefields and mountain glaciers) were taken from the first +globally complete glacier inventory, the Randolph Glacier Inventory +version 1.0 (RGIv1.0: Arendt et al. 2012). Vector data for the Greenland +Ice Sheet were provided by Frank Paul and Tobias Bolch (University of +Zurich: Rastner et al. 2012). Antarctic Ice Sheet data were provided by +Andrew Bliss (University of Alaska) and were extracted from the +Scientific Committee on Antarctic Research (SCAR) Antarctic Digital +Database version 5.0. Floating ice is only provided for the Antarctic +and does not include the small area of Arctic ice shelves. High spatial +resolution vector data were then processed to determine the area of +glacier, ice sheet and floating ice within 30-second grid cells +globally. The 30-second glacier, ice sheet and Antarctic ice shelf masks +were subsequently draped over equivalent-resolution GLOBE topography +(Global Land One-km Base Elevation Project, Hastings et al. 1999) to +extract approximate ice-covered elevations of ice-covered regions. Grid +cells flagged as land-ice in the mask but ocean in GLOBE (typically, +around ice sheets at high latitudes) were designated land-ice with an +elevation of 0 meters. Finally, the high-resolution mask/topography +datasets were aggregated and processed into three 3-minute datasets: +3-minute fractional areal land ice coverage (including both glaciers and +ice sheets); 3-minute distributions of areal glacier fractional coverage +by elevation and areal ice sheet fractional coverage by elevation. Ice +fractions were binned at 100 meter intervals, with bin edges defined +from 0 to 6000 meters (plus one top bin encompassing all remaining +high-elevation ice, primarily in the Himalaya). These distributions by +elevation are needed when running CLM4 with multiple glacier elevation +classes. + +Percent lake and lake depth are area-averaged from the 90-second +resolution data of Kourzeneva (2009, 2010) to the 0.05\ :math:`{}^\circ` +resolution using the MODIS land-mask. Percent urban is derived from +LandScan 2004, a population density dataset derived from census data, +nighttime lights satellite observations, road proximity and slope +(Dobson et al. 2000) as described by Jackson et al. (2010) at 1km +resolution and aggregated to 0.05\ :math:`{}^\circ`. A number of urban +radiative, thermal, and morphological fields are also required and are +obtained from Jackson et al. (2010). Their description can be found in +Table 3 of the Community Land Model Urban (CLMU) technical note (Oleson +et al. 2010b). + +Percent PFTs are derived from MODIS satellite data as described in +Lawrence and Chase (2007) (section 21.3.3). Prescribed PFT leaf area +index is derived from the MODIS satellite data of Myneni et al. (2002) +using the de-aggregation methods described in Lawrence and Chase (2007) +(section 2.2.3). Prescribed PFT stem area index is derived from PFT leaf +area index phenology combined with the methods of Zeng et al. (2002). +Prescribed canopy top and bottom heights are from Bonan (1996) as +described in Bonan et al. (2002b). If the biogeochemistry model is +active, it supplies the leaf and stem area index and canopy top and +bottom heights dynamically, and the prescribed values are ignored. + +Soil color determines dry and saturated soil albedo (section 3.2). Soil +colors are from Lawrence and Chase (2007) (section 3.2). + +The soil texture and organic matter content determine soil thermal and +hydrologic properties (sections 6.3 and 7.4.1). The International +Geosphere-Biosphere Programme (IGBP) soil dataset (Global Soil Data Task +2000) of 4931 soil mapping units and their sand and clay content for +each soil layer were used to create a mineral soil texture dataset +(Bonan et al. 2002b). Soil organic matter data is merged from two +sources. The majority of the globe is from ISRIC-WISE (Batjes, 2006). +The high latitudes come from the 0.25\ :math:`{}^\circ` version of the +Northern Circumpolar Soil Carbon Database (Hugelius et al. 2012). Both +datasets report carbon down to 1m depth. Carbon is partitioned across +the top seven CLM4 layers (:math:`\sim`\ 1m depth) as in Lawrence and +Slater (2008). + +The maximum fractional saturated area (:math:`f_{\max }` ) is used in +determining surface runoff and infiltration (section 7.3). Maximum +fractional saturated area at 0.125\ :math:`{}^{o}` resolution is +calculated from 1-km compound topographic indices (CTIs) based on the +USGS HYDRO1K dataset (Verdin and Greenlee 1996) following the algorithm +in Niu et al. (2005). :math:`f_{\max }` is the ratio between the number +of 1-km pixels with CTIs equal to or larger than the mean CTI and the +total number of pixels in a 0.125\ :math:`{}^\circ` grid cell. See +section 7.3.1 and Li et al. (2013b) for further details. Slope and +elevation are also obtained from the USGS HYDRO1K 1-km dataset (Verdin +and Greenlee 1996). Slope is used in the River Transport Model (Chapter +11) and in the surface water parameterization (section 7.3.2), and +elevation is used to calculate the grid cell standard deviation of +topography for the snow cover fraction parameterization (section 7.2.1). + +Biogenic Volatile Organic Compounds emissions factors are from the Model +of Emissions of Gases and Aerosols from Nature version 2.1 (MEGAN2.1; +Guenther et al. 2012). + +The default list of PFTs includes an unmanaged crop treated as a second +C3 grass (Table 2.1). The unmanaged crop has grid cell fractional cover +assigned from MODIS satellite data (Lawrence and Chase 2007). A managed +crop option uses grid cell fractional cover from the present-day crop +dataset of Ramankutty and Foley (1998) (CLM4CNcrop). Managed crops are +assigned in the proportions given by Ramankutty and Foley (1998) without +exceeding the area previously assigned to the unmanaged crop. The +unmanaged crop continues to occupy any of its original area that remains +and continues to be handled just by the CN part of CLM4CNcrop. The +managed crop types (corn, soybean, and temperate cereals) were chosen +based on the availability of corresponding algorithms in AgroIBIS +(Kucharik et al. 2000; Kucharik and Brye 2003). Temperate cereals +include wheat, barley, and rye here. All temperate cereals are treated +as summer crops (like spring wheat, for example) at this time. Winter +cereals (such as winter wheat) may be introduced in a future version of +the model. + +To allow crops to coexist with natural vegetation in a grid cell and be +treated by separate models (i.e., CLM4.5BGCcrop versus the Dynamic +Vegetation version (CLM4.5BGCDV)), we separate the vegetated land unit +into a naturally vegetated land unit and a human managed land unit. PFTs +in the naturally vegetated land unit share one soil column and compete +for water (default CLM setting). PFTs in the human managed land unit do +not share soil columns and thus permit for differences in land +management between crops. + +CLM includes the option to irrigate cropland areas that are equipped for +irrigation. The application of irrigation responds dynamically to +climate (see Chapter 20). In CLM, irrigation is implemented for the C3 +generic crop only. When irrigation is enabled, the cropland area of each +grid cell is divided into an irrigated and unirrigated fraction +according to a dataset of areas equipped for irrigation (Siebert et al. +2005). The area of irrigated cropland in each grid cell is given by the +smaller of the grid cell’s total cropland area, according to the default +CLM4 dataset, and the grid cell’s area equipped for irrigation. The +remainder of the grid cell’s cropland area (if any) is then assigned to +unirrigated cropland. Irrigated and unirrigated crops are placed on +separate soil columns, so that irrigation is only applied to the soil +beneath irrigated crops. + +Several input datasets are required for the fire model (Li et al. 2013a) +including population density, gross domestic production, peat area +fraction, and peak month of agricultural waste burning. Population +density at 0.5\ :math:`{}^{o}` resolution for 1850-2100 combines 5-min +resolution decadal population density data for 1850–1980 from the +Database of the Global Environment version 3.1 (HYDEv3.1) with +0.5\ :math:`{}^{o}` resolution population density data for 1990, 1995, +2000, and 2005 from the Gridded Population of the World version 3 +dataset (GPWv3) (CIESIN, 2005). Gross Domestic Production (GDP) per +capita in 2000 at 0.5\ :math:`{}^{o}` is from Van Vuuren et al. (2006), +which is the base-year GDP data for IPCC-SRES and derived from +country-level World Bank’s World Development Indicators (WDI) measured +in constant 1995 US$ (World Bank, 2004) and the UN Statistics Database +(UNSTAT, 2005). The peatland area fraction at 0.5\ :math:`{}^{o}` +resolution is derived from three vector datasets: peatland data in +Indonesia and Malaysian Borneo (Olson et al. 2001); peatland data in +Canada (Tarnocai et al. 2011); and bog, fen and mire data in boreal +regions (north of 45\ :math:`{}^{o}`\ N) outside Canada provided by the +Global Lakes and Wetlands Database (GLWD) (Lehner and Döll, 2004). The +climatological peak month for agricultural waste burning is from van der +Werf et al. (2010). + +Adjustable Parameters and Physical Constants +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Values of certain adjustable parameters inherent in the biogeophysical +or biogeochemical parameterizations have either been obtained from the +literature or calibrated based on comparisons with observations. These +are described in the text. Physical constants, generally shared by all +of the components in the coupled modeling system, are presented in Table +2.6. + +.. csv-table:: Table 2.6. Physical constants + :header: "description", "name", "value", "units" + :widths: 40, 20, 20, 20 + + "Pi", :math:`\pi`, 3.14159265358979323846, "\-" + "Acceleration of gravity", :math:`g`, 9.80616, m s\ :math:`{}^{-2}` + "Standard pressure", :math:`P_{std}`, 101325, "Pa" + "Stefan-Boltzmann constant", :math:`\sigma`, 5.67 :math:`\times 10^{-8}`, W m :math:`{}^{-2}` K :math:`{}^{-4}` + "Boltzmann constant", :math:`\kappa`, 1.38065 :math:`\times 10^{-23}`, J K :math:`{}^{-1}` molecule :math:`{}^{-1}` + "Avogadro’s number", :math:`N_{A}`, 6.02214 :math:`\times 10^{26}`, molecule kmol\ :math:`{}^{-1}` + "Universal gas constant", :math:`R_{gas}`, :math:`N_{A} \kappa`, J K :math:`{}^{-1}` kmol :math:`{}^{-1}` + "Molecular weight of dry air", :math:`MW_{da}`, 28.966, kg kmol :math:`{}^{-1}` + "Dry air gas constant", :math:`R_{da}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{da} }} \right. \kern-\nulldelimiterspace} MW_{da} }`, J K :math:`{}^{-1}` kg :math:`{}^{-1}` + "Molecular weight of water vapor", :math:`MW_{wv}`, 18.016, kg kmol :math:`{}^{-1}` + "Water vapor gas constant", :math:`R_{wv}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{wv} }} \right. \kern-\nulldelimiterspace} MW_{wv} }`, J K :math:`{}^{-1}` kg :math:`{}^{-1}` + "Von Karman constant", :math:`k`, 0.4, "\-" + "Freezing temperature of fresh water", :math:`T_{f}`, 273.5, K + "Density of liquid water", :math:`\rho _{liq}`, 1000, kg m :math:`{}^{-3}` + "Density of ice", :math:`\rho _{ice}`, 917, kg m :math:`{}^{-3}` + "Specific heat capacity of dry air", :math:`C_{p}`, 1.00464 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` + "Specific heat capacity of water", :math:`C_{liq}`, 4.188 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` + "Specific heat capacity of ice", :math:`C_{ice}`, 2.11727 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` + "Latent heat of vaporization", :math:`\lambda _{vap}`, 2.501 :math:`\times 10^{6}`, J kg :math:`{}^{-1}` + "Latent heat of fusion", :math:`L_{f}`, 3.337 :math:`\times 10^{5}`, J kg :math:`{}^{-1}` + "Latent heat of sublimation", :math:`\lambda _{sub}`, :math:`\lambda _{vap} +L_{f}`, J kg :math:`{}^{-1}` + :math:`{}^{1}` "Thermal conductivity of water", :math:`\lambda _{liq}`, 0.57, W m :math:`{}^{-1}` K :math:`{}^{-1}` + :math:`{}^{1}` "Thermal conductivity of ice", :math:`\lambda _{ice}`, 2.29, W m :math:`{}^{-1}` K :math:`{}^{-1}` + :math:`{}^{1}` "Thermal conductivity of air", :math:`\lambda _{air}`, 0.023 W m :math:`{}^{-1}` K :math:`{}^{-1}` + "Radius of the earth", :math:`R_{e}`, 6.37122, :math:`\times 10^{6}` m + +:math:`{}^{1}`\ Not shared by other components of the coupled modeling system. + diff --git a/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst b/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst new file mode 100644 index 0000000000..2c378b3aec --- /dev/null +++ b/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst @@ -0,0 +1,722 @@ +**** + +Crops and Irrigation +======================== + +Summary of CLM4.5 updates relative to the CLM4.0 +----------------------------------------------------- + +We describe here the complete crop and irrigation parameterizations that +appear in CLM4.5. Corresponding information for CLM4.0 appeared on the +CLM4.0 web site in a pdf document independent of the CLM4.0 Technical +Note (Oleson et al. 2010a). The CLM4.0 crop model description also +appeared in Levis et al. (2012). + +CLM4.5 includes the following updates to the CROP option, where CROP +refers to the interactive crop management model: + +- Interactive irrigation + +- Interactive fertilization + +- Biological nitrogen fixation for soybeans + +- Modified C:N ratios for crops + +- Nitrogen retranslocation for crops + +- Separate reproductive pool + +These updates appear in detail in section 20.4. Most also appear in +Drewniak et al. (2013). + +The crop model +------------------- + +20.2.1 Introduction +^^^^^^^^^^^^^^^^^^^ + +Groups developing Earth System Models generally account for the human +footprint on the landscape in simulations of historical and future +climates. Traditionally we have represented this footprint with natural +vegetation types and particularly grasses because they resemble many +common crops. Most modeling efforts have not incorporated more explicit +representations of land management such as crop type, planting, +harvesting, tillage, fertilization, and irrigation, because global scale +datasets of these factors have lagged behind vegetation mapping. As this +begins to change, we increasingly find models that will simulate the +biogeophysical and biogeochemical effects not only of natural but also +human-managed land cover. + +AgroIBIS is a state-of-the-art land surface model with options to +simulate dynamic vegetation (Kucharik et al. ** 2000) and interactive +crop management (Kucharik and Brye 2003). The interactive crop +management parameterizations from AgroIBIS (March 2003 version) were +coupled as a proof-of-concept to the Community Land Model version 3 +[CLM3.0, Oleson et al. ** (2004)] (not published), then coupled to the +CLM3.5 (Levis et al. 2009) and later released to the community with +CLM4CN (Levis et al. 2012). + +With interactive crop management and, therefore, a more accurate +representation of agricultural landscapes, we hope to improve the CLM’s +simulated biogeophysics and biogeochemistry. These advances may improve +fully coupled simulations with the Community Earth System Model (CESM), +while helping human societies answer questions about changing food, +energy, and water resources in response to climate, environmental, land +use, and land management change (e.g., Kucharik and Brye 2003; Lobell et +al. ** 2006). + +20.2.2 Crop plant functional types +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CLM’s default list of plant functional types (pfts) includes an +unmanaged crop (Table 2.1) treated as a second C3 grass. The unmanaged +crop has grid cell coverage assigned from satellite data, as do all +natural pfts when CLM’s dynamic vegetation model (CNDV; Castillo et al. +2012) is not active. + +The new crop pfts used in the CLM get grid cell coverage from the +present-day crop dataset of Portmann et al. (2010). We assign these +managed crops in the proportions given by Portmann et al. (2010) without +exceeding the area previously assigned to the unmanaged crop. The +unmanaged crop continues to occupy any of its original area that remains +and continues to be handled just by the carbon/nitrogen cycling part of +the CLM (i.e., CN). The managed crop types (corn, soybean, and temperate +cereals) were chosen based on the availability of corresponding +algorithms in AgroIBIS. Temperate cereals include wheat, barley, and rye +here. We treat all temperate cereals as summer crops (like spring wheat, +for example) at this time. We may introduce winter cereals (such as +winter wheat) in a future version of the model. + +To allow crops to coexist with natural vegetation in a grid cell and be +treated by separate models (i.e., CLM4.5CNcrop versus CLM4.5CNDV), we +separate the vegetated land unit into a naturally vegetated land unit +and a human managed land unit. Plant functional types in the naturally +vegetated land unit share one soil column and compete for water (default +CLM setting). Managed crop PFTs in the human managed land unit do not +share soil columns and thus permit for differences in land management +between crops. + +20.2.3 Phenology +^^^^^^^^^^^^^^^^ + +CLM4.5CN includes evergreen, seasonally deciduous (responding to changes +in day length), and stress deciduous (responding to changes in +temperature and/or soil moisture) phenology algorithms (Chapter 14). In +CLM4.5CNcrop we have added the AgroIBIS crop phenology algorithm, +consisting of three distinct phases. + +Phase 1 starts at planting and ends with leaf emergence, phase 2 +continues from leaf emergence to the beginning of grain fill, and phase +3 starts from the beginning of grain fill and ends with physiological +maturity and harvest. + +20.2.3.1 Planting +''''''''''''''''' + +Corn and temperate cereals must meet the following requirements between +April 1\ :math:`{}^{st}` and June 14\ :math:`{}^{th}` for planting in +the northern hemisphere (NH): + +.. math:: + + \label{ZEqnNum568682} + \begin{array}{l} {T_{10d} >T_{p} } \\ {T_{10d}^{\min } >T_{p}^{\min } } \\ {GDD_{8} \ge GDD_{\min } } \end{array} + +where *T*\ :math:`{}_{10}`\ *:math:`{}_{d}`* is the 10-day running mean +of *T*\ :math:`{}_{2}`\ *:math:`{}_{m}`*, (the simulated 2-m air +temperature at every model time step) and :math:`T_{10d}^{\min }` is +the 10-day running mean of :math:`T_{2m}^{\min }` (the daily minimum of +*T*\ :math:`{}_{2}`\ *:math:`{}_{m}`*). *T\ :math:`{}_{p}`* and +:math:`T_{p}^{\min }` are crop-specific coldest planting temperatures +(Table 20.1), *GDD*\ :math:`{}_{8}` is the 20-year running mean growing +degree-days (units are degree-days or :math:`{}^\circ`\ days) tracked +from April through September (NH) base 8\ :math:`{}^\circ`\ C with +maximum daily increments of 30\ :math:`{}^\circ`\ days (see Eq. ), and +*GDD*\ :math:`{}_{min }`\ is the minimum growing degree day requirement +(Table 20.1). Soy must meet the same requirements but between May +1\ :math:`{}^{st}` and June 14\ :math:`{}^{th}` for planting. If the +requirements in Eq. are not met by June 14\ :math:`{}^{th}`, then corn, +soybean, and temperate cereals are still planted on June +15\ :math:`{}^{th}` as long as *GDD*\ :math:`{}_{8}`\ :math:`>`\ 0. In +the southern hemisphere (SH) the NH requirements apply 6 months later. + +*GDD*\ :math:`{}_{8}` does not change as quickly as +*T*\ :math:`{}_{10}`\ *:math:`{}_{d}`* and :math:`T_{10d}^{\min }` , so +it determines whether the crop can be planted in a grid cell, while the +two faster-changing variables determine when the crop may be planted. + +At planting, each crop is assigned 1 g leaf C m\ :math:`{}^{-2}` pft +column area to be transferred to the leaves upon leaf emergence. An +equivalent amount of seed leaf N is assigned given the pft’s C to N +ratio for leaves (*CN\ :math:`{}_{leaf}`*). (This differs from AgroIBIS, +which uses a seed leaf area index instead of seed C.) + +At planting, the model updates the average growing degree-days necessary +for the crop to reach vegetative and physiological maturity, +*GDD*\ :math:`{}_{mat}`, according to the following AgroIBIS rules: + +.. math:: + + \label{20.2)} + \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950}` 0, and *:math:`\beta`\ :math:`{}_{t}`* :math:`<` 1, +i.e., water is limiting for photosynthesis (see section 8.4). + +If irrigation is required, the model computes the deficit between the +current soil moisture content and a target soil moisture content; this +deficit is the amount of water that will be added through irrigation. +The target soil moisture content in each soil layer *i* +(*w\ :math:`{}_{target,i}`*, kg m\ :math:`{}^{-2}`) is a weighted +average of the minimum soil moisture content that results in no water +stress in that layer (*w\ :math:`{}_{o,i}`*, kg m\ :math:`{}^{-2}`) and +the soil moisture content at saturation in that layer +(*w\ :math:`{}_{sat,i}`*, kg m\ :math:`{}^{-2}`): + +.. math:: + + \label{20.7)} + w_{target,i} =(1-0.7)\cdot w_{o,i} +0.7\cdot w_{sat,i} + +*w\ :math:`{}_{o,i}`* is determined by inverting equation 8.19 in Oleson +et al. (2010a) to solve for the value of *s\ :math:`{}_{i}`* (soil +wetness) that makes *:math:`\Psi`\ :math:`{}_{i}`* = +*:math:`\Psi`\ :math:`{}_{o}`* (where *:math:`\Psi`\ :math:`{}_{i}`* is +the soil water matric potential and *:math:`\Psi`\ :math:`{}_{o}`* is +the soil water potential when stomata are fully open), and then +converting this value to units of kg m\ :math:`{}^{-2}`. +*w\ :math:`{}_{sat,i}`* is calculated simply by converting effective +porosity (section 7.4) to units of kg m\ :math:`{}^{-2}`. The value 0.7 +was determined empirically, in order to give global, annual irrigation +amounts that approximately match observed gross irrigation water use +around the year 2000 (i.e., total water withdrawals for irrigation: +:math:`\sim` 2500 – 3000 km\ :math:`{}^{3}` year\ :math:`{}^{-1}` +(Shiklomanov 2000)). The total water deficit (*w\ :math:`{}_{deficit}`*, +kg m\ :math:`{}^{-2}`) of the column is then determined by: + +.. math:: + + \label{20.8)} + w_{deficit} =\sum _{i}\max \left(w_{target,i} -w_{liq,i} ,0\right) + +where *w\ :math:`{}_{liq,i}`* (kg m\ :math:`{}^{-2}`) is the current +soil water content of layer *i* (Chapter 7). The max function means that +a surplus in one layer cannot make up for a deficit in another layer. +The sum is taken only over soil layers that contain roots. In addition, +if the temperature of any soil layer is below freezing, then the sum +only includes layers above the top-most frozen soil layer. + +The amount of water added to this column through irrigation is then +equal to *w\ :math:`{}_{deficit}`*. This irrigation is applied at a +constant rate over the following four hours. Irrigation water is applied +directly to the ground surface, bypassing canopy interception (i.e., +added to *q\ :math:`{}_{grnd,liq}`*: section 7.1). Added irrigation is +removed from total liquid runoff (*R\ :math:`{}_{liq}`*: Chapter 11), +simulating removal from nearby rivers. + +The details about what is new in CLM4.5 +-------------------------------------------- + +20.4.1 Interactive irrigation for corn, temperate cereals, and soybean +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CLM4.0 included interactive irrigation only for the generic C3 crops, +i.e. plant functional types (pfts) 15 (rainfed) and 16 (irrigated) in +the CLM list of pfts and not for the additional crops of the interactive +crop management model (CROP). Irrigation and CROP were mutually +exclusive in CLM4.0. + +In CLM4.5 we have reversed this situation. Now the irrigation model can +be used only while running with CROP. To accomplish this we downloaded +data of percent irrigated and percent rainfed corn, soybean, and +temperate cereals (wheat, barley, and rye) (Portmann et al. 2010), +available online from + +*ftp://ftp.rz.uni-frankfurt.de/pub/uni-frankfurt/physische\_geographie/hydrologie/public/data/MIRCA2000/harvested\_area\_grids.* + +We embedded this data in CLM’s high-resolution pft data for use with the +tool mksurfdat to generate surface datasets at any desired resolution. +Now this data includes percent cover for 24 pfts: + +1-16 as in the standard list of pfts, plus six more: + +17 corn + +18 irrigated\_corn + +19 spring\_temperate\_cereal + +20 irrigated\_spring\_temperate\_cereal + +21 winter\_temperate\_cereal + +22 irrigated\_winter\_temperate\_cereal + +23 soybean + +24 irrigated\_soybean + +We intend surface datasets with 24 pfts only for CROP simulations with +or without irrigation. In simulations without irrigation, the rainfed +and irrigated crops merge into just rainfed crops at run time. Surface +datasets with 16 pfts can be used for all other CLM simulations. + +20.4.2 Interactive fertilization +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CLM adds nitrogen directly to the soil mineral nitrogen pool to meet +crop nitrogen demands. CLM’s separate crop land unit ensures that +natural vegetation will not access the fertilizer applied to crops. +Fertilizer amounts are obtained from the Agro-IBIS model (Kucharik and +Brye 2003), but can be modified in CLM’s pft-physiology input dataset. +Fertilizer is reported in g N/m\ :math:`{}^{2}` by plant functional +type. Total nitrogen fertilizer amounts are 150 g N/m\ :math:`{}^{2}` +for maize, 80 g N/m\ :math:`{}^{2}` for temperate cereals, and 25 g +N/m\ :math:`{}^{2}` for soybean, representative of central U.S. annual +fertilizer application amounts. Since CLM’s denitrification rate is high +and results in a 50% loss of the unused available nitrogen each day, +fertilizer is applied slowly to minimize the loss and maximize plant +uptake. Fertilizer application begins during the emergence phase of crop +development and continues for 20 days, which helps reduce large losses +of nitrogen from leaching and denitrification during the early stage of +crop development. The 20-day period is chosen as an optimization to +limit fertilizer application to the emergence stage. A fertilizer +counter in seconds, *f*, is set as soon as the onset growth for crops +initiates: + +*f* = *n* \* 86400 [20.9)] + +where *n* is set to 20 fertilizer application days. When the crop enters +phase 2 (leaf emergence to the beginning of grain fill) of its growth +cycle, fertilizer application begins by initializing fertilizer amount +to the total fertilizer divided by the initialized *f*. Fertilizer is +applied and *f* is decremented each time step until a zero balance on +the counter is reached. + +The crop fertilization scheme was developed in versions of the CLM prior +to CLM4.5. In CLM4.5, crops with fertilization may be simulated over +productive. + +20.4.3 Biological nitrogen fixation for soybeans +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Nitrogen fixation by soybeans is similar to that in the SWAT model +(Neitsch et al. 2005) and depends on soil moisture, nitrogen +availability, and growth stage. Soybean fixation is calculated only for +unmet nitrogen demand; if soil nitrogen meets soybean demand, there will +be no fixation during the time step. Soybean fixation is determined by + +.. math:: + + \label{20.10)} + N_{fix} \; =\; N_{plant\_ ndemand} \; *\; min\; \left(\; 1,\; fxw,\; fxn\; \right)*\; fxg + +where *N\ :math:`{}_{plant\_demand}`* is the balance of nitrogen needed +to reach potential growth that cannot be supplied from the soil mineral +nitrogen pool, *fxw* is the soil water factor, *fxn* is the soil +nitrogen factor, and *fxg* is the growth stage factor calculated by + +.. math:: + + \label{20.11)} + fxw=\frac{wf}{0.85} + +.. math:: + + \label{20.12)} + fxn=\; \left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }sminn\le 10} \\ {1.5-0.005\left(sminn\times 10\right)\qquad {\rm for\; 10\; <\; }sminn{\rm \; }\ge 30} \\ {1\qquad \qquad \qquad \qquad {\rm for\; }sminn>30} \end{array}\right\} + +.. math:: + + \label{20.13)} + fxg=\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad \qquad {\rm for\; }GDD_{T_{2m} } \le 0.15} \\ {6.67\times GDD_{T_{2m} } -1\qquad \qquad \qquad {\rm for\; }0.150.75} \end{array}\right\} + +where *wf* is the soil water content as a fraction of the water holding +capacity for the top 0.05 m, *sminn* is the total nitrogen in the soil +pool (g/m:math:`{}^{2}`), and :math:`{GDD}_{T_{2m}}` is the fraction of +growing degree-days accumulated during the growing season. +:math:`N\mathrm{fix}` is added directly to the soil mineral nitrogen +pool for use that time step. Nitrogen fixation occurs after the plant +has accumulated 15%\ *GDD\ :math:`{}_{mat}`* and before +75%\ *GDD\ :math:`{}_{mat}`*, so before grain fill begins. + +20.4.4 Modified C:N ratios for crops +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Typically, C:N ratios in plant tissue vary throughout the growing season +and tend to be lower during early growth stages and higher in later +growth stages. In order to account for this change, two sets of C:N +ratios are established in CLM for the leaf, stem, and fine root of +crops. This modified C:N ratio approach accounts for the nitrogen +retranslocation that occurs during phase 3 of crop growth. Leaf and stem +(and root for temperate cereals) C:N ratios for phases 1 and 2 are lower +than measurements (Table 20.3) to allow excess nitrogen storage in plant +tissue. During grain fill (phase 3) of the crop growth cycle, the +nitrogen in the plant tissues is moved to a storage pool to fulfill +nitrogen demands of organ (reproductive pool) development, such that the +resulting C:N ratio of the plant tissue is reflective of measurements at +harvest. All C:N ratios were determined by calibration process, through +comparisons of model output versus observations of plant carbon +throughout the growth season. + +20.4.5 Nitrogen retranslocation for crops +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Nitrogen retranslocation in crops occurs when nitrogen that was used for +tissue growth of leaves, stems, and fine roots during the early growth +season is remobilized and used for grain development (Pollmer et al. +1979; Crawford et al. 1982; Simpson et al. 1983; Ta and Weiland 1992; +Barbottin et al. 2005; Gallais et al. 2006, 2007). Nitrogen allocation +for crops follows that of natural vegetation, is supplied in CLM by the +soil mineral nitrogen pool, and depends on C:N ratios for leaves, stems, +roots, and organs. Nitrogen demand during organ development is fulfilled +through retranslocation from leaves, stems, and roots. Nitrogen +retranslocation is initiated at the beginning of the grain fill stage +for corn and temperate cereals, but not until after LAI decline in +soybean. Nitrogen stored in the leaf and stem is moved into a storage +retranslocation pool. For temperate cereals, nitrogen in roots is also +released into the retranslocation storage pool. The quantity of nitrogen +mobilized depends on the C:N ratio of the plant tissue, and is +calculated as + +.. math:: + + \label{20.14)} + leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } + +.. math:: + + \label{20.15)} + stemn\_ to\_ retransn=\frac{c_{stem} }{CN_{stem} } -\frac{c_{stem} }{CN_{stem}^{f} } + +.. math:: + + \label{20.16)} + frootn\_ to\_ retransn=\frac{c_{froot} }{CN_{froot} } -\frac{c_{froot} }{CN_{froot}^{f} } + +where *C\ :math:`{}_{leaf}`*, *C\ :math:`{}_{stem}`*, and +*C\ :math:`{}_{froot}`* is the carbon in the plant leaf, stem, and fine +root, respectively, *CN\ :math:`{}_{leaf}`*, *CN\ :math:`{}_{stem}`*, +and *CN\ :math:`{}_{froot}`* is the pre-grain fill C:N ratio of the +leaf, stem, and fine root respectively, and :math:`CN^f_{leaf}`, +:math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N +ratio of the leaf, stem, and fine root respectively (Table 20.3). Since +C:N measurements are taken from mature crops, pre-grain development C:N +ratios for leaves, stems, and roots are optimized to allow maximum +nitrogen accumulation for later use during organ development. Post-grain +fill C:N ratios are assigned the same as crop residue. Once excess +nitrogen is moved into the retranslocated pool, during the remainder of +the growing season the retranslocated pool is used first to meet plant +nitrogen demand by assigning the available nitrogen from the +retranslocated pool equal to the plant nitrogen demand. Once the +retranslocation pool is depleted, soil mineral nitrogen pool is used to +fulfill plant nitrogen demands. + +Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, +fine root, and reproductive pools. + ++----------------------------+--------+---------------------+-----------+ +| Pre-grain fill stage | Corn | Temperate Cereals | Soybean | ++============================+========+=====================+===========+ +| *CN\ :math:`{}_{leaf}`* | 10 | 15 | 25 | ++----------------------------+--------+---------------------+-----------+ +| *CN\ :math:`{}_{stem}`* | 50 | 50 | 50 | ++----------------------------+--------+---------------------+-----------+ +| *CN\ :math:`{}_{froot}`* | 42 | 30 | 42 | ++----------------------------+--------+---------------------+-----------+ +| Post-grain fill stage | | | | ++----------------------------+--------+---------------------+-----------+ +| :math:`CN_{leaf}^{f}` | 65 | 65 | 65 | ++----------------------------+--------+---------------------+-----------+ +| :math:`CN_{stem}^{f}` | 120 | 100 | 130 | ++----------------------------+--------+---------------------+-----------+ +| :math:`CN_{froot}^{f}` | 42 | 40 | 42 | ++----------------------------+--------+---------------------+-----------+ +| :math:`CN_{repr}^{f}` | 50 | 40 | 60 | ++----------------------------+--------+---------------------+-----------+ + +**** + +20.4.6 Separate reproductive pool +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +One notable difference between natural vegetation and crops is the +presence of a reproductive carbon pool (and nitrogen pool). Accounting +for the reproductive pool helps determine whether crops are performing +reasonably, through yield calculations, seasonal GPP and NEE changes, +etc. The reproductive pool is maintained similarly to the leaf, stem, +and fine root pools, but allocation of carbon and nitrogen does not +begin until the grain fill stage of crop development. Eq. shows the +carbon and nitrogen allocation coefficients to the reproductive pool. In +the CLM4.0, allocation of carbon to the reproductive pool was calculated +but merged with the stem pool. In the model, as allocation declines +during the grain fill stage of growth, increasing amounts of carbon and +nitrogen are available for grain development. diff --git a/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst b/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst new file mode 100644 index 0000000000..956e1aca1a --- /dev/null +++ b/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst @@ -0,0 +1,359 @@ +.. math:: 1 + +Transient Landcover Change +============================== + +CLM includes a treatment of mass and energy fluxes associated with +prescribed temporal change in land cover. Using an annual time series of +the spatial distribution of PFTs and wood harvest, CLM diagnoses the +change in area for PFTs at each model time step and then performs mass +and energy balance accounting necessary to represent the expansion and +contraction of PFT area. This implementation currently only pertains to +the case where all PFTs for a particular grid cell coexist on a single +soil/snow column. In this case, the only biogeophysical state variable +affected is canopy water (:math:`W_{can}` ). The biogeochemical impacts +of land use and land cover change are simulated through changes in CLM +carbon pools and fluxes as shown in Figure 21.1 and described further in +Chapter 13. Other implementations are possible, such as changing the +area of soil/snow columns or land unit area, however these require +additional consideration of conservation of mass and energy among the +soil/snow columns and land units which will be implemented in future +versions of CLM. + +Annual Transient Land Cover Data and Time Interpolation +------------------------------------------------------------ + +The changes in area over time associated with individual PFTs are +prescribed through a forcing dataset, referred to here as the *dynpft* +dataset. The *dynpft* dataset consists of an annual time series of +global grids, where each annual time slice describes the fractional area +occupied by all PFTs and the annual wood harvest within each grid cell. +Changes in area and wood harvest for each PFT within a grid cell at each +model time step are inferred from a time-interpolation of the area +information for the PFT from the two bracketing annual time slices in +the *dynpft* dataset. + +As a special case, when the time dimension of the *dynpft* dataset +starts at a later year than the current model time step, the first time +slice from the *dynpft* dataset is used to represent the current time +step PFT fractional area distributions. Similarly, when the time +dimension of the *dynpft* dataset stops at an earlier year than the +current model time step, the last time slice of the *dynpft* dataset is +used. Thus, the simulation will have invariant representations of PFT +distributions through time for the periods prior to and following the +time duration of the *dynpft* dataset, with transient PFT distributions +during the period covered by the *dynpft* dataset. + +The following equations capture this logic, where :math:`year_{cur}` is +the calendar year for the current timestep, +:math:`dynpft\_ year\eqref{GrindEQ__1_}` and +:math:`dynpft\_ year(nyears)`\ are the first and last calendar years in +the *dynpft* dataset, respectively, :math:`nyears` is the number of +years in the *dynpft* dataset, :math:`nt_{1}` and :math:`nt_{2}` +:math:`{}_{ }`\ are the two bracketing years used in the interpolation +algorithm, and :math:`n` is the index value for the +:math:`dynpft\_ year` array corresponding to +:math:`dynpft\_ year(n)=year_{cur}` : + +.. math:: + + \label{21.1)} + nt_{1} =\left\{\begin{array}{l} {1\qquad {\rm for}\qquad year_{cur} 0` and decreases for +:math:`\Delta w_{p} <0`. + +Mass and Energy Conservation +--------------------------------- + +Mass conservation is maintained across a PFT weight transition by +summing up all the water state variables to get the total vegetated land +unit water content before (:math:`W_{tot,1}` ) and after +(:math:`W_{tot,2}` ) new PFT weights are calculated. For example, +:math:`W_{tot,1}` is + +.. math:: + + \label{21.6)} + W_{tot,1} =W_{a} +W_{sno} +\sum _{i=1}^{N_{levgrnd} }\left(w_{liq,i} +w_{ice,i} \right) +\sum _{j=1}^{npft}\left(W_{can,j} wt_{j,1} \right) + +where :math:`W_{a}` is the aquifer water, :math:`W_{sno}` is the snow +water, :math:`w_{liq,i}` and :math:`w_{ice,i}` \ are the liquid and ice +soil water contents, :math:`W_{can,j}` \ is the canopy water content for +PFT :math:`j`, and :math:`wt_{j,1}` is the PFT weight for PFT +:math:`j`. For the situation where only PFT weights are changing and all +other land unit fractions are constant, any difference between +:math:`W_{tot,1}` and :math:`W_{tot,2}` \ can only be due to +differences in the total canopy water before and after the PFT weight +change. To ensure water conservation, the typically very small +difference between :math:`W_{tot,2}` \ and :math:`W_{tot,1}` is +subtracted from the grid cell runoff + +.. math:: + + \label{21.7)} + R_{liq} =R_{liq} +W_{tot,2} -W_{tot,1} . + +Total energy is unperturbed in this case and therefore an energy +conservation treatment is not required. As noted above, other +implementations are possible and will be desirable in the future, such +as changing the area of soil/snow columns or land unit area, for example +in a situation in which crops are implemented on a separate soil column. +These would require additional consideration of conservation of mass and +energy among the soil/snow columns and land units. + +Annual Transient Land Cover Dataset Development +---------------------------------------------------- + +This section describes the development of the d\ *ynpft* dataset. +Development of this dataset requires adapting for use with the CLM a +harmonized dataset of land cover change for the historical period and +for different representations of the scenario period. + +21.3.1 UNH Transient Land Use and Land Cover Change Dataset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To coordinate the processing and consistency of land use and land cover +change data between the historical period (1850-2005) and the four IPCC +representative concentration pathways (RCPs) derived from integrated +assessment models (IAM), the University of New Hampshire +(stocktickerUNH) research group (Louise Chini, George Hurtt, Steve +Frolking; luh.unh.edu) produced a harmonized transient dataset for use +in climate change simulations. The historical component of the transient +land use and land cover change dataset is Version 1 of the Land-Use +History A product (LUHa.v1) covering the period 1850-2005. The RCP +transient land use and land cover change components (2005-2100) are +referred to as the Future Land-Use Harmonization A products. Version 1 +(LUHa.v1\_future.v1) is used for the AIM, MESSAGE, and MiniCAM IAMs; +Version 1.1 (LUHa.v1\_future.v1.1) is used for the IMAGE IAM. The land +cover information is provided at 0.5 degree grid resolution and includes +fractional grid cell coverage by crops, pasture, and primary and +secondary natural vegetation. + +The crop fraction of the grid cell represents the area of the grid cell +used to grow any type of crop. Similarly, pasture represents the +fraction of a grid cell used for grazing livestock. The remaining area +in a half degree grid cell is partitioned into primary and secondary +vegetation. Primary vegetation represents the fractional area of a grid +cell with vegetation undisturbed by human activities. Secondary +vegetation represents vegetated areas that have recovered from some +human disturbance; this could include re-vegetation of pasture and crop +areas as well as primary vegetation areas that have been logged. + +The stocktickerUNH dataset provides a transition matrix that describes +the annual fraction of land that is transformed from one category to +another (e.g. primary land to crop, pasture to crop, etc.; Hurtt et al. +2006). Included in these transitions is the conversion of secondary land +to secondary land, representing the logging on land recovering from an +earlier disturbance. These transitions provide information on all +changes in land cover through the sum of all transitions in a given +year. Harmonized prescriptions of CMIP5 wood harvest statistics also are +provided by (Hurtt et al. 2011) for the historical and RCP time series. +The wood harvest is prescribed spatially on the same 0.5 degree grid as +the land use class transitions for each year. + +To ensure consistency with the various land use classes wood harvest is +prescribed as both the area of land harvested and the amount of carbon +extracted in the grid cell for a particular year. To account for the +differences in standing amount of wood carbon as well as the differences +in harvest intensity associated with the different land units, the +harvest area and carbon amounts are prescribed for the five classes of: +PlaceNamePrimary PlaceTypeForest, PlaceNamePrimary PlaceTypeNon-Forest, +PlaceNameSecondary PlaceNameMature PlaceTypeForest, PlaceNameSecondary +PlaceNameYoung PlaceTypeForest, and PlaceNameplaceSecondary +PlaceTypeNon-Forest. + +21.3.2 Representing Land Use and Land Cover Change in CLM +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +CLM represents the land surface as a hierarchy of sub-grid types: +glacier; lake; wetland; urban; and vegetated land. The vegetated land is +further divided into a mosaic of PFTs. To represent the UNH transient +land use and land cover change dataset in CLM, the annual fractional +composition of crop, pasture, primary vegetation, and secondary +vegetation land units specified in the UNH dataset needs to be +faithfully represented with a corresponding PFT mosaic in CLM using the +methods described in Lawrence et al (2012). This method translated each +of the UNH land units into fractional PFT values based on current day +and potential vegetation CLM land surface parameters for that grid cell +and for that year, as shown in Figure 21.2. + +The methodology for creating the transient PFT dataset is based on four +steps which are applied across the time series. First, crop PFT +composition is directly specified from the crop land unit fractional +area. Second, pasture PFTs are assigned based on grass PFTs found in the +potential vegetation and current day CLM land surface parameters scaled +by the area of pasture. Third, potential vegetation PFTs are assigned to +the grid cell scaled by the fractional area of the primary land unit. +Last, current day non-crop and non-pasture PFTs are assigned to the grid +cell scaled by the fractional area of the secondary land unit. The +annual tree harvest values also are calculated from the harvest +information of the UNH dataset used in conjunction with transient tree +PFT values. Separate datasets representing the extent of water, wetland, +ice and urban land cover are used to compile the final land cover +present in each CLM grid cell. These additional non-vegetated land cover +fractions are held constant throughout the time series. All datasets are +resolved at the half degree grid resolution. + +21.3.3 Present Day PFT Dataset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The present day dataset is based on the methodology of Lawrence and +Chase (2007) and uses a variety of satellite products to develop present +day PFT distributions with matching leaf area index values. The dataset +initially derives fractions of bare ground and tree cover from the +Moderate Resolution Imaging Spectroradiometer (MODIS) vegetation +continuous fields product (Hansen et al. 2003). To further distinguish +tree types, the tree fraction is divided into broadleaf/needleleaf and +evergreen/deciduous types based on the Advanced Very High Resolution +Radiometer (AVHRR) continuous fields tree cover (DeFries et al. 2000). +The remaining grid cell area is assumed to be herbaceous grasses and +shrubs, including crops. The area of crop is initially determined from +Ramankutty et al. (2008) circa 2000 global crop land areas, and the +remaining grass and shrub fractions are derived from the MODIS land +cover (Friedl et al. 2002). Further subdivisions of grass, shrub and +tree PFTs into tropical, temperate and boreal types were based on the +physiology and climate rules from Nemani and Running (1996), and for +C3/C4 photosynthetic pathways based on MODIS derived leaf area index +values and the mapping methods of Still et al. (2003). In contrast to +Lawrence and Chase (2007), the understory grasses of forested areas have +been replaced with trees for the dataset. Some advantages of this +dataset are that it reproduces the physical properties as observed by +the MODIS land surface data (e.g. grid cell albedo and leaf area index +values) while maintaining the multiple PFT representation. + +21.3.4 Potential PFT Distribution +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Essential to any reconstruction of past vegetation distributions is the +need to know the potential vegetation that would be there prior to human +activities. Many researchers have worked to estimate potential +vegetation types at regional and global scales from remnant vegetation +and other field data or from bioclimatic models. The CLM potential PFT +distribution is derived from Ramankutty et al. (2008) at 5 arc-minute +resolution. However, this product is based on a biome type +classification system that is not directly compatible with the CLM PFT +distributions. + +The CLM potential vegetation is described by Lawrence and Chase (2010). +This reconstruction describes potential PFT distributions extrapolated +from the current day PFT composition of remnant natural biomes as mapped +by Ramankutty et al. (2008). The current day remnant natural PFT +parameters were taken from the Lawrence and Chase (2007) dataset with +the same forest understory changes as described above to ensure +consistency between the two datasets. The current day remnant natural +PFT biome compositions were spatially extrapolated to the potential +vegetation biome distributions provided by Ramankutty et al. (2008) +using inverse distance weighted methods. The resulting product is a CLM +PFT distribution that may have existed prior to human disturbance under +current day climate conditions. + +21.3.5 Transient Land Cover Change Dataset +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For each year from 1850 to 2005 and to 2100 for each of the four RCPs, +PFT distributions and wood harvest are adjusted based on the +stocktickerUNH dataset. Initially the grid cell is checked to adjust the +crop area based on the stocktickerUNH crop area. If the crop area +exceeds the available land area (i.e. the grid cell area minus the area +assigned to glacier, wetlands, lake and urban areas) then all the +available area is allocated to crops and no other PFTs are added. After +the crop area is assigned, any remaining area is considered available +for pasture. + +As the pasture data from the stocktickerUNH dataset represents grazing, +pasture areas are assigned in the present day based on the availability +of grasses (C3, C4 and boreal C3 PFTs) and shrubs relative to the bare +soil fraction. If the grazing area exceeds the total vegetated area from +both the potential and current day PFT data, then the grazed area is +limited to the larger of the potential or current day vegetated area. +This is done to prevent representing sparsely vegetated grazing areas as +100% vegetated pastures. Once the grazing area is less than or equal to +the total vegetated area, then grazing areas are assigned to the C3 and +C4 grass areas based on their potential vegetation and current day +fractions. In areas where the grazing area cannot be met through the +current day or potential vegetation grass fraction alone, the current +day tree PFTs are converted to grass PFTs, with the remaining shrub PFTs +included as being grazed. + +Once crop and pasture areas are assigned to a grid cell, the remaining +area is assigned to primary and secondary natural vegetation. Primary +vegetation is assumed to be undisturbed and reflects the potential +vegetation PFT distributions. In the secondary region, the PFT +distributions are based on the current day non-crop and non-pasture PFTs +in the grid cell. This process ensures that the PFT distributions are +kept consistent with the original current day and potential vegetation +CLM parameters, while remaining faithful to the stocktickerUNH assigned +areas. + +21.3.6 Forest Harvest Dataset Changes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Discussions following the initial analysis of CCSM4 land cover change +experiments found there were very high wood harvest areas compared to +wood harvest carbon in the RCP 6.0 and RCP 8.5 time series. The high +wood harvest areas were traced to using gridded spatially explicit wood +harvest targets from the MESSAGE and AIM groups for these two time +series, rather than using regional targets with spatial downscaling in +GLM as done with the other three time periods. As a result of these +discussions new amended wood harvest targets were generated with +regional targets through GLM for the RCP 6.0 and RCP 8.5 time series as +described in Lawrence et al. (2012). + +Figure 21.1. Schematic of land cover change impacts on CLM carbon pools +and fluxes. + +|image| + +Figure 21.2. Schematic of translation of annual UNH land units to CLM4 +plant functional types. + +|image| + +.. |image| image:: image1 +.. |image| image:: image2 diff --git a/doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst b/doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst new file mode 100644 index 0000000000..b90f8b4a16 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst @@ -0,0 +1,155 @@ +.. math:: 1 + +Dynamic Global Vegetation Model +=================================== + +In CLM the user may choose to run the CN model as a dgvm (dynamic global +vegetation model) (CNDV). Note that CN must be active to run the dgvm in +CLM. In this section, a general description of the dgvm processes and +how they integrate with CN are provided. Further details are available +in the CLM3DGVM Technical Note (Levis et al. 2004). The focus here is on +the differences relative to the corresponding processes in the CLM3DGVM. + +As with the CLM3DGVM, CNDV can simulate biogeographical changes only for +natural vegetation. Although the vegetated land unit may be separated +into naturally vegetated and human managed land units to permit a +coexistence of natural and human managed vegetation, CNDV only works if +the human managed land units are fixed. CLM’s transient land cover and +land use change capability (see Chapter 21), which permits transitions +between natural and human managed plant functional types (PFTs), is +incompatible with the CNDV option at this time. + +CNDV was implemented by introducing CLM3DGVM code to the hourly CN +framework only to the extent necessary to simulate annual biogeography +updates. This includes the annual processes of light competition, +establishment, and survival [see sections 2.7 and 2.10, Levis et al. +(2004)] as they pertain to the calculations of PFT cover (FPC) and +population (P) but not processes related to carbon pools, leaf area +index (LAI), or canopy height. In CNDV we added complexity to the gap +mortality calculation with annual heat stress and growth efficiency +considerations from the corresponding CLM3DGVM algorithm [section 2.8, +Levis et al. (2004)]. All other ecosystem processes (allocation, +phenology, fire, etc.) are handled by CN modules. Unlike in the +CLM3DGVM, in CNDV, annual biogeography updates are interpolated to +hourly intervals. + +Establishment and survival +------------------------------- + +The PFT distribution in the vegetated land unit is typically prescribed +in CLM (see section 2.1.2) except for the case when CNDV is active. In +CNDV the model begins with no PFT information per grid cell and +evaluates whether or not a PFT may establish or survive according to the +PFT’s bioclimatic limits (Table 22.1). Shrub PFTs are treated as trees +at establishment. + +CNDV omits the CLM3DGVM’s annual introduction of saplings when a PFT can +establish. The CLM3DGVM merged sapling carbon pools with a PFT’s +existing carbon. The resultant leaf carbon (annual maximum value) would +update the FPC, i.e. the foliar projective cover or fraction of the +vegetated land unit occupied by the PFT [section 2.10, Levis et al. +(2004)]. Instead, CNDV updates the FPC using the PFT’s annual maximum +leaf carbon without an addition from saplings. For newly established +PFTs, CNDV assigns seed leaf carbon equal to 1 g C m\ :math:`{}^{-2}` of +land unit area and seed FPC equal to 0.05 for grasses and 0.000844 for +trees (values determined from CLM3DGVM simulations). The addition of +establishing individuals to *P*, a PFT’s population, is handled as in +the CLM3DGVM. + +*FPC* changes annually as in the CLM3DGVM but now is interpolated to an +hourly increment using the algorithms designed to conserve energy and +mass in the CLM’s dynamic land use option. + +Light competition +---------------------- + +In CNDV’s order of annual processes, light competition is invoked before +establishment and survival. However, light competition does not affect a +simulation starting from bare ground until the vegetation fills the land +unit (a few years at least). + +Light competition starts with a calculation updating *FPC*. For +reference, this update was included at the end of allocation in the +CLM3DGVM [section 2.6, Levis et al. (2004)]. + +Due to their height advantage, trees will cover up to 95% of the land +unit when their productivity permits, as in the CLM3DGVM, regardless of +grass and shrub productivity. Grasses get second priority, as in the +CLM3DGVM, even with shrubs included now. Shrubs, then, have access to +the remaining space and follow the tree algorithm for self thinning +[section 2.7, Levis et al. (2004)]. As a result, trees typically +dominate in the most productive regions, grasses in less productive +regions, and shrubs in the least productive non-desert regions (Zeng et +al. 2008). + +CN processes modified for the CNDV coupling +------------------------------------------------ + +Gap mortality and mortality from fire: Constant annual mortality rate of +0.02 is changed for trees and shrubs to an annual rate calculated as in +the CLM3DGVM accounting for background and stress mortality [section +2.8, Levis et al. (2004)]. The CN module converts the annual rate to +hourly. + +The CLM3DGVM used the concepts of average plant individual and PFT +population, *P*. CNDV retains these concepts in the light competition, +establishment, and survival calculations. In CNDV we account for the +individuals removed hourly from *P* in response to CN’s fire and gap +mortality, while the carbon pools per individual and FPC remain +constant. Ultimately, *P* updates should only affect the annual +processes of light competition, establishment, and survival, so the *P* +update may be moved to the end of the year in a future version of CNDV. + +Vegetation Structure Update: CN stocking is a constant, while in CNDV +stocking changes as P and FPC change. This affects the top-of-canopy +height calculation. CN specific leaf area and stem diameter calculations +are kept, while the height calculation is replaced with the CLM3DGVM’s +[section 2.6, Levis et al. (2004)]. CN stem area index (SAI) is kept. + +Allocation: CN calculates a PFT’s fraction of currently allocated carbon +relative to the total allocation instead of obtaining a constant value +from CLM’s PFT-physiology file. In CNDV, we returned to the constant +values in the old PFT-physiology file to get a reasonable simulation of +PFTs. For CNDV to use the calculated fraction, we will need to change +the algorithm for PFTs in early stages of growth. + +Table 22.1. Plant functional type (PFT) biogeography rules with respect +to climate. + +Adapted from Table 1 of Levis et al. (2004) to include shrub PFTs. +:math:`T_{c,\min }` , coldest minimum monthly air temperature for +survival of previously established PFTs; :math:`T_{c,\max }` , warmest +minimum monthly air temperature for establishment of new PFTs; +:math:`GDD_{\min }` , minimum annual growing degree-days above +5\ :math:`{}^\circ`\ C for establishment of new PFTs. Levis et al. +(2004) include an explanation of these variables and their use. + ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| | Survival | | | | ++=============================================+==============================================+==============================================+=========================+========+ +| | *T*\ :math:`{}_{c,min}` (:math:`\circ`\ C) | *T*\ :math:`{}_{c,max}` (:math:`\circ`\ C) | GDD\ :math:`{}_{min}` | | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Tropical broadleaf evergreen tree (BET) | | 15.5 | No limit | 0 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Tropical broadleaf deciduous tree (BDT) | | 15.5 | No limit | 0 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Temperate needleleaf evergreen tree (NET) | | -2.0 | 22.0 | 900 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Temperate broadleaf evergreen tree (BET) | | 3.0 | 18.8 | 1200 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Temperate broadleaf deciduous tree (BDT) | | -17.0 | 15.5 | 1200 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Boreal needleleaf evergreen tree (NET) | | -32.5 | -2.0 | 600 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Boreal deciduous tree | | No limit | -2.0 | 350 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Temperate broadleaf deciduous shrub (BDS) | | -17.0 | No limit | 1200 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| Boreal broadleaf deciduous shrub (BDS) | | No limit | -2.0 | 350 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| C\ :math:`{}_{4}` | | 15.5 | No limit | 0 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| C\ :math:`{}_{3}` | | -17.0 | 15.5 | 0 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ +| C\ :math:`{}_{3}` arctic | | No limit | -17.0 | 0 | ++---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ diff --git a/doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst b/doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst new file mode 100644 index 0000000000..d19c09ca0b --- /dev/null +++ b/doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst @@ -0,0 +1,66 @@ +.. math:: 2 + +.. math:: 1 + +Biogenic Volatile Organic Compounds (BVOCs) +=============================================== + +This chapter briefly describes the biogenic volatile organic compound +(BVOC) emissions model implemented in CLM. The CLM3 version (Levis et +al. 2003; Oleson et al. 2004) was based on Guenther et al. (1995). Heald +et al. (2008) updated this scheme in CLM4 based on Guenther et al. +(2006). The current version in CLM4.5 is based on MEGAN2.1 discussed in +detail in Guenther et al. (2012). This update of MEGAN incorporates four +main features: expansion to 147 chemical compounds the treatment of the +light-dependent fraction (LDF) for each compound inclusion of the +inhibition of isoprene emission by atmospheric CO\ :math:`{}_{2}` and +emission factors mapped to the specific PFTs of the CLM. + +MEGAN2.1 now describes the emissions of speciated monoterpenes, +sesquiterpenes, oxygenated VOC as well as isoprene. A flexible scheme +has been implemented in the CLM to specify a subset of emissions. This +allows for additional flexibility in grouping chemical compounds to form +the lumped species frequently used in atmospheric chemistry. The mapping +or grouping are therefore defined through a namelist parameter in +drv\_flds\_in, e.g. megan\_specifier = ’ISOP = isoprene’, ’BIGALK = +pentane + hexane + heptane + tricyclene’. + +Terrestrial BVOC emissions from plants to the atmosphere are expressed +as a flux, ** :math:`F_{i}` (:math:`\mu` \ g C m\ :math:`{}^{-2}` +ground area h\ :math:`{}^{-1}`), for emission of chemical compound +:math:`i` + +.. math:: + + \label{ZEqnNum964222} + F_{i} =\gamma _{i} \rho \sum _{j}\varepsilon _{i,j} \left(wt\right)_{j} + +where :math:`\gamma _{i}` is the emission activity factor accounting +for responses to meteorological and phenological conditions, +:math:`\rho` is the canopy loss and production factor also known as +escape efficiency (set to 1), and :math:`\varepsilon _{i,\, j}` +(:math:`\mu` \ g C m\ :math:`{}^{-2}` ground area h\ :math:`{}^{-1}`) is +the emission factor at standard conditions of light, temperature, and +leaf area for plant functional type *j* with fractional coverage +:math:`\left(wt\right)_{j}` (Guenther et al. 2012). The emission +activity factor :math:`\gamma _{i}` depends on plant functional type, +temperature, LAI, leaf age, and soil moisture (Guenther et al. 2012). +For isoprene only, the effect of CO\ :math:`{}_{2}` inhibition is now +included as described by Heald et al. (2009). Previously, only isoprene +was treated as a light-dependent emission. In MEGAN2.1, each chemical +compound is assigned a LDF (ranging from 1.0 for isoprene to 0.2 for +some monoterpenes, VOCs and acetone). The activity factor for the light +response of emissions is therefore estimated as: + +.. math:: + + \label{23.2)} + \gamma _{P,\, i} =\left(1-LDF_{i} \right)+\gamma _{P\_ LDF} LDF_{i} + +where the LDF activity factor (:math:`\gamma _{P\_ LDF}` ) is specified +as a function of PAR as in previous versions of MEGAN. + +The values for each emission factor :math:`\varepsilon _{i,\, j}` are +now available for each of the 15 plant functional types in the CLM and +each chemical compound. This information is distributed through an +external file, allowing for more frequent and easier updates. diff --git a/doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst b/doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst new file mode 100644 index 0000000000..ae371ca838 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst @@ -0,0 +1,212 @@ +.. math:: 1 + +.. math:: 1 + +Dust Model +============== + +Atmospheric dust is mobilized from the land by wind in the CLM. The most +important factors determining soil erodibility and dust emission include +the wind friction speed, the vegetation cover, and the soil moisture. +The CLM dust mobilization scheme (Mahowald et al. ** 2006) accounts for +these factors based on the DEAD (Dust Entrainment and Deposition) model +of Zender et al. (2003). Please refer to the Zender et al. ** (2003) +article for additional information regarding the equations presented in +this section. + +The total vertical mass flux of dust, :math:`F_{j}` (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), from the ground into transport +bin :math:`j` is given by + +.. math:: + + \label{ZEqnNum146272} + F_{j} =TSf_{m} \alpha Q_{s} \sum _{i=1}^{I}M_{i,j} + +where :math:`T` is a global factor that compensates for the DEAD model’s +sensitivity to horizontal and temporal resolution and equals 5 x +10\ :math:`{}^{-4}` in the CLM instead of 7 x 10\ :math:`{}^{-4}` in +Zender et al. (2003). :math:`S` is the source erodibility factor set to +1 in the CLM and serves as a place holder at this time. + +The grid cell fraction of exposed bare soil suitable for dust +mobilization :math:`f_{m}` is given by + +.. math:: + + \label{24.2)} + f_{m} =\left(1-f_{lake} -f_{wetl} \right)\left(1-f_{sno} \right)\left(1-f_{v} \right)\frac{w_{liq,1} }{w_{liq,1} +w_{ice,1} } + +where ** :math:`f_{lake}` and ** :math:`f_{wetl}` and :math:`f_{sno}` +are the CLM grid cell fractions of lake and wetland (section 2.2.3) and +snow cover (section 7.2.1), all ranging from zero to one. Not mentioned +by Zender et al. (2003), :math:`w_{liq,\, 1}` and +:math:`{}_{w_{ice,\, 1} }` are the CLM top soil layer liquid water and +ice contents (mm) entered as a ratio expressing the decreasing ability +of dust to mobilize from increasingly frozen soil. The grid cell +fraction of vegetation cover,\ :math:`{}_{f_{v} }`, is defined as + +.. math:: + + \label{ZEqnNum242183} + 0\le f_{v} =\frac{L+S}{\left(L+S\right)_{t} } \le 1{\rm \; \; \; \; where\; }\left(L+S\right)_{t} =0.3{\rm \; m}^{2} {\rm m}^{-2} + +where equation applies only for dust mobilization and is not related to +the plant functional type fractions prescribed from the CLM input data +or simulated by the CLM dynamic vegetation model (Chapter 22). :math:`L` +and :math:`S` are the CLM leaf and stem area index values +(m:math:`{}^{2}` m\ :math:`{}^{-2}`) averaged at the land unit level so +as to include all the pfts and the bare ground present in a vegetated +land unit. ** :math:`L` and :math:`S` may be prescribed from the CLM +input data (section 2.1.4) or simulated by the CLM biogeochemistry model +(Chapter 13). + +The sandblasting mass efficiency :math:`\alpha` (m:math:`{}^{-1}`) is +calculated as + +.. math:: + + \label{24.4)} + \alpha =100e^{\left(13.4M_{clay} -6.0\right)\ln 10} {\rm \; \; }\left\{\begin{array}{l} {M_{clay} =\% clay\times 0.01{\rm \; \; \; 0}\le \% clay\le 20} \\ {M_{clay} =20\times 0.01{\rm \; \; \; \; \; \; \; \; 20<\% }clay\le 100} \end{array}\right. + +where :math:`M_{clay}` \ *:math:`{}_{ }`*\ is the mass fraction of clay +particles in the soil and %clay is determined from the surface dataset +(section 2.2.3). :math:`M_{clay} =0` corresponds to sand and +:math:`M_{clay} =0.2` to sandy loam. + +:math:`Q_{s}` is the total horizontally saltating mass flux (kg +m\ :math:`{}^{-1}` s\ :math:`{}^{-1}`) of “large†particles (Table +24.1), also referred to as the vertically integrated streamwise mass +flux + +.. math:: + + \label{ZEqnNum832592} + Q_{s} =\left\{\begin{array}{l} {\frac{c_{s} \rho _{atm} u_{*s}^{3} }{g} \left(1-\frac{u_{*t} }{u_{*s} } \right)\left(1+\frac{u_{*t} }{u_{*s} } \right)^{2} {\rm \; }\qquad {\rm for\; }u_{*t} w_{t} } \end{array}\right. + +where + +.. math:: + + \label{24.8)} + w_{t} =a\left(0.17M_{clay} +0.14M_{clay}^{2} \right){\rm \; \; \; \; \; \; 0}\le M_{clay} =\% clay\times 0.01\le 1 + +and + +.. math:: + + \label{24.9)} + w=\frac{\theta _{1} \rho _{liq} }{\rho _{d,1} } + +where :math:`a=M_{clay}^{-1}` for tuning purposes, +:math:`\theta _{1}` is the volumetric soil moisture in the top soil +layer (m:math:`{}^{3 }`\ m\ :math:`{}^{-3}`) (section 7.4), +:math:`\rho _{liq}` is the density of liquid water (kg +m\ :math:`{}^{-3}`) (Table 2.6), and :math:`\rho _{d,\, 1}` is the bulk +density of soil in the top soil layer (kg m\ :math:`{}^{-3}`) defined as +in section 6.3 rather than as in Zender et al. ** (2003). +:math:`Re_{*t}^{f}` from equation is the threshold friction Reynolds +factor + +.. math:: + + \label{24.10)} + Re_{*t}^{f} =\left\{\begin{array}{l} {\frac{0.1291^{2} }{-1+1.928Re_{*t} } {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; 0.03}\le Re_{*t} \le 10} \\ {0.12^{2} \left(1-0.0858e^{-0.0617(Re_{*t} -10)} \right)^{2} {\rm \; for\; }Re_{*t} >10} \end{array}\right. + +and :math:`Re_{*t}` is the threshold friction Reynolds number +approximation for optimally sized particles + +.. math:: + + \label{24.11)} + Re_{*t} =0.38+1331\left(100D_{osp} \right)^{1.56} + +In equation , :math:`u_{*s}` ** is defined as the wind friction speed +(m s\ :math:`{}^{-1}`) accounting for the Owen effect (Owen 1964) + +.. math:: + + \label{24.12)} + u_{*s} =\left\{\begin{array}{l} {u_{*} {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; }U_{10} ` 1.0 would indicate a preference for the +heavier isotope. Currently, in all cases where Eq. is used to calculate +a :math:`{}^{13}`\ C flux, *f\ :math:`{}_{frac}`* is set to 1.0. + +For :math:`{}^{1}`\ :math:`{}^{4}`\ C, no fractionation is used in +either the initial photosynthetic step, nor in subsequent fluxes from +upstream to downstream pools; as discussed below, this is because +observations of :math:`{}^{1}`\ :math:`{}^{4}`\ C are typically +described in units that implicitly correct out the fractionation of +:math:`{}^{1}`\ :math:`{}^{4}`\ C by referencing them to +:math:`{}^{1}`\ :math:`{}^{3}`\ C ratios. + +Isotope Symbols, Units, and Reference Standards +---------------------------------------------------- + +Carbon has two primary stable isotopes, :math:`{}^{12}`\ C and +:math:`{}^{13}`\ C. :math:`{}^{12}`\ C is the most abundant, comprising +about 99% of all carbon. The isotope ratio of a compound, +*R\ :math:`{}_{A}`*, is the mass ratio of the rare isotope to the +abundant isotope + +.. math:: + + \label{25.2)} + R_{A} =\frac{{}^{13} C_{A} }{{}^{12} C_{A} } . + +Carbon isotope ratios are often expressed using delta notation, +:math:`\deltaup`. The :math:`\deltaup`\ :math:`{}^{13}`\ C value of a +compound A, :math:`\deltaup`\ :math:`{}^{13}`\ C\ :math:`{}_{A}`, is the +difference between the isotope ratio of the compound, +*R\ :math:`{}_{A}`*, and that of the Pee Dee Belemnite standard, +*R\ :math:`{}_{PDB}`*, in parts per thousand + +.. math:: + + \label{25.3)} + \delta ^{13} C_{A} =\left(\frac{R_{A} }{R_{PDB} } -1\right)\times 1000 + +where *R\ :math:`{}_{PDB}`* = 0.0112372, and units of :math:`\deltaup` +are per mil (‰). + +Isotopic fractionation can be expressed in several ways. One expression +of the fractionation factor is with alpha (:math:`\alphaup`) notation. +For example, the equilibrium fractionation between two reservoirs A and +B can be written as: + +.. math:: + + \label{25.4)} + \alpha _{A-B} =\frac{R_{A} }{R_{B} } =\frac{\delta _{A} +1000}{\delta _{B} +1000} . + +This can also be expressed using epsilon notation +(:math:`\varepsilonup`), where + +.. math:: + + \label{25.5)} + \alpha _{A-B} =\frac{\varepsilon _{A-B} }{1000} +1 + +In other words, if :math:`{\varepsilon }_{A-B}=4.4\mathrm{\textrm{‰}}`, +then :math:`\alphaup`\ :math:`{}_{A-B}`\ =1.0044. + +In addition to the stable isotopes :math:`{}^{1}`\ :math:`{}^{2}`\ C and +:math:`{}^{1}`\ :math:`{}^{3}`\ C, the unstable isotope +:math:`{}^{1}`\ :math:`{}^{4}`\ C is included in CLM. +:math:`{}^{1}`\ :math:`{}^{4}`\ C can also be described using the delta +notation: + +.. math:: + + \label{25.6)} + \delta ^{14} C=\left(\frac{A_{s} }{A_{abs} } -1\right)\times 1000 + +However, observations of :math:`{}^{1}`\ :math:`{}^{4}`\ C are typically +fractionation-corrected using the following notation: + +.. math:: + + \label{25.7)} + \Delta {}^{14} C=1000\times \left(\left(1+\frac{\delta {}^{14} C}{1000} \right)\frac{0.975^{2} }{\left(1+\frac{\delta {}^{13} C}{1000} \right)^{2} } -1\right) + +where :math:`\deltaup`\ :math:`{}^{14}`\ C is the measured isotopic +fraction and :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C corrects for +mass-dependent isotopic fractionation processes (assumed to be 0.975 for +fractionation of :math:`{}^{13}`\ C by photosynthesis). CLM assumes a +background preindustrial atmospheric :math:`{}^{14}`\ C /C ratio of +10\ :math:`{}^{-12}`, which is used for A\ :math:`{}_{abs}`. For the +reference standard A\ :math:`{}_{abs}`, which is a plant tissue and has +a :math:`\deltaup`\ :math:`{}^{13}`\ C value is :math:`\mathrm{-}`\ 25 ‰ +due to photosynthetic discrimination, +:math:`\deltaup`\ :math:`{}^{14}`\ C = +:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C. For CLM, in order to use +the :math:`{}^{14}`\ C model independently of the :math:`{}^{13}`\ C +model, for the :math:`{}^{14}`\ C calculations, this fractionation is +set to zero, such that the 0.975 term becomes 1, the +:math:`\deltaup`\ :math:`{}^{13}`\ C term (for the calculation of +:math:`\deltaup`\ :math:`{}^{14}`\ C only) becomes 0, and thus +:math:`\deltaup`\ :math:`{}^{14}`\ C = +:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C. + +Carbon Isotope Discrimination During Photosynthesis +-------------------------------------------------------- + +Photosynthesis is modeled in CLM as a two-step process: diffusion of +CO\ :math:`{}_{2}` into the stomatal cavity, followed by enzymatic +fixation (Chapter 8). Each step is associated with a kinetic isotope +effect. The kinetic isotope effect during diffusion of +CO\ :math:`{}_{2}` through the stomatal opening is 4.4‰. The kinetic +isotope effect during fixation of CO\ :math:`{}_{2}` with Rubisco is +:math:`\sim`\ 30‰; however, since about 5-10% of carbon in C3 plants +reacts with phosphoenolpyruvate carboxylase (PEPC) (Melzer and O’Leary, +1987), the net kinetic isotope effect during fixation is +:math:`\sim`\ 27‰ for C3 plants. In C4 plant photosynthesis, only the +diffusion effect is important. The fractionation factor equations for C3 +and C4 plants are given below: + +For C4 plants, + +.. math:: + + \label{25.8)} + \alpha _{psn} =1+\frac{4.4}{1000} + +For C3 plants, + +.. math:: + + \label{25.9)} + \alpha _{psn} =1+\frac{4.4+22.6\frac{c_{i}^{*} }{pCO_{2} } }{1000} + +where :math:`{\alpha }_{psn}` is the fractionation factor, and +:math:`c^*_i` and pCO\ :math:`{}_{2}` are the revised intracellular and +atmospheric CO\ :math:`{}_{2}` partial pressure, respectively. + +As can be seen from the above equation, kinetic isotope effect during +fixation of CO\ :math:`{}_{2}` is dependent on the intracellular +CO\ :math:`{}_{2}` concentration, which in turn depends on the net +carbon assimilation. That is calculated during the photosynthesis +calculation as follows: + +.. math:: + + \label{25.10)} + c_{i} =pCO_{2} -a_{n} p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } + +and + +.. math:: + + \label{25.11)} + c_{i}^{*} =pCO_{2} -a_{n} \left(1-d\right)p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } + +where :math:`a_n` is net carbon assimilation during photosynthesis, +:math:`d` is downscaling factor due to nitrogen limitation, :math:`p` is +atmospheric pressure, :math:`g_b` is leaf boundary layer conductance, +and :math:`g_s` is leaf stomatal conductance. + +The fractionation factor :math:`{\alpha }_{psn}` and net assimilation +:math:`a_n` are calculated during the radiation time-step in +CanopyFluxesMod.F90, whereas the downscaling factor :math:`d` is not +calculated until after the nitrogen limitation is computed in +CNAllocationMod.F90. That results in a difference between the actual +photosynthesis, which is downscaled by :math:`d`, and the potential +photosynthesis. In order to overcome this mismatch, downscaling due to +nitrogen limitation is factored in the calculation of the kinetic +isotope effect during fixation by defining a downscaled version of +intracellular CO\ :math:`{}_{2}` (:math:`c^*_i`), as a first order +approximation. However, since nitrogen down-regulation is calculated +after the photosynthesis calculation, down-regulation coefficient +calculated in the previous time step needs to be used. + +Isotopic fractionation code is compatible with multi-layered canopy +parameterization; i.e., it is possible to calculate varying +discrimination rates for each layer of a multi-layered canopy. However, +as with the rest of the photosynthesis model, the number of canopy +layers is currently set to one by default. + +:math:`{}^{14}`\ C radioactive decay and historical atmospheric :math:`{}^{14}`\ C concentrations +------------------------------------------------------------------------------------------------------ + +In the preindustrial biosphere, radioactive decay of :math:`{}^{14}`\ C +in carbon pools allows dating of long-term age since photosynthetic +uptake; while over the 20\ :math:`{}^{th}` century, radiocarbon in the +atmosphere was first diluted by radiocarbon-free fossil fuels and then +enriched by aboveground thermonuclear testing to approximately double +its long-term mean concentration. CLM includes both of these processes +to allow comparison of carbon that may vary on multiple timescales with +observed values. + +For radioactive decay, at each timestep all :math:`{}^{14}`\ C pools are +reduced at a rate of –log/:math:`\tau`, where :math:`\tau` is the +half-life (Libby half-life value of 5568 years). In order to rapidly +equilibrate the long-lived pools during accelerated decomposition +spinup, the radioactive decay of the accelerated pools is also +accelerated by the same degree as the decomposition, such that the +:math:`{}^{14}`\ C value of these pools is in equilibrium when taken out +of the spinup mode. + +For variation of atmospheric :math:`{}^{14}`\ C over the historical +period, :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C values can be set to +either fixed concentration (:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C += 0‰) or time-varying concentrations read in from a file. A default file +is provided that is based on a spline fit through several observational +datasets spanning the 20\ :math:`{}^{th}` century: (Levin and Kromer, +2004; Manning and Melhuish, 1994; Nydal and Lövseth, 1996; Turnbull et +al. 2007). This is shown in Figure 25.1. + +Figure 25.1. Atmospheric :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C +used to drive :math:`{}^{14}`\ C model over the historical period. + +|image| + +.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst b/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst new file mode 100644 index 0000000000..9bf3495e0c --- /dev/null +++ b/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst @@ -0,0 +1,210 @@ +.. math:: 1 + +Offline Mode +================ + +In offline mode (uncoupled to an atmospheric model), the atmospheric +forcing required by CLM (Table 2.3) is supplied by observed datasets. +The standard forcing provided with the model is a 110-year (1901-2010) +dataset (CRUNCEP; Viovy 2011) that is a combination of two existing +datasets; the CRU TS3.2 0.5\ :math:`{}^\circ` X 0.5\ :math:`{}^\circ` +monthly data covering the period 1901 to 2002 (Mitchell and Jones 2005) +and the NCEP reanalysis 2.5\ :math:`{}^\circ` X 2.5\ :math:`{}^\circ` +6-hourly data covering the period 1948 to 2010. The CRUNCEP dataset has +been used to force CLM for studies of vegetation growth, +evapotranspiration, and gross primary production (Mao et al. 2012, Mao +et al. 2013, Shi et al. 2013) and for the TRENDY (trends in net +land-atmosphere carbon exchange over the period 1980-2010) project (Piao +et al. 2012). Version 4 is used here (Viovy 2011). Alternative forcing +datasets can also be used (e.g., the Qian et al. (2006) dataset used for +previous versions of CLM is still available). + +Here, the CRUNCEP dataset, which does not include data over oceans, +lakes, and Antarctica is modified. This missing data is filled with Qian +et al. (2006) data from 1948 that is interpolated by the data atmosphere +model to the 0.5\ :math:`{}^\circ` CRUNCEP grid. This allows the model +to be run over Antarctica and ensures data is available along coastlines +regardless of model resolution. + +The forcing data is ingested into a data atmosphere model in three +“streamsâ€; precipitation (:math:`P`) (mm s\ :math:`{}^{-1}`), solar +radiation (:math:`S_{atm}` ) (W m\ :math:`{}^{-2}`), and four other +fields [atmospheric pressure :math:`P_{atm}` (Pa), atmospheric specific +humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`), atmospheric +temperature :math:`T_{atm}` (K), and atmospheric wind :math:`W_{atm}` +(m s\ :math:`{}^{-1}`)]. These are separate streams because they are +handled differently according to the type of field. In the CRUNCEP +dataset, the precipitation stream is provided at six hour intervals and +the data atmosphere model prescribes the same precipitation rate for +each model time step within the six hour period. The four fields that +are grouped together in another stream (pressure, humidity, temperature, +and wind) are provided at six hour intervals and the data atmosphere +model linearly interpolates these fields to the time step of the model. + +The total solar radiation is also provided at six hour intervals. The +data is fit to the model time step using a diurnal function that depends +on the cosine of the solar zenith angle :math:`\mu` to provide a +smoother diurnal cycle of solar radiation and to ensure that all of the +solar radiation supplied by the six-hourly forcing data is actually +used. The solar radiation at model time step :math:`t_{M}` is + +.. math:: + + \label{ZEqnNum160435} + \begin{array}{l} {S_{atm} \left(t_{M} \right)=\frac{\frac{\Delta t_{FD} }{\Delta t_{M} } S_{atm} \left(t_{FD} \right)\mu \left(t_{M} \right)}{\sum _{i=1}^{\frac{\Delta t_{FD} }{\Delta t_{M} } }\mu \left(t_{M_{i} } \right) } \qquad {\rm for\; }\mu \left(t_{M} \right)>0.001} \\ {S_{atm} \left(t_{M} \right)=0\qquad {\rm for\; }\mu \left(t_{M} \right)\le 0.001} \end{array} + +where :math:`\Delta t_{FD}` is the time step of the forcing data (6 +hours :math:`\times` 3600 seconds hour\ :math:`{}^{-1}` = 21600 +seconds), :math:`\Delta t_{M}` is the model time step (seconds), +:math:`S_{atm} \left(t_{FD} \right)` is the six-hourly solar radiation +from the forcing data (W m\ :math:`{}^{-2}`), and +:math:`\mu \left(t_{M} \right)` is the cosine of the solar zenith angle +at model time step :math:`t_{M}` (section 3.3). The term in the +denominator of equation is the sum of the cosine of the solar zenith +angle for each model time step falling within the six hour period. For +numerical purposes, :math:`\mu \left(t_{M_{i} } \right)\ge 0.001`. + +The total incident solar radiation :math:`S_{atm}` at the model time +step :math:`t_{M}` is then split into near-infrared and visible +radiation and partitioned into direct and diffuse according to factors +derived from one year’s worth of hourly CAM output from CAM version +cam3\_5\_55 as + +.. math:: + + \label{26.2)} + S_{atm} \, \downarrow _{vis}^{\mu } =R_{vis} \left(\alpha S_{atm} \right) + +.. math:: + + \label{26.3)} + S_{atm} \, \downarrow _{nir}^{\mu } =R_{nir} \left[\left(1-\alpha \right)S_{atm} \right] + +.. math:: + + \label{26.4)} + S_{atm} \, \downarrow _{vis} =\left(1-R_{vis} \right)\left(\alpha S_{atm} \right) + +.. math:: + + \label{26.5)} + S_{atm} \, \downarrow _{nir} =\left(1-R_{nir} \right)\left[\left(1-\alpha \right)S_{atm} \right]. + +where :math:`\alpha` , the ratio of visible to total incident solar +radiation, is assumed to be + +.. math:: + + \label{26.6)} + \alpha =\frac{S_{atm} \, \downarrow _{vis}^{\mu } +S_{atm} \, \downarrow _{vis}^{} }{S_{atm} } =0.5. + +The ratio of direct to total incident radiation in the visible +:math:`R_{vis}` is + +.. math:: + + \label{26.7)} + R_{vis} =a_{0} +a_{1} \times \alpha S_{atm} +a_{2} \times \left(\alpha S_{atm} \right)^{2} +a_{3} \times \left(\alpha S_{atm} \right)^{3} \qquad 0.01\le R_{vis} \le 0.99 + +and in the near-infrared :math:`R_{nir}` is + +.. math:: + + \label{26.8)} + R_{nir} =b_{0} +b_{1} \times \left(1-\alpha \right)S_{atm} +b_{2} \times \left[\left(1-\alpha \right)S_{atm} \right]^{2} +b_{3} \times \left[\left(1-\alpha \right)S_{atm} \right]^{3} \qquad 0.01\le R_{nir} \le 0.99 + +where +:math:`a_{0} =0.17639,\, a_{1} =0.00380,\, a_{2} =-9.0039\times 10^{-6} ,\, a_{3} =8.1351\times 10^{-9}` +and +:math:`b_{0} =0.29548,b_{1} =0.00504,b_{2} =-1.4957\times 10^{-5} ,b_{3} =1.4881\times 10^{-8}` +are coefficients from polynomial fits to the placeCAM data. + +The additional atmospheric forcing variables required by Table 2.3 are +derived as follows. The atmospheric reference height :math:`z'_{atm}` +(m) is set to 30 m. The directional wind components are derived as +:math:`u_{atm} =v_{atm} ={W_{atm} \mathord{\left/ {\vphantom {W_{atm} \sqrt{2} }} \right. \kern-\nulldelimiterspace} \sqrt{2} }` . +The potential temperature :math:`\overline{\theta _{atm} }` (K) is set +to the atmospheric temperature :math:`T_{atm}` . The atmospheric +longwave radiation :math:`L_{atm} \, \downarrow` (W m\ :math:`{}^{-2}`) +is derived from the atmospheric vapor pressure :math:`e_{atm}` and +temperature :math:`T_{atm}` (Idso 1981) as + +.. math:: + + \label{26.9)} + L_{atm} \, \downarrow =\left[0.70+5.95\times 10^{-5} \times 0.01e_{atm} \exp \left(\frac{1500}{T_{atm} } \right)\right]\sigma T_{atm}^{4} + +where + +.. math:: + + \label{26.10)} + e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } + +and :math:`\sigma` is the Stefan-Boltzmann constant (W +m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6). The fraction of +precipitation :math:`P` (mm s\ :math:`{}^{-1}`) falling as rain and/or +snow is + +.. math:: + + \label{ZEqnNum336485} + q_{rain} =P\left(f_{P} \right), + +.. math:: + + \label{26.12)} + q_{snow} =P\left(1-f_{P} \right) + +where + +.. math:: + + \label{26.13)} + f_{P} =0<0.5\left(T_{atm} -T_{f} \right)<1. + +The aerosol deposition rates :math:`D_{sp}` (14 rates as described in +Table 2.3) are provided by a time-varying, globally-gridded aerosol +deposition file developed by Lamarque et al. (2010). + +If the user wishes to provide atmospheric forcing data from another +source, the data format outlined above will need to be followed with the +following exceptions. The data atmosphere model will accept a +user-supplied relative humidity :math:`RH` (%) and derive specific +humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`) from + +.. math:: + + \label{26.14)} + q_{atm} =\frac{0.622e_{atm} }{P_{atm} -0.378e_{atm} } + +where the atmospheric vapor pressure :math:`e_{atm}` (Pa) is derived +from the water (:math:`T_{atm} >T_{f}` ) or ice +(:math:`T_{atm} \le T_{f}` ) saturation vapor pressure +:math:`e_{sat}^{T_{atm} }` as +:math:`e_{atm} =\frac{RH}{100} e_{sat}^{T_{atm} }` where :math:`T_{f}` +is the freezing temperature of water (K) (Table 2.6), and +:math:`P_{atm}` is the pressure at height :math:`z_{atm}` (Pa). The +data atmosphere model will also accept a user-supplied dew point +temperature :math:`T_{dew}` (K) and derive specific humidity +:math:`q_{atm}` from + +.. math:: + + \label{26.15)} + q_{atm} =\frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . + +Here, :math:`e_{sat}^{T}` , the saturation vapor pressure as a function +of temperature, is derived from Lowe’s (1977) polynomials. If not +provided by the user, the atmospheric pressure :math:`P_{atm}` (Pa) is +set equal to the standard atmospheric pressure :math:`P_{std} =101325` +Pa, and surface pressure :math:`P_{srf}` (Pa) is set equal +to\ :math:`P_{atm}` . + +The user may provide the total direct and diffuse solar radiation, +:math:`S_{atm} \, \downarrow ^{\mu }` and +:math:`S_{atm} \, \downarrow` . These will be time-interpolated using +the procedure described above and then each term equally apportioned +into the visible and near-infrared wavebands (e.g., +:math:`S_{atm} \, \downarrow _{vis}^{\mu } =0.5S_{atm} \, \downarrow ^{\mu }` , +:math:`S_{atm} \, \downarrow _{nir}^{\mu } =0.5S_{atm} \, \downarrow ^{\mu }` ). diff --git a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst new file mode 100644 index 0000000000..fb30a23e60 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst @@ -0,0 +1,1377 @@ +.. math:: 1 + +.. math:: 1 + +References +============== + +Aber, J.D., Melillo, J.M. and McClaugherty, C.A., 1990. Predicting +long-term patterns of mass loss, nitrogen dynamics, and soil organic +matter formation from initial fime litter chemistry in temperate forest +ecosystems. Canadian Journal of Botany, 68: 2201-2208. + +Aber, J.D., Goodale, C.L., Ollinger, S.V., Smith, M.-L., Magill, A.H., +Martin, M.E., Hallett, R.A., and Stoddard, J.L. 2003. Is nitrogen +deposition altering the nitrogen status of northeastern forests? +BioScience 53:375-389. + +Allen, C.B., Will, R.E., and Jacobson, M.A. 2005. Production efficiency +and radiation use efficiency of four tree species receiving irrigation +and fertilization. Forest Science 51:556-569. + +Anderson, E.A. 1976. A point energy and mass balance model of a snow +cover. NOAA Technical Report NWS 19, Office of Hydrology, National +Weather Service, Silver Spring, MD. + +André, J.-C., Goutorbe, J.-P., and Perrier, A. 1986. HAPEX-MOBILHY: A +hydrologic atmosphere experiment for the study of water budget and +evaporation flux at the climatic scale. Bull. Amer. Meteor. Soc. +67:138-144. + +Andrén, O. and Paustian, K., 1987. Barley straw decomposition in the +field: a comparison of models. Ecology 68:1190-1200. + +Arah, J.R.M. and Stephen, K.D., 1998. A model of the processes leading +to methane emission from peatland. Atmos. Environ. 32:3257-3264. + +Arah, J. and Vinten, A., 1995. Simplified models of anoxia and +denitrification in aggregated and simple-structured soils. European +Journal of Soil Science 46:507-517. + +Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global +Glacier Outlines Version: 1.0, Global Land Ice Measurements from Space, +Boulder Colorado, USA. Digital Media. + +Arora, V.K. and Boer, G.J. 2005. Fire as an interactive component of +dynamic vegetation models. J. Geophys. Res. 110:G02008. +DOI:10.1029/2005JG000042. + +Arya, S.P. 2001. Introduction to Meteorology. Academic Press, San Diego, +CA. + +Asner, G.P., Wessman, C.A., Schimel, D.S., and Archer, S. 1998. +Variability in leaf and litter optical properties: implications for BRDF +model inversions using AVHRR, MODIS, and MISR. Remote Sens. Environ. +63:243-257. + +Axelsson, E., and Axelsson, B. 1986. Changes in carbon allocation +patterns in spruce and pine trees following irrigation and +fertilization. Tree Phys. 2:189-204. + +Baird, A.J., Beckwith, C.W., Waldron, S. and Waddington, J.M., 2004. +Ebullition of methane-containing gas bubbles from near-surface Sphagnum +peat. Geophys. Res. Lett. 31. DOI:10.1029/2004GL021157. + +Baldocchi, D., et al. 2001. FLUXNET: A new tool to study the temporal +and spatial variability of ecosystem-scale carbon dioxide, water vapor, +and energy flux densities. Bull. Amer. Meteor. Soc. 82:2415-2433. + +Barbottin, A., Lecomte, C., Bouchard, C., and Jeuffroy, M.-H. 2005. +Nitrogen remobilization during grain filling in wheat: Genotypic and +environmental effects. Crop Sci. 45:1141-1150. + +Batjes, N.H., 2006. ISRIC-WISE derived soil properties on a 5 by 5 +arc-minutes global grid. Report 2006/02 (available through : +http://www.isric.org) + +Berger, A.L. 1978a. Long-term variations of daily insolation and +quaternary climatic changes. J. Atmos. Sci. 35:2362-2367. + +Berger, A.L. 1978b. A simple algorithm to compute long-term variations +of daily or monthly insolation. Contribution de l’Institut d’Astronomie +et de Géophysique, Université Catholique de Louvain, Louvain-la-Neuve, +No. 18. + +Berger, A., Loutre, M.-F., and Tricot, C. 1993. Insolation and Earth’s +orbital periods. J. Geophys. Res. 98:10341-10362. + +Berkowitz, B., and Balberg, I. 1992. Percolation approach to the problem +of hydraulic conductivity in porous media. Transport in Porous Media +9:275–286. + +Beven, K.J., and Kirkby, M.J. 1979. A physically based variable +contributing area model of basin hydrology. Hydrol. Sci. Bull. 24:43-69. + +Bohren, C. F., and Huffman, D. R. 1983. Absorption and scattering of +light by small particles. John Wiley & Sons, New York, NY. + +Bonan, G.B. 1996. A land surface model (LSM version 1.0) for ecological, +hydrological, and atmospheric studies: Technical description and user’s +guide. NCAR Technical Note NCAR/TN-417+STR, National Center for +Atmospheric Research, Boulder, CO, 150 pp. + +Bonan, G.B. 1998. The land surface climatology of the NCAR Land Surface +Model coupled to the NCAR Community Climate Model. J. Climate +11:1307-1326. + +Bonan, G.B. 2002. Ecological Climatology: Concepts and Applications. +Cambridge University Press. + +Bonan, G.B., Oleson, K.W., Vertenstein, M., Levis, S., Zeng, X., Dai, +Y., Dickinson, R.E., and Yang, Z.-L. 2002a. The land surface climatology +of the Community Land Model coupled to the NCAR Community Climate Model. +J. Climate 15: 3123-3149. + +Bonan, G.B., Levis, S., Kergoat, L., and Oleson, K.W. 2002b. Landscapes +as patches of plant functional types: An integrating concept for climate +and ecosystem models. Global Biogeochem. Cycles 16: 5.1-5.23. + +Bonan, G.B., and Levis, S. 2006. Evaluating aspects of the Community +Land and Atmosphere Models (CLM3 and CAM3) using a dynamic global +vegetation model. J. Climate 19:2290-2301. + +Bonan, G.B., Lawrence P.J., Oleson K.W., Levis S., Jung M., Reichstein +M., Lawrence, D.M., and Swenson, S.C. 2011. Improving canopy processes +in the Community Land Model (CLM4) using global flux fields empirically +inferred from FLUXNET data. J. Geophys. Res. 116, G02014. +DOI:10.1029/2010JG001593. + +Bonan, G. B., Oleson, K.W., Fisher, R.A., Lasslop, G., and Reichstein, +M. 2012. Reconciling leaf physiological traits and canopy flux data: Use +of the TRY and FLUXNET databases in the Community Land Model version 4, +J. Geophys. Res., 117, G02026. DOI:10.1029/2011JG001913. + +Branstetter, M.L., and Famiglietti, J.S. 1999. Testing the sensitivity +of GCM-simulated runoff to climate model resolution using a parallel +river transport algorithm. Preprints, 14\ :math:`{}^{th}` Conference on +Hydrology, Dallas, TX, Amer. Meteor. Soc., 391-392. + +Branstetter, M.L. 2001. Development of a parallel river transport +algorithm and applications to climate studies. Ph.D. dissertation, +University of Texas at Austin. + +Brun, E. 1989. Investigation of wet-snow metamorphism in respect of +liquid water content. Ann. Glaciol. 13:22-26. + +Bugmann, H., and Solomon, A.M. 2000. Explaining forest composition and +biomass across multiple biogeographical regions. Ecol. Appl. 10:95-114. + +Busing, R.T. 2005. Tree mortality, canopy turnover, and woody detritus +in old cove forests of the southern Appalachians. Ecology 86:73-84. + +Campbell, G.S., and Norman, J.M. 1998. An Introduction to Environmental +Biophysics (2:math:`{}^{nd}` edition). Springer-Verlag, New York. + +Castillo, G., Kendra, C., Levis, S., and Thornton, P. 2012. Evaluation +of the new CNDV option of the Community Land Model: effects of dynamic +vegetation and interactive nitrogen on CLM4 means and variability. J. +Climate 25:3702–3714. + +Cao, M., Marshall, S. and Gregson, K., 1996. Global carbon exchange and +methane emissions from natural wetlands: Application of a process-based +model. J. Geophys. Res. 101(D9):14,399-14,414. + +Churkina, G. et al., 2003. Analyzing the ecosystem carbon dynamics of +four European coniferous forests using a biogeochemistry model. +Ecosystems, 6: 168-184. + +CIESIN: Gridded population of the world version 3 (GPWv3), 2005. +Population density grids, Technical report, Socioeconomic Data and +Applications Center (SEDAC), Columbia University, Palisades, New York, +USA. + +Clapp, R.B., and Hornberger, G.M. 1978. Empirical equations for some +soil hydraulic properties. Water Resour. Res. 14:601-604. + +Clauser, C., and Huenges, E. 1995. Thermal conductivity of rocks and +minerals. pp. 105-126. In: T. J. Ahrens (editor) Rock Physics and Phase +Relations: A Handbook of Physical Constants. Washington, D.C. + +Cleveland, C.C., Townsend, A.R., Schimel, D.S., Fisher, H., Howarth, +R.W., Hedin, L.O., Perakis, S.S., Latty, E.F., Von Fischer, J.C., +Elseroad, A., and Wasson, M.F. 1999. Global patterns of terrestrial +biological nitrogen (N2) fixation in natural ecosystems. Global +Biogeochem. Cycles 13:623-645. + +Collatz, G.J., Ball, J.T., Grivet, C., and Berry, J.A. 1991. +Physiological and environmental regulation of stomatal conductance, +photosynthesis, and transpiration: A model that includes a laminar +boundary layer. Agric. For. Meteor. 54:107-136. + +Collatz, G.J., Ribas-Carbo, M., and Berry, J.A. 1992. Coupled +photosynthesis-stomatal conductance model for leaves of +C\ :math:`{}_{4}` plants. Aust. J. Plant Physiol. 19:519-538. + +Colmer, T.D., 2003. Long-distance transport of gases in plants: a +perspective on internal aeration and radial oxygen loss from roots. +Plant Cell and Environment 26:17-36. + +Conway, H., Gades, A., and Raymond, C.F. 1996. Albedo of dirty snow +during conditions of melt. Water Resour. Res. 32:1713-1718. + +Cosby, B.J., Hornberger, G.M., Clapp, R.B., and Ginn, T.R. 1984. A +statistical exploration of the relationships of soil moisture +characteristics to the physical properties of soils. Water Resour. Res. +20:682-690. + +Crawford, T. W., Rendig, V. V., and Broadent, F. E. 1982. Sources, +fluxes, and sinks of nitrogen during early reproductive growth of maize +(Zea mays L.). Plant Physiol. 70:1645-1660. + +Dai, Y., and Zeng, Q. 1997. A land surface model (IAP94) for climate +studies. Part I: formulation and validation in off-line experiments. +Adv. Atmos. Sci. 14:433-460. + +Dai, Y., et al. 2001. Common Land Model: Technical documentation and +user’s guide [Available online at +http://climate.eas.gatech.edu/dai/clmdoc.pdf]. + +Dai, Y., Zeng, X., Dickinson, R.E., Baker, I., Bonan, G.B., Bosilovich, +M.G., Denning, A.S., Dirmeyer, P.A., Houser, P.R., Niu, G., Oleson, +K.W., Schlosser, C.A., and Yang, Z.-L. 2003. The Common Land Model. +Bull. Amer. Meteor. Soc. 84:1013-1023. + +Dai, Y., Dickinson, R.E., and Wang, Y.-P. 2004. A two-big-leaf model for +canopy temperature, photosynthesis, and stomatal conductance. J. Climate +17:2281-2299. + +Dai, A., and Trenberth, K.E. 2002. Estimates of freshwater discharge +from continents: Latitudinal and seasonal variations. J. Hydrometeor. +3:660-687. + +DeFries, R.S., Hansen, M.C., Townshend, J.R.G., Janetos, A.C., and +Loveland, T.R. 2000. A new global 1-km dataset of percentage tree cover +derived from remote sensing. Global Change Biol. 6:247-254. + +Degens, B. and Sparling, G., 1996. Changes in aggregation do not +correspond with changes in labile organic C fractions in soil amended +with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): +453-462. + +de Vries, D.A. 1963. Thermal Properties of Soils. In: W.R. van Wijk +(editor) Physics of the Plant Environment. North-Holland, Amsterdam. + +Dickinson, R.E. 1983. Land surface processes and climate-surface albedos +and energy balance. Adv. Geophys. 25:305-353. + +Dickinson, R.E., Henderson-Sellers, A., and Kennedy, P.J. 1993. +Biosphere-Atmosphere Transfer Scheme (BATS) version 1e as coupled to the +NCAR Community Climate Model. NCAR Technical Note NCAR/TN-387+STR. +National Center for Atmospheric Research, Boulder, CO. + +Dickinson, R.E., Oleson, K.W., Bonan, G., Hoffman, F., Thornton, P., +Vertenstein, M., Yang, Z.-L., and Zeng, X. 2006. The Community Land +Model and its climate statistics as a component of the Community Climate +System Model. J. Climate 19:2302-2324. + +Dingman, S.L. 2002. Physical Hydrology. Second Edition. Prentice Hall, +NJ. + +Dirmeyer, P.A., Dolman, A.J., and Sato, N. 1999. The pilot phase of the +Global Soil Wetness Project. Bull. Amer. Meteor. Soc. 80:851-878. + +Dobson, J.E., Bright, E.A., Coleman, P.R., Durfee, R.C., and Worley, +B.A. 2000. LandScan: A global population database for estimating +populations at risk. Photogramm. Eng. Rem. Sens. 66:849-857. + +Dorman, J.L., and Sellers, P.J. 1989. A global climatology of albedo, +roughness length and stomatal resistance for atmospheric general +circulation models as represented by the simple biosphere model (SiB). +J. Appl. Meteor. 28:833-855. + +Dougherty, R.L., Bradford, J.A., Coyne, P.I., and Sims, P.L. 1994. +Applying an empirical model of stomatal conductance to three C4 grasses. +Agric. For. Meteor. 67:269-290. + +Drewniak, B., Song, J., Prell, J., Kotamarthi, V.R., and Jacob, R. 2013. +Modeling agriculture in the Community Land Model. Geosci. Model Dev. +6:495-515. DOI:10.5194/gmd-6-495-2013. + +Dunfield, P., Knowles, R., Dumont, R. and Moore, T.R., 1993. Methane +Production and Consumption in Temperate and Sub-Arctic Peat Soils - +Response to Temperature and Ph. Soil Biology & Biochemistry 25:321-326. + +Entekhabi, D., and Eagleson, P.S. 1989. Land surface hydrology +parameterization for atmospheric general circulation models including +subgrid scale spatial variability. J. Climate 2:816-831. + +Fang, X. and Stefan, H.G., 1996. Long-term lake water temperature and +ice cover simulations/measurements. Cold Regions Science and Technology +24:289-304. + +Farouki, O.T. 1981. The thermal properties of soils in cold regions. +Cold Regions Sci. and Tech. 5:67-75. + +Farquhar, G.D., von Caemmerer, S., and Berry, J.A. 1980. A biochemical +model of photosynthetic CO\ :math:`{}_{2}` assimilation in leaves of +C\ :math:`{}_{3}` species. Planta 149:78-90. + +Farquhar, G.D., and von Caemmerer, S. 1982. Modeling of photosynthetic +response to environmental conditions. pp. 549-587. In: O.L. Lange, P.S. +Nobel, C.B. Osmond, and H. Zeigler (editors) Encyclopedia of Plant +Physiology. Vol. 12B. Physiological Plant Ecology. II. Water Relations +and Carbon Assimilation. Springer-Verlag, New York. + +Ferrari, J.B., 1999. Fine-scale patterns of leaf litterfall and nitrogen +cycling in an old-growth forest. Canadian Journal of Forest Research, +29: 291-302. + +Firestone, M.K. and Davidson, E.A. 1989. Exchange of Trace Gases between +Terrestrial Ecosystems and the Atmosphere. In: M.O. Andreae and D.S. +Schimel (Editors). John Wiley and Sons, pp. 7-21. + +Flanner, M.G., and Zender. C.S. 2005. Snowpack radiative heating: +Influence on Tibetan Plateau climate. Geophys. Res. Lett. 32:L06501. +DOI:10.1029/2004GL022076. + +Flanner, M.G., and Zender, C.S. 2006. Linking snowpack microphysics and +albedo evolution. J. Geophys. Res. 111:D12208. DOI:10.1029/2005JD006834. + +Flanner, M.G., Zender, C.S., Randerson, J.T., and Rasch, P.J. 2007. +Present day climate forcing and response from black carbon in snow. J. +Geophys. Res. 112:D11202. DOI:10.1029/2006JD008003. + +Flatau, P.J., Walko, R.L., and Cotton, W.R. 1992. Polynomial fits to +saturation vapor pressure. J. Appl. Meteor. 31:1507-1513. + +Friedl, M.A., McIver, D.K., Hodges, J.C.F., Zhang, X.Y., Muchoney, D., +Strahler, A.H., Woodcock, C.E., Gopal, S., Schneider, A., Cooper, A., +Baccini, A., Gao, F., and Schaaf, C. 2002. Global land cover mapping +from MODIS: algorithms and early results. Remote Sens. Environ. +83:287-302. + +Frolking, S., et al. 2001. Modeling Northern Peatland Decomposition and +Peat Accumulation. Ecosystems. 4:479-498. + +Gallais, A., Coque, M. Quillere, I., Prioul, J., and Hirel, B. 2006. +Modeling postsilking nitrogen fluxes in maize (Zea mays) using +15N-labeling field experiments. New Phytologist 172:696-707. + +Gallais, A., Coque, M., Gouis, J. L., Prioul, J. L., Hirel, B., and +Quillere, I. 2007. Estimating the proportion of nitrogen remobilization +and of postsilking nitrogen uptake allocated to maize kernels by +Nitrogen-15 labeling. Crop Sci. 47:685-693. + +Galloway, J.N., et al. 2004. Nitrogen cycles: past, present, and future. +Biogeochem. 70:153-226. + +Garcia, R.L., Kanemasu, E.T., Blad, B.L., Bauer, A., Hatfield, J.L., +Major, D.A., Reginato, R.J., and Hubbard, K.G. 1988. Interception and +use efficiency of light in winter wheat under different nitrogen +regimes. Agric. For. Meteor. 44:175-186. + +Gash, J.H.C., Nobre, C.A., Roberts, J.M., and Victoria, R.L. 1996. An +overview of ABRACOS. pp. 1-14. In: J.H.C. Gash, C.A. Nobre, J.M. +Roberts, and R.L. Victoria (editors) Amazonian Deforestation and +Climate. John Wiley and Sons, Chichester, England. + +Gholz, H.L., Perry, C.S., Cropper, W.P., Jr. and Hendry, L.C., 1985. +Litterfall, decomposition, and nitrogen and phosphorous dynamics in a +chronosequence of slash pine (*Pinus elliottii*) plantations. Forest +Science, 31: 463-478. + +Giglio, L., Csiszar, I., and Justice, C.O. 2006. Global distribution and +seasonality of active fires as observed with the Terra and Aqua Moderate +Resolution Imaging Spectroradiometer (MODIS) sensors. J. Geophys. Res. +111:G02016. DOI:10.1029/2005JG000142. + +Global Soil Data Task 2000. Global soil data products CD-ROM (IGBP-DIS). +International Geosphere-Biosphere Programme-Data and Information +Available Services [Available online at http://www.daac.ornl.gov]. + +Gomes, E.P.C., Mantovani, W., and Kageyama, P.Y. 2003. Mortality and +recruitment of trees in a secondary montane rain forest in southeastern +Brazil. Brazilian Journal of Biology 63:47-60. + +Gosz, J.R., Likens, G.E., and Bormann, F.H. 1973. Nutrient release from +decomposing leaf and branch litter in the Hubbard Brook Forest, New +Hampshire. Ecological Monographs 43:173-191. + +Gotangco Castillo C., Levis S., and Thornton P. 2012. Evaluation of the +new CNDV option of the Community Land Model: Effects of dynamic +vegetation and interactive nitrogen on CLM4 means and variability. J. +Climate 25:3702-3714. DOI:10.1175/JCLID-11-00372.1. + +Graham, S.T., Famiglietti, J.S., and Maidment, D.R. 1999. Five-minute, +1/2º, and 1º data sets of continental watersheds and river networks for +use in regional and global hydrologic and climate system modeling +studies. Water Resour. Res. 35:583-587. + +Grenfell, T.C., and Warren, S.G. 1999. Representation of a nonspherical +ice particle by a collection of independent spheres for scattering and +absorption of radiation. J. Geophys. Res. 104(D24):37697-37709. + +del Grosso, S.J., et al. 2000. General model for N2O and N2 gas +emissions from soils due to dentrification. Global Biogeochem. Cycles +14:1045-1060. + +Guenther, A., Hewitt, C.N., Erickson, D., Fall, R., Geron, C., Graedel, +T., Harley, P., Klinger, L., Lerdau, M., McKay, W.A., Pierce, T., +Scholes, B., Steinbrecher, R., Tallamraju, R., Taylor, J., and +Zimmerman, P. 1995. A global model of natural volatile organic compound +emissions. J. Geophys. Res. 100:8873-8892. + +Guenther, A., Karl, T., Harley, P., Wiedinmyer, C., Palmer. P.I., and +Geron, C. 2006. Estimates of global terrestrial isoprene emissions using +MEGAN (Model of Emissions of Gases and Aerosols from Nature). Atmos. +Chem. Phys. 6:3181–3210. + +Guenther, A. B., Jiang, X., Heald, C. L., Sakulyanontvittaya, T., Duhl, +T., Emmons, L. K., & Wang, X., 2012. The Model of Emissions of Gases and +Aerosols from Nature version 2.1 (MEGAN2.1): an extended and updated +framework for modeling biogenic emissions, Geosci. Model Dev., 5, +1471–1492. DOI:10.5194. + +Hack, J.J., Caron, J.M., Yeager, S.G., Oleson, K.W., Holland, M.M., +Truesdale, J.E., and Rasch, P.J. 2006. Simulation of the global +hydrological cycle in the CCSM Community Atmosphere Model version 3 +(CAM3): mean features. J. Climate 19:2199-2221. + +Hansen, M., DeFries, R.S., Townshend, J.R.G., Carroll, M., Dimiceli, C., +and Sohlberg, R.A. 2003. Global percent tree cover at a spatial +resolution of 500 meters: first results of the MODIS vegetation +continuous fields algorithm. Earth Interactions 7:1-15. + +Hastings, D.A., Dunbar, P.K., Elphingstone, G.M., Bootz, M., Murakami, +H., Maruyama, H., Masaharu, H., Holland, P., Payne, J., Bryant, N.A., +Logan, T.L., Muller, J.-P., Schreier, G., and MacDonald, J.S., eds., +1999. The Global Land One-kilometer Base Elevation (GLOBE) Digital +Elevation Model, Version 1.0. National Oceanic and Atmospheric +Administration, National Geophysical Data Center, 325 Broadway, Boulder, +Colorado 80305-3328, U.S.A. + +Heald, C.L., Henze, D.K., Horowitz, L.W., Feddema, J., Lamarque, J.-F., +Guenther, A., Hess, P.G., Vitt, F., Seinfeld, J.H., Goldstein, A.H., and +Fung, I. 2008. Predicted change in global secondary organic aerosol +concentrations in response to future climate, emissions, and land use +change. J. Geophys. Res. 113:D05211. DOI:10.1029/2007JD009092. + +Heald, C.L., Wilkinson, M.J., Monson, R.K., Alo, C.A., Wang, G.L., and +Guenther, A. 2009. Response of isoprene emission to ambient +CO\ :math:`{}_{2}` changes and implications for global budgets. Global +Change Biol. 15:1127-1140. DOI:10.1111/j.1365-2486.2008.01802.x + +Henderson-Sellers, B. 1985. New formulation of eddy diffusion +thermocline models. Appl. Math. Modelling 9:441-446. + +Henderson-Sellers, B. 1986. Calculating the surface energy balance for +lake and reservoir modeling: A review. Rev. Geophys. 24:625-649. + +Henderson-Sellers, A., Yang, Z.-L., and Dickinson, R.E. 1993. The +project for intercomparison of land-surface parameterization schemes. +Bull. Amer. Meteor. Soc. 74: 1335-1349. + +Hostetler, S.W., and Bartlein, P.J. 1990. Simulation of lake evaporation +with application to modeling lake level variations of Harney-Malheur +Lake, Oregon. Water Resour. Res. 26:2603-2612. + +Hostetler, S.W., Bates, G.T., and Giorgi, F. 1993. Interactive coupling +of a lake thermal model with a regional climate model. J. Geophys. Res. +98:5045-5057. + +Hostetler, S.W., Giorgi, F., Bates, G.T., and Bartlein, P.J. 1994. +Lake-atmosphere feedbacks associated with paleolakes Bonneville and +Lahontan. Science 263:665-668. + +Hou, Z., Huang, M., Leung, L.R., Lin, G., and Ricciuto, D.M. 2012. +Sensitivity of surface flux simulations to hydrologic parameters based +on an uncertainty quantification framework applied to the Community Land +Model. J. Geophys. Res. 117:D15108. + +Huang, M., and Liang, X. 2006. On the assessment of the impact of +reducing parameters and identification of parameter uncertainties for a +hydrologic model with applications to ungauged basins. J. Hydrol. +320:37-61. + +Hugelius, G., C. Tarnocai, G. Broll, J.G. Canadell, P. Kuhry, adn D.K. +Swanson, 2012. The Northern Circumpolar Soil Carbon Database: spatially +distributed datasets of soil coverage and soil carbon storage in the +northern permafrost regions. Earth Syst. Sci. Data Discuss., 5, 707-733 +(available online at (http://dev1.geo.su.se/bbcc/dev/ncscd/). + +Hunt, H.W., Ingham, E.R., Coleman, D.C., Elliott, E.T., and Reid, C.P.P. +1988. Nitrogen limitation of production and decomposition in prairie, +mountain meadow, and pine forest. Ecology 69:1009-1016. + +Hunt, E.R., Jr. and Running, S.W., 1992. Simulated dry matter yields for +aspen and spruce stands in the north american boreal forest. Canadian +Journal of Remote Sensing, 18: 126-133. + +Hunt, E.R., Jr. et al., 1996. Global net carbon exchange and +intra-annual atmospheric CO\ :math:`{}_{2}` concentrations predicted by +an ecosystem process model and three-dimensional atmospheric transport +model. Global Biogeochemical Cycles, 10: 431-456. + +Hurtt, G.C., Frolking, S., Fearon, M.G., Moore, B., Shevliakova, E., +Malyshev, S., Pacala, S.W., and Houghton, R.A. 2006. The underpinnings +of land-use history: three centuries of global gridded land-use +transitions, wood-harvest activity, and resulting secondary lands. +Global Change Biol. 12:1208-1229. + +Hurtt, G.C., et al. 2011. Harmonization of land-use scenarios for the +period 1500-2100: 600 years of global gridded annual land-use +transitions, wood harvest, and resulting secondary lands. Climatic +Change 109:117-161. DOI:10.1007/s10584-011-0153-2. + +Idso, S.B. 1981. A set of equations for full spectrum and 8- to +14-\ :math:`\mu` \ m and 10.5- to 12.5-\ :math:`\mu` \ m thermal +radiation from cloudless skies. Water Resour. Res. 17:295-304. + +Iiyama, I. and Hasegawa, S., 2005. Gas diffusion coefficient of +undisturbed peat soils. Soil Science and Plant Nutrition 51:431-435. + +Jackson, R. B., Canadell, J., Ehleringer, J. R., Mooney, H. A., Sala, O. +E., and Schulze, E. D. 1996. A global analysis of root distributions for +terrestrial biomes Oecologia 108:389–411. DOI:10.1007/BF00333714. + +Jackson, T.L., Feddema, J.J., Oleson, K.W., Bonan, G.B., and Bauer, J.T. +2010. Parameterization of urban characteristics for global climate +modeling. Annals of the Association of American Geographers. +100:848-865. + +Jenkinson, D. and Coleman, K. 2008. The turnover of organic carbon in +subsoils. Part 2. Modelling carbon turnover. European Journal of Soil +Science 59:400-413. + +Jordan, R. 1991. A One-dimensional Temperature Model for a Snow Cover: +Technical Documentation for SNTHERM.89. U.S. Army Cold Regions Research +and Engineering Laboratory, Special Report 91-16. + +Kattge, J., and Knorr, W. 2007. Temperature acclimation in a biochemical +model of photosynthesis: a reanalysis of data from 36 species. Plant +Cell Environ. 30:1176-1190. DOI:10.1111/j.1365-3040.2007.01690.x. + +Kattge, J., Knorr, W., Raddatz, T., and Wirth C. 2009: Quantifying +photosynthetic capacity and its relationship to leaf nitrogen content +for global–scale terrestrial biosphere models. Global Change Biol. +15:976–991. + +Keller, M., Palace, M., Asner, G.P., Pereira, R., Jr. and Silva, J.N.M., +2004. Coarse woody debris in undisturbed and logged forests in the +eastern Brazilian Amazon. Global Change Biology, 10: 784-795. + +Kellner, E., Baird, A.J., Oosterwoud, M., Harrison, K. and Waddington, +J.M., 2006. Effect of temperature and atmospheric pressure on methane +(CH4) ebullition from near-surface peats. Geophys. Res. Lett. 33. +DOI:10.1029/2006GL027509. + +Kimball, J.S., Thornton, P.E., White, M.A. and Running, S.W. 1997. +Simulating forest productivity and surface-atmosphere exchange in the +BOREAS study region. Tree Physiology 17:589-599. + +Kohyama, T., Suzuki, E., Partomihardjo, T., and Yamada, T. 2001. Dynamic +steady state of patch-mosaic tree size structure of a mixed diptocarp +forest regulated by local crowding. Ecological Research 16:85-98. + +Kourzeneva, E., 2009. Global dataset for the parameterization of lakes +in Numerical Weather Prediction and Climate modeling. ALADIN Newsletter, +No 37, July-December, 2009, F. Bouttier and C. Fischer, Eds., +Meteo-France, Toulouse, France, 46-53. + +Kourzeneva, E., 2010: External data for lake parameterization in +Numerical Weather Prediction and climate modeling. Boreal Environment +Research, 15, 165-177. + +Kourzeneva, E., Asensio, H., Martin, E. and Faroux, S., 2012. Global +gridded dataset of lake coverage and lake depth for use in numerical +weather prediction and climate modelling. Tellus A 64. + +Koven, C., et al. 2009. On the formation of high-latitude soil carbon +stocks: The effects of cryoturbation and insulation by organic matter in +a land surface model. Geophys. Res. Lett. 36: L21501. + +Koven, C.D., et al. 2011. Permafrost carbon-climate feedbacks accelerate +global warming. Proceedings of the National Academy of Sciences +108:14769-14774. + +Koven, C.D. et al. 2013. The effect of vertically-resolved soil +biogeochemistry and alternate soil C and N models on C dynamics of CLM4. +Biogeosciences Discussions 10:7201-7256. + +Kucharik, C.J., Foley, J.A., Delire, C., Fisher, V.A., Coe, M.T., +Lenters, J.D., Young-Molling, C., and Ramankutty, N. 2000. Testing the +performance of a dynamic global ecosystem model: water balance, carbon +balance, and vegetation structure. Global Biogeochem. Cycles 14: +795–825. + +Kucharik, C.J., and Brye, K.R. 2003. Integrated BIosphere Simulator +(IBIS) yield and nitrate loss predictions for Wisconsin maize receiving +varied amounts of nitrogen fertilizer. Journal of Environmental Quality +32: 247–268. + +Ladd, J.N., Jocteur-Monrozier, L. and Amato, M., 1992. Carbon turnover +and nitrogen transformations in an alfisol and vertisol amended with +[U-:math:`{}^{14}`\ C] glucose and [:math:`{}^{15}`\ N] ammonium +sulfate. Soil Biology and Biochemistry, 24: 359-371. + +Lamarque, J.-F., et al. 2010. Historical (1850-2000) gridded +anthropogenic and biomass burning emissions of reactive gases and +aerosols: methodology and application. Atmos. Chem. Phys. Discuss. +10:4963-5019. DOI:10.5194/acpd-10-4963-2010. + +Larcher, W. 1995. Physiological Plant Ecology, Springer-Verlag, Berlin +Heidelberg. + +Lavigne, M.B., and Ryan, M.G. 1997. Growth and maintenance respiration +rates of aspen, black spruce, and jack pine stems at northern and +southern BOREAS sites. Tree Phys. 17:543-551. + +Law, B.E., Sun, O.J., Campbell, J., Van Tuyl, S. and Thornton, P.E. +2003. Changes in carbon storage and fluxes in a chronosequence of +ponderosa pine. Global Change Biology, 9: 510-514. + +Lawrence, D.M., Thornton, P.E., Oleson, K.W., and Bonan, G.B. 2007. The +partitioning of evapotranspiration into transpiration, soil evaporation, +and canopy evaporation in a GCM: Impacts on land-atmosphere interaction. +J. Hydrometeor. 8:862-880. + +Lawrence, D.M., and Slater, A.G. 2008. Incorporating organic soil into a +global climate model. Clim. Dyn. 30. DOI:10.1007/s00382-007-0278-1. + +Lawrence, D.M., Slater, A.G., Romanovsky, V.E., and Nicolsky, D.J. 2008. +The sensitivity of a model projection of near-surface permafrost +degradation to soil column depth and inclusion of soil organic matter. +J. Geophys. Res. 113:F02011. DOI:10.1029/2007JF000883. + +Lawrence, D.M., K.W. Oleson, M.G. Flanner, P.E. Thornton, S.C. Swenson, +P.J. Lawrence, X. Zeng, Z.-L. Yang, S. Levis, K. Sakaguchi, G.B. Bonan, +and A.G. Slater, 2011. Parameterization improvements and functional and +structural advances in version 4 of the Community Land Model. J. Adv. +Model. Earth Sys. 3. DOI:10.1029/2011MS000045. + +Lawrence, P.J., and Chase, T.N. 2007. Representing a MODIS consistent +land surface in the Community Land Model (CLM 3.0). J. Geophys. Res. +112:G01023. DOI:10.1029/2006JG000168. + +Lawrence, P.J., and Chase, T.N. 2010. Investigating the climate impacts +of global land cover change in the Community Climate System Model. Int. +J. Climatol. 30:2066-2087. DOI:10.1002/joc.2061. + +Lawrence, P.J., et al. 2012. Simulating the biogeochemical and +biogeophysical impacts of transient land cover change and wood harvest +in the Community Climate System Model (CCSM4) from 1850 to 2100. J. +Climate 25:3071-3095. DOI:10.1175/JCLI-D-11-00256.1. + +Lehner, B. and Döll, P., 2004. Development and validation of a global +database of lakes, reservoirs and wetlands, J. Hydrol., 296, 1–22. + +Le Page, Y., van der Werf, G.R., Morton, D.C., and Pereira, J.M.C. 2010. +Modeling fire-driven deforestation potential in Amazonia under current +and projected climate conditions. J. Geophys. Res. 115:G03012. +DOI:10.1029/2009JG001190. + +Lerman, A., 1979. Geochemical processes: Water and sediment +environments. John Wiley and Sons, New York, N.Y. + +Letts, M.G., Roulet, N.T., Comer, N.T., Skarupa, M.R., and Verseghy, +D.L. 2000. Parametrization of peatland hydraulic properties for the +Canadian Land Surface Scheme. Atmos.-Ocean 38:141-160. + +Levin, I. and Kromer, B. 2004. The tropospheric 14CO2 level in +mid-latitudes of the Northern Hemisphere (1959-2003) Radiocarbon 46:1. + +Levis, S., Wiedinmyer, C., Bonan, G.B., and Guenther, A. 2003. +Simulating biogenic volatile organic compound emissions in the Community +Climate System Model. J. Geophys. Res. 108:4659. +DOI:10.1029/2002JD003203. + +Levis, S., Bonan, G.B., Vertenstein, M., and Oleson, K.W. 2004. The +community land model’s dynamic global vegetation model (CLM-DGVM): +technical description and user’s guide. NCAR Technical Note +NCAR/TN-459+STR. National Center for Atmospheric Research, Boulder, +Colorado. 50 pp. + +Levis, S., Thornton, P., Bonan, G., and Kucharik, C. 2009. Modeling land +use and land management with the Community Land Model. iLeaps +newsletter, No. 7. + +Levis, S., Bonan, G., Kluzek, E., Thornton, P., Jones, A., Sacks, W., +and Kucharik, C 2012. Interactive crop management in the Community Earth +System Model (CESM1): Seasonal influences on land-atmosphere fluxes. J. +Climate 25: 4839-4859. DOI:10.1175/JCLI-D-11-00446.1. + +Li, C., Aber, J., Stange, F., Butterbach-Bahl, K. and Papen, H. 2000. A +process-oriented model of N2O and NO emissions from forest soils: 1. +Model development. J. Geophys. Res. 105(D4):4369-4384. + +Li, F., Zeng, X.-D., and Levis, S. 2012a. A process-based fire +parameterization of intermediate complexity in a Dynamic Global +Vegetation Model. Biogeosciences 9:2761-2780. + +Li, F., Zeng, X. D., and Levis, S. 2012b. Corrigendum to “A +process-based fire parameterization of intermediate complexity in a +Dynamic Global Vegetation Model†published in Biogeosciences, 9, +2761–2780, 2012â€. Biogeosciences 9: 4771-4772. + +Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire +in the Earth system – Part 1: Improved global fire modeling in the +Community Earth System Model (CESM1). Biogeosciences 10:2293-2314. + +Li, H.-Y., Huang, M., Tesfa, T., Ke, Y., Sun, Y., Liu, Y., and Leung, L. +R. 2013b. A subbasin-based framework to represent land surface processes +in an Earth System Model, Geosci. Model Dev. Discuss. 6:2699-2730. +DOI:10.5194/gmdd-6-2699-2013. + +Li, H., Huang, M., Wigmosta, M.S., Ke, Y., Coleman, A.M., Leung, L.R., +Wang, A., and Ricciuto, D.M. 2011. Evaluating runoff simulations from +the Community Land Model 4.0 using observations from flux towers and a +mountainous watershed. J. Geophys. Res. 116:D24120. +DOI:10.1029/2011JD016276. + +Liang, X., Lettenmaier, D.P., Wood, E.F., and Burges, S.J. 1994. A +simple hydrologically based model of land surface water and energy +fluxes for GSMs. J. Geophys. Res. 99(D7):14,415–14,428. + +Lipscomb, W., and Sacks, W. 2012. The CESM land ice model documentation +and user’s guide. 46 pp. [Available online at +http://www.cesm.ucar.edu/models/cesm1.1/cism/]. + +Lloyd, J. and Taylor, J.A., 1994. On the temperature dependence of soil +respiration. Functional Ecology, 8: 315-323. + +Lloyd, J., et al. 2010. Optimisation of photosynthetic carbon gain and +within-canopy gradients of associated foliar traits for Amazon forest +trees. Biogeosci. 7:1833-1859. DOI:10.5194/bg-7-1833-2010. + +Lobell, D.B., Bala, G., and Duffy, P.B. 2006. Biogeophysical impacts of +cropland management changes on climate. Geophys. Res. Lett. 33:L06708. +DOI:10.1029/2005GL025492. + +Loveland, T.R., Reed, B.C., Brown, J.F., Ohlen, D.O., Zhu, Z., Yang, L., +and Merchant, J.W. 2000. Development of a global land cover +characteristics database and IGBP DISCover from 1 km AVHRR data. Int. J. +Remote Sens. 21:1303-1330. + +Lowe, P.R. 1977. An approximating polynomial for the computation of +saturation vapor pressure. J. Appl. Meteor. 16:100-103. + +Luo, Y., Hui, D., and Zhang, D. 2006. Elevated CO2 stimulates net +accumulations of carbon and nitrogen in land ecosystems: a +meta-analysis. Ecology 87:53-63. + +Magill, A.H. et al., 1997. Biogeochemical response of forest ecosystems +to simulated chronic nitrogen deposition. Ecological Applications, 7: +402-415. + +Mahowald, N.M., Muhs, D.R., Levis, S., Rasch, P.J., Yoshioka, M., +Zender, C.S., and Luo, C. 2006. Change in atmospheric mineral aerosols +in response to climate: last glacial period, pre-industrial, modern and +doubled CO\ :math:`{}_{2}` climates. J. Geophys. Res\ *.* 111:D10202. +DOI:10.1029/2005JD006653. + +Makela, A. 2002. Derivation of stem taper from the pipe model theory in +a carbon balance framework. Tree Phys. 22:891-905. + +Manning, M.R. and Melhuish, W.H. 1994. Trends: A Compendium of Data on +Global Change. Carbon Dioxide Information Analysis Center,. Oak Ridge +National Laboratory, U.S. Department of Energy, Oak Ridge, Tenn., U.S.A. + +Mao, J., Thornton, P.E., Shi, X., Zhao, M., and Post, W.M. 2012. Remote +sensing evaluation of CLM4 GPP for the period 2000 to 2009. J. Climate +25:5327-5342. + +Mao, J., Shi, X., Thornton, P.E., Hoffman, F.M., Zhu, Z., and Ranga B. +Myneni, R.B. 2013. Global latitudinal-asymmetric vegetation growth +trends and their driving mechanisms: 1982-2009. Remote Sensing +5:1484-1497. + +Martin, J.P., Haider, K. and Kassim, G., 1980. Biodegradation and +stabilization after 2 years of specific crop, lignin, and polysaccharide +carbons in soils. Soil Science Society of America Journal 44:1250-1255. + +Mary, B., Fresneau, C., Morel, J.L. and Mariotti, A., 1993. C and N +cycling during decomposition of root mucilage, roots and glucose in +soil. Soil Biology and Biochemistry 25:1005-1014. + +McGuire, A.D., Melillo, J.M., Joyce, L.A., Kicklighter, D.W., Grace, +A.L., Moore III, B., and Vorosmarty, C.J. 1992. Interactions between +carbon and nitrogen dynamics in estimating net primary productivity for +potential vegetation in North America. Global Biogeochem. Cycles +6:101-124. + +Melzer, E., and O’Leary, M.H. 1987. Anapleurotic CO2 Fixation by +Phosphoenolpyruvate Carboxylase in C3 Plants. Plant. Physiol. 84:58. + +Miller, J.R., Russell, G.L., and Caliri, G. 1994. Continental-scale +river flow in climate models. J. Climate 7:914-928. + +Millington, R. and Quirk, J.P., 1961. Permeability of Porous Solids. +Transactions of the Faraday Society 57:1200-1207. + +Mironov, D. et al., 2010. Implementation of the lake parameterisation +scheme FLake into the numerical weather prediction model COSMO. Boreal +Environment Research 15:218-230. + +Mitchell, T.D., and Jones, P.D. 2005. An improved method of constructing +a database of monthly climate observations and associated +high-resolution grids. Int. J. Climatol. 25:693-712. + +Moldrup, P. et al. 2003. Modeling diffusion and reaction in soils: X. A +unifying model for solute and gas diffusivity in unsaturated soil. Soil +Science 168:321-337. + +Myneni, R.B., et al. 2002. Global products of vegetation leaf area and +fraction absorbed PAR from year one of MODIS data. Remote Sens. Environ. +83:214-231. + +Neff, J.C., Harden, J.W. and Gleixner, G. 2005. Fire effects on soil +organic matter content, composition, and nutrients in boreal interior +Alaska. Canadian Journal of Forest Research-Revue Canadienne De +Recherche Forestiere 35:2178-2187. + +Neitsch, S.L., Arnold, J.G., Kiniry, J.R., and Williams J.R. 2005. Soil +and Water Assessment Tool, Theoretical Documentation: Version 2005. +Temple, TX. USDA Agricultural Research Service and Texas A&M Blackland +Research Center. + +Nemani, R.R., and Running, S.W. 1996. Implementation of a hierarchical +global vegetation classification in ecosystem function models. J. Veg. +Sci. 7:337-346. + +Niinemets, U., Kull, O., and Tenhunen, J.D. 1998. An analysis of light +effects on foliar morphology, physiology, and light interception in +temperate deciduous woody species of contrasting shade tolerance. Tree +Phys. 18:681-696. + +Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A +simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global +climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. + +Niu, G.-Y., and Yang, Z.-L. 2006. Effects of frozen soil on snowmelt +runoff and soil water storage at a continental scale. J. Hydrometeor. +7:937-952. + +Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., Gulden, L.E., and Su, H. 2007. +Development of a simple groundwater model for use in climate models and +evaluation with Gravity Recovery and Climate Experiment data. J. +Geophys. Res. 112:D07103. DOI:10.1029/2006JD007522. + +Niu, G.-Y., and Yang, Z.-L. 2007. An observation-based formulation of +snow cover fraction and its evaluation over large North American river +basins. J. Geophys. Res. 112:D21101. DOI:10.1029/2007JD008674. + +Nydal, R. and Lövseth, K. 1996. Carbon-14 Measurements In Atmospheric +CO2 From Northern And Southern Hemisphere Sites, 1962-1993, Carbon +Dioxide Information Analysis Center. + +Oikawa, S., Hikosaka, K. and Hirose, T., 2005. Dynamics of leaf area and +nitrogen in the canopy of an annual herb, Xanthium canadense. Oecologia, +143: 517-526. + +Oke, T. 1987. Boundary Layer Climates (2:math:`{}^{nd}` edition). +Routledge, London and New York. + +Oleson, K.W., and Bonan, G.B. 2000. The effects of remotely-sensed plant +functional type and leaf area index on simulations of boreal forest +surface fluxes by the NCAR land surface model. J. Hydrometeor. +1:431-446. + +Oleson, K.W., Dai, Y., Bonan, G., Bosilovich, M., Dickinson, R., +Dirmeyer, P., Hoffman, F., Houser, P., Levis, S., Niu, G.-Y., Thornton, +P., Vertenstein, M., Yang, Z.-L., and Zeng. X. 2004. Technical +description of the Community Land Model (CLM). NCAR Technical Note +NCAR/TN-461+STR. National Center for Atmospheric Research, Boulder, +Colorado. 173 pp. + +Oleson, K.W., Niu, G.-Y., Yang, Z.-L., Lawrence, D.M., Thornton, P.E., +Lawrence, P.J., Stöckli, R., Dickinson, R.E., Bonan, G.B., Levis, S., +Dai, A., and Qian, T. 2008a. Improvements to the Community Land Model +and their impact on the hydrological cycle. J. Geophys. Res. 113:G01021. +DOI:10.1029/2007JG000563. + +Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Grimmond, +C.S.B. 2008b. An urban parameterization for a global climate model. 1. +Formulation and evaluation for two cities. J. Appl. Meteor. Clim. +47:1038-1060. + +Oleson, K.W., Bonan, G.B., Feddema, J., and Vertenstein, M. 2008c. An +urban parameterization for a global climate model. 2. Sensitivity to +input parameters and the simulated urban heat island in offline +simulations. J. Appl. Meteor. Clim. 47:1061-1076. + +Oleson, K.W., et al. 2010a. Technical description of version 4.0 of the +Community Land model (CLM). NCAR Technical Note NCAR/TN-478+STR, +National Center for Atmospheric Research, Boulder, CO, 257 pp. + +Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Kluzek, E. +2010b. Technical description of an urban parameterization for the +Community Land Model (CLMU). NCAR Technical Note NCAR/TN-480+STR, +National Center for Atmospheric Research, Boulder, CO, 169 pp. + +Olson, J.S., 1963. Energy storage and the balance of producers and +decomposers in ecological systems. Ecology 44:322-331. + +Olson, D.M., Dinerstein, E., Wikramanayake, E.D., Burgess, N.D., Powell, +G.V.N., Underwood, E.C., D’Amico, J.A., Itoua, I., Strand, H. E., +Morrison, J. C., Loucks, C. J., Allnutt, T. F., Ricketts, T. H., Kura, +Y., Lamoreux, J. F., Wettengel, W. W., Heda, P., and Kassem, K. R., +2001. Terrestrial ecoregions of the world a new map of life on earth, +Bioscience, 51, 933–938. + +Orchard, V.A. and Cook, F.J., 1983. Relationship between soil +respiration and soil moisture. Soil Biology and Biochemistry, 15: +447-453. + +Owen, P.R. 1964. Saltation of uniform grains in air. J. Fluid Mech\ *.* +20:225-242. + +Ozdogan, M., Rodell, M., Beaudoing, H.K., and Toll, D.L. 2010. +Simulating the effects of irrigation over the United States in a land +surface model based on satellite-derived agricultural data. Journal of +Hydrometeorology 11:171-184. + +Page, S.E., Siegert, F., Rieley, J.O., Boehm, H-D.V., Jaya, A., and +Limin, S. 2002. The amount of carbon released from peat and forest fires +in Indonesia in 1997. Nature 420:61-65. + +Panofsky, H.A., and Dutton, J.A. 1984. Atmospheric Turbulence: Models +and Methods for Engineering Applications. John Wiley and Sons, New York. + +Parton, W., Stewart, J. and Cole, C., 1988. Dynamics of C, N, P And S in +Grassland Soils - A Model. Biogeochemistry 5:109-131. + +Parton, W.J., et al. 1993. Observations and modeling of biomass and soil +organic matter dynamics for the grassland biome worlwide. Global +Biogeochemical Cycles 7:785-809. + +Parton, W. et al. 1996. Generalized model for N2 and N2O production from +nitrification and denitrification. Global Biogeochemical Cycles +10:401-412. + +Parton, W.J. et al. 2001. Generalized model for NOx and N2O emissions +from soils. J. Geophys. Res. 106(D15):17403-17419. + +Paterson, W.S.B., 1994. The Physics of Glaciers. Elsevier Science Inc., +New York, 480 pp. + +Petrescu, A.M.R. et al. 2010. Modeling regional to global CH4 emissions +of boreal and arctic wetlands. Global Biogeochemical Cycles, 24(GB4009). + +Philip, J.R. 1957. Evaporation, and moisture and heat fields in the +soil. J. Meteor. 14:354-366. + +Piao, S.L., et al. 2012. The carbon budget of terrestrial ecosystems in +East Asia over the last two decades. Biogeosciences 9:3571-3586. + +Pivovarov, A.A., 1972. Thermal Conditions in Freezing Lakes and +Reservoirs. John Wiley, New York. + +Pollmer, W.G., Eberhard, D., Klein, D., and Dhillon, B.S. 1979. Genetic +control of nitrogen uptake and translocation in maize. Crop Sci. +19:82-86. + +Portmann, F.T., Siebert, S., and Döll, P. 2010. MIRCA2000 - Global +monthly irrigated and rainfed crop areas around the year 2000: A new +high-resolution data set for agricultural and hydrological modeling. +Global Biogeochem. Cycles. 24, GB1011. DOI:10.1029/2008GB003435. + +Press, W.H., Teukolsky, S.A., Vetterling, W.T., and Flannery, B.P. 1992. +Numerical Recipes in FORTRAN: The Art of Scientific Computing. Cambridge +University Press, New York. + +Prigent, C., Papa, F., Aires, F., Rossow, W.B. and Matthews, E. 2007. +Global inundation dynamics inferred from multiple satellite +observations, 1993-2000. J. Geophys. Res. 112(D12). + +Pritchard, M.S., Bush, A.B.G., and Marshall, S.J. 2008. Neglecting +ice-atmosphere interactions underestimates ice sheet melt in +millennial-scale deglaciation simulations. Geophys. Res. Lett. ** +35:L01503. DOI:10.1029/2007GL031738. + +Qian, T., Dai, A., Trenberth, K.E., and Oleson, K.W. 2006. Simulation of +global land surface conditions from 1948 to 2004: Part I: Forcing data +and evaluations. J. Hydrometeor. 7:953-975. + +Ramankutty, N., and Foley, J. A., 1998. Characterizing patterns of +global land use: An analysis of global croplands data. Global +Biogeochemical Cycles, 12, 667-685. + +Ramankutty, N., Evan, A., Monfreda, C., and Foley, J.A. 2008. Farming +the Planet. Part 1: The Geographic Distribution of Global Agricultural +Lands in the Year 2000. Global Biogeochem. Cycles. 22:GB1003. +DOI:10.1029/2007GB002952. + +Randlett, D.L., Zak, D.R., Pregitzer, K.S., and Curtis, P.S. 1996. +Elevated atmospheric carbon dioxide and leaf litter chemistry: +Influences on microbial respiration and net nitrogen mineralization. +Soil Sci. Soc. Am. J. 60:1571-1577. + +Rastetter, E.B., Ryan, M.G., Shaver, G.R., Melillo, J.M., Nadelhoffer, +K.J., Hobbie, J.E., and Aber, J.D. 1991. A general biogeochemical model +describing the responses of the C and N cycles in terrestrial ecosystems +to changes in CO2, climate and N deposition. Tree Phys. 9:101-126. + +Rastner, P., Bolch, T., Mölg, N., Machguth, H., and Paul, F., 2012. The +first complete glacier inventory for the whole of Greenland, The +Cryosphere Discuss., 6, 2399-2436, 10.5194/tcd-6-2399-2012. + +Riley, W. J., Z. M. Subin, D. M. Lawrence, S. C. Swenson, M. S. Torn, L. +Meng, N. Mahowald, and P. Hess, 2011a. Barriers to predicting global +terrestrial methane fluxes: Analyses using a methane biogeochemistry +model integrated in CESM. Biogeosciences, 8, 1925–1953. +DOI:10.5194/bg-8-1925-2011. + +Riley, W.J. et al. 2011b. CLM4Me, a Methane Biogeochemistry Model +Integrated in CESM, Land and Biogeochemistry Model Working Group +Meeting, Boulder, CO. + +Ryan, M. G. 1991. A simple method for estimating gross carbon budgets +for vegetation in forest ecosystems. Tree Phys. 9:255-266. + +Running, S.W. and Coughlan, J.C., 1988. A general model of forest +ecosystem processes for regional applications. I. Hydrological balance, +canopy gas exchange and primary production processes. Ecological +Modelling, 42: 125-154. + +Running, S.W. et al., 1989. Mapping regional forest evapotranspiration +and photosynthesis by coupling satellite data with ecosystem simlation. +Ecology, 70: 1090-1101. + +Running, S.W. and Gower, S.T., 1991. FOREST BGC, A general model of +forest ecosystem processes for regional applications. II. Dynamic carbon +allocation and nitrogen budgets. Tree Physiology, 9: 147-160. + +Running, S.W. and Hunt, E.R., Jr., 1993. Generalization of a forest +ecosystem process model for other biomes, BIOME-BGC, and an +applicationfor global-scale models. In: J.R. Ehleringer and C. Field +(Editors), Scaling Physiological Processes: Leaf to Globe. Academic +Press, San Diego, CA, pp. 141-158. + +Sacks, W. J., Cook, B. I., Buenning, N., Levis, S., and Helkowski, J. H. +2009. Effects of global irrigation on the near-surface climate. Climate +Dyn., 33, 159–175. DOI:10.1007/s00382-008-0445-z. + +Saggar, S., Tate, K.R., Feltham, C.W., Childs, C.W. and Parshotam, A., +1994. Carbon turnover in a range of allophanic soils amended with +:math:`{}^{14}`\ C-labelled glucose. Soil Biology and Biochemistry, 26: +1263-1271. + +Sakaguchi, K., and Zeng, X. 2009. Effects of soil wetness, plant litter, +and under-canopy atmospheric stability on ground evaporation in the +Community Land Model (CLM3.5). J. Geophys. Res. 114:D01107. +DOI:10.1029/2008JD010834. + +Schaaf, C.B., Gao, F., Strahler, A.H., Lucht, W., Li, X., Tsang, T., +Strugnell, N.C., Zhang, X., Jin, Y., and Muller, J.-P. 2002. First +operational BRDF, albedo nadir reflectance products from MODIS. Remote +Sens. Environ. 83:135-148. + +Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. +Academic Press, London, 588 pp. + +Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity +in soils and cultures to water stress. Applied and Environmental +Microbiology 62:3203-3209. + +Segers, R., 1998. Methane production and methane consumption: a review +of processes underlying wetland methane fluxes. Biogeochemistry +41:23-51. + +Sellers, P.J. 1985. Canopy reflectance, photosynthesis and +transpiration. Int. J. Remote Sens. 6:1335-1372. + +Sellers, P.J., Mintz, Y., Sud, Y.C., and Dalcher, A. 1986. A simple +biosphere model (SiB) for use within general circulation models. J. +Atmos. Sci. 43:505-531. + +Sellers, P.J., Hall, F.G., Asrar, G., Strebel, D.E., and Murphy, R.E. +1988. The First ISLSCP Field Experiment (FIFE). Bull. Amer. Meteor. Soc. +69:22-27. + +Sellers, P.J., Berry, J.A., Collatz, G.J., Field, C.B., and Hall, F.G. +1992. Canopy reflectance, photosynthesis, and transpiration. III. A +reanalysis using improved leaf models and a new canopy integration +scheme. Remote Sens. Environ. 42:187-216. + +Sellers, P.J., et al. 1995. The Boreal Ecosystem-Atmosphere Study +(BOREAS): An overview and early results from the 1994 field year. Bull. +Amer. Meteor. Soc. 76:1549-1577. + +Sellers, P.J., Randall, D.A., Collatz, G.J., Berry, J.A., Field, C.B., +Dazlich, D.A., Zhang, C., Collelo, G.D., and Bounoua, L. 1996. A revised +land surface parameterization (SiB2) for atmospheric GCMs. Part I: Model +formulation. J. Climate 9:676-705. + +Shi, X., Mao, J., Thornton, P.E., and Huang, M. 2013. Spatiotemporal +patterns of evapotranspiration in response to multiple environmental +factors simulated by the Community Land Model. Environ. Res. Lett. +8:024012. + +Shiklomanov, I.A. 2000. Appraisal and assessment of world water +resources. Water International 25:11-32. + +Siebert, S., Döll, P., Hoogeveen, J., Faures, J.M., Frenken, K., Feick, +S., 2005. Development and validation of the global map of irrigation +areas. Hydrol Earth Syst Sc 9:535–547 + +Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen +redistribution during grain growth in wheat (Triticum avestivum L.). +Plant Physiol. 71:7-14. + +Smith, A.M.S., Wooster, M.J., Drake, N.A., Dipotso, F.M. and Perry, +G.L.W., 2005. Fire in African savanna: Testing the impact of incomplete +combustion on pyrogenic emissions estimates. Ecological Applications, +15: 1074-1082. + +Sollins, P., 1982. Input and decay of coarse woody debris in coniferous +stands in western Oregon and Washington. Canadian Journal of Forest +Research, 12: 18-28. + +Son, Y. and Gower, S.T., 1991. Aboveground nitrogen and phosphorus use +by five plantation-grown trees with different leaf longevities. +Biogeochemistry, 14: 167-191. + +Sørensen, L.H., 1981. Carbon-nitrogen relationships during the +humification of cellulose in soils containing different amounts of clay. +Soil Biology and Biochemistry, 13: 313-321. + +Sprugel, D.G., Ryan, M.G., Brooks, J.R., Vogt, K.A., and Martin, T.A. +1995. Respiration from the organ level to stand level. pp. 255-299. In: +W. K. Smith and T. M. Hinkley (editors) Resource Physiology of Conifers. +Academic Press, San Diego,CA. + +Stauffer, D., and Aharony, A. 1994. Introduction to Percolation Theory. +Taylor and Francis, London. + +Still, C.J., Berry, J.A., Collatz, G.J., and DeFries, R.S. 2003. Global +distribution of C3 and C4 vegetation: carbon cycle implications. Global +Biogeochem. Cycles 17:1006. DOI:10.1029/2001GB001807. + +Stöckli, R., Lawrence, D.M., Niu, G.-Y., Oleson, K.W., Thornton, P.E., +Yang, Z.-L., Bonan, G.B., Denning, A.S., and Running, S.W. 2008. Use of +FLUXNET in the Community Land Model development. J. Geophys. Res. +113:G01025. DOI:10.1029/2007JG000562. + +Strack, M., Kellner, E. and Waddington, J.M., 2006. Effect of entrapped +gas on peatland surface level fluctuations. Hydrological Processes +20:3611-3622. + +Strahler, A.H., Muchoney, D., Borak, J., Friedl, M., Gopal, S., Lambin, +E., and Moody. A. 1999. MODIS Land Cover Product: Algorithm Theoretical +Basis Document (Version 5.0). Boston University, Boston. + +Stull, R.B. 1988. An Introduction to Boundary Layer Meteorology. Kluwer +Academic Publishers, Dordrecht. + +Subin, Z.M., Riley, W.J. and Mironov, D. 2012a. Improved lake model for +climate simulations, J. Adv. Model. Earth Syst., 4, M02001. +DOI:10.1029/2011MS000072. + +Subin, Z.M., Murphy, L.N., Li, F., Bonfils, C. and Riley, W.J., 2012b. +Boreal lakes moderate seasonal and diurnal temperature variation and +perturb atmospheric circulation: analyses in the Community Earth System +Model 1 (CESM1). Tellus A, North America, 64. + +Sun, Y., Gu, L., and Dickinson, R. E. 2012. A numerical issue in +calculating the coupled carbon and water fluxes in a climate model, J. +Geophys. Res., 117, D22103. DOI:10.1029/2012JD018059. + +Swenson, S.C., Lawrence, D.M., and Lee, H. 2012. Improved Simulation of +the Terrestrial Hydrological Cycle in Permafrost Regions by the +Community Land Model. JAMES, 4, M08002. DOI:10.1029/2012MS000165. + +Swenson, S.C. and Lawrence, D.M. 2012. A New Fractional Snow Covered +Area Parameterization for the Community Land Model and its Effect on the +Surface Energy Balance. JGR, 117, D21107. DOI:10.1029/2012JD018178. + +Ta, C.T. and Weiland, R.T. 1992. Nitrogen partitioning in maize during +ear development. Crop Sci. 32:443-451. + +Tang, J.Y. and Riley, W.J. 2013. A new top boundary condition for +modeling surface diffusive exchange of a generic volatile tracer: +Theoretical analysis and application to soil evaporation. Hydrol. Earth +Syst. Sci. 17:873-893. + +Tarnocai, C., Kettles, I. M., and Lacelle, B., 2011. Peatlands of +Canada, Geological Survey of Canada, Open File 6561, CD-ROM. +DOI:10.495/288786. + +Taylor, B.R., Parkinson, D. and Parsons, W.F.J., 1989. Nitrogen and +lignin content as predictors of litter decay rates: A microcosm test. +Ecology, 70: 97-104. + +Thonicke, K., Venevsky, S., Sitch, S., and Cramer, W. 2001. The role of +fire disturbance for global vegetation dynamics: coupling fire into a +Dynamic Global Vegetation Model. Global Ecology and Biogeography +10:661-667. + +Thornton, P.E., 1998. Regional ecosystem simulation: combining surface- +and satellite-based observations to study linkages between terrestrial +energy and mass budgets. Ph.D. Thesis, The University of Montana, +Missoula, 280 pp. + +Thornton, P.E., Law, B.E., Gholz, H.L., Clark, K.L., Falge, E., +Ellsworth, D.S., Goldstein, A.H., Monson, R.K., Hollinger, D., Falk, M., +Chen, J., and Sparks, J.P. 2002. Modeling and measuring the effects of +disturbance history and climate on carbon and water budgets in evergreen +needleleaf forests. Agric. For. Meteor. 113:185-222. + +Thornton, P.E., and Rosenbloom, N.A. 2005. Ecosystem model spin-up: +estimating steady state conditions in a coupled terrestrial carbon and +nitrogen cycle model. Ecological Modelling 189:25-48. + +Thornton, P.E., and Zimmermann, N.E. 2007. An improved canopy +integration scheme for a land surface model with prognostic canopy +structure. J. Climate 20:3902-3923. + +Thornton, P.E., Lamarque, J.-F., Rosenbloom, N.A., and Mahowald, N.M. +2007. Influence of carbon-nitrogen cycle coupling on land model response +to CO\ :math:`{}_{2}` fertilization and climate variability. Global +Biogeochem. Cycles 21:GB4018. + +Thornton, P.E., Doney, S.C., Lindsay, K., Moore, J.K., Mahowald, N., +Randerson, J.T., Fung, I., Lamarque, J.F., Feddema, J.J., and Lee, Y.H. +2009. Carbon-nitrogen interactions regulate climate-carbon cycle +feedbacks: results from an atmosphere-ocean general circulation model. +Biogeosci. 6:2099-2120. + +Tian, H. et al. 2010. Spatial and temporal patterns of CH4 and N2O +fluxes in terrestrial ecosystems of North America during 1979-2008: +application of a global biogeochemistry model. Biogeosciences +7:2673-2694. + +Toon, O.B., McKay, C.P., Ackerman, T.P., and Santhanam, K. 1989. Rapid +calculation of radiative heating rates and photodissociation rates in +inhomogeneous multiple scattering atmospheres. J. Geophys. Res. +94(D13):16,287-16,301. + +Turetsky, M.R., Wieder, R.K., Halsey, L.A., and Vitt, D.H. 2002. Current +disturbance and the diminishing peatland carbon sink. Geophys. Res. +Lett. 29:1526. DOI:10.1029/2001GL014000. + +Turetsky, M.R., Amiro, B.D., Bosch, E., andBhatti, J.S. 2004. Historical +burn area in western Canadian peatlands and its relationship to fire +weather indices. Global Biogeochem. Cycles 18:GB4014. +DOI:10.1029/2004GB002222. + +Turnbull, J.C. et al. 2007. A new high precision (CO2)-C-14 time series +for North American continental air. Journal of Geophysical +Research-Atmospheres 112(D11). + +Tye, A.M., et al. 2005. The fate of N-15 added to high Arctic tundra to +mimic increased inputs of atmospheric nitrogen released from a melting +snowpack. Global Change Biology 11:1640-1654. + +Unland, H.E., Houser, P.R., Shuttleworth, W.J., and Yang, Z.-L. 1996. +Surface flux measurement and modeling at a semi-arid Sonoran Desert +site. Agric. For. Meteor. 82:119-153. + +UNSTAT, 2005. National Accounts Main Aggregates Database, United Nations +Statistics Division. + +Vallano, D.M. and Sparks, J.P. 2007. Quantifying foliar uptake of +gaseous itrogen dioxide using enriched foliar +:math:`\deltaup`\ :math:`{}^{15 }`\ N values. New Phytologist +177:946-955. + +van der Werf, G.R., Randerson, J.T., Giglio, L., Collatz, G.J., Mu, M., +Kasibhatla, S.P., Morton, D.C., DeFries, R.S., Jin, Y., van Leeuwen, +T.T. 2010. Global fire emissions and the contribution of deforestation, +savanna, forest, agricultural, and peat fires (1997-2009) Atmos. Chem. +Phys. 10:11707-11735. + +van Veen, J.A., Ladd, J.N. and Frissel, M.J., 1984. Modelling C and N +turnover through the microbial biomass in soil. Plant and Soil, 76: +257-274. + +Van Vuuren, D.P., Lucas, P.S., and Hilderink, H.B.M., 2006. Downscaling +drivers of global environmental change: enabling use of global SRES +scenarios at the national and grid levels, Report 550025001, Netherlands +Environmental Assessment Agency, 45 pp. + +Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: +effects of size, competition and site fertility on growth allocation and +production. Tree Phys. 25:17-30. + +Verdin, K. L., and S. K. Greenlee, 1996. Development of continental +scale digital elevation models and extraction of hydrographic features, +paper presented at the Third International Conference/Workshop on +Integrating GIS and Environmental Modeling, Santa Fe, New Mexico, 21–26 +January, Natl. Cent. for Geogr. Inf. and Anal., Santa Barbara, Calif. + +Viovy, N. 2011. CRUNCEP dataset. [Description available at +http://dods.extra.cea.fr/data/p529viov/cruncep/readme.htm. Data +available at +http://dods.extra.cea.fr/store/p529viov/cruncep/V4\_1901\_2011/]. + +Vitousek, P.M., and Howarth, R.W. 1991. Nitrogen limitation on land and +in the sea: How can it occur? Biogeochem. 13:87-115. + +Walter, B.P., Heimann, M. and Matthews, E., 2001. Modeling modern +methane emissions from natural wetlands 1. Model description and +results. J. Geophys. Res. 106(D24):34189-34206. + +Wania, R., Ross, I. and Prentice, I.C. 2009. Integrating peatlands and +permafrost into a dynamic global vegetation model: 2. Evaluation and +sensitivity of vegetation and carbon cycle processes. Global Biogeochem. +Cycles 23. + +Wania, R., Ross, I. and Prentice, I.C. 2010. Implementation and +evaluation of a new methane model within a dynamic global vegetation +model LPJ-WHyMe v1.3. Geoscientific Model Development Discussions +3:1-59. + +Wang, A., and Zeng, X. 2009. Improving the treatment of vertical snow +burial fraction over short vegetation in the NCAR CLM3. Adv. Atmos. Sci. +26:877-886. DOI:10.1007/s00376-009-8098-3. + +White, M.A., Thornton, P.E., and Running, S.W. 1997. A continental +phenology model for monitoring vegetation responses to interannual +climatic variability. Global Biogeochem. Cycles 11:217-234. + +White, M.A., Thornton, P.E., Running, S.W., and Nemani, R.R. 2000. +Parameterization and sensitivity analysis of the Biome-BGC terrestrial +ecosystem model: net primary production controls. Earth Interactions +4:1-85. + +Wiscombe, W.J., and Warren, S.G. 1980. A model for the spectral albedo +of snow. I. Pure snow. J. Atmos. Sci. 37:2712-2733. + +Wood, E.F., Lettenmaier, D.P., and Zartarian, V.G. 1992. A land-surface +hydrology parameterization with subgrid variability for general +circulation models. J. Geophys. Res. 97(D3):2717–2728. +DOI:10.1029/91JD01786. + +World Bank, 2004. World development indicators 2004, Oxford University +Press, New York, 416 pp. + +Yang, Z.-L. 1998. Technical note of a 10-layer soil moisture and +temperature model. Unpublished manuscript. + +Zender, C.S., Bian, H., and Newman, D. 2003. Mineral dust entrainment +and deposition (DEAD) model: Description and 1990s dust climatology. ** +J. Geophys. Res\ *.* 108(D14):4416. DOI:10.1029/2002JD002775. + +Zeng, X., and Dickinson, R.E. 1998. Effect of surface sublayer on +surface skin temperature and fluxes. J.Climate 11:537-550. + +Zeng, X., Zhao, M., and Dickinson, R.E. 1998. Intercomparison of bulk +aerodynamic algorithms for the computation of sea surface fluxes using +the TOGA COARE and TAO data. J. Climate 11:2628-2644. + +Zeng, X. 2001. Global vegetation root distribution for land modeling. J. +Hydrometeor. 2:525-530. + +Zeng, X., Shaikh, M., Dai, Y., Dickinson, R.E., and Myneni, R. 2002. +Coupling of the Common Land Model to the NCAR Community Climate Model. +J. Climate 15:1832-1854. + +Zeng, X., Dickinson, R.E., Barlage, M., Dai, Y., Wang, G., and Oleson, +K. 2005. Treatment of under-canopy turbulence in land models. J. Climate +18:5086-5094. + +Zeng, X., and Wang, A. 2007. Consistent parameterization of roughness +length and displacement height for sparse and dense canopies in land +models. J. Hydrometeor. 8:730-737. + +Zeng, X., and Decker, M. 2009. Improving the numerical solution of soil +moisture-based Richards equation for land models with a deep or shallow +water table. J. Hydrometeor. 10:308-319. + +Zeng, X., Zeng, X., and Barlage, M. 2008. Growing temperate shrubs over +arid and semiarid regions in the Community Land Model - Dynamic Global +Vegetation Model. Global Biogeochem. Cycles 22:GB3003. +DOI:10.1029/2007GB003014. + +Zhang, Y., Li, C.S., Trettin, C.C., Li, H. and Sun, G., 2002. An +integrated model of soil, hydrology, and vegetation for carbon dynamics +in wetland ecosystems. Global Biogeochemical Cycles 16. +DOI:10.1029/2001GB001838. + +Zhuang, Q., et al. 2004. Methane fluxes between terrestrial ecosystems +and the atmosphere at northern high latitudes during the past century: A +retrospective analysis with a process-based biogeochemistry model. +Global Biogeochemical Cycles 18. DOI:10.1029/2004GB002239. + +Zilitinkevich, S.S. 1970. Dynamics of the Atmospheric Boundary Layer. +Leningrad Gidrometeor. diff --git a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst new file mode 100644 index 0000000000..cc47ceedf1 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst @@ -0,0 +1,1137 @@ +Surface Albedos +================== + +Canopy Radiative Transfer +----------------------------- + +Radiative transfer within vegetative canopies is calculated from the +two-stream approximation of Dickinson (1983) and Sellers (1985) as +described by Bonan (1996) + +.. math:: + :label: 3.1 + + -\bar{\mu }\frac{dI\, \uparrow }{d\left(L+S\right)} +\left[1-\left(1-\beta \right)\omega \right]I\, \uparrow -\omega \beta I\, \downarrow =\omega \bar{\mu }K\beta _{0} e^{-K\left(L+S\right)} + +.. math:: + :label: 3.2 + + \bar{\mu }\frac{dI\, \downarrow }{d\left(L+S\right)} +\left[1-\left(1-\beta \right)\omega \right]I\, \downarrow -\omega \beta I\, \uparrow =\omega \bar{\mu }K\left(1-\beta _{0} \right)e^{-K\left(L+S\right)} + +where :math:`I\, \uparrow` and :math:`I\, \downarrow` are the upward +and downward diffuse radiative fluxes per unit incident flux, +:math:`K={G\left(\mu \right)\mathord{\left/ {\vphantom {G\left(\mu \right) \mu }} \right. \kern-\nulldelimiterspace} \mu }` +is the optical depth of direct beam per unit leaf and stem area, +:math:`\mu` is the cosine of the zenith angle of the incident beam, +:math:`G\left(\mu \right)` is the relative projected area of leaf and +stem elements in the direction :math:`\cos ^{-1} \mu` , +:math:`\bar{\mu }` is the average inverse diffuse optical depth per unit +leaf and stem area, :math:`\omega` is a scattering coefficient, +:math:`\beta` and :math:`\beta _{0}` are upscatter parameters for +diffuse and direct beam radiation, respectively, :math:`L` is the +exposed leaf area index (section 2.1.4), and :math:`S` is the exposed +stem area index (section 2.1.4). Given the direct beam albedo +:math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse albedo +:math:`\alpha _{g,\, \Lambda }` of the ground (section 3.2), these +equations are solved to calculate the fluxes, per unit incident flux, +absorbed by the vegetation, reflected by the vegetation, and transmitted +through the vegetation for direct and diffuse radiation and for visible +(:math:`<` 0.7\ :math:`\mu {\rm m}`) and near-infrared +(:math:`ge` 0.7\ :math:`\mu {\rm m}`) wavebands. The absorbed +radiation is partitioned to sunlit and shaded fractions of the canopy. +The optical parameters :math:`G\left(\mu \right)`, :math:`\bar{\mu }`, +:math:`\omega`, :math:`\beta`, and :math:`\beta _{0}` are calculated +based on work in Sellers (1985) as follows. + +The relative projected area of leaves and stems in the direction +:math:`\cos ^{-1} \mu` is + +.. math:: + :label: 3.3 + + G\left(\mu \right)=\phi _{1} +\phi _{2} \mu + +where :math:`\phi _{1} ={\rm 0.5}-0.633\chi _{L} -0.33\chi _{L}^{2}` +and :math:`\phi _{2} =0.877\left(1-2\phi _{1} \right)` for +:math:`-0.4\le \chi _{L} \le 0.6`. :math:`\chi _{L}` is the departure +of leaf angles from a random distribution and equals +1 for horizontal +leaves, 0 for random leaves, and –1 for vertical leaves. + +The average inverse diffuse optical depth per unit leaf and stem area is + +.. math:: + :label: 3.4 + + \bar{\mu }=\int _{0}^{1}\frac{\mu '}{G\left(\mu '\right)} d\mu '=\frac{1}{\phi _{2} } \left[1-\frac{\phi _{1} }{\phi _{2} } \ln \left(\frac{\phi _{1} +\phi _{2} }{\phi _{1} } \right)\right] + +where :math:`\mu '` is the direction of the scattered flux. + +The optical parameters :math:`\omega` , :math:`\beta` , and +:math:`\beta _{0}` , which vary with wavelength (:math:`\Lambda` ), are +weighted combinations of values for vegetation and snow. The model +determines that snow is on the canopy if :math:`T_{v} \le T_{f}` , where +:math:`T_{v}` is the vegetation temperature (K) (Chapter 5) and +:math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). In +this case, the optical parameters are + +.. math:: + :label: 3.5 + + \omega _{\Lambda } =\omega _{\Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} f_{wet} + +.. math:: + :label: 3.6 + + \omega _{\Lambda } \beta _{\Lambda } =\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{\Lambda }^{sno} f_{wet} + +.. math:: + :label: 3.7 + + \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{0,\, \Lambda }^{sno} f_{wet} + +where :math:`f_{wet}` is the wetted fraction of the canopy (section +7.1). The snow and vegetation weights are applied to the products +:math:`\omega _{\Lambda } \beta _{\Lambda }` and +:math:`\omega _{\Lambda } \beta _{0,\, \Lambda }` because these +products are used in the two-stream equations. If there is no snow on +the canopy, + +.. math:: + :label: 3.8 + + \omega _{\Lambda } =\omega _{\Lambda }^{veg} + +.. math:: + :label: 3.9 + + \omega _{\Lambda } \beta _{\Lambda } =\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} + +.. math:: + :label: 3.10 + + \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} . + +For vegetation, +:math:`\omega _{\Lambda }^{veg} =\alpha _{\Lambda } +\tau _{\Lambda }` . +:math:`\alpha _{\Lambda }` is a weighted combination of the leaf and +stem reflectances +(:math:`\alpha _{\Lambda }^{leaf} ,\alpha _{\Lambda }^{stem}` ) + +.. math:: + :label: 3.11 + + \alpha _{\Lambda } =\alpha _{\Lambda }^{leaf} w_{leaf} +\alpha _{\Lambda }^{stem} w_{stem} + +where +:math:`w_{leaf} ={L\mathord{\left/ {\vphantom {L \left(L+S\right)}} \right. \kern-\nulldelimiterspace} \left(L+S\right)}` +and +:math:`w_{stem} ={S\mathord{\left/ {\vphantom {S \left(L+S\right)}} \right. \kern-\nulldelimiterspace} \left(L+S\right)}` . +:math:`\tau _{\Lambda }` is a weighted combination of the leaf and stem transmittances (:math:`\tau _{\Lambda }^{leaf}, \tau _{\Lambda }^{stem}`) + +.. math:: + :label: 3.12 + + \tau _{\Lambda } =\tau _{\Lambda }^{leaf} w_{leaf} +\tau _{\Lambda }^{stem} w_{stem} . + +The upscatter for diffuse radiation is + +.. math:: + :label: ZEqnNum472968 + + \omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} =\frac{1}{2} \left[\alpha _{\Lambda } +\tau _{\Lambda } +\left(\alpha _{\Lambda } -\tau _{\Lambda } \right)\cos ^{2} \bar{\theta }\right] + +where :math:`\bar{\theta }` is the mean leaf inclination angle relative +to the horizontal plane (i.e., the angle between leaf normal and local +vertical) (Sellers 1985). Here, :math:`\cos \bar{\theta }` is +approximated by + +.. math:: + :label: ZEqnNum720349 + + \cos \bar{\theta }=\frac{1+\chi _{L} }{2} + +Using this approximation, for vertical leaves (:math:`\chi _{L} =-1`, +:math:`\bar{\theta }=90^{{\rm o}}` ), +:math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} =0.5\left(\alpha _{\Lambda } +\tau _{\Lambda } \right)`, +and for horizontal leaves (:math:`\chi _{L} =1`, +:math:`\bar{\theta }=0^{{\rm o}}` ) , +:math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} =\alpha _{\Lambda }` , +which agree with both Dickinson (1983) and Sellers (1985). For random +(spherically distributed) leaves (:math:`\chi _{L} =0`, +:math:`\bar{\theta }=60^{{\rm o}}` ), the approximation yields +:math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} ={5\mathord{\left/ {\vphantom {5 8}} \right. \kern-\nulldelimiterspace} 8} \alpha _{\Lambda } +{3\mathord{\left/ {\vphantom {3 8}} \right. \kern-\nulldelimiterspace} 8} \tau _{\Lambda }` +whereas the approximate solution of Dickinson (1983) is +:math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} ={2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} \alpha _{\Lambda } +{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} \tau _{\Lambda }` . +This discrepancy arises from the fact that a spherical leaf angle +distribution has a true mean leaf inclination +:math:`\bar{\theta }\approx 57` (Campbell and Norman 1998) in equation , +while :math:`\bar{\theta }=60` in equation . The upscatter for direct +beam radiation is + +.. math:: + :label: 3.15 + + \omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} =\frac{1+\bar{\mu }K}{\bar{\mu }K} a_{s} \left(\mu \right)_{\Lambda } + +where the single scattering albedo is + +.. math:: + :label: 3.16 + + \begin{array}{rcl} {a_{s} \left(\mu \right)_{\Lambda } } & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \int _{0}^{1}\frac{\mu 'G\left(\mu \right)}{\mu G\left(\mu '\right)+\mu 'G\left(\mu \right)} d\mu '} \\ {} & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \frac{G\left(\mu \right)}{\mu \phi _{2} +G\left(\mu \right)} \left[1-\frac{\mu \phi _{1} }{\mu \phi _{2} +G\left(\mu \right)} \ln \left(\frac{\mu \phi _{1} +\mu \phi _{2} +G\left(\mu \right)}{\mu \phi _{1} } \right)\right].} \end{array} + +The upward diffuse fluxes per unit incident direct beam and diffuse flux +(i.e., the surface albedos) are + +.. math:: + :label: 3.17 + + I\, \uparrow _{\Lambda }^{\mu } =\frac{h_{1} }{\sigma } +h_{2} +h_{3} + +.. math:: + :label: 3.18 + + I\, \uparrow _{\Lambda } =h_{7} +h_{8} . + +The downward diffuse fluxes per unit incident direct beam and diffuse +radiation, respectively, are + +.. math:: + :label: 3.19 + + I\, \downarrow _{\Lambda }^{\mu } =\frac{h_{4} }{\sigma } e^{-K\left(L+S\right)} +h_{5} s_{1} +\frac{h_{6} }{s_{1} } + +.. math:: + :label: 3.20 + + I\, \downarrow _{\Lambda } =h_{9} s_{1} +\frac{h_{10} }{s_{1} } . + +With reference to Figure 4.1, the direct beam flux transmitted through +the canopy, per unit incident flux, is :math:`e^{-K\left(L+S\right)}` , +and the direct beam and diffuse fluxes absorbed by the vegetation, per +unit incident flux, are + +.. math:: + :label: 3.21 + + \vec{I}_{\Lambda }^{\mu } =1-I\, \uparrow _{\Lambda }^{\mu } -\left(1-\alpha _{g,\, \Lambda } \right)I\, \downarrow _{\Lambda }^{\mu } -\left(1-\alpha _{g,\, \Lambda }^{\mu } \right)e^{-K\left(L+S\right)} + +.. math:: + :label: 3.22 + + \vec{I}_{\Lambda } =1-I\, \uparrow _{\Lambda } -\left(1-\alpha _{g,\, \Lambda } \right)I\, \downarrow _{\Lambda } . + +These fluxes are partitioned to the sunlit and shaded canopy using an +analytical solution to the two-stream approximation for sunlit and +shaded leaves (Dai et al. 2004), as described by Bonan et al. (2011). +The absorption of direct beam radiation by sunlit leaves is + +.. math:: + :label: 3.23 + + \vec{I}_{sun,\Lambda }^{\mu } =\left(1-\omega _{\Lambda } \right)\left[1-s_{2} +\frac{1}{\bar{\mu }} \left(a_{1} +a_{2} \right)\right] + +and for shaded leaves is + +.. math:: + :label: 3.24 + + \vec{I}_{sha,\Lambda }^{\mu } =\vec{I}_{\Lambda }^{\mu } -\vec{I}_{sun,\Lambda }^{\mu } + +with + +.. math:: + :label: 3.25 + + a_{1} =\frac{h_{1} }{\sigma } \left[\frac{1-s_{2}^{2} }{2K} \right]+h_{2} \left[\frac{1-s_{2} s_{1} }{K+h} \right]+h_{3} \left[\frac{1-{s_{2} \mathord{\left/ {\vphantom {s_{2} s_{1} }} \right. \kern-\nulldelimiterspace} s_{1} } }{K-h} \right] + +.. math:: + :label: 3.26 + + a_{2} =\frac{h_{4} }{\sigma } \left[\frac{1-s_{2}^{2} }{2K} \right]+h_{5} \left[\frac{1-s_{2} s_{1} }{K+h} \right]+h_{6} \left[\frac{1-{s_{2} \mathord{\left/ {\vphantom {s_{2} s_{1} }} \right. \kern-\nulldelimiterspace} s_{1} } }{K-h} \right]. + +For diffuse radiation, the absorbed radiation for sunlit leaves is + +.. math:: + :label: 3.27 + + \vec{I}_{sun,\Lambda }^{} =\left[\frac{1-\omega _{\Lambda } }{\bar{\mu }} \right]\left(a_{1} +a_{2} \right) + +and for shaded leaves is + +.. math:: + :label: 3.28 + + \vec{I}_{sha,\Lambda }^{} =\vec{I}_{\Lambda }^{} -\vec{I}_{sun,\Lambda }^{} + +with + +.. math:: + :label: 3.29 + + a_{1} =h_{7} \left[\frac{1-s_{2} s_{1} }{K+h} \right]+h_{8} \left[\frac{1-{s_{2} \mathord{\left/ {\vphantom {s_{2} s_{1} }} \right. \kern-\nulldelimiterspace} s_{1} } }{K-h} \right] + +.. math:: + :label: 3.30 + + a_{2} =h_{9} \left[\frac{1-s_{2} s_{1} }{K+h} \right]+h_{10} \left[\frac{1-{s_{2} \mathord{\left/ {\vphantom {s_{2} s_{1} }} \right. \kern-\nulldelimiterspace} s_{1} } }{K-h} \right]. + +The parameters :math:`h_{1}` –:math:`h_{10}` , :math:`\sigma` , +:math:`h`, :math:`s_{1}` , and :math:`s_{2}` are from Sellers (1985) +[note the error in :math:`h_{4}` in Sellers (1985)]: + +.. math:: + :label: 3.31 + + b=1-\omega _{\Lambda } +\omega _{\Lambda } \beta _{\Lambda } + +.. math:: + :label: 3.32 + + c=\omega _{\Lambda } \beta _{\Lambda } + +.. math:: + :label: 3.33 + + d=\omega _{\Lambda } \bar{\mu }K\beta _{0,\, \Lambda } + +.. math:: + :label: 3.34 + + f=\omega _{\Lambda } \bar{\mu }K\left(1-\beta _{0,\, \Lambda } \right) + +.. math:: + :label: 3.35 + + h=\frac{\sqrt{b^{2} -c^{2} } }{\bar{\mu }} + +.. math:: + :label: 3.36 + + \sigma =\left(\bar{\mu }K\right)^{2} +c^{2} -b^{2} + +.. math:: + :label: 3.37 + + u_{1} =b-{c\mathord{\left/ {\vphantom {c \alpha _{g,\, \Lambda }^{\mu } }} \right. \kern-\nulldelimiterspace} \alpha _{g,\, \Lambda }^{\mu } } {\rm \; or\; }u_{1} =b-{c\mathord{\left/ {\vphantom {c \alpha _{g,\, \Lambda } }} \right. \kern-\nulldelimiterspace} \alpha _{g,\, \Lambda } } + +.. math:: + :label: 3.38 + + u_{2} =b-c\alpha _{g,\, \Lambda }^{\mu } {\rm \; or\; }u_{2} =b-c\alpha _{g,\, \Lambda } + +.. math:: + :label: 3.39 + + u_{3} =f+c\alpha _{g,\, \Lambda }^{\mu } {\rm \; or\; }u_{3} =f+c\alpha _{g,\, \Lambda } + +.. math:: + :label: 3.40 + + s_{1} =\exp \left\{-\min \left[h\left(L+S\right),40\right]\right\} + +.. math:: + :label: 3.41 + + s_{2} =\exp \left\{-\min \left[K\left(L+S\right),40\right]\right\} + +.. math:: + :label: 3.42 + + p_{1} =b+\bar{\mu }h + +.. math:: + :label: 3.43 + + p_{2} =b-\bar{\mu }h + +.. math:: + :label: 3.44 + + p_{3} =b+\bar{\mu }K + +.. math:: + :label: 3.45 + + p_{4} =b-\bar{\mu }K + +.. math:: + :label: 3.46 + + d_{1} =\frac{p_{1} \left(u_{1} -\bar{\mu }h\right)}{s_{1} } -p_{2} \left(u_{1} +\bar{\mu }h\right)s_{1} + +.. math:: + :label: 3.47 + + d_{2} =\frac{u_{2} +\bar{\mu }h}{s_{1} } -\left(u_{2} -\bar{\mu }h\right)s_{1} + +.. math:: + :label: 3.48 + + h_{1} =-dp_{4} -cf + +.. math:: + :label: 3.49 + + h_{2} =\frac{1}{d_{1} } \left[\left(d-\frac{h_{1} }{\sigma } p_{3} \right)\frac{\left(u_{1} -\bar{\mu }h\right)}{s_{1} } -p_{2} \left(d-c-\frac{h_{1} }{\sigma } \left(u_{1} +\bar{\mu }K\right)\right)s_{2} \right] + +.. math:: + :label: 3.50 + + h_{3} =\frac{-1}{d_{1} } \left[\left(d-\frac{h_{1} }{\sigma } p_{3} \right)\left(u_{1} +\bar{\mu }h\right)s_{1} -p_{1} \left(d-c-\frac{h_{1} }{\sigma } \left(u_{1} +\bar{\mu }K\right)\right)s_{2} \right] + +.. math:: + :label: 3.51 + + h_{4} =-fp_{3} -cd + +.. math:: + :label: 3.52 + + h_{5} =\frac{-1}{d_{2} } \left[\left(\frac{h_{4} \left(u_{2} +\bar{\mu }h\right)}{\sigma s_{1} } \right)+\left(u_{3} -\frac{h_{4} }{\sigma } \left(u_{2} -\bar{\mu }K\right)\right)s_{2} \right] + +.. math:: + :label: 3.53 + + h_{6} =\frac{1}{d_{2} } \left[\frac{h_{4} }{\sigma } \left(u_{2} -\bar{\mu }h\right)s_{1} +\left(u_{3} -\frac{h_{4} }{\sigma } \left(u_{2} -\bar{\mu }K\right)\right)s_{2} \right] + +.. math:: + :label: 3.54 + + h_{7} =\frac{c\left(u_{1} -\bar{\mu }h\right)}{d_{1} s_{1} } + +.. math:: + :label: 3.55 + + h_{8} =\frac{-c\left(u_{1} +\bar{\mu }h\right)s_{1} }{d_{1} } + +.. math:: + :label: 3.56 + + h_{9} =\frac{u_{2} +\bar{\mu }h}{d_{2} s_{1} } + +.. math:: + :label: 3.57 + + h_{10} =\frac{-s_{1} \left(u_{2} -\bar{\mu }h\right)}{d_{2} } . + +Plant functional type optical properties (Table 3.1) for trees and +shrubs are from Dorman and Sellers (1989). Leaf and stem optical +properties (placeVIS and NIR reflectance and transmittance) were derived +for grasslands and crops from full optical range spectra of measured +optical properties (Asner et al. 1998). Optical properties for +intercepted snow (Table 3.2) are from Sellers et al. (1986). + +Table 3.1. Plant functional type optical properties + ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Plant Functional Type | :math:`\chi _{L}` | :math:`\alpha _{vis}^{leaf}` | :math:`\alpha _{nir}^{leaf}` | :math:`\alpha _{vis}^{stem}` | :math:`\alpha _{nir}^{stem}` | :math:`\tau _{vis}^{leaf}` | :math:`\tau _{nir}^{leaf}` | :math:`\tau _{vis}^{stem}` | :math:`\tau _{nir}^{stem}` | ++==================================+======================+=================================+=================================+=================================+=================================+===============================+===============================+===============================+===============================+ +| NET Temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| NET Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| NDT Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BET Tropical | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BET temperate | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BDT tropical | 0.01 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BDT temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BDT boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BES temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BDS temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| BDS boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| C\ :math:`{}_{3}` arctic grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| C\ :math:`{}_{3}` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| C\ :math:`{}_{4}` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Crop R | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Crop I | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Corn R | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Corn I | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Temp Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Temp Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Winter Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Winter Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Soybean R | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ +| Soybean I | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | ++----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + +Table 3.2. Intercepted snow optical properties + ++-----------------------------+-------+-------+ +| Parameter | vis | nir | ++-----------------------------+-------+-------+ +| :math:`\omega ^{sno}` | 0.8 | 0.4 | ++-----------------------------+-------+-------+ +| :math:`\beta ^{sno}` | 0.5 | 0.5 | ++-----------------------------+-------+-------+ +| :math:`\beta _{0}^{sno}` | 0.5 | 0.5 | ++-----------------------------+-------+-------+ + +Ground Albedos +------------------ + +The overall direct beam :math:`\alpha _{g,\, \Lambda }^{\mu }` and +diffuse :math:`\alpha _{g,\, \Lambda }` ground albedos are weighted +combinations of “soil†and snow albedos + +.. math:: + :label: 3.58 + + \alpha _{g,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda }^{\mu } \left(1-f_{sno} \right)+\alpha _{sno,\, \Lambda }^{\mu } f_{sno} + +.. math:: + :label: 3.59 + + \alpha _{g,\, \Lambda } =\alpha _{soi,\, \Lambda } \left(1-f_{sno} \right)+\alpha _{sno,\, \Lambda } f_{sno} + +where :math:`f_{sno}` is the fraction of the ground covered with snow +(section 7.2.1). + +:math:`\alpha _{soi,\, \Lambda }^{\mu }` and +:math:`\alpha _{soi,\, \Lambda }` vary with glacier, lake, wetland, and +soil surfaces. Glacier albedos are from Paterson (1994) + +.. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.6 + +.. math:: \alpha _{soi,\, nir}^{\mu } =\alpha _{soi,\, nir} =0.4. + +Unfrozen lake and wetland albedos depend on the cosine of the solar +zenith angle :math:`\mu` + +.. math:: + :label: 3.60 + + \alpha _{soi,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda } =0.05\left(\mu +0.15\right)^{-1} . + +Frozen lake and wetland albedos are from NCAR LSM (Bonan 1996) + +.. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.60 + +.. math:: \alpha _{soi,\, nir}^{\mu } =\alpha _{soi,\, nir} =0.40. + +As in NCAR LSM (Bonan 1996), soil albedos vary with color class + +.. math:: + :label: 3.61 + + \alpha _{soi,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda } =\left(\alpha _{sat,\, \Lambda } +\Delta \right)\le \alpha _{dry,\, \Lambda } + +where :math:`\Delta` depends on the volumetric water content of the +first soil layer :math:`\theta _{1}` (section 7.4) as +:math:`\Delta =0.11-0.40\theta _{1} >0`, and +:math:`\alpha _{sat,\, \Lambda }` and +:math:`\alpha _{dry,\, \Lambda }` are albedos for saturated and dry +soil color classes (Table 3.3). + +CLM soil colors are prescribed so that they best reproduce observed +MODIS local solar noon surface albedo values at the CLM grid cell +following the methods of Lawrence and Chase (2007). The soil colors are +fitted over the range of 20 soil classes shown in Table 3.3 and compared +to the MODIS monthly local solar noon all-sky surface albedo as +described in Strahler et al. (1999) and Schaaf et al. (2002). The CLM +two-stream radiation model was used to calculate the model equivalent +surface albedo using climatological monthly soil moisture along with the +vegetation parameters of PFT fraction, LAI, and SAI. The soil color that +produced the closest all-sky albedo in the two-stream radiation model +was selected as the best fit for the month. The fitted monthly soil +colors were averaged over all snow-free months to specify a +representative soil color for the grid cell. In cases where there was no +snow-free surface albedo for the year, the soil color derived from +snow-affected albedo was used to give a representative soil color that +included the effects of the minimum permanent snow cover. + +Table 3.3. Dry and saturated soil albedos + ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| Color Class | vis | nir | vis | nir | Color Class | vis | nir | vis | nir | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +| 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | ++---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + +Snow Albedo +^^^^^^^^^^^^^^^^^ + +Snow albedo and solar absorption within each snow layer are simulated +with the Snow, Ice, and Aerosol Radiative Model (SNICAR), which +incorporates a two-stream radiative transfer solution from Toon et al. +(1989). Albedo and the vertical absorption profile depend on solar +zenith angle, albedo of the substrate underlying snow, mass +concentrations of atmospheric-deposited aerosols (black carbon, mineral +dust, and organic carbon), and ice effective grain size +(:math:`r_{e}`), which is simulated with a snow aging routine +described in section 3.2.3. Representation of impurity mass +concentrations within the snowpack is described in section 7.2.4. +Implementation of SNICAR in CLM is also described somewhat by Flanner +and Zender (2005) and Flanner et al. (2007). + +The two-stream solution requires the following bulk optical properties +for each snow layer and spectral band: extinction optical depth +(:math:`\tau`), single-scatter albedo (:math:`\omega`), and +scattering asymmetry parameter (*g*). The snow layers used for radiative +calculations are identical to snow layers applied elsewhere in CLM, +except for the case when snow mass is greater than zero but no snow +layers exist. When this occurs, a single radiative layer is specified to +have the column snow mass and an effective grain size of freshly-fallen +snow (section 3.2.3). The bulk optical properties are weighted functions +of each constituent *k*, computed for each snow layer and spectral band +as + +.. math:: + :label: 3.62 + + \tau =\sum _{1}^{k}\tau _{k} + +.. math:: + :label: 3.63 + + \omega =\frac{\sum _{1}^{k}\omega _{k} \tau _{k} }{\sum _{1}^{k}\tau _{k} } + +.. math:: + :label: 3.64 + + g=\frac{\sum _{1}^{k}g_{k} \omega _{k} \tau _{k} }{\sum _{1}^{k}\omega _{k} \tau _{k} } + +For each constituent (ice, two black carbon species, two organic carbon +species, and four dust species), :math:`\omega`, *g*, and +the mass extinction cross-section :math:`\psi` (:math:`\text{m}^{2} \text{kg}^{-1}`) +are computed offline with Mie Theory, e.g., +applying the computational technique from Bohren and Huffman (1983). The +extinction optical depth for each constituent depends on its mass +extinction cross-section and layer mass, :math:`w _{k} (\text{kg m} ^{-2}`) as + +.. math:: + :label: 3.65 + + \tau _{k} =\psi _{k} w_{k} + +The two-stream solution (Toon et al. 1989) applies a tri-diagonal matrix +solution to produce upward and downward radiative fluxes at each layer +interface, from which net radiation, layer absorption, and surface +albedo are easily derived. Solar fluxes are computed in five spectral +bands, listed in Table 3.4. Because snow albedo varies strongly across +the solar spectrum, it was determined that four bands were needed to +accurately represent the near-infrared (NIR) characteristics of snow, +whereas only one band was needed for the visible spectrum. Boundaries of +the NIR bands were selected to capture broad radiative features and +maximize accuracy and computational efficiency. We partition NIR +(0.7-5.0 :math:`\mu` m) surface downwelling flux from CLM +according to the weights listed in Table 3.4, which are unique for +diffuse and direct incident flux. These fixed weights were determined +with offline hyperspectral radiative transfer calculations for an +atmosphere typical of mid-latitude winter (Flanner et al. 2007). The +tri-diagonal solution includes intermediate terms that allow for easy +interchange of two-stream techniques. We apply the Eddington solution +for the visible band (following Wiscombe and Warren 1980) and the +hemispheric mean solution (Toon et al. 1989) for NIR bands. These +choices were made because the Eddington scheme works well for highly +scattering media, but can produce negative albedo for absorptive NIR +bands with diffuse incident flux. Delta scalings are applied to +:math:`\tau`, :math:`\omega`, and :math:`g` (Wiscombe and Warren 1980) in +all spectral bands, producing effective values (denoted with \*) that +are applied in the two-stream solution + +.. math:: + :label: 3.66 + + \tau ^{*} =\left(1-\omega g^{2} \right)\tau + +.. math:: + :label: 3.67 + + \omega ^{*} =\frac{\left(1-g^{2} \right)\omega }{1-g^{2} \omega } + +.. math:: + :label: 3.68 + + g^{*} =\frac{g}{1+g} + +Table 3.4. Spectral bands and weights used for snow radiative transfer + ++---------------------------------------------------------+----------------------+------------------+ +| Spectral band | Direct-beam weight | Diffuse weight | ++=========================================================+======================+==================+ +| Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | ++---------------------------------------------------------+----------------------+------------------+ +| Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | ++---------------------------------------------------------+----------------------+------------------+ +| Band 3: 1.0-1.2\ :math:`\mu`\ m (near-IR) | 0.181 | 0.202 | ++---------------------------------------------------------+----------------------+------------------+ +| Band 4: 1.2-1.5\ :math:`\mu`\ m (near-IR) | 0.121 | 0.109 | ++---------------------------------------------------------+----------------------+------------------+ +| Band 5: 1.5-5.0\ :math:`\mu`\ m (near-IR) | 0.204 | 0.103 | ++---------------------------------------------------------+----------------------+------------------+ + +Under direct-beam conditions, singularities in the radiative +approximation are occasionally approached in spectral bands 4 and 5 that +produce unrealistic conditions (negative energy absorption in a layer, +negative albedo, or total absorbed flux greater than incident flux). +When any of these three conditions occur, the Eddington approximation is +attempted instead, and if both approximations fail, the cosine of the +solar zenith angle is adjusted by 0.02 (conserving incident flux) and a +warning message is produced. This situation occurs in only about 1 in +10 :math:`{}^{6}` computations of snow albedo. After looping over the +five spectral bands, absorption fluxes and albedo are averaged back into +the bulk NIR band used by the rest of CLM. + +Soil albedo (or underlying substrate albedo), which is defined for +visible and NIR bands, is a required boundary condition for the snow +radiative transfer calculation. Currently, the bulk NIR soil albedo is +applied to all four NIR snow bands. With ground albedo as a lower +boundary condition, SNICAR simulates solar absorption in all snow layers +as well as the underlying soil or ground. With a thin snowpack, +penetrating solar radiation to the underlying soil can be quite large +and heat cannot be released from the soil to the atmosphere in this +situation. Thus, solar radiation penetration is limited to snowpacks +with total snow depth greater than or equal to 0.1 m +(:math:`z_{sno} \ge 0.1`) to prevent unrealistic soil warming within a +single timestep. + +The radiative transfer calculation is performed twice for each column +containing a mass of snow greater than +:math:`1 \times 10^{-30} \text{kg m}^{-2}` (excluding lake and urban columns); once each for +direct-beam and diffuse incident flux. Absorption in each layer +:math:`i` of pure snow is initially recorded as absorbed flux per unit +incident flux on the ground (:math:`S_{sno,\, i}` ), as albedos must be +calculated for the next timestep with unknown incident flux. The snow +absorption fluxes that are used for column temperature calculations are + +.. math:: + :label: ZEqnNum275338 + + S_{g,\, i} =S_{sno,\, i} \left(1-\alpha _{sno} \right) + +This weighting is performed for direct-beam and diffuse, visible and NIR +fluxes. After the ground-incident fluxes (transmitted through the +vegetation canopy) have been calculated for the current time step +(sections 3.1 and 4.1), the layer absorption factors + +(:math:`S_{g,\, i}`) are multiplied by the ground-incident fluxes to +produce solar absorption (W m\ :math:`{}^{-2}`) in each snow layer and +the underlying ground. + +Snowpack Optical Properties +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Ice optical properties for the five spectral bands are derived offline +and stored in a namelist-defined lookup table for online retrieval (see +CLM4.5 User’s Guide). Mie properties are first computed at fine spectral +resolution (470 bands), and are then weighted into the five bands +applied by CLM according to incident solar flux, +:math:`I^{\downarrow } (\lambda )`. For example, the broadband +mass-extinction cross section (:math:`\bar{\psi }`) over wavelength +interval :math:`\lambda _{1}` to :math:`\lambda _{2}` is + +.. math:: + :label: 3.70 + + \bar{\psi }=\frac{\int _{\lambda _{1} }^{\lambda _{2} }\psi \left(\lambda \right) I^{\downarrow } \left(\lambda \right){\rm d}\lambda }{\int _{\lambda _{1} }^{\lambda _{2} }I^{\downarrow } \left(\lambda \right){\rm d}\lambda } + +Broadband single-scatter albedo (:math:`\bar{\omega }`) is additionally +weighted by the diffuse albedo for a semi-infinite snowpack (:math:`\alpha _{sno}`) + +.. math:: + :label: 3.71 + + \bar{\omega }=\frac{\int _{\lambda _{1} }^{\lambda _{2} }\omega (\lambda )I^{\downarrow } ( \lambda )\alpha _{sno} (\lambda ){\rm d}\lambda }{\int _{\lambda _{1} }^{\lambda _{2} }I^{\downarrow } ( \lambda )\alpha _{sno} (\lambda ){\rm d}\lambda } + +Inclusion of this additional albedo weight was found to improve accuracy +of the five-band albedo solutions (relative to 470-band solutions) +because of the strong dependence of optically-thick snowpack albedo on +ice grain single-scatter albedo (Flanner et al. 2007). The lookup tables +contain optical properties for lognormal distributions of ice particles +over the range of effective radii: 30\ :math:`\mu`\ m +:math:`< r _{e} < \text{1500} \mu \text{m}`, at 1 :math:`\mu` m resolution. Single-scatter albedos for the end-members of this size +range are listed in Table 3.5. + +Optical properties for black carbon are described in Flanner et al. +(2007). Single-scatter albedo, mass extinction cross-section, and +asymmetry parameter values for all snowpack species, in the five +spectral bands used, are listed in Tables 3.5, 3.6, and 3.7. These +properties were also derived with Mie Theory, using various published +sources of indices of refraction and assumptions about particle size +distribution. Weighting into the five CLM spectral bands was determined +only with incident solar flux, as in equation . + +Table 3.5. Single-scatter albedo values used for snowpack impurities and ice + ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | ++================================================================+==========+==========+==========+==========+==========+ +| Hydrophilic black carbon | 0.516 | 0.434 | 0.346 | 0.276 | 0.139 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic black carbon | 0.288 | 0.187 | 0.123 | 0.089 | 0.040 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophilic organic carbon | 0.997 | 0.994 | 0.990 | 0.987 | 0.951 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic organic carbon | 0.963 | 0.921 | 0.860 | 0.814 | 0.744 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 1 | 0.979 | 0.994 | 0.993 | 0.993 | 0.953 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 2 | 0.944 | 0.984 | 0.989 | 0.992 | 0.983 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 3 | 0.904 | 0.965 | 0.969 | 0.973 | 0.978 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 4 | 0.850 | 0.940 | 0.948 | 0.953 | 0.955 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 0.9999 | 0.9999 | 0.9992 | 0.9938 | 0.9413 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 0.9998 | 0.9960 | 0.9680 | 0.8730 | 0.5500 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ + +Table 3.6. Mass extinction values (:math:`\text{m}^{2} \text{kg}^{-1}`) used for snowpack impurities and ice. + ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | ++================================================================+==========+==========+==========+==========+==========+ +| Hydrophilic black carbon | 25369 | 12520 | 7739 | 5744 | 3527 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic black carbon | 11398 | 5923 | 4040 | 3262 | 2224 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophilic organic carbon | 37774 | 22112 | 14719 | 10940 | 5441 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic organic carbon | 3289 | 1486 | 872 | 606 | 248 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 1 | 2687 | 2420 | 1628 | 1138 | 466 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 2 | 841 | 987 | 1184 | 1267 | 993 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 3 | 388 | 419 | 400 | 397 | 503 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 4 | 197 | 203 | 208 | 205 | 229 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 55.7 | 56.1 | 56.3 | 56.6 | 57.3 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 1.09 | 1.09 | 1.09 | 1.09 | 1.1 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ + +Table 3.7. Asymmetry scattering parameters used for snowpack impurities and ice. + ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | ++================================================================+==========+==========+==========+==========+==========+ +| Hydrophilic black carbon | 0.52 | 0.34 | 0.24 | 0.19 | 0.10 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic black carbon | 0.35 | 0.21 | 0.15 | 0.11 | 0.06 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophilic organic carbon | 0.77 | 0.75 | 0.72 | 0.70 | 0.64 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Hydrophobic organic carbon | 0.62 | 0.57 | 0.54 | 0.51 | 0.44 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 1 | 0.69 | 0.72 | 0.67 | 0.61 | 0.44 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 2 | 0.70 | 0.65 | 0.70 | 0.72 | 0.70 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 3 | 0.79 | 0.75 | 0.68 | 0.63 | 0.67 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Dust 4 | 0.83 | 0.79 | 0.77 | 0.76 | 0.73 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 30\ :math:`\mu`\ m) | 0.88 | 0.88 | 0.88 | 0.88 | 0.90 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ +| Ice (:math:`r _{e}` = 1500\ :math:`\mu`\ m) | 0.89 | 0.90 | 0.90 | 0.92 | 0.97 | ++----------------------------------------------------------------+----------+----------+----------+----------+----------+ + +Snow Aging +^^^^^^^^^^^^^^^^ + +Snow aging is represented as evolution of the ice effective grain size +(:math:`r_{e}`). Previous studies have shown that use of spheres +which conserve the surface area-to-volume ratio (or specific surface +area) of ice media composed of more complex shapes produces relatively +small errors in simulated hemispheric fluxes (e.g., Grenfell and Warren +1999). Effective radius is the surface area-weighted mean radius of an +ensemble of spherical particles and is directly related to specific +surface area (*SSA*) as +:math:`r_{e} ={3\mathord{\left/ {\vphantom {3 \left(\rho _{ice} SSA\right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} SSA\right)}` , +where :math:`\rho_{ice}` is the density of ice. Hence, +:math:`r_{e}` is a simple and practical metric for relating the +snowpack microphysical state to dry snow radiative characteristics. + +Wet snow processes can also drive rapid changes in albedo. The presence +of liquid water induces rapid coarsening of the surrounding ice grains +(e.g., Brun 1989), and liquid water tends to refreeze into large ice +clumps that darken the bulk snowpack. The presence of small liquid +drops, by itself, does not significantly darken snowpack, as ice and +water have very similar indices of refraction throughout the solar +spectrum. Pooled or ponded water, however, can significantly darken +snowpack by greatly reducing the number of refraction events per unit +mass. This influence is not currently accounted for. + +The net change in effective grain size occurring each time step is +represented in each snow layer as a summation of changes caused by dry +snow metamorphism (:math:`dr_{e,dry}`), liquid water-induced +metamorphism (:math:`dr_{e,wet}`), refreezing of liquid water, and +addition of freshly-fallen snow. The mass of each snow layer is +partitioned into fractions of snow carrying over from the previous time +step (:math:`f_{old}`), freshly-fallen snow +(:math:`f_{new}`), and refrozen liquid water +(:math:`f_{rfz}`), such that snow :math:`r_{e}` is updated +each time step *t* as + +.. math:: + :label: 3.72 + + r_{e} \left(t\right)=\left[r_{e} \left(t-1\right)+dr_{e,\, dry} +dr_{e,\, wet} \right]f_{old} +r_{e,\, 0} f_{new} +r_{e,\, rfz} f_{rfrz} + +Here, the effective radius of freshly-fallen snow +(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface +area of 60 :math:`\text{m}^{2} \text{kg}^{-1}`), and the effective +radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. + +Dry snow aging is based on a microphysical model described by Flanner +and Zender (2006). This model simulates diffusive vapor flux amongst +collections of ice crystals with various size and inter-particle +spacing. Specific surface area and effective radius are prognosed for +any combination of snow temperature, temperature gradient, density, and +initial size distribution. The combination of warm snow, large +temperature gradient, and low density produces the most rapid snow +aging, whereas aging proceeds slowly in cold snow, regardless of +temperature gradient and density. Because this model is currently too +computationally expensive for inclusion in climate models, we fit +parametric curves to model output over a wide range of snow conditions +and apply these parameters in CLM. The functional form of the parametric +equation is + +.. math:: + :label: 3.73 + + \frac{dr_{e,\, dry} }{dt} =\left(\frac{dr_{e} }{dt} \right)_{0} \left(\frac{\eta }{\left(r_{e} -r_{e,\, 0} \right)+\eta } \right)^{{1\mathord{\left/ {\vphantom {1 \kappa }} \right. \kern-\nulldelimiterspace} \kappa } } + +The parameters :math:`{(\frac{dr_{e}}{dt}})_{0}`, +:math:`\eta`, and :math:`\kappa` are retrieved interactively from a +lookup table with dimensions corresponding to snow temperature, +temperature gradient, and density. The domain covered by this lookup +table includes temperature ranging from 223 to 273 K, temperature +gradient ranging from 0 to 300 K m\ :math:`{}^{-1}`, and density ranging +from 50 to 400 kg m\ :math:`{}^{-3}`. Temperature gradient is calculated +at the midpoint of each snow layer *n*, using mid-layer temperatures +(:math:`T_{n}`) and snow layer thicknesses (:math:`dz_{n}`), as + +.. math:: + :label: 3.74 + + \left(\frac{dT}{dz} \right)_{n} =\frac{1}{dz_{n} } abs\left[\frac{T_{n-1} dz_{n} +T_{n} dz_{n-1} }{dz_{n} +dz_{n-1} } +\frac{T_{n+1} dz_{n} +T_{n} dz_{n+1} }{dz_{n} +dz_{n+1} } \right] + +For the bottom snow layer (:math:`n=0`), +:math:`T_{n+1}` is taken as the temperature of the +top soil layer, and for the top snow layer it is assumed that +:math:`T_{n-1}` = :math:`T_{n}`. + +The contribution of liquid water to enhanced metamorphism is based on +parametric equations published by Brun (1989), who measured grain +growth rates under different liquid water contents. This relationship, +expressed in terms of :math:`r_{e} (\mu \text{m})` and +subtracting an offset due to dry aging, depends on the mass liquid water +fraction :math:`f_{liq}` as + +.. math:: + :label: 3.75 + + \frac{dr_{e} }{dt} =\frac{10^{18} C_{1} f_{liq} ^{3} }{4\pi r_{e} ^{2} } + +The constant *C*\ :math:`{}_{1}` is +4.22\ :math:`\times`\ 10\ :math:`{}^{-13}`, and: +:math:`f_{liq} =w_{liq} /(w_{liq} +w_{ice} )`\ (section 7.2). + +In cases where snow mass is greater than zero, but a snow layer has not +yet been defined, :math:`r_{e}` is set to :math:`r_{e,0}`. When snow layers are combined or +divided, :math:`r_{e}` is calculated as a mass-weighted mean of +the two layers, following computations of other state variables (section +7.2.7). Finally, the allowable range of :math:`r_{e}`, +corresponding to the range over which Mie optical properties have been +defined, is 30-1500\ :math:`\mu` m. + +Solar Zenith Angle +---------------------- + +The CLM uses the same formulation for solar zenith angle as the +Community Atmosphere Model. The cosine of the solar zenith angle +:math:`\mu` is + +.. math:: + :label: 3.76 + + \mu =\sin \phi \sin \delta -\cos \phi \cos \delta \cos h + +where :math:`h` is the solar hour angle (radians) (24 hour periodicity), +:math:`\delta` is the solar declination angle (radians), and +:math:`\phi` is latitude (radians) (positive in Northern Hemisphere). +The solar hour angle :math:`h` (radians) is + +.. math:: + :label: 3.77 + + h=2\pi d+\theta + +where :math:`d` is calendar day (:math:`d=0.0` at 0Z on January 1), and +:math:`\theta` is longitude (radians) (positive east of the +CityplaceGreenwich meridian). + +The solar declination angle :math:`\delta` is calculated as in Berger +(1978a,b) and is valid for one million years past or hence, relative to +1950 A.D. The orbital parameters may be specified directly or the +orbital parameters are calculated for the desired year. The required +orbital parameters to be input by the user are the obliquity of the +Earth :math:`\varepsilon` (degrees, +:math:`-90^{\circ } <\varepsilon <90^{\circ }` ), Earth’s eccentricity +:math:`e` (:math:`0.00} \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+\pi \qquad {\rm for\; }e^{\cos } <{\rm -1}\times {\rm 10}^{{\rm -8}} } \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+2\pi \qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } <0} \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]\qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } \ge 0} \end{array}\right\}. + +The numerical solution for the longitude of the perihelion +:math:`\tilde{\omega }` is constrained to be between 0 and 360 degrees +(measured from the autumn equinox). A constant 180 degrees is then added +to :math:`\tilde{\omega }` because the Sun is considered as revolving +around the Earth (geocentric coordinate system) (Berger et al. 1993). + +Table 3.8. Orbital parameters + ++--------------------------------------+-------------+ +| Parameter | | ++======================================+=============+ +| :math:`\varepsilon *` | 23.320556 | ++--------------------------------------+-------------+ +| :math:`\tilde{\psi }` (arcseconds) | 50.439273 | ++--------------------------------------+-------------+ +| :math:`\zeta` (degrees) | 3.392506 | ++--------------------------------------+-------------+ diff --git a/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst b/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst new file mode 100644 index 0000000000..45d03e83f8 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst @@ -0,0 +1,289 @@ +Radiative Fluxes +=================== + +The net radiation at the surface is +:math:`\left(\vec{S}_{v} +\vec{S}_{g} \right)-\left(\vec{L}_{v} +\vec{L}_{g} \right)`, +where :math:`\vec{S}` is the net solar flux absorbed by the vegetation +(“vâ€) and the ground (“gâ€) and :math:`\vec{L}` is the net longwave flux +(positive toward the atmosphere) (W m\ :math:`{}^{-2}`). + +Solar Fluxes +---------------- + +Figure 4.1 illustrates the direct beam and diffuse fluxes in the canopy. +:math:`I\, \uparrow _{\Lambda }^{\mu }` and +:math:`I\, \uparrow _{\Lambda }` are the upward diffuse fluxes, per +unit incident direct beam and diffuse flux (section 3.1). +:math:`I\, \downarrow _{\Lambda }^{\mu }` and +:math:`I\, \downarrow _{\Lambda }` \ are the downward diffuse fluxes +below the vegetation per unit incident direct beam and diffuse radiation +(section 3.1). The direct beam flux transmitted through the canopy, per +unit incident flux, is :math:`e^{-K\left(L+S\right)}` . +:math:`\vec{I}_{\Lambda }^{\mu }` and :math:`\vec{I}_{\Lambda }^{}` +are the fluxes absorbed by the vegetation, per unit incident direct beam +and diffuse radiation (section 3.1). +:math:`\alpha _{g,\, \Lambda }^{\mu }` and +:math:`\alpha _{g,\, \Lambda }` are the direct beam and diffuse ground +albedos (section 3.2). :math:`L` and :math:`S` are the exposed leaf area +index and stem area index (section 2.1.4). :math:`K` is the optical +depth of direct beam per unit leaf and stem area (section 3.1). + +Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse +solar radiation, and (c) longwave radiation absorbed, transmitted, and +reflected by vegetation and ground. + +For clarity, terms involving :math:`T^{n+1} -T^{n}` are not shown in +(c). + +.. image:: image1.png + +The total solar radiation absorbed by the vegetation and ground is + +.. math:: + :label: 4.1 + + \vec{S}_{v} =\sum _{\Lambda }S_{atm} \, \downarrow _{\Lambda }^{\mu } \overrightarrow{I}_{\Lambda }^{\mu } +S_{atm} \, \downarrow _{\Lambda } \overrightarrow{I}_{\Lambda } + +.. math:: + :label: 4.2 + + \begin{array}{l} {\vec{S}_{g} =\sum _{\Lambda }S_{atm} \, \downarrow _{\Lambda }^{\mu } e^{-K\left(L+S\right)} \left(1-\alpha _{g,\, \Lambda }^{\mu } \right) +} \\ {\qquad \left(S_{atm} \, \downarrow _{\Lambda }^{\mu } I\downarrow _{\Lambda }^{\mu } +S_{atm} \downarrow _{\Lambda } I\downarrow _{\Lambda } \right)\left(1-\alpha _{g,\, \Lambda } \right)} \end{array} + +where :math:`S_{atm} \, \downarrow _{\Lambda }^{\mu }` and +:math:`S_{atm} \, \downarrow _{\Lambda }` are the incident direct beam +and diffuse solar fluxes (W m\ :math:`{}^{-2}`). For non-vegetated +surfaces, :math:`e^{-K\left(L+S\right)} =1`, +:math:`\overrightarrow{I}_{\Lambda }^{\mu } =\overrightarrow{I}_{\Lambda } =0`, +:math:`I\, \downarrow _{\Lambda }^{\mu } =0`, and +:math:`I\, \downarrow _{\Lambda } =1`, so that + +.. math:: + :label: 4.3 + + \begin{array}{l} {\vec{S}_{g} =\sum _{\Lambda }S_{atm} \, \downarrow _{\Lambda }^{\mu } \left(1-\alpha _{g,\, \Lambda }^{\mu } \right) +S_{atm} \, \downarrow _{\Lambda } \left(1-\alpha _{g,\, \Lambda } \right)} \\ {\vec{S}_{v} =0} \end{array}. + +Solar radiation is conserved as + +.. math:: + :label: 4.4 + + \sum _{\Lambda }\left(S_{atm} \, \downarrow _{\Lambda }^{\mu } +S_{atm} \, \downarrow _{\Lambda } \right)=\left(\vec{S}_{v} +\vec{S}_{g} \right) +\sum _{\Lambda }\left(S_{atm} \, \downarrow _{\Lambda }^{\mu } I\uparrow _{\Lambda }^{\mu } +S_{atm} \, \downarrow _{\Lambda } I\uparrow _{\Lambda } \right) + +where the latter term in parentheses is reflected solar radiation. + +Photosynthesis and transpiration depend non-linearly on solar radiation, +via the light response of stomata. The canopy is treated as two leaves +(sunlit and shaded) and the solar radiation in the visible waveband +(:math:`<` 0.7 µm) absorbed by the vegetation is apportioned to the +sunlit and shaded leaves (section 3.1). The absorbed photosynthetically +active (visible waveband) radiation averaged over the sunlit canopy (per +unit plant area) is + +.. math:: + :label: 4.5 + + \phi ^{sun} ={\left(\vec{I}_{sun,vis}^{\mu } S_{atm} \downarrow _{vis}^{\mu } +\vec{I}_{sun,vis}^{} S_{atm} \downarrow _{vis}^{} \right)\mathord{\left/ {\vphantom {\left(\vec{I}_{sun,vis}^{\mu } S_{atm} \downarrow _{vis}^{\mu } +\vec{I}_{sun,vis}^{} S_{atm} \downarrow _{vis}^{} \right) L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } + +and the absorbed radiation for the average shaded leaf (per unit plant +area) is + +.. math:: + :label: 4.6 + + \phi ^{sha} ={\left(\vec{I}_{sha,vis}^{\mu } S_{atm} \downarrow _{vis}^{\mu } +\vec{I}_{sha,vis}^{} S_{atm} \downarrow _{vis}^{} \right)\mathord{\left/ {\vphantom {\left(\vec{I}_{sha,vis}^{\mu } S_{atm} \downarrow _{vis}^{\mu } +\vec{I}_{sha,vis}^{} S_{atm} \downarrow _{vis}^{} \right) L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } + +with :math:`L^{sun}` and :math:`L^{sha}` the sunlit and shaded plant +area index, respectively. The sunlit plant area index is + +.. math:: + :label: 4.7 + + L^{sun} =\frac{1-e^{-K(L+S)} }{K} + +and the shaded leaf area index is :math:`L^{sha} =(L+S)-L^{sun}` . In +calculating :math:`L^{sun}` , + +.. math:: + :label: 4.8 + + K=\frac{G\left(\mu \right)}{\mu } + +where :math:`G\left(\mu \right)` and :math:`\mu` are parameters in the +two-stream approximation (section 3.1). + +The model uses the two-stream approximation to calculate radiative +transfer of direct and diffuse radiation through a canopy that is +differentiated into leaves that are sunlit and those that are shaded +(section 3.1). The two-stream equations are integrated over all plant +area (leaf and stem area) in the canopy. The model has an optional +(though not supported) multi-layer canopy, as described by Bonan et al. +(2012). The multi-layer model is only intended to address the +non-linearity of light profiles, photosynthesis, and stomatal +conductance in the plant canopy. + +In the multi-layer canopy, canopy-integrated radiative fluxes are +calculated from the two-stream approximation. The model additionally +derives the light profile with depth in the canopy by taking the +derivatives of the absorbed radiative fluxes with respect to plant area +index (:math:`L'=L+S`) and evaluating them incrementally through the +canopy with cumulative plant area index (:math:`x`). The terms +:math:`{d\vec{I}_{sun,\Lambda }^{\mu } (x)\mathord{\left/ {\vphantom {d\vec{I}_{sun,\Lambda }^{\mu } (x) dL'}} \right. \kern-\nulldelimiterspace} dL'}` +and +:math:`{d\vec{I}_{sun,\Lambda }^{} (x)\mathord{\left/ {\vphantom {d\vec{I}_{sun,\Lambda }^{} (x) dL'}} \right. \kern-\nulldelimiterspace} dL'}` +are the direct beam and diffuse solar radiation, respectively, absorbed +by the sunlit fraction of the canopy (per unit plant area) at a depth +defined by the cumulative plant area index :math:`x`; +:math:`{d\vec{I}_{sha,\Lambda }^{\mu } (x)\mathord{\left/ {\vphantom {d\vec{I}_{sha,\Lambda }^{\mu } (x) dL'}} \right. \kern-\nulldelimiterspace} dL'}` \ and +:math:`{d\vec{I}_{sha,\Lambda }^{} (x)\mathord{\left/ {\vphantom {d\vec{I}_{sha,\Lambda }^{} (x) dL'}} \right. \kern-\nulldelimiterspace} dL'}` +are the corresponding fluxes for the shaded fraction of the canopy at +depth :math:`x`. These fluxes are normalized by the sunlit or shaded +fraction at depth :math:`x`, defined by +:math:`f_{sun} =\exp \left(-Kx\right)`, to give fluxes per unit sunlit +or shaded plant area at depth :math:`x`. + +Longwave Fluxes +------------------- + +The net longwave radiation (W m\ :math:`{}^{-2}`) (positive toward the +atmosphere) at the surface is + +.. math:: + :label: 4.9 + + \vec{L}=L\, \uparrow -L_{atm} \, \downarrow + +where :math:`L\, \uparrow` is the upward longwave radiation from the +surface and :math:`L_{atm} \, \downarrow` is the downward atmospheric +longwave radiation (W m\ :math:`{}^{-2}`). The radiative temperature +:math:`T_{rad}` (K) is defined from the upward longwave radiation as + +.. math:: + :label: 4.10 + + T_{rad} =\left(\frac{L\, \uparrow }{\sigma } \right)^{{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } + +where :math:`\sigma` is the Stefan-Boltzmann constant (W +m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6). With reference to +Figure 4.1, the upward longwave radiation from the surface to the +atmosphere is + +.. math:: + :label: 4.11 + + \begin{array}{l} {L\, \uparrow =\delta _{veg} L_{vg} \, \uparrow +\left(1-\delta _{veg} \right)\left(1-\varepsilon _{g} \right)L_{atm} \, \downarrow +} \\ {\qquad \left(1-\delta _{veg} \right)\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right)} \end{array} + +where :math:`L_{vg} \, \uparrow` is the upward longwave radiation from +the vegetation/soil system for exposed leaf and stem area +:math:`L+S\ge 0.05`, :math:`\delta _{veg}` is a step function and is +zero for :math:`L+S<0.05` and one otherwise, :math:`\varepsilon _{g}` +is the ground emissivity, and :math:`T_{g}^{n+1}` and +:math:`T_{g}^{n}` are the snow/soil surface temperatures at the current +and previous time steps, respectively (Chapter 6). + +For non-vegetated surfaces, the above equation reduces to + +.. math:: + :label: 4.12 + + L\, \uparrow =\left(1-\varepsilon _{g} \right)L_{atm} \, \downarrow +\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right) + +where the first term is the atmospheric longwave radiation reflected by +the ground, the second term is the longwave radiation emitted by the +ground, and the last term is the increase (decrease) in longwave +radiation emitted by the ground due to an increase (decrease) in ground +temperature. + +For vegetated surfaces, the upward longwave radiation from the surface +reduces to + +.. math:: + :label: 4.13 + + L\, \uparrow =L_{vg} \, \uparrow +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right) + +where + +.. math:: + :label: 4.14 + + \begin{array}{l} {L_{vg} \, \uparrow =\left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\left(1-\varepsilon _{v} \right)L_{atm} \, \downarrow } \\ {\qquad \qquad +\varepsilon _{v} \left[1+\left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\right]\sigma \left(T_{v}^{n} \right)^{3} \left[T_{v}^{n} +4\left(T_{v}^{n+1} -T_{v}^{n} \right)\right]} \\ {\qquad \qquad +\varepsilon _{g} \left(1-\varepsilon _{v} \right)\sigma \left(T_{g}^{n} \right)^{4} } \\ {\qquad =\left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\left(1-\varepsilon _{v} \right)L_{atm} \, \downarrow } \\ {\qquad \qquad +\varepsilon _{v} \sigma \left(T_{v}^{n} \right)^{4} } \\ {\qquad \qquad +\varepsilon _{v} \left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\sigma \left(T_{v}^{n} \right)^{4} } \\ {\qquad \qquad +4\varepsilon _{v} \sigma \left(T_{v}^{n} \right)^{3} \left(T_{v}^{n+1} -T_{v}^{n} \right)} \\ {\qquad \qquad +4\varepsilon _{v} \left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\sigma \left(T_{v}^{n} \right)^{3} \left(T_{v}^{n+1} -T_{v}^{n} \right)} \\ {\qquad \qquad +\varepsilon _{g} \left(1-\varepsilon _{v} \right)\sigma \left(T_{g}^{n} \right)^{4} } \end{array} + +where :math:`\varepsilon _{v}` is the vegetation emissivity and +:math:`T_{v}^{n+1}` and :math:`T_{v}^{n}` are the vegetation +temperatures at the current and previous time steps, respectively +(Chapter 5). The first term in the equation above is the atmospheric +longwave radiation that is transmitted through the canopy, reflected by +the ground, and transmitted through the canopy to the atmosphere. The +second term is the longwave radiation emitted by the canopy directly to +the atmosphere. The third term is the longwave radiation emitted +downward from the canopy, reflected by the ground, and transmitted +through the canopy to the atmosphere. The fourth term is the increase +(decrease) in longwave radiation due to an increase (decrease) in canopy +temperature that is emitted by the canopy directly to the atmosphere. +The fifth term is the increase (decrease) in longwave radiation due to +an increase (decrease) in canopy temperature that is emitted downward +from the canopy, reflected from the ground, and transmitted through the +canopy to the atmosphere. The last term is the longwave radiation +emitted by the ground and transmitted through the canopy to the +atmosphere. + +The upward longwave radiation from the ground is + +.. math:: + :label: 4.15 + + L_{g} \, \uparrow =\left(1-\varepsilon _{g} \right)L_{v} \, \downarrow +\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} + +where :math:`L_{v} \, \downarrow` is the downward longwave radiation +below the vegetation + +.. math:: + :label: 4.16 + + L_{v} \, \downarrow =\left(1-\varepsilon _{v} \right)L_{atm} \, \downarrow +\varepsilon _{v} \sigma \left(T_{v}^{n} \right)^{4} +4\varepsilon _{v} \sigma \left(T_{v}^{n} \right)^{3} \left(T_{v}^{n+1} -T_{v}^{n} \right). + +The net longwave radiation flux for the ground is (positive toward the +atmosphere) + +.. math:: + :label: 4.17 + + \vec{L}_{g} =\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} -\delta _{veg} \varepsilon _{g} L_{v} \, \downarrow -\left(1-\delta _{veg} \right)\varepsilon _{g} L_{atm} \, \downarrow . + +The above expression for :math:`\vec{L}_{g}` is the net longwave +radiation forcing that is used in the soil temperature calculation +(Chapter 6). Once updated soil temperatures have been obtained, the term +:math:`4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right)` +is added to :math:`\vec{L}_{g}` to calculate the ground heat flux +(section 5.4) + +The net longwave radiation flux for vegetation is (positive toward the +atmosphere) + +.. math:: + :label: 4.18 + + \vec{L}_{v} =\left[2-\varepsilon _{v} \left(1-\varepsilon _{g} \right)\right]\varepsilon _{v} \sigma \left(T_{v} \right)^{4} -\varepsilon _{v} \varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} -\varepsilon _{v} \left[1+\left(1-\varepsilon _{g} \right)\left(1-\varepsilon _{v} \right)\right]L_{atm} \, \downarrow . + +These equations assume that absorptivity equals emissivity. The +emissivity of the ground is + +.. math:: + :label: 4.19 + + \varepsilon _{g} =\varepsilon _{soi} \left(1-f_{sno} \right)+\varepsilon _{sno} f_{sno} + +where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, and +0.96 for wetland, :math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` +is the fraction of ground covered by snow (section 7.2.1). The +vegetation emissivity is + +.. math:: + :label: 4.20 + + \varepsilon _{v} =1-e^{-{\left(L+S\right)\mathord{\left/ {\vphantom {\left(L+S\right) \bar{\mu }}} \right. \kern-\nulldelimiterspace} \bar{\mu }} } + +where :math:`L` and :math:`S` are the leaf and stem area indices +(section 2.1.4) and :math:`\bar{\mu }=1` is the average inverse optical +depth for longwave radiation. + diff --git a/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst b/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst new file mode 100644 index 0000000000..336fde1b9f --- /dev/null +++ b/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst @@ -0,0 +1,1773 @@ +Momentum, Sensible Heat, and Latent Heat Fluxes +================================================== + +The zonal :math:`\tau _{x}` and meridional :math:`\tau _{y}` momentum +fluxes (kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}`), sensible heat flux +:math:`H` (W m\ :math:`{}^{-2}`), and water vapor flux :math:`E` (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) between the atmosphere at +reference height :math:`z_{atm,\, x}` (m) [where :math:`x` is height +for wind (momentum) (:math:`m`), temperature (sensible heat) +(:math:`h`), and humidity (water vapor) (:math:`w`); with zonal and +meridional winds :math:`u_{atm}` and :math:`v_{atm}` (m +s\ :math:`{}^{-1}`), potential temperature :math:`\theta _{atm}` (K), +and specific humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`)] and the +surface [with :math:`u_{s}` , :math:`v_{s}` , :math:`\theta _{s}` , and +:math:`q_{s}` ] are + +.. math:: + :label: 5.1 + + \tau _{x} =-\rho _{atm} \frac{\left(u_{atm} -u_{s} \right)}{r_{am} } + +.. math:: + :label: 5.2 + + \tau _{y} =-\rho _{atm} \frac{\left(v_{atm} -v_{s} \right)}{r_{am} } + +.. math:: + :label: 5.3 + + H=-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -\theta _{s} \right)}{r_{ah} } + +.. math:: + :label: 5.4 + + E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } . + +These fluxes are derived in the next section from Monin-Obukhov +similarity theory developed for the surface layer (i.e., the nearly +constant flux layer above the surface sublayer). In this derivation, +:math:`u_{s}` and :math:`v_{s}` are defined to equal zero at height +:math:`z_{0m} +d` (the apparent sink for momentum) so that +:math:`r_{am}` is the aerodynamic resistance (s m\ :math:`{}^{-1}`) for +momentum between the atmosphere at height :math:`z_{atm,\, m}` and the +surface at height :math:`z_{0m} +d`. Thus, the momentum fluxes become + +.. math:: + :label: + + \tau _{x} =-\rho _{atm} \frac{u_{atm} }{r_{am} } + +.. math:: + :label: + + \tau _{y} =-\rho _{atm} \frac{v_{atm} }{r_{am} } . + +Likewise, :math:`\theta _{s}` and :math:`q_{s}` are defined at +heights :math:`z_{0h} +d` and :math:`z_{0w} +d` (the apparent sinks for +heat and water vapor, respectively + +:math:`r_{aw}` are the aerodynamic resistances (s m\ :math:`{}^{-1}`) +to sensible heat and water vapor transfer between the atmosphere at +heights :math:`z_{atm,\, h}` and :math:`z_{atm,\, w}` and the surface +at heights :math:`z_{0h} +d` and :math:`z_{0w} +d`, respectively. The +specific heat capacity of air :math:`C_{p}` (J kg\ :math:`{}^{-1}` +K\ :math:`{}^{-1}`) is a constant (Table 2.6). The atmospheric potential +temperature used here is + +.. math:: + :label: 5.7 + + \theta _{atm} =T_{atm} +\Gamma _{d} z_{atm,\, h} + +where :math:`T_{atm}` is the air temperature (K) at height +:math:`z_{atm,\, h}` and :math:`\Gamma _{d} =0.0098` K +m\ :math:`{}^{-1}` is the negative of the dry adiabatic lapse rate [this +expression is first-order equivalent to +:math:`\theta _{atm} =T_{atm} \left({P_{srf} \mathord{\left/ {\vphantom {P_{srf} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } \right)^{{R_{da} \mathord{\left/ {\vphantom {R_{da} C_{p} }} \right. \kern-\nulldelimiterspace} C_{p} } }` +(Stull 1988), where :math:`P_{srf}` is the surface pressure (Pa), +:math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`R_{da}` +is the gas constant for dry air (J kg\ :math:`{}^{-1}` +K\ :math:`{}^{-1}`) (Table 2.6)]. By definition, +:math:`\theta _{s} =T_{s}` . The density of moist air (kg +m\ :math:`{}^{-3}`) is + +.. math:: + :label: 5.8 + + \rho _{atm} =\frac{P_{atm} -0.378e_{atm} }{R_{da} T_{atm} } + +where the atmospheric vapor pressure :math:`e_{atm}` (Pa) is derived +from the atmospheric specific humidity :math:`q_{atm}` + +.. math:: + :label: 5.9 + + e_{atm} =\frac{q_{atm} P_{atm} }{0.622+0.378q_{atm} } . + +Monin-Obukhov Similarity Theory +----------------------------------- + +The surface vertical kinematic fluxes of momentum +:math:`\overline{u'w'}` and :math:`\overline{v'w'}` (:math:`\text{m}^{2} \text{s}^{-2}`), sensible heat :math:`\overline{\theta 'w'}` +(:math:`\text{K m} \text{s}^{-1}`), and latent heat :math:`\overline{q'w'}` (:math:`\text{kg kg }^{-1}` m s\ :math:`{}^{-1}`), where :math:`u'`, :math:`v'`, +:math:`w'`, :math:`\theta '`, and :math:`q'` are zonal horizontal wind, +meridional horizontal wind, vertical velocity, potential temperature, +and specific humidity turbulent fluctuations about the mean, are defined +from Monin-Obukhov similarity applied to the surface layer. This theory +states that when scaled appropriately, the dimensionless mean horizontal +wind speed, mean potential temperature, and mean specific humidity +profile gradients depend on unique functions of +:math:`\zeta =\frac{z-d}{L}` (Zeng et al. 1998) as + +.. math:: + :label: 5.10 + + \frac{k\left(z-d\right)}{u_{*} } \frac{\partial \left|{\it u}\right|}{\partial z} =\phi _{m} \left(\zeta \right) + +.. math:: + :label: 5.11 + + \frac{k\left(z-d\right)}{\theta _{*} } \frac{\partial \theta }{\partial z} =\phi _{h} \left(\zeta \right) + +.. math:: + :label: 5.12 + + \frac{k\left(z-d\right)}{q_{*} } \frac{\partial q}{\partial z} =\phi _{w} \left(\zeta \right) + +where :math:`z` is height in the surface layer (m), :math:`d` is the +displacement height (m), :math:`L` is the Monin-Obukhov length scale (m) +that accounts for buoyancy effects resulting from vertical density +gradients (i.e., the atmospheric stability), k is the von Karman +constant (Table 2.6), and :math:`\left|{\it u}\right|` is the +atmospheric wind speed (m s\ :math:`{}^{-1}`). :math:`\phi _{m}` , +:math:`\phi _{h}` , and :math:`\phi _{w}` are universal (over any +surface) similarity functions of :math:`\zeta` that relate the constant +fluxes of momentum, sensible heat, and latent heat to the mean profile +gradients of :math:`\left|{\it u}\right|`, :math:`\theta` , and +:math:`q` in the surface layer. In neutral conditions, +:math:`\phi _{m} =\phi _{h} =\phi _{w} =1`. The velocity (i.e., friction +velocity) :math:`u_{\*}` (m s\ :math:`{}^{-1}`), temperature +:math:`\theta _{\*}` (K), and moisture :math:`q_{\*}` (kg +kg\ :math:`{}^{-1}`) scales are + +.. math:: + :label: 5.13 + + u_{*}^{2} =\sqrt{\left(\overline{u'w'}\right)^{2} +\left(\overline{v'w'}\right)^{2} } =\frac{\left|{\it \tau }\right|}{\rho _{atm} } + +.. math:: + :label: 5.14 + + \theta _{*} u_{*} =-\overline{\theta 'w'}=-\frac{H}{\rho _{atm} C_{p} } + +.. math:: + :label: 5.15 + + q_{*} u_{*} =-\overline{q'w'}=-\frac{E}{\rho _{atm} } + +where :math:`\left|{\it \tau }\right|` is the shearing stress (kg +m\ :math:`{}^{-1}` s\ :math:`{}^{-2}`), with zonal and meridional +components :math:`\overline{u'w'}=-\frac{\tau _{x} }{\rho _{atm} }` and +:math:`\overline{v'w'}=-\frac{\tau _{y} }{\rho _{atm} }` , respectively, +:math:`H` is the sensible heat flux (W m\ :math:`{}^{-2}`) and :math:`E` +is the water vapor flux (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). + +The dimensionless length scale :math:`L` is the Monin-Obukhov length +defined as + +.. math:: + :label: 5.16 + + L=-\frac{u_{*}^{3} }{k\left(\frac{g}{\overline{\theta _{v,\, atm} }} \right)\theta '_{v} w'} =\frac{u_{*}^{2} \overline{\theta _{v,\, atm} }}{kg\theta _{v*} } + +where :math:`g` is the acceleration of gravity (m s\ :math:`{}^{-2}`) +(Table 2.6), and +:math:`\overline{\theta _{v,\, atm} }=\overline{\theta _{atm} }\left(1+0.61q_{atm} \right)` +is the reference virtual potential temperature. :math:`L>0` indicates +stable conditions. :math:`L<0` indicates unstable conditions. +:math:`L=\infty` for neutral conditions. The temperature scale +:math:`\theta _{v*}` is defined as + +.. math:: + :label: ZEqnNum632600 + + \theta _{v*} u_{*} =\left[\theta _{*} \left(1+0.61q_{atm} \right)+0.61\overline{\theta _{atm} }q_{*} \right]u_{*} + +where :math:`\overline{\theta _{atm} }` is the atmospheric potential +temperature. + +Following Panofsky and Dutton (1984), the differential equations for +:math:`\phi _{m} \left(\zeta \right)`, +:math:`\phi _{h} \left(\zeta \right)`, and +:math:`\phi _{w} \left(\zeta \right)` can be integrated formally without +commitment to their exact forms. Integration between two arbitrary +heights in the surface layer :math:`z_{2}` and :math:`z_{1}` +(:math:`z_{2} >z_{1}` ) with horizontal winds +:math:`\left|{\it u}\right|_{1}` and :math:`\left|{\it u}\right|_{2}` , +potential temperatures :math:`\theta _{1}` and :math:`\theta _{2}` , +and specific humidities :math:`q_{1}` and :math:`q_{2}` results in + +.. math:: + :label: 5.18 + + \left|{\it u}\right|_{2} -\left|{\it u}\right|_{1} =\frac{u_{*} }{k} \left[\ln \left(\frac{z_{2} -d}{z_{1} -d} \right)-\psi _{m} \left(\frac{z_{2} -d}{L} \right)+\psi _{m} \left(\frac{z_{1} -d}{L} \right)\right] + +.. math:: + :label: 5.19 + + \theta _{2} -\theta _{1} =\frac{\theta _{*} }{k} \left[\ln \left(\frac{z_{2} -d}{z_{1} -d} \right)-\psi _{h} \left(\frac{z_{2} -d}{L} \right)+\psi _{h} \left(\frac{z_{1} -d}{L} \right)\right] + +.. math:: + :label: 5.20 + + q_{2} -q_{1} =\frac{q_{*} }{k} \left[\ln \left(\frac{z_{2} -d}{z_{1} -d} \right)-\psi _{w} \left(\frac{z_{2} -d}{L} \right)+\psi _{w} \left(\frac{z_{1} -d}{L} \right)\right]. + +The functions :math:`\psi _{m} \left(\zeta \right)`, +:math:`\psi _{h} \left(\zeta \right)`, and +:math:`\psi _{w} \left(\zeta \right)` are defined as + +.. math:: + :label: 5.21 + + \psi _{m} \left(\zeta \right)=\int _{{z_{0m} \mathord{\left/ {\vphantom {z_{0m} L}} \right. \kern-\nulldelimiterspace} L} }^{\zeta }\frac{\left[1-\phi _{m} \left(x\right)\right]}{x} \, dx + +.. math:: + :label: 5.22 + + \psi _{h} \left(\zeta \right)=\int _{{z_{0h} \mathord{\left/ {\vphantom {z_{0h} L}} \right. \kern-\nulldelimiterspace} L} }^{\zeta }\frac{\left[1-\phi _{h} \left(x\right)\right]}{x} \, dx + +.. math:: + :label: 5.23 + + \psi _{w} \left(\zeta \right)=\int _{{z_{0w} \mathord{\left/ {\vphantom {z_{0w} L}} \right. \kern-\nulldelimiterspace} L} }^{\zeta }\frac{\left[1-\phi _{w} \left(x\right)\right]}{x} \, dx + +where :math:`z_{0m}` , :math:`z_{0h}` , and :math:`z_{0w}` are the +roughness lengths (m) for momentum, sensible heat, and water vapor, +respectively. + +Defining the surface values + +.. math:: \left|{\it u}\right|_{1} =0{\rm \; at\; }z_{1} =z_{0m} +d, + +.. math:: \theta _{1} =\theta _{s} {\rm \; at\; }z_{1} =z_{0h} +d,{\rm \; and} + +.. math:: q_{1} =q_{s} {\rm \; at\; }z_{1} =z_{0w} +d, + +and the atmospheric values at :math:`z_{2} =z_{atm,\, x}` + +.. math:: + :label: ZEqnNum228149 + + \left|{\it u}\right|_{2} =V_{a} {\rm =\; }\sqrt{u_{atm}^{2} +v_{atm}^{2} +U_{c}^{2} } \ge 1, + +.. math:: \theta _{2} =\theta _{atm} {\rm ,\; and} + +.. math:: q_{2} =q_{atm} {\rm ,\; } + +the integral forms of the flux-gradient relations are + +.. math:: + :label: 5.25 + + V_{a} =\frac{u_{*} }{k} \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right] + +.. math:: + :label: 5.26 + + \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left[\ln \left(\frac{z_{atm,\, h} -d}{z_{0h} } \right)-\psi _{h} \left(\frac{z_{atm,\, h} -d}{L} \right)+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right] + +.. math:: + :label: 5.27 + + q_{atm} -q_{s} =\frac{q_{*} }{k} \left[\ln \left(\frac{z_{atm,\, w} -d}{z_{0w} } \right)-\psi _{w} \left(\frac{z_{atm,\, w} -d}{L} \right)+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right]. + +The constraint :math:`V_{a} \ge 1` is required simply for numerical +reasons to prevent :math:`H` and :math:`E` from becoming small with +small wind speeds. The convective velocity :math:`U_{c}` accounts for +the contribution of large eddies in the convective boundary layer to +surface fluxes as follows + +.. math:: + :label: 5.28 + + {U_{c} = 0\ \qquad \zeta \ge {\rm 0} {\rm (stable)}} \\ + {U_{c} = \beta w_{\*} \qquad \zeta <0 {\rm (unstable})} + +where :math:`w_{\*}` is the convective velocity scale + +.. math:: + :label: 5.29 + + w_{\*} =\left(\frac{-gu_{\*} \theta _{v*} z_{i} }{\overline{\theta _{v,\, atm} }} \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } , + +:math:`z_{i} =1000` is the convective boundary layer height (m), and :math:`\beta =1`. + +The momentum flux gradient relations are (Zeng et al. 1998) + +.. math:: + :label: 5.30 + + \begin{array}{l} {\phi _{m} \left(\zeta \right)=0.7k^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \qquad {\rm for\; }\zeta <-1.574{\rm \; (very\; unstable)}} \\ {\phi _{m} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } \qquad {\rm for\; -1.574}\le \zeta <0{\rm \; (unstable)}} \\ {\phi _{m} \left(\zeta \right)=1+5\zeta \qquad {\rm for\; }0\le \zeta \le 1{\rm \; (stable)}} \\ {\phi _{m} \left(\zeta \right)=5+\zeta \qquad {\rm for\; }\zeta {\rm >1\; (very\; stable).}} \end{array} + +The sensible and latent heat flux gradient relations are (Zeng et al. +1998) + +.. math:: + :label: 5.31 + + \begin{array}{l} {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=0.9k^{{4\mathord{\left/ {\vphantom {4 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \qquad {\rm for\; }\zeta <-0.465{\rm \; (very\; unstable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 2}} \right. \kern-\nulldelimiterspace} 2} } \qquad {\rm for\; -0.465}\le \zeta <0{\rm \; (unstable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=1+5\zeta \qquad {\rm for\; }0\le \zeta \le 1{\rm \; (stable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=5+\zeta \qquad {\rm for\; }\zeta {\rm >1\; (very\; stable).}} \end{array} + +To ensure continuous functions of +:math:`\phi _{m} \left(\zeta \right)`, +:math:`\phi _{h} \left(\zeta \right)`, and +:math:`\phi _{w} \left(\zeta \right)`, the simplest approach (i.e., +without considering any transition regimes) is to match the relations +for very unstable and unstable conditions at :math:`\zeta _{m} =-1.574` +for :math:`\phi _{m} \left(\zeta \right)` and +:math:`\zeta _{h} =\zeta _{w} =-0.465` for +:math:`\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)` +(Zeng et al. 1998). The flux gradient relations can be integrated to +yield wind profiles for the following conditions: + +Very unstable :math:`\left(\zeta <-1.574\right)` + +.. math:: + :label: ZEqnNum566843 + + V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{\zeta _{m} L}{z_{0m} } -\psi _{m} \left(\zeta _{m} \right)\right]+1.14\left[\left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta _{m} \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right\} + +Unstable :math:`\left(-1.574\le \zeta <0\right)` + +.. math:: + :label: ZEqnNum309568 + + V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, m} -d}{z_{0m} } -\psi _{m} \left(\zeta \right)\right]+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right\} + +Stable :math:`\left(0\le \zeta \le 1\right)` + +.. math:: + :label: ZEqnNum973766 + + V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, m} -d}{z_{0m} } +5\zeta \right]-5\frac{z_{0m} }{L} \right\} + +Very stable :math:`\left(\zeta >1\right)` + +.. math:: + :label: ZEqnNum310559 + + V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{L}{z_{0m} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0m} }{L} \right\} + +where + +.. math:: + :label: 5.36 + + \psi _{m} \left(\zeta \right)=2\ln \left(\frac{1+x}{2} \right)+\ln \left(\frac{1+x^{2} }{2} \right)-2\tan ^{-1} x+\frac{\pi }{2} + +and + +:math:`x=\left(1-16\zeta \right)^{{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} }` . + +The potential temperature profiles are: + +Very unstable :math:`\left(\zeta <-0.465\right)` + +.. math:: + :label: ZEqnNum382106 + + \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{\zeta _{h} L}{z_{0h} } -\psi _{h} \left(\zeta _{h} \right)\right]+0.8\left[\left(-\zeta _{h} \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right\} + +Unstable :math:`\left(-0.465\le \zeta <0\right)` + +.. math:: + :label: ZEqnNum767002 + + \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{z_{atm,\, h} -d}{z_{0h} } -\psi _{h} \left(\zeta \right)\right]+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right\} + + +Stable :math:`\left(0\le \zeta \le 1\right)` + +.. math:: + :label: ZEqnNum556410 + + \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{z_{atm,\, h} -d}{z_{0h} } +5\zeta \right]-5\frac{z_{0h} }{L} \right\} + +Very stable :math:`\left(\zeta >1\right)` + +.. math:: + :label: ZEqnNum846197 + + \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{L}{z_{0h} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0h} }{L} \right\}. + +The specific humidity profiles are: + +Very unstable :math:`\left(\zeta <-0.465\right)` + +.. math:: + :label: ZEqnNum299834 + + q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{\zeta _{w} L}{z_{0w} } -\psi _{w} \left(\zeta _{w} \right)\right]+0.8\left[\left(-\zeta _{w} \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right\} + +Unstable :math:`\left(-0.465\le \zeta <0\right)` + +.. math:: + + \label{ZEqnNum142122} + q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, w} -d}{z_{0w} } -\psi _{w} \left(\zeta \right)\right]+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right\} + +Stable :math:`\left(0\le \zeta \le 1\right)` + +.. math:: + :label: ZEqnNum350694 + + q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, w} -d}{z_{0w} } +5\zeta \right]-5\frac{z_{0w} }{L} \right\} + +Very stable :math:`\left(\zeta >1\right)` + +.. math:: + :label: ZEqnNum211437 + + q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{L}{z_{0w} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0w} }{L} \right\} + +where + +.. math:: + :label: 5.45 + + \psi _{h} \left(\zeta \right)=\psi _{w} \left(\zeta \right)=2\ln \left(\frac{1+x^{2} }{2} \right). + +Using the definitions of :math:`u_{*}` , :math:`\theta _{*}` , and +:math:`q_{*}` , an iterative solution of these equations can be used to +calculate the surface momentum, sensible heat, and water vapor flux +using atmospheric and surface values for :math:`\left|{\it u}\right|`, +:math:`\theta` , and :math:`q` except that :math:`L` depends on +:math:`u_{*}` , :math:`\theta _{*}` , and :math:`q_{*}` . However, the +bulk CityplaceRichardson number + +.. math:: + :label: ZEqnNum750428} + + R_{iB} =\frac{\theta _{v,\, atm} -\theta _{v,\, s} }{\overline{\theta _{v,\, atm} }} \frac{g\left(z_{atm,\, m} -d\right)}{V_{a}^{2} } + + +is related to :math:`\zeta` (Arya 2001) as + +.. math:: + :label: 5.47 + + R_{iB} =\zeta \left[\ln \left(\frac{z_{atm,\, h} -d}{z_{0h} } \right)-\psi _{h} \left(\zeta \right)\right]\left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\zeta \right)\right]^{-2} . + +Using +:math:`\phi _{h} =\phi _{m}^{2} =\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 2}} \right. \kern-\nulldelimiterspace} 2} }` +for unstable conditions and :math:`\phi _{h} =\phi _{m} =1+5\zeta` for +stable conditions to determine :math:`\psi _{m} \left(\zeta \right)` and +:math:`\psi _{h} \left(\zeta \right)`, the inverse relationship +:math:`\zeta =f\left(R_{iB} \right)` can be solved to obtain a first +guess for :math:`\zeta` and thus :math:`L` from + +.. math:: + + \label{ZEqnNum979946} + \begin{array}{l} {\zeta =\frac{R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)}{1-5\min \left(R_{iB} ,0.19\right)} \qquad 0.01\le \zeta \le 2\qquad {\rm for\; }R_{iB} \ge 0{\rm \; (neutral\; or\; stable)}} \\ {\zeta =R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)\qquad -100\le \zeta \le -0.01\qquad {\rm for\; }R_{iB} <0{\rm \; (unstable)}} \end{array}. + +Upon iteration (section 5.3.2), the following is used to determine +:math:`\zeta` and thus :math:`L` + +.. math:: + + \label{ZEqnNum153243} + \zeta =\frac{\left(z_{atm,\, m} -d\right)kg\theta _{v*} }{u_{*}^{2} \overline{\theta _{v,\, atm} }} + +where + +.. math:: \begin{array}{l} {0.01\le \zeta \le 2\qquad {\rm for\; }\zeta \ge 0{\rm \; (neutral\; or\; stable)}} \\ {{\rm -100}\le \zeta \le {\rm -0.01}\qquad {\rm for\; }\zeta <0{\rm \; (unstable)}} \end{array}. + +The difference in virtual potential air temperature between the +reference height and the surface is + +.. math:: + :label: ZEqnNum516498 + + \theta _{v,\, atm} -\theta _{v,\, s} =\left(\theta _{atm} -\theta _{s} \right)\left(1+0.61q_{atm} \right)+0.61\overline{\theta _{atm} }\left(q_{atm} -q_{s} \right). + +The momentum, sensible heat, and water vapor fluxes between the surface +and the atmosphere can also be written in the form + +.. math:: + :label: ZEqnNum567382 + + \tau _{x} =-\rho _{atm} \frac{\left(u_{atm} -u_{s} \right)}{r_{am} } + +.. math:: + :label: ZEqnNum615113 + + \tau _{y} =-\rho _{atm} \frac{\left(v_{atm} -v_{s} \right)}{r_{am} } + +.. math:: + :label: ZEqnNum588623 + + H=-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -\theta _{s} \right)}{r_{ah} } + +.. math:: + :label: ZEqnNum154565 + + E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } + +where the aerodynamic resistances (s m\ :math:`{}^{-1}`) are + +.. math:: + :label: ZEqnNum660763 + + r_{am} =\frac{V_{a} }{u_{*}^{2} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]^{2} + +.. math:: + :label: ZEqnNum193138 + + \begin{array}{l} {r_{ah} =\frac{\theta _{atm} -\theta _{s} }{\theta _{*} u_{*} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]} \\ {\qquad \left[\ln \left(\frac{z_{atm,\, h} -d}{z_{0h} } \right)-\psi _{h} \left(\frac{z_{atm,\, h} -d}{L} \right)+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right]} \end{array} + +.. math:: + :label: ZEqnNum382229 + + \begin{array}{l} {r_{aw} =\frac{q_{atm} -q_{s} }{q_{*} u_{*} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]} \\ {\qquad \left[\ln \left(\frac{z_{atm,\, {\it w}} -d}{z_{0w} } \right)-\psi _{w} \left(\frac{z_{atm,\, w} -d}{L} \right)+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right]} \end{array}. + +A 2-m height “screen†temperature is useful for comparison with +observations + +.. math:: + :label: ZEqnNum664652 + + T_{2m} =\theta _{s} +\frac{\theta _{*} }{k} \left[\ln \left(\frac{2+z_{0h} }{z_{0h} } \right)-\psi _{h} \left(\frac{2+z_{0h} }{L} \right)+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right] + +where for convenience, “2-m†is defined as 2 m above the apparent sink +for sensible heat (:math:`z_{0h} +d`). Similarly, a 2-m height specific +humidity is defined as + +.. math:: + :label: ZEqnNum735237 + + q_{2m} =q_{s} +\frac{q_{*} }{k} \left[\ln \left(\frac{2+z_{0w} }{z_{0w} } \right)-\psi _{w} \left(\frac{2+z_{0w} }{L} \right)+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right]. + +Relative humidity is + +.. math:: + :label: ZEqnNum299365 + + RH_{2m} =\min \left(100,\, \frac{q_{2m} }{q_{sat}^{T_{2m} } } \times 100\right) + +where :math:`q_{sat}^{T_{2m} }` is the saturated specific humidity at +the 2-m temperature :math:`T_{2m}` (section 5.5). + +A 10-m wind speed is calculated as (note that this is not consistent +with the 10-m wind speed calculated for the dust model as described in +Chapter 24) + +.. math:: + :label: 5.61 + + u_{10m} =\left\{\begin{array}{l} {V_{a} \qquad z_{atm,\, m} \le 10} \\ {V_{a} -\frac{u_{*} }{k} \left[\ln \left(\frac{z_{atm,\, m} -d}{10+z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{10+z_{0m} }{L} \right)\right]\qquad z_{atm,\, m} >10} \end{array}\right\} + +Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces +-------------------------------------------------------------- + +Surfaces are considered non-vegetated for the surface flux calculations +if leaf plus stem area index :math:`L+S<0.05` (section 2.1.4). By +definition, this includes bare soil, wetlands, and glaciers. The +solution for lakes is described in Chapter 9. For these surfaces, the +surface may be exposed to the atmosphere, snow covered, and/or surface +water covered, so that the sensible heat flux :math:`H_{g}` (W +m\ :math:`{}^{-2}`) is, with reference to Figure 5.1, + +.. math:: + :label: ZEqnNum726771 + + H_{g} =\left(1-f_{sno} -f_{h2osfc} \right)H_{soil} +f_{sno} H_{snow} +f_{h2osfc} H_{h2osfc} + +where :math:`\left(1-f_{sno} -f_{h2osfc} \right)`, :math:`f_{sno}` , and +:math:`f_{h2osfc}` are the exposed, snow covered, and surface water +covered fractions of the grid cell. The individual fluxes based on the +temperatures of the soil :math:`T_{1}` , snow :math:`T_{snl+1}` , and +surface water :math:`T_{h2osfc}` are + +.. math:: + :label: 5.63 + + H_{soil} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{1} \right)}{r_{ah} } + +.. math:: + :label: 5.64 + + H_{sno} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{snl+1} \right)}{r_{ah} } + +.. math:: + :label: 5.65 + + H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{h2osfc} \right)}{r_{ah} } + +where :math:`\rho _{atm}` is the density of atmospheric air (kg +m\ :math:`{}^{-3}`), :math:`C_{p}` is the specific heat capacity of air +(J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +:math:`\theta _{atm}` is the atmospheric potential temperature (K), and +:math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer +(s m\ :math:`{}^{-1}`). + +The water vapor flux :math:`E_{g}` (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) is, with reference to Figure 5.2, + +.. math:: + :label: ZEqnNum419297 + + E_{g} =\left(1-f_{sno} -f_{h2osfc} \right)E_{soil} +f_{sno} E_{snow} +f_{h2osfc} E_{h2osfc} + +.. math:: + :label: 5.67 + + E_{soil} =-\frac{\beta _{soi} \rho _{atm} \left(q_{atm} -q_{soil} \right)}{r_{aw} } + +.. math:: + :label: 5.68 + + E_{sno} =-\frac{\rho _{atm} \left(q_{atm} -q_{sno} \right)}{r_{aw} } + +.. math:: + :label: 5.69 + + E_{h2osfc} =-\frac{\rho _{atm} \left(q_{atm} -q_{h2osfc} \right)}{r_{aw} } + +where :math:`\beta _{soi}` is an empirical function of soil water +(Sakaguchi and Zeng 2009), :math:`q_{atm}` is the atmospheric specific +humidity (kg kg\ :math:`{}^{-1}`), :math:`q_{soil}` , :math:`q_{sno}` , +and :math:`q_{h2osfc}` are the specific humidities (kg +kg\ :math:`{}^{-1}`) of the soil, snow, and surface water, respectively, +and :math:`r_{aw}` is the aerodynamic resistance to water vapor +transfer (s m\ :math:`{}^{-1}`). The specific humidities of the snow +:math:`q_{sno}` and surface water :math:`q_{h2osfc}` are assumed to be +at the saturation specific humidity of their respective temperatures + +.. math:: + :label: 5.70) + + q_{sno} =q_{sat}^{T_{snl+1} } + +.. math:: + :label: 5.71) + + q_{h2osfc} =q_{sat}^{T_{h2osfc} } + +The specific humidity of the soil surface :math:`q_{soil}` is assumed +to be proportional to the saturation specific humidity + +.. math:: + :label: 5.72) + + q_{soil} =\alpha _{soil} q_{sat}^{T_{1} } + +where :math:`q_{sat}^{T_{1} }` is the saturated specific humidity at +the soil surface temperature :math:`T_{1}` (section 5.5). The factor +:math:`\alpha _{soil}` is a function of the surface soil water matric +potential :math:`\psi` as in Philip (1957) + +.. math:: + :label: 5.73) + + \alpha _{soil} =\exp \left(\frac{\psi _{1} g}{1\times 10^{3} R_{wv} T_{1} } \right) + +where :math:`R_{wv}` is the gas constant for water vapor (J +kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), :math:`g` is the +gravitational acceleration (m s\ :math:`{}^{-2}`) (Table 2.6), and +:math:`\psi _{1}` is the soil water matric potential of the top soil +layer (mm). The soil water matric potential :math:`\psi _{1}` is + +.. math:: + :label: 5.74) + + \psi _{1} =\psi _{sat,\, 1} s_{1}^{-B_{1} } \ge -1\times 10^{8} + +where :math:`\psi _{sat,\, 1}` is the saturated matric potential (mm) +(section 7.4.1), :math:`B_{1}` is the Clapp and Hornberger (1978) +parameter (section 7.4.1), and :math:`s_{1}` is the wetness of the top +soil layer with respect to saturation. The surface wetness +:math:`s_{1}` is a function of the liquid water and ice content + +.. math:: + :label: 5.75) + + s_{1} =\frac{1}{\Delta z_{1} \theta _{sat,\, 1} } \left[\frac{w_{liq,\, 1} }{\rho _{liq} } +\frac{w_{ice,\, 1} }{\rho _{ice} } \right]\qquad 0.01\le s_{1} \le 1.0 + +where :math:`\Delta z_{1}` is the thickness of the top soil layer (m), +:math:`\rho _{liq}` and :math:`\rho _{ice}` are the density of liquid +water and ice (kg m\ :math:`{}^{-3}`) (Table 2.6), :math:`w_{liq,\, 1}` +and :math:`w_{ice,\, 1}` are the mass of liquid water and ice of the +top soil layer (:math:`\text{kg} \text{m}^{-2}`) (Chapter 7), and +:math:`\theta _{sat,\, 1}` is the saturated volumetric water content +(i.e., porosity) of the top soil layer (:math:`\text{mm}^{3}` :math:`\text{mm}^{-3}`) (section 7.4.1). If +:math:`q_{sat}^{T_{1} } >q_{atm}` and :math:`q_{atm} >q_{soil}` , then +:math:`q_{soil} =q_{atm}` and :math:`\frac{dq_{soil} }{dT} =0`. This +prevents large increases (decreases) in :math:`q_{soil}` for small +increases (decreases) in soil moisture in very dry soils. + +The function :math:`\beta _{soi}` ranges from 0 to 1 and is intended to +represent the molecular diffusion process from the soil pore to the +surface within the dry part of the soil (Sakaguchi and Zeng 2009) as + +.. math:: + :label: 5.76) + + \beta _{soi} =\left\{\begin{array}{l} {1\qquad \theta _{1} \ge \theta _{fc,\, 1} {\rm \; or\; }q_{atm} -q_{soil} >0} \\ {0.25\left(1-f_{sno} -f_{h2osfc} \right)\left[1-\cos \left(\pi \frac{\theta _{1} }{\theta _{fc,\, 1} } \right)\right]^{2} +f_{sno} +f_{h2osfc} \qquad \theta _{1} <\theta _{fc,\, 1} } \end{array}\right\}. + +where :math:`\theta _{fc,\, 1}` is the field capacity of the top soil +layer and +:math:`0.01{\le \theta _{1} \mathord{\left/ {\vphantom {\le \theta _{1} \theta _{fc,\, 1} \le 1}} \right. \kern-\nulldelimiterspace} \theta _{fc,\, 1} \le 1}` . +The volumetric water content of the top soil layer (:math:`\text{mm}^{3}` :math:`\text{mm}^{-3}`) is + +.. math:: + :label: 5.77) + + \theta _{1} =\frac{1}{\Delta z_{1} } \left[\frac{w_{liq,\, 1} }{\rho _{liq} } +\frac{w_{ice,\, 1} }{\rho _{ice} } \right]. + +The volumetric water content at field capacity is derived by assuming a +hydraulic conductivity of 0.1 mm day\ :math:`{}^{-1}` and inverting the +hydraulic conductivity function (section 7.4.1) as + +.. math:: + :label: 5.78) + + \theta _{fc,\, 1} =\theta _{sat,\, 1} \left[\frac{0.1}{86400k_{sat,\, 1} } \right]^{\frac{1}{2B_{i} +3} } + +where :math:`k_{sat,\, 1}` is the saturated hydraulic conductivity of +the top soil layer (mm s\ :math:`{}^{-1}`) (section 7.4.1) and the +exponent :math:`B_{1}` is a function of soil texture (section 7.4.1). + +The roughness lengths used to calculate :math:`r_{am}` , +:math:`r_{ah}` , and :math:`r_{aw}` are :math:`z_{0m} =z_{0m,\, g}` , +:math:`z_{0h} =z_{0h,\, g}` , and :math:`z_{0w} =z_{0w,\, g}` . The +displacement height :math:`d=0`. The momentum roughness length is +:math:`z_{0m,\, g} =0.01` for soil, glaciers, and wetland, and +:math:`z_{0m,\, g} =0.0024` for snow-covered surfaces +(:math:`f_{sno} >0`). In general, :math:`z_{0m}` is different from +:math:`z_{0h}` because the transfer of momentum is affected by pressure +fluctuations in the turbulent waves behind the roughness elements, while +for heat and water vapor transfer no such dynamical mechanism exists. +Rather, heat and water vapor must be transferred by molecular diffusion +across the interfacial sublayer. The following relation from +Zilitinkevich (1970) is adopted by Zeng and Dickinson (1998) + +.. math:: + :label: ZEqnNum844212 + + z_{0h,\, g} =z_{0w,\, g} =z_{0m,\, g} e^{-a\left({u_{*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon } \right)^{0.45} } + +where the quantity +:math:`{u_{*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon }` +is the roughness Reynolds number (and may be interpreted as the Reynolds +number of the smallest turbulent eddy in the flow) with the kinematic +viscosity of air :math:`\upsilon =1.5\times 10^{-5}` m\ :math:`{}^{2}` +s\ :math:`{}^{-1}` and :math:`a=0.13`. + +The numerical solution for the fluxes of momentum, sensible heat, and +water vapor flux from non-vegetated surfaces proceeds as follows: + +#. An initial guess for the wind speed :math:`V_{a}` is obtained from + eq. assuming an initial convective velocity :math:`U_{c} =0` m + s\ :math:`{}^{-1}` for stable conditions + (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from + eq. ) and :math:`U_{c} =0.5` for unstable conditions + (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). + +#. An initial guess for the Monin-Obukhov length :math:`L` is obtained + from the bulk Richardson number using eqs. and . + +#. The following system of equations is iterated three times: + +#. Friction velocity :math:`u_{*}` (eqs. , , , ) + +#. Potential temperature scale :math:`\theta _{*}` (eqs. , , , ) + +#. Humidity scale :math:`q_{*}` (eqs. , , , ) + +#. Roughness lengths for sensible :math:`z_{0h,\, g}` and latent heat + :math:`z_{0w,\, g}` (eq. ) + +#. Virtual potential temperature scale :math:`\theta _{v*}` (eq. ) + +#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) + +#. Monin-Obukhov length :math:`L` (eq. ) + +#. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and + :math:`r_{aw}` (eqs. , , ) + +#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (eqs. , ) + +#. Sensible heat flux :math:`H_{g}` (eq. ) + +#. Water vapor flux :math:`E_{g}` (eq. ) + +#. 2-m height air temperature :math:`T_{2m}` and specific humidity + :math:`q_{2m}` (eqs. , ) + +The partial derivatives of the soil surface fluxes with respect to +ground temperature, which are needed for the soil temperature +calculations (section 6.1) and to update the soil surface fluxes +(section 5.4), are + +.. math:: + :label: ZEqnNum806472 + + \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r_{ah} } + +.. math:: + :label: ZEqnNum497230 + + \frac{\partial E_{g} }{\partial T_{g} } =\frac{\beta _{soi} \rho _{atm} }{r_{aw} } \frac{dq_{g} }{dT_{g} } + +where + +.. math:: + :label: 5.82) + + \frac{dq_{g} }{dT_{g} } =\left(1-f_{sno} -f_{h2osfc} \right)\alpha _{soil} \frac{dq_{sat}^{T_{soil} } }{dT_{soil} } +f_{sno} \frac{dq_{sat}^{T_{sno} } }{dT_{sno} } +f_{h2osfc} \frac{dq_{sat}^{T_{h2osfc} } }{dT_{h2osfc} } . + +The partial derivatives +:math:`\frac{\partial r_{ah} }{\partial T_{g} }` and +:math:`\frac{\partial r_{aw} }{\partial T_{g} }` , which cannot be +determined analytically, are ignored for +:math:`\frac{\partial H_{g} }{\partial T_{g} }` and +:math:`\frac{\partial E_{g} }{\partial T_{g} }` . + +Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces +-------------------------------------------------------------------------- + +In the case of a vegetated surface, the sensible heat :math:`H` and +water vapor flux :math:`E` are partitioned into vegetation and ground +fluxes that depend on vegetation :math:`T_{v}` and ground +:math:`T_{g}` temperatures in addition to surface temperature +:math:`T_{s}` and specific humidity :math:`q_{s}` . Because of the +coupling between vegetation temperature and fluxes, Newton-Raphson +iteration is used to solve for the vegetation temperature and the +sensible heat and water vapor fluxes from vegetation simultaneously +using the ground temperature from the previous time step. In section +5.3.1, the equations used in the iteration scheme are derived. Details +on the numerical scheme are provided in section 5.3.2. + +Theory +^^^^^^^^^^^^ + +The air within the canopy is assumed to have negligible capacity to +store heat so that the sensible heat flux :math:`H` between the surface +at height :math:`z_{0h} +d` and the atmosphere at height +:math:`z_{atm,\, h}` must be balanced by the sum of the sensible heat +from the vegetation :math:`H_{v}` and the ground :math:`H_{g}` + +.. math:: + :label: ZEqnNum550014 + + H=H_{v} +H_{g} + +where, with reference to Figure 5.1, + +.. math:: + :label: 5.84) + + H=-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{s} \right)}{r_{ah} } + +.. math:: + :label: ZEqnNum675188 + + H_{v} =-\rho _{atm} C_{p} \left(T_{s} -T_{v} \right)\frac{\left(L+S\right)}{r_{b} } + +.. math:: + :label: ZEqnNum293573 + + H_{g} =\left(1-f_{sno} -f_{h2osfc} \right)H_{soil} +f_{sno} H_{snow} +f_{h2osfc} H_{h2osfc} + +.. math:: + :label: 5.87) + + H_{soil} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{1} \right)}{r_{ah} ^{{'} } } + +.. math:: + :label: 5.88) + + H_{sno} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{snl+1} \right)}{r_{ah} ^{{'} } } + +.. math:: + :label: 5.89) + + H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{h2osfc} \right)}{r_{ah} ^{{'} } } + +where :math:`\rho _{atm}` is the density of atmospheric air (kg +m\ :math:`{}^{-3}`), :math:`C_{p}` is the specific heat capacity of air +(J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +:math:`\theta _{atm}` is the atmospheric potential temperature (K), and +:math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer +(s m\ :math:`{}^{-1}`). + +Here, :math:`T_{s}` is the surface temperature at height +:math:`z_{0h} +d`, also referred to as the canopy air temperature. +:math:`L` and :math:`S` are the exposed leaf and stem area indices +(section 2.1.4), :math:`r_{b}` is the leaf boundary layer resistance (s +m\ :math:`{}^{-1}`), and :math:`r_{ah} ^{{'} }` is the aerodynamic +resistance (s m\ :math:`{}^{-1}`) to heat transfer between the ground at +height :math:`z_{0h} ^{{'} }` and the canopy air at height +:math:`z_{0h} +d`. + +Figure 5.1. Schematic diagram of sensible heat fluxes for (a) +non-vegetated surfaces and (b) vegetated surfaces. + +.. image:: image1.png + +Figure 5.2. Schematic diagram of water vapor fluxes for (a) +non-vegetated surfaces and (b) vegetated surfaces. + +.. image:: image2.png + +Equations - can be solved for the canopy air temperature :math:`T_{s}` + +.. math:: + :label: ZEqnNum103571 + + T_{s} =\frac{c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} +c_{v}^{h} T_{v} }{c_{a}^{h} +c_{g}^{h} +c_{v}^{h} } + +where + +.. math:: + :label: ZEqnNum298904 + + c_{a}^{h} =\frac{1}{r_{ah} } + +.. math:: + :label: ZEqnNum991533 + + c_{g}^{h} =\frac{1}{r_{ah} ^{{'} } } + +.. math:: + :label: ZEqnNum284616 + + c_{v}^{h} =\frac{\left(L+S\right)}{r_{b} } + +are the sensible heat conductances from the canopy air to the +atmosphere, the ground to canopy air, and leaf surface to canopy air, +respectively (m s\ :math:`{}^{-1}`). + +When the expression for :math:`T_{s}` is substituted into equation , +the sensible heat flux from vegetation :math:`H_{v}` is a function of +:math:`\theta _{atm}` , :math:`T_{g}` , and :math:`T_{v}` + +.. math:: + :label: ZEqnNum362496 + + H_{v} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} -\left(c_{a}^{h} +c_{g}^{h} \right)T_{v} \right]\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . + +Similarly, the expression for :math:`T_{s}` can be substituted into +equation to obtain the sensible heat flux from ground :math:`H_{g}` + +.. math:: + :label: ZEqnNum527667 + + H_{g} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{v}^{h} T_{v} -\left(c_{a}^{h} +c_{v}^{h} \right)T_{g} \right]\frac{c_{g}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . + +The air within the canopy is assumed to have negligible capacity to +store water vapor so that the water vapor flux :math:`E` between the +surface at height :math:`z_{0w} +d` and the atmosphere at height +:math:`z_{atm,\, w}` must be balanced by the sum of the water vapor +flux from the vegetation :math:`E_{v}` and the ground :math:`E_{g}` + +.. math:: + :label: ZEqnNum365017 + + E=E_{v} +E_{g} + +where, with reference to Figure 5.2, + +.. math:: + :label: 5.97) + + E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } + +.. math:: + :label: ZEqnNum351492 + + E_{v} =-\rho _{atm} \frac{\left(q_{s} -q_{sat}^{T_{v} } \right)}{r_{total} } + +.. math:: + :label: ZEqnNum145330 + + E_{g} =\left(1-f_{sno} -f_{h2osfc} \right)E_{soil} +f_{sno} E_{snow} +f_{h2osfc} E_{h2osfc} + +.. math:: + :label: 5.100) + + E_{soil} =-\rho _{atm} \frac{\beta _{soi} \left(q_{s} -q_{soil} \right)}{r_{aw} ^{{'} } +r_{litter} } + +.. math:: + :label: 5.101) + + E_{sno} =-\rho _{atm} \frac{\left(q_{s} -q_{sno} \right)}{r_{aw} ^{{'} } +r_{litter} } + +.. math:: + :label: 5.102) + + E_{h2osfc} =-\rho _{atm} \frac{\left(q_{s} -q_{h2osfc} \right)}{r_{aw} ^{{'} } +r_{litter} } + +where :math:`q_{atm}` is the atmospheric specific humidity (kg +kg\ :math:`{}^{-1}`), :math:`r_{aw}` is the aerodynamic resistance to +water vapor transfer (s m\ :math:`{}^{-1}`), :math:`q_{sat}^{T_{v} }` +(kg kg\ :math:`{}^{-1}`) is the saturation water vapor specific humidity +at the vegetation temperature (section 5.5), :math:`q_{g}` , +:math:`q_{sno}` , and :math:`q_{h2osfc}` are the specific humidities +of the soil, snow, and surface water (section 5.2), +:math:`r_{aw} ^{{'} }` is the aerodynamic resistance (s +m\ :math:`{}^{-1}`) to water vapor transfer between the ground at height +:math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, +:math:`\beta _{soi}` is an empirical function of soil water (section +5.2), and :math:`r_{litter}` is a resistance for the plant litter layer +(s m\ :math:`{}^{-1}`). :math:`r_{total}` is the total resistance to +water vapor transfer from the canopy to the canopy air and includes +contributions from leaf boundary layer and sunlit and shaded stomatal +resistances :math:`r_{b}` , :math:`r_{s}^{sun}` , and +:math:`r_{s}^{sha}` (Figure 5.2). The water vapor flux from vegetation +is the sum of water vapor flux from wetted leaf and stem area +:math:`E_{v}^{w}` (evaporation of water intercepted by the canopy) and +transpiration from dry leaf surfaces :math:`E_{v}^{t}` + +.. math:: + :label: 5.103) + + E_{v} =E_{v}^{w} +E_{v}^{t} . + +Equations - can be solved for the canopy specific humidity +:math:`q_{s}` + +.. math:: + :label: ZEqnNum362168 + + q_{s} =\frac{c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} +c_{v}^{w} q_{sat}^{T_{v} } }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } + +where + +.. math:: + :label: ZEqnNum533553 + + c_{a}^{w} =\frac{1}{r_{aw} } + +.. math:: + :label: ZEqnNum544982 + + c_{v}^{w} =\frac{\left(L+S\right)}{r_{b} } r'' + +.. math:: + :label: ZEqnNum888691 + + c_{g}^{w} =\frac{\beta _{soi} }{r_{aw} ^{{'} } +r_{litter} } + +are the water vapor conductances from the canopy air to the atmosphere, +the leaf to canopy air, and ground to canopy air, respectively. The term +:math:`r''` is determined from contributions by wet leaves and +transpiration and limited by available water and potential evaporation +as + +.. math:: + :label: ZEqnNum166006 + + r''=\left\{\begin{array}{l} {\min \left(f_{wet} +r_{dry} ^{{'} {'} } ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} >0} \\ {\min \left(f_{wet} ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} \le 0} \\ {1\qquad E_{v}^{w,\, pot} \le 0} \end{array}\right\} + +where :math:`f_{wet}` is the fraction of leaves and stems that are wet +(section 7.1), :math:`W_{can}` is canopy water (kg m\ :math:`{}^{-2}`) +(section 7.1), :math:`\Delta t` is the time step (s), and +:math:`\beta _{t}` is a soil moisture function limiting transpiration +(Chapter 8). The potential evaporation from wet foliage per unit wetted +area is + +.. math:: + :label: 5.109) + + E_{v}^{w,\, pot} =-\frac{\rho _{atm} \left(q_{s} -q_{sat}^{T_{v} } \right)}{r_{b} } . + +The term :math:`r_{dry} ^{{'} {'} }` is + +.. math:: + :label: 5.110) + + r_{dry} ^{{'} {'} } =\frac{f_{dry} r_{b} }{L} \left(\frac{L^{sun} }{r_{b} +r_{s}^{sun} } +\frac{L^{sha} }{r_{b} +r_{s}^{sha} } \right) + +where :math:`f_{dry}` is the fraction of leaves that are dry (section +7.1), :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded +leaf area indices (section 4.1), and :math:`r_{s}^{sun}` and +:math:`r_{s}^{sha}` are the sunlit and shaded stomatal resistances (s +m\ :math:`{}^{-1}`) (Chapter 8). + +When the expression for :math:`q_{s}` is substituted into equation , +the water vapor flux from vegetation :math:`E_{v}` is a function of +:math:`q_{atm}` , :math:`q_{g}` , and :math:`q_{sat}^{T_{v} }` + +.. math:: + :label: ZEqnNum256012 + + E_{v} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)q_{sat}^{T_{v} } \right]\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } . + +Similarly, the expression for :math:`q_{s}` can be substituted into +equation to obtain the water vapor flux from the ground beneath the +canopy :math:`E_{g}` + +.. math:: + :label: ZEqnNum243941 + + E_{g} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{v}^{w} q_{sat}^{T_{v} } -\left(c_{a}^{w} +c_{v}^{w} \right)q_{g} \right]\frac{c_{g}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } . + +The aerodynamic resistances to heat (moisture) transfer between the +ground at height :math:`z_{0h} ^{{'} }` (:math:`z_{0w} ^{{'} }` ) and +the canopy air at height :math:`z_{0h} +d` (:math:`z_{0w} +d`) are + +.. math:: + :label: ZEqnNum496775 + + r_{ah} ^{{'} } =r_{aw} ^{{'} } =\frac{1}{C_{s} U_{av} } + +where + +.. math:: + :label: ZEqnNum781547 + + U_{av} =V_{a} \sqrt{\frac{1}{r_{am} V_{a} } } =u_{*} + +is the magnitude of the wind velocity incident on the leaves +(equivalent here to friction velocity) (m s\ :math:`{}^{-1}`) and +:math:`C_{s}` is the turbulent transfer coefficient between the +underlying soil and the canopy air. :math:`C_{s}` is obtained by +interpolation between values for dense canopy and bare soil (Zeng et al. +2005) + +.. math:: + :label: 5.115) + + C_{s} =C_{s,\, bare} W+C_{s,\, dense} (1-W) + +where the weight :math:`W` is + +.. math:: + :label: 5.116) + + W=e^{-\left(L+S\right)} . + +The dense canopy turbulent transfer coefficient in Zeng et al. (2005) +is modified from its original value of 0.004 (Dickinson et al. 1993) by +Sakaguchi and Zeng (2009) to account for stability as + +.. math:: + :label: 5.117) + + C_{s,\, dense} =\left\{\begin{array}{l} {0.004\qquad T_{s} -T_{g} \le 0} \\ {\frac{0.004}{1+\gamma \min \left(S,10\right)} \qquad T_{s} -T_{g} >0} \end{array}\right\} + +where :math:`\gamma =0.5` and :math:`S` is a stability parameter +determined from + +.. math:: + :label: 5.118) + + S=\frac{gz_{top} \left(T_{s} -T_{g} \right)}{T_{s} u_{*}^{2} } + +where :math:`g` is the gravitational acceleration (m +s\ :math:`{}^{-2}`) (Table 2.6), and :math:`z_{top}` is canopy top +height (m) (Table 2.2). The bare soil turbulent transfer coefficient is + +.. math:: + :label: 5.119) + + C_{s,\, bare} =\frac{k}{a} \left(\frac{z_{0m,\, g} U_{av} }{\upsilon } \right)^{-0.45} + +where the kinematic viscosity of air +:math:`\upsilon =1.5\times 10^{-5}` m\ :math:`{}^{2}` +s\ :math:`{}^{-1}` and :math:`a=0.13`. + +The litter resistance :math:`r_{litter}` (Sakaguchi and Zeng 2009) (s +m\ :math:`{}^{-1}`) is + +.. math:: + :label: 5.120) + + r_{litter} =\frac{1}{0.004u_{*} } \left(1-e^{-L_{litter}^{eff} } \right) + +where the effective litter area index :math:`L_{litter}^{eff}` +(:math:`\text{m}^{2}` :math:`\text{m}^{-2}`) is the fraction of plant litter +area index :math:`L_{litter}` (currently set to 0.5 :math:`\text{m}^{2}` +:math:`\text{m}^{-2}`) that is not covered by snow + +.. math:: + :label: 5.121) + + L_{litter}^{eff} =L_{litter} \left[1-\min \left(f_{litter}^{snow} ,\, 1\right)\right]. + +The effective snow cover of the litter layer is + +.. math:: + :label: 5.122) + + f_{litter}^{snow} =\frac{z_{sno} }{\Delta z_{litter} } + +where :math:`\Delta z_{litter} =0.05`\ m is assumed as a typical depth +for the litter layer, and :math:`z_{sno}` is the depth of snow (section +7.2) (m). + +The leaf boundary layer resistance :math:`r_{b}` is + +.. math:: + :label: ZEqnNum181758 + + r_{b} =\frac{1}{C_{v} } \left({U_{av} \mathord{\left/ {\vphantom {U_{av} d_{leaf} }} \right. \kern-\nulldelimiterspace} d_{leaf} } \right)^{{-1\mathord{\left/ {\vphantom {-1 2}} \right. \kern-\nulldelimiterspace} 2} } + +where :math:`C_{v} =0.01` m s\ :math:`{}^{-1/2}` is the turbulent +transfer coefficient between the canopy surface and canopy air, and +:math:`d_{leaf}` is the characteristic dimension of the leaves in the +direction of wind flow (Table 5.1). + +The partial derivatives of the fluxes from the soil beneath the canopy +with respect to ground temperature, which are needed for the soil +temperature calculations (section 6.1) and to update the soil surface +fluxes (section 5.4), are + +.. math:: + :label: ZEqnNum774729 + + \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r'_{ah} } \frac{c_{a}^{h} +c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } + +.. math:: + :label: ZEqnNum562232 + + \frac{\partial E_{g} }{\partial T_{g} } =\frac{\beta _{soi} \rho _{atm} }{r'_{aw} +r_{litter} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . + +The partial derivatives +:math:`\frac{\partial r'_{ah} }{\partial T_{g} }` and +:math:`\frac{\partial r'_{aw} }{\partial T_{g} }` , which cannot be +determined analytically, are ignored for +:math:`\frac{\partial H_{g} }{\partial T_{g} }` and +:math:`\frac{\partial E_{g} }{\partial T_{g} }` . + +The roughness lengths used to calculate :math:`r_{am}` , +:math:`r_{ah}` , and :math:`r_{aw}` from equations , , and are +:math:`z_{0m} =z_{0m,\, v}` , :math:`z_{0h} =z_{0h,\, v}` , and +:math:`z_{0w} =z_{0w,\, v}` . The vegetation displacement height +:math:`d` and the roughness lengths are a function of plant height and +adjusted for canopy density following Zeng and Wang (2007) + +.. math:: + :label: 5.126) + + z_{0m,\, v} =z_{0h,\, v} =z_{0w,\, v} =\exp \left[V\ln \left(z_{top} R_{z0m} \right)+\left(1-V\right)\ln \left(z_{0m,\, g} \right)\right] + +.. math:: + :label: 5.127) + + d=z_{top} R_{d} V + +where :math:`z_{top}` is canopy top height (m) (Table 2.2), +:math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness +length and displacement height to canopy top height, respectively (Table +5.1), and :math:`z_{0m,\, g}` is the ground momentum roughness length +(m) (section 5.2). The fractional weight :math:`V` is determined from + +.. math:: + :label: 5.128) + + V=\frac{1-\exp \left\{-\beta \min \left[L+S,\, \left(L+S\right)_{cr} \right]\right\}}{1-\exp \left[-\beta \left(L+S\right)_{cr} \right]} + +where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} =2` (:math:`\text{m}^{2}` m\ :math:`{}^{-2}`) is a critical value of exposed leaf +plus stem area for which :math:`z_{0m}` reaches its maximum. + +Table 5.1. Plant functional type aerodynamic parameters + ++----------------------------------+--------------------+------------------+-------------------------+ +| Plant functional type | :math:`R_{z0m}` | :math:`R_{d}` | :math:`d_{leaf}` (m) | ++==================================+====================+==================+=========================+ +| NET Temperate | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| NET Boreal | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| NDT Boreal | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BET Tropical | 0.075 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BET temperate | 0.075 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BDT tropical | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BDT temperate | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BDT boreal | 0.055 | 0.67 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BES temperate | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BDS temperate | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| BDS boreal | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| C\ :math:`{}_{3}` arctic grass | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| C\ :math:`{}_{3}` grass | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| C\ :math:`{}_{4}` grass | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Crop R | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Crop I | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Corn R | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Corn I | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Temp Cereal R | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Temp Cereal I | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Winter Cereal R | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Winter Cereal I | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Soybean R | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ +| Soybean I | 0.120 | 0.68 | 0.04 | ++----------------------------------+--------------------+------------------+-------------------------+ + +Numerical Implementation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Canopy energy conservation gives + +.. math:: + :label: 5.129) + + -\overrightarrow{S}_{v} +\overrightarrow{L}_{v} \left(T_{v} \right)+H_{v} \left(T_{v} \right)+\lambda E_{v} \left(T_{v} \right)=0 + +where :math:`\overrightarrow{S}_{v}` is the solar radiation absorbed by +the vegetation (section 4.1), :math:`\overrightarrow{L}_{v}` is the net +longwave radiation absorbed by vegetation (section 4.2), and +:math:`H_{v}` and :math:`\lambda E_{v}` are the sensible and latent +heat fluxes from vegetation, respectively. The term :math:`\lambda` is +taken to be the latent heat of vaporization :math:`\lambda _{vap}` +(Table 2.6). + +:math:`\overrightarrow{L}_{v}` , :math:`H_{v}` , and +:math:`\lambda E_{v}` depend on the vegetation temperature +:math:`T_{v}` . The Newton-Raphson method for finding roots of +non-linear systems of equations can be applied to iteratively solve for +:math:`T_{v}` as + +.. math:: + :label: ZEqnNum247755 + + \Delta T_{v} =\frac{\overrightarrow{S}_{v} -\overrightarrow{L}_{v} -H_{v} -\lambda E_{v} }{\frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } +\frac{\partial H_{v} }{\partial T_{v} } +\frac{\partial \lambda E_{v} }{\partial T_{v} } } + +where :math:`\Delta T_{v} =T_{v}^{n+1} -T_{v}^{n}` and the subscript +“n†indicates the iteration. + +The partial derivatives are + +.. math:: + :label: 5.131) + + \frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } =4\varepsilon _{v} \sigma \left[2-\varepsilon _{v} \left(1-\varepsilon _{g} \right)\right]T_{v}^{3} + +.. math:: + :label: 5.132) + + \frac{\partial H_{v} }{\partial T_{v} } =\rho _{atm} C_{p} \left(c_{a}^{h} +c_{g}^{h} \right)\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } + +.. math:: + :label: 5.133) + + \frac{\partial \lambda E_{v} }{\partial T_{v} } =\lambda \rho _{atm} \left(c_{a}^{w} +c_{g}^{w} \right)\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{sat}^{T_{v} } }{dT_{v} } . + +The partial derivatives +:math:`\frac{\partial r_{ah} }{\partial T_{v} }` and +:math:`\frac{\partial r_{aw} }{\partial T_{v} }` , which cannot be +determined analytically, are ignored for +:math:`\frac{\partial H_{v} }{\partial T_{v} }` and +:math:`\frac{\partial \lambda E_{v} }{\partial T_{v} }` . However, if +:math:`\zeta` changes sign more than four times during the temperature +iteration, :math:`\zeta =-0.01`. This helps prevent “flip-flopping†+between stable and unstable conditions. The total water vapor flux +:math:`E_{v}` , transpiration flux :math:`E_{v}^{t}` , and sensible heat +flux :math:`H_{v}` are updated for changes in leaf temperature as + +.. math:: + :label: ZEqnNum420059 + + E_{v} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)\left(q_{sat}^{T_{v} } +\frac{dq_{sat}^{T_{v} } }{dT_{v} } \Delta T_{v} \right)\right]\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } + +.. math:: + :label: ZEqnNum554100 + + E_{v}^{t} =-r_{dry} ^{{'} {'} } \rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)\left(q_{sat}^{T_{v} } +\frac{dq_{sat}^{T_{v} } }{dT_{v} } \Delta T_{v} \right)\right]\frac{c_{v}^{h} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } + +.. math:: + :label: ZEqnNum839021 + + H_{v} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} -\left(c_{a}^{h} +c_{g}^{h} \right)\left(T_{v} +\Delta T_{v} \right)\right]\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . + +The numerical solution for vegetation temperature and the fluxes of +momentum, sensible heat, and water vapor flux from vegetated surfaces +proceeds as follows: + +#. Initial values for canopy air temperature and specific humidity are + obtained from + + .. math:: + :label: 5.137) + + T_{s} =\frac{T_{g} +\theta _{atm} }{2} + + .. math:: + :label: 5.138) + + q_{s} =\frac{q_{g} +q_{atm} }{2} . + +#. An initial guess for the wind speed :math:`V_{a}` is obtained from + eq. assuming an initial convective velocity :math:`U_{c} =0` m + s\ :math:`{}^{-1}` for stable conditions + (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from + eq. ) and :math:`U_{c} =0.5` for unstable conditions + (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). + +#. An initial guess for the Monin-Obukhov length :math:`L` is obtained + from the bulk Richardson number using equation and . + +#. Iteration proceeds on the following system of equations: + +#. Friction velocity :math:`u_{*}` (eqs. , , , ) + +#. Ratio :math:`\frac{\theta _{*} }{\theta _{atm} -\theta _{s} }` (eqs. + , , , ) + +#. Ratio :math:`\frac{q_{*} }{q_{atm} -q_{s} }` (eqs. , , , ) + +#. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and + :math:`r_{aw}` (eqs. , , ) + +#. Magnitude of the wind velocity incident on the leaves :math:`U_{av}` + (eq. ) + +#. Leaf boundary layer resistance :math:`r_{b}` (eq. ) + +#. Aerodynamic resistances :math:`r_{ah} ^{{'} }` and + :math:`r_{aw} ^{{'} }` (eq. ) + +#. Sunlit and shaded stomatal resistances :math:`r_{s}^{sun}` and + :math:`r_{s}^{sha}` (Chapter 8) + +#. Sensible heat conductances :math:`c_{a}^{h}` , :math:`c_{g}^{h}` , + and :math:`c_{v}^{h}` (eqs. , , ) + +#. Latent heat conductances :math:`c_{a}^{w}` , :math:`c_{v}^{w}` , and + :math:`c_{g}^{w}` (eqs. , , ) + +#. Sensible heat flux from vegetation :math:`H_{v}` (eq. ) + +#. Latent heat flux from vegetation :math:`\lambda E_{v}` (eq. ) + +#. If the latent heat flux has changed sign from the latent heat flux + computed at the previous iteration + (:math:`\lambda E_{v} ^{n+1} \times \lambda E_{v} ^{n} <0`), the + latent heat flux is constrained to be 10% of the computed value. The + difference between the constrained and computed value + (:math:`\Delta _{1} =0.1\lambda E_{v} ^{n+1} -\lambda E_{v} ^{n+1}` ) + is added to the sensible heat flux later. + +#. Change in vegetation temperature :math:`\Delta T_{v}` (eq. ) and + update the vegetation temperature as + :math:`T_{v}^{n+1} =T_{v}^{n} +\Delta T_{v}` . :math:`T_{v}` is + constrained to change by no more than 1ºK in one iteration. If this + limit is exceeded, the energy error is + + .. math:: + :label: 5.139) + + \Delta _{2} =\overrightarrow{S}_{v} -\overrightarrow{L}_{v} -\frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } \Delta T_{v} -H_{v} -\frac{\partial H_{v} }{\partial T_{v} } \Delta T_{v} -\lambda E_{v} -\frac{\partial \lambda E_{v} }{\partial T_{v} } \Delta T_{v} + +where :math:`\Delta T_{v} =1{\rm \; or\; }-1`. The error +:math:`\Delta _{2}` is added to the sensible heat flux later. + +#. Water vapor flux :math:`E_{v}` (eq. ) + +#. Transpiration :math:`E_{v}^{t}` (eq. if :math:`\beta _{t} >0`, + otherwise :math:`E_{v}^{t} =0`) + +#. The water vapor flux :math:`E_{v}` is constrained to be less than or + equal to the sum of transpiration :math:`E_{v}^{t}` and the water + available from wetted leaves and stems + :math:`{W_{can} \mathord{\left/ {\vphantom {W_{can} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` . + The energy error due to this constraint is + + .. math:: + :label: 5.140) + + \Delta _{3} =\max \left(0,\, E_{v} -E_{v}^{t} -\frac{W_{can} }{\Delta t} \right). + +The error :math:`\lambda \Delta _{3}` is added to the sensible heat +flux later. + +#. Sensible heat flux :math:`H_{v}` (eq. ). The three energy error + terms, :math:`\Delta _{1}` , :math:`\Delta _{2}` , and + :math:`\lambda \Delta _{3}` are also added to the sensible heat + flux. + +#. The saturated vapor pressure :math:`e_{i}` (Chapter 8), saturated + specific humidity :math:`q_{sat}^{T_{v} }` and its derivative + :math:`\frac{dq_{sat}^{T_{v} } }{dT_{v} }` at the leaf surface + (section 5.5), are re-evaluated based on the new :math:`T_{v}` . + +#. Canopy air temperature :math:`T_{s}` (eq. ) + +#. Canopy air specific humidity :math:`q_{s}` (eq. ) + +#. Temperature difference :math:`\theta _{atm} -\theta _{s}` + +#. Specific humidity difference :math:`q_{atm} -q_{s}` + +#. Potential temperature scale + :math:`\theta _{*} =\frac{\theta _{*} }{\theta _{atm} -\theta _{s} } \left(\theta _{atm} -\theta _{s} \right)` + where :math:`\frac{\theta _{*} }{\theta _{atm} -\theta _{s} }` was + calculated earlier in the iteration + +#. Humidity scale + :math:`q_{*} =\frac{q_{*} }{q_{atm} -q_{s} } \left(q_{atm} -q_{s} \right)` + where :math:`\frac{q_{*} }{q_{atm} -q_{s} }` was calculated earlier + in the iteration + +#. Virtual potential temperature scale :math:`\theta _{v*}` (eq. ) + +#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) + +#. Monin-Obukhov length :math:`L` (eq. ) + +#. The iteration is stopped after two or more steps if + :math:`\tilde{\Delta }T_{v} <0.01` and + :math:`\left|\lambda E_{v}^{n+1} -\lambda E_{v}^{n} \right|<0.1` + where + :math:`\tilde{\Delta }T_{v} =\max \left(\left|T_{v}^{n+1} -T_{v}^{n} \right|,\, \left|T_{v}^{n} -T_{v}^{n-1} \right|\right)`, + or after forty iterations have been carried out. + +#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (eqs. , ) + +#. Sensible heat flux from ground :math:`H_{g}` (eq. ) + +#. Water vapor flux from ground :math:`E_{g}` (eq. ) + +#. 2-m height air temperature :math:`T_{2m}` , specific humidity + :math:`q_{2m}` , relative humidity :math:`RH_{2m}` \ (eqs. , , ) + +Update of Ground Sensible and Latent Heat Fluxes +---------------------------------------------------- + +The sensible and water vapor heat fluxes derived above for bare soil and +soil beneath canopy are based on the ground surface temperature from the +previous time step :math:`T_{g}^{n}` and are used as the surface +forcing for the solution of the soil temperature equations (section +6.1). This solution yields a new ground surface temperature +:math:`T_{g}^{n+1}` . The ground sensible and water vapor fluxes are +then updated for :math:`T_{g}^{n+1}` as + +.. math:: + :label: 5.141) + + H'_{g} =H_{g} +\left(T_{g}^{n+1} -T_{g}^{n} \right)\frac{\partial H_{g} }{\partial T_{g} } + +.. math:: + :label: 5.142) + + E'_{g} =E_{g} +\left(T_{g}^{n+1} -T_{g}^{n} \right)\frac{\partial E_{g} }{\partial T_{g} } + +where :math:`H_{g}` and :math:`E_{g}` are the sensible heat and water +vapor fluxes derived from equations and for non-vegetated surfaces and +equations and for vegetated surfaces using :math:`T_{g}^{n}` . One +further adjustment is made to :math:`H'_{g}` and :math:`E'_{g}` . If +the soil moisture in the top snow/soil layer is not sufficient to +support the updated ground evaporation, i.e., if :math:`E'_{g} >0` and +:math:`f_{evap} <1` where + +.. math:: + :label: 5.143) + + f_{evap} =\frac{{\left(w_{ice,\; snl+1} +w_{liq,\, snl+1} \right)\mathord{\left/ {\vphantom {\left(w_{ice,\; snl+1} +w_{liq,\, snl+1} \right) \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} }{\sum _{j=1}^{npft}\left(E'_{g} \right)_{j} \left(wt\right)_{j} } \le 1, + +an adjustment is made to reduce the ground evaporation accordingly as + +.. math:: + :label: 5.144) + + E''_{g} =f_{evap} E'_{g} . + +The term +:math:`\sum _{j=1}^{npft}\left(E'_{g} \right)_{j} \left(wt\right)_{j}` +is the sum of :math:`E'_{g}` over all evaporating PFTs where +:math:`\left(E'_{g} \right)_{j}` is the ground evaporation from the +:math:`j^{th}` PFT on the column, :math:`\left(wt\right)_{j}` is the +relative area of the :math:`j^{th}` PFT with respect to the column, and +:math:`npft` is the number of PFTs on the column. +:math:`w_{ice,\, snl+1}` and :math:`w_{liq,\, snl+1}` are the ice and +liquid water contents (kg m\ :math:`{}^{-2}`) of the top snow/soil layer +(Chapter 7). Any resulting energy deficit is assigned to sensible heat +as + +.. math:: + :label: 5.145) + + H''_{g} =H_{g} +\lambda \left(E'_{g} -E''_{g} \right). + +The ground water vapor flux :math:`E''_{g}` is partitioned into +evaporation of liquid water from snow/soil :math:`q_{seva}` (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), sublimation from snow/soil ice +:math:`q_{subl}` (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), liquid dew +on snow/soil :math:`q_{sdew}` (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`), or frost on snow/soil :math:`q_{frost}` (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) as + +.. math:: + :label: 5.146) + + q_{seva} =\max \left(E''_{sno} \frac{w_{liq,\, snl+1} }{w_{ice,\; snl+1} +w_{liq,\, snl+1} } ,0\right)\qquad E''_{sno} \ge 0,\, w_{ice,\; snl+1} +w_{liq,\, snl+1} >0 + +.. math:: + :label: 5.147) + + q_{subl} =E''_{sno} -q_{seva} \qquad E''_{sno} \ge 0 + +.. math:: + :label: 5.148) + + q_{sdew} =\left|E''_{sno} \right|\qquad E''_{sno} <0{\rm \; and\; }T_{g} \ge T_{f} + +.. math:: + :label: 5.149) + + q_{frost} =\left|E''_{sno} \right|\qquad E''_{sno} <0{\rm \; and\; }T_{g} 0} \\ {\lambda _{vap} \qquad {\rm otherwise}} \end{array}\right\} + +where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the latent +heat of sublimation and vaporization, respectively (J +kg\ :math:`{}^{-1}`) (Table 2.6). When converting vegetation water vapor +flux to an energy flux, :math:`\lambda _{vap}` is used. + +The system balances energy as + +.. math:: + :label: 5.154) + + \overrightarrow{S}_{g} +\overrightarrow{S}_{v} +L_{atm} \, \downarrow -L\, \uparrow -H_{v} -H_{g} -\lambda _{vap} E_{v} -\lambda E_{g} -G=0. + +Saturation Vapor Pressure +----------------------------- + +Saturation vapor pressure :math:`e_{sat}^{T}` (Pa) and its derivative +:math:`\frac{de_{sat}^{T} }{dT}` , as a function of temperature +:math:`T` (ºC), are calculated from the eighth-order polynomial fits of +Flatau et al. (1992) + +.. math:: + :label: 5.155) + + e_{sat}^{T} =100\left[a_{0} +a_{1} T+\cdots +a_{n} T^{n} \right] + +.. math:: + :label: 5.156) + + \frac{de_{sat}^{T} }{dT} =100\left[b_{0} +b_{1} T+\cdots +b_{n} T^{n} \right] + +where the coefficients for ice are valid for +:math:`-75\, ^{\circ } {\rm C}\le T<0\, ^{\circ } {\rm C}` and the +coefficients for water are valid for +:math:`0\, ^{\circ } {\rm C}\le T\le 100\, ^{\circ } {\rm C}` (Table 5.2 +and 5.3). The saturated water vapor specific humidity +:math:`q_{sat}^{T}` and its derivative +:math:`\frac{dq_{sat}^{T} }{dT}` are + +.. math:: + :label: 5.157) + + q_{sat}^{T} =\frac{0.622e_{sat}^{T} }{P_{atm} -0.378e_{sat}^{T} } + +.. math:: + :label: 5.158) + + \frac{dq_{sat}^{T} }{dT} =\frac{0.622P_{atm} }{\left(P_{atm} -0.378e_{sat}^{T} \right)^{2} } \frac{de_{sat}^{T} }{dT} . + +Table 5.2. Coefficients for :math:`e_{sat}^{T}` + ++------------------+------------------------------------------+----------------------------------------+ +| | water | ice | ++==================+==========================================+========================================+ +| :math:`a_{0}` | 6.11213476 | 6.11123516 | ++------------------+------------------------------------------+----------------------------------------+ +| :math:`a_{1}` | 4.44007856 :math:`\times 10^{-1}` | 5.03109514\ :math:`\times 10^{-1}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{2}` | 1.43064234 :math:`\times 10^{-2}` | 1.88369801\ :math:`\times 10^{-2}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{3}` | 2.64461437 :math:`\times 10^{-4}` | 4.20547422\ :math:`\times 10^{-4}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{4}` | 3.05903558 :math:`\times 10^{-6}` | 6.14396778\ :math:`\times 10^{-6}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{5}` | 1.96237241 :math:`\times 10^{-8}` | 6.02780717\ :math:`\times 10^{-8}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{6}` | 8.92344772 :math:`\times 10^{-11}` | 3.87940929\ :math:`\times 10^{-10}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{7}` | -3.73208410 :math:`\times 10^{-13}` | 1.49436277\ :math:`\times 10^{-12}` | ++------------------+-------------------------------------------+---------------------------------------+ +| :math:`a_{8}` | 2.09339997 :math:`\times 10^{-16}` | 2.62655803\ :math:`\times 10^{-15}` | ++------------------+------------------------------------------+----------------------------------------+ + +Table 5.3. Coefficients for :math:`\frac{de_{sat}^{T} }{dT}` + ++------------------+----------------------------------------+----------------------------------------+ +| | water | ice | ++==================+========================================+========================================+ +| :math:`b_{0}` | 4.44017302\ :math:`\times 10^{-1}` | 5.03277922\ :math:`\times 10^{-1}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{1}` | 2.86064092\ :math:`\times 10^{-2}` | 3.77289173\ :math:`\times 10^{-2}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{2}` | 7.94683137\ :math:`\times 10^{-4}` | 1.26801703\ :math:`\times 10^{-3}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{3}` | 1.21211669\ :math:`\times 10^{-5}` | 2.49468427\ :math:`\times 10^{-5}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{4}` | 1.03354611\ :math:`\times 10^{-7}` | 3.13703411\ :math:`\times 10^{-7}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{5}` | 4.04125005\ :math:`\times 10^{-10}` | 2.57180651\ :math:`\times 10^{-9}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{6}` | -7.88037859 :math:`\times 10^{-13}` | 1.33268878\ :math:`\times 10^{-11}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{7}` | -1.14596802 :math:`\times 10^{-14}` | 3.94116744\ :math:`\times 10^{-14}` | ++------------------+----------------------------------------+----------------------------------------+ +| :math:`b_{8}` | 3.81294516\ :math:`\times 10^{-17}` | 4.98070196\ :math:`\times 10^{-17}` | ++------------------+----------------------------------------+----------------------------------------+ + diff --git a/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst b/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst new file mode 100644 index 0000000000..d39a780958 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst @@ -0,0 +1,928 @@ +Soil and Snow Temperatures +============================= + +The first law of heat conduction is + +.. math:: + :label: 6.1) + + F=-\lambda \nabla T + +where :math:`F` is the amount of heat conducted across a unit +cross-sectional area in unit time (W m\ :math:`{}^{-2}`), +:math:`\lambda` is thermal conductivity (W m\ :math:`{}^{-1}` +K\ :math:`{}^{-1}`), and :math:`\nabla T` is the spatial gradient of +temperature (K m\ :math:`{}^{-1}`). In one-dimensional form + +.. math:: + :label: ZEqnNum105915 + + F_{z} =-\lambda \frac{\partial T}{\partial z} + +where :math:`z` is in the vertical direction (m) and is positive +downward and :math:`F_{z}` is positive upward. To account for +non-steady or transient conditions, the principle of energy conservation +in the form of the continuity equation is invoked as + +.. math:: + :label: ZEqnNum376834 + + c\frac{\partial T}{\partial t} =-\frac{\partial F_{z} }{\partial z} + +where :math:`c` is the volumetric snow/soil heat capacity (J +m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`) and :math:`t` is time (s). +Combining equations and yields the second law of heat conduction in +one-dimensional form + +.. math:: + :label: 6.4) + + c\frac{\partial T}{\partial t} =\frac{\partial }{\partial z} \left[\lambda \frac{\partial T}{\partial z} \right]. + +This equation is solved numerically to calculate the soil, snow, and +surface water temperatures for a fifteen-layer soil column with up to +five overlying layers of snow and a single surface water layer with the +boundary conditions of :math:`h` as the heat flux into the top soil, +snow, and surface water layers from the overlying atmosphere (section +6.1) and zero heat flux at the bottom of the soil column. The +temperature profile is calculated first without phase change and then +readjusted for phase change (section 6.2). + +Numerical Solution +---------------------- + +The soil column is discretized into fifteen layers (Table 6.1) where the +depth of soil layer :math:`i`, or node depth, :math:`z_{i}` (m), is + +.. math:: + :label: ZEqnNum185766 + + z_{i} =f_{s} \left\{\exp \left[0.5\left(i-0.5\right)\right]-1\right\} + +where :math:`f_{s} =0.025` is a scaling factor. The thickness of each +layer :math:`\Delta z_{i}` (m) is + +.. math:: + :label: 6.6) + + \Delta z_{i} =\left\{\begin{array}{l} {0.5\left(z_{1} +z_{2} \right)\qquad i=1} \\ {0.5\left(z_{i+1} -z_{i-1} \right)\qquad i=2,3,\ldots ,N_{levgrnd} -1} \\ {z_{N} -z_{N-1} \qquad i=N_{levgrnd} } \end{array}\right\} + +where :math:`N_{levgrnd} =15` is the number of soil layers. The depths +at the layer interfaces :math:`z_{h,\, i}` (m) are + +.. math:: + :label: 6.7) + + z_{h,\, i} =\left\{\begin{array}{l} {0.5\left(z_{i} +z_{i+1} \right)\qquad i=1,2,\ldots ,N_{levgrnd} -1} \\ {z_{N_{levgrnd} } +0.5\Delta z_{N_{levgrnd} } \qquad i=N_{levgrnd} } \end{array}\right\}. + +The exponential form of equation is to obtain more soil layers near the +soil surface where the soil water gradient is generally strong (section +7.4). + +Table 6.1. Soil layer structure. + +Layer node depth (:math:`z_{i}` ), thickness (:math:`\Delta z_{i}` ), +and depth at layer interface (:math:`z_{h,\, i}` ) for fifteen-layer +soil column. All in meters. + ++---------------+------------------+-------------------------+-----------------------+ +| Layer | :math:`z_{i}` | :math:`\Delta z_{i}` | :math:`z_{h,\, i}` | ++===============+==================+=========================+=======================+ +| 1 (top) | 0.0071 | 0.0175 | 0.0175 | ++---------------+------------------+-------------------------+-----------------------+ +| 2 | 0.0279 | 0.0276 | 0.0451 | ++---------------+------------------+-------------------------+-----------------------+ +| 3 | 0.0623 | 0.0455 | 0.0906 | ++---------------+------------------+-------------------------+-----------------------+ +| 4 | 0.1189 | 0.0750 | 0.1655 | ++---------------+------------------+-------------------------+-----------------------+ +| 5 | 0.2122 | 0.1236 | 0.2891 | ++---------------+------------------+-------------------------+-----------------------+ +| 6 | 0.3661 | 0.2038 | 0.4929 | ++---------------+------------------+-------------------------+-----------------------+ +| 7 | 0.6198 | 0.3360 | 0.8289 | ++---------------+------------------+-------------------------+-----------------------+ +| 8 | 1.0380 | 0.5539 | 1.3828 | ++---------------+------------------+-------------------------+-----------------------+ +| 9 | 1.7276 | 0.9133 | 2.2961 | ++---------------+------------------+-------------------------+-----------------------+ +| 10 | 2.8646 | 1.5058 | 3.8019 | ++---------------+------------------+-------------------------+-----------------------+ +| 11 | 4.7392 | 2.4826 | 6.2845 | ++---------------+------------------+-------------------------+-----------------------+ +| 12 | 7.8298 | 4.0931 | 10.3775 | ++---------------+------------------+-------------------------+-----------------------+ +| 13 | 12.9253 | 6.7484 | 17.1259 | ++---------------+------------------+-------------------------+-----------------------+ +| 14 | 21.3265 | 11.1262 | 28.2520 | ++---------------+------------------+-------------------------+-----------------------+ +| 15 (bottom) | 35.1776 | 13.8512 | 42.1032 | ++---------------+------------------+-------------------------+-----------------------+ + +The overlying snow pack is modeled with up to five layers depending on +the total snow depth. The layers from top to bottom are indexed in the +Fortran code as :math:`i=-4,-3,-2,-1,0`, which permits the accumulation +or ablation of snow at the top of the snow pack without renumbering the +layers. Layer :math:`i=0` is the snow layer next to the soil surface and +layer :math:`i=snl+1` is the top layer, where the variable :math:`snl` +is the negative of the number of snow layers. The number of snow layers +and the thickness of each layer is a function of snow depth +:math:`z_{sno}` (m) as follows. + +.. math:: \left\{\begin{array}{l} {snl=-1} \\ {\Delta z_{0} =z_{sno} \qquad {\rm for\; 0.01}\le {\rm z}_{{\rm sno}} \le 0.03} \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-2} \\ {\Delta z_{-1} ={z_{sno} \mathord{\left/ {\vphantom {z_{sno} 2}} \right. \kern-\nulldelimiterspace} 2} \qquad {\rm for\; 0.03}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.04} \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-2} \\ {\Delta z_{-1} =0.02\qquad {\rm for\; 0.04}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.07} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-3} \\ {\Delta z_{-2} =0.02} \\ {\Delta z_{-1} ={\left(z_{sno} -0.02\right)\mathord{\left/ {\vphantom {\left(z_{sno} -0.02\right) 2}} \right. \kern-\nulldelimiterspace} 2} \qquad {\rm for\; 0.07}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.12} \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-3} \\ {\Delta z_{-2} =0.02} \\ {\Delta z_{-1} =0.05\qquad {\rm for\; 0.12}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.18} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-4} \\ {\Delta z_{-3} =0.02} \\ {\Delta z_{-2} =0.05\qquad {\rm for\; 0.18}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.29} \\ {\Delta z_{-1} ={\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-4} \\ {\Delta z_{-3} =0.02} \\ {\Delta z_{-2} =0.05\qquad {\rm for\; 0.29}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.41} \\ {\Delta z_{-1} =0.11} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-5} \\ {\Delta z_{-4} =0.02} \\ {\Delta z_{-3} =0.05\qquad {\rm for\; 0.41}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.64} \\ {\Delta z_{-2} =0.11} \\ {\Delta z_{-1} ={\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, + +.. math:: \left\{\begin{array}{l} {snl=-5} \\ {\Delta z_{-4} =0.02} \\ {\Delta z_{-3} =0.05\qquad {\rm for\; 0.64}\, {\rm <}\, {\rm z}_{{\rm sno}} } \\ {\Delta z_{-2} =0.11} \\ {\Delta z_{-1} =0.23} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}. + +The node depths, which are located at the midpoint of the snow layers, +and the layer interfaces are both referenced from the soil surface and +are defined as negative values + +.. math:: + :label: 6.8) + + z_{i} =z_{h,\, i} -0.5\Delta z_{i} \qquad i=snl+1,\ldots ,0 + +.. math:: + :label: 6.9) + + z_{h,\, i} =z_{h,\, i+1} -\Delta z_{i+1} \qquad i=snl,\ldots ,-1. + +Note that :math:`z_{h,\, 0}` , the interface between the bottom snow +layer and the top soil layer, is zero. Thermal properties (i.e., +temperature :math:`T_{i}` [K]; thermal conductivity +:math:`\lambda _{i}` [W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`]; +volumetric heat capacity :math:`c_{i}` [J m\ :math:`{}^{-3}` +K\ :math:`{}^{-1}`]) are defined for soil layers at the node depths +(Figure 6.1) and for snow layers at the layer midpoints. When present, +snow occupies a fraction of a grid cell’s area, therefore snow depth +represents the thickness of the snowpack averaged over only the snow +covered area. The grid cell average snow depth is related to the depth +of the snow covered area as :math:`\bar{z}_{sno} =f_{sno} z_{sno}` . By +default, the grid cell average snow depth is written to the history +file. + +The heat flux :math:`F_{i}` (W m\ :math:`{}^{-2}`) from layer :math:`i` +to layer :math:`i+1` is + +.. math:: + :label: ZEqnNum443713 + + F_{i} =-\lambda \left[z_{h,\, i} \right]\left(\frac{T_{i} -T_{i+1} }{z_{i+1} -z_{i} } \right) + +where the thermal conductivity at the interface +:math:`\lambda \left[z_{h,\, i} \right]` is + +.. math:: + :label: ZEqnNum604125 + + \lambda \left[z_{h,\, i} \right]=\left\{\begin{array}{l} {\frac{\lambda _{i} \lambda _{i+1} \left(z_{i+1} -z_{i} \right)}{\lambda _{i} \left(z_{i+1} -z_{h,\, i} \right)+\lambda _{i+1} \left(z_{h,\, i} -z_{i} \right)} \qquad i=snl+1,\ldots ,N_{levgrnd} -1} \\ {0\qquad i=N_{levgrnd} } \end{array}\right\}. + +These equations are derived, with reference to Figure 6.1, assuming +that the heat flux from :math:`i` (depth :math:`z_{i}` ) to the +interface between :math:`i` and :math:`i+1` (depth :math:`z_{h,\, i}` ) +equals the heat flux from the interface to :math:`i+1` (depth +:math:`z_{i+1}` ), i.e., + +.. math:: + :label: ZEqnNum726244 + + -\lambda _{i} \frac{T_{i} -T_{m} }{z_{h,\, i} -z_{i} } =-\lambda _{i+1} \frac{T_{m} -T_{i+1} }{z_{i+1} -z_{h,\, i} } + +where :math:`T_{m}` is the temperature at the interface of layers +:math:`i` and :math:`i+1`. + +Figure 6.1. Schematic diagram of numerical scheme used to solve for soil +temperature. + +Shown are three soil layers, :math:`i-1`, :math:`i`, and :math:`i+1`. +The thermal conductivity :math:`\lambda` , specific heat capacity +:math:`c`, and temperature :math:`T` are defined at the layer node depth +:math:`z`. :math:`T_{m}` is the interface temperature. The thermal +conductivity :math:`\lambda \left[z_{h} \right]` is defined at the +interface of two layers + +:math:`z_{h}` . The layer thickness is :math:`\Delta z`. The heat fluxes +:math:`F_{i-1}` and :math:`F_{i}` are defined as positive upwards. + +.. image:: image1.png + + +The energy balance for the :math:`i^{th}` layer is + +.. math:: + :label: 6.13) + + \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=-F_{i-1} +F_{i} + +where the superscripts :math:`n` and :math:`n+1` indicate values at the +beginning and end of the time step, respectively, and :math:`\Delta t` +is the time step (s). This equation is solved using the Crank-Nicholson +method, which combines the explicit method with fluxes evaluated at +:math:`n` (:math:`F_{i-1}^{n} ,F_{i}^{n}` ) and the implicit method with +fluxes evaluated at :math:`n+1` (:math:`F_{i-1}^{n+1} ,F_{i}^{n+1}` ) + +.. math:: + :label: 6.14) + + \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=\alpha \left(-F_{i-1}^{n} +F_{i}^{n} \right)+\left(1-\alpha \right)\left(-F_{i-1}^{n+1} +F_{i}^{n+1} \right) + +where :math:`\alpha =0.5`, resulting in a tridiagonal system of +equations + +.. math:: + :label: 6.15) + + r_{i} =a_{i} T_{i-1}^{n+1} +b_{i} T_{i}^{n+1} +c_{i} T_{i+1}^{n+1} + +where :math:`a_{i}` , :math:`b_{i}` , and :math:`c_{i}` are the +subdiagonal, diagonal, and superdiagonal elements in the tridiagonal +matrix and :math:`r_{i}` is a column vector of constants. When surface +water is present, the equation for the top soil layer has an additional +term representing the surface water temperature; this results in a four +element band-diagonal system of equations. + +For the top soil layer :math:`i=1` , top snow layer :math:`i=snl+1`, or +surface water layer, the heat flux from the overlying atmosphere +:math:`h` (W m\ :math:`{}^{-2}`, defined as positive into the surface) +is + +.. math:: + :label: 6.16) + + h^{n+1} =-\alpha F_{i-1}^{n} -\left(1-\alpha \right)F_{i-1}^{n+1} . + +The energy balance for these layers is then + +.. math:: + :label: 6.17) + + \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=h^{n+1} +\alpha F_{i}^{n} +\left(1-\alpha \right)F_{i}^{n+1} . + +The heat flux :math:`h` at :math:`n+1` may be approximated as follows + +.. math:: + :label: 6.18) + + h^{n+1} =h^{n} +\frac{\partial h}{\partial T_{i} } \left(T_{i}^{n+1} -T_{i}^{n} \right). + +The resulting equations are then + +.. math:: + :label: ZEqnNum219926 + + \begin{array}{rcl} {\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)} & {=} & {h^{n} +\frac{\partial h}{\partial T_{i} } \left(T_{i}^{n+1} -T_{i} \right)} \\ {} & {} & {-\alpha \frac{\lambda \left[z_{h,\, i} \right]\left(T_{i}^{n} -T_{i+1}^{n} \right)}{z_{i+1} -z_{i} } -\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i} \right]\left(T_{i}^{n+1} -T_{i+1}^{n+1} \right)}{z_{i+1} -z_{i} } } \end{array} + +For the top snow layer, :math:`i=snl+1`, the coefficients are + +.. math:: + :label: 6.20) + + a_{i} =0 + +.. math:: + :label: 6.21) + + b_{i} =1+\frac{\Delta t}{c_{i} \Delta z_{i} } \left[\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } -\frac{\partial h}{\partial T_{i} } \right] + +.. math:: + :label: 6.22) + + c_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } + +.. math:: + :label: 6.23) + + r_{i} =T_{i}^{n} +\frac{\Delta t}{c_{i} \Delta z_{i} } \left[h_{sno} ^{n} -\frac{\partial h}{\partial T_{i} } T_{i}^{n} +\alpha F_{i} \right] + +where + +.. math:: + :label: ZEqnNum455578 + + F_{i} =-\lambda \left[z_{h,\, i} \right]\left(\frac{T_{i}^{n} -T_{i+1}^{n} }{z_{i+1} -z_{i} } \right). + +The heat flux into the snow surface from the overlying atmosphere +:math:`h` is + +.. math:: + :label: 6.25) + + h=\overrightarrow{S}_{sno} -\overrightarrow{L}_{sno} -H_{sno} -\lambda E_{sno} + +where :math:`\overrightarrow{S}_{sno}` is the solar radiation absorbed +by the top snow layer (section 3.2.1), :math:`\overrightarrow{L}_{sno}` +is the longwave radiation absorbed by the snow (positive toward the +atmosphere) (section 4.2), :math:`H_{sno}` is the sensible heat flux +from the snow (Chapter 5), and :math:`\lambda E_{sno}` is the latent +heat flux from the snow (Chapter 5). The partial derivative of the heat +flux :math:`h` with respect to temperature is + +.. math:: + :label: 6.26) + + \frac{\partial h}{\partial T_{} } =-\frac{\partial \overrightarrow{L}_{} }{\partial T_{} } -\frac{\partial H_{} }{\partial T_{} } -\frac{\partial \lambda E_{} }{\partial T_{} } + +where the partial derivative of the net longwave radiation is + +.. math:: + :label: 6.27) + + \frac{\partial \overrightarrow{L}_{} }{\partial T_{} } =4\varepsilon _{g} \sigma \left(T_{}^{n} \right)^{3} + +and the partial derivatives of the sensible and latent heat fluxes are +given by equations and for non-vegetated surfaces, and by equations and +for vegetated surfaces. :math:`\sigma` is the Stefan-Boltzmann constant +(W m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6) and +:math:`\varepsilon _{g}` is the ground emissivity (section 4.2). For +purposes of computing :math:`h` and +:math:`\frac{\partial h}{\partial T_{g} }` , the term :math:`\lambda` +is arbitrarily assumed to be + +.. math:: + :label: 6.28) + + \lambda =\left\{\begin{array}{l} {\lambda _{sub} \qquad {\rm if\; }w_{liq,\, snl+1} =0{\rm \; and\; }w_{ice,\, snl+1} >0} \\ {\lambda _{vap} \qquad {\rm otherwise}} \end{array}\right\} + +where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the +latent heat of sublimation and vaporization, respectively (J +kg\ :math:`{}^{-1}`) (Table 2.6), and :math:`w_{liq,\, snl+1}` and +:math:`w_{ice,\, snl+1}` are the liquid water and ice contents of the +top snow/soil layer, respectively (kg m\ :math:`{}^{-2}`) (Chapter 7). + +For the top soil layer, :math:`i=1`, the coefficients are + +.. math:: + :label: 6.29) + + a_{i} =-f_{sno} \left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } + +.. math:: + :label: 6.30) + + b_{i} =1+\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \left[f_{sno} \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } +\frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \right]-\left(1-f_{sno} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} + +.. math:: + :label: 6.31) + + c_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } + +.. math:: + :label: 6.32) + + r_{i} =T_{i}^{n} +\frac{\Delta t}{c_{i} \Delta z_{i} } \left[\left(1-f_{sno} \right)\left(h_{soil} ^{n} -\frac{\partial h}{\partial T_{} } T_{i}^{n} \right)+\alpha \left(F_{i} -f_{sno} F_{i-1} \right)\right] + +The heat flux into the soil surface from the overlying atmosphere +:math:`h` is + +.. math:: + :label: 6.33) + + h=\overrightarrow{S}_{soil} -\overrightarrow{L}_{soil} -H_{soil} -\lambda E_{soil} + +It can be seen that when no snow is present (:math:`f_{sno} =0`), the +expressions for the coefficients of the top soil layer have the same +form as those for the top snow layer. + +The surface snow/soil layer temperature computed in this way is the +layer-averaged temperature and hence has somewhat reduced diurnal +amplitude compared with surface temperature. An accurate surface +temperature is provided that compensates for this effect and numerical +error by tuning the heat capacity of the top layer (through adjustment +of the layer thickness) to give an exact match to the analytic solution +for diurnal heating. The top layer thickness for :math:`i=snl+1` is +given by + +.. math:: + :label: 6.34) + + \Delta z_{i*} =0.5\left[z_{i} -z_{h,\, i-1} +c_{a} \left(z_{i+1} -z_{h,\, i-1} \right)\right] + +where :math:`c_{a}` is a tunable parameter, varying from 0 to 1, and is +taken as 0.34 by comparing the numerical solution with the analytic +solution (Z.-L. Yang 1998, unpublished manuscript). +:math:`\Delta z_{i*}` is used in place of :math:`\Delta z_{i}` for +:math:`i=snl+1` in equations -. The top snow/soil layer temperature +computed in this way is the ground surface temperature +:math:`T_{g}^{n+1}` . + +The boundary condition at the bottom of the snow/soil column is zero +heat flux, :math:`F_{i} =0`, resulting in, for :math:`i=N_{levgrnd}` , + +.. math:: + :label: 6.35) + + \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=\alpha \frac{\lambda \left[z_{h,\, i-1} \right]\left(T_{i-1}^{n} -T_{i}^{n} \right)}{z_{i} -z_{i-1} } +\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i-1} \right]\left(T_{i-1}^{n+1} -T_{i}^{n+1} \right)}{z_{i} -z_{i-1} } + +.. math:: + :label: 6.36) + + a_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } + +.. math:: + :label: 6.37) + + b_{i} =1+\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } + +.. math:: + :label: 6.38) + + c_{i} =0 + +.. math:: + :label: 6.39) + + r_{i} =T_{i}^{n} -\alpha \frac{\Delta t}{c_{i} \Delta z_{i} } F_{i-1} + +where + +.. math:: + :label: ZEqnNum768674 + + F_{i-1} =-\frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \left(T_{i-1}^{n} -T_{i}^{n} \right). + +For the interior snow/soil layers, :math:`snl+1T_{f} {\rm \; and\; }w_{ice,\, i} >0\qquad i=snl+1,\ldots ,N_{levgrnd} \qquad {\rm melting}} \\ {T_{i}^{n+1} 0\qquad i=snl+1,\ldots ,0\qquad {\rm freezing}} \\ {T_{i}^{n+1} w_{liq,\, \max ,\, i} \qquad i=1,\ldots ,N_{levgrnd} \qquad {\rm freezing}} \end{array} + +where :math:`T_{i}^{n+1}` is the soil layer temperature after solution +of the tridiagonal equation set, :math:`w_{ice,\, i}` and +:math:`w_{liq,\, i}` are the mass of ice and liquid water (kg +m\ :math:`{}^{-2}`) in each snow/soil layer, respectively, and +:math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). For +the freezing process in soil layers, the concept of supercooled soil +water from Niu and Yang (2006) is adopted. The supercooled soil water is +the liquid water that coexists with ice over a wide range of +temperatures below freezing and is implemented through a freezing point +depression equation + +.. math:: + :label: ZEqnNum547401 + + w_{liq,\, \max ,\, i} =\Delta z_{i} \theta _{sat,\, i} \left[\frac{10^{3} L_{f} \left(T_{f} -T_{i} \right)}{gT_{i} \psi _{sat,\, i} } \right]^{{-1\mathord{\left/ {\vphantom {-1 B_{i} }} \right. \kern-\nulldelimiterspace} B_{i} } } \qquad T_{i} 0`) +but there are no explicit snow layers (:math:`snl=0`) (i.e., there is +not enough snow present to meet the minimum snow depth requirement of +0.01 m), snow melt will take place for soil layer :math:`i=1` if the +soil layer temperature is greater than the freezing temperature +(:math:`T_{1}^{n+1} >T_{f}` ). + +The rate of phase change is assessed from the energy excess (or deficit) +needed to change :math:`T_{i}` to freezing temperature, :math:`T_{f}` . +The excess or deficit of energy :math:`H_{i}` (W m\ :math:`{}^{-2}`) is +determined as follows + +.. math:: + :label: 6.55) + + H_{i} =\left\{\begin{array}{l} {\frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\qquad \quad \quad \quad i=snl+1} \\ {\left(1-f_{sno} -f_{h2osfc} \right)\frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\quad {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} i=1} \\ {-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\qquad \quad \quad \quad i\ne \left\{1,snl+1\right\}} \end{array}\right\}. + +If the melting criteria is met (equation ) and +:math:`H_{m} =\frac{H_{i} \Delta t}{L_{f} } >0`, then the ice mass is +readjusted as + +.. math:: + :label: ZEqnNum547839 + + w_{ice,\, i}^{n+1} =w_{ice,\, i}^{n} -H_{m} \ge 0\qquad i=snl+1,\ldots ,N_{levgrnd} . + +If the freezing criteria is met (equation ) and :math:`H_{m} <0`, then +the ice mass is readjusted for :math:`i=snl+1,\ldots ,0` as + +.. math:: + :label: 6.57) + + w_{ice,\, i}^{n+1} =\min \left(w_{liq,\, i}^{n} +w_{ice,\, i}^{n} ,w_{ice,\, i}^{n} -H_{m} \right) + +and for :math:`i=1,\ldots ,N_{levgrnd}` as + +.. math:: + :label: 6.58) + + w_{ice,\, i}^{n+1} =\left\{\begin{array}{l} {\min \left(w_{liq,\, i}^{n} +w_{ice,\, i}^{n} -w_{liq,\, \max ,\, i}^{n} ,\, w_{ice,\, i}^{n} -H_{m} \right)\qquad w_{liq,\, i}^{n} +w_{ice,\, i}^{n} \ge w_{liq,\, \max ,\, i}^{n} {\rm \; }} \\ {{\rm 0}\qquad w_{liq,\, i}^{n} +w_{ice,\, i}^{n} 0`) as + +.. math:: + :label: ZEqnNum190862 + + T_{i}^{n+1} =\left\{\begin{array}{l} {T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} \qquad \quad \quad \quad \quad \quad \, i=snl+1} \\ {T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} \qquad i=1} \\ {T_{f} +\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \qquad \quad \quad \quad \quad \quad \, i\ne \left\{1,snl+1\right\}} \end{array}\right\}. + +For the special case when snow is present (:math:`W_{sno} >0`), there +are no explicit snow layers (:math:`snl=0`), and +:math:`\frac{H_{1} \Delta t}{L_{f} } >0` (melting), the snow mass +:math:`W_{sno}` (kg m\ :math:`{}^{-2}`) is reduced according to + +.. math:: + :label: 6.62) + + W_{sno}^{n+1} =W_{sno}^{n} -\frac{H_{1} \Delta t}{L_{f} } \ge 0. + +The snow depth is reduced proportionally + +.. math:: + :label: 6.63) + + z_{sno}^{n+1} =\frac{W_{sno}^{n+1} }{W_{sno}^{n} } z_{sno}^{n} . + +Again, because part of the energy may not be consumed in melting, the +energy for the surface soil layer :math:`i=1` is recalculated as + +.. math:: + :label: 6.64) + + H_{1*} =H_{1} -\frac{L_{f} \left(W_{sno}^{n} -W_{sno}^{n+1} \right)}{\Delta t} . + +If there is excess energy (:math:`H_{1*} >0`), this energy becomes +available to the top soil layer as + +.. math:: + :label: ZEqnNum985120 + + H_{1} =H_{1*} . + +The ice mass, liquid water content, and temperature of the top soil +layer are then determined from equations , , and using the recalculated +energy from equation . Snow melt :math:`M_{1S}` (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) and phase change energy :math:`E_{p,\, 1S}` (W +m\ :math:`{}^{-2}`) for this special case are + +.. math:: + :label: 6.66) + + M_{1S} =\frac{W_{sno}^{n} -W_{sno}^{n+1} }{\Delta t} \ge 0 + +.. math:: + :label: 6.67) + + E_{p,\, 1S} =L_{f} M_{1S} . + +The total energy of phase change :math:`E_{p}` (W m\ :math:`{}^{-2}`) +for the snow/soil column is + +.. math:: + :label: 6.68) + + E_{p} =E_{p,\, 1S} +\sum _{i=snl+1}^{N_{levgrnd} }E_{p,i} + +where + +.. math:: + :label: 6.69) + + E_{p,\, i} =L_{f} \frac{\left(w_{ice,\, i}^{n} -w_{ice,\, i}^{n+1} \right)}{\Delta t} . + +The total snow melt :math:`M` (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`) is + +.. math:: + :label: 6.70) + + M=M_{1S} +\sum _{i=snl+1}^{i=0}M_{i} + +where + +.. math:: + :label: 6.71) + + M_{i} =\frac{\left(w_{ice,\, i}^{n} -w_{ice,\, i}^{n+1} \right)}{\Delta t} \ge 0. + +The solution for snow/soil temperatures conserves energy as + +.. math:: + :label: 6.72) + + G-E_{p} -\sum _{i=snl+1}^{i=N_{levgrnd} }\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=0 + +where :math:`G` is the ground heat flux (section 5.4). + +Surface Water +^^^^^^^^^^^^^^^^^^^ + +Phase change of surface water takes place when the surface water +temperature, :math:`T_{h2osfc}` , becomes less than :math:`T_{f}` . The +energy available for freezing is + +.. math:: + :label: 6.73) + + H_{h2osfc} =\frac{\partial h}{\partial T} \left(T_{f} -T_{h2osfc}^{n} \right)-\frac{c_{h2osfc} \Delta z_{h2osfc} }{\Delta t} \left(T_{f} -T_{h2osfc}^{n} \right) + +where :math:`c_{h2osfc}` is the volumetric heat capacity of water, and +:math:`\Delta z_{h2osfc}` is the depth of the surface water layer. If +:math:`H_{m} =\frac{H_{h2osfc} \Delta t}{L_{f} } >0` then :math:`H_{m}` +is removed from surface water and added to the snow column as ice + +.. math:: + :label: 6.74) + + H^{n+1} _{h2osfc} =H^{n} _{h2osfc} -H_{m} + +.. math:: + :label: 6.75) + + w_{ice,\, 0}^{n+1} =w_{ice,\, 0}^{n} +H_{m} + +The snow depth is adjusted to account for the additional ice mass + +.. math:: + :label: 6.76) + + \Delta z_{sno} =\frac{H_{m} }{\rho _{ice} } + +If :math:`H_{m}` \ is greater than :math:`W_{sfc}` , the excess heat +:math:`\frac{L_{f} \left(H_{m} -W_{sfc} \right)}{\Delta t}` is used to +cool the snow layer. + +Soil and Snow Thermal Properties +------------------------------------ + +The thermal and hydraulic (section 6.3 and 7.4.1) properties of the soil +are assumed to be a weighted combination of the mineral and organic +properties of the soil (Lawrence and Slater 2008). The soil layer +organic matter fraction :math:`f_{om,i}` is + +.. math:: + :label: 6.77) + + f_{om,i} =\rho _{om,i} /\rho _{om,\max } . + +Soil thermal conductivity :math:`\lambda _{i}` (W m\ :math:`{}^{-1}` +K\ :math:`{}^{-1}`) is from Farouki (1981) + +.. math:: + :label: 6.78) + + \begin{array}{l} {\lambda _{i} =\left\{\begin{array}{l} {K_{e,\, i} \lambda _{sat,\, i} +\left(1-K_{e,\, i} \right)\lambda _{dry,\, i} \qquad S_{r,\, i} >1\times 10^{-7} } \\ {\lambda _{dry,\, i} \qquad S_{r,\, i} \le 1\times 10^{-7} } \end{array}\right\}\qquad i=1,\ldots ,N_{levsoi} } \\ {\lambda _{i} =\lambda _{bedrock} \qquad i=N_{levsoi} +1,\ldots N_{levgrnd} } \end{array} + +where :math:`\lambda _{sat,\, i}` is the saturated thermal +conductivity, :math:`\lambda _{dry,\, i}` is the dry thermal +conductivity, :math:`K_{e,\, i}` is the Kersten number, +:math:`S_{r,\, i}` is the wetness of the soil with respect to +saturation, and :math:`\lambda _{bedrock} =3` W m\ :math:`{}^{-1}` +K\ :math:`{}^{-1}` is the thermal conductivity assumed for the deep +ground layers (typical of saturated granitic rock; Clauser and Huenges, +1995). For glaciers and wetlands, + +.. math:: + :label: 6.79) + + \lambda _{i} =\left\{\begin{array}{l} {\lambda _{liq,\, i} \qquad T_{i} \ge T_{f} } \\ {\lambda _{ice,\, i} \qquad T_{i} 0`) but +there are no explicit snow layers (:math:`snl=0`), the heat capacity of +the top layer is a blend of ice and soil heat capacity + +.. math:: + :label: 6.93) + + c_{1} =c_{1}^{\*} +\frac{C_{ice} W_{sno} }{\Delta z_{1} } + +where :math:`c_{1}^{\*}` is calculated from equation or . + +.. todo:: fill in the above - should be calculated form equation (6.89) or (6.92) + diff --git a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst new file mode 100644 index 0000000000..47359c6b77 --- /dev/null +++ b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst @@ -0,0 +1,2167 @@ +Hydrology +============ + +The model parameterizes interception, throughfall, canopy drip, snow +accumulation and melt, water transfer between snow layers, infiltration, +evaporation, surface runoff, sub-surface drainage, redistribution within +the soil column, and groundwater discharge and recharge to simulate +changes in canopy water :math:`\Delta W_{can}` , surface water +:math:`\Delta W_{sfc}` , snow water :math:`\Delta W_{sno}` , soil water +:math:`\Delta w_{liq,\, i}` , and soil ice :math:`\Delta w_{ice,\, i}` , +and water in the unconfined aquifer :math:`\Delta W_{a}` (all in kg +m\ :math:`{}^{-2}` or mm of H\ :math:`{}_{2}`\ O) (Figure 7.1). + +The total water balance of the system is + +.. math:: + :label: 7.1) + + \begin{array}{l} {\Delta W_{can} +\Delta W_{sfc} +\Delta W_{sno} +} \\ {\sum _{i=1}^{N_{levsoi} }\left(\Delta w_{liq,\, i} +\Delta w_{ice,\, i} \right)+\Delta W_{a} =\left(\begin{array}{l} {q_{rain} +q_{sno} -E_{v} -E_{g} -q_{over} } \\ {-q_{h2osfc} -q_{drai} -q_{rgwl} -q_{snwcp,\, ice} } \end{array}\right) \Delta t} \end{array} + +where :math:`q_{rain}` is the liquid part of precipitation, +:math:`q_{sno}` is the solid part of precipitation, :math:`E_{v}` is +ET from vegetation (Chapter 5), :math:`E_{g}` is ground evaporation +(Chapter 5), :math:`q_{over}` is surface runoff (section 7.3), +:math:`q_{h2osfc}` is runoff from surface water storage (section 7.3), +:math:`q_{drai}` is sub-surface drainage (section 7.6), +:math:`q_{rgwl}` and :math:`q_{snwcp,ice}` are liquid and solid runoff +from glaciers, wetlands, and lakes, and runoff from other surface types +due to snow capping (section 7.7) (all in kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`), :math:`N_{levsoi}` is the number of soil layers +(note that hydrology calculations are only done over soil layers 1 to +:math:`N_{levsoi}` ; ground levels :math:`N_{levsoi} +1`\ to +:math:`N_{levgrnd}` are currently hydrologically inactive; Lawrence et +al. 2008) and :math:`\Delta t` is the time step (s). + +Figure 7.1. Hydrologic processes represented in CLM. + +.. image:: image1.png + +Canopy Water +---------------- + +Precipitation is either intercepted by the canopy, falls directly to the +snow/soil surface (throughfall), or drips off the vegetation (canopy +drip). Interception by vegetation :math:`q_{intr}` (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) does not distinguish between +liquid and solid phases + +.. math:: + :label: 7.2) + + q_{intr} =\alpha \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + +where :math:`L` and :math:`S` are the exposed leaf and stem area index, +respectively (section 2.1.4), and :math:`\alpha =0.25` scales +interception from point to grid cell (Lawrence et al. 2007). Throughfall +(kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), however, is divided into +liquid and solid phases reaching the ground (soil or snow surface) as + +.. math:: + :label: 7.3) + + q_{thru,\, liq} =q_{rain} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] + +.. math:: + :label: 7.4) + + q_{thru,\, ice} =q_{sno} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. + +Similarly, the canopy drip is + +.. math:: + :label: 7.5) + + q_{drip,\, liq} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{rain} }{q_{rain} +q_{sno} } \ge 0 + +.. math:: + :label: 7.6) + + q_{drip,\, ice} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{sno} }{q_{rain} +q_{sno} } \ge 0 + +where + +.. math:: + :label: 7.7) + + W_{can}^{intr} =W_{can}^{n} +q_{intr} \Delta t\ge 0 + +is the canopy water after accounting for interception, +:math:`W_{can}^{n}` is the canopy water from the previous time step, +and :math:`W_{can,\, \max }` (kg m\ :math:`{}^{-2}`) is the maximum +amount of water the canopy can hold + +.. math:: + :label: 7.8) + + W_{can,\, \max } =p\left(L+S\right). + +The maximum storage of solid water is assumed to be the same as that of +liquid water, :math:`p=0.1` kg m\ :math:`{}^{-2}` (Dickinson et al. +1993). The canopy water is updated as + +.. math:: + :label: 7.9) + + W_{can}^{n+1} =W_{can}^{n} +q_{intr} \Delta t-\left(q_{drip,\, liq} +q_{drip,\, ice} \right)\Delta t-E_{v}^{w} \Delta t\ge 0. + +where :math:`E_{v}^{w}` is the flux of water vapor from stem and leaf +surfaces (Chapter 5). The total rate of liquid and solid precipitation +reaching the ground is then + +.. math:: + :label: ZEqnNum946822 + + q_{grnd,liq} =q_{thru,\, liq} +q_{drip,\, liq} + +.. math:: + :label: ZEqnNum339590 + + q_{grnd,ice} =q_{thru,\, ice} +q_{drip,\, ice} . + +Solid precipitation reaching the soil or snow surface, +:math:`q_{grnd,\, ice} \Delta t`, is added immediately to the snow pack +(section 7.2). The liquid part, :math:`q_{grnd,\, liq} \Delta t` is +added after surface fluxes (Chapter 5) and snow/soil temperatures +(Chapter 6) have been determined. + +The wetted fraction of the canopy (stems plus leaves), which is required +for the surface albedo (section 3.1) and surface flux (Chapter 5) +calculations is (Dickinson et al. 1993) + +.. math:: + :label: 7.12) + + f_{wet} =\left\{\begin{array}{l} {\left[\frac{W_{can} }{p\left(L+S\right)} \right]^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \le 1\qquad L+S>0} \\ {0\qquad L+S=0} \end{array}\right\} + +while the fraction of the canopy that is dry and transpiring is + +.. math:: + :label: 7.13) + + f_{dry} =\left\{\begin{array}{l} {\frac{\left(1-f_{wet} \right)L}{L+S} \qquad L+S>0} \\ {0\qquad L+S=0} \end{array}\right\}. + +Snow +-------- + +The parameterizations for snow are based primarily on Anderson (1976), +country-regionplaceJordan (1991), and Dai and Zeng (1997). The snowpack +can have up to five layers. These layers are indexed in the Fortran code +as :math:`i=-4,-3,-2,-1,0` where layer :math:`i=0` is the snow layer +next to the top soil layer and layer :math:`i=-4` is the top layer of a +five-layer snow pack. Since the number of snow layers varies according +to the snow depth, we use the notation :math:`snl+1` to describe the top +layer of snow for the variable layer snow pack, where :math:`snl` is the +negative of the number of snow layers. Refer to Figure 7.2 for an +example of the snow layer structure for a three layer snow pack. + +Figure 7.2. Example of three layer snow pack (:math:`snl=-3`). + +Shown are three snow layers, :math:`i=-2`, :math:`i=-1`, and +:math:`i=0`. The layer node depth is :math:`z`, the layer interface is +:math:`z_{h}` , and the layer thickness is :math:`\Delta z`. + +.. image:: image2.png + +The state variables for snow are the mass of water :math:`w_{liq,i}` +(kg m\ :math:`{}^{-2}`), mass of ice :math:`w_{ice,i}` (kg +m\ :math:`{}^{-2}`), layer thickness :math:`\Delta z_{i}` (m), and +temperature :math:`T_{i}` (Chapter 6). The water vapor phase is +neglected. Snow can also exist in the model without being represented by +explicit snow layers. This occurs when the snowpack is less than a +specified minimum snow depth (:math:`z_{sno} <0.01` m). In this case, +the state variable is the mass of snow :math:`W_{sno}` (kg +m\ :math:`{}^{-2}`). + +Section 7.2.1 describes the calculation of fractional snow covered area, +which is used in the surface albedo calculation (Chapter 3) and the +surface flux calculations (Chapter 5). The following two sections (7.2.2 +and 7.2.3) describe the ice and water content of the snow pack assuming +that at least one snow layer exists. Section 7.2.4 describes how black +and organic carbon and mineral dust particles are represented within +snow, including meltwater flushing. See section 7.2.5 for a description +of how a snow layer is initialized. + +Snow Covered Area Fraction +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The fraction of the ground covered by snow, :math:`f_{sno}` , is based +on the method of Swenson and Lawrence (2012). Because the processes +governing snowfall and snowmelt differ, changes in :math:`f_{sno}` are +calculated separately for accumulation and depletion. When snowfall +occurs, :math:`f_{sno}` is updated as + +.. math:: + :label: 7.14) + + f^{n+1} _{sno} =1-\left(\left(1-\tanh (k_{accum} q_{sno} \Delta t)\right)\left(1-f^{n} _{sno} \right)\right) + +where :math:`k_{accum}` is a constant whose default value is 0.1, +:math:`q_{sno} \Delta t` is the amount of new snow, +:math:`f^{n+1} _{sno}` is the updated snow covered fraction (SCF), and +:math:`f^{n} _{sno}` is the SCF from the previous time step. + +When snow melt occurs, :math:`f_{sno}` is calculated from the depletion +curve + +.. math:: + :label: 7.15) + + f_{sno} =1-\left(\frac{\cos ^{-1} \left(2R_{sno} -1\right)}{\pi } \right)^{N_{melt} } + +where :math:`R_{sno}` is the ratio of :math:`W_{sno}` to the maximum +accumulated snow :math:`W_{\max }` , and :math:`N_{melt}` is a +parameter that depends on the topographic variability within the grid +cell. Whenever :math:`W_{sno}` reaches zero, :math:`W_{\max }` is +reset to zero. The depletion curve shape parameter is defined as + +.. math:: + :label: 7.16) + + N_{melt} =\frac{200}{\min \left(10,\sigma _{topo} \right)} + +The standard deviation of the elevation within a grid cell, +:math:`\sigma _{topo}` , is calculated from a high resolution DEM (a +1km DEM is used for CLM). + +Ice Content +^^^^^^^^^^^^^^^^^ + +The conservation equation for mass of ice in snow layers is + +.. math:: + :label: 7.17) + + \frac{\partial w_{ice,\, i} }{\partial t} =\left\{\begin{array}{l} {f_{sno} q_{ice,\, i-1} -\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+1} \\ {-\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+2,\ldots ,0} \end{array}\right\} + +where :math:`q_{ice,\, i-1}` is the rate of ice accumulation from +precipitation or frost or the rate of ice loss from sublimation (kg +m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) in the top layer and +:math:`{\left(\Delta w_{ice,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{ice,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` +is the change in ice due to phase change (melting rate) (section 6.2). +The term :math:`q_{ice,\, i-1}` is computed in two steps as + +.. math:: + :label: 7.18) + + q_{ice,\, i-1} =q_{grnd,\, ice} +\left(q_{frost} -q_{subl} \right) + +where :math:`q_{grnd,\, ice}` is the rate of solid precipitation +reaching the ground (section 7.1) and :math:`q_{frost}` and +:math:`q_{subl}` are gains due to frost and losses due to sublimation, +respectively (section 5.4). In the first step, immediately after +:math:`q_{grnd,\, ice}` has been determined after accounting for +interception (section 7.1), a new snow depth :math:`z_{sno}` (m) is +calculated from + +.. math:: + :label: 7.19) + + z_{sno}^{n+1} =z_{sno}^{n} +\Delta z_{sno} + +where + +.. math:: + :label: 7.20) + + \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } + +and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg +m\ :math:`{}^{-3}`) (CityplaceAnderson 1976) + +.. math:: + :label: 7.21) + + \rho _{sno} =\left\{\begin{array}{l} {50+1.7\left(17\right)^{1.5} \qquad T_{atm} >T_{f} +2} \\ {50+1.7\left(T_{atm} -T_{f} +15\right)^{1.5} \qquad T_{f} -15T_{f}` ). In this case, the incoming solid precipitation +is assigned to the runoff term :math:`q_{rgwl}` (section 7.7). + +In the second step, after surface fluxes and snow/soil temperatures have +been determined (Chapters 5 and 6), :math:`w_{ice,\, snl+1}` is updated +for frost or sublimation as + +.. math:: + :label: ZEqnNum863244 + + w_{ice,\, snl+1}^{n+1} =w_{ice,\, snl+1}^{n} +f_{sno} \left(q_{frost} -q_{subl} \right)\Delta t. + +If :math:`w_{ice,\, snl+1}^{n+1} <0` upon solution of equation , the ice +content is reset to zero and the liquid water content +:math:`w_{liq,\, snl+1}` is reduced by the amount required to bring +:math:`w_{ice,\, snl+1}^{n+1}` up to zero. + +The snow water equivalent :math:`W_{sno}` is capped to not exceed 1000 +kg m\ :math:`{}^{-2}`. If the addition of :math:`q_{frost}` were to +result in :math:`W_{sno} >1000` kg m\ :math:`{}^{-2}`, the frost term +:math:`q_{frost}` is instead added to the ice runoff term +:math:`q_{snwcp,\, ice}` (section 7.7). + +Water Content +^^^^^^^^^^^^^^^^^^^ + +The conservation equation for mass of water in snow layers is + +.. math:: + :label: 7.26) + + \frac{\partial w_{liq,\, i} }{\partial t} =\left(q_{liq,\, i-1} -q_{liq,\, i} \right)+\frac{\left(\Delta w_{liq,\, i} \right)_{p} }{\Delta t} + +where :math:`q_{liq,\, i-1}` is the flow of liquid water into layer +:math:`i` from the layer above, :math:`q_{liq,\, i}` is the flow of +water out of layer :math:`i` to the layer below, +:math:`{\left(\Delta w_{liq,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{liq,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` +is the change in liquid water due to phase change (melting rate) +(section 6.2). For the top snow layer only, + +.. math:: + :label: 7.27) + + q_{liq,\, i-1} =f_{sno} \left(q_{grnd,\, liq} +\left(q_{sdew} -q_{seva} \right)\right) + +where :math:`q_{grnd,\, liq}` is the rate of liquid precipitation +reaching the snow (section 7.1), :math:`q_{seva}` is the evaporation of +liquid water and :math:`q_{sdew}` is the liquid dew (section 5.4). +After surface fluxes and snow/soil temperatures have been determined +(Chapters 5 and 6), :math:`w_{liq,\, snl+1}` is updated for the liquid +precipitation reaching the ground and dew or evaporation as + +.. math:: + :label: 7.28) + + w_{liq,\, snl+1}^{n+1} =w_{liq,\, snl+1}^{n} +f_{sno} \left(q_{grnd,\, liq} +q_{sdew} -q_{seva} \right)\Delta t. + +When the liquid water within a snow layer exceeds the layer’s holding +capacity, the excess water is added to the underlying layer, limited by +the effective porosity (:math:`1-\theta _{ice}` ) of the layer. The flow +of water is assumed to be zero (:math:`q_{liq,\, i} =0`) if the +effective porosity of either of the two layers +(:math:`1-\theta _{ice,\, i} {\rm \; and\; }1-\theta _{ice,\, i+1}` ) is +less than :math:`\theta _{imp} =0.05`, the water impermeable volumetric +water content. Thus, water flow between layers, :math:`q_{liq,\, i}` , +for layers :math:`i=snl+1,\ldots ,0`, is initially calculated as + +.. math:: + :label: ZEqnNum767577 + + q_{liq,\, i} =\frac{\rho _{liq} \left[\theta _{liq,\, i} -S_{r} \left(1-\theta _{ice,\, i} \right)\right]f_{sno} \Delta z_{i} }{\Delta t} \ge 0 + +where the volumetric liquid water :math:`\theta _{liq,\, i}` and ice +:math:`\theta _{ice,\, i}` contents are + +.. math:: + :label: 7.30) + + \theta _{ice,\, i} =\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } \le 1 + +.. math:: + :label: 7.31) + + \theta _{liq,\, i} =\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \le 1-\theta _{ice,\, i} , + +and :math:`S_{r} =0.033` is the irreducible water saturation (snow +holds a certain amount of liquid water due to capillary retention after +drainage has ceased (Anderson 1976)). The water holding capacity of the +underlying layer limits the flow of water :math:`q_{liq,\, i}` +calculated in equation , unless the underlying layer is the surface soil +layer, as + +.. math:: + :label: 7.32) + + q_{liq,\, i} \le \frac{\rho _{liq} \left[1-\theta _{ice,\, i+1} -\theta _{liq,\, i+1} \right]\Delta z_{i+1} }{\Delta t} \qquad i=snl+1,\ldots ,-1. + +The liquid water content :math:`w_{liq,\, i}` is updated as + +.. math:: + :label: ZEqnNum265203 + + w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\left(q_{i-1} -q_{i} \right)\Delta t. + +Equations - are solved sequentially from top (:math:`i=snl+1`) to +bottom (:math:`i=0`) snow layer in each time step. The total flow of +liquid water reaching the soil surface is then :math:`q_{liq,\, 0}` +which is used in the calculation of surface runoff and infiltration +(section 7.3). + +Black and organic carbon and mineral dust within snow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Particles within snow originate from atmospheric aerosol deposition +(:math:`D_{sp}` in Table 2.3 (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) +and influence snow radiative transfer (sections 3.2.1, 3.2.2, and +3.3.3). Particle masses and mixing ratios are represented with a simple +mass-conserving scheme. The model maintains masses of the following +eight particle species within each snow layer: hydrophilic black carbon, +hydrophobic black carbon, hydrophilic organic carbon, hydrophobic +organic carbon, and four species of mineral dust with the following +particle sizes: 0.1-1.0, 1.0-2.5, 2.5-5.0, and 5.0-10.0 :math:`\mu m`. +Each of these species has unique optical properties (Table 3.5) and +meltwater removal efficiencies (Table 7.1). + +The black carbon and organic carbon deposition rates described in Table +2.3 are combined into four categories as follows + +.. math:: + :label: 7.34) + + D_{bc,\, hphil} =D_{bc,\, dryhphil} +D_{bc,\, wethphil} + +.. math:: + :label: 7.35) + + D_{bc,\, hphob} =D_{bc,\, dryhphob} + +.. math:: + :label: 7.36) + + D_{oc,\, hphil} =D_{oc,\, dryhphil} +D_{oc,\, wethphil} + +.. math:: + :label: 7.37) + + D_{oc,\, hphob} =D_{oc,\, dryhphob} + +Deposited particles are assumed to be instantly mixed (homogeneously) +within the surface snow layer and are added after the inter-layer water +fluxes are computed (section 7.2.3) so that some aerosol is in the top +layer after deposition and is not immediately washed out before +radiative calculations are done. Particle masses are then redistributed +each time step based on meltwater drainage through the snow column +(section 7.2.3) and snow layer combination and subdivision (section +7.2.7). The change in mass of each of the particle species +:math:`\Delta m_{sp,\, i}` (kg m\ :math:`{}^{-2}`) is + +.. math:: + :label: 7.38) + + \Delta m_{sp,\, i} =\left[k_{sp} \left(q_{liq,\, i-1} c_{sp,\, i-1} -q_{liq,\, i} c_{i} \right)+D_{sp} \right]\Delta t + +where :math:`k_{sp}` is the meltwater scavenging efficiency that is +unique for each species (Table 7.1), :math:`q_{liq,\, i-1}` is the flow +of liquid water into layer :math:`i` from the layer above, +:math:`q_{liq,\, i}` is the flow of water out of layer :math:`i` into +the layer below (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) (section +7.2.3), :math:`c_{sp,\, i-1}` and :math:`c_{sp,\, i}` are the particle +mass mixing ratios in layers :math:`i-1` and :math:`i` (kg +kg\ :math:`{}^{-1}`), :math:`D_{sp}` is the atmospheric deposition rate +(zero for all layers except layer :math:`snl+1`), and :math:`\Delta t` +is the model time step (s). The particle mass mixing ratio is + +.. math:: + :label: 7.39) + + c_{i} =\frac{m_{sp,\, i} }{w_{liq,\, i} +w_{ice,\, i} } . + +Values of :math:`k_{sp}` are partially derived from experiments +published by Conway et al. (1996). Particles masses are re-distributed +proportionately with snow mass when layers are combined or divided, thus +conserving particle mass within the snow column. The mass of particles +carried out with meltwater through the bottom snow layer is assumed to +be permanently lost from the snowpack, and is not maintained within the +model. + +Table 7.1. Meltwater scavenging efficiency for particles within snow + ++------------------------------------------+-------------------+ +| Species | :math:`k_{sp}` | ++==========================================+===================+ +| Hydrophilic black carbon | 0.20 | ++------------------------------------------+-------------------+ +| Hydrophobic black carbon | 0.03 | ++------------------------------------------+-------------------+ +| Hydrophilic organic carbon | 0.20 | ++------------------------------------------+-------------------+ +| Hydrophobic organic carbon | 0.03 | ++------------------------------------------+-------------------+ +| Dust species 1 (0.1-1.0 :math:`\mu m`) | 0.02 | ++------------------------------------------+-------------------+ +| Dust species 2 (1.0-2.5 :math:`\mu m`) | 0.02 | ++------------------------------------------+-------------------+ +| Dust species 3 (2.5-5.0 :math:`\mu m`) | 0.01 | ++------------------------------------------+-------------------+ +| Dust species 4 (5.0-10.0 :math:`\mu m`) | 0.01 | ++------------------------------------------+-------------------+ + +Initialization of snow layer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If there are no existing snow layers (:math:`snl+1=1`) but +:math:`z_{sno} \ge 0.01` m after accounting for solid precipitation +:math:`q_{sno}` , then a snow layer is initialized (:math:`snl=-1`) as +follows + +.. math:: + :label: 7.40) + + \begin{array}{l} {\Delta z_{0} =z_{sno} } \\ {z_{o} =-0.5\Delta z_{0} } \\ {z_{h,\, -1} =-\Delta z_{0} } \\ {T_{0} =\min \left(T_{f} ,T_{atm} \right)} \\ {w_{ice,\, 0} =W_{sno} } \\ {w_{liq,\, 0} =0} \end{array}. + +Snow Compaction +^^^^^^^^^^^^^^^^^^^^^ + +Snow compaction is initiated after the soil hydrology calculations +[surface runoff (section 7.3), infiltration (section 7.3), soil water +(section 7.4), groundwater-soilwater interactions (section 7.6)] are +complete. Compaction of snow includes three types of processes: +destructive metamorphism of new snow (crystal breakdown due to wind or +thermodynamic stress); snow load or overburden (pressure); and melting +(changes in snow structure due to melt-freeze cycles plus changes in +crystals due to liquid water). The total fractional compaction rate for +each snow layer :math:`C_{R,\, i}` (:math:`\text{s}^{-1}`) is the sum of the +three compaction processes + +.. math:: + :label: 7.41) + + C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} . + +Compaction is not allowed if the layer is saturated + +.. math:: + :label: 7.42) + + 1-\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } +\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \right)\le 0.001 + +or if the ice content is below a minimum value +(:math:`w_{ice,\, i} \le 0.1`). + +Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` +(:math:`{\text s^{-1}}`) is temperature dependent (CityplaceAnderson 1976) + +.. math:: + :label: 7.43) + + C_{R1,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{metamorphism} =-c_{3} c_{1} c_{2} \exp \left[-c_{4} \left(T_{f} -T_{i} \right)\right] + +where :math:`c_{3} =2.777\times 10^{-6}` (:math:`\text{s}^{-1}`) is the +fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` :math:`\text{K}^{-1}`, and + +.. math:: + :label: 7.44) + + c_{1} & = 1\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{1} & = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right]\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{2} & = 2\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ + c_{2} & = 1\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 + +where +:math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` +and +:math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` +are the bulk densities of liquid water and ice (kg m\ :math:`{}^{-3}`). + +The compaction rate as a result of overburden :math:`C_{R2,\; i}` +(:math:`\text{s}^{-1}`) is a linear function of the snow load pressure +:math:`P_{s,\, i}` (:math:`\text{k} \text{g} \text{m}^{-2}`) (CityplaceAnderson 1976) + +.. math:: + :label: 7.45) + + C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } + +where :math:`\eta` is a viscosity coefficient (:math:`\text{kg} \text{s} \text{m}^{-2}`) +that varies with density and temperature as + +.. math:: + :label: 7.46) + + \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] + +where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :math:`{}^{-2}`, and +:math:`c_{5} =0.08` K\ :math:`{}^{-1}`, :math:`c_{6} =0.023` +m\ :math:`{}^{3}` kg\ :math:`{}^{-1}` are constants. The snow load +pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of +the ice :math:`w_{ice,\, i}` and liquid water contents +:math:`w_{liq,\, i}` of the layers above plus half the ice and liquid +water contents of the layer being compacted + +.. math:: + :label: 7.47) + + P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . + +The compaction rate due to melting :math:`C_{R3,\; i}` +(:math:`\text{s}^{-1}`) is taken to be the ratio of the change in snow ice +mass after the melting to the mass before melting + +.. math:: + :label: 7.48) + + C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) + +and melting is identified during the phase change calculations (section +6.2). Because snow depth is defined as the average depth of the snow +covered area, the snow depth must also be updated for changes in +:math:`f_{sno}` . + +.. math:: + :label: 7.49) + + C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) + +The snow layer thickness after compaction is then + +.. math:: + :label: 7.50) + + \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). + +Snow Layer Combination and Subdivision +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +After the determination of snow temperature including phase change +(Chapter 6), snow hydrology (sections 7.2.2, 7.2.3, and 7.2.4), and the +compaction calculations , the number of snow layers is adjusted by +either combining or subdividing layers. The combination and subdivision +of snow layers is based on Jordan (1991). + +7.2.7.1 Combination +''''''''''''''''''' + +If a snow layer has nearly melted or if its thickness +:math:`\Delta z_{i}` is less than the prescribed minimum thickness +:math:`\Delta z_{\min }` (Table 7.2), the layer is combined with a +neighboring layer. The overlying or underlying layer is selected as the +neighboring layer according to the following rules + +#. If the top layer is being removed, it is combined with the underlying + layer + +#. If the underlying layer is not snow (i.e., it is the top soil layer), + the layer is combined with the overlying layer + +#. If the layer is nearly completely melted, the layer is combined with + the underlying layer + +#. If none of the above rules apply, the layer is combined with the + thinnest neighboring layer. + +A first pass is made through all snow layers to determine if any layer +is nearly melted (:math:`w_{ice,\, i} \le 0.1`). If so, the remaining +liquid water and ice content of layer :math:`i` is combined with the +underlying neighbor :math:`i+1` as + +.. math:: + :label: 7.51) + + w_{liq,\, i+1} =w_{liq,\, i+1} +w_{liq,\, i} + +.. math:: + :label: 7.52) + + w_{ice,\, i+1} =w_{ice,\, i+1} +w_{ice,\, i} . + +This includes the snow layer directly above the top soil layer. In this +case, the liquid water and ice content of the melted snow layer is added +to the contents of the top soil layer. The layer properties, +:math:`T_{i}` , :math:`w_{ice,\, i}` , :math:`w_{liq,\, i}` , +:math:`\Delta z_{i}` , are then re-indexed so that the layers above the +eliminated layer are shifted down by one and the number of snow layers +is decremented accordingly. + +At this point, if there are no explicit snow layers remaining +(:math:`snl=0`), the snow water equivalent :math:`W_{sno}` and snow +depth :math:`z_{sno}` are set to zero, otherwise, :math:`W_{sno}` and +:math:`z_{sno}` are re-calculated as + +.. math:: + :label: 7.53) + + W_{sno} =\sum _{i=snl+1}^{i=0}\left(w_{ice,\, i} +w_{liq,\, i} \right) + +.. math:: + :label: 7.54) + + z_{sno} =\sum _{i=snl+1}^{i=0}\Delta z_{i} . + +If the snow depth :math:`0`\ 1 | 0.03 | 0.02 | ++--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ +| 2 | 0.015 | 2 | :math:`>`\ 2 | 0.07 | 0.05 | ++--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ +| 3 | 0.025 | 3 | :math:`>`\ 3 | 0.18 | 0.11 | ++--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ +| 4 | 0.055 | 4 | :math:`>`\ 4 | 0.41 | 0.23 | ++--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ +| 5 (bottom) | 0.115 | 5 | - | - | - | ++--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ + +The maximum snow layer thickness, :math:`\Delta z_{\max }` , depends on +the number of layers, :math:`N_{l}` and :math:`N_{u}` (section +7.2.7.2). + +7.2.7.2 Subdivision +''''''''''''''''''' + +The snow layers are subdivided when the layer thickness exceeds the +prescribed maximum thickness :math:`\Delta z_{\max }` with lower and +upper bounds that depend on the number of snow layers (Table 7.2). For +example, if there is only one layer, then the maximum thickness of that +layer is 0.03 m, however, if there is more than one layer, then the +maximum thickness of the top layer is 0.02 m. Layers are checked +sequentially from top to bottom for this limit. If there is only one +snow layer and its thickness is greater than 0.03 m (Table 7.2), the +layer is subdivided into two layers of equal thickness, liquid water and +ice contents, and temperature. If there is an existing layer below the +layer to be subdivided, the thickness :math:`\Delta z_{i}` , liquid +water and ice contents, :math:`w_{liq,\; i}` and :math:`w_{ice,\; i}` , +and temperature :math:`T_{i}` of the excess snow are combined with the +underlying layer according to equations -. If there is no underlying +layer after adjusting the layer for the excess snow, the layer is +subdivided into two layers of equal thickness, liquid water and ice +contents. The vertical snow temperature profile is maintained by +calculating the slope between the layer above the splitting layer +(:math:`T_{1}` ) and the splitting layer (:math:`T_{2}` ) and +constraining the new temperatures (:math:`T_{2}^{n+1}` , +:math:`T_{3}^{n+1}` ) to lie along this slope. The temperature of the +lower layer is first evaluated from + +.. math:: + :label: 7.62) + + T'_{3} =T_{2}^{n} -\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right), + +then adjusted as, + +.. math:: + :label: 7.63) + + \begin{array}{l} {T_{3}^{n+1} =T_{2}^{n} \qquad T'_{3} \ge T_{f} } \\ {T_{2}^{n+1} =T_{2}^{n} +\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right)\qquad T'_{3} f_{c} } \\ {f_{connected} =0\qquad \qquad \qquad for\, f_{h2osfc} \le f_{c} } \end{array} + +where :math:`f_{c}` is a threshold below which no single connected +inundated area spans the grid cell and :math:`\mu` is a scaling +exponent. Default values of :math:`f_{c}` and :math:`\mu` \ are 0.4 and +0.14, respectively. When the inundated fraction of the grid cell +surpasses :math:`f_{c}` , the surface water store acts as a linear +reservoir + +.. math:: + :label: 7.70) + + qout,h2osfc=kh2osfcf_{connected} (Wsfc-Wc)\frac{1}{\Delta t} + +where :math:`qout,h2osfc` is the surface water runoff, :math:`kh2osfc` +is a constant, :math:`Wc` is the amount of surface water present when +:math:`f_{h2osfc} =f_{c}` , and :math:`\Delta t` is the model time step. +The linear storage coefficent :math:`kh2osfc=\sin \left(\beta \right)` +is a function of grid cell mean topographic slope where :math:`\beta` +is the slope in radians. + +Infiltration +^^^^^^^^^^^^^^^^^^ + +The surface moisture flux remaining after surface runoff has been +removed, + +.. math:: + :label: 7.71) + + qin,surface=(1-f_{sat} )q_{liq,\, 0} + +is divided into inputs to surface water (:math:`q_{in,\, h2osfc}` ) and +the soil :math:`q_{in,soil}` . If :math:`q_{in,soil}` exceeds the +maximum soil infiltration capacity (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}`), + +.. math:: + :label: ZEqnNum569150 + + q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat + +where :math:`{\rm \Theta }ice` is an ice impedance factor (section +7.4), infiltration excess (Hortonian) runoff is generated + +.. math:: + :label: 7.73) + + q_{infl,\, excess} =\max \left(q_{in,soil} -\left(1-f_{h2osfc} \right)q_{\inf l,\max } ,0\right) + +and transferred from :math:`q_{in,soil}` to :math:`q_{in,h2osfc}` . +After evaporative losses have been removed, these moisture fluxes are + +.. math:: + :label: 7.74) + + q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} +q_{infl,excess} -q_{evap,h2osfc} + +and + +.. math:: + :label: 7.75) + + qin,soil=(1-f_{h2osfc} )q_{in,surface} -q_{\inf l,excess} -(1-f_{sno} -f_{h2osfc} )qevap,soil. + +The balance of surface water is then calculated as + +.. math:: + :label: 7.76) + + \Delta W_{sfc} =\left(qin,h2osfc-qout,h2osfc-qdrain,h2osfc\right)\Delta t. + +Bottom drainage from the surface water store + +.. math:: + :label: 7.77) + + qdrain,h2osfc=\min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) + +is then added to :math:`q_{in,soil}` giving the total infiltration +into the surface soil layer + +.. math:: + :label: 7.78) + + q_{infl} =q_{in,soil} +q_{drain,h2osfc} + +Infiltration :math:`q_{infl}` and explicit surface runoff +:math:`q_{over}` are not allowed for glaciers. + +Soil Water +-------------- + +Soil water is predicted from a multi-layer model, in which the vertical +soil moisture transport is governed by infiltration, surface and +sub-surface runoff, gradient diffusion, gravity, canopy transpiration +through root extraction, and interactions with groundwater (Figure 7.1). +The following derivation generally follows that of Z.-L. Yang (1998, +unpublished manuscript) with modifications by Zeng and Decker (2009). + +For one-dimensional vertical water flow in soils, the conservation of +mass is stated as + +.. math:: + :label: ZEqnNum790844 + + \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q + +where :math:`\theta` is the volumetric soil water content +(mm:math:`{}^{3}` of water mm\ :math:`{}^{-3}` of soil), :math:`t` is +time (s), :math:`z` is height above some datum in the soil column (mm) +(positive upwards), :math:`q` is soil water flux (kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}` or mm s\ :math:`{}^{-1}`) (positive upwards), and +:math:`Q` is a soil moisture sink term (mm of water mm\ :math:`{}^{-1}` +of soil s\ :math:`{}^{-1}`) (ET loss). This equation is solved +numerically by dividing the soil column into multiple layers in the +vertical and integrating downward over each layer with an upper boundary +condition of the infiltration flux into the top soil layer +:math:`q_{infl}` and a lower boundary condition that depends on the +depth of the water table. + +The soil water flux :math:`q` in equation can be described by Darcy’s +law + +.. math:: + :label: 7.80) + + q=-k\frac{\partial \psi _{h} }{\partial z} + +where :math:`k` is the hydraulic conductivity (mm s\ :math:`{}^{-1}`), +and :math:`\psi _{h}` is the hydraulic potential (mm). The hydraulic +potential is + +.. math:: + :label: 7.81) + + \psi _{h} =\psi _{m} +\psi _{z} + +where :math:`\psi _{m}` is the soil matric potential (mm) (which is +related to the adsorptive and capillary forces within the soil matrix), +and :math:`\psi _{z}` is the gravitational potential (mm) (the vertical +distance from an arbitrary reference elevation to a point in the soil). +If the reference elevation is the soil surface, then +:math:`\psi _{z} =z`. Letting :math:`\psi =\psi _{m}` , Darcy’s law +becomes + +.. math:: + :label: ZEqnNum186573 + + q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. + +Darcy’s equation can be further manipulated to yield + +.. math:: + :label: 7.83) + + q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). + +Substitution of this equation into equation , with :math:`Q=0`, yields +the Richards equation + +.. math:: + :label: ZEqnNum670361 + + \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } \right)+1\right]. + +Zeng and Decker (2009) note that this :math:`\theta` -based form of the +Richards equation cannot maintain the hydrostatic equilibrium soil +moisture distribution because of the truncation errors of the +finite-difference numerical scheme. They show that this deficiency can +be overcome by subtracting the equilibrium state from equation as + +.. math:: + :label: ZEqnNum936839 + + q=-k\left[\frac{\partial \left(\psi +z-C\right)}{\partial z} \right] + +where :math:`C` is a constant hydraulic potential above the water table +:math:`z_{\nabla }` + +.. math:: + :label: ZEqnNum126975 + + C=\psi _{E} +z=\psi _{sat} \left[\frac{\theta _{E} \left(z\right)}{\theta _{sat} } \right]^{-B} +z=\psi _{sat} +z_{\nabla } + +so that + +.. math:: + :label: ZEqnNum537733 + + q=-k\left[\frac{\partial \left(\psi -\psi _{E} \right)}{\partial z} \right] + +where :math:`\psi _{E}` \ is the equilibrium soil matric potential +(mm). Substitution of equations and into equation yields Zeng and +Decker’s (2009) modified Richards equation + +.. math:: + :label: 7.88) + + \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \left(\psi -\psi _{E} \right)}{\partial z} \right)\right]-Q + +where the soil moisture sink term :math:`Q` is now included. + +Hydraulic Properties +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The hydraulic conductivity :math:`k_{i}` (mm s\ :math:`{}^{-1}`) and +the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` +vary with volumetric soil water :math:`\theta _{i}` and soil texture. +As with the soil thermal properties (section 6.3) the hydraulic +properties of the soil are assumed to be a weighted combination of the +mineral properties, which are determined according to sand and clay +contents based on work by Clapp and Hornberger (1978) and Cosby et al. +(1984), and organic properties of the soil (Lawrence and Slater 2008). + +The hydraulic conductivity is defined at the depth of the interface of +two adjacent layers :math:`z_{h,\, i}` (Figure 7.3) and is a function +of the saturated hydraulic conductivity +:math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil +moisture of the two layers :math:`\theta _{i}` and +:math:`\theta _{i+1}` and an ice impedance factor +:math:`\Theta _{ice}` + +.. math:: + :label: ZEqnNum398074 + + k\left[z_{h,\, i} \right]=\left\{\begin{array}{l} {\Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} \qquad 1\le i\le N_{levsoi} -1} \\ {\Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} \qquad i=N_{levsoi} } \end{array}\right\}. + +The ice impedance factor is a function of ice content, and is meant to +quantify the increased tortuosity of the water flow when part of the +pore space is filled with ice. Swenson et al. (2012) used a power law +form :math:`\Theta _{ice} =10^{-\Omega F_{ice} }` where +:math:`\Omega =6`\ and +:math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the +ice-filled fraction of the pore space. + +Because the hydraulic properties of mineral and organic soil may differ +significantly, the bulk hydraulic properties of each soil layer are +computed as weighted averages of the properties of the mineral and +organic components. The water content at saturation (i.e. porosity) is + +.. math:: + :label: 7.90) + + \theta _{sat,i} =(1-f_{om,i} )\theta _{sat,\min ,i} +f_{om,i} \theta _{sat,om} + +where :math:`f_{om,i}` is the soil organic matter fraction, +:math:`\theta _{sat,om} =0.9` (Farouki 1981; Letts et al. 2000) is the +porosity of organic matter and the porosity of the mineral soil +:math:`\theta _{sat,\min ,i}` is + +.. math:: + :label: 7.91) + + \theta _{sai,\min ,i} =0.489-0.00126(\% sand)_{i} . + +The exponent “:math:`B`†is + +.. math:: + :label: 7.92) + + B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} + +where :math:`B_{om} =2.7`\ (Letts et al. 2000) and + +.. math:: + :label: 7.93) + + B_{\min ,i} =2.91+0.159(\% clay)_{i} . + +The soil matric potential (mm) is defined at the node depth +:math:`z_{i}` of each layer :math:`i` (Figure 7.3) + +.. math:: + :label: ZEqnNum316201 + + \psi _{i} =\psi _{sat,\, i} \left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad 0.01\le \frac{\theta _{i} }{\theta _{sat,\, i} } \le 1 + +where the saturated soil matric potential (mm) is + +.. math:: + :label: 7.95) + + \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} + +where :math:`\psi _{sat,om} =-10.3`\ mm (Letts et al. 2000) is the +saturated organic matter matric potential and the saturated mineral soil +matric potential :math:`\psi _{sat,\min ,i}` \ is + +.. math:: + :label: 7.96) + + \psi _{sat,\, \min ,\, i} =-10.0\times 10^{1.88-0.0131(\% sand)_{i} } . + +The saturated hydraulic conductivity, +:math:`k_{sat} \left[z_{h,\, i} \right]` (mm s\ :math:`{}^{-1}`), for +organic soils (:math:`k_{sat,\, om}` ) may be two to three orders of +magnitude larger than that of mineral soils (:math:`k_{sat,\, \min }` ). +Bulk soil layer values of :math:`k_{sat}` \ calculated as weighted +averages based on :math:`f_{om}` may therefore be determined primarily +by the organic soil properties even for values of :math:`f_{om}` as low +as 1 %. To better represent the influence of organic soil material on +the grid cell average saturated hydraulic conductivity, the soil organic +matter fraction is further subdivided into “connected†and “unconnected†+fractions using a result from percolation theory (Stauffer and Aharony +1994, Berkowitz and Balberg 1992). Assuming that the organic and mineral +fractions are randomly distributed throughout a soil layer, percolation +theory predicts that above a threshold value +:math:`f_{om} =f_{threshold}` , connected flow pathways consisting of +organic material only exist and span the soil space. Flow through these +pathways interacts only with organic material, and thus can be described +by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by + +.. math:: + :label: 7.97) + + \begin{array}{l} {f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta _{perc} } f_{om} {\rm \; }\qquad f_{om} \ge f_{threshold} } \\ {f_{perc} =0\qquad f_{om} 0} \\ {\left(r_{e,\, i} \right)_{j} =0\qquad \left(\beta _{t} \right)_{j} =0} \end{array} + +and :math:`\left(r_{i} \right)_{j}` is the fraction of roots in layer +:math:`i` (Chapter 8), :math:`\left(w_{i} \right)_{j}` is a soil +dryness or plant wilting factor for layer :math:`i` (Chapter 8), and +:math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total +soil column for the :math:`j^{th}` PFT (Chapter 8). + +The soil water fluxes in equation , which are a function of +:math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of +their dependence on hydraulic conductivity and soil matric potential, +can be linearized about :math:`\theta` using a Taylor series expansion +as + +.. math:: + :label: 7.108) + + q_{i}^{n+1} =q_{i}^{n} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } \Delta \theta _{liq,\, i+1} + +.. math:: + :label: 7.109) + + q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } \Delta \theta _{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} . + +Substitution of these expressions for :math:`q_{i}^{n+1}` and +:math:`q_{i-1}^{n+1}` into equation results in a general tridiagonal +equation set of the form + +.. math:: + :label: 7.110) + + r_{i} =a_{i} \Delta \theta _{liq,\, i-1} +b_{i} \Delta \theta _{liq,\, i} +c_{i} \Delta \theta _{liq,\, i+1} + +where + +.. math:: + :label: ZEqnNum557934 + + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + +.. math:: + :label: 7.112) + + b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.113) + + c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + +.. math:: + :label: ZEqnNum981892 + + r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . + +The tridiagonal equation set is solved over +:math:`i=1,\ldots ,N_{levsoi} +1` where the layer +:math:`i=N_{levsoi} +1` is a virtual layer representing the aquifer. + +The finite-difference forms of the fluxes and partial derivatives in +equations - can be obtained from equation as + +.. math:: + :label: 7.115) + + q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + +.. math:: + :label: 7.116) + + q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + +.. math:: + :label: 7.117) + + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + +.. math:: + :label: 7.118) + + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + +.. math:: + :label: 7.119) + + \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + +.. math:: + :label: 7.120) + + \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right]. + +The derivatives of the soil matric potential at the node depth are +derived from equation + +.. math:: + :label: 7.121) + + \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, \, i-1} } =-B_{i-1} \frac{\psi _{i-1} }{\theta _{\, \, i-1} } + +.. math:: + :label: 7.122) + + \frac{\partial \psi _{i} }{\partial \theta _{\, liq,\, i} } =-B_{i} \frac{\psi _{i} }{\theta _{i} } + +.. math:: + :label: 7.123) + + \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } =-B_{i+1} \frac{\psi _{i+1} }{\theta _{\, i+1} } + +with the constraint +:math:`0.01\, \theta _{sat,\, i} \le \theta _{\, i} \le \theta _{sat,\, i}` . + +The derivatives of the hydraulic conductivity at the layer interface are +derived from equation + +.. math:: + :label: 7.124) + + \begin{array}{l} {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } =\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } =\left(1-\frac{f_{frz,\, i-1} +f_{frz,\, i} }{2} \right)\left(2B_{i-1} +3\right)k_{sat} \left[z_{h,\, i-1} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right]^{2B_{i-1} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right)} \end{array} + +.. math:: + :label: 7.125) + + \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. + +7.4.2.1 Equilibrium soil matric potential and volumetric moisture +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The equilibrium soil matric potential :math:`\psi _{E}` can be derived +from equation as + +.. math:: + :label: ZEqnNum899028 + + \psi _{E} =\psi _{sat} \left(\frac{\theta _{E} \left(z\right)}{\theta _{sat} } \right)^{-B} + +and the equilibrium volumetric water content +:math:`\theta _{E} \left(z\right)` at depth :math:`z` can also be +derived as + +.. math:: + :label: 7.127) + + \theta _{E} \left(z\right)=\theta _{sat} \left(\frac{\psi _{sat} +z_{\nabla } -z}{\psi _{sat} } \right)^{-\frac{1}{B} } . + +Here, the soil matric potentials, the water table depth +:math:`z_{\nabla }` and the soil depths have units of mm. For the +finite-difference scheme, a layer-average equilibrium volumetric water +content is used in equation and can be obtained from + +.. math:: + :label: 7.128) + + \overline{\theta _{E,\, i} }=\int _{z_{h,\, i-1} }^{z_{h,\, i} }\frac{\theta _{E} \left(z\right)}{z_{h,\, i} -z_{h,\, i-1} } \, dz + +which when integrated yields + +.. math:: + :label: ZEqnNum445442 + + \overline{\theta _{E,\, i} }=\frac{\theta _{sat,\, i} \psi _{sat,\, i} }{\left(z_{h,\, i} -z_{h,\, i-1} \right)\left(1-\frac{1}{B_{i} } \right)} \left[\left(\frac{\psi _{sat,\, i} -z_{\nabla } +z_{h,\, i} }{\psi _{sat,\, i} } \right)^{1-\frac{1}{B_{i} } } -\left(\frac{\psi _{sat,\, i} -z_{\nabla } +z_{h,\, i-1} }{\psi _{sat,\, i} } \right)^{1-\frac{1}{B_{i} } } \right]. + +Equation is valid when the water table :math:`z_{\nabla }` is deeper +than both interface depths :math:`z_{h,\, i-1}` and +:math:`z_{h,\, i}` . Since the water table can be within the soil +column, the equation is modified if the water table is within soil layer +:math:`i` (:math:`z_{h,\, i-1} z_{h,\, N_{levsoi} }` ), an equilibrium volumetric +soil moisture is calculated for a virtual layer :math:`i=N_{levsoi} +1` +as + +.. math:: + :label: ZEqnNum235293 + + \overline{\theta _{E,\, i=N_{levsoi+1} } }=\frac{\theta _{sat,i-1} \psi _{sat,\, i-1} }{\left(z_{\nabla } -z_{h,\, i-1} \right)\left(1-\frac{1}{B_{i-1} } \right)} \left[1-\left(\frac{\psi _{sat,\, i-1} -z_{\nabla } +z_{h,\, i-1} }{\psi _{sat,\, i-1} } \right)^{1-\frac{1}{B_{i-1} } } \right] + +The equilibrium volumetric soil moisture is constrained by + +.. math:: + :label: 7.133) + + 0\le \overline{\theta _{E,\, i} }\le \theta _{sat,\, i} + +The equilibrium soil matric potential is then + +.. math:: + :label: ZEqnNum533842 + + \psi _{E,\, i} =\psi _{sat,\, i} \left(\frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad \frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \ge 0.01 + +7.4.2.2 Equation set for layer :math:`i=1` +'''''''''''''''''''''''''''''''''''''''''' + +For the top soil layer (:math:`i=1`), the boundary condition is the +infiltration rate (section 7.3), +:math:`q_{i-1}^{n+1} =-q_{infl}^{n+1}` , and the water balance equation +is + +.. math:: + :label: 7.135) + + \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =q_{infl}^{n+1} +q_{i}^{n+1} -e_{i} . + +After grouping like terms, the coefficients of the tridiagonal set of +equations for :math:`i=1` are + +.. math:: + :label: 7.136) + + a_{i} =0 + +.. math:: + :label: 7.137) + + b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.138) + + c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + +.. math:: + :label: 7.139) + + r_{i} =q_{infl}^{n+1} -q_{i}^{n} +e_{i} . + +7.4.2.3 Equation set for layers :math:`i=2,\ldots ,N_{levsoi} -1` +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +The coefficients of the tridiagonal set of equations for +:math:`i=2,\ldots ,N_{levsoi} -1` are + +.. math:: + :label: 7.140) + + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + +.. math:: + :label: 7.141) + + b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.142) + + c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + +.. math:: + :label: 7.143) + + r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . + +7.4.2.4 Equation set for layers :math:`i=N_{levsoi} ,\ldots N_{levsoi} +1` +'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +For the lowest soil layer (:math:`i=N_{levsoi}` ), the bottom boundary +condition depends on the depth of the water table. If the water table is +within the soil column (:math:`z_{\nabla } \le z_{h,\, N_{levsoi} }` ), +a zero-flux bottom boundary condition is applied (:math:`q_{i}^{n} =0`) +and the coefficients of the tridiagonal set of equations for +:math:`i=N_{levsoi}` are + +.. math:: + :label: 7.144) + + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + +.. math:: + :label: 7.145) + + b_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.146) + + c_{i} =0 + +.. math:: + :label: 7.147) + + r_{i} =q_{i-1}^{n} +e_{i} . + +The coefficients for the aquifer layer :math:`i=N_{levsoi} +1` are then + +.. math:: + :label: 7.148) + + a_{i} =0 + +.. math:: + :label: 7.149) + + b_{i} =-\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.150) + + c_{i} =0 + +.. math:: + :label: 7.151) + + r_{i} =0. + +If the water table is below the soil column +(:math:`z_{\nabla } >z_{h,\, N_{levsoi} }` ), the coefficients for +:math:`i=N_{levsoi}` are + +.. math:: + :label: 7.152) + + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + +.. math:: + :label: 7.153) + + b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.154) + + c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + +.. math:: + :label: 7.155) + + r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . + +The :math:`i=N_{levsoi} +1` terms are evaluated using + +.. math:: + :label: 7.156) + + \psi _{N_{levsoi} +1} =\psi _{sat,\, N_{levsoi} } \left[s_{N_{levsoi} +1} \right]^{-B_{N_{levsoi} } } \ge -1\times 10^{8} + +.. math:: + :label: 7.157) + + z_{N_{levsoi} +1} =0.5\left(z_{\nabla } +z_{N_{levsoi} } \right) + +where + +.. math:: + :label: 7.158) + + s_{N_{levsoi} +1} =0.5\left(\frac{\theta _{sat,\, N_{levsoi} } +\theta _{N_{levsoi} } }{\theta _{sat,\, N_{levsoi} } } \right)\qquad 0.01\le s_{N_{levsoi} +1} \le 1, + + :math:`\psi _{E,\, N_{levsoi} +1}` is evaluated from equations and , +and + +.. math:: + :label: 7.159) + + \frac{\partial \psi _{N_{levsoi} +1} }{\partial \theta _{liq,\, N_{levsoi} +1} } =-B_{N_{levsoi} } \frac{\psi _{N_{levsoi} +1} }{s_{\, N_{levsoi} } \theta _{sat,\, N_{levsoi} } } . + +The coefficients for the aquifer layer :math:`i=N_{levsoi} +1` are then + +.. math:: + :label: 7.160) + + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + +.. math:: + :label: 7.161) + + b_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + +.. math:: + :label: 7.162) + + c_{i} =0 + +.. math:: + :label: 7.163) + + r_{i} =q_{i-1}^{n} . + +Upon solution of the tridiagonal equation set (Press et al. 1992), the +liquid water contents are updated as follows + +.. math:: + :label: 7.164) + + w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\Delta \theta _{liq,\, i} \Delta z_{i} \qquad i=1,\ldots ,N_{levsoi} . + +The volumetric water content is + +.. math:: + :label: 7.165) + + \theta _{i} =\frac{w_{liq,\, i} }{\Delta z_{i} \rho _{liq} } +\frac{w_{ice,\, i} }{\Delta z_{i} \rho _{ice} } . + +Frozen Soils and Perched Water Table +---------------------------------------- + +When soils freeze, the power-law form of the ice impedance factor +(section 7.4.1) can greatly decrease the hydraulic conductivity of the +soil, leading to nearly impermeable soil layers. When unfrozen soil +layers are present above relatively ice-rich frozen layers, the +possibility exists for perched saturated zones. Lateral drainage from +perched saturated regions is parameterized as a function of the +thickness of the saturated zone + +.. math:: + :label: 7.166) + + q_{drai,perch} =k_{drai,\, perch} \left(z_{frost} -z_{\nabla ,perch} \right) + +where :math:`k_{drai,\, perch}` depends on topographic slope and soil +hydraulic conductivity, + +.. math:: + :label: 7.167) + + k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta _{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) + +where :math:`\Theta _{ice}` is an ice impedance factor determined from +the ice content of the soil layers interacting with the water table +(section 7.6), :math:`\beta` is the mean grid cell topographic slope in +radians, :math:`z_{frost}` \ is the depth to the frost table, and +:math:`z_{\nabla ,perch}` is the depth to the perched saturated zone. +The frost table :math:`z_{frost}` is defined as the shallowest frozen +layer having an unfrozen layer above it, while the perched water table +:math:`z_{\nabla ,perch}` is defined as the depth at which the +volumetric water content drops below a specified threshold. The default +threshold is set to 0.9. Drainage from the perched saturated zone +:math:`q_{drai,perch}` is removed from layers :math:`N_{perch}` +through :math:`N_{frost}` , which are the layers containing +:math:`z_{\nabla ,perch}` and, :math:`z_{frost}` \ respectively. + +Groundwater-Soil Water Interactions +--------------------------------------- + +Drainage or sub-surface runoff is based on the SIMTOP scheme (Niu et al. +2005) with a modification to account for reduced drainage in frozen +soils. In the work of Niu et al. (2005), the drainage :math:`q_{drai}` +(kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) was formulated as + +.. math:: + :label: ZEqnNum924767 + + q_{drai} =q_{drai,\, \max } \exp \left(-f_{drai} z_{\nabla } \right). + +Here, the water table depth :math:`z_{\nabla }` has units of meters. To +restrict drainage in frozen soils, Niu et al. (2005) added the following +condition + +.. math:: + :label: 7.169) + + q_{drai} =0\qquad {\rm for\; \; }w_{ice,\, N_{levsoi} } >w_{liq,\, N_{levsoi} } . + +In preliminary testing it was found that a more gradual restriction of +drainage was required so that the water table depth remained dynamic +under partially frozen conditions. The following modification is made to +equation + +.. math:: + :label: ZEqnNum150955 + + q_{drai} =\Theta _{ice} q_{drai,\, \max } \exp \left(-f_{drai} z_{\nabla } \right) + +where :math:`\Theta _{ice}` is an ice impedance factor determined from +the ice content of the soil layers interacting with the water table + +.. math:: + :label: 7.171) + + \Theta _{ice} =10^{-\Omega \left(\frac{\sum _{i=jwt}^{i=N_{levsoi} }F_{ice,i} \Delta z_{i} }{\sum _{i=jwt}^{i=N_{levsoi} }\Delta z_{i} } \right)} + +where :math:`\Omega =6`\ is an adjustable parameter, :math:`jwt` is the +index of the layer directly above the water table, +:math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the +ice-filled fraction of the pore space of soil layer :math:`i` (kg +m\ :math:`{}^{-2}`), and :math:`\Delta z_{i}` is the layer thickness +(mm). This expression is functionally the same as that used to determine +the ice impedance factor in section 7.4. In equation , the decay factor +:math:`f_{drai} =2.5` m\ :math:`{}^{-1}` and the maximum drainage when +the water table depth is at the surface +:math:`q_{drai,\, \max } =10\sin (\beta )` kg m\ :math:`{}^{-2}` +s\ :math:`{}^{-1}` , where :math:`\beta` is the mean grid cell +topographic slope in radians, were determined for global simulations +through sensitivity analysis and comparison with observed runoff. + +Determination of water table depth :math:`z_{\nabla }` is based on work +by Niu et al. (2007). In this approach, a groundwater component is added +in the form of an unconfined aquifer lying below the soil column (Figure +7.1). The groundwater solution is dependent on whether the water table +is within or below the soil column. The water stored in the unconfined +aquifer :math:`W_{a}` has a prescribed maximum value (5000 mm). When +the water table is within the soil column, :math:`W_{a}` is constant +because there is no water exchange between the soil column and the +underlying aquifer. In this case, recharge to the water table is +diagnosed by applying Darcy’s law across the water table + +.. math:: + :label: 7.172) + + q_{rech\arg e} =-k_{aq} \frac{\left(\Psi _{\nabla } -\Psi _{jwt} \right)}{\left(z_{\nabla } -z_{jwt} \right)} + +where :math:`\Psi _{\nabla } =0` is the matric potential at the water +table and\ :math:`k_{aq} =\Theta _{ice,jwt+1} k\left[z_{jwt+1} \right]` +is the hydraulic conductivity of the layer containing the water table. +Change in the water table is then calculated as the difference between +recharge and drainage, scaled by the specific yield of the layer +containing the water table + +.. math:: + :label: ZEqnNum287831 + + \Delta z_{\nabla } =\frac{\left(q_{rech\arg e} -q_{drai} \right)}{S_{y} } \Delta t. + +The specific yield, :math:`S_{y}` , which depends on the soil +properties and the water table location, is derived by taking the +difference between two equilibrium soil moisture profiles whose water +tables differ by an infinitesimal amount + +.. math:: + :label: 7.174) + + S_{y} =\theta _{sat} \left(1-\left(1+\frac{z_{\nabla } }{\Psi _{sat} } \right)^{\frac{-1}{B} } \right) + +where B is the Clapp-Hornberger exponent. Because :math:`S_{y}` is a +function of the soil properties, it results in water table dynamics that +are consistent with the soil water fluxes described in section 7.4. + +For the case when the water table is below the soil column, the change +in water stored in the unconfined aquifer :math:`W_{a}` (mm) is updated +as + +.. math:: + :label: 7.174) + + \Delta W_{a}^{} =\left(q_{recharge} -q_{drai} \right)\Delta t + +and the water table is updated using equation with the specific yield of +layer :math:`N_{levsoi}` . + +The recharge rate is defined as positive when water enters the aquifer + +.. math:: + :label: 7.174) + + q_{recharge} =\frac{\Delta \theta _{liq,\, N_{levsoi} +1} \Delta z_{N_{levsoi} +1} }{\Delta t} + +where +:math:`\Delta \theta _{liq,\, N_{levsoi} +1} =\theta _{liq,\, N_{levsoi} +1}^{n+1} -\theta _{liq,\, N_{levsoi} +1}^{n}` +is the change in liquid water content for layer :math:`i=N_{levsoi} +1` +calculated from the solution of the soil water equations (section 7.4), +and :math:`\Delta z_{N_{levsoi} +1}` (mm) is + +.. math:: + :label: 7.174) + + \Delta z_{N_{levsoi} +1} =z_{\nabla }^{n} -z_{h,\, N_{levsoi} } . + +After the above calculations, two numerical adjustments are implemented +to keep the liquid water content of each soil layer +(:math:`w_{liq,\, i}` ) within physical constraints of +:math:`w_{liq}^{\min } \le w_{liq,\, i} \le \left(\theta _{sat,\, i} -\theta _{ice,\, i} \right)\Delta z_{i}` +where :math:`w_{liq}^{\min } =0.01` (mm). First, beginning with the +bottom soil layer :math:`i=N_{levsoi}` , any excess liquid water in each +soil layer +(:math:`w_{liq,\, i}^{excess} =w_{liq,\, i} -\left(\theta _{sat,\, i} -\theta _{ice,\, i} \right)\Delta z_{i} \ge 0`) +is successively added to the layer above. Any excess liquid water that +remains after saturating the entire soil column (plus a maximum surface +ponding depth :math:`w_{liq}^{pond} =10` kg m\ :math:`{}^{-2}`), is +added to drainage :math:`q_{drai}` . Second, to prevent negative +:math:`w_{liq,\, i}` , each layer is successively brought up to +:math:`w_{liq,\, i} =w_{liq}^{\min }` by taking the required amount of +water from the layer below. If this results in +:math:`w_{liq,\, N_{levsoi} } T_{f} -2{\rm \; and\; }\theta _{liq,\, i} >0} \\ {0\qquad \qquad \qquad \qquad {\rm for\; }T_{i} \le T_{f} -2{\rm \; or\; }\theta _{liq,\, i} \le 0} \end{array}\right\} + +where :math:`\psi _{i}` is the soil water matric potential (mm) and +:math:`\psi _{c}` and :math:`\psi _{o}` are the soil water potential +(mm) when stomata are fully closed or fully open (respectively) (Table +8.1). The term in brackets scales :math:`w_{i}` by the ratio of the +effective porosity (accounting for the ice fraction; +:math:`\theta _{sat} -\theta _{ice}` ) relative to the total porosity. + +Here, the soil water matric potential :math:`\psi _{i}` \ is defined as + +.. math:: + :label: 8.28) + + \psi _{i} =\psi _{sat,i} \, s_{i}^{-B_{i} } \ge \psi _{c} + +where :math:`s_{i}` is the soil wetness for layer :math:`i` with +respect to the effective porosity and :math:`\psi _{sat,i}` and +:math:`B_{i}` are the saturated soil matric potential (mm) and the +Clapp and Hornberger (1978) parameter (section 7.4.1). The soil wetness +:math:`s_{i}` is + +.. math:: + :label: 8.29) + + s_{i} =\frac{\theta _{liq,\, i} }{\theta _{sat,\, i} -\theta _{ice,\, i} } \ge 0.01 + +where +:math:`\theta _{ice,\, i} ={w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(\rho _{ice} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} \Delta z_{i} \right)} \le \theta _{sat,\, i}` \ and +:math:`\theta _{liq,\, i} ={w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(\rho _{liq} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{liq} \Delta z_{i} \right)} \le \theta _{sat,\, i} -\theta _{ice,\, i}` . +:math:`w_{ice,\, i}` and :math:`w_{liq,\, i}` are the ice and liquid +water contents (kg m\ :math:`{}^{-2}`) (Chapter 7), +:math:`\theta _{sat,\, i}` is the saturated volumetric water content +(section 7.4.1), :math:`\rho _{ice}` and :math:`\rho _{liq}` are the +densities of ice and liquid water (kg m\ :math:`{}^{-3}`) (Table 2.6), +and :math:`\Delta z_{i}` is the soil layer thickness (m) (section 6.1). + +The root fraction :math:`r_{i}` in each soil layer depends on the plant +functional type + +.. math:: + :label: 8.30) + + r_{i} =\left\{\begin{array}{l} {0.5\left[\begin{array}{l} {\exp \left(-r_{a} z_{h,\, i-1} \right)+\exp \left(-r_{b} z_{h,\, i-1} \right)-} \\ {\exp \left(-r_{a} z_{h,\, i} \right)-\exp \left(-r_{b} z_{h,\, i} \right)} \end{array}\right]\qquad {\rm for\; }1\le iT_{f} } \end{array}\right\}. + +The sensible heat flux (W m\ :math:`{}^{-2}`) is + +.. math:: + :label: ZEqnNum720553 + + H_{g} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{g} \right)}{r_{ah} } + +where :math:`\rho _{atm}` is the density of moist air (kg +m\ :math:`{}^{-3}`) (Chapter 5), :math:`C_{p}` is the specific heat +capacity of air (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +:math:`\theta _{atm}` is the atmospheric potential temperature (K) +(Chapter 5), :math:`T_{g}` is the lake surface temperature (K) (at an +infinitesimal interface just above the top resolved model layer: snow, +ice, or water), and :math:`r_{ah}` is the aerodynamic resistance to +sensible heat transfer (s m\ :math:`{}^{-1}`) (section 5.1). + +The water vapor flux (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is + +.. math:: + :label: 9.10) + + E_{g} =-\frac{\rho _{atm} \left(q_{atm} -q_{sat}^{T_{g} } \right)}{r_{aw} } + +where :math:`q_{atm}` is the atmospheric specific humidity (kg +kg\ :math:`{}^{-1}`) (section 2.2.1), :math:`q_{sat}^{T_{g} }` \ is the +saturated specific humidity (kg kg\ :math:`{}^{-1}`) (section 5.5) at +the lake surface temperature :math:`T_{g}` , and :math:`r_{aw}` is the +aerodynamic resistance to water vapor transfer (s m\ :math:`{}^{-1}`) +(section 5.1). + +The zonal and meridional momentum fluxes are + +.. math:: + :label: 9.11) + + \tau _{x} =-\rho _{atm} \frac{u_{atm} }{r_{atm} } + +.. math:: + :label: 9.12) + + \tau _{y} =-\rho _{atm} \frac{v_{atm} }{r_{atm} } + +where :math:`u_{atm}` and :math:`v_{atm}` are the zonal and +meridional atmospheric winds (m s\ :math:`{}^{-1}`) (section 2.2.1), and +:math:`r_{am}` is the aerodynamic resistance for momentum (s +m\ :math:`{}^{-1}`) (section 5.1). + +The heat flux into the lake surface :math:`G` (W m\ :math:`{}^{-2}`) is + +.. math:: + :label: ZEqnNum122376 + + G=\frac{2\lambda _{T} }{\Delta z_{T} } \left(T_{g} -T_{T} \right) + +where :math:`\lambda _{T}` is the thermal conductivity (W +m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), :math:`\Delta z_{T}` is the +thickness (m), and :math:`T_{T}` is the temperature (K) of the top +resolved lake layer (snow, ice, or water). The top thermal conductivity +:math:`\lambda _{T}` of unfrozen lakes ( :math:`T_{g} >T_{f}` ) +includes conductivities due to molecular ( :math:`\lambda _{liq}` ) and +eddy (:math:`\lambda _{K}` ) diffusivities (section 9.5.4), as evaluated +in the top lake layer at the previous timestep, where +:math:`\lambda _{liq}` is the thermal conductivity of water (Table +2.6). For frozen lakes without resolved snow layers, +:math:`\lambda _{T} =\lambda _{ice}` . When resolved snow layers are +present, :math:`\lambda _{T}` \ is calculated based on the water +content, ice content, and thickness of the top snow layer, as for +non-vegetated surfaces. + +The absorbed solar radiation :math:`\vec{S}_{g}` is + +.. math:: + :label: 9.14) + + \vec{S}_{g} =\sum _{\Lambda }S_{atm} \, \downarrow _{\Lambda }^{\mu } \left(1-\alpha _{g,\, \Lambda }^{\mu } \right) +S_{atm} \, \downarrow _{\Lambda } \left(1-\alpha _{g,\, \Lambda } \right) + +where :math:`S_{atm} \, \downarrow _{\Lambda }^{\mu }` and +:math:`S_{atm} \, \downarrow _{\Lambda }` are the incident direct beam +and diffuse solar fluxes (W m\ :math:`{}^{-2}`) and :math:`\Lambda` +denotes the visible (:math:`<` 0.7\ :math:`\mu {\rm m}`) and +near-infrared (:math:`\ge` 0.7\ :math:`\mu {\rm m}`) wavebands (section +2.2.1), and :math:`\alpha _{g,\, \Lambda }^{\mu }` and +:math:`\alpha _{g,\, \mu }` are the direct beam and diffuse lake +albedos (section 9.3). + +The net emitted longwave radiation is + +.. math:: + :label: 9.15) + + \vec{L}_{g} =L_{g} \, \uparrow -L_{atm} \, \downarrow + +where :math:`L_{g} \, \uparrow` is the upward longwave radiation from +the surface, :math:`L_{atm} \, \downarrow` is the downward atmospheric +longwave radiation (section 2.2.1). The upward longwave radiation from +the surface is + +.. math:: + :label: 9.16) + + L\, \uparrow =\left(1-\varepsilon _{g} \right)L_{atm} \, \downarrow +\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right) + +where :math:`\varepsilon _{g} =0.97` is the lake surface emissivity, +:math:`\sigma` is the Stefan-Boltzmann constant (W m\ :math:`{}^{-2}` +K\ :math:`{}^{-4}`) (Table 2.6), and :math:`T_{g}^{n+1} -T_{g}^{n}` is +the difference in lake surface temperature between Newton-Raphson +iterations (see below). + +The sensible heat :math:`H_{g}` , the water vapor flux :math:`E_{g}` +through its dependence on the saturated specific humidity, the net +longwave radiation :math:`\vec{L}_{g}` , and the ground heat flux +:math:`G`, all depend on the lake surface temperature :math:`T_{g}` . +Newton-Raphson iteration is applied to solve for :math:`T_{g}` and the +surface fluxes as + +.. math:: + :label: ZEqnNum858039 + + \Delta T_{g} =\frac{\beta \overrightarrow{S}_{g} -\overrightarrow{L}_{g} -H_{g} -\lambda E_{g} -G}{\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } } + +where :math:`\Delta T_{g} =T_{g}^{n+1} -T_{g}^{n}` and the subscript +“n†indicates the iteration. Therefore, the surface temperature +:math:`T_{g}^{n+1}` can be written as + +.. math:: + :label: ZEqnNum878786 + + T_{g}^{n+1} =\frac{\beta \overrightarrow{S}_{g} -\overrightarrow{L}_{g} -H_{g} -\lambda E_{g} -G+T_{g}^{n} \left(\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } \right)}{\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } } + +where the partial derivatives are + +.. math:: + :label: 9.19) + + \frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } =4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} , + +.. math:: + :label: 9.20) + + \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r_{ah} } , + +.. math:: + :label: 9.21) + + \frac{\partial \lambda E_{g} }{\partial T_{g} } =\frac{\lambda \rho _{atm} }{r_{aw} } \frac{dq_{sat}^{T_{g} } }{dT_{g} } , + +.. math:: + :label: 9.22) + + \frac{\partial G}{\partial T_{g} } =\frac{2\lambda _{T} }{\Delta z_{T} } . + +The fluxes of momentum, sensible heat, and water vapor are solved for +simultaneously with lake surface temperature as follows. The +stability-related equations are the same as for non-vegetated surfaces +(section 5.2), except that the surface roughnesses are here (weakly +varying) functions of the friction velocity :math:`u_{\*}` . To begin, +*z* :math:`{}_{0}`\ :math:`{}_{m}` is set based on the value +calculated for the last timestep (for :math:`T_{g} >T_{f}` ) or based on +the values in section 9.4.2 (otherwise), and the scalar roughness +lengths are set based on the relationships in section 9.4.2. + +#. An initial guess for the wind speed :math:`V_{a}` including the + convective velocity :math:`U_{c}` is obtained from eq. assuming an + initial convective velocity :math:`U_{c} =0` m s\ :math:`{}^{-1}` for + stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` + as evaluated from eq. ) and :math:`U_{c} =0.5` for unstable + conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). + +#. An initial guess for the Monin-Obukhov length :math:`L` is obtained + from the bulk Richardson number using equations and . + +#. The following system of equations is iterated four times: + +#. Heat of vaporization / sublimation :math:`\lambda` \ (eq. ) + +#. Thermal conductivity :math:`\lambda _{T}` \ (above) + +#. Friction velocity :math:`u_{\*}` (eqs. , , , ) + +#. Potential temperature scale :math:`\theta _{\*}` (eqs. , , , ) + +#. Humidity scale :math:`q_{\*}` (eqs. , , , ) + +#. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and + :math:`r_{aw}` (eqs. , , ) + +#. Lake surface temperature :math:`T_{g}^{n+1}` (eq.) + +#. Heat of vaporization / sublimation :math:`\lambda` (eq. ) + +#. Sensible heat flux :math:`H_{g}` is updated for :math:`T_{g}^{n+1}` + (eq.) + +#. Water vapor flux :math:`E_{g}` is updated for :math:`T_{g}^{n+1}` + as + + .. math:: + :label: ZEqnNum331835 + + E_{g} =-\frac{\rho _{atm} }{r_{aw} } \left[q_{atm} -q_{sat}^{T_{g} } -\frac{\partial q_{sat}^{T_{g} } }{\partial T_{g} } \left(T_{g}^{n+1} -T_{g}^{n} \right)\right] + +where the last term on the right side of equation is the change in +saturated specific humidity due to the change in :math:`T_{g}` between +iterations. + +#. Saturated specific humidity :math:`q_{sat}^{T_{g} }` and its + derivative :math:`\frac{dq_{sat}^{T_{g} } }{dT_{g} }` are updated + for :math:`T_{g}^{n+1}` (section 5.1). + +#. Virtual potential temperature scale :math:`\theta _{v\*}` (eq. ) + +#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) + +#. Monin-Obukhov length :math:`L` (eq. ). + +#. Roughness lengths (eq. , ). + +Once the four iterations for lake surface temperature have been yielded +a tentative solution :math:`T_{g} ^{{'} }` , several restrictions +are imposed in order to maintain consistency with the top lake model +layer temperature :math:`T_{T}` \ (Subin et al. 2012a). + +.. math:: + :label: ZEqnNum180534 + + \begin{array}{l} {{\rm 1)\; }T_{T} \le T_{f} T_{g} ^{{'} } >T_{m} \Rightarrow T_{g} =T_{T} ,} \\ {{\rm 3)\; }T_{m} >T_{g} ^{{'} } >T_{T} >T_{f} \Rightarrow T_{g} =T_{T} } \end{array} + +where :math:`T_{m}` \ is the temperature of maximum liquid water +density, 3.85\ :math:`{}^\circ`\ C (Hostetler and Bartlein 1990). The +first condition requires that, if there is any snow or ice present, the +surface temperature is restricted to be less than or equal to freezing. +The second and third conditions maintain convective stability in the top +lake layer. + +If eq. XXX is applied, the turbulent fluxes :math:`H_{g}` and +:math:`E_{g}` are re-evaluated. The emitted longwave radiation and +the momentum fluxes are re-evaluated in any case. The final ground heat +flux :math:`G` is calculated from the residual of the energy balance eq. +XXX in order to precisely conserve energy. XXX This ground heat flux +is taken as a prescribed flux boundary condition for the lake +temperature solution (section 9.5.3). An energy balance check is +included at each timestep to insure that eq. XXX is obeyed to within +0.1 W m\ :math:`{}^{-2}`. + +Lake Temperature +-------------------- + +Introduction +^^^^^^^^^^^^^^^^^^ + +The (optional-) snow, lake body (water and/or ice), soil, and bedrock +system is unified for the lake temperature solution. The governing +equation, similar to that for the snow-soil-bedrock system for vegetated +land units (Chapter 6), is + +.. math:: + :label: ZEqnNum239244 + + \tilde{c}_{v} \frac{\partial T}{\partial t} =\frac{\partial }{\partial z} \left(\tau \frac{\partial T}{\partial z} \right)-\frac{d\phi }{dz} + +where :math:`\tilde{c}_{v}` is the volumetric heat capacity (J +m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`), :math:`t` is time (s), *T* is +the temperature (K), :math:`\tau` is the thermal conductivity (W +m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), and :math:`\phi` is the solar +radiation (W m\ :math:`{}^{-2}`) penetrating to depth *z* (m). The +system is discretized into *N* layers, where + +.. math:: + :label: 9.26) + + N=n_{sno} +N_{levlak} +N_{levgrnd} , + + :math:`n_{sno}` is the number of actively modeled snow layers at the +current timestep (section 7.2), and :math:`N_{levgrnd}` \ is as for +vegetated land units (Chapter 6). Energy is conserved as + +.. math:: + :label: ZEqnNum317718 + + \frac{d}{dt} \sum _{j=1}^{N}\left[\tilde{c}_{v,j} (t)\left(T_{j} -T_{f} \right)+L_{j} (t)\right] \Delta z_{j} =G+\left(1-\beta \right)\vec{S}_{g} + +where :math:`\tilde{c}_{v,j} (t)`\ is the volumetric heat capacity of +the *j*\ th layer (section 9.5.5), :math:`L_{j} (t)`\ is the latent heat +of fusion per unit volume of the *j*\ th layer (proportional to the mass +of liquid water present), and the right-hand side represents the net +influx of energy to the lake system. Note that +:math:`\tilde{c}_{v,j} (t)` can only change due to phase change (except +for changing snow layer mass, which, apart from energy required to melt +snow, represents an untracked energy flux in the land model, along with +advected energy associated with water flows in general), and this is +restricted to occur at :math:`T_{j} =T_{f}` \ in the snow-lake-soil +system, allowing eq. to be precisely enforced and justifying the +exclusion of :math:`c_{v,j}` from the time derivative in eq. . + +Overview of Changes from CLM4 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Thermal conductivities include additional eddy diffusivity, beyond the +Hostetler and Bartlein (1990) formulation, due to unresolved processes +(Fang and Stefan 1996; Subin et al. 2012a). Lake water is now allowed to +freeze by an arbitrary fraction for each layer, which releases latent +heat and changes thermal properties. Convective mixing occurs for all +lakes, even if frozen. Soil and bedrock are included beneath the lake. +The full snow model is used if the snow thickness exceeds a threshold; +if there are resolved snow layers, radiation transfer is predicted by +the snow-optics submodel (Chapter 3), and the remaining radiation +penetrating the bottom snow layer is absorbed in the top layer of lake +ice; conversely, if there are no snow layers, the solar radiation +penetrating the bottom lake layer is absorbed in the top soil layer. The +lakes have variable depth, and all physics is assumed valid for +arbitrary depth, except for a depth-dependent enhanced mixing (section +9.5.4). Finally, a previous sign error in the calculation of eddy +diffusivity (specifically, the Brunt-Väisälä frequency term; eq. ) was +corrected. + +Boundary Conditions +^^^^^^^^^^^^^^^^^^^^^^^^^ + +The top boundary condition, imposed at the top modeled layer +:math:`i=j_{top}` , where :math:`j_{top} =-n_{sno} +1`, is the +downwards surface flux *G* defined by the energy flux residual during +the surface temperature solution (section 9.4.3). The bottom boundary +condition, imposed at :math:`i=N_{levlak} +N_{levgrnd}` , is zero flux. +The 2-m windspeed :math:`u_{2}` \ (m s\ :math:`{}^{-1}`) is used in the +calculation of eddy diffusivity: + +.. math:: + :label: ZEqnNum997977 + + u_{2} =\frac{u_{*} }{k} \ln \left(\frac{2}{z_{0m} } \right)\ge 0.1. + +where :math:`u_{*}` \ is the friction velocity calculated in section +9.4.3 and *k* is the von Karman constant (Table 2.6). + +Eddy Diffusivity and Thermal Conductivities +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The total eddy diffusivity :math:`K_{W}` (:math:`\text{m}^{2}\,\text{s}^{-1}`) for liquid water in the lake body is given by (Subin et al. 2012a) + +.. math:: + :label: 9.29) + + K_{W} = m_{d} \left(\kappa _{e} +K_{ed} +\kappa _{m} \right) + +where :math:`\kappa _{e}` is due to wind-driven eddies (Hostetler and +Bartlein 1990), :math:`K_{ed}` is a modest enhanced diffusivity +intended to represent unresolved mixing processes (Fang and Stefan +1996), +:math:`\kappa _{m} =\frac{\lambda _{liq} }{c_{liq} \rho _{liq} }` \ is +the molecular diffusivity of water (given by the ratio of its thermal +conductivity (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) to the product of +its heat capacity (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) and density +(kg m\ :math:`{}^{-3}`), values given in Table 2.6), and :math:`m_{d}` +(unitless) is a factor which increases the overall diffusivity for large +lakes, intended to represent 3-dimensional mixing processes such as +caused by horizontal temperature gradients. As currently implemented, + +.. math:: + :label: 9.30) + + m_{d} =\left\{\begin{array}{l} {1,\qquad d<25{\rm m}} \\ {10,\qquad d\ge 25{\rm m}} \end{array}\right\} + +where *d* is the lake depth. + +The wind-driven eddy diffusion coefficient :math:`\kappa _{e,\, i}` +( :math:`\text{m}^{2}\,\text{s}^{-1}` ) for layers :math:`1\le i\le N_{levlak}` is + +.. math:: + :label: 9.31) + + \kappa _{e,\, i} =\left\{\begin{array}{l} {\frac{kw^{*} z_{i} }{P_{0} \left(1+37Ri^{2} \right)} \exp \left(-k^{*} z_{i} \right)\qquad T_{g} >T_{f} } \\ {0\qquad T_{g} \le T_{f} } \end{array}\right\} + +where :math:`P_{0} =1` is the neutral value of the turbulent Prandtl +number, :math:`z_{i}` is the node depth (m), the surface friction +velocity (m s\ :math:`{}^{-1}`) is :math:`w^{*} =0.0012u_{2}` , and +:math:`k^{*}` varies with latitude :math:`\phi` as +:math:`k^{*} =6.6u_{2}^{-1.84} \sqrt{\left|\sin \phi \right|}` . For the +bottom layer, +:math:`\kappa _{e,\, N_{levlak} } =\kappa _{e,N_{levlak} -1\, }` . As in +Hostetler and Bartlein (1990), the 2-m wind speed :math:`u_{2}` (m +s\ :math:`{}^{-1}`) (eq. ) is used to evaluate :math:`w^{*}` and +:math:`k^{*}` rather than the 10-m wind used by Henderson-Sellers +(1985). + +The CityplaceRichardson number is + +.. math:: + :label: 9.32) + + R_{i} =\frac{-1+\sqrt{1+\frac{40N^{2} k^{2} z_{i}^{2} }{w^{*^{2} } \exp \left(-2k^{*} z_{i} \right)} } }{20} + +where + +.. math:: + :label: ZEqnNum230908 + + N^{2} =\frac{g}{\rho _{i} } \frac{\partial \rho }{\partial z} + +and :math:`g` is the acceleration due to gravity (m s\ :math:`{}^{-2}`) +(Table 2.6), :math:`\rho _{i}` is the density of water (kg +m\ :math:`{}^{-3}`), and :math:`\frac{\partial \rho }{\partial z}` is +approximated as +:math:`\frac{\rho _{i+1} -\rho _{i} }{z_{i+1} -z_{i} }` . Note that +because here, *z* is increasing downwards (unlike in Hostetler and +Bartlein (1990)), eq. contains no negative sign; this is a correction +from CLM4. The density of water is (Hostetler and Bartlein 1990) + +.. math:: + :label: 9.34) + + \rho _{i} =1000\left(1-1.9549\times 10^{-5} \left|T_{i} -277\right|^{1.68} \right). + +The enhanced diffusivity :math:`K_{ed}` is given by (Fang and Stefan +1996) + +.. math:: + :label: ZEqnNum809542 + + K_{ed} =1.04\times 10^{-8} \left(N^{2} \right)^{-0.43} ,N^{2} \ge 7.5\times 10^{-5} {\rm s}^{2} + +where :math:`N^{2}` \ is calculated as in eq. except for the minimum +value imposed in . + +The thermal conductivity for the liquid water portion of lake body layer +*i*, :math:`\tau _{liq,i}` (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) is +given by + +.. math:: + :label: 9.36) + + \tau _{liq,i} =K_{W} c_{liq} \rho _{liq} . + +The thermal conductivity of the ice portion of lake body layer *i*, +:math:`\tau _{ice,eff}` \ (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), is +constant among layers, and is given by + +.. math:: + :label: 9.37) + + \tau _{ice,eff} =\tau _{ice} \frac{\rho _{ice} }{\rho _{liq} } + +where :math:`\tau _{ice}` \ (Table 2.6) is the nominal thermal +conductivity of ice: :math:`\tau _{ice,eff}` \ is adjusted for the fact +that the nominal model layer thicknesses remain constant even while the +physical ice thickness exceeds the water thickness. + +The overall thermal conductivity :math:`\tau _{i}` for layer *i* with +ice mass-fraction :math:`I_{i}` is the harmonic mean of the liquid +and water fractions, assuming that they will be physically vertically +stacked, and is given by + +.. math:: + :label: 9.38) + + \tau _{i} =\frac{\tau _{ice,eff} \tau _{liq,i} }{\tau _{liq,i} I_{i} +\tau _{ice} \left(1-I_{i} \right)} . + +The thermal conductivity of snow, soil, and bedrock layers above and +below the lake, respectively, are computed identically to those for +vegetated land units (Chapter 6), except for the adjustment of thermal +conductivity for frost heave or excess ice (Subin et al., 2012a, +Supporting Information). + +Radiation Penetration +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If there are no resolved snow layers, the surface absorption fraction :math:`\beta` is set according to the near-infrared fraction simulated +by the atmospheric model. This is apportioned to the surface energy +budget (section 9.4.2), and thus no additional radiation is absorbed in +the top :math:`z_{a}` (currently 0.6 m) of unfrozen lakes, for which +the light extinction coefficient :math:`\eta` ( :math:`\text{m}^{-1}` ) +varies between lake columns (eq. ). For frozen lakes +(:math:`T_{g} \le T_{f}` ), the remaining :math:`\left(1-\beta \right)\vec{S}_{g}` fraction of surface absorbed +radiation that is not apportioned to the surface energy budget is +absorbed in the top lake body layer. This is a simplification, as lake +ice is partially transparent. If there are resolved snow layers, then +the snow optics submodel (Chapter 3) is used to calculate the snow layer +absorption (except for the absorption predicted for the top layer by the +snow optics submodel, which is assigned to the surface energy budget), +with the remainder penetrating snow layers absorbed in the top lake body +ice layer. + +For unfrozen lakes, the solar radiation remaining at depth +:math:`z>z_{a}` in the lake body is given by + +.. math:: + :label: 9.39) + + \phi =\left(1-\beta \vec{S}_{g} \right)\exp \left\{-\eta \left(z-z_{a} \right)\right\} . + +For all lake body layers, the flux absorbed by the layer *i*, +:math:`\phi _{i}` , is + +.. math:: + :label: 9.40) + + \phi _{i} =\left(1-\beta \vec{S}_{g} \right)\left[\exp \left\{-\eta \left(z_{i} -\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}-\exp \left\{-\eta \left(z_{i} +\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}\right] . + +The argument of each exponent is constrained to be non-negative (so +:math:`\phi _{i}` = 0 for layers contained within :math:`\text{z}_{a}`). +The remaining flux exiting the bottom of layer :math:`i=N_{levlak}` is +absorbed in the top soil layer. + +The light extinction coefficient :math:`\eta` ( :math:`\text{m}^{-1}` ), if +not provided as external data, is a function of depth *d* (m) (Subin et +al. 2012a): + +.. math:: + :label: ZEqnNum284649 + + \eta =1.1925d^{-0.424} . + +Heat Capacities +^^^^^^^^^^^^^^^^^^^^^ + +The vertically-integrated heat capacity for each lake layer, +:math:`\text{c}_{v,i}\,\text{J\,m}^{-2}`) is +determined by the mass-weighted average over the heat capacities for the +water and ice fractions: + +.. math:: + :label: 9.42) + + c_{v,i} =\Delta z_{i} \rho _{liq} \left[c_{liq} \left(1-I_{i} \right)+c_{ice} I_{i} \right] . + +Note that the density of water is used for both ice and water fractions, +as the thickness of the layer is fixed. + +The total heat capacity :math:`c_{v,i}` for each soil, snow, and +bedrock layer (J m\ :math:`{}^{-2}`) is determined as for vegetated land +units (Chapter 6), as the sum of the heat capacities for the water, ice, +and mineral constituents. + +Crank-Nicholson Solution +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The solution method for thermal diffusion is similar to that used for +soil (Chapter 6), except that the lake body layers are sandwiched +between the snow and soil layers (section 9.5.1), and radiation flux is +absorbed throughout the lake layers. Before solution, layer temperatures +:math:`T_{i}` (K), thermal conductivities :math:`\tau _{i}` (W +m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), heat capacities :math:`c_{v,i}` +(J m\ :math:`{}^{-2}`), and layer and interface depths from all +components are transformed into a uniform set of vectors with length +:math:`N=n_{sno} +N_{levlak} +N_{levgrnd}` and consistent units to +simplify the solution. Thermal conductivities at layer interfaces are +calculated as the harmonic mean of the conductivities of the neighboring +layers: + +.. math:: + :label: 9.43) + + \lambda _{i} =\frac{\tau _{i} \tau _{i+1} \left(z_{i+1} -z_{i} \right)}{\tau _{i} \left(z_{i+1} -\hat{z}_{i} \right)+\tau _{i+1} \left(\hat{z}_{i} -z_{i} \right)} , + +where :math:`\lambda _{i}` is the conductivity at the interface between +layer *i* and layer *i +* 1, :math:`z_{i}` is the depth of the node of +layer *i*, and :math:`\hat{z}_{i}` is the depth of the interface below +layer *i*. Care is taken at the boundaries between snow and lake and +between lake and soil. The governing equation is discretized for each +layer as + +.. math:: + :label: ZEqnNum991615 + + \frac{c_{v,i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=F_{i-1} -F_{i} +\phi _{i} + +where superscripts *n* + 1 and *n* denote values at the end and +beginning of the timestep :math:`\Delta t`, respectively, :math:`F_{i}` +(W m\ :math:`{}^{-2}`) is the downward heat flux at the bottom of layer +*i*, and :math:`\phi _{i}` is the solar radiation absorbed in layer +*i*. + +Eq. is solved using the semi-implicit Crank-Nicholson Method, resulting +in a tridiagonal system of equations: + +.. math:: + :label: 9.45) + + \begin{array}{l} {r_{i} =a_{i} T_{i-1}^{n+1} +b_{i} T_{i}^{n+1} +cT_{i+1}^{n+1} ,} \\ {a_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } ,} \\ {b_{i} =1+0.5\frac{\Delta t}{c_{v,i} } \left(\frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } +\frac{\partial F_{i} }{\partial T_{i}^{n} } \right),} \\ {c_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i} }{\partial T_{i}^{n} } ,} \\ {r_{i} =T_{i}^{n} +0.5\frac{\Delta t}{c_{v,i} } \left(F_{i-1} -F_{i} \right)+\frac{\Delta t}{c_{v,i} } \phi _{i} .} \end{array} + +The fluxes :math:`F_{i}` are defined as follows: for the top layer, +:math:`F_{j_{top} -1} =2G;a_{j_{top} } =0`, where *G* is defined as in +section 9.4.3 (the factor of 2 merely cancels out the Crank-Nicholson +0.5 in the equation for :math:`r_{j_{top} }` ). For the bottom layer, +:math:`F_{N_{levlak} +N_{levgrnd} } =0`. For all other layers: + +.. math:: + :label: 9.46) + + F_{i} =\lambda _{i} \frac{T_{i} ^{n} -T_{i+1}^{n} }{z_{n+1} -z_{n} } . + +Phase Change +^^^^^^^^^^^^^^^^^^ + +Phase change in the lake, snow, and soil is done similarly to that done +for the soil and snow for vegetated land units (Chapter 6), except +without the allowance for freezing point depression in soil underlying +lakes. After the heat diffusion is calculated, phase change occurs in a +given layer if the temperature is below freezing and liquid water +remains, or if the temperature is above freezing and ice remains. + +If melting occurs, the available energy for melting, :math:`Q_{avail}` +(J m\ :math:`{}^{-2}`), is computed as + +.. math:: + :label: ZEqnNum598199 + + Q_{avail} =\left(T_{i} -T_{f} \right)c_{v,i} + +where :math:`T_{i}` is the temperature of the layer after thermal +diffusion (section 9.5.7), and :math:`c_{v,i}` \ is as calculated in +section 9.5.6. The mass of melt in the layer *M* (kg m\ :math:`{}^{-2}`) +is given by + +.. math:: + :label: 9.48) + + M=\min \left\{M_{ice} ,\frac{Q_{avail} }{H_{fus} } \right\} + +where :math:`H_{fus}` (J kg\ :math:`{}^{-1}`) is the latent heat of +fusion of water (Table 2.6), and :math:`M_{ice}` is the mass of ice in +the layer: :math:`I_{i} \rho _{liq} \Delta z_{i}` for a lake body +layer, or simply the soil / snow ice content state variable +(:math:`w_{ice}` ) for a soil / snow layer. The heat remainder, +:math:`Q_{rem}` \ is given by + +.. math:: + :label: ZEqnNum889387 + + Q_{rem} =Q_{avail} -MH_{fus} . + +Finally, the mass of ice in the layer :math:`M_{ice}` is adjusted +downwards by :math:`M`, and the temperature :math:`T_{i}` of the +layer is adjusted to + +.. math:: + :label: ZEqnNum926437 + + T_{i} =T_{f} +\frac{Q_{rem} }{c'_{v,i} } + +where :math:`c'_{v,i} =c_{v,i} +M\left(c_{liq} -c_{ice} \right)`. + +If freezing occurs, :math:`Q_{avail}` is again given by but will be +negative. The melt :math:`M`, also negative, is given by + +.. math:: + :label: 9.51) + + M=\max \left\{-M_{liq} ,\frac{Q_{avail} }{H_{fus} } \right\} + +where :math:`M_{liq}` is the mass of water in the layer: +:math:`\left(1-I_{i} \right)\rho _{liq} \Delta z_{i}` for a lake body +layer, or the soil / snow water content state variable +(:math:`w_{liq}` ). The heat remainder :math:`Q_{rem}` is given by eq. +and will be negative or zero. Finally, :math:`M_{liq}` is adjusted +downwards by :math:`-M` and the temperature is reset according to eq. . + +In the presence of nonzero snow water :math:`W_{sno}` without resolved +snow layers over + +an unfrozen top lake layer, the available energy in the top lake layer +:math:`\left(T_{1} -T_{f} \right)c_{v,1}` is used to melt the snow. +Similar to above, :math:`W_{sno}` is either completely melted and the +remainder of heat returned to the top lake layer, or the available heat +is exhausted and the top lake layer is set to freezing. The snow +thickness is adjusted downwards in proportion to the amount of melt, +maintaining constant density. + +Convection +^^^^^^^^^^^^^^^^ + +Convective mixing is based on Hostetler et al.’s (1993, 1994) coupled +lake-atmosphere model, adjusting the lake temperature after diffusion +and phase change to maintain a stable density profile. Unfrozen lakes +overturn when :math:`\rho _{i} >\rho _{i+1}` , in which case the layer +thickness weighted average temperature for layers 1 to :math:`i+1` is +applied to layers 1 to :math:`i+1` and the densities are updated. This +scheme is applied iteratively to layers :math:`1\le i 0`, then :math:`T_{froz} =T_{f}` , and :math:`T_{unfr}` +is given by + +.. math:: + :label: 9.54) + + T_{unfr} =\frac{Q}{\rho _{liq} Z_{i+1} \left[\left(1-I_{av} \right)c_{liq} \right]} +T_{f} . + +If :math:`Q < 0`, then :math:`T_{unfr} =T_{f}` , and :math:`T_{froz}` +is given by + +.. math:: + :label: 9.55) + + T_{froz} =\frac{Q}{\rho _{liq} Z_{i+1} \left[I_{av} c_{ice} \right]} +T_{f} . + +The ice is lumped together at the top. For each lake layer *j* from 1 +to *i* + 1, the ice fraction and temperature are set as follows, where +:math:`Z_{j} =\sum _{m=1}^{j}\Delta z_{m}` : + +#. If :math:`Z_{j} \le Z_{i+1} I_{av}` , then :math:`I_{j} =1` and + :math:`T_{j} =T_{froz}` . + +#. Otherwise, if :math:`Z_{j-1} 1000{\rm m}`, +in which case additional precipitation and frost deposition is added to +:math:`q_{snwcp,\, ice}` . + +If there are resolved snow layers, the generalized “evaporation†+:math:`E_{g}` (i.e., evaporation, dew, frost, and sublimation) is +treated as over other land units, except that the allowed evaporation +from the ground is unlimited (though the top snow layer cannot lose more +water mass than it contains). If there are no resolved snow layers but +:math:`W_{sno} >0` and :math:`E_{g} >0`, sublimation +:math:`q_{sub,sno}` \ (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) will be +given by + +.. math:: + :label: 9.60) + + q_{sub,sno} =\min \left\{E_{g} ,\frac{W_{sno} }{\Delta t} \right\} . + +If :math:`E_{g} <0,T_{g} \le T_{f}` , and there are no resolved snow +layers or the top snow layer is not unfrozen, then the rate of frost +production :math:`q_{frost} =\left|E_{g} \right|`. If :math:`E_{g} <0` +but the top snow layer has completely thawed during the Phase Change +step of the Lake Temperature solution (section 9.5.8), then frost (or +dew) is not allowed to accumulate (:math:`q_{frost} =0`), to insure that +the layer is eliminated by the Snow Hydrology (section 7.2) code. (If +:math:`T_{g} >T_{f}` , then no snow is present (section 9.4.3), and +evaporation or dew deposition is balanced by :math:`q_{rgwl}` .) The +snowpack is updated for frost and sublimation: + +.. math:: + :label: 9.61) + + W_{sno} =W_{sno} +\Delta t\left(q_{frost} -q_{sub,sno} \right) . + +If there are resolved snow layers, then this update occurs using the +Snow Hydrology submodel (section 7.2). Otherwise, the snow ice mass is +updated directly, and :math:`z_{sno}` is adjusted by the same +proportion as the snow ice (i.e., maintaining the same density), unless +there was no snow before adding the frost, in which case the density is +assumed to be 250 kg m\ :math:`{}^{-3}`. + +Soil Hydrology +^^^^^^^^^^^^^^^^^^^^ + +The combined water and ice soil volume fraction in a soil layer +:math:`\theta _{i}` is given by + +.. math:: + :label: 9.62) + + \theta _{i} =\frac{1}{\Delta z_{i} } \left(\frac{w_{ice,i} }{\rho _{ice} } +\frac{w_{liq,i} }{\rho _{liq} } \right) . + +If :math:`\theta _{i} <\theta _{sat,i}` , the pore volume fraction at +saturation (as may occur when ice melts), then the liquid water mass is +adjusted to + +.. math:: + :label: 9.63) + + w_{liq,i} =\left(\theta _{sat,i} \Delta z_{i} -\frac{w_{ice,i} }{\rho _{ice} } \right)\rho _{liq} . + +Otherwise, if excess ice is melting and +:math:`w_{liq,i} >\theta _{sat,i} \rho _{liq} \Delta z_{i}` , then the +water in the layer is reset to + +.. math:: + :label: 9.64) + + w_{liq,i} = \theta _{sat,i} \rho _{liq} \Delta z_{i} + +This allows excess ice to be initialized (and begin to be lost only +after the pore ice is melted, which is realistic if the excess ice is +found in heterogeneous chunks) but irreversibly lost when melt occurs. + +Modifications to Snow Layer Logic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +A thickness difference :math:`z_{lsa} =s_{\min } -\tilde{s}_{\min }` +adjusts the minimum resolved snow layer thickness for lake columns as +compared to non-lake columns. The value of :math:`z_{lsa}` is chosen to +satisfy the CFL condition for the model timestep. By default, +:math:`\tilde{s}_{\min }` \ = 1 cm and :math:`s_{\min }` \ = 4 cm. See +Subin et al. (2012a; including Supporting Information) for further +discussion. + +The rules for combining and sub-dividing snow layers (section 7.2.7) are +adjusted for lakes to maintain minimum thicknesses of :math:`s_{\min }` +and to increase all target layer thicknesses by :math:`z_{lsa}` . The +rules for combining layers are modified by simply increasing layer +thickness thresholds by :math:`z_{lsa}` . The rules for dividing snow +layers are contained in a separate subroutine that is modified for +lakes, and is a function of the number of layers and the layer +thicknesses. There are two types of operations: (a) subdividing layers +in half, and (b) shifting some volume from higher layers to lower layers +(without increasing the layer number). For subdivisions of type (a), the +thickness thresholds triggering subdivision are increased by +:math:`2z_{lsa}` for lakes. For shifts of type (b), the thickness +thresholds triggering the shifts are increased by :math:`z_{lsa}` . At +the end of the modified subroutine, a snow ice and liquid balance check +are performed. + +In rare instances, resolved snow layers may be present over an unfrozen +top lake body layer. In this case, the snow layers may be eliminated if +enough heat is present in the top layer to melt the snow: see Subin et +al. (2012a, Supporting Information). From 13fbf29398b215ebbaab54b3e87ce7f3f9bcf6ab Mon Sep 17 00:00:00 2001 From: mvertens Date: Mon, 27 Mar 2017 11:30:21 -0600 Subject: [PATCH 003/730] first pass at complete tech note --- doc/source/conf.py | 2 +- doc/source/index.rst | 1 + .../CLM45_Tech_Note_Chpt_1_Introduction.rst | 432 ++++++------------ .../CLM45_Tech_Note_Chpt_11_RTM.rst | 20 +- .../CLM45_Tech_Note_Chpt_12_Urban.rst | 6 +- ...Note_Chpt_13_CN_Allocation_Respiration.rst | 40 +- ...Tech_Note_Chpt_14_Vegetation_Phenology.rst | 350 +++++++------- .../CLM45_Tech_Note_Chpt_15_Decomposition.rst | 353 +++++++------- ...h_Note_Chpt_16_External_Nitrogen_Cycle.rst | 183 ++++---- ...LM45_Tech_Note_Chpt_17_Plant_Mortality.rst | 186 ++++---- .../CLM45_Tech_Note_Chpt_18_Fire.rst | 287 ++++++------ .../CLM45_Tech_Note_Chpt_19_Methane.rst | 323 ++++++------- .../CLM45_Tech_Note_Chpt_2_Ecosystem.rst | 277 ++++++----- ...LM45_Tech_Note_Chpt_20_Crop_Irrigation.rst | 294 ++++++------ ..._Tech_Note_Chpt_21_Transient_Landcover.rst | 25 +- .../CLM45_Tech_Note_Chpt_22_DGVM.rst | 12 +- .../CLM45_Tech_Note_Chpt_23_BVOCs.rst | 19 +- .../CLM45_Tech_Note_Chpt_24_Dust.rst | 83 ++-- .../CLM45_Tech_Note_Chpt_25_Isotopes.rst | 163 +++---- .../CLM45_Tech_Note_Chpt_26_Offline.rst | 54 ++- .../CLM45_Tech_Note_Chpt_27_References.rst | 14 +- ...CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst | 61 +-- ...LM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst | 14 +- .../CLM45_Tech_Note_Chpt_5_Fluxes.rst | 168 +++---- ...ech_Note_Chpt_6_Soil_Snow_Temperatures.rst | 102 ++--- .../CLM45_Tech_Note_Chpt_7_Hydrology.rst | 146 +++--- .../CLM45_Tech_Note_Chpt_8_Photosynthesis.rst | 202 ++++---- .../CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst | 149 +++--- doc/source/tech_note/index.rst | 43 ++ .../overview/scientific_validation.rst | 2 +- 30 files changed, 1836 insertions(+), 2175 deletions(-) create mode 100644 doc/source/tech_note/index.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index bdf2be569c..dc9a7b7ea8 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -34,7 +34,7 @@ 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', + 'sphinx.ext.imgmath', 'sphinx.ext.githubpages'] # Add any paths that contain templates here, relative to this directory. diff --git a/doc/source/index.rst b/doc/source/index.rst index a5ec1eb158..cc7ec3c27c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -17,6 +17,7 @@ Table of contents :maxdepth: 1 users_guide/index.rst + tech_note/index.rst Indices and tables ================== diff --git a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst index 1bcd54fca7..bb9b012bdc 100644 --- a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst +++ b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst @@ -1,17 +1,9 @@ -.. math:: 188 - **NCAR/TN-503+STR** **NCAR Technical Note** -**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** - -**** - **July 2013** -**** - **Technical Description of version 4.5 of the Community Land Model (CLM)** @@ -19,16 +11,12 @@ **Keith W. Oleson, David M. Lawrence** -**** - ***Lead Authors*** **Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, Peter E. Thornton** -**** - ***Contributing Authors*** **Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, @@ -36,16 +24,9 @@ Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, Jinyun Tang, Zong-Liang Yang** -**** - -**** - -**** - **NCAR Earth System Laboratory** -**Climate and Global Dynamics -Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** +**Climate and Global Dynamics Division** **NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** @@ -57,13 +38,9 @@ Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ **ISSN Electronic Edition 2153-2400** -**** - **NCAR TECHNICAL NOTES** -http://library.ucar.edu/research/publish-technote\ **** - -**** +http://library.ucar.edu/research/publish-technote The Technical Notes series provides an outlet for a variety of NCAR Manuscripts that contribute in specialized ways to the body of @@ -75,35 +52,23 @@ include: **EDD – Engineering, Design, or Development Reports** -Equipment descriptions, test results, instrumentation, - -and operating and maintenance manuals. +Equipment descriptions, test results, instrumentation, and operating and maintenance manuals. **IA – Instructional Aids** -** Instruction manuals, bibliographies, film supplements, - -and other research or instructional aids. +Instruction manuals, bibliographies, film supplements, and other research or instructional aids. **PPR – Program Progress Reports** -** Field program reports, interim and working reports, - -survey reports, and plans for experiments. +Field program reports, interim and working reports, survey reports, and plans for experiments. **PROC – Proceedings** -** Documentation or symposia, colloquia, conferences, - -workshops, and lectures. (Distribution maybe limited to - -attendees). +Documentation or symposia, colloquia, conferences, workshops, and lectures. (Distribution maybe limited to attendees). **STR – Scientific and Technical Reports** -Data compilations, theoretical and numerical - -investigations, and experimental results. +Data compilations, theoretical and numerical investigations, and experimental results. The National Center for Atmospheric Research (NCAR) is operated by the nonprofit University Corporation for Atmospheric Research (UCAR) under @@ -113,61 +78,35 @@ are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. National Center for Atmospheric Research - -P. O. Box 3000 - -Boulder, Colorado 80307-300 - -**** - -ii +P. O. Box 3000, Boulder, Colorado 80307-300 **NCAR/TN-503+STR** **NCAR Technical Note** -**\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** - -**** - **July 2013** -**** +**Technical Description of version 4.5 of the Community Land Model (CLM)** -**Technical Description of version 4.5 of the Community Land Model -(CLM)** - -***Coordinating Lead Authors*** +**Coordinating Lead Authors** **Keith W. Oleson, David M. Lawrence** -**** - -***Lead Authors*** +**Lead Authors** **Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel -Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, -Peter E. Thornton** - -**** +Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, Peter E. Thornton** -***Contributing Authors*** +**Contributing Authors** **Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, Jinyun Tang, Zong-Liang Yang** -**** - -**** - -**** - **NCAR Earth System Laboratory** -**Climate and Global Dynamics -Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_** +**Climate and Global Dynamics Division** **NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** @@ -179,219 +118,127 @@ Division\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ **ISSN Electronic Edition 2153-2400** -xi - -**TABLE OF CONTENTS** - -**** - -**1. Introduction 11.1 Model History 11.1.1 Inception of CLM 11.1.2 CLM2 -31.1.3 CLM3 51.1.4 CLM3.5 61.1.5 CLM4 71.1.6 CLM4.5 81.2 Biogeophysical -and Biogeochemical Processes 112. Surface Characterization and Model -Input Requirements 142.1 Surface Characterization 142.1.1 Surface -Heterogeneity and Data Structure 142.1.2 Vegetation Composition 172.1.3 -Vegetation Structure 192.1.4 Phenology and vegetation burial by snow -212.2 Model Input Requirements 212.2.1 Atmospheric Coupling 212.2.2 -Initialization 272.2.3 Surface Data 282.2.4 Adjustable Parameters and -Physical Constants 353. Surface Albedos 373.1 Canopy Radiative Transfer -373.2 Ground Albedos 463.2.1 Snow Albedo 483.2.2 Snowpack Optical -Properties 523.2.3 Snow Aging 563.3 Solar Zenith Angle 594. Radiative -Fluxes 634.1 Solar Fluxes 634.2 Longwave Fluxes 675. Momentum, Sensible -Heat, and Latent Heat Fluxes 715.1 Monin-Obukhov Similarity Theory 735.2 -Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces 825.3 -Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces -885.3.1 Theory 885.3.2 Numerical Implementation 1025.4 Update of Ground -Sensible and Latent Heat Fluxes 1075.5 Saturation Vapor Pressure 1106. -Soil and Snow Temperatures 1136.1 Numerical Solution 1146.2 Phase Change -1256.2.1 Soil and Snow Layers 1256.2.2 Surface Water 1296.3 Soil and -Snow Thermal Properties 1307. Hydrology 1347.1 Canopy Water 1357.2 Snow -1377.2.1 Snow Covered Area Fraction 1397.2.2 Ice Content 1407.2.3 Water -Content 1427.2.4 Black and organic carbon and mineral dust within snow -1437.2.5 Initialization of snow layer 1467.2.6 Snow Compaction 1467.2.7 -Snow Layer Combination and Subdivision 1497.2.7.1 Combination 1497.2.7.2 -Subdivision 1527.3 Surface Runoff, Surface Water Storage, and -Infiltration 1537.3.1 Surface Runoff 1537.3.2 Surface Water Storage -1557.3.3 Infiltration 1567.4 Soil Water 1587.4.1 Hydraulic Properties -1607.4.2 Numerical Solution 1637.4.2.1 Equilibrium soil matric potential -and volumetric moisture 1697.4.2.2 Equation set for layer i=1 1717.4.2.3 -Equation set for layers i=2,…,N\ :sub:`levsoi` -1 1717.4.2.4 Equation -set for layers i=N\ :sub:`levsoi` ,…N\ :sub:`levsoi` +1 1727.5 Frozen -Soils and Perched Water Table 1747.6 Groundwater-Soil Water Interactions -1757.7 Runoff from glaciers and snow-capped surfaces 1787.8 The Variable -Infiltration Capacity parameterizations as a hydrologic option 1798. -Stomatal Resistance and Photosynthesis 1838.1 Stomatal resistance 1838.2 -Photosynthesis 1868.3 Vcmax25 and canopy scaling 1918.4 Soil water -stress 1938.5 Numerical implementation 1979. Lake Model 2009.1 -Discretization 2019.2 External Data 2029.3 Surface Albedo 2029.4 Surface -Fluxes and Surface Temperature 2039.4.1 Overview of Changes from CLM4 -2039.4.2 Surface Properties 2039.4.3 Surface Flux Solution 2059.5 Lake -Temperature 2119.5.1 Introduction 2119.5.2 Overview of Changes from CLM4 -2129.5.3 Boundary Conditions 2139.5.4 Eddy Diffusivity and Thermal -Conductivities 2139.5.5 Radiation Penetration 2169.5.6 Heat Capacities -2179.5.7 Crank-Nicholson Solution 2179.5.8 Phase Change 2199.5.9 -Convection 2209.5.10 Energy Conservation 2239.6 Lake Hydrology 2239.6.1 -Overview 2239.6.2 Water Balance 2249.6.3 Precipitation, Evaporation, and -Runoff 2259.6.4 Soil Hydrology 2269.6.5 Modifications to Snow Layer -Logic 22710. Glaciers 22910.1 Overview 22910.2 Multiple elevation class -scheme 23110.3 Computation of the surface mass balance 23211. River -Transport Model (RTM) 23512. Urban Model (CLMU) 23913. Carbon and -Nitrogen Pools, Allocation, and Respiration 24413.1 Introduction 24413.2 -Carbon Allocation for Maintenance Respiration Costs 24613.3 Carbon and -Nitrogen Stoichiometry of New Growth 24813.4 Deployment of -retranslocated nitrogen 25213.5 Plant nitrogen uptake from soil mineral -nitrogen pool 25313.6 Final carbon and nitrogen allocation 25313.7 -Autotrophic Respiration 25613.7.1 Maintenance Respiration 25613.7.2 -Growth Respiration 25714. Vegetation Phenology 25914.1 General Phenology -Flux Parameterization 25914.1.1 Onset Periods 26014.1.2 Offset Periods -26214.1.3 Background Onset Growth 26414.1.4 Background Litterfall -26514.1.5 Livewood Turnover 26614.2 Evergreen Phenology 26714.3 -Seasonal-Deciduous Phenology 26814.3.1 Seasonal-Deciduous Onset Trigger -26814.3.2 Seasonal-Deciduous Offset Trigger 27114.4 Stress-Deciduous -Phenology 27114.4.1 Stress-Deciduous Onset Triggers 27114.4.2 -Stress-Deciduous Offset Triggers 27314.4.3 Stress-Deciduous: Long -Growing Season 27414.5 Litterfall Fluxes Merged to the Column Level -27615. Decomposition 27815.1 CLM-CN Pool Structure, Rate Constants and -Parameters 28115.2 Century-based Pool Structure, Rate Constants and -Parameters 28515.3 Environmental modifiers on decomposition rate 28615.4 -N-limitation of Decomposition Fluxes 28915.5 N Competition between plant -uptake and soil immobilization fluxes 29215.6 Final Decomposition Fluxes -29315.7 Vertical Distribution and Transport of Decomposing C and N pools -29515.8 Model Equilibration 29616. External Nitrogen Cycle 29816.1 -Atmospheric Nitrogen Deposition 29816.2 Biological Nitrogen Fixation -29916.3 Nitrification and Denitrification Losses of Nitrogen 30116.3.1 -CLM-CN formulation 30116.3.2 Century-based formulation 30416.4 Leaching -Losses of Nitrogen 30516.5 Losses of Nitrogen Due to Fire 30717. Plant -Mortality 30817.1 Mortality Fluxes Leaving Vegetation Pools 30817.2 -Mortality Fluxes Merged to the Column Level 31118. Fire 31618.1 Non-peat -fires outside cropland and tropical closed forest 31618.1.1 Fire counts -31618.1.2 Average spread area of a fire 32018.1.3 Fire impact 32318.2 -Agricultural fires 32518.3 Deforestation fires 32618.4 Peat fires 32919. -Methane Model 33219.1 Methane Model Structure and Flow 33219.2 Governing -Mass-Balance Relationship 33319.3 CH4 Production 33419.4 Ebullition -33819.5 Aerenchyma Transport 33819.6 CH4 Oxidation 34019.7 Reactive -Transport Solution 34019.7.1 Competition for CH4 and O2 34119.7.2 CH4 -and O2 Source Terms 34119.7.3 Aqueous and Gaseous Diffusion 34219.7.4 -Boundary Conditions 34319.7.5 Crank-Nicholson Solution 34419.7.6 -Interface between water table and unsaturated zone 34519.8 Inundated -Fraction Prediction 34619.9 Seasonal Inundation 34720. Crops and -Irrigation 34820.1 Summary of CLM4.5 updates relative to the CLM4.0 -34820.2 The crop model 34820.2.1 Introduction 34820.2.2 Crop plant -functional types 34920.2.3 Phenology 35020.2.3.1 Planting 35120.2.3.2 -Leaf emergence 35220.2.3.3 Grain fill 35320.2.3.4 Harvest 35320.2.4 -Allocation 35320.2.4.1 Leaf emergence to grain fill 35420.2.4.2 Grain -fill to harvest 35420.2.5 General comments 35520.3 The irrigation model -36020.4 The details about what is new in CLM4.5 36120.4.1 Interactive -irrigation for corn, temperate cereals, and soybean 36120.4.2 -Interactive fertilization 36320.4.3 Biological nitrogen fixation for -soybeans 36420.4.4 Modified C:N ratios for crops 36520.4.5 Nitrogen -retranslocation for crops 36520.4.6 Separate reproductive pool 36721. -Transient Landcover Change 36921.1 Annual Transient Land Cover Data and -Time Interpolation 36921.2 Mass and Energy Conservation 37121.3 Annual -Transient Land Cover Dataset Development 37221.3.1 UNH Transient Land -Use and Land Cover Change Dataset 37221.3.2 Representing Land Use and -Land Cover Change in CLM 37421.3.3 Present Day PFT Dataset 37521.3.4 -Potential PFT Distribution 37621.3.5 Transient Land Cover Change Dataset -37721.3.6 Forest Harvest Dataset Changes 37822. Dynamic Global -Vegetation Model 38122.1 Establishment and survival 38222.2 Light -competition 38322.3 CN processes modified for the CNDV coupling 38323. -Biogenic Volatile Organic Compounds (BVOCs) 38624. Dust Model 38825. -Carbon Isotopes 39325.1 General Form for Calculating 13C and 14C Flux -39325.2 Isotope Symbols, Units, and Reference Standards 39425.3 Carbon -Isotope Discrimination During Photosynthesis 39625.4 14C radioactive -decay and historical atmospheric 14C concentrations 39826. Offline Mode -40027. References 405** - **LIST OF FIGURES** -Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes -simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). -13Figure 2.1. Configuration of the CLM subgrid hierarchy. 15Figure 4.1. -Schematic diagram of (a) direct beam radiation, (b) diffuse solar -radiation, and (c) longwave radiation absorbed, transmitted, and -reflected by vegetation and ground. 64Figure 5.1. Schematic diagram of -sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated -surfaces. 91Figure 5.2. Schematic diagram of water vapor fluxes for (a) -non-vegetated surfaces and (b) vegetated surfaces. 92Figure 6.1. -Schematic diagram of numerical scheme used to solve for soil -temperature. 119Figure 7.1. Hydrologic processes represented in CLM. -135Figure 7.2. Example of three layer snow pack (snl=-3). 137Figure 7.3. -Schematic diagram of numerical scheme used to solve for soil water -fluxes. 165Figure 12.1. Schematic representation of the urban land unit. -242Figure 12.2. Schematic of urban and atmospheric model coupling. -243Figure 13.1. Vegetation fluxes and pools. 245Figure 13.2: Carbon and -nitrogen pools. 246Figure 14.1. Example of annual phenology cycle for -seasonal deciduous. 260Figure 14.2. Example fluxes and pools sizes for -an onset growth period of 15 days, with initial transfer pool size of -100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool -(e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its -associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). -262Figure 14.3. Example fluxes and pool sizes for an offset (litterfall) -period of 15 days, with initial display pool size of 100 gC m-2 and a -timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon -content of display pool and litter pool through the litterfall period, -ignoring the losses from litter pool due to decomposition during this -period. 264Figure 15.1. Schematic of decomposition model in CLM. -279Figure 15.2. Pool structure, transitions, respired fractions (numbers -at end of arrows), and turnover times (numbers in boxes) for the 2 -alternate soil decomposition models included in CLM. 281Figure 16.1. -Biological nitrogen fixation as a function of annual net primary -production. 300Figure 19.1. Schematic representation of biological and -physical processes integrated in CLM that affect the net CH4 surface -flux. (left) Fully inundated portion of a CLM gridcell and (right) -variably saturated portion of a gridcell. 334Figure 21.1. Schematic of -land cover change impacts on CLM carbon pools and fluxes. 379Figure -21.2. Schematic of translation of annual UNH land units to CLM4 plant -functional types. 380Figure 25.1. Atmospheric -:math:`\mathrm{\Delta}`\ 14C used to drive 14C model over the historical -period. 399\ **** +- Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). + +- Figure 2.1. Configuration of the CLM subgrid hierarchy. + +- Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. + +- Figure 5.1. Schematic diagram of sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. + +- Figure 5.2. Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. + +- Figure 6.1. Schematic diagram of numerical scheme used to solve for soil temperature. + +- Figure 7.1. Hydrologic processes represented in CLM. + +- Figure 7.2. Example of three layer snow pack (snl=-3). + +- Figure 7.3. Schematic diagram of numerical scheme used to solve for soil water fluxes. + +- Figure 12.1. Schematic representation of the urban land unit. + +- Figure 12.2. Schematic of urban and atmospheric model coupling. + +- Figure 13.1. Vegetation fluxes and pools. + +- Figure 13.2: Carbon and nitrogen pools. + +- Figure 14.1. Example of annual phenology cycle for seasonal deciduous. + +- Figure 14.2. Example fluxes and pools sizes for an onset growth period of 15 days, with initial transfer pool size of 100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool (e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). + +- Figure 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. + +- Figure 15.1. Schematic of decomposition model in CLM. + +- Figure 15.2. Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. + +- Figure 16.1. Biological nitrogen fixation as a function of annual net primary production. 300Figure 19.1. Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. + +- Figure 21.1. Schematic of land cover change impacts on CLM carbon pools and fluxes. + +- Figure 21.2. Schematic of translation of annual UNH land units to CLM4 plant functional types. + +- Figure 25.1. Atmospheric :math:`\mathrm{\Delta}` 14C used to drive 14C model over the historical period. **LIST OF TABLES** -Table 2.1. Plant functional types 18Table 2.2. Prescribed plant -functional type heights 20Table 2.3. Atmospheric input to land model -23Table 2.4. Land model output to atmospheric model 26Table 2.5. Surface -data required for CLM4.5 and their base spatial resolution 29Table 2.6. -Physical constants 36Table 3.1. Plant functional type optical properties -44Table 3.2. Intercepted snow optical properties 46Table 3.3. Dry and -saturated soil albedos 48Table 3.4. Spectral bands and weights used for -snow radiative transfer 51Table 3.5. Single-scatter albedo values used -for snowpack impurities and ice 54Table 3.6. Mass extinction values (m2 -kg-1) used for snowpack impurities and ice. 55Table 3.7. Asymmetry -scattering parameters used for snowpack impurities and ice. 56Table 3.8. -Orbital parameters 62Table 5.1. Plant functional type aerodynamic -parameters 101Table 5.2. Coefficients for e\ :sub:`sat`\ :sup:`T` -111Table 5.3. Coefficients for 112Table 6.1. Soil layer structure. -115Table 7.1. Meltwater scavenging efficiency for particles within snow -146Table 7.2. Minimum and maximum thickness of snow layers (m) 152Table -8.1. Plant functional type (PFT) photosynthetic parameters. 185Table -8.2. Temperature dependence parameters for C3 photosynthesis. 190Table -8.3. Plant functional type root distribution parameters. 196Table 13.1. -Allocation and carbon:nitrogen ratio parameters 250Table 15.1. -Decomposition rate constants for litter and SOM pools, C:N ratios, and -acceleration parameters (see section 15.8 for explanation) for the -CLM-CN decomposition pool structure. 283Table 15.2. Respiration -fractions for litter and SOM pools 284Table 15.3. Respiration fractions -for litter and SOM pools for Century-based structure 285Table 15.4. -Turnover times, C:N ratios, and acceleration parameters (see section -15.8 for explanation) for the Century-based decomposition cascade. -286Table 18.1. PFT-specific combustion completeness and fire mortality -factors. 331Table 19.1. Parameter descriptions and sensitivity analysis -ranges applied in the methane model. 337Table 19.2. Temperature -dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. -342Table 20.1. Crop plant functional types (pfts) in CLM4.5CNcrop and -their parameters relating to phenology and morphology. Numbers in the -first column correspond to the list of pfts in Table 2.1. 357Table 20.2. -Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. -Numbers in the first column correspond to the list of pfts in Table 2.1. -359Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, -fine root, and reproductive pools. 367Table 22.1. Plant functional type -(PFT) biogeography rules with respect to climate. 385Table 24.1. Mass -fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric -standard deviation :sub:`g, i` , per dust source mode i 392Table 24.2. -Minimum and maximum particle diameters in each dust transport bin j -392\ **** - -ACKNOWLEDGEMENTS +- Table 2.1. Plant functional types + +- Table 2.2. Prescribed plant functional type heights + +- Table 2.3. Atmospheric input to land model + +- Table 2.4. Land model output to atmospheric model + +- Table 2.5. Surface data required for CLM4.5 and their base spatial resolution + +- Table 2.6. Physical constants + +- Table 3.1. Plant functional type optical properties + +- Table 3.2. Intercepted snow optical properties + +- Table 3.3. Dry and saturated soil albedos + +- Table 3.4. Spectral bands and weights used for snow radiative transfer + +- Table 3.5. Single-scatter albedo values used for snowpack impurities and ice + +- Table 3.6. Mass extinction values (m2 kg-1) used for snowpack impurities and ice. + +- Table 3.7. Asymmetry scattering parameters used for snowpack impurities and ice. + +- Table 3.8. Orbital parameters + +- Table 5.1. Plant functional type aerodynamic parameters + +- Table 5.2. Coefficients for e\ :sub:`sat`\ :sup:`T` + +- Table 5.3. Coefficients for 112Table 6.1. Soil layer structure. + +- Table 7.1. Meltwater scavenging efficiency for particles within snow + +- Table 7.2. Minimum and maximum thickness of snow layers (m) + +- Table 8.1. Plant functional type (PFT) photosynthetic parameters. + +- Table 8.2. Temperature dependence parameters for C3 photosynthesis. + +- Table8.3. Plant functional type root distribution parameters. + +- Table 13.1. Allocation and carbon:nitrogen ratio parameters + +- Table 15.1. Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. + +- Table 15.2. Respiration fractions for litter and SOM pools + +- Table 15.3. Respiration fractions for litter and SOM pools for Century-based structure + +- Table 15.4.Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. + +- Table 18.1. PFT-specific combustion completeness and fire mortality factors. + +- Table 19.1. Parameter descriptions and sensitivity analysis ranges applied in the methane model. + +- Table 19.2. Temperature dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. + +- Table 20.1. Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in Table 2.1. + +- Table 20.2. Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in Table 2.1. + +- Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. + +- Table 22.1. Plant functional type (PFT) biogeography rules with respect to climate. + +- Table 24.1. Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i + +- Table 24.2. Minimum and maximum particle diameters in each dust transport bin j + +**ACKNOWLEDGEMENTS** The authors would like to acknowledge the substantial contributions of the following members of the Land Model and Biogeochemistry Working @@ -426,12 +273,9 @@ National Laboratory); A. Bozbiyik (Bern University); C. Heald National Laboratory); Ying Sun and Z.-L. Yang (University of Texas at Austin) -.. math:: 188 - -.. math:: 7 - -Introduction -=============== +================= + 1. Introduction +================= The purpose of this technical note is to describe the biogeophysical and biogeochemical parameterizations and numerical implementation of version @@ -690,7 +534,11 @@ problems or biases. The main modifications include updates to canopy processes including a revised canopy radiation scheme and canopy scaling of leaf processes, co-limitations on photosynthesis, revisions to photosynthetic parameters -(Bonan et al. 2011), **** temperature acclimation of photosynthesis, and +(Bonan et al. 2011), + +.. todo:: had three stars here - need to resolve this + +temperature acclimation of photosynthesis, and improved stability of the iterative solution in the photosynthesis and stomatal conductance model (Sun et al. 2012). Hydrology updates include modifications such that hydraulic properties of frozen soils are @@ -827,6 +675,4 @@ processes simulated include (Figure 1.1): Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). -**|image|** - -.. |image| image:: image1 +.. image:: image1.png diff --git a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst index 2f1fd04e7b..032589055f 100644 --- a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst +++ b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst @@ -20,7 +20,7 @@ ocean separately. The RTM uses a linear transport scheme to route water from each grid cell to its downstream neighboring grid cell. The change in storage :math:`S` of river water, whether it be liquid or ice, within a RTM grid -cell (m\ :math:`{}^{3}` s\ :math:`{}^{-1}`) is +cell (m\ :sup:`3` s\ :sup:`-1`) is .. math:: :label: ZEqnNum723341 @@ -28,11 +28,11 @@ cell (m\ :math:`{}^{3}` s\ :math:`{}^{-1}`) is \frac{dS}{dt} =\sum F_{in} -F_{out} +R where :math:`\sum F_{in}` is the sum of inflows of water from -neighboring upstream grid cells (m\ :math:`{}^{3}` s\ :math:`{}^{-1}`), +neighboring upstream grid cells (m\ :sup:`3` s\ :sup:`-1`), :math:`F_{out}` is the flux of water leaving the grid cell in the -downstream direction (m :math:`{}^{3}` s\ :math:`{}^{-1}`), and :math:`R` +downstream direction (m :sup:`3` s\ :sup:`-1`), and :math:`R` is the total runoff generated by the land model grid cell -(m\ :math:`{}^{3}` s\ :math:`{}^{-1}`). Downstream water flow direction in +(m\ :sup:`3` s\ :sup:`-1`). Downstream water flow direction in each grid cell is determined as one of eight compass points (north, northeast, east, southeast, south, southwest, west, and northwest) based on the steepest downhill slope as determined from a digital elevation @@ -45,9 +45,9 @@ model (Graham et al. 1999). The flux of water leaving the grid cell F_{out} =\frac{v}{d} S where :math:`v` is the effective water flow velocity (m -s\ :math:`{}^{-1}`), :math:`d` is the distance between centers of +s\ :sup:`-1`), :math:`d` is the distance between centers of neighboring grid cells (m), and :math:`S` is the volume of river water -stored within the grid cell (m\ :math:`{}^{3}`). The effective water flow +stored within the grid cell (m\ :sup:`3`). The effective water flow velocity can be estimated from Manning’s equation, which is a function of surface water slope, the hydraulic radius of the river channel, and a channel roughness coefficient (Dingman, 2002). However, hydraulic radius @@ -94,7 +94,7 @@ The RTM is generally run at a time step greater than that of the CLM because of computational constraints. The total runoff from the land model at each time step is accumulated until the RTM is invoked. The total liquid water runoff at the land model resolution (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is +m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 11.6) @@ -104,7 +104,7 @@ m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is where :math:`q_{over}` is surface runoff (section 7.3), :math:`q_{drai}` is sub-surface drainage (section 7.6), and :math:`q_{rgwl}` is liquid runoff from glaciers, wetlands, and lakes -(all in kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) (sections 7.7 and +(all in kg m\ :sup:`-2` s\ :sup:`-1`) (sections 7.7 and 9.6.3). The total ice water runoff, also at the land model resolution is .. math:: @@ -115,9 +115,9 @@ where :math:`q_{over}` is surface runoff (section 7.3), where :math:`q_{snwcp,ice}` is the ice runoff from snow-capped surfaces (section 7.7). The runoff at the land model resolution is interpolated to the resolution of RTM and converted to units of -m\ :math:`{}^{3}` s\ :math:`{}^{-1}` for use in equation by multiplying +m\ :sup:`3` s\ :sup:`-1` for use in equation by multiplying by :math:`1\times 10^{-3} A` where :math:`A` is the area -(m\ :math:`{}^{2}`) of the RTM grid cell. +(m\ :sup:`2`) of the RTM grid cell. The RTM grid cells that are at river mouths, hence providing freshwater flux to the ocean, are identified by examining each RTM ocean grid cell diff --git a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst index f4e74d3731..7e78b328d2 100644 --- a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst +++ b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst @@ -83,9 +83,9 @@ LD)], was derived from LandScan 2004, a population density dataset derived from census data, nighttime lights satellite observations, road proximity, and slope (Dobson et al. 2000). The urban extent data for TBD, HD, and MD classes are aggregated from the original 1 km resolution -to both a 0.05\ :math:`{}^\circ` by 0.05\ :math:`{}^\circ` global grid -for high-resolution studies or a 0.5\ :math:`{}^\circ` by -0.5\ :math:`{}^\circ` grid. For the current implementation, the LD class +to both a 0.05\ :sup:`o` by 0.05\ :sup:`o` global grid +for high-resolution studies or a 0.5\ :sup:`o` by +0.5\ :sup:`o` grid. For the current implementation, the LD class is not used because it is highly rural and better modeled as a vegetated/soil surface. Although the TBD, HD, and MD classes are represented as individual urban landunits, urban model history output is diff --git a/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst b/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst index c4a4ab2345..a4173834b5 100644 --- a/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst +++ b/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst @@ -64,14 +64,14 @@ storage pools from which new growth will be displayed in subsequent time steps. The total maintenance respiration demand (:math:`CF_{mr}`, gC -m\ :sup:`-2` s\ :math:`{}^{-1}`) is calculated as a function of +m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of tissue mass and nitrogen concentration, and temperature (section 13.7). The carbon supply to support this demand is composed of fluxes allocated from carbon assimilated in the current timestep -(:math:`CF_{GPP,mr}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) +(:math:`CF_{GPP,mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) and from a storage pool that is drawn down when total demand exceeds photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` -s\ :math:`{}^{-1}`): +s\ :sup:`-1`): .. math:: :label: 13.1) @@ -105,7 +105,7 @@ and plant type are not suitable to sustained growth, the deficit in this pool increases until the available carbon is being allocated mostly to alleviate the deficit, and new growth approaches zero. The allocation flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC -m\ :sup:`-2` s\ :math:`{}^{-1}`) is given as +m\ :sup:`-2` s\ :sup:`-1`) is given as .. math:: :label: 13.4) @@ -131,7 +131,7 @@ Carbon and Nitrogen Stoichiometry of New Growth After accounting for the carbon cost of maintenance respiration, the remaining carbon flux from photosynthesis which can be allocated to new -growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) is +growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 13.6) @@ -197,11 +197,11 @@ Table 13.1. Allocation and carbon:nitrogen ratio parameters +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ | BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :math:`{}_{3}` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +| C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :math:`{}_{3}` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +| C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :math:`{}_{4}` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +| C\ :sub:`4` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ | Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ @@ -237,10 +237,10 @@ where all C:N parameters are defined as constants for a given PFT (Table Given values for the parameters in and , total carbon and nitrogen allocation to new growth ( :math:`CF_{alloc}`, gC -m\ :sup:`-2` s\ :math:`{}^{-1}`, and :math:`NF_{alloc}`, gN -m\ :sup:`-2` s\ :math:`{}^{-1}`, respectively) can be expressed as +m\ :sup:`-2` s\ :sup:`-1`, and :math:`NF_{alloc}`, gN +m\ :sup:`-2` s\ :sup:`-1`, respectively) can be expressed as functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC -m\ :sup:`-2` s\ :math:`{}^{-1}`): +m\ :sup:`-2` s\ :sup:`-1`): .. math:: :label: ZEqnNum555154 @@ -263,7 +263,7 @@ Since the C:N stoichiometry for new growth allocation is defined, from Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation (:math:`CF_{avail\_alloc}`) can be used to calculate the total plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, -gN m\ :sup:`-2` s\ :math:`{}^{-1}`) as: +gN m\ :sup:`-2` s\ :sup:`-1`) as: .. math:: :label: 13.13) @@ -282,16 +282,16 @@ Son and Gower, 1991). CLM includes one pool of retranslocated nitrogen (:math:`NS_{retrans}`, gN m\ :sup:`-2`), and the availability of nitrogen from this pool to support new growth (:math:`NF_{avail\_retrans}`, gN m\ :sup:`-2` -s\ :math:`{}^{-1}`) is proportional to the plant nitrogen demand, as: +s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: .. math:: :label: 13.14) NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) -where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :math:`{}^{-1}`) is the previous year’s annual sum of retranslocated +where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of retranslocated nitrogen extracted from senescing tissues, -:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :math:`{}^{-1}`) is the previous year’s annual sum of +:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of :math:`NF_{plant\_demand}`, and :math:`\Delta`\ *t* (s) is the model’s biogeochemistry time step. This formulation produces an annual cycle in the extraction of nitrogen from :math:`NS_{retrans}` @@ -307,7 +307,7 @@ simulation, before :math:`NF_{plant\_demand\_ann}` and The actual flux of nitrogen from the retranslocated N pool into allocation of new growth (:math:`NF_{retrans,alloc}`, gN -m\ :sup:`-2` s\ :math:`{}^{-1}`) is never greater than the plant +m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant demand for new nitrogen: .. math:: @@ -321,7 +321,7 @@ Plant nitrogen uptake from soil mineral nitrogen pool The total plant nitrogen demand is reduced by the nitrogen flux from :math:`NS_{retrans}` to give the plant demand for mineral nitrogen from the soil (:math:`NF_{plant\_demand\_soil}`, gN -m\ :sup:`-2` s\ :math:`{}^{-1}`): +m\ :sup:`-2` s\ :sup:`-1`): .. math:: :label: ZEqnNum491412 @@ -368,7 +368,7 @@ The downregulation of photosynthesis can then be calculated as: f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . Total allocation to new leaf carbon -(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :math:`{}^{-1}`) is calculated as: +(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: .. math:: :label: 13.21) @@ -550,8 +550,8 @@ following the empirical relationship reported by Ryan (1991): where :math:`MR_{base}` (= 2.525e\ :sup:`-6` gC gN\ :sup:`-1` s\ :sup:`-1`) is the base rate of maintenance respiration per unit nitrogen content, :math:`MR_{q10}` (= 2.0) is the temperature sensitivity for maintenance respiration, -:math:`T_{2m}` (:math:`{}^\circ`\ C) is the air temperature at 2m -height, :math:`Ts_{j}`* (:math:`{}^\circ`\ C) is the soil +:math:`T_{2m}` (:sup:`o`\ C) is the air temperature at 2m +height, :math:`Ts_{j}`* (:sup:`o`\ C) is the soil temperature at level *j*, and :math:`rootfr_{j}` is the fraction of fine roots distributed in soil level *j*. diff --git a/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst b/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst index 65a0cf17a7..305e532552 100644 --- a/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst +++ b/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst @@ -1,5 +1,3 @@ -.. math:: 10 - Vegetation Phenology ======================== @@ -33,7 +31,7 @@ storage over the course of a single growing season. Figure 14.1. Example of annual phenology cycle for seasonal deciduous. -|image| +.. image:: image1.png 14.1.1 Onset Periods ^^^^^^^^^^^^^^^^^^^^ @@ -43,78 +41,77 @@ growth periods (Figure 14.1). Carbon fluxes from the transfer pools into displayed growth are calculated during these periods as: .. math:: + :label: 14.1) - \label{14.1)} CF_{leaf\_ xfer,leaf} =r_{xfer\_ on} CS_{leaf\_ xfer} .. math:: + :label: 14.2) - \label{14.2)} CF_{froot\_ xfer,froot} =r_{xfer\_ on} CS_{froot\_ xfer} .. math:: + :label: 14.3) - \label{14.3)} CF_{livestem\_ xfer,livestem} =r_{xfer\_ on} CS_{livestem\_ xfer} .. math:: + :label: 14.4) - \label{14.4)} CF_{deadstem\_ xfer,deadstem} =r_{xfer\_ on} CS_{deadstem\_ xfer} .. math:: + :label: 14.5) - \label{14.5)} CF_{livecroot\_ xfer,livecroot} =r_{xfer\_ on} CS_{livecroot\_ xfer} .. math:: + :label: 14.6) - \label{14.6)} CF_{deadcroot\_ xfer,deadcroot} =r_{xfer\_ on} CS_{deadcroot\_ xfer} , with corresponding nitrogen fluxes: .. math:: + :label: 14.7) - \label{14.7)} NF_{leaf\_ xfer,leaf} =r_{xfer\_ on} NS_{leaf\_ xfer} .. math:: + :label: 14.8) - \label{14.8)} NF_{froot\_ xfer,froot} =r_{xfer\_ on} NS_{froot\_ xfer} .. math:: + :label: 14.9) - \label{14.9)} NF_{livestem\_ xfer,livestem} =r_{xfer\_ on} NS_{livestem\_ xfer} .. math:: + :label: 14.10) - \label{14.10)} NF_{deadstem\_ xfer,deadstem} =r_{xfer\_ on} NS_{deadstem\_ xfer} .. math:: + :label: 14.11) - \label{14.11)} NF_{livecroot\_ xfer,livecroot} =r_{xfer\_ on} NS_{livecroot\_ xfer} .. math:: + :label: 14.12) - \label{14.12)} NF_{deadcroot\_ xfer,deadcroot} =r_{xfer\_ on} NS_{deadcroot\_ xfer} , where CF is the carbon flux, CS is stored carbon, NF is the nitrogen -flux, NS is stored nitrogen, *r\ :math:`{}_{xfer\_on}`* -(s:math:`{}^{-1}`) is a time-varying rate coefficient controlling flux +flux, NS is stored nitrogen, :math:`{r}_{xfer\_on}` (s\ :sup:`-1`) is a time-varying rate coefficient controlling flux out of the transfer pool: .. math:: + :label: ZEqnNum852972 - \label{ZEqnNum852972} r_{xfer\_ on} =\left\{\begin{array}{l} {{2\mathord{\left/ {\vphantom {2 t_{onset} }} \right. \kern-\nulldelimiterspace} t_{onset} } \qquad {\rm for\; }t_{onset} \ne \Delta t} \\ {{1\mathord{\left/ {\vphantom {1 \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \qquad {\rm for\; }t_{onset} =\Delta t} \end{array}\right. -and *t\ :math:`{}_{onset}`* (s) is the number of seconds remaining in +and *t*\ :sub:`onset` (s) is the number of seconds remaining in the current phenology onset growth period (Figure 14.1). The form of Eq. produces a flux from the transfer pool which declines linearly over the onset growth period, approaching zero flux in the final timestep. @@ -129,47 +126,44 @@ Carbon fluxes from display pools into litter are calculated during these periods as: .. math:: + :label: 14.14) - \label{14.14)} CF_{leaf,litter}^{n} =\left\{\begin{array}{l} {CF_{leaf,litter}^{n-1} +r_{xfer\_ off} \left(CS_{leaf} -CF_{leaf,litter}^{n-1} {\kern 1pt} t_{offset} \right)\qquad {\rm for\; }t_{offset} \ne \Delta t} \\ {\left({CS_{leaf} \mathord{\left/ {\vphantom {CS_{leaf} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \right)+CF_{alloc,leaf} \qquad \qquad \qquad \qquad {\rm for\; }t_{offset} =\Delta t} \end{array}\right. .. math:: + :label: 14.15) - \label{14.15)} CF_{froot,litter}^{n} =\left\{\begin{array}{l} {CF_{froot,litter}^{n-1} +r_{xfer\_ off} \left(CS_{froot} -CF_{froot,litter}^{n-1} {\kern 1pt} t_{offset} \right)\qquad {\rm for\; }t_{offset} \ne \Delta t} \\ {\left({CS_{froot} \mathord{\left/ {\vphantom {CS_{froot} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \right)+CF_{alloc,\, froot} \qquad \qquad \qquad {\rm for\; }t_{offset} =\Delta t} \end{array}\right. .. math:: + :label: 14.16) - \label{14.16)} r_{xfer\_ off} =\frac{2\Delta t}{t_{offset} ^{2} } where superscripts *n* and *n-1* refer to fluxes on the current and -previous timesteps, respectively. The rate coefficient -*r\ :math:`{}_{xfer\_off}`* varies with time to produce a linearly +previous timesteps, respectively. The rate coefficient :math:`{r}_{xfer\_off}` varies with time to produce a linearly increasing litterfall rate throughout the offset period, and the special case for fluxes in the final litterfall timestep -(*t\ :math:`{}_{offset}`* = *:math:`\Delta`\ t*) ensures that all of the +(:math:`{t}_{offset}` = :math:`\Delta t`\ ) ensures that all of the displayed growth is sent to the litter pools for deciduous plant types. -Corresponding nitrogen fluxes during litterfall take into account -retranslocation of nitrogen out of the displayed leaf pool prior to -litterfall (*NF\ :math:`{}_{leaf,retrans}`*, gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`). Retranslocation of nitrogen out of fine roots is +Corresponding nitrogen fluxes during litterfall take into account retranslocation of nitrogen out of the displayed leaf pool prior to +litterfall (:math:`{NF}_{leaf,retrans}`, gN m\ :sup:`-2` s\ :sup:`-1`). Retranslocation of nitrogen out of fine roots is assumed to be negligible. The fluxes are: .. math:: + :label: 14.17) - \label{14.17)} NF_{leaf,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf\_ litter} }} \right. \kern-\nulldelimiterspace} CN_{leaf\_ litter} } .. math:: + :label: 14.18) - \label{14.18)} NF_{froot,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{froot} }} \right. \kern-\nulldelimiterspace} CN_{froot} } .. math:: + :label: 14.19) - \label{14.19)} NF_{leaf,retrans} =\left({CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf} }} \right. \kern-\nulldelimiterspace} CN_{leaf} } \right)-NF_{leaf,litter} . where CN is C:N. @@ -182,7 +176,7 @@ case when stress signals are absent, and the vegetation shifts from a deciduous habit to an evergreen habit, until the next occurrence of an offset stress trigger . In that case, the regular onset flux mechanism is switched off and a background onset growth algorithm is invoked -(*r\ :math:`{}_{bgtr}`* :math:`>` 0). During this period, small fluxes +(:math:`{r}_{bgtr} > 0`). During this period, small fluxes of carbon and nitrogen from the storage pools into the associated transfer pools are calculated on each time step, and the entire contents of the transfer pool are added to the associated displayed growth pool @@ -190,65 +184,65 @@ on each time step. The carbon fluxes from transfer to display pools under these conditions are: .. math:: + :label: 14.20) - \label{14.20)} CF_{leaf\_ xfer,leaf} ={CS_{leaf\_ xfer} \mathord{\left/ {\vphantom {CS_{leaf\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.21) - \label{14.21)} CF_{froot\_ xfer,froot} ={CS_{froot\_ xfer} \mathord{\left/ {\vphantom {CS_{froot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.22) - \label{14.22)} CF_{livestem\_ xfer,livestem} ={CS_{livestem\_ xfer} \mathord{\left/ {\vphantom {CS_{livestem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.23) - \label{14.23)} CF_{deadstem\_ xfer,deadstem} ={CS_{deadstem\_ xfer} \mathord{\left/ {\vphantom {CS_{deadstem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.24) - \label{14.24)} CF_{livecroot\_ xfer,livecroot} ={CS_{livecroot\_ xfer} \mathord{\left/ {\vphantom {CS_{livecroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.25) - \label{14.25)} CF_{deadcroot\_ xfer,deadcroot} ={CS_{deadcroot\_ xfer} \mathord{\left/ {\vphantom {CS_{deadcroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} , and the corresponding nitrogen fluxes are: .. math:: + :label: 14.26) - \label{14.26)} NF_{leaf\_ xfer,leaf} ={NS_{leaf\_ xfer} \mathord{\left/ {\vphantom {NS_{leaf\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.27) - \label{14.27)} NF_{froot\_ xfer,froot} ={NS_{froot\_ xfer} \mathord{\left/ {\vphantom {NS_{froot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.28) - \label{14.28)} NF_{livestem\_ xfer,livestem} ={NS_{livestem\_ xfer} \mathord{\left/ {\vphantom {NS_{livestem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.29) - \label{14.29)} NF_{deadstem\_ xfer,deadstem} ={NS_{deadstem\_ xfer} \mathord{\left/ {\vphantom {NS_{deadstem\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.30) - \label{14.30)} NF_{livecroot\_ xfer,livecroot} ={NS_{livecroot\_ xfer} \mathord{\left/ {\vphantom {NS_{livecroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.31) - \label{14.31)} NF_{deadcroot\_ xfer,deadcroot} ={NS_{deadcroot\_ xfer} \mathord{\left/ {\vphantom {NS_{deadcroot\_ xfer} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} . 14.1.4 Background Litterfall @@ -261,34 +255,33 @@ referred to as background litterfall. For evergreen types the background litterfall is the only litterfall flux. For stress-deciduous types either the offset period litterfall or the background litterfall mechanism may be active, but not both at once. Given a specification of -the background litterfall rate (*r\ :math:`{}_{bglf}`*, -s\ :math:`{}^{-1}`), litterfall carbon fluxes are calculated as +the background litterfall rate (:math:`{r}_{bglf}`, s\ :sup:`-1`), litterfall carbon fluxes are calculated as .. math:: + :label: 14.32) - \label{14.32)} CF_{leaf,litter} =r_{bglf} CS_{leaf} .. math:: + :label: 14.33) - \label{14.33)} CS_{froot,litter} =r_{bglf} CS_{froot} , with corresponding nitrogen litterfall and retranslocation fluxes: .. math:: + :label: 14.34) - \label{14.34)} NF_{leaf,litter} ={CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf\_ litter} }} \right. \kern-\nulldelimiterspace} CN_{leaf\_ litter} } .. math:: + :label: 14.35) - \label{14.35)} NF_{froot,litter} ={CF_{froot,litter} \mathord{\left/ {\vphantom {CF_{froot,litter} CN_{froot} }} \right. \kern-\nulldelimiterspace} CN_{froot} } .. math:: + :label: 14.36) - \label{14.36)} NF_{leaf,retrans} =\left({CF_{leaf,litter} \mathord{\left/ {\vphantom {CF_{leaf,litter} CN_{leaf} }} \right. \kern-\nulldelimiterspace} CN_{leaf} } \right)-NF_{leaf,litter} . 14.1.5 Livewood Turnover @@ -305,48 +298,48 @@ effect the transfer of live wood to dead wood pools, which also takes into account the different nitrogen concentrations typical of these tissue types. -A live wood turnover rate (*r\ :math:`{}_{lwt}`*, s\ :math:`{}^{-1}`) is +A live wood turnover rate (:math:`{r}_{lwt}`, s\ :sup:`-1`) is defined as .. math:: + :label: 14.37) - \label{14.37)} r_{lwt} ={p_{lwt} \mathord{\left/ {\vphantom {p_{lwt} \left(365\cdot 86400\right)}} \right. \kern-\nulldelimiterspace} \left(365\cdot 86400\right)} -where *p\ :math:`{}_{lwt}`* = 0.7 is the assumed annual live wood +where :math:`{p}_{lwt} = 0.7` is the assumed annual live wood turnover fraction. Carbon fluxes from live to dead wood pools are: .. math:: + :label: 14.38) - \label{14.38)} CF_{livestem,deadstem} =CS_{livestem} r_{lwt} .. math:: + :label: 14.39) - \label{14.39)} CF_{livecroot,deadcroot} =CS_{livecroot} r_{lwt} , and the associated nitrogen fluxes, including retranslocation of nitrogen out of live wood during turnover, are: .. math:: + :label: 14.40) - \label{14.40)} NF_{livestem,deadstem} ={CF_{livestem,deadstem} \mathord{\left/ {\vphantom {CF_{livestem,deadstem} CN_{dw} }} \right. \kern-\nulldelimiterspace} CN_{dw} } .. math:: + :label: 14.41) - \label{14.41)} NF_{livestem,retrans} =\left({CF_{livestem,deadstem} \mathord{\left/ {\vphantom {CF_{livestem,deadstem} CN_{lw} }} \right. \kern-\nulldelimiterspace} CN_{lw} } \right)-NF_{livestem,deadstem} .. math:: + :label: 14.42) - \label{14.42)} NF_{livecroot,deadcroot} ={CF_{livecroot,deadcroot} \mathord{\left/ {\vphantom {CF_{livecroot,deadcroot} CN_{dw} }} \right. \kern-\nulldelimiterspace} CN_{dw} } .. math:: + :label: 14.43) - \label{14.43)} NF_{livecroot,retrans} =\left({CF_{livecroot,deadcroot} \mathord{\left/ {\vphantom {CF_{livecroot,deadcroot} CN_{lw} }} \right. \kern-\nulldelimiterspace} CN_{lw} } \right)-NF_{livecroot,deadcroot} . Evergreen Phenology @@ -355,7 +348,7 @@ Evergreen Phenology The evergreen phenology algorithm is by far the simplest of the three possible types. It is assumed for all evergreen types that all carbon and nitrogen allocated for new growth in the current timestep goes -immediately to the displayed growth pools (i.e. *f\ :math:`{}_{cur}`* = +immediately to the displayed growth pools (i.e. f\ :math:`{f}_{cur} = 1.0` (Chapter 13)). As such, there is never an accumulation of carbon or nitrogen in the storage or transfer pools, and so the onset growth and background onset growth mechanisms are never invoked for this type. @@ -366,13 +359,12 @@ roots. This is an obvious area for potential improvements in the model, since it is known, at least for evergreen needleleaf trees in the temperate and boreal zones, that there are distinct periods of higher and lower leaf litterfall (Ferrari, 1999; Gholz et al., 1985). The rate -of background litterfall (*r\ :math:`{}_{bglf}`*, section 14.1.4) -depends on the specified leaf longevity -(*:math:`\tau`\ :math:`{}_{leaf}`*, y), as +of background litterfall (:math:`{r}_{bglf}`, section 14.1.4) +depends on the specified leaf longevity (:math:`\tau_{leaf}`\ , y), as .. math:: + :label: 14.44) - \label{14.44)} r_{bglf} =\frac{1}{\tau _{leaf} \cdot 365\cdot 86400} . Seasonal-Deciduous Phenology @@ -394,16 +386,15 @@ of one onset period and one offset period each year. The algorithms for initiation of onset and offset periods use the winter and summer solstices as coordination signals. The period between winter -and summer solstice is identified as *dayl\ :math:`{}_{n}`* :math:`>` -*dayl\ :math:`{}_{n-1}`*, and the period between summer and winter -solstice is identified as *dayl\ :math:`{}_{n}`* :math:`<` -*dayl\ :math:`{}_{n-1}`*, where *dayl\ :math:`{}_{n}`* and -*dayl\ :math:`{}_{n-1}`* are the daylength (s) calculated for the +and summer solstice is identified as :math:`{dayl}_{n} > {dayl}_{n-1}`, +and the period between summer and winter +solstice is identified as :math:`{dayl}_{n} < {dayl}_{n-1}`, +where :math:`{dayl}_{n}` and :math:`{dayl}_{n-1}` are the day length(s) calculated for the current and previous timesteps, respectively, using .. math:: + :label: 14.45) - \label{14.45)} dayl=2\cdot 13750.9871\cdot acos\left(\frac{-\sin (lat)\sin (decl)}{\cos (lat)\cos (decl)} \right), where *lat* and *decl* are the latitude and solar declination (radians), @@ -415,124 +406,120 @@ radian of hour-angle. The onset trigger for the seasonal-deciduous phenology algorithm is based on an accumulated growing-degree-day approach (White et al., -1997). The growing-degree-day summation (*GDD\ :math:`{}_{sum}`*) is -initiated (*GDD\ :math:`{}_{sum}`* = 0) when the phenological state is +1997). The growing-degree-day summation (:math:`{GDD}_{sum}`) is +initiated ( :math:`{GDD}_{sum} = 0`) when the phenological state is dormant and the model timestep crosses the winter solstice. Once these -conditions are met, *GDD\ :math:`{}_{sum}`* is updated on each timestep -as +conditions are met, :math:`{GDD}_{sum}` is updated on each timestep as .. math:: + :label: ZEqnNum510730 - \label{ZEqnNum510730} GDD_{sum}^{n} =\left\{\begin{array}{l} {GDD_{sum}^{n-1} +\left(T_{s,3} -TKFRZ\right)f_{day} \qquad {\rm for\; }T_{s,3} >TKFRZ} \\ {GDD_{sum}^{n-1} \qquad \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \end{array}\right. -where *T\ :math:`{}_{s,3}`* (K) is the temperature of the third soil -layer, and +where :math:`{T}_{s,3}` (K) is the temperature of the third soil layer, and :math:`f_{day} ={\Delta t\mathord{\left/ {\vphantom {\Delta t 86400}} \right. \kern-\nulldelimiterspace} 86400}` . The onset period is initiated if :math:`GDD_{sum} >GDD_{sum\_ crit}` , where .. math:: + :label: ZEqnNum598907 - \label{ZEqnNum598907} GDD_{sum\_ crit} =\exp \left(4.8+0.13{\kern 1pt} \left(T_{2m,ann\_ avg} -TKFRZ\right)\right) -and where *T\ :math:`{}_{2m,ann\_avg}`* (K) is the annual average of -the 2m air temperature, and TKFRZ is the freezing point of water (273.15 -K). The following control variables are set when a new onset growth +and where :math:`{T}_{2m,ann\_avg}` (K) is the annual average of +the 2m air temperature, and TKFRZ is the freezing point of water (273.15 K). The following control variables are set when a new onset growth period is initiated: .. math:: + :label: 14.48) - \label{14.48)} GDD_{sum} =0 .. math:: + :label: 14.49) - \label{14.49)} t_{onset} =86400\cdot n_{days\_ on} , -where *n\ :math:`{}_{days\_on}`* is set to a constant value of 30 days. +where :math:`{n}_{days\_on}` is set to a constant value of 30 days. Fluxes from storage into transfer pools occur in the timestep when a new onset growth period is initiated. Carbon fluxes are: .. math:: + :label: ZEqnNum904388 - \label{ZEqnNum904388} CF_{leaf\_ stor,leaf\_ xfer} ={f_{stor,xfer} CS_{leaf\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{leaf\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.51) - \label{14.51)} CF_{froot\_ stor,froot\_ xfer} ={f_{stor,xfer} CS_{froot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{froot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.52) - \label{14.52)} CF_{livestem\_ stor,livestem\_ xfer} ={f_{stor,xfer} CS_{livestem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{livestem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.53) - \label{14.53)} CF_{deadstem\_ stor,deadstem\_ xfer} ={f_{stor,xfer} CS_{deadstem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{deadstem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.54) - \label{14.54)} CF_{livecroot\_ stor,livecroot\_ xfer} ={f_{stor,xfer} CS_{livecroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{livecroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.55) - \label{14.55)} CF_{deadcroot\_ stor,deadcroot\_ xfer} ={f_{stor,xfer} CS_{deadcroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{deadcroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: ZEqnNum195642 - \label{ZEqnNum195642} CF_{gresp\_ stor,gresp\_ xfer} ={f_{stor,xfer} CS_{gresp\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} CS_{gresp\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} and the associated nitrogen fluxes are: .. math:: + :label: ZEqnNum812152 - \label{ZEqnNum812152} NF_{leaf\_ stor,leaf\_ xfer} ={f_{stor,xfer} NS_{leaf\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{leaf\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.58) - \label{14.58)} NF_{froot\_ stor,froot\_ xfer} ={f_{stor,xfer} NS_{froot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{froot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.59) - \label{14.59)} NF_{livestem\_ stor,livestem\_ xfer} ={f_{stor,xfer} NS_{livestem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{livestem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.60) - \label{14.60)} NF_{deadstem\_ stor,deadstem\_ xfer} ={f_{stor,xfer} NS_{deadstem\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{deadstem\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 14.61) - \label{14.61)} NF_{livecroot\_ stor,livecroot\_ xfer} ={f_{stor,xfer} NS_{livecroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{livecroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: ZEqnNum605338 - \label{ZEqnNum605338} NF_{deadcroot\_ stor,deadcroot\_ xfer} ={f_{stor,xfer} NS_{deadcroot\_ stor} \mathord{\left/ {\vphantom {f_{stor,xfer} NS_{deadcroot\_ stor} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} -where *f\ :math:`{}_{stor,xfer}`* is the fraction of current storage +where :math:`{f}_{stor,xfer}` is the fraction of current storage pool moved into the transfer pool for display over the incipient onset period. This fraction is set to 0.5, based on the observation that seasonal deciduous trees are capable of replacing their canopies from storage reserves in the event of a severe early-season disturbance such as frost damage or defoliation due to insect herbivory. -If the onset criterion (*GDD\ :math:`{}_{sum}`* :math:`>` -*GDD\ :math:`{}_{sum\_crit}`*) is not met before the summer solstice, -then *GDD\ :math:`{}_{sum}`* is set to 0.0 and the growing-degree-day +If the onset criterion (:math:`{GDD}_{sum} > {GDD}_{sum\_crit}`) is not met before the summer solstice, +then :math:`{GDD}_{sum}` is set to 0.0 and the growing-degree-day accumulation will not start again until the following winter solstice. This mechanism prevents the initiation of very short growing seasons late in the summer in cold climates. The onset counter is decremented on @@ -540,8 +527,8 @@ each time step after initiation of the onset period, until it reaches zero, signaling the end of the onset period: .. math:: + :label: 14.63) - \label{14.63)} t_{onfset}^{n} =t_{onfset}^{n-1} -\Delta t 14.3.2 Seasonal-Deciduous Offset Trigger @@ -551,14 +538,14 @@ After the completion of an onset period, and once past the summer solstice, the offset (litterfall) period is triggered when daylength is shorter than 39300 s. The offset counter is set at the initiation of the offset period: :math:`t_{offset} =86400\cdot n_{days\_ off}` , where -*n\ :math:`{}_{days\_off}`* is set to a constant value of 15 days. The +:math:`{n}_{days\_off}` is set to a constant value of 15 days. The offset counter is decremented on each time step after initiation of the offset period, until it reaches zero, signaling the end of the offset period: .. math:: + :label: 14.64) - \label{14.64)} t_{offset}^{n} =t_{offset}^{n-1} -\Delta t Stress-Deciduous Phenology @@ -581,22 +568,21 @@ the next stress trigger. In climates that are warm year-round, onset triggering depends on soil water availability. At the beginning of a dormant period (end of previous offset period), an accumulated soil water index -(*SWI\ :math:`{}_{sum}`*, d) is initialized (*SWI\ :math:`{}_{sum}`* = -0), with subsequent accumulation calculated as: +(:math:`{SWI}_{sum}`, d) is initialized (:math:`{SWI}_{sum} = 0`), with subsequent accumulation calculated as: .. math:: + :label: ZEqnNum503826 - \label{ZEqnNum503826} SWI_{sum}^{n} =\left\{\begin{array}{l} {SWI_{sum}^{n-1} +f_{day} \qquad {\rm for\; }\Psi _{s,3} \ge \Psi _{onset} } \\ {SWI_{sum}^{n-1} \qquad \qquad {\rm for\; }\Psi _{s,3} <\Psi _{onset} } \end{array}\right. -where :math:`\Psi`\ *:math:`{}_{s,3}`* is the soil water potential (MPa) -in the third soil layer and :math:`\Psi`\ *:math:`{}_{onset}`* = -2 MPa +where :math:`\Psi`\ :sub:`s,3` is the soil water potential (MPa) +in the third soil layer and :math:`{\Psi}_{onset} = -2 MPa` is the onset soil water potential threshold. Onset triggering is -possible once *SWI\ :math:`{}_{sum}`* :math:`>` 15. If the cold climate +possible once :math:`{SWI}_{sum} > 15`. If the cold climate growing degree-day accumulator is not active at the time when this threshold is reached (see below), and if the daylength is greater than 6 hours, then onset is triggered. Except as noted below, -*SWI\ :math:`{}_{sum}`* continues to accumulate according to Eq. during +:math:`{SWI}_{sum}` continues to accumulate according to Eq. during the dormant period if the daylength criterion prevents onset triggering, and onset is then triggered at the timestep when daylength exceeds 6 hours. @@ -604,37 +590,32 @@ hours. In climates with a cold season, onset triggering depends on both accumulated soil temperature summation and adequate soil moisture. At the beginning of a dormant period a freezing day accumulator -(*FD\ :math:`{}_{sum}`*, d) is initialized (*FD\ :math:`{}_{sum}`* = 0), +(:math:`{FD}_{sum}`, d) is initialized (:math:`{FD}_{sum} = 0`), with subsequent accumulation calculated as: .. math:: + :label: 14.66) - \label{14.66)} FD_{sum}^{n} =\left\{\begin{array}{l} {FD_{sum}^{n-1} +f_{day} \qquad {\rm for\; }T_{s,3} >TKFRZ} \\ {FD_{sum}^{n-1} \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \end{array}\right. . -If *FD\ :math:`{}_{sum}`* :math:`>` 15 during the dormant period, then a +If :math:`{FD}_{sum} > 15` during the dormant period, then a cold-climate onset triggering criterion is introduced, following exactly -the growing degree-day summation (*GDD\ :math:`{}_{sum}`*) logic of Eqs. -and . At that time *SWI\ :math:`{}_{sum}`* is reset -(*SWI\ :math:`{}_{sum}`* = 0). Onset triggering under these conditions +the growing degree-day summation (:math:`{GDD}_{sum}`) logic of Eqs. +and . At that time :math:`{SWI}_{sum}` is reset +(:math:`{SWI}_{sum} = 0`). Onset triggering under these conditions depends on meeting all three of the following criteria: -*SWI\ :math:`{}_{sum}`* :math:`>` 15, *GDD\ :math:`{}_{sum}`* :math:`>` -*GDD\ :math:`{}_{sum\_crit}`*, and daylength greater than 6 hrs. +:math:`{SWI}_{sum} > 15`, :math:`{GDD}_{sum} > {GDD}_{sum\_crit}`, and daylength greater than 6 hrs. The following control variables are set when a new onset growth period -is initiated: *SWI\ :math:`{}_{sum}`* = 0, *FD\ :math:`{}_{sum}`* = 0, -*GDD\ :math:`{}_{sum}`* = 0, *n\ :math:`{}_{days\_active}`* = 0, and -:math:`t_{onset} =86400\cdot n_{days\_ on}` , where -*n\ :math:`{}_{days\_on}`* is set to a constant value of 30 days. Fluxes -from storage into transfer pools occur in the timestep when a new onset -growth period is initiated, and are handled identically to Eqs. - for -carbon fluxes, and to Eqs. - for nitrogen fluxes. The onset counter is -decremented on each time step after initiation of the onset period, +is initiated: :math:`{SWI}_{sum} = 0`, :math:`{FD}_{sum} = 0`, :math:`{GDD}_{sum} = 0`, :math:`{n}_{days\_active} = 0`, and +:math:`t_{onset} = 86400\cdot n_{days\_ on}` , where :math:`{n}_{days\_on}` is set to a constant value of 30 days. Fluxes +from storage into transfer pools occur in the timestep when a new onset growth period is initiated, and are handled identically to Eqs. - for +carbon fluxes, and to Eqs. - for nitrogen fluxes. The onset counter is decremented on each time step after initiation of the onset period, until it reaches zero, signaling the end of the onset period: .. math:: + :label: 14.67) - \label{14.67)} t_{onfset}^{n} =t_{onfset}^{n-1} -\Delta t 14.4.2 Stress-Deciduous Offset Triggers @@ -646,44 +627,43 @@ period of dry soil, sustained period of cold temperature, or daylength shorter than 6 hours. Offset triggering due to dry soil or cold temperature conditions is only allowed once the most recent onset period is complete. Dry soil condition is evaluated with an offset soil water -index accumulator (*OSWI\ :math:`{}_{sum}`*, d). To test for a sustained +index accumulator (:math:`{OSWI}_{sum}`, d). To test for a sustained period of dry soils, this control variable can increase or decrease, as follows: .. math:: + :label: 14.68) - \label{14.68)} OSWI_{sum}^{n} =\left\{\begin{array}{l} {OSWI_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }\Psi _{s,3} \le \Psi _{offset} } \\ {{\rm max}\left(OSWI_{sum}^{n-1} -f_{day} ,0\right)\qquad {\rm for\; }\Psi _{s,3} >\Psi _{onset} } \end{array}\right. -where :math:`\Psi`\ *:math:`{}_{offset}`* = -2 MPa is the offset soil +where :math:`{\Psi}_{offset} = -2 MPa` is the offset soil water potential threshold. An offset period is triggered if the previous -onset period is complete and *OSWI\ :math:`{}_{sum}`* -:math:`\mathrm{\ge}` *OSWI\ :math:`{}_{sum\_crit}`*, where -*OSWI\ :math:`{}_{sum\_crit}`* = 15. +onset period is complete and :math:`{OSWI}_{sum}` +:math:`\mathrm{\ge}` :math:`{OSWI}_{sum\_crit}`, where :math:`{OSWI}_{sum\_crit} = 15`. The cold temperature trigger is calculated with an offset freezing day -accumulator (*OFD\ :math:`{}_{sum}`*, d). To test for a sustained period +accumulator (:math:`{OFD}_{sum}`, d). To test for a sustained period of cold temperature, this variable can increase or decrease, as follows: .. math:: + :label: 14.69) - \label{14.69)} OFD_{sum}^{n} =\left\{\begin{array}{l} {OFD_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \\ {{\rm max}\left(OFD_{sum}^{n-1} -f_{day} ,0\right)\qquad \qquad {\rm for\; }T_{s,3} >TKFRZ} \end{array}\right. An offset period is triggered if the previous onset period is complete -and *OFD\ :math:`{}_{sum}`* :math:`>` *OFD\ :math:`{}_{sum\_crit}`*, -where *OFD\ :math:`{}_{sum\_crit}`* = 15. +and :math:`{OFD}_{sum} > {OFD}_{sum\_crit}`, +where :math:`{OFD}_{sum\_crit} = 15`. The offset counter is set at the initiation of the offset period: :math:`t_{offset} =86400\cdot n_{days\_ off}` , where -*n\ :math:`{}_{days\_off}`* is set to a constant value of 15 days. The +:math:`{n}_{days\_off}` is set to a constant value of 15 days. The offset counter is decremented on each time step after initiation of the offset period, until it reaches zero, signaling the end of the offset period: .. math:: + :label: 14.70) - \label{14.70)} t_{offset}^{n} =t_{offset}^{n-1} -\Delta t 14.4.3 Stress-Deciduous: Long Growing Season @@ -695,99 +675,94 @@ shifts toward the evergreen behavior. This can happen in cases where a stress-deciduous vegetation type is assigned in a climate where suitably strong stresses occur less frequently than once per year. This condition is evaluated by tracking the number of days since the beginning of the -most recent onset period (*n\ :math:`{}_{days\_active}`*, d). At the end -of an offset period *n\ :math:`{}_{days\_active}`* is reset to 0. A long +most recent onset period (:math:`{n}_{days\_active}`, d). At the end +of an offset period :math:`{n}_{days\_active}` is reset to 0. A long growing season control variable (*LGS*, range 0 to 1) is calculated as: .. math:: + :label: 14.71) - \label{14.71)} LGS=\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }n_{days\_ active} <365} \\ {\left({n_{days\_ active} \mathord{\left/ {\vphantom {n_{days\_ active} 365}} \right. \kern-\nulldelimiterspace} 365} \right)-1\qquad {\rm for\; }365\le n_{days\_ active} <730} \\ {1\qquad \qquad \qquad {\rm for\; }n_{days\_ active} \ge 730} \end{array}\right. . -The rate coefficient for background litterfall (*r\ :math:`{}_{bglf}`*, -s\ :math:`{}^{-1}`) is calculated as a function of *LGS*: +The rate coefficient for background litterfall (:math:`{r}_{bglf}`, s\ :sup:`-1`) is calculated as a function of *LGS*: .. math:: + :label: 14.72) - \label{14.72)} r_{bglf} =\frac{LGS}{\tau _{leaf} \cdot 365\cdot 86400} -where *:math:`\tau`\ :math:`{}_{leaf}`* is the leaf longevity. The -result is a shift to continuous litterfall as -*n\ :math:`{}_{days\_active}`* increases from 365 to 730. When a new -offset period is triggered *r\ :math:`{}_{bglf}`* is set to 0. +where :math:`{\tau}_{leaf}` is the leaf longevity. The result is a shift to continuous litterfall as +:math:`{n}_{days\_active}` increases from 365 to 730. When a new offset period is triggered :math:`{r}_{bglf}` is set to 0. -The rate coefficient for background onset growth from the transfer pools -(*r\ :math:`{}_{bgtr}`*, s\ :math:`{}^{-1}`) also depends on *LGS*, as: +The rate coefficient for background onset growth from the transfer pools ( :math:`{r}_{bgtr}`, s\ :sup:`-1`) also depends on *LGS*, as: .. math:: + :label: 14.73) - \label{14.73)} r_{bgtr} =\frac{LGS}{365\cdot 86400} . -On each timestep with *r\ :math:`{}_{bgtr}`* :math:`\neq` 0, carbon -fluxes from storage to transfer pools are calculated as: +On each timestep with :math:`{r}_{bgtr}` :math:`\neq` 0, carbon fluxes from storage to transfer pools are calculated as: .. math:: + :label: 14.74) - \label{14.74)} CF_{leaf\_ stor,leaf\_ xfer} =CS_{leaf\_ stor} r_{bgtr} .. math:: + :label: 14.75) - \label{14.75)} CF_{froot\_ stor,froot\_ xfer} =CS_{froot\_ stor} r_{bgtr} .. math:: + :label: 14.76) - \label{14.76)} CF_{livestem\_ stor,livestem\_ xfer} =CS_{livestem\_ stor} r_{bgtr} .. math:: + :label: 14.77) - \label{14.77)} CF_{deadstem\_ stor,deadstem\_ xfer} =CS_{deadstem\_ stor} r_{bgtr} .. math:: + :label: 14.78) - \label{14.78)} CF_{livecroot\_ stor,livecroot\_ xfer} =CS_{livecroot\_ stor} r_{bgtr} .. math:: + :label: 14.79) - \label{14.79)} CF_{deadcroot\_ stor,deadcroot\_ xfer} =CS_{deadcroot\_ stor} r_{bgtr} , with corresponding nitrogen fluxes: .. math:: + :label: 14.80) - \label{14.80)} NF_{leaf\_ stor,leaf\_ xfer} =NS_{leaf\_ stor} r_{bgtr} .. math:: + :label: 14.81) - \label{14.81)} NF_{froot\_ stor,froot\_ xfer} =NS_{froot\_ stor} r_{bgtr} .. math:: + :label: 14.82) - \label{14.82)} NF_{livestem\_ stor,livestem\_ xfer} =NS_{livestem\_ stor} r_{bgtr} .. math:: + :label: 14.83) - \label{14.83)} NF_{deadstem\_ stor,deadstem\_ xfer} =NS_{deadstem\_ stor} r_{bgtr} .. math:: + :label: 14.84) - \label{14.84)} NF_{livecroot\_ stor,livecroot\_ xfer} =NS_{livecroot\_ stor} r_{bgtr} .. math:: + :label: 14.85) - \label{14.85)} NF_{deadcroot\_ stor,deadcroot\_ xfer} =NS_{deadcroot\_ stor} r_{bgtr} . The result, in conjunction with the treatment of background onset @@ -795,7 +770,7 @@ growth, is a shift to continuous transfer from storage to display pools at a rate that would result in complete turnover of the storage pools in one year at steady state, once *LGS* reaches 1 (i.e. after two years without stress-deciduous offset conditions). If and when conditions -cause stress-deciduous triggering again, *r\ :math:`{}_{bgtr}`* is rest +cause stress-deciduous triggering again, :math:`{r}_{bgtr}` is rest to 0. Litterfall Fluxes Merged to the Column Level @@ -813,75 +788,74 @@ calculated using a weighted average of the fluxes originating at the PFT level. Carbon fluxes are calculated as: .. math:: + :label: 14.86) - \label{14.86)} CF_{leaf,lit1} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} .. math:: + :label: 14.87) - \label{14.87)} CF_{leaf,lit2} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} .. math:: + :label: 14.88) - \label{14.88)} CF_{leaf,lit3} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} .. math:: + :label: 14.89) - \label{14.89)} CF_{froot,lit1} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lab\_ froot,p} wcol_{p} .. math:: + :label: 14.90) - \label{14.90)} CF_{froot,lit2} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{cel\_ froot,p} wcol_{p} .. math:: + :label: 14.91) - \label{14.91)} CF_{froot,lit3} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lig\_ froot,p} wcol_{p} , -where *f\ :math:`{}_{lab\_leaf,p}`*, *f\ :math:`{}_{cel\_leaf,p}`*, and -*f\ :math:`{}_{lig\_leaf,p}`* are the labile, cellulose/hemicellulose, +where :math:`{f}_{lab\_leaf,p}`, :math:`{f}_{cel\_leaf,p}`, and +:math:`{f}_{lig\_leaf,p}` are the labile, cellulose/hemicellulose, and lignin fractions of leaf litter for PFT *p*, -*f\ :math:`{}_{lab\_froot,p}`*, *f\ :math:`{}_{cel\_froot,p}`*, and -*f\ :math:`{}_{lig\_froot,p}`* are the labile, cellulose/hemicellulose, +:math:`{f}_{lab\_froot,p}`, :math:`{f}_{cel\_froot,p}`, and +:math:`{f}_{lig\_froot,p}` are the labile, cellulose/hemicellulose, and lignin fractions of fine root litter for PFT *p*, -*wtcol\ :math:`{}_{p}`* is the weight relative to the column for PFT +:math:`{wtcol}_{p}` is the weight relative to the column for PFT *p*, and *p* is an index through the plant functional types occurring on a column. Nitrogen fluxes to the litter pools are assumed to follow the C:N of the senescent tissue, and so are distributed using the same fractions used for carbon fluxes: .. math:: + :label: 14.92) - \label{14.92)} NF_{leaf,lit1} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} .. math:: + :label: 14.93) - \label{14.93)} NF_{leaf,lit2} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} .. math:: + :label: 14.94) - \label{14.94)} NF_{leaf,lit3} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} .. math:: + :label: 14.95) - \label{14.95)} NF_{froot,lit1} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lab\_ froot,p} wcol_{p} .. math:: + :label: 14.96) - \label{14.96)} NF_{froot,lit2} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{cel\_ froot,p} wcol_{p} .. math:: + :label: 14.97) - \label{14.97)} NF_{froot,lit3} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lig\_ froot,p} wcol_{p} . -.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst b/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst index eefab609fb..89e12a7b94 100644 --- a/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst +++ b/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst @@ -3,16 +3,16 @@ Decomposition Decomposition of fresh litter material into progressively more recalcitrant forms of soil organic matter is represented in CLM is -defined as a cascade of *k\ :math:`{}_{tras}`* transformations between -*m\ :math:`{}_{pool}`* decomposing coarse woody debris (CWD), litter, +defined as a cascade of :math:`{k}_{tras}` transformations between +:math:`{m}_{pool}` decomposing coarse woody debris (CWD), litter, and soil organic matter (SOM) pools, each defined at -*n\ :math:`{}_{lev}`* vertical levels. CLM allows the user to define, at +:math:`{n}_{lev}` vertical levels. CLM allows the user to define, at compile time, between 2 contrasting hypotheses of decomposition as embodied by two separate decomposition submodels: the CLM-CN pool structure used in CLM4.0, or a second pool structure, characterized by slower decomposition rates, based on the Century model (Parton et al. 1988). In addition, the user can choose, at compile time, whether to -allow *n\ :math:`{}_{lev}`* to equal 1, as in CLM4.0, or to equal the +allow :math:`{n}_{lev}` to equal 1, as in CLM4.0, or to equal the number of soil levels used for the soil hydrology (default 10). Figure 15.1. Schematic of decomposition model in CLM. @@ -21,41 +21,40 @@ Model is structured to allow different representations of the soil C and N decomposition cascade, as well as a vertically-explicit treatment of soil biogeochemistry. -|image| +.. image:: image1.png For the single-level model structure, the fundamental equation for carbon balance of the decomposing pools is: .. math:: + :label: 15.1) - \label{15.1)} \frac{\partial C_{i} }{\partial t} =R_{i} +\sum _{j\ne i}\left(i-r_{j} \right)T_{ji} k_{j} C_{j} -k_{i} C_{i} -where *C\ :math:`{}_{i}`* is the carbon content of pool *i*, -*R\ :math:`{}_{i}`* are the carbon inputs from plant tissues directly to -pool *i* (only non-zero for CWD and litter pools), *k\ :math:`{}_{i}`* -is the decay constant of pool *i*; *T\ :math:`{}_{ji}`* is the fraction +where :math:`{C}_{i}` is the carbon content of pool *i*, +:math:`{R}_{i}` are the carbon inputs from plant tissues directly to +pool *i* (only non-zero for CWD and litter pools), :math:`{k}_{i}` +is the decay constant of pool *i*; :math:`{T}_{ji}` is the fraction of carbon directed from pool *j* to pool *i* with fraction -*r\ :math:`{}_{j}`* lost as a respiration flux along the way. +:math:`{r}_{j}` lost as a respiration flux along the way. Adding the vertical dimension to the decomposing pools changes the balance equation to the following: .. math:: + :label: 15.2) - \label{15.2)} \begin{array}{l} {\frac{\partial C_{i} (z)}{\partial t} =R_{i} (z)+\sum _{i\ne j}\left(1-r_{j} \right)T_{ji} k_{j} (z)C_{j} (z) -k_{i} (z)C_{i} (z)} \\ {+\frac{\partial }{\partial z} \left(D(z)\frac{\partial C_{i} }{\partial z} \right)+\frac{\partial }{\partial z} \left(A(z)C_{i} \right)} \end{array} -where *C\ :math:`{}_{i}`\ (z)* is now defined at each model level, and -in volumetric (gC m\ :math:`{}^{-3}`) rather than areal (gC -m\ :math:`{}^{-2}`) units, along with *R\ :math:`{}_{i}`\ (z)* and -*k\ :math:`{}_{j}`\ (z)*. In addition, vertical transport is handled by +where :math:`{C}_{i}`\ (z) is now defined at each model level, and +in volumetric (gC m\ :sup:`-3`) rather than areal (gC m\ :sup:`-2`) units, along with :math:`{R}_{i}`\ (z) and +:math:`{k}_{j}`\ (z). In addition, vertical transport is handled by the last two terms, for diffusive and advective transport. In the base model, advective transport is set to zero, leaving only a diffusive flux with diffusivity *D(z)* defined for all decomposing carbon and nitrogen pools. Further discussion of the vertical distribution of carbon inputs -*R\ :math:`{}_{i}`\ (z)*, vertical turnover times -*k\ :math:`{}_{j}`\ (z)*, and vertical transport *D(z)* is below. +:math:`{R}_{i}`\ (z), vertical turnover times +:math:`{k}_{j}`\ (z), and vertical transport *D(z)* is below. Discussion of the vertical model and analysis of both decomposition structures is in Koven et al (2013). @@ -63,7 +62,7 @@ Figure 15.2. Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. -|image| +.. image:: image2.png CLM-CN Pool Structure, Rate Constants and Parameters --------------------------------------------------------- @@ -100,52 +99,52 @@ for the CLM-CN decomposition pool structure. +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ | | Biome-BGC | CLM-CN | | | +==========================+================================================+===============================================+===============+=========================================+ -| | *k\ :math:`{}_{disc1 }`*\ (d:math:`{}^{-1}`) | *k\ :math:`{}_{disc2}`* (hr:math:`{}^{-1}`) | *C:N ratio* | *Acceleration term (a:math:`{}_{i}`)* | +| | :math:`{k}_{disc1}`\ (d\ :sup:`-1`) | :math:`{k}_{disc2}` (hr\ :sup:`-1`) | *C:N ratio* | Acceleration term (:math:`{a}_{i}`) | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{Lit1}`* | 0.7 | 0.04892 | - | 1 | +| :math:`{k}_{Lit1}` | 0.7 | 0.04892 | - | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{Lit2}`* | 0.07 | 0.00302 | - | 1 | +| :math:`{k}_{Lit2}` | 0.07 | 0.00302 | - | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{Lit3}`* | 0.014 | 0.00059 | - | 1 | +| :math:`{k}_{Lit3}` | 0.014 | 0.00059 | - | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{SOM1}`* | 0.07 | 0.00302 | 12 | 1 | +| :math:`{k}_{SOM1}` | 0.07 | 0.00302 | 12 | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{SOM2}`* | 0.014 | 0.00059 | 12 | 1 | +| :math:`{k}_{SOM2}` | 0.014 | 0.00059 | 12 | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{SOM3}`* | 0.0014 | 0.00006 | 10 | 5 | +| :math:`{k}_{SOM3}` | 0.0014 | 0.00006 | 10 | 5 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{SOM4}`* | 0.0001 | 0.000004 | 10 | 70 | +| :math:`{k}_{SOM4}` | 0.0001 | 0.000004 | 10 | 70 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| *k\ :math:`{}_{CWD}`* | 0.001 | 0.00004 | - | 1 | +| :math:`{k}_{CWD}` | 0.001 | 0.00004 | - | 1 | +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ The first column of Table 15.1 gives the rates as used for the Biome-BGC model, which uses a discrete-time model with a daily timestep. The second column of Table 15.1 shows the rates transformed for a one-hour discrete timestep typical of CLM-CN. The transformation is based on the -conversion of the initial discrete-time value (*k\ :math:`{}_{disc1}`*) -first to a continuous time value (*k\ :math:`{}_{cont}`*), then to the +conversion of the initial discrete-time value (:math:`{k}_{disc1}`) +first to a continuous time value (:math:`{k}_{cont}`), then to the new discrete-time value with a different timestep -(*k\ :math:`{}_{disc2}`*) , following Olson (1963): +(:math:`{k}_{disc2}`) , following Olson (1963): .. math:: + :label: ZEqnNum608251 - \label{ZEqnNum608251} k_{cont} =-\log \left(1-k_{disc1} \right) .. math:: + :label: ZEqnNum772630 - \label{ZEqnNum772630} k_{disc2} =1-\exp \left(-k_{cont} \frac{\Delta t_{2} }{\Delta t_{1} } \right) -where :math:`\Delta`\ *t\ :math:`{}_{1}`* (s) and -:math:`\Delta`\ *t\ :math:`{}_{2}`* (s) are the time steps of the +where :math:`\Delta`\ :math:`{t}_{1}` (s) and +:math:`\Delta`\ t\ :sub:`2` (s) are the time steps of the initial and new discrete-time models, respectively. Respiration fractions are parameterized for decomposition fluxes out of each litter and SOM pool. The respiration fraction (*rf*, unitless) is the fraction of the decomposition carbon flux leaving one of the litter -or SOM pools that is released as CO\ :math:`{}_{2}` due to heterotrophic +or SOM pools that is released as CO\ :sub:`2` due to heterotrophic respiration. Respiration fractions and exponential decay rates are estimated simultaneously from the results of microcosm decomposition experiments (Thornton, 1998). The same values are used in CLM-CN and @@ -156,24 +155,24 @@ Table 15.2. Respiration fractions for litter and SOM pools +---------------------------+-----------------------+ | Pool | *rf* | +===========================+=======================+ -| *rf\ :math:`{}_{Lit1}`* | 0.39 | +| :math:`{rf}_{Lit1}` | 0.39 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{Lit2}`* | 0.55 | +| :math:`{rf}_{Lit2}` | 0.55 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{Lit3}`* | 0.29 | +| :math:`{rf}_{Lit3}` | 0.29 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{SOM1}`* | 0.28 | +| :math:`{rf}_{SOM1}` | 0.28 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{SOM2}`* | 0.46 | +| :math:`{rf}_{SOM2}` | 0.46 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{SOM3}`* | 0.55 | +| :math:`{rf}_{SOM3}` | 0.55 | +---------------------------+-----------------------+ -| *rf\ :math:`{}_{SOM4}`* | 1.0\ :math:`{}^{a}` | +| :math:`{rf}_{SOM4}` | :math:`{1.0}^{a}` | +---------------------------+-----------------------+ -:math:`{}^{a}` The respiration fraction for pool SOM4 is 1.0 by +:sup:`a`:math:`{}^{a}` The respiration fraction for pool SOM4 is 1.0 by definition: since there is no pool downstream of SOM4, the entire carbon -flux leaving this pool is assumed to be respired as CO\ :math:`{}_{2}`. +flux leaving this pool is assumed to be respired as CO\ :sub:`2`. Century-based Pool Structure, Rate Constants and Parameters ---------------------------------------------------------------- @@ -190,7 +189,7 @@ section 15.8 for explanation) for the Century-based decomposition cascade. +------------+------------------------+-------------+-------------------------------------------+ -| | Turnover time (year) | C:N ratio | Acceleration term (*a\ :math:`{}_{i}`*) | +| | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | +============+========================+=============+===========================================+ | CWD | 4.1 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ @@ -207,26 +206,24 @@ cascade. | SOM 3 | 270 | 11 | 675 | +------------+------------------------+-------------+-------------------------------------------+ -Likewise, values for the respiration fraction of Century-based structure -are in Table 15.4. +Likewise, values for the respiration fraction of Century-based structure are in Table 15.4. -Table 15.4. Respiration fractions for litter and SOM pools for -Century-based structure +Table 15.4. Respiration fractions for litter and SOM pools for Century-based structure +---------------------------+----------+ | Pool | *rf* | +===========================+==========+ -| *rf\ :math:`{}_{Lit1}`* | 0.55 | +| :math:`{rf}_{Lit1}` | 0.55 | +---------------------------+----------+ -| *rf\ :math:`{}_{Lit2}`* | 0.5 | +| :math:`{rf}_{Lit2}` | 0.5 | +---------------------------+----------+ -| *rf\ :math:`{}_{Lit3}`* | 0.5 | +| :math:`{rf}_{Lit3}` | 0.5 | +---------------------------+----------+ -| *rf\ :math:`{}_{SOM1}`* | f(txt) | +| :math:`{rf}_{SOM1}` | f(txt) | +---------------------------+----------+ -| *rf\ :math:`{}_{SOM2}`* | 0.55 | +| :math:`{rf}_{SOM2}` | 0.55 | +---------------------------+----------+ -| *rf\ :math:`{}_{SOM3}`* | 0.55 | +| :math:`{rf}_{SOM3}` | 0.55 | +---------------------------+----------+ Environmental modifiers on decomposition rate @@ -234,48 +231,46 @@ Environmental modifiers on decomposition rate These base rates are modified on each timestep by functions of the current soil environment. For the single-level model, there are two rate -modifiers, temperature (*r\ :math:`{}_{tsoil}`*, unitless) and moisture -(*r\ :math:`{}_{water}`*, unitless), both of which are calculated using +modifiers, temperature (:math:`{r}_{tsoil}`, unitless) and moisture +(:math:`{r}_{water}`, unitless), both of which are calculated using the average environmental conditions of the top five model levels (top 29 cm of soil column). For the vertically-resolved model, two additional environmental modifiers are calculated beyond the temperature and -moisture limitations: an oxygen scalar (*r\ :math:`{}_{oxygen}`*, -unitless), and a depth scalar (*r\ :math:`{}_{depth}`*, unitless). +moisture limitations: an oxygen scalar (:math:`{r}_{oxygen}`, +unitless), and a depth scalar (:math:`{r}_{depth}`, unitless). -The Temperature scalar *r\ :math:`{}_{tsoil}`* is calculated in CLM -using a *Q\ :math:`{}_{10}`* approach, with *Q\ :math:`{}_{10}`\ =1.5:* +The Temperature scalar :math:`{r}_{tsoil}` is calculated in CLM +using a :math:`{Q}_{10}` approach, with :math:`{Q}_{10} = 1.5`. .. math:: + :label: 15.5) - \label{15.5)} r_{tsoil} =Q_{10} ^{\left(\frac{T_{soil,\, j} -T_{ref} }{10} \right)} -where *j* is the soil layer index, *T\ :math:`{}_{soil,j}`* (K) is the -temperature of soil level *j*. The reference temperature -*T\ :math:`{}_{ref}`* = 25C. +where *j* is the soil layer index, :math:`{T}_{soil,j}` (K) is the +temperature of soil level *j*. The reference temperature :math:`{T}_{ref}` = 25C. -The rate scalar for soil water potential (*r\ :math:`{}_{water}`*, +The rate scalar for soil water potential (:math:`{r}_{water}`, unitless) is calculated using a relationship from Andrén and Paustian (1987) and supported by additional data in Orchard and Cook (1983): .. math:: + :label: 15.6) - \label{15.6)} r_{water} =\sum _{j=1}^{5}\left\{\begin{array}{l} {0\qquad {\rm for\; }\Psi _{j} <\Psi _{\min } } \\ {\frac{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{j} }} \right. \kern-\nulldelimiterspace} \Psi _{j} } \right)}{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{\max } }} \right. \kern-\nulldelimiterspace} \Psi _{\max } } \right)} w_{soil,\, j} \qquad {\rm for\; }\Psi _{\min } \le \Psi _{j} \le \Psi _{\max } } \\ {1\qquad {\rm for\; }\Psi _{j} >\Psi _{\max } \qquad \qquad } \end{array}\right\} -where :math:`\Psi`\ *:math:`{}_{j}`* is the soil water potential in -layer *j*, :math:`\Psi`\ *:math:`{}_{min}`* is a lower limit for soil +where :math:`{\Psi}_{j}` is the soil water potential in +layer *j*, :math:`{\Psi}_{min}` is a lower limit for soil water potential control on decomposition rate (set to -10 MPa). -:math:`\Psi`\ *:math:`{}_{sat,j}`* (MPa) is the saturated soil water -potential, calculated using the multivariate regression model from Cosby -et al. (1984): +:math:`{\Psi}_{sat,j}` (MPa) is the saturated soil water +potential, calculated using the multivariate regression model from Cosby et al. (1984): .. math:: + :label: 15.7) - \label{15.7)} \Psi _{sat,\, j} =-\left(9.8e-5\right)\exp \left(\left(1.54-0.0095P_{sand,\, j} +0.0063\left(100-P_{sand,\, j} -P_{clay,\, j} \right)\right)\log \left(10\right)\right) -where *P\ :math:`{}_{sand,j}`* and *P\ :math:`{}_{clay,j}`* are the +where :math:`{P}_{sand,j}` and :math:`{P}_{clay,j}` are the volume percentages of sand and clay in soil layer *j*. For frozen soils, the bulk of the rapid dropoff in decomposition with @@ -284,32 +279,32 @@ potential is limited by temperature in the supercooled water formulation of Niu and Yang (2006), .. math:: + :label: 15.8) - \label{15.8)} \psi \left(T\right)=-\frac{L_{f} \left(T-T_{f} \right)}{10^{3} T} An additional frozen decomposition limitation can be specified using a -‘frozen Q\ :math:`{}_{10}`’ following Koven et al. (2011), however the -default value of this is the same as the unfrozen Q\ :math:`{}_{10}` +‘frozen Q\ :sub:`10` following Koven et al. (2011), however the +default value of this is the same as the unfrozen Q\ :sub:`10` value, and therefore the basic hypothesis is that frozen respiration is limited by liquid water availability, and can be modeled following the same approach as thawed but dry soils. -An additional rate scalar, *r\ :math:`{}_{oxygen}`* is enabled when the -CH\ :math:`{}_{4}` submodel is used (set equal to 1 for the single layer -model or when the CH\ :math:`{}_{4}` submodel is disabled). This limits +An additional rate scalar, :math:`{r}_{oxygen}` is enabled when the +CH\ :sub:`4` submodel is used (set equal to 1 for the single layer +model or when the CH\ :sub:`4` submodel is disabled). This limits decomposition when there is insufficient molecular oxygen to satisfy -stoichiometric demand (1 mol O\ :math:`{}_{2}` consumed per mol -CO\ :math:`{}_{2}` produced) from heterotrophic decomposers, and supply +stoichiometric demand (1 mol O\ :sub:`2` consumed per mol +CO\ :sub:`2` produced) from heterotrophic decomposers, and supply from diffusion through soil layers (unsaturated and saturated) or -aerenchyma (Chapter 19). A minimum value of *r\ :math:`{}_{oxygen}`* is +aerenchyma (Chapter 19). A minimum value of :math:`{r}_{oxygen}` is set at 0.2, with the assumption that oxygen within organic tissues can supply the necessary stoichiometric demand at this rate. This value lies between estimates of 0.025–0.1 (Frolking et al. 2001), and 0.35 (Wania et al. 2009); the large range of these estimates poses a large unresolved uncertainty. -Lastly, a possible explicit depth dependence, *r\ :math:`{}_{depth}`*, +Lastly, a possible explicit depth dependence, :math:`{r}_{depth}`, (set equal to 1 for the single layer model) can be applied to soil C decomposition rates to account for processes other than temperature, moisture, and anoxia that can limit decomposition. This depth dependence @@ -322,19 +317,17 @@ includes these unresolved depth controls via an exponential decrease in the soil turnover time with depth: .. math:: + :label: 15.9) - \label{15.9)} r_{depth} =\exp \left(-\frac{z}{z_{\tau } } \right) -where *z\ :math:`{}_{\tau}`* is the e-folding depth for decomposition, -set by default to 0.5m. +where :math:`{z}_{\tau}` is the e-folding depth for decomposition, set by default to 0.5m. -The combined decomposition rate scalar (*r\ :math:`{}_{total}`*, -unitless) is: +The combined decomposition rate scalar (:math:`{r}_{total}`,unitless) is: .. math:: + :label: 15.10) - \label{15.10)} r_{total} =r_{tsoil} r_{water} r_{oxygen} r_{depth} . N-limitation of Decomposition Fluxes @@ -347,35 +340,34 @@ nitrogen supply. The general case is described here first, referring to a generic decomposition flux from an “upstream†pool (*u*) to a “downstream†pool (*d*), with an intervening loss due to respiration. The potential carbon flux out of the upstream pool -(*CF\ :math:`{}_{pot,u}`*, gC m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is: +(:math:`{CF}_{pot,u}`, gC m\ :sup:`-2` s\ :sup:`-1`) is: .. math:: + :label: 15.11) - \label{15.11)} CF_{pot,\, u} =CS_{u} k_{u} -where *CS\ :math:`{}_{u}`* (gC m\ :math:`{}^{-2}`) is the initial mass -in the upstream pool and *k\ :math:`{}_{u}`* is the decay rate constant -(s:math:`{}^{-1}`) for the upstream pool, adjusted for temperature and +where :math:`{CS}_{u}` (gC m\ :sup:`-2`) is the initial mass +in the upstream pool and :math:`{k}_{u}` is the decay rate constant +(s:sup:`-1`) for the upstream pool, adjusted for temperature and moisture conditions. Depending on the C:N ratios of the upstream and downstream pools and the amount of carbon lost in the transformation due to respiration (the respiration fraction), the execution of this potential carbon flux can generate either a source or a sink of new mineral nitrogen -(*NF\ :math:`{}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}`*, -gN m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). The governing equation +(:math:`{NF}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}`, gN m\ :sup:`-2` s\ :sup:`-1`). The governing equation (Thornton and Rosenbloom, 2005) is: .. math:: + :label: 15.12) - \label{15.12)} NF_{pot\_ min,\, u\to d} =\frac{CF_{pot,\, u} \left(1-rf_{u} -\frac{CN_{d} }{CN_{u} } \right)}{CN_{d} } -where *rf\ :math:`{}_{u}`* is the respiration fraction for fluxes -leaving the upstream pool, *CN\ :math:`{}_{u}`* and *CN\ :math:`{}_{d}`* +where :math:`{rf}_{u}` is the respiration fraction for fluxes +leaving the upstream pool, :math:`{CN}_{u}` and :math:`{CN}_{d}` are the C:N ratios for upstream and downstream pools, respectively. Negative values of -*NF\ :math:`{}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}`* +:math:`{NF}_{pot\_min,u}`\ :math:`{}_{\rightarrow}`\ :math:`{}_{d}` indicate that the decomposition flux results in a source of new mineral nitrogen, while positive values indicate that the potential decomposition flux results in a sink (demand) for mineral nitrogen. @@ -385,38 +377,38 @@ individual pools in the decomposition cascade, for the example of the CLM-CN pool structure, are given as: .. math:: + :label: 15.13) - \label{15.13)} CF_{pot,\, Lit1} ={CS_{Lit1} k_{Lit1} r_{total} \mathord{\left/ {\vphantom {CS_{Lit1} k_{Lit1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.14) - \label{15.14)} CF_{pot,\, Lit2} ={CS_{Lit2} k_{Lit2} r_{total} \mathord{\left/ {\vphantom {CS_{Lit2} k_{Lit2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.15) - \label{15.15)} CF_{pot,\, Lit3} ={CS_{Lit3} k_{Lit3} r_{total} \mathord{\left/ {\vphantom {CS_{Lit3} k_{Lit3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.16) - \label{15.16)} CF_{pot,\, SOM1} ={CS_{SOM1} k_{SOM1} r_{total} \mathord{\left/ {\vphantom {CS_{SOM1} k_{SOM1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.17) - \label{15.17)} CF_{pot,\, SOM2} ={CS_{SOM2} k_{SOM2} r_{total} \mathord{\left/ {\vphantom {CS_{SOM2} k_{SOM2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.18) - \label{15.18)} CF_{pot,\, SOM3} ={CS_{SOM3} k_{SOM3} r_{total} \mathord{\left/ {\vphantom {CS_{SOM3} k_{SOM3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: + :label: 15.19) - \label{15.19)} CF_{pot,\, SOM4} ={CS_{SOM4} k_{SOM4} r_{total} \mathord{\left/ {\vphantom {CS_{SOM4} k_{SOM4} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} where the factor (1/:math:`\Delta`\ *t*) is included because the rate @@ -427,43 +419,43 @@ again for the example of the CLM-CN pool structure (the CENTURY structure will be similar but without the different terminal step): .. math:: + :label: ZEqnNum934998 - \label{ZEqnNum934998} NF_{pot\_ min,\, Lit1\to SOM1} ={CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right) CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } .. math:: + :label: 15.21) - \label{15.21)} NF_{pot\_ min,\, Lit2\to SOM2} ={CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: + :label: 15.22) - \label{15.22)} NF_{pot\_ min,\, Lit3\to SOM3} ={CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } .. math:: + :label: 15.23) - \label{15.23)} NF_{pot\_ min,\, SOM1\to SOM2} ={CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: + :label: 15.24) - \label{15.24)} NF_{pot\_ min,\, SOM2\to SOM3} ={CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } .. math:: + :label: 15.25) - \label{15.25)} NF_{pot\_ min,\, SOM3\to SOM4} ={CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right) CN_{SOM4} }} \right. \kern-\nulldelimiterspace} CN_{SOM4} } .. math:: + :label: ZEqnNum473594 - \label{ZEqnNum473594} NF_{pot\_ min,\, SOM4} =-{CF_{pot,\, SOM4} \mathord{\left/ {\vphantom {CF_{pot,\, SOM4} CN_{SOM4} }} \right. \kern-\nulldelimiterspace} CN_{SOM4} } where the special form of Eq. arises because there is no SOM pool downstream of SOM4 in the converging cascade: all carbon fluxes leaving -that pool are assumed to be in the form of respired CO\ :math:`{}_{2}`, +that pool are assumed to be in the form of respired CO\ :sub:`2`, and all nitrogen fluxes leaving that pool are assumed to be sources of new mineral nitrogen. @@ -476,11 +468,9 @@ nitrogen, the total immobilization demand, and the total demand for soil mineral nitrogen to support new plant growth. The potential mineral nitrogen fluxes from Eqs. - are evaluated, summing all the positive fluxes to generate the total potential nitrogen immobilization flux -(*NF\ :math:`{}_{immob\_demand}`*, gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), and summing absolute values of all the negative +(:math:`{NF}_{immob\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`), and summing absolute values of all the negative fluxes to generate the total nitrogen mineralization flux -(*NF\ :math:`{}_{gross\_nmin}`*, gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`). Since *NF\ :math:`{}_{griss\_nmin}`* is a source of +(:math:`{NF}_{gross\_nmin}`, gN m\ :sup:`-2` s\ :sup:`-1`). Since :math:`{NF}_{griss\_nmin}` is a source of new mineral nitrogen to the soil mineral nitrogen pool it is not limited by the availability of soil mineral nitrogen, and is therefore an actual as opposed to a potential flux. @@ -488,42 +478,39 @@ as opposed to a potential flux. N Competition between plant uptake and soil immobilization fluxes ---------------------------------------------------------------------- -Once *NF\ :math:`{}_{immob\_demand }`* is known, the competition between +Once :math:`{NF}_{immob\_demand }` is known, the competition between plant and microbial nitrogen demand can be resolved. Mineral nitrogen in -the soil pool (*NS\ :math:`{}_{sminn}`*, gN m\ :math:`{}^{-2}`) at the +the soil pool (:math:`{NS}_{sminn}`, gN m\ :sup:`-2`) at the beginning of the timestep is considered the available supply. Total -demand for mineral nitrogen from this pool -(*NF\ :math:`{}_{total\_demand}`*, gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) is: +demand for mineral nitrogen from this pool (:math:`{NF}_{total\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) is: .. math:: + :label: 15.27) - \label{15.27)} NF_{total\_ demand} =NF_{immob\_ demand} +NF_{plant\_ demand\_ soil} -If *NF\ :math:`{}_{total\_demand}`*\ :math:`\Delta`\ *t* :math:`<` -*NS\ :math:`{}_{sminn}`*, then the available pool is large enough to +If :math:`{NF}_{total\_demand}`\ :math:`\Delta`\ *t* :math:`<` +:math:`{NS}_{sminn}`, then the available pool is large enough to meet both plant and microbial demand, and neither plant growth nor immobilization steps in the decomposition cascade are limited by nitrogen availability in the timestep. In that case, the signaling -variables *f\ :math:`{}_{plant\_demand}`* and -*f\ :math:`{}_{immob\_demand}`* are both set to 1.0, where -*f\ :math:`{}_{plant\_demand}`* is defined and used in section 15.4, and -*f\ :math:`{}_{immob\_demand}`* is the fraction of potential -immobilization demand that can be met given current supply of mineral -nitrogen. - -If *NF\ :math:`{}_{total\_demand}`*\ :math:`\Delta`\ *t* -:math:`\mathrm{\ge}` *NS\ :math:`{}_{sminn}`*, then there is not enough +variables :math:`{f}_{plant\_demand}` and +:math:`{f}_{immob\_demand}` are both set to 1.0, where +:math:`{f}_{plant\_demand}` is defined and used in section 15.4, and +:math:`{f}_{immob\_demand}` is the fraction of potential +immobilization demand that can be met given current supply of mineral nitrogen. + +If :math:`{NF}_{total\_demand}`\ :math:`\Delta`\ *t* +:math:`\mathrm{\ge}` :math:`{NS}_{sminn}`, then there is not enough mineral nitrogen to meet the combined demands for plant growth and heterotrophic immobilization, and both of these processes proceed at lower-than-potential rates, defined by the fractions -*f\ :math:`{}_{plant\_demand}`* and *f\ :math:`{}_{immob\_demand}`*, +:math:`{f}_{plant\_demand}` and :math:`{f}_{immob\_demand}`, where: .. math:: + :label: 15.28) - \label{15.28)} f_{plant\_ demand} =f_{immob\_ demand} =\frac{NS_{sminn} }{\Delta t\, NF_{total\_ demand} } This treatment of competition for nitrogen as a limiting resource is @@ -536,116 +523,116 @@ fraction of the available resource. Final Decomposition Fluxes ------------------------------- -With *f\ :math:`{}_{immob\_demand}`* known, final decomposition fluxes +With :math:`{f}_{immob\_demand}` known, final decomposition fluxes can be calculated. Actual carbon fluxes leaving the individual litter and SOM pools, again for the example of the CLM-CN pool structure (the CENTURY structure will be similar but, again without the different terminal step), are calculated as: .. math:: + :label: 15.29) - \label{15.29)} CF_{Lit1} =\left\{\begin{array}{l} {CF_{pot,\, Lit1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {CF_{pot,\, Lit1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: + :label: 15.30) - \label{15.30)} CF_{Lit2} =\left\{\begin{array}{l} {CF_{pot,\, Lit2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {CF_{pot,\, Lit2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: + :label: 15.31) - \label{15.31)} CF_{Lit3} =\left\{\begin{array}{l} {CF_{pot,\, Lit3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {CF_{pot,\, Lit3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: + :label: 15.32) - \label{15.32)} CF_{SOM1} =\left\{\begin{array}{l} {CF_{pot,\, SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {CF_{pot,\, SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: + :label: 15.33) - \label{15.33)} CF_{SOM2} =\left\{\begin{array}{l} {CF_{pot,\, SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {CF_{pot,\, SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: + :label: 15.34) - \label{15.34)} CF_{SOM3} =\left\{\begin{array}{l} {CF_{pot,\, SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {CF_{pot,\, SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: + :label: 15.35) - \label{15.35)} CF_{SOM4} =CF_{pot,\, SOM4} Heterotrophic respiration fluxes (losses of carbon as -CO\ :math:`{}_{2}` to the atmosphere) are: +CO\ :sub:`2` to the atmosphere) are: .. math:: + :label: 15.36) - \label{15.36)} CF_{Lit1,\, HR} =CF_{Lit1} rf_{Lit1} .. math:: + :label: 15.37) - \label{15.37)} CF_{Lit2,\, HR} =CF_{Lit2} rf_{Lit2} .. math:: + :label: 15.38) - \label{15.38)} CF_{Lit3,\, HR} =CF_{Lit3} rf_{Lit3} .. math:: + :label: 15.39) - \label{15.39)} CF_{SOM1,\, HR} =CF_{SOM1} rf_{SOM1} .. math:: + :label: 15.40) - \label{15.40)} CF_{SOM2,\, HR} =CF_{SOM2} rf_{SOM2} .. math:: + :label: 15.41) - \label{15.41)} CF_{SOM3,\, HR} =CF_{SOM3} rf_{SOM3} .. math:: + :label: 15.42) - \label{15.42)} CF_{SOM4,\, HR} =CF_{SOM4} rf_{SOM4} Transfers of carbon from upstream to downstream pools in the decomposition cascade are given as: .. math:: + :label: 15.43) - \label{15.43)} CF_{Lit1,\, SOM1} =CF_{Lit1} \left(1-rf_{Lit1} \right) .. math:: + :label: 15.44) - \label{15.44)} CF_{Lit2,\, SOM2} =CF_{Lit2} \left(1-rf_{Lit2} \right) .. math:: + :label: 15.45) - \label{15.45)} CF_{Lit3,\, SOM3} =CF_{Lit3} \left(1-rf_{Lit3} \right) .. math:: + :label: 15.46) - \label{15.46)} CF_{SOM1,\, SOM2} =CF_{SOM1} \left(1-rf_{SOM1} \right) .. math:: + :label: 15.47) - \label{15.47)} CF_{SOM2,\, SOM3} =CF_{SOM2} \left(1-rf_{SOM2} \right) .. math:: + :label: 15.48) - \label{15.48)} CF_{SOM3,\, SOM4} =CF_{SOM3} \left(1-rf_{SOM3} \right) In accounting for the fluxes of nitrogen between pools in the @@ -658,33 +645,33 @@ or from the downstream pool to the soil mineral nitrogen pool pools in the decomposition cascade are given as: .. math:: + :label: 15.49) - \label{15.49)} NF_{Lit1,\, SOM1} ={CF_{Lit1} \mathord{\left/ {\vphantom {CF_{Lit1} CN_{Lit1} }} \right. \kern-\nulldelimiterspace} CN_{Lit1} } .. math:: + :label: 15.50) - \label{15.50)} NF_{Lit2,\, SOM2} ={CF_{Lit2} \mathord{\left/ {\vphantom {CF_{Lit2} CN_{Lit2} }} \right. \kern-\nulldelimiterspace} CN_{Lit2} } .. math:: + :label: 15.51) - \label{15.51)} NF_{Lit3,\, SOM3} ={CF_{Lit3} \mathord{\left/ {\vphantom {CF_{Lit3} CN_{Lit3} }} \right. \kern-\nulldelimiterspace} CN_{Lit3} } .. math:: + :label: 15.52) - \label{15.52)} NF_{SOM1,\, SOM2} ={CF_{SOM1} \mathord{\left/ {\vphantom {CF_{SOM1} CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } .. math:: + :label: 15.53) - \label{15.53)} NF_{SOM2,\, SOM3} ={CF_{SOM2} \mathord{\left/ {\vphantom {CF_{SOM2} CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: + :label: 15.54) - \label{15.54)} NF_{SOM3,\, SOM4} ={CF_{SOM3} \mathord{\left/ {\vphantom {CF_{SOM3} CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } Corresponding fluxes to or from the soil mineral nitrogen pool depend on @@ -692,38 +679,38 @@ whether the decomposition step is an immobilization flux or a mineralization flux: .. math:: + :label: 15.55) - \label{15.55)} NF_{sminn,\, Lit1\to SOM1} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit1\to SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {NF_{pot\_ min,\, Lit1\to SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: + :label: 15.56) - \label{15.56)} NF_{sminn,\, Lit2\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit2\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {NF_{pot\_ min,\, Lit2\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: + :label: 15.57) - \label{15.57)} NF_{sminn,\, Lit3\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit3\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {NF_{pot\_ min,\, Lit3\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: + :label: 15.58) - \label{15.58)} NF_{sminn,SOM1\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM1\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {NF_{pot\_ min,\, SOM1\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: + :label: 15.59) - \label{15.59)} NF_{sminn,SOM2\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM2\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {NF_{pot\_ min,\, SOM2\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: + :label: 15.60) - \label{15.60)} NF_{sminn,SOM3\to SOM4} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM3\to SOM4} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {NF_{pot\_ min,\, SOM3\to SOM4} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: + :label: 15.61) - \label{15.61)} NF_{sminn,\, SOM4} =NF_{pot\_ min,\, SOM4} Vertical Distribution and Transport of Decomposing C and N pools @@ -753,8 +740,8 @@ parameterization based on that of Koven et al. (2009) is used: the diffusivity parameter is constant through the active layer, and decreases linearly from the base of the active layer to zero at a set depth (default 3m); the default permafrost diffusivity is 5 -cm\ :math:`{}^{2}`/yr. For non-permafrost soils, the default diffusivity -is 1 cm\ :math:`{}^{2}`/yr. +cm\ :sup:`2`/yr. For non-permafrost soils, the default diffusivity +is 1 cm\ :sup:`2`/yr. Model Equilibration ------------------------ @@ -769,23 +756,23 @@ decomposition†(Thornton and Rosenbloom, 2005) is used. The fundamental idea of this approach is to allow fluxes between the various pools (both turnover-defined and vertically-defined fluxes) adjust rapidly, while keeping the pool sizes themselves small so that they can fill quickly. -To do this, the base decomposition rate *k\ :math:`{}_{i}`* for each -pool *i* is accelerated by a term *a\ :math:`{}_{i}`* such that the slow +To do this, the base decomposition rate :math:`{k}_{i}` for each +pool *i* is accelerated by a term :math:`{a}_{i}` such that the slow pools are collapsed onto an approximately annual timescale (Koven et al. 2013). Accelerating the pools beyond this timescale distorts the seasonal and/or diurnal cycles of decomposition and N mineralization, thus leading to a substantially different ecosystem productivity than the full model. For the vertical model, the vertical transport terms are -also accelerated by the same term *a\ :math:`{}_{i}`*, as is the +also accelerated by the same term :math:`{a}_{i}`, as is the radioactive decay when :math:`{}^{14}`\ C is enabled, following the same principle of keeping fluxes between pools (or fluxes lost to decay) close to the full model while keeping the pools sizes small. When leaving the accelerated decomposition mode, the concentration of C and N in pools that had been accelerated are multiplied by the same term -*a\ :math:`{}_{i}`*, to bring the model into approximate equilibrium. +:math:`{a}_{i}`, to bring the model into approximate equilibrium. Note that in CLM, the model can also transition into accelerated decomposition mode from the standard mode (by dividing the pools by -*a\ :math:`{}_{i}`*), and that the transitions into and out of +:math:`{a}_{i}`), and that the transitions into and out of accelerated decomposition mode are handled automatically by CLM upon loading from restart files (which preserve information about the mode of the model when restart files were written). @@ -793,5 +780,3 @@ the model when restart files were written). The acceleration terms for the two decomposition cascades are shown in Tables 15.1 and 15.3. -.. |image| image:: image1 -.. |image| image:: image2 diff --git a/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst b/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst index b6dd7a2b1a..07bb1567f9 100644 --- a/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst @@ -1,7 +1,3 @@ -.. math:: 1 - -.. math:: 1 - External Nitrogen Cycle =========================== @@ -19,13 +15,12 @@ sinks in the external nitrogen cycle. CLM includes two separate treatments of the slow nitrogen cycle. The first is the original CLM-CN formulations, which includes a single soil mineral nitrogen pool to represent both -NO\ :math:`{}_{3}`\ :math:`{}^{-}` and -NH\ :math:`{}_{4}`\ :math:`{}^{+}`, and with nitrogen losses via +NO\ :sub:`3`\ :sup:`-` and NH\ :sub:`4`\ :sup:`+`, and with nitrogen losses via denitrification calculated as a constant fraction of mineralization plus a fixed first-order loss of unutilized mineral nitrogen at the end of every timestep. The second is based on the Century N-gas model; this -includes separate NH\ :math:`{}_{4}`\ :math:`{}^{+}` and -NO\ :math:`{}_{3}`\ :math:`{}^{-}`\ :math:`{}^{ }`\ pools, as well as +includes separate NH\ :sub:`4`\ :sup:`+` and +NO\ :sub:`3`\ :sup:`-` pools, as well as environmentally controlled nitrification and denitrification rates. Both are described below. @@ -34,42 +29,41 @@ Atmospheric Nitrogen Deposition CLM uses a single variable to represent the total deposition of mineral nitrogen onto the land surface, combining wet and dry deposition of -NO\ :math:`{}_{y}` and NH\ :math:`{}_{x}` as a single flux -(*NF\ :math:`{}_{ndep\_sminn}`*, gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`). This flux is intended to represent total reactive +NO\ :sub:`y` and NH\ :sub:`x` as a single flux +(:math:`{NF}_{ndep\_sminn}`, gN m\ :sup:`-2` s\ :sup:`-1`). This flux is intended to represent total reactive nitrogen deposited to the land surface which originates from the following natural and anthropogenic sources (Galloway et al. 2004): -formation of NO\ :math:`{}_{x}` during lightning, -NO\ :math:`{}_{x }`\ and NH\ :math:`{}_{3}` emission from wildfire, -NO\ :math:`{}_{x}` emission from natural soils, NH\ :math:`{}_{3}` +formation of NO\ :sub:`x` during lightning, +NO\ :math:`{}_{x }`\ and NH\ :sub:`3` emission from wildfire, +NO\ :sub:`x` emission from natural soils, NH\ :sub:`3` emission from natural soils, vegetation, and wild animals, -NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission during fossil fuel -combustion (both thermal and fuel NO\ :math:`{}_{x}` production), -NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission from other industrial -processes, NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` emission from fire -associated with deforestation, NO\ :math:`{}_{x}` and NH\ :math:`{}_{3}` -emission from agricultural burning, NO\ :math:`{}_{x}` emission from -agricultural soils, NH\ :math:`{}_{3}` emission from agricultural crops, -NH\ :math:`{}_{3}` emission from agricultural animal waste, and -NH\ :math:`{}_{3}` emission from human waste and waste water. The +NO\ :sub:`x` and NH\ :sub:`3` emission during fossil fuel +combustion (both thermal and fuel NO\ :sub:`x` production), +NO\ :sub:`x` and NH\ :sub:`3` emission from other industrial +processes, NO\ :sub:`x` and NH\ :sub:`3` emission from fire +associated with deforestation, NO\ :sub:`x` and NH\ :sub:`3` +emission from agricultural burning, NO\ :sub:`x` emission from +agricultural soils, NH\ :sub:`3` emission from agricultural crops, +NH\ :sub:`3` emission from agricultural animal waste, and +NH\ :sub:`3` emission from human waste and waste water. The deposition flux is provided as a spatially and (potentially) temporally varying dataset (see section 2.2.3 for a description of the default input dataset). In the CLM-CN mineral N pool model, the nitrogen deposition flux is assumed to enter the soil mineral nitrogen pool -(*NS\ :math:`{}_{sminn}`*) directly; while in the Century-based model, +(:math:`{NS}_{sminn}`) directly; while in the Century-based model, all of the nitrogen is assumed to enter the -NH\ :math:`{}_{4}`\ :math:`{}^{+}` pool. Real pathways for wet and dry +NH\ :sub:`4`\ :sup:`+` pool. Real pathways for wet and dry nitrogen deposition can be more complex than currently represented in the CLM-CN, including release from melting snowpack and direct foliar -uptake of deposited NO\ :math:`{}_{y}` (e.g. Tye et al. 2005; Vallano +uptake of deposited NO\ :sub:`y` (e.g. Tye et al. 2005; Vallano and Sparks, 2007). Biological Nitrogen Fixation --------------------------------- -The fixation of new reactive nitrogen from atmospheric N\ :math:`{}_{2}` +The fixation of new reactive nitrogen from atmospheric N\ :sub:`2` by soil microorganisms is an important component of both preindustrial and modern-day nitrogen budgets, but a mechanistic understanding of global-scale controls on biological nitrogen fixation (BNF) is still @@ -77,8 +71,7 @@ only poorly developed (Cleveland et al. 1999; Galloway et al. 2004). Cleveland et al. (1999) suggested empirical relationships that predict BNF as a function of either evapotranspiration rate or net primary productivity for natural vegetation. CLM assumes that BNF is a function -of net primary production (*CF\ :math:`{}_{ann\_NPP}`*, gC -m\ :math:`{}^{-2}` y\ :math:`{}^{-1}`). The rationale for choosing net +of net primary production (:math:`{CF}_{ann\_NPP}`, gC m\ :sup:`-2` y\ :sup:`-1`). The rationale for choosing net primary production over evapotranspiration as the predictor is that the two are well-correlated (Parton et al. 1993; Running et al. 1989), and the use of primary production also introduces a known dependence of BNF @@ -86,18 +79,17 @@ on the carbon supply to nitrogen fixing microorganisms (Cleveland et al. 1999). The expression used is: .. math:: + :label: ZEqnNum802819: - \label{ZEqnNum802819} NF_{nfix,sminn} ={1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right)\mathord{\left/ {\vphantom {1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right) \left(86400\cdot 365\right)}} \right. \kern-\nulldelimiterspace} \left(86400\cdot 365\right)} -where *NF\ :math:`{}_{nfix,sminn}`* (gN m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) is the rate of BNF. Eq. is plotted over a range of +where :math:`{NF}_{nfix,sminn}` (gN m\ :sup:`-2` s\ :sup:`-1`) is the rate of BNF. Eq. is plotted over a range of annual NPP in Figure 16.1. Figure 16.1. Biological nitrogen fixation as a function of annual net primary production. -|image| +.. image:: image1.png Because of the empirical nature of this NPP-BNF relationship, the timescale for calculating NPP and thus BNF is unconstrained. Using @@ -111,7 +103,7 @@ and BNF calculated from that using equation 16.1. As with Atmospheric N deposition, BNF N inputs are added directly to the mineral N pools. In the CLM-CN N model, this is the single mineral N pool; in the Century-based model, this is the -NH\ :math:`{}_{4}`\ :math:`{}^{+}` pool. +NH\ :sub:`4`\ :sup:`+` pool. Nitrification and Denitrification Losses of Nitrogen --------------------------------------------------------- @@ -129,8 +121,8 @@ acceptor supporting the metabolism of heterotrophs, but anaerobic conditions favor the activity of soil heterotrophs which use nitrate as an electron acceptor (e.g. *Pseudomonas* and *Clostridium*) supporting respiration. This process, known as denitrification, results in the -transformation of nitrate to gaseous N\ :math:`{}_{2}`, with smaller -associated production of NO\ :math:`{}_{x}` and N\ :math:`{}_{2}`\ O. It +transformation of nitrate to gaseous N\ :sub:`2`, with smaller +associated production of NO\ :sub:`x` and N\ :sub:`2`\ O. It is typically assumed that nitrogen fixation and denitrification were approximately balanced in the preindustrial biosphere (Galloway et al. 2004). It is likely that denitrification can occur within anaerobic @@ -155,46 +147,46 @@ Denitrification fluxes associated with gross mineralization in the decomposition cascade are calculated as follows: .. math:: + :label: 16.2) - \label{16.2)} NF_{denit,Lit1\to SOM1} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} >0} \\ {-NF_{pot\_ min,Lit1\to SOM1} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} \le 0} \end{array}\right. .. math:: + :label: 16.3) - \label{16.3)} NF_{denit,Lit2\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} >0} \\ {-NF_{pot\_ min,Lit2\to SOM2} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} \le 0} \end{array}\right. .. math:: + :label: 16.4) - \label{16.4)} NF_{denit,Lit3\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} >0} \\ {-NF_{pot\_ min,Lit3\to SOM3} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} \le 0} \end{array}\right. .. math:: + :label: 16.5) - \label{16.5)} NF_{denit,SOM1\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} >0} \\ {-NF_{pot\_ min,SOM1\to SOM2} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} \le 0} \end{array}\right. .. math:: + :label: 16.6) - \label{16.6)} NF_{denit,SOM2\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} >0} \\ {-NF_{pot\_ min,SOM2\to SOM3} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} \le 0} \end{array}\right. .. math:: + :label: 16.7) - \label{16.7)} NF_{denit,SOM3\to SOM4} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} >0} \\ {-NF_{pot\_ min,SOM3\to SOM4} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} \le 0} \end{array}\right. .. math:: + :label: 16.8) - \label{16.8)} NF_{denit,SOM4} =-NF_{pot\_ min,SOM4} -where *f\ :math:`{}_{denit}`* = 0.01 is the constant denitrification +where :math:`{f}_{denit} = 0.01` is the constant denitrification fraction of gross mineralization, and the denitrification fluxes are assumed to be leaving the soil mineral nitrogen pool -(*NS\ :math:`{}_{sminn}`*) and entering the atmosphere. The speciation +(:math:`{NS}_{sminn}`) and entering the atmosphere. The speciation of gaseous nitrogen fluxes entering the atmosphere (e.g. -N\ :math:`{}_{2}` vs. NO\ :math:`{}_{x}` or N\ :math:`{}_{2}`\ O) is not +N\ :sub:`2` vs. NO\ :sub:`x` or N\ :sub:`2`\ O) is not specified. Providing an explicit speciation of these nitrogen losses is another high-priority area for future model development. @@ -220,18 +212,18 @@ pool. The denitrification of excess soil mineral nitrogen is non-zero whenever the supply of mineral nitrogen exceeds the demand: .. math:: + :label: 16.9) - \label{16.9)} NF_{sminn,denit} =\left\{\begin{array}{l} {\left(\frac{NS_{sminn} }{\Delta t} \right)-NF_{total\_ demand} f_{dnx} \qquad {\rm for\; }NF_{total\_ demand} \Delta tB_{up} } \end{array} -where :math:`B_{ag}` (g C m\ :math:`{}^{--2}`) is the aboveground +where :math:`B_{ag}` (g C m\ :sup:`-2`) is the aboveground biomass of combined leaf, stem and aboveground litter (leaf litter and -woody debris) pools; :math:`B_{low}` \ =155 g C m\ :math:`{}^{--2 }`\ is +woody debris) pools; :math:`B_{low}` \ =155 g C m\ :sup:`-2` is the lower fuel threshold below which fire does not occur; -:math:`B_{up}` \ = 1050 g C m\ :math:`{}^{--2}` is the upper fuel +:math:`B_{up}` \ = 1050 g C m\ :sup:`-2` is the upper fuel threshold above which fire occurrence is not limited by fuel -availability. **** +availability. -Fuel combustibility :math:`f_{m}` is estimated by +Fuel combustibility :math:`f_{m}` is estimated by .. math:: + :label: 18.7) - \label{18.7)} f_{m} =f_{RH} f_{\theta } f_{T} -where\ :math:`f_{RH}` , **:math:`f_{\theta }` **, :math:`f_{T}` +where :math:`f_{RH}`, :math:`f_{\theta }`, :math:`f_{T}` represent the dependence of fuel combustibility on relative humidity *RH* (%), surface soil wetness :math:`\theta` , and surface air -temperature *T* (ºC), respectively.\ :math:`f_{RH}` is calculated by +temperature *T* (ºC), respectively. :math:`f_{RH}` is calculated by .. math:: + :label: 18.8) - \label{18.8)} f_{RH} =\left\{\begin{array}{cccc} {1} & {} & {} & {RH\le RH_{low} } \\ {\frac{RH_{up} -RH}{RH_{up} -RH_{low} } ,} & {} & {} & {RH_{low} 0.1` person km\ :math:`{}^{-2}`, we parameterize the +:math:`D_{p} >0.1` person km\ :sup:`-2`, we parameterize the fraction of anthropogenic and natural fires unsuppressed by human activities as .. math:: + :label: 18.10) - \label{18.10)} f_{se,o} =f_{d} f_{e} -where *f\ :math:`{}_{d}`* and *:math:`{}_{ }`\ f\ :math:`{}_{e}`* are +where :math:`{f}_{d}` and :math:`{f}_{e}` are the effects of the demographic and economic conditions on fire occurrence. The demographic influence on fire occurrence is .. math:: + :label: 18.11) - \label{18.11)} f_{d} =0.01+0.98\exp (-0.025D_{P} ). For shrub and grass PFTs, the economic influence on fire occurrence is parameterized as a function of Gross Domestic Product GDP (k 1995US$ -capita\ :math:`{}^{-1}`): +capita\ :sup:`-1`): .. math:: + :label: 18.12) - \label{18.12)} f_{e} =0.1+0.9\times \exp [-\pi (\frac{GDP}{8} )^{0.5} ] which captures 73% of the observed MODIS fire counts with variable GDP @@ -175,17 +166,17 @@ in regions where shrub and grass PFTs are dominant (fractional coverage of shrub and grass PFTs :math:`>` 50%). In regions outside tropical closed forests and dominated by trees (fractional coverage of tree PFTs :math:`>` 50%), we divide the MODIS fire counts into only two bins -(:math:`GDP\ge 20` k 1995US$ capita\ :math:`{}^{-1}`, and :math:`GDP<20` -k 1995US$ capita\ :math:`{}^{-1}`) and parameterize the economic +(:math:`GDP\ge 20` k 1995US$ capita\ :sup:`-1`, and :math:`GDP<20` +k 1995US$ capita\ :sup:`-1`) and parameterize the economic influence on fire occurrence for tree PFTs as .. math:: + :label: 18.13) - \label{18.13)} f_{e} =\left\{\begin{array}{cc} {0.39,} & {GDP\ge 20} \\ {1} & {GDP<20} \end{array}\right. to reproduce that the MODIS fire counts in tree-dominated regions of -GDP\ :math:`\ge 20` k 1995US$ capita\ :math:`{}^{-1}` is 39% of that in +GDP\ :math:`\ge 20` k 1995US$ capita\ :sup:`-1` is 39% of that in other **** tree-dominated regions. 18.1.2 Average spread area of a fire @@ -197,8 +188,8 @@ socioeconomic impact on the average burned area rather than separately on fire spread rate and fire duration: .. math:: + :label: 18.14) - \label{18.14)} a=a^{*} F_{se} where :math:`a^{*}` is the average burned area of a fire without @@ -212,47 +203,45 @@ formula for an ellipse, average burned area of a fire can be represented as: .. math:: + :label: 18.15) - \label{18.15)} a^{*} =\pi \frac{l}{2} \frac{w}{2} \times 10^{-6} =\frac{\pi u_{p}^{2} \tau ^{2} }{4L_{B} } (1+\frac{1}{H_{B} } )^{2} \times 10^{-6} -where :math:`u_{p}` \ (m s\ :math:`{}^{--1}`) is the fire spread rate in +where :math:`u_{p}` \ (m s\ :sup:`-1`) is the fire spread rate in the downwind direction; :math:`\tau` \ (s) is average fire duration;\ :math:`L_{B}` and :math:`H_{B}` are length-to-breadth ratio -and head-to-back ratio of the ellipse; 10\ :math:`{}^{-6 }`\ converts -m\ :math:`{}^{2}` to km\ :math:`{}^{2}`. +and head-to-back ratio of the ellipse; 10\ :sup:`-6` converts m\ :sup:`2` to km\ :sup:`2`. According to Arora and Boer (2005), .. math:: + :label: ZEqnNum696342 - \label{ZEqnNum696342} L_{B} =1.0+10.0[1-\exp (-0.06W)] -where :math:`W`\ (m s\ :math:`{}^{--1}`) is the wind speed. According to +where :math:`W`\ (m s\ :sup:`-1`) is the wind speed. According to the mathematical properties of the ellipse, the head-to-back ratio :math:`H_{B}` is .. math:: + :label: ZEqnNum179757 - \label{ZEqnNum179757} H_{B} =\frac{u_{p} }{u_{b} } =\frac{L_{B} +(L_{B} ^{2} -1)^{0.5} }{L_{B} -(L_{B} ^{2} -1)^{0.5} } . The fire spread rate in the downwind direction is represented as .. math:: + :label: 18.18) - \label{18.18)} u_{p} =u_{\max } C_{m} g(W) (Arora and Boer, 2005), where :math:`u_{\max }` (m -s\ :math:`{}^{--1}`) is the PFT-dependent average maximum fire spread +s\ :sup:`-1`) is the PFT-dependent average maximum fire spread rate in natural vegetation regions; :math:`C_{m}` and :math:`g(W)` represent the dependence of :math:`u_{p}` on fuel wetness and wind speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.55 m -s\ :math:`{}^{--1 }`\ for grass PFTs, 0.46 m s\ :math:`{}^{--1}` for -shrub PFTs, 0.43 m s\ :math:`{}^{--1}` for\ :math:`{}^{ }`\ needleleaf -tree PFTs, and 0.40 m s\ :math:`{}^{--1}` for other tree PFTs. +s\ :sup:`-1`\ for grass PFTs, 0.46 m s\ :sup:`-1` for +shrub PFTs, 0.43 m s\ :sup:`-1` for needleleaf tree PFTs, and 0.40 m s\ :sup:`-1` for other tree PFTs. :math:`C_{m} =C_{\beta } C_{RH}` is estimated by the dependence of :math:`u_{p}` \ on root zone soil wetness (:math:`C_{\beta }` ) and relative humidity (:math:`C_{RH}` ). Here,\ :math:`\beta` is a root @@ -264,8 +253,8 @@ and upper thresholds of root zone soil wetness, respectively. derived from the mathematical properties of the ellipse and Eqs and .. math:: + :label: 18.19) - \label{18.19)} g(W)=\frac{2L_{B} }{1+\frac{1}{H_{B} } } g(0). Since g(\ *W*)=1.0, and\ :math:`L_{B}` and :math:`H_{B}` are at their @@ -273,8 +262,8 @@ maxima\ :math:`L_{B} ^{\max } =11.0`\ and :math:`H_{B} ^{\max } =482.0` when :math:`W\to \infty` , g(0) can be derived as .. math:: + :label: 18.20) - \label{18.20)} g(0)=\frac{1+\frac{1}{H_{B} ^{\max } } }{2L_{B} ^{\max } } =0.05. In the absence of globally gridded data on barriers to fire (e.g. @@ -285,16 +274,16 @@ average fire duration is simply assumed equal to 1 which is the observed As with the socioeconomic influence on fire occurrence, we assume that the socioeconomic influence on fire spreading is negligible in regions -of\ :math:`D_{p} \le 0.1` person km\ :math:`{}^{-2}`, i.e., +of\ :math:`D_{p} \le 0.1` person km\ :sup:`-2`, i.e., :math:`F_{se} =1.0`. In regions of :math:`D_{p} >0.1` person -km\ :math:`{}^{-2}`, we parameterize such socioeconomic influence as: +km\ :sup:`-2`, we parameterize such socioeconomic influence as: .. math:: + :label: 18.21) - \label{18.21)} F_{se} =F_{d} F_{e} -where *F\ :math:`{}_{d}`* and\ *:math:`{}_{ }`\ F\ :math:`{}_{e}`* are +where :math:`{F}_{d}` and :math:`{F}_{e}` are effects of the demographic and economic conditions on the average spread area of a fire, and are identified by maximizing the explained variability of the GFED3 burned area fraction with both socioeconomic @@ -302,30 +291,30 @@ indices in grid cells with various dominant vegetation types. For shrub and grass PFTs, the demographic impact factor is .. math:: + :label: ZEqnNum900584 - \label{ZEqnNum900584} F_{d} =0.2+0.8\times \exp [-\pi (\frac{D_{p} }{450} )^{0.5} ] and the economic impact factor is .. math:: + :label: ZEqnNum213480 - \label{ZEqnNum213480} F_{e} =0.2+0.8\times \exp (-\pi \frac{GDP}{7} ). For tree PFTs outside tropical closed forests, the demographic and economic impact factors are given as .. math:: + :label: 18.24) - \label{18.24)} F_{d} =0.4+0.6\times \exp (-\pi \frac{D_{p} }{125} ) and .. math:: + :label: ZEqnNum543524 - \label{ZEqnNum543524} F_{e} =\left\{\begin{array}{cc} {0.62,} & {GDP>20} \\ {0.83,} & {8`\ *T\ :math:`{}_{f}`* if no agricultural fires occurred -earlier in the year; *f\ :math:`{}_{t}`* is set to 0 otherwise. Peak +*T*\ :math:`>`\ :math:`{T}_{f}` if no agricultural fires occurred +earlier in the year; :math:`{f}_{t}` is set to 0 otherwise. Peak month in this dataset correlates with the month after harvesting or the month before planting. In CLM we use this dataset the same way whether the CROP option is active or not, without regard to the CROP option’s @@ -473,59 +451,59 @@ these grid cells. Burned area is controlled by the deforestation rate and climate: .. math:: + :label: 18.34) - \label{18.34)} A_{b} =bf_{lu} f_{cli,d} A_{g} -where *b* (time step)\ :math:`{}^{-1 }`\ is a global constant; +where *b* (time step)\ :sup:`-1` is a global constant; :math:`f_{lu}` (fraction) represents the effect of decreasing fractional coverage of tree PFTs derived from land use data; and :math:`f_{cli,d}` (fraction) represents the effect of climate conditions on the burned area. -Constants *b* and\ :math:`{}^{ }`\ :math:`{}^{f_{lu} }` are calibrated +Constants *b* and :math:`{f}_{lu}` are calibrated based on observations and reanalysis datasets in the Amazon rainforest -(tropical closed forests within 15.5ºS\ :math:`\mathrm{-}`\ 10.5ºN, -30.5ºW\ :math:`\mathrm{-}`\ 91ºW). *b=*\ 0.035 d\ :math:`{}^{-1}` and +(tropical closed forests within 15.5ºS\ :math:`\text{-}`\ 10.5ºN, +30.5ºW\ :math:`\text{-}`\ 91ºW). *b=*\ 0.035 d\ :sup:`-1` and :math:`f_{lu}` is defined as .. math:: + :label: 18.35) - \label{18.35)} f_{lu} =\max (0.0005,0.19D-0.0011) -where :math:`D`\ (yr:math:`{}^{-1}`) is the annual loss of tree cover +where :math:`D`\ (yr:sup:`-1`) is the annual loss of tree cover based on CLM4’s land use and land cover change data. The effect of climate on deforestation fires is parameterized as: .. math:: + :label: ZEqnNum336915 - \label{ZEqnNum336915} \begin{array}{l} {f_{cli,d} =\max [0,\min (1,\frac{b_{2} -P_{60d} }{b_{2} } )]^{0.5} \max [0,\min (1,\frac{b_{3} -P_{10d} }{b_{3} } )]^{0.5} } \\ {\qquad \max [0,\min (1,\frac{0.25-P}{0.25} )]} \end{array} -where\ :math:`P`\ (mm d\ :math:`{}^{-1}`) is instantaneous -precipitation, while :math:`P_{60d}` (mm d\ :math:`{}^{-1}`) and -:math:`P_{10d}` (mm d\ :math:`{}^{-1}`) are 60-day and 10-day running +where\ :math:`P`\ (mm d\ :sup:`-1`) is instantaneous +precipitation, while :math:`P_{60d}` (mm d\ :sup:`-1`) and +:math:`P_{10d}` (mm d\ :sup:`-1`) are 60-day and 10-day running means of precipitation, respectively; :math:`b_{2}` (mm -d\ :math:`{}^{-1}`) and :math:`b_{3}` (mm d\ :math:`{}^{-1}`) are the +d\ :sup:`-1`) and :math:`b_{3}` (mm d\ :sup:`-1`) are the grid-cell dependent thresholds of :math:`P_{60d}` and :math:`P_{10d}` ; -0.25 mm d\ :math:`{}^{-1}` is the maximum precipitation rate for +0.25 mm d\ :sup:`-1` is the maximum precipitation rate for drizzle. Le Page et al. (2010) analyzed the relationship between large-scale deforestation fire counts and precipitation during -2003\ :math:`\mathrm{-}`\ 2006 in southern Amazonia where tropical +2003\ :math:`\text{-}`\ 2006 in southern Amazonia where tropical evergreen trees (BET Tropical) are dominant. Figure 2 in Le Page et al. (2010) showed that fires generally occurred if both :math:`P_{60d}` and -:math:`P_{10d}` were less than about 4.0 mm d\ :math:`{}^{-1}`, and +:math:`P_{10d}` were less than about 4.0 mm d\ :sup:`-1`, and fires occurred more frequently in a drier environment. Based on the -30-yr (1985:math:`\mathrm{-}`\ 2004) precipitation data in Qian et al. +30-yr (1985:math:`\text{-}`\ 2004) precipitation data in Qian et al. (2006), the climatological precipitation of dry months (P:math:`<`\ 4.0 -mm d\ :math:`{}^{-1}`) in a year over tropical deciduous tree (BDT +mm d\ :sup:`-1`) in a year over tropical deciduous tree (BDT Tropical) dominated regions is 46% of that over BET Tropical dominated regions, so we set the PFT-dependent thresholds of :math:`P_{60d}` and -:math:`P_{10d}` as 4.0 mm d\ :math:`{}^{-1}` for BET Tropical and 1.8 -mm d\ :math:`{}^{-1}` (= 4.0 mm d\ :math:`{}^{-1}` :math:`\times` 46%) -for BDT Tropical, and *b\ :math:`{}_{2}`* and *b\ :math:`{}_{3}`* are +:math:`P_{10d}` as 4.0 mm d\ :sup:`-1` for BET Tropical and 1.8 +mm d\ :sup:`-1` (= 4.0 mm d\ :sup:`-1` :math:`\times` 46%) +for BDT Tropical, and *b*\ :sub:`2` and *b*\ :sub:`3` are the average of thresholds of BET Tropical and BDT Tropical weighted by their coverage. @@ -536,7 +514,7 @@ to the fraction of conversion flux for tropical trees in the tree-reduced region (60%) assigned by CLM, to reach the maximum fire carbon emissions in a conversion region requires burning this region about twice when we set PFT-dependent combustion completeness factors to -about 0.3 for stem [the mean of 0.2\ :math:`\mathrm{-}`\ 0.4 used in van +about 0.3 for stem [the mean of 0.2\ :math:`{-}`\ 0.4 used in van der Werf (2010)]. Therefore, when the burned area calculated from Eq. is no more than twice the tree-reduced area, we assume no escaped fires outside the land-type conversion region, and the fire-related fraction @@ -550,43 +528,41 @@ section 18.1.3. Peat fires --------------- -The burned area due to peat fires is given as *A\ :math:`{}_{b}`*: +The burned area due to peat fires is given as :math:`{A}_{b}`: .. math:: + :label: 18.37) - \label{18.37)} A_{b} =cf_{cli,p} f_{peat} (1-f_{sat} )A_{g} -where *c* (time step)\ :math:`{}^{-1}` is a constant; :math:`f_{cli,p}` +where *c* (time step)\ :sup:`-1` is a constant; :math:`f_{cli,p}` represents the effect of climate on the burned area;\ :math:`f_{peat}` is the fractional coverage of peatland in the grid cell; and :math:`f_{sat}` is the fraction of the grid cell with a water table at -the surface or higher. *c*\ =1.0\ :math:`\times`\ 10\ :math:`{}^{-3}` -hr\ :math:`{}^{-1 }`\ for tropical peat fires and -*c*\ =4.2\ :math:`\times`\ 10\ :math:`{}^{-5}`\ :math:`{}^{ }`\ hr\ :math:`{}^{-1 }`\ for -boreal peat fires are derived using an inverse -method,\ :math:`{}^{ }`\ by matching simulations from an unreleased +the surface or higher. *c*\ =1.0\ :math:`\times`\ 10\ :sup:`-3` hr\ :sup:`-1` for tropical peat fires and +*c*\ =4.2\ :math:`\times`\ 10\ :sup:`-5` hr\ :sup:`-1` for boreal peat fires are derived using an inverse +method, by matching simulations from an unreleased CLM4.5 version driven by Qian et al. (2006) atmospheric forcing and climatological lightning data to earlier studies: about 2.4 Mha peatland was burned over Indonesia in 1997 (Page et al. 2002) and the average burned area of peat fires in Western Canada was 0.2 Mha -yr\ :math:`{}^{-1}` for 1980\ :math:`\mathrm{-}`\ 1999 (Turestky et al. +yr\ :sup:`-1` for 1980\ :math:`\math{-}`\ 1999 (Turestky et al. 2004). For tropical peat fires, :math:`f_{cli,p}` is set as a function of long-term precipitation :math:`P_{60d}` : .. math:: + :label: 18.38) - \label{18.38)} f_{cli,p} =\max [0,\min (1,\frac{4-P_{60d} }{4} )]^{2} . For boreal peat fires, :math:`f_{cli,p}` is set to .. math:: + :label: 18.39) - \label{18.39)} - f_{cli,p} =\exp (-\pi \frac{\theta _{17cm} }{0.3} )\cdot \max [0,\min (1,\frac{T_{17cm} -T_{f} }{10} )] + f_{cli,p} = \exp (-\pi \frac{\theta _{17cm} }{0.3} )\cdot \max [0,\min (1,\frac{T_{17cm} -T_{f} }{10} )] where :math:`\theta _{17cm}` and :math:`T_{17cm}` are the wetness and temperature of the top 17 cm of soil; :math:`T_{f}` \ =273.15 K is the @@ -595,13 +571,10 @@ freezing temperature. Peat fires lead to peat combustion and the combustion and mortality of vegetation in peatlands. For tropical peat fires, based on Page et al. (2002), about 6% of the peat carbon loss from stored carbon is caused by -33.9% of the peatland burned. Carbon emissions due to peat combustion (g -C m\ :math:`{}^{-2}` (time step)\ :math:`{}^{-1}`) are therefore set as +33.9% of the peatland burned. Carbon emissions due to peat combustion (g C m\ :sup:`-2` (time step)\ :sup:`-1`) are therefore set as the product of 6%/33.9%, by burned area fraction of peat fire ((time -step)\ :math:`{}^{-1}`), by soil organic carbon (g C -m\ :math:`{}^{-2}`). For boreal peat fires, the carbon emissions due to -peat combustion are set as 2.2 kg C -m\ :math:`{}^{-}`\ :math:`{}^{2 }`\ peat fire area (Turetsky et al. +step)\ :sup:`-1`), by soil organic carbon (g C m\ :sup:`-2`). For boreal peat fires, the carbon emissions due to +peat combustion are set as 2.2 kg C m\ :sup:`-2`\ peat fire area (Turetsky et al. 2002). Biomass combustion and vegetation mortality in post-fire peatlands are set the same as section 18.1.3 for non-crop PFTs and as section 18.2 for crops PFTs. @@ -610,7 +583,7 @@ Table 18.1. PFT-specific combustion completeness and fire mortality factors. +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| PFT | *CC*\ :math:`{}_{leaf}` | *CC*\ :math:`{}_{stem}` | *CC*\ :math:`{}_{root}` | *CC*\ :math:`{}_{ts}` | *M*\ :math:`{}_{leaf}` | *M*\ :math:`{}_{livestem}` | *M*\ :math:`{}_{deadstem}` | *M*\ :math:`{}_{root}` | *M*\ :math:`{}_{ts}` | *M*\ :math:`{}_{livestem}` | *:math:`\xi`*\ :math:`{}_{j}` | +| PFT | *CC*\ :sub:`leaf` | *CC*\ :sub:`stem` | *CC*\ :sub:`root` | *CC*\ :sub:`ts` | *M*\ :sub:`leaf` | *M*\ :sub:`livestem` | *M*\ :sub:`deadstem` | *M*\ :sub:`root` | *M*\ :sub:`ts` | *M*\ :sub:`livestem` | :math:`\xi`\ :sub:`j` | +==================================+===========================+===========================+===========================+=========================+==========================+==============================+==============================+==========================+========================+==============================+=================================+ | NET Temperate | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ @@ -634,11 +607,11 @@ factors. +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ | BDS Boreal | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :math:`{}_{3}` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +| C\ :sub:`3` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :math:`{}_{3}` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +| C\ :sub:`3` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :math:`{}_{4}` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +| C\ :sub:`4` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ | Crop 1 | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ diff --git a/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst b/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst index 980ed65268..7bdea2fefb 100644 --- a/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst +++ b/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst @@ -9,15 +9,15 @@ Zhuang et al. 2004). Although the model has similarities with these precursor models, a number of new process representations and parameterization have been integrated into CLM. -Mechanistically modeling net surface CH\ :math:`{}_{4}` emissions +Mechanistically modeling net surface CH\ :sub:`4` emissions requires representing a complex and interacting series of processes. We first (section 19.1) describe the overall model structure and flow of -information in the CH\ :math:`{}_{4}` model, then describe the methods -used to represent: CH\ :math:`{}_{4}` mass balance; CH\ :math:`{}_{4}` -production; ebullition; aerenchyma transport; CH\ :math:`{}_{4}` +information in the CH\ :sub:`4` model, then describe the methods +used to represent: CH\ :sub:`4` mass balance; CH\ :sub:`4` +production; ebullition; aerenchyma transport; CH\ :sub:`4` oxidation; reactive transport solution, including boundary conditions, numerical solution, water table interface, etc.; seasonal inundation -effects; and impact of seasonal inundation on CH\ :math:`{}_{4}` +effects; and impact of seasonal inundation on CH\ :sub:`4` production. Methane Model Structure and Flow @@ -26,97 +26,90 @@ Methane Model Structure and Flow The driver routine for the methane biogeochemistry calculations (ch4, in ch4Mod.F) controls the initialization of boundary conditions, inundation, and impact of redox conditions; calls to routines to -calculate CH\ :math:`{}_{4}` production, oxidation, transport through +calculate CH\ :sub:`4` production, oxidation, transport through aerenchyma, ebullition, and the overall mass balance (for unsaturated and saturated soils and, if desired, lakes); resolves changes to -CH\ :math:`{}_{4}` calculations associated with a changing inundated +CH\ :sub:`4` calculations associated with a changing inundated fraction; performs a mass balance check; and calculates the average -gridcell CH\ :math:`{}_{4}` production, oxidation, and exchanges with +gridcell CH\ :sub:`4` production, oxidation, and exchanges with the atmosphere. Governing Mass-Balance Relationship ---------------------------------------- -The model (Figure 19.1) accounts for CH\ :math:`{}_{4}` production in -the anaerobic fraction of soil (*P*, mol m\ :math:`{}^{-3}` -s\ :math:`{}^{-1}`), ebullition (*E*, mol m\ :math:`{}^{-3}` -s\ :math:`{}^{-1}`), aerenchyma transport (*A*, mol m\ :math:`{}^{-3}` -s\ :math:`{}^{-1}`), aqueous and gaseous diffusion (*F\ :math:`{}_{D}`*, -mol m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), and oxidation (*O*, mol -m\ :math:`{}^{-3}` s\ :math:`{}^{-1}`) via a transient reaction +The model (Figure 19.1) accounts for CH\ :sub:`4` production in +the anaerobic fraction of soil (*P*, mol m\ :sup:`-3` s\ :sup:`-1`), ebullition (*E*, mol m\ :sup:`-3` s\ :sup:`-1`), +aerenchyma transport (*A*, mol m\ :sup:`-3` s\ :sup:`-1`), aqueous and gaseous diffusion (:math:`{F}_{D}`, +mol m\ :sup:`-2` s\ :sup:`-1`), and oxidation (*O*, mol m\ :sup:`-3` s\ :sup:`-1`) via a transient reaction diffusion equation: .. math:: + :label: ZEqnNum628535 - \label{ZEqnNum628535} \frac{\partial \left(RC\right)}{\partial t} =\frac{\partial F_{D} }{\partial z} +P\left(z,t\right)-E\left(z,t\right)-A\left(z,t\right)-O\left(z,t\right) Here *z* (m) represents the vertical dimension, *t* (s) is time, and *R* accounts for gas in both the aqueous and gaseous -phases:\ :math:`R=\varepsilon _{a} +K_{H}^{} \varepsilon _{w}` , with -*:math:`\epsilon`\ :math:`{}_{a}`*, *:math:`\epsilon`\ :math:`{}_{w}`,* -and :math:`K_{H}^{}` (-) the air-filled porosity, water-filled +phases:\ :math:`R = \epsilon _{a} +K_{H} \epsilon _{w}`, with +:math:`\epsilon _{a}`, :math:`\epsilon _{w}`, and :math:`K_{H}` (-) the air-filled porosity, water-filled porosity, and partitioning coefficient for the species of interest, -respectively, and :math:`C` represents CH\ :math:`{}_{4}` or -O\ :math:`{}_{2}` concentration with respect to water volume (mol -m\ :math:`{}^{-3}`). +respectively, and :math:`C` represents CH\ :sub:`4` or O\ :sub:`2` concentration with respect to water volume (mol m\ :sup:`-3`). An analogous version of equation is concurrently solved for -O\ :math:`{}_{2}`, but with the following differences relative to -CH\ :math:`{}_{4}`: *P* = *E* = 0 (i.e., no production or ebullition), -and the oxidation sink includes the O\ :math:`{}_{2}` demanded by +O\ :sub:`2`, but with the following differences relative to +CH\ :sub:`4`: *P* = *E* = 0 (i.e., no production or ebullition), +and the oxidation sink includes the O\ :sub:`2` demanded by methanotrophs, heterotroph decomposers, nitrifiers, and autotrophic root respiration. As currently implemented, each gridcell contains an inundated and a non-inundated fraction. Therefore, equation is solved four times for each gridcell and time step: in the inundated and non-inundated -fractions, and for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`. If desired, -the CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` mass balance equation is +fractions, and for CH\ :sub:`4` and O\ :sub:`2`. If desired, +the CH\ :sub:`4` and O\ :sub:`2` mass balance equation is solved again for lakes (Chapter 9). For non-inundated areas, the water table interface is defined at the deepest transition from greater than 95% saturated to less than 95% saturated that occurs above frozen soil layers. The inundated fraction is allowed to change at each time step, -and the total soil CH\ :math:`{}_{4}` quantity is conserved by evolving -CH\ :math:`{}_{4}` to the atmosphere when the inundated fraction +and the total soil CH\ :sub:`4` quantity is conserved by evolving +CH\ :sub:`4` to the atmosphere when the inundated fraction decreases, and averaging a portion of the non-inundated concentration into the inundated concentration when the inundated fraction increases. Figure 19.1. Schematic representation of biological and physical -processes integrated in CLM that affect the net CH\ :math:`{}_{4}` +processes integrated in CLM that affect the net CH\ :sub:`4` surface flux (Riley et al. 2011a). (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. -|image| +.. image:: image1.png -19.3 CH\ :math:`{}_{4}` Production +CH\ :sub:`4` Production ---------------------------------- Because CLM does not currently specifically represent wetland plant functional types or soil biogeochemical processes, we used gridcell-averaged decomposition rates as proxies. Thus, the upland (default) heterotrophic respiration is used to estimate the wetland -decomposition rate after first dividing off the O\ :math:`{}_{2}` -limitation. The O\ :math:`{}_{2}` consumption associated with anaerobic +decomposition rate after first dividing off the O\ :sub:`2` +limitation. The O\ :sub:`2` consumption associated with anaerobic decomposition is then set to the unlimited version so that it will be -reduced appropriately during O\ :math:`{}_{2}` competition. -CH\ :math:`{}_{4}` production at each soil level in the anaerobic +reduced appropriately during O\ :sub:`2` competition. +CH\ :sub:`4` production at each soil level in the anaerobic portion (i.e., below the water table) of the column is related to the gridcell estimate of heterotrophic respiration from soil and litter -(*R\ :math:`{}_{H}`*; mol C m\ :math:`{}^{-2}` -s\ :math:`{}^{-}`\ :math:`{}^{1}`) corrected for its soil temperature -(*T\ :math:`{}_{s}`*) dependence, soil temperature through a -*Q*\ :math:`{}_{10}` factor (:math:`f_{T}` ), pH (:math:`f_{pH}` ), -redox potential (:math:`f_{pE}` ), and a factor accounting for the +(R\ :sub:`H`; mol C m\ :sup:`-2` s\ :sub:`-1`) corrected for its soil temperature +(:math:`{T}_{s}`) dependence, soil temperature through a +:math:`{A}_{10}` factor (:math:`f_{T}`), pH (:math:`f_{pH}`), +redox potential (:math:`f_{pE}`), and a factor accounting for the seasonal inundation fraction (*S*, described below): .. math:: + :label: ZEqnNum109798 - \label{ZEqnNum109798} P=R_{H} f_{CH_{4} } f_{T} f_{pH} f_{pE} S. Here, :math:`f_{CH_{4} }` is the baseline ratio between -CO\ :math:`{}_{2}` and CH\ :math:`{}_{4}` production (all parameters +CO\ :sub:`2` and CH\ :sub:`4` production (all parameters values are given in Table 19.1). Currently, :math:`f_{CH_{4} }` is modified to account for our assumptions that methanogens may have a higher Q\ :math:`{}_{10}` than aerobic decomposers; are not N limited; @@ -126,27 +119,24 @@ When the single BGC soil level is used in CLM (Chapter 15), the temperature factor, :math:`f_{T}` , is set to 0 for temperatures equal to or below freezing, even though CLM allows heterotrophic respiration below freezing. However, if the vertically resolved BGC soil column is -used, CH\ :math:`{}_{4}` production continues below freezing because +used, CH\ :sub:`4` production continues below freezing because liquid water stress limits decomposition. The base temperature for the -*Q*\ :math:`{}_{10}` factor, *T\ :math:`{}_{B}`*, is 22 -:math:`{}^\circ`\ C and effectively modified the base -:math:`f_{CH_{4} }` value. +:math:`{Q}_{10}` factor, :math:`{T}_{B}`, is 22\ :sup:`o` C and effectively modified the base +:math:`f_{CH_{4}}` value. -For the single-layer BGC version, *R\ :math:`{}_{H}`* is distributed ** +For the single-layer BGC version, :math:`{R}_{H}` is distributed among soil levels by assuming that 50% is associated with the roots (using the CLM PFT-specific rooting distribution) and the rest is evenly divided among the top 0.28 m of soil (to be consistent with CLM’s soil decomposition algorithm). For the vertically resolved BGC version, the -prognosed distribution of *R\ :math:`{}_{H}`* is used to estimate -CH\ :math:`{}_{4}` production. +prognosed distribution of :math:`{R}_{H}` is used to estimate CH\ :sub:`4` production. The factor :math:`f_{pH}` is nominally set to 1, although a static -spatial map of *pH* can be used to determine this factor (Dunfield et -al. 1993) by applying: +spatial map of *pH* can be used to determine this factor (Dunfield et al. 1993) by applying: .. math:: + :label: 19.3) - \label{19.3)} f_{pH} =10^{-0.2235pH^{2} +2.7727pH-8.6} . The :math:`f_{pE}` factor assumes that alternative electron acceptors @@ -157,26 +147,26 @@ in the upland fraction of the gridcell. We consider both :math:`f_{pH}` and :math:`f_{pE}` to be poorly constrained in the model and identify these controllers as important areas for model improvement. -As a non-default option to account for CH\ :math:`{}_{4}` production in +As a non-default option to account for CH\ :sub:`4` production in anoxic microsites above the water table, we apply the Arah and Stephen (1998) estimate of anaerobic fraction: .. math:: + :label: 19.4) - \label{19.4)} \varphi =\frac{1}{1+\eta C_{O_{2} } } . -Here, *:math:`\varphi`* is the factor by which production is inhibited +Here, :math:`\phi` is the factor by which production is inhibited above the water table (compared to production as calculated in equation -, :math:`C_{O_{2} }` (mol m\ :math:`{}^{-3}`) is the bulk soil oxygen -concentration, and *:math:`\eta`* = 400 mol m\ :math:`{}^{-3}`. +, :math:`C_{O_{2}}` (mol m\ :sup:`-3`) is the bulk soil oxygen +concentration, and :math:`\eta` = 400 mol m\ :sup:`-3`. -The O\ :math:`{}_{2}` required to facilitate the vertically resolved +The O\ :sub:`2` required to facilitate the vertically resolved heterotrophic decomposition and root respiration is estimated assuming 1 -mol O\ :math:`{}_{2}` is required per mol CO\ :math:`{}_{2}` produced. -The model also calculates the O\ :math:`{}_{2}` required during -nitrification, and the total O\ :math:`{}_{2}` demand is used in the -O\ :math:`{}_{2}` mass balance solution. +mol O\ :sub:`2` is required per mol CO\ :sub:`2` produced. +The model also calculates the O\ :sub:`2` required during +nitrification, and the total O\ :sub:`2` demand is used in the +O\ :sub:`2` mass balance solution. Table 19.1. Parameter descriptions and sensitivity analysis ranges applied in the methane model. @@ -184,79 +174,74 @@ applied in the methane model. +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ | Mechanism | Parameter | Baseline Value | Range for Sensitivity Analysis | Units | Description | +==============+============================+==============================================+==================================================================================================+=============================================+============================================================================================+ -| Production | *Q\ :math:`{}_{10}`* | 2 | 1.5 – 4 | - | CH\ :math:`{}_{4}` production Q\ :math:`{}_{10}` | +| Production | :math:`{Q}_{10}` | 2 | 1.5 – 4 | - | CH\ :sub:`4` production :math:`{Q}_{10}` | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{pH}` | 1 | On, off | - | Impact of pH on CH\ :math:`{}_{4}` production | +| | :math:`f_{pH}` | 1 | On, off | - | Impact of pH on CH\ :sub:`4` production | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{pE}` | 1 | On, off | - | Impact of redox potential on CH\ :math:`{}_{4}` production | +| | :math:`f_{pE}` | 1 | On, off | - | Impact of redox potential on CH\ :sub:`4` production | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| ** | *S* | Varies | NA | - | Seasonal inundation factor | +| | *S* | Varies | NA | - | Seasonal inundation factor | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | *:math:`\beta`* | 0.2 | NA | - | Effect of anoxia on decomposition rate (used to calculate *S* only) | +| | :math:`\beta` | 0.2 | NA | - | Effect of anoxia on decomposition rate (used to calculate *S* only) | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{CH_{4} }` | 0.2 | NA | - | Ratio between CH\ :math:`{}_{4}` and CO\ :math:`{}_{2}` production below the water table | +| | :math:`f_{CH_{4} }` | 0.2 | NA | - | Ratio between CH\ :sub:`4` and CO\ :sub:`2` production below the water table | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Ebullition | *C\ :math:`{}_{e,max}`* | 0.15 | NA | mol m\ :math:`{}^{-3}` | CH\ :math:`{}_{4}` concentration to start ebullition | +| Ebullition | :math:`{C}_{e,max}` | 0.15 | NA | mol m\ :sup:`-3` | CH\ :sub:`4` concentration to start ebullition | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| ** | *C\ :math:`{}_{e,min}`* | 0.15 | NA | - | CH\ :math:`{}_{4}` concentration to end ebullition | +| | :math:`{C}_{e,min}` | 0.15 | NA | - | CH\ :sub:`4` concentration to end ebullition | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Diffusion | :math:`f_{D_{0} }` \ ** | 1 | 1, 10 | m\ :math:`{}^{2}` s\ :math:`{}^{-1}` | Diffusion coefficient multiplier (Table 19.2) | +| Diffusion | :math:`f_{D_{0} }` | 1 | 1, 10 | m\ :sup:`2` s\ :sup:`-1` | Diffusion coefficient multiplier (Table 19.2) | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ | Aerenchyma | *p* | 0.3 | NA | - | Grass aerenchyma porosity | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| ** | *R* | 2.9\ :math:`\times`\ 10\ :math:`{}^{-3}` m | NA | m | Aerenchyma radius | +| | *R* | 2.9\ :math:`\times`\ 10\ :sup:`-3` m | NA | m | Aerenchyma radius | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| ** | *r\ :math:`{}_{L}`* | 3 | NA | - | Root length to depth ratio | +| | :math:`{r}_{L}` | 3 | NA | - | Root length to depth ratio | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | *F\ :math:`{}_{a}`* | 1 | 0.5 – 1.5 | - | Aerenchyma conductance multiplier | +| | :math:`{F}_{a}` | 1 | 0.5 – 1.5 | - | Aerenchyma conductance multiplier | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Oxidation | :math:`K_{CH_{4} }` | 5 x 10\ :math:`{}^{-3}` | 5\ :math:`\times`\ 10\ :math:`{}^{-4}`\ :math:`{}_{ }`- 5\ :math:`\times`\ 10\ :math:`{}^{-2}` | mol m\ :math:`{}^{-3}` | CH\ :math:`{}_{4}` half-saturation oxidation coefficient (wetlands) | +| Oxidation | :math:`K_{CH_{4} }` | 5 x 10\ :sup:`-3` | 5\ :math:`\times`\ 10\ :math:`{}^{-4}`\ :math:`{}_{ }`- 5\ :math:`\times`\ 10\ :sup:`-2` | mol m\ :sup:`-3` | CH\ :sub:`4` half-saturation oxidation coefficient (wetlands) | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| ** | :math:`K_{O_{2} }` \ ** | 2 x 10\ :math:`{}^{-2}` | 2\ :math:`\times`\ 10\ :math:`{}^{-3}` - 2\ :math:`\times`\ 10\ :math:`{}^{-1}` | mol m\ :math:`{}^{-3}` | O\ :math:`{}_{2}` half-saturation oxidation coefficient | +| | :math:`K_{O_{2} }` | 2 x 10\ :sup:`-2` | 2\ :math:`\times`\ 10\ :sup:`-3` - 2\ :math:`\times`\ 10\ :sup:`-1` | mol m\ :sup:`-3` | O\ :sub:`2` half-saturation oxidation coefficient | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`R_{o,\max }` \ ** | 1.25 x 10\ :math:`{}^{-5}` | 1.25\ :math:`\times`\ 10\ :math:`{}^{-6}` - 1.25\ :math:`\times`\ 10\ :math:`{}^{-4}` | mol m\ :math:`{}^{-3}` s\ :math:`{}^{-1}` | Maximum oxidation rate (wetlands) | +| | :math:`R_{o,\max }` | 1.25 x 10\ :math:`{}^{-5}` | 1.25\ :math:`\times`\ 10\ :math:`{}^{-6}` - 1.25\ :math:`\times`\ 10\ :math:`{}^{-4}` | mol m\ :sup:`-3` s\ :sup:`-1` | Maximum oxidation rate (wetlands) | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -.. math:: 8 - -.. math:: 17 - Ebullition --------------- -Briefly, the simulated aqueous CH\ :math:`{}_{4}` concentration in each +Briefly, the simulated aqueous CH\ :sub:`4` concentration in each soil level is used to estimate the expected equilibrium gaseous partial pressure (:math:`C_{e}` ), as a function of temperature and depth below the water table, by first estimating the Henry’s law partitioning -coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. -(2010): +coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. (2010): .. math:: + :label: 19.5) - \label{19.5)} \log \left(\frac{1}{k_{H} } \right)=\log k_{H}^{s} -\frac{1}{C_{H} } \left(\frac{1}{T} -\frac{1}{T^{s} } \right) .. math:: + :label: ZEqnNum493232 - \label{ZEqnNum493232} k_{h}^{C} =Tk_{H} R_{g} .. math:: + :label: 19.7) - \label{19.7)} C_{e} =\frac{C_{w} R_{g} T}{\theta _{s} k_{H}^{C} p} where :math:`C_{H}` \ is a constant, :math:`R_{g}` is the universal gas constant, :math:`k_{H}^{s}` is Henry’s law partitioning coefficient at standard temperature (:math:`T^{s}` ),\ :math:`C_{w}` \ is local -aqueous CH\ :math:`{}_{4}` concentration, and *p* is pressure. +aqueous CH\ :sub:`4` concentration, and *p* is pressure. The local pressure is calculated as the sum of the ambient pressure, water pressure down to the local depth, and pressure from surface -ponding (if applicable). When the CH\ :math:`{}_{4}` partial pressure +ponding (if applicable). When the CH\ :sub:`4` partial pressure exceeds 15% of the local pressure (Baird et al. 2004; Strack et al. -2006; Wania et al. 2010), bubbling occurs to remove CH\ :math:`{}_{4}` -to below this value, modified by the fraction of CH\ :math:`{}_{4}` in +2006; Wania et al. 2010), bubbling occurs to remove CH\ :sub:`4` +to below this value, modified by the fraction of CH\ :sub:`4` in the bubbles [taken as 57%; (Kellner et al. 2006; Wania et al. 2010)]. Bubbles are immediately added to the surface flux for saturated columns and are placed immediately above the water table interface in @@ -271,21 +256,19 @@ atmosphere and, if specified, by vertical advection with the transpiration stream. There is evidence that pressure driven flow can also occur, but we did not include that mechanism in the current model. -The diffusive transport through aerenchyma (*A*, mol m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) from each soil layer is represented in the model as: +The diffusive transport through aerenchyma (*A*, mol m\ :sup:`-2` s\ :sup:`-1`) from each soil layer is represented in the model as: .. math:: + :label: ZEqnNum158128 - \label{ZEqnNum158128} A=\frac{C\left(z\right)-C_{a} }{{\raise0.7ex\hbox{$ r_{L} z $}\!\mathord{\left/ {\vphantom {r_{L} z D}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ D $}} +r_{a} } pT\rho _{r} , - -where *D* is the free-air gas diffusion coefficient (m:math:`{}^{2}` -s\ :math:`{}^{-1}`); *C(z)* (mol m\ :math:`{}^{-3}`) is the gaseous + +where *D* is the free-air gas diffusion coefficient (m:sup:`2` s\ :sup:`-1`); *C(z)* (mol m\ :sup:`-3`) is the gaseous concentration at depth *z* (m); :math:`r_{L}` is the ratio of root length to depth; *p* is the porosity (-); *T* is specific aerenchyma -area (m:math:`{}^{2}` m\ :math:`{}^{-2}`); *r\ :math:`{}_{a}`* is the +area (m:sup:`2` m\ :sup:`-2`); :math:`{r}_{a}` is the aerodynamic resistance between the surface and the atmospheric reference -height (s m:math:`{}^{-1}`); and :math:`\rho _{r}` is the rooting +height (s m:sup:`-1`); and :math:`\rho _{r}` is the rooting density as a function of depth (-). The gaseous concentration is calculated with Henry’s law as described in equation . @@ -293,125 +276,121 @@ Based on the ranges reported in Colmer (2003), we have chosen baseline aerenchyma porosity values of 0.3 for grass and crop PFTs and 0.1 for tree and shrub PFTs. The aerenchyma area varies over the course of the growing season; we parameterize this dependency using the simulated leaf -area index *L* (m:math:`{}^{2}` m\ :math:`{}^{-2}`), as in Wania et al. +area index *L* (m:sup:`2` m\ :sup:`-2`), as in Wania et al. (2010): .. math:: + :label: 19.9) - \label{19.9)} T=\frac{f_{N} N_{a} L}{0.22} \pi R^{2} . Here :math:`N_{a}` is annual net primary production (NPP, mol -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`); *R* is the aerenchyma radius -(2.9:math:`\times`\ 10\ :math:`{}^{-3}` m); *f\ :math:`{}_{N}`* is the +m\ :sup:`-2` s\ :sup:`-1`); *R* is the aerenchyma radius +(2.9:math:`\times`\ 10\ :sup:`-3` m); :math:`{f}_{N}` is the belowground fraction of annual NPP; and the 0.22 factor represents the -amount of C per tiller. O\ :math:`{}_{2}` can also diffuse in from the +amount of C per tiller. O\ :sub:`2` can also diffuse in from the atmosphere to the soil layer via the reverse of the same pathway, with the same representation as Equation but with the gas diffusivity of oxygen. -CLM also simulates the direct emission of CH\ :math:`{}_{4}` from leaves +CLM also simulates the direct emission of CH\ :sub:`4` from leaves to the atmosphere via transpiration of dissolved methane. We calculate -this flux (:math:`F_{CH_{4} -T}` ; mol m\ :math:`{}^{-}`\ :math:`{}^{2}` -s\ :math:`{}^{-1}`) using the simulated soil water methane concentration -(:math:`C_{CH_{4} ,j}` (mol m\ :math:`{}^{-3}`)) in each soil layer *j* +this flux (:math:`F_{CH_{4} -T}` ; mol m\ :math:`{}^{-}`\ :sup:`2` +s\ :sup:`-1`) using the simulated soil water methane concentration +(:math:`C_{CH_{4} ,j}` (mol m\ :sup:`-3`)) in each soil layer *j* and the CLM predicted transpiration (:math:`F_{T}` ) for each PFT, assuming that no methane was oxidized inside the plant tissue: .. math:: + :label: 19.10) - \label{19.10)} F_{CH_{4} -T} =\sum _{j}\rho _{r,j} F_{T} C_{CH_{4} ,j} . -CH\ :math:`{}_{4}` Oxidation +CH\ :sub:`4` Oxidation --------------------------------- -CLM represents CH\ :math:`{}_{4}` oxidation with double Michaelis-Menten +CLM represents CH\ :sub:`4` oxidation with double Michaelis-Menten kinetics (Arah and Stephen 1998; Segers 1998), dependent on both the -gaseous CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` concentrations: +gaseous CH\ :sub:`4` and O\ :sub:`2` concentrations: .. math:: + :label: 19.11) - \label{19.11)} R_{oxic} =R_{o,\max } \left[\frac{C_{CH_{4} } }{K_{CH_{4} } +C_{CH_{4} } } \right]\left[\frac{C_{O_{2} } }{K_{O_{2} } +C_{O_{2} } } \right]Q_{10} F_{\vartheta } where :math:`K_{CH_{4} }` and :math:`K_{O_{2} }` \ are the half -saturation coefficients (mol m\ :math:`{}^{-3}`) with respect to -CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` concentrations, respectively; +saturation coefficients (mol m\ :sup:`-3`) with respect to +CH\ :sub:`4` and O\ :sub:`2` concentrations, respectively; :math:`R_{o,\max }` is the maximum oxidation rate (mol -m\ :math:`{}^{-3}` s\ :math:`{}^{-1}`); and *Q\ :math:`{}_{10}`* +m\ :sup:`-3` s\ :sup:`-1`); and :math:`{Q}_{10}` specifies the temperature dependence of the reaction with a base -temperature set to 12 :math:`{}^\circ`\ C. The soil moisture limitation -factor :math:`F_{\vartheta }` is applied above the water table to +temperature set to 12 :sup:`o` C. The soil moisture limitation +factor :math:`F_{\theta }` is applied above the water table to represent water stress for methanotrophs. Based on the data in Schnell -and King (1996), we take :math:`F_{\vartheta } =e^{{\raise0.7ex\hbox{` --P -:math:`}\!\mathord{\left/ {\vphantom {-P P_{c} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{` -P\ :sub:`c` :math:`}} }` , where *P* is the soil moisture potential and -*P\ :math:`{}_{c}`* = -2.4:math:`\times`\ 10\ :math:`{}^{5}` mm. +and King (1996), we take :math:`F_{\theta } = {e}^{-P/{P}_{c}}`, where *P* is the soil moisture potential and +:math:`{P}_{c} = -2.4 \times {10}^{5}` mm. Reactive Transport Solution -------------------------------- The solution to equation is solved in several sequential steps: resolve -competition for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` (section +competition for CH\ :sub:`4` and O\ :sub:`2` (section 19.7.1); add the ebullition flux into the layer directly above the water -table or into the atmosphere; calculate the overall CH\ :math:`{}_{4}` -or O\ :math:`{}_{2}` source term based on production, aerenchyma +table or into the atmosphere; calculate the overall CH\ :sub:`4` +or O\ :sub:`2` source term based on production, aerenchyma transport, ebullition, and oxidation; establish boundary conditions, including surface conductance to account for snow, ponding, and turbulent conductances and bottom flux condition (section 19.7.2); calculate diffusivity (section 19.7.3); and solve the resulting mass balance using a tridiagonal solver (section 19.7.5). -19.7.1 Competition for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` +Competition for CH\ :sub:`4` and O\ :sub:`2` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -For each time step, the unlimited CH\ :math:`{}_{4}` and -O\ :math:`{}_{2}` demands in each model depth interval are computed. If +For each time step, the unlimited CH\ :sub:`4` and +O\ :sub:`2` demands in each model depth interval are computed. If the total demand over a time step for one of the species exceeds the amount available in a particular control volume, the demand from each process associated with the sink is scaled by the fraction required to ensure non-negative concentrations. Since the methanotrophs are limited -by both CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`, the stricter +by both CH\ :sub:`4` and O\ :sub:`2`, the stricter limitation is applied to methanotroph oxidation, and then the limitations are scaled back for the other processes. The competition is designed so that the sinks must not exceed the available concentration over the time step, and if any limitation exists, the sinks must sum to this value. Because the sinks are calculated explicitly while the transport is semi-implicit, negative concentrations can occur after the -tridiagonal solution. When this condition occurs for O\ :math:`{}_{2}`, +tridiagonal solution. When this condition occurs for O\ :sub:`2`, the concentrations are reset to zero; if it occurs for -CH\ :math:`{}_{4}`, the surface flux is adjusted and the concentration +CH\ :sub:`4`, the surface flux is adjusted and the concentration is set to zero if the adjustment is not too large. -19.7.2 CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` Source Terms +19.7.2 CH\ :sub:`4` and O\ :sub:`2` Source Terms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The overall CH\ :math:`{}_{4}` net source term consists of production, +The overall CH\ :sub:`4` net source term consists of production, oxidation at the base of aerenchyma, transport through aerenchyma, methanotrophic oxidation, and ebullition (either to the control volume above the water table if unsaturated or directly to the atmosphere if -saturated). For O\ :math:`{}_{2}` below the top control volume, the net -source term consists of O\ :math:`{}_{2}` losses from methanotrophy, SOM -decomposition, and autotrophic respiration, and an O\ :math:`{}_{2}` +saturated). For O\ :sub:`2` below the top control volume, the net +source term consists of O\ :sub:`2` losses from methanotrophy, SOM +decomposition, and autotrophic respiration, and an O\ :sub:`2` source through aerenchyma. 19.7.3 Aqueous and Gaseous Diffusion ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For gaseous diffusion, we adopted the temperature dependence of -molecular free-air diffusion coefficients (*D\ :math:`{}_{0}`* -(m:math:`{}^{2}` s\ :math:`{}^{-1}`)) as described by Lerman et al. -(1979) and applied by Wania et al. (2010) (Table 19.2). +molecular free-air diffusion coefficients (:math:`{D}_{0}` +(m:sup:`2` s\ :sup:`-1`)) as described by Lerman et al. (1979) and applied by Wania et al. (2010) (Table 19.2). Table 19.2. Temperature dependence of aqueous and gaseous diffusion -coefficients for CH\ :math:`{}_{4}` and O\ :math:`{}_{2}`. +coefficients for CH\ :sub:`4` and O\ :sub:`2`. +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ -| D\ :math:`{}_{0}` (m:math:`{}^{2}` s\ :math:`{}^{-1}`) | CH\ :math:`{}_{4}` | O\ :math:`{}_{2}` | +| :math:`{D}_{0}` (m\ :sup:`2` s\ :sup:`-1`) | CH\ :sub:`4` | O\ :sub:`2` | +==========================================================+==========================================================+========================================================+ -| Aqueous | 0.9798 + 0.02986\ *T* + 0.0004381\ *T*\ :math:`{}^{2}` | 1.172+ 0.03443\ *T* + 0.0005048\ *T*\ :math:`{}^{2}` | +| Aqueous | 0.9798 + 0.02986\ *T* + 0.0004381\ *T*\ :sup:`2` | 1.172+ 0.03443\ *T* + 0.0005048\ *T*\ :sup:`2` | +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ | Gaseous | 0.1875 + 0.0013\ *T* | 0.1759 + 0.0011\ *T* | +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ @@ -420,12 +399,12 @@ Gaseous diffusivity in soils also depends on the molecular diffusivity, soil structure, porosity, and organic matter content. Moldrup et al. (2003), using observations across a range of unsaturated mineral soils, showed that the relationship between effective diffusivity -(:math:`D_{e}` (m:math:`{}^{2}` s\ :math:`{}^{-1}`)) and soil +(:math:`D_{e}` (m:sup:`2` s\ :sup:`-1`)) and soil properties can be represented as: .. math:: + :label: ZEqnNum730978 - \label{ZEqnNum730978} D_{e} =D_{0} \theta _{a}^{2} \left(\frac{\theta _{a} }{\theta _{s} } \right)^{{\raise0.7ex\hbox{$ 3 $}\!\mathord{\left/ {\vphantom {3 b}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ b $}} } , where :math:`\theta _{a}` and :math:`\theta _{s}` are the air-filled @@ -436,26 +415,26 @@ Hasegawa (2005) have shown that the original Millington-Quirk closely in unsaturated peat soils: .. math:: + :label: ZEqnNum437147 - \label{ZEqnNum437147} D_{e} =D_{0} \frac{\theta _{a} ^{{\raise0.7ex\hbox{$ 10 $}\!\mathord{\left/ {\vphantom {10 3}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ 3 $}} } }{\theta _{s} ^{2} } In CLM, we applied equation for soils with zero organic matter content -and equation for soils with more than 130 kg m\ :math:`{}^{-3}` organic +and equation for soils with more than 130 kg m\ :sup:`-3` organic matter content. A linear interpolation between these two limits is -applied for soils with SOM content below 130 kg m\ :math:`{}^{-3}`. For +applied for soils with SOM content below 130 kg m\ :sup:`-3`. For aqueous diffusion in the saturated part of the soil column, we applied (Moldrup et al. 2003): .. math:: + :label: 19.14) - \label{19.14)} D_{e} =D_{0} \theta _{s} ^{2} . To simplify the solution, we assumed that gaseous diffusion dominates above the water table interface and aqueous diffusion below the water table interface. Descriptions, baseline values, and dimensions for -parameters specific to the CH\ :math:`{}_{4}` model are given in Table +parameters specific to the CH\ :sub:`4` model are given in Table 19.1. For freezing or frozen soils below the water table, diffusion is limited to the remaining liquid (CLM allows for some freezing point depression), and the diffusion coefficients are scaled by the @@ -465,7 +444,7 @@ equilibrium is assumed at the interface with the water table. 19.7.4 Boundary Conditions ^^^^^^^^^^^^^^^^^^^^^^^^^^ -We assume the CH\ :math:`{}_{4}` and O\ :math:`{}_{2}` surface fluxes +We assume the CH\ :sub:`4` and O\ :sub:`2` surface fluxes can be calculated from an effective conductance and a gaseous concentration gradient between the atmospheric concentration and either the gaseous concentration in the first soil layer (unsaturated soils) or @@ -481,7 +460,7 @@ with a series combination: :math:`\left[\frac{1}{w} +\frac{\Delta x_{1} }{D_{1} } \right]^{-1}` , and if the top layer is saturated, this term is replaced with :math:`\left[\frac{K_{H} }{w} +\frac{\frac{1}{2} \Delta x_{1} }{D_{1} } \right]^{-1}` , -where *K\ :math:`{}_{H}`* is the Henry’s law equilibrium constant. +where :math:`{K}_{H}` is the Henry’s law equilibrium constant. When snow is present, a resistance is added to account for diffusion through the snow based on the Millington-Quirk expression (equation ) @@ -492,7 +471,7 @@ ponding depth to diffusivity. The overall conductance is taken as the series combination of surface, snow, and ponding resistances. We assume a zero flux gradient at the bottom of the soil column. -19.7.5 Crank-Nicholson Solution +Crank-Nicholson Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Equation is solved using a Crank-Nicholson solution (Press et al. 1992), @@ -500,13 +479,13 @@ which combines fully explicit and implicit representations of the mass balance. The fully explicit decomposition of equation can be written as .. math:: + :label: ZEqnNum395184 - \label{ZEqnNum395184} \frac{R_{j}^{n+1} C_{j}^{n+1} -R_{j}^{n} C_{j}^{n} }{\Delta t} =\frac{1}{\Delta x_{j} } \left[\frac{D_{p1}^{n} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{n} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+S_{j}^{n} , where *j* refers to the cell in the vertically discretized soil column (increasing downward), *n* refers to the current time step, -*:math:`\Delta`\ t* is the time step (s), *p1* is *j+½*, *m1* is *j-½*, +:math:`\Delta`\ *t* is the time step (s), *p1* is *j+½*, *m1* is *j-½*, and :math:`S_{j}^{n}` is the net source at time step *n* and position *j*, i.e., :math:`S_{j}^{n} =P\left(j,n\right)-E\left(j,n\right)-A\left(j,n\right)-O\left(j,n\right)`. @@ -520,15 +499,15 @@ Using an average of the fully implicit and fully explicit relationships gives: .. math:: + :label: ZEqnNum463314 - \label{ZEqnNum463314} \begin{array}{l} {-\frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1}^{} } C_{j-1}^{n+1} +\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(\frac{D_{p1}^{} }{\Delta x_{p1}^{} } +\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \right)\right]C_{j}^{n+1} -\frac{1}{2\Delta x_{j} } \frac{D_{p1}^{} }{\Delta x_{p1}^{} } C_{j+1}^{n+1} =} \\ {\frac{R_{j}^{n} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right]} \end{array}, Equation is solved with a standard tridiagonal solver, i.e.: .. math:: + :label: 19.17) - \label{19.17)} aC_{j-1}^{n+1} +bC_{j}^{n+1} +cC_{j+1}^{n+1} =r, with coefficients specified in equation . @@ -538,7 +517,7 @@ the diffusion solution and the time-varying aggregation over inundated and non-inundated areas strictly conserves methane molecules (except for production minus consumption) and carbon atoms. -19.7.6 Interface between water table and unsaturated zone +Interface between water table and unsaturated zone ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We assume Henry’s Law equilibrium at the interface between the saturated @@ -552,8 +531,8 @@ soil element above the interface: .. math:: b=\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(K_{H} \frac{D_{p1}^{} }{\Delta x_{p1} } +\frac{D_{m1}^{} }{\Delta x_{m1} } \right)\right] .. math:: + :label: 19.18) - \label{19.18)} r=\frac{R_{j}^{n} }{\Delta t} C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -K_{H} C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] and the soil element below the interface: @@ -563,8 +542,8 @@ and the soil element below the interface: .. math:: a=-K_{H} \frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1} } .. math:: + :label: 19.19) - \label{19.19)} r=\frac{R_{j}^{n} }{\Delta t} +C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -K_{H} C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] Inundated Fraction Prediction @@ -573,26 +552,25 @@ Inundated Fraction Prediction We developed a simplified dynamic representation of spatial inundation based on recent work by Prigent et al. (2007), who described a multi-satellite approach to estimate the global monthly inundated -fraction (*F\ :math:`{}_{i}`*) over an equal area grid +fraction (:math:`{F}_{i}`) over an equal area grid (0.25:math:`\circ`\ :math:`\times`\ 0.25\ :math:`\circ` at the equator) from 1993 - 2000. They suggested that the IGBP estimate for inundation could be used as a measure of sensitivity of their detection approach at low inundation. We therefore used the sum of their satellite-derived -*F\ :math:`{}_{i}`* and the constant IGBP estimate when it was less than +:math:`{F}_{i}` and the constant IGBP estimate when it was less than 10% to perform a simple inversion for the inundated fraction for methane -production (*f\ :math:`{}_{s}`*). The method optimized three parameters -(*p\ :math:`{}_{1}`*, *p\ :math:`{}_{2}`*, *p\ :math:`{}_{3}`*) for each +production (:math:`{f}_{s}`). The method optimized three parameters +(:math:`{p}_{1}`, *p*\ :sub:`2`, :math:`{p}_{3}`) for each grid cell in a simple model based on simulated water table depth -(*z\ :math:`{}_{w}`*) and surface runoff (*Q\ :math:`{}_{r}`* (mm -s\ :math:`{}^{-1}`)): +(:math:`{z}_{w}`) and surface runoff (:math:`{Q}_{r}` (mm s\ :sup:`-1`)): .. math:: + :label: 19.20) - \label{19.20)} f_{s} =P_{1} e^{{\raise0.7ex\hbox{$ -z_{w} $}\!\mathord{\left/ {\vphantom {-z_{w} p_{2} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ p_{2} $}} } +p_{3} Q_{r} . These parameters were evaluated at the -0.5\ **:math:`\boldsymbol{{}^\circ}`** resolution, and aggregated for +0.5\ :sup:`o` resolution, and aggregated for coarser simulations. We expect that ongoing work in the hydrology submodel of CLM will alleviate the need for this crude simplification of inundated fraction in future model versions. @@ -601,19 +579,18 @@ Seasonal Inundation ------------------------ We have developed a simplified scaling factor to mimic the impact of -seasonal inundation on CH\ :math:`{}_{4}` production (see appendix B in +seasonal inundation on CH\ :sub:`4` production (see appendix B in Riley et al. (2011a) for a discussion of this simplified expression): .. math:: + :label: 19.21) - \label{19.21)} S=\frac{\beta \left(f-\bar{f}\right)+\bar{f}}{f} ,S\le 1. Here, *f* is the instantaneous inundated fraction, :math:`\bar{f}` is the annual average inundated fraction (evaluated for the previous calendar year) weighted by heterotrophic respiration, and -*:math:`\beta`* is the anoxia factor that relates the fully anoxic +:math:`\beta` is the anoxia factor that relates the fully anoxic decomposition rate to the fully oxygen-unlimited decomposition rate, all other conditions being equal. -.. |image| image:: image1 diff --git a/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst b/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst index 0e29f00078..d19fdd3f5d 100644 --- a/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst +++ b/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst @@ -135,52 +135,46 @@ Table 2.1. Plant functional types +--------------------------------------------------------------+-------------------+ | Broadleaf deciduous shrub – boreal | BDS Boreal | +--------------------------------------------------------------+-------------------+ -| C\ :math:`{}_{3}` arctic grass | - | +| C\ :sub:`3` arctic grass | - | +--------------------------------------------------------------+-------------------+ -| C\ :math:`{}_{3}` grass | - | +| C\ :sub:`3` grass | - | +--------------------------------------------------------------+-------------------+ -| C\ :math:`{}_{4}` grass | - | +| C\ :sub:`4` grass | - | +--------------------------------------------------------------+-------------------+ -| C\ :math:`{}_{3}` Unmanaged Rainfed Crop | Crop R | +| C\ :sub:`3` Unmanaged Rainfed Crop | Crop R | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{1}`\ C\ :math:`{}_{3}` Unmanaged Irrigated Crop | Crop I | +| :sup:`1`\ C\ :sub:`3` Unmanaged Irrigated Crop | Crop I | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Rainfed Corn | Corn R | +| :sup:`2`\ Rainfed Corn | Corn R | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Irrigated Corn | Corn I | +| :sup:`2`\ Irrigated Corn | Corn I | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Rainfed Temperate Cereals | Temp Cereal R | +| :sup:`2`\ Rainfed Temperate Cereals | Temp Cereal R | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Irrigated Temperate Cereals | Temp Cereal I | +| :sup:`2`\ Irrigated Temperate Cereals | Temp Cereal I | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{3}`\ Rainfed Winter Cereals | Winter Cereal R | +| :sup:`3`\ Rainfed Winter Cereals | Winter Cereal R | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{3}`\ Irrigated Winter Cereals | Winter Cereal I | +| :sup:`3`\ Irrigated Winter Cereals | Winter Cereal I | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Rainfed Soybean | Soybean R | +| :sup:`2`\ Rainfed Soybean | Soybean R | +--------------------------------------------------------------+-------------------+ -| :math:`{}^{2}`\ Irrigated Soybean | Soybean I | +| :sup:`2`\ Irrigated Soybean | Soybean I | +--------------------------------------------------------------+-------------------+ -:math:`{}^{1}`\ Only used if irrigation is active (Chapter 20). -:math:`{}^{2}`\ Only used if crop model is active (Chapter 20). -:math:`{}^{3}`\ Reserved for future implementations of crop model -(Chapter 20). +:sup:`1`\ Only used if irrigation is active (Chapter 20). +:sup:`2`\ Only used if crop model is active (Chapter 20). +:sup:`3`\ Reserved for future implementations of crop model (Chapter 20). Vegetation Structure ^^^^^^^^^^^^^^^^^^^^^^^^^^ Vegetation structure is defined by leaf and stem area indices -(:math:`L,\, S`) and canopy top and bottom heights -(:math:`z_{top}` ,\ :math:`z_{bot}` ) (Table 2.2). Separate leaf and -stem area indices and canopy heights are prescribed or calculated for -each PFT. Daily leaf and stem area indices are obtained from gridded -datasets of monthly values (section 2.2.3). Canopy top and bottom -heights are also obtained from gridded datasets. However, these are -currently invariant in space and time and were obtained from -PFT-specific values (Bonan et al. 2002a). When the biogeochemistry model -is active, vegetation state (LAI, SAI, canopy top and bottom heights) -are calculated prognostically (see Chapter 14). +(:math:`L,\, S`) and canopy top and bottom heights (:math:`z_{top}`,\ :math:`z_{bot}` ) (Table 2.2). Separate leaf and +stem area indices and canopy heights are prescribed or calculated for each PFT. Daily leaf and stem area indices are obtained from gridded +datasets of monthly values (section 2.2.3). Canopy top and bottom heights are also obtained from gridded datasets. However, these are +currently invariant in space and time and were obtained from PFT-specific values (Bonan et al. 2002a). When the biogeochemistry model +is active, vegetation state (LAI, SAI, canopy top and bottom heights) are calculated prognostically (see Chapter 14). Table 2.2. Prescribed plant functional type heights @@ -219,30 +213,30 @@ Table 2.2. Prescribed plant functional type heights +-----------------------------------+------------------------+------------------------+ | Crop I | 0.5 | 0.01 | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Corn R | - | - | +| :sup:`1`\ Corn R | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Corn I | - | - | +| :sup:`1`\ Corn I | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Temp Cereal R | - | - | +| :sup:`1`\ Temp Cereal R | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Temp Cereal I | - | - | +| :sup:`1`\ Temp Cereal I | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Winter Cereal R | - | - | +| :sup:`1`\ Winter Cereal R | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Winter Cereal I | - | - | +| :sup:`1`\ Winter Cereal I | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Soybean R | - | - | +| :sup:`1`\ Soybean R | - | - | +-----------------------------------+------------------------+------------------------+ -| :math:`{}^{1}`\ Soybean I | - | - | +| :sup:`1`\ Soybean I | - | - | +-----------------------------------+------------------------+------------------------+ -:math:`{}^{1}`\ Determined by the crop model (Chapter 20) +:sup:`1`\ Determined by the crop model (Chapter 20) Phenology and vegetation burial by snow ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When the biogeochemistry model is inactive, leaf and stem area indices -(m:math:`{}^{2}` leaf area m\ :math:`{}^{-2}` ground area) are updated +(m\ :sup:`2` leaf area m\ :sup:`-2` ground area) are updated daily by linearly interpolating between monthly values. Monthly PFT leaf area index values are developed from the 1-km MODIS-derived monthly grid cell average leaf area index of Myneni et al. (2002), as described in @@ -266,12 +260,9 @@ snow, :math:`A` is the remaining exposed leaf or stem area, {f_{veg}^{sno} = \frac{z_{sno} -z_{bot} }{z_{top} -z_{bot} } \qquad {\rm for\; tree\; and\; shrub}} \\ {f_{veg}^{sno} = \frac{\min \left(z_{sno} ,\, z_{c} \right)}{z_{c} } \qquad {\rm for\; grass\; and\; crop}} -where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, -:math:`z_{sno}` is the depth of snow (m) (section 7.2), and -:math:`z_{c} =0.2` is the snow depth when short vegetation is assumed to -be completely buried by snow (m). For numerical reasons, exposed leaf -and stem area are set to zero if less than 0.05. If the sum of exposed -leaf and stem area is zero, then the surface is treated as snow-covered +where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, :math:`z_{sno}` is the depth of snow (m) (section 7.2), and +:math:`z_{c} = 0.2` is the snow depth when short vegetation is assumed to be completely buried by snow (m). For numerical reasons, exposed leaf +and stem area are set to zero if less than 0.05. If the sum of exposed leaf and stem area is zero, then the surface is treated as snow-covered ground. Model Input Requirements @@ -299,44 +290,44 @@ Table 2.3. Atmospheric input to land model +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Field | variable name | units | +======================================================+================================================+=================================================+ -| :math:`{}^{1}`\ Reference height | :math:`z'_{atm}` | m | +| :sup:`1`\ Reference height | :math:`z'_{atm}` | m | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :math:`{}^{-1}` | +| Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :math:`{}^{-1}` | +| Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Potential temperature | :math:`\overline{\theta _{atm} }` | K | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Specific humidity at :math:`z_{atm}` | :math:`q_{atm}` | kg kg\ :math:`{}^{-1}` | +| Specific humidity at :math:`z_{atm}` | :math:`q_{atm}` | kg kg\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Pressure at :math:`z_{atm}` | :math:`P_{atm}` | Pa | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Temperature at :math:`z_{atm}` | :math:`T_{atm}` | K | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident longwave radiation | :math:`L_{atm} \, \downarrow` | W m\ :math:`{}^{-2}` | +| Incident longwave radiation | :math:`L_{atm} \, \downarrow` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :math:`{}^{2}`\ Liquid precipitation | :math:`q_{rain}` | mm s\ :math:`{}^{-1}` | +| :sup:`2`\ Liquid precipitation | :math:`q_{rain}` | mm s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :math:`{}^{2}`\ Solid precipitation | :math:`q_{sno}` | mm s\ :math:`{}^{-1}` | +| :sup:`2`\ Solid precipitation | :math:`q_{sno}` | mm s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident direct beam visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}^{\mu }` | W m\ :math:`{}^{-2}` | +| Incident direct beam visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}^{\mu }` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident direct beam near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}^{\mu }` | W m\ :math:`{}^{-2}` | +| Incident direct beam near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}^{\mu }` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident diffuse visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}` | W m\ :math:`{}^{-2}` | +| Incident diffuse visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :math:`{}^{-2}` | +| Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Carbon dioxide (CO:math:`{}_{2}`) concentration | :math:`c_{a}` | ppmv | +| Carbon dioxide (CO:sub:`2`) concentration | :math:`c_{a}` | ppmv | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :math:`{}^{3}`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | +| :sup:`3`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :sup:`-2` s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :math:`{}^{4}`\ Nitrogen deposition rate | :math:`NF_{ndep\_ s{\it min}n}` | g (N) m\ :math:`{}^{-2}` yr\ :math:`{}^{-1}` | +| :sup:`4`\ Nitrogen deposition rate | :math:`NF_{ndep\_ s{\it min}n}` | g (N) m\ :sup:`-2` yr\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :math:`{}^{5}`\ Lightning frequency | :math:`I_{l}` | flash km\ :math:`{}^{-2}` hr\ :math:`{}^{-1}` | +| :sup:`5`\ Lightning frequency | :math:`I_{l}` | flash km\ :sup:`-2` hr\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -:math:`{}^{1}`\ The atmospheric reference height received from the +:sup:`1`\ The atmospheric reference height received from the atmospheric model :math:`z'_{atm}` is assumed to be the height above the surface as defined by the roughness length :math:`z_{0}` plus displacement height :math:`d`. Thus, the reference height used for flux @@ -346,12 +337,12 @@ reference heights for temperature, wind, and specific humidity :math:`z_{atm,\, w}` ) are required. These are set equal to\ :math:`z_{atm}` . -:math:`{}^{2}`\ The placeCAM provides convective and large-scale liquid +:sup:`2`\ The placeCAM provides convective and large-scale liquid and solid precipitation, which are added to yield total liquid precipitation :math:`q_{rain}` and solid precipitation :math:`q_{sno}` . -:math:`{}^{3}`\ There are 14 aerosol deposition rates required depending +:sup:`3`\ There are 14 aerosol deposition rates required depending on species and affinity for bonding with water; 8 of these are dust deposition rates (dry and wet rates for 4 dust size bins, :math:`D_{dst,\, dry1} ,\, D_{dst,\, dry2} ,\, D_{dst,\, dry3} ,\, D_{dst,\, dry4}` , @@ -368,41 +359,41 @@ time-varying (annual cycle or transient), globally-gridded deposition file defined in the namelist (see the CLM4.5 User’s Guide). Aerosol deposition rates were calculated in a transient 1850-2009 CAM simulation (at a resolution of 1.9x2.5x26L) with interactive chemistry (troposphere -and stratosphere) driven by CCSM3 20\ :math:`{}^{th}` century +and stratosphere) driven by CCSM3 20\ :sup:`th` century sea-surface temperatures and emissions (Lamarque et al. 2010) for short-lived gases and aerosols; observed concentrations were specified -for methane, N\ :math:`{}_{2}`\ O, the ozone-depleting substances (CFCs) -,and CO\ :math:`{}_{2}`. The fluxes are used by the snow-related +for methane, N\ :sub:`2`\ O, the ozone-depleting substances (CFCs) +,and CO\ :sub:`2`. The fluxes are used by the snow-related parameterizations (Chapters 3 and 7). -:math:`{}^{4}`\ The nitrogen deposition rate is required by the +:sup:`4`\ The nitrogen deposition rate is required by the biogeochemistry model when active and represents the total deposition of mineral nitrogen onto the land surface, combining deposition of -NO\ :math:`{}_{y}` and NH\ :math:`{}_{x}`. The rate is supplied either +NO\ :sub:`y` and NH\ :sub:`x`. The rate is supplied either as a time-invariant spatially-varying annual mean rate or time-varying for a transient simulation. Nitrogen deposition rates were calculated from the same CAM chemistry simulation that generated the aerosol deposition rates. -:math:`{}^{5}`\ Climatological 3-hourly lightning frequency at -:math:`\sim`\ 1.8\ :math:`{}^{o}` resolution is provided, which was +:sup:`5`\ Climatological 3-hourly lightning frequency at +:math:`\sim`\ 1.8\ :sup:`o` resolution is provided, which was calculated via bilinear interpolation from 1995-2011 NASA LIS/OTD grid -product v2.2 (http://ghrc.msfc.nasa.gov) 2-hourly, 2.5\ :math:`{}^{o}` +product v2.2 (http://ghrc.msfc.nasa.gov) 2-hourly, 2.5\ :sup:`o` lightning frequency data. In future versions of the model, lightning data may be obtained directly from the atmosphere model. -Density of air (:math:`\rho _{atm}` ) (kg m\ :math:`{}^{-3}`) is also +Density of air (:math:`\rho _{atm}` ) (kg m\ :sup:`-3`) is also required but is calculated directly from :math:`\rho _{atm} =\frac{P_{atm} -0.378e_{atm} }{R_{da} T_{atm} }` where :math:`P_{atm}` is atmospheric pressure (Pa), :math:`e_{atm}` is atmospheric vapor pressure (Pa), :math:`R_{da}` is the gas constant for -dry air (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), and +dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), and :math:`T_{atm}` is the atmospheric temperature (K). The atmospheric vapor pressure :math:`e_{atm}` is derived from atmospheric specific -humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`) as +humidity :math:`q_{atm}` (kg kg\ :sup:`-1`) as :math:`e_{atm} =\frac{q_{atm} P_{atm} }{0.622+0.378q_{atm} }` . -The O\ :math:`{}_{2}` partial pressure (Pa) is required but is +The O\ :sub:`2` partial pressure (Pa) is required but is calculated from molar ratio and the atmospheric pressure :math:`P_{atm}` as :math:`o_{i} =0.209P_{atm}` . @@ -411,17 +402,17 @@ Table 2.4. Land model output to atmospheric model +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Field | Variable name | units | +=======================================+================================================+==============================================================+ -| :math:`{}^{1}`\ Latent heat flux | :math:`\lambda _{vap} E_{v} +\lambda E_{g}` | W m\ :math:`{}^{-2}` | +| :sup:`1`\ Latent heat flux | :math:`\lambda _{vap} E_{v} +\lambda E_{g}` | W m\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Sensible heat flux | :math:`H_{v} +H_{g}` | W m\ :math:`{}^{-2}` | +| Sensible heat flux | :math:`H_{v} +H_{g}` | W m\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Water vapor flux | :math:`E_{v} +E_{g}` | mm s\ :math:`{}^{-1}` | +| Water vapor flux | :math:`E_{v} +E_{g}` | mm s\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Zonal momentum flux | :math:`\tau _{x}` | kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}` | +| Zonal momentum flux | :math:`\tau _{x}` | kg m\ :sup:`-1` s\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Meridional momentum flux | :math:`\tau _{y}` | kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}` | +| Meridional momentum flux | :math:`\tau _{y}` | kg m\ :sup:`-1` s\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Emitted longwave radiation | :math:`L\, \uparrow` | W m\ :math:`{}^{-2}` | +| Emitted longwave radiation | :math:`L\, \uparrow` | W m\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Direct beam visible albedo | :math:`I\, \uparrow _{vis}^{\mu }` | - | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ @@ -431,33 +422,33 @@ Table 2.4. Land model output to atmospheric model +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Diffuse near-infrared albedo | :math:`I\, \uparrow _{nir}` | - | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Absorbed solar radiation | :math:`\vec{S}` | W m\ :math:`{}^{-2}` | +| Absorbed solar radiation | :math:`\vec{S}` | W m\ :sup:`-2` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Radiative temperature | :math:`T_{rad}` | K | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Temperature at 2 meter height | :math:`T_{2m}` | K | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :math:`{}^{-1}` | +| Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Snow water equivalent | :math:`W_{sno}` | m | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Aerodynamic resistance | :math:`r_{am}` | s m\ :math:`{}^{-1}` | +| Aerodynamic resistance | :math:`r_{am}` | s m\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Friction velocity | :math:`u_{*}` | m s\ :math:`{}^{-1}` | +| Friction velocity | :math:`u_{*}` | m s\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| :math:`{}^{2}`\ Dust flux | :math:`F_{j}` | kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | +| :sup:`2`\ Dust flux | :math:`F_{j}` | kg m\ :sup:`-2` s\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Net ecosystem exchange | NEE | kgCO\ :math:`{}_{2}` m\ :math:`{}^{-2}` s\ :math:`{}^{-1}` | +| Net ecosystem exchange | NEE | kgCO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -:math:`{}^{1}`\ :math:`\lambda _{vap}` is the latent heat of -vaporization (J kg\ :math:`{}^{-1}`) (Table 2.6) and :math:`\lambda` is +:sup:`1`\ :math:`\lambda _{vap}` is the latent heat of +vaporization (J kg\ :sup:`-1`) (Table 2.6) and :math:`\lambda` is either the latent heat of vaporization :math:`\lambda _{vap}` or latent -heat of sublimation :math:`\lambda _{sub}` (J kg\ :math:`{}^{-1}`) +heat of sublimation :math:`\lambda _{sub}` (J kg\ :sup:`-1`) (Table 2.6) depending on the liquid water and ice content of the top snow/soil layer (section 5.4). -:math:`{}^{2}`\ There are :math:`j=1,\ldots ,4` dust transport bins. +:sup:`2`\ There are :math:`j=1,\ldots ,4` dust transport bins. Initialization ^^^^^^^^^^^^^^^^^^^^ @@ -485,9 +476,9 @@ surface ground temperature :math:`T_{g}` and soil layer temperature :math:`T_{i}` , for :math:`i=1,\ldots ,N_{levgrnd}` , of 274 K, vegetation temperature :math:`T_{v}` of 283 K, no snow or canopy water (:math:`W_{sno} =0`, :math:`W_{can} =0`), and volumetric soil water -content :math:`\theta _{i} =0.15` mm\ :math:`{}^{3}` mm\ :math:`{}^{-3}` +content :math:`\theta _{i} =0.15` mm\ :sup:`3` mm\ :sup:`-3` for layers :math:`i=1,\ldots ,N_{levsoi}` and :math:`\theta _{i} =0.0` -mm\ :math:`{}^{3}` mm\ :math:`{}^{-3}` for layers +mm\ :sup:`3` mm\ :sup:`-3` for layers :math:`i=N_{levsoi} +1,\ldots ,N_{levgrnd}` . placeLake temperatures (:math:`T_{g}` and :math:`T_{i}` ) are initialized at 277 K and :math:`W_{sno} =0`. @@ -497,12 +488,12 @@ Glacier temperatures (:math:`T_{g} =T_{snl+1}` and :math:`T_{i}` for of the number of snow layers, i.e., :math:`snl` ranges from –5 to 0) are initialized to 250 K with a snow water equivalent :math:`W_{sno} =1000` mm, snow depth :math:`z_{sno} =\frac{W_{sno} }{\rho _{sno} }` (m) where -:math:`\rho _{sno} =250` kg m\ :math:`{}^{-3}` is an initial estimate +:math:`\rho _{sno} =250` kg m\ :sup:`-3` is an initial estimate for the bulk density of snow, and :math:`\theta _{i}` \ =1.0 for :math:`i=1,\ldots ,N_{levgrnd}` . The snow layer structure (e.g., number of snow layers :math:`snl` and layer thickness) is initialized based on the snow depth (section 6.1). The snow liquid water and ice contents (kg -m\ :math:`{}^{-2}`) are initialized as :math:`w_{liq,\, i} =0` and +m\ :sup:`-2`) are initialized as :math:`w_{liq,\, i} =0` and :math:`w_{ice,\, i} =\Delta z_{i} \rho _{sno}` , respectively, where :math:`i=snl+1,\ldots ,0` are the snow layers, and :math:`\Delta z_{i}` is the thickness of snow layer :math:`i` (m). The soil liquid water and @@ -512,7 +503,7 @@ ice contents are initialized as :math:`w_{liq,\, i} =0` and :math:`w_{liq,\, i} =\Delta z_{i} \rho _{liq} \theta _{i}` and :math:`w_{ice,\, i} =0` for :math:`T_{i} >T_{f}` , where :math:`\rho _{ice}` and :math:`\rho _{liq}` are the densities of ice -and liquid water (kg m\ :math:`{}^{-3}`) (Table 2.6), and :math:`T_{f}` +and liquid water (kg m\ :sup:`-3`) (Table 2.6), and :math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). All vegetated and glacier land units are initialized with water stored in the unconfined aquifer and unsaturated soil :math:`W_{a} =4000` mm and water table @@ -540,46 +531,46 @@ resolution +--------------------------------------------+---------------------------+ | Surface Field | Resolution | +============================================+===========================+ -| Percent glacier | 0.05\ :math:`\circ` | +| Percent glacier | 0.05\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Percent lake and lake depth | 0.05\ :math:`\circ` | +| Percent lake and lake depth | 0.05\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Percent urban | 0.05\ :math:`\circ` | +| Percent urban | 0.05\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Percent plant functional types (PFTs) | 0.05\ :math:`\circ` | +| Percent plant functional types (PFTs) | 0.05\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Monthly leaf and stem area index | 0.5\ :math:`\circ` | +| Monthly leaf and stem area index | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Canopy height (top, bottom) | 0.5\ :math:`\circ` | +| Canopy height (top, bottom) | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Soil color | 0.5\ :math:`\circ` | +| Soil color | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Percent sand, percent clay | 0.083\ :math:`{}^\circ` | +| Percent sand, percent clay | 0.083\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Soil organic matter density | 0.083\ :math:`\circ` | +| Soil organic matter density | 0.083\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Maximum fractional saturated area | 0.125\ :math:`\circ` | +| Maximum fractional saturated area | 0.125\ :sup:`o` | +--------------------------------------------+---------------------------+ | Elevation | 1km | +--------------------------------------------+---------------------------+ | Slope | 1km | +--------------------------------------------+---------------------------+ -| Biogenic Volatile Organic Compounds | 0.5\ :math:`{}^\circ` | +| Biogenic Volatile Organic Compounds | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Crop Irrigation | 0.083\ :math:`{}^\circ` | +| Crop Irrigation | 0.083\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Managed crops | 0.5\ :math:`{}^\circ` | +| Managed crops | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Population density | 0.5\ :math:`{}^\circ` | +| Population density | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Gross domestic production | 0.5\ :math:`{}^\circ` | +| Gross domestic production | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Peat area fraction | 0.5\ :math:`{}^\circ` | +| Peat area fraction | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -| Peak month of agricultural waste burning | 0.5\ :math:`{}^\circ` | +| Peak month of agricultural waste burning | 0.5\ :sup:`o` | +--------------------------------------------+---------------------------+ -At the base spatial resolution of 0.05\ :math:`\circ`, the percentage of +At the base spatial resolution of 0.05\ :sup:`o`, the percentage of each PFT is defined with respect to the vegetated portion of the grid cell and the sum of the PFTs is 100%. The percent lake, wetland, glacier, and urban at their base resolution are specified with respect @@ -619,12 +610,12 @@ elevation are needed when running CLM4 with multiple glacier elevation classes. Percent lake and lake depth are area-averaged from the 90-second -resolution data of Kourzeneva (2009, 2010) to the 0.05\ :math:`{}^\circ` +resolution data of Kourzeneva (2009, 2010) to the 0.05\ :sup:`o` resolution using the MODIS land-mask. Percent urban is derived from LandScan 2004, a population density dataset derived from census data, nighttime lights satellite observations, road proximity and slope (Dobson et al. 2000) as described by Jackson et al. (2010) at 1km -resolution and aggregated to 0.05\ :math:`{}^\circ`. A number of urban +resolution and aggregated to 0.05\ :sup:`o`. A number of urban radiative, thermal, and morphological fields are also required and are obtained from Jackson et al. (2010). Their description can be found in Table 3 of the Community Land Model Urban (CLMU) technical note (Oleson @@ -651,7 +642,7 @@ Geosphere-Biosphere Programme (IGBP) soil dataset (Global Soil Data Task each soil layer were used to create a mineral soil texture dataset (Bonan et al. 2002b). Soil organic matter data is merged from two sources. The majority of the globe is from ISRIC-WISE (Batjes, 2006). -The high latitudes come from the 0.25\ :math:`{}^\circ` version of the +The high latitudes come from the 0.25\ :sup:`o` version of the Northern Circumpolar Soil Carbon Database (Hugelius et al. 2012). Both datasets report carbon down to 1m depth. Carbon is partitioned across the top seven CLM4 layers (:math:`\sim`\ 1m depth) as in Lawrence and @@ -659,12 +650,12 @@ Slater (2008). The maximum fractional saturated area (:math:`f_{\max }` ) is used in determining surface runoff and infiltration (section 7.3). Maximum -fractional saturated area at 0.125\ :math:`{}^{o}` resolution is +fractional saturated area at 0.125\ :sup:`o` resolution is calculated from 1-km compound topographic indices (CTIs) based on the USGS HYDRO1K dataset (Verdin and Greenlee 1996) following the algorithm in Niu et al. (2005). :math:`f_{\max }` is the ratio between the number of 1-km pixels with CTIs equal to or larger than the mean CTI and the -total number of pixels in a 0.125\ :math:`{}^\circ` grid cell. See +total number of pixels in a 0.125\ :sup:`o` grid cell. See section 7.3.1 and Li et al. (2013b) for further details. Slope and elevation are also obtained from the USGS HYDRO1K 1-km dataset (Verdin and Greenlee 1996). Slope is used in the River Transport Model (Chapter @@ -719,21 +710,21 @@ beneath irrigated crops. Several input datasets are required for the fire model (Li et al. 2013a) including population density, gross domestic production, peat area fraction, and peak month of agricultural waste burning. Population -density at 0.5\ :math:`{}^{o}` resolution for 1850-2100 combines 5-min +density at 0.5\ :sup:`o` resolution for 1850-2100 combines 5-min resolution decadal population density data for 1850–1980 from the Database of the Global Environment version 3.1 (HYDEv3.1) with -0.5\ :math:`{}^{o}` resolution population density data for 1990, 1995, +0.5\ :sup:`o` resolution population density data for 1990, 1995, 2000, and 2005 from the Gridded Population of the World version 3 dataset (GPWv3) (CIESIN, 2005). Gross Domestic Production (GDP) per -capita in 2000 at 0.5\ :math:`{}^{o}` is from Van Vuuren et al. (2006), +capita in 2000 at 0.5\ :sup:`o` is from Van Vuuren et al. (2006), which is the base-year GDP data for IPCC-SRES and derived from country-level World Bank’s World Development Indicators (WDI) measured in constant 1995 US$ (World Bank, 2004) and the UN Statistics Database -(UNSTAT, 2005). The peatland area fraction at 0.5\ :math:`{}^{o}` +(UNSTAT, 2005). The peatland area fraction at 0.5\ :sup:`o` resolution is derived from three vector datasets: peatland data in Indonesia and Malaysian Borneo (Olson et al. 2001); peatland data in Canada (Tarnocai et al. 2011); and bog, fen and mire data in boreal -regions (north of 45\ :math:`{}^{o}`\ N) outside Canada provided by the +regions (north of 45\ :sup:`o`\ N) outside Canada provided by the Global Lakes and Wetlands Database (GLWD) (Lehner and Döll, 2004). The climatological peak month for agricultural waste burning is from van der Werf et al. (2010). @@ -753,30 +744,30 @@ of the components in the coupled modeling system, are presented in Table :widths: 40, 20, 20, 20 "Pi", :math:`\pi`, 3.14159265358979323846, "\-" - "Acceleration of gravity", :math:`g`, 9.80616, m s\ :math:`{}^{-2}` + "Acceleration of gravity", :math:`g`, 9.80616, m s\ :sup:`-2` "Standard pressure", :math:`P_{std}`, 101325, "Pa" - "Stefan-Boltzmann constant", :math:`\sigma`, 5.67 :math:`\times 10^{-8}`, W m :math:`{}^{-2}` K :math:`{}^{-4}` - "Boltzmann constant", :math:`\kappa`, 1.38065 :math:`\times 10^{-23}`, J K :math:`{}^{-1}` molecule :math:`{}^{-1}` - "Avogadro’s number", :math:`N_{A}`, 6.02214 :math:`\times 10^{26}`, molecule kmol\ :math:`{}^{-1}` - "Universal gas constant", :math:`R_{gas}`, :math:`N_{A} \kappa`, J K :math:`{}^{-1}` kmol :math:`{}^{-1}` - "Molecular weight of dry air", :math:`MW_{da}`, 28.966, kg kmol :math:`{}^{-1}` - "Dry air gas constant", :math:`R_{da}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{da} }} \right. \kern-\nulldelimiterspace} MW_{da} }`, J K :math:`{}^{-1}` kg :math:`{}^{-1}` - "Molecular weight of water vapor", :math:`MW_{wv}`, 18.016, kg kmol :math:`{}^{-1}` - "Water vapor gas constant", :math:`R_{wv}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{wv} }} \right. \kern-\nulldelimiterspace} MW_{wv} }`, J K :math:`{}^{-1}` kg :math:`{}^{-1}` + "Stefan-Boltzmann constant", :math:`\sigma`, 5.67 :math:`\times 10^{-8}`, W m :sup:`-2` K :math:`{}^{-4}` + "Boltzmann constant", :math:`\kappa`, 1.38065 :math:`\times 10^{-23}`, J K :sup:`-1` molecule :sup:`-1` + "Avogadro’s number", :math:`N_{A}`, 6.02214 :math:`\times 10^{26}`, molecule kmol\ :sup:`-1` + "Universal gas constant", :math:`R_{gas}`, :math:`N_{A} \kappa`, J K :sup:`-1` kmol :sup:`-1` + "Molecular weight of dry air", :math:`MW_{da}`, 28.966, kg kmol :sup:`-1` + "Dry air gas constant", :math:`R_{da}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{da} }} \right. \kern-\nulldelimiterspace} MW_{da} }`, J K :sup:`-1` kg :sup:`-1` + "Molecular weight of water vapor", :math:`MW_{wv}`, 18.016, kg kmol :sup:`-1` + "Water vapor gas constant", :math:`R_{wv}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{wv} }} \right. \kern-\nulldelimiterspace} MW_{wv} }`, J K :sup:`-1` kg :sup:`-1` "Von Karman constant", :math:`k`, 0.4, "\-" "Freezing temperature of fresh water", :math:`T_{f}`, 273.5, K - "Density of liquid water", :math:`\rho _{liq}`, 1000, kg m :math:`{}^{-3}` - "Density of ice", :math:`\rho _{ice}`, 917, kg m :math:`{}^{-3}` - "Specific heat capacity of dry air", :math:`C_{p}`, 1.00464 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` - "Specific heat capacity of water", :math:`C_{liq}`, 4.188 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` - "Specific heat capacity of ice", :math:`C_{ice}`, 2.11727 :math:`\times 10^{3}`, J kg :math:`{}^{-1}` K :math:`{}^{-1}` - "Latent heat of vaporization", :math:`\lambda _{vap}`, 2.501 :math:`\times 10^{6}`, J kg :math:`{}^{-1}` - "Latent heat of fusion", :math:`L_{f}`, 3.337 :math:`\times 10^{5}`, J kg :math:`{}^{-1}` - "Latent heat of sublimation", :math:`\lambda _{sub}`, :math:`\lambda _{vap} +L_{f}`, J kg :math:`{}^{-1}` - :math:`{}^{1}` "Thermal conductivity of water", :math:`\lambda _{liq}`, 0.57, W m :math:`{}^{-1}` K :math:`{}^{-1}` - :math:`{}^{1}` "Thermal conductivity of ice", :math:`\lambda _{ice}`, 2.29, W m :math:`{}^{-1}` K :math:`{}^{-1}` - :math:`{}^{1}` "Thermal conductivity of air", :math:`\lambda _{air}`, 0.023 W m :math:`{}^{-1}` K :math:`{}^{-1}` + "Density of liquid water", :math:`\rho _{liq}`, 1000, kg m :sup:`-3` + "Density of ice", :math:`\rho _{ice}`, 917, kg m :sup:`-3` + "Specific heat capacity of dry air", :math:`C_{p}`, 1.00464 :math:`\times 10^{3}`, J kg :sup:`-1` K :sup:`-1` + "Specific heat capacity of water", :math:`C_{liq}`, 4.188 :math:`\times 10^{3}`, J kg :sup:`-1` K :sup:`-1` + "Specific heat capacity of ice", :math:`C_{ice}`, 2.11727 :math:`\times 10^{3}`, J kg :sup:`-1` K :sup:`-1` + "Latent heat of vaporization", :math:`\lambda _{vap}`, 2.501 :math:`\times 10^{6}`, J kg :sup:`-1` + "Latent heat of fusion", :math:`L_{f}`, 3.337 :math:`\times 10^{5}`, J kg :sup:`-1` + "Latent heat of sublimation", :math:`\lambda _{sub}`, :math:`\lambda _{vap} +L_{f}`, J kg :sup:`-1` + :sup:`1` "Thermal conductivity of water", :math:`\lambda _{liq}`, 0.57, W m :sup:`-1` K :sup:`-1` + :sup:`1` "Thermal conductivity of ice", :math:`\lambda _{ice}`, 2.29, W m :sup:`-1` K :sup:`-1` + :sup:`1` "Thermal conductivity of air", :math:`\lambda _{air}`, 0.023 W m :sup:`-1` K :sup:`-1` "Radius of the earth", :math:`R_{e}`, 6.37122, :math:`\times 10^{6}` m -:math:`{}^{1}`\ Not shared by other components of the coupled modeling system. +:sup:`1`\ Not shared by other components of the coupled modeling system. diff --git a/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst b/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst index 2c378b3aec..570028bc8b 100644 --- a/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst +++ b/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst @@ -1,5 +1,3 @@ -**** - Crops and Irrigation ======================== @@ -33,7 +31,7 @@ Drewniak et al. (2013). The crop model ------------------- -20.2.1 Introduction +Introduction ^^^^^^^^^^^^^^^^^^^ Groups developing Earth System Models generally account for the human @@ -49,11 +47,11 @@ biogeophysical and biogeochemical effects not only of natural but also human-managed land cover. AgroIBIS is a state-of-the-art land surface model with options to -simulate dynamic vegetation (Kucharik et al. ** 2000) and interactive +simulate dynamic vegetation (Kucharik et al. 2000) and interactive crop management (Kucharik and Brye 2003). The interactive crop management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 -[CLM3.0, Oleson et al. ** (2004)] (not published), then coupled to the +[CLM3.0, Oleson et al. (2004)] (not published), then coupled to the CLM3.5 (Levis et al. 2009) and later released to the community with CLM4CN (Levis et al. 2012). @@ -63,17 +61,15 @@ simulated biogeophysics and biogeochemistry. These advances may improve fully coupled simulations with the Community Earth System Model (CESM), while helping human societies answer questions about changing food, energy, and water resources in response to climate, environmental, land -use, and land management change (e.g., Kucharik and Brye 2003; Lobell et -al. ** 2006). +use, and land management change (e.g., Kucharik and Brye 2003; Lobell et al. 2006). -20.2.2 Crop plant functional types +Crop plant functional types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CLM’s default list of plant functional types (pfts) includes an unmanaged crop (Table 2.1) treated as a second C3 grass. The unmanaged crop has grid cell coverage assigned from satellite data, as do all -natural pfts when CLM’s dynamic vegetation model (CNDV; Castillo et al. -2012) is not active. +natural pfts when CLM’s dynamic vegetation model (CNDV; Castillo et al. 2012) is not active. The new crop pfts used in the CLM get grid cell coverage from the present-day crop dataset of Portmann et al. (2010). We assign these @@ -97,7 +93,7 @@ CLM setting). Managed crop PFTs in the human managed land unit do not share soil columns and thus permit for differences in land management between crops. -20.2.3 Phenology +Phenology ^^^^^^^^^^^^^^^^ CLM4.5CN includes evergreen, seasonally deciduous (responding to changes @@ -111,104 +107,102 @@ continues from leaf emergence to the beginning of grain fill, and phase 3 starts from the beginning of grain fill and ends with physiological maturity and harvest. -20.2.3.1 Planting +Planting ''''''''''''''''' Corn and temperate cereals must meet the following requirements between -April 1\ :math:`{}^{st}` and June 14\ :math:`{}^{th}` for planting in -the northern hemisphere (NH): +April 1\ :sup:`st` and June 14\ :sup:`th` for planting in the northern hemisphere (NH): .. math:: + :label: ZEqnNum568682 - \label{ZEqnNum568682} - \begin{array}{l} {T_{10d} >T_{p} } \\ {T_{10d}^{\min } >T_{p}^{\min } } \\ {GDD_{8} \ge GDD_{\min } } \end{array} + \begin{array}{l} + {T_{10d} >T_{p} } \\ + {T_{10d}^{\min } >T_{p}^{\min } } \\ + {GDD_{8} \ge GDD_{\min } } + \end{array} -where *T*\ :math:`{}_{10}`\ *:math:`{}_{d}`* is the 10-day running mean -of *T*\ :math:`{}_{2}`\ *:math:`{}_{m}`*, (the simulated 2-m air -temperature at every model time step) and :math:`T_{10d}^{\min }` is +where :math:`{T}_{10d}` is the 10-day running mean of :math:`{T}_{2m}`, (the simulated 2-m air +temperature at every model time step) and :math:`T_{10d}^{\min}` is the 10-day running mean of :math:`T_{2m}^{\min }` (the daily minimum of -*T*\ :math:`{}_{2}`\ *:math:`{}_{m}`*). *T\ :math:`{}_{p}`* and -:math:`T_{p}^{\min }` are crop-specific coldest planting temperatures -(Table 20.1), *GDD*\ :math:`{}_{8}` is the 20-year running mean growing -degree-days (units are degree-days or :math:`{}^\circ`\ days) tracked -from April through September (NH) base 8\ :math:`{}^\circ`\ C with -maximum daily increments of 30\ :math:`{}^\circ`\ days (see Eq. ), and -*GDD*\ :math:`{}_{min }`\ is the minimum growing degree day requirement +:math:`{T}_{2m}`. :math:`{T}_{p}` and :math:`T_{p}^{\min }` are crop-specific coldest planting temperatures +(Table 20.1), :math:`{GDD}_{8}` is the 20-year running mean growing +degree-days (units are degree-days or :sup:`o` days) tracked +from April through September (NH) base 8\ :sup:`o` C with +maximum daily increments of 30\ :sup:`o` days (see Eq.XXX ), and +:math:`{GDD}_{min }`\ is the minimum growing degree day requirement (Table 20.1). Soy must meet the same requirements but between May -1\ :math:`{}^{st}` and June 14\ :math:`{}^{th}` for planting. If the -requirements in Eq. are not met by June 14\ :math:`{}^{th}`, then corn, +1\ :sup:`st` and June 14\ :sup:`th` for planting. If the +requirements in Eq. are not met by June 14\ :sup:`th`, then corn, soybean, and temperate cereals are still planted on June -15\ :math:`{}^{th}` as long as *GDD*\ :math:`{}_{8}`\ :math:`>`\ 0. In +15\ :sup:`th` as long as :math:`{GDD}_{8} > 0`. In the southern hemisphere (SH) the NH requirements apply 6 months later. -*GDD*\ :math:`{}_{8}` does not change as quickly as -*T*\ :math:`{}_{10}`\ *:math:`{}_{d}`* and :math:`T_{10d}^{\min }` , so +:math:`{GDD}_{8}` does not change as quickly as :math:`{T}_{10d}` and :math:`T_{10d}^{\min }`, so it determines whether the crop can be planted in a grid cell, while the two faster-changing variables determine when the crop may be planted. -At planting, each crop is assigned 1 g leaf C m\ :math:`{}^{-2}` pft +At planting, each crop is assigned 1 g leaf C m\ :sup:`-2` pft column area to be transferred to the leaves upon leaf emergence. An equivalent amount of seed leaf N is assigned given the pft’s C to N -ratio for leaves (*CN\ :math:`{}_{leaf}`*). (This differs from AgroIBIS, +ratio for leaves (:math:`{CN}_{leaf}`). (This differs from AgroIBIS, which uses a seed leaf area index instead of seed C.) At planting, the model updates the average growing degree-days necessary for the crop to reach vegetative and physiological maturity, -*GDD*\ :math:`{}_{mat}`, according to the following AgroIBIS rules: +:math:`{GDD}_{mat}`, according to the following AgroIBIS rules: .. math:: + :label: 20.2) - \label{20.2)} \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950}` 0, and *:math:`\beta`\ :math:`{}_{t}`* :math:`<` 1, -i.e., water is limiting for photosynthesis (see section 8.4). +leaf area :math:`>` 0, and :math:`\beta_{t} < 1`, i.e., water is limiting for photosynthesis (see section 8.4). If irrigation is required, the model computes the deficit between the current soil moisture content and a target soil moisture content; this deficit is the amount of water that will be added through irrigation. The target soil moisture content in each soil layer *i* -(*w\ :math:`{}_{target,i}`*, kg m\ :math:`{}^{-2}`) is a weighted +(:math:`{s}_{target,i}`, kg m\ :sup:`-2`) is a weighted average of the minimum soil moisture content that results in no water -stress in that layer (*w\ :math:`{}_{o,i}`*, kg m\ :math:`{}^{-2}`) and -the soil moisture content at saturation in that layer -(*w\ :math:`{}_{sat,i}`*, kg m\ :math:`{}^{-2}`): +stress in that layer (:math:`{s}_{o,i}`, kg m\ :sup:`-2`) and +the soil moisture content at saturation in that layer (:math:`{w}_{sat,i}`, kg m\ :sup:`-2`): .. math:: + :label: 20.7) - \label{20.7)} w_{target,i} =(1-0.7)\cdot w_{o,i} +0.7\cdot w_{sat,i} -*w\ :math:`{}_{o,i}`* is determined by inverting equation 8.19 in Oleson -et al. (2010a) to solve for the value of *s\ :math:`{}_{i}`* (soil -wetness) that makes *:math:`\Psi`\ :math:`{}_{i}`* = -*:math:`\Psi`\ :math:`{}_{o}`* (where *:math:`\Psi`\ :math:`{}_{i}`* is -the soil water matric potential and *:math:`\Psi`\ :math:`{}_{o}`* is +:math:`{w}_{o,i}` is determined by inverting equation 8.19 in Oleson +et al. (2010a) to solve for the value of :math:`{s}_{i}` (soil +wetness) that makes :math:`\Psi_{i} = \Psi_{o}` (where :math:`\Psi_{i}` is +the soil water matric potential and :math:`\Psi_{o}` is the soil water potential when stomata are fully open), and then -converting this value to units of kg m\ :math:`{}^{-2}`. -*w\ :math:`{}_{sat,i}`* is calculated simply by converting effective -porosity (section 7.4) to units of kg m\ :math:`{}^{-2}`. The value 0.7 +converting this value to units of kg m\ :sup:`-2`. +:math:`{w}_{sat,i}` is calculated simply by converting effective +porosity (section 7.4) to units of kg m\ :sup:`-2`. The value 0.7 was determined empirically, in order to give global, annual irrigation amounts that approximately match observed gross irrigation water use around the year 2000 (i.e., total water withdrawals for irrigation: -:math:`\sim` 2500 – 3000 km\ :math:`{}^{3}` year\ :math:`{}^{-1}` -(Shiklomanov 2000)). The total water deficit (*w\ :math:`{}_{deficit}`*, -kg m\ :math:`{}^{-2}`) of the column is then determined by: +:math:`\sim` 2500 – 3000 km\ :sup:`3` year\ :sup:`-1` +(Shiklomanov 2000)). The total water deficit (:math:`{w}_{deficit}`, +kg m\ :sup:`-2`) of the column is then determined by: .. math:: + :label: 20.8) - \label{20.8)} w_{deficit} =\sum _{i}\max \left(w_{target,i} -w_{liq,i} ,0\right) -where *w\ :math:`{}_{liq,i}`* (kg m\ :math:`{}^{-2}`) is the current +where :math:`{w}_{liq,i}` (kg m\ :sup:`-2`) is the current soil water content of layer *i* (Chapter 7). The max function means that a surplus in one layer cannot make up for a deficit in another layer. The sum is taken only over soil layers that contain roots. In addition, @@ -475,17 +471,17 @@ if the temperature of any soil layer is below freezing, then the sum only includes layers above the top-most frozen soil layer. The amount of water added to this column through irrigation is then -equal to *w\ :math:`{}_{deficit}`*. This irrigation is applied at a +equal to :math:`{w}_{deficit}`. This irrigation is applied at a constant rate over the following four hours. Irrigation water is applied directly to the ground surface, bypassing canopy interception (i.e., -added to *q\ :math:`{}_{grnd,liq}`*: section 7.1). Added irrigation is -removed from total liquid runoff (*R\ :math:`{}_{liq}`*: Chapter 11), +added to :math:`{q}_{grnd,liq}`: section 7.1). Added irrigation is +removed from total liquid runoff ( :math:`{R}_{liq}`: Chapter 11), simulating removal from nearby rivers. The details about what is new in CLM4.5 -------------------------------------------- -20.4.1 Interactive irrigation for corn, temperate cereals, and soybean +Interactive irrigation for corn, temperate cereals, and soybean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CLM4.0 included interactive irrigation only for the generic C3 crops, @@ -529,7 +525,7 @@ or without irrigation. In simulations without irrigation, the rainfed and irrigated crops merge into just rainfed crops at run time. Surface datasets with 16 pfts can be used for all other CLM simulations. -20.4.2 Interactive fertilization +Interactive fertilization ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ CLM adds nitrogen directly to the soil mineral nitrogen pool to meet @@ -537,10 +533,10 @@ crop nitrogen demands. CLM’s separate crop land unit ensures that natural vegetation will not access the fertilizer applied to crops. Fertilizer amounts are obtained from the Agro-IBIS model (Kucharik and Brye 2003), but can be modified in CLM’s pft-physiology input dataset. -Fertilizer is reported in g N/m\ :math:`{}^{2}` by plant functional -type. Total nitrogen fertilizer amounts are 150 g N/m\ :math:`{}^{2}` -for maize, 80 g N/m\ :math:`{}^{2}` for temperate cereals, and 25 g -N/m\ :math:`{}^{2}` for soybean, representative of central U.S. annual +Fertilizer is reported in g N/m\ :sup:`2` by plant functional +type. Total nitrogen fertilizer amounts are 150 g N/m\ :sup:`2` +for maize, 80 g N/m\ :sup:`2` for temperate cereals, and 25 g +N/m\ :sup:`2` for soybean, representative of central U.S. annual fertilizer application amounts. Since CLM’s denitrification rate is high and results in a 50% loss of the unused available nitrogen each day, fertilizer is applied slowly to minimize the loss and maximize plant @@ -565,7 +561,7 @@ The crop fertilization scheme was developed in versions of the CLM prior to CLM4.5. In CLM4.5, crops with fertilization may be simulated over productive. -20.4.3 Biological nitrogen fixation for soybeans +Biological nitrogen fixation for soybeans ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nitrogen fixation by soybeans is similar to that in the SWAT model @@ -575,40 +571,40 @@ unmet nitrogen demand; if soil nitrogen meets soybean demand, there will be no fixation during the time step. Soybean fixation is determined by .. math:: + :label: 20.10) - \label{20.10)} N_{fix} \; =\; N_{plant\_ ndemand} \; *\; min\; \left(\; 1,\; fxw,\; fxn\; \right)*\; fxg -where *N\ :math:`{}_{plant\_demand}`* is the balance of nitrogen needed +where :math:`{N}_{plant\_demand}` is the balance of nitrogen needed to reach potential growth that cannot be supplied from the soil mineral nitrogen pool, *fxw* is the soil water factor, *fxn* is the soil nitrogen factor, and *fxg* is the growth stage factor calculated by .. math:: + :label: 20.11) - \label{20.11)} fxw=\frac{wf}{0.85} .. math:: + :label: 20.12) - \label{20.12)} fxn=\; \left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }sminn\le 10} \\ {1.5-0.005\left(sminn\times 10\right)\qquad {\rm for\; 10\; <\; }sminn{\rm \; }\ge 30} \\ {1\qquad \qquad \qquad \qquad {\rm for\; }sminn>30} \end{array}\right\} .. math:: + :label: 20.13) - \label{20.13)} fxg=\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad \qquad {\rm for\; }GDD_{T_{2m} } \le 0.15} \\ {6.67\times GDD_{T_{2m} } -1\qquad \qquad \qquad {\rm for\; }0.150.75} \end{array}\right\} where *wf* is the soil water content as a fraction of the water holding capacity for the top 0.05 m, *sminn* is the total nitrogen in the soil -pool (g/m:math:`{}^{2}`), and :math:`{GDD}_{T_{2m}}` is the fraction of +pool (g/m:sup:`2`), and :math:`{GDD}_{T_{2m}}` is the fraction of growing degree-days accumulated during the growing season. :math:`N\mathrm{fix}` is added directly to the soil mineral nitrogen pool for use that time step. Nitrogen fixation occurs after the plant -has accumulated 15%\ *GDD\ :math:`{}_{mat}`* and before -75%\ *GDD\ :math:`{}_{mat}`*, so before grain fill begins. +has accumulated 15%\ :math:`{GDD}_{mat}` and before +75%\ :math:`{GDD}_{mat}`, so before grain fill begins. -20.4.4 Modified C:N ratios for crops +Modified C:N ratios for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Typically, C:N ratios in plant tissue vary throughout the growing season @@ -627,7 +623,7 @@ harvest. All C:N ratios were determined by calibration process, through comparisons of model output versus observations of plant carbon throughout the growth season. -20.4.5 Nitrogen retranslocation for crops +Nitrogen retranslocation for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nitrogen retranslocation in crops occurs when nitrogen that was used for @@ -648,24 +644,22 @@ mobilized depends on the C:N ratio of the plant tissue, and is calculated as .. math:: + :label: 20.14) - \label{20.14)} leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } .. math:: + :label: 20.15) - \label{20.15)} stemn\_ to\_ retransn=\frac{c_{stem} }{CN_{stem} } -\frac{c_{stem} }{CN_{stem}^{f} } .. math:: + :label: 20.16) - \label{20.16)} frootn\_ to\_ retransn=\frac{c_{froot} }{CN_{froot} } -\frac{c_{froot} }{CN_{froot}^{f} } -where *C\ :math:`{}_{leaf}`*, *C\ :math:`{}_{stem}`*, and -*C\ :math:`{}_{froot}`* is the carbon in the plant leaf, stem, and fine -root, respectively, *CN\ :math:`{}_{leaf}`*, *CN\ :math:`{}_{stem}`*, -and *CN\ :math:`{}_{froot}`* is the pre-grain fill C:N ratio of the +where :math:`{C}_{leaf}`, :math:`{C}_{stem}`, and :math:`{C}_{froot}` is the carbon in the plant leaf, stem, and fine +root, respectively, :math:`{CN}_{leaf}`, :math:`{CN}_{stem}`, and :math:`{CN}_{froot}` is the pre-grain fill C:N ratio of the leaf, stem, and fine root respectively, and :math:`CN^f_{leaf}`, :math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N ratio of the leaf, stem, and fine root respectively (Table 20.3). Since @@ -686,11 +680,11 @@ fine root, and reproductive pools. +----------------------------+--------+---------------------+-----------+ | Pre-grain fill stage | Corn | Temperate Cereals | Soybean | +============================+========+=====================+===========+ -| *CN\ :math:`{}_{leaf}`* | 10 | 15 | 25 | +| :math:`{CN}_{leaf}` | 10 | 15 | 25 | +----------------------------+--------+---------------------+-----------+ -| *CN\ :math:`{}_{stem}`* | 50 | 50 | 50 | +| :math:`{CN}_{stem}` | 50 | 50 | 50 | +----------------------------+--------+---------------------+-----------+ -| *CN\ :math:`{}_{froot}`* | 42 | 30 | 42 | +| :math:`{CN}_{froot}` | 42 | 30 | 42 | +----------------------------+--------+---------------------+-----------+ | Post-grain fill stage | | | | +----------------------------+--------+---------------------+-----------+ @@ -703,9 +697,7 @@ fine root, and reproductive pools. | :math:`CN_{repr}^{f}` | 50 | 40 | 60 | +----------------------------+--------+---------------------+-----------+ -**** - -20.4.6 Separate reproductive pool +Separate reproductive pool ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ One notable difference between natural vegetation and crops is the diff --git a/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst b/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst index 956e1aca1a..661b1f2e6e 100644 --- a/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst +++ b/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst @@ -1,5 +1,3 @@ -.. math:: 1 - Transient Landcover Change ============================== @@ -56,13 +54,13 @@ algorithm, and :math:`n` is the index value for the :math:`dynpft\_ year(n)=year_{cur}` : .. math:: + :label: 21.1) - \label{21.1)} nt_{1} =\left\{\begin{array}{l} {1\qquad {\rm for}\qquad year_{cur} w_{t} } \end{array}\right. where .. math:: + :label: 24.8) - \label{24.8)} w_{t} =a\left(0.17M_{clay} +0.14M_{clay}^{2} \right){\rm \; \; \; \; \; \; 0}\le M_{clay} =\% clay\times 0.01\le 1 and .. math:: + :label: 24.9) - \label{24.9)} w=\frac{\theta _{1} \rho _{liq} }{\rho _{d,1} } where :math:`a=M_{clay}^{-1}` for tuning purposes, :math:`\theta _{1}` is the volumetric soil moisture in the top soil -layer (m:math:`{}^{3 }`\ m\ :math:`{}^{-3}`) (section 7.4), +layer (m:math:`{}^{3 }`\ m\ :sup:`-3`) (section 7.4), :math:`\rho _{liq}` is the density of liquid water (kg -m\ :math:`{}^{-3}`) (Table 2.6), and :math:`\rho _{d,\, 1}` is the bulk -density of soil in the top soil layer (kg m\ :math:`{}^{-3}`) defined as -in section 6.3 rather than as in Zender et al. ** (2003). +m\ :sup:`-3`) (Table 2.6), and :math:`\rho _{d,\, 1}` is the bulk +density of soil in the top soil layer (kg m\ :sup:`-3`) defined as +in section 6.3 rather than as in Zender et al. (2003). :math:`Re_{*t}^{f}` from equation is the threshold friction Reynolds factor .. math:: + :label: 24.10) - \label{24.10)} Re_{*t}^{f} =\left\{\begin{array}{l} {\frac{0.1291^{2} }{-1+1.928Re_{*t} } {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; 0.03}\le Re_{*t} \le 10} \\ {0.12^{2} \left(1-0.0858e^{-0.0617(Re_{*t} -10)} \right)^{2} {\rm \; for\; }Re_{*t} >10} \end{array}\right. and :math:`Re_{*t}` is the threshold friction Reynolds number approximation for optimally sized particles .. math:: + :label: 24.11) - \label{24.11)} Re_{*t} =0.38+1331\left(100D_{osp} \right)^{1.56} In equation , :math:`u_{*s}` ** is defined as the wind friction speed -(m s\ :math:`{}^{-1}`) accounting for the Owen effect (Owen 1964) +(m s\ :sup:`-1`) accounting for the Owen effect (Owen 1964) .. math:: + :label: 24.12) - \label{24.12)} - u_{*s} =\left\{\begin{array}{l} {u_{*} {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; }U_{10} ` 1.0 would indicate a preference for the +If the :math:`{f}_{frac}` = 1.0 (no fractionation), then the fluxes +:math:`{CF}_{13C}` and :math:`{CF}_{totC}`* will be in simple +proportion to the masses :math:`{CS}_{13C\_up}` and +:math:`{CS}_{totC\_up}`. Values of :math:`{f}_{frac} < 1.0` indicate a discrimination against the heavier isotope +(:sup:`13`\ C) in the flux-generating process, while +:math:`{f}_{frac}` :math:`>` 1.0 would indicate a preference for the heavier isotope. Currently, in all cases where Eq. is used to calculate -a :math:`{}^{13}`\ C flux, *f\ :math:`{}_{frac}`* is set to 1.0. +a :sup:`13`\ C flux, :math:`{f}_{frac}` is set to 1.0. -For :math:`{}^{1}`\ :math:`{}^{4}`\ C, no fractionation is used in +For :sup:`1`\ :sup:`4`\ C, no fractionation is used in either the initial photosynthetic step, nor in subsequent fluxes from upstream to downstream pools; as discussed below, this is because -observations of :math:`{}^{1}`\ :math:`{}^{4}`\ C are typically +observations of :sup:`1`\ :sup:`4`\ C are typically described in units that implicitly correct out the fractionation of -:math:`{}^{1}`\ :math:`{}^{4}`\ C by referencing them to -:math:`{}^{1}`\ :math:`{}^{3}`\ C ratios. +:sup:`1`\ :sup:`4`\ C by referencing them to +:sup:`1`\ :sup:`3`\ C ratios. Isotope Symbols, Units, and Reference Standards ---------------------------------------------------- Carbon has two primary stable isotopes, :math:`{}^{12}`\ C and -:math:`{}^{13}`\ C. :math:`{}^{12}`\ C is the most abundant, comprising +:sup:`13`\ C. :math:`{}^{12}`\ C is the most abundant, comprising about 99% of all carbon. The isotope ratio of a compound, -*R\ :math:`{}_{A}`*, is the mass ratio of the rare isotope to the -abundant isotope +:math:`{R}_{A}`, is the mass ratio of the rare isotope to the abundant isotope .. math:: + :label: 25.2) - \label{25.2)} R_{A} =\frac{{}^{13} C_{A} }{{}^{12} C_{A} } . Carbon isotope ratios are often expressed using delta notation, -:math:`\deltaup`. The :math:`\deltaup`\ :math:`{}^{13}`\ C value of a -compound A, :math:`\deltaup`\ :math:`{}^{13}`\ C\ :math:`{}_{A}`, is the +:math:`\delta`. The :math:`\delta^{13}`\ C value of a +compound A, :math:`\delta^{13}`\ C\ :sub:`A`, is the difference between the isotope ratio of the compound, -*R\ :math:`{}_{A}`*, and that of the Pee Dee Belemnite standard, -*R\ :math:`{}_{PDB}`*, in parts per thousand +:math:`{R}_{A}`, and that of the Pee Dee Belemnite standard, :math:`{R}_{PDB}`, in parts per thousand .. math:: + :label: 25.3) - \label{25.3)} \delta ^{13} C_{A} =\left(\frac{R_{A} }{R_{PDB} } -1\right)\times 1000 -where *R\ :math:`{}_{PDB}`* = 0.0112372, and units of :math:`\deltaup` -are per mil (‰). +where :math:`{R}_{PDB}` = 0.0112372, and units of :math:`\delta` are per mil (‰). Isotopic fractionation can be expressed in several ways. One expression -of the fractionation factor is with alpha (:math:`\alphaup`) notation. +of the fractionation factor is with alpha (:math:`\alpha`) notation. For example, the equilibrium fractionation between two reservoirs A and B can be written as: .. math:: + :label: 25.4) - \label{25.4)} \alpha _{A-B} =\frac{R_{A} }{R_{B} } =\frac{\delta _{A} +1000}{\delta _{B} +1000} . -This can also be expressed using epsilon notation -(:math:`\varepsilonup`), where +This can also be expressed using epsilon notation (:math:`\epsilon`), where .. math:: + :label: 25.5) - \label{25.5)} \alpha _{A-B} =\frac{\varepsilon _{A-B} }{1000} +1 -In other words, if :math:`{\varepsilon }_{A-B}=4.4\mathrm{\textrm{‰}}`, -then :math:`\alphaup`\ :math:`{}_{A-B}`\ =1.0044. +In other words, if :math:`{\epsilon }_{A-B} = 4.4{\mathrm{‰}}`, then :math:`{\alpha}_{A-B} =1.0044`. -In addition to the stable isotopes :math:`{}^{1}`\ :math:`{}^{2}`\ C and -:math:`{}^{1}`\ :math:`{}^{3}`\ C, the unstable isotope -:math:`{}^{1}`\ :math:`{}^{4}`\ C is included in CLM. -:math:`{}^{1}`\ :math:`{}^{4}`\ C can also be described using the delta -notation: +In addition to the stable isotopes :sup:`1`\ :sup:`2`\ C and :sup:`1`\ :sup:`3`\ C, the unstable isotope +:sup:`1`\ :sup:`4`\ C is included in CLM. :sup:`1`\ :sup:`4`\ C can also be described using the delta notation: .. math:: + :label: 25.6) - \label{25.6)} \delta ^{14} C=\left(\frac{A_{s} }{A_{abs} } -1\right)\times 1000 -However, observations of :math:`{}^{1}`\ :math:`{}^{4}`\ C are typically +However, observations of :sup:`1`\ :sup:`4`\ C are typically fractionation-corrected using the following notation: .. math:: + :label: 25.7) - \label{25.7)} \Delta {}^{14} C=1000\times \left(\left(1+\frac{\delta {}^{14} C}{1000} \right)\frac{0.975^{2} }{\left(1+\frac{\delta {}^{13} C}{1000} \right)^{2} } -1\right) -where :math:`\deltaup`\ :math:`{}^{14}`\ C is the measured isotopic -fraction and :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C corrects for +where :math:`\delta^{14}`\ C is the measured isotopic +fraction and :math:`\mathrm{\Delta}^{14}`\ C corrects for mass-dependent isotopic fractionation processes (assumed to be 0.975 for -fractionation of :math:`{}^{13}`\ C by photosynthesis). CLM assumes a -background preindustrial atmospheric :math:`{}^{14}`\ C /C ratio of -10\ :math:`{}^{-12}`, which is used for A\ :math:`{}_{abs}`. For the -reference standard A\ :math:`{}_{abs}`, which is a plant tissue and has -a :math:`\deltaup`\ :math:`{}^{13}`\ C value is :math:`\mathrm{-}`\ 25 ‰ -due to photosynthetic discrimination, -:math:`\deltaup`\ :math:`{}^{14}`\ C = -:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C. For CLM, in order to use -the :math:`{}^{14}`\ C model independently of the :math:`{}^{13}`\ C -model, for the :math:`{}^{14}`\ C calculations, this fractionation is +fractionation of :sup:`13`\ C by photosynthesis). CLM assumes a +background preindustrial atmospheric :sup:`14`\ C /C ratio of 10\ :sup:`-12`, which is used for A\ :sub::`abs`. +For the reference standard A\ :math:`{}_{abs}`, which is a plant tissue and has +a :math:`\delta^{13}`\ C value is :math:`\mathrm{-}`\ 25 ‰ due to photosynthetic discrimination, +:math:`\delta`\ :sup:`14`\ C = :math:`\mathrm{\Delta}`\ :sup:`14`\ C. For CLM, in order to use +the :sup:`14`\ C model independently of the :sup:`13`\ C +model, for the :sup:`14`\ C calculations, this fractionation is set to zero, such that the 0.975 term becomes 1, the -:math:`\deltaup`\ :math:`{}^{13}`\ C term (for the calculation of -:math:`\deltaup`\ :math:`{}^{14}`\ C only) becomes 0, and thus -:math:`\deltaup`\ :math:`{}^{14}`\ C = -:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C. +:math:`\delta^{13}`\ C term (for the calculation of +:math:`\delta^{14}`\ C only) becomes 0, and thus +:math:`\delta^{14}`\ C = :math:`\mathrm{\Delta}`\ :sup:`14`\ C. Carbon Isotope Discrimination During Photosynthesis -------------------------------------------------------- Photosynthesis is modeled in CLM as a two-step process: diffusion of -CO\ :math:`{}_{2}` into the stomatal cavity, followed by enzymatic +CO\ :sub:`2` into the stomatal cavity, followed by enzymatic fixation (Chapter 8). Each step is associated with a kinetic isotope effect. The kinetic isotope effect during diffusion of -CO\ :math:`{}_{2}` through the stomatal opening is 4.4‰. The kinetic -isotope effect during fixation of CO\ :math:`{}_{2}` with Rubisco is +CO\ :sub:`2` through the stomatal opening is 4.4‰. The kinetic +isotope effect during fixation of CO\ :sub:`2` with Rubisco is :math:`\sim`\ 30‰; however, since about 5-10% of carbon in C3 plants reacts with phosphoenolpyruvate carboxylase (PEPC) (Melzer and O’Leary, 1987), the net kinetic isotope effect during fixation is @@ -160,37 +145,37 @@ and C4 plants are given below: For C4 plants, .. math:: + :label: 25.8) - \label{25.8)} \alpha _{psn} =1+\frac{4.4}{1000} For C3 plants, .. math:: + :label: 25.9) - \label{25.9)} \alpha _{psn} =1+\frac{4.4+22.6\frac{c_{i}^{*} }{pCO_{2} } }{1000} where :math:`{\alpha }_{psn}` is the fractionation factor, and -:math:`c^*_i` and pCO\ :math:`{}_{2}` are the revised intracellular and -atmospheric CO\ :math:`{}_{2}` partial pressure, respectively. +:math:`c^*_i` and pCO\ :sub:`2` are the revised intracellular and +atmospheric CO\ :sub:`2` partial pressure, respectively. As can be seen from the above equation, kinetic isotope effect during -fixation of CO\ :math:`{}_{2}` is dependent on the intracellular -CO\ :math:`{}_{2}` concentration, which in turn depends on the net +fixation of CO\ :sub:`2` is dependent on the intracellular +CO\ :sub:`2` concentration, which in turn depends on the net carbon assimilation. That is calculated during the photosynthesis calculation as follows: .. math:: + :label: 25.10) - \label{25.10)} c_{i} =pCO_{2} -a_{n} p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } and .. math:: + :label: 25.11) - \label{25.11)} c_{i}^{*} =pCO_{2} -a_{n} \left(1-d\right)p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } where :math:`a_n` is net carbon assimilation during photosynthesis, @@ -207,7 +192,7 @@ photosynthesis, which is downscaled by :math:`d`, and the potential photosynthesis. In order to overcome this mismatch, downscaling due to nitrogen limitation is factored in the calculation of the kinetic isotope effect during fixation by defining a downscaled version of -intracellular CO\ :math:`{}_{2}` (:math:`c^*_i`), as a first order +intracellular CO\ :sub:`2` (:math:`c^*_i`), as a first order approximation. However, since nitrogen down-regulation is calculated after the photosynthesis calculation, down-regulation coefficient calculated in the previous time step needs to be used. @@ -218,10 +203,10 @@ discrimination rates for each layer of a multi-layered canopy. However, as with the rest of the photosynthesis model, the number of canopy layers is currently set to one by default. -:math:`{}^{14}`\ C radioactive decay and historical atmospheric :math:`{}^{14}`\ C concentrations +:sup:`14`\ C radioactive decay and historical atmospheric :sup:`14`\ C concentrations ------------------------------------------------------------------------------------------------------ -In the preindustrial biosphere, radioactive decay of :math:`{}^{14}`\ C +In the preindustrial biosphere, radioactive decay of :sup:`14`\ C in carbon pools allows dating of long-term age since photosynthetic uptake; while over the 20\ :math:`{}^{th}` century, radiocarbon in the atmosphere was first diluted by radiocarbon-free fossil fuels and then @@ -230,27 +215,25 @@ its long-term mean concentration. CLM includes both of these processes to allow comparison of carbon that may vary on multiple timescales with observed values. -For radioactive decay, at each timestep all :math:`{}^{14}`\ C pools are +For radioactive decay, at each timestep all :sup:`14`\ C pools are reduced at a rate of –log/:math:`\tau`, where :math:`\tau` is the half-life (Libby half-life value of 5568 years). In order to rapidly equilibrate the long-lived pools during accelerated decomposition spinup, the radioactive decay of the accelerated pools is also accelerated by the same degree as the decomposition, such that the -:math:`{}^{14}`\ C value of these pools is in equilibrium when taken out +:sup:`14`\ C value of these pools is in equilibrium when taken out of the spinup mode. -For variation of atmospheric :math:`{}^{14}`\ C over the historical -period, :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C values can be set to -either fixed concentration (:math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C -= 0‰) or time-varying concentrations read in from a file. A default file +For variation of atmospheric :sup:`14`\ C over the historical +period, :math:`\mathrm{\Delta}`\ :sup:`14`\ C values can be set to +either fixed concentration (:math:`\mathrm{\Delta}`\ :sup:`14`\ C = 0‰) +or time-varying concentrations read in from a file. A default file is provided that is based on a spline fit through several observational datasets spanning the 20\ :math:`{}^{th}` century: (Levin and Kromer, 2004; Manning and Melhuish, 1994; Nydal and Lövseth, 1996; Turnbull et al. 2007). This is shown in Figure 25.1. -Figure 25.1. Atmospheric :math:`\mathrm{\Delta}`\ :math:`{}^{14}`\ C -used to drive :math:`{}^{14}`\ C model over the historical period. - -|image| +Figure 25.1. Atmospheric :math:`\mathrm{\Delta}`\ :sup:`14`\ C +used to drive :sup:`14`\ C model over the historical period. -.. |image| image:: image1 +.. image:: image1.png diff --git a/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst b/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst index 9bf3495e0c..c6a78b34d9 100644 --- a/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst +++ b/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst @@ -1,5 +1,3 @@ -.. math:: 1 - Offline Mode ================ @@ -27,12 +25,12 @@ to be run over Antarctica and ensures data is available along coastlines regardless of model resolution. The forcing data is ingested into a data atmosphere model in three -“streamsâ€; precipitation (:math:`P`) (mm s\ :math:`{}^{-1}`), solar -radiation (:math:`S_{atm}` ) (W m\ :math:`{}^{-2}`), and four other +“streamsâ€; precipitation (:math:`P`) (mm s\ :sup:`-1`), solar +radiation (:math:`S_{atm}` ) (W m\ :sup:`-2`), and four other fields [atmospheric pressure :math:`P_{atm}` (Pa), atmospheric specific -humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`), atmospheric +humidity :math:`q_{atm}` (kg kg\ :sup:`-1`), atmospheric temperature :math:`T_{atm}` (K), and atmospheric wind :math:`W_{atm}` -(m s\ :math:`{}^{-1}`)]. These are separate streams because they are +(m s\ :sup:`-1`)]. These are separate streams because they are handled differently according to the type of field. In the CRUNCEP dataset, the precipitation stream is provided at six hour intervals and the data atmosphere model prescribes the same precipitation rate for @@ -49,15 +47,15 @@ solar radiation supplied by the six-hourly forcing data is actually used. The solar radiation at model time step :math:`t_{M}` is .. math:: + :label: ZEqnNum160435 - \label{ZEqnNum160435} \begin{array}{l} {S_{atm} \left(t_{M} \right)=\frac{\frac{\Delta t_{FD} }{\Delta t_{M} } S_{atm} \left(t_{FD} \right)\mu \left(t_{M} \right)}{\sum _{i=1}^{\frac{\Delta t_{FD} }{\Delta t_{M} } }\mu \left(t_{M_{i} } \right) } \qquad {\rm for\; }\mu \left(t_{M} \right)>0.001} \\ {S_{atm} \left(t_{M} \right)=0\qquad {\rm for\; }\mu \left(t_{M} \right)\le 0.001} \end{array} where :math:`\Delta t_{FD}` is the time step of the forcing data (6 -hours :math:`\times` 3600 seconds hour\ :math:`{}^{-1}` = 21600 +hours :math:`\times` 3600 seconds hour\ :sup:`-1` = 21600 seconds), :math:`\Delta t_{M}` is the model time step (seconds), :math:`S_{atm} \left(t_{FD} \right)` is the six-hourly solar radiation -from the forcing data (W m\ :math:`{}^{-2}`), and +from the forcing data (W m\ :sup:`-2`), and :math:`\mu \left(t_{M} \right)` is the cosine of the solar zenith angle at model time step :math:`t_{M}` (section 3.3). The term in the denominator of equation is the sum of the cosine of the solar zenith @@ -71,46 +69,46 @@ derived from one year’s worth of hourly CAM output from CAM version cam3\_5\_55 as .. math:: + :label: 26.2) - \label{26.2)} S_{atm} \, \downarrow _{vis}^{\mu } =R_{vis} \left(\alpha S_{atm} \right) .. math:: + :label: 26.3) - \label{26.3)} S_{atm} \, \downarrow _{nir}^{\mu } =R_{nir} \left[\left(1-\alpha \right)S_{atm} \right] .. math:: + :label: 26.4) - \label{26.4)} S_{atm} \, \downarrow _{vis} =\left(1-R_{vis} \right)\left(\alpha S_{atm} \right) .. math:: + :label: 26.5) - \label{26.5)} S_{atm} \, \downarrow _{nir} =\left(1-R_{nir} \right)\left[\left(1-\alpha \right)S_{atm} \right]. where :math:`\alpha` , the ratio of visible to total incident solar radiation, is assumed to be .. math:: + :label: 26.6) - \label{26.6)} \alpha =\frac{S_{atm} \, \downarrow _{vis}^{\mu } +S_{atm} \, \downarrow _{vis}^{} }{S_{atm} } =0.5. The ratio of direct to total incident radiation in the visible :math:`R_{vis}` is .. math:: + :label: 26.7) - \label{26.7)} R_{vis} =a_{0} +a_{1} \times \alpha S_{atm} +a_{2} \times \left(\alpha S_{atm} \right)^{2} +a_{3} \times \left(\alpha S_{atm} \right)^{3} \qquad 0.01\le R_{vis} \le 0.99 and in the near-infrared :math:`R_{nir}` is .. math:: + :label: 26.8) - \label{26.8)} R_{nir} =b_{0} +b_{1} \times \left(1-\alpha \right)S_{atm} +b_{2} \times \left[\left(1-\alpha \right)S_{atm} \right]^{2} +b_{3} \times \left[\left(1-\alpha \right)S_{atm} \right]^{3} \qquad 0.01\le R_{nir} \le 0.99 where @@ -125,42 +123,42 @@ derived as follows. The atmospheric reference height :math:`z'_{atm}` :math:`u_{atm} =v_{atm} ={W_{atm} \mathord{\left/ {\vphantom {W_{atm} \sqrt{2} }} \right. \kern-\nulldelimiterspace} \sqrt{2} }` . The potential temperature :math:`\overline{\theta _{atm} }` (K) is set to the atmospheric temperature :math:`T_{atm}` . The atmospheric -longwave radiation :math:`L_{atm} \, \downarrow` (W m\ :math:`{}^{-2}`) +longwave radiation :math:`L_{atm} \, \downarrow` (W m\ :sup:`-2`) is derived from the atmospheric vapor pressure :math:`e_{atm}` and temperature :math:`T_{atm}` (Idso 1981) as .. math:: + :label: 26.9) - \label{26.9)} L_{atm} \, \downarrow =\left[0.70+5.95\times 10^{-5} \times 0.01e_{atm} \exp \left(\frac{1500}{T_{atm} } \right)\right]\sigma T_{atm}^{4} where .. math:: + :label: 26.10) - \label{26.10)} e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } and :math:`\sigma` is the Stefan-Boltzmann constant (W -m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6). The fraction of -precipitation :math:`P` (mm s\ :math:`{}^{-1}`) falling as rain and/or +m\ :sup:`-2` K\ :math:`{}^{-4}`) (Table 2.6). The fraction of +precipitation :math:`P` (mm s\ :sup:`-1`) falling as rain and/or snow is .. math:: + :label: ZEqnNum336485 - \label{ZEqnNum336485} q_{rain} =P\left(f_{P} \right), .. math:: + :label: 26.12) - \label{26.12)} q_{snow} =P\left(1-f_{P} \right) where .. math:: + :label: 26.13) - \label{26.13)} f_{P} =0<0.5\left(T_{atm} -T_{f} \right)<1. The aerosol deposition rates :math:`D_{sp}` (14 rates as described in @@ -171,11 +169,11 @@ If the user wishes to provide atmospheric forcing data from another source, the data format outlined above will need to be followed with the following exceptions. The data atmosphere model will accept a user-supplied relative humidity :math:`RH` (%) and derive specific -humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`) from +humidity :math:`q_{atm}` (kg kg\ :sup:`-1`) from .. math:: + :label: 26.14) - \label{26.14)} q_{atm} =\frac{0.622e_{atm} }{P_{atm} -0.378e_{atm} } where the atmospheric vapor pressure :math:`e_{atm}` (Pa) is derived @@ -190,9 +188,9 @@ temperature :math:`T_{dew}` (K) and derive specific humidity :math:`q_{atm}` from .. math:: + :label: 26.15) - \label{26.15)} - q_{atm} =\frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . + q_{atm} = \frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . Here, :math:`e_{sat}^{T}` , the saturation vapor pressure as a function of temperature, is derived from Lowe’s (1977) polynomials. If not diff --git a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst index fb30a23e60..5b73e1a70a 100644 --- a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst +++ b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst @@ -1,7 +1,3 @@ -.. math:: 1 - -.. math:: 1 - References ============== @@ -293,7 +289,7 @@ Farouki, O.T. 1981. The thermal properties of soils in cold regions. Cold Regions Sci. and Tech. 5:67-75. Farquhar, G.D., von Caemmerer, S., and Berry, J.A. 1980. A biochemical -model of photosynthetic CO\ :math:`{}_{2}` assimilation in leaves of +model of photosynthetic CO\ :sub:`2` assimilation in leaves of C\ :math:`{}_{3}` species. Planta 149:78-90. Farquhar, G.D., and von Caemmerer, S. 1982. Modeling of photosynthetic @@ -438,7 +434,7 @@ change. J. Geophys. Res. 113:D05211. DOI:10.1029/2007JD009092. Heald, C.L., Wilkinson, M.J., Monson, R.K., Alo, C.A., Wang, G.L., and Guenther, A. 2009. Response of isoprene emission to ambient -CO\ :math:`{}_{2}` changes and implications for global budgets. Global +CO\ :sub:`2` changes and implications for global budgets. Global Change Biol. 15:1127-1140. DOI:10.1111/j.1365-2486.2008.01802.x Henderson-Sellers, B. 1985. New formulation of eddy diffusion @@ -488,7 +484,7 @@ aspen and spruce stands in the north american boreal forest. Canadian Journal of Remote Sensing, 18: 126-133. Hunt, E.R., Jr. et al., 1996. Global net carbon exchange and -intra-annual atmospheric CO\ :math:`{}_{2}` concentrations predicted by +intra-annual atmospheric CO\ :sub:`2` concentrations predicted by an ecosystem process model and three-dimensional atmospheric transport model. Global Biogeochemical Cycles, 10: 431-456. @@ -746,7 +742,7 @@ to simulated chronic nitrogen deposition. Ecological Applications, 7: Mahowald, N.M., Muhs, D.R., Levis, S., Rasch, P.J., Yoshioka, M., Zender, C.S., and Luo, C. 2006. Change in atmospheric mineral aerosols in response to climate: last glacial period, pre-industrial, modern and -doubled CO\ :math:`{}_{2}` climates. J. Geophys. Res\ *.* 111:D10202. +doubled CO\ :sub:`2` climates. J. Geophys. Res\ *.* 111:D10202. DOI:10.1029/2005JD006653. Makela, A. 2002. Derivation of stem taper from the pipe model theory in @@ -1206,7 +1202,7 @@ structure. J. Climate 20:3902-3923. Thornton, P.E., Lamarque, J.-F., Rosenbloom, N.A., and Mahowald, N.M. 2007. Influence of carbon-nitrogen cycle coupling on land model response -to CO\ :math:`{}_{2}` fertilization and climate variability. Global +to CO\ :sub:`2` fertilization and climate variability. Global Biogeochem. Cycles 21:GB4018. Thornton, P.E., Doney, S.C., Lindsay, K., Moore, J.K., Mahowald, N., diff --git a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst index cc47ceedf1..e4320a9933 100644 --- a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst +++ b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst @@ -66,12 +66,9 @@ The average inverse diffuse optical depth per unit leaf and stem area is where :math:`\mu '` is the direction of the scattered flux. -The optical parameters :math:`\omega` , :math:`\beta` , and -:math:`\beta _{0}` , which vary with wavelength (:math:`\Lambda` ), are -weighted combinations of values for vegetation and snow. The model -determines that snow is on the canopy if :math:`T_{v} \le T_{f}` , where -:math:`T_{v}` is the vegetation temperature (K) (Chapter 5) and -:math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). In +The optical parameters :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}`, which vary with wavelength (:math:`\Lambda` ), are +weighted combinations of values for vegetation and snow. The model determines that snow is on the canopy if :math:`T_{v} \le T_{f}` , where +:math:`T_{v}` is the vegetation temperature (K) (Chapter 5) and :math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). In this case, the optical parameters are .. math:: @@ -89,12 +86,9 @@ this case, the optical parameters are \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{0,\, \Lambda }^{sno} f_{wet} -where :math:`f_{wet}` is the wetted fraction of the canopy (section -7.1). The snow and vegetation weights are applied to the products -:math:`\omega _{\Lambda } \beta _{\Lambda }` and -:math:`\omega _{\Lambda } \beta _{0,\, \Lambda }` because these -products are used in the two-stream equations. If there is no snow on -the canopy, +where :math:`f_{wet}` is the wetted fraction of the canopy (section 7.1). The snow and vegetation weights are applied to the products +:math:`\omega _{\Lambda } \beta _{\Lambda }` and :math:`\omega _{\Lambda } \beta _{0,\, \Lambda }` because these +products are used in the two-stream equations. If there is no snow on the canopy, .. math:: :label: 3.8 @@ -449,11 +443,11 @@ Table 3.1. Plant functional type optical properties +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ | BDS boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :math:`{}_{3}` arctic grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +| C\ :sub:`3` arctic grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :math:`{}_{3}` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +| C\ :sub:`3` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :math:`{}_{4}` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +| C\ :sub:`4` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ | Crop R | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ @@ -480,7 +474,7 @@ Table 3.2. Intercepted snow optical properties +-----------------------------+-------+-------+ | Parameter | vis | nir | -+-----------------------------+-------+-------+ ++=============================+=======+=======+ | :math:`\omega ^{sno}` | 0.8 | 0.4 | +-----------------------------+-------+-------+ | :math:`\beta ^{sno}` | 0.5 | 0.5 | @@ -491,8 +485,7 @@ Table 3.2. Intercepted snow optical properties Ground Albedos ------------------ -The overall direct beam :math:`\alpha _{g,\, \Lambda }^{\mu }` and -diffuse :math:`\alpha _{g,\, \Lambda }` ground albedos are weighted +The overall direct beam :math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse :math:`\alpha _{g,\, \Lambda }` ground albedos are weighted combinations of “soil†and snow albedos .. math:: @@ -505,8 +498,7 @@ combinations of “soil†and snow albedos \alpha _{g,\, \Lambda } =\alpha _{soi,\, \Lambda } \left(1-f_{sno} \right)+\alpha _{sno,\, \Lambda } f_{sno} -where :math:`f_{sno}` is the fraction of the ground covered with snow -(section 7.2.1). +where :math:`f_{sno}` is the fraction of the ground covered with snow (section 7.2.1). :math:`\alpha _{soi,\, \Lambda }^{\mu }` and :math:`\alpha _{soi,\, \Lambda }` vary with glacier, lake, wetland, and @@ -630,13 +622,10 @@ as g=\frac{\sum _{1}^{k}g_{k} \omega _{k} \tau _{k} }{\sum _{1}^{k}\omega _{k} \tau _{k} } -For each constituent (ice, two black carbon species, two organic carbon -species, and four dust species), :math:`\omega`, *g*, and -the mass extinction cross-section :math:`\psi` (:math:`\text{m}^{2} \text{kg}^{-1}`) -are computed offline with Mie Theory, e.g., -applying the computational technique from Bohren and Huffman (1983). The -extinction optical depth for each constituent depends on its mass -extinction cross-section and layer mass, :math:`w _{k} (\text{kg m} ^{-2}`) as +For each constituent (ice, two black carbon species, two organic carbon species, and four dust species), :math:`\omega`, *g*, and +the mass extinction cross-section :math:`\psi` (m\ :sup:`2` kg\ :sub:`-1`) +are computed offline with Mie Theory, e.g., applying the computational technique from Bohren and Huffman (1983). The +extinction optical depth for each constituent depends on its mass extinction cross-section and layer mass, :math:`w _{k}` (kg\ m\ :sup:`-1`) as .. math:: :label: 3.65 @@ -708,7 +697,7 @@ When any of these three conditions occur, the Eddington approximation is attempted instead, and if both approximations fail, the cosine of the solar zenith angle is adjusted by 0.02 (conserving incident flux) and a warning message is produced. This situation occurs in only about 1 in -10 :math:`{}^{6}` computations of snow albedo. After looping over the +10 :sup:`6` computations of snow albedo. After looping over the five spectral bands, absorption fluxes and albedo are averaged back into the bulk NIR band used by the rest of CLM. @@ -727,7 +716,7 @@ single timestep. The radiative transfer calculation is performed twice for each column containing a mass of snow greater than -:math:`1 \times 10^{-30} \text{kg m}^{-2}` (excluding lake and urban columns); once each for +:math:`1 \times 10^{-30}` kg\ m\ :sup:`-2` (excluding lake and urban columns); once each for direct-beam and diffuse incident flux. Absorption in each layer :math:`i` of pure snow is initially recorded as absorbed flux per unit incident flux on the ground (:math:`S_{sno,\, i}` ), as albedos must be @@ -745,7 +734,7 @@ vegetation canopy) have been calculated for the current time step (sections 3.1 and 4.1), the layer absorption factors (:math:`S_{g,\, i}`) are multiplied by the ground-incident fluxes to -produce solar absorption (W m\ :math:`{}^{-2}`) in each snow layer and +produce solar absorption (W m\ :sup:`-2`) in each snow layer and the underlying ground. Snowpack Optical Properties @@ -817,7 +806,7 @@ Table 3.5. Single-scatter albedo values used for snowpack impurities and ice | Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 0.9998 | 0.9960 | 0.9680 | 0.8730 | 0.5500 | +----------------------------------------------------------------+----------+----------+----------+----------+----------+ -Table 3.6. Mass extinction values (:math:`\text{m}^{2} \text{kg}^{-1}`) used for snowpack impurities and ice. +Table 3.6. Mass extinction values (m\ :sup:`2` kg\ :sub:`-1`) used for snowpack impurities and ice. +----------------------------------------------------------------+----------+----------+----------+----------+----------+ | Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | @@ -912,8 +901,7 @@ each time step *t* as r_{e} \left(t\right)=\left[r_{e} \left(t-1\right)+dr_{e,\, dry} +dr_{e,\, wet} \right]f_{old} +r_{e,\, 0} f_{new} +r_{e,\, rfz} f_{rfrz} Here, the effective radius of freshly-fallen snow -(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface -area of 60 :math:`\text{m}^{2} \text{kg}^{-1}`), and the effective +(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sub:`-1`), and the effective radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. Dry snow aging is based on a microphysical model described by Flanner @@ -940,8 +928,8 @@ The parameters :math:`{(\frac{dr_{e}}{dt}})_{0}`, lookup table with dimensions corresponding to snow temperature, temperature gradient, and density. The domain covered by this lookup table includes temperature ranging from 223 to 273 K, temperature -gradient ranging from 0 to 300 K m\ :math:`{}^{-1}`, and density ranging -from 50 to 400 kg m\ :math:`{}^{-3}`. Temperature gradient is calculated +gradient ranging from 0 to 300 K m\ :sup:`-1`, and density ranging +from 50 to 400 kg m\ :sup:`-3`. Temperature gradient is calculated at the midpoint of each snow layer *n*, using mid-layer temperatures (:math:`T_{n}`) and snow layer thicknesses (:math:`dz_{n}`), as @@ -967,8 +955,7 @@ fraction :math:`f_{liq}` as \frac{dr_{e} }{dt} =\frac{10^{18} C_{1} f_{liq} ^{3} }{4\pi r_{e} ^{2} } -The constant *C*\ :math:`{}_{1}` is -4.22\ :math:`\times`\ 10\ :math:`{}^{-13}`, and: +The constant *C*\ :sub:`1` is 4.22\ :math:`\times`\ 10\ :sup:`-13`, and: :math:`f_{liq} =w_{liq} /(w_{liq} +w_{ice} )`\ (section 7.2). In cases where snow mass is greater than zero, but a snow layer has not diff --git a/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst b/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst index 45d03e83f8..64506d1032 100644 --- a/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst +++ b/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst @@ -5,7 +5,7 @@ The net radiation at the surface is :math:`\left(\vec{S}_{v} +\vec{S}_{g} \right)-\left(\vec{L}_{v} +\vec{L}_{g} \right)`, where :math:`\vec{S}` is the net solar flux absorbed by the vegetation (“vâ€) and the ground (“gâ€) and :math:`\vec{L}` is the net longwave flux -(positive toward the atmosphere) (W m\ :math:`{}^{-2}`). +(positive toward the atmosphere) (W m\ :sup:`-2`). Solar Fluxes ---------------- @@ -51,7 +51,7 @@ The total solar radiation absorbed by the vegetation and ground is where :math:`S_{atm} \, \downarrow _{\Lambda }^{\mu }` and :math:`S_{atm} \, \downarrow _{\Lambda }` are the incident direct beam -and diffuse solar fluxes (W m\ :math:`{}^{-2}`). For non-vegetated +and diffuse solar fluxes (W m\ :sup:`-2`). For non-vegetated surfaces, :math:`e^{-K\left(L+S\right)} =1`, :math:`\overrightarrow{I}_{\Lambda }^{\mu } =\overrightarrow{I}_{\Lambda } =0`, :math:`I\, \downarrow _{\Lambda }^{\mu } =0`, and @@ -144,7 +144,7 @@ or shaded plant area at depth :math:`x`. Longwave Fluxes ------------------- -The net longwave radiation (W m\ :math:`{}^{-2}`) (positive toward the +The net longwave radiation (W m\ :sup:`-2`) (positive toward the atmosphere) at the surface is .. math:: @@ -154,7 +154,7 @@ atmosphere) at the surface is where :math:`L\, \uparrow` is the upward longwave radiation from the surface and :math:`L_{atm} \, \downarrow` is the downward atmospheric -longwave radiation (W m\ :math:`{}^{-2}`). The radiative temperature +longwave radiation (W m\ :sup:`-2`). The radiative temperature :math:`T_{rad}` (K) is defined from the upward longwave radiation as .. math:: @@ -162,10 +162,8 @@ longwave radiation (W m\ :math:`{}^{-2}`). The radiative temperature T_{rad} =\left(\frac{L\, \uparrow }{\sigma } \right)^{{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } -where :math:`\sigma` is the Stefan-Boltzmann constant (W -m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6). With reference to -Figure 4.1, the upward longwave radiation from the surface to the -atmosphere is +where :math:`\sigma` is the Stefan-Boltzmann constant (W\ m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6). With reference to +Figure 4.1, the upward longwave radiation from the surface to the atmosphere is .. math:: :label: 4.11 diff --git a/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst b/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst index 336fde1b9f..81c25ee0e8 100644 --- a/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst +++ b/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst @@ -2,15 +2,14 @@ Momentum, Sensible Heat, and Latent Heat Fluxes ================================================== The zonal :math:`\tau _{x}` and meridional :math:`\tau _{y}` momentum -fluxes (kg m\ :math:`{}^{-1}` s\ :math:`{}^{-2}`), sensible heat flux -:math:`H` (W m\ :math:`{}^{-2}`), and water vapor flux :math:`E` (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) between the atmosphere at +fluxes (kg m\ :sup:`-1` s\ :sup:`-2`), sensible heat flux +:math:`H` (W m\ :sup:`-2`), and water vapor flux :math:`E` (kg m\ :sup:`-2` s\ :sup:`-1`) between the atmosphere at reference height :math:`z_{atm,\, x}` (m) [where :math:`x` is height for wind (momentum) (:math:`m`), temperature (sensible heat) (:math:`h`), and humidity (water vapor) (:math:`w`); with zonal and meridional winds :math:`u_{atm}` and :math:`v_{atm}` (m -s\ :math:`{}^{-1}`), potential temperature :math:`\theta _{atm}` (K), -and specific humidity :math:`q_{atm}` (kg kg\ :math:`{}^{-1}`)] and the +s\ :sup:`-1`), potential temperature :math:`\theta _{atm}` (K), +and specific humidity :math:`q_{atm}` (kg kg\ :sup:`-1`)] and the surface [with :math:`u_{s}` , :math:`v_{s}` , :math:`\theta _{s}` , and :math:`q_{s}` ] are @@ -39,7 +38,7 @@ similarity theory developed for the surface layer (i.e., the nearly constant flux layer above the surface sublayer). In this derivation, :math:`u_{s}` and :math:`v_{s}` are defined to equal zero at height :math:`z_{0m} +d` (the apparent sink for momentum) so that -:math:`r_{am}` is the aerodynamic resistance (s m\ :math:`{}^{-1}`) for +:math:`r_{am}` is the aerodynamic resistance (s m\ :sup:`-1`) for momentum between the atmosphere at height :math:`z_{atm,\, m}` and the surface at height :math:`z_{0m} +d`. Thus, the momentum fluxes become @@ -57,12 +56,12 @@ Likewise, :math:`\theta _{s}` and :math:`q_{s}` are defined at heights :math:`z_{0h} +d` and :math:`z_{0w} +d` (the apparent sinks for heat and water vapor, respectively -:math:`r_{aw}` are the aerodynamic resistances (s m\ :math:`{}^{-1}`) +:math:`r_{aw}` are the aerodynamic resistances (s m\ :sup:`-1`) to sensible heat and water vapor transfer between the atmosphere at heights :math:`z_{atm,\, h}` and :math:`z_{atm,\, w}` and the surface at heights :math:`z_{0h} +d` and :math:`z_{0w} +d`, respectively. The -specific heat capacity of air :math:`C_{p}` (J kg\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`) is a constant (Table 2.6). The atmospheric potential +specific heat capacity of air :math:`C_{p}` (J kg\ :sup:`-1` +K\ :sup:`-1`) is a constant (Table 2.6). The atmospheric potential temperature used here is .. math:: @@ -72,15 +71,13 @@ temperature used here is where :math:`T_{atm}` is the air temperature (K) at height :math:`z_{atm,\, h}` and :math:`\Gamma _{d} =0.0098` K -m\ :math:`{}^{-1}` is the negative of the dry adiabatic lapse rate [this +m\ :sup:`-1` is the negative of the dry adiabatic lapse rate [this expression is first-order equivalent to :math:`\theta _{atm} =T_{atm} \left({P_{srf} \mathord{\left/ {\vphantom {P_{srf} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } \right)^{{R_{da} \mathord{\left/ {\vphantom {R_{da} C_{p} }} \right. \kern-\nulldelimiterspace} C_{p} } }` (Stull 1988), where :math:`P_{srf}` is the surface pressure (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`R_{da}` -is the gas constant for dry air (J kg\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`) (Table 2.6)]. By definition, -:math:`\theta _{s} =T_{s}` . The density of moist air (kg -m\ :math:`{}^{-3}`) is +is the gas constant for dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6)]. By definition, +:math:`\theta _{s} =T_{s}` . The density of moist air (kg m\ :sup:`-3`) is .. math:: :label: 5.8 @@ -99,8 +96,8 @@ Monin-Obukhov Similarity Theory ----------------------------------- The surface vertical kinematic fluxes of momentum -:math:`\overline{u'w'}` and :math:`\overline{v'w'}` (:math:`\text{m}^{2} \text{s}^{-2}`), sensible heat :math:`\overline{\theta 'w'}` -(:math:`\text{K m} \text{s}^{-1}`), and latent heat :math:`\overline{q'w'}` (:math:`\text{kg kg }^{-1}` m s\ :math:`{}^{-1}`), where :math:`u'`, :math:`v'`, +:math:`\overline{u'w'}` and :math:`\overline{v'w'}` (m\ :sup:`2` s\ :sub:`-2`), sensible heat :math:`\overline{\theta 'w'}` +(K m s :sup:`-1`), and latent heat :math:`\overline{q'w'}` (kg kg\ :sup:`-1` m s\ :sup:`-1`), where :math:`u'`, :math:`v'`, :math:`w'`, :math:`\theta '`, and :math:`q'` are zonal horizontal wind, meridional horizontal wind, vertical velocity, potential temperature, and specific humidity turbulent fluctuations about the mean, are defined @@ -130,16 +127,15 @@ displacement height (m), :math:`L` is the Monin-Obukhov length scale (m) that accounts for buoyancy effects resulting from vertical density gradients (i.e., the atmospheric stability), k is the von Karman constant (Table 2.6), and :math:`\left|{\it u}\right|` is the -atmospheric wind speed (m s\ :math:`{}^{-1}`). :math:`\phi _{m}` , +atmospheric wind speed (m s\ :sup:`-1`). :math:`\phi _{m}` , :math:`\phi _{h}` , and :math:`\phi _{w}` are universal (over any surface) similarity functions of :math:`\zeta` that relate the constant fluxes of momentum, sensible heat, and latent heat to the mean profile gradients of :math:`\left|{\it u}\right|`, :math:`\theta` , and :math:`q` in the surface layer. In neutral conditions, :math:`\phi _{m} =\phi _{h} =\phi _{w} =1`. The velocity (i.e., friction -velocity) :math:`u_{\*}` (m s\ :math:`{}^{-1}`), temperature -:math:`\theta _{\*}` (K), and moisture :math:`q_{\*}` (kg -kg\ :math:`{}^{-1}`) scales are +velocity) :math:`u_{\*}` (m s\ :sup:`-1`), temperature +:math:`\theta _{\*}` (K), and moisture :math:`q_{\*}` (kg kg\ :sup:`-1`) scales are .. math:: :label: 5.13 @@ -156,12 +152,11 @@ kg\ :math:`{}^{-1}`) scales are q_{*} u_{*} =-\overline{q'w'}=-\frac{E}{\rho _{atm} } -where :math:`\left|{\it \tau }\right|` is the shearing stress (kg -m\ :math:`{}^{-1}` s\ :math:`{}^{-2}`), with zonal and meridional +where :math:`\left|{\it \tau }\right|` is the shearing stress (kg m\ :sup:`-1` s\ :sup:`-2`), with zonal and meridional components :math:`\overline{u'w'}=-\frac{\tau _{x} }{\rho _{atm} }` and :math:`\overline{v'w'}=-\frac{\tau _{y} }{\rho _{atm} }` , respectively, -:math:`H` is the sensible heat flux (W m\ :math:`{}^{-2}`) and :math:`E` -is the water vapor flux (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). +:math:`H` is the sensible heat flux (W m\ :sup:`-2`) and :math:`E` +is the water vapor flux (kg m\ :sup:`-2` s\ :sup:`-1`). The dimensionless length scale :math:`L` is the Monin-Obukhov length defined as @@ -171,7 +166,7 @@ defined as L=-\frac{u_{*}^{3} }{k\left(\frac{g}{\overline{\theta _{v,\, atm} }} \right)\theta '_{v} w'} =\frac{u_{*}^{2} \overline{\theta _{v,\, atm} }}{kg\theta _{v*} } -where :math:`g` is the acceleration of gravity (m s\ :math:`{}^{-2}`) +where :math:`g` is the acceleration of gravity (m s\ :sup:`-2`) (Table 2.6), and :math:`\overline{\theta _{v,\, atm} }=\overline{\theta _{atm} }\left(1+0.61q_{atm} \right)` is the reference virtual potential temperature. :math:`L>0` indicates @@ -504,7 +499,7 @@ and the atmosphere can also be written in the form E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } -where the aerodynamic resistances (s m\ :math:`{}^{-1}`) are +where the aerodynamic resistances (s m\ :sup:`-1`) are .. math:: :label: ZEqnNum660763 @@ -566,7 +561,7 @@ definition, this includes bare soil, wetlands, and glaciers. The solution for lakes is described in Chapter 9. For these surfaces, the surface may be exposed to the atmosphere, snow covered, and/or surface water covered, so that the sensible heat flux :math:`H_{g}` (W -m\ :math:`{}^{-2}`) is, with reference to Figure 5.1, +m\ :sup:`-2`) is, with reference to Figure 5.1, .. math:: :label: ZEqnNum726771 @@ -594,15 +589,13 @@ surface water :math:`T_{h2osfc}` are H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{h2osfc} \right)}{r_{ah} } -where :math:`\rho _{atm}` is the density of atmospheric air (kg -m\ :math:`{}^{-3}`), :math:`C_{p}` is the specific heat capacity of air -(J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +where :math:`\rho _{atm}` is the density of atmospheric air (kg m\ :sup:`-3`), :math:`C_{p}` is the specific heat capacity of air +(J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), :math:`\theta _{atm}` is the atmospheric potential temperature (K), and :math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer -(s m\ :math:`{}^{-1}`). +(s m\ :sup:`-1`). -The water vapor flux :math:`E_{g}` (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) is, with reference to Figure 5.2, +The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with reference to Figure 5.2, .. math:: :label: ZEqnNum419297 @@ -624,14 +617,10 @@ s\ :math:`{}^{-1}`) is, with reference to Figure 5.2, E_{h2osfc} =-\frac{\rho _{atm} \left(q_{atm} -q_{h2osfc} \right)}{r_{aw} } -where :math:`\beta _{soi}` is an empirical function of soil water -(Sakaguchi and Zeng 2009), :math:`q_{atm}` is the atmospheric specific -humidity (kg kg\ :math:`{}^{-1}`), :math:`q_{soil}` , :math:`q_{sno}` , -and :math:`q_{h2osfc}` are the specific humidities (kg -kg\ :math:`{}^{-1}`) of the soil, snow, and surface water, respectively, -and :math:`r_{aw}` is the aerodynamic resistance to water vapor -transfer (s m\ :math:`{}^{-1}`). The specific humidities of the snow -:math:`q_{sno}` and surface water :math:`q_{h2osfc}` are assumed to be +where :math:`\beta _{soi}` is an empirical function of soil water (Sakaguchi and Zeng 2009), :math:`q_{atm}` is the atmospheric specific +humidity (kg kg\ :sup:`-1`), :math:`q_{soil}` , :math:`q_{sno}` , and :math:`q_{h2osfc}` are the specific humidities +(kg kg\ :sup:`-1`) of the soil, snow, and surface water, respectively, and :math:`r_{aw}` is the aerodynamic resistance to water vapor +transfer (s m\ :sup:`-1`). The specific humidities of the snow :math:`q_{sno}` and surface water :math:`q_{h2osfc}` are assumed to be at the saturation specific humidity of their respective temperatures .. math:: @@ -662,9 +651,8 @@ potential :math:`\psi` as in Philip (1957) \alpha _{soil} =\exp \left(\frac{\psi _{1} g}{1\times 10^{3} R_{wv} T_{1} } \right) -where :math:`R_{wv}` is the gas constant for water vapor (J -kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), :math:`g` is the -gravitational acceleration (m s\ :math:`{}^{-2}`) (Table 2.6), and +where :math:`R_{wv}` is the gas constant for water vapor (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), :math:`g` is the +gravitational acceleration (m s\ :sup:`-2`) (Table 2.6), and :math:`\psi _{1}` is the soil water matric potential of the top soil layer (mm). The soil water matric potential :math:`\psi _{1}` is @@ -686,11 +674,11 @@ soil layer with respect to saturation. The surface wetness where :math:`\Delta z_{1}` is the thickness of the top soil layer (m), :math:`\rho _{liq}` and :math:`\rho _{ice}` are the density of liquid -water and ice (kg m\ :math:`{}^{-3}`) (Table 2.6), :math:`w_{liq,\, 1}` +water and ice (kg m\ :sup:`-3`) (Table 2.6), :math:`w_{liq,\, 1}` and :math:`w_{ice,\, 1}` are the mass of liquid water and ice of the -top soil layer (:math:`\text{kg} \text{m}^{-2}`) (Chapter 7), and +top soil layer (kg m\ :sup:`-2`) (Chapter 7), and :math:`\theta _{sat,\, 1}` is the saturated volumetric water content -(i.e., porosity) of the top soil layer (:math:`\text{mm}^{3}` :math:`\text{mm}^{-3}`) (section 7.4.1). If +(i.e., porosity) of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) (section 7.4.1). If :math:`q_{sat}^{T_{1} } >q_{atm}` and :math:`q_{atm} >q_{soil}` , then :math:`q_{soil} =q_{atm}` and :math:`\frac{dq_{soil} }{dT} =0`. This prevents large increases (decreases) in :math:`q_{soil}` for small @@ -708,7 +696,7 @@ surface within the dry part of the soil (Sakaguchi and Zeng 2009) as where :math:`\theta _{fc,\, 1}` is the field capacity of the top soil layer and :math:`0.01{\le \theta _{1} \mathord{\left/ {\vphantom {\le \theta _{1} \theta _{fc,\, 1} \le 1}} \right. \kern-\nulldelimiterspace} \theta _{fc,\, 1} \le 1}` . -The volumetric water content of the top soil layer (:math:`\text{mm}^{3}` :math:`\text{mm}^{-3}`) is +The volumetric water content of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) is .. math:: :label: 5.77) @@ -716,7 +704,7 @@ The volumetric water content of the top soil layer (:math:`\text{mm}^{3}` :math: \theta _{1} =\frac{1}{\Delta z_{1} } \left[\frac{w_{liq,\, 1} }{\rho _{liq} } +\frac{w_{ice,\, 1} }{\rho _{ice} } \right]. The volumetric water content at field capacity is derived by assuming a -hydraulic conductivity of 0.1 mm day\ :math:`{}^{-1}` and inverting the +hydraulic conductivity of 0.1 mm day\ :sup:`-1` and inverting the hydraulic conductivity function (section 7.4.1) as .. math:: @@ -725,7 +713,7 @@ hydraulic conductivity function (section 7.4.1) as \theta _{fc,\, 1} =\theta _{sat,\, 1} \left[\frac{0.1}{86400k_{sat,\, 1} } \right]^{\frac{1}{2B_{i} +3} } where :math:`k_{sat,\, 1}` is the saturated hydraulic conductivity of -the top soil layer (mm s\ :math:`{}^{-1}`) (section 7.4.1) and the +the top soil layer (mm s\ :sup:`-1`) (section 7.4.1) and the exponent :math:`B_{1}` is a function of soil texture (section 7.4.1). The roughness lengths used to calculate :math:`r_{am}` , @@ -748,18 +736,16 @@ Zilitinkevich (1970) is adopted by Zeng and Dickinson (1998) z_{0h,\, g} =z_{0w,\, g} =z_{0m,\, g} e^{-a\left({u_{*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon } \right)^{0.45} } where the quantity -:math:`{u_{*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon }` -is the roughness Reynolds number (and may be interpreted as the Reynolds -number of the smallest turbulent eddy in the flow) with the kinematic -viscosity of air :math:`\upsilon =1.5\times 10^{-5}` m\ :math:`{}^{2}` -s\ :math:`{}^{-1}` and :math:`a=0.13`. +:math:`{u_{\*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon }` +is the roughness Reynolds number (and may be interpreted as the Reynolds number of the smallest turbulent eddy in the flow) with the kinematic +viscosity of air :math:`\upsilon =1.5\times 10^{-5}` m\ :sup:`2` s\ :sup:`-1` and :math:`a=0.13`. The numerical solution for the fluxes of momentum, sensible heat, and water vapor flux from non-vegetated surfaces proceeds as follows: #. An initial guess for the wind speed :math:`V_{a}` is obtained from eq. assuming an initial convective velocity :math:`U_{c} =0` m - s\ :math:`{}^{-1}` for stable conditions + s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from eq. ) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). @@ -886,19 +872,18 @@ where, with reference to Figure 5.1, H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{h2osfc} \right)}{r_{ah} ^{{'} } } -where :math:`\rho _{atm}` is the density of atmospheric air (kg -m\ :math:`{}^{-3}`), :math:`C_{p}` is the specific heat capacity of air -(J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +where :math:`\rho _{atm}` is the density of atmospheric air (kg m\ :sup:`-3`), :math:`C_{p}` is the specific heat capacity of air +(J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), :math:`\theta _{atm}` is the atmospheric potential temperature (K), and :math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer -(s m\ :math:`{}^{-1}`). +(s m\ :sup:`-1`). Here, :math:`T_{s}` is the surface temperature at height :math:`z_{0h} +d`, also referred to as the canopy air temperature. :math:`L` and :math:`S` are the exposed leaf and stem area indices (section 2.1.4), :math:`r_{b}` is the leaf boundary layer resistance (s -m\ :math:`{}^{-1}`), and :math:`r_{ah} ^{{'} }` is the aerodynamic -resistance (s m\ :math:`{}^{-1}`) to heat transfer between the ground at +m\ :sup:`-1`), and :math:`r_{ah} ^{{'} }` is the aerodynamic +resistance (s m\ :sup:`-1`) to heat transfer between the ground at height :math:`z_{0h} ^{{'} }` and the canopy air at height :math:`z_{0h} +d`. @@ -938,7 +923,7 @@ where are the sensible heat conductances from the canopy air to the atmosphere, the ground to canopy air, and leaf surface to canopy air, -respectively (m s\ :math:`{}^{-1}`). +respectively (m s\ :sup:`-1`). When the expression for :math:`T_{s}` is substituted into equation , the sensible heat flux from vegetation :math:`H_{v}` is a function of @@ -1000,19 +985,18 @@ where, with reference to Figure 5.2, E_{h2osfc} =-\rho _{atm} \frac{\left(q_{s} -q_{h2osfc} \right)}{r_{aw} ^{{'} } +r_{litter} } -where :math:`q_{atm}` is the atmospheric specific humidity (kg -kg\ :math:`{}^{-1}`), :math:`r_{aw}` is the aerodynamic resistance to -water vapor transfer (s m\ :math:`{}^{-1}`), :math:`q_{sat}^{T_{v} }` -(kg kg\ :math:`{}^{-1}`) is the saturation water vapor specific humidity +where :math:`q_{atm}` is the atmospheric specific humidity (kg kg\ :sup:`-1`), :math:`r_{aw}` is the aerodynamic resistance to +water vapor transfer (s m\ :sup:`-1`), :math:`q_{sat}^{T_{v} }` +(kg kg\ :sup:`-1`) is the saturation water vapor specific humidity at the vegetation temperature (section 5.5), :math:`q_{g}` , :math:`q_{sno}` , and :math:`q_{h2osfc}` are the specific humidities of the soil, snow, and surface water (section 5.2), :math:`r_{aw} ^{{'} }` is the aerodynamic resistance (s -m\ :math:`{}^{-1}`) to water vapor transfer between the ground at height +m\ :sup:`-1`) to water vapor transfer between the ground at height :math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, :math:`\beta _{soi}` is an empirical function of soil water (section 5.2), and :math:`r_{litter}` is a resistance for the plant litter layer -(s m\ :math:`{}^{-1}`). :math:`r_{total}` is the total resistance to +(s m\ :sup:`-1`). :math:`r_{total}` is the total resistance to water vapor transfer from the canopy to the canopy air and includes contributions from leaf boundary layer and sunlit and shaded stomatal resistances :math:`r_{b}` , :math:`r_{s}^{sun}` , and @@ -1063,7 +1047,7 @@ as r''=\left\{\begin{array}{l} {\min \left(f_{wet} +r_{dry} ^{{'} {'} } ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} >0} \\ {\min \left(f_{wet} ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} \le 0} \\ {1\qquad E_{v}^{w,\, pot} \le 0} \end{array}\right\} where :math:`f_{wet}` is the fraction of leaves and stems that are wet -(section 7.1), :math:`W_{can}` is canopy water (kg m\ :math:`{}^{-2}`) +(section 7.1), :math:`W_{can}` is canopy water (kg m\ :sup:`-2`) (section 7.1), :math:`\Delta t` is the time step (s), and :math:`\beta _{t}` is a soil moisture function limiting transpiration (Chapter 8). The potential evaporation from wet foliage per unit wetted @@ -1085,7 +1069,7 @@ where :math:`f_{dry}` is the fraction of leaves that are dry (section 7.1), :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded leaf area indices (section 4.1), and :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}` are the sunlit and shaded stomatal resistances (s -m\ :math:`{}^{-1}`) (Chapter 8). +m\ :sup:`-1`) (Chapter 8). When the expression for :math:`q_{s}` is substituted into equation , the water vapor flux from vegetation :math:`E_{v}` is a function of @@ -1122,7 +1106,7 @@ where U_{av} =V_{a} \sqrt{\frac{1}{r_{am} V_{a} } } =u_{*} is the magnitude of the wind velocity incident on the leaves -(equivalent here to friction velocity) (m s\ :math:`{}^{-1}`) and +(equivalent here to friction velocity) (m s\ :sup:`-1`) and :math:`C_{s}` is the turbulent transfer coefficient between the underlying soil and the canopy air. :math:`C_{s}` is obtained by interpolation between values for dense canopy and bare soil (Zeng et al. @@ -1158,7 +1142,7 @@ determined from S=\frac{gz_{top} \left(T_{s} -T_{g} \right)}{T_{s} u_{*}^{2} } where :math:`g` is the gravitational acceleration (m -s\ :math:`{}^{-2}`) (Table 2.6), and :math:`z_{top}` is canopy top +s\ :sup:`-2`) (Table 2.6), and :math:`z_{top}` is canopy top height (m) (Table 2.2). The bare soil turbulent transfer coefficient is .. math:: @@ -1167,21 +1151,19 @@ height (m) (Table 2.2). The bare soil turbulent transfer coefficient is C_{s,\, bare} =\frac{k}{a} \left(\frac{z_{0m,\, g} U_{av} }{\upsilon } \right)^{-0.45} where the kinematic viscosity of air -:math:`\upsilon =1.5\times 10^{-5}` m\ :math:`{}^{2}` -s\ :math:`{}^{-1}` and :math:`a=0.13`. +:math:`\upsilon =1.5\times 10^{-5}` m\ :sup:`2` +s\ :sup:`-1` and :math:`a=0.13`. The litter resistance :math:`r_{litter}` (Sakaguchi and Zeng 2009) (s -m\ :math:`{}^{-1}`) is +m\ :sup:`-1`) is .. math:: :label: 5.120) r_{litter} =\frac{1}{0.004u_{*} } \left(1-e^{-L_{litter}^{eff} } \right) -where the effective litter area index :math:`L_{litter}^{eff}` -(:math:`\text{m}^{2}` :math:`\text{m}^{-2}`) is the fraction of plant litter -area index :math:`L_{litter}` (currently set to 0.5 :math:`\text{m}^{2}` -:math:`\text{m}^{-2}`) that is not covered by snow +where the effective litter area index :math:`L_{litter}^{eff}` (m\ :sup:`2` m\ :sup:`-2`) is the fraction of plant litter +area index :math:`L_{litter}` (currently set to 0.5 m\ :sup:`2` m\ :sup:`-2`) that is not covered by snow .. math:: :label: 5.121) @@ -1206,7 +1188,7 @@ The leaf boundary layer resistance :math:`r_{b}` is r_{b} =\frac{1}{C_{v} } \left({U_{av} \mathord{\left/ {\vphantom {U_{av} d_{leaf} }} \right. \kern-\nulldelimiterspace} d_{leaf} } \right)^{{-1\mathord{\left/ {\vphantom {-1 2}} \right. \kern-\nulldelimiterspace} 2} } -where :math:`C_{v} =0.01` m s\ :math:`{}^{-1/2}` is the turbulent +where :math:`C_{v} =0.01` m\ s\ :sup:`-1/2` is the turbulent transfer coefficient between the canopy surface and canopy air, and :math:`d_{leaf}` is the characteristic dimension of the leaves in the direction of wind flow (Table 5.1). @@ -1261,7 +1243,7 @@ length and displacement height to canopy top height, respectively (Table V=\frac{1-\exp \left\{-\beta \min \left[L+S,\, \left(L+S\right)_{cr} \right]\right\}}{1-\exp \left[-\beta \left(L+S\right)_{cr} \right]} -where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} =2` (:math:`\text{m}^{2}` m\ :math:`{}^{-2}`) is a critical value of exposed leaf +where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} =2` (m\ :sup:`2` m\ :sup:`-2`) is a critical value of exposed leaf plus stem area for which :math:`z_{0m}` reaches its maximum. Table 5.1. Plant functional type aerodynamic parameters @@ -1291,11 +1273,11 @@ Table 5.1. Plant functional type aerodynamic parameters +----------------------------------+--------------------+------------------+-------------------------+ | BDS boreal | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ -| C\ :math:`{}_{3}` arctic grass | 0.120 | 0.68 | 0.04 | +| C\ :sub:`3` arctic grass | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ -| C\ :math:`{}_{3}` grass | 0.120 | 0.68 | 0.04 | +| C\ :sub:`3` grass | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ -| C\ :math:`{}_{4}` grass | 0.120 | 0.68 | 0.04 | +| C\ :sub:`4` grass | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ | Crop R | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ @@ -1413,7 +1395,7 @@ proceeds as follows: #. An initial guess for the wind speed :math:`V_{a}` is obtained from eq. assuming an initial convective velocity :math:`U_{c} =0` m - s\ :math:`{}^{-1}` for stable conditions + s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from eq. ) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). @@ -1594,7 +1576,7 @@ is the sum of :math:`E'_{g}` over all evaporating PFTs where relative area of the :math:`j^{th}` PFT with respect to the column, and :math:`npft` is the number of PFTs on the column. :math:`w_{ice,\, snl+1}` and :math:`w_{liq,\, snl+1}` are the ice and -liquid water contents (kg m\ :math:`{}^{-2}`) of the top snow/soil layer +liquid water contents (kg m\ :sup:`-2`) of the top snow/soil layer (Chapter 7). Any resulting energy deficit is assigned to sensible heat as @@ -1603,13 +1585,9 @@ as H''_{g} =H_{g} +\lambda \left(E'_{g} -E''_{g} \right). -The ground water vapor flux :math:`E''_{g}` is partitioned into -evaporation of liquid water from snow/soil :math:`q_{seva}` (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), sublimation from snow/soil ice -:math:`q_{subl}` (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), liquid dew -on snow/soil :math:`q_{sdew}` (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), or frost on snow/soil :math:`q_{frost}` (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) as +The ground water vapor flux :math:`E''_{g}` is partitioned into evaporation of liquid water from snow/soil :math:`q_{seva}` +(kg\ m\ :sup:`-2` s\ :sup:`-1`), sublimation from snow/soil ice :math:`q_{subl}` (kg m\ :sup:`-2` s\ :sup:`-1`), liquid dew +on snow/soil :math:`q_{sdew}` (kg m\ :sup:`-2` s\ :sup:`-1`), or frost on snow/soil :math:`q_{frost}` (kg m\ :sup:`-2` s\ :sup:`-1`) as .. math:: :label: 5.146) @@ -1677,7 +1655,7 @@ When converting ground water vapor flux to an energy flux, the term where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the latent heat of sublimation and vaporization, respectively (J -kg\ :math:`{}^{-1}`) (Table 2.6). When converting vegetation water vapor +(kg\ :sup:`-1`) (Table 2.6). When converting vegetation water vapor flux to an energy flux, :math:`\lambda _{vap}` is used. The system balances energy as diff --git a/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst b/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst index d39a780958..83dc1e3579 100644 --- a/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst @@ -9,10 +9,10 @@ The first law of heat conduction is F=-\lambda \nabla T where :math:`F` is the amount of heat conducted across a unit -cross-sectional area in unit time (W m\ :math:`{}^{-2}`), -:math:`\lambda` is thermal conductivity (W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`), and :math:`\nabla T` is the spatial gradient of -temperature (K m\ :math:`{}^{-1}`). In one-dimensional form +cross-sectional area in unit time (W m\ :sup:`-2`), +:math:`\lambda` is thermal conductivity (W m\ :sup:`-1` +K\ :sup:`-1`), and :math:`\nabla T` is the spatial gradient of +temperature (K m\ :sup:`-1`). In one-dimensional form .. math:: :label: ZEqnNum105915 @@ -30,7 +30,7 @@ in the form of the continuity equation is invoked as c\frac{\partial T}{\partial t} =-\frac{\partial F_{z} }{\partial z} where :math:`c` is the volumetric snow/soil heat capacity (J -m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`) and :math:`t` is time (s). +m\ :sup:`-3` K\ :sup:`-1`) and :math:`t` is time (s). Combining equations and yields the second law of heat conduction in one-dimensional form @@ -164,9 +164,9 @@ are defined as negative values Note that :math:`z_{h,\, 0}` , the interface between the bottom snow layer and the top soil layer, is zero. Thermal properties (i.e., temperature :math:`T_{i}` [K]; thermal conductivity -:math:`\lambda _{i}` [W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`]; -volumetric heat capacity :math:`c_{i}` [J m\ :math:`{}^{-3}` -K\ :math:`{}^{-1}`]) are defined for soil layers at the node depths +:math:`\lambda _{i}` [W m\ :sup:`-1` K\ :sup:`-1`]; +volumetric heat capacity :math:`c_{i}` [J m\ :sup:`-3` +K\ :sup:`-1`]) are defined for soil layers at the node depths (Figure 6.1) and for snow layers at the layer midpoints. When present, snow occupies a fraction of a grid cell’s area, therefore snow depth represents the thickness of the snowpack averaged over only the snow @@ -175,7 +175,7 @@ of the snow covered area as :math:`\bar{z}_{sno} =f_{sno} z_{sno}` . By default, the grid cell average snow depth is written to the history file. -The heat flux :math:`F_{i}` (W m\ :math:`{}^{-2}`) from layer :math:`i` +The heat flux :math:`F_{i}` (W m\ :sup:`-2`) from layer :math:`i` to layer :math:`i+1` is .. math:: @@ -257,7 +257,7 @@ element band-diagonal system of equations. For the top soil layer :math:`i=1` , top snow layer :math:`i=snl+1`, or surface water layer, the heat flux from the overlying atmosphere -:math:`h` (W m\ :math:`{}^{-2}`, defined as positive into the surface) +:math:`h` (W m\ :sup:`-2`, defined as positive into the surface) is .. math:: @@ -346,10 +346,8 @@ where the partial derivative of the net longwave radiation is and the partial derivatives of the sensible and latent heat fluxes are given by equations and for non-vegetated surfaces, and by equations and for vegetated surfaces. :math:`\sigma` is the Stefan-Boltzmann constant -(W m\ :math:`{}^{-2}` K\ :math:`{}^{-4}`) (Table 2.6) and -:math:`\varepsilon _{g}` is the ground emissivity (section 4.2). For -purposes of computing :math:`h` and -:math:`\frac{\partial h}{\partial T_{g} }` , the term :math:`\lambda` +(W m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6) and :math:`\varepsilon _{g}` is the ground emissivity (section 4.2). For +purposes of computing :math:`h` and :math:`\frac{\partial h}{\partial T_{g} }` , the term :math:`\lambda` is arbitrarily assumed to be .. math:: @@ -359,9 +357,9 @@ is arbitrarily assumed to be where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the latent heat of sublimation and vaporization, respectively (J -kg\ :math:`{}^{-1}`) (Table 2.6), and :math:`w_{liq,\, snl+1}` and +kg\ :sup:`-1`) (Table 2.6), and :math:`w_{liq,\, snl+1}` and :math:`w_{ice,\, snl+1}` are the liquid water and ice contents of the -top snow/soil layer, respectively (kg m\ :math:`{}^{-2}`) (Chapter 7). +top snow/soil layer, respectively (kg m\ :sup:`-2`) (Chapter 7). For the top soil layer, :math:`i=1`, the coefficients are @@ -544,7 +542,7 @@ phase change will take place as where :math:`T_{i}^{n+1}` is the soil layer temperature after solution of the tridiagonal equation set, :math:`w_{ice,\, i}` and :math:`w_{liq,\, i}` are the mass of ice and liquid water (kg -m\ :math:`{}^{-2}`) in each snow/soil layer, respectively, and +m\ :sup:`-2`) in each snow/soil layer, respectively, and :math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). For the freezing process in soil layers, the concept of supercooled soil water from Niu and Yang (2006) is adopted. The supercooled soil water is @@ -558,11 +556,11 @@ depression equation w_{liq,\, \max ,\, i} =\Delta z_{i} \theta _{sat,\, i} \left[\frac{10^{3} L_{f} \left(T_{f} -T_{i} \right)}{gT_{i} \psi _{sat,\, i} } \right]^{{-1\mathord{\left/ {\vphantom {-1 B_{i} }} \right. \kern-\nulldelimiterspace} B_{i} } } \qquad T_{i} 0`), there are no explicit snow layers (:math:`snl=0`), and :math:`\frac{H_{1} \Delta t}{L_{f} } >0` (melting), the snow mass -:math:`W_{sno}` (kg m\ :math:`{}^{-2}`) is reduced according to +:math:`W_{sno}` (kg m\ :sup:`-2`) is reduced according to .. math:: :label: 6.62) @@ -665,9 +663,9 @@ available to the top soil layer as The ice mass, liquid water content, and temperature of the top soil layer are then determined from equations , , and using the recalculated -energy from equation . Snow melt :math:`M_{1S}` (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) and phase change energy :math:`E_{p,\, 1S}` (W -m\ :math:`{}^{-2}`) for this special case are +energy from equation . Snow melt :math:`M_{1S}` (kg m\ :sup:`-2` +s\ :sup:`-1`) and phase change energy :math:`E_{p,\, 1S}` (W +m\ :sup:`-2`) for this special case are .. math:: :label: 6.66) @@ -679,7 +677,7 @@ m\ :math:`{}^{-2}`) for this special case are E_{p,\, 1S} =L_{f} M_{1S} . -The total energy of phase change :math:`E_{p}` (W m\ :math:`{}^{-2}`) +The total energy of phase change :math:`E_{p}` (W m\ :sup:`-2`) for the snow/soil column is .. math:: @@ -694,8 +692,8 @@ where E_{p,\, i} =L_{f} \frac{\left(w_{ice,\, i}^{n} -w_{ice,\, i}^{n+1} \right)}{\Delta t} . -The total snow melt :math:`M` (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) is +The total snow melt :math:`M` (kg m\ :sup:`-2` +s\ :sup:`-1`) is .. math:: :label: 6.70) @@ -769,8 +767,8 @@ organic matter fraction :math:`f_{om,i}` is f_{om,i} =\rho _{om,i} /\rho _{om,\max } . -Soil thermal conductivity :math:`\lambda _{i}` (W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`) is from Farouki (1981) +Soil thermal conductivity :math:`\lambda _{i}` (W m\ :sup:`-1` +K\ :sup:`-1`) is from Farouki (1981) .. math:: :label: 6.78) @@ -781,8 +779,8 @@ where :math:`\lambda _{sat,\, i}` is the saturated thermal conductivity, :math:`\lambda _{dry,\, i}` is the dry thermal conductivity, :math:`K_{e,\, i}` is the Kersten number, :math:`S_{r,\, i}` is the wetness of the soil with respect to -saturation, and :math:`\lambda _{bedrock} =3` W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}` is the thermal conductivity assumed for the deep +saturation, and :math:`\lambda _{bedrock} =3` W m\ :sup:`-1` +K\ :sup:`-1` is the thermal conductivity assumed for the deep ground layers (typical of saturated granitic rock; Clauser and Huenges, 1995). For glaciers and wetlands, @@ -794,7 +792,7 @@ ground layers (typical of saturated granitic rock; Clauser and Huenges, where :math:`\lambda _{liq}` and :math:`\lambda _{ice}` are the thermal conductivities of liquid water and ice, respectively (Table 2.6). The saturated thermal conductivity :math:`\lambda _{sat,\, i}` (W -m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) depends on the thermal +m\ :sup:`-1` K\ :sup:`-1`) depends on the thermal conductivities of the soil solid, liquid water, and ice constituents .. math:: @@ -819,8 +817,8 @@ where the mineral soil solid thermal conductivity \lambda _{s,\, \min ,i} =\frac{8.80{\rm \; }\left(\% sand\right)_{i} +{\rm 2.92\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } , -and :math:`\lambda _{s,om} =0.25`\ W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}` (Farouki, 1981). :math:`\theta _{sat,\, i}` is the +and :math:`\lambda _{s,om} =0.25`\ W m\ :sup:`-1` +K\ :sup:`-1` (Farouki, 1981). :math:`\theta _{sat,\, i}` is the volumetric water content at saturation (porosity) (section 7.4.1). The thermal conductivity of dry soil is @@ -831,18 +829,18 @@ The thermal conductivity of dry soil is \lambda _{dry,i} =(1-f_{om,i} )\lambda _{dry,\min ,i} +f_{om,i} \lambda _{dry,om} where the thermal conductivity of dry mineral soil -:math:`\lambda _{dry,\min ,i}` \ (W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`) depends on the bulk density +:math:`\lambda _{dry,\min ,i}` \ (W m\ :sup:`-1` +K\ :sup:`-1`) depends on the bulk density :math:`\rho _{d,\, i} =2700\left(1-\theta _{sat,\, i} \right)` (kg -m\ :math:`{}^{-3}`) as +m\ :sup:`-3`) as .. math:: :label: 6.84) \lambda _{dry,\, \min ,i} =\frac{0.135\rho _{d,\, i} +64.7}{2700-0.947\rho _{d,\, i} } -and :math:`\lambda _{dry,om} =0.05` W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}` (Farouki, 1981) is the dry thermal conductivity of +and :math:`\lambda _{dry,om} =0.05` W m\ :sup:`-1` +K\ :sup:`-1` (Farouki, 1981) is the dry thermal conductivity of organic matter. The Kersten number :math:`K_{e,\, i}` is a function of the degree of saturation :math:`S_{r}` and phase of water @@ -858,8 +856,8 @@ where S_{r,\, i} =\left(\frac{w_{liq,\, i} }{\rho _{liq} \Delta z_{i} } +\frac{w_{ice,\, i} }{\rho _{ice} \Delta z_{i} } \right)\frac{1}{\theta _{sat,\, i} } =\frac{\theta _{liq,\, i} +\theta _{ice,\, i} }{\theta _{sat,\, i} } \le 1. -Thermal conductivity :math:`\lambda _{i}` (W m\ :math:`{}^{-1}` -K\ :math:`{}^{-1}`) for snow is from Jordan (1991) +Thermal conductivity :math:`\lambda _{i}` (W m\ :sup:`-1` +K\ :sup:`-1`) for snow is from Jordan (1991) .. math:: :label: 6.87) @@ -868,15 +866,15 @@ K\ :math:`{}^{-1}`) for snow is from Jordan (1991) where :math:`\lambda _{air}` is the thermal conductivity of air (Table 2.6) and :math:`\rho _{sno,\, i}` is the bulk density of snow (kg -m\ :math:`{}^{-3}`) +m\ :sup:`-3`) .. math:: :label: 6.88) \rho _{sno,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{\Delta z_{i} } . -The volumetric heat capacity :math:`c_{i}` (J m\ :math:`{}^{-3}` -K\ :math:`{}^{-1}`) for soil is from de Vries (1963) and depends on the +The volumetric heat capacity :math:`c_{i}` (J m\ :sup:`-3` +K\ :sup:`-1`) for soil is from de Vries (1963) and depends on the heat capacities of the soil solid, liquid water, and ice constituents .. math:: @@ -885,9 +883,9 @@ heat capacities of the soil solid, liquid water, and ice constituents c_{i} =c_{s,\, i} \left(1-\theta _{sat,\, i} \right)+\frac{w_{ice,\, i} }{\Delta z_{i} } C_{ice} +\frac{w_{liq,\, i} }{\Delta z_{i} } C_{liq} where :math:`C_{liq}` and :math:`C_{ice}` are the specific heat -capacities (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) of liquid water +capacities (J kg\ :sup:`-1` K\ :sup:`-1`) of liquid water and ice, respectively (Table 2.6). The heat capacity of soil solids -:math:`c_{s,i}` \ (J m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`) is +:math:`c_{s,i}` \ (J m\ :sup:`-3` K\ :sup:`-1`) is .. math:: :label: 6.90) @@ -895,17 +893,17 @@ and ice, respectively (Table 2.6). The heat capacity of soil solids c_{s,i} =(1-f_{om,i} )c_{s,\min ,i} +f_{om,i} c_{s,om} where the heat capacity of mineral soil solids -:math:`c_{s,\min ,\, i}` (J m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`) is +:math:`c_{s,\min ,\, i}` (J m\ :sup:`-3` K\ :sup:`-1`) is .. math:: :label: 6.91) \begin{array}{l} {c_{s,\min ,\, i} =\left(\frac{2.128{\rm \; }\left(\% sand\right)_{i} +{\rm 2.385\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } \right)\times 10^{6} \qquad i=1,\ldots ,N_{levsoi} } \\ {c_{s,\, \min ,i} =c_{s,\, bedrock} \qquad i=N_{levsoi} +1,\ldots ,N_{levgrnd} } \end{array} -where :math:`c_{s,bedrock} =2\times 10^{6}` J m\ :math:`{}^{-3}` -K\ :math:`{}^{-1}` is the heat capacity of bedrock and -:math:`c_{s,om} =2.5\times 10^{6}` \ J m\ :math:`{}^{-3}` -K\ :math:`{}^{-1}` (Farouki, 1981) is the heat capacity of organic +where :math:`c_{s,bedrock} =2\times 10^{6}` J m\ :sup:`-3` +K\ :sup:`-1` is the heat capacity of bedrock and +:math:`c_{s,om} =2.5\times 10^{6}` \ J m\ :sup:`-3` +K\ :sup:`-1` (Farouki, 1981) is the heat capacity of organic matter. For glaciers, wetlands, and snow .. math:: diff --git a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst index 47359c6b77..20ed6594d2 100644 --- a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst +++ b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst @@ -9,7 +9,7 @@ changes in canopy water :math:`\Delta W_{can}` , surface water :math:`\Delta W_{sfc}` , snow water :math:`\Delta W_{sno}` , soil water :math:`\Delta w_{liq,\, i}` , and soil ice :math:`\Delta w_{ice,\, i}` , and water in the unconfined aquifer :math:`\Delta W_{a}` (all in kg -m\ :math:`{}^{-2}` or mm of H\ :math:`{}_{2}`\ O) (Figure 7.1). +m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (Figure 7.1). The total water balance of the system is @@ -26,8 +26,8 @@ ET from vegetation (Chapter 5), :math:`E_{g}` is ground evaporation :math:`q_{drai}` is sub-surface drainage (section 7.6), :math:`q_{rgwl}` and :math:`q_{snwcp,ice}` are liquid and solid runoff from glaciers, wetlands, and lakes, and runoff from other surface types -due to snow capping (section 7.7) (all in kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), :math:`N_{levsoi}` is the number of soil layers +due to snow capping (section 7.7) (all in kg m\ :sup:`-2` +s\ :sup:`-1`), :math:`N_{levsoi}` is the number of soil layers (note that hydrology calculations are only done over soil layers 1 to :math:`N_{levsoi}` ; ground levels :math:`N_{levsoi} +1`\ to :math:`N_{levgrnd}` are currently hydrologically inactive; Lawrence et @@ -43,7 +43,7 @@ Canopy Water Precipitation is either intercepted by the canopy, falls directly to the snow/soil surface (throughfall), or drips off the vegetation (canopy drip). Interception by vegetation :math:`q_{intr}` (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) does not distinguish between +m\ :sup:`-2` s\ :sup:`-1`) does not distinguish between liquid and solid phases .. math:: @@ -54,7 +54,7 @@ liquid and solid phases where :math:`L` and :math:`S` are the exposed leaf and stem area index, respectively (section 2.1.4), and :math:`\alpha =0.25` scales interception from point to grid cell (Lawrence et al. 2007). Throughfall -(kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), however, is divided into +(kg m\ :sup:`-2` s\ :sup:`-1`), however, is divided into liquid and solid phases reaching the ground (soil or snow surface) as .. math:: @@ -88,7 +88,7 @@ where is the canopy water after accounting for interception, :math:`W_{can}^{n}` is the canopy water from the previous time step, -and :math:`W_{can,\, \max }` (kg m\ :math:`{}^{-2}`) is the maximum +and :math:`W_{can,\, \max }` (kg m\ :sup:`-2`) is the maximum amount of water the canopy can hold .. math:: @@ -97,7 +97,7 @@ amount of water the canopy can hold W_{can,\, \max } =p\left(L+S\right). The maximum storage of solid water is assumed to be the same as that of -liquid water, :math:`p=0.1` kg m\ :math:`{}^{-2}` (Dickinson et al. +liquid water, :math:`p=0.1` kg m\ :sup:`-2` (Dickinson et al. 1993). The canopy water is updated as .. math:: @@ -164,14 +164,14 @@ Shown are three snow layers, :math:`i=-2`, :math:`i=-1`, and .. image:: image2.png The state variables for snow are the mass of water :math:`w_{liq,i}` -(kg m\ :math:`{}^{-2}`), mass of ice :math:`w_{ice,i}` (kg -m\ :math:`{}^{-2}`), layer thickness :math:`\Delta z_{i}` (m), and +(kg m\ :sup:`-2`), mass of ice :math:`w_{ice,i}` (kg +m\ :sup:`-2`), layer thickness :math:`\Delta z_{i}` (m), and temperature :math:`T_{i}` (Chapter 6). The water vapor phase is neglected. Snow can also exist in the model without being represented by explicit snow layers. This occurs when the snowpack is less than a specified minimum snow depth (:math:`z_{sno} <0.01` m). In this case, the state variable is the mass of snow :math:`W_{sno}` (kg -m\ :math:`{}^{-2}`). +m\ :sup:`-2`). Section 7.2.1 describes the calculation of fractional snow covered area, which is used in the surface albedo calculation (Chapter 3) and the @@ -236,7 +236,7 @@ The conservation equation for mass of ice in snow layers is where :math:`q_{ice,\, i-1}` is the rate of ice accumulation from precipitation or frost or the rate of ice loss from sublimation (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) in the top layer and +m\ :sup:`-2` s\ :sup:`-1`) in the top layer and :math:`{\left(\Delta w_{ice,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{ice,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` is the change in ice due to phase change (melting rate) (section 6.2). The term :math:`q_{ice,\, i-1}` is computed in two steps as @@ -267,7 +267,7 @@ where \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg -m\ :math:`{}^{-3}`) (CityplaceAnderson 1976) +m\ :sup:`-3`) (CityplaceAnderson 1976) .. math:: :label: 7.21) @@ -315,8 +315,8 @@ content is reset to zero and the liquid water content :math:`w_{ice,\, snl+1}^{n+1}` up to zero. The snow water equivalent :math:`W_{sno}` is capped to not exceed 1000 -kg m\ :math:`{}^{-2}`. If the addition of :math:`q_{frost}` were to -result in :math:`W_{sno} >1000` kg m\ :math:`{}^{-2}`, the frost term +kg m\ :sup:`-2`. If the addition of :math:`q_{frost}` were to +result in :math:`W_{sno} >1000` kg m\ :sup:`-2`, the frost term :math:`q_{frost}` is instead added to the ice runoff term :math:`q_{snwcp,\, ice}` (section 7.7). @@ -411,7 +411,7 @@ Black and organic carbon and mineral dust within snow ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Particles within snow originate from atmospheric aerosol deposition -(:math:`D_{sp}` in Table 2.3 (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) +(:math:`D_{sp}` in Table 2.3 (kg m\ :sup:`-2` s\ :sup:`-1`) and influence snow radiative transfer (sections 3.2.1, 3.2.2, and 3.3.3). Particle masses and mixing ratios are represented with a simple mass-conserving scheme. The model maintains masses of the following @@ -453,7 +453,7 @@ radiative calculations are done. Particle masses are then redistributed each time step based on meltwater drainage through the snow column (section 7.2.3) and snow layer combination and subdivision (section 7.2.7). The change in mass of each of the particle species -:math:`\Delta m_{sp,\, i}` (kg m\ :math:`{}^{-2}`) is +:math:`\Delta m_{sp,\, i}` (kg m\ :sup:`-2`) is .. math:: :label: 7.38) @@ -464,10 +464,10 @@ where :math:`k_{sp}` is the meltwater scavenging efficiency that is unique for each species (Table 7.1), :math:`q_{liq,\, i-1}` is the flow of liquid water into layer :math:`i` from the layer above, :math:`q_{liq,\, i}` is the flow of water out of layer :math:`i` into -the layer below (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) (section +the layer below (kg m\ :sup:`-2` s\ :sup:`-1`) (section 7.2.3), :math:`c_{sp,\, i-1}` and :math:`c_{sp,\, i}` are the particle mass mixing ratios in layers :math:`i-1` and :math:`i` (kg -kg\ :math:`{}^{-1}`), :math:`D_{sp}` is the atmospheric deposition rate +kg\ :sup:`-1`), :math:`D_{sp}` is the atmospheric deposition rate (zero for all layers except layer :math:`snl+1`), and :math:`\Delta t` is the model time step (s). The particle mass mixing ratio is @@ -530,7 +530,7 @@ destructive metamorphism of new snow (crystal breakdown due to wind or thermodynamic stress); snow load or overburden (pressure); and melting (changes in snow structure due to melt-freeze cycles plus changes in crystals due to liquid water). The total fractional compaction rate for -each snow layer :math:`C_{R,\, i}` (:math:`\text{s}^{-1}`) is the sum of the +each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the three compaction processes .. math:: @@ -548,16 +548,14 @@ Compaction is not allowed if the layer is saturated or if the ice content is below a minimum value (:math:`w_{ice,\, i} \le 0.1`). -Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` -(:math:`{\text s^{-1}}`) is temperature dependent (CityplaceAnderson 1976) +Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (CityplaceAnderson 1976) .. math:: :label: 7.43) C_{R1,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{metamorphism} =-c_{3} c_{1} c_{2} \exp \left[-c_{4} \left(T_{f} -T_{i} \right)\right] -where :math:`c_{3} =2.777\times 10^{-6}` (:math:`\text{s}^{-1}`) is the -fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` :math:`\text{K}^{-1}`, and +where :math:`c_{3} =2.777\times 10^{-6}` (s\ :sup:`-1`) is the fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` K\ :sup:`-1`, and .. math:: :label: 7.44) @@ -571,28 +569,25 @@ where :math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` and :math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` -are the bulk densities of liquid water and ice (kg m\ :math:`{}^{-3}`). +are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). -The compaction rate as a result of overburden :math:`C_{R2,\; i}` -(:math:`\text{s}^{-1}`) is a linear function of the snow load pressure -:math:`P_{s,\, i}` (:math:`\text{k} \text{g} \text{m}^{-2}`) (CityplaceAnderson 1976) +The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (CityplaceAnderson 1976) .. math:: :label: 7.45) C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } -where :math:`\eta` is a viscosity coefficient (:math:`\text{kg} \text{s} \text{m}^{-2}`) -that varies with density and temperature as +where :math:`\eta` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and temperature as .. math:: :label: 7.46) \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] -where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :math:`{}^{-2}`, and -:math:`c_{5} =0.08` K\ :math:`{}^{-1}`, :math:`c_{6} =0.023` -m\ :math:`{}^{3}` kg\ :math:`{}^{-1}` are constants. The snow load +where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :sup:`-2`, and +:math:`c_{5} =0.08` K\ :sup:`-1`, :math:`c_{6} =0.023` +m\ :sup:`3` kg\ :sup:`-1` are constants. The snow load pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of the ice :math:`w_{ice,\, i}` and liquid water contents :math:`w_{liq,\, i}` of the layers above plus half the ice and liquid @@ -603,8 +598,7 @@ water contents of the layer being compacted P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . -The compaction rate due to melting :math:`C_{R3,\; i}` -(:math:`\text{s}^{-1}`) is taken to be the ratio of the change in snow ice +The compaction rate due to melting :math:`C_{R3,\; i}` (s\ :sup:`-1`) is taken to be the ratio of the change in snow ice mass after the melting to the mass before melting .. math:: @@ -741,8 +735,8 @@ where :math:`h_{c} =h_{1} +h_{2}` is the combined enthalpy h_{i} =\left(C_{ice} w_{ice,\, i} +C_{liq} w_{liq,\, i} \right)\left(T_{i} -T_{f} \right)+L_{f} w_{liq,\, i} . In these equations, :math:`L_{f}` is the latent heat of fusion (J -kg\ :math:`{}^{-1}`) and :math:`C_{liq}` and :math:`C_{ice}` are the -specific heat capacities (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) of +kg\ :sup:`-1`) and :math:`C_{liq}` and :math:`C_{ice}` are the +specific heat capacities (J kg\ :sup:`-1` K\ :sup:`-1`) of liquid water and ice, respectively (Table 2.6). After layer combination, the node depths and layer interfaces (Figure 7.2) are recalculated from @@ -825,7 +819,7 @@ Surface Runoff, Surface Water Storage, and Infiltration The moisture input at the grid cell surface ,\ :math:`q_{liq,\, 0}` , is the sum of liquid precipitation reaching the ground and melt water from -snow (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). The moisture flux is +snow (kg m\ :sup:`-2` s\ :sup:`-1`). The moisture flux is then partitioned between surface runoff, surface water storage, and infiltration into the soil. @@ -854,7 +848,7 @@ The fractional saturated area is a function of soil moisture where :math:`f_{\max }` is the potential or maximum value of :math:`f_{sat}` , :math:`f_{over}` is a decay factor -(:math:`\text{m}^{-1}`), and :math:`z_{\nabla}` is the water table depth +(m\ :sup:`-1`), and :math:`z_{\nabla}` is the water table depth (m) (section 7.6). The maximum saturated fraction, :math:`f_{\max }` , is defined as the value of the discrete cumulative distribution function (CDF) of the topographic index when the grid cell mean water table depth @@ -864,19 +858,19 @@ mean topographic index. It should be calculated explicitly from the CDF at each grid cell at the resolution that the model is run. However, because this is a computationally intensive task for global applications, :math:`f_{\max }` is calculated once at -0.125\ :math:`{}^\circ` resolution using the 1-km compound topographic +0.125\ :sup:`o` resolution using the 1-km compound topographic indices (CTIs) based on the HYDRO1K dataset (Verdin and Greenlee 1996) from USGS following the algorithm in Niu et al. (2005) and then area-averaged to the desired model resolution (section 2.2.3). Pixels with CTIs exceeding the 95 percentile threshold in each -0.125\ :math:`{}^\circ` grid cell are excluded from the calculation to +0.125\ :sup:`o` grid cell are excluded from the calculation to eliminate biased estimation of statistics due to large CTI values at pixels on stream networks. For grid cells over regions without CTIs such as Australia, the global mean :math:`f_{\max }` is used to fill the gaps. See Li et al. (2013b) for additional details. The decay factor :math:`f_{over}` for global simulations was determined through sensitivity analysis and comparison with observed runoff to be 0.5 -m\ :math:`{}^{-1}`. +m\ :sup:`-1`. Surface Water Storage ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -884,7 +878,7 @@ Surface Water Storage A surface water store has been added to the model to represent wetlands and small, sub-grid scale water bodies. As a result, the wetland land unit has been removed. The state variables for surface water are the -mass of water :math:`W_{sfc}` (kg m\ :math:`{}^{-2}`) and temperature +mass of water :math:`W_{sfc}` (kg m\ :sup:`-2`) and temperature :math:`T_{h2osfc}` (Chapter 6). Surface water storage and outflow are functions of fine spatial scale elevation variations called microtopography. The microtopography is assumed to be distributed @@ -967,8 +961,8 @@ removed, is divided into inputs to surface water (:math:`q_{in,\, h2osfc}` ) and the soil :math:`q_{in,soil}` . If :math:`q_{in,soil}` exceeds the -maximum soil infiltration capacity (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), +maximum soil infiltration capacity (kg m\ :sup:`-2` +s\ :sup:`-1`), .. math:: :label: ZEqnNum569150 @@ -1042,12 +1036,12 @@ mass is stated as \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q where :math:`\theta` is the volumetric soil water content -(mm:math:`{}^{3}` of water mm\ :math:`{}^{-3}` of soil), :math:`t` is +(mm:sup:`3` of water mm\ :sup:`-3` of soil), :math:`t` is time (s), :math:`z` is height above some datum in the soil column (mm) -(positive upwards), :math:`q` is soil water flux (kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}` or mm s\ :math:`{}^{-1}`) (positive upwards), and -:math:`Q` is a soil moisture sink term (mm of water mm\ :math:`{}^{-1}` -of soil s\ :math:`{}^{-1}`) (ET loss). This equation is solved +(positive upwards), :math:`q` is soil water flux (kg m\ :sup:`-2` +s\ :sup:`-1` or mm s\ :sup:`-1`) (positive upwards), and +:math:`Q` is a soil moisture sink term (mm of water mm\ :sup:`-1` +of soil s\ :sup:`-1`) (ET loss). This equation is solved numerically by dividing the soil column into multiple layers in the vertical and integrating downward over each layer with an upper boundary condition of the infiltration flux into the top soil layer @@ -1062,7 +1056,7 @@ law q=-k\frac{\partial \psi _{h} }{\partial z} -where :math:`k` is the hydraulic conductivity (mm s\ :math:`{}^{-1}`), +where :math:`k` is the hydraulic conductivity (mm s\ :sup:`-1`), and :math:`\psi _{h}` is the hydraulic potential (mm). The hydraulic potential is @@ -1139,7 +1133,7 @@ where the soil moisture sink term :math:`Q` is now included. Hydraulic Properties ^^^^^^^^^^^^^^^^^^^^^^^^^^ -The hydraulic conductivity :math:`k_{i}` (mm s\ :math:`{}^{-1}`) and +The hydraulic conductivity :math:`k_{i}` (mm s\ :sup:`-1`) and the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` vary with volumetric soil water :math:`\theta _{i}` and soil texture. As with the soil thermal properties (section 6.3) the hydraulic @@ -1228,7 +1222,7 @@ matric potential :math:`\psi _{sat,\min ,i}` \ is \psi _{sat,\, \min ,\, i} =-10.0\times 10^{1.88-0.0131(\% sand)_{i} } . The saturated hydraulic conductivity, -:math:`k_{sat} \left[z_{h,\, i} \right]` (mm s\ :math:`{}^{-1}`), for +:math:`k_{sat} \left[z_{h,\, i} \right]` (mm s\ :sup:`-1`), for organic soils (:math:`k_{sat,\, om}` ) may be two to three orders of magnitude larger than that of mineral soils (:math:`k_{sat,\, \min }` ). Bulk soil layer values of :math:`k_{sat}` \ calculated as weighted @@ -1303,7 +1297,7 @@ where :math:`q_{i}` is the flux of water across interface :math:`z_{h,\, i}` , :math:`q_{i-1}` is the flux of water across interface :math:`z_{h,\, i-1}` , and :math:`e_{i}` is a layer-averaged soil moisture sink term (ET loss) defined as positive for flow out of -the layer (mm s\ :math:`{}^{-1}`). Taking the finite difference with +the layer (mm s\ :sup:`-1`). Taking the finite difference with time and evaluating the fluxes implicitly at time :math:`n+1` yields .. math:: @@ -1339,7 +1333,7 @@ the interface of two layers :math:`z_{h}` . The layer thickness is term :math:`e` (ET loss) is defined as positive for flow out of the layer. -.. image:: image3 +.. image:: image3.png Note that because more than one plant functional type (PFT) may share a soil column, the transpiration :math:`E_{v}^{t}` is a weighted sum of @@ -1495,7 +1489,7 @@ derived from equation \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. -7.4.2.1 Equilibrium soil matric potential and volumetric moisture +Equilibrium soil matric potential and volumetric moisture ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The equilibrium soil matric potential :math:`\psi _{E}` can be derived @@ -1579,7 +1573,7 @@ The equilibrium soil matric potential is then \psi _{E,\, i} =\psi _{sat,\, i} \left(\frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad \frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \ge 0.01 -7.4.2.2 Equation set for layer :math:`i=1` +Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' For the top soil layer (:math:`i=1`), the boundary condition is the @@ -1615,7 +1609,7 @@ equations for :math:`i=1` are r_{i} =q_{infl}^{n+1} -q_{i}^{n} +e_{i} . -7.4.2.3 Equation set for layers :math:`i=2,\ldots ,N_{levsoi} -1` +Equation set for layers :math:`i=2,\ldots ,N_{levsoi} -1` ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' The coefficients of the tridiagonal set of equations for @@ -1641,7 +1635,7 @@ The coefficients of the tridiagonal set of equations for r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . -7.4.2.4 Equation set for layers :math:`i=N_{levsoi} ,\ldots N_{levsoi} +1` +Equation set for layers :math:`i=N_{levsoi} ,\ldots N_{levsoi} +1` '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' For the lowest soil layer (:math:`i=N_{levsoi}` ), the bottom boundary @@ -1825,7 +1819,7 @@ Groundwater-Soil Water Interactions Drainage or sub-surface runoff is based on the SIMTOP scheme (Niu et al. 2005) with a modification to account for reduced drainage in frozen soils. In the work of Niu et al. (2005), the drainage :math:`q_{drai}` -(kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) was formulated as +(kg m\ :sup:`-2` s\ :sup:`-1`) was formulated as .. math:: :label: ZEqnNum924767 @@ -1863,13 +1857,13 @@ where :math:`\Omega =6`\ is an adjustable parameter, :math:`jwt` is the index of the layer directly above the water table, :math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the ice-filled fraction of the pore space of soil layer :math:`i` (kg -m\ :math:`{}^{-2}`), and :math:`\Delta z_{i}` is the layer thickness +m\ :sup:`-2`), and :math:`\Delta z_{i}` is the layer thickness (mm). This expression is functionally the same as that used to determine the ice impedance factor in section 7.4. In equation , the decay factor -:math:`f_{drai} =2.5` m\ :math:`{}^{-1}` and the maximum drainage when +:math:`f_{drai} =2.5` m\ :sup:`-1` and the maximum drainage when the water table depth is at the surface -:math:`q_{drai,\, \max } =10\sin (\beta )` kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}` , where :math:`\beta` is the mean grid cell +:math:`q_{drai,\, \max } =10\sin (\beta )` kg m\ :sup:`-2` +s\ :sup:`-1` , where :math:`\beta` is the mean grid cell topographic slope in radians, were determined for global simulations through sensitivity analysis and comparison with observed runoff. @@ -1955,7 +1949,7 @@ soil layer (:math:`w_{liq,\, i}^{excess} =w_{liq,\, i} -\left(\theta _{sat,\, i} -\theta _{ice,\, i} \right)\Delta z_{i} \ge 0`) is successively added to the layer above. Any excess liquid water that remains after saturating the entire soil column (plus a maximum surface -ponding depth :math:`w_{liq}^{pond} =10` kg m\ :math:`{}^{-2}`), is +ponding depth :math:`w_{liq}^{pond} =10` kg m\ :sup:`-2`), is added to drainage :math:`q_{drai}` . Second, to prevent negative :math:`w_{liq,\, i}` , each layer is successively brought up to :math:`w_{liq,\, i} =w_{liq}^{\min }` by taking the required amount of @@ -1993,7 +1987,7 @@ Runoff from glaciers and snow-capped surfaces ------------------------------------------------- All surfaces are constrained to have a snow water equivalent -:math:`W_{sno} \le 1000` kg m\ :math:`{}^{-2}`. For snow-capped +:math:`W_{sno} \le 1000` kg m\ :sup:`-2`. For snow-capped surfaces, the solid and liquid precipitation reaching the snow surface and dew in solid or liquid form, is separated into solid :math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms @@ -2065,7 +2059,7 @@ CLM soil column with thicknesses of :math:`\sum^3_{i=1}{\Delta z_i}`, step, the soil moisture profile is determined following the algorithms detailed in section 7.4, and aggregated to the three VIC layers for runoff generation calculations. The surface runoff generated by the -saturation excess runoff mechanism, *q\ :math:`{}_{over}`*, is +saturation excess runoff mechanism, q\ :sub:`over`, is calculated using equation , but with the fractional saturated area defined as @@ -2077,8 +2071,8 @@ defined as where :math:`w_{top}` and :math:`w_{m,top}` are calculated as :math:`\sum^6_{i=1}{{\theta }_i\Delta z_i}` and :math:`\sum^6_{i=1}{{\theta }_{s,i}\Delta z_i}`, respectively, and -represent the soil moisture (kg m\ :math:`{}^{-2}`) and maximum soil -moisture (kg m\ :math:`{}^{-2}`) in the top two VIC layers combined. +represent the soil moisture (kg m\ :sup:`-2`) and maximum soil +moisture (kg m\ :sup:`-2`) in the top two VIC layers combined. In equation , it is hypothesized that the spatial heterogeneity of soil moisture holding capacity in the top VIC layers can be represented by a @@ -2095,13 +2089,13 @@ conceptually as i=i_m\left(1-{\left(1-A\right)}^{1/b_{inf}}\right) where :math:`i` and :math:`i_{m}` are the point and maximum point soil -moisture holding capacities (kg m\ :math:`{}^{-2}`), respectively; +moisture holding capacities (kg m\ :sup:`-2`), respectively; :math:`A` is the fraction of a grid cell for which the soil moisture holding capacity is less than or equal to :math:`i`; and :math:`i_m=w_{m,top}\left(1+b_{inf}\right)`. When :math:`A` is equal to :math:`f_{sat}`, the corresponding point soil moisture holding capacity is denoted as :math:`i_0`. The maximum soil infiltration capacity (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) in equation becomes +m\ :sup:`-2` s\ :sup:`-1`) in equation becomes .. math:: :label: ZEqnNum202398 @@ -2124,9 +2118,9 @@ The subsurface runoff in equation is parameterized as \right]/\mathrm{\Delta }t where :math:`w_{bot}` and :math:`w_{m,bot}` are the soil moisture (kg -m\ :math:`{}^{-2}`) and maximum soil moisture (kg m\ :math:`{}^{-2}`) in +m\ :sup:`-2`) and maximum soil moisture (kg m\ :sup:`-2`) in the bottom VIC layer, respectively, :math:`D_{smax}` is the maximum -subsurface flow rate (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), +subsurface flow rate (kg m\ :sup:`-2` s\ :sup:`-1`), :math:`D_s` is a fraction of :math:`D_{smax}`, :math:`W_s` is a fraction of :math:`w_{m,bot}`, and :math:`{\mathrm{\Theta }}_{ice,bot}` is an ice impedance factor determined from the ice content of the bottom VIC @@ -2143,9 +2137,9 @@ other four parameters, :math:`b_{inf}` , :math:`D_{smax}` , :math:`D_s` dataset. Users can provide calibrated parameter values determined manually or automatically by modifying the surface dataset. Note that the units of :math:`D_{smax}` on the surface dataset are mm -d\ :math:`{}^{-1}` (the traditional units for other standard VIC -applications) which are then converted to kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}` for use in CLM. A preliminary calibration was +d\ :sup:`-1` (the traditional units for other standard VIC +applications) which are then converted to kg m\ :sup:`-2` +s\ :sup:`-1` for use in CLM. A preliminary calibration was performed by perturbing the three parameters :math:`b_{inf}` , :math:`D_{smax}` , and :math:`W_s`, and fixing :math:`D_s=0.1` globally. The parameter space for :math:`b_{inf}` , :math:`D_{smax}` , and @@ -2154,7 +2148,7 @@ described by Hou et al. (2012) to produce 64 combinations of parameter values based on *a priori* information about the parameters. For each set of parameter values, a global simulation was performed using the compset I\_2000 (i.e., driven by satellite phenology) at a resolution of -0.9\ :math:`{}^\circ`\ x1.25\ :math:`{}^\circ` on the basis of the +0.9\ :sup:`o`\ x1.25\ :sup:`o` on the basis of the development tag betr\_m\_sci10\_clm45sci13\_clm4\_0\_54. At each model grid cell, the set of :math:`b_{inf}` , :math:`D_{smax}` , and :math:`W_s` values corresponding to the simulation that produced the diff --git a/doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst b/doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst index f8ac82d263..6cd61d641c 100644 --- a/doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst +++ b/doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst @@ -6,11 +6,10 @@ Leaf stomatal resistance, which is needed for the water vapor flux (1991, 1992). These equations are solved separately for sunlit and shaded leaves using average absorbed photosynthetically active radiation for sunlit and shaded leaves -[:math:`\phi ^{sun}` ,\ :math:`\phi ^{sha}` :math:`\text{W} \text{m}^{-2}` +[:math:`\phi ^{sun}` ,\ :math:`\phi ^{sha}` W m\ :sup:`-2` (section 4.1)] to give sunlit and shaded stomatal resistance -(:math:`r_{s}^{sun}` ,\ :math:`r_{s}^{sha}` :math:`\text{sm}^{-1}`) and -photosynthesis (:math:`A^{sun}` ,\ :math:`A^{sha}` µmol -:math:`\text{CO}_{2}` m\ :math:`{}^{-2}` :math:`\text{s}^{-1}`). Canopy +(:math:`r_{s}^{sun}` ,\ :math:`r_{s}^{sha}` s m\ :sup:`-1`) and +photosynthesis (:math:`A^{sun}` ,\ :math:`A^{sha}` µmol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`). Canopy photosynthesis is :math:`A^{sun} L^{sun} +A^{sha} L^{sha}` , where :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded leaf area indices (section 4.1). Canopy conductance is @@ -26,7 +25,7 @@ model as described by Collatz et al. (1991) and implemented in global climate models (Sellers et al. 1996). The model relates stomatal conductance (i.e., the inverse of resistance) to net leaf photosynthesis, scaled by the relative humidity at the leaf surface and -the :math:`\text{CO}_{2}` concentration at the leaf surface. Leaf stomatal +the CO\ :sub:`1` concentration at the leaf surface. Leaf stomatal resistance is .. math:: @@ -34,22 +33,22 @@ resistance is \frac{1}{r_{s} } =g_{s} =m\frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } h_{s} +b\, \beta _{t} -where :math:`r_{s}` is leaf stomatal resistance (s m\ :math:`{}^{2}` -:math:`\mu`\ mol\ :math:`{}^{-1}`), :math:`m` is a plant functional +where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` +:math:`\mu`\ mol\ :sup:`-1`), :math:`m` is a plant functional type dependent parameter (Table 8.1), :math:`A_{n}` is leaf net -photosynthesis (:math:`\mu`\ mol CO\ :math:`{}_{2}` m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), :math:`c_{s}` is the CO\ :math:`{}_{2}` partial +photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` +s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), :math:`h_{s} =e_{s} /e_{i}` is the leaf surface humidity with :math:`e_{s}` the vapor pressure at the leaf surface (Pa) and :math:`e_{i}` the saturation vapor pressure (Pa) inside the leaf at the vegetation temperature\ :math:`T_{v}`, and :math:`b` is the minimum -stomatal conductance (:math:`\mu` mol m :math:`{}^{-2}` -s\ :math:`{}^{-1}`). Parameter values are :math:`m=9` for -C\ :math:`{}_{3}` plants and :math:`m=4` for C\ :math:`{}_{4}` plants +stomatal conductance (:math:`\mu` mol m :sup:`-2` +s\ :sup:`-1`). Parameter values are :math:`m=9` for +C\ :sub:`3` plants and :math:`m=4` for C\ :sub:`4` plants (Collatz et al. 1991, 1992, Sellers et al. 1996). Sellers et al. (1996) -used :math:`b=10000` for C :math:`{}_{3}` plants and -:math:`b=40000` for C :math:`{}_{4}` plants, also used here. +used :math:`b=10000` for C\ :sub:`3` plants and +:math:`b=40000` for C\ :sub:`4` plants, also used here. Photosynthesis is calculated for sunlit (:math:`A^{sun}`) and shaded (:math:`A^{sha}`) leaves to give :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}`. Additionally, soil water influences stomatal @@ -58,12 +57,10 @@ water stress function :math:`\beta _{t}` (which ranges from 0 to 1) and also indirectly through :math:`A_{n}`, as in (Sellers et al. 1996). Resistance is converted from units of -:math:`\textrm{s\,m}^{2}\, \mu \, \textrm{mol}^{-1}` to -:math:`\textrm{s\,m}^{-1}` as: -:math:`\text{1\,s\,m}^{-1}` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` -:math:`\mu\,\text{mol}^{-1}` m\ :math:`{}^{2}` s, where -:math:`R_{gas}` is the universal gas constant (J K\ :math:`{}^{-1}` -kmol\ :math:`{}^{-1}`) (Table 2.6) and :math:`\theta _{atm}` is the +s m\ :sup:`2` :math:`\mu` mol\ :sub:`-1` to s m\ :sup:`-1` as: +1 s m\ sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` +:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` +kmol\ :sup:`-1`) (Table 2.6) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). Table 8.1. Plant functional type (PFT) photosynthetic parameters. @@ -93,11 +90,11 @@ Table 8.1. Plant functional type (PFT) photosynthetic parameters. +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ | BDS boreal | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :math:`{}_{3}` arctic grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | +| C\ :sub:`3` arctic grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :math:`{}_{3}` grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | +| C\ :sub:`3` grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :math:`{}_{4}` grass | 4 | 0.05 | 25 | 0.0900 | 0.030 | -74000 | -275000 | 51.6 | +| C\ :sub:`4` grass | 4 | 0.05 | 25 | 0.0900 | 0.030 | -74000 | -275000 | 51.6 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ | Crop R | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ @@ -120,18 +117,16 @@ Table 8.1. Plant functional type (PFT) photosynthetic parameters. | Soybean I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -:math:`\alpha` (mol CO\ :math:`{}_{2}` mol\ :math:`{}^{-1}` photon); -:math:`CN_{L}` (g C g\ :math:`{}^{-1}` N); :math:`F_{LNR}` (g N -Rubisco g\ :math:`{}^{-1}` N); :math:`SLA_{0}` (m:math:`{}^{2}` -:math:`\text{g}^{-1}` C); :math:`\psi _{o}` and :math:`\psi _{c}` (mm); -:math:`\text{V}_{cmax25}` (:math:`\mu`\ mol m\ :math:`{}^{-2}` -:math:`\text{s}^{-1}`, calculated from equation for canopy top). +:math:`\alpha` (mol CO\ :sub:`2` mol\ :sup:`-1` photon); +:math:`CN_{L}` (g C g\ :sup:`-1` N); :math:`F_{LNR}` (g N Rubisco g\ :sup:`-1` N); :math:`SLA_{0}` (m\ :sup:`2` g\ :sup:`-1` C); +:math:`\psi _{o}` and :math:`\psi _{c}` (mm); +V\ :sub:`cmax25` (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`, calculated from equation for canopy top). Photosynthesis ------------------ -Photosynthesis in C\ :math:`{}_{3}` plants is based on the model of -Farquhar et al. (1980). Photosynthesis in C\ :math:`{}_{4}` plants is +Photosynthesis in C\ :sub:`3` plants is based on the model of +Farquhar et al. (1980). Photosynthesis in C\ :sub:`4` plants is based on the model of Collatz et al. (1992). Bonan et al. (2011) describe the implementation, modified here. In its simplest form, leaf net photosynthesis after accounting for respiration (:math:`R_{d}` ) is @@ -142,8 +137,8 @@ net photosynthesis after accounting for respiration (:math:`R_{d}` ) is A_{n} =\min \left(A_{c} ,A_{j} ,A_{p} \right)-R_{d} . The RuBP carboxylase (Rubisco) limited rate of carboxylation -:math:`A_{c}` (:math:`\mu` \ mol CO\ :math:`{}_{2}` m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) is +:math:`A_{c}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` +s\ :sup:`-1`) is .. math:: :label: ZEqnNum141081 @@ -153,17 +148,17 @@ s\ :math:`{}^{-1}`) is The maximum rate of carboxylation allowed by the capacity to regenerate RuBP (i.e., the light-limited rate) :math:`A_{j}` (:math:`\mu` \ mol -CO\ :math:`{}_{2}` m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is +CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 8.4) A_{j} =\left\{\begin{array}{l} {\frac{J\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. -The product-limited rate of carboxylation for C\ :math:`{}_{3}` plants +The product-limited rate of carboxylation for C\ :sub:`3` plants and the PEP carboxylase-limited rate of carboxylation for -C\ :math:`{}_{4}` plants :math:`A_{p}` (:math:`\mu` \ mol -CO\ :math:`{}_{2}` m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is +C\ :sub:`4` plants :math:`A_{p}` (:math:`\mu` \ mol +CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: ZEqnNum104028 @@ -171,27 +166,27 @@ CO\ :math:`{}_{2}` m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is A_{p} =\left\{\begin{array}{l} {3T_{p\qquad } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {k_{p} \frac{c_{i} }{P_{atm} } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}. In these equations, :math:`c_{i}` is the internal leaf -CO\ :math:`{}_{2}` partial pressure (Pa) and :math:`o_{i} =0.20P_{atm}` -is the O\ :math:`{}_{2}` partial pressure (Pa). :math:`K_{c}` and +CO\ :sub:`2` partial pressure (Pa) and :math:`o_{i} =0.20P_{atm}` +is the O\ :sub:`2` partial pressure (Pa). :math:`K_{c}` and :math:`K_{o}` are the Michaelis-Menten constants (Pa) for -CO\ :math:`{}_{2}` and O\ :math:`{}_{2}`. :math:`\Gamma _{\*}` (Pa) is -the CO\ :math:`{}_{2}` compensation point. :math:`V_{c\max }` is the -maximum rate of carboxylation (µmol m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`) and :math:`J` is the electron transport rate (µmol -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`). :math:`T_{p}` is the triose -phosphate utilization rate (µmol m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), +CO\ :sub:`2` and O\ :sub:`2`. :math:`\Gamma _{\*}` (Pa) is +the CO\ :sub:`2` compensation point. :math:`V_{c\max }` is the +maximum rate of carboxylation (µmol m\ :sup:`-2` +s\ :sup:`-1`) and :math:`J` is the electron transport rate (µmol +m\ :sup:`-2` s\ :sup:`-1`). :math:`T_{p}` is the triose +phosphate utilization rate (µmol m\ :sup:`-2` s\ :sup:`-1`), taken as :math:`T_{p} =0.167V_{c\max }` so that -:math:`A_{p} =0.5V_{c\max }` for C\ :math:`{}_{3}` plants (as in -Collatz et al. 1991). For C\ :math:`{}_{4}` plants, the light-limited +:math:`A_{p} =0.5V_{c\max }` for C\ :sub:`3` plants (as in +Collatz et al. 1991). For C\ :sub:`4` plants, the light-limited rate :math:`A_{j}` varies with :math:`\phi` in relation to the quantum -efficiency (:math:`\alpha =0.05` mol CO\ :math:`{}_{2}` -mol\ :math:`{}^{-1}` photon). :math:`\phi` is the absorbed -photosynthetically active radiation (W m\ :math:`{}^{-2}`) (section +efficiency (:math:`\alpha =0.05` mol CO\ :sub:`2` +mol\ :sup:`-1` photon). :math:`\phi` is the absorbed +photosynthetically active radiation (W m\ :sup:`-2`) (section 4.1), which is converted to photosynthetic photon flux assuming 4.6 :math:`\mu` \ mol photons per joule. :math:`k_{p}` is the initial slope -of C\ :math:`{}_{4}` CO\ :math:`{}_{2}` response curve. +of C\ :sub:`4` CO\ :sub:`2` response curve. -For C\ :math:`{}_{3}` plants, the electron transport rate depends on the +For C\ :sub:`3` plants, the electron transport rate depends on the photosynthetically active radiation absorbed by the leaf. A common expression is the smaller of the two roots of the equation @@ -201,13 +196,13 @@ expression is the smaller of the two roots of the equation \Theta _{PSII} J^{2} -\left(I_{PSII} +J_{\max } \right)J+I_{PSII} J_{\max } =0 where :math:`J_{\max }` is the maximum potential rate of electron -transport (:math:`\mu`\ mol m\ :math:`{}^{--2}` s\ :math:`{}^{--1}`), +transport (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`), :math:`I_{PSII}` is the light utilized in electron transport by -photosystem II (µmol m\ :math:`{}^{--2}` s\ :math:`{}^{--1}`), and +photosystem II (µmol m\ :sup:`-2` s\ :sup:`-1`), and :math:`\Theta _{PSII}` is a curvature parameter. For a given amount of photosynthetically active radiation absorbed by a leaf :math:`\phi` (W -m\ :math:`{}^{-2}`), converted to photosynthetic photon flux density -with 4.6 :math:`\mu`\ mol J\ :math:`{}^{-1}`, the light utilized in +m\ :sup:`-2`), converted to photosynthetic photon flux density +with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is .. math:: @@ -219,8 +214,8 @@ where :math:`\Phi _{PSII}` is the quantum yield of photosystem II, and the term 0.5 arises because one photon is absorbed by each of the two photosystems to move one electron. Parameter values are :math:`\Theta _{PSII}` \ = 0.7 and :math:`\Phi _{PSII}` \ = 0.85. In -calculating :math:`A_{j}` (for both C\ :math:`{}_{3}` and -C\ :math:`{}_{4}` plants), :math:`\phi =\phi ^{sun}` for sunlit leaves +calculating :math:`A_{j}` (for both C\ :sub:`3` and +C\ :sub:`4` plants), :math:`\phi =\phi ^{sun}` for sunlit leaves and :math:`\phi =\phi ^{sha}` for shaded leaves. The model uses co-limitation as described by Collatz et al. (1991, @@ -233,12 +228,12 @@ smaller root of the equations \begin{array}{rcl} {\Theta _{cj} A_{i}^{2} -\left(A_{c} +A_{j} \right)A_{i} +A_{c} A_{j} } & {=} & {0} \\ {\Theta _{ip} A^{2} -\left(A_{i} +A_{p} \right)A+A_{i} A_{p} } & {=} & {0} \end{array} . Values are :math:`\Theta _{cj} =0.98` and :math:`\Theta _{ip} =0.95` for -C\ :math:`{}_{3}` plants; and :math:`\Theta _{cj} =0.80`\ and -:math:`\Theta _{ip} =0.95` for C\ :math:`{}_{4}` plants. +C\ :sub:`3` plants; and :math:`\Theta _{cj} =0.80`\ and +:math:`\Theta _{ip} =0.95` for C\ :sub:`4` plants. :math:`A_{n} =A-R_{d}` . The parameters :math:`K_{c}`, :math:`K_{o}` , and :math:`\Gamma _{*}` -depend on temperature. Values at 25 :math:`{}^\circ` \ C are +depend on temperature. Values at 25 :sup:`o` \ C are :math:`K_{c25} ={\rm 4}0{\rm 4}.{\rm 9}\times 10^{-6} P_{atm}` , :math:`K_{o25} =278.4\times 10^{-3} P_{atm}` , and :math:`\Gamma _{*25} {\rm =42}.75\times 10^{-6} P_{atm}` . @@ -247,14 +242,14 @@ and :math:`R_{d}` also vary with temperature. Parameter values at 25 :math:`\circ`\ C are calculated from :math:`V_{c\max }` \ at 25 :math:`\circ`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}` , :math:`T_{p25} =0.167V_{c\max 25}` , and -:math:`R_{d25} =0.015V_{c\max 25}` (C :math:`\text{}_{3}`) and -:math:`R_{d25} =0.025V_{c\max 25}` (C :math:`{}_{4}`). For -C\ :math:`{}_{4}` plants, :math:`k_{p25} =20000\; V_{c\max 25}` . +:math:`R_{d25} =0.015V_{c\max 25}` (C\ :sub:`3`) and +:math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). For +C\ :sub:`4` plants, :math:`k_{p25} =20000\; V_{c\max 25}` . However, when the biogeochemistry is active, :math:`R_{d25}` is calculated from leaf nitrogen as :math:`R_{d25} =0.2577N_{a}` , where :math:`N_{a}` is the area-based leaf nitrogen concentration (g N -m\ :math:`{}^{-2}` leaf area, equation ) and 0.2577 :math:`\mu`\ mol -CO\ :math:`{}_{2}` g\ :math:`{}^{-1}` N s\ :math:`{}^{-1}` the base +m\ :sup:`-2` leaf area, equation ) and 0.2577 :math:`\mu`\ mol +CO\ :sub:`2` g\ :sup:`-1` N s\ :sup:`-1` the base respiration rate. The parameters :math:`V_{c\max 25}` , :math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and :math:`R_{d25}` are scaled over the canopy for sunlit and shaded leaves @@ -284,7 +279,7 @@ Table 8.2 list parameter values for :math:`\Delta H_{a}` , :math:`\Delta H_{d}` , and :math:`\Delta S`, from Bonan et al. (2011). Because :math:`T_{p}` as implemented here varies with :math:`V_{c\max }` , the same temperature parameters are used for -:math:`T_{p}` . For C\ :math:`{}_{4}` plants, +:math:`T_{p}` . For C\ :sub:`4` plants, .. math:: :label: 8.12) @@ -292,10 +287,10 @@ Because :math:`T_{p}` as implemented here varies with \begin{array}{l} {V_{c\max } =V_{c\max 25} \left[\frac{Q_{10} ^{(T_{v} -298.15)/10} }{f_{H} \left(T_{v} \right)f_{L} \left(T_{v} \right)} \right]} \\ {f_{H} \left(T_{v} \right)=1+\exp \left[s_{1} \left(T_{v} -s_{2} \right)\right]} \\ {f_{L} \left(T_{v} \right)=1+\exp \left[s_{3} \left(s_{4} -T_{v} \right)\right]} \end{array} with :math:`Q_{10} =2`, -:math:`s_{1} =0.3`\ K\ :math:`{}^{-}`\ :math:`{}^{1}`, +:math:`s_{1} =0.3`\ K\ :sup:`-1` :math:`s_{2} =313.15` K, -:math:`s_{3} =0.2`\ K\ :math:`{}^{-}`\ :math:`{}^{1}`, and -:math:`s_{4} =288.15` K. Additionally, +:math:`s_{3} =0.2`\ K\ :sup:`-1`, and :math:`s_{4} =288.15` K. +Additionally, .. math:: :label: 8.13) @@ -303,7 +298,7 @@ with :math:`Q_{10} =2`, R_{d} =R_{d25} \left\{\frac{Q_{10} ^{(T_{v} -298.15)/10} }{1+\exp \left[s_{5} \left(T_{v} -s_{6} \right)\right]} \right\} with :math:`Q_{10} =2`, :math:`s_{5} =1.3` -K\ :math:`{}^{-}`\ :math:`{}^{1}`, and :math:`s_{6} =328.15`\ K, and +K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and .. math:: :label: 8.14) @@ -315,7 +310,7 @@ with :math:`Q_{10} =2`. Table 8.2. Temperature dependence parameters for C3 photosynthesis. +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| Parameter | :math:`\Delta H_{a}` (J mol\ :math:`{}^{-}`\ :math:`{}^{1}`) | :math:`\Delta H_{d}` (J mol\ :math:`{}^{-}`\ :math:`{}^{1}`) | :math:`\Delta S` (J mol\ :math:`{}^{-}`\ :math:`{}^{1}` K\ :math:`{}^{-}`\ :math:`{}^{1}`) | +| Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | :math:`\Delta S` (J mol\ :sup:`-1` K\ :sup:`-1`) | +========================+=================================================================+=================================================================+==============================================================================================+ | :math:`V_{c\max }` | 65330 | 149250 | 485 | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ @@ -349,8 +344,7 @@ and :math:`J_{\max }` to increase with warmer temperature. In this parameterization, :math:`\Delta H_{d}` \ = 200000, :math:`\Delta H_{a}` \ = 72000 for :math:`V_{c\max }` , and :math:`\Delta H_{a}` \ = 50000 for :math:`J_{\max }` . Additionally, the -ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :math:`{}^\circ`\ C -decreases with growth temperature as +ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: :label: 8.16) @@ -359,15 +353,13 @@ decreases with growth temperature as In these acclimation functions, :math:`T_{10}` is the 10-day mean air temperature (K) and :math:`T_{f}` is the freezing point of water (K). -For lack of data, :math:`T_{p}` acclimates similar to -:math:`V_{c\max }` . Acclimation is restricted over the temperature -range :math:`T_{10} -T_{f} \ge 11`\ :math:`{}^\circ`\ C and -:math:`T_{10} -T_{f} \le 35`\ :math:`{}^\circ`\ C. +For lack of data, :math:`T_{p}` acclimates similar to V :sub:`cmax` . Acclimation is restricted over the temperature +range :math:`T_{10} -T_{f} \ge 11`\ :sup:`o`\ C and :math:`T_{10} -T_{f} \le 35`\ :sup:`o`\ C. -:math:`\text{V}_{cmax25}` and Canopy scaling +V\ :sub:`cmax25` and Canopy scaling -------------------------------------------- -The maximum rate of carboxylation at 25 :math:`{}^\circ`\ C varies with +The maximum rate of carboxylation at 25 :sup:`o`\ C varies with foliage nitrogen concentration and specific leaf area and is calculated as in Thornton and Zimmermann (2007). At 25ºC, @@ -377,12 +369,12 @@ as in Thornton and Zimmermann (2007). At 25ºC, V_{c\max 25} =N_{a} F_{LNR} F_{NR} a_{R25} where :math:`N_{a}` is the area-based leaf nitrogen concentration (g N -m\ :math:`{}^{-2}` leaf area), :math:`F_{LNR}` is the fraction of leaf -nitrogen in Rubisco (g N in Rubisco g\ :math:`{}^{-1}` N), +m\ :sup:`-2` leaf area), :math:`F_{LNR}` is the fraction of leaf +nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), :math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass -to nitrogen in Rubisco (g Rubisco g\ :math:`{}^{-1}` N in Rubisco), and +to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and :math:`a_{R25} =60` is the specific activity of Rubisco (µmol -CO\ :math:`{}_{2}` g\ :math:`{}^{-1}` Rubisco s\ :math:`{}^{-1}`). +CO\ :sub:`2` g\ :sup:`-1` Rubisco s\ :sup:`-1`). :math:`N_{a}` is calculated from mass-based leaf N concentration and specific leaf area @@ -392,8 +384,8 @@ specific leaf area N_{a} =\frac{1}{CN_{L} \; SLA_{0} } where :math:`CN_{L}` is the leaf carbon-to-nitrogen ratio (g C -g\ :math:`{}^{-1}` N) and :math:`SLA_{0}` is specific leaf area at the -canopy top ( :math:`\text{m}^{2}\,\text{leaf area}\,\text{g}^{-1}\,\text{C}` ). Table 8.1 +g\ :sup:`-1` N) and :math:`SLA_{0}` is specific leaf area at the +canopy top ( m\ :sup:`2` leaf area g\ :sup:`-1` C ). Table 8.1 lists values of :math:`F_{LNR}` , :math:`CN_{L}` , and :math:`SLA_{0}` for each plant functional type. :math:`F_{LNR}` was chosen to give :math:`V_{c\max 25}` consistent with Kattge et al. (2009), as discussed @@ -450,7 +442,7 @@ extinction coefficient (equation 4.9). Photosynthetic parameters The value :math:`K_{n} = 0.11` chosen by Bonan et al. (2011) is consistent with observationally-derived estimates for forests, mostly -tropical, and provides a gradient in :math:`\text{V}_{cmax}` similar to +tropical, and provides a gradient in V\ :sub:`cmax` similar to the original CLM4 specific leaf area scaling. However, Bonan et al. (2012) showed that the sunlit/shaded canopy parameterization does not match an explicit multi-layer canopy parameterization. The discrepancy @@ -487,8 +479,8 @@ Soil water stress Soil water influences stomatal conductance directly by multiplying the minimum conductance by a soil water stress function :math:`\beta _{t}` -and also indirectly through :math:`A_{n}` in the C\ :math:`{}_{3}` and -C\ :math:`{}_{4}` photosynthesis models, as in Sellers et al. (1996). +and also indirectly through :math:`A_{n}` in the C\ :sub:`3` and +C\ :sub:`4` photosynthesis models, as in Sellers et al. (1996). The latter effect is achieved by multiplying :math:`V_{c\; \max }` and :math:`R_{d}` by :math:`\beta _{t}` . @@ -540,10 +532,10 @@ where :math:`\theta _{ice,\, i} ={w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(\rho _{ice} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} \Delta z_{i} \right)} \le \theta _{sat,\, i}` \ and :math:`\theta _{liq,\, i} ={w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(\rho _{liq} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{liq} \Delta z_{i} \right)} \le \theta _{sat,\, i} -\theta _{ice,\, i}` . :math:`w_{ice,\, i}` and :math:`w_{liq,\, i}` are the ice and liquid -water contents (kg m\ :math:`{}^{-2}`) (Chapter 7), +water contents (kg m\ :sup:`-2`) (Chapter 7), :math:`\theta _{sat,\, i}` is the saturated volumetric water content (section 7.4.1), :math:`\rho _{ice}` and :math:`\rho _{liq}` are the -densities of ice and liquid water (kg m\ :math:`{}^{-3}`) (Table 2.6), +densities of ice and liquid water (kg m\ :sup:`-3`) (Table 2.6), and :math:`\Delta z_{i}` is the soil layer thickness (m) (section 6.1). The root fraction :math:`r_{i}` in each soil layer depends on the plant @@ -587,11 +579,11 @@ Table 8.3. Plant functional type root distribution parameters. +----------------------------------+------------------+------------------+ | BDS boreal | 7.0 | 1.5 | +----------------------------------+------------------+------------------+ -| C\ :math:`{}_{3}` grass arctic | 11.0 | 2.0 | +| C\ :sub:`3` grass arctic | 11.0 | 2.0 | +----------------------------------+------------------+------------------+ -| C\ :math:`{}_{3}` grass | 11.0 | 2.0 | +| C\ :sub:`3` grass | 11.0 | 2.0 | +----------------------------------+------------------+------------------+ -| C\ :math:`{}_{4}` grass | 11.0 | 2.0 | +| C\ :sub:`4` grass | 11.0 | 2.0 | +----------------------------------+------------------+------------------+ | Crop R | 6.0 | 3.0 | +----------------------------------+------------------+------------------+ @@ -617,13 +609,13 @@ Table 8.3. Plant functional type root distribution parameters. Numerical implementation ---------------------------- -The CO\ :math:`{}_{2}` partial pressure at the leaf surface +The CO\ :sub:`2` partial pressure at the leaf surface :math:`c_{s}` (Pa) and the vapor pressure at the leaf surface :math:`e_{s}` (Pa), needed for the stomatal resistance model in -equation , and the internal leaf CO\ :math:`{}_{2}` partial pressure +equation , and the internal leaf CO\ :sub:`2` partial pressure :math:`c_{i}` (Pa), needed for the photosynthesis model in equations -, are calculated assuming there is negligible capacity to store -CO\ :math:`{}_{2}` and water vapor at the leaf surface so that +CO\ :sub:`2` and water vapor at the leaf surface so that .. math:: :label: ZEqnNum581596 @@ -638,13 +630,13 @@ and the transpiration fluxes are related as \frac{e_{a} -e_{i} }{r_{b} +r_{s} } =\frac{e_{a} -e_{s} }{r_{b} } =\frac{e_{s} -e_{i} }{r_{s} } where :math:`r_{b}` is leaf boundary layer resistance (s -m\ :math:`{}^{2}` :math:`\mu` \ mol\ :math:`{}^{-1}`) (section 5.3), the -terms 1.4 and 1.6 are the ratios of diffusivity of CO\ :math:`{}_{2}` to -H\ :math:`{}_{2}`\ O for the leaf boundary layer resistance and stomatal +m\ :sup:`2` :math:`\mu` \ mol\ :sup:`-1`) (section 5.3), the +terms 1.4 and 1.6 are the ratios of diffusivity of CO\ :sub:`2` to +H\ :sub:`2`\ O for the leaf boundary layer resistance and stomatal resistance, :math:`c_{a} ={\rm CO}_{{\rm 2}} \left({\rm mol\; mol}^{{\rm -1}} \right)P_{atm}` -is the atmospheric CO\ :math:`{}_{2}` partial pressure (Pa) calculated -from CO\ :math:`{}_{2}` concentration (ppmv), :math:`e_{i}` is the +is the atmospheric CO\ :sub:`2` partial pressure (Pa) calculated +from CO\ :sub:`2` concentration (ppmv), :math:`e_{i}` is the saturation vapor pressure (Pa) evaluated at the leaf temperature :math:`T_{v}` , and :math:`e_{a}` is the vapor pressure of air (Pa). The vapor pressure of air in the plant canopy :math:`e_{a}` (Pa) is @@ -656,7 +648,7 @@ determined from e_{a} =\frac{P_{atm} q_{s} }{0.622} where :math:`q_{s}` is the specific humidity of canopy air (kg -kg\ :math:`{}^{-1}`) (section 5.3). Equations and are solved for +kg\ :sup:`-1`) (section 5.3). Equations and are solved for :math:`c_{s}` and :math:`e_{s}` .. math:: @@ -706,13 +698,13 @@ resolved at depths in the canopy using a light profile (Chapter 4). In this case, :math:`V_{c\max 25}` is not integrated over the canopy, but is instead given explicitly for each canopy layer using equation . This also uses the Lloyd et al. (2010) relationship whereby -:math:`\text{K}_{n}` scales with :math:`\text{V}_{cmax}` as +K\ :sub:`n` scales with V\ :sub:`cmax` as .. math:: :label: 8.38) K_{n} =\exp \left(0.00963V_{c\max } -2.43\right) -such that higher values of :math:`\text{V}_{cmax}` imply steeper declines +such that higher values of V\ :sub:`cmax` imply steeper declines in photosynthetic capacity through the canopy with respect to cumulative leaf area. diff --git a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst index b13328cecb..900f8873a9 100644 --- a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst +++ b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst @@ -41,7 +41,7 @@ implemented, the lake consists of 0-5 snow layers; water and ice layers layer has a fixed water mass (set by the nominal layer thickness and the liquid density), with frozen mass-fraction *I* a state variable. Resolved snow layers are present if the snow thickness -:math:`z_{sno} \ge s_{\min }` , where *s* :math:`{}_{min}` = 4 cm by +:math:`z_{sno} \ge s_{\min }` , where *s*\ :sub:`min` = 4 cm by default, and is adjusted for model timesteps other than 1800 s in order to maintain numerical stability (section 9.6.5). For global simulations with 10 body layers, the default (50 m lake) body layer thicknesses are @@ -58,7 +58,7 @@ maintain fixed proportions. For lakes with *d* :math:`<` 1 m, all layers have equal thickness. Thicknesses of snow, soil, and bedrock layers follow the scheme used over non-vegetated surfaces (Chapter 6), with modifications to the snow layer thickness rules to keep snow layers at -least as thick as *s*\ :math:`{}_{min}` (section 9.6.5). +least as thick as *s*\ :sub:`min` (section 9.6.5). External Data ----------------- @@ -66,7 +66,7 @@ External Data As discussed in Subin et al (2012a, b), the Global Lake and Wetland Database (Lehner and Doll 2004) is currently used to prescribe lake fraction in each land model grid cell, for a total of 2.3 million -km\ :math:`{}^{-2}`. As in Subin et al. (2012a, b), the Kourzeneva +km\ :sup:`-2`. As in Subin et al. (2012a, b), the Kourzeneva (2012) global gridded dataset is currently used to estimate a mean lake depth in each grid cell, based on interpolated compilations of geographic information. @@ -75,7 +75,7 @@ Surface Albedo ------------------ For direct radiation, the albedo *a* for lakes with ground temperature -:math:`\text{T}_{g}` * (K) above freezing is given by (Pivovarov, 1972) +:math:`{T}_{g}` (K) above freezing is given by (Pivovarov, 1972) .. math:: :label: ZEqnNum194122 @@ -86,9 +86,9 @@ where *z* is the zenith angle. For diffuse radiation, the expression in eq. is integrated over the full sky to yield *a* = 0.10. For frozen lakes without resolved snow layers, the albedo at cold -temperatures *a* :math:`{}_{0}` is 0.60 for visible and 0.40 for near +temperatures *a*\ :sub:`0` is 0.60 for visible and 0.40 for near infrared radiation. As the temperature at the ice surface, -:math:`\text{T}_{g}`, approaches freezing [ :math:`\text{T}_{f}` (K) (Table +:math:`{T}_{g}`, approaches freezing [ :math:`{T}_{f}` (K) (Table 2.6)], the albedo is relaxed towards 0.10 based on Mironov et al. (2010): .. math:: @@ -99,7 +99,7 @@ infrared radiation. As the temperature at the ice surface, where *a* is restricted to be no less than that given in eq. . For frozen lakes with resolved snow layers, the reflectance of the ice -surface is fixed at *a* :math:`{}_{0}`, and the snow reflectance is +surface is fixed at *a*\ :sub:`0`, and the snow reflectance is calculated as over non-vegetated surfaces (Chapter 3). These two reflectances are combined to obtain the snow-fraction-weighted albedo as in over non-vegetated surfaces (Chapter 3). @@ -115,12 +115,12 @@ Overview of Changes from CLM4 roughnesses depend (weakly) on the friction velocity :math:`u_{\*}` (which itself depends weakly on the surface roughnesses), their calculation has been incorporated into the iteration solution for - :math:`\text{T}_{g}`, and the maximum number of iterations has been + :math:`{T}_{g}`, and the maximum number of iterations has been increased to 4. Convergence of the modified solution was tested during development. #. A coefficient of :math:`\beta` has been added to - :math:`\text{S}_{g}` in eq. , correcting a previous error. + :math:`{S}_{g}` in eq. , correcting a previous error. .. todo:: fill this equation number in #. The top layer thickness :math:`\Delta z_{T}` used in eq. has been @@ -132,7 +132,7 @@ Overview of Changes from CLM4 conductivity calculated in the previous timestep. #. Several conditions are imposed on the ground temperature - :math:`\text{T}_{g}` to maintain a stable density profile at the lake + :math:`{T}_{g}` to maintain a stable density profile at the lake surface eq. . Surface Properties @@ -154,7 +154,7 @@ forcing. For frozen lakes ( :math:`T_{g} \le T_{f}` ) with resolved snow layers, the momentum roughness length :math:`z_{0m} =2.4\times 10^{-3} {\rm m}` (as over non-vegetated surfaces; Chapter 5), and the scalar roughness lengths -(*z* :math:`{}_{0}`\ :math:`{}_{q}`, for latent heat; and *z* :math:`{}_{0}`\ :math:`{}_{h}`, for sensible heat) are given by +(*z*\ :sub:`0q` for latent heat; and *z*\ :sub:`0h`, for sensible heat) are given by (Zilitinkevich 1970) .. math:: @@ -165,14 +165,13 @@ surfaces; Chapter 5), and the scalar roughness lengths where :math:`R_{0}` is the near-surface atmospheric roughness Reynolds number, :math:`z_{0h}` is the roughness length for sensible heat, :math:`z_{0q}` is the -roughness length for latent heat, :math:`\nu` ( :math:`\text{m}^{2}\,\text{s}^{-1}`) is the kinematic viscosity of air, and -:math:`u_{\*}` ( :math:`\text{m\,s}^{-1}` ) is the friction velocity in the +roughness length for latent heat, :math:`\nu` (m\ :sup:`2` s\ :sup:`-1`) is the kinematic viscosity of air, and +:math:`u_{\*}` (m s\ :sup:`-1`) is the friction velocity in the atmospheric surface layer. For frozen lakes without resolved snow layers, :math:`z_{0m} =1\times 10^{-3} {\rm m}` (Subin et al. 2012a), and the scalar roughness lengths are given by . -For unfrozen lakes, *z* :math:`{}_{0}`\ :math:`{}_{m}` is given by -(Subin et al. 2012a) +For unfrozen lakes, *z*\ :sub:`0m` is given by (Subin et al. 2012a) .. math:: :label: ZEqnNum864823 @@ -193,7 +192,7 @@ where :math:`\nu _{0} =1.51\times 10^{-5} {\textstyle\frac{{\rm m}^{{\rm 2}} }{{\rm s}}}` , :math:`T_{0} ={\rm 293.15\; K}`, :math:`P_{0} =1.013\times 10^{5} {\rm \; Pa}` , and -:math:`\text{P}_{ref}` is the pressure at the atmospheric reference +:math:`\{P}_{ref}` is the pressure at the atmospheric reference height. The Charnock coefficient *C* is a function of the lake fetch *F* (m), given in the surface data or set to 25 times the lake depth *d* by default: @@ -206,7 +205,7 @@ default: where *A* and *B* define the fetch- and depth-limitation, respectively; :math:`C_{\min } =0.01` , :math:`C_{\max } =0.01`, :math:`\varepsilon =1` , :math:`f_{c} =100` , and *u* (m -s\ :math:`{}^{-1}`) is the atmospheric forcing wind. +s\ :sup:`-1`) is the atmospheric forcing wind. Surface Flux Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -224,7 +223,7 @@ where :math:`\vec{S}_{g}` \ is the absorbed solar radiation in the lake, :math:`H_{g}` \ is the sensible heat flux (+ upwards), :math:`E_{g}` \ is the water vapor flux (+ upwards), and *G* is the ground heat flux (+ downwards). All of these fluxes depend implicitly on -the temperature at the lake surface :math:`\text{T}_{g}`. +the temperature at the lake surface :math:`{T}_{g}`. :math:`\lambda` converts :math:`E_{g}` to an energy flux based on .. math:: @@ -232,7 +231,7 @@ the temperature at the lake surface :math:`\text{T}_{g}`. \lambda =\left\{\begin{array}{l} {\lambda _{sub} \qquad T_{g} \le T_{f} } \\ {\lambda _{vap} \qquad T_{g} >T_{f} } \end{array}\right\}. -The sensible heat flux (W m\ :math:`{}^{-2}`) is +The sensible heat flux (W m\ :sup:`-2`) is .. math:: :label: ZEqnNum720553 @@ -240,15 +239,15 @@ The sensible heat flux (W m\ :math:`{}^{-2}`) is H_{g} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{g} \right)}{r_{ah} } where :math:`\rho _{atm}` is the density of moist air (kg -m\ :math:`{}^{-3}`) (Chapter 5), :math:`C_{p}` is the specific heat -capacity of air (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) (Table 2.6), +m\ :sup:`-3`) (Chapter 5), :math:`C_{p}` is the specific heat +capacity of air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), :math:`\theta _{atm}` is the atmospheric potential temperature (K) (Chapter 5), :math:`T_{g}` is the lake surface temperature (K) (at an infinitesimal interface just above the top resolved model layer: snow, ice, or water), and :math:`r_{ah}` is the aerodynamic resistance to -sensible heat transfer (s m\ :math:`{}^{-1}`) (section 5.1). +sensible heat transfer (s m\ :sup:`-1`) (section 5.1). -The water vapor flux (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is +The water vapor flux (kg m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 9.10) @@ -256,10 +255,10 @@ The water vapor flux (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) is E_{g} =-\frac{\rho _{atm} \left(q_{atm} -q_{sat}^{T_{g} } \right)}{r_{aw} } where :math:`q_{atm}` is the atmospheric specific humidity (kg -kg\ :math:`{}^{-1}`) (section 2.2.1), :math:`q_{sat}^{T_{g} }` \ is the -saturated specific humidity (kg kg\ :math:`{}^{-1}`) (section 5.5) at +kg\ :sup:`-1`) (section 2.2.1), :math:`q_{sat}^{T_{g} }` \ is the +saturated specific humidity (kg kg\ :sup:`-1`) (section 5.5) at the lake surface temperature :math:`T_{g}` , and :math:`r_{aw}` is the -aerodynamic resistance to water vapor transfer (s m\ :math:`{}^{-1}`) +aerodynamic resistance to water vapor transfer (s m\ :sup:`-1`) (section 5.1). The zonal and meridional momentum fluxes are @@ -275,11 +274,11 @@ The zonal and meridional momentum fluxes are \tau _{y} =-\rho _{atm} \frac{v_{atm} }{r_{atm} } where :math:`u_{atm}` and :math:`v_{atm}` are the zonal and -meridional atmospheric winds (m s\ :math:`{}^{-1}`) (section 2.2.1), and +meridional atmospheric winds (m s\ :sup:`-1`) (section 2.2.1), and :math:`r_{am}` is the aerodynamic resistance for momentum (s -m\ :math:`{}^{-1}`) (section 5.1). +m\ :sup:`-1`) (section 5.1). -The heat flux into the lake surface :math:`G` (W m\ :math:`{}^{-2}`) is +The heat flux into the lake surface :math:`G` (W m\ :sup:`-2`) is .. math:: :label: ZEqnNum122376 @@ -287,7 +286,7 @@ The heat flux into the lake surface :math:`G` (W m\ :math:`{}^{-2}`) is G=\frac{2\lambda _{T} }{\Delta z_{T} } \left(T_{g} -T_{T} \right) where :math:`\lambda _{T}` is the thermal conductivity (W -m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), :math:`\Delta z_{T}` is the +m\ :sup:`-1` K\ :sup:`-1`), :math:`\Delta z_{T}` is the thickness (m), and :math:`T_{T}` is the temperature (K) of the top resolved lake layer (snow, ice, or water). The top thermal conductivity :math:`\lambda _{T}` of unfrozen lakes ( :math:`T_{g} >T_{f}` ) @@ -310,7 +309,7 @@ The absorbed solar radiation :math:`\vec{S}_{g}` is where :math:`S_{atm} \, \downarrow _{\Lambda }^{\mu }` and :math:`S_{atm} \, \downarrow _{\Lambda }` are the incident direct beam -and diffuse solar fluxes (W m\ :math:`{}^{-2}`) and :math:`\Lambda` +and diffuse solar fluxes (W m\ :sup:`-2`) and :math:`\Lambda` denotes the visible (:math:`<` 0.7\ :math:`\mu {\rm m}`) and near-infrared (:math:`\ge` 0.7\ :math:`\mu {\rm m}`) wavebands (section 2.2.1), and :math:`\alpha _{g,\, \Lambda }^{\mu }` and @@ -335,10 +334,8 @@ the surface is L\, \uparrow =\left(1-\varepsilon _{g} \right)L_{atm} \, \downarrow +\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right) where :math:`\varepsilon _{g} =0.97` is the lake surface emissivity, -:math:`\sigma` is the Stefan-Boltzmann constant (W m\ :math:`{}^{-2}` -K\ :math:`{}^{-4}`) (Table 2.6), and :math:`T_{g}^{n+1} -T_{g}^{n}` is -the difference in lake surface temperature between Newton-Raphson -iterations (see below). +:math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6), and :math:`T_{g}^{n+1} -T_{g}^{n}` is +the difference in lake surface temperature between Newton-Raphson iterations (see below). The sensible heat :math:`H_{g}` , the water vapor flux :math:`E_{g}` through its dependence on the saturated specific humidity, the net @@ -388,14 +385,14 @@ simultaneously with lake surface temperature as follows. The stability-related equations are the same as for non-vegetated surfaces (section 5.2), except that the surface roughnesses are here (weakly varying) functions of the friction velocity :math:`u_{\*}` . To begin, -*z* :math:`{}_{0}`\ :math:`{}_{m}` is set based on the value +*z*\ :sub:`0m` is set based on the value calculated for the last timestep (for :math:`T_{g} >T_{f}` ) or based on the values in section 9.4.2 (otherwise), and the scalar roughness lengths are set based on the relationships in section 9.4.2. #. An initial guess for the wind speed :math:`V_{a}` including the convective velocity :math:`U_{c}` is obtained from eq. assuming an - initial convective velocity :math:`U_{c} =0` m s\ :math:`{}^{-1}` for + initial convective velocity :math:`U_{c} =0` m s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from eq. ) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). @@ -460,7 +457,7 @@ layer temperature :math:`T_{T}` \ (Subin et al. 2012a). \begin{array}{l} {{\rm 1)\; }T_{T} \le T_{f} T_{g} ^{{'} } >T_{m} \Rightarrow T_{g} =T_{T} ,} \\ {{\rm 3)\; }T_{m} >T_{g} ^{{'} } >T_{T} >T_{f} \Rightarrow T_{g} =T_{T} } \end{array} where :math:`T_{m}` \ is the temperature of maximum liquid water -density, 3.85\ :math:`{}^\circ`\ C (Hostetler and Bartlein 1990). The +density, 3.85\ :sup:`o` C (Hostetler and Bartlein 1990). The first condition requires that, if there is any snow or ice present, the surface temperature is restricted to be less than or equal to freezing. The second and third conditions maintain convective stability in the top @@ -474,7 +471,7 @@ XXX in order to precisely conserve energy. XXX This ground heat flux is taken as a prescribed flux boundary condition for the lake temperature solution (section 9.5.3). An energy balance check is included at each timestep to insure that eq. XXX is obeyed to within -0.1 W m\ :math:`{}^{-2}`. +0.1 W m\ :sup:`-2`. Lake Temperature -------------------- @@ -493,10 +490,10 @@ land units (Chapter 6), is \tilde{c}_{v} \frac{\partial T}{\partial t} =\frac{\partial }{\partial z} \left(\tau \frac{\partial T}{\partial z} \right)-\frac{d\phi }{dz} where :math:`\tilde{c}_{v}` is the volumetric heat capacity (J -m\ :math:`{}^{-3}` K\ :math:`{}^{-1}`), :math:`t` is time (s), *T* is +m\ :sup:`-3` K\ :sup:`-1`), :math:`t` is time (s), *T* is the temperature (K), :math:`\tau` is the thermal conductivity (W -m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), and :math:`\phi` is the solar -radiation (W m\ :math:`{}^{-2}`) penetrating to depth *z* (m). The +m\ :sup:`-1` K\ :sup:`-1`), and :math:`\phi` is the solar +radiation (W m\ :sup:`-2`) penetrating to depth *z* (m). The system is discretized into *N* layers, where .. math:: @@ -555,7 +552,7 @@ The top boundary condition, imposed at the top modeled layer downwards surface flux *G* defined by the energy flux residual during the surface temperature solution (section 9.4.3). The bottom boundary condition, imposed at :math:`i=N_{levlak} +N_{levgrnd}` , is zero flux. -The 2-m windspeed :math:`u_{2}` \ (m s\ :math:`{}^{-1}`) is used in the +The 2-m windspeed :math:`u_{2}` \ (m s\ :sup:`-1`) is used in the calculation of eddy diffusivity: .. math:: @@ -569,7 +566,7 @@ where :math:`u_{*}` \ is the friction velocity calculated in section Eddy Diffusivity and Thermal Conductivities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The total eddy diffusivity :math:`K_{W}` (:math:`\text{m}^{2}\,\text{s}^{-1}`) for liquid water in the lake body is given by (Subin et al. 2012a) +The total eddy diffusivity :math:`K_{W}` (m\ :sup:`2` s\ :sup:`-1`) for liquid water in the lake body is given by (Subin et al. 2012a) .. math:: :label: 9.29) @@ -582,9 +579,9 @@ intended to represent unresolved mixing processes (Fang and Stefan 1996), :math:`\kappa _{m} =\frac{\lambda _{liq} }{c_{liq} \rho _{liq} }` \ is the molecular diffusivity of water (given by the ratio of its thermal -conductivity (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) to the product of -its heat capacity (J kg\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) and density -(kg m\ :math:`{}^{-3}`), values given in Table 2.6), and :math:`m_{d}` +conductivity (W m\ :sup:`-1` K\ :sup:`-1`) to the product of +its heat capacity (J kg\ :sup:`-1` K\ :sup:`-1`) and density +(kg m\ :sup:`-3`), values given in Table 2.6), and :math:`m_{d}` (unitless) is a factor which increases the overall diffusivity for large lakes, intended to represent 3-dimensional mixing processes such as caused by horizontal temperature gradients. As currently implemented, @@ -596,8 +593,7 @@ caused by horizontal temperature gradients. As currently implemented, where *d* is the lake depth. -The wind-driven eddy diffusion coefficient :math:`\kappa _{e,\, i}` -( :math:`\text{m}^{2}\,\text{s}^{-1}` ) for layers :math:`1\le i\le N_{levlak}` is +The wind-driven eddy diffusion coefficient :math:`\kappa _{e,\, i}` (m\ :sup:`2` s\ :sup:`-1`) for layers :math:`1\le i\le N_{levlak}` is .. math:: :label: 9.31) @@ -606,13 +602,13 @@ The wind-driven eddy diffusion coefficient :math:`\kappa _{e,\, i}` where :math:`P_{0} =1` is the neutral value of the turbulent Prandtl number, :math:`z_{i}` is the node depth (m), the surface friction -velocity (m s\ :math:`{}^{-1}`) is :math:`w^{*} =0.0012u_{2}` , and +velocity (m s\ :sup:`-1`) is :math:`w^{*} =0.0012u_{2}` , and :math:`k^{*}` varies with latitude :math:`\phi` as :math:`k^{*} =6.6u_{2}^{-1.84} \sqrt{\left|\sin \phi \right|}` . For the bottom layer, :math:`\kappa _{e,\, N_{levlak} } =\kappa _{e,N_{levlak} -1\, }` . As in Hostetler and Bartlein (1990), the 2-m wind speed :math:`u_{2}` (m -s\ :math:`{}^{-1}`) (eq. ) is used to evaluate :math:`w^{*}` and +s\ :sup:`-1`) (eq. ) is used to evaluate :math:`w^{*}` and :math:`k^{*}` rather than the 10-m wind used by Henderson-Sellers (1985). @@ -630,9 +626,9 @@ where N^{2} =\frac{g}{\rho _{i} } \frac{\partial \rho }{\partial z} -and :math:`g` is the acceleration due to gravity (m s\ :math:`{}^{-2}`) +and :math:`g` is the acceleration due to gravity (m s\ :sup:`-2`) (Table 2.6), :math:`\rho _{i}` is the density of water (kg -m\ :math:`{}^{-3}`), and :math:`\frac{\partial \rho }{\partial z}` is +m\ :sup:`-3`), and :math:`\frac{\partial \rho }{\partial z}` is approximated as :math:`\frac{\rho _{i+1} -\rho _{i} }{z_{i+1} -z_{i} }` . Note that because here, *z* is increasing downwards (unlike in Hostetler and @@ -656,7 +652,7 @@ where :math:`N^{2}` \ is calculated as in eq. except for the minimum value imposed in . The thermal conductivity for the liquid water portion of lake body layer -*i*, :math:`\tau _{liq,i}` (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`) is +*i*, :math:`\tau _{liq,i}` (W m\ :sup:`-1` K\ :sup:`-1`) is given by .. math:: @@ -665,7 +661,7 @@ given by \tau _{liq,i} =K_{W} c_{liq} \rho _{liq} . The thermal conductivity of the ice portion of lake body layer *i*, -:math:`\tau _{ice,eff}` \ (W m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), is +:math:`\tau _{ice,eff}` \ (W m\ :sup:`-1` K\ :sup:`-1`), is constant among layers, and is given by .. math:: @@ -701,7 +697,7 @@ If there are no resolved snow layers, the surface absorption fraction :math:`\be by the atmospheric model. This is apportioned to the surface energy budget (section 9.4.2), and thus no additional radiation is absorbed in the top :math:`z_{a}` (currently 0.6 m) of unfrozen lakes, for which -the light extinction coefficient :math:`\eta` ( :math:`\text{m}^{-1}` ) +the light extinction coefficient :math:`\eta` (m\ :sup:`-1`) varies between lake columns (eq. ). For frozen lakes (:math:`T_{g} \le T_{f}` ), the remaining :math:`\left(1-\beta \right)\vec{S}_{g}` fraction of surface absorbed radiation that is not apportioned to the surface energy budget is @@ -730,11 +726,11 @@ For all lake body layers, the flux absorbed by the layer *i*, \phi _{i} =\left(1-\beta \vec{S}_{g} \right)\left[\exp \left\{-\eta \left(z_{i} -\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}-\exp \left\{-\eta \left(z_{i} +\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}\right] . The argument of each exponent is constrained to be non-negative (so -:math:`\phi _{i}` = 0 for layers contained within :math:`\text{z}_{a}`). +:math:`\phi _{i}` = 0 for layers contained within :math:`{z}_{a}`). The remaining flux exiting the bottom of layer :math:`i=N_{levlak}` is absorbed in the top soil layer. -The light extinction coefficient :math:`\eta` ( :math:`\text{m}^{-1}` ), if +The light extinction coefficient :math:`\eta` (m\ :sup:`-1`), if not provided as external data, is a function of depth *d* (m) (Subin et al. 2012a): @@ -747,8 +743,7 @@ Heat Capacities ^^^^^^^^^^^^^^^^^^^^^ The vertically-integrated heat capacity for each lake layer, -:math:`\text{c}_{v,i}\,\text{J\,m}^{-2}`) is -determined by the mass-weighted average over the heat capacities for the +:math:`\text{c}_{v,i}` (J m\ :sup:`-2`) is determined by the mass-weighted average over the heat capacities for the water and ice fractions: .. math:: @@ -760,7 +755,7 @@ Note that the density of water is used for both ice and water fractions, as the thickness of the layer is fixed. The total heat capacity :math:`c_{v,i}` for each soil, snow, and -bedrock layer (J m\ :math:`{}^{-2}`) is determined as for vegetated land +bedrock layer (J m\ :sup:`-2`) is determined as for vegetated land units (Chapter 6), as the sum of the heat capacities for the water, ice, and mineral constituents. @@ -772,8 +767,8 @@ soil (Chapter 6), except that the lake body layers are sandwiched between the snow and soil layers (section 9.5.1), and radiation flux is absorbed throughout the lake layers. Before solution, layer temperatures :math:`T_{i}` (K), thermal conductivities :math:`\tau _{i}` (W -m\ :math:`{}^{-1}` K\ :math:`{}^{-1}`), heat capacities :math:`c_{v,i}` -(J m\ :math:`{}^{-2}`), and layer and interface depths from all +m\ :sup:`-1` K\ :sup:`-1`), heat capacities :math:`c_{v,i}` +(J m\ :sup:`-2`), and layer and interface depths from all components are transformed into a uniform set of vectors with length :math:`N=n_{sno} +N_{levlak} +N_{levgrnd}` and consistent units to simplify the solution. Thermal conductivities at layer interfaces are @@ -799,7 +794,7 @@ layer as where superscripts *n* + 1 and *n* denote values at the end and beginning of the timestep :math:`\Delta t`, respectively, :math:`F_{i}` -(W m\ :math:`{}^{-2}`) is the downward heat flux at the bottom of layer +(W m\ :sup:`-2`) is the downward heat flux at the bottom of layer *i*, and :math:`\phi _{i}` is the solar radiation absorbed in layer *i*. @@ -833,7 +828,7 @@ given layer if the temperature is below freezing and liquid water remains, or if the temperature is above freezing and ice remains. If melting occurs, the available energy for melting, :math:`Q_{avail}` -(J m\ :math:`{}^{-2}`), is computed as +(J m\ :sup:`-2`), is computed as .. math:: :label: ZEqnNum598199 @@ -842,7 +837,7 @@ If melting occurs, the available energy for melting, :math:`Q_{avail}` where :math:`T_{i}` is the temperature of the layer after thermal diffusion (section 9.5.7), and :math:`c_{v,i}` \ is as calculated in -section 9.5.6. The mass of melt in the layer *M* (kg m\ :math:`{}^{-2}`) +section 9.5.6. The mass of melt in the layer *M* (kg m\ :sup:`-2`) is given by .. math:: @@ -850,7 +845,7 @@ is given by M=\min \left\{M_{ice} ,\frac{Q_{avail} }{H_{fus} } \right\} -where :math:`H_{fus}` (J kg\ :math:`{}^{-1}`) is the latent heat of +where :math:`H_{fus}` (J kg\ :sup:`-1`) is the latent heat of fusion of water (Table 2.6), and :math:`M_{ice}` is the mass of ice in the layer: :math:`I_{i} \rho _{liq} \Delta z_{i}` for a lake body layer, or simply the soil / snow ice content state variable @@ -991,7 +986,7 @@ Energy Conservation To check energy conservation, the left-hand side of eq. XXX is re-written to yield the total enthalpy of the lake system (J -m\ :math:`{}^{-2}`) :math:`H_{tot}` : +m\ :sup:`-2`) :math:`H_{tot}` : .. math:: :label: 9.57) @@ -1004,14 +999,14 @@ present in resolved snow layers. This expression is evaluated once at the beginning and once at the end of the timestep (re-evaluating each :math:`c_{v,i}` ), and the change is compared with the net surface energy flux to yield the error flux :math:`E_{soi}` (W -m\ :math:`{}^{-2}`): +m\ :sup:`-2`): .. math:: :label: 9.58) E_{soi} =\frac{\Delta H_{tot} }{\Delta t} -G-\sum _{i=j_{top} }^{N_{levlak} +N_{levgrnd} }\phi _{i} -If :math:`\left|E_{soi} \right|<0.1`\ W m\ :math:`{}^{-2}`, it is +If :math:`\left|E_{soi} \right|<0.1`\ W m\ :sup:`-2`, it is subtracted from the sensible heat flux and added to *G*. Otherwise, the model is aborted. @@ -1025,8 +1020,8 @@ Hydrology is done similarly to other impervious non-vegetated columns (e.g., glaciers) where snow layers may be resolved but infiltration into the permanent ground is not allowed. The water mass of lake columns is currently maintained constant, aside from overlying snow. The water -budget is balanced with :math:`q_{rgwl}` (eq. ; kg m\ :math:`{}^{-2}` -s\ :math:`{}^{-1}`), a generalized runoff term for impervious land units +budget is balanced with :math:`q_{rgwl}` (eq. ; kg m\ :sup:`-2` +s\ :sup:`-1`), a generalized runoff term for impervious land units that may be negative. There are some modifications to the soil and snow parameterizations as @@ -1055,12 +1050,12 @@ The total water balance of the system is given by \Delta W_{sno} +\sum _{i=1}^{n_{levsoi} }\left(\Delta w_{liq,i} +\Delta w_{ice,i} \right) =\left(q_{rain} +q_{sno} -E_{g} -q_{rgwl} -q_{snwcp,\, ice} \right)\Delta t -where :math:`W_{sno}` (kg m\ :math:`{}^{-2}`) is the total mass of snow +where :math:`W_{sno}` (kg m\ :sup:`-2`) is the total mass of snow (both liquid and ice, in resolved snow layers or bulk snow), :math:`w_{liq,i}` and :math:`w_{ice,i}` are the masses of water phases -(kg m\ :math:`{}^{-2}`) in soil layer *i*, :math:`q_{rain}` and +(kg m\ :sup:`-2`) in soil layer *i*, :math:`q_{rain}` and :math:`q_{sno}` are the precipitation forcing from the atmosphere (kg -m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`), :math:`q_{snwcp,\, ice}` is the +m\ :sup:`-2` s\ :sup:`-1`), :math:`q_{snwcp,\, ice}` is the ice runoff associated with snow-capping (below), :math:`E_{g}` is the ground evaporation (section 9.4.3), and :math:`n_{levsoi}` is the number of hydrologically active soil layers (as opposed to dry bedrock @@ -1092,7 +1087,7 @@ treated as over other land units, except that the allowed evaporation from the ground is unlimited (though the top snow layer cannot lose more water mass than it contains). If there are no resolved snow layers but :math:`W_{sno} >0` and :math:`E_{g} >0`, sublimation -:math:`q_{sub,sno}` \ (kg m\ :math:`{}^{-2}` s\ :math:`{}^{-1}`) will be +:math:`q_{sub,sno}` \ (kg m\ :sup:`-2` s\ :sup:`-1`) will be given by .. math:: @@ -1121,7 +1116,7 @@ Snow Hydrology submodel (section 7.2). Otherwise, the snow ice mass is updated directly, and :math:`z_{sno}` is adjusted by the same proportion as the snow ice (i.e., maintaining the same density), unless there was no snow before adding the frost, in which case the density is -assumed to be 250 kg m\ :math:`{}^{-3}`. +assumed to be 250 kg m\ :sup:`-3`. Soil Hydrology ^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst new file mode 100644 index 0000000000..6adf6f9db7 --- /dev/null +++ b/doc/source/tech_note/index.rst @@ -0,0 +1,43 @@ +.. on documentation master file, created by + sphinx-quickstart on Tue Jan 31 19:46:36 2017. + You can adapt this file completely to your liking, but it should at least + contain the root`toctree` directive. + +.. _tech_note: + +##################################### +CLM Technical Note +##################################### + +.. toctree:: + :maxdepth: 2 + :numbered: + + CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst + CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst + CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst + CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst + CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst + CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst + CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst + CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst + CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst + CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst + CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst + CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst + CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst + CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst + CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst + CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst + CHAPTER_17/CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst + CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst + CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst + CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst + CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst + CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst + CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst + CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst + CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst + CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst + CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst + diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index 6ad113adc5..7d4408bcc8 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -1,7 +1,7 @@ .. _scientific-validiation: ======================== - Scientific Validiation + Scientific Validation ======================== In this section we go over what has been extensively tested and scientifically validated with CLM4.5, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. From d910ae506c43b1b3ba84cb43e0ce3ef72cdf224a Mon Sep 17 00:00:00 2001 From: mvertens Date: Tue, 28 Mar 2017 11:19:41 -0600 Subject: [PATCH 004/730] added all the html for the tech_note --- .../CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst | 3 +-- .../CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst | 10 +++++----- .../CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst | 9 +++++---- .../CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst b/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst index afffe5fec1..c455e50387 100644 --- a/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst +++ b/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst @@ -235,8 +235,7 @@ The fire spread rate in the downwind direction is represented as u_{p} =u_{\max } C_{m} g(W) - (Arora and Boer, 2005), where :math:`u_{\max }` (m -s\ :sup:`-1`) is the PFT-dependent average maximum fire spread +(Arora and Boer, 2005), where :math:`u_{\max }` (m s\ :sup:`-1`) is the PFT-dependent average maximum fire spread rate in natural vegetation regions; :math:`C_{m}` and :math:`g(W)` represent the dependence of :math:`u_{p}` on fuel wetness and wind speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.55 m diff --git a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst index e4320a9933..da7150bda6 100644 --- a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst +++ b/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst @@ -678,15 +678,15 @@ Table 3.4. Spectral bands and weights used for snow radiative transfer +---------------------------------------------------------+----------------------+------------------+ | Spectral band | Direct-beam weight | Diffuse weight | +=========================================================+======================+==================+ -| Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | +| Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | +---------------------------------------------------------+----------------------+------------------+ -| Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | +| Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | +---------------------------------------------------------+----------------------+------------------+ -| Band 3: 1.0-1.2\ :math:`\mu`\ m (near-IR) | 0.181 | 0.202 | +| Band 3: 1.0-1.2\ :math:`\mu`\ m (near-IR) | 0.181 | 0.202 | +---------------------------------------------------------+----------------------+------------------+ -| Band 4: 1.2-1.5\ :math:`\mu`\ m (near-IR) | 0.121 | 0.109 | +| Band 4: 1.2-1.5\ :math:`\mu`\ m (near-IR) | 0.121 | 0.109 | +---------------------------------------------------------+----------------------+------------------+ -| Band 5: 1.5-5.0\ :math:`\mu`\ m (near-IR) | 0.204 | 0.103 | +| Band 5: 1.5-5.0\ :math:`\mu`\ m (near-IR) | 0.204 | 0.103 | +---------------------------------------------------------+----------------------+------------------+ Under direct-beam conditions, singularities in the radiative diff --git a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst index 20ed6594d2..48fe2dd742 100644 --- a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst +++ b/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst @@ -1730,7 +1730,8 @@ where s_{N_{levsoi} +1} =0.5\left(\frac{\theta _{sat,\, N_{levsoi} } +\theta _{N_{levsoi} } }{\theta _{sat,\, N_{levsoi} } } \right)\qquad 0.01\le s_{N_{levsoi} +1} \le 1, - :math:`\psi _{E,\, N_{levsoi} +1}` is evaluated from equations and , +:math:`\psi _{E,\, N_{levsoi} +1}` is evaluated from equations and , + and .. math:: @@ -1914,7 +1915,7 @@ in water stored in the unconfined aquifer :math:`W_{a}` (mm) is updated as .. math:: - :label: 7.174) + :label: 7.174a) \Delta W_{a}^{} =\left(q_{recharge} -q_{drai} \right)\Delta t @@ -1924,7 +1925,7 @@ layer :math:`N_{levsoi}` . The recharge rate is defined as positive when water enters the aquifer .. math:: - :label: 7.174) + :label: 7.174b) q_{recharge} =\frac{\Delta \theta _{liq,\, N_{levsoi} +1} \Delta z_{N_{levsoi} +1} }{\Delta t} @@ -1935,7 +1936,7 @@ calculated from the solution of the soil water equations (section 7.4), and :math:`\Delta z_{N_{levsoi} +1}` (mm) is .. math:: - :label: 7.174) + :label: 7.174c) \Delta z_{N_{levsoi} +1} =z_{\nabla }^{n} -z_{h,\, N_{levsoi} } . diff --git a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst index 900f8873a9..40cff9b8d8 100644 --- a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst +++ b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst @@ -501,7 +501,7 @@ system is discretized into *N* layers, where N=n_{sno} +N_{levlak} +N_{levgrnd} , - :math:`n_{sno}` is the number of actively modeled snow layers at the +:math:`n_{sno}` is the number of actively modeled snow layers at the current timestep (section 7.2), and :math:`N_{levgrnd}` \ is as for vegetated land units (Chapter 6). Energy is conserved as From 428ad361d85f027c76b8246e457dbec4d54c248f Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 31 Mar 2017 11:57:40 -0600 Subject: [PATCH 005/730] Fixed some latex errors --- .../CLM45_Tech_Note_Chpt_11_RTM.rst | 18 ++++++------- .../CLM45_Tech_Note_Chpt_12_Urban.rst | 2 +- .../CLM45_Tech_Note_Chpt_18_Fire.rst | 27 +++++++++---------- .../CLM45_Tech_Note_Chpt_25_Isotopes.rst | 2 +- .../CLM45_Tech_Note_Chpt_27_References.rst | 2 +- .../CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst | 2 +- .../customizing-the-clm-configuration.rst | 8 +++--- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst index 032589055f..fd0702da94 100644 --- a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst +++ b/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst @@ -23,7 +23,7 @@ cell to its downstream neighboring grid cell. The change in storage cell (m\ :sup:`3` s\ :sup:`-1`) is .. math:: - :label: ZEqnNum723341 + :label: 11.1) \frac{dS}{dt} =\sum F_{in} -F_{out} +R @@ -55,7 +55,7 @@ and channel roughness data are not available globally, so a simplified effective flow velocity expression is used in RTM .. math:: - :label: 11.2) + :label: 11.3) v=\max \left(0.05,k\beta ^{1/2} \right) @@ -66,14 +66,14 @@ The distance :math:`d` between two grid cell centers depends on river direction, latitude, and longitude as .. math:: - :label: 11.3) + :label: 11.4) d=\sqrt{\Delta x^{2} +\Delta y^{2} } . The distance in the zonal direction :math:`\Delta x` (m) is .. math:: - :label: 11.4) + :label: 11.5) \Delta x=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right)\left[0.5\left(\cos \phi _{i,\, j} +\cos \phi _{i*,\, j*} \right)\right] @@ -86,7 +86,7 @@ are grid cell indices. The distance in the meridional direction :math:`\Delta y` (m) is .. math:: - :label: 11.5) + :label: 11.6) \Delta y=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right). @@ -97,7 +97,7 @@ total liquid water runoff at the land model resolution (kg m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 11.6) + :label: 11.7) R_{liq} =q_{over} +q_{drai} +q_{rgwl} @@ -108,14 +108,14 @@ where :math:`q_{over}` is surface runoff (section 7.3), 9.6.3). The total ice water runoff, also at the land model resolution is .. math:: - :label: 11.7) + :label: 11.8) R_{ice} =q_{snwcp,ice} where :math:`q_{snwcp,ice}` is the ice runoff from snow-capped surfaces (section 7.7). The runoff at the land model resolution is interpolated to the resolution of RTM and converted to units of -m\ :sup:`3` s\ :sup:`-1` for use in equation by multiplying +m\ :sup:`3` s\ :sup:`-1` for use in equation (11.1) by multiplying by :math:`1\times 10^{-3} A` where :math:`A` is the area (m\ :sup:`2`) of the RTM grid cell. @@ -132,7 +132,7 @@ as a diagnostic tool. The river-routing scheme conserves water globally as .. math:: - :label: 11.8) + :label: 11.9) \sum _{i,\, j}\left(\frac{dS}{dt} \right) _{i,\, j} =\sum _{i,\, j}R_{i,\, j} . diff --git a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst index 7e78b328d2..b5415474b1 100644 --- a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst +++ b/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst @@ -112,7 +112,7 @@ but are not shown for clarity. Figure 12.2. Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind -(:math:`u_{atm}` ), temperature (**:math:`T_{atm}` **), specific +(:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar (:math:`S_{atm} \, \downarrow` ) and longwave (:math:`L_{atm} \, \downarrow` ) radiation at reference height diff --git a/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst b/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst index c455e50387..df1842bde1 100644 --- a/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst +++ b/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst @@ -27,7 +27,7 @@ where :math:`N_{f}` (count (time step)\ :sup:`-1`) is fire counts in the grid cell; :math:`a` (km:sup:`2`) is average fire spread area of a fire. -18.1.1 Fire counts +Fire counts ^^^^^^^^^^^^^^^^^^ Fire counts :math:`N_{f}` is taken as @@ -176,10 +176,10 @@ influence on fire occurrence for tree PFTs as f_{e} =\left\{\begin{array}{cc} {0.39,} & {GDP\ge 20} \\ {1} & {GDP<20} \end{array}\right. to reproduce that the MODIS fire counts in tree-dominated regions of -GDP\ :math:`\ge 20` k 1995US$ capita\ :sup:`-1` is 39% of that in -other **** tree-dominated regions. +GDP (:math:`\ge 20` k 1995US$ capita\ :sup:`-1` is 39% of that in +other tree-dominated regions. -18.1.2 Average spread area of a fire +Average spread area of a fire ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Fire fighting capacity depends on socioeconomic conditions and affects @@ -235,7 +235,7 @@ The fire spread rate in the downwind direction is represented as u_{p} =u_{\max } C_{m} g(W) -(Arora and Boer, 2005), where :math:`u_{\max }` (m s\ :sup:`-1`) is the PFT-dependent average maximum fire spread +(Arora and Boer, 2005), where :math:`u_{\max }`\ (m s\ :sup:`-1`) is the PFT-dependent average maximum fire spread rate in natural vegetation regions; :math:`C_{m}` and :math:`g(W)` represent the dependence of :math:`u_{p}` on fuel wetness and wind speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.55 m @@ -319,7 +319,7 @@ and Eqs. - reflect that more developed and more densely populated regions have a higher fire fighting capability. -18.1.3 Fire impact +Fire impact ^^^^^^^^^^^^^^^^^^ In post-fire regions, we calculate PFT-level fire carbon emissions from @@ -328,25 +328,25 @@ the *j*\ th PFT, :math:`{\phi}_{j}` (g C (time step)\ :sup:`-1`, as .. math:: :label: 18.26) - \phi _{j} =A_{b,} _{j} C_{j} \bullet CC_{j} + \phi _{j} =A_{b,j} C_{j} \bullet CC_{j} where :math:`A_{b,j}` (km\ :sup:`2`\ (time step)\ :sup:`-1`) is burned area for the *j*\ th PFT; **C**\ :sub:`j` =(*C*\ :sub:`leaf`, *C*\ :sub:`stem`, *C*\ :sub:`root`, *C*\ :sub:`ts`) is a vector with carbon density (g C km\ :sup:`-2`) for leaf, stem (live and dead stem), root (fine, live coarse and dead coarse root), and transfer and storage carbon pools -as elements; **CC**\ :sub:`j` = (*CC*\ :sub:`leaf`, *CC*\ :sub:`stem`, *CC*\ :sub:`root`, *CC*\ sub:`ts`) is the corresponding combustion +as elements; **CC**\ :sub:`j` = (*CC*\ :sub:`leaf`, *CC*\ :sub:`stem`, *CC*\ :sub:`root`, *CC*\ :sub:`ts`) is the corresponding combustion completeness factor vector (Table 18.1). Moreover, we assume that 30% and 20% of column-level litter and coarse woody debris are burned and the corresponding carbon is transferred to atmosphere. Tissue mortality due to fire leads to carbon transfers in two ways. First, carbon from uncombusted leaf, live stem, dead stem, root, and transfer and storage pools -:math:`C^{'} _{j1} =(C_{{\rm leaf}} (1-CC_{{\rm leaf}} ),C_{{\rm livestem}} (1-CC_{{\rm stem}} ),C_{{\rm deadstem}} (1-CC_{{\rm stem}} ),C_{{\rm root}} (1-CC_{{\rm root}} ),C_{{\rm ts}} (1-CC_{{\rm ts}} ))_{j}` +:math:`C^{'} _{j1} =(C_{{\rm leaf}} (1-CC_{{\rm leaf}} ) ,C_{{\rm livestem}} (1-CC_{{\rm stem}} ) ,C_{{\rm deadstem}} (1-CC_{{\rm stem}} ),C_{{\rm root}} (1-CC_{{\rm root}} ),C_{{\rm ts}} (1-CC_{{\rm ts}} )) _{j}` (g C km\ :sup:`-2`) is transferred to litter as .. math:: :label: 18.27) - \Psi _{j1} =\frac{A_{b,} _{j} }{f_{j} A_{g} } C^{'} _{j1} \bullet M_{j1} + \Psi _{j1} =\frac{A_{b,j} }{f_{j} A_{g} } C^{'} _{j1} \bullet M_{j1} where :math:`M_{j1} =(M_{{\rm leaf}} ,M_{{\rm livestem,1}} ,M_{{\rm deadstem}} ,M_{{\rm root}} ,M_{{\rm ts}} )_{j}` @@ -356,7 +356,7 @@ carbon from uncombusted live stems is transferred to dead stems as: .. math:: :label: 18.28) - \Psi _{j2} =\frac{A_{b,} _{j} }{f_{j} A_{g} } C_{livestem} (1-CC_{stem} )M_{livestem,2} + \Psi _{j2} =\frac{A_{b,j} }{f_{j} A_{g} } C_{livestem} (1-CC_{stem} )M_{livestem,2} where :math:`M_{livestem,2}` is the corresponding mortality factor (Table 18.1). @@ -371,7 +371,7 @@ killed by fire per km\ :sup:`2` (individual km\ :sup:`-2` .. math:: :label: 18.29) - P_{disturb,} _{j} =\frac{A_{b,} _{j} }{f_{j} A_{g} } P_{j} \xi _{j} + P_{disturb,j} =\frac{A_{b,j} }{f_{j} A_{g} } P_{j} \xi _{j} where :math:`P_{j}` (individual km\ :sup:`-2`) is the population density for the *j*\ th tree PFT and :math:`\xi _{j}` is the @@ -545,8 +545,7 @@ CLM4.5 version driven by Qian et al. (2006) atmospheric forcing and climatological lightning data to earlier studies: about 2.4 Mha peatland was burned over Indonesia in 1997 (Page et al. 2002) and the average burned area of peat fires in Western Canada was 0.2 Mha -yr\ :sup:`-1` for 1980\ :math:`\math{-}`\ 1999 (Turestky et al. -2004). +yr\ :sup:`-1` for 1980-1999 (Turestky et al. 2004). For tropical peat fires, :math:`f_{cli,p}` is set as a function of long-term precipitation :math:`P_{60d}` : diff --git a/doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst b/doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst index 024b447962..2138ab143a 100644 --- a/doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst +++ b/doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst @@ -93,7 +93,7 @@ This can also be expressed using epsilon notation (:math:`\epsilon`), where \alpha _{A-B} =\frac{\varepsilon _{A-B} }{1000} +1 -In other words, if :math:`{\epsilon }_{A-B} = 4.4{\mathrm{‰}}`, then :math:`{\alpha}_{A-B} =1.0044`. +In other words, if :math:`{\epsilon }_{A-B} = 4.4` ‰ , then :math:`{\alpha}_{A-B} =1.0044`. In addition to the stable isotopes :sup:`1`\ :sup:`2`\ C and :sup:`1`\ :sup:`3`\ C, the unstable isotope :sup:`1`\ :sup:`4`\ C is included in CLM. :sup:`1`\ :sup:`4`\ C can also be described using the delta notation: diff --git a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst index 5b73e1a70a..9a63855c9c 100644 --- a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst +++ b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst @@ -1247,7 +1247,7 @@ Statistics Division. Vallano, D.M. and Sparks, J.P. 2007. Quantifying foliar uptake of gaseous itrogen dioxide using enriched foliar -:math:`\deltaup`\ :math:`{}^{15 }`\ N values. New Phytologist +:math:`\delta^{15}`\ N values. New Phytologist 177:946-955. van der Werf, G.R., Randerson, J.T., Giglio, L., Collatz, G.J., Mu, M., diff --git a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst index 40cff9b8d8..63bf60ba22 100644 --- a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst +++ b/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst @@ -192,7 +192,7 @@ where :math:`\nu _{0} =1.51\times 10^{-5} {\textstyle\frac{{\rm m}^{{\rm 2}} }{{\rm s}}}` , :math:`T_{0} ={\rm 293.15\; K}`, :math:`P_{0} =1.013\times 10^{5} {\rm \; Pa}` , and -:math:`\{P}_{ref}` is the pressure at the atmospheric reference +:math:`P_{ref}` is the pressure at the atmospheric reference height. The Charnock coefficient *C* is a function of the lake fetch *F* (m), given in the surface data or set to 25 times the lake depth *d* by default: diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index ed00d99483..e4cafcf046 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -102,7 +102,7 @@ CLM_NML_USE_CASE glacierMEC_pd = Running an IG case with the ice sheet model glimmer stdurbpt_pd = Standard Urban Point Namelist Settings - .. note::See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + .. note::See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. CLM_BLDNML_OPTS The option CLM_BLDNML_OPTS is for passing options to the CLM "build-namelist" script. @@ -343,7 +343,7 @@ When "-irrig" is used **build-namelist** will try to find surface datasets that For a list of the history fields available see `CLM History Fields `_. - .. note: See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + .. note::See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. ``CLM_FORCE_COLDSTART`` when set to on, *requires* that your simulation do a cold start from arbitrary initial conditions. If this is NOT set, it will use an initial condition file if it can find an appropriate one, and otherwise do a cold start. ``CLM_FORCE_COLDSTART`` is a good way to ensure that you are doing a cold start if that is what you want to do. @@ -360,7 +360,7 @@ When "-irrig" is used **build-namelist** will try to find surface datasets that An example of using ``CLM_USRDAT_NAME`` for a simulation is given in `Example 5-4 `_. - .. note:: See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. + .. note: See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. ``CLM_CO2_TYPE`` sets the type of input CO2 for either "constant", "diagnostic" or prognostic". @@ -421,7 +421,7 @@ Example: user_nl_clm namelist file **Note:** The comments at the top are some guidance given in the default user_nl_clm and just give some guidance on how to set variables and use the file. -**Note:** See the `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. +**Note:** See `the Section called Precedence of Options `_ section for the precedence of this option relative to the others. **Note:** You do NOT need to specify the namelist group that the variables are in because the CLM **build-namelist** knows the namelist that specific variable names belong to, and it puts them there. From 5118ba09dafd6cead0ed3be06bd5f664d21cdc08 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 7 Apr 2017 16:35:03 -0600 Subject: [PATCH 006/730] Testing change to Chapter 1 --- .../tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst index bb9b012bdc..6c2db760a5 100644 --- a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst +++ b/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst @@ -4,7 +4,7 @@ **July 2013** -**Technical Description of version 4.5 of the Community Land Model +**Technical Description of version 5.0 of the Community Land Model (CLM)** ***Coordinating Lead Authors*** From 0ec3302fa4be700af496e2ea3fb4f18d22d5d383 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 10 Apr 2017 10:18:06 -0600 Subject: [PATCH 007/730] Test of Chapter 1 rename --- ...Introduction.rst => CLM50_Tech_Note_Chpt_1_Introduction.rst} | 0 doc/source/tech_note/index.rst | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename doc/source/tech_note/CHAPTER_1/{CLM45_Tech_Note_Chpt_1_Introduction.rst => CLM50_Tech_Note_Chpt_1_Introduction.rst} (100%) diff --git a/doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst rename to doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 6adf6f9db7..a6d675ffed 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -13,7 +13,7 @@ CLM Technical Note :maxdepth: 2 :numbered: - CHAPTER_1/CLM45_Tech_Note_Chpt_1_Introduction.rst + CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst From b7a0c619d0f4387d24b1c992f680fa76a055f82b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 10 Apr 2017 15:49:20 -0600 Subject: [PATCH 008/730] 3rd Test of Chapter 1 rename --- .../tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst | 2 +- .../tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst index 6c2db760a5..7074842c5b 100644 --- a/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst +++ b/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst @@ -281,7 +281,7 @@ The purpose of this technical note is to describe the biogeophysical and biogeochemical parameterizations and numerical implementation of version 4.5 of the Community Land Model (CLM4.5). Scientific justification and evaluation of these parameterizations can be found in the referenced -scientific papers (Chapter 27). This technical note and the CLM4.5 +scientific papers (:ref:`rst_References`). This technical note and the CLM4.5 User’s Guide together provide the user with the scientific description and operating instructions for CLM. diff --git a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst index 9a63855c9c..b953d98b3d 100644 --- a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst +++ b/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst @@ -1,3 +1,5 @@ +.. _rst_References: + References ============== From f5e4f1304b0bad4976d34f5c44193996e30956bc Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 10 Apr 2017 16:15:30 -0600 Subject: [PATCH 009/730] 1st Test of Chapter 2 rename --- ..._Chpt_2_Ecosystem.rst => CLM50_Tech_Note_Chpt_2_Ecosystem.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/source/tech_note/CHAPTER_2/{CLM45_Tech_Note_Chpt_2_Ecosystem.rst => CLM50_Tech_Note_Chpt_2_Ecosystem.rst} (100%) diff --git a/doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst b/doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst rename to doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst From 00425245d755df802c3195b4929ae7ecb1a2fa75 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 10 Apr 2017 16:45:31 -0600 Subject: [PATCH 010/730] 2nd Test of Chapter 2 rename --- doc/source/tech_note/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index a6d675ffed..1848b3d8d5 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -14,7 +14,7 @@ CLM Technical Note :numbered: CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst - CHAPTER_2/CLM45_Tech_Note_Chpt_2_Ecosystem.rst + CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst From c81e2d64e67c2fbfa1cd2f736e7551e3e2f00eca Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 11 Apr 2017 09:45:38 -0600 Subject: [PATCH 011/730] Change chapter titles to CLM50 --- ...st => CLM50_Tech_Note_Chpt_10_Glacier.rst} | 0 ...TM.rst => CLM50_Tech_Note_Chpt_11_RTM.rst} | 0 ....rst => CLM50_Tech_Note_Chpt_12_Urban.rst} | 0 ...ote_Chpt_13_CN_Allocation_Respiration.rst} | 0 ...ech_Note_Chpt_14_Vegetation_Phenology.rst} | 0 ...CLM50_Tech_Note_Chpt_15_Decomposition.rst} | 0 ..._Note_Chpt_16_External_Nitrogen_Cycle.rst} | 0 ...M50_Tech_Note_Chpt_17_Plant_Mortality.rst} | 0 ...e.rst => CLM50_Tech_Note_Chpt_18_Fire.rst} | 0 ...st => CLM50_Tech_Note_Chpt_19_Methane.rst} | 0 ...M50_Tech_Note_Chpt_20_Crop_Irrigation.rst} | 0 ...Tech_Note_Chpt_21_Transient_Landcover.rst} | 0 ...M.rst => CLM50_Tech_Note_Chpt_22_DGVM.rst} | 0 ....rst => CLM50_Tech_Note_Chpt_23_BVOCs.rst} | 0 ...t.rst => CLM50_Tech_Note_Chpt_24_Dust.rst} | 0 ...t => CLM50_Tech_Note_Chpt_25_Isotopes.rst} | 0 ...st => CLM50_Tech_Note_Chpt_26_Offline.rst} | 0 ...=> CLM50_Tech_Note_Chpt_27_References.rst} | 0 ...LM50_Tech_Note_Chpt_3_Surface_Albedos.rst} | 0 ...M50_Tech_Note_Chpt_4_Radiative_Fluxes.rst} | 0 ....rst => CLM50_Tech_Note_Chpt_5_Fluxes.rst} | 0 ...ch_Note_Chpt_6_Soil_Snow_Temperatures.rst} | 0 ...t => CLM50_Tech_Note_Chpt_7_Hydrology.rst} | 0 ...CLM50_Tech_Note_Chpt_8_Photosynthesis.rst} | 0 ...ke.rst => CLM50_Tech_Note_Chpt_9_Lake.rst} | 0 doc/source/tech_note/index.rst | 50 +++++++++---------- 26 files changed, 25 insertions(+), 25 deletions(-) rename doc/source/tech_note/CHAPTER_10/{CLM45_Tech_Note_Chpt_10_Glacier.rst => CLM50_Tech_Note_Chpt_10_Glacier.rst} (100%) rename doc/source/tech_note/CHAPTER_11/{CLM45_Tech_Note_Chpt_11_RTM.rst => CLM50_Tech_Note_Chpt_11_RTM.rst} (100%) rename doc/source/tech_note/CHAPTER_12/{CLM45_Tech_Note_Chpt_12_Urban.rst => CLM50_Tech_Note_Chpt_12_Urban.rst} (100%) rename doc/source/tech_note/CHAPTER_13/{CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst => CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst} (100%) rename doc/source/tech_note/CHAPTER_14/{CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst => CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst} (100%) rename doc/source/tech_note/CHAPTER_15/{CLM45_Tech_Note_Chpt_15_Decomposition.rst => CLM50_Tech_Note_Chpt_15_Decomposition.rst} (100%) rename doc/source/tech_note/CHAPTER_16/{CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst => CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst} (100%) rename doc/source/tech_note/CHAPTER_17/{CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst => CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst} (100%) rename doc/source/tech_note/CHAPTER_18/{CLM45_Tech_Note_Chpt_18_Fire.rst => CLM50_Tech_Note_Chpt_18_Fire.rst} (100%) rename doc/source/tech_note/CHAPTER_19/{CLM45_Tech_Note_Chpt_19_Methane.rst => CLM50_Tech_Note_Chpt_19_Methane.rst} (100%) rename doc/source/tech_note/CHAPTER_20/{CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst => CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst} (100%) rename doc/source/tech_note/CHAPTER_21/{CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst => CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst} (100%) rename doc/source/tech_note/CHAPTER_22/{CLM45_Tech_Note_Chpt_22_DGVM.rst => CLM50_Tech_Note_Chpt_22_DGVM.rst} (100%) rename doc/source/tech_note/CHAPTER_23/{CLM45_Tech_Note_Chpt_23_BVOCs.rst => CLM50_Tech_Note_Chpt_23_BVOCs.rst} (100%) rename doc/source/tech_note/CHAPTER_24/{CLM45_Tech_Note_Chpt_24_Dust.rst => CLM50_Tech_Note_Chpt_24_Dust.rst} (100%) rename doc/source/tech_note/CHAPTER_25/{CLM45_Tech_Note_Chpt_25_Isotopes.rst => CLM50_Tech_Note_Chpt_25_Isotopes.rst} (100%) rename doc/source/tech_note/CHAPTER_26/{CLM45_Tech_Note_Chpt_26_Offline.rst => CLM50_Tech_Note_Chpt_26_Offline.rst} (100%) rename doc/source/tech_note/CHAPTER_27/{CLM45_Tech_Note_Chpt_27_References.rst => CLM50_Tech_Note_Chpt_27_References.rst} (100%) rename doc/source/tech_note/CHAPTER_3/{CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst => CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst} (100%) rename doc/source/tech_note/CHAPTER_4/{CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst => CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst} (100%) rename doc/source/tech_note/CHAPTER_5/{CLM45_Tech_Note_Chpt_5_Fluxes.rst => CLM50_Tech_Note_Chpt_5_Fluxes.rst} (100%) rename doc/source/tech_note/CHAPTER_6/{CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst => CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst} (100%) rename doc/source/tech_note/CHAPTER_7/{CLM45_Tech_Note_Chpt_7_Hydrology.rst => CLM50_Tech_Note_Chpt_7_Hydrology.rst} (100%) rename doc/source/tech_note/CHAPTER_8/{CLM45_Tech_Note_Chpt_8_Photosynthesis.rst => CLM50_Tech_Note_Chpt_8_Photosynthesis.rst} (100%) rename doc/source/tech_note/CHAPTER_9/{CLM45_Tech_Note_Chpt_9_Lake.rst => CLM50_Tech_Note_Chpt_9_Lake.rst} (100%) diff --git a/doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst b/doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst rename to doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst diff --git a/doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst rename to doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst diff --git a/doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst b/doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst rename to doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst diff --git a/doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst b/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst rename to doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst diff --git a/doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst b/doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst rename to doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst diff --git a/doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst b/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst rename to doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst diff --git a/doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst b/doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst rename to doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst diff --git a/doc/source/tech_note/CHAPTER_17/CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst b/doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_17/CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst rename to doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst diff --git a/doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst b/doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst rename to doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst diff --git a/doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst b/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst rename to doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst diff --git a/doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst b/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst rename to doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst diff --git a/doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst b/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst rename to doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst diff --git a/doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst b/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst rename to doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst diff --git a/doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst b/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst rename to doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst diff --git a/doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst b/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst rename to doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst diff --git a/doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst b/doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst rename to doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst diff --git a/doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst b/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst rename to doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst diff --git a/doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst rename to doc/source/tech_note/CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst diff --git a/doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst rename to doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst diff --git a/doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst b/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst rename to doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst diff --git a/doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst b/doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst rename to doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst diff --git a/doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst b/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst rename to doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst diff --git a/doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst b/doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst rename to doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst diff --git a/doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst b/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst rename to doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst diff --git a/doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst b/doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst rename to doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 1848b3d8d5..4141a560bc 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -15,29 +15,29 @@ CLM Technical Note CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst - CHAPTER_3/CLM45_Tech_Note_Chpt_3_Surface_Albedos.rst - CHAPTER_4/CLM45_Tech_Note_Chpt_4_Radiative_Fluxes.rst - CHAPTER_5/CLM45_Tech_Note_Chpt_5_Fluxes.rst - CHAPTER_6/CLM45_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst - CHAPTER_7/CLM45_Tech_Note_Chpt_7_Hydrology.rst - CHAPTER_8/CLM45_Tech_Note_Chpt_8_Photosynthesis.rst - CHAPTER_9/CLM45_Tech_Note_Chpt_9_Lake.rst - CHAPTER_10/CLM45_Tech_Note_Chpt_10_Glacier.rst - CHAPTER_11/CLM45_Tech_Note_Chpt_11_RTM.rst - CHAPTER_12/CLM45_Tech_Note_Chpt_12_Urban.rst - CHAPTER_13/CLM45_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst - CHAPTER_14/CLM45_Tech_Note_Chpt_14_Vegetation_Phenology.rst - CHAPTER_15/CLM45_Tech_Note_Chpt_15_Decomposition.rst - CHAPTER_16/CLM45_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst - CHAPTER_17/CLM45_Tech_Note_Chpt_17_Plant_Mortality.rst - CHAPTER_18/CLM45_Tech_Note_Chpt_18_Fire.rst - CHAPTER_19/CLM45_Tech_Note_Chpt_19_Methane.rst - CHAPTER_20/CLM45_Tech_Note_Chpt_20_Crop_Irrigation.rst - CHAPTER_21/CLM45_Tech_Note_Chpt_21_Transient_Landcover.rst - CHAPTER_22/CLM45_Tech_Note_Chpt_22_DGVM.rst - CHAPTER_23/CLM45_Tech_Note_Chpt_23_BVOCs.rst - CHAPTER_24/CLM45_Tech_Note_Chpt_24_Dust.rst - CHAPTER_25/CLM45_Tech_Note_Chpt_25_Isotopes.rst - CHAPTER_26/CLM45_Tech_Note_Chpt_26_Offline.rst - CHAPTER_27/CLM45_Tech_Note_Chpt_27_References.rst + CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst + CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst + CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst + CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst + CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst + CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst + CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst + CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst + CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst + CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst + CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst + CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst + CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst + CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst + CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst + CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst + CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst + CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst + CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst + CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst + CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst + CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst + CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst + CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst + CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst From 5f3c4fa68feb3b8f588c2d442962de72d5c5a556 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 11 Apr 2017 11:46:31 -0600 Subject: [PATCH 012/730] Add links to chapters --- .../CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst | 5 +++-- .../tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst | 2 ++ .../tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst | 2 ++ .../tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst | 2 ++ .../CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst | 2 ++ .../CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst | 2 ++ .../CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst | 2 ++ .../CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst | 2 ++ .../CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst | 2 ++ .../tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst | 2 ++ .../tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst | 2 ++ .../tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst | 1 + .../CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst | 2 ++ .../CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst | 2 ++ .../tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst | 2 ++ .../tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst | 2 ++ .../tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst | 2 ++ .../CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst | 2 ++ .../tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst | 2 ++ .../CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst | 2 ++ .../CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst | 2 ++ .../tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst | 2 ++ .../CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst | 2 ++ .../tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst | 2 ++ .../CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst | 2 ++ .../tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst | 2 ++ 26 files changed, 52 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst b/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst index 7074842c5b..2a5ba1d3ae 100644 --- a/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst +++ b/doc/source/tech_note/CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst @@ -273,8 +273,9 @@ National Laboratory); A. Bozbiyik (Bern University); C. Heald National Laboratory); Ying Sun and Z.-L. Yang (University of Texas at Austin) -================= - 1. Introduction +.. _rst_Introduction: + +Introduction ================= The purpose of this technical note is to describe the biogeophysical and diff --git a/doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst b/doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst index 9bd3e1e11d..6ba68086db 100644 --- a/doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst +++ b/doc/source/tech_note/CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst @@ -1,3 +1,5 @@ +.. _rst_Glaciers: + Glaciers ============ diff --git a/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst index fd0702da94..9568b91b16 100644 --- a/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst +++ b/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst @@ -1,3 +1,5 @@ +.. _rst_River Transport Model (RTM): + River Transport Model (RTM) =============================== diff --git a/doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst b/doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst index b5415474b1..b95589f7b4 100644 --- a/doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst +++ b/doc/source/tech_note/CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst @@ -1,3 +1,5 @@ +.. _rst_Urban Model (CLMU): + Urban Model (CLMU) ====================== diff --git a/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst b/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst index a4173834b5..4512d906c4 100644 --- a/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst +++ b/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst @@ -1,3 +1,5 @@ +.. _rst_Carbon and Nitrogen Pools, Allocation, and Respiration: + Carbon and Nitrogen Pools, Allocation, and Respiration ========================================================== diff --git a/doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst b/doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst index 305e532552..df022465a8 100644 --- a/doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst +++ b/doc/source/tech_note/CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst @@ -1,3 +1,5 @@ +.. _rst_Vegetation Phenology: + Vegetation Phenology ======================== diff --git a/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst b/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst index 89e12a7b94..34a71b2b24 100644 --- a/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst +++ b/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst @@ -1,3 +1,5 @@ +.. _rst_Decomposition: + Decomposition ================= diff --git a/doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst b/doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst index 07bb1567f9..20d76e38ad 100644 --- a/doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst @@ -1,3 +1,5 @@ +.. _rst_External Nitrogen Cycle: + External Nitrogen Cycle =========================== diff --git a/doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst b/doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst index 348c0a3649..ba880609bf 100644 --- a/doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst +++ b/doc/source/tech_note/CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst @@ -1,3 +1,5 @@ +.. _rst_Plant Mortality: + Plant Mortality =================== diff --git a/doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst b/doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst index df1842bde1..f2236018f6 100644 --- a/doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst +++ b/doc/source/tech_note/CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst @@ -1,3 +1,5 @@ +.. _rst_Fire: + Fire ======== diff --git a/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst b/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst index 7bdea2fefb..fc71c600dd 100644 --- a/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst +++ b/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst @@ -1,3 +1,5 @@ +.. _rst_Methane Model: + Methane Model ================= diff --git a/doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst b/doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst index d19fdd3f5d..888c379382 100644 --- a/doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst +++ b/doc/source/tech_note/CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst @@ -1,3 +1,4 @@ +.. _rst_Surface Characterization and Model Input Requirements: Surface Characterization and Model Input Requirements ======================================================== diff --git a/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst b/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst index 570028bc8b..9d2aeb71f4 100644 --- a/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst +++ b/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst @@ -1,3 +1,5 @@ +.. _rst_Crops and Irrigation: + Crops and Irrigation ======================== diff --git a/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst b/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst index 661b1f2e6e..d967dae888 100644 --- a/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst +++ b/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst @@ -1,3 +1,5 @@ +.. _rst_Transient Landcover Change: + Transient Landcover Change ============================== diff --git a/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst b/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst index 0ee97d23e3..4a7d378379 100644 --- a/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst +++ b/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst @@ -1,3 +1,5 @@ +.. _rst_Dynamic Global Vegetation Model: + Dynamic Global Vegetation Model =================================== diff --git a/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst b/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst index f5f23f8644..bd8259e57c 100644 --- a/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst +++ b/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst @@ -1,3 +1,5 @@ +.. _rst_Biogenic Volatile Organic Compounds (BVOCs): + Biogenic Volatile Organic Compounds (BVOCs) =============================================== diff --git a/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst b/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst index 92dcefad3e..8126f09774 100644 --- a/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst +++ b/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst @@ -1,3 +1,5 @@ +.. _rst_Dust Model: + Dust Model ============== diff --git a/doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst b/doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst index 2138ab143a..acb4cf595d 100644 --- a/doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst +++ b/doc/source/tech_note/CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst @@ -1,3 +1,5 @@ +.. _rst_Carbon Isotopes: + Carbon Isotopes =================== diff --git a/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst b/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst index c6a78b34d9..db2b04d5cf 100644 --- a/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst +++ b/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst @@ -1,3 +1,5 @@ +.. _rst_Offline Mode: + Offline Mode ================ diff --git a/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst index da7150bda6..039691c090 100644 --- a/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst +++ b/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst @@ -1,3 +1,5 @@ +.. _rst_Surface Albedos: + Surface Albedos ================== diff --git a/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst b/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst index 64506d1032..741801942d 100644 --- a/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst +++ b/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst @@ -1,3 +1,5 @@ +.. _rst_Radiative Fluxes: + Radiative Fluxes =================== diff --git a/doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst b/doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst index 81c25ee0e8..2d2eb57337 100644 --- a/doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst +++ b/doc/source/tech_note/CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst @@ -1,3 +1,5 @@ +.. _rst_Momentum, Sensible Heat, and Latent Heat Fluxes: + Momentum, Sensible Heat, and Latent Heat Fluxes ================================================== diff --git a/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst b/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst index 83dc1e3579..002aac2b0d 100644 --- a/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst @@ -1,3 +1,5 @@ +.. _rst_Soil and Snow Temperatures: + Soil and Snow Temperatures ============================= diff --git a/doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst b/doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst index 48fe2dd742..59751de56c 100644 --- a/doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst +++ b/doc/source/tech_note/CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst @@ -1,3 +1,5 @@ +.. _rst_Hydrology: + Hydrology ============ diff --git a/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst b/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst index 6cd61d641c..c380f0d75a 100644 --- a/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst +++ b/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst @@ -1,3 +1,5 @@ +.. _rst_Stomatal Resistance and Photosynthesis: + Stomatal Resistance and Photosynthesis ========================================= diff --git a/doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst b/doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst index 63bf60ba22..1356ca27a9 100644 --- a/doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst +++ b/doc/source/tech_note/CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst @@ -1,3 +1,5 @@ +.. _rst_Lake Model: + Lake Model ============= From 8efdfff444c171833356f3702b701b1a61f83ea8 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 12 Apr 2017 08:00:40 -0600 Subject: [PATCH 013/730] Rename chapters --- .../CLM50_Tech_Note_BVOCs.rst} | 2 +- .../CLM50_Tech_Note_CN_Allocation.rst} | 98 +-- .../CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 4 + .../CLM50_Tech_Note_Crop_Irrigation.rst} | 24 +- .../CLM50_Tech_Note_DGVM.rst} | 0 .../CLM50_Tech_Note_Decomposition.rst} | 114 ++-- .../CLM50_Tech_Note_Dust.rst} | 20 +- .../CLM50_Tech_Note_Ecosystem.rst} | 0 ...M50_Tech_Note_External_Nitrogen_Cycle.rst} | 36 +- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 4 + .../CLM50_Tech_Note_Fire.rst} | 64 +- .../CLM50_Tech_Note_Fluxes.rst} | 0 .../CLM50_Tech_Note_Glacier.rst} | 0 .../CLM50_Tech_Note_Hydrology.rst} | 0 .../CLM50_Tech_Note_Introduction.rst} | 0 .../CLM50_Tech_Note_Isotopes.rst} | 20 +- .../CLM50_Tech_Note_Lake.rst} | 84 +-- .../CLM50_Tech_Note_Methane.rst} | 26 +- .../CLM50_Tech_Note_Offline.rst} | 26 +- .../CLM50_Tech_Note_Photosynthesis.rst} | 58 +- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 4 + ...CLM50_Tech_Note_Plant_Hydraulic_Stress.rst | 4 + .../CLM50_Tech_Note_Plant_Mortality.rst} | 172 ++--- .../CLM50_Tech_Note_Plant_Respiration.rst | 601 ++++++++++++++++++ .../CLM50_Tech_Note_RTM.rst} | 18 +- .../CLM50_Tech_Note_Radiative_Fluxes.rst} | 0 .../CLM50_Tech_Note_References.rst} | 0 .../CLM50_Tech_Note_Snow_Hydrology.rst | 4 + ...LM50_Tech_Note_Soil_Snow_Temperatures.rst} | 0 .../CLM50_Tech_Note_Surface_Albedos.rst} | 0 .../CLM50_Tech_Note_Transient_Landcover.rst} | 14 +- .../CLM50_Tech_Note_Urban.rst} | 0 ...ch_Note_Vegetation_Phenology_Turnover.rst} | 184 +++--- doc/source/tech_note/index.rst | 59 +- 34 files changed, 1133 insertions(+), 507 deletions(-) rename doc/source/tech_note/{CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst => BVOCs/CLM50_Tech_Note_BVOCs.rst} (99%) rename doc/source/tech_note/{CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst => CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst} (96%) create mode 100644 doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst rename doc/source/tech_note/{CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst => Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst} (99%) rename doc/source/tech_note/{CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst => DGVM/CLM50_Tech_Note_DGVM.rst} (100%) rename doc/source/tech_note/{CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst => Decomposition/CLM50_Tech_Note_Decomposition.rst} (97%) rename doc/source/tech_note/{CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst => Dust/CLM50_Tech_Note_Dust.rst} (98%) rename doc/source/tech_note/{CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst => Ecosystem/CLM50_Tech_Note_Ecosystem.rst} (100%) rename doc/source/tech_note/{CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst => External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst} (98%) create mode 100644 doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst rename doc/source/tech_note/{CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst => Fire/CLM50_Tech_Note_Fire.rst} (98%) rename doc/source/tech_note/{CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst => Fluxes/CLM50_Tech_Note_Fluxes.rst} (100%) rename doc/source/tech_note/{CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst => Glacier/CLM50_Tech_Note_Glacier.rst} (100%) rename doc/source/tech_note/{CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst => Hydrology/CLM50_Tech_Note_Hydrology.rst} (100%) rename doc/source/tech_note/{CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst => Introduction/CLM50_Tech_Note_Introduction.rst} (100%) rename doc/source/tech_note/{CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst => Isotopes/CLM50_Tech_Note_Isotopes.rst} (98%) rename doc/source/tech_note/{CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst => Lake/CLM50_Tech_Note_Lake.rst} (98%) rename doc/source/tech_note/{CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst => Methane/CLM50_Tech_Note_Methane.rst} (99%) rename doc/source/tech_note/{CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst => Offline/CLM50_Tech_Note_Offline.rst} (97%) rename doc/source/tech_note/{CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst => Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst} (98%) create mode 100644 doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst create mode 100644 doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst rename doc/source/tech_note/{CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst => Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst} (86%) create mode 100644 doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst rename doc/source/tech_note/{CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst => RTM/CLM50_Tech_Note_RTM.rst} (97%) rename doc/source/tech_note/{CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst => Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst} (100%) rename doc/source/tech_note/{CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst => References/CLM50_Tech_Note_References.rst} (100%) create mode 100644 doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst rename doc/source/tech_note/{CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst => Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst} (100%) rename doc/source/tech_note/{CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst => Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst} (100%) rename doc/source/tech_note/{CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst => Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst} (99%) rename doc/source/tech_note/{CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst => Urban/CLM50_Tech_Note_Urban.rst} (100%) rename doc/source/tech_note/{CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst => Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst} (94%) diff --git a/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst similarity index 99% rename from doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst rename to doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst index bd8259e57c..8c5737f171 100644 --- a/doc/source/tech_note/CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst +++ b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst @@ -50,7 +50,7 @@ some monoterpenes, VOCs and acetone). The activity factor for the light response of emissions is therefore estimated as: .. math:: - :label: 23.2) + :label: 28.2) \gamma _{P,\, i} =\left(1-LDF_{i} \right)+\gamma _{P\_ LDF} LDF_{i} diff --git a/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst similarity index 96% rename from doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst rename to doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 4512d906c4..c6a6fa4aa0 100644 --- a/doc/source/tech_note/CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -1,7 +1,7 @@ -.. _rst_Carbon and Nitrogen Pools, Allocation, and Respiration: +.. _rst_CN Allocation: -Carbon and Nitrogen Pools, Allocation, and Respiration -========================================================== +Carbon and Nitrogen Allocation +============================== Introduction ----------------- @@ -76,17 +76,17 @@ photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: 13.1) + :label: 19.1) CF_{mr} =CF_{GPP,mr} +CF_{xs,mr} .. math:: - :label: 13.2) + :label: 19.2) CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. .. math:: - :label: 13.3) + :label: 19.3) CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. @@ -110,12 +110,12 @@ flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC m\ :sup:`-2` s\ :sup:`-1`) is given as .. math:: - :label: 13.4) + :label: 19.4) CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. .. math:: - :label: 13.5) + :label: 19.5) CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. @@ -136,7 +136,7 @@ remaining carbon flux from photosynthesis which can be allocated to new growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 13.6) + :label: 19.6) CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . @@ -162,7 +162,7 @@ ratio for carbon allocation between new stem and new leaf increases with increasing net primary production (NPP), as .. math:: - :label: 13.8) + :label: 19.8) a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 @@ -252,12 +252,12 @@ m\ :sup:`-2` s\ :sup:`-1`): where .. math:: - :label: 13.11) + :label: 19.11) \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} .. math:: - :label: 13.12) + :label: 19.12) N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. @@ -268,7 +268,7 @@ plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) as: .. math:: - :label: 13.13) + :label: 19.13) NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . @@ -287,7 +287,7 @@ availability of nitrogen from this pool to support new growth s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: .. math:: - :label: 13.14) + :label: 19.14) NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) @@ -313,7 +313,7 @@ m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant demand for new nitrogen: .. math:: - :label: 13.15) + :label: 19.15) NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) @@ -340,7 +340,7 @@ mineral nitrogen supply and competition with heterotrophs. Plant uptake from the soil mineral nitrogen pool is then given as: .. math:: - :label: 13.17) + :label: 19.17) NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} @@ -350,7 +350,7 @@ Final carbon and nitrogen allocation The total flux of allocated nitrogen is given as: .. math:: - :label: 13.18) + :label: 19.18) NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} @@ -358,14 +358,14 @@ From the stoichiometric relationship in Eq. , the associated carbon allocation flux is: .. math:: - :label: 13.19) + :label: 19.19) CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . The downregulation of photosynthesis can then be calculated as: .. math:: - :label: 13.20) + :label: 19.20) f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . @@ -373,7 +373,7 @@ Total allocation to new leaf carbon (:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: .. math:: - :label: 13.21) + :label: 19.21) CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . @@ -389,124 +389,124 @@ storage pools (where storage is indicated with *\_stor*) for the various tissue types are given as: .. math:: - :label: 13.22) + :label: 19.22) CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} .. math:: - :label: 13.23) + :label: 19.23) CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) .. math:: - :label: 13.24) + :label: 19.24) CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} .. math:: - :label: 13.25) + :label: 19.25) CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) .. math:: - :label: 13.26) + :label: 19.26) CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} .. math:: - :label: 13.27) + :label: 19.27) CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 13.28) + :label: 19.28) CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 13.29) + :label: 19.29) CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) .. math:: - :label: 13.30) + :label: 19.30) CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} .. math:: - :label: 13.31) + :label: 19.31) CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 13.32) + :label: 19.32) CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 13.33) + :label: 19.33) CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). The corresponding nitrogen allocation fluxes are given as: .. math:: - :label: 13.34) + :label: 19.34) NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} .. math:: - :label: 13.35) + :label: 19.35) NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) .. math:: - :label: 13.36) + :label: 19.36) NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} .. math:: - :label: 13.37) + :label: 19.37) NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) .. math:: - :label: 13.38) + :label: 19.38) NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 13.39) + :label: 19.39) NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 13.40) + :label: 19.40) NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 13.41) + :label: 19.41) NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) .. math:: - :label: 13.42) + :label: 19.42) NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 13.43) + :label: 19.43) NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 13.44) + :label: 19.44) NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 13.45) + :label: 19.45) NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). @@ -530,22 +530,22 @@ functions tissue nitrogen content and the relevant temperature, following the empirical relationship reported by Ryan (1991): .. math:: - :label: 13.46) + :label: 19.46) CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 13.47) + :label: 19.47) CF_{mr\_ livestem} \_ =NS_{livestem} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 13.48) + :label: 19.48) CF_{mr\_ livecroot} \_ =NS_{livecroot} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 13.49) + :label: 19.49) CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} @@ -568,7 +568,7 @@ common base maintenance respiration rate for all live tissue types. The total maintenance respiration cost is then given as: .. math:: - :label: 13.50) + :label: 19.50) CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst new file mode 100644 index 0000000000..92903f02e0 --- /dev/null +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -0,0 +1,4 @@ +.. _rst_CN Pools: + +CN Pools +=================== diff --git a/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst similarity index 99% rename from doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst rename to doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 9d2aeb71f4..80cd1e3527 100644 --- a/doc/source/tech_note/CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -155,7 +155,7 @@ for the crop to reach vegetative and physiological maturity, :math:`{GDD}_{mat}`, according to the following AgroIBIS rules: .. math:: - :label: 20.2) + :label: 25.2) \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950}30} \end{array}\right\} .. math:: - :label: 20.13) + :label: 25.13) fxg=\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad \qquad {\rm for\; }GDD_{T_{2m} } \le 0.15} \\ {6.67\times GDD_{T_{2m} } -1\qquad \qquad \qquad {\rm for\; }0.150.75} \end{array}\right\} @@ -646,17 +646,17 @@ mobilized depends on the C:N ratio of the plant tissue, and is calculated as .. math:: - :label: 20.14) + :label: 25.14) leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } .. math:: - :label: 20.15) + :label: 25.15) stemn\_ to\_ retransn=\frac{c_{stem} }{CN_{stem} } -\frac{c_{stem} }{CN_{stem}^{f} } .. math:: - :label: 20.16) + :label: 25.16) frootn\_ to\_ retransn=\frac{c_{froot} }{CN_{froot} } -\frac{c_{froot} }{CN_{froot}^{f} } diff --git a/doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst rename to doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst diff --git a/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst similarity index 97% rename from doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst rename to doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 34a71b2b24..4686f649c2 100644 --- a/doc/source/tech_note/CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -29,7 +29,7 @@ For the single-level model structure, the fundamental equation for carbon balance of the decomposing pools is: .. math:: - :label: 15.1) + :label: 21.1) \frac{\partial C_{i} }{\partial t} =R_{i} +\sum _{j\ne i}\left(i-r_{j} \right)T_{ji} k_{j} C_{j} -k_{i} C_{i} @@ -44,7 +44,7 @@ Adding the vertical dimension to the decomposing pools changes the balance equation to the following: .. math:: - :label: 15.2) + :label: 21.2) \begin{array}{l} {\frac{\partial C_{i} (z)}{\partial t} =R_{i} (z)+\sum _{i\ne j}\left(1-r_{j} \right)T_{ji} k_{j} (z)C_{j} (z) -k_{i} (z)C_{i} (z)} \\ {+\frac{\partial }{\partial z} \left(D(z)\frac{\partial C_{i} }{\partial z} \right)+\frac{\partial }{\partial z} \left(A(z)C_{i} \right)} \end{array} @@ -245,7 +245,7 @@ The Temperature scalar :math:`{r}_{tsoil}` is calculated in CLM using a :math:`{Q}_{10}` approach, with :math:`{Q}_{10} = 1.5`. .. math:: - :label: 15.5) + :label: 21.5) r_{tsoil} =Q_{10} ^{\left(\frac{T_{soil,\, j} -T_{ref} }{10} \right)} @@ -257,7 +257,7 @@ unitless) is calculated using a relationship from Andrén and Paustian (1987) and supported by additional data in Orchard and Cook (1983): .. math:: - :label: 15.6) + :label: 21.6) r_{water} =\sum _{j=1}^{5}\left\{\begin{array}{l} {0\qquad {\rm for\; }\Psi _{j} <\Psi _{\min } } \\ {\frac{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{j} }} \right. \kern-\nulldelimiterspace} \Psi _{j} } \right)}{\log \left({\Psi _{\min } \mathord{\left/ {\vphantom {\Psi _{\min } \Psi _{\max } }} \right. \kern-\nulldelimiterspace} \Psi _{\max } } \right)} w_{soil,\, j} \qquad {\rm for\; }\Psi _{\min } \le \Psi _{j} \le \Psi _{\max } } \\ {1\qquad {\rm for\; }\Psi _{j} >\Psi _{\max } \qquad \qquad } \end{array}\right\} @@ -268,7 +268,7 @@ water potential control on decomposition rate (set to -10 MPa). potential, calculated using the multivariate regression model from Cosby et al. (1984): .. math:: - :label: 15.7) + :label: 21.7) \Psi _{sat,\, j} =-\left(9.8e-5\right)\exp \left(\left(1.54-0.0095P_{sand,\, j} +0.0063\left(100-P_{sand,\, j} -P_{clay,\, j} \right)\right)\log \left(10\right)\right) @@ -281,7 +281,7 @@ potential is limited by temperature in the supercooled water formulation of Niu and Yang (2006), .. math:: - :label: 15.8) + :label: 21.8) \psi \left(T\right)=-\frac{L_{f} \left(T-T_{f} \right)}{10^{3} T} @@ -319,7 +319,7 @@ includes these unresolved depth controls via an exponential decrease in the soil turnover time with depth: .. math:: - :label: 15.9) + :label: 21.9) r_{depth} =\exp \left(-\frac{z}{z_{\tau } } \right) @@ -328,7 +328,7 @@ where :math:`{z}_{\tau}` is the e-folding depth for decomposition, set by defaul The combined decomposition rate scalar (:math:`{r}_{total}`,unitless) is: .. math:: - :label: 15.10) + :label: 21.10) r_{total} =r_{tsoil} r_{water} r_{oxygen} r_{depth} . @@ -345,7 +345,7 @@ The potential carbon flux out of the upstream pool (:math:`{CF}_{pot,u}`, gC m\ :sup:`-2` s\ :sup:`-1`) is: .. math:: - :label: 15.11) + :label: 21.11) CF_{pot,\, u} =CS_{u} k_{u} @@ -361,7 +361,7 @@ mineral nitrogen (Thornton and Rosenbloom, 2005) is: .. math:: - :label: 15.12) + :label: 21.12) NF_{pot\_ min,\, u\to d} =\frac{CF_{pot,\, u} \left(1-rf_{u} -\frac{CN_{d} }{CN_{u} } \right)}{CN_{d} } @@ -379,37 +379,37 @@ individual pools in the decomposition cascade, for the example of the CLM-CN pool structure, are given as: .. math:: - :label: 15.13) + :label: 21.13) CF_{pot,\, Lit1} ={CS_{Lit1} k_{Lit1} r_{total} \mathord{\left/ {\vphantom {CS_{Lit1} k_{Lit1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.14) + :label: 21.14) CF_{pot,\, Lit2} ={CS_{Lit2} k_{Lit2} r_{total} \mathord{\left/ {\vphantom {CS_{Lit2} k_{Lit2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.15) + :label: 21.15) CF_{pot,\, Lit3} ={CS_{Lit3} k_{Lit3} r_{total} \mathord{\left/ {\vphantom {CS_{Lit3} k_{Lit3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.16) + :label: 21.16) CF_{pot,\, SOM1} ={CS_{SOM1} k_{SOM1} r_{total} \mathord{\left/ {\vphantom {CS_{SOM1} k_{SOM1} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.17) + :label: 21.17) CF_{pot,\, SOM2} ={CS_{SOM2} k_{SOM2} r_{total} \mathord{\left/ {\vphantom {CS_{SOM2} k_{SOM2} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.18) + :label: 21.18) CF_{pot,\, SOM3} ={CS_{SOM3} k_{SOM3} r_{total} \mathord{\left/ {\vphantom {CS_{SOM3} k_{SOM3} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} .. math:: - :label: 15.19) + :label: 21.19) CF_{pot,\, SOM4} ={CS_{SOM4} k_{SOM4} r_{total} \mathord{\left/ {\vphantom {CS_{SOM4} k_{SOM4} r_{total} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} @@ -426,27 +426,27 @@ structure will be similar but without the different terminal step): NF_{pot\_ min,\, Lit1\to SOM1} ={CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit1} \left(1-rf_{Lit1} -\frac{CN_{SOM1} }{CN_{Lit1} } \right) CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } .. math:: - :label: 15.21) + :label: 21.21) NF_{pot\_ min,\, Lit2\to SOM2} ={CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit2} \left(1-rf_{Lit2} -\frac{CN_{SOM2} }{CN_{Lit2} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: - :label: 15.22) + :label: 21.22) NF_{pot\_ min,\, Lit3\to SOM3} ={CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, Lit3} \left(1-rf_{Lit3} -\frac{CN_{SOM3} }{CN_{Lit3} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } .. math:: - :label: 15.23) + :label: 21.23) NF_{pot\_ min,\, SOM1\to SOM2} ={CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM1} \left(1-rf_{SOM1} -\frac{CN_{SOM2} }{CN_{SOM1} } \right) CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: - :label: 15.24) + :label: 21.24) NF_{pot\_ min,\, SOM2\to SOM3} ={CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM2} \left(1-rf_{SOM2} -\frac{CN_{SOM3} }{CN_{SOM2} } \right) CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } .. math:: - :label: 15.25) + :label: 21.25) NF_{pot\_ min,\, SOM3\to SOM4} ={CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right)\mathord{\left/ {\vphantom {CF_{pot,\, SOM3} \left(1-rf_{SOM3} -\frac{CN_{SOM4} }{CN_{SOM3} } \right) CN_{SOM4} }} \right. \kern-\nulldelimiterspace} CN_{SOM4} } @@ -487,7 +487,7 @@ beginning of the timestep is considered the available supply. Total demand for mineral nitrogen from this pool (:math:`{NF}_{total\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) is: .. math:: - :label: 15.27) + :label: 21.27) NF_{total\_ demand} =NF_{immob\_ demand} +NF_{plant\_ demand\_ soil} @@ -511,7 +511,7 @@ lower-than-potential rates, defined by the fractions where: .. math:: - :label: 15.28) + :label: 21.28) f_{plant\_ demand} =f_{immob\_ demand} =\frac{NS_{sminn} }{\Delta t\, NF_{total\_ demand} } @@ -532,37 +532,37 @@ CENTURY structure will be similar but, again without the different terminal step), are calculated as: .. math:: - :label: 15.29) + :label: 21.29) CF_{Lit1} =\left\{\begin{array}{l} {CF_{pot,\, Lit1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {CF_{pot,\, Lit1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: - :label: 15.30) + :label: 21.30) CF_{Lit2} =\left\{\begin{array}{l} {CF_{pot,\, Lit2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {CF_{pot,\, Lit2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 15.31) + :label: 21.31) CF_{Lit3} =\left\{\begin{array}{l} {CF_{pot,\, Lit3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {CF_{pot,\, Lit3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 15.32) + :label: 21.32) CF_{SOM1} =\left\{\begin{array}{l} {CF_{pot,\, SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {CF_{pot,\, SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 15.33) + :label: 21.33) CF_{SOM2} =\left\{\begin{array}{l} {CF_{pot,\, SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {CF_{pot,\, SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 15.34) + :label: 21.34) CF_{SOM3} =\left\{\begin{array}{l} {CF_{pot,\, SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {CF_{pot,\, SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: - :label: 15.35) + :label: 21.35) CF_{SOM4} =CF_{pot,\, SOM4} @@ -570,37 +570,37 @@ Heterotrophic respiration fluxes (losses of carbon as CO\ :sub:`2` to the atmosphere) are: .. math:: - :label: 15.36) + :label: 21.36) CF_{Lit1,\, HR} =CF_{Lit1} rf_{Lit1} .. math:: - :label: 15.37) + :label: 21.37) CF_{Lit2,\, HR} =CF_{Lit2} rf_{Lit2} .. math:: - :label: 15.38) + :label: 21.38) CF_{Lit3,\, HR} =CF_{Lit3} rf_{Lit3} .. math:: - :label: 15.39) + :label: 21.39) CF_{SOM1,\, HR} =CF_{SOM1} rf_{SOM1} .. math:: - :label: 15.40) + :label: 21.40) CF_{SOM2,\, HR} =CF_{SOM2} rf_{SOM2} .. math:: - :label: 15.41) + :label: 21.41) CF_{SOM3,\, HR} =CF_{SOM3} rf_{SOM3} .. math:: - :label: 15.42) + :label: 21.42) CF_{SOM4,\, HR} =CF_{SOM4} rf_{SOM4} @@ -608,32 +608,32 @@ Transfers of carbon from upstream to downstream pools in the decomposition cascade are given as: .. math:: - :label: 15.43) + :label: 21.43) CF_{Lit1,\, SOM1} =CF_{Lit1} \left(1-rf_{Lit1} \right) .. math:: - :label: 15.44) + :label: 21.44) CF_{Lit2,\, SOM2} =CF_{Lit2} \left(1-rf_{Lit2} \right) .. math:: - :label: 15.45) + :label: 21.45) CF_{Lit3,\, SOM3} =CF_{Lit3} \left(1-rf_{Lit3} \right) .. math:: - :label: 15.46) + :label: 21.46) CF_{SOM1,\, SOM2} =CF_{SOM1} \left(1-rf_{SOM1} \right) .. math:: - :label: 15.47) + :label: 21.47) CF_{SOM2,\, SOM3} =CF_{SOM2} \left(1-rf_{SOM2} \right) .. math:: - :label: 15.48) + :label: 21.48) CF_{SOM3,\, SOM4} =CF_{SOM3} \left(1-rf_{SOM3} \right) @@ -647,32 +647,32 @@ or from the downstream pool to the soil mineral nitrogen pool pools in the decomposition cascade are given as: .. math:: - :label: 15.49) + :label: 21.49) NF_{Lit1,\, SOM1} ={CF_{Lit1} \mathord{\left/ {\vphantom {CF_{Lit1} CN_{Lit1} }} \right. \kern-\nulldelimiterspace} CN_{Lit1} } .. math:: - :label: 15.50) + :label: 21.50) NF_{Lit2,\, SOM2} ={CF_{Lit2} \mathord{\left/ {\vphantom {CF_{Lit2} CN_{Lit2} }} \right. \kern-\nulldelimiterspace} CN_{Lit2} } .. math:: - :label: 15.51) + :label: 21.51) NF_{Lit3,\, SOM3} ={CF_{Lit3} \mathord{\left/ {\vphantom {CF_{Lit3} CN_{Lit3} }} \right. \kern-\nulldelimiterspace} CN_{Lit3} } .. math:: - :label: 15.52) + :label: 21.52) NF_{SOM1,\, SOM2} ={CF_{SOM1} \mathord{\left/ {\vphantom {CF_{SOM1} CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } .. math:: - :label: 15.53) + :label: 21.53) NF_{SOM2,\, SOM3} ={CF_{SOM2} \mathord{\left/ {\vphantom {CF_{SOM2} CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: - :label: 15.54) + :label: 21.54) NF_{SOM3,\, SOM4} ={CF_{SOM3} \mathord{\left/ {\vphantom {CF_{SOM3} CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } @@ -681,37 +681,37 @@ whether the decomposition step is an immobilization flux or a mineralization flux: .. math:: - :label: 15.55) + :label: 21.55) NF_{sminn,\, Lit1\to SOM1} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit1\to SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {NF_{pot\_ min,\, Lit1\to SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: - :label: 15.56) + :label: 21.56) NF_{sminn,\, Lit2\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit2\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {NF_{pot\_ min,\, Lit2\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 15.57) + :label: 21.57) NF_{sminn,\, Lit3\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit3\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {NF_{pot\_ min,\, Lit3\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 15.58) + :label: 21.58) NF_{sminn,SOM1\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM1\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {NF_{pot\_ min,\, SOM1\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 15.59) + :label: 21.59) NF_{sminn,SOM2\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM2\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {NF_{pot\_ min,\, SOM2\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 15.60) + :label: 21.60) NF_{sminn,SOM3\to SOM4} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM3\to SOM4} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {NF_{pot\_ min,\, SOM3\to SOM4} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: - :label: 15.61) + :label: 21.61) NF_{sminn,\, SOM4} =NF_{pot\_ min,\, SOM4} diff --git a/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst similarity index 98% rename from doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst rename to doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst index 8126f09774..381367a4c0 100644 --- a/doc/source/tech_note/CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst +++ b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst @@ -30,7 +30,7 @@ The grid cell fraction of exposed bare soil suitable for dust mobilization :math:`f_{m}` is given by .. math:: - :label: 24.2) + :label: 29.2) f_{m} =\left(1-f_{lake} -f_{wetl} \right)\left(1-f_{sno} \right)\left(1-f_{v} \right)\frac{w_{liq,1} }{w_{liq,1} +w_{ice,1} } @@ -62,7 +62,7 @@ The sandblasting mass efficiency :math:`\alpha` (m:sup:`-1`) is calculated as .. math:: - :label: 24.4) + :label: 29.4) \alpha =100e^{\left(13.4M_{clay} -6.0\right)\ln 10} {\rm \; \; }\left\{\begin{array}{l} {M_{clay} =\% clay\times 0.01{\rm \; \; \; 0}\le \% clay\le 20} \\ {M_{clay} =20\times 0.01{\rm \; \; \; \; \; \; \; \; 20<\% }clay\le 100} \end{array}\right. @@ -98,21 +98,21 @@ diameter (75 x 10\ :math:`{}^{-6}` m) of optimal saltation particles, and :math:`f_{w}` is a factor dependent on soil moisture: .. math:: - :label: 24.7) + :label: 29.7) f_{w} =\left\{\begin{array}{l} {1{\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; }w\le w_{t} } \\ {\sqrt{1+1.21\left[100\left(w-w_{t} \right)\right]^{0.68} } {\rm \; \; for\; }w>w_{t} } \end{array}\right. where .. math:: - :label: 24.8) + :label: 29.8) w_{t} =a\left(0.17M_{clay} +0.14M_{clay}^{2} \right){\rm \; \; \; \; \; \; 0}\le M_{clay} =\% clay\times 0.01\le 1 and .. math:: - :label: 24.9) + :label: 29.9) w=\frac{\theta _{1} \rho _{liq} }{\rho _{d,1} } @@ -127,7 +127,7 @@ in section 6.3 rather than as in Zender et al. (2003). factor .. math:: - :label: 24.10) + :label: 29.10) Re_{*t}^{f} =\left\{\begin{array}{l} {\frac{0.1291^{2} }{-1+1.928Re_{*t} } {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; 0.03}\le Re_{*t} \le 10} \\ {0.12^{2} \left(1-0.0858e^{-0.0617(Re_{*t} -10)} \right)^{2} {\rm \; for\; }Re_{*t} >10} \end{array}\right. @@ -135,7 +135,7 @@ and :math:`Re_{*t}` is the threshold friction Reynolds number approximation for optimally sized particles .. math:: - :label: 24.11) + :label: 29.11) Re_{*t} =0.38+1331\left(100D_{osp} \right)^{1.56} @@ -143,7 +143,7 @@ In equation , :math:`u_{*s}` ** is defined as the wind friction speed (m s\ :sup:`-1`) accounting for the Owen effect (Owen 1964) .. math:: - :label: 24.12) + :label: 29.12) u_{\*s} =\left\{\begin{array}{l} {u_{\*} {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; }U_{10} 0} \\ {-NF_{pot\_ min,Lit1\to SOM1} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} \le 0} \end{array}\right. .. math:: - :label: 16.3) + :label: 22.3) NF_{denit,Lit2\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} >0} \\ {-NF_{pot\_ min,Lit2\to SOM2} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} \le 0} \end{array}\right. .. math:: - :label: 16.4) + :label: 22.4) NF_{denit,Lit3\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} >0} \\ {-NF_{pot\_ min,Lit3\to SOM3} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} \le 0} \end{array}\right. .. math:: - :label: 16.5) + :label: 22.5) NF_{denit,SOM1\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} >0} \\ {-NF_{pot\_ min,SOM1\to SOM2} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} \le 0} \end{array}\right. .. math:: - :label: 16.6) + :label: 22.6) NF_{denit,SOM2\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} >0} \\ {-NF_{pot\_ min,SOM2\to SOM3} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} \le 0} \end{array}\right. .. math:: - :label: 16.7) + :label: 22.7) NF_{denit,SOM3\to SOM4} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} >0} \\ {-NF_{pot\_ min,SOM3\to SOM4} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} \le 0} \end{array}\right. .. math:: - :label: 16.8) + :label: 22.8) NF_{denit,SOM4} =-NF_{pot\_ min,SOM4} @@ -214,7 +214,7 @@ pool. The denitrification of excess soil mineral nitrogen is non-zero whenever the supply of mineral nitrogen exceeds the demand: .. math:: - :label: 16.9) + :label: 22.9) NF_{sminn,denit} =\left\{\begin{array}{l} {\left(\frac{NS_{sminn} }{\Delta t} \right)-NF_{total\_ demand} f_{dnx} \qquad {\rm for\; }NF_{total\_ demand} \Delta tT_{f} } \\ {0\qquad T_{g} \le T_{f} } \end{array}\right\} @@ -617,7 +617,7 @@ s\ :sup:`-1`) (eq. ) is used to evaluate :math:`w^{*}` and The CityplaceRichardson number is .. math:: - :label: 9.32) + :label: 12.32) R_{i} =\frac{-1+\sqrt{1+\frac{40N^{2} k^{2} z_{i}^{2} }{w^{*^{2} } \exp \left(-2k^{*} z_{i} \right)} } }{20} @@ -638,7 +638,7 @@ Bartlein (1990)), eq. contains no negative sign; this is a correction from CLM4. The density of water is (Hostetler and Bartlein 1990) .. math:: - :label: 9.34) + :label: 12.34) \rho _{i} =1000\left(1-1.9549\times 10^{-5} \left|T_{i} -277\right|^{1.68} \right). @@ -658,7 +658,7 @@ The thermal conductivity for the liquid water portion of lake body layer given by .. math:: - :label: 9.36) + :label: 12.36) \tau _{liq,i} =K_{W} c_{liq} \rho _{liq} . @@ -667,7 +667,7 @@ The thermal conductivity of the ice portion of lake body layer *i*, constant among layers, and is given by .. math:: - :label: 9.37) + :label: 12.37) \tau _{ice,eff} =\tau _{ice} \frac{\rho _{ice} }{\rho _{liq} } @@ -682,7 +682,7 @@ and water fractions, assuming that they will be physically vertically stacked, and is given by .. math:: - :label: 9.38) + :label: 12.38) \tau _{i} =\frac{\tau _{ice,eff} \tau _{liq,i} }{\tau _{liq,i} I_{i} +\tau _{ice} \left(1-I_{i} \right)} . @@ -715,7 +715,7 @@ For unfrozen lakes, the solar radiation remaining at depth :math:`z>z_{a}` in the lake body is given by .. math:: - :label: 9.39) + :label: 12.39) \phi =\left(1-\beta \vec{S}_{g} \right)\exp \left\{-\eta \left(z-z_{a} \right)\right\} . @@ -723,7 +723,7 @@ For all lake body layers, the flux absorbed by the layer *i*, :math:`\phi _{i}` , is .. math:: - :label: 9.40) + :label: 12.40) \phi _{i} =\left(1-\beta \vec{S}_{g} \right)\left[\exp \left\{-\eta \left(z_{i} -\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}-\exp \left\{-\eta \left(z_{i} +\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}\right] . @@ -749,7 +749,7 @@ The vertically-integrated heat capacity for each lake layer, water and ice fractions: .. math:: - :label: 9.42) + :label: 12.42) c_{v,i} =\Delta z_{i} \rho _{liq} \left[c_{liq} \left(1-I_{i} \right)+c_{ice} I_{i} \right] . @@ -778,7 +778,7 @@ calculated as the harmonic mean of the conductivities of the neighboring layers: .. math:: - :label: 9.43) + :label: 12.43) \lambda _{i} =\frac{\tau _{i} \tau _{i+1} \left(z_{i+1} -z_{i} \right)}{\tau _{i} \left(z_{i+1} -\hat{z}_{i} \right)+\tau _{i+1} \left(\hat{z}_{i} -z_{i} \right)} , @@ -804,7 +804,7 @@ Eq. is solved using the semi-implicit Crank-Nicholson Method, resulting in a tridiagonal system of equations: .. math:: - :label: 9.45) + :label: 12.45) \begin{array}{l} {r_{i} =a_{i} T_{i-1}^{n+1} +b_{i} T_{i}^{n+1} +cT_{i+1}^{n+1} ,} \\ {a_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } ,} \\ {b_{i} =1+0.5\frac{\Delta t}{c_{v,i} } \left(\frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } +\frac{\partial F_{i} }{\partial T_{i}^{n} } \right),} \\ {c_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i} }{\partial T_{i}^{n} } ,} \\ {r_{i} =T_{i}^{n} +0.5\frac{\Delta t}{c_{v,i} } \left(F_{i-1} -F_{i} \right)+\frac{\Delta t}{c_{v,i} } \phi _{i} .} \end{array} @@ -815,7 +815,7 @@ section 9.4.3 (the factor of 2 merely cancels out the Crank-Nicholson :math:`F_{N_{levlak} +N_{levgrnd} } =0`. For all other layers: .. math:: - :label: 9.46) + :label: 12.46) F_{i} =\lambda _{i} \frac{T_{i} ^{n} -T_{i+1}^{n} }{z_{n+1} -z_{n} } . @@ -843,7 +843,7 @@ section 9.5.6. The mass of melt in the layer *M* (kg m\ :sup:`-2`) is given by .. math:: - :label: 9.48) + :label: 12.48) M=\min \left\{M_{ice} ,\frac{Q_{avail} }{H_{fus} } \right\} @@ -874,7 +874,7 @@ If freezing occurs, :math:`Q_{avail}` is again given by but will be negative. The melt :math:`M`, also negative, is given by .. math:: - :label: 9.51) + :label: 12.51) M=\max \left\{-M_{liq} ,\frac{Q_{avail} }{H_{fus} } \right\} @@ -925,14 +925,14 @@ When this occurs, these two lake layers and all those above mix. Total enthalpy *Q* is conserved as .. math:: - :label: 9.52) + :label: 12.52) Q=\sum _{j=1}^{i+1}\Delta z_{j} \rho _{liq} \left(T_{j} -T_{f} \right)\left[\left(1-I_{j} \right)c_{liq} +I_{j} c_{ice} \right] . Once the average ice fraction :math:`I_{av}` is calculated from .. math:: - :label: 9.53) + :label: 12.53) \begin{array}{l} {I_{av} =\frac{\sum _{j=1}^{i+1}I_{j} \Delta z_{j} }{Z_{i+1} } ,} \\ {Z_{i+1} =\sum _{j=1}^{i+1}\Delta z_{j} ,} \end{array} @@ -950,7 +950,7 @@ If :math:`Q > 0`, then :math:`T_{froz} =T_{f}` , and :math:`T_{unfr}` is given by .. math:: - :label: 9.54) + :label: 12.54) T_{unfr} =\frac{Q}{\rho _{liq} Z_{i+1} \left[\left(1-I_{av} \right)c_{liq} \right]} +T_{f} . @@ -958,7 +958,7 @@ If :math:`Q < 0`, then :math:`T_{unfr} =T_{f}` , and :math:`T_{froz}` is given by .. math:: - :label: 9.55) + :label: 12.55) T_{froz} =\frac{Q}{\rho _{liq} Z_{i+1} \left[I_{av} c_{ice} \right]} +T_{f} . @@ -977,7 +977,7 @@ to *i* + 1, the ice fraction and temperature are set as follows, where by the heat capacity of the layer to yield .. math:: - :label: 9.56) + :label: 12.56) T_{j} =\frac{T_{froz} I_{j} c_{ice} +T_{unfr} \left(1-I_{j} \right)c_{liq} }{I_{j} c_{ice} +\left(1-I_{j} \right)c_{liq} } . @@ -991,7 +991,7 @@ re-written to yield the total enthalpy of the lake system (J m\ :sup:`-2`) :math:`H_{tot}` : .. math:: - :label: 9.57) + :label: 12.57) H_{tot} =\sum _{i=j_{top} }^{N_{levlak} +N_{levgrnd} }\left[c_{v,i} \left(T_{i} -T_{f} \right)+M_{liq,i} H_{fus} \right] -W_{sno,bulk} H_{fus} @@ -1004,7 +1004,7 @@ energy flux to yield the error flux :math:`E_{soi}` (W m\ :sup:`-2`): .. math:: - :label: 9.58) + :label: 12.58) E_{soi} =\frac{\Delta H_{tot} }{\Delta t} -G-\sum _{i=j_{top} }^{N_{levlak} +N_{levgrnd} }\phi _{i} @@ -1093,7 +1093,7 @@ water mass than it contains). If there are no resolved snow layers but given by .. math:: - :label: 9.60) + :label: 12.60) q_{sub,sno} =\min \left\{E_{g} ,\frac{W_{sno} }{\Delta t} \right\} . @@ -1109,7 +1109,7 @@ evaporation or dew deposition is balanced by :math:`q_{rgwl}` .) The snowpack is updated for frost and sublimation: .. math:: - :label: 9.61) + :label: 12.61) W_{sno} =W_{sno} +\Delta t\left(q_{frost} -q_{sub,sno} \right) . @@ -1127,7 +1127,7 @@ The combined water and ice soil volume fraction in a soil layer :math:`\theta _{i}` is given by .. math:: - :label: 9.62) + :label: 12.62) \theta _{i} =\frac{1}{\Delta z_{i} } \left(\frac{w_{ice,i} }{\rho _{ice} } +\frac{w_{liq,i} }{\rho _{liq} } \right) . @@ -1136,7 +1136,7 @@ saturation (as may occur when ice melts), then the liquid water mass is adjusted to .. math:: - :label: 9.63) + :label: 12.63) w_{liq,i} =\left(\theta _{sat,i} \Delta z_{i} -\frac{w_{ice,i} }{\rho _{ice} } \right)\rho _{liq} . @@ -1145,7 +1145,7 @@ Otherwise, if excess ice is melting and water in the layer is reset to .. math:: - :label: 9.64) + :label: 12.64) w_{liq,i} = \theta _{sat,i} \rho _{liq} \Delta z_{i} diff --git a/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst similarity index 99% rename from doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst rename to doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst index fc71c600dd..6a29802004 100644 --- a/doc/source/tech_note/CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst +++ b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst @@ -137,7 +137,7 @@ The factor :math:`f_{pH}` is nominally set to 1, although a static spatial map of *pH* can be used to determine this factor (Dunfield et al. 1993) by applying: .. math:: - :label: 19.3) + :label: 24.3) f_{pH} =10^{-0.2235pH^{2} +2.7727pH-8.6} . @@ -154,7 +154,7 @@ anoxic microsites above the water table, we apply the Arah and Stephen (1998) estimate of anaerobic fraction: .. math:: - :label: 19.4) + :label: 24.4) \varphi =\frac{1}{1+\eta C_{O_{2} } } . @@ -219,7 +219,7 @@ the water table, by first estimating the Henry’s law partitioning coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. (2010): .. math:: - :label: 19.5) + :label: 24.5) \log \left(\frac{1}{k_{H} } \right)=\log k_{H}^{s} -\frac{1}{C_{H} } \left(\frac{1}{T} -\frac{1}{T^{s} } \right) @@ -229,7 +229,7 @@ coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. (2010): k_{h}^{C} =Tk_{H} R_{g} .. math:: - :label: 19.7) + :label: 24.7) C_{e} =\frac{C_{w} R_{g} T}{\theta _{s} k_{H}^{C} p} @@ -282,7 +282,7 @@ area index *L* (m:sup:`2` m\ :sup:`-2`), as in Wania et al. (2010): .. math:: - :label: 19.9) + :label: 24.9) T=\frac{f_{N} N_{a} L}{0.22} \pi R^{2} . @@ -304,7 +304,7 @@ and the CLM predicted transpiration (:math:`F_{T}` ) for each PFT, assuming that no methane was oxidized inside the plant tissue: .. math:: - :label: 19.10) + :label: 24.10) F_{CH_{4} -T} =\sum _{j}\rho _{r,j} F_{T} C_{CH_{4} ,j} . @@ -316,7 +316,7 @@ kinetics (Arah and Stephen 1998; Segers 1998), dependent on both the gaseous CH\ :sub:`4` and O\ :sub:`2` concentrations: .. math:: - :label: 19.11) + :label: 24.11) R_{oxic} =R_{o,\max } \left[\frac{C_{CH_{4} } }{K_{CH_{4} } +C_{CH_{4} } } \right]\left[\frac{C_{O_{2} } }{K_{O_{2} } +C_{O_{2} } } \right]Q_{10} F_{\vartheta } @@ -429,7 +429,7 @@ aqueous diffusion in the saturated part of the soil column, we applied (Moldrup et al. 2003): .. math:: - :label: 19.14) + :label: 24.14) D_{e} =D_{0} \theta _{s} ^{2} . @@ -508,7 +508,7 @@ gives: Equation is solved with a standard tridiagonal solver, i.e.: .. math:: - :label: 19.17) + :label: 24.17) aC_{j-1}^{n+1} +bC_{j}^{n+1} +cC_{j+1}^{n+1} =r, @@ -533,7 +533,7 @@ soil element above the interface: .. math:: b=\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(K_{H} \frac{D_{p1}^{} }{\Delta x_{p1} } +\frac{D_{m1}^{} }{\Delta x_{m1} } \right)\right] .. math:: - :label: 19.18) + :label: 24.18) r=\frac{R_{j}^{n} }{\Delta t} C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -K_{H} C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] @@ -544,7 +544,7 @@ and the soil element below the interface: .. math:: a=-K_{H} \frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1} } .. math:: - :label: 19.19) + :label: 24.19) r=\frac{R_{j}^{n} }{\Delta t} +C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -K_{H} C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] @@ -567,7 +567,7 @@ grid cell in a simple model based on simulated water table depth (:math:`{z}_{w}`) and surface runoff (:math:`{Q}_{r}` (mm s\ :sup:`-1`)): .. math:: - :label: 19.20) + :label: 24.20) f_{s} =P_{1} e^{{\raise0.7ex\hbox{$ -z_{w} $}\!\mathord{\left/ {\vphantom {-z_{w} p_{2} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ p_{2} $}} } +p_{3} Q_{r} . @@ -585,7 +585,7 @@ seasonal inundation on CH\ :sub:`4` production (see appendix B in Riley et al. (2011a) for a discussion of this simplified expression): .. math:: - :label: 19.21) + :label: 24.21) S=\frac{\beta \left(f-\bar{f}\right)+\bar{f}}{f} ,S\le 1. diff --git a/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst similarity index 97% rename from doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst rename to doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst index db2b04d5cf..7219e7a293 100644 --- a/doc/source/tech_note/CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst +++ b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst @@ -71,22 +71,22 @@ derived from one year’s worth of hourly CAM output from CAM version cam3\_5\_55 as .. math:: - :label: 26.2) + :label: 31.2) S_{atm} \, \downarrow _{vis}^{\mu } =R_{vis} \left(\alpha S_{atm} \right) .. math:: - :label: 26.3) + :label: 31.3) S_{atm} \, \downarrow _{nir}^{\mu } =R_{nir} \left[\left(1-\alpha \right)S_{atm} \right] .. math:: - :label: 26.4) + :label: 31.4) S_{atm} \, \downarrow _{vis} =\left(1-R_{vis} \right)\left(\alpha S_{atm} \right) .. math:: - :label: 26.5) + :label: 31.5) S_{atm} \, \downarrow _{nir} =\left(1-R_{nir} \right)\left[\left(1-\alpha \right)S_{atm} \right]. @@ -94,7 +94,7 @@ where :math:`\alpha` , the ratio of visible to total incident solar radiation, is assumed to be .. math:: - :label: 26.6) + :label: 31.6) \alpha =\frac{S_{atm} \, \downarrow _{vis}^{\mu } +S_{atm} \, \downarrow _{vis}^{} }{S_{atm} } =0.5. @@ -102,14 +102,14 @@ The ratio of direct to total incident radiation in the visible :math:`R_{vis}` is .. math:: - :label: 26.7) + :label: 31.7) R_{vis} =a_{0} +a_{1} \times \alpha S_{atm} +a_{2} \times \left(\alpha S_{atm} \right)^{2} +a_{3} \times \left(\alpha S_{atm} \right)^{3} \qquad 0.01\le R_{vis} \le 0.99 and in the near-infrared :math:`R_{nir}` is .. math:: - :label: 26.8) + :label: 31.8) R_{nir} =b_{0} +b_{1} \times \left(1-\alpha \right)S_{atm} +b_{2} \times \left[\left(1-\alpha \right)S_{atm} \right]^{2} +b_{3} \times \left[\left(1-\alpha \right)S_{atm} \right]^{3} \qquad 0.01\le R_{nir} \le 0.99 @@ -130,14 +130,14 @@ is derived from the atmospheric vapor pressure :math:`e_{atm}` and temperature :math:`T_{atm}` (Idso 1981) as .. math:: - :label: 26.9) + :label: 31.9) L_{atm} \, \downarrow =\left[0.70+5.95\times 10^{-5} \times 0.01e_{atm} \exp \left(\frac{1500}{T_{atm} } \right)\right]\sigma T_{atm}^{4} where .. math:: - :label: 26.10) + :label: 31.10) e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } @@ -152,14 +152,14 @@ snow is q_{rain} =P\left(f_{P} \right), .. math:: - :label: 26.12) + :label: 31.12) q_{snow} =P\left(1-f_{P} \right) where .. math:: - :label: 26.13) + :label: 31.13) f_{P} =0<0.5\left(T_{atm} -T_{f} \right)<1. @@ -174,7 +174,7 @@ user-supplied relative humidity :math:`RH` (%) and derive specific humidity :math:`q_{atm}` (kg kg\ :sup:`-1`) from .. math:: - :label: 26.14) + :label: 31.14) q_{atm} =\frac{0.622e_{atm} }{P_{atm} -0.378e_{atm} } @@ -190,7 +190,7 @@ temperature :math:`T_{dew}` (K) and derive specific humidity :math:`q_{atm}` from .. math:: - :label: 26.15) + :label: 31.15) q_{atm} = \frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . diff --git a/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst similarity index 98% rename from doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst rename to doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index c380f0d75a..e48ba34933 100644 --- a/doc/source/tech_note/CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -134,7 +134,7 @@ describe the implementation, modified here. In its simplest form, leaf net photosynthesis after accounting for respiration (:math:`R_{d}` ) is .. math:: - :label: 8.2) + :label: 9.2) A_{n} =\min \left(A_{c} ,A_{j} ,A_{p} \right)-R_{d} . @@ -153,7 +153,7 @@ RuBP (i.e., the light-limited rate) :math:`A_{j}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 8.4) + :label: 9.4) A_{j} =\left\{\begin{array}{l} {\frac{J\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -193,7 +193,7 @@ photosynthetically active radiation absorbed by the leaf. A common expression is the smaller of the two roots of the equation .. math:: - :label: 8.6) + :label: 9.6) \Theta _{PSII} J^{2} -\left(I_{PSII} +J_{\max } \right)J+I_{PSII} J_{\max } =0 @@ -208,7 +208,7 @@ with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is .. math:: - :label: 8.7) + :label: 9.7) I_{PSII} =0.5\Phi _{PSII} (4.6\phi ) @@ -225,7 +225,7 @@ The model uses co-limitation as described by Collatz et al. (1991, smaller root of the equations .. math:: - :label: 8.8) + :label: 9.8) \begin{array}{rcl} {\Theta _{cj} A_{i}^{2} -\left(A_{c} +A_{j} \right)A_{i} +A_{c} A_{j} } & {=} & {0} \\ {\Theta _{ip} A^{2} -\left(A_{i} +A_{p} \right)A+A_{i} A_{p} } & {=} & {0} \end{array} . @@ -259,21 +259,21 @@ respiration rate. The parameters :math:`V_{c\max 25}` , :math:`T_{v}` (K) as: .. math:: - :label: 8.9) + :label: 9.9) \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma _{*} } & {=} & {\Gamma _{*25} \; f\left(T_{v} \right)} \end{array} with .. math:: - :label: 8.10) + :label: 9.10) f\left(T_{v} \right)=\; \exp \left[\frac{\Delta H_{a} }{298.15\times 0.001R_{gas} } \left(1-\frac{298.15}{T_{v} } \right)\right] and .. math:: - :label: 8.11) + :label: 9.11) f_{H} \left(T_{v} \right)=\frac{1+\exp \left(\frac{298.15\Delta S-\Delta H_{d} }{298.15\times 0.001R_{gas} } \right)}{1+\exp \left(\frac{\Delta ST_{v} -\Delta H_{d} }{0.001R_{gas} T_{v} } \right)} . @@ -284,7 +284,7 @@ Because :math:`T_{p}` as implemented here varies with :math:`T_{p}` . For C\ :sub:`4` plants, .. math:: - :label: 8.12) + :label: 9.12) \begin{array}{l} {V_{c\max } =V_{c\max 25} \left[\frac{Q_{10} ^{(T_{v} -298.15)/10} }{f_{H} \left(T_{v} \right)f_{L} \left(T_{v} \right)} \right]} \\ {f_{H} \left(T_{v} \right)=1+\exp \left[s_{1} \left(T_{v} -s_{2} \right)\right]} \\ {f_{L} \left(T_{v} \right)=1+\exp \left[s_{3} \left(s_{4} -T_{v} \right)\right]} \end{array} @@ -295,7 +295,7 @@ with :math:`Q_{10} =2`, Additionally, .. math:: - :label: 8.13) + :label: 9.13) R_{d} =R_{d25} \left\{\frac{Q_{10} ^{(T_{v} -298.15)/10} }{1+\exp \left[s_{5} \left(T_{v} -s_{6} \right)\right]} \right\} @@ -303,7 +303,7 @@ with :math:`Q_{10} =2`, :math:`s_{5} =1.3` K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and .. math:: - :label: 8.14) + :label: 9.14) k_{p} =k_{p25} \, Q_{10} ^{(T_{v} -298.15)/10} @@ -337,7 +337,7 @@ achieved by allowing :math:`\Delta S`\ to vary with growth temperature according to .. math:: - :label: 8.15) + :label: 9.15) \begin{array}{l} {\Delta S=668.39-1.07(T_{10} -T_{f} )\qquad \qquad {\rm for\; }V_{c\max } } \\ {\Delta S=659.70-0.75(T_{10} -T_{f} )\qquad \qquad {\rm for\; }J_{\max } } \end{array} @@ -349,7 +349,7 @@ parameterization, :math:`\Delta H_{d}` \ = 200000, ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: - :label: 8.16) + :label: 9.16) J_{\max 25} /V_{c\max 25} =2.59-0.035(T_{10} -T_{f} ). @@ -415,24 +415,24 @@ coefficient for nitrogen. The canopy integrated value for sunlit and shaded leaves is .. math:: - :label: 8.20) + :label: 9.20) \begin{array}{rcl} {V_{c\; \max 25}^{sun} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)f_{sun} \left(x\right)\, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} } \end{array} .. math:: - :label: 8.21) + :label: 9.21) \begin{array}{rcl} {V_{c\; \max 25}^{sha} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)\left[1-f_{sun} \left(x\right)\right] \, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left\{\left[1-e^{-K_{n} L} \right]\frac{1}{K_{n} } -\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} \right\}} \end{array} and the average value for the sunlit and shaded leaves is .. math:: - :label: 8.22) + :label: 9.22) \bar{V}_{c\; \max 25}^{sun} ={V_{c\; \max 25}^{sun} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sun} L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } .. math:: - :label: 8.23) + :label: 9.23) \bar{V}_{c\; \max 25}^{sha} ={V_{c\; \max 25}^{sha} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sha} L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } . @@ -457,7 +457,7 @@ using the function :math:`f(DYL)`, which introduces seasonal variation to :math:`V_{c\max }` .. math:: - :label: 8.24) + :label: 9.24) f\left(DYL\right)=\frac{\left(DYL\right)^{2} }{\left(DYL_{\max } \right)^{2} } @@ -465,7 +465,7 @@ with :math:`0.01\le f\left(DYL\right)\le 1`. Daylength (seconds) is given by .. math:: - :label: 8.25) + :label: 9.25) DYL=2\times 13750.9871\cos ^{-1} \left[\frac{-\sin \left(lat\right)\sin \left(decl\right)}{\cos \left(lat\right)\cos \left(decl\right)} \right] @@ -492,7 +492,7 @@ of each soil layer, the root distribution of the plant functional type, and a plant-dependent response to soil water stress .. math:: - :label: 8.26) + :label: 9.26) \beta _{t} =\sum _{i}w_{i} r_{i} @@ -501,7 +501,7 @@ where :math:`w_{i}` is a plant wilting factor for layer :math:`i` and wilting factor :math:`w_{i}` is .. math:: - :label: 8.27) + :label: 9.27) w_{i} =\left\{\begin{array}{l} {\frac{\psi _{c} -\psi _{i} }{\psi _{c} -\psi _{o} } \left[\frac{\theta _{sat,i} -\theta _{ice,i} }{\theta _{sat,i} } \right]\le 1\qquad {\rm for\; }T_{i} >T_{f} -2{\rm \; and\; }\theta _{liq,\, i} >0} \\ {0\qquad \qquad \qquad \qquad {\rm for\; }T_{i} \le T_{f} -2{\rm \; or\; }\theta _{liq,\, i} \le 0} \end{array}\right\} @@ -515,7 +515,7 @@ effective porosity (accounting for the ice fraction; Here, the soil water matric potential :math:`\psi _{i}` \ is defined as .. math:: - :label: 8.28) + :label: 9.28) \psi _{i} =\psi _{sat,i} \, s_{i}^{-B_{i} } \ge \psi _{c} @@ -526,7 +526,7 @@ Clapp and Hornberger (1978) parameter (section 7.4.1). The soil wetness :math:`s_{i}` is .. math:: - :label: 8.29) + :label: 9.29) s_{i} =\frac{\theta _{liq,\, i} }{\theta _{sat,\, i} -\theta _{ice,\, i} } \ge 0.01 @@ -544,7 +544,7 @@ The root fraction :math:`r_{i}` in each soil layer depends on the plant functional type .. math:: - :label: 8.30) + :label: 9.30) r_{i} =\left\{\begin{array}{l} {0.5\left[\begin{array}{l} {\exp \left(-r_{a} z_{h,\, i-1} \right)+\exp \left(-r_{b} z_{h,\, i-1} \right)-} \\ {\exp \left(-r_{a} z_{h,\, i} \right)-\exp \left(-r_{b} z_{h,\, i} \right)} \end{array}\right]\qquad {\rm for\; }1\le iCF_{GPPpot} } \end{array}\right. + +.. math:: + :label: 17.3) + + CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. + +The storage pool that supplies carbon for maintenance respiration in +excess of current :math:`CF_{GPPpot}` ( :math:`CS_{xs}`, gC +m\ :sup:`-2`) is permitted to run a deficit (negative state), and +the magnitude of this deficit determines an allocation demand which +gradually replenishes :math:`CS_{xs}`. The logic for allowing a +negative state for this pool is to eliminate the need to know in advance +what the total maintenance respiration demand will be for a particular +combination of climate and plant type. Using the deficit approach, the +allocation to alleviate the deficit increases as the deficit increases, +until the supply of carbon into the pool balances the demand for carbon +leaving the pool in a quasi-steady state, with variability driven by the +seasonal cycle, climate variation, disturbance, and internal dynamics of +the plant-litter-soil system. In cases where the combination of climate +and plant type are not suitable to sustained growth, the deficit in this +pool increases until the available carbon is being allocated mostly to +alleviate the deficit, and new growth approaches zero. The allocation +flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC +m\ :sup:`-2` s\ :sup:`-1`) is given as + +.. math:: + :label: 17.4) + + CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. + +.. math:: + :label: 17.5) + + CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. + +where :math:`\tau_{xs}` is the time constant (currently +set to 30 days) controlling the rate of replenishment of :math:`CS_{xs}`. + +Note that these two top-priority carbon allocation fluxes +(:math:`CF_{GPP,mr}` and :math:`CF_{GPP,xs}`) are not +stoichiometrically associated with any nitrogen fluxes, and so this +initial allocation step can proceed without reference to (or limitation +from) the available mineral nitrogen supply. + +Carbon and Nitrogen Stoichiometry of New Growth +---------------------------------------------------- + +After accounting for the carbon cost of maintenance respiration, the +remaining carbon flux from photosynthesis which can be allocated to new +growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is + +.. math:: + :label: 17.6) + + CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . + +Potential allocation to new growth is calculated for all of the plant +carbon and nitrogen state variables based on specified C:N ratios for +each tissue type and allometric parameters that relate allocation +between various tissue types. The allometric parameters are defined as +follows: + +.. math:: + :label: ZEqnNum650137 + + \begin{array}{l} {a_{1} ={\rm \; ratio\; of\; new\; fine\; root\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{2} ={\rm \; ratio\; of\; new\; coarse\; root\; :\; new\; stem\; carbon\; allocation}} \\ {a_{3} ={\rm \; ratio\; of\; new\; stem\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{4} ={\rm \; ratio\; new\; live\; wood\; :\; new\; total\; wood\; allocation}} \\ {g_{1} ={\rm ratio\; of\; growth\; respiration\; carbon\; :\; new\; growth\; carbon.\; }} \end{array} + +Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined as constants for a given PFT (Table +13.1), while :math:`g_{l }` = 0.3 (unitless) is prescribed as a +constant for all PFTs, based on construction costs for a range of woody +and non-woody tissues (Larcher, 1995). + +The model includes a dynamic allocation scheme for woody vegetation +(parameter :math:`a_{3}` = -1, Table 13.1), in which case the +ratio for carbon allocation between new stem and new leaf increases with +increasing net primary production (NPP), as + +.. math:: + :label: 17.8) + + a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 + +where :math:`NPP_{ann}` is the annual sum of NPP from the previous +year. This mechanism has the effect of increasing woody allocation in +favorable growth environments (Allen et al., 2005; Vanninen and Makela, +2005) and during the phase of stand growth prior to canopy closure +(Axelsson and Axelsson, 1986). + +Table 13.1. Allocation and carbon:nitrogen ratio parameters + ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | ++==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ +| NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| NET Boreal | 1 | 0.3 | -1 | 0.1 | 40 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| NDT Boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BET Tropical | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BET temperate | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT tropical | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT temperate | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDT boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BES temperate | 1 | 0.3 | 0.2 | 0.5 | 30 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| C\ :sub:`4` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Crop I | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Corn R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Corn I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Temp Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Temp Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Winter Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Winter Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Soybean R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +| Soybean I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | ++----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + +Carbon to nitrogen ratios are defined for different tissue types as +follows: + +.. math:: + :label: ZEqnNum413927 + + \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} + +where all C:N parameters are defined as constants for a given PFT (Table +13.1). + +Given values for the parameters in and , total carbon and nitrogen +allocation to new growth ( :math:`CF_{alloc}`, gC +m\ :sup:`-2` s\ :sup:`-1`, and :math:`NF_{alloc}`, gN +m\ :sup:`-2` s\ :sup:`-1`, respectively) can be expressed as +functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC +m\ :sup:`-2` s\ :sup:`-1`): + +.. math:: + :label: ZEqnNum555154 + + \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} + +where + +.. math:: + :label: 17.11) + + \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} + +.. math:: + :label: 17.12) + + N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. + +Since the C:N stoichiometry for new growth allocation is defined, from +Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation +(:math:`CF_{avail\_alloc}`) can be used to calculate the total +plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, +gN m\ :sup:`-2` s\ :sup:`-1`) as: + +.. math:: + :label: 17.13) + + NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . + +Deployment of retranslocated nitrogen +------------------------------------------ + +In many plants, some portion of the nitrogen used to construct new +tissues is mobilized from senescing tissues, especially leaves, and +retained within the plant when the tissues are lost as litter. This +store of retranslocated nitrogen is used to supply part of the nitrogen +demand for subsequent growth (Magill et al., 1997; Oikawa et al., 2005; +Son and Gower, 1991). CLM includes one pool of retranslocated nitrogen +(:math:`NS_{retrans}`, gN m\ :sup:`-2`), and the +availability of nitrogen from this pool to support new growth +(:math:`NF_{avail\_retrans}`, gN m\ :sup:`-2` +s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: + +.. math:: + :label: 17.14) + + NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) + +where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of retranslocated +nitrogen extracted from senescing tissues, +:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of +:math:`NF_{plant\_demand}`, and :math:`\Delta`\ *t* (s) is the +model’s biogeochemistry time step. This formulation produces an annual +cycle in the extraction of nitrogen from :math:`NS_{retrans}` +which corresponds to the annual cycle of plant nitrogen demand, and +which is scaled to give :math:`NS_{retrans}` approximately a +one-year turnover time. The minimum function prevents extraction of more +than the remaining pool of retranslocated nitrogen, which can be an +important constraint under conditions where high rates of mortality are +modifying the size of the pool. During the first year of an initial +simulation, before :math:`NF_{plant\_demand\_ann}` and +:math:`NF_{retrans\_ann}` have valid values, +:math:`NF_{avail\_retrans}` is set to 0.0. + +The actual flux of nitrogen from the retranslocated N pool into +allocation of new growth (:math:`NF_{retrans,alloc}`, gN +m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant +demand for new nitrogen: + +.. math:: + :label: 17.15) + + NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) + +Plant nitrogen uptake from soil mineral nitrogen pool +---------------------------------------------------------- + +The total plant nitrogen demand is reduced by the nitrogen flux from +:math:`NS_{retrans}` to give the plant demand for mineral nitrogen +from the soil (:math:`NF_{plant\_demand\_soil}`, gN +m\ :sup:`-2` s\ :sup:`-1`): + +.. math:: + :label: ZEqnNum491412 + + NF_{plant\_ demand\_ soil} =NF_{plant\_ demand} -NF_{retrans,alloc} . + +The combined demand from all PFTs sharing space on a soil column and the +demand from the heterotrophic community in the soil (nitrogen +immobilization demand) compete for the available soil mineral nitrogen +pool. The result of this competition is passed back to the allocation +algorithm as :math:`f_{plant\_demand}`, the fraction (from 0 to 1) +of the plant nitrogen demand which can be met given the current soil +mineral nitrogen supply and competition with heterotrophs. Plant uptake +from the soil mineral nitrogen pool is then given as: + +.. math:: + :label: 17.17) + + NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} + +Final carbon and nitrogen allocation +----------------------------------------- + +The total flux of allocated nitrogen is given as: + +.. math:: + :label: 17.18) + + NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} + +From the stoichiometric relationship in Eq. , the associated carbon +allocation flux is: + +.. math:: + :label: 17.19) + + CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . + +The downregulation of photosynthesis can then be calculated as: + +.. math:: + :label: 17.20) + + f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . + +Total allocation to new leaf carbon +(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: + +.. math:: + :label: 17.21) + + CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . + +There are two carbon pools associated with each plant tissue – one which +represents the currently displayed tissue, and another which represents +carbon stored for display in a subsequent growth period. The nitrogen +pools follow this same organization. The model keeps track of stored +carbon according to which tissue type it will eventually be displayed +as, and the separation between display in the current timestep and +storage for later display depends on the parameter :math:`f_{cur}` +(values 0 to 1). Given :math:`CF_{alloc,leaf}` and :math:`f_{cur}`, the allocation fluxes of carbon to display and +storage pools (where storage is indicated with *\_stor*) for the various +tissue types are given as: + +.. math:: + :label: 17.22) + + CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} + +.. math:: + :label: 17.23) + + CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) + +.. math:: + :label: 17.24) + + CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} + +.. math:: + :label: 17.25) + + CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) + +.. math:: + :label: 17.26) + + CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} + +.. math:: + :label: 17.27) + + CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) + +.. math:: + :label: 17.28) + + CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} + +.. math:: + :label: 17.29) + + CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) + +.. math:: + :label: 17.30) + + CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} + +.. math:: + :label: 17.31) + + CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) + +.. math:: + :label: 17.32) + + CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} + +.. math:: + :label: 17.33) + + CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). + +The corresponding nitrogen allocation fluxes are given as: + +.. math:: + :label: 17.34) + + NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} + +.. math:: + :label: 17.35) + + NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) + +.. math:: + :label: 17.36) + + NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} + +.. math:: + :label: 17.37) + + NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) + +.. math:: + :label: 17.38) + + NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} + +.. math:: + :label: 17.39) + + NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + +.. math:: + :label: 17.40) + + NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + +.. math:: + :label: 17.41) + + NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) + +.. math:: + :label: 17.42) + + NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} + +.. math:: + :label: 17.43) + + NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + +.. math:: + :label: 17.44) + + NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + +.. math:: + :label: 17.45) + + NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). + +Autotrophic Respiration +---------------------------- + +The model treats maintenance and growth respiration fluxes separately, +even though it is difficult to measure them as separate fluxes (Lavigne +and Ryan, 1997; Sprugel et al., 1995). Maintenance respiration is +defined as the carbon cost to support the metabolic activity of existing +live tissue, while growth respiration is defined as the additional +carbon cost for the synthesis of new growth. + +13.7.1 Maintenance Respiration +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Under the assumption that tissue nitrogen content is a suitable index of +cellular metabolic rate, maintenance respiration costs for live tissues +(leaf, live stem, live coarse root, and fine root) are calculated as +functions tissue nitrogen content and the relevant temperature, +following the empirical relationship reported by Ryan (1991): + +.. math:: + :label: 17.46) + + CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 17.47) + + CF_{mr\_ livestem} \_ =NS_{livestem} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 17.48) + + CF_{mr\_ livecroot} \_ =NS_{livecroot} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + +.. math:: + :label: 17.49) + + CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} + +where :math:`MR_{base}` (= 2.525e\ :sup:`-6` gC gN\ :sup:`-1` s\ :sup:`-1`) is the base rate of maintenance +respiration per unit nitrogen content, :math:`MR_{q10}` (= 2.0) is +the temperature sensitivity for maintenance respiration, +:math:`T_{2m}` (:sup:`o`\ C) is the air temperature at 2m +height, :math:`Ts_{j}`* (:sup:`o`\ C) is the soil +temperature at level *j*, and :math:`rootfr_{j}` is the fraction +of fine roots distributed in soil level *j*. + +Note that, for woody vegetation, maintenance respiration costs are not +calculated for the dead stem and dead coarse root components. These +components are assumed to consist of dead xylem cells, with no metabolic +function. By separating the small live component of the woody tissue +(ray parenchyma, phloem, and sheathing lateral meristem cells) from the +larger fraction of dead woody tissue, it is reasonable to assume a +common base maintenance respiration rate for all live tissue types. + +The total maintenance respiration cost is then given as: + +.. math:: + :label: 17.50) + + CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . + +13.7.2 Growth Respiration +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Growth respiration is calculated as a factor of 0.3 times the total +carbon in new growth on a given timestep, based on construction costs +for a range of woody and non-woody tissues (Larcher, 1995). For new +carbon and nitrogen allocation that enters storage pools for subsequent +display, it is not clear what fraction of the associated growth +respiration should occur at the time of initial allocation, and what +fraction should occur later, at the time of display of new growth from +storage. Eddy covariance estimates of carbon fluxes in forest ecosystems +suggest that the growth respiration associated with transfer of +allocated carbon and nitrogen from storage into displayed tissue is not +significant (Churkina et al., 2003), and so it is assumed in CLM that +all of the growth respiration cost is incurred at the time of initial +allocation, regardless of the fraction of allocation that is displayed +immediately (i.e. regardless of the value of :math:`f_{cur}`, +section 13.5). This behavior is parameterized in such a way that if +future research suggests that some fraction of the growth respiration +cost should be incurred at the time of display from storage, a simple +parameter modification will effect the change. [1]_ + +.. [1] + Parameter :math:`\text{grpnow}` in routines CNGResp and CNAllocation, currently set to 1.0, could be changed to a smaller + value to transfer some portion (1 - :math:`\text{grpnow}` ) of the growth respiration forward in time to occur at the time of growth + display from storage. + diff --git a/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst b/doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst similarity index 97% rename from doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst rename to doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst index 9568b91b16..773b3f2fe6 100644 --- a/doc/source/tech_note/CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst +++ b/doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst @@ -25,7 +25,7 @@ cell to its downstream neighboring grid cell. The change in storage cell (m\ :sup:`3` s\ :sup:`-1`) is .. math:: - :label: 11.1) + :label: 14.1) \frac{dS}{dt} =\sum F_{in} -F_{out} +R @@ -42,7 +42,7 @@ model (Graham et al. 1999). The flux of water leaving the grid cell :math:`F_{out}` is .. math:: - :label: 11.2) + :label: 14.2) F_{out} =\frac{v}{d} S @@ -57,7 +57,7 @@ and channel roughness data are not available globally, so a simplified effective flow velocity expression is used in RTM .. math:: - :label: 11.3) + :label: 14.3) v=\max \left(0.05,k\beta ^{1/2} \right) @@ -68,14 +68,14 @@ The distance :math:`d` between two grid cell centers depends on river direction, latitude, and longitude as .. math:: - :label: 11.4) + :label: 14.4) d=\sqrt{\Delta x^{2} +\Delta y^{2} } . The distance in the zonal direction :math:`\Delta x` (m) is .. math:: - :label: 11.5) + :label: 14.5) \Delta x=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right)\left[0.5\left(\cos \phi _{i,\, j} +\cos \phi _{i*,\, j*} \right)\right] @@ -88,7 +88,7 @@ are grid cell indices. The distance in the meridional direction :math:`\Delta y` (m) is .. math:: - :label: 11.6) + :label: 14.6) \Delta y=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right). @@ -99,7 +99,7 @@ total liquid water runoff at the land model resolution (kg m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 11.7) + :label: 14.7) R_{liq} =q_{over} +q_{drai} +q_{rgwl} @@ -110,7 +110,7 @@ where :math:`q_{over}` is surface runoff (section 7.3), 9.6.3). The total ice water runoff, also at the land model resolution is .. math:: - :label: 11.8) + :label: 14.8) R_{ice} =q_{snwcp,ice} @@ -134,7 +134,7 @@ as a diagnostic tool. The river-routing scheme conserves water globally as .. math:: - :label: 11.9) + :label: 14.9) \sum _{i,\, j}\left(\frac{dS}{dt} \right) _{i,\, j} =\sum _{i,\, j}R_{i,\, j} . diff --git a/doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst rename to doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst diff --git a/doc/source/tech_note/CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst rename to doc/source/tech_note/References/CLM50_Tech_Note_References.rst diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst new file mode 100644 index 0000000000..d84d3c8a3d --- /dev/null +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -0,0 +1,4 @@ +.. _rst_Snow Hydrology: + +Snow Hydrology +============== diff --git a/doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst rename to doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst diff --git a/doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst similarity index 100% rename from doc/source/tech_note/CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst rename to doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst diff --git a/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst similarity index 99% rename from doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst rename to doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index d967dae888..fad229fe7c 100644 --- a/doc/source/tech_note/CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -56,12 +56,12 @@ algorithm, and :math:`n` is the index value for the :math:`dynpft\_ year(n)=year_{cur}` : .. math:: - :label: 21.1) + :label: 26.1) nt_{1} =\left\{\begin{array}{l} {1\qquad {\rm for}\qquad year_{cur} TKFRZ} \\ {FD_{sum}^{n-1} \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \end{array}\right. . @@ -616,7 +616,7 @@ carbon fluxes, and to Eqs. - for nitrogen fluxes. The onset counter is decrement until it reaches zero, signaling the end of the onset period: .. math:: - :label: 14.67) + :label: 20.67) t_{onfset}^{n} =t_{onfset}^{n-1} -\Delta t @@ -634,7 +634,7 @@ period of dry soils, this control variable can increase or decrease, as follows: .. math:: - :label: 14.68) + :label: 20.68) OSWI_{sum}^{n} =\left\{\begin{array}{l} {OSWI_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }\Psi _{s,3} \le \Psi _{offset} } \\ {{\rm max}\left(OSWI_{sum}^{n-1} -f_{day} ,0\right)\qquad {\rm for\; }\Psi _{s,3} >\Psi _{onset} } \end{array}\right. @@ -648,7 +648,7 @@ accumulator (:math:`{OFD}_{sum}`, d). To test for a sustained period of cold temperature, this variable can increase or decrease, as follows: .. math:: - :label: 14.69) + :label: 20.69) OFD_{sum}^{n} =\left\{\begin{array}{l} {OFD_{sum}^{n-1} +f_{day} \qquad \qquad \qquad {\rm for\; }T_{s,3} \le TKFRZ} \\ {{\rm max}\left(OFD_{sum}^{n-1} -f_{day} ,0\right)\qquad \qquad {\rm for\; }T_{s,3} >TKFRZ} \end{array}\right. @@ -664,7 +664,7 @@ offset period, until it reaches zero, signaling the end of the offset period: .. math:: - :label: 14.70) + :label: 20.70) t_{offset}^{n} =t_{offset}^{n-1} -\Delta t @@ -682,14 +682,14 @@ of an offset period :math:`{n}_{days\_active}` is reset to 0. A long growing season control variable (*LGS*, range 0 to 1) is calculated as: .. math:: - :label: 14.71) + :label: 20.71) LGS=\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }n_{days\_ active} <365} \\ {\left({n_{days\_ active} \mathord{\left/ {\vphantom {n_{days\_ active} 365}} \right. \kern-\nulldelimiterspace} 365} \right)-1\qquad {\rm for\; }365\le n_{days\_ active} <730} \\ {1\qquad \qquad \qquad {\rm for\; }n_{days\_ active} \ge 730} \end{array}\right. . The rate coefficient for background litterfall (:math:`{r}_{bglf}`, s\ :sup:`-1`) is calculated as a function of *LGS*: .. math:: - :label: 14.72) + :label: 20.72) r_{bglf} =\frac{LGS}{\tau _{leaf} \cdot 365\cdot 86400} @@ -699,71 +699,71 @@ where :math:`{\tau}_{leaf}` is the leaf longevity. The result is a shift to cont The rate coefficient for background onset growth from the transfer pools ( :math:`{r}_{bgtr}`, s\ :sup:`-1`) also depends on *LGS*, as: .. math:: - :label: 14.73) + :label: 20.73) r_{bgtr} =\frac{LGS}{365\cdot 86400} . On each timestep with :math:`{r}_{bgtr}` :math:`\neq` 0, carbon fluxes from storage to transfer pools are calculated as: .. math:: - :label: 14.74) + :label: 20.74) CF_{leaf\_ stor,leaf\_ xfer} =CS_{leaf\_ stor} r_{bgtr} .. math:: - :label: 14.75) + :label: 20.75) CF_{froot\_ stor,froot\_ xfer} =CS_{froot\_ stor} r_{bgtr} .. math:: - :label: 14.76) + :label: 20.76) CF_{livestem\_ stor,livestem\_ xfer} =CS_{livestem\_ stor} r_{bgtr} .. math:: - :label: 14.77) + :label: 20.77) CF_{deadstem\_ stor,deadstem\_ xfer} =CS_{deadstem\_ stor} r_{bgtr} .. math:: - :label: 14.78) + :label: 20.78) CF_{livecroot\_ stor,livecroot\_ xfer} =CS_{livecroot\_ stor} r_{bgtr} .. math:: - :label: 14.79) + :label: 20.79) CF_{deadcroot\_ stor,deadcroot\_ xfer} =CS_{deadcroot\_ stor} r_{bgtr} , with corresponding nitrogen fluxes: .. math:: - :label: 14.80) + :label: 20.80) NF_{leaf\_ stor,leaf\_ xfer} =NS_{leaf\_ stor} r_{bgtr} .. math:: - :label: 14.81) + :label: 20.81) NF_{froot\_ stor,froot\_ xfer} =NS_{froot\_ stor} r_{bgtr} .. math:: - :label: 14.82) + :label: 20.82) NF_{livestem\_ stor,livestem\_ xfer} =NS_{livestem\_ stor} r_{bgtr} .. math:: - :label: 14.83) + :label: 20.83) NF_{deadstem\_ stor,deadstem\_ xfer} =NS_{deadstem\_ stor} r_{bgtr} .. math:: - :label: 14.84) + :label: 20.84) NF_{livecroot\_ stor,livecroot\_ xfer} =NS_{livecroot\_ stor} r_{bgtr} .. math:: - :label: 14.85) + :label: 20.85) NF_{deadcroot\_ stor,deadcroot\_ xfer} =NS_{deadcroot\_ stor} r_{bgtr} . @@ -790,32 +790,32 @@ calculated using a weighted average of the fluxes originating at the PFT level. Carbon fluxes are calculated as: .. math:: - :label: 14.86) + :label: 20.86) CF_{leaf,lit1} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} .. math:: - :label: 14.87) + :label: 20.87) CF_{leaf,lit2} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} .. math:: - :label: 14.88) + :label: 20.88) CF_{leaf,lit3} =\sum _{p=0}^{npfts}CF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} .. math:: - :label: 14.89) + :label: 20.89) CF_{froot,lit1} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lab\_ froot,p} wcol_{p} .. math:: - :label: 14.90) + :label: 20.90) CF_{froot,lit2} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{cel\_ froot,p} wcol_{p} .. math:: - :label: 14.91) + :label: 20.91) CF_{froot,lit3} =\sum _{p=0}^{npfts}CF_{froot,litter} f_{lig\_ froot,p} wcol_{p} , @@ -832,32 +832,32 @@ C:N of the senescent tissue, and so are distributed using the same fractions used for carbon fluxes: .. math:: - :label: 14.92) + :label: 20.92) NF_{leaf,lit1} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lab\_ leaf,p} wcol_{p} .. math:: - :label: 14.93) + :label: 20.93) NF_{leaf,lit2} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{cel\_ leaf,p} wcol_{p} .. math:: - :label: 14.94) + :label: 20.94) NF_{leaf,lit3} =\sum _{p=0}^{npfts}NF_{leaf,litter} f_{lig\_ leaf,p} wcol_{p} .. math:: - :label: 14.95) + :label: 20.95) NF_{froot,lit1} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lab\_ froot,p} wcol_{p} .. math:: - :label: 14.96) + :label: 20.96) NF_{froot,lit2} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{cel\_ froot,p} wcol_{p} .. math:: - :label: 14.97) + :label: 20.97) NF_{froot,lit3} =\sum _{p=0}^{npfts}NF_{froot,litter} f_{lig\_ froot,p} wcol_{p} . diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 4141a560bc..74a39e908b 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -13,31 +13,36 @@ CLM Technical Note :maxdepth: 2 :numbered: - CHAPTER_1/CLM50_Tech_Note_Chpt_1_Introduction.rst - CHAPTER_2/CLM50_Tech_Note_Chpt_2_Ecosystem.rst - CHAPTER_3/CLM50_Tech_Note_Chpt_3_Surface_Albedos.rst - CHAPTER_4/CLM50_Tech_Note_Chpt_4_Radiative_Fluxes.rst - CHAPTER_5/CLM50_Tech_Note_Chpt_5_Fluxes.rst - CHAPTER_6/CLM50_Tech_Note_Chpt_6_Soil_Snow_Temperatures.rst - CHAPTER_7/CLM50_Tech_Note_Chpt_7_Hydrology.rst - CHAPTER_8/CLM50_Tech_Note_Chpt_8_Photosynthesis.rst - CHAPTER_9/CLM50_Tech_Note_Chpt_9_Lake.rst - CHAPTER_10/CLM50_Tech_Note_Chpt_10_Glacier.rst - CHAPTER_11/CLM50_Tech_Note_Chpt_11_RTM.rst - CHAPTER_12/CLM50_Tech_Note_Chpt_12_Urban.rst - CHAPTER_13/CLM50_Tech_Note_Chpt_13_CN_Allocation_Respiration.rst - CHAPTER_14/CLM50_Tech_Note_Chpt_14_Vegetation_Phenology.rst - CHAPTER_15/CLM50_Tech_Note_Chpt_15_Decomposition.rst - CHAPTER_16/CLM50_Tech_Note_Chpt_16_External_Nitrogen_Cycle.rst - CHAPTER_17/CLM50_Tech_Note_Chpt_17_Plant_Mortality.rst - CHAPTER_18/CLM50_Tech_Note_Chpt_18_Fire.rst - CHAPTER_19/CLM50_Tech_Note_Chpt_19_Methane.rst - CHAPTER_20/CLM50_Tech_Note_Chpt_20_Crop_Irrigation.rst - CHAPTER_21/CLM50_Tech_Note_Chpt_21_Transient_Landcover.rst - CHAPTER_22/CLM50_Tech_Note_Chpt_22_DGVM.rst - CHAPTER_23/CLM50_Tech_Note_Chpt_23_BVOCs.rst - CHAPTER_24/CLM50_Tech_Note_Chpt_24_Dust.rst - CHAPTER_25/CLM50_Tech_Note_Chpt_25_Isotopes.rst - CHAPTER_26/CLM50_Tech_Note_Chpt_26_Offline.rst - CHAPTER_27/CLM50_Tech_Note_Chpt_27_References.rst + Introduction/CLM50_Tech_Note_Introduction.rst + Ecosystem/CLM50_Tech_Note_Ecosystem.rst + Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst + Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst + Fluxes/CLM50_Tech_Note_Fluxes.rst + Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst + Hydrology/CLM50_Tech_Note_Hydrology.rst + Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst + Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst + Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst + Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst + Lake/CLM50_Tech_Note_Lake.rst + Glacier/CLM50_Tech_Note_Glacier.rst + RTM/CLM50_Tech_Note_RTM.rst + Urban/CLM50_Tech_Note_Urban.rst + CN_Pools/CLM50_Tech_Note_CN_Pools.rst + Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst + FUN/CLM50_Tech_Note_FUN.rst + CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst + Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst + Decomposition/CLM50_Tech_Note_Decomposition.rst + External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst + Fire/CLM50_Tech_Note_Fire.rst + Methane/CLM50_Tech_Note_Methane.rst + Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst + Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst + DGVM/CLM50_Tech_Note_DGVM.rst + BVOCs/CLM50_Tech_Note_BVOCs.rst + Dust/CLM50_Tech_Note_Dust.rst + Isotopes/CLM50_Tech_Note_Isotopes.rst + Offline/CLM50_Tech_Note_Offline.rst + References/CLM50_Tech_Note_References.rst From 0024f6a24bb609555e8220d3f57d870723f0b5c2 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 18 May 2017 13:07:45 -0600 Subject: [PATCH 014/730] split hydrology & snow hydrology --- doc/source/conf.py | 7 + .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 16 +- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 697 +---------------- .../CLM50_Tech_Note_Snow_Hydrology.rst | 710 +++++++++++++++++- ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 10 + .../CLM50_Tech_Note_Surface_Albedos.rst | 10 + 6 files changed, 775 insertions(+), 675 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index dc9a7b7ea8..2d69cb46bd 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -162,3 +162,10 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} + +numfig = True +numfig_format = {'figure': 'Figure %s', + 'table': 'Table %s', + 'code-block': 'Code %s', + 'section': '%s', + } diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 2d2eb57337..868d8409a6 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -94,6 +94,8 @@ from the atmospheric specific humidity :math:`q_{atm}` e_{atm} =\frac{q_{atm} P_{atm} }{0.622+0.378q_{atm} } . +.. _Monin-Obukhov Similarity Theory: + Monin-Obukhov Similarity Theory ----------------------------------- @@ -430,7 +432,7 @@ calculate the surface momentum, sensible heat, and water vapor flux using atmospheric and surface values for :math:`\left|{\it u}\right|`, :math:`\theta` , and :math:`q` except that :math:`L` depends on :math:`u_{*}` , :math:`\theta _{*}` , and :math:`q_{*}` . However, the -bulk CityplaceRichardson number +bulk Richardson number .. math:: :label: ZEqnNum750428} @@ -554,6 +556,8 @@ Chapter 24) u_{10m} =\left\{\begin{array}{l} {V_{a} \qquad z_{atm,\, m} \le 10} \\ {V_{a} -\frac{u_{*} }{k} \left[\ln \left(\frac{z_{atm,\, m} -d}{10+z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{10+z_{0m} }{L} \right)\right]\qquad z_{atm,\, m} >10} \end{array}\right\} +.. _Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces: + Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces -------------------------------------------------------------- @@ -813,6 +817,8 @@ determined analytically, are ignored for :math:`\frac{\partial H_{g} }{\partial T_{g} }` and :math:`\frac{\partial E_{g} }{\partial T_{g} }` . +.. _Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces: + Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces -------------------------------------------------------------------------- @@ -828,6 +834,8 @@ using the ground temperature from the previous time step. In section 5.3.1, the equations used in the iteration scheme are derived. Details on the numerical scheme are provided in section 5.3.2. +.. _Theory: + Theory ^^^^^^^^^^^^ @@ -1302,6 +1310,8 @@ Table 5.1. Plant functional type aerodynamic parameters | Soybean I | 0.120 | 0.68 | 0.04 | +----------------------------------+--------------------+------------------+-------------------------+ +.. _Numerical Implementation: + Numerical Implementation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1529,6 +1539,8 @@ flux later. #. 2-m height air temperature :math:`T_{2m}` , specific humidity :math:`q_{2m}` , relative humidity :math:`RH_{2m}` \ (eqs. , , ) +.. _Update of Ground Sensible and Latent Heat Fluxes: + Update of Ground Sensible and Latent Heat Fluxes ---------------------------------------------------- @@ -1667,6 +1679,8 @@ The system balances energy as \overrightarrow{S}_{g} +\overrightarrow{S}_{v} +L_{atm} \, \downarrow -L\, \uparrow -H_{v} -H_{g} -\lambda _{vap} E_{v} -\lambda E_{g} -G=0. +.. _Saturation Vapor Pressure: + Saturation Vapor Pressure ----------------------------- diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 59751de56c..205a14c0e6 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -39,6 +39,8 @@ Figure 7.1. Hydrologic processes represented in CLM. .. image:: image1.png +.. _Canopy Water: + Canopy Water ---------------- @@ -143,678 +145,7 @@ while the fraction of the canopy that is dry and transpiring is f_{dry} =\left\{\begin{array}{l} {\frac{\left(1-f_{wet} \right)L}{L+S} \qquad L+S>0} \\ {0\qquad L+S=0} \end{array}\right\}. -Snow --------- - -The parameterizations for snow are based primarily on Anderson (1976), -country-regionplaceJordan (1991), and Dai and Zeng (1997). The snowpack -can have up to five layers. These layers are indexed in the Fortran code -as :math:`i=-4,-3,-2,-1,0` where layer :math:`i=0` is the snow layer -next to the top soil layer and layer :math:`i=-4` is the top layer of a -five-layer snow pack. Since the number of snow layers varies according -to the snow depth, we use the notation :math:`snl+1` to describe the top -layer of snow for the variable layer snow pack, where :math:`snl` is the -negative of the number of snow layers. Refer to Figure 7.2 for an -example of the snow layer structure for a three layer snow pack. - -Figure 7.2. Example of three layer snow pack (:math:`snl=-3`). - -Shown are three snow layers, :math:`i=-2`, :math:`i=-1`, and -:math:`i=0`. The layer node depth is :math:`z`, the layer interface is -:math:`z_{h}` , and the layer thickness is :math:`\Delta z`. - -.. image:: image2.png - -The state variables for snow are the mass of water :math:`w_{liq,i}` -(kg m\ :sup:`-2`), mass of ice :math:`w_{ice,i}` (kg -m\ :sup:`-2`), layer thickness :math:`\Delta z_{i}` (m), and -temperature :math:`T_{i}` (Chapter 6). The water vapor phase is -neglected. Snow can also exist in the model without being represented by -explicit snow layers. This occurs when the snowpack is less than a -specified minimum snow depth (:math:`z_{sno} <0.01` m). In this case, -the state variable is the mass of snow :math:`W_{sno}` (kg -m\ :sup:`-2`). - -Section 7.2.1 describes the calculation of fractional snow covered area, -which is used in the surface albedo calculation (Chapter 3) and the -surface flux calculations (Chapter 5). The following two sections (7.2.2 -and 7.2.3) describe the ice and water content of the snow pack assuming -that at least one snow layer exists. Section 7.2.4 describes how black -and organic carbon and mineral dust particles are represented within -snow, including meltwater flushing. See section 7.2.5 for a description -of how a snow layer is initialized. - -Snow Covered Area Fraction -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The fraction of the ground covered by snow, :math:`f_{sno}` , is based -on the method of Swenson and Lawrence (2012). Because the processes -governing snowfall and snowmelt differ, changes in :math:`f_{sno}` are -calculated separately for accumulation and depletion. When snowfall -occurs, :math:`f_{sno}` is updated as - -.. math:: - :label: 7.14) - - f^{n+1} _{sno} =1-\left(\left(1-\tanh (k_{accum} q_{sno} \Delta t)\right)\left(1-f^{n} _{sno} \right)\right) - -where :math:`k_{accum}` is a constant whose default value is 0.1, -:math:`q_{sno} \Delta t` is the amount of new snow, -:math:`f^{n+1} _{sno}` is the updated snow covered fraction (SCF), and -:math:`f^{n} _{sno}` is the SCF from the previous time step. - -When snow melt occurs, :math:`f_{sno}` is calculated from the depletion -curve - -.. math:: - :label: 7.15) - - f_{sno} =1-\left(\frac{\cos ^{-1} \left(2R_{sno} -1\right)}{\pi } \right)^{N_{melt} } - -where :math:`R_{sno}` is the ratio of :math:`W_{sno}` to the maximum -accumulated snow :math:`W_{\max }` , and :math:`N_{melt}` is a -parameter that depends on the topographic variability within the grid -cell. Whenever :math:`W_{sno}` reaches zero, :math:`W_{\max }` is -reset to zero. The depletion curve shape parameter is defined as - -.. math:: - :label: 7.16) - - N_{melt} =\frac{200}{\min \left(10,\sigma _{topo} \right)} - -The standard deviation of the elevation within a grid cell, -:math:`\sigma _{topo}` , is calculated from a high resolution DEM (a -1km DEM is used for CLM). - -Ice Content -^^^^^^^^^^^^^^^^^ - -The conservation equation for mass of ice in snow layers is - -.. math:: - :label: 7.17) - - \frac{\partial w_{ice,\, i} }{\partial t} =\left\{\begin{array}{l} {f_{sno} q_{ice,\, i-1} -\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+1} \\ {-\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+2,\ldots ,0} \end{array}\right\} - -where :math:`q_{ice,\, i-1}` is the rate of ice accumulation from -precipitation or frost or the rate of ice loss from sublimation (kg -m\ :sup:`-2` s\ :sup:`-1`) in the top layer and -:math:`{\left(\Delta w_{ice,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{ice,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` -is the change in ice due to phase change (melting rate) (section 6.2). -The term :math:`q_{ice,\, i-1}` is computed in two steps as - -.. math:: - :label: 7.18) - - q_{ice,\, i-1} =q_{grnd,\, ice} +\left(q_{frost} -q_{subl} \right) - -where :math:`q_{grnd,\, ice}` is the rate of solid precipitation -reaching the ground (section 7.1) and :math:`q_{frost}` and -:math:`q_{subl}` are gains due to frost and losses due to sublimation, -respectively (section 5.4). In the first step, immediately after -:math:`q_{grnd,\, ice}` has been determined after accounting for -interception (section 7.1), a new snow depth :math:`z_{sno}` (m) is -calculated from - -.. math:: - :label: 7.19) - - z_{sno}^{n+1} =z_{sno}^{n} +\Delta z_{sno} - -where - -.. math:: - :label: 7.20) - - \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } - -and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg -m\ :sup:`-3`) (CityplaceAnderson 1976) - -.. math:: - :label: 7.21) - - \rho _{sno} =\left\{\begin{array}{l} {50+1.7\left(17\right)^{1.5} \qquad T_{atm} >T_{f} +2} \\ {50+1.7\left(T_{atm} -T_{f} +15\right)^{1.5} \qquad T_{f} -15T_{f}` ). In this case, the incoming solid precipitation -is assigned to the runoff term :math:`q_{rgwl}` (section 7.7). - -In the second step, after surface fluxes and snow/soil temperatures have -been determined (Chapters 5 and 6), :math:`w_{ice,\, snl+1}` is updated -for frost or sublimation as - -.. math:: - :label: ZEqnNum863244 - - w_{ice,\, snl+1}^{n+1} =w_{ice,\, snl+1}^{n} +f_{sno} \left(q_{frost} -q_{subl} \right)\Delta t. - -If :math:`w_{ice,\, snl+1}^{n+1} <0` upon solution of equation , the ice -content is reset to zero and the liquid water content -:math:`w_{liq,\, snl+1}` is reduced by the amount required to bring -:math:`w_{ice,\, snl+1}^{n+1}` up to zero. - -The snow water equivalent :math:`W_{sno}` is capped to not exceed 1000 -kg m\ :sup:`-2`. If the addition of :math:`q_{frost}` were to -result in :math:`W_{sno} >1000` kg m\ :sup:`-2`, the frost term -:math:`q_{frost}` is instead added to the ice runoff term -:math:`q_{snwcp,\, ice}` (section 7.7). - -Water Content -^^^^^^^^^^^^^^^^^^^ - -The conservation equation for mass of water in snow layers is - -.. math:: - :label: 7.26) - - \frac{\partial w_{liq,\, i} }{\partial t} =\left(q_{liq,\, i-1} -q_{liq,\, i} \right)+\frac{\left(\Delta w_{liq,\, i} \right)_{p} }{\Delta t} - -where :math:`q_{liq,\, i-1}` is the flow of liquid water into layer -:math:`i` from the layer above, :math:`q_{liq,\, i}` is the flow of -water out of layer :math:`i` to the layer below, -:math:`{\left(\Delta w_{liq,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{liq,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` -is the change in liquid water due to phase change (melting rate) -(section 6.2). For the top snow layer only, - -.. math:: - :label: 7.27) - - q_{liq,\, i-1} =f_{sno} \left(q_{grnd,\, liq} +\left(q_{sdew} -q_{seva} \right)\right) - -where :math:`q_{grnd,\, liq}` is the rate of liquid precipitation -reaching the snow (section 7.1), :math:`q_{seva}` is the evaporation of -liquid water and :math:`q_{sdew}` is the liquid dew (section 5.4). -After surface fluxes and snow/soil temperatures have been determined -(Chapters 5 and 6), :math:`w_{liq,\, snl+1}` is updated for the liquid -precipitation reaching the ground and dew or evaporation as - -.. math:: - :label: 7.28) - - w_{liq,\, snl+1}^{n+1} =w_{liq,\, snl+1}^{n} +f_{sno} \left(q_{grnd,\, liq} +q_{sdew} -q_{seva} \right)\Delta t. - -When the liquid water within a snow layer exceeds the layer’s holding -capacity, the excess water is added to the underlying layer, limited by -the effective porosity (:math:`1-\theta _{ice}` ) of the layer. The flow -of water is assumed to be zero (:math:`q_{liq,\, i} =0`) if the -effective porosity of either of the two layers -(:math:`1-\theta _{ice,\, i} {\rm \; and\; }1-\theta _{ice,\, i+1}` ) is -less than :math:`\theta _{imp} =0.05`, the water impermeable volumetric -water content. Thus, water flow between layers, :math:`q_{liq,\, i}` , -for layers :math:`i=snl+1,\ldots ,0`, is initially calculated as - -.. math:: - :label: ZEqnNum767577 - - q_{liq,\, i} =\frac{\rho _{liq} \left[\theta _{liq,\, i} -S_{r} \left(1-\theta _{ice,\, i} \right)\right]f_{sno} \Delta z_{i} }{\Delta t} \ge 0 - -where the volumetric liquid water :math:`\theta _{liq,\, i}` and ice -:math:`\theta _{ice,\, i}` contents are - -.. math:: - :label: 7.30) - - \theta _{ice,\, i} =\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } \le 1 - -.. math:: - :label: 7.31) - - \theta _{liq,\, i} =\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \le 1-\theta _{ice,\, i} , - -and :math:`S_{r} =0.033` is the irreducible water saturation (snow -holds a certain amount of liquid water due to capillary retention after -drainage has ceased (Anderson 1976)). The water holding capacity of the -underlying layer limits the flow of water :math:`q_{liq,\, i}` -calculated in equation , unless the underlying layer is the surface soil -layer, as - -.. math:: - :label: 7.32) - - q_{liq,\, i} \le \frac{\rho _{liq} \left[1-\theta _{ice,\, i+1} -\theta _{liq,\, i+1} \right]\Delta z_{i+1} }{\Delta t} \qquad i=snl+1,\ldots ,-1. - -The liquid water content :math:`w_{liq,\, i}` is updated as - -.. math:: - :label: ZEqnNum265203 - - w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\left(q_{i-1} -q_{i} \right)\Delta t. - -Equations - are solved sequentially from top (:math:`i=snl+1`) to -bottom (:math:`i=0`) snow layer in each time step. The total flow of -liquid water reaching the soil surface is then :math:`q_{liq,\, 0}` -which is used in the calculation of surface runoff and infiltration -(section 7.3). - -Black and organic carbon and mineral dust within snow -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Particles within snow originate from atmospheric aerosol deposition -(:math:`D_{sp}` in Table 2.3 (kg m\ :sup:`-2` s\ :sup:`-1`) -and influence snow radiative transfer (sections 3.2.1, 3.2.2, and -3.3.3). Particle masses and mixing ratios are represented with a simple -mass-conserving scheme. The model maintains masses of the following -eight particle species within each snow layer: hydrophilic black carbon, -hydrophobic black carbon, hydrophilic organic carbon, hydrophobic -organic carbon, and four species of mineral dust with the following -particle sizes: 0.1-1.0, 1.0-2.5, 2.5-5.0, and 5.0-10.0 :math:`\mu m`. -Each of these species has unique optical properties (Table 3.5) and -meltwater removal efficiencies (Table 7.1). - -The black carbon and organic carbon deposition rates described in Table -2.3 are combined into four categories as follows - -.. math:: - :label: 7.34) - - D_{bc,\, hphil} =D_{bc,\, dryhphil} +D_{bc,\, wethphil} - -.. math:: - :label: 7.35) - - D_{bc,\, hphob} =D_{bc,\, dryhphob} - -.. math:: - :label: 7.36) - - D_{oc,\, hphil} =D_{oc,\, dryhphil} +D_{oc,\, wethphil} - -.. math:: - :label: 7.37) - - D_{oc,\, hphob} =D_{oc,\, dryhphob} - -Deposited particles are assumed to be instantly mixed (homogeneously) -within the surface snow layer and are added after the inter-layer water -fluxes are computed (section 7.2.3) so that some aerosol is in the top -layer after deposition and is not immediately washed out before -radiative calculations are done. Particle masses are then redistributed -each time step based on meltwater drainage through the snow column -(section 7.2.3) and snow layer combination and subdivision (section -7.2.7). The change in mass of each of the particle species -:math:`\Delta m_{sp,\, i}` (kg m\ :sup:`-2`) is - -.. math:: - :label: 7.38) - - \Delta m_{sp,\, i} =\left[k_{sp} \left(q_{liq,\, i-1} c_{sp,\, i-1} -q_{liq,\, i} c_{i} \right)+D_{sp} \right]\Delta t - -where :math:`k_{sp}` is the meltwater scavenging efficiency that is -unique for each species (Table 7.1), :math:`q_{liq,\, i-1}` is the flow -of liquid water into layer :math:`i` from the layer above, -:math:`q_{liq,\, i}` is the flow of water out of layer :math:`i` into -the layer below (kg m\ :sup:`-2` s\ :sup:`-1`) (section -7.2.3), :math:`c_{sp,\, i-1}` and :math:`c_{sp,\, i}` are the particle -mass mixing ratios in layers :math:`i-1` and :math:`i` (kg -kg\ :sup:`-1`), :math:`D_{sp}` is the atmospheric deposition rate -(zero for all layers except layer :math:`snl+1`), and :math:`\Delta t` -is the model time step (s). The particle mass mixing ratio is - -.. math:: - :label: 7.39) - - c_{i} =\frac{m_{sp,\, i} }{w_{liq,\, i} +w_{ice,\, i} } . - -Values of :math:`k_{sp}` are partially derived from experiments -published by Conway et al. (1996). Particles masses are re-distributed -proportionately with snow mass when layers are combined or divided, thus -conserving particle mass within the snow column. The mass of particles -carried out with meltwater through the bottom snow layer is assumed to -be permanently lost from the snowpack, and is not maintained within the -model. - -Table 7.1. Meltwater scavenging efficiency for particles within snow - -+------------------------------------------+-------------------+ -| Species | :math:`k_{sp}` | -+==========================================+===================+ -| Hydrophilic black carbon | 0.20 | -+------------------------------------------+-------------------+ -| Hydrophobic black carbon | 0.03 | -+------------------------------------------+-------------------+ -| Hydrophilic organic carbon | 0.20 | -+------------------------------------------+-------------------+ -| Hydrophobic organic carbon | 0.03 | -+------------------------------------------+-------------------+ -| Dust species 1 (0.1-1.0 :math:`\mu m`) | 0.02 | -+------------------------------------------+-------------------+ -| Dust species 2 (1.0-2.5 :math:`\mu m`) | 0.02 | -+------------------------------------------+-------------------+ -| Dust species 3 (2.5-5.0 :math:`\mu m`) | 0.01 | -+------------------------------------------+-------------------+ -| Dust species 4 (5.0-10.0 :math:`\mu m`) | 0.01 | -+------------------------------------------+-------------------+ - -Initialization of snow layer -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -If there are no existing snow layers (:math:`snl+1=1`) but -:math:`z_{sno} \ge 0.01` m after accounting for solid precipitation -:math:`q_{sno}` , then a snow layer is initialized (:math:`snl=-1`) as -follows - -.. math:: - :label: 7.40) - - \begin{array}{l} {\Delta z_{0} =z_{sno} } \\ {z_{o} =-0.5\Delta z_{0} } \\ {z_{h,\, -1} =-\Delta z_{0} } \\ {T_{0} =\min \left(T_{f} ,T_{atm} \right)} \\ {w_{ice,\, 0} =W_{sno} } \\ {w_{liq,\, 0} =0} \end{array}. - -Snow Compaction -^^^^^^^^^^^^^^^^^^^^^ - -Snow compaction is initiated after the soil hydrology calculations -[surface runoff (section 7.3), infiltration (section 7.3), soil water -(section 7.4), groundwater-soilwater interactions (section 7.6)] are -complete. Compaction of snow includes three types of processes: -destructive metamorphism of new snow (crystal breakdown due to wind or -thermodynamic stress); snow load or overburden (pressure); and melting -(changes in snow structure due to melt-freeze cycles plus changes in -crystals due to liquid water). The total fractional compaction rate for -each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the -three compaction processes - -.. math:: - :label: 7.41) - - C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} . - -Compaction is not allowed if the layer is saturated - -.. math:: - :label: 7.42) - - 1-\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } +\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \right)\le 0.001 - -or if the ice content is below a minimum value -(:math:`w_{ice,\, i} \le 0.1`). - -Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (CityplaceAnderson 1976) - -.. math:: - :label: 7.43) - - C_{R1,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{metamorphism} =-c_{3} c_{1} c_{2} \exp \left[-c_{4} \left(T_{f} -T_{i} \right)\right] - -where :math:`c_{3} =2.777\times 10^{-6}` (s\ :sup:`-1`) is the fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` K\ :sup:`-1`, and - -.. math:: - :label: 7.44) - - c_{1} & = 1\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ - c_{1} & = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right]\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ - c_{2} & = 2\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ - c_{2} & = 1\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 - -where -:math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` -and -:math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` -are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). - -The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (CityplaceAnderson 1976) - -.. math:: - :label: 7.45) - - C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } - -where :math:`\eta` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and temperature as - -.. math:: - :label: 7.46) - - \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] - -where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :sup:`-2`, and -:math:`c_{5} =0.08` K\ :sup:`-1`, :math:`c_{6} =0.023` -m\ :sup:`3` kg\ :sup:`-1` are constants. The snow load -pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of -the ice :math:`w_{ice,\, i}` and liquid water contents -:math:`w_{liq,\, i}` of the layers above plus half the ice and liquid -water contents of the layer being compacted - -.. math:: - :label: 7.47) - - P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . - -The compaction rate due to melting :math:`C_{R3,\; i}` (s\ :sup:`-1`) is taken to be the ratio of the change in snow ice -mass after the melting to the mass before melting - -.. math:: - :label: 7.48) - - C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) - -and melting is identified during the phase change calculations (section -6.2). Because snow depth is defined as the average depth of the snow -covered area, the snow depth must also be updated for changes in -:math:`f_{sno}` . - -.. math:: - :label: 7.49) - - C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) - -The snow layer thickness after compaction is then - -.. math:: - :label: 7.50) - - \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). - -Snow Layer Combination and Subdivision -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -After the determination of snow temperature including phase change -(Chapter 6), snow hydrology (sections 7.2.2, 7.2.3, and 7.2.4), and the -compaction calculations , the number of snow layers is adjusted by -either combining or subdividing layers. The combination and subdivision -of snow layers is based on Jordan (1991). - -7.2.7.1 Combination -''''''''''''''''''' - -If a snow layer has nearly melted or if its thickness -:math:`\Delta z_{i}` is less than the prescribed minimum thickness -:math:`\Delta z_{\min }` (Table 7.2), the layer is combined with a -neighboring layer. The overlying or underlying layer is selected as the -neighboring layer according to the following rules - -#. If the top layer is being removed, it is combined with the underlying - layer - -#. If the underlying layer is not snow (i.e., it is the top soil layer), - the layer is combined with the overlying layer - -#. If the layer is nearly completely melted, the layer is combined with - the underlying layer - -#. If none of the above rules apply, the layer is combined with the - thinnest neighboring layer. - -A first pass is made through all snow layers to determine if any layer -is nearly melted (:math:`w_{ice,\, i} \le 0.1`). If so, the remaining -liquid water and ice content of layer :math:`i` is combined with the -underlying neighbor :math:`i+1` as - -.. math:: - :label: 7.51) - - w_{liq,\, i+1} =w_{liq,\, i+1} +w_{liq,\, i} - -.. math:: - :label: 7.52) - - w_{ice,\, i+1} =w_{ice,\, i+1} +w_{ice,\, i} . - -This includes the snow layer directly above the top soil layer. In this -case, the liquid water and ice content of the melted snow layer is added -to the contents of the top soil layer. The layer properties, -:math:`T_{i}` , :math:`w_{ice,\, i}` , :math:`w_{liq,\, i}` , -:math:`\Delta z_{i}` , are then re-indexed so that the layers above the -eliminated layer are shifted down by one and the number of snow layers -is decremented accordingly. - -At this point, if there are no explicit snow layers remaining -(:math:`snl=0`), the snow water equivalent :math:`W_{sno}` and snow -depth :math:`z_{sno}` are set to zero, otherwise, :math:`W_{sno}` and -:math:`z_{sno}` are re-calculated as - -.. math:: - :label: 7.53) - - W_{sno} =\sum _{i=snl+1}^{i=0}\left(w_{ice,\, i} +w_{liq,\, i} \right) - -.. math:: - :label: 7.54) - - z_{sno} =\sum _{i=snl+1}^{i=0}\Delta z_{i} . - -If the snow depth :math:`0`\ 1 | 0.03 | 0.02 | -+--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ -| 2 | 0.015 | 2 | :math:`>`\ 2 | 0.07 | 0.05 | -+--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ -| 3 | 0.025 | 3 | :math:`>`\ 3 | 0.18 | 0.11 | -+--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ -| 4 | 0.055 | 4 | :math:`>`\ 4 | 0.41 | 0.23 | -+--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ -| 5 (bottom) | 0.115 | 5 | - | - | - | -+--------------+-----------------------------+------------------+------------------+-----------------------------------------------+-----------------------------------------------+ - -The maximum snow layer thickness, :math:`\Delta z_{\max }` , depends on -the number of layers, :math:`N_{l}` and :math:`N_{u}` (section -7.2.7.2). - -7.2.7.2 Subdivision -''''''''''''''''''' - -The snow layers are subdivided when the layer thickness exceeds the -prescribed maximum thickness :math:`\Delta z_{\max }` with lower and -upper bounds that depend on the number of snow layers (Table 7.2). For -example, if there is only one layer, then the maximum thickness of that -layer is 0.03 m, however, if there is more than one layer, then the -maximum thickness of the top layer is 0.02 m. Layers are checked -sequentially from top to bottom for this limit. If there is only one -snow layer and its thickness is greater than 0.03 m (Table 7.2), the -layer is subdivided into two layers of equal thickness, liquid water and -ice contents, and temperature. If there is an existing layer below the -layer to be subdivided, the thickness :math:`\Delta z_{i}` , liquid -water and ice contents, :math:`w_{liq,\; i}` and :math:`w_{ice,\; i}` , -and temperature :math:`T_{i}` of the excess snow are combined with the -underlying layer according to equations -. If there is no underlying -layer after adjusting the layer for the excess snow, the layer is -subdivided into two layers of equal thickness, liquid water and ice -contents. The vertical snow temperature profile is maintained by -calculating the slope between the layer above the splitting layer -(:math:`T_{1}` ) and the splitting layer (:math:`T_{2}` ) and -constraining the new temperatures (:math:`T_{2}^{n+1}` , -:math:`T_{3}^{n+1}` ) to lie along this slope. The temperature of the -lower layer is first evaluated from - -.. math:: - :label: 7.62) - - T'_{3} =T_{2}^{n} -\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right), - -then adjusted as, - -.. math:: - :label: 7.63) - - \begin{array}{l} {T_{3}^{n+1} =T_{2}^{n} \qquad T'_{3} \ge T_{f} } \\ {T_{2}^{n+1} =T_{2}^{n} +\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right)\qquad T'_{3} T_{f} +2} \\ {50+1.7\left(T_{atm} -T_{f} +15\right)^{1.5} \qquad T_{f} -15T_{f}` ). In this case, the incoming solid precipitation +is assigned to the runoff term :math:`q_{rgwl}` (section :numref:`Runoff from glaciers and snow-capped surfaces`). + +In the second step, after surface fluxes and snow/soil temperatures have +been determined (Chapters :numref:`rst_Momentum, Sensible Heat, and Latent Heat +Fluxes` and :numref:`rst_Soil and Snow Temperatures`), +:math:`w_{ice,\, snl+1}` is updated for frost or sublimation as + +.. math:: + :label: ZEqnNum863244 + + w_{ice,\, snl+1}^{n+1} =w_{ice,\, snl+1}^{n} +f_{sno} \left(q_{frost} -q_{subl} \right)\Delta t. + +If :math:`w_{ice,\, snl+1}^{n+1} <0` upon solution of equation , the ice +content is reset to zero and the liquid water content +:math:`w_{liq,\, snl+1}` is reduced by the amount required to bring +:math:`w_{ice,\, snl+1}^{n+1}` up to zero. + +The snow water equivalent :math:`W_{sno}` is capped to not exceed 1000 +kg m\ :sup:`-2`. If the addition of :math:`q_{frost}` were to +result in :math:`W_{sno} >1000` kg m\ :sup:`-2`, the frost term +:math:`q_{frost}` is instead added to the ice runoff term +:math:`q_{snwcp,\, ice}` (section :numref:`Runoff from glaciers and snow-capped surfaces`). + +.. _Water Content: + +Water Content +^^^^^^^^^^^^^^^^^^^ + +The conservation equation for mass of water in snow layers is + +.. math:: + :label: 8.26) + + \frac{\partial w_{liq,\, i} }{\partial t} =\left(q_{liq,\, i-1} -q_{liq,\, i} \right)+\frac{\left(\Delta w_{liq,\, i} \right)_{p} }{\Delta t} + +where :math:`q_{liq,\, i-1}` is the flow of liquid water into layer +:math:`i` from the layer above, :math:`q_{liq,\, i}` is the flow of +water out of layer :math:`i` to the layer below, +:math:`{\left(\Delta w_{liq,\, i} \right)_{p} \mathord{\left/ {\vphantom {\left(\Delta w_{liq,\, i} \right)_{p} \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t}` +is the change in liquid water due to phase change (melting rate) +(section :numref:`Phase Change`). For the top snow layer only, + +.. math:: + :label: 8.27) + + q_{liq,\, i-1} =f_{sno} \left(q_{grnd,\, liq} +\left(q_{sdew} -q_{seva} \right)\right) + +where :math:`q_{grnd,\, liq}` is the rate of liquid precipitation +reaching the snow (section :numref:`Canopy Water`), :math:`q_{seva}` is the +evaporation of liquid water and :math:`q_{sdew}` is the liquid dew (section +5.4). After surface fluxes and snow/soil temperatures have been determined +(Chapters :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes` and +:numref:`rst_Soil and Snow Temperatures`), :math:`w_{liq,\, snl+1}` is +updated for the liquid precipitation reaching the ground and dew or +evaporation as + +.. math:: + :label: 8.28) + + w_{liq,\, snl+1}^{n+1} =w_{liq,\, snl+1}^{n} +f_{sno} \left(q_{grnd,\, liq} +q_{sdew} -q_{seva} \right)\Delta t. + +When the liquid water within a snow layer exceeds the layer’s holding +capacity, the excess water is added to the underlying layer, limited by +the effective porosity (:math:`1-\theta _{ice}` ) of the layer. The flow +of water is assumed to be zero (:math:`q_{liq,\, i} =0`) if the +effective porosity of either of the two layers +(:math:`1-\theta _{ice,\, i} {\rm \; and\; }1-\theta _{ice,\, i+1}` ) is +less than :math:`\theta _{imp} =0.05`, the water impermeable volumetric +water content. Thus, water flow between layers, :math:`q_{liq,\, i}` , +for layers :math:`i=snl+1,\ldots ,0`, is initially calculated as + +.. math:: + :label: ZEqnNum767577 + + q_{liq,\, i} =\frac{\rho _{liq} \left[\theta _{liq,\, i} -S_{r} \left(1-\theta _{ice,\, i} \right)\right]f_{sno} \Delta z_{i} }{\Delta t} \ge 0 + +where the volumetric liquid water :math:`\theta _{liq,\, i}` and ice +:math:`\theta _{ice,\, i}` contents are + +.. math:: + :label: 8.30) + + \theta _{ice,\, i} =\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } \le 1 + +.. math:: + :label: 8.31) + + \theta _{liq,\, i} =\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \le 1-\theta _{ice,\, i} , + +and :math:`S_{r} =0.033` is the irreducible water saturation (snow +holds a certain amount of liquid water due to capillary retention after +drainage has ceased (Anderson 1976)). The water holding capacity of the +underlying layer limits the flow of water :math:`q_{liq,\, i}` +calculated in equation , unless the underlying layer is the surface soil +layer, as + +.. math:: + :label: 8.32) + + q_{liq,\, i} \le \frac{\rho _{liq} \left[1-\theta _{ice,\, i+1} -\theta _{liq,\, i+1} \right]\Delta z_{i+1} }{\Delta t} \qquad i=snl+1,\ldots ,-1. + +The liquid water content :math:`w_{liq,\, i}` is updated as + +.. math:: + :label: ZEqnNum265203 + + w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\left(q_{i-1} -q_{i} \right)\Delta t. + +Equations - are solved sequentially from top (:math:`i=snl+1`) to +bottom (:math:`i=0`) snow layer in each time step. The total flow of +liquid water reaching the soil surface is then :math:`q_{liq,\, 0}` +which is used in the calculation of surface runoff and infiltration +(sections :numref:`Surface Runoff` and :numref:`Infiltration`). + +.. _Black and organic carbon and mineral dust within snow: + +Black and organic carbon and mineral dust within snow +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Particles within snow originate from atmospheric aerosol deposition +(:math:`D_{sp}` in Table 2.3 (kg m\ :sup:`-2` s\ :sup:`-1`) +and influence snow radiative transfer (sections :numref:`Snow Albedo`, +:numref:`Snowpack Optical Properties`, and :numref:`Snow Aging`). +Particle masses and mixing ratios are represented with a simple +mass-conserving scheme. The model maintains masses of the following +eight particle species within each snow layer: hydrophilic black carbon, +hydrophobic black carbon, hydrophilic organic carbon, hydrophobic +organic carbon, and four species of mineral dust with the following +particle sizes: 0.1-1.0, 1.0-2.5, 2.5-5.0, and 5.0-10.0 :math:`\mu m`. +Each of these species has unique optical properties (Table 3.5) and +meltwater removal efficiencies (:numref:`Table Meltwater scavenging`). + +The black carbon and organic carbon deposition rates described in Table +2.3 are combined into four categories as follows + +.. math:: + :label: 8.34) + + D_{bc,\, hphil} =D_{bc,\, dryhphil} +D_{bc,\, wethphil} + +.. math:: + :label: 8.35) + + D_{bc,\, hphob} =D_{bc,\, dryhphob} + +.. math:: + :label: 8.36) + + D_{oc,\, hphil} =D_{oc,\, dryhphil} +D_{oc,\, wethphil} + +.. math:: + :label: 8.37) + + D_{oc,\, hphob} =D_{oc,\, dryhphob} + +Deposited particles are assumed to be instantly mixed (homogeneously) +within the surface snow layer and are added after the inter-layer water +fluxes are computed (section :numref:`Water Content`) so that some aerosol is in the top +layer after deposition and is not immediately washed out before radiative +calculations are done. Particle masses are then redistributed each time +step based on meltwater drainage through the snow column (section +:numref:`Water Content`) and snow layer combination and subdivision +(section :numref:`Snow Layer Combination and Subdivision`). The change in +mass of each of the particle species :math:`\Delta m_{sp,\, i}` +(kg m\ :sup:`-2`) is + +.. math:: + :label: 8.38) + + \Delta m_{sp,\, i} =\left[k_{sp} \left(q_{liq,\, i-1} c_{sp,\, i-1} -q_{liq,\, i} c_{i} \right)+D_{sp} \right]\Delta t + +where :math:`k_{sp}` is the meltwater scavenging efficiency that is +unique for each species (:numref:`Table Meltwater scavenging`), :math:`q_{liq,\, i-1}` is the flow +of liquid water into layer :math:`i` from the layer above, +:math:`q_{liq,\, i}` is the flow of water out of layer :math:`i` into +the layer below (kg m\ :sup:`-2` s\ :sup:`-1`) (section +:numref:`Water Content`), :math:`c_{sp,\, i-1}` and :math:`c_{sp,\, i}` are the particle +mass mixing ratios in layers :math:`i-1` and :math:`i` (kg +kg\ :sup:`-1`), :math:`D_{sp}` is the atmospheric deposition rate +(zero for all layers except layer :math:`snl+1`), and :math:`\Delta t` +is the model time step (s). The particle mass mixing ratio is + +.. math:: + :label: 8.39) + + c_{i} =\frac{m_{sp,\, i} }{w_{liq,\, i} +w_{ice,\, i} } . + +Values of :math:`k_{sp}` are partially derived from experiments +published by Conway et al. (1996). Particles masses are re-distributed +proportionately with snow mass when layers are combined or divided, thus +conserving particle mass within the snow column. The mass of particles +carried out with meltwater through the bottom snow layer is assumed to +be permanently lost from the snowpack, and is not maintained within the +model. + +.. _Table Meltwater scavenging: + +.. table:: Meltwater scavenging efficiency for particles within snow + + +------------------------------------------+-------------------+ + | Species | :math:`k_{sp}` | + +==========================================+===================+ + | Hydrophilic black carbon | 0.20 | + +------------------------------------------+-------------------+ + | Hydrophobic black carbon | 0.03 | + +------------------------------------------+-------------------+ + | Hydrophilic organic carbon | 0.20 | + +------------------------------------------+-------------------+ + | Hydrophobic organic carbon | 0.03 | + +------------------------------------------+-------------------+ + | Dust species 1 (0.1-1.0 :math:`\mu m`) | 0.02 | + +------------------------------------------+-------------------+ + | Dust species 2 (1.0-2.5 :math:`\mu m`) | 0.02 | + +------------------------------------------+-------------------+ + | Dust species 3 (2.5-5.0 :math:`\mu m`) | 0.01 | + +------------------------------------------+-------------------+ + | Dust species 4 (5.0-10.0 :math:`\mu m`) | 0.01 | + +------------------------------------------+-------------------+ + +.. _Initialization of snow layer: + +Initialization of snow layer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If there are no existing snow layers (:math:`snl+1=1`) but +:math:`z_{sno} \ge 0.01` m after accounting for solid precipitation +:math:`q_{sno}` , then a snow layer is initialized (:math:`snl=-1`) as +follows + +.. math:: + :label: 8.40) + + \begin{array}{l} {\Delta z_{0} =z_{sno} } \\ {z_{o} =-0.5\Delta z_{0} } \\ {z_{h,\, -1} =-\Delta z_{0} } \\ {T_{0} =\min \left(T_{f} ,T_{atm} \right)} \\ {w_{ice,\, 0} =W_{sno} } \\ {w_{liq,\, 0} =0} \end{array}. + +.. _Snow Compaction: + +Snow Compaction +^^^^^^^^^^^^^^^^^^^^^ + +Snow compaction is initiated after the soil hydrology calculations +[surface runoff (section :numref:`Surface Runoff`), infiltration (section +:numref:`Infiltration`), soil water (section :numref:`Soil Water`), +groundwater-soilwater interactions (section 8.6)] are +complete. Compaction of snow includes three types of processes: +destructive metamorphism of new snow (crystal breakdown due to wind or +thermodynamic stress); snow load or overburden (pressure); and melting +(changes in snow structure due to melt-freeze cycles plus changes in +crystals due to liquid water). The total fractional compaction rate for +each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the +three compaction processes + +.. math:: + :label: 8.41) + + C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} . + +Compaction is not allowed if the layer is saturated + +.. math:: + :label: 8.42) + + 1-\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } +\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \right)\le 0.001 + +or if the ice content is below a minimum value +(:math:`w_{ice,\, i} \le 0.1`). + +Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (CityplaceAnderson 1976) + +.. math:: + :label: 8.43) + + C_{R1,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{metamorphism} =-c_{3} c_{1} c_{2} \exp \left[-c_{4} \left(T_{f} -T_{i} \right)\right] + +where :math:`c_{3} =2.777\times 10^{-6}` (s\ :sup:`-1`) is the fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` K\ :sup:`-1`, and + +.. math:: + :label: 8.44) + + c_{1} & = 1\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{1} & = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right]\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{2} & = 2\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ + c_{2} & = 1\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 + +where +:math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` +and +:math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` +are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). + +The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (CityplaceAnderson 1976) + +.. math:: + :label: 8.45) + + C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } + +where :math:`\eta` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and temperature as + +.. math:: + :label: 8.46) + + \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] + +where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :sup:`-2`, and +:math:`c_{5} =0.08` K\ :sup:`-1`, :math:`c_{6} =0.023` +m\ :sup:`3` kg\ :sup:`-1` are constants. The snow load +pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of +the ice :math:`w_{ice,\, i}` and liquid water contents +:math:`w_{liq,\, i}` of the layers above plus half the ice and liquid +water contents of the layer being compacted + +.. math:: + :label: 8.47) + + P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . + +The compaction rate due to melting :math:`C_{R3,\; i}` (s\ :sup:`-1`) is taken to be the ratio of the change in snow ice +mass after the melting to the mass before melting + +.. math:: + :label: 8.48) + + C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) + +and melting is identified during the phase change calculations (section +:numref:`Phase Change`). Because snow depth is defined as the average depth of the snow +covered area, the snow depth must also be updated for changes in +:math:`f_{sno}` . + +.. math:: + :label: 8.49) + + C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) + +The snow layer thickness after compaction is then + +.. math:: + :label: 8.50) + + \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). + +.. _Snow Layer Combination and Subdivision: + +Snow Layer Combination and Subdivision +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +After the determination of snow temperature including phase change(Chapter +:numref:`rst_Soil and Snow Temperatures`), snow hydrology (Chapter +:numref:`rst_Snow Hydrology`), and the compaction calculations (section +:numref:`Snow Compaction`) , the number of snow layers is adjusted by +either combining or subdividing layers. The combination and subdivision +of snow layers is based on Jordan (1991). + +.. _Combination: + +Combination +''''''''''''''''''' + +If a snow layer has nearly melted or if its thickness +:math:`\Delta z_{i}` is less than the prescribed minimum thickness +:math:`\Delta z_{\min }` (:numref:`Table snow layer thickness`), the layer is combined with a +neighboring layer. The overlying or underlying layer is selected as the +neighboring layer according to the following rules + +#. If the top layer is being removed, it is combined with the underlying + layer + +#. If the underlying layer is not snow (i.e., it is the top soil layer), + the layer is combined with the overlying layer + +#. If the layer is nearly completely melted, the layer is combined with + the underlying layer + +#. If none of the above rules apply, the layer is combined with the + thinnest neighboring layer. + +A first pass is made through all snow layers to determine if any layer +is nearly melted (:math:`w_{ice,\, i} \le 0.1`). If so, the remaining +liquid water and ice content of layer :math:`i` is combined with the +underlying neighbor :math:`i+1` as + +.. math:: + :label: 8.51) + + w_{liq,\, i+1} =w_{liq,\, i+1} +w_{liq,\, i} + +.. math:: + :label: 8.52) + + w_{ice,\, i+1} =w_{ice,\, i+1} +w_{ice,\, i} . + +This includes the snow layer directly above the top soil layer. In this +case, the liquid water and ice content of the melted snow layer is added +to the contents of the top soil layer. The layer properties, +:math:`T_{i}` , :math:`w_{ice,\, i}` , :math:`w_{liq,\, i}` , +:math:`\Delta z_{i}` , are then re-indexed so that the layers above the +eliminated layer are shifted down by one and the number of snow layers +is decremented accordingly. + +At this point, if there are no explicit snow layers remaining +(:math:`snl=0`), the snow water equivalent :math:`W_{sno}` and snow +depth :math:`z_{sno}` are set to zero, otherwise, :math:`W_{sno}` and +:math:`z_{sno}` are re-calculated as + +.. math:: + :label: 8.53) + + W_{sno} =\sum _{i=snl+1}^{i=0}\left(w_{ice,\, i} +w_{liq,\, i} \right) + +.. math:: + :label: 8.54) + + z_{sno} =\sum _{i=snl+1}^{i=0}\Delta z_{i} . + +If the snow depth :math:`0`\ 1 | 0.03 | 0.02 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 2 | 0.015 | 2 | :math:`>`\ 2 | 0.07 | 0.05 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 3 | 0.025 | 3 | :math:`>`\ 3 | 0.18 | 0.11 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 4 | 0.055 | 4 | :math:`>`\ 4 | 0.41 | 0.23 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 5 (bottom) | 0.115 | 5 | - | - | - | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + +The maximum snow layer thickness, :math:`\Delta z_{\max }` , depends on +the number of layers, :math:`N_{l}` and :math:`N_{u}` (section +:numref:`Subdivision`). + +.. _Subdivision: + +Subdivision +''''''''''''''''''' + +The snow layers are subdivided when the layer thickness exceeds the +prescribed maximum thickness :math:`\Delta z_{\max }` with lower and +upper bounds that depend on the number of snow layers (numref:`Table snow layer thickness`). For +example, if there is only one layer, then the maximum thickness of that +layer is 0.03 m, however, if there is more than one layer, then the +maximum thickness of the top layer is 0.02 m. Layers are checked +sequentially from top to bottom for this limit. If there is only one +snow layer and its thickness is greater than 0.03 m (:numref:`Table snow layer thickness`), the +layer is subdivided into two layers of equal thickness, liquid water and +ice contents, and temperature. If there is an existing layer below the +layer to be subdivided, the thickness :math:`\Delta z_{i}` , liquid +water and ice contents, :math:`w_{liq,\; i}` and :math:`w_{ice,\; i}` , +and temperature :math:`T_{i}` of the excess snow are combined with the +underlying layer according to equations -. If there is no underlying +layer after adjusting the layer for the excess snow, the layer is +subdivided into two layers of equal thickness, liquid water and ice +contents. The vertical snow temperature profile is maintained by +calculating the slope between the layer above the splitting layer +(:math:`T_{1}` ) and the splitting layer (:math:`T_{2}` ) and +constraining the new temperatures (:math:`T_{2}^{n+1}` , +:math:`T_{3}^{n+1}` ) to lie along this slope. The temperature of the +lower layer is first evaluated from + +.. math:: + :label: 8.62) + + T'_{3} =T_{2}^{n} -\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right), + +then adjusted as, + +.. math:: + :label: 8.63) + + \begin{array}{l} {T_{3}^{n+1} =T_{2}^{n} \qquad T'_{3} \ge T_{f} } \\ {T_{2}^{n+1} =T_{2}^{n} +\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right)\qquad T'_{3} Date: Fri, 19 May 2017 14:17:31 -0600 Subject: [PATCH 015/730] labeled references --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 593 ++++++++-------- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 399 +++++------ .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 267 +++----- .../tech_note/Lake/CLM50_Tech_Note_Lake.rst | 66 +- .../Offline/CLM50_Tech_Note_Offline.rst | 41 +- .../CLM50_Tech_Note_Radiative_Fluxes.rst | 4 + .../References/CLM50_Tech_Note_References.rst | 632 +++++++++++++++++- .../CLM50_Tech_Note_Snow_Hydrology.rst | 25 +- ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 2 +- 9 files changed, 1328 insertions(+), 701 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 888c379382..959a8cbd73 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -3,15 +3,20 @@ Surface Characterization and Model Input Requirements ======================================================== +.. _Surface Characterization: + Surface Characterization ----------------------------- +.. _Surface Heterogeneity and Data Structure: + Surface Heterogeneity and Data Structure ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Spatial land surface heterogeneity in CLM is represented as a nested subgrid hierarchy in which grid cells are composed of multiple land -units, snow/soil columns, and PFTs (Figure 2.1). Each grid cell can have +units, snow/soil columns, and PFTs (:numref:`Figure CLM subgrid hierarchy`). +Each grid cell can have a different number of land units, each land unit can have a different number of columns, and each column can have multiple PFTs. The first subgrid level, the land unit, is intended to capture the broadest @@ -43,7 +48,11 @@ single crop occupying each column. The urban land units have five columns (roof, sunlit walls and shaded walls, and pervious and impervious canyon floor) (Oleson et al. 2010b). -Figure 2.1. Configuration of the CLM subgrid hierarchy. +.. _Figure CLM subgrid hierarchy: + +.. Figure:: image1.png + + Configuration of the CLM subgrid hierarchy. Note that the Crop land unit is only used when the model is run with the crop model active. Abbreviations: TBD – Tall Building District; HD – @@ -51,8 +60,6 @@ High Density; MD – Medium Density, G – Glacier, L – Lake, U – Urban, C Crop, V – Vegetated, PFT – Plant Functional Type, I – Irrigated, U – Unirrigated . -.. image:: image1.png - The third subgrid level is referred to as the PFT level, but it also includes the treatment for bare ground. It is intended to capture the biogeophysical and biogeochemical differences between broad categories @@ -62,7 +69,7 @@ structure may coexist on a single column. All fluxes to and from the surface are defined at the PFT level, as are the vegetation state variables (e.g. vegetation temperature and canopy water storage). On the crop land unit, several different crop types can be represented on each -crop land unit column (see Chapter 20 for details). +crop land unit column (see Chapter :numref:`rst_Crops and Irrigation` for details). In addition to state and flux variable data structures for conserved components at each subgrid level (e.g., energy, water, carbon), each @@ -76,7 +83,8 @@ and the fraction of canopy that is wet are defined as physical state variables at the PFT level. The standard configuration of the model subgrid hierarchy is illustrated -in Figure 2.1. Here, only four PFTs are shown associated with the single +in :numref:`Figure CLM subgrid hierarchy`. Here, only four PFTs are shown +associated with the single column beneath the vegetated land unit but up to sixteen are possible. The crop land unit is present only when the crop model is active. @@ -90,13 +98,17 @@ by computing a weighted sum of the desired quantity over all PFTs whose weighting depends on the PFT area relative to all PFTs, unless otherwise noted in the text. +.. _Vegetation Composition: + Vegetation Composition ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Vegetated surfaces are comprised of up to 15 possible plant functional -types (PFTs) plus bare ground (Table 2.1). An additional PFT is -added if the irrigation model is active and six additional PFTs are -added if the crop model is active (Chapter 20). These plant types differ +types (PFTs) plus bare ground (:numref:`Table Plant functional types`). An +additional PFT is added if +the irrigation model is active and six additional PFTs are added if the +crop model is active (Chapter :numref:`rst_Crops and Irrigation`). These +plant types differ in leaf and stem optical properties that determine reflection, transmittance, and absorption of solar radiation (Table 3.1), root distribution parameters that control the uptake of water from the soil @@ -109,129 +121,141 @@ within a grid cell can either be prescribed as time-invariant fields evolve with time if the model is run in transient landcover mode (Chapter 21). -Table 2.1. Plant functional types - -+--------------------------------------------------------------+-------------------+ -| Plant functional type | Acronym | -+==============================================================+===================+ -| Needleleaf evergreen tree – temperate | NET Temperate | -+--------------------------------------------------------------+-------------------+ -| Needleleaf evergreen tree - boreal | NET Boreal | -+--------------------------------------------------------------+-------------------+ -| Needleleaf deciduous tree – boreal | NDT Boreal | -+--------------------------------------------------------------+-------------------+ -| Broadleaf evergreen tree – tropical | BET Tropical | -+--------------------------------------------------------------+-------------------+ -| Broadleaf evergreen tree – temperate | BET Temperate | -+--------------------------------------------------------------+-------------------+ -| Broadleaf deciduous tree – tropical | BDT Tropical | -+--------------------------------------------------------------+-------------------+ -| Broadleaf deciduous tree – temperate | BDT Temperate | -+--------------------------------------------------------------+-------------------+ -| Broadleaf deciduous tree – boreal | BDT Boreal | -+--------------------------------------------------------------+-------------------+ -| Broadleaf evergreen shrub - temperate | BES Temperate | -+--------------------------------------------------------------+-------------------+ -| Broadleaf deciduous shrub – temperate | BDS Temperate | -+--------------------------------------------------------------+-------------------+ -| Broadleaf deciduous shrub – boreal | BDS Boreal | -+--------------------------------------------------------------+-------------------+ -| C\ :sub:`3` arctic grass | - | -+--------------------------------------------------------------+-------------------+ -| C\ :sub:`3` grass | - | -+--------------------------------------------------------------+-------------------+ -| C\ :sub:`4` grass | - | -+--------------------------------------------------------------+-------------------+ -| C\ :sub:`3` Unmanaged Rainfed Crop | Crop R | -+--------------------------------------------------------------+-------------------+ -| :sup:`1`\ C\ :sub:`3` Unmanaged Irrigated Crop | Crop I | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Rainfed Corn | Corn R | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Irrigated Corn | Corn I | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Rainfed Temperate Cereals | Temp Cereal R | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Irrigated Temperate Cereals | Temp Cereal I | -+--------------------------------------------------------------+-------------------+ -| :sup:`3`\ Rainfed Winter Cereals | Winter Cereal R | -+--------------------------------------------------------------+-------------------+ -| :sup:`3`\ Irrigated Winter Cereals | Winter Cereal I | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Rainfed Soybean | Soybean R | -+--------------------------------------------------------------+-------------------+ -| :sup:`2`\ Irrigated Soybean | Soybean I | -+--------------------------------------------------------------+-------------------+ - -:sup:`1`\ Only used if irrigation is active (Chapter 20). -:sup:`2`\ Only used if crop model is active (Chapter 20). -:sup:`3`\ Reserved for future implementations of crop model (Chapter 20). +.. _Table Plant functional types: + +.. table:: Plant functional types + + +--------------------------------------------------------------+-------------------+ + | Plant functional type | Acronym | + +==============================================================+===================+ + | Needleleaf evergreen tree – temperate | NET Temperate | + +--------------------------------------------------------------+-------------------+ + | Needleleaf evergreen tree - boreal | NET Boreal | + +--------------------------------------------------------------+-------------------+ + | Needleleaf deciduous tree – boreal | NDT Boreal | + +--------------------------------------------------------------+-------------------+ + | Broadleaf evergreen tree – tropical | BET Tropical | + +--------------------------------------------------------------+-------------------+ + | Broadleaf evergreen tree – temperate | BET Temperate | + +--------------------------------------------------------------+-------------------+ + | Broadleaf deciduous tree – tropical | BDT Tropical | + +--------------------------------------------------------------+-------------------+ + | Broadleaf deciduous tree – temperate | BDT Temperate | + +--------------------------------------------------------------+-------------------+ + | Broadleaf deciduous tree – boreal | BDT Boreal | + +--------------------------------------------------------------+-------------------+ + | Broadleaf evergreen shrub - temperate | BES Temperate | + +--------------------------------------------------------------+-------------------+ + | Broadleaf deciduous shrub – temperate | BDS Temperate | + +--------------------------------------------------------------+-------------------+ + | Broadleaf deciduous shrub – boreal | BDS Boreal | + +--------------------------------------------------------------+-------------------+ + | C\ :sub:`3` arctic grass | - | + +--------------------------------------------------------------+-------------------+ + | C\ :sub:`3` grass | - | + +--------------------------------------------------------------+-------------------+ + | C\ :sub:`4` grass | - | + +--------------------------------------------------------------+-------------------+ + | C\ :sub:`3` Unmanaged Rainfed Crop | Crop R | + +--------------------------------------------------------------+-------------------+ + | :sup:`1`\ C\ :sub:`3` Unmanaged Irrigated Crop | Crop I | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Rainfed Corn | Corn R | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Irrigated Corn | Corn I | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Rainfed Temperate Cereals | Temp Cereal R | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Irrigated Temperate Cereals | Temp Cereal I | + +--------------------------------------------------------------+-------------------+ + | :sup:`3`\ Rainfed Winter Cereals | Winter Cereal R | + +--------------------------------------------------------------+-------------------+ + | :sup:`3`\ Irrigated Winter Cereals | Winter Cereal I | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Rainfed Soybean | Soybean R | + +--------------------------------------------------------------+-------------------+ + | :sup:`2`\ Irrigated Soybean | Soybean I | + +--------------------------------------------------------------+-------------------+ + +:sup:`1`\ Only used if irrigation is active (Chapter :numref:`rst_Crops and Irrigation`). +:sup:`2`\ Only used if crop model is active (Chapter :numref:`rst_Crops and Irrigation`). +:sup:`3`\ Reserved for future implementations of crop model (Chapter :numref:`rst_Crops and Irrigation`). + +.. _Vegetation Structure: Vegetation Structure ^^^^^^^^^^^^^^^^^^^^^^^^^^ Vegetation structure is defined by leaf and stem area indices -(:math:`L,\, S`) and canopy top and bottom heights (:math:`z_{top}`,\ :math:`z_{bot}` ) (Table 2.2). Separate leaf and -stem area indices and canopy heights are prescribed or calculated for each PFT. Daily leaf and stem area indices are obtained from gridded -datasets of monthly values (section 2.2.3). Canopy top and bottom heights are also obtained from gridded datasets. However, these are -currently invariant in space and time and were obtained from PFT-specific values (Bonan et al. 2002a). When the biogeochemistry model -is active, vegetation state (LAI, SAI, canopy top and bottom heights) are calculated prognostically (see Chapter 14). - -Table 2.2. Prescribed plant functional type heights - -+-----------------------------------+------------------------+------------------------+ -| Plant functional type | :math:`z_{top}` (m) | :math:`z_{bot}` (m) | -+===================================+========================+========================+ -| NET Temperate | 17 | 8.5 | -+-----------------------------------+------------------------+------------------------+ -| NET Boreal | 17 | 8.5 | -+-----------------------------------+------------------------+------------------------+ -| NDT Boreal | 14 | 7 | -+-----------------------------------+------------------------+------------------------+ -| BET Tropical | 35 | 1 | -+-----------------------------------+------------------------+------------------------+ -| BET temperate | 35 | 1 | -+-----------------------------------+------------------------+------------------------+ -| BDT tropical | 18 | 10 | -+-----------------------------------+------------------------+------------------------+ -| BDT temperate | 20 | 11.5 | -+-----------------------------------+------------------------+------------------------+ -| BDT boreal | 20 | 11.5 | -+-----------------------------------+------------------------+------------------------+ -| BES temperate | 0.5 | 0.1 | -+-----------------------------------+------------------------+------------------------+ -| BDS temperate | 0.5 | 0.1 | -+-----------------------------------+------------------------+------------------------+ -| BDS boreal | 0.5 | 0.1 | -+-----------------------------------+------------------------+------------------------+ -| C\ :math:`{}_{3}` arctic grass | 0.5 | 0.01 | -+-----------------------------------+------------------------+------------------------+ -| C\ :math:`{}_{3}` grass | 0.5 | 0.01 | -+-----------------------------------+------------------------+------------------------+ -| C\ :math:`{}_{4}` grass | 0.5 | 0.01 | -+-----------------------------------+------------------------+------------------------+ -| Crop R | 0.5 | 0.01 | -+-----------------------------------+------------------------+------------------------+ -| Crop I | 0.5 | 0.01 | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Corn R | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Corn I | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Temp Cereal R | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Temp Cereal I | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Winter Cereal R | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Winter Cereal I | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Soybean R | - | - | -+-----------------------------------+------------------------+------------------------+ -| :sup:`1`\ Soybean I | - | - | -+-----------------------------------+------------------------+------------------------+ - -:sup:`1`\ Determined by the crop model (Chapter 20) +(:math:`L,\, S`) and canopy top and bottom heights (:math:`z_{top}`,\ :math:`z_{bot}` ) +(:numref:`Table Prescribed plant functional type heights`). Separate leaf and +stem area indices and canopy heights are prescribed or calculated for each PFT. Daily leaf +and stem area indices are obtained from griddeddatasets of monthly values (section +:numref:`Surface Data`). Canopy top and bottom heights are also obtained from gridded datasets. +However, these are currently invariant in space and time and were obtained from PFT-specific +values (:ref:`Bonan et al. 2002a `). When the biogeochemistry model is active, +vegetation state (LAI, SAI, canopy top and bottom heights) are calculated prognostically +(see Chapter :numref:`rst_Vegetation Phenology and Turnover`). + +.. _Table Prescribed plant functional type heights: + +.. table:: Prescribed plant functional type heights + + +-----------------------------------+------------------------+------------------------+ + | Plant functional type | :math:`z_{top}` (m) | :math:`z_{bot}` (m) | + +===================================+========================+========================+ + | NET Temperate | 17 | 8.5 | + +-----------------------------------+------------------------+------------------------+ + | NET Boreal | 17 | 8.5 | + +-----------------------------------+------------------------+------------------------+ + | NDT Boreal | 14 | 7 | + +-----------------------------------+------------------------+------------------------+ + | BET Tropical | 35 | 1 | + +-----------------------------------+------------------------+------------------------+ + | BET temperate | 35 | 1 | + +-----------------------------------+------------------------+------------------------+ + | BDT tropical | 18 | 10 | + +-----------------------------------+------------------------+------------------------+ + | BDT temperate | 20 | 11.5 | + +-----------------------------------+------------------------+------------------------+ + | BDT boreal | 20 | 11.5 | + +-----------------------------------+------------------------+------------------------+ + | BES temperate | 0.5 | 0.1 | + +-----------------------------------+------------------------+------------------------+ + | BDS temperate | 0.5 | 0.1 | + +-----------------------------------+------------------------+------------------------+ + | BDS boreal | 0.5 | 0.1 | + +-----------------------------------+------------------------+------------------------+ + | C\ :math:`{}_{3}` arctic grass | 0.5 | 0.01 | + +-----------------------------------+------------------------+------------------------+ + | C\ :math:`{}_{3}` grass | 0.5 | 0.01 | + +-----------------------------------+------------------------+------------------------+ + | C\ :math:`{}_{4}` grass | 0.5 | 0.01 | + +-----------------------------------+------------------------+------------------------+ + | Crop R | 0.5 | 0.01 | + +-----------------------------------+------------------------+------------------------+ + | Crop I | 0.5 | 0.01 | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Corn R | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Corn I | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Temp Cereal R | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Temp Cereal I | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Winter Cereal R | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Winter Cereal I | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Soybean R | - | - | + +-----------------------------------+------------------------+------------------------+ + | :sup:`1`\ Soybean I | - | - | + +-----------------------------------+------------------------+------------------------+ + +:sup:`1`\ Determined by the crop model (Chapter :numref:`rst_Crops and Irrigation`) + +.. _Phenology and vegetation burial by snow: Phenology and vegetation burial by snow ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -266,67 +290,74 @@ where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, :math:`z and stem area are set to zero if less than 0.05. If the sum of exposed leaf and stem area is zero, then the surface is treated as snow-covered ground. +.. _Model Input Requirements: + Model Input Requirements ---------------------------- +.. _Atmospheric Coupling: + Atmospheric Coupling ^^^^^^^^^^^^^^^^^^^^^^^^^^ -The current state of the atmosphere (Table 2.3) at a given time step is +The current state of the atmosphere (:numref:`Table Atmospheric input to land model`) +at a given time step is used to force the land model. This atmospheric state is provided by an atmospheric model in coupled mode or from an observed dataset in offline -mode (Chapter 26). The land model then initiates a full set of +mode (Chapter :numref:`rst_Offline Mode`). The land model then initiates a full set of calculations for surface energy, constituent, momentum, and radiative fluxes. The land model calculations are implemented in two steps. The land model proceeds with the calculation of surface energy, constituent, momentum, and radiative fluxes using the snow and soil hydrologic states from the previous time step. The land model then updates the soil and snow hydrology calculations based on these fluxes. These fields are -passed to the atmosphere (Table 2.4). The albedos sent to the atmosphere +passed to the atmosphere (:numref:`Table Land model output to atmospheric model`). The albedos sent to the atmosphere are for the solar zenith angle at the next time step but with surface conditions from the current time step. -Table 2.3. Atmospheric input to land model - -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Field | variable name | units | -+======================================================+================================================+=================================================+ -| :sup:`1`\ Reference height | :math:`z'_{atm}` | m | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Potential temperature | :math:`\overline{\theta _{atm} }` | K | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Specific humidity at :math:`z_{atm}` | :math:`q_{atm}` | kg kg\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Pressure at :math:`z_{atm}` | :math:`P_{atm}` | Pa | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Temperature at :math:`z_{atm}` | :math:`T_{atm}` | K | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident longwave radiation | :math:`L_{atm} \, \downarrow` | W m\ :sup:`-2` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :sup:`2`\ Liquid precipitation | :math:`q_{rain}` | mm s\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :sup:`2`\ Solid precipitation | :math:`q_{sno}` | mm s\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident direct beam visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}^{\mu }` | W m\ :sup:`-2` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident direct beam near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}^{\mu }` | W m\ :sup:`-2` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident diffuse visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}` | W m\ :sup:`-2` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :sup:`-2` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| Carbon dioxide (CO:sub:`2`) concentration | :math:`c_{a}` | ppmv | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :sup:`3`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :sup:`-2` s\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :sup:`4`\ Nitrogen deposition rate | :math:`NF_{ndep\_ s{\it min}n}` | g (N) m\ :sup:`-2` yr\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ -| :sup:`5`\ Lightning frequency | :math:`I_{l}` | flash km\ :sup:`-2` hr\ :sup:`-1` | -+------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ +.. _Table Atmospheric input to land model: + +.. table:: Atmospheric input to land model + + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Field | variable name | units | + +======================================================+================================================+=================================================+ + | :sup:`1`\ Reference height | :math:`z'_{atm}` | m | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Potential temperature | :math:`\overline{\theta _{atm} }` | K | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Specific humidity at :math:`z_{atm}` | :math:`q_{atm}` | kg kg\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Pressure at :math:`z_{atm}` | :math:`P_{atm}` | Pa | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Temperature at :math:`z_{atm}` | :math:`T_{atm}` | K | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Incident longwave radiation | :math:`L_{atm} \, \downarrow` | W m\ :sup:`-2` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | :sup:`2`\ Liquid precipitation | :math:`q_{rain}` | mm s\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | :sup:`2`\ Solid precipitation | :math:`q_{sno}` | mm s\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Incident direct beam visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}^{\mu }` | W m\ :sup:`-2` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Incident direct beam near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}^{\mu }` | W m\ :sup:`-2` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Incident diffuse visible solar radiation | :math:`S_{atm} \, \downarrow _{vis}` | W m\ :sup:`-2` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :sup:`-2` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Carbon dioxide (CO:sub:`2`) concentration | :math:`c_{a}` | ppmv | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | :sup:`3`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :sup:`-2` s\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | :sup:`4`\ Nitrogen deposition rate | :math:`NF_{ndep\_ s{\it min}n}` | g (N) m\ :sup:`-2` yr\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | :sup:`5`\ Lightning frequency | :math:`I_{l}` | flash km\ :sup:`-2` hr\ :sup:`-1` | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ :sup:`1`\ The atmospheric reference height received from the atmospheric model :math:`z'_{atm}` is assumed to be the height above @@ -388,7 +419,7 @@ required but is calculated directly from :math:`\rho _{atm} =\frac{P_{atm} -0.378e_{atm} }{R_{da} T_{atm} }` where :math:`P_{atm}` is atmospheric pressure (Pa), :math:`e_{atm}` is atmospheric vapor pressure (Pa), :math:`R_{da}` is the gas constant for -dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), and +dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`), and :math:`T_{atm}` is the atmospheric temperature (K). The atmospheric vapor pressure :math:`e_{atm}` is derived from atmospheric specific humidity :math:`q_{atm}` (kg kg\ :sup:`-1`) as @@ -398,59 +429,63 @@ The O\ :sub:`2` partial pressure (Pa) is required but is calculated from molar ratio and the atmospheric pressure :math:`P_{atm}` as :math:`o_{i} =0.209P_{atm}` . -Table 2.4. Land model output to atmospheric model - -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Field | Variable name | units | -+=======================================+================================================+==============================================================+ -| :sup:`1`\ Latent heat flux | :math:`\lambda _{vap} E_{v} +\lambda E_{g}` | W m\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Sensible heat flux | :math:`H_{v} +H_{g}` | W m\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Water vapor flux | :math:`E_{v} +E_{g}` | mm s\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Zonal momentum flux | :math:`\tau _{x}` | kg m\ :sup:`-1` s\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Meridional momentum flux | :math:`\tau _{y}` | kg m\ :sup:`-1` s\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Emitted longwave radiation | :math:`L\, \uparrow` | W m\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Direct beam visible albedo | :math:`I\, \uparrow _{vis}^{\mu }` | - | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Direct beam near-infrared albedo | :math:`I\, \uparrow _{nir}^{\mu }` | - | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Diffuse visible albedo | :math:`I\, \uparrow _{vis}` | - | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Diffuse near-infrared albedo | :math:`I\, \uparrow _{nir}` | - | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Absorbed solar radiation | :math:`\vec{S}` | W m\ :sup:`-2` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Radiative temperature | :math:`T_{rad}` | K | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Temperature at 2 meter height | :math:`T_{2m}` | K | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Snow water equivalent | :math:`W_{sno}` | m | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Aerodynamic resistance | :math:`r_{am}` | s m\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Friction velocity | :math:`u_{*}` | m s\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| :sup:`2`\ Dust flux | :math:`F_{j}` | kg m\ :sup:`-2` s\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ -| Net ecosystem exchange | NEE | kgCO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1` | -+---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ +.. _Table Land model output to atmospheric model: + +.. table:: Land model output to atmospheric model + + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Field | Variable name | units | + +=======================================+================================================+==============================================================+ + | :sup:`1`\ Latent heat flux | :math:`\lambda _{vap} E_{v} +\lambda E_{g}` | W m\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Sensible heat flux | :math:`H_{v} +H_{g}` | W m\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Water vapor flux | :math:`E_{v} +E_{g}` | mm s\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Zonal momentum flux | :math:`\tau _{x}` | kg m\ :sup:`-1` s\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Meridional momentum flux | :math:`\tau _{y}` | kg m\ :sup:`-1` s\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Emitted longwave radiation | :math:`L\, \uparrow` | W m\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Direct beam visible albedo | :math:`I\, \uparrow _{vis}^{\mu }` | - | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Direct beam near-infrared albedo | :math:`I\, \uparrow _{nir}^{\mu }` | - | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Diffuse visible albedo | :math:`I\, \uparrow _{vis}` | - | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Diffuse near-infrared albedo | :math:`I\, \uparrow _{nir}` | - | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Absorbed solar radiation | :math:`\vec{S}` | W m\ :sup:`-2` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Radiative temperature | :math:`T_{rad}` | K | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Temperature at 2 meter height | :math:`T_{2m}` | K | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Snow water equivalent | :math:`W_{sno}` | m | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Aerodynamic resistance | :math:`r_{am}` | s m\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Friction velocity | :math:`u_{*}` | m s\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | :sup:`2`\ Dust flux | :math:`F_{j}` | kg m\ :sup:`-2` s\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Net ecosystem exchange | NEE | kgCO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ :sup:`1`\ :math:`\lambda _{vap}` is the latent heat of -vaporization (J kg\ :sup:`-1`) (Table 2.6) and :math:`\lambda` is +vaporization (J kg\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\lambda` is either the latent heat of vaporization :math:`\lambda _{vap}` or latent heat of sublimation :math:`\lambda _{sub}` (J kg\ :sup:`-1`) -(Table 2.6) depending on the liquid water and ice content of the top +(:numref:`Table Physical constants`) depending on the liquid water and ice content of the top snow/soil layer (section 5.4). :sup:`2`\ There are :math:`j=1,\ldots ,4` dust transport bins. +.. _Initialization: + Initialization ^^^^^^^^^^^^^^^^^^^^ @@ -504,16 +539,19 @@ ice contents are initialized as :math:`w_{liq,\, i} =0` and :math:`w_{liq,\, i} =\Delta z_{i} \rho _{liq} \theta _{i}` and :math:`w_{ice,\, i} =0` for :math:`T_{i} >T_{f}` , where :math:`\rho _{ice}` and :math:`\rho _{liq}` are the densities of ice -and liquid water (kg m\ :sup:`-3`) (Table 2.6), and :math:`T_{f}` -is the freezing temperature of water (K) (Table 2.6). All vegetated and +and liquid water (kg m\ :sup:`-3`) (:numref:`Table Physical constants`), and :math:`T_{f}` +is the freezing temperature of water (K) (:numref:`Table Physical constants`). All vegetated and glacier land units are initialized with water stored in the unconfined aquifer and unsaturated soil :math:`W_{a} =4000` mm and water table depth :math:`z_{\nabla }` at five meters below the soil column. +.. _Surface Data: + Surface Data ^^^^^^^^^^^^^^^^^^ -Required surface data for each land grid cell are listed in Table 2.5 +Required surface data for each land grid cell are listed in +:numref:`Table Surface data required for CLM and their base spatial resolution` and include the glacier, lake, and urban fractions of the grid cell (vegetated and crop occupy the remainder), the fractional cover of each plant functional type (PFT), monthly leaf and stem area index and canopy @@ -523,53 +561,55 @@ elevation, biogenic volatile organic compounds (BVOCs) emissions factors, population density, gross domestic production, peat area fraction, and peak month of agricultural burning. Optional surface data include crop irrigation and managed crops. All fields are aggregated to -the model’s grid from high-resolution input datasets (Table 2.5) that +the model’s grid from high-resolution input datasets ( +:numref:`Table Surface data required for CLM and their base spatial resolution`) that are obtained from a variety of sources described below. -Table 2.5. Surface data required for CLM and their base spatial -resolution - -+--------------------------------------------+---------------------------+ -| Surface Field | Resolution | -+============================================+===========================+ -| Percent glacier | 0.05\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Percent lake and lake depth | 0.05\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Percent urban | 0.05\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Percent plant functional types (PFTs) | 0.05\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Monthly leaf and stem area index | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Canopy height (top, bottom) | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Soil color | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Percent sand, percent clay | 0.083\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Soil organic matter density | 0.083\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Maximum fractional saturated area | 0.125\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Elevation | 1km | -+--------------------------------------------+---------------------------+ -| Slope | 1km | -+--------------------------------------------+---------------------------+ -| Biogenic Volatile Organic Compounds | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Crop Irrigation | 0.083\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Managed crops | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Population density | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Gross domestic production | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Peat area fraction | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ -| Peak month of agricultural waste burning | 0.5\ :sup:`o` | -+--------------------------------------------+---------------------------+ +.. _Table Surface data required for CLM and their base spatial resolution: + +.. table:: Surface data required for CLM and their base spatial resolution + + +--------------------------------------------+---------------------------+ + | Surface Field | Resolution | + +============================================+===========================+ + | Percent glacier | 0.05\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Percent lake and lake depth | 0.05\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Percent urban | 0.05\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Percent plant functional types (PFTs) | 0.05\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Monthly leaf and stem area index | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Canopy height (top, bottom) | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Soil color | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Percent sand, percent clay | 0.083\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Soil organic matter density | 0.083\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Maximum fractional saturated area | 0.125\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Elevation | 1km | + +--------------------------------------------+---------------------------+ + | Slope | 1km | + +--------------------------------------------+---------------------------+ + | Biogenic Volatile Organic Compounds | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Crop Irrigation | 0.083\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Managed crops | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Population density | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Gross domestic production | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Peat area fraction | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ + | Peak month of agricultural waste burning | 0.5\ :sup:`o` | + +--------------------------------------------+---------------------------+ At the base spatial resolution of 0.05\ :sup:`o`, the percentage of each PFT is defined with respect to the vegetated portion of the grid @@ -669,7 +709,7 @@ of Emissions of Gases and Aerosols from Nature version 2.1 (MEGAN2.1; Guenther et al. 2012). The default list of PFTs includes an unmanaged crop treated as a second -C3 grass (Table 2.1). The unmanaged crop has grid cell fractional cover +C3 grass (:numref:`Table Plant functional types`). The unmanaged crop has grid cell fractional cover assigned from MODIS satellite data (Lawrence and Chase 2007). A managed crop option uses grid cell fractional cover from the present-day crop dataset of Ramankutty and Foley (1998) (CLM4CNcrop). Managed crops are @@ -695,12 +735,12 @@ not share soil columns and thus permit for differences in land management between crops. CLM includes the option to irrigate cropland areas that are equipped for -irrigation. The application of irrigation responds dynamically to -climate (see Chapter 20). In CLM, irrigation is implemented for the C3 +irrigation. The application of irrigation responds dynamically to climate +(see Chapter :numref:`rst_Crops and Irrigation`). In CLM, irrigation is +implemented for the C3 generic crop only. When irrigation is enabled, the cropland area of each grid cell is divided into an irrigated and unirrigated fraction -according to a dataset of areas equipped for irrigation (Siebert et al. -2005). The area of irrigated cropland in each grid cell is given by the +according to a dataset of areas equipped for irrigation (:ref:`Siebert et al. (2005) `). The area of irrigated cropland in each grid cell is given by the smaller of the grid cell’s total cropland area, according to the default CLM4 dataset, and the grid cell’s area equipped for irrigation. The remainder of the grid cell’s cropland area (if any) is then assigned to @@ -708,7 +748,7 @@ unirrigated cropland. Irrigated and unirrigated crops are placed on separate soil columns, so that irrigation is only applied to the soil beneath irrigated crops. -Several input datasets are required for the fire model (Li et al. 2013a) +Several input datasets are required for the fire model (:ref:`Li et al. 2013a `) including population density, gross domestic production, peat area fraction, and peak month of agricultural waste burning. Population density at 0.5\ :sup:`o` resolution for 1850-2100 combines 5-min @@ -730,6 +770,8 @@ Global Lakes and Wetlands Database (GLWD) (Lehner and Döll, 2004). The climatological peak month for agricultural waste burning is from van der Werf et al. (2010). +.. _Adjustable Parameters and Physical Constants: + Adjustable Parameters and Physical Constants ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -737,10 +779,13 @@ Values of certain adjustable parameters inherent in the biogeophysical or biogeochemical parameterizations have either been obtained from the literature or calibrated based on comparisons with observations. These are described in the text. Physical constants, generally shared by all -of the components in the coupled modeling system, are presented in Table -2.6. +of the components in the coupled modeling system, are presented in +:numref:`Table Physical constants`. + + +.. _Table Physical constants: -.. csv-table:: Table 2.6. Physical constants +.. csv-table:: Physical constants :header: "description", "name", "value", "units" :widths: 40, 20, 20, 20 diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 868d8409a6..0bfdaf6217 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -63,7 +63,7 @@ to sensible heat and water vapor transfer between the atmosphere at heights :math:`z_{atm,\, h}` and :math:`z_{atm,\, w}` and the surface at heights :math:`z_{0h} +d` and :math:`z_{0w} +d`, respectively. The specific heat capacity of air :math:`C_{p}` (J kg\ :sup:`-1` -K\ :sup:`-1`) is a constant (Table 2.6). The atmospheric potential +K\ :sup:`-1`) is a constant (:numref:`Table Physical constants`). The atmospheric potential temperature used here is .. math:: @@ -78,7 +78,7 @@ expression is first-order equivalent to :math:`\theta _{atm} =T_{atm} \left({P_{srf} \mathord{\left/ {\vphantom {P_{srf} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } \right)^{{R_{da} \mathord{\left/ {\vphantom {R_{da} C_{p} }} \right. \kern-\nulldelimiterspace} C_{p} } }` (Stull 1988), where :math:`P_{srf}` is the surface pressure (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`R_{da}` -is the gas constant for dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6)]. By definition, +is the gas constant for dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`)]. By definition, :math:`\theta _{s} =T_{s}` . The density of moist air (kg m\ :sup:`-3`) is .. math:: @@ -130,7 +130,7 @@ where :math:`z` is height in the surface layer (m), :math:`d` is the displacement height (m), :math:`L` is the Monin-Obukhov length scale (m) that accounts for buoyancy effects resulting from vertical density gradients (i.e., the atmospheric stability), k is the von Karman -constant (Table 2.6), and :math:`\left|{\it u}\right|` is the +constant (:numref:`Table Physical constants`), and :math:`\left|{\it u}\right|` is the atmospheric wind speed (m s\ :sup:`-1`). :math:`\phi _{m}` , :math:`\phi _{h}` , and :math:`\phi _{w}` are universal (over any surface) similarity functions of :math:`\zeta` that relate the constant @@ -171,7 +171,7 @@ defined as L=-\frac{u_{*}^{3} }{k\left(\frac{g}{\overline{\theta _{v,\, atm} }} \right)\theta '_{v} w'} =\frac{u_{*}^{2} \overline{\theta _{v,\, atm} }}{kg\theta _{v*} } where :math:`g` is the acceleration of gravity (m s\ :sup:`-2`) -(Table 2.6), and +(:numref:`Table Physical constants`), and :math:`\overline{\theta _{v,\, atm} }=\overline{\theta _{atm} }\left(1+0.61q_{atm} \right)` is the reference virtual potential temperature. :math:`L>0` indicates stable conditions. :math:`L<0` indicates unstable conditions. @@ -186,7 +186,7 @@ stable conditions. :math:`L<0` indicates unstable conditions. where :math:`\overline{\theta _{atm} }` is the atmospheric potential temperature. -Following Panofsky and Dutton (1984), the differential equations for +Following :ref:`Panofsky and Dutton (1984)`, the differential equations for :math:`\phi _{m} \left(\zeta \right)`, :math:`\phi _{h} \left(\zeta \right)`, and :math:`\phi _{w} \left(\zeta \right)` can be integrated formally without @@ -292,15 +292,14 @@ where :math:`w_{\*}` is the convective velocity scale :math:`z_{i} =1000` is the convective boundary layer height (m), and :math:`\beta =1`. -The momentum flux gradient relations are (Zeng et al. 1998) +The momentum flux gradient relations are (:ref:`Zeng et al. 1998 `) .. math:: :label: 5.30 \begin{array}{l} {\phi _{m} \left(\zeta \right)=0.7k^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \qquad {\rm for\; }\zeta <-1.574{\rm \; (very\; unstable)}} \\ {\phi _{m} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } \qquad {\rm for\; -1.574}\le \zeta <0{\rm \; (unstable)}} \\ {\phi _{m} \left(\zeta \right)=1+5\zeta \qquad {\rm for\; }0\le \zeta \le 1{\rm \; (stable)}} \\ {\phi _{m} \left(\zeta \right)=5+\zeta \qquad {\rm for\; }\zeta {\rm >1\; (very\; stable).}} \end{array} -The sensible and latent heat flux gradient relations are (Zeng et al. -1998) +The sensible and latent heat flux gradient relations are (:ref:`Zeng et al. 1998 `) .. math:: :label: 5.31 @@ -316,7 +315,7 @@ for very unstable and unstable conditions at :math:`\zeta _{m} =-1.574` for :math:`\phi _{m} \left(\zeta \right)` and :math:`\zeta _{h} =\zeta _{w} =-0.465` for :math:`\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)` -(Zeng et al. 1998). The flux gradient relations can be integrated to +(:ref:`Zeng et al. 1998 `). The flux gradient relations can be integrated to yield wind profiles for the following conditions: Very unstable :math:`\left(\zeta <-1.574\right)` @@ -440,7 +439,7 @@ bulk Richardson number R_{iB} =\frac{\theta _{v,\, atm} -\theta _{v,\, s} }{\overline{\theta _{v,\, atm} }} \frac{g\left(z_{atm,\, m} -d\right)}{V_{a}^{2} } -is related to :math:`\zeta` (Arya 2001) as +is related to :math:`\zeta` (:ref:`Arya 2001 `) as .. math:: :label: 5.47 @@ -460,7 +459,7 @@ guess for :math:`\zeta` and thus :math:`L` from \label{ZEqnNum979946} \begin{array}{l} {\zeta =\frac{R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)}{1-5\min \left(R_{iB} ,0.19\right)} \qquad 0.01\le \zeta \le 2\qquad {\rm for\; }R_{iB} \ge 0{\rm \; (neutral\; or\; stable)}} \\ {\zeta =R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)\qquad -100\le \zeta \le -0.01\qquad {\rm for\; }R_{iB} <0{\rm \; (unstable)}} \end{array}. -Upon iteration (section 5.3.2), the following is used to determine +Upon iteration (section :numref:`Numerical Implementation`), the following is used to determine :math:`\zeta` and thus :math:`L` .. math:: @@ -545,11 +544,11 @@ Relative humidity is RH_{2m} =\min \left(100,\, \frac{q_{2m} }{q_{sat}^{T_{2m} } } \times 100\right) where :math:`q_{sat}^{T_{2m} }` is the saturated specific humidity at -the 2-m temperature :math:`T_{2m}` (section 5.5). +the 2-m temperature :math:`T_{2m}` (section :numref:`Saturation Vapor Pressure`). A 10-m wind speed is calculated as (note that this is not consistent with the 10-m wind speed calculated for the dust model as described in -Chapter 24) +Chapter :numref:`rst_Dust Model`) .. math:: :label: 5.61 @@ -562,12 +561,13 @@ Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces -------------------------------------------------------------- Surfaces are considered non-vegetated for the surface flux calculations -if leaf plus stem area index :math:`L+S<0.05` (section 2.1.4). By +if leaf plus stem area index :math:`L+S<0.05` (section +:numref:`Phenology and vegetation burial by snow`). By definition, this includes bare soil, wetlands, and glaciers. The -solution for lakes is described in Chapter 9. For these surfaces, the +solution for lakes is described in Chapter :numref:`rst_Lake Model`. For these surfaces, the surface may be exposed to the atmosphere, snow covered, and/or surface water covered, so that the sensible heat flux :math:`H_{g}` (W -m\ :sup:`-2`) is, with reference to Figure 5.1, +m\ :sup:`-2`) is, with reference to :numref:`Figure Schematic diagram of sensible heat fluxes`, .. math:: :label: ZEqnNum726771 @@ -596,12 +596,13 @@ surface water :math:`T_{h2osfc}` are H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{h2osfc} \right)}{r_{ah} } where :math:`\rho _{atm}` is the density of atmospheric air (kg m\ :sup:`-3`), :math:`C_{p}` is the specific heat capacity of air -(J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), +(J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`), :math:`\theta _{atm}` is the atmospheric potential temperature (K), and :math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer (s m\ :sup:`-1`). -The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with reference to Figure 5.2, +The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with reference to +:numref:`Figure Schematic diagram of latent heat fluxes`, .. math:: :label: ZEqnNum419297 @@ -648,7 +649,7 @@ to be proportional to the saturation specific humidity q_{soil} =\alpha _{soil} q_{sat}^{T_{1} } where :math:`q_{sat}^{T_{1} }` is the saturated specific humidity at -the soil surface temperature :math:`T_{1}` (section 5.5). The factor +the soil surface temperature :math:`T_{1}` (section :numref:`Saturation Vapor Pressure`). The factor :math:`\alpha _{soil}` is a function of the surface soil water matric potential :math:`\psi` as in Philip (1957) @@ -657,8 +658,8 @@ potential :math:`\psi` as in Philip (1957) \alpha _{soil} =\exp \left(\frac{\psi _{1} g}{1\times 10^{3} R_{wv} T_{1} } \right) -where :math:`R_{wv}` is the gas constant for water vapor (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), :math:`g` is the -gravitational acceleration (m s\ :sup:`-2`) (Table 2.6), and +where :math:`R_{wv}` is the gas constant for water vapor (J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`), :math:`g` is the +gravitational acceleration (m s\ :sup:`-2`) (:numref:`Table Physical constants`), and :math:`\psi _{1}` is the soil water matric potential of the top soil layer (mm). The soil water matric potential :math:`\psi _{1}` is @@ -668,10 +669,11 @@ layer (mm). The soil water matric potential :math:`\psi _{1}` is \psi _{1} =\psi _{sat,\, 1} s_{1}^{-B_{1} } \ge -1\times 10^{8} where :math:`\psi _{sat,\, 1}` is the saturated matric potential (mm) -(section 7.4.1), :math:`B_{1}` is the Clapp and Hornberger (1978) -parameter (section 7.4.1), and :math:`s_{1}` is the wetness of the top -soil layer with respect to saturation. The surface wetness -:math:`s_{1}` is a function of the liquid water and ice content +(section :numref:`Hydraulic Properties`), +:math:`B_{1}` is the :ref:`Clapp and Hornberger (1978) ` +parameter (section :numref:`Hydraulic Properties`), +and :math:`s_{1}` is the wetness of the top soil layer with respect to saturation. +The surface wetness :math:`s_{1}` is a function of the liquid water and ice content .. math:: :label: 5.75) @@ -680,11 +682,11 @@ soil layer with respect to saturation. The surface wetness where :math:`\Delta z_{1}` is the thickness of the top soil layer (m), :math:`\rho _{liq}` and :math:`\rho _{ice}` are the density of liquid -water and ice (kg m\ :sup:`-3`) (Table 2.6), :math:`w_{liq,\, 1}` +water and ice (kg m\ :sup:`-3`) (:numref:`Table Physical constants`), :math:`w_{liq,\, 1}` and :math:`w_{ice,\, 1}` are the mass of liquid water and ice of the -top soil layer (kg m\ :sup:`-2`) (Chapter 7), and +top soil layer (kg m\ :sup:`-2`) (Chapter :numref:`rst_Hydrology`), and :math:`\theta _{sat,\, 1}` is the saturated volumetric water content -(i.e., porosity) of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) (section 7.4.1). If +(i.e., porosity) of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) (section :numref:`Hydraulic Properties`). If :math:`q_{sat}^{T_{1} } >q_{atm}` and :math:`q_{atm} >q_{soil}` , then :math:`q_{soil} =q_{atm}` and :math:`\frac{dq_{soil} }{dT} =0`. This prevents large increases (decreases) in :math:`q_{soil}` for small @@ -711,7 +713,7 @@ The volumetric water content of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) The volumetric water content at field capacity is derived by assuming a hydraulic conductivity of 0.1 mm day\ :sup:`-1` and inverting the -hydraulic conductivity function (section 7.4.1) as +hydraulic conductivity function (section :numref:`Hydraulic Properties`) as .. math:: :label: 5.78) @@ -719,8 +721,8 @@ hydraulic conductivity function (section 7.4.1) as \theta _{fc,\, 1} =\theta _{sat,\, 1} \left[\frac{0.1}{86400k_{sat,\, 1} } \right]^{\frac{1}{2B_{i} +3} } where :math:`k_{sat,\, 1}` is the saturated hydraulic conductivity of -the top soil layer (mm s\ :sup:`-1`) (section 7.4.1) and the -exponent :math:`B_{1}` is a function of soil texture (section 7.4.1). +the top soil layer (mm s\ :sup:`-1`) (section :numref:`Hydraulic Properties`) and the +exponent :math:`B_{1}` is a function of soil texture (section :numref:`Hydraulic Properties`). The roughness lengths used to calculate :math:`r_{am}` , :math:`r_{ah}` , and :math:`r_{aw}` are :math:`z_{0m} =z_{0m,\, g}` , @@ -734,7 +736,8 @@ fluctuations in the turbulent waves behind the roughness elements, while for heat and water vapor transfer no such dynamical mechanism exists. Rather, heat and water vapor must be transferred by molecular diffusion across the interfacial sublayer. The following relation from -Zilitinkevich (1970) is adopted by Zeng and Dickinson (1998) +:ref:`Zilitinkevich (1970) ` is adopted by +:ref:`Zeng and Dickinson 1998 ` .. math:: :label: ZEqnNum844212 @@ -789,9 +792,9 @@ water vapor flux from non-vegetated surfaces proceeds as follows: :math:`q_{2m}` (eqs. , ) The partial derivatives of the soil surface fluxes with respect to -ground temperature, which are needed for the soil temperature -calculations (section 6.1) and to update the soil surface fluxes -(section 5.4), are +ground temperature, which are needed for the soil temperature calculations (section +:numref:`Numerical Solution Temperature`) and to update the soil surface fluxes +(section :numref:`Update of Ground Sensible and Latent Heat Fluxes`), are .. math:: :label: ZEqnNum806472 @@ -831,8 +834,8 @@ coupling between vegetation temperature and fluxes, Newton-Raphson iteration is used to solve for the vegetation temperature and the sensible heat and water vapor fluxes from vegetation simultaneously using the ground temperature from the previous time step. In section -5.3.1, the equations used in the iteration scheme are derived. Details -on the numerical scheme are provided in section 5.3.2. +:numref:`Theory`, the equations used in the iteration scheme are derived. Details +on the numerical scheme are provided in section :numref:`Numerical Implementation`. .. _Theory: @@ -850,7 +853,7 @@ from the vegetation :math:`H_{v}` and the ground :math:`H_{g}` H=H_{v} +H_{g} -where, with reference to Figure 5.1, +where, with reference to :numref:`Figure Schematic diagram of sensible heat fluxes`, .. math:: :label: 5.84) @@ -883,7 +886,7 @@ where, with reference to Figure 5.1, H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{h2osfc} \right)}{r_{ah} ^{{'} } } where :math:`\rho _{atm}` is the density of atmospheric air (kg m\ :sup:`-3`), :math:`C_{p}` is the specific heat capacity of air -(J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), +(J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`), :math:`\theta _{atm}` is the atmospheric potential temperature (K), and :math:`r_{ah}` is the aerodynamic resistance to sensible heat transfer (s m\ :sup:`-1`). @@ -891,21 +894,25 @@ where :math:`\rho _{atm}` is the density of atmospheric air (kg m\ :sup:`-3`), Here, :math:`T_{s}` is the surface temperature at height :math:`z_{0h} +d`, also referred to as the canopy air temperature. :math:`L` and :math:`S` are the exposed leaf and stem area indices -(section 2.1.4), :math:`r_{b}` is the leaf boundary layer resistance (s +(section :numref:`Phenology and vegetation burial by snow`), :math:`r_{b}` is the leaf boundary layer resistance (s m\ :sup:`-1`), and :math:`r_{ah} ^{{'} }` is the aerodynamic resistance (s m\ :sup:`-1`) to heat transfer between the ground at height :math:`z_{0h} ^{{'} }` and the canopy air at height :math:`z_{0h} +d`. -Figure 5.1. Schematic diagram of sensible heat fluxes for (a) -non-vegetated surfaces and (b) vegetated surfaces. +.. _Figure Schematic diagram of sensible heat fluxes: -.. image:: image1.png +.. figure:: image1.png -Figure 5.2. Schematic diagram of water vapor fluxes for (a) -non-vegetated surfaces and (b) vegetated surfaces. + Figure Schematic diagram of sensible heat fluxes for (a) + non-vegetated surfaces and (b) vegetated surfaces. -.. image:: image2.png +.. _Figure Schematic diagram of latent heat fluxes: + +.. figure:: image2.png + + Figure Schematic diagram of water vapor fluxes for (a) + non-vegetated surfaces and (b) vegetated surfaces. Equations - can be solved for the canopy air temperature :math:`T_{s}` @@ -963,7 +970,7 @@ flux from the vegetation :math:`E_{v}` and the ground :math:`E_{g}` E=E_{v} +E_{g} -where, with reference to Figure 5.2, +where, with reference to :numref:`Figure Schematic diagram of latent heat fluxes`, .. math:: :label: 5.97) @@ -998,19 +1005,21 @@ where, with reference to Figure 5.2, where :math:`q_{atm}` is the atmospheric specific humidity (kg kg\ :sup:`-1`), :math:`r_{aw}` is the aerodynamic resistance to water vapor transfer (s m\ :sup:`-1`), :math:`q_{sat}^{T_{v} }` (kg kg\ :sup:`-1`) is the saturation water vapor specific humidity -at the vegetation temperature (section 5.5), :math:`q_{g}` , +at the vegetation temperature (section :numref:`Saturation Vapor Pressure`), :math:`q_{g}` , :math:`q_{sno}` , and :math:`q_{h2osfc}` are the specific humidities -of the soil, snow, and surface water (section 5.2), +of the soil, snow, and surface water (section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), :math:`r_{aw} ^{{'} }` is the aerodynamic resistance (s m\ :sup:`-1`) to water vapor transfer between the ground at height :math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, :math:`\beta _{soi}` is an empirical function of soil water (section -5.2), and :math:`r_{litter}` is a resistance for the plant litter layer +:numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), +and :math:`r_{litter}` is a resistance for the plant litter layer (s m\ :sup:`-1`). :math:`r_{total}` is the total resistance to water vapor transfer from the canopy to the canopy air and includes contributions from leaf boundary layer and sunlit and shaded stomatal resistances :math:`r_{b}` , :math:`r_{s}^{sun}` , and -:math:`r_{s}^{sha}` (Figure 5.2). The water vapor flux from vegetation +:math:`r_{s}^{sha}` (:numref:`Figure Schematic diagram of latent heat fluxes`). +The water vapor flux from vegetation is the sum of water vapor flux from wetted leaf and stem area :math:`E_{v}^{w}` (evaporation of water intercepted by the canopy) and transpiration from dry leaf surfaces :math:`E_{v}^{t}` @@ -1057,11 +1066,11 @@ as r''=\left\{\begin{array}{l} {\min \left(f_{wet} +r_{dry} ^{{'} {'} } ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} >0} \\ {\min \left(f_{wet} ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} \le 0} \\ {1\qquad E_{v}^{w,\, pot} \le 0} \end{array}\right\} where :math:`f_{wet}` is the fraction of leaves and stems that are wet -(section 7.1), :math:`W_{can}` is canopy water (kg m\ :sup:`-2`) -(section 7.1), :math:`\Delta t` is the time step (s), and +(section :numref:`Canopy Water`), :math:`W_{can}` is canopy water (kg m\ :sup:`-2`) +(section :numref:`Canopy Water`), :math:`\Delta t` is the time step (s), and :math:`\beta _{t}` is a soil moisture function limiting transpiration -(Chapter 8). The potential evaporation from wet foliage per unit wetted -area is +(Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). The potential +evaporation from wet foliage per unit wetted area is .. math:: :label: 5.109) @@ -1076,10 +1085,10 @@ The term :math:`r_{dry} ^{{'} {'} }` is r_{dry} ^{{'} {'} } =\frac{f_{dry} r_{b} }{L} \left(\frac{L^{sun} }{r_{b} +r_{s}^{sun} } +\frac{L^{sha} }{r_{b} +r_{s}^{sha} } \right) where :math:`f_{dry}` is the fraction of leaves that are dry (section -7.1), :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded -leaf area indices (section 4.1), and :math:`r_{s}^{sun}` and +:numref:`Canopy Water`), :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded +leaf area indices (section :numref:`Solar Fluxes`), and :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}` are the sunlit and shaded stomatal resistances (s -m\ :sup:`-1`) (Chapter 8). +m\ :sup:`-1`) (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). When the expression for :math:`q_{s}` is substituted into equation , the water vapor flux from vegetation :math:`E_{v}` is a function of @@ -1119,8 +1128,7 @@ is the magnitude of the wind velocity incident on the leaves (equivalent here to friction velocity) (m s\ :sup:`-1`) and :math:`C_{s}` is the turbulent transfer coefficient between the underlying soil and the canopy air. :math:`C_{s}` is obtained by -interpolation between values for dense canopy and bare soil (Zeng et al. -2005) +interpolation between values for dense canopy and bare soil (:ref:`Zeng et al. 2005 `) .. math:: :label: 5.115) @@ -1134,8 +1142,8 @@ where the weight :math:`W` is W=e^{-\left(L+S\right)} . -The dense canopy turbulent transfer coefficient in Zeng et al. (2005) -is modified from its original value of 0.004 (Dickinson et al. 1993) by +The dense canopy turbulent transfer coefficient in :ref:`Zeng et al. (2005) ` +is modified from its original value of 0.004 (:ref:`Dickinson et al. 1993 `) by Sakaguchi and Zeng (2009) to account for stability as .. math:: @@ -1152,8 +1160,8 @@ determined from S=\frac{gz_{top} \left(T_{s} -T_{g} \right)}{T_{s} u_{*}^{2} } where :math:`g` is the gravitational acceleration (m -s\ :sup:`-2`) (Table 2.6), and :math:`z_{top}` is canopy top -height (m) (Table 2.2). The bare soil turbulent transfer coefficient is +s\ :sup:`-2`) (:numref:`Table Physical constants`), and :math:`z_{top}` is canopy top +height (m) (:numref:`Table Prescribed plant functional type heights`). The bare soil turbulent transfer coefficient is .. math:: :label: 5.119) @@ -1188,8 +1196,7 @@ The effective snow cover of the litter layer is f_{litter}^{snow} =\frac{z_{sno} }{\Delta z_{litter} } where :math:`\Delta z_{litter} =0.05`\ m is assumed as a typical depth -for the litter layer, and :math:`z_{sno}` is the depth of snow (section -7.2) (m). +for the litter layer, and :math:`z_{sno}` is the depth of snow (Chapter :numref:`rst_Snow Hydrology`) (m). The leaf boundary layer resistance :math:`r_{b}` is @@ -1201,12 +1208,12 @@ The leaf boundary layer resistance :math:`r_{b}` is where :math:`C_{v} =0.01` m\ s\ :sup:`-1/2` is the turbulent transfer coefficient between the canopy surface and canopy air, and :math:`d_{leaf}` is the characteristic dimension of the leaves in the -direction of wind flow (Table 5.1). +direction of wind flow (:numref:`Table Coefficients for saturation vapor pressure`). The partial derivatives of the fluxes from the soil beneath the canopy with respect to ground temperature, which are needed for the soil -temperature calculations (section 6.1) and to update the soil surface -fluxes (section 5.4), are +temperature calculations (section :numref:`Numerical Solution Temperature`) and to update the soil surface +fluxes (section :numref:`Update of Ground Sensible and Latent Heat Fluxes`), are .. math:: :label: ZEqnNum774729 @@ -1230,7 +1237,7 @@ The roughness lengths used to calculate :math:`r_{am}` , :math:`z_{0m} =z_{0m,\, v}` , :math:`z_{0h} =z_{0h,\, v}` , and :math:`z_{0w} =z_{0w,\, v}` . The vegetation displacement height :math:`d` and the roughness lengths are a function of plant height and -adjusted for canopy density following Zeng and Wang (2007) +adjusted for canopy density following :ref:`Zeng and Wang (2007) ` .. math:: :label: 5.126) @@ -1242,11 +1249,12 @@ adjusted for canopy density following Zeng and Wang (2007) d=z_{top} R_{d} V -where :math:`z_{top}` is canopy top height (m) (Table 2.2), +where :math:`z_{top}` is canopy top height (m) (:numref:`Table Prescribed plant functional type heights`), :math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness -length and displacement height to canopy top height, respectively (Table -5.1), and :math:`z_{0m,\, g}` is the ground momentum roughness length -(m) (section 5.2). The fractional weight :math:`V` is determined from +length and displacement height to canopy top height, respectively +(:numref:`Table Plant functional type aerodynamic parameters`), and +:math:`z_{0m,\, g}` is the ground momentum roughness length +(m) (section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`). The fractional weight :math:`V` is determined from .. math:: :label: 5.128) @@ -1256,59 +1264,61 @@ length and displacement height to canopy top height, respectively (Table where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} =2` (m\ :sup:`2` m\ :sup:`-2`) is a critical value of exposed leaf plus stem area for which :math:`z_{0m}` reaches its maximum. -Table 5.1. Plant functional type aerodynamic parameters - -+----------------------------------+--------------------+------------------+-------------------------+ -| Plant functional type | :math:`R_{z0m}` | :math:`R_{d}` | :math:`d_{leaf}` (m) | -+==================================+====================+==================+=========================+ -| NET Temperate | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| NET Boreal | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| NDT Boreal | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BET Tropical | 0.075 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BET temperate | 0.075 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BDT tropical | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BDT temperate | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BDT boreal | 0.055 | 0.67 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BES temperate | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BDS temperate | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| BDS boreal | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| C\ :sub:`3` arctic grass | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| C\ :sub:`3` grass | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| C\ :sub:`4` grass | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Crop R | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Crop I | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Corn R | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Corn I | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Temp Cereal R | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Temp Cereal I | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Winter Cereal R | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Winter Cereal I | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Soybean R | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ -| Soybean I | 0.120 | 0.68 | 0.04 | -+----------------------------------+--------------------+------------------+-------------------------+ +.. _Table Plant functional type aerodynamic parameters: + +.. table:: Plant functional type aerodynamic parameters + + +----------------------------------+--------------------+------------------+-------------------------+ + | Plant functional type | :math:`R_{z0m}` | :math:`R_{d}` | :math:`d_{leaf}` (m) | + +==================================+====================+==================+=========================+ + | NET Temperate | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | NET Boreal | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | NDT Boreal | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BET Tropical | 0.075 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BET temperate | 0.075 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BDT tropical | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BDT temperate | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BDT boreal | 0.055 | 0.67 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BES temperate | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BDS temperate | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | BDS boreal | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | C\ :sub:`3` arctic grass | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | C\ :sub:`3` grass | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | C\ :sub:`4` grass | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Crop R | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Crop I | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Corn R | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Corn I | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Temp Cereal R | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Temp Cereal I | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Winter Cereal R | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Winter Cereal I | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Soybean R | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ + | Soybean I | 0.120 | 0.68 | 0.04 | + +----------------------------------+--------------------+------------------+-------------------------+ .. _Numerical Implementation: @@ -1323,12 +1333,12 @@ Canopy energy conservation gives -\overrightarrow{S}_{v} +\overrightarrow{L}_{v} \left(T_{v} \right)+H_{v} \left(T_{v} \right)+\lambda E_{v} \left(T_{v} \right)=0 where :math:`\overrightarrow{S}_{v}` is the solar radiation absorbed by -the vegetation (section 4.1), :math:`\overrightarrow{L}_{v}` is the net -longwave radiation absorbed by vegetation (section 4.2), and +the vegetation (section :numref:`Solar Fluxes`), :math:`\overrightarrow{L}_{v}` is the net +longwave radiation absorbed by vegetation (section :numref:`Longwave Fluxes`), and :math:`H_{v}` and :math:`\lambda E_{v}` are the sensible and latent heat fluxes from vegetation, respectively. The term :math:`\lambda` is taken to be the latent heat of vaporization :math:`\lambda _{vap}` -(Table 2.6). +(:numref:`Table Physical constants`). :math:`\overrightarrow{L}_{v}` , :math:`H_{v}` , and :math:`\lambda E_{v}` depend on the vegetation temperature @@ -1436,7 +1446,7 @@ proceeds as follows: :math:`r_{aw} ^{{'} }` (eq. ) #. Sunlit and shaded stomatal resistances :math:`r_{s}^{sun}` and - :math:`r_{s}^{sha}` (Chapter 8) + :math:`r_{s}^{sha}` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) #. Sensible heat conductances :math:`c_{a}^{h}` , :math:`c_{g}^{h}` , and :math:`c_{v}^{h}` (eqs. , , ) @@ -1494,10 +1504,10 @@ flux later. :math:`\lambda \Delta _{3}` are also added to the sensible heat flux. -#. The saturated vapor pressure :math:`e_{i}` (Chapter 8), saturated +#. The saturated vapor pressure :math:`e_{i}` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), saturated specific humidity :math:`q_{sat}^{T_{v} }` and its derivative :math:`\frac{dq_{sat}^{T_{v} } }{dT_{v} }` at the leaf surface - (section 5.5), are re-evaluated based on the new :math:`T_{v}` . + (section :numref:`Saturation Vapor Pressure`), are re-evaluated based on the new :math:`T_{v}` . #. Canopy air temperature :math:`T_{s}` (eq. ) @@ -1548,7 +1558,7 @@ The sensible and water vapor heat fluxes derived above for bare soil and soil beneath canopy are based on the ground surface temperature from the previous time step :math:`T_{g}^{n}` and are used as the surface forcing for the solution of the soil temperature equations (section -6.1). This solution yields a new ground surface temperature +:numref:`Numerical Solution Temperature`). This solution yields a new ground surface temperature :math:`T_{g}^{n+1}` . The ground sensible and water vapor fluxes are then updated for :math:`T_{g}^{n+1}` as @@ -1591,7 +1601,7 @@ relative area of the :math:`j^{th}` PFT with respect to the column, and :math:`npft` is the number of PFTs on the column. :math:`w_{ice,\, snl+1}` and :math:`w_{liq,\, snl+1}` are the ice and liquid water contents (kg m\ :sup:`-2`) of the top snow/soil layer -(Chapter 7). Any resulting energy deficit is assigned to sensible heat +(Chapter :numref:`rst_Hydrology`). Any resulting energy deficit is assigned to sensible heat as .. math:: @@ -1626,9 +1636,9 @@ on snow/soil :math:`q_{sdew}` (kg m\ :sup:`-2` s\ :sup:`-1`), or frost on snow/ The loss or gain in snow mass due to :math:`q_{seva}` , :math:`q_{subl}` , :math:`q_{sdew}` , and :math:`q_{frost}` on a snow surface are accounted for during the snow hydrology calculations -(section 7.2). The loss of soil and surface water due to +(Chapter :numref:`rst_Snow Hydrology`). The loss of soil and surface water due to :math:`q_{seva}` is accounted for in the calculation of infiltration -(section 7.3), while losses or gains due to :math:`q_{subl}` , +(section :numref:`Infiltration`), while losses or gains due to :math:`q_{subl}` , :math:`q_{sdew}` , and :math:`q_{frost}` on a soil surface are accounted for following the sub-surface drainage calculations (section 7.6). @@ -1641,8 +1651,8 @@ The ground heat flux :math:`G` is calculated as G=\overrightarrow{S}_{g} -\overrightarrow{L}_{g} -H_{g} -\lambda E_{g} where :math:`\overrightarrow{S}_{g}` is the solar radiation absorbed by -the ground (section 4.1), :math:`\overrightarrow{L}_{g}` is the net -longwave radiation absorbed by the ground (section 4.2) +the ground (section :numref:`Solar Fluxes`), :math:`\overrightarrow{L}_{g}` is the net +longwave radiation absorbed by the ground (section :numref:`Longwave Fluxes`) .. math:: :label: 5.151) @@ -1669,7 +1679,7 @@ When converting ground water vapor flux to an energy flux, the term where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the latent heat of sublimation and vaporization, respectively (J -(kg\ :sup:`-1`) (Table 2.6). When converting vegetation water vapor +(kg\ :sup:`-1`) (:numref:`Table Physical constants`). When converting vegetation water vapor flux to an energy flux, :math:`\lambda _{vap}` is used. The system balances energy as @@ -1687,7 +1697,7 @@ Saturation Vapor Pressure Saturation vapor pressure :math:`e_{sat}^{T}` (Pa) and its derivative :math:`\frac{de_{sat}^{T} }{dT}` , as a function of temperature :math:`T` (ºC), are calculated from the eighth-order polynomial fits of -Flatau et al. (1992) +:ref:`Flatau et al. (1992) ` .. math:: :label: 5.155) @@ -1702,10 +1712,11 @@ Flatau et al. (1992) where the coefficients for ice are valid for :math:`-75\, ^{\circ } {\rm C}\le T<0\, ^{\circ } {\rm C}` and the coefficients for water are valid for -:math:`0\, ^{\circ } {\rm C}\le T\le 100\, ^{\circ } {\rm C}` (Table 5.2 -and 5.3). The saturated water vapor specific humidity -:math:`q_{sat}^{T}` and its derivative -:math:`\frac{dq_{sat}^{T} }{dT}` are +:math:`0\, ^{\circ } {\rm C}\le T\le 100\, ^{\circ } {\rm C}` +(:numref:`Table Coefficients for saturation vapor pressure` and +:numref:`Table Coefficients for derivative of esat`). +The saturated water vapor specific humidity :math:`q_{sat}^{T}` and its derivative +:math:`\frac{dq_{sat}^{T} }{dT}` are .. math:: :label: 5.157) @@ -1717,51 +1728,55 @@ and 5.3). The saturated water vapor specific humidity \frac{dq_{sat}^{T} }{dT} =\frac{0.622P_{atm} }{\left(P_{atm} -0.378e_{sat}^{T} \right)^{2} } \frac{de_{sat}^{T} }{dT} . -Table 5.2. Coefficients for :math:`e_{sat}^{T}` - -+------------------+------------------------------------------+----------------------------------------+ -| | water | ice | -+==================+==========================================+========================================+ -| :math:`a_{0}` | 6.11213476 | 6.11123516 | -+------------------+------------------------------------------+----------------------------------------+ -| :math:`a_{1}` | 4.44007856 :math:`\times 10^{-1}` | 5.03109514\ :math:`\times 10^{-1}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{2}` | 1.43064234 :math:`\times 10^{-2}` | 1.88369801\ :math:`\times 10^{-2}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{3}` | 2.64461437 :math:`\times 10^{-4}` | 4.20547422\ :math:`\times 10^{-4}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{4}` | 3.05903558 :math:`\times 10^{-6}` | 6.14396778\ :math:`\times 10^{-6}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{5}` | 1.96237241 :math:`\times 10^{-8}` | 6.02780717\ :math:`\times 10^{-8}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{6}` | 8.92344772 :math:`\times 10^{-11}` | 3.87940929\ :math:`\times 10^{-10}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{7}` | -3.73208410 :math:`\times 10^{-13}` | 1.49436277\ :math:`\times 10^{-12}` | -+------------------+-------------------------------------------+---------------------------------------+ -| :math:`a_{8}` | 2.09339997 :math:`\times 10^{-16}` | 2.62655803\ :math:`\times 10^{-15}` | -+------------------+------------------------------------------+----------------------------------------+ - -Table 5.3. Coefficients for :math:`\frac{de_{sat}^{T} }{dT}` - -+------------------+----------------------------------------+----------------------------------------+ -| | water | ice | -+==================+========================================+========================================+ -| :math:`b_{0}` | 4.44017302\ :math:`\times 10^{-1}` | 5.03277922\ :math:`\times 10^{-1}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{1}` | 2.86064092\ :math:`\times 10^{-2}` | 3.77289173\ :math:`\times 10^{-2}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{2}` | 7.94683137\ :math:`\times 10^{-4}` | 1.26801703\ :math:`\times 10^{-3}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{3}` | 1.21211669\ :math:`\times 10^{-5}` | 2.49468427\ :math:`\times 10^{-5}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{4}` | 1.03354611\ :math:`\times 10^{-7}` | 3.13703411\ :math:`\times 10^{-7}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{5}` | 4.04125005\ :math:`\times 10^{-10}` | 2.57180651\ :math:`\times 10^{-9}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{6}` | -7.88037859 :math:`\times 10^{-13}` | 1.33268878\ :math:`\times 10^{-11}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{7}` | -1.14596802 :math:`\times 10^{-14}` | 3.94116744\ :math:`\times 10^{-14}` | -+------------------+----------------------------------------+----------------------------------------+ -| :math:`b_{8}` | 3.81294516\ :math:`\times 10^{-17}` | 4.98070196\ :math:`\times 10^{-17}` | -+------------------+----------------------------------------+----------------------------------------+ +.. _Table Coefficients for saturation vapor pressure: + +.. table:: Coefficients for :math:`e_{sat}^{T}` + + +------------------+------------------------------------------+----------------------------------------+ + | | water | ice | + +==================+==========================================+========================================+ + | :math:`a_{0}` | 6.11213476 | 6.11123516 | + +------------------+------------------------------------------+----------------------------------------+ + | :math:`a_{1}` | 4.44007856 :math:`\times 10^{-1}` | 5.03109514\ :math:`\times 10^{-1}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{2}` | 1.43064234 :math:`\times 10^{-2}` | 1.88369801\ :math:`\times 10^{-2}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{3}` | 2.64461437 :math:`\times 10^{-4}` | 4.20547422\ :math:`\times 10^{-4}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{4}` | 3.05903558 :math:`\times 10^{-6}` | 6.14396778\ :math:`\times 10^{-6}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{5}` | 1.96237241 :math:`\times 10^{-8}` | 6.02780717\ :math:`\times 10^{-8}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{6}` | 8.92344772 :math:`\times 10^{-11}` | 3.87940929\ :math:`\times 10^{-10}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{7}` | -3.73208410 :math:`\times 10^{-13}` | 1.49436277\ :math:`\times 10^{-12}` | + +------------------+-------------------------------------------+---------------------------------------+ + | :math:`a_{8}` | 2.09339997 :math:`\times 10^{-16}` | 2.62655803\ :math:`\times 10^{-15}` | + +------------------+------------------------------------------+----------------------------------------+ + +.. _Table Coefficients for derivative of esat: + +.. table:: Coefficients for :math:`\frac{de_{sat}^{T} }{dT}` + + +------------------+----------------------------------------+----------------------------------------+ + | | water | ice | + +==================+========================================+========================================+ + | :math:`b_{0}` | 4.44017302\ :math:`\times 10^{-1}` | 5.03277922\ :math:`\times 10^{-1}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{1}` | 2.86064092\ :math:`\times 10^{-2}` | 3.77289173\ :math:`\times 10^{-2}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{2}` | 7.94683137\ :math:`\times 10^{-4}` | 1.26801703\ :math:`\times 10^{-3}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{3}` | 1.21211669\ :math:`\times 10^{-5}` | 2.49468427\ :math:`\times 10^{-5}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{4}` | 1.03354611\ :math:`\times 10^{-7}` | 3.13703411\ :math:`\times 10^{-7}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{5}` | 4.04125005\ :math:`\times 10^{-10}` | 2.57180651\ :math:`\times 10^{-9}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{6}` | -7.88037859 :math:`\times 10^{-13}` | 1.33268878\ :math:`\times 10^{-11}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{7}` | -1.14596802 :math:`\times 10^{-14}` | 3.94116744\ :math:`\times 10^{-14}` | + +------------------+----------------------------------------+----------------------------------------+ + | :math:`b_{8}` | 3.81294516\ :math:`\times 10^{-17}` | 4.98070196\ :math:`\times 10^{-17}` | + +------------------+----------------------------------------+----------------------------------------+ diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 205a14c0e6..f850a383b4 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -11,7 +11,7 @@ changes in canopy water :math:`\Delta W_{can}` , surface water :math:`\Delta W_{sfc}` , snow water :math:`\Delta W_{sno}` , soil water :math:`\Delta w_{liq,\, i}` , and soil ice :math:`\Delta w_{ice,\, i}` , and water in the unconfined aquifer :math:`\Delta W_{a}` (all in kg -m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (Figure 7.1). +m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Hydrologic processes figure`). The total water balance of the system is @@ -22,22 +22,24 @@ The total water balance of the system is where :math:`q_{rain}` is the liquid part of precipitation, :math:`q_{sno}` is the solid part of precipitation, :math:`E_{v}` is -ET from vegetation (Chapter 5), :math:`E_{g}` is ground evaporation -(Chapter 5), :math:`q_{over}` is surface runoff (section 7.3), -:math:`q_{h2osfc}` is runoff from surface water storage (section 7.3), +ET from vegetation (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`E_{g}` is ground evaporation +(Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`q_{over}` is surface runoff (section :numref:`Surface Runoff`), +:math:`q_{h2osfc}` is runoff from surface water storage (section :numref:`Surface Runoff`), :math:`q_{drai}` is sub-surface drainage (section 7.6), :math:`q_{rgwl}` and :math:`q_{snwcp,ice}` are liquid and solid runoff from glaciers, wetlands, and lakes, and runoff from other surface types -due to snow capping (section 7.7) (all in kg m\ :sup:`-2` +due to snow capping (section :numref:`Runoff from glaciers and snow-capped surfaces`) (all in kg m\ :sup:`-2` s\ :sup:`-1`), :math:`N_{levsoi}` is the number of soil layers (note that hydrology calculations are only done over soil layers 1 to :math:`N_{levsoi}` ; ground levels :math:`N_{levsoi} +1`\ to -:math:`N_{levgrnd}` are currently hydrologically inactive; Lawrence et -al. 2008) and :math:`\Delta t` is the time step (s). +:math:`N_{levgrnd}` are currently hydrologically inactive; :ref:`(Lawrence et +al. 2008) ` and :math:`\Delta t` is the time step (s). -Figure 7.1. Hydrologic processes represented in CLM. +.. _Hydrologic processes figure: -.. image:: image1.png +.. Figure:: image1.png + + Hydrologic processes represented in CLM. .. _Canopy Water: @@ -57,7 +59,7 @@ liquid and solid phases where :math:`L` and :math:`S` are the exposed leaf and stem area index, respectively (section 2.1.4), and :math:`\alpha =0.25` scales -interception from point to grid cell (Lawrence et al. 2007). Throughfall +interception from point to grid cell (:ref:`Lawrence et al. 2007 `). Throughfall (kg m\ :sup:`-2` s\ :sup:`-1`), however, is divided into liquid and solid phases reaching the ground (soil or snow surface) as @@ -101,8 +103,8 @@ amount of water the canopy can hold W_{can,\, \max } =p\left(L+S\right). The maximum storage of solid water is assumed to be the same as that of -liquid water, :math:`p=0.1` kg m\ :sup:`-2` (Dickinson et al. -1993). The canopy water is updated as +liquid water, :math:`p=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. +1993 `). The canopy water is updated as .. math:: :label: 7.9) @@ -110,7 +112,7 @@ liquid water, :math:`p=0.1` kg m\ :sup:`-2` (Dickinson et al. W_{can}^{n+1} =W_{can}^{n} +q_{intr} \Delta t-\left(q_{drip,\, liq} +q_{drip,\, ice} \right)\Delta t-E_{v}^{w} \Delta t\ge 0. where :math:`E_{v}^{w}` is the flux of water vapor from stem and leaf -surfaces (Chapter 5). The total rate of liquid and solid precipitation +surfaces (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`). The total rate of liquid and solid precipitation reaching the ground is then .. math:: @@ -125,13 +127,15 @@ reaching the ground is then Solid precipitation reaching the soil or snow surface, :math:`q_{grnd,\, ice} \Delta t`, is added immediately to the snow pack -(section 7.2). The liquid part, :math:`q_{grnd,\, liq} \Delta t` is -added after surface fluxes (Chapter 5) and snow/soil temperatures -(Chapter 6) have been determined. +(Chapter :numref:`rst_Snow Hydrology`). The liquid part, +:math:`q_{grnd,\, liq} \Delta t` is added after surface fluxes +(Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) +and snow/soil temperatures (Chapter :numref:`rst_Soil and Snow Temperatures`) +have been determined. The wetted fraction of the canopy (stems plus leaves), which is required -for the surface albedo (section 3.1) and surface flux (Chapter 5) -calculations is (Dickinson et al. 1993) +for the surface albedo (section :numref:`Canopy Radiative Transfer`) and surface flux (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) +calculations is (:ref:`Dickinson et al.1993 `) .. math:: :label: 7.12) @@ -161,8 +165,9 @@ infiltration into the soil. Surface Runoff ^^^^^^^^^^^^^^^^^^^^ -The simple TOPMODEL-based (Beven and Kirkby 1979) runoff model (SIMTOP) -described by Niu et al. (2005) is implemented to parameterize runoff. A +The simple TOPMODEL-based (:ref:`Beven and Kirkby 1979 `) +runoff model (SIMTOP) described by :ref:`Niu et al. (2005) ` +is implemented to parameterize runoff. A key concept underlying this approach is that of fractional saturated area :math:`f_{sat}` , which is determined by the topographic characteristics and soil moisture state of a grid cell. The saturated @@ -192,17 +197,18 @@ cell whose topographic index is larger than or equal to the grid cell mean topographic index. It should be calculated explicitly from the CDF at each grid cell at the resolution that the model is run. However, because this is a computationally intensive task for global -applications, :math:`f_{\max }` is calculated once at -0.125\ :sup:`o` resolution using the 1-km compound topographic -indices (CTIs) based on the HYDRO1K dataset (Verdin and Greenlee 1996) -from USGS following the algorithm in Niu et al. (2005) and then -area-averaged to the desired model resolution (section 2.2.3). Pixels +applications, :math:`f_{\max }` is calculated once at 0.125\ :sup:`o` +resolution using the 1-km compound topographic indices (CTIs) based on +the HYDRO1K dataset (:ref:`Verdin and Greenlee 1996 `) +from USGS following the algorithm in :ref:`Niu et al. (2005) ` +and then area-averaged to the desired model resolution (section +:numref:`Surface Data`). Pixels with CTIs exceeding the 95 percentile threshold in each 0.125\ :sup:`o` grid cell are excluded from the calculation to eliminate biased estimation of statistics due to large CTI values at pixels on stream networks. For grid cells over regions without CTIs such as Australia, the global mean :math:`f_{\max }` is used to fill the -gaps. See Li et al. (2013b) for additional details. The decay factor +gaps. See :ref:`Li et al. (2013b) ` for additional details. The decay factor :math:`f_{over}` for global simulations was determined through sensitivity analysis and comparison with observed runoff to be 0.5 m\ :sup:`-1`. @@ -216,7 +222,8 @@ A surface water store has been added to the model to represent wetlands and small, sub-grid scale water bodies. As a result, the wetland land unit has been removed. The state variables for surface water are the mass of water :math:`W_{sfc}` (kg m\ :sup:`-2`) and temperature -:math:`T_{h2osfc}` (Chapter 6). Surface water storage and outflow are +:math:`T_{h2osfc}` (Chapter :numref:`rst_Soil and Snow Temperatures`). +Surface water storage and outflow are functions of fine spatial scale elevation variations called microtopography. The microtopography is assumed to be distributed normally around the grid cell mean elevation. Given the standard @@ -364,9 +371,10 @@ Soil Water Soil water is predicted from a multi-layer model, in which the vertical soil moisture transport is governed by infiltration, surface and sub-surface runoff, gradient diffusion, gravity, canopy transpiration -through root extraction, and interactions with groundwater (Figure 7.1). -The following derivation generally follows that of Z.-L. Yang (1998, -unpublished manuscript) with modifications by Zeng and Decker (2009). +through root extraction, and interactions with groundwater +(:numref:`Hydrologic processes figure`). +The following derivation generally follows that of :ref:`Z.-L. Yang (1998, +unpublished manuscript) ` with modifications by Zeng and Decker (2009). For one-dimensional vertical water flow in soils, the conservation of mass is stated as @@ -482,11 +490,13 @@ vary with volumetric soil water :math:`\theta _{i}` and soil texture. As with the soil thermal properties (section 6.3) the hydraulic properties of the soil are assumed to be a weighted combination of the mineral properties, which are determined according to sand and clay -contents based on work by Clapp and Hornberger (1978) and Cosby et al. -(1984), and organic properties of the soil (Lawrence and Slater 2008). +contents based on work by :ref:`Clapp and Hornberger (1978) +` and :ref:`Cosby et al. (1984) `, +and organic properties of the soil +(:ref:`Lawrence and Slater 2008 `). The hydraulic conductivity is defined at the depth of the interface of -two adjacent layers :math:`z_{h,\, i}` (Figure 7.3) and is a function +two adjacent layers :math:`z_{h,\, i}` (:numref:`Water flux schematic figure`) and is a function of the saturated hydraulic conductivity :math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil moisture of the two layers :math:`\theta _{i}` and @@ -500,8 +510,8 @@ moisture of the two layers :math:`\theta _{i}` and The ice impedance factor is a function of ice content, and is meant to quantify the increased tortuosity of the water flow when part of the -pore space is filled with ice. Swenson et al. (2012) used a power law -form :math:`\Theta _{ice} =10^{-\Omega F_{ice} }` where +pore space is filled with ice. :ref:`Swenson et al. (2012) ` +used a power law form :math:`\Theta _{ice} =10^{-\Omega F_{ice} }` where :math:`\Omega =6`\ and :math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the ice-filled fraction of the pore space. @@ -517,7 +527,8 @@ organic components. The water content at saturation (i.e. porosity) is \theta _{sat,i} =(1-f_{om,i} )\theta _{sat,\min ,i} +f_{om,i} \theta _{sat,om} where :math:`f_{om,i}` is the soil organic matter fraction, -:math:`\theta _{sat,om} =0.9` (Farouki 1981; Letts et al. 2000) is the +:math:`\theta _{sat,om} =0.9` (:ref:`Farouki 1981 `; +:ref:`Letts et al. 2000 `) is the porosity of organic matter and the porosity of the mineral soil :math:`\theta _{sat,\min ,i}` is @@ -533,7 +544,7 @@ The exponent “:math:`B`†is B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} -where :math:`B_{om} =2.7`\ (Letts et al. 2000) and +where :math:`B_{om} =2.7`\ (:ref:`Letts et al. 2000 `) and .. math:: :label: 7.93) @@ -541,7 +552,7 @@ where :math:`B_{om} =2.7`\ (Letts et al. 2000) and B_{\min ,i} =2.91+0.159(\% clay)_{i} . The soil matric potential (mm) is defined at the node depth -:math:`z_{i}` of each layer :math:`i` (Figure 7.3) +:math:`z_{i}` of each layer :math:`i` (:numref:`Water flux schematic figure`) .. math:: :label: ZEqnNum316201 @@ -574,8 +585,8 @@ by the organic soil properties even for values of :math:`f_{om}` as low as 1 %. To better represent the influence of organic soil material on the grid cell average saturated hydraulic conductivity, the soil organic matter fraction is further subdivided into “connected†and “unconnected†-fractions using a result from percolation theory (Stauffer and Aharony -1994, Berkowitz and Balberg 1992). Assuming that the organic and mineral +fractions using a result from percolation theory (:ref:`Stauffer and Aharony +1994 `, :ref:`Berkowitz and Balberg 1992 `). Assuming that the organic and mineral fractions are randomly distributed throughout a soil layer, percolation theory predicts that above a threshold value :math:`f_{om} =f_{threshold}` , connected flow pathways consisting of @@ -601,7 +612,7 @@ pass through the mineral and organic components in series k_{sat,\, uncon} =f_{uncon} \left(\frac{\left(1-f_{om} \right)}{k_{sat,\, \min } } +\frac{\left(f_{om} -f_{perc} \right)}{k_{sat,\, om} } \right)^{-1} . where saturated hydraulic conductivity for mineral soil depends on soil -texture (Cosby et al. 1984) as +texture (:ref:`Cosby et al. (1984) `) as .. math:: :label: 7.99) @@ -621,7 +632,7 @@ as Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ -With reference to Figure 7.3, the equation for conservation of mass +With reference to :numref:`Water flux schematic figure`, the equation for conservation of mass (equation ) can be integrated over each layer as .. math:: @@ -657,7 +668,7 @@ is the change in volumetric soil liquid water of layer :math:`i` in time :math:`i` (mm). The water removed by transpiration in each layer :math:`e_{i}` is a -function of the total transpiration :math:`E_{v}^{t}` (Chapter 5) and +function of the total transpiration :math:`E_{v}^{t}` (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) and the effective root fraction :math:`r_{e,\, i}` .. math:: @@ -665,8 +676,11 @@ the effective root fraction :math:`r_{e,\, i}` e_{i} =r_{e,\, i} E_{v}^{t} . -Figure 7.3. Schematic diagram of numerical scheme used to solve for soil -water fluxes. +.. _Water flux schematic figure: + +.. Figure:: image2.png + + Schematic diagram of numerical scheme used to solve for soil water fluxes. Shown are three soil layers, :math:`i-1`, :math:`i`, and :math:`i+1`. The soil matric potential :math:`\psi` and volumetric soil water @@ -678,7 +692,6 @@ the interface of two layers :math:`z_{h}` . The layer thickness is term :math:`e` (ET loss) is defined as positive for flow out of the layer. -.. image:: image2.png Note that because more than one plant functional type (PFT) may share a soil column, the transpiration :math:`E_{v}^{t}` is a weighted sum of @@ -711,10 +724,10 @@ fraction for the :math:`j^{th}` PFT \begin{array}{l} {\left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } \qquad \left(\beta _{t} \right)_{j} >0} \\ {\left(r_{e,\, i} \right)_{j} =0\qquad \left(\beta _{t} \right)_{j} =0} \end{array} and :math:`\left(r_{i} \right)_{j}` is the fraction of roots in layer -:math:`i` (Chapter 8), :math:`\left(w_{i} \right)_{j}` is a soil -dryness or plant wilting factor for layer :math:`i` (Chapter 8), and -:math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total -soil column for the :math:`j^{th}` PFT (Chapter 8). +:math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), +:math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor +for layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total +soil column for the :math:`j^{th}` PFT (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). The soil water fluxes in equation , which are a function of :math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of @@ -922,7 +935,7 @@ Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' For the top soil layer (:math:`i=1`), the boundary condition is the -infiltration rate (section 7.3), +infiltration rate (section :numref:`Surface Runoff`), :math:`q_{i-1}^{n+1} =-q_{infl}^{n+1}` , and the water balance equation is @@ -1127,7 +1140,7 @@ Frozen Soils and Perched Water Table ---------------------------------------- When soils freeze, the power-law form of the ice impedance factor -(section 7.4.1) can greatly decrease the hydraulic conductivity of the +(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic conductivity of the soil, leading to nearly impermeable soil layers. When unfrozen soil layers are present above relatively ice-rich frozen layers, the possibility exists for perched saturated zones. Lateral drainage from @@ -1206,12 +1219,12 @@ the ice content of the soil layers interacting with the water table where :math:`\Omega =6`\ is an adjustable parameter, :math:`jwt` is the index of the layer directly above the water table, :math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the -ice-filled fraction of the pore space of soil layer :math:`i` (kg -m\ :sup:`-2`), and :math:`\Delta z_{i}` is the layer thickness -(mm). This expression is functionally the same as that used to determine -the ice impedance factor in section 7.4. In equation , the decay factor -:math:`f_{drai} =2.5` m\ :sup:`-1` and the maximum drainage when -the water table depth is at the surface +ice-filled fraction of the pore space of soil layer :math:`i` (kg +m\ :sup:`-2`), and :math:`\Delta z_{i}` is the layer thickness (mm). This +expression is functionally the same as that used to determine the ice +impedance factor in section :numref:`Hydraulic Properties`. In equation , +the decay factor :math:`f_{drai} =2.5` m\ :sup:`-1` and the maximum drainage +when the water table depth is at the surface :math:`q_{drai,\, \max } =10\sin (\beta )` kg m\ :sup:`-2` s\ :sup:`-1` , where :math:`\beta` is the mean grid cell topographic slope in radians, were determined for global simulations @@ -1219,8 +1232,7 @@ through sensitivity analysis and comparison with observed runoff. Determination of water table depth :math:`z_{\nabla }` is based on work by Niu et al. (2007). In this approach, a groundwater component is added -in the form of an unconfined aquifer lying below the soil column (Figure -7.1). The groundwater solution is dependent on whether the water table +in the form of an unconfined aquifer lying below the soil column (:numref:`Hydrologic processes figure`). The groundwater solution is dependent on whether the water table is within or below the soil column. The water stored in the unconfined aquifer :math:`W_{a}` has a prescribed maximum value (5000 mm). When the water table is within the soil column, :math:`W_{a}` is constant @@ -1380,136 +1392,7 @@ at the beginning and ending of the time step defined as Currently, glaciers are non-vegetated and :math:`E_{v} =W_{can} =0`. The contribution of lake runoff to :math:`q_{rgwl}` is described in -section 9.6.3. The runoff term :math:`q_{rgwl}` may be negative for -glaciers and lakes, which reduces the total amount of runoff available -to the RTM. - -.. _The Variable Infiltration Capacity parameterizations as a hydrologic option: - -The Variable Infiltration Capacity parameterizations as a hydrologic option -------------------------------------------------------------------------------- - -The hydrologic parameterizations from the Variable Infiltration Capacity -(VIC) land surface model (Liang et al. 1994) have been implemented as a -hydrologic option. VIC includes two different time scales of runoff -generation. To capture such dynamics, the soil column in the original -VIC model -(http://www.hydro.washington.edu/Lettenmaier/Models/VIC/Overview/ModelOverview.shtml) -is typically divided into three layers with variable soil depths. The -upper two layers are designed to represent the dynamic responses of the -soil to rainfall events for surface runoff generation, and the lower -layer is used to characterize the seasonal soil moisture behavior and -subsurface runoff generation. The implementation of the VIC -parameterizations are as described in Li et al. (2011) except where -updated for consistency with modifications to CLM hydrology in CLM4.5. -Note that unless explicitly mentioned in this section, any descriptions -from sections 7.1-7.7 are intact and remain valid when the VIC hydrology -option is turned on. - -Three VIC soil layers are defined by aggregating multiple layers in the -CLM soil column with thicknesses of :math:`\sum^3_{i=1}{\Delta z_i}`, -:math:`\sum^6_{i=4}{\Delta z_i}`, -:math:`\sum^{N_{levsoi}}_{i=7}{\Delta z_i}`, respectively. At each time -step, the soil moisture profile is determined following the algorithms -detailed in section 7.4, and aggregated to the three VIC layers for -runoff generation calculations. The surface runoff generated by the -saturation excess runoff mechanism, q\ :sub:`over`, is -calculated using equation , but with the fractional saturated area -defined as - -.. math:: - :label: ZEqnNum627546 - - f_{sat} =1-\left(1-{w_{top} \mathord{\left/ {\vphantom {w_{top} w_{m,\, top} }} \right. \kern-\nulldelimiterspace} w_{m,\, top} } \right)^{{1\mathord{\left/ {\vphantom {1 \left(1+b_{inf} \right)}} \right. \kern-\nulldelimiterspace} \left(1+b_{inf} \right)} } - -where :math:`w_{top}` and :math:`w_{m,top}` are calculated as -:math:`\sum^6_{i=1}{{\theta }_i\Delta z_i}` and -:math:`\sum^6_{i=1}{{\theta }_{s,i}\Delta z_i}`, respectively, and -represent the soil moisture (kg m\ :sup:`-2`) and maximum soil -moisture (kg m\ :sup:`-2`) in the top two VIC layers combined. - -In equation , it is hypothesized that the spatial heterogeneity of soil -moisture holding capacity in the top VIC layers can be represented by a -soil moisture holding capacity curve as defined in equation , in which -:math:`b_{inf}` is a parameter that controls the shape of the curve. -That is, if one assumes that a grid cell (or soil column in this case) -is composed of many pixels (or points) with varying soil moisture -capacity, this variation across the grid cell can be represented -conceptually as - -.. math:: - :label: ZEqnNum929519 - - i=i_m\left(1-{\left(1-A\right)}^{1/b_{inf}}\right) - -where :math:`i` and :math:`i_{m}` are the point and maximum point soil -moisture holding capacities (kg m\ :sup:`-2`), respectively; -:math:`A` is the fraction of a grid cell for which the soil moisture -holding capacity is less than or equal to :math:`i`; and -:math:`i_m=w_{m,top}\left(1+b_{inf}\right)`. When :math:`A` is equal to -:math:`f_{sat}`, the corresponding point soil moisture holding capacity -is denoted as :math:`i_0`. The maximum soil infiltration capacity (kg -m\ :sup:`-2` s\ :sup:`-1`) in equation becomes - -.. math:: - :label: ZEqnNum202398 - - q_{inf,\, max} =\left\{\begin{array}{l} {\left(1-f_{sat} \right)\theta _{ice,\, top} \left(\frac{w_{m,\, top} -w_{top} }{\Delta t} \right)\qquad i_{o} +q_{in,\, soil} \Delta t\ge i_{m} } \\ {\left(1-f_{sat} \right)\frac{\theta _{ice,\, top} }{\Delta t} \left\{\begin{array}{l} {\left(w_{m,\, top} -w_{top} \right)-w_{m,\, top} \times } \\ {\left[1-\max \left(1,\, \frac{\left(i_{o} +q_{in,\, soil} \Delta t\right)}{i_{m} } \right)^{1+b_{inf} } \right]} \end{array}\right\}\qquad i_{o} +q_{in,\, soil} \Delta t`. +It includes extensive modifications to the lake code of +:numref:`Zeng et al. (2002) ` used in CLM versions 2 through 4, which utilized concepts from the lake models of -Bonan (1996), Henderson-Sellers (1985, 1986), Hostetler and Bartlein -(1990) and the coupled lake-atmosphere model of Hostetler et al. (1993, -1994). Lakes have spatially variable depth prescribed in the surface -data (section 9.2); the surface data optionally includes lake optical +:numref:`Bonan (1996) `, +:numref:`Henderson-Sellers (1985) `, +:numref:`Henderson-Sellers (1986) `, +:numref:`Hostetler and Bartlein (1990) `, +and the coupled lake-atmosphere model of :numref:`Hostetler et al. (1993) `, :numref:`Hostetler et al. (1993) `. +Lakes have spatially variable depth prescribed in the surface data (section +:numref:`External Data Lake`); the surface data optionally includes lake optical extinction coeffient and horizontal fetch, currently only used for site simulations. Lake physics includes freezing and thawing in the lake body, resolved snow layers, and “soil†and bedrock layers below the lake @@ -30,6 +34,8 @@ ground heat flux *G* as a top boundary condition. Snow, soil, and bedrock models generally follow the formulations for non-vegetated surfaces (Chapter 6), with modifications described below. +.. _Vertical Discretization Lake: + Vertical Discretization --------------------------- @@ -62,6 +68,8 @@ follow the scheme used over non-vegetated surfaces (Chapter 6), with modifications to the snow layer thickness rules to keep snow layers at least as thick as *s*\ :sub:`min` (section 9.6.5). +.. _External Data Lake: + External Data ----------------- @@ -73,6 +81,8 @@ km\ :sup:`-2`. As in Subin et al. (2012a, b), the Kourzeneva depth in each grid cell, based on interpolated compilations of geographic information. +.. _Surface Albedo Lake: + Surface Albedo ------------------ @@ -106,9 +116,13 @@ calculated as over non-vegetated surfaces (Chapter 3). These two reflectances are combined to obtain the snow-fraction-weighted albedo as in over non-vegetated surfaces (Chapter 3). +.. _Surface Fluxes and Surface Temperature Lake: + Surface Fluxes and Surface Temperature ------------------------------------------ +.. _Overview of Changes from CLM4: + Overview of Changes from CLM4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -137,6 +151,8 @@ Overview of Changes from CLM4 :math:`{T}_{g}` to maintain a stable density profile at the lake surface eq. . +.. _Surface Properties Lake: + Surface Properties ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -209,6 +225,8 @@ where *A* and *B* define the fetch- and depth-limitation, respectively; :math:`\varepsilon =1` , :math:`f_{c} =100` , and *u* (m s\ :sup:`-1`) is the atmospheric forcing wind. +.. _Surface Flux Solution Lake: + Surface Flux Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -475,9 +493,13 @@ temperature solution (section 9.5.3). An energy balance check is included at each timestep to insure that eq. XXX is obeyed to within 0.1 W m\ :sup:`-2`. +.. _Lake Temperature: + Lake Temperature -------------------- +.. _Introduction Lake: + Introduction ^^^^^^^^^^^^^^^^^^ @@ -525,6 +547,8 @@ restricted to occur at :math:`T_{j} =T_{f}` \ in the snow-lake-soil system, allowing eq. to be precisely enforced and justifying the exclusion of :math:`c_{v,j}` from the time derivative in eq. . +.. _Overview of Changes from CLM4 2: + Overview of Changes from CLM4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -546,6 +570,8 @@ arbitrary depth, except for a depth-dependent enhanced mixing (section diffusivity (specifically, the Brunt-Väisälä frequency term; eq. ) was corrected. +.. _Boundary Conditions Lake: + Boundary Conditions ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -565,6 +591,8 @@ calculation of eddy diffusivity: where :math:`u_{*}` \ is the friction velocity calculated in section 9.4.3 and *k* is the von Karman constant (Table 2.6). +.. _Eddy Diffusivity and Thermal Conductivities: + Eddy Diffusivity and Thermal Conductivities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -614,7 +642,7 @@ s\ :sup:`-1`) (eq. ) is used to evaluate :math:`w^{*}` and :math:`k^{*}` rather than the 10-m wind used by Henderson-Sellers (1985). -The CityplaceRichardson number is +The Richardson number is .. math:: :label: 12.32) @@ -692,6 +720,8 @@ vegetated land units (Chapter 6), except for the adjustment of thermal conductivity for frost heave or excess ice (Subin et al., 2012a, Supporting Information). +.. _Radiation Penetration: + Radiation Penetration ^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -741,6 +771,8 @@ al. 2012a): \eta =1.1925d^{-0.424} . +.. _Heat Capacities Lake: + Heat Capacities ^^^^^^^^^^^^^^^^^^^^^ @@ -761,6 +793,8 @@ bedrock layer (J m\ :sup:`-2`) is determined as for vegetated land units (Chapter 6), as the sum of the heat capacities for the water, ice, and mineral constituents. +.. _Crank-Nicholson Solution Lake: + Crank-Nicholson Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -819,6 +853,8 @@ section 9.4.3 (the factor of 2 merely cancels out the Crank-Nicholson F_{i} =\lambda _{i} \frac{T_{i} ^{n} -T_{i+1}^{n} }{z_{n+1} -z_{n} } . +.. _Phase Change Lake: + Phase Change ^^^^^^^^^^^^^^^^^^ @@ -896,6 +932,8 @@ is exhausted and the top lake layer is set to freezing. The snow thickness is adjusted downwards in proportion to the amount of melt, maintaining constant density. +.. _Convection Lake: + Convection ^^^^^^^^^^^^^^^^ @@ -983,6 +1021,8 @@ to *i* + 1, the ice fraction and temperature are set as follows, where #. Otherwise, :math:`I_{j} =0` and :math:`T_{j} =T_{unfr}` . +.. _Energy Conservation Lake: + Energy Conservation ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1012,9 +1052,13 @@ If :math:`\left|E_{soi} \right|<0.1`\ W m\ :sup:`-2`, it is subtracted from the sensible heat flux and added to *G*. Otherwise, the model is aborted. +.. _Lake Hydrology: + Lake Hydrology ------------------ +.. _Overview Lake Hydrology: + Overview ^^^^^^^^^^^^^^ @@ -1042,6 +1086,8 @@ explicit time-stepping integration of the surface flux solution, resolved snow layers must be a minimum of :math:`s_{\min }` = 4 cm thick rather than 1 cm when the default timestep of 1800 s is used. +.. _Water Balance Lake: + Water Balance ^^^^^^^^^^^^^^^^^^^ @@ -1063,6 +1109,8 @@ ground evaporation (section 9.4.3), and :math:`n_{levsoi}` is the number of hydrologically active soil layers (as opposed to dry bedrock layers). +.. _Precipitation, Evaporation, and Runoff Lake: + Precipitation, Evaporation, and Runoff ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1120,6 +1168,8 @@ proportion as the snow ice (i.e., maintaining the same density), unless there was no snow before adding the frost, in which case the density is assumed to be 250 kg m\ :sup:`-3`. +.. _Soil Hydrology Lake: + Soil Hydrology ^^^^^^^^^^^^^^^^^^^^ @@ -1153,6 +1203,8 @@ This allows excess ice to be initialized (and begin to be lost only after the pore ice is melted, which is realistic if the excess ice is found in heterogeneous chunks) but irreversibly lost when melt occurs. +.. _Modifications to Snow Layer Logic Lake: + Modifications to Snow Layer Logic ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst index 7219e7a293..e4e2db66fa 100644 --- a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst +++ b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst @@ -4,24 +4,26 @@ Offline Mode ================ In offline mode (uncoupled to an atmospheric model), the atmospheric -forcing required by CLM (Table 2.3) is supplied by observed datasets. -The standard forcing provided with the model is a 110-year (1901-2010) -dataset (CRUNCEP; Viovy 2011) that is a combination of two existing -datasets; the CRU TS3.2 0.5\ :math:`{}^\circ` X 0.5\ :math:`{}^\circ` -monthly data covering the period 1901 to 2002 (Mitchell and Jones 2005) +forcing required by CLM (:numref:`Table Atmospheric input to land model`) +is supplied by observed datasets. The standard forcing provided with the +model is a 110-year (1901-2010) dataset (CRUNCEP; :ref:`Viovy 2011 `) +that is a combination of two existing datasets; the CRU TS3.2 0.5\ +:math:`{}^\circ` X 0.5\ :math:`{}^\circ` monthly data covering the period +1901 to 2002 (:ref:`Mitchell and Jones 2005 `) and the NCEP reanalysis 2.5\ :math:`{}^\circ` X 2.5\ :math:`{}^\circ` 6-hourly data covering the period 1948 to 2010. The CRUNCEP dataset has been used to force CLM for studies of vegetation growth, -evapotranspiration, and gross primary production (Mao et al. 2012, Mao -et al. 2013, Shi et al. 2013) and for the TRENDY (trends in net -land-atmosphere carbon exchange over the period 1980-2010) project (Piao -et al. 2012). Version 4 is used here (Viovy 2011). Alternative forcing -datasets can also be used (e.g., the Qian et al. (2006) dataset used for +evapotranspiration, and gross primary production (:ref:`Mao et al. 2012 `, +:ref:`Mao et al. 2013 `, :ref:`Shi et al. 2013 `) +and for the TRENDY (trends in net land-atmosphere carbon exchange over the period +1980-2010) project (:ref:`Piao et al. 2012 `). Version 4 is used +here (:ref:`Viovy 2011 `). Alternative forcing datasets can also be used +(e.g., the :ref:`Qian et al. (2006) ` dataset used for previous versions of CLM is still available). Here, the CRUNCEP dataset, which does not include data over oceans, -lakes, and Antarctica is modified. This missing data is filled with Qian -et al. (2006) data from 1948 that is interpolated by the data atmosphere +lakes, and Antarctica is modified. This missing data is filled with +:ref:`Qian et al. (2006) ` data from 1948 that is interpolated by the data atmosphere model to the 0.5\ :math:`{}^\circ` CRUNCEP grid. This allows the model to be run over Antarctica and ensures data is available along coastlines regardless of model resolution. @@ -119,7 +121,7 @@ and :math:`b_{0} =0.29548,b_{1} =0.00504,b_{2} =-1.4957\times 10^{-5} ,b_{3} =1.4881\times 10^{-8}` are coefficients from polynomial fits to the placeCAM data. -The additional atmospheric forcing variables required by Table 2.3 are +The additional atmospheric forcing variables required by :numref:`Table Atmospheric input to land model` are derived as follows. The atmospheric reference height :math:`z'_{atm}` (m) is set to 30 m. The directional wind components are derived as :math:`u_{atm} =v_{atm} ={W_{atm} \mathord{\left/ {\vphantom {W_{atm} \sqrt{2} }} \right. \kern-\nulldelimiterspace} \sqrt{2} }` . @@ -141,8 +143,8 @@ where e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } -and :math:`\sigma` is the Stefan-Boltzmann constant (W -m\ :sup:`-2` K\ :math:`{}^{-4}`) (Table 2.6). The fraction of +and :math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ +:math:`{}^{-4}`) (:numref:`Table Physical constants`). The fraction of precipitation :math:`P` (mm s\ :sup:`-1`) falling as rain and/or snow is @@ -164,8 +166,9 @@ where f_{P} =0<0.5\left(T_{atm} -T_{f} \right)<1. The aerosol deposition rates :math:`D_{sp}` (14 rates as described in -Table 2.3) are provided by a time-varying, globally-gridded aerosol -deposition file developed by Lamarque et al. (2010). +:numref:`Table Atmospheric input to land model`) are provided by a +time-varying, globally-gridded aerosol deposition file developed by +:ref:`Lamarque et al. (2010) `. If the user wishes to provide atmospheric forcing data from another source, the data format outlined above will need to be followed with the @@ -183,7 +186,7 @@ from the water (:math:`T_{atm} >T_{f}` ) or ice (:math:`T_{atm} \le T_{f}` ) saturation vapor pressure :math:`e_{sat}^{T_{atm} }` as :math:`e_{atm} =\frac{RH}{100} e_{sat}^{T_{atm} }` where :math:`T_{f}` -is the freezing temperature of water (K) (Table 2.6), and +is the freezing temperature of water (K) (:numref:`Table Physical constants`), and :math:`P_{atm}` is the pressure at height :math:`z_{atm}` (Pa). The data atmosphere model will also accept a user-supplied dew point temperature :math:`T_{dew}` (K) and derive specific humidity @@ -195,7 +198,7 @@ temperature :math:`T_{dew}` (K) and derive specific humidity q_{atm} = \frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . Here, :math:`e_{sat}^{T}` , the saturation vapor pressure as a function -of temperature, is derived from Lowe’s (1977) polynomials. If not +of temperature, is derived from :ref:`Lowe’s (1977) ` polynomials. If not provided by the user, the atmospheric pressure :math:`P_{atm}` (Pa) is set equal to the standard atmospheric pressure :math:`P_{std} =101325` Pa, and surface pressure :math:`P_{srf}` (Pa) is set equal diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index 741801942d..28f43fce9a 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -9,6 +9,8 @@ where :math:`\vec{S}` is the net solar flux absorbed by the vegetation (“vâ€) and the ground (“gâ€) and :math:`\vec{L}` is the net longwave flux (positive toward the atmosphere) (W m\ :sup:`-2`). +.. _Solar Fluxes: + Solar Fluxes ---------------- @@ -143,6 +145,8 @@ fraction at depth :math:`x`, defined by :math:`f_{sun} =\exp \left(-Kx\right)`, to give fluxes per unit sunlit or shaded plant area at depth :math:`x`. +.. _Longwave Fluxes: + Longwave Fluxes ------------------- diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index b953d98b3d..4b81731fb0 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -3,127 +3,187 @@ References ============== +.. _Aberetal1990: + Aber, J.D., Melillo, J.M. and McClaugherty, C.A., 1990. Predicting long-term patterns of mass loss, nitrogen dynamics, and soil organic matter formation from initial fime litter chemistry in temperate forest ecosystems. Canadian Journal of Botany, 68: 2201-2208. +.. _Aberetal2003: + Aber, J.D., Goodale, C.L., Ollinger, S.V., Smith, M.-L., Magill, A.H., Martin, M.E., Hallett, R.A., and Stoddard, J.L. 2003. Is nitrogen deposition altering the nitrogen status of northeastern forests? BioScience 53:375-389. +.. _Allenetal2005: + Allen, C.B., Will, R.E., and Jacobson, M.A. 2005. Production efficiency and radiation use efficiency of four tree species receiving irrigation and fertilization. Forest Science 51:556-569. +.. _Anderson1976: + Anderson, E.A. 1976. A point energy and mass balance model of a snow cover. NOAA Technical Report NWS 19, Office of Hydrology, National Weather Service, Silver Spring, MD. +.. _Andréetal1986: + André, J.-C., Goutorbe, J.-P., and Perrier, A. 1986. HAPEX-MOBILHY: A hydrologic atmosphere experiment for the study of water budget and evaporation flux at the climatic scale. Bull. Amer. Meteor. Soc. 67:138-144. +.. _AndrénPaustian1987: + Andrén, O. and Paustian, K., 1987. Barley straw decomposition in the field: a comparison of models. Ecology 68:1190-1200. +.. _ArahStephen1998: + Arah, J.R.M. and Stephen, K.D., 1998. A model of the processes leading to methane emission from peatland. Atmos. Environ. 32:3257-3264. +.. _ArahVinten1995: + Arah, J. and Vinten, A., 1995. Simplified models of anoxia and denitrification in aggregated and simple-structured soils. European Journal of Soil Science 46:507-517. +.. _Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global + Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global Glacier Outlines Version: 1.0, Global Land Ice Measurements from Space, Boulder Colorado, USA. Digital Media. +.. _AroraBoer2005: + Arora, V.K. and Boer, G.J. 2005. Fire as an interactive component of dynamic vegetation models. J. Geophys. Res. 110:G02008. DOI:10.1029/2005JG000042. +.. _Arya2001: + Arya, S.P. 2001. Introduction to Meteorology. Academic Press, San Diego, CA. +.. _Asneretal1998: + Asner, G.P., Wessman, C.A., Schimel, D.S., and Archer, S. 1998. Variability in leaf and litter optical properties: implications for BRDF model inversions using AVHRR, MODIS, and MISR. Remote Sens. Environ. 63:243-257. +.. _AxelssonAxelsson1986: + Axelsson, E., and Axelsson, B. 1986. Changes in carbon allocation patterns in spruce and pine trees following irrigation and fertilization. Tree Phys. 2:189-204. +.. _Bairdetal2004: + Baird, A.J., Beckwith, C.W., Waldron, S. and Waddington, J.M., 2004. Ebullition of methane-containing gas bubbles from near-surface Sphagnum peat. Geophys. Res. Lett. 31. DOI:10.1029/2004GL021157. +.. _Baldocchietal2001: + Baldocchi, D., et al. 2001. FLUXNET: A new tool to study the temporal and spatial variability of ecosystem-scale carbon dioxide, water vapor, and energy flux densities. Bull. Amer. Meteor. Soc. 82:2415-2433. +.. _Barbottinetal2005: + Barbottin, A., Lecomte, C., Bouchard, C., and Jeuffroy, M.-H. 2005. Nitrogen remobilization during grain filling in wheat: Genotypic and environmental effects. Crop Sci. 45:1141-1150. +.. _Batjes2006: + Batjes, N.H., 2006. ISRIC-WISE derived soil properties on a 5 by 5 arc-minutes global grid. Report 2006/02 (available through : http://www.isric.org) +.. _Berger1978a: + Berger, A.L. 1978a. Long-term variations of daily insolation and quaternary climatic changes. J. Atmos. Sci. 35:2362-2367. +.. _Berger1978b: + Berger, A.L. 1978b. A simple algorithm to compute long-term variations of daily or monthly insolation. Contribution de l’Institut d’Astronomie et de Géophysique, Université Catholique de Louvain, Louvain-la-Neuve, No. 18. +.. _Bergeretal1993: + Berger, A., Loutre, M.-F., and Tricot, C. 1993. Insolation and Earth’s orbital periods. J. Geophys. Res. 98:10341-10362. +.. _BerkowitzBalberg1992: + Berkowitz, B., and Balberg, I. 1992. Percolation approach to the problem of hydraulic conductivity in porous media. Transport in Porous Media 9:275–286. +.. _BevenKirkby1979: + Beven, K.J., and Kirkby, M.J. 1979. A physically based variable contributing area model of basin hydrology. Hydrol. Sci. Bull. 24:43-69. Bohren, C. F., and Huffman, D. R. 1983. Absorption and scattering of light by small particles. John Wiley & Sons, New York, NY. +.. _Bonan1996: + Bonan, G.B. 1996. A land surface model (LSM version 1.0) for ecological, hydrological, and atmospheric studies: Technical description and user’s guide. NCAR Technical Note NCAR/TN-417+STR, National Center for Atmospheric Research, Boulder, CO, 150 pp. +.. _Bonan1998: + Bonan, G.B. 1998. The land surface climatology of the NCAR Land Surface Model coupled to the NCAR Community Climate Model. J. Climate 11:1307-1326. +.. _Bonan2002: + Bonan, G.B. 2002. Ecological Climatology: Concepts and Applications. Cambridge University Press. +.. _Bonanetal2002a: + Bonan, G.B., Oleson, K.W., Vertenstein, M., Levis, S., Zeng, X., Dai, Y., Dickinson, R.E., and Yang, Z.-L. 2002a. The land surface climatology of the Community Land Model coupled to the NCAR Community Climate Model. J. Climate 15: 3123-3149. +.. _Bonanetal2002b: + Bonan, G.B., Levis, S., Kergoat, L., and Oleson, K.W. 2002b. Landscapes as patches of plant functional types: An integrating concept for climate and ecosystem models. Global Biogeochem. Cycles 16: 5.1-5.23. +.. _BonanLevis2006: + Bonan, G.B., and Levis, S. 2006. Evaluating aspects of the Community Land and Atmosphere Models (CLM3 and CAM3) using a dynamic global vegetation model. J. Climate 19:2290-2301. +.. _Bonanetal2011: + Bonan, G.B., Lawrence P.J., Oleson K.W., Levis S., Jung M., Reichstein M., Lawrence, D.M., and Swenson, S.C. 2011. Improving canopy processes in the Community Land Model (CLM4) using global flux fields empirically inferred from FLUXNET data. J. Geophys. Res. 116, G02014. DOI:10.1029/2010JG001593. +.. _Bonanetal2012: + Bonan, G. B., Oleson, K.W., Fisher, R.A., Lasslop, G., and Reichstein, M. 2012. Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4, @@ -138,99 +198,147 @@ Branstetter, M.L. 2001. Development of a parallel river transport algorithm and applications to climate studies. Ph.D. dissertation, University of Texas at Austin. +.. _Brun1989: + Brun, E. 1989. Investigation of wet-snow metamorphism in respect of liquid water content. Ann. Glaciol. 13:22-26. +.. _BugmannSolomon2000: + Bugmann, H., and Solomon, A.M. 2000. Explaining forest composition and biomass across multiple biogeographical regions. Ecol. Appl. 10:95-114. +.. _Busing2005: + Busing, R.T. 2005. Tree mortality, canopy turnover, and woody detritus in old cove forests of the southern Appalachians. Ecology 86:73-84. +.. _CampbellNorman1998: + Campbell, G.S., and Norman, J.M. 1998. An Introduction to Environmental Biophysics (2:math:`{}^{nd}` edition). Springer-Verlag, New York. +.. _Castilloetal2012: + Castillo, G., Kendra, C., Levis, S., and Thornton, P. 2012. Evaluation of the new CNDV option of the Community Land Model: effects of dynamic vegetation and interactive nitrogen on CLM4 means and variability. J. Climate 25:3702–3714. +.. _Caoetal1996: + Cao, M., Marshall, S. and Gregson, K., 1996. Global carbon exchange and methane emissions from natural wetlands: Application of a process-based model. J. Geophys. Res. 101(D9):14,399-14,414. +.. _Churkinaetal2003: + Churkina, G. et al., 2003. Analyzing the ecosystem carbon dynamics of four European coniferous forests using a biogeochemistry model. Ecosystems, 6: 168-184. +.. _CIESIN2005: + CIESIN: Gridded population of the world version 3 (GPWv3), 2005. Population density grids, Technical report, Socioeconomic Data and Applications Center (SEDAC), Columbia University, Palisades, New York, USA. +.. _ClappHornberger1978: + Clapp, R.B., and Hornberger, G.M. 1978. Empirical equations for some soil hydraulic properties. Water Resour. Res. 14:601-604. +.. _ClauserHuenges1995: + Clauser, C., and Huenges, E. 1995. Thermal conductivity of rocks and minerals. pp. 105-126. In: T. J. Ahrens (editor) Rock Physics and Phase Relations: A Handbook of Physical Constants. Washington, D.C. +.. _Clevelandetal1999: + Cleveland, C.C., Townsend, A.R., Schimel, D.S., Fisher, H., Howarth, R.W., Hedin, L.O., Perakis, S.S., Latty, E.F., Von Fischer, J.C., Elseroad, A., and Wasson, M.F. 1999. Global patterns of terrestrial biological nitrogen (N2) fixation in natural ecosystems. Global Biogeochem. Cycles 13:623-645. +.. _Collatzetal1991: + Collatz, G.J., Ball, J.T., Grivet, C., and Berry, J.A. 1991. Physiological and environmental regulation of stomatal conductance, photosynthesis, and transpiration: A model that includes a laminar boundary layer. Agric. For. Meteor. 54:107-136. +.. _Collatzetal1992: + Collatz, G.J., Ribas-Carbo, M., and Berry, J.A. 1992. Coupled photosynthesis-stomatal conductance model for leaves of C\ :math:`{}_{4}` plants. Aust. J. Plant Physiol. 19:519-538. +.. _Colmer2003: + Colmer, T.D., 2003. Long-distance transport of gases in plants: a perspective on internal aeration and radial oxygen loss from roots. Plant Cell and Environment 26:17-36. +.. _Conwayetal1996: + Conway, H., Gades, A., and Raymond, C.F. 1996. Albedo of dirty snow during conditions of melt. Water Resour. Res. 32:1713-1718. +.. _Cosbyetal1984: + Cosby, B.J., Hornberger, G.M., Clapp, R.B., and Ginn, T.R. 1984. A statistical exploration of the relationships of soil moisture characteristics to the physical properties of soils. Water Resour. Res. 20:682-690. +.. _Crawfordetal1982: + Crawford, T. W., Rendig, V. V., and Broadent, F. E. 1982. Sources, fluxes, and sinks of nitrogen during early reproductive growth of maize (Zea mays L.). Plant Physiol. 70:1645-1660. +.. _DaiZeng1997: + Dai, Y., and Zeng, Q. 1997. A land surface model (IAP94) for climate studies. Part I: formulation and validation in off-line experiments. Adv. Atmos. Sci. 14:433-460. +.. _Daietal2001: + Dai, Y., et al. 2001. Common Land Model: Technical documentation and user’s guide [Available online at http://climate.eas.gatech.edu/dai/clmdoc.pdf]. +.. _Daietal2003: + Dai, Y., Zeng, X., Dickinson, R.E., Baker, I., Bonan, G.B., Bosilovich, M.G., Denning, A.S., Dirmeyer, P.A., Houser, P.R., Niu, G., Oleson, K.W., Schlosser, C.A., and Yang, Z.-L. 2003. The Common Land Model. Bull. Amer. Meteor. Soc. 84:1013-1023. +.. _Daietal2004: + Dai, Y., Dickinson, R.E., and Wang, Y.-P. 2004. A two-big-leaf model for canopy temperature, photosynthesis, and stomatal conductance. J. Climate 17:2281-2299. +.. _DaiTrenberth2002: + Dai, A., and Trenberth, K.E. 2002. Estimates of freshwater discharge from continents: Latitudinal and seasonal variations. J. Hydrometeor. 3:660-687. +.. _DeFriesetal2000: + DeFries, R.S., Hansen, M.C., Townshend, J.R.G., Janetos, A.C., and Loveland, T.R. 2000. A new global 1-km dataset of percentage tree cover derived from remote sensing. Global Change Biol. 6:247-254. +.. _DegensSparling1996: + Degens, B. and Sparling, G., 1996. Changes in aggregation do not correspond with changes in labile organic C fractions in soil amended with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): @@ -239,187 +347,273 @@ with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): de Vries, D.A. 1963. Thermal Properties of Soils. In: W.R. van Wijk (editor) Physics of the Plant Environment. North-Holland, Amsterdam. +.. _Dickinson1983: + Dickinson, R.E. 1983. Land surface processes and climate-surface albedos and energy balance. Adv. Geophys. 25:305-353. +.. _Dickinsonetal1993: + Dickinson, R.E., Henderson-Sellers, A., and Kennedy, P.J. 1993. Biosphere-Atmosphere Transfer Scheme (BATS) version 1e as coupled to the NCAR Community Climate Model. NCAR Technical Note NCAR/TN-387+STR. National Center for Atmospheric Research, Boulder, CO. +.. _Dickinsonetal2006: + Dickinson, R.E., Oleson, K.W., Bonan, G., Hoffman, F., Thornton, P., Vertenstein, M., Yang, Z.-L., and Zeng, X. 2006. The Community Land Model and its climate statistics as a component of the Community Climate System Model. J. Climate 19:2302-2324. +.. _Dingman2002: + Dingman, S.L. 2002. Physical Hydrology. Second Edition. Prentice Hall, NJ. +.. _Dirmeyeretal1999: + Dirmeyer, P.A., Dolman, A.J., and Sato, N. 1999. The pilot phase of the Global Soil Wetness Project. Bull. Amer. Meteor. Soc. 80:851-878. +.. _Dobsonetal2000: + Dobson, J.E., Bright, E.A., Coleman, P.R., Durfee, R.C., and Worley, B.A. 2000. LandScan: A global population database for estimating populations at risk. Photogramm. Eng. Rem. Sens. 66:849-857. +.. _DormanSellers1989: + Dorman, J.L., and Sellers, P.J. 1989. A global climatology of albedo, roughness length and stomatal resistance for atmospheric general circulation models as represented by the simple biosphere model (SiB). J. Appl. Meteor. 28:833-855. +.. _Doughertyetal1994: + Dougherty, R.L., Bradford, J.A., Coyne, P.I., and Sims, P.L. 1994. Applying an empirical model of stomatal conductance to three C4 grasses. Agric. For. Meteor. 67:269-290. +.. _Drewniaketal2013: + Drewniak, B., Song, J., Prell, J., Kotamarthi, V.R., and Jacob, R. 2013. Modeling agriculture in the Community Land Model. Geosci. Model Dev. 6:495-515. DOI:10.5194/gmd-6-495-2013. +.. _Dunfieldetal1993: + Dunfield, P., Knowles, R., Dumont, R. and Moore, T.R., 1993. Methane Production and Consumption in Temperate and Sub-Arctic Peat Soils - Response to Temperature and Ph. Soil Biology & Biochemistry 25:321-326. +.. _EntekhabiEagleson1989: + Entekhabi, D., and Eagleson, P.S. 1989. Land surface hydrology parameterization for atmospheric general circulation models including subgrid scale spatial variability. J. Climate 2:816-831. +.. _FangStefan1996: + Fang, X. and Stefan, H.G., 1996. Long-term lake water temperature and ice cover simulations/measurements. Cold Regions Science and Technology 24:289-304. +.. _Farouki1981: + Farouki, O.T. 1981. The thermal properties of soils in cold regions. Cold Regions Sci. and Tech. 5:67-75. +.. _Farquharetal1980: + Farquhar, G.D., von Caemmerer, S., and Berry, J.A. 1980. A biochemical model of photosynthetic CO\ :sub:`2` assimilation in leaves of C\ :math:`{}_{3}` species. Planta 149:78-90. +.. _FarquharvonCaemmerer1982: + Farquhar, G.D., and von Caemmerer, S. 1982. Modeling of photosynthetic response to environmental conditions. pp. 549-587. In: O.L. Lange, P.S. Nobel, C.B. Osmond, and H. Zeigler (editors) Encyclopedia of Plant Physiology. Vol. 12B. Physiological Plant Ecology. II. Water Relations and Carbon Assimilation. Springer-Verlag, New York. +.. _Ferrari1999: + Ferrari, J.B., 1999. Fine-scale patterns of leaf litterfall and nitrogen cycling in an old-growth forest. Canadian Journal of Forest Research, 29: 291-302. +.. _FirestoneDavidson1989: + Firestone, M.K. and Davidson, E.A. 1989. Exchange of Trace Gases between Terrestrial Ecosystems and the Atmosphere. In: M.O. Andreae and D.S. Schimel (Editors). John Wiley and Sons, pp. 7-21. +.. _FlannerZender2005: + Flanner, M.G., and Zender. C.S. 2005. Snowpack radiative heating: Influence on Tibetan Plateau climate. Geophys. Res. Lett. 32:L06501. DOI:10.1029/2004GL022076. +.. _FlannerZender2006: + Flanner, M.G., and Zender, C.S. 2006. Linking snowpack microphysics and albedo evolution. J. Geophys. Res. 111:D12208. DOI:10.1029/2005JD006834. +.. _Flanneretal2007: + Flanner, M.G., Zender, C.S., Randerson, J.T., and Rasch, P.J. 2007. Present day climate forcing and response from black carbon in snow. J. Geophys. Res. 112:D11202. DOI:10.1029/2006JD008003. +.. _Flatauetal1992: + Flatau, P.J., Walko, R.L., and Cotton, W.R. 1992. Polynomial fits to saturation vapor pressure. J. Appl. Meteor. 31:1507-1513. +.. _Friedl,etal2002: + Friedl, M.A., McIver, D.K., Hodges, J.C.F., Zhang, X.Y., Muchoney, D., Strahler, A.H., Woodcock, C.E., Gopal, S., Schneider, A., Cooper, A., Baccini, A., Gao, F., and Schaaf, C. 2002. Global land cover mapping from MODIS: algorithms and early results. Remote Sens. Environ. 83:287-302. +.. _Frolkingetal2001: + Frolking, S., et al. 2001. Modeling Northern Peatland Decomposition and Peat Accumulation. Ecosystems. 4:479-498. +.. _Gallaisetal2006: + Gallais, A., Coque, M. Quillere, I., Prioul, J., and Hirel, B. 2006. Modeling postsilking nitrogen fluxes in maize (Zea mays) using 15N-labeling field experiments. New Phytologist 172:696-707. +.. _Gallaisetal2007: + Gallais, A., Coque, M., Gouis, J. L., Prioul, J. L., Hirel, B., and Quillere, I. 2007. Estimating the proportion of nitrogen remobilization and of postsilking nitrogen uptake allocated to maize kernels by Nitrogen-15 labeling. Crop Sci. 47:685-693. +.. _Gallowayetal2004: + Galloway, J.N., et al. 2004. Nitrogen cycles: past, present, and future. Biogeochem. 70:153-226. +.. _Garciaetal1988: + Garcia, R.L., Kanemasu, E.T., Blad, B.L., Bauer, A., Hatfield, J.L., Major, D.A., Reginato, R.J., and Hubbard, K.G. 1988. Interception and use efficiency of light in winter wheat under different nitrogen regimes. Agric. For. Meteor. 44:175-186. +.. _Gashetal1996: + Gash, J.H.C., Nobre, C.A., Roberts, J.M., and Victoria, R.L. 1996. An overview of ABRACOS. pp. 1-14. In: J.H.C. Gash, C.A. Nobre, J.M. Roberts, and R.L. Victoria (editors) Amazonian Deforestation and Climate. John Wiley and Sons, Chichester, England. +.. _Gholzetal1985: + Gholz, H.L., Perry, C.S., Cropper, W.P., Jr. and Hendry, L.C., 1985. Litterfall, decomposition, and nitrogen and phosphorous dynamics in a chronosequence of slash pine (*Pinus elliottii*) plantations. Forest Science, 31: 463-478. +.. _Giglioetal2006: + Giglio, L., Csiszar, I., and Justice, C.O. 2006. Global distribution and seasonality of active fires as observed with the Terra and Aqua Moderate Resolution Imaging Spectroradiometer (MODIS) sensors. J. Geophys. Res. 111:G02016. DOI:10.1029/2005JG000142. +.. _GlobalSoilDataTask2000: + Global Soil Data Task 2000. Global soil data products CD-ROM (IGBP-DIS). International Geosphere-Biosphere Programme-Data and Information Available Services [Available online at http://www.daac.ornl.gov]. +.. _Gomesetal2003: + Gomes, E.P.C., Mantovani, W., and Kageyama, P.Y. 2003. Mortality and recruitment of trees in a secondary montane rain forest in southeastern Brazil. Brazilian Journal of Biology 63:47-60. +.. _Goszetal1973: + Gosz, J.R., Likens, G.E., and Bormann, F.H. 1973. Nutrient release from decomposing leaf and branch litter in the Hubbard Brook Forest, New Hampshire. Ecological Monographs 43:173-191. +.. _GotangcoCastilloetal2012: + Gotangco Castillo C., Levis S., and Thornton P. 2012. Evaluation of the new CNDV option of the Community Land Model: Effects of dynamic vegetation and interactive nitrogen on CLM4 means and variability. J. Climate 25:3702-3714. DOI:10.1175/JCLID-11-00372.1. +.. _Grahametal1999: + Graham, S.T., Famiglietti, J.S., and Maidment, D.R. 1999. Five-minute, 1/2º, and 1º data sets of continental watersheds and river networks for use in regional and global hydrologic and climate system modeling studies. Water Resour. Res. 35:583-587. +.. _GrenfellWarren1999: + Grenfell, T.C., and Warren, S.G. 1999. Representation of a nonspherical ice particle by a collection of independent spheres for scattering and absorption of radiation. J. Geophys. Res. 104(D24):37697-37709. +.. _delGrossoetal2000: + del Grosso, S.J., et al. 2000. General model for N2O and N2 gas emissions from soils due to dentrification. Global Biogeochem. Cycles 14:1045-1060. +.. _Guentheretal1995: + Guenther, A., Hewitt, C.N., Erickson, D., Fall, R., Geron, C., Graedel, T., Harley, P., Klinger, L., Lerdau, M., McKay, W.A., Pierce, T., Scholes, B., Steinbrecher, R., Tallamraju, R., Taylor, J., and Zimmerman, P. 1995. A global model of natural volatile organic compound emissions. J. Geophys. Res. 100:8873-8892. +.. _Guentheretal2006: + Guenther, A., Karl, T., Harley, P., Wiedinmyer, C., Palmer. P.I., and Geron, C. 2006. Estimates of global terrestrial isoprene emissions using MEGAN (Model of Emissions of Gases and Aerosols from Nature). Atmos. Chem. Phys. 6:3181–3210. +.. _Guentheretal2012: + Guenther, A. B., Jiang, X., Heald, C. L., Sakulyanontvittaya, T., Duhl, T., Emmons, L. K., & Wang, X., 2012. The Model of Emissions of Gases and Aerosols from Nature version 2.1 (MEGAN2.1): an extended and updated framework for modeling biogenic emissions, Geosci. Model Dev., 5, 1471–1492. DOI:10.5194. +.. _Hacketal2006: + Hack, J.J., Caron, J.M., Yeager, S.G., Oleson, K.W., Holland, M.M., Truesdale, J.E., and Rasch, P.J. 2006. Simulation of the global hydrological cycle in the CCSM Community Atmosphere Model version 3 (CAM3): mean features. J. Climate 19:2199-2221. +.. _Hansenetal2003: + Hansen, M., DeFries, R.S., Townshend, J.R.G., Carroll, M., Dimiceli, C., and Sohlberg, R.A. 2003. Global percent tree cover at a spatial resolution of 500 meters: first results of the MODIS vegetation continuous fields algorithm. Earth Interactions 7:1-15. +.. _Hastingsetal1999: + Hastings, D.A., Dunbar, P.K., Elphingstone, G.M., Bootz, M., Murakami, H., Maruyama, H., Masaharu, H., Holland, P., Payne, J., Bryant, N.A., Logan, T.L., Muller, J.-P., Schreier, G., and MacDonald, J.S., eds., @@ -428,399 +622,583 @@ Elevation Model, Version 1.0. National Oceanic and Atmospheric Administration, National Geophysical Data Center, 325 Broadway, Boulder, Colorado 80305-3328, U.S.A. +.. _Healdetal2008: + Heald, C.L., Henze, D.K., Horowitz, L.W., Feddema, J., Lamarque, J.-F., Guenther, A., Hess, P.G., Vitt, F., Seinfeld, J.H., Goldstein, A.H., and Fung, I. 2008. Predicted change in global secondary organic aerosol concentrations in response to future climate, emissions, and land use change. J. Geophys. Res. 113:D05211. DOI:10.1029/2007JD009092. +.. _Healdetal2009: + Heald, C.L., Wilkinson, M.J., Monson, R.K., Alo, C.A., Wang, G.L., and Guenther, A. 2009. Response of isoprene emission to ambient CO\ :sub:`2` changes and implications for global budgets. Global Change Biol. 15:1127-1140. DOI:10.1111/j.1365-2486.2008.01802.x +.. _Henderson-Sellers1985: + Henderson-Sellers, B. 1985. New formulation of eddy diffusion thermocline models. Appl. Math. Modelling 9:441-446. +.. _Henderson-Sellers1986: + Henderson-Sellers, B. 1986. Calculating the surface energy balance for lake and reservoir modeling: A review. Rev. Geophys. 24:625-649. +.. _Henderson-Sellersetal1993: + Henderson-Sellers, A., Yang, Z.-L., and Dickinson, R.E. 1993. The project for intercomparison of land-surface parameterization schemes. Bull. Amer. Meteor. Soc. 74: 1335-1349. +.. _HostetlerBartlein1990: + Hostetler, S.W., and Bartlein, P.J. 1990. Simulation of lake evaporation with application to modeling lake level variations of Harney-Malheur Lake, Oregon. Water Resour. Res. 26:2603-2612. +.. _Hostetleretal1993: + Hostetler, S.W., Bates, G.T., and Giorgi, F. 1993. Interactive coupling of a lake thermal model with a regional climate model. J. Geophys. Res. 98:5045-5057. +.. _Hostetleretal1994: + Hostetler, S.W., Giorgi, F., Bates, G.T., and Bartlein, P.J. 1994. Lake-atmosphere feedbacks associated with paleolakes Bonneville and Lahontan. Science 263:665-668. +.. _Houetal2012: + Hou, Z., Huang, M., Leung, L.R., Lin, G., and Ricciuto, D.M. 2012. Sensitivity of surface flux simulations to hydrologic parameters based on an uncertainty quantification framework applied to the Community Land Model. J. Geophys. Res. 117:D15108. +.. _HuangLiang2006: + Huang, M., and Liang, X. 2006. On the assessment of the impact of reducing parameters and identification of parameter uncertainties for a hydrologic model with applications to ungauged basins. J. Hydrol. 320:37-61. +.. _Hugeliusetal2012: + Hugelius, G., C. Tarnocai, G. Broll, J.G. Canadell, P. Kuhry, adn D.K. Swanson, 2012. The Northern Circumpolar Soil Carbon Database: spatially distributed datasets of soil coverage and soil carbon storage in the northern permafrost regions. Earth Syst. Sci. Data Discuss., 5, 707-733 (available online at (http://dev1.geo.su.se/bbcc/dev/ncscd/). +.. _Huntetal1988: + Hunt, H.W., Ingham, E.R., Coleman, D.C., Elliott, E.T., and Reid, C.P.P. 1988. Nitrogen limitation of production and decomposition in prairie, mountain meadow, and pine forest. Ecology 69:1009-1016. +.. _HuntRunning1992: + Hunt, E.R., Jr. and Running, S.W., 1992. Simulated dry matter yields for aspen and spruce stands in the north american boreal forest. Canadian Journal of Remote Sensing, 18: 126-133. +.. _Huntetal1996: + Hunt, E.R., Jr. et al., 1996. Global net carbon exchange and intra-annual atmospheric CO\ :sub:`2` concentrations predicted by an ecosystem process model and three-dimensional atmospheric transport model. Global Biogeochemical Cycles, 10: 431-456. +.. _Hurttetal2006: + Hurtt, G.C., Frolking, S., Fearon, M.G., Moore, B., Shevliakova, E., Malyshev, S., Pacala, S.W., and Houghton, R.A. 2006. The underpinnings of land-use history: three centuries of global gridded land-use transitions, wood-harvest activity, and resulting secondary lands. Global Change Biol. 12:1208-1229. +.. _Hurttetal2011: + Hurtt, G.C., et al. 2011. Harmonization of land-use scenarios for the period 1500-2100: 600 years of global gridded annual land-use transitions, wood harvest, and resulting secondary lands. Climatic Change 109:117-161. DOI:10.1007/s10584-011-0153-2. +.. _Idso1981: + Idso, S.B. 1981. A set of equations for full spectrum and 8- to 14-\ :math:`\mu` \ m and 10.5- to 12.5-\ :math:`\mu` \ m thermal radiation from cloudless skies. Water Resour. Res. 17:295-304. +.. _IiyamaHasegawa2005: + Iiyama, I. and Hasegawa, S., 2005. Gas diffusion coefficient of undisturbed peat soils. Soil Science and Plant Nutrition 51:431-435. -Jackson, R. B., Canadell, J., Ehleringer, J. R., Mooney, H. A., Sala, O. +.. _Jacksonetal1996: + +Jacksonetal1996: E., and Schulze, E. D. 1996. A global analysis of root distributions for terrestrial biomes Oecologia 108:389–411. DOI:10.1007/BF00333714. +.. _Jacksonetal2010: + Jackson, T.L., Feddema, J.J., Oleson, K.W., Bonan, G.B., and Bauer, J.T. 2010. Parameterization of urban characteristics for global climate modeling. Annals of the Association of American Geographers. 100:848-865. +.. _JenkinsonColeman2008: + Jenkinson, D. and Coleman, K. 2008. The turnover of organic carbon in subsoils. Part 2. Modelling carbon turnover. European Journal of Soil Science 59:400-413. +.. _Jordan1991: + Jordan, R. 1991. A One-dimensional Temperature Model for a Snow Cover: Technical Documentation for SNTHERM.89. U.S. Army Cold Regions Research and Engineering Laboratory, Special Report 91-16. +.. _KattgeKnorr2007: + Kattge, J., and Knorr, W. 2007. Temperature acclimation in a biochemical model of photosynthesis: a reanalysis of data from 36 species. Plant Cell Environ. 30:1176-1190. DOI:10.1111/j.1365-3040.2007.01690.x. +.. _Kattgeetal2009: + Kattge, J., Knorr, W., Raddatz, T., and Wirth C. 2009: Quantifying photosynthetic capacity and its relationship to leaf nitrogen content for global–scale terrestrial biosphere models. Global Change Biol. 15:976–991. +.. _Kelleretal2004: + Keller, M., Palace, M., Asner, G.P., Pereira, R., Jr. and Silva, J.N.M., 2004. Coarse woody debris in undisturbed and logged forests in the eastern Brazilian Amazon. Global Change Biology, 10: 784-795. +.. _Kellneretal2006: + Kellner, E., Baird, A.J., Oosterwoud, M., Harrison, K. and Waddington, J.M., 2006. Effect of temperature and atmospheric pressure on methane (CH4) ebullition from near-surface peats. Geophys. Res. Lett. 33. DOI:10.1029/2006GL027509. +.. _Kimballetal1997: + Kimball, J.S., Thornton, P.E., White, M.A. and Running, S.W. 1997. Simulating forest productivity and surface-atmosphere exchange in the BOREAS study region. Tree Physiology 17:589-599. +.. _Kohyamaetal2001: + Kohyama, T., Suzuki, E., Partomihardjo, T., and Yamada, T. 2001. Dynamic steady state of patch-mosaic tree size structure of a mixed diptocarp forest regulated by local crowding. Ecological Research 16:85-98. +.. _Kourzeneva2009: + Kourzeneva, E., 2009. Global dataset for the parameterization of lakes in Numerical Weather Prediction and Climate modeling. ALADIN Newsletter, No 37, July-December, 2009, F. Bouttier and C. Fischer, Eds., Meteo-France, Toulouse, France, 46-53. +.. _Kourzeneva2010: + Kourzeneva, E., 2010: External data for lake parameterization in Numerical Weather Prediction and climate modeling. Boreal Environment Research, 15, 165-177. +.. _Kourzenevaetal2012: + Kourzeneva, E., Asensio, H., Martin, E. and Faroux, S., 2012. Global gridded dataset of lake coverage and lake depth for use in numerical weather prediction and climate modelling. Tellus A 64. +.. _Kovenetal2009: + Koven, C., et al. 2009. On the formation of high-latitude soil carbon stocks: The effects of cryoturbation and insulation by organic matter in a land surface model. Geophys. Res. Lett. 36: L21501. +.. _Kovenetal2011: + Koven, C.D., et al. 2011. Permafrost carbon-climate feedbacks accelerate global warming. Proceedings of the National Academy of Sciences 108:14769-14774. +.. _Kovenetal2013: + Koven, C.D. et al. 2013. The effect of vertically-resolved soil biogeochemistry and alternate soil C and N models on C dynamics of CLM4. Biogeosciences Discussions 10:7201-7256. +.. _Kuchariketal2000: + Kucharik, C.J., Foley, J.A., Delire, C., Fisher, V.A., Coe, M.T., Lenters, J.D., Young-Molling, C., and Ramankutty, N. 2000. Testing the performance of a dynamic global ecosystem model: water balance, carbon balance, and vegetation structure. Global Biogeochem. Cycles 14: 795–825. +.. _KucharikBrye2003: + Kucharik, C.J., and Brye, K.R. 2003. Integrated BIosphere Simulator (IBIS) yield and nitrate loss predictions for Wisconsin maize receiving varied amounts of nitrogen fertilizer. Journal of Environmental Quality 32: 247–268. +.. _Laddetal2992: + Ladd, J.N., Jocteur-Monrozier, L. and Amato, M., 1992. Carbon turnover and nitrogen transformations in an alfisol and vertisol amended with [U-:math:`{}^{14}`\ C] glucose and [:math:`{}^{15}`\ N] ammonium sulfate. Soil Biology and Biochemistry, 24: 359-371. +.. _Lamarqueetal2010: + Lamarque, J.-F., et al. 2010. Historical (1850-2000) gridded anthropogenic and biomass burning emissions of reactive gases and aerosols: methodology and application. Atmos. Chem. Phys. Discuss. 10:4963-5019. DOI:10.5194/acpd-10-4963-2010. +.. _Larcher1995: + Larcher, W. 1995. Physiological Plant Ecology, Springer-Verlag, Berlin Heidelberg. +.. _LavigneRyan1997: + Lavigne, M.B., and Ryan, M.G. 1997. Growth and maintenance respiration rates of aspen, black spruce, and jack pine stems at northern and southern BOREAS sites. Tree Phys. 17:543-551. +.. _Lawetal2003: + Law, B.E., Sun, O.J., Campbell, J., Van Tuyl, S. and Thornton, P.E. 2003. Changes in carbon storage and fluxes in a chronosequence of ponderosa pine. Global Change Biology, 9: 510-514. +.. _Lawrenceetal2007: + Lawrence, D.M., Thornton, P.E., Oleson, K.W., and Bonan, G.B. 2007. The partitioning of evapotranspiration into transpiration, soil evaporation, and canopy evaporation in a GCM: Impacts on land-atmosphere interaction. J. Hydrometeor. 8:862-880. +.. _LawrenceSlater2008: + Lawrence, D.M., and Slater, A.G. 2008. Incorporating organic soil into a global climate model. Clim. Dyn. 30. DOI:10.1007/s00382-007-0278-1. +.. _Lawrenceetal2008: + Lawrence, D.M., Slater, A.G., Romanovsky, V.E., and Nicolsky, D.J. 2008. The sensitivity of a model projection of near-surface permafrost degradation to soil column depth and inclusion of soil organic matter. J. Geophys. Res. 113:F02011. DOI:10.1029/2007JF000883. +.. _Lawrenceetal2011: + Lawrence, D.M., K.W. Oleson, M.G. Flanner, P.E. Thornton, S.C. Swenson, P.J. Lawrence, X. Zeng, Z.-L. Yang, S. Levis, K. Sakaguchi, G.B. Bonan, and A.G. Slater, 2011. Parameterization improvements and functional and structural advances in version 4 of the Community Land Model. J. Adv. Model. Earth Sys. 3. DOI:10.1029/2011MS000045. +.. _LawrenceChase2007: + Lawrence, P.J., and Chase, T.N. 2007. Representing a MODIS consistent land surface in the Community Land Model (CLM 3.0). J. Geophys. Res. 112:G01023. DOI:10.1029/2006JG000168. +.. _LawrenceChase2010: + Lawrence, P.J., and Chase, T.N. 2010. Investigating the climate impacts of global land cover change in the Community Climate System Model. Int. J. Climatol. 30:2066-2087. DOI:10.1002/joc.2061. +.. _Lawrenceetal2012: + Lawrence, P.J., et al. 2012. Simulating the biogeochemical and biogeophysical impacts of transient land cover change and wood harvest in the Community Climate System Model (CCSM4) from 1850 to 2100. J. Climate 25:3071-3095. DOI:10.1175/JCLI-D-11-00256.1. +.. _LehnerDoll2004: + Lehner, B. and Döll, P., 2004. Development and validation of a global database of lakes, reservoirs and wetlands, J. Hydrol., 296, 1–22. +.. _LePageetal2010: + Le Page, Y., van der Werf, G.R., Morton, D.C., and Pereira, J.M.C. 2010. Modeling fire-driven deforestation potential in Amazonia under current and projected climate conditions. J. Geophys. Res. 115:G03012. DOI:10.1029/2009JG001190. +.. _Lerman1979: + Lerman, A., 1979. Geochemical processes: Water and sediment environments. John Wiley and Sons, New York, N.Y. +.. _Lettsetal2000: + Letts, M.G., Roulet, N.T., Comer, N.T., Skarupa, M.R., and Verseghy, D.L. 2000. Parametrization of peatland hydraulic properties for the Canadian Land Surface Scheme. Atmos.-Ocean 38:141-160. +.. _LevinKromer2004: + Levin, I. and Kromer, B. 2004. The tropospheric 14CO2 level in mid-latitudes of the Northern Hemisphere (1959-2003) Radiocarbon 46:1. +.. _Levisetal2003: + Levis, S., Wiedinmyer, C., Bonan, G.B., and Guenther, A. 2003. Simulating biogenic volatile organic compound emissions in the Community Climate System Model. J. Geophys. Res. 108:4659. DOI:10.1029/2002JD003203. +.. _Levisetal2004: + Levis, S., Bonan, G.B., Vertenstein, M., and Oleson, K.W. 2004. The community land model’s dynamic global vegetation model (CLM-DGVM): technical description and user’s guide. NCAR Technical Note NCAR/TN-459+STR. National Center for Atmospheric Research, Boulder, Colorado. 50 pp. +.. _Levisetal2009: + Levis, S., Thornton, P., Bonan, G., and Kucharik, C. 2009. Modeling land use and land management with the Community Land Model. iLeaps newsletter, No. 7. +.. _Levisetal2012: + Levis, S., Bonan, G., Kluzek, E., Thornton, P., Jones, A., Sacks, W., and Kucharik, C 2012. Interactive crop management in the Community Earth System Model (CESM1): Seasonal influences on land-atmosphere fluxes. J. Climate 25: 4839-4859. DOI:10.1175/JCLI-D-11-00446.1. +.. _Lietal2000: + Li, C., Aber, J., Stange, F., Butterbach-Bahl, K. and Papen, H. 2000. A process-oriented model of N2O and NO emissions from forest soils: 1. Model development. J. Geophys. Res. 105(D4):4369-4384. +.. _Lietal2012a: + Li, F., Zeng, X.-D., and Levis, S. 2012a. A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model. Biogeosciences 9:2761-2780. +.. _Lietal2012b: + Li, F., Zeng, X. D., and Levis, S. 2012b. Corrigendum to “A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model†published in Biogeosciences, 9, 2761–2780, 2012â€. Biogeosciences 9: 4771-4772. +.. _Lietal2013a: + Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire in the Earth system – Part 1: Improved global fire modeling in the Community Earth System Model (CESM1). Biogeosciences 10:2293-2314. +.. _Lietal2013b: + Li, H.-Y., Huang, M., Tesfa, T., Ke, Y., Sun, Y., Liu, Y., and Leung, L. R. 2013b. A subbasin-based framework to represent land surface processes in an Earth System Model, Geosci. Model Dev. Discuss. 6:2699-2730. DOI:10.5194/gmdd-6-2699-2013. +.. _Lietal2011: + Li, H., Huang, M., Wigmosta, M.S., Ke, Y., Coleman, A.M., Leung, L.R., Wang, A., and Ricciuto, D.M. 2011. Evaluating runoff simulations from the Community Land Model 4.0 using observations from flux towers and a mountainous watershed. J. Geophys. Res. 116:D24120. DOI:10.1029/2011JD016276. +.. _Liangetal1994: + Liang, X., Lettenmaier, D.P., Wood, E.F., and Burges, S.J. 1994. A simple hydrologically based model of land surface water and energy fluxes for GSMs. J. Geophys. Res. 99(D7):14,415–14,428. +.. _LipscombSacks2012: + Lipscomb, W., and Sacks, W. 2012. The CESM land ice model documentation and user’s guide. 46 pp. [Available online at http://www.cesm.ucar.edu/models/cesm1.1/cism/]. +.. _LloydTaylor1994: + Lloyd, J. and Taylor, J.A., 1994. On the temperature dependence of soil respiration. Functional Ecology, 8: 315-323. +.. _Lloydetal2010: + Lloyd, J., et al. 2010. Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees. Biogeosci. 7:1833-1859. DOI:10.5194/bg-7-1833-2010. +.. _Lobelletal2006: + Lobell, D.B., Bala, G., and Duffy, P.B. 2006. Biogeophysical impacts of cropland management changes on climate. Geophys. Res. Lett. 33:L06708. DOI:10.1029/2005GL025492. +.. _Lovelandetal2000: + Loveland, T.R., Reed, B.C., Brown, J.F., Ohlen, D.O., Zhu, Z., Yang, L., and Merchant, J.W. 2000. Development of a global land cover characteristics database and IGBP DISCover from 1 km AVHRR data. Int. J. Remote Sens. 21:1303-1330. +.. _Lowe1977: + Lowe, P.R. 1977. An approximating polynomial for the computation of saturation vapor pressure. J. Appl. Meteor. 16:100-103. +.. _Luoetal2006: + Luo, Y., Hui, D., and Zhang, D. 2006. Elevated CO2 stimulates net accumulations of carbon and nitrogen in land ecosystems: a meta-analysis. Ecology 87:53-63. +.. _Magilletal1997: + Magill, A.H. et al., 1997. Biogeochemical response of forest ecosystems to simulated chronic nitrogen deposition. Ecological Applications, 7: 402-415. +.. _Mahowaldetal2006: + Mahowald, N.M., Muhs, D.R., Levis, S., Rasch, P.J., Yoshioka, M., Zender, C.S., and Luo, C. 2006. Change in atmospheric mineral aerosols in response to climate: last glacial period, pre-industrial, modern and doubled CO\ :sub:`2` climates. J. Geophys. Res\ *.* 111:D10202. DOI:10.1029/2005JD006653. +.. _Makela2002: + Makela, A. 2002. Derivation of stem taper from the pipe model theory in a carbon balance framework. Tree Phys. 22:891-905. +.. _Manning, M.R. and Melhuish, W.H. 1994. Trends: A Compendium of Data on + Manning, M.R. and Melhuish, W.H. 1994. Trends: A Compendium of Data on Global Change. Carbon Dioxide Information Analysis Center,. Oak Ridge National Laboratory, U.S. Department of Energy, Oak Ridge, Tenn., U.S.A. +.. _Maoetal2012: + Mao, J., Thornton, P.E., Shi, X., Zhao, M., and Post, W.M. 2012. Remote sensing evaluation of CLM4 GPP for the period 2000 to 2009. J. Climate 25:5327-5342. +.. _Maoetal2013: + Mao, J., Shi, X., Thornton, P.E., Hoffman, F.M., Zhu, Z., and Ranga B. Myneni, R.B. 2013. Global latitudinal-asymmetric vegetation growth trends and their driving mechanisms: 1982-2009. Remote Sensing 5:1484-1497. +.. _Martinetal1980: + Martin, J.P., Haider, K. and Kassim, G., 1980. Biodegradation and stabilization after 2 years of specific crop, lignin, and polysaccharide carbons in soils. Soil Science Society of America Journal 44:1250-1255. +.. _Maryetal1993: + Mary, B., Fresneau, C., Morel, J.L. and Mariotti, A., 1993. C and N cycling during decomposition of root mucilage, roots and glucose in soil. Soil Biology and Biochemistry 25:1005-1014. +.. _McGuireetal1992: + McGuire, A.D., Melillo, J.M., Joyce, L.A., Kicklighter, D.W., Grace, A.L., Moore III, B., and Vorosmarty, C.J. 1992. Interactions between carbon and nitrogen dynamics in estimating net primary productivity for potential vegetation in North America. Global Biogeochem. Cycles 6:101-124. +.. _MelzerOLeary1987: + Melzer, E., and O’Leary, M.H. 1987. Anapleurotic CO2 Fixation by Phosphoenolpyruvate Carboxylase in C3 Plants. Plant. Physiol. 84:58. +.. _Milleretal1994: + Miller, J.R., Russell, G.L., and Caliri, G. 1994. Continental-scale river flow in climate models. J. Climate 7:914-928. +.. _MillingtonQuirk1961: + Millington, R. and Quirk, J.P., 1961. Permeability of Porous Solids. Transactions of the Faraday Society 57:1200-1207. +.. _Mironovetal2010: + Mironov, D. et al., 2010. Implementation of the lake parameterisation scheme FLake into the numerical weather prediction model COSMO. Boreal Environment Research 15:218-230. +.. _MitchellJones2005: + Mitchell, T.D., and Jones, P.D. 2005. An improved method of constructing a database of monthly climate observations and associated high-resolution grids. Int. J. Climatol. 25:693-712. +.. _Moldrupetal2003: + Moldrup, P. et al. 2003. Modeling diffusion and reaction in soils: X. A unifying model for solute and gas diffusivity in unsaturated soil. Soil Science 168:321-337. +.. _Mynenietal2002: + Myneni, R.B., et al. 2002. Global products of vegetation leaf area and fraction absorbed PAR from year one of MODIS data. Remote Sens. Environ. 83:214-231. +.. _Neffetal2005: + Neff, J.C., Harden, J.W. and Gleixner, G. 2005. Fire effects on soil organic matter content, composition, and nutrients in boreal interior Alaska. Canadian Journal of Forest Research-Revue Canadienne De Recherche Forestiere 35:2178-2187. +.. _Neitschetal2005: + Neitsch, S.L., Arnold, J.G., Kiniry, J.R., and Williams J.R. 2005. Soil and Water Assessment Tool, Theoretical Documentation: Version 2005. Temple, TX. USDA Agricultural Research Service and Texas A&M Blackland Research Center. +.. _NemaniRunning1996: + Nemani, R.R., and Running, S.W. 1996. Implementation of a hierarchical global vegetation classification in ecosystem function models. J. Veg. Sci. 7:337-346. +.. _Niinemetstal1998: + Niinemets, U., Kull, O., and Tenhunen, J.D. 1998. An analysis of light effects on foliar morphology, physiology, and light interception in temperate deciduous woody species of contrasting shade tolerance. Tree Phys. 18:681-696. +.. _Niuetal2005: + Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. @@ -838,22 +1216,32 @@ Niu, G.-Y., and Yang, Z.-L. 2007. An observation-based formulation of snow cover fraction and its evaluation over large North American river basins. J. Geophys. Res. 112:D21101. DOI:10.1029/2007JD008674. +.. _NydalLovseth1996: + Nydal, R. and Lövseth, K. 1996. Carbon-14 Measurements In Atmospheric CO2 From Northern And Southern Hemisphere Sites, 1962-1993, Carbon Dioxide Information Analysis Center. +.. _Oikawaetal2005: + Oikawa, S., Hikosaka, K. and Hirose, T., 2005. Dynamics of leaf area and nitrogen in the canopy of an annual herb, Xanthium canadense. Oecologia, 143: 517-526. +.. _Oke1987: + Oke, T. 1987. Boundary Layer Climates (2:math:`{}^{nd}` edition). Routledge, London and New York. +.. _OlesonBonan2000: + Oleson, K.W., and Bonan, G.B. 2000. The effects of remotely-sensed plant functional type and leaf area index on simulations of boreal forest surface fluxes by the NCAR land surface model. J. Hydrometeor. 1:431-446. +.. _Olesonetal2004: + Oleson, K.W., Dai, Y., Bonan, G., Bosilovich, M., Dickinson, R., Dirmeyer, P., Hoffman, F., Houser, P., Levis, S., Niu, G.-Y., Thornton, P., Vertenstein, M., Yang, Z.-L., and Zeng. X. 2004. Technical @@ -861,34 +1249,48 @@ description of the Community Land Model (CLM). NCAR Technical Note NCAR/TN-461+STR. National Center for Atmospheric Research, Boulder, Colorado. 173 pp. +.. _Olesonetal2008a: + Oleson, K.W., Niu, G.-Y., Yang, Z.-L., Lawrence, D.M., Thornton, P.E., Lawrence, P.J., Stöckli, R., Dickinson, R.E., Bonan, G.B., Levis, S., Dai, A., and Qian, T. 2008a. Improvements to the Community Land Model and their impact on the hydrological cycle. J. Geophys. Res. 113:G01021. DOI:10.1029/2007JG000563. +.. _Olesonetal2008b: + Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Grimmond, C.S.B. 2008b. An urban parameterization for a global climate model. 1. Formulation and evaluation for two cities. J. Appl. Meteor. Clim. 47:1038-1060. +.. _Olesonetal2008c: + Oleson, K.W., Bonan, G.B., Feddema, J., and Vertenstein, M. 2008c. An urban parameterization for a global climate model. 2. Sensitivity to input parameters and the simulated urban heat island in offline simulations. J. Appl. Meteor. Clim. 47:1061-1076. +.. _Olesonetal2010a: + Oleson, K.W., et al. 2010a. Technical description of version 4.0 of the Community Land model (CLM). NCAR Technical Note NCAR/TN-478+STR, National Center for Atmospheric Research, Boulder, CO, 257 pp. +.. _Olesonetal2010b: + Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Kluzek, E. 2010b. Technical description of an urban parameterization for the Community Land Model (CLMU). NCAR Technical Note NCAR/TN-480+STR, National Center for Atmospheric Research, Boulder, CO, 169 pp. +.. _Olson1963: + Olson, J.S., 1963. Energy storage and the balance of producers and decomposers in ecological systems. Ecology 44:322-331. +.. _Olsonetal2001: + Olson, D.M., Dinerstein, E., Wikramanayake, E.D., Burgess, N.D., Powell, G.V.N., Underwood, E.C., D’Amico, J.A., Itoua, I., Strand, H. E., Morrison, J. C., Loucks, C. J., Allnutt, T. F., Ricketts, T. H., Kura, @@ -896,139 +1298,207 @@ Y., Lamoreux, J. F., Wettengel, W. W., Heda, P., and Kassem, K. R., 2001. Terrestrial ecoregions of the world a new map of life on earth, Bioscience, 51, 933–938. +.. _OrchardCook1983: + Orchard, V.A. and Cook, F.J., 1983. Relationship between soil respiration and soil moisture. Soil Biology and Biochemistry, 15: 447-453. +.. _Owen1964: + Owen, P.R. 1964. Saltation of uniform grains in air. J. Fluid Mech\ *.* 20:225-242. +.. _Ozdoganetal2010: + Ozdogan, M., Rodell, M., Beaudoing, H.K., and Toll, D.L. 2010. Simulating the effects of irrigation over the United States in a land surface model based on satellite-derived agricultural data. Journal of Hydrometeorology 11:171-184. +.. _Pageetal2002: + Page, S.E., Siegert, F., Rieley, J.O., Boehm, H-D.V., Jaya, A., and Limin, S. 2002. The amount of carbon released from peat and forest fires in Indonesia in 1997. Nature 420:61-65. +.. _PanofskyDutton1984: + Panofsky, H.A., and Dutton, J.A. 1984. Atmospheric Turbulence: Models and Methods for Engineering Applications. John Wiley and Sons, New York. +.. _Partonetal1988: + Parton, W., Stewart, J. and Cole, C., 1988. Dynamics of C, N, P And S in Grassland Soils - A Model. Biogeochemistry 5:109-131. +.. _Partonetal1993: + Parton, W.J., et al. 1993. Observations and modeling of biomass and soil organic matter dynamics for the grassland biome worlwide. Global Biogeochemical Cycles 7:785-809. +.. _Partonetal1996: + Parton, W. et al. 1996. Generalized model for N2 and N2O production from nitrification and denitrification. Global Biogeochemical Cycles 10:401-412. +.. _Partonetal2001: + Parton, W.J. et al. 2001. Generalized model for NOx and N2O emissions from soils. J. Geophys. Res. 106(D15):17403-17419. +.. _Paterson1994: + Paterson, W.S.B., 1994. The Physics of Glaciers. Elsevier Science Inc., New York, 480 pp. +.. _Petrescuetal2010: + Petrescu, A.M.R. et al. 2010. Modeling regional to global CH4 emissions of boreal and arctic wetlands. Global Biogeochemical Cycles, 24(GB4009). +.. _Philip1957: + Philip, J.R. 1957. Evaporation, and moisture and heat fields in the soil. J. Meteor. 14:354-366. +.. _Piaoetal2012: + Piao, S.L., et al. 2012. The carbon budget of terrestrial ecosystems in East Asia over the last two decades. Biogeosciences 9:3571-3586. +.. _Pivovarov1972: + Pivovarov, A.A., 1972. Thermal Conditions in Freezing Lakes and Reservoirs. John Wiley, New York. +.. _Pollmeretal1979: + Pollmer, W.G., Eberhard, D., Klein, D., and Dhillon, B.S. 1979. Genetic control of nitrogen uptake and translocation in maize. Crop Sci. 19:82-86. +.. _Portmann2010: + Portmann, F.T., Siebert, S., and Döll, P. 2010. MIRCA2000 - Global monthly irrigated and rainfed crop areas around the year 2000: A new high-resolution data set for agricultural and hydrological modeling. Global Biogeochem. Cycles. 24, GB1011. DOI:10.1029/2008GB003435. +.. _Pressetal1992: + Press, W.H., Teukolsky, S.A., Vetterling, W.T., and Flannery, B.P. 1992. Numerical Recipes in FORTRAN: The Art of Scientific Computing. Cambridge University Press, New York. +.. _Prigentetal2007: + Prigent, C., Papa, F., Aires, F., Rossow, W.B. and Matthews, E. 2007. Global inundation dynamics inferred from multiple satellite observations, 1993-2000. J. Geophys. Res. 112(D12). +.. _Pritchardetal2008: + Pritchard, M.S., Bush, A.B.G., and Marshall, S.J. 2008. Neglecting ice-atmosphere interactions underestimates ice sheet melt in millennial-scale deglaciation simulations. Geophys. Res. Lett. ** 35:L01503. DOI:10.1029/2007GL031738. +.. _Qianetal2006: + Qian, T., Dai, A., Trenberth, K.E., and Oleson, K.W. 2006. Simulation of global land surface conditions from 1948 to 2004: Part I: Forcing data and evaluations. J. Hydrometeor. 7:953-975. +.. _RamankuttyFoley1998: + Ramankutty, N., and Foley, J. A., 1998. Characterizing patterns of global land use: An analysis of global croplands data. Global Biogeochemical Cycles, 12, 667-685. +.. _Ramankuttyetal2008: + Ramankutty, N., Evan, A., Monfreda, C., and Foley, J.A. 2008. Farming the Planet. Part 1: The Geographic Distribution of Global Agricultural Lands in the Year 2000. Global Biogeochem. Cycles. 22:GB1003. DOI:10.1029/2007GB002952. +.. _Randlettetal1996: + Randlett, D.L., Zak, D.R., Pregitzer, K.S., and Curtis, P.S. 1996. Elevated atmospheric carbon dioxide and leaf litter chemistry: Influences on microbial respiration and net nitrogen mineralization. Soil Sci. Soc. Am. J. 60:1571-1577. +.. _Rastetteretal1991: + Rastetter, E.B., Ryan, M.G., Shaver, G.R., Melillo, J.M., Nadelhoffer, K.J., Hobbie, J.E., and Aber, J.D. 1991. A general biogeochemical model describing the responses of the C and N cycles in terrestrial ecosystems to changes in CO2, climate and N deposition. Tree Phys. 9:101-126. +.. _Rastneretal2012: + Rastner, P., Bolch, T., Mölg, N., Machguth, H., and Paul, F., 2012. The first complete glacier inventory for the whole of Greenland, The Cryosphere Discuss., 6, 2399-2436, 10.5194/tcd-6-2399-2012. +.. _Rileyetal2011a: + Riley, W. J., Z. M. Subin, D. M. Lawrence, S. C. Swenson, M. S. Torn, L. Meng, N. Mahowald, and P. Hess, 2011a. Barriers to predicting global terrestrial methane fluxes: Analyses using a methane biogeochemistry model integrated in CESM. Biogeosciences, 8, 1925–1953. DOI:10.5194/bg-8-1925-2011. +.. _Rileyetal2011b: + Riley, W.J. et al. 2011b. CLM4Me, a Methane Biogeochemistry Model Integrated in CESM, Land and Biogeochemistry Model Working Group Meeting, Boulder, CO. +.. _Ryan1991: + Ryan, M. G. 1991. A simple method for estimating gross carbon budgets for vegetation in forest ecosystems. Tree Phys. 9:255-266. +.. _RunningCoughlan1988: + Running, S.W. and Coughlan, J.C., 1988. A general model of forest ecosystem processes for regional applications. I. Hydrological balance, canopy gas exchange and primary production processes. Ecological Modelling, 42: 125-154. +.. _Runningetal1989: + Running, S.W. et al., 1989. Mapping regional forest evapotranspiration and photosynthesis by coupling satellite data with ecosystem simlation. Ecology, 70: 1090-1101. +.. _RunningGower1991: + Running, S.W. and Gower, S.T., 1991. FOREST BGC, A general model of forest ecosystem processes for regional applications. II. Dynamic carbon allocation and nitrogen budgets. Tree Physiology, 9: 147-160. +.. _RunningHunt1993: + Running, S.W. and Hunt, E.R., Jr., 1993. Generalization of a forest ecosystem process model for other biomes, BIOME-BGC, and an applicationfor global-scale models. In: J.R. Ehleringer and C. Field (Editors), Scaling Physiological Processes: Leaf to Globe. Academic Press, San Diego, CA, pp. 141-158. -Sacks, W. J., Cook, B. I., Buenning, N., Levis, S., and Helkowski, J. H. +.. _Sacksetal2009: + +Sacks, W. J., Cook, B. I., Buenning, N., Levis, S., and Helkowski, J. H. 2009. Effects of global irrigation on the near-surface climate. Climate Dyn., 33, 159–175. DOI:10.1007/s00382-008-0445-z. +.. _Saggaretal1994: + Saggar, S., Tate, K.R., Feltham, C.W., Childs, C.W. and Parshotam, A., 1994. Carbon turnover in a range of allophanic soils amended with :math:`{}^{14}`\ C-labelled glucose. Soil Biology and Biochemistry, 26: @@ -1039,315 +1509,463 @@ and under-canopy atmospheric stability on ground evaporation in the Community Land Model (CLM3.5). J. Geophys. Res. 114:D01107. DOI:10.1029/2008JD010834. +.. _Schaafetal2002: + Schaaf, C.B., Gao, F., Strahler, A.H., Lucht, W., Li, X., Tsang, T., Strugnell, N.C., Zhang, X., Jin, Y., and Muller, J.-P. 2002. First operational BRDF, albedo nadir reflectance products from MODIS. Remote Sens. Environ. 83:135-148. +.. _Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. + Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. Academic Press, London, 588 pp. +.. _SchnellKing1996: + Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity in soils and cultures to water stress. Applied and Environmental Microbiology 62:3203-3209. +.. _Segers, R., 1998. Methane production and methane consumption: a review + Segers, R., 1998. Methane production and methane consumption: a review of processes underlying wetland methane fluxes. Biogeochemistry 41:23-51. +.. _Sellers1985: + Sellers, P.J. 1985. Canopy reflectance, photosynthesis and transpiration. Int. J. Remote Sens. 6:1335-1372. +.. _Sellersetal1986: + Sellers, P.J., Mintz, Y., Sud, Y.C., and Dalcher, A. 1986. A simple biosphere model (SiB) for use within general circulation models. J. Atmos. Sci. 43:505-531. +.. _Sellersetal1988: + Sellers, P.J., Hall, F.G., Asrar, G., Strebel, D.E., and Murphy, R.E. 1988. The First ISLSCP Field Experiment (FIFE). Bull. Amer. Meteor. Soc. 69:22-27. +.. _Sellersetal1992: + Sellers, P.J., Berry, J.A., Collatz, G.J., Field, C.B., and Hall, F.G. 1992. Canopy reflectance, photosynthesis, and transpiration. III. A reanalysis using improved leaf models and a new canopy integration scheme. Remote Sens. Environ. 42:187-216. +.. _Sellersetal1995: + Sellers, P.J., et al. 1995. The Boreal Ecosystem-Atmosphere Study (BOREAS): An overview and early results from the 1994 field year. Bull. Amer. Meteor. Soc. 76:1549-1577. +.. _Sellersetal1996: + Sellers, P.J., Randall, D.A., Collatz, G.J., Berry, J.A., Field, C.B., Dazlich, D.A., Zhang, C., Collelo, G.D., and Bounoua, L. 1996. A revised land surface parameterization (SiB2) for atmospheric GCMs. Part I: Model formulation. J. Climate 9:676-705. +.. _Shietal2013: + Shi, X., Mao, J., Thornton, P.E., and Huang, M. 2013. Spatiotemporal patterns of evapotranspiration in response to multiple environmental factors simulated by the Community Land Model. Environ. Res. Lett. 8:024012. +.. _Shiklomanov2000: + Shiklomanov, I.A. 2000. Appraisal and assessment of world water resources. Water International 25:11-32. +.. _Siebertetal2005: + Siebert, S., Döll, P., Hoogeveen, J., Faures, J.M., Frenken, K., Feick, S., 2005. Development and validation of the global map of irrigation areas. Hydrol Earth Syst Sc 9:535–547 +.. _Simpsonetal1983: + Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen redistribution during grain growth in wheat (Triticum avestivum L.). Plant Physiol. 71:7-14. +.. _Smithetal2005: + Smith, A.M.S., Wooster, M.J., Drake, N.A., Dipotso, F.M. and Perry, G.L.W., 2005. Fire in African savanna: Testing the impact of incomplete combustion on pyrogenic emissions estimates. Ecological Applications, 15: 1074-1082. +.. _Sollins1982: + Sollins, P., 1982. Input and decay of coarse woody debris in coniferous stands in western Oregon and Washington. Canadian Journal of Forest Research, 12: 18-28. +.. _SonGower1991: + Son, Y. and Gower, S.T., 1991. Aboveground nitrogen and phosphorus use by five plantation-grown trees with different leaf longevities. Biogeochemistry, 14: 167-191. +.. _Sorensen1981: + Sørensen, L.H., 1981. Carbon-nitrogen relationships during the humification of cellulose in soils containing different amounts of clay. Soil Biology and Biochemistry, 13: 313-321. +.. _Sprugeletal1995: + Sprugel, D.G., Ryan, M.G., Brooks, J.R., Vogt, K.A., and Martin, T.A. 1995. Respiration from the organ level to stand level. pp. 255-299. In: W. K. Smith and T. M. Hinkley (editors) Resource Physiology of Conifers. Academic Press, San Diego,CA. +.. _StaufferAharony1994: + Stauffer, D., and Aharony, A. 1994. Introduction to Percolation Theory. Taylor and Francis, London. +.. _Stilletal2003: + Still, C.J., Berry, J.A., Collatz, G.J., and DeFries, R.S. 2003. Global distribution of C3 and C4 vegetation: carbon cycle implications. Global Biogeochem. Cycles 17:1006. DOI:10.1029/2001GB001807. +.. _Stocklietal2008: + Stöckli, R., Lawrence, D.M., Niu, G.-Y., Oleson, K.W., Thornton, P.E., Yang, Z.-L., Bonan, G.B., Denning, A.S., and Running, S.W. 2008. Use of FLUXNET in the Community Land Model development. J. Geophys. Res. 113:G01025. DOI:10.1029/2007JG000562. +.. _Stracketal2006: + Strack, M., Kellner, E. and Waddington, J.M., 2006. Effect of entrapped gas on peatland surface level fluctuations. Hydrological Processes 20:3611-3622. +.. _Strahleretal1999: + Strahler, A.H., Muchoney, D., Borak, J., Friedl, M., Gopal, S., Lambin, E., and Moody. A. 1999. MODIS Land Cover Product: Algorithm Theoretical Basis Document (Version 5.0). Boston University, Boston. +.. _Stull1988: + Stull, R.B. 1988. An Introduction to Boundary Layer Meteorology. Kluwer Academic Publishers, Dordrecht. +.. _Subinetal2012a: + Subin, Z.M., Riley, W.J. and Mironov, D. 2012a. Improved lake model for climate simulations, J. Adv. Model. Earth Syst., 4, M02001. DOI:10.1029/2011MS000072. +.. _Subinetal2012b: + Subin, Z.M., Murphy, L.N., Li, F., Bonfils, C. and Riley, W.J., 2012b. Boreal lakes moderate seasonal and diurnal temperature variation and perturb atmospheric circulation: analyses in the Community Earth System Model 1 (CESM1). Tellus A, North America, 64. +.. _Sunetal2012: + Sun, Y., Gu, L., and Dickinson, R. E. 2012. A numerical issue in calculating the coupled carbon and water fluxes in a climate model, J. Geophys. Res., 117, D22103. DOI:10.1029/2012JD018059. +.. _Swensonetal2012: + Swenson, S.C., Lawrence, D.M., and Lee, H. 2012. Improved Simulation of the Terrestrial Hydrological Cycle in Permafrost Regions by the Community Land Model. JAMES, 4, M08002. DOI:10.1029/2012MS000165. +.. _SwensonLawrence2012: + Swenson, S.C. and Lawrence, D.M. 2012. A New Fractional Snow Covered Area Parameterization for the Community Land Model and its Effect on the Surface Energy Balance. JGR, 117, D21107. DOI:10.1029/2012JD018178. +.. _TaWeiland1992: + Ta, C.T. and Weiland, R.T. 1992. Nitrogen partitioning in maize during ear development. Crop Sci. 32:443-451. +.. _TangRiley2013: + Tang, J.Y. and Riley, W.J. 2013. A new top boundary condition for modeling surface diffusive exchange of a generic volatile tracer: Theoretical analysis and application to soil evaporation. Hydrol. Earth Syst. Sci. 17:873-893. +.. _Tarnocaietal2011: + Tarnocai, C., Kettles, I. M., and Lacelle, B., 2011. Peatlands of Canada, Geological Survey of Canada, Open File 6561, CD-ROM. DOI:10.495/288786. +.. _Tayloretal1989: + Taylor, B.R., Parkinson, D. and Parsons, W.F.J., 1989. Nitrogen and lignin content as predictors of litter decay rates: A microcosm test. Ecology, 70: 97-104. +.. _Thonickeetal2001: + Thonicke, K., Venevsky, S., Sitch, S., and Cramer, W. 2001. The role of fire disturbance for global vegetation dynamics: coupling fire into a Dynamic Global Vegetation Model. Global Ecology and Biogeography 10:661-667. +.. _Thornton1998: + Thornton, P.E., 1998. Regional ecosystem simulation: combining surface- and satellite-based observations to study linkages between terrestrial energy and mass budgets. Ph.D. Thesis, The University of Montana, Missoula, 280 pp. +.. _Thorntonetal2002: + Thornton, P.E., Law, B.E., Gholz, H.L., Clark, K.L., Falge, E., Ellsworth, D.S., Goldstein, A.H., Monson, R.K., Hollinger, D., Falk, M., Chen, J., and Sparks, J.P. 2002. Modeling and measuring the effects of disturbance history and climate on carbon and water budgets in evergreen needleleaf forests. Agric. For. Meteor. 113:185-222. +.. _ThorntonRosenbloom2005: + Thornton, P.E., and Rosenbloom, N.A. 2005. Ecosystem model spin-up: estimating steady state conditions in a coupled terrestrial carbon and nitrogen cycle model. Ecological Modelling 189:25-48. +.. _ThorntonZimmermann2007: + Thornton, P.E., and Zimmermann, N.E. 2007. An improved canopy integration scheme for a land surface model with prognostic canopy structure. J. Climate 20:3902-3923. +.. _Thorntonetal2007: + Thornton, P.E., Lamarque, J.-F., Rosenbloom, N.A., and Mahowald, N.M. 2007. Influence of carbon-nitrogen cycle coupling on land model response to CO\ :sub:`2` fertilization and climate variability. Global Biogeochem. Cycles 21:GB4018. +.. _Thorntonetal2009: + Thornton, P.E., Doney, S.C., Lindsay, K., Moore, J.K., Mahowald, N., Randerson, J.T., Fung, I., Lamarque, J.F., Feddema, J.J., and Lee, Y.H. 2009. Carbon-nitrogen interactions regulate climate-carbon cycle feedbacks: results from an atmosphere-ocean general circulation model. Biogeosci. 6:2099-2120. +.. _Tianetal2010: + Tian, H. et al. 2010. Spatial and temporal patterns of CH4 and N2O fluxes in terrestrial ecosystems of North America during 1979-2008: application of a global biogeochemistry model. Biogeosciences 7:2673-2694. +.. _Toonetal1989: + Toon, O.B., McKay, C.P., Ackerman, T.P., and Santhanam, K. 1989. Rapid calculation of radiative heating rates and photodissociation rates in inhomogeneous multiple scattering atmospheres. J. Geophys. Res. 94(D13):16,287-16,301. +.. _Turetskyetal2002: + Turetsky, M.R., Wieder, R.K., Halsey, L.A., and Vitt, D.H. 2002. Current disturbance and the diminishing peatland carbon sink. Geophys. Res. Lett. 29:1526. DOI:10.1029/2001GL014000. -Turetsky, M.R., Amiro, B.D., Bosch, E., andBhatti, J.S. 2004. Historical +.. _Turetskyetal2004: + +Turetsky, M.R., Amiro, B.D., Bosch, E., and Bhatti, J.S. 2004. Historical burn area in western Canadian peatlands and its relationship to fire weather indices. Global Biogeochem. Cycles 18:GB4014. DOI:10.1029/2004GB002222. +.. _Turnbulletal2007: + Turnbull, J.C. et al. 2007. A new high precision (CO2)-C-14 time series for North American continental air. Journal of Geophysical Research-Atmospheres 112(D11). +.. _Tyeetal2005: + Tye, A.M., et al. 2005. The fate of N-15 added to high Arctic tundra to mimic increased inputs of atmospheric nitrogen released from a melting snowpack. Global Change Biology 11:1640-1654. +.. _Unlandetal1996: + Unland, H.E., Houser, P.R., Shuttleworth, W.J., and Yang, Z.-L. 1996. Surface flux measurement and modeling at a semi-arid Sonoran Desert site. Agric. For. Meteor. 82:119-153. +.. _UNSTAT2005: + UNSTAT, 2005. National Accounts Main Aggregates Database, United Nations Statistics Division. +.. _VallanoSparks2007: + Vallano, D.M. and Sparks, J.P. 2007. Quantifying foliar uptake of gaseous itrogen dioxide using enriched foliar :math:`\delta^{15}`\ N values. New Phytologist 177:946-955. +.. _vanderWerfetal2010: + van der Werf, G.R., Randerson, J.T., Giglio, L., Collatz, G.J., Mu, M., Kasibhatla, S.P., Morton, D.C., DeFries, R.S., Jin, Y., van Leeuwen, T.T. 2010. Global fire emissions and the contribution of deforestation, savanna, forest, agricultural, and peat fires (1997-2009) Atmos. Chem. Phys. 10:11707-11735. +.. _van Veenetal1984: + van Veen, J.A., Ladd, J.N. and Frissel, M.J., 1984. Modelling C and N turnover through the microbial biomass in soil. Plant and Soil, 76: 257-274. +.. _VanVuurenetal2006: + Van Vuuren, D.P., Lucas, P.S., and Hilderink, H.B.M., 2006. Downscaling drivers of global environmental change: enabling use of global SRES scenarios at the national and grid levels, Report 550025001, Netherlands Environmental Assessment Agency, 45 pp. +.. _Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: + Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: effects of size, competition and site fertility on growth allocation and production. Tree Phys. 25:17-30. +.. _VerdinGreenlee1996: + Verdin, K. L., and S. K. Greenlee, 1996. Development of continental scale digital elevation models and extraction of hydrographic features, paper presented at the Third International Conference/Workshop on Integrating GIS and Environmental Modeling, Santa Fe, New Mexico, 21–26 January, Natl. Cent. for Geogr. Inf. and Anal., Santa Barbara, Calif. +.. _Viovy2011: + Viovy, N. 2011. CRUNCEP dataset. [Description available at http://dods.extra.cea.fr/data/p529viov/cruncep/readme.htm. Data available at http://dods.extra.cea.fr/store/p529viov/cruncep/V4\_1901\_2011/]. +.. _VitousekHowarth1991: + Vitousek, P.M., and Howarth, R.W. 1991. Nitrogen limitation on land and in the sea: How can it occur? Biogeochem. 13:87-115. +.. _Walteretal2001: + Walter, B.P., Heimann, M. and Matthews, E., 2001. Modeling modern methane emissions from natural wetlands 1. Model description and results. J. Geophys. Res. 106(D24):34189-34206. +.. _Waniaetal2009: + Wania, R., Ross, I. and Prentice, I.C. 2009. Integrating peatlands and permafrost into a dynamic global vegetation model: 2. Evaluation and sensitivity of vegetation and carbon cycle processes. Global Biogeochem. Cycles 23. +.. _Waniaetal2010: + Wania, R., Ross, I. and Prentice, I.C. 2010. Implementation and evaluation of a new methane model within a dynamic global vegetation model LPJ-WHyMe v1.3. Geoscientific Model Development Discussions 3:1-59. +.. _WangZeng2009: + Wang, A., and Zeng, X. 2009. Improving the treatment of vertical snow burial fraction over short vegetation in the NCAR CLM3. Adv. Atmos. Sci. 26:877-886. DOI:10.1007/s00376-009-8098-3. +.. _Whiteetal1997: + White, M.A., Thornton, P.E., and Running, S.W. 1997. A continental phenology model for monitoring vegetation responses to interannual climatic variability. Global Biogeochem. Cycles 11:217-234. +.. _Whiteetal2000: + White, M.A., Thornton, P.E., Running, S.W., and Nemani, R.R. 2000. Parameterization and sensitivity analysis of the Biome-BGC terrestrial ecosystem model: net primary production controls. Earth Interactions 4:1-85. +.. _WiscombeWarren1980: + Wiscombe, W.J., and Warren, S.G. 1980. A model for the spectral albedo of snow. I. Pure snow. J. Atmos. Sci. 37:2712-2733. +.. _Woodetal1992: + Wood, E.F., Lettenmaier, D.P., and Zartarian, V.G. 1992. A land-surface hydrology parameterization with subgrid variability for general circulation models. J. Geophys. Res. 97(D3):2717–2728. DOI:10.1029/91JD01786. +.. _World Bank2004: + World Bank, 2004. World development indicators 2004, Oxford University Press, New York, 416 pp. +.. _Yang1998: + Yang, Z.-L. 1998. Technical note of a 10-layer soil moisture and temperature model. Unpublished manuscript. +.. _Zenderetal2003: + Zender, C.S., Bian, H., and Newman, D. 2003. Mineral dust entrainment and deposition (DEAD) model: Description and 1990s dust climatology. ** J. Geophys. Res\ *.* 108(D14):4416. DOI:10.1029/2002JD002775. +.. _ZengDickinson1998: + Zeng, X., and Dickinson, R.E. 1998. Effect of surface sublayer on surface skin temperature and fluxes. J.Climate 11:537-550. +.. _Zengetal1998: + Zeng, X., Zhao, M., and Dickinson, R.E. 1998. Intercomparison of bulk aerodynamic algorithms for the computation of sea surface fluxes using the TOGA COARE and TAO data. J. Climate 11:2628-2644. +.. _Zeng2001: + Zeng, X. 2001. Global vegetation root distribution for land modeling. J. Hydrometeor. 2:525-530. +.. _Zengetal2002: + Zeng, X., Shaikh, M., Dai, Y., Dickinson, R.E., and Myneni, R. 2002. Coupling of the Common Land Model to the NCAR Community Climate Model. J. Climate 15:1832-1854. +.. _Zengetal2005: + Zeng, X., Dickinson, R.E., Barlage, M., Dai, Y., Wang, G., and Oleson, K. 2005. Treatment of under-canopy turbulence in land models. J. Climate 18:5086-5094. +.. _ZengWang2007: + Zeng, X., and Wang, A. 2007. Consistent parameterization of roughness length and displacement height for sparse and dense canopies in land models. J. Hydrometeor. 8:730-737. @@ -1356,20 +1974,28 @@ Zeng, X., and Decker, M. 2009. Improving the numerical solution of soil moisture-based Richards equation for land models with a deep or shallow water table. J. Hydrometeor. 10:308-319. +.. _Zengetal2008: + Zeng, X., Zeng, X., and Barlage, M. 2008. Growing temperate shrubs over arid and semiarid regions in the Community Land Model - Dynamic Global Vegetation Model. Global Biogeochem. Cycles 22:GB3003. DOI:10.1029/2007GB003014. +.. _Zhangetal2002: + Zhang, Y., Li, C.S., Trettin, C.C., Li, H. and Sun, G., 2002. An integrated model of soil, hydrology, and vegetation for carbon dynamics in wetland ecosystems. Global Biogeochemical Cycles 16. DOI:10.1029/2001GB001838. +.. _Zhuangetal2004: + Zhuang, Q., et al. 2004. Methane fluxes between terrestrial ecosystems and the atmosphere at northern high latitudes during the past century: A retrospective analysis with a process-based biogeochemistry model. Global Biogeochemical Cycles 18. DOI:10.1029/2004GB002239. +.. _Zilitinkevich1970: + Zilitinkevich, S.S. 1970. Dynamics of the Atmospheric Boundary Layer. Leningrad Gidrometeor. diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index f586313340..f033832ceb 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -3,9 +3,8 @@ Snow Hydrology =============== -The model parameterizes -The parameterizations for snow are based primarily on Anderson (1976), -country-regionplaceJordan (1991), and Dai and Zeng (1997). The snowpack +The parameterizations for snow are based primarily on :ref:`Anderson (1976) `, +:ref:`Jordan (1991) `, and :ref:`Dai and Zeng (1997) `. The snowpack can have up to five layers. These layers are indexed in the Fortran code as :math:`i=-4,-3,-2,-1,0` where layer :math:`i=0` is the snow layer next to the top soil layer and layer :math:`i=-4` is the top layer of a @@ -55,7 +54,8 @@ Snow Covered Area Fraction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The fraction of the ground covered by snow, :math:`f_{sno}` , is based -on the method of Swenson and Lawrence (2012). Because the processes +on the method of :ref:`Swenson and Lawrence (2012) `. +Because the processes governing snowfall and snowmelt differ, changes in :math:`f_{sno}` are calculated separately for accumulation and depletion. When snowfall occurs, :math:`f_{sno}` is updated as @@ -138,7 +138,7 @@ where \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg -m\ :sup:`-3`) (CityplaceAnderson 1976) +m\ :sup:`-3`) (:ref:`Anderson (1976) `) .. math:: :label: 8.21) @@ -260,7 +260,7 @@ where the volumetric liquid water :math:`\theta _{liq,\, i}` and ice and :math:`S_{r} =0.033` is the irreducible water saturation (snow holds a certain amount of liquid water due to capillary retention after -drainage has ceased (Anderson 1976)). The water holding capacity of the +drainage has ceased (:ref:`Anderson (1976) `)). The water holding capacity of the underlying layer limits the flow of water :math:`q_{liq,\, i}` calculated in equation , unless the underlying layer is the surface soil layer, as @@ -357,7 +357,7 @@ is the model time step (s). The particle mass mixing ratio is c_{i} =\frac{m_{sp,\, i} }{w_{liq,\, i} +w_{ice,\, i} } . Values of :math:`k_{sp}` are partially derived from experiments -published by Conway et al. (1996). Particles masses are re-distributed +published by :ref:`Conway et al. (1996) `. Particles masses are re-distributed proportionately with snow mass when layers are combined or divided, thus conserving particle mass within the snow column. The mass of particles carried out with meltwater through the bottom snow layer is assumed to @@ -367,7 +367,7 @@ model. .. _Table Meltwater scavenging: .. table:: Meltwater scavenging efficiency for particles within snow - + +------------------------------------------+-------------------+ | Species | :math:`k_{sp}` | +==========================================+===================+ @@ -410,8 +410,7 @@ Snow Compaction Snow compaction is initiated after the soil hydrology calculations [surface runoff (section :numref:`Surface Runoff`), infiltration (section -:numref:`Infiltration`), soil water (section :numref:`Soil Water`), -groundwater-soilwater interactions (section 8.6)] are +:numref:`Infiltration`), soil water (section :numref:`Soil Water`)] are complete. Compaction of snow includes three types of processes: destructive metamorphism of new snow (crystal breakdown due to wind or thermodynamic stress); snow load or overburden (pressure); and melting @@ -435,7 +434,7 @@ Compaction is not allowed if the layer is saturated or if the ice content is below a minimum value (:math:`w_{ice,\, i} \le 0.1`). -Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (CityplaceAnderson 1976) +Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (:ref:`Anderson (1976) `) .. math:: :label: 8.43) @@ -458,7 +457,7 @@ and :math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). -The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (CityplaceAnderson 1976) +The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (:ref:`Anderson (1976) `) .. math:: :label: 8.45) @@ -520,7 +519,7 @@ After the determination of snow temperature including phase change(Chapter :numref:`rst_Snow Hydrology`), and the compaction calculations (section :numref:`Snow Compaction`) , the number of snow layers is adjusted by either combining or subdividing layers. The combination and subdivision -of snow layers is based on Jordan (1991). +of snow layers is based on :ref:`Jordan (1991) `. .. _Combination: diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 946dbd4c45..c1971be79a 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -50,7 +50,7 @@ snow, and surface water layers from the overlying atmosphere (section temperature profile is calculated first without phase change and then readjusted for phase change (section 6.2). -.. _Numerical Solution: +.. _Numerical Solution Temperature: Numerical Solution ---------------------- From cdbd9fe94196b30ffb3b4f7e17df16a37bae29ac Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Tue, 23 May 2017 10:57:23 -0600 Subject: [PATCH 016/730] add vertical discretization --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 40 ++ .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 249 +++++++--- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 84 +++- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 440 ++++-------------- .../CLM50_Tech_Note_Photosynthesis.rst | 282 +++++------ .../References/CLM50_Tech_Note_References.rst | 17 +- .../CLM50_Tech_Note_Snow_Hydrology.rst | 13 +- ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 141 ++---- .../CLM50_Tech_Note_Surface_Albedos.rst | 134 +++--- 9 files changed, 649 insertions(+), 751 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 80cd1e3527..f0f31eac92 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -3,6 +3,8 @@ Crops and Irrigation ======================== +.. _Summary of CLM4.5 updates relative to the CLM4.0: + Summary of CLM4.5 updates relative to the CLM4.0 ----------------------------------------------------- @@ -30,6 +32,8 @@ refers to the interactive crop management model: These updates appear in detail in section 20.4. Most also appear in Drewniak et al. (2013). +.. _The crop model: + The crop model ------------------- @@ -65,6 +69,8 @@ while helping human societies answer questions about changing food, energy, and water resources in response to climate, environmental, land use, and land management change (e.g., Kucharik and Brye 2003; Lobell et al. 2006). +.. _Crop plant functional types: + Crop plant functional types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -95,6 +101,8 @@ CLM setting). Managed crop PFTs in the human managed land unit do not share soil columns and thus permit for differences in land management between crops. +.. _Phenology: + Phenology ^^^^^^^^^^^^^^^^ @@ -109,6 +117,8 @@ continues from leaf emergence to the beginning of grain fill, and phase 3 starts from the beginning of grain fill and ends with physiological maturity and harvest. +.. _Planting: + Planting ''''''''''''''''' @@ -175,6 +185,8 @@ outside the above ranges, then it equals the minimum or maximum value in the range. Also :math:`{T}_{f}` equals 273.15 K, :math:`{T}_{2m}` has units of K, and *GDD* has units of :sup:`o`\ days. +.. _Leaf emergence: + Leaf emergence ''''''''''''''''''''''' @@ -188,6 +200,8 @@ time step of phase 2, at which moment all seed C is transferred to leaf C. Subsequently, the leaf area index generally increases and reaches a maximum value during phase 2. +.. _Grain fill: + Grain fill ''''''''''''''''''' @@ -200,6 +214,8 @@ percentage itself is an empirical function of :math:`{GDD}_{mat}` response to a background litterfall rate calculated as the inverse of leaf longevity for the pft as done in the CN part of the model. +.. _Harvest: + Harvest '''''''''''''''' @@ -215,6 +231,8 @@ flow of live stem C and N to litter for corn, soybean, and temperate cereals. This is in contrast to the approach for unmanaged PFTs which puts live stem C and N to dead stems first, rather than to litter. +.. _Allocation: + Allocation ^^^^^^^^^^^^^^^^^ @@ -224,6 +242,8 @@ Simulated C assimilation begins every year upon leaf emergence in phase allocation of such C to the crop’s leaf, live stem, fine root, and reproductive pools. +.. _Leaf emergence to grain fill: + Leaf emergence to grain fill ''''''''''''''''''''''''''''''''''''' @@ -242,6 +262,8 @@ section 20.2.3. At a crop-specific maximum leaf area index, :math:`{L}_{max}` (Table 20.2), carbon allocation is directed exclusively to the fine roots. +.. _Grain fill to harvest: + Grain fill to harvest '''''''''''''''''''''''''''''' @@ -269,6 +291,8 @@ allocation decline factors, and :math:`a_{leaf}^{f}` and :math:`a_{livestem}^{f}` are final values of these allocation coefficients (Table 20.2). +.. _General comments: + General comments ^^^^^^^^^^^^^^^^^^^^^^^ @@ -411,6 +435,8 @@ allocation. Numbers in the first column correspond to the list of pfts in Table Notes: Crop growth phases and corresponding variables are described in the text +.. _The irrigation model: + The irrigation model ------------------------- @@ -480,9 +506,13 @@ added to :math:`{q}_{grnd,liq}`: section 7.1). Added irrigation is removed from total liquid runoff ( :math:`{R}_{liq}`: Chapter 11), simulating removal from nearby rivers. +.. _The details about what is new in CLM4.5: + The details about what is new in CLM4.5 -------------------------------------------- +.. _Interactive irrigation for corn, temperate cereals, and soybean: + Interactive irrigation for corn, temperate cereals, and soybean ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -527,6 +557,8 @@ or without irrigation. In simulations without irrigation, the rainfed and irrigated crops merge into just rainfed crops at run time. Surface datasets with 16 pfts can be used for all other CLM simulations. +.. _Interactive fertilization: + Interactive fertilization ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -563,6 +595,8 @@ The crop fertilization scheme was developed in versions of the CLM prior to CLM4.5. In CLM4.5, crops with fertilization may be simulated over productive. +.. _Biological nitrogen fixation for soybeans: + Biological nitrogen fixation for soybeans ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -606,6 +640,8 @@ pool for use that time step. Nitrogen fixation occurs after the plant has accumulated 15%\ :math:`{GDD}_{mat}` and before 75%\ :math:`{GDD}_{mat}`, so before grain fill begins. +.. _Modified C\:N ratios for crops: + Modified C:N ratios for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -625,6 +661,8 @@ harvest. All C:N ratios were determined by calibration process, through comparisons of model output versus observations of plant carbon throughout the growth season. +.. _Nitrogen retranslocation for crops: + Nitrogen retranslocation for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -699,6 +737,8 @@ fine root, and reproductive pools. | :math:`CN_{repr}^{f}` | 50 | 40 | 60 | +----------------------------+--------+---------------------+-----------+ +.. _Separate reproductive pool: + Separate reproductive pool ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 959a8cbd73..df44ae6fe1 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -1,7 +1,7 @@ -.. _rst_Surface Characterization and Model Input Requirements: +.. _rst_Surface Characterization, Vertical Discretization, and Model Input Requirements: -Surface Characterization and Model Input Requirements -======================================================== +Surface Characterization, Vertical Discretization, and Model Input Requirements +=================================================================================== .. _Surface Characterization: @@ -91,7 +91,7 @@ The crop land unit is present only when the crop model is active. Note that the biogeophysical processes related to soil and snow require PFT level properties to be aggregated to the column level. For example, the net heat flux into the ground is required as a boundary condition -for the solution of snow/soil temperatures (Chapter 6). This column +for the solution of snow/soil temperatures (Chapter :numref:`rst_Soil and Snow Temperatures`). This column level property must be determined by aggregating the net heat flux from all PFTs sharing the column. This is generally accomplished in the model by computing a weighted sum of the desired quantity over all PFTs whose @@ -108,18 +108,18 @@ types (PFTs) plus bare ground (:numref:`Table Plant functional types`). An additional PFT is added if the irrigation model is active and six additional PFTs are added if the crop model is active (Chapter :numref:`rst_Crops and Irrigation`). These -plant types differ -in leaf and stem optical properties that determine reflection, -transmittance, and absorption of solar radiation (Table 3.1), root +plant types differ in leaf and stem optical properties that determine reflection, +transmittance, and absorption of solar radiation (:numref:`Table Plant functional type optical properties`), root distribution parameters that control the uptake of water from the soil -(Table 8.3), aerodynamic parameters that determine resistance to heat, -moisture, and momentum transfer (Table 5.1), and photosynthetic +(:numref:`Table Plant functional type root distribution parameters`), aerodynamic parameters that determine resistance to heat, +moisture, and momentum transfer (:numref:`Table Plant functional type aerodynamic parameters`), and photosynthetic parameters that determine stomatal resistance, photosynthesis, and -transpiration (Tables 8.1, 8.2). The composition and abundance of PFTs +transpiration (:numref:`Table Plant functional type (PFT) photosynthetic parameters`, +:numref:`Table Temperature dependence parameters for C3 photosynthesis`). The composition and abundance of PFTs within a grid cell can either be prescribed as time-invariant fields (e.g., using the present day dataset described in section 21.3.3) or can evolve with time if the model is run in transient landcover mode -(Chapter 21). +(Chapter :numref:`rst_Transient Landcover Change`). .. _Table Plant functional types: @@ -264,11 +264,12 @@ When the biogeochemistry model is inactive, leaf and stem area indices (m\ :sup:`2` leaf area m\ :sup:`-2` ground area) are updated daily by linearly interpolating between monthly values. Monthly PFT leaf area index values are developed from the 1-km MODIS-derived monthly grid -cell average leaf area index of Myneni et al. (2002), as described in -Lawrence and Chase (2007). Stem area index is calculated from the -monthly PFT leaf area index using the methods of Zeng et al. (2002). The -leaf and stem area indices are adjusted for vertical burying by snow -(Wang and Zeng 2009) as +cell average leaf area index of :ref:`Myneni et al. (2002) `, +as described in :ref:`Lawrence and Chase (2007) `. Stem area +ndex is calculated from the monthly PFT leaf area index using the methods of +:ref:`Zeng et al. (2002) `. The leaf and stem area indices are +adjusted for vertical burying by snow (:ref:`Wang and Zeng 2009 `) +as .. math:: :label: 2.1 @@ -285,10 +286,110 @@ snow, :math:`A` is the remaining exposed leaf or stem area, {f_{veg}^{sno} = \frac{z_{sno} -z_{bot} }{z_{top} -z_{bot} } \qquad {\rm for\; tree\; and\; shrub}} \\ {f_{veg}^{sno} = \frac{\min \left(z_{sno} ,\, z_{c} \right)}{z_{c} } \qquad {\rm for\; grass\; and\; crop}} -where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, :math:`z_{sno}` is the depth of snow (m) (section 7.2), and -:math:`z_{c} = 0.2` is the snow depth when short vegetation is assumed to be completely buried by snow (m). For numerical reasons, exposed leaf -and stem area are set to zero if less than 0.05. If the sum of exposed leaf and stem area is zero, then the surface is treated as snow-covered -ground. +where :math:`z_{sno} -z_{bot} \ge 0,{\rm \; }0\le f_{veg}^{sno} \le 1`, :math:`z_{sno}` is the depth of snow (m) +(Chapter :numref:`rst_Snow Hydrology`), and :math:`z_{c} = 0.2` is the snow depth when short vegetation is assumed to +be completely buried by snow (m). For numerical reasons, exposed leaf and stem area are set to zero if less than +0.05. If the sum of exposed leaf and stem area is zero, then the surface is treated as snow-covered ground. + +.. _Vertical Discretization: + +Vertical Discretization +---------------------------- +.. + (this was taken from Initialization; is it still needed? + Vegetated and glacier land units have fifteen vertical layers, while + lakes have ten. For soil points, temperature calculations are done over + all layers, :math:`N_{levgrnd} =15`, while hydrology calculations are + done over the top ten layers, :math:`N_{levsoi} =10`, the bottom five + layers being specified as bedrock. + +.. _Soil Layers: + +Soil Layers +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The soil column can be discretized into an arbitrary number of layers. The default +vertical discretization (:numref:`Table Soil layer structure`) uses +:math:`N_{levgrnd} = 25` layers, of which :math:`N_{levsoi} = 20` are hydrologically and +biogeochemically active. The deepest 5 layers are only included in the thermodynamical +calculations (:ref:`Lawrence et al. 2008 `) described in Chapter +:numref:`rst_Soil and Snow Temperatures`. + +The layer structure of the soil is described by the node depth, :math:`z_{i}` +(m), the thickness of each layer, :math:`\Delta z_{i}` (m), and the depths +at the layer interfaces :math:`z_{h,\, i}` (m). + +.. _Table Soil layer structure: + +.. table:: Soil layer structure + + +---------------+------------------+------------------------+------------------------+ + | Layer | :math:`z_{i}` | :math:`\Delta z_{i}` | :math:`z_{h,\, i}` | + +===============+==================+========================+========================+ + | 1 | 0.010 | 0.020 | 0.020 | + +---------------+------------------+------------------------+------------------------+ + | 2 | 0.040 | 0.040 | 0.060 | + +---------------+------------------+------------------------+------------------------+ + | 3 | 0.090 | 0.060 | 0.120 | + +---------------+------------------+------------------------+------------------------+ + | 4 | 0.160 | 0.080 | 0.200 | + +---------------+------------------+------------------------+------------------------+ + | 5 | 0.260 | 0.120 | 0.320 | + +---------------+------------------+------------------------+------------------------+ + | 6 | 0.400 | 0.160 | 0.480 | + +---------------+------------------+------------------------+------------------------+ + | 7 | 0.580 | 0.200 | 0.680 | + +---------------+------------------+------------------------+------------------------+ + | 8 | 0.800 | 0.240 | 0.920 | + +---------------+------------------+------------------------+------------------------+ + | 9 | 1.060 | 0.280 | 1.200 | + +---------------+------------------+------------------------+------------------------+ + | 10 | 1.360 | 0.320 | 1.520 | + +---------------+------------------+------------------------+------------------------+ + | 11 | 1.700 | 0.360 | 1.880 | + +---------------+------------------+------------------------+------------------------+ + | 12 | 2.080 | 0.400 | 2.280 | + +---------------+------------------+------------------------+------------------------+ + | 13 | 2.500 | 0.440 | 2.720 | + +---------------+------------------+------------------------+------------------------+ + | 14 | 2.990 | 0.540 | 3.260 | + +---------------+------------------+------------------------+------------------------+ + | 15 | 3.580 | 0.640 | 3.900 | + +---------------+------------------+------------------------+------------------------+ + | 16 | 4.270 | 0.740 | 4.640 | + +---------------+------------------+------------------------+------------------------+ + | 17 | 5.060 | 0.840 | 5.480 | + +---------------+------------------+------------------------+------------------------+ + | 18 | 5.950 | 0.940 | 6.420 | + +---------------+------------------+------------------------+------------------------+ + | 19 | 6.940 | 1.040 | 7.460 | + +---------------+------------------+------------------------+------------------------+ + | 20 | 8.030 | 1.140 | 8.600 | + +---------------+------------------+------------------------+------------------------+ + | 21 | 9.795 | 2.390 | 10.990 | + +---------------+------------------+------------------------+------------------------+ + | 22 | 13.328 | 4.676 | 15.666 | + +---------------+------------------+------------------------+------------------------+ + | 23 | 19.483 | 7.635 | 23.301 | + +---------------+------------------+------------------------+------------------------+ + | 24 | 28.871 | 11.140 | 34.441 | + +---------------+------------------+------------------------+------------------------+ + | 25 | 41.998 | 15.115 | 49.556 | + +---------------+------------------+------------------------+------------------------+ + +Layer node depth (:math:`z_{i}` ), thickness (:math:`\Delta z_{i}` ), and depth at +layer interface (:math:`z_{h,\, i}` ) for default soil column. All in meters. + +.. _Depth to Bedrock: + +Depth to Bedrock +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The hydrologically and biogeochemically active portion of the soil column can be +restricted to a thickness less than that of the maximum soil depth. By providing +a depth-to-bedrock dataset, which may vary spatially, the number of layers used +in the hydrologic and biogeochemical calculations, :math:`N_{bedrock}`, may be +specified, subject to the constraint :math:`N_{bedrock} \le N_{levsoi}` .. _Model Input Requirements: @@ -363,7 +464,8 @@ conditions from the current time step. atmospheric model :math:`z'_{atm}` is assumed to be the height above the surface as defined by the roughness length :math:`z_{0}` plus displacement height :math:`d`. Thus, the reference height used for flux -computations (Chapter 5) is :math:`z_{atm} =z'_{atm} +z_{0} +d`. The +computations (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) +is :math:`z_{atm} =z'_{atm} +z_{0} +d`. The reference heights for temperature, wind, and specific humidity (:math:`z_{atm,\, h}` , :math:`z_{atm,\, {\it m}}` , :math:`z_{atm,\, w}` ) are required. These are set equal @@ -396,7 +498,7 @@ sea-surface temperatures and emissions (Lamarque et al. 2010) for short-lived gases and aerosols; observed concentrations were specified for methane, N\ :sub:`2`\ O, the ozone-depleting substances (CFCs) ,and CO\ :sub:`2`. The fluxes are used by the snow-related -parameterizations (Chapters 3 and 7). +parameterizations (Chapters :numref:`rst_Surface Albedos` and numref:`rst_Snow Hydrology`). :sup:`4`\ The nitrogen deposition rate is required by the biogeochemistry model when active and represents the total deposition of @@ -503,11 +605,7 @@ fields that are required from the restart or initial conditions files can be obtained by examining the code. Arbitrary initial conditions are specified as follows. -Vegetated and glacier land units have fifteen vertical layers, while -lakes have ten. For soil points, temperature calculations are done over -all layers, :math:`N_{levgrnd} =15`, while hydrology calculations are -done over the top ten layers, :math:`N_{levsoi} =10`, the bottom five -layers being specified as bedrock. Soil points are initialized with +Soil points are initialized with surface ground temperature :math:`T_{g}` and soil layer temperature :math:`T_{i}` , for :math:`i=1,\ldots ,N_{levgrnd}` , of 274 K, vegetation temperature :math:`T_{v}` of 283 K, no snow or canopy water @@ -624,9 +722,10 @@ The percentage glacier mask was derived from vector data of global glacier and ice sheet spatial coverage. Vector data for glaciers (ice caps, icefields and mountain glaciers) were taken from the first globally complete glacier inventory, the Randolph Glacier Inventory -version 1.0 (RGIv1.0: Arendt et al. 2012). Vector data for the Greenland -Ice Sheet were provided by Frank Paul and Tobias Bolch (University of -Zurich: Rastner et al. 2012). Antarctic Ice Sheet data were provided by +version 1.0 (RGIv1.0: :ref:`Arendt et al. 2012 `). +Vector data for the Greenland Ice Sheet were provided by Frank Paul and +Tobias Bolch (University of Zurich: :ref:`Rastner et al. 2012 `). +Antarctic Ice Sheet data were provided by Andrew Bliss (University of Alaska) and were extracted from the Scientific Committee on Antarctic Research (SCAR) Antarctic Digital Database version 5.0. Floating ice is only provided for the Antarctic @@ -651,75 +750,80 @@ elevation are needed when running CLM4 with multiple glacier elevation classes. Percent lake and lake depth are area-averaged from the 90-second -resolution data of Kourzeneva (2009, 2010) to the 0.05\ :sup:`o` +resolution data of :ref:`Kourzeneva (2009, 2010) ` to the 0.05\ :sup:`o` resolution using the MODIS land-mask. Percent urban is derived from LandScan 2004, a population density dataset derived from census data, nighttime lights satellite observations, road proximity and slope -(Dobson et al. 2000) as described by Jackson et al. (2010) at 1km +(:ref:`Dobson et al. 2000 `) as described by +:ref:`Jackson et al. (2010) ` at 1km resolution and aggregated to 0.05\ :sup:`o`. A number of urban radiative, thermal, and morphological fields are also required and are -obtained from Jackson et al. (2010). Their description can be found in -Table 3 of the Community Land Model Urban (CLMU) technical note (Oleson -et al. 2010b). +obtained from :ref:`Jackson et al. (2010) `. Their description can be found in +Table 3 of the Community Land Model Urban (CLMU) technical note (:ref:`Oleson +et al. 2010b `). Percent PFTs are derived from MODIS satellite data as described in -Lawrence and Chase (2007) (section 21.3.3). Prescribed PFT leaf area -index is derived from the MODIS satellite data of Myneni et al. (2002) -using the de-aggregation methods described in Lawrence and Chase (2007) +:ref:`Lawrence and Chase (2007) ` (section 21.3.3). +Prescribed PFT leaf area index is derived from the MODIS satellite data of +:ref:`Myneni et al. (2002) ` using the de-aggregation methods +described in :ref:`Lawrence and Chase (2007) ` (section 2.2.3). Prescribed PFT stem area index is derived from PFT leaf -area index phenology combined with the methods of Zeng et al. (2002). -Prescribed canopy top and bottom heights are from Bonan (1996) as -described in Bonan et al. (2002b). If the biogeochemistry model is +area index phenology combined with the methods of :ref:`Zeng et al. (2002) `. +Prescribed canopy top and bottom heights are from :ref:`Bonan (1996) ` as +described in :ref:`Bonan et al. (2002b) `. If the biogeochemistry model is active, it supplies the leaf and stem area index and canopy top and bottom heights dynamically, and the prescribed values are ignored. -Soil color determines dry and saturated soil albedo (section 3.2). Soil -colors are from Lawrence and Chase (2007) (section 3.2). +Soil color determines dry and saturated soil albedo (section :numref:`Ground Albedos`). +Soil colors are from :ref:`Lawrence and Chase (2007) `. The soil texture and organic matter content determine soil thermal and hydrologic properties (sections 6.3 and 7.4.1). The International Geosphere-Biosphere Programme (IGBP) soil dataset (Global Soil Data Task 2000) of 4931 soil mapping units and their sand and clay content for each soil layer were used to create a mineral soil texture dataset -(Bonan et al. 2002b). Soil organic matter data is merged from two -sources. The majority of the globe is from ISRIC-WISE (Batjes, 2006). +:ref:`(Bonan et al. 2002b) `. Soil organic matter data is merged from two +sources. The majority of the globe is from ISRIC-WISE (:ref:`Batjes, 2006 `). The high latitudes come from the 0.25\ :sup:`o` version of the -Northern Circumpolar Soil Carbon Database (Hugelius et al. 2012). Both +Northern Circumpolar Soil Carbon Database (:ref:`Hugelius et al. 2012 `). Both datasets report carbon down to 1m depth. Carbon is partitioned across -the top seven CLM4 layers (:math:`\sim`\ 1m depth) as in Lawrence and -Slater (2008). +the top seven CLM4 layers (:math:`\sim`\ 1m depth) as in +:ref:`Lawrence and Slater (2008) `. The maximum fractional saturated area (:math:`f_{\max }` ) is used in determining surface runoff and infiltration (section 7.3). Maximum fractional saturated area at 0.125\ :sup:`o` resolution is calculated from 1-km compound topographic indices (CTIs) based on the -USGS HYDRO1K dataset (Verdin and Greenlee 1996) following the algorithm -in Niu et al. (2005). :math:`f_{\max }` is the ratio between the number +USGS HYDRO1K dataset (:ref:`Verdin and Greenlee 1996 `) +following the algorithm in :ref:`Niu et al. (2005) `. +:math:`f_{\max }` is the ratio between the number of 1-km pixels with CTIs equal to or larger than the mean CTI and the total number of pixels in a 0.125\ :sup:`o` grid cell. See -section 7.3.1 and Li et al. (2013b) for further details. Slope and -elevation are also obtained from the USGS HYDRO1K 1-km dataset (Verdin -and Greenlee 1996). Slope is used in the River Transport Model (Chapter -11) and in the surface water parameterization (section 7.3.2), and +section 7.3.1 and :ref:`Li et al. (2013b) ` for further details. Slope and +elevation are also obtained from the USGS HYDRO1K 1-km dataset +(:ref:`Verdin and Greenlee 1996 `). Slope is used in the +surface water parameterization (section :numref:`Surface Water Storage`), and elevation is used to calculate the grid cell standard deviation of -topography for the snow cover fraction parameterization (section 7.2.1). +topography for the snow cover fraction parameterization (section :numref:`Snow Covered Area Fraction`). Biogenic Volatile Organic Compounds emissions factors are from the Model of Emissions of Gases and Aerosols from Nature version 2.1 (MEGAN2.1; -Guenther et al. 2012). +:ref:`Guenther et al. 2012 `). The default list of PFTs includes an unmanaged crop treated as a second C3 grass (:numref:`Table Plant functional types`). The unmanaged crop has grid cell fractional cover -assigned from MODIS satellite data (Lawrence and Chase 2007). A managed +assigned from MODIS satellite data (:ref:`Lawrence and Chase (2007) `). A managed crop option uses grid cell fractional cover from the present-day crop -dataset of Ramankutty and Foley (1998) (CLM4CNcrop). Managed crops are -assigned in the proportions given by Ramankutty and Foley (1998) without +dataset of :ref:`Ramankutty and Foley (1998) ` +(CLM4CNcrop). Managed crops are assigned in the proportions given by +:ref:`Ramankutty and Foley (1998) ` without exceeding the area previously assigned to the unmanaged crop. The unmanaged crop continues to occupy any of its original area that remains and continues to be handled just by the CN part of CLM4CNcrop. The managed crop types (corn, soybean, and temperate cereals) were chosen based on the availability of corresponding algorithms in AgroIBIS -(Kucharik et al. 2000; Kucharik and Brye 2003). Temperate cereals +(:ref:`Kucharik et al. 2000 `; +:ref:`Kucharik and Brye 2003 `). Temperate cereals include wheat, barley, and rye here. All temperate cereals are treated as summer crops (like spring wheat, for example) at this time. Winter cereals (such as winter wheat) may be introduced in a future version of @@ -737,10 +841,11 @@ management between crops. CLM includes the option to irrigate cropland areas that are equipped for irrigation. The application of irrigation responds dynamically to climate (see Chapter :numref:`rst_Crops and Irrigation`). In CLM, irrigation is -implemented for the C3 -generic crop only. When irrigation is enabled, the cropland area of each -grid cell is divided into an irrigated and unirrigated fraction -according to a dataset of areas equipped for irrigation (:ref:`Siebert et al. (2005) `). The area of irrigated cropland in each grid cell is given by the +implemented for the C3 generic crop only. When irrigation is enabled, the +cropland area of each grid cell is divided into an irrigated and unirrigated +fraction according to a dataset of areas equipped for irrigation +(:ref:`Siebert et al. (2005) `). The area of irrigated +cropland in each grid cell is given by the smaller of the grid cell’s total cropland area, according to the default CLM4 dataset, and the grid cell’s area equipped for irrigation. The remainder of the grid cell’s cropland area (if any) is then assigned to @@ -757,18 +862,18 @@ Database of the Global Environment version 3.1 (HYDEv3.1) with 0.5\ :sup:`o` resolution population density data for 1990, 1995, 2000, and 2005 from the Gridded Population of the World version 3 dataset (GPWv3) (CIESIN, 2005). Gross Domestic Production (GDP) per -capita in 2000 at 0.5\ :sup:`o` is from Van Vuuren et al. (2006), +capita in 2000 at 0.5\ :sup:`o` is from :ref:`Van Vuuren et al. (2006) `, which is the base-year GDP data for IPCC-SRES and derived from country-level World Bank’s World Development Indicators (WDI) measured -in constant 1995 US$ (World Bank, 2004) and the UN Statistics Database -(UNSTAT, 2005). The peatland area fraction at 0.5\ :sup:`o` +in constant 1995 US$ (:ref:`World Bank, 2004 `) and the UN Statistics Database +(:ref:`UNSTAT, 2005 `). The peatland area fraction at 0.5\ :sup:`o` resolution is derived from three vector datasets: peatland data in -Indonesia and Malaysian Borneo (Olson et al. 2001); peatland data in -Canada (Tarnocai et al. 2011); and bog, fen and mire data in boreal +Indonesia and Malaysian Borneo (:ref:`Olson et al. 2001 `); peatland data in +Canada (:ref:`Tarnocai et al. 2011 `); and bog, fen and mire data in boreal regions (north of 45\ :sup:`o`\ N) outside Canada provided by the -Global Lakes and Wetlands Database (GLWD) (Lehner and Döll, 2004). The -climatological peak month for agricultural waste burning is from van der -Werf et al. (2010). +Global Lakes and Wetlands Database (GLWD) (:ref:`Lehner and Döll, 2004 `). The +climatological peak month for agricultural waste burning is from :ref:`van der +Werf et al. (2010) `. .. _Adjustable Parameters and Physical Constants: diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 0bfdaf6217..0d8d213cb4 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -612,7 +612,7 @@ The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with refe .. math:: :label: 5.67 - E_{soil} =-\frac{\beta _{soi} \rho _{atm} \left(q_{atm} -q_{soil} \right)}{r_{aw} } + E_{soil} =-\frac{\rho _{atm} \left(q_{atm} -q_{soil} \right)}{r_{aw} + r_{soil}} .. math:: :label: 5.68 @@ -624,11 +624,11 @@ The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with refe E_{h2osfc} =-\frac{\rho _{atm} \left(q_{atm} -q_{h2osfc} \right)}{r_{aw} } -where :math:`\beta _{soi}` is an empirical function of soil water (Sakaguchi and Zeng 2009), :math:`q_{atm}` is the atmospheric specific -humidity (kg kg\ :sup:`-1`), :math:`q_{soil}` , :math:`q_{sno}` , and :math:`q_{h2osfc}` are the specific humidities -(kg kg\ :sup:`-1`) of the soil, snow, and surface water, respectively, and :math:`r_{aw}` is the aerodynamic resistance to water vapor -transfer (s m\ :sup:`-1`). The specific humidities of the snow :math:`q_{sno}` and surface water :math:`q_{h2osfc}` are assumed to be -at the saturation specific humidity of their respective temperatures +where :math:`q_{atm}` is the atmospheric specific humidity (kg kg\ :sup:`-1`), :math:`q_{soil}` , :math:`q_{sno}` , +and :math:`q_{h2osfc}` are the specific humidities (kg kg\ :sup:`-1`) of the soil, snow, and surface water, respectively, +:math:`r_{aw}` is the aerodynamic resistance to water vapor transfer (s m\ :sup:`-1`), and :math:`r _{soi}` is the soil +resistance to water vapor transfer (s m\ :sup:`-1`). The specific humidities of the snow :math:`q_{sno}` and surface water +:math:`q_{h2osfc}` are assumed to be at the saturation specific humidity of their respective temperatures .. math:: :label: 5.70) @@ -692,37 +692,71 @@ top soil layer (kg m\ :sup:`-2`) (Chapter :numref:`rst_Hydrology`), and prevents large increases (decreases) in :math:`q_{soil}` for small increases (decreases) in soil moisture in very dry soils. -The function :math:`\beta _{soi}` ranges from 0 to 1 and is intended to -represent the molecular diffusion process from the soil pore to the -surface within the dry part of the soil (Sakaguchi and Zeng 2009) as +The resistance to water vapor transfer occurring within the soil matrix +:math:`r_{soil}` is .. math:: :label: 5.76) - \beta _{soi} =\left\{\begin{array}{l} {1\qquad \theta _{1} \ge \theta _{fc,\, 1} {\rm \; or\; }q_{atm} -q_{soil} >0} \\ {0.25\left(1-f_{sno} -f_{h2osfc} \right)\left[1-\cos \left(\pi \frac{\theta _{1} }{\theta _{fc,\, 1} } \right)\right]^{2} +f_{sno} +f_{h2osfc} \qquad \theta _{1} <\theta _{fc,\, 1} } \end{array}\right\}. + r_{soil} = \frac{DSL}{D_{v} \tau} -where :math:`\theta _{fc,\, 1}` is the field capacity of the top soil -layer and -:math:`0.01{\le \theta _{1} \mathord{\left/ {\vphantom {\le \theta _{1} \theta _{fc,\, 1} \le 1}} \right. \kern-\nulldelimiterspace} \theta _{fc,\, 1} \le 1}` . -The volumetric water content of the top soil layer (mm\ :sup:`3` mm\ :sup:`-3`) is +where :math:`DSL` is the thickness of the dry surface layer, :math:`D_{v}` +is the molecular diffusivity of water vapor in air and :math:`\tau` +describes the tortuosity of the vapor flow paths through +the soil matrix (:ref:`Swenson and Lawrence 2014 `). + +The thickness of the dry surface layer is given by + +.. math:: + :label: 5.77) + + DSL = + \begin{array}{lr} + D_{max} \ \frac{\left( \theta_{init} - \theta_{1}\right)} + {\left(\theta_{init} - \theta_{air}\right)} & \qquad \theta_{1} < \theta_{init} \\ + 0 & \qquad \theta_{1} \ge \theta_{init} + \end{array} + +where :math:`D_{max}` is a parameter specifying the length scale +of the maximum DSL thickness (default value = 15 mm), +:math:`\theta_{init}` is the moisture value at which the DSL initiates, +:math:`\theta_{1}` is the moisture value of the top model soil layer, +and :math:`\theta_{air}` is the 'air dry' soil moisture value +(:ref:`Dingman 2002 `): + +.. math:: + :label: 5.78) + + \theta_{air} = \Phi \left( \frac{\Psi_{sat}}{\Psi_{air}} \right)^{\frac{1}{B_{1}}} \ . + +where :math:`\Phi` is the porosity, :math:`\Psi_{sat}` is the saturated +soil matric potential, :math:`\Psi_{air} = 10^{7}` mm is the air dry +matric potential, and :math:`B_{1}` is a function of soil texture (section +:numref:`Hydraulic Properties`). + +The soil tortuosity is + +.. math:: + :label: 5.79) + + \tau = \Phi^{2}_{air}\left(\frac{\Phi_{air}}{\Phi}\right)^{\frac{3}{B_{1}}} + +where :math:`\Phi_{air}` is the air filled pore space .. math:: - :label: 5.77) + :label: 5.80) - \theta _{1} =\frac{1}{\Delta z_{1} } \left[\frac{w_{liq,\, 1} }{\rho _{liq} } +\frac{w_{ice,\, 1} }{\rho _{ice} } \right]. + \Phi_{air} = \Phi - \theta_{air} \ . -The volumetric water content at field capacity is derived by assuming a -hydraulic conductivity of 0.1 mm day\ :sup:`-1` and inverting the -hydraulic conductivity function (section :numref:`Hydraulic Properties`) as +:math:`D_{v}` depends on temperature .. math:: - :label: 5.78) + :label: 5.81) - \theta _{fc,\, 1} =\theta _{sat,\, 1} \left[\frac{0.1}{86400k_{sat,\, 1} } \right]^{\frac{1}{2B_{i} +3} } + D_{v} = 2.12 \times 10^{-5} \left(\frac{T_{1}}{T_{f}}\right)^{1.75} \ . -where :math:`k_{sat,\, 1}` is the saturated hydraulic conductivity of -the top soil layer (mm s\ :sup:`-1`) (section :numref:`Hydraulic Properties`) and the -exponent :math:`B_{1}` is a function of soil texture (section :numref:`Hydraulic Properties`). +where :math:`T_{1}` is the temperature of the top soil layer and +:math:`T_{f}` is the freezing temperature of water (:numref:`Table Physical Constants`). The roughness lengths used to calculate :math:`r_{am}` , :math:`r_{ah}` , and :math:`r_{aw}` are :math:`z_{0m} =z_{0m,\, g}` , @@ -942,7 +976,7 @@ are the sensible heat conductances from the canopy air to the atmosphere, the ground to canopy air, and leaf surface to canopy air, respectively (m s\ :sup:`-1`). -When the expression for :math:`T_{s}` is substituted into equation , +When the expression for :math:`T_{s}` is substituted into equation :eq:`ZEqnNum675188`, the sensible heat flux from vegetation :math:`H_{v}` is a function of :math:`\theta _{atm}` , :math:`T_{g}` , and :math:`T_{v}` diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index f850a383b4..e6f45af8ff 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -25,7 +25,7 @@ where :math:`q_{rain}` is the liquid part of precipitation, ET from vegetation (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`E_{g}` is ground evaporation (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`q_{over}` is surface runoff (section :numref:`Surface Runoff`), :math:`q_{h2osfc}` is runoff from surface water storage (section :numref:`Surface Runoff`), -:math:`q_{drai}` is sub-surface drainage (section 7.6), +:math:`q_{drai}` is sub-surface drainage (section :numref:`Lateral Sub-surface Runoff`), :math:`q_{rgwl}` and :math:`q_{snwcp,ice}` are liquid and solid runoff from glaciers, wetlands, and lakes, and runoff from other surface types due to snow capping (section :numref:`Runoff from glaciers and snow-capped surfaces`) (all in kg m\ :sup:`-2` @@ -140,14 +140,22 @@ calculations is (:ref:`Dickinson et al.1993 `) .. math:: :label: 7.12) - f_{wet} =\left\{\begin{array}{l} {\left[\frac{W_{can} }{p\left(L+S\right)} \right]^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \le 1\qquad L+S>0} \\ {0\qquad L+S=0} \end{array}\right\} + f_{wet} = + \left\{\begin{array}{lr} + \left[\frac{W_{can} }{p\left(L+S\right)} \right]^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \le 1 & \qquad L+S > 0 \\ + 0 &\qquad L+S = 0 + \end{array}\right\} while the fraction of the canopy that is dry and transpiring is .. math:: :label: 7.13) - f_{dry} =\left\{\begin{array}{l} {\frac{\left(1-f_{wet} \right)L}{L+S} \qquad L+S>0} \\ {0\qquad L+S=0} \end{array}\right\}. + f_{dry} = + \left\{\begin{array}{lr} + \frac{\left(1-f_{wet} \right)L}{L+S} & \qquad L+S > 0 \\ + 0 &\qquad L+S = 0 + \end{array}\right\}. .. _Surface Runoff, Surface Water Storage, and Infiltration: @@ -271,7 +279,7 @@ portion of the grid cell that is interconnected .. math:: :label: 7.69) - \begin{array}{l} {f_{connected} =\left(f_{h2osfc} -f_{c} \right)^{\mu } \qquad for\, f_{h2osfc} >f_{c} } \\ {f_{connected} =0\qquad \qquad \qquad for\, f_{h2osfc} \le f_{c} } \end{array} + \begin{array}{lr} f_{connected} =\left(f_{h2osfc} -f_{c} \right)^{\mu } & \qquad f_{h2osfc} >f_{c} \\ f_{connected} =0 &\qquad f_{h2osfc} \le f_{c} \end{array} where :math:`f_{c}` is a threshold below which no single connected inundated area spans the grid cell and :math:`\mu` is a scaling @@ -316,7 +324,7 @@ s\ :sup:`-1`), q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat where :math:`{\rm \Theta }ice` is an ice impedance factor (section -7.4), infiltration excess (Hortonian) runoff is generated +:numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff is generated .. math:: :label: 7.73) @@ -370,11 +378,10 @@ Soil Water Soil water is predicted from a multi-layer model, in which the vertical soil moisture transport is governed by infiltration, surface and -sub-surface runoff, gradient diffusion, gravity, canopy transpiration -through root extraction, and interactions with groundwater -(:numref:`Hydrologic processes figure`). +sub-surface runoff, gradient diffusion, gravity, and canopy transpiration +through root extraction (:numref:`Hydrologic processes figure`). The following derivation generally follows that of :ref:`Z.-L. Yang (1998, -unpublished manuscript) ` with modifications by Zeng and Decker (2009). +unpublished manuscript) `. For one-dimensional vertical water flow in soils, the conservation of mass is stated as @@ -394,11 +401,12 @@ of soil s\ :sup:`-1`) (ET loss). This equation is solved numerically by dividing the soil column into multiple layers in the vertical and integrating downward over each layer with an upper boundary condition of the infiltration flux into the top soil layer -:math:`q_{infl}` and a lower boundary condition that depends on the -depth of the water table. +:math:`q_{infl}` and a zero-flux lower boundary condition at the +bottom of the soil column (sub-surface runoff is removed later in the +timestep, section :numref:`Lateral Sub-surface Runoff`). The soil water flux :math:`q` in equation can be described by Darcy’s -law +law :ref:`(Dingman 2002) ` .. math:: :label: 7.80) @@ -427,57 +435,20 @@ becomes q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. -Darcy’s equation can be further manipulated to yield +Equation :eq:`ZEqnNum186573` can be further manipulated to yield .. math:: :label: 7.83) q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). -Substitution of this equation into equation , with :math:`Q=0`, yields +Substitution of this equation into equation :eq:`ZEqnNum790844`, with :math:`Q=0`, yields the Richards equation .. math:: :label: ZEqnNum670361 - \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } \right)+1\right]. - -Zeng and Decker (2009) note that this :math:`\theta` -based form of the -Richards equation cannot maintain the hydrostatic equilibrium soil -moisture distribution because of the truncation errors of the -finite-difference numerical scheme. They show that this deficiency can -be overcome by subtracting the equilibrium state from equation as - -.. math:: - :label: ZEqnNum936839 - - q=-k\left[\frac{\partial \left(\psi +z-C\right)}{\partial z} \right] - -where :math:`C` is a constant hydraulic potential above the water table -:math:`z_{\nabla }` - -.. math:: - :label: ZEqnNum126975 - - C=\psi _{E} +z=\psi _{sat} \left[\frac{\theta _{E} \left(z\right)}{\theta _{sat} } \right]^{-B} +z=\psi _{sat} +z_{\nabla } - -so that - -.. math:: - :label: ZEqnNum537733 - - q=-k\left[\frac{\partial \left(\psi -\psi _{E} \right)}{\partial z} \right] - -where :math:`\psi _{E}` \ is the equilibrium soil matric potential -(mm). Substitution of equations and into equation yields Zeng and -Decker’s (2009) modified Richards equation - -.. math:: - :label: 7.88) - - \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \left(\psi -\psi _{E} \right)}{\partial z} \right)\right]-Q - -where the soil moisture sink term :math:`Q` is now included. + \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right)\right]. .. _Hydraulic Properties: @@ -487,7 +458,7 @@ Hydraulic Properties The hydraulic conductivity :math:`k_{i}` (mm s\ :sup:`-1`) and the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` vary with volumetric soil water :math:`\theta _{i}` and soil texture. -As with the soil thermal properties (section 6.3) the hydraulic +As with the soil thermal properties (section :numref:`Soil And Snow Thermal Properties`) the hydraulic properties of the soil are assumed to be a weighted combination of the mineral properties, which are determined according to sand and clay contents based on work by :ref:`Clapp and Hornberger (1978) @@ -506,14 +477,18 @@ moisture of the two layers :math:`\theta _{i}` and .. math:: :label: ZEqnNum398074 - k\left[z_{h,\, i} \right]=\left\{\begin{array}{l} {\Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} \qquad 1\le i\le N_{levsoi} -1} \\ {\Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} \qquad i=N_{levsoi} } \end{array}\right\}. + k\left[z_{h,\, i} \right] = + \left\{\begin{array}{lr} + \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ + \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} + \end{array}\right\}. The ice impedance factor is a function of ice content, and is meant to quantify the increased tortuosity of the water flow when part of the pore space is filled with ice. :ref:`Swenson et al. (2012) ` -used a power law form :math:`\Theta _{ice} =10^{-\Omega F_{ice} }` where -:math:`\Omega =6`\ and -:math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the +used a power law form :math:`\Theta _{ice} = 10^{-\Omega F_{ice} }` where +:math:`\Omega = 6`\ and +:math:`F_{ice} = \frac{\theta_{ice} }{\theta_{sat} }` is the ice-filled fraction of the pore space. Because the hydraulic properties of mineral and organic soil may differ @@ -535,16 +510,16 @@ porosity of organic matter and the porosity of the mineral soil .. math:: :label: 7.91) - \theta _{sai,\min ,i} =0.489-0.00126(\% sand)_{i} . + \theta _{sai,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . -The exponent “:math:`B`†is +The exponent :math:`B_{i}` is .. math:: :label: 7.92) B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} -where :math:`B_{om} =2.7`\ (:ref:`Letts et al. 2000 `) and +where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and .. math:: :label: 7.93) @@ -566,7 +541,7 @@ where the saturated soil matric potential (mm) is \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} -where :math:`\psi _{sat,om} =-10.3`\ mm (Letts et al. 2000) is the +where :math:`\psi _{sat,om} = -10.3` \ mm (:ref:`Letts et al. 2000 `) is the saturated organic matter matric potential and the saturated mineral soil matric potential :math:`\psi _{sat,\min ,i}` \ is @@ -586,9 +561,9 @@ as 1 %. To better represent the influence of organic soil material on the grid cell average saturated hydraulic conductivity, the soil organic matter fraction is further subdivided into “connected†and “unconnected†fractions using a result from percolation theory (:ref:`Stauffer and Aharony -1994 `, :ref:`Berkowitz and Balberg 1992 `). Assuming that the organic and mineral -fractions are randomly distributed throughout a soil layer, percolation -theory predicts that above a threshold value +1994 `, :ref:`Berkowitz and Balberg 1992 `). +Assuming that the organic and mineral fractions are randomly distributed throughout +a soil layer, percolation theory predicts that above a threshold value :math:`f_{om} =f_{threshold}` , connected flow pathways consisting of organic material only exist and span the soil space. Flow through these pathways interacts only with organic material, and thus can be described @@ -597,7 +572,10 @@ by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by .. math:: :label: 7.97) - \begin{array}{l} {f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta _{perc} } f_{om} {\rm \; }\qquad f_{om} \ge f_{threshold} } \\ {f_{perc} =0\qquad f_{om} `) as +texture (:ref:`Cosby et al. 1984 `) as .. math:: :label: 7.99) @@ -633,7 +611,7 @@ Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ With reference to :numref:`Water flux schematic figure`, the equation for conservation of mass -(equation ) can be integrated over each layer as +(equation :eq:`ZEqnNum790844`) can be integrated over each layer as .. math:: :label: 7.101) @@ -777,8 +755,7 @@ where r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . The tridiagonal equation set is solved over -:math:`i=1,\ldots ,N_{levsoi} +1` where the layer -:math:`i=N_{levsoi} +1` is a virtual layer representing the aquifer. +:math:`i=1,\ldots ,N_{levsoi}`. The finite-difference forms of the fluxes and partial derivatives in equations - can be obtained from equation as @@ -847,90 +824,6 @@ derived from equation \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. -Equilibrium soil matric potential and volumetric moisture -''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -The equilibrium soil matric potential :math:`\psi _{E}` can be derived -from equation as - -.. math:: - :label: ZEqnNum899028 - - \psi _{E} =\psi _{sat} \left(\frac{\theta _{E} \left(z\right)}{\theta _{sat} } \right)^{-B} - -and the equilibrium volumetric water content -:math:`\theta _{E} \left(z\right)` at depth :math:`z` can also be -derived as - -.. math:: - :label: 7.127) - - \theta _{E} \left(z\right)=\theta _{sat} \left(\frac{\psi _{sat} +z_{\nabla } -z}{\psi _{sat} } \right)^{-\frac{1}{B} } . - -Here, the soil matric potentials, the water table depth -:math:`z_{\nabla }` and the soil depths have units of mm. For the -finite-difference scheme, a layer-average equilibrium volumetric water -content is used in equation and can be obtained from - -.. math:: - :label: 7.128) - - \overline{\theta _{E,\, i} }=\int _{z_{h,\, i-1} }^{z_{h,\, i} }\frac{\theta _{E} \left(z\right)}{z_{h,\, i} -z_{h,\, i-1} } \, dz - -which when integrated yields - -.. math:: - :label: ZEqnNum445442 - - \overline{\theta _{E,\, i} }=\frac{\theta _{sat,\, i} \psi _{sat,\, i} }{\left(z_{h,\, i} -z_{h,\, i-1} \right)\left(1-\frac{1}{B_{i} } \right)} \left[\left(\frac{\psi _{sat,\, i} -z_{\nabla } +z_{h,\, i} }{\psi _{sat,\, i} } \right)^{1-\frac{1}{B_{i} } } -\left(\frac{\psi _{sat,\, i} -z_{\nabla } +z_{h,\, i-1} }{\psi _{sat,\, i} } \right)^{1-\frac{1}{B_{i} } } \right]. - -Equation is valid when the water table :math:`z_{\nabla }` is deeper -than both interface depths :math:`z_{h,\, i-1}` and -:math:`z_{h,\, i}` . Since the water table can be within the soil -column, the equation is modified if the water table is within soil layer -:math:`i` (:math:`z_{h,\, i-1} z_{h,\, N_{levsoi} }` ), an equilibrium volumetric -soil moisture is calculated for a virtual layer :math:`i=N_{levsoi} +1` -as - -.. math:: - :label: ZEqnNum235293 - - \overline{\theta _{E,\, i=N_{levsoi+1} } }=\frac{\theta _{sat,i-1} \psi _{sat,\, i-1} }{\left(z_{\nabla } -z_{h,\, i-1} \right)\left(1-\frac{1}{B_{i-1} } \right)} \left[1-\left(\frac{\psi _{sat,\, i-1} -z_{\nabla } +z_{h,\, i-1} }{\psi _{sat,\, i-1} } \right)^{1-\frac{1}{B_{i-1} } } \right] - -The equilibrium volumetric soil moisture is constrained by - -.. math:: - :label: 7.133) - - 0\le \overline{\theta _{E,\, i} }\le \theta _{sat,\, i} - -The equilibrium soil matric potential is then - -.. math:: - :label: ZEqnNum533842 - - \psi _{E,\, i} =\psi _{sat,\, i} \left(\frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad \frac{\overline{\theta _{E,\, i} }}{\theta _{sat,\, i} } \ge 0.01 - Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' @@ -993,47 +886,23 @@ The coefficients of the tridiagonal set of equations for r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . -Equation set for layers :math:`i=N_{levsoi} ,\ldots N_{levsoi} +1` +Equation set for layer :math:`i=N_{levsoi}` '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' -For the lowest soil layer (:math:`i=N_{levsoi}` ), the bottom boundary -condition depends on the depth of the water table. If the water table is -within the soil column (:math:`z_{\nabla } \le z_{h,\, N_{levsoi} }` ), -a zero-flux bottom boundary condition is applied (:math:`q_{i}^{n} =0`) +For the lowest soil layer (:math:`i=N_{levsoi}` ), a zero-flux bottom boundary +condition is applied (:math:`q_{i}^{n} =0`) and the coefficients of the tridiagonal set of equations for :math:`i=N_{levsoi}` are -.. math:: - :label: 7.144) - - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } - -.. math:: - :label: 7.145) - - b_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} - -.. math:: - :label: 7.146) - - c_{i} =0 - -.. math:: - :label: 7.147) - - r_{i} =q_{i-1}^{n} +e_{i} . - -The coefficients for the aquifer layer :math:`i=N_{levsoi} +1` are then - .. math:: :label: 7.148) - a_{i} =0 + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: :label: 7.149) - b_{i} =-\frac{\Delta z_{i} }{\Delta t} + b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: :label: 7.150) @@ -1043,83 +912,28 @@ The coefficients for the aquifer layer :math:`i=N_{levsoi} +1` are then .. math:: :label: 7.151) - r_{i} =0. + r_{i} =q_{i-1}^{n} +e_{i} . -If the water table is below the soil column -(:math:`z_{\nabla } >z_{h,\, N_{levsoi} }` ), the coefficients for -:math:`i=N_{levsoi}` are +Adaptive Time Stepping +''''''''''''''''''''''''''''' +The tridiagonal equation set is solved using an adaptive time-stepping procedure. +An initial solution is found by setting :math:`\Delta t` equal to the model time +step. An estimate of the error is calculated from .. math:: :label: 7.152) - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } - -.. math:: - :label: 7.153) - - b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} - -.. math:: - :label: 7.154) - - c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } - -.. math:: - :label: 7.155) - - r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . - -The :math:`i=N_{levsoi} +1` terms are evaluated using - -.. math:: - :label: 7.156) - - \psi _{N_{levsoi} +1} =\psi _{sat,\, N_{levsoi} } \left[s_{N_{levsoi} +1} \right]^{-B_{N_{levsoi} } } \ge -1\times 10^{8} - -.. math:: - :label: 7.157) - - z_{N_{levsoi} +1} =0.5\left(z_{\nabla } +z_{N_{levsoi} } \right) - -where - -.. math:: - :label: 7.158) - - s_{N_{levsoi} +1} =0.5\left(\frac{\theta _{sat,\, N_{levsoi} } +\theta _{N_{levsoi} } }{\theta _{sat,\, N_{levsoi} } } \right)\qquad 0.01\le s_{N_{levsoi} +1} \le 1, - -:math:`\psi _{E,\, N_{levsoi} +1}` is evaluated from equations and , - -and - -.. math:: - :label: 7.159) - - \frac{\partial \psi _{N_{levsoi} +1} }{\partial \theta _{liq,\, N_{levsoi} +1} } =-B_{N_{levsoi} } \frac{\psi _{N_{levsoi} +1} }{s_{\, N_{levsoi} } \theta _{sat,\, N_{levsoi} } } . - -The coefficients for the aquifer layer :math:`i=N_{levsoi} +1` are then - -.. math:: - :label: 7.160) - - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } - -.. math:: - :label: 7.161) + \epsilon = max \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - + \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] - b_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} +If :math:`\epsilon` is greater than a specified error tolerance, the solution is +rejected, :math:`\Delta t` is halved and a new solution is determined. If the solution +is accepted, the procedure repeats until the adaptive sub-stepping spans the full +model time step. During the solution, the sub-steps may be halved until a +specified minimum time step length is reached, and the sub-steps may be doubled +when :math:`\epsilon` is less than a specified error tolerance. -.. math:: - :label: 7.162) - - c_{i} =0 - -.. math:: - :label: 7.163) - - r_{i} =q_{i-1}^{n} . - -Upon solution of the tridiagonal equation set (Press et al. 1992), the +Upon solution of the tridiagonal equation set, the liquid water contents are updated as follows .. math:: @@ -1160,9 +974,8 @@ hydraulic conductivity, k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta _{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) -where :math:`\Theta _{ice}` is an ice impedance factor determined from -the ice content of the soil layers interacting with the water table -(section 7.6), :math:`\beta` is the mean grid cell topographic slope in +where :math:`\Theta_{ice}` is an ice impedance factor, :math:`\beta` +is the mean grid cell topographic slope in radians, :math:`z_{frost}` \ is the depth to the frost table, and :math:`z_{\nabla ,perch}` is the depth to the perched saturated zone. The frost table :math:`z_{frost}` is defined as the shallowest frozen @@ -1174,88 +987,33 @@ threshold is set to 0.9. Drainage from the perched saturated zone through :math:`N_{frost}` , which are the layers containing :math:`z_{\nabla ,perch}` and, :math:`z_{frost}` \ respectively. -.. _Groundwater-Soil Water Interactions: +.. _Lateral Sub-surface Runoff: -Groundwater-Soil Water Interactions +Lateral Sub-surface Runoff --------------------------------------- - -Drainage or sub-surface runoff is based on the SIMTOP scheme (Niu et al. -2005) with a modification to account for reduced drainage in frozen -soils. In the work of Niu et al. (2005), the drainage :math:`q_{drai}` -(kg m\ :sup:`-2` s\ :sup:`-1`) was formulated as - -.. math:: - :label: ZEqnNum924767 - - q_{drai} =q_{drai,\, \max } \exp \left(-f_{drai} z_{\nabla } \right). - -Here, the water table depth :math:`z_{\nabla }` has units of meters. To -restrict drainage in frozen soils, Niu et al. (2005) added the following -condition - -.. math:: - :label: 7.169) - - q_{drai} =0\qquad {\rm for\; \; }w_{ice,\, N_{levsoi} } >w_{liq,\, N_{levsoi} } . - -In preliminary testing it was found that a more gradual restriction of -drainage was required so that the water table depth remained dynamic -under partially frozen conditions. The following modification is made to -equation - -.. math:: - :label: ZEqnNum150955 - - q_{drai} =\Theta _{ice} q_{drai,\, \max } \exp \left(-f_{drai} z_{\nabla } \right) - -where :math:`\Theta _{ice}` is an ice impedance factor determined from -the ice content of the soil layers interacting with the water table +Lateral sub-surface runoff occurs when saturated soil moisture conditions +exist within the soil column. Sub-surface runoff is .. math:: - :label: 7.171) + :label: 7.168) - \Theta _{ice} =10^{-\Omega \left(\frac{\sum _{i=jwt}^{i=N_{levsoi} }F_{ice,i} \Delta z_{i} }{\sum _{i=jwt}^{i=N_{levsoi} }\Delta z_{i} } \right)} + q_{subsurface} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) + \Delta z_{sat}^{N_{baseflow}} \ , -where :math:`\Omega =6`\ is an adjustable parameter, :math:`jwt` is the -index of the layer directly above the water table, -:math:`F_{ice} =\frac{\theta _{ice} }{\theta _{sat} }` is the -ice-filled fraction of the pore space of soil layer :math:`i` (kg -m\ :sup:`-2`), and :math:`\Delta z_{i}` is the layer thickness (mm). This -expression is functionally the same as that used to determine the ice -impedance factor in section :numref:`Hydraulic Properties`. In equation , -the decay factor :math:`f_{drai} =2.5` m\ :sup:`-1` and the maximum drainage -when the water table depth is at the surface -:math:`q_{drai,\, \max } =10\sin (\beta )` kg m\ :sup:`-2` -s\ :sup:`-1` , where :math:`\beta` is the mean grid cell -topographic slope in radians, were determined for global simulations -through sensitivity analysis and comparison with observed runoff. +where :math:`K_{baseflow}` is a calibration parameter, :math:`\beta` is the +topographic slope, the exponent :math:`N_{baseflow}` = 1, and :math:`\Delta z_{sat}` +is the thickness of the saturated portion of the soil column. -Determination of water table depth :math:`z_{\nabla }` is based on work -by Niu et al. (2007). In this approach, a groundwater component is added -in the form of an unconfined aquifer lying below the soil column (:numref:`Hydrologic processes figure`). The groundwater solution is dependent on whether the water table -is within or below the soil column. The water stored in the unconfined -aquifer :math:`W_{a}` has a prescribed maximum value (5000 mm). When -the water table is within the soil column, :math:`W_{a}` is constant -because there is no water exchange between the soil column and the -underlying aquifer. In this case, recharge to the water table is -diagnosed by applying Darcy’s law across the water table +The saturated thickness is .. math:: - :label: 7.172) - - q_{rech\arg e} =-k_{aq} \frac{\left(\Psi _{\nabla } -\Psi _{jwt} \right)}{\left(z_{\nabla } -z_{jwt} \right)} + :label: 7.1681) -where :math:`\Psi _{\nabla } =0` is the matric potential at the water -table and\ :math:`k_{aq} =\Theta _{ice,jwt+1} k\left[z_{jwt+1} \right]` -is the hydraulic conductivity of the layer containing the water table. -Change in the water table is then calculated as the difference between -recharge and drainage, scaled by the specific yield of the layer -containing the water table + \Delta z_{sat} = z_{bedrock} - z_{\nabla}, -.. math:: - :label: ZEqnNum287831 - - \Delta z_{\nabla } =\frac{\left(q_{rech\arg e} -q_{drai} \right)}{S_{y} } \Delta t. +where the water table :math:`z_{\nabla}` is determined by finding the +first soil layer above the bedrock depth (section ) in which the volumetric water +content drops below a specified threshold. The default threshold is set to 0.9. The specific yield, :math:`S_{y}` , which depends on the soil properties and the water table location, is derived by taking the @@ -1271,36 +1029,6 @@ where B is the Clapp-Hornberger exponent. Because :math:`S_{y}` is a function of the soil properties, it results in water table dynamics that are consistent with the soil water fluxes described in section 7.4. -For the case when the water table is below the soil column, the change -in water stored in the unconfined aquifer :math:`W_{a}` (mm) is updated -as - -.. math:: - :label: 7.174a) - - \Delta W_{a}^{} =\left(q_{recharge} -q_{drai} \right)\Delta t - -and the water table is updated using equation with the specific yield of -layer :math:`N_{levsoi}` . - -The recharge rate is defined as positive when water enters the aquifer - -.. math:: - :label: 7.174b) - - q_{recharge} =\frac{\Delta \theta _{liq,\, N_{levsoi} +1} \Delta z_{N_{levsoi} +1} }{\Delta t} - -where -:math:`\Delta \theta _{liq,\, N_{levsoi} +1} =\theta _{liq,\, N_{levsoi} +1}^{n+1} -\theta _{liq,\, N_{levsoi} +1}^{n}` -is the change in liquid water content for layer :math:`i=N_{levsoi} +1` -calculated from the solution of the soil water equations (section 7.4), -and :math:`\Delta z_{N_{levsoi} +1}` (mm) is - -.. math:: - :label: 7.174c) - - \Delta z_{N_{levsoi} +1} =z_{\nabla }^{n} -z_{h,\, N_{levsoi} } . - After the above calculations, two numerical adjustments are implemented to keep the liquid water content of each soil layer (:math:`w_{liq,\, i}` ) within physical constraints of diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index e48ba34933..ca5fa9f660 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -19,6 +19,8 @@ area indices (section 4.1). Canopy conductance is where :math:`r_{b}` is the leaf boundary layer resistance (section 5.3). The equation set is described by Bonan et al. (2011). +.. _Stomatal resistance: + Stomatal resistance ----------------------- @@ -65,65 +67,69 @@ s m\ :sup:`2` :math:`\mu` mol\ :sub:`-1` to s m\ :sup:`-1` as: kmol\ :sup:`-1`) (Table 2.6) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). -Table 8.1. Plant functional type (PFT) photosynthetic parameters. - -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| PFT | m | :math:`\alpha` | :math:`CN_{L}` | :math:`F_{LNR}` | :math:`SLA_{0}` | :math:`\psi _{o}` | :math:`\psi _{c}` | :math:`{V}_{cmax25}` | -+==================================+=====+====================+===================+====================+====================+======================+======================+===========================+ -| NET Temperate | 9 | – | 35 | 0.0509 | 0.010 | -66000 | -255000 | 62.5 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| NET Boreal | 9 | – | 40 | 0.0466 | 0.008 | -66000 | -255000 | 62.6 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| NDT Boreal | 9 | – | 25 | 0.0546 | 0.024 | -66000 | -255000 | 39.1 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BET Tropical | 9 | – | 30 | 0.0461 | 0.012 | -66000 | -255000 | 55.0 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BET temperate | 9 | – | 30 | 0.0515 | 0.012 | -66000 | -255000 | 61.5 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BDT tropical | 9 | – | 25 | 0.0716 | 0.030 | -35000 | -224000 | 41.0 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BDT temperate | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BDT boreal | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BES temperate | 9 | – | 30 | 0.0517 | 0.012 | -83000 | -428000 | 61.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BDS temperate | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| BDS boreal | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :sub:`3` arctic grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :sub:`3` grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| C\ :sub:`4` grass | 4 | 0.05 | 25 | 0.0900 | 0.030 | -74000 | -275000 | 51.6 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Crop R | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Crop I | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Corn R | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Corn I | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Temp Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Temp Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Winter Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Winter Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Soybean R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ -| Soybean I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | -+----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ +.. _Table Plant functional type (PFT) photosynthetic parameters: + +.. table:: Plant functional type (PFT) photosynthetic parameters. + + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | PFT | m | :math:`\alpha` | :math:`CN_{L}` | :math:`F_{LNR}` | :math:`SLA_{0}` | :math:`\psi _{o}` | :math:`\psi _{c}` | :math:`{V}_{cmax25}` | + +==================================+=====+====================+===================+====================+====================+======================+======================+===========================+ + | NET Temperate | 9 | – | 35 | 0.0509 | 0.010 | -66000 | -255000 | 62.5 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | NET Boreal | 9 | – | 40 | 0.0466 | 0.008 | -66000 | -255000 | 62.6 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | NDT Boreal | 9 | – | 25 | 0.0546 | 0.024 | -66000 | -255000 | 39.1 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BET Tropical | 9 | – | 30 | 0.0461 | 0.012 | -66000 | -255000 | 55.0 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BET temperate | 9 | – | 30 | 0.0515 | 0.012 | -66000 | -255000 | 61.5 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BDT tropical | 9 | – | 25 | 0.0716 | 0.030 | -35000 | -224000 | 41.0 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BDT temperate | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BDT boreal | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BES temperate | 9 | – | 30 | 0.0517 | 0.012 | -83000 | -428000 | 61.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BDS temperate | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | BDS boreal | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | C\ :sub:`3` arctic grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | C\ :sub:`3` grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | C\ :sub:`4` grass | 4 | 0.05 | 25 | 0.0900 | 0.030 | -74000 | -275000 | 51.6 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Crop R | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Crop I | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Corn R | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Corn I | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Temp Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Temp Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Winter Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Winter Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Soybean R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ + | Soybean I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | + +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ :math:`\alpha` (mol CO\ :sub:`2` mol\ :sup:`-1` photon); :math:`CN_{L}` (g C g\ :sup:`-1` N); :math:`F_{LNR}` (g N Rubisco g\ :sup:`-1` N); :math:`SLA_{0}` (m\ :sup:`2` g\ :sup:`-1` C); :math:`\psi _{o}` and :math:`\psi _{c}` (mm); V\ :sub:`cmax25` (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`, calculated from equation for canopy top). +.. _Photosynthesis: + Photosynthesis ------------------ @@ -309,30 +315,32 @@ K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and with :math:`Q_{10} =2`. -Table 8.2. Temperature dependence parameters for C3 photosynthesis. - -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | :math:`\Delta S` (J mol\ :sup:`-1` K\ :sup:`-1`) | -+========================+=================================================================+=================================================================+==============================================================================================+ -| :math:`V_{c\max }` | 65330 | 149250 | 485 | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`J_{\max }` | 43540 | 152040 | 495 | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`T_{p}` | 65330 | 149250 | 485 | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`R_{d}` | 46390 | 150650 | 490 | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`K_{c}` | 79430 | – | – | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`K_{o}` | 36380 | – | – | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -| :math:`\Gamma _{\*}` | 37830 | – | – | -+------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - -The parameters in Table 8.2 do not allow for temperature acclimation of -photosynthesis. In the model, acclimation is implemented as in Kattge -and Knorr (2007). In this parameterization, :math:`V_{c\max }` and -:math:`J_{\max }` vary with the plant growth temperature. This is +.. _Table Temperature dependence parameters for C3 photosynthesis: + +.. table:: Temperature dependence parameters for C3 photosynthesis. + + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | :math:`\Delta S` (J mol\ :sup:`-1` K\ :sup:`-1`) | + +========================+=================================================================+=================================================================+==============================================================================================+ + | :math:`V_{c\max }` | 65330 | 149250 | 485 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`J_{\max }` | 43540 | 152040 | 495 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`T_{p}` | 65330 | 149250 | 485 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`R_{d}` | 46390 | 150650 | 490 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`K_{c}` | 79430 | – | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`K_{o}` | 36380 | – | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + | :math:`\Gamma _{\*}` | 37830 | – | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ + +The parameters in numref:`Table Temperature dependence parameters for C3 photosynthesis` +do not allow for temperature acclimation of photosynthesis. In the model, acclimation is +implemented as in :ref:`Kattge and Knorr (2007) `. In this parameterization, +:math:`V_{c\max }` and :math:`J_{\max }` vary with the plant growth temperature. This is achieved by allowing :math:`\Delta S`\ to vary with growth temperature according to @@ -358,6 +366,8 @@ temperature (K) and :math:`T_{f}` is the freezing point of water (K). For lack of data, :math:`T_{p}` acclimates similar to V :sub:`cmax` . Acclimation is restricted over the temperature range :math:`T_{10} -T_{f} \ge 11`\ :sup:`o`\ C and :math:`T_{10} -T_{f} \le 35`\ :sup:`o`\ C. +.. _V\ :sub:`cmax25` and Canopy scaling: + V\ :sub:`cmax25` and Canopy scaling -------------------------------------------- @@ -476,6 +486,8 @@ orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], positive for Northern Hemisphere latitudes and negative for Southern Hemisphere). +.. _Soil water stress: + Soil water stress --------------------- @@ -551,62 +563,66 @@ functional type where :math:`z_{h,\, i}` (m) is the depth from the soil surface to the interface between layers :math:`i` and :math:`i+1` (:math:`z_{h,\, 0}` , the soil surface) (section 6.1), and :math:`r_{a}` and :math:`r_{b}` -are plant-dependent root distribution parameters adopted from Zeng -(2001) (Table 8.3). - -Table 8.3. Plant functional type root distribution parameters. - -+----------------------------------+------------------+------------------+ -| Plant Functional Type | :math:`r_{a}` | :math:`r_{b}` | -+==================================+==================+==================+ -| NET Temperate | 7.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| NET Boreal | 7.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| NDT Boreal | 7.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| BET Tropical | 7.0 | 1.0 | -+----------------------------------+------------------+------------------+ -| BET temperate | 7.0 | 1.0 | -+----------------------------------+------------------+------------------+ -| BDT tropical | 6.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| BDT temperate | 6.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| BDT boreal | 6.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| BES temperate | 7.0 | 1.5 | -+----------------------------------+------------------+------------------+ -| BDS temperate | 7.0 | 1.5 | -+----------------------------------+------------------+------------------+ -| BDS boreal | 7.0 | 1.5 | -+----------------------------------+------------------+------------------+ -| C\ :sub:`3` grass arctic | 11.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| C\ :sub:`3` grass | 11.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| C\ :sub:`4` grass | 11.0 | 2.0 | -+----------------------------------+------------------+------------------+ -| Crop R | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Crop I | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Corn R | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Corn I | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Temp Cereal R | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Temp Cereal I | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Winter Cereal R | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Winter Cereal I | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Soybean R | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ -| Soybean I | 6.0 | 3.0 | -+----------------------------------+------------------+------------------+ +are plant-dependent root distribution parameters adopted from :ref:`Zeng (2001) ` +(:numref:`Table Plant functional type root distribution parameters`). + +.. _Table Plant functional type root distribution parameters: + +.. table:: Plant functional type root distribution parameters + + +----------------------------------+------------------+------------------+ + | Plant Functional Type | :math:`r_{a}` | :math:`r_{b}` | + +==================================+==================+==================+ + | NET Temperate | 7.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | NET Boreal | 7.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | NDT Boreal | 7.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | BET Tropical | 7.0 | 1.0 | + +----------------------------------+------------------+------------------+ + | BET temperate | 7.0 | 1.0 | + +----------------------------------+------------------+------------------+ + | BDT tropical | 6.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | BDT temperate | 6.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | BDT boreal | 6.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | BES temperate | 7.0 | 1.5 | + +----------------------------------+------------------+------------------+ + | BDS temperate | 7.0 | 1.5 | + +----------------------------------+------------------+------------------+ + | BDS boreal | 7.0 | 1.5 | + +----------------------------------+------------------+------------------+ + | C\ :sub:`3` grass arctic | 11.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | C\ :sub:`3` grass | 11.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | C\ :sub:`4` grass | 11.0 | 2.0 | + +----------------------------------+------------------+------------------+ + | Crop R | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Crop I | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Corn R | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Corn I | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Temp Cereal R | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Temp Cereal I | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Winter Cereal R | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Winter Cereal I | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Soybean R | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + | Soybean I | 6.0 | 3.0 | + +----------------------------------+------------------+------------------+ + +.. _Numerical implementation photosynthesis: Numerical implementation ---------------------------- diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 4b81731fb0..3e52821ef7 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -52,7 +52,7 @@ Arah, J. and Vinten, A., 1995. Simplified models of anoxia and denitrification in aggregated and simple-structured soils. European Journal of Soil Science 46:507-517. -.. _Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global +.. _Arendtetal2012: Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global Glacier Outlines Version: 1.0, Global Land Ice Measurements from Space, @@ -344,6 +344,8 @@ correspond with changes in labile organic C fractions in soil amended with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): 453-462. +.. _deVries1963: + de Vries, D.A. 1963. Thermal Properties of Soils. In: W.R. van Wijk (editor) Physics of the Plant Environment. North-Holland, Amsterdam. @@ -1692,6 +1694,17 @@ Swenson, S.C. and Lawrence, D.M. 2012. A New Fractional Snow Covered Area Parameterization for the Community Land Model and its Effect on the Surface Energy Balance. JGR, 117, D21107. DOI:10.1029/2012JD018178. +.. _SwensonLawrence2014: +Swenson, S.C., and D. M. Lawrence. 2014. Assessing a dry surface +layer-based soil resistance parameterization for the Community Land Model +using GRACE and FLUXNET-MTE data. JGR, 119, 10, 299–10,312, +DOI:10.1002/2014JD022314. + +.. _SwensonLawrence2015: +Swenson, S.C., and D. M. Lawrence. 2015. A GRACE-based assessment of +interannual groundwater dynamics in the Community Land Model. WRR, 51, +doi:10.1002/2015WR017582. + .. _TaWeiland1992: Ta, C.T. and Weiland, R.T. 1992. Nitrogen partitioning in maize during @@ -1920,7 +1933,7 @@ hydrology parameterization with subgrid variability for general circulation models. J. Geophys. Res. 97(D3):2717–2728. DOI:10.1029/91JD01786. -.. _World Bank2004: +.. _WorldBank2004: World Bank, 2004. World development indicators 2004, Oxford University Press, New York, 416 pp. diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index f033832ceb..dbe949bd34 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -103,7 +103,11 @@ The conservation equation for mass of ice in snow layers is .. math:: :label: 8.17) - \frac{\partial w_{ice,\, i} }{\partial t} =\left\{\begin{array}{l} {f_{sno} q_{ice,\, i-1} -\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+1} \\ {-\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} \qquad i=snl+2,\ldots ,0} \end{array}\right\} + \frac{\partial w_{ice,\, i} }{\partial t} = + \left\{\begin{array}{lr} + f_{sno} \ q_{ice,\, i-1} -\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} & \qquad i=snl+1 \\ + -\frac{\left(\Delta w_{ice,\, i} \right)_{p} }{\Delta t} & \qquad i=snl+2,\ldots ,0 + \end{array}\right\} where :math:`q_{ice,\, i-1}` is the rate of ice accumulation from precipitation or frost or the rate of ice loss from sublimation (kg @@ -143,7 +147,12 @@ m\ :sup:`-3`) (:ref:`Anderson (1976) `) .. math:: :label: 8.21) - \rho _{sno} =\left\{\begin{array}{l} {50+1.7\left(17\right)^{1.5} \qquad T_{atm} >T_{f} +2} \\ {50+1.7\left(T_{atm} -T_{f} +15\right)^{1.5} \qquad T_{f} -15T_{f} +2 \ \\ + 50+1.7 \left(T_{atm} -T_{f} + 15\right)^{1.5} & \qquad T_{f} - 15 < T_{atm} \le T_{f} + 2 \ \\ + 50 &\qquad T_{atm} \le T_{f} - 15 + \end{array}\right\} where :math:`T_{atm}` is the atmospheric temperature (K), and :math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). The diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index c1971be79a..083c6b651e 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -46,82 +46,17 @@ surface water temperatures for a fifteen-layer soil column with up to five overlying layers of snow and a single surface water layer with the boundary conditions of :math:`h` as the heat flux into the top soil, snow, and surface water layers from the overlying atmosphere (section -6.1) and zero heat flux at the bottom of the soil column. The -temperature profile is calculated first without phase change and then -readjusted for phase change (section 6.2). +:numref:`Numerical Solution Temperature`) and zero heat flux at the bottom +of the soil column. The temperature profile is calculated first without +phase change and then readjusted for phase change (section :numref:`Phase Change`). .. _Numerical Solution Temperature: Numerical Solution ---------------------- -The soil column is discretized into fifteen layers (Table 6.1) where the -depth of soil layer :math:`i`, or node depth, :math:`z_{i}` (m), is - -.. math:: - :label: ZEqnNum185766 - - z_{i} =f_{s} \left\{\exp \left[0.5\left(i-0.5\right)\right]-1\right\} - -where :math:`f_{s} =0.025` is a scaling factor. The thickness of each -layer :math:`\Delta z_{i}` (m) is - -.. math:: - :label: 6.6) - - \Delta z_{i} =\left\{\begin{array}{l} {0.5\left(z_{1} +z_{2} \right)\qquad i=1} \\ {0.5\left(z_{i+1} -z_{i-1} \right)\qquad i=2,3,\ldots ,N_{levgrnd} -1} \\ {z_{N} -z_{N-1} \qquad i=N_{levgrnd} } \end{array}\right\} - -where :math:`N_{levgrnd} =15` is the number of soil layers. The depths -at the layer interfaces :math:`z_{h,\, i}` (m) are - -.. math:: - :label: 6.7) - - z_{h,\, i} =\left\{\begin{array}{l} {0.5\left(z_{i} +z_{i+1} \right)\qquad i=1,2,\ldots ,N_{levgrnd} -1} \\ {z_{N_{levgrnd} } +0.5\Delta z_{N_{levgrnd} } \qquad i=N_{levgrnd} } \end{array}\right\}. - -The exponential form of equation is to obtain more soil layers near the -soil surface where the soil water gradient is generally strong (section -7.4). - -Table 6.1. Soil layer structure. - -Layer node depth (:math:`z_{i}` ), thickness (:math:`\Delta z_{i}` ), -and depth at layer interface (:math:`z_{h,\, i}` ) for fifteen-layer -soil column. All in meters. - -+---------------+------------------+-------------------------+-----------------------+ -| Layer | :math:`z_{i}` | :math:`\Delta z_{i}` | :math:`z_{h,\, i}` | -+===============+==================+=========================+=======================+ -| 1 (top) | 0.0071 | 0.0175 | 0.0175 | -+---------------+------------------+-------------------------+-----------------------+ -| 2 | 0.0279 | 0.0276 | 0.0451 | -+---------------+------------------+-------------------------+-----------------------+ -| 3 | 0.0623 | 0.0455 | 0.0906 | -+---------------+------------------+-------------------------+-----------------------+ -| 4 | 0.1189 | 0.0750 | 0.1655 | -+---------------+------------------+-------------------------+-----------------------+ -| 5 | 0.2122 | 0.1236 | 0.2891 | -+---------------+------------------+-------------------------+-----------------------+ -| 6 | 0.3661 | 0.2038 | 0.4929 | -+---------------+------------------+-------------------------+-----------------------+ -| 7 | 0.6198 | 0.3360 | 0.8289 | -+---------------+------------------+-------------------------+-----------------------+ -| 8 | 1.0380 | 0.5539 | 1.3828 | -+---------------+------------------+-------------------------+-----------------------+ -| 9 | 1.7276 | 0.9133 | 2.2961 | -+---------------+------------------+-------------------------+-----------------------+ -| 10 | 2.8646 | 1.5058 | 3.8019 | -+---------------+------------------+-------------------------+-----------------------+ -| 11 | 4.7392 | 2.4826 | 6.2845 | -+---------------+------------------+-------------------------+-----------------------+ -| 12 | 7.8298 | 4.0931 | 10.3775 | -+---------------+------------------+-------------------------+-----------------------+ -| 13 | 12.9253 | 6.7484 | 17.1259 | -+---------------+------------------+-------------------------+-----------------------+ -| 14 | 21.3265 | 11.1262 | 28.2520 | -+---------------+------------------+-------------------------+-----------------------+ -| 15 (bottom) | 35.1776 | 13.8512 | 42.1032 | -+---------------+------------------+-------------------------+-----------------------+ +The soil column is discretized into 25 layers (section :numref:`Vertical Discretization`) +where :math:`N_{levgrnd} = 25` is the number of soil layers (:numref:`Table Soil layer structure`). The overlying snow pack is modeled with up to five layers depending on the total snow depth. The layers from top to bottom are indexed in the @@ -209,9 +144,6 @@ equals the heat flux from the interface to :math:`i+1` (depth where :math:`T_{m}` is the temperature at the interface of layers :math:`i` and :math:`i+1`. -Figure 6.1. Schematic diagram of numerical scheme used to solve for soil -temperature. - Shown are three soil layers, :math:`i-1`, :math:`i`, and :math:`i+1`. The thermal conductivity :math:`\lambda` , specific heat capacity :math:`c`, and temperature :math:`T` are defined at the layer node depth @@ -222,8 +154,11 @@ interface of two layers :math:`z_{h}` . The layer thickness is :math:`\Delta z`. The heat fluxes :math:`F_{i-1}` and :math:`F_{i}` are defined as positive upwards. -.. image:: image1.png +.. _Figure Soil Temperature Schematic: +.. figure:: image1.png + + Schematic diagram of numerical scheme used to solve for soil temperature. The energy balance for the :math:`i^{th}` layer is @@ -769,23 +704,31 @@ cool the snow layer. Soil and Snow Thermal Properties ------------------------------------ -The thermal and hydraulic (section 6.3 and 7.4.1) properties of the soil -are assumed to be a weighted combination of the mineral and organic -properties of the soil (Lawrence and Slater 2008). The soil layer -organic matter fraction :math:`f_{om,i}` is +The thermal properties of the soil are assumed to be a weighted combination of +the mineral and organic properties of the soil +(:ref:`Lawrence and Slater 2008 `). +The soil layer organic matter fraction :math:`f_{om,i}` is .. math:: :label: 6.77) f_{om,i} =\rho _{om,i} /\rho _{om,\max } . -Soil thermal conductivity :math:`\lambda _{i}` (W m\ :sup:`-1` -K\ :sup:`-1`) is from Farouki (1981) +Soil thermal conductivity :math:`\lambda _{i}` (W m\ :sup:`-1` K\ :sup:`-1`) +is from :ref:`Farouki (1981) ` .. math:: :label: 6.78) - \begin{array}{l} {\lambda _{i} =\left\{\begin{array}{l} {K_{e,\, i} \lambda _{sat,\, i} +\left(1-K_{e,\, i} \right)\lambda _{dry,\, i} \qquad S_{r,\, i} >1\times 10^{-7} } \\ {\lambda _{dry,\, i} \qquad S_{r,\, i} \le 1\times 10^{-7} } \end{array}\right\}\qquad i=1,\ldots ,N_{levsoi} } \\ {\lambda _{i} =\lambda _{bedrock} \qquad i=N_{levsoi} +1,\ldots N_{levgrnd} } \end{array} + \begin{array}{lr} + \lambda _{i} = \left\{ + \begin{array}{lr} + K_{e,\, i} \lambda _{sat,\, i} +\left(1-K_{e,\, i} \right)\lambda _{dry,\, i} &\qquad S_{r,\, i} > 1\times 10^{-7} \\ + \lambda _{dry,\, i} &\qquad S_{r,\, i} \le 1\times 10^{-7} + \end{array}\right\} &\qquad i=1,\ldots ,N_{levsoi} \\ + + \lambda _{i} =\lambda _{bedrock} &\qquad i=N_{levsoi} +1,\ldots N_{levgrnd} + \end{array} where :math:`\lambda _{sat,\, i}` is the saturated thermal conductivity, :math:`\lambda _{dry,\, i}` is the dry thermal @@ -793,8 +736,8 @@ conductivity, :math:`K_{e,\, i}` is the Kersten number, :math:`S_{r,\, i}` is the wetness of the soil with respect to saturation, and :math:`\lambda _{bedrock} =3` W m\ :sup:`-1` K\ :sup:`-1` is the thermal conductivity assumed for the deep -ground layers (typical of saturated granitic rock; Clauser and Huenges, -1995). For glaciers and wetlands, +ground layers (typical of saturated granitic rock; +:ref:`Clauser and Huenges 1995 `). For glaciers and wetlands, .. math:: :label: 6.79) @@ -830,8 +773,8 @@ where the mineral soil solid thermal conductivity \lambda _{s,\, \min ,i} =\frac{8.80{\rm \; }\left(\% sand\right)_{i} +{\rm 2.92\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } , and :math:`\lambda _{s,om} =0.25`\ W m\ :sup:`-1` -K\ :sup:`-1` (Farouki, 1981). :math:`\theta _{sat,\, i}` is the -volumetric water content at saturation (porosity) (section 7.4.1). +K\ :sup:`-1` (:ref:`Farouki 1981 `). :math:`\theta _{sat,\, i}` is the +volumetric water content at saturation (porosity) (section :numref:`Hydraulic Properties`). The thermal conductivity of dry soil is @@ -852,14 +795,18 @@ m\ :sup:`-3`) as \lambda _{dry,\, \min ,i} =\frac{0.135\rho _{d,\, i} +64.7}{2700-0.947\rho _{d,\, i} } and :math:`\lambda _{dry,om} =0.05` W m\ :sup:`-1` -K\ :sup:`-1` (Farouki, 1981) is the dry thermal conductivity of +K\ :sup:`-1` (:ref:`Farouki 1981 `) is the dry thermal conductivity of organic matter. The Kersten number :math:`K_{e,\, i}` is a function of the degree of saturation :math:`S_{r}` and phase of water .. math:: :label: 6.85) - K_{e,\, i} =\left\{\begin{array}{l} {\log \left(S_{r,\, i} \right)+1\ge 0\qquad T_{i} \ge T_{f} } \\ {S_{r,\, i} \qquad T_{i} ` .. math:: :label: 6.87) \lambda _{i} =\lambda _{air} +\left(7.75\times 10^{-5} \rho _{sno,\, i} +1.105\times 10^{-6} \rho _{sno,\, i}^{2} \right)\left(\lambda _{ice} -\lambda _{air} \right) -where :math:`\lambda _{air}` is the thermal conductivity of air (Table -2.6) and :math:`\rho _{sno,\, i}` is the bulk density of snow (kg -m\ :sup:`-3`) +where :math:`\lambda _{air}` is the thermal conductivity of air (:numref:`Table Physical Constants`) +and :math:`\rho _{sno,\, i}` is the bulk density of snow (kg m\ :sup:`-3`) .. math:: :label: 6.88) \rho _{sno,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{\Delta z_{i} } . -The volumetric heat capacity :math:`c_{i}` (J m\ :sup:`-3` -K\ :sup:`-1`) for soil is from de Vries (1963) and depends on the +The volumetric heat capacity :math:`c_{i}` (J m\ :sup:`-3` K\ :sup:`-1`) for +soil is from :ref:`de Vries (1963) ` and depends on the heat capacities of the soil solid, liquid water, and ice constituents .. math:: @@ -896,7 +842,7 @@ heat capacities of the soil solid, liquid water, and ice constituents where :math:`C_{liq}` and :math:`C_{ice}` are the specific heat capacities (J kg\ :sup:`-1` K\ :sup:`-1`) of liquid water -and ice, respectively (Table 2.6). The heat capacity of soil solids +and ice, respectively (:numref:`Table Physical Constants`). The heat capacity of soil solids :math:`c_{s,i}` \ (J m\ :sup:`-3` K\ :sup:`-1`) is .. math:: @@ -910,12 +856,15 @@ where the heat capacity of mineral soil solids .. math:: :label: 6.91) - \begin{array}{l} {c_{s,\min ,\, i} =\left(\frac{2.128{\rm \; }\left(\% sand\right)_{i} +{\rm 2.385\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } \right)\times 10^{6} \qquad i=1,\ldots ,N_{levsoi} } \\ {c_{s,\, \min ,i} =c_{s,\, bedrock} \qquad i=N_{levsoi} +1,\ldots ,N_{levgrnd} } \end{array} + \begin{array}{lr} + c_{s,\min ,\, i} =\left(\frac{2.128{\rm \; }\left(\% sand\right)_{i} +{\rm 2.385\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } \right)\times 10^{6} &\qquad i=1,\ldots ,N_{levsoi} \\ + c_{s,\, \min ,i} =c_{s,\, bedrock} &\qquad i=N_{levsoi} +1,\ldots ,N_{levgrnd} + \end{array} where :math:`c_{s,bedrock} =2\times 10^{6}` J m\ :sup:`-3` K\ :sup:`-1` is the heat capacity of bedrock and :math:`c_{s,om} =2.5\times 10^{6}` \ J m\ :sup:`-3` -K\ :sup:`-1` (Farouki, 1981) is the heat capacity of organic +K\ :sup:`-1` (ref:`Farouki 1981 `) is the heat capacity of organic matter. For glaciers, wetlands, and snow .. math:: diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index f2d54987f9..82a25eba77 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -420,71 +420,75 @@ for grasslands and crops from full optical range spectra of measured optical properties (Asner et al. 1998). Optical properties for intercepted snow (Table 3.2) are from Sellers et al. (1986). -Table 3.1. Plant functional type optical properties - -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Plant Functional Type | :math:`\chi _{L}` | :math:`\alpha _{vis}^{leaf}` | :math:`\alpha _{nir}^{leaf}` | :math:`\alpha _{vis}^{stem}` | :math:`\alpha _{nir}^{stem}` | :math:`\tau _{vis}^{leaf}` | :math:`\tau _{nir}^{leaf}` | :math:`\tau _{vis}^{stem}` | :math:`\tau _{nir}^{stem}` | -+==================================+======================+=================================+=================================+=================================+=================================+===============================+===============================+===============================+===============================+ -| NET Temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| NET Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| NDT Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BET Tropical | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BET temperate | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BDT tropical | 0.01 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BDT temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BDT boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BES temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BDS temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| BDS boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :sub:`3` arctic grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :sub:`3` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| C\ :sub:`4` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Crop R | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Crop I | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Corn R | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Corn I | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Temp Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Temp Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Winter Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Winter Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Soybean R | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Soybean I | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | -+----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - -Table 3.2. Intercepted snow optical properties - -+-----------------------------+-------+-------+ -| Parameter | vis | nir | -+=============================+=======+=======+ -| :math:`\omega ^{sno}` | 0.8 | 0.4 | -+-----------------------------+-------+-------+ -| :math:`\beta ^{sno}` | 0.5 | 0.5 | -+-----------------------------+-------+-------+ -| :math:`\beta _{0}^{sno}` | 0.5 | 0.5 | -+-----------------------------+-------+-------+ +.. _Table Plant functional type optical properties: + +.. table:: Plant functional type optical properties + + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Plant Functional Type | :math:`\chi _{L}` | :math:`\alpha _{vis}^{leaf}` | :math:`\alpha _{nir}^{leaf}` | :math:`\alpha _{vis}^{stem}` | :math:`\alpha _{nir}^{stem}` | :math:`\tau _{vis}^{leaf}` | :math:`\tau _{nir}^{leaf}` | :math:`\tau _{vis}^{stem}` | :math:`\tau _{nir}^{stem}` | + +==================================+======================+=================================+=================================+=================================+=================================+===============================+===============================+===============================+===============================+ + | NET Temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | NET Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | NDT Boreal | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BET Tropical | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BET temperate | 0.10 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BDT tropical | 0.01 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BDT temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BDT boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BES temperate | 0.01 | 0.07 | 0.35 | 0.16 | 0.39 | 0.05 | 0.10 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BDS temperate | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | BDS boreal | 0.25 | 0.10 | 0.45 | 0.16 | 0.39 | 0.05 | 0.25 | 0.001 | 0.001 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | C\ :sub:`3` arctic grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | C\ :sub:`3` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | C\ :sub:`4` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Crop R | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Crop I | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Corn R | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Corn I | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Temp Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Temp Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Winter Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Winter Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Soybean R | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + | Soybean I | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ + +.. _Table Intercepted snow optical properties: + +.. table:: Intercepted snow optical properties + + +-----------------------------+-------+-------+ + | Parameter | vis | nir | + +=============================+=======+=======+ + | :math:`\omega ^{sno}` | 0.8 | 0.4 | + +-----------------------------+-------+-------+ + | :math:`\beta ^{sno}` | 0.5 | 0.5 | + +-----------------------------+-------+-------+ + | :math:`\beta _{0}^{sno}` | 0.5 | 0.5 | + +-----------------------------+-------+-------+ .. _Ground Albedos: From 500487cd7a735c37f09562a142c91c10e5c10397 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 24 May 2017 09:06:54 -0600 Subject: [PATCH 017/730] revise irrigation section --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 136 ++++-- .../CLM50_Tech_Note_Photosynthesis.rst | 5 +- .../References/CLM50_Tech_Note_References.rst | 6 +- .../CLM50_Tech_Note_Surface_Albedos.rst | 450 ++++++++++-------- 4 files changed, 337 insertions(+), 260 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index f0f31eac92..449341c0f9 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -443,68 +443,110 @@ The irrigation model The CLM includes the option to irrigate cropland areas that are equipped for irrigation. The application of irrigation responds dynamically to the soil moisture conditions simulated by the CLM. This irrigation -algorithm is based loosely on the implementation of Ozdogan et al. -(2010). +algorithm is based loosely on the implementation of +:ref:`Ozdogan et al. (2010) `. When irrigation is enabled, the crop areas of each grid cell are divided into irrigated and rainfed fractions according to a dataset of areas -equipped for irrigation (Portmann et al. 2010). Irrigated and rainfed -crops are placed on separate soil columns, so that irrigation is only -applied to the soil beneath irrigated crops. +equipped for irrigation (:ref:`Portmann et al. 2010 `). +Irrigated and rainfed crops are placed on separate soil columns, so that +irrigation is only applied to the soil beneath irrigated crops. In irrigated croplands, a check is made once per day to determine whether irrigation is required on that day. This check is made in the first time step after 6 AM local time. Irrigation is required if crop -leaf area :math:`>` 0, and :math:`\beta_{t} < 1`, i.e., water is limiting for photosynthesis (see section 8.4). +leaf area :math:`>` 0, and the available soil water is below a specified +threshold. -If irrigation is required, the model computes the deficit between the -current soil moisture content and a target soil moisture content; this -deficit is the amount of water that will be added through irrigation. -The target soil moisture content in each soil layer *i* -(:math:`{s}_{target,i}`, kg m\ :sup:`-2`) is a weighted -average of the minimum soil moisture content that results in no water -stress in that layer (:math:`{s}_{o,i}`, kg m\ :sup:`-2`) and -the soil moisture content at saturation in that layer (:math:`{w}_{sat,i}`, kg m\ :sup:`-2`): +The soil moisture deficit :math:`D_{irrig}` is .. math:: - :label: 25.7) - - w_{target,i} =(1-0.7)\cdot w_{o,i} +0.7\cdot w_{sat,i} - -:math:`{w}_{o,i}` is determined by inverting equation 8.19 in Oleson -et al. (2010a) to solve for the value of :math:`{s}_{i}` (soil -wetness) that makes :math:`\Psi_{i} = \Psi_{o}` (where :math:`\Psi_{i}` is -the soil water matric potential and :math:`\Psi_{o}` is -the soil water potential when stomata are fully open), and then -converting this value to units of kg m\ :sup:`-2`. -:math:`{w}_{sat,i}` is calculated simply by converting effective -porosity (section 7.4) to units of kg m\ :sup:`-2`. The value 0.7 -was determined empirically, in order to give global, annual irrigation -amounts that approximately match observed gross irrigation water use -around the year 2000 (i.e., total water withdrawals for irrigation: -:math:`\sim` 2500 – 3000 km\ :sup:`3` year\ :sup:`-1` -(Shiklomanov 2000)). The total water deficit (:math:`{w}_{deficit}`, -kg m\ :sup:`-2`) of the column is then determined by: + :label: 25.61) + + D_{irrig} = \left\{ + \begin{array}{lr} + w_{thresh} - w_{avail} &\qquad w_{thresh} > w_{avail} \\ + 0 &\qquad w_{thresh} \le w_{avail} + \end{array} \right\} + +where :math:`w_{thresh}` is the irrigation moisture threshold (mm) and +:math:`w_{avail}` is the available moisture (mm). The moisture threshold +is + +.. math:: + :label: 25.62) + + w_{thresh} = f_{thresh} \left(w_{target} - w_{wilt}\right) + w_{wilt} + +where :math:`w_{target}` is the irrigation target soil moisture (mm) + +.. math:: + :label: 25.63) + + w_{target} = \sum_{j=1}^{N_{irr}} \theta_{target} \Delta z_{j} \ , + +:math:`w_{wilt}` is the wilting point soil moisture (mm) .. math:: - :label: 25.8) + :label: 25.64) - w_{deficit} =\sum _{i}\max \left(w_{target,i} -w_{liq,i} ,0\right) + w_{wilt} = \sum_{j=1}^{N_{irr}} \theta_{wilt} \Delta z_{j} \ , -where :math:`{w}_{liq,i}` (kg m\ :sup:`-2`) is the current -soil water content of layer *i* (Chapter 7). The max function means that -a surplus in one layer cannot make up for a deficit in another layer. -The sum is taken only over soil layers that contain roots. In addition, -if the temperature of any soil layer is below freezing, then the sum -only includes layers above the top-most frozen soil layer. +and :math:`f_{thresh}` is a tuning parameter. The available moisture in +the soil is -The amount of water added to this column through irrigation is then -equal to :math:`{w}_{deficit}`. This irrigation is applied at a -constant rate over the following four hours. Irrigation water is applied +.. math:: + :label: 25.65) + + w_{avail} = \sum_{j=1}^{N_{irr}} \theta_{j} \Delta z_{j} \ , + +:math:`N_{irr}` is the index of the soil layer corresponding to a specified +depth :math:`z_{irrig}` (:numref:`Table Irrigation parameters`) and +:math:`\Delta z` is the thickness of the soil layer (section +:numref:`Vertical Discretization`). :math:`\theta_{j}` is the +volumetric soil moisture in layer :math:`j` (section :numref:`Soil Water`). +:math:`\theta_{target}` and +:math:`\theta_{wilt}` are the target and wilting point volumetric +soil moisture values, respectively, and are determined by inverting +:eq:`ZEqnNum316201` using soil matric +potential parameters :math:`\Psi_{target}` and :math:`\Psi_{wilt}` +(:numref:`Table Irrigation parameters`). After the soil moisture deficit +:math:`D_{irrig}` is calculated, irrigation in an amount equal to +:math:`\frac{D_{irrig}}{T_{irrig}}` (mm/s) is applied uniformly over +the irrigation period :math:`T_{irrig}` (s). Irrigation water is applied directly to the ground surface, bypassing canopy interception (i.e., -added to :math:`{q}_{grnd,liq}`: section 7.1). Added irrigation is -removed from total liquid runoff ( :math:`{R}_{liq}`: Chapter 11), -simulating removal from nearby rivers. +added to :math:`{q}_{grnd,liq}`: section :numref:`Canopy Water`). + +To conserve mass, irrigation is removed from river water storage (Chapter 11). +When river water storage is inadequate to meet irrigation demand, +there are two options: 1) the additional water can be removed from the +ocean model, or 2) the irrigation demand can be reduced such that +river water storage is maintained above a specified threshold. + +.. _Table Irrigation parameters: + +.. table:: Irrigation parameters + + +--------------------------------------+-------------+ + | Parameter | | + +======================================+=============+ + | :math:`f_{thresh}` | 1.0 | + +--------------------------------------+-------------+ + | :math:`z_{irrig}` (m) | 0.6 | + +--------------------------------------+-------------+ + | :math:`\Psi_{target}` (mm) | -3400 | + +--------------------------------------+-------------+ + | :math:`\Psi_{wilt}` (mm) | -150000 | + +--------------------------------------+-------------+ + +.. add a reference to surface data in chapter2 + To accomplish this we downloaded + data of percent irrigated and percent rainfed corn, soybean, and + temperate cereals (wheat, barley, and rye) (:ref:`Portmann et al. 2010 `), + available online from + *ftp://ftp.rz.uni-frankfurt.de/pub/uni-frankfurt/physische\_geographie/hydrologie/public/data/MIRCA2000/harvested\_area\_grids.* + + .. _The details about what is new in CLM4.5: @@ -525,7 +567,7 @@ exclusive in CLM4.0. In CLM4.5 we have reversed this situation. Now the irrigation model can be used only while running with CROP. To accomplish this we downloaded data of percent irrigated and percent rainfed corn, soybean, and -temperate cereals (wheat, barley, and rye) (Portmann et al. 2010), +temperate cereals (wheat, barley, and rye) (:ref:`Portmann et al. 2010 `), available online from *ftp://ftp.rz.uni-frankfurt.de/pub/uni-frankfurt/physische\_geographie/hydrologie/public/data/MIRCA2000/harvested\_area\_grids.* diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index ca5fa9f660..70fa76baf7 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -562,8 +562,9 @@ functional type where :math:`z_{h,\, i}` (m) is the depth from the soil surface to the interface between layers :math:`i` and :math:`i+1` (:math:`z_{h,\, 0}` , -the soil surface) (section 6.1), and :math:`r_{a}` and :math:`r_{b}` -are plant-dependent root distribution parameters adopted from :ref:`Zeng (2001) ` +the soil surface) (section :numref:`Vertical Discretization`), and :math:`r_{a}` +and :math:`r_{b}` are plant-dependent root distribution parameters adopted from +:ref:`Zeng (2001) ` (:numref:`Table Plant functional type root distribution parameters`). .. _Table Plant functional type root distribution parameters: diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 3e52821ef7..f884270f62 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -134,6 +134,8 @@ of hydraulic conductivity in porous media. Transport in Porous Media Beven, K.J., and Kirkby, M.J. 1979. A physically based variable contributing area model of basin hydrology. Hydrol. Sci. Bull. 24:43-69. +.. _BohrenHuffman1983: + Bohren, C. F., and Huffman, D. R. 1983. Absorption and scattering of light by small particles. John Wiley & Sons, New York, NY. @@ -1382,7 +1384,7 @@ Pollmer, W.G., Eberhard, D., Klein, D., and Dhillon, B.S. 1979. Genetic control of nitrogen uptake and translocation in maize. Crop Sci. 19:82-86. -.. _Portmann2010: +.. _Portmannetal2010: Portmann, F.T., Siebert, S., and Döll, P. 2010. MIRCA2000 - Global monthly irrigated and rainfed crop areas around the year 2000: A new @@ -1695,12 +1697,14 @@ Area Parameterization for the Community Land Model and its Effect on the Surface Energy Balance. JGR, 117, D21107. DOI:10.1029/2012JD018178. .. _SwensonLawrence2014: + Swenson, S.C., and D. M. Lawrence. 2014. Assessing a dry surface layer-based soil resistance parameterization for the Community Land Model using GRACE and FLUXNET-MTE data. JGR, 119, 10, 299–10,312, DOI:10.1002/2014JD022314. .. _SwensonLawrence2015: + Swenson, S.C., and D. M. Lawrence. 2015. A GRACE-based assessment of interannual groundwater dynamics in the Community Land Model. WRR, 51, doi:10.1002/2015WR017582. diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 82a25eba77..0cd135e220 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -9,8 +9,8 @@ Canopy Radiative Transfer ----------------------------- Radiative transfer within vegetative canopies is calculated from the -two-stream approximation of Dickinson (1983) and Sellers (1985) as -described by Bonan (1996) +two-stream approximation of :ref:`Dickinson (1983) ` and +:ref:`Sellers (1985) ` as described by :ref:`Bonan (1996) ` .. math:: :label: 3.1 @@ -33,10 +33,10 @@ stem elements in the direction :math:`\cos ^{-1} \mu` , leaf and stem area, :math:`\omega` is a scattering coefficient, :math:`\beta` and :math:`\beta _{0}` are upscatter parameters for diffuse and direct beam radiation, respectively, :math:`L` is the -exposed leaf area index (section 2.1.4), and :math:`S` is the exposed -stem area index (section 2.1.4). Given the direct beam albedo -:math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse albedo -:math:`\alpha _{g,\, \Lambda }` of the ground (section 3.2), these +exposed leaf area index , and :math:`S` is the exposed stem area index +(section :numref:`Phenology and vegetation burial by snow`). Given the +direct beam albedo :math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse albedo +:math:`\alpha _{g,\, \Lambda }` of the ground (section :numref:`Ground Albedos`), these equations are solved to calculate the fluxes, per unit incident flux, absorbed by the vegetation, reflected by the vegetation, and transmitted through the vegetation for direct and diffuse radiation and for visible @@ -45,7 +45,7 @@ through the vegetation for direct and diffuse radiation and for visible radiation is partitioned to sunlit and shaded fractions of the canopy. The optical parameters :math:`G\left(\mu \right)`, :math:`\bar{\mu }`, :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}` are calculated -based on work in Sellers (1985) as follows. +based on work in :ref:`Sellers (1985) ` as follows. The relative projected area of leaves and stems in the direction :math:`\cos ^{-1} \mu` is @@ -70,10 +70,12 @@ The average inverse diffuse optical depth per unit leaf and stem area is where :math:`\mu '` is the direction of the scattered flux. -The optical parameters :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}`, which vary with wavelength (:math:`\Lambda` ), are -weighted combinations of values for vegetation and snow. The model determines that snow is on the canopy if :math:`T_{v} \le T_{f}` , where -:math:`T_{v}` is the vegetation temperature (K) (Chapter 5) and :math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). In -this case, the optical parameters are +The optical parameters :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}`, +which vary with wavelength (:math:`\Lambda` ), are weighted combinations of values +for vegetation and snow. The model determines that snow is on the canopy if +:math:`T_{v} \le T_{f}` , where :math:`T_{v}` is the vegetation temperature (K) (Chapter +:numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) and :math:`T_{f}` is the +freezing temperature of water (K) (:numref:`Table Physical Constants`). In this case, the optical parameters are .. math:: :label: 3.5 @@ -90,7 +92,7 @@ this case, the optical parameters are \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{0,\, \Lambda }^{sno} f_{wet} -where :math:`f_{wet}` is the wetted fraction of the canopy (section 7.1). The snow and vegetation weights are applied to the products +where :math:`f_{wet}` is the wetted fraction of the canopy (section :numref:`Canopy Water`). The snow and vegetation weights are applied to the products :math:`\omega _{\Lambda } \beta _{\Lambda }` and :math:`\omega _{\Lambda } \beta _{0,\, \Lambda }` because these products are used in the two-stream equations. If there is no snow on the canopy, @@ -413,12 +415,13 @@ The parameters :math:`h_{1}` –:math:`h_{10}` , :math:`\sigma` , h_{10} =\frac{-s_{1} \left(u_{2} -\bar{\mu }h\right)}{d_{2} } . -Plant functional type optical properties (Table 3.1) for trees and -shrubs are from Dorman and Sellers (1989). Leaf and stem optical +Plant functional type optical properties (:numref:`Table Plant functional type optical properties`) +for trees and shrubs are from :ref:`Dorman and Sellers (1989) `. Leaf and stem optical properties (placeVIS and NIR reflectance and transmittance) were derived for grasslands and crops from full optical range spectra of measured -optical properties (Asner et al. 1998). Optical properties for -intercepted snow (Table 3.2) are from Sellers et al. (1986). +optical properties (:ref:`Asner et al. 1998 `). Optical properties for +intercepted snow (:numref:`Table Intercepted snow optical properties`) are +:ref:`from Sellers et al. (1986) `. .. _Table Plant functional type optical properties: @@ -495,7 +498,8 @@ intercepted snow (Table 3.2) are from Sellers et al. (1986). Ground Albedos ------------------ -The overall direct beam :math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse :math:`\alpha _{g,\, \Lambda }` ground albedos are weighted +The overall direct beam :math:`\alpha _{g,\, \Lambda }^{\mu }` and diffuse +:math:`\alpha _{g,\, \Lambda }` ground albedos are weighted combinations of “soil†and snow albedos .. math:: @@ -508,11 +512,12 @@ combinations of “soil†and snow albedos \alpha _{g,\, \Lambda } =\alpha _{soi,\, \Lambda } \left(1-f_{sno} \right)+\alpha _{sno,\, \Lambda } f_{sno} -where :math:`f_{sno}` is the fraction of the ground covered with snow (section 7.2.1). +where :math:`f_{sno}` is the fraction of the ground covered with snow +(section :numref:`Snow Covered Area Fraction`). :math:`\alpha _{soi,\, \Lambda }^{\mu }` and :math:`\alpha _{soi,\, \Lambda }` vary with glacier, lake, wetland, and -soil surfaces. Glacier albedos are from Paterson (1994) +soil surfaces. Glacier albedos are from :ref:`Paterson (1994) ` .. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.6 @@ -526,13 +531,13 @@ zenith angle :math:`\mu` \alpha _{soi,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda } =0.05\left(\mu +0.15\right)^{-1} . -Frozen lake and wetland albedos are from NCAR LSM (Bonan 1996) +Frozen lake and wetland albedos are from NCAR LSM (:ref:`Bonan 1996 `) .. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.60 .. math:: \alpha _{soi,\, nir}^{\mu } =\alpha _{soi,\, nir} =0.40. -As in NCAR LSM (Bonan 1996), soil albedos vary with color class +As in NCAR LSM (:ref:`Bonan 1996 `), soil albedos vary with color class .. math:: :label: 3.61 @@ -540,18 +545,20 @@ As in NCAR LSM (Bonan 1996), soil albedos vary with color class \alpha _{soi,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda } =\left(\alpha _{sat,\, \Lambda } +\Delta \right)\le \alpha _{dry,\, \Lambda } where :math:`\Delta` depends on the volumetric water content of the -first soil layer :math:`\theta _{1}` (section 7.4) as +first soil layer :math:`\theta _{1}` (section :numref:`Soil Water`) as :math:`\Delta =0.11-0.40\theta _{1} >0`, and :math:`\alpha _{sat,\, \Lambda }` and :math:`\alpha _{dry,\, \Lambda }` are albedos for saturated and dry -soil color classes (Table 3.3). +soil color classes (:numref:`Table Dry and saturated soil albedos`). CLM soil colors are prescribed so that they best reproduce observed MODIS local solar noon surface albedo values at the CLM grid cell -following the methods of Lawrence and Chase (2007). The soil colors are -fitted over the range of 20 soil classes shown in Table 3.3 and compared +following the methods of :ref:`Lawrence and Chase (2007) `. +The soil colors are fitted over the range of 20 soil classes shown in +:numref:`Table Dry and saturated soil albedos` and compared to the MODIS monthly local solar noon all-sky surface albedo as -described in Strahler et al. (1999) and Schaaf et al. (2002). The CLM +described in :ref:`Strahler et al. (1999) ` and +:ref:`Schaaf et al. (2002) `. The CLM two-stream radiation model was used to calculate the model equivalent surface albedo using climatological monthly soil moisture along with the vegetation parameters of PFT fraction, LAI, and SAI. The soil color that @@ -563,31 +570,33 @@ snow-free surface albedo for the year, the soil color derived from snow-affected albedo was used to give a representative soil color that included the effects of the minimum permanent snow cover. -Table 3.3. Dry and saturated soil albedos - -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| Color Class | vis | nir | vis | nir | Color Class | vis | nir | vis | nir | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ -| 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | -+---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ +.. _Table Dry and saturated soil albedos: + +.. table:: Dry and saturated soil albedos + + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | Color Class | vis | nir | vis | nir | Color Class | vis | nir | vis | nir | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ .. _Snow Albedo: @@ -596,16 +605,18 @@ Snow Albedo Snow albedo and solar absorption within each snow layer are simulated with the Snow, Ice, and Aerosol Radiative Model (SNICAR), which -incorporates a two-stream radiative transfer solution from Toon et al. -(1989). Albedo and the vertical absorption profile depend on solar -zenith angle, albedo of the substrate underlying snow, mass +incorporates a two-stream radiative transfer solution from +:ref:`Toon et al. (1989) `. Albedo and the vertical absorption +profile depend on solar zenith angle, albedo of the substrate underlying snow, mass concentrations of atmospheric-deposited aerosols (black carbon, mineral dust, and organic carbon), and ice effective grain size (:math:`r_{e}`), which is simulated with a snow aging routine -described in section 3.2.3. Representation of impurity mass -concentrations within the snowpack is described in section 7.2.4. -Implementation of SNICAR in CLM is also described somewhat by Flanner -and Zender (2005) and Flanner et al. (2007). +described in section :numref:`Snow Aging`. Representation of impurity mass +concentrations within the snowpack is described in section +:numref:`Black and organic carbon and mineral dust within snow`. +Implementation of SNICAR in CLM is also described somewhat by +:ref:`Flanner and Zender (2005) ` and +:ref:`Flanner et al. (2007) `. The two-stream solution requires the following bulk optical properties for each snow layer and spectral band: extinction optical depth @@ -615,7 +626,7 @@ calculations are identical to snow layers applied elsewhere in CLM, except for the case when snow mass is greater than zero but no snow layers exist. When this occurs, a single radiative layer is specified to have the column snow mass and an effective grain size of freshly-fallen -snow (section 3.2.3). The bulk optical properties are weighted functions +snow (section :numref:`Snow Aging`). The bulk optical properties are weighted functions of each constituent *k*, computed for each snow layer and spectral band as @@ -634,39 +645,42 @@ as g=\frac{\sum _{1}^{k}g_{k} \omega _{k} \tau _{k} }{\sum _{1}^{k}\omega _{k} \tau _{k} } -For each constituent (ice, two black carbon species, two organic carbon species, and four dust species), :math:`\omega`, *g*, and -the mass extinction cross-section :math:`\psi` (m\ :sup:`2` kg\ :sub:`-1`) -are computed offline with Mie Theory, e.g., applying the computational technique from Bohren and Huffman (1983). The -extinction optical depth for each constituent depends on its mass extinction cross-section and layer mass, :math:`w _{k}` (kg\ m\ :sup:`-1`) as +For each constituent (ice, two black carbon species, two organic carbon species, and +four dust species), :math:`\omega`, *g*, and the mass extinction cross-section +:math:`\psi` (m\ :sup:`2` kg\ :sub:`-1`) are computed offline with Mie Theory, e.g., +applying the computational technique from :ref:`Bohren and Huffman (1983) `. +The extinction optical depth for each constituent depends on its mass extinction +cross-section and layer mass, :math:`w _{k}` (kg\ m\ :sup:`-1`) as .. math:: :label: 3.65 \tau _{k} =\psi _{k} w_{k} -The two-stream solution (Toon et al. 1989) applies a tri-diagonal matrix +The two-stream solution (:ref:`Toon et al. (1989) `) applies a tri-diagonal matrix solution to produce upward and downward radiative fluxes at each layer interface, from which net radiation, layer absorption, and surface albedo are easily derived. Solar fluxes are computed in five spectral -bands, listed in Table 3.4. Because snow albedo varies strongly across +bands, listed in :numref:`Table Spectral bands and weights used for snow radiative transfer`. +Because snow albedo varies strongly across the solar spectrum, it was determined that four bands were needed to accurately represent the near-infrared (NIR) characteristics of snow, whereas only one band was needed for the visible spectrum. Boundaries of the NIR bands were selected to capture broad radiative features and -maximize accuracy and computational efficiency. We partition NIR -(0.7-5.0 :math:`\mu` m) surface downwelling flux from CLM -according to the weights listed in Table 3.4, which are unique for -diffuse and direct incident flux. These fixed weights were determined -with offline hyperspectral radiative transfer calculations for an -atmosphere typical of mid-latitude winter (Flanner et al. 2007). The -tri-diagonal solution includes intermediate terms that allow for easy +maximize accuracy and computational efficiency. We partition NIR (0.7-5.0 +:math:`\mu` m) surface downwelling flux from CLM according to the weights listed +in :numref:`Table Spectral bands and weights used for snow radiative transfer`, +which are unique for diffuse and direct incident flux. These fixed weights were +determined with offline hyperspectral radiative transfer calculations for an +atmosphere typical of mid-latitude winter (:ref:`Flanner et al. (2007) `). +The tri-diagonal solution includes intermediate terms that allow for easy interchange of two-stream techniques. We apply the Eddington solution -for the visible band (following Wiscombe and Warren 1980) and the -hemispheric mean solution (Toon et al. 1989) for NIR bands. These +for the visible band (following :ref:`Wiscombe and Warren 1980 `) and the +hemispheric mean solution ((:ref:`Toon et al. (1989) `) for NIR bands. These choices were made because the Eddington scheme works well for highly scattering media, but can produce negative albedo for absorptive NIR bands with diffuse incident flux. Delta scalings are applied to -:math:`\tau`, :math:`\omega`, and :math:`g` (Wiscombe and Warren 1980) in +:math:`\tau`, :math:`\omega`, and :math:`g` (:ref:`Wiscombe and Warren 1980 `) in all spectral bands, producing effective values (denoted with \*) that are applied in the two-stream solution @@ -685,21 +699,23 @@ are applied in the two-stream solution g^{*} =\frac{g}{1+g} -Table 3.4. Spectral bands and weights used for snow radiative transfer - -+---------------------------------------------------------+----------------------+------------------+ -| Spectral band | Direct-beam weight | Diffuse weight | -+=========================================================+======================+==================+ -| Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | -+---------------------------------------------------------+----------------------+------------------+ -| Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | -+---------------------------------------------------------+----------------------+------------------+ -| Band 3: 1.0-1.2\ :math:`\mu`\ m (near-IR) | 0.181 | 0.202 | -+---------------------------------------------------------+----------------------+------------------+ -| Band 4: 1.2-1.5\ :math:`\mu`\ m (near-IR) | 0.121 | 0.109 | -+---------------------------------------------------------+----------------------+------------------+ -| Band 5: 1.5-5.0\ :math:`\mu`\ m (near-IR) | 0.204 | 0.103 | -+---------------------------------------------------------+----------------------+------------------+ +.. _Table Spectral bands and weights used for snow radiative transfer: + +.. table:: Spectral bands and weights used for snow radiative transfer + + +---------------------------------------------------------+----------------------+------------------+ + | Spectral band | Direct-beam weight | Diffuse weight | + +=========================================================+======================+==================+ + | Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | + +---------------------------------------------------------+----------------------+------------------+ + | Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | + +---------------------------------------------------------+----------------------+------------------+ + | Band 3: 1.0-1.2\ :math:`\mu`\ m (near-IR) | 0.181 | 0.202 | + +---------------------------------------------------------+----------------------+------------------+ + | Band 4: 1.2-1.5\ :math:`\mu`\ m (near-IR) | 0.121 | 0.109 | + +---------------------------------------------------------+----------------------+------------------+ + | Band 5: 1.5-5.0\ :math:`\mu`\ m (near-IR) | 0.204 | 0.103 | + +---------------------------------------------------------+----------------------+------------------+ Under direct-beam conditions, singularities in the radiative approximation are occasionally approached in spectral bands 4 and 5 that @@ -743,7 +759,8 @@ absorption fluxes that are used for column temperature calculations are This weighting is performed for direct-beam and diffuse, visible and NIR fluxes. After the ground-incident fluxes (transmitted through the vegetation canopy) have been calculated for the current time step -(sections 3.1 and 4.1), the layer absorption factors +(sections :numref:`Canopy Radiative Transfer` and :numref:`Solar Fluxes`), +the layer absorption factors (:math:`S_{g,\, i}`) are multiplied by the ground-incident fluxes to produce solar absorption (W m\ :sup:`-2`) in each snow layer and @@ -779,98 +796,107 @@ weighted by the diffuse albedo for a semi-infinite snowpack (:math:`\alpha _{sno Inclusion of this additional albedo weight was found to improve accuracy of the five-band albedo solutions (relative to 470-band solutions) because of the strong dependence of optically-thick snowpack albedo on -ice grain single-scatter albedo (Flanner et al. 2007). The lookup tables -contain optical properties for lognormal distributions of ice particles -over the range of effective radii: 30\ :math:`\mu`\ m -:math:`< r _{e} < \text{1500} \mu \text{m}`, at 1 :math:`\mu` m resolution. Single-scatter albedos for the end-members of this size -range are listed in Table 3.5. - -Optical properties for black carbon are described in Flanner et al. -(2007). Single-scatter albedo, mass extinction cross-section, and +ice grain single-scatter albedo (:ref:`Flanner et al. (2007) `). +The lookup tables contain optical properties for lognormal distributions of ice +particles over the range of effective radii: 30\ :math:`\mu`\ m +:math:`< r _{e} < \text{1500} \mu \text{m}`, at 1 :math:`\mu` m resolution. +Single-scatter albedos for the end-members of this size range are listed in +:numref:`Table Single-scatter albedo values used for snowpack impurities and ice`. + +Optical properties for black carbon are described in :ref:`Flanner et al. (2007) `. +Single-scatter albedo, mass extinction cross-section, and asymmetry parameter values for all snowpack species, in the five -spectral bands used, are listed in Tables 3.5, 3.6, and 3.7. These -properties were also derived with Mie Theory, using various published +spectral bands used, are listed in :numref:`Table Single-scatter albedo values used for snowpack impurities and ice`, +:numref:`Table Mass extinction values`, and +:numref:`Table Asymmetry scattering parameters used for snowpack impurities and ice`. +These properties were also derived with Mie Theory, using various published sources of indices of refraction and assumptions about particle size distribution. Weighting into the five CLM spectral bands was determined only with incident solar flux, as in equation . -Table 3.5. Single-scatter albedo values used for snowpack impurities and ice - -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | -+================================================================+==========+==========+==========+==========+==========+ -| Hydrophilic black carbon | 0.516 | 0.434 | 0.346 | 0.276 | 0.139 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic black carbon | 0.288 | 0.187 | 0.123 | 0.089 | 0.040 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophilic organic carbon | 0.997 | 0.994 | 0.990 | 0.987 | 0.951 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic organic carbon | 0.963 | 0.921 | 0.860 | 0.814 | 0.744 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 1 | 0.979 | 0.994 | 0.993 | 0.993 | 0.953 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 2 | 0.944 | 0.984 | 0.989 | 0.992 | 0.983 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 3 | 0.904 | 0.965 | 0.969 | 0.973 | 0.978 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 4 | 0.850 | 0.940 | 0.948 | 0.953 | 0.955 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 0.9999 | 0.9999 | 0.9992 | 0.9938 | 0.9413 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 0.9998 | 0.9960 | 0.9680 | 0.8730 | 0.5500 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ - -Table 3.6. Mass extinction values (m\ :sup:`2` kg\ :sub:`-1`) used for snowpack impurities and ice. - -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | -+================================================================+==========+==========+==========+==========+==========+ -| Hydrophilic black carbon | 25369 | 12520 | 7739 | 5744 | 3527 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic black carbon | 11398 | 5923 | 4040 | 3262 | 2224 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophilic organic carbon | 37774 | 22112 | 14719 | 10940 | 5441 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic organic carbon | 3289 | 1486 | 872 | 606 | 248 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 1 | 2687 | 2420 | 1628 | 1138 | 466 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 2 | 841 | 987 | 1184 | 1267 | 993 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 3 | 388 | 419 | 400 | 397 | 503 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 4 | 197 | 203 | 208 | 205 | 229 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 55.7 | 56.1 | 56.3 | 56.6 | 57.3 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 1.09 | 1.09 | 1.09 | 1.09 | 1.1 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ - -Table 3.7. Asymmetry scattering parameters used for snowpack impurities and ice. - -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | -+================================================================+==========+==========+==========+==========+==========+ -| Hydrophilic black carbon | 0.52 | 0.34 | 0.24 | 0.19 | 0.10 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic black carbon | 0.35 | 0.21 | 0.15 | 0.11 | 0.06 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophilic organic carbon | 0.77 | 0.75 | 0.72 | 0.70 | 0.64 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Hydrophobic organic carbon | 0.62 | 0.57 | 0.54 | 0.51 | 0.44 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 1 | 0.69 | 0.72 | 0.67 | 0.61 | 0.44 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 2 | 0.70 | 0.65 | 0.70 | 0.72 | 0.70 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 3 | 0.79 | 0.75 | 0.68 | 0.63 | 0.67 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Dust 4 | 0.83 | 0.79 | 0.77 | 0.76 | 0.73 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 30\ :math:`\mu`\ m) | 0.88 | 0.88 | 0.88 | 0.88 | 0.90 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ -| Ice (:math:`r _{e}` = 1500\ :math:`\mu`\ m) | 0.89 | 0.90 | 0.90 | 0.92 | 0.97 | -+----------------------------------------------------------------+----------+----------+----------+----------+----------+ +.. _Table Single-scatter albedo values used for snowpack impurities and ice: + +.. table:: Single-scatter albedo values used for snowpack impurities and ice + + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | + +================================================================+==========+==========+==========+==========+==========+ + | Hydrophilic black carbon | 0.516 | 0.434 | 0.346 | 0.276 | 0.139 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic black carbon | 0.288 | 0.187 | 0.123 | 0.089 | 0.040 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophilic organic carbon | 0.997 | 0.994 | 0.990 | 0.987 | 0.951 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic organic carbon | 0.963 | 0.921 | 0.860 | 0.814 | 0.744 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 1 | 0.979 | 0.994 | 0.993 | 0.993 | 0.953 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 2 | 0.944 | 0.984 | 0.989 | 0.992 | 0.983 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 3 | 0.904 | 0.965 | 0.969 | 0.973 | 0.978 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 4 | 0.850 | 0.940 | 0.948 | 0.953 | 0.955 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 0.9999 | 0.9999 | 0.9992 | 0.9938 | 0.9413 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 0.9998 | 0.9960 | 0.9680 | 0.8730 | 0.5500 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + +.. _Table Mass extinction values: + +.. table:: Mass extinction values (m\ :sup:`2` kg\ :sub:`-1`) used for snowpack impurities and ice + + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | + +================================================================+==========+==========+==========+==========+==========+ + | Hydrophilic black carbon | 25369 | 12520 | 7739 | 5744 | 3527 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic black carbon | 11398 | 5923 | 4040 | 3262 | 2224 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophilic organic carbon | 37774 | 22112 | 14719 | 10940 | 5441 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic organic carbon | 3289 | 1486 | 872 | 606 | 248 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 1 | 2687 | 2420 | 1628 | 1138 | 466 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 2 | 841 | 987 | 1184 | 1267 | 993 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 3 | 388 | 419 | 400 | 397 | 503 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 4 | 197 | 203 | 208 | 205 | 229 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 30 :math:`\mu` m) | 55.7 | 56.1 | 56.3 | 56.6 | 57.3 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 1500 :math:`\mu` m) | 1.09 | 1.09 | 1.09 | 1.09 | 1.1 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + +.. _Table Asymmetry scattering parameters used for snowpack impurities and ice: + +.. table:: Asymmetry scattering parameters used for snowpack impurities and ice. + + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | + +================================================================+==========+==========+==========+==========+==========+ + | Hydrophilic black carbon | 0.52 | 0.34 | 0.24 | 0.19 | 0.10 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic black carbon | 0.35 | 0.21 | 0.15 | 0.11 | 0.06 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophilic organic carbon | 0.77 | 0.75 | 0.72 | 0.70 | 0.64 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Hydrophobic organic carbon | 0.62 | 0.57 | 0.54 | 0.51 | 0.44 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 1 | 0.69 | 0.72 | 0.67 | 0.61 | 0.44 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 2 | 0.70 | 0.65 | 0.70 | 0.72 | 0.70 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 3 | 0.79 | 0.75 | 0.68 | 0.63 | 0.67 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Dust 4 | 0.83 | 0.79 | 0.77 | 0.76 | 0.73 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 30\ :math:`\mu`\ m) | 0.88 | 0.88 | 0.88 | 0.88 | 0.90 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ + | Ice (:math:`r _{e}` = 1500\ :math:`\mu`\ m) | 0.89 | 0.90 | 0.90 | 0.92 | 0.97 | + +----------------------------------------------------------------+----------+----------+----------+----------+----------+ .. _Snow Aging: @@ -881,9 +907,9 @@ Snow aging is represented as evolution of the ice effective grain size (:math:`r_{e}`). Previous studies have shown that use of spheres which conserve the surface area-to-volume ratio (or specific surface area) of ice media composed of more complex shapes produces relatively -small errors in simulated hemispheric fluxes (e.g., Grenfell and Warren -1999). Effective radius is the surface area-weighted mean radius of an -ensemble of spherical particles and is directly related to specific +small errors in simulated hemispheric fluxes (e.g., :ref:`Grenfell and Warren +1999 `). Effective radius is the surface area-weighted mean +radius of an ensemble of spherical particles and is directly related to specific surface area (*SSA*) as :math:`r_{e} ={3\mathord{\left/ {\vphantom {3 \left(\rho _{ice} SSA\right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} SSA\right)}` , where :math:`\rho_{ice}` is the density of ice. Hence, @@ -892,7 +918,7 @@ snowpack microphysical state to dry snow radiative characteristics. Wet snow processes can also drive rapid changes in albedo. The presence of liquid water induces rapid coarsening of the surrounding ice grains -(e.g., Brun 1989), and liquid water tends to refreeze into large ice +(e.g., :ref:`Brun 1989 `), and liquid water tends to refreeze into large ice clumps that darken the bulk snowpack. The presence of small liquid drops, by itself, does not significantly darken snowpack, as ice and water have very similar indices of refraction throughout the solar @@ -920,9 +946,9 @@ Here, the effective radius of freshly-fallen snow (:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sub:`-1`), and the effective radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. -Dry snow aging is based on a microphysical model described by Flanner -and Zender (2006). This model simulates diffusive vapor flux amongst -collections of ice crystals with various size and inter-particle +Dry snow aging is based on a microphysical model described by :ref:`Flanner +and Zender (2006) `. This model simulates diffusive vapor flux +amongst collections of ice crystals with various size and inter-particle spacing. Specific surface area and effective radius are prognosed for any combination of snow temperature, temperature gradient, density, and initial size distribution. The combination of warm snow, large @@ -960,7 +986,7 @@ top soil layer, and for the top snow layer it is assumed that :math:`T_{n-1}` = :math:`T_{n}`. The contribution of liquid water to enhanced metamorphism is based on -parametric equations published by Brun (1989), who measured grain +parametric equations published by :ref:`Brun (1989) `, who measured grain growth rates under different liquid water contents. This relationship, expressed in terms of :math:`r_{e} (\mu \text{m})` and subtracting an offset due to dry aging, depends on the mass liquid water @@ -972,16 +998,18 @@ fraction :math:`f_{liq}` as \frac{dr_{e} }{dt} =\frac{10^{18} C_{1} f_{liq} ^{3} }{4\pi r_{e} ^{2} } The constant *C*\ :sub:`1` is 4.22\ :math:`\times`\ 10\ :sup:`-13`, and: -:math:`f_{liq} =w_{liq} /(w_{liq} +w_{ice} )`\ (section 7.2). +:math:`f_{liq} =w_{liq} /(w_{liq} +w_{ice} )`\ (Chapter :numref:`rst_Snow Hydrology`). In cases where snow mass is greater than zero, but a snow layer has not yet been defined, :math:`r_{e}` is set to :math:`r_{e,0}`. When snow layers are combined or divided, :math:`r_{e}` is calculated as a mass-weighted mean of the two layers, following computations of other state variables (section -7.2.7). Finally, the allowable range of :math:`r_{e}`, +:numref:`Snow Layer Combination and Subdivision`). Finally, the allowable range of :math:`r_{e}`, corresponding to the range over which Mie optical properties have been defined, is 30-1500\ :math:`\mu` m. +.. _Solar Zenith Angle: + Solar Zenith Angle ---------------------- @@ -1008,8 +1036,8 @@ where :math:`d` is calendar day (:math:`d=0.0` at 0Z on January 1), and :math:`\theta` is longitude (radians) (positive east of the CityplaceGreenwich meridian). -The solar declination angle :math:`\delta` is calculated as in Berger -(1978a,b) and is valid for one million years past or hence, relative to +The solar declination angle :math:`\delta` is calculated as in :ref:`Berger +(1978a,b) ` and is valid for one million years past or hence, relative to 1950 A.D. The orbital parameters may be specified directly or the orbital parameters are calculated for the desired year. The required orbital parameters to be input by the user are the obliquity of the @@ -1018,7 +1046,7 @@ Earth :math:`\varepsilon` (degrees, :math:`e` (:math:`0.0`)). The solar declination :math:`\delta` (radians) is .. math:: @@ -1036,10 +1064,10 @@ The obliquity of the Earth :math:`\varepsilon` (degrees) is \varepsilon =\varepsilon *+\sum _{i=1}^{i=47}A_{i} \cos \left(f_{i} t+\delta _{i} \right) -where :math:`\varepsilon *` is a constant of integration (Table 3.8), +where :math:`\varepsilon *` is a constant of integration (:numref:`Table Orbital parameters`), :math:`A_{i}` , :math:`f_{i}` , and :math:`\delta _{i}` are amplitude, -mean rate, and phase terms in the cosine series expansion (Berger -1978a,b), and :math:`t=t_{0} -1950` where :math:`t_{0}` is the year. +mean rate, and phase terms in the cosine series expansion (:ref:`Berger +(1978a,b) `, and :math:`t=t_{0} -1950` where :math:`t_{0}` is the year. The series expansion terms are not shown here but can be found in the source code file shr\_orb\_mod.F90. @@ -1087,7 +1115,7 @@ where are the cosine and sine series expansions for :math:`e`, and :math:`M_{j}` , :math:`g_{j}` , and :math:`B_{j}` are amplitude, mean -rate, and phase terms in the series expansions (Berger 1978a,b). The +rate, and phase terms in the series expansions (:ref:`Berger (1978a,b) `). The longitude of the perihelion relative to the moving vernal equinox :math:`\tilde{\omega }` (degrees) is @@ -1110,9 +1138,9 @@ orbit relative to the fixed stars. The general precession :math:`\psi` \psi =\frac{\tilde{\psi }t}{3600} +\zeta +\sum _{i=1}^{78}F_{i} \sin \left(f_{i} ^{{'} } t+\delta _{i} ^{{'} } \right) where :math:`\tilde{\psi }` (arcseconds) and :math:`\zeta` (degrees) -are constants (Table 3.8), and :math:`F_{i}` , :math:`f_{i} ^{{'} }` , +are constants (:numref:`Table Orbital parameters`), and :math:`F_{i}` , :math:`f_{i} ^{{'} }` , and :math:`\delta _{i} ^{{'} }` are amplitude, mean rate, and phase -terms in the sine series expansion (Berger 1978a,b). The longitude of +terms in the sine series expansion (:ref:`Berger (1978a,b) `)). The longitude of the perihelion :math:`\Pi` (radians) depends on the sine and cosine series expansions for the eccentricity :math:`e`\ as follows: @@ -1125,16 +1153,18 @@ The numerical solution for the longitude of the perihelion :math:`\tilde{\omega }` is constrained to be between 0 and 360 degrees (measured from the autumn equinox). A constant 180 degrees is then added to :math:`\tilde{\omega }` because the Sun is considered as revolving -around the Earth (geocentric coordinate system) (Berger et al. 1993). - -Table 3.8. Orbital parameters - -+--------------------------------------+-------------+ -| Parameter | | -+======================================+=============+ -| :math:`\varepsilon *` | 23.320556 | -+--------------------------------------+-------------+ -| :math:`\tilde{\psi }` (arcseconds) | 50.439273 | -+--------------------------------------+-------------+ -| :math:`\zeta` (degrees) | 3.392506 | -+--------------------------------------+-------------+ +around the Earth (geocentric coordinate system) (:ref:`Berger et al. 1993 `)). + +.. _Table Orbital parameters: + +.. table:: Orbital parameters + + +--------------------------------------+-------------+ + | Parameter | | + +======================================+=============+ + | :math:`\varepsilon *` | 23.320556 | + +--------------------------------------+-------------+ + | :math:`\tilde{\psi }` (arcseconds) | 50.439273 | + +--------------------------------------+-------------+ + | :math:`\zeta` (degrees) | 3.392506 | + +--------------------------------------+-------------+ From 76f93f7ff0c06d7c98ea478d8d3989c3ac777c5b Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Wed, 24 May 2017 12:12:18 -0600 Subject: [PATCH 018/730] Updated Crop chapter summary and added CLM4.5 tech note reference --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 39 ++++++++++++------- .../References/CLM50_Tech_Note_References.rst | 4 ++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 80cd1e3527..aa2e130e68 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -3,32 +3,43 @@ Crops and Irrigation ======================== -Summary of CLM4.5 updates relative to the CLM4.0 +Summary of CLM5.0 updates relative to the CLM4.5 ----------------------------------------------------- We describe here the complete crop and irrigation parameterizations that -appear in CLM4.5. Corresponding information for CLM4.0 appeared on the -CLM4.0 web site in a pdf document independent of the CLM4.0 Technical +appear in CLM5.0. Corresponding information for CLM4.5 appeared on the +CLM4.5 web site in a pdf document independent of the CLM4.5 Technical Note (Oleson et al. 2010a). The CLM4.0 crop model description also appeared in Levis et al. (2012). -CLM4.5 includes the following updates to the CROP option, where CROP -refers to the interactive crop management model: +CLM5.0 includes the following updates to the CROP option, where CROP +refers to the interactive crop management model and is included by default with the BGC configuration: -- Interactive irrigation +- New crop functional types -- Interactive fertilization +- All crop areas are actively managed -- Biological nitrogen fixation for soybeans +- Fertilization rates updated based on crop type and geographic region -- Modified C:N ratios for crops +- Irrigation updates -- Nitrogen retranslocation for crops +- Phenological triggers vary by latitude for some crop types -- Separate reproductive pool +- Ability to simulate transient crop management -These updates appear in detail in section 20.4. Most also appear in -Drewniak et al. (2013). +- Adjustments to allocation and phenological parameters + +- Crops reaching their maximum LAI triggers the grain fill phase + +- Grain C and N pools are included in a 1-year product pool + +- C for annual crop seeding comes from the grain C pool + +- Initial seed C for planting is increased from 1 to 3 g C/m^2 + + +These updates appear in detail in the sections below. Many also appear in +Levis et al. (2016). The crop model ------------------- @@ -55,7 +66,7 @@ management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 [CLM3.0, Oleson et al. (2004)] (not published), then coupled to the CLM3.5 (Levis et al. 2009) and later released to the community with -CLM4CN (Levis et al. 2012). +CLM4CN (Levis et al. 2012) and CLM4.5. With interactive crop management and, therefore, a more accurate representation of agricultural landscapes, we hope to improve the CLM’s diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index b953d98b3d..a7c59328dd 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -886,6 +886,10 @@ Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Kluzek, E. Community Land Model (CLMU). NCAR Technical Note NCAR/TN-480+STR, National Center for Atmospheric Research, Boulder, CO, 169 pp. +Oleson, K.W., et al. 2013. Technical description of version 4.5 of the +Community Land Model (CLM). NCAR Technical Note NCAR/TN-503+STR, +National Center for Atmospheric Research, Boulder, CO, 420 pp. + Olson, J.S., 1963. Energy storage and the balance of producers and decomposers in ecological systems. Ecology 44:322-331. From 9255276dd7f087458921c1cb663818e39dc58f74 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 24 May 2017 13:56:30 -0600 Subject: [PATCH 019/730] update irrigation --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 449341c0f9..ef249b0ee0 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -273,14 +273,14 @@ phase 3. Other allocation coefficients change to: .. math:: :label: ZEqnNum833921 - \begin{array}{l} - {a_{leaf} =a_{leaf}^{i,3} {\rm \; \; \; when\; \; \; }a_{leaf}^{i,3} \le a_{leaf}^{f} {\rm \; \; \; else...}} \\ - {a_{leaf} =a_{leaf} \left(1-\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \right)^{d_{alloc}^{leaf} } \ge a_{leaf}^{f} {\rm \; \; \; where\; \; \; }\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \le 1} \\ - {} \\ - {a_{livestem} =a_{livestem}^{i,3} {\rm \; \; \; when\; \; \; }a_{livestem}^{i,3} \le a_{livestem}^{f} {\rm \; \; \; else...}} \\ - {a_{livestem} =a_{livestem} \left(1-\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \right)^{d_{alloc}^{stem} } \ge a_{livestem}^{f} {\rm \; \; \; where\; \; \; }\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \le 1} \\ - {} \\ - {a_{repr} =1-a_{froot} -a_{livestem} -a_{leaf} } + \begin{array}{lr} + a_{leaf} =a_{leaf}^{i,3} & {\rm when} \quad a_{leaf}^{i,3} \le a_{leaf}^{f} \quad {\rm else} \\ + a_{leaf} =a_{leaf} \left(1-\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \right)^{d_{alloc}^{leaf} } \ge a_{leaf}^{f} & {\rm where} \quad \frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \le 1 \\ + \\ + a_{livestem} =a_{livestem}^{i,3} & {\rm when} \quad a_{livestem}^{i,3} \le a_{livestem}^{f} \quad {\rm else} \\ + a_{livestem} =a_{livestem} \left(1-\frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \right)^{d_{alloc}^{stem} } \ge a_{livestem}^{f} & {\rm where} \quad \frac{GDD_{T_{{\rm 2m}} } -h}{GDD_{{\rm mat}} d_{L} -h} \le 1 \\ + \\ + a_{repr} =1-a_{froot} -a_{livestem} -a_{leaf} \end{array} where :math:`a_{leaf}^{i,3}` and :math:`a_{livestem}^{i,3}` (initial From c5821ded00e5980d12937106ee4b0814df4dca08 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 May 2017 16:22:26 -0600 Subject: [PATCH 020/730] Add html files back in, and make a few changes to getting-help for Users Guide --- doc/source/users_guide/overview/getting-help.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index fb5069226b..8d45c71bcb 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -3,13 +3,13 @@ ============== Getting Help ============== -In addition to this users-guide there are several other resources that are available to help you use CLM4.5. The first one is the CESM1.2.0 User's-Guide, which documents the entire process of creating cases with CESM1.2.0. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in CESM1.2.0. +In addition to this users-guide there are several other resources that are available to help you use CLM5.0. The first one is the CESM1.2.0 User's-Guide, which documents the entire process of creating cases with CESM1.2.0. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in CESM1.2.0. --------------------------- The CESM User's-Guide --------------------------- -CLM4.5 in CESM1.2.0 is always run from within the standard CESM1.2.0 build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the CESM1.2.0 scripts and understand how to work with them. User's-Guide documentation on the CESM1.2.0 scripts are available from the following web-page. The purpose of this CLM4.5 in CESM1.2.0 User's Guide is to give the CLM4.5 user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the CESM1.2.0 Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. +CLM5.0 in CESM2.0 is always run from within the standard CESM2.0 build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the CESM1.2.0 scripts and understand how to work with them. User's-Guide documentation on the CESM1.2.0 scripts are available from the following web-page. The purpose of this CLM4.5 in CESM1.2.0 User's Guide is to give the CLM4.5 user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the CESM1.2.0 Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. `cesmrel; Scripts User's-Guide (http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html) `_ From 804853929eebc035575551ddd98a369126f9d7c7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 May 2017 16:51:39 -0600 Subject: [PATCH 021/730] More update to clm50 in users guide --- doc/source/users_guide/overview/introduction.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 37eb0cb82d..de8dcc25fa 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -4,21 +4,21 @@ Introduction ============== -The Community Land Model (CLM4.5 in CESM1.2.0) is the latest in a +The Community Land Model (CLM5.0 in CESM2.0) is the latest in a series of global land models developed by t he CESM Land Model Working Group (LMWG) and maintained at the National Center for Atmospheric Research (NCAR). This guide is intended to instruct both the novice and experienced user on running CLM. This guide pertains to the latest -version CLM4.5 in CESM1.2.0 available for download from the public +version CLM5.0 in CESM2.0 available for download from the public release subversion repository as a part of CESM1.2.0. Documentation may be different if you are using an older version, you should either use the documentation for that release version, update to the latest version, or use the documentation inside your own source tree. There is information in the ChangeLog file and in the `What is new with -CLM4.5 in CESM1.2.0 since previous public releases? `_ +CLM5.0 in CESM2.0 since previous public releases? `_ regarding the changes from previous versions of CESM. -.. note:: This release of CLM4.5 in CESM1.2.0 includes BOTH CLM4.0 +.. note:: This release of CLM5.0 in CESM1.2.0 includes BOTH CLM4.0 physics used in previous releases as well as the updated CLM4.5 physics. Both CLM as well as CLM support tools allow you to trigger between the two physics modes. Most often when we refer to CLM4.0 we From aa96a511b92f111f5b835f8c03010707459898d8 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Thu, 25 May 2017 16:55:33 -0600 Subject: [PATCH 022/730] Updated references, added reference links & updated text in Crop chapter, added Vcmax text to Photosynthetic Capacity chapter for Chonggang to edit --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 66 +++++----- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 120 ++++++++++++++++++ .../References/CLM50_Tech_Note_References.rst | 12 ++ 3 files changed, 164 insertions(+), 34 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index b8791663a2..98c5ddcea3 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -11,8 +11,7 @@ Summary of CLM5.0 updates relative to the CLM4.5 We describe here the complete crop and irrigation parameterizations that appear in CLM5.0. Corresponding information for CLM4.5 appeared on the CLM4.5 web site in a pdf document independent of the CLM4.5 Technical -Note (Oleson et al. 2010a). The CLM4.0 crop model description also -appeared in Levis et al. (2012). +Note (:ref:`Oleson et al. 2013 `). CLM5.0 includes the following updates to the CROP option, where CROP refers to the interactive crop management model and is included by default with the BGC configuration: @@ -23,7 +22,7 @@ refers to the interactive crop management model and is included by default with - Fertilization rates updated based on crop type and geographic region -- Irrigation updates +- New Irrigation triggers - Phenological triggers vary by latitude for some crop types @@ -41,7 +40,7 @@ refers to the interactive crop management model and is included by default with These updates appear in detail in the sections below. Many also appear in -Levis et al. (2016). +Levis et al. (:ref:`2016 `). .. _The crop model: @@ -64,13 +63,14 @@ biogeophysical and biogeochemical effects not only of natural but also human-managed land cover. AgroIBIS is a state-of-the-art land surface model with options to -simulate dynamic vegetation (Kucharik et al. 2000) and interactive -crop management (Kucharik and Brye 2003). The interactive crop +simulate dynamic vegetation (:ref:`Kucharik et al. 2000 `) and interactive +crop management (:ref:`Kucharik and Brye 2003 `). The interactive crop management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 -[CLM3.0, Oleson et al. (2004)] (not published), then coupled to the -CLM3.5 (Levis et al. 2009) and later released to the community with -CLM4CN (Levis et al. 2012) and CLM4.5. +[CLM3.0, :ref:`Oleson et al. (2004) `] (not published), then coupled to the +CLM3.5 (:ref:`Levis et al. 2009 `) and later released to the community with +CLM4CN (:ref:`Levis et al. 2012 `), with additional updates +available by request after the release of CLM4.5 (:ref:`Levis et al. 2016 `). With interactive crop management and, therefore, a more accurate representation of agricultural landscapes, we hope to improve the CLM’s @@ -78,39 +78,37 @@ simulated biogeophysics and biogeochemistry. These advances may improve fully coupled simulations with the Community Earth System Model (CESM), while helping human societies answer questions about changing food, energy, and water resources in response to climate, environmental, land -use, and land management change (e.g., Kucharik and Brye 2003; Lobell et al. 2006). +use, and land management change (e.g., :ref:`Kucharik and Brye 2003 ; Lobell et al. 2006 `). .. _Crop plant functional types: Crop plant functional types ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +To allow crops to coexist with natural vegetation in a grid cell, the +vegetated land unit is separated into a naturally vegetated land unit and +a managed crop land unit. Unlike the plant functional types (pfts) in the +naturally vegetated land unit, the managed crop pfts in the managed crop +land unit do not share soil columns and thus permit for differences in the +land management between crops. Crop grid cell coverage is assigned from +satellite data (similar to all natural pfts), and the managed crop type +proportions within the crop area is based on the dataset created by +(:ref:`Portmann et al. 2010 `) for present day and +extrapolated through time using the LUMIP data (insert citation). Each +actively managed crop type has a rainfed and an irrigated pft that are on +independent soil columns. Actively managed crop types (Table XX) are chosen +based on the availability of corresponding algorithms in AgroIBIS and as +developed by Badger and Dirmeyer (:ref:`2015 `) and +described by Levis et al. (:ref:`2016 `). A parameterization +for winter cereals is developed but is not included in CLM5.0 due to the +inability to distinguish between winter and summer cereals in the LUMIP dataset (insert citation). + CLM’s default list of plant functional types (pfts) includes an -unmanaged crop (Table 2.1) treated as a second C3 grass. The unmanaged +unmanaged crop (Table 2.1) treated as a second C3 grass, as well as several +additional crop types that do not have associated parameters. The unmanaged crop has grid cell coverage assigned from satellite data, as do all -natural pfts when CLM’s dynamic vegetation model (CNDV; Castillo et al. 2012) is not active. - -The new crop pfts used in the CLM get grid cell coverage from the -present-day crop dataset of Portmann et al. (2010). We assign these -managed crops in the proportions given by Portmann et al. (2010) without -exceeding the area previously assigned to the unmanaged crop. The -unmanaged crop continues to occupy any of its original area that remains -and continues to be handled just by the carbon/nitrogen cycling part of -the CLM (i.e., CN). The managed crop types (corn, soybean, and temperate -cereals) were chosen based on the availability of corresponding -algorithms in AgroIBIS. Temperate cereals include wheat, barley, and rye -here. We treat all temperate cereals as summer crops (like spring wheat, -for example) at this time. We may introduce winter cereals (such as -winter wheat) in a future version of the model. - -To allow crops to coexist with natural vegetation in a grid cell and be -treated by separate models (i.e., CLM4.5CNcrop versus CLM4.5CNDV), we -separate the vegetated land unit into a naturally vegetated land unit -and a human managed land unit. Plant functional types in the naturally -vegetated land unit share one soil column and compete for water (default -CLM setting). Managed crop PFTs in the human managed land unit do not -share soil columns and thus permit for differences in land management -between crops. +natural pfts when CLM’s crop model is not active. [include remapping text here]. + .. _Phenology: diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index c294531b44..803964c6df 100644 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -2,3 +2,123 @@ Photosynthetic Capacity ======================= + +.. _V\ :sub:`cmax25` and Canopy scaling: + +V\ :sub:`cmax25` and Canopy scaling +-------------------------------------------- + +The maximum rate of carboxylation at 25 :sup:`o`\ C varies with +foliage nitrogen concentration and specific leaf area and is calculated +as in Thornton and Zimmermann (2007). At 25ºC, + +.. math:: + :label: ZEqnNum217783 + + V_{c\max 25} =N_{a} F_{LNR} F_{NR} a_{R25} + +where :math:`N_{a}` is the area-based leaf nitrogen concentration (g N +m\ :sup:`-2` leaf area), :math:`F_{LNR}` is the fraction of leaf +nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), +:math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass +to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and +:math:`a_{R25} =60` is the specific activity of Rubisco (µmol +CO\ :sub:`2` g\ :sup:`-1` Rubisco s\ :sup:`-1`). +:math:`N_{a}` is calculated from mass-based leaf N concentration and +specific leaf area + +.. math:: + :label: ZEqnNum561340 + + N_{a} =\frac{1}{CN_{L} \; SLA_{0} } + +where :math:`CN_{L}` is the leaf carbon-to-nitrogen ratio (g C +g\ :sup:`-1` N) and :math:`SLA_{0}` is specific leaf area at the +canopy top ( m\ :sup:`2` leaf area g\ :sup:`-1` C ). Table 8.1 +lists values of :math:`F_{LNR}` , :math:`CN_{L}` , and :math:`SLA_{0}` +for each plant functional type. :math:`F_{LNR}` was chosen to give +:math:`V_{c\max 25}` consistent with Kattge et al. (2009), as discussed +by Bonan et al. (2011, 2012). Table 8.1 lists derived values for +:math:`V_{c\max 25}` at the top of the canopy using :math:`SLA_{0}` . +Tropical broadleaf evergreen trees are an exception, and a higher +:math:`V_{c\max 25}` is used to alleviate model biases (Bonan et al. +2012). + +:math:`V_{c\max 25}` is calculated separately for sunlit and shaded +leaves using an exponential profile to area-based leaf nitrogen +(:math:`N_{a}` ), as in Bonan et al. (2011). :math:`V_{c\max 25}` at +cumulative leaf area index :math:`x` from the canopy top scales directly +with :math:`N_{a}` , which decreases exponentially with greater +cumulative leaf area, so that + +.. math:: + :label: ZEqnNum745439 + + V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} + +where :math:`V_{c\; \max 25}^{} \left(0\right)` is defined at the top of +the canopy using :math:`SLA_{0}` , and :math:`K_{n}` is the decay +coefficient for nitrogen. The canopy integrated value for sunlit and +shaded leaves is + +.. math:: + :label: 9.20) + + \begin{array}{rcl} {V_{c\; \max 25}^{sun} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)f_{sun} \left(x\right)\, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} } \end{array} + +.. math:: + :label: 9.21) + + \begin{array}{rcl} {V_{c\; \max 25}^{sha} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)\left[1-f_{sun} \left(x\right)\right] \, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left\{\left[1-e^{-K_{n} L} \right]\frac{1}{K_{n} } -\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} \right\}} \end{array} + +and the average value for the sunlit and shaded leaves is + +.. math:: + :label: 9.22) + + \bar{V}_{c\; \max 25}^{sun} ={V_{c\; \max 25}^{sun} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sun} L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } + +.. math:: + :label: 9.23) + + \bar{V}_{c\; \max 25}^{sha} ={V_{c\; \max 25}^{sha} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sha} L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } . + +This integration is over all leaf area (:math:`L`) with +:math:`f_{sun} (x)=\exp \left(-Kx\right)` and :math:`K` the direct beam +extinction coefficient (equation 4.9). Photosynthetic parameters +:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and +:math:`R_{d25}` scale similarly. + +The value :math:`K_{n} = 0.11` chosen by Bonan et al. (2011) is +consistent with observationally-derived estimates for forests, mostly +tropical, and provides a gradient in V\ :sub:`cmax` similar to +the original CLM4 specific leaf area scaling. However, Bonan et al. +(2012) showed that the sunlit/shaded canopy parameterization does not +match an explicit multi-layer canopy parameterization. The discrepancy +arises from absorption of scattered radiation by shaded leaves and can +be tuned out with higher :math:`K_{n}` . The model uses +:math:`K_{n} =0.30` to match an explicit multi-layer canopy. + +:math:`V_{c\max 25}` additionally varies with daylength (:math:`DYL`) +using the function :math:`f(DYL)`, which introduces seasonal variation +to :math:`V_{c\max }` + +.. math:: + :label: 9.24) + + f\left(DYL\right)=\frac{\left(DYL\right)^{2} }{\left(DYL_{\max } \right)^{2} } + +with :math:`0.01\le f\left(DYL\right)\le 1`. Daylength (seconds) is +given by + +.. math:: + :label: 9.25) + + DYL=2\times 13750.9871\cos ^{-1} \left[\frac{-\sin \left(lat\right)\sin \left(decl\right)}{\cos \left(lat\right)\cos \left(decl\right)} \right] + +where :math:`lat` (latitude) and :math:`decl` (declination angle) are +from section 3.3. Maximum daylength (:math:`DYL_{\max }` ) is calculated +similarly but using the maximum declination angle for present-day +orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], +positive for Northern Hemisphere latitudes and negative for Southern +Hemisphere). diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index fcbbde344d..7fb1521105 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -82,6 +82,12 @@ Axelsson, E., and Axelsson, B. 1986. Changes in carbon allocation patterns in spruce and pine trees following irrigation and fertilization. Tree Phys. 2:189-204. +.. _BadgerandDirmeyer2015: + +Badger, A.M., and Dirmeyer, P.A., 2015. Climate response to Amazon forest +replacement by heterogeneous crop cover. Hydrol. Earth. Syst. Sci. 19:4547- +4557. + .. _Bairdetal2004: Baird, A.J., Beckwith, C.W., Waldron, S. and Waddington, J.M., 2004. @@ -990,6 +996,12 @@ and Kucharik, C 2012. Interactive crop management in the Community Earth System Model (CESM1): Seasonal influences on land-atmosphere fluxes. J. Climate 25: 4839-4859. DOI:10.1175/JCLI-D-11-00446.1. +.. _Levisetal2016: + +Levis, S., Badger, A., Drewniak, B., Nevison, C., Ren, X. 2016. CLMcrop +yields and water requirements: avoided impacts by choosing RCP 4.5 over 8.5. +Climatic Change. DOI:10.1007/s10584-016-1654-9. + .. _Lietal2000: Li, C., Aber, J., Stange, F., Butterbach-Bahl, K. and Papen, H. 2000. A From 48450d9730fbfef31a5bdde1eef6c5afe0fd8257 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 26 May 2017 07:17:12 -0600 Subject: [PATCH 023/730] correct lake references --- .../tech_note/Lake/CLM50_Tech_Note_Lake.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst index aa0489964d..860bc2ae7c 100644 --- a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst +++ b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst @@ -4,17 +4,17 @@ Lake Model ============= The lake model, denoted the *Lake, Ice, Snow, and Sediment Simulator* -(LISSS), is from :numref:`Subin et al. (2012a) `. +(LISSS), is from :ref:`Subin et al. (2012a) `. It includes extensive modifications to the lake code of -:numref:`Zeng et al. (2002) ` used in CLM +:ref:`Zeng et al. (2002) ` used in CLM versions 2 through 4, which utilized concepts from the lake models of -:numref:`Bonan (1996) `, -:numref:`Henderson-Sellers (1985) `, -:numref:`Henderson-Sellers (1986) `, -:numref:`Hostetler and Bartlein (1990) `, -and the coupled lake-atmosphere model of :numref:`Hostetler et al. (1993) `, :numref:`Hostetler et al. (1993) `. +:ref:`Bonan (1996) `, +:ref:`Henderson-Sellers (1985) `, +:ref:`Henderson-Sellers (1986) `, +:ref:`Hostetler and Bartlein (1990) `, +and the coupled lake-atmosphere model of :ref:`Hostetler et al. (1993) `, :ref:`Hostetler et al. (1993) `. Lakes have spatially variable depth prescribed in the surface data (section -:numref:`External Data Lake`); the surface data optionally includes lake optical +:ref:`External Data Lake`); the surface data optionally includes lake optical extinction coeffient and horizontal fetch, currently only used for site simulations. Lake physics includes freezing and thawing in the lake body, resolved snow layers, and “soil†and bedrock layers below the lake From 95c43a0bafd9c8d4deb67603816777db52f5a039 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 26 May 2017 10:52:56 -0600 Subject: [PATCH 024/730] Updates to radiative fluxes and surface albedos --- .../CLM50_Tech_Note_Radiative_Fluxes.rst | 11 +++-- .../CLM50_Tech_Note_Surface_Albedos.rst | 48 ++++++++++--------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index 28f43fce9a..1115bf1dc6 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -32,14 +32,17 @@ albedos (section 3.2). :math:`L` and :math:`S` are the exposed leaf area index and stem area index (section 2.1.4). :math:`K` is the optical depth of direct beam per unit leaf and stem area (section 3.1). -Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse -solar radiation, and (c) longwave radiation absorbed, transmitted, and -reflected by vegetation and ground. +.. Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. + +.. _Figure schematic diagram of radiation: + +.. Figure:: image1.png + + Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. For clarity, terms involving :math:`T^{n+1} -T^{n}` are not shown in (c). -.. image:: image1.png The total solar radiation absorbed by the vegetation and ground is diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 0cd135e220..33fd1c0792 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -41,7 +41,7 @@ equations are solved to calculate the fluxes, per unit incident flux, absorbed by the vegetation, reflected by the vegetation, and transmitted through the vegetation for direct and diffuse radiation and for visible (:math:`<` 0.7\ :math:`\mu {\rm m}`) and near-infrared -(:math:`ge` 0.7\ :math:`\mu {\rm m}`) wavebands. The absorbed +(:math:`\geq` 0.7\ :math:`\mu {\rm m}`) wavebands. The absorbed radiation is partitioned to sunlit and shaded fractions of the canopy. The optical parameters :math:`G\left(\mu \right)`, :math:`\bar{\mu }`, :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}` are calculated @@ -156,15 +156,15 @@ Using this approximation, for vertical leaves (:math:`\chi _{L} =-1`, and for horizontal leaves (:math:`\chi _{L} =1`, :math:`\bar{\theta }=0^{{\rm o}}` ) , :math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} =\alpha _{\Lambda }` , -which agree with both Dickinson (1983) and Sellers (1985). For random +which agree with both :ref:`Dickinson (1983) ` and :ref:`Sellers (1985) `. For random (spherically distributed) leaves (:math:`\chi _{L} =0`, :math:`\bar{\theta }=60^{{\rm o}}` ), the approximation yields :math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} ={5\mathord{\left/ {\vphantom {5 8}} \right. \kern-\nulldelimiterspace} 8} \alpha _{\Lambda } +{3\mathord{\left/ {\vphantom {3 8}} \right. \kern-\nulldelimiterspace} 8} \tau _{\Lambda }` -whereas the approximate solution of Dickinson (1983) is +whereas the approximate solution of :ref:`Dickinson (1983) ` is :math:`\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} ={2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} \alpha _{\Lambda } +{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} \tau _{\Lambda }` . This discrepancy arises from the fact that a spherical leaf angle distribution has a true mean leaf inclination -:math:`\bar{\theta }\approx 57` (Campbell and Norman 1998) in equation , +:math:`\bar{\theta }\approx 57` :ref:`(Campbell and Norman 1998) ` in equation , while :math:`\bar{\theta }=60` in equation . The upscatter for direct beam radiation is @@ -178,7 +178,11 @@ where the single scattering albedo is .. math:: :label: 3.16 - \begin{array}{rcl} {a_{s} \left(\mu \right)_{\Lambda } } & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \int _{0}^{1}\frac{\mu 'G\left(\mu \right)}{\mu G\left(\mu '\right)+\mu 'G\left(\mu \right)} d\mu '} \\ {} & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \frac{G\left(\mu \right)}{\mu \phi _{2} +G\left(\mu \right)} \left[1-\frac{\mu \phi _{1} }{\mu \phi _{2} +G\left(\mu \right)} \ln \left(\frac{\mu \phi _{1} +\mu \phi _{2} +G\left(\mu \right)}{\mu \phi _{1} } \right)\right].} \end{array} + \begin{array}{rcl} {a_{s} \left(\mu \right)_{\Lambda } } & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \int _{0}^{1}\frac{\mu 'G\left(\mu \right)}{\mu G\left(\mu '\right)+\mu 'G\left(\mu \right)} d\mu '} \\ {} & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \frac{G\left(\mu \right)}{\min (\mu \phi _{2} +G\left(\mu \right),1e-6)} \left[1-\frac{\mu \phi _{1} }{\min (\mu \phi _{2} +G\left(\mu \right),1e-6)} \ln \left(\frac{\mu \phi _{1} +\min (\mu \phi _{2} +G\left(\mu \right),1e-6)}{\mu \phi _{1} } \right)\right].} \end{array} + +Note here the restriction on :math:`\mu \phi _{2} +G\left(\mu \right)`. We have seen cases where small values +can cause unrealistic single scattering albedo associated with the log calculation, +thereby eventually causing a negative soil albedo. The upward diffuse fluxes per unit incident direct beam and diffuse flux (i.e., the surface albedos) are @@ -206,7 +210,7 @@ radiation, respectively, are I\, \downarrow _{\Lambda } =h_{9} s_{1} +\frac{h_{10} }{s_{1} } . -With reference to Figure 4.1, the direct beam flux transmitted through +With reference to :numref:`Figure schematic diagram of radiation`, the direct beam flux transmitted through the canopy, per unit incident flux, is :math:`e^{-K\left(L+S\right)}` , and the direct beam and diffuse fluxes absorbed by the vegetation, per unit incident flux, are @@ -223,7 +227,7 @@ unit incident flux, are These fluxes are partitioned to the sunlit and shaded canopy using an analytical solution to the two-stream approximation for sunlit and -shaded leaves (Dai et al. 2004), as described by Bonan et al. (2011). +shaded leaves :ref:`(Dai et al. 2004) `, as described by :ref:`Bonan et al. (2011) `. The absorption of direct beam radiation by sunlit leaves is .. math:: @@ -277,8 +281,8 @@ with a_{2} =h_{9} \left[\frac{1-s_{2} s_{1} }{K+h} \right]+h_{10} \left[\frac{1-{s_{2} \mathord{\left/ {\vphantom {s_{2} s_{1} }} \right. \kern-\nulldelimiterspace} s_{1} } }{K-h} \right]. The parameters :math:`h_{1}` –:math:`h_{10}` , :math:`\sigma` , -:math:`h`, :math:`s_{1}` , and :math:`s_{2}` are from Sellers (1985) -[note the error in :math:`h_{4}` in Sellers (1985)]: +:math:`h`, :math:`s_{1}` , and :math:`s_{2}` are from :ref:`Sellers (1985) ` +[note the error in :math:`h_{4}` in :ref:`Sellers (1985) `]: .. math:: :label: 3.31 @@ -417,11 +421,11 @@ The parameters :math:`h_{1}` –:math:`h_{10}` , :math:`\sigma` , Plant functional type optical properties (:numref:`Table Plant functional type optical properties`) for trees and shrubs are from :ref:`Dorman and Sellers (1989) `. Leaf and stem optical -properties (placeVIS and NIR reflectance and transmittance) were derived +properties (VIS and NIR reflectance and transmittance) were derived for grasslands and crops from full optical range spectra of measured optical properties (:ref:`Asner et al. 1998 `). Optical properties for -intercepted snow (:numref:`Table Intercepted snow optical properties`) are -:ref:`from Sellers et al. (1986) `. +intercepted snow (:numref:`Table Intercepted snow optical properties`) are from +:ref:`Sellers et al. (1986) `. .. _Table Plant functional type optical properties: @@ -458,25 +462,23 @@ intercepted snow (:numref:`Table Intercepted snow optical properties`) are +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ | C\ :sub:`4` grass | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Crop R | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | - +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Crop I | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | C\ :sub:`3` Crop | -0.30 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Corn R | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Temp Corn | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Corn I | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Spring Wheat | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Temp Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Temp Soybean | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Temp Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Cotton | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Winter Cereal R | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Rice | 0.65 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Winter Cereal I | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Sugarcane | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Soybean R | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Tropical Corn | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Soybean I | -0.5 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Tropical Soybean | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ .. _Table Intercepted snow optical properties: From 8d902b3761bd4453c5622afb45417dac7b19a431 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 30 May 2017 11:32:20 -0600 Subject: [PATCH 025/730] Chapter 3 Surface Albedos updates and cleanup --- .../CLM50_Tech_Note_Surface_Albedos.rst | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 33fd1c0792..0b45f9faec 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -576,6 +576,8 @@ included the effects of the minimum permanent snow cover. .. table:: Dry and saturated soil albedos + +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ + | | Dry | Saturated | | Dry | Saturated | +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ | Color Class | vis | nir | vis | nir | Color Class | vis | nir | vis | nir | +---------------+--------+--------+--------+--------+---------------+--------+--------+--------+--------+ @@ -708,7 +710,7 @@ are applied in the two-stream solution +---------------------------------------------------------+----------------------+------------------+ | Spectral band | Direct-beam weight | Diffuse weight | +=========================================================+======================+==================+ - | Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | | | + | Band 1: 0.3-0.7\ :math:`\mu`\ m (visible) | (1.0) | (1.0) | +---------------------------------------------------------+----------------------+------------------+ | Band 2: 0.7-1.0\ :math:`\mu`\ m (near-IR) | 0.494 | 0.586 | +---------------------------------------------------------+----------------------+------------------+ @@ -739,15 +741,18 @@ boundary condition, SNICAR simulates solar absorption in all snow layers as well as the underlying soil or ground. With a thin snowpack, penetrating solar radiation to the underlying soil can be quite large and heat cannot be released from the soil to the atmosphere in this -situation. Thus, solar radiation penetration is limited to snowpacks -with total snow depth greater than or equal to 0.1 m -(:math:`z_{sno} \ge 0.1`) to prevent unrealistic soil warming within a -single timestep. +situation. Thus, if the snowpack has total snow depth less than 0.1 m +(:math:`z_{sno} < 0.1`) and there are no explicit snow layers, the solar +radiation is absorbed by the top soil layer. If there is a single snow layer, +the solar radiation is absorbed in that layer. If there is more than a single +snow layer, 75% of the solar radiation is absorbed in the top snow layer, +and 25% is absorbed in the next lowest snow layer. This prevents unrealistic +soil warming within a single timestep. The radiative transfer calculation is performed twice for each column containing a mass of snow greater than :math:`1 \times 10^{-30}` kg\ m\ :sup:`-2` (excluding lake and urban columns); once each for -direct-beam and diffuse incident flux. Absorption in each layer +direct-beam and diffuse incident flux. Absorption in each layer :math:`i` of pure snow is initially recorded as absorbed flux per unit incident flux on the ground (:math:`S_{sno,\, i}` ), as albedos must be calculated for the next timestep with unknown incident flux. The snow @@ -775,7 +780,7 @@ Snowpack Optical Properties Ice optical properties for the five spectral bands are derived offline and stored in a namelist-defined lookup table for online retrieval (see -CLM4.5 User’s Guide). Mie properties are first computed at fine spectral +CLM5.0 User’s Guide). Mie properties are first computed at fine spectral resolution (470 bands), and are then weighted into the five bands applied by CLM according to incident solar flux, :math:`I^{\downarrow } (\lambda )`. For example, the broadband @@ -846,7 +851,7 @@ only with incident solar flux, as in equation . .. _Table Mass extinction values: -.. table:: Mass extinction values (m\ :sup:`2` kg\ :sub:`-1`) used for snowpack impurities and ice +.. table:: Mass extinction values (m\ :sup:`2` kg\ :sup:`-1`) used for snowpack impurities and ice +----------------------------------------------------------------+----------+----------+----------+----------+----------+ | Species | Band 1 | Band 2 | Band 3 | Band 4 | Band 5 | @@ -945,7 +950,7 @@ each time step *t* as r_{e} \left(t\right)=\left[r_{e} \left(t-1\right)+dr_{e,\, dry} +dr_{e,\, wet} \right]f_{old} +r_{e,\, 0} f_{new} +r_{e,\, rfz} f_{rfrz} Here, the effective radius of freshly-fallen snow -(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sub:`-1`), and the effective +(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sup:`-1`), and the effective radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. Dry snow aging is based on a microphysical model described by :ref:`Flanner @@ -1036,7 +1041,7 @@ The solar hour angle :math:`h` (radians) is where :math:`d` is calendar day (:math:`d=0.0` at 0Z on January 1), and :math:`\theta` is longitude (radians) (positive east of the -CityplaceGreenwich meridian). +Greenwich meridian). The solar declination angle :math:`\delta` is calculated as in :ref:`Berger (1978a,b) ` and is valid for one million years past or hence, relative to From a890a94e4d26d4174e74ac77bc84de5ff39e567a Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 30 May 2017 14:50:22 -0600 Subject: [PATCH 026/730] Chapter 4 updates and cleanup --- .../CLM50_Tech_Note_Radiative_Fluxes.rst | 51 +++++++++++-------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index 1115bf1dc6..af386af482 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -14,23 +14,25 @@ where :math:`\vec{S}` is the net solar flux absorbed by the vegetation Solar Fluxes ---------------- -Figure 4.1 illustrates the direct beam and diffuse fluxes in the canopy. +:numref:`Figure schematic diagram of radiation` illustrates the direct beam and diffuse fluxes in the canopy. :math:`I\, \uparrow _{\Lambda }^{\mu }` and :math:`I\, \uparrow _{\Lambda }` are the upward diffuse fluxes, per -unit incident direct beam and diffuse flux (section 3.1). +unit incident direct beam and diffuse flux (section :numref:`Canopy Radiative Transfer`). :math:`I\, \downarrow _{\Lambda }^{\mu }` and :math:`I\, \downarrow _{\Lambda }` \ are the downward diffuse fluxes below the vegetation per unit incident direct beam and diffuse radiation -(section 3.1). The direct beam flux transmitted through the canopy, per +(section :numref:`Canopy Radiative Transfer`). The direct beam flux +transmitted through the canopy, per unit incident flux, is :math:`e^{-K\left(L+S\right)}` . :math:`\vec{I}_{\Lambda }^{\mu }` and :math:`\vec{I}_{\Lambda }^{}` are the fluxes absorbed by the vegetation, per unit incident direct beam -and diffuse radiation (section 3.1). +and diffuse radiation (section :numref:`Canopy Radiative Transfer`). :math:`\alpha _{g,\, \Lambda }^{\mu }` and :math:`\alpha _{g,\, \Lambda }` are the direct beam and diffuse ground -albedos (section 3.2). :math:`L` and :math:`S` are the exposed leaf area -index and stem area index (section 2.1.4). :math:`K` is the optical -depth of direct beam per unit leaf and stem area (section 3.1). +albedos (section :numref:`Ground Albedos`). :math:`L` and :math:`S` are the exposed leaf area +index and stem area index (section :numref:`Phenology and vegetation burial by snow`). +:math:`K` is the optical +depth of direct beam per unit leaf and stem area (section :numref:`Canopy Radiative Transfer`). .. Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. @@ -82,7 +84,8 @@ Photosynthesis and transpiration depend non-linearly on solar radiation, via the light response of stomata. The canopy is treated as two leaves (sunlit and shaded) and the solar radiation in the visible waveband (:math:`<` 0.7 µm) absorbed by the vegetation is apportioned to the -sunlit and shaded leaves (section 3.1). The absorbed photosynthetically +sunlit and shaded leaves (section :numref:`Canopy Radiative Transfer`). +The absorbed photosynthetically active (visible waveband) radiation averaged over the sunlit canopy (per unit plant area) is @@ -116,15 +119,17 @@ calculating :math:`L^{sun}` , K=\frac{G\left(\mu \right)}{\mu } where :math:`G\left(\mu \right)` and :math:`\mu` are parameters in the -two-stream approximation (section 3.1). +two-stream approximation (section :numref:`Canopy Radiative Transfer`). The model uses the two-stream approximation to calculate radiative transfer of direct and diffuse radiation through a canopy that is differentiated into leaves that are sunlit and those that are shaded -(section 3.1). The two-stream equations are integrated over all plant +(section :numref:`Canopy Radiative Transfer`). The two-stream equations +are integrated over all plant area (leaf and stem area) in the canopy. The model has an optional -(though not supported) multi-layer canopy, as described by Bonan et al. -(2012). The multi-layer model is only intended to address the +(though not supported) multi-layer canopy, as described by +:ref:`Bonan et al. (2012) `. +The multi-layer model is only intended to address the non-linearity of light profiles, photosynthesis, and stomatal conductance in the plant canopy. @@ -171,8 +176,10 @@ longwave radiation (W m\ :sup:`-2`). The radiative temperature T_{rad} =\left(\frac{L\, \uparrow }{\sigma } \right)^{{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } -where :math:`\sigma` is the Stefan-Boltzmann constant (W\ m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6). With reference to -Figure 4.1, the upward longwave radiation from the surface to the atmosphere is +where :math:`\sigma` is the Stefan-Boltzmann constant (W\ m\ :sup:`-2` K\ :sup:`-4`) +(:numref:`Table Physical constants`). With reference to +:numref:`Figure schematic diagram of radiation`, the upward longwave radiation +from the surface to the atmosphere is .. math:: :label: 4.11 @@ -185,7 +192,7 @@ the vegetation/soil system for exposed leaf and stem area zero for :math:`L+S<0.05` and one otherwise, :math:`\varepsilon _{g}` is the ground emissivity, and :math:`T_{g}^{n+1}` and :math:`T_{g}^{n}` are the snow/soil surface temperatures at the current -and previous time steps, respectively (Chapter 6). +and previous time steps, respectively (:ref:`rst_Soil and Snow Temperatures`). For non-vegetated surfaces, the above equation reduces to @@ -218,7 +225,8 @@ where where :math:`\varepsilon _{v}` is the vegetation emissivity and :math:`T_{v}^{n+1}` and :math:`T_{v}^{n}` are the vegetation temperatures at the current and previous time steps, respectively -(Chapter 5). The first term in the equation above is the atmospheric +(:ref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`). +The first term in the equation above is the atmospheric longwave radiation that is transmitted through the canopy, reflected by the ground, and transmitted through the canopy to the atmosphere. The second term is the longwave radiation emitted by the canopy directly to @@ -259,10 +267,11 @@ atmosphere) The above expression for :math:`\vec{L}_{g}` is the net longwave radiation forcing that is used in the soil temperature calculation -(Chapter 6). Once updated soil temperatures have been obtained, the term +(:ref:`rst_Soil and Snow Temperatures`). Once updated soil +temperatures have been obtained, the term :math:`4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right)` is added to :math:`\vec{L}_{g}` to calculate the ground heat flux -(section 5.4) +(section :numref:`Update of Ground Sensible and Latent Heat Fluxes`) The net longwave radiation flux for vegetation is (positive toward the atmosphere) @@ -282,7 +291,8 @@ emissivity of the ground is where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, and 0.96 for wetland, :math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` -is the fraction of ground covered by snow (section 7.2.1). The +is the fraction of ground covered by snow +(section :numref:`Snow Covered Area Fraction`). The vegetation emissivity is .. math:: @@ -291,6 +301,7 @@ vegetation emissivity is \varepsilon _{v} =1-e^{-{\left(L+S\right)\mathord{\left/ {\vphantom {\left(L+S\right) \bar{\mu }}} \right. \kern-\nulldelimiterspace} \bar{\mu }} } where :math:`L` and :math:`S` are the leaf and stem area indices -(section 2.1.4) and :math:`\bar{\mu }=1` is the average inverse optical +(section :numref:`Phenology and vegetation burial by snow`) and +:math:`\bar{\mu }=1` is the average inverse optical depth for longwave radiation. From cd853dffbcbd962316c06c6bde789197e38bbf74 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Tue, 30 May 2017 15:14:05 -0600 Subject: [PATCH 027/730] add links to Introduction --- .../CLM50_Tech_Note_CN_Allocation.rst | 126 ++++---- .../CLM50_Tech_Note_Crop_Irrigation.rst | 166 +++++----- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 66 ++-- .../CLM50_Tech_Note_Decomposition.rst | 208 ++++++------ .../tech_note/Dust/CLM50_Tech_Note_Dust.rst | 68 ++-- ...LM50_Tech_Note_External_Nitrogen_Cycle.rst | 8 +- .../tech_note/Fire/CLM50_Tech_Note_Fire.rst | 87 ++--- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 14 +- .../CLM50_Tech_Note_Introduction.rst | 296 +++++++++--------- .../Isotopes/CLM50_Tech_Note_Isotopes.rst | 8 +- .../Methane/CLM50_Tech_Note_Methane.rst | 119 +++---- .../CLM50_Tech_Note_Radiative_Fluxes.rst | 15 +- ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 5 +- .../CLM50_Tech_Note_Transient_Landcover.rst | 14 +- .../tech_note/Urban/CLM50_Tech_Note_Urban.rst | 15 +- ...ech_Note_Vegetation_Phenology_Turnover.rst | 6 +- 16 files changed, 636 insertions(+), 585 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index c6a6fa4aa0..3206f3ab28 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -29,18 +29,22 @@ nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue prior to abscission and litterfall. Altogether there are 20 state variables for vegetation carbon, and 19 for vegetation nitrogen. -Figure 13.1. Vegetation fluxes and pools. +.. _Figure Vegetation fluxes and pools: -.. image:: image1.png +.. figure:: image1.png :width: 800px :height: 800px -Figure 13.2: Carbon and nitrogen pools. + Vegetation fluxes and pools. -.. image:: image2.png +.. _Figure Carbon and nitrogen pools: + +.. figure:: image2.png :width: 400px :height: 400px + Carbon and nitrogen pools. + Carbon Allocation for Maintenance Respiration Costs -------------------------------------------------------- @@ -157,7 +161,7 @@ constant for all PFTs, based on construction costs for a range of woody and non-woody tissues (Larcher, 1995). The model includes a dynamic allocation scheme for woody vegetation -(parameter :math:`a_{3}` = -1, Table 13.1), in which case the +(parameter :math:`a_{3}` = -1, :numref:`Table Allocation and CN ratio parameters`), in which case the ratio for carbon allocation between new stem and new leaf increases with increasing net primary production (NPP), as @@ -172,59 +176,61 @@ favorable growth environments (Allen et al., 2005; Vanninen and Makela, 2005) and during the phase of stand growth prior to canopy closure (Axelsson and Axelsson, 1986). -Table 13.1. Allocation and carbon:nitrogen ratio parameters - -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | -+==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ -| NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| NET Boreal | 1 | 0.3 | -1 | 0.1 | 40 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| NDT Boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BET Tropical | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BET temperate | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT tropical | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT temperate | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BES temperate | 1 | 0.3 | 0.2 | 0.5 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`4` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Crop I | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Corn R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Corn I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Temp Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Temp Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Winter Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Winter Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Soybean R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Soybean I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +.. _Table Allocation and CN ratio parameters: + +.. table:: Allocation and carbon\:nitrogen ratio parameters + + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | + +==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ + | NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | NET Boreal | 1 | 0.3 | -1 | 0.1 | 40 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | NDT Boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BET Tropical | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BET temperate | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BDT tropical | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BDT temperate | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BDT boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BES temperate | 1 | 0.3 | 0.2 | 0.5 | 30 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | C\ :sub:`4` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Crop I | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Corn R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Corn I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Temp Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Temp Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Winter Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Winter Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Soybean R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ + | Soybean I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | + +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ Carbon to nitrogen ratios are defined for different tissue types as follows: @@ -234,8 +240,8 @@ follows: \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} -where all C:N parameters are defined as constants for a given PFT (Table -13.1). +where all C:N parameters are defined as constants for a given PFT +(:numref:`Table Allocation and CN ratio parameters`). Given values for the parameters in and , total carbon and nitrogen allocation to new growth ( :math:`CF_{alloc}`, gC diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index dc14d45c6b..2961569d3a 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -78,7 +78,7 @@ simulated biogeophysics and biogeochemistry. These advances may improve fully coupled simulations with the Community Earth System Model (CESM), while helping human societies answer questions about changing food, energy, and water resources in response to climate, environmental, land -use, and land management change (e.g., :ref:`Kucharik and Brye 2003 ; Lobell et al. 2006 `). +use, and land management change (e.g., :ref:`Kucharik and Brye 2003 `; :ref:`Lobell et al. 2006 `). .. _Crop plant functional types: @@ -147,12 +147,12 @@ where :math:`{T}_{10d}` is the 10-day running mean of :math:`{T}_{2m}`, (the sim temperature at every model time step) and :math:`T_{10d}^{\min}` is the 10-day running mean of :math:`T_{2m}^{\min }` (the daily minimum of :math:`{T}_{2m}`. :math:`{T}_{p}` and :math:`T_{p}^{\min }` are crop-specific coldest planting temperatures -(Table 20.1), :math:`{GDD}_{8}` is the 20-year running mean growing +(:numref:`Table Crop plant functional types`), :math:`{GDD}_{8}` is the 20-year running mean growing degree-days (units are degree-days or :sup:`o` days) tracked from April through September (NH) base 8\ :sup:`o` C with maximum daily increments of 30\ :sup:`o` days (see Eq.XXX ), and :math:`{GDD}_{min }`\ is the minimum growing degree day requirement -(Table 20.1). Soy must meet the same requirements but between May +(:numref:`Table Crop plant functional types`). Soy must meet the same requirements but between May 1\ :sup:`st` and June 14\ :sup:`th` for planting. If the requirements in Eq. are not met by June 14\ :sup:`th`, then corn, soybean, and temperate cereals are still planted on June @@ -202,7 +202,7 @@ Leaf emergence According to AgroIBIS, leaves may emerge when the growing degree-days of soil temperature to 0.05 m depth tracked since planting (:math:`GDD_{T_{soi} }` ) reaches 3 to 5% of :math:`{GDD}_{mat}` -(Table 20.1). :math:`GDD_{T_{soi} }` is base 8, 0, and +(:numref:`Table Crop plant functional types`). :math:`GDD_{T_{soi} }` is base 8, 0, and 10\ :math:`{}^\circ`\ C for corn, soybean, and temperate cereals. Leaf onset, as defined in the CN part of the model, occurs in the first time step of phase 2, at which moment all seed C is transferred to leaf @@ -217,7 +217,7 @@ Grain fill Phase 3 begins in a similar way to phase 2. A variable tracked since planting like :math:`GDD_{T_{soi} }` but for 2-m air temperature, :math:`GDD_{T_{{\rm 2m}} }`, must reach a heat unit threshold, *h*, -of 40 to 70% of :math:`{GDD}_{mat}` (Table 20.1). For corn the +of 40 to 70% of :math:`{GDD}_{mat}` (:numref:`Table Crop plant functional types`). For corn the percentage itself is an empirical function of :math:`{GDD}_{mat}` (not shown). In phase 3, the leaf area index begins to decline in response to a background litterfall rate calculated as the inverse of @@ -365,42 +365,42 @@ crop and from each other: #. Slope, *m*, of conductance-to-photosynthesis relationship from 9 to 4 for C4 crops as in AgroIBIS. -#. Specific leaf areas, *SLA*, to the AgroIBIS values (Table 20.1). +#. Specific leaf areas, *SLA*, to the AgroIBIS values (:numref:`Table Crop plant functional types`). -#. Leaf orientation, :math:`\chi _{L}`, to the AgroIBIS values (Table 20.1). +#. Leaf orientation, :math:`\chi _{L}`, to the AgroIBIS values (:numref:`Table Crop plant functional types`). #. Soil moisture photosynthesis limitation factor, :math:`\beta _{t}`, for soybeans multiplied as in AgroIBIS by 1.25 for increased drought tolerance. -Table 20.1. Crop plant functional types (pfts) in CLM4.5CNcrop and their -parameters relating to phenology and morphology. Numbers in the first -column correspond to the list of pfts in Table 2.1. - -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| | Phenological | :math:`T_{p}` | :math:`T_{p}^{\min }` | :math:`{GDD}_{min}` | :math:`{GDD}_{mat}` | Phase 2 | Phase 3 | Harvest: days | :math:`z_{top}^{\max }` | *SLA* | :math:`\chi _{L}` | | -| | Type | K | K | ºdays | ºdays | %\ :math:`{GDD}_{mat}` | %\ :math:`{GDD}_{mat}` | past planting | m | m\ :sup:`2`\ leaf g\ :sup:`-1`\ C | index | | -+=======+==============================================+======================+==============================+===========================+===========================+==============================+==============================+=================+==============================+=================================================+========================+====+ -| 15. | C\ :sub:`3` unmanaged rainfed crop | | | | | | | 0.03 | -0.30 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 16. | C\ :sub:`3` unmanaged irrigated crop | | | | | | | 0.03 | -0.30 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 17. | Rainfed Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 18. | Irrigated Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 19. | Rainfed Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 20. | Irrigated Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 21. | Rainfed Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 22. | Irrigated Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 23. | Rainfed Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ -| 24. | Irrigated Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | -+-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ +.. _Table Crop plant functional types: + +.. table:: Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. + + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | | Phenological | :math:`T_{p}` | :math:`T_{p}^{\min }` | :math:`{GDD}_{min}` | :math:`{GDD}_{mat}` | Phase 2 | Phase 3 | Harvest: days | :math:`z_{top}^{\max }` | *SLA* | :math:`\chi _{L}` | | + | | Type | K | K | ºdays | ºdays | %\ :math:`{GDD}_{mat}` | %\ :math:`{GDD}_{mat}` | past planting | m | m\ :sup:`2`\ leaf g\ :sup:`-1`\ C | index | | + +=======+==============================================+======================+==============================+===========================+===========================+==============================+==============================+=================+==============================+=================================================+========================+====+ + | 15. | C\ :sub:`3` unmanaged rainfed crop | | | | | | | 0.03 | -0.30 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 16. | C\ :sub:`3` unmanaged irrigated crop | | | | | | | 0.03 | -0.30 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 17. | Rainfed Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 18. | Irrigated Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 19. | Rainfed Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 20. | Irrigated Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 21. | Rainfed Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 22. | Irrigated Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 23. | Rainfed Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ + | 24. | Irrigated Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | + +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ Notes: :math:`T_{p}` and :math:`T_{p}^{\min }` are coldest planting temperatures but for winter cereals :math:`T_{p}^{\min }` @@ -416,30 +416,31 @@ top-of-canopy height of a crop, *SLA* is specific leaf area, and leaf orientation index, :math:`\chi _{L}` , equals -1 for vertical, 0 for random, and 1 for horizontal leaf orientation. -Table 20.2. Crop pfts in CLM4.5CNcrop and their parameters relating to -allocation. Numbers in the first column correspond to the list of pfts in Table 2.1. - -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| | :math:`a_{leaf}^{i}` | :math:`{L}_{max}` | :math:`a_{froot}^{i}` | :math:`a_{froot}^{f}` | :math:`a_{leaf}^{f}` | :math:`a_{livestem}^{f}` | :math:`d_{L}` | :math:`d_{alloc}^{stem}` | :math:`d_{alloc}^{leaf}` | | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| | fraction | m\ :sup:`2` m\ :sup:`-2` | | | | | | | | | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 17. | Rainfed Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 18. | Irrigated Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 19. | Rainfed Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 20. | Irrigated Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 21. | Rainfed Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 22. | Irrigated Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 23. | Rainfed Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ -| 24. | Irrigated Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | -+-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ +.. _Table Crop pfts in CLM4.5CNcrop and their parameters: + +.. table:: Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. + + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | | :math:`a_{leaf}^{i}` | :math:`{L}_{max}` | :math:`a_{froot}^{i}` | :math:`a_{froot}^{f}` | :math:`a_{leaf}^{f}` | :math:`a_{livestem}^{f}` | :math:`d_{L}` | :math:`d_{alloc}^{stem}` | :math:`d_{alloc}^{leaf}` | | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | | fraction | m\ :sup:`2` m\ :sup:`-2` | | | | | | | | | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 17. | Rainfed Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 18. | Irrigated Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 19. | Rainfed Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 20. | Irrigated Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 21. | Rainfed Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 22. | Irrigated Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 23. | Rainfed Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ + | 24. | Irrigated Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | + +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ Notes: Crop growth phases and corresponding variables are described in the text @@ -753,7 +754,7 @@ where :math:`{C}_{leaf}`, :math:`{C}_{stem}`, and :math:`{C}_{froot}` is the car root, respectively, :math:`{CN}_{leaf}`, :math:`{CN}_{stem}`, and :math:`{CN}_{froot}` is the pre-grain fill C:N ratio of the leaf, stem, and fine root respectively, and :math:`CN^f_{leaf}`, :math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N -ratio of the leaf, stem, and fine root respectively (Table 20.3). Since +ratio of the leaf, stem, and fine root respectively (:numref:`Table Pre- and post-grain fill CN ratios`). Since C:N measurements are taken from mature crops, pre-grain development C:N ratios for leaves, stems, and roots are optimized to allow maximum nitrogen accumulation for later use during organ development. Post-grain @@ -765,28 +766,29 @@ retranslocated pool equal to the plant nitrogen demand. Once the retranslocation pool is depleted, soil mineral nitrogen pool is used to fulfill plant nitrogen demands. -Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, -fine root, and reproductive pools. - -+----------------------------+--------+---------------------+-----------+ -| Pre-grain fill stage | Corn | Temperate Cereals | Soybean | -+============================+========+=====================+===========+ -| :math:`{CN}_{leaf}` | 10 | 15 | 25 | -+----------------------------+--------+---------------------+-----------+ -| :math:`{CN}_{stem}` | 50 | 50 | 50 | -+----------------------------+--------+---------------------+-----------+ -| :math:`{CN}_{froot}` | 42 | 30 | 42 | -+----------------------------+--------+---------------------+-----------+ -| Post-grain fill stage | | | | -+----------------------------+--------+---------------------+-----------+ -| :math:`CN_{leaf}^{f}` | 65 | 65 | 65 | -+----------------------------+--------+---------------------+-----------+ -| :math:`CN_{stem}^{f}` | 120 | 100 | 130 | -+----------------------------+--------+---------------------+-----------+ -| :math:`CN_{froot}^{f}` | 42 | 40 | 42 | -+----------------------------+--------+---------------------+-----------+ -| :math:`CN_{repr}^{f}` | 50 | 40 | 60 | -+----------------------------+--------+---------------------+-----------+ +.. _Table Pre- and post-grain fill CN ratios: + +.. table:: Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. + + +----------------------------+--------+---------------------+-----------+ + | Pre-grain fill stage | Corn | Temperate Cereals | Soybean | + +============================+========+=====================+===========+ + | :math:`{CN}_{leaf}` | 10 | 15 | 25 | + +----------------------------+--------+---------------------+-----------+ + | :math:`{CN}_{stem}` | 50 | 50 | 50 | + +----------------------------+--------+---------------------+-----------+ + | :math:`{CN}_{froot}` | 42 | 30 | 42 | + +----------------------------+--------+---------------------+-----------+ + | Post-grain fill stage | | | | + +----------------------------+--------+---------------------+-----------+ + | :math:`CN_{leaf}^{f}` | 65 | 65 | 65 | + +----------------------------+--------+---------------------+-----------+ + | :math:`CN_{stem}^{f}` | 120 | 100 | 130 | + +----------------------------+--------+---------------------+-----------+ + | :math:`CN_{froot}^{f}` | 42 | 40 | 42 | + +----------------------------+--------+---------------------+-----------+ + | :math:`CN_{repr}^{f}` | 50 | 40 | 60 | + +----------------------------+--------+---------------------+-----------+ .. _Separate reproductive pool: diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 4a7d378379..8608521802 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -40,7 +40,7 @@ The PFT distribution in the vegetated land unit is typically prescribed in CLM (see section 2.1.2) except for the case when CNDV is active. In CNDV the model begins with no PFT information per grid cell and evaluates whether or not a PFT may establish or survive according to the -PFT’s bioclimatic limits (Table 22.1). Shrub PFTs are treated as trees +PFT’s bioclimatic limits (:numref:`Table Plant functional type (PFT) biogeography rules`). Shrub PFTs are treated as trees at establishment. CNDV omits the CLM3DGVM’s annual introduction of saplings when a PFT can @@ -113,8 +113,39 @@ values in the old PFT-physiology file to get a reasonable simulation of PFTs. For CNDV to use the calculated fraction, we will need to change the algorithm for PFTs in early stages of growth. -Table 22.1. Plant functional type (PFT) biogeography rules with respect -to climate. +.. _Table Plant functional type (PFT) biogeography rules: + +.. table:: Plant functional type (PFT) biogeography rules with respect to climate. + + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | | Survival | | | | + +=============================================+==============================================+==============================================+=========================+========+ + | | :math:`{T}_{c,min}` (:math:`\circ`\ C) | :math:`{T}_{c,max}` (:math:`\circ`\ C) | :math:`{GDD}_{min}` | | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Tropical broadleaf evergreen tree (BET) | | 15.5 | No limit | 0 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Tropical broadleaf deciduous tree (BDT) | | 15.5 | No limit | 0 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Temperate needleleaf evergreen tree (NET) | | -2.0 | 22.0 | 900 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Temperate broadleaf evergreen tree (BET) | | 3.0 | 18.8 | 1200 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Temperate broadleaf deciduous tree (BDT) | | -17.0 | 15.5 | 1200 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Boreal needleleaf evergreen tree (NET) | | -32.5 | -2.0 | 600 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Boreal deciduous tree | | No limit | -2.0 | 350 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Temperate broadleaf deciduous shrub (BDS) | | -17.0 | No limit | 1200 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | Boreal broadleaf deciduous shrub (BDS) | | No limit | -2.0 | 350 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | C\ :sub:`4` | | 15.5 | No limit | 0 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | C\ :sub:`3` | | -17.0 | 15.5 | 0 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ + | C\ :sub:`3` arctic | | No limit | -17.0 | 0 | + +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ Adapted from Table 1 of Levis et al. (2004) to include shrub PFTs. :math:`T_{c,\min }` , coldest minimum monthly air temperature for @@ -124,32 +155,3 @@ minimum monthly air temperature for establishment of new PFTs; 5\ :math:`{}^\circ`\ C for establishment of new PFTs. Levis et al. (2004) include an explanation of these variables and their use. -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| | Survival | | | | -+=============================================+==============================================+==============================================+=========================+========+ -| | :math:`{T}_{c,min}` (:math:`\circ`\ C) | :math:`{T}_{c,max}` (:math:`\circ`\ C) | :math:`{GDD}_{min}` | | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Tropical broadleaf evergreen tree (BET) | | 15.5 | No limit | 0 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Tropical broadleaf deciduous tree (BDT) | | 15.5 | No limit | 0 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Temperate needleleaf evergreen tree (NET) | | -2.0 | 22.0 | 900 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Temperate broadleaf evergreen tree (BET) | | 3.0 | 18.8 | 1200 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Temperate broadleaf deciduous tree (BDT) | | -17.0 | 15.5 | 1200 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Boreal needleleaf evergreen tree (NET) | | -32.5 | -2.0 | 600 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Boreal deciduous tree | | No limit | -2.0 | 350 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Temperate broadleaf deciduous shrub (BDS) | | -17.0 | No limit | 1200 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| Boreal broadleaf deciduous shrub (BDS) | | No limit | -2.0 | 350 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| C\ :sub:`4` | | 15.5 | No limit | 0 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| C\ :sub:`3` | | -17.0 | 15.5 | 0 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ -| C\ :sub:`3` arctic | | No limit | -17.0 | 0 | -+---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 4686f649c2..d35feab5be 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -17,14 +17,16 @@ slower decomposition rates, based on the Century model (Parton et al. allow :math:`{n}_{lev}` to equal 1, as in CLM4.0, or to equal the number of soil levels used for the soil hydrology (default 10). -Figure 15.1. Schematic of decomposition model in CLM. +.. _Figure Schematic of decomposition model in CLM: + +.. figure:: image1.png + + Schematic of decomposition model in CLM. Model is structured to allow different representations of the soil C and N decomposition cascade, as well as a vertically-explicit treatment of soil biogeochemistry. -.. image:: image1.png - For the single-level model structure, the fundamental equation for carbon balance of the decomposing pools is: @@ -60,11 +62,13 @@ pools. Further discussion of the vertical distribution of carbon inputs Discussion of the vertical model and analysis of both decomposition structures is in Koven et al (2013). -Figure 15.2. Pool structure, transitions, respired fractions (numbers at -end of arrows), and turnover times (numbers in boxes) for the 2 -alternate soil decomposition models included in CLM. +.. _Figure Pool structure: + +.. figure:: image2.png -.. image:: image2.png + Pool structure, transitions, respired fractions (numbers at + end of arrows), and turnover times (numbers in boxes) for the 2 + alternate soil decomposition models included in CLM. CLM-CN Pool Structure, Rate Constants and Parameters --------------------------------------------------------- @@ -90,39 +94,39 @@ estimate exponential decay rates and respiration fractions (Thornton, conducted at constant temperature and under moist conditions with relatively high mineral nitrogen concentrations, and so the resulting rate constants are assumed not limited by the availability of water or -mineral nitrogen. Table 15.1 lists the base decomposition rates for each +mineral nitrogen. :numref:`Table Decomposition rate constants` lists the base decomposition rates for each litter and SOM pool, as well as a base rate for physical fragmentation for the coarse woody debris pool (CWD). -Table 15.1. Decomposition rate constants for litter and SOM pools, C:N -ratios, and acceleration parameters (see section 15.8 for explanation) -for the CLM-CN decomposition pool structure. - -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| | Biome-BGC | CLM-CN | | | -+==========================+================================================+===============================================+===============+=========================================+ -| | :math:`{k}_{disc1}`\ (d\ :sup:`-1`) | :math:`{k}_{disc2}` (hr\ :sup:`-1`) | *C:N ratio* | Acceleration term (:math:`{a}_{i}`) | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{Lit1}` | 0.7 | 0.04892 | - | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{Lit2}` | 0.07 | 0.00302 | - | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{Lit3}` | 0.014 | 0.00059 | - | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{SOM1}` | 0.07 | 0.00302 | 12 | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{SOM2}` | 0.014 | 0.00059 | 12 | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{SOM3}` | 0.0014 | 0.00006 | 10 | 5 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{SOM4}` | 0.0001 | 0.000004 | 10 | 70 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ -| :math:`{k}_{CWD}` | 0.001 | 0.00004 | - | 1 | -+--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ - -The first column of Table 15.1 gives the rates as used for the Biome-BGC +.. _Table Decomposition rate constants: + +.. table:: Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. + + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | | Biome-BGC | CLM-CN | | | + +==========================+================================================+===============================================+===============+=========================================+ + | | :math:`{k}_{disc1}`\ (d\ :sup:`-1`) | :math:`{k}_{disc2}` (hr\ :sup:`-1`) | *C:N ratio* | Acceleration term (:math:`{a}_{i}`) | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{Lit1}` | 0.7 | 0.04892 | - | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{Lit2}` | 0.07 | 0.00302 | - | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{Lit3}` | 0.014 | 0.00059 | - | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{SOM1}` | 0.07 | 0.00302 | 12 | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{SOM2}` | 0.014 | 0.00059 | 12 | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{SOM3}` | 0.0014 | 0.00006 | 10 | 5 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{SOM4}` | 0.0001 | 0.000004 | 10 | 70 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + | :math:`{k}_{CWD}` | 0.001 | 0.00004 | - | 1 | + +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ + +The first column of :numref:`Table Decomposition rate constants` gives the rates as used for the Biome-BGC model, which uses a discrete-time model with a daily timestep. The -second column of Table 15.1 shows the rates transformed for a one-hour +second column of :numref:`Table Decomposition rate constants` shows the rates transformed for a one-hour discrete timestep typical of CLM-CN. The transformation is based on the conversion of the initial discrete-time value (:math:`{k}_{disc1}`) first to a continuous time value (:math:`{k}_{cont}`), then to the @@ -150,27 +154,29 @@ or SOM pools that is released as CO\ :sub:`2` due to heterotrophic respiration. Respiration fractions and exponential decay rates are estimated simultaneously from the results of microcosm decomposition experiments (Thornton, 1998). The same values are used in CLM-CN and -Biome-BGC (Table 15.2). - -Table 15.2. Respiration fractions for litter and SOM pools - -+---------------------------+-----------------------+ -| Pool | *rf* | -+===========================+=======================+ -| :math:`{rf}_{Lit1}` | 0.39 | -+---------------------------+-----------------------+ -| :math:`{rf}_{Lit2}` | 0.55 | -+---------------------------+-----------------------+ -| :math:`{rf}_{Lit3}` | 0.29 | -+---------------------------+-----------------------+ -| :math:`{rf}_{SOM1}` | 0.28 | -+---------------------------+-----------------------+ -| :math:`{rf}_{SOM2}` | 0.46 | -+---------------------------+-----------------------+ -| :math:`{rf}_{SOM3}` | 0.55 | -+---------------------------+-----------------------+ -| :math:`{rf}_{SOM4}` | :math:`{1.0}^{a}` | -+---------------------------+-----------------------+ +Biome-BGC (:numref:`Table Respiration fractions for litter and SOM pools`). + +.. _Table Respiration fractions for litter and SOM pools: + +.. table:: Respiration fractions for litter and SOM pools + + +---------------------------+-----------------------+ + | Pool | *rf* | + +===========================+=======================+ + | :math:`{rf}_{Lit1}` | 0.39 | + +---------------------------+-----------------------+ + | :math:`{rf}_{Lit2}` | 0.55 | + +---------------------------+-----------------------+ + | :math:`{rf}_{Lit3}` | 0.29 | + +---------------------------+-----------------------+ + | :math:`{rf}_{SOM1}` | 0.28 | + +---------------------------+-----------------------+ + | :math:`{rf}_{SOM2}` | 0.46 | + +---------------------------+-----------------------+ + | :math:`{rf}_{SOM3}` | 0.55 | + +---------------------------+-----------------------+ + | :math:`{rf}_{SOM4}` | :math:`{1.0}^{a}` | + +---------------------------+-----------------------+ :sup:`a`:math:`{}^{a}` The respiration fraction for pool SOM4 is 1.0 by definition: since there is no pool downstream of SOM4, the entire carbon @@ -184,49 +190,51 @@ decay model; the two structures differ in the number of pools, the connections between those pools, the turnover times of the pools, and the respired fraction during each transition (Figure 15.2). The turnover times are different for the Century-based pool structure, following -those described in Parton et al. (1988) (Table 15.3). - -Table 15.3. Turnover times, C:N ratios, and acceleration parameters (see -section 15.8 for explanation) for the Century-based decomposition -cascade. - -+------------+------------------------+-------------+-------------------------------------------+ -| | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | -+============+========================+=============+===========================================+ -| CWD | 4.1 | - | 1 | -+------------+------------------------+-------------+-------------------------------------------+ -| Litter 1 | 0.066 | - | 1 | -+------------+------------------------+-------------+-------------------------------------------+ -| Litter 2 | 0.25 | - | 1 | -+------------+------------------------+-------------+-------------------------------------------+ -| Litter 3 | 0.25 | - | 1 | -+------------+------------------------+-------------+-------------------------------------------+ -| SOM 1 | 0.17 | 8 | 1 | -+------------+------------------------+-------------+-------------------------------------------+ -| SOM 2 | 6.1 | 11 | 15 | -+------------+------------------------+-------------+-------------------------------------------+ -| SOM 3 | 270 | 11 | 675 | -+------------+------------------------+-------------+-------------------------------------------+ - -Likewise, values for the respiration fraction of Century-based structure are in Table 15.4. - -Table 15.4. Respiration fractions for litter and SOM pools for Century-based structure - -+---------------------------+----------+ -| Pool | *rf* | -+===========================+==========+ -| :math:`{rf}_{Lit1}` | 0.55 | -+---------------------------+----------+ -| :math:`{rf}_{Lit2}` | 0.5 | -+---------------------------+----------+ -| :math:`{rf}_{Lit3}` | 0.5 | -+---------------------------+----------+ -| :math:`{rf}_{SOM1}` | f(txt) | -+---------------------------+----------+ -| :math:`{rf}_{SOM2}` | 0.55 | -+---------------------------+----------+ -| :math:`{rf}_{SOM3}` | 0.55 | -+---------------------------+----------+ +those described in Parton et al. (1988) (:numref:`Table Turnover times`). + +.. _Table Turnover times: + +.. table:: Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. + + +------------+------------------------+-------------+-------------------------------------------+ + | | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | + +============+========================+=============+===========================================+ + | CWD | 4.1 | - | 1 | + +------------+------------------------+-------------+-------------------------------------------+ + | Litter 1 | 0.066 | - | 1 | + +------------+------------------------+-------------+-------------------------------------------+ + | Litter 2 | 0.25 | - | 1 | + +------------+------------------------+-------------+-------------------------------------------+ + | Litter 3 | 0.25 | - | 1 | + +------------+------------------------+-------------+-------------------------------------------+ + | SOM 1 | 0.17 | 8 | 1 | + +------------+------------------------+-------------+-------------------------------------------+ + | SOM 2 | 6.1 | 11 | 15 | + +------------+------------------------+-------------+-------------------------------------------+ + | SOM 3 | 270 | 11 | 675 | + +------------+------------------------+-------------+-------------------------------------------+ + +Likewise, values for the respiration fraction of Century-based structure are in :numref:`Table Respiration fractions for Century-based structure`. + +.. _Table Respiration fractions for Century-based structure: + +.. table:: Respiration fractions for litter and SOM pools for Century-based structure + + +---------------------------+----------+ + | Pool | *rf* | + +===========================+==========+ + | :math:`{rf}_{Lit1}` | 0.55 | + +---------------------------+----------+ + | :math:`{rf}_{Lit2}` | 0.5 | + +---------------------------+----------+ + | :math:`{rf}_{Lit3}` | 0.5 | + +---------------------------+----------+ + | :math:`{rf}_{SOM1}` | f(txt) | + +---------------------------+----------+ + | :math:`{rf}_{SOM2}` | 0.55 | + +---------------------------+----------+ + | :math:`{rf}_{SOM3}` | 0.55 | + +---------------------------+----------+ Environmental modifiers on decomposition rate -------------------------------------------------- diff --git a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst index 381367a4c0..2b3bfa6dd7 100644 --- a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst +++ b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst @@ -83,8 +83,8 @@ flux where the saltation constant :math:`c_{s}` equals 2.61 and :math:`\rho _{atm}` is the atmospheric density (kg m\ :sup:`-3`) -(Table 2.3), :math:`g` the acceleration of gravity (m -s\ :sup:`-2`) (Table 2.6). The threshold wind friction speed for saltation :math:`u_{*t}` (m s\ :sup:`-1`) is +(:numref:`Table Atmospheric input to land model`), :math:`g` the acceleration of gravity (m +s\ :sup:`-2`) (:numref:`Table Physical constants`). The threshold wind friction speed for saltation :math:`u_{*t}` (m s\ :sup:`-1`) is .. math:: :label: ZEqnNum888452 @@ -120,7 +120,7 @@ where :math:`a=M_{clay}^{-1}` for tuning purposes, :math:`\theta _{1}` is the volumetric soil moisture in the top soil layer (m:math:`{}^{3 }`\ m\ :sup:`-3`) (section 7.4), :math:`\rho _{liq}` is the density of liquid water (kg -m\ :sup:`-3`) (Table 2.6), and :math:`\rho _{d,\, 1}` is the bulk +m\ :sup:`-3`) (:numref:`Table Physical constants`), and :math:`\rho _{d,\, 1}` is the bulk density of soil in the top soil layer (kg m\ :sup:`-3`) defined as in section 6.3 rather than as in Zender et al. (2003). :math:`Re_{*t}^{f}` from equation is the threshold friction Reynolds @@ -172,34 +172,36 @@ mode :math:`i` carried in each of *:math:`J=4`* transport bins :math:`j` where :math:`m_{i}` , :math:`\tilde{D}_{v,\, i}` , and :math:`\sigma _{g,\, i}` are the mass fraction, mass median diameter, and geometric standard deviation assigned to each particle source mode -:math:`i` (Table 24.1), while :math:`D_{j,\, \min }` and +:math:`i` (:numref:`Table Dust Mass fraction`), while :math:`D_{j,\, \min }` and :math:`D_{j,\, \max }` are the minimum and maximum diameters (m) in -each transport bin :math:`j` ** (Table 24.2). - -Table 24.1. Mass fraction :math:`m_{i}` , mass median diameter -:math:`\tilde{D}_{v,\, i}` , and geometric standard deviation -:math:`\sigma _{g,\, i}` , per dust source mode :math:`i` - -+-------------+-----------------------------+-----------------------------------+-----------------------------+ -| :math:`i` | :math:`m_{i}` (fraction) | :math:`\tilde{D}_{v,\, i}` (m) | :math:`\sigma _{g,\, i}` | -+=============+=============================+===================================+=============================+ -| 1 | 0.036 | 0.832 x 10\ :math:`{}^{-6}` | 2.1 | -+-------------+-----------------------------+-----------------------------------+-----------------------------+ -| 2 | 0.957 | 4.820 x 10\ :math:`{}^{-6}` | 1.9 | -+-------------+-----------------------------+-----------------------------------+-----------------------------+ -| 3 | 0.007 | 19.38 x 10\ :math:`{}^{-6}` | 1.6 | -+-------------+-----------------------------+-----------------------------------+-----------------------------+ - -Table 24.2. Minimum and maximum particle diameters in each dust transport bin :math:`j` - -+-------------+-------------------------------+-------------------------------+ -| :math:`j` | :math:`D_{j,\, \min }` (m) | :math:`D_{j,\, \max }` (m) | -+=============+===============================+===============================+ -| 1 | 0.1 x 10\ :math:`{}^{-6}` | 1.0 x 10\ :math:`{}^{-6}` | -+-------------+-------------------------------+-------------------------------+ -| 2 | 1.0 x 10\ :math:`{}^{-6}` | 2.5 x 10\ :math:`{}^{-6}` | -+-------------+-------------------------------+-------------------------------+ -| 3 | 2.5 x 10\ :math:`{}^{-6}` | 5.0 x 10\ :math:`{}^{-6}` | -+-------------+-------------------------------+-------------------------------+ -| 4 | 5.0 x 10\ :math:`{}^{-6}` | 10.0 x 10\ :math:`{}^{-6}` | -+-------------+-------------------------------+-------------------------------+ +each transport bin :math:`j` ** (:numref:`Table Dust Minimum and maximum particle diameters`). + +.. _Table Dust Mass fraction: + +.. table:: Mass fraction :math:`m_{i}` , mass median diameter :math:`\tilde{D}_{v,\, i}` , and geometric standard deviation :math:`\sigma _{g,\, i}` , per dust source mode :math:`i` + + +-------------+-----------------------------+-----------------------------------+-----------------------------+ + | :math:`i` | :math:`m_{i}` (fraction) | :math:`\tilde{D}_{v,\, i}` (m) | :math:`\sigma _{g,\, i}` | + +=============+=============================+===================================+=============================+ + | 1 | 0.036 | 0.832 x 10\ :math:`{}^{-6}` | 2.1 | + +-------------+-----------------------------+-----------------------------------+-----------------------------+ + | 2 | 0.957 | 4.820 x 10\ :math:`{}^{-6}` | 1.9 | + +-------------+-----------------------------+-----------------------------------+-----------------------------+ + | 3 | 0.007 | 19.38 x 10\ :math:`{}^{-6}` | 1.6 | + +-------------+-----------------------------+-----------------------------------+-----------------------------+ + +.. _Table Dust Minimum and maximum particle diameters: + +.. table:: Minimum and maximum particle diameters in each dust transport bin :math:`j` + + +-------------+-------------------------------+-------------------------------+ + | :math:`j` | :math:`D_{j,\, \min }` (m) | :math:`D_{j,\, \max }` (m) | + +=============+===============================+===============================+ + | 1 | 0.1 x 10\ :math:`{}^{-6}` | 1.0 x 10\ :math:`{}^{-6}` | + +-------------+-------------------------------+-------------------------------+ + | 2 | 1.0 x 10\ :math:`{}^{-6}` | 2.5 x 10\ :math:`{}^{-6}` | + +-------------+-------------------------------+-------------------------------+ + | 3 | 2.5 x 10\ :math:`{}^{-6}` | 5.0 x 10\ :math:`{}^{-6}` | + +-------------+-------------------------------+-------------------------------+ + | 4 | 5.0 x 10\ :math:`{}^{-6}` | 10.0 x 10\ :math:`{}^{-6}` | + +-------------+-------------------------------+-------------------------------+ diff --git a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst index 2678b845e7..b8f6536a46 100644 --- a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst @@ -88,10 +88,12 @@ on the carbon supply to nitrogen fixing microorganisms (Cleveland et al. where :math:`{NF}_{nfix,sminn}` (gN m\ :sup:`-2` s\ :sup:`-1`) is the rate of BNF. Eq. is plotted over a range of annual NPP in Figure 16.1. -Figure 16.1. Biological nitrogen fixation as a function of annual net -primary production. +.. _Figure Biological nitrogen fixation: + +.. figure:: image1.png -.. image:: image1.png + Biological nitrogen fixation as a function of annual net +primary production. Because of the empirical nature of this NPP-BNF relationship, the timescale for calculating NPP and thus BNF is unconstrained. Using diff --git a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst index 74e2c334da..d6b6495827 100644 --- a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst +++ b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst @@ -336,7 +336,7 @@ where :math:`A_{b,j}` (km\ :sup:`2`\ (time step)\ :sup:`-1`) is burned area for **C**\ :sub:`j` =(*C*\ :sub:`leaf`, *C*\ :sub:`stem`, *C*\ :sub:`root`, *C*\ :sub:`ts`) is a vector with carbon density (g C km\ :sup:`-2`) for leaf, stem (live and dead stem), root (fine, live coarse and dead coarse root), and transfer and storage carbon pools as elements; **CC**\ :sub:`j` = (*CC*\ :sub:`leaf`, *CC*\ :sub:`stem`, *CC*\ :sub:`root`, *CC*\ :sub:`ts`) is the corresponding combustion -completeness factor vector (Table 18.1). Moreover, we assume that 30% and 20% of column-level litter and coarse woody debris are burned and +completeness factor vector (:numref:`Table PFT-specific combustion completeness and fire mortality`). Moreover, we assume that 30% and 20% of column-level litter and coarse woody debris are burned and the corresponding carbon is transferred to atmosphere. Tissue mortality due to fire leads to carbon transfers in two ways. @@ -352,7 +352,7 @@ transfer and storage pools where :math:`M_{j1} =(M_{{\rm leaf}} ,M_{{\rm livestem,1}} ,M_{{\rm deadstem}} ,M_{{\rm root}} ,M_{{\rm ts}} )_{j}` -is the corresponding mortality factor vector (Table 18.1). Second, +is the corresponding mortality factor vector (:numref:`Table PFT-specific combustion completeness and fire mortality`). Second, carbon from uncombusted live stems is transferred to dead stems as: .. math:: @@ -361,7 +361,7 @@ carbon from uncombusted live stems is transferred to dead stems as: \Psi _{j2} =\frac{A_{b,j} }{f_{j} A_{g} } C_{livestem} (1-CC_{stem} )M_{livestem,2} where :math:`M_{livestem,2}` is the corresponding mortality factor -(Table 18.1). +(:numref:`Table PFT-specific combustion completeness and fire mortality`). Fire nitrogen emissions and nitrogen transfers due to fire-induced mortality are calculated the same way as for carbon, using the same @@ -377,7 +377,7 @@ killed by fire per km\ :sup:`2` (individual km\ :sup:`-2` where :math:`P_{j}` (individual km\ :sup:`-2`) is the population density for the *j*\ th tree PFT and :math:`\xi _{j}` is the -whole-plant mortality factor (Table 18.1). +whole-plant mortality factor (:numref:`Table PFT-specific combustion completeness and fire mortality`). Agricultural fires ----------------------- @@ -437,7 +437,7 @@ simulated planting and harvesting dates. In the post-fire region, fire impact is parameterized similar to section 18.1.3 but with combustion completeness factors and tissue mortality -factors for crop PFTs (Table 18.1). +factors for crop PFTs (:numref:`Table PFT-specific combustion completeness and fire mortality`). Deforestation fires ------------------------ @@ -579,44 +579,45 @@ peat combustion are set as 2.2 kg C m\ :sup:`-2`\ peat fire area (Turetsky et al peatlands are set the same as section 18.1.3 for non-crop PFTs and as section 18.2 for crops PFTs. -Table 18.1. PFT-specific combustion completeness and fire mortality -factors. - -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| PFT | *CC*\ :sub:`leaf` | *CC*\ :sub:`stem` | *CC*\ :sub:`root` | *CC*\ :sub:`ts` | *M*\ :sub:`leaf` | *M*\ :sub:`livestem` | *M*\ :sub:`deadstem` | *M*\ :sub:`root` | *M*\ :sub:`ts` | *M*\ :sub:`livestem` | :math:`\xi`\ :sub:`j` | -+==================================+===========================+===========================+===========================+=========================+==========================+==============================+==============================+==========================+========================+==============================+=================================+ -| NET Temperate | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| NET Boreal | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| NDT Boreal | - | - | - | - | - | - | - | - | - | - | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BET Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BET Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BDT Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BDT Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BDT Boreal | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BES Temperate | - | - | - | - | - | - | - | - | - | - | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BDS Temperate | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| BDS Boreal | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :sub:`3` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :sub:`3` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| C\ :sub:`4` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| Crop 1 | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -| Crop 2 | - | - | - | - | - | - | - | - | - | - | - | -+----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ +.. _Table PFT-specific combustion completeness and fire mortality: + +.. table:: PFT-specific combustion completeness and fire mortality factors. + + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | PFT | *CC*\ :sub:`leaf` | *CC*\ :sub:`stem` | *CC*\ :sub:`root` | *CC*\ :sub:`ts` | *M*\ :sub:`leaf` | *M*\ :sub:`livestem` | *M*\ :sub:`deadstem` | *M*\ :sub:`root` | *M*\ :sub:`ts` | *M*\ :sub:`livestem` | :math:`\xi`\ :sub:`j` | + +==================================+===========================+===========================+===========================+=========================+==========================+==============================+==============================+==========================+========================+==============================+=================================+ + | NET Temperate | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | NET Boreal | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | NDT Boreal | - | - | - | - | - | - | - | - | - | - | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BET Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BET Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BDT Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BDT Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BDT Boreal | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BES Temperate | - | - | - | - | - | - | - | - | - | - | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BDS Temperate | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | BDS Boreal | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | C\ :sub:`3` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | C\ :sub:`3` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | C\ :sub:`4` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | Crop 1 | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ + | Crop 2 | - | - | - | - | - | - | - | - | - | - | - | + +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ Leaves (:math:`CC_{{\rm leaf}}` ), stems (:math:`CC_{{\rm stem}}` ), roots (:math:`CC_{{\rm root}}` ) , and transfer and storage carbon diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index e6f45af8ff..f1f78574df 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -11,7 +11,7 @@ changes in canopy water :math:`\Delta W_{can}` , surface water :math:`\Delta W_{sfc}` , snow water :math:`\Delta W_{sno}` , soil water :math:`\Delta w_{liq,\, i}` , and soil ice :math:`\Delta w_{ice,\, i}` , and water in the unconfined aquifer :math:`\Delta W_{a}` (all in kg -m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Hydrologic processes figure`). +m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Figure Hydrologic processes`). The total water balance of the system is @@ -35,7 +35,7 @@ s\ :sup:`-1`), :math:`N_{levsoi}` is the number of soil layers :math:`N_{levgrnd}` are currently hydrologically inactive; :ref:`(Lawrence et al. 2008) ` and :math:`\Delta t` is the time step (s). -.. _Hydrologic processes figure: +.. _Figure Hydrologic processes: .. Figure:: image1.png @@ -379,7 +379,7 @@ Soil Water Soil water is predicted from a multi-layer model, in which the vertical soil moisture transport is governed by infiltration, surface and sub-surface runoff, gradient diffusion, gravity, and canopy transpiration -through root extraction (:numref:`Hydrologic processes figure`). +through root extraction (:numref:`Figure Hydrologic processes`). The following derivation generally follows that of :ref:`Z.-L. Yang (1998, unpublished manuscript) `. @@ -467,7 +467,7 @@ and organic properties of the soil (:ref:`Lawrence and Slater 2008 `). The hydraulic conductivity is defined at the depth of the interface of -two adjacent layers :math:`z_{h,\, i}` (:numref:`Water flux schematic figure`) and is a function +two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) and is a function of the saturated hydraulic conductivity :math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil moisture of the two layers :math:`\theta _{i}` and @@ -527,7 +527,7 @@ where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and B_{\min ,i} =2.91+0.159(\% clay)_{i} . The soil matric potential (mm) is defined at the node depth -:math:`z_{i}` of each layer :math:`i` (:numref:`Water flux schematic figure`) +:math:`z_{i}` of each layer :math:`i` (:numref:`Figure Water flux schematic`) .. math:: :label: ZEqnNum316201 @@ -610,7 +610,7 @@ as Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ -With reference to :numref:`Water flux schematic figure`, the equation for conservation of mass +With reference to :numref:`Figure Water flux schematic`, the equation for conservation of mass (equation :eq:`ZEqnNum790844`) can be integrated over each layer as .. math:: @@ -654,7 +654,7 @@ the effective root fraction :math:`r_{e,\, i}` e_{i} =r_{e,\, i} E_{v}^{t} . -.. _Water flux schematic figure: +.. _Figure Water flux schematic: .. Figure:: image2.png diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 2a5ba1d3ae..9e6c3f2fd0 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -120,123 +120,127 @@ Jinyun Tang, Zong-Liang Yang** **LIST OF FIGURES** -- Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). +- :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). -- Figure 2.1. Configuration of the CLM subgrid hierarchy. +- :numref:`Figure CLM subgrid hierarchy` Configuration of the CLM subgrid hierarchy. -- Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. +- :numref:`Figure Radiation Schematic` Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. -- Figure 5.1. Schematic diagram of sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. +- :numref:`Figure Schematic diagram of sensible heat fluxes` Schematic diagram of sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. -- Figure 5.2. Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. +- :numref:`Figure Schematic diagram of latent heat fluxes` Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. -- Figure 6.1. Schematic diagram of numerical scheme used to solve for soil temperature. +- :numref:`Figure Soil Temperature Schematic`. Schematic diagram of numerical scheme used to solve for soil temperature. -- Figure 7.1. Hydrologic processes represented in CLM. +- :numref:`Figure Hydrologic processes` Hydrologic processes represented in CLM. -- Figure 7.2. Example of three layer snow pack (snl=-3). +- :numref:`Figure Water flux schematic` Schematic diagram of numerical scheme used to solve for soil water fluxes. -- Figure 7.3. Schematic diagram of numerical scheme used to solve for soil water fluxes. +- :numref:`three layer snow pack` Example of three layer snow pack (snl=-3). -- Figure 12.1. Schematic representation of the urban land unit. +- :numref:`Figure Schematic representation of the urban land unit` Schematic representation of the urban land unit. -- Figure 12.2. Schematic of urban and atmospheric model coupling. +- :numref:`Figure Schematic of urban and atmospheric model coupling` Schematic of urban and atmospheric model coupling. -- Figure 13.1. Vegetation fluxes and pools. +- :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. -- Figure 13.2: Carbon and nitrogen pools. +- :numref:`Figure Carbon and nitrogen pools` Carbon and nitrogen pools. -- Figure 14.1. Example of annual phenology cycle for seasonal deciduous. +- :numref:`Figure annual phenology cycle` Example of annual phenology cycle for seasonal deciduous. -- Figure 14.2. Example fluxes and pools sizes for an onset growth period of 15 days, with initial transfer pool size of 100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool (e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). +- 14.2. Example fluxes and pools sizes for an onset growth period of 15 days, with initial transfer pool size of 100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool (e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). -- Figure 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. +- 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. -- Figure 15.1. Schematic of decomposition model in CLM. +- :numref:`Figure Schematic of decomposition model in CLM` Schematic of decomposition model in CLM. -- Figure 15.2. Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. +- :numref:`Figure Pool structure` Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. -- Figure 16.1. Biological nitrogen fixation as a function of annual net primary production. 300Figure 19.1. Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. +- :numref:`Figure Biological nitrogen fixation` Biological nitrogen fixation as a function of annual net primary production. -- Figure 21.1. Schematic of land cover change impacts on CLM carbon pools and fluxes. +- :numref:`Figure Methane Schematic` Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. -- Figure 21.2. Schematic of translation of annual UNH land units to CLM4 plant functional types. +- :numref:`Figure Schematic of land cover change` Schematic of land cover change impacts on CLM carbon pools and fluxes. -- Figure 25.1. Atmospheric :math:`\mathrm{\Delta}` 14C used to drive 14C model over the historical period. +- :numref:`Figure Schematic of translation of annual UNH land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. + +- :numref:`Figure Atmospheric Delta C14` Atmospheric :math:`\mathrm{\Delta}` 14C used to drive 14C model over the historical period. **LIST OF TABLES** -- Table 2.1. Plant functional types +- :numref:`Table Plant functional types` Plant functional types + +- :numref:`Table Prescribed plant functional type heights` Prescribed plant functional type heights -- Table 2.2. Prescribed plant functional type heights +- :numref:`Table Soil layer structure` Soil layer structure -- Table 2.3. Atmospheric input to land model +- :numref:`Table Atmospheric input to land model` Atmospheric input to land model -- Table 2.4. Land model output to atmospheric model +- :numref:`Table Land model output to atmospheric model` Land model output to atmospheric model -- Table 2.5. Surface data required for CLM4.5 and their base spatial resolution +- :numref:`Table Surface data required for CLM and their base spatial resolution` Surface data required for CLM4.5 and their base spatial resolution -- Table 2.6. Physical constants +- :numref:`Table Physical constants` Physical constants -- Table 3.1. Plant functional type optical properties +- :numref:`Table Plant functional type optical properties` Plant functional type optical properties -- Table 3.2. Intercepted snow optical properties +- :numref:`Table Intercepted snow optical properties` Intercepted snow optical properties -- Table 3.3. Dry and saturated soil albedos +- :numref:`Table Dry and saturated soil albedos` Dry and saturated soil albedos -- Table 3.4. Spectral bands and weights used for snow radiative transfer +- :numref:`Table Spectral bands and weights used for snow radiative transfer` Spectral bands and weights used for snow radiative transfer -- Table 3.5. Single-scatter albedo values used for snowpack impurities and ice +- :numref:`Table Single-scatter albedo values used for snowpack impurities and ice` Single-scatter albedo values used for snowpack impurities and ice -- Table 3.6. Mass extinction values (m2 kg-1) used for snowpack impurities and ice. +- :numref:`Table Mass extinction values` Mass extinction values (m2 kg-1) used for snowpack impurities and ice. -- Table 3.7. Asymmetry scattering parameters used for snowpack impurities and ice. +- :numref:`Table Asymmetry scattering parameters used for snowpack impurities and ice` Asymmetry scattering parameters used for snowpack impurities and ice. -- Table 3.8. Orbital parameters +- :numref:`Table Orbital parameters` Orbital parameters -- Table 5.1. Plant functional type aerodynamic parameters +- :numref:`Table Plant functional type aerodynamic parameters` Plant functional type aerodynamic parameters -- Table 5.2. Coefficients for e\ :sub:`sat`\ :sup:`T` +- :numref:`Table Coefficients for saturation vapor pressure` Coefficients for e\ :sub:`sat`\ :sup:`T` -- Table 5.3. Coefficients for 112Table 6.1. Soil layer structure. +- :numref:`Table Coefficients for derivative of esat` Coefficients for 112:numref:`` 6.1. Soil layer structure. -- Table 7.1. Meltwater scavenging efficiency for particles within snow +- :numref:`Table Meltwater scavenging` Meltwater scavenging efficiency for particles within snow -- Table 7.2. Minimum and maximum thickness of snow layers (m) +- :numref:`Table snow layer thickness` Minimum and maximum thickness of snow layers (m) -- Table 8.1. Plant functional type (PFT) photosynthetic parameters. +- :numref:`Table Plant functional type (PFT) photosynthetic parameters` Plant functional type (PFT) photosynthetic parameters. -- Table 8.2. Temperature dependence parameters for C3 photosynthesis. +- :numref:`Table Temperature dependence parameters for C3 photosynthesis` Temperature dependence parameters for C3 photosynthesis. -- Table8.3. Plant functional type root distribution parameters. +- :numref:`Table Plant functional type root distribution parameters` Plant functional type root distribution parameters. -- Table 13.1. Allocation and carbon:nitrogen ratio parameters +- :numref:`Table Allocation and CN ratio parameters` Allocation and carbon:nitrogen ratio parameters -- Table 15.1. Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. +- :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. -- Table 15.2. Respiration fractions for litter and SOM pools +- :numref:`Table Respiration fractions for litter and SOM pools` Respiration fractions for litter and SOM pools -- Table 15.3. Respiration fractions for litter and SOM pools for Century-based structure +- :numref:`Table Turnover times` Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. -- Table 15.4.Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. +- :numref:`Table Respiration fractions for Century-based structure` Respiration fractions for litter and SOM pools for Century-based structure -- Table 18.1. PFT-specific combustion completeness and fire mortality factors. +- :numref:`Table PFT-specific combustion completeness and fire mortality` PFT-specific combustion completeness and fire mortality factors. -- Table 19.1. Parameter descriptions and sensitivity analysis ranges applied in the methane model. +- :numref:`Table Methane Parameter descriptions` Parameter descriptions and sensitivity analysis ranges applied in the methane model. -- Table 19.2. Temperature dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. +- :numref:`Table Temperature dependence of aqueous and gaseous diffusion` Temperature dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. -- Table 20.1. Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in Table 2.1. +- :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. -- Table 20.2. Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in Table 2.1. +- :numref:`Table Crop pfts in CLM4.5CNcrop and their parameters` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. -- Table 20.3. Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. +- :numref:`Table Pre- and post-grain fill CN ratios` Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. -- Table 22.1. Plant functional type (PFT) biogeography rules with respect to climate. +- :numref:`Table Plant functional type (PFT) biogeography rules` Plant functional type (PFT) biogeography rules with respect to climate. -- Table 24.1. Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i +- :numref:`Table Dust Mass fraction` Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i -- Table 24.2. Minimum and maximum particle diameters in each dust transport bin j +- :numref:`Table Dust Minimum and maximum particle diameters` Minimum and maximum particle diameters in each dust transport bin j **ACKNOWLEDGEMENTS** @@ -295,17 +299,17 @@ Inception of CLM The early development of the Community Land Model can be described as the merging of a community-developed land model focusing on biogeophysics and a concurrent effort at NCAR to expand the NCAR Land -Surface Model (NCAR LSM, Bonan 1996) to include the carbon cycle, +Surface Model (NCAR LSM, :ref:`Bonan 1996`) to include the carbon cycle, vegetation dynamics, and river routing. The concept of a community-developed land component of the Community Climate System Model (CCSM) was initially proposed at the CCSM Land Model Working Group (LMWG) meeting in February 1996. Initial software specifications and development focused on evaluating the best features of three existing -land models: the NCAR LSM (Bonan 1996, 1998) used in the Community +land models: the NCAR LSM (:ref:`Bonan 1996, 1998`) used in the Community Climate Model (CCM3) and the initial version of CCSM; the Institute of -Atmospheric Physics, Chinese Academy of Sciences land model (IAP94) (Dai -and Zeng 1997); and the Biosphere-Atmosphere Transfer Scheme (BATS) -(Dickinson et al. 1993) used with CCM2. A scientific steering committee +Atmospheric Physics, Chinese Academy of Sciences land model (IAP94) (:ref:`Dai +and Zeng 1997`); and the Biosphere-Atmosphere Transfer Scheme (BATS) +(:ref:`Dickinson et al. 1993`) used with CCM2. A scientific steering committee was formed to review the initial specifications of the design provided by Robert Dickinson, Gordon Bonan, Xubin Zeng, and Yongjiu Dai and to facilitate further development. Steering committee members were selected @@ -329,11 +333,11 @@ Oleson, M. Bosilovich, Zong-Liang Yang, Ian Baker, P. Houser, and P. Dirmeyer at the LMWG meeting hosted by COLA (Center for Ocean-Land-Atmosphere Studies) in November 1999. Field data used for validation included sites adopted by the Project for Intercomparison of -Land-surface Parameterization Schemes (Henderson-Sellers et al. 1993) -(Cabauw, Valdai, Red-Arkansas river basin) and others [FIFE (Sellers et -al. 1988), BOREAS (Sellers et al. 1995), HAPEX-MOBILHY (André et al. -1986), ABRACOS (Gash et al. 1996), Sonoran Desert (Unland et al. 1996), -GSWP (Dirmeyer et al. 1999)]. Y. Dai also presented results from a +Land-surface Parameterization Schemes (:ref:`Henderson-Sellers et al. 1993`) +(Cabauw, Valdai, Red-Arkansas river basin) and others [FIFE (:ref:`Sellers et +al. 1988`), BOREAS :ref:`(Sellers et al. 1995`), HAPEX-MOBILHY (:ref:`André et al. +1986`), ABRACOS (:ref:`Gash et al. 1996`), Sonoran Desert (:ref:`Unland et al. 1996`), +GSWP (:ref:`Dirmeyer et al. 1999`)]. Y. Dai also presented results from a preliminary coupling of the Common Land Model to CCM3, indicating that the land model could be successfully coupled to a climate model. @@ -348,9 +352,9 @@ and soil temperatures. Sam Levis reported on efforts to incorporate a river routing model to deliver runoff to the ocean model in CCSM. Soon after the workshop, the code was delivered to NCAR for implementation into the CCSM framework. Documentation for the Common Land Model is -provided by Dai et al. (2001) while the coupling with CCM3 is described -in Zeng et al. (2002). The model was introduced to the modeling -community in Dai et al. (2003). +provided by :ref:`Dai et al. (2001)` while the coupling with CCM3 is described +in :ref:`Zeng et al. (2002)`. The model was introduced to the modeling +community in :ref:`Dai et al. (2003)`. CLM2 ^^^^^^^^^^ @@ -361,8 +365,8 @@ cycling, vegetation dynamics, and river routing. The preservation of these advancements necessitated several modifications to the Common Land Model. The biome-type land cover classification scheme was replaced with a plant functional type (PFT) representation with the specification of -PFTs and leaf area index from satellite data (Oleson and Bonan 2000; -Bonan et al. 2002a, b). This also required modifications to +PFTs and leaf area index from satellite data (:ref:`Oleson and Bonan 2000`; +:ref:`Bonan et al. 2002a, b`). This also required modifications to parameterizations for vegetation albedo and vertical burying of vegetation by snow. Changes were made to canopy scaling, leaf physiology, and soil water limitations on photosynthesis to resolve @@ -382,7 +386,7 @@ K. Oleson reported on initial results from a coupling of CCM3 with CLM2 at the June 2001 CCSM Workshop LMWG meeting. Generally, the CLM2 preserved most of the improvements seen in the Common Land Model, particularly with respect to surface air temperature, runoff, and snow. -These simulations are documented in Bonan et al. (2002a). Further small +These simulations are documented in :ref:`Bonan et al. (2002a)`. Further small improvements to the biogeophysical parameterizations, ongoing software development, and extensive analysis and validation within CAM2 and CCSM2 culminated in the release of CLM2 to the community in May 2002. @@ -414,14 +418,14 @@ added stability corrections to the diagnostic 2-m air temperature calculation which reduced biases in this temperature. Competition between PFTs for water, in which PFTs share a single soil column, is the default mode of operation in this model version. CLM3 was released to -the community in June 2004. Dickinson et al. (2006) describe the climate -statistics of CLM3 when coupled to CCSM3.0. Hack et al. (2006) provide +the community in June 2004.:ref:`Dickinson et al. (2006)` describe the climate +statistics of CLM3 when coupled to CCSM3.0. :ref:`Hack et al. (2006)` provide an analysis of selected features of the land hydrological cycle. -Lawrence et al. (2007) examine the impact of changes in CLM3 +:ref:`Lawrence et al. (2007)` examine the impact of changes in CLM3 hydrological parameterizations on partitioning of evapotranspiration (ET) and its effect on the timescales of ET response to precipitation events, interseasonal soil moisture storage, soil moisture memory, and -land-atmosphere coupling. Qian et al. (2006) evaluate CLM3’s performance +land-atmosphere coupling. :ref:`Qian et al. (2006)` evaluate CLM3’s performance in simulating soil moisture content, runoff, and river discharge when forced by observed precipitation, temperature and other atmospheric data. @@ -442,16 +446,16 @@ integration, canopy interception, frozen soil, soil water availability, and soil evaporation, a TOPMODEL-based model for surface and subsurface runoff, a groundwater model for determining water table depth, and the introduction of a factor to simulate nitrogen limitation on plant -productivity. Oleson et al. (2008a) show that CLM3.5 exhibits +productivity. :ref:`Oleson et al. (2008a)` show that CLM3.5 exhibits significant improvements over CLM3 in its partitioning of global ET which result in wetter soils, less plant water stress, increased transpiration and photosynthesis, and an improved annual cycle of total water storage. Phase and amplitude of the runoff annual cycle is generally improved. Dramatic improvements in vegetation biogeography result when CLM3.5 is coupled to a dynamic global vegetation model. -Stöckli et al. (2008) examine the performance of CLM3.5 at local scales +:ref:`Stöckli et al. (2008)` examine the performance of CLM3.5 at local scales by making use of a network of long-term ground-based ecosystem -observations [FLUXNET (Baldocchi et al. 2001)]. Data from 15 FLUXNET +observations [FLUXNET (:ref:`Baldocchi et al. 2001`)]. Data from 15 FLUXNET sites were used to demonstrate significantly improved soil hydrology and energy partitioning in CLM3.5. CLM3.5 was released to the community in May, 2007. @@ -462,7 +466,7 @@ CLM4 The motivation for the next version of the model, CLM4, was to incorporate several recent scientific advances in the understanding and representation of land surface processes, expand model capabilities, and -improve surface and atmospheric forcing datasets (Lawrence et al. 2011). +improve surface and atmospheric forcing datasets (:ref:`Lawrence et al. 2011`). Included in the first category are more sophisticated representations of soil hydrology and snow processes. In particular, new treatments of soil column-groundwater interactions, soil evaporation, aerodynamic @@ -488,25 +492,25 @@ ecosystem process model Biome-BGC (Biome BioGeochemical Cycles), originating at the Numerical Terradynamic Simulation Group (NTSG) at the University of Montana, under the guidance of Prof. Steven Running. Biome-BGC itself is an extension of an earlier model, Forest-BGC -**(Running and Coughlan, 1988; Running and Gower, 1991)**, which +(:ref:`Running and Coughlan, 1988`; :ref:`Running and Gower, 1991`), which simulates water, carbon, and, to a limited extent, nitrogen fluxes for forest ecosystems. Forest-BGC was designed to be driven by remote sensing inputs of vegetation structure, and so used a diagnostic (prescribed) leaf area index, or, in the case of the dynamic allocation -version of the model **(Running and Gower, 1991)**, prescribed maximum +version of the model (:ref:`Running and Gower, 1991`), prescribed maximum leaf area index. Biome-BGC expanded on the Forest-BGC logic by introducing a more -mechanistic calculation of leaf and canopy scale photosynthesis **(Hunt -and Running, 1992)**, and extending the physiological parameterizations -to include multiple woody and non-woody vegetation types **(Hunt et al. -1996; Running and Hunt, 1993)**. Later versions of Biome-BGC introduced +mechanistic calculation of leaf and canopy scale photosynthesis (:ref:`Hunt +and Running, 1992`), and extending the physiological parameterizations +to include multiple woody and non-woody vegetation types (:ref:`Hunt et al. +1996`; :ref:`Running and Hunt, 1993`). Later versions of Biome-BGC introduced more mechanistic descriptions of belowground carbon and nitrogen cycles, nitrogen controls on photosynthesis and decomposition, sunlit and shaded canopies, vertical gradient in leaf morphology, and explicit treatment -of fire and harvest disturbance and regrowth dynamics **(Kimball et al. -1997; Thornton, 1998; Thornton et al. 2002; White et al. 2000)**. -Biome-BGC version 4.1.2 **(Thornton et al. 2002)** provided a point of +of fire and harvest disturbance and regrowth dynamics (:ref:`Kimball et al. +1997`; :ref:`Thornton, 1998`; :ref:`Thornton et al. 2002`; :ref:`White et al. 2000`). +Biome-BGC version 4.1.2 (:ref:`Thornton et al. 2002`) provided a point of departure for integrating new biogeochemistry components into CLM4. CLM4 was released to the community in June, 2010 along with the @@ -535,26 +539,26 @@ problems or biases. The main modifications include updates to canopy processes including a revised canopy radiation scheme and canopy scaling of leaf processes, co-limitations on photosynthesis, revisions to photosynthetic parameters -(Bonan et al. 2011), +(:ref:`Bonan et al. 2011`), .. todo:: had three stars here - need to resolve this temperature acclimation of photosynthesis, and improved stability of the iterative solution in the photosynthesis and -stomatal conductance model (Sun et al. 2012). Hydrology updates include +stomatal conductance model (:ref:`Sun et al. 2012`). Hydrology updates include modifications such that hydraulic properties of frozen soils are determined by liquid water content only rather than total water content and the introduction of an ice impedance function, and other corrections that increase the consistency between soil water state and water table position and allow for a perched water table above icy permafrost ground -(Swenson et al. 2012). A new snow cover fraction parameterization is +(:ref:`Swenson et al. 2012`). A new snow cover fraction parameterization is incorporated that reflects the hysteresis in fractional snow cover for a -given snow depth between accumulation and melt phases (Swenson and -Lawrence, 2012). The lake model in CLM4 is replaced with a completely -revised and more realistic lake model (Subin et al. 2012a). A surface +given snow depth between accumulation and melt phases (:ref:`Swenson and +Lawrence, 2012`). The lake model in CLM4 is replaced with a completely +revised and more realistic lake model (:ref:`Subin et al. 2012a`). A surface water store is introduced, replacing the wetland land unit and permitting prognostic wetland distribution modeling, and the surface -energy fluxes are calculated separately (Swenson and Lawrence, 2012) for +energy fluxes are calculated separately (:ref:`Swenson and Lawrence, 2012`) for snow-covered, water-covered, and snow/water-free portions of vegetated and crop land units, and snow-covered and snow-free portions of glacier land units. Globally constant river flow velocity is replaced with @@ -562,28 +566,28 @@ variable flow velocity based on mean grid cell slope. A vertically resolved soil biogeochemistry scheme is introduced with base decomposition rates modified by soil temperature, water, and oxygen limitations and also including vertical mixing of soil carbon and -nitrogen due to bioturbation, cryoturbation, and diffusion (Koven et al. -2013). The litter and soil carbon and nitrogen pool structure as well as +nitrogen due to bioturbation, cryoturbation, and diffusion (:ref:`Koven et al. +2013`). The litter and soil carbon and nitrogen pool structure as well as nitrification and denitrification are modified based on the Century model and biological fixation is revised to distribute fixation more -realistically over the year (Koven et al. 2013). The fire model is +realistically over the year (:ref:`Koven et al. 2013`). The fire model is replaced with a model that includes representations of natural and anthropogenic triggers and suppression as well as agricultural, -deforestation, and peat fires (Li et al. 2012a,b; Li et al. 2013a). The +deforestation, and peat fires (:ref:`Li et al. 2012a,b`; :ref:`Li et al. 2013a`). The biogenic volatile organic compounds model is updated to MEGAN2.1 -(Guenther et al. 2012). +(:ref:`Guenther et al. 2012`). Additions to the model include a methane production, oxidation, and -emissions model (Riley et al. 2011a) and an extension of the crop model -to include interactive fertilization, organ pools (Drewniak et al. -2013), and irrigation (Sacks et al. 2009). Elements of the Variable +emissions model (:ref:`Riley et al. 2011a`) and an extension of the crop model +to include interactive fertilization, organ pools (:ref:`Drewniak et al. +2013`), and irrigation (:ref:`Sacks et al. 2009`). Elements of the Variable Infiltration Capacity (VIC) model are included as an alternative -optional runoff generation scheme (Li et al. 2011). There is also an -option to run with a multilayer canopy (Bonan et al. 2012). Multiple +optional runoff generation scheme (:ref:`Li et al. 2011`). There is also an +option to run with a multilayer canopy (:ref:`Bonan et al. 2012`). Multiple urban density classes, rather than the single dominant urban density class used in CLM4, are modeled in the urban land unit. Carbon -(:math:`{}^{13}`\ C and :math:`{}^{14}`\ C) isotopes are enabled (Koven -et al. 2013). Minor changes include a switch of the C3 Arctic grass and +(:math:`{}^{13}`\ C and :math:`{}^{14}`\ C) isotopes are enabled (:ref:`Koven +et al. 2013`). Minor changes include a switch of the C3 Arctic grass and shrub phenology from stress deciduous to seasonal deciduous and a change in the glacier bare ice albedo to better reflect recent estimates. Finally, the carbon and nitrogen cycle spinup is accelerated and @@ -594,9 +598,9 @@ Finally, the predominantly low resolution input data for provided with CLM4 to create CLM4 surface datasets is replaced with newer and higher resolution input datasets where possible (see section 2.2.3 for details). The default meteorological forcing dataset provided with CLM4 -(Qian et al. 2006) is replaced with the 1901-2010 CRUNCEP forcing +(:ref:`Qian et al. 2006)` is replaced with the 1901-2010 CRUNCEP forcing dataset (see Chapter 26) for CLM4.5, though users can also still use the -Qian et al. (2006) dataset or other alternative forcing datasets. +:ref:`Qian et al. (2006)` dataset or other alternative forcing datasets. CLM4.5 was released to the community in June 2013 along with the Community Earth System Model version 1.2 (CESM1.2). @@ -607,73 +611,75 @@ Biogeophysical and Biogeochemical Processes Biogeophysical and biogeochemical processes are simulated for each subgrid land unit, column, and plant functional type (PFT) independently and each subgrid unit maintains its own prognostic variables (see -section 2.1.1 for definitions of subgrid units). The same atmospheric +section :numref:`Surface Heterogeneity and Data Structure` for definitions +of subgrid units). The same atmospheric forcing is used to force all subgrid units within a grid cell. The surface variables and fluxes required by the atmosphere are obtained by averaging the subgrid quantities weighted by their fractional areas. The -processes simulated include (Figure 1.1): +processes simulated include (:numref:`Figure Land processes`): #. Surface characterization including land type heterogeneity and - ecosystem structure (Chapter 2) + ecosystem structure (Chapter :numref:`rst_Surface Characterization, Vertical Discretization, and Model Input Requirements`) #. Absorption, reflection, and transmittance of solar radiation (Chapter - 3, 4) + :numref:`rst_Surface Albedos`, :numref:`rst_Radiative Fluxes`) -#. Absorption and emission of longwave radiation (Chapter 4) +#. Absorption and emission of longwave radiation (Chapter :numref:`rst_Radiative Fluxes`) #. Momentum, sensible heat (ground and canopy), and latent heat (ground - evaporation, canopy evaporation, transpiration) fluxes (Chapter 5) + evaporation, canopy evaporation, transpiration) fluxes (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) -#. Heat transfer in soil and snow including phase change (Chapter 6) +#. Heat transfer in soil and snow including phase change (Chapter :numref:`rst_Soil and Snow Temperatures`) -#. Canopy hydrology (interception, throughfall, and drip) (Chapter 7) - -#. Snow hydrology (snow accumulation and melt, compaction, water - transfer between snow layers) (Chapter 7) +#. Canopy hydrology (interception, throughfall, and drip) (Chapter :numref:`rst_Hydrology`) #. Soil hydrology (surface runoff, infiltration, redistribution of water - within the column, sub-surface drainage, groundwater) (Chapter 7) + within the column, sub-surface drainage, groundwater) (Chapter :numref:`rst_Hydrology`) -#. Stomatal physiology and photosynthesis (Chapter 8) +#. Snow hydrology (snow accumulation and melt, compaction, water + transfer between snow layers) (Chapter :numref:`rst_Snow Hydrology`) + +#. Stomatal physiology and photosynthesis (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) -#. place Lake temperatures and fluxes (Chapter 9) +#. Lake temperatures and fluxes (Chapter :numref:`rst_Lake Model`) -#. Glacier processes (Chapter 10) +#. Glacier processes (Chapter :numref:`rst_Glaciers`) -#. Routing of runoff from rivers to ocean (Chapter 11) +#. Routing of runoff from rivers to ocean (Chapter :numref:`rst_River Transport Model (RTM)`) -#. Urban energy balance and climate (Chapter 12) +#. Urban energy balance and climate (Chapter :numref:`rst_Urban Model (CLMU)`) #. Vegetation carbon and nitrogen allocation and respiration (Chapter - 13) + :numref:`rst_CN Allocation`) -#. Vegetation phenology (Chapter 14) +#. Vegetation phenology (Chapter :numref:`rst_Vegetation Phenology and Turnover`) -#. Soil and litter carbon decomposition (Chapter 15) +#. Soil and litter carbon decomposition (Chapter :numref:`rst_Decomposition`) #. Nitrogen cycling including deposition, biological fixation, - denitrification, leaching, and losses due to fire (Chapter 16) + denitrification, leaching, and losses due to fire (Chapter :numref:`rst_External Nitrogen Cycle`) -#. Plant mortality (Chapter 17) +#. Plant mortality (Chapter :numref:`rst_Plant Mortality`) #. Fire ignition and suppression, including natural, deforestation, and - agricultural fire (Chapter 18) + agricultural fire (Chapter :numref:`rst_Fire`) + +#. Methane production, oxidation, and emissions (Chapter :numref:`rst_Methane Model`) -#. Methane production, oxidation, and emissions (Chapter 19) +#. Crop dynamics and irrigation (Chapter :numref:`rst_Crops and Irrigation`) -#. Crop dynamics and irrigation (Chapter 20) +#. Land cover and land use change including wood harvest (Chapter :numref:`rst_Transient Landcover Change`) -#. Land cover and land use change including wood harvest (Chapter 21) +#. Dynamic global vegetation distribution (Chapter :numref:`rst_Dynamic Global Vegetation Model`) -#. Dynamic global vegetation distribution (Chapter 22) +#. Biogenic volatile organic compound emissions (Chapter :numref:`rst_Biogenic Volatile Organic Compounds (BVOCs)`) -#. Biogenic volatile organic compound emissions (Chapter 23) +#. Dust mobilization and deposition (Chapter :numref:`rst_Dust Model`) -#. Dust mobilization and deposition (Chapter 24) +#. Carbon isotope fractionation (Chapter :numref:`rst_Carbon Isotopes`) -#. Carbon isotope fractionation (Chapter 25) +.. _Figure Land processes: -Figure 1.1. Land biogeophysical, biogeochemical, and landscape processes -simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). +.. figure:: image1.png -.. image:: image1.png + Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from :ref:`Lawrence et al. (2011)` for CLM4.5). diff --git a/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst b/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst index f4b8127a2c..093b7d7a37 100644 --- a/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst +++ b/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst @@ -235,7 +235,9 @@ datasets spanning the 20\ :math:`{}^{th}` century: (Levin and Kromer, 2004; Manning and Melhuish, 1994; Nydal and Lövseth, 1996; Turnbull et al. 2007). This is shown in Figure 25.1. -Figure 25.1. Atmospheric :math:`\mathrm{\Delta}`\ :sup:`14`\ C -used to drive :sup:`14`\ C model over the historical period. +.. _Figure Atmospheric Delta C14: -.. image:: image1.png +.. figure:: image1.png + + Atmospheric :math:`\mathrm{\Delta}`\ :sup:`14`\ C + used to drive :sup:`14`\ C model over the historical period. diff --git a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst index 6a29802004..c881a2c7c2 100644 --- a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst +++ b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst @@ -39,7 +39,7 @@ the atmosphere. Governing Mass-Balance Relationship ---------------------------------------- -The model (Figure 19.1) accounts for CH\ :sub:`4` production in +The model (:numref:`Figure Methane Schematic`) accounts for CH\ :sub:`4` production in the anaerobic fraction of soil (*P*, mol m\ :sup:`-3` s\ :sup:`-1`), ebullition (*E*, mol m\ :sup:`-3` s\ :sup:`-1`), aerenchyma transport (*A*, mol m\ :sup:`-3` s\ :sup:`-1`), aqueous and gaseous diffusion (:math:`{F}_{D}`, mol m\ :sup:`-2` s\ :sup:`-1`), and oxidation (*O*, mol m\ :sup:`-3` s\ :sup:`-1`) via a transient reaction @@ -78,12 +78,14 @@ CH\ :sub:`4` to the atmosphere when the inundated fraction decreases, and averaging a portion of the non-inundated concentration into the inundated concentration when the inundated fraction increases. -Figure 19.1. Schematic representation of biological and physical -processes integrated in CLM that affect the net CH\ :sub:`4` -surface flux (Riley et al. 2011a). (left) Fully inundated portion of a -CLM gridcell and (right) variably saturated portion of a gridcell. +.. _Figure Methane Schematic: -.. image:: image1.png +.. figure:: image1.png + + Schematic representation of biological and physical + processes integrated in CLM that affect the net CH\ :sub:`4` + surface flux (:ref:`Riley et al. 2011a`). (left) Fully inundated portion of a + CLM gridcell and (right) variably saturated portion of a gridcell. CH\ :sub:`4` Production ---------------------------------- @@ -112,7 +114,7 @@ seasonal inundation fraction (*S*, described below): Here, :math:`f_{CH_{4} }` is the baseline ratio between CO\ :sub:`2` and CH\ :sub:`4` production (all parameters -values are given in Table 19.1). Currently, :math:`f_{CH_{4} }` is +values are given in :numref:`Table Methane Parameter descriptions`). Currently, :math:`f_{CH_{4} }` is modified to account for our assumptions that methanogens may have a higher Q\ :math:`{}_{10}` than aerobic decomposers; are not N limited; and do not have a low-moisture limitation. @@ -170,44 +172,46 @@ The model also calculates the O\ :sub:`2` required during nitrification, and the total O\ :sub:`2` demand is used in the O\ :sub:`2` mass balance solution. -Table 19.1. Parameter descriptions and sensitivity analysis ranges -applied in the methane model. - -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Mechanism | Parameter | Baseline Value | Range for Sensitivity Analysis | Units | Description | -+==============+============================+==============================================+==================================================================================================+=============================================+============================================================================================+ -| Production | :math:`{Q}_{10}` | 2 | 1.5 – 4 | - | CH\ :sub:`4` production :math:`{Q}_{10}` | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{pH}` | 1 | On, off | - | Impact of pH on CH\ :sub:`4` production | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{pE}` | 1 | On, off | - | Impact of redox potential on CH\ :sub:`4` production | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | *S* | Varies | NA | - | Seasonal inundation factor | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`\beta` | 0.2 | NA | - | Effect of anoxia on decomposition rate (used to calculate *S* only) | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`f_{CH_{4} }` | 0.2 | NA | - | Ratio between CH\ :sub:`4` and CO\ :sub:`2` production below the water table | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Ebullition | :math:`{C}_{e,max}` | 0.15 | NA | mol m\ :sup:`-3` | CH\ :sub:`4` concentration to start ebullition | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`{C}_{e,min}` | 0.15 | NA | - | CH\ :sub:`4` concentration to end ebullition | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Diffusion | :math:`f_{D_{0} }` | 1 | 1, 10 | m\ :sup:`2` s\ :sup:`-1` | Diffusion coefficient multiplier (Table 19.2) | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Aerenchyma | *p* | 0.3 | NA | - | Grass aerenchyma porosity | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | *R* | 2.9\ :math:`\times`\ 10\ :sup:`-3` m | NA | m | Aerenchyma radius | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`{r}_{L}` | 3 | NA | - | Root length to depth ratio | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`{F}_{a}` | 1 | 0.5 – 1.5 | - | Aerenchyma conductance multiplier | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| Oxidation | :math:`K_{CH_{4} }` | 5 x 10\ :sup:`-3` | 5\ :math:`\times`\ 10\ :math:`{}^{-4}`\ :math:`{}_{ }`- 5\ :math:`\times`\ 10\ :sup:`-2` | mol m\ :sup:`-3` | CH\ :sub:`4` half-saturation oxidation coefficient (wetlands) | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`K_{O_{2} }` | 2 x 10\ :sup:`-2` | 2\ :math:`\times`\ 10\ :sup:`-3` - 2\ :math:`\times`\ 10\ :sup:`-1` | mol m\ :sup:`-3` | O\ :sub:`2` half-saturation oxidation coefficient | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ -| | :math:`R_{o,\max }` | 1.25 x 10\ :math:`{}^{-5}` | 1.25\ :math:`\times`\ 10\ :math:`{}^{-6}` - 1.25\ :math:`\times`\ 10\ :math:`{}^{-4}` | mol m\ :sup:`-3` s\ :sup:`-1` | Maximum oxidation rate (wetlands) | -+--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ +.. _Table Methane Parameter descriptions: + +.. table:: Parameter descriptions and sensitivity analysis ranges applied in the methane model + + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | Mechanism | Parameter | Baseline Value | Range for Sensitivity Analysis | Units | Description | + +==============+============================+==============================================+==================================================================================================+=============================================+============================================================================================+ + | Production | :math:`{Q}_{10}` | 2 | 1.5 – 4 | - | CH\ :sub:`4` production :math:`{Q}_{10}` | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`f_{pH}` | 1 | On, off | - | Impact of pH on CH\ :sub:`4` production | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`f_{pE}` | 1 | On, off | - | Impact of redox potential on CH\ :sub:`4` production | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | *S* | Varies | NA | - | Seasonal inundation factor | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`\beta` | 0.2 | NA | - | Effect of anoxia on decomposition rate (used to calculate *S* only) | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`f_{CH_{4} }` | 0.2 | NA | - | Ratio between CH\ :sub:`4` and CO\ :sub:`2` production below the water table | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | Ebullition | :math:`{C}_{e,max}` | 0.15 | NA | mol m\ :sup:`-3` | CH\ :sub:`4` concentration to start ebullition | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`{C}_{e,min}` | 0.15 | NA | - | CH\ :sub:`4` concentration to end ebullition | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | Diffusion | :math:`f_{D_{0} }` | 1 | 1, 10 | m\ :sup:`2` s\ :sup:`-1` | Diffusion coefficient multiplier (Table 19.2) | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | Aerenchyma | *p* | 0.3 | NA | - | Grass aerenchyma porosity | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | *R* | 2.9\ :math:`\times`\ 10\ :sup:`-3` m | NA | m | Aerenchyma radius | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`{r}_{L}` | 3 | NA | - | Root length to depth ratio | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`{F}_{a}` | 1 | 0.5 – 1.5 | - | Aerenchyma conductance multiplier | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | Oxidation | :math:`K_{CH_{4} }` | 5 x 10\ :sup:`-3` | 5\ :math:`\times`\ 10\ :math:`{}^{-4}`\ :math:`{}_{ }`- 5\ :math:`\times`\ 10\ :sup:`-2` | mol m\ :sup:`-3` | CH\ :sub:`4` half-saturation oxidation coefficient (wetlands) | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`K_{O_{2} }` | 2 x 10\ :sup:`-2` | 2\ :math:`\times`\ 10\ :sup:`-3` - 2\ :math:`\times`\ 10\ :sup:`-1` | mol m\ :sup:`-3` | O\ :sub:`2` half-saturation oxidation coefficient | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + | | :math:`R_{o,\max }` | 1.25 x 10\ :math:`{}^{-5}` | 1.25\ :math:`\times`\ 10\ :math:`{}^{-6}` - 1.25\ :math:`\times`\ 10\ :math:`{}^{-4}` | mol m\ :sup:`-3` s\ :sup:`-1` | Maximum oxidation rate (wetlands) | + +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ + Ebullition --------------- @@ -384,18 +388,19 @@ source through aerenchyma. For gaseous diffusion, we adopted the temperature dependence of molecular free-air diffusion coefficients (:math:`{D}_{0}` -(m:sup:`2` s\ :sup:`-1`)) as described by Lerman et al. (1979) and applied by Wania et al. (2010) (Table 19.2). - -Table 19.2. Temperature dependence of aqueous and gaseous diffusion -coefficients for CH\ :sub:`4` and O\ :sub:`2`. - -+----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ -| :math:`{D}_{0}` (m\ :sup:`2` s\ :sup:`-1`) | CH\ :sub:`4` | O\ :sub:`2` | -+==========================================================+==========================================================+========================================================+ -| Aqueous | 0.9798 + 0.02986\ *T* + 0.0004381\ *T*\ :sup:`2` | 1.172+ 0.03443\ *T* + 0.0005048\ *T*\ :sup:`2` | -+----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ -| Gaseous | 0.1875 + 0.0013\ *T* | 0.1759 + 0.0011\ *T* | -+----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ +(m:sup:`2` s\ :sup:`-1`)) as described by Lerman et al. (1979) and applied by Wania et al. (2010) (:numref:`Table Temperature dependence of aqueous and gaseous diffusion`). + +.. _Table Temperature dependence of aqueous and gaseous diffusion: + +.. table:: Temperature dependence of aqueous and gaseous diffusion coefficients for CH\ :sub:`4` and O\ :sub:`2` + + +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ + | :math:`{D}_{0}` (m\ :sup:`2` s\ :sup:`-1`) | CH\ :sub:`4` | O\ :sub:`2` | + +==========================================================+==========================================================+========================================================+ + | Aqueous | 0.9798 + 0.02986\ *T* + 0.0004381\ *T*\ :sup:`2` | 1.172+ 0.03443\ *T* + 0.0005048\ *T*\ :sup:`2` | + +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ + | Gaseous | 0.1875 + 0.0013\ *T* | 0.1759 + 0.0011\ *T* | + +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ Gaseous diffusivity in soils also depends on the molecular diffusivity, soil structure, porosity, and organic matter content. Moldrup et al. diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index 28f43fce9a..c451a6dbef 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -14,7 +14,7 @@ where :math:`\vec{S}` is the net solar flux absorbed by the vegetation Solar Fluxes ---------------- -Figure 4.1 illustrates the direct beam and diffuse fluxes in the canopy. +:numref:`Figure Radiation Schematic` illustrates the direct beam and diffuse fluxes in the canopy. :math:`I\, \uparrow _{\Lambda }^{\mu }` and :math:`I\, \uparrow _{\Lambda }` are the upward diffuse fluxes, per unit incident direct beam and diffuse flux (section 3.1). @@ -32,14 +32,17 @@ albedos (section 3.2). :math:`L` and :math:`S` are the exposed leaf area index and stem area index (section 2.1.4). :math:`K` is the optical depth of direct beam per unit leaf and stem area (section 3.1). -Figure 4.1. Schematic diagram of (a) direct beam radiation, (b) diffuse -solar radiation, and (c) longwave radiation absorbed, transmitted, and -reflected by vegetation and ground. +.. _Figure Radiation Schematic: + +.. figure:: image1.png + + Schematic diagram of (a) direct beam radiation, (b) diffuse + solar radiation, and (c) longwave radiation absorbed, transmitted, and + reflected by vegetation and ground. For clarity, terms involving :math:`T^{n+1} -T^{n}` are not shown in (c). -.. image:: image1.png The total solar radiation absorbed by the vegetation and ground is @@ -169,7 +172,7 @@ longwave radiation (W m\ :sup:`-2`). The radiative temperature T_{rad} =\left(\frac{L\, \uparrow }{\sigma } \right)^{{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } where :math:`\sigma` is the Stefan-Boltzmann constant (W\ m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6). With reference to -Figure 4.1, the upward longwave radiation from the surface to the atmosphere is +:numref:`Figure Radiation Schematic`, the upward longwave radiation from the surface to the atmosphere is .. math:: :label: 4.11 diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 083c6b651e..0a7b941359 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -106,7 +106,7 @@ temperature :math:`T_{i}` [K]; thermal conductivity :math:`\lambda _{i}` [W m\ :sup:`-1` K\ :sup:`-1`]; volumetric heat capacity :math:`c_{i}` [J m\ :sup:`-3` K\ :sup:`-1`]) are defined for soil layers at the node depths -(Figure 6.1) and for snow layers at the layer midpoints. When present, +(:numref:`Figure Soil Temperature Schematic`) and for snow layers at the layer midpoints. When present, snow occupies a fraction of a grid cell’s area, therefore snow depth represents the thickness of the snowpack averaged over only the snow covered area. The grid cell average snow depth is related to the depth @@ -130,7 +130,8 @@ where the thermal conductivity at the interface \lambda \left[z_{h,\, i} \right]=\left\{\begin{array}{l} {\frac{\lambda _{i} \lambda _{i+1} \left(z_{i+1} -z_{i} \right)}{\lambda _{i} \left(z_{i+1} -z_{h,\, i} \right)+\lambda _{i+1} \left(z_{h,\, i} -z_{i} \right)} \qquad i=snl+1,\ldots ,N_{levgrnd} -1} \\ {0\qquad i=N_{levgrnd} } \end{array}\right\}. -These equations are derived, with reference to Figure 6.1, assuming +These equations are derived, with reference to +:numref:`Figure Soil Temperature Schematic`, assuming that the heat flux from :math:`i` (depth :math:`z_{i}` ) to the interface between :math:`i` and :math:`i+1` (depth :math:`z_{h,\, i}` ) equals the heat flux from the interface to :math:`i+1` (depth diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index fad229fe7c..e6f40c34ef 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -345,12 +345,14 @@ discussions new amended wood harvest targets were generated with regional targets through GLM for the RCP 6.0 and RCP 8.5 time series as described in Lawrence et al. (2012). -Figure 21.1. Schematic of land cover change impacts on CLM carbon pools -and fluxes. +.. _Figure Schematic of land cover change: -.. image:: image1.png +.. figure:: image1.png -Figure 21.2. Schematic of translation of annual UNH land units to CLM4 -plant functional types. + Schematic of land cover change impacts on CLM carbon pools and fluxes. -.. image:: image2.png +.. _Figure Schematic of translation of annual UNH land units: + +.. figure:: image2.png + + Schematic of translation of annual UNH land units to CLM4 plant functional types. diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index b95589f7b4..df42e024e9 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -103,15 +103,22 @@ climate and socioeconomic considerations. The surface dataset creation routines (see CLM4.5 User’s Guide) aggregate the data to the desired resolution. -Figure 12.1. Schematic representation of the urban land unit. +.. _Figure Schematic representation of the urban land unit: + +.. figure:: image1.png + + Schematic representation of the urban land unit. See the text for description of notation. Incident, reflected, and net solar and longwave radiation are calculated for each individual surface but are not shown for clarity. -.. image:: image1.png -Figure 12.2. Schematic of urban and atmospheric model coupling. +.. _Figure Schematic of urban and atmospheric model coupling: + +.. figure:: image2.png + + Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind (:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific @@ -129,4 +136,4 @@ absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature (:math:`u_{c}` ) within the urban canopy layer are diagnosed by the urban model. :math:`H` is the average building height. -.. image:: image2.png + diff --git a/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst b/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst index de270ebdc6..251e1acfcd 100644 --- a/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst +++ b/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst @@ -31,9 +31,11 @@ maintained as a separate state variable for each tissue type. Storage reduce the complexity of accounting for transfers into and out of storage over the course of a single growing season. -Figure 14.1. Example of annual phenology cycle for seasonal deciduous. +.. _Figure annual phenology cycle: -.. image:: image1.png +.. figure:: image1.png + + Example of annual phenology cycle for seasonal deciduous. 14.1.1 Onset Periods ^^^^^^^^^^^^^^^^^^^^ From 9b9e27d1a21af2007037f38d3a7f7d381b3524c0 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 30 May 2017 15:39:12 -0600 Subject: [PATCH 028/730] Chapter 15 urban model updates and cleanup --- .../tech_note/Urban/CLM50_Tech_Note_Urban.rst | 49 +++++++++---------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index b95589f7b4..e53b33463f 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -5,7 +5,8 @@ Urban Model (CLMU) At the global scale, and at the coarse spatial resolution of current climate models, urbanization has negligible impact on climate. However, -the urban parameterization (CLMU; Oleson et al. 2008b,c) allows +the urban parameterization (CLMU; :ref:`Oleson et al. (2008b) `; +:ref:`Oleson et al. (2008c) `) allows simulation of the urban environment within a climate model, and particularly the temperature where people live. As such, the urban model allows scientific study of how climate change affects the urban heat @@ -13,7 +14,8 @@ island and possible urban planning and design strategies to mitigate warming (e.g., white roofs). The urban model that was released as a component of CLM4.0 is separately -described in the urban technical note (Oleson et al. 2010b). Here, we +described in the urban technical note (:ref:`Oleson et al. (2010b) `). +Here, we provide a brief overview of the urban model released as a component of CLM4.5. The main changes in the urban model from CLM4.0 to CLM4.5 are 1) an expansion of the single urban landunit to up to three landunits per @@ -28,9 +30,11 @@ calculations for the pervious road now follows CLM4.5 parameterizations. Urban areas in CLM are represented by up to three urban landunits per gridcell according to density class. The urban landunit is based on the -“urban canyon†concept of Oke (1987) in which the canyon geometry is +“urban canyon†concept of :ref:`Oke (1987) ` in which +the canyon geometry is described by building height (:math:`H`) and street width (:math:`W`) -(Figure 12.1). The canyon system consists of roofs, walls, and canyon +(:numref:`Figure schematic representation of urban`). The canyon system +consists of roofs, walls, and canyon floor. Walls are further divided into shaded and sunlit components. The canyon floor is divided into pervious (e.g., to represent residential lawns, parks) and impervious (e.g., to represent roads, parking lots, @@ -39,12 +43,13 @@ pervious fraction; instead evaporation is parameterized by a simplified bulk scheme. Each of the five urban surfaces is treated as a column within the -landunit (Figure 12.1). Radiation parameterizations account for trapping +landunit (:numref:`Figure schematic representation of urban`). +Radiation parameterizations account for trapping of solar and longwave radiation inside the canyon. Momentum fluxes are determined for the urban landunit using a roughness length and displacement height appropriate for the urban canyon and stability formulations from CLM. A one-dimensional heat conduction equation is -solved numerically for a multiple-layer (:math:`N_{levurb} =5`) column +solved numerically for a multiple-layer (:math:`N_{levurb} =10`) column to determine conduction fluxes into and out of canyon surfaces. The interior boundary conditions for roofs and walls are determined by an interior building temperature (:math:`T_{iB}` ) held between prescribed @@ -67,7 +72,8 @@ maximum ponding depth runs off The heat and moisture fluxes from each surface interact with each other through a bulk air mass that represents air in the urban canopy layer for which specific humidity (:math:`q_{ac}` ) and temperature -(:math:`T_{ac}` ) are prognosed (Figure 12.2). The air temperature can +(:math:`T_{ac}` ) are prognosed (:numref:`Figure schematic of urban and atmospheric model coupling`). +The air temperature can be compared with that from surrounding vegetated/soil (rural) surfaces in the model to ascertain heat island characteristics. As with other landunits, the CLMU is forced either with output from a host atmospheric @@ -103,30 +109,19 @@ climate and socioeconomic considerations. The surface dataset creation routines (see CLM4.5 User’s Guide) aggregate the data to the desired resolution. -Figure 12.1. Schematic representation of the urban land unit. +.. Figure 12.1. Schematic representation of the urban land unit -See the text for description of notation. Incident, reflected, and net -solar and longwave radiation are calculated for each individual surface -but are not shown for clarity. +.. _Figure schematic representation of urban: -.. image:: image1.png +.. Figure:: image1.png -Figure 12.2. Schematic of urban and atmospheric model coupling. + Schematic representation of the urban land unit. See the text for description of notation. Incident, reflected, and net solar and longwave radiation are calculated for each individual surface but are not shown for clarity. -The urban model is forced by the atmospheric model wind -(:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific -humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar -(:math:`S_{atm} \, \downarrow` ) and longwave -(:math:`L_{atm} \, \downarrow` ) radiation at reference height -:math:`z'_{atm}` (section 2.2.1). Fluxes from the urban landunit to the -atmosphere are turbulent sensible (:math:`H`) and latent heat -(:math:`\lambda E`), momentum (:math:`\tau` ), albedo -(:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and -absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature +.. Figure 12.2. Schematic of urban and atmospheric model coupling -(:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed -(:math:`u_{c}` ) within the urban canopy layer are diagnosed by the -urban model. :math:`H` is the average building height. +.. _Figure schematic of urban and atmospheric model coupling: -.. image:: image2.png +.. Figure:: image2.png + + Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind (:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar (:math:`S_{atm} \, \downarrow` ) and longwave (:math:`L_{atm} \, \downarrow` ) radiation at reference height :math:`z'_{atm}` (section 2.2.1). Fluxes from the urban landunit to the atmosphere are turbulent sensible (:math:`H`) and latent heat (:math:`\lambda E`), momentum (:math:`\tau` ), albedo (:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature (:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed (:math:`u_{c}` ) within the urban canopy layer are diagnosed by the urban model. :math:`H` is the average building height. From 0bdb352242c6bc6d4b88b67786325e3748325004 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 30 May 2017 17:46:39 -0600 Subject: [PATCH 029/730] Chapter 15 Urban model updates and cleanup --- .../References/CLM50_Tech_Note_References.rst | 12 +++ .../tech_note/Urban/CLM50_Tech_Note_Urban.rst | 80 ++++++++++++------- 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 7fb1521105..5c278d1e0f 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -221,6 +221,12 @@ biomass across multiple biogeographical regions. Ecol. Appl. 10:95-114. Busing, R.T. 2005. Tree mortality, canopy turnover, and woody detritus in old cove forests of the southern Appalachians. Ecology 86:73-84. +.. _Buzanetal2015: + +Buzan, J.R., Oleson, K., and Huber, M. 2015: Implementation and +comparison of a suite of heat stress metrics within the Community Land +Model version 4.5, Geosci. Model Dev., 8, 151-170, doi:10.5194/gmd-8-151-2015. + .. _CampbellNorman1998: Campbell, G.S., and Norman, J.M. 1998. An Introduction to Environmental @@ -1616,6 +1622,12 @@ Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen redistribution during grain growth in wheat (Triticum avestivum L.). Plant Physiol. 71:7-14. +.. _Sivak2013: + +Sivak, M. 2013. Air conditioning versus heating: climate control is more +energy demanding in Minneapolis than in Miami. Environ. Res. Lett., 8, +doi:10.1088/1748-9326/8/1/014050. + .. _Smithetal2005: Smith, A.M.S., Wooster, M.J., Drake, N.A., Dipotso, F.M. and Perry, diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index 8292ea3394..35a77b901f 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -13,21 +13,6 @@ allows scientific study of how climate change affects the urban heat island and possible urban planning and design strategies to mitigate warming (e.g., white roofs). -The urban model that was released as a component of CLM4.0 is separately -described in the urban technical note (:ref:`Oleson et al. (2010b) `). -Here, we -provide a brief overview of the urban model released as a component of -CLM4.5. The main changes in the urban model from CLM4.0 to CLM4.5 are 1) -an expansion of the single urban landunit to up to three landunits per -grid cell stratified by urban density types, 2) the number of urban -layers for roofs and walls is no longer constrained to be equal to the -number of ground layers, 3) space heating and air conditioning wasteheat -factors are now set to zero by default so that the user can customize -these factors for their own application, 4) the elevation threshold used -to eliminate urban areas in the surface dataset creation routines has -been changed from 2200 meters to 2600 meters, 5) hydrologic and thermal -calculations for the pervious road now follows CLM4.5 parameterizations. - Urban areas in CLM are represented by up to three urban landunits per gridcell according to density class. The urban landunit is based on the “urban canyon†concept of :ref:`Oke (1987) ` in which @@ -50,15 +35,25 @@ determined for the urban landunit using a roughness length and displacement height appropriate for the urban canyon and stability formulations from CLM. A one-dimensional heat conduction equation is solved numerically for a multiple-layer (:math:`N_{levurb} =10`) column -to determine conduction fluxes into and out of canyon surfaces. The -interior boundary conditions for roofs and walls are determined by an -interior building temperature (:math:`T_{iB}` ) held between prescribed -maximum and minimum temperatures +to determine conduction fluxes into and out of canyon surfaces. + +A new building energy model has been developed for CLM5.0. It accounts +for the conduction of heat through interior surfaces (roof, sunlit and +shaded walls, and floors), convection (sensible heat exchange) between +interior surfaces and building air, longwave radiation exchange between +interior surfaces, and ventilation (natural infiltration and exfiltration). +Idealized HAC systems are assumed where the system capacity is infinite and +the system supplies the amount of energy needed to keep the indoor air +temperature (:math:`T_{iB}`) within maximum and minimum emperatures (:math:`T_{iB,\, \max } ,\, T_{iB,\, \min }` ), thus explicitly -resolving space heating and air conditioning fluxes. Anthropogenic -sources of waste heat (:math:`Q_{H,\, waste}` ) from air conditioning -and space heating can be optionally incorporated as modifications to the -canyon energy budget. Turbulent [sensible heat (:math:`Q_{H,\, u}` ) and +resolving space heating and air conditioning fluxes. Anthropogenic sources +of waste heat (:math:`Q_{H,\, waste}` ) from HAC that account for inefficiencies +in the heating and air conditioning equipment and from energy lost in the +conversion of primary energy sources to end use energy are derived from +:ref:`Sivak (2013) `. These sources of waste heat are incorporated +as modifications to the canyon energy budget. + +Turbulent [sensible heat (:math:`Q_{H,\, u}` ) and latent heat (:math:`Q_{E,\, u}` )] and storage (:math:`Q_{S,\, u}` ) heat fluxes and surface (:math:`T_{u,\, s}` ) and internal (:math:`T_{u,\, i=1,\, N_{levgrnd} }` ) temperatures are determined for @@ -77,7 +72,7 @@ The air temperature can be compared with that from surrounding vegetated/soil (rural) surfaces in the model to ascertain heat island characteristics. As with other landunits, the CLMU is forced either with output from a host atmospheric -model (e.g., the Community Atmosphere Model (stocktickerCAM)) or +model (e.g., the Community Atmosphere Model (CAM)) or observed forcing (e.g., reanalysis or field observations). The urban model produces sensible, latent heat, and momentum fluxes, emitted longwave, and reflected solar radiation, which are area-averaged with @@ -85,11 +80,11 @@ fluxes from non-urban “landunits†(e.g., vegetation, lakes) to supply grid cell averaged fluxes to the atmospheric model. Present day global urban extent and urban properties were developed by -Jackson et al. (2010). Urban extent, defined for four classes [tall +:ref:`Jackson et al. (2010) `. Urban extent, defined for four classes [tall building district (TBD), and high, medium, and low density (HD, MD, LD)], was derived from LandScan 2004, a population density dataset derived from census data, nighttime lights satellite observations, road -proximity, and slope (Dobson et al. 2000). The urban extent data for +proximity, and slope (:ref:`Dobson et al. 2000 `). The urban extent data for TBD, HD, and MD classes are aggregated from the original 1 km resolution to both a 0.05\ :sup:`o` by 0.05\ :sup:`o` global grid for high-resolution studies or a 0.5\ :sup:`o` by @@ -106,7 +101,7 @@ fraction, average building height, and pervious fraction of the canyon floor) properties are provided for each of the density classes. Building interior minimum and maximum temperatures are prescribed based on climate and socioeconomic considerations. The surface dataset creation -routines (see CLM4.5 User’s Guide) aggregate the data to the desired +routines (see CLM5.0 User’s Guide) aggregate the data to the desired resolution. .. Figure 12.1. Schematic representation of the urban land unit @@ -123,4 +118,33 @@ resolution. .. Figure:: image2.png - Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind (:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar (:math:`S_{atm} \, \downarrow` ) and longwave (:math:`L_{atm} \, \downarrow` ) radiation at reference height :math:`z'_{atm}` (section 2.2.1). Fluxes from the urban landunit to the atmosphere are turbulent sensible (:math:`H`) and latent heat (:math:`\lambda E`), momentum (:math:`\tau` ), albedo (:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature (:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed (:math:`u_{c}` ) within the urban canopy layer are diagnosed by the urban model. :math:`H` is the average building height. + Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind (:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar (:math:`S_{atm} \, \downarrow` ) and longwave (:math:`L_{atm} \, \downarrow` ) radiation at reference height :math:`z'_{atm}` (section :numref:`Atmospheric Coupling`). Fluxes from the urban landunit to the atmosphere are turbulent sensible (:math:`H`) and latent heat (:math:`\lambda E`), momentum (:math:`\tau` ), albedo (:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature (:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed (:math:`u_{c}` ) within the urban canopy layer are diagnosed by the urban model. :math:`H` is the average building height. + +The urban model that was first lreleased as a component of CLM4.0 is separately +described in the urban technical note (:ref:`Oleson et al. (2010b) `). +The main changes in the urban model from CLM4.0 to CLM4.5 were 1) +an expansion of the single urban landunit to up to three landunits per +grid cell stratified by urban density types, 2) the number of urban +layers for roofs and walls was no longer constrained to be equal to the +number of ground layers, 3) space heating and air conditioning wasteheat +factors were set to zero by default so that the user could customize +these factors for their own application, 4) the elevation threshold used +to eliminate urban areas in the surface dataset creation routines was +increased from 2200 meters to 2600 meters, 5) hydrologic and thermal +calculations for the pervious road followed CLM4.5 parameterizations. + +The main changes in the urban model from CLM4.5 to CLM5.0 are 1) a more +sophisticated and realistic building space heating and air conditioning +submodel that prognoses interior building air temperature and includes more +realistic space heating and air conditioning wasteheat factors (see above), 2) the maximum +building temperature (which determines air conditioning demand) is now read in +from a namelist-defined file which allows for dynamic control of this input +variable. The maximum building temperatures that are defined in +:ref:`Jackson et al. (2010) ` are implemented in year 1950 (thus +air conditioning is off in prior years) and air conditioning is turned off in year +2100 (because the buildings are not suitable for air conditioning in some extreme +global warming scenarios). These feature will be described in more detail in +a forthcoming paper. In addition, a module of heat stress indices calculated online +in the model that can be used to assess human thermal comfort for rural and urban +areas has been added. This last development is described and evaluated by +:ref:`Buzan et al. (2015) `. From a9fcbcfb792a6f63adec14e59e68d4ba0f036a1f Mon Sep 17 00:00:00 2001 From: djk2120 Date: Wed, 31 May 2017 11:08:47 -0400 Subject: [PATCH 030/730] Update PHS equations for sections 11.1-3 --- ...CLM50_Tech_Note_Plant_Hydraulic_Stress.rst | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) diff --git a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst index ed75965d41..e5541bf2b4 100644 --- a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst +++ b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst @@ -2,3 +2,256 @@ Plant Hydraulic Stress ====================== + +Hello + +.. _Plant Water Supply: + +Plant Water Supply +----------------------- + +PHS explicitly models water transport through the vegetation according to a simple hydraulic framework following Darcy's Law for porous media flow equations. The supply equations are used to solve for vegetation water potential forced by a given transpiration and the set of layer-by-layer soil water potentials. + +The water supply is discretized into segments: soil-to-root, root-to-stem, and stem-to-leaf. There are typically several (1-49) soil-to-root flows operating in parallel, one per soil layer. There are two stem-to-leaf flows operating in parallel, corresponding to the sunlit and shaded "leaves". + +In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculated as: + +.. math:: + :label: 11.1) + + q = kA\Delta\psi + + +:math:`q` is the flux of water (mmH\ :sub:`2`\ O) + +:math:`k` is the hydraulic conductance (s\ :sup:`-1`\ ) + +:math:`A` is the area basis (m\ :sup:`2`\ /m\ :sup:`2`\ ) + +:math:`\Delta\psi` is the gradient in water potential (mmH\ :sub:`2`\ O) + +.. math:: + :label: 11.2) + + k=k_{max}\cdot 2^{-\left(\dfrac{\psi}{p50}\right)^{c_k}} + +:math:`k_{max}` is the maximum segment conductance (s-1) + +:math:`p50` is the water potential at 50% loss of conductivity (mmH2O) + +:math:`\psi` is the water potential of the lower segment terminus (mmH2O) + +.. math:: + :label: 11.3) + + q_{1a}=k_{1a}*\mbox{LAI}_{sun}*\left(\psi_{stem}-\psi_{sunleaf} \right) + +.. math:: + :label: 11.4) + + q_{1b}=k_{1b}*\mbox{LAI}_{shade}*\left(\psi_{stem}-\psi_{shadeleaf} \right) + +.. math:: + :label: 11.5) + + k_{1a}=k_{1a,max}*2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} + +.. math:: + :label: 11.6) + + k_{1b}=k_{1b,max}*2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} + +Variables: + +:math:`LAI_{sun}` = sunlit leaf area index (m2/m2) + +:math:`LAI_{shade}` = shaded leaf area index (m2/m2) + +:math:`\psi_{stem}` = stem water potential (mmH20) + +:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH20) + +:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH20) + +Parameters: + +:math:`k_{1a,max}` = maximum leaf conductance (s-1) + +:math:`k_{1b,max}` = maximum leaf conductance (s-1) + +:math:`p50_{1}` = water potential at 50% loss of conductance (mmH2O) + +:math:`c_{k}` = vulnerability curve shape-fitting parameter (-) + +.. math:: + :label: 11.7) + + q_2=k_2 \cdot SAI \cdot \left( \psi_{root} - \psi_{stem} - \Delta \psi_z \right) + +.. math:: + :label: 11.8) + + k_2=\dfrac{k_{2,max}}{z_2} \cdot 2^{-\left(\dfrac{\psi_{root}}{p50_2}\right)^{c_k}} + +Variables: + +:math:`SAI` = stem area index (m2/m2) + +:math:`\Delta\psi_z` = gravitational potential (mmH2O) + +:math:`\psi_{root}` = root water potential (mmH2O) + +:math:`\psi_{stem}` = stem water potential (mmH2O) + +Parameters: + +:math:`k_{2,max}` = maximum stem conductivity (m/s) + +:math:`p50_2` = water potential at 50% loss of conductivity (mmH2O) + +:math:`z_2` = vegetation height (m) + +.. math:: + :label: 11.9) + + q_{3,i}=k_{3,i}*RAI*\left(\psi_{soil,i}-\psi_{root} + \Delta\psi_{z,i} \right) + +.. math:: + :label: 11.10) + + RAI=\left(LAI+SAI \right)\cdot r_i \cdot f_{root-leaf} + +.. math:: + :label: 11.11) + + k_{3,i}=\dfrac{k_{root}*k_{soil-to-root}}{k_{root}+k_{soil-to-root}} + +.. math:: + :label: 11.12) + + k_{root,i}=\dfrac{k_{3,max}}{z_{3,i}}*2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} + +.. math:: + :label: 11.13) + + k_{soil-to-root} = \dfrac{k_{soil,i}}{dx_{root,i}} + +.. math:: + :label: 11.14) + + dx_{root,i} = \left(\pi*\mbox{root-length-density}_i\right)^{-0.5} + +.. math:: + :label: 11.15) + + \mbox{root-length-density} = \dfrac{\mbox{total root length}}{\mbox{soil volume}} + +Variables: + +:math:`\Delta\psi_{z,i}` = change in gravitational potential from soil layer :math:`i` to surface (mmH2O) + +:math:`LAI` = total leaf area index (m2/m2) + +:math:`SAI` = stem area index (m2/m2) + +:math:`\psi_{soil,i}` = water potential in soil layer :math:`i` (mmH2O) + +:math:`\psi_{root}` = root water potential (mmH2O) + +:math:`z_{3,i}` = length of root tissue conducting path = soil layer depth + root lateral length (m) + +:math:`r_i` = root fraction in soil layer :math:`i` (-) + +:math:`k_{soil,i}` = Brooks-Corey soil conductivity in soil layer :math:`i` (m/s) + +Parameters: + +:math:`f_{root-leaf}` = root-to-shoot ratio (-) + +:math:`p50_3` = water potential at 50% loss of root tissue conductance (mmH2O) + +:math:`ck` = shape-fitting parameter for vulnerability curve (-) + +.. _Plant Water Demand: + +Plant Water Demand +----------------------- + +.. math:: + :label: 11.16) + + E_{sun} = E_{sun,max}*2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} + +.. math:: + :label: 11.17) + + E_{shade} = E_{shade,max}*2^{-\left(\dfrac{\psi_{shadeleaf}}{p50_e}\right)^{c_k}} + +.. math:: + :label: 11.18) + + B_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,B_t=1}} + +.. math:: + :label: 11.19) + + B_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,B_t=1}} + +:math:`E_{sun}` = sunlit leaf transpiration (mm/s) + +:math:`E_{shade}` = shaded leaf transpiration (mm/s) + +:math:`E_{sun,max}` = sunlit leaf transpiration absent water stress (mm/s) + +:math:`E_{shade,max}` = shaded leaf transpiration absent water stress (mm/s) + +:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH2O) + +:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH2O) + +:math:`g_{s,sun}` = stomatal conductance of water corresponding to :math:`E_{sun}` + +:math:`g_{s,shade}` = stomatal conductance of water corresponding to :math:`E_{shade}` + +:math:`g_{s,sun,max}` = stomatal conductance of water corresponding to :math:`E_{sun,max}` + +:math:`g_{s,shade,max}` = stomatal conductance of water corresponding to :math:`E_{shade,max}` + +.. _Vegetation Water Potential: + +Vegetation Water Potential +----------------------------- + +PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential at each timestep. PHS iterates to find the vegetation water potential vector :math:`\psi` that satisfies continuity in the non-linear vegetation water supply and demand equations. + +.. math:: + :label: 11.20) + + \psi=\left[\psi_{sunleaf},\psi_{shadeleaf},\psi_{stem},\psi_{root}\right] + +.. math:: + :label: 11.21) + + \begin{aligned} + E_{sun}&=q_{1a}\\ + E_{shade}&=q_{1b}\\ + E_{sun}+E_{shade}&=q_{1a}+q_{1b}\\ + &=q_2\\ + &=\sum_{i=1}^{nlevsoi}{q_{3,i}} + \end{aligned} + +The demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy equations in (11.21). + +.. math:: + :label: 11.21) + + ff + + + +Yo + + + + + From a6688bd5ff15bf17801cca034cd4b0ad57e52af6 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 31 May 2017 11:20:53 -0600 Subject: [PATCH 031/730] update Fluxes chapter --- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 555 +++++++++--------- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 2 +- .../tech_note/Urban/CLM50_Tech_Note_Urban.rst | 2 +- 3 files changed, 282 insertions(+), 277 deletions(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 0d8d213cb4..0ffe6e43f3 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -45,12 +45,12 @@ momentum between the atmosphere at height :math:`z_{atm,\, m}` and the surface at height :math:`z_{0m} +d`. Thus, the momentum fluxes become .. math:: - :label: + :label: 5.5 \tau _{x} =-\rho _{atm} \frac{u_{atm} }{r_{am} } .. math:: - :label: + :label: 5.6 \tau _{y} =-\rho _{atm} \frac{v_{atm} }{r_{am} } . @@ -76,7 +76,7 @@ where :math:`T_{atm}` is the air temperature (K) at height m\ :sup:`-1` is the negative of the dry adiabatic lapse rate [this expression is first-order equivalent to :math:`\theta _{atm} =T_{atm} \left({P_{srf} \mathord{\left/ {\vphantom {P_{srf} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } \right)^{{R_{da} \mathord{\left/ {\vphantom {R_{da} C_{p} }} \right. \kern-\nulldelimiterspace} C_{p} } }` -(Stull 1988), where :math:`P_{srf}` is the surface pressure (Pa), +(:ref:`Stull 1988 `), where :math:`P_{srf}` is the surface pressure (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`R_{da}` is the gas constant for dry air (J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical constants`)]. By definition, :math:`\theta _{s} =T_{s}` . The density of moist air (kg m\ :sup:`-3`) is @@ -109,7 +109,7 @@ from Monin-Obukhov similarity applied to the surface layer. This theory states that when scaled appropriately, the dimensionless mean horizontal wind speed, mean potential temperature, and mean specific humidity profile gradients depend on unique functions of -:math:`\zeta =\frac{z-d}{L}` (Zeng et al. 1998) as +:math:`\zeta =\frac{z-d}{L}` (:ref:`Zeng et al. 1998`) as .. math:: :label: 5.10 @@ -162,8 +162,7 @@ components :math:`\overline{u'w'}=-\frac{\tau _{x} }{\rho _{atm} }` and :math:`H` is the sensible heat flux (W m\ :sup:`-2`) and :math:`E` is the water vapor flux (kg m\ :sup:`-2` s\ :sup:`-1`). -The dimensionless length scale :math:`L` is the Monin-Obukhov length -defined as +The length scale :math:`L` is the Monin-Obukhov length defined as .. math:: :label: 5.16 @@ -179,7 +178,7 @@ stable conditions. :math:`L<0` indicates unstable conditions. :math:`\theta _{v*}` is defined as .. math:: - :label: ZEqnNum632600 + :label: 5.17 \theta _{v*} u_{*} =\left[\theta _{*} \left(1+0.61q_{atm} \right)+0.61\overline{\theta _{atm} }q_{*} \right]u_{*} @@ -246,7 +245,7 @@ Defining the surface values and the atmospheric values at :math:`z_{2} =z_{atm,\, x}` .. math:: - :label: ZEqnNum228149 + :label: 5.24 \left|{\it u}\right|_{2} =V_{a} {\rm =\; }\sqrt{u_{atm}^{2} +v_{atm}^{2} +U_{c}^{2} } \ge 1, @@ -280,15 +279,18 @@ surface fluxes as follows .. math:: :label: 5.28 - {U_{c} = 0\ \qquad \zeta \ge {\rm 0} {\rm (stable)}} \\ - {U_{c} = \beta w_{\*} \qquad \zeta <0 {\rm (unstable})} + U_{c} = \left\{ + \begin{array}{ll} + 0 & \qquad \zeta \ge {\rm 0} \quad {\rm (stable)} \\ + \beta w_{*} & \qquad \zeta < 0 \quad {\rm (unstable)} + \end{array} \right\} -where :math:`w_{\*}` is the convective velocity scale +where :math:`w_{*}` is the convective velocity scale .. math:: :label: 5.29 - w_{\*} =\left(\frac{-gu_{\*} \theta _{v*} z_{i} }{\overline{\theta _{v,\, atm} }} \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } , + w_{*} =\left(\frac{-gu_{\*} \theta _{v*} z_{i} }{\overline{\theta _{v,\, atm} }} \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } , :math:`z_{i} =1000` is the convective boundary layer height (m), and :math:`\beta =1`. @@ -297,14 +299,24 @@ The momentum flux gradient relations are (:ref:`Zeng et al. 1998 ` .. math:: :label: 5.30 - \begin{array}{l} {\phi _{m} \left(\zeta \right)=0.7k^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \qquad {\rm for\; }\zeta <-1.574{\rm \; (very\; unstable)}} \\ {\phi _{m} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } \qquad {\rm for\; -1.574}\le \zeta <0{\rm \; (unstable)}} \\ {\phi _{m} \left(\zeta \right)=1+5\zeta \qquad {\rm for\; }0\le \zeta \le 1{\rm \; (stable)}} \\ {\phi _{m} \left(\zeta \right)=5+\zeta \qquad {\rm for\; }\zeta {\rm >1\; (very\; stable).}} \end{array} + \begin{array}{llr} + \phi _{m} \left(\zeta \right)=0.7k^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } & \qquad {\rm for\; }\zeta <-1.574 & \ {\rm \; (very\; unstable)} \\ + \phi _{m} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 4}} \right. \kern-\nulldelimiterspace} 4} } & \qquad {\rm for\; -1.574}\le \zeta <0 & \ {\rm \; (unstable)} \\ + \phi _{m} \left(\zeta \right)=1+5\zeta & \qquad {\rm for\; }0\le \zeta \le 1& \ {\rm \; (stable)} \\ + \phi _{m} \left(\zeta \right)=5+\zeta & \qquad {\rm for\; }\zeta >1 & \ {\rm\; (very\; stable).} + \end{array} The sensible and latent heat flux gradient relations are (:ref:`Zeng et al. 1998 `) .. math:: :label: 5.31 - \begin{array}{l} {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=0.9k^{{4\mathord{\left/ {\vphantom {4 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \qquad {\rm for\; }\zeta <-0.465{\rm \; (very\; unstable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 2}} \right. \kern-\nulldelimiterspace} 2} } \qquad {\rm for\; -0.465}\le \zeta <0{\rm \; (unstable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=1+5\zeta \qquad {\rm for\; }0\le \zeta \le 1{\rm \; (stable)}} \\ {\phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=5+\zeta \qquad {\rm for\; }\zeta {\rm >1\; (very\; stable).}} \end{array} + \begin{array}{llr} + \phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=0.9k^{{4\mathord{\left/ {\vphantom {4 3}} \right. \kern-\nulldelimiterspace} 3} } \left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } & \qquad {\rm for\; }\zeta <-0.465 & \ {\rm \; (very\; unstable)} \\ + \phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=\left(1-16\zeta \right)^{-{1\mathord{\left/ {\vphantom {1 2}} \right. \kern-\nulldelimiterspace} 2} } & \qquad {\rm for\; -0.465}\le \zeta <0 & \ {\rm \; (unstable)} \\ + \phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=1+5\zeta & \qquad {\rm for\; }0\le \zeta \le 1 & \ {\rm \; (stable)} \\ + \phi _{h} \left(\zeta \right)=\phi _{w} \left(\zeta \right)=5+\zeta & \qquad {\rm for\; }\zeta >1 & \ {\rm \; (very\; stable).} + \end{array} To ensure continuous functions of :math:`\phi _{m} \left(\zeta \right)`, @@ -321,28 +333,28 @@ yield wind profiles for the following conditions: Very unstable :math:`\left(\zeta <-1.574\right)` .. math:: - :label: ZEqnNum566843 + :label: 5.32 V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{\zeta _{m} L}{z_{0m} } -\psi _{m} \left(\zeta _{m} \right)\right]+1.14\left[\left(-\zeta \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta _{m} \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right\} Unstable :math:`\left(-1.574\le \zeta <0\right)` .. math:: - :label: ZEqnNum309568 + :label: 5.33 V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, m} -d}{z_{0m} } -\psi _{m} \left(\zeta \right)\right]+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right\} Stable :math:`\left(0\le \zeta \le 1\right)` .. math:: - :label: ZEqnNum973766 + :label: 5.34 V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, m} -d}{z_{0m} } +5\zeta \right]-5\frac{z_{0m} }{L} \right\} Very stable :math:`\left(\zeta >1\right)` .. math:: - :label: ZEqnNum310559 + :label: 5.35 V_{a} =\frac{u_{*} }{k} \left\{\left[\ln \frac{L}{z_{0m} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0m} }{L} \right\} @@ -362,14 +374,14 @@ The potential temperature profiles are: Very unstable :math:`\left(\zeta <-0.465\right)` .. math:: - :label: ZEqnNum382106 + :label: 5.37 \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{\zeta _{h} L}{z_{0h} } -\psi _{h} \left(\zeta _{h} \right)\right]+0.8\left[\left(-\zeta _{h} \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right\} Unstable :math:`\left(-0.465\le \zeta <0\right)` .. math:: - :label: ZEqnNum767002 + :label: 5.38 \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{z_{atm,\, h} -d}{z_{0h} } -\psi _{h} \left(\zeta \right)\right]+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right\} @@ -377,14 +389,14 @@ Unstable :math:`\left(-0.465\le \zeta <0\right)` Stable :math:`\left(0\le \zeta \le 1\right)` .. math:: - :label: ZEqnNum556410 + :label: 5.39 \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{z_{atm,\, h} -d}{z_{0h} } +5\zeta \right]-5\frac{z_{0h} }{L} \right\} Very stable :math:`\left(\zeta >1\right)` .. math:: - :label: ZEqnNum846197 + :label: 5.40 \theta _{atm} -\theta _{s} =\frac{\theta _{*} }{k} \left\{\left[\ln \frac{L}{z_{0h} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0h} }{L} \right\}. @@ -393,28 +405,28 @@ The specific humidity profiles are: Very unstable :math:`\left(\zeta <-0.465\right)` .. math:: - :label: ZEqnNum299834 + :label: 5.41 q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{\zeta _{w} L}{z_{0w} } -\psi _{w} \left(\zeta _{w} \right)\right]+0.8\left[\left(-\zeta _{w} \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } -\left(-\zeta \right)^{{-1\mathord{\left/ {\vphantom {-1 3}} \right. \kern-\nulldelimiterspace} 3} } \right]+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right\} Unstable :math:`\left(-0.465\le \zeta <0\right)` .. math:: + :label: 5.42 - \label{ZEqnNum142122} q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, w} -d}{z_{0w} } -\psi _{w} \left(\zeta \right)\right]+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right\} Stable :math:`\left(0\le \zeta \le 1\right)` .. math:: - :label: ZEqnNum350694 + :label: 5.43 q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{z_{atm,\, w} -d}{z_{0w} } +5\zeta \right]-5\frac{z_{0w} }{L} \right\} Very stable :math:`\left(\zeta >1\right)` .. math:: - :label: ZEqnNum211437 + :label: 5.44 q_{atm} -q_{s} =\frac{q_{*} }{k} \left\{\left[\ln \frac{L}{z_{0w} } +5\right]+\left[5\ln \zeta +\zeta -1\right]-5\frac{z_{0w} }{L} \right\} @@ -434,7 +446,7 @@ using atmospheric and surface values for :math:`\left|{\it u}\right|`, bulk Richardson number .. math:: - :label: ZEqnNum750428} + :label: 5.46 R_{iB} =\frac{\theta _{v,\, atm} -\theta _{v,\, s} }{\overline{\theta _{v,\, atm} }} \frac{g\left(z_{atm,\, m} -d\right)}{V_{a}^{2} } @@ -455,27 +467,35 @@ stable conditions to determine :math:`\psi _{m} \left(\zeta \right)` and guess for :math:`\zeta` and thus :math:`L` from .. math:: + :label: 5.48 - \label{ZEqnNum979946} - \begin{array}{l} {\zeta =\frac{R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)}{1-5\min \left(R_{iB} ,0.19\right)} \qquad 0.01\le \zeta \le 2\qquad {\rm for\; }R_{iB} \ge 0{\rm \; (neutral\; or\; stable)}} \\ {\zeta =R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)\qquad -100\le \zeta \le -0.01\qquad {\rm for\; }R_{iB} <0{\rm \; (unstable)}} \end{array}. + \begin{array}{lcr} + \zeta =\frac{R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)}{1-5\min \left(R_{iB} ,0.19\right)} & \qquad 0.01\le \zeta \le 2 & \qquad {\rm for\; }R_{iB} \ge 0 {\rm \; (neutral\; or\; stable)} \\ + \zeta =R_{iB} \ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right) & \qquad -100\le \zeta \le -0.01 & \qquad {\rm for\; }R_{iB} <0 \ {\rm \; (unstable)} + \end{array}. Upon iteration (section :numref:`Numerical Implementation`), the following is used to determine :math:`\zeta` and thus :math:`L` .. math:: + :label: 5.49 - \label{ZEqnNum153243} \zeta =\frac{\left(z_{atm,\, m} -d\right)kg\theta _{v*} }{u_{*}^{2} \overline{\theta _{v,\, atm} }} where -.. math:: \begin{array}{l} {0.01\le \zeta \le 2\qquad {\rm for\; }\zeta \ge 0{\rm \; (neutral\; or\; stable)}} \\ {{\rm -100}\le \zeta \le {\rm -0.01}\qquad {\rm for\; }\zeta <0{\rm \; (unstable)}} \end{array}. +.. math:: + + \begin{array}{cr} + 0.01\le \zeta \le 2 & \qquad {\rm for\; }\zeta \ge 0{\rm \; (neutral\; or\; stable)} \\ + {\rm -100}\le \zeta \le {\rm -0.01} & \qquad {\rm for\; }\zeta <0{\rm \; (unstable)} + \end{array}. The difference in virtual potential air temperature between the reference height and the surface is .. math:: - :label: ZEqnNum516498 + :label: 5.50 \theta _{v,\, atm} -\theta _{v,\, s} =\left(\theta _{atm} -\theta _{s} \right)\left(1+0.61q_{atm} \right)+0.61\overline{\theta _{atm} }\left(q_{atm} -q_{s} \right). @@ -483,39 +503,39 @@ The momentum, sensible heat, and water vapor fluxes between the surface and the atmosphere can also be written in the form .. math:: - :label: ZEqnNum567382 + :label: 5.51 \tau _{x} =-\rho _{atm} \frac{\left(u_{atm} -u_{s} \right)}{r_{am} } .. math:: - :label: ZEqnNum615113 + :label: 5.52 \tau _{y} =-\rho _{atm} \frac{\left(v_{atm} -v_{s} \right)}{r_{am} } .. math:: - :label: ZEqnNum588623 + :label: 5.53 H=-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -\theta _{s} \right)}{r_{ah} } .. math:: - :label: ZEqnNum154565 + :label: 5.54 E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } where the aerodynamic resistances (s m\ :sup:`-1`) are .. math:: - :label: ZEqnNum660763 + :label: 5.55 r_{am} =\frac{V_{a} }{u_{*}^{2} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]^{2} .. math:: - :label: ZEqnNum193138 + :label: 5.56 \begin{array}{l} {r_{ah} =\frac{\theta _{atm} -\theta _{s} }{\theta _{*} u_{*} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]} \\ {\qquad \left[\ln \left(\frac{z_{atm,\, h} -d}{z_{0h} } \right)-\psi _{h} \left(\frac{z_{atm,\, h} -d}{L} \right)+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right]} \end{array} .. math:: - :label: ZEqnNum382229 + :label: 5.57 \begin{array}{l} {r_{aw} =\frac{q_{atm} -q_{s} }{q_{*} u_{*} } =\frac{1}{k^{2} V_{a} } \left[\ln \left(\frac{z_{atm,\, m} -d}{z_{0m} } \right)-\psi _{m} \left(\frac{z_{atm,\, m} -d}{L} \right)+\psi _{m} \left(\frac{z_{0m} }{L} \right)\right]} \\ {\qquad \left[\ln \left(\frac{z_{atm,\, {\it w}} -d}{z_{0w} } \right)-\psi _{w} \left(\frac{z_{atm,\, w} -d}{L} \right)+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right]} \end{array}. @@ -523,7 +543,7 @@ A 2-m height “screen†temperature is useful for comparison with observations .. math:: - :label: ZEqnNum664652 + :label: 5.58 T_{2m} =\theta _{s} +\frac{\theta _{*} }{k} \left[\ln \left(\frac{2+z_{0h} }{z_{0h} } \right)-\psi _{h} \left(\frac{2+z_{0h} }{L} \right)+\psi _{h} \left(\frac{z_{0h} }{L} \right)\right] @@ -532,14 +552,14 @@ for sensible heat (:math:`z_{0h} +d`). Similarly, a 2-m height specific humidity is defined as .. math:: - :label: ZEqnNum735237 + :label: 5.59 q_{2m} =q_{s} +\frac{q_{*} }{k} \left[\ln \left(\frac{2+z_{0w} }{z_{0w} } \right)-\psi _{w} \left(\frac{2+z_{0w} }{L} \right)+\psi _{w} \left(\frac{z_{0w} }{L} \right)\right]. Relative humidity is .. math:: - :label: ZEqnNum299365 + :label: 5.60 RH_{2m} =\min \left(100,\, \frac{q_{2m} }{q_{sat}^{T_{2m} } } \times 100\right) @@ -570,7 +590,7 @@ water covered, so that the sensible heat flux :math:`H_{g}` (W m\ :sup:`-2`) is, with reference to :numref:`Figure Schematic diagram of sensible heat fluxes`, .. math:: - :label: ZEqnNum726771 + :label: 5.62 H_{g} =\left(1-f_{sno} -f_{h2osfc} \right)H_{soil} +f_{sno} H_{snow} +f_{h2osfc} H_{h2osfc} @@ -605,7 +625,7 @@ The water vapor flux :math:`E_{g}` (kg m\ :sup:`-2` s\ :sup:`-1`) is, with refe :numref:`Figure Schematic diagram of latent heat fluxes`, .. math:: - :label: ZEqnNum419297 + :label: 5.66 E_{g} =\left(1-f_{sno} -f_{h2osfc} \right)E_{soil} +f_{sno} E_{snow} +f_{h2osfc} E_{h2osfc} @@ -631,12 +651,12 @@ resistance to water vapor transfer (s m\ :sup:`-1`). The specific humidities of :math:`q_{h2osfc}` are assumed to be at the saturation specific humidity of their respective temperatures .. math:: - :label: 5.70) + :label: 5.70 q_{sno} =q_{sat}^{T_{snl+1} } .. math:: - :label: 5.71) + :label: 5.71 q_{h2osfc} =q_{sat}^{T_{h2osfc} } @@ -644,17 +664,17 @@ The specific humidity of the soil surface :math:`q_{soil}` is assumed to be proportional to the saturation specific humidity .. math:: - :label: 5.72) + :label: 5.72 q_{soil} =\alpha _{soil} q_{sat}^{T_{1} } where :math:`q_{sat}^{T_{1} }` is the saturated specific humidity at the soil surface temperature :math:`T_{1}` (section :numref:`Saturation Vapor Pressure`). The factor :math:`\alpha _{soil}` is a function of the surface soil water matric -potential :math:`\psi` as in Philip (1957) +potential :math:`\psi` as in :ref:`Philip (1957)` .. math:: - :label: 5.73) + :label: 5.73 \alpha _{soil} =\exp \left(\frac{\psi _{1} g}{1\times 10^{3} R_{wv} T_{1} } \right) @@ -664,7 +684,7 @@ gravitational acceleration (m s\ :sup:`-2`) (:numref:`Table Physical constants`) layer (mm). The soil water matric potential :math:`\psi _{1}` is .. math:: - :label: 5.74) + :label: 5.74 \psi _{1} =\psi _{sat,\, 1} s_{1}^{-B_{1} } \ge -1\times 10^{8} @@ -676,7 +696,7 @@ and :math:`s_{1}` is the wetness of the top soil layer with respect to saturati The surface wetness :math:`s_{1}` is a function of the liquid water and ice content .. math:: - :label: 5.75) + :label: 5.75 s_{1} =\frac{1}{\Delta z_{1} \theta _{sat,\, 1} } \left[\frac{w_{liq,\, 1} }{\rho _{liq} } +\frac{w_{ice,\, 1} }{\rho _{ice} } \right]\qquad 0.01\le s_{1} \le 1.0 @@ -693,22 +713,22 @@ prevents large increases (decreases) in :math:`q_{soil}` for small increases (decreases) in soil moisture in very dry soils. The resistance to water vapor transfer occurring within the soil matrix -:math:`r_{soil}` is +:math:`r_{soil}` (s m\ :sup:`-1`) is .. math:: - :label: 5.76) + :label: 5.76 r_{soil} = \frac{DSL}{D_{v} \tau} -where :math:`DSL` is the thickness of the dry surface layer, :math:`D_{v}` -is the molecular diffusivity of water vapor in air and :math:`\tau` -describes the tortuosity of the vapor flow paths through +where :math:`DSL` is the thickness of the dry surface layer (m), :math:`D_{v}` +is the molecular diffusivity of water vapor in air (m\ :sup:`2` s\ :sup:`-2`) +and :math:`\tau` (*unitless*) describes the tortuosity of the vapor flow paths through the soil matrix (:ref:`Swenson and Lawrence 2014 `). The thickness of the dry surface layer is given by .. math:: - :label: 5.77) + :label: 5.77 DSL = \begin{array}{lr} @@ -719,44 +739,47 @@ The thickness of the dry surface layer is given by where :math:`D_{max}` is a parameter specifying the length scale of the maximum DSL thickness (default value = 15 mm), -:math:`\theta_{init}` is the moisture value at which the DSL initiates, -:math:`\theta_{1}` is the moisture value of the top model soil layer, -and :math:`\theta_{air}` is the 'air dry' soil moisture value -(:ref:`Dingman 2002 `): +:math:`\theta_{init}` (mm\ :sup:`3` mm\ :sup:`-3`) is the moisture value +at which the DSL initiates, :math:`\theta_{1}` (mm\ :sup:`3` mm\ :sup:`-3`) +is the moisture value of the top model soil layer, and +:math:`\theta_{air}` (mm\ :sup:`3` mm\ :sup:`-3`) is the 'air dry' soil +moisture value (:ref:`Dingman 2002 `): .. math:: - :label: 5.78) + :label: 5.78 \theta_{air} = \Phi \left( \frac{\Psi_{sat}}{\Psi_{air}} \right)^{\frac{1}{B_{1}}} \ . -where :math:`\Phi` is the porosity, :math:`\Psi_{sat}` is the saturated -soil matric potential, :math:`\Psi_{air} = 10^{7}` mm is the air dry -matric potential, and :math:`B_{1}` is a function of soil texture (section +where :math:`\Phi` is the porosity (mm\ :sup:`3` mm\ :sup:`-3`), +:math:`\Psi_{sat}` is the saturated soil matric potential (mm), +:math:`\Psi_{air} = 10^{7}` mm is the air dry matric potential, and +:math:`B_{1}` is a function of soil texture (section :numref:`Hydraulic Properties`). The soil tortuosity is .. math:: - :label: 5.79) + :label: 5.79 \tau = \Phi^{2}_{air}\left(\frac{\Phi_{air}}{\Phi}\right)^{\frac{3}{B_{1}}} -where :math:`\Phi_{air}` is the air filled pore space +where :math:`\Phi_{air}` (mm\ :sup:`3` mm\ :sup:`-3`) is the air filled pore space .. math:: - :label: 5.80) + :label: 5.80 \Phi_{air} = \Phi - \theta_{air} \ . :math:`D_{v}` depends on temperature .. math:: - :label: 5.81) + :label: 5.81 D_{v} = 2.12 \times 10^{-5} \left(\frac{T_{1}}{T_{f}}\right)^{1.75} \ . -where :math:`T_{1}` is the temperature of the top soil layer and -:math:`T_{f}` is the freezing temperature of water (:numref:`Table Physical Constants`). +where :math:`T_{1}` (K) is the temperature of the top soil layer and +:math:`T_{f}` (K) is the freezing temperature of water +(:numref:`Table Physical Constants`). The roughness lengths used to calculate :math:`r_{am}` , :math:`r_{ah}` , and :math:`r_{aw}` are :math:`z_{0m} =z_{0m,\, g}` , @@ -774,7 +797,7 @@ across the interfacial sublayer. The following relation from :ref:`Zeng and Dickinson 1998 ` .. math:: - :label: ZEqnNum844212 + :label: 5.82 z_{0h,\, g} =z_{0w,\, g} =z_{0m,\, g} e^{-a\left({u_{*} z_{0m,\, g} \mathord{\left/ {\vphantom {u_{*} z_{0m,\, g} \upsilon }} \right. \kern-\nulldelimiterspace} \upsilon } \right)^{0.45} } @@ -787,43 +810,43 @@ The numerical solution for the fluxes of momentum, sensible heat, and water vapor flux from non-vegetated surfaces proceeds as follows: #. An initial guess for the wind speed :math:`V_{a}` is obtained from - eq. assuming an initial convective velocity :math:`U_{c} =0` m + :eq:`5.24` assuming an initial convective velocity :math:`U_{c} =0` m s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from - eq. ) and :math:`U_{c} =0.5` for unstable conditions + :eq:`5.50` ) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). #. An initial guess for the Monin-Obukhov length :math:`L` is obtained - from the bulk Richardson number using eqs. and . + from the bulk Richardson number using :eq:`5.46` and :eq:`5.48`. #. The following system of equations is iterated three times: -#. Friction velocity :math:`u_{*}` (eqs. , , , ) +#. Friction velocity :math:`u_{*}` (:eq:`5.32`, :eq:`5.33`, :eq:`5.34`, :eq:`5.35`) -#. Potential temperature scale :math:`\theta _{*}` (eqs. , , , ) +#. Potential temperature scale :math:`\theta _{*}` (:eq:`5.37` , :eq:`5.38`, :eq:`5.39`, :eq:`5.40`) -#. Humidity scale :math:`q_{*}` (eqs. , , , ) +#. Humidity scale :math:`q_{*}` (:eq:`5.41`, :eq:`5.42`, :eq:`5.43`, :eq:`5.44`) #. Roughness lengths for sensible :math:`z_{0h,\, g}` and latent heat - :math:`z_{0w,\, g}` (eq. ) + :math:`z_{0w,\, g}` (:eq:`5.82` ) -#. Virtual potential temperature scale :math:`\theta _{v*}` (eq. ) +#. Virtual potential temperature scale :math:`\theta _{v*}` ( :eq:`5.17`) -#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) +#. Wind speed including the convective velocity, :math:`V_{a}` ( :eq:`5.24`) -#. Monin-Obukhov length :math:`L` (eq. ) +#. Monin-Obukhov length :math:`L` (:eq:`5.49`) #. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and - :math:`r_{aw}` (eqs. , , ) + :math:`r_{aw}` (:eq:`5.55`, :eq:`5.56`, :eq:`5.57`) -#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (eqs. , ) +#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (:eq:`5.5`, :eq:`5.6`) -#. Sensible heat flux :math:`H_{g}` (eq. ) +#. Sensible heat flux :math:`H_{g}` (:eq:`5.62`) -#. Water vapor flux :math:`E_{g}` (eq. ) +#. Water vapor flux :math:`E_{g}` (:eq:`5.66`) #. 2-m height air temperature :math:`T_{2m}` and specific humidity - :math:`q_{2m}` (eqs. , ) + :math:`q_{2m}` (:eq:`5.58` , :eq:`5.59`) The partial derivatives of the soil surface fluxes with respect to ground temperature, which are needed for the soil temperature calculations (section @@ -831,19 +854,19 @@ ground temperature, which are needed for the soil temperature calculations (sect (section :numref:`Update of Ground Sensible and Latent Heat Fluxes`), are .. math:: - :label: ZEqnNum806472 + :label: 5.83 \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r_{ah} } .. math:: - :label: ZEqnNum497230 + :label: 5.84 \frac{\partial E_{g} }{\partial T_{g} } =\frac{\beta _{soi} \rho _{atm} }{r_{aw} } \frac{dq_{g} }{dT_{g} } where .. math:: - :label: 5.82) + :label: 5.85 \frac{dq_{g} }{dT_{g} } =\left(1-f_{sno} -f_{h2osfc} \right)\alpha _{soil} \frac{dq_{sat}^{T_{soil} } }{dT_{soil} } +f_{sno} \frac{dq_{sat}^{T_{sno} } }{dT_{sno} } +f_{h2osfc} \frac{dq_{sat}^{T_{h2osfc} } }{dT_{h2osfc} } . @@ -883,39 +906,41 @@ at height :math:`z_{0h} +d` and the atmosphere at height from the vegetation :math:`H_{v}` and the ground :math:`H_{g}` .. math:: - :label: ZEqnNum550014 + :label: 5.86 H=H_{v} +H_{g} where, with reference to :numref:`Figure Schematic diagram of sensible heat fluxes`, .. math:: - :label: 5.84) + :label: 5.87 H=-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{s} \right)}{r_{ah} } .. math:: - :label: ZEqnNum675188 + :label: 5.88 H_{v} =-\rho _{atm} C_{p} \left(T_{s} -T_{v} \right)\frac{\left(L+S\right)}{r_{b} } .. math:: - :label: ZEqnNum293573 + :label: 5.89 - H_{g} =\left(1-f_{sno} -f_{h2osfc} \right)H_{soil} +f_{sno} H_{snow} +f_{h2osfc} H_{h2osfc} + H_{g} =\left(1-f_{sno} -f_{h2osfc} \right)H_{soil} +f_{sno} H_{snow} +f_{h2osfc} H_{h2osfc} \ , + +where .. math:: - :label: 5.87) + :label: 5.90 H_{soil} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{1} \right)}{r_{ah} ^{{'} } } .. math:: - :label: 5.88) + :label: 5.91 H_{sno} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{snl+1} \right)}{r_{ah} ^{{'} } } .. math:: - :label: 5.89) + :label: 5.92 H_{h2osfc} =-\rho _{atm} C_{p} \frac{\left(T_{s} -T_{h2osfc} \right)}{r_{ah} ^{{'} } } @@ -948,27 +973,28 @@ height :math:`z_{0h} ^{{'} }` and the canopy air at height Figure Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. -Equations - can be solved for the canopy air temperature :math:`T_{s}` +Equations :eq:`5.86` - :eq:`5.89` can be solved for the canopy air +temperature :math:`T_{s}` .. math:: - :label: ZEqnNum103571 + :label: 5.93 T_{s} =\frac{c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} +c_{v}^{h} T_{v} }{c_{a}^{h} +c_{g}^{h} +c_{v}^{h} } where .. math:: - :label: ZEqnNum298904 + :label: 5.94 c_{a}^{h} =\frac{1}{r_{ah} } .. math:: - :label: ZEqnNum991533 + :label: 5.95 c_{g}^{h} =\frac{1}{r_{ah} ^{{'} } } .. math:: - :label: ZEqnNum284616 + :label: 5.96 c_{v}^{h} =\frac{\left(L+S\right)}{r_{b} } @@ -976,22 +1002,22 @@ are the sensible heat conductances from the canopy air to the atmosphere, the ground to canopy air, and leaf surface to canopy air, respectively (m s\ :sup:`-1`). -When the expression for :math:`T_{s}` is substituted into equation :eq:`ZEqnNum675188`, +When the expression for :math:`T_{s}` is substituted into equation :eq:`5.88`, the sensible heat flux from vegetation :math:`H_{v}` is a function of :math:`\theta _{atm}` , :math:`T_{g}` , and :math:`T_{v}` .. math:: - :label: ZEqnNum362496 + :label: 5.97 - H_{v} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} -\left(c_{a}^{h} +c_{g}^{h} \right)T_{v} \right]\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . + H_{v} = -\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} -\left(c_{a}^{h} +c_{g}^{h} \right)T_{v} \right]\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . Similarly, the expression for :math:`T_{s}` can be substituted into equation to obtain the sensible heat flux from ground :math:`H_{g}` .. math:: - :label: ZEqnNum527667 + :label: 5.98 - H_{g} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{v}^{h} T_{v} -\left(c_{a}^{h} +c_{v}^{h} \right)T_{g} \right]\frac{c_{g}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . + H_{g} = -\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{v}^{h} T_{v} -\left(c_{a}^{h} +c_{v}^{h} \right)T_{g} \right]\frac{c_{g}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . The air within the canopy is assumed to have negligible capacity to store water vapor so that the water vapor flux :math:`E` between the @@ -1000,41 +1026,43 @@ surface at height :math:`z_{0w} +d` and the atmosphere at height flux from the vegetation :math:`E_{v}` and the ground :math:`E_{g}` .. math:: - :label: ZEqnNum365017 + :label: 5.99 - E=E_{v} +E_{g} + E = E_{v} +E_{g} where, with reference to :numref:`Figure Schematic diagram of latent heat fluxes`, .. math:: - :label: 5.97) + :label: 5.100 - E=-\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } + E = -\rho _{atm} \frac{\left(q_{atm} -q_{s} \right)}{r_{aw} } .. math:: - :label: ZEqnNum351492 + :label: 5.101 - E_{v} =-\rho _{atm} \frac{\left(q_{s} -q_{sat}^{T_{v} } \right)}{r_{total} } + E_{v} = -\rho _{atm} \frac{\left(q_{s} -q_{sat}^{T_{v} } \right)}{r_{total} } .. math:: - :label: ZEqnNum145330 + :label: 5.102 - E_{g} =\left(1-f_{sno} -f_{h2osfc} \right)E_{soil} +f_{sno} E_{snow} +f_{h2osfc} E_{h2osfc} + E_{g} = \left(1-f_{sno} -f_{h2osfc} \right)E_{soil} +f_{sno} E_{snow} +f_{h2osfc} E_{h2osfc} \ , + +where .. math:: - :label: 5.100) + :label: 5.103 - E_{soil} =-\rho _{atm} \frac{\beta _{soi} \left(q_{s} -q_{soil} \right)}{r_{aw} ^{{'} } +r_{litter} } + E_{soil} = -\rho _{atm} \frac{\beta _{soi} \left(q_{s} -q_{soil} \right)}{r_{aw} ^{{'} } +r_{soil} } .. math:: - :label: 5.101) + :label: 5.104 - E_{sno} =-\rho _{atm} \frac{\left(q_{s} -q_{sno} \right)}{r_{aw} ^{{'} } +r_{litter} } + E_{sno} = -\rho _{atm} \frac{\left(q_{s} -q_{sno} \right)}{r_{aw} ^{{'} } +r_{soil} } .. math:: - :label: 5.102) + :label: 5.105 - E_{h2osfc} =-\rho _{atm} \frac{\left(q_{s} -q_{h2osfc} \right)}{r_{aw} ^{{'} } +r_{litter} } + E_{h2osfc} = -\rho _{atm} \frac{\left(q_{s} -q_{h2osfc} \right)}{r_{aw} ^{{'} } +r_{soil} } where :math:`q_{atm}` is the atmospheric specific humidity (kg kg\ :sup:`-1`), :math:`r_{aw}` is the aerodynamic resistance to water vapor transfer (s m\ :sup:`-1`), :math:`q_{sat}^{T_{v} }` @@ -1047,7 +1075,7 @@ m\ :sup:`-1`) to water vapor transfer between the ground at height :math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, :math:`\beta _{soi}` is an empirical function of soil water (section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), -and :math:`r_{litter}` is a resistance for the plant litter layer +and :math:`r_{soil}` (:eq:`5.76`) is a resistance to diffusion through the soil (s m\ :sup:`-1`). :math:`r_{total}` is the total resistance to water vapor transfer from the canopy to the canopy air and includes contributions from leaf boundary layer and sunlit and shaded stomatal @@ -1059,34 +1087,34 @@ is the sum of water vapor flux from wetted leaf and stem area transpiration from dry leaf surfaces :math:`E_{v}^{t}` .. math:: - :label: 5.103) + :label: 5.106 E_{v} =E_{v}^{w} +E_{v}^{t} . -Equations - can be solved for the canopy specific humidity +Equations :eq:`5.99` - :eq:`5.102` can be solved for the canopy specific humidity :math:`q_{s}` .. math:: - :label: ZEqnNum362168 + :label: 5.107 q_{s} =\frac{c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} +c_{v}^{w} q_{sat}^{T_{v} } }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } where .. math:: - :label: ZEqnNum533553 + :label: 5.108 c_{a}^{w} =\frac{1}{r_{aw} } .. math:: - :label: ZEqnNum544982 + :label: 5.109 c_{v}^{w} =\frac{\left(L+S\right)}{r_{b} } r'' .. math:: - :label: ZEqnNum888691 + :label: 5.110 - c_{g}^{w} =\frac{\beta _{soi} }{r_{aw} ^{{'} } +r_{litter} } + c_{g}^{w} =\frac{1}{r_{aw} ^{{'} } +r_{soil} } are the water vapor conductances from the canopy air to the atmosphere, the leaf to canopy air, and ground to canopy air, respectively. The term @@ -1095,9 +1123,14 @@ transpiration and limited by available water and potential evaporation as .. math:: - :label: ZEqnNum166006 + :label: 5.111 - r''=\left\{\begin{array}{l} {\min \left(f_{wet} +r_{dry} ^{{'} {'} } ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} >0} \\ {\min \left(f_{wet} ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right)\qquad E_{v}^{w,\, pot} >0,\, \beta _{t} \le 0} \\ {1\qquad E_{v}^{w,\, pot} \le 0} \end{array}\right\} + r'' = \left\{ + \begin{array}{lr} + \min \left(f_{wet} +r_{dry} ^{{'} {'} } ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right) & \qquad E_{v}^{w,\, pot} >0,\, \beta _{t} >0 \\ + \min \left(f_{wet} ,\, \frac{E_{v}^{w,\, pot} r_{dry} ^{{'} {'} } +\frac{W_{can} }{\Delta t} }{E_{v}^{w,\, pot} } \right) & \qquad E_{v}^{w,\, pot} >0,\, \beta _{t} \le 0 \\ + 1 & \qquad E_{v}^{w,\, pot} \le 0 + \end{array}\right\} where :math:`f_{wet}` is the fraction of leaves and stems that are wet (section :numref:`Canopy Water`), :math:`W_{can}` is canopy water (kg m\ :sup:`-2`) @@ -1107,14 +1140,14 @@ where :math:`f_{wet}` is the fraction of leaves and stems that are wet evaporation from wet foliage per unit wetted area is .. math:: - :label: 5.109) + :label: 5.112 E_{v}^{w,\, pot} =-\frac{\rho _{atm} \left(q_{s} -q_{sat}^{T_{v} } \right)}{r_{b} } . The term :math:`r_{dry} ^{{'} {'} }` is .. math:: - :label: 5.110) + :label: 5.113 r_{dry} ^{{'} {'} } =\frac{f_{dry} r_{b} }{L} \left(\frac{L^{sun} }{r_{b} +r_{s}^{sun} } +\frac{L^{sha} }{r_{b} +r_{s}^{sha} } \right) @@ -1124,21 +1157,21 @@ leaf area indices (section :numref:`Solar Fluxes`), and :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}` are the sunlit and shaded stomatal resistances (s m\ :sup:`-1`) (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). -When the expression for :math:`q_{s}` is substituted into equation , +When the expression for :math:`q_{s}` is substituted into equation :eq:`5.101`, the water vapor flux from vegetation :math:`E_{v}` is a function of :math:`q_{atm}` , :math:`q_{g}` , and :math:`q_{sat}^{T_{v} }` .. math:: - :label: ZEqnNum256012 + :label: 5.114 E_{v} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)q_{sat}^{T_{v} } \right]\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } . Similarly, the expression for :math:`q_{s}` can be substituted into -equation to obtain the water vapor flux from the ground beneath the +:eq:`5.84` to obtain the water vapor flux from the ground beneath the canopy :math:`E_{g}` .. math:: - :label: ZEqnNum243941 + :label: 5.115 E_{g} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{v}^{w} q_{sat}^{T_{v} } -\left(c_{a}^{w} +c_{v}^{w} \right)q_{g} \right]\frac{c_{g}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } . @@ -1147,14 +1180,14 @@ ground at height :math:`z_{0h} ^{{'} }` (:math:`z_{0w} ^{{'} }` ) and the canopy air at height :math:`z_{0h} +d` (:math:`z_{0w} +d`) are .. math:: - :label: ZEqnNum496775 + :label: 5.116 r_{ah} ^{{'} } =r_{aw} ^{{'} } =\frac{1}{C_{s} U_{av} } where .. math:: - :label: ZEqnNum781547 + :label: 5.117 U_{av} =V_{a} \sqrt{\frac{1}{r_{am} V_{a} } } =u_{*} @@ -1162,80 +1195,43 @@ is the magnitude of the wind velocity incident on the leaves (equivalent here to friction velocity) (m s\ :sup:`-1`) and :math:`C_{s}` is the turbulent transfer coefficient between the underlying soil and the canopy air. :math:`C_{s}` is obtained by -interpolation between values for dense canopy and bare soil (:ref:`Zeng et al. 2005 `) +interpolation between values for dense canopy and bare soil +(:ref:`Zeng et al. 2005 `) .. math:: - :label: 5.115) + :label: 5.118 C_{s} =C_{s,\, bare} W+C_{s,\, dense} (1-W) where the weight :math:`W` is .. math:: - :label: 5.116) + :label: 5.119 W=e^{-\left(L+S\right)} . -The dense canopy turbulent transfer coefficient in :ref:`Zeng et al. (2005) ` -is modified from its original value of 0.004 (:ref:`Dickinson et al. 1993 `) by -Sakaguchi and Zeng (2009) to account for stability as +The dense canopy turbulent transfer coefficient +(:ref:`Dickinson et al. 1993 `) is .. math:: - :label: 5.117) - - C_{s,\, dense} =\left\{\begin{array}{l} {0.004\qquad T_{s} -T_{g} \le 0} \\ {\frac{0.004}{1+\gamma \min \left(S,10\right)} \qquad T_{s} -T_{g} >0} \end{array}\right\} - -where :math:`\gamma =0.5` and :math:`S` is a stability parameter -determined from - -.. math:: - :label: 5.118) + :label: 5.120) - S=\frac{gz_{top} \left(T_{s} -T_{g} \right)}{T_{s} u_{*}^{2} } + C_{s,\, dense} =0.004 \ . -where :math:`g` is the gravitational acceleration (m -s\ :sup:`-2`) (:numref:`Table Physical constants`), and :math:`z_{top}` is canopy top -height (m) (:numref:`Table Prescribed plant functional type heights`). The bare soil turbulent transfer coefficient is +The bare soil turbulent transfer coefficient is .. math:: - :label: 5.119) + :label: 5.121 C_{s,\, bare} =\frac{k}{a} \left(\frac{z_{0m,\, g} U_{av} }{\upsilon } \right)^{-0.45} where the kinematic viscosity of air -:math:`\upsilon =1.5\times 10^{-5}` m\ :sup:`2` -s\ :sup:`-1` and :math:`a=0.13`. - -The litter resistance :math:`r_{litter}` (Sakaguchi and Zeng 2009) (s -m\ :sup:`-1`) is - -.. math:: - :label: 5.120) - - r_{litter} =\frac{1}{0.004u_{*} } \left(1-e^{-L_{litter}^{eff} } \right) - -where the effective litter area index :math:`L_{litter}^{eff}` (m\ :sup:`2` m\ :sup:`-2`) is the fraction of plant litter -area index :math:`L_{litter}` (currently set to 0.5 m\ :sup:`2` m\ :sup:`-2`) that is not covered by snow - -.. math:: - :label: 5.121) - - L_{litter}^{eff} =L_{litter} \left[1-\min \left(f_{litter}^{snow} ,\, 1\right)\right]. - -The effective snow cover of the litter layer is - -.. math:: - :label: 5.122) - - f_{litter}^{snow} =\frac{z_{sno} }{\Delta z_{litter} } - -where :math:`\Delta z_{litter} =0.05`\ m is assumed as a typical depth -for the litter layer, and :math:`z_{sno}` is the depth of snow (Chapter :numref:`rst_Snow Hydrology`) (m). +:math:`\upsilon =1.5\times 10^{-5}` m\ :sup:`2` s\ :sup:`-1` and :math:`a=0.13`. The leaf boundary layer resistance :math:`r_{b}` is .. math:: - :label: ZEqnNum181758 + :label: 5.122 r_{b} =\frac{1}{C_{v} } \left({U_{av} \mathord{\left/ {\vphantom {U_{av} d_{leaf} }} \right. \kern-\nulldelimiterspace} d_{leaf} } \right)^{{-1\mathord{\left/ {\vphantom {-1 2}} \right. \kern-\nulldelimiterspace} 2} } @@ -1246,16 +1242,17 @@ direction of wind flow (:numref:`Table Coefficients for saturation vapor pressur The partial derivatives of the fluxes from the soil beneath the canopy with respect to ground temperature, which are needed for the soil -temperature calculations (section :numref:`Numerical Solution Temperature`) and to update the soil surface -fluxes (section :numref:`Update of Ground Sensible and Latent Heat Fluxes`), are +temperature calculations (section :numref:`Numerical Solution Temperature`) +and to update the soil surface fluxes (section +:numref:`Update of Ground Sensible and Latent Heat Fluxes`), are .. math:: - :label: ZEqnNum774729 + :label: 5.123 \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r'_{ah} } \frac{c_{a}^{h} +c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } .. math:: - :label: ZEqnNum562232 + :label: 5.124 \frac{\partial E_{g} }{\partial T_{g} } =\frac{\beta _{soi} \rho _{atm} }{r'_{aw} +r_{litter} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . @@ -1267,35 +1264,38 @@ determined analytically, are ignored for :math:`\frac{\partial E_{g} }{\partial T_{g} }` . The roughness lengths used to calculate :math:`r_{am}` , -:math:`r_{ah}` , and :math:`r_{aw}` from equations , , and are +:math:`r_{ah}` , and :math:`r_{aw}` from :eq:`5.55`, :eq:`5.56`, and :eq:`5.57` are :math:`z_{0m} =z_{0m,\, v}` , :math:`z_{0h} =z_{0h,\, v}` , and :math:`z_{0w} =z_{0w,\, v}` . The vegetation displacement height :math:`d` and the roughness lengths are a function of plant height and adjusted for canopy density following :ref:`Zeng and Wang (2007) ` .. math:: - :label: 5.126) + :label: 5.125 - z_{0m,\, v} =z_{0h,\, v} =z_{0w,\, v} =\exp \left[V\ln \left(z_{top} R_{z0m} \right)+\left(1-V\right)\ln \left(z_{0m,\, g} \right)\right] + z_{0m,\, v} = z_{0h,\, v} =z_{0w,\, v} =\exp \left[V\ln \left(z_{top} R_{z0m} \right)+\left(1-V\right)\ln \left(z_{0m,\, g} \right)\right] .. math:: - :label: 5.127) + :label: 5.126 - d=z_{top} R_{d} V + d = z_{top} R_{d} V -where :math:`z_{top}` is canopy top height (m) (:numref:`Table Prescribed plant functional type heights`), +where :math:`z_{top}` is canopy top height (m) +(:numref:`Table Prescribed plant functional type heights`), :math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness length and displacement height to canopy top height, respectively -(:numref:`Table Plant functional type aerodynamic parameters`), and -:math:`z_{0m,\, g}` is the ground momentum roughness length -(m) (section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`). The fractional weight :math:`V` is determined from +(:numref:`Table Plant functional type aerodynamic parameters`), and :math:`z_{0m,\, g}` +is the ground momentum roughness length (m) (section +:numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`). The +fractional weight :math:`V` is determined from .. math:: - :label: 5.128) + :label: 5.127 - V=\frac{1-\exp \left\{-\beta \min \left[L+S,\, \left(L+S\right)_{cr} \right]\right\}}{1-\exp \left[-\beta \left(L+S\right)_{cr} \right]} + V = \frac{1-\exp \left\{-\beta \min \left[L+S,\, \left(L+S\right)_{cr} \right]\right\}}{1-\exp \left[-\beta \left(L+S\right)_{cr} \right]} -where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} =2` (m\ :sup:`2` m\ :sup:`-2`) is a critical value of exposed leaf +where :math:`\beta =1` and :math:`\left(L+S\right)_{cr} = 2` +(m\ :sup:`2` m\ :sup:`-2`) is a critical value of exposed leaf plus stem area for which :math:`z_{0m}` reaches its maximum. .. _Table Plant functional type aerodynamic parameters: @@ -1362,7 +1362,7 @@ Numerical Implementation Canopy energy conservation gives .. math:: - :label: 5.129) + :label: 5.128 -\overrightarrow{S}_{v} +\overrightarrow{L}_{v} \left(T_{v} \right)+H_{v} \left(T_{v} \right)+\lambda E_{v} \left(T_{v} \right)=0 @@ -1381,7 +1381,7 @@ non-linear systems of equations can be applied to iteratively solve for :math:`T_{v}` as .. math:: - :label: ZEqnNum247755 + :label: 5.129 \Delta T_{v} =\frac{\overrightarrow{S}_{v} -\overrightarrow{L}_{v} -H_{v} -\lambda E_{v} }{\frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } +\frac{\partial H_{v} }{\partial T_{v} } +\frac{\partial \lambda E_{v} }{\partial T_{v} } } @@ -1391,17 +1391,17 @@ where :math:`\Delta T_{v} =T_{v}^{n+1} -T_{v}^{n}` and the subscript The partial derivatives are .. math:: - :label: 5.131) + :label: 5.130 \frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } =4\varepsilon _{v} \sigma \left[2-\varepsilon _{v} \left(1-\varepsilon _{g} \right)\right]T_{v}^{3} .. math:: - :label: 5.132) + :label: 5.131 \frac{\partial H_{v} }{\partial T_{v} } =\rho _{atm} C_{p} \left(c_{a}^{h} +c_{g}^{h} \right)\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } .. math:: - :label: 5.133) + :label: 5.132 \frac{\partial \lambda E_{v} }{\partial T_{v} } =\lambda \rho _{atm} \left(c_{a}^{w} +c_{g}^{w} \right)\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{sat}^{T_{v} } }{dT_{v} } . @@ -1418,17 +1418,17 @@ between stable and unstable conditions. The total water vapor flux flux :math:`H_{v}` are updated for changes in leaf temperature as .. math:: - :label: ZEqnNum420059 + :label: 5.133 E_{v} =-\rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)\left(q_{sat}^{T_{v} } +\frac{dq_{sat}^{T_{v} } }{dT_{v} } \Delta T_{v} \right)\right]\frac{c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } .. math:: - :label: ZEqnNum554100 + :label: 5.134 E_{v}^{t} =-r_{dry} ^{{'} {'} } \rho _{atm} \left[c_{a}^{w} q_{atm} +c_{g}^{w} q_{g} -\left(c_{a}^{w} +c_{g}^{w} \right)\left(q_{sat}^{T_{v} } +\frac{dq_{sat}^{T_{v} } }{dT_{v} } \Delta T_{v} \right)\right]\frac{c_{v}^{h} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } .. math:: - :label: ZEqnNum839021 + :label: 5.135 H_{v} =-\rho _{atm} C_{p} \left[c_{a}^{h} \theta _{atm} +c_{g}^{h} T_{g} -\left(c_{a}^{h} +c_{g}^{h} \right)\left(T_{v} +\Delta T_{v} \right)\right]\frac{c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } . @@ -1440,57 +1440,57 @@ proceeds as follows: obtained from .. math:: - :label: 5.137) + :label: 5.136 T_{s} =\frac{T_{g} +\theta _{atm} }{2} .. math:: - :label: 5.138) + :label: 5.137 q_{s} =\frac{q_{g} +q_{atm} }{2} . #. An initial guess for the wind speed :math:`V_{a}` is obtained from - eq. assuming an initial convective velocity :math:`U_{c} =0` m + :eq:`5.24` assuming an initial convective velocity :math:`U_{c} =0` m s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` as evaluated from - eq. ) and :math:`U_{c} =0.5` for unstable conditions + :eq:`5.50` ) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). #. An initial guess for the Monin-Obukhov length :math:`L` is obtained - from the bulk Richardson number using equation and . + from the bulk Richardson number using equation and :eq:`5.46` and :eq:`5.48`. #. Iteration proceeds on the following system of equations: -#. Friction velocity :math:`u_{*}` (eqs. , , , ) +#. Friction velocity :math:`u_{*}` (:eq:`5.32`, :eq:`5.33`, :eq:`5.34`, :eq:`5.35`) -#. Ratio :math:`\frac{\theta _{*} }{\theta _{atm} -\theta _{s} }` (eqs. - , , , ) +#. Ratio :math:`\frac{\theta _{*} }{\theta _{atm} -\theta _{s} }` + (:eq:`5.37` , :eq:`5.38`, :eq:`5.39`, :eq:`5.40`) -#. Ratio :math:`\frac{q_{*} }{q_{atm} -q_{s} }` (eqs. , , , ) +#. Ratio :math:`\frac{q_{*} }{q_{atm} -q_{s} }` (:eq:`5.41`, :eq:`5.42`, :eq:`5.43`, :eq:`5.44`) #. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and - :math:`r_{aw}` (eqs. , , ) + :math:`r_{aw}` (:eq:`5.55`, :eq:`5.56`, :eq:`5.57`) #. Magnitude of the wind velocity incident on the leaves :math:`U_{av}` - (eq. ) + (:eq:`5.117` ) -#. Leaf boundary layer resistance :math:`r_{b}` (eq. ) +#. Leaf boundary layer resistance :math:`r_{b}` (:eq:`5.136` ) #. Aerodynamic resistances :math:`r_{ah} ^{{'} }` and - :math:`r_{aw} ^{{'} }` (eq. ) + :math:`r_{aw} ^{{'} }` (:eq:`5.116` ) #. Sunlit and shaded stomatal resistances :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) #. Sensible heat conductances :math:`c_{a}^{h}` , :math:`c_{g}^{h}` , - and :math:`c_{v}^{h}` (eqs. , , ) + and :math:`c_{v}^{h}` (:eq:`5.94`, :eq:`5.95`, :eq:`5.96`) #. Latent heat conductances :math:`c_{a}^{w}` , :math:`c_{v}^{w}` , and - :math:`c_{g}^{w}` (eqs. , , ) + :math:`c_{g}^{w}` (:eq:`5.108`, :eq:`5.109`, :eq:`5.110`) -#. Sensible heat flux from vegetation :math:`H_{v}` (eq. ) +#. Sensible heat flux from vegetation :math:`H_{v}` (:eq:`5.97` ) -#. Latent heat flux from vegetation :math:`\lambda E_{v}` (eq. ) +#. Latent heat flux from vegetation :math:`\lambda E_{v}` (:eq:`5.101` ) #. If the latent heat flux has changed sign from the latent heat flux computed at the previous iteration @@ -1500,23 +1500,23 @@ proceeds as follows: (:math:`\Delta _{1} =0.1\lambda E_{v} ^{n+1} -\lambda E_{v} ^{n+1}` ) is added to the sensible heat flux later. -#. Change in vegetation temperature :math:`\Delta T_{v}` (eq. ) and +#. Change in vegetation temperature :math:`\Delta T_{v}` (:eq:`5.129` ) and update the vegetation temperature as :math:`T_{v}^{n+1} =T_{v}^{n} +\Delta T_{v}` . :math:`T_{v}` is constrained to change by no more than 1ºK in one iteration. If this limit is exceeded, the energy error is .. math:: - :label: 5.139) + :label: 5.138 \Delta _{2} =\overrightarrow{S}_{v} -\overrightarrow{L}_{v} -\frac{\partial \overrightarrow{L}_{v} }{\partial T_{v} } \Delta T_{v} -H_{v} -\frac{\partial H_{v} }{\partial T_{v} } \Delta T_{v} -\lambda E_{v} -\frac{\partial \lambda E_{v} }{\partial T_{v} } \Delta T_{v} where :math:`\Delta T_{v} =1{\rm \; or\; }-1`. The error :math:`\Delta _{2}` is added to the sensible heat flux later. -#. Water vapor flux :math:`E_{v}` (eq. ) +#. Water vapor flux :math:`E_{v}` (:eq:`5.133` ) -#. Transpiration :math:`E_{v}^{t}` (eq. if :math:`\beta _{t} >0`, +#. Transpiration :math:`E_{v}^{t}` (:eq:`5.134` if :math:`\beta_{t} >0`, otherwise :math:`E_{v}^{t} =0`) #. The water vapor flux :math:`E_{v}` is constrained to be less than or @@ -1526,26 +1526,28 @@ where :math:`\Delta T_{v} =1{\rm \; or\; }-1`. The error The energy error due to this constraint is .. math:: - :label: 5.140) + :label: 5.139 \Delta _{3} =\max \left(0,\, E_{v} -E_{v}^{t} -\frac{W_{can} }{\Delta t} \right). The error :math:`\lambda \Delta _{3}` is added to the sensible heat flux later. -#. Sensible heat flux :math:`H_{v}` (eq. ). The three energy error +#. Sensible heat flux :math:`H_{v}` (:eq:`` ). The three energy error terms, :math:`\Delta _{1}` , :math:`\Delta _{2}` , and :math:`\lambda \Delta _{3}` are also added to the sensible heat flux. -#. The saturated vapor pressure :math:`e_{i}` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), saturated +#. The saturated vapor pressure :math:`e_{i}` (Chapter + :numref:`rst_Stomatal Resistance and Photosynthesis`), saturated specific humidity :math:`q_{sat}^{T_{v} }` and its derivative :math:`\frac{dq_{sat}^{T_{v} } }{dT_{v} }` at the leaf surface - (section :numref:`Saturation Vapor Pressure`), are re-evaluated based on the new :math:`T_{v}` . + (section :numref:`Saturation Vapor Pressure`), are re-evaluated based on + the new :math:`T_{v}` . -#. Canopy air temperature :math:`T_{s}` (eq. ) +#. Canopy air temperature :math:`T_{s}` (:eq:`5.93` ) -#. Canopy air specific humidity :math:`q_{s}` (eq. ) +#. Canopy air specific humidity :math:`q_{s}` (:eq:`5.107` ) #. Temperature difference :math:`\theta _{atm} -\theta _{s}` @@ -1561,11 +1563,11 @@ flux later. where :math:`\frac{q_{*} }{q_{atm} -q_{s} }` was calculated earlier in the iteration -#. Virtual potential temperature scale :math:`\theta _{v*}` (eq. ) +#. Virtual potential temperature scale :math:`\theta _{v*}` (:eq:`5.17` ) -#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) +#. Wind speed including the convective velocity, :math:`V_{a}` (:eq:`5.24` ) -#. Monin-Obukhov length :math:`L` (eq. ) +#. Monin-Obukhov length :math:`L` (:eq:`5.49` ) #. The iteration is stopped after two or more steps if :math:`\tilde{\Delta }T_{v} <0.01` and @@ -1574,14 +1576,14 @@ flux later. :math:`\tilde{\Delta }T_{v} =\max \left(\left|T_{v}^{n+1} -T_{v}^{n} \right|,\, \left|T_{v}^{n} -T_{v}^{n-1} \right|\right)`, or after forty iterations have been carried out. -#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (eqs. , ) +#. Momentum fluxes :math:`\tau _{x}` , :math:`\tau _{y}` (:eq:`5.5`, :eq:`5.6`) -#. Sensible heat flux from ground :math:`H_{g}` (eq. ) +#. Sensible heat flux from ground :math:`H_{g}` (:eq:`5.89` ) -#. Water vapor flux from ground :math:`E_{g}` (eq. ) +#. Water vapor flux from ground :math:`E_{g}` (:eq:`5.102` ) #. 2-m height air temperature :math:`T_{2m}` , specific humidity - :math:`q_{2m}` , relative humidity :math:`RH_{2m}` \ (eqs. , , ) + :math:`q_{2m}` , relative humidity :math:`RH_{2m}` \ (:eq:`5.58` , :eq:`5.59`, :eq:`5.60`) .. _Update of Ground Sensible and Latent Heat Fluxes: @@ -1592,17 +1594,17 @@ The sensible and water vapor heat fluxes derived above for bare soil and soil beneath canopy are based on the ground surface temperature from the previous time step :math:`T_{g}^{n}` and are used as the surface forcing for the solution of the soil temperature equations (section -:numref:`Numerical Solution Temperature`). This solution yields a new ground surface temperature -:math:`T_{g}^{n+1}` . The ground sensible and water vapor fluxes are -then updated for :math:`T_{g}^{n+1}` as +:numref:`Numerical Solution Temperature`). This solution yields a new ground +surface temperature :math:`T_{g}^{n+1}` . The ground sensible and water +vapor fluxes are then updated for :math:`T_{g}^{n+1}` as .. math:: - :label: 5.141) + :label: 5.140 H'_{g} =H_{g} +\left(T_{g}^{n+1} -T_{g}^{n} \right)\frac{\partial H_{g} }{\partial T_{g} } .. math:: - :label: 5.142) + :label: 5.141 E'_{g} =E_{g} +\left(T_{g}^{n+1} -T_{g}^{n} \right)\frac{\partial E_{g} }{\partial T_{g} } @@ -1611,18 +1613,18 @@ vapor fluxes derived from equations and for non-vegetated surfaces and equations and for vegetated surfaces using :math:`T_{g}^{n}` . One further adjustment is made to :math:`H'_{g}` and :math:`E'_{g}` . If the soil moisture in the top snow/soil layer is not sufficient to -support the updated ground evaporation, i.e., if :math:`E'_{g} >0` and -:math:`f_{evap} <1` where +support the updated ground evaporation, i.e., if :math:`E'_{g} > 0` and +:math:`f_{evap} < 1` where .. math:: - :label: 5.143) + :label: 5.142 f_{evap} =\frac{{\left(w_{ice,\; snl+1} +w_{liq,\, snl+1} \right)\mathord{\left/ {\vphantom {\left(w_{ice,\; snl+1} +w_{liq,\, snl+1} \right) \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} }{\sum _{j=1}^{npft}\left(E'_{g} \right)_{j} \left(wt\right)_{j} } \le 1, an adjustment is made to reduce the ground evaporation accordingly as .. math:: - :label: 5.144) + :label: 5.143 E''_{g} =f_{evap} E'_{g} . @@ -1635,35 +1637,38 @@ relative area of the :math:`j^{th}` PFT with respect to the column, and :math:`npft` is the number of PFTs on the column. :math:`w_{ice,\, snl+1}` and :math:`w_{liq,\, snl+1}` are the ice and liquid water contents (kg m\ :sup:`-2`) of the top snow/soil layer -(Chapter :numref:`rst_Hydrology`). Any resulting energy deficit is assigned to sensible heat +(Chapter :numref:`rst_Hydrology`). Any resulting energy deficit is assigned +to sensible heat as .. math:: - :label: 5.145) + :label: 5.144 H''_{g} =H_{g} +\lambda \left(E'_{g} -E''_{g} \right). -The ground water vapor flux :math:`E''_{g}` is partitioned into evaporation of liquid water from snow/soil :math:`q_{seva}` -(kg\ m\ :sup:`-2` s\ :sup:`-1`), sublimation from snow/soil ice :math:`q_{subl}` (kg m\ :sup:`-2` s\ :sup:`-1`), liquid dew -on snow/soil :math:`q_{sdew}` (kg m\ :sup:`-2` s\ :sup:`-1`), or frost on snow/soil :math:`q_{frost}` (kg m\ :sup:`-2` s\ :sup:`-1`) as +The ground water vapor flux :math:`E''_{g}` is partitioned into evaporation +of liquid water from snow/soil :math:`q_{seva}` (kg\ m\ :sup:`-2` s\ :sup:`-1`), +sublimation from snow/soil ice :math:`q_{subl}` (kg m\ :sup:`-2` s\ :sup:`-1`), +liquid dew on snow/soil :math:`q_{sdew}` (kg m\ :sup:`-2` s\ :sup:`-1`), or +frost on snow/soil :math:`q_{frost}` (kg m\ :sup:`-2` s\ :sup:`-1`) as .. math:: - :label: 5.146) + :label: 5.145 q_{seva} =\max \left(E''_{sno} \frac{w_{liq,\, snl+1} }{w_{ice,\; snl+1} +w_{liq,\, snl+1} } ,0\right)\qquad E''_{sno} \ge 0,\, w_{ice,\; snl+1} +w_{liq,\, snl+1} >0 .. math:: - :label: 5.147) + :label: 5.146 q_{subl} =E''_{sno} -q_{seva} \qquad E''_{sno} \ge 0 .. math:: - :label: 5.148) + :label: 5.147 q_{sdew} =\left|E''_{sno} \right|\qquad E''_{sno} <0{\rm \; and\; }T_{g} \ge T_{f} .. math:: - :label: 5.149) + :label: 5.148 q_{frost} =\left|E''_{sno} \right|\qquad E''_{sno} <0{\rm \; and\; }T_{g} 0} \\ {\lambda _{vap} \qquad {\rm otherwise}} \end{array}\right\} @@ -1719,7 +1724,7 @@ flux to an energy flux, :math:`\lambda _{vap}` is used. The system balances energy as .. math:: - :label: 5.154) + :label: 5.153 \overrightarrow{S}_{g} +\overrightarrow{S}_{v} +L_{atm} \, \downarrow -L\, \uparrow -H_{v} -H_{g} -\lambda _{vap} E_{v} -\lambda E_{g} -G=0. @@ -1734,12 +1739,12 @@ Saturation vapor pressure :math:`e_{sat}^{T}` (Pa) and its derivative :ref:`Flatau et al. (1992) ` .. math:: - :label: 5.155) + :label: 5.154 e_{sat}^{T} =100\left[a_{0} +a_{1} T+\cdots +a_{n} T^{n} \right] .. math:: - :label: 5.156) + :label: 5.155 \frac{de_{sat}^{T} }{dT} =100\left[b_{0} +b_{1} T+\cdots +b_{n} T^{n} \right] @@ -1753,12 +1758,12 @@ The saturated water vapor specific humidity :math:`q_{sat}^{T}` and its derivati :math:`\frac{dq_{sat}^{T} }{dT}` are .. math:: - :label: 5.157) + :label: 5.156 q_{sat}^{T} =\frac{0.622e_{sat}^{T} }{P_{atm} -0.378e_{sat}^{T} } .. math:: - :label: 5.158) + :label: 5.157 \frac{dq_{sat}^{T} }{dT} =\frac{0.622P_{atm} }{\left(P_{atm} -0.378e_{sat}^{T} \right)^{2} } \frac{de_{sat}^{T} }{dT} . diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index f1f78574df..69a8907f89 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -392,7 +392,7 @@ mass is stated as \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q where :math:`\theta` is the volumetric soil water content -(mm:sup:`3` of water mm\ :sup:`-3` of soil), :math:`t` is +(mm\ :sup:`3` of water mm\ :sup:`-3` of soil), :math:`t` is time (s), :math:`z` is height above some datum in the soil column (mm) (positive upwards), :math:`q` is soil water flux (kg m\ :sup:`-2` s\ :sup:`-1` or mm s\ :sup:`-1`) (positive upwards), and diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index 35a77b901f..136272973d 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -106,7 +106,7 @@ resolution. .. Figure 12.1. Schematic representation of the urban land unit -.. _Figure schematic representation of urban: +.. _Figure schematic representation of the urban land unit: .. figure:: image1.png From 80662a29eea077ab7cb7511ee0c037ee77ab49fa Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 31 May 2017 11:38:37 -0600 Subject: [PATCH 032/730] Update html --- .../CLM50_Tech_Note_External_Nitrogen_Cycle.rst | 2 +- .../CLM50_Tech_Note_Plant_Hydraulic_Stress.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst index b8f6536a46..69959b0a8c 100644 --- a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst @@ -93,7 +93,7 @@ annual NPP in Figure 16.1. .. figure:: image1.png Biological nitrogen fixation as a function of annual net -primary production. + primary production. Because of the empirical nature of this NPP-BNF relationship, the timescale for calculating NPP and thus BNF is unconstrained. Using diff --git a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst index e5541bf2b4..02132af76d 100644 --- a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst +++ b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst @@ -230,7 +230,7 @@ PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential a \psi=\left[\psi_{sunleaf},\psi_{shadeleaf},\psi_{stem},\psi_{root}\right] .. math:: - :label: 11.21) + :label: 11.21 \begin{aligned} E_{sun}&=q_{1a}\\ @@ -240,10 +240,10 @@ PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential a &=\sum_{i=1}^{nlevsoi}{q_{3,i}} \end{aligned} -The demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy equations in (11.21). +The demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy :eq:`11.21`. .. math:: - :label: 11.21) + :label: 11.22) ff From 4f2077ed2cd2c4f1f5a09c37f353c8e7e6b0e6bd Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 31 May 2017 13:34:20 -0600 Subject: [PATCH 033/730] update methane and lake chapters --- .../CLM50_Tech_Note_CN_Allocation.rst | 100 ++-- .../tech_note/Lake/CLM50_Tech_Note_Lake.rst | 479 +++++++++--------- .../Methane/CLM50_Tech_Note_Methane.rst | 211 +++++--- .../References/CLM50_Tech_Note_References.rst | 2 +- 4 files changed, 418 insertions(+), 374 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 3206f3ab28..a63ec9ae3d 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -80,17 +80,17 @@ photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: 19.1) + :label: 19.1 CF_{mr} =CF_{GPP,mr} +CF_{xs,mr} .. math:: - :label: 19.2) + :label: 19.2 CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. .. math:: - :label: 19.3) + :label: 19.3 CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. @@ -114,12 +114,12 @@ flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC m\ :sup:`-2` s\ :sup:`-1`) is given as .. math:: - :label: 19.4) + :label: 19.4 CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. .. math:: - :label: 19.5) + :label: 19.5 CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. @@ -140,7 +140,7 @@ remaining carbon flux from photosynthesis which can be allocated to new growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 19.6) + :label: 19.6 CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . @@ -151,7 +151,7 @@ between various tissue types. The allometric parameters are defined as follows: .. math:: - :label: ZEqnNum650137 + :label: 19.7 \begin{array}{l} {a_{1} ={\rm \; ratio\; of\; new\; fine\; root\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{2} ={\rm \; ratio\; of\; new\; coarse\; root\; :\; new\; stem\; carbon\; allocation}} \\ {a_{3} ={\rm \; ratio\; of\; new\; stem\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{4} ={\rm \; ratio\; new\; live\; wood\; :\; new\; total\; wood\; allocation}} \\ {g_{1} ={\rm ratio\; of\; growth\; respiration\; carbon\; :\; new\; growth\; carbon.\; }} \end{array} @@ -166,7 +166,7 @@ ratio for carbon allocation between new stem and new leaf increases with increasing net primary production (NPP), as .. math:: - :label: 19.8) + :label: 19.8 a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 @@ -236,7 +236,7 @@ Carbon to nitrogen ratios are defined for different tissue types as follows: .. math:: - :label: ZEqnNum413927 + :label: 19.9 \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} @@ -251,19 +251,19 @@ functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: ZEqnNum555154 + :label: 19.10 \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} where .. math:: - :label: 19.11) + :label: 19.11 \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} .. math:: - :label: 19.12) + :label: 19.12 N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. @@ -274,7 +274,7 @@ plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) as: .. math:: - :label: 19.13) + :label: 19.13 NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . @@ -293,7 +293,7 @@ availability of nitrogen from this pool to support new growth s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: .. math:: - :label: 19.14) + :label: 19.14 NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) @@ -319,7 +319,7 @@ m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant demand for new nitrogen: .. math:: - :label: 19.15) + :label: 19.15 NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) @@ -332,7 +332,7 @@ from the soil (:math:`NF_{plant\_demand\_soil}`, gN m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: ZEqnNum491412 + :label: 19.16 NF_{plant\_ demand\_ soil} =NF_{plant\_ demand} -NF_{retrans,alloc} . @@ -346,7 +346,7 @@ mineral nitrogen supply and competition with heterotrophs. Plant uptake from the soil mineral nitrogen pool is then given as: .. math:: - :label: 19.17) + :label: 19.17 NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} @@ -356,7 +356,7 @@ Final carbon and nitrogen allocation The total flux of allocated nitrogen is given as: .. math:: - :label: 19.18) + :label: 19.18 NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} @@ -364,14 +364,14 @@ From the stoichiometric relationship in Eq. , the associated carbon allocation flux is: .. math:: - :label: 19.19) + :label: 19.19 CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . The downregulation of photosynthesis can then be calculated as: .. math:: - :label: 19.20) + :label: 19.20 f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . @@ -379,7 +379,7 @@ Total allocation to new leaf carbon (:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: .. math:: - :label: 19.21) + :label: 19.21 CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . @@ -395,124 +395,124 @@ storage pools (where storage is indicated with *\_stor*) for the various tissue types are given as: .. math:: - :label: 19.22) + :label: 19.22 CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} .. math:: - :label: 19.23) + :label: 19.23 CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) .. math:: - :label: 19.24) + :label: 19.24 CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} .. math:: - :label: 19.25) + :label: 19.25 CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) .. math:: - :label: 19.26) + :label: 19.26 CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} .. math:: - :label: 19.27) + :label: 19.27 CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 19.28) + :label: 19.28 CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 19.29) + :label: 19.29 CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) .. math:: - :label: 19.30) + :label: 19.30 CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} .. math:: - :label: 19.31) + :label: 19.31 CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 19.32) + :label: 19.32 CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 19.33) + :label: 19.33 CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). The corresponding nitrogen allocation fluxes are given as: .. math:: - :label: 19.34) + :label: 19.34 NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} .. math:: - :label: 19.35) + :label: 19.35 NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) .. math:: - :label: 19.36) + :label: 19.36 NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} .. math:: - :label: 19.37) + :label: 19.37 NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) .. math:: - :label: 19.38) + :label: 19.38 NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 19.39) + :label: 19.39 NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 19.40) + :label: 19.40 NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 19.41) + :label: 19.41 NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) .. math:: - :label: 19.42) + :label: 19.42 NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 19.43) + :label: 19.43 NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 19.44) + :label: 19.44 NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 19.45) + :label: 19.45 NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). @@ -536,22 +536,22 @@ functions tissue nitrogen content and the relevant temperature, following the empirical relationship reported by Ryan (1991): .. math:: - :label: 19.46) + :label: 19.46 CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 19.47) + :label: 19.47 CF_{mr\_ livestem} \_ =NS_{livestem} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 19.48) + :label: 19.48 CF_{mr\_ livecroot} \_ =NS_{livecroot} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} .. math:: - :label: 19.49) + :label: 19.49 CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} @@ -574,7 +574,7 @@ common base maintenance respiration rate for all live tissue types. The total maintenance respiration cost is then given as: .. math:: - :label: 19.50) + :label: 19.50 CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . diff --git a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst index 860bc2ae7c..28cf52f8a1 100644 --- a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst +++ b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst @@ -21,10 +21,13 @@ body, resolved snow layers, and “soil†and bedrock layers below the lake body. Temperatures and ice fractions are simulated for :math:`N_{levlak} =10` layers (for global simulations) or :math:`N_{levlak} =25` (for site simulations) with discretization -described in section 9.1. Lake albedo is described in section 9.3. Lake -surface fluxes (section 9.4) generally follow the formulations for -non-vegetated surfaces, including the calculations of aerodynamic -resistances (section 5.2); however, the lake surface temperature +described in section :numref:`Vertical Discretization Lake`. Lake albedo is +described in section :numref:`Surface Albedo Lake`. Lake surface fluxes +(section :numref:`Surface Fluxes and Surface Temperature Lake`) generally +follow the formulations for non-vegetated surfaces, including the calculations +of aerodynamic resistances (section +:numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`); +however, the lake surface temperature :math:`T_{g}` (representing an infinitesimal interface layer between the top resolved lake layer and the atmosphere) is solved for simultaneously with the surface fluxes. After surface fluxes are @@ -32,7 +35,8 @@ evaluated, temperatures are solved simultaneously in the resolved snow layers (if present), the lake body, and the soil and bedrock, using the ground heat flux *G* as a top boundary condition. Snow, soil, and bedrock models generally follow the formulations for non-vegetated -surfaces (Chapter 6), with modifications described below. +surfaces (Chapter :numref:`rst_Soil and Snow Temperatures`), with +modifications described below. .. _Vertical Discretization Lake: @@ -51,7 +55,7 @@ liquid density), with frozen mass-fraction *I* a state variable. Resolved snow layers are present if the snow thickness :math:`z_{sno} \ge s_{\min }` , where *s*\ :sub:`min` = 4 cm by default, and is adjusted for model timesteps other than 1800 s in order -to maintain numerical stability (section 9.6.5). For global simulations +to maintain numerical stability (section :numref:`Modifications to Snow Layer Logic Lake`). For global simulations with 10 body layers, the default (50 m lake) body layer thicknesses are given by: :math:`\Delta z_{i}` of 0.1, 1, 2, 3, 4, 5, 7, 7, 10.45, and 10.45 m, with node depths :math:`z_{i}` located at the center of each @@ -64,22 +68,23 @@ layers 10-13; 2 for layers 14-15; 2.5 for layers 16-17; 3.5 for layers layer is kept at 10 cm and the other 9 layer thicknesses are adjusted to maintain fixed proportions. For lakes with *d* :math:`<` 1 m, all layers have equal thickness. Thicknesses of snow, soil, and bedrock layers -follow the scheme used over non-vegetated surfaces (Chapter 6), with +follow the scheme used over non-vegetated surfaces (Chapter :numref:`rst_Soil and Snow Temperatures`), with modifications to the snow layer thickness rules to keep snow layers at -least as thick as *s*\ :sub:`min` (section 9.6.5). +least as thick as *s*\ :sub:`min` (section :numref:`Modifications to Snow Layer Logic Lake`). .. _External Data Lake: External Data ----------------- -As discussed in Subin et al (2012a, b), the Global Lake and Wetland -Database (Lehner and Doll 2004) is currently used to prescribe lake -fraction in each land model grid cell, for a total of 2.3 million -km\ :sup:`-2`. As in Subin et al. (2012a, b), the Kourzeneva -(2012) global gridded dataset is currently used to estimate a mean lake -depth in each grid cell, based on interpolated compilations of -geographic information. +As discussed in :ref:`Subin et al. (2012a, b) `, the +Global Lake and Wetland Database (:ref:`Lehner and Doll 2004`) +is currently used to prescribe lake fraction in each land model grid cell, +for a total of 2.3 million km\ :sup:`-2`. As in +:ref:`Subin et al. (2012a, b) `, the +:ref:`Kourzeneva et al. (2012)` global gridded dataset is currently +used to estimate a mean lake depth in each grid cell, based on interpolated +compilations of geographic information. .. _Surface Albedo Lake: @@ -87,10 +92,10 @@ Surface Albedo ------------------ For direct radiation, the albedo *a* for lakes with ground temperature -:math:`{T}_{g}` (K) above freezing is given by (Pivovarov, 1972) +:math:`{T}_{g}` (K) above freezing is given by (:ref:`Pivovarov, 1972`) .. math:: - :label: ZEqnNum194122 + :label: 12.1 a=\frac{0.5}{\cos z+0.15} @@ -100,57 +105,27 @@ eq. is integrated over the full sky to yield *a* = 0.10. For frozen lakes without resolved snow layers, the albedo at cold temperatures *a*\ :sub:`0` is 0.60 for visible and 0.40 for near infrared radiation. As the temperature at the ice surface, -:math:`{T}_{g}`, approaches freezing [ :math:`{T}_{f}` (K) (Table -2.6)], the albedo is relaxed towards 0.10 based on Mironov et al. (2010): +:math:`{T}_{g}`, approaches freezing [ :math:`{T}_{f}` (K) (:numref:`Table Physical Constants`)], the albedo is relaxed towards 0.10 based on +:ref:`Mironov et al. (2010)`: .. math:: - :label: 12.2) + :label: 12.2 a=a_{0} \left(1-x\right)+0.10x,x=\exp \left(-95\frac{T_{f} -T_{g} }{T_{f} } \right) -where *a* is restricted to be no less than that given in eq. . +where *a* is restricted to be no less than that given in :eq:`12.1`. For frozen lakes with resolved snow layers, the reflectance of the ice surface is fixed at *a*\ :sub:`0`, and the snow reflectance is -calculated as over non-vegetated surfaces (Chapter 3). These two -reflectances are combined to obtain the snow-fraction-weighted albedo as -in over non-vegetated surfaces (Chapter 3). +calculated as over non-vegetated surfaces (Chapter :numref:`rst_Surface Albedos`). +These two reflectances are combined to obtain the snow-fraction-weighted albedo as +in over non-vegetated surfaces (Chapter :numref:`rst_Surface Albedos`). .. _Surface Fluxes and Surface Temperature Lake: Surface Fluxes and Surface Temperature ------------------------------------------ -.. _Overview of Changes from CLM4: - -Overview of Changes from CLM4 -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -#. The surface roughnesses, and surface absorption fraction - :math:`\beta`, are diagnostic rather than constants. As the surface - roughnesses depend (weakly) on the friction velocity :math:`u_{\*}` - (which itself depends weakly on the surface roughnesses), their - calculation has been incorporated into the iteration solution for - :math:`{T}_{g}`, and the maximum number of iterations has been - increased to 4. Convergence of the modified solution was tested - during development. - -#. A coefficient of :math:`\beta` has been added to - :math:`{S}_{g}` in eq. , correcting a previous error. - .. todo:: fill this equation number in - -#. The top layer thickness :math:`\Delta z_{T}` used in eq. has been - appended with a coefficient of ½, correcting a previous error. - -#. The thermal conductivity :math:`\lambda _{T}` used in eq. depends on - the properties of the top model layer (e.g., snow, ice, or water). - When this layer is unfrozen, :math:`\lambda _{T}` includes the eddy - conductivity calculated in the previous timestep. - -#. Several conditions are imposed on the ground temperature - :math:`{T}_{g}` to maintain a stable density profile at the lake - surface eq. . - .. _Surface Properties Lake: Surface Properties @@ -159,24 +134,25 @@ Surface Properties The fraction of shortwave radiation absorbed at the surface, :math:`\beta`, depends on the lake state. If resolved snow layers are present, then :math:`\beta` is set equal to the absorption fraction -predicted by the snow-optics submodel (Chapter 3) for the top snow +predicted by the snow-optics submodel (Chapter :numref:`rst_Surface Albedos`) +for the top snow layer. Otherwise, :math:`\beta` is set equal to the near infrared fraction of the shortwave radiation reaching the surface simulated by the atmospheric model or atmospheric data model used for offline -simulations (Chapter 26). The remainder of the shortwave radiation +simulations (Chapter :numref:`rst_Offline Mode`). The remainder of the shortwave radiation fraction (1 :math:`{-}` :math:`\beta`) is absorbed in the lake -body or soil as described in section 9.5.5. +body or soil as described in section :numref:`Radiation Penetration`. The surface roughnesses are functions of the lake state and atmospheric forcing. For frozen lakes ( :math:`T_{g} \le T_{f}` ) with resolved snow layers, the momentum roughness length -:math:`z_{0m} =2.4\times 10^{-3} {\rm m}` (as over non-vegetated -surfaces; Chapter 5), and the scalar roughness lengths +:math:`z_{0m} =2.4 \times 10^{-3} {\rm m}` (as over non-vegetated +surfaces; Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), and the scalar roughness lengths (*z*\ :sub:`0q` for latent heat; and *z*\ :sub:`0h`, for sensible heat) are given by -(Zilitinkevich 1970) +(:ref:`Zilitinkevich 1970`) .. math:: - :label: ZEqnNum631483 + :label: 12.3 \begin{array}{l} {R_{0} =\frac{z_{0m} u_{*} }{\nu } ,} \\ {z_{0h} =z_{0q} =z_{0m} \exp \left\{-0.13R_{0} ^{0.45} \right\}} \end{array} @@ -186,23 +162,23 @@ length for sensible heat, :math:`z_{0q}` is the roughness length for latent heat, :math:`\nu` (m\ :sup:`2` s\ :sup:`-1`) is the kinematic viscosity of air, and :math:`u_{\*}` (m s\ :sup:`-1`) is the friction velocity in the atmospheric surface layer. For frozen lakes without resolved snow -layers, :math:`z_{0m} =1\times 10^{-3} {\rm m}` (Subin et al. 2012a), +layers, :math:`z_{0m} =1\times 10^{-3} {\rm m}` (:ref:`Subin et al. (2012a) `), and the scalar roughness lengths are given by . -For unfrozen lakes, *z*\ :sub:`0m` is given by (Subin et al. 2012a) +For unfrozen lakes, *z*\ :sub:`0m` is given by (:ref:`Subin et al. (2012a) `) .. math:: - :label: ZEqnNum864823 + :label: 12.4 z_{0m} =\max \left(\frac{\alpha \nu }{u_{*} } ,C\frac{u_{*} ^{2} }{g} \right) where :math:`\alpha` = 0.1, :math:`\nu` is the kinematic viscosity of air given below, *C* is the effective Charnock coefficient given -below, and *g* is the acceleration of gravity (Table 2.6). The kinematic +below, and *g* is the acceleration of gravity (:numref:`Table Physical Constants`). The kinematic viscosity is given by .. math:: - :label: 12.5) + :label: 12.5 \nu =\nu _{0} \left(\frac{T_{g} }{T_{0} } \right)^{1.5} \frac{P_{0} }{P_{ref} } @@ -216,7 +192,7 @@ height. The Charnock coefficient *C* is a function of the lake fetch *F* default: .. math:: - :label: 12.6) + :label: 12.6 \begin{array}{l} {C=C_{\min } +(C_{\max } -C_{\min } )\exp \left\{-\min \left(A,B\right)\right\}} \\ {A={\left(\frac{Fg}{u_{\*} ^{2} } \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } \mathord{\left/ {\vphantom {\left(\frac{Fg}{u_{\*} ^{2} } \right)^{{1\mathord{\left/ {\vphantom {1 3}} \right. \kern-\nulldelimiterspace} 3} } f_{c} }} \right. \kern-\nulldelimiterspace} f_{c} } } \\ {B=\varepsilon \frac{\sqrt{dg} }{u} } \end{array} @@ -233,7 +209,7 @@ Surface Flux Solution Conservation of energy at the lake surface requires .. math:: - :label: ZEqnNum309023 + :label: 12.7 \beta \vec{S}_{g} -\vec{L}_{g} -H_{g} -\lambda E_{g} -G=0 @@ -247,61 +223,63 @@ the temperature at the lake surface :math:`{T}_{g}`. :math:`\lambda` converts :math:`E_{g}` to an energy flux based on .. math:: - :label: ZEqnNum257687 + :label: 12.8 \lambda =\left\{\begin{array}{l} {\lambda _{sub} \qquad T_{g} \le T_{f} } \\ {\lambda _{vap} \qquad T_{g} >T_{f} } \end{array}\right\}. The sensible heat flux (W m\ :sup:`-2`) is .. math:: - :label: ZEqnNum720553 + :label: 12.9 H_{g} =-\rho _{atm} C_{p} \frac{\left(\theta _{atm} -T_{g} \right)}{r_{ah} } where :math:`\rho _{atm}` is the density of moist air (kg -m\ :sup:`-3`) (Chapter 5), :math:`C_{p}` is the specific heat -capacity of air (J kg\ :sup:`-1` K\ :sup:`-1`) (Table 2.6), +m\ :sup:`-3`) (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`C_{p}` is the specific heat +capacity of air (J kg\ :sup:`-1` K\ :sup:`-1`) (:numref:`Table Physical Constants`), :math:`\theta _{atm}` is the atmospheric potential temperature (K) -(Chapter 5), :math:`T_{g}` is the lake surface temperature (K) (at an +(Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), :math:`T_{g}` is the lake surface temperature (K) (at an infinitesimal interface just above the top resolved model layer: snow, ice, or water), and :math:`r_{ah}` is the aerodynamic resistance to -sensible heat transfer (s m\ :sup:`-1`) (section 5.1). +sensible heat transfer (s m\ :sup:`-1`) (section :numref:`Monin-Obukhov Similarity Theory`). The water vapor flux (kg m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 12.10) + :label: 12.10 E_{g} =-\frac{\rho _{atm} \left(q_{atm} -q_{sat}^{T_{g} } \right)}{r_{aw} } where :math:`q_{atm}` is the atmospheric specific humidity (kg -kg\ :sup:`-1`) (section 2.2.1), :math:`q_{sat}^{T_{g} }` \ is the -saturated specific humidity (kg kg\ :sup:`-1`) (section 5.5) at +kg\ :sup:`-1`) (section :numref:`Atmospheric Coupling`), +:math:`q_{sat}^{T_{g} }` \ is the saturated specific humidity +(kg kg\ :sup:`-1`) (section :numref:`Saturation Vapor Pressure`) at the lake surface temperature :math:`T_{g}` , and :math:`r_{aw}` is the aerodynamic resistance to water vapor transfer (s m\ :sup:`-1`) -(section 5.1). +(section :numref:`Monin-Obukhov Similarity Theory`). The zonal and meridional momentum fluxes are .. math:: - :label: 12.11) + :label: 12.11 \tau _{x} =-\rho _{atm} \frac{u_{atm} }{r_{atm} } .. math:: - :label: 12.12) + :label: 12.12 \tau _{y} =-\rho _{atm} \frac{v_{atm} }{r_{atm} } where :math:`u_{atm}` and :math:`v_{atm}` are the zonal and -meridional atmospheric winds (m s\ :sup:`-1`) (section 2.2.1), and +meridional atmospheric winds (m s\ :sup:`-1`) (section +:numref:`Atmospheric Coupling`), and :math:`r_{am}` is the aerodynamic resistance for momentum (s -m\ :sup:`-1`) (section 5.1). +m\ :sup:`-1`) (section :numref:`Monin-Obukhov Similarity Theory`). The heat flux into the lake surface :math:`G` (W m\ :sup:`-2`) is .. math:: - :label: ZEqnNum122376 + :label: 12.13 G=\frac{2\lambda _{T} }{\Delta z_{T} } \left(T_{g} -T_{T} \right) @@ -311,10 +289,9 @@ thickness (m), and :math:`T_{T}` is the temperature (K) of the top resolved lake layer (snow, ice, or water). The top thermal conductivity :math:`\lambda _{T}` of unfrozen lakes ( :math:`T_{g} >T_{f}` ) includes conductivities due to molecular ( :math:`\lambda _{liq}` ) and -eddy (:math:`\lambda _{K}` ) diffusivities (section 9.5.4), as evaluated +eddy (:math:`\lambda _{K}` ) diffusivities (section :numref:`Eddy Diffusivity and Thermal Conductivities`), as evaluated in the top lake layer at the previous timestep, where -:math:`\lambda _{liq}` is the thermal conductivity of water (Table -2.6). For frozen lakes without resolved snow layers, +:math:`\lambda _{liq}` is the thermal conductivity of water (:numref:`Table Physical Constants`). For frozen lakes without resolved snow layers, :math:`\lambda _{T} =\lambda _{ice}` . When resolved snow layers are present, :math:`\lambda _{T}` \ is calculated based on the water content, ice content, and thickness of the top snow layer, as for @@ -323,7 +300,7 @@ non-vegetated surfaces. The absorbed solar radiation :math:`\vec{S}_{g}` is .. math:: - :label: 12.14) + :label: 12.14 \vec{S}_{g} =\sum _{\Lambda }S_{atm} \, \downarrow _{\Lambda }^{\mu } \left(1-\alpha _{g,\, \Lambda }^{\mu } \right) +S_{atm} \, \downarrow _{\Lambda } \left(1-\alpha _{g,\, \Lambda } \right) @@ -332,30 +309,32 @@ where :math:`S_{atm} \, \downarrow _{\Lambda }^{\mu }` and and diffuse solar fluxes (W m\ :sup:`-2`) and :math:`\Lambda` denotes the visible (:math:`<` 0.7\ :math:`\mu {\rm m}`) and near-infrared (:math:`\ge` 0.7\ :math:`\mu {\rm m}`) wavebands (section -2.2.1), and :math:`\alpha _{g,\, \Lambda }^{\mu }` and +:numref:`Atmospheric Coupling`), and :math:`\alpha _{g,\, \Lambda }^{\mu }` and :math:`\alpha _{g,\, \mu }` are the direct beam and diffuse lake -albedos (section 9.3). +albedos (section :numref:`Surface Albedo Lake`). The net emitted longwave radiation is .. math:: - :label: 12.15) + :label: 12.15 \vec{L}_{g} =L_{g} \, \uparrow -L_{atm} \, \downarrow where :math:`L_{g} \, \uparrow` is the upward longwave radiation from the surface, :math:`L_{atm} \, \downarrow` is the downward atmospheric -longwave radiation (section 2.2.1). The upward longwave radiation from -the surface is +longwave radiation (section :numref:`Atmospheric Coupling`). The upward +longwave radiation from the surface is .. math:: - :label: 12.16) + :label: 12.16 L\, \uparrow =\left(1-\varepsilon _{g} \right)L_{atm} \, \downarrow +\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{4} +4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} \left(T_{g}^{n+1} -T_{g}^{n} \right) where :math:`\varepsilon _{g} =0.97` is the lake surface emissivity, -:math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6), and :math:`T_{g}^{n+1} -T_{g}^{n}` is -the difference in lake surface temperature between Newton-Raphson iterations (see below). +:math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ +:sup:`-4`) (:numref:`Table Physical Constants`), and +:math:`T_{g}^{n+1} -T_{g}^{n}` is the difference in lake surface +temperature between Newton-Raphson iterations (see below). The sensible heat :math:`H_{g}` , the water vapor flux :math:`E_{g}` through its dependence on the saturated specific humidity, the net @@ -365,7 +344,7 @@ Newton-Raphson iteration is applied to solve for :math:`T_{g}` and the surface fluxes as .. math:: - :label: ZEqnNum858039 + :label: 12.17 \Delta T_{g} =\frac{\beta \overrightarrow{S}_{g} -\overrightarrow{L}_{g} -H_{g} -\lambda E_{g} -G}{\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } } @@ -374,79 +353,80 @@ where :math:`\Delta T_{g} =T_{g}^{n+1} -T_{g}^{n}` and the subscript :math:`T_{g}^{n+1}` can be written as .. math:: - :label: ZEqnNum878786 + :label: 12.18 T_{g}^{n+1} =\frac{\beta \overrightarrow{S}_{g} -\overrightarrow{L}_{g} -H_{g} -\lambda E_{g} -G+T_{g}^{n} \left(\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } \right)}{\frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } +\frac{\partial H_{g} }{\partial T_{g} } +\frac{\partial \lambda E_{g} }{\partial T_{g} } +\frac{\partial G}{\partial T_{g} } } where the partial derivatives are .. math:: - :label: 12.19) + :label: 12.19 \frac{\partial \overrightarrow{L}_{g} }{\partial T_{g} } =4\varepsilon _{g} \sigma \left(T_{g}^{n} \right)^{3} , .. math:: - :label: 12.20) + :label: 12.20 \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r_{ah} } , .. math:: - :label: 12.21) + :label: 12.21 \frac{\partial \lambda E_{g} }{\partial T_{g} } =\frac{\lambda \rho _{atm} }{r_{aw} } \frac{dq_{sat}^{T_{g} } }{dT_{g} } , .. math:: - :label: 12.22) + :label: 12.22 \frac{\partial G}{\partial T_{g} } =\frac{2\lambda _{T} }{\Delta z_{T} } . The fluxes of momentum, sensible heat, and water vapor are solved for simultaneously with lake surface temperature as follows. The stability-related equations are the same as for non-vegetated surfaces -(section 5.2), except that the surface roughnesses are here (weakly -varying) functions of the friction velocity :math:`u_{\*}` . To begin, -*z*\ :sub:`0m` is set based on the value -calculated for the last timestep (for :math:`T_{g} >T_{f}` ) or based on -the values in section 9.4.2 (otherwise), and the scalar roughness -lengths are set based on the relationships in section 9.4.2. +(section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), +except that the surface roughnesses are here (weakly varying) functions +of the friction velocity :math:`u_{\*}` . To begin, *z*\ :sub:`0m` is set +based on the value calculated for the last timestep (for +:math:`T_{g} >T_{f}` ) or based on the values in section +:numref:`Surface Properties Lake` (otherwise), and the scalar roughness +lengths are set based on the relationships in section :numref:`Surface Properties Lake`. #. An initial guess for the wind speed :math:`V_{a}` including the - convective velocity :math:`U_{c}` is obtained from eq. assuming an + convective velocity :math:`U_{c}` is obtained from :eq:`5.24` assuming an initial convective velocity :math:`U_{c} =0` m s\ :sup:`-1` for stable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} \ge 0` - as evaluated from eq. ) and :math:`U_{c} =0.5` for unstable + as evaluated from :eq:`5.50`) and :math:`U_{c} =0.5` for unstable conditions (:math:`\theta _{v,\, atm} -\theta _{v,\, s} <0`). #. An initial guess for the Monin-Obukhov length :math:`L` is obtained - from the bulk Richardson number using equations and . + from the bulk Richardson number using :eq:`5.46` and :eq:`5.48`. #. The following system of equations is iterated four times: -#. Heat of vaporization / sublimation :math:`\lambda` \ (eq. ) +#. Heat of vaporization / sublimation :math:`\lambda` \ (:eq:`12.8`) #. Thermal conductivity :math:`\lambda _{T}` \ (above) -#. Friction velocity :math:`u_{\*}` (eqs. , , , ) +#. Friction velocity :math:`u_{\*}` (:eq:`5.32`, :eq:`5.33`, :eq:`5.34`, :eq:`5.35`) -#. Potential temperature scale :math:`\theta _{\*}` (eqs. , , , ) +#. Potential temperature scale :math:`\theta _{\*}` (:eq:`5.37` , :eq:`5.38`, :eq:`5.39`, :eq:`5.40`) -#. Humidity scale :math:`q_{\*}` (eqs. , , , ) +#. Humidity scale :math:`q_{\*}` (:eq:`5.41`, :eq:`5.42`, :eq:`5.43`, :eq:`5.44`) #. Aerodynamic resistances :math:`r_{am}` , :math:`r_{ah}` , and - :math:`r_{aw}` (eqs. , , ) + :math:`r_{aw}` (:eq:`5.55`, :eq:`5.56`, :eq:`5.57`) -#. Lake surface temperature :math:`T_{g}^{n+1}` (eq.) +#. Lake surface temperature :math:`T_{g}^{n+1}` (:eq:`12.18`) -#. Heat of vaporization / sublimation :math:`\lambda` (eq. ) +#. Heat of vaporization / sublimation :math:`\lambda` (:eq:`12.8`) #. Sensible heat flux :math:`H_{g}` is updated for :math:`T_{g}^{n+1}` - (eq.) + (:eq:`12.9`) #. Water vapor flux :math:`E_{g}` is updated for :math:`T_{g}^{n+1}` as .. math:: - :label: ZEqnNum331835 + :label: 12.23 E_{g} =-\frac{\rho _{atm} }{r_{aw} } \left[q_{atm} -q_{sat}^{T_{g} } -\frac{\partial q_{sat}^{T_{g} } }{\partial T_{g} } \left(T_{g}^{n+1} -T_{g}^{n} \right)\right] @@ -456,28 +436,28 @@ iterations. #. Saturated specific humidity :math:`q_{sat}^{T_{g} }` and its derivative :math:`\frac{dq_{sat}^{T_{g} } }{dT_{g} }` are updated - for :math:`T_{g}^{n+1}` (section 5.1). + for :math:`T_{g}^{n+1}` (section :numref:`Monin-Obukhov Similarity Theory`). -#. Virtual potential temperature scale :math:`\theta _{v\*}` (eq. ) +#. Virtual potential temperature scale :math:`\theta _{v\*}` (:eq:`5.17`) -#. Wind speed including the convective velocity, :math:`V_{a}` (eq. ) +#. Wind speed including the convective velocity, :math:`V_{a}` (:eq:`5.24`) -#. Monin-Obukhov length :math:`L` (eq. ). +#. Monin-Obukhov length :math:`L` (:eq:`5.49`) -#. Roughness lengths (eq. , ). +#. Roughness lengths (:eq:`12.3`, :eq:`12.4`). Once the four iterations for lake surface temperature have been yielded a tentative solution :math:`T_{g} ^{{'} }` , several restrictions are imposed in order to maintain consistency with the top lake model -layer temperature :math:`T_{T}` \ (Subin et al. 2012a). +layer temperature :math:`T_{T}` \ (:ref:`Subin et al. (2012a) `). .. math:: - :label: ZEqnNum180534 + :label: 12.24 \begin{array}{l} {{\rm 1)\; }T_{T} \le T_{f} T_{g} ^{{'} } >T_{m} \Rightarrow T_{g} =T_{T} ,} \\ {{\rm 3)\; }T_{m} >T_{g} ^{{'} } >T_{T} >T_{f} \Rightarrow T_{g} =T_{T} } \end{array} where :math:`T_{m}` \ is the temperature of maximum liquid water -density, 3.85\ :sup:`o` C (Hostetler and Bartlein 1990). The +density, 3.85\ :sup:`o` C (:ref:`Hostetler and Bartlein (1990) `). The first condition requires that, if there is any snow or ice present, the surface temperature is restricted to be less than or equal to freezing. The second and third conditions maintain convective stability in the top @@ -489,7 +469,8 @@ the momentum fluxes are re-evaluated in any case. The final ground heat flux :math:`G` is calculated from the residual of the energy balance eq. XXX in order to precisely conserve energy. XXX This ground heat flux is taken as a prescribed flux boundary condition for the lake -temperature solution (section 9.5.3). An energy balance check is +temperature solution (section :numref:`Boundary Conditions Lake`). +An energy balance check is included at each timestep to insure that eq. XXX is obeyed to within 0.1 W m\ :sup:`-2`. @@ -506,10 +487,10 @@ Introduction The (optional-) snow, lake body (water and/or ice), soil, and bedrock system is unified for the lake temperature solution. The governing equation, similar to that for the snow-soil-bedrock system for vegetated -land units (Chapter 6), is +land units (Chapter :numref:`rst_Soil and Snow Temperatures`), is .. math:: - :label: ZEqnNum239244 + :label: 12.25 \tilde{c}_{v} \frac{\partial T}{\partial t} =\frac{\partial }{\partial z} \left(\tau \frac{\partial T}{\partial z} \right)-\frac{d\phi }{dz} @@ -521,21 +502,23 @@ radiation (W m\ :sup:`-2`) penetrating to depth *z* (m). The system is discretized into *N* layers, where .. math:: - :label: 12.26) + :label: 12.26 N=n_{sno} +N_{levlak} +N_{levgrnd} , :math:`n_{sno}` is the number of actively modeled snow layers at the -current timestep (section 7.2), and :math:`N_{levgrnd}` \ is as for -vegetated land units (Chapter 6). Energy is conserved as +current timestep (Chapter :numref:`rst_Snow Hydrology`), and +:math:`N_{levgrnd}` \ is as for vegetated land units (Chapter +:numref:`rst_Soil and Snow Temperatures`). Energy is conserved as .. math:: - :label: ZEqnNum317718 + :label: 12.27 \frac{d}{dt} \sum _{j=1}^{N}\left[\tilde{c}_{v,j} (t)\left(T_{j} -T_{f} \right)+L_{j} (t)\right] \Delta z_{j} =G+\left(1-\beta \right)\vec{S}_{g} where :math:`\tilde{c}_{v,j} (t)`\ is the volumetric heat capacity of -the *j*\ th layer (section 9.5.5), :math:`L_{j} (t)`\ is the latent heat +the *j*\ th layer (section :numref:`Radiation Penetration`), +:math:`L_{j} (t)`\ is the latent heat of fusion per unit volume of the *j*\ th layer (proportional to the mass of liquid water present), and the right-hand side represents the net influx of energy to the lake system. Note that @@ -553,20 +536,21 @@ Overview of Changes from CLM4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thermal conductivities include additional eddy diffusivity, beyond the -Hostetler and Bartlein (1990) formulation, due to unresolved processes -(Fang and Stefan 1996; Subin et al. 2012a). Lake water is now allowed to +:ref:`Hostetler and Bartlein (1990)` formulation, +due to unresolved processes (:ref:`Fang and Stefan 1996`; +:ref:`Subin et al. (2012a) `). Lake water is now allowed to freeze by an arbitrary fraction for each layer, which releases latent heat and changes thermal properties. Convective mixing occurs for all lakes, even if frozen. Soil and bedrock are included beneath the lake. The full snow model is used if the snow thickness exceeds a threshold; if there are resolved snow layers, radiation transfer is predicted by -the snow-optics submodel (Chapter 3), and the remaining radiation +the snow-optics submodel (Chapter :numref:`rst_Surface Albedos`), and the remaining radiation penetrating the bottom snow layer is absorbed in the top layer of lake ice; conversely, if there are no snow layers, the solar radiation penetrating the bottom lake layer is absorbed in the top soil layer. The lakes have variable depth, and all physics is assumed valid for arbitrary depth, except for a depth-dependent enhanced mixing (section -9.5.4). Finally, a previous sign error in the calculation of eddy +:numref:`Eddy Diffusivity and Thermal Conductivities`). Finally, a previous sign error in the calculation of eddy diffusivity (specifically, the Brunt-Väisälä frequency term; eq. ) was corrected. @@ -576,48 +560,50 @@ Boundary Conditions ^^^^^^^^^^^^^^^^^^^^^^^^^ The top boundary condition, imposed at the top modeled layer -:math:`i=j_{top}` , where :math:`j_{top} =-n_{sno} +1`, is the -downwards surface flux *G* defined by the energy flux residual during -the surface temperature solution (section 9.4.3). The bottom boundary -condition, imposed at :math:`i=N_{levlak} +N_{levgrnd}` , is zero flux. +:math:`i=j_{top}` , where :math:`j_{top} =-n_{sno} +1`, is the downwards +surface flux *G* defined by the energy flux residual during the surface +temperature solution (section :numref:`Boundary Conditions Lake`). The bottom +boundary condition, imposed at :math:`i=N_{levlak} +N_{levgrnd}` , is zero flux. The 2-m windspeed :math:`u_{2}` \ (m s\ :sup:`-1`) is used in the calculation of eddy diffusivity: .. math:: - :label: ZEqnNum997977 + :label: 12.28 u_{2} =\frac{u_{*} }{k} \ln \left(\frac{2}{z_{0m} } \right)\ge 0.1. where :math:`u_{*}` \ is the friction velocity calculated in section -9.4.3 and *k* is the von Karman constant (Table 2.6). +:numref:`Boundary Conditions Lake` and *k* is the von Karman constant +(:numref:`Table Physical Constants`). .. _Eddy Diffusivity and Thermal Conductivities: Eddy Diffusivity and Thermal Conductivities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The total eddy diffusivity :math:`K_{W}` (m\ :sup:`2` s\ :sup:`-1`) for liquid water in the lake body is given by (Subin et al. 2012a) +The total eddy diffusivity :math:`K_{W}` (m\ :sup:`2` s\ :sup:`-1`) for liquid water in the lake body is given by (:ref:`Subin et al. (2012a) `) .. math:: - :label: 12.29) + :label: 12.29 K_{W} = m_{d} \left(\kappa _{e} +K_{ed} +\kappa _{m} \right) -where :math:`\kappa _{e}` is due to wind-driven eddies (Hostetler and -Bartlein 1990), :math:`K_{ed}` is a modest enhanced diffusivity -intended to represent unresolved mixing processes (Fang and Stefan -1996), +where :math:`\kappa _{e}` is due to wind-driven eddies +(:ref:`Hostetler and Bartlein (1990)`), +:math:`K_{ed}` is a modest enhanced diffusivity +intended to represent unresolved mixing processes +(:ref:`Fang and Stefan 1996`), :math:`\kappa _{m} =\frac{\lambda _{liq} }{c_{liq} \rho _{liq} }` \ is the molecular diffusivity of water (given by the ratio of its thermal conductivity (W m\ :sup:`-1` K\ :sup:`-1`) to the product of its heat capacity (J kg\ :sup:`-1` K\ :sup:`-1`) and density -(kg m\ :sup:`-3`), values given in Table 2.6), and :math:`m_{d}` +(kg m\ :sup:`-3`), values given in :numref:`Table Physical Constants`), and :math:`m_{d}` (unitless) is a factor which increases the overall diffusivity for large lakes, intended to represent 3-dimensional mixing processes such as caused by horizontal temperature gradients. As currently implemented, .. math:: - :label: 12.30) + :label: 12.30 m_{d} =\left\{\begin{array}{l} {1,\qquad d<25{\rm m}} \\ {10,\qquad d\ge 25{\rm m}} \end{array}\right\} @@ -626,7 +612,7 @@ where *d* is the lake depth. The wind-driven eddy diffusion coefficient :math:`\kappa _{e,\, i}` (m\ :sup:`2` s\ :sup:`-1`) for layers :math:`1\le i\le N_{levlak}` is .. math:: - :label: 12.31) + :label: 12.31 \kappa _{e,\, i} =\left\{\begin{array}{l} {\frac{kw^{*} z_{i} }{P_{0} \left(1+37Ri^{2} \right)} \exp \left(-k^{*} z_{i} \right)\qquad T_{g} >T_{f} } \\ {0\qquad T_{g} \le T_{f} } \end{array}\right\} @@ -637,44 +623,45 @@ velocity (m s\ :sup:`-1`) is :math:`w^{*} =0.0012u_{2}` , and :math:`k^{*} =6.6u_{2}^{-1.84} \sqrt{\left|\sin \phi \right|}` . For the bottom layer, :math:`\kappa _{e,\, N_{levlak} } =\kappa _{e,N_{levlak} -1\, }` . As in -Hostetler and Bartlein (1990), the 2-m wind speed :math:`u_{2}` (m -s\ :sup:`-1`) (eq. ) is used to evaluate :math:`w^{*}` and -:math:`k^{*}` rather than the 10-m wind used by Henderson-Sellers -(1985). +:ref:`Hostetler and Bartlein (1990)`, +the 2-m wind speed :math:`u_{2}` (m s\ :sup:`-1`) (eq. ) is used to evaluate +:math:`w^{*}` and :math:`k^{*}` rather than the 10-m wind used by +:ref:`Henderson-Sellers (1985) `. + The Richardson number is .. math:: - :label: 12.32) + :label: 12.32 R_{i} =\frac{-1+\sqrt{1+\frac{40N^{2} k^{2} z_{i}^{2} }{w^{*^{2} } \exp \left(-2k^{*} z_{i} \right)} } }{20} where .. math:: - :label: ZEqnNum230908 + :label: 12.33 N^{2} =\frac{g}{\rho _{i} } \frac{\partial \rho }{\partial z} and :math:`g` is the acceleration due to gravity (m s\ :sup:`-2`) -(Table 2.6), :math:`\rho _{i}` is the density of water (kg +(:numref:`Table Physical Constants`), :math:`\rho _{i}` is the density of water (kg m\ :sup:`-3`), and :math:`\frac{\partial \rho }{\partial z}` is approximated as :math:`\frac{\rho _{i+1} -\rho _{i} }{z_{i+1} -z_{i} }` . Note that -because here, *z* is increasing downwards (unlike in Hostetler and -Bartlein (1990)), eq. contains no negative sign; this is a correction -from CLM4. The density of water is (Hostetler and Bartlein 1990) +because here, *z* is increasing downwards (unlike in :ref:`Hostetler and Bartlein (1990)`), eq. contains no negative sign; this is a correction +from CLM4. The density of water is +(:ref:`Hostetler and Bartlein (1990)`) .. math:: - :label: 12.34) + :label: 12.34 \rho _{i} =1000\left(1-1.9549\times 10^{-5} \left|T_{i} -277\right|^{1.68} \right). -The enhanced diffusivity :math:`K_{ed}` is given by (Fang and Stefan -1996) +The enhanced diffusivity :math:`K_{ed}` is given by +(:ref:`Fang and Stefan 1996`) .. math:: - :label: ZEqnNum809542 + :label: 12.35 K_{ed} =1.04\times 10^{-8} \left(N^{2} \right)^{-0.43} ,N^{2} \ge 7.5\times 10^{-5} {\rm s}^{2} @@ -686,7 +673,7 @@ The thermal conductivity for the liquid water portion of lake body layer given by .. math:: - :label: 12.36) + :label: 12.36 \tau _{liq,i} =K_{W} c_{liq} \rho _{liq} . @@ -695,11 +682,11 @@ The thermal conductivity of the ice portion of lake body layer *i*, constant among layers, and is given by .. math:: - :label: 12.37) + :label: 12.37 \tau _{ice,eff} =\tau _{ice} \frac{\rho _{ice} }{\rho _{liq} } -where :math:`\tau _{ice}` \ (Table 2.6) is the nominal thermal +where :math:`\tau _{ice}` \ (:numref:`Table Physical Constants`) is the nominal thermal conductivity of ice: :math:`\tau _{ice,eff}` \ is adjusted for the fact that the nominal model layer thicknesses remain constant even while the physical ice thickness exceeds the water thickness. @@ -710,15 +697,15 @@ and water fractions, assuming that they will be physically vertically stacked, and is given by .. math:: - :label: 12.38) + :label: 12.38 \tau _{i} =\frac{\tau _{ice,eff} \tau _{liq,i} }{\tau _{liq,i} I_{i} +\tau _{ice} \left(1-I_{i} \right)} . The thermal conductivity of snow, soil, and bedrock layers above and below the lake, respectively, are computed identically to those for -vegetated land units (Chapter 6), except for the adjustment of thermal -conductivity for frost heave or excess ice (Subin et al., 2012a, -Supporting Information). +vegetated land units (Chapter :numref:`rst_Soil and Snow Temperatures`), except for the adjustment of thermal +conductivity for frost heave or excess ice (:ref:`Subin et al., 2012a, +Supporting Information`). .. _Radiation Penetration: @@ -727,7 +714,7 @@ Radiation Penetration If there are no resolved snow layers, the surface absorption fraction :math:`\beta` is set according to the near-infrared fraction simulated by the atmospheric model. This is apportioned to the surface energy -budget (section 9.4.2), and thus no additional radiation is absorbed in +budget (section :numref:`Surface Properties Lake`), and thus no additional radiation is absorbed in the top :math:`z_{a}` (currently 0.6 m) of unfrozen lakes, for which the light extinction coefficient :math:`\eta` (m\ :sup:`-1`) varies between lake columns (eq. ). For frozen lakes @@ -735,7 +722,7 @@ varies between lake columns (eq. ). For frozen lakes radiation that is not apportioned to the surface energy budget is absorbed in the top lake body layer. This is a simplification, as lake ice is partially transparent. If there are resolved snow layers, then -the snow optics submodel (Chapter 3) is used to calculate the snow layer +the snow optics submodel (Chapter :numref:`rst_Surface Albedos`) is used to calculate the snow layer absorption (except for the absorption predicted for the top layer by the snow optics submodel, which is assigned to the surface energy budget), with the remainder penetrating snow layers absorbed in the top lake body @@ -745,7 +732,7 @@ For unfrozen lakes, the solar radiation remaining at depth :math:`z>z_{a}` in the lake body is given by .. math:: - :label: 12.39) + :label: 12.39 \phi =\left(1-\beta \vec{S}_{g} \right)\exp \left\{-\eta \left(z-z_{a} \right)\right\} . @@ -753,7 +740,7 @@ For all lake body layers, the flux absorbed by the layer *i*, :math:`\phi _{i}` , is .. math:: - :label: 12.40) + :label: 12.40 \phi _{i} =\left(1-\beta \vec{S}_{g} \right)\left[\exp \left\{-\eta \left(z_{i} -\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}-\exp \left\{-\eta \left(z_{i} +\frac{\Delta z_{i} }{2} -z_{a} \right)\right\}\right] . @@ -763,11 +750,11 @@ The remaining flux exiting the bottom of layer :math:`i=N_{levlak}` is absorbed in the top soil layer. The light extinction coefficient :math:`\eta` (m\ :sup:`-1`), if -not provided as external data, is a function of depth *d* (m) (Subin et -al. 2012a): +not provided as external data, is a function of depth *d* (m) +(:ref:`Subin et al. (2012a) `): .. math:: - :label: ZEqnNum284649 + :label: 12.41 \eta =1.1925d^{-0.424} . @@ -781,7 +768,7 @@ The vertically-integrated heat capacity for each lake layer, water and ice fractions: .. math:: - :label: 12.42) + :label: 12.42 c_{v,i} =\Delta z_{i} \rho _{liq} \left[c_{liq} \left(1-I_{i} \right)+c_{ice} I_{i} \right] . @@ -790,7 +777,7 @@ as the thickness of the layer is fixed. The total heat capacity :math:`c_{v,i}` for each soil, snow, and bedrock layer (J m\ :sup:`-2`) is determined as for vegetated land -units (Chapter 6), as the sum of the heat capacities for the water, ice, +units (Chapter :numref:`rst_Soil and Snow Temperatures`), as the sum of the heat capacities for the water, ice, and mineral constituents. .. _Crank-Nicholson Solution Lake: @@ -799,8 +786,9 @@ Crank-Nicholson Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The solution method for thermal diffusion is similar to that used for -soil (Chapter 6), except that the lake body layers are sandwiched -between the snow and soil layers (section 9.5.1), and radiation flux is +soil (Chapter :numref:`rst_Soil and Snow Temperatures`), except that the +lake body layers are sandwiched between the snow and soil layers +(section :numref:`Introduction Lake`), and radiation flux is absorbed throughout the lake layers. Before solution, layer temperatures :math:`T_{i}` (K), thermal conductivities :math:`\tau _{i}` (W m\ :sup:`-1` K\ :sup:`-1`), heat capacities :math:`c_{v,i}` @@ -812,7 +800,7 @@ calculated as the harmonic mean of the conductivities of the neighboring layers: .. math:: - :label: 12.43) + :label: 12.43 \lambda _{i} =\frac{\tau _{i} \tau _{i+1} \left(z_{i+1} -z_{i} \right)}{\tau _{i} \left(z_{i+1} -\hat{z}_{i} \right)+\tau _{i+1} \left(\hat{z}_{i} -z_{i} \right)} , @@ -824,7 +812,7 @@ between lake and soil. The governing equation is discretized for each layer as .. math:: - :label: ZEqnNum991615 + :label: 12.44 \frac{c_{v,i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=F_{i-1} -F_{i} +\phi _{i} @@ -838,18 +826,19 @@ Eq. is solved using the semi-implicit Crank-Nicholson Method, resulting in a tridiagonal system of equations: .. math:: - :label: 12.45) + :label: 12.45 \begin{array}{l} {r_{i} =a_{i} T_{i-1}^{n+1} +b_{i} T_{i}^{n+1} +cT_{i+1}^{n+1} ,} \\ {a_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } ,} \\ {b_{i} =1+0.5\frac{\Delta t}{c_{v,i} } \left(\frac{\partial F_{i-1} }{\partial T_{i-1}^{n} } +\frac{\partial F_{i} }{\partial T_{i}^{n} } \right),} \\ {c_{i} =-0.5\frac{\Delta t}{c_{v,i} } \frac{\partial F_{i} }{\partial T_{i}^{n} } ,} \\ {r_{i} =T_{i}^{n} +0.5\frac{\Delta t}{c_{v,i} } \left(F_{i-1} -F_{i} \right)+\frac{\Delta t}{c_{v,i} } \phi _{i} .} \end{array} The fluxes :math:`F_{i}` are defined as follows: for the top layer, :math:`F_{j_{top} -1} =2G;a_{j_{top} } =0`, where *G* is defined as in -section 9.4.3 (the factor of 2 merely cancels out the Crank-Nicholson -0.5 in the equation for :math:`r_{j_{top} }` ). For the bottom layer, -:math:`F_{N_{levlak} +N_{levgrnd} } =0`. For all other layers: +section :numref:`Boundary Conditions Lake` (the factor of 2 merely cancels +out the Crank-Nicholson 0.5 in the equation for :math:`r_{j_{top} }` ). +For the bottom layer, :math:`F_{N_{levlak} +N_{levgrnd} } =0`. +For all other layers: .. math:: - :label: 12.46) + :label: 12.46 F_{i} =\lambda _{i} \frac{T_{i} ^{n} -T_{i+1}^{n} }{z_{n+1} -z_{n} } . @@ -859,7 +848,7 @@ Phase Change ^^^^^^^^^^^^^^^^^^ Phase change in the lake, snow, and soil is done similarly to that done -for the soil and snow for vegetated land units (Chapter 6), except +for the soil and snow for vegetated land units (Chapter :numref:`rst_Soil and Snow Temperatures`), except without the allowance for freezing point depression in soil underlying lakes. After the heat diffusion is calculated, phase change occurs in a given layer if the temperature is below freezing and liquid water @@ -869,29 +858,30 @@ If melting occurs, the available energy for melting, :math:`Q_{avail}` (J m\ :sup:`-2`), is computed as .. math:: - :label: ZEqnNum598199 + :label: 12.47 Q_{avail} =\left(T_{i} -T_{f} \right)c_{v,i} where :math:`T_{i}` is the temperature of the layer after thermal -diffusion (section 9.5.7), and :math:`c_{v,i}` \ is as calculated in -section 9.5.6. The mass of melt in the layer *M* (kg m\ :sup:`-2`) -is given by +diffusion (section :numref:`Crank-Nicholson Solution Lake`), and +:math:`c_{v,i}` \ is as calculated in section +:numref:`Heat Capacities Lake`. The mass of melt in the layer *M* +(kg m\ :sup:`-2`) is given by .. math:: - :label: 12.48) + :label: 12.48 M=\min \left\{M_{ice} ,\frac{Q_{avail} }{H_{fus} } \right\} where :math:`H_{fus}` (J kg\ :sup:`-1`) is the latent heat of -fusion of water (Table 2.6), and :math:`M_{ice}` is the mass of ice in +fusion of water (:numref:`Table Physical Constants`), and :math:`M_{ice}` is the mass of ice in the layer: :math:`I_{i} \rho _{liq} \Delta z_{i}` for a lake body layer, or simply the soil / snow ice content state variable (:math:`w_{ice}` ) for a soil / snow layer. The heat remainder, :math:`Q_{rem}` \ is given by .. math:: - :label: ZEqnNum889387 + :label: 12.49 Q_{rem} =Q_{avail} -MH_{fus} . @@ -900,7 +890,7 @@ downwards by :math:`M`, and the temperature :math:`T_{i}` of the layer is adjusted to .. math:: - :label: ZEqnNum926437 + :label: 12.50 T_{i} =T_{f} +\frac{Q_{rem} }{c'_{v,i} } @@ -910,7 +900,7 @@ If freezing occurs, :math:`Q_{avail}` is again given by but will be negative. The melt :math:`M`, also negative, is given by .. math:: - :label: 12.51) + :label: 12.51 M=\max \left\{-M_{liq} ,\frac{Q_{avail} }{H_{fus} } \right\} @@ -937,7 +927,8 @@ maintaining constant density. Convection ^^^^^^^^^^^^^^^^ -Convective mixing is based on Hostetler et al.’s (1993, 1994) coupled +Convective mixing is based on +:ref:`Hostetler et al.’s (1993, 1994)` coupled lake-atmosphere model, adjusting the lake temperature after diffusion and phase change to maintain a stable density profile. Unfrozen lakes overturn when :math:`\rho _{i} >\rho _{i+1}` , in which case the layer @@ -946,9 +937,11 @@ applied to layers 1 to :math:`i+1` and the densities are updated. This scheme is applied iteratively to layers :math:`1\le i`), as occasionally +these can be induced by +heat expelled from the sediments (not present in the original +:ref:`Hostetler et al. (1994)` model). Mixing proceeds +from the bottom upward in this case (i.e., first mixing layers :math:`i=N_{levlak} -1` and :math:`i=N_{levlak}` , then checking :math:`i=N_{levlak} -2` and :math:`i=N_{levlak} -1` and mixing down to :math:`i=N_{levlak}` if @@ -963,14 +956,14 @@ When this occurs, these two lake layers and all those above mix. Total enthalpy *Q* is conserved as .. math:: - :label: 12.52) + :label: 12.52 Q=\sum _{j=1}^{i+1}\Delta z_{j} \rho _{liq} \left(T_{j} -T_{f} \right)\left[\left(1-I_{j} \right)c_{liq} +I_{j} c_{ice} \right] . Once the average ice fraction :math:`I_{av}` is calculated from .. math:: - :label: 12.53) + :label: 12.53 \begin{array}{l} {I_{av} =\frac{\sum _{j=1}^{i+1}I_{j} \Delta z_{j} }{Z_{i+1} } ,} \\ {Z_{i+1} =\sum _{j=1}^{i+1}\Delta z_{j} ,} \end{array} @@ -988,7 +981,7 @@ If :math:`Q > 0`, then :math:`T_{froz} =T_{f}` , and :math:`T_{unfr}` is given by .. math:: - :label: 12.54) + :label: 12.54 T_{unfr} =\frac{Q}{\rho _{liq} Z_{i+1} \left[\left(1-I_{av} \right)c_{liq} \right]} +T_{f} . @@ -996,7 +989,7 @@ If :math:`Q < 0`, then :math:`T_{unfr} =T_{f}` , and :math:`T_{froz}` is given by .. math:: - :label: 12.55) + :label: 12.55 T_{froz} =\frac{Q}{\rho _{liq} Z_{i+1} \left[I_{av} c_{ice} \right]} +T_{f} . @@ -1015,7 +1008,7 @@ to *i* + 1, the ice fraction and temperature are set as follows, where by the heat capacity of the layer to yield .. math:: - :label: 12.56) + :label: 12.56 T_{j} =\frac{T_{froz} I_{j} c_{ice} +T_{unfr} \left(1-I_{j} \right)c_{liq} }{I_{j} c_{ice} +\left(1-I_{j} \right)c_{liq} } . @@ -1031,12 +1024,12 @@ re-written to yield the total enthalpy of the lake system (J m\ :sup:`-2`) :math:`H_{tot}` : .. math:: - :label: 12.57) + :label: 12.57 H_{tot} =\sum _{i=j_{top} }^{N_{levlak} +N_{levgrnd} }\left[c_{v,i} \left(T_{i} -T_{f} \right)+M_{liq,i} H_{fus} \right] -W_{sno,bulk} H_{fus} where :math:`M_{liq,i}` is the water mass of the *i*\ th layer (similar -to section 9.5.8), and :math:`W_{sno,bulk}` is the mass of snow-ice not +to section :numref:`Phase Change Lake`), and :math:`W_{sno,bulk}` is the mass of snow-ice not present in resolved snow layers. This expression is evaluated once at the beginning and once at the end of the timestep (re-evaluating each :math:`c_{v,i}` ), and the change is compared with the net surface @@ -1044,7 +1037,7 @@ energy flux to yield the error flux :math:`E_{soi}` (W m\ :sup:`-2`): .. math:: - :label: 12.58) + :label: 12.58 E_{soi} =\frac{\Delta H_{tot} }{\Delta t} -G-\sum _{i=j_{top} }^{N_{levlak} +N_{levgrnd} }\phi _{i} @@ -1074,7 +1067,8 @@ There are some modifications to the soil and snow parameterizations as compared with the soil in vegetated land units, or the snow overlying other impervious columns. The soil can freeze or thaw, with the allowance for frost heave (or the initialization of excess ice) -(sections 9.5.4 and 9.5.8), but no air-filled pore space is allowed in +(sections :numref:`Eddy Diffusivity and Thermal Conductivities` and +:numref:`Phase Change Lake`), but no air-filled pore space is allowed in the soil. To preserve numerical stability in the lake model (which uses a slightly different surface flux algorithm than over other non-vegetated land units), two changes are made to the snow model. @@ -1094,7 +1088,7 @@ Water Balance The total water balance of the system is given by .. math:: - :label: ZEqnNum932128 + :label: 12.59 \Delta W_{sno} +\sum _{i=1}^{n_{levsoi} }\left(\Delta w_{liq,i} +\Delta w_{ice,i} \right) =\left(q_{rain} +q_{sno} -E_{g} -q_{rgwl} -q_{snwcp,\, ice} \right)\Delta t @@ -1103,10 +1097,10 @@ where :math:`W_{sno}` (kg m\ :sup:`-2`) is the total mass of snow :math:`w_{liq,i}` and :math:`w_{ice,i}` are the masses of water phases (kg m\ :sup:`-2`) in soil layer *i*, :math:`q_{rain}` and :math:`q_{sno}` are the precipitation forcing from the atmosphere (kg -m\ :sup:`-2` s\ :sup:`-1`), :math:`q_{snwcp,\, ice}` is the -ice runoff associated with snow-capping (below), :math:`E_{g}` is the -ground evaporation (section 9.4.3), and :math:`n_{levsoi}` is the -number of hydrologically active soil layers (as opposed to dry bedrock +m\ :sup:`-2` s\ :sup:`-1`), :math:`q_{snwcp,\, ice}` is the ice runoff +associated with snow-capping (below), :math:`E_{g}` is the ground +evaporation (section :numref:`Surface Flux Solution Lake`), and :math:`n_{levsoi}` +is the number of hydrologically active soil layers (as opposed to dry bedrock layers). .. _Precipitation, Evaporation, and Runoff Lake: @@ -1120,8 +1114,9 @@ As for other land types, incident snowfall accumulates (with ice mass exceeds a minimum thickness :math:`s_{\min }` , at which point a resolved snow layer is initiated, with water, ice, dissolved aerosol, snow-grain radius, etc., state variables tracked by the Snow Hydrology -submodel (section 7.2). The density of fresh snow is assigned as for -other land types (section 7.2). Solid precipitation is added immediately +submodel (Chapter :numref:`rst_Snow Hydrology`). The density of fresh snow is +assigned as for other land types (Chapter :numref:`rst_Snow Hydrology`). +Solid precipitation is added immediately to the snow, while liquid precipitation is added to snow layers, if they exist, after accounting for dew, frost, and sublimation (below). If :math:`z_{sno}` exceeds :math:`s_{\min }` after solid precipitation is @@ -1141,29 +1136,30 @@ water mass than it contains). If there are no resolved snow layers but given by .. math:: - :label: 12.60) + :label: 12.60 q_{sub,sno} =\min \left\{E_{g} ,\frac{W_{sno} }{\Delta t} \right\} . If :math:`E_{g} <0,T_{g} \le T_{f}` , and there are no resolved snow layers or the top snow layer is not unfrozen, then the rate of frost production :math:`q_{frost} =\left|E_{g} \right|`. If :math:`E_{g} <0` -but the top snow layer has completely thawed during the Phase Change -step of the Lake Temperature solution (section 9.5.8), then frost (or -dew) is not allowed to accumulate (:math:`q_{frost} =0`), to insure that -the layer is eliminated by the Snow Hydrology (section 7.2) code. (If -:math:`T_{g} >T_{f}` , then no snow is present (section 9.4.3), and +but the top snow layer has completely thawed during the Phase Change step +of the Lake Temperature solution (section :numref:`Phase Change Lake`), then +frost (or dew) is not allowed to accumulate (:math:`q_{frost} =0`), to +insure that the layer is eliminated by the Snow Hydrology +(Chapter :numref:`rst_Snow Hydrology`) code. (If :math:`T_{g} >T_{f}`, +then no snow is present (section :numref:`Surface Flux Solution Lake`), and evaporation or dew deposition is balanced by :math:`q_{rgwl}` .) The snowpack is updated for frost and sublimation: .. math:: - :label: 12.61) + :label: 12.61 W_{sno} =W_{sno} +\Delta t\left(q_{frost} -q_{sub,sno} \right) . -If there are resolved snow layers, then this update occurs using the -Snow Hydrology submodel (section 7.2). Otherwise, the snow ice mass is -updated directly, and :math:`z_{sno}` is adjusted by the same +If there are resolved snow layers, then this update occurs using the Snow +Hydrology submodel (Chapter :numref:`rst_Snow Hydrology`). Otherwise, the +snow ice mass is updated directly, and :math:`z_{sno}` is adjusted by the same proportion as the snow ice (i.e., maintaining the same density), unless there was no snow before adding the frost, in which case the density is assumed to be 250 kg m\ :sup:`-3`. @@ -1177,7 +1173,7 @@ The combined water and ice soil volume fraction in a soil layer :math:`\theta _{i}` is given by .. math:: - :label: 12.62) + :label: 12.62 \theta _{i} =\frac{1}{\Delta z_{i} } \left(\frac{w_{ice,i} }{\rho _{ice} } +\frac{w_{liq,i} }{\rho _{liq} } \right) . @@ -1186,7 +1182,7 @@ saturation (as may occur when ice melts), then the liquid water mass is adjusted to .. math:: - :label: 12.63) + :label: 12.63 w_{liq,i} =\left(\theta _{sat,i} \Delta z_{i} -\frac{w_{ice,i} }{\rho _{ice} } \right)\rho _{liq} . @@ -1195,7 +1191,7 @@ Otherwise, if excess ice is melting and water in the layer is reset to .. math:: - :label: 12.64) + :label: 12.64 w_{liq,i} = \theta _{sat,i} \rho _{liq} \Delta z_{i} @@ -1213,10 +1209,11 @@ adjusts the minimum resolved snow layer thickness for lake columns as compared to non-lake columns. The value of :math:`z_{lsa}` is chosen to satisfy the CFL condition for the model timestep. By default, :math:`\tilde{s}_{\min }` \ = 1 cm and :math:`s_{\min }` \ = 4 cm. See -Subin et al. (2012a; including Supporting Information) for further -discussion. +:ref:`Subin et al. (2012a; including Supporting Information)` +for further discussion. -The rules for combining and sub-dividing snow layers (section 7.2.7) are +The rules for combining and sub-dividing snow layers (section +:numref:`Snow Layer Combination and Subdivision`) are adjusted for lakes to maintain minimum thicknesses of :math:`s_{\min }` and to increase all target layer thicknesses by :math:`z_{lsa}` . The rules for combining layers are modified by simply increasing layer @@ -1234,5 +1231,5 @@ are performed. In rare instances, resolved snow layers may be present over an unfrozen top lake body layer. In this case, the snow layers may be eliminated if -enough heat is present in the top layer to melt the snow: see Subin et -al. (2012a, Supporting Information). +enough heat is present in the top layer to melt the snow: see +:ref:`Subin et al. (2012a, Supporting Information) `. diff --git a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst index c881a2c7c2..f78f464779 100644 --- a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst +++ b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst @@ -4,16 +4,19 @@ Methane Model ================= The representation of processes in the methane biogeochemical model -integrated in CLM [CLM4Me; (Riley et al. 2011a)] is based on several -previously published models (Cao et al. 1996; Petrescu et al. 2010; Tian -et al. 2010; Walter et al. 2001; Wania et al. 2010; Zhang et al. 2002; -Zhuang et al. 2004). Although the model has similarities with these -precursor models, a number of new process representations and +integrated in CLM [CLM4Me; (:ref:`Riley et al. 2011a`)] +is based on several previously published models +(:ref:`Cao et al. 1996`; :ref:`Petrescu et al. 2010`; +:ref:`Tianet al. 2010`; :ref:`Walter et al. 2001`; +:ref:`Wania et al. 2010`; :ref:`Zhang et al. 2002`; +:ref:`Zhuang et al. 2004`). Although the model has similarities +with these precursor models, a number of new process representations and parameterization have been integrated into CLM. -Mechanistically modeling net surface CH\ :sub:`4` emissions -requires representing a complex and interacting series of processes. We -first (section 19.1) describe the overall model structure and flow of +Mechanistically modeling net surface CH\ :sub:`4` emissions requires +representing a complex and interacting series of processes. We first +(section :numref:`Methane Model Structure and Flow`) describe the overall +model structure and flow of information in the CH\ :sub:`4` model, then describe the methods used to represent: CH\ :sub:`4` mass balance; CH\ :sub:`4` production; ebullition; aerenchyma transport; CH\ :sub:`4` @@ -22,6 +25,8 @@ numerical solution, water table interface, etc.; seasonal inundation effects; and impact of seasonal inundation on CH\ :sub:`4` production. +.. _Methane Model Structure and Flow: + Methane Model Structure and Flow ------------------------------------- @@ -36,17 +41,21 @@ fraction; performs a mass balance check; and calculates the average gridcell CH\ :sub:`4` production, oxidation, and exchanges with the atmosphere. +.. _Governing Mass-Balance Relationship: + Governing Mass-Balance Relationship ---------------------------------------- -The model (:numref:`Figure Methane Schematic`) accounts for CH\ :sub:`4` production in -the anaerobic fraction of soil (*P*, mol m\ :sup:`-3` s\ :sup:`-1`), ebullition (*E*, mol m\ :sup:`-3` s\ :sup:`-1`), -aerenchyma transport (*A*, mol m\ :sup:`-3` s\ :sup:`-1`), aqueous and gaseous diffusion (:math:`{F}_{D}`, -mol m\ :sup:`-2` s\ :sup:`-1`), and oxidation (*O*, mol m\ :sup:`-3` s\ :sup:`-1`) via a transient reaction +The model (:numref:`Figure Methane Schematic`) accounts for CH\ :sub:`4` +production in the anaerobic fraction of soil (*P*, mol m\ :sup:`-3` +s\ :sup:`-1`), ebullition (*E*, mol m\ :sup:`-3` s\ :sup:`-1`), +aerenchyma transport (*A*, mol m\ :sup:`-3` s\ :sup:`-1`), aqueous and +gaseous diffusion (:math:`{F}_{D}`, mol m\ :sup:`-2` s\ :sup:`-1`), and +oxidation (*O*, mol m\ :sup:`-3` s\ :sup:`-1`) via a transient reaction diffusion equation: .. math:: - :label: ZEqnNum628535 + :label: 24.1 \frac{\partial \left(RC\right)}{\partial t} =\frac{\partial F_{D} }{\partial z} +P\left(z,t\right)-E\left(z,t\right)-A\left(z,t\right)-O\left(z,t\right) @@ -84,9 +93,12 @@ into the inundated concentration when the inundated fraction increases. Schematic representation of biological and physical processes integrated in CLM that affect the net CH\ :sub:`4` - surface flux (:ref:`Riley et al. 2011a`). (left) Fully inundated portion of a + surface flux (:ref:`Riley et al. 2011a`). (left) + Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. +.. _CH4 Production: + CH\ :sub:`4` Production ---------------------------------- @@ -108,25 +120,25 @@ redox potential (:math:`f_{pE}`), and a factor accounting for the seasonal inundation fraction (*S*, described below): .. math:: - :label: ZEqnNum109798 + :label: 24.2 P=R_{H} f_{CH_{4} } f_{T} f_{pH} f_{pE} S. -Here, :math:`f_{CH_{4} }` is the baseline ratio between -CO\ :sub:`2` and CH\ :sub:`4` production (all parameters -values are given in :numref:`Table Methane Parameter descriptions`). Currently, :math:`f_{CH_{4} }` is -modified to account for our assumptions that methanogens may have a +Here, :math:`f_{CH_{4} }` is the baseline ratio between CO\ :sub:`2` +and CH\ :sub:`4` production (all parameters values are given in +:numref:`Table Methane Parameter descriptions`). Currently, :math:`f_{CH_{4} }` +is modified to account for our assumptions that methanogens may have a higher Q\ :math:`{}_{10}` than aerobic decomposers; are not N limited; and do not have a low-moisture limitation. -When the single BGC soil level is used in CLM (Chapter 15), the +When the single BGC soil level is used in CLM (Chapter :numref:`rst_Decomposition`), the temperature factor, :math:`f_{T}` , is set to 0 for temperatures equal to or below freezing, even though CLM allows heterotrophic respiration below freezing. However, if the vertically resolved BGC soil column is used, CH\ :sub:`4` production continues below freezing because liquid water stress limits decomposition. The base temperature for the -:math:`{Q}_{10}` factor, :math:`{T}_{B}`, is 22\ :sup:`o` C and effectively modified the base -:math:`f_{CH_{4}}` value. +:math:`{Q}_{10}` factor, :math:`{T}_{B}`, is 22\ :sup:`o` C and effectively +modified the base :math:`f_{CH_{4}}` value. For the single-layer BGC version, :math:`{R}_{H}` is distributed among soil levels by assuming that 50% is associated with the roots @@ -136,10 +148,11 @@ decomposition algorithm). For the vertically resolved BGC version, the prognosed distribution of :math:`{R}_{H}` is used to estimate CH\ :sub:`4` production. The factor :math:`f_{pH}` is nominally set to 1, although a static -spatial map of *pH* can be used to determine this factor (Dunfield et al. 1993) by applying: +spatial map of *pH* can be used to determine this factor +(:ref:`Dunfield et al. 1993`) by applying: .. math:: - :label: 24.3) + :label: 24.3 f_{pH} =10^{-0.2235pH^{2} +2.7727pH-8.6} . @@ -156,7 +169,7 @@ anoxic microsites above the water table, we apply the Arah and Stephen (1998) estimate of anaerobic fraction: .. math:: - :label: 24.4) + :label: 24.4 \varphi =\frac{1}{1+\eta C_{O_{2} } } . @@ -195,7 +208,7 @@ O\ :sub:`2` mass balance solution. +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ | | :math:`{C}_{e,min}` | 0.15 | NA | - | CH\ :sub:`4` concentration to end ebullition | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ - | Diffusion | :math:`f_{D_{0} }` | 1 | 1, 10 | m\ :sup:`2` s\ :sup:`-1` | Diffusion coefficient multiplier (Table 19.2) | + | Diffusion | :math:`f_{D_{0} }` | 1 | 1, 10 | m\ :sup:`2` s\ :sup:`-1` | Diffusion coefficient multiplier (Table 24.2) | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ | Aerenchyma | *p* | 0.3 | NA | - | Grass aerenchyma porosity | +--------------+----------------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------+---------------------------------------------+--------------------------------------------------------------------------------------------+ @@ -220,20 +233,21 @@ Briefly, the simulated aqueous CH\ :sub:`4` concentration in each soil level is used to estimate the expected equilibrium gaseous partial pressure (:math:`C_{e}` ), as a function of temperature and depth below the water table, by first estimating the Henry’s law partitioning -coefficient (:math:`k_{h}^{C}` ) by the method described in Wania et al. (2010): +coefficient (:math:`k_{h}^{C}` ) by the method described in +:ref:`Wania et al. (2010)`: .. math:: - :label: 24.5) + :label: 24.5 \log \left(\frac{1}{k_{H} } \right)=\log k_{H}^{s} -\frac{1}{C_{H} } \left(\frac{1}{T} -\frac{1}{T^{s} } \right) .. math:: - :label: ZEqnNum493232 + :label: 24.6 k_{h}^{C} =Tk_{H} R_{g} .. math:: - :label: 24.7) + :label: 24.7 C_{e} =\frac{C_{w} R_{g} T}{\theta _{s} k_{H}^{C} p} @@ -248,11 +262,14 @@ ponding (if applicable). When the CH\ :sub:`4` partial pressure exceeds 15% of the local pressure (Baird et al. 2004; Strack et al. 2006; Wania et al. 2010), bubbling occurs to remove CH\ :sub:`4` to below this value, modified by the fraction of CH\ :sub:`4` in -the bubbles [taken as 57%; (Kellner et al. 2006; Wania et al. 2010)]. +the bubbles [taken as 57%; (:ref:`Kellner et al. 2006`; +:ref:`Wania et al. 2010`)]. Bubbles are immediately added to the surface flux for saturated columns and are placed immediately above the water table interface in unsaturated columns. +.. _Aerenchyma Transport: + Aerenchyma Transport ------------------------- @@ -265,7 +282,7 @@ also occur, but we did not include that mechanism in the current model. The diffusive transport through aerenchyma (*A*, mol m\ :sup:`-2` s\ :sup:`-1`) from each soil layer is represented in the model as: .. math:: - :label: ZEqnNum158128 + :label: 24.8 A=\frac{C\left(z\right)-C_{a} }{{\raise0.7ex\hbox{$ r_{L} z $}\!\mathord{\left/ {\vphantom {r_{L} z D}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ D $}} +r_{a} } pT\rho _{r} , @@ -278,21 +295,20 @@ height (s m:sup:`-1`); and :math:`\rho _{r}` is the rooting density as a function of depth (-). The gaseous concentration is calculated with Henry’s law as described in equation . -Based on the ranges reported in Colmer (2003), we have chosen baseline -aerenchyma porosity values of 0.3 for grass and crop PFTs and 0.1 for +Based on the ranges reported in :ref:`Colmer (2003)`, we have chosen +baseline aerenchyma porosity values of 0.3 for grass and crop PFTs and 0.1 for tree and shrub PFTs. The aerenchyma area varies over the course of the growing season; we parameterize this dependency using the simulated leaf -area index *L* (m:sup:`2` m\ :sup:`-2`), as in Wania et al. -(2010): +area index *L* (m:sup:`2` m\ :sup:`-2`), as in :ref:`Wania et al. 2010`: .. math:: - :label: 24.9) + :label: 24.9 T=\frac{f_{N} N_{a} L}{0.22} \pi R^{2} . Here :math:`N_{a}` is annual net primary production (NPP, mol m\ :sup:`-2` s\ :sup:`-1`); *R* is the aerenchyma radius -(2.9:math:`\times`\ 10\ :sup:`-3` m); :math:`{f}_{N}` is the +(2.9 :math:`\times`\ 10\ :sup:`-3` m); :math:`{f}_{N}` is the belowground fraction of annual NPP; and the 0.22 factor represents the amount of C per tiller. O\ :sub:`2` can also diffuse in from the atmosphere to the soil layer via the reverse of the same pathway, with @@ -308,19 +324,21 @@ and the CLM predicted transpiration (:math:`F_{T}` ) for each PFT, assuming that no methane was oxidized inside the plant tissue: .. math:: - :label: 24.10) + :label: 24.10 F_{CH_{4} -T} =\sum _{j}\rho _{r,j} F_{T} C_{CH_{4} ,j} . +.. _CH4 Oxidation: + CH\ :sub:`4` Oxidation --------------------------------- CLM represents CH\ :sub:`4` oxidation with double Michaelis-Menten -kinetics (Arah and Stephen 1998; Segers 1998), dependent on both the -gaseous CH\ :sub:`4` and O\ :sub:`2` concentrations: +kinetics (:ref:`Arah and Stephen 1998`; :ref:`Segers 1998`), +dependent on both the gaseous CH\ :sub:`4` and O\ :sub:`2` concentrations: .. math:: - :label: 24.11) + :label: 24.11 R_{oxic} =R_{o,\max } \left[\frac{C_{CH_{4} } }{K_{CH_{4} } +C_{CH_{4} } } \right]\left[\frac{C_{O_{2} } }{K_{O_{2} } +C_{O_{2} } } \right]Q_{10} F_{\vartheta } @@ -332,23 +350,31 @@ m\ :sup:`-3` s\ :sup:`-1`); and :math:`{Q}_{10}` specifies the temperature dependence of the reaction with a base temperature set to 12 :sup:`o` C. The soil moisture limitation factor :math:`F_{\theta }` is applied above the water table to -represent water stress for methanotrophs. Based on the data in Schnell -and King (1996), we take :math:`F_{\theta } = {e}^{-P/{P}_{c}}`, where *P* is the soil moisture potential and -:math:`{P}_{c} = -2.4 \times {10}^{5}` mm. +represent water stress for methanotrophs. Based on the data in +:ref:`Schnell and King (1996)`, we take +:math:`F_{\theta } = {e}^{-P/{P}_{c}}`, where *P* is the soil moisture +potential and :math:`{P}_{c} = -2.4 \times {10}^{5}` mm. + +.. _Reactive Transport Solution: Reactive Transport Solution -------------------------------- The solution to equation is solved in several sequential steps: resolve competition for CH\ :sub:`4` and O\ :sub:`2` (section -19.7.1); add the ebullition flux into the layer directly above the water +:numref:`Competition for CH4and O2`); add the ebullition flux into the +layer directly above the water table or into the atmosphere; calculate the overall CH\ :sub:`4` or O\ :sub:`2` source term based on production, aerenchyma transport, ebullition, and oxidation; establish boundary conditions, including surface conductance to account for snow, ponding, and -turbulent conductances and bottom flux condition (section 19.7.2); -calculate diffusivity (section 19.7.3); and solve the resulting mass -balance using a tridiagonal solver (section 19.7.5). +turbulent conductances and bottom flux condition +(section :numref:`CH4 and O2 Source Terms`); calculate diffusivity +(section :numref:`Aqueous and Gaseous Diffusion`); and solve the resulting +mass balance using a tridiagonal solver (section +:numref:`Crank-Nicholson Solution Methane`). + +.. _Competition for CH4and O2: Competition for CH\ :sub:`4` and O\ :sub:`2` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -371,7 +397,9 @@ the concentrations are reset to zero; if it occurs for CH\ :sub:`4`, the surface flux is adjusted and the concentration is set to zero if the adjustment is not too large. -19.7.2 CH\ :sub:`4` and O\ :sub:`2` Source Terms +.. _CH4 and O2 Source Terms: + +CH\ :sub:`4` and O\ :sub:`2` Source Terms ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The overall CH\ :sub:`4` net source term consists of production, @@ -383,12 +411,17 @@ source term consists of O\ :sub:`2` losses from methanotrophy, SOM decomposition, and autotrophic respiration, and an O\ :sub:`2` source through aerenchyma. -19.7.3 Aqueous and Gaseous Diffusion +.. _Aqueous and Gaseous Diffusion: + +Aqueous and Gaseous Diffusion ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For gaseous diffusion, we adopted the temperature dependence of molecular free-air diffusion coefficients (:math:`{D}_{0}` -(m:sup:`2` s\ :sup:`-1`)) as described by Lerman et al. (1979) and applied by Wania et al. (2010) (:numref:`Table Temperature dependence of aqueous and gaseous diffusion`). +(m:sup:`2` s\ :sup:`-1`)) as described by +:ref:`Lerman (1979) ` and applied by +:ref:`Wania et al. (2010)` +(:numref:`Table Temperature dependence of aqueous and gaseous diffusion`). .. _Table Temperature dependence of aqueous and gaseous diffusion: @@ -403,26 +436,26 @@ molecular free-air diffusion coefficients (:math:`{D}_{0}` +----------------------------------------------------------+----------------------------------------------------------+--------------------------------------------------------+ Gaseous diffusivity in soils also depends on the molecular diffusivity, -soil structure, porosity, and organic matter content. Moldrup et al. -(2003), using observations across a range of unsaturated mineral soils, -showed that the relationship between effective diffusivity -(:math:`D_{e}` (m:sup:`2` s\ :sup:`-1`)) and soil +soil structure, porosity, and organic matter content. +:ref:`Moldrup et al. (2003)`, using observations across a +range of unsaturated mineral soils, showed that the relationship between +effective diffusivity (:math:`D_{e}` (m:sup:`2` s\ :sup:`-1`)) and soil properties can be represented as: .. math:: - :label: ZEqnNum730978 + :label: 24.12 D_{e} =D_{0} \theta _{a}^{2} \left(\frac{\theta _{a} }{\theta _{s} } \right)^{{\raise0.7ex\hbox{$ 3 $}\!\mathord{\left/ {\vphantom {3 b}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ b $}} } , where :math:`\theta _{a}` and :math:`\theta _{s}` are the air-filled and total (saturated water-filled) porosities (-), respectively, and *b* -is the slope of the water retention curve (-). However, Iiyama and -Hasegawa (2005) have shown that the original Millington-Quirk -(Millington and Quirk 1961) relationship matched measurements more -closely in unsaturated peat soils: +is the slope of the water retention curve (-). However, :ref:`Iiyama and +Hasegawa (2005)` have shown that the original Millington-Quirk +(:ref:`Millington and Quirk 1961`) relationship matched +measurements more closely in unsaturated peat soils: .. math:: - :label: ZEqnNum437147 + :label: 24.13 D_{e} =D_{0} \frac{\theta _{a} ^{{\raise0.7ex\hbox{$ 10 $}\!\mathord{\left/ {\vphantom {10 3}} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ 3 $}} } }{\theta _{s} ^{2} } @@ -431,24 +464,27 @@ and equation for soils with more than 130 kg m\ :sup:`-3` organic matter content. A linear interpolation between these two limits is applied for soils with SOM content below 130 kg m\ :sup:`-3`. For aqueous diffusion in the saturated part of the soil column, we applied -(Moldrup et al. 2003): +(:ref:`Moldrup et al. (2003)`): .. math:: - :label: 24.14) + :label: 24.14 D_{e} =D_{0} \theta _{s} ^{2} . To simplify the solution, we assumed that gaseous diffusion dominates above the water table interface and aqueous diffusion below the water table interface. Descriptions, baseline values, and dimensions for -parameters specific to the CH\ :sub:`4` model are given in Table -19.1. For freezing or frozen soils below the water table, diffusion is -limited to the remaining liquid (CLM allows for some freezing point -depression), and the diffusion coefficients are scaled by the +parameters specific to the CH\ :sub:`4` model are given in +:numref:`Table Methane Parameter descriptions`. For freezing or frozen +soils below the water table, diffusion is limited to the remaining +liquid (CLM allows for some freezing point depression), and the diffusion +coefficients are scaled by the volume-fraction of liquid. For unsaturated soils, Henry’s law equilibrium is assumed at the interface with the water table. -19.7.4 Boundary Conditions +.. _Boundary Conditions: + +Boundary Conditions ^^^^^^^^^^^^^^^^^^^^^^^^^^ We assume the CH\ :sub:`4` and O\ :sub:`2` surface fluxes @@ -458,7 +494,8 @@ the gaseous concentration in the first soil layer (unsaturated soils) or in equilibrium with the water (saturated soil\ :math:`w\left(C_{1}^{n} -C_{a} \right)` and :math:`w\left(C_{1}^{n+1} -C_{a} \right)` for the fully explicit and -fully implicit cases, respectively (however, see Tang and Riley (2013) +fully implicit cases, respectively (however, see +:ref:`Tang and Riley (2013)` for a more complete representation of this process). Here, *w* is the surface boundary layer conductance as calculated in the existing CLM surface latent heat calculations. If the top layer is not fully @@ -470,7 +507,7 @@ and if the top layer is saturated, this term is replaced with where :math:`{K}_{H}` is the Henry’s law equilibrium constant. When snow is present, a resistance is added to account for diffusion -through the snow based on the Millington-Quirk expression (equation ) +through the snow based on the Millington-Quirk expression :eq:`24.13` and CLM’s prediction of the liquid water, ice, and air fractions of each snow layer. When the soil is ponded, the diffusivity is assumed to be that of methane in pure water, and the resistance as the ratio of the @@ -478,15 +515,18 @@ ponding depth to diffusivity. The overall conductance is taken as the series combination of surface, snow, and ponding resistances. We assume a zero flux gradient at the bottom of the soil column. +.. _Crank-Nicholson Solution Methane: + Crank-Nicholson Solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Equation is solved using a Crank-Nicholson solution (Press et al. 1992), +Equation is solved using a Crank-Nicholson solution +(:ref:`Press et al. 1992`), which combines fully explicit and implicit representations of the mass balance. The fully explicit decomposition of equation can be written as .. math:: - :label: ZEqnNum395184 + :label: 24.15 \frac{R_{j}^{n+1} C_{j}^{n+1} -R_{j}^{n} C_{j}^{n} }{\Delta t} =\frac{1}{\Delta x_{j} } \left[\frac{D_{p1}^{n} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{n} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+S_{j}^{n} , @@ -506,14 +546,14 @@ Using an average of the fully implicit and fully explicit relationships gives: .. math:: - :label: ZEqnNum463314 + :label: 24.16 \begin{array}{l} {-\frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1}^{} } C_{j-1}^{n+1} +\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(\frac{D_{p1}^{} }{\Delta x_{p1}^{} } +\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \right)\right]C_{j}^{n+1} -\frac{1}{2\Delta x_{j} } \frac{D_{p1}^{} }{\Delta x_{p1}^{} } C_{j+1}^{n+1} =} \\ {\frac{R_{j}^{n} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1}^{} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1}^{} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right]} \end{array}, Equation is solved with a standard tridiagonal solver, i.e.: .. math:: - :label: 24.17) + :label: 24.17 aC_{j-1}^{n+1} +bC_{j}^{n+1} +cC_{j+1}^{n+1} =r, @@ -524,6 +564,8 @@ the diffusion solution and the time-varying aggregation over inundated and non-inundated areas strictly conserves methane molecules (except for production minus consumption) and carbon atoms. +.. _Interface between water table and unsaturated zone: + Interface between water table and unsaturated zone ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -538,7 +580,7 @@ soil element above the interface: .. math:: b=\left[\frac{R_{j}^{n+1} }{\Delta t} +\frac{1}{2\Delta x_{j} } \left(K_{H} \frac{D_{p1}^{} }{\Delta x_{p1} } +\frac{D_{m1}^{} }{\Delta x_{m1} } \right)\right] .. math:: - :label: 24.18) + :label: 24.18 r=\frac{R_{j}^{n} }{\Delta t} C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -K_{H} C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] @@ -549,18 +591,20 @@ and the soil element below the interface: .. math:: a=-K_{H} \frac{1}{2\Delta x_{j} } \frac{D_{m1}^{} }{\Delta x_{m1} } .. math:: - :label: 24.19) + :label: 24.19 r=\frac{R_{j}^{n} }{\Delta t} +C_{j}^{n} +\frac{1}{2\Delta x_{j} } \left[\frac{D_{p1}^{} }{\Delta x_{p1} } \left(C_{j+1}^{n} -C_{j}^{n} \right)-\frac{D_{m1}^{} }{\Delta x_{m1} } \left(C_{j}^{n} -K_{H} C_{j-1}^{n} \right)\right]+\frac{1}{2} \left[S_{j}^{n} +S_{j}^{n+1} \right] +.. _Inundated Fraction Prediction: + Inundated Fraction Prediction ---------------------------------- We developed a simplified dynamic representation of spatial inundation -based on recent work by Prigent et al. (2007), who described a +based on recent work by :ref:`Prigent et al. (2007)`, who described a multi-satellite approach to estimate the global monthly inundated fraction (:math:`{F}_{i}`) over an equal area grid -(0.25:math:`\circ`\ :math:`\times`\ 0.25\ :math:`\circ` at the equator) +(0.25 :math:`\circ` \ :math:`\times`\ 0.25\ :math:`\circ` at the equator) from 1993 - 2000. They suggested that the IGBP estimate for inundation could be used as a measure of sensitivity of their detection approach at low inundation. We therefore used the sum of their satellite-derived @@ -572,7 +616,7 @@ grid cell in a simple model based on simulated water table depth (:math:`{z}_{w}`) and surface runoff (:math:`{Q}_{r}` (mm s\ :sup:`-1`)): .. math:: - :label: 24.20) + :label: 24.20 f_{s} =P_{1} e^{{\raise0.7ex\hbox{$ -z_{w} $}\!\mathord{\left/ {\vphantom {-z_{w} p_{2} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ p_{2} $}} } +p_{3} Q_{r} . @@ -582,15 +626,18 @@ coarser simulations. We expect that ongoing work in the hydrology submodel of CLM will alleviate the need for this crude simplification of inundated fraction in future model versions. +.. _Seasonal Inundation: + Seasonal Inundation ------------------------ We have developed a simplified scaling factor to mimic the impact of seasonal inundation on CH\ :sub:`4` production (see appendix B in -Riley et al. (2011a) for a discussion of this simplified expression): +:ref:`Riley et al. (2011a)` for a discussion of this +simplified expression): .. math:: - :label: 24.21) + :label: 24.21 S=\frac{\beta \left(f-\bar{f}\right)+\bar{f}}{f} ,S\le 1. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 5c278d1e0f..dfe1f67abb 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1555,7 +1555,7 @@ Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity in soils and cultures to water stress. Applied and Environmental Microbiology 62:3203-3209. -.. _Segers, R., 1998. Methane production and methane consumption: a review +.. _Segers1998: Segers, R., 1998. Methane production and methane consumption: a review of processes underlying wetland methane fluxes. Biogeochemistry From 89a87adda6bdd1ac608ae1ad9b594ee9752d85f4 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 31 May 2017 14:01:49 -0600 Subject: [PATCH 034/730] update Dust chapter --- .../tech_note/Dust/CLM50_Tech_Note_Dust.rst | 106 ++++++++++-------- .../tech_note/Urban/CLM50_Tech_Note_Urban.rst | 6 +- 2 files changed, 62 insertions(+), 50 deletions(-) diff --git a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst index 2b3bfa6dd7..c40ac583f7 100644 --- a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst +++ b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst @@ -6,45 +6,48 @@ Dust Model Atmospheric dust is mobilized from the land by wind in the CLM. The most important factors determining soil erodibility and dust emission include the wind friction speed, the vegetation cover, and the soil moisture. -The CLM dust mobilization scheme (Mahowald et al. ** 2006) accounts for -these factors based on the DEAD (Dust Entrainment and Deposition) model -of Zender et al. (2003). Please refer to the Zender et al. ** (2003) -article for additional information regarding the equations presented in -this section. +The CLM dust mobilization scheme (:ref:`Mahowald et al. 2006`) +accounts for these factors based on the DEAD (Dust Entrainment and Deposition) +model of :ref:`Zender et al. (2003)`. Please refer to the +:ref:`Zender et al. (2003)` article for additional +information regarding the equations presented in this section. -The total vertical mass flux of dust, :math:`F_{j}` (kg m\ :sup:`-2` s\ :sup:`-1`), from the ground into transport -bin :math:`j` is given by +The total vertical mass flux of dust, :math:`F_{j}` +(kg m\ :sup:`-2` s\ :sup:`-1`), from the ground into transport bin +:math:`j` is given by .. math:: - :label: ZEqnNum146272 + :label: 29.1 F_{j} =TSf_{m} \alpha Q_{s} \sum _{i=1}^{I}M_{i,j} where :math:`T` is a global factor that compensates for the DEAD model’s sensitivity to horizontal and temporal resolution and equals 5 x 10\ :sup:`-4` in the CLM instead of 7 x 10\ :sup:`-4` in -Zender et al. (2003). :math:`S` is the source erodibility factor set to -1 in the CLM and serves as a place holder at this time. +:ref:`Zender et al. (2003)`. :math:`S` is the source +erodibility factor set to 1 in the CLM and serves as a place holder +at this time. The grid cell fraction of exposed bare soil suitable for dust mobilization :math:`f_{m}` is given by .. math:: - :label: 29.2) + :label: 29.2 f_{m} =\left(1-f_{lake} -f_{wetl} \right)\left(1-f_{sno} \right)\left(1-f_{v} \right)\frac{w_{liq,1} }{w_{liq,1} +w_{ice,1} } -where ** :math:`f_{lake}` and ** :math:`f_{wetl}` and :math:`f_{sno}` -are the CLM grid cell fractions of lake and wetland (section 2.2.3) and -snow cover (section 7.2.1), all ranging from zero to one. Not mentioned -by Zender et al. (2003), :math:`w_{liq,\, 1}` and +where :math:`f_{lake}` and :math:`f_{wetl}` and :math:`f_{sno}` +are the CLM grid cell fractions of lake and wetland (section +:numref:`Surface Data`) and snow cover (section +:numref:`Snow Covered Area Fraction`), all ranging from zero to one. Not mentioned +by :ref:`Zender et al. (2003)`, :math:`w_{liq,\, 1}` and :math:`{}_{w_{ice,\, 1} }` are the CLM top soil layer liquid water and ice contents (mm) entered as a ratio expressing the decreasing ability of dust to mobilize from increasingly frozen soil. The grid cell fraction of vegetation cover,\ :math:`{}_{f_{v} }`, is defined as .. math:: - :label: ZEqnNum242183 + :label: 29.3 0\le f_{v} =\frac{L+S}{\left(L+S\right)_{t} } \le 1{\rm \; \; \; \; where\; }\left(L+S\right)_{t} =0.3{\rm \; m}^{2} {\rm m}^{-2} @@ -52,34 +55,38 @@ where equation applies only for dust mobilization and is not related to the plant functional type fractions prescribed from the CLM input data or simulated by the CLM dynamic vegetation model (Chapter 22). :math:`L` and :math:`S` are the CLM leaf and stem area index values -(m:sup:`2` m\ :sup:`-2`) averaged at the land unit level so +(m :sup:`2` m\ :sup:`-2`) averaged at the land unit level so as to include all the pfts and the bare ground present in a vegetated land unit. :math:`L` and :math:`S` may be prescribed from the CLM -input data (section 2.1.4) or simulated by the CLM biogeochemistry model -(Chapter 13). +input data (section :numref:`Phenology and vegetation burial by snow`) +or simulated by the CLM biogeochemistry model (Chapter +:numref:`rst_Vegetation Phenology and Turnover`). -The sandblasting mass efficiency :math:`\alpha` (m:sup:`-1`) is +The sandblasting mass efficiency :math:`\alpha` (m :sup:`-1`) is calculated as .. math:: - :label: 29.4) + :label: 29.4 \alpha =100e^{\left(13.4M_{clay} -6.0\right)\ln 10} {\rm \; \; }\left\{\begin{array}{l} {M_{clay} =\% clay\times 0.01{\rm \; \; \; 0}\le \% clay\le 20} \\ {M_{clay} =20\times 0.01{\rm \; \; \; \; \; \; \; \; 20<\% }clay\le 100} \end{array}\right. where :math:`M_{clay}` is the mass fraction of clay particles in the soil and %clay is determined from the surface dataset -(section 2.2.3). :math:`M_{clay} =0` corresponds to sand and +(section :numref:`Surface Data`). :math:`M_{clay} =0` corresponds to sand and :math:`M_{clay} =0.2` to sandy loam. :math:`Q_{s}` is the total horizontally saltating mass flux (kg -m\ :sup:`-1` s\ :sup:`-1`) of “large†particles (Table -24.1), also referred to as the vertically integrated streamwise mass -flux +m\ :sup:`-1` s\ :sup:`-1`) of “large†particles (:numref:`Table Dust Mass fraction`), +also referred to as the vertically integrated streamwise mass flux .. math:: - :label: ZEqnNum832592 + :label: 29.5 - Q_{s} =\left\{\begin{array}{l} {\frac{c_{s} \rho _{atm} u_{*s}^{3} }{g} \left(1-\frac{u_{*t} }{u_{*s} } \right)\left(1+\frac{u_{*t} }{u_{*s} } \right)^{2} {\rm \; }\qquad {\rm for\; }u_{*t} w_{t} } \end{array}\right. where .. math:: - :label: 29.8) + :label: 29.8 w_{t} =a\left(0.17M_{clay} +0.14M_{clay}^{2} \right){\rm \; \; \; \; \; \; 0}\le M_{clay} =\% clay\times 0.01\le 1 and .. math:: - :label: 29.9) + :label: 29.9 w=\frac{\theta _{1} \rho _{liq} }{\rho _{d,1} } where :math:`a=M_{clay}^{-1}` for tuning purposes, :math:`\theta _{1}` is the volumetric soil moisture in the top soil -layer (m:math:`{}^{3 }`\ m\ :sup:`-3`) (section 7.4), +layer (m :math:`{}^{3 }`\ m\ :sup:`-3`) (section :numref:`Soil Water`), :math:`\rho _{liq}` is the density of liquid water (kg -m\ :sup:`-3`) (:numref:`Table Physical constants`), and :math:`\rho _{d,\, 1}` is the bulk -density of soil in the top soil layer (kg m\ :sup:`-3`) defined as -in section 6.3 rather than as in Zender et al. (2003). +m\ :sup:`-3`) (:numref:`Table Physical constants`), and :math:`\rho _{d,\, 1}` +is the bulk density of soil in the top soil layer (kg m\ :sup:`-3`) +defined as in section :numref:`Soil and Snow Thermal Properties` +rather than as in :ref:`Zender et al. (2003)`. :math:`Re_{*t}^{f}` from equation is the threshold friction Reynolds factor .. math:: - :label: 29.10) + :label: 29.10 Re_{*t}^{f} =\left\{\begin{array}{l} {\frac{0.1291^{2} }{-1+1.928Re_{*t} } {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; 0.03}\le Re_{*t} \le 10} \\ {0.12^{2} \left(1-0.0858e^{-0.0617(Re_{*t} -10)} \right)^{2} {\rm \; for\; }Re_{*t} >10} \end{array}\right. @@ -135,28 +143,32 @@ and :math:`Re_{*t}` is the threshold friction Reynolds number approximation for optimally sized particles .. math:: - :label: 29.11) + :label: 29.11 Re_{*t} =0.38+1331\left(100D_{osp} \right)^{1.56} -In equation , :math:`u_{*s}` ** is defined as the wind friction speed -(m s\ :sup:`-1`) accounting for the Owen effect (Owen 1964) +In :eq:`29.5` , :math:`u_{*s}` is defined as the wind friction speed +(m s\ :sup:`-1`) accounting for the Owen effect (:ref:`Owen 1964`) .. math:: - :label: 29.12) + :label: 29.12 - u_{\*s} =\left\{\begin{array}{l} {u_{\*} {\rm \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; \; for\; }U_{10} ` but here for 10 m above the ground, and :math:`U_{10,\, t}` is the threshold wind speed at 10 m (m s\ :sup:`-1`) .. math:: - :label: 29.13) + :label: 29.13 U_{10,t} =u_{*t} \frac{U_{10} }{u_{*} } @@ -165,7 +177,7 @@ In equation we sum :math:`M_{i,\, j}` over :math:`I=3` source modes mode :math:`i` carried in each of *:math:`J=4`* transport bins :math:`j` .. math:: - :label: 29.14) + :label: 29.14 M_{i,j} =\frac{m_{i} }{2} \left[{\rm erf}\left(\frac{\ln {\textstyle\frac{D_{j,\max } }{\tilde{D}_{v,i} }} }{\sqrt{2} \ln \sigma _{g,i} } \right)-{\rm erf}\left(\frac{\ln {\textstyle\frac{D_{j,\min } }{\tilde{D}_{v,i} }} }{\sqrt{2} \ln \sigma _{g,i} } \right)\right] @@ -174,7 +186,7 @@ where :math:`m_{i}` , :math:`\tilde{D}_{v,\, i}` , and and geometric standard deviation assigned to each particle source mode :math:`i` (:numref:`Table Dust Mass fraction`), while :math:`D_{j,\, \min }` and :math:`D_{j,\, \max }` are the minimum and maximum diameters (m) in -each transport bin :math:`j` ** (:numref:`Table Dust Minimum and maximum particle diameters`). +each transport bin :math:`j` (:numref:`Table Dust Minimum and maximum particle diameters`). .. _Table Dust Mass fraction: diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index 136272973d..4a6192aacb 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -18,7 +18,7 @@ gridcell according to density class. The urban landunit is based on the “urban canyon†concept of :ref:`Oke (1987) ` in which the canyon geometry is described by building height (:math:`H`) and street width (:math:`W`) -(:numref:`Figure schematic representation of urban`). The canyon system +(:numref:`Figure schematic representation of the urban landunit`). The canyon system consists of roofs, walls, and canyon floor. Walls are further divided into shaded and sunlit components. The canyon floor is divided into pervious (e.g., to represent residential @@ -28,7 +28,7 @@ pervious fraction; instead evaporation is parameterized by a simplified bulk scheme. Each of the five urban surfaces is treated as a column within the -landunit (:numref:`Figure schematic representation of urban`). +landunit (:numref:`Figure schematic representation of the urban landunit`). Radiation parameterizations account for trapping of solar and longwave radiation inside the canyon. Momentum fluxes are determined for the urban landunit using a roughness length and @@ -106,7 +106,7 @@ resolution. .. Figure 12.1. Schematic representation of the urban land unit -.. _Figure schematic representation of the urban land unit: +.. _Figure schematic representation of the urban landunit: .. figure:: image1.png From bcf269c2f8755f38a334dd00e4dad2c54b8846d7 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 1 Jun 2017 09:27:10 -0600 Subject: [PATCH 035/730] Update Chapter 6 --- .../CLM50_Tech_Note_Introduction.rst | 4 +- .../References/CLM50_Tech_Note_References.rst | 2 + ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 371 +++++++++++------- 3 files changed, 230 insertions(+), 147 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 9e6c3f2fd0..29892825d8 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -1,4 +1,4 @@ -**NCAR/TN-503+STR** +g**NCAR/TN-503+STR** **NCAR Technical Note** @@ -138,7 +138,7 @@ Jinyun Tang, Zong-Liang Yang** - :numref:`three layer snow pack` Example of three layer snow pack (snl=-3). -- :numref:`Figure Schematic representation of the urban land unit` Schematic representation of the urban land unit. +- :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. - :numref:`Figure Schematic of urban and atmospheric model coupling` Schematic of urban and atmospheric model coupling. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index dfe1f67abb..dfb4b81d9c 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1225,6 +1225,8 @@ Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. +.. _NiuYang2006: + Niu, G.-Y., and Yang, Z.-L. 2006. Effects of frozen soil on snowmelt runoff and soil water storage at a continental scale. J. Hydrometeor. 7:937-952. diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 0a7b941359..780ccb4752 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -6,7 +6,7 @@ Soil and Snow Temperatures The first law of heat conduction is .. math:: - :label: 6.1) + :label: 6.1 F=-\lambda \nabla T @@ -17,7 +17,7 @@ K\ :sup:`-1`), and :math:`\nabla T` is the spatial gradient of temperature (K m\ :sup:`-1`). In one-dimensional form .. math:: - :label: ZEqnNum105915 + :label: 6.2 F_{z} =-\lambda \frac{\partial T}{\partial z} @@ -27,7 +27,7 @@ non-steady or transient conditions, the principle of energy conservation in the form of the continuity equation is invoked as .. math:: - :label: ZEqnNum376834 + :label: 6.3 c\frac{\partial T}{\partial t} =-\frac{\partial F_{z} }{\partial z} @@ -37,7 +37,7 @@ Combining equations and yields the second law of heat conduction in one-dimensional form .. math:: - :label: 6.4) + :label: 6.4 c\frac{\partial T}{\partial t} =\frac{\partial }{\partial z} \left[\lambda \frac{\partial T}{\partial z} \right]. @@ -55,8 +55,9 @@ phase change and then readjusted for phase change (section :numref:`Phase Change Numerical Solution ---------------------- -The soil column is discretized into 25 layers (section :numref:`Vertical Discretization`) -where :math:`N_{levgrnd} = 25` is the number of soil layers (:numref:`Table Soil layer structure`). +The soil column is discretized into 25 layers (section +:numref:`Vertical Discretization`) where :math:`N_{levgrnd} = 25` is the +number of soil layers (:numref:`Table Soil layer structure`). The overlying snow pack is modeled with up to five layers depending on the total snow depth. The layers from top to bottom are indexed in the @@ -68,35 +69,88 @@ is the negative of the number of snow layers. The number of snow layers and the thickness of each layer is a function of snow depth :math:`z_{sno}` (m) as follows. -.. math:: \left\{\begin{array}{l} {snl=-1} \\ {\Delta z_{0} =z_{sno} \qquad {\rm for\; 0.01}\le {\rm z}_{{\rm sno}} \le 0.03} \end{array}\right\}, +.. math:: -.. math:: \left\{\begin{array}{l} {snl=-2} \\ {\Delta z_{-1} ={z_{sno} \mathord{\left/ {\vphantom {z_{sno} 2}} \right. \kern-\nulldelimiterspace} 2} \qquad {\rm for\; 0.03}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.04} \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, - -.. math:: \left\{\begin{array}{l} {snl=-2} \\ {\Delta z_{-1} =0.02\qquad {\rm for\; 0.04}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.07} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-1} } \end{array}\right\}, - -.. math:: \left\{\begin{array}{l} {snl=-3} \\ {\Delta z_{-2} =0.02} \\ {\Delta z_{-1} ={\left(z_{sno} -0.02\right)\mathord{\left/ {\vphantom {\left(z_{sno} -0.02\right) 2}} \right. \kern-\nulldelimiterspace} 2} \qquad {\rm for\; 0.07}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.12} \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, - -.. math:: \left\{\begin{array}{l} {snl=-3} \\ {\Delta z_{-2} =0.02} \\ {\Delta z_{-1} =0.05\qquad {\rm for\; 0.12}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.18} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}, - -.. math:: \left\{\begin{array}{l} {snl=-4} \\ {\Delta z_{-3} =0.02} \\ {\Delta z_{-2} =0.05\qquad {\rm for\; 0.18}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.29} \\ {\Delta z_{-1} ={\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, - -.. math:: \left\{\begin{array}{l} {snl=-4} \\ {\Delta z_{-3} =0.02} \\ {\Delta z_{-2} =0.05\qquad {\rm for\; 0.29}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.41} \\ {\Delta z_{-1} =0.11} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}, + \begin{array}{lr} -.. math:: \left\{\begin{array}{l} {snl=-5} \\ {\Delta z_{-4} =0.02} \\ {\Delta z_{-3} =0.05\qquad {\rm for\; 0.41}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.64} \\ {\Delta z_{-2} =0.11} \\ {\Delta z_{-1} ={\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \\ {\Delta z_{0} =\Delta z_{-1} } \end{array}\right\}, + \left\{ \begin{array}{l} + snl=-1 \\ + \Delta z_{0} = z_{sno} + \end{array} \right\} & \qquad {\rm for\; 0.01}\le {\rm z}_{{\rm sno}} \le 0.03 \\ + + \left\{ \begin{array}{l} + snl=-2 \\ + \Delta z_{-1} ={z_{sno} \mathord{\left/ {\vphantom {z_{sno} 2}} \right. \kern-\nulldelimiterspace} 2} \\ + \Delta z_{0} = \Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.03}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.04 \\ + + \left\{ \begin{array}{l} + snl=-2 \\ + \Delta z_{-1} = 0.02 \\ + \Delta z_{0} = z_{sno} -\Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.04}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.07 \\ + \left\{ \begin{array}{l} + snl=-3 \\ + \Delta z_{-2} = 0.02 \\ + \Delta z_{-1} = {\left(z_{sno} -0.02\right)\mathord{\left/ {\vphantom {\left(z_{sno} -0.02\right) 2}} \right. \kern-\nulldelimiterspace} 2} \\ + \Delta z_{0} = \Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.07}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.12 \\ + + \left\{ \begin{array}{l} + snl=-3 \\ + \Delta z_{-2} = 0.02 \\ + \Delta z_{-1} = 0.05 \\ + \Delta z_{0} = z_{sno} -\Delta z_{-2} -\Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.12}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.18 \\ + + \left\{ \begin{array}{l} + snl=-4 \\ + \Delta z_{-3} = 0.02 \\ + \Delta z_{-2} = 0.05 \\ + \Delta z_{-1} = {\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} \\ + \Delta z_{0} =\Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.18}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.29 \\ + + \left\{ \begin{array}{l} + snl=-4 \\ + \Delta z_{-3} = 0.02 \\ + \Delta z_{-2} = 0.05 \\ + \Delta z_{-1} = 0.11 \\ + \Delta z_{0} = z_{sno} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.29}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.41 \\ + + \left\{ \begin{array}{l} + snl=-5 \\ + \Delta z_{-4} = 0.02 \\ + \Delta z_{-3} = 0.05 \\ + \Delta z_{-2} = 0.11 \\ + \Delta z_{-1} = {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} \\ + \Delta z_{0} = \Delta z_{-1} + + \end{array} \right\} & \qquad {\rm for\; 0.41}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.64 \\ + + \left\{ \begin{array}{l} + snl=-5 \\ + \Delta z_{-4} = 0.02 \\ + \Delta z_{-3} = 0.05 \\ + \Delta z_{-2} = 0.11 \\ + \Delta z_{-1} = 0.23 \\ + \Delta z_{0} = z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} + \end{array} \right\} & \qquad {\rm for\; 0.64}\, {\rm <}\, {\rm z}_{{\rm sno}} -.. math:: \left\{\begin{array}{l} {snl=-5} \\ {\Delta z_{-4} =0.02} \\ {\Delta z_{-3} =0.05\qquad {\rm for\; 0.64}\, {\rm <}\, {\rm z}_{{\rm sno}} } \\ {\Delta z_{-2} =0.11} \\ {\Delta z_{-1} =0.23} \\ {\Delta z_{0} =z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} } \end{array}\right\}. + \end{array} The node depths, which are located at the midpoint of the snow layers, and the layer interfaces are both referenced from the soil surface and are defined as negative values .. math:: - :label: 6.8) + :label: 6.8 z_{i} =z_{h,\, i} -0.5\Delta z_{i} \qquad i=snl+1,\ldots ,0 .. math:: - :label: 6.9) + :label: 6.9 z_{h,\, i} =z_{h,\, i+1} -\Delta z_{i+1} \qquad i=snl,\ldots ,-1. @@ -118,7 +172,7 @@ The heat flux :math:`F_{i}` (W m\ :sup:`-2`) from layer :math:`i` to layer :math:`i+1` is .. math:: - :label: ZEqnNum443713 + :label: 6.10 F_{i} =-\lambda \left[z_{h,\, i} \right]\left(\frac{T_{i} -T_{i+1} }{z_{i+1} -z_{i} } \right) @@ -126,7 +180,7 @@ where the thermal conductivity at the interface :math:`\lambda \left[z_{h,\, i} \right]` is .. math:: - :label: ZEqnNum604125 + :label: 6.11 \lambda \left[z_{h,\, i} \right]=\left\{\begin{array}{l} {\frac{\lambda _{i} \lambda _{i+1} \left(z_{i+1} -z_{i} \right)}{\lambda _{i} \left(z_{i+1} -z_{h,\, i} \right)+\lambda _{i+1} \left(z_{h,\, i} -z_{i} \right)} \qquad i=snl+1,\ldots ,N_{levgrnd} -1} \\ {0\qquad i=N_{levgrnd} } \end{array}\right\}. @@ -138,7 +192,7 @@ equals the heat flux from the interface to :math:`i+1` (depth :math:`z_{i+1}` ), i.e., .. math:: - :label: ZEqnNum726244 + :label: 6.12 -\lambda _{i} \frac{T_{i} -T_{m} }{z_{h,\, i} -z_{i} } =-\lambda _{i+1} \frac{T_{m} -T_{i+1} }{z_{i+1} -z_{h,\, i} } @@ -164,7 +218,7 @@ interface of two layers The energy balance for the :math:`i^{th}` layer is .. math:: - :label: 6.13) + :label: 6.13 \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=-F_{i-1} +F_{i} @@ -176,7 +230,7 @@ method, which combines the explicit method with fluxes evaluated at fluxes evaluated at :math:`n+1` (:math:`F_{i-1}^{n+1} ,F_{i}^{n+1}` ) .. math:: - :label: 6.14) + :label: 6.14 \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=\alpha \left(-F_{i-1}^{n} +F_{i}^{n} \right)+\left(1-\alpha \right)\left(-F_{i-1}^{n+1} +F_{i}^{n+1} \right) @@ -184,7 +238,7 @@ where :math:`\alpha =0.5`, resulting in a tridiagonal system of equations .. math:: - :label: 6.15) + :label: 6.15 r_{i} =a_{i} T_{i-1}^{n+1} +b_{i} T_{i}^{n+1} +c_{i} T_{i+1}^{n+1} @@ -201,57 +255,57 @@ surface water layer, the heat flux from the overlying atmosphere is .. math:: - :label: 6.16) + :label: 6.16 h^{n+1} =-\alpha F_{i-1}^{n} -\left(1-\alpha \right)F_{i-1}^{n+1} . The energy balance for these layers is then .. math:: - :label: 6.17) + :label: 6.17 \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=h^{n+1} +\alpha F_{i}^{n} +\left(1-\alpha \right)F_{i}^{n+1} . The heat flux :math:`h` at :math:`n+1` may be approximated as follows .. math:: - :label: 6.18) + :label: 6.18 h^{n+1} =h^{n} +\frac{\partial h}{\partial T_{i} } \left(T_{i}^{n+1} -T_{i}^{n} \right). The resulting equations are then .. math:: - :label: ZEqnNum219926 + :label: 6.19 \begin{array}{rcl} {\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)} & {=} & {h^{n} +\frac{\partial h}{\partial T_{i} } \left(T_{i}^{n+1} -T_{i} \right)} \\ {} & {} & {-\alpha \frac{\lambda \left[z_{h,\, i} \right]\left(T_{i}^{n} -T_{i+1}^{n} \right)}{z_{i+1} -z_{i} } -\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i} \right]\left(T_{i}^{n+1} -T_{i+1}^{n+1} \right)}{z_{i+1} -z_{i} } } \end{array} For the top snow layer, :math:`i=snl+1`, the coefficients are .. math:: - :label: 6.20) + :label: 6.20 a_{i} =0 .. math:: - :label: 6.21) + :label: 6.21 b_{i} =1+\frac{\Delta t}{c_{i} \Delta z_{i} } \left[\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } -\frac{\partial h}{\partial T_{i} } \right] .. math:: - :label: 6.22) + :label: 6.22 c_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } .. math:: - :label: 6.23) + :label: 6.23 r_{i} =T_{i}^{n} +\frac{\Delta t}{c_{i} \Delta z_{i} } \left[h_{sno} ^{n} -\frac{\partial h}{\partial T_{i} } T_{i}^{n} +\alpha F_{i} \right] where .. math:: - :label: ZEqnNum455578 + :label: 6.24 F_{i} =-\lambda \left[z_{h,\, i} \right]\left(\frac{T_{i}^{n} -T_{i+1}^{n} }{z_{i+1} -z_{i} } \right). @@ -259,67 +313,72 @@ The heat flux into the snow surface from the overlying atmosphere :math:`h` is .. math:: - :label: 6.25) + :label: 6.25 h=\overrightarrow{S}_{sno} -\overrightarrow{L}_{sno} -H_{sno} -\lambda E_{sno} where :math:`\overrightarrow{S}_{sno}` is the solar radiation absorbed -by the top snow layer (section 3.2.1), :math:`\overrightarrow{L}_{sno}` +by the top snow layer (section :numref:`Snow Albedo`), :math:`\overrightarrow{L}_{sno}` is the longwave radiation absorbed by the snow (positive toward the -atmosphere) (section 4.2), :math:`H_{sno}` is the sensible heat flux -from the snow (Chapter 5), and :math:`\lambda E_{sno}` is the latent -heat flux from the snow (Chapter 5). The partial derivative of the heat -flux :math:`h` with respect to temperature is +atmosphere) (section :numref:`Longwave Fluxes`), :math:`H_{sno}` is the +sensible heat flux from the snow (Chapter +:numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), and +:math:`\lambda E_{sno}` is the latent heat flux from the snow (Chapter +:numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`). The partial +derivative of the heat flux :math:`h` with respect to temperature is .. math:: - :label: 6.26) + :label: 6.26 \frac{\partial h}{\partial T_{} } =-\frac{\partial \overrightarrow{L}_{} }{\partial T_{} } -\frac{\partial H_{} }{\partial T_{} } -\frac{\partial \lambda E_{} }{\partial T_{} } where the partial derivative of the net longwave radiation is .. math:: - :label: 6.27) + :label: 6.27 \frac{\partial \overrightarrow{L}_{} }{\partial T_{} } =4\varepsilon _{g} \sigma \left(T_{}^{n} \right)^{3} and the partial derivatives of the sensible and latent heat fluxes are given by equations and for non-vegetated surfaces, and by equations and for vegetated surfaces. :math:`\sigma` is the Stefan-Boltzmann constant -(W m\ :sup:`-2` K\ :sup:`-4`) (Table 2.6) and :math:`\varepsilon _{g}` is the ground emissivity (section 4.2). For -purposes of computing :math:`h` and :math:`\frac{\partial h}{\partial T_{g} }` , the term :math:`\lambda` +(W m\ :sup:`-2` K\ :sup:`-4`) (:numref:`Table Physical Constants`) and +:math:`\varepsilon _{g}` is the ground emissivity (section +:numref:`Longwave Fluxes`). For purposes of computing :math:`h` and +:math:`\frac{\partial h}{\partial T_{g} }` , the term :math:`\lambda` is arbitrarily assumed to be .. math:: - :label: 6.28) + :label: 6.28 \lambda =\left\{\begin{array}{l} {\lambda _{sub} \qquad {\rm if\; }w_{liq,\, snl+1} =0{\rm \; and\; }w_{ice,\, snl+1} >0} \\ {\lambda _{vap} \qquad {\rm otherwise}} \end{array}\right\} where :math:`\lambda _{sub}` and :math:`\lambda _{vap}` are the latent heat of sublimation and vaporization, respectively (J -kg\ :sup:`-1`) (Table 2.6), and :math:`w_{liq,\, snl+1}` and -:math:`w_{ice,\, snl+1}` are the liquid water and ice contents of the -top snow/soil layer, respectively (kg m\ :sup:`-2`) (Chapter 7). +kg\ :sup:`-1`) (:numref:`Table Physical Constants`), and :math:`w_{liq,\, snl+1}` +and :math:`w_{ice,\, snl+1}` are the liquid water and ice contents of the +top snow/soil layer, respectively (kg m\ :sup:`-2`) +(Chapter :numref:`rst_Hydrology`). For the top soil layer, :math:`i=1`, the coefficients are .. math:: - :label: 6.29) + :label: 6.29 a_{i} =-f_{sno} \left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } .. math:: - :label: 6.30) + :label: 6.30 b_{i} =1+\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \left[f_{sno} \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } +\frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \right]-\left(1-f_{sno} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} .. math:: - :label: 6.31) + :label: 6.31 c_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } .. math:: - :label: 6.32) + :label: 6.32 r_{i} =T_{i}^{n} +\frac{\Delta t}{c_{i} \Delta z_{i} } \left[\left(1-f_{sno} \right)\left(h_{soil} ^{n} -\frac{\partial h}{\partial T_{} } T_{i}^{n} \right)+\alpha \left(F_{i} -f_{sno} F_{i-1} \right)\right] @@ -327,7 +386,7 @@ The heat flux into the soil surface from the overlying atmosphere :math:`h` is .. math:: - :label: 6.33) + :label: 6.33 h=\overrightarrow{S}_{soil} -\overrightarrow{L}_{soil} -H_{soil} -\lambda E_{soil} @@ -345,13 +404,13 @@ for diurnal heating. The top layer thickness for :math:`i=snl+1` is given by .. math:: - :label: 6.34) + :label: 6.34 \Delta z_{i*} =0.5\left[z_{i} -z_{h,\, i-1} +c_{a} \left(z_{i+1} -z_{h,\, i-1} \right)\right] where :math:`c_{a}` is a tunable parameter, varying from 0 to 1, and is taken as 0.34 by comparing the numerical solution with the analytic -solution (Z.-L. Yang 1998, unpublished manuscript). +solution (:ref:`Z.-L. Yang 1998, unpublished manuscript`). :math:`\Delta z_{i*}` is used in place of :math:`\Delta z_{i}` for :math:`i=snl+1` in equations -. The top snow/soil layer temperature computed in this way is the ground surface temperature @@ -361,34 +420,34 @@ The boundary condition at the bottom of the snow/soil column is zero heat flux, :math:`F_{i} =0`, resulting in, for :math:`i=N_{levgrnd}` , .. math:: - :label: 6.35) + :label: 6.35 \frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=\alpha \frac{\lambda \left[z_{h,\, i-1} \right]\left(T_{i-1}^{n} -T_{i}^{n} \right)}{z_{i} -z_{i-1} } +\left(1-\alpha \right)\frac{\lambda \left[z_{h,\, i-1} \right]\left(T_{i-1}^{n+1} -T_{i}^{n+1} \right)}{z_{i} -z_{i-1} } .. math:: - :label: 6.36) + :label: 6.36 a_{i} =-\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } .. math:: - :label: 6.37) + :label: 6.37 b_{i} =1+\left(1-\alpha \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } .. math:: - :label: 6.38) + :label: 6.38 c_{i} =0 .. math:: - :label: 6.39) + :label: 6.39 r_{i} =T_{i}^{n} -\alpha \frac{\Delta t}{c_{i} \Delta z_{i} } F_{i-1} where .. math:: - :label: ZEqnNum768674 + :label: 6.40 F_{i-1} =-\frac{\lambda \left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \left(T_{i-1}^{n} -T_{i}^{n} \right). @@ -396,48 +455,48 @@ For the interior snow/soil layers, :math:`snl+1T_{f} {\rm \; and\; }w_{ice,\, i} >0 & \qquad i=snl+1,\ldots ,N_{levgrnd} \qquad {\rm melting} \end{array} + +.. math:: + :label: 6.53b - \begin{array}{l} {T_{i}^{n+1} >T_{f} {\rm \; and\; }w_{ice,\, i} >0\qquad i=snl+1,\ldots ,N_{levgrnd} \qquad {\rm melting}} \\ {T_{i}^{n+1} 0\qquad i=snl+1,\ldots ,0\qquad {\rm freezing}} \\ {T_{i}^{n+1} w_{liq,\, \max ,\, i} \qquad i=1,\ldots ,N_{levgrnd} \qquad {\rm freezing}} \end{array} + \begin{array}{lr} + \begin{array}{lr} + T_{i}^{n+1} 0 & \qquad i=snl+1,\ldots ,0 \\ + T_{i}^{n+1} w_{liq,\, \max ,\, i} & \quad i=1,\ldots ,N_{levgrnd} + \end{array} & \quad {\rm freezing} + \end{array} where :math:`T_{i}^{n+1}` is the soil layer temperature after solution of the tridiagonal equation set, :math:`w_{ice,\, i}` and :math:`w_{liq,\, i}` are the mass of ice and liquid water (kg -m\ :sup:`-2`) in each snow/soil layer, respectively, and -:math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). For -the freezing process in soil layers, the concept of supercooled soil -water from Niu and Yang (2006) is adopted. The supercooled soil water is -the liquid water that coexists with ice over a wide range of +m\ :sup:`-2`) in each snow/soil layer, respectively, and :math:`T_{f}` +is the freezing temperature of water (K) (:numref:`Table Physical Constants`). +For the freezing process in soil layers, the concept of supercooled soil +water from :ref:`Niu and Yang (2006)` is adopted. The supercooled +soil water is the liquid water that coexists with ice over a wide range of temperatures below freezing and is implemented through a freezing point depression equation .. math:: - :label: ZEqnNum547401 + :label: 6.54 w_{liq,\, \max ,\, i} =\Delta z_{i} \theta _{sat,\, i} \left[\frac{10^{3} L_{f} \left(T_{f} -T_{i} \right)}{gT_{i} \psi _{sat,\, i} } \right]^{{-1\mathord{\left/ {\vphantom {-1 B_{i} }} \right. \kern-\nulldelimiterspace} B_{i} } } \qquad T_{i} ` exponent +(section :numref:`Soil Water`). For the special case when snow is present (snow mass :math:`W_{sno} >0`) but there are no explicit snow layers (:math:`snl=0`) (i.e., there is @@ -521,38 +592,46 @@ The excess or deficit of energy :math:`H_{i}` (W m\ :sup:`-2`) is determined as follows .. math:: - :label: 6.55) + :label: 6.55 - H_{i} =\left\{\begin{array}{l} {\frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\qquad \quad \quad \quad i=snl+1} \\ {\left(1-f_{sno} -f_{h2osfc} \right)\frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\quad {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} i=1} \\ {-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\qquad \quad \quad \quad i\ne \left\{1,snl+1\right\}} \end{array}\right\}. + H_{i} =\left\{\begin{array}{lr} + \frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right) & \quad \quad i=snl+1 \\ + \left(1-f_{sno} -f_{h2osfc} \right)\frac{\partial h}{\partial T} \left(T_{f} -T_{i}^{n} \right)-\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right)\quad {\kern 1pt} {\kern 1pt} {\kern 1pt} {\kern 1pt} & i=1 \\ + -\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{f} -T_{i}^{n} \right) & \quad \quad i\ne \left\{1,snl+1\right\} + \end{array}\right\}. -If the melting criteria is met (equation ) and +If the melting criteria is met :eq:`6.53a` and :math:`H_{m} =\frac{H_{i} \Delta t}{L_{f} } >0`, then the ice mass is readjusted as .. math:: - :label: ZEqnNum547839 + :label: 6.56 w_{ice,\, i}^{n+1} =w_{ice,\, i}^{n} -H_{m} \ge 0\qquad i=snl+1,\ldots ,N_{levgrnd} . -If the freezing criteria is met (equation ) and :math:`H_{m} <0`, then +If the freezing criteria is met :eq:`6.53b` and :math:`H_{m} <0`, then the ice mass is readjusted for :math:`i=snl+1,\ldots ,0` as .. math:: - :label: 6.57) + :label: 6.57 w_{ice,\, i}^{n+1} =\min \left(w_{liq,\, i}^{n} +w_{ice,\, i}^{n} ,w_{ice,\, i}^{n} -H_{m} \right) and for :math:`i=1,\ldots ,N_{levgrnd}` as .. math:: - :label: 6.58) + :label: 6.58 - w_{ice,\, i}^{n+1} =\left\{\begin{array}{l} {\min \left(w_{liq,\, i}^{n} +w_{ice,\, i}^{n} -w_{liq,\, \max ,\, i}^{n} ,\, w_{ice,\, i}^{n} -H_{m} \right)\qquad w_{liq,\, i}^{n} +w_{ice,\, i}^{n} \ge w_{liq,\, \max ,\, i}^{n} {\rm \; }} \\ {{\rm 0}\qquad w_{liq,\, i}^{n} +w_{ice,\, i}^{n} 0`) as .. math:: - :label: ZEqnNum190862 + :label: 6.61 - T_{i}^{n+1} =\left\{\begin{array}{l} {T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} \qquad \quad \quad \quad \quad \quad \, i=snl+1} \\ {T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} \qquad i=1} \\ {T_{f} +\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \qquad \quad \quad \quad \quad \quad \, i\ne \left\{1,snl+1\right\}} \end{array}\right\}. + T_{i}^{n+1} = + \left\{\begin{array}{lr} + T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} & \quad \quad \quad \quad \, i=snl+1 \\ + T_{f} +{\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \mathord{\left/ {\vphantom {\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)}} \right. \kern-\nulldelimiterspace} \left(1-\left(1-f_{sno} -f_{h2osfc} \right)\frac{\Delta t}{c_{i} \Delta z_{i} } \frac{\partial h}{\partial T} \right)} & \qquad i=1 \\ + T_{f} +\frac{\Delta t}{c_{i} \Delta z_{i} } H_{i*} & \quad \quad \quad \quad \, i\ne \left\{1,snl+1\right\} + \end{array}\right\}. For the special case when snow is present (:math:`W_{sno} >0`), there are no explicit snow layers (:math:`snl=0`), and @@ -578,14 +662,14 @@ are no explicit snow layers (:math:`snl=0`), and :math:`W_{sno}` (kg m\ :sup:`-2`) is reduced according to .. math:: - :label: 6.62) + :label: 6.62 W_{sno}^{n+1} =W_{sno}^{n} -\frac{H_{1} \Delta t}{L_{f} } \ge 0. The snow depth is reduced proportionally .. math:: - :label: 6.63) + :label: 6.63 z_{sno}^{n+1} =\frac{W_{sno}^{n+1} }{W_{sno}^{n} } z_{sno}^{n} . @@ -593,7 +677,7 @@ Again, because part of the energy may not be consumed in melting, the energy for the surface soil layer :math:`i=1` is recalculated as .. math:: - :label: 6.64) + :label: 6.64 H_{1*} =H_{1} -\frac{L_{f} \left(W_{sno}^{n} -W_{sno}^{n+1} \right)}{\Delta t} . @@ -601,23 +685,23 @@ If there is excess energy (:math:`H_{1*} >0`), this energy becomes available to the top soil layer as .. math:: - :label: ZEqnNum985120 + :label: 6.65 H_{1} =H_{1*} . The ice mass, liquid water content, and temperature of the top soil -layer are then determined from equations , , and using the recalculated -energy from equation . Snow melt :math:`M_{1S}` (kg m\ :sup:`-2` -s\ :sup:`-1`) and phase change energy :math:`E_{p,\, 1S}` (W -m\ :sup:`-2`) for this special case are +layer are then determined from :eq:`6.56`, :eq:`6.59`, and :eq:`6.61` +using the recalculated energy from :eq:`6.65`. Snow melt :math:`M_{1S}` +(kg m\ :sup:`-2` s\ :sup:`-1`) and phase change energy :math:`E_{p,\, 1S}` +(W m\ :sup:`-2`) for this special case are .. math:: - :label: 6.66) + :label: 6.66 M_{1S} =\frac{W_{sno}^{n} -W_{sno}^{n+1} }{\Delta t} \ge 0 .. math:: - :label: 6.67) + :label: 6.67 E_{p,\, 1S} =L_{f} M_{1S} . @@ -625,14 +709,14 @@ The total energy of phase change :math:`E_{p}` (W m\ :sup:`-2`) for the snow/soil column is .. math:: - :label: 6.68) + :label: 6.68 E_{p} =E_{p,\, 1S} +\sum _{i=snl+1}^{N_{levgrnd} }E_{p,i} where .. math:: - :label: 6.69) + :label: 6.69 E_{p,\, i} =L_{f} \frac{\left(w_{ice,\, i}^{n} -w_{ice,\, i}^{n+1} \right)}{\Delta t} . @@ -640,25 +724,26 @@ The total snow melt :math:`M` (kg m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 6.70) + :label: 6.70 M=M_{1S} +\sum _{i=snl+1}^{i=0}M_{i} where .. math:: - :label: 6.71) + :label: 6.71 M_{i} =\frac{\left(w_{ice,\, i}^{n} -w_{ice,\, i}^{n+1} \right)}{\Delta t} \ge 0. The solution for snow/soil temperatures conserves energy as .. math:: - :label: 6.72) + :label: 6.72 G-E_{p} -\sum _{i=snl+1}^{i=N_{levgrnd} }\frac{c_{i} \Delta z_{i} }{\Delta t} \left(T_{i}^{n+1} -T_{i}^{n} \right)=0 -where :math:`G` is the ground heat flux (section 5.4). +where :math:`G` is the ground heat flux (section +:numref:`Update of Ground Sensible and Latent Heat Fluxes`). .. _Surface Water: @@ -670,7 +755,7 @@ temperature, :math:`T_{h2osfc}` , becomes less than :math:`T_{f}` . The energy available for freezing is .. math:: - :label: 6.73) + :label: 6.73 H_{h2osfc} =\frac{\partial h}{\partial T} \left(T_{f} -T_{h2osfc}^{n} \right)-\frac{c_{h2osfc} \Delta z_{h2osfc} }{\Delta t} \left(T_{f} -T_{h2osfc}^{n} \right) @@ -680,19 +765,19 @@ where :math:`c_{h2osfc}` is the volumetric heat capacity of water, and is removed from surface water and added to the snow column as ice .. math:: - :label: 6.74) + :label: 6.74 H^{n+1} _{h2osfc} =H^{n} _{h2osfc} -H_{m} .. math:: - :label: 6.75) + :label: 6.75 w_{ice,\, 0}^{n+1} =w_{ice,\, 0}^{n} +H_{m} The snow depth is adjusted to account for the additional ice mass .. math:: - :label: 6.76) + :label: 6.76 \Delta z_{sno} =\frac{H_{m} }{\rho _{ice} } @@ -711,7 +796,7 @@ the mineral and organic properties of the soil The soil layer organic matter fraction :math:`f_{om,i}` is .. math:: - :label: 6.77) + :label: 6.77 f_{om,i} =\rho _{om,i} /\rho _{om,\max } . @@ -719,7 +804,7 @@ Soil thermal conductivity :math:`\lambda _{i}` (W m\ :sup:`-1` K\ :sup:`-1`) is from :ref:`Farouki (1981) ` .. math:: - :label: 6.78) + :label: 6.78 \begin{array}{lr} \lambda _{i} = \left\{ @@ -741,18 +826,17 @@ ground layers (typical of saturated granitic rock; :ref:`Clauser and Huenges 1995 `). For glaciers and wetlands, .. math:: - :label: 6.79) + :label: 6.79 \lambda _{i} =\left\{\begin{array}{l} {\lambda _{liq,\, i} \qquad T_{i} \ge T_{f} } \\ {\lambda _{ice,\, i} \qquad T_{i} ` .. math:: - :label: 6.87) + :label: 6.87 \lambda _{i} =\lambda _{air} +\left(7.75\times 10^{-5} \rho _{sno,\, i} +1.105\times 10^{-6} \rho _{sno,\, i}^{2} \right)\left(\lambda _{ice} -\lambda _{air} \right) @@ -828,7 +912,7 @@ where :math:`\lambda _{air}` is the thermal conductivity of air (:numref:`Table and :math:`\rho _{sno,\, i}` is the bulk density of snow (kg m\ :sup:`-3`) .. math:: - :label: 6.88) + :label: 6.88 \rho _{sno,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{\Delta z_{i} } . @@ -837,7 +921,7 @@ soil is from :ref:`de Vries (1963) ` and depends on the heat capacities of the soil solid, liquid water, and ice constituents .. math:: - :label: ZEqnNum222806 + :label: 6.89 c_{i} =c_{s,\, i} \left(1-\theta _{sat,\, i} \right)+\frac{w_{ice,\, i} }{\Delta z_{i} } C_{ice} +\frac{w_{liq,\, i} }{\Delta z_{i} } C_{liq} @@ -847,7 +931,7 @@ and ice, respectively (:numref:`Table Physical Constants`). The heat capacity of :math:`c_{s,i}` \ (J m\ :sup:`-3` K\ :sup:`-1`) is .. math:: - :label: 6.90) + :label: 6.90 c_{s,i} =(1-f_{om,i} )c_{s,\min ,i} +f_{om,i} c_{s,om} @@ -855,7 +939,7 @@ where the heat capacity of mineral soil solids :math:`c_{s,\min ,\, i}` (J m\ :sup:`-3` K\ :sup:`-1`) is .. math:: - :label: 6.91) + :label: 6.91 \begin{array}{lr} c_{s,\min ,\, i} =\left(\frac{2.128{\rm \; }\left(\% sand\right)_{i} +{\rm 2.385\; }\left(\% clay\right)_{i} }{\left(\% sand\right)_{i} +\left(\% clay\right)_{i} } \right)\times 10^{6} &\qquad i=1,\ldots ,N_{levsoi} \\ @@ -865,11 +949,11 @@ where the heat capacity of mineral soil solids where :math:`c_{s,bedrock} =2\times 10^{6}` J m\ :sup:`-3` K\ :sup:`-1` is the heat capacity of bedrock and :math:`c_{s,om} =2.5\times 10^{6}` \ J m\ :sup:`-3` -K\ :sup:`-1` (ref:`Farouki 1981 `) is the heat capacity of organic +K\ :sup:`-1` (:ref:`Farouki 1981 `) is the heat capacity of organic matter. For glaciers, wetlands, and snow .. math:: - :label: ZEqnNum107679 + :label: 6.92 c_{i} =\frac{w_{ice,\, i} }{\Delta z_{i} } C_{ice} +\frac{w_{liq,\, i} }{\Delta z_{i} } C_{liq} . @@ -878,11 +962,8 @@ there are no explicit snow layers (:math:`snl=0`), the heat capacity of the top layer is a blend of ice and soil heat capacity .. math:: - :label: 6.93) - - c_{1} =c_{1}^{\*} +\frac{C_{ice} W_{sno} }{\Delta z_{1} } - -where :math:`c_{1}^{\*}` is calculated from equation or . + :label: 6.93 -.. todo:: fill in the above - should be calculated form equation (6.89) or (6.92) + c_{1} =c_{1}^{*} +\frac{C_{ice} W_{sno} }{\Delta z_{1} } +where :math:`c_{1}^{*}` is calculated from :eq:`6.89` or :eq:`6.92`. From 0073bde0ccbed500f5052cdbc09484685cb37cdd Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 1 Jun 2017 12:37:44 -0600 Subject: [PATCH 036/730] Update Chaptes 7,8 --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 256 +++++++++--------- .../CLM50_Tech_Note_Snow_Hydrology.rst | 157 ++++++----- 2 files changed, 219 insertions(+), 194 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 69a8907f89..0db3456163 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -16,7 +16,7 @@ m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Figure Hydrologic processes`). The total water balance of the system is .. math:: - :label: 7.1) + :label: 7.1 \begin{array}{l} {\Delta W_{can} +\Delta W_{sfc} +\Delta W_{sno} +} \\ {\sum _{i=1}^{N_{levsoi} }\left(\Delta w_{liq,\, i} +\Delta w_{ice,\, i} \right)+\Delta W_{a} =\left(\begin{array}{l} {q_{rain} +q_{sno} -E_{v} -E_{g} -q_{over} } \\ {-q_{h2osfc} -q_{drai} -q_{rgwl} -q_{snwcp,\, ice} } \end{array}\right) \Delta t} \end{array} @@ -53,42 +53,43 @@ m\ :sup:`-2` s\ :sup:`-1`) does not distinguish between liquid and solid phases .. math:: - :label: 7.2) + :label: 7.2 q_{intr} =\alpha \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} where :math:`L` and :math:`S` are the exposed leaf and stem area index, -respectively (section 2.1.4), and :math:`\alpha =0.25` scales -interception from point to grid cell (:ref:`Lawrence et al. 2007 `). Throughfall +respectively (section :numref:`Phenology and vegetation burial by snow`), +and :math:`\alpha =0.25` scales interception from point to grid cell +(:ref:`Lawrence et al. 2007 `). Throughfall (kg m\ :sup:`-2` s\ :sup:`-1`), however, is divided into liquid and solid phases reaching the ground (soil or snow surface) as .. math:: - :label: 7.3) + :label: 7.3 q_{thru,\, liq} =q_{rain} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] .. math:: - :label: 7.4) + :label: 7.4 q_{thru,\, ice} =q_{sno} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. Similarly, the canopy drip is .. math:: - :label: 7.5) + :label: 7.5 q_{drip,\, liq} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{rain} }{q_{rain} +q_{sno} } \ge 0 .. math:: - :label: 7.6) + :label: 7.6 q_{drip,\, ice} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{sno} }{q_{rain} +q_{sno} } \ge 0 where .. math:: - :label: 7.7) + :label: 7.7 W_{can}^{intr} =W_{can}^{n} +q_{intr} \Delta t\ge 0 @@ -98,7 +99,7 @@ and :math:`W_{can,\, \max }` (kg m\ :sup:`-2`) is the maximum amount of water the canopy can hold .. math:: - :label: 7.8) + :label: 7.8 W_{can,\, \max } =p\left(L+S\right). @@ -107,7 +108,7 @@ liquid water, :math:`p=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. 1993 `). The canopy water is updated as .. math:: - :label: 7.9) + :label: 7.9 W_{can}^{n+1} =W_{can}^{n} +q_{intr} \Delta t-\left(q_{drip,\, liq} +q_{drip,\, ice} \right)\Delta t-E_{v}^{w} \Delta t\ge 0. @@ -116,12 +117,12 @@ surfaces (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) reaching the ground is then .. math:: - :label: ZEqnNum946822 + :label: 7.10 q_{grnd,liq} =q_{thru,\, liq} +q_{drip,\, liq} .. math:: - :label: ZEqnNum339590 + :label: 7.11 q_{grnd,ice} =q_{thru,\, ice} +q_{drip,\, ice} . @@ -138,7 +139,7 @@ for the surface albedo (section :numref:`Canopy Radiative Transfer`) and surface calculations is (:ref:`Dickinson et al.1993 `) .. math:: - :label: 7.12) + :label: 7.12 f_{wet} = \left\{\begin{array}{lr} @@ -149,7 +150,7 @@ calculations is (:ref:`Dickinson et al.1993 `) while the fraction of the canopy that is dry and transpiring is .. math:: - :label: 7.13) + :label: 7.13 f_{dry} = \left\{\begin{array}{lr} @@ -183,21 +184,21 @@ portion of a grid cell contributes to surface runoff, :math:`q_{over}` , by the saturation excess mechanism (Dunne runoff) .. math:: - :label: ZEqnNum549608 + :label: 7.64 q_{over} =f_{sat} q_{liq,\, 0} The fractional saturated area is a function of soil moisture .. math:: - :label: 7.65) + :label: 7.65 - f_{sat} =f_{\max } \exp \left(-0.5f_{over} z_{\nabla } \right) + f_{sat} = f_{\max } \exp \left(-0.5 f_{over} z_{\nabla } \right) -where :math:`f_{\max }` is the potential or maximum value of -:math:`f_{sat}` , :math:`f_{over}` is a decay factor -(m\ :sup:`-1`), and :math:`z_{\nabla}` is the water table depth -(m) (section 7.6). The maximum saturated fraction, :math:`f_{\max }` , +where :math:`f_{\max }` is the potential or maximum value of +:math:`f_{sat}`, :math:`f_{over}` is a decay factor (m\ :sup:`-1`), and +:math:`z_{\nabla}` is the water table depth (m) (section +:numref:`Lateral Sub-surface Runoff`). The maximum saturated fraction, :math:`f_{\max }` , is defined as the value of the discrete cumulative distribution function (CDF) of the topographic index when the grid cell mean water table depth is zero. Thus, :math:`f_{\max }` is the percent of pixels in a grid @@ -242,7 +243,7 @@ height (relative to the grid cell mean elevation) of the surface water, :math:`d`, by .. math:: - :label: ZEqnNum277892 + :label: 7.66 W_{sfc} =\frac{d}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right)+\frac{\sigma _{micro} }{\sqrt{2\pi } } e^{\frac{-d^{2} }{2\sigma _{micro} ^{2} } } @@ -252,7 +253,7 @@ Newton-Raphson method. Once :math:`d` is known, one can determine the fraction of the area that is inundated as .. math:: - :label: 7.67) + :label: 7.67 f_{h2osfc} =\frac{1}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right) @@ -260,7 +261,7 @@ No global datasets exist for microtopography, so the default parameterization is a simple function of slope .. math:: - :label: 7.68) + :label: 7.68 \sigma _{micro} =\left(\beta +\beta _{0} \right)^{\eta } @@ -277,7 +278,7 @@ percolation theory can be used to quantify the fraction of the inundated portion of the grid cell that is interconnected .. math:: - :label: 7.69) + :label: 7.69 \begin{array}{lr} f_{connected} =\left(f_{h2osfc} -f_{c} \right)^{\mu } & \qquad f_{h2osfc} >f_{c} \\ f_{connected} =0 &\qquad f_{h2osfc} \le f_{c} \end{array} @@ -289,7 +290,7 @@ surpasses :math:`f_{c}` , the surface water store acts as a linear reservoir .. math:: - :label: 7.70) + :label: 7.70 qout,h2osfc=kh2osfcf_{connected} (Wsfc-Wc)\frac{1}{\Delta t} @@ -309,7 +310,7 @@ The surface moisture flux remaining after surface runoff has been removed, .. math:: - :label: 7.71) + :label: 7.71 qin,surface=(1-f_{sat} )q_{liq,\, 0} @@ -319,7 +320,7 @@ maximum soil infiltration capacity (kg m\ :sup:`-2` s\ :sup:`-1`), .. math:: - :label: ZEqnNum569150 + :label: 7.72 q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat @@ -327,7 +328,7 @@ where :math:`{\rm \Theta }ice` is an ice impedance factor (section :numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff is generated .. math:: - :label: 7.73) + :label: 7.73 q_{infl,\, excess} =\max \left(q_{in,soil} -\left(1-f_{h2osfc} \right)q_{\inf l,\max } ,0\right) @@ -335,28 +336,28 @@ and transferred from :math:`q_{in,soil}` to :math:`q_{in,h2osfc}` . After evaporative losses have been removed, these moisture fluxes are .. math:: - :label: 7.74) + :label: 7.74 q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} +q_{infl,excess} -q_{evap,h2osfc} and .. math:: - :label: 7.75) + :label: 7.75 qin,soil=(1-f_{h2osfc} )q_{in,surface} -q_{\inf l,excess} -(1-f_{sno} -f_{h2osfc} )qevap,soil. The balance of surface water is then calculated as .. math:: - :label: 7.76) + :label: 7.76 \Delta W_{sfc} =\left(qin,h2osfc-qout,h2osfc-qdrain,h2osfc\right)\Delta t. Bottom drainage from the surface water store .. math:: - :label: 7.77) + :label: 7.77 qdrain,h2osfc=\min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) @@ -364,7 +365,7 @@ is then added to :math:`q_{in,soil}` giving the total infiltration into the surface soil layer .. math:: - :label: 7.78) + :label: 7.78 q_{infl} =q_{in,soil} +q_{drain,h2osfc} @@ -387,7 +388,7 @@ For one-dimensional vertical water flow in soils, the conservation of mass is stated as .. math:: - :label: ZEqnNum790844 + :label: 7.79 \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q @@ -409,7 +410,7 @@ The soil water flux :math:`q` in equation can be described by Darcy’s law :ref:`(Dingman 2002) ` .. math:: - :label: 7.80) + :label: 7.80 q=-k\frac{\partial \psi _{h} }{\partial z} @@ -418,7 +419,7 @@ and :math:`\psi _{h}` is the hydraulic potential (mm). The hydraulic potential is .. math:: - :label: 7.81) + :label: 7.81 \psi _{h} =\psi _{m} +\psi _{z} @@ -431,22 +432,22 @@ If the reference elevation is the soil surface, then becomes .. math:: - :label: ZEqnNum186573 + :label: 7.82 q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. -Equation :eq:`ZEqnNum186573` can be further manipulated to yield +Equation :eq:`7.82` can be further manipulated to yield .. math:: - :label: 7.83) + :label: 7.83 q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). -Substitution of this equation into equation :eq:`ZEqnNum790844`, with :math:`Q=0`, yields +Substitution of this equation into equation :eq:`7.79`, with :math:`Q=0`, yields the Richards equation .. math:: - :label: ZEqnNum670361 + :label: 7.84 \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right)\right]. @@ -458,7 +459,8 @@ Hydraulic Properties The hydraulic conductivity :math:`k_{i}` (mm s\ :sup:`-1`) and the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` vary with volumetric soil water :math:`\theta _{i}` and soil texture. -As with the soil thermal properties (section :numref:`Soil And Snow Thermal Properties`) the hydraulic +As with the soil thermal properties (section +:numref:`Soil And Snow Thermal Properties`) the hydraulic properties of the soil are assumed to be a weighted combination of the mineral properties, which are determined according to sand and clay contents based on work by :ref:`Clapp and Hornberger (1978) @@ -475,7 +477,7 @@ moisture of the two layers :math:`\theta _{i}` and :math:`\Theta _{ice}` .. math:: - :label: ZEqnNum398074 + :label: 7.85 k\left[z_{h,\, i} \right] = \left\{\begin{array}{lr} @@ -497,7 +499,7 @@ computed as weighted averages of the properties of the mineral and organic components. The water content at saturation (i.e. porosity) is .. math:: - :label: 7.90) + :label: 7.90 \theta _{sat,i} =(1-f_{om,i} )\theta _{sat,\min ,i} +f_{om,i} \theta _{sat,om} @@ -508,21 +510,21 @@ porosity of organic matter and the porosity of the mineral soil :math:`\theta _{sat,\min ,i}` is .. math:: - :label: 7.91) + :label: 7.91 \theta _{sai,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . The exponent :math:`B_{i}` is .. math:: - :label: 7.92) + :label: 7.92 B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and .. math:: - :label: 7.93) + :label: 7.93 B_{\min ,i} =2.91+0.159(\% clay)_{i} . @@ -530,14 +532,14 @@ The soil matric potential (mm) is defined at the node depth :math:`z_{i}` of each layer :math:`i` (:numref:`Figure Water flux schematic`) .. math:: - :label: ZEqnNum316201 + :label: 7.94 \psi _{i} =\psi _{sat,\, i} \left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad 0.01\le \frac{\theta _{i} }{\theta _{sat,\, i} } \le 1 where the saturated soil matric potential (mm) is .. math:: - :label: 7.95) + :label: 7.95 \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} @@ -546,7 +548,7 @@ saturated organic matter matric potential and the saturated mineral soil matric potential :math:`\psi _{sat,\min ,i}` \ is .. math:: - :label: 7.96) + :label: 7.96 \psi _{sat,\, \min ,\, i} =-10.0\times 10^{1.88-0.0131(\% sand)_{i} } . @@ -570,7 +572,7 @@ pathways interacts only with organic material, and thus can be described by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by .. math:: - :label: 7.97) + :label: 7.97 \begin{array}{lr} f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta _{perc} } f_{om} {\rm \; } & \qquad f_{om} \ge f_{threshold} \\ @@ -585,7 +587,7 @@ hydraulic conductivity is assumed to correspond to flow pathways that pass through the mineral and organic components in series .. math:: - :label: 7.98) + :label: 7.98 k_{sat,\, uncon} =f_{uncon} \left(\frac{\left(1-f_{om} \right)}{k_{sat,\, \min } } +\frac{\left(f_{om} -f_{perc} \right)}{k_{sat,\, om} } \right)^{-1} . @@ -593,7 +595,7 @@ where saturated hydraulic conductivity for mineral soil depends on soil texture (:ref:`Cosby et al. 1984 `) as .. math:: - :label: 7.99) + :label: 7.99 k_{sat,\, \min } \left[z_{h,\, i} \right]=0.0070556\times 10^{-0.884+0.0153\left(\% sand\right)_{i} } . @@ -601,7 +603,7 @@ The bulk soil layer saturated hydraulic conductivity is then computed as .. math:: - :label: 7.100) + :label: 7.100 k_{sat} \left[z_{h,\, i} \right]=f_{uncon,\, i} k_{sat,\, uncon} \left[z_{h,\, i} \right]+(1-f_{uncon,\, i} )k_{sat,\, om} \left[z_{h,\, i} \right]. @@ -610,11 +612,11 @@ as Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ -With reference to :numref:`Figure Water flux schematic`, the equation for conservation of mass -(equation :eq:`ZEqnNum790844`) can be integrated over each layer as +With reference to :numref:`Figure Water flux schematic`, the equation for +conservation of mass :eq:`7.79` can be integrated over each layer as .. math:: - :label: 7.101) + :label: 7.101 \int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial \theta }{\partial t} \, dz=-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial q}{\partial z} \, dz-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }Q\, dz . @@ -623,7 +625,7 @@ as positive upward from the soil surface. This equation can be written as .. math:: - :label: ZEqnNum225309 + :label: 7.102 \Delta z_{i} \frac{\partial \theta _{liq,\, i} }{\partial t} =-q_{i-1} +q_{i} -e_{i} @@ -635,7 +637,7 @@ the layer (mm s\ :sup:`-1`). Taking the finite difference with time and evaluating the fluxes implicitly at time :math:`n+1` yields .. math:: - :label: ZEqnNum181361 + :label: 7.103 \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =-q_{i-1}^{n+1} +q_{i}^{n+1} -e_{i} @@ -650,7 +652,7 @@ function of the total transpiration :math:`E_{v}^{t}` (Chapter :numref:`rst_Mom the effective root fraction :math:`r_{e,\, i}` .. math:: - :label: ZEqnNum357392 + :label: 7.104 e_{i} =r_{e,\, i} E_{v}^{t} . @@ -676,7 +678,7 @@ soil column, the transpiration :math:`E_{v}^{t}` is a weighted sum of transpiration from all PFTs whose weighting depends on PFT area as .. math:: - :label: 7.105) + :label: 7.105 E_{v}^{t} =\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} @@ -689,7 +691,7 @@ quantity that is a weighted sum over all PFTs. The weighting depends on the per unit area transpiration of each PFT and its relative area as .. math:: - :label: 7.106) + :label: 7.106 r_{e,\, i} =\frac{\sum _{j=1}^{npft}\left(r_{e,\, i} \right)_{j} \left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} }{\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} } @@ -697,15 +699,20 @@ where :math:`\left(r_{e,\, i} \right)_{j}` is the effective root fraction for the :math:`j^{th}` PFT .. math:: - :label: 7.107) + :label: 7.107 - \begin{array}{l} {\left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } \qquad \left(\beta _{t} \right)_{j} >0} \\ {\left(r_{e,\, i} \right)_{j} =0\qquad \left(\beta _{t} \right)_{j} =0} \end{array} + \begin{array}{lr} + \left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } & \qquad \left(\beta _{t} \right)_{j} >0 \\ + \left(r_{e,\, i} \right)_{j} =0 & \qquad \left(\beta _{t} \right)_{j} =0 + \end{array} and :math:`\left(r_{i} \right)_{j}` is the fraction of roots in layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), -:math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor -for layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total -soil column for the :math:`j^{th}` PFT (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). +:math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor for +layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), +and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total +soil column for the :math:`j^{th}` PFT (Chapter +:numref:`rst_Stomatal Resistance and Photosynthesis`). The soil water fluxes in equation , which are a function of :math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of @@ -714,12 +721,12 @@ can be linearized about :math:`\theta` using a Taylor series expansion as .. math:: - :label: 7.108) + :label: 7.108 q_{i}^{n+1} =q_{i}^{n} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } \Delta \theta _{liq,\, i+1} .. math:: - :label: 7.109) + :label: 7.109 q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } \Delta \theta _{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} . @@ -728,29 +735,29 @@ Substitution of these expressions for :math:`q_{i}^{n+1}` and equation set of the form .. math:: - :label: 7.110) + :label: 7.110 r_{i} =a_{i} \Delta \theta _{liq,\, i-1} +b_{i} \Delta \theta _{liq,\, i} +c_{i} \Delta \theta _{liq,\, i+1} where .. math:: - :label: ZEqnNum557934 + :label: 7.111 a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.112) + :label: 7.112 b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.113) + :label: 7.113 c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: ZEqnNum981892 + :label: 7.114 r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -761,32 +768,32 @@ The finite-difference forms of the fluxes and partial derivatives in equations - can be obtained from equation as .. math:: - :label: 7.115) + :label: 7.115 q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.116) + :label: 7.116 q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] .. math:: - :label: 7.117) + :label: 7.117 \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.118) + :label: 7.118 \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.119) + :label: 7.119 \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] .. math:: - :label: 7.120) + :label: 7.120 \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right]. @@ -794,17 +801,17 @@ The derivatives of the soil matric potential at the node depth are derived from equation .. math:: - :label: 7.121) + :label: 7.121 \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, \, i-1} } =-B_{i-1} \frac{\psi _{i-1} }{\theta _{\, \, i-1} } .. math:: - :label: 7.122) + :label: 7.122 \frac{\partial \psi _{i} }{\partial \theta _{\, liq,\, i} } =-B_{i} \frac{\psi _{i} }{\theta _{i} } .. math:: - :label: 7.123) + :label: 7.123 \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } =-B_{i+1} \frac{\psi _{i+1} }{\theta _{\, i+1} } @@ -815,12 +822,12 @@ The derivatives of the hydraulic conductivity at the layer interface are derived from equation .. math:: - :label: 7.124) + :label: 7.124 \begin{array}{l} {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } =\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } =\left(1-\frac{f_{frz,\, i-1} +f_{frz,\, i} }{2} \right)\left(2B_{i-1} +3\right)k_{sat} \left[z_{h,\, i-1} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right]^{2B_{i-1} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right)} \end{array} .. math:: - :label: 7.125) + :label: 7.125 \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. @@ -833,7 +840,7 @@ infiltration rate (section :numref:`Surface Runoff`), is .. math:: - :label: 7.135) + :label: 7.135 \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =q_{infl}^{n+1} +q_{i}^{n+1} -e_{i} . @@ -841,22 +848,22 @@ After grouping like terms, the coefficients of the tridiagonal set of equations for :math:`i=1` are .. math:: - :label: 7.136) + :label: 7.136 a_{i} =0 .. math:: - :label: 7.137) + :label: 7.137 b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.138) + :label: 7.138 c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: 7.139) + :label: 7.139 r_{i} =q_{infl}^{n+1} -q_{i}^{n} +e_{i} . @@ -867,22 +874,22 @@ The coefficients of the tridiagonal set of equations for :math:`i=2,\ldots ,N_{levsoi} -1` are .. math:: - :label: 7.140) + :label: 7.140 a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.141) + :label: 7.141 b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.142) + :label: 7.142 c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: 7.143) + :label: 7.143 r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -895,22 +902,22 @@ and the coefficients of the tridiagonal set of equations for :math:`i=N_{levsoi}` are .. math:: - :label: 7.148) + :label: 7.148 a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.149) + :label: 7.149 b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.150) + :label: 7.150 c_{i} =0 .. math:: - :label: 7.151) + :label: 7.151 r_{i} =q_{i-1}^{n} +e_{i} . @@ -921,7 +928,7 @@ An initial solution is found by setting :math:`\Delta t` equal to the model time step. An estimate of the error is calculated from .. math:: - :label: 7.152) + :label: 7.152 \epsilon = max \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] @@ -937,14 +944,14 @@ Upon solution of the tridiagonal equation set, the liquid water contents are updated as follows .. math:: - :label: 7.164) + :label: 7.164 w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\Delta \theta _{liq,\, i} \Delta z_{i} \qquad i=1,\ldots ,N_{levsoi} . The volumetric water content is .. math:: - :label: 7.165) + :label: 7.165 \theta _{i} =\frac{w_{liq,\, i} }{\Delta z_{i} \rho _{liq} } +\frac{w_{ice,\, i} }{\Delta z_{i} \rho _{ice} } . @@ -954,7 +961,8 @@ Frozen Soils and Perched Water Table ---------------------------------------- When soils freeze, the power-law form of the ice impedance factor -(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic conductivity of the +(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic +conductivity of the soil, leading to nearly impermeable soil layers. When unfrozen soil layers are present above relatively ice-rich frozen layers, the possibility exists for perched saturated zones. Lateral drainage from @@ -962,7 +970,7 @@ perched saturated regions is parameterized as a function of the thickness of the saturated zone .. math:: - :label: 7.166) + :label: 7.166 q_{drai,perch} =k_{drai,\, perch} \left(z_{frost} -z_{\nabla ,perch} \right) @@ -970,7 +978,7 @@ where :math:`k_{drai,\, perch}` depends on topographic slope and soil hydraulic conductivity, .. math:: - :label: 7.167) + :label: 7.167 k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta _{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) @@ -995,7 +1003,7 @@ Lateral sub-surface runoff occurs when saturated soil moisture conditions exist within the soil column. Sub-surface runoff is .. math:: - :label: 7.168) + :label: 7.168 q_{subsurface} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) \Delta z_{sat}^{N_{baseflow}} \ , @@ -1007,13 +1015,14 @@ is the thickness of the saturated portion of the soil column. The saturated thickness is .. math:: - :label: 7.1681) + :label: 7.1681 \Delta z_{sat} = z_{bedrock} - z_{\nabla}, where the water table :math:`z_{\nabla}` is determined by finding the -first soil layer above the bedrock depth (section ) in which the volumetric water -content drops below a specified threshold. The default threshold is set to 0.9. +first soil layer above the bedrock depth (section :numref:`Depth to Bedrock`) +in which the volumetric water content drops below a specified threshold. +The default threshold is set to 0.9. The specific yield, :math:`S_{y}` , which depends on the soil properties and the water table location, is derived by taking the @@ -1021,13 +1030,13 @@ difference between two equilibrium soil moisture profiles whose water tables differ by an infinitesimal amount .. math:: - :label: 7.174) + :label: 7.174 S_{y} =\theta _{sat} \left(1-\left(1+\frac{z_{\nabla } }{\Psi _{sat} } \right)^{\frac{-1}{B} } \right) where B is the Clapp-Hornberger exponent. Because :math:`S_{y}` is a function of the soil properties, it results in water table dynamics that -are consistent with the soil water fluxes described in section 7.4. +are consistent with the soil water fluxes described in section :numref:`Soil Water`. After the above calculations, two numerical adjustments are implemented to keep the liquid water content of each soil layer @@ -1052,22 +1061,22 @@ those layers subject to the constraint found, then the water is removed from :math:`W_{t}` and :math:`q_{drai}` . -The soil surface layer liquid water and ice contents are then updated -for dew :math:`q_{sdew}` , frost :math:`q_{frost}` , or sublimation -:math:`q_{subl}` (section 5.4) as +The soil surface layer liquid water and ice contents are then updated for +dew :math:`q_{sdew}`, frost :math:`q_{frost}`, or sublimation :math:`q_{subl}` +(section :numref:`Update of Ground Sensible and Latent Heat Fluxes`) as .. math:: - :label: 7.175) + :label: 7.175 w_{liq,\, 1}^{n+1} =w_{liq,\, 1}^{n} +q_{sdew} \Delta t .. math:: - :label: 7.176) + :label: 7.176 w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} +q_{frost} \Delta t .. math:: - :label: 7.177) + :label: 7.177 w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} -q_{subl} \Delta t. @@ -1085,12 +1094,12 @@ and dew in solid or liquid form, is separated into solid :math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms .. math:: - :label: 7.178) + :label: 7.178 q_{snwcp,ice} =q_{grnd,ice} +q_{frost} .. math:: - :label: 7.179) + :label: 7.179 q_{snwcp,liq} =q_{grnd,liq} +q_{dew} @@ -1106,7 +1115,7 @@ For glacier surfaces the runoff term :math:`q_{rgwl}` is calculated from the residual of the water balance .. math:: - :label: 7.180) + :label: 7.180 q_{rgwl} =q_{grnd,ice} +q_{grnd,liq} -E_{g} -E_{v} -\frac{\left(W_{b}^{n+1} -W_{b}^{n} \right)}{\Delta t} -q_{snwcp,ice} @@ -1114,7 +1123,7 @@ where :math:`W_{b}^{n}` and :math:`W_{b}^{n+1}` are the water balances at the beginning and ending of the time step defined as .. math:: - :label: 7.181) + :label: 7.181 W_{b} =W_{can} +W_{sno} +\sum _{i=1}^{N}\left(w_{ice,i} +w_{liq,i} \right) . @@ -1122,5 +1131,6 @@ Currently, glaciers are non-vegetated and :math:`E_{v} =W_{can} =0`. The contribution of lake runoff to :math:`q_{rgwl}` is described in section :numref:`Precipitation, Evaporation, and Runoff Lake`. The runoff term :math:`q_{rgwl}` may be negative for glaciers and lakes, which reduces -the total amount of runoff available to the river routing model (Chapter :numref:`rst_River Transport Model (RTM)`). +the total amount of runoff available to the river routing model +(Chapter :numref:`rst_River Transport Model (RTM)`). diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index dbe949bd34..5f87ec2f1a 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -3,21 +3,20 @@ Snow Hydrology =============== -The parameterizations for snow are based primarily on :ref:`Anderson (1976) `, -:ref:`Jordan (1991) `, and :ref:`Dai and Zeng (1997) `. The snowpack +The parameterizations for snow are based primarily on +:ref:`Anderson (1976) `, :ref:`Jordan (1991) `, +and :ref:`Dai and Zeng (1997) `. The snowpack can have up to five layers. These layers are indexed in the Fortran code as :math:`i=-4,-3,-2,-1,0` where layer :math:`i=0` is the snow layer next to the top soil layer and layer :math:`i=-4` is the top layer of a five-layer snow pack. Since the number of snow layers varies according to the snow depth, we use the notation :math:`snl+1` to describe the top layer of snow for the variable layer snow pack, where :math:`snl` is the -negative of the number of snow layers. Refer to Figure :numref:`three layer +negative of the number of snow layers. Refer to :numref:`Figure three layer snow pack` for an example of the snow layer structure for a three layer snow pack. -.. Figure 8.2. Example of three layer snow pack (:math:`snl=-3`). - -.. _three layer snow pack: +.. _Figure three layer snow pack: .. Figure:: image1.png @@ -61,7 +60,7 @@ calculated separately for accumulation and depletion. When snowfall occurs, :math:`f_{sno}` is updated as .. math:: - :label: 8.14) + :label: 8.14 f^{n+1} _{sno} =1-\left(\left(1-\tanh (k_{accum} q_{sno} \Delta t)\right)\left(1-f^{n} _{sno} \right)\right) @@ -74,7 +73,7 @@ When snow melt occurs, :math:`f_{sno}` is calculated from the depletion curve .. math:: - :label: 8.15) + :label: 8.15 f_{sno} =1-\left(\frac{\cos ^{-1} \left(2R_{sno} -1\right)}{\pi } \right)^{N_{melt} } @@ -85,7 +84,7 @@ cell. Whenever :math:`W_{sno}` reaches zero, :math:`W_{\max }` is reset to zero. The depletion curve shape parameter is defined as .. math:: - :label: 8.16) + :label: 8.16 N_{melt} =\frac{200}{\min \left(10,\sigma _{topo} \right)} @@ -101,7 +100,7 @@ Ice Content The conservation equation for mass of ice in snow layers is .. math:: - :label: 8.17) + :label: 8.17 \frac{\partial w_{ice,\, i} }{\partial t} = \left\{\begin{array}{lr} @@ -117,7 +116,7 @@ is the change in ice due to phase change (melting rate) (section :numref:`Phase The term :math:`q_{ice,\, i-1}` is computed in two steps as .. math:: - :label: 8.18) + :label: 8.18 q_{ice,\, i-1} =q_{grnd,\, ice} +\left(q_{frost} -q_{subl} \right) @@ -130,14 +129,14 @@ interception (section :numref:`Canopy Water`), a new snow depth :math:`z_{sno}` calculated from .. math:: - :label: 8.19) + :label: 8.19 z_{sno}^{n+1} =z_{sno}^{n} +\Delta z_{sno} where .. math:: - :label: 8.20) + :label: 8.20 \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } @@ -145,7 +144,7 @@ and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg m\ :sup:`-3`) (:ref:`Anderson (1976) `) .. math:: - :label: 8.21) + :label: 8.21 \rho _{sno} = \left\{\begin{array}{lr} @@ -159,26 +158,27 @@ where :math:`T_{atm}` is the atmospheric temperature (K), and mass of snow :math:`W_{sno}` is .. math:: - :label: 8.22) + :label: 8.22 W_{sno}^{n+1} =W_{sno}^{n} +q_{grnd,\, ice} \Delta t. The ice content of the top layer and the layer thickness are updated as .. math:: - :label: 8.23) + :label: 8.23 w_{ice,\, snl+1}^{n+1} =w_{ice,\, snl+1}^{n} +q_{grnd,\, ice} \Delta t .. math:: - :label: 8.24) + :label: 8.24 \Delta z_{snl+1}^{n+1} =\Delta z_{snl+1}^{n} +\Delta z_{sno} . Since wetlands are modeled as columns of water (no soil), snow is not allowed to accumulate if the surface temperature is above freezing (:math:`T_{g} >T_{f}` ). In this case, the incoming solid precipitation -is assigned to the runoff term :math:`q_{rgwl}` (section :numref:`Runoff from glaciers and snow-capped surfaces`). +is assigned to the runoff term :math:`q_{rgwl}` (section +:numref:`Runoff from glaciers and snow-capped surfaces`). In the second step, after surface fluxes and snow/soil temperatures have been determined (Chapters :numref:`rst_Momentum, Sensible Heat, and Latent Heat @@ -186,7 +186,7 @@ Fluxes` and :numref:`rst_Soil and Snow Temperatures`), :math:`w_{ice,\, snl+1}` is updated for frost or sublimation as .. math:: - :label: ZEqnNum863244 + :label: 8.25 w_{ice,\, snl+1}^{n+1} =w_{ice,\, snl+1}^{n} +f_{sno} \left(q_{frost} -q_{subl} \right)\Delta t. @@ -209,7 +209,7 @@ Water Content The conservation equation for mass of water in snow layers is .. math:: - :label: 8.26) + :label: 8.26 \frac{\partial w_{liq,\, i} }{\partial t} =\left(q_{liq,\, i-1} -q_{liq,\, i} \right)+\frac{\left(\Delta w_{liq,\, i} \right)_{p} }{\Delta t} @@ -221,21 +221,22 @@ is the change in liquid water due to phase change (melting rate) (section :numref:`Phase Change`). For the top snow layer only, .. math:: - :label: 8.27) + :label: 8.27 q_{liq,\, i-1} =f_{sno} \left(q_{grnd,\, liq} +\left(q_{sdew} -q_{seva} \right)\right) where :math:`q_{grnd,\, liq}` is the rate of liquid precipitation reaching the snow (section :numref:`Canopy Water`), :math:`q_{seva}` is the evaporation of liquid water and :math:`q_{sdew}` is the liquid dew (section -5.4). After surface fluxes and snow/soil temperatures have been determined +:numref:`Update of Ground Sensible and Latent Heat Fluxes`). After surface +fluxes and snow/soil temperatures have been determined (Chapters :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes` and :numref:`rst_Soil and Snow Temperatures`), :math:`w_{liq,\, snl+1}` is updated for the liquid precipitation reaching the ground and dew or evaporation as .. math:: - :label: 8.28) + :label: 8.28 w_{liq,\, snl+1}^{n+1} =w_{liq,\, snl+1}^{n} +f_{sno} \left(q_{grnd,\, liq} +q_{sdew} -q_{seva} \right)\Delta t. @@ -250,7 +251,7 @@ water content. Thus, water flow between layers, :math:`q_{liq,\, i}` , for layers :math:`i=snl+1,\ldots ,0`, is initially calculated as .. math:: - :label: ZEqnNum767577 + :label: 8.29 q_{liq,\, i} =\frac{\rho _{liq} \left[\theta _{liq,\, i} -S_{r} \left(1-\theta _{ice,\, i} \right)\right]f_{sno} \Delta z_{i} }{\Delta t} \ge 0 @@ -258,12 +259,12 @@ where the volumetric liquid water :math:`\theta _{liq,\, i}` and ice :math:`\theta _{ice,\, i}` contents are .. math:: - :label: 8.30) + :label: 8.30 \theta _{ice,\, i} =\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } \le 1 .. math:: - :label: 8.31) + :label: 8.31 \theta _{liq,\, i} =\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \le 1-\theta _{ice,\, i} , @@ -275,14 +276,14 @@ calculated in equation , unless the underlying layer is the surface soil layer, as .. math:: - :label: 8.32) + :label: 8.32 q_{liq,\, i} \le \frac{\rho _{liq} \left[1-\theta _{ice,\, i+1} -\theta _{liq,\, i+1} \right]\Delta z_{i+1} }{\Delta t} \qquad i=snl+1,\ldots ,-1. The liquid water content :math:`w_{liq,\, i}` is updated as .. math:: - :label: ZEqnNum265203 + :label: 8.33 w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\left(q_{i-1} -q_{i} \right)\Delta t. @@ -307,29 +308,30 @@ eight particle species within each snow layer: hydrophilic black carbon, hydrophobic black carbon, hydrophilic organic carbon, hydrophobic organic carbon, and four species of mineral dust with the following particle sizes: 0.1-1.0, 1.0-2.5, 2.5-5.0, and 5.0-10.0 :math:`\mu m`. -Each of these species has unique optical properties (Table 3.5) and -meltwater removal efficiencies (:numref:`Table Meltwater scavenging`). +Each of these species has unique optical properties +(:numref:`Table Single-scatter albedo values used for snowpack impurities and ice`) +and meltwater removal efficiencies (:numref:`Table Meltwater scavenging`). The black carbon and organic carbon deposition rates described in Table 2.3 are combined into four categories as follows .. math:: - :label: 8.34) + :label: 8.34 D_{bc,\, hphil} =D_{bc,\, dryhphil} +D_{bc,\, wethphil} .. math:: - :label: 8.35) + :label: 8.35 D_{bc,\, hphob} =D_{bc,\, dryhphob} .. math:: - :label: 8.36) + :label: 8.36 D_{oc,\, hphil} =D_{oc,\, dryhphil} +D_{oc,\, wethphil} .. math:: - :label: 8.37) + :label: 8.37 D_{oc,\, hphob} =D_{oc,\, dryhphob} @@ -345,7 +347,7 @@ mass of each of the particle species :math:`\Delta m_{sp,\, i}` (kg m\ :sup:`-2`) is .. math:: - :label: 8.38) + :label: 8.38 \Delta m_{sp,\, i} =\left[k_{sp} \left(q_{liq,\, i-1} c_{sp,\, i-1} -q_{liq,\, i} c_{i} \right)+D_{sp} \right]\Delta t @@ -361,7 +363,7 @@ kg\ :sup:`-1`), :math:`D_{sp}` is the atmospheric deposition rate is the model time step (s). The particle mass mixing ratio is .. math:: - :label: 8.39) + :label: 8.39 c_{i} =\frac{m_{sp,\, i} }{w_{liq,\, i} +w_{ice,\, i} } . @@ -408,9 +410,16 @@ If there are no existing snow layers (:math:`snl+1=1`) but follows .. math:: - :label: 8.40) + :label: 8.40 - \begin{array}{l} {\Delta z_{0} =z_{sno} } \\ {z_{o} =-0.5\Delta z_{0} } \\ {z_{h,\, -1} =-\Delta z_{0} } \\ {T_{0} =\min \left(T_{f} ,T_{atm} \right)} \\ {w_{ice,\, 0} =W_{sno} } \\ {w_{liq,\, 0} =0} \end{array}. + \begin{array}{lcr} + \Delta z_{0} & = & z_{sno} \\ + z_{o} & = & -0.5\Delta z_{0} \\ + z_{h,\, -1} & = & -\Delta z_{0} \\ + T_{0} & = & \min \left(T_{f} ,T_{atm} \right) \\ + w_{ice,\, 0} & = & W_{sno} \\ + w_{liq,\, 0} & = & 0 + \end{array}. .. _Snow Compaction: @@ -429,14 +438,14 @@ each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the three compaction processes .. math:: - :label: 8.41) + :label: 8.41 C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} . Compaction is not allowed if the layer is saturated .. math:: - :label: 8.42) + :label: 8.42 1-\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} \rho _{ice} } +\frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} \rho _{liq} } \right)\le 0.001 @@ -446,19 +455,21 @@ or if the ice content is below a minimum value Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (:ref:`Anderson (1976) `) .. math:: - :label: 8.43) + :label: 8.43 C_{R1,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{metamorphism} =-c_{3} c_{1} c_{2} \exp \left[-c_{4} \left(T_{f} -T_{i} \right)\right] where :math:`c_{3} =2.777\times 10^{-6}` (s\ :sup:`-1`) is the fractional compaction rate for :math:`T_{i} =T_{f}`, :math:`c_{4} =0.04` K\ :sup:`-1`, and .. math:: - :label: 8.44) + :label: 8.44 - c_{1} & = 1\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ - c_{1} & = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right]\qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ - c_{2} & = 2\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ - c_{2} & = 1\qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 + \begin{array}{lr} + c_{1} = 1 & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{1} = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right] & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{2} = 2 & \qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ + c_{2} = 1 & \qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 + \end{array} where :math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` @@ -469,14 +480,14 @@ are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (:ref:`Anderson (1976) `) .. math:: - :label: 8.45) + :label: 8.45 C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } where :math:`\eta` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and temperature as .. math:: - :label: 8.46) + :label: 8.46 \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] @@ -489,7 +500,7 @@ the ice :math:`w_{ice,\, i}` and liquid water contents water contents of the layer being compacted .. math:: - :label: 8.47) + :label: 8.47 P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . @@ -497,7 +508,7 @@ The compaction rate due to melting :math:`C_{R3,\; i}` (s\ :sup:`-1`) is taken t mass after the melting to the mass before melting .. math:: - :label: 8.48) + :label: 8.48 C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) @@ -507,14 +518,14 @@ covered area, the snow depth must also be updated for changes in :math:`f_{sno}` . .. math:: - :label: 8.49) + :label: 8.49 C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) The snow layer thickness after compaction is then .. math:: - :label: 8.50) + :label: 8.50 \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). @@ -559,12 +570,12 @@ liquid water and ice content of layer :math:`i` is combined with the underlying neighbor :math:`i+1` as .. math:: - :label: 8.51) + :label: 8.51 w_{liq,\, i+1} =w_{liq,\, i+1} +w_{liq,\, i} .. math:: - :label: 8.52) + :label: 8.52 w_{ice,\, i+1} =w_{ice,\, i+1} +w_{ice,\, i} . @@ -582,12 +593,12 @@ depth :math:`z_{sno}` are set to zero, otherwise, :math:`W_{sno}` and :math:`z_{sno}` are re-calculated as .. math:: - :label: 8.53) + :label: 8.53 W_{sno} =\sum _{i=snl+1}^{i=0}\left(w_{ice,\, i} +w_{liq,\, i} \right) .. math:: - :label: 8.54) + :label: 8.54 z_{sno} =\sum _{i=snl+1}^{i=0}\Delta z_{i} . @@ -603,26 +614,26 @@ When two snow layers are combined (denoted here as 1 and 2), their thickness combination (:math:`c`) is .. math:: - :label: ZEqnNum956014 + :label: 8.55 \Delta z_{c} =\Delta z_{1} +\Delta z_{2} , their mass combination is .. math:: - :label: 8.56) + :label: 8.56 w_{liq,\, c} =w_{liq,\, 1} +w_{liq,\, 2} .. math:: - :label: 8.57) + :label: 8.57 w_{ice,\, c} =w_{ice,\, 1} +w_{ice,\, 2} , and their temperatures are combined as .. math:: - :label: ZEqnNum325173 + :label: 8.58 T_{c} =T_{f} +\frac{h_{c} -L_{f} w_{liq,\, c} }{C_{ice} w_{ice,\, c} +C_{liq} w_{liq,\, c} } @@ -630,23 +641,24 @@ where :math:`h_{c} =h_{1} +h_{2}` is the combined enthalpy :math:`h_{i}` of the two layers where .. math:: - :label: 8.59) + :label: 8.59 h_{i} =\left(C_{ice} w_{ice,\, i} +C_{liq} w_{liq,\, i} \right)\left(T_{i} -T_{f} \right)+L_{f} w_{liq,\, i} . -In these equations, :math:`L_{f}` is the latent heat of fusion (J -kg\ :sup:`-1`) and :math:`C_{liq}` and :math:`C_{ice}` are the -specific heat capacities (J kg\ :sup:`-1` K\ :sup:`-1`) of -liquid water and ice, respectively (Table 2.6). After layer combination, -the node depths and layer interfaces (Figure 8.2) are recalculated from +In these equations, :math:`L_{f}` is the latent heat of fusion (J kg\ +:sup:`-1`) and :math:`C_{liq}` and :math:`C_{ice}` are the specific +heat capacities (J kg\ :sup:`-1` K\ :sup:`-1`) of liquid water and ice, +respectively (:numref:`Table Physical Constants`). After layer combination, +the node depths and layer interfaces (:numref:`Figure three layer snow pack`) +are recalculated from .. math:: - :label: ZEqnNum639853 + :label: 8.60 z_{i} =z_{h,\, i} -0.5\Delta z_{i} \qquad i=0,\ldots ,snl+1 .. math:: - :label: ZEqnNum295008 + :label: 8.61 z_{h,\, i-1} =z_{h,\, i} -\Delta z_{i} \qquad i=0,\ldots ,snl+1 @@ -703,16 +715,19 @@ constraining the new temperatures (:math:`T_{2}^{n+1}` , lower layer is first evaluated from .. math:: - :label: 8.62) + :label: 8.62 T'_{3} =T_{2}^{n} -\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1}^{n} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right), then adjusted as, .. math:: - :label: 8.63) + :label: 8.63 - \begin{array}{l} {T_{3}^{n+1} =T_{2}^{n} \qquad T'_{3} \ge T_{f} } \\ {T_{2}^{n+1} =T_{2}^{n} +\left(\frac{T_{1}^{n} -T_{2}^{n} }{{\left(\Delta z_{1} +\Delta z_{2}^{n} \right)\mathord{\left/ {\vphantom {\left(\Delta z_{1} +\Delta z_{2}^{n} \right) 2}} \right. \kern-\nulldelimiterspace} 2} } \right)\left(\frac{\Delta z_{2}^{n+1} }{2} \right)\qquad T'_{3} Date: Thu, 1 Jun 2017 14:07:59 -0600 Subject: [PATCH 037/730] Add anomaly forcing subsection --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 23 ++++-- .../Offline/CLM50_Tech_Note_Offline.rst | 73 ++++++++++++++----- 2 files changed, 73 insertions(+), 23 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index 6ba68086db..fa25eeb5c8 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -5,9 +5,13 @@ Glaciers This chapter describes features of CLM that are specific to coupling to an ice sheet model (in the CESM context, this is the Glimmer-CISM model; -Lipscomb and Sacks (2012) provide documentation and user’s guide for -Glimmer-CISM). General information about glacier land units can be found -elsewhere in this document (see Chapter 2 for an overview). +:ref:`Lipscomb and Sacks (2012)` provide documentation +and user’s guide for Glimmer-CISM). General information about glacier +land units can be found elsewhere in this document (see Chapter +:numref:`rst_Surface Characterization, Vertical Discretization, and +Model Input Requirements` for an overview). + +.. _Overview: Overview ------------- @@ -16,7 +20,8 @@ CLM is responsible for computing three quantities that are passed to the ice sheet model: #. Surface mass balance (SMB) – the net annual accumulation/ablation of - mass at the upper surface (section 10.3) + mass at the upper surface (section + :numref:`Computation of the surface mass balance`) #. Ground surface temperature, which serves as an upper boundary condition for Glimmer-CISM’s temperature calculation @@ -47,7 +52,8 @@ Glimmer-CISM: improvements to the CLM are applied to ice sheets automatically. #. The atmosphere model can respond during runtime to ice-sheet surface - changes. As shown by Pritchard et al. (2008), runtime albedo feedback + changes. As shown by :ref:`Pritchard et al. (2008)`, + runtime albedo feedback from the ice sheet is critical for simulating ice-sheet retreat on paleoclimate time scales. Without this feedback the atmosphere warms much less, and the retreat is delayed. @@ -71,11 +77,14 @@ which ice-sheet elevation changes are modest. For longer runs with larger elevation changes, two-way coupling is highly desirable. A two-way coupling scheme is under development. +.. _Multiple elevation class scheme: + Multiple elevation class scheme ------------------------------------ In the typical operation of CLM, the glacier land unit contains a single -column (section 2.1.1). However, when running CESM with an active ice +column (section :numref:`Surface Heterogeneity and Data Structure`). +However, when running CESM with an active ice sheet model, the glacier land unit is replaced by a glacier\_mec land unit, where “mec†denotes “multiple elevation classesâ€. In most ways, glacier\_mec land units behave the same as standard glacier land units. @@ -119,6 +128,8 @@ elevation classes. Some columns may have zero area and are called the land and the atmosphere, but are included for potential forcing of Glimmer-CISM. +.. _Computation of the surface mass balance: + Computation of the surface mass balance -------------------------------------------- diff --git a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst index e4e2db66fa..da2788a5f9 100644 --- a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst +++ b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst @@ -51,9 +51,12 @@ solar radiation supplied by the six-hourly forcing data is actually used. The solar radiation at model time step :math:`t_{M}` is .. math:: - :label: ZEqnNum160435 + :label: 31.1 - \begin{array}{l} {S_{atm} \left(t_{M} \right)=\frac{\frac{\Delta t_{FD} }{\Delta t_{M} } S_{atm} \left(t_{FD} \right)\mu \left(t_{M} \right)}{\sum _{i=1}^{\frac{\Delta t_{FD} }{\Delta t_{M} } }\mu \left(t_{M_{i} } \right) } \qquad {\rm for\; }\mu \left(t_{M} \right)>0.001} \\ {S_{atm} \left(t_{M} \right)=0\qquad {\rm for\; }\mu \left(t_{M} \right)\le 0.001} \end{array} + \begin{array}{lr} + S_{atm} \left(t_{M} \right)=\frac{\frac{\Delta t_{FD} }{\Delta t_{M} } S_{atm} \left(t_{FD} \right)\mu \left(t_{M} \right)}{\sum _{i=1}^{\frac{\Delta t_{FD} }{\Delta t_{M} } }\mu \left(t_{M_{i} } \right) } & \qquad {\rm for\; }\mu \left(t_{M} \right)>0.001 \\ + S_{atm} \left(t_{M} \right)=0 & \qquad {\rm for\; }\mu \left(t_{M} \right)\le 0.001 + \end{array} where :math:`\Delta t_{FD}` is the time step of the forcing data (6 hours :math:`\times` 3600 seconds hour\ :sup:`-1` = 21600 @@ -73,22 +76,22 @@ derived from one year’s worth of hourly CAM output from CAM version cam3\_5\_55 as .. math:: - :label: 31.2) + :label: 31.2 S_{atm} \, \downarrow _{vis}^{\mu } =R_{vis} \left(\alpha S_{atm} \right) .. math:: - :label: 31.3) + :label: 31.3 S_{atm} \, \downarrow _{nir}^{\mu } =R_{nir} \left[\left(1-\alpha \right)S_{atm} \right] .. math:: - :label: 31.4) + :label: 31.4 S_{atm} \, \downarrow _{vis} =\left(1-R_{vis} \right)\left(\alpha S_{atm} \right) .. math:: - :label: 31.5) + :label: 31.5 S_{atm} \, \downarrow _{nir} =\left(1-R_{nir} \right)\left[\left(1-\alpha \right)S_{atm} \right]. @@ -96,7 +99,7 @@ where :math:`\alpha` , the ratio of visible to total incident solar radiation, is assumed to be .. math:: - :label: 31.6) + :label: 31.6 \alpha =\frac{S_{atm} \, \downarrow _{vis}^{\mu } +S_{atm} \, \downarrow _{vis}^{} }{S_{atm} } =0.5. @@ -104,14 +107,14 @@ The ratio of direct to total incident radiation in the visible :math:`R_{vis}` is .. math:: - :label: 31.7) + :label: 31.7 R_{vis} =a_{0} +a_{1} \times \alpha S_{atm} +a_{2} \times \left(\alpha S_{atm} \right)^{2} +a_{3} \times \left(\alpha S_{atm} \right)^{3} \qquad 0.01\le R_{vis} \le 0.99 and in the near-infrared :math:`R_{nir}` is .. math:: - :label: 31.8) + :label: 31.8 R_{nir} =b_{0} +b_{1} \times \left(1-\alpha \right)S_{atm} +b_{2} \times \left[\left(1-\alpha \right)S_{atm} \right]^{2} +b_{3} \times \left[\left(1-\alpha \right)S_{atm} \right]^{3} \qquad 0.01\le R_{nir} \le 0.99 @@ -129,17 +132,17 @@ The potential temperature :math:`\overline{\theta _{atm} }` (K) is set to the atmospheric temperature :math:`T_{atm}` . The atmospheric longwave radiation :math:`L_{atm} \, \downarrow` (W m\ :sup:`-2`) is derived from the atmospheric vapor pressure :math:`e_{atm}` and -temperature :math:`T_{atm}` (Idso 1981) as +temperature :math:`T_{atm}` (:ref:`Idso 1981`) as .. math:: - :label: 31.9) + :label: 31.9 L_{atm} \, \downarrow =\left[0.70+5.95\times 10^{-5} \times 0.01e_{atm} \exp \left(\frac{1500}{T_{atm} } \right)\right]\sigma T_{atm}^{4} where .. math:: - :label: 31.10) + :label: 31.10 e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } @@ -149,19 +152,19 @@ precipitation :math:`P` (mm s\ :sup:`-1`) falling as rain and/or snow is .. math:: - :label: ZEqnNum336485 + :label: 31.11 q_{rain} =P\left(f_{P} \right), .. math:: - :label: 31.12) + :label: 31.12 q_{snow} =P\left(1-f_{P} \right) where .. math:: - :label: 31.13) + :label: 31.13 f_{P} =0<0.5\left(T_{atm} -T_{f} \right)<1. @@ -177,7 +180,7 @@ user-supplied relative humidity :math:`RH` (%) and derive specific humidity :math:`q_{atm}` (kg kg\ :sup:`-1`) from .. math:: - :label: 31.14) + :label: 31.14 q_{atm} =\frac{0.622e_{atm} }{P_{atm} -0.378e_{atm} } @@ -193,7 +196,7 @@ temperature :math:`T_{dew}` (K) and derive specific humidity :math:`q_{atm}` from .. math:: - :label: 31.15) + :label: 31.15 q_{atm} = \frac{0.622e_{sat}^{T_{dew} } }{P_{atm} -0.378e_{sat}^{T_{dew} } } . @@ -211,3 +214,39 @@ the procedure described above and then each term equally apportioned into the visible and near-infrared wavebands (e.g., :math:`S_{atm} \, \downarrow _{vis}^{\mu } =0.5S_{atm} \, \downarrow ^{\mu }` , :math:`S_{atm} \, \downarrow _{nir}^{\mu } =0.5S_{atm} \, \downarrow ^{\mu }` ). + +.. _Anomaly Forcing: + +Anomaly Forcing +----------------------------- + +The 'Anomaly Forcing' atmospheric forcing mode provides a means to drive +CLM with projections of future climate conditions without the need for +large, high-frequency datasets. From an existing climate simulation +spanning both the historical and future time periods, a set of anomalies +are created by removing a climatological seasonal cycle based on the end +of the historical period from each year of the future time period of the +simulation. These anomalies can then be applied to a repeating +high-frequency forcing dataset of finite duration (e.g. 10 years). State +and flux forcing variables are adjusted using additive and multiplicative +anomalies, respectively: + +.. math:: + :label: 31.16 + + \begin{array}{lr} + S^{'} = S + k_{anomaly} & \quad {\rm state \ variable} \\ + F^{'} = f * k_{anomaly} & \quad {\rm flux \ variable} + \end{array} + +where :math:`S^{'}` is the adjusted atmospheric state variable, :math:`S` +is the state variable from the high-frequency reference atmospheric +forcing dataset, and :math:`k_{anomaly}` is an additive anomaly. +Similarly, math:`F^{'}` is the adjusted atmospheric flux variable, +:math:`F` is the flux variable from the high-frequency reference +atmospheric forcing dataset, and :math:`k_{anomaly}` is a +multiplicative anomaly. State variables are temperature :math:`T_{atm}`, +pressure :math:`P_{atm}`, humidity :math:`q_{atm}`, and wind +:math:`W_{atm}`. Flux variables are precipitation :math:`P`, atmospheric +shortwave radiation :math:`S_{atm} \, \downarrow`, and atmospheric +longwave radiation :math:`L_{atm} \, \downarrow`. From e92ef848265e40a16d1eccac7505286192a78e92 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 2 Jun 2017 09:30:57 -0600 Subject: [PATCH 038/730] Update Hydrology Chapter --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 108 +++++++++++------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 0db3456163..4e203f8586 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -186,14 +186,14 @@ by the saturation excess mechanism (Dunne runoff) .. math:: :label: 7.64 - q_{over} =f_{sat} q_{liq,\, 0} + q_{over} =f_{sat} \ q_{liq,\, 0} The fractional saturated area is a function of soil moisture .. math:: :label: 7.65 - f_{sat} = f_{\max } \exp \left(-0.5 f_{over} z_{\nabla } \right) + f_{sat} = f_{\max } \ \exp \left(-0.5 f_{over} z_{\nabla } \right) where :math:`f_{\max }` is the potential or maximum value of :math:`f_{sat}`, :math:`f_{over}` is a decay factor (m\ :sup:`-1`), and @@ -248,7 +248,7 @@ height (relative to the grid cell mean elevation) of the surface water, W_{sfc} =\frac{d}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right)+\frac{\sigma _{micro} }{\sqrt{2\pi } } e^{\frac{-d^{2} }{2\sigma _{micro} ^{2} } } where :math:`erf` is the error function. For a given value of -:math:`W_{sfc}` , equation can be solved for :math:`d` using the +:math:`W_{sfc}`, :eq:`7.66` can be solved for :math:`d` using the Newton-Raphson method. Once :math:`d` is known, one can determine the fraction of the area that is inundated as @@ -267,7 +267,7 @@ parameterization is a simple function of slope where :math:`\beta` is the topographic slope, :math:`\beta _{0} =\left(\sigma _{\max } \right)^{\frac{1}{\eta } }` \ determines -the maximum value of :math:`\sigma _{}` , and :math:`\eta` is an +the maximum value of :math:`\sigma _{micro}` , and :math:`\eta` is an adjustable parameter. Default values in the model are :math:`\sigma _{\max } =0.4` and :math:`\eta =-3`. @@ -292,12 +292,12 @@ reservoir .. math:: :label: 7.70 - qout,h2osfc=kh2osfcf_{connected} (Wsfc-Wc)\frac{1}{\Delta t} + q_{out,h2osfc}=k_{h2osfc} \ f_{connected} \ (Wsfc-Wc)\frac{1}{\Delta t} -where :math:`qout,h2osfc` is the surface water runoff, :math:`kh2osfc` +where :math:`q_{out,h2osfc}` is the surface water runoff, :math:`k_{h2osfc}` is a constant, :math:`Wc` is the amount of surface water present when -:math:`f_{h2osfc} =f_{c}` , and :math:`\Delta t` is the model time step. -The linear storage coefficent :math:`kh2osfc=\sin \left(\beta \right)` +:math:`f_{h2osfc} = f_{c}` , and :math:`\Delta t` is the model time step. +The linear storage coefficent :math:`k_{h2osfc} = \sin \left(\beta \right)` is a function of grid cell mean topographic slope where :math:`\beta` is the slope in radians. @@ -312,7 +312,7 @@ removed, .. math:: :label: 7.71 - qin,surface=(1-f_{sat} )q_{liq,\, 0} + q_{in,surface} = (1-f_{sat}) \ q_{liq,\, 0} is divided into inputs to surface water (:math:`q_{in,\, h2osfc}` ) and the soil :math:`q_{in,soil}` . If :math:`q_{in,soil}` exceeds the @@ -322,10 +322,11 @@ s\ :sup:`-1`), .. math:: :label: 7.72 - q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat + q_{infl,\, \max } =(1-f_{sat}) \ \Theta_{ice} k_{sat} -where :math:`{\rm \Theta }ice` is an ice impedance factor (section -:numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff is generated +where :math:`\Theta_{ice}` is an ice impedance factor (section +:numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff +is generated .. math:: :label: 7.73 @@ -338,28 +339,28 @@ After evaporative losses have been removed, these moisture fluxes are .. math:: :label: 7.74 - q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} +q_{infl,excess} -q_{evap,h2osfc} + q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} + q_{infl,excess} - q_{evap,h2osfc} and .. math:: :label: 7.75 - qin,soil=(1-f_{h2osfc} )q_{in,surface} -q_{\inf l,excess} -(1-f_{sno} -f_{h2osfc} )qevap,soil. + q_{in,soil} = (1-f_{h2osfc}) q_{in,surface} - q_{\inf l,excess} - (1 - f_{sno} - f_{h2osfc} ) q_{evap,soil}. The balance of surface water is then calculated as .. math:: :label: 7.76 - \Delta W_{sfc} =\left(qin,h2osfc-qout,h2osfc-qdrain,h2osfc\right)\Delta t. + \Delta W_{sfc} =\left(q_{in,h2osfc} - q_{out,h2osfc} - q_{drain,h2osfc} \right) \ \Delta t. Bottom drainage from the surface water store .. math:: :label: 7.77 - qdrain,h2osfc=\min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) + q_{drain,h2osfc} = \min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) is then added to :math:`q_{in,soil}` giving the total infiltration into the surface soil layer @@ -367,7 +368,7 @@ into the surface soil layer .. math:: :label: 7.78 - q_{infl} =q_{in,soil} +q_{drain,h2osfc} + q_{infl} = q_{in,soil} + q_{drain,h2osfc} Infiltration :math:`q_{infl}` and explicit surface runoff :math:`q_{over}` are not allowed for glaciers. @@ -469,27 +470,34 @@ and organic properties of the soil (:ref:`Lawrence and Slater 2008 `). The hydraulic conductivity is defined at the depth of the interface of -two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) and is a function -of the saturated hydraulic conductivity +two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) +and is a function of the saturated hydraulic conductivity :math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil -moisture of the two layers :math:`\theta _{i}` and -:math:`\theta _{i+1}` and an ice impedance factor -:math:`\Theta _{ice}` +moisture of the two layers :math:`\theta_{i}` and +:math:`\theta_{i+1}` and an ice impedance factor +:math:`\Theta_{ice}` .. math:: :label: 7.85 k\left[z_{h,\, i} \right] = \left\{\begin{array}{lr} - \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ - \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} + \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta_{\, i} +\theta_{\, i+1} \right)}{0.5\left(\theta_{sat,\, i} +\theta_{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ + \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta_{\, i} }{\theta_{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} \end{array}\right\}. The ice impedance factor is a function of ice content, and is meant to quantify the increased tortuosity of the water flow when part of the pore space is filled with ice. :ref:`Swenson et al. (2012) ` -used a power law form :math:`\Theta _{ice} = 10^{-\Omega F_{ice} }` where -:math:`\Omega = 6`\ and +used a power law form + +.. math:: + :label: 7.86 + + \Theta _{ice} = 10^{-\Omega F_{ice}} + +where +:math:`\Omega = 6` and :math:`F_{ice} = \frac{\theta_{ice} }{\theta_{sat} }` is the ice-filled fraction of the pore space. @@ -512,7 +520,7 @@ porosity of organic matter and the porosity of the mineral soil .. math:: :label: 7.91 - \theta _{sai,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . + \theta _{sat,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . The exponent :math:`B_{i}` is @@ -566,10 +574,10 @@ fractions using a result from percolation theory (:ref:`Stauffer and Aharony 1994 `, :ref:`Berkowitz and Balberg 1992 `). Assuming that the organic and mineral fractions are randomly distributed throughout a soil layer, percolation theory predicts that above a threshold value -:math:`f_{om} =f_{threshold}` , connected flow pathways consisting of +:math:`f_{om} =f_{threshold}`, connected flow pathways consisting of organic material only exist and span the soil space. Flow through these pathways interacts only with organic material, and thus can be described -by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by +by :math:`k_{sat,\, om}`. This fraction of the grid cell is given by .. math:: :label: 7.97 @@ -714,7 +722,7 @@ and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total soil column for the :math:`j^{th}` PFT (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). -The soil water fluxes in equation , which are a function of +The soil water fluxes in :eq:`7.103`, which are a function of :math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of their dependence on hydraulic conductivity and soil matric potential, can be linearized about :math:`\theta` using a Taylor series expansion @@ -730,8 +738,8 @@ as q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } \Delta \theta _{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} . -Substitution of these expressions for :math:`q_{i}^{n+1}` and -:math:`q_{i-1}^{n+1}` into equation results in a general tridiagonal +Substitution of these expressions for :math:`q_{i}^{n+1}` and +:math:`q_{i-1}^{n+1}` into equation :eq:`7.103` results in a general tridiagonal equation set of the form .. math:: @@ -765,40 +773,40 @@ The tridiagonal equation set is solved over :math:`i=1,\ldots ,N_{levsoi}`. The finite-difference forms of the fluxes and partial derivatives in -equations - can be obtained from equation as +equations :eq:`7.111` - :eq:`7.114` can be obtained from :eq:`7.80` as .. math:: :label: 7.115 - q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: :label: 7.116 - q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} -z_{i} } \right] .. math:: :label: 7.117 - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] .. math:: :label: 7.118 - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] .. math:: :label: 7.119 - \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right] .. math:: :label: 7.120 - \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right]. + \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right]. The derivatives of the soil matric potential at the node depth are -derived from equation +derived from :eq:`7.94` .. math:: :label: 7.121 @@ -819,17 +827,31 @@ with the constraint :math:`0.01\, \theta _{sat,\, i} \le \theta _{\, i} \le \theta _{sat,\, i}` . The derivatives of the hydraulic conductivity at the layer interface are -derived from equation +derived from :eq:`7.85` + +.. check eqn .. math:: :label: 7.124 - \begin{array}{l} {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } =\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } =\left(1-\frac{f_{frz,\, i-1} +f_{frz,\, i} }{2} \right)\left(2B_{i-1} +3\right)k_{sat} \left[z_{h,\, i-1} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right]^{2B_{i-1} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right)} \end{array} + \begin{array}{l} + {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } + = \frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } + = \left(2B_{i-1} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i-1} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i-1} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array} + +where :math:`\overline{\theta}_{liq} = 0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)`, +:math:`\overline{\theta}_{sat} = 0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)`, +and :math:`\overline{\Theta}_{ice} = \Theta_{ice}(\overline{\theta}_{ice})` :eq:`7.86` + +and .. math:: :label: 7.125 - \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. + \begin{array}{l} + {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } + = \frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } + = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array}. Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' From 4a9c173c03674dce7078118106d573d979df5961 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 2 Jun 2017 09:42:44 -0600 Subject: [PATCH 039/730] correct reference in crop --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 55 ++++++++++--------- .../CLM50_Tech_Note_Introduction.rst | 2 +- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 2961569d3a..f5acbeca61 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -103,8 +103,8 @@ described by Levis et al. (:ref:`2016 `). A parameterization for winter cereals is developed but is not included in CLM5.0 due to the inability to distinguish between winter and summer cereals in the LUMIP dataset (insert citation). -CLM’s default list of plant functional types (pfts) includes an -unmanaged crop (Table 2.1) treated as a second C3 grass, as well as several +CLM’s default list of plant functional types (pfts) includes an unmanaged crop +(:numref:`Table Plant functional types`) treated as a second C3 grass, as well as several additional crop types that do not have associated parameters. The unmanaged crop has grid cell coverage assigned from satellite data, as do all natural pfts when CLM’s crop model is not active. [include remapping text here]. @@ -135,7 +135,7 @@ Corn and temperate cereals must meet the following requirements between April 1\ :sup:`st` and June 14\ :sup:`th` for planting in the northern hemisphere (NH): .. math:: - :label: ZEqnNum568682 + :label: 25.1 \begin{array}{l} {T_{10d} >T_{p} } \\ @@ -174,7 +174,7 @@ for the crop to reach vegetative and physiological maturity, :math:`{GDD}_{mat}`, according to the following AgroIBIS rules: .. math:: - :label: 25.2) + :label: 25.2 \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950}30} \end{array}\right\} .. math:: - :label: 25.13) + :label: 25.13 fxg=\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad \qquad {\rm for\; }GDD_{T_{2m} } \le 0.15} \\ {6.67\times GDD_{T_{2m} } -1\qquad \qquad \qquad {\rm for\; }0.150.75} \end{array}\right\} @@ -736,17 +737,17 @@ mobilized depends on the C:N ratio of the plant tissue, and is calculated as .. math:: - :label: 25.14) + :label: 25.14 leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } .. math:: - :label: 25.15) + :label: 25.15 stemn\_ to\_ retransn=\frac{c_{stem} }{CN_{stem} } -\frac{c_{stem} }{CN_{stem}^{f} } .. math:: - :label: 25.16) + :label: 25.16 frootn\_ to\_ retransn=\frac{c_{froot} }{CN_{froot} } -\frac{c_{froot} }{CN_{froot}^{f} } diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 29892825d8..027d92e9e2 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -136,7 +136,7 @@ Jinyun Tang, Zong-Liang Yang** - :numref:`Figure Water flux schematic` Schematic diagram of numerical scheme used to solve for soil water fluxes. -- :numref:`three layer snow pack` Example of three layer snow pack (snl=-3). +- :numref:`Figure three layer snow pack` Example of three layer snow pack (snl=-3). - :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. From 779cab3a879ac6ef875b18649d6dbd6b60543c50 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 2 Jun 2017 11:11:03 -0600 Subject: [PATCH 040/730] add new snow density equations --- .../References/CLM50_Tech_Note_References.rst | 7 +++++ .../CLM50_Tech_Note_Snow_Hydrology.rst | 30 +++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index dfb4b81d9c..73691897a2 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1885,6 +1885,13 @@ van Veen, J.A., Ladd, J.N. and Frissel, M.J., 1984. Modelling C and N turnover through the microbial biomass in soil. Plant and Soil, 76: 257-274. +.. _vanKampenhoutetal2017: + +van Kampenhout, L., J.T.M. Lenaerts, W.H. Lipscomb, W.J. Sacks, D.M. +Lawrence, A.G. Slater, and M.R. van den Broeke, 2017. +Improving the representation of polar snow and firn in the +Community Earth System Model, submitted. + .. _VanVuurenetal2006: Van Vuuren, D.P., Lucas, P.S., and Hilderink, H.B.M., 2006. Downscaling diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index 5f87ec2f1a..a97e161526 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -141,21 +141,39 @@ where \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg -m\ :sup:`-3`) (:ref:`Anderson (1976) `) +m\ :sup:`-3`) (:ref:`van Kampenhout et al. (2017) `, +:ref:`Anderson (1976) `) .. math:: :label: 8.21 - \rho _{sno} = + \rho_{sno} = \left\{\begin{array}{lr} 50 + 1.7 \left(17\right)^{1.5} & \qquad T_{atm} >T_{f} +2 \ \\ 50+1.7 \left(T_{atm} -T_{f} + 15\right)^{1.5} & \qquad T_{f} - 15 < T_{atm} \le T_{f} + 2 \ \\ - 50 &\qquad T_{atm} \le T_{f} - 15 + -3.833 \ \left( T_{atm} -T_{f} \right) - 0.0333 \ \left( T_{atm} -T_{f} \right)^{2} + &\qquad T_{atm} \le T_{f} - 15 \end{array}\right\} -where :math:`T_{atm}` is the atmospheric temperature (K), and -:math:`T_{f}` is the freezing temperature of water (K) (Table 2.6). The -mass of snow :math:`W_{sno}` is +.. bifall(c) = -(50._r8/15._r8 + 0.0333_r8*15_r8)*(forc_t(c)-tfrz) - 0.0333_r8*(forc_t(c)-tfrz)**2 + +where :math:`T_{atm}` is the atmospheric temperature (K), and :math:`T_{f}` is +the freezing temperature of water (K) (:numref:`Table Physical Constants`). When +wind speed :math:`W_{atm}` is greater than 0.1 m :sub:`-1`, snow density +increases due to wind-driven compaction according to +:ref:`(van Kampenhout et al. 2017) ` + +.. math:: + :label: 8.21b + + \Delta \rho_{sno} = 266.861 \left(\frac{1 + tanh(\frac{W_{atm}}{5})}{2}\right)^{8.8} + +where :math:`\Delta \rho_{sno}` (kg m\ :sup:`-3`) is the increase in snow +density relative to :eq:`8.21`. + +.. bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + TANH(forc_wind(g)/5.0_r8))/2._r8)**8.8_r8) + +The mass of snow :math:`W_{sno}` is .. math:: :label: 8.22 From 84cedaf9968119bd9b4c0a9e47b4729a8a67fa35 Mon Sep 17 00:00:00 2001 From: Justin Perket Date: Fri, 2 Jun 2017 16:01:29 -0600 Subject: [PATCH 041/730] Added descriptions of canopy snow hydrology and albedo. And fixed a couple typos --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 2 +- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 520 ++++++++++-------- .../References/CLM50_Tech_Note_References.rst | 15 +- .../CLM50_Tech_Note_Surface_Albedos.rst | 23 +- 4 files changed, 315 insertions(+), 245 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index df44ae6fe1..e8b78225dc 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -906,7 +906,7 @@ of the components in the coupled modeling system, are presented in "Molecular weight of water vapor", :math:`MW_{wv}`, 18.016, kg kmol :sup:`-1` "Water vapor gas constant", :math:`R_{wv}`, :math:`{R_{gas} \mathord{\left/ {\vphantom {R_{gas} MW_{wv} }} \right. \kern-\nulldelimiterspace} MW_{wv} }`, J K :sup:`-1` kg :sup:`-1` "Von Karman constant", :math:`k`, 0.4, "\-" - "Freezing temperature of fresh water", :math:`T_{f}`, 273.5, K + "Freezing temperature of fresh water", :math:`T_{f}`, 273.15, K "Density of liquid water", :math:`\rho _{liq}`, 1000, kg m :sup:`-3` "Density of ice", :math:`\rho _{ice}`, 917, kg m :sup:`-3` "Specific heat capacity of dry air", :math:`C_{p}`, 1.00464 :math:`\times 10^{3}`, J kg :sup:`-1` K :sup:`-1` diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 4e203f8586..e86d47e701 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -7,8 +7,9 @@ The model parameterizes interception, throughfall, canopy drip, snow accumulation and melt, water transfer between snow layers, infiltration, evaporation, surface runoff, sub-surface drainage, redistribution within the soil column, and groundwater discharge and recharge to simulate -changes in canopy water :math:`\Delta W_{can}` , surface water -:math:`\Delta W_{sfc}` , snow water :math:`\Delta W_{sno}` , soil water +changes in canopy water :math:`\Delta W_{can,\,liq}` , canopy snow water +:math:`\Delta W_{can,\,sno}` surface water :math:`\Delta W_{sfc}` , +snow water :math:`\Delta W_{sno}` , soil water :math:`\Delta w_{liq,\, i}` , and soil ice :math:`\Delta w_{ice,\, i}` , and water in the unconfined aquifer :math:`\Delta W_{a}` (all in kg m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Figure Hydrologic processes`). @@ -16,9 +17,9 @@ m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Figure Hydrologic processes`). The total water balance of the system is .. math:: - :label: 7.1 + :label: 7.1) - \begin{array}{l} {\Delta W_{can} +\Delta W_{sfc} +\Delta W_{sno} +} \\ {\sum _{i=1}^{N_{levsoi} }\left(\Delta w_{liq,\, i} +\Delta w_{ice,\, i} \right)+\Delta W_{a} =\left(\begin{array}{l} {q_{rain} +q_{sno} -E_{v} -E_{g} -q_{over} } \\ {-q_{h2osfc} -q_{drai} -q_{rgwl} -q_{snwcp,\, ice} } \end{array}\right) \Delta t} \end{array} + \begin{array}{l} {\Delta W_{can,\,liq} +\Delta W_{can,\,sno} +\Delta W_{sfc} +\Delta W_{sno} +} \\ {\sum _{i=1}^{N_{levsoi} }\left(\Delta w_{liq,\, i} +\Delta w_{ice,\, i} \right)+\Delta W_{a} =\left(\begin{array}{l} {q_{rain} +q_{sno} -E_{v} -E_{g} -q_{over} } \\ {-q_{h2osfc} -q_{drai} -q_{rgwl} -q_{snwcp,\, ice} } \end{array}\right) \Delta t} \end{array} where :math:`q_{rain}` is the liquid part of precipitation, :math:`q_{sno}` is the solid part of precipitation, :math:`E_{v}` is @@ -31,8 +32,8 @@ from glaciers, wetlands, and lakes, and runoff from other surface types due to snow capping (section :numref:`Runoff from glaciers and snow-capped surfaces`) (all in kg m\ :sup:`-2` s\ :sup:`-1`), :math:`N_{levsoi}` is the number of soil layers (note that hydrology calculations are only done over soil layers 1 to -:math:`N_{levsoi}` ; ground levels :math:`N_{levsoi} +1`\ to -:math:`N_{levgrnd}` are currently hydrologically inactive; :ref:`(Lawrence et +:math:`N_{levsoi}` ; ground levels :math:`N_{levsoi} +1` \ to +:math:`N_{levgrnd}` are currently hydrologically inactive; :ref:`(Lawrence et al. 2008) ` and :math:`\Delta t` is the time step (s). .. _Figure Hydrologic processes: @@ -46,85 +47,158 @@ al. 2008) ` and :math:`\Delta t` is the time step (s). Canopy Water ---------------- -Precipitation is either intercepted by the canopy, falls directly to the +Liquid precipitation is either intercepted by the canopy, falls directly to the snow/soil surface (throughfall), or drips off the vegetation (canopy -drip). Interception by vegetation :math:`q_{intr}` (kg -m\ :sup:`-2` s\ :sup:`-1`) does not distinguish between -liquid and solid phases +drip). Solid precipitation is treated similiar, with the addition of unloading of previously intercepted snow. +Interception by vegetation is divided between liquid and solid phases +:math:`q_{intr,\,liq}` and :math:`q_{intr,\,ice}` (kg m\ :sup:`-2` s\ :sup:`-1`) .. math:: - :label: 7.2 + :label: 7.2) - q_{intr} =\alpha \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + q_{intr,\,liq} =\alpha_{liq} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} +.. math:: + :label: 7.3) + + q_{intr,\,ice} =\alpha_{sno} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + + where :math:`L` and :math:`S` are the exposed leaf and stem area index, -respectively (section :numref:`Phenology and vegetation burial by snow`), -and :math:`\alpha =0.25` scales interception from point to grid cell -(:ref:`Lawrence et al. 2007 `). Throughfall -(kg m\ :sup:`-2` s\ :sup:`-1`), however, is divided into -liquid and solid phases reaching the ground (soil or snow surface) as +respectively (section 2.1.4), and the :math:`\alpha`\'s scale +the fractional area of a leaf that collects water (:ref:`Lawrence et al. 2007 `). +Values of :math:`\alpha_{liq} = 0.25` and :math:`\alpha_{sno} = 1` reflect the increased capacity one side of a leaf has for snow than liquid water. +Throughfall (kg m\ :sup:`-2` s\ :sup:`-1`) is also divided into +liquid and solid phases, reaching the ground (soil or snow surface) as .. math:: - :label: 7.3 + :label: 7.4) - q_{thru,\, liq} =q_{rain} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] + q_{thru,\, liq} =q_{rain} \left[1-\alpha_{liq} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] .. math:: - :label: 7.4 + :label: 7.5) - q_{thru,\, ice} =q_{sno} \left[1-\alpha \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. + q_{thru,\, ice} =q_{sno} \left[1-\alpha_{sno} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. -Similarly, the canopy drip is +Similarly, the liquid and solid canopy drip fluxes are .. math:: - :label: 7.5 + :label: 7.6) - q_{drip,\, liq} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{rain} }{q_{rain} +q_{sno} } \ge 0 + q_{drip,\, liq} =\frac{W_{can,\,liq}^{intr} -W_{can,\,liq}^{max } }{\Delta t} \ge 0 .. math:: - :label: 7.6 + :label: 7.7) - q_{drip,\, ice} =\frac{W_{can}^{intr} -W_{can,\, \max } }{\Delta t} \frac{q_{sno} }{q_{rain} +q_{sno} } \ge 0 + q_{drip,\, ice} =\frac{W_{can,\,sno}^{intr} -W_{can,\,sno}^{max } }{\Delta t} \ge 0 where .. math:: - :label: 7.7 + :label: 7.8) + + W_{can,liq}^{intr} =W_{can,liq}^{n} +q_{intr} \Delta t\ge 0 + +and + +.. math:: + :label: 7.9) + + W_{can,sno}^{intr} =W_{can,sno}^{n} +q_{intr} \Delta t\ge 0 + + +are the the canopy liquid water and snow water equivalent after accounting for interception, +:math:`W_{can,\,liq}^{n}` and :math:`W_{can,\,sno}^{n}` are the canopy liquid and snow water +from the previous time step, and :math:`W_{can,\,liq}^{max }` and :math:`W_{can,\,snow}^{max }` +(kg m\ :sup:`-2` or mm of H\ :sub:`2`\ O) are the maximum amounts of liquid water and snow the canopy can hold. +They are defined by + +.. math:: + :label: 7.10) + + W_{can,\,liq}^{max } =p_{liq}\left(L+S\right) + +.. math:: + :label: 7.11) + + W_{can,\,sno}^{max } =p_{ice}\left(L+S\right). + +The maximum storage of liquid water is :math:`p_{liq}=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. +1993 `), and that of snow is :math:`p_{sno}=6`, consistent with reported +field measurements (:ref:`Pomeroy et al. 1998 `). + +Canopy snow unloading from wind speed :math:`u` and above-freezing temperatures are modeled from linear +fluxes and e-folding times similar to :ref:`Roesch et al. (2001) ` + +.. math:: + :label: 7.12) + + q_{unl,\, wind} =\frac{u W_{can,sno}}{1.56\times 10^5 \text{ m}} + +.. math:: + :label: 7.13) + + q_{unl,\, temp} =\frac{W_{can,sno}(T-270 \textrm{ K})}{1.87\times 10^5 \text{ K s}} > 0 + +.. math:: + :label: 7.14) + + q_{unl,\, tot} =\min \left( q_{unl,\, wind} +q_{unl,\, temp} ,W_{can,\, sno} \right) + + +The canopy liquid water and snow water equivalent are updated as + +.. math:: + :label: 7.15) - W_{can}^{intr} =W_{can}^{n} +q_{intr} \Delta t\ge 0 + W_{can,\, liq}^{n+1} =W_{can,liq}^{n} + q_{intr,\, liq} - q_{drip,\, liq} \Delta t - E_{v}^{liq} \Delta t \ge 0 -is the canopy water after accounting for interception, -:math:`W_{can}^{n}` is the canopy water from the previous time step, -and :math:`W_{can,\, \max }` (kg m\ :sup:`-2`) is the maximum -amount of water the canopy can hold +and .. math:: - :label: 7.8 + :label: 7.16) + + W_{can,\, sno}^{n+1} =W_{can,sno}^{n} + q_{intr,\, ice} - \left(q_{drip,\, ice}+q_{unl,\, tot} \right)\Delta t + - E_{v}^{ice} \Delta t \ge 0 + +.. W_{can}^{n+1} =W_{can}^{n} +q_{intr} \Delta t-\left(q_{drip,\, liq} +q_{drip,\, ice} \right)\Delta t-E_{v}^{w} \Delta t\ge 0. + +where :math:`E_{v}^{liq}` and :math:`E_{v}^{ice}` are partitioned from the stem and leaf +surface evaporation :math:`E_{v}^{w}` (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) based on the vegetation temperature :math:`T_{v}` (K) (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) and its relation to the freezing temperature of water :math:`T_{f}` (K) (:numref:`Table Physical Constants`) - W_{can,\, \max } =p\left(L+S\right). +.. math:: + :label: 7.17) -The maximum storage of solid water is assumed to be the same as that of -liquid water, :math:`p=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. -1993 `). The canopy water is updated as + E_{v}^{liq} &= \begin{cases} + E_{v}^{w} & T_v > T_{f} \\ + 0 & T_v \le T_f + \end{cases} .. math:: - :label: 7.9 + :label: 7.18) + + E_{v}^{ice} &= \begin{cases} + 0 & T_v > T_f \\ + E_{v}^{w} & T_v \le T_f + \end{cases} . - W_{can}^{n+1} =W_{can}^{n} +q_{intr} \Delta t-\left(q_{drip,\, liq} +q_{drip,\, ice} \right)\Delta t-E_{v}^{w} \Delta t\ge 0. +.. \begin{array}{lr} +.. E_{v}^{liq} = E_{v}^{w} \qquad T > 273 \text{K} \\ +.. E_{v}^{ice} = E_{v}^{w} \qquad T \le 273 \text{K} +.. \end{array} -where :math:`E_{v}^{w}` is the flux of water vapor from stem and leaf -surfaces (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`). The total rate of liquid and solid precipitation -reaching the ground is then +The total rate of liquid and solid precipitation reaching the ground is then .. math:: - :label: 7.10 + :label: ZEqnNum946822 q_{grnd,liq} =q_{thru,\, liq} +q_{drip,\, liq} .. math:: - :label: 7.11 + :label: ZEqnNum339590 - q_{grnd,ice} =q_{thru,\, ice} +q_{drip,\, ice} . + q_{grnd,ice} =q_{thru,\, ice} +q_{drip,\, ice} +q_{unl,\, tot} . Solid precipitation reaching the soil or snow surface, :math:`q_{grnd,\, ice} \Delta t`, is added immediately to the snow pack @@ -135,22 +209,22 @@ and snow/soil temperatures (Chapter :numref:`rst_Soil and Snow Temperatures`) have been determined. The wetted fraction of the canopy (stems plus leaves), which is required -for the surface albedo (section :numref:`Canopy Radiative Transfer`) and surface flux (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) -calculations is (:ref:`Dickinson et al.1993 `) +for surface flux (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) +calculations, is (:ref:`Dickinson et al.1993 `) .. math:: - :label: 7.12 + :label: 7.21) f_{wet} = \left\{\begin{array}{lr} - \left[\frac{W_{can} }{p\left(L+S\right)} \right]^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \le 1 & \qquad L+S > 0 \\ + \left[\frac{W_{can} }{p_{liq}\left(L+S\right)} \right]^{{2\mathord{\left/ {\vphantom {2 3}} \right. \kern-\nulldelimiterspace} 3} } \le 1 & \qquad L+S > 0 \\ 0 &\qquad L+S = 0 \end{array}\right\} while the fraction of the canopy that is dry and transpiring is .. math:: - :label: 7.13 + :label: 7.22) f_{dry} = \left\{\begin{array}{lr} @@ -158,6 +232,19 @@ while the fraction of the canopy that is dry and transpiring is 0 &\qquad L+S = 0 \end{array}\right\}. +Similarly, the snow-covered fraction of the canopy is used for surface alebdo when intercepted snow is present (Chapter :numref:`rst_Surface Albedos`) + + +.. math:: + :label: 7.23) + + f_{can,\, sno} = + \left\{\begin{array}{lr} + \left[\frac{W_{can,\, sno} }{p_{sno}\left(L+S\right)} \right]^{{3\mathord{\left/ {\vphantom {3 20}} \right. \kern-\nulldelimiterspace} 20} } \le 1 & \qquad L+S > 0 \\ + 0 &\qquad L+S = 0 + \end{array}\right\}. + + .. _Surface Runoff, Surface Water Storage, and Infiltration: Surface Runoff, Surface Water Storage, and Infiltration @@ -184,21 +271,21 @@ portion of a grid cell contributes to surface runoff, :math:`q_{over}` , by the saturation excess mechanism (Dunne runoff) .. math:: - :label: 7.64 + :label: ZEqnNum549608 - q_{over} =f_{sat} \ q_{liq,\, 0} + q_{over} =f_{sat} q_{liq,\, 0} The fractional saturated area is a function of soil moisture .. math:: - :label: 7.65 + :label: 7.65) - f_{sat} = f_{\max } \ \exp \left(-0.5 f_{over} z_{\nabla } \right) + f_{sat} =f_{\max } \exp \left(-0.5f_{over} z_{\nabla } \right) -where :math:`f_{\max }` is the potential or maximum value of -:math:`f_{sat}`, :math:`f_{over}` is a decay factor (m\ :sup:`-1`), and -:math:`z_{\nabla}` is the water table depth (m) (section -:numref:`Lateral Sub-surface Runoff`). The maximum saturated fraction, :math:`f_{\max }` , +where :math:`f_{\max }` is the potential or maximum value of +:math:`f_{sat}` , :math:`f_{over}` is a decay factor +(m\ :sup:`-1`), and :math:`z_{\nabla}` is the water table depth +(m) (section 7.6). The maximum saturated fraction, :math:`f_{\max }` , is defined as the value of the discrete cumulative distribution function (CDF) of the topographic index when the grid cell mean water table depth is zero. Thus, :math:`f_{\max }` is the percent of pixels in a grid @@ -243,17 +330,17 @@ height (relative to the grid cell mean elevation) of the surface water, :math:`d`, by .. math:: - :label: 7.66 + :label: ZEqnNum277892 W_{sfc} =\frac{d}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right)+\frac{\sigma _{micro} }{\sqrt{2\pi } } e^{\frac{-d^{2} }{2\sigma _{micro} ^{2} } } where :math:`erf` is the error function. For a given value of -:math:`W_{sfc}`, :eq:`7.66` can be solved for :math:`d` using the +:math:`W_{sfc}` , equation can be solved for :math:`d` using the Newton-Raphson method. Once :math:`d` is known, one can determine the fraction of the area that is inundated as .. math:: - :label: 7.67 + :label: 7.67) f_{h2osfc} =\frac{1}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right) @@ -261,13 +348,13 @@ No global datasets exist for microtopography, so the default parameterization is a simple function of slope .. math:: - :label: 7.68 + :label: 7.68) \sigma _{micro} =\left(\beta +\beta _{0} \right)^{\eta } where :math:`\beta` is the topographic slope, :math:`\beta _{0} =\left(\sigma _{\max } \right)^{\frac{1}{\eta } }` \ determines -the maximum value of :math:`\sigma _{micro}` , and :math:`\eta` is an +the maximum value of :math:`\sigma _{}` , and :math:`\eta` is an adjustable parameter. Default values in the model are :math:`\sigma _{\max } =0.4` and :math:`\eta =-3`. @@ -278,7 +365,7 @@ percolation theory can be used to quantify the fraction of the inundated portion of the grid cell that is interconnected .. math:: - :label: 7.69 + :label: 7.69) \begin{array}{lr} f_{connected} =\left(f_{h2osfc} -f_{c} \right)^{\mu } & \qquad f_{h2osfc} >f_{c} \\ f_{connected} =0 &\qquad f_{h2osfc} \le f_{c} \end{array} @@ -290,14 +377,14 @@ surpasses :math:`f_{c}` , the surface water store acts as a linear reservoir .. math:: - :label: 7.70 + :label: 7.70) - q_{out,h2osfc}=k_{h2osfc} \ f_{connected} \ (Wsfc-Wc)\frac{1}{\Delta t} + qout,h2osfc=kh2osfcf_{connected} (Wsfc-Wc)\frac{1}{\Delta t} -where :math:`q_{out,h2osfc}` is the surface water runoff, :math:`k_{h2osfc}` +where :math:`qout,h2osfc` is the surface water runoff, :math:`kh2osfc` is a constant, :math:`Wc` is the amount of surface water present when -:math:`f_{h2osfc} = f_{c}` , and :math:`\Delta t` is the model time step. -The linear storage coefficent :math:`k_{h2osfc} = \sin \left(\beta \right)` +:math:`f_{h2osfc} =f_{c}` , and :math:`\Delta t` is the model time step. +The linear storage coefficent :math:`kh2osfc=\sin \left(\beta \right)` is a function of grid cell mean topographic slope where :math:`\beta` is the slope in radians. @@ -310,9 +397,9 @@ The surface moisture flux remaining after surface runoff has been removed, .. math:: - :label: 7.71 + :label: 7.71) - q_{in,surface} = (1-f_{sat}) \ q_{liq,\, 0} + qin,surface=(1-f_{sat} )q_{liq,\, 0} is divided into inputs to surface water (:math:`q_{in,\, h2osfc}` ) and the soil :math:`q_{in,soil}` . If :math:`q_{in,soil}` exceeds the @@ -320,16 +407,15 @@ maximum soil infiltration capacity (kg m\ :sup:`-2` s\ :sup:`-1`), .. math:: - :label: 7.72 + :label: ZEqnNum569150 - q_{infl,\, \max } =(1-f_{sat}) \ \Theta_{ice} k_{sat} + q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat -where :math:`\Theta_{ice}` is an ice impedance factor (section -:numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff -is generated +where :math:`{\rm \Theta }ice` is an ice impedance factor (section +:numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff is generated .. math:: - :label: 7.73 + :label: 7.73) q_{infl,\, excess} =\max \left(q_{in,soil} -\left(1-f_{h2osfc} \right)q_{\inf l,\max } ,0\right) @@ -337,38 +423,38 @@ and transferred from :math:`q_{in,soil}` to :math:`q_{in,h2osfc}` . After evaporative losses have been removed, these moisture fluxes are .. math:: - :label: 7.74 + :label: 7.74) - q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} + q_{infl,excess} - q_{evap,h2osfc} + q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} +q_{infl,excess} -q_{evap,h2osfc} and .. math:: - :label: 7.75 + :label: 7.75) - q_{in,soil} = (1-f_{h2osfc}) q_{in,surface} - q_{\inf l,excess} - (1 - f_{sno} - f_{h2osfc} ) q_{evap,soil}. + qin,soil=(1-f_{h2osfc} )q_{in,surface} -q_{\inf l,excess} -(1-f_{sno} -f_{h2osfc} )qevap,soil. The balance of surface water is then calculated as .. math:: - :label: 7.76 + :label: 7.76) - \Delta W_{sfc} =\left(q_{in,h2osfc} - q_{out,h2osfc} - q_{drain,h2osfc} \right) \ \Delta t. + \Delta W_{sfc} =\left(qin,h2osfc-qout,h2osfc-qdrain,h2osfc\right)\Delta t. Bottom drainage from the surface water store .. math:: - :label: 7.77 + :label: 7.77) - q_{drain,h2osfc} = \min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) + qdrain,h2osfc=\min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) is then added to :math:`q_{in,soil}` giving the total infiltration into the surface soil layer .. math:: - :label: 7.78 + :label: 7.78) - q_{infl} = q_{in,soil} + q_{drain,h2osfc} + q_{infl} =q_{in,soil} +q_{drain,h2osfc} Infiltration :math:`q_{infl}` and explicit surface runoff :math:`q_{over}` are not allowed for glaciers. @@ -389,12 +475,12 @@ For one-dimensional vertical water flow in soils, the conservation of mass is stated as .. math:: - :label: 7.79 + :label: ZEqnNum790844 \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q where :math:`\theta` is the volumetric soil water content -(mm\ :sup:`3` of water mm\ :sup:`-3` of soil), :math:`t` is +(mm\ :sup:`3` of water / mm\ :sup:`-3` of soil), :math:`t` is time (s), :math:`z` is height above some datum in the soil column (mm) (positive upwards), :math:`q` is soil water flux (kg m\ :sup:`-2` s\ :sup:`-1` or mm s\ :sup:`-1`) (positive upwards), and @@ -411,7 +497,7 @@ The soil water flux :math:`q` in equation can be described by Darcy’s law :ref:`(Dingman 2002) ` .. math:: - :label: 7.80 + :label: 7.80) q=-k\frac{\partial \psi _{h} }{\partial z} @@ -420,7 +506,7 @@ and :math:`\psi _{h}` is the hydraulic potential (mm). The hydraulic potential is .. math:: - :label: 7.81 + :label: 7.81) \psi _{h} =\psi _{m} +\psi _{z} @@ -433,22 +519,22 @@ If the reference elevation is the soil surface, then becomes .. math:: - :label: 7.82 + :label: ZEqnNum186573 q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. -Equation :eq:`7.82` can be further manipulated to yield +Equation :eq:`ZEqnNum186573` can be further manipulated to yield .. math:: - :label: 7.83 + :label: 7.83) q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). -Substitution of this equation into equation :eq:`7.79`, with :math:`Q=0`, yields +Substitution of this equation into equation :eq:`ZEqnNum790844`, with :math:`Q=0`, yields the Richards equation .. math:: - :label: 7.84 + :label: ZEqnNum670361 \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right)\right]. @@ -460,8 +546,7 @@ Hydraulic Properties The hydraulic conductivity :math:`k_{i}` (mm s\ :sup:`-1`) and the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` vary with volumetric soil water :math:`\theta _{i}` and soil texture. -As with the soil thermal properties (section -:numref:`Soil And Snow Thermal Properties`) the hydraulic +As with the soil thermal properties (section :numref:`Soil And Snow Thermal Properties`) the hydraulic properties of the soil are assumed to be a weighted combination of the mineral properties, which are determined according to sand and clay contents based on work by :ref:`Clapp and Hornberger (1978) @@ -470,34 +555,27 @@ and organic properties of the soil (:ref:`Lawrence and Slater 2008 `). The hydraulic conductivity is defined at the depth of the interface of -two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) -and is a function of the saturated hydraulic conductivity +two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) and is a function +of the saturated hydraulic conductivity :math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil -moisture of the two layers :math:`\theta_{i}` and -:math:`\theta_{i+1}` and an ice impedance factor -:math:`\Theta_{ice}` +moisture of the two layers :math:`\theta _{i}` and +:math:`\theta _{i+1}` and an ice impedance factor +:math:`\Theta _{ice}` .. math:: - :label: 7.85 + :label: ZEqnNum398074 k\left[z_{h,\, i} \right] = \left\{\begin{array}{lr} - \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta_{\, i} +\theta_{\, i+1} \right)}{0.5\left(\theta_{sat,\, i} +\theta_{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ - \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta_{\, i} }{\theta_{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} + \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ + \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} \end{array}\right\}. The ice impedance factor is a function of ice content, and is meant to quantify the increased tortuosity of the water flow when part of the pore space is filled with ice. :ref:`Swenson et al. (2012) ` -used a power law form - -.. math:: - :label: 7.86 - - \Theta _{ice} = 10^{-\Omega F_{ice}} - -where -:math:`\Omega = 6` and +used a power law form :math:`\Theta _{ice} = 10^{-\Omega F_{ice} }` where +:math:`\Omega = 6`\ and :math:`F_{ice} = \frac{\theta_{ice} }{\theta_{sat} }` is the ice-filled fraction of the pore space. @@ -507,7 +585,7 @@ computed as weighted averages of the properties of the mineral and organic components. The water content at saturation (i.e. porosity) is .. math:: - :label: 7.90 + :label: 7.90) \theta _{sat,i} =(1-f_{om,i} )\theta _{sat,\min ,i} +f_{om,i} \theta _{sat,om} @@ -518,21 +596,21 @@ porosity of organic matter and the porosity of the mineral soil :math:`\theta _{sat,\min ,i}` is .. math:: - :label: 7.91 + :label: 7.91) - \theta _{sat,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . + \theta _{sai,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . The exponent :math:`B_{i}` is .. math:: - :label: 7.92 + :label: 7.92) B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and .. math:: - :label: 7.93 + :label: 7.93) B_{\min ,i} =2.91+0.159(\% clay)_{i} . @@ -540,14 +618,14 @@ The soil matric potential (mm) is defined at the node depth :math:`z_{i}` of each layer :math:`i` (:numref:`Figure Water flux schematic`) .. math:: - :label: 7.94 + :label: ZEqnNum316201 \psi _{i} =\psi _{sat,\, i} \left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad 0.01\le \frac{\theta _{i} }{\theta _{sat,\, i} } \le 1 where the saturated soil matric potential (mm) is .. math:: - :label: 7.95 + :label: 7.95) \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} @@ -556,7 +634,7 @@ saturated organic matter matric potential and the saturated mineral soil matric potential :math:`\psi _{sat,\min ,i}` \ is .. math:: - :label: 7.96 + :label: 7.96) \psi _{sat,\, \min ,\, i} =-10.0\times 10^{1.88-0.0131(\% sand)_{i} } . @@ -574,13 +652,13 @@ fractions using a result from percolation theory (:ref:`Stauffer and Aharony 1994 `, :ref:`Berkowitz and Balberg 1992 `). Assuming that the organic and mineral fractions are randomly distributed throughout a soil layer, percolation theory predicts that above a threshold value -:math:`f_{om} =f_{threshold}`, connected flow pathways consisting of +:math:`f_{om} =f_{threshold}` , connected flow pathways consisting of organic material only exist and span the soil space. Flow through these pathways interacts only with organic material, and thus can be described -by :math:`k_{sat,\, om}`. This fraction of the grid cell is given by +by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by .. math:: - :label: 7.97 + :label: 7.97) \begin{array}{lr} f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta _{perc} } f_{om} {\rm \; } & \qquad f_{om} \ge f_{threshold} \\ @@ -595,7 +673,7 @@ hydraulic conductivity is assumed to correspond to flow pathways that pass through the mineral and organic components in series .. math:: - :label: 7.98 + :label: 7.98) k_{sat,\, uncon} =f_{uncon} \left(\frac{\left(1-f_{om} \right)}{k_{sat,\, \min } } +\frac{\left(f_{om} -f_{perc} \right)}{k_{sat,\, om} } \right)^{-1} . @@ -603,7 +681,7 @@ where saturated hydraulic conductivity for mineral soil depends on soil texture (:ref:`Cosby et al. 1984 `) as .. math:: - :label: 7.99 + :label: 7.99) k_{sat,\, \min } \left[z_{h,\, i} \right]=0.0070556\times 10^{-0.884+0.0153\left(\% sand\right)_{i} } . @@ -611,7 +689,7 @@ The bulk soil layer saturated hydraulic conductivity is then computed as .. math:: - :label: 7.100 + :label: 7.100) k_{sat} \left[z_{h,\, i} \right]=f_{uncon,\, i} k_{sat,\, uncon} \left[z_{h,\, i} \right]+(1-f_{uncon,\, i} )k_{sat,\, om} \left[z_{h,\, i} \right]. @@ -620,11 +698,11 @@ as Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ -With reference to :numref:`Figure Water flux schematic`, the equation for -conservation of mass :eq:`7.79` can be integrated over each layer as +With reference to :numref:`Figure Water flux schematic`, the equation for conservation of mass +(equation :eq:`ZEqnNum790844`) can be integrated over each layer as .. math:: - :label: 7.101 + :label: 7.101) \int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial \theta }{\partial t} \, dz=-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial q}{\partial z} \, dz-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }Q\, dz . @@ -633,7 +711,7 @@ as positive upward from the soil surface. This equation can be written as .. math:: - :label: 7.102 + :label: ZEqnNum225309 \Delta z_{i} \frac{\partial \theta _{liq,\, i} }{\partial t} =-q_{i-1} +q_{i} -e_{i} @@ -645,7 +723,7 @@ the layer (mm s\ :sup:`-1`). Taking the finite difference with time and evaluating the fluxes implicitly at time :math:`n+1` yields .. math:: - :label: 7.103 + :label: ZEqnNum181361 \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =-q_{i-1}^{n+1} +q_{i}^{n+1} -e_{i} @@ -660,7 +738,7 @@ function of the total transpiration :math:`E_{v}^{t}` (Chapter :numref:`rst_Mom the effective root fraction :math:`r_{e,\, i}` .. math:: - :label: 7.104 + :label: ZEqnNum357392 e_{i} =r_{e,\, i} E_{v}^{t} . @@ -686,7 +764,7 @@ soil column, the transpiration :math:`E_{v}^{t}` is a weighted sum of transpiration from all PFTs whose weighting depends on PFT area as .. math:: - :label: 7.105 + :label: 7.105) E_{v}^{t} =\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} @@ -699,7 +777,7 @@ quantity that is a weighted sum over all PFTs. The weighting depends on the per unit area transpiration of each PFT and its relative area as .. math:: - :label: 7.106 + :label: 7.106) r_{e,\, i} =\frac{\sum _{j=1}^{npft}\left(r_{e,\, i} \right)_{j} \left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} }{\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} } @@ -707,65 +785,60 @@ where :math:`\left(r_{e,\, i} \right)_{j}` is the effective root fraction for the :math:`j^{th}` PFT .. math:: - :label: 7.107 + :label: 7.107) - \begin{array}{lr} - \left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } & \qquad \left(\beta _{t} \right)_{j} >0 \\ - \left(r_{e,\, i} \right)_{j} =0 & \qquad \left(\beta _{t} \right)_{j} =0 - \end{array} + \begin{array}{l} {\left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } \qquad \left(\beta _{t} \right)_{j} >0} \\ {\left(r_{e,\, i} \right)_{j} =0\qquad \left(\beta _{t} \right)_{j} =0} \end{array} and :math:`\left(r_{i} \right)_{j}` is the fraction of roots in layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), -:math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor for -layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), -and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total -soil column for the :math:`j^{th}` PFT (Chapter -:numref:`rst_Stomatal Resistance and Photosynthesis`). +:math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor +for layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total +soil column for the :math:`j^{th}` PFT (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). -The soil water fluxes in :eq:`7.103`, which are a function of +The soil water fluxes in equation , which are a function of :math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of their dependence on hydraulic conductivity and soil matric potential, can be linearized about :math:`\theta` using a Taylor series expansion as .. math:: - :label: 7.108 + :label: 7.108) q_{i}^{n+1} =q_{i}^{n} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } \Delta \theta _{liq,\, i+1} .. math:: - :label: 7.109 + :label: 7.109) q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } \Delta \theta _{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} . -Substitution of these expressions for :math:`q_{i}^{n+1}` and -:math:`q_{i-1}^{n+1}` into equation :eq:`7.103` results in a general tridiagonal +Substitution of these expressions for :math:`q_{i}^{n+1}` and +:math:`q_{i-1}^{n+1}` into equation results in a general tridiagonal equation set of the form .. math:: - :label: 7.110 + :label: 7.110) r_{i} =a_{i} \Delta \theta _{liq,\, i-1} +b_{i} \Delta \theta _{liq,\, i} +c_{i} \Delta \theta _{liq,\, i+1} where .. math:: - :label: 7.111 + :label: ZEqnNum557934 a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.112 + :label: 7.112) b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.113 + :label: 7.113) c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: 7.114 + :label: ZEqnNum981892 r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -773,53 +846,53 @@ The tridiagonal equation set is solved over :math:`i=1,\ldots ,N_{levsoi}`. The finite-difference forms of the fluxes and partial derivatives in -equations :eq:`7.111` - :eq:`7.114` can be obtained from :eq:`7.80` as +equations - can be obtained from equation as .. math:: - :label: 7.115 + :label: 7.115) - q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} -z_{i-1} } \right] + q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.116 + :label: 7.116) - q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} -z_{i} } \right] + q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] .. math:: - :label: 7.117 + :label: 7.117) - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.118 + :label: 7.118) - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.119 + :label: 7.119) - \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right] + \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] .. math:: - :label: 7.120 + :label: 7.120) - \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right]. + \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right]. The derivatives of the soil matric potential at the node depth are -derived from :eq:`7.94` +derived from equation .. math:: - :label: 7.121 + :label: 7.121) \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, \, i-1} } =-B_{i-1} \frac{\psi _{i-1} }{\theta _{\, \, i-1} } .. math:: - :label: 7.122 + :label: 7.122) \frac{\partial \psi _{i} }{\partial \theta _{\, liq,\, i} } =-B_{i} \frac{\psi _{i} }{\theta _{i} } .. math:: - :label: 7.123 + :label: 7.123) \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } =-B_{i+1} \frac{\psi _{i+1} }{\theta _{\, i+1} } @@ -827,31 +900,17 @@ with the constraint :math:`0.01\, \theta _{sat,\, i} \le \theta _{\, i} \le \theta _{sat,\, i}` . The derivatives of the hydraulic conductivity at the layer interface are -derived from :eq:`7.85` - -.. check eqn +derived from equation .. math:: - :label: 7.124 - - \begin{array}{l} - {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } - = \frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } - = \left(2B_{i-1} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i-1} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i-1} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array} - -where :math:`\overline{\theta}_{liq} = 0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)`, -:math:`\overline{\theta}_{sat} = 0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)`, -and :math:`\overline{\Theta}_{ice} = \Theta_{ice}(\overline{\theta}_{ice})` :eq:`7.86` + :label: 7.124) -and + \begin{array}{l} {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } =\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } =\left(1-\frac{f_{frz,\, i-1} +f_{frz,\, i} }{2} \right)\left(2B_{i-1} +3\right)k_{sat} \left[z_{h,\, i-1} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right]^{2B_{i-1} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right)} \end{array} .. math:: - :label: 7.125 + :label: 7.125) - \begin{array}{l} - {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } - = \frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } - = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array}. + \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } =\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } =\left(1-\frac{f_{frz,\, i} +f_{frz,\, i+1} }{2} \right)\left(2B_{i} +3\right)k_{sat} \left[z_{h,\, i} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right)} \end{array}. Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' @@ -862,7 +921,7 @@ infiltration rate (section :numref:`Surface Runoff`), is .. math:: - :label: 7.135 + :label: 7.135) \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =q_{infl}^{n+1} +q_{i}^{n+1} -e_{i} . @@ -870,22 +929,22 @@ After grouping like terms, the coefficients of the tridiagonal set of equations for :math:`i=1` are .. math:: - :label: 7.136 + :label: 7.136) a_{i} =0 .. math:: - :label: 7.137 + :label: 7.137) b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.138 + :label: 7.138) c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: 7.139 + :label: 7.139) r_{i} =q_{infl}^{n+1} -q_{i}^{n} +e_{i} . @@ -896,22 +955,22 @@ The coefficients of the tridiagonal set of equations for :math:`i=2,\ldots ,N_{levsoi} -1` are .. math:: - :label: 7.140 + :label: 7.140) a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.141 + :label: 7.141) b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.142 + :label: 7.142) c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } .. math:: - :label: 7.143 + :label: 7.143) r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -924,22 +983,22 @@ and the coefficients of the tridiagonal set of equations for :math:`i=N_{levsoi}` are .. math:: - :label: 7.148 + :label: 7.148) a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } .. math:: - :label: 7.149 + :label: 7.149) b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.150 + :label: 7.150) c_{i} =0 .. math:: - :label: 7.151 + :label: 7.151) r_{i} =q_{i-1}^{n} +e_{i} . @@ -950,7 +1009,7 @@ An initial solution is found by setting :math:`\Delta t` equal to the model time step. An estimate of the error is calculated from .. math:: - :label: 7.152 + :label: 7.152) \epsilon = max \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] @@ -966,14 +1025,14 @@ Upon solution of the tridiagonal equation set, the liquid water contents are updated as follows .. math:: - :label: 7.164 + :label: 7.164) w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\Delta \theta _{liq,\, i} \Delta z_{i} \qquad i=1,\ldots ,N_{levsoi} . The volumetric water content is .. math:: - :label: 7.165 + :label: 7.165) \theta _{i} =\frac{w_{liq,\, i} }{\Delta z_{i} \rho _{liq} } +\frac{w_{ice,\, i} }{\Delta z_{i} \rho _{ice} } . @@ -983,8 +1042,7 @@ Frozen Soils and Perched Water Table ---------------------------------------- When soils freeze, the power-law form of the ice impedance factor -(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic -conductivity of the +(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic conductivity of the soil, leading to nearly impermeable soil layers. When unfrozen soil layers are present above relatively ice-rich frozen layers, the possibility exists for perched saturated zones. Lateral drainage from @@ -992,7 +1050,7 @@ perched saturated regions is parameterized as a function of the thickness of the saturated zone .. math:: - :label: 7.166 + :label: 7.166) q_{drai,perch} =k_{drai,\, perch} \left(z_{frost} -z_{\nabla ,perch} \right) @@ -1000,7 +1058,7 @@ where :math:`k_{drai,\, perch}` depends on topographic slope and soil hydraulic conductivity, .. math:: - :label: 7.167 + :label: 7.167) k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta _{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) @@ -1025,7 +1083,7 @@ Lateral sub-surface runoff occurs when saturated soil moisture conditions exist within the soil column. Sub-surface runoff is .. math:: - :label: 7.168 + :label: 7.168) q_{subsurface} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) \Delta z_{sat}^{N_{baseflow}} \ , @@ -1037,14 +1095,13 @@ is the thickness of the saturated portion of the soil column. The saturated thickness is .. math:: - :label: 7.1681 + :label: 7.1681) \Delta z_{sat} = z_{bedrock} - z_{\nabla}, where the water table :math:`z_{\nabla}` is determined by finding the -first soil layer above the bedrock depth (section :numref:`Depth to Bedrock`) -in which the volumetric water content drops below a specified threshold. -The default threshold is set to 0.9. +first soil layer above the bedrock depth (section ) in which the volumetric water +content drops below a specified threshold. The default threshold is set to 0.9. The specific yield, :math:`S_{y}` , which depends on the soil properties and the water table location, is derived by taking the @@ -1052,13 +1109,13 @@ difference between two equilibrium soil moisture profiles whose water tables differ by an infinitesimal amount .. math:: - :label: 7.174 + :label: 7.174) S_{y} =\theta _{sat} \left(1-\left(1+\frac{z_{\nabla } }{\Psi _{sat} } \right)^{\frac{-1}{B} } \right) where B is the Clapp-Hornberger exponent. Because :math:`S_{y}` is a function of the soil properties, it results in water table dynamics that -are consistent with the soil water fluxes described in section :numref:`Soil Water`. +are consistent with the soil water fluxes described in section 7.4. After the above calculations, two numerical adjustments are implemented to keep the liquid water content of each soil layer @@ -1083,22 +1140,22 @@ those layers subject to the constraint found, then the water is removed from :math:`W_{t}` and :math:`q_{drai}` . -The soil surface layer liquid water and ice contents are then updated for -dew :math:`q_{sdew}`, frost :math:`q_{frost}`, or sublimation :math:`q_{subl}` -(section :numref:`Update of Ground Sensible and Latent Heat Fluxes`) as +The soil surface layer liquid water and ice contents are then updated +for dew :math:`q_{sdew}` , frost :math:`q_{frost}` , or sublimation +:math:`q_{subl}` (section 5.4) as .. math:: - :label: 7.175 + :label: 7.175) w_{liq,\, 1}^{n+1} =w_{liq,\, 1}^{n} +q_{sdew} \Delta t .. math:: - :label: 7.176 + :label: 7.176) w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} +q_{frost} \Delta t .. math:: - :label: 7.177 + :label: 7.177) w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} -q_{subl} \Delta t. @@ -1116,12 +1173,12 @@ and dew in solid or liquid form, is separated into solid :math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms .. math:: - :label: 7.178 + :label: 7.178) q_{snwcp,ice} =q_{grnd,ice} +q_{frost} .. math:: - :label: 7.179 + :label: 7.179) q_{snwcp,liq} =q_{grnd,liq} +q_{dew} @@ -1137,7 +1194,7 @@ For glacier surfaces the runoff term :math:`q_{rgwl}` is calculated from the residual of the water balance .. math:: - :label: 7.180 + :label: 7.180) q_{rgwl} =q_{grnd,ice} +q_{grnd,liq} -E_{g} -E_{v} -\frac{\left(W_{b}^{n+1} -W_{b}^{n} \right)}{\Delta t} -q_{snwcp,ice} @@ -1145,7 +1202,7 @@ where :math:`W_{b}^{n}` and :math:`W_{b}^{n+1}` are the water balances at the beginning and ending of the time step defined as .. math:: - :label: 7.181 + :label: 7.181) W_{b} =W_{can} +W_{sno} +\sum _{i=1}^{N}\left(w_{ice,i} +w_{liq,i} \right) . @@ -1153,6 +1210,5 @@ Currently, glaciers are non-vegetated and :math:`E_{v} =W_{can} =0`. The contribution of lake runoff to :math:`q_{rgwl}` is described in section :numref:`Precipitation, Evaporation, and Runoff Lake`. The runoff term :math:`q_{rgwl}` may be negative for glaciers and lakes, which reduces -the total amount of runoff available to the river routing model -(Chapter :numref:`rst_River Transport Model (RTM)`). +the total amount of runoff available to the river routing model (Chapter :numref:`rst_River Transport Model (RTM)`). diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index dfb4b81d9c..6d989d2b1c 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1225,8 +1225,6 @@ Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. -.. _NiuYang2006: - Niu, G.-Y., and Yang, Z.-L. 2006. Effects of frozen soil on snowmelt runoff and soil water storage at a continental scale. J. Hydrometeor. 7:937-952. @@ -1410,6 +1408,12 @@ Pollmer, W.G., Eberhard, D., Klein, D., and Dhillon, B.S. 1979. Genetic control of nitrogen uptake and translocation in maize. Crop Sci. 19:82-86. +.. _Pomeroyetal1998: + +Pomeroy, J. W., D. M. Gray, K. R. Shook, B. Toth, R. L. H. Essery, +A. Pietroniro, and N. Hedstrom. 1998. An evaluation of snow accumulation +and ablation processes for land surface modelling. Hydrol. Process. 12:2339–2367. + .. _Portmannetal2010: Portmann, F.T., Siebert, S., and Döll, P. 2010. MIRCA2000 - Global @@ -1489,6 +1493,11 @@ Riley, W.J. et al. 2011b. CLM4Me, a Methane Biogeochemistry Model Integrated in CESM, Land and Biogeochemistry Model Working Group Meeting, Boulder, CO. +.. _Roeschetal2001: + +Roesch, A., M. Wild, H. Gilgen, and A. Ohmura. 2001. A new snow cover +fraction parametrization for the ECHAM4 GCM, Clim. Dyn., 17:933–946. + .. _Ryan1991: Ryan, M. G. 1991. A simple method for estimating gross carbon budgets @@ -1557,7 +1566,7 @@ Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity in soils and cultures to water stress. Applied and Environmental Microbiology 62:3203-3209. -.. _Segers1998: +.. _Segers, R., 1998. Methane production and methane consumption: a review Segers, R., 1998. Methane production and methane consumption: a review of processes underlying wetland methane fluxes. Biogeochemistry diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index d20ac17a27..256648359f 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -72,29 +72,34 @@ where :math:`\mu '` is the direction of the scattered flux. The optical parameters :math:`\omega`, :math:`\beta`, and :math:`\beta _{0}`, which vary with wavelength (:math:`\Lambda` ), are weighted combinations of values -for vegetation and snow. The model determines that snow is on the canopy if -:math:`T_{v} \le T_{f}` , where :math:`T_{v}` is the vegetation temperature (K) (Chapter -:numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) and :math:`T_{f}` is the -freezing temperature of water (K) (:numref:`Table Physical Constants`). In this case, the optical parameters are +for vegetation and snow, using the canopy snow-covered fraction :math:`f_{can,\, sno}` +(Chapter :numref:`rst_Hydrology`). The optical parameters are + + +.. + The model determines that snow is on the canopy if + :math:`T_{v} \le T_{f}` , where :math:`T_{v}` is the vegetation temperature (K) (Chapter + :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`) and :math:`T_{f}` is the + freezing temperature of water (K) (:numref:`Table Physical Constants`). In this case, the optical parameters are .. math:: :label: 3.5 - \omega _{\Lambda } =\omega _{\Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} f_{wet} + \omega _{\Lambda } =\omega _{\Lambda }^{veg} \left(1-f_{can,\, sno} \right)+\omega _{\Lambda }^{sno} f_{can,\, sno} .. math:: :label: 3.6 - \omega _{\Lambda } \beta _{\Lambda } =\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{\Lambda }^{sno} f_{wet} + \omega _{\Lambda } \beta _{\Lambda } =\omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} \left(1-f_{can,\, sno} \right)+\omega _{\Lambda }^{sno} \beta _{\Lambda }^{sno} f_{can,\, sno} .. math:: :label: 3.7 - \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} \left(1-f_{wet} \right)+\omega _{\Lambda }^{sno} \beta _{0,\, \Lambda }^{sno} f_{wet} + \omega _{\Lambda } \beta _{0,\, \Lambda } =\omega _{\Lambda }^{veg} \beta _{0,\, \Lambda }^{veg} \left(1-f_{can,\, sno} \right)+\omega _{\Lambda }^{sno} \beta _{0,\, \Lambda }^{sno} f_{can,\, sno} -where :math:`f_{wet}` is the wetted fraction of the canopy (section :numref:`Canopy Water`). The snow and vegetation weights are applied to the products +The snow and vegetation weights are applied to the products :math:`\omega _{\Lambda } \beta _{\Lambda }` and :math:`\omega _{\Lambda } \beta _{0,\, \Lambda }` because these -products are used in the two-stream equations. If there is no snow on the canopy, +products are used in the two-stream equations. If there is no snow on the canopy, this reduces to .. math:: :label: 3.8 From aa7cc7a6ec1053ca8058fe10e686e5340d409936 Mon Sep 17 00:00:00 2001 From: Yaqiong Lu Date: Fri, 2 Jun 2017 16:39:37 -0600 Subject: [PATCH 042/730] updated crop tables --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 110 ++++++++---------- 1 file changed, 51 insertions(+), 59 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 2961569d3a..79e089380b 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -375,72 +375,64 @@ crop and from each other: .. _Table Crop plant functional types: -.. table:: Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | | Phenological | :math:`T_{p}` | :math:`T_{p}^{\min }` | :math:`{GDD}_{min}` | :math:`{GDD}_{mat}` | Phase 2 | Phase 3 | Harvest: days | :math:`z_{top}^{\max }` | *SLA* | :math:`\chi _{L}` | | - | | Type | K | K | ºdays | ºdays | %\ :math:`{GDD}_{mat}` | %\ :math:`{GDD}_{mat}` | past planting | m | m\ :sup:`2`\ leaf g\ :sup:`-1`\ C | index | | - +=======+==============================================+======================+==============================+===========================+===========================+==============================+==============================+=================+==============================+=================================================+========================+====+ - | 15. | C\ :sub:`3` unmanaged rainfed crop | | | | | | | 0.03 | -0.30 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 16. | C\ :sub:`3` unmanaged irrigated crop | | | | | | | 0.03 | -0.30 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 17. | Rainfed Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 18. | Irrigated Corn (also known as Maize) | | 950-1850 | 3 | 55-65 | :math:`\mathrm{\le}`\ 165 | 2.50 | 0.05 | -0.50 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 19. | Rainfed Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 20. | Irrigated Temperate Cereals | | :math:`\mathrm{\le}`\ 1700 | 5 | 60 | :math:`\mathrm{\le}`\ 150 | 1.20 | 0.07 | 0.65 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 21. | Rainfed Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 22. | Irrigated Winter cereals (place holder) | | 1900 | 5 | 40 | :math:`\mathrm{\le}`\ 265 | 1.20 | 0.07 | 0.65 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 23. | Rainfed Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - | 24. | Irrigated Soybean | | :math:`\mathrm{\le}`\ 1700 | 3 | 70 | :math:`\mathrm{\le}`\ 150 | 0.75 | 0.07 | -0.50 | | | | - +-------+----------------------------------------------+----------------------+------------------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------+------------------------------+-------------------------------------------------+------------------------+----+ - -Notes: :math:`T_{p}` and :math:`T_{p}^{\min }` are coldest -planting temperatures but for winter cereals :math:`T_{p}^{\min }` -is a warmest planting temperature. :math:`{GDD}_{min}` is the lowest -(for planting) 20-year running mean growing degree-days base 0ºC (winter -cereals) or 8 (other crops) tracked from April to September (NH). +.. table:: Crop plant functional types (pfts) in CLM5BGCCROP and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. + + === =========================== ================= =========================== ============================= =========================== ============================= ============================= =========================== =========================== =================================== ======================= + IVT Phenological Type :math:`T_{p}` (K) :math:`{GDD}_{min}` (ºdays) base temperature for GDD (ºC) :math:`{GDD}_{mat}` (ºdays) Phase 2 % :math:`{GDD}_{mat}` Phase 3 % :math:`{GDD}_{mat}` Harvest: days past planting :math:`z_{top}^{\max }` (m) SLA (m :sup:`2` leaf g :sup:`-1` C) :math:`\chi _{L}` index + === =========================== ================= =========================== ============================= =========================== ============================= ============================= =========================== =========================== =================================== ======================= + 17 rainfed temperate corn 279.15 50 8 950-1850 0.03 0.65 :math:`\mathrm{\le}`\ 165 2.50 0.05 -0.50 + 18 irrigated temperate corn 279.15 50 8 950-1850 0.03 0.65 :math:`\mathrm{\le}`\ 165 2.50 0.05 -0.50 + 19 rainfed spring wheat 272.15 50 0 :math:`\mathrm{\le}`\ 1700 0.05 0.60 :math:`\mathrm{\le}`\ 150 1.20 0.04 0.65 + 20 irrigated spring wheat 272.15 50 0 :math:`\mathrm{\le}`\ 1700 0.05 0.60 :math:`\mathrm{\le}`\ 150 1.20 0.04 0.65 + 23 rainfed temperate soybean 279.15 50 10 :math:`\mathrm{\le}`\ 1900 0.03 0.50 :math:`\mathrm{\le}`\ 150 0.75 0.04 -0.50 + 24 irrigated temperate soybean 279.15 50 10 :math:`\mathrm{\le}`\ 1900 0.03 0.50 :math:`\mathrm{\le}`\ 150 0.75 0.04 -0.50 + 41 rainfed cotton 283.15 50 10 :math:`\mathrm{\le}`\ 1700 0.03 0.50 :math:`\mathrm{\le}`\ 160 1.50 0.04 -0.50 + 42 irrigated cotton 283.15 50 10 :math:`\mathrm{\le}`\ 1700 0.03 0.50 :math:`\mathrm{\le}`\ 160 1.50 0.04 -0.50 + 61 rainfed rice 283.15 50 10 :math:`\mathrm{\le}`\ 2100 0.01 0.40 :math:`\mathrm{\le}`\ 150 1.80 0.04 0.65 + 62 irrigated rice 283.15 50 10 :math:`\mathrm{\le}`\ 2100 0.01 0.40 :math:`\mathrm{\le}`\ 150 1.80 0.04 0.65 + 67 rainfed sugarcane 283.15 50 10 950-1850 0.03 0.65 :math:`\mathrm{\le}`\ 300 4.00 0.05 -0.50 + 68 irrigated sugarcane 283.15 50 10 950-1850 0.03 0.65 :math:`\mathrm{\le}`\ 300 4.00 0.05 -0.50 + 75 rainfed tropical corn 283.15 50 10 :math:`\mathrm{\le}`\ 1800 0.03 0.50 :math:`\mathrm{\le}`\ 160 2.50 0.05 -0.50 + 76 irrigated tropical corn 283.15 50 10 :math:`\mathrm{\le}`\ 1800 0.03 0.50 :math:`\mathrm{\le}`\ 160 2.50 0.05 -0.50 + 77 rainfed tropical soybean 283.15 50 10 :math:`\mathrm{\le}`\ 2100 0.03 0.50 :math:`\mathrm{\le}`\ 150 1.00 0.04 -0.50 + 78 irrigated tropical soybean 283.15 50 10 :math:`\mathrm{\le}`\ 2100 0.03 0.50 :math:`\mathrm{\le}`\ 150 1.00 0.04 -0.50 + === =========================== ================= =========================== ============================= =========================== ============================= ============================= =========================== =========================== =================================== ======================= + +Notes: :math:`T_{p}` is the minimum planting temperatures. :math:`{GDD}_{min}` is the lowest +(for planting) 20-year running mean growing degree-days base on the base temperature in the 5\ :sup:`th` column, tracked from April to September (NH). :math:`{GDD}_{mat}` is a crop’s 20-year running mean growing degree-days needed for vegetative and physiological maturity. Harvest occurs at 100%\ :math:`{GDD}_{mat}` or when the days past planting -reach the number in the 10\ :sup:`th` column. Crop growth phases +reach the number in the 9\ :sup:`th` column. Crop growth phases are described in the text. :math:`z_{top}^{\max }` is the maximum -top-of-canopy height of a crop, *SLA* is specific leaf area, and leaf -orientation index, :math:`\chi _{L}` , equals -1 for vertical, 0 for +top-of-canopy height of a crop, *SLA* is specific leaf area. :math:`\chi _{L}` is the leaf +orientation index, equals -1 for vertical, 0 for random, and 1 for horizontal leaf orientation. .. _Table Crop pfts in CLM4.5CNcrop and their parameters: -.. table:: Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | | :math:`a_{leaf}^{i}` | :math:`{L}_{max}` | :math:`a_{froot}^{i}` | :math:`a_{froot}^{f}` | :math:`a_{leaf}^{f}` | :math:`a_{livestem}^{f}` | :math:`d_{L}` | :math:`d_{alloc}^{stem}` | :math:`d_{alloc}^{leaf}` | | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | | fraction | m\ :sup:`2` m\ :sup:`-2` | | | | | | | | | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 17. | Rainfed Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 18. | Irrigated Corn (also referred to as Maize) | 0.800 | 5 | 0.400 | 0.050 | 0.000 | 0.000 | 1.05 | 2 | 5 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 19. | Rainfed Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 20. | Irrigated Temperate Cereals | 0.750 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 21. | Rainfed Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 22. | Irrigated Winter cereals (place holder) | 0.425 | 7 | 0.300 | 0.000 | 0.000 | 0.050 | 1.05 | 1 | 3 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 23. | Rainfed Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ - | 24. | Irrigated Soybean | 0.850 | 6 | 0.500 | 0.200 | 0.000 | 0.300 | 1.05 | 5 | 2 | - +-------+----------------------------------------------+------------------------------------------+--------------------------+--------------------------+-------------------------+-----------------------------+----------------------+---------------------------------+-----------------------------+-----+ +.. table:: Crop pfts in CLM5BGCCROP and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. + + === =========================== ==================== =========================================== ===================== ===================== ==================== ======================== ============= ======================== ======================== + IVT Phenological Type :math:`a_{leaf}^{i}` :math:`{L}_{max}` (m :sup:`2` m :sup:`-2`) :math:`a_{froot}^{i}` :math:`a_{froot}^{f}` :math:`a_{leaf}^{f}` :math:`a_{livestem}^{f}` :math:`d_{L}` :math:`d_{alloc}^{stem}` :math:`d_{alloc}^{leaf}` + === =========================== ==================== =========================================== ===================== ===================== ==================== ======================== ============= ======================== ======================== + 17 rainfed temperate corn 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 18 irrigated temperate corn 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 19 rainfed spring wheat 0.90 7 0.1 0.00 0 0.05 1.05 1 3 + 20 irrigated spring wheat 0.90 7 0.1 0.00 0 0.05 1.05 1 3 + 23 rainfed temperate soybean 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + 24 irrigated temperate soybean 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + 41 rainfed cotton 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + 42 irrigated cotton 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + 61 rainfed rice 0.75 7 0.1 0.00 0 0.05 1.05 1 3 + 62 irrigated rice 0.75 7 0.1 0.00 0 0.05 1.05 1 3 + 67 rainfed sugarcane 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 68 irrigated sugarcane 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 75 rainfed tropical corn 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 76 irrigated tropical corn 0.80 5 0.4 0.05 0 0.00 1.05 2 5 + 77 rainfed tropical soybean 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + 78 irrigated tropical soybean 0.85 6 0.2 0.20 0 0.30 1.05 5 2 + === =========================== ==================== =========================================== ===================== ===================== ==================== ======================== ============= ======================== ======================== Notes: Crop growth phases and corresponding variables are described in the text @@ -738,7 +730,7 @@ calculated as .. math:: :label: 25.14) - leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } + leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } .. math:: :label: 25.15) From 8229a0839a9161f773ffda4979586311cdae92b1 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Mon, 5 Jun 2017 08:00:34 -0600 Subject: [PATCH 043/730] math cleanup --- .../tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 5 ++++- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 4e203f8586..253ea92109 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -851,7 +851,10 @@ and \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } = \frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } - = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array}. + = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array} + +where :math:`\overline{\theta}_{liq} = 0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)`, +:math:`\overline{\theta}_{sat} = 0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)`. Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 027d92e9e2..157b564d7e 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -232,7 +232,7 @@ Jinyun Tang, Zong-Liang Yang** - :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. -- :numref:`Table Crop pfts in CLM4.5CNcrop and their parameters` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. +- :numref:`Table Crop pfts` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - :numref:`Table Pre- and post-grain fill CN ratios` Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index d20ac17a27..ec565fe1d3 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -136,17 +136,17 @@ and The upscatter for diffuse radiation is .. math:: - :label: ZEqnNum472968 + :label: 3.13 \omega _{\Lambda }^{veg} \beta _{\Lambda }^{veg} =\frac{1}{2} \left[\alpha _{\Lambda } +\tau _{\Lambda } +\left(\alpha _{\Lambda } -\tau _{\Lambda } \right)\cos ^{2} \bar{\theta }\right] where :math:`\bar{\theta }` is the mean leaf inclination angle relative to the horizontal plane (i.e., the angle between leaf normal and local -vertical) (Sellers 1985). Here, :math:`\cos \bar{\theta }` is +vertical) (:ref:`Sellers (1985) `). Here, :math:`\cos \bar{\theta }` is approximated by .. math:: - :label: ZEqnNum720349 + :label: 3.14 \cos \bar{\theta }=\frac{1+\chi _{L} }{2} From 692bd7f8b2ddd43e542ed40c6a892ae497e8101a Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Mon, 5 Jun 2017 09:00:59 -0600 Subject: [PATCH 044/730] fix overwritten hydrology changes --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 485 +++++++++--------- .../References/CLM50_Tech_Note_References.rst | 2 +- 2 files changed, 257 insertions(+), 230 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 126fd05cda..9dec375356 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -17,7 +17,7 @@ m\ :sup:`-2` or mm of H\ :sub:`2`\ O) (:numref:`Figure Hydrologic processes`). The total water balance of the system is .. math:: - :label: 7.1) + :label: 7.1 \begin{array}{l} {\Delta W_{can,\,liq} +\Delta W_{can,\,sno} +\Delta W_{sfc} +\Delta W_{sno} +} \\ {\sum _{i=1}^{N_{levsoi} }\left(\Delta w_{liq,\, i} +\Delta w_{ice,\, i} \right)+\Delta W_{a} =\left(\begin{array}{l} {q_{rain} +q_{sno} -E_{v} -E_{g} -q_{over} } \\ {-q_{h2osfc} -q_{drai} -q_{rgwl} -q_{snwcp,\, ice} } \end{array}\right) \Delta t} \end{array} @@ -54,56 +54,58 @@ Interception by vegetation is divided between liquid and solid phases :math:`q_{intr,\,liq}` and :math:`q_{intr,\,ice}` (kg m\ :sup:`-2` s\ :sup:`-1`) .. math:: - :label: 7.2) + :label: 7.2 q_{intr,\,liq} =\alpha_{liq} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} .. math:: - :label: 7.3) + :label: 7.3 q_{intr,\,ice} =\alpha_{sno} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} where :math:`L` and :math:`S` are the exposed leaf and stem area index, -respectively (section 2.1.4), and the :math:`\alpha`\'s scale -the fractional area of a leaf that collects water (:ref:`Lawrence et al. 2007 `). -Values of :math:`\alpha_{liq} = 0.25` and :math:`\alpha_{sno} = 1` reflect the increased capacity one side of a leaf has for snow than liquid water. +respectively (section :numref:`Phenology and vegetation burial by snow`), and +the :math:`\alpha`\'s scale the fractional area of a leaf that collects water +(:ref:`Lawrence et al. 2007 `). Values of +:math:`\alpha_{liq} = 0.25` and :math:`\alpha_{sno} = 1` reflect the increased +capacity one side of a leaf has for snow than liquid water. Throughfall (kg m\ :sup:`-2` s\ :sup:`-1`) is also divided into liquid and solid phases, reaching the ground (soil or snow surface) as .. math:: - :label: 7.4) + :label: 7.4 q_{thru,\, liq} =q_{rain} \left[1-\alpha_{liq} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] .. math:: - :label: 7.5) + :label: 7.5 q_{thru,\, ice} =q_{sno} \left[1-\alpha_{sno} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. Similarly, the liquid and solid canopy drip fluxes are .. math:: - :label: 7.6) + :label: 7.6 q_{drip,\, liq} =\frac{W_{can,\,liq}^{intr} -W_{can,\,liq}^{max } }{\Delta t} \ge 0 .. math:: - :label: 7.7) + :label: 7.7 q_{drip,\, ice} =\frac{W_{can,\,sno}^{intr} -W_{can,\,sno}^{max } }{\Delta t} \ge 0 where .. math:: - :label: 7.8) + :label: 7.8 W_{can,liq}^{intr} =W_{can,liq}^{n} +q_{intr} \Delta t\ge 0 and .. math:: - :label: 7.9) + :label: 7.9 W_{can,sno}^{intr} =W_{can,sno}^{n} +q_{intr} \Delta t\ge 0 @@ -115,12 +117,12 @@ from the previous time step, and :math:`W_{can,\,liq}^{max }` and :math:`W_{can, They are defined by .. math:: - :label: 7.10) + :label: 7.10 W_{can,\,liq}^{max } =p_{liq}\left(L+S\right) .. math:: - :label: 7.11) + :label: 7.11 W_{can,\,sno}^{max } =p_{ice}\left(L+S\right). @@ -132,17 +134,17 @@ Canopy snow unloading from wind speed :math:`u` and above-freezing temperatures fluxes and e-folding times similar to :ref:`Roesch et al. (2001) ` .. math:: - :label: 7.12) + :label: 7.12 q_{unl,\, wind} =\frac{u W_{can,sno}}{1.56\times 10^5 \text{ m}} .. math:: - :label: 7.13) + :label: 7.13 q_{unl,\, temp} =\frac{W_{can,sno}(T-270 \textrm{ K})}{1.87\times 10^5 \text{ K s}} > 0 .. math:: - :label: 7.14) + :label: 7.14 q_{unl,\, tot} =\min \left( q_{unl,\, wind} +q_{unl,\, temp} ,W_{can,\, sno} \right) @@ -150,14 +152,14 @@ fluxes and e-folding times similar to :ref:`Roesch et al. (2001) T_{f} \\ - 0 & T_v \le T_f - \end{cases} + E_{v}^{liq} = + \left\{\begin{array}{lr} + E_{v}^{w} & T_v > T_{f} \\ + 0 & T_v \le T_f + \end{array}\right\} .. math:: - :label: 7.18) + :label: 7.18 - E_{v}^{ice} &= \begin{cases} - 0 & T_v > T_f \\ - E_{v}^{w} & T_v \le T_f - \end{cases} . + E_{v}^{ice} = + \left\{\begin{array}{lr} + 0 & T_v > T_f \\ + E_{v}^{w} & T_v \le T_f + \end{array}\right\}. .. \begin{array}{lr} .. E_{v}^{liq} = E_{v}^{w} \qquad T > 273 \text{K} \\ @@ -191,12 +195,12 @@ surface evaporation :math:`E_{v}^{w}` (Chapter :numref:`rst_Momentum, Sensible H The total rate of liquid and solid precipitation reaching the ground is then .. math:: - :label: ZEqnNum946822 + :label: 7.19 q_{grnd,liq} =q_{thru,\, liq} +q_{drip,\, liq} .. math:: - :label: ZEqnNum339590 + :label: 7.20 q_{grnd,ice} =q_{thru,\, ice} +q_{drip,\, ice} +q_{unl,\, tot} . @@ -213,7 +217,7 @@ for surface flux (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat calculations, is (:ref:`Dickinson et al.1993 `) .. math:: - :label: 7.21) + :label: 7.21 f_{wet} = \left\{\begin{array}{lr} @@ -224,7 +228,7 @@ calculations, is (:ref:`Dickinson et al.1993 `) while the fraction of the canopy that is dry and transpiring is .. math:: - :label: 7.22) + :label: 7.22 f_{dry} = \left\{\begin{array}{lr} @@ -236,7 +240,7 @@ Similarly, the snow-covered fraction of the canopy is used for surface alebdo wh .. math:: - :label: 7.23) + :label: 7.23 f_{can,\, sno} = \left\{\begin{array}{lr} @@ -271,28 +275,28 @@ portion of a grid cell contributes to surface runoff, :math:`q_{over}` , by the saturation excess mechanism (Dunne runoff) .. math:: - :label: ZEqnNum549608 + :label: 7.64 - q_{over} =f_{sat} q_{liq,\, 0} + q_{over} =f_{sat} \ q_{liq,\, 0} The fractional saturated area is a function of soil moisture .. math:: - :label: 7.65) + :label: 7.65 - f_{sat} =f_{\max } \exp \left(-0.5f_{over} z_{\nabla } \right) + f_{sat} =f_{\max } \ \exp \left(-0.5f_{over} z_{\nabla } \right) where :math:`f_{\max }` is the potential or maximum value of -:math:`f_{sat}` , :math:`f_{over}` is a decay factor -(m\ :sup:`-1`), and :math:`z_{\nabla}` is the water table depth -(m) (section 7.6). The maximum saturated fraction, :math:`f_{\max }` , -is defined as the value of the discrete cumulative distribution function -(CDF) of the topographic index when the grid cell mean water table depth -is zero. Thus, :math:`f_{\max }` is the percent of pixels in a grid -cell whose topographic index is larger than or equal to the grid cell -mean topographic index. It should be calculated explicitly from the CDF -at each grid cell at the resolution that the model is run. However, -because this is a computationally intensive task for global +:math:`f_{sat}` , :math:`f_{over}` is a decay factor (m\ :sup:`-1`), and +:math:`z_{\nabla}` is the water table depth (m) (section +:numref:`Lateral Sub-surface Runoff`). The maximum saturated fraction, +:math:`f_{\max }`, is defined as the value of the discrete cumulative +distribution function (CDF) of the topographic index when the grid cell +mean water table depth is zero. Thus, :math:`f_{\max }` is the percent of +pixels in a grid cell whose topographic index is larger than or equal to +the grid cell mean topographic index. It should be calculated explicitly +from the CDF at each grid cell at the resolution that the model is run. +However, because this is a computationally intensive task for global applications, :math:`f_{\max }` is calculated once at 0.125\ :sup:`o` resolution using the 1-km compound topographic indices (CTIs) based on the HYDRO1K dataset (:ref:`Verdin and Greenlee 1996 `) @@ -330,17 +334,17 @@ height (relative to the grid cell mean elevation) of the surface water, :math:`d`, by .. math:: - :label: ZEqnNum277892 + :label: 7.66 W_{sfc} =\frac{d}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right)+\frac{\sigma _{micro} }{\sqrt{2\pi } } e^{\frac{-d^{2} }{2\sigma _{micro} ^{2} } } where :math:`erf` is the error function. For a given value of -:math:`W_{sfc}` , equation can be solved for :math:`d` using the +:math:`W_{sfc}` , :eq:`7.66` can be solved for :math:`d` using the Newton-Raphson method. Once :math:`d` is known, one can determine the fraction of the area that is inundated as .. math:: - :label: 7.67) + :label: 7.67 f_{h2osfc} =\frac{1}{2} \left(1+erf\left(\frac{d}{\sigma _{micro} \sqrt{2} } \right)\right) @@ -348,15 +352,15 @@ No global datasets exist for microtopography, so the default parameterization is a simple function of slope .. math:: - :label: 7.68) + :label: 7.68 \sigma _{micro} =\left(\beta +\beta _{0} \right)^{\eta } where :math:`\beta` is the topographic slope, -:math:`\beta _{0} =\left(\sigma _{\max } \right)^{\frac{1}{\eta } }` \ determines -the maximum value of :math:`\sigma _{}` , and :math:`\eta` is an +:math:`\beta_{0} =\left(\sigma_{\max } \right)^{\frac{1}{\eta } }` \ determines +the maximum value of :math:`\sigma_{micro}` , and :math:`\eta` is an adjustable parameter. Default values in the model are -:math:`\sigma _{\max } =0.4` and :math:`\eta =-3`. +:math:`\sigma_{\max } =0.4` and :math:`\eta =-3`. If the spatial scale of the microtopography is small relative to that of the grid cell, one can assume that the inundated areas are distributed @@ -365,7 +369,7 @@ percolation theory can be used to quantify the fraction of the inundated portion of the grid cell that is interconnected .. math:: - :label: 7.69) + :label: 7.69 \begin{array}{lr} f_{connected} =\left(f_{h2osfc} -f_{c} \right)^{\mu } & \qquad f_{h2osfc} >f_{c} \\ f_{connected} =0 &\qquad f_{h2osfc} \le f_{c} \end{array} @@ -377,14 +381,14 @@ surpasses :math:`f_{c}` , the surface water store acts as a linear reservoir .. math:: - :label: 7.70) + :label: 7.70 - qout,h2osfc=kh2osfcf_{connected} (Wsfc-Wc)\frac{1}{\Delta t} + q_{out,h2osfc}=k_{h2osfc} \ f_{connected} \ (Wsfc-Wc)\frac{1}{\Delta t} -where :math:`qout,h2osfc` is the surface water runoff, :math:`kh2osfc` +where :math:`q_{out,h2osfc}` is the surface water runoff, :math:`k_{h2osfc}` is a constant, :math:`Wc` is the amount of surface water present when :math:`f_{h2osfc} =f_{c}` , and :math:`\Delta t` is the model time step. -The linear storage coefficent :math:`kh2osfc=\sin \left(\beta \right)` +The linear storage coefficent :math:`k_{h2osfc} = \sin \left(\beta \right)` is a function of grid cell mean topographic slope where :math:`\beta` is the slope in radians. @@ -397,9 +401,9 @@ The surface moisture flux remaining after surface runoff has been removed, .. math:: - :label: 7.71) + :label: 7.71 - qin,surface=(1-f_{sat} )q_{liq,\, 0} + q_{in,surface} = (1-f_{sat}) \ q_{liq,\, 0} is divided into inputs to surface water (:math:`q_{in,\, h2osfc}` ) and the soil :math:`q_{in,soil}` . If :math:`q_{in,soil}` exceeds the @@ -407,15 +411,15 @@ maximum soil infiltration capacity (kg m\ :sup:`-2` s\ :sup:`-1`), .. math:: - :label: ZEqnNum569150 + :label: 7.72 - q_{infl,\, \max } =(1-fsat){\rm \Theta }iceksat + q_{infl,\, \max } =(1-f_{sat}) \ \Theta_{ice} k_{sat} -where :math:`{\rm \Theta }ice` is an ice impedance factor (section +where :math:`\Theta_{ice}` is an ice impedance factor (section :numref:`Hydraulic Properties`), infiltration excess (Hortonian) runoff is generated .. math:: - :label: 7.73) + :label: 7.73 q_{infl,\, excess} =\max \left(q_{in,soil} -\left(1-f_{h2osfc} \right)q_{\inf l,\max } ,0\right) @@ -423,38 +427,39 @@ and transferred from :math:`q_{in,soil}` to :math:`q_{in,h2osfc}` . After evaporative losses have been removed, these moisture fluxes are .. math:: - :label: 7.74) + :label: 7.74 - q_{in,\, h2osfc} =f_{h2osfc} q_{in,surface} +q_{infl,excess} -q_{evap,h2osfc} + q_{in,\, h2osfc} = f_{h2osfc} q_{in,surface} + q_{infl,excess} - q_{evap,h2osfc} and .. math:: - :label: 7.75) + :label: 7.75 - qin,soil=(1-f_{h2osfc} )q_{in,surface} -q_{\inf l,excess} -(1-f_{sno} -f_{h2osfc} )qevap,soil. + qin,soil=(1-f_{h2osfc} )q_{in,surface} - q_{\inf l,excess} - (1-f_{sno} -f_{h2osfc} ) \ qevap,soil. The balance of surface water is then calculated as .. math:: - :label: 7.76) + :label: 7.76 + + \Delta W_{sfc} =\left(q_{in,h2osfc} - q_{out,h2osfc} - q_{drain,h2osfc} \right) \ \Delta t. - \Delta W_{sfc} =\left(qin,h2osfc-qout,h2osfc-qdrain,h2osfc\right)\Delta t. Bottom drainage from the surface water store .. math:: - :label: 7.77) + :label: 7.77 - qdrain,h2osfc=\min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) + q_{drain,h2osfc} = \min \left(f_{h2osfc} q_{\inf l,\max } ,\frac{W_{sfc} }{\Delta t} \right) is then added to :math:`q_{in,soil}` giving the total infiltration into the surface soil layer .. math:: - :label: 7.78) + :label: 7.78 - q_{infl} =q_{in,soil} +q_{drain,h2osfc} + q_{infl} = q_{in,soil} + q_{drain,h2osfc} Infiltration :math:`q_{infl}` and explicit surface runoff :math:`q_{over}` are not allowed for glaciers. @@ -475,7 +480,7 @@ For one-dimensional vertical water flow in soils, the conservation of mass is stated as .. math:: - :label: ZEqnNum790844 + :label: 7.79 \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q @@ -497,16 +502,16 @@ The soil water flux :math:`q` in equation can be described by Darcy’s law :ref:`(Dingman 2002) ` .. math:: - :label: 7.80) + :label: 7.80 - q=-k\frac{\partial \psi _{h} }{\partial z} + q = -k \frac{\partial \psi _{h} }{\partial z} where :math:`k` is the hydraulic conductivity (mm s\ :sup:`-1`), and :math:`\psi _{h}` is the hydraulic potential (mm). The hydraulic potential is .. math:: - :label: 7.81) + :label: 7.81 \psi _{h} =\psi _{m} +\psi _{z} @@ -519,22 +524,22 @@ If the reference elevation is the soil surface, then becomes .. math:: - :label: ZEqnNum186573 + :label: 7.82 - q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. + q = -k \left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]. -Equation :eq:`ZEqnNum186573` can be further manipulated to yield +Equation :eq:`7.82` can be further manipulated to yield .. math:: - :label: 7.83) + :label: 7.83 q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). -Substitution of this equation into equation :eq:`ZEqnNum790844`, with :math:`Q=0`, yields +Substitution of this equation into equation :eq:`7.79`, with :math:`Q=0`, yields the Richards equation .. math:: - :label: ZEqnNum670361 + :label: 7.84 \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right)\right]. @@ -546,7 +551,8 @@ Hydraulic Properties The hydraulic conductivity :math:`k_{i}` (mm s\ :sup:`-1`) and the soil matric potential :math:`\psi _{i}` (mm) for layer :math:`i` vary with volumetric soil water :math:`\theta _{i}` and soil texture. -As with the soil thermal properties (section :numref:`Soil And Snow Thermal Properties`) the hydraulic +As with the soil thermal properties (section +:numref:`Soil And Snow Thermal Properties`) the hydraulic properties of the soil are assumed to be a weighted combination of the mineral properties, which are determined according to sand and clay contents based on work by :ref:`Clapp and Hornberger (1978) @@ -555,29 +561,33 @@ and organic properties of the soil (:ref:`Lawrence and Slater 2008 `). The hydraulic conductivity is defined at the depth of the interface of -two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) and is a function -of the saturated hydraulic conductivity +two adjacent layers :math:`z_{h,\, i}` (:numref:`Figure Water flux schematic`) +and is a function of the saturated hydraulic conductivity :math:`k_{sat} \left[z_{h,\, i} \right]`, the liquid volumetric soil -moisture of the two layers :math:`\theta _{i}` and -:math:`\theta _{i+1}` and an ice impedance factor -:math:`\Theta _{ice}` +moisture of the two layers :math:`\theta _{i}` and :math:`\theta_{i+1}` +and an ice impedance factor :math:`\Theta_{ice}` .. math:: - :label: ZEqnNum398074 + :label: 7.85 k\left[z_{h,\, i} \right] = \left\{\begin{array}{lr} - \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)}{0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ - \Theta _{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} + \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left[\frac{0.5\left(\theta_{\, i} +\theta_{\, i+1} \right)}{0.5\left(\theta_{sat,\, i} +\theta_{sat,\, i+1} \right)} \right]^{2B_{i} +3} & \qquad 1 \le i \le N_{levsoi} - 1 \\ + \Theta_{ice} k_{sat} \left[z_{h,\, i} \right]\left(\frac{\theta_{\, i} }{\theta_{sat,\, i} } \right)^{2B_{i} +3} & \qquad i = N_{levsoi} \end{array}\right\}. The ice impedance factor is a function of ice content, and is meant to quantify the increased tortuosity of the water flow when part of the pore space is filled with ice. :ref:`Swenson et al. (2012) ` -used a power law form :math:`\Theta _{ice} = 10^{-\Omega F_{ice} }` where -:math:`\Omega = 6`\ and -:math:`F_{ice} = \frac{\theta_{ice} }{\theta_{sat} }` is the -ice-filled fraction of the pore space. +used a power law form + +.. math:: + :label: 7.86 + + \Theta_{ice} = 10^{-\Omega F_{ice} } + +where :math:`\Omega = 6`\ and :math:`F_{ice} = \frac{\theta_{ice} }{\theta_{sat} }` +is the ice-filled fraction of the pore space. Because the hydraulic properties of mineral and organic soil may differ significantly, the bulk hydraulic properties of each soil layer are @@ -585,32 +595,32 @@ computed as weighted averages of the properties of the mineral and organic components. The water content at saturation (i.e. porosity) is .. math:: - :label: 7.90) + :label: 7.90 - \theta _{sat,i} =(1-f_{om,i} )\theta _{sat,\min ,i} +f_{om,i} \theta _{sat,om} + \theta_{sat,i} =(1-f_{om,i} )\theta_{sat,\min ,i} +f_{om,i} \theta_{sat,om} where :math:`f_{om,i}` is the soil organic matter fraction, -:math:`\theta _{sat,om} =0.9` (:ref:`Farouki 1981 `; +:math:`\theta_{sat,om} =0.9` (:ref:`Farouki 1981 `; :ref:`Letts et al. 2000 `) is the porosity of organic matter and the porosity of the mineral soil -:math:`\theta _{sat,\min ,i}` is +:math:`\theta_{sat,\min ,i}` is .. math:: - :label: 7.91) + :label: 7.91 - \theta _{sai,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . + \theta_{sat,\min ,i} = 0.489 - 0.00126(\% sand)_{i} . The exponent :math:`B_{i}` is .. math:: - :label: 7.92) + :label: 7.92 B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and .. math:: - :label: 7.93) + :label: 7.93 B_{\min ,i} =2.91+0.159(\% clay)_{i} . @@ -618,14 +628,14 @@ The soil matric potential (mm) is defined at the node depth :math:`z_{i}` of each layer :math:`i` (:numref:`Figure Water flux schematic`) .. math:: - :label: ZEqnNum316201 + :label: 7.94 - \psi _{i} =\psi _{sat,\, i} \left(\frac{\theta _{\, i} }{\theta _{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad 0.01\le \frac{\theta _{i} }{\theta _{sat,\, i} } \le 1 + \psi _{i} =\psi _{sat,\, i} \left(\frac{\theta_{\, i} }{\theta_{sat,\, i} } \right)^{-B_{i} } \ge -1\times 10^{8} \qquad 0.01\le \frac{\theta_{i} }{\theta_{sat,\, i} } \le 1 where the saturated soil matric potential (mm) is .. math:: - :label: 7.95) + :label: 7.95 \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} @@ -634,7 +644,7 @@ saturated organic matter matric potential and the saturated mineral soil matric potential :math:`\psi _{sat,\min ,i}` \ is .. math:: - :label: 7.96) + :label: 7.96 \psi _{sat,\, \min ,\, i} =-10.0\times 10^{1.88-0.0131(\% sand)_{i} } . @@ -652,28 +662,28 @@ fractions using a result from percolation theory (:ref:`Stauffer and Aharony 1994 `, :ref:`Berkowitz and Balberg 1992 `). Assuming that the organic and mineral fractions are randomly distributed throughout a soil layer, percolation theory predicts that above a threshold value -:math:`f_{om} =f_{threshold}` , connected flow pathways consisting of +:math:`f_{om} = f_{threshold}`, connected flow pathways consisting of organic material only exist and span the soil space. Flow through these pathways interacts only with organic material, and thus can be described -by :math:`k_{sat,\, om}` . This fraction of the grid cell is given by +by :math:`k_{sat,\, om}`. This fraction of the grid cell is given by .. math:: - :label: 7.97) + :label: 7.97 \begin{array}{lr} - f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta _{perc} } f_{om} {\rm \; } & \qquad f_{om} \ge f_{threshold} \\ + f_{perc} =\; N_{perc} \left(f_{om} {\rm \; }-f_{threshold} \right)^{\beta_{perc} } f_{om} {\rm \; } & \qquad f_{om} \ge f_{threshold} \\ f_{perc} = 0 & \qquad f_{om} `) as .. math:: - :label: 7.99) + :label: 7.99 k_{sat,\, \min } \left[z_{h,\, i} \right]=0.0070556\times 10^{-0.884+0.0153\left(\% sand\right)_{i} } . @@ -689,7 +699,7 @@ The bulk soil layer saturated hydraulic conductivity is then computed as .. math:: - :label: 7.100) + :label: 7.100 k_{sat} \left[z_{h,\, i} \right]=f_{uncon,\, i} k_{sat,\, uncon} \left[z_{h,\, i} \right]+(1-f_{uncon,\, i} )k_{sat,\, om} \left[z_{h,\, i} \right]. @@ -698,11 +708,11 @@ as Numerical Solution ^^^^^^^^^^^^^^^^^^^^^^^^ -With reference to :numref:`Figure Water flux schematic`, the equation for conservation of mass -(equation :eq:`ZEqnNum790844`) can be integrated over each layer as +With reference to :numref:`Figure Water flux schematic`, the equation for +conservation of mass (equation :eq:`7.79`) can be integrated over each layer as .. math:: - :label: 7.101) + :label: 7.101 \int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial \theta }{\partial t} \, dz=-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial q}{\partial z} \, dz-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }Q\, dz . @@ -711,9 +721,9 @@ as positive upward from the soil surface. This equation can be written as .. math:: - :label: ZEqnNum225309 + :label: 7.102 - \Delta z_{i} \frac{\partial \theta _{liq,\, i} }{\partial t} =-q_{i-1} +q_{i} -e_{i} + \Delta z_{i} \frac{\partial \theta_{liq,\, i} }{\partial t} =-q_{i-1} +q_{i} -e_{i} where :math:`q_{i}` is the flux of water across interface :math:`z_{h,\, i}` , :math:`q_{i-1}` is the flux of water across @@ -723,12 +733,12 @@ the layer (mm s\ :sup:`-1`). Taking the finite difference with time and evaluating the fluxes implicitly at time :math:`n+1` yields .. math:: - :label: ZEqnNum181361 + :label: 7.103 - \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =-q_{i-1}^{n+1} +q_{i}^{n+1} -e_{i} + \frac{\Delta z_{i} \Delta \theta_{liq,\, i} }{\Delta t} =-q_{i-1}^{n+1} +q_{i}^{n+1} -e_{i} where -:math:`\Delta \theta _{liq,\, i} =\theta _{liq,\, i}^{n+1} -\theta _{liq,\, i}^{n}` +:math:`\Delta \theta_{liq,\, i} =\theta_{liq,\, i}^{n+1} -\theta_{liq,\, i}^{n}` is the change in volumetric soil liquid water of layer :math:`i` in time :math:`\Delta t`\ and :math:`\Delta z_{i}` is the thickness of layer :math:`i` (mm). @@ -738,7 +748,7 @@ function of the total transpiration :math:`E_{v}^{t}` (Chapter :numref:`rst_Mom the effective root fraction :math:`r_{e,\, i}` .. math:: - :label: ZEqnNum357392 + :label: 7.104 e_{i} =r_{e,\, i} E_{v}^{t} . @@ -750,7 +760,7 @@ the effective root fraction :math:`r_{e,\, i}` Shown are three soil layers, :math:`i-1`, :math:`i`, and :math:`i+1`. The soil matric potential :math:`\psi` and volumetric soil water -:math:`\theta _{liq}` are defined at the layer node depth :math:`z`. +:math:`\theta_{liq}` are defined at the layer node depth :math:`z`. The hydraulic conductivity :math:`k\left[z_{h} \right]` is defined at the interface of two layers :math:`z_{h}` . The layer thickness is :math:`\Delta z`. The soil water fluxes :math:`q_{i-1}` and @@ -764,7 +774,7 @@ soil column, the transpiration :math:`E_{v}^{t}` is a weighted sum of transpiration from all PFTs whose weighting depends on PFT area as .. math:: - :label: 7.105) + :label: 7.105 E_{v}^{t} =\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} @@ -777,7 +787,7 @@ quantity that is a weighted sum over all PFTs. The weighting depends on the per unit area transpiration of each PFT and its relative area as .. math:: - :label: 7.106) + :label: 7.106 r_{e,\, i} =\frac{\sum _{j=1}^{npft}\left(r_{e,\, i} \right)_{j} \left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} }{\sum _{j=1}^{npft}\left(E_{v}^{t} \right)_{j} \left(wt\right)_{j} } @@ -785,60 +795,63 @@ where :math:`\left(r_{e,\, i} \right)_{j}` is the effective root fraction for the :math:`j^{th}` PFT .. math:: - :label: 7.107) - - \begin{array}{l} {\left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } \qquad \left(\beta _{t} \right)_{j} >0} \\ {\left(r_{e,\, i} \right)_{j} =0\qquad \left(\beta _{t} \right)_{j} =0} \end{array} + :label: 7.107 + \begin{array}{lr} + \left(r_{e,\, i} \right)_{j} =\frac{\left(r_{i} \right)_{j} \left(w_{i} \right)_{j} }{\left(\beta _{t} \right)_{j} } & \qquad \left(\beta _{t} \right)_{j} >0 \\ + \left(r_{e,\, i} \right)_{j} =0 & \qquad \left(\beta _{t} \right)_{j} =0 + \end{array} + and :math:`\left(r_{i} \right)_{j}` is the fraction of roots in layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), :math:`\left(w_{i} \right)_{j}` is a soil dryness or plant wilting factor -for layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), and :math:`\left(\beta _{t} \right)_{j}` is a wetness factor for the total +for layer :math:`i` (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`), and :math:`\left(\beta_{t} \right)_{j}` is a wetness factor for the total soil column for the :math:`j^{th}` PFT (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). -The soil water fluxes in equation , which are a function of -:math:`\theta _{liq,\, i}` and :math:`\theta _{liq,\, i+1}` because of +The soil water fluxes in :eq:`7.103`,, which are a function of +:math:`\theta_{liq,\, i}` and :math:`\theta_{liq,\, i+1}` because of their dependence on hydraulic conductivity and soil matric potential, can be linearized about :math:`\theta` using a Taylor series expansion as .. math:: - :label: 7.108) + :label: 7.108 - q_{i}^{n+1} =q_{i}^{n} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} +\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } \Delta \theta _{liq,\, i+1} + q_{i}^{n+1} =q_{i}^{n} +\frac{\partial q_{i} }{\partial \theta_{liq,\, i} } \Delta \theta_{liq,\, i} +\frac{\partial q_{i} }{\partial \theta_{liq,\, i+1} } \Delta \theta_{liq,\, i+1} .. math:: - :label: 7.109) + :label: 7.109 - q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } \Delta \theta _{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } \Delta \theta _{liq,\, i} . + q_{i-1}^{n+1} =q_{i-1}^{n} +\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i-1} } \Delta \theta_{liq,\, i-1} +\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i} } \Delta \theta_{liq,\, i} . Substitution of these expressions for :math:`q_{i}^{n+1}` and -:math:`q_{i-1}^{n+1}` into equation results in a general tridiagonal +:math:`q_{i-1}^{n+1}` into :eq:`7.103` results in a general tridiagonal equation set of the form .. math:: - :label: 7.110) + :label: 7.110 - r_{i} =a_{i} \Delta \theta _{liq,\, i-1} +b_{i} \Delta \theta _{liq,\, i} +c_{i} \Delta \theta _{liq,\, i+1} + r_{i} =a_{i} \Delta \theta_{liq,\, i-1} +b_{i} \Delta \theta_{liq,\, i} +c_{i} \Delta \theta_{liq,\, i+1} where .. math:: - :label: ZEqnNum557934 + :label: 7.111 - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i-1} } .. math:: - :label: 7.112) + :label: 7.112 - b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + b_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.113) + :label: 7.113 - c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + c_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i+1} } .. math:: - :label: ZEqnNum981892 + :label: 7.114 r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -846,77 +859,89 @@ The tridiagonal equation set is solved over :math:`i=1,\ldots ,N_{levsoi}`. The finite-difference forms of the fluxes and partial derivatives in -equations - can be obtained from equation as +equations :eq:`7.111` - :eq:`7.114` can be obtained from equation as .. math:: - :label: 7.115) + :label: 7.115 - q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + q_{i-1}^{n} =-k\left[z_{h,\, i-1} \right]\left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.116) + :label: 7.116 - q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + q_{i}^{n} =-k\left[z_{h,\, i} \right]\left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} -z_{i} } \right] .. math:: - :label: 7.117) + :label: 7.117 - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } =-\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, i-1} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] .. math:: - :label: 7.118) + :label: 7.118 + + \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(z_{i} - z_{i-1} \right)}{z_{i} - z_{i-1} } \right] - \frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } =\left[\frac{k\left[z_{h,\, i-1} \right]}{z_{i} -z_{i-1} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i-1} -\psi _{i} \right)+\left(\psi _{E,\, i} -\psi _{E,\, i-1} \right)}{z_{i} -z_{i-1} } \right] .. math:: - :label: 7.119) + :label: 7.119 - \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right] + \frac{\partial q_{i} }{\partial \theta _{liq,\, i} } =-\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i} }{\partial \theta _{liq,\, i} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right] .. math:: - :label: 7.120) + :label: 7.120 - \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(\psi _{E,\, i+1} -\psi _{E,\, i} \right)}{z_{i+1} -z_{i} } \right]. + \frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } =\left[\frac{k\left[z_{h,\, i} \right]}{z_{i+1} -z_{i} } \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } \right]-\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } \left[\frac{\left(\psi _{i} -\psi _{i+1} \right)+\left(z_{i+1} - z_{i} \right)}{z_{i+1} - z_{i} } \right]. The derivatives of the soil matric potential at the node depth are -derived from equation +derived from :eq:`7.94` .. math:: - :label: 7.121) + :label: 7.121 - \frac{\partial \psi _{i-1} }{\partial \theta _{liq,\, \, i-1} } =-B_{i-1} \frac{\psi _{i-1} }{\theta _{\, \, i-1} } + \frac{\partial \psi _{i-1} }{\partial \theta_{liq,\, \, i-1} } =-B_{i-1} \frac{\psi _{i-1} }{\theta_{\, \, i-1} } .. math:: - :label: 7.122) + :label: 7.122 - \frac{\partial \psi _{i} }{\partial \theta _{\, liq,\, i} } =-B_{i} \frac{\psi _{i} }{\theta _{i} } + \frac{\partial \psi _{i} }{\partial \theta_{\, liq,\, i} } =-B_{i} \frac{\psi _{i} }{\theta_{i} } .. math:: - :label: 7.123) + :label: 7.123 - \frac{\partial \psi _{i+1} }{\partial \theta _{liq,\, i+1} } =-B_{i+1} \frac{\psi _{i+1} }{\theta _{\, i+1} } + \frac{\partial \psi _{i+1} }{\partial \theta_{liq,\, i+1} } =-B_{i+1} \frac{\psi _{i+1} }{\theta_{\, i+1} } with the constraint -:math:`0.01\, \theta _{sat,\, i} \le \theta _{\, i} \le \theta _{sat,\, i}` . +:math:`0.01\, \theta_{sat,\, i} \le \theta_{\, i} \le \theta_{sat,\, i}` . The derivatives of the hydraulic conductivity at the layer interface are -derived from equation +derived from :eq:`7.85` .. math:: - :label: 7.124) + :label: 7.124 - \begin{array}{l} {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } =\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } =\left(1-\frac{f_{frz,\, i-1} +f_{frz,\, i} }{2} \right)\left(2B_{i-1} +3\right)k_{sat} \left[z_{h,\, i-1} \right]\times } \\ {\qquad \left[\frac{0.5\left(\theta _{\, i-1} +\theta _{\, i} \right)}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right]^{2B_{i-1} +2} \left(\frac{0.5}{0.5\left(\theta _{sat,\, i-1} +\theta _{sat,\, i} \right)} \right)} \end{array} + \begin{array}{l} + {\frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i-1} } + = \frac{\partial k\left[z_{h,\, i-1} \right]}{\partial \theta _{liq,\, i} } + = \left(2B_{i-1} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i-1} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i-1} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array} + +where :math:`\overline{\Theta}_{ice} = \Theta(\overline{\theta}_{ice})` :eq:`7.86`, +:math:`\overline{\theta}_{ice} = 0.5\left(\theta_{ice\, i-1} +\theta_{ice\, i} \right)`, +:math:`\overline{\theta}_{liq} = 0.5\left(\theta_{liq\, i-1} +\theta_{liq\, i} \right)`, +and +:math:`\overline{\theta}_{sat} = 0.5\left(\theta_{sat,\, i-1} +\theta_{sat,\, i} \right)` + +and .. math:: - :label: 7.125) + :label: 7.125 \begin{array}{l} {\frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i} } = \frac{\partial k\left[z_{h,\, i} \right]}{\partial \theta _{liq,\, i+1} } - = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array} + = \left(2B_{i} +3\right) \ \overline{\Theta}_{ice} \ k_{sat} \left[z_{h,\, i} \right] \ \left[\frac{\overline{\theta}_{liq}}{\overline{\theta}_{sat}} \right]^{2B_{i} +2} \left(\frac{0.5}{\overline{\theta}_{sat}} \right)} \end{array}. -where :math:`\overline{\theta}_{liq} = 0.5\left(\theta _{\, i} +\theta _{\, i+1} \right)`, -:math:`\overline{\theta}_{sat} = 0.5\left(\theta _{sat,\, i} +\theta _{sat,\, i+1} \right)`. +where :math:`\overline{\theta}_{liq} = 0.5\left(\theta_{\, i} +\theta_{\, i+1} \right)`, +:math:`\overline{\theta}_{sat} = 0.5\left(\theta_{sat,\, i} +\theta_{sat,\, i+1} \right)`. Equation set for layer :math:`i=1` '''''''''''''''''''''''''''''''''''''''''' @@ -927,30 +952,30 @@ infiltration rate (section :numref:`Surface Runoff`), is .. math:: - :label: 7.135) + :label: 7.135 - \frac{\Delta z_{i} \Delta \theta _{liq,\, i} }{\Delta t} =q_{infl}^{n+1} +q_{i}^{n+1} -e_{i} . + \frac{\Delta z_{i} \Delta \theta_{liq,\, i} }{\Delta t} =q_{infl}^{n+1} +q_{i}^{n+1} -e_{i} . After grouping like terms, the coefficients of the tridiagonal set of equations for :math:`i=1` are .. math:: - :label: 7.136) + :label: 7.136 a_{i} =0 .. math:: - :label: 7.137) + :label: 7.137 - b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + b_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.138) + :label: 7.138 - c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + c_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i+1} } .. math:: - :label: 7.139) + :label: 7.139 r_{i} =q_{infl}^{n+1} -q_{i}^{n} +e_{i} . @@ -961,22 +986,22 @@ The coefficients of the tridiagonal set of equations for :math:`i=2,\ldots ,N_{levsoi} -1` are .. math:: - :label: 7.140) + :label: 7.140 - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i-1} } .. math:: - :label: 7.141) + :label: 7.141 - b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + b_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.142) + :label: 7.142 - c_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i+1} } + c_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i+1} } .. math:: - :label: 7.143) + :label: 7.143 r_{i} =q_{i-1}^{n} -q_{i}^{n} +e_{i} . @@ -989,22 +1014,22 @@ and the coefficients of the tridiagonal set of equations for :math:`i=N_{levsoi}` are .. math:: - :label: 7.148) + :label: 7.148 - a_{i} =-\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i-1} } + a_{i} =-\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i-1} } .. math:: - :label: 7.149) + :label: 7.149 - b_{i} =\frac{\partial q_{i} }{\partial \theta _{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta _{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} + b_{i} =\frac{\partial q_{i} }{\partial \theta_{liq,\, i} } -\frac{\partial q_{i-1} }{\partial \theta_{liq,\, i} } -\frac{\Delta z_{i} }{\Delta t} .. math:: - :label: 7.150) + :label: 7.150 c_{i} =0 .. math:: - :label: 7.151) + :label: 7.151 r_{i} =q_{i-1}^{n} +e_{i} . @@ -1015,7 +1040,7 @@ An initial solution is found by setting :math:`\Delta t` equal to the model time step. An estimate of the error is calculated from .. math:: - :label: 7.152) + :label: 7.152 \epsilon = max \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] @@ -1031,16 +1056,16 @@ Upon solution of the tridiagonal equation set, the liquid water contents are updated as follows .. math:: - :label: 7.164) + :label: 7.164 - w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\Delta \theta _{liq,\, i} \Delta z_{i} \qquad i=1,\ldots ,N_{levsoi} . + w_{liq,\, i}^{n+1} =w_{liq,\, i}^{n} +\Delta \theta_{liq,\, i} \Delta z_{i} \qquad i=1,\ldots ,N_{levsoi} . The volumetric water content is .. math:: - :label: 7.165) + :label: 7.165 - \theta _{i} =\frac{w_{liq,\, i} }{\Delta z_{i} \rho _{liq} } +\frac{w_{ice,\, i} }{\Delta z_{i} \rho _{ice} } . + \theta_{i} =\frac{w_{liq,\, i} }{\Delta z_{i} \rho _{liq} } +\frac{w_{ice,\, i} }{\Delta z_{i} \rho _{ice} } . .. _Frozen Soils and Perched Water Table: @@ -1048,15 +1073,15 @@ Frozen Soils and Perched Water Table ---------------------------------------- When soils freeze, the power-law form of the ice impedance factor -(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic conductivity of the -soil, leading to nearly impermeable soil layers. When unfrozen soil -layers are present above relatively ice-rich frozen layers, the +(section :numref:`Hydraulic Properties`) can greatly decrease the hydraulic +conductivity of the soil, leading to nearly impermeable soil layers. When unfrozen +soil layers are present above relatively ice-rich frozen layers, the possibility exists for perched saturated zones. Lateral drainage from perched saturated regions is parameterized as a function of the thickness of the saturated zone .. math:: - :label: 7.166) + :label: 7.166 q_{drai,perch} =k_{drai,\, perch} \left(z_{frost} -z_{\nabla ,perch} \right) @@ -1064,9 +1089,9 @@ where :math:`k_{drai,\, perch}` depends on topographic slope and soil hydraulic conductivity, .. math:: - :label: 7.167) + :label: 7.167 - k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta _{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) + k_{drai,\, perch} =10^{-5} \sin (\beta )\left(\frac{\sum _{i=N_{perch} }^{i=N_{frost} }\Theta_{ice,i} k_{sat} \left[z_{i} \right]\Delta z_{i} }{\sum _{i=N_{perch} }^{i=N_{frost} }\Delta z_{i} } \right) where :math:`\Theta_{ice}` is an ice impedance factor, :math:`\beta` is the mean grid cell topographic slope in @@ -1089,7 +1114,7 @@ Lateral sub-surface runoff occurs when saturated soil moisture conditions exist within the soil column. Sub-surface runoff is .. math:: - :label: 7.168) + :label: 7.168 q_{subsurface} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) \Delta z_{sat}^{N_{baseflow}} \ , @@ -1101,13 +1126,14 @@ is the thickness of the saturated portion of the soil column. The saturated thickness is .. math:: - :label: 7.1681) + :label: 7.1681 \Delta z_{sat} = z_{bedrock} - z_{\nabla}, where the water table :math:`z_{\nabla}` is determined by finding the -first soil layer above the bedrock depth (section ) in which the volumetric water -content drops below a specified threshold. The default threshold is set to 0.9. +irst soil layer above the bedrock depth (section :numref:`Depth to Bedrock`) +in which the volumetric water content drops below a specified threshold. +The default threshold is set to 0.9. The specific yield, :math:`S_{y}` , which depends on the soil properties and the water table location, is derived by taking the @@ -1115,22 +1141,22 @@ difference between two equilibrium soil moisture profiles whose water tables differ by an infinitesimal amount .. math:: - :label: 7.174) + :label: 7.174 - S_{y} =\theta _{sat} \left(1-\left(1+\frac{z_{\nabla } }{\Psi _{sat} } \right)^{\frac{-1}{B} } \right) + S_{y} =\theta_{sat} \left(1-\left(1+\frac{z_{\nabla } }{\Psi _{sat} } \right)^{\frac{-1}{B} } \right) where B is the Clapp-Hornberger exponent. Because :math:`S_{y}` is a function of the soil properties, it results in water table dynamics that -are consistent with the soil water fluxes described in section 7.4. +are consistent with the soil water fluxes described in section :numref:`Soil Water`. After the above calculations, two numerical adjustments are implemented to keep the liquid water content of each soil layer (:math:`w_{liq,\, i}` ) within physical constraints of -:math:`w_{liq}^{\min } \le w_{liq,\, i} \le \left(\theta _{sat,\, i} -\theta _{ice,\, i} \right)\Delta z_{i}` +:math:`w_{liq}^{\min } \le w_{liq,\, i} \le \left(\theta_{sat,\, i} -\theta_{ice,\, i} \right)\Delta z_{i}` where :math:`w_{liq}^{\min } =0.01` (mm). First, beginning with the bottom soil layer :math:`i=N_{levsoi}` , any excess liquid water in each soil layer -(:math:`w_{liq,\, i}^{excess} =w_{liq,\, i} -\left(\theta _{sat,\, i} -\theta _{ice,\, i} \right)\Delta z_{i} \ge 0`) +(:math:`w_{liq,\, i}^{excess} =w_{liq,\, i} -\left(\theta_{sat,\, i} -\theta_{ice,\, i} \right)\Delta z_{i} \ge 0`) is successively added to the layer above. Any excess liquid water that remains after saturating the entire soil column (plus a maximum surface ponding depth :math:`w_{liq}^{pond} =10` kg m\ :sup:`-2`), is @@ -1147,21 +1173,21 @@ found, then the water is removed from :math:`W_{t}` and :math:`q_{drai}` . The soil surface layer liquid water and ice contents are then updated -for dew :math:`q_{sdew}` , frost :math:`q_{frost}` , or sublimation -:math:`q_{subl}` (section 5.4) as +for dew :math:`q_{sdew}` , frost :math:`q_{frost}` , or sublimation :math:`q_{subl}` +(section :numref:`Update of Ground Sensible and Latent Heat Fluxes`) as .. math:: - :label: 7.175) + :label: 7.175 w_{liq,\, 1}^{n+1} =w_{liq,\, 1}^{n} +q_{sdew} \Delta t .. math:: - :label: 7.176) + :label: 7.176 w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} +q_{frost} \Delta t .. math:: - :label: 7.177) + :label: 7.177 w_{ice,\, 1}^{n+1} =w_{ice,\, 1}^{n} -q_{subl} \Delta t. @@ -1179,12 +1205,12 @@ and dew in solid or liquid form, is separated into solid :math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms .. math:: - :label: 7.178) + :label: 7.178 q_{snwcp,ice} =q_{grnd,ice} +q_{frost} .. math:: - :label: 7.179) + :label: 7.179 q_{snwcp,liq} =q_{grnd,liq} +q_{dew} @@ -1200,7 +1226,7 @@ For glacier surfaces the runoff term :math:`q_{rgwl}` is calculated from the residual of the water balance .. math:: - :label: 7.180) + :label: 7.180 q_{rgwl} =q_{grnd,ice} +q_{grnd,liq} -E_{g} -E_{v} -\frac{\left(W_{b}^{n+1} -W_{b}^{n} \right)}{\Delta t} -q_{snwcp,ice} @@ -1208,7 +1234,7 @@ where :math:`W_{b}^{n}` and :math:`W_{b}^{n+1}` are the water balances at the beginning and ending of the time step defined as .. math:: - :label: 7.181) + :label: 7.181 W_{b} =W_{can} +W_{sno} +\sum _{i=1}^{N}\left(w_{ice,i} +w_{liq,i} \right) . @@ -1218,3 +1244,4 @@ section :numref:`Precipitation, Evaporation, and Runoff Lake`. The runoff term :math:`q_{rgwl}` may be negative for glaciers and lakes, which reduces the total amount of runoff available to the river routing model (Chapter :numref:`rst_River Transport Model (RTM)`). +> diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 987ac62c8e..3781c4b7a2 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1566,7 +1566,7 @@ Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity in soils and cultures to water stress. Applied and Environmental Microbiology 62:3203-3209. -.. _Segers, R., 1998. Methane production and methane consumption: a review +.. _Segers1998: Segers, R., 1998. Methane production and methane consumption: a review of processes underlying wetland methane fluxes. Biogeochemistry From 4f1c013b4fb53b6bc26a5488314b54456db29e85 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Mon, 5 Jun 2017 09:42:32 -0600 Subject: [PATCH 045/730] one more hydrology fix --- doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 2 +- doc/source/tech_note/References/CLM50_Tech_Note_References.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 9dec375356..db82c6ac68 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -436,7 +436,7 @@ and .. math:: :label: 7.75 - qin,soil=(1-f_{h2osfc} )q_{in,surface} - q_{\inf l,excess} - (1-f_{sno} -f_{h2osfc} ) \ qevap,soil. + q_{in,soil} = (1-f_{h2osfc} ) \ q_{in,surface} - q_{\inf l,excess} - (1 - f_{sno} - f_{h2osfc} ) \ q_{evap,soil}. The balance of surface water is then calculated as diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 3781c4b7a2..1847c205df 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1225,6 +1225,8 @@ Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. +.. _NiuYang2006: + Niu, G.-Y., and Yang, Z.-L. 2006. Effects of frozen soil on snowmelt runoff and soil water storage at a continental scale. J. Hydrometeor. 7:937-952. From d75f87650aac53df6e10f018475003705516332d Mon Sep 17 00:00:00 2001 From: djk2120 Date: Mon, 5 Jun 2017 15:20:54 -0400 Subject: [PATCH 046/730] PHS update, including circuit diagram and more explantory text, part 2 --- ...CLM50_Tech_Note_Plant_Hydraulic_Stress.rst | 58 ++++++++++++++----- 1 file changed, 42 insertions(+), 16 deletions(-) diff --git a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst index 02132af76d..d8bad01423 100644 --- a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst +++ b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst @@ -3,7 +3,13 @@ Plant Hydraulic Stress ====================== -Hello +Introductory text... + +.. _Figure Soil Temperature Schematic: + +.. figure:: circuit.jpg + + Circuit diagram of plant hydraulics scheme .. _Plant Water Supply: @@ -19,27 +25,32 @@ In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculate .. math:: :label: 11.1) - q = kA\Delta\psi + q = kA\left( \psi_1 - \psi_2 \right) -:math:`q` is the flux of water (mmH\ :sub:`2`\ O) +:math:`q` is the flux of water (mmH\ :sub:`2`\ O) spanning the segment between :math:`\psi_1` and :math:`\psi_2` :math:`k` is the hydraulic conductance (s\ :sup:`-1`\ ) -:math:`A` is the area basis (m\ :sup:`2`\ /m\ :sup:`2`\ ) +:math:`A` is the area basis (m\ :sup:`2`\ /m\ :sup:`2`\ ) relating the conducting area basis to ground area -:math:`\Delta\psi` is the gradient in water potential (mmH\ :sub:`2`\ O) +:math:`\psi_1 - \psi_2` is the gradient in water potential (mmH\ :sub:`2`\ O) across the segment .. math:: :label: 11.2) - k=k_{max}\cdot 2^{-\left(\dfrac{\psi}{p50}\right)^{c_k}} + k=k_{max}\cdot 2^{-\left(\dfrac{\psi_1}{p50}\right)^{c_k}} :math:`k_{max}` is the maximum segment conductance (s-1) :math:`p50` is the water potential at 50% loss of conductivity (mmH2O) -:math:`\psi` is the water potential of the lower segment terminus (mmH2O) +:math:`\psi_1` is the water potential of the lower segment terminus (mmH2O) + +The area basis and conductance parameterization varies by segment. There are two stem-to-leaf fluxes in parallel, from stem to sunlit leaf and from stem to shaded leaf (:math:`q_{1a}` and :math:`q_{1a}`). +The water flux from stem-to-leaf is the product of the segment conductance, the conducting area basis, and the water potential gradient from stem to leaf. Stem-to-leaf conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve. +The maximum conductance is a PFT parameter representing the maximum conductance of water from stem to leaf per unit leaf area. +This parameter can be defined separately for sunlit and shaded segments and should already include the appropriate length scaling (in other words this is a conductance, not conductivity). The water potential gradient is the difference between leaf water potential and stem water potential. There is no gravity term, assuming a negligible difference in height across the segment. The area basis is the leaf area index (either sunlit or shaded). .. math:: :label: 11.3) @@ -63,15 +74,19 @@ In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculate Variables: +:math:`q_{1a}` = flux of water (mmH2O/s) from stem to sunlit leaf + +:math:`q_{1b}` = flux of water (mmH2O/s) from stem to shaded leaf + :math:`LAI_{sun}` = sunlit leaf area index (m2/m2) :math:`LAI_{shade}` = shaded leaf area index (m2/m2) -:math:`\psi_{stem}` = stem water potential (mmH20) +:math:`\psi_{stem}` = stem water potential (mmH2O) -:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH20) +:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH2O) -:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH20) +:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH2O) Parameters: @@ -83,6 +98,8 @@ Parameters: :math:`c_{k}` = vulnerability curve shape-fitting parameter (-) +There is one root-to-stem flux. This represents a flux from the root collar to the upper branch reaches. The water flux from root-to-stem is the product of the segment conductance, the conducting area basis, and the water potential gradient from root to stem. Root-to-stem conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve (two parameters). The maximum conductance is defined as the maximum root-to-stem conductivity per unit stem area (PFT parameter) divided by the length of the conducting path, which is taken to be the vegetation height. The area basis is the stem area index. The gradient in water potential is the difference between the root water potential and the stem water potential less the difference in gravitational potential. + .. math:: :label: 11.7) @@ -95,6 +112,8 @@ Parameters: Variables: +:math:`q_2` = flux of water (mmH2O/s) from root to stem + :math:`SAI` = stem area index (m2/m2) :math:`\Delta\psi_z` = gravitational potential (mmH2O) @@ -111,6 +130,14 @@ Parameters: :math:`z_2` = vegetation height (m) +There are several soil-to-root fluxes operating in parallel (one for each root-containing soil layer). Each represents a flux from the given soil layer to the root collar. The water flux from soil-to-root is the product of the segment conductance, the conducting area basis, and the water potential gradient from soil to root. The area basis is a proxy for root area index, defined as the summed leaf and stem area index multiplied by the root-to-shoot ratio (PFT parameter) multiplied by the layer root fraction. The root fraction comes from an empirical root profile (see section zqz). + +The gradient in water potential is the difference between the soil water potential and the root water potential less the difference in gravitational potential. There is only one root water potential to which all soil layers are connected in parallel. A soil-to-root flux can be either positive (vegetation water uptake) or negative (water deposition), depending on the relative values of the root and soil water potentials. This allows for the occurrence of hydraulic redistribution where water moves through vegetation tissue from one soil layer to another. + +Soil-to-root conductance is the result of two resistances in series, first across the soil-root interface and then through the root tissue. The root tissue conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve. The maximum conductance is defined as the maximum root-tissue conductivity (PFT parameter) divided by the length of the conducting path, which is taken to be the soil layer depth plus lateral root length. + +The soil-root interface conductance is defined as the soil conductivity divided by the conducting length from soil to root. The soil conductivity varies by soil layer and is calculated based on soil potential and soil properties, via the Brooks-Corey theory. The conducting length is computed by calculating the characteristic root spacing following Bonan-2014. The root spacing depends on total root biomass and PFT parameters defining root structure (see section zqz). + .. math:: :label: 11.9) @@ -124,17 +151,17 @@ Parameters: .. math:: :label: 11.11) - k_{3,i}=\dfrac{k_{root}*k_{soil-to-root}}{k_{root}+k_{soil-to-root}} + k_{3,i}=\dfrac{k_{r,i}*k_{s,i}}{k_{r,i}+k_{s,i}} .. math:: :label: 11.12) - k_{root,i}=\dfrac{k_{3,max}}{z_{3,i}}*2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} + k_{r,i}=\dfrac{k_{3,max}}{z_{3,i}}*2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} .. math:: :label: 11.13) - k_{soil-to-root} = \dfrac{k_{soil,i}}{dx_{root,i}} + k_{s,i} = \dfrac{k_{soil,i}}{dx_{root,i}} .. math:: :label: 11.14) @@ -148,6 +175,8 @@ Parameters: Variables: +:math:`q_{3,i}` = flux of water (mmH2O/s) from soil layer :math:`i` to root + :math:`\Delta\psi_{z,i}` = change in gravitational potential from soil layer :math:`i` to surface (mmH2O) :math:`LAI` = total leaf area index (m2/m2) @@ -249,9 +278,6 @@ The demand terms (left-hand side) are decreasing functions of absolute leaf wate -Yo - - From 481ad0a657c8ba200b1d807b42f7b1cff16334a7 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Mon, 5 Jun 2017 16:32:32 -0600 Subject: [PATCH 047/730] Updated crop chapter, crop functional type section, and added associated references --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 35 ++++++++++++------- .../References/CLM50_Tech_Note_References.rst | 6 ++++ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 98c5ddcea3..1de6809021 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -90,25 +90,34 @@ vegetated land unit is separated into a naturally vegetated land unit and a managed crop land unit. Unlike the plant functional types (pfts) in the naturally vegetated land unit, the managed crop pfts in the managed crop land unit do not share soil columns and thus permit for differences in the -land management between crops. Crop grid cell coverage is assigned from +land management between crops. Each crop type has a rainfed and an irrigated +pft that are on independent soil columns. Crop grid cell coverage is assigned from satellite data (similar to all natural pfts), and the managed crop type proportions within the crop area is based on the dataset created by (:ref:`Portmann et al. 2010 `) for present day and -extrapolated through time using the LUMIP data (insert citation). Each -actively managed crop type has a rainfed and an irrigated pft that are on -independent soil columns. Actively managed crop types (Table XX) are chosen +extrapolated through time using the dataset provided by Land Use Model +Intercomparison Project (LUMIP), which is part of CMIP6 Land use timeseries +(:ref:`Lawrence et al. 2016 `). For more details about how +crop distributions are determined, see chapter 26 on :ref:`rst_Transient Landcover Change`. + +CLM5 includes eight actively managed crop types +(temperate soybean, tropical soybean, temperate corn, tropical +corn, spring wheat, cotton, rice, and sugarcane) that are chosen based on the availability of corresponding algorithms in AgroIBIS and as developed by Badger and Dirmeyer (:ref:`2015 `) and -described by Levis et al. (:ref:`2016 `). A parameterization -for winter cereals is developed but is not included in CLM5.0 due to the -inability to distinguish between winter and summer cereals in the LUMIP dataset (insert citation). - +described by Levis et al. (:ref:`2016 `). In addition, CLM’s default list of plant functional types (pfts) includes an -unmanaged crop (Table 2.1) treated as a second C3 grass, as well as several -additional crop types that do not have associated parameters. The unmanaged -crop has grid cell coverage assigned from satellite data, as do all -natural pfts when CLM’s crop model is not active. [include remapping text here]. - +irrigated and unirrigated unmanaged C3 crop (Table 2.1)[update table reference] treated as a second C3 grass. +The unmanaged C3 crop is only used when the crop model is not active and +has grid cell coverage assigned from satellite data. [info here about irrigation for unmanaged C3 crop] +The default list of pfts also includes twenty-three inactive crop pfts +that do not yet have associated parameters required for active management. So that all crop area is actively managed, +each of the inactive crop types is simulated using the parameters of the +spatially closest associated crop type that is most similar to the functional type (e.g., C3 or C4), +which is required to maintain similar phenological parameters. +The information detailing which parameters are used for each crop type is +included in Table XX. It should be noted that analysis with pft-level history output will +need to remap the crop types, as pft-level data will only include actively managed crop types. .. _Phenology: diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 7fb1521105..2c168c5fd4 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -894,6 +894,12 @@ Law, B.E., Sun, O.J., Campbell, J., Van Tuyl, S. and Thornton, P.E. 2003. Changes in carbon storage and fluxes in a chronosequence of ponderosa pine. Global Change Biology, 9: 510-514. +.. _Lawrenceetal2016: + +Lawrence, D.M., et al. 2016. The Land Use Model Intercomparison Project +(LUMIP) contribution to CMIP6: rationale and experimental design. Geo. Sci. +Dev. 9:2973-2998. + .. _Lawrenceetal2007: Lawrence, D.M., Thornton, P.E., Oleson, K.W., and Bonan, G.B. 2007. The From 0e3abef7bb61aa4b3610495893871bf36cfa1cc7 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Tue, 6 Jun 2017 07:51:43 -0600 Subject: [PATCH 048/730] reformat Surfacealbedo --- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 45977ead34..f16a46ec97 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -1159,7 +1159,14 @@ series expansions for the eccentricity :math:`e`\ as follows: .. math:: :label: 3.87 - \Pi =\left\{\begin{array}{l} {0\qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } =0} \\ {1.5\pi \qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } <0} \\ {0.5\pi \qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } >0} \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+\pi \qquad {\rm for\; }e^{\cos } <{\rm -1}\times {\rm 10}^{{\rm -8}} } \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+2\pi \qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } <0} \\ {\tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]\qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } \ge 0} \end{array}\right\}. + \Pi =\left\{\begin{array}{lr} + 0 & \qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } = 0 \\ + 1.5\pi & \qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } < 0 \\ + 0.5\pi & \qquad {\rm for\; -1}\times {\rm 10}^{{\rm -8}} \le e^{\cos } \le 1\times 10^{-8} {\rm \; and\; }e^{\sin } > 0 \\ + \tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+\pi & \qquad {\rm for\; }e^{\cos } <{\rm -1}\times {\rm 10}^{{\rm -8}} \\ + \tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right]+2\pi & \qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } <0 \\ + \tan ^{-1} \left[\frac{e^{\sin } }{e^{\cos } } \right] & \qquad {\rm for\; }e^{\cos } >{\rm 1}\times {\rm 10}^{{\rm -8}} {\rm \; and\; }e^{\sin } \ge 0 + \end{array}\right\}. The numerical solution for the longitude of the perihelion :math:`\tilde{\omega }` is constrained to be between 0 and 360 degrees From 3e1dbc96f21bf6659a052becd1bf8aaa5243aa66 Mon Sep 17 00:00:00 2001 From: Yaqiong Lu Date: Tue, 6 Jun 2017 10:57:16 -0600 Subject: [PATCH 049/730] updated fertilization and latvery GDD --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 54 ++++++++++++++----- .../References/CLM50_Tech_Note_References.rst | 9 ++++ 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 1b2548d64f..4f85e4309b 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -610,13 +610,18 @@ Interactive fertilization CLM adds nitrogen directly to the soil mineral nitrogen pool to meet crop nitrogen demands. CLM’s separate crop land unit ensures that natural vegetation will not access the fertilizer applied to crops. -Fertilizer amounts are obtained from the Agro-IBIS model (Kucharik and -Brye 2003), but can be modified in CLM’s pft-physiology input dataset. -Fertilizer is reported in g N/m\ :sup:`2` by plant functional -type. Total nitrogen fertilizer amounts are 150 g N/m\ :sup:`2` -for maize, 80 g N/m\ :sup:`2` for temperate cereals, and 25 g -N/m\ :sup:`2` for soybean, representative of central U.S. annual -fertilizer application amounts. Since CLM’s denitrification rate is high +Fertilizer in CLM5BGCCROP is prescribed by crop function types spatially +for each year based on the LUMIP land use and land cover change +time series (LUH2 for historical and SSPs for future) (:ref:`Lawrence et al. 2016 `). +There are two fields that are used to prescribe industrial fertilizer. +On the surface data set the field CONST_FERTNITRO_CFT specifies the +annual fertilizer application for a non-transient simulations in g N/m\ :sup:`2`/yr. +In the case of a transient simulation this is replaced by the landuse.timeseries +file with the field FERTNITRO_CFT which is also in g N/m\ :sup:`2`/yr. +The values for both of these fields come from the LUMIP time series for each year. +In addition to the industrial fertilizer there is a background manure fertilizer +on the clm parameters file with the field manunitro. For the current CLM5BGCCROP, +this is set to 0.002 kg N/m\ :sup:`2`/yr. Since CLM’s denitrification rate is high and results in a 50% loss of the unused available nitrogen each day, fertilizer is applied slowly to minimize the loss and maximize plant uptake. Fertilizer application begins during the emergence phase of crop @@ -627,18 +632,18 @@ limit fertilizer application to the emergence stage. A fertilizer counter in seconds, *f*, is set as soon as the onset growth for crops initiates: -*f* = *n* \* 86400 [20.9)] +.. math:: + :label: 25.18 + + f = n \times 86400 where *n* is set to 20 fertilizer application days. When the crop enters phase 2 (leaf emergence to the beginning of grain fill) of its growth cycle, fertilizer application begins by initializing fertilizer amount -to the total fertilizer divided by the initialized *f*. Fertilizer is -applied and *f* is decremented each time step until a zero balance on +to the total fertilizer at each grid cell divided by the initialized *f*. +Fertilizer is applied and *f* is decremented each time step until a zero balance on the counter is reached. -The crop fertilization scheme was developed in versions of the CLM prior -to CLM4.5. In CLM4.5, crops with fertilization may be simulated over -productive. .. _Biological nitrogen fixation for soybeans: @@ -800,3 +805,26 @@ the CLM4.0, allocation of carbon to the reproductive pool was calculated but merged with the stem pool. In the model, as allocation declines during the grain fill stage of growth, increasing amounts of carbon and nitrogen are available for grain development. + +.. _Latitude vary base tempereature for growing degree days: + +Latitude vary base tempereature for growing degree days +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +For both rainfed and irrigated spring wheat and sugarcane, +a latitude vary base temperature in calculating :math:`GDD_{T_{{\rm 2m}} }` +(growing degree days since planting) was introduced. + +.. math:: + :label: 25.17 + + latitude\ vary\ baset = \left\{ + \begin{array}{lr} + baset +12 - 0.4 \times latitude &\qquad 0 \le latitude \le 30 \\ + baset +12 + 0.4 \times latitude &\qquad -30 \le latitude \le 0 + \end{array} \right\} + +where :math:`baset` is the 5\ :sup:`th` column in :numref:`Table Crop plant functional types`. +Such latitude vary baset could increase the base temperature, slow down :math:`GDD_{T_{{\rm 2m}} }` +accumulation, and extend the growing season for -30º to 30º regions for spring wheat +and sugarcane. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 1847c205df..4a88ae39e2 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -927,6 +927,15 @@ and A.G. Slater, 2011. Parameterization improvements and functional and structural advances in version 4 of the Community Land Model. J. Adv. Model. Earth Sys. 3. DOI:10.1029/2011MS000045. +.. _Lawrenceetal2016: + +Lawrence, D. M., Hurtt, G. C., Arneth, A., Brovkin, V., Calvin, K. V., +Jones, A. D., Jones, C. D., Lawrence, P. J., de Noblet-Ducoudré, N., Pongratz, +J., Seneviratne, S. I., and Shevliakova, E, 2016. The Land Use Model +Intercomparison Project (LUMIP) contribution to CMIP6: rationale +and experimental design, Geosci. Model Dev., 9, 2973-2998, +doi:10.5194/gmd-9-2973-2016. + .. _LawrenceChase2007: Lawrence, P.J., and Chase, T.N. 2007. Representing a MODIS consistent From b8cc331040e3eb7fc8bdd075d931d91f7d17d30c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 6 Jun 2017 12:08:06 -0600 Subject: [PATCH 050/730] Updates to Offline chapter --- .../Offline/CLM50_Tech_Note_Offline.rst | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst index da2788a5f9..0419ec668e 100644 --- a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst +++ b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst @@ -5,26 +5,29 @@ Offline Mode In offline mode (uncoupled to an atmospheric model), the atmospheric forcing required by CLM (:numref:`Table Atmospheric input to land model`) -is supplied by observed datasets. The standard forcing provided with the -model is a 110-year (1901-2010) dataset (CRUNCEP; :ref:`Viovy 2011 `) -that is a combination of two existing datasets; the CRU TS3.2 0.5\ -:math:`{}^\circ` X 0.5\ :math:`{}^\circ` monthly data covering the period +is supplied by observed datasets. The standard forcing provided with the +model is a 110-year (1901-2010) dataset provided by the Global Soil Wetness +Project (GSWP3; NEED A REFERENCE). The GSWP3 dataset has a spatial resolution of +0.5\ :math:`{}^o` X 0.5\ :math:`{}^o` and a temporal resolution of three +hours. + +An alternative forcing dataset is also available, CRUNCEP, a 110-year (1901-2010) dataset +(CRUNCEP; :ref:`Viovy 2011 `) that is a combination of two existing datasets; +the CRU TS3.2 0.5\ :math:`{}^o` X 0.5\ :math:`{}^o` monthly data covering the period 1901 to 2002 (:ref:`Mitchell and Jones 2005 `) -and the NCEP reanalysis 2.5\ :math:`{}^\circ` X 2.5\ :math:`{}^\circ` +and the NCEP reanalysis 2.5\ :math:`{}^o` X 2.5\ :math:`{}^o` 6-hourly data covering the period 1948 to 2010. The CRUNCEP dataset has been used to force CLM for studies of vegetation growth, evapotranspiration, and gross primary production (:ref:`Mao et al. 2012 `, :ref:`Mao et al. 2013 `, :ref:`Shi et al. 2013 `) and for the TRENDY (trends in net land-atmosphere carbon exchange over the period -1980-2010) project (:ref:`Piao et al. 2012 `). Version 4 is used -here (:ref:`Viovy 2011 `). Alternative forcing datasets can also be used -(e.g., the :ref:`Qian et al. (2006) ` dataset used for -previous versions of CLM is still available). +1980-2010) project (:ref:`Piao et al. 2012 `). Version 7 is available +here (:ref:`Viovy 2011 `). -Here, the CRUNCEP dataset, which does not include data over oceans, +Here, the GSWP3 dataset, which does not include data for particular fields over oceans, lakes, and Antarctica is modified. This missing data is filled with :ref:`Qian et al. (2006) ` data from 1948 that is interpolated by the data atmosphere -model to the 0.5\ :math:`{}^\circ` CRUNCEP grid. This allows the model +model to the 0.5\ :math:`{}^o` GSWP3 grid. This allows the model to be run over Antarctica and ensures data is available along coastlines regardless of model resolution. @@ -35,19 +38,19 @@ fields [atmospheric pressure :math:`P_{atm}` (Pa), atmospheric specific humidity :math:`q_{atm}` (kg kg\ :sup:`-1`), atmospheric temperature :math:`T_{atm}` (K), and atmospheric wind :math:`W_{atm}` (m s\ :sup:`-1`)]. These are separate streams because they are -handled differently according to the type of field. In the CRUNCEP -dataset, the precipitation stream is provided at six hour intervals and +handled differently according to the type of field. In the GSWP3 +dataset, the precipitation stream is provided at three hour intervals and the data atmosphere model prescribes the same precipitation rate for -each model time step within the six hour period. The four fields that +each model time step within the three hour period. The four fields that are grouped together in another stream (pressure, humidity, temperature, -and wind) are provided at six hour intervals and the data atmosphere +and wind) are provided at three hour intervals and the data atmosphere model linearly interpolates these fields to the time step of the model. -The total solar radiation is also provided at six hour intervals. The +The total solar radiation is also provided at three hour intervals. The data is fit to the model time step using a diurnal function that depends on the cosine of the solar zenith angle :math:`\mu` to provide a smoother diurnal cycle of solar radiation and to ensure that all of the -solar radiation supplied by the six-hourly forcing data is actually +solar radiation supplied by the three-hourly forcing data is actually used. The solar radiation at model time step :math:`t_{M}` is .. math:: @@ -58,15 +61,15 @@ used. The solar radiation at model time step :math:`t_{M}` is S_{atm} \left(t_{M} \right)=0 & \qquad {\rm for\; }\mu \left(t_{M} \right)\le 0.001 \end{array} -where :math:`\Delta t_{FD}` is the time step of the forcing data (6 -hours :math:`\times` 3600 seconds hour\ :sup:`-1` = 21600 +where :math:`\Delta t_{FD}` is the time step of the forcing data (3 +hours :math:`\times` 3600 seconds hour\ :sup:`-1` = 10800 seconds), :math:`\Delta t_{M}` is the model time step (seconds), -:math:`S_{atm} \left(t_{FD} \right)` is the six-hourly solar radiation +:math:`S_{atm} \left(t_{FD} \right)` is the three-hourly solar radiation from the forcing data (W m\ :sup:`-2`), and :math:`\mu \left(t_{M} \right)` is the cosine of the solar zenith angle -at model time step :math:`t_{M}` (section 3.3). The term in the -denominator of equation is the sum of the cosine of the solar zenith -angle for each model time step falling within the six hour period. For +at model time step :math:`t_{M}` (section :numref:`Solar Zenith Angle`). The term in the +denominator of equation (1) is the sum of the cosine of the solar zenith +angle for each model time step falling within the three hour period. For numerical purposes, :math:`\mu \left(t_{M_{i} } \right)\ge 0.001`. The total incident solar radiation :math:`S_{atm}` at the model time @@ -122,7 +125,7 @@ where :math:`a_{0} =0.17639,\, a_{1} =0.00380,\, a_{2} =-9.0039\times 10^{-6} ,\, a_{3} =8.1351\times 10^{-9}` and :math:`b_{0} =0.29548,b_{1} =0.00504,b_{2} =-1.4957\times 10^{-5} ,b_{3} =1.4881\times 10^{-8}` -are coefficients from polynomial fits to the placeCAM data. +are coefficients from polynomial fits to the CAM data. The additional atmospheric forcing variables required by :numref:`Table Atmospheric input to land model` are derived as follows. The atmospheric reference height :math:`z'_{atm}` @@ -146,8 +149,8 @@ where e_{atm} =\frac{P_{atm} q_{atm} }{0.622+0.378q_{atm} } -and :math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ -:math:`{}^{-4}`) (:numref:`Table Physical constants`). The fraction of +and :math:`\sigma` is the Stefan-Boltzmann constant (W m\ :sup:`-2` K\ :sup:`-4`) +(:numref:`Table Physical constants`). The fraction of precipitation :math:`P` (mm s\ :sup:`-1`) falling as rain and/or snow is From a890f67bcc1f1274cf24a83c75a741a6fd9dd999 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Tue, 6 Jun 2017 14:53:03 -0600 Subject: [PATCH 051/730] fix references in Introduction --- .../CLM50_Tech_Note_Introduction.rst | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 157b564d7e..48452d358f 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -418,10 +418,12 @@ added stability corrections to the diagnostic 2-m air temperature calculation which reduced biases in this temperature. Competition between PFTs for water, in which PFTs share a single soil column, is the default mode of operation in this model version. CLM3 was released to -the community in June 2004.:ref:`Dickinson et al. (2006)` describe the climate -statistics of CLM3 when coupled to CCSM3.0. :ref:`Hack et al. (2006)` provide -an analysis of selected features of the land hydrological cycle. -:ref:`Lawrence et al. (2007)` examine the impact of changes in CLM3 +the community in June 2004. :ref:`Dickinson et al. (2006)` +describe the climate statistics of CLM3 when coupled to CCSM3.0. +:ref:`Hack et al. (2006)` provide an analysis of selected +features of the land hydrological cycle. +:ref:`Lawrence et al. (2007)` examine the impact of +changes in CLM3 hydrological parameterizations on partitioning of evapotranspiration (ET) and its effect on the timescales of ET response to precipitation events, interseasonal soil moisture storage, soil moisture memory, and @@ -596,11 +598,12 @@ remains long. Finally, the predominantly low resolution input data for provided with CLM4 to create CLM4 surface datasets is replaced with newer and higher -resolution input datasets where possible (see section 2.2.3 for -details). The default meteorological forcing dataset provided with CLM4 -(:ref:`Qian et al. 2006)` is replaced with the 1901-2010 CRUNCEP forcing -dataset (see Chapter 26) for CLM4.5, though users can also still use the -:ref:`Qian et al. (2006)` dataset or other alternative forcing datasets. +resolution input datasets where possible (see section :numref:`Surface Data` +for details). The default meteorological forcing dataset provided with CLM4 +(:ref:`Qian et al. 2006)` is replaced with the 1901-2010 +CRUNCEP forcing dataset (see Chapter :numref:`rst_Offline Mode`) for CLM4.5, +though users can also still use the :ref:`Qian et al. (2006)` +dataset or other alternative forcing datasets. CLM4.5 was released to the community in June 2013 along with the Community Earth System Model version 1.2 (CESM1.2). From 1d543aea4af058faed4ddde07ffe5182ccf212ab Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Tue, 6 Jun 2017 16:49:44 -0600 Subject: [PATCH 052/730] Updated portions of the crop chapter, including harvest and grain fill phenology --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 35 +++++++++++-------- .../References/CLM50_Tech_Note_References.rst | 16 +++------ 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index b44a1874b6..3ff2afc0b5 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -107,17 +107,21 @@ based on the availability of corresponding algorithms in AgroIBIS and as developed by Badger and Dirmeyer (:ref:`2015 `) and described by Levis et al. (:ref:`2016 `). In addition, CLM’s default list of plant functional types (pfts) includes an -irrigated and unirrigated unmanaged C3 crop (Table 2.1)[update table reference] treated as a second C3 grass. +irrigated and unirrigated unmanaged C3 crop (Table 25.1) treated as a second C3 grass, The unmanaged C3 crop is only used when the crop model is not active and -has grid cell coverage assigned from satellite data. [info here about irrigation for unmanaged C3 crop] +has grid cell coverage assigned from satellite data, and +the unmanaged C3 irrigated crop type is currently not used +since irrigation requires the crop model to be active. The default list of pfts also includes twenty-three inactive crop pfts -that do not yet have associated parameters required for active management. So that all crop area is actively managed, -each of the inactive crop types is simulated using the parameters of the +that do not yet have associated parameters required for active management. +Each of the inactive crop types is simulated using the parameters of the spatially closest associated crop type that is most similar to the functional type (e.g., C3 or C4), -which is required to maintain similar phenological parameters. -The information detailing which parameters are used for each crop type is -included in Table XX. It should be noted that analysis with pft-level history output will -need to remap the crop types, as pft-level data will only include actively managed crop types. +which is required to maintain similar phenological parameters based on temperature thresholds. +Information detailing which parameters are used for each crop type is +included in Table 25.1. It should be noted that analysis with pft-level history output merges +all crop types into the actively managed crop type, so analysis +of crop-specific output will require use of the land surface dataset to +remap the yields of each actively and inactively managed crop type. .. _Phenology: @@ -210,7 +214,7 @@ Leaf emergence According to AgroIBIS, leaves may emerge when the growing degree-days of soil temperature to 0.05 m depth tracked since planting -(:math:`GDD_{T_{soi} }` ) reaches 3 to 5% of :math:`{GDD}_{mat}` +(:math:`GDD_{T_{soi} }` ) reaches 1 to 5% of :math:`{GDD}_{mat}` (:numref:`Table Crop plant functional types`). :math:`GDD_{T_{soi} }` is base 8, 0, and 10\ :math:`{}^\circ`\ C for corn, soybean, and temperate cereals. Leaf onset, as defined in the CN part of the model, occurs in the first @@ -223,12 +227,13 @@ a maximum value during phase 2. Grain fill ''''''''''''''''''' -Phase 3 begins in a similar way to phase 2. A variable tracked since +Phase 3 begins in one of two ways. The first potential trigger is based on temperature, similar to phase 2. A variable tracked since planting like :math:`GDD_{T_{soi} }` but for 2-m air temperature, :math:`GDD_{T_{{\rm 2m}} }`, must reach a heat unit threshold, *h*, -of 40 to 70% of :math:`{GDD}_{mat}` (:numref:`Table Crop plant functional types`). For corn the -percentage itself is an empirical function of :math:`{GDD}_{mat}` -(not shown). In phase 3, the leaf area index begins to decline in +of 40 to 65% of :math:`{GDD}_{mat}` (:numref:`Table Crop plant functional types`). +The second potential trigger for phase 3 is based on leaf area index. +When the maximum value of leaf area index is reached in phase 2, phase 3 begins. +In phase 3, the leaf area index begins to decline in response to a background litterfall rate calculated as the inverse of leaf longevity for the pft as done in the CN part of the model. @@ -240,12 +245,12 @@ Harvest Harvest is assumed to occur as soon as the crop reaches maturity. When :math:`GDD_{T_{{\rm 2m}} }` reaches 100% of :math:`{GDD}_{mat}` or the number of days past planting reaches a crop-specific maximum -(:numref:`Table Crop plant functional types`), then the crop is harvested. +(:numref:`Table Crop plant functional types`)[update table reference], then the crop is harvested. Harvest occurs in one time step using CN’s leaf offset algorithm. New variables track the flow of grain C and N to food and of live stem C and N to litter. Currently, food C and N are routed directly to litter using the labile, cellulose, and lignin -fractions for leaves. The same fractions for leaves are used for the +fractions for leaves. [update to product pool] The same fractions for leaves are used for the flow of live stem C and N to litter for corn, soybean, and temperate cereals. This is in contrast to the approach for unmanaged PFTs which puts live stem C and N to dead stems first, rather than to litter. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index b6df8ed437..7c89fc063b 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -900,12 +900,6 @@ Law, B.E., Sun, O.J., Campbell, J., Van Tuyl, S. and Thornton, P.E. 2003. Changes in carbon storage and fluxes in a chronosequence of ponderosa pine. Global Change Biology, 9: 510-514. -.. _Lawrenceetal2016: - -Lawrence, D.M., et al. 2016. The Land Use Model Intercomparison Project -(LUMIP) contribution to CMIP6: rationale and experimental design. Geo. Sci. -Dev. 9:2973-2998. - .. _Lawrenceetal2007: Lawrence, D.M., Thornton, P.E., Oleson, K.W., and Bonan, G.B. 2007. The @@ -935,12 +929,12 @@ Model. Earth Sys. 3. DOI:10.1029/2011MS000045. .. _Lawrenceetal2016: -Lawrence, D. M., Hurtt, G. C., Arneth, A., Brovkin, V., Calvin, K. V., -Jones, A. D., Jones, C. D., Lawrence, P. J., de Noblet-Ducoudré, N., Pongratz, -J., Seneviratne, S. I., and Shevliakova, E, 2016. The Land Use Model +Lawrence, D.M., Hurtt, G.C., Arneth, A., Brovkin, V., Calvin, K.V., +Jones, A.D., Jones, C.D., Lawrence, P.J., de Noblet-Ducoudré, N., Pongratz, +J., Seneviratne, S.I., and Shevliakova, E. 2016. The Land Use Model Intercomparison Project (LUMIP) contribution to CMIP6: rationale -and experimental design, Geosci. Model Dev., 9, 2973-2998, -doi:10.5194/gmd-9-2973-2016. +and experimental design. Geosci. Model Dev. 9:2973-2998. +DOI:10.5194/gmd-9-2973-2016. .. _LawrenceChase2007: From 3e3655cc0e47e2deb7c3630284c5796a60d0a128 Mon Sep 17 00:00:00 2001 From: Justin Perket Date: Wed, 7 Jun 2017 13:09:33 -0600 Subject: [PATCH 053/730] fixed couple typos in 7.1 --- .../tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index db82c6ac68..bce8c53b23 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -56,12 +56,12 @@ Interception by vegetation is divided between liquid and solid phases .. math:: :label: 7.2 - q_{intr,\,liq} =\alpha_{liq} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + q_{intr,\,liq} =\alpha_{liq} q_{rain} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} .. math:: :label: 7.3 - q_{intr,\,ice} =\alpha_{sno} \left(q_{rain} +q_{sno} \right)\left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + q_{intr,\,ice} =\alpha_{sno} q_{sno} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} where :math:`L` and :math:`S` are the exposed leaf and stem area index, @@ -100,14 +100,14 @@ where .. math:: :label: 7.8 - W_{can,liq}^{intr} =W_{can,liq}^{n} +q_{intr} \Delta t\ge 0 + W_{can,liq}^{intr} =W_{can,liq}^{n} +q_{intr,\, liq} \Delta t\ge 0 and .. math:: :label: 7.9 - W_{can,sno}^{intr} =W_{can,sno}^{n} +q_{intr} \Delta t\ge 0 + W_{can,sno}^{intr} =W_{can,sno}^{n} +q_{intr,\, ice} \Delta t\ge 0 are the the canopy liquid water and snow water equivalent after accounting for interception, From 5c6e5b0861a7a976e25b2299bf42d55ee0173623 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 8 Jun 2017 08:21:51 -0600 Subject: [PATCH 054/730] Hydrology update --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 71 +++++++++++++------ .../References/CLM50_Tech_Note_References.rst | 6 ++ 2 files changed, 55 insertions(+), 22 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index db82c6ac68..ad50ea0f5e 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -473,8 +473,6 @@ Soil water is predicted from a multi-layer model, in which the vertical soil moisture transport is governed by infiltration, surface and sub-surface runoff, gradient diffusion, gravity, and canopy transpiration through root extraction (:numref:`Figure Hydrologic processes`). -The following derivation generally follows that of :ref:`Z.-L. Yang (1998, -unpublished manuscript) `. For one-dimensional vertical water flow in soils, the conservation of mass is stated as @@ -482,14 +480,14 @@ mass is stated as .. math:: :label: 7.79 - \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} -Q + \frac{\partial \theta }{\partial t} =-\frac{\partial q}{\partial z} - e where :math:`\theta` is the volumetric soil water content (mm\ :sup:`3` of water / mm\ :sup:`-3` of soil), :math:`t` is time (s), :math:`z` is height above some datum in the soil column (mm) (positive upwards), :math:`q` is soil water flux (kg m\ :sup:`-2` s\ :sup:`-1` or mm s\ :sup:`-1`) (positive upwards), and -:math:`Q` is a soil moisture sink term (mm of water mm\ :sup:`-1` +:math:`e` is a soil moisture sink term (mm of water mm\ :sup:`-1` of soil s\ :sup:`-1`) (ET loss). This equation is solved numerically by dividing the soil column into multiple layers in the vertical and integrating downward over each layer with an upper boundary @@ -533,15 +531,22 @@ Equation :eq:`7.82` can be further manipulated to yield .. math:: :label: 7.83 - q=-k\left[\frac{\partial \left(\psi +z\right)}{\partial z} \right]=-k\left(\frac{\partial \psi }{\partial z} +1\right)=-k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right). + q = -k \left[\frac{\partial \left(\psi +z\right)}{\partial z} \right] + = -k \left(\frac{\partial \psi }{\partial z} + 1 \right) \ . -Substitution of this equation into equation :eq:`7.79`, with :math:`Q=0`, yields -the Richards equation +Substitution of this equation into equation :eq:`7.79`, with :math:`e = 0`, yields +the Richards equation :ref:`(Dingman 2002) ` .. math:: :label: 7.84 - \frac{\partial \theta }{\partial t} =\frac{\partial }{\partial z} \left[k\left(\frac{\partial \theta }{\partial z} \frac{\partial \psi }{\partial \theta } +1\right)\right]. + \frac{\partial \theta }{\partial t} = + \frac{\partial }{\partial z} \left[k\left(\frac{\partial \psi }{\partial z} + 1 + \right)\right]. + +In practice (Section :numref:`Numerical Solution Hydrology`), changes in soil +water content are predicted from :eq:`7.79` using finite-difference approximations +for :eq:`7.83`. .. _Hydraulic Properties: @@ -714,7 +719,7 @@ conservation of mass (equation :eq:`7.79`) can be integrated over each layer as .. math:: :label: 7.101 - \int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial \theta }{\partial t} \, dz=-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial q}{\partial z} \, dz-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }Q\, dz . + \int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial \theta }{\partial t} \, dz=-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} }\frac{\partial q}{\partial z} \, dz-\int _{-z_{h,\, i} }^{-z_{h,\, i-1} } e\, dz . Note that the integration limits are negative since :math:`z` is defined as positive upward from the soil surface. This equation can be written @@ -1035,25 +1040,47 @@ and the coefficients of the tridiagonal set of equations for Adaptive Time Stepping ''''''''''''''''''''''''''''' -The tridiagonal equation set is solved using an adaptive time-stepping procedure. -An initial solution is found by setting :math:`\Delta t` equal to the model time -step. An estimate of the error is calculated from + +To improve the accuracy and stability of the numerical solutions, the +length of the time step is adjusted. The difference between two numerical +approximations is used to estimate the temporal truncation error, and then +the step size is adjusted to meet a user-prescribed error tolerance +:ref:`[Kavetski et al., 2002]`. The temporal truncation +error is estimated by comparing the flux obtained from the first-order +Taylor series expansion (:math:`q_{i-1}^{n+1}` and :math:`q_{i}^{n+1}`, +equations :eq:`7.108` and :eq:`7.109`) against the flux at the start of the +time step (:math:`q_{i-1}^{n}` and :math:`q_{i}^{n}`). Since the tridiagonal +solution already provides an estimate of :math:`\Delta \theta_{liq,i}`, it is +convenient to compute the error for each of the :math:`i` layers from equation +:eq:`7.103` as .. math:: :label: 7.152 - \epsilon = max \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - - \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] + \epsilon_{i} = \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - + \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] \ \frac{\Delta t_{sub}}{2} + +and the maximum absolute error across all layers as + +.. math:: + :label: 7.153 + + \begin{array}{lr} + \epsilon_{crit} = {\rm max} \left( \left| \epsilon_{i} \right| \right) & \qquad 1 \le i \le nlevsoi + \end{array} \ . -If :math:`\epsilon` is greater than a specified error tolerance, the solution is -rejected, :math:`\Delta t` is halved and a new solution is determined. If the solution -is accepted, the procedure repeats until the adaptive sub-stepping spans the full -model time step. During the solution, the sub-steps may be halved until a -specified minimum time step length is reached, and the sub-steps may be doubled -when :math:`\epsilon` is less than a specified error tolerance. +The adaptive step size selection is based on specified upper and lower error +tolerances, :math:`\tau_{U}` and :math:`\tau_{L}`. The solution is accepted if +:math:`\epsilon_{crit} \le \tau_{U}` and the procedure repeats until the adaptive +sub-stepping spans the full model time step (the sub-steps are doubled if +:math:`\epsilon_{crit} \le \tau_{L}`, i.e., if the solution is very accurate). +Conversely, the solution is rejected if :math:`\epsilon_{crit} > \tau_{U}`. In +this case the length of the sub-steps is halved and a new solution is obtained. +The halving of substeps continues until either :math:`\epsilon_{crit} \le \tau_{U}` +or the specified minimum time step length is reached. -Upon solution of the tridiagonal equation set, the -liquid water contents are updated as follows +Upon solution of the tridiagonal equation set, the liquid water contents are updated +as follows .. math:: :label: 7.164 diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index b6df8ed437..a1dbf281ea 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -792,6 +792,12 @@ photosynthetic capacity and its relationship to leaf nitrogen content for global–scale terrestrial biosphere models. Global Change Biol. 15:976–991. +.. _Kavetskietal2002: + +Kavetski, D., Binning, P. and Sloan, S.W., 2002. Noniterative time +stepping schemes with adaptive truncation error control for the +solution of Richards equation. Water Resources Research, 38(10). + .. _Kelleretal2004: Keller, M., Palace, M., Asner, G.P., Pereira, R., Jr. and Silva, J.N.M., From 645daaed9e0f0ccfa5eb86f8d53b7e398423c45a Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 8 Jun 2017 08:50:33 -0600 Subject: [PATCH 055/730] Hydrology typo fix --- .../tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 8afb068892..404943dd97 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -546,7 +546,7 @@ the Richards equation :ref:`(Dingman 2002) ` In practice (Section :numref:`Numerical Solution Hydrology`), changes in soil water content are predicted from :eq:`7.79` using finite-difference approximations -for :eq:`7.83`. +for :eq:`7.84`. .. _Hydraulic Properties: @@ -1041,10 +1041,10 @@ and the coefficients of the tridiagonal set of equations for Adaptive Time Stepping ''''''''''''''''''''''''''''' -To improve the accuracy and stability of the numerical solutions, the -length of the time step is adjusted. The difference between two numerical +The length of the time step is adjusted in order to improve the accuracy +and stability of the numerical solutions. The difference between two numerical approximations is used to estimate the temporal truncation error, and then -the step size is adjusted to meet a user-prescribed error tolerance +the step size :math:`\Delta t_{sub}` is adjusted to meet a user-prescribed error tolerance :ref:`[Kavetski et al., 2002]`. The temporal truncation error is estimated by comparing the flux obtained from the first-order Taylor series expansion (:math:`q_{i-1}^{n+1}` and :math:`q_{i}^{n+1}`, @@ -1057,7 +1057,7 @@ convenient to compute the error for each of the :math:`i` layers from equation .. math:: :label: 7.152 - \epsilon_{i} = \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t} - + \epsilon_{i} = \left[ \frac{\Delta \theta_{liq,\, i} \Delta z_{i}}{\Delta t_{sub}} - \left( q_{i-1}^{n} - q_{i}^{n} + e_{i}\right) \right] \ \frac{\Delta t_{sub}}{2} and the maximum absolute error across all layers as From e23f4731c1e175614d99f776ca7f16537bd396fa Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 8 Jun 2017 10:47:39 -0600 Subject: [PATCH 056/730] Fire Chapter Update from F.Li --- .../tech_note/Fire/CLM50_Tech_Note_Fire.rst | 613 ++++++++++-------- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 2 +- .../References/CLM50_Tech_Note_References.rst | 6 + 3 files changed, 332 insertions(+), 289 deletions(-) diff --git a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst index d6b6495827..caef87c2b3 100644 --- a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst +++ b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst @@ -4,162 +4,166 @@ Fire ======== The fire parameterization in CLM contains four components: non-peat -fires outside cropland and tropical closed forests, agricultural fires, -deforestation fires in the tropical closed forests, and peat fires (Li -et al. 2012a, b, 2013). In this fire parameterization, burned area is -affected by climate and weather conditions, vegetation composition and -structure, and human activities. After burned area is calculated, we -estimate the fire impact, including biomass and peat burning, -fire-induced vegetation mortality, and the adjustment of the carbon and -nitrogen (C/N) pools. Justification for all equations and parameter -values is given by Li et al. (2012a, b; 2013) in detail. +fires outside cropland and tropical closed forests, agricultural fires +in cropland, deforestation fires in the tropical closed forests, and +peat fires (see :ref:`Li et al. 2012a `, +:ref:`Li et al. 2012b `, :ref:`Li et al. 2013 `, +:ref:`Li and Lawrence 2017 ` for details). +In this fire parameterization, burned area is affected by climate and +weather conditions, vegetation composition and structure, and human +activities. After burned area is calculated, we estimate the fire impact, +including biomass and peat burning, fire-induced vegetation mortality, +adjustment of the carbon and nitrogen (C/N) pools, and fire emissions. + +.. _Non-peat fires outside cropland and tropical closed forest: Non-peat fires outside cropland and tropical closed forest --------------------------------------------------------------- -Burned area in a grid cell per time step,\ :math:`A_{b}` -(km :sup:`2` (time step) :sup:`-1`), is determined by +Burned area in a grid cell, \ :math:`A_{b}` (km\ :sup:`2` s :sup:`-1`), +is determined by .. math:: - :label: 23.1) + :label: 23.1 A_{b} =N_{f} a -where :math:`N_{f}` (count (time step)\ :sup:`-1`) is fire -counts in the grid cell; :math:`a` (km:sup:`2`) is average fire +where :math:`N_{f}` (count s\ :sup:`-1`) is fire +counts in the grid cell; :math:`a` (km\ :sup:`2`) is average fire spread area of a fire. +.. _Fire counts: + Fire counts ^^^^^^^^^^^^^^^^^^ Fire counts :math:`N_{f}` is taken as .. math:: - :label: 23.2) + :label: 23.2 - N_{f} =N_{i} f_{b} f_{m} f_{se,o} + N_{f} = N_{i} f_{b} f_{m} f_{se,o} -where :math:`N_{i}` \ ( count (time step)\ :sup:`-1`) is the +where :math:`N_{i}` ( count s\ :sup:`-1`) is the number of ignition sources due to natural causes and human activities; :math:`f_{b}` and :math:`f_{m}` (fractions) represent the availability and combustibility of fuel, respectively; :math:`f_{se,o}` is the fraction of anthropogenic and natural fires unsuppressed by humans and related to the socioeconomic conditions. -:math:`N_{i}` (count (time step)\ :sup:`-1`) is given as +:math:`N_{i}` (count s\ :sup:`-1`) is given as .. math:: - :label: 23.3) + :label: 23.3 - N_{i} =(I_{n} +I_{a} )A_{g} + N_{i} = \left(I_{n} +I_{a} \right) A_{g} -where :math:`I_{n}` \ (count km\ :sup:`-2` (time step)\ :sub:`-1`) and :math:`I_{a}` \ (count km\ :sup:`-2` (time step)\ :sup:`-1`) are the number of natural and -anthropogenic ignitions per km\ :sup:`2`, respectively; -*A*\ :sub:`g` is the area of the grid cell (km\ :sup:`2`). -:math:`I_{n}` is estimated by +where :math:`I_{n}` (count km\ :sup:`-2` s\ :sup:`-1`) and :math:`I_{a}` +(count km\ :sup:`-2` s\ :sup:`-1`) are the number of natural and anthropogenic +ignitions per km\ :sup:`2`, respectively; :math:`A_{g}` is the area of the +grid cell (km\ :sup:`2`). :math:`I_{n}` is estimated by .. math:: - :label: 23.4) + :label: 23.4 - I_{n} =\gamma \psi I_{l} + I_{n} = \gamma \psi I_{l} -where :math:`\gamma` \ =0.25 is ignition efficiency of cloud-to-ground -lightning; :math:`\psi =\frac{1}{5.16+2.16\cos (3\lambda )}` is the -cloud-to-ground lightning fraction and depends on the latitude -:math:`\lambda` ; :math:`I_{l}` (flash km\ :sup:`-2` (time step)\ :sup:`-1`) is the total lightning flashes. :math:`I_{a}` , -is modeled as a monotonic increasing function of population density:\ +where :math:`\gamma` \ =0.22 is ignition efficiency of cloud-to-ground +lightning; :math:`\psi =\frac{1}{5.16+2.16\cos [3min(60,\lambda )]}` is the +cloud-to-ground lightning fraction and depends on the latitude +:math:`\lambda` (degrees) ; :math:`I_{l}` (flash km\ :sup:`-2` s\ :sup:`-1`) is +the total lightning flashes. :math:`I_{a}` is modeled as a monotonic +increasing function of population density: .. math:: - :label: 23.5) + :label: 23.5 I_{a} =\frac{\alpha D_{P} k(D_{P} )}{n} -where :math:`\alpha =0.0035` (count person\ :sup:`-1` mon\ :sup:`-1`) is the number of potential ignition sources by a -person per month; :math:`D_{P}` (person km\ :sup:`-2`) is the population density; -:math:`k(D_{P} )=6.8D_{P} ^{-0.6}` represents anthropogenic ignition -potential as a function of human population density\ :math:`D_{P}` ; *n* -is the number of time steps in a month. +where :math:`\alpha =0.01` (count person\ :sup:`-1` mon\ :sup:`-1`) is the number of potential ignition sources by a +person per month; :math:`D_{P}` (person km\ :sup:`-2`) is the population density; :math:`k(D_{P} )=6.8D_{P} ^{-0.6}` represents anthropogenic ignition +potential as a function of human population density :math:`D_{P}` ; *n* +is the seconds in a month. -Fuel availability\ :math:`f_{b}` is given as +Fuel availability :math:`f_{b}` is given as .. math:: - :label: ZEqnNum730456 + :label: 23.6 - f_{b} =\left\{\begin{array}{c} {0} \\ {\frac{B_{ag} -B_{low} }{B_{up} -B_{low} } } \\ {1} \end{array}\right. ,\begin{array}{cc} {} & {} \end{array}\begin{array}{c} {B_{ag} B_{up} } \end{array} + f_{b} =\left\{\begin{array}{c} + {0} \\ {\frac{B_{ag} -B_{low} }{B_{up} -B_{low} } } \\ {1} \end{array} + \begin{array}{cc} {} & {} \end{array}\begin{array}{c} {B_{ag} B_{up} } + \end{array}\right\} \ , -where :math:`B_{ag}` (g C m\ :sup:`-2`) is the aboveground -biomass of combined leaf, stem and aboveground litter (leaf litter and -woody debris) pools; :math:`B_{low}` \ =155 g C m\ :sup:`-2` is -the lower fuel threshold below which fire does not occur; -:math:`B_{up}` \ = 1050 g C m\ :sup:`-2` is the upper fuel -threshold above which fire occurrence is not limited by fuel -availability. +where :math:`B_{ag}` (g C m\ :sup:`-2`) is the biomass of combined leaf, +stem, litter, and woody debris pools; :math:`B_{low}` = 105 g C m :sup:`-2` +is the lower fuel threshold below which fire does not occur; :math:`B_{up}` += 1050 g C m\ :sup:`-2` is the upper fuel threshold above which fire +occurrence is not limited by fuel availability. Fuel combustibility :math:`f_{m}` is estimated by .. math:: - :label: 23.7) - - f_{m} =f_{RH} f_{\theta } f_{T} + :label: 23.7 -where :math:`f_{RH}`, :math:`f_{\theta }`, :math:`f_{T}` -represent the dependence of fuel combustibility on relative humidity -*RH* (%), surface soil wetness :math:`\theta` , and surface air -temperature *T* (ºC), respectively. :math:`f_{RH}` is calculated by + f_{m} = {f_{RH} f_{\beta}}, &\qquad T_{17cm} > T_{f} + +where :math:`f_{RH}` and :math:`f_{\beta }` represent the dependence of +fuel combustibility on relative humidity :math:`RH` (%) and root-zone +soil moisture limitation :math:`\beta` (fraction); :math:`T_{17cm}` is +the temperature of the top 17 cm of soil (K) and :math:`T_{f}` is the +freezing temperature. :math:`f_{RH}` is a weighted average of real time +:math:`RH` (:math:`RH_{0}`) and 30-day running mean :math:`RH` +(:math:`RH_{30d}`): .. math:: - :label: 23.8) - - f_{RH} =\left\{\begin{array}{cccc} {1} & {} & {} & {RH\le RH_{low} } \\ {\frac{RH_{up} -RH}{RH_{up} -RH_{low} } ,} & {} & {} & {RH_{low} 0.1` person km\ :sup:`-2`, we parameterize the fraction of anthropogenic and natural fires unsuppressed by human activities as .. math:: - :label: 23.10) + :label: 23.10 f_{se,o} =f_{d} f_{e} -where :math:`{f}_{d}` and :math:`{f}_{e}` are -the effects of the demographic and economic conditions on fire -occurrence. The demographic influence on fire occurrence is +where :math:`{f}_{d}` and :math:`{f}_{e}` are the effects of the +demographic and economic conditions on fire occurrence. The demographic +influence on fire occurrence is .. math:: - :label: 23.11) + :label: 23.11 - f_{d} =0.01+0.98\exp (-0.025D_{P} ). + f_{d} =0.01 + 0.98 \exp (-0.025D_{P} ). For shrub and grass PFTs, the economic influence on fire occurrence is parameterized as a function of Gross Domestic Product GDP (k 1995US$ capita\ :sup:`-1`): .. math:: - :label: 23.12) + :label: 23.12 f_{e} =0.1+0.9\times \exp [-\pi (\frac{GDP}{8} )^{0.5} ] @@ -167,19 +171,20 @@ which captures 73% of the observed MODIS fire counts with variable GDP in regions where shrub and grass PFTs are dominant (fractional coverage of shrub and grass PFTs :math:`>` 50%). In regions outside tropical closed forests and dominated by trees (fractional coverage of tree PFTs -:math:`>` 50%), we divide the MODIS fire counts into only two bins -(:math:`GDP\ge 20` k 1995US$ capita\ :sup:`-1`, and :math:`GDP<20` -k 1995US$ capita\ :sup:`-1`) and parameterize the economic -influence on fire occurrence for tree PFTs as +:math:`>` 50%), we use .. math:: - :label: 23.13) + :label: 23.13 + + f_{e} =\left\{\begin{array}{c} + {0.39} \\ {0.79} \\ {1} \end{array} + \begin{array}{cc} {} & {} \end{array}\begin{array}{c} {GDP > 20 } \\ + { 8 < GDP \le 20 } \\ { GDP \le 8 } + \end{array}\right\} \ , - f_{e} =\left\{\begin{array}{cc} {0.39,} & {GDP\ge 20} \\ {1} & {GDP<20} \end{array}\right. +to reproduce the relationship between MODIS fire counts and GDP. -to reproduce that the MODIS fire counts in tree-dominated regions of -GDP (:math:`\ge 20` k 1995US$ capita\ :sup:`-1` is 39% of that in -other tree-dominated regions. +.. _Average spread area of a fire: Average spread area of a fire ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -190,7 +195,7 @@ socioeconomic impact on the average burned area rather than separately on fire spread rate and fire duration: .. math:: - :label: 23.14) + :label: 23.14 a=a^{*} F_{se} @@ -205,19 +210,19 @@ formula for an ellipse, average burned area of a fire can be represented as: .. math:: - :label: 23.15) + :label: 23.15 a^{*} =\pi \frac{l}{2} \frac{w}{2} \times 10^{-6} =\frac{\pi u_{p}^{2} \tau ^{2} }{4L_{B} } (1+\frac{1}{H_{B} } )^{2} \times 10^{-6} -where :math:`u_{p}` \ (m s\ :sup:`-1`) is the fire spread rate in -the downwind direction; :math:`\tau` \ (s) is average fire -duration;\ :math:`L_{B}` and :math:`H_{B}` are length-to-breadth ratio -and head-to-back ratio of the ellipse; 10\ :sup:`-6` converts m\ :sup:`2` to km\ :sup:`2`. +where :math:`u_{p}` (m s\ :sup:`-1`) is the fire spread rate in the +downwind direction; :math:`\tau` (s) is average fire duration; :math:`L_{B}` +and :math:`H_{B}` are length-to-breadth ratio and head-to-back ratio of +the ellipse; 10 :sup:`-6` converts m :sup:`2` to km :sup:`2`. -According to Arora and Boer (2005), +According to :ref:`Arora and Boer (2005)`, .. math:: - :label: ZEqnNum696342 + :label: 23.16 L_{B} =1.0+10.0[1-\exp (-0.06W)] @@ -226,61 +231,55 @@ the mathematical properties of the ellipse, the head-to-back ratio :math:`H_{B}` is .. math:: - :label: ZEqnNum179757 + :label: 23.17 H_{B} =\frac{u_{p} }{u_{b} } =\frac{L_{B} +(L_{B} ^{2} -1)^{0.5} }{L_{B} -(L_{B} ^{2} -1)^{0.5} } . The fire spread rate in the downwind direction is represented as .. math:: - :label: 23.18) + :label: 23.18 u_{p} =u_{\max } C_{m} g(W) -(Arora and Boer, 2005), where :math:`u_{\max }`\ (m s\ :sup:`-1`) is the PFT-dependent average maximum fire spread -rate in natural vegetation regions; :math:`C_{m}` and :math:`g(W)` +(:ref:`Arora and Boer, 2005`), where :math:`u_{\max }` +(m s\ :sup:`-1`) is the PFT-dependent average maximum fire spread +rate in natural vegetation regions; :math:`C_{m} =\sqrt{f_{m}}` and :math:`g(W)` represent the dependence of :math:`u_{p}` on fuel wetness and wind -speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.55 m -s\ :sup:`-1`\ for grass PFTs, 0.46 m s\ :sup:`-1` for -shrub PFTs, 0.43 m s\ :sup:`-1` for needleleaf tree PFTs, and 0.40 m s\ :sup:`-1` for other tree PFTs. -:math:`C_{m} =C_{\beta } C_{RH}` is estimated by the dependence of -:math:`u_{p}` \ on root zone soil wetness (:math:`C_{\beta }` ) and -relative humidity (:math:`C_{RH}` ). Here,\ :math:`\beta` is a root -zone soil moisture limitation function. Due to a lack of observations to -calibrate :math:`C_{\beta }` , we adopt a simple linear function, where -:math:`\beta _{low}` \ =0.3 and :math:`\beta _{up}` \ =0.7 are the lower -and upper thresholds of root zone soil wetness, respectively. -**:math:`C_{RH}` ** is set equal to :math:`f_{RH}` . :math:`g(W)` is -derived from the mathematical properties of the ellipse and Eqs and - -.. math:: - :label: 23.19) +speed :math:`W`, respectively. :math:`u_{\max }` is set to 0.33 +m s :sup:`-1`\ for grass PFTs, 0.28 m s :sup:`-1` for shrub PFTs, 0.26 +m s\ :sup:`-1` for needleleaf tree PFTs, and 0.25 m s\ :sup:`-1` for +other tree PFTs. :math:`g(W)` is derived from the mathematical properties +of the ellipse and equation :eq:`23.16` and :eq:`23.17`. + +.. math:: + :label: 23.19 g(W)=\frac{2L_{B} }{1+\frac{1}{H_{B} } } g(0). -Since g(\ *W*)=1.0, and\ :math:`L_{B}` and :math:`H_{B}` are at their -maxima\ :math:`L_{B} ^{\max } =11.0`\ and :math:`H_{B} ^{\max } =482.0` +Since g(\ *W*)=1.0, and \ :math:`L_{B}` and :math:`H_{B}` are at their +maxima \ :math:`L_{B} ^{\max } =11.0` and \ :math:`H_{B} ^{\max } =482.0` when :math:`W\to \infty` , g(0) can be derived as .. math:: - :label: 23.20) + :label: 23.20 g(0)=\frac{1+\frac{1}{H_{B} ^{\max } } }{2L_{B} ^{\max } } =0.05. In the absence of globally gridded data on barriers to fire (e.g. rivers, lakes, roads, firebreaks) and human fire-fighting efforts, average fire duration is simply assumed equal to 1 which is the observed -2001–2004 mean persistence of most fires in the world (Giglio et al. -2006). +2001–2004 mean persistence of most fires in the world +(:ref:`Giglio et al. 2006 `). As with the socioeconomic influence on fire occurrence, we assume that the socioeconomic influence on fire spreading is negligible in regions -of\ :math:`D_{p} \le 0.1` person km\ :sup:`-2`, i.e., -:math:`F_{se} =1.0`. In regions of :math:`D_{p} >0.1` person +of :math:`D_{p} \le 0.1` person km\ :sup:`-2`, i.e., +:math:`F_{se} = 1.0`. In regions of :math:`D_{p} >0.1` person km\ :sup:`-2`, we parameterize such socioeconomic influence as: .. math:: - :label: 23.21) + :label: 23.21 F_{se} =F_{d} F_{e} @@ -292,14 +291,14 @@ indices in grid cells with various dominant vegetation types. For shrub and grass PFTs, the demographic impact factor is .. math:: - :label: ZEqnNum900584 + :label: 23.22 F_{d} =0.2+0.8\times \exp [-\pi (\frac{D_{p} }{450} )^{0.5} ] and the economic impact factor is .. math:: - :label: ZEqnNum213480 + :label: 23.23 F_{e} =0.2+0.8\times \exp (-\pi \frac{GDP}{7} ). @@ -307,144 +306,154 @@ For tree PFTs outside tropical closed forests, the demographic and economic impact factors are given as .. math:: - :label: 23.24) + :label: 23.24 F_{d} =0.4+0.6\times \exp (-\pi \frac{D_{p} }{125} ) and .. math:: - :label: ZEqnNum543524 + :label: 23.25 + + F_{e} =\left\{\begin{array}{cc} + {0.62,} & {GDP>20} \\ {0.83,} & {820} \\ {0.83,} & {8` that shows the +2001-2009 average contribution of cropland fires is 4.7% of the total +global burned area. -We assume the same fuel-load requirement for all fires, so -:math:`f_{b}` is set by Eq. . The socioeconomic factor :math:`f_{se}` -is given as follows: +The socioeconomic factor :math:`f_{se}` is given as follows: .. math:: - :label: 23.31) + :label: 23.31 f_{se} =f_{d} f_{e} . Here .. math:: - :label: 23.32) + :label: 23.32 f_{d} =0.04+0.96\times \exp [-\pi (\frac{D_{p} }{350} )^{0.5} ] and .. math:: - :label: 23.33) + :label: 23.33 f_{e} =0.01+0.99\times \exp (-\pi \frac{GDP}{10} ) are the effects of population density and GDP on burned area, derived -in a similar way to Eqs. and . :math:`f_{t}` is set to 1 during the -climatological peak month for agricultural fires (van der Werf et al. -2010) in time steps with no precipitation and -*T*\ :math:`>`\ :math:`{T}_{f}` if no agricultural fires occurred -earlier in the year; :math:`{f}_{t}` is set to 0 otherwise. Peak +in a similar way to equation :eq:`23.32` and :eq:`23.33`. :math:`f_{t}` +is set to 1 at the first time step during the climatological peak month +for agricultural fires (:ref:`van der Werf et al. 2010 `); +:math:`{f}_{t}` is set to 0 otherwise. Peak month in this dataset correlates with the month after harvesting or the month before planting. In CLM we use this dataset the same way whether the CROP option is active or not, without regard to the CROP option’s simulated planting and harvesting dates. -In the post-fire region, fire impact is parameterized similar to section -18.1.3 but with combustion completeness factors and tissue mortality -factors for crop PFTs (:numref:`Table PFT-specific combustion completeness and fire mortality`). +In the post-fire region, fire impact is parameterized similar to section +:numref:`Fire impact` but with combustion completeness factors and tissue +mortality factors for crop PFTs +(:numref:`Table PFT-specific combustion completeness and fire mortality factors`). +.. _Deforestation fires: + Deforestation fires ------------------------ CLM focuses on deforestation fires in tropical closed forests. Tropical -closed forests are defined as grid cells with tropical tree coverage -:math:`>`\ 60% according to the FAO classification. Deforestation fires +closed forests are defined as grid cells with tropical tree (BET and BDT tropical) +coverage :math:`>` 60% according to the FAO classification. Deforestation fires are defined as fires caused by deforestation, including escaped deforestation fires, termed degradation fires. Deforestation and degradation fires are assumed to occur outside of cropland areas in @@ -452,71 +461,74 @@ these grid cells. Burned area is controlled by the deforestation rate and climate: .. math:: - :label: 23.34) + :label: 23.34 - A_{b} =bf_{lu} f_{cli,d} A_{g} + A_{b} = b \ f_{lu} f_{cli,d} f_{b} A_{g} -where *b* (time step)\ :sup:`-1` is a global constant; +where :math:`b` (s\ :sup:`-1`) is a global constant; :math:`f_{lu}` (fraction) represents the effect of decreasing -fractional coverage of tree PFTs derived from land use data; and +fractional coverage of tree PFTs derived from land use data; :math:`f_{cli,d}` (fraction) represents the effect of climate conditions on the burned area. -Constants *b* and :math:`{f}_{lu}` are calibrated +Constants :math:`b` and :math:`{f}_{lu}` are calibrated based on observations and reanalysis datasets in the Amazon rainforest -(tropical closed forests within 15.5ºS\ :math:`\text{-}`\ 10.5ºN, -30.5ºW\ :math:`\text{-}`\ 91ºW). *b=*\ 0.035 d\ :sup:`-1` and -:math:`f_{lu}` is defined as +(tropical closed forests within 15.5 :sup:`o` S :math:`\text{-}` 10.5 +:sup:`o` N, 30.5 :sup:`o` W :math:`\text{-}` 91 :sup:`o` W). +:math:`b` = 0.033 d\ :sup:`-1` and :math:`f_{lu}` is defined as .. math:: - :label: 23.35) + :label: 23.35 - f_{lu} =\max (0.0005,0.19D-0.0011) + f_{lu} = \max (0.0005,0.19D-0.001) -where :math:`D`\ (yr:sup:`-1`) is the annual loss of tree cover -based on CLM4’s land use and land cover change data. +where :math:`D` (yr\ :sup:`-1`) is the annual loss of tree cover +based on CLM land use and land cover change data. The effect of climate on deforestation fires is parameterized as: .. math:: - :label: ZEqnNum336915 - - \begin{array}{l} {f_{cli,d} =\max [0,\min (1,\frac{b_{2} -P_{60d} }{b_{2} } )]^{0.5} \max [0,\min (1,\frac{b_{3} -P_{10d} }{b_{3} } )]^{0.5} } \\ {\qquad \max [0,\min (1,\frac{0.25-P}{0.25} )]} \end{array} - -where\ :math:`P`\ (mm d\ :sup:`-1`) is instantaneous -precipitation, while :math:`P_{60d}` (mm d\ :sup:`-1`) and -:math:`P_{10d}` (mm d\ :sup:`-1`) are 60-day and 10-day running -means of precipitation, respectively; :math:`b_{2}` (mm -d\ :sup:`-1`) and :math:`b_{3}` (mm d\ :sup:`-1`) are the -grid-cell dependent thresholds of :math:`P_{60d}` and :math:`P_{10d}` ; -0.25 mm d\ :sup:`-1` is the maximum precipitation rate for -drizzle. Le Page et al. (2010) analyzed the relationship between -large-scale deforestation fire counts and precipitation during -2003\ :math:`\text{-}`\ 2006 in southern Amazonia where tropical -evergreen trees (BET Tropical) are dominant. Figure 2 in Le Page et al. -(2010) showed that fires generally occurred if both :math:`P_{60d}` and -:math:`P_{10d}` were less than about 4.0 mm d\ :sup:`-1`, and -fires occurred more frequently in a drier environment. Based on the -30-yr (1985:math:`\text{-}`\ 2004) precipitation data in Qian et al. -(2006), the climatological precipitation of dry months (P:math:`<`\ 4.0 -mm d\ :sup:`-1`) in a year over tropical deciduous tree (BDT -Tropical) dominated regions is 46% of that over BET Tropical dominated -regions, so we set the PFT-dependent thresholds of :math:`P_{60d}` and -:math:`P_{10d}` as 4.0 mm d\ :sup:`-1` for BET Tropical and 1.8 -mm d\ :sup:`-1` (= 4.0 mm d\ :sup:`-1` :math:`\times` 46%) -for BDT Tropical, and *b*\ :sub:`2` and *b*\ :sub:`3` are -the average of thresholds of BET Tropical and BDT Tropical weighted by -their coverage. + :label: 23.36 + + \begin{array}{ll} + f_{cli,d} \quad = & \quad \max \left[0,\min (1,\frac{b_{2} -P_{60d} }{b_{2} } )\right]^{0.5} \times \\ + & \quad \max \left[0,\min (1,\frac{b_{3} -P_{10d} }{b_{3} } )\right]^{0.5} \times \\ + & \quad \max \left[0,\min (1,\frac{0.25-P}{0.25} )\right] + \end{array} + +where :math:`P` (mm d :sup:`-1`) is instantaneous precipitation, while +:math:`P_{60d}` (mm d\ :sup:`-1`) and :math:`P_{10d}` (mm d :sup:`-1`) +are 60-day and 10-day running means of precipitation, respectively; +:math:`b_{2}` (mm d :sup:`-1`) and :math:`b_{3}` (mm d :sup:`-1`) are +the grid-cell dependent thresholds of :math:`P_{60d}` and :math:`P_{10d}` ; +0.25 mm d :sup:`-1` is the maximum precipitation rate for drizzle. +:ref:`Le Page et al. (2010) ` analyzed the relationship +between large-scale deforestation fire counts and precipitation during 2003 +:math:`\text{-}`\ 2006 in southern Amazonia where tropical evergreen trees +(BET Tropical) are dominant. Figure 2 in +:ref:`Le Page et al. (2010) ` showed that fires generally +occurred if both :math:`P_{60d}` and :math:`P_{10d}` were less than about +4.0 mm d :sup:`-1`, and fires occurred more frequently in a drier environment. +Based on the 30-yr (1985 to 2004) precipitation data in +:ref:`Qian et al. (2006) `. The climatological precipitation +of dry months (P < 4.0 mm d :sup:`-1`) in a year over tropical deciduous +tree (BDT Tropical) dominated regions is 46% of that over BET Tropical +dominated regions, so we set the PFT-dependent thresholds of :math:`P_{60d}` +and :math:`P_{10d}` as 4.0 mm d :sup:`-1` for BET Tropical and 1.8 mm d +:sup:`-1` (= 4.0 mm d :sup:`-1` :math:`\times` 46%) for BDT Tropical, and +:math:`b`\ :sub:`2` and :math:`b`\ :sub:`3` are the average of thresholds +of BET Tropical and BDT Tropical weighted bytheir coverage. The post-fire area due to deforestation is not limited to land-type conversion regions. In the tree-reduced region, the maximum fire carbon emissions are assumed to be 80% of the total conversion flux. According to the fraction of conversion flux for tropical trees in the -tree-reduced region (60%) assigned by CLM, to reach the maximum fire +tree-reduced region (60%) assigned by CLM4-CN, to reach the maximum fire carbon emissions in a conversion region requires burning this region about twice when we set PFT-dependent combustion completeness factors to -about 0.3 for stem [the mean of 0.2\ :math:`{-}`\ 0.4 used in van -der Werf (2010)]. Therefore, when the burned area calculated from Eq. is +about 0.3 for stem [the mean of 0.2\ :math:`{-}`\ 0.4 used in +:ref:`van der Werf et al. (2010) `. Therefore, when +the burned area calculated from equation :eq:`23.36` is no more than twice the tree-reduced area, we assume no escaped fires outside the land-type conversion region, and the fire-related fraction of the total conversion flux is estimated as @@ -524,7 +536,9 @@ of the total conversion flux is estimated as conversion flux is assumed to be fire carbon emissions, and the biomass combustion and vegetation mortality outside the tree-reduced regions with an area fraction of :math:`\frac{A_{b} }{A_{g} } -2D` are set as in -section 18.1.3. +section :numref:`Fire impact`. + +.. _Peat fires: Peat fires --------------- @@ -532,102 +546,125 @@ Peat fires The burned area due to peat fires is given as :math:`{A}_{b}`: .. math:: - :label: 23.37) + :label: 23.37 - A_{b} =cf_{cli,p} f_{peat} (1-f_{sat} )A_{g} + A_{b} = c \ f_{cli,p} f_{peat} (1 - f_{sat} ) A_{g} -where *c* (time step)\ :sup:`-1` is a constant; :math:`f_{cli,p}` -represents the effect of climate on the burned area;\ :math:`f_{peat}` -is the fractional coverage of peatland in the grid cell; and -:math:`f_{sat}` is the fraction of the grid cell with a water table at -the surface or higher. *c*\ =1.0\ :math:`\times`\ 10\ :sup:`-3` hr\ :sup:`-1` for tropical peat fires and -*c*\ =4.2\ :math:`\times`\ 10\ :sup:`-5` hr\ :sup:`-1` for boreal peat fires are derived using an inverse -method, by matching simulations from an unreleased -CLM4.5 version driven by Qian et al. (2006) atmospheric forcing and -climatological lightning data to earlier studies: about 2.4 Mha peatland -was burned over Indonesia in 1997 (Page et al. 2002) and the average -burned area of peat fires in Western Canada was 0.2 Mha -yr\ :sup:`-1` for 1980-1999 (Turestky et al. 2004). +where :math:`c` (s\ :sup:`-1`) is a constant; :math:`f_{cli,p}` represents +the effect of climate on the burned area; :math:`f_{peat}` is the fractional +coverage of peatland in the grid cell; and :math:`f_{sat}` is the fraction +of the grid cell with a water table at the surface or higher. :math:`c` = 0.17 +:math:`\times` 10 :sup:`-3` hr\ :sup:`-1` for tropical peat fires and +:math:`c` = 0.9 :math:`\times` 10 :sup:`-5` hr :sup:`-1` for boreal peat fires +are derived using an inverse method, by matching simulations to earlier +studies: about 2.4 Mha peatland was burned over Indonesia in 1997 +(:ref:`Page et al. 2002 `) and the average burned area of peat +fires in Western Canada was 0.2 Mha yr :sup:`-1` for 1980-1999 +(:ref:`Turetsky et al. 2004 `). For tropical peat fires, :math:`f_{cli,p}` is set as a function of long-term precipitation :math:`P_{60d}` : .. math:: - :label: 23.38) + :label: 23.38 - f_{cli,p} =\max [0,\min (1,\frac{4-P_{60d} }{4} )]^{2} . + f_{cli,p} = \ max \left[0,\min \left(1,\frac{4-P_{60d} }{4} \right)\right]^{2} . For boreal peat fires, :math:`f_{cli,p}` is set to .. math:: - :label: 23.39) + :label: 23.39 f_{cli,p} = \exp (-\pi \frac{\theta _{17cm} }{0.3} )\cdot \max [0,\min (1,\frac{T_{17cm} -T_{f} }{10} )] -where :math:`\theta _{17cm}` and :math:`T_{17cm}` are the wetness and -temperature of the top 17 cm of soil; :math:`T_{f}` \ =273.15 K is the -freezing temperature. +where :math:`\theta _{17cm}` is the wetness of the top 17 cm of soil. + +Peat fires lead to peat burning and the combustion and mortality of +vegetation over peatlands. For tropical peat fires, based on +:ref:`Page et al. (2002) `, about 6% of the peat carbon loss +from stored carbon is caused by 33.9% of the peatland burned. Carbon emissions +due to peat burning (g C m\ :sup:`-2` s\ :sup:`-1`) are therefore set as the +product of 6%/33.9%, burned area fraction of peat fire (s\ :sup:`-1`), and +soil organic carbon (g C m\ :sup:`-2`). For boreal peat fires, the carbon +emissions due to peat burning are set as 2.2 kg C m\ :sup:`-2` \ peat fire +area (:ref:`Turetsky et al. 2002 `). Biomass combustion +and vegetation mortality in post-fire peatlands are set the same as section +:numref:`Fire impact` for non-crop PFTs and as section +:numref:`Agricultural fires` for crops PFTs. -Peat fires lead to peat combustion and the combustion and mortality of -vegetation in peatlands. For tropical peat fires, based on Page et al. -(2002), about 6% of the peat carbon loss from stored carbon is caused by -33.9% of the peatland burned. Carbon emissions due to peat combustion (g C m\ :sup:`-2` (time step)\ :sup:`-1`) are therefore set as -the product of 6%/33.9%, by burned area fraction of peat fire ((time -step)\ :sup:`-1`), by soil organic carbon (g C m\ :sup:`-2`). For boreal peat fires, the carbon emissions due to -peat combustion are set as 2.2 kg C m\ :sup:`-2`\ peat fire area (Turetsky et al. -2002). Biomass combustion and vegetation mortality in post-fire -peatlands are set the same as section 18.1.3 for non-crop PFTs and as -section 18.2 for crops PFTs. +.. _Fire trace gas and aerosol emissions: -.. _Table PFT-specific combustion completeness and fire mortality: +Fire trace gas and aerosol emissions +------------------------------------- +CESM2 is the first Earth system model that can model the full coupling +among fire, fire emissions, land, and atmosphere. CLM5, as the land +component of CESM2, calculates the surface trace gas and aerosol emissions +due to fire and fire emission heights, as the inputs of atmospheric +chemistry model and aerosol model. + +Emissions for trace gas and aerosol species x and the j-th PFT, :math:`E_{x,j}` +(g species s\ :sup:`-1`), are given by + +.. math:: + :label: 23.40 + + E_{x,j} = EF_{x,j}\frac{\phi _{j} }{[C]}. + +Here, :math:`EF_{x,j}` (g species (g dm)\ :sup:`-1`) is PFT-dependent emission +factor scaled from biome-level values (Li et al., in prep, also used for FireMIP +fire emissions data) by Dr. Val Martin and Dr. Li. :math:`[C]` = 0.5 +(g C (g dm)\ :sup:`-1`) is a conversion factor from dry matter to carbon. + +Emission height is PFT-dependent: 4.3 km for needleleaf tree PFTs, 3 km for other +boreal and temperate tree PFTs, 2.5 km for tropical tree PFTs, 2 km for shrub +PFTs, and 1 km for grass and crop PFTs. These values are compiled from earlier +studies by Dr. Val Martin. + +.. _Table PFT-specific combustion completeness and fire mortality factors: .. table:: PFT-specific combustion completeness and fire mortality factors. +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | PFT | *CC*\ :sub:`leaf` | *CC*\ :sub:`stem` | *CC*\ :sub:`root` | *CC*\ :sub:`ts` | *M*\ :sub:`leaf` | *M*\ :sub:`livestem` | *M*\ :sub:`deadstem` | *M*\ :sub:`root` | *M*\ :sub:`ts` | *M*\ :sub:`livestem` | :math:`\xi`\ :sub:`j` | + | PFT | *CC*\ :sub:`leaf` | *CC*\ :sub:`stem` | *CC*\ :sub:`root` | *CC*\ :sub:`ts` | *M*\ :sub:`leaf` | *M*\ :sub:`livestem,1` | *M*\ :sub:`deadstem` | *M*\ :sub:`root` | *M*\ :sub:`ts` | *M*\ :sub:`livestem,2` | :math:`\xi`\ :sub:`j` | +==================================+===========================+===========================+===========================+=========================+==========================+==============================+==============================+==========================+========================+==============================+=================================+ - | NET Temperate | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | - +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | NET Boreal | 0.80 | 0.25 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | + | NET Temperate | 0.80 | 0.30 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | NDT Boreal | - | - | - | - | - | - | - | - | - | - | - | + | NET Boreal | 0.80 | 0.30 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BET Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + | NDT Boreal | 0.80 | 0.30 | 0.00 | 0.50 | 0.80 | 0.15 | 0.15 | 0.15 | 0.50 | 0.35 | 0.15 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BET Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + | BET Tropical | 0.80 | 0.27 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BDT Tropical | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | + | BET Temperate | 0.80 | 0.27 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BDT Temperate | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | + | BDT Tropical | 0.80 | 0.27 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BDT Boreal | 0.80 | 0.22 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | + | BDT Temperate | 0.80 | 0.27 | 0.00 | 0.45 | 0.80 | 0.10 | 0.10 | 0.10 | 0.35 | 0.25 | 0.10 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BES Temperate | - | - | - | - | - | - | - | - | - | - | - | + | BDT Boreal | 0.80 | 0.27 | 0.00 | 0.45 | 0.80 | 0.13 | 0.13 | 0.13 | 0.45 | 0.32 | 0.13 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BDS Temperate | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | + | BES Temperate | 0.80 | 0.35 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | BDS Boreal | 0.80 | 0.30 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | + | BDS Temperate | 0.80 | 0.35 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | C\ :sub:`3` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + | BDS Boreal | 0.80 | 0.35 | 0.00 | 0.55 | 0.80 | 0.17 | 0.17 | 0.17 | 0.55 | 0.38 | 0.17 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | C\ :sub:`3` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + | C\ :sub:`3` Grass Arctic | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | 0.20 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | C\ :sub:`4` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + | C\ :sub:`3` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | 0.20 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | Crop 1 | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | - | + | C\ :sub:`4` Grass | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | 0.20 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ - | Crop 2 | - | - | - | - | - | - | - | - | - | - | - | + | Crop | 0.80 | 0.80 | 0.00 | 0.80 | 0.80 | 0.20 | 0.20 | 0.20 | 0.80 | 0.60 | 0.20 | +----------------------------------+---------------------------+---------------------------+---------------------------+-------------------------+--------------------------+------------------------------+------------------------------+--------------------------+------------------------+------------------------------+---------------------------------+ -Leaves (:math:`CC_{{\rm leaf}}` ), stems (:math:`CC_{{\rm stem}}` ), -roots (:math:`CC_{{\rm root}}` ) , and transfer and storage carbon -(:math:`CC_{{\rm ts}}` ); mortality factors for leaves -(:math:`M_{{\rm leaf}}` ), live stems (:math:`M_{{\rm livestem,1}}` ), -dead stems (:math:`M_{{\rm deadstem}}` ), roots -(:math:`M_{{\rm root}}` ), and transfer and storage carbon -(:math:`M_{{\rm ts}}` ) related to the carbon transfers from these pools +Leaves (:math:`CC_{leaf}` ), stems (:math:`CC_{stem}` ), +roots (:math:`CC_{root}` ) , and transfer and storage carbon +(:math:`CC_{ts}` ); mortality factors for leaves +(:math:`M_{leaf}` ), live stems (:math:`M_{livestem,1}` ), +dead stems (:math:`M_{deadstem}` ), roots +(:math:`M_{root}` ), and transfer and storage carbon +(:math:`M_{ts}` ) related to the carbon transfers from these pools to litter pool; mortality factors for live stems -(:math:`M_{{\rm livestem,2}}` ) related to the carbon transfer from live +(:math:`M_{livestem,2}` ) related to the carbon transfer from live stems to dead stems; whole-plant mortality factor (:math:`\xi _{j}` ). -Parameters are calibrated in an unreleased CLM4.5 version driven by Qian -et al. (2006) atmospheric forcing and climatological lightning data. diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 404943dd97..8b9a9df144 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -38,7 +38,7 @@ al. 2008) ` and :math:`\Delta t` is the time step (s). .. _Figure Hydrologic processes: -.. Figure:: image1.png +.. Figure:: hydrologic.processes.png Hydrologic processes represented in CLM. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index be084381b3..724fd493f8 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1048,6 +1048,12 @@ Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire in the Earth system – Part 1: Improved global fire modeling in the Community Earth System Model (CESM1). Biogeosciences 10:2293-2314. +.. _LiLawrence2017: + +Li, F., and Lawrence, D. 2017. Role of fire in the global land water +budget during the 20th century through changing ecosystems. +J. Clim. 30: 1894-1908. + .. _Lietal2013b: Li, H.-Y., Huang, M., Tesfa, T., Ke, Y., Sun, Y., Liu, Y., and Leung, L. From db54a61e329f96e2724d328e4a13ec74bc0cab0f Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 8 Jun 2017 11:22:27 -0600 Subject: [PATCH 057/730] update Offline Chapter --- .../tech_note/Offline/CLM50_Tech_Note_Offline.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst index 0419ec668e..f41a24a1d6 100644 --- a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst +++ b/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst @@ -8,14 +8,14 @@ forcing required by CLM (:numref:`Table Atmospheric input to land model`) is supplied by observed datasets. The standard forcing provided with the model is a 110-year (1901-2010) dataset provided by the Global Soil Wetness Project (GSWP3; NEED A REFERENCE). The GSWP3 dataset has a spatial resolution of -0.5\ :math:`{}^o` X 0.5\ :math:`{}^o` and a temporal resolution of three +0.5\ :sup:`o` X 0.5\ :sup:`o` and a temporal resolution of three hours. An alternative forcing dataset is also available, CRUNCEP, a 110-year (1901-2010) dataset (CRUNCEP; :ref:`Viovy 2011 `) that is a combination of two existing datasets; -the CRU TS3.2 0.5\ :math:`{}^o` X 0.5\ :math:`{}^o` monthly data covering the period +the CRU TS3.2 0.5\ :sup:`o` X 0.5\ :sup:`o` monthly data covering the period 1901 to 2002 (:ref:`Mitchell and Jones 2005 `) -and the NCEP reanalysis 2.5\ :math:`{}^o` X 2.5\ :math:`{}^o` +and the NCEP reanalysis 2.5\ :sup:`o` X 2.5\ :sup:`o` 6-hourly data covering the period 1948 to 2010. The CRUNCEP dataset has been used to force CLM for studies of vegetation growth, evapotranspiration, and gross primary production (:ref:`Mao et al. 2012 `, @@ -27,7 +27,7 @@ here (:ref:`Viovy 2011 `). Here, the GSWP3 dataset, which does not include data for particular fields over oceans, lakes, and Antarctica is modified. This missing data is filled with :ref:`Qian et al. (2006) ` data from 1948 that is interpolated by the data atmosphere -model to the 0.5\ :math:`{}^o` GSWP3 grid. This allows the model +model to the 0.5\ :sup:`o` GSWP3 grid. This allows the model to be run over Antarctica and ensures data is available along coastlines regardless of model resolution. @@ -239,13 +239,13 @@ anomalies, respectively: \begin{array}{lr} S^{'} = S + k_{anomaly} & \quad {\rm state \ variable} \\ - F^{'} = f * k_{anomaly} & \quad {\rm flux \ variable} + F^{'} = f \times k_{anomaly} & \quad {\rm flux \ variable} \end{array} where :math:`S^{'}` is the adjusted atmospheric state variable, :math:`S` is the state variable from the high-frequency reference atmospheric forcing dataset, and :math:`k_{anomaly}` is an additive anomaly. -Similarly, math:`F^{'}` is the adjusted atmospheric flux variable, +Similarly, :math:`F^{'}` is the adjusted atmospheric flux variable, :math:`F` is the flux variable from the high-frequency reference atmospheric forcing dataset, and :math:`k_{anomaly}` is a multiplicative anomaly. State variables are temperature :math:`T_{atm}`, From f237ae31a4af2a23c38ff9b00e3d1f995e8c0631 Mon Sep 17 00:00:00 2001 From: djk2120 Date: Thu, 8 Jun 2017 15:09:24 -0400 Subject: [PATCH 058/730] PHS update: including flow diagram, numerical implementation, and other edits --- ...CLM50_Tech_Note_Plant_Hydraulic_Stress.rst | 352 ++++++++++++++++-- 1 file changed, 313 insertions(+), 39 deletions(-) diff --git a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst index d8bad01423..d49d3a04b3 100644 --- a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst +++ b/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst @@ -3,7 +3,14 @@ Plant Hydraulic Stress ====================== -Introductory text... +The Plant Hydraulic Stress (PHS) routine explicitly models water transport through the vegetation according to a simple hydraulic framework following Darcy's Law for porous media flow equations influenced by +:ref:`Bonan et al. (2014) `, +:ref:`Chuang et al. (2006) `, +:ref:`Sperry et al. (1998) `, +:ref:`Sperry and Love (2015) `, +:ref:`Williams et al (1996) `. + +PHS solves for the vegetation water potential that matches water supply with transpiration demand. Water supply is modeled according to the circuit analog in :numref:`Figure Soil Temperature Schematic`. Transpiration demand is modeled relative to maximum transpiration by a transpiration loss function dependent on leaf water potential. .. _Figure Soil Temperature Schematic: @@ -16,18 +23,16 @@ Introductory text... Plant Water Supply ----------------------- -PHS explicitly models water transport through the vegetation according to a simple hydraulic framework following Darcy's Law for porous media flow equations. The supply equations are used to solve for vegetation water potential forced by a given transpiration and the set of layer-by-layer soil water potentials. - +The supply equations are used to solve for vegetation water potential forced by transpiration demand and the set of layer-by-layer soil water potentials. The water supply is discretized into segments: soil-to-root, root-to-stem, and stem-to-leaf. There are typically several (1-49) soil-to-root flows operating in parallel, one per soil layer. There are two stem-to-leaf flows operating in parallel, corresponding to the sunlit and shaded "leaves". -In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculated as: +In general the water fluxes (e.g. soil-to-root, root-to-stem, etc.) are modeled according to Darcy's Law for porous media flow as: .. math:: - :label: 11.1) + :label: 11.101) q = kA\left( \psi_1 - \psi_2 \right) - :math:`q` is the flux of water (mmH\ :sub:`2`\ O) spanning the segment between :math:`\psi_1` and :math:`\psi_2` :math:`k` is the hydraulic conductance (s\ :sup:`-1`\ ) @@ -36,8 +41,11 @@ In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculate :math:`\psi_1 - \psi_2` is the gradient in water potential (mmH\ :sub:`2`\ O) across the segment +The segments in :numref:`Figure Soil Temperature Schematic` have variable resistance, as the water potentials become lower, hydraulic conductance decreases. +This is captured by multiplying the maximum segment conductance by a sigmoidal function capturing the percent loss of conductivity. The function uses two parameters to fit experimental vulnerability curves: the water potential at 50% loss of conductivity (:math:`p50`) and a shape fitting parameter (:math:`c_k`). + .. math:: - :label: 11.2) + :label: 11.102) k=k_{max}\cdot 2^{-\left(\dfrac{\psi_1}{p50}\right)^{c_k}} @@ -47,35 +55,40 @@ In general the water fluxes (e.g. soil-to-root, root-to-stem, etc) are calculate :math:`\psi_1` is the water potential of the lower segment terminus (mmH2O) +.. _Stem-to-leaf: + +Stem-to-leaf +'''''''''''''''''''''''' + The area basis and conductance parameterization varies by segment. There are two stem-to-leaf fluxes in parallel, from stem to sunlit leaf and from stem to shaded leaf (:math:`q_{1a}` and :math:`q_{1a}`). The water flux from stem-to-leaf is the product of the segment conductance, the conducting area basis, and the water potential gradient from stem to leaf. Stem-to-leaf conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve. The maximum conductance is a PFT parameter representing the maximum conductance of water from stem to leaf per unit leaf area. This parameter can be defined separately for sunlit and shaded segments and should already include the appropriate length scaling (in other words this is a conductance, not conductivity). The water potential gradient is the difference between leaf water potential and stem water potential. There is no gravity term, assuming a negligible difference in height across the segment. The area basis is the leaf area index (either sunlit or shaded). .. math:: - :label: 11.3) + :label: 11.103) - q_{1a}=k_{1a}*\mbox{LAI}_{sun}*\left(\psi_{stem}-\psi_{sunleaf} \right) + q_{1a}=k_{1a}\cdot\mbox{LAI}_{sun}\cdot\left(\psi_{stem}-\psi_{sunleaf} \right) .. math:: - :label: 11.4) + :label: 11.104) - q_{1b}=k_{1b}*\mbox{LAI}_{shade}*\left(\psi_{stem}-\psi_{shadeleaf} \right) + q_{1b}=k_{1b}\cdot\mbox{LAI}_{shade}\cdot\left(\psi_{stem}-\psi_{shadeleaf} \right) .. math:: - :label: 11.5) + :label: 11.105) - k_{1a}=k_{1a,max}*2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} + k_{1a}=k_{1a,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} .. math:: - :label: 11.6) + :label: 11.106) - k_{1b}=k_{1b,max}*2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} + k_{1b}=k_{1b,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} Variables: :math:`q_{1a}` = flux of water (mmH2O/s) from stem to sunlit leaf - +12 :math:`q_{1b}` = flux of water (mmH2O/s) from stem to shaded leaf :math:`LAI_{sun}` = sunlit leaf area index (m2/m2) @@ -98,15 +111,20 @@ Parameters: :math:`c_{k}` = vulnerability curve shape-fitting parameter (-) +.. _Root-to-stem: + +Root-to-stem +'''''''''''''''''''''''' + There is one root-to-stem flux. This represents a flux from the root collar to the upper branch reaches. The water flux from root-to-stem is the product of the segment conductance, the conducting area basis, and the water potential gradient from root to stem. Root-to-stem conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve (two parameters). The maximum conductance is defined as the maximum root-to-stem conductivity per unit stem area (PFT parameter) divided by the length of the conducting path, which is taken to be the vegetation height. The area basis is the stem area index. The gradient in water potential is the difference between the root water potential and the stem water potential less the difference in gravitational potential. .. math:: - :label: 11.7) + :label: 11.107) q_2=k_2 \cdot SAI \cdot \left( \psi_{root} - \psi_{stem} - \Delta \psi_z \right) .. math:: - :label: 11.8) + :label: 11.108) k_2=\dfrac{k_{2,max}}{z_2} \cdot 2^{-\left(\dfrac{\psi_{root}}{p50_2}\right)^{c_k}} @@ -130,6 +148,11 @@ Parameters: :math:`z_2` = vegetation height (m) +.. _Soil-to-root: + +Soil-to-root +'''''''''''''''''''''''' + There are several soil-to-root fluxes operating in parallel (one for each root-containing soil layer). Each represents a flux from the given soil layer to the root collar. The water flux from soil-to-root is the product of the segment conductance, the conducting area basis, and the water potential gradient from soil to root. The area basis is a proxy for root area index, defined as the summed leaf and stem area index multiplied by the root-to-shoot ratio (PFT parameter) multiplied by the layer root fraction. The root fraction comes from an empirical root profile (see section zqz). The gradient in water potential is the difference between the soil water potential and the root water potential less the difference in gravitational potential. There is only one root water potential to which all soil layers are connected in parallel. A soil-to-root flux can be either positive (vegetation water uptake) or negative (water deposition), depending on the relative values of the root and soil water potentials. This allows for the occurrence of hydraulic redistribution where water moves through vegetation tissue from one soil layer to another. @@ -139,37 +162,37 @@ Soil-to-root conductance is the result of two resistances in series, first acros The soil-root interface conductance is defined as the soil conductivity divided by the conducting length from soil to root. The soil conductivity varies by soil layer and is calculated based on soil potential and soil properties, via the Brooks-Corey theory. The conducting length is computed by calculating the characteristic root spacing following Bonan-2014. The root spacing depends on total root biomass and PFT parameters defining root structure (see section zqz). .. math:: - :label: 11.9) + :label: 11.109) q_{3,i}=k_{3,i}*RAI*\left(\psi_{soil,i}-\psi_{root} + \Delta\psi_{z,i} \right) .. math:: - :label: 11.10) + :label: 11.110) RAI=\left(LAI+SAI \right)\cdot r_i \cdot f_{root-leaf} .. math:: - :label: 11.11) + :label: 11.111) k_{3,i}=\dfrac{k_{r,i}*k_{s,i}}{k_{r,i}+k_{s,i}} .. math:: - :label: 11.12) + :label: 11.112) k_{r,i}=\dfrac{k_{3,max}}{z_{3,i}}*2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} .. math:: - :label: 11.13) + :label: 11.113) k_{s,i} = \dfrac{k_{soil,i}}{dx_{root,i}} .. math:: - :label: 11.14) + :label: 11.114) dx_{root,i} = \left(\pi*\mbox{root-length-density}_i\right)^{-0.5} .. math:: - :label: 11.15) + :label: 11.115) \mbox{root-length-density} = \dfrac{\mbox{total root length}}{\mbox{soil volume}} @@ -206,25 +229,35 @@ Parameters: Plant Water Demand ----------------------- +Plant water demand depends on stomatal conductance, which is described in section :numref:`Stomatal resistance`. +Here we describe the influence of PHS and the coupling of vegetation water demand and supply. +PHS models vegetation water demand as transpiration attenuated by a transpiration loss function based on leaf water potential. +Sunlit leaf transpiration is modeled as the maximum sunlit leaf transpiration multiplied by the percent of maximum transpiration as modeled by the sigmoidal loss function. +The same follows for shaded leaf transpiration. +Maximum stomatal conductance is calculated from the Medlyn model :ref:`(Medlyn et al. 2011) ` absent water stress and used to calculate the maximum transpiration (see section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). +Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. +Water stress is calculated with distinct values for sunlit and shaded leaves. +Vegetation water stress is calculated based on leaf water potential and is used to attenuate photosynthesis (see section :numref:`Photosynthesis`) + .. math:: - :label: 11.16) + :label: 11.201) - E_{sun} = E_{sun,max}*2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} + E_{sun} = E_{sun,max} \cdot 2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} .. math:: - :label: 11.17) + :label: 11.202) - E_{shade} = E_{shade,max}*2^{-\left(\dfrac{\psi_{shadeleaf}}{p50_e}\right)^{c_k}} + E_{shade} = E_{shade,max} \cdot 2^{-\left(\dfrac{\psi_{shadeleaf}}{p50_e}\right)^{c_k}} .. math:: - :label: 11.18) + :label: 11.203) - B_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,B_t=1}} + \beta_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,\beta_t=1}} .. math:: - :label: 11.19) + :label: 11.204) - B_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,B_t=1}} + \beta_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,\beta_t=1}} :math:`E_{sun}` = sunlit leaf transpiration (mm/s) @@ -238,6 +271,10 @@ Plant Water Demand :math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH2O) +:math:`\beta_{t,sun}` = sunlit transpiration water stress (-) + +:math:`\beta_{t,shade}` = shaded transpiration water stress (-) + :math:`g_{s,sun}` = stomatal conductance of water corresponding to :math:`E_{sun}` :math:`g_{s,shade}` = stomatal conductance of water corresponding to :math:`E_{shade}` @@ -251,15 +288,15 @@ Plant Water Demand Vegetation Water Potential ----------------------------- -PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential at each timestep. PHS iterates to find the vegetation water potential vector :math:`\psi` that satisfies continuity in the non-linear vegetation water supply and demand equations. +Both plant water supply and demand are functions of vegetation water potential. PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential at each timestep. PHS iterates to find the vegetation water potential :math:`\psi` (vector) that satisfies continuity between the non-linear vegetation water supply and demand (equations :eq:`11.103)`, :eq:`11.104)`, :eq:`11.107)`, :eq:`11.109)`, :eq:`11.201)`, :eq:`11.202)`). .. math:: - :label: 11.20) + :label: 11.301) \psi=\left[\psi_{sunleaf},\psi_{shadeleaf},\psi_{stem},\psi_{root}\right] .. math:: - :label: 11.21 + :label: 11.302) \begin{aligned} E_{sun}&=q_{1a}\\ @@ -269,15 +306,252 @@ PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential a &=\sum_{i=1}^{nlevsoi}{q_{3,i}} \end{aligned} -The demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy :eq:`11.21`. +PHS finds the water potentials that match supply and demand. In the plant water transport equations :eq:`11.302)`, the demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy continuity :eq:`11.302)`. + + + +.. _PHS Numerical Implementation: + +Numerical Implementation +-------------------------------- + +The four plant water potential nodes are ( :math:`\psi_{root}`, :math:`\psi_{xylem}`, :math:`\psi_{shadeleaf}`, :math:`\psi_{sunleaf}`). +The fluxes between each pair of nodes are labeled in Figure 1. +:math:`E_{sun}` and :math:`E_{sha}` are the transpiration from sunlit and shaded leaves, respectively. +We use the circuit-analog model to calculate the vegetation water potential ( :math:`\psi`) for the four plant nodes, forced by soil matric potential and unstressed transpiration. +The unstressed transpiration is acquired by running the photosynthesis model with :math:`\beta_t=1`. +The unstressed transpiration flux is attenuated based on the leaf-level vegetation water potential. +Using the attenuated transpiration, we solve for :math:`g_{s,stressed}` and output :math:`\beta_t=\dfrac{g_{s,stressed}}{g_{s,unstressed}}`. + +The continuity of water flow through the system yields four equations + +.. math:: + :label: 11.401) + + \begin{aligned} + E_{sun}&=q_{1a}\\ + E_{shade}&=q_{1b}\\ + q_{1a}+q_{1b}&=q_2\\ + q_2&=\sum_{i=1}^{nlevsoi}{q_{3,i}} + \end{aligned} + + +We seek the set of vegetation water potential values, + +.. math:: + :label: 11.402) + + \psi=\left[ \begin {array}{c} + \psi_{sunleaf}\cr\psi_{shadeleaf}\cr\psi_{stem}\cr\psi_{root} + \end {array} \right] + +that satisfies these equations, as forced by the soil moisture and atmospheric state. +Each flux on the schematic can be represented in terms of the relevant water potentials. Defining the transpiration fluxes: + +.. math:: + :label: 11.403) + + \begin{aligned} + E_{sun} &= E_{sun,max} \cdot 2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} \\ + E_{shade} &= E_{shade,max} \cdot 2^{-\left(\dfrac{\psi_{shadeleaf}}{p50_e}\right)^{c_k}} + \end{aligned} + +Defining the water supply fluxes: + +.. math:: + :label: 11.404) + + \begin{aligned} + q_{1a}&=k_{1a,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} \cdot\mbox{LAI}_{sun}\cdot\left(\psi_{stem}-\psi_{sunleaf} \right) \\ + q_{1b}&=k_{1b,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}}\cdot\mbox{LAI}_{shade}\cdot\left(\psi_{stem}-\psi_{shadeleaf} \right) \\ + q_2&=\dfrac{k_{2,max}}{z_2} \cdot 2^{-\left(\dfrac{\psi_{root}}{p50_2}\right)^{c_k}} \cdot SAI \cdot \left( \psi_{root} - \psi_{stem} - \Delta \psi_z \right) \\ + q_{soil}&=\sum_{i=1}^{nlevsoi}{q_{3,i}}=\sum_{i=1}^{nlevsoi}{k_{3,i}\cdot RAI\cdot\left(\psi_{soil,i}-\psi_{root} + \Delta\psi_{z,i} \right)} + \end{aligned} + +We're looking to find the vector :math:`\psi` +that fits with soil and atmospheric forcings while satisfying water flow continuity. +Due to the model non-linearity, we use a linearized explicit approach, iterating with Newton's method. +The initial guess is the solution for :math:`\psi` (vector) from the previous time step. +The general framework, from iteration `m` to `m+1` is: + +.. math:: + :label: 11.405) + + q^{m+1}=q^m+\dfrac{\delta q}{\delta\psi}\Delta\psi \\ + \psi^{m+1}=\psi^{m}+\Delta\psi + +So for our first flux balance equation, at iteration `m+1`, we have: + +.. math:: + :label: 11.406) + + E_{sun}^{m+1}=q_{1a}^{m+1} + +Which can be linearized to: + +.. math:: + :label: 11.407) + + E_{sun}^{m}+\dfrac{\delta E_{sun}}{\delta\psi}\Delta\psi=q_{1a}^{m}+\dfrac{\delta q_{1a}}{\delta\psi}\Delta\psi + +And rearranged to be: + +.. math:: + :label: 11.408) + + \dfrac{\delta q_{1a}}{\delta\psi}\Delta\psi-\dfrac{\delta E_{sun}}{\delta\psi}\Delta\psi=E_{sun}^{m}-q_{1a}^{m} + +And for the other 3 flux balance equations: + +.. math:: + :label: 11.409) + + \begin{aligned} + \dfrac{\delta q_{1b}}{\delta\psi}\Delta\psi-\dfrac{\delta E_{sha}}{\delta\psi}\Delta\psi&=E_{sha}^{m}-q_{1b}^{m} \\ + \dfrac{\delta q_2}{\delta\psi}\Delta\psi-\dfrac{\delta q_{1a}}{\delta\psi}\Delta\psi-\dfrac{\delta q_{1b}}{\delta\psi}\Delta\psi&=q_{1a}^{m}+q_{1b}^{m}-q_2^{m} \\ + \dfrac{\delta q_{soil}}{\delta\psi}\Delta\psi-\dfrac{\delta q_2}{\delta\psi}\Delta\psi&=q_2^{m}-q_{soil}^{m} + \end{aligned} + +Putting all four together in matrix form: + +.. math:: + :label: 11.410) + + \left[ \begin {array}{c} + \dfrac{\delta q_{1a}}{\delta\psi}-\dfrac{\delta E_{sun}}{\delta\psi} \cr + \dfrac{\delta q_{1b}}{\delta\psi}-\dfrac{\delta E_{sha}}{\delta\psi} \cr + \dfrac{\delta q_2}{\delta\psi}-\dfrac{\delta q_{1a}}{\delta\psi}-\dfrac{\delta q_{1b}}{\delta\psi} \cr + \dfrac{\delta q_{soil}}{\delta\psi}-\dfrac{\delta q_2}{\delta\psi} + \end {array} \right] + \Delta\psi= + \left[ \begin {array}{c} + E_{sun}^{m}-q_{1a}^{m} \cr + E_{sha}^{m}-q_{1b}^{m} \cr + q_{1a}^{m}+q_{1b}^{m}-q_2^{m} \cr + q_2^{m}-q_{soil}^{m} + \end {array} \right] + +Now to expand the left-hand side, from generic :math:`\psi` to all four plant water potential nodes, noting that many derivatives are zero (e.g. :math:`\dfrac{\delta E_{sun}}{\delta\psi_{sha}}=0`) + +Introducing the notation: +:math:`A\Delta\psi=b` + +.. math:: + :label: 11.411) + + \Delta\psi=\left[ \begin {array}{c} + \Delta\psi_{sunleaf} \cr + \Delta\psi_{shadeleaf} \cr + \Delta\psi_{stem} \cr + \Delta\psi_{root} + \end {array} \right] + +.. math:: + :label: 11.412) + + A= + \left[ \begin {array}{cccc} + \dfrac{\delta q_{1a}}{\delta \psi_{sun}}-\dfrac{\delta E_{sun}}{\delta \psi_{sun}}&0&\dfrac{\delta q_{1a}}{\delta \psi_{stem}}&0\cr + 0&\dfrac{\delta q_{1b}}{\delta \psi_{sha}}-\dfrac{\delta E_{sha}}{\delta \psi_{sha}}&\dfrac{\delta q_{1b}}{\delta \psi_{stem}}&0\cr + -\dfrac{\delta q_{1a}}{\delta \psi_{sun}}& + -\dfrac{\delta q_{1b}}{\delta \psi_{sha}}& + \dfrac{\delta q_2}{\delta \psi_{stem}}-\dfrac{\delta q_{1a}}{\delta \psi_{stem}}-\dfrac{\delta q_{1b}}{\delta \psi_{stem}}& + \dfrac{\delta q_2}{\delta \psi_{root}}\cr + 0&0&-\dfrac{\delta q_2}{\delta \psi_{stem}}&\dfrac{\delta q_{soil}}{\delta \psi_{root}}-\dfrac{\delta q_2}{\delta \psi_{root}} + \end {array} \right] + +.. math:: + :label: 11.413) + + b= + \left[ \begin {array}{c} + E_{sun}^{m}-q_{b1}^{m} \cr + E_{sha}^{m}-q_{b2}^{m} \cr + q_{b1}^{m}+q_{b2}^{m}-q_{stem}^{m} \cr + q_{stem}^{m}-q_{soil}^{m} + \end {array} \right] + +Now we compute all the entries for :math:`A` and :math:`b` based on the soil moisture and maximum transpiration forcings and can solve to find: + +.. math:: + :label: 11.414) + + \Delta\psi=A^{-1}b .. math:: - :label: 11.22) + :label: 11.415) + + \psi_{m+1}=\psi_m+\Delta\psi + +We iterate until :math:`b\to 0`, signifying water flux balance through the system. The result is a final set of water potentials ( :math:`\psi_{root}`, :math:`\psi_{xylem}`, :math:`\psi_{shadeleaf}`, :math:`\psi_{sunleaf}`) satisfying non-divergent water flux through the system. +The magnitude of the water flux is driven by soil matric potential and unstressed ( :math:`\beta_t=1`) transpiration. + +We use the transpiration solution (corresponding to the final solution for :math:`\psi`) to compute stomatal conductance. The stomatal conductance is then used to compute :math:`\beta_t`. + +.. math:: + :label: 11.416) + + \beta_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,\beta_t=1}} + +.. math:: + :label: 11.417) + + \beta_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,\beta_t=1}} + +The :math:`\beta_t` values are used in the Photosynthesis module (see section :numref:`Photosynthesis`) to apply water stress. +The solution for :math:`\psi` is saved as a new variable (vegetation water potential) and is indicative of plant water status. +The soil-to-root fluxes :math:`\left( q_{3,1},q_{3,2},\mbox{...},q_{3,n}\right)` are used as the soil transpiration sink in the Richards' equation subsurface flow equations (see section :numref:`Soil Water`). + +.. _Flow Diagram of Leaf Flux Calculations: + +Flow Diagram of Leaf Flux Calculations: +------------------------------------------- + +PHS runs nested in the loop that solves for sensible and latent heat fluxes and temperature for vegetated surfaces (see section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). +The scheme iterates for convergence of leaf temperature (:math:`T_l`), transpiration water stress (:math:`\beta_t`), and intercellular CO2 concentration (:math:`c_i`). +PHS is forced by maximum transpiration (absent water stress, :math:`\beta_t=1`), whereby we first solve for assimilation, stomatal conductance, and intercellular CO2 with :math:`\beta_{t,sun}` and :math:`\beta_{t,shade}` both set to 1. +This involves iterating to convergence of :math:`c_i` (see section :numref:`Photosynthesis`). + +Next, using the solutions for :math:`E_{sun,max}` and :math:`E_{shade,max}`, PHS solves for :math:`\psi`, :math:`\beta_{t,sun}`, and :math:`\beta_{t,shade}`. +The values for :math:`\beta_{t,sun}`, and :math:`\beta_{t,shade}` are inputs to the photosynthesis routine, which now solves for attenuated photosynthesis and stomatal conductance (reflecting water stress). +Again this involves iterating to convergence of :math:`c_i`. +Non-linearities between :math:`\beta_t` and transpiration require also iterating to convergence of :math:`\beta_t`. +The outermost level of iteration works towards convergence of leaf temperature, reflecting leaf surface energy balance. + +.. _Figure PHS Flow Diagram: + +.. figure:: flow.png + + Flow diagram of leaf flux calculations + + +.. _PHS Refs: + +References +----------------------------- + +Local references. Will copy over + +.. _Bonanetal2014: + +Bonan, G.B., Williams, M., Fisher, R.A., and Oleson, K.W. 2014. Modeling stomatal conductance in the earth system: linking leaf water-use efficiency and water transport along the soil–plant–atmosphere continuum, Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. + +.. _Chuangetal2006: + +Chuang Y.L., Oren R., Bertozzi A.L, Phillips N., Katul G.G. 2006. The porous media model for the hydraulic system of a conifer tree: Linking sap flux data to transpiration rate, Ecological Modelling, 191, 447-468, doi:10.1016/j.ecolmodel.2005.03.027. + +.. _Medlynetal2011: - ff +Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and Wingate, L. (2011), Reconciling the optimal and empirical approaches to modelling stomatal conductance. Global Change Biology, 17: 2134–2144. doi:10.1111/j.1365-2486.2010.02375.x +.. _Sperryetal1998: +Sperry, J.S., Adler, F.R., Campbell, G.S. and Comstock, J.P. (1998), Limitation of plant water use by rhizosphere and xylem conductance: results from a model. Plant, Cell & Environment, 21: 347–359. doi:10.1046/j.1365-3040.1998.00287.x +.. _SperryandLove2015: +Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us about responses to climate-change droughts. New Phytol, 207: 14–27. doi:10.1111/nph.13354 +.. _Williamsetal1996: +Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere continuum in a Quercus–Acer stand at Harvard Forest: the regulation of stomatal conductance by light, nitrogen and soil/plant hydraulic properties. Plant, Cell & Environment, 19: 911–927. doi:10.1111/j.1365-3040.1996.tb00456.x \ No newline at end of file From ad6b0e0289c6c06293422d19086f1c222ea2361c Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 9 Jun 2017 08:58:00 -0600 Subject: [PATCH 059/730] change chapter names --- .../CLM50_Tech_Note_Land-Only_Mode.rst} | 6 +- .../CLM50_Tech_Note_Plant_Hydraulics.rst} | 146 +++++++++++------- doc/source/tech_note/index.rst | 4 +- 3 files changed, 92 insertions(+), 64 deletions(-) rename doc/source/tech_note/{Offline/CLM50_Tech_Note_Offline.rst => Land-Only_Mode/CLM50_Tech_Note_Land-Only_Mode.rst} (99%) rename doc/source/tech_note/{Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst => Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst} (86%) diff --git a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst b/doc/source/tech_note/Land-Only_Mode/CLM50_Tech_Note_Land-Only_Mode.rst similarity index 99% rename from doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst rename to doc/source/tech_note/Land-Only_Mode/CLM50_Tech_Note_Land-Only_Mode.rst index f41a24a1d6..9fba6f187c 100644 --- a/doc/source/tech_note/Offline/CLM50_Tech_Note_Offline.rst +++ b/doc/source/tech_note/Land-Only_Mode/CLM50_Tech_Note_Land-Only_Mode.rst @@ -1,9 +1,9 @@ -.. _rst_Offline Mode: +.. _rst_Land-only Mode: -Offline Mode +Land-Only Mode ================ -In offline mode (uncoupled to an atmospheric model), the atmospheric +In land-only mode (uncoupled to an atmospheric model), the atmospheric forcing required by CLM (:numref:`Table Atmospheric input to land model`) is supplied by observed datasets. The standard forcing provided with the model is a 110-year (1901-2010) dataset provided by the Global Soil Wetness diff --git a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst similarity index 86% rename from doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst rename to doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst index d49d3a04b3..60bfc568ef 100644 --- a/doc/source/tech_note/Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst +++ b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst @@ -1,18 +1,34 @@ -.. _rst_Plant Hydraulic Stress: +.. _rst_Plant Hydraulics: -Plant Hydraulic Stress +Plant Hydraulics ====================== -The Plant Hydraulic Stress (PHS) routine explicitly models water transport through the vegetation according to a simple hydraulic framework following Darcy's Law for porous media flow equations influenced by +.. _Rooting Profiles: + +Rooting Profiles +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. _Plant Hydraulic Stress: + +Plant Hydraulic Stress +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The Plant Hydraulic Stress (PHS) routine explicitly models water transport +through the vegetation according to a simple hydraulic framework following +Darcy's Law for porous media flow equations influenced by :ref:`Bonan et al. (2014) `, :ref:`Chuang et al. (2006) `, :ref:`Sperry et al. (1998) `, :ref:`Sperry and Love (2015) `, :ref:`Williams et al (1996) `. -PHS solves for the vegetation water potential that matches water supply with transpiration demand. Water supply is modeled according to the circuit analog in :numref:`Figure Soil Temperature Schematic`. Transpiration demand is modeled relative to maximum transpiration by a transpiration loss function dependent on leaf water potential. +PHS solves for the vegetation water potential that matches water supply with +transpiration demand. Water supply is modeled according to the circuit analog +in :numref:`Figure Plant hydraulic circuit`. Transpiration demand is modeled +relative to maximum transpiration by a transpiration loss function dependent +on leaf water potential. -.. _Figure Soil Temperature Schematic: +.. _Figure Plant hydraulic circuit: .. figure:: circuit.jpg @@ -23,29 +39,41 @@ PHS solves for the vegetation water potential that matches water supply with tra Plant Water Supply ----------------------- -The supply equations are used to solve for vegetation water potential forced by transpiration demand and the set of layer-by-layer soil water potentials. -The water supply is discretized into segments: soil-to-root, root-to-stem, and stem-to-leaf. There are typically several (1-49) soil-to-root flows operating in parallel, one per soil layer. There are two stem-to-leaf flows operating in parallel, corresponding to the sunlit and shaded "leaves". +The supply equations are used to solve for vegetation water potential forced +by transpiration demand and the set of layer-by-layer soil water potentials. +The water supply is discretized into segments: soil-to-root, root-to-stem, and +stem-to-leaf. There are typically several (1-49) soil-to-root flows operating +in parallel, one per soil layer. There are two stem-to-leaf flows operating in +parallel, corresponding to the sunlit and shaded "leaves". -In general the water fluxes (e.g. soil-to-root, root-to-stem, etc.) are modeled according to Darcy's Law for porous media flow as: +In general the water fluxes (e.g. soil-to-root, root-to-stem, etc.) are +modeled according to Darcy's Law for porous media flow as: .. math:: - :label: 11.101) + :label: 11.101 q = kA\left( \psi_1 - \psi_2 \right) -:math:`q` is the flux of water (mmH\ :sub:`2`\ O) spanning the segment between :math:`\psi_1` and :math:`\psi_2` +:math:`q` is the flux of water (mmH\ :sub:`2`\ O) spanning the segment +between :math:`\psi_1` and :math:`\psi_2` :math:`k` is the hydraulic conductance (s\ :sup:`-1`\ ) -:math:`A` is the area basis (m\ :sup:`2`\ /m\ :sup:`2`\ ) relating the conducting area basis to ground area +:math:`A` is the area basis (m\ :sup:`2`\ /m\ :sup:`2`\ ) relating the +conducting area basis to ground area -:math:`\psi_1 - \psi_2` is the gradient in water potential (mmH\ :sub:`2`\ O) across the segment +:math:`\psi_1 - \psi_2` is the gradient in water potential (mmH\ :sub:`2`\ O) +across the segment -The segments in :numref:`Figure Soil Temperature Schematic` have variable resistance, as the water potentials become lower, hydraulic conductance decreases. -This is captured by multiplying the maximum segment conductance by a sigmoidal function capturing the percent loss of conductivity. The function uses two parameters to fit experimental vulnerability curves: the water potential at 50% loss of conductivity (:math:`p50`) and a shape fitting parameter (:math:`c_k`). +The segments in :numref:`Figure Plant hydraulic circuit` have variable resistance, +as the water potentials become lower, hydraulic conductance decreases. This is +captured by multiplying the maximum segment conductance by a sigmoidal function +capturing the percent loss of conductivity. The function uses two parameters to +fit experimental vulnerability curves: the water potential at 50% loss of +conductivity (:math:`p50`) and a shape fitting parameter (:math:`c_k`). .. math:: - :label: 11.102) + :label: 11.102 k=k_{max}\cdot 2^{-\left(\dfrac{\psi_1}{p50}\right)^{c_k}} @@ -66,29 +94,29 @@ The maximum conductance is a PFT parameter representing the maximum conductance This parameter can be defined separately for sunlit and shaded segments and should already include the appropriate length scaling (in other words this is a conductance, not conductivity). The water potential gradient is the difference between leaf water potential and stem water potential. There is no gravity term, assuming a negligible difference in height across the segment. The area basis is the leaf area index (either sunlit or shaded). .. math:: - :label: 11.103) + :label: 11.103 q_{1a}=k_{1a}\cdot\mbox{LAI}_{sun}\cdot\left(\psi_{stem}-\psi_{sunleaf} \right) .. math:: - :label: 11.104) + :label: 11.104 q_{1b}=k_{1b}\cdot\mbox{LAI}_{shade}\cdot\left(\psi_{stem}-\psi_{shadeleaf} \right) .. math:: - :label: 11.105) + :label: 11.105 k_{1a}=k_{1a,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} .. math:: - :label: 11.106) + :label: 11.106 k_{1b}=k_{1b,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} Variables: :math:`q_{1a}` = flux of water (mmH2O/s) from stem to sunlit leaf -12 + :math:`q_{1b}` = flux of water (mmH2O/s) from stem to shaded leaf :math:`LAI_{sun}` = sunlit leaf area index (m2/m2) @@ -119,12 +147,12 @@ Root-to-stem There is one root-to-stem flux. This represents a flux from the root collar to the upper branch reaches. The water flux from root-to-stem is the product of the segment conductance, the conducting area basis, and the water potential gradient from root to stem. Root-to-stem conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve (two parameters). The maximum conductance is defined as the maximum root-to-stem conductivity per unit stem area (PFT parameter) divided by the length of the conducting path, which is taken to be the vegetation height. The area basis is the stem area index. The gradient in water potential is the difference between the root water potential and the stem water potential less the difference in gravitational potential. .. math:: - :label: 11.107) + :label: 11.107 q_2=k_2 \cdot SAI \cdot \left( \psi_{root} - \psi_{stem} - \Delta \psi_z \right) .. math:: - :label: 11.108) + :label: 11.108 k_2=\dfrac{k_{2,max}}{z_2} \cdot 2^{-\left(\dfrac{\psi_{root}}{p50_2}\right)^{c_k}} @@ -162,37 +190,37 @@ Soil-to-root conductance is the result of two resistances in series, first acros The soil-root interface conductance is defined as the soil conductivity divided by the conducting length from soil to root. The soil conductivity varies by soil layer and is calculated based on soil potential and soil properties, via the Brooks-Corey theory. The conducting length is computed by calculating the characteristic root spacing following Bonan-2014. The root spacing depends on total root biomass and PFT parameters defining root structure (see section zqz). .. math:: - :label: 11.109) + :label: 11.109 - q_{3,i}=k_{3,i}*RAI*\left(\psi_{soil,i}-\psi_{root} + \Delta\psi_{z,i} \right) + q_{3,i}=k_{3,i} \cdot RAI \cdot \left(\psi_{soil,i}-\psi_{root} + \Delta\psi_{z,i} \right) .. math:: - :label: 11.110) + :label: 11.110 - RAI=\left(LAI+SAI \right)\cdot r_i \cdot f_{root-leaf} + RAI=\left(LAI+SAI \right) \cdot r_i \cdot f_{root-leaf} .. math:: - :label: 11.111) + :label: 11.111 - k_{3,i}=\dfrac{k_{r,i}*k_{s,i}}{k_{r,i}+k_{s,i}} + k_{3,i}=\dfrac{k_{r,i} \cdot k_{s,i}}{k_{r,i}+k_{s,i}} .. math:: - :label: 11.112) + :label: 11.112 - k_{r,i}=\dfrac{k_{3,max}}{z_{3,i}}*2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} + k_{r,i}=\dfrac{k_{3,max}}{z_{3,i}} \cdot 2^{-\left(\dfrac{\psi_{soil,i}}{p50_3}\right)^{c_k}} .. math:: - :label: 11.113) + :label: 11.113 k_{s,i} = \dfrac{k_{soil,i}}{dx_{root,i}} .. math:: - :label: 11.114) + :label: 11.114 dx_{root,i} = \left(\pi*\mbox{root-length-density}_i\right)^{-0.5} .. math:: - :label: 11.115) + :label: 11.115 \mbox{root-length-density} = \dfrac{\mbox{total root length}}{\mbox{soil volume}} @@ -240,22 +268,22 @@ Water stress is calculated with distinct values for sunlit and shaded leaves. Vegetation water stress is calculated based on leaf water potential and is used to attenuate photosynthesis (see section :numref:`Photosynthesis`) .. math:: - :label: 11.201) + :label: 11.201 E_{sun} = E_{sun,max} \cdot 2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} .. math:: - :label: 11.202) + :label: 11.202 E_{shade} = E_{shade,max} \cdot 2^{-\left(\dfrac{\psi_{shadeleaf}}{p50_e}\right)^{c_k}} .. math:: - :label: 11.203) + :label: 11.203 \beta_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,\beta_t=1}} .. math:: - :label: 11.204) + :label: 11.204 \beta_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,\beta_t=1}} @@ -288,15 +316,15 @@ Vegetation water stress is calculated based on leaf water potential and is used Vegetation Water Potential ----------------------------- -Both plant water supply and demand are functions of vegetation water potential. PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential at each timestep. PHS iterates to find the vegetation water potential :math:`\psi` (vector) that satisfies continuity between the non-linear vegetation water supply and demand (equations :eq:`11.103)`, :eq:`11.104)`, :eq:`11.107)`, :eq:`11.109)`, :eq:`11.201)`, :eq:`11.202)`). +Both plant water supply and demand are functions of vegetation water potential. PHS explicitly models root, stem, shaded leaf, and sunlit leaf water potential at each timestep. PHS iterates to find the vegetation water potential :math:`\psi` (vector) that satisfies continuity between the non-linear vegetation water supply and demand (equations :eq:`11.103`, :eq:`11.104`, :eq:`11.107`, :eq:`11.109`, :eq:`11.201`, :eq:`11.202`). .. math:: - :label: 11.301) + :label: 11.301 \psi=\left[\psi_{sunleaf},\psi_{shadeleaf},\psi_{stem},\psi_{root}\right] .. math:: - :label: 11.302) + :label: 11.302 \begin{aligned} E_{sun}&=q_{1a}\\ @@ -306,7 +334,7 @@ Both plant water supply and demand are functions of vegetation water potential. &=\sum_{i=1}^{nlevsoi}{q_{3,i}} \end{aligned} -PHS finds the water potentials that match supply and demand. In the plant water transport equations :eq:`11.302)`, the demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy continuity :eq:`11.302)`. +PHS finds the water potentials that match supply and demand. In the plant water transport equations :eq:`11.302`, the demand terms (left-hand side) are decreasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, water stress increases, causing a decrease in transpiration demand. The supply terms (right-hand side) are increasing functions of absolute leaf water potential. As absolute leaf water potential becomes larger, the gradients in water potential increase, causing an increase in vegetation water supply. PHS takes a Newton's method approach to iteratively solve for the vegetation water potentials that satisfy continuity :eq:`11.302`. @@ -326,7 +354,7 @@ Using the attenuated transpiration, we solve for :math:`g_{s,stressed}` and outp The continuity of water flow through the system yields four equations .. math:: - :label: 11.401) + :label: 11.401 \begin{aligned} E_{sun}&=q_{1a}\\ @@ -339,7 +367,7 @@ The continuity of water flow through the system yields four equations We seek the set of vegetation water potential values, .. math:: - :label: 11.402) + :label: 11.402 \psi=\left[ \begin {array}{c} \psi_{sunleaf}\cr\psi_{shadeleaf}\cr\psi_{stem}\cr\psi_{root} @@ -349,7 +377,7 @@ that satisfies these equations, as forced by the soil moisture and atmospheric s Each flux on the schematic can be represented in terms of the relevant water potentials. Defining the transpiration fluxes: .. math:: - :label: 11.403) + :label: 11.403 \begin{aligned} E_{sun} &= E_{sun,max} \cdot 2^{-\left(\dfrac{\psi_{sunleaf}}{p50_e}\right)^{c_k}} \\ @@ -359,7 +387,7 @@ Each flux on the schematic can be represented in terms of the relevant water pot Defining the water supply fluxes: .. math:: - :label: 11.404) + :label: 11.404 \begin{aligned} q_{1a}&=k_{1a,max}\cdot 2^{-\left(\dfrac{\psi_{stem}}{p50_1}\right)^{c_k}} \cdot\mbox{LAI}_{sun}\cdot\left(\psi_{stem}-\psi_{sunleaf} \right) \\ @@ -375,7 +403,7 @@ The initial guess is the solution for :math:`\psi` (vector) from the previous ti The general framework, from iteration `m` to `m+1` is: .. math:: - :label: 11.405) + :label: 11.405 q^{m+1}=q^m+\dfrac{\delta q}{\delta\psi}\Delta\psi \\ \psi^{m+1}=\psi^{m}+\Delta\psi @@ -383,28 +411,28 @@ The general framework, from iteration `m` to `m+1` is: So for our first flux balance equation, at iteration `m+1`, we have: .. math:: - :label: 11.406) + :label: 11.406 E_{sun}^{m+1}=q_{1a}^{m+1} Which can be linearized to: .. math:: - :label: 11.407) + :label: 11.407 E_{sun}^{m}+\dfrac{\delta E_{sun}}{\delta\psi}\Delta\psi=q_{1a}^{m}+\dfrac{\delta q_{1a}}{\delta\psi}\Delta\psi And rearranged to be: .. math:: - :label: 11.408) + :label: 11.408 \dfrac{\delta q_{1a}}{\delta\psi}\Delta\psi-\dfrac{\delta E_{sun}}{\delta\psi}\Delta\psi=E_{sun}^{m}-q_{1a}^{m} And for the other 3 flux balance equations: .. math:: - :label: 11.409) + :label: 11.409 \begin{aligned} \dfrac{\delta q_{1b}}{\delta\psi}\Delta\psi-\dfrac{\delta E_{sha}}{\delta\psi}\Delta\psi&=E_{sha}^{m}-q_{1b}^{m} \\ @@ -415,7 +443,7 @@ And for the other 3 flux balance equations: Putting all four together in matrix form: .. math:: - :label: 11.410) + :label: 11.410 \left[ \begin {array}{c} \dfrac{\delta q_{1a}}{\delta\psi}-\dfrac{\delta E_{sun}}{\delta\psi} \cr @@ -437,7 +465,7 @@ Introducing the notation: :math:`A\Delta\psi=b` .. math:: - :label: 11.411) + :label: 11.411 \Delta\psi=\left[ \begin {array}{c} \Delta\psi_{sunleaf} \cr @@ -447,7 +475,7 @@ Introducing the notation: \end {array} \right] .. math:: - :label: 11.412) + :label: 11.412 A= \left[ \begin {array}{cccc} @@ -461,7 +489,7 @@ Introducing the notation: \end {array} \right] .. math:: - :label: 11.413) + :label: 11.413 b= \left[ \begin {array}{c} @@ -474,12 +502,12 @@ Introducing the notation: Now we compute all the entries for :math:`A` and :math:`b` based on the soil moisture and maximum transpiration forcings and can solve to find: .. math:: - :label: 11.414) + :label: 11.414 \Delta\psi=A^{-1}b .. math:: - :label: 11.415) + :label: 11.415 \psi_{m+1}=\psi_m+\Delta\psi @@ -489,12 +517,12 @@ The magnitude of the water flux is driven by soil matric potential and unstresse We use the transpiration solution (corresponding to the final solution for :math:`\psi`) to compute stomatal conductance. The stomatal conductance is then used to compute :math:`\beta_t`. .. math:: - :label: 11.416) + :label: 11.416 \beta_{t,sun} = \dfrac{g_{s,sun}}{g_{s,sun,\beta_t=1}} .. math:: - :label: 11.417) + :label: 11.417 \beta_{t,shade} = \dfrac{g_{s,shade}}{g_{s,shade,\beta_t=1}} @@ -554,4 +582,4 @@ Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us about respon .. _Williamsetal1996: -Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere continuum in a Quercus–Acer stand at Harvard Forest: the regulation of stomatal conductance by light, nitrogen and soil/plant hydraulic properties. Plant, Cell & Environment, 19: 911–927. doi:10.1111/j.1365-3040.1996.tb00456.x \ No newline at end of file +Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere continuum in a Quercus–Acer stand at Harvard Forest: the regulation of stomatal conductance by light, nitrogen and soil/plant hydraulic properties. Plant, Cell & Environment, 19: 911–927. doi:10.1111/j.1365-3040.1996.tb00456.x diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 74a39e908b..a05aa6210b 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -23,7 +23,7 @@ CLM Technical Note Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst - Plant_Hydraulic_Stress/CLM50_Tech_Note_Plant_Hydraulic_Stress.rst + Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst Lake/CLM50_Tech_Note_Lake.rst Glacier/CLM50_Tech_Note_Glacier.rst RTM/CLM50_Tech_Note_RTM.rst @@ -43,6 +43,6 @@ CLM Technical Note BVOCs/CLM50_Tech_Note_BVOCs.rst Dust/CLM50_Tech_Note_Dust.rst Isotopes/CLM50_Tech_Note_Isotopes.rst - Offline/CLM50_Tech_Note_Offline.rst + Land-Only_Mode/CLM50_Tech_Note_Land-Only_Mode.rst References/CLM50_Tech_Note_References.rst From 92a6e84f18a271ad58fcbb5f44d1212cccf18df5 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 9 Jun 2017 09:37:02 -0600 Subject: [PATCH 060/730] Update Photosynthetic Capacity --- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 380 ++++++++++++------ 1 file changed, 256 insertions(+), 124 deletions(-) mode change 100644 => 100755 doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst old mode 100644 new mode 100755 index 803964c6df..0f24520566 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -1,124 +1,256 @@ -.. _rst_Photosynthetic Capacity: - -Photosynthetic Capacity -======================= - -.. _V\ :sub:`cmax25` and Canopy scaling: - -V\ :sub:`cmax25` and Canopy scaling --------------------------------------------- - -The maximum rate of carboxylation at 25 :sup:`o`\ C varies with -foliage nitrogen concentration and specific leaf area and is calculated -as in Thornton and Zimmermann (2007). At 25ºC, - -.. math:: - :label: ZEqnNum217783 - - V_{c\max 25} =N_{a} F_{LNR} F_{NR} a_{R25} - -where :math:`N_{a}` is the area-based leaf nitrogen concentration (g N -m\ :sup:`-2` leaf area), :math:`F_{LNR}` is the fraction of leaf -nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), -:math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass -to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and -:math:`a_{R25} =60` is the specific activity of Rubisco (µmol -CO\ :sub:`2` g\ :sup:`-1` Rubisco s\ :sup:`-1`). -:math:`N_{a}` is calculated from mass-based leaf N concentration and -specific leaf area - -.. math:: - :label: ZEqnNum561340 - - N_{a} =\frac{1}{CN_{L} \; SLA_{0} } - -where :math:`CN_{L}` is the leaf carbon-to-nitrogen ratio (g C -g\ :sup:`-1` N) and :math:`SLA_{0}` is specific leaf area at the -canopy top ( m\ :sup:`2` leaf area g\ :sup:`-1` C ). Table 8.1 -lists values of :math:`F_{LNR}` , :math:`CN_{L}` , and :math:`SLA_{0}` -for each plant functional type. :math:`F_{LNR}` was chosen to give -:math:`V_{c\max 25}` consistent with Kattge et al. (2009), as discussed -by Bonan et al. (2011, 2012). Table 8.1 lists derived values for -:math:`V_{c\max 25}` at the top of the canopy using :math:`SLA_{0}` . -Tropical broadleaf evergreen trees are an exception, and a higher -:math:`V_{c\max 25}` is used to alleviate model biases (Bonan et al. -2012). - -:math:`V_{c\max 25}` is calculated separately for sunlit and shaded -leaves using an exponential profile to area-based leaf nitrogen -(:math:`N_{a}` ), as in Bonan et al. (2011). :math:`V_{c\max 25}` at -cumulative leaf area index :math:`x` from the canopy top scales directly -with :math:`N_{a}` , which decreases exponentially with greater -cumulative leaf area, so that - -.. math:: - :label: ZEqnNum745439 - - V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} - -where :math:`V_{c\; \max 25}^{} \left(0\right)` is defined at the top of -the canopy using :math:`SLA_{0}` , and :math:`K_{n}` is the decay -coefficient for nitrogen. The canopy integrated value for sunlit and -shaded leaves is - -.. math:: - :label: 9.20) - - \begin{array}{rcl} {V_{c\; \max 25}^{sun} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)f_{sun} \left(x\right)\, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} } \end{array} - -.. math:: - :label: 9.21) - - \begin{array}{rcl} {V_{c\; \max 25}^{sha} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)\left[1-f_{sun} \left(x\right)\right] \, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left\{\left[1-e^{-K_{n} L} \right]\frac{1}{K_{n} } -\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} \right\}} \end{array} - -and the average value for the sunlit and shaded leaves is - -.. math:: - :label: 9.22) - - \bar{V}_{c\; \max 25}^{sun} ={V_{c\; \max 25}^{sun} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sun} L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } - -.. math:: - :label: 9.23) - - \bar{V}_{c\; \max 25}^{sha} ={V_{c\; \max 25}^{sha} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sha} L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } . - -This integration is over all leaf area (:math:`L`) with -:math:`f_{sun} (x)=\exp \left(-Kx\right)` and :math:`K` the direct beam -extinction coefficient (equation 4.9). Photosynthetic parameters -:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and -:math:`R_{d25}` scale similarly. - -The value :math:`K_{n} = 0.11` chosen by Bonan et al. (2011) is -consistent with observationally-derived estimates for forests, mostly -tropical, and provides a gradient in V\ :sub:`cmax` similar to -the original CLM4 specific leaf area scaling. However, Bonan et al. -(2012) showed that the sunlit/shaded canopy parameterization does not -match an explicit multi-layer canopy parameterization. The discrepancy -arises from absorption of scattered radiation by shaded leaves and can -be tuned out with higher :math:`K_{n}` . The model uses -:math:`K_{n} =0.30` to match an explicit multi-layer canopy. - -:math:`V_{c\max 25}` additionally varies with daylength (:math:`DYL`) -using the function :math:`f(DYL)`, which introduces seasonal variation -to :math:`V_{c\max }` - -.. math:: - :label: 9.24) - - f\left(DYL\right)=\frac{\left(DYL\right)^{2} }{\left(DYL_{\max } \right)^{2} } - -with :math:`0.01\le f\left(DYL\right)\le 1`. Daylength (seconds) is -given by - -.. math:: - :label: 9.25) - - DYL=2\times 13750.9871\cos ^{-1} \left[\frac{-\sin \left(lat\right)\sin \left(decl\right)}{\cos \left(lat\right)\cos \left(decl\right)} \right] - -where :math:`lat` (latitude) and :math:`decl` (declination angle) are -from section 3.3. Maximum daylength (:math:`DYL_{\max }` ) is calculated -similarly but using the maximum declination angle for present-day -orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], -positive for Northern Hemisphere latitudes and negative for Southern -Hemisphere). +.. _rst_Photosynthetic Capacity: + +Photosynthetic Capacity +======================= + +The photosynthetic capacity is represented by two key parameters: 1) the maximum rate of carboxylation at +25 :sup:`o`\ C, :math:`V_{\text{c,max25}}`; and 2) the maximum rate of electron transport at +25 :sup:`o`\ C, :math:`J_{\text{max25}}` . They are predicted by a mechanistic model of leaf +utilization of nitrogen for assimilation (LUNA V1.0) (Ali et al. 2016) based on an optimality hypothesis to nitrogen allocation +among light capture, electron transport, carboxylation, respiration and storage. +Specifically, the model allocates the nitrogen by maximizing the daily +net photosynthetic carbon gain under following two key assumptions: + +- nitrogen allocated for light capture, electron transport and carboxylation are co-limiting; +- respiratory nitrogen is allocated to maintain dark respiration determined by :math:`V_{\text{c,max}}`. + +Compared to traditional photosynthetic capacity models, a key advantage of LUNA is that the model is able to predict the potential +acclimation of photosynthetic capacities at different environmental conditions as determined by temperature, radiation, +CO :sub:`2` concentrations, day length, and humidity. + +.. _Model inputs and parameter estimations: + +Model inputs and parameter estimations +------------------------------------------------------- +The LUNA model includes the following four unitless parameters: + +- :math:`J_{maxb0}` , which specifies the baseline proportion of nitrogen allocated for electron transport; +- :math:`J_{maxb1}` , which determines response of electron transport rate to light availability; +- :math:`t_{c,j0}` , which defines the baseline ratio of Rubisco-limited rate to light-limited rate; +- :math:`H` , which determines the response of electron transport rate to relative humidity. + +The above four parameters are estimated by fitting the LUNA model to a global compilation of >800 obervations +located at different biomes, canopy locations, and time of the year from 1993-2013 (Ali et al 2015). The model inputs +are area-based leaf nitrogen content, leaf mass per unit leaf area and the driving environmental conditions (average of past 10 days) +including temperature, CO :sub:`2` concentrations, daily mean and maximum radiation, relative humidity and day length. +The estimated values in CLM5 for the listed parameters are 0.0311, 0.1745, 0.8054, and 6.0999, repectively. In LUNA V1.0, the estimated +parameter values are for C3 natural vegetations. In view that potentially large differences in photosythetic capacity could exist +between crops and natural vegetations due to human selection and genetic modifications, in CLM5, +the LUNA model are used only for C3 natural vegetations. The photosynthetic capacity for crops and C4 plants are thus +still kept the same as CLM4.5. Namely, it is estimated based on the leaf nitrogen content, fixed RUBISCO allocations for +:math:`V_{c\max 25}` and an adjusting factor to account for the impact of day length. In CLM5, the model simulates both sun-lit and shaded leaves; +however, because the sun-lit and shaded leaves can changes through the day based on the sun angles, +we do not differentiate the photosynthetic capacity difference for sun-lit or shaded leaves. + + +.. _Model structure: + +Model structure +---------------------------------------------------------- + +The structure of the LUNA model is adapted from Xu et al.(2012), where the plant nitrogen at the leaf level ( :math:`\text{LNC}_{a}`; gN/ m :sup:`2` leaf) is divided into +four pools: structural nitrogen( :math:`N_{\text{str}}`; gN/m :sup:`2` leaf), +photosynthetic nitrogen ( :math:`N_{\text{psn}}`; gN/ m:sup:`2` leaf), +storage nitrogen( :math:`N_{\text{store}}`; gN/m :sup:`2` leaf), +and respiratory nitrogen ( :math:`N_{\text{resp}}`; gN/m :sup:`2` leaf). +Namely, + +.. math:: + :label: 10.1) + + \text{LNC}_{a} = N_{\text{psn}} + N_{\text{str}}+ N_{\text{store}} + N_{\text{resp}}. + +The photosynthetic nitrogen, :math:`N_{\text{psn}}`, is further divided into +nitrogen for light capture ( :math:`N_{\text{lc}}`; gN/m :sup:`2` leaf), +nitrogen for electron transport ( :math:`N_{\text{et}}`; gN/m :sup:`2` leaf), +and nitrogen for carboxylation ( :math:`N_{\text{cb}}`; gN/m :sup:`2` leaf). +Namely, + +.. math:: + :label: 10.2) + + N_{\text{psn}} =N_{\text{et}} + N_{\text{cb}} + N_{\text{lc}}. + +The structural nitrogen, :math:`N_{\text{str}}`, is calculated as the +multiplication of leaf mass per unit area (LMA: g biomass/m :sup:`2` leaf), and the structural nitrogen content (SNC; gN/g biomass). Namely, + +.. math:: + :label: 10.3) + + N_{\text{str}} = \text{SNC} \cdot \text{LMA} + +where SNC is set to be fixed at 0.002 (gN/g biomass), based on data on C:N ratio from dead wood (White etal.,2000). + +We assume that plants optimize their nitrogen allocations (i.e., :math:`N_{\text{store}}`, :math:`N_{\text{resp}}`, :math:`N_{\text{lc}}`, :math:`N_{\text{et}}`, :math:`N_{\text{cb}}`) to maximize the photosynthetic carbon gain, defined as +the gross photosynthesis ( :math:`A` ) minus the maintenance respiration for +photosynthetic enzymes ( :math:`R_{\text{psn}}` ), under specific +environmental conditions and given plant's strategy of leaf nitrogen +use. Namely, the solutions of nitrogen allocations \{ :math:`N_{\text{store}}`, :math:`N_{\text{resp}}`, :math:`N_{\text{lc}}`, :math:`N_{\text{et}}`, :math:`N_{\text{cb}}` \} can be estimated as follows, + +.. math:: + :label: 10.4) + + \left\{\hat{N}_{\text{{store}}}, \hat{N}_{\text{{resp}}}, + \hat{\mathrm{N}}_{\text{lc}}, \hat{N}_{\text{et}}, \hat{\mathrm{N}}_{\text{cb}} + \right\} = \underset{\mathrm{N}_{\text{store}}\,+\,\mathrm{N}_{\text{resp}}\,+\,\mathrm{N}_{\text{lc}}\,+\,\mathrm{N}_{\text{et}}\,+\,\mathrm{N}_{\text{cb}}\,<\text{FNC}_{\mathrm{a}}}{\text{argmax}} (A-R_{\text{psn}}), + +where :math:`\text{FNC}_{a}` is the functional nitrogen content defined as the total leaf nitrogen content ( :math:`\text{LNC}_{a}`) minus the structural nitrogen content ( :math:`N_{\text{str}}` ). + +The gross photosynthesis, :math:`A`, was calculated with a coupled leaf gas exchange model based on the Farquhar et al. (1980) model of +photosynthesis and Ball--Berry-type stomatal conductance model (Ball et al., 1987). The maintenance respiration for photosynthetic enzymes, :math:`R_{\text{psn}}`, is +calculated by the multiplication of total photosynthetic nitrogen ( :math:`N_{\text{psn}}` ) and the maintenance respiration cost for photosynthetic enzymes. + +In the LUNA model, the maximum electron transport rate +( :math:`J_{\text{max}}`; :math:`{\mu} mol` electron / m :sup:`-2`/s) +is simulated to have a baseline allocation of nitrogen and additional +nitrogen allocation to change depending on the average daytime +photosynthetic active radiation (PAR; :math:`{\mu} mol` electron / m :sup:`-2`/s), day length (hours) and air humidity. +Specifically, the LUNA model has + +.. math:: + :label: 10.5) + + J_{\text{{max}}} = J_{\text{max}0} + J_{\text{max}b1} + f\left(\text{day length} \right)f\left(\text{humidity} + \right)\alpha \text{PAR} + +The baseline electron transport rate, :math:`J_{\text{max}0}`, is calculated as follows, + +.. math:: + :label: 10.6) + + J_{\text{max}0} = J_{\text{max}b0}{\text{FNC}}_{\mathrm{a}}{\text{NUE}}_{J_{\text{{max}}}} + + +where :math:`J_{\text{max}b0}` (unitless) is the baseline proportion of nitrogen +allocated for electron transport rate. :math:`{\text{NUE}}_{J_{\text{{max}}}}` ( :math:`{\mu} mol` electron /s/g N) +is the nitrogen use efficiency of :math:`J_{\text{{max}}}`. :math:`J_{\text{max}b1}` (unitless) is a coefficient determining the response of the electron +transport rate to amount of absorbed light (i.e., :math:`\alpha \text{PAR}`). +:math:`f\left(\text{day length} \right)` is a function specifies the impact of day +length (hours) on :math:`J_{\text{max}}` in view that longer day length has been demonstrated by previous studies to alter :math:`V_{\mathrm{c}\text{max}25}` and +:math:`J_{\text{max}25}` (Bauerle et al., 2012; Comstock and Ehleringer, 1986) through photoperiod sensing and regulation (e.g. Song et al., 2013). +Following Bauerle et al. (2012), :math:`f\left(\text{day length} \right)` is simulated as follows, + +.. math:: + :label: 10.7) + + f\left(\text{day length} \right) = \left(\frac{\text{day length}}{12} \right)^{2}. + +:math:`f\left(\text{humidity} \right)` represents the impact of air humitidy on +:math:`J_{\text{{max}}}`. We assume that higher humidity leads to higher +:math:`J_{\text{{max}}}` with less water limiation on stomta opening and that low +relative humidity has a stronger impact on nitrogen allocation due to greater +water limitation. When relative humidity (RH; unitless) is too low, we assume +that plants are physiologically unable to reallocate nitrogen. We therefore +assume that there exists a critical value of relative humidity ( :math:`RH_{0} = +0.25`; unitless), below which there is no optimal nitrogen allocation. Based +on the above assumptions, we have + +.. math:: + :label: 10.8) + + f\left(\text{humidity} + \right) = \left(1-\mathrm{e}^{\left(-H + \frac{\text{max}\left(\text{RH}-{\text{RH}}_{0}, 0 \right)}{1-\text{RH}_{0}} \right)} \right), + + +where :math:`H` (unitless) specifies the impact of relative humidity on electron transport rate. + +The efficiency of light energy absorption (unitless), :math:`\alpha`, is calculated +depending on the amount of nitrogen allocated for light capture, +:math:`\mathrm{N}_{\text{lc}}`. Following Niinemets and Tenhunen (1997), the LUNA model has, + +.. math:: + :label: 10.9) + + \alpha =\frac{0.292}{1+\frac{0.076}{\mathrm{N}_{\text{lc}}C_{b}}} + + +where 0.292 is the conversion factor from photon to electron. :math:`C_{b}` +is the conversion factor (1.78) from nitrogen to chlorophyll. After we +estimate :math:`J_{\text{{max}}}`, the actual electron transport rate with +the daily maximum radiation ( :math:`J_{x}`) can be calculated using the +empirical expression of leaf (1937), + +.. math:: + :label: 10.10) + + J_{x} = \frac{\alpha \text{PAR}_{\text{max}}} {\left(1 + \frac{\alpha^{2}{\text{PAR}}_{\text{{max}}}^{2}}{J_{\text{{max}}}^{2}} + \right)^{0.5}} + + +where :math:`\text{PAR}_{\text{{max}}}` ( :math:`\mu mol`/m :sup:`2`/s) is the +maximum photosynthetically active radiation during the day. + + +Based on Farquhar et al. (1980) and Wullschleger (1993), we can calculate the +electron-limited photosynthetic rate under daily maximum radiation ( :math:`W_{jx}`) +and the Rubisco-limited photosynthetic rate ( :math:`W_{\mathrm{c}}`) as follows, + + +.. math:: + :label: 10.11) + + W_{J_{x}} = K_{j}J_{x} , + +.. math:: + :label: 10.12) + + W_{\mathrm{c}} = K_{\mathrm{c}} V_{{\mathrm{c}, \text{max}}}, + + +where :math:`K_{j}` and :math:`K_{\mathrm{c}}` as the conversion factors for +:math:`J_{x}` and :math:`V_{{\mathrm{c}, \text{max}}}` ( :math:`V_{{\mathrm{c}, \text{max}}}` to +:math:`W_{\mathrm{c}}` and :math:`J_{x}` to :math:`W_{J_{x}}`), respectively. Based on +Xu et al. (2012), Maire et al. (2012) and Walker et al. (2014), we +assume that :math:`W_{\mathrm{c}}` is proportional to +:math:`W_{J_{x}}`. Specifically, we have + +.. math:: + :label: 10.13) + + W_{\mathrm{c}}=t_{\alpha}t_{\mathrm{c}, j0}W_{J_{x}} + + +where :math:`t_{\mathrm{c}, j0}` is the baseline ratio of :math:`W_{\mathrm{c}}` to +:math:`W_{J_{x}}`. We recognize that this ratio may change depending on the +nitrogen use efficiency of carboxylation and electron transport (Ainsworth and Rogers, 2007), +therefore the LUNA model has the modification factor, :math:`t_{\alpha}`, to adjust baseline +the ratio depending on the nitrogen use efficiency for electron vs carboxylation (Ali et al 2016). + +Following Collatz et al.(1991a), the total respiration ( :math:`R_{\mathrm{t}}`) is +calculated in proportion to :math:`V_{\text{c,max}}`, + +.. math:: + :label: 10.14) + + R_{\mathrm{t}} = 0.015 V_{\text{c,max}}. + + +Accounting for the daytime and nighttime temperature, the daily respirations is calculated as follows, + + +.. math:: + :label: 10.15) + + + R_{\text{td}}={R}_{\mathrm{t}} [D_{\text{day}} + D_{\text{night}} f_{\mathrm{r}}{(T_{\text{night}})/f_{\mathrm{r}}{(T_{\text{day}})}}], + + +where :math:`D_{\text{day}}` and :math:`D_{\text{night}}` are daytime and +nighttime durations in seconds. :math:`f_{\mathrm{r}}(T_{\text{night}})` and +:math:`f_{\mathrm{r}}(T_{\text{day}})` are the temperature response functions for +respiration [see Appendix B in Ali et al (2016) for details ]. + + +.. _Numerical scheme: + +Numerical scheme +--------------------------------------------------------- + +The LUNA model searches for the "optimal" nitrogen allocations for maximum net photosynthetic carbon gain +by incrementally increase the nitrogen allocated for light capture (i.e., :math:`N_{\text{lc}}`) (see Ali et al 2016 for details) . +We assume that plants only optimize the nitrogen allocation when they can grow (i.e., GPP>0.0). +If GPP become zero under stress, then the LUNA model assume a certain amount of enzyme will decay at daily rates of 0.1, +in view that the half-life time for photosynthetic enzymes are short (~7 days) (Suzuki et al. 2001). +To avoid unrealistic low values of photosynthetic capacity, the decay is only limited to 50 percent of the original enzyme levels. \ No newline at end of file From 11fd281ef02e33f454588105da8812db342b92c5 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 9 Jun 2017 11:00:43 -0600 Subject: [PATCH 061/730] Move root profile --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 4 +- .../CLM50_Tech_Note_Introduction.rst | 6 +- .../CLM50_Tech_Note_Photosynthesis.rst | 71 ------ .../CLM50_Tech_Note_Plant_Hydraulics.rst | 214 ++++++++++++++++-- .../References/CLM50_Tech_Note_References.rst | 5 + 5 files changed, 200 insertions(+), 100 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index e8b78225dc..d5f9b85560 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -404,8 +404,8 @@ Atmospheric Coupling The current state of the atmosphere (:numref:`Table Atmospheric input to land model`) at a given time step is used to force the land model. This atmospheric state is provided by an -atmospheric model in coupled mode or from an observed dataset in offline -mode (Chapter :numref:`rst_Offline Mode`). The land model then initiates a full set of +atmospheric model in coupled mode or from an observed dataset in land-only +mode (Chapter :numref:`rst_Land-Only Mode`). The land model then initiates a full set of calculations for surface energy, constituent, momentum, and radiative fluxes. The land model calculations are implemented in two steps. The land model proceeds with the calculation of surface energy, constituent, diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 48452d358f..ed7a66f332 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -485,11 +485,11 @@ canyon model to contrast rural and urban energy balance and climate Other modifications of note include refinement of the global PFT, wetland, and lake distributions, more realistic optical properties for grasslands and croplands, and an improved diurnal cycle and spectral -distribution of incoming solar radiation to force the model in offline +distribution of incoming solar radiation to force the model in land-only mode. Many of the ideas incorporated into the carbon and nitrogen cycle -component of CLM4 derive from the earlier development of the offline +component of CLM4 derive from the earlier development of the land-only ecosystem process model Biome-BGC (Biome BioGeochemical Cycles), originating at the Numerical Terradynamic Simulation Group (NTSG) at the University of Montana, under the guidance of Prof. Steven Running. @@ -601,7 +601,7 @@ CLM4 to create CLM4 surface datasets is replaced with newer and higher resolution input datasets where possible (see section :numref:`Surface Data` for details). The default meteorological forcing dataset provided with CLM4 (:ref:`Qian et al. 2006)` is replaced with the 1901-2010 -CRUNCEP forcing dataset (see Chapter :numref:`rst_Offline Mode`) for CLM4.5, +CRUNCEP forcing dataset (see Chapter :numref:`rst_Land-Only Mode`) for CLM4.5, though users can also still use the :ref:`Qian et al. (2006)` dataset or other alternative forcing datasets. diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 70fa76baf7..d50b90a814 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -552,77 +552,6 @@ water contents (kg m\ :sup:`-2`) (Chapter 7), densities of ice and liquid water (kg m\ :sup:`-3`) (Table 2.6), and :math:`\Delta z_{i}` is the soil layer thickness (m) (section 6.1). -The root fraction :math:`r_{i}` in each soil layer depends on the plant -functional type - -.. math:: - :label: 9.30) - - r_{i} =\left\{\begin{array}{l} {0.5\left[\begin{array}{l} {\exp \left(-r_{a} z_{h,\, i-1} \right)+\exp \left(-r_{b} z_{h,\, i-1} \right)-} \\ {\exp \left(-r_{a} z_{h,\, i} \right)-\exp \left(-r_{b} z_{h,\, i} \right)} \end{array}\right]\qquad {\rm for\; }1\le i` -(:numref:`Table Plant functional type root distribution parameters`). - -.. _Table Plant functional type root distribution parameters: - -.. table:: Plant functional type root distribution parameters - - +----------------------------------+------------------+------------------+ - | Plant Functional Type | :math:`r_{a}` | :math:`r_{b}` | - +==================================+==================+==================+ - | NET Temperate | 7.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | NET Boreal | 7.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | NDT Boreal | 7.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | BET Tropical | 7.0 | 1.0 | - +----------------------------------+------------------+------------------+ - | BET temperate | 7.0 | 1.0 | - +----------------------------------+------------------+------------------+ - | BDT tropical | 6.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | BDT temperate | 6.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | BDT boreal | 6.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | BES temperate | 7.0 | 1.5 | - +----------------------------------+------------------+------------------+ - | BDS temperate | 7.0 | 1.5 | - +----------------------------------+------------------+------------------+ - | BDS boreal | 7.0 | 1.5 | - +----------------------------------+------------------+------------------+ - | C\ :sub:`3` grass arctic | 11.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | C\ :sub:`3` grass | 11.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | C\ :sub:`4` grass | 11.0 | 2.0 | - +----------------------------------+------------------+------------------+ - | Crop R | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Crop I | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Corn R | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Corn I | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Temp Cereal R | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Temp Cereal I | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Winter Cereal R | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Winter Cereal I | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Soybean R | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - | Soybean I | 6.0 | 3.0 | - +----------------------------------+------------------+------------------+ - .. _Numerical implementation photosynthesis: Numerical implementation diff --git a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst index 60bfc568ef..703f9b8ed9 100644 --- a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst +++ b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst @@ -3,11 +3,140 @@ Plant Hydraulics ====================== -.. _Rooting Profiles: +.. _Roots: -Rooting Profiles +Roots ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. _Vertical Root Distribution: + +Vertical Root Distribution +--------------------------- + +The root fraction :math:`r_{i}` in each soil layer depends on the plant +functional type + +.. math:: + :label: 11.1 + + r_{i} = + \begin{array}{lr} + \left(\beta^{z_{h,\, i-1} \cdot 100} - \beta^{z_{h,\, i} \cdot 100} \right) & \qquad {\rm for\; }1 \le i \le N_{levsoi} + \end{array} + +where :math:`z_{h,\, i}` (m) is the depth from the soil surface to the +interface between layers :math:`i` and :math:`i+1` (:math:`z_{h,\, 0}` , +the soil surface) (section :numref:`Vertical Discretization`), the factor of 100 +converts from m to cm, and :math:`\beta` is a plant-dependent root +distribution parameter adopted from :ref:`Jackson et al. (1996)` +(:numref:`Table Plant functional type root distribution parameters`). + +.. rootfr(p,lev) = ( & + beta ** (col%zi(c,lev-1)*m_to_cm) - & + beta ** (col%zi(c,lev)*m_to_cm) ) + +.. 0, 0.976, 0.943, 0.943, 0.993, 0.966, 0.993, 0.966, 0.943, 0.964, 0.964, + 0.914, 0.914, 0.943, 0.943, 0.943, 0.943, 0.943, 0.943, 0.943, 0.943, + +.. _Table Plant functional type root distribution parameters: + +.. table:: Plant functional type root distribution parameters + + +----------------------------------+------------------+ + | Plant Functional Type | :math:`\beta` | + +==================================+==================+ + | NET Temperate | 0.976 | + +----------------------------------+------------------+ + | NET Boreal | 0.943 | + +----------------------------------+------------------+ + | NDT Boreal | 0.943 | + +----------------------------------+------------------+ + | BET Tropical | 0.993 | + +----------------------------------+------------------+ + | BET temperate | 0.966 | + +----------------------------------+------------------+ + | BDT tropical | 0.993 | + +----------------------------------+------------------+ + | BDT temperate | 0.966 | + +----------------------------------+------------------+ + | BDT boreal | 0.943 | + +----------------------------------+------------------+ + | BES temperate | 0.964 | + +----------------------------------+------------------+ + | BDS temperate | 0.964 | + +----------------------------------+------------------+ + | BDS boreal | 0.914 | + +----------------------------------+------------------+ + | C\ :sub:`3` grass arctic | 0.914 | + +----------------------------------+------------------+ + | C\ :sub:`3` grass | 0.943 | + +----------------------------------+------------------+ + | C\ :sub:`4` grass | 0.943 | + +----------------------------------+------------------+ + | Crop R | 0.943 | + +----------------------------------+------------------+ + | Crop I | 0.943 | + +----------------------------------+------------------+ + | Corn R | 0.943 | + +----------------------------------+------------------+ + | Corn I | 0.943 | + +----------------------------------+------------------+ + | Temp Cereal R | 0.943 | + +----------------------------------+------------------+ + | Temp Cereal I | 0.943 | + +----------------------------------+------------------+ + | Winter Cereal R | 0.943 | + +----------------------------------+------------------+ + | Winter Cereal I | 0.943 | + +----------------------------------+------------------+ + | Soybean R | 0.943 | + +----------------------------------+------------------+ + | Soybean I | 0.943 | + +----------------------------------+------------------+ + +.. _Root Spacing: + +Root Spacing +----------------------------- + +To determine the conductance along the soil to root pathway (section +:numref:`Soil-to-root`) an estimate of the spacing between the roots within +a soil layer is required. The distance between roots :math:`dx_{root,i}` (m) +is calculated by assuming that roots are distributed uniformly throughout +the soil (:ref:`Gardner 1960`) + +.. math:: + :label: 11.12 + + dx_{root,i} = \left(\pi \cdot L_i\right)^{\frac{1}{2}} + +where :math:`L_{i}` is the root length density (m m :sup:`-3`) + +.. math:: + :label: 11.13 + + L_{i} = \frac{B_{root,i}}{\rho_{root} {CA}_{root}} \ , + +:math:`B_{root,i}` is the root biomass density (kg m :sup:`-3`) + +.. math:: + :label: 11.14 + + B_{root,i} = \frac{c\_to\_b \cdot C_{fineroot} \cdot r_{i}}{dz_{i}} + +where :math:`c\_to\_b = 2` (kg biomass kg carbon :sup:`-1`) and +:math:`C_{fineroot}` is the amount of fine root carbon (kg m :sup:`-2`). + +:math:`\rho_{root}` is the root density (kg m :sup:`-3`), and +:math:`{CA}_{root}` is the fine root cross sectional area (m :sup:`2`) + +.. math:: + :label: 11.15 + + CA_{root} = \pi r_{root}^{2} + +where :math:`r_{root}` is the root radius (m). + .. _Plant Hydraulic Stress: Plant Hydraulic Stress @@ -88,10 +217,21 @@ conductivity (:math:`p50`) and a shape fitting parameter (:math:`c_k`). Stem-to-leaf '''''''''''''''''''''''' -The area basis and conductance parameterization varies by segment. There are two stem-to-leaf fluxes in parallel, from stem to sunlit leaf and from stem to shaded leaf (:math:`q_{1a}` and :math:`q_{1a}`). -The water flux from stem-to-leaf is the product of the segment conductance, the conducting area basis, and the water potential gradient from stem to leaf. Stem-to-leaf conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve. -The maximum conductance is a PFT parameter representing the maximum conductance of water from stem to leaf per unit leaf area. -This parameter can be defined separately for sunlit and shaded segments and should already include the appropriate length scaling (in other words this is a conductance, not conductivity). The water potential gradient is the difference between leaf water potential and stem water potential. There is no gravity term, assuming a negligible difference in height across the segment. The area basis is the leaf area index (either sunlit or shaded). +The area basis and conductance parameterization varies by segment. There +are two stem-to-leaf fluxes in parallel, from stem to sunlit leaf and from +stem to shaded leaf (:math:`q_{1a}` and :math:`q_{1a}`). The water flux from +stem-to-leaf is the product of the segment conductance, the conducting area +basis, and the water potential gradient from stem to leaf. Stem-to-leaf +conductance is defined as the maximum conductance multiplied by the percent +of maximum conductance, as calculated by the sigmoidal vulnerability curve. +The maximum conductance is a PFT parameter representing the maximum +conductance of water from stem to leaf per unit leaf area. This parameter +can be defined separately for sunlit and shaded segments and should already +include the appropriate length scaling (in other words this is a conductance, +not conductivity). The water potential gradient is the difference between +leaf water potential and stem water potential. There is no gravity term, +assuming a negligible difference in height across the segment. The area +basis is the leaf area index (either sunlit or shaded). .. math:: :label: 11.103 @@ -144,7 +284,18 @@ Parameters: Root-to-stem '''''''''''''''''''''''' -There is one root-to-stem flux. This represents a flux from the root collar to the upper branch reaches. The water flux from root-to-stem is the product of the segment conductance, the conducting area basis, and the water potential gradient from root to stem. Root-to-stem conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve (two parameters). The maximum conductance is defined as the maximum root-to-stem conductivity per unit stem area (PFT parameter) divided by the length of the conducting path, which is taken to be the vegetation height. The area basis is the stem area index. The gradient in water potential is the difference between the root water potential and the stem water potential less the difference in gravitational potential. +There is one root-to-stem flux. This represents a flux from the root collar +to the upper branch reaches. The water flux from root-to-stem is the product +of the segment conductance, the conducting area basis, and the water +potential gradient from root to stem. Root-to-stem conductance is defined +as the maximum conductance multiplied by the percent of maximum conductance, +as calculated by the sigmoidal vulnerability curve (two parameters). The +maximum conductance is defined as the maximum root-to-stem conductivity per +unit stem area (PFT parameter) divided by the length of the conducting path, +which is taken to be the vegetation height. The area basis is the stem area +index. The gradient in water potential is the difference between the root +water potential and the stem water potential less the difference in +gravitational potential. .. math:: :label: 11.107 @@ -181,13 +332,38 @@ Parameters: Soil-to-root '''''''''''''''''''''''' -There are several soil-to-root fluxes operating in parallel (one for each root-containing soil layer). Each represents a flux from the given soil layer to the root collar. The water flux from soil-to-root is the product of the segment conductance, the conducting area basis, and the water potential gradient from soil to root. The area basis is a proxy for root area index, defined as the summed leaf and stem area index multiplied by the root-to-shoot ratio (PFT parameter) multiplied by the layer root fraction. The root fraction comes from an empirical root profile (see section zqz). - -The gradient in water potential is the difference between the soil water potential and the root water potential less the difference in gravitational potential. There is only one root water potential to which all soil layers are connected in parallel. A soil-to-root flux can be either positive (vegetation water uptake) or negative (water deposition), depending on the relative values of the root and soil water potentials. This allows for the occurrence of hydraulic redistribution where water moves through vegetation tissue from one soil layer to another. - -Soil-to-root conductance is the result of two resistances in series, first across the soil-root interface and then through the root tissue. The root tissue conductance is defined as the maximum conductance multiplied by the percent of maximum conductance, as calculated by the sigmoidal vulnerability curve. The maximum conductance is defined as the maximum root-tissue conductivity (PFT parameter) divided by the length of the conducting path, which is taken to be the soil layer depth plus lateral root length. - -The soil-root interface conductance is defined as the soil conductivity divided by the conducting length from soil to root. The soil conductivity varies by soil layer and is calculated based on soil potential and soil properties, via the Brooks-Corey theory. The conducting length is computed by calculating the characteristic root spacing following Bonan-2014. The root spacing depends on total root biomass and PFT parameters defining root structure (see section zqz). +There are several soil-to-root fluxes operating in parallel (one for each +root-containing soil layer). Each represents a flux from the given soil +layer to the root collar. The water flux from soil-to-root is the product +of the segment conductance, the conducting area basis, and the water +potential gradient from soil to root. The area basis is a proxy for root +area index, defined as the summed leaf and stem area index multiplied by +the root-to-shoot ratio (PFT parameter) multiplied by the layer root +fraction. The root fraction comes from an empirical root profile (section +:numref:`Vertical Root Distribution`). + +The gradient in water potential is the difference between the soil water +potential and the root water potential less the difference in gravitational +potential. There is only one root water potential to which all soil layers +are connected in parallel. A soil-to-root flux can be either positive +(vegetation water uptake) or negative (water deposition), depending on the +relative values of the root and soil water potentials. This allows for the +occurrence of hydraulic redistribution where water moves through vegetation +tissue from one soil layer to another. + +Soil-to-root conductance is the result of two resistances in series, first +across the soil-root interface and then through the root tissue. The root +tissue conductance is defined as the maximum conductance multiplied by the +percent of maximum conductance, as calculated by the sigmoidal vulnerability +curve. The maximum conductance is defined as the maximum root-tissue +conductivity (PFT parameter) divided by the length of the conducting path, +which is taken to be the soil layer depth plus lateral root length. + +The soil-root interface conductance is defined as the soil conductivity +divided by the conducting length from soil to root. The soil conductivity +varies by soil layer and is calculated based on soil potential and soil +properties, via the Brooks-Corey theory. The conducting length is determined +from the characteristic root spacing (section :numref:`Root Spacing`). .. math:: :label: 11.109 @@ -214,16 +390,6 @@ The soil-root interface conductance is defined as the soil conductivity divided k_{s,i} = \dfrac{k_{soil,i}}{dx_{root,i}} -.. math:: - :label: 11.114 - - dx_{root,i} = \left(\pi*\mbox{root-length-density}_i\right)^{-0.5} - -.. math:: - :label: 11.115 - - \mbox{root-length-density} = \dfrac{\mbox{total root length}}{\mbox{soil volume}} - Variables: :math:`q_{3,i}` = flux of water (mmH2O/s) from soil layer :math:`i` to root diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 724fd493f8..699bef7769 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -526,6 +526,11 @@ Major, D.A., Reginato, R.J., and Hubbard, K.G. 1988. Interception and use efficiency of light in winter wheat under different nitrogen regimes. Agric. For. Meteor. 44:175-186. +.. _Gardner1960: + +Gardner, W. R. 1960. Dynamic aspects of water availability to plants, +Soil Sci., 89, 63–73. + .. _Gashetal1996: Gash, J.H.C., Nobre, C.A., Roberts, J.M., and Victoria, R.L. 1996. An From 8b846e92b9c2519e53539d59e958cc5713c60d93 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 9 Jun 2017 11:09:46 -0600 Subject: [PATCH 062/730] add references --- .../CLM50_Tech_Note_Introduction.rst | 2 +- .../CLM50_Tech_Note_Plant_Hydraulics.rst | 32 ------------ .../References/CLM50_Tech_Note_References.rst | 50 ++++++++++++++++--- 3 files changed, 44 insertions(+), 40 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index ed7a66f332..7f409914b2 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -224,7 +224,7 @@ Jinyun Tang, Zong-Liang Yang** - :numref:`Table Respiration fractions for Century-based structure` Respiration fractions for litter and SOM pools for Century-based structure -- :numref:`Table PFT-specific combustion completeness and fire mortality` PFT-specific combustion completeness and fire mortality factors. +- :numref:`Table PFT-specific combustion completeness and fire mortality factors` PFT-specific combustion completeness and fire mortality factors. - :numref:`Table Methane Parameter descriptions` Parameter descriptions and sensitivity analysis ranges applied in the methane model. diff --git a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst index 703f9b8ed9..5e0063817b 100644 --- a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst +++ b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst @@ -717,35 +717,3 @@ The outermost level of iteration works towards convergence of leaf temperature, .. figure:: flow.png Flow diagram of leaf flux calculations - - -.. _PHS Refs: - -References ------------------------------ - -Local references. Will copy over - -.. _Bonanetal2014: - -Bonan, G.B., Williams, M., Fisher, R.A., and Oleson, K.W. 2014. Modeling stomatal conductance in the earth system: linking leaf water-use efficiency and water transport along the soil–plant–atmosphere continuum, Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. - -.. _Chuangetal2006: - -Chuang Y.L., Oren R., Bertozzi A.L, Phillips N., Katul G.G. 2006. The porous media model for the hydraulic system of a conifer tree: Linking sap flux data to transpiration rate, Ecological Modelling, 191, 447-468, doi:10.1016/j.ecolmodel.2005.03.027. - -.. _Medlynetal2011: - -Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and Wingate, L. (2011), Reconciling the optimal and empirical approaches to modelling stomatal conductance. Global Change Biology, 17: 2134–2144. doi:10.1111/j.1365-2486.2010.02375.x - -.. _Sperryetal1998: - -Sperry, J.S., Adler, F.R., Campbell, G.S. and Comstock, J.P. (1998), Limitation of plant water use by rhizosphere and xylem conductance: results from a model. Plant, Cell & Environment, 21: 347–359. doi:10.1046/j.1365-3040.1998.00287.x - -.. _SperryandLove2015: - -Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us about responses to climate-change droughts. New Phytol, 207: 14–27. doi:10.1111/nph.13354 - -.. _Williamsetal1996: - -Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere continuum in a Quercus–Acer stand at Harvard Forest: the regulation of stomatal conductance by light, nitrogen and soil/plant hydraulic properties. Plant, Cell & Environment, 19: 911–927. doi:10.1111/j.1365-3040.1996.tb00456.x diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 699bef7769..076af343be 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -197,14 +197,12 @@ M. 2012. Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4, J. Geophys. Res., 117, G02026. DOI:10.1029/2011JG001913. -Branstetter, M.L., and Famiglietti, J.S. 1999. Testing the sensitivity -of GCM-simulated runoff to climate model resolution using a parallel -river transport algorithm. Preprints, 14\ :math:`{}^{th}` Conference on -Hydrology, Dallas, TX, Amer. Meteor. Soc., 391-392. +.. _Bonanetal2014: -Branstetter, M.L. 2001. Development of a parallel river transport -algorithm and applications to climate studies. Ph.D. dissertation, -University of Texas at Austin. +Bonan, G.B., Williams, M., Fisher, R.A., and Oleson, K.W. 2014. Modeling +stomatal conductance in the earth system: linking leaf water-use +efficiency and water transport along the soil–plant–atmosphere continuum, +Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. .. _Brun1989: @@ -245,6 +243,13 @@ Cao, M., Marshall, S. and Gregson, K., 1996. Global carbon exchange and methane emissions from natural wetlands: Application of a process-based model. J. Geophys. Res. 101(D9):14,399-14,414. +.. _Chuangetal2006: + +Chuang Y.L., Oren R., Bertozzi A.L, Phillips N., Katul G.G. 2006. The +porous media model for the hydraulic system of a conifer tree: Linking +sap flux data to transpiration rate, Ecological Modelling, 191, 447-468, +doi:10.1016/j.ecolmodel.2005.03.027. + .. _Churkinaetal2003: Churkina, G. et al., 2003. Analyzing the ecosystem carbon dynamics of @@ -1179,6 +1184,14 @@ carbon and nitrogen dynamics in estimating net primary productivity for potential vegetation in North America. Global Biogeochem. Cycles 6:101-124. +.. _Medlynetal2011: + +Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., +Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and +Wingate, L. (2011), Reconciling the optimal and empirical approaches to +modelling stomatal conductance. Global Change Biology, 17: 2134–2144. +doi:10.1111/j.1365-2486.2010.02375.x + .. _MelzerOLeary1987: Melzer, E., and O’Leary, M.H. 1987. Anapleurotic CO2 Fixation by @@ -1692,6 +1705,19 @@ Sørensen, L.H., 1981. Carbon-nitrogen relationships during the humification of cellulose in soils containing different amounts of clay. Soil Biology and Biochemistry, 13: 313-321. +.. _Sperryetal1998: + +Sperry, J.S., Adler, F.R., Campbell, G.S. and Comstock, J.P. 1998. +Limitation of plant water use by rhizosphere and xylem conductance: +results from a model. Plant, Cell & Environment, 21: 347–359. +doi:10.1046/j.1365-3040.1998.00287.x + +.. _SperryandLove2015: + +Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us +about responses to climate-change droughts. New Phytol, 207: 14–27. +doi:10.1111/nph.13354 + .. _Sprugeletal1995: Sprugel, D.G., Ryan, M.G., Brooks, J.R., Vogt, K.A., and Martin, T.A. @@ -2001,6 +2027,16 @@ Parameterization and sensitivity analysis of the Biome-BGC terrestrial ecosystem model: net primary production controls. Earth Interactions 4:1-85. +.. _Williamsetal1996: + +Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., +Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. +and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere +continuum in a Quercus–Acer stand at Harvard Forest: the regulation +of stomatal conductance by light, nitrogen and soil/plant hydraulic +properties. Plant, Cell & Environment, 19: 911–927. +doi:10.1111/j.1365-3040.1996.tb00456.x + .. _WiscombeWarren1980: Wiscombe, W.J., and Warren, S.G. 1980. A model for the spectral albedo From 3b59bde5078b275f7bddff9b0c76c8f1c7b495e7 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Fri, 9 Jun 2017 17:34:13 -0600 Subject: [PATCH 063/730] Updated the N retranslocation section of the Crop chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 110 ++++++++---------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 3ff2afc0b5..d130d29bb8 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -79,6 +79,9 @@ fully coupled simulations with the Community Earth System Model (CESM), while helping human societies answer questions about changing food, energy, and water resources in response to climate, environmental, land use, and land management change (e.g., :ref:`Kucharik and Brye 2003 `; :ref:`Lobell et al. 2006 `). +As implemented here, the crop model uses the same physiology as the +natural vegetation, though uses different crop-specific parameter values, +phenology, and allocation, as well as fertilizer and irrigation management. .. _Crop plant functional types: @@ -94,7 +97,7 @@ land management between crops. Each crop type has a rainfed and an irrigated pft that are on independent soil columns. Crop grid cell coverage is assigned from satellite data (similar to all natural pfts), and the managed crop type proportions within the crop area is based on the dataset created by -(:ref:`Portmann et al. 2010 `) for present day and +(:ref:`Portmann et al. 2010 `) for present day. New in CLM5, crop area is extrapolated through time using the dataset provided by Land Use Model Intercomparison Project (LUMIP), which is part of CMIP6 Land use timeseries (:ref:`Lawrence et al. 2016 `). For more details about how @@ -105,8 +108,15 @@ CLM5 includes eight actively managed crop types corn, spring wheat, cotton, rice, and sugarcane) that are chosen based on the availability of corresponding algorithms in AgroIBIS and as developed by Badger and Dirmeyer (:ref:`2015 `) and -described by Levis et al. (:ref:`2016 `). In addition, -CLM’s default list of plant functional types (pfts) includes an +described by Levis et al. (:ref:`2016 `). The representations of +sugarcane, rice, cotton, tropical corn, and tropical soy are new in CLM5. +Sugarcane and tropical corn are both C4 plants and are therefore represented +using the temperate corn functional form. Tropical soybean uses the temperate +soybean functional form, while rice and cotton use the wheat functional form. +In tropical regions, parameter values were developed for the Amazon Basin, and planting +date window is shifted by six months relative to the Northern Hemisphere. + +In addition, CLM’s default list of plant functional types (pfts) includes an irrigated and unirrigated unmanaged C3 crop (Table 25.1) treated as a second C3 grass, The unmanaged C3 crop is only used when the crop model is not active and has grid cell coverage assigned from satellite data, and @@ -231,6 +241,8 @@ Phase 3 begins in one of two ways. The first potential trigger is based on tempe planting like :math:`GDD_{T_{soi} }` but for 2-m air temperature, :math:`GDD_{T_{{\rm 2m}} }`, must reach a heat unit threshold, *h*, of 40 to 65% of :math:`{GDD}_{mat}` (:numref:`Table Crop plant functional types`). +For crops with the C4 photosynthetic pathway (temperate and tropical corn, sugarcane), +the :math:`{GDD}_{mat}` is based on an empirical function and ranges between 950 and 1850. The second potential trigger for phase 3 is based on leaf area index. When the maximum value of leaf area index is reached in phase 2, phase 3 begins. In phase 3, the leaf area index begins to decline in @@ -243,17 +255,17 @@ Harvest '''''''''''''''' Harvest is assumed to occur as soon as the crop reaches maturity. When -:math:`GDD_{T_{{\rm 2m}} }` reaches 100% of :math:`{GDD}_{mat}` or +:math:`GDD_{T_{{\rm 2m}} }` reaches 100% of :math:`{GDD}_{mat}` or the number of days past planting reaches a crop-specific maximum (:numref:`Table Crop plant functional types`)[update table reference], then the crop is harvested. Harvest occurs in one time step using -CN’s leaf offset algorithm. New variables track the flow of grain C and -N to food and of live stem C and N to litter. Currently, food C and N -are routed directly to litter using the labile, cellulose, and lignin -fractions for leaves. [update to product pool] The same fractions for leaves are used for the -flow of live stem C and N to litter for corn, soybean, and temperate -cereals. This is in contrast to the approach for unmanaged PFTs which -puts live stem C and N to dead stems first, rather than to litter. +CN’s leaf offset algorithm. Variables track the flow of grain C and +N to food and of live stem C and N to litter. Putting live +stem C and N into the litter pool is in contrast to the approach for unmanaged PFTs which +puts live stem C and N into dead stem pools first. Leaf and root C and N pools +are routed to the litter pools in the same manner as natural vegetation. In CLM5, food C and N +are routed to a grain product pool where the C and N decay to the atmosphere over one year, +similar in structure to the wood product pools. .. _Allocation: @@ -315,6 +327,12 @@ allocation decline factors, and :math:`a_{leaf}^{f}` and :math:`a_{livestem}^{f}` are final values of these allocation coefficients (:numref:`Table Crop pfts`). +Harvest to seed +'''''''''''''''''''''''''''''' + +In CLM5, the C and N required for crop seeding is removed from the grain +product pool during harvest and used to seed crops in the subsequent year. + .. _General comments: General comments @@ -664,54 +682,24 @@ the counter is reached. Biological nitrogen fixation for soybeans ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Nitrogen fixation by soybeans is similar to that in the SWAT model -(Neitsch et al. 2005) and depends on soil moisture, nitrogen -availability, and growth stage. Soybean fixation is calculated only for -unmet nitrogen demand; if soil nitrogen meets soybean demand, there will -be no fixation during the time step. Soybean fixation is determined by - -.. math:: - :label: 25.10 - - N_{fix} \; =\; N_{plant\_ ndemand} \; *\; min\; \left(\; 1,\; fxw,\; fxn\; \right)*\; fxg - -where :math:`{N}_{plant\_demand}` is the balance of nitrogen needed -to reach potential growth that cannot be supplied from the soil mineral -nitrogen pool, *fxw* is the soil water factor, *fxn* is the soil -nitrogen factor, and *fxg* is the growth stage factor calculated by - -.. math:: - :label: 25.11 - - fxw=\frac{wf}{0.85} - -.. math:: - :label: 25.12 - - fxn=\; \left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }sminn\le 10} \\ {1.5-0.005\left(sminn\times 10\right)\qquad {\rm for\; 10\; <\; }sminn{\rm \; }\ge 30} \\ {1\qquad \qquad \qquad \qquad {\rm for\; }sminn>30} \end{array}\right\} - -.. math:: - :label: 25.13 - - fxg=\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad \qquad {\rm for\; }GDD_{T_{2m} } \le 0.15} \\ {6.67\times GDD_{T_{2m} } -1\qquad \qquad \qquad {\rm for\; }0.150.75} \end{array}\right\} - -where *wf* is the soil water content as a fraction of the water holding -capacity for the top 0.05 m, *sminn* is the total nitrogen in the soil -pool (g/m:sup:`2`), and :math:`{GDD}_{T_{2m}}` is the fraction of -growing degree-days accumulated during the growing season. -:math:`N\mathrm{fix}` is added directly to the soil mineral nitrogen -pool for use that time step. Nitrogen fixation occurs after the plant -has accumulated 15%\ :math:`{GDD}_{mat}` and before -75%\ :math:`{GDD}_{mat}`, so before grain fill begins. +Biological N fixation for soybeans is calculated by the fixation and +uptake of nitrogen module [add reference to chapter 18]. Unlike natural +vegetation, where a fraction of the vegetation are N fixers, all soybeans +are treated as N fixers. .. _Modified C\:N ratios for crops: Modified C:N ratios for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Typically, C:N ratios in plant tissue vary throughout the growing season -and tend to be lower during early growth stages and higher in later -growth stages. In order to account for this change, two sets of C:N +Carbon to nitrogen ratios (C:N) for crops are calculated by the flexible C:N +module that is new to CLM5. + +In CLM5, the flexible C:N module allows leaf C:N to vary based +on residual N allocated to the leaf pool after the demands of other plant organs +are met. Grain C/N is similarly xxx... + +In order to account for this change, two sets of C:N ratios are established in CLM for the leaf, stem, and fine root of crops. This modified C:N ratio approach accounts for the nitrogen retranslocation that occurs during phase 3 of crop growth. Leaf and stem @@ -740,9 +728,9 @@ soil mineral nitrogen pool, and depends on C:N ratios for leaves, stems, roots, and organs. Nitrogen demand during organ development is fulfilled through retranslocation from leaves, stems, and roots. Nitrogen retranslocation is initiated at the beginning of the grain fill stage -for corn and temperate cereals, but not until after LAI decline in -soybean. Nitrogen stored in the leaf and stem is moved into a storage -retranslocation pool. For temperate cereals, nitrogen in roots is also +for all crops except soybean, for which retranslocation is after LAI decline. +Nitrogen stored in the leaf and stem is moved into a storage +retranslocation pool. For wheat and rice, nitrogen in roots is also released into the retranslocation storage pool. The quantity of nitrogen mobilized depends on the C:N ratio of the plant tissue, and is calculated as @@ -750,21 +738,21 @@ calculated as .. math:: :label: 25.14 - leaf\_ to\_ retransn=\frac{c_{leaf} }{CN_{leaf} } -\frac{c_{leaf} }{CN_{leaf}^{f} } + leaf\_ to\_ retransn=n_{leaf} -\frac{c_{leaf} }{CN_{leaf}^{f} } .. math:: :label: 25.15 - stemn\_ to\_ retransn=\frac{c_{stem} }{CN_{stem} } -\frac{c_{stem} }{CN_{stem}^{f} } + stemn\_ to\_ retransn=n_{stem} -\frac{c_{stem} }{CN_{stem}^{f} } .. math:: :label: 25.16 - frootn\_ to\_ retransn=\frac{c_{froot} }{CN_{froot} } -\frac{c_{froot} }{CN_{froot}^{f} } + frootn\_ to\_ retransn=n_{froot} -\frac{c_{froot} }{CN_{froot}^{f} } where :math:`{C}_{leaf}`, :math:`{C}_{stem}`, and :math:`{C}_{froot}` is the carbon in the plant leaf, stem, and fine -root, respectively, :math:`{CN}_{leaf}`, :math:`{CN}_{stem}`, and :math:`{CN}_{froot}` is the pre-grain fill C:N ratio of the -leaf, stem, and fine root respectively, and :math:`CN^f_{leaf}`, +root, respectively, :math:`{N}_{leaf}`, :math:`{N}_{stem}`, and :math:`{N}_{froot}` +is the nitrogen in the plant leaf, stem, and fine root, respectively, and :math:`CN^f_{leaf}`, :math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N ratio of the leaf, stem, and fine root respectively (:numref:`Table Pre- and post-grain fill CN ratios`). Since C:N measurements are taken from mature crops, pre-grain development C:N From 9a4e0fe38d0bec27012d01c52e55f3ae9764034b Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Tue, 13 Jun 2017 12:14:07 -0600 Subject: [PATCH 064/730] Updated CN and N retranslocation sections of crop chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 97 +++++-------------- 1 file changed, 24 insertions(+), 73 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index d130d29bb8..e54cb0d30f 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -101,7 +101,7 @@ proportions within the crop area is based on the dataset created by extrapolated through time using the dataset provided by Land Use Model Intercomparison Project (LUMIP), which is part of CMIP6 Land use timeseries (:ref:`Lawrence et al. 2016 `). For more details about how -crop distributions are determined, see chapter 26 on :ref:`rst_Transient Landcover Change`. +crop distributions are determined, see Chapter :numref: `rst_Transient Landcover Change`. CLM5 includes eight actively managed crop types (temperate soybean, tropical soybean, temperate corn, tropical @@ -117,7 +117,7 @@ In tropical regions, parameter values were developed for the Amazon Basin, and p date window is shifted by six months relative to the Northern Hemisphere. In addition, CLM’s default list of plant functional types (pfts) includes an -irrigated and unirrigated unmanaged C3 crop (Table 25.1) treated as a second C3 grass, +irrigated and unirrigated unmanaged C3 crop (Table 25.1) treated as a second C3 grass. The unmanaged C3 crop is only used when the crop model is not active and has grid cell coverage assigned from satellite data, and the unmanaged C3 irrigated crop type is currently not used @@ -128,7 +128,7 @@ Each of the inactive crop types is simulated using the parameters of the spatially closest associated crop type that is most similar to the functional type (e.g., C3 or C4), which is required to maintain similar phenological parameters based on temperature thresholds. Information detailing which parameters are used for each crop type is -included in Table 25.1. It should be noted that analysis with pft-level history output merges +included in Table 25.1. It should be noted that pft-level history output merges all crop types into the actively managed crop type, so analysis of crop-specific output will require use of the land surface dataset to remap the yields of each actively and inactively managed crop type. @@ -588,52 +588,6 @@ river water storage is maintained above a specified threshold. The details about what is new in CLM4.5 -------------------------------------------- -.. _Interactive irrigation for corn, temperate cereals, and soybean: - -Interactive irrigation for corn, temperate cereals, and soybean -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -CLM4.0 included interactive irrigation only for the generic C3 crops, -i.e. plant functional types (pfts) 15 (rainfed) and 16 (irrigated) in -the CLM list of pfts and not for the additional crops of the interactive -crop management model (CROP). Irrigation and CROP were mutually -exclusive in CLM4.0. - -In CLM4.5 we have reversed this situation. Now the irrigation model can -be used only while running with CROP. To accomplish this we downloaded -data of percent irrigated and percent rainfed corn, soybean, and -temperate cereals (wheat, barley, and rye) (:ref:`Portmann et al. 2010 `), -available online from - -*ftp://ftp.rz.uni-frankfurt.de/pub/uni-frankfurt/physische\_geographie/hydrologie/public/data/MIRCA2000/harvested\_area\_grids.* - -We embedded this data in CLM’s high-resolution pft data for use with the -tool mksurfdat to generate surface datasets at any desired resolution. -Now this data includes percent cover for 24 pfts: - -1-16 as in the standard list of pfts, plus six more: - -17 corn - -18 irrigated\_corn - -19 spring\_temperate\_cereal - -20 irrigated\_spring\_temperate\_cereal - -21 winter\_temperate\_cereal - -22 irrigated\_winter\_temperate\_cereal - -23 soybean - -24 irrigated\_soybean - -We intend surface datasets with 24 pfts only for CROP simulations with -or without irrigation. In simulations without irrigation, the rainfed -and irrigated crops merge into just rainfed crops at run time. Surface -datasets with 16 pfts can be used for all other CLM simulations. - .. _Interactive fertilization: Interactive fertilization @@ -682,30 +636,27 @@ the counter is reached. Biological nitrogen fixation for soybeans ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Biological N fixation for soybeans is calculated by the fixation and -uptake of nitrogen module [add reference to chapter 18]. Unlike natural +Biological N fixation for soybeans is calculated by the fixation and uptake of +nitrogen module (Chapter :numref:`rst_FUN`). Unlike natural vegetation, where a fraction of the vegetation are N fixers, all soybeans are treated as N fixers. .. _Modified C\:N ratios for crops: -Modified C:N ratios for crops +C:N ratios for crops ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Carbon to nitrogen ratios (C:N) for crops are calculated by the flexible C:N -module that is new to CLM5. - -In CLM5, the flexible C:N module allows leaf C:N to vary based -on residual N allocated to the leaf pool after the demands of other plant organs -are met. Grain C/N is similarly xxx... - -In order to account for this change, two sets of C:N +Typically, C:N ratios in plant tissue vary throughout the growing season and +tend to be lower during early growth stages and higher in later growth stages. +In order to account for this seasonal change, two sets of C:N ratios are established in CLM for the leaf, stem, and fine root of crops. This modified C:N ratio approach accounts for the nitrogen -retranslocation that occurs during phase 3 of crop growth. Leaf and stem -(and root for temperate cereals) C:N ratios for phases 1 and 2 are lower -than measurements (Table 20.3) to allow excess nitrogen storage in plant -tissue. During grain fill (phase 3) of the crop growth cycle, the +retranslocation that occurs during phase 3 of crop growth. Leaf, stem, and root +C:N ratios for phases 1 and 2 are calculated +using the new CLM5 carbon and nitrogen allocation scheme +(Chapter :numref:`rst_CN Allocation`), which provides a target C:N value +and allows C:N to vary through time. +During grain fill (phase 3) of the crop growth cycle, a portion of the nitrogen in the plant tissues is moved to a storage pool to fulfill nitrogen demands of organ (reproductive pool) development, such that the resulting C:N ratio of the plant tissue is reflective of measurements at @@ -720,9 +671,10 @@ Nitrogen retranslocation for crops Nitrogen retranslocation in crops occurs when nitrogen that was used for tissue growth of leaves, stems, and fine roots during the early growth -season is remobilized and used for grain development (Pollmer et al. -1979; Crawford et al. 1982; Simpson et al. 1983; Ta and Weiland 1992; -Barbottin et al. 2005; Gallais et al. 2006, 2007). Nitrogen allocation +season is remobilized and used for grain development (:ref:`Pollmer et al. 1979 +`, :ref:`Crawford et al. 1982 `, :ref:`Simpson et al. 1983 +`, :ref:`Ta and Weiland 1992 `, :ref:`Barbottin et al. 2005 `, +:ref:`Gallais et al. 2006 `, :ref:`Gallais et al. 2007 `). Nitrogen allocation for crops follows that of natural vegetation, is supplied in CLM by the soil mineral nitrogen pool, and depends on C:N ratios for leaves, stems, roots, and organs. Nitrogen demand during organ development is fulfilled @@ -798,13 +750,12 @@ Separate reproductive pool One notable difference between natural vegetation and crops is the presence of a reproductive carbon pool (and nitrogen pool). Accounting for the reproductive pool helps determine whether crops are performing -reasonably, through yield calculations, seasonal GPP and NEE changes, -etc. The reproductive pool is maintained similarly to the leaf, stem, +reasonably through yield calculations. +The reproductive pool is maintained similarly to the leaf, stem, and fine root pools, but allocation of carbon and nitrogen does not -begin until the grain fill stage of crop development. Eq. shows the -carbon and nitrogen allocation coefficients to the reproductive pool. In -the CLM4.0, allocation of carbon to the reproductive pool was calculated -but merged with the stem pool. In the model, as allocation declines +begin until the grain fill stage of crop development. Eq. :eq:`(5)` shows the +carbon and nitrogen allocation coefficients to the reproductive pool. +In CLM, as allocation declines during the grain fill stage of growth, increasing amounts of carbon and nitrogen are available for grain development. From 88ca8dab03e41c3f0286e7294b06699ffa69f31f Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Tue, 13 Jun 2017 15:14:54 -0600 Subject: [PATCH 065/730] Restructured text in crop chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 432 +++++++----------- 1 file changed, 176 insertions(+), 256 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index e54cb0d30f..7d959d3f39 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -69,8 +69,9 @@ management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 [CLM3.0, :ref:`Oleson et al. (2004) `] (not published), then coupled to the CLM3.5 (:ref:`Levis et al. 2009 `) and later released to the community with -CLM4CN (:ref:`Levis et al. 2012 `), with additional updates -available by request after the release of CLM4.5 (:ref:`Levis et al. 2016 `). +CLM4CN (:ref:`Levis et al. 2012 `), and CLM4.5. Additional updates after the +release of CLM4.5 were available by request (:ref:`Levis et al. 2016 `), +and those are now incorporated into CLM5. With interactive crop management and, therefore, a more accurate representation of agricultural landscapes, we hope to improve the CLM’s @@ -101,7 +102,7 @@ proportions within the crop area is based on the dataset created by extrapolated through time using the dataset provided by Land Use Model Intercomparison Project (LUMIP), which is part of CMIP6 Land use timeseries (:ref:`Lawrence et al. 2016 `). For more details about how -crop distributions are determined, see Chapter :numref: `rst_Transient Landcover Change`. +crop distributions are determined, see Chapter :numref:`rst_Transient Landcover Change`. CLM5 includes eight actively managed crop types (temperate soybean, tropical soybean, temperate corn, tropical @@ -138,10 +139,10 @@ remap the yields of each actively and inactively managed crop type. Phenology ^^^^^^^^^^^^^^^^ -CLM4.5CN includes evergreen, seasonally deciduous (responding to changes +CLM5-BGC includes evergreen, seasonally deciduous (responding to changes in day length), and stress deciduous (responding to changes in -temperature and/or soil moisture) phenology algorithms (Chapter 14). In -CLM4.5CNcrop we have added the AgroIBIS crop phenology algorithm, +temperature and/or soil moisture) phenology algorithms (Chapter :numref:`rst_Vegetation Phenology and Turnover`). +CLM5-BGC-crop uses the AgroIBIS crop phenology algorithm, consisting of three distinct phases. Phase 1 starts at planting and ends with leaf emergence, phase 2 @@ -247,7 +248,7 @@ The second potential trigger for phase 3 is based on leaf area index. When the maximum value of leaf area index is reached in phase 2, phase 3 begins. In phase 3, the leaf area index begins to decline in response to a background litterfall rate calculated as the inverse of -leaf longevity for the pft as done in the CN part of the model. +leaf longevity for the pft as done in the BGC part of the model. .. _Harvest: @@ -257,14 +258,15 @@ Harvest Harvest is assumed to occur as soon as the crop reaches maturity. When :math:`GDD_{T_{{\rm 2m}} }` reaches 100% of :math:`{GDD}_{mat}` or the number of days past planting reaches a crop-specific maximum -(:numref:`Table Crop plant functional types`)[update table reference], then the crop is harvested. +(:numref:`Table Crop plant functional types`), then the crop is harvested. Harvest occurs in one time step using -CN’s leaf offset algorithm. Variables track the flow of grain C and +the BGC leaf offset algorithm. Variables track the flow of grain C and N to food and of live stem C and N to litter. Putting live stem C and N into the litter pool is in contrast to the approach for unmanaged PFTs which puts live stem C and N into dead stem pools first. Leaf and root C and N pools -are routed to the litter pools in the same manner as natural vegetation. In CLM5, food C and N -are routed to a grain product pool where the C and N decay to the atmosphere over one year, +are routed to the litter pools in the same manner as natural vegetation. Whereas food C and N +formerly was transferred to the litter pool, CLM5 routes food C and N +to a grain product pool where the C and N decay to the atmosphere over one year, similar in structure to the wood product pools. .. _Allocation: @@ -272,12 +274,40 @@ similar in structure to the wood product pools. Allocation ^^^^^^^^^^^^^^^^^ -Allocation responds to the same phases as phenology (section 20.2.3). +Allocation responds to the same phases as phenology (section :numref: `_Phenology`). Simulated C assimilation begins every year upon leaf emergence in phase 2 and ends with harvest at the end of phase 3; therefore, so does the allocation of such C to the crop’s leaf, live stem, fine root, and reproductive pools. +Typically, C:N ratios in plant tissue vary throughout the growing season and +tend to be lower during early growth stages and higher in later growth stages. +In order to account for this seasonal change, two sets of C:N +ratios are established in CLM for the leaf, stem, and fine root of +crops. This modified C:N ratio approach accounts for the nitrogen +retranslocation that occurs during phase 3 of crop growth. Leaf, stem, and root +C:N ratios for phases 1 and 2 are calculated +using the new CLM5 carbon and nitrogen allocation scheme +(Chapter :numref:`rst_CN Allocation`), which provides a target C:N value +and allows C:N to vary through time. +During grain fill (phase 3) of the crop growth cycle, a portion of the +nitrogen in the plant tissues is moved to a storage pool to fulfill +nitrogen demands of organ (reproductive pool) development, such that the +resulting C:N ratio of the plant tissue is reflective of measurements at +harvest. All C:N ratios were determined by calibration process, through +comparisons of model output versus observations of plant carbon +throughout the growth season. + +The BGC part of the model keeps track of a term representing excess +maintenance respiration that for perennial pfts or pfts with C storage +may be extracted from later gross primary production. Later extraction +cannot continue to happen after harvest for annual crops, so at harvest +we turn the excess respiration pool into a flux that extracts +CO\ :sub:`2` directly from the atmosphere. This way we eliminate +any excess maintenance respiration remaining at harvest as if such +respiration had not taken place. + + .. _Leaf emergence to grain fill: Leaf emergence to grain fill @@ -327,27 +357,72 @@ allocation decline factors, and :math:`a_{leaf}^{f}` and :math:`a_{livestem}^{f}` are final values of these allocation coefficients (:numref:`Table Crop pfts`). -Harvest to seed +Nitrogen retranslocation for crops +,,,,,,,,,,,,,,,,,,,,,,,,,,,, + +Nitrogen retranslocation in crops occurs when nitrogen that was used for +tissue growth of leaves, stems, and fine roots during the early growth +season is remobilized and used for grain development (:ref:`Pollmer et al. 1979 +`, :ref:`Crawford et al. 1982 `, :ref:`Simpson et al. 1983 +`, :ref:`Ta and Weiland 1992 `, :ref:`Barbottin et al. 2005 `, +:ref:`Gallais et al. 2006 `, :ref:`Gallais et al. 2007 `). Nitrogen allocation +for crops follows that of natural vegetation, is supplied in CLM by the +soil mineral nitrogen pool, and depends on C:N ratios for leaves, stems, +roots, and organs. Nitrogen demand during organ development is fulfilled +through retranslocation from leaves, stems, and roots. Nitrogen +retranslocation is initiated at the beginning of the grain fill stage +for all crops except soybean, for which retranslocation is after LAI decline. +Nitrogen stored in the leaf and stem is moved into a storage +retranslocation pool. For wheat and rice, nitrogen in roots is also +released into the retranslocation storage pool. The quantity of nitrogen +mobilized depends on the C:N ratio of the plant tissue, and is +calculated as + +.. math:: + :label: 25.14 + + leaf\_ to\_ retransn=n_{leaf} -\frac{c_{leaf} }{CN_{leaf}^{f} } + +.. math:: + :label: 25.15 + + stemn\_ to\_ retransn=n_{stem} -\frac{c_{stem} }{CN_{stem}^{f} } + +.. math:: + :label: 25.16 + + frootn\_ to\_ retransn=n_{froot} -\frac{c_{froot} }{CN_{froot}^{f} } + +where :math:`{C}_{leaf}`, :math:`{C}_{stem}`, and :math:`{C}_{froot}` is the carbon in the plant leaf, stem, and fine +root, respectively, :math:`{N}_{leaf}`, :math:`{N}_{stem}`, and :math:`{N}_{froot}` +is the nitrogen in the plant leaf, stem, and fine root, respectively, and :math:`CN^f_{leaf}`, +:math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N +ratio of the leaf, stem, and fine root respectively (:numref:`Table Pre- and post-grain fill CN ratios`). Since +C:N measurements are taken from mature crops, pre-grain development C:N +ratios for leaves, stems, and roots are optimized to allow maximum +nitrogen accumulation for later use during organ development. Post-grain +fill C:N ratios are assigned the same as crop residue. Once excess +nitrogen is moved into the retranslocated pool, during the remainder of +the growing season the retranslocated pool is used first to meet plant +nitrogen demand by assigning the available nitrogen from the +retranslocated pool equal to the plant nitrogen demand. Once the +retranslocation pool is depleted, soil mineral nitrogen pool is used to +fulfill plant nitrogen demands. + +Harvest to food and seed '''''''''''''''''''''''''''''' In CLM5, the C and N required for crop seeding is removed from the grain -product pool during harvest and used to seed crops in the subsequent year. +product pool during harvest and used to seed crops in the subsequent year. +Caluating the crop yields requires... .. _General comments: -General comments +Other Features ^^^^^^^^^^^^^^^^^^^^^^^ -C and N accounting now includes new pools and fluxes pertaining to live -stems and reproductive tissues. For example, the calculations of growth -respiration, above ground net primary production, litter fall, and -displayed vegetation all now account for reproductive C. - -We track allocation to reproductive C separately from CN’s allocation to -other C pools but within the CN framework. CN uses -:math:`{\textstyle\frac{a_{root} }{a_{leaf} }}` and :math:`{\textstyle\frac{a_{livestem} }{a_{leaf} }}` to calculate C and -N allometry and plant N demand. - +Physical Crop Characteristics +'''''''''''''''''''''''''''''' Stem area index (*S*) is equal to 0.1\ *L* for corn and 0.2\ *L* for other crops, as in AgroIBIS, where *L* is the leaf area index. All live C and N pools go to 0 after crop harvest, but the *S* is kept at 0.25 to @@ -364,47 +439,92 @@ and :math:`{z}_{bot}` (m), come from the AgroIBIS formulation: {z_{bot} =0.02{\rm m}} \end{array} -The CN part of the model keeps track of a term representing excess -maintenance respiration that for perennial pfts or pfts with C storage -may be extracted from later gross primary production. Later extraction -cannot continue to happen after harvest for annual crops, so at harvest -we turn the excess respiration pool into a flux that extracts -CO\ :sub:`2` directly from the atmosphere. This way we eliminate -any excess maintenance respiration remaining at harvest as if such -respiration had not taken place. +.. _Interactive fertilization: + +Interactive Fertilization +'''''''''''''''''''''''''''''' +CLM adds nitrogen directly to the soil mineral nitrogen pool to meet +crop nitrogen demands. CLM’s separate crop land unit ensures that +natural vegetation will not access the fertilizer applied to crops. +Fertilizer in CLM5BGCCROP is prescribed by crop function types spatially +for each year based on the LUMIP land use and land cover change +time series (LUH2 for historical and SSPs for future) (:ref:`Lawrence et al. 2016 `). +There are two fields that are used to prescribe industrial fertilizer. +On the surface data set the field CONST_FERTNITRO_CFT specifies the +annual fertilizer application for a non-transient simulations in g N/m\ :sup:`2`/yr. +In the case of a transient simulation this is replaced by the landuse.timeseries +file with the field FERTNITRO_CFT which is also in g N/m\ :sup:`2`/yr. +The values for both of these fields come from the LUMIP time series for each year. +In addition to the industrial fertilizer there is a background manure fertilizer +on the clm parameters file with the field manunitro. For the current CLM5BGCCROP, +this is set to 0.002 kg N/m\ :sup:`2`/yr. Since CLM’s denitrification rate is high +and results in a 50% loss of the unused available nitrogen each day, +fertilizer is applied slowly to minimize the loss and maximize plant +uptake. Fertilizer application begins during the emergence phase of crop +development and continues for 20 days, which helps reduce large losses +of nitrogen from leaching and denitrification during the early stage of +crop development. The 20-day period is chosen as an optimization to +limit fertilizer application to the emergence stage. A fertilizer +counter in seconds, *f*, is set as soon as the onset growth for crops +initiates: -In the list of plant physiological and other parameters used by the CLM, -we started the managed crops with the existing values assigned to the -unmanaged C3 crop. Then we changed the following parameters to -distinguish corn, soybean, and temperate cereals from the unmanaged C3 -crop and from each other: +.. math:: + :label: 25.18 -#. Growth respiration coefficient from 0.30 to the AgroIBIS value of - 0.25. + f = n \times 86400 -#. Fraction of leaf N in the Rubisco enzyme from 0.1 to 0.2 g N Rubisco - g\ :sup:`-1` N leaf for temperate cereals to increase - productivity (not chosen based on AgroIBIS). +where *n* is set to 20 fertilizer application days. When the crop enters +phase 2 (leaf emergence to the beginning of grain fill) of its growth +cycle, fertilizer application begins by initializing fertilizer amount +to the total fertilizer at each grid cell divided by the initialized *f*. +Fertilizer is applied and *f* is decremented each time step until a zero balance on +the counter is reached. -#. Fraction of current photosynthesis displayed as growth changed from - 0.5 to 1 (not chosen based on AgroIBIS). -#. CLM4.5CN curve for the effect of temperature on photosynthesis - instead of crop-specific curves from AgroIBIS. +.. _Biological nitrogen fixation for soybeans: -#. Quantum efficiency at 25\ :sup:`o`\ C, - :math:`\alpha` , from 0.06 to 0.04 *µ*\ mol CO\ :sub:`2` *µ*\ mol\ :sup:`-1` photon for C4 crops (corn and unmanaged C4 - crop), using CLM4.5CN’s C4 grass value. +Biological nitrogen fixation for soybeans +'''''''''''''''''''''''''''''' +Biological N fixation for soybeans is calculated by the fixation and uptake of +nitrogen module (Chapter :numref:`rst_FUN`). Unlike natural +vegetation, where a fraction of the vegetation are N fixers, all soybeans +are treated as N fixers. -#. Slope, *m*, of conductance-to-photosynthesis relationship from 9 to 4 for C4 crops as in AgroIBIS. +.. _Latitude vary base tempereature for growing degree days: -#. Specific leaf areas, *SLA*, to the AgroIBIS values (:numref:`Table Crop plant functional types`). +Latitude vary base tempereature for growing degree days +'''''''''''''''''''''''''''''' +For both rainfed and irrigated spring wheat and sugarcane, +a latitude vary base temperature in calculating :math:`GDD_{T_{{\rm 2m}} }` +(growing degree days since planting) was introduced. -#. Leaf orientation, :math:`\chi _{L}`, to the AgroIBIS values (:numref:`Table Crop plant functional types`). +.. math:: + :label: 25.17 -#. Soil moisture photosynthesis limitation factor, - :math:`\beta _{t}`, for soybeans multiplied as in AgroIBIS by 1.25 - for increased drought tolerance. + latitude\ vary\ baset = \left\{ + \begin{array}{lr} + baset +12 - 0.4 \times latitude &\qquad 0 \le latitude \le 30 \\ + baset +12 + 0.4 \times latitude &\qquad -30 \le latitude \le 0 + \end{array} \right\} + +where :math:`baset` is the 5\ :sup:`th` column in :numref:`Table Crop plant functional types`. +Such latitude vary baset could increase the base temperature, slow down :math:`GDD_{T_{{\rm 2m}} }` +accumulation, and extend the growing season for -30º to 30º regions for spring wheat +and sugarcane. + +Separate reproductive pool +'''''''''''''''''''''''''''''' +One notable difference between natural vegetation and crops is the +presence of a reproductive carbon pool (and nitrogen pool). Accounting +for the reproductive pool helps determine whether crops are performing +reasonably through yield calculations. +The reproductive pool is maintained similarly to the leaf, stem, +and fine root pools, but allocation of carbon and nitrogen does not +begin until the grain fill stage of crop development. Eq. :eq:`(5)` shows the +carbon and nitrogen allocation coefficients to the reproductive pool. +In CLM, as allocation declines +during the grain fill stage of growth, increasing amounts of carbon and +nitrogen are available for grain development. .. _Table Crop plant functional types: @@ -581,203 +701,3 @@ river water storage is maintained above a specified threshold. available online from *ftp://ftp.rz.uni-frankfurt.de/pub/uni-frankfurt/physische\_geographie/hydrologie/public/data/MIRCA2000/harvested\_area\_grids.* - - -.. _The details about what is new in CLM4.5: - -The details about what is new in CLM4.5 --------------------------------------------- - -.. _Interactive fertilization: - -Interactive fertilization -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -CLM adds nitrogen directly to the soil mineral nitrogen pool to meet -crop nitrogen demands. CLM’s separate crop land unit ensures that -natural vegetation will not access the fertilizer applied to crops. -Fertilizer in CLM5BGCCROP is prescribed by crop function types spatially -for each year based on the LUMIP land use and land cover change -time series (LUH2 for historical and SSPs for future) (:ref:`Lawrence et al. 2016 `). -There are two fields that are used to prescribe industrial fertilizer. -On the surface data set the field CONST_FERTNITRO_CFT specifies the -annual fertilizer application for a non-transient simulations in g N/m\ :sup:`2`/yr. -In the case of a transient simulation this is replaced by the landuse.timeseries -file with the field FERTNITRO_CFT which is also in g N/m\ :sup:`2`/yr. -The values for both of these fields come from the LUMIP time series for each year. -In addition to the industrial fertilizer there is a background manure fertilizer -on the clm parameters file with the field manunitro. For the current CLM5BGCCROP, -this is set to 0.002 kg N/m\ :sup:`2`/yr. Since CLM’s denitrification rate is high -and results in a 50% loss of the unused available nitrogen each day, -fertilizer is applied slowly to minimize the loss and maximize plant -uptake. Fertilizer application begins during the emergence phase of crop -development and continues for 20 days, which helps reduce large losses -of nitrogen from leaching and denitrification during the early stage of -crop development. The 20-day period is chosen as an optimization to -limit fertilizer application to the emergence stage. A fertilizer -counter in seconds, *f*, is set as soon as the onset growth for crops -initiates: - -.. math:: - :label: 25.18 - - f = n \times 86400 - -where *n* is set to 20 fertilizer application days. When the crop enters -phase 2 (leaf emergence to the beginning of grain fill) of its growth -cycle, fertilizer application begins by initializing fertilizer amount -to the total fertilizer at each grid cell divided by the initialized *f*. -Fertilizer is applied and *f* is decremented each time step until a zero balance on -the counter is reached. - - -.. _Biological nitrogen fixation for soybeans: - -Biological nitrogen fixation for soybeans -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Biological N fixation for soybeans is calculated by the fixation and uptake of -nitrogen module (Chapter :numref:`rst_FUN`). Unlike natural -vegetation, where a fraction of the vegetation are N fixers, all soybeans -are treated as N fixers. - -.. _Modified C\:N ratios for crops: - -C:N ratios for crops -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Typically, C:N ratios in plant tissue vary throughout the growing season and -tend to be lower during early growth stages and higher in later growth stages. -In order to account for this seasonal change, two sets of C:N -ratios are established in CLM for the leaf, stem, and fine root of -crops. This modified C:N ratio approach accounts for the nitrogen -retranslocation that occurs during phase 3 of crop growth. Leaf, stem, and root -C:N ratios for phases 1 and 2 are calculated -using the new CLM5 carbon and nitrogen allocation scheme -(Chapter :numref:`rst_CN Allocation`), which provides a target C:N value -and allows C:N to vary through time. -During grain fill (phase 3) of the crop growth cycle, a portion of the -nitrogen in the plant tissues is moved to a storage pool to fulfill -nitrogen demands of organ (reproductive pool) development, such that the -resulting C:N ratio of the plant tissue is reflective of measurements at -harvest. All C:N ratios were determined by calibration process, through -comparisons of model output versus observations of plant carbon -throughout the growth season. - -.. _Nitrogen retranslocation for crops: - -Nitrogen retranslocation for crops -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Nitrogen retranslocation in crops occurs when nitrogen that was used for -tissue growth of leaves, stems, and fine roots during the early growth -season is remobilized and used for grain development (:ref:`Pollmer et al. 1979 -`, :ref:`Crawford et al. 1982 `, :ref:`Simpson et al. 1983 -`, :ref:`Ta and Weiland 1992 `, :ref:`Barbottin et al. 2005 `, -:ref:`Gallais et al. 2006 `, :ref:`Gallais et al. 2007 `). Nitrogen allocation -for crops follows that of natural vegetation, is supplied in CLM by the -soil mineral nitrogen pool, and depends on C:N ratios for leaves, stems, -roots, and organs. Nitrogen demand during organ development is fulfilled -through retranslocation from leaves, stems, and roots. Nitrogen -retranslocation is initiated at the beginning of the grain fill stage -for all crops except soybean, for which retranslocation is after LAI decline. -Nitrogen stored in the leaf and stem is moved into a storage -retranslocation pool. For wheat and rice, nitrogen in roots is also -released into the retranslocation storage pool. The quantity of nitrogen -mobilized depends on the C:N ratio of the plant tissue, and is -calculated as - -.. math:: - :label: 25.14 - - leaf\_ to\_ retransn=n_{leaf} -\frac{c_{leaf} }{CN_{leaf}^{f} } - -.. math:: - :label: 25.15 - - stemn\_ to\_ retransn=n_{stem} -\frac{c_{stem} }{CN_{stem}^{f} } - -.. math:: - :label: 25.16 - - frootn\_ to\_ retransn=n_{froot} -\frac{c_{froot} }{CN_{froot}^{f} } - -where :math:`{C}_{leaf}`, :math:`{C}_{stem}`, and :math:`{C}_{froot}` is the carbon in the plant leaf, stem, and fine -root, respectively, :math:`{N}_{leaf}`, :math:`{N}_{stem}`, and :math:`{N}_{froot}` -is the nitrogen in the plant leaf, stem, and fine root, respectively, and :math:`CN^f_{leaf}`, -:math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N -ratio of the leaf, stem, and fine root respectively (:numref:`Table Pre- and post-grain fill CN ratios`). Since -C:N measurements are taken from mature crops, pre-grain development C:N -ratios for leaves, stems, and roots are optimized to allow maximum -nitrogen accumulation for later use during organ development. Post-grain -fill C:N ratios are assigned the same as crop residue. Once excess -nitrogen is moved into the retranslocated pool, during the remainder of -the growing season the retranslocated pool is used first to meet plant -nitrogen demand by assigning the available nitrogen from the -retranslocated pool equal to the plant nitrogen demand. Once the -retranslocation pool is depleted, soil mineral nitrogen pool is used to -fulfill plant nitrogen demands. - -.. _Table Pre- and post-grain fill CN ratios: - -.. table:: Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. - - +----------------------------+--------+---------------------+-----------+ - | Pre-grain fill stage | Corn | Temperate Cereals | Soybean | - +============================+========+=====================+===========+ - | :math:`{CN}_{leaf}` | 10 | 15 | 25 | - +----------------------------+--------+---------------------+-----------+ - | :math:`{CN}_{stem}` | 50 | 50 | 50 | - +----------------------------+--------+---------------------+-----------+ - | :math:`{CN}_{froot}` | 42 | 30 | 42 | - +----------------------------+--------+---------------------+-----------+ - | Post-grain fill stage | | | | - +----------------------------+--------+---------------------+-----------+ - | :math:`CN_{leaf}^{f}` | 65 | 65 | 65 | - +----------------------------+--------+---------------------+-----------+ - | :math:`CN_{stem}^{f}` | 120 | 100 | 130 | - +----------------------------+--------+---------------------+-----------+ - | :math:`CN_{froot}^{f}` | 42 | 40 | 42 | - +----------------------------+--------+---------------------+-----------+ - | :math:`CN_{repr}^{f}` | 50 | 40 | 60 | - +----------------------------+--------+---------------------+-----------+ - -.. _Separate reproductive pool: - -Separate reproductive pool -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -One notable difference between natural vegetation and crops is the -presence of a reproductive carbon pool (and nitrogen pool). Accounting -for the reproductive pool helps determine whether crops are performing -reasonably through yield calculations. -The reproductive pool is maintained similarly to the leaf, stem, -and fine root pools, but allocation of carbon and nitrogen does not -begin until the grain fill stage of crop development. Eq. :eq:`(5)` shows the -carbon and nitrogen allocation coefficients to the reproductive pool. -In CLM, as allocation declines -during the grain fill stage of growth, increasing amounts of carbon and -nitrogen are available for grain development. - -.. _Latitude vary base tempereature for growing degree days: - -Latitude vary base tempereature for growing degree days -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For both rainfed and irrigated spring wheat and sugarcane, -a latitude vary base temperature in calculating :math:`GDD_{T_{{\rm 2m}} }` -(growing degree days since planting) was introduced. - -.. math:: - :label: 25.17 - - latitude\ vary\ baset = \left\{ - \begin{array}{lr} - baset +12 - 0.4 \times latitude &\qquad 0 \le latitude \le 30 \\ - baset +12 + 0.4 \times latitude &\qquad -30 \le latitude \le 0 - \end{array} \right\} - -where :math:`baset` is the 5\ :sup:`th` column in :numref:`Table Crop plant functional types`. -Such latitude vary baset could increase the base temperature, slow down :math:`GDD_{T_{{\rm 2m}} }` -accumulation, and extend the growing season for -30º to 30º regions for spring wheat -and sugarcane. From 4cf8315e1c6cbed837761b7ec6ef8e923ca9a216 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 13 Jun 2017 16:45:17 -0600 Subject: [PATCH 066/730] Update html --- .../Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 7d959d3f39..f7219c640e 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -358,7 +358,7 @@ allocation decline factors, and :math:`a_{leaf}^{f}` and coefficients (:numref:`Table Crop pfts`). Nitrogen retranslocation for crops -,,,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, Nitrogen retranslocation in crops occurs when nitrogen that was used for tissue growth of leaves, stems, and fine roots during the early growth @@ -484,7 +484,7 @@ the counter is reached. .. _Biological nitrogen fixation for soybeans: Biological nitrogen fixation for soybeans -'''''''''''''''''''''''''''''' +'''''''''''''''''''''''''''''''''''''''''' Biological N fixation for soybeans is calculated by the fixation and uptake of nitrogen module (Chapter :numref:`rst_FUN`). Unlike natural vegetation, where a fraction of the vegetation are N fixers, all soybeans @@ -493,7 +493,7 @@ are treated as N fixers. .. _Latitude vary base tempereature for growing degree days: Latitude vary base tempereature for growing degree days -'''''''''''''''''''''''''''''' +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' For both rainfed and irrigated spring wheat and sugarcane, a latitude vary base temperature in calculating :math:`GDD_{T_{{\rm 2m}} }` (growing degree days since planting) was introduced. From 9d9e6e71b0eb5ff1be5e9a5cda747028e86b26c3 Mon Sep 17 00:00:00 2001 From: Yaqiong Lu Date: Wed, 14 Jun 2017 12:55:06 -0600 Subject: [PATCH 067/730] updated crop chapter tables and text --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 307 ++++++++++++------ 1 file changed, 201 insertions(+), 106 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index f7219c640e..a9eafc3320 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -118,7 +118,7 @@ In tropical regions, parameter values were developed for the Amazon Basin, and p date window is shifted by six months relative to the Northern Hemisphere. In addition, CLM’s default list of plant functional types (pfts) includes an -irrigated and unirrigated unmanaged C3 crop (Table 25.1) treated as a second C3 grass. +irrigated and unirrigated unmanaged C3 crop (:numref:`Table Crop plant functional types`) treated as a second C3 grass. The unmanaged C3 crop is only used when the crop model is not active and has grid cell coverage assigned from satellite data, and the unmanaged C3 irrigated crop type is currently not used @@ -129,11 +129,86 @@ Each of the inactive crop types is simulated using the parameters of the spatially closest associated crop type that is most similar to the functional type (e.g., C3 or C4), which is required to maintain similar phenological parameters based on temperature thresholds. Information detailing which parameters are used for each crop type is -included in Table 25.1. It should be noted that pft-level history output merges +included in :numref:`Table Crop plant functional types`. It should be noted that pft-level history output merges all crop types into the actively managed crop type, so analysis of crop-specific output will require use of the land surface dataset to remap the yields of each actively and inactively managed crop type. +.. _Table Crop plant functional types: + +.. table:: Crop plant functional types (pfts) in CLM5BGCCROP. + + === =========================== ================ =========================== + ITV Plant function types (PFTs) Management Class Crop Parameters Used + === =========================== ================ =========================== + 15 c3 unmanaged rainfed crop none not applicable + 16 c3 unmanaged irrigated crop none not applicable + 17 rainfed temperate corn active rainfed temperate corn + 18 irrigated temperate corn active irrigated temperate corn + 19 rainfed spring wheat active rainfed spring wheat + 20 irrigated spring wheat active irrigated spring wheat + 21 rainfed winter wheat inactive rainfed spring wheat + 22 irrigated winter wheat inactive irrigated spring wheat + 23 rainfed temperate soybean active rainfed temperate soybean + 24 irrigated temperate soybean active irrigated temperate soybean + 25 rainfed barley inactive rainfed spring wheat + 26 irrigated barley inactive irrigated spring wheat + 27 rainfed winter barley inactive rainfed spring wheat + 28 irrigated winter barley inactive irrigated spring wheat + 29 rainfed rye inactive rainfed spring wheat + 30 irrigated rye inactive irrigated spring wheat + 31 rainfed winter rye inactive rainfed spring wheat + 32 irrigated winter rye inactive irrigated spring wheat + 33 rainfed cassava inactive rainfed rice + 34 irrigated cassava inactive irrigated rice + 35 rainfed citrus inactive rainfed spring wheat + 36 irrigated citrus inactive irrigated spring wheat + 37 rainfed cocoa inactive rainfed rice + 38 irrigated cocoa inactive irrigated rice + 39 rainfed coffee inactive rainfed rice + 40 irrigated coffee inactive irrigated rice + 41 rainfed cotton active rainfed cotton + 42 irrigated cotton active irrigated cotton + 43 rainfed datepalm inactive rainfed cotton + 44 irrigated datepalm inactive irrigated cotton + 45 rainfed foddergrass inactive rainfed spring wheat + 46 irrigated foddergrass inactive irrigated spring wheat + 47 rainfed grapes inactive rainfed spring wheat + 48 irrigated grapes inactive irrigated spring wheat + 49 rainfed groundnuts inactive rainfed rice + 50 irrigated groundnuts inactive irrigated rice + 51 rainfed millet inactive rainfed tropical corn + 52 irrigated millet inactive irrigated tropical corn + 53 rainfed oilpalm inactive rainfed rice + 54 irrigated oilpalm inactive irrigated rice + 55 rainfed potatoes inactive rainfed spring wheat + 56 irrigated potatoes inactive irrigated spring wheat + 57 rainfed pulses inactive rainfed spring wheat + 58 irrigated pulses inactive irrigated spring wheat + 59 rainfed rapeseed inactive rainfed spring wheat + 60 irrigated rapeseed inactive irrigated spring wheat + 61 rainfed rice active rainfed rice + 62 irrigated rice active irrigated rice + 63 rainfed sorghum inactive rainfed tropical corn + 64 irrigated sorghum inactive irrigated tropical corn + 65 rainfed sugarbeet inactive rainfed spring wheat + 66 irrigated sugarbeet inactive irrigated spring wheat + 67 rainfed sugarcane active rainfed sugarcane + 68 irrigated sugarcane active irrigated sugarcane + 69 rainfed sunflower inactive rainfed spring wheat + 70 irrigated sunflower inactive irrigated spring wheat + 71 rainfed miscanthus inactive rainfed tropical corn + 72 irrigated miscanthus inactive irrigated tropical corn + 73 rainfed switchgrass inactive rainfed tropical corn + 74 irrigated switchgrass inactive irrigated tropical corn + 75 rainfed tropical corn active rainfed tropical corn + 76 irrigated tropical corn active irrigated tropical corn + 77 rainfed tropical soybean active rainfed tropical soybean + 78 irrigated tropical soybean active irrigated tropical soybean + === =========================== ================ =========================== + + + .. _Phenology: Phenology @@ -155,8 +230,8 @@ maturity and harvest. Planting ''''''''''''''''' -Corn and temperate cereals must meet the following requirements between -April 1\ :sup:`st` and June 14\ :sup:`th` for planting in the northern hemisphere (NH): +All crops must meet the following requirements between the minimum planting date and the maximum +planting date (for northern hemisphere) in :numref:`Table Crop phenology parameters`: .. math:: :label: 25.1 @@ -171,41 +246,36 @@ where :math:`{T}_{10d}` is the 10-day running mean of :math:`{T}_{2m}`, (the sim temperature at every model time step) and :math:`T_{10d}^{\min}` is the 10-day running mean of :math:`T_{2m}^{\min }` (the daily minimum of :math:`{T}_{2m}`. :math:`{T}_{p}` and :math:`T_{p}^{\min }` are crop-specific coldest planting temperatures -(:numref:`Table Crop plant functional types`), :math:`{GDD}_{8}` is the 20-year running mean growing +(:numref:`Table Crop phenology parameters`), :math:`{GDD}_{8}` is the 20-year running mean growing degree-days (units are degree-days or :sup:`o` days) tracked from April through September (NH) base 8\ :sup:`o` C with -maximum daily increments of 30\ :sup:`o` days (see Eq.XXX ), and +maximum daily increments of 30\ :sup:`o` days (see equation :eq:`25.3`), and :math:`{GDD}_{min }`\ is the minimum growing degree day requirement -(:numref:`Table Crop plant functional types`). Soy must meet the same requirements but between May -1\ :sup:`st` and June 14\ :sup:`th` for planting. If the -requirements in Eq. are not met by June 14\ :sup:`th`, then corn, -soybean, and temperate cereals are still planted on June -15\ :sup:`th` as long as :math:`{GDD}_{8} > 0`. In -the southern hemisphere (SH) the NH requirements apply 6 months later. - -:math:`{GDD}_{8}` does not change as quickly as :math:`{T}_{10d}` and :math:`T_{10d}^{\min }`, so +(:numref:`Table Crop phenology parameters`). :math:`{GDD}_{8}` does not change as quickly as :math:`{T}_{10d}` and :math:`T_{10d}^{\min }`, so it determines whether the crop can be planted in a grid cell, while the two faster-changing variables determine when the crop may be planted. -At planting, each crop is assigned 1 g leaf C m\ :sup:`-2` pft +If the requirements in equation :eq:`25.1` are not met by the maximum planting date, +crops are still planted on the maximum planting date as long as :math:`{GDD}_{8} > 0`. In +the southern hemisphere (SH) the NH requirements apply 6 months later. + +At planting, each crop is assigned 3 g leaf C m\ :sup:`-2` pft column area to be transferred to the leaves upon leaf emergence. An equivalent amount of seed leaf N is assigned given the pft’s C to N -ratio for leaves (:math:`{CN}_{leaf}`). (This differs from AgroIBIS, -which uses a seed leaf area index instead of seed C.) - -At planting, the model updates the average growing degree-days necessary +ratio for leaves (:math:`{CN}_{leaf}` in :numref:`Table Crop allocation parameters`,this differs from AgroIBIS, +which uses a seed leaf area index instead of seed C). The model updates the average growing degree-days necessary for the crop to reach vegetative and physiological maturity, :math:`{GDD}_{mat}`, according to the following AgroIBIS rules: .. math:: :label: 25.2 - \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950} Date: Wed, 14 Jun 2017 17:22:32 -0600 Subject: [PATCH 068/730] Text revisions to introduction and other features section of crop chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index a9eafc3320..863e03ecfe 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -9,12 +9,11 @@ Summary of CLM5.0 updates relative to the CLM4.5 ----------------------------------------------------- We describe here the complete crop and irrigation parameterizations that -appear in CLM5.0. Corresponding information for CLM4.5 appeared on the -CLM4.5 web site in a pdf document independent of the CLM4.5 Technical -Note (:ref:`Oleson et al. 2013 `). +appear in CLM5.0. Corresponding information for CLM4.5 appeared in the +CLM4.5 Technical Note (:ref:`Oleson et al. 2013 `). -CLM5.0 includes the following updates to the CROP option, where CROP -refers to the interactive crop management model and is included by default with the BGC configuration: +CLM5.0 includes the following new updates to the CROP option, where CROP +refers to the interactive crop management model and is included as an option with the BGC configuration: - New crop functional types @@ -38,7 +37,6 @@ refers to the interactive crop management model and is included by default with - Initial seed C for planting is increased from 1 to 3 g C/m^2 - These updates appear in detail in the sections below. Many also appear in Levis et al. (:ref:`2016 `). @@ -69,7 +67,7 @@ management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 [CLM3.0, :ref:`Oleson et al. (2004) `] (not published), then coupled to the CLM3.5 (:ref:`Levis et al. 2009 `) and later released to the community with -CLM4CN (:ref:`Levis et al. 2012 `), and CLM4.5. Additional updates after the +CLM4CN (:ref:`Levis et al. 2012 `), and CLM4.5BGC. Additional updates after the release of CLM4.5 were available by request (:ref:`Levis et al. 2016 `), and those are now incorporated into CLM5. @@ -578,8 +576,9 @@ Other Features Physical Crop Characteristics '''''''''''''''''''''''''''''' +Leaf area index (*L*) is calculated as a function of XXX [update]. Stem area index (*S*) is equal to 0.1\ *L* for corn and 0.2\ *L* for -other crops, as in AgroIBIS, where *L* is the leaf area index. All live +other crops, as in AgroIBIS. All live C and N pools go to 0 after crop harvest, but the *S* is kept at 0.25 to simulate a post-harvest “stubble†on the ground. @@ -599,24 +598,26 @@ and :math:`{z}_{bot}` (m), come from the AgroIBIS formulation: Interactive Fertilization '''''''''''''''''''''''''''''' -CLM adds nitrogen directly to the soil mineral nitrogen pool to meet -crop nitrogen demands. CLM’s separate crop land unit ensures that +CLM simulates fertilization by adding nitrogen directly to the soil mineral nitrogen pool to meet +crop nitrogen demands using both industrial fertilizer and manure application. CLM’s separate crop land unit ensures that natural vegetation will not access the fertilizer applied to crops. -Fertilizer in CLM5BGCCROP is prescribed by crop function types spatially +Fertilizer in CLM5BGCCROP is prescribed by crop functional types and varies spatially for each year based on the LUMIP land use and land cover change time series (LUH2 for historical and SSPs for future) (:ref:`Lawrence et al. 2016 `). -There are two fields that are used to prescribe industrial fertilizer. -On the surface data set the field CONST_FERTNITRO_CFT specifies the -annual fertilizer application for a non-transient simulations in g N/m\ :sup:`2`/yr. -In the case of a transient simulation this is replaced by the landuse.timeseries -file with the field FERTNITRO_CFT which is also in g N/m\ :sup:`2`/yr. +One of two fields is used to prescribe industrial fertilizer based on the type of simulation. +For non-transient simulations, annual fertilizer application in g N/m\ :sup:`2`/yr +is specified on the land surface data set by the field CONST_FERTNITRO_CFT. +In transient simulations, annual fertilizer application is specified on the land use time series +file by the field FERTNITRO_CFT, which is also in g N/m\ :sup:`2`/yr. The values for both of these fields come from the LUMIP time series for each year. -In addition to the industrial fertilizer there is a background manure fertilizer -on the clm parameters file with the field manunitro. For the current CLM5BGCCROP, -this is set to 0.002 kg N/m\ :sup:`2`/yr. Since CLM’s denitrification rate is high -and results in a 50% loss of the unused available nitrogen each day, -fertilizer is applied slowly to minimize the loss and maximize plant -uptake. Fertilizer application begins during the emergence phase of crop +In addition to the industrial fertilizer, background manure fertilizer is specified +on the parameter file by the field 'manunitro'. For the current CLM5BGCCROP, +manure N is applied at a rate of 0.002 kg N/m\ :sup:`2`/yr. Because previous versions +of CLM (e.g., CLM4) had rapid denitrification rates, fertilizer is applied slowly +to minimize N loss (primarily through denitrification) and maximize plant uptake. +The current implementation of CLM5 inherits this legacy, although denitrification rates +are slower in the current version of the model (:ref:`Koven et al. 2013 `). As such, +fertilizer application begins during the emergence phase of crop development and continues for 20 days, which helps reduce large losses of nitrogen from leaching and denitrification during the early stage of crop development. The 20-day period is chosen as an optimization to @@ -648,24 +649,25 @@ are treated as N fixers. .. _Latitude vary base tempereature for growing degree days: -Latitude vary base tempereature for growing degree days +Latitudinal variation in base growth tempereature '''''''''''''''''''''''''''''''''''''''''''''''''''''''' -For both rainfed and irrigated spring wheat and sugarcane, -a latitude vary base temperature in calculating :math:`GDD_{T_{{\rm 2m}} }` -(growing degree days since planting) was introduced. +For most crops, :math:`GDD_{T_{{\rm 2m}} }` (growing degree days since planting) +is the same in all locations. However, +the for both rainfed and irrigated spring wheat and sugarcane, the calculation of +:math:`GDD_{T_{{\rm 2m}} }` allows for latitudinal variation: .. math:: :label: 25.11 - latitude\ vary\ baset = \left\{ + latitudinal\ variation\ in\ base\ T = \left\{ \begin{array}{lr} baset +12 - 0.4 \times latitude &\qquad 0 \le latitude \le 30 \\ baset +12 + 0.4 \times latitude &\qquad -30 \le latitude \le 0 \end{array} \right\} -where :math:`baset` is the 5\ :sup:`th` row in :numref:`Table Crop phenology parameters`. -Such latitude vary baset could increase the base temperature, slow down :math:`GDD_{T_{{\rm 2m}} }` -accumulation, and extend the growing season for -30º to 30º regions for spring wheat +where :math:`baset` is the *base temperature for GDD* (7\ :sup:`th` row) in :numref:`Table Crop phenology parameters`. +Such latitudinal variation in base growth temperature could increase the base temperature, slow down :math:`GDD_{T_{{\rm 2m}} }` +accumulation, and extend the growing season for regions within 30ºS to 30ºN for spring wheat and sugarcane. .. _Separate reproductive pool: @@ -678,9 +680,9 @@ for the reproductive pool helps determine whether crops are performing reasonably through yield calculations. The reproductive pool is maintained similarly to the leaf, stem, and fine root pools, but allocation of carbon and nitrogen does not -begin until the grain fill stage of crop development. Eq. :eq:`(5)` shows the +begin until the grain fill stage of crop development. Equation :eq:`25.5` describes the carbon and nitrogen allocation coefficients to the reproductive pool. -In CLM, as allocation declines +In CLM5BGCCROP, as allocation declines during the grain fill stage of growth, increasing amounts of carbon and nitrogen are available for grain development. From 944cbcec2ee5b26b0f05a1dd2c01c93b4227c79b Mon Sep 17 00:00:00 2001 From: Yaqiong Lu Date: Thu, 15 Jun 2017 10:36:11 -0600 Subject: [PATCH 069/730] changed crop text --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 863e03ecfe..4ceedd3c28 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -229,7 +229,7 @@ Planting ''''''''''''''''' All crops must meet the following requirements between the minimum planting date and the maximum -planting date (for northern hemisphere) in :numref:`Table Crop phenology parameters`: +planting date (for the northern hemisphere) in :numref:`Table Crop phenology parameters`: .. math:: :label: 25.1 @@ -252,15 +252,14 @@ maximum daily increments of 30\ :sup:`o` days (see equation :eq:`25.3`), and (:numref:`Table Crop phenology parameters`). :math:`{GDD}_{8}` does not change as quickly as :math:`{T}_{10d}` and :math:`T_{10d}^{\min }`, so it determines whether the crop can be planted in a grid cell, while the two faster-changing variables determine when the crop may be planted. - If the requirements in equation :eq:`25.1` are not met by the maximum planting date, crops are still planted on the maximum planting date as long as :math:`{GDD}_{8} > 0`. In the southern hemisphere (SH) the NH requirements apply 6 months later. -At planting, each crop is assigned 3 g leaf C m\ :sup:`-2` pft -column area to be transferred to the leaves upon leaf emergence. An +At planting, each crop seed pool is assigned 3 gC m\ :sup:`-2` from its +grain product pool. The seed carbon transferred to the leaves upon leaf emergence. An equivalent amount of seed leaf N is assigned given the pft’s C to N -ratio for leaves (:math:`{CN}_{leaf}` in :numref:`Table Crop allocation parameters`,this differs from AgroIBIS, +ratio for leaves (:math:`{CN}_{leaf}` in :numref:`Table Crop allocation parameters`, this differs from AgroIBIS, which uses a seed leaf area index instead of seed C). The model updates the average growing degree-days necessary for the crop to reach vegetative and physiological maturity, :math:`{GDD}_{mat}`, according to the following AgroIBIS rules: @@ -272,8 +271,8 @@ for the crop to reach vegetative and physiological maturity, where :math:`{GDD}_{10}` is the 20-year running mean growing degree-days tracked from April through September (NH) base -10\ :math:`{}^\circ`\ C with maximum daily increments of -30\ :math:`{}^\circ`\ days. Equation :eq:`25.3` shows how we calculate +10\ :sup:`o`\C with maximum daily increments of +30\ :sup:`o`\days. Equation :eq:`25.3` shows how we calculate :math:`{GDD}_{0}`, :math:`{GDD}_{8}`, and :math:`{GDD}_{10}`: .. math:: @@ -294,12 +293,13 @@ Leaf emergence According to AgroIBIS, leaves may emerge when the growing degree-days of soil temperature to 0.05 m depth tracked since planting (:math:`GDD_{T_{soi} }` ) reaches 1 to 5% of :math:`{GDD}_{mat}` -(:numref:`Table Crop phenology parameters`). :math:`GDD_{T_{soi} }` is base 8, 0, and -10\ :math:`{}^\circ`\ C for corn, soybean, and temperate cereals. -Leaf onset, as defined in the CN part of the model, occurs in the first +(:numref:`Table Crop phenology parameters`). The base temperature for :math:`GDD_{T_{soi} }` +are listed in :numref:`Table Crop phenology parameters`. +Leaf onset occurs in the first time step of phase 2, at which moment all seed C is transferred to leaf C. Subsequently, the leaf area index generally increases and reaches -a maximum value during phase 2. +a maximum value during phase 2. Stem and root C are also increasing, based on +the carbon allocation algorithem in section :numref:`Leaf emergence to grain fill`. .. _Grain fill: @@ -368,13 +368,13 @@ similar in structure to the wood product pools. Notes: :math:`Date_{planting}^{min}` and :math:`Date_{planting}^{max}` are the minimum and maximum planting date in the Northern Hemisphere, the corresponding dates in the Southern Hemisphere apply 6 months later. -:math:`T_{p}` and :math:`T_{p}^{ min }` are crop-specific temperatures threshold for planting. +:math:`T_{p}` and :math:`T_{p}^{ min }` are crop-specific coldest planting temperatures. :math:`{GDD}_{min}` is the lowest (for planting) 20-year running mean growing degree-days base -on the base temperature in the 5\ :sup:`th` row, tracked from April to September (NH). +on the base temperature in the 7\ :sup:`th` row, tracked from April to September (NH). :math:`{GDD}_{mat}` is a crop’s 20-year running mean growing degree-days needed for vegetative and physiological maturity. Harvest occurs at 100%\ :math:`{GDD}_{mat}` or when the days past planting -reach the number in the 9\ :sup:`th` row. Crop growth phases +reach the number in the 11\ :sup:`th` row. Crop growth phases are described in the text. :math:`z_{top}^{\max }` is the maximum top-of-canopy height of a crop, *SLA* is specific leaf area. :math:`\chi _{L}` is the leaf orientation index, equals -1 for vertical, 0 for From a304d84830edd00b994acd1157b7e1d62d7f4c98 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 15 Jun 2017 12:11:31 -0600 Subject: [PATCH 070/730] Updates to the Introduction chapter --- .../CLM50_Tech_Note_Introduction.rst | 170 +++++------------- 1 file changed, 49 insertions(+), 121 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 7f409914b2..ded640dda9 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -1,74 +1,24 @@ -g**NCAR/TN-503+STR** -**NCAR Technical Note** -**July 2013** +**July 2017** **Technical Description of version 5.0 of the Community Land Model (CLM)** ***Coordinating Lead Authors*** -**Keith W. Oleson, David M. Lawrence** +**David M. Lawrence, Rosie Fisher, Charles D. Koven, Keith W. Oleson, Sean Swenson** ***Lead Authors*** -**Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel -Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, -Peter E. Thornton** +**Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu +** ***Contributing Authors*** -**Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, -Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William -Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, -Jinyun Tang, Zong-Liang Yang** +**Ben Andre, Ali Ashehad, Gautam Bisht, Gordon Bonan, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +L. Ruby Leung, William Lipscomb, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** -**NCAR Earth System Laboratory** - -**Climate and Global Dynamics Division** - -**NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** - -**P. O. Box 3000** - -**BOULDER, COLORADO 80307-3000** - -**ISSN Print Edition 2153-2397** - -**ISSN Electronic Edition 2153-2400** - -**NCAR TECHNICAL NOTES** - -http://library.ucar.edu/research/publish-technote - -The Technical Notes series provides an outlet for a variety of NCAR -Manuscripts that contribute in specialized ways to the body of -scientific knowledge but that are not yet at a point of a formal -journal, monograph or book publication. Reports in this series are -issued by the NCAR scientific divisions, serviced by OpenSky and -operated through the NCAR Library. Designation symbols for the series -include: - -**EDD – Engineering, Design, or Development Reports** - -Equipment descriptions, test results, instrumentation, and operating and maintenance manuals. - -**IA – Instructional Aids** - -Instruction manuals, bibliographies, film supplements, and other research or instructional aids. - -**PPR – Program Progress Reports** - -Field program reports, interim and working reports, survey reports, and plans for experiments. - -**PROC – Proceedings** - -Documentation or symposia, colloquia, conferences, workshops, and lectures. (Distribution maybe limited to attendees). - -**STR – Scientific and Technical Reports** - -Data compilations, theoretical and numerical investigations, and experimental results. The National Center for Atmospheric Research (NCAR) is operated by the nonprofit University Corporation for Atmospheric Research (UCAR) under @@ -80,43 +30,7 @@ the National Science Foundation. National Center for Atmospheric Research P. O. Box 3000, Boulder, Colorado 80307-300 -**NCAR/TN-503+STR** - -**NCAR Technical Note** - -**July 2013** - -**Technical Description of version 4.5 of the Community Land Model (CLM)** - -**Coordinating Lead Authors** - -**Keith W. Oleson, David M. Lawrence** -**Lead Authors** - -**Gordon B. Bonan, Beth Drewniak, Maoyi Huang, Charles D. Koven, Samuel -Levis, Fang Li, William J. Riley, Zachary M. Subin, Sean C. Swenson, Peter E. Thornton** - -**Contributing Authors** - -**Anil Bozbiyik, Rosie Fisher, Colette L. Heald, Erik Kluzek, -Jean-Francois Lamarque, Peter J. Lawrence, L. Ruby Leung, William -Lipscomb, Stefan Muszala, Daniel M. Ricciuto, William Sacks, Ying Sun, -Jinyun Tang, Zong-Liang Yang** - -**NCAR Earth System Laboratory** - -**Climate and Global Dynamics Division** - -**NATIONAL CENTER FOR ATMOSPHERIC RESEARCH** - -**P. O. Box 3000** - -**BOULDER, COLORADO 80307-3000** - -**ISSN Print Edition 2153-2397** - -**ISSN Electronic Edition 2153-2400** **LIST OF FIGURES** @@ -255,19 +169,16 @@ Fung, David Gochis, Alex Guenther, Tim Hoar, Forrest Hoffman, Paul Houser, Trish Jackson, Brian Kauffman, Silvia Kloster, Natalie Mahowald, Jiafu Mao, Lei Meng, Sheri Michelson, Guo-Yue Niu, Adam Phillips, Taotao Qian, Jon Radakovich, James Randerson, Nan Rosenbloom, Steve Running, -Koichi Sakaguchi, Adam Schlosser, Andrew Slater, Reto Stöckli, Quinn -Thomas, Mariana Vertenstein, Nicholas Viovy, Aihui Wang, Guiling Wang, +Koichi Sakaguchi, Adam Schlosser, Andrew Slater, Reto Stöckli, Ying Sun, Quinn +Thomas, Peter Thornton, Mariana Vertenstein, Nicholas Viovy, Aihui Wang, Guiling Wang, Charlie Zender, Xiaodong Zeng, and Xubin Zeng. -The authors also thank the following people for their review of this -document: Jonathan Buzan, Kyla Dahlin, Sanjiv Kumar, Hanna Lee, Danica -Lombardozzi, Quinn Thomas, and Will Wieder. + Current affiliations for the authors are as follows: -K.W. Oleson, D.M. Lawrence, G.B. Bonan, S. Levis, S.C. Swenson, R. -Fisher, E. Kluzek, J.-F. Lamarque, P.J. Lawrence, S. Muszala, and W. -Sacks (National Center for Atmospheric Research); B. Drewniak (Argonne +K.W. Oleson, D.M. Lawrence, G.B. Bonan, S.C. Swenson, R. +Fisher, E. Kluzek, P.J. Lawrence, W. Sacks and M. Vertenstein (National Center for Atmospheric Research); B. Drewniak (Argonne National Laboratory); M. Huang, L.R. Leung (Pacific Northwest National Laboratory); C.D. Koven, W.J. Riley, and J. Tang (Lawrence Berkeley National Laboratory); F. Li (Chinese Academy of Sciences); Z.M. Subin @@ -282,11 +193,11 @@ Austin) Introduction ================= -The purpose of this technical note is to describe the biogeophysical and +The purpose of this document is to fully describe the biogeophysical and biogeochemical parameterizations and numerical implementation of version -4.5 of the Community Land Model (CLM4.5). Scientific justification and +5.0 of the Community Land Model (CLM5.0). Scientific justification and evaluation of these parameterizations can be found in the referenced -scientific papers (:ref:`rst_References`). This technical note and the CLM4.5 +scientific papers (:ref:`rst_References`). This document and the CLM5.0 User’s Guide together provide the user with the scientific description and operating instructions for CLM. @@ -523,8 +434,7 @@ model option for coupled simulations in CESM1.2. CLM4.5 ^^^^^^^^^^^^ -The motivations for the development of CLM4.5 (the model version -described in this Technical Description) were similar to those for CLM4: +The motivations for the development of CLM4.5 were similar to those for CLM4: incorporate several recent scientific advances in the understanding and representation of land surface processes, expand model capabilities, and improve surface and atmospheric forcing datasets. @@ -541,13 +451,9 @@ problems or biases. The main modifications include updates to canopy processes including a revised canopy radiation scheme and canopy scaling of leaf processes, co-limitations on photosynthesis, revisions to photosynthetic parameters -(:ref:`Bonan et al. 2011`), - -.. todo:: had three stars here - need to resolve this - -temperature acclimation of photosynthesis, and +(:ref:`Bonan et al. 2011`), temperature acclimation of photosynthesis, and improved stability of the iterative solution in the photosynthesis and -stomatal conductance model (:ref:`Sun et al. 2012`). Hydrology updates include +stomatal conductance model (:ref:`Sun et al. 2012`). Hydrology updates included modifications such that hydraulic properties of frozen soils are determined by liquid water content only rather than total water content and the introduction of an ice impedance function, and other corrections @@ -556,10 +462,10 @@ position and allow for a perched water table above icy permafrost ground (:ref:`Swenson et al. 2012`). A new snow cover fraction parameterization is incorporated that reflects the hysteresis in fractional snow cover for a given snow depth between accumulation and melt phases (:ref:`Swenson and -Lawrence, 2012`). The lake model in CLM4 is replaced with a completely +Lawrence, 2012`). The lake model in CLM4 was replaced with a completely revised and more realistic lake model (:ref:`Subin et al. 2012a`). A surface -water store is introduced, replacing the wetland land unit and -permitting prognostic wetland distribution modeling, and the surface +water store was introduced, replacing the wetland land unit and +permitting prognostic wetland distribution modeling. The surface energy fluxes are calculated separately (:ref:`Swenson and Lawrence, 2012`) for snow-covered, water-covered, and snow/water-free portions of vegetated and crop land units, and snow-covered and snow-free portions of glacier @@ -570,9 +476,9 @@ decomposition rates modified by soil temperature, water, and oxygen limitations and also including vertical mixing of soil carbon and nitrogen due to bioturbation, cryoturbation, and diffusion (:ref:`Koven et al. 2013`). The litter and soil carbon and nitrogen pool structure as well as -nitrification and denitrification are modified based on the Century -model and biological fixation is revised to distribute fixation more -realistically over the year (:ref:`Koven et al. 2013`). The fire model is +nitrification and denitrification that were modified based on the Century +model. Biological fixation was revised to distribute fixation more +realistically over the year (:ref:`Koven et al. 2013`). The fire model was replaced with a model that includes representations of natural and anthropogenic triggers and suppression as well as agricultural, deforestation, and peat fires (:ref:`Li et al. 2012a,b`; :ref:`Li et al. 2013a`). The @@ -608,6 +514,21 @@ dataset or other alternative forcing datasets. CLM4.5 was released to the community in June 2013 along with the Community Earth System Model version 1.2 (CESM1.2). +CLM5.0 +^^^^^^^^^^^^ + +Developments for CLM5.0 build on the progress made in CLM4.5. Much of the focus of development centered on a +push towards more mechanistic treatment of several key processes, in addition to more comprehensive and explicit representation +of land use and land-cover change. In particular, + +To represent … Stomatal conductance is a function of prognostic (predicted) leaf water potential. LWP is the result of atmospheric demand and supply from soil via resistance network. + +Dynamic land units. + +Included within the codebase of the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, +reference Fisher???). This version of CLM5-FATES that is supported in this release is described here??? Short blurb on what FATES can do??? + + Biogeophysical and Biogeochemical Processes ----------------------------------------------- @@ -644,6 +565,10 @@ processes simulated include (:numref:`Figure Land processes`): #. Stomatal physiology and photosynthesis (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) +#. Prognostic photosynthetic capacity (Chapter :number:`rst_Photosynthetic Capacity`) + +#. Plant hydraulics (Chapter :number: `rst_Plant Hydraulics`) + #. Lake temperatures and fluxes (Chapter :numref:`rst_Lake Model`) #. Glacier processes (Chapter :numref:`rst_Glaciers`) @@ -652,19 +577,22 @@ processes simulated include (:numref:`Figure Land processes`): #. Urban energy balance and climate (Chapter :numref:`rst_Urban Model (CLMU)`) -#. Vegetation carbon and nitrogen allocation and respiration (Chapter - :numref:`rst_CN Allocation`) +#. Vegetation carbon and nitrogen allocation (Chapter :numref:`rst_CN Allocation`) #. Vegetation phenology (Chapter :numref:`rst_Vegetation Phenology and Turnover`) +#. Plant respiration (Chapter :number:`rst_Plant Respiration`) + #. Soil and litter carbon decomposition (Chapter :numref:`rst_Decomposition`) -#. Nitrogen cycling including deposition, biological fixation, +#. Fixation and uptake of nitrogen (Chapter :number:`rst_FUN`) + +#. External nitrogen cycling including deposition, denitrification, leaching, and losses due to fire (Chapter :numref:`rst_External Nitrogen Cycle`) #. Plant mortality (Chapter :numref:`rst_Plant Mortality`) -#. Fire ignition and suppression, including natural, deforestation, and +#. Fire ignition, suppression, spread, and emissions, including natural, deforestation, and agricultural fire (Chapter :numref:`rst_Fire`) #. Methane production, oxidation, and emissions (Chapter :numref:`rst_Methane Model`) From cee897951a2db6502bc83202ca8e3ed8a17062af Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Thu, 15 Jun 2017 14:14:12 -0600 Subject: [PATCH 071/730] A few small changes to the crop chapter in collaboration with Yaqiong --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 4ceedd3c28..a40cba747e 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -532,7 +532,12 @@ Harvest to food and seed In CLM5, the C and N required for crop seeding is removed from the grain product pool during harvest and used to seed crops in the subsequent year. -Caluating the crop yields requires... +Caluating the crop yields requires that you sum the GRAINC_TO_FOOD variable +for each year. Additionally, harvest is not typically 100% efficient, so +analysis needs to assume that harvest efficiency is less. We assume a harvest +efficiency of 85%, and a grain C of 45% of the grain dry weight. + +equation (g/m^2) = (sum(GRAINC_TO_FOOD)/0.45)*.85 @@ -576,8 +581,9 @@ Other Features Physical Crop Characteristics '''''''''''''''''''''''''''''' -Leaf area index (*L*) is calculated as a function of XXX [update]. -Stem area index (*S*) is equal to 0.1\ *L* for corn and 0.2\ *L* for +Leaf area index (*L*) is calculated as a function of specific leaf area +(SLA) and leaf C (:ref:`Crop phenology parameters`). +Stem area index (*S*) is equal to 0.1\ *L* for temperate and tropical corn and sugarcane and 0.2\ *L* for other crops, as in AgroIBIS. All live C and N pools go to 0 after crop harvest, but the *S* is kept at 0.25 to simulate a post-harvest “stubble†on the ground. From d0b6860393ac2cc0a4ca98ac9c7569c13e26a8dc Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 15 Jun 2017 14:27:02 -0600 Subject: [PATCH 072/730] Update MOSART Chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 26 +++- .../CLM50_Tech_Note_Plant_Hydraulics.rst | 2 +- .../tech_note/RTM/CLM50_Tech_Note_RTM.rst | 141 ------------------ .../References/CLM50_Tech_Note_References.rst | 37 +++++ doc/source/tech_note/index.rst | 2 +- 5 files changed, 57 insertions(+), 151 deletions(-) delete mode 100644 doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 4ceedd3c28..11d8f6c109 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -38,7 +38,7 @@ refers to the interactive crop management model and is included as an option wit - Initial seed C for planting is increased from 1 to 3 g C/m^2 These updates appear in detail in the sections below. Many also appear in -Levis et al. (:ref:`2016 `). +:ref:`Levis et al. (2016) `. .. _The crop model: @@ -65,7 +65,7 @@ simulate dynamic vegetation (:ref:`Kucharik et al. 2000 `) and crop management (:ref:`Kucharik and Brye 2003 `). The interactive crop management parameterizations from AgroIBIS (March 2003 version) were coupled as a proof-of-concept to the Community Land Model version 3 -[CLM3.0, :ref:`Oleson et al. (2004) `] (not published), then coupled to the +[CLM3.0, :ref:`Oleson et al. (2004) ` ] (not published), then coupled to the CLM3.5 (:ref:`Levis et al. 2009 `) and later released to the community with CLM4CN (:ref:`Levis et al. 2012 `), and CLM4.5BGC. Additional updates after the release of CLM4.5 were available by request (:ref:`Levis et al. 2016 `), @@ -106,8 +106,8 @@ CLM5 includes eight actively managed crop types (temperate soybean, tropical soybean, temperate corn, tropical corn, spring wheat, cotton, rice, and sugarcane) that are chosen based on the availability of corresponding algorithms in AgroIBIS and as -developed by Badger and Dirmeyer (:ref:`2015 `) and -described by Levis et al. (:ref:`2016 `). The representations of +developed by :ref:`Badger and Dirmeyer (2015)` and +described by :ref:`Levis et al. (2016)`. The representations of sugarcane, rice, cotton, tropical corn, and tropical soy are new in CLM5. Sugarcane and tropical corn are both C4 plants and are therefore represented using the temperate corn functional form. Tropical soybean uses the temperate @@ -234,7 +234,7 @@ planting date (for the northern hemisphere) in :numref:`Table Crop phenology par .. math:: :label: 25.1 - \begin{array}{l} + \begin{array}{c} {T_{10d} >T_{p} } \\ {T_{10d}^{\min } >T_{p}^{\min } } \\ {GDD_{8} \ge GDD_{\min } } @@ -267,7 +267,13 @@ for the crop to reach vegetative and physiological maturity, .. math:: :label: 25.2 - \begin{array}{l} {GDD_{{\rm mat}}^{{\rm corn,sugarcane}} =0.85GDD_{{\rm 8}} {\rm \; \; \; and\; \; \; 950}`) .. math:: :label: 11.12 - dx_{root,i} = \left(\pi \cdot L_i\right)^{\frac{1}{2}} + dx_{root,i} = \left(\pi \cdot L_i\right)^{- \frac{1}{2}} where :math:`L_{i}` is the root length density (m m :sup:`-3`) diff --git a/doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst b/doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst deleted file mode 100644 index 773b3f2fe6..0000000000 --- a/doc/source/tech_note/RTM/CLM50_Tech_Note_RTM.rst +++ /dev/null @@ -1,141 +0,0 @@ -.. _rst_River Transport Model (RTM): - -River Transport Model (RTM) -=============================== - -The RTM was developed to route total runoff from the land surface model -to either the active ocean or marginal seas which enables the hydrologic -cycle to be closed (Branstetter 2001, Branstetter and Famiglietti 1999). -This is needed to model ocean convection and circulation, which is -affected by freshwater input. It also provides another method of -diagnosing the performance of the land model because the river flow can -be directly compared to gauging station data (e.g., Dai and Trenberth -2002). - -To improve global energy conservation when CLM is being run as part of -the Community Climate System Model, runoff is split into two streams, a -liquid water stream and an ice water stream (derived from excess -snowfall in snow-capped grid cells, section 7.7). The liquid and ice -streams are routed through the RTM, passed to, and dealt with by the -ocean separately. - -The RTM uses a linear transport scheme to route water from each grid -cell to its downstream neighboring grid cell. The change in storage -:math:`S` of river water, whether it be liquid or ice, within a RTM grid -cell (m\ :sup:`3` s\ :sup:`-1`) is - -.. math:: - :label: 14.1) - - \frac{dS}{dt} =\sum F_{in} -F_{out} +R - -where :math:`\sum F_{in}` is the sum of inflows of water from -neighboring upstream grid cells (m\ :sup:`3` s\ :sup:`-1`), -:math:`F_{out}` is the flux of water leaving the grid cell in the -downstream direction (m :sup:`3` s\ :sup:`-1`), and :math:`R` -is the total runoff generated by the land model grid cell -(m\ :sup:`3` s\ :sup:`-1`). Downstream water flow direction in -each grid cell is determined as one of eight compass points (north, -northeast, east, southeast, south, southwest, west, and northwest) based -on the steepest downhill slope as determined from a digital elevation -model (Graham et al. 1999). The flux of water leaving the grid cell -:math:`F_{out}` is - -.. math:: - :label: 14.2) - - F_{out} =\frac{v}{d} S - -where :math:`v` is the effective water flow velocity (m -s\ :sup:`-1`), :math:`d` is the distance between centers of -neighboring grid cells (m), and :math:`S` is the volume of river water -stored within the grid cell (m\ :sup:`3`). The effective water flow -velocity can be estimated from Manning’s equation, which is a function -of surface water slope, the hydraulic radius of the river channel, and a -channel roughness coefficient (Dingman, 2002). However, hydraulic radius -and channel roughness data are not available globally, so a simplified -effective flow velocity expression is used in RTM - -.. math:: - :label: 14.3) - - v=\max \left(0.05,k\beta ^{1/2} \right) - -where :math:`\beta` is the grid cell mean topographic slope, and -:math:`k=1`. - -The distance :math:`d` between two grid cell centers depends on river -direction, latitude, and longitude as - -.. math:: - :label: 14.4) - - d=\sqrt{\Delta x^{2} +\Delta y^{2} } . - -The distance in the zonal direction :math:`\Delta x` (m) is - -.. math:: - :label: 14.5) - - \Delta x=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right)\left[0.5\left(\cos \phi _{i,\, j} +\cos \phi _{i*,\, j*} \right)\right] - -where :math:`\theta _{i,\, j}` and :math:`\theta _{i*,\, j*}` are the -latitudes (radians) of the upstream and downstream grid cells, -:math:`\phi _{i,\, j}` and :math:`\phi _{i*,\, j*}` are the longitudes -(radians) of the upstream and downstream grid cells, :math:`R_{e}` is -the radius of the earth (km) (Table 2.6), and :math:`i` and :math:`j` -are grid cell indices. The distance in the meridional direction -:math:`\Delta y` (m) is - -.. math:: - :label: 14.6) - - \Delta y=\left(1\times 10^{3} \left|\theta _{i,\, j} -\theta _{i*,\, j*} \right|R_{e} \right). - -The RTM is generally run at a time step greater than that of the CLM -because of computational constraints. The total runoff from the land -model at each time step is accumulated until the RTM is invoked. The -total liquid water runoff at the land model resolution (kg -m\ :sup:`-2` s\ :sup:`-1`) is - -.. math:: - :label: 14.7) - - R_{liq} =q_{over} +q_{drai} +q_{rgwl} - -where :math:`q_{over}` is surface runoff (section 7.3), -:math:`q_{drai}` is sub-surface drainage (section 7.6), and -:math:`q_{rgwl}` is liquid runoff from glaciers, wetlands, and lakes -(all in kg m\ :sup:`-2` s\ :sup:`-1`) (sections 7.7 and -9.6.3). The total ice water runoff, also at the land model resolution is - -.. math:: - :label: 14.8) - - R_{ice} =q_{snwcp,ice} - -where :math:`q_{snwcp,ice}` is the ice runoff from snow-capped -surfaces (section 7.7). The runoff at the land model resolution is -interpolated to the resolution of RTM and converted to units of -m\ :sup:`3` s\ :sup:`-1` for use in equation (11.1) by multiplying -by :math:`1\times 10^{-3} A` where :math:`A` is the area -(m\ :sup:`2`) of the RTM grid cell. - -The RTM grid cells that are at river mouths, hence providing freshwater -flux to the ocean, are identified by examining each RTM ocean grid cell -and determining if a RTM land grid cell flows to that ocean grid cell. -River mouth grid cells are also assigned if any overlapping grid cells -at the land model resolution contain land. When used as part of the -Community Climate System Model, the ocean freshwater liquid and ice -fluxes at the RTM resolution are passed to the flux coupler which -distributes the fluxes to the appropriate ocean grid cells. When used -with the Community Atmosphere Model or when run offline, RTM serves only -as a diagnostic tool. The river-routing scheme conserves water globally -as - -.. math:: - :label: 14.9) - - \sum _{i,\, j}\left(\frac{dS}{dt} \right) _{i,\, j} =\sum _{i,\, j}R_{i,\, j} . - - diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 076af343be..97e221f702 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -543,6 +543,12 @@ overview of ABRACOS. pp. 1-14. In: J.H.C. Gash, C.A. Nobre, J.M. Roberts, and R.L. Victoria (editors) Amazonian Deforestation and Climate. John Wiley and Sons, Chichester, England. +.. _Getiranaetal2012: + +Getirana, A. C. V., A. Boone, D. Yamazaki, B. Decharme, F. Papa, and +N. Mognard. 2012. The hydrological modeling and analysis platform +(HyMAP): Evaluation in the Amazon basin, J. Hydrometeorol., 13, 1641–1665. + .. _Gholzetal1985: Gholz, H.L., Perry, C.S., Cropper, W.P., Jr. and Hendry, L.C., 1985. @@ -976,6 +982,11 @@ Climate 25:3071-3095. DOI:10.1175/JCLI-D-11-00256.1. Lehner, B. and Döll, P., 2004. Development and validation of a global database of lakes, reservoirs and wetlands, J. Hydrol., 296, 1–22. +.. _Lehneretal2008: + +Lehner, B., Verdin, K. and Jarvis, A., 2008. New global hydrograhy +derived from spaceborne elevation data. Eos Trans., AGU, 89, 93 – 94. + .. _LePageetal2010: Le Page, Y., van der Werf, G.R., Morton, D.C., and Pereira, J.M.C. 2010. @@ -1079,6 +1090,20 @@ the Community Land Model 4.0 using observations from flux towers and a mountainous watershed. J. Geophys. Res. 116:D24120. DOI:10.1029/2011JD016276. +.. _Lietal2015a: + +Li, H., L. Leung, A. Getirana, M. Huang, H. Wu, Y. Xu, J. Guo and +N. Voisin. 2015a. Evaluating global streamflow simulations by a +physically-based routing model coupled with the Community Land Model, +J. of Hydromet., 16(2):948-971, doi: 10.1175/JHM-D-14-0079.1 + +.. _Lietal2015b: + +Li, H., L. Leung, T. Tesfa, N. Voisin, M. Hejazi, L. Liu, Y. Liu, +J. Rice, H. Wu, and X. Yang. 2015. Modeling stream temperature in the +Anthropocene: An earth system modeling approach, J. Adv. Model. +Earth Syst., 7, doi:10.1002/2015MS000471. + .. _Liangetal1994: Liang, X., Lettenmaier, D.P., Wood, E.F., and Burges, S.J. 1994. A @@ -2054,6 +2079,18 @@ DOI:10.1029/91JD01786. World Bank, 2004. World development indicators 2004, Oxford University Press, New York, 416 pp. +.. _Wuetal2011: + +Wu, H., J. S. Kimball, N. Mantua, and J. Stanford, 2011: Automated +upscaling of river networks for macroscale hydrological modeling. +Water Resour. Res., 47, W03517, doi:10.1029/2009WR008871. + +.. _Wuetal2012: + +Wu, H., J. S. Kimball, H. Li, M. Huang, L. R. Leung, and R. F. Adler +(2012), A New Global River Network Database for Macroscale Hydrologic +modeling, Water Resour. Res., 48, W09701, doi:10.1029/2012WR012313. + .. _Yang1998: Yang, Z.-L. 1998. Technical note of a 10-layer soil moisture and diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index a05aa6210b..3f60029854 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -26,7 +26,7 @@ CLM Technical Note Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst Lake/CLM50_Tech_Note_Lake.rst Glacier/CLM50_Tech_Note_Glacier.rst - RTM/CLM50_Tech_Note_RTM.rst + MOSART/CLM50_Tech_Note_MOSART.rst Urban/CLM50_Tech_Note_Urban.rst CN_Pools/CLM50_Tech_Note_CN_Pools.rst Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst From 1179e59af9ccf43e14d4dc7e5f149d5b16e4b21d Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 15 Jun 2017 15:01:16 -0600 Subject: [PATCH 073/730] Add table to MOSART --- .../CLM50_Tech_Note_Introduction.rst | 13 +- .../MOSART/CLM50_Tech_Note_MOSART.rst | 243 ++++++++++++++++++ 2 files changed, 250 insertions(+), 6 deletions(-) create mode 100644 doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index ded640dda9..bbad06b077 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -11,8 +11,7 @@ ***Lead Authors*** -**Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu -** +**Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu** ***Contributing Authors*** @@ -128,6 +127,8 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Plant functional type root distribution parameters` Plant functional type root distribution parameters. +- :numref:`Table MOSART Parameters` List of parameters in the global hydrography dataset. + - :numref:`Table Allocation and CN ratio parameters` Allocation and carbon:nitrogen ratio parameters - :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. @@ -565,9 +566,9 @@ processes simulated include (:numref:`Figure Land processes`): #. Stomatal physiology and photosynthesis (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) -#. Prognostic photosynthetic capacity (Chapter :number:`rst_Photosynthetic Capacity`) +#. Prognostic photosynthetic capacity (Chapter :numref:`rst_Photosynthetic Capacity`) -#. Plant hydraulics (Chapter :number: `rst_Plant Hydraulics`) +#. Plant hydraulics (Chapter :numref: `rst_Plant Hydraulics`) #. Lake temperatures and fluxes (Chapter :numref:`rst_Lake Model`) @@ -581,11 +582,11 @@ processes simulated include (:numref:`Figure Land processes`): #. Vegetation phenology (Chapter :numref:`rst_Vegetation Phenology and Turnover`) -#. Plant respiration (Chapter :number:`rst_Plant Respiration`) +#. Plant respiration (Chapter :numref:`rst_Plant Respiration`) #. Soil and litter carbon decomposition (Chapter :numref:`rst_Decomposition`) -#. Fixation and uptake of nitrogen (Chapter :number:`rst_FUN`) +#. Fixation and uptake of nitrogen (Chapter :numref:`rst_FUN`) #. External nitrogen cycling including deposition, denitrification, leaching, and losses due to fire (Chapter :numref:`rst_External Nitrogen Cycle`) diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst new file mode 100644 index 0000000000..cae3bd0493 --- /dev/null +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -0,0 +1,243 @@ +.. _rst_River Transport Model (RTM): + +Model for Scale Adaptive River Transport (MOSART) +================================================= + +.. _Overview: + +Overview +--------- + +MOSART is a river transport model designed for applications across local, +regional and global scales :ref:`(Li et al., 2013b) `. A +major purpose of MOSART is to provide freshwater input for the ocean +model in coupled Earth system model. MOSART also provides an effective +way of evaluating and diagnosing the soil hydrology simulated by land +surface models through direction comparison of the simulated river flow +with observations of natural streamflow at gauging stations +:ref:`(Li et al., 2015a)`. Moreover, MOSART provides a +modeling framework for representing riverine transport and transformation +of energy and biogeochemical fluxes under both natural and human-influenced +conditions ( :ref:`(Li et al., 2015b) `. + +.. _Routing Processes: + +Routing Processes +------------------ + +MOSART divides each spatial unit such as a lat/lon grid or watershed into +three categories of hydrologic units (as shown in +:numref:`Figure MOSART conceptual diagram`): hillslopes +that contribute both surface and subsurface runoff into tributaries, +tributaries that discharge into a single main channel, and the main channel +connects the local spatial unit with upstream/downstream units through the +river network. MOSART assumes that all the tributaries within a spatial unit +can be treated as a single hypothetical sub-network channel with a transport +capacity equivalent to all the tributaries combined. Correspondingly, three +routing processes are represented in MOSART: 1) hillslope routing: in each +spatial unit, surface runoff is routed as overland flow into the sub-network +channel, while subsurface runoff generated in the spatial unit directly enters +the sub-network channel; 2) sub-network channel routing: the sub-network channel +receives water from the hillslopes, routes water through the channel and discharges +it into the main channel; 3) main channel routing: the main channel receives water +from the sub-network channel and/or inflow, if any, from the upstream spatial units, +and discharges the water to its downstream spatial unit or the ocean. + +.. _Figure MOSART conceptual diagram: + +.. figure:: mosart_diagram.png + :width: 800px + :height: 400px + + +MOSART only route positive runoff, although negative runoff could be generated +occasionally by the land model (e.g., :math:`q_{gwl}`). Negative runoff in any +runoff component including :math:`q_{sur}`, :math:`q_{sub}`, :math:`q_{gwl}` +is mapped directly from the spatial unit where it is generated at any time step to +the basin outlet of the corresponding spatial unit. + +In MOSART, the travel velocities of water across hillslopes, sub-network and main +channel are all estimated using the Manning’s equation with different levels of +simplifications. Generally the Manning’s equation is in the form of + +.. math:: + :label: 14.1 + + V = \frac{R^{\frac{2}{3}} S_{f}}{n} + +where :math: `V` is the travel velocity (m s :sup:`-1` ), :math:`R` is the hydraulic +radius (m). :math:`S_{f}` is the friction slope, and accounting for the effects +of gravity, friction, inertia and other forces onthe water. If the channel slope +is steep enough, the gravity force dominates over the others so one can approximate +:math:`S_{f}` by the channel bed slope :math:`S` , which is the key assumption +underpinning the kinematic wave method. :math:`n` is the Manning’s roughness +coefficient, which is mainly controlled by surface roughness and sinuosity of the +flow path. + +If the water surface is sufficiently large or the water depth :math:`h` is +sufficiently shallow, the hydraulic radius can be approximated by the water depth. +This is the case for both hillslope and sub-network channel routing. + +.. math:: + :label: 14.2 + + R_{h} = h_{h} + R_{t} = h_{t} + +Here :math:`R_{h}` (m) and :math:`R_{t}` (m) are hydraulic radius for hillslope and +sub-network channel routing respectively, and :math:`h_{h}` (m) and :math:`h_{t}` +(m) are water depth during hillslope and sub-network channel routing respectively. + +For the main channel, the hydraulic radius is given by + +.. math:: + :label: 14.3 + + R_{r} = \frac{A_{r}}{P_{r}} + +where :math:`A_{r}` (m :sup:`2` ) is the wetted area defined as the part of the +channel cross-section area below the water surface, :math:`P_{r}` (m) is the +wetted perimeter (m), the perimeter confines in the wetted area. + +For hillslopes, sub-network and main channels, a common continuity equation can +be written as + +.. math:: + :label: 14.4 + + \frac{dS}{dt} = Q_{in} - Q_{out} + R + + +where :math:`Q_{in}` (m :sup:`3` s :sup:`-1` ) is the main channel flow from +the upstream grid(s) into the main channel of the current grid, which is zero for +hillslope and sub-network routing. :math:`Q_{out}` (m :sup:`3` s :sup:`-1` ) is +the outflow rate from hillslope into the sub-network, from the sub-network into +the main channel, or from the current main channel to the main channel of its +downstream grid (if not the outlet grid) or ocean (if the current grid is the +basin outlet). :math:`R` (m :sup:`3` s :sup:`-1` ) is a source term, which +could be the surface +runoff generation rate for hillslopes, or lateral inflow (from hillslopes) into +sub-network channel or water-atmosphere exchange fluxes such as precipitation +and evaporation. It is assumed that surface runoff is generated uniformly +across all the hillslopes. Currently, MOSART does not exchange water with +the atmosphere or return water to the land model so its function is strictly +to transport water from runoff generation through the hillslope, tributaries, +and main channels to the basin outlets. + +.. _Numerical Solution MOSART: + +Numerical Solution +---------------------------- + +The numerical implementation of MOSART is mainly based on a subcycling +scheme and a local time-stepping algorithm. There are two levels of +subcycling. For convenience, we denote :math:`T_{inputs}` (s), +:math:`T_{mosart}` (s), :math:`T_{hillslope}` (s) and +:math:`T_{channel}` (s) as the time steps of runoff inputs (from CLM +to MOSART via the flux coupler), MOSART routing, hillslope routing and +channel routing respectively. The first level of subcycling is between +the runoff inputs and MOSART routing. If :math:`T_{inputs}` is 10800s +and :math:`T_{mosart}` is 3600s, three MOSART time steps will be +invoked each time the runoff inputs are updated. The second level of +subcycling is between the hillslope routing and channel routing. This +is to account for the fact that the travel velocity of water across +hillslope is usually much slower than that in the channels. +:math:`T_{hillslope}` is usually set as the same as :math:`T_{mosart}`, +but within each time step of hillslope routing there are a few time +steps for channel routing, i.e., +:math:`T_{hillslope} = D_{levelH2R} \cdot T_{channel}`. The local +time-stepping algorithm is to account for the fact that the travel +velocity of water is much faster in some river channels (e.g., with +steeper bed slope, narrower channel width) than others. That is, for +each channel (either a sub-network or main channel), the final time +step of local channel routing is given as +:math:`T_{local}=T_{channel}/D_{local}`. :math:`D_{local}` is +currently estimated empirically as a function of local channel slope, +width, length and upstream drainage area. If MOSART crashes due to a +numerical issue, we recommend to increase :math:`D_{levelH2R}` and, if +the issue remains, reducing :math:`T_{mosart}`. + +.. _Parameters and Input Data: + +Parameters and Input Data +--------------------------------- + +MOSART is supported by a comprehensive, global hydrography dataset at 0.5 +:sup:`o` resolution. As such, the fundamental spatial unit of MOSART is a 0.5 +:sup:`o` lat/lon grid. The topographic parameters (such as flow direction, +channel length, topographic and channel slopes etc.) were derived using the +Dominant River Tracing (DRT) algorithm (:ref:`Wu et al., 2011` ; +:ref:`Wu et al. 2012 `). The DRT algorithm produces the topographic +parameters in a scale-consistent way to preserve/upscale the key features of +a baseline high-resolution hydrography dataset at multiple coarser spatial +resolutions. Here the baseline high-resolution hydrography dataset is the +1km resolution Hydrological data and maps based on SHuttle Elevation +Derivatives at multiple Scales (HydroSHEDS) +(:ref:`Lehner and Döll, 2004 ` ; +:ref:`Lehner et al., 2008 `). The channel geometry +parameters, e.g., bankfull width and depth, were estimated from empirical +hydraulic geometry relationships as functions of the mean annual discharge. +The Manning roughness coefficients for overland and channel flow were +calculated as functions of landcover and water depth. For more details +on the methodology to derive channel geometry and the Manning’s roughness +coefficients, please refer to +:ref:`Getirana et al. (2012) ` . The full list of +parameters included in this global hydrography dataset is provided in +the :numref:`Table MOSART Parameters`. Evaluation of global simulations +by MOSART using the aforementioned parameters is described in +:ref:`Li et al. (2015b) ` . + +.. _Table MOSART Parameters: + +.. table:: List of parameters in the global hydrography dataset + + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | Name | Unit | Description | + +=========================+===============+====================================================================================================================================+ + | :math:`F_{dir}` | \- | The D8 single flow direction for each coarse grid cell coded using 1 (E), 2 (SE), 4 (S), 8 (SW), 16 (W), 32 (NW), 64 (N), 128 (NE) | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`A_{total}` | km :sup:`2` | The upstream drainage area of each coarse grid cell | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`F_{dis}` | m | The dominant river length for each coarse grid cell | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`S_{channel}` | \- | The average channel slope for each coarse grid cell | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`S_{topographic}` | \- | The average topographic slope (for overland flow routing) for each coarse grid cell | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`A_{local}` | km :sup:`2` | The surface area for each coarse grid cell | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`D_{p}` | m :sup:`-1` | Drainage density, calculated as the total channel length within each coarse grid cell divided by the local cell area | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`D_{r}` | m | The bankfull depth of main channel | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`W_{r}` | m | The bankfull width of main channel | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`D_{t}` | m | The average bankfull depth of tributary channels | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`W_{t}` | m | The average bankfull width of tributary channels | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`n_{r}` | \- | Manning’s roughness coefficient for channel flow routing | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + | :math:`n_{h}` | \- | Manning’s roughness coefficient for overland flow routing | + +-------------------------+---------------+------------------------------------------------------------------------------------------------------------------------------------+ + + + +Difference between CLM5.0 and CLM4.5 +------------------------------------- + +1. Routing methods: RTM, a linear reservoir method, is used in CLM4.5 for +river routing, whilst in CLM5.0, MOSART is an added option for river routing +based on the more physically-based kinematic wave method. +2. Runoff treatment: In RTM runoff is routed regardless of its sign so +negative streamflow can be simulated at times. MOSART routes only nonnegative +runoff and always produces positive streamflow, which is important for +future extension for modeling riverine heat and biogeochemical fluxes. +3. Input parameters: RTM in CLM4.5 only requires one layer of spatial variable +of channel velocity, whilst MOSART in CLM5.0 requires 13 parameters that +are all available globally at 0.5 :sup:`o` resolution. +4. Outputs: RTM only produces streamflow simulation, whilst MOSART +additionally simulates the time-varying channel velocities and channel +water depth and channel surface water variation. + + From 3754e4d33471263fb24dbff22e9ea8e8ae3e21a6 Mon Sep 17 00:00:00 2001 From: Yaqiong Lu Date: Thu, 15 Jun 2017 15:20:36 -0600 Subject: [PATCH 074/730] updated crop --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 66f9d2b59f..a91ec4b6f9 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -371,7 +371,6 @@ similar in structure to the wood product pools. :math:`\chi _{L}` index -0.5 0.65 -0.5 -0.5 0.65 -0.5 -0.5 -0.5 grperc 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 flnr 0.293 0.41 0.41 0.41 0.41 0.293 0.293 0.41 - mbbopt 4 9 9 9 9 4 4 9 fcur 1 1 1 1 1 1 1 1 =================================== ========================= ========================== ========================== ========================== ========================== ========================= ========================= ========================== @@ -390,8 +389,7 @@ top-of-canopy height of a crop, *SLA* is specific leaf area. :math:`\chi _{L}` i orientation index, equals -1 for vertical, 0 for random, and 1 for horizontal leaf orientation. grperc is the growth respiration factor. flnr is the fraction of leaf N in Rubisco enzyme. -mbbopt is the Ball-Berry slope of conductance-photosynthesis relationship. -fcur is the fraction of allocation that goes to currently displayed growth +fcur is the fraction of allocation that goes to currently displayed growth. .. _Allocation: @@ -547,9 +545,10 @@ for each year. Additionally, harvest is not typically 100% efficient, so analysis needs to assume that harvest efficiency is less. We assume a harvest efficiency of 85%, and a grain C of 45% of the grain dry weight. -equation (g/m^2) = (sum(GRAINC_TO_FOOD)/0.45)*.85 - +.. math:: + :label: 25.9 + Grain\ yield(g.m^{-2})=\frac{\sum(GRAINC\_ TO\_ FOOD)*0.85}{0.45} .. _Table Crop allocation parameters: @@ -592,7 +591,7 @@ Other Features Physical Crop Characteristics '''''''''''''''''''''''''''''' Leaf area index (*L*) is calculated as a function of specific leaf area -(SLA) and leaf C (:ref:`Crop phenology parameters`). +(SLA, :numref:`Table Crop phenology parameters`) and leaf C. Stem area index (*S*) is equal to 0.1\ *L* for temperate and tropical corn and sugarcane and 0.2\ *L* for other crops, as in AgroIBIS. All live C and N pools go to 0 after crop harvest, but the *S* is kept at 0.25 to @@ -603,7 +602,7 @@ and :math:`{z}_{bot}` (m), come from the AgroIBIS formulation: .. math:: - :label: 25.9 + :label: 25.10 \begin{array}{l} {z_{top} =z_{top}^{\max } \left(\frac{L}{L_{\max } -1} \right)^{2} \ge 0.05{\rm \; where\; }\frac{L}{L_{\max } -1} \le 1} \\ @@ -642,7 +641,7 @@ counter in seconds, *f*, is set as soon as the onset growth for crops initiates: .. math:: - :label: 25.10 + :label: 25.11 f = n \times 86400 @@ -673,7 +672,7 @@ the for both rainfed and irrigated spring wheat and sugarcane, the calculation o :math:`GDD_{T_{{\rm 2m}} }` allows for latitudinal variation: .. math:: - :label: 25.11 + :label: 25.12 latitudinal\ variation\ in\ base\ T = \left\{ \begin{array}{lr} From caf97209b788bdf57df0da20fdfa837ae1513966 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Thu, 15 Jun 2017 17:09:03 -0600 Subject: [PATCH 075/730] Updated introduction of photosynthesis chapter --- .../CLM50_Tech_Note_Photosynthesis.rst | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index d50b90a814..f54c7da3c1 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -3,21 +3,43 @@ Stomatal Resistance and Photosynthesis ========================================= +Summary of CLM5.0 updates relative to the CLM4.5 +----------------------------------------------------- + +We describe here the complete photosynthesis and stomatal conductance parameterizations that +appear in CLM5.0. Corresponding information for CLM4.5 appeared in the +CLM4.5 Technical Note (:ref:`Oleson et al. 2013 `). + +CLM5 includes the following new changes to photosynthesis and stomatal conductance: + +- Default stomatal conductance calculation uses the Medlyn conductance model + +- :math:`V_{cmax}` is predicted by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) + +- Water stress is applied by the hydraulic conductance model (Chapter :numref:`rst_Plant Hydraulics`) + + +Introduction +----------------------- + Leaf stomatal resistance, which is needed for the water vapor flux -(Chapter 5), is coupled to leaf photosynthesis similar to Collatz et al. -(1991, 1992). These equations are solved separately for sunlit and +(Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`), +is coupled to leaf photosynthesis similar to Collatz et al. +(:ref:`1991 `, :ref:`1992 `). These equations are solved separately for sunlit and shaded leaves using average absorbed photosynthetically active radiation for sunlit and shaded leaves [:math:`\phi ^{sun}` ,\ :math:`\phi ^{sha}` W m\ :sup:`-2` -(section 4.1)] to give sunlit and shaded stomatal resistance +(section :numref:`Solar Fluxes`)] to give sunlit and shaded stomatal resistance (:math:`r_{s}^{sun}` ,\ :math:`r_{s}^{sha}` s m\ :sup:`-1`) and photosynthesis (:math:`A^{sun}` ,\ :math:`A^{sha}` µmol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`). Canopy photosynthesis is :math:`A^{sun} L^{sun} +A^{sha} L^{sha}` , where :math:`L^{sun}` and :math:`L^{sha}` are the sunlit and shaded leaf -area indices (section 4.1). Canopy conductance is +area indices (section :numref:`Solar Fluxes`). Canopy conductance is :math:`\frac{1}{r_{b} +r_{s}^{sun} } L^{sun} +\frac{1}{r_{b} +r_{s}^{sha} } L^{sha}` , where :math:`r_{b}` is the leaf boundary layer resistance (section -5.3). The equation set is described by Bonan et al. (2011). +:numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). +The implementation is described by Bonan et al. (:ref:`2011 `), though different +methods of calculating stomatal conductance and :math:`V_{cmax}` are used in CLM5. .. _Stomatal resistance: From e2fb2b8d51bdbc181e8200049d3ccb03ceab3d7d Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 16 Jun 2017 08:35:39 -0600 Subject: [PATCH 076/730] add mosart figure --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index bbad06b077..31ab7685d8 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -53,6 +53,8 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. +- :numref:`Figure MOSART conceptual diagram` MOSART conceptual diagram. + - :numref:`Figure Schematic of urban and atmospheric model coupling` Schematic of urban and atmospheric model coupling. - :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. From c1de9a28f715cf6db65c7538ea3cfad8e18ebbe6 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 16 Jun 2017 08:39:14 -0600 Subject: [PATCH 077/730] mosart label change --- doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst | 2 +- doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index fa25eeb5c8..84752b5429 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -11,7 +11,7 @@ land units can be found elsewhere in this document (see Chapter :numref:`rst_Surface Characterization, Vertical Discretization, and Model Input Requirements` for an overview). -.. _Overview: +.. _Overview Glaciers: Overview ------------- diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst index cae3bd0493..24df209f08 100644 --- a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -3,7 +3,7 @@ Model for Scale Adaptive River Transport (MOSART) ================================================= -.. _Overview: +.. _Overview MOSART: Overview --------- From f2daf15ca8f6887d74023d245fb73e016d944bc7 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Wed, 28 Jun 2017 17:16:04 -0600 Subject: [PATCH 078/730] Detailed editing of crop chapter through the end of the phenology section --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 72 ++++++++++--------- .../CLM50_Tech_Note_Photosynthesis.rst | 66 ----------------- 2 files changed, 37 insertions(+), 101 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index a91ec4b6f9..37eca59b4e 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -96,7 +96,7 @@ land management between crops. Each crop type has a rainfed and an irrigated pft that are on independent soil columns. Crop grid cell coverage is assigned from satellite data (similar to all natural pfts), and the managed crop type proportions within the crop area is based on the dataset created by -(:ref:`Portmann et al. 2010 `) for present day. New in CLM5, crop area is +:ref:`Portmann et al. (2010)` for present day. New in CLM5, crop area is extrapolated through time using the dataset provided by Land Use Model Intercomparison Project (LUMIP), which is part of CMIP6 Land use timeseries (:ref:`Lawrence et al. 2016 `). For more details about how @@ -130,11 +130,13 @@ Information detailing which parameters are used for each crop type is included in :numref:`Table Crop plant functional types`. It should be noted that pft-level history output merges all crop types into the actively managed crop type, so analysis of crop-specific output will require use of the land surface dataset to -remap the yields of each actively and inactively managed crop type. +remap the yields of each actively and inactively managed crop type. Otherwise, the +actively managed crop type will include yields for that crop type and all inactively +managed crop types that are using the same parameter set. .. _Table Crop plant functional types: -.. table:: Crop plant functional types (pfts) in CLM5BGCCROP. +.. table:: Crop plant functional types (pfts) included in CLM5BGCCROP. === =========================== ================ =========================== ITV Plant function types (PFTs) Management Class Crop Parameters Used @@ -241,25 +243,25 @@ planting date (for the northern hemisphere) in :numref:`Table Crop phenology par \end{array} where :math:`{T}_{10d}` is the 10-day running mean of :math:`{T}_{2m}`, (the simulated 2-m air -temperature at every model time step) and :math:`T_{10d}^{\min}` is +temperature during each model time step) and :math:`T_{10d}^{\min}` is the 10-day running mean of :math:`T_{2m}^{\min }` (the daily minimum of -:math:`{T}_{2m}`. :math:`{T}_{p}` and :math:`T_{p}^{\min }` are crop-specific coldest planting temperatures +:math:`{T}_{2m}`). :math:`{T}_{p}` and :math:`T_{p}^{\min }` are crop-specific coldest planting temperatures (:numref:`Table Crop phenology parameters`), :math:`{GDD}_{8}` is the 20-year running mean growing degree-days (units are degree-days or :sup:`o` days) tracked -from April through September (NH) base 8\ :sup:`o` C with +from April through September (NH) above 8\ :sup:`o` C with maximum daily increments of 30\ :sup:`o` days (see equation :eq:`25.3`), and :math:`{GDD}_{min }`\ is the minimum growing degree day requirement (:numref:`Table Crop phenology parameters`). :math:`{GDD}_{8}` does not change as quickly as :math:`{T}_{10d}` and :math:`T_{10d}^{\min }`, so -it determines whether the crop can be planted in a grid cell, while the -two faster-changing variables determine when the crop may be planted. +it determines whether it is warm enough for the crop to be planted in a grid cell, while the +2-m air temperature variables determine the day when the crop may be planted if the :math:`{GDD}_{8}` threshold is met. If the requirements in equation :eq:`25.1` are not met by the maximum planting date, crops are still planted on the maximum planting date as long as :math:`{GDD}_{8} > 0`. In the southern hemisphere (SH) the NH requirements apply 6 months later. At planting, each crop seed pool is assigned 3 gC m\ :sup:`-2` from its -grain product pool. The seed carbon transferred to the leaves upon leaf emergence. An +grain product pool. The seed carbon is transferred to the leaves upon leaf emergence. An equivalent amount of seed leaf N is assigned given the pft’s C to N -ratio for leaves (:math:`{CN}_{leaf}` in :numref:`Table Crop allocation parameters`, this differs from AgroIBIS, +ratio for leaves (:math:`{CN}_{leaf}` in :numref:`Table Crop allocation parameters`; this differs from AgroIBIS, which uses a seed leaf area index instead of seed C). The model updates the average growing degree-days necessary for the crop to reach vegetative and physiological maturity, :math:`{GDD}_{mat}`, according to the following AgroIBIS rules: @@ -275,11 +277,11 @@ for the crop to reach vegetative and physiological maturity, GDD_{{\rm mat}}^{{\rm trop.soy}} =GDD_{{\rm 10}} & {\rm \; \; \; and\; \; \; } & GDD_{{\rm mat}}^{{\rm trop.soy}} <2100{}^\circ {\rm days} \end{array} -where :math:`{GDD}_{10}` is the 20-year running mean growing -degree-days tracked from April through September (NH) base -10\ :sup:`o`\C with maximum daily increments of -30\ :sup:`o`\days. Equation :eq:`25.3` shows how we calculate -:math:`{GDD}_{0}`, :math:`{GDD}_{8}`, and :math:`{GDD}_{10}`: +where :math:`{GDD}_{0}`, :math:`{GDD}_{8}`, and :math:`{GDD}_{10}` are the 20-year running mean growing +degree-days tracked from April through September (NH) over 0\ :sup:`o`\C, 8\ :sup:`o`\C, and +10\ :sup:`o`\C, respectively, with maximum daily increments of +26\ :sup:`o`\days (for :math:`{GDD}_{0}`) or 30\ :sup:`o`\days (for :math:`{GDD}_{8}` and :math:`{GDD}_{10}`). Equation :eq:`25.3` shows how we calculate +:math:`{GDD}_{0}`, :math:`{GDD}_{8}`, and :math:`{GDD}_{10}` for each model timestep: .. math:: :label: 25.3 @@ -291,9 +293,9 @@ degree-days tracked from April through September (NH) base \end{array} where, if :math:`{T}_{2m}` - :math:`{T}_{f}` takes on values -outside the above ranges, then it equals the minimum or maximum value in -the range. Also :math:`{T}_{f}` equals 273.15 K, -:math:`{T}_{2m}` has units of K, and *GDD* has units of ºdays. +outside the above ranges within a day, then it equals the minimum or maximum value in +the range for that day. :math:`{T}_{f}` is the freezing temperature of water and equals 273.15 K, +:math:`{T}_{2m}` is the 2-m air temperature in units of K, and *GDD* is in units of ºdays. .. _Leaf emergence: @@ -301,25 +303,25 @@ Leaf emergence ''''''''''''''''''''''' According to AgroIBIS, leaves may emerge when the growing degree-days of -soil temperature to 0.05 m depth tracked since planting -(:math:`GDD_{T_{soi} }` ) reaches 1 to 5% of :math:`{GDD}_{mat}` -(:numref:`Table Crop phenology parameters`). The base temperature for :math:`GDD_{T_{soi} }` -are listed in :numref:`Table Crop phenology parameters`. -Leaf onset occurs in the first +soil temperature to 0.05 m depth (:math:`GDD_{T_{soi} }` ), which is tracked since planting, +reaches 1 to 5% of :math:`{GDD}_{mat}` +(see Phase 2 % :math:`{GDD}_{mat}` in :numref:`Table Crop phenology parameters`). The base temperature threshold for :math:`GDD_{T_{soi} }` +are listed in :numref:`Table Crop phenology parameters`, and leaf emergence (crop phenology phase 2) +starts when this threshold is met. Leaf onset occurs in the first time step of phase 2, at which moment all seed C is transferred to leaf -C. Subsequently, the leaf area index generally increases and reaches -a maximum value during phase 2. Stem and root C are also increasing, based on -the carbon allocation algorithem in section :numref:`Leaf emergence to grain fill`. +C. Subsequently, the leaf area index generally increases throughout phase 2 until it reaches +a predetermined maximum value. Stem and root C also increase throughout phase 2 based on +the carbon allocation algorithm in section :numref:`Leaf emergence to grain fill`. .. _Grain fill: Grain fill ''''''''''''''''''' -Phase 3 begins in one of two ways. The first potential trigger is based on temperature, similar to phase 2. A variable tracked since -planting like :math:`GDD_{T_{soi} }` but for 2-m air temperature, -:math:`GDD_{T_{{\rm 2m}} }`, must reach a heat unit threshold, *h*, -of 40 to 65% of :math:`{GDD}_{mat}` (:numref:`Table Crop phenology parameters`). +The grain fill phase (phase 3) begins in one of two ways. The first potential trigger is based on temperature, similar to phase 2. A variable tracked since +planting, similar to :math:`GDD_{T_{soi} }` but for 2-m air temperature, +:math:`GDD_{T_{{\rm 2m}} }`, must reach a threshold +of 40 to 65% of :math:`{GDD}_{mat}` (see Phase 3 % :math:`{GDD}_{mat}` in :numref:`Table Crop phenology parameters`). For crops with the C4 photosynthetic pathway (temperate and tropical corn, sugarcane), the :math:`{GDD}_{mat}` is based on an empirical function and ranges between 950 and 1850. The second potential trigger for phase 3 is based on leaf area index. @@ -339,11 +341,11 @@ the number of days past planting reaches a crop-specific maximum (:numref:`Table Crop phenology parameters`), then the crop is harvested. Harvest occurs in one time step using the BGC leaf offset algorithm. Variables track the flow of grain C and -N to food and of live stem C and N to litter. Putting live +N to food and of all other plant pools, including live stem C and N, to litter. Putting live stem C and N into the litter pool is in contrast to the approach for unmanaged PFTs which puts live stem C and N into dead stem pools first. Leaf and root C and N pools are routed to the litter pools in the same manner as natural vegetation. Whereas food C and N -formerly was transferred to the litter pool, CLM5 routes food C and N +was formerly transferred to the litter pool, CLM5 routes food C and N to a grain product pool where the C and N decay to the atmosphere over one year, similar in structure to the wood product pools. @@ -378,8 +380,8 @@ Notes: :math:`Date_{planting}^{min}` and :math:`Date_{planting}^{max}` are the minimum and maximum planting date in the Northern Hemisphere, the corresponding dates in the Southern Hemisphere apply 6 months later. :math:`T_{p}` and :math:`T_{p}^{ min }` are crop-specific coldest planting temperatures. -:math:`{GDD}_{min}` is the lowest (for planting) 20-year running mean growing degree-days base -on the base temperature in the 7\ :sup:`th` row, tracked from April to September (NH). +:math:`{GDD}_{min}` is the lowest (for planting) 20-year running mean growing degree-days based +on the base temperature threshold in the 7\ :sup:`th` row, tracked from April to September (NH). :math:`{GDD}_{mat}` is a crop’s 20-year running mean growing degree-days needed for vegetative and physiological maturity. Harvest occurs at 100%\ :math:`{GDD}_{mat}` or when the days past planting @@ -388,7 +390,7 @@ are described in the text. :math:`z_{top}^{\max }` is the maximum top-of-canopy height of a crop, *SLA* is specific leaf area. :math:`\chi _{L}` is the leaf orientation index, equals -1 for vertical, 0 for random, and 1 for horizontal leaf orientation. -grperc is the growth respiration factor. flnr is the fraction of leaf N in Rubisco enzyme. +grperc is the growth respiration factor. flnr is the fraction of leaf N in the Rubisco enzyme. fcur is the fraction of allocation that goes to currently displayed growth. .. _Allocation: diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index f54c7da3c1..de6693e76b 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -508,72 +508,6 @@ orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], positive for Northern Hemisphere latitudes and negative for Southern Hemisphere). -.. _Soil water stress: - -Soil water stress ---------------------- - -Soil water influences stomatal conductance directly by multiplying the -minimum conductance by a soil water stress function :math:`\beta _{t}` -and also indirectly through :math:`A_{n}` in the C\ :sub:`3` and -C\ :sub:`4` photosynthesis models, as in Sellers et al. (1996). -The latter effect is achieved by multiplying :math:`V_{c\; \max }` and -:math:`R_{d}` by :math:`\beta _{t}` . - -The function :math:`\beta _{t}` ranges from one when the soil is wet to -near zero when the soil is dry and depends on the soil water potential -of each soil layer, the root distribution of the plant functional type, -and a plant-dependent response to soil water stress - -.. math:: - :label: 9.26) - - \beta _{t} =\sum _{i}w_{i} r_{i} - -where :math:`w_{i}` is a plant wilting factor for layer :math:`i` and -:math:`r_{i}` is the fraction of roots in layer :math:`i`. The plant -wilting factor :math:`w_{i}` is - -.. math:: - :label: 9.27) - - w_{i} =\left\{\begin{array}{l} {\frac{\psi _{c} -\psi _{i} }{\psi _{c} -\psi _{o} } \left[\frac{\theta _{sat,i} -\theta _{ice,i} }{\theta _{sat,i} } \right]\le 1\qquad {\rm for\; }T_{i} >T_{f} -2{\rm \; and\; }\theta _{liq,\, i} >0} \\ {0\qquad \qquad \qquad \qquad {\rm for\; }T_{i} \le T_{f} -2{\rm \; or\; }\theta _{liq,\, i} \le 0} \end{array}\right\} - -where :math:`\psi _{i}` is the soil water matric potential (mm) and -:math:`\psi _{c}` and :math:`\psi _{o}` are the soil water potential -(mm) when stomata are fully closed or fully open (respectively) (Table -8.1). The term in brackets scales :math:`w_{i}` by the ratio of the -effective porosity (accounting for the ice fraction; -:math:`\theta _{sat} -\theta _{ice}` ) relative to the total porosity. - -Here, the soil water matric potential :math:`\psi _{i}` \ is defined as - -.. math:: - :label: 9.28) - - \psi _{i} =\psi _{sat,i} \, s_{i}^{-B_{i} } \ge \psi _{c} - -where :math:`s_{i}` is the soil wetness for layer :math:`i` with -respect to the effective porosity and :math:`\psi _{sat,i}` and -:math:`B_{i}` are the saturated soil matric potential (mm) and the -Clapp and Hornberger (1978) parameter (section 7.4.1). The soil wetness -:math:`s_{i}` is - -.. math:: - :label: 9.29) - - s_{i} =\frac{\theta _{liq,\, i} }{\theta _{sat,\, i} -\theta _{ice,\, i} } \ge 0.01 - -where -:math:`\theta _{ice,\, i} ={w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(\rho _{ice} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} \Delta z_{i} \right)} \le \theta _{sat,\, i}` \ and -:math:`\theta _{liq,\, i} ={w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(\rho _{liq} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{liq} \Delta z_{i} \right)} \le \theta _{sat,\, i} -\theta _{ice,\, i}` . -:math:`w_{ice,\, i}` and :math:`w_{liq,\, i}` are the ice and liquid -water contents (kg m\ :sup:`-2`) (Chapter 7), -:math:`\theta _{sat,\, i}` is the saturated volumetric water content -(section 7.4.1), :math:`\rho _{ice}` and :math:`\rho _{liq}` are the -densities of ice and liquid water (kg m\ :sup:`-3`) (Table 2.6), -and :math:`\Delta z_{i}` is the soil layer thickness (m) (section 6.1). - .. _Numerical implementation photosynthesis: Numerical implementation From c87be809421b5ce7e38f371a315d1fe16b27fc2f Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Fri, 30 Jun 2017 13:48:02 -0600 Subject: [PATCH 079/730] Detailed edits on full crop chapter --- .../CLM50_Tech_Note_Crop_Irrigation.rst | 115 ++++++++++-------- 1 file changed, 61 insertions(+), 54 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 37eca59b4e..1694764136 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -320,12 +320,12 @@ Grain fill The grain fill phase (phase 3) begins in one of two ways. The first potential trigger is based on temperature, similar to phase 2. A variable tracked since planting, similar to :math:`GDD_{T_{soi} }` but for 2-m air temperature, -:math:`GDD_{T_{{\rm 2m}} }`, must reach a threshold +:math:`GDD_{T_{{\rm 2m}} }`, must reach a heat unit threshold, *h*, of of 40 to 65% of :math:`{GDD}_{mat}` (see Phase 3 % :math:`{GDD}_{mat}` in :numref:`Table Crop phenology parameters`). For crops with the C4 photosynthetic pathway (temperate and tropical corn, sugarcane), the :math:`{GDD}_{mat}` is based on an empirical function and ranges between 950 and 1850. The second potential trigger for phase 3 is based on leaf area index. -When the maximum value of leaf area index is reached in phase 2, phase 3 begins. +When the maximum value of leaf area index is reached in phase 2 (:numref:`Table Crop allocation parameters`), phase 3 begins. In phase 3, the leaf area index begins to decline in response to a background litterfall rate calculated as the inverse of leaf longevity for the pft as done in the BGC part of the model. @@ -339,15 +339,7 @@ Harvest is assumed to occur as soon as the crop reaches maturity. When :math:`GDD_{T_{{\rm 2m}} }` reaches 100% of :math:`{GDD}_{mat}` or the number of days past planting reaches a crop-specific maximum (:numref:`Table Crop phenology parameters`), then the crop is harvested. -Harvest occurs in one time step using -the BGC leaf offset algorithm. Variables track the flow of grain C and -N to food and of all other plant pools, including live stem C and N, to litter. Putting live -stem C and N into the litter pool is in contrast to the approach for unmanaged PFTs which -puts live stem C and N into dead stem pools first. Leaf and root C and N pools -are routed to the litter pools in the same manner as natural vegetation. Whereas food C and N -was formerly transferred to the litter pool, CLM5 routes food C and N -to a grain product pool where the C and N decay to the atmosphere over one year, -similar in structure to the wood product pools. +Harvest occurs in one time step using the BGC leaf offset algorithm. .. _Table Crop phenology parameters: @@ -398,7 +390,7 @@ fcur is the fraction of allocation that goes to currently displayed growth. Allocation ^^^^^^^^^^^^^^^^^ -Allocation responds to the same phases as phenology (section :numref:`Phenology`). +Allocation changes based on the crop phenology phases phenology (section :numref:`Phenology`). Simulated C assimilation begins every year upon leaf emergence in phase 2 and ends with harvest at the end of phase 3; therefore, so does the allocation of such C to the crop’s leaf, live stem, fine root, and @@ -408,33 +400,35 @@ Typically, C:N ratios in plant tissue vary throughout the growing season and tend to be lower during early growth stages and higher in later growth stages. In order to account for this seasonal change, two sets of C:N ratios are established in CLM for the leaf, stem, and fine root of -crops. This modified C:N ratio approach accounts for the nitrogen -retranslocation that occurs during phase 3 of crop growth. Leaf, stem, and root -C:N ratios for phases 1 and 2 are calculated +crops: one during the leaf emergence phase (phenology phase 2), and a second during +grain fill phase (phenology phase 3). This modified C:N ratio approach accounts for the nitrogen +retranslocation that occurs during the grain fill phase (phase 3) of crop growth. Leaf, stem, and root +C:N ratios for phase 2 are calculated using the new CLM5 carbon and nitrogen allocation scheme (Chapter :numref:`rst_CN Allocation`), which provides a target C:N value -and allows C:N to vary through time. +(:numref:`Table Crop allocation parameters`) and allows C:N to vary through time. During grain fill (phase 3) of the crop growth cycle, a portion of the nitrogen in the plant tissues is moved to a storage pool to fulfill nitrogen demands of organ (reproductive pool) development, such that the resulting C:N ratio of the plant tissue is reflective of measurements at harvest. All C:N ratios were determined by calibration process, through comparisons of model output versus observations of plant carbon -throughout the growth season. +throughout the growing season. The BGC part of the model keeps track of a term representing excess -maintenance respiration that for perennial pfts or pfts with C storage -may be extracted from later gross primary production. Later extraction +maintenance respiration, which supplies the carbon required for maintenance respiration during periods of +low photosynthesis (Chapter :numref:`rst_Plant Respiration`). +Carbon supply for excess maintenance respiration cannot continue to happen after harvest for annual crops, so at harvest -we turn the excess respiration pool into a flux that extracts -CO\ :sub:`2` directly from the atmosphere. This way we eliminate -any excess maintenance respiration remaining at harvest as if such +the excess respiration pool is turned into a flux that extracts +CO\ :sub:`2` directly from the atmosphere. This way +any excess maintenance respiration remaining at harvest is eliminated as if such respiration had not taken place. .. _Leaf emergence to grain fill: -Leaf emergence to grain fill +Leaf emergence ''''''''''''''''''''''''''''''''''''' During phase 2, the allocation coefficients (fraction of available C) to @@ -454,11 +448,11 @@ exclusively to the fine roots. .. _Grain fill to harvest: -Grain fill to harvest +Grain fill '''''''''''''''''''''''''''''' The calculation of :math:`a_{froot}` remains the same from phase 2 to -phase 3. Other allocation coefficients change to: +phase 3. During grain fill (phase 3), other allocation coefficients change to: .. math:: :label: 25.5 @@ -499,7 +493,7 @@ through retranslocation from leaves, stems, and roots. Nitrogen retranslocation is initiated at the beginning of the grain fill stage for all crops except soybean, for which retranslocation is after LAI decline. Nitrogen stored in the leaf and stem is moved into a storage -retranslocation pool. For wheat and rice, nitrogen in roots is also +retranslocation pool for all crops, and for wheat and rice, nitrogen in roots is also released into the retranslocation storage pool. The quantity of nitrogen mobilized depends on the C:N ratio of the plant tissue, and is calculated as @@ -524,28 +518,37 @@ root, respectively, :math:`{N}_{leaf}`, :math:`{N}_{stem}`, and :math:`{N}_{froo is the nitrogen in the plant leaf, stem, and fine root, respectively, and :math:`CN^f_{leaf}`, :math:`CN^f_{stem}`, and :math:`CN^f_{froot}` is the post-grain fill C:N ratio of the leaf, stem, and fine root respectively (:numref:`Table Crop allocation parameters`). Since -C:N measurements are taken from mature crops, pre-grain development C:N -ratios for leaves, stems, and roots are optimized to allow maximum -nitrogen accumulation for later use during organ development. Post-grain -fill C:N ratios are assigned the same as crop residue. Once excess -nitrogen is moved into the retranslocated pool, during the remainder of -the growing season the retranslocated pool is used first to meet plant +C:N measurements are often taken from mature crops, pre-grain development C:N +ratios for leaves, stems, and roots in the model are optimized to allow maximum +nitrogen accumulation for later use during organ development, and post-grain +fill C:N ratios are assigned the same as crop residue. After +nitrogen is moved into the retranslocated pool, +the nitrogen in this pool is used to meet plant nitrogen demand by assigning the available nitrogen from the -retranslocated pool equal to the plant nitrogen demand. Once the +retranslocated pool equal to the plant nitrogen demand for each organ (:math:`{CN_{[organ]}^{f} }` in :numref:`Table Crop allocation parameters`). Once the retranslocation pool is depleted, soil mineral nitrogen pool is used to fulfill plant nitrogen demands. .. _Harvest to food and seed: -Harvest to food and seed +Harvest '''''''''''''''''''''''''''''' -In CLM5, the C and N required for crop seeding is removed from the grain -product pool during harvest and used to seed crops in the subsequent year. -Caluating the crop yields requires that you sum the GRAINC_TO_FOOD variable -for each year. Additionally, harvest is not typically 100% efficient, so +Variables track the flow of grain C and +N to food and of all other plant pools, including live stem C and N, to litter. Putting live +stem C and N into the litter pool is in contrast to the approach for unmanaged PFTs which +puts live stem C and N into dead stem pools first. Leaf and root C and N pools +are routed to the litter pools in the same manner as natural vegetation. Whereas food C and N +was formerly transferred to the litter pool, CLM5 routes food C and N +to a grain product pool where the C and N decay to the atmosphere over one year, +similar in structure to the wood product pools. +Additionally, CLM5 accounts for the C and N required for crop seeding by removing the seed C and N from the grain +product pool during harvest. The crop seed pool is then used to seed crops in the subsequent year. +Calcuating the crop yields (Equation :eq:`25.9`) requires that you sum the GRAINC_TO_FOOD variable +for each year, and must account for the proportion of C in the dry crop weight. +Here, we assume that grain C is 45% of the total dry weight. Additionally, harvest is not typically 100% efficient, so analysis needs to assume that harvest efficiency is less. We assume a harvest -efficiency of 85%, and a grain C of 45% of the grain dry weight. +efficiency of 85%. .. math:: :label: 25.9 @@ -579,8 +582,9 @@ efficiency of 85%, and a grain C of 45% of the grain dry weight. :math:`{CN}_{grain}` 50 50 50 50 50 50 50 50 =========================================== ============== ============ ================== ====== ====== ========= ============= ================ -Notes: Crop growth phases and corresponding variables are described in -the text +Notes: Crop growth phases and corresponding variables are described throughout +the text. :math:`{CN}_{leaf}`, :math:`{CN}_{stem}`, and :math:`{CN}_{froot}` are +the target C:N ratios used during the leaf emergence phase (phase 2). .. _Other Features: @@ -611,6 +615,9 @@ and :math:`{z}_{bot}` (m), come from the AgroIBIS formulation: {z_{bot} =0.02{\rm m}} \end{array} +where :math:`z_{top}^{\max }` is the maximum top-of-canopy height of the crop (:numref:`Table Crop phenology parameters`) +and :math:`L_{\max }` is the maximum leaf area index (:numref:`Table Crop allocation parameters`). + .. _Interactive fertilization: Interactive Fertilization @@ -634,12 +641,12 @@ of CLM (e.g., CLM4) had rapid denitrification rates, fertilizer is applied slowl to minimize N loss (primarily through denitrification) and maximize plant uptake. The current implementation of CLM5 inherits this legacy, although denitrification rates are slower in the current version of the model (:ref:`Koven et al. 2013 `). As such, -fertilizer application begins during the emergence phase of crop -development and continues for 20 days, which helps reduce large losses +fertilizer application begins during the leaf emergence phase of crop +development (phase 2) and continues for 20 days, which helps reduce large losses of nitrogen from leaching and denitrification during the early stage of crop development. The 20-day period is chosen as an optimization to limit fertilizer application to the emergence stage. A fertilizer -counter in seconds, *f*, is set as soon as the onset growth for crops +counter in seconds, *f*, is set as soon as the leaf emergence phase for crops initiates: .. math:: @@ -647,10 +654,10 @@ initiates: f = n \times 86400 -where *n* is set to 20 fertilizer application days. When the crop enters -phase 2 (leaf emergence to the beginning of grain fill) of its growth +where *n* is set to 20 fertilizer application days and 86400 is the number of seconds per day. When the crop enters +phase 2 (leaf emergence) of its growth cycle, fertilizer application begins by initializing fertilizer amount -to the total fertilizer at each grid cell divided by the initialized *f*. +to the total fertilizer at each column within the grid cell divided by the initialized *f*. Fertilizer is applied and *f* is decremented each time step until a zero balance on the counter is reached. @@ -660,8 +667,8 @@ the counter is reached. Biological nitrogen fixation for soybeans '''''''''''''''''''''''''''''''''''''''''' Biological N fixation for soybeans is calculated by the fixation and uptake of -nitrogen module (Chapter :numref:`rst_FUN`). Unlike natural -vegetation, where a fraction of the vegetation are N fixers, all soybeans +nitrogen module (Chapter :numref:`rst_FUN`) and is the same as N fixation in natural vegetation. Unlike natural +vegetation, where a fraction of each pft are N fixers, all soybeans are treated as N fixers. .. _Latitude vary base tempereature for growing degree days: @@ -692,14 +699,14 @@ and sugarcane. Separate reproductive pool '''''''''''''''''''''''''''''' One notable difference between natural vegetation and crops is the -presence of a reproductive carbon pool (and nitrogen pool). Accounting -for the reproductive pool helps determine whether crops are performing +presence of reproductive carbon and nitrogen pools. Accounting +for the reproductive pools helps determine whether crops are performing reasonably through yield calculations. The reproductive pool is maintained similarly to the leaf, stem, and fine root pools, but allocation of carbon and nitrogen does not begin until the grain fill stage of crop development. Equation :eq:`25.5` describes the carbon and nitrogen allocation coefficients to the reproductive pool. -In CLM5BGCCROP, as allocation declines +In CLM5BGCCROP, as allocation declines in stem, leaf, and root pools (see section :numref:`Grain fill to harvest`) during the grain fill stage of growth, increasing amounts of carbon and nitrogen are available for grain development. @@ -771,7 +778,7 @@ the soil is :math:`N_{irr}` is the index of the soil layer corresponding to a specified depth :math:`z_{irrig}` (:numref:`Table Irrigation parameters`) and -:math:`\Delta z` is the thickness of the soil layer (section +:math:`\Delta z_{j}` is the thickness of the soil layer in layer :math:`j` (section :numref:`Vertical Discretization`). :math:`\theta_{j}` is the volumetric soil moisture in layer :math:`j` (section :numref:`Soil Water`). :math:`\theta_{target}` and @@ -786,7 +793,7 @@ the irrigation period :math:`T_{irrig}` (s). Irrigation water is applied directly to the ground surface, bypassing canopy interception (i.e., added to :math:`{q}_{grnd,liq}`: section :numref:`Canopy Water`). -To conserve mass, irrigation is removed from river water storage (Chapter 11). +To conserve mass, irrigation is removed from river water storage (Chapter :numref:`rst_River Transport Model (RTM)`). When river water storage is inadequate to meet irrigation demand, there are two options: 1) the additional water can be removed from the ocean model, or 2) the irrigation demand can be reduced such that From 6cf7a5d1b0b7fe6672e5e1aaf219a7503f181195 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Fri, 30 Jun 2017 14:22:54 -0600 Subject: [PATCH 080/730] One more small update to crop chapter text --- .../Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 1694764136..85c284cd89 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -305,8 +305,9 @@ Leaf emergence According to AgroIBIS, leaves may emerge when the growing degree-days of soil temperature to 0.05 m depth (:math:`GDD_{T_{soi} }` ), which is tracked since planting, reaches 1 to 5% of :math:`{GDD}_{mat}` -(see Phase 2 % :math:`{GDD}_{mat}` in :numref:`Table Crop phenology parameters`). The base temperature threshold for :math:`GDD_{T_{soi} }` -are listed in :numref:`Table Crop phenology parameters`, and leaf emergence (crop phenology phase 2) +(see Phase 2 % :math:`{GDD}_{mat}` in :numref:`Table Crop phenology parameters`). The base temperature threshold values for :math:`GDD_{T_{soi} }` +are listed in :numref:`Table Crop phenology parameters` (the same base temperature threshold values are also used for +:math:`GDD_{T_{{\rm 2m}} }` in section :numref:`Grain Fill`), and leaf emergence (crop phenology phase 2) starts when this threshold is met. Leaf onset occurs in the first time step of phase 2, at which moment all seed C is transferred to leaf C. Subsequently, the leaf area index generally increases throughout phase 2 until it reaches From 03a437d3a6ec85018d85e137d8f927b0486b6bf3 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Fri, 30 Jun 2017 17:16:50 -0600 Subject: [PATCH 081/730] Updates to photosynthesis chapter (canopy scaling & numerical implementation) and photosynthetic capacity chapter (included section headings and moved Vcmax calculations here, though calculation still needs to be verified) --- .../CLM50_Tech_Note_Photosynthesis.rst | 165 ++++++------------ ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 67 ++++++- 2 files changed, 117 insertions(+), 115 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index de6693e76b..cfe155d42a 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -14,7 +14,10 @@ CLM5 includes the following new changes to photosynthesis and stomatal conductan - Default stomatal conductance calculation uses the Medlyn conductance model -- :math:`V_{cmax}` is predicted by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) +- :math:`J_{max}` is predicted by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) + +- Leaf N concentration and the fraction of leaf N in Rubisco used to calculate +:math:`V_{cmax}` are determined by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) - Water stress is applied by the hydraulic conductance model (Chapter :numref:`rst_Plant Hydraulics`) @@ -39,7 +42,8 @@ area indices (section :numref:`Solar Fluxes`). Canopy conductance is where :math:`r_{b}` is the leaf boundary layer resistance (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). The implementation is described by Bonan et al. (:ref:`2011 `), though different -methods of calculating stomatal conductance and :math:`V_{cmax}` are used in CLM5. +methods of calculating stomatal conductance, :math:`J_{max}`, and the nitrogen variables +used to calculate :math:`V_{cmax}` are used in CLM5. .. _Stomatal resistance: @@ -55,7 +59,7 @@ the CO\ :sub:`1` concentration at the leaf surface. Leaf stomatal resistance is .. math:: - :label: ZEqnNum230514 + :label: 9.1 \frac{1}{r_{s} } =g_{s} =m\frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } h_{s} +b\, \beta _{t} @@ -162,7 +166,7 @@ describe the implementation, modified here. In its simplest form, leaf net photosynthesis after accounting for respiration (:math:`R_{d}` ) is .. math:: - :label: 9.2) + :label: 9.2 A_{n} =\min \left(A_{c} ,A_{j} ,A_{p} \right)-R_{d} . @@ -171,9 +175,8 @@ The RuBP carboxylase (Rubisco) limited rate of carboxylation s\ :sup:`-1`) is .. math:: - :label: ZEqnNum141081 + :label: 9.3 - \label{ZEqnNum141081} A_{c} =\left\{\begin{array}{l} {\frac{V_{c\max } \left(c_{i} -\Gamma _{\*} \right)}{c_{i} +K_{c} \left(1+{o_{i} \mathord{\left/ {\vphantom {o_{i} K_{o} }} \right. \kern-\nulldelimiterspace} K_{o} } \right)} \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {V_{c\max } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. The maximum rate of carboxylation allowed by the capacity to regenerate @@ -181,7 +184,7 @@ RuBP (i.e., the light-limited rate) :math:`A_{j}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 9.4) + :label: 9.4 A_{j} =\left\{\begin{array}{l} {\frac{J\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -191,7 +194,7 @@ C\ :sub:`4` plants :math:`A_{p}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: ZEqnNum104028 + :label: 9.5 A_{p} =\left\{\begin{array}{l} {3T_{p\qquad } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {k_{p} \frac{c_{i} }{P_{atm} } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}. @@ -221,7 +224,7 @@ photosynthetically active radiation absorbed by the leaf. A common expression is the smaller of the two roots of the equation .. math:: - :label: 9.6) + :label: 9.6 \Theta _{PSII} J^{2} -\left(I_{PSII} +J_{\max } \right)J+I_{PSII} J_{\max } =0 @@ -236,7 +239,7 @@ with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is .. math:: - :label: 9.7) + :label: 9.7 I_{PSII} =0.5\Phi _{PSII} (4.6\phi ) @@ -253,7 +256,7 @@ The model uses co-limitation as described by Collatz et al. (1991, smaller root of the equations .. math:: - :label: 9.8) + :label: 9.8 \begin{array}{rcl} {\Theta _{cj} A_{i}^{2} -\left(A_{c} +A_{j} \right)A_{i} +A_{c} A_{j} } & {=} & {0} \\ {\Theta _{ip} A^{2} -\left(A_{i} +A_{p} \right)A+A_{i} A_{p} } & {=} & {0} \end{array} . @@ -287,21 +290,21 @@ respiration rate. The parameters :math:`V_{c\max 25}` , :math:`T_{v}` (K) as: .. math:: - :label: 9.9) + :label: 9.9 \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma _{*} } & {=} & {\Gamma _{*25} \; f\left(T_{v} \right)} \end{array} with .. math:: - :label: 9.10) + :label: 9.10 f\left(T_{v} \right)=\; \exp \left[\frac{\Delta H_{a} }{298.15\times 0.001R_{gas} } \left(1-\frac{298.15}{T_{v} } \right)\right] and .. math:: - :label: 9.11) + :label: 9.11 f_{H} \left(T_{v} \right)=\frac{1+\exp \left(\frac{298.15\Delta S-\Delta H_{d} }{298.15\times 0.001R_{gas} } \right)}{1+\exp \left(\frac{\Delta ST_{v} -\Delta H_{d} }{0.001R_{gas} T_{v} } \right)} . @@ -312,7 +315,7 @@ Because :math:`T_{p}` as implemented here varies with :math:`T_{p}` . For C\ :sub:`4` plants, .. math:: - :label: 9.12) + :label: 9.12 \begin{array}{l} {V_{c\max } =V_{c\max 25} \left[\frac{Q_{10} ^{(T_{v} -298.15)/10} }{f_{H} \left(T_{v} \right)f_{L} \left(T_{v} \right)} \right]} \\ {f_{H} \left(T_{v} \right)=1+\exp \left[s_{1} \left(T_{v} -s_{2} \right)\right]} \\ {f_{L} \left(T_{v} \right)=1+\exp \left[s_{3} \left(s_{4} -T_{v} \right)\right]} \end{array} @@ -323,7 +326,7 @@ with :math:`Q_{10} =2`, Additionally, .. math:: - :label: 9.13) + :label: 9.13 R_{d} =R_{d25} \left\{\frac{Q_{10} ^{(T_{v} -298.15)/10} }{1+\exp \left[s_{5} \left(T_{v} -s_{6} \right)\right]} \right\} @@ -331,7 +334,7 @@ with :math:`Q_{10} =2`, :math:`s_{5} =1.3` K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and .. math:: - :label: 9.14) + :label: 9.14 k_{p} =k_{p25} \, Q_{10} ^{(T_{v} -298.15)/10} @@ -367,7 +370,7 @@ achieved by allowing :math:`\Delta S`\ to vary with growth temperature according to .. math:: - :label: 9.15) + :label: 9.15 \begin{array}{l} {\Delta S=668.39-1.07(T_{10} -T_{f} )\qquad \qquad {\rm for\; }V_{c\max } } \\ {\Delta S=659.70-0.75(T_{10} -T_{f} )\qquad \qquad {\rm for\; }J_{\max } } \end{array} @@ -379,7 +382,7 @@ parameterization, :math:`\Delta H_{d}` \ = 200000, ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: - :label: 9.16) + :label: 9.16 J_{\max 25} /V_{c\max 25} =2.59-0.035(T_{10} -T_{f} ). @@ -388,83 +391,49 @@ temperature (K) and :math:`T_{f}` is the freezing point of water (K). For lack of data, :math:`T_{p}` acclimates similar to V :sub:`cmax` . Acclimation is restricted over the temperature range :math:`T_{10} -T_{f} \ge 11`\ :sup:`o`\ C and :math:`T_{10} -T_{f} \le 35`\ :sup:`o`\ C. -.. _V\ :sub:`cmax25` and Canopy scaling: +.. Canopy scaling: -V\ :sub:`cmax25` and Canopy scaling +Canopy scaling -------------------------------------------- -The maximum rate of carboxylation at 25 :sup:`o`\ C varies with -foliage nitrogen concentration and specific leaf area and is calculated -as in Thornton and Zimmermann (2007). At 25ºC, - -.. math:: - :label: ZEqnNum217783 - - V_{c\max 25} =N_{a} F_{LNR} F_{NR} a_{R25} - -where :math:`N_{a}` is the area-based leaf nitrogen concentration (g N -m\ :sup:`-2` leaf area), :math:`F_{LNR}` is the fraction of leaf -nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), -:math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass -to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and -:math:`a_{R25} =60` is the specific activity of Rubisco (µmol -CO\ :sub:`2` g\ :sup:`-1` Rubisco s\ :sup:`-1`). -:math:`N_{a}` is calculated from mass-based leaf N concentration and -specific leaf area - -.. math:: - :label: ZEqnNum561340 - - N_{a} =\frac{1}{CN_{L} \; SLA_{0} } - -where :math:`CN_{L}` is the leaf carbon-to-nitrogen ratio (g C -g\ :sup:`-1` N) and :math:`SLA_{0}` is specific leaf area at the -canopy top ( m\ :sup:`2` leaf area g\ :sup:`-1` C ). Table 8.1 -lists values of :math:`F_{LNR}` , :math:`CN_{L}` , and :math:`SLA_{0}` -for each plant functional type. :math:`F_{LNR}` was chosen to give -:math:`V_{c\max 25}` consistent with Kattge et al. (2009), as discussed -by Bonan et al. (2011, 2012). Table 8.1 lists derived values for -:math:`V_{c\max 25}` at the top of the canopy using :math:`SLA_{0}` . -Tropical broadleaf evergreen trees are an exception, and a higher -:math:`V_{c\max 25}` is used to alleviate model biases (Bonan et al. -2012). - :math:`V_{c\max 25}` is calculated separately for sunlit and shaded leaves using an exponential profile to area-based leaf nitrogen -(:math:`N_{a}` ), as in Bonan et al. (2011). :math:`V_{c\max 25}` at +(:math:`LNC_{a}`, see Chapter :numref:`rst_Photosynthetic Capacity` ), +as in :ref:`Bonan et al. (2011)`. :math:`V_{c\max 25}` at cumulative leaf area index :math:`x` from the canopy top scales directly -with :math:`N_{a}` , which decreases exponentially with greater +with :math:`LNC_{a}` , which decreases exponentially with greater cumulative leaf area, so that .. math:: - :label: ZEqnNum745439 + :label: 9.17 V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} where :math:`V_{c\; \max 25}^{} \left(0\right)` is defined at the top of -the canopy using :math:`SLA_{0}` , and :math:`K_{n}` is the decay +the canopy using :math:`SLA_{0}`, whic is the specific leaf area at +the canopy top and :math:`K_{n}` is the decay coefficient for nitrogen. The canopy integrated value for sunlit and shaded leaves is .. math:: - :label: 9.20) + :label: 9.20 \begin{array}{rcl} {V_{c\; \max 25}^{sun} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)f_{sun} \left(x\right)\, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} } \end{array} .. math:: - :label: 9.21) + :label: 9.21 \begin{array}{rcl} {V_{c\; \max 25}^{sha} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)\left[1-f_{sun} \left(x\right)\right] \, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left\{\left[1-e^{-K_{n} L} \right]\frac{1}{K_{n} } -\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} \right\}} \end{array} and the average value for the sunlit and shaded leaves is .. math:: - :label: 9.22) + :label: 9.22 \bar{V}_{c\; \max 25}^{sun} ={V_{c\; \max 25}^{sun} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sun} L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } .. math:: - :label: 9.23) + :label: 9.23 \bar{V}_{c\; \max 25}^{sha} ={V_{c\; \max 25}^{sha} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sha} L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } . @@ -474,39 +443,16 @@ extinction coefficient (equation 4.9). Photosynthetic parameters :math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and :math:`R_{d25}` scale similarly. -The value :math:`K_{n} = 0.11` chosen by Bonan et al. (2011) is +The value :math:`K_{n} = 0.11` chosen by :ref:`Bonan et al. (2011)` is consistent with observationally-derived estimates for forests, mostly tropical, and provides a gradient in V\ :sub:`cmax` similar to -the original CLM4 specific leaf area scaling. However, Bonan et al. -(2012) showed that the sunlit/shaded canopy parameterization does not +the original CLM4 specific leaf area scaling. However, +:ref:`Bonan et al. (2012)` showed that the sunlit/shaded canopy parameterization does not match an explicit multi-layer canopy parameterization. The discrepancy arises from absorption of scattered radiation by shaded leaves and can be tuned out with higher :math:`K_{n}` . The model uses :math:`K_{n} =0.30` to match an explicit multi-layer canopy. -:math:`V_{c\max 25}` additionally varies with daylength (:math:`DYL`) -using the function :math:`f(DYL)`, which introduces seasonal variation -to :math:`V_{c\max }` - -.. math:: - :label: 9.24) - - f\left(DYL\right)=\frac{\left(DYL\right)^{2} }{\left(DYL_{\max } \right)^{2} } - -with :math:`0.01\le f\left(DYL\right)\le 1`. Daylength (seconds) is -given by - -.. math:: - :label: 9.25) - - DYL=2\times 13750.9871\cos ^{-1} \left[\frac{-\sin \left(lat\right)\sin \left(decl\right)}{\cos \left(lat\right)\cos \left(decl\right)} \right] - -where :math:`lat` (latitude) and :math:`decl` (declination angle) are -from section 3.3. Maximum daylength (:math:`DYL_{\max }` ) is calculated -similarly but using the maximum declination angle for present-day -orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], -positive for Northern Hemisphere latitudes and negative for Southern -Hemisphere). .. _Numerical implementation photosynthesis: @@ -516,29 +462,29 @@ Numerical implementation The CO\ :sub:`2` partial pressure at the leaf surface :math:`c_{s}` (Pa) and the vapor pressure at the leaf surface :math:`e_{s}` (Pa), needed for the stomatal resistance model in -equation , and the internal leaf CO\ :sub:`2` partial pressure -:math:`c_{i}` (Pa), needed for the photosynthesis model in equations -, +equation :eq:`9.1`, and the internal leaf CO\ :sub:`2` partial pressure +:math:`c_{i}` (Pa), needed for the photosynthesis model in equations :eq:`9.3`-:eq:`9.5`, are calculated assuming there is negligible capacity to store CO\ :sub:`2` and water vapor at the leaf surface so that .. math:: - :label: ZEqnNum581596 + :label: 9.31 A_{n} =\frac{c_{a} -c_{i} }{\left(1.4r_{b} +1.6r_{s} \right)P_{atm} } =\frac{c_{a} -c_{s} }{1.4r_{b} P_{atm} } =\frac{c_{s} -c_{i} }{1.6r_{s} P_{atm} } and the transpiration fluxes are related as .. math:: - :label: ZEqnNum323660 + :label: 9.32 \frac{e_{a} -e_{i} }{r_{b} +r_{s} } =\frac{e_{a} -e_{s} }{r_{b} } =\frac{e_{s} -e_{i} }{r_{s} } where :math:`r_{b}` is leaf boundary layer resistance (s -m\ :sup:`2` :math:`\mu` \ mol\ :sup:`-1`) (section 5.3), the +m\ :sup:`2` :math:`\mu` \ mol\ :sup:`-1`) (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`), the terms 1.4 and 1.6 are the ratios of diffusivity of CO\ :sub:`2` to H\ :sub:`2`\ O for the leaf boundary layer resistance and stomatal resistance, -:math:`c_{a} ={\rm CO}_{{\rm 2}} \left({\rm mol\; mol}^{{\rm -1}} \right)P_{atm}` +:math:`c_{a} ={\rm CO}_{{\rm 2}} \left({\rm mol\; mol}^{{\rm -1}} \right)`, :math:`P_{atm}` is the atmospheric CO\ :sub:`2` partial pressure (Pa) calculated from CO\ :sub:`2` concentration (ppmv), :math:`e_{i}` is the saturation vapor pressure (Pa) evaluated at the leaf temperature @@ -547,31 +493,32 @@ The vapor pressure of air in the plant canopy :math:`e_{a}` (Pa) is determined from .. math:: - :label: 9.33) + :label: 9.33 e_{a} =\frac{P_{atm} q_{s} }{0.622} where :math:`q_{s}` is the specific humidity of canopy air (kg -kg\ :sup:`-1`) (section 5.3). Equations and are solved for +kg\ :sup:`-1`) (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). +Equations and are solved for :math:`c_{s}` and :math:`e_{s}` .. math:: - :label: 9.34) + :label: 9.34 c_{s} =c_{a} -1.4r_{b} P_{atm} A_{n} .. math:: - :label: ZEqnNum123611 + :label: 9.35 e_{s} =\frac{e_{a} r_{s} +e_{i} r_{b} }{r_{b} +r_{s} } -Substitution of equation into equation gives an expression for stomatal +Substitution of equation :eq:`9.35` into equation :eq:`9.1` gives an expression for stomatal resistance (:math:`r_{s}` ) as a function of photosynthesis (:math:`A_{n}` ), given here in terms of conductance with :math:`g_{s} =1/r_{s}` and :math:`g_{b} =1/r_{b}` .. math:: - :label: 9.36) + :label: 9.36 c_{s} g_{s}^{2} +\left[c_{s} \left(g_{b} -b\right)-m{\it A}_{n} P_{atm} \right]g_{s} -g_{b} \left[c_{s} b+mA_{n} P_{atm} {e_{a} \mathord{\left/ {\vphantom {e_{a} e_{\*} \left(T_{v} \right)}} \right. \kern-\nulldelimiterspace} e_{\*} \left(T_{v} \right)} \right]=0. @@ -579,13 +526,13 @@ Stomatal conductance is the larger of the two roots that satisfy the quadratic equation. Values for :math:`c_{i}` are given by .. math:: - :label: 9.37) + :label: 9.37 c_{i} =c_{a} -\left(1.4r_{b} +1.6r_{s} \right)P_{atm} A{}_{n} The equations for :math:`c_{i}` , :math:`c_{s}` , :math:`r_{s}` , and :math:`A_{n}` are solved iteratively until :math:`c_{i}` converges. -Sun et al. (2012) pointed out that the CLM4 numerical approach does not +:ref:`Sun et al. (2012)` pointed out that the CLM4 numerical approach does not always converge. Therefore, the model uses a hybrid algorithm that combines the secant method and Brent’s method to solve for :math:`c_{i}` . The equation set is solved separately for sunlit @@ -593,19 +540,19 @@ combines the secant method and Brent’s method to solve for (:math:`A_{n}^{sha}` , :math:`r_{s}^{sha}` ) leaves. The model has an optional (though not supported) multi-layer canopy, as -described by Bonan et al. (2012). The multi-layer model is only intended +described by :ref:`Bonan et al. (2012)`. The multi-layer model is only intended to address the non-linearity of light profiles, photosynthesis, and stomatal conductance in the plant canopy. In the multi-layer canopy, sunlit (:math:`A_{n}^{sun}` , :math:`r_{s}^{sun}` ) and shaded (:math:`A_{n}^{sha}` , :math:`r_{s}^{sha}` ) leaves are explicitly -resolved at depths in the canopy using a light profile (Chapter 4). In +resolved at depths in the canopy using a light profile (Chapter :numref:`rst_Radiative Fluxes`). In this case, :math:`V_{c\max 25}` is not integrated over the canopy, but is instead given explicitly for each canopy layer using equation . This -also uses the Lloyd et al. (2010) relationship whereby +also uses the :ref:`Lloyd et al. (2010)` relationship whereby K\ :sub:`n` scales with V\ :sub:`cmax` as .. math:: - :label: 9.38) + :label: 9.38 K_{n} =\exp \left(0.00963V_{c\max } -2.43\right) diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index 0f24520566..704f0d4be5 100755 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -48,6 +48,9 @@ we do not differentiate the photosynthetic capacity difference for sun-lit or sh Model structure ---------------------------------------------------------- +Plant Nitrogen +'''''''''''''''''''''''''' + The structure of the LUNA model is adapted from Xu et al.(2012), where the plant nitrogen at the leaf level ( :math:`\text{LNC}_{a}`; gN/ m :sup:`2` leaf) is divided into four pools: structural nitrogen( :math:`N_{\text{str}}`; gN/m :sup:`2` leaf), photosynthetic nitrogen ( :math:`N_{\text{psn}}`; gN/ m:sup:`2` leaf), @@ -100,6 +103,9 @@ The gross photosynthesis, :math:`A`, was calculated with a coupled leaf gas exc photosynthesis and Ball--Berry-type stomatal conductance model (Ball et al., 1987). The maintenance respiration for photosynthetic enzymes, :math:`R_{\text{psn}}`, is calculated by the multiplication of total photosynthetic nitrogen ( :math:`N_{\text{psn}}` ) and the maintenance respiration cost for photosynthetic enzymes. +Maximum electron transport rate +'''''''''''''''''''''' + In the LUNA model, the maximum electron transport rate ( :math:`J_{\text{max}}`; :math:`{\mu} mol` electron / m :sup:`-2`/s) is simulated to have a baseline allocation of nitrogen and additional @@ -182,6 +188,52 @@ empirical expression of leaf (1937), where :math:`\text{PAR}_{\text{{max}}}` ( :math:`\mu mol`/m :sup:`2`/s) is the maximum photosynthetically active radiation during the day. +Maximum rate of carboxylation +''''''''''''''''' + +The maximum rate of carboxylation at 25 :sup:`o`\ C varies with +foliage nitrogen concentration and specific leaf area and is calculated +as in Thornton and Zimmermann (2007). At 25ºC, + +.. math:: + :label: 10.11) + + V_{c\max 25} =N_{str} N_{cb} F_{NR} a_{R25} + +where :math:`N_{str}` is the area-based leaf nitrogen concentration (g N +m\ :sup:`-2` leaf area), :math:`N_{cb}` is the fraction of leaf +nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), +:math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass +to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and +:math:`a_{R25} =60` is the specific activity of Rubisco (µmol +CO\ :sub:`2` g\ :sup:`-1` Rubisco s\ :sup:`-1`). + +:math:`V_{c\max 25}` additionally varies with daylength (:math:`DYL`) +using the function :math:`f(DYL)`, which introduces seasonal variation +to :math:`V_{c\max }` + +.. math:: + :label: 10.12) + + f\left(DYL\right)=\frac{\left(DYL\right)^{2} }{\left(DYL_{\max } \right)^{2} } + +with :math:`0.01\le f\left(DYL\right)\le 1`. Daylength (seconds) is +given by + +.. math:: + :label: 10.13) + + DYL=2\times 13750.9871\cos ^{-1} \left[\frac{-\sin \left(lat\right)\sin \left(decl\right)}{\cos \left(lat\right)\cos \left(decl\right)} \right] + +where :math:`lat` (latitude) and :math:`decl` (declination angle) are +from section :numref:`Solar Zenith Angle`. Maximum daylength (:math:`DYL_{\max }` ) is calculated +similarly but using the maximum declination angle for present-day +orbital geometry (:math:`\pm`\ 23.4667º [:math:`\pm`\ 0.409571 radians], +positive for Northern Hemisphere latitudes and negative for Southern +Hemisphere). + +Implementation of Photosynthetic Capacity +''''''''''''''''' Based on Farquhar et al. (1980) and Wullschleger (1993), we can calculate the electron-limited photosynthetic rate under daily maximum radiation ( :math:`W_{jx}`) @@ -189,12 +241,12 @@ and the Rubisco-limited photosynthetic rate ( :math:`W_{\mathrm{c}}`) as follows .. math:: - :label: 10.11) + :label: 10.14) W_{J_{x}} = K_{j}J_{x} , .. math:: - :label: 10.12) + :label: 10.15) W_{\mathrm{c}} = K_{\mathrm{c}} V_{{\mathrm{c}, \text{max}}}, @@ -207,7 +259,7 @@ assume that :math:`W_{\mathrm{c}}` is proportional to :math:`W_{J_{x}}`. Specifically, we have .. math:: - :label: 10.13) + :label: 10.16) W_{\mathrm{c}}=t_{\alpha}t_{\mathrm{c}, j0}W_{J_{x}} @@ -218,11 +270,14 @@ nitrogen use efficiency of carboxylation and electron transport (Ainsworth and R therefore the LUNA model has the modification factor, :math:`t_{\alpha}`, to adjust baseline the ratio depending on the nitrogen use efficiency for electron vs carboxylation (Ali et al 2016). +Total Respiration +''''''''''''''' + Following Collatz et al.(1991a), the total respiration ( :math:`R_{\mathrm{t}}`) is calculated in proportion to :math:`V_{\text{c,max}}`, .. math:: - :label: 10.14) + :label: 10.17) R_{\mathrm{t}} = 0.015 V_{\text{c,max}}. @@ -231,7 +286,7 @@ Accounting for the daytime and nighttime temperature, the daily respirations is .. math:: - :label: 10.15) + :label: 10.18) R_{\text{td}}={R}_{\mathrm{t}} [D_{\text{day}} + D_{\text{night}} f_{\mathrm{r}}{(T_{\text{night}})/f_{\mathrm{r}}{(T_{\text{day}})}}], @@ -253,4 +308,4 @@ by incrementally increase the nitrogen allocated for light capture (i.e., :math We assume that plants only optimize the nitrogen allocation when they can grow (i.e., GPP>0.0). If GPP become zero under stress, then the LUNA model assume a certain amount of enzyme will decay at daily rates of 0.1, in view that the half-life time for photosynthetic enzymes are short (~7 days) (Suzuki et al. 2001). -To avoid unrealistic low values of photosynthetic capacity, the decay is only limited to 50 percent of the original enzyme levels. \ No newline at end of file +To avoid unrealistic low values of photosynthetic capacity, the decay is only limited to 50 percent of the original enzyme levels. From b005a83568b118ea26a34e28c7f9d70a0e43eb29 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Thu, 27 Jul 2017 16:16:47 -0600 Subject: [PATCH 082/730] Updates to the stomatal conductance section of the photosynthesis chapter --- .../CLM50_Tech_Note_Photosynthesis.rst | 165 +++++++++--------- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 8 +- 2 files changed, 88 insertions(+), 85 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index cfe155d42a..163c476d08 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -16,8 +16,7 @@ CLM5 includes the following new changes to photosynthesis and stomatal conductan - :math:`J_{max}` is predicted by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) -- Leaf N concentration and the fraction of leaf N in Rubisco used to calculate -:math:`V_{cmax}` are determined by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) +- Leaf N concentration and the fraction of leaf N in Rubisco used to calculate :math:`V_{cmax25}` are determined by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) - Water stress is applied by the hydraulic conductance model (Chapter :numref:`rst_Plant Hydraulics`) @@ -43,54 +42,54 @@ where :math:`r_{b}` is the leaf boundary layer resistance (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). The implementation is described by Bonan et al. (:ref:`2011 `), though different methods of calculating stomatal conductance, :math:`J_{max}`, and the nitrogen variables -used to calculate :math:`V_{cmax}` are used in CLM5. +used to calculate :math:`V_{cmax25}` are used in CLM5. .. _Stomatal resistance: Stomatal resistance ----------------------- -Leaf stomatal resistance is calculated from the Ball-Berry conductance -model as described by Collatz et al. (1991) and implemented in global -climate models (Sellers et al. 1996). The model relates stomatal -conductance (i.e., the inverse of resistance) to net leaf -photosynthesis, scaled by the relative humidity at the leaf surface and -the CO\ :sub:`1` concentration at the leaf surface. Leaf stomatal -resistance is +CLM5 calculates stomatal conductance using the Medlyn stomatal conductance model (:ref:`Medlyn et al. 2011`). +Previous versions of CLM calculated leaf stomatal resistance is using the Ball-Berry conductance +model as described by :ref:`Collatz et al. (1991)` and implemented in global +climate models (:ref:`Sellers et al. 1996`). The Medlyn model +calculates stomatal conductance (i.e., the inverse of resistance) based on net leaf +photosynthesis, the vapor pressure deficit, and the CO\ :sub:`2` concentration at the leaf surface. +Leaf stomatal resistance is: .. math:: :label: 9.1 - \frac{1}{r_{s} } =g_{s} =m\frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } h_{s} +b\, \beta _{t} + \frac{1}{r_{s} } =g_{s} = g_{o} + (1 + \frac{g_{1} }{\sqrt{D}}) \frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` -:math:`\mu`\ mol\ :sup:`-1`), :math:`m` is a plant functional -type dependent parameter (Table 8.1), :math:`A_{n}` is leaf net +:math:`\mu`\ mol\ :sup:`-1`), :math:`g_{o}` is the minimum stomatal conductance +(:math:`\mu` mol m :sup:`-2` s\ :sup:`-1`), :math:`A_{n}` is leaf net photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric -pressure (Pa), :math:`h_{s} =e_{s} /e_{i}` is the leaf surface humidity -with :math:`e_{s}` the vapor pressure at the leaf surface (Pa) and -:math:`e_{i}` the saturation vapor pressure (Pa) inside the leaf at the -vegetation temperature\ :math:`T_{v}`, and :math:`b` is the minimum -stomatal conductance (:math:`\mu` mol m :sup:`-2` -s\ :sup:`-1`). Parameter values are :math:`m=9` for -C\ :sub:`3` plants and :math:`m=4` for C\ :sub:`4` plants -(Collatz et al. 1991, 1992, Sellers et al. 1996). Sellers et al. (1996) -used :math:`b=10000` for C\ :sub:`3` plants and -:math:`b=40000` for C\ :sub:`4` plants, also used here. +pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (Pa). +:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) photosynthetic parameters`) +and can be calculated as + +.. math:: + :label: 9.2 + + g_{1} = {\sqrt{\frac{3\Gamma*\lambda}{1.6}}} + +Parameter values are :math:`g_{o}=X` for +C\ :sub:`3` plants and :math:`g_{o}=4` for C\ :sub:`4` plants Photosynthesis is calculated for sunlit (:math:`A^{sun}`) and shaded (:math:`A^{sha}`) leaves to give :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}`. Additionally, soil water influences stomatal -resistance directly by multiplying the minimum conductance by a soil -water stress function :math:`\beta _{t}` (which ranges from 0 to 1) and -also indirectly through :math:`A_{n}`, as in (Sellers et al. 1996). +resistance through plant hydraulic stress, detailed in +the :ref:`rst_Plant Hydraulics` chapter. Resistance is converted from units of s m\ :sup:`2` :math:`\mu` mol\ :sub:`-1` to s m\ :sup:`-1` as: -1 s m\ sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` +1 s m\ :sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` :math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` -kmol\ :sup:`-1`) (Table 2.6) and :math:`\theta _{atm}` is the +kmol\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). .. _Table Plant functional type (PFT) photosynthetic parameters: @@ -160,13 +159,13 @@ Photosynthesis ------------------ Photosynthesis in C\ :sub:`3` plants is based on the model of -Farquhar et al. (1980). Photosynthesis in C\ :sub:`4` plants is -based on the model of Collatz et al. (1992). Bonan et al. (2011) +:ref:`Farquhar et al. (1980)`. Photosynthesis in C\ :sub:`4` plants is +based on the model of :ref:`Collatz et al. (1992)`. :ref:`Bonan et al. (2011)` describe the implementation, modified here. In its simplest form, leaf net photosynthesis after accounting for respiration (:math:`R_{d}` ) is .. math:: - :label: 9.2 + :label: 9.3 A_{n} =\min \left(A_{c} ,A_{j} ,A_{p} \right)-R_{d} . @@ -175,7 +174,7 @@ The RuBP carboxylase (Rubisco) limited rate of carboxylation s\ :sup:`-1`) is .. math:: - :label: 9.3 + :label: 9.4 A_{c} =\left\{\begin{array}{l} {\frac{V_{c\max } \left(c_{i} -\Gamma _{\*} \right)}{c_{i} +K_{c} \left(1+{o_{i} \mathord{\left/ {\vphantom {o_{i} K_{o} }} \right. \kern-\nulldelimiterspace} K_{o} } \right)} \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {V_{c\max } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -184,7 +183,7 @@ RuBP (i.e., the light-limited rate) :math:`A_{j}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 9.4 + :label: 9.5 A_{j} =\left\{\begin{array}{l} {\frac{J\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. @@ -194,7 +193,7 @@ C\ :sub:`4` plants :math:`A_{p}` (:math:`\mu` \ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 9.5 + :label: 9.6 A_{p} =\left\{\begin{array}{l} {3T_{p\qquad } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {k_{p} \frac{c_{i} }{P_{atm} } \qquad \qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}. @@ -210,12 +209,12 @@ m\ :sup:`-2` s\ :sup:`-1`). :math:`T_{p}` is the triose phosphate utilization rate (µmol m\ :sup:`-2` s\ :sup:`-1`), taken as :math:`T_{p} =0.167V_{c\max }` so that :math:`A_{p} =0.5V_{c\max }` for C\ :sub:`3` plants (as in -Collatz et al. 1991). For C\ :sub:`4` plants, the light-limited +:ref:`Collatz et al. 1992 `). For C\ :sub:`4` plants, the light-limited rate :math:`A_{j}` varies with :math:`\phi` in relation to the quantum efficiency (:math:`\alpha =0.05` mol CO\ :sub:`2` mol\ :sup:`-1` photon). :math:`\phi` is the absorbed -photosynthetically active radiation (W m\ :sup:`-2`) (section -4.1), which is converted to photosynthetic photon flux assuming 4.6 +photosynthetically active radiation (W m\ :sup:`-2`) (section :numref:`Solar Fluxes`) +, which is converted to photosynthetic photon flux assuming 4.6 :math:`\mu` \ mol photons per joule. :math:`k_{p}` is the initial slope of C\ :sub:`4` CO\ :sub:`2` response curve. @@ -224,7 +223,7 @@ photosynthetically active radiation absorbed by the leaf. A common expression is the smaller of the two roots of the equation .. math:: - :label: 9.6 + :label: 9.7 \Theta _{PSII} J^{2} -\left(I_{PSII} +J_{\max } \right)J+I_{PSII} J_{\max } =0 @@ -239,7 +238,7 @@ with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is .. math:: - :label: 9.7 + :label: 9.8 I_{PSII} =0.5\Phi _{PSII} (4.6\phi ) @@ -251,12 +250,12 @@ calculating :math:`A_{j}` (for both C\ :sub:`3` and C\ :sub:`4` plants), :math:`\phi =\phi ^{sun}` for sunlit leaves and :math:`\phi =\phi ^{sha}` for shaded leaves. -The model uses co-limitation as described by Collatz et al. (1991, -1992). The actual gross photosynthesis rate, :math:`A`, is given by the +The model uses co-limitation as described by :ref:`Collatz et al. (1991, 1992) +`. The actual gross photosynthesis rate, :math:`A`, is given by the smaller root of the equations .. math:: - :label: 9.8 + :label: 9.9 \begin{array}{rcl} {\Theta _{cj} A_{i}^{2} -\left(A_{c} +A_{j} \right)A_{i} +A_{c} A_{j} } & {=} & {0} \\ {\Theta _{ip} A^{2} -\left(A_{i} +A_{p} \right)A+A_{i} A_{p} } & {=} & {0} \end{array} . @@ -265,57 +264,61 @@ C\ :sub:`3` plants; and :math:`\Theta _{cj} =0.80`\ and :math:`\Theta _{ip} =0.95` for C\ :sub:`4` plants. :math:`A_{n} =A-R_{d}` . -The parameters :math:`K_{c}`, :math:`K_{o}` , and :math:`\Gamma _{*}` +The parameters :math:`K_{c}`, :math:`K_{o}`, and :math:`\Gamma _{*}` depend on temperature. Values at 25 :sup:`o` \ C are -:math:`K_{c25} ={\rm 4}0{\rm 4}.{\rm 9}\times 10^{-6} P_{atm}` , -:math:`K_{o25} =278.4\times 10^{-3} P_{atm}` , and -:math:`\Gamma _{*25} {\rm =42}.75\times 10^{-6} P_{atm}` . -:math:`V_{c\max }` , :math:`J_{\max }` , :math:`T_{p}` , :math:`k_{p}` , -and :math:`R_{d}` also vary with temperature. Parameter values at 25 +:math:`K_{c25} ={\rm 4}0{\rm 4}.{\rm 9}\times 10^{-6} P_{atm}`, +:math:`K_{o25} =278.4\times 10^{-3} P_{atm}`, and +:math:`\Gamma _{*25} {\rm =42}.75\times 10^{-6} P_{atm}`. +:math:`V_{c\max }`, :math:`J_{\max }`, :math:`T_{p}`, :math:`k_{p}`, +and :math:`R_{d}` also vary with temperature. Parameter values at 25 :math:`\circ`\ C are calculated from :math:`V_{c\max }` \ at 25 -:math:`\circ`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}` , -:math:`T_{p25} =0.167V_{c\max 25}` , and -:math:`R_{d25} =0.015V_{c\max 25}` (C\ :sub:`3`) and -:math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). For -C\ :sub:`4` plants, :math:`k_{p25} =20000\; V_{c\max 25}` . +:math:`\circ`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}`, +:math:`T_{p25} =0.167V_{c\max 25}`, and +:math:`R_{d25} =0.015V_{c\max 25}` (C\ :sub:`3`) and +:math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). For +C\ :sub:`4` plants, :math:`k_{p25} =20000\; V_{c\max 25}`. However, when the biogeochemistry is active, :math:`R_{d25}` is -calculated from leaf nitrogen as :math:`R_{d25} =0.2577N_{a}` , where -:math:`N_{a}` is the area-based leaf nitrogen concentration (g N -m\ :sup:`-2` leaf area, equation ) and 0.2577 :math:`\mu`\ mol -CO\ :sub:`2` g\ :sup:`-1` N s\ :sup:`-1` the base -respiration rate. The parameters :math:`V_{c\max 25}` , -:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and -:math:`R_{d25}` are scaled over the canopy for sunlit and shaded leaves -(section 8.3). In C3 plants, these are adjusted for leaf temperature -:math:`T_{v}` (K) as: +calculated from leaf nitrogen as :math:`R_{d25} = 0.2577LNC_{a}`, +where :math:`LNC_{a}` is the area-based leaf nitrogen concentration +(g N m\ :sup:`-2` leaf area, Chapter :numref:`rst_Photosynthetic Capacity`), +and 0.2577 :math:`\mu`\ mol CO\ :sub:`2` g\ :sup:`-1` N s\ :sup:`-1` is the base respiration rate. +The parameters :math:`V_{c\max 25}`, +:math:`J_{\max 25}`, :math:`T_{p25}`, :math:`k_{p25}`, and +:math:`R_{d25}` are scaled over the canopy for sunlit and shaded leaves +(section :numref:`Canopy scaling`). In C\ :sub:`3` plants, these are adjusted for leaf temperature, +:math:`T_{v}` (K), as: .. math:: - :label: 9.9 + :label: 9.10 \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma _{*} } & {=} & {\Gamma _{*25} \; f\left(T_{v} \right)} \end{array} with .. math:: - :label: 9.10 + :label: 9.11 f\left(T_{v} \right)=\; \exp \left[\frac{\Delta H_{a} }{298.15\times 0.001R_{gas} } \left(1-\frac{298.15}{T_{v} } \right)\right] and .. math:: - :label: 9.11 + :label: 9.12 f_{H} \left(T_{v} \right)=\frac{1+\exp \left(\frac{298.15\Delta S-\Delta H_{d} }{298.15\times 0.001R_{gas} } \right)}{1+\exp \left(\frac{\Delta ST_{v} -\Delta H_{d} }{0.001R_{gas} T_{v} } \right)} . -Table 8.2 list parameter values for :math:`\Delta H_{a}` , -:math:`\Delta H_{d}` , and :math:`\Delta S`, from Bonan et al. (2011). +:numref:`Table Temperature dependence parameters for C3 photosynthesis` +lists parameter values for :math:`\Delta H_{a}` , +:math:`\Delta H_{d}` , and :math:`\Delta S`, from :ref:`Bonan et al. (2011)`. +[Note: should we remove :math:`\Delta S` from the table below since we no longer use these? +Also, we should consider updating :math:`\Delta H_{a}` , +:math:`\Delta H_{d}` in this table] Because :math:`T_{p}` as implemented here varies with -:math:`V_{c\max }` , the same temperature parameters are used for -:math:`T_{p}` . For C\ :sub:`4` plants, +:math:`V_{c\max }` , :math:`T_{p}` uses the same temperature parameters as +:math:`V_{c\max}` . For C\ :sub:`4` plants, .. math:: - :label: 9.12 + :label: 9.13 \begin{array}{l} {V_{c\max } =V_{c\max 25} \left[\frac{Q_{10} ^{(T_{v} -298.15)/10} }{f_{H} \left(T_{v} \right)f_{L} \left(T_{v} \right)} \right]} \\ {f_{H} \left(T_{v} \right)=1+\exp \left[s_{1} \left(T_{v} -s_{2} \right)\right]} \\ {f_{L} \left(T_{v} \right)=1+\exp \left[s_{3} \left(s_{4} -T_{v} \right)\right]} \end{array} @@ -326,7 +329,7 @@ with :math:`Q_{10} =2`, Additionally, .. math:: - :label: 9.13 + :label: 9.14 R_{d} =R_{d25} \left\{\frac{Q_{10} ^{(T_{v} -298.15)/10} }{1+\exp \left[s_{5} \left(T_{v} -s_{6} \right)\right]} \right\} @@ -334,7 +337,7 @@ with :math:`Q_{10} =2`, :math:`s_{5} =1.3` K\ :sup:`-1` and :math:`s_{6} =328.15`\ K, and .. math:: - :label: 9.14 + :label: 9.15 k_{p} =k_{p25} \, Q_{10} ^{(T_{v} -298.15)/10} @@ -362,36 +365,36 @@ with :math:`Q_{10} =2`. | :math:`\Gamma _{\*}` | 37830 | – | – | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ -The parameters in numref:`Table Temperature dependence parameters for C3 photosynthesis` +The parameters in :numref:`Table Temperature dependence parameters for C3 photosynthesis` do not allow for temperature acclimation of photosynthesis. In the model, acclimation is implemented as in :ref:`Kattge and Knorr (2007) `. In this parameterization, :math:`V_{c\max }` and :math:`J_{\max }` vary with the plant growth temperature. This is -achieved by allowing :math:`\Delta S`\ to vary with growth temperature +achieved by allowing :math:`\Delta S`\ to vary with growth temperature according to .. math:: - :label: 9.15 + :label: 9.16 \begin{array}{l} {\Delta S=668.39-1.07(T_{10} -T_{f} )\qquad \qquad {\rm for\; }V_{c\max } } \\ {\Delta S=659.70-0.75(T_{10} -T_{f} )\qquad \qquad {\rm for\; }J_{\max } } \end{array} The effect is to cause the temperature optimum of :math:`V_{c\max }` -and :math:`J_{\max }` to increase with warmer temperature. In this +and :math:`J_{\max }` to increase with warmer temperatures. In this parameterization, :math:`\Delta H_{d}` \ = 200000, :math:`\Delta H_{a}` \ = 72000 for :math:`V_{c\max }` , and :math:`\Delta H_{a}` \ = 50000 for :math:`J_{\max }` . Additionally, the ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: - :label: 9.16 + :label: 9.17 J_{\max 25} /V_{c\max 25} =2.59-0.035(T_{10} -T_{f} ). In these acclimation functions, :math:`T_{10}` is the 10-day mean air temperature (K) and :math:`T_{f}` is the freezing point of water (K). -For lack of data, :math:`T_{p}` acclimates similar to V :sub:`cmax` . Acclimation is restricted over the temperature +For lack of data, :math:`T_{p}` acclimates similar to :math:`V_{c\max }`. Acclimation is restricted over the temperature range :math:`T_{10} -T_{f} \ge 11`\ :sup:`o`\ C and :math:`T_{10} -T_{f} \le 35`\ :sup:`o`\ C. -.. Canopy scaling: +.. _Canopy scaling: Canopy scaling -------------------------------------------- @@ -405,7 +408,7 @@ with :math:`LNC_{a}` , which decreases exponentially with greater cumulative leaf area, so that .. math:: - :label: 9.17 + :label: 9.18 V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} @@ -547,7 +550,7 @@ sunlit (:math:`A_{n}^{sun}` , :math:`r_{s}^{sun}` ) and shaded (:math:`A_{n}^{sha}` , :math:`r_{s}^{sha}` ) leaves are explicitly resolved at depths in the canopy using a light profile (Chapter :numref:`rst_Radiative Fluxes`). In this case, :math:`V_{c\max 25}` is not integrated over the canopy, but -is instead given explicitly for each canopy layer using equation . This +is instead given explicitly for each canopy layer using equation :eq:`9.18`. This also uses the :ref:`Lloyd et al. (2010)` relationship whereby K\ :sub:`n` scales with V\ :sub:`cmax` as diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index 704f0d4be5..0c99101fa0 100755 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -104,7 +104,7 @@ photosynthesis and Ball--Berry-type stomatal conductance model (Ball et al., 198 calculated by the multiplication of total photosynthetic nitrogen ( :math:`N_{\text{psn}}` ) and the maintenance respiration cost for photosynthetic enzymes. Maximum electron transport rate -'''''''''''''''''''''' +''''''''''''''''''''''''''''''''' In the LUNA model, the maximum electron transport rate ( :math:`J_{\text{max}}`; :math:`{\mu} mol` electron / m :sup:`-2`/s) @@ -189,7 +189,7 @@ where :math:`\text{PAR}_{\text{{max}}}` ( :math:`\mu mol`/m :sup:`2`/s) is the maximum photosynthetically active radiation during the day. Maximum rate of carboxylation -''''''''''''''''' +'''''''''''''''''''''''''''''' The maximum rate of carboxylation at 25 :sup:`o`\ C varies with foliage nitrogen concentration and specific leaf area and is calculated @@ -233,7 +233,7 @@ positive for Northern Hemisphere latitudes and negative for Southern Hemisphere). Implementation of Photosynthetic Capacity -''''''''''''''''' +'''''''''''''''''''''''''''''''''''''''''' Based on Farquhar et al. (1980) and Wullschleger (1993), we can calculate the electron-limited photosynthetic rate under daily maximum radiation ( :math:`W_{jx}`) @@ -271,7 +271,7 @@ therefore the LUNA model has the modification factor, :math:`t_{\alpha}`, to adj the ratio depending on the nitrogen use efficiency for electron vs carboxylation (Ali et al 2016). Total Respiration -''''''''''''''' +''''''''''''''''''' Following Collatz et al.(1991a), the total respiration ( :math:`R_{\mathrm{t}}`) is calculated in proportion to :math:`V_{\text{c,max}}`, From 073dddd8d41a0d07b0ae0ebcbfcfe97559268493 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Mon, 31 Jul 2017 17:40:28 -0600 Subject: [PATCH 083/730] Edited stomatal conductance section & updated the parameter table --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 2 +- .../CLM50_Tech_Note_Introduction.rst | 2 +- .../CLM50_Tech_Note_Photosynthesis.rst | 128 +++++++++--------- 3 files changed, 64 insertions(+), 68 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index d5f9b85560..10315b7d98 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -114,7 +114,7 @@ distribution parameters that control the uptake of water from the soil (:numref:`Table Plant functional type root distribution parameters`), aerodynamic parameters that determine resistance to heat, moisture, and momentum transfer (:numref:`Table Plant functional type aerodynamic parameters`), and photosynthetic parameters that determine stomatal resistance, photosynthesis, and -transpiration (:numref:`Table Plant functional type (PFT) photosynthetic parameters`, +transpiration (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`, :numref:`Table Temperature dependence parameters for C3 photosynthesis`). The composition and abundance of PFTs within a grid cell can either be prescribed as time-invariant fields (e.g., using the present day dataset described in section 21.3.3) or can diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 31ab7685d8..7c006efab7 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -123,7 +123,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table snow layer thickness` Minimum and maximum thickness of snow layers (m) -- :numref:`Table Plant functional type (PFT) photosynthetic parameters` Plant functional type (PFT) photosynthetic parameters. +- :numref:`Table Plant functional type (PFT) stomatal conductance parameters` Plant functional type (PFT) stomatal conductance parameters. - :numref:`Table Temperature dependence parameters for C3 photosynthesis` Temperature dependence parameters for C3 photosynthesis. diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 163c476d08..a6cb6e987a 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -69,16 +69,20 @@ photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (Pa). -:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) photosynthetic parameters`) +:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`) and can be calculated as .. math:: :label: 9.2 - g_{1} = {\sqrt{\frac{3\Gamma*\lambda}{1.6}}} + g_{1} = {\sqrt{\frac{3\Gamma\lambda}{1.6}}} -Parameter values are :math:`g_{o}=X` for -C\ :sub:`3` plants and :math:`g_{o}=4` for C\ :sub:`4` plants +where :math:`\Gamma` (mol mol\ :sup:`-1`) is the CO\ :sub:`2` compensation point +for photosynthesis without dark respiration and :math:`\lambda` +(mol H\ :sub:`2` O mol\ :sup:`-1`) is a parameter +describing the marginal water cost of carbon gain. +The value for :math:`g_{o}=100` :math:`\mu` mol m :sup:`-2` s\ :sup:`-1` for +C\ :sub:`3` and C\ :sub:`4` plants. Photosynthesis is calculated for sunlit (:math:`A^{sun}`) and shaded (:math:`A^{sha}`) leaves to give :math:`r_{s}^{sun}` and :math:`r_{s}^{sha}`. Additionally, soil water influences stomatal @@ -86,72 +90,64 @@ resistance through plant hydraulic stress, detailed in the :ref:`rst_Plant Hydraulics` chapter. Resistance is converted from units of -s m\ :sup:`2` :math:`\mu` mol\ :sub:`-1` to s m\ :sup:`-1` as: +s m\ :sup:`2` :math:`\mu` mol\ :sup:`-1` to s m\ :sup:`-1` as: 1 s m\ :sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` -:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` +:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [check units are correct here] +where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` kmol\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). -.. _Table Plant functional type (PFT) photosynthetic parameters: - -.. table:: Plant functional type (PFT) photosynthetic parameters. - - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | PFT | m | :math:`\alpha` | :math:`CN_{L}` | :math:`F_{LNR}` | :math:`SLA_{0}` | :math:`\psi _{o}` | :math:`\psi _{c}` | :math:`{V}_{cmax25}` | - +==================================+=====+====================+===================+====================+====================+======================+======================+===========================+ - | NET Temperate | 9 | – | 35 | 0.0509 | 0.010 | -66000 | -255000 | 62.5 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | NET Boreal | 9 | – | 40 | 0.0466 | 0.008 | -66000 | -255000 | 62.6 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | NDT Boreal | 9 | – | 25 | 0.0546 | 0.024 | -66000 | -255000 | 39.1 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BET Tropical | 9 | – | 30 | 0.0461 | 0.012 | -66000 | -255000 | 55.0 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BET temperate | 9 | – | 30 | 0.0515 | 0.012 | -66000 | -255000 | 61.5 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BDT tropical | 9 | – | 25 | 0.0716 | 0.030 | -35000 | -224000 | 41.0 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BDT temperate | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BDT boreal | 9 | – | 25 | 0.1007 | 0.030 | -35000 | -224000 | 57.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BES temperate | 9 | – | 30 | 0.0517 | 0.012 | -83000 | -428000 | 61.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BDS temperate | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | BDS boreal | 9 | – | 25 | 0.0943 | 0.030 | -83000 | -428000 | 54.0 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | C\ :sub:`3` arctic grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | C\ :sub:`3` grass | 9 | – | 25 | 0.1365 | 0.030 | -74000 | -275000 | 78.2 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | C\ :sub:`4` grass | 4 | 0.05 | 25 | 0.0900 | 0.030 | -74000 | -275000 | 51.6 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Crop R | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Crop I | 9 | – | 25 | 0.1758 | 0.030 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Corn R | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Corn I | 4 | 0.05 | 25 | 0.2930 | 0.050 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Temp Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Temp Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Winter Cereal R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Winter Cereal I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Soybean R | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - | Soybean I | 9 | – | 25 | 0.4102 | 0.070 | -74000 | -275000 | 100.7 | - +----------------------------------+-----+--------------------+-------------------+--------------------+--------------------+----------------------+----------------------+---------------------------+ - -:math:`\alpha` (mol CO\ :sub:`2` mol\ :sup:`-1` photon); -:math:`CN_{L}` (g C g\ :sup:`-1` N); :math:`F_{LNR}` (g N Rubisco g\ :sup:`-1` N); :math:`SLA_{0}` (m\ :sup:`2` g\ :sup:`-1` C); -:math:`\psi _{o}` and :math:`\psi _{c}` (mm); -V\ :sub:`cmax25` (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`, calculated from equation for canopy top). +.. _Table Plant functional type (PFT) stomatal conductance parameters: + +.. table:: Plant functional type (PFT) stomatal conductance parameters. + + +----------------------------------+-------------------+ + | PFT | g\ :sub:`1` (Pa) | + +==================================+===================+ + | NET Temperate | 2.35 | + +----------------------------------+-------------------+ + | NET Boreal | 2.35 | + +----------------------------------+-------------------+ + | NDT Boreal | 2.35 | + +----------------------------------+-------------------+ + | BET Tropical | 4.12 | + +----------------------------------+-------------------+ + | BET temperate | 4.12 | + +----------------------------------+-------------------+ + | BDT tropical | 4.45 | + +----------------------------------+-------------------+ + | BDT temperate | 4.45 | + +----------------------------------+-------------------+ + | BDT boreal | 4.45 | + +----------------------------------+-------------------+ + | BES temperate | 4.70 | + +----------------------------------+-------------------+ + | BDS temperate | 4.70 | + +----------------------------------+-------------------+ + | BDS boreal | 4.70 | + +----------------------------------+-------------------+ + | C\ :sub:`3` arctic grass | 2.22 | + +----------------------------------+-------------------+ + | C\ :sub:`3` grass | 5.25 | + +----------------------------------+-------------------+ + | C\ :sub:`4` grass | 1.62 | + +----------------------------------+-------------------+ + | Temperate Corn | 1.79 | + +----------------------------------+-------------------+ + | Spring Wheat | 5.79 | + +----------------------------------+-------------------+ + | Temperate Soybean | 5.79 | + +----------------------------------+-------------------+ + | Cotton | 5.79 | + +----------------------------------+-------------------+ + | Rice | 5.79 | + +----------------------------------+-------------------+ + | Sugarcane | 1.79 | + +----------------------------------+-------------------+ + | Tropical Corn | 1.79 | + +----------------------------------+-------------------+ + | Tropical Soybean | 5.79 | + +----------------------------------+-------------------+ .. _Photosynthesis: From 8bcfd46472b961a68f52ccbcb4822160469c595b Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Tue, 1 Aug 2017 17:38:32 -0600 Subject: [PATCH 084/730] Minor edits in the photosynthesis section --- .../CLM50_Tech_Note_Photosynthesis.rst | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index a6cb6e987a..b3d512121d 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -92,7 +92,7 @@ the :ref:`rst_Plant Hydraulics` chapter. Resistance is converted from units of s m\ :sup:`2` :math:`\mu` mol\ :sup:`-1` to s m\ :sup:`-1` as: 1 s m\ :sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` -:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [check units are correct here] +:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [same as 4.5, but seems off. check that units are correct] where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` kmol\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). @@ -181,7 +181,7 @@ CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 9.5 - A_{j} =\left\{\begin{array}{l} {\frac{J\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. + A_{j} =\left\{\begin{array}{l} {\frac{J_{x}\left(c_{i} -\Gamma _{\*} \right)}{4c_{i} +8\Gamma _{\*} } \qquad \qquad {\rm for\; C}_{{\rm 3}} {\rm \; plants}} \\ {\alpha (4.6\phi )\qquad \qquad {\rm for\; C}_{{\rm 4}} {\rm \; plants}} \end{array}\right\}\qquad \qquad c_{i} -\Gamma _{\*} \ge 0. The product-limited rate of carboxylation for C\ :sub:`3` plants and the PEP carboxylase-limited rate of carboxylation for @@ -200,7 +200,8 @@ is the O\ :sub:`2` partial pressure (Pa). :math:`K_{c}` and CO\ :sub:`2` and O\ :sub:`2`. :math:`\Gamma _{\*}` (Pa) is the CO\ :sub:`2` compensation point. :math:`V_{c\max }` is the maximum rate of carboxylation (µmol m\ :sup:`-2` -s\ :sup:`-1`) and :math:`J` is the electron transport rate (µmol +s\ :sup:`-1`, Chapter :numref:`rst_Photosynthetic Capacity`) +and :math:`J_{x}` is the electron transport rate (µmol m\ :sup:`-2` s\ :sup:`-1`). :math:`T_{p}` is the triose phosphate utilization rate (µmol m\ :sup:`-2` s\ :sup:`-1`), taken as :math:`T_{p} =0.167V_{c\max }` so that @@ -221,14 +222,14 @@ expression is the smaller of the two roots of the equation .. math:: :label: 9.7 - \Theta _{PSII} J^{2} -\left(I_{PSII} +J_{\max } \right)J+I_{PSII} J_{\max } =0 + \Theta _{PSII} J_{x}^{2} -\left(I_{PSII} +J_{\max } \right)J_{x}+I_{PSII} J_{\max } =0 where :math:`J_{\max }` is the maximum potential rate of electron -transport (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`), +transport (:math:`\mu`\ mol m\ :sup:`-2` s\ :sup:`-1`, Chapter :numref:`rst_Photosynthetic Capacity`), :math:`I_{PSII}` is the light utilized in electron transport by photosystem II (µmol m\ :sup:`-2` s\ :sup:`-1`), and :math:`\Theta _{PSII}` is a curvature parameter. For a given amount of -photosynthetically active radiation absorbed by a leaf :math:`\phi` (W +photosynthetically active radiation absorbed by a leaf (:math:`\phi`, W m\ :sup:`-2`), converted to photosynthetic photon flux density with 4.6 :math:`\mu`\ mol J\ :sup:`-1`, the light utilized in electron transport is @@ -258,17 +259,18 @@ smaller root of the equations Values are :math:`\Theta _{cj} =0.98` and :math:`\Theta _{ip} =0.95` for C\ :sub:`3` plants; and :math:`\Theta _{cj} =0.80`\ and :math:`\Theta _{ip} =0.95` for C\ :sub:`4` plants. +:math:`A_{i}` is the intermediate co-limited photosynthesis. :math:`A_{n} =A-R_{d}` . -The parameters :math:`K_{c}`, :math:`K_{o}`, and :math:`\Gamma _{*}` +The parameters :math:`K_{c}`, :math:`K_{o}`, and :math:`\Gamma` depend on temperature. Values at 25 :sup:`o` \ C are :math:`K_{c25} ={\rm 4}0{\rm 4}.{\rm 9}\times 10^{-6} P_{atm}`, :math:`K_{o25} =278.4\times 10^{-3} P_{atm}`, and -:math:`\Gamma _{*25} {\rm =42}.75\times 10^{-6} P_{atm}`. +:math:`\Gamma _{25} {\rm =42}.75\times 10^{-6} P_{atm}`. :math:`V_{c\max }`, :math:`J_{\max }`, :math:`T_{p}`, :math:`k_{p}`, and :math:`R_{d}` also vary with temperature. Parameter values at 25 -:math:`\circ`\ C are calculated from :math:`V_{c\max }` \ at 25 -:math:`\circ`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}`, +:sup:`o`\ C are calculated from :math:`V_{c\max }` \ at 25 +:sup:`\o`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}`, :math:`T_{p25} =0.167V_{c\max 25}`, and :math:`R_{d25} =0.015V_{c\max 25}` (C\ :sub:`3`) and :math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). For @@ -278,6 +280,7 @@ calculated from leaf nitrogen as :math:`R_{d25} = 0.2577LNC_{a}`, where :math:`LNC_{a}` is the area-based leaf nitrogen concentration (g N m\ :sup:`-2` leaf area, Chapter :numref:`rst_Photosynthetic Capacity`), and 0.2577 :math:`\mu`\ mol CO\ :sub:`2` g\ :sup:`-1` N s\ :sup:`-1` is the base respiration rate. +[this doesn't look correct based on the code, which lists two options; verify with Rosie] The parameters :math:`V_{c\max 25}`, :math:`J_{\max 25}`, :math:`T_{p25}`, :math:`k_{p25}`, and :math:`R_{d25}` are scaled over the canopy for sunlit and shaded leaves @@ -287,7 +290,7 @@ The parameters :math:`V_{c\max 25}`, .. math:: :label: 9.10 - \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma _{*} } & {=} & {\Gamma _{*25} \; f\left(T_{v} \right)} \end{array} + \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma } & {=} & {\Gamma _{25} \; f\left(T_{v} \right)} \end{array} with @@ -306,9 +309,6 @@ and :numref:`Table Temperature dependence parameters for C3 photosynthesis` lists parameter values for :math:`\Delta H_{a}` , :math:`\Delta H_{d}` , and :math:`\Delta S`, from :ref:`Bonan et al. (2011)`. -[Note: should we remove :math:`\Delta S` from the table below since we no longer use these? -Also, we should consider updating :math:`\Delta H_{a}` , -:math:`\Delta H_{d}` in this table] Because :math:`T_{p}` as implemented here varies with :math:`V_{c\max }` , :math:`T_{p}` uses the same temperature parameters as :math:`V_{c\max}` . For C\ :sub:`4` plants, @@ -346,11 +346,11 @@ with :math:`Q_{10} =2`. +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ | Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | :math:`\Delta S` (J mol\ :sup:`-1` K\ :sup:`-1`) | +========================+=================================================================+=================================================================+==============================================================================================+ - | :math:`V_{c\max }` | 65330 | 149250 | 485 | + | :math:`V_{c\max }` | 72000 | 200000 | 485 | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`J_{\max }` | 43540 | 152040 | 495 | + | :math:`J_{\max }` | 50000 | 152040 | 495 | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`T_{p}` | 65330 | 149250 | 485 | + | :math:`T_{p}` | 72000 | 149250 | 485 | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ | :math:`R_{d}` | 46390 | 150650 | 490 | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ @@ -361,6 +361,8 @@ with :math:`Q_{10} =2`. | :math:`\Gamma _{\*}` | 37830 | – | – | +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ +[Note: updated the Vcmax :math:`\Delta H_{a}` and :math:`\Delta H_{d}` +and the Jmax :math:`\Delta H_{a}` based on acclimation values. All other values are the same as previous] The parameters in :numref:`Table Temperature dependence parameters for C3 photosynthesis` do not allow for temperature acclimation of photosynthesis. In the model, acclimation is implemented as in :ref:`Kattge and Knorr (2007) `. In this parameterization, @@ -374,10 +376,8 @@ according to \begin{array}{l} {\Delta S=668.39-1.07(T_{10} -T_{f} )\qquad \qquad {\rm for\; }V_{c\max } } \\ {\Delta S=659.70-0.75(T_{10} -T_{f} )\qquad \qquad {\rm for\; }J_{\max } } \end{array} The effect is to cause the temperature optimum of :math:`V_{c\max }` -and :math:`J_{\max }` to increase with warmer temperatures. In this -parameterization, :math:`\Delta H_{d}` \ = 200000, -:math:`\Delta H_{a}` \ = 72000 for :math:`V_{c\max }` , and -:math:`\Delta H_{a}` \ = 50000 for :math:`J_{\max }` . Additionally, the +and :math:`J_{\max }` to increase with warmer temperatures. +Additionally, the ratio :math:`J_{\max 25} /V_{c\max 25}` at 25 :sup:`o`\ C decreases with growth temperature as .. math:: From e3bb7122a6bf1b91e491675f3f11e7afb3fc4045 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Wed, 2 Aug 2017 13:32:49 -0600 Subject: [PATCH 085/730] More edits on photosynthesis, canopy scaling, and numerical implementation sections of photosynthesis chapter --- .../CLM50_Tech_Note_Photosynthesis.rst | 73 ++++++++++--------- .../References/CLM50_Tech_Note_References.rst | 6 ++ 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index b3d512121d..b8e443f10a 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -78,7 +78,8 @@ and can be calculated as g_{1} = {\sqrt{\frac{3\Gamma\lambda}{1.6}}} where :math:`\Gamma` (mol mol\ :sup:`-1`) is the CO\ :sub:`2` compensation point -for photosynthesis without dark respiration and :math:`\lambda` +for photosynthesis without dark respiration, +1.6 is the ratio of diffusivity of CO\ :sub:`2` to H\ :sub:`2` O and :math:`\lambda` (mol H\ :sub:`2` O mol\ :sup:`-1`) is a parameter describing the marginal water cost of carbon gain. The value for :math:`g_{o}=100` :math:`\mu` mol m :sup:`-2` s\ :sup:`-1` for @@ -92,7 +93,7 @@ the :ref:`rst_Plant Hydraulics` chapter. Resistance is converted from units of s m\ :sup:`2` :math:`\mu` mol\ :sup:`-1` to s m\ :sup:`-1` as: 1 s m\ :sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` -:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [same as 4.5, but seems off. check that units are correct] +:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [same as 4.5, but units seem off. check that units are correct] where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` kmol\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). @@ -307,8 +308,12 @@ and f_{H} \left(T_{v} \right)=\frac{1+\exp \left(\frac{298.15\Delta S-\Delta H_{d} }{298.15\times 0.001R_{gas} } \right)}{1+\exp \left(\frac{\Delta ST_{v} -\Delta H_{d} }{0.001R_{gas} T_{v} } \right)} . :numref:`Table Temperature dependence parameters for C3 photosynthesis` -lists parameter values for :math:`\Delta H_{a}` , -:math:`\Delta H_{d}` , and :math:`\Delta S`, from :ref:`Bonan et al. (2011)`. +lists parameter values for :math:`\Delta H_{a}` and +:math:`\Delta H_{d}` . :math:`\Delta S` is calculated +separately for :math:`V_{c\max }` and :math:`J_{max }` +to allow for temperature acclimation of photosynthesis (see equation :eq:`9.16`), +and :math:`\Delta S` is 490 J mol :sup:`-1` K :sup:`-1` for :math:`R_d` +(:ref:`Bonan et al. 2011`, :ref:`Lombardozzi et al. 2015`). Because :math:`T_{p}` as implemented here varies with :math:`V_{c\max }` , :math:`T_{p}` uses the same temperature parameters as :math:`V_{c\max}` . For C\ :sub:`4` plants, @@ -343,28 +348,25 @@ with :math:`Q_{10} =2`. .. table:: Temperature dependence parameters for C3 photosynthesis. - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | :math:`\Delta S` (J mol\ :sup:`-1` K\ :sup:`-1`) | - +========================+=================================================================+=================================================================+==============================================================================================+ - | :math:`V_{c\max }` | 72000 | 200000 | 485 | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`J_{\max }` | 50000 | 152040 | 495 | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`T_{p}` | 72000 | 149250 | 485 | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`R_{d}` | 46390 | 150650 | 490 | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`K_{c}` | 79430 | – | – | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`K_{o}` | 36380 | – | – | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - | :math:`\Gamma _{\*}` | 37830 | – | – | - +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------+ - -[Note: updated the Vcmax :math:`\Delta H_{a}` and :math:`\Delta H_{d}` -and the Jmax :math:`\Delta H_{a}` based on acclimation values. All other values are the same as previous] -The parameters in :numref:`Table Temperature dependence parameters for C3 photosynthesis` -do not allow for temperature acclimation of photosynthesis. In the model, acclimation is + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | Parameter | :math:`\Delta H_{a}` (J mol\ :sup:`-1`) | :math:`\Delta H_{d}` (J mol\ :sup:`-1`) | + +========================+=================================================================+=================================================================+ + | :math:`V_{c\max }` | 72000 | 200000 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`J_{\max }` | 50000 | 200000 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`T_{p}` | 72000 | 200000 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`R_{d}` | 46390 | 150650 | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`K_{c}` | 79430 | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`K_{o}` | 36380 | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + | :math:`\Gamma _{\*}` | 37830 | – | + +------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ + +In the model, acclimation is implemented as in :ref:`Kattge and Knorr (2007) `. In this parameterization, :math:`V_{c\max }` and :math:`J_{\max }` vary with the plant growth temperature. This is achieved by allowing :math:`\Delta S`\ to vary with growth temperature @@ -401,7 +403,7 @@ leaves using an exponential profile to area-based leaf nitrogen as in :ref:`Bonan et al. (2011)`. :math:`V_{c\max 25}` at cumulative leaf area index :math:`x` from the canopy top scales directly with :math:`LNC_{a}` , which decreases exponentially with greater -cumulative leaf area, so that +cumulative leaf area, so that [Verify with Rosie- different based on Vcmax option 0, 3, & 4] .. math:: :label: 9.18 @@ -409,7 +411,7 @@ cumulative leaf area, so that V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} where :math:`V_{c\; \max 25}^{} \left(0\right)` is defined at the top of -the canopy using :math:`SLA_{0}`, whic is the specific leaf area at +the canopy using :math:`SLA_{0}`, which is the specific leaf area at the canopy top and :math:`K_{n}` is the decay coefficient for nitrogen. The canopy integrated value for sunlit and shaded leaves is @@ -438,10 +440,12 @@ and the average value for the sunlit and shaded leaves is This integration is over all leaf area (:math:`L`) with :math:`f_{sun} (x)=\exp \left(-Kx\right)` and :math:`K` the direct beam -extinction coefficient (equation 4.9). Photosynthetic parameters -:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}` , and +extinction coefficient (equation :eq:`4.8` in chapter :numref:`rst_Radiative Fluxes`). Photosynthetic parameters +:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}`, and :math:`R_{d25}` scale similarly. +The model uses :math:`K_{n} =0.30` to match an explicit multi-layer canopy, as in +:ref:`Bonan et al. (2012)`. The value :math:`K_{n} = 0.11` chosen by :ref:`Bonan et al. (2011)` is consistent with observationally-derived estimates for forests, mostly tropical, and provides a gradient in V\ :sub:`cmax` similar to @@ -449,8 +453,7 @@ the original CLM4 specific leaf area scaling. However, :ref:`Bonan et al. (2012)` showed that the sunlit/shaded canopy parameterization does not match an explicit multi-layer canopy parameterization. The discrepancy arises from absorption of scattered radiation by shaded leaves and can -be tuned out with higher :math:`K_{n}` . The model uses -:math:`K_{n} =0.30` to match an explicit multi-layer canopy. +be tuned out with higher :math:`K_{n}`. .. _Numerical implementation photosynthesis: @@ -458,8 +461,8 @@ be tuned out with higher :math:`K_{n}` . The model uses Numerical implementation ---------------------------- -The CO\ :sub:`2` partial pressure at the leaf surface -:math:`c_{s}` (Pa) and the vapor pressure at the leaf surface +The CO\ :sub:`2` partial pressure at the leaf surface, +:math:`c_{s}` (Pa), and the vapor pressure at the leaf surface, :math:`e_{s}` (Pa), needed for the stomatal resistance model in equation :eq:`9.1`, and the internal leaf CO\ :sub:`2` partial pressure :math:`c_{i}` (Pa), needed for the photosynthesis model in equations :eq:`9.3`-:eq:`9.5`, @@ -497,7 +500,7 @@ determined from e_{a} =\frac{P_{atm} q_{s} }{0.622} where :math:`q_{s}` is the specific humidity of canopy air (kg -kg\ :sup:`-1`) (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). +kg\ :sup:`-1`, section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). Equations and are solved for :math:`c_{s}` and :math:`e_{s}` diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 97e221f702..eb5a00c9c8 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1133,6 +1133,12 @@ Lobell, D.B., Bala, G., and Duffy, P.B. 2006. Biogeophysical impacts of cropland management changes on climate. Geophys. Res. Lett. 33:L06708. DOI:10.1029/2005GL025492. +.. _Lombardozzietal2015: + +Lombardozzi, D.L., Bonan, G.B., Smith, N.G., Dukes, J.S. 2015. Temperature +acclimation of photosynthesis and respiration: A key uncertainty in the +carbon cycle-climate feedback. Geophys. Res. Lett. 42:8624-8631. + .. _Lovelandetal2000: Loveland, T.R., Reed, B.C., Brown, J.F., Ohlen, D.O., Zhu, Z., Yang, L., From 1f01fcbd8936d392589748cf4d93e1e694bd14b6 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Wed, 2 Aug 2017 13:54:12 -0600 Subject: [PATCH 086/730] Updated the crop chapter to reflect the new changes in leaf angle distribution --- .../Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 85c284cd89..fb6a180edd 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -363,7 +363,7 @@ Harvest occurs in one time step using the BGC leaf offset algorithm. Harvest: days past planting :math:`\mathrm{\le}`\ 165 :math:`\mathrm{\le}`\ 150 :math:`\mathrm{\le}`\ 150 :math:`\mathrm{\le}`\ 160 :math:`\mathrm{\le}`\ 150 :math:`\mathrm{\le}`\ 300 :math:`\mathrm{\le}`\ 160 :math:`\mathrm{\le}`\ 150 :math:`z_{top}^{\max }` (m) 2.5 1.2 0.75 1.5 1.8 4 2.5 1 SLA (m :sup:`2` leaf g :sup:`-1` C) 0.05 0.035 0.035 0.035 0.035 0.05 0.05 0.035 - :math:`\chi _{L}` index -0.5 0.65 -0.5 -0.5 0.65 -0.5 -0.5 -0.5 + :math:`\chi _{L}` index -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 -0.5 grperc 0.11 0.11 0.11 0.11 0.11 0.11 0.11 0.11 flnr 0.293 0.41 0.41 0.41 0.41 0.293 0.293 0.41 fcur 1 1 1 1 1 1 1 1 From 172db34303856a407a5996159385e0ca26ef8970 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 16 Aug 2017 13:22:53 -0600 Subject: [PATCH 087/730] removed bsoil from fluxes chapter --- doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst | 6 ++---- doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 0ffe6e43f3..04d0a6a83c 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1052,7 +1052,7 @@ where .. math:: :label: 5.103 - E_{soil} = -\rho _{atm} \frac{\beta _{soi} \left(q_{s} -q_{soil} \right)}{r_{aw} ^{{'} } +r_{soil} } + E_{soil} = -\rho _{atm} \frac{\left(q_{s} -q_{soil} \right)}{r_{aw} ^{{'} } +r_{soil} } .. math:: :label: 5.104 @@ -1072,9 +1072,7 @@ at the vegetation temperature (section :numref:`Saturation Vapor Pressure`), :ma of the soil, snow, and surface water (section :numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), :math:`r_{aw} ^{{'} }` is the aerodynamic resistance (s m\ :sup:`-1`) to water vapor transfer between the ground at height -:math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, -:math:`\beta _{soi}` is an empirical function of soil water (section -:numref:`Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces`), +:math:`z_{0w} ^{{'} }` and the canopy air at height :math:`z_{0w} +d`, and :math:`r_{soil}` (:eq:`5.76`) is a resistance to diffusion through the soil (s m\ :sup:`-1`). :math:`r_{total}` is the total resistance to water vapor transfer from the canopy to the canopy air and includes diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst index 24df209f08..b844b4a433 100644 --- a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -53,8 +53,8 @@ and discharges the water to its downstream spatial unit or the ocean. MOSART only route positive runoff, although negative runoff could be generated occasionally by the land model (e.g., :math:`q_{gwl}`). Negative runoff in any runoff component including :math:`q_{sur}`, :math:`q_{sub}`, :math:`q_{gwl}` -is mapped directly from the spatial unit where it is generated at any time step to -the basin outlet of the corresponding spatial unit. +is not routed through MOSART, but instead is mapped directly from the spatial unit +where it is generated at any time step to the coupler. In MOSART, the travel velocities of water across hillslopes, sub-network and main channel are all estimated using the Manning’s equation with different levels of From 24bf0b52d6daa04745dbc235a327c76e39468744 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 18 Aug 2017 10:50:24 -0600 Subject: [PATCH 088/730] Updates to Introduction, very minor updates to BVOCs, and some references added --- .../tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst | 4 +- .../CLM50_Tech_Note_Introduction.rst | 94 +++++++++++-------- .../References/CLM50_Tech_Note_References.rst | 38 +++++++- 3 files changed, 96 insertions(+), 40 deletions(-) diff --git a/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst index 8c5737f171..433f26d97d 100644 --- a/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst +++ b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst @@ -7,7 +7,7 @@ This chapter briefly describes the biogenic volatile organic compound (BVOC) emissions model implemented in CLM. The CLM3 version (Levis et al. 2003; Oleson et al. 2004) was based on Guenther et al. (1995). Heald et al. (2008) updated this scheme in CLM4 based on Guenther et al. -(2006). The current version in CLM4.5 is based on MEGAN2.1 discussed in +(2006). The current version was implemented in CLM4.5 and is based on MEGAN2.1 discussed in detail in Guenther et al. (2012). This update of MEGAN incorporates four main features: expansion to 147 chemical compounds the treatment of the light-dependent fraction (LDF) for each compound inclusion of the @@ -58,6 +58,6 @@ where the LDF activity factor (:math:`\gamma _{P\_ LDF}` ) is specified as a function of PAR as in previous versions of MEGAN. The values for each emission factor :math:`\epsilon _{i,\, j}` are -now available for each of the 15 plant functional types in the CLM and +now available for each of the plant functional types in the CLM and each chemical compound. This information is distributed through an external file, allowing for more frequent and easier updates. diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 31ab7685d8..2c9abf86cc 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -11,12 +11,12 @@ ***Lead Authors*** -**Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu** +**Gordon Bonan, Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu** ***Contributing Authors*** -**Ben Andre, Ali Ashehad, Gautam Bisht, Gordon Bonan, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** +**Ben Andre, Ali Ashehad, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the @@ -176,21 +176,6 @@ Koichi Sakaguchi, Adam Schlosser, Andrew Slater, Reto Stöckli, Ying Sun, Quinn Thomas, Peter Thornton, Mariana Vertenstein, Nicholas Viovy, Aihui Wang, Guiling Wang, Charlie Zender, Xiaodong Zeng, and Xubin Zeng. - - -Current affiliations for the authors are as follows: - -K.W. Oleson, D.M. Lawrence, G.B. Bonan, S.C. Swenson, R. -Fisher, E. Kluzek, P.J. Lawrence, W. Sacks and M. Vertenstein (National Center for Atmospheric Research); B. Drewniak (Argonne -National Laboratory); M. Huang, L.R. Leung (Pacific Northwest National -Laboratory); C.D. Koven, W.J. Riley, and J. Tang (Lawrence Berkeley -National Laboratory); F. Li (Chinese Academy of Sciences); Z.M. Subin -(Princeton University); P.E. Thornton and D.M. Ricciuto (Oak Ridge -National Laboratory); A. Bozbiyik (Bern University); C. Heald -(Massachusetts Institute of Technology), W. Lipscomb (Los Alamos -National Laboratory); Ying Sun and Z.-L. Yang (University of Texas at -Austin) - .. _rst_Introduction: Introduction @@ -520,17 +505,55 @@ Community Earth System Model version 1.2 (CESM1.2). CLM5.0 ^^^^^^^^^^^^ -Developments for CLM5.0 build on the progress made in CLM4.5. Much of the focus of development centered on a -push towards more mechanistic treatment of several key processes, in addition to more comprehensive and explicit representation -of land use and land-cover change. In particular, - -To represent … Stomatal conductance is a function of prognostic (predicted) leaf water potential. LWP is the result of atmospheric demand and supply from soil via resistance network. - -Dynamic land units. - -Included within the codebase of the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, -reference Fisher???). This version of CLM5-FATES that is supported in this release is described here??? Short blurb on what FATES can do??? - +Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been udpated with particularly +notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, +and crop modeling. +Much of the focus of development centered on a +push towards more mechanistic treatment of key processes, in addition to more comprehensive and explicit representation +of land use and land-cover change. Prior versions of CLM included relatively few options for physics parameterizations or structure. +In CLM5, where new parameterizations or model decisions were made, in most cases, the CLM4.5 parameterization was maintained so that users could switch back and forth between different parameterizations via namelist control where appropriate or desirable. Throughout the CLM5 Technical Descpription, in general only the default parameterization for any given process is described. Readers are referred to the CLM4.5 or CLM4 Technical Descriptions for detailed descriptions of non-default parameterizations. + +The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. + +Several changes are included that are mainly targeted at improving the simulation of surface mass balance over ice +sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to +dynamically adjust landunit weights means that a glacier can initiate, grow, shrink, or disappear during +a simulation when two-way coupling is active. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. + +A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. + +Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model (refs???) is adapted for CLM :ref:`(Shi et al., 2016)` to resolve the +unrealistic feature that plants get nitrogen for free in CLM4 and CLM4.5. With FUN, the fact that plants typically spend a +significant fraction of their available carbon on nutrient aquisition is acounted for. The static plant carbon:nitrogen (C:N) ratios utilized in CLM4 and CLM4.5 are replaced with variable plant C:N ratios which +allows plants to adjust their C:N ratio, and therefore their leaf nitrogen content, with the cost of N uptake :ref:`(Ghimire et al. 2016)`. +The implementation of a flexible C:N ratio means that the model no longer relies on instantaneous downregulation +of potential photosynthesis rates based on soil mineral nitrogen availability to represent nutrient limitation. Furthermore, stomatal conductance +is now based on the N-limited photosynthesis rather than on potential photosynthesis. Finally, the Leaf Use of +Nitrogen for Assimilation (LUNA, :ref:`(Xu et al., 2012` and :ref:`Ali et al., 2016)` model is incorporated. The LUNA model calculates +photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that +light capture, carboxylation, and respiration are co-limiting. Allocation changes ... Fixation ??? + +Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. +Fertilization rates and irrigation equipped area updated based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that +vary by latitude for selected crop types, grain C and N is now removed at harvest to a 1-year product pool with +the carbon for the next season's crop seed removed from the grain carbon at harvest. Through the introduction of +the capability to dynamically adjust landunit weights during a simulation, the crop model can now be run coincidentally +with prescribed land use, which significantly expands the capabilities of the model. Mass-based rather than area-based wood harvest is applied. Several heat stress indices for both urban and rural areas are calculated and output by default :ref:`(Buzan et al., 2015)`. A more sophisticated and realistic building space heating and air conditioning submodel that prognoses interior building air temperature and includes more realistic space heating and air conditioning wasteheat factors +is incorporated. + +The fire model is the same as utilized in CLM4.5 except that a modified scheme is used to estimate the dependence of fire occurrence and spread on fuel wetness for non-peat fires outside cropland and tropical closed forests :ref:`Li and Lawrence, 2017)` and the dependence of agricultural fires on fuel load is removed. + +Included with the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, :ref:`Fisher et al., 2015)`. A major motivation of this development is to allow the prediction of biome boundaries directly from plant physiological traits via their competitive interactions. The version of CLM5-FATES that is supported in this release is described here??? Short blurb on what FATES can do??? Note that the classical dynamic global vegetation model (DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. + +During the course of the development of CLM5.0, it became clear that the increasing complexity of the model combined with the increasing number and range +of model development projects required updates to the underlying CLM infrastructure. Many such software improvements +are included in CLM5.0 including a partial transition to an object-oriented modular software structure, extraction of many hard coded model +parameters into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at +specific locations or to conduct parameter sensitivity studies. As part of the effort to increase +the scientific utility of the code, in most instances older generation parameterizations (i.e., the parameterizations +available in CLM4 or CLM4.5) are retained under namelist switches, allowing the user to revert to CLM4.5 +from the same code base or to revert individual parameterizations where the old parameterizations are compatible with the new code. Finally, multiple vertical soil layer structures +are defined and it is relatively easy to add additional structures. Biogeophysical and Biogeochemical Processes ----------------------------------------------- @@ -566,9 +589,8 @@ processes simulated include (:numref:`Figure Land processes`): #. Snow hydrology (snow accumulation and melt, compaction, water transfer between snow layers) (Chapter :numref:`rst_Snow Hydrology`) -#. Stomatal physiology and photosynthesis (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`) - -#. Prognostic photosynthetic capacity (Chapter :numref:`rst_Photosynthetic Capacity`) +#. Stomatal physiology, photosythetic capacity, and photosynthesis (Chapters :numref:`rst_Stomatal Resistance and Photosynthesis` and + :numref:`rst_Photosynthetic Capacity`) #. Plant hydraulics (Chapter :numref: `rst_Plant Hydraulics`) @@ -576,7 +598,7 @@ processes simulated include (:numref:`Figure Land processes`): #. Glacier processes (Chapter :numref:`rst_Glaciers`) -#. Routing of runoff from rivers to ocean (Chapter :numref:`rst_River Transport Model (RTM)`) +#. River routing and river flow (Chapter :numref:`rst_River Transport Model (RTM)`) #. Urban energy balance and climate (Chapter :numref:`rst_Urban Model (CLMU)`) @@ -593,19 +615,17 @@ processes simulated include (:numref:`Figure Land processes`): #. External nitrogen cycling including deposition, denitrification, leaching, and losses due to fire (Chapter :numref:`rst_External Nitrogen Cycle`) -#. Plant mortality (Chapter :numref:`rst_Plant Mortality`) +#. Plant mortality (Chapter :numref:`rst_Plant_Mortality`) #. Fire ignition, suppression, spread, and emissions, including natural, deforestation, and agricultural fire (Chapter :numref:`rst_Fire`) #. Methane production, oxidation, and emissions (Chapter :numref:`rst_Methane Model`) -#. Crop dynamics and irrigation (Chapter :numref:`rst_Crops and Irrigation`) +#. Crop dynamics, irrigation, and fertilization (Chapter :numref:`rst_Crops and Irrigation`) #. Land cover and land use change including wood harvest (Chapter :numref:`rst_Transient Landcover Change`) -#. Dynamic global vegetation distribution (Chapter :numref:`rst_Dynamic Global Vegetation Model`) - #. Biogenic volatile organic compound emissions (Chapter :numref:`rst_Biogenic Volatile Organic Compounds (BVOCs)`) #. Dust mobilization and deposition (Chapter :numref:`rst_Dust Model`) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 97e221f702..f71c59d22d 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -17,6 +17,10 @@ Martin, M.E., Hallett, R.A., and Stoddard, J.L. 2003. Is nitrogen deposition altering the nitrogen status of northeastern forests? BioScience 53:375-389. +.. _Alietal2016: + +Ali, A. A., C. Xu, A. Rogers, R. A. Fisher, S. D. Wullschleger, E. Massoud, J. A. Vrugt, J. D. Muss, N. McDowell, and J. Fisher, 2016: A global scale mechanistic model of photosynthetic capacity (LUNA V1. 0). Geosci. Mod. Dev., 9:587-606. + .. _Allenetal2005: Allen, C.B., Will, R.E., and Jacobson, M.A. 2005. Production efficiency @@ -209,6 +213,10 @@ Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. Brun, E. 1989. Investigation of wet-snow metamorphism in respect of liquid water content. Ann. Glaciol. 13:22-26. +.. _Brunkeetal2016: + +Brunke, M. A., P. Broxton, J. Pelletier, D. Gochis, P. Hazenberg, D. M. Lawrence, L. R. Leung, G.-Y. Niu, P. A. Troch, and X. Zeng, 2016: Implementing and Evaluating Variable Soil Thickness in the Community Land Model, Version 4.5 (CLM4.5). J. Clim. 29:3441-3461. + .. _BugmannSolomon2000: Bugmann, H., and Solomon, A.M. 2000. Explaining forest composition and @@ -319,6 +327,10 @@ Crawford, T. W., Rendig, V. V., and Broadent, F. E. 1982. Sources, fluxes, and sinks of nitrogen during early reproductive growth of maize (Zea mays L.). Plant Physiol. 70:1645-1660. +.. _Dahlinetal2015: + +Dahlin, K., R. Fisher, and P. Lawrence, 2015: Environmental drivers of drought deciduous phenology in the Community Land Model. Biogeosciences, 12:5061-5074. + .. _DaiZeng1997: Dai, Y., and Zeng, Q. 1997. A land surface model (IAP94) for climate @@ -471,6 +483,10 @@ Firestone, M.K. and Davidson, E.A. 1989. Exchange of Trace Gases between Terrestrial Ecosystems and the Atmosphere. In: M.O. Andreae and D.S. Schimel (Editors). John Wiley and Sons, pp. 7-21. +.. _Fisheretal2015: + +Fisher, R. A., S. Muszala, M. Verteinstein, P. Lawrence, C. Xu, N. G. McDowell, R. G. Knox, C. Koven, J. Holm, B. M. Rogers, A. Spessa, D. Lawrence, and G. Bonan, 2015: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED). Geosci. Model Dev., 8: 3593-3619, doi:10.5194/gmd-8-3593-2015. + .. _FlannerZender2005: Flanner, M.G., and Zender. C.S. 2005. Snowpack radiative heating: @@ -547,7 +563,11 @@ Climate. John Wiley and Sons, Chichester, England. Getirana, A. C. V., A. Boone, D. Yamazaki, B. Decharme, F. Papa, and N. Mognard. 2012. The hydrological modeling and analysis platform -(HyMAP): Evaluation in the Amazon basin, J. Hydrometeorol., 13, 1641–1665. +(HyMAP): Evaluation in the Amazon basin, J. Hydrometeorol., 13, 1641-1665. + +.. _Ghimireetal2016: + +Ghimire, B., W. J. Riley, C. D. Koven, M. Mu, and J. T. Randerson, 2016: Representing leaf and root physiological traits in CLM improves global carbon and nitrogen cycling predictions. J. Adv. Mod. Earth Sys. 8: 598-613. .. _Gholzetal1985: @@ -1448,6 +1468,10 @@ from soils. J. Geophys. Res. 106(D15):17403-17419. Paterson, W.S.B., 1994. The Physics of Glaciers. Elsevier Science Inc., New York, 480 pp. +.. _Pelletieretal2016: + +Pelletier, J. D., P. D. Broxton, P. Hazenberg, X. Zeng, P. A. Troch, G. Y. Niu, Z. Williams, M. A. Brunke, and D. Gochis, 2016: A gridded global data set of soil, intact regolith, and sedimentary deposit thicknesses for regional and global land surface modeling. J. Adv. Mod. Earth Sys. 8:41-65. + .. _Petrescuetal2010: Petrescu, A.M.R. et al. 2010. Modeling regional to global CH4 emissions @@ -1564,6 +1588,10 @@ Meeting, Boulder, CO. Roesch, A., M. Wild, H. Gilgen, and A. Ohmura. 2001. A new snow cover fraction parametrization for the ECHAM4 GCM, Clim. Dyn., 17:933–946. +.. _Rogersetal2017: + +Rogers, A., B. E. Medlyn, J. S. Dukes, G. Bonan, S. Caemmerer, M. C. Dietze, J. Kattge, A. D. Leakey, L. M. Mercado, and U. Niinemets, 2017: A roadmap for improving the representation of photosynthesis in Earth system models. New Phytologist, 213:22-42. + .. _Ryan1991: Ryan, M. G. 1991. A simple method for estimating gross carbon budgets @@ -1682,6 +1710,10 @@ patterns of evapotranspiration in response to multiple environmental factors simulated by the Community Land Model. Environ. Res. Lett. 8:024012. +.. _Shietal2016: + +Shi, M., J. B. Fisher, E. R. Brzostek, and R. P. Phillips, 2016: Carbon cost of plant nitrogen acquisition: global carbon cycle impact from an improved plant nitrogen cycle in the Community Land Model. Glob. Change Biol., 22:1299-1314. + .. _Shiklomanov2000: Shiklomanov, I.A. 2000. Appraisal and assessment of world water @@ -2091,6 +2123,10 @@ Wu, H., J. S. Kimball, H. Li, M. Huang, L. R. Leung, and R. F. Adler (2012), A New Global River Network Database for Macroscale Hydrologic modeling, Water Resour. Res., 48, W09701, doi:10.1029/2012WR012313. +.. _Xuetal2012: + +Xu, C., R. Fisher, S. D. Wullschleger, C. J. Wilson, M. Cai, and N. G. McDowell, 2012: Toward a mechanistic modeling of nitrogen limitation on vegetation dynamics. PloS one, 7:e37914. + .. _Yang1998: Yang, Z.-L. 1998. Technical note of a 10-layer soil moisture and From 4a563c250a28559a3f39b29fffe53985c6408cff Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Wed, 23 Aug 2017 15:51:19 -0600 Subject: [PATCH 089/730] PJL Updated the Transient Landcover Chapter --- .../CLM50_Tech_Note_Transient_Landcover.rst | 441 +++++++----------- 1 file changed, 180 insertions(+), 261 deletions(-) diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index e6f40c34ef..16aaa120a8 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -1,71 +1,76 @@ .. _rst_Transient Landcover Change: -Transient Landcover Change -============================== +Transient Land Use and Land Cover Change +=========================================== CLM includes a treatment of mass and energy fluxes associated with -prescribed temporal change in land cover. Using an annual time series of -the spatial distribution of PFTs and wood harvest, CLM diagnoses the -change in area for PFTs at each model time step and then performs mass -and energy balance accounting necessary to represent the expansion and -contraction of PFT area. This implementation currently only pertains to -the case where all PFTs for a particular grid cell coexist on a single -soil/snow column. In this case, the only biogeophysical state variable -affected is canopy water (:math:`W_{can}` ). The biogeochemical impacts -of land use and land cover change are simulated through changes in CLM -carbon pools and fluxes as shown in Figure 21.1 and described further in -Chapter 13. Other implementations are possible, such as changing the -area of soil/snow columns or land unit area, however these require -additional consideration of conservation of mass and energy among the -soil/snow columns and land units which will be implemented in future -versions of CLM. - -Annual Transient Land Cover Data and Time Interpolation ------------------------------------------------------------- - -The changes in area over time associated with individual PFTs are -prescribed through a forcing dataset, referred to here as the *dynpft* -dataset. The *dynpft* dataset consists of an annual time series of -global grids, where each annual time slice describes the fractional area -occupied by all PFTs and the annual wood harvest within each grid cell. -Changes in area and wood harvest for each PFT within a grid cell at each -model time step are inferred from a time-interpolation of the area -information for the PFT from the two bracketing annual time slices in -the *dynpft* dataset. - -As a special case, when the time dimension of the *dynpft* dataset +prescribed temporal land use and land cover change (LULCC). The model uses an annual +time series of the spatial distribution of the natural and crop land units +of each grid cell, in combination with the distribution of PFTs and CFTs +that exist in those land units. Additional land use is prescribed through annual +crop specific management of nitrogen fertilizer and irrigation described further +in Chapter 25, and through wood harvest on tree PFTs. For changes in the distributions +of natural and crop vegetation CLM diagnoses the change in area of the PFTs and CFTs +on January 1st of each model year and then performs mass and energy balance accounting +necessary to represent the expansion and contraction of the PFT and CFT areas. The +biogeophysical impacts of LULCC are simulated through changes +in surface properties which in turn impact the surface albedo, hydrology, and roughness +which then impact fluxes of energy, moisture and momentum to the atmosphere under the +altered properties. Additionally changes in energy and moisture associated with changes +in the natural and crop vegetation distribution are accounted for through small +fluxes to the atmosphere. The biogeochemical impacts of LULCC +are simulated through changes in CLM carbon pools and fluxes as shown in Figure xx.x and +described further in Chapter 16. + +Annual Transient Land Use and Land Cover Data and Time Interpolation +----------------------------------------------------------------------- + +The changes in area over time associated with changes in natural and crop +vegetation and the land use on that vegetation are prescribed through a forcing dataset, +referred to here as the *landuse.timeseries* dataset. The *landuse.timeseries* dataset +consists of an annual time series of global grids, where each annual time slice describes +the fractional area occupied by all PFTs and CFTs along with the nitrogen fertilizer and +irrigation fraction of each crop CFT, and the annual wood harvest applied to tree PFTs. +Changes in area of PFTs and CFTs are performed annually on the first time step of January +1st of the year. Fertilizer application, irrigation and wood harvest for each PFT and CFT +are performed at each model time step depending on rules from the crop and natural vegetation +phenology models. The irrigation fraction is set annually however fertlizer application and +wood harvest are set from a time-interpolation of the application rates from the two bracketing +annual time slices in the *landuse.timeseries* dataset. + +As a special case, when the time dimension of the *landuse.timeseries* dataset starts at a later year than the current model time step, the first time -slice from the *dynpft* dataset is used to represent the current time -step PFT fractional area distributions. Similarly, when the time -dimension of the *dynpft* dataset stops at an earlier year than the -current model time step, the last time slice of the *dynpft* dataset is -used. Thus, the simulation will have invariant representations of PFT +slice from the *landuse.timeseries* dataset is used to represent the current time +step PFT and CFT fractional area distributions. Similarly, when the time +dimension of the *landuse.timeseries* dataset stops at an earlier year than the +current model time step, the last time slice of the *landuse.timeseries* dataset is +used. Thus, the simulation will have invariant representations of PFT and CFT distributions through time for the periods prior to and following the -time duration of the *dynpft* dataset, with transient PFT distributions -during the period covered by the *dynpft* dataset. +time duration of the *landuse.timeseries* dataset, with transient PFT and CFT distributions +during the period covered by the *landuse.timeseries* dataset. The following equations capture this logic, where :math:`year_{cur}` is the calendar year for the current timestep, -:math:`dynpft\_ year\eqref{GrindEQ__1_}` and -:math:`dynpft\_ year(nyears)`\ are the first and last calendar years in -the *dynpft* dataset, respectively, :math:`nyears` is the number of -years in the *dynpft* dataset, :math:`nt_{1}` and :math:`nt_{2}` +:math:`landuse.timeseries\_ year(1)` and +:math:`landuse.timeseries\_ year(nyears)` are the first and last calendar years in +the *landuse.timeseries* dataset, respectively, :math:`nyears` is the number of +years in the *landuse.timeseries* dataset, :math:`nt_{1}` and :math:`nt_{2}` :math:`{}_{ }`\ are the two bracketing years used in the interpolation algorithm, and :math:`n` is the index value for the -:math:`dynpft\_ year` array corresponding to -:math:`dynpft\_ year(n)=year_{cur}` : +:math:`landuse.timeseries\_ year` array corresponding to +:math:`landuse.timeseries\_ year(n)=year_{cur}` : .. math:: :label: 26.1) - nt_{1} =\left\{\begin{array}{l} {1\qquad {\rm for}\qquad year_{cur} 0` and decreases for :math:`\Delta w_{p} <0`. Mass and Energy Conservation --------------------------------- -Mass conservation is maintained across a PFT weight transition by -summing up all the water state variables to get the total vegetated land -unit water content before (:math:`W_{tot,1}` ) and after -(:math:`W_{tot,2}` ) new PFT weights are calculated. For example, +Mass conservation is maintained across PFT and CFT weight transitions by +summing up all the carbon, nitrogen, water and energy state variables to get the total vegetated land +units value before (:math:`W_{tot,1}` ) and after +(:math:`W_{tot,2}` ) the new PFT and CFT weights are calculated. Transitions are performed on above ground +variables first and then at the land unit level for below ground variables second. For example the hydrological +balance is calculated, :math:`W_{tot,1}` is .. math:: @@ -125,12 +132,11 @@ unit water content before (:math:`W_{tot,1}` ) and after where :math:`W_{a}` is the aquifer water, :math:`W_{sno}` is the snow water, :math:`w_{liq,i}` and :math:`w_{ice,i}` \ are the liquid and ice soil water contents, :math:`W_{can,j}` \ is the canopy water content for -PFT :math:`j`, and :math:`wt_{j,1}` is the PFT weight for PFT -:math:`j`. For the situation where only PFT weights are changing and all -other land unit fractions are constant, any difference between -:math:`W_{tot,1}` and :math:`W_{tot,2}` \ can only be due to -differences in the total canopy water before and after the PFT weight -change. To ensure water conservation, the typically very small +PFT and CFT :math:`j`, and :math:`wt_{j,1}` is the PFT or CFT weight for +:math:`j`. For the situation where PFT and CFT weights are changing, any difference +between :math:`W_{tot,1}` and :math:`W_{tot,2}` \ are due to +differences in the total canopy water before and after the PFT and CFT weight +change. To ensure conservation, the typically very small difference between :math:`W_{tot,2}` \ and :math:`W_{tot,1}` is subtracted from the grid cell runoff @@ -140,210 +146,117 @@ subtracted from the grid cell runoff R_{liq} =R_{liq} +W_{tot,2} -W_{tot,1} . Total energy is unperturbed in this case and therefore an energy -conservation treatment is not required. As noted above, other -implementations are possible and will be desirable in the future, such -as changing the area of soil/snow columns or land unit area, for example -in a situation in which crops are implemented on a separate soil column. -These would require additional consideration of conservation of mass and -energy among the soil/snow columns and land units. +conservation treatment is not required. Changing the area of natural and crop land units +in association with the change in PFTs and CFTs results in changes in the soil/snow columns +and land unit area. To address these additional changes, conservation of mass and +energy among the soil/snow columns and land units is performed as a secondary calculation once +all above ground PFT and CFT changes have been done. Annual Transient Land Cover Dataset Development ---------------------------------------------------- -This section describes the development of the d\ *ynpft* dataset. -Development of this dataset requires adapting for use with the CLM a -harmonized dataset of land cover change for the historical period and -for different representations of the scenario period. +This section describes the development of the *landuse.timeseries* dataset. +Development of this dataset involves the translation of +harmonized datasets of LULCC for the historical period and +for the different Shared Socioeconomic Pathway (SSP) - Representative +Concentration Pathway (RCP) scenarios. Additionally, LULCC time +series are to be generated for the Last Millennium and the extension beyond 2100 experiments +of CMIP6. -21.3.1 UNH Transient Land Use and Land Cover Change Dataset +LUH2 Transient Land Use and Land Cover Change Dataset ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -To coordinate the processing and consistency of land use and land cover -change data between the historical period (1850-2005) and the four IPCC -representative concentration pathways (RCPs) derived from integrated -assessment models (IAM), the University of New Hampshire -(stocktickerUNH) research group (Louise Chini, George Hurtt, Steve -Frolking; luh.unh.edu) produced a harmonized transient dataset for use -in climate change simulations. The historical component of the transient -land use and land cover change dataset is Version 1 of the Land-Use -History A product (LUHa.v1) covering the period 1850-2005. The RCP -transient land use and land cover change components (2005-2100) are -referred to as the Future Land-Use Harmonization A products. Version 1 -(LUHa.v1\_future.v1) is used for the AIM, MESSAGE, and MiniCAM IAMs; -Version 1.1 (LUHa.v1\_future.v1.1) is used for the IMAGE IAM. The land -cover information is provided at 0.5 degree grid resolution and includes -fractional grid cell coverage by crops, pasture, and primary and -secondary natural vegetation. - -The crop fraction of the grid cell represents the area of the grid cell -used to grow any type of crop. Similarly, pasture represents the -fraction of a grid cell used for grazing livestock. The remaining area -in a half degree grid cell is partitioned into primary and secondary -vegetation. Primary vegetation represents the fractional area of a grid -cell with vegetation undisturbed by human activities. Secondary -vegetation represents vegetated areas that have recovered from some -human disturbance; this could include re-vegetation of pasture and crop -areas as well as primary vegetation areas that have been logged. - -The stocktickerUNH dataset provides a transition matrix that describes -the annual fraction of land that is transformed from one category to -another (e.g. primary land to crop, pasture to crop, etc.; Hurtt et al. -2006). Included in these transitions is the conversion of secondary land -to secondary land, representing the logging on land recovering from an -earlier disturbance. These transitions provide information on all -changes in land cover through the sum of all transitions in a given -year. Harmonized prescriptions of CMIP5 wood harvest statistics also are -provided by (Hurtt et al. 2011) for the historical and RCP time series. -The wood harvest is prescribed spatially on the same 0.5 degree grid as -the land use class transitions for each year. - -To ensure consistency with the various land use classes wood harvest is -prescribed as both the area of land harvested and the amount of carbon -extracted in the grid cell for a particular year. To account for the -differences in standing amount of wood carbon as well as the differences -in harvest intensity associated with the different land units, the -harvest area and carbon amounts are prescribed for the five classes of: -PlaceNamePrimary PlaceTypeForest, PlaceNamePrimary PlaceTypeNon-Forest, -PlaceNameSecondary PlaceNameMature PlaceTypeForest, PlaceNameSecondary -PlaceNameYoung PlaceTypeForest, and PlaceNameplaceSecondary -PlaceTypeNon-Forest. - -21.3.2 Representing Land Use and Land Cover Change in CLM -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -CLM represents the land surface as a hierarchy of sub-grid types: -glacier; lake; wetland; urban; and vegetated land. The vegetated land is -further divided into a mosaic of PFTs. To represent the UNH transient -land use and land cover change dataset in CLM, the annual fractional -composition of crop, pasture, primary vegetation, and secondary -vegetation land units specified in the UNH dataset needs to be -faithfully represented with a corresponding PFT mosaic in CLM using the -methods described in Lawrence et al (2012). This method translated each -of the UNH land units into fractional PFT values based on current day -and potential vegetation CLM land surface parameters for that grid cell -and for that year, as shown in Figure 21.2. - -The methodology for creating the transient PFT dataset is based on four -steps which are applied across the time series. First, crop PFT -composition is directly specified from the crop land unit fractional -area. Second, pasture PFTs are assigned based on grass PFTs found in the -potential vegetation and current day CLM land surface parameters scaled -by the area of pasture. Third, potential vegetation PFTs are assigned to -the grid cell scaled by the fractional area of the primary land unit. -Last, current day non-crop and non-pasture PFTs are assigned to the grid -cell scaled by the fractional area of the secondary land unit. The -annual tree harvest values also are calculated from the harvest -information of the UNH dataset used in conjunction with transient tree -PFT values. Separate datasets representing the extent of water, wetland, -ice and urban land cover are used to compile the final land cover -present in each CLM grid cell. These additional non-vegetated land cover -fractions are held constant throughout the time series. All datasets are -resolved at the half degree grid resolution. - -21.3.3 Present Day PFT Dataset -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The present day dataset is based on the methodology of Lawrence and -Chase (2007) and uses a variety of satellite products to develop present -day PFT distributions with matching leaf area index values. The dataset -initially derives fractions of bare ground and tree cover from the -Moderate Resolution Imaging Spectroradiometer (MODIS) vegetation -continuous fields product (Hansen et al. 2003). To further distinguish -tree types, the tree fraction is divided into broadleaf/needleleaf and -evergreen/deciduous types based on the Advanced Very High Resolution -Radiometer (AVHRR) continuous fields tree cover (DeFries et al. 2000). -The remaining grid cell area is assumed to be herbaceous grasses and -shrubs, including crops. The area of crop is initially determined from -Ramankutty et al. (2008) circa 2000 global crop land areas, and the -remaining grass and shrub fractions are derived from the MODIS land -cover (Friedl et al. 2002). Further subdivisions of grass, shrub and -tree PFTs into tropical, temperate and boreal types were based on the -physiology and climate rules from Nemani and Running (1996), and for -C3/C4 photosynthetic pathways based on MODIS derived leaf area index -values and the mapping methods of Still et al. (2003). In contrast to -Lawrence and Chase (2007), the understory grasses of forested areas have -been replaced with trees for the dataset. Some advantages of this -dataset are that it reproduces the physical properties as observed by -the MODIS land surface data (e.g. grid cell albedo and leaf area index -values) while maintaining the multiple PFT representation. - -21.3.4 Potential PFT Distribution -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Essential to any reconstruction of past vegetation distributions is the -need to know the potential vegetation that would be there prior to human -activities. Many researchers have worked to estimate potential -vegetation types at regional and global scales from remnant vegetation -and other field data or from bioclimatic models. The CLM potential PFT -distribution is derived from Ramankutty et al. (2008) at 5 arc-minute -resolution. However, this product is based on a biome type -classification system that is not directly compatible with the CLM PFT -distributions. - -The CLM potential vegetation is described by Lawrence and Chase (2010). -This reconstruction describes potential PFT distributions extrapolated -from the current day PFT composition of remnant natural biomes as mapped -by Ramankutty et al. (2008). The current day remnant natural PFT -parameters were taken from the Lawrence and Chase (2007) dataset with -the same forest understory changes as described above to ensure -consistency between the two datasets. The current day remnant natural -PFT biome compositions were spatially extrapolated to the potential -vegetation biome distributions provided by Ramankutty et al. (2008) -using inverse distance weighted methods. The resulting product is a CLM -PFT distribution that may have existed prior to human disturbance under -current day climate conditions. - -21.3.5 Transient Land Cover Change Dataset -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -For each year from 1850 to 2005 and to 2100 for each of the four RCPs, -PFT distributions and wood harvest are adjusted based on the -stocktickerUNH dataset. Initially the grid cell is checked to adjust the -crop area based on the stocktickerUNH crop area. If the crop area -exceeds the available land area (i.e. the grid cell area minus the area -assigned to glacier, wetlands, lake and urban areas) then all the -available area is allocated to crops and no other PFTs are added. After -the crop area is assigned, any remaining area is considered available -for pasture. - -As the pasture data from the stocktickerUNH dataset represents grazing, -pasture areas are assigned in the present day based on the availability -of grasses (C3, C4 and boreal C3 PFTs) and shrubs relative to the bare -soil fraction. If the grazing area exceeds the total vegetated area from -both the potential and current day PFT data, then the grazed area is -limited to the larger of the potential or current day vegetated area. -This is done to prevent representing sparsely vegetated grazing areas as -100% vegetated pastures. Once the grazing area is less than or equal to -the total vegetated area, then grazing areas are assigned to the C3 and -C4 grass areas based on their potential vegetation and current day -fractions. In areas where the grazing area cannot be met through the -current day or potential vegetation grass fraction alone, the current -day tree PFTs are converted to grass PFTs, with the remaining shrub PFTs -included as being grazed. - -Once crop and pasture areas are assigned to a grid cell, the remaining -area is assigned to primary and secondary natural vegetation. Primary -vegetation is assumed to be undisturbed and reflects the potential -vegetation PFT distributions. In the secondary region, the PFT -distributions are based on the current day non-crop and non-pasture PFTs -in the grid cell. This process ensures that the PFT distributions are -kept consistent with the original current day and potential vegetation -CLM parameters, while remaining faithful to the stocktickerUNH assigned -areas. - -Forest Harvest Dataset Changes -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Discussions following the initial analysis of CCSM4 land cover change -experiments found there were very high wood harvest areas compared to -wood harvest carbon in the RCP 6.0 and RCP 8.5 time series. The high -wood harvest areas were traced to using gridded spatially explicit wood -harvest targets from the MESSAGE and AIM groups for these two time -series, rather than using regional targets with spatial downscaling in -GLM as done with the other three time periods. As a result of these -discussions new amended wood harvest targets were generated with -regional targets through GLM for the RCP 6.0 and RCP 8.5 time series as -described in Lawrence et al. (2012). +To coordinate the processing and consistency of LULCC data between +the historical period (1850-2015) and the six +SSP-RCP (2016-2100) scenarios derived from Integrated +Assessment Models (IAM), the University of Maryland and the University of New Hampshire +research groups (Louise Chini, George Hurtt, Steve +Frolking and Ritvik Sahajpal; luh.umd.edu) produced a new version of the Land Use Harmonized version 2 +(LUH2) transient datasets for use with Earth System Model simulations. The new data sets +are the product of the Land Use Model Intercomparison Project (LUMIP; https://cmip.ucar.edu/lumip) +as part of the Coupled Model Intercomparison Project 6 (CMIP6). The historical component of the +transient LULCC dataset has agriculture and urban +land use based on HYDE 3.2 with wood harvest based on FAO, Landsat and other sources, for the period 850-2015. +The SSP-RCP transient LULCC components (2015-2100) are +referred to as the LUH2 Future Scenario datasets. The LULCC information is provided at 0.25 degree grid resolution and includes +fractional grid cell coverage by the 12 land units of: + +Primary Forest, Secondary Forest, Primary Non-Forest, Secondary Non-Forest, + +Pasture, Rangeland, Urban, + +C3 Annual Crop, C4 Annual Crop, C3 Perennial Crop, C4 Perennial Crop, and C3 Nitrogen Fixing Crop. + +The new land unit format is an improvement on the CMIP5 LULCC +datasets as they: provide Forest and Non Forest information in combination with Primary and Secondary +land; differentiate between Pasture and Rangelands for grazing livestock; and specify annual details +on the types of Crops grown and management practices applied in each grid cell. Like the CMIP5 LULCC datasets Primary vegetation +represents the fractional area of a grid cell with vegetation undisturbed by human activities. Secondary +vegetation represents vegetated areas that have recovered from some human disturbance; this could include +re-vegetation of pasture and crop areas as well as primary vegetation areas that have been logged. +In this manner the land units can change through deforestation from Forested to Non Forested land and in the +opposite direction from Non Forested to Forested land through reforestation or afforestation without going +through the Crop, Pasture or Rangeland states. + +The LUH2 dataset provides a time series of land cover states as well as a transition matrices that describes +the annual fraction of land that is transformed from one land unit category to +another (e.g. Primary Forest to C3 Annual Crop, Pasture to C3 Perrenial Crop, etc.; Lawrence et al. +2016). Included in these transition matrices is the total conversion of one land cover type to another referred to +as Gross LULCC. This value can be larger than the sum of the changes in the state of a land unit from one time period +to the next known as the Net LULCC. This difference is possible as land unit changes can occur both from the land unit +and to the land unit at the same time. An example of this difference occurs with shifting cultivation where Secondary Forest +can be converted to C3 Annual Crop at the same time as C3 Annual Crop is abandoned to Secondary Forest. + +The transition matrices also provide harmonized prescriptions of wood harvest both in area of the grid cell harvested +and in the amount of biomass carbon harvested. The wood harvest biomass amount includes a 30% slash component inline with +the CMIP5 LULCC data described in (Hurtt et al. 2011). The harvest area and carbon amounts are prescribed for the five classes of: +Primary Forest, Primary Non-Forest, +Secondary Mature Forest, Secondary +Young Forest, and Secondary +Non-Forest. + +Additional land use management is prescribed on the Crop land units for +nitrogen fertilization and irrigation equipped land. The fertilizer application and the the irrigation fraction is +prescribed for each Crop land unit in a grid cell individually for each year of the time series. The wood harvest +and crop management are both prescribed spatially on the same 0.25 degree grid as the land use class transitions. + +Representing LUH2 Land Use and Land Cover Change in CLM5 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To represent the LUH2 transient LULCC dataset in CLM5, the annual fractional +composition of the twelve land units specified in the dataset needs to be +faithfully represented with a corresponding PFT and CFT mosaics of CLM. +CLM5 represents the land surface as a hierarchy of sub-grid types: +glacier; lake; wetland; urban; vegetated land; and crop land. The vegetated land is +further divided into a mosaic of Plant Functional Types (PFTs), while the crop land +is divided into a mosaic of Crop Functional Types (CFTs). + +To support this translation task the CLM5 Land Use Data tool has been built that extends the +methods described in Lawrence et al (2012) to include all the new functionality of CMIP6 and CLM5 LULCC. +The tool translates each of the LUH2 land units for a given year into fractional PFT and CFT values based on +the current day CLM5 data for the land unit in that grid cell. The current day land unit descriptions are generated from +from 1km resolution MODIS, MIRCA2000, ICESAT, AVHRR, SRTM, and CRU climate data products combined with reference year +LUH2 land unit data, usually set to 2005. Where the land unit does not exist in a grid cell for the current +day, the land unit description is generated from nearest neighbors with an inverse distance weighted search +algorithm. + +The Land Use Data tool produces raw vegetation, crop, and management data files which are combined with +other raw land surface data to produce the CLM5 initial surface dataset and the dynamic +*landuse.timeseries* dataset with the CLM5 mksurfdata_map tool. The schematic of this entire process from +LUH2 time series and high resolution current day data to the output of CLM5 surface datasets from the +mksurfdata_map tool is shown in Figure 21.2. + +The methodology for creating the CLM5 transient PFT and CFT dataset is based on four +steps which are applied across all of the historical and future time series. +The first step involves generating the current day descriptions of natural and managed vegetation PFTs at +1km resolution from the global source datasets, and the current day description of crop CFTs at the 10km resolution +from the MIRCA 2000 datasets. The second step combines the current day (2005) LUH2 land units with the current +day CLM5 PFT and CFT distributions to get CLM5 land unit descriptions in either PFTs or CFTs at the LUH2 resolution of +0.25 degrees. The third step involves combining the LUH2 land unit time series with the CLM5 PFT and CFT descriptions +for that land unit to generate the CLM5 raw PFT and CFT time series in the *landuse.timeseries* file. At this point in the process +management information in terms of fertilizer, irrigation and wood harvest are added to the CLM5 PFT and CFT data +to complete the CLM5 raw PFT and CFT files. The final step is to combine these files with the other raw CLM5 surface +data files in the mksurfdata_map tool. .. _Figure Schematic of land cover change: @@ -351,8 +264,14 @@ described in Lawrence et al. (2012). Schematic of land cover change impacts on CLM carbon pools and fluxes. -.. _Figure Schematic of translation of annual UNH land units: +.. _Figure Schematic of translation of annual LUH2 land units: .. figure:: image2.png - Schematic of translation of annual UNH land units to CLM4 plant functional types. + Schematic of translation of annual LUH2 land units to CLM5 plant and crop functional types. + + .. _Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool + +.. figure :: image3.png + + Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool From b8ca1aa0a5a26f6f570c2afeada0a8c169e3c0e4 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 23 Aug 2017 16:23:57 -0600 Subject: [PATCH 090/730] Updates to BVOC and methane (finundated) chapters --- .../tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst | 10 +++---- .../Methane/CLM50_Tech_Note_Methane.rst | 26 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst index 433f26d97d..e7e8637649 100644 --- a/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst +++ b/doc/source/tech_note/BVOCs/CLM50_Tech_Note_BVOCs.rst @@ -9,17 +9,17 @@ al. 2003; Oleson et al. 2004) was based on Guenther et al. (1995). Heald et al. (2008) updated this scheme in CLM4 based on Guenther et al. (2006). The current version was implemented in CLM4.5 and is based on MEGAN2.1 discussed in detail in Guenther et al. (2012). This update of MEGAN incorporates four -main features: expansion to 147 chemical compounds the treatment of the -light-dependent fraction (LDF) for each compound inclusion of the +main features: 1) expansion to 147 chemical compounds, 2) the treatment of the +light-dependent fraction (LDF) for each compound, 3) inclusion of the inhibition of isoprene emission by atmospheric CO\ :sub:`2` and -emission factors mapped to the specific PFTs of the CLM. +4) emission factors mapped to the specific PFTs of the CLM. MEGAN2.1 now describes the emissions of speciated monoterpenes, -sesquiterpenes, oxygenated VOC as well as isoprene. A flexible scheme +sesquiterpenes, oxygenated VOCs as well as isoprene. A flexible scheme has been implemented in the CLM to specify a subset of emissions. This allows for additional flexibility in grouping chemical compounds to form the lumped species frequently used in atmospheric chemistry. The mapping -or grouping are therefore defined through a namelist parameter in +or grouping is therefore defined through a namelist parameter in drv\_flds\_in, e.g. megan\_specifier = ’ISOP = isoprene’, ’BIGALK = pentane + hexane + heptane + tricyclene’. diff --git a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst index f78f464779..7c89f857e3 100644 --- a/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst +++ b/doc/source/tech_note/Methane/CLM50_Tech_Note_Methane.rst @@ -297,14 +297,12 @@ calculated with Henry’s law as described in equation . Based on the ranges reported in :ref:`Colmer (2003)`, we have chosen baseline aerenchyma porosity values of 0.3 for grass and crop PFTs and 0.1 for -tree and shrub PFTs. The aerenchyma area varies over the course of the -growing season; we parameterize this dependency using the simulated leaf -area index *L* (m:sup:`2` m\ :sup:`-2`), as in :ref:`Wania et al. 2010`: +tree and shrub PFTs: .. math:: :label: 24.9 - T=\frac{f_{N} N_{a} L}{0.22} \pi R^{2} . + T=\frac{4 f_{N} N_{a}}{0.22} \pi R^{2} . Here :math:`N_{a}` is annual net primary production (NPP, mol m\ :sup:`-2` s\ :sup:`-1`); *R* is the aerenchyma radius @@ -600,8 +598,8 @@ and the soil element below the interface: Inundated Fraction Prediction ---------------------------------- -We developed a simplified dynamic representation of spatial inundation -based on recent work by :ref:`Prigent et al. (2007)`, who described a +A simplified dynamic representation of spatial inundation +based on recent work by :ref:`Prigent et al. (2007)` is used. Prigent et al. (2007) described a multi-satellite approach to estimate the global monthly inundated fraction (:math:`{F}_{i}`) over an equal area grid (0.25 :math:`\circ` \ :math:`\times`\ 0.25\ :math:`\circ` at the equator) @@ -610,20 +608,20 @@ could be used as a measure of sensitivity of their detection approach at low inundation. We therefore used the sum of their satellite-derived :math:`{F}_{i}` and the constant IGBP estimate when it was less than 10% to perform a simple inversion for the inundated fraction for methane -production (:math:`{f}_{s}`). The method optimized three parameters -(:math:`{p}_{1}`, *p*\ :sub:`2`, :math:`{p}_{3}`) for each -grid cell in a simple model based on simulated water table depth -(:math:`{z}_{w}`) and surface runoff (:math:`{Q}_{r}` (mm s\ :sup:`-1`)): +production (:math:`{f}_{s}`). The method optimized two parameters +(:math:`{fws}_{slope}` and :math:`{fws}_{intercept}`) for each +grid cell in a simple model based on simulated total water storage +(:math:`{TWS}`): .. math:: :label: 24.20 - f_{s} =P_{1} e^{{\raise0.7ex\hbox{$ -z_{w} $}\!\mathord{\left/ {\vphantom {-z_{w} p_{2} }} \right. \kern-\nulldelimiterspace}\!\lower0.7ex\hbox{$ p_{2} $}} } +p_{3} Q_{r} . + f_{s} =fws_{slope} TWS + fws_{intercept} . These parameters were evaluated at the 0.5\ :sup:`o` resolution, and aggregated for -coarser simulations. We expect that ongoing work in the hydrology -submodel of CLM will alleviate the need for this crude simplification of +coarser simulations. Ongoing work in the hydrology +submodel of CLM may alleviate the need for this crude simplification of inundated fraction in future model versions. .. _Seasonal Inundation: @@ -631,7 +629,7 @@ inundated fraction in future model versions. Seasonal Inundation ------------------------ -We have developed a simplified scaling factor to mimic the impact of +A simple scaling factor is used to mimic the impact of seasonal inundation on CH\ :sub:`4` production (see appendix B in :ref:`Riley et al. (2011a)` for a discussion of this simplified expression): From 34c574ca24b53b29197c78c4656b5a5fb007192c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 24 Aug 2017 10:45:15 -0600 Subject: [PATCH 091/730] Update pft optical properties --- .../CLM50_Tech_Note_Surface_Albedos.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index f16a46ec97..2548b228fa 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -471,19 +471,19 @@ intercepted snow (:numref:`Table Intercepted snow optical properties`) are from +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ | Temp Corn | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Spring Wheat | 0.65 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | + | Spring Wheat | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ | Temp Soybean | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Cotton | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | + | Cotton | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Rice | 0.65 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | + | Rice | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Sugarcane | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | + | Sugarcane | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Tropical Corn | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | + | Tropical Corn | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ - | Tropical Soybean | -0.50 | 0.11 | 0.58 | 0.31 | 0.53 | 0.07 | 0.25 | 0.120 | 0.250 | + | Tropical Soybean | -0.50 | 0.11 | 0.35 | 0.31 | 0.53 | 0.05 | 0.34 | 0.120 | 0.250 | +----------------------------------+----------------------+---------------------------------+---------------------------------+---------------------------------+---------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ .. _Table Intercepted snow optical properties: From bedbaf7a3ae9d6cf9eb5bc8f283695d13e0ed340 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Fri, 25 Aug 2017 15:39:31 -0600 Subject: [PATCH 092/730] First part of FUN documentation --- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 3deceec659..7c11f2bd7d 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -2,3 +2,287 @@ Fixation and uptake of nitrogen =============================== + +Introduction +----------------- + + +The Fixation and Uptake of Nitrogen model is based on work by Fisher (J.) et al., (2008), Brzostek et al. (2015) and Shi et al. (2016). The concept of FUN is that in most cases, Nitrogen uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of Nitrogen in the environment which a plant may exchange for carbon. The ratio of carbon expended to Nitrogen acquired is referred to here as the cost, or exchange rate, of N acquisition (:math:`E_{nacq}`, gC/gN)). There are four pathways for N uptake: + +1. Fixation by symbiotic bacteria in root nodules (for N fixing plants) (:math:`fix`) +2. Retranslocation of N from senescing tissues (:math:`ret`) +3. Active uptake of Nitrogen by plant roots as nitrate (:math:`NO`:sub:`3`) (:math:`act_{no3}`) +4. Active uptake of Nitrogen by plant roots as ammonia (:math:`NH`:sub:`4`) (:math:`act_{nh4}`) + +The notation suffix for each pathway is given in parentheses here. At each timestep, each of these pathways is associated with a cost term (:math:`cost_x`), a payment in carbon (:math:`C_{nuptake,x}`), and an influx of Nitrogen (:math:`N_{uptake,x}`), any of which may be zero, and where :math:`x` is one of the four uptake streams listed above (:math:`fix`, :math:`ret`, :math:`act_{no3}` or :math:`act_{nh4}`). + + +Boundary conditions of FUN +-------------------------------------------------------- + +Available Carbon +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The carbon available for FUN, :math:`C_{avail}` (gC m\ :sup:`-2`) is the total canopy photosynthetic uptake (GPP), minus the maintenance respiration fluxes (:math:`m_r`) and multiplied by the time step in seconds (:math:`\delta t`). Thus, the remainder of this chapter considers fluxes per timestep, and integrates these fluxes as they are calculated. + + .. math:: + + C_{avail} = (GPP - m_r) \delta t + +Growth respiration is thus only calculated on the part of the carbon uptake that remains after expenditure of C by the FUN module. + +Available Soil Nitrogen +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Cost of Nitrogen Fixation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Cost of Active Uptake +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + + +Resolving N cost across simultaneous uptake streams +-------------------------------------------------------- +The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN (Fisher et al. 2008) utilized a scheme whereby plants only took up N from the cheapest pathway. Brzostek et al. introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: + + .. math:: + + N_{conductance}= \sum{(1/cost_{x})} + +From this, we then calculate the fraction of the carbon allocated to each pathway as + + .. math:: + + C_{frac,x} = \frac{1/cost_{x}}{N_{conductance}} + + +These fractions are used later, to calculate the carbon expended on different uptake pathways. Next, the N acquired from each uptake stream per unit C spent (:math:`N_{exch,x}`, gN/gC) is determined as + + .. math:: + + N_{exch,x} = \frac{C_{frac,x}}{cost_{x}} + +We then determine the total amount of N uptake per unit C spent (:math:`N_{exch,tot}`, gN/gC) as the sum of all the uptake streams. + + .. math:: + N_{exch,tot} = \sum{N_{exch,x}} + +and thus the subsequent overall N cost is + + .. math:: + N_{cost,tot} = 1/{N_{exch,tot}} + +Throughout these calculations, :math:`x` is the sum of the fixation and active uptake pathways. Retranslocation is determined via a different set of mechanisms, once the :math:`N_{cost,tot}` is known. + +Nitrogen Retranslocation +-------------------------------------------------------- +The retranslocation uses an iterative algorithm to remove Nitrogen from each piece of falling litter. There are two pathways for this, 'free' uptake which removes the labile N pool, and 'paid-for' uptake which uses C to extract N from increasingly more recalcitrant pools. + +At each timestep, the pool of carbon in falling leaves (:math:`C_{fallingleaf}`, g m\ :sup:`-2`) is generated from the quantity of litterfall on that day (see Phenology chapter for details). The amount of N in the litter pool (:math:`N_{fallingleaf}`, g m\ :sup:`-2`) is calculated as the total leaf N multiplied by the fraction of the leaf pool passed to litter that timestep. + + .. math:: + + N_{fallingleaf} = N_{leaf}.C_{fallingleaf}/C_{leaf} + +The carbon available at the beginning of the iterative retranslocation calculation is equal to the :math:`C_{avail}` input into FUN. + + .. math:: + + C_{avail_retrans,0} = C_{avail} + + +Free Retranslocation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Some part of the leaf Nitrogen pool is removed without the need for an C expenditure. This 'free' N uptake amount, (:math:`N_{retrans,free}`, gN m\ :sup:`-2`) is calculated as + + .. math:: + + N_{retrans,free} = max(N_{fallingleaf} - (C_{fallingleaf}/CN_{litter,min} ),0.0) + +where :math:`CN_{litter,min}` is the minimum C:N ratio of the falling litter (currently set to 1.5 x the target C:N ratio). + +The new :math:`N_{fallingleaf}` (gN m\ :sup:`-2`) is then determined as + + .. math:: + + N_{fallingleaf} = N_{fallingleaf} - N_{retrans,free} + +and the new litter C:N ratio as + + .. math:: + + CN_{fallingleaf}=C_{fallingleaf}/N_{fallingleaf} + + +Paid-for Retranslocation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The remaining calculations conduct an iterative calculation to determine the degree to which N retranslocation from leaves is paid for as C:N ratios and thus cost increase as N is extracted. The iteration continues until either + +1. The cost of retranslocation (:math:`cost_{retrans}` increases beyond the cost of acquiring N from alternative pathways (:math:`N_{cost,tot}`). +2. :math:`CN_{fallingleaf}` rises to a maximum level, after which no more extraction is possible (representing unavoidable N loss) or +3. There is no more carbon left to pay for extraction. + +First we calculate the cost of extraction (:math:`cost_{retrans}`, gC/gN) for the current leaf C:N ratio as + + .. math:: + + cost_{retrans}= k_{retrans} / (1/CN_{fallingleaf})^{1.3} + +where :math:`k_{retrans}` is a parameter controlling the overall cost of resorption, which also increases exponentially as the C:N ratio increases **Say something about 1.3 exponent**). + +Next, we calculate the amount of C needed to be spent to increase the falling leaf C:N ratio by 1.0 in this iteration :math:`i` (:math:`C_{retrans_spent,i}`, gC m\ :sup:`-2`) as: + .. math:: + + C_{retrans,spent,i} = cost_{retrans}.(N_{fallingleaf} - C_{fallingleaf}/ + (CN_{fallingleaf} + 1.0)) + +(wherein the retranslocation cost is assumed to not change over the increment of 1.0 in C:N ratio). Next, we calculate whether this is larger than the remaining C available to spend. + + .. math:: + + C_{retrans,spent,i} = min(C_{retrans,spent,i}, C_{avail,retrans,i}) + +The amount of N retranslocated from the leaf in this iteration (:math:`N_{retrans_paid,i}`, gN m\ :sup:`-2`) is calculated, checking that it does not fall below zero: + + .. math:: + + N_{retrans,paid,i} = min(N_{fallingleaf},C_{retrans,spent,i} / cost_{retrans}) + +The next step calculates the growth C which is accounted for by this amount of N extraction in this iteration (:math:`C_{retrans,accounted,i}`). This is calculated using the current plant C:N ratio, and also for the additional C which will need to be spent on growth respiration to build this amount of new tissue. + + .. math:: + + C_{retrans,accounted,i} = N_{retrans,paid,i} . CN_{plant} . (1.0 + gr_{frac}) + +Then the falling leaf N is updated: + + .. math:: + + N_{fallingleaf} = N_{fallingleaf} - N_{ret,i} + +and the :math:`CN_{fallingleaf}` and cost_{retrans} are updated. The amount of available carbon that is either unspent on N acquisition nor accounted for by N uptake is updated: + + .. math:: + + C_{avail,retrans,i+1} = C_{avail,retrans,i} - C_{retrans,spent,i} - C_{retrans,accounted,i} + + +Outputs of Retranslocation algorithm. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The final output of the retranslocation calculation are the retranslocated N (:math:`N_{retrans}`, gN m\ :sup:`-2`), C spent on retranslocation (:math:`C_{retrans_paid}`, gC m\ :sup:`-2`), and C accounted for by retranslocation (:math:`C_{retrans_accounted}`, gC m\ :sup:`-2`). + +For paid-for uptake, we accumulate the total carbon spent on retranslocation (:math:`C_{spent_retrans}`), + + .. math:: + + C_{retrans,spent} = \sum{C_{retrans,i}} + +The total N acquired from retranslocation is + + .. math:: + + N_{retrans} = N_{retrans,paid}+N_{retrans,free} + +where N acquired by paid-for retranslocation is + + .. math:: + + N_{retrans,paid} = \sum{N_{retrans,paid,i}} + +The total carbon accounted for by retranslocation is the sum of the C accounted for by paid-for N uptake (:math:`N_{retrans_paid}`) and by free N uptake (:math:`N_{retrans_free}`). + + .. math:: + + C_{retrans,accounted} = \sum{C_{retrans,accounted,i}}+N_{retrans,free}.CN_{plant} . (1.0 + gr_{frac}) + + +The total available carbon in FUN to spend on fixation and active uptake (:math:`C_{tospend}`, gC m\ :sup:`-2`) is calculated as the carbon available minus that account for by retranslocation: + + .. math:: + + C_{tospend} = C_{avail} - C_{retrans,accounted} + + +Carbon expenditure on fixation and active uptake. +-------------------------------------------------------- + +At each model timestep, the overall cost of N uptake is calculated (see below) in terms of C:N ratios. The available carbon (:math:`C_{avail}`, g m\ :sup:`-2` s\ :sup:`-1`) is then allocated to two alternative outcomes, payment for N uptake, or conservation for growth. For each carbon conserved for growth, a corresponding quantity of N must be made available. In the case where the plant target C:N ratio is fixed, the partitioning between carbon for growth (:math:`C_{growth}`) and carbon for N uptake (:math:`C_{nuptake}`) is calculated by solving a system of simultaneous equations. First, the carbon available must equal the carbon spent on N uptake plus that saved for growth. + + .. math:: + + C_{growth}+C_{nuptake}=C_{avail} + +Second, the nitrogen acquired from expenditure of N (left hand side of term below) must equal the N that is required to match the growth carbon (right hand side of term below). + + .. math:: + + C_{nuptake}/N_{cost} =C_{growth}/CN_{target} + +The solution to these two equated terms can be used to estimate the ideal :math:`C_{nuptake}` as follows, + + .. math:: + C_{nuptake} =C_{tospend}/ ( (1.0+f_{gr}*(CN_{target} / N_{cost}) + 1) . + +and the other C and N fluxes can be determined following the logic above. + +Modifications to allow variation in C:N ratios +-------------------------------------------------------- +The original FUN model as developed by Fisher et al. (2008) and Brzostek et al. (2015) assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. **lit review on CN ratios** + +Thus, in CLM5, we introduce the capacity for tissue C:N ratios to be prognostic, rather than static. Overall N and C availability (:math:`N_uptake` and :math:`C_{growth}`) and hence tissue C:N ratios, are both determined by FUN. Allocation to individual tissues is discussed in the allocation chapter + +Here we introduce an algorithm which adjusts the C expenditure on uptake to allow varying tissue C:N ratios. Increasing C spent on uptake will directly reduce the C:N ratio, and reducing C spent on uptake (retaining more for tissue growth) will increase it. C spent on uptake is impacted by both the N cost in the environment, and the existing tissue C:N ratio of the plant. The output of this algorithm is :math:`\gamma_{FUN}`, the fraction of the ideal :math:`C_{nuptake}` calculated from +the FUN equation above (**link equation**). + + .. math:: + C_{nuptake} = C_{nuptake}.\gamma_{FUN} + + +Response of C expenditure to Nitrogen uptake cost +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The environmental cost of Nitrogen (:math:`N_{cost,tot}`) is used to determine :math:`\gamma_{FUN}`. + + .. math:: + \gamma_{FUN} = max(0.0,1.0 - (N_{cost,tot}-a_{cnflex})/b_{cnflex}) + +where :math:`a_{cnflex}` and :math:`b_{cnflex}` are parameters fitted to give flexible C:N ranges over the operating range of N costs of the model. Calibration of these parameters should be subject to future testing in idealized experimental settings; they are here intended as a placeholder to allow some flexible stoichiometry, in the absence of adequate understanding of this process. Here :math:`a_{cnflex}` operates as the :math:`N_{cost,tot}` above which there is a modification in the C expenditure (to allow higher C:N ratios), and :math:`b_{cnflex}` is the scalar which determines how much the C expenditure is modified for a given discrepancy between :math:`a_{cnflex}` and the actual cost of uptake. + + +Response of C expenditure to plant C:N ratios +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +We first calculate a :math:`\delta_{CN}`, which is the difference between the target C:N (:math:`target_{CN}`) a model parameter, and the existing C:N ratio (:math:`CN_{plant}`) **This isn't strictly how it is worked out. Need to remember why we use c_allometry instead**. + + .. math:: + + CN_{plant} = \frac{C_{leaf} + C_{leaf,storage}}{N_{leaf} + N_{leaf,storage})} + +and + .. math:: + \delta_{CN} = CN_{plant} - target_{CN} + + +We then modify :math:`\gamma_{FUN}` to account for situations where (even if N is expensive) plant C:N ratios have increased too far from the target. For situations where :math:`\delta_{CN}` is positive and :math:`\gamma_{FUN}` is <1: + + .. math:: + \gamma_{FUN} = \gamma_{FUN}+(1-\gamma_{FUN}).min(1,\delta_{CN}/c_{flexcn}) + +For situations where :math:`\delta_{CN}` is negative, we reduce C spent on N uptake and retain more C for growth: + + .. math:: + \gamma_{FUN} = \gamma_{FUN}+ 0.5.(delta_CN/c_{flexcn}) + + +We then restrict the degree to which C expenditure can be reduced ( to prevent unrea;istically high C:N ratios) as + + .. math:: + \gamma_{FUN} = max(min(1.0,\gamma_{FUN}),0.5) + + + + + + + + + + From 609d3b9573635185d5d2f6539d3e4d40e74c4f82 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Tue, 29 Aug 2017 16:32:31 -0600 Subject: [PATCH 093/730] Phase 2 of FUN tech note --- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 174 +++++++++++++++--- 1 file changed, 151 insertions(+), 23 deletions(-) diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 7c11f2bd7d..94c9027a23 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -1,20 +1,32 @@ .. _rst_FUN: -Fixation and uptake of nitrogen +Fixation and Uptake of Nitrogen (FUN) =============================== Introduction ----------------- -The Fixation and Uptake of Nitrogen model is based on work by Fisher (J.) et al., (2008), Brzostek et al. (2015) and Shi et al. (2016). The concept of FUN is that in most cases, Nitrogen uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of Nitrogen in the environment which a plant may exchange for carbon. The ratio of carbon expended to Nitrogen acquired is referred to here as the cost, or exchange rate, of N acquisition (:math:`E_{nacq}`, gC/gN)). There are four pathways for N uptake: +The Fixation and Uptake of Nitrogen model is based on work by Fisher (J.) et al., (2008), Brzostek et al. (2015) and Shi et al. (2016). The concept of FUN is that in most cases, Nitrogen uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of Nitrogen in the environment which a plant may exchange for carbon. The ratio of carbon expended to Nitrogen acquired is referred to here as the cost, or exchange rate, of N acquisition (:math:`E_{nacq}`, gC/gN)). There are eight pathways for N uptake: -1. Fixation by symbiotic bacteria in root nodules (for N fixing plants) (:math:`fix`) -2. Retranslocation of N from senescing tissues (:math:`ret`) -3. Active uptake of Nitrogen by plant roots as nitrate (:math:`NO`:sub:`3`) (:math:`act_{no3}`) -4. Active uptake of Nitrogen by plant roots as ammonia (:math:`NH`:sub:`4`) (:math:`act_{nh4}`) +1. Fixation by symbiotic bacteria in root nodules (for N fixing plants) (:math:`_{fix}`) +2. Retranslocation of N from senescing tissues (:math:`_{ret}`) +3. Active uptake of NH4 by arbuscular mycorrhizal plants (:math:`_{active,nh4}`) +4. Active uptake of NH4 by ectomycorrhizal plants (:math:`_{active,nh4}`) +5. Active uptake of NO3 by arbuscular mycorrhizal plants (:math:`_{active,no3}`) +6. Active uptake of NO3 by ectomycorrhizal plants (:math:`_{active,no3}`) +7. Nonmycorrhizal uptake of NH4 (:math:`_{nonmyc,no3}`) +8. Nonmycorrhizal uptake of NO3 (:math:`_{nonmyc,nh4}`) + + +The notation suffix for each pathway is given in parentheses here. At each timestep, each of these pathways is associated with a cost term (:math:`N_{cost,x}`), a payment in carbon (:math:`C_{nuptake,x}`), and an influx of Nitrogen (:math:`N_{uptake,x}`) where :math:`x` is one of the eight uptake streams listed above. + + +For each PFT, we define a fraction of the total C acquisition that can be used for N fixation (:math:`f_{fixers}`), which is broadly equivalent to the fraction of a given PFT that is capable of fixing Nitrogen, and thus represents an upper limit on the amount to which fixation can be increased in low n conditions. For each PFT, the cost calculation is conducted twice. Once where fixation is possible and once where it is not. (:math:`f_{fixers}`) + + +For all of the active uptake pathways, whose cost depends on varying concentrations of N through the soil profile, the costs and fluxes are also determined by soil layer :math:`j`. -The notation suffix for each pathway is given in parentheses here. At each timestep, each of these pathways is associated with a cost term (:math:`cost_x`), a payment in carbon (:math:`C_{nuptake,x}`), and an influx of Nitrogen (:math:`N_{uptake,x}`), any of which may be zero, and where :math:`x` is one of the four uptake streams listed above (:math:`fix`, :math:`ret`, :math:`act_{no3}` or :math:`act_{nh4}`). Boundary conditions of FUN @@ -35,32 +47,67 @@ Available Soil Nitrogen Cost of Nitrogen Fixation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The cost of fixation is derived from Houlton et al. (2008). + .. math:: + + N_{cost,fix} = -s_{fix}/(1.25 e^{a_{fix} + b_{fix} . t_{soil} (1 - 0.5 t_{soil}/ c_{fix}) }) + +Herein, :math:`a_{fix}`, :math:`b_{fix}` and :math:`c_{fix}` are all parameters of the temperature response function of fixation reported by Houlton et al. (2008) (:math:`exp[a+bT_s(1-0.5T_s/c)`). t_{soil} is the soil temperature in C. The values of these parameters are fitted to empirical data as a=-3.62 :math:`\pm` 0.52, b=0.27:math:`\pm` 0.04 and c=25.15 :math:`\pm` 0.66. 1.25 converts from the temperature response function to a 0-1 limitation factor (as specifically employed by Houlton et al.). This function is a 'rate' of uptake for a given temperature. Here we assimilated the rate of fixation into the cost term by assuming that the rate is analagous to a conductance for N, and inverting the term to produce a cost/resistance analagoue. We then multiply this temperature term by the minimum cost at optimal temperature (:math:`s_{fix}`) to give a temperature limited cost in terms of C to N ratios. + + Cost of Active Uptake ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The cost of N uptake from soil, for each layer :math:`j`, is controlled by two uptake parameters that pertain respectively to the relationship between soil N content and N uptake, and root C density and N uptake. + +For non-mycorrhizal uptake: + + .. math:: + + N_{cost,nonmyc,j} = \frac{k_{n,nonmyc}}{N_{smin,j}} + \frac{k_{c,nonmyc}}{c_{root,j}} + +and for active uptake: + + .. math:: + + N_{cost,active,j} = \frac{k_{n,active}}{N_{smin,j}} + \frac{k_{c,active}}{c_{root,j}} + +where :math:`k_{n,active}` varies according to whether we are considering ecto or arbuscular mycorrhizal uptake. + .. math:: + :label: 18.2 + + k_{n,active} = + \left\{\begin{array}{lr} + k_{n,Eactive}& e = 1\\ + k_{n,Aactive}& e = 0 + \end{array}\right\} + +where m=1 pertains to the fraction of the PFT that is ecotmycorrhizal, as opposed to arbuscular mycorrhizal. + Resolving N cost across simultaneous uptake streams -------------------------------------------------------- The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN (Fisher et al. 2008) utilized a scheme whereby plants only took up N from the cheapest pathway. Brzostek et al. introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: .. math:: - N_{conductance}= \sum{(1/cost_{x})} + N_{conductance,f}= \sum{(1/N_{cost,x})} + From this, we then calculate the fraction of the carbon allocated to each pathway as .. math:: - C_{frac,x} = \frac{1/cost_{x}}{N_{conductance}} + C_{frac,x} = \frac{1/N_{cost,x}}{N_{conductance}} These fractions are used later, to calculate the carbon expended on different uptake pathways. Next, the N acquired from each uptake stream per unit C spent (:math:`N_{exch,x}`, gN/gC) is determined as .. math:: - N_{exch,x} = \frac{C_{frac,x}}{cost_{x}} + N_{exch,x} = \frac{C_{frac,x}}{N_{cost,x}} We then determine the total amount of N uptake per unit C spent (:math:`N_{exch,tot}`, gN/gC) as the sum of all the uptake streams. @@ -72,7 +119,7 @@ and thus the subsequent overall N cost is .. math:: N_{cost,tot} = 1/{N_{exch,tot}} -Throughout these calculations, :math:`x` is the sum of the fixation and active uptake pathways. Retranslocation is determined via a different set of mechanisms, once the :math:`N_{cost,tot}` is known. + Retranslocation is determined via a different set of mechanisms, once the :math:`N_{cost,tot}` is known. Nitrogen Retranslocation -------------------------------------------------------- @@ -88,7 +135,7 @@ The carbon available at the beginning of the iterative retranslocation calculati .. math:: - C_{avail_retrans,0} = C_{avail} + C_{avail,retrans,0} = C_{avail} Free Retranslocation @@ -261,28 +308,109 @@ and \delta_{CN} = CN_{plant} - target_{CN} -We then modify :math:`\gamma_{FUN}` to account for situations where (even if N is expensive) plant C:N ratios have increased too far from the target. For situations where :math:`\delta_{CN}` is positive and :math:`\gamma_{FUN}` is <1: - - .. math:: - \gamma_{FUN} = \gamma_{FUN}+(1-\gamma_{FUN}).min(1,\delta_{CN}/c_{flexcn}) +We then increase :math:`\gamma_{FUN}` to account for situations where (even if N is expensive) plant C:N ratios have increased too far from the target. Where :math:`\delta_{CN}` is negative, we reduce C spent on N uptake and retain more C for growth + + .. math:: + :label: 7.23 -For situations where :math:`\delta_{CN}` is negative, we reduce C spent on N uptake and retain more C for growth: + \gamma_{FUN} = + \left\{\begin{array}{lr} + \gamma_{FUN}+ 0.5.(delta_{CN}/c_{flexcn})& delta_{CN} > 0\\ + \gamma_{FUN}+(1-\gamma_{FUN}).min(1,\delta_{CN}/c_{flexcn}) & delta_{CN} < 0 + \end{array}\right\} - .. math:: - \gamma_{FUN} = \gamma_{FUN}+ 0.5.(delta_CN/c_{flexcn}) - - -We then restrict the degree to which C expenditure can be reduced ( to prevent unrea;istically high C:N ratios) as +We then restrict the degree to which C expenditure can be reduced (to prevent unrealistically high C:N ratios) as .. math:: \gamma_{FUN} = max(min(1.0,\gamma_{FUN}),0.5) + + +Calculation of N uptake streams from active uptake and fixation +-------------------------------------------------------- + +Once the final :math:`C_{nuptake}` is known, the fluxes of C to the individual pools can be derived as + + .. math:: + C_{nuptake,x} = C_{frac,x}.C_{nuptake} + - + .. math:: + + N_{uptake,x} = \frac{C_{nuptake}}{N_{cost}} + + +Following this, we determine whether the extraction estimates exceed the pool size for each source of N. Where :math:`N_{active,no3} + N_{nonmyc,no3} > N_{avail,no3}`, we calculate the unmet uptake, :math:`N_{unmet,no3}` + + .. math:: + + N_{unmet,no3} = N_{active,no3} + N_{nonmyc,no3} - N_{avail,no3} + +then modify both fluxes to account + + .. math:: + + N_{active,no3} = N_{active,no3} + N_{unmet,no3}.\frac{N_{active,no3}}{N_{active,no3}+N_{nonmyc,no3}} + + .. math:: + + N_{nonmyc,no3} = N_{nonmyc,no3} + N_{unmet,no3}.\frac{N_{nonmyc,no3}}{N_{active,no3}+N_{nonmyc,no3}} + +and similarly, for NH4, where :math:`N_{active,nh4} + N_{nonmyc,nh4} > N_{avail,nh4}`, we calculate the unmet uptake, :math:`N_{unmet,no3}` + + .. math:: + + N_{unmet,nh4} = N_{active,nh4} + N_{nonmyc,nh4} - N_{avail,nh4} + +then modify both fluxes to account + + .. math:: + + N_{active,nh4} = N_{active,nh4} + N_{unmet,nh4}.\frac{N_{active,nh4}}{N_{active,nh4}+N_{nonmyc,nh4}} + .. math:: + + N_{nonmyc,nh4} = N_{nonmyc,nh4} + N_{unmet,nh4}.\frac{N_{nonmyc,nh4}}{N_{active,nh4}+N_{nonmyc,nh4}} + + +and then update the C spent to account for hte new lower N acquisition in that layer/pool. + + .. math:: + + C_{active,nh4} = N_{active,nh4}.N_{cost,active,nh4}\\ + C_{active,no3} = N_{active,no3}.N_{cost,active,no3}\\ + C_{nonmyc,no3} = N_{nonmyc,no3}.N_{cost,nonmyc,no3}\\ + C_{nonmyc,no3} = N_{nonmyc,no3}.N_{cost,nonmyc,no3}\\ + + +Following this, we determine how much carbon is accounted for for each soil layer. + + .. math:: + + C_{accounted,x,j} = C_{spent,j,x} - (N_{acquired,j,x}.CN_{plant}.(1.0+ gr_{frac})) + + + +Types of N uptake streams +-------------------------------------------------------- +Arbuscular mycorrhizal fungi: +Ectomycorrhizal fungi: +Nonmycorrhizal plants. + + +ECK_active (step 1) sets active components for Ectomycorrhizal fungi +ACK_active (step 2) sets active components for Arbuscular fungi +kc_nonmyc (step 1) sets nonmyc components for Ectomycorrhizal fungi +kc_nonmyc (step 2) sets active components for Arbuscular fungi +ACTIVE vs NONMYC +ECTO vs ARBU for ACTIVE. + +References +-------------------------------------------------------- +Houlton, B.Z., Wang, Y.P., Vitousek, P.M. and Field, C.B., 2008. A unifying framework for dinitrogen fixation in the terrestrial biosphere. Nature, 454(7202), p.327. From 8ace44030f052ed0a757b0584da9bce94326ad51 Mon Sep 17 00:00:00 2001 From: Charlie Koven Date: Thu, 31 Aug 2017 17:07:44 -0700 Subject: [PATCH 094/730] a few changes: replaced some graphics, moved some text from allocation to CN pools, updated text in a few places --- .../CLM50_Tech_Note_CN_Allocation.rst | 38 ------------ .../CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 47 +++++++++++++++ .../CLM50_Tech_Note_Decomposition.rst | 59 ++++++++++++++----- .../References/CLM50_Tech_Note_References.rst | 7 +++ 4 files changed, 97 insertions(+), 54 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index a63ec9ae3d..71eca6193a 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -6,44 +6,6 @@ Carbon and Nitrogen Allocation Introduction ----------------- -CLM includes a fully-prognostic treatment of the terrestrial carbon and -nitrogen cycles including interactions between these cycles as mediated -by biological mechanisms of plants and soil heterotrophs. The model is -fully prognostic with respect to all carbon and nitrogen state variables -in the vegetation, litter, and soil organic matter. The seasonal timing -of new vegetation growth and litterfall is also prognostic, responding -to soil and air temperature, soil water availability, and daylength, in -varying degrees depending on a specified phenology type for each PFT -(see Chapter 14). The prognostic LAI, SAI, and vegetation heights are -utilized by the biophysical model. - -Separate state variables for C and N are tracked for leaf, live stem, -dead stem, live coarse root, dead coarse root, and fine root pools -(Figure 13.1 and 13.2). Each of these pools has two corresponding -storage pools representing, respectively, short-term and long-term -storage of non-structural carbohydrates and labile nitrogen. There are -two additional carbon pools, one for the storage of growth respiration -reserves, and another used to meet excess demand for maintenance -respiration during periods with low photosynthesis. One additional -nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue -prior to abscission and litterfall. Altogether there are 20 state -variables for vegetation carbon, and 19 for vegetation nitrogen. - -.. _Figure Vegetation fluxes and pools: - -.. figure:: image1.png - :width: 800px - :height: 800px - - Vegetation fluxes and pools. - -.. _Figure Carbon and nitrogen pools: - -.. figure:: image2.png - :width: 400px - :height: 400px - - Carbon and nitrogen pools. Carbon Allocation for Maintenance Respiration Costs -------------------------------------------------------- diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst index 92903f02e0..a98069deaf 100644 --- a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -2,3 +2,50 @@ CN Pools =================== + +Introduction +----------------- + +CLM includes a prognostic treatment of the terrestrial carbon and +nitrogen cycles including natural vegetation, crops, and soil biogeochemistry. The model is +fully prognostic with respect to all carbon and nitrogen state variables +in the vegetation, litter, and soil organic matter. The seasonal timing +of new vegetation growth and litterfall is also prognostic, responding +to soil and air temperature, soil water availability, daylength, and +crop management practices in +varying degrees depending on a specified phenology type or management for each PFT +(Chapter +:numref:`rst_Vegetation Phenology and Turnover`). The +prognostic LAI, SAI, +tissue stoichiometry, and vegetation heights are +utilized by the biophysical model that couples carbon, water, and +energy cycles. + +Separate state variables for C and N are tracked for leaf, live stem, +dead stem, live coarse root, dead coarse root, fine root, and grain pools +(:numref:`Figure Vegetation fluxes and pools`). Each of these pools has two corresponding +storage pools representing, respectively, short-term and long-term +storage of non-structural carbohydrates and labile nitrogen. There are +two additional carbon pools, one for the storage of growth respiration +reserves, and another used to meet excess demand for maintenance +respiration during periods with low photosynthesis. One additional +nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue +prior to abscission and litterfall. Altogether there are 23 state +variables for vegetation carbon, and 22 for vegetation nitrogen. + +.. _Figure Vegetation fluxes and pools: + +.. figure:: CLMCN_pool_structure_v2_lores.png + :width: 753px + :height: 513px + + Vegetation fluxes and pools for carbon cycle in CLM5. + +In addition to the vegetation pools, CLM includes a series of +decomposing carbon and nitrogen pools as vegetation successively +breaks down to CWD, and/or litter, and subsequently to soil organic +matter. Discussion of the decomposition model, alternate +specifications of decomposition rates, and methods to rapidly +equilibrate the decomposition model, is in Chapter +:numref:`rst_Decomposition`. + diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index d35feab5be..87f7f170bd 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -15,11 +15,12 @@ structure used in CLM4.0, or a second pool structure, characterized by slower decomposition rates, based on the Century model (Parton et al. 1988). In addition, the user can choose, at compile time, whether to allow :math:`{n}_{lev}` to equal 1, as in CLM4.0, or to equal the -number of soil levels used for the soil hydrology (default 10). +number of soil levels used for the soil hydrological and thermal +calculations (see Section :numref:`Soil Layers` for soil layering). .. _Figure Schematic of decomposition model in CLM: -.. figure:: image1.png +.. figure:: CLM4_vertsoil_soilstruct_drawing.png Schematic of decomposition model in CLM. @@ -60,11 +61,11 @@ pools. Further discussion of the vertical distribution of carbon inputs :math:`{R}_{i}`\ (z), vertical turnover times :math:`{k}_{j}`\ (z), and vertical transport *D(z)* is below. Discussion of the vertical model and analysis of both decomposition -structures is in Koven et al (2013). +structures is in :ref:`Koven et al. (2013) `. .. _Figure Pool structure: -.. figure:: image2.png +.. figure:: soil_C_pools_CN_century.png Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 @@ -271,7 +272,9 @@ unitless) is calculated using a relationship from Andrén and Paustian where :math:`{\Psi}_{j}` is the soil water potential in layer *j*, :math:`{\Psi}_{min}` is a lower limit for soil -water potential control on decomposition rate (set to -10 MPa). +water potential control on decomposition rate (in CLM5, this was +changed from a default value of -10 MPa in CLM4.5 and earlier to a +default value of -2.5 MPa). :math:`{\Psi}_{sat,j}` (MPa) is the saturated soil water potential, calculated using the multivariate regression model from Cosby et al. (1984): @@ -294,7 +297,7 @@ of Niu and Yang (2006), \psi \left(T\right)=-\frac{L_{f} \left(T-T_{f} \right)}{10^{3} T} An additional frozen decomposition limitation can be specified using a -‘frozen Q\ :sub:`10` following Koven et al. (2011), however the +‘frozen Q\ :sub:`10`' following :ref:`Koven et al. (2011) `, however the default value of this is the same as the unfrozen Q\ :sub:`10` value, and therefore the basic hypothesis is that frozen respiration is limited by liquid water availability, and can be modeled following the @@ -322,7 +325,7 @@ of decomposition was shown by Jenkinson and Coleman (2008) to be an important term in fitting total C and 14C profiles, and implies that unresolved processes, such as priming effects, microscale anoxia, soil mineral surface and/or aggregate stabilization may be important in -controlling the fate of carbon at depth (Koven et al. 2013). CLM +controlling the fate of carbon at depth :ref:`Koven et al. (2013) `. CLM includes these unresolved depth controls via an exponential decrease in the soil turnover time with depth: @@ -331,7 +334,10 @@ the soil turnover time with depth: r_{depth} =\exp \left(-\frac{z}{z_{\tau } } \right) -where :math:`{z}_{\tau}` is the e-folding depth for decomposition, set by default to 0.5m. +where :math:`{z}_{\tau}` is the e-folding depth for decomposition. For +CLM4.5, the default value of this was 0.5m. For CLM5, this has been +changed to a default value of 10m, which effectively means that +intrinsic decomposition rates may proceed as quickly at depth as at the surface. The combined decomposition rate scalar (:math:`{r}_{total}`,unitless) is: @@ -746,15 +752,22 @@ value of the advection term is 0 cm/yr, such that transport is purely diffusive. Diffusive transport differs in rate between permafrost soils (where cryoturbation is the dominant transport term) and non-permafrost soils (where bioturbation dominates). For permafrost soils, a -parameterization based on that of Koven et al. (2009) is used: the +parameterization based on that of :ref:`Koven et al. (2009) ` is used: the diffusivity parameter is constant through the active layer, and decreases linearly from the base of the active layer to zero at a set depth (default 3m); the default permafrost diffusivity is 5 cm\ :sup:`2`/yr. For non-permafrost soils, the default diffusivity is 1 cm\ :sup:`2`/yr. -Model Equilibration ------------------------- +Model Equilibration and its Acceleration +--------------------------------------- +For transient experiments, it is usually assumed that the carbon cycle +is starting from a point of relatively close equilibrium, i.e. that +productivity is balanced by ecosystem carbon losses through +respiratory and disturbance pathways. In order to satisfy this +assumption, the model is generally run until the productivity and loss +terms find a stable long-term equilibrium; at this point the model is +considered 'spun up'. Because of the coupling between the slowest SOM pools and productivity through N downregulation of photosynthesis, equilibration of the model @@ -762,14 +775,13 @@ for initialization purposes will take an extremely long time in the standard mode. This is particularly true for the CENTURY-based decomposition cascade, which includes a passive pool. In order to rapidly equilibrate the model, a modified version of the “accelerated -decomposition†(Thornton and Rosenbloom, 2005) is used. The fundamental +decomposition†:ref:`(Thornton and Rosenbloon, 2005) ` is used. The fundamental idea of this approach is to allow fluxes between the various pools (both turnover-defined and vertically-defined fluxes) adjust rapidly, while keeping the pool sizes themselves small so that they can fill quickly. To do this, the base decomposition rate :math:`{k}_{i}` for each pool *i* is accelerated by a term :math:`{a}_{i}` such that the slow -pools are collapsed onto an approximately annual timescale (Koven et al. -2013). Accelerating the pools beyond this timescale distorts the +pools are collapsed onto an approximately annual timescale :ref:`Koven et al. (2013) `. Accelerating the pools beyond this timescale distorts the seasonal and/or diurnal cycles of decomposition and N mineralization, thus leading to a substantially different ecosystem productivity than the full model. For the vertical model, the vertical transport terms are @@ -787,6 +799,21 @@ accelerated decomposition mode are handled automatically by CLM upon loading from restart files (which preserve information about the mode of the model when restart files were written). -The acceleration terms for the two decomposition cascades are shown in -Tables 15.1 and 15.3. +The base acceleration terms for the two decomposition cascades are shown in +Tables 15.1 and 15.3. In addition to the base terms, CLM5 also +includes a geographic term to the acceleration in order to apply +larger values to high-latitude systems, where decomposition rates are +particularly slow and thus equilibration can take significantly longer +than in temperate or tropical climates. This geographic term takes +the form of a logistic equation, where :math:`{a}_{i}` is equal to the +product of the base acceleration term and :math:`{a}_{l}` below: + +.. math:: + :label: 21.62) + + a_l = 1 + 50 / \left ( 1 + exp \left (-0.1 * (abs(latitude) - + 60 ) \right ) \right ) + + + diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index a419e14e80..d7a5887778 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -896,6 +896,13 @@ Koven, C.D. et al. 2013. The effect of vertically-resolved soil biogeochemistry and alternate soil C and N models on C dynamics of CLM4. Biogeosciences Discussions 10:7201-7256. +.. _Kovenetal2015: + +Koven, C.D. et al. 2015. Permafrost carbon-climate feedback is +sensitive to deep soil carbon decomposability but not deep soil +nitrogen dynamics. Proceedings of the National Academies of Science, +112, 12, 3752-3757, doi:10.1073/pnas.1415123112 + .. _Kuchariketal2000: Kucharik, C.J., Foley, J.A., Delire, C., Fisher, V.A., Coe, M.T., From bda8c43308dedf6e4a947ffce438a0332d713022 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 1 Sep 2017 09:03:35 -0600 Subject: [PATCH 095/730] Update html and fix build errors --- doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst | 9 ++++----- .../CLM50_Tech_Note_Transient_Landcover.rst | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 94c9027a23..32d42b564c 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -1,7 +1,7 @@ .. _rst_FUN: Fixation and Uptake of Nitrogen (FUN) -=============================== +======================================= Introduction ----------------- @@ -286,7 +286,7 @@ the FUN equation above (**link equation**). Response of C expenditure to Nitrogen uptake cost -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The environmental cost of Nitrogen (:math:`N_{cost,tot}`) is used to determine :math:`\gamma_{FUN}`. .. math:: @@ -296,7 +296,7 @@ where :math:`a_{cnflex}` and :math:`b_{cnflex}` are parameters fitted to give fl Response of C expenditure to plant C:N ratios -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ We first calculate a :math:`\delta_{CN}`, which is the difference between the target C:N (:math:`target_{CN}`) a model parameter, and the existing C:N ratio (:math:`CN_{plant}`) **This isn't strictly how it is worked out. Need to remember why we use c_allometry instead**. .. math:: @@ -311,7 +311,6 @@ and We then increase :math:`\gamma_{FUN}` to account for situations where (even if N is expensive) plant C:N ratios have increased too far from the target. Where :math:`\delta_{CN}` is negative, we reduce C spent on N uptake and retain more C for growth .. math:: - :label: 7.23 \gamma_{FUN} = \left\{\begin{array}{lr} @@ -326,7 +325,7 @@ We then restrict the degree to which C expenditure can be reduced (to prevent un Calculation of N uptake streams from active uptake and fixation --------------------------------------------------------- +---------------------------------------------------------------- Once the final :math:`C_{nuptake}` is known, the fluxes of C to the individual pools can be derived as diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index 16aaa120a8..e8edb60222 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -270,8 +270,8 @@ data files in the mksurfdata_map tool. Schematic of translation of annual LUH2 land units to CLM5 plant and crop functional types. - .. _Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool +.. _Figure Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool: -.. figure :: image3.png +.. figure:: image3.png Workflow of CLM5 Land Use Data Tool and Mksurfdata_map Tool From f75874ee3c22850be25c38f21406980a7e9cc499 Mon Sep 17 00:00:00 2001 From: Charlie Koven Date: Fri, 1 Sep 2017 11:10:41 -0700 Subject: [PATCH 096/730] more changes, mainly on allocation text --- .../CLM50_Tech_Note_CN_Allocation.rst | 173 ++++-------------- .../CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 14 ++ .../CLM50_Tech_Note_Decomposition.rst | 20 +- 3 files changed, 59 insertions(+), 148 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 71eca6193a..728ae142c1 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -7,18 +7,14 @@ Introduction ----------------- -Carbon Allocation for Maintenance Respiration Costs --------------------------------------------------------- - The carbon and nitrogen allocation routines in CLM determine the fate of newly assimilated carbon, coming from the calculation of photosynthesis, and available mineral nitrogen, coming from plant uptake of mineral -nitrogen in the soil or being drawn out of plant reserves. Allocation -fluxes are determined in three steps: first :math:`CF_{GPPpot}` is -used to evaluate the potential allocation of carbon and nitrogen -assuming an unlimited nitrogen supply, then the actual nitrogen supply -is compared against the demand, and finally allocation of carbon and -nitrogen are reduced, if necessary, to match nitrogen supply and demand. +nitrogen in the soil or being drawn out of plant reserves. A significant change to CLM5 relative to prior versions is that allocation of carbon and nitrogen proceed independently rather than in a sequential manner. + + +Carbon Allocation for Maintenance Respiration Costs +-------------------------------------------------------- Allocation of available carbon on each time step is prioritized, with first priority given to the demand for carbon to support maintenance @@ -49,15 +45,15 @@ s\ :sup:`-1`): .. math:: :label: 19.2 - CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. + CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPP} } \\ {CF_{GPP} \qquad {\rm for\; }CF_{mr} >CF_{GPP} } \end{array}\right. .. math:: :label: 19.3 - CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. + CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPP} } \\ {CF_{mr} -CF_{GPP} \qquad {\rm for\; }CF_{mr} >CF_{GPP} } \end{array}\right. The storage pool that supplies carbon for maintenance respiration in -excess of current :math:`CF_{GPPpot}` ( :math:`CS_{xs}`, gC +excess of current :math:`CF_{GPP}` ( :math:`CS_{xs}`, gC m\ :sup:`-2`) is permitted to run a deficit (negative state), and the magnitude of this deficit determines an allocation demand which gradually replenishes :math:`CS_{xs}`. The logic for allowing a @@ -83,16 +79,14 @@ m\ :sup:`-2` s\ :sup:`-1`) is given as .. math:: :label: 19.5 - CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. + CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPP} -CF_{GPP,mr} } \\ {\max (CF_{GPP} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPP} -CF_{GPP,mr} } \end{array}\right. where :math:`\tau_{xs}` is the time constant (currently set to 30 days) controlling the rate of replenishment of :math:`CS_{xs}`. Note that these two top-priority carbon allocation fluxes (:math:`CF_{GPP,mr}` and :math:`CF_{GPP,xs}`) are not -stoichiometrically associated with any nitrogen fluxes, and so this -initial allocation step can proceed without reference to (or limitation -from) the available mineral nitrogen supply. +stoichiometrically associated with any nitrogen fluxes. Carbon and Nitrogen Stoichiometry of New Growth ---------------------------------------------------- @@ -104,7 +98,7 @@ growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 19.6 - CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . + CF_{avail\_ alloc} =CF_{GPP} -CF_{GPP,mr} -CF_{GPP,xs} . Potential allocation to new growth is calculated for all of the plant carbon and nitrogen state variables based on specified C:N ratios for @@ -140,10 +134,10 @@ favorable growth environments (Allen et al., 2005; Vanninen and Makela, .. _Table Allocation and CN ratio parameters: -.. table:: Allocation and carbon\:nitrogen ratio parameters +.. table:: Allocation and target carbon\:nitrogen ratio parameters +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ - | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | + | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`Target CN_{leaf}` | :math:`Target CN_{fr}` | :math:`Target CN_{lw}` | :math:`Target CN_{dw}` | +==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ | NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ @@ -240,111 +234,9 @@ gN m\ :sup:`-2` s\ :sup:`-1`) as: NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . -Deployment of retranslocated nitrogen ------------------------------------------- - -In many plants, some portion of the nitrogen used to construct new -tissues is mobilized from senescing tissues, especially leaves, and -retained within the plant when the tissues are lost as litter. This -store of retranslocated nitrogen is used to supply part of the nitrogen -demand for subsequent growth (Magill et al., 1997; Oikawa et al., 2005; -Son and Gower, 1991). CLM includes one pool of retranslocated nitrogen -(:math:`NS_{retrans}`, gN m\ :sup:`-2`), and the -availability of nitrogen from this pool to support new growth -(:math:`NF_{avail\_retrans}`, gN m\ :sup:`-2` -s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: - -.. math:: - :label: 19.14 - - NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) - -where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of retranslocated -nitrogen extracted from senescing tissues, -:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of -:math:`NF_{plant\_demand}`, and :math:`\Delta`\ *t* (s) is the -model’s biogeochemistry time step. This formulation produces an annual -cycle in the extraction of nitrogen from :math:`NS_{retrans}` -which corresponds to the annual cycle of plant nitrogen demand, and -which is scaled to give :math:`NS_{retrans}` approximately a -one-year turnover time. The minimum function prevents extraction of more -than the remaining pool of retranslocated nitrogen, which can be an -important constraint under conditions where high rates of mortality are -modifying the size of the pool. During the first year of an initial -simulation, before :math:`NF_{plant\_demand\_ann}` and -:math:`NF_{retrans\_ann}` have valid values, -:math:`NF_{avail\_retrans}` is set to 0.0. - -The actual flux of nitrogen from the retranslocated N pool into -allocation of new growth (:math:`NF_{retrans,alloc}`, gN -m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant -demand for new nitrogen: - -.. math:: - :label: 19.15 - - NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) - -Plant nitrogen uptake from soil mineral nitrogen pool ----------------------------------------------------------- - -The total plant nitrogen demand is reduced by the nitrogen flux from -:math:`NS_{retrans}` to give the plant demand for mineral nitrogen -from the soil (:math:`NF_{plant\_demand\_soil}`, gN -m\ :sup:`-2` s\ :sup:`-1`): - -.. math:: - :label: 19.16 - - NF_{plant\_ demand\_ soil} =NF_{plant\_ demand} -NF_{retrans,alloc} . - -The combined demand from all PFTs sharing space on a soil column and the -demand from the heterotrophic community in the soil (nitrogen -immobilization demand) compete for the available soil mineral nitrogen -pool. The result of this competition is passed back to the allocation -algorithm as :math:`f_{plant\_demand}`, the fraction (from 0 to 1) -of the plant nitrogen demand which can be met given the current soil -mineral nitrogen supply and competition with heterotrophs. Plant uptake -from the soil mineral nitrogen pool is then given as: - -.. math:: - :label: 19.17 - - NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} - -Final carbon and nitrogen allocation +Carbon Allocation to New Growth ----------------------------------------- -The total flux of allocated nitrogen is given as: - -.. math:: - :label: 19.18 - - NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} - -From the stoichiometric relationship in Eq. , the associated carbon -allocation flux is: - -.. math:: - :label: 19.19 - - CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . - -The downregulation of photosynthesis can then be calculated as: - -.. math:: - :label: 19.20 - - f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . - -Total allocation to new leaf carbon -(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: - -.. math:: - :label: 19.21 - - CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . - There are two carbon pools associated with each plant tissue – one which represents the currently displayed tissue, and another which represents carbon stored for display in a subsequent growth period. The nitrogen @@ -416,67 +308,78 @@ tissue types are given as: CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). -The corresponding nitrogen allocation fluxes are given as: + +Nitrogen allocation +----------------------------------------- + +The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{supply}`. The total N allocated for a given organ :math:`o` is the minimum between the supply and the demand: + +.. math:: + + NF_{alloc,o} = min \left( NF_{demand, o}, NF_{supply, o} \right) + +The demand for each tissue, calculated for the tissue to remain on stoichiometry during growth, is: + .. math:: :label: 19.34 - NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} + NF_{demand,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} .. math:: :label: 19.35 - NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) + NF_{demand,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) .. math:: :label: 19.36 - NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} + NF_{demand,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} .. math:: :label: 19.37 - NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) + NF_{demand,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) .. math:: :label: 19.38 - NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} + NF_{demand,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: :label: 19.39 - NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + NF_{demand,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: :label: 19.40 - NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + NF_{demand,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: :label: 19.41 - NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) + NF_{demand,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) .. math:: :label: 19.42 - NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} + NF_{demand,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: :label: 19.43 - NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) + NF_{demand,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: :label: 19.44 - NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} + NF_{demand,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: :label: 19.45 - NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). + NF_{demand,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). Autotrophic Respiration ---------------------------- diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst index a98069deaf..9304f87634 100644 --- a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -49,3 +49,17 @@ specifications of decomposition rates, and methods to rapidly equilibrate the decomposition model, is in Chapter :numref:`rst_Decomposition`. +Tissue Stoichiometry +----------------------- + +As of CLM5, vegetation tissues have a flexible stoichiometry, as +described in :ref:`Ghimire et al. (2015) `. Each +tissue has a target C\:N ratio, and nitrogen is allocated at each +timestep in order to allow the plant to best match the target +stoichiometry. Nitrogen downregulation of productivity acts by +increasing the C\:N ratio of leaves when insufficient nitrogen is +available to meet stoichiometric demands of leaf growth, thereby +reducing the N available for photosynthesis and reducing the :math:`V_{\text{c,max25}}` and +:math:`J_{\text{max25}}` terms, as described in Chapter +:numref:`rst_Photosynthetic Capacity`. Details of the flexible tissue +stoichiometry are described in Chapter :numref:`rst_CN Allocation`. diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 87f7f170bd..6863012fda 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -273,19 +273,13 @@ unitless) is calculated using a relationship from Andrén and Paustian where :math:`{\Psi}_{j}` is the soil water potential in layer *j*, :math:`{\Psi}_{min}` is a lower limit for soil water potential control on decomposition rate (in CLM5, this was -changed from a default value of -10 MPa in CLM4.5 and earlier to a -default value of -2.5 MPa). -:math:`{\Psi}_{sat,j}` (MPa) is the saturated soil water -potential, calculated using the multivariate regression model from Cosby et al. (1984): - -.. math:: - :label: 21.7) - - \Psi _{sat,\, j} =-\left(9.8e-5\right)\exp \left(\left(1.54-0.0095P_{sand,\, j} +0.0063\left(100-P_{sand,\, j} -P_{clay,\, j} \right)\right)\log \left(10\right)\right) - -where :math:`{P}_{sand,j}` and :math:`{P}_{clay,j}` are the -volume percentages of sand and clay in soil layer *j*. - +changed from a default value of -10 MPa used in CLM4.5 and earlier to a +default value of -2.5 MPa). :math:`{\Psi}_{max,j}` (MPa) is the soil +moisture at which decomposition proceeds at a moisture-unlimited +rate. The default value of :math:`{\Psi}_{max,j}` for CLM5 is updated +from a saturated value used in CLM4.5 and earlier, to a value +nominally at field capacity, with a value of -0.002 MPa + For frozen soils, the bulk of the rapid dropoff in decomposition with decreasing temperature is due to the moisture limitation, since matric potential is limited by temperature in the supercooled water formulation From 683a3185eb150276d56f9911c4acd032c3e82184 Mon Sep 17 00:00:00 2001 From: Charlie Koven Date: Wed, 6 Sep 2017 13:28:37 -0700 Subject: [PATCH 097/730] updated text in CN allocation: added N supply term equations, deleted the code on plant respiration (which has its own chapter), a couple other things. --- .../CLM50_Tech_Note_CN_Allocation.rst | 138 +++++------------- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 2 +- 2 files changed, 34 insertions(+), 106 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 728ae142c1..4db8909b42 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -249,62 +249,62 @@ storage pools (where storage is indicated with *\_stor*) for the various tissue types are given as: .. math:: - :label: 19.22 + :label: 19.14 CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} .. math:: - :label: 19.23 + :label: 19.15 CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) .. math:: - :label: 19.24 + :label: 19.16 CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} .. math:: - :label: 19.25 + :label: 19.17 CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) .. math:: - :label: 19.26 + :label: 19.18 CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} .. math:: - :label: 19.27 + :label: 19.19 CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 19.28 + :label: 19.20 CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 19.29 + :label: 19.21 CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) .. math:: - :label: 19.30 + :label: 19.22 CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} .. math:: - :label: 19.31 + :label: 19.23 CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) .. math:: - :label: 19.32 + :label: 19.24 CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} .. math:: - :label: 19.33 + :label: 19.25 CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). @@ -313,160 +313,88 @@ tissue types are given as: Nitrogen allocation ----------------------------------------- -The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{supply}`. The total N allocated for a given organ :math:`o` is the minimum between the supply and the demand: +The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{supply}`. The total N allocated for a given tissue :math:`i` is the minimum between the supply and the demand: .. math:: + :label: 19.26 - NF_{alloc,o} = min \left( NF_{demand, o}, NF_{supply, o} \right) + NF_{alloc,i} = min \left( NF_{demand, i}, NF_{supply, i} \right) The demand for each tissue, calculated for the tissue to remain on stoichiometry during growth, is: .. math:: - :label: 19.34 + :label: 19.27 NF_{demand,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} .. math:: - :label: 19.35 + :label: 19.28 NF_{demand,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) .. math:: - :label: 19.36 + :label: 19.29 NF_{demand,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} .. math:: - :label: 19.37 + :label: 19.30 NF_{demand,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) .. math:: - :label: 19.38 + :label: 19.31 NF_{demand,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 19.39 + :label: 19.32 NF_{demand,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 19.40 + :label: 19.33 NF_{demand,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 19.41 + :label: 19.34 NF_{demand,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) .. math:: - :label: 19.42 + :label: 19.35 NF_{demand,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} .. math:: - :label: 19.43 + :label: 19.36 NF_{demand,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) .. math:: - :label: 19.44 + :label: 19.37 NF_{demand,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} .. math:: - :label: 19.45 + :label: 19.38 NF_{demand,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). -Autotrophic Respiration ----------------------------- - -The model treats maintenance and growth respiration fluxes separately, -even though it is difficult to measure them as separate fluxes (Lavigne -and Ryan, 1997; Sprugel et al., 1995). Maintenance respiration is -defined as the carbon cost to support the metabolic activity of existing -live tissue, while growth respiration is defined as the additional -carbon cost for the synthesis of new growth. - -13.7.1 Maintenance Respiration -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Under the assumption that tissue nitrogen content is a suitable index of -cellular metabolic rate, maintenance respiration costs for live tissues -(leaf, live stem, live coarse root, and fine root) are calculated as -functions tissue nitrogen content and the relevant temperature, -following the empirical relationship reported by Ryan (1991): - -.. math:: - :label: 19.46 - - CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} +After each pool's demand is calculated, the total plant N demand is then the sum of each individual pool :math: `i` corresponding to each tissue: .. math:: - :label: 19.47 - - CF_{mr\_ livestem} \_ =NS_{livestem} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} - -.. math:: - :label: 19.48 - - CF_{mr\_ livecroot} \_ =NS_{livecroot} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} - -.. math:: - :label: 19.49 - - CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} - -where :math:`MR_{base}` (= 2.525e\ :sup:`-6` gC gN\ :sup:`-1` s\ :sup:`-1`) is the base rate of maintenance -respiration per unit nitrogen content, :math:`MR_{q10}` (= 2.0) is -the temperature sensitivity for maintenance respiration, -:math:`T_{2m}` (:sup:`o`\ C) is the air temperature at 2m -height, :math:`Ts_{j}`* (:sup:`o`\ C) is the soil -temperature at level *j*, and :math:`rootfr_{j}` is the fraction -of fine roots distributed in soil level *j*. + :label: 19.39 -Note that, for woody vegetation, maintenance respiration costs are not -calculated for the dead stem and dead coarse root components. These -components are assumed to consist of dead xylem cells, with no metabolic -function. By separating the small live component of the woody tissue -(ray parenchyma, phloem, and sheathing lateral meristem cells) from the -larger fraction of dead woody tissue, it is reasonable to assume a -common base maintenance respiration rate for all live tissue types. + NF_{demand,tot} = \sum _{i=tissues} NF_{demand,i} -The total maintenance respiration cost is then given as: +and the total supply for each tissue :math: `i` is the product of the fractional demand and the total available N, calculated as the term :math: `N_{uptake}` equal to the sum of the eight N uptake streams described in the FUN model (Chapter :numref:`rst_FUN`). .. math:: - :label: 19.50 - - CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . + :label: 19.40 -13.7.2 Growth Respiration -^^^^^^^^^^^^^^^^^^^^^^^^^ + NF_{alloc,i} = N_{uptake} NF_{demand,i} / NF_{demand,tot} -Growth respiration is calculated as a factor of 0.3 times the total -carbon in new growth on a given timestep, based on construction costs -for a range of woody and non-woody tissues (Larcher, 1995). For new -carbon and nitrogen allocation that enters storage pools for subsequent -display, it is not clear what fraction of the associated growth -respiration should occur at the time of initial allocation, and what -fraction should occur later, at the time of display of new growth from -storage. Eddy covariance estimates of carbon fluxes in forest ecosystems -suggest that the growth respiration associated with transfer of -allocated carbon and nitrogen from storage into displayed tissue is not -significant (Churkina et al., 2003), and so it is assumed in CLM that -all of the growth respiration cost is incurred at the time of initial -allocation, regardless of the fraction of allocation that is displayed -immediately (i.e. regardless of the value of :math:`f_{cur}`, -section 13.5). This behavior is parameterized in such a way that if -future research suggests that some fraction of the growth respiration -cost should be incurred at the time of display from storage, a simple -parameter modification will effect the change. [1]_ -.. [1] - Parameter :math:`\text{grpnow}` in routines CNGResp and CNAllocation, currently set to 1.0, could be changed to a smaller - value to transfer some portion (1 - :math:`\text{grpnow}` ) of the growth respiration forward in time to occur at the time of growth - display from storage. diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 32d42b564c..c94c3556ef 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -276,7 +276,7 @@ Modifications to allow variation in C:N ratios -------------------------------------------------------- The original FUN model as developed by Fisher et al. (2008) and Brzostek et al. (2015) assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. **lit review on CN ratios** -Thus, in CLM5, we introduce the capacity for tissue C:N ratios to be prognostic, rather than static. Overall N and C availability (:math:`N_uptake` and :math:`C_{growth}`) and hence tissue C:N ratios, are both determined by FUN. Allocation to individual tissues is discussed in the allocation chapter +Thus, in CLM5, we introduce the capacity for tissue C:N ratios to be prognostic, rather than static. Overall N and C availability (:math:`N_{uptake}` and :math:`C_{growth}`) and hence tissue C:N ratios, are both determined by FUN. Allocation to individual tissues is discussed in the allocation chapter Here we introduce an algorithm which adjusts the C expenditure on uptake to allow varying tissue C:N ratios. Increasing C spent on uptake will directly reduce the C:N ratio, and reducing C spent on uptake (retaining more for tissue growth) will increase it. C spent on uptake is impacted by both the N cost in the environment, and the existing tissue C:N ratio of the plant. The output of this algorithm is :math:`\gamma_{FUN}`, the fraction of the ideal :math:`C_{nuptake}` calculated from the FUN equation above (**link equation**). From 476bb4ebdbff08f31ab9e2004a33b98dac1c929c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 11 Sep 2017 11:41:50 -0600 Subject: [PATCH 098/730] Update html and fix build errors --- .../CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst | 2 +- .../tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 2 +- .../Decomposition/CLM50_Tech_Note_Decomposition.rst | 2 +- .../Introduction/CLM50_Tech_Note_Introduction.rst | 8 ++++---- doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst | 2 +- .../CLM50_Tech_Note_Plant_Respiration.rst | 8 +------- 6 files changed, 9 insertions(+), 15 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 4db8909b42..50f47d92e0 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -137,7 +137,7 @@ favorable growth environments (Allen et al., 2005; Vanninen and Makela, .. table:: Allocation and target carbon\:nitrogen ratio parameters +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ - | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`Target CN_{leaf}` | :math:`Target CN_{fr}` | :math:`Target CN_{lw}` | :math:`Target CN_{dw}` | + | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`Target CN_{leaf}` | :math:`Target CN_{fr}` | :math:`Target CN_{lw}` | :math:`Target CN_{dw}` | +==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ | NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst index 9304f87634..469bc96f33 100644 --- a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -53,7 +53,7 @@ Tissue Stoichiometry ----------------------- As of CLM5, vegetation tissues have a flexible stoichiometry, as -described in :ref:`Ghimire et al. (2015) `. Each +described in :ref:`Ghimire et al. (2016) `. Each tissue has a target C\:N ratio, and nitrogen is allocated at each timestep in order to allow the plant to best match the target stoichiometry. Nitrogen downregulation of productivity acts by diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 6863012fda..4d72bd357e 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -754,7 +754,7 @@ cm\ :sup:`2`/yr. For non-permafrost soils, the default diffusivity is 1 cm\ :sup:`2`/yr. Model Equilibration and its Acceleration ---------------------------------------- +----------------------------------------- For transient experiments, it is usually assumed that the carbon cycle is starting from a point of relatively close equilibrium, i.e. that productivity is balanced by ecosystem carbon losses through diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index f71aed9712..69139a35fe 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -77,7 +77,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Schematic of land cover change` Schematic of land cover change impacts on CLM carbon pools and fluxes. -- :numref:`Figure Schematic of translation of annual UNH land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. +- :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. - :numref:`Figure Atmospheric Delta C14` Atmospheric :math:`\mathrm{\Delta}` 14C used to drive 14C model over the historical period. @@ -149,9 +149,9 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. -- :numref:`Table Crop pfts` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. +- :numref:`Table Crop plant functional types` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. -- :numref:`Table Pre- and post-grain fill CN ratios` Pre- and post-grain fill C:N ratios for crop leaf, stem, fine root, and reproductive pools. +- :numref:`Table Crop allocation parameters` Crop allocation parameters for the active crop plant functional types (pfts) in CLM5BGCCROP. Numbers in the first row correspond to the list of pfts in :numref:`Table Crop plant functional types`. - :numref:`Table Plant functional type (PFT) biogeography rules` Plant functional type (PFT) biogeography rules with respect to climate. @@ -533,7 +533,7 @@ Nitrogen for Assimilation (LUNA, :ref:`(Xu et al., 2012` and :ref:`A photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that light capture, carboxylation, and respiration are co-limiting. Allocation changes ... Fixation ??? -Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. +Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. Fertilization rates and irrigation equipped area updated based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that vary by latitude for selected crop types, grain C and N is now removed at harvest to a 1-year product pool with the carbon for the next season's crop seed removed from the grain carbon at harvest. Through the introduction of diff --git a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst index 28cf52f8a1..40b1918f46 100644 --- a/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst +++ b/doc/source/tech_note/Lake/CLM50_Tech_Note_Lake.rst @@ -139,7 +139,7 @@ for the top snow layer. Otherwise, :math:`\beta` is set equal to the near infrared fraction of the shortwave radiation reaching the surface simulated by the atmospheric model or atmospheric data model used for offline -simulations (Chapter :numref:`rst_Offline Mode`). The remainder of the shortwave radiation +simulations (Chapter :numref:`rst_Land-only Mode`). The remainder of the shortwave radiation fraction (1 :math:`{-}` :math:`\beta`) is absorbed in the lake body or soil as described in section :numref:`Radiation Penetration`. diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 7fe7be9689..c2a665d8ac 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -29,13 +29,7 @@ nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue prior to abscission and litterfall. Altogether there are 20 state variables for vegetation carbon, and 19 for vegetation nitrogen. -Figure 13.1. Vegetation fluxes and pools. - -.. image:: image1.png - :width: 800px - :height: 800px - -Figure 13.2: Carbon and nitrogen pools. +.. _Figure Carbon and nitrogen pools: .. image:: image2.png :width: 400px From e923b35211ef4f67c835608f358c7f63f03cd62b Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 5 Oct 2017 17:15:50 -0600 Subject: [PATCH 099/730] fixed a few typos in the Introduction --- .../CLM50_Tech_Note_Introduction.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index f71aed9712..b8a4d2c30f 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -505,7 +505,7 @@ Community Earth System Model version 1.2 (CESM1.2). CLM5.0 ^^^^^^^^^^^^ -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been udpated with particularly +Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop modeling. Much of the focus of development centered on a @@ -520,7 +520,7 @@ sheets. The fresh snow density parameterization is updated to more realisticall dynamically adjust landunit weights means that a glacier can initiate, grow, shrink, or disappear during a simulation when two-way coupling is active. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. -A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. +A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:`(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model (refs???) is adapted for CLM :ref:`(Shi et al., 2016)` to resolve the unrealistic feature that plants get nitrogen for free in CLM4 and CLM4.5. With FUN, the fact that plants typically spend a @@ -533,25 +533,25 @@ Nitrogen for Assimilation (LUNA, :ref:`(Xu et al., 2012` and :ref:`A photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that light capture, carboxylation, and respiration are co-limiting. Allocation changes ... Fixation ??? -Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. -Fertilization rates and irrigation equipped area updated based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that +Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016`). These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. +Fertilization rates and irrigation equipped area are updated annually based on crop type and geographic region through an input dataset. The irrigation trigger is revised. Additional minor changes include crop phenological triggers that vary by latitude for selected crop types, grain C and N is now removed at harvest to a 1-year product pool with the carbon for the next season's crop seed removed from the grain carbon at harvest. Through the introduction of the capability to dynamically adjust landunit weights during a simulation, the crop model can now be run coincidentally with prescribed land use, which significantly expands the capabilities of the model. Mass-based rather than area-based wood harvest is applied. Several heat stress indices for both urban and rural areas are calculated and output by default :ref:`(Buzan et al., 2015)`. A more sophisticated and realistic building space heating and air conditioning submodel that prognoses interior building air temperature and includes more realistic space heating and air conditioning wasteheat factors is incorporated. -The fire model is the same as utilized in CLM4.5 except that a modified scheme is used to estimate the dependence of fire occurrence and spread on fuel wetness for non-peat fires outside cropland and tropical closed forests :ref:`Li and Lawrence, 2017)` and the dependence of agricultural fires on fuel load is removed. +The fire model is the same as utilized in CLM4.5 except that a modified scheme is used to estimate the dependence of fire occurrence and spread on fuel wetness for non-peat fires outside cropland and tropical closed forests :ref:`(Li and Lawrence, 2017)` and the dependence of agricultural fires on fuel load is removed. Included with the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, :ref:`Fisher et al., 2015)`. A major motivation of this development is to allow the prediction of biome boundaries directly from plant physiological traits via their competitive interactions. The version of CLM5-FATES that is supported in this release is described here??? Short blurb on what FATES can do??? Note that the classical dynamic global vegetation model (DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. During the course of the development of CLM5.0, it became clear that the increasing complexity of the model combined with the increasing number and range of model development projects required updates to the underlying CLM infrastructure. Many such software improvements -are included in CLM5.0 including a partial transition to an object-oriented modular software structure, extraction of many hard coded model -parameters into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at +are included in CLM5.0 including a partial transition to an object-oriented modular software structure. Many hard coded model +parameters have been extracted into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at specific locations or to conduct parameter sensitivity studies. As part of the effort to increase the scientific utility of the code, in most instances older generation parameterizations (i.e., the parameterizations -available in CLM4 or CLM4.5) are retained under namelist switches, allowing the user to revert to CLM4.5 +available in CLM4 or CLM4.5) are retained under namelist switches, allowing the user to revert to CLM4.5 from the same code base or to revert individual parameterizations where the old parameterizations are compatible with the new code. Finally, multiple vertical soil layer structures are defined and it is relatively easy to add additional structures. From a6f35a5da50e3de8f986da3fb0142b31460a7295 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 12 Oct 2017 09:49:48 -0600 Subject: [PATCH 100/730] Edits to Vegetation Phenology chapter, minor edits to Intro --- .../CLM50_Tech_Note_Introduction.rst | 2 +- ...ech_Note_Vegetation_Phenology_Turnover.rst | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index daca44e404..3f5473c9bf 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -174,7 +174,7 @@ Jiafu Mao, Lei Meng, Sheri Michelson, Guo-Yue Niu, Adam Phillips, Taotao Qian, Jon Radakovich, James Randerson, Nan Rosenbloom, Steve Running, Koichi Sakaguchi, Adam Schlosser, Andrew Slater, Reto Stöckli, Ying Sun, Quinn Thomas, Peter Thornton, Mariana Vertenstein, Nicholas Viovy, Aihui Wang, Guiling Wang, -Charlie Zender, Xiaodong Zeng, and Xubin Zeng. +Zong-Liang Yang, Charlie Zender, Xiaodong Zeng, and Xubin Zeng. .. _rst_Introduction: diff --git a/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst b/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst index 251e1acfcd..7ede3405e0 100644 --- a/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst +++ b/doc/source/tech_note/Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst @@ -116,7 +116,7 @@ out of the transfer pool: r_{xfer\_ on} =\left\{\begin{array}{l} {{2\mathord{\left/ {\vphantom {2 t_{onset} }} \right. \kern-\nulldelimiterspace} t_{onset} } \qquad {\rm for\; }t_{onset} \ne \Delta t} \\ {{1\mathord{\left/ {\vphantom {1 \Delta t}} \right. \kern-\nulldelimiterspace} \Delta t} \qquad {\rm for\; }t_{onset} =\Delta t} \end{array}\right. and *t*\ :sub:`onset` (s) is the number of seconds remaining in -the current phenology onset growth period (Figure 14.1). The form of Eq. +the current phenology onset growth period (Figure 14.1). The form of Eq. :eq:`ZEqnNum852972` produces a flux from the transfer pool which declines linearly over the onset growth period, approaching zero flux in the final timestep. @@ -580,13 +580,16 @@ previous offset period), an accumulated soil water index SWI_{sum}^{n} =\left\{\begin{array}{l} {SWI_{sum}^{n-1} +f_{day} \qquad {\rm for\; }\Psi _{s,3} \ge \Psi _{onset} } \\ {SWI_{sum}^{n-1} \qquad \qquad {\rm for\; }\Psi _{s,3} <\Psi _{onset} } \end{array}\right. where :math:`\Psi`\ :sub:`s,3` is the soil water potential (MPa) -in the third soil layer and :math:`{\Psi}_{onset} = -2 MPa` +in the third soil layer and :math:`{\Psi}_{onset} = -0.6 MPa` is the onset soil water potential threshold. Onset triggering is -possible once :math:`{SWI}_{sum} > 15`. If the cold climate -growing degree-day accumulator is not active at the time when this -threshold is reached (see below), and if the daylength is greater than 6 +possible once :math:`{SWI}_{sum} > 15`. To avoid spurious onset triggering due to +soil moisture in the third soil layer exceeding the threshold due only to +soil water suction of water from deeper in the soil column, an additional precipitation trigger is included which requires +at least 20 mm of rain over the previous 10 days :ref:`(Dahlin et al., 2015) `. If the cold climate +growing degree-day accumulator is not active at the time when the soil moisture and precipitation +thresholds are reached (see below), and if the daylength is greater than 6 hours, then onset is triggered. Except as noted below, -:math:`{SWI}_{sum}` continues to accumulate according to Eq. during +:math:`{SWI}_{sum}` continues to accumulate according to Eq. :eq:`ZEqnNum503826` during the dormant period if the daylength criterion prevents onset triggering, and onset is then triggered at the timestep when daylength exceeds 6 hours. @@ -604,8 +607,8 @@ with subsequent accumulation calculated as: If :math:`{FD}_{sum} > 15` during the dormant period, then a cold-climate onset triggering criterion is introduced, following exactly -the growing degree-day summation (:math:`{GDD}_{sum}`) logic of Eqs. -and . At that time :math:`{SWI}_{sum}` is reset +the growing degree-day summation (:math:`{GDD}_{sum}`) logic of Eqs. :eq:`ZEqnNum510730` +and :eq:`ZEqnNum598907`. At that time :math:`{SWI}_{sum}` is reset (:math:`{SWI}_{sum} = 0`). Onset triggering under these conditions depends on meeting all three of the following criteria: :math:`{SWI}_{sum} > 15`, :math:`{GDD}_{sum} > {GDD}_{sum\_crit}`, and daylength greater than 6 hrs. @@ -613,8 +616,8 @@ depends on meeting all three of the following criteria: The following control variables are set when a new onset growth period is initiated: :math:`{SWI}_{sum} = 0`, :math:`{FD}_{sum} = 0`, :math:`{GDD}_{sum} = 0`, :math:`{n}_{days\_active} = 0`, and :math:`t_{onset} = 86400\cdot n_{days\_ on}` , where :math:`{n}_{days\_on}` is set to a constant value of 30 days. Fluxes -from storage into transfer pools occur in the timestep when a new onset growth period is initiated, and are handled identically to Eqs. - for -carbon fluxes, and to Eqs. - for nitrogen fluxes. The onset counter is decremented on each time step after initiation of the onset period, +from storage into transfer pools occur in the timestep when a new onset growth period is initiated, and are handled identically to Eqs. :eq:`ZEqnNum904388` -:eq:`ZEqnNum195642` for +carbon fluxes, and to Eqs. :eq:`ZEqnNum812152` - :eq:`ZEqnNum605338` for nitrogen fluxes. The onset counter is decremented on each time step after initiation of the onset period, until it reaches zero, signaling the end of the onset period: .. math:: From c663ab8c96f10f64604154ba3b34b4e76db74783 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 12 Oct 2017 16:38:36 -0600 Subject: [PATCH 101/730] Fixes for lnd <-> atm coupling fields Added atmosphere model's surface height as a required input, and 10-m wind speed as an output. Also fixed some typos. --- .../tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 10315b7d98..e21c8e05d0 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -425,6 +425,8 @@ conditions from the current time step. +======================================================+================================================+=================================================+ | :sup:`1`\ Reference height | :math:`z'_{atm}` | m | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ + | Atmosphere model's surface height | :math:`z_{surf,atm}` | m | + +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Zonal wind at :math:`z_{atm}` | :math:`u_{atm}` | m s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Meridional wind at :math:`z_{atm}` | :math:`v_{atm}` | m s\ :sup:`-1` | @@ -451,7 +453,7 @@ conditions from the current time step. +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | Incident diffuse near-infrared solar radiation | :math:`S_{atm} \, \downarrow _{nir}` | W m\ :sup:`-2` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ - | Carbon dioxide (CO:sub:`2`) concentration | :math:`c_{a}` | ppmv | + | Carbon dioxide (CO\ :sub:`2`) concentration | :math:`c_{a}` | ppmv | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ | :sup:`3`\ Aerosol deposition rate | :math:`D_{sp}` | kg m\ :sup:`-2` s\ :sup:`-1` | +------------------------------------------------------+------------------------------------------------+-------------------------------------------------+ @@ -471,7 +473,7 @@ reference heights for temperature, wind, and specific humidity :math:`z_{atm,\, w}` ) are required. These are set equal to\ :math:`z_{atm}` . -:sup:`2`\ The placeCAM provides convective and large-scale liquid +:sup:`2`\ CAM provides convective and large-scale liquid and solid precipitation, which are added to yield total liquid precipitation :math:`q_{rain}` and solid precipitation :math:`q_{sno}` . @@ -566,6 +568,8 @@ calculated from molar ratio and the atmospheric pressure +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Specific humidity at 2 meter height | :math:`q_{2m}` | kg kg\ :sup:`-1` | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ + | Wind speed at 10 meter height | :math:`u_{10m}` | m s\ :sup:`-1` | + +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Snow water equivalent | :math:`W_{sno}` | m | +---------------------------------------+------------------------------------------------+--------------------------------------------------------------+ | Aerodynamic resistance | :math:`r_{am}` | s m\ :sup:`-1` | From 429985bf7716e1ecd287b0c206da98f38d3d5743 Mon Sep 17 00:00:00 2001 From: Charlie Koven Date: Fri, 10 Nov 2017 15:46:37 -0800 Subject: [PATCH 102/730] made some changes to the Allocation Chapter --- .../CLM50_Tech_Note_CN_Allocation.rst | 38 ++++++++----------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 50f47d92e0..37d3f0a10f 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -3,6 +3,13 @@ Carbon and Nitrogen Allocation ============================== +Summary of CLM5.0 updates relative to the CLM4.5 +----------------------------------------------------- +- CLM5 now defaults to a static allocation to woody biomass rather than the dynamic allocation term used in CLM4.5. The dynamic allocation is stil lkept as an option, for details, see the CLM4.5 Tech Note. + + - CLM5 now includes flexible C:N ratios of all plant tissues, which allows allocation of carbon to occur separately from allocation of nitrogen, thus removing the requirement to downregulate photosynthesis based on the instantaneous stoichiometric needs of allocation. + + Introduction ----------------- @@ -13,19 +20,19 @@ and available mineral nitrogen, coming from plant uptake of mineral nitrogen in the soil or being drawn out of plant reserves. A significant change to CLM5 relative to prior versions is that allocation of carbon and nitrogen proceed independently rather than in a sequential manner. -Carbon Allocation for Maintenance Respiration Costs --------------------------------------------------------- +Carbon Allocation to Cover Prior-Timestep Maintenance Respiration Costs +---------------------------------------------------------------------------- Allocation of available carbon on each time step is prioritized, with first priority given to the demand for carbon to support maintenance -respiration of live tissues (section 13.7). Second priority is to -replenish the internal plant carbon pool that supports maintenance -respiration during times when maintenance respiration exceeds +respiration of live tissues (Chapter :numref:`rst_Plant Respiration`) and Nitrogen acquisition costs (Chapter :numref:`rst_FUN`). Second priority is to +replenish the plant carbon deficit pool that balances maintenance +respiration that occurs during times when maintenance respiration exceeds photosynthesis (e.g. at night, during winter for perennial vegetation, or during periods of drought stress) (Sprugel et al., 1995). Third priority is to support growth of new tissues, including allocation to storage pools from which new growth will be displayed in subsequent time -steps. +steps, as well as growth respiration costs. The total maintenance respiration demand (:math:`CF_{mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of @@ -116,21 +123,6 @@ Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined as consta constant for all PFTs, based on construction costs for a range of woody and non-woody tissues (Larcher, 1995). -The model includes a dynamic allocation scheme for woody vegetation -(parameter :math:`a_{3}` = -1, :numref:`Table Allocation and CN ratio parameters`), in which case the -ratio for carbon allocation between new stem and new leaf increases with -increasing net primary production (NPP), as - -.. math:: - :label: 19.8 - - a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 - -where :math:`NPP_{ann}` is the annual sum of NPP from the previous -year. This mechanism has the effect of increasing woody allocation in -favorable growth environments (Allen et al., 2005; Vanninen and Makela, -2005) and during the phase of stand growth prior to canopy closure -(Axelsson and Axelsson, 1986). .. _Table Allocation and CN ratio parameters: @@ -382,14 +374,14 @@ The demand for each tissue, calculated for the tissue to remain on stoichiometry NF_{demand,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). -After each pool's demand is calculated, the total plant N demand is then the sum of each individual pool :math: `i` corresponding to each tissue: +After each pool's demand is calculated, the total plant N demand is then the sum of each individual pool :math:`i` corresponding to each tissue: .. math:: :label: 19.39 NF_{demand,tot} = \sum _{i=tissues} NF_{demand,i} -and the total supply for each tissue :math: `i` is the product of the fractional demand and the total available N, calculated as the term :math: `N_{uptake}` equal to the sum of the eight N uptake streams described in the FUN model (Chapter :numref:`rst_FUN`). +and the total supply for each tissue :math:`i` is the product of the fractional demand and the total available N, calculated as the term :math:`N_{uptake}` equal to the sum of the eight N uptake streams described in the FUN model (Chapter :numref:`rst_FUN`). .. math:: :label: 19.40 From 8226193dd1dbba312165b4097d020379455a90c3 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 14 Nov 2017 09:41:39 -0700 Subject: [PATCH 103/730] Updates to Carbon isotopes chapter --- .../CLM50_Tech_Note_Introduction.rst | 2 - .../Isotopes/CLM50_Tech_Note_Isotopes.rst | 60 +++++-------------- .../References/CLM50_Tech_Note_References.rst | 26 +------- 3 files changed, 18 insertions(+), 70 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 3f5473c9bf..69ad12b91f 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -79,8 +79,6 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. -- :numref:`Figure Atmospheric Delta C14` Atmospheric :math:`\mathrm{\Delta}` 14C used to drive 14C model over the historical period. - **LIST OF TABLES** - :numref:`Table Plant functional types` Plant functional types diff --git a/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst b/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst index 093b7d7a37..43692205b8 100644 --- a/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst +++ b/doc/source/tech_note/Isotopes/CLM50_Tech_Note_Isotopes.rst @@ -22,13 +22,13 @@ General Form for Calculating :sup:`13`\ C and :sup:`14`\ C Flux -------------------------------------------------------------------------------- In general, the flux of :sup:`13`\ C and corresponding to a given -flux of total C (*CF\ :math:`{}_{13C}`* and *CF\ :math:`{}_{totC}`*, -respectively) is determined by *CF\ :math:`{}_{totC}`*, the masses of +flux of total C (:math:`{CF}_{13C}` and :math:`{CF}_{totC}`, +respectively) is determined by :math:`{CF}_{totC}`, the masses of :sup:`13`\ C and total C in the upstream pools -(*CS\ :math:`{}_{13C\_up}`* and *CS\ :math:`{}_{totC\_up}`*, +(:math:`{CS}_{13C\_up}` and :math:`{CS}_{totC\_up}`, respectively, i.e. the pools *from which* the fluxes of :sup:`13`\ C and total C originate), and a fractionation factor, -*f\ :math:`{}_{frac}`*: +:math:`{f}_{frac}`: .. math:: :label: ZEqnNum629812 @@ -36,7 +36,7 @@ respectively, i.e. the pools *from which* the fluxes of CF_{13C} =\left\{\begin{array}{l} {CF_{totC} \frac{CS_{13C\_ up} }{CS_{totC\_ up} } f_{frac} \qquad {\rm for\; }CS_{totC} \ne 0} \\ {0\qquad {\rm for\; }CS_{totC} =0} \end{array}\right\} If the :math:`{f}_{frac}` = 1.0 (no fractionation), then the fluxes -:math:`{CF}_{13C}` and :math:`{CF}_{totC}`* will be in simple +:math:`{CF}_{13C}` and :math:`{CF}_{totC}` will be in simple proportion to the masses :math:`{CS}_{13C\_up}` and :math:`{CS}_{totC\_up}`. Values of :math:`{f}_{frac} < 1.0` indicate a discrimination against the heavier isotope (:sup:`13`\ C) in the flux-generating process, while @@ -55,8 +55,8 @@ described in units that implicitly correct out the fractionation of Isotope Symbols, Units, and Reference Standards ---------------------------------------------------- -Carbon has two primary stable isotopes, :math:`{}^{12}`\ C and -:sup:`13`\ C. :math:`{}^{12}`\ C is the most abundant, comprising +Carbon has two primary stable isotopes, :sup:`12`\ C and +:sup:`13`\ C. :sup:`12`\ C is the most abundant, comprising about 99% of all carbon. The isotope ratio of a compound, :math:`{R}_{A}`, is the mass ratio of the rare isotope to the abundant isotope @@ -133,7 +133,7 @@ Carbon Isotope Discrimination During Photosynthesis Photosynthesis is modeled in CLM as a two-step process: diffusion of CO\ :sub:`2` into the stomatal cavity, followed by enzymatic -fixation (Chapter 8). Each step is associated with a kinetic isotope +fixation (Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`). Each step is associated with a kinetic isotope effect. The kinetic isotope effect during diffusion of CO\ :sub:`2` through the stomatal opening is 4.4‰. The kinetic isotope effect during fixation of CO\ :sub:`2` with Rubisco is @@ -173,39 +173,17 @@ calculation as follows: c_{i} =pCO_{2} -a_{n} p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } -and - -.. math:: - :label: 30.11) - - c_{i}^{*} =pCO_{2} -a_{n} \left(1-d\right)p\frac{\left(1.4g_{s} \right)+\left(1.6g_{b} \right)}{g_{b} g_{s} } - -where :math:`a_n` is net carbon assimilation during photosynthesis, -:math:`d` is downscaling factor due to nitrogen limitation, :math:`p` is +where :math:`a_n` is net carbon assimilation during photosynthesis, :math:`p` is atmospheric pressure, :math:`g_b` is leaf boundary layer conductance, and :math:`g_s` is leaf stomatal conductance. -The fractionation factor :math:`{\alpha }_{psn}` and net assimilation -:math:`a_n` are calculated during the radiation time-step in -CanopyFluxesMod.F90, whereas the downscaling factor :math:`d` is not -calculated until after the nitrogen limitation is computed in -CNAllocationMod.F90. That results in a difference between the actual -photosynthesis, which is downscaled by :math:`d`, and the potential -photosynthesis. In order to overcome this mismatch, downscaling due to -nitrogen limitation is factored in the calculation of the kinetic -isotope effect during fixation by defining a downscaled version of -intracellular CO\ :sub:`2` (:math:`c^*_i`), as a first order -approximation. However, since nitrogen down-regulation is calculated -after the photosynthesis calculation, down-regulation coefficient -calculated in the previous time step needs to be used. - Isotopic fractionation code is compatible with multi-layered canopy parameterization; i.e., it is possible to calculate varying discrimination rates for each layer of a multi-layered canopy. However, as with the rest of the photosynthesis model, the number of canopy layers is currently set to one by default. -:sup:`14`\ C radioactive decay and historical atmospheric :sup:`14`\ C concentrations +:sup:`14`\ C radioactive decay and historical atmospheric :sup:`14`\ C and :sup:`13`\ C concentrations ------------------------------------------------------------------------------------------------------ In the preindustrial biosphere, radioactive decay of :sup:`14`\ C @@ -226,18 +204,10 @@ accelerated by the same degree as the decomposition, such that the :sup:`14`\ C value of these pools is in equilibrium when taken out of the spinup mode. -For variation of atmospheric :sup:`14`\ C over the historical -period, :math:`\mathrm{\Delta}`\ :sup:`14`\ C values can be set to -either fixed concentration (:math:`\mathrm{\Delta}`\ :sup:`14`\ C = 0‰) -or time-varying concentrations read in from a file. A default file -is provided that is based on a spline fit through several observational -datasets spanning the 20\ :math:`{}^{th}` century: (Levin and Kromer, -2004; Manning and Melhuish, 1994; Nydal and Lövseth, 1996; Turnbull et -al. 2007). This is shown in Figure 25.1. - -.. _Figure Atmospheric Delta C14: +For variation of atmospheric :sup:`14`\ C and :sup:`13`\ C over the historical +period, :math:`\mathrm{\Delta}`\ :sup:`14`\ C and :math:`\mathrm{\Delta}`\:sup:`13`\ C values can be set to +either fixed concentrations +or time-varying concentrations read in from a file. A default file is provided that spans the historical period (:ref:`Graven et al., 2017 `). For +:math:`\mathrm{\Delta}`\ :sup:`14`\ C, values are provided and read in for three latitude bands (30 :sup:`o`\ N-90 :sup:`o`\ N, 30 :sup:`o`\ S-30 :sup:`o`\ N, and 30 :sup:`o`\ S-90 :sup:`o`\ S). -.. figure:: image1.png - Atmospheric :math:`\mathrm{\Delta}`\ :sup:`14`\ C - used to drive :sup:`14`\ C model over the historical period. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index d7a5887778..048fa076c0 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -615,6 +615,9 @@ Graham, S.T., Famiglietti, J.S., and Maidment, D.R. 1999. Five-minute, use in regional and global hydrologic and climate system modeling studies. Water Resour. Res. 35:583-587. +.. _Gravenetal2017: + +Graven, H., C. E. Allison, D. M. Etheridge, S. Hammer, R. F. Keeling, I. Levin, H. A. J. Meijer, M. Rubino, P. P. Tans, C. M. Trudinger, B. H. Vaughn and J. W. C. White (2017) Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geoscientific Model Development, in review. doi: 10.5194/gmd-2017-166. .. _GrenfellWarren1999: Grenfell, T.C., and Warren, S.G. 1999. Representation of a nonspherical @@ -1032,11 +1035,6 @@ Letts, M.G., Roulet, N.T., Comer, N.T., Skarupa, M.R., and Verseghy, D.L. 2000. Parametrization of peatland hydraulic properties for the Canadian Land Surface Scheme. Atmos.-Ocean 38:141-160. -.. _LevinKromer2004: - -Levin, I. and Kromer, B. 2004. The tropospheric 14CO2 level in -mid-latitudes of the Northern Hemisphere (1959-2003) Radiocarbon 46:1. - .. _Levisetal2003: Levis, S., Wiedinmyer, C., Bonan, G.B., and Guenther, A. 2003. @@ -1203,12 +1201,6 @@ DOI:10.1029/2005JD006653. Makela, A. 2002. Derivation of stem taper from the pipe model theory in a carbon balance framework. Tree Phys. 22:891-905. -.. _Manning, M.R. and Melhuish, W.H. 1994. Trends: A Compendium of Data on - -Manning, M.R. and Melhuish, W.H. 1994. Trends: A Compendium of Data on -Global Change. Carbon Dioxide Information Analysis Center,. Oak Ridge -National Laboratory, U.S. Department of Energy, Oak Ridge, Tenn., U.S.A. - .. _Maoetal2012: Mao, J., Thornton, P.E., Shi, X., Zhao, M., and Post, W.M. 2012. Remote @@ -1337,12 +1329,6 @@ Niu, G.-Y., and Yang, Z.-L. 2007. An observation-based formulation of snow cover fraction and its evaluation over large North American river basins. J. Geophys. Res. 112:D21101. DOI:10.1029/2007JD008674. -.. _NydalLovseth1996: - -Nydal, R. and Lövseth, K. 1996. Carbon-14 Measurements In Atmospheric -CO2 From Northern And Southern Hemisphere Sites, 1962-1993, Carbon -Dioxide Information Analysis Center. - .. _Oikawaetal2005: Oikawa, S., Hikosaka, K. and Hirose, T., 2005. Dynamics of leaf area and @@ -1974,12 +1960,6 @@ burn area in western Canadian peatlands and its relationship to fire weather indices. Global Biogeochem. Cycles 18:GB4014. DOI:10.1029/2004GB002222. -.. _Turnbulletal2007: - -Turnbull, J.C. et al. 2007. A new high precision (CO2)-C-14 time series -for North American continental air. Journal of Geophysical -Research-Atmospheres 112(D11). - .. _Tyeetal2005: Tye, A.M., et al. 2005. The fate of N-15 added to high Arctic tundra to From 0c52f7524498e6031b6bfe1e86b66a40371c3628 Mon Sep 17 00:00:00 2001 From: William Wieder Date: Fri, 17 Nov 2017 11:07:58 -0700 Subject: [PATCH 104/730] updated External N cycle, Plant Respiration, refs --- ...LM50_Tech_Note_External_Nitrogen_Cycle.rst | 325 +++++++----------- .../CLM50_Tech_Note_Plant_Respiration.rst | 112 +++--- .../References/CLM50_Tech_Note_References.rst | 20 +- 3 files changed, 182 insertions(+), 275 deletions(-) diff --git a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst index 69959b0a8c..6a4ff5479d 100644 --- a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst @@ -3,8 +3,26 @@ External Nitrogen Cycle =========================== +.. _Summary of CLM5.0 updates relative to the CLM4.5: + +Summary of CLM5.0 updates relative to the CLM4.5 +----------------------------------------------------- + +We describe external inputs to the nitrogen cycle in CLM5.0.  Much of the following information appeared in the CLM4.5 Technical Note (:ref:`Oleson et al. 2013 `) as well as :ref:`Koven et al. (2013) `. + +CLM5.0 includes the following changes to terrestrial nitrogen inputs: + +- Time varrying deposition of reactive nitrogen. In off-line runs this changes monthly. In coupled simulations N deposition is passed at the coupling timestep (e.g., half-hourly). + +- Asymbiotic (or free living) N fixation is a function of evapotranspiration and is added to the inorganic nitrogen (NH\ :sub:`4`\ :sup:`+`) pool (described below). + +- Symbiotic N fixation is handled by the FUN model (chapter :numref:`rst_FUN`) and is passed straight to the plant, not the mineral nitrogen pool. + +Overview +----------------------------------------------------- + In addition to the relatively rapid cycling of nitrogen within the plant -– litter – soil organic matter system, CLM also represents several slow +– litter – soil organic matter system, CLM also represents several processes which couple the internal nitrogen cycle to external sources and sinks. Inputs of new mineral nitrogen are from atmospheric deposition and biological nitrogen fixation. Losses of mineral nitrogen @@ -12,19 +30,12 @@ are due to nitrification, denitrification, leaching, and losses in fire. While the short-term dynamics of nitrogen limitation depend on the behavior of the internal nitrogen cycle, establishment of total ecosystem nitrogen stocks depends on the balance between sources and -sinks in the external nitrogen cycle. - -CLM includes two separate treatments of the slow nitrogen cycle. The -first is the original CLM-CN formulations, which includes a single soil -mineral nitrogen pool to represent both -NO\ :sub:`3`\ :sup:`-` and NH\ :sub:`4`\ :sup:`+`, and with nitrogen losses via -denitrification calculated as a constant fraction of mineralization plus -a fixed first-order loss of unutilized mineral nitrogen at the end of -every timestep. The second is based on the Century N-gas model; this +sinks in the external nitrogen cycle (:ref:`Thomas et al. 2015 `). + +As with CLM4.5, CLM5.0 represents inorganic N transformations based on the Century N-gas model; this includes separate NH\ :sub:`4`\ :sup:`+` and NO\ :sub:`3`\ :sup:`-` pools, as well as -environmentally controlled nitrification and denitrification rates. Both -are described below. +environmentally controlled nitrification and denitrification rates that is described below. Atmospheric Nitrogen Deposition ------------------------------------ @@ -32,7 +43,8 @@ Atmospheric Nitrogen Deposition CLM uses a single variable to represent the total deposition of mineral nitrogen onto the land surface, combining wet and dry deposition of NO\ :sub:`y` and NH\ :sub:`x` as a single flux -(:math:`{NF}_{ndep\_sminn}`, gN m\ :sup:`-2` s\ :sup:`-1`). This flux is intended to represent total reactive +(:math:`{NF}_{ndep\_sminn}`, gN m\ :sup:`-2` s\ :sup:`-1`). This flux +is intended to represent total reactive nitrogen deposited to the land surface which originates from the following natural and anthropogenic sources (Galloway et al. 2004): formation of NO\ :sub:`x` during lightning, @@ -49,18 +61,25 @@ agricultural soils, NH\ :sub:`3` emission from agricultural crops, NH\ :sub:`3` emission from agricultural animal waste, and NH\ :sub:`3` emission from human waste and waste water. The deposition flux is provided as a spatially and (potentially) temporally -varying dataset (see section 2.2.3 for a description of the default +varying dataset (see section :numref:`Atmospheric Coupling` for a description of the default input dataset). -In the CLM-CN mineral N pool model, the nitrogen deposition flux is -assumed to enter the soil mineral nitrogen pool -(:math:`{NS}_{sminn}`) directly; while in the Century-based model, -all of the nitrogen is assumed to enter the -NH\ :sub:`4`\ :sup:`+` pool. Real pathways for wet and dry +The nitrogen deposition flux is assumed to enter the NH\ :sub:`4`\ :sup:`+` pool, +and is vertically distributed throughout the soil profile. Although N deposition +inputs include both oxidized and reduced forms, CLM5 only reads in total +N deposition. This approach is held over from CLM4.0, which only represented a +single mineral nitrogen pool, however, real pathways for wet and dry nitrogen deposition can be more complex than currently represented in -the CLM-CN, including release from melting snowpack and direct foliar -uptake of deposited NO\ :sub:`y` (e.g. Tye et al. 2005; Vallano -and Sparks, 2007). +the CLM5.0, including release from melting snowpack and direct foliar +uptake of deposited NO\ :sub:`y` (:ref:`Tye et al. 2005 `; +:ref:`Vallano and Sparks, 2007 `). + +In offline (uncoupled) CLM5.0 simulations monthly +estimates of N deposition are provided, as opposed to decadal files +supplied with previous versions of the model. In coupled simulations, +N depositions fluxes are passed to the land model at the frequency of +the time step (every half hour) through the coupler. + Biological Nitrogen Fixation --------------------------------- @@ -69,56 +88,53 @@ The fixation of new reactive nitrogen from atmospheric N\ :sub:`2` by soil microorganisms is an important component of both preindustrial and modern-day nitrogen budgets, but a mechanistic understanding of global-scale controls on biological nitrogen fixation (BNF) is still -only poorly developed (Cleveland et al. 1999; Galloway et al. 2004). -Cleveland et al. (1999) suggested empirical relationships that predict -BNF as a function of either evapotranspiration rate or net primary -productivity for natural vegetation. CLM assumes that BNF is a function -of net primary production (:math:`{CF}_{ann\_NPP}`, gC m\ :sup:`-2` y\ :sup:`-1`). The rationale for choosing net -primary production over evapotranspiration as the predictor is that the -two are well-correlated (Parton et al. 1993; Running et al. 1989), and -the use of primary production also introduces a known dependence of BNF -on the carbon supply to nitrogen fixing microorganisms (Cleveland et al. -1999). The expression used is: +only poorly developed (:ref:`Cleveland et al. 1999 `; +:ref:`Galloway et al. 2004 `). CLM5.0 uses the FUN +model (chapter :numref:`rst_FUN`) to +calculate the carbon cost and nitrogen acquired through symbotic +nitrogen fixation. This nitrogen is immediately available to plants. + +:ref:`Cleveland et al. (1999) ` suggested +an empirical relationships that predicts BNF as a function of +either evapotranspiration rate or net primary productivity for +natural vegetation. CLM5.0 adopts the evapotranspiration approach +to calculate asymbiotic, or free-living, N fixation. This function +has been modified from the :ref:`Cleveland et al. (1999) +` estimates to provide lower estimate of +free-living nitrogen fixation in CLM5.0 +(:math:`{CF}_{ann\_ET}`, mm yr\ :sup:`-1`). +This moves away from the NPP approach used in CLM4.0 and 4.5 and +avoids unrealistically increasing freeliving rates of N fixation +under global change scenarios (:ref:`Wieder et al. 2015 +` The expression used is: .. math:: - :label: ZEqnNum802819: + :label: 22.1) - NF_{nfix,sminn} ={1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right)\mathord{\left/ {\vphantom {1.8\left(1-\exp \left(-0.003{\kern 1pt} CF_{ann\_ NPP} \right)\right) \left(86400\cdot 365\right)}} \right. \kern-\nulldelimiterspace} \left(86400\cdot 365\right)} + NF_{nfix,sminn} ={0.0006\left(0.0117+CF_{ann\_ ET}\right)\mathord{\left/ {\vphantom {0.0006\left(0.0117+ CF_{ann\_ ET}\right) \left(86400\cdot 365\right)}} \right. \kern-\nulldelimiterspace} \left(86400\cdot 365\right)} + +Where :math:`{NF}_{nfix,sminn}` (gN m\ :sup:`-2` s\ :sup:`-1`) is the rate of free-living nitrogen fixation in :numref:`Figure Biological nitrogen fixation`. -where :math:`{NF}_{nfix,sminn}` (gN m\ :sup:`-2` s\ :sup:`-1`) is the rate of BNF. Eq. is plotted over a range of -annual NPP in Figure 16.1. .. _Figure Biological nitrogen fixation: .. figure:: image1.png - Biological nitrogen fixation as a function of annual net - primary production. - -Because of the empirical nature of this NPP-BNF relationship, the -timescale for calculating NPP and thus BNF is unconstrained. Using -annual NPP, as in CLM4.0, introduces an error at high latitudes because -the aseasonal BNF inputs mean that much of the nitrogen is added when -the vegetation is dormant and may be lost before it is ever taken up by -vegetation. Thus an option was added to CLM to allow for an exponential -relaxation (with default e-folding time of 10 days) calculation of NPP, -and BNF calculated from that using equation 16.1. - -As with Atmospheric N deposition, BNF N inputs are added directly to the -mineral N pools. In the CLM-CN N model, this is the single mineral N -pool; in the Century-based model, this is the + Free-living nitrogen fixation as a function of annual evapotranspiration. Results here show annual N inputs from free-living N fixations, but the model actually calculates inputs on a per second basis. + +As with Atmospheric N deposition, free-living N inputs are added directly to the NH\ :sub:`4`\ :sup:`+` pool. Nitrification and Denitrification Losses of Nitrogen --------------------------------------------------------- -In order to better understand the structural uncertainty in -biogeochemical responses to climate change, CLM includes two alternate -representations of the mineral N transformations and losses that define -the slow N cycle. Each of these is described below. - -16.3.1 CLM-CN formulation -^^^^^^^^^^^^^^^^^^^^^^^^^ +Nitrification is an autotrophic process that converts less mobile ammonium +ions into nitrate, that can more easily be lost from soil systems by leaching +or denitrification. The process catalyzed by ammonia oxidizing archaea and +bacteria that convert ammonium (NH\ :sub:`4`\ :sup:`+`) into nitrite, which +is subsequently oxidized into nitrate (NO\ :sub:`3`\ :sup:`-`). Conditions +favoring nitrification include high NH\ :sub:`4`\ :sup:`+` concentrations, +well aerated soils, a neutral pH and warmer temperatures. Under aerobic conditions in the soil oxygen is the preferred electron acceptor supporting the metabolism of heterotrophs, but anaerobic @@ -127,153 +143,59 @@ an electron acceptor (e.g. *Pseudomonas* and *Clostridium*) supporting respiration. This process, known as denitrification, results in the transformation of nitrate to gaseous N\ :sub:`2`, with smaller associated production of NO\ :sub:`x` and N\ :sub:`2`\ O. It -is typically assumed that nitrogen fixation and denitrification were -approximately balanced in the preindustrial biosphere (Galloway et al. -2004). It is likely that denitrification can occur within anaerobic +is typically assumed that nitrogen fixation and denitrification +were approximately balanced in the preindustrial biosphere ( +:ref:`Galloway et al. 2004 `). It is likely +that denitrification can occur within anaerobic microsites within an otherwise aerobic soil environment, leading to large global denitrification fluxes even when fluxes per unit area are -rather low (Galloway et al. 2004). - -Because the vertical distribution of soil organic matter is not resolved -explicitly in CLM-CN, a simple denitrification parameterization is used -that treats denitrification as a constant fraction of gross nitrogen -mineralization. At each step in the decomposition cascade, if the -transformation from an upstream to a downstream pool is predicted to -mineralize (as opposed to immobilize) nitrogen, then a constant fraction -of the nitrogen mineralization flux is assumed to be lost via -denitrification. Due to large uncertainties in the mechanistic -understanding of the environmental controls on denitrification, no -modifications to the denitrification fraction are made for different -soil moisture conditions. This is identified as a high-priority area for -future model development. - -Denitrification fluxes associated with gross mineralization in the -decomposition cascade are calculated as follows: - -.. math:: - :label: 22.2) - - NF_{denit,Lit1\to SOM1} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} >0} \\ {-NF_{pot\_ min,Lit1\to SOM1} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit1\to SOM1} \le 0} \end{array}\right. - -.. math:: - :label: 22.3) - - NF_{denit,Lit2\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} >0} \\ {-NF_{pot\_ min,Lit2\to SOM2} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit2\to SOM2} \le 0} \end{array}\right. - -.. math:: - :label: 22.4) - - NF_{denit,Lit3\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} >0} \\ {-NF_{pot\_ min,Lit3\to SOM3} {\kern 1pt} f_{denit} \qquad \qquad {\rm for\; }NF_{pot\_ min,Lit3\to SOM3} \le 0} \end{array}\right. - -.. math:: - :label: 22.5) - - NF_{denit,SOM1\to SOM2} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} >0} \\ {-NF_{pot\_ min,SOM1\to SOM2} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM1\to SOM2} \le 0} \end{array}\right. - -.. math:: - :label: 22.6) - - NF_{denit,SOM2\to SOM3} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} >0} \\ {-NF_{pot\_ min,SOM2\to SOM3} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM2\to SOM3} \le 0} \end{array}\right. - -.. math:: - :label: 22.7) - - NF_{denit,SOM3\to SOM4} =\left\{\begin{array}{l} {0\qquad \qquad \qquad \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} >0} \\ {-NF_{pot\_ min,SOM3\to SOM4} {\kern 1pt} f_{denit} \qquad {\rm for\; }NF_{pot\_ min,SOM3\to SOM4} \le 0} \end{array}\right. - -.. math:: - :label: 22.8) - - NF_{denit,SOM4} =-NF_{pot\_ min,SOM4} - -where :math:`{f}_{denit} = 0.01` is the constant denitrification -fraction of gross mineralization, and the denitrification fluxes are -assumed to be leaving the soil mineral nitrogen pool -(:math:`{NS}_{sminn}`) and entering the atmosphere. The speciation -of gaseous nitrogen fluxes entering the atmosphere (e.g. -N\ :sub:`2` vs. NO\ :sub:`x` or N\ :sub:`2`\ O) is not -specified. Providing an explicit speciation of these nitrogen losses is -another high-priority area for future model development. - -The model includes one other denitrification pathway, intended to -represent the observed losses of mineral nitrogen in systems -experiencing nitrogen saturation. One reason this mechanism has been -included is in anticipation of an agricultural fertilization flux, -provided either through a prescribed dataset or through a prognostic -agricultural management routine. The model does not currently include an -explicit representation of the fertilization flux, but when it is -introduced, it will be necessary to account for the substantial -denitrification losses associated with high nitrate concentrations in -some heavily fertilized agricultural soils. Nitrogen saturation can also -occur in natural vegetation systems, especially under conditions of high -atmospheric nitrogen deposition, and so this mechanism plays a useful -role even prior to the introduction within the model of agricultural -fertilization. - -For the purpose of this calculation, nitrogen saturation is evaluated on -each timestep, by comparing the total demand for new mineral nitrogen -from plants and immobilization with the available soil mineral nitrogen -pool. The denitrification of excess soil mineral nitrogen is non-zero -whenever the supply of mineral nitrogen exceeds the demand: - -.. math:: - :label: 22.9) - - NF_{sminn,denit} =\left\{\begin{array}{l} {\left(\frac{NS_{sminn} }{\Delta t} \right)-NF_{total\_ demand} f_{dnx} \qquad {\rm for\; }NF_{total\_ demand} \Delta t`). CLM includes a detailed representation of nitrification and -denitrification based on the Century N model (Parton et al. 1996, 2001; -del Grosso et al. 2000). In this approach, nitrification of -NH\ :sub:`4`\ :sup:`+` to NO\ :sub:`3`\ :sup:`-`` +denitrification based on the Century N model (:ref:`Parton +et al. 1996 `, :ref:`2001 `; +:ref:`del Grosso et al. 2000 `). In this +approach, nitrification of NH\ :sub:`4`\ :sup:`+` to NO\ :sub:`3`\ :sup:`-` is a function of temperature, moisture, and pH: .. math:: - :label: 22.11) + :label: 22.2) f_{nitr,p} =\left[NH_{4} \right]k_{nitr} f\left(T\right)f\left(H_{2} O\right)f\left(pH\right) where :math:`{f}_{nitr,p}` is the potential nitrification rate (prior to competition for NH\ :sub:`4`\ :sup:`+` by plant uptake and N immobilization), :math:`{k}_{nitr}` is the maximum -nitrification rate (10 % day\ :math:`\mathrm{-}`\ 1, (Parton et al. -2001)), and *f(T)* and *f(H\)*\ :sub:`2`\ O) are rate modifiers for -temperature and moisture content. CLM uses the same rate modifiers as -are used in the decomposition routine. *f(pH)* is a rate modifier for -pH; however, because CLM does not calculate pH, instead a fixed pH value -of 6.5 is used in the pH function of Parton et al. (1996). +nitrification rate (10 % day\ :math:`\mathrm{-}`\ 1, +(:ref:`Parton et al. 2001 `), and *f(T)* and +*f(H\)*\ :sub:`2`\ O) are rate modifiers for temperature and +moisture content. CLM uses the same rate modifiers as +are used in the decomposition routine. *f(pH)* is a rate +modifier for pH; however, because CLM does not calculate pH, +instead a fixed pH value of 6.5 is used in the pH function of +:ref:`Parton et al. (1996) `. The potential denitrification rate is co-limited by NO\ :sup:`-3` concentration and C consumption rates, and occurs only in the anoxic fraction of soils: .. math:: - :label: 22.12) + :label: 22.3) f_{denitr,p} =\min \left(f(decomp),f\left(\left[NO_{3} ^{-} \right]\right)\right)frac_{anox} where :math:`{f}_{denitr,p}` is the potential denitrification rate and *f(decomp)* and *f([NO*\ :sub:`3`\ :sup:`-` *])* are the carbon- and nitrate- limited denitrification rate functions, -respectively, (del Grosso et al. 2000). Because the modified CLM -includes explicit treatment of soil biogeochemical vertical profiles, -including diffusion of the trace gases O\ :sub:`2` and -CH\ :sub:`4` (Riley et al. 2011a), the calculation of anoxic -fraction :math:`{frac}_{anox}` uses this information following the -anoxic microsite formulation of Arah and Vinten (1995): +respectively, (:ref:`del Grosso et al. 2000 `). +Because the modified CLM includes explicit treatment of soil +biogeochemical vertical profiles, including diffusion of the trace +gases O\ :sub:`2` and CH\ :sub:`4` (:ref:`Riley et al. 2011a +`), the calculation of anoxic fraction :math:`{frac}_{anox}` +uses this information following the anoxic microsite formulation +of :ref:`Arah and Vinten (1995) `. .. math:: - :label: 22.13) + :label: 22.4) frac_{anox} =\exp \left(-aR_{\psi }^{-\alpha } V^{-\beta } C^{\gamma } \left[\theta +\chi \varepsilon \right]^{\delta } \right) @@ -283,20 +205,21 @@ radius of a typical pore space at moisture content :math:`\psi`, *V* is the O\ :sub:`2` consumption rate, *C* is the O\ :sub:`2` concentration, :math:`\theta` is the water-filled pore space, :math:`\chi` is the ratio of diffusivity of oxygen in water to that in -air, and :math:`\epsilon` is the air-filled pore space (Arah and -Vinten, 1995). These parameters are all calculated separately at each +air, and :math:`\epsilon` is the air-filled pore space (:ref:`Arah and +Vinten (1995) `). These parameters are all calculated +separately at each layer to define a profile of anoxic porespace fraction in the soil. The nitrification/denitrification models used here also predict fluxes -of N\ :sub:`2`\ O via a “hole-in-the-pipe†approach (Firestone and -Davidson, 1989). A constant fraction (6 \* 10\ :math:`{}^{-4}`, Li et -al. 2000) of the nitrification flux is assumed to be -N\ :sub:`2`\ O, while the fraction of denitrification going to -N\ :sub:`2`\ O, P\ :math:`{P}_{N2:N2O}`, is variable, following -the Century (del Grosso et al. 2000) approach: +of N\ :sub:`2`\ O via a “hole-in-the-pipe†approach (:ref:`Firestone and +Davidson, 1989 `). A constant fraction +(6 \* 10\ :math:`{}^{-4}`, :ref:`Li et al. 2000 `) of the +nitrification flux is assumed to be N\ :sub:`2`\ O, while the fraction +of denitrification going to N\ :sub:`2`\ O, \ :math:`{P}_{N2:N2O}`, is variable, following +the Century (:ref:`del Grosso et al. 2000 `) approach: .. math:: - :label: 22.14) + :label: 22.5) P_{N_{2} :N_{2} O} =\max \left(0.16k_{1} ,k_{1} \exp \left(-0.8P_{NO_{3} :CO_{2} } \right)\right)f_{WFPS} @@ -307,7 +230,7 @@ a function of :math:`{d}_{g}`, the gas diffusivity through the soil matrix: .. math:: - :label: 22.15) + :label: 22.6) k_{1} =\max \left(1.7,38.4-350*d_{g} \right) @@ -329,7 +252,7 @@ depends on the concentration of dissolved mineral (inorganic) nitrogen in soil water solution (*DIN*, gN kgH\ :sub:`2`\ O), and the rate of hydrologic discharge from the soil column to streamflow (:math:`{Q}_{dis}`, kgH\ :sub:`2`\ O m\ :sup:`-2` -s\ :sup:`-1`, section 7.6), as +s\ :sup:`-1`, section :numref:`Lateral Sub-surface Runoff`), as .. math:: :label: 22.17) @@ -338,11 +261,8 @@ s\ :sup:`-1`, section 7.6), as *DIN* is calculated assuming that a constant fraction (*sf*, proportion) of the remaining soil mineral N pool is in soluble form, and that this -entire fraction is dissolved in the total soil water. For the CLM-CN -soil model, it is further assumed that *sf* = 0.1, representing an -estimated 10% of the total :math:`{NS}_{sminn}` pool as soluble -nitrate, with the remaining 90% as less soluble ammonia; for the -Century-based formulation, the leaching acts only on the +entire fraction is dissolved in the total soil water. For the Century- +based formulation in CLM5.0, the leaching acts only on the NO\ :sub:`3`\ :sup:`-`` pool (which is assumed to be 100% soluble), while the NH\ :sub:`4`\ :sup:`+` pool is assumed to be 100% adsorbed onto mineral surfaces and unaffected by leaching. @@ -362,25 +282,18 @@ each time step to not exceed the soluble fraction of :math:`{NS}_{sminn}` NF_{leached} =\min \left(NF_{leached} ,\frac{NS_{sminn} sf}{\Delta t} \right). -The CLM-CN parameterization of the soluble fraction is poorly -constrained by observations. Fraction of total soil mineral N pool -present as nitrate will vary spatially and temporally, depending on -oxygen status of soils and rates of nitrification. A calibration of this -parameterization against observations of dissolved nitrate in headwater -streams might be an effective method for imposing better observational -constraints at broad spatial scales. - Losses of Nitrogen Due to Fire ----------------------------------- The final pathway for nitrogen loss is through combustion, also known as pyrodenitrification. Detailed equations are provided, together with the -effects of fire on the carbon budget, in Chapter 18. It is assumed in +effects of fire on the carbon budget, in Chapter :numref:`rst_Fire`). It is assumed in CLM-CN that losses of N due to fire are restricted to vegetation and litter pools (including coarse woody debris). Loss rates of N are determined by the fraction of biomass lost to combustion, assuming that most of the nitrogen in the burned biomass is lost to the atmosphere -(Schlesinger, 1997; Smith et al. 2005). It is assumed that soil organic +(:ref:`Schlesinger, 1997 `; :ref:`Smith et al. 2005 +`). It is assumed that soil organic matter pools of carbon and nitrogen are not directly affected by fire -(Neff et al. 2005). +(:ref:`Neff et al. 2005 `). diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index c2a665d8ac..920bc2c1ba 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -145,15 +145,23 @@ follows: \begin{array}{l} {a_{1} ={\rm \; ratio\; of\; new\; fine\; root\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{2} ={\rm \; ratio\; of\; new\; coarse\; root\; :\; new\; stem\; carbon\; allocation}} \\ {a_{3} ={\rm \; ratio\; of\; new\; stem\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{4} ={\rm \; ratio\; new\; live\; wood\; :\; new\; total\; wood\; allocation}} \\ {g_{1} ={\rm ratio\; of\; growth\; respiration\; carbon\; :\; new\; growth\; carbon.\; }} \end{array} -Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined as constants for a given PFT (Table -13.1), while :math:`g_{l }` = 0.3 (unitless) is prescribed as a +Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined +as constants for a given PFT (:numref:`Table Allocation and carbon:nitrogen +ratio parameters`), while :math:`g_{l }` = 0.3 (unitless) is prescribed as a constant for all PFTs, based on construction costs for a range of woody -and non-woody tissues (Larcher, 1995). +and non-woody tissues (:ref:`Larcher, 1995 `). -The model includes a dynamic allocation scheme for woody vegetation -(parameter :math:`a_{3}` = -1, Table 13.1), in which case the -ratio for carbon allocation between new stem and new leaf increases with -increasing net primary production (NPP), as +CLM5.0 applies a fixed allocation scheme for woody vegetation. +The decision to use the fixed allocation scheme in CLM5.0 came +from biases in above-ground biomass illustrated by Negrón-Juárez +et al. (:ref:`2015 `). + +The model maintains the capacity to represent a dynamic allocation scheme +for woody vegetation (parameter :math:`a_{3}` = -1, :numref:`Table Allocation +and carbon:nitrogen ratio parameters`), but this is not the default +configuration. With dynamic allocation the ratio for carbon allocation +between new stem and new leaf increases with increasing net primary +production (NPP), as .. math:: :label: 17.8) @@ -162,63 +170,33 @@ increasing net primary production (NPP), as where :math:`NPP_{ann}` is the annual sum of NPP from the previous year. This mechanism has the effect of increasing woody allocation in -favorable growth environments (Allen et al., 2005; Vanninen and Makela, -2005) and during the phase of stand growth prior to canopy closure -(Axelsson and Axelsson, 1986). - -Table 13.1. Allocation and carbon:nitrogen ratio parameters - -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`CN_{leaf}` | :math:`CN_{fr}` | :math:`CN_{lw}` | :math:`CN_{dw}` | -+==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ -| NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| NET Boreal | 1 | 0.3 | -1 | 0.1 | 40 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| NDT Boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BET Tropical | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BET temperate | 1 | 0.3 | -1 | 0.1 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT tropical | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT temperate | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDT boreal | 1 | 0.3 | -1 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BES temperate | 1 | 0.3 | 0.2 | 0.5 | 30 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| C\ :sub:`4` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Crop R | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Crop I | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Corn R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Corn I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Temp Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Temp Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Winter Cereal R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Winter Cereal I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Soybean R | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ -| Soybean I | 2 | 0 | 0 | 1 | 25 | 42 | 50 | 500 | -+----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ +favorable growth environments (:ref:`Allen et al., 2005 `; +:ref:`Vanninen and Makela, 2005 `) and during +the phase of stand growth prior to canopy closure (:ref:`Axelsson and +Axelsson, 1986 `). + +.. _Table Allocation and carbon:nitrogen ratio parameters: + +.. table:: Allocation and carbon:nitrogen ratio parameters. + + ======================== ============= ============= ============= ============= ================= =============== =============== =============== + Plant functional type :math:`a_{1}` :math:`a_{2}` :math:`a_{3}` :math:`a_{4}` :math:`CN_{leaf}` :math:`CN_{fr}` :math:`CN_{lw}` :math:`CN_{dw}` + ======================== ============= ============= ============= ============= ================= =============== =============== =============== + NET Temperate 1.5 0.3 2.30 0.1 58.00 42 50 500 + NET Boreal 1.5 0.3 2.30 0.1 58.00 42 50 500 + NDT Boreal 1.5 0.3 1.00 0.1 25.81 42 50 500 + BET Tropical 1.5 0.3 2.30 0.1 29.60 42 50 500 + BET temperate 1.5 0.3 1.50 0.1 29.60 42 50 500 + BDT tropical 1.5 0.3 1.00 0.1 23.45 42 50 500 + BDT temperate 1.5 0.3 2.30 0.1 23.45 42 50 500 + BDT boreal 1.5 0.3 2.30 0.1 23.45 42 50 500 + BES temperate 1.5 0.3 1.40 0.5 36.42 42 50 500 + BDS temperate 1.5 0.3 0.24 0.5 23.26 42 50 500 + BDS boreal 1.5 0.3 0.24 0.1 23.26 42 50 500 + C\ :sub:`3` arctic grass 1.5 0.0 0.00 0.0 28.03 42 0 0 + C\ :sub:`3` grass 1.5 0.0 0.00 0.0 28.03 42 0 0 + C\ :sub:`4` grass 1.5 0.0 0.00 0.0 35.36 42 0 0 + ======================== ============= ============= ============= ============= ================= =============== =============== =============== Carbon to nitrogen ratios are defined for different tissue types as follows: @@ -226,10 +204,10 @@ follows: .. math:: :label: ZEqnNum413927 - \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} + \begin{array}{l} {CN_{leaf} =\ {\rm \;C:N\; for\; leaf}} \\ {CN_{fr} =\ {\rm \;C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \;C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\ {\rm \;C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} -where all C:N parameters are defined as constants for a given PFT (Table -13.1). +where all C:N parameters are defined as constants for a given PFT +(:numref:`Table Allocation and carbon:nitrogen ratio parameters`). Given values for the parameters in and , total carbon and nitrogen allocation to new growth ( :math:`CF_{alloc}`, gC diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 048fa076c0..59fed6d91b 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1295,6 +1295,11 @@ and Water Assessment Tool, Theoretical Documentation: Version 2005. Temple, TX. USDA Agricultural Research Service and Texas A&M Blackland Research Center. +.. _Negrón-Juárezetal2015: + +Negrón-Juárez, R. Koven, C.D., Riley, W.J., Knox, R.G., Chambers, J.Q. +2015. Environmental Research Letters 10:064017. DOI:10.1088/1748-9326/10/6/064017. + .. _NemaniRunning1996: Nemani, R.R., and Running, S.W. 1996. Implementation of a hierarchical @@ -1648,7 +1653,7 @@ Strugnell, N.C., Zhang, X., Jin, Y., and Muller, J.-P. 2002. First operational BRDF, albedo nadir reflectance products from MODIS. Remote Sens. Environ. 83:135-148. -.. _Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. +.. _Schlesinger1997: Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. Academic Press, London, 588 pp. @@ -1884,6 +1889,10 @@ Taylor, B.R., Parkinson, D. and Parsons, W.F.J., 1989. Nitrogen and lignin content as predictors of litter decay rates: A microcosm test. Ecology, 70: 97-104. +.. _Thomasetal2015: + +Thomas R.Q., Brookshire E.N., Gerber S. 2015. Nitrogen limitation on land: how can it occur in Earth system models? Global Change Biology, 21, 1777-1793, doi:10.1111/gcb.12813. + .. _Thonickeetal2001: Thonicke, K., Venevsky, S., Sitch, S., and Cramer, W. 2001. The role of @@ -2012,7 +2021,7 @@ drivers of global environmental change: enabling use of global SRES scenarios at the national and grid levels, Report 550025001, Netherlands Environmental Assessment Agency, 45 pp. -.. _Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: +.. _VanninenMakela2005: Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: effects of size, competition and site fertility on growth allocation and @@ -2077,6 +2086,13 @@ Parameterization and sensitivity analysis of the Biome-BGC terrestrial ecosystem model: net primary production controls. Earth Interactions 4:1-85. +.. _Wiederetal2015: + +Wieder, W. R., Cleveland, C. C., Lawrence, D. M., and Bonan, G. B. 2015. +Effects of model structural uncertainty on carbon cycle projections: +biological nitrogen fixation as a case study. Environmental Research +Letters, 10(4), 044016. + .. _Williamsetal1996: Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., From e8b89e1f6cffb3d233ba2ba56f1d89b4c1d220ff Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 17 Nov 2017 16:58:45 -0700 Subject: [PATCH 105/730] Update html --- .../Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 920bc2c1ba..1dc02dd07c 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -31,10 +31,12 @@ variables for vegetation carbon, and 19 for vegetation nitrogen. .. _Figure Carbon and nitrogen pools: -.. image:: image2.png +.. figure:: image2.png :width: 400px :height: 400px + Carbon and nitrogen pools. + Carbon Allocation for Maintenance Respiration Costs -------------------------------------------------------- From 7e52cbd33fdc937a7c4b907d7664aee43c90c6ef Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 17 Nov 2017 17:32:53 -0700 Subject: [PATCH 106/730] Updates to Introduction, added some refs, fixed refs in FUN chapter --- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 14 ++++--------- .../CLM50_Tech_Note_Introduction.rst | 15 +++++++------- .../CLM50_Tech_Note_Plant_Respiration.rst | 2 +- .../References/CLM50_Tech_Note_References.rst | 20 +++++++++++++++++-- 4 files changed, 31 insertions(+), 20 deletions(-) diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index c94c3556ef..e10698858b 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -7,7 +7,7 @@ Introduction ----------------- -The Fixation and Uptake of Nitrogen model is based on work by Fisher (J.) et al., (2008), Brzostek et al. (2015) and Shi et al. (2016). The concept of FUN is that in most cases, Nitrogen uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of Nitrogen in the environment which a plant may exchange for carbon. The ratio of carbon expended to Nitrogen acquired is referred to here as the cost, or exchange rate, of N acquisition (:math:`E_{nacq}`, gC/gN)). There are eight pathways for N uptake: +The Fixation and Uptake of Nitrogen model is based on work by :ref:`Fisher et al. (2010)`, :ref:`Brzostek et al. (2014)`, and :ref:`Shi et al. (2016)`. The concept of FUN is that in most cases, Nitrogen uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of Nitrogen in the environment which a plant may exchange for carbon. The ratio of carbon expended to Nitrogen acquired is referred to here as the cost, or exchange rate, of N acquisition (:math:`E_{nacq}`, gC/gN)). There are eight pathways for N uptake: 1. Fixation by symbiotic bacteria in root nodules (for N fixing plants) (:math:`_{fix}`) 2. Retranslocation of N from senescing tissues (:math:`_{ret}`) @@ -47,7 +47,7 @@ Available Soil Nitrogen Cost of Nitrogen Fixation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The cost of fixation is derived from Houlton et al. (2008). +The cost of fixation is derived from :ref:`Houlton et al. (2008)`. .. math:: N_{cost,fix} = -s_{fix}/(1.25 e^{a_{fix} + b_{fix} . t_{soil} (1 - 0.5 t_{soil}/ c_{fix}) }) @@ -89,7 +89,7 @@ where m=1 pertains to the fraction of the PFT that is ecotmycorrhizal, as oppose Resolving N cost across simultaneous uptake streams -------------------------------------------------------- -The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN (Fisher et al. 2008) utilized a scheme whereby plants only took up N from the cheapest pathway. Brzostek et al. introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: +The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN :ref:`(Fisher et al., 2010))` utilized a scheme whereby plants only took up N from the cheapest pathway. :ref:`Brzostek et al. (2014)` introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: .. math:: @@ -274,7 +274,7 @@ and the other C and N fluxes can be determined following the logic above. Modifications to allow variation in C:N ratios -------------------------------------------------------- -The original FUN model as developed by Fisher et al. (2008) and Brzostek et al. (2015) assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. **lit review on CN ratios** +The original FUN model as developed by :ref:`Fisher et al. (2010)` and :ref:`Brzostek et al. (2014)` assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. **lit review on CN ratios** Thus, in CLM5, we introduce the capacity for tissue C:N ratios to be prognostic, rather than static. Overall N and C availability (:math:`N_{uptake}` and :math:`C_{growth}`) and hence tissue C:N ratios, are both determined by FUN. Allocation to individual tissues is discussed in the allocation chapter @@ -407,9 +407,3 @@ kc_nonmyc (step 2) sets active components for Arbuscular fungi ACTIVE vs NONMYC ECTO vs ARBU for ACTIVE. -References --------------------------------------------------------- - -Houlton, B.Z., Wang, Y.P., Vitousek, P.M. and Field, C.B., 2008. A unifying framework for dinitrogen fixation in the terrestrial biosphere. Nature, 454(7202), p.327. - - diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 69ad12b91f..ee53f94082 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -511,7 +511,7 @@ push towards more mechanistic treatment of key processes, in addition to more co of land use and land-cover change. Prior versions of CLM included relatively few options for physics parameterizations or structure. In CLM5, where new parameterizations or model decisions were made, in most cases, the CLM4.5 parameterization was maintained so that users could switch back and forth between different parameterizations via namelist control where appropriate or desirable. Throughout the CLM5 Technical Descpription, in general only the default parameterization for any given process is described. Readers are referred to the CLM4.5 or CLM4 Technical Descriptions for detailed descriptions of non-default parameterizations. -The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. +The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Rooting profiles were used inconsistently in CLM4.5 with :ref:`Zeng (2001)` profiles used for water and :ref: `Jackson et al. (1996)` profiles used for carbon inputs. For CLM5, the Jackson et al. (1996) rooting profiles are used for both water and carbon. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. Several changes are included that are mainly targeted at improving the simulation of surface mass balance over ice sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to @@ -520,16 +520,17 @@ a simulation when two-way coupling is active. Multiple elevation classes (10 el A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:`(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. -Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model (refs???) is adapted for CLM :ref:`(Shi et al., 2016)` to resolve the -unrealistic feature that plants get nitrogen for free in CLM4 and CLM4.5. With FUN, the fact that plants typically spend a -significant fraction of their available carbon on nutrient aquisition is acounted for. The static plant carbon:nitrogen (C:N) ratios utilized in CLM4 and CLM4.5 are replaced with variable plant C:N ratios which +Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model based on the work of :ref:`Fisher et al. (2010)`, :ref:`Brzostek et al. (2014)`, and :ref:`Shi et al. (2016)` is incorporated. The concept of FUN is that in most cases, N uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of N in the environment which a plant may exchange for carbon. The ratio of carbon expended to N acquired is therefore the cost, or exchange rate, of N acquisition. FUN calculates the rate of symbiotic N fixation, with this N passed straight to the plant, not the mineral N pool. Separately, CLM5 also calculates rates of symbiotic (or free living) N fixation as a function of evapotranspiration (:ref:`Cleveland et al. 1999 `), which +is added to the soil inorganic ammonium (NH\ :sub:`4`\ :sup:`+`) pool. The static plant carbon:nitrogen (C:N) ratios utilized in CLM4 and CLM4.5 are replaced with variable plant C:N ratios which allows plants to adjust their C:N ratio, and therefore their leaf nitrogen content, with the cost of N uptake :ref:`(Ghimire et al. 2016)`. The implementation of a flexible C:N ratio means that the model no longer relies on instantaneous downregulation of potential photosynthesis rates based on soil mineral nitrogen availability to represent nutrient limitation. Furthermore, stomatal conductance is now based on the N-limited photosynthesis rather than on potential photosynthesis. Finally, the Leaf Use of -Nitrogen for Assimilation (LUNA, :ref:`(Xu et al., 2012` and :ref:`Ali et al., 2016)` model is incorporated. The LUNA model calculates +Nitrogen for Assimilation (LUNA, :ref:`Xu et al., 2012` and :ref:`Ali et al., 2016)` model is incorporated. The LUNA model calculates photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that -light capture, carboxylation, and respiration are co-limiting. Allocation changes ... Fixation ??? +light capture, carboxylation, and respiration are co-limiting. + +CLM5 applies a fixed allocation scheme for woody vegetation. The decision to use a fixed allocation scheme in CLM5, rather than a dynamic allocation scheme based on NPP as was used in CLM4 and CLM4.5, was driven by the fact that observations indicate that biomass saturates with increasing productivity, in contrast to the behavior in CLM4 and CLM4.5 where biomass continuously increases with increasing productivity (:ref:`Negron-Juarez et al., 2015`). Soil carbon decomposition processes are unchanged in CLM5, but a new metric for apparent soil carbon turnover times (:ref:`Koven et al., 2017 `) suggested parameter changes that produce a weak intrinsic depth limitation on soil carbon turnover rates (rather than the strong depth limitaiton in CLM4.5) and that the thresholds for soil moisture limitation on soil carbon turnover rates in dry soils should be set at a wetter soil moisture level than that used in CLM4.5. Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016)`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. Fertilization rates and irrigation equipped area updated annually based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that @@ -545,7 +546,7 @@ Included with the release of CLM5.0 is a functionally supported version of the F During the course of the development of CLM5.0, it became clear that the increasing complexity of the model combined with the increasing number and range of model development projects required updates to the underlying CLM infrastructure. Many such software improvements -are included in CLM5.0 including a partial transition to an object-oriented modular software structure. Many hard coded model +are included in CLM5 including a partial transition to an object-oriented modular software structure. Many hard coded model parameters have been extracted into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at specific locations or to conduct parameter sensitivity studies. As part of the effort to increase the scientific utility of the code, in most instances older generation parameterizations (i.e., the parameterizations diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 1dc02dd07c..c4fae1d7d9 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -156,7 +156,7 @@ and non-woody tissues (:ref:`Larcher, 1995 `). CLM5.0 applies a fixed allocation scheme for woody vegetation. The decision to use the fixed allocation scheme in CLM5.0 came from biases in above-ground biomass illustrated by Negrón-Juárez -et al. (:ref:`2015 `). +et al. (:ref:`2015 `). The model maintains the capacity to represent a dynamic allocation scheme for woody vegetation (parameter :math:`a_{3}` = -1, :numref:`Table Allocation diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 59fed6d91b..e613dce3b4 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -217,6 +217,10 @@ liquid water content. Ann. Glaciol. 13:22-26. Brunke, M. A., P. Broxton, J. Pelletier, D. Gochis, P. Hazenberg, D. M. Lawrence, L. R. Leung, G.-Y. Niu, P. A. Troch, and X. Zeng, 2016: Implementing and Evaluating Variable Soil Thickness in the Community Land Model, Version 4.5 (CLM4.5). J. Clim. 29:3441-3461. +.. _Brzosteketal2014: + +Brzostek, E. R., J. B. Fisher, and R. P. Phillips, 2014. Modeling the carbon cost of plant nitrogen acquisition: Mycorrhizal trade-offs and multipath resistance uptake improve predictions of retranslocation. J. Geophys. Res. Biogeosci., 119, 1684–1697, doi:10.1002/2014JG002660. + .. _BugmannSolomon2000: Bugmann, H., and Solomon, A.M. 2000. Explaining forest composition and @@ -487,6 +491,10 @@ Schimel (Editors). John Wiley and Sons, pp. 7-21. Fisher, R. A., S. Muszala, M. Verteinstein, P. Lawrence, C. Xu, N. G. McDowell, R. G. Knox, C. Koven, J. Holm, B. M. Rogers, A. Spessa, D. Lawrence, and G. Bonan, 2015: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED). Geosci. Model Dev., 8: 3593-3619, doi:10.5194/gmd-8-3593-2015. +.. _Fisheretal2010: + +Fisher, J. B., S. Sitch, Y. Malhi, R. A. Fisher, C. Huntingford, and S.-Y. Tan, 2010. Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation. Global Biogeochem. Cycles, 24, GB1014, doi:10.1029/2009GB003621. + .. _FlannerZender2005: Flanner, M.G., and Zender. C.S. 2005. Snowpack radiative heating: @@ -733,6 +741,10 @@ Sensitivity of surface flux simulations to hydrologic parameters based on an uncertainty quantification framework applied to the Community Land Model. J. Geophys. Res. 117:D15108. +.. _Houltonetal2008: + +Houlton, B.Z., Wang, Y.P., Vitousek, P.M. and Field, C.B., 2008. A unifying framework for dinitrogen fixation in the terrestrial biosphere. Nature, 454(7202), p.327. + .. _HuangLiang2006: Huang, M., and Liang, X. 2006. On the assessment of the impact of @@ -906,6 +918,10 @@ sensitive to deep soil carbon decomposability but not deep soil nitrogen dynamics. Proceedings of the National Academies of Science, 112, 12, 3752-3757, doi:10.1073/pnas.1415123112 +.. _Kovenetal2017: + +Koven, C.D., G. Hugelius, D.M. Lawrence, and W.R. Wieder, 2017: Higher climatological temperature sensitivity of soil carbon in cold than warm climates. Nature Clim. Change, 7, doi:10.1038/nclimate3421. + .. _Kuchariketal2000: Kucharik, C.J., Foley, J.A., Delire, C., Fisher, V.A., Coe, M.T., @@ -1295,9 +1311,9 @@ and Water Assessment Tool, Theoretical Documentation: Version 2005. Temple, TX. USDA Agricultural Research Service and Texas A&M Blackland Research Center. -.. _Negrón-Juárezetal2015: +.. _NegronJuarezetal2015: -Negrón-Juárez, R. Koven, C.D., Riley, W.J., Knox, R.G., Chambers, J.Q. +Negron-Juarez, R. Koven, C.D., Riley, W.J., Knox, R.G., Chambers, J.Q. 2015. Environmental Research Letters 10:064017. DOI:10.1088/1748-9326/10/6/064017. .. _NemaniRunning1996: From 88a17841ea4bce158a4060e1f8c9178f4478c295 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Mon, 20 Nov 2017 05:07:49 -0700 Subject: [PATCH 107/730] Removed allocation from respiration chapter. Moved image to CNPools --- .../CLM50_Tech_Note_Plant_Respiration.rst | 58 +------------------ 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index c4fae1d7d9..7fac43551c 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -3,63 +3,11 @@ Plant Respiration ================= -Introduction ------------------ - -CLM includes a fully-prognostic treatment of the terrestrial carbon and -nitrogen cycles including interactions between these cycles as mediated -by biological mechanisms of plants and soil heterotrophs. The model is -fully prognostic with respect to all carbon and nitrogen state variables -in the vegetation, litter, and soil organic matter. The seasonal timing -of new vegetation growth and litterfall is also prognostic, responding -to soil and air temperature, soil water availability, and daylength, in -varying degrees depending on a specified phenology type for each PFT -(see Chapter 14). The prognostic LAI, SAI, and vegetation heights are -utilized by the biophysical model. - -Separate state variables for C and N are tracked for leaf, live stem, -dead stem, live coarse root, dead coarse root, and fine root pools -(Figure 13.1 and 13.2). Each of these pools has two corresponding -storage pools representing, respectively, short-term and long-term -storage of non-structural carbohydrates and labile nitrogen. There are -two additional carbon pools, one for the storage of growth respiration -reserves, and another used to meet excess demand for maintenance -respiration during periods with low photosynthesis. One additional -nitrogen pool tracks retranslocated nitrogen, mobilized from leaf tissue -prior to abscission and litterfall. Altogether there are 20 state -variables for vegetation carbon, and 19 for vegetation nitrogen. - -.. _Figure Carbon and nitrogen pools: - -.. figure:: image2.png - :width: 400px - :height: 400px - - Carbon and nitrogen pools. - -Carbon Allocation for Maintenance Respiration Costs + +Carbon Expenditure on Plant Maintenance Respiration -------------------------------------------------------- -The carbon and nitrogen allocation routines in CLM determine the fate of -newly assimilated carbon, coming from the calculation of photosynthesis, -and available mineral nitrogen, coming from plant uptake of mineral -nitrogen in the soil or being drawn out of plant reserves. Allocation -fluxes are determined in three steps: first :math:`CF_{GPPpot}` is -used to evaluate the potential allocation of carbon and nitrogen -assuming an unlimited nitrogen supply, then the actual nitrogen supply -is compared against the demand, and finally allocation of carbon and -nitrogen are reduced, if necessary, to match nitrogen supply and demand. - -Allocation of available carbon on each time step is prioritized, with -first priority given to the demand for carbon to support maintenance -respiration of live tissues (section 13.7). Second priority is to -replenish the internal plant carbon pool that supports maintenance -respiration during times when maintenance respiration exceeds -photosynthesis (e.g. at night, during winter for perennial vegetation, -or during periods of drought stress) (Sprugel et al., 1995). Third -priority is to support growth of new tissues, including allocation to -storage pools from which new growth will be displayed in subsequent time -steps. +After the assimilation of photsynthetic carbon, the first expenditure is on plant maintenance respiration (Chapter :numref:`rst_CN Allocation`) The total maintenance respiration demand (:math:`CF_{mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of From f6b0c59a61d319c1237d4ec3bd9968c6ede99808 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Mon, 20 Nov 2017 15:42:02 -0700 Subject: [PATCH 108/730] Modified CN_Allocation to explain FUN interactions --- .../CLM50_Tech_Note_CN_Allocation.rst | 63 ++++++------------- 1 file changed, 19 insertions(+), 44 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 37d3f0a10f..3edb8fb857 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -7,32 +7,22 @@ Summary of CLM5.0 updates relative to the CLM4.5 ----------------------------------------------------- - CLM5 now defaults to a static allocation to woody biomass rather than the dynamic allocation term used in CLM4.5. The dynamic allocation is stil lkept as an option, for details, see the CLM4.5 Tech Note. - - CLM5 now includes flexible C:N ratios of all plant tissues, which allows allocation of carbon to occur separately from allocation of nitrogen, thus removing the requirement to downregulate photosynthesis based on the instantaneous stoichiometric needs of allocation. +- CLM5 now includes flexible C:N ratios of all plant tissues, which allows allocation of carbon to occur separately from allocation of nitrogen, thus removing the requirement to downregulate photosynthesis based on the instantaneous stoichiometric needs of allocation. + +- CLM5 accounts for the carbon expenditure on nitrogen aquisition, as determined by the FUN model, and the N uptake it determined by the environmental cost of Nitrogen from fixation, active uptake and retranslocation. Introduction ----------------- +The carbon and nitrogen allocation routines in CLM determine the fate of newly assimilated carbon, and absorbed nitrogen. The environmental cost of nitrogen estimated by the FUN model modulates the C:N ratios of the plant tissue pools around a target ratio, and absorbed nitrogen is allocated in proportion to the demand, as estimated by the ideal requirements of these target C:N ratios. -The carbon and nitrogen allocation routines in CLM determine the fate of -newly assimilated carbon, coming from the calculation of photosynthesis, -and available mineral nitrogen, coming from plant uptake of mineral -nitrogen in the soil or being drawn out of plant reserves. A significant change to CLM5 relative to prior versions is that allocation of carbon and nitrogen proceed independently rather than in a sequential manner. -Carbon Allocation to Cover Prior-Timestep Maintenance Respiration Costs +Carbon Allocation to Cover Prior-Timestep Maintenance Respiration Costs ("Excess" Respiration) ---------------------------------------------------------------------------- -Allocation of available carbon on each time step is prioritized, with -first priority given to the demand for carbon to support maintenance -respiration of live tissues (Chapter :numref:`rst_Plant Respiration`) and Nitrogen acquisition costs (Chapter :numref:`rst_FUN`). Second priority is to -replenish the plant carbon deficit pool that balances maintenance -respiration that occurs during times when maintenance respiration exceeds -photosynthesis (e.g. at night, during winter for perennial vegetation, -or during periods of drought stress) (Sprugel et al., 1995). Third -priority is to support growth of new tissues, including allocation to -storage pools from which new growth will be displayed in subsequent time -steps, as well as growth respiration costs. +After respiration of live tissues (Chapter :numref:`rst_Plant Respiration`), the next priority of the carbon allocation cascade is to replenish the plant carbon deficit pool that balances maintenance respiration that occurs during times when maintenance respiration exceeds photosynthesis (e.g. at night, during winter for perennial vegetation, or during periods of drought stress) (Sprugel et al., 1995). The total maintenance respiration demand (:math:`CF_{mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of @@ -99,16 +89,19 @@ Carbon and Nitrogen Stoichiometry of New Growth ---------------------------------------------------- After accounting for the carbon cost of maintenance respiration, the -remaining carbon flux from photosynthesis which can be allocated to new -growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is +remaining carbon flux from photosynthesis which is allocated either to new +growth or to nitrogen acquisition processes (Chapter :numref:`rst_FUN`), (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 19.6 CF_{avail\_ alloc} =CF_{GPP} -CF_{GPP,mr} -CF_{GPP,xs} . -Potential allocation to new growth is calculated for all of the plant -carbon and nitrogen state variables based on specified C:N ratios for + +The FUN model requires an estimate of the C:N requirements of the existing plant structure, given that different relative quantities of wood, root and leaf biomass will result in different necessary C:N ratios for expansion. + +These C and N allocation ratios are calculated for all of the plant +carbon and nitrogen state variables based on target C:N ratios for each tissue type and allometric parameters that relate allocation between various tissue types. The allometric parameters are defined as follows: @@ -191,17 +184,14 @@ follows: where all C:N parameters are defined as constants for a given PFT (:numref:`Table Allocation and CN ratio parameters`). -Given values for the parameters in and , total carbon and nitrogen -allocation to new growth ( :math:`CF_{alloc}`, gC -m\ :sup:`-2` s\ :sup:`-1`, and :math:`NF_{alloc}`, gN -m\ :sup:`-2` s\ :sup:`-1`, respectively) can be expressed as -functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC -m\ :sup:`-2` s\ :sup:`-1`): + +The target C:N stoichiometry for new growth allocation can be calculated as .. math:: - :label: 19.10 + :label: 19.13 + + CN_{plant\_ target} =\frac{N_{allom} }{C_{allom} } . - \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} where @@ -215,16 +205,7 @@ where N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. -Since the C:N stoichiometry for new growth allocation is defined, from -Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation -(:math:`CF_{avail\_alloc}`) can be used to calculate the total -plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, -gN m\ :sup:`-2` s\ :sup:`-1`) as: -.. math:: - :label: 19.13 - - NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . Carbon Allocation to New Growth ----------------------------------------- @@ -305,14 +286,8 @@ tissue types are given as: Nitrogen allocation ----------------------------------------- -The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{supply}`. The total N allocated for a given tissue :math:`i` is the minimum between the supply and the demand: - -.. math:: - :label: 19.26 - - NF_{alloc,i} = min \left( NF_{demand, i}, NF_{supply, i} \right) +The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{uptake}`. This is distribution in proportion to the demand for N from different tissues, calculated as: -The demand for each tissue, calculated for the tissue to remain on stoichiometry during growth, is: .. math:: :label: 19.27 From 407df8d4188a4b9bd2fda40d04a5a62c58a4efe0 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 30 Nov 2017 17:37:18 -0700 Subject: [PATCH 109/730] Updated parameter values in Decomposition chapter --- .../CLM50_Tech_Note_Decomposition.rst | 16 ++++++++-------- .../CLM50_Tech_Note_Introduction.rst | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 4d72bd357e..4f662988f6 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -200,19 +200,19 @@ those described in Parton et al. (1988) (:numref:`Table Turnover times`). +------------+------------------------+-------------+-------------------------------------------+ | | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | +============+========================+=============+===========================================+ - | CWD | 4.1 | - | 1 | + | CWD | 3.3 | - | 1.65 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 1 | 0.066 | - | 1 | + | Litter 1 | 0.054 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 2 | 0.25 | - | 1 | + | Litter 2 | 0.20 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 3 | 0.25 | - | 1 | + | Litter 3 | 0.20 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 1 | 0.17 | 8 | 1 | + | SOM 1 | 0.14 | 12 | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 2 | 6.1 | 11 | 15 | + | SOM 2 | 5 | 12 | 5 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 3 | 270 | 11 | 675 | + | SOM 3 | 222 | 10 | 222 | +------------+------------------------+-------------+-------------------------------------------+ Likewise, values for the respiration fraction of Century-based structure are in :numref:`Table Respiration fractions for Century-based structure`. @@ -794,7 +794,7 @@ loading from restart files (which preserve information about the mode of the model when restart files were written). The base acceleration terms for the two decomposition cascades are shown in -Tables 15.1 and 15.3. In addition to the base terms, CLM5 also +Tables :numref:`Table Decomposition rate constants` and :numref:`Table Turnover times`. In addition to the base terms, CLM5 also includes a geographic term to the acceleration in order to apply larger values to high-latitude systems, where decomposition rates are particularly slow and thus equilibration can take significantly longer diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index ee53f94082..999e6cd30e 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -511,7 +511,7 @@ push towards more mechanistic treatment of key processes, in addition to more co of land use and land-cover change. Prior versions of CLM included relatively few options for physics parameterizations or structure. In CLM5, where new parameterizations or model decisions were made, in most cases, the CLM4.5 parameterization was maintained so that users could switch back and forth between different parameterizations via namelist control where appropriate or desirable. Throughout the CLM5 Technical Descpription, in general only the default parameterization for any given process is described. Readers are referred to the CLM4.5 or CLM4 Technical Descriptions for detailed descriptions of non-default parameterizations. -The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Rooting profiles were used inconsistently in CLM4.5 with :ref:`Zeng (2001)` profiles used for water and :ref: `Jackson et al. (1996)` profiles used for carbon inputs. For CLM5, the Jackson et al. (1996) rooting profiles are used for both water and carbon. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. +The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Rooting profiles were used inconsistently in CLM4.5 with :ref:`Zeng (2001)` profiles used for water and :ref:`Jackson et al. (1996)` profiles used for carbon inputs. For CLM5, the Jackson et al. (1996) rooting profiles are used for both water and carbon. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. Several changes are included that are mainly targeted at improving the simulation of surface mass balance over ice sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to From c019c6ebaac5fc8e221ce115707562118894f29a Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Fri, 1 Dec 2017 06:33:31 -0700 Subject: [PATCH 110/730] Modified Decomposition chapter discussion of N competition --- .../CLM50_Tech_Note_Decomposition.rst | 153 ++++++++++-------- 1 file changed, 85 insertions(+), 68 deletions(-) diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 4f662988f6..30c9b3988d 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -12,7 +12,7 @@ and soil organic matter (SOM) pools, each defined at compile time, between 2 contrasting hypotheses of decomposition as embodied by two separate decomposition submodels: the CLM-CN pool structure used in CLM4.0, or a second pool structure, characterized by -slower decomposition rates, based on the Century model (Parton et al. +slower decomposition rates, based on the fCentury model (Parton et al. 1988). In addition, the user can choose, at compile time, whether to allow :math:`{n}_{lev}` to equal 1, as in CLM4.0, or to equal the number of soil levels used for the soil hydrological and thermal @@ -200,19 +200,19 @@ those described in Parton et al. (1988) (:numref:`Table Turnover times`). +------------+------------------------+-------------+-------------------------------------------+ | | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | +============+========================+=============+===========================================+ - | CWD | 3.3 | - | 1.65 | + | CWD | 4.1 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 1 | 0.054 | - | 1 | + | Litter 1 | 0.066 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 2 | 0.20 | - | 1 | + | Litter 2 | 0.25 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | Litter 3 | 0.20 | - | 1 | + | Litter 3 | 0.25 | - | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 1 | 0.14 | 12 | 1 | + | SOM 1 | 0.17 | 8 | 1 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 2 | 5 | 12 | 5 | + | SOM 2 | 6.1 | 11 | 15 | +------------+------------------------+-------------+-------------------------------------------+ - | SOM 3 | 222 | 10 | 222 | + | SOM 3 | 270 | 11 | 675 | +------------+------------------------+-------------+-------------------------------------------+ Likewise, values for the respiration fraction of Century-based structure are in :numref:`Table Respiration fractions for Century-based structure`. @@ -488,47 +488,64 @@ as opposed to a potential flux. N Competition between plant uptake and soil immobilization fluxes ---------------------------------------------------------------------- -Once :math:`{NF}_{immob\_demand }` is known, the competition between -plant and microbial nitrogen demand can be resolved. Mineral nitrogen in +Once :math:`{NF}_{immob\_demand }` and :math:`{NF}_{nit\_demand }` for each layer *j* are known, the competition between plant and microbial nitrogen demand can be resolved. Mineral nitrogen in the soil pool (:math:`{NS}_{sminn}`, gN m\ :sup:`-2`) at the -beginning of the timestep is considered the available supply. Total -demand for mineral nitrogen from this pool (:math:`{NF}_{total\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) is: +beginning of the timestep is considered the available supply. + +Here, the :math:`{NF}_{plant\_demand}` is the theoretical maximum demand for nitrogen by plants to meet the entire carbon uptake given an N cost of zero (and therefore represents the upper bound on N requirements). N uptake costs that are +:math:`>` 0 imply that the plant will take up less N that it demands, ultimately. However, given the heuristic nature of the N competition algorithm, this discrepancy is not explicitly resolved here. + +The hypothetical plant nitrogen demand from the soil mineral pool is distributed between layers in proportion to the profile of available mineral N: + +.. math:: + :label: 21.291 + + NF_{plant\_ demand,j} = NF_{plant\_ demand} NS_{sminn\_ j} / \sum _{j=1}^{nj}NS_{sminn,j} + +Plants first compete for ammonia (NH4). For each soil layer (*j*), we calculate the total NH4 demand as: .. math:: - :label: 21.27) + :label: 21.292 - NF_{total\_ demand} =NF_{immob\_ demand} +NF_{plant\_ demand\_ soil} + NF_{total\_ demand_nh4,j} = NF_{immob\_ demand,j} + NF_{immob\_ demand,j} + NF_{nit\_ demand,j} -If :math:`{NF}_{total\_demand}`\ :math:`\Delta`\ *t* :math:`<` -:math:`{NS}_{sminn}`, then the available pool is large enough to -meet both plant and microbial demand, and neither plant growth nor -immobilization steps in the decomposition cascade are limited by -nitrogen availability in the timestep. In that case, the signaling -variables :math:`{f}_{plant\_demand}` and -:math:`{f}_{immob\_demand}` are both set to 1.0, where -:math:`{f}_{plant\_demand}` is defined and used in section 15.4, and -:math:`{f}_{immob\_demand}` is the fraction of potential -immobilization demand that can be met given current supply of mineral nitrogen. +where +If :math:`{NF}_{total\_demand,j}`\ :math:`\Delta`\ *t* :math:`<` +:math:`{NS}_{sminn,j}`, then the available pool is large enough to +meet both the maximum plant and microbial demand, then immobilization proceeds at the maximum rate. -If :math:`{NF}_{total\_demand}`\ :math:`\Delta`\ *t* -:math:`\mathrm{\ge}` :math:`{NS}_{sminn}`, then there is not enough +.. math:: + :label: 21.29) + + f_{immob\_demand,j} = 1.0 + +where :math:`{f}_{immob\_demand,j}` is the fraction of potential immobilization demand that can be met given current supply of mineral nitrogen in this layer. We also set the actual nitrification flux to be the same as the potential flux (:math:`NF_{nit}` = :math:`NF_{nit\_ demand}`). + +If :math:`{NF}_{total\_demand,j}`\ :math:`\Delta`\ *t* +:math:`\mathrm{\ge}` :math:`{NS}_{sminn,j}`, then there is not enough mineral nitrogen to meet the combined demands for plant growth and -heterotrophic immobilization, and both of these processes proceed at -lower-than-potential rates, defined by the fractions -:math:`{f}_{plant\_demand}` and :math:`{f}_{immob\_demand}`, -where: +heterotrophic immobilization, immobilization is reduced proportional to the discrepancy, by :math:`f_{immob\_ demand,j}`, where .. math:: - :label: 21.28) + :label: 21.30) + + f_{immob\_ demand,j} = \frac{NS_{sminn,j} }{\Delta t\, NF_{total\_ demand,j} } + +The N available to the FUN model for plant uptake (:math:`{NF}_ {plant\_ avail\_ sminn}` (gN m\ :sup:`-2`), which determines both the cost of N uptake, and the absolute limit on the N which is available for acquisition, is calculated as the total mineralized pool minus the actual immobilized flux: + +.. math:: + :label: 21.311) + + NF_{plant\_ avail\_ sminn,j} = NS_{sminn,j} - f_{immob\_demand} NF_{immob\_ demand,j} - f_{plant\_ demand} =f_{immob\_ demand} =\frac{NS_{sminn} }{\Delta t\, NF_{total\_ demand} } This treatment of competition for nitrogen as a limiting resource is referred to a demand-based competition, where the fraction of the available resource that eventually flows to a particular process depends on the demand from that process in comparison to the total demand from all processes. Processes expressing a greater demand acquire a larger -fraction of the available resource. +vfraction of the available resource. + Final Decomposition Fluxes ------------------------------- @@ -540,37 +557,37 @@ CENTURY structure will be similar but, again without the different terminal step), are calculated as: .. math:: - :label: 21.29) + :label: 21.32) CF_{Lit1} =\left\{\begin{array}{l} {CF_{pot,\, Lit1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {CF_{pot,\, Lit1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: - :label: 21.30) + :label: 21.33) CF_{Lit2} =\left\{\begin{array}{l} {CF_{pot,\, Lit2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {CF_{pot,\, Lit2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 21.31) + :label: 21.34) CF_{Lit3} =\left\{\begin{array}{l} {CF_{pot,\, Lit3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {CF_{pot,\, Lit3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 21.32) + :label: 21.35) CF_{SOM1} =\left\{\begin{array}{l} {CF_{pot,\, SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {CF_{pot,\, SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 21.33) + :label: 21.36) CF_{SOM2} =\left\{\begin{array}{l} {CF_{pot,\, SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {CF_{pot,\, SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 21.34) + :label: 21.37) CF_{SOM3} =\left\{\begin{array}{l} {CF_{pot,\, SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {CF_{pot,\, SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: - :label: 21.35) + :label: 21.38) CF_{SOM4} =CF_{pot,\, SOM4} @@ -578,37 +595,37 @@ Heterotrophic respiration fluxes (losses of carbon as CO\ :sub:`2` to the atmosphere) are: .. math:: - :label: 21.36) + :label: 21.39) CF_{Lit1,\, HR} =CF_{Lit1} rf_{Lit1} .. math:: - :label: 21.37) + :label: 21.40) CF_{Lit2,\, HR} =CF_{Lit2} rf_{Lit2} .. math:: - :label: 21.38) + :label: 21.41) CF_{Lit3,\, HR} =CF_{Lit3} rf_{Lit3} .. math:: - :label: 21.39) + :label: 21.42) CF_{SOM1,\, HR} =CF_{SOM1} rf_{SOM1} .. math:: - :label: 21.40) + :label: 21.43) CF_{SOM2,\, HR} =CF_{SOM2} rf_{SOM2} .. math:: - :label: 21.41) + :label: 21.44) CF_{SOM3,\, HR} =CF_{SOM3} rf_{SOM3} .. math:: - :label: 21.42) + :label: 21.45) CF_{SOM4,\, HR} =CF_{SOM4} rf_{SOM4} @@ -616,32 +633,32 @@ Transfers of carbon from upstream to downstream pools in the decomposition cascade are given as: .. math:: - :label: 21.43) + :label: 21.46) CF_{Lit1,\, SOM1} =CF_{Lit1} \left(1-rf_{Lit1} \right) .. math:: - :label: 21.44) + :label: 21.47) CF_{Lit2,\, SOM2} =CF_{Lit2} \left(1-rf_{Lit2} \right) .. math:: - :label: 21.45) + :label: 21.48) CF_{Lit3,\, SOM3} =CF_{Lit3} \left(1-rf_{Lit3} \right) .. math:: - :label: 21.46) + :label: 21.49) CF_{SOM1,\, SOM2} =CF_{SOM1} \left(1-rf_{SOM1} \right) .. math:: - :label: 21.47) + :label: 21.50) CF_{SOM2,\, SOM3} =CF_{SOM2} \left(1-rf_{SOM2} \right) .. math:: - :label: 21.48) + :label: 21.51) CF_{SOM3,\, SOM4} =CF_{SOM3} \left(1-rf_{SOM3} \right) @@ -655,32 +672,32 @@ or from the downstream pool to the soil mineral nitrogen pool pools in the decomposition cascade are given as: .. math:: - :label: 21.49) + :label: 21.52) NF_{Lit1,\, SOM1} ={CF_{Lit1} \mathord{\left/ {\vphantom {CF_{Lit1} CN_{Lit1} }} \right. \kern-\nulldelimiterspace} CN_{Lit1} } .. math:: - :label: 21.50) + :label: 21.53) NF_{Lit2,\, SOM2} ={CF_{Lit2} \mathord{\left/ {\vphantom {CF_{Lit2} CN_{Lit2} }} \right. \kern-\nulldelimiterspace} CN_{Lit2} } .. math:: - :label: 21.51) + :label: 21.54) NF_{Lit3,\, SOM3} ={CF_{Lit3} \mathord{\left/ {\vphantom {CF_{Lit3} CN_{Lit3} }} \right. \kern-\nulldelimiterspace} CN_{Lit3} } .. math:: - :label: 21.52) + :label: 21.55) NF_{SOM1,\, SOM2} ={CF_{SOM1} \mathord{\left/ {\vphantom {CF_{SOM1} CN_{SOM1} }} \right. \kern-\nulldelimiterspace} CN_{SOM1} } .. math:: - :label: 21.53) + :label: 21.56) NF_{SOM2,\, SOM3} ={CF_{SOM2} \mathord{\left/ {\vphantom {CF_{SOM2} CN_{SOM2} }} \right. \kern-\nulldelimiterspace} CN_{SOM2} } .. math:: - :label: 21.54) + :label: 21.57) NF_{SOM3,\, SOM4} ={CF_{SOM3} \mathord{\left/ {\vphantom {CF_{SOM3} CN_{SOM3} }} \right. \kern-\nulldelimiterspace} CN_{SOM3} } @@ -689,37 +706,37 @@ whether the decomposition step is an immobilization flux or a mineralization flux: .. math:: - :label: 21.55) + :label: 21.58) NF_{sminn,\, Lit1\to SOM1} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit1\to SOM1} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} >0} \\ {NF_{pot\_ min,\, Lit1\to SOM1} \qquad {\rm for\; }NF_{pot\_ min,\, Lit1\to SOM1} \le 0} \end{array}\right\} .. math:: - :label: 21.56) + :label: 21.59) NF_{sminn,\, Lit2\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit2\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} >0} \\ {NF_{pot\_ min,\, Lit2\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, Lit2\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 21.57) + :label: 21.60) NF_{sminn,\, Lit3\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, Lit3\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} >0} \\ {NF_{pot\_ min,\, Lit3\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, Lit3\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 21.58) + :label: 21.61) NF_{sminn,SOM1\to SOM2} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM1\to SOM2} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} >0} \\ {NF_{pot\_ min,\, SOM1\to SOM2} \qquad {\rm for\; }NF_{pot\_ min,\, SOM1\to SOM2} \le 0} \end{array}\right\} .. math:: - :label: 21.59) + :label: 21.62) NF_{sminn,SOM2\to SOM3} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM2\to SOM3} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} >0} \\ {NF_{pot\_ min,\, SOM2\to SOM3} \qquad {\rm for\; }NF_{pot\_ min,\, SOM2\to SOM3} \le 0} \end{array}\right\} .. math:: - :label: 21.60) + :label: 21.63) NF_{sminn,SOM3\to SOM4} =\left\{\begin{array}{l} {NF_{pot\_ min,\, SOM3\to SOM4} f_{immob\_ demand} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} >0} \\ {NF_{pot\_ min,\, SOM3\to SOM4} \qquad {\rm for\; }NF_{pot\_ min,\, SOM3\to SOM4} \le 0} \end{array}\right\} .. math:: - :label: 21.61) + :label: 21.64) NF_{sminn,\, SOM4} =NF_{pot\_ min,\, SOM4} @@ -794,7 +811,7 @@ loading from restart files (which preserve information about the mode of the model when restart files were written). The base acceleration terms for the two decomposition cascades are shown in -Tables :numref:`Table Decomposition rate constants` and :numref:`Table Turnover times`. In addition to the base terms, CLM5 also +Tables 15.1 and 15.3. In addition to the base terms, CLM5 also includes a geographic term to the acceleration in order to apply larger values to high-latitude systems, where decomposition rates are particularly slow and thus equilibration can take significantly longer @@ -803,7 +820,7 @@ the form of a logistic equation, where :math:`{a}_{i}` is equal to the product of the base acceleration term and :math:`{a}_{l}` below: .. math:: - :label: 21.62) + :label: 21.65) a_l = 1 + 50 / \left ( 1 + exp \left (-0.1 * (abs(latitude) - 60 ) \right ) \right ) From 59b6fa4f5a5f11f69c3f0ef431876735e516b586 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 1 Dec 2017 09:33:19 -0700 Subject: [PATCH 111/730] Update html --- .../tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 3edb8fb857..751c393535 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -20,7 +20,7 @@ The carbon and nitrogen allocation routines in CLM determine the fate of newly a Carbon Allocation to Cover Prior-Timestep Maintenance Respiration Costs ("Excess" Respiration) ----------------------------------------------------------------------------- +---------------------------------------------------------------------------------------------- After respiration of live tissues (Chapter :numref:`rst_Plant Respiration`), the next priority of the carbon allocation cascade is to replenish the plant carbon deficit pool that balances maintenance respiration that occurs during times when maintenance respiration exceeds photosynthesis (e.g. at night, during winter for perennial vegetation, or during periods of drought stress) (Sprugel et al., 1995). From 55c81baca6568810b2f78cd03d88dd2243458dc0 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Fri, 1 Dec 2017 12:15:09 -0700 Subject: [PATCH 112/730] modifications to respiration. Added Atkin model, removed allocation text --- .../CLM50_Tech_Note_Plant_Respiration.rst | 472 ++---------------- 1 file changed, 31 insertions(+), 441 deletions(-) diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 7fac43551c..0ec9d5e1d6 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -4,434 +4,6 @@ Plant Respiration ================= -Carbon Expenditure on Plant Maintenance Respiration --------------------------------------------------------- - -After the assimilation of photsynthetic carbon, the first expenditure is on plant maintenance respiration (Chapter :numref:`rst_CN Allocation`) - -The total maintenance respiration demand (:math:`CF_{mr}`, gC -m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of -tissue mass and nitrogen concentration, and temperature (section 13.7). -The carbon supply to support this demand is composed of fluxes allocated -from carbon assimilated in the current timestep -(:math:`CF_{GPP,mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) -and from a storage pool that is drawn down when total demand exceeds -photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` -s\ :sup:`-1`): - -.. math:: - :label: 17.1) - - CF_{mr} =CF_{GPP,mr} +CF_{xs,mr} - -.. math:: - :label: 17.2) - - CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. - -.. math:: - :label: 17.3) - - CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPPpot} } \\ {CF_{mr} -CF_{GPPpot} \qquad {\rm for\; }CF_{mr} >CF_{GPPpot} } \end{array}\right. - -The storage pool that supplies carbon for maintenance respiration in -excess of current :math:`CF_{GPPpot}` ( :math:`CS_{xs}`, gC -m\ :sup:`-2`) is permitted to run a deficit (negative state), and -the magnitude of this deficit determines an allocation demand which -gradually replenishes :math:`CS_{xs}`. The logic for allowing a -negative state for this pool is to eliminate the need to know in advance -what the total maintenance respiration demand will be for a particular -combination of climate and plant type. Using the deficit approach, the -allocation to alleviate the deficit increases as the deficit increases, -until the supply of carbon into the pool balances the demand for carbon -leaving the pool in a quasi-steady state, with variability driven by the -seasonal cycle, climate variation, disturbance, and internal dynamics of -the plant-litter-soil system. In cases where the combination of climate -and plant type are not suitable to sustained growth, the deficit in this -pool increases until the available carbon is being allocated mostly to -alleviate the deficit, and new growth approaches zero. The allocation -flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC -m\ :sup:`-2` s\ :sup:`-1`) is given as - -.. math:: - :label: 17.4) - - CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. - -.. math:: - :label: 17.5) - - CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPPpot} -CF_{GPP,mr} } \\ {\max (CF_{GPPpot} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPPpot} -CF_{GPP,mr} } \end{array}\right. - -where :math:`\tau_{xs}` is the time constant (currently -set to 30 days) controlling the rate of replenishment of :math:`CS_{xs}`. - -Note that these two top-priority carbon allocation fluxes -(:math:`CF_{GPP,mr}` and :math:`CF_{GPP,xs}`) are not -stoichiometrically associated with any nitrogen fluxes, and so this -initial allocation step can proceed without reference to (or limitation -from) the available mineral nitrogen supply. - -Carbon and Nitrogen Stoichiometry of New Growth ----------------------------------------------------- - -After accounting for the carbon cost of maintenance respiration, the -remaining carbon flux from photosynthesis which can be allocated to new -growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is - -.. math:: - :label: 17.6) - - CF_{avail\_ alloc} =CF_{GPPpot} -CF_{GPP,mr} -CF_{GPP,xs} . - -Potential allocation to new growth is calculated for all of the plant -carbon and nitrogen state variables based on specified C:N ratios for -each tissue type and allometric parameters that relate allocation -between various tissue types. The allometric parameters are defined as -follows: - -.. math:: - :label: ZEqnNum650137 - - \begin{array}{l} {a_{1} ={\rm \; ratio\; of\; new\; fine\; root\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{2} ={\rm \; ratio\; of\; new\; coarse\; root\; :\; new\; stem\; carbon\; allocation}} \\ {a_{3} ={\rm \; ratio\; of\; new\; stem\; :\; new\; leaf\; carbon\; allocation}} \\ {a_{4} ={\rm \; ratio\; new\; live\; wood\; :\; new\; total\; wood\; allocation}} \\ {g_{1} ={\rm ratio\; of\; growth\; respiration\; carbon\; :\; new\; growth\; carbon.\; }} \end{array} - -Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined -as constants for a given PFT (:numref:`Table Allocation and carbon:nitrogen -ratio parameters`), while :math:`g_{l }` = 0.3 (unitless) is prescribed as a -constant for all PFTs, based on construction costs for a range of woody -and non-woody tissues (:ref:`Larcher, 1995 `). - -CLM5.0 applies a fixed allocation scheme for woody vegetation. -The decision to use the fixed allocation scheme in CLM5.0 came -from biases in above-ground biomass illustrated by Negrón-Juárez -et al. (:ref:`2015 `). - -The model maintains the capacity to represent a dynamic allocation scheme -for woody vegetation (parameter :math:`a_{3}` = -1, :numref:`Table Allocation -and carbon:nitrogen ratio parameters`), but this is not the default -configuration. With dynamic allocation the ratio for carbon allocation -between new stem and new leaf increases with increasing net primary -production (NPP), as - -.. math:: - :label: 17.8) - - a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 - -where :math:`NPP_{ann}` is the annual sum of NPP from the previous -year. This mechanism has the effect of increasing woody allocation in -favorable growth environments (:ref:`Allen et al., 2005 `; -:ref:`Vanninen and Makela, 2005 `) and during -the phase of stand growth prior to canopy closure (:ref:`Axelsson and -Axelsson, 1986 `). - -.. _Table Allocation and carbon:nitrogen ratio parameters: - -.. table:: Allocation and carbon:nitrogen ratio parameters. - - ======================== ============= ============= ============= ============= ================= =============== =============== =============== - Plant functional type :math:`a_{1}` :math:`a_{2}` :math:`a_{3}` :math:`a_{4}` :math:`CN_{leaf}` :math:`CN_{fr}` :math:`CN_{lw}` :math:`CN_{dw}` - ======================== ============= ============= ============= ============= ================= =============== =============== =============== - NET Temperate 1.5 0.3 2.30 0.1 58.00 42 50 500 - NET Boreal 1.5 0.3 2.30 0.1 58.00 42 50 500 - NDT Boreal 1.5 0.3 1.00 0.1 25.81 42 50 500 - BET Tropical 1.5 0.3 2.30 0.1 29.60 42 50 500 - BET temperate 1.5 0.3 1.50 0.1 29.60 42 50 500 - BDT tropical 1.5 0.3 1.00 0.1 23.45 42 50 500 - BDT temperate 1.5 0.3 2.30 0.1 23.45 42 50 500 - BDT boreal 1.5 0.3 2.30 0.1 23.45 42 50 500 - BES temperate 1.5 0.3 1.40 0.5 36.42 42 50 500 - BDS temperate 1.5 0.3 0.24 0.5 23.26 42 50 500 - BDS boreal 1.5 0.3 0.24 0.1 23.26 42 50 500 - C\ :sub:`3` arctic grass 1.5 0.0 0.00 0.0 28.03 42 0 0 - C\ :sub:`3` grass 1.5 0.0 0.00 0.0 28.03 42 0 0 - C\ :sub:`4` grass 1.5 0.0 0.00 0.0 35.36 42 0 0 - ======================== ============= ============= ============= ============= ================= =============== =============== =============== - -Carbon to nitrogen ratios are defined for different tissue types as -follows: - -.. math:: - :label: ZEqnNum413927 - - \begin{array}{l} {CN_{leaf} =\ {\rm \;C:N\; for\; leaf}} \\ {CN_{fr} =\ {\rm \;C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \;C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\ {\rm \;C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} - -where all C:N parameters are defined as constants for a given PFT -(:numref:`Table Allocation and carbon:nitrogen ratio parameters`). - -Given values for the parameters in and , total carbon and nitrogen -allocation to new growth ( :math:`CF_{alloc}`, gC -m\ :sup:`-2` s\ :sup:`-1`, and :math:`NF_{alloc}`, gN -m\ :sup:`-2` s\ :sup:`-1`, respectively) can be expressed as -functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC -m\ :sup:`-2` s\ :sup:`-1`): - -.. math:: - :label: ZEqnNum555154 - - \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} - -where - -.. math:: - :label: 17.11) - - \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} - -.. math:: - :label: 17.12) - - N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. - -Since the C:N stoichiometry for new growth allocation is defined, from -Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation -(:math:`CF_{avail\_alloc}`) can be used to calculate the total -plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, -gN m\ :sup:`-2` s\ :sup:`-1`) as: - -.. math:: - :label: 17.13) - - NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . - -Deployment of retranslocated nitrogen ------------------------------------------- - -In many plants, some portion of the nitrogen used to construct new -tissues is mobilized from senescing tissues, especially leaves, and -retained within the plant when the tissues are lost as litter. This -store of retranslocated nitrogen is used to supply part of the nitrogen -demand for subsequent growth (Magill et al., 1997; Oikawa et al., 2005; -Son and Gower, 1991). CLM includes one pool of retranslocated nitrogen -(:math:`NS_{retrans}`, gN m\ :sup:`-2`), and the -availability of nitrogen from this pool to support new growth -(:math:`NF_{avail\_retrans}`, gN m\ :sup:`-2` -s\ :sup:`-1`) is proportional to the plant nitrogen demand, as: - -.. math:: - :label: 17.14) - - NF_{avail\_ retrans} =\min \left(\frac{NF_{retrans\_ ann} \frac{NF_{plant\_ demand} }{NF_{plant\_ demand\_ ann} } }{\Delta t} ,\; \frac{NS_{retrans} }{\Delta t} \right) - -where :math:`NF_{retrans\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of retranslocated -nitrogen extracted from senescing tissues, -:math:`NF_{plant\_demand\_ann}` (gN m\ :sup:`-2` y\ :sup:`-1`) is the previous year’s annual sum of -:math:`NF_{plant\_demand}`, and :math:`\Delta`\ *t* (s) is the -model’s biogeochemistry time step. This formulation produces an annual -cycle in the extraction of nitrogen from :math:`NS_{retrans}` -which corresponds to the annual cycle of plant nitrogen demand, and -which is scaled to give :math:`NS_{retrans}` approximately a -one-year turnover time. The minimum function prevents extraction of more -than the remaining pool of retranslocated nitrogen, which can be an -important constraint under conditions where high rates of mortality are -modifying the size of the pool. During the first year of an initial -simulation, before :math:`NF_{plant\_demand\_ann}` and -:math:`NF_{retrans\_ann}` have valid values, -:math:`NF_{avail\_retrans}` is set to 0.0. - -The actual flux of nitrogen from the retranslocated N pool into -allocation of new growth (:math:`NF_{retrans,alloc}`, gN -m\ :sup:`-2` s\ :sup:`-1`) is never greater than the plant -demand for new nitrogen: - -.. math:: - :label: 17.15) - - NF_{retrans,alloc} =\min \left(NF_{plant\_ demand} ,NF_{avail\_ retrans} \right) - -Plant nitrogen uptake from soil mineral nitrogen pool ----------------------------------------------------------- - -The total plant nitrogen demand is reduced by the nitrogen flux from -:math:`NS_{retrans}` to give the plant demand for mineral nitrogen -from the soil (:math:`NF_{plant\_demand\_soil}`, gN -m\ :sup:`-2` s\ :sup:`-1`): - -.. math:: - :label: ZEqnNum491412 - - NF_{plant\_ demand\_ soil} =NF_{plant\_ demand} -NF_{retrans,alloc} . - -The combined demand from all PFTs sharing space on a soil column and the -demand from the heterotrophic community in the soil (nitrogen -immobilization demand) compete for the available soil mineral nitrogen -pool. The result of this competition is passed back to the allocation -algorithm as :math:`f_{plant\_demand}`, the fraction (from 0 to 1) -of the plant nitrogen demand which can be met given the current soil -mineral nitrogen supply and competition with heterotrophs. Plant uptake -from the soil mineral nitrogen pool is then given as: - -.. math:: - :label: 17.17) - - NF_{sminn,alloc} =NF_{plant\_ demand\_ soil} f_{plant\_ demand} - -Final carbon and nitrogen allocation ------------------------------------------ - -The total flux of allocated nitrogen is given as: - -.. math:: - :label: 17.18) - - NF_{alloc} =NF_{retrans,alloc} +NF_{sminn,alloc} - -From the stoichiometric relationship in Eq. , the associated carbon -allocation flux is: - -.. math:: - :label: 17.19) - - CF_{alloc} =NF_{alloc} \frac{C_{allom} }{N_{allom} } . - -The downregulation of photosynthesis can then be calculated as: - -.. math:: - :label: 17.20) - - f_{dreg} =\frac{CF_{alloc} -CF_{avail\_ alloc} }{CF_{GPPpot} } . - -Total allocation to new leaf carbon -(:math:`CF_{alloc,leaf\_tot}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as: - -.. math:: - :label: 17.21) - - CF_{alloc,leaf\_ tot} =\frac{CF_{alloc} }{C_{allom} } . - -There are two carbon pools associated with each plant tissue – one which -represents the currently displayed tissue, and another which represents -carbon stored for display in a subsequent growth period. The nitrogen -pools follow this same organization. The model keeps track of stored -carbon according to which tissue type it will eventually be displayed -as, and the separation between display in the current timestep and -storage for later display depends on the parameter :math:`f_{cur}` -(values 0 to 1). Given :math:`CF_{alloc,leaf}` and :math:`f_{cur}`, the allocation fluxes of carbon to display and -storage pools (where storage is indicated with *\_stor*) for the various -tissue types are given as: - -.. math:: - :label: 17.22) - - CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} - -.. math:: - :label: 17.23) - - CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) - -.. math:: - :label: 17.24) - - CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} - -.. math:: - :label: 17.25) - - CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) - -.. math:: - :label: 17.26) - - CF_{alloc,livestem} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} f_{cur} - -.. math:: - :label: 17.27) - - CF_{alloc,livestem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} a_{4} \left(1-f_{cur} \right) - -.. math:: - :label: 17.28) - - CF_{alloc,deadstem} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)f_{cur} - -.. math:: - :label: 17.29) - - CF_{alloc,deadstem\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right) - -.. math:: - :label: 17.30) - - CF_{alloc,livecroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} f_{cur} - -.. math:: - :label: 17.31) - - CF_{alloc,livecroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} \left(1-f_{cur} \right) - -.. math:: - :label: 17.32) - - CF_{alloc,deadcroot} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)f_{cur} - -.. math:: - :label: 17.33) - - CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). - -The corresponding nitrogen allocation fluxes are given as: - -.. math:: - :label: 17.34) - - NF_{alloc,leaf} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } f_{cur} - -.. math:: - :label: 17.35) - - NF_{alloc,leaf\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} }{CN_{leaf} } \left(1-f_{cur} \right) - -.. math:: - :label: 17.36) - - NF_{alloc,froot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } f_{cur} - -.. math:: - :label: 17.37) - - NF_{alloc,froot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{1} }{CN_{fr} } \left(1-f_{cur} \right) - -.. math:: - :label: 17.38) - - NF_{alloc,livestem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } f_{cur} - -.. math:: - :label: 17.39) - - NF_{alloc,livestem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) - -.. math:: - :label: 17.40) - - NF_{alloc,deadstem} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} - -.. math:: - :label: 17.41) - - NF_{alloc,deadstem\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right) - -.. math:: - :label: 17.42) - - NF_{alloc,livecroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } f_{cur} - -.. math:: - :label: 17.43) - - NF_{alloc,livecroot\_ stor} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} a_{4} }{CN_{lw} } \left(1-f_{cur} \right) - -.. math:: - :label: 17.44) - - NF_{alloc,deadcroot} \_ =\frac{CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } f_{cur} - -.. math:: - :label: 17.45) - - NF_{alloc,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). - Autotrophic Respiration ---------------------------- @@ -442,19 +14,17 @@ defined as the carbon cost to support the metabolic activity of existing live tissue, while growth respiration is defined as the additional carbon cost for the synthesis of new growth. -13.7.1 Maintenance Respiration +Maintenance Respiration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Under the assumption that tissue nitrogen content is a suitable index of -cellular metabolic rate, maintenance respiration costs for live tissues -(leaf, live stem, live coarse root, and fine root) are calculated as -functions tissue nitrogen content and the relevant temperature, -following the empirical relationship reported by Ryan (1991): +Atkin et al. (2016) propose a model for respiration that is based on the leaf nitrogen content per unit area (:math:`NS_{narea}` (gN m :sup:`2` leaf), with an intercept parameter that is PFT dependant, and an acclimation term that depends upon the average temperature of the previous 10 day period :math:`t_{2m,10days}`, in Celsius. .. math:: - :label: 17.46) + :label: 17.46) - CF_{mr\_ leaf} \_ =NS_{leaf} MR_{base} MR_{Q10} ^{(T_{2m} -20)/10} + CF_{mr\_ leaf} = i_{atkin,pft} + (NS_{narea} 0.2061) - (0.0402 (t_{2m,10days})) + +The temperature dependance of leaf maintenance (dark) respiration is described in Chapter :numref:`rst_Stomatal Resistance and Photosynthesis`. .. math:: :label: 17.47) @@ -471,14 +41,34 @@ following the empirical relationship reported by Ryan (1991): CF_{mr\_ froot} \_ =\sum _{j=1}^{nlevsoi}NS_{froot} rootfr_{j} MR_{base} MR_{Q10} ^{(Ts_{j} -20)/10} -where :math:`MR_{base}` (= 2.525e\ :sup:`-6` gC gN\ :sup:`-1` s\ :sup:`-1`) is the base rate of maintenance -respiration per unit nitrogen content, :math:`MR_{q10}` (= 2.0) is +where :math:`MR_{q10}` (= 2.0) is the temperature sensitivity for maintenance respiration, :math:`T_{2m}` (:sup:`o`\ C) is the air temperature at 2m height, :math:`Ts_{j}`* (:sup:`o`\ C) is the soil temperature at level *j*, and :math:`rootfr_{j}` is the fraction of fine roots distributed in soil level *j*. +.. table:: Atkin leaf respiration model intercept values. + + ======================== ============= + Plant functional type :math:`i_{atkin}` + ======================== ============= + NET Temperate 1.499 + NET Boreal 1.499 + NDT Boreal 1.499 + BET Tropical 1.756 + BET temperate 1.756 + BDT tropical 1.756 + BDT temperate 1.756 + BDT boreal 1.756 + BES temperate 2.075 + BDS temperate 2.075 + BDS boreal 2.075 + C\ :sub:`3` arctic grass 2.196 + C\ :sub:`3` grass 2.196 + C\ :sub:`4` grass 2.196 + ======================== ============= + Note that, for woody vegetation, maintenance respiration costs are not calculated for the dead stem and dead coarse root components. These components are assumed to consist of dead xylem cells, with no metabolic @@ -494,12 +84,12 @@ The total maintenance respiration cost is then given as: CF_{mr} =CF_{mr\_ leaf} +CF_{mr\_ froot} +CF_{mr\_ livestem} +CF_{mr\_ livecroot} . -13.7.2 Growth Respiration +Growth Respiration ^^^^^^^^^^^^^^^^^^^^^^^^^ -Growth respiration is calculated as a factor of 0.3 times the total +Growth respiration is calculated as a factor of 0.11 times the total carbon in new growth on a given timestep, based on construction costs -for a range of woody and non-woody tissues (Larcher, 1995). For new +for a range of woody and non-woody tissues (Atkin et al. in prep). For new carbon and nitrogen allocation that enters storage pools for subsequent display, it is not clear what fraction of the associated growth respiration should occur at the time of initial allocation, and what From 21daba770bede96ee552a88ecb5a8b7a4fe41849 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Fri, 1 Dec 2017 12:28:30 -0700 Subject: [PATCH 113/730] modifications to respiration. altered growth respiration description --- .../Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 0ec9d5e1d6..33b9477ed1 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -88,7 +88,8 @@ Growth Respiration ^^^^^^^^^^^^^^^^^^^^^^^^^ Growth respiration is calculated as a factor of 0.11 times the total -carbon in new growth on a given timestep, based on construction costs +carbon allocation to new growth (:math:`CF_{growth}`, after allocating carbon for N acquisition, +Chapter :numref:`rst_FUN`.)on a given timestep, based on construction costs for a range of woody and non-woody tissues (Atkin et al. in prep). For new carbon and nitrogen allocation that enters storage pools for subsequent display, it is not clear what fraction of the associated growth From 8a922b4caad36e64acd2df7b16770f6c3530bbd9 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Thu, 7 Dec 2017 11:20:00 -0700 Subject: [PATCH 114/730] added CLM(FATES) tech note to DGVM chapter. Refs still need formatting --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 3825 ++++++++++++++++- 1 file changed, 3676 insertions(+), 149 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 8608521802..72001f2827 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -1,157 +1,3684 @@ +====================================== +CLM(ED) model: Technical Documentation +====================================== + .. _rst_Dynamic Global Vegetation Model: -Dynamic Global Vegetation Model +Dynamic Global Vegetation =================================== -In CLM the user may choose to run the CN model as a dgvm (dynamic global -vegetation model) (CNDV). Note that CN must be active to run the dgvm in -CLM. In this section, a general description of the dgvm processes and -how they integrate with CN are provided. Further details are available -in the CLM3DGVM Technical Note (Levis et al. 2004). The focus here is on -the differences relative to the corresponding processes in the CLM3DGVM. - -As with the CLM3DGVM, CNDV can simulate biogeographical changes only for -natural vegetation. Although the vegetated land unit may be separated -into naturally vegetated and human managed land units to permit a -coexistence of natural and human managed vegetation, CNDV only works if -the human managed land units are fixed. CLM’s transient land cover and -land use change capability (see Chapter 21), which permits transitions -between natural and human managed plant functional types (PFTs), is -incompatible with the CNDV option at this time. - -CNDV was implemented by introducing CLM3DGVM code to the hourly CN -framework only to the extent necessary to simulate annual biogeography -updates. This includes the annual processes of light competition, -establishment, and survival [see sections 2.7 and 2.10, Levis et al. -(2004)] as they pertain to the calculations of PFT cover (FPC) and -population (P) but not processes related to carbon pools, leaf area -index (LAI), or canopy height. In CNDV we added complexity to the gap -mortality calculation with annual heat stress and growth efficiency -considerations from the corresponding CLM3DGVM algorithm [section 2.8, -Levis et al. (2004)]. All other ecosystem processes (allocation, -phenology, fire, etc.) are handled by CN modules. Unlike in the -CLM3DGVM, in CNDV, annual biogeography updates are interpolated to -hourly intervals. - -Establishment and survival -------------------------------- +What has changed +---------------- + +- Deprecation of the dynamic global vegetation model (DGVM): The CLM5.0 model contains the legancy 'CNDV' code, which runs the CLM4(CN) model in combination with the LPJ-derived dynamics vegetation model introduced in CLM3. While this capacity has not technically been removed from the model, the DGVM has not been tested in the development of CLM5 and is no longer scientifically supported. + +- Introduction of FATES: The Functionally Assembled Terrestrial Ecosystem Simulator (FATES) is the actively developed DGVM for the CLM5. + + +Technical Documentation for FATES +================================== + + +Preamble +======== + +| This document is a technical appendix to +| Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, + Knox RG, Koven C, Holm J, Rogers BM, Lawrence D. Taking off the + training wheels: the properties of a dynamic vegetation model without + climate envelopes. Geoscientific Model Development Discussions. 2015 + Apr 1;8(4). +| https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf + +Authors +======= + +Rosie Fisher, Stefan Muszala, Mariana Verteinstein, Peter Lawrence, Chonggang Xu,Nate McDowell, Ryan Knox, Charles Koven, Jennifer Holm, Brendan Rogers, David Lawrence, and Gordon Bonan. + +Acknowledgements +================ + +The development of the ideas in this document has benefitted from +conversation with many people, including William Bond, Peter Cox, Matthew Forest, Andrew Fox, William Hoffman, Peter Lawrence, Jeremy Lichstein, Heike Lischke, Mark Lomas, Nathan McDowell, Paul Moorcroft, Colin Prentice, Drew Purves, Naomi Tague, Benjamin Sanderson, Stephen Sitch, Abigail Swann, Anthony Walker, Mathew Williams, F.Ian Woodward \& S\"onke Zaehle. + + +Introduction +============ + +The CLM(ED) model is presented here as an option within the structure of +the Community Land Model (CLM). Ecosystem Demography (‘ED’), is a +concept derived from the work of :raw-latex:`\cite{mc_2001}` and is a +cohort model of vegetation competition and co-existence, allowing a +representation of the biosphere which accounts for the division of the +land surface into successional stages, and the competition for light +between height structured cohorts of representative trees of various +plant functional types. This implementation of the Ecosystem Demography +concept links the surface flux and canopy physiology concepts in the CLM +with numerous additional developments necessary to accommodate the new +model also documented here. These include a version of the SPITFIRE +(Spread and InTensity of Fire) model of +:raw-latex:`\parencite{thonicke2010}`, and an adoption of the concept of +‘perfect plasticity’ approach of +:raw-latex:`\parencite{purves2008,lichstein2011,weng2014}` in accounting +for the spatial arrangement of crowns. Novel algorithms accounting for +the fragmentation of coarse woody debris into chemical litter streams, +for the physiological optimisation of canopy thickness, for the +accumulation of seeds in the seed bank, for multi-layer multi-PFT +radiation transfer, for drought-deciduous and cold-deciduous phenology, +for carbon storage allocation, and for tree mortality under carbon +stress, are also included and presented here. + +This Document +------------- + +This document describes the implementation of the Ecosystem Demography +concept within the Community Land Model. It is intended as a +supplementary document to the main CLM technical note, which is at the +time of writing, the CLM4.5 technical note +:raw-latex:`\parencite{oleson2013}`. The material covered describes how +the Ecosystem Demography code is organized, how it interacts with the +pre-existing CLM routines, and the new aspects of plant physiology and +vegetation dynamics that are introduced further to those already +existing within the model. Numerous other implementations of the +Ecosystem Demography concept are in existence, in particular the ED2 +model, which is a fully operational land surface scheme +:raw-latex:`\parencite{medvigy2009}` which contains both the basic ED +concept and an array of physiological and ecological innovations +surrounding the basic concept. Therefore, to avoid confusion between the +concept of ‘Ecosystem Demography’ and the implementation of this concept +in different models, we refer our model as the ‘CLM(ED)’ throughout. + +The representation of ecosystem heterogeneity in the CLM(ED) +============================================================ + +The land surface of the Earth is heterogeneous for many reasons, driven +by variations in climate, edaphic history, ecological variability, +geological forcing and human interventions. Land surface models +represent this variability first by introducing a grid structure to the +land surface, allowing different atmospheric forcings to operate in each +grid cell, and subsequently by representing ‘sub-grid’ variability in +the surface properties. In the CLM, the land surface is divided into +numerous ‘landunits’ corresponding to the underlying condition of the +surface (e.g. soils, ice, lakes, bare ground) and then ‘columns’ +referring to elements of the surface that share below ground resources +(water & nutrients). Within the ‘soil’ landunit, for example, there are +separate columns for crops, and for natural vegetation, as these are +assumed to use separate resource pools. The CLM(ED) model at present +only operates on the naturally vegetated column. The ‘soil’ column is +sub-divided into numerous tiles, that correspond to statistical +fractions of the potentially vegetated land area. In the CLM 4.5 (and +all previous versions of the model), sub-grid tiling operates on the +basis of plant functional types (PFTs). That is, each piece of land is +assumed to be occupied by only one plant functional type, with multiple +PFT-specific tiles sharing a common soil water and nutrient pool. This +PFT-based tiling structure is the standard method used by most land +surface models deployed in climate prediction. + +The introduction of the Ecosystem Demography concept introduces +significant alterations to the representation of the land surface in the +CLM. In the CLM(ED), the tiling structure represents the disturbance +history of the ecosystem. Thus, some fraction of the land surface is +characterized as ‘recently disturbed’, some fraction has escaped +disturbance for a long time, and other areas will have intermediate +disturbances. Thus the ED concept essentially discretizes the trajectory +of succession from disturbed ground to ‘mature’ ecosystems. Within the +ED code, each ‘disturbance history class’ is referred to as a ‘patch’. +The word ‘patch’ has many possible interpretations, so it is important +to note that: **there is no spatial location associated with the concept +of a ‘patch’. It refers to a fraction of the potential vegetated area +consisting of all parts of the ecosystem with similar disturbance +history.** + +The ‘patch’ organizational structure in CLM thus replaces the previous +‘PFT’ structure in the organization heirarchy. The original hierarchical +land surface organizational structure of CLM as described in +:raw-latex:`\cite{oleson2013}` may be depicted as: + +.. math:: + + \mathbf{gridcell} \left\{ + \begin{array}{cc} + \mathbf{landunit} & \\ + \mathbf{landunit} &\left\{ + \begin{array}{ll} + \mathbf{column}&\\ + \mathbf{column}&\left\{ + \begin{array}{ll} + \mathbf{pft}&\\ + \mathbf{pft}&\\ + \mathbf{pft}&\\ + \end{array}\right.\\ + \mathbf{column}&\\ + \end{array}\right.\\ + \mathbf{landunit} & \\ + \end{array}\right. + +and the new structure is altered to the following: + +.. math:: + + \mathbf{gridcell} \left\{ + \begin{array}{cc} + \mathbf{landunit} & \\ + \mathbf{landunit} &\left\{ + \begin{array}{ll} + \mathbf{column}&\\ + \mathbf{column}&\left\{ + \begin{array}{ll} + \mathbf{patch}&\\ + \mathbf{patch}&\\ + \mathbf{patch}&\\ + \end{array}\right.\\ + \mathbf{column}&\\ + \end{array}\right.\\ + \mathbf{landunit} & \\ + \end{array}\right. + +Thus, each gridcell becomes a matrix of ‘patches’ that are +conceptualized by their ‘age since disturbance’ in years. This is the +equivalent of grouping together all those areas of a gridcell that are +‘canopy gaps’, into a single entity, and all those areas that are +‘mature forest’ into a single entity. + +Cohortized representation of tree populations +--------------------------------------------- + +Each common-disturbance-history patch is a notional ecosystem that might +in reality contain numerous individual plants which vary in their +physiological attributes, in height and in spatial position. One way of +addressing this heterogeneity is to simulate a forest of specific +individuals, and to monitor their behavior through time. This is the +approach taken by ‘gap’ and individual-based +:raw-latex:`\parencite{smith2001,sato2007,uriarte2009,fyllas2014}`. The +depiction of individuals typically implies that the outcome of the model +is stochastic. This is because we lack the necessary detailed knowledge +to simulate the individual plant’s fates. Thus gap models imply both +stochastic locations and mortality of plants. Thus, (with a genuinely +random seed) each model outcome is different, and an ensemble of model +runs is required to generate an average representative solution. Because +the random death of large individual trees can cause significant +deviations from the mean trajectory for a small plot (a typical +simulated plot size is 30m x 30 m) the number of runs required to +minimize these deviations is large and computationally expensive. For +this reason, models that resolve individual trees typically use a +physiological timestep of one day or longer (e.g. +:raw-latex:`\cite{smith2001,xiaodong2005,sato2007}` + +The approach introduced by the Ecosystem Demography model +:raw-latex:`\parencite{mc_2001}` is to group the hypothetical population +of plants into ‘cohorts’. In the notional ecosystem, after the +land-surface is divided into common-disturbance-history patches, the +population in each patch is divided first into plant functional types +(the standard approach to representing plant diversity in large scale +vegetation models), and then each plant type is represented as numerous +height classes. Importantly, **for each PFT/height class bin, we model +*one* representative individual plant, which tracks the average +properties of this ‘cohort’ of individual plants.** Thus, each +common-disturbance-history patch is typically occupied by a set of +cohorts of different plant functional types, and different height +classes within those plant functional types. Each cohort is associated +with a number of identical trees, :math:`n_{coh}` (where :math:`{coh}` +denotes the identification or index number for a given cohort).. + +The complete hierarchy of elements in the CLM(ED) is therefore now +described as follows: + +.. math:: + + \mathbf{gridcell}\left\{ + \begin{array}{cc} + \mathbf{landunit} & \\ + \mathbf{landunit} &\left\{ + \begin{array}{ll} + \mathbf{column}&\\ + \mathbf{column}&\left\{ + \begin{array}{ll} + \mathbf{patch}&\\ + \mathbf{patch}&\left\{ + \begin{array}{ll} + \mathbf{cohort}&\\ + \mathbf{cohort}&\\ + \mathbf{cohort}&\\ + \end{array}\right.\\ + \mathbf{patch}&\\ + \end{array}\right.\\ + \mathbf{column}&\\ + \end{array}\right.\\ + \mathbf{landunit} & \\ + \end{array}\right. + +Discretization of cohorts and patches +------------------------------------- + +Newly disturbed land and newly recruited seedlings can in theory be +generated at each new model timestep as the result of germination and +disturbance processes. If the new patches and cohorts established at +*every* timestep were tracked by the model structure, the computational +load would of course be extremely high (and thus equivalent to an +individual-based approach). A signature feature of the ED model is the +system by which ‘functionally equivalent’ patches and cohorts are fused +into single model entities to save memory and computational time. + +[1]_ This functionality requires that criteria are established for the +meaning of `functional equivalence’, which are by necessity slightly +subjective, as they represent ways of abstracting reality into a more +tractable mathematical representation. As an example of this, for +height-structured cohorts, we calculate the relativized differences in +height (:math:`h_{coh}`, m) between two cohorts of the same pft, +:math:`p` and :math:`q` as + +.. math:: d_{hite,p,q} = \frac{\mathrm{abs}.(h_{p-}h_{q})}{\frac{1}{2}(h_{p}+h_{q})} + +If :math:`d_{hite,p,q}` is smaller than some threshold :math:`t_{ch}`, +and they are of the same plant functional type, the two cohorts are +considered equivalent and merged to form a third cohort :math:`r`, with +the properties of cohort :math:`p` and :math:`q` averaged such that they +conserve mass. The model parameter :math:`t_{ch}` can be adjusted to +adjust the trade-off between simulation accuracy and computational load. +There is no theoretical optimal value for this threshold but it may be +altered to have finer or coarser model resolutions as needed. + +[2]_ Similarly, for common-disturbance-history patches, we again assign +a threshold criteria, which is then compared to the difference between +patches :math:`m` and :math:`n`, and if the difference is less than some +threshold value (:math:`t_{p}`) then patches are merged together, +otherwise they are kept separate. However, in contrast with +height-structured cohorts, where the meaning of the difference criteria +is relatively clear, how the landscape should be divided into +common-disturbance-history units is less clear. Several alternative +criteria are possible, including Leaf Area Index, total biomass and +total stem basal area. + +In this implementation of the CLM(ED) we assess the amount of +above-ground biomass in each PFT/plant diameter bin. Biomass is first +grouped into fixed diameter bins for each PFT (:math:`ft`) and a +significant difference in any bin will cause patches to remain +separated. This means that if two patches have similar total biomass, +but differ in the distribution of that biomass between diameter classes +or plant types, they remain as separate entities. Thus + +.. math:: B_{profile,m,dc,ft} = \sum_{d_{c,min}}^{d_{c,max}} (B_{ag,coh}n_{coh}) + +:math:`B_{profile,m,dc,ft}` is the binned above-ground biomass profile +for patch :math:`m`,\ :math:`d_{c}` is the diameter class. +:math:`d_{c,min}` and :math:`d_{c,max}` are the lower and upper +boundaries for the :math:`d_{c}` diameter class. :math:`B_{ag,coh}` and +:math:`n_{coh}` depict the biomass (KgC m\ :math:`^{-2}`) and the number +of individuals of each cohort respectively. A difference matrix between +patches :math:`m` and :math:`n` is thus calculated as + +.. math:: d_{biomass,mn,dc,ft} = \frac{\rm{abs}\it(B_{profile,m,hc,ft}-B_{profile,n,hc,ft})}{\frac{1}{2}(B_{profile,m,hc,ft}+B_{profile,n,hc,ft})} + +If all the values of :math:`d_{biomass,mn,hc,ft}` are smaller than the +threshold, :math:`t_{p}`, then the patches :math:`m` and :math:`n` are +fused together to form a new patch :math:`o`. + +To increase computational efficiency and to simplify the coding +structure of the model, the maximum number of patches is capped at +:math:`P_{no,max}`. To force the fusion of patches down to this number, +the simulation begins with a relatively sensitive discretization of +patches (:math:`t_{p}` = 0.2) but if the patch number exceeds the +maximum, the fusion routine is repeated iteratively until the two most +similar patches reach their fusion threshold. This approach maintains an +even discretization along the biomass gradient, in contrast to, for +example, simply fusing the oldest or youngest patches together. + +[3]_ The area of the new patch (:math:`A_{patch,o}`, m\ :math:`^{2}`) +is the sum of the area of the two existing patches, + +.. math:: A_{patch,o} = A_{patch,n} + A_{patch,m} + +and the cohorts ‘belonging’ to patches :math:`m` and :math:`n` now +co-occupy patch :math:`o`. The state properties of :math:`m` and +:math:`n` (litter, seed pools, etc. ) are also averaged in accordance +with mass conservation . + +Linked Lists: the general code structure of CLM(ED) +--------------------------------------------------- + +[4]_ The number of patches in each natural vegetation column and the +number of cohorts in any given patch are variable through time because +they are re-calculated for each daily timestep of the model. The more +complex an ecosystem, the larger the number of patches and cohorts. For +a slowly growing ecosystem, where maximum cohort size achieved between +disturbance intervals is low, the number of cohorts is also low. For +fast-growing ecosystems where many plant types are viable and maximum +heights are large, more cohorts are required to represent the ecosystem +with adequate complexity. + +In terms of variable structure, the creation of an array whose size +could accommodate every possible cohort would mean defining the maximum +potential number of cohorts for every potential patch, which would +result in very large amounts of wasted allocated memory, on account of +the heterogeneity in the number of cohorts between complex and simple +ecosystems (n.b. this does still happen for some variables at restart +timesteps). To resolve this, the cohort structure in the CLM(ED) model +does not use an array system for internal calculations. Instead it uses +a system of *linked lists* where each cohort structure is linked to the +cohorts larger than and smaller than itself using a system of pointers. +The shortest cohort in each patch has a ‘shorter’ pointer that points to +the *null* value, and the tallest cohort has a ‘taller’ pointer that +points to the null value. + +Instead of iterating along a vector indexed by :math:`coh`, the code +structures typically begin at the tallest cohort in a given patch, and +iterate until a null pointer is encountered. + +Using this structure, it is therefore possible to have an unbounded + upper limit on cohort number, and also to easily alter the ordering of + cohorts if, for example, a cohort of one functional type begins to + grow faster than a competitor of another functional type, and the + cohort list can easily be re-ordered by altering the pointer + structure. Each cohort has `pointers` indicating to which patch and + gridcell it belongs. The patch system is analogous to the cohort + system, except that patches are ordered in terms of their relative age, with + pointers to older and younger patches where cp\ :math:`_1` is the + oldest: + + +Indices used in CLM(ED) +----------------------- + +Some of the indices used in the CLM(ED) are similar to those used in the +standard CLM4.5 model; column (:math:`c`), land unit(\ :math:`l`), grid +cell(\ :math:`g`) and soil layer (:math:`j`). On account of the +additional complexity of the new representation of plant function, +several additional indices are introduced that describe the +discritization of plant type, fuel type, litter type, plant height, +canopy identity, leaf vertical structure and fuel moisture +characteristics. To provide a reference with which to interpret the +equations that follow, they are listed here. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Table of subscripts used in this document } + ++------------------+-----------------------+ +| Parameter Symbol | Parameter Name | ++==================+=======================+ +| *ft* | Plant Functional Type | ++------------------+-----------------------+ +| *fc* | Fuel Class | ++------------------+-----------------------+ +| *lsc* | Litter Size Class | ++------------------+-----------------------+ +| *coh* | Cohort Index | ++------------------+-----------------------+ +| *patch* | Patch Index | ++------------------+-----------------------+ +| *Cl* | Canopy Layer | ++------------------+-----------------------+ +| *z* | Leaf Layer | ++------------------+-----------------------+ +| *mc* | Moisture Class | ++------------------+-----------------------+ + +.. raw:: latex + + \bigskip -The PFT distribution in the vegetated land unit is typically prescribed -in CLM (see section 2.1.2) except for the case when CNDV is active. In -CNDV the model begins with no PFT information per grid cell and -evaluates whether or not a PFT may establish or survive according to the -PFT’s bioclimatic limits (:numref:`Table Plant functional type (PFT) biogeography rules`). Shrub PFTs are treated as trees -at establishment. - -CNDV omits the CLM3DGVM’s annual introduction of saplings when a PFT can -establish. The CLM3DGVM merged sapling carbon pools with a PFT’s -existing carbon. The resultant leaf carbon (annual maximum value) would -update the FPC, i.e. the foliar projective cover or fraction of the -vegetated land unit occupied by the PFT [section 2.10, Levis et al. -(2004)]. Instead, CNDV updates the FPC using the PFT’s annual maximum -leaf carbon without an addition from saplings. For newly established -PFTs, CNDV assigns seed leaf carbon equal to 1 g C m\ :sup:`-2` of -land unit area and seed FPC equal to 0.05 for grasses and 0.000844 for -trees (values determined from CLM3DGVM simulations). The addition of -establishing individuals to *P*, a PFT’s population, is handled as in -the CLM3DGVM. - -*FPC* changes annually as in the CLM3DGVM but now is interpolated to an -hourly increment using the algorithms designed to conserve energy and -mass in the CLM’s dynamic land use option. - -Light competition +Cohort State Variables ---------------------- -In CNDV’s order of annual processes, light competition is invoked before -establishment and survival. However, light competition does not affect a -simulation starting from bare ground until the vegetation fills the land -unit (a few years at least). - -Light competition starts with a calculation updating *FPC*. For -reference, this update was included at the end of allocation in the -CLM3DGVM [section 2.6, Levis et al. (2004)]. - -Due to their height advantage, trees will cover up to 95% of the land -unit when their productivity permits, as in the CLM3DGVM, regardless of -grass and shrub productivity. Grasses get second priority, as in the -CLM3DGVM, even with shrubs included now. Shrubs, then, have access to -the remaining space and follow the tree algorithm for self thinning -[section 2.7, Levis et al. (2004)]. As a result, trees typically -dominate in the most productive regions, grasses in less productive -regions, and shrubs in the least productive non-desert regions (Zeng et -al. 2008). - -CN processes modified for the CNDV coupling ------------------------------------------------- - -Gap mortality and mortality from fire: Constant annual mortality rate of -0.02 is changed for trees and shrubs to an annual rate calculated as in -the CLM3DGVM accounting for background and stress mortality [section -2.8, Levis et al. (2004)]. The CN module converts the annual rate to -hourly. - -The CLM3DGVM used the concepts of average plant individual and PFT -population, *P*. CNDV retains these concepts in the light competition, -establishment, and survival calculations. In CNDV we account for the -individuals removed hourly from *P* in response to CN’s fire and gap -mortality, while the carbon pools per individual and FPC remain -constant. Ultimately, *P* updates should only affect the annual -processes of light competition, establishment, and survival, so the *P* -update may be moved to the end of the year in a future version of CNDV. - -Vegetation Structure Update: CN stocking is a constant, while in CNDV -stocking changes as P and FPC change. This affects the top-of-canopy -height calculation. CN specific leaf area and stem diameter calculations -are kept, while the height calculation is replaced with the CLM3DGVM’s -[section 2.6, Levis et al. (2004)]. CN stem area index (SAI) is kept. - -Allocation: CN calculates a PFT’s fraction of currently allocated carbon -relative to the total allocation instead of obtaining a constant value -from CLM’s PFT-physiology file. In CNDV, we returned to the constant -values in the old PFT-physiology file to get a reasonable simulation of -PFTs. For CNDV to use the calculated fraction, we will need to change -the algorithm for PFTs in early stages of growth. - -.. _Table Plant functional type (PFT) biogeography rules: - -.. table:: Plant functional type (PFT) biogeography rules with respect to climate. - - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | | Survival | | | | - +=============================================+==============================================+==============================================+=========================+========+ - | | :math:`{T}_{c,min}` (:math:`\circ`\ C) | :math:`{T}_{c,max}` (:math:`\circ`\ C) | :math:`{GDD}_{min}` | | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Tropical broadleaf evergreen tree (BET) | | 15.5 | No limit | 0 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Tropical broadleaf deciduous tree (BDT) | | 15.5 | No limit | 0 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Temperate needleleaf evergreen tree (NET) | | -2.0 | 22.0 | 900 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Temperate broadleaf evergreen tree (BET) | | 3.0 | 18.8 | 1200 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Temperate broadleaf deciduous tree (BDT) | | -17.0 | 15.5 | 1200 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Boreal needleleaf evergreen tree (NET) | | -32.5 | -2.0 | 600 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Boreal deciduous tree | | No limit | -2.0 | 350 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Temperate broadleaf deciduous shrub (BDS) | | -17.0 | No limit | 1200 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | Boreal broadleaf deciduous shrub (BDS) | | No limit | -2.0 | 350 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | C\ :sub:`4` | | 15.5 | No limit | 0 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | C\ :sub:`3` | | -17.0 | 15.5 | 0 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - | C\ :sub:`3` arctic | | No limit | -17.0 | 0 | - +---------------------------------------------+----------------------------------------------+----------------------------------------------+-------------------------+--------+ - -Adapted from Table 1 of Levis et al. (2004) to include shrub PFTs. -:math:`T_{c,\min }` , coldest minimum monthly air temperature for -survival of previously established PFTs; :math:`T_{c,\max }` , warmest -minimum monthly air temperature for establishment of new PFTs; -:math:`GDD_{\min }` , minimum annual growing degree-days above -5\ :math:`{}^\circ`\ C for establishment of new PFTs. Levis et al. -(2004) include an explanation of these variables and their use. +The unit of allometry in the ED model is the cohort. Each cohort +represents a group of plants with similar functional types and heights +that occupy portions of column with similar disturbance histories. The +state variables of each cohort therefore consist of several pieces of +information that fully describe the growth status of the plant and its +position in the ecosystem structure, and from which the model can be +restarted. The state variables of a cohort are as follows: + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{State Variables of `cohort' sructure} + ++-----------------+-----------------+-----------------+-----------------+ +| Quantity | Variable name | Units | Notes | ++=================+=================+=================+=================+ +| Plant | :math:`{\it{ft} | integer | | +| Functional Type | _{coh}}` | | | ++-----------------+-----------------+-----------------+-----------------+ +| Number of | :math:`n_{coh}` | n per | | +| Individuals | | 10000m\ :math:` | | +| | | ^{-2}` | | ++-----------------+-----------------+-----------------+-----------------+ +| Height | :math:`h_{coh}` | m | | ++-----------------+-----------------+-----------------+-----------------+ +| Diameter | :math:`\it{dbh_ | cm | | +| | {coh}}` | | | ++-----------------+-----------------+-----------------+-----------------+ +| Structural | :math:`{b_{stru | KgC | Stem wood | +| Biomass | c,coh}}` | plant\ :math:`^ | (above and | +| | | {-1}` | below ground) | ++-----------------+-----------------+-----------------+-----------------+ +| Alive Biomass | :math:`{b_{aliv | KgC | Leaf, fine root | +| | e,coh}}` | plant\ :math:`^ | and sapwood | +| | | {-1}` | | ++-----------------+-----------------+-----------------+-----------------+ +| Stored Biomass | :math:`{b_{stor | KgC | Labile carbon | +| | e,coh}}` | plant\ :math:`^ | reserve | +| | | {-1}` | | ++-----------------+-----------------+-----------------+-----------------+ +| Leaf memory | :math:`{l_{memo | KgC | Leaf mass when | +| | ry,coh}}` | plant\ :math:`^ | leaves are | +| | | {-1}` | dropped | ++-----------------+-----------------+-----------------+-----------------+ +| Canopy Layer | :math:`{C_{l,co | integer | 1 = top layer | +| | h}}` | | | ++-----------------+-----------------+-----------------+-----------------+ +| Phenological | :math:`{S_{phen | integer | 1=leaves off. | +| Status | ,coh}}` | | 2=leaves on | ++-----------------+-----------------+-----------------+-----------------+ +| Canopy trimming | :math:`C_{trim, | fraction | 1.0=max leaf | +| | coh}` | | area | ++-----------------+-----------------+-----------------+-----------------+ +| Patch Index | :math:`{p_{coh} | integer | To which patch | +| | }` | | does this | +| | | | cohort belong? | ++-----------------+-----------------+-----------------+-----------------+ + +Patch State Variables +--------------------- + +A patch, as discuss earlier, is a fraction of the landscape which +contains ecosystems with similar structure and disturbance history. A +patch has no spatial location. The state variables, which are +‘ecosystem’ rather than ‘tree’ scale properties, from which the model +can be restarted, are as follows + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{State variables of `patch' structure} + ++-------------+-------------+-------------+-------------+-------------+ +| Quantity | Variable | Units | Indexed By | | +| | name | | | | ++=============+=============+=============+=============+=============+ +| Area | :math:`\it{ | m\ :math:`^ | - | | +| | A_{patch}}` | {2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| Age | :math:`age_ | years | - | | +| | {patch}` | | | | ++-------------+-------------+-------------+-------------+-------------+ +| Seed | :math:`seed_| KgC | :math:`ft` | | +| | {patch}` | m\ :math:`^ | | | +| | | {-2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| Leaf Litter | :math:`l_{l | KgC | :math:`ft` | | +| | itter,patch | m\ :math:`^ | | | +| | }` | {-2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| Root Litter | :math:`r_{l | KgC | :math:`ft` | | +| | itter,patch | m\ :math:`^ | | | +| | }` | {-2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| AG Coarse | :math:` | KgC | Size Class | | +| Woody | {CWD}_{A | m\ :math:`^ | (lsc) | | +| Debris | G,patch}` | {-2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| BG Coarse | :math:` | KgC | Size Class | | +| Woody | {CWD}_{B | m\ :math:`^ | (lsc) | | +| Debris | G,patch}` | {-2}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| Canopy | :math:`S_{c | - | Canopy | | +| Spread | ,patch}` | | Layer | | ++-------------+-------------+-------------+-------------+-------------+ +| Column | :math:`{l_{ | integer | - | | +| Index | patch}}` | | | | ++-------------+-------------+-------------+-------------+-------------+ + +.. raw:: latex + + \bigskip + +Model Structure +--------------- + +Code concerned with the Ecosystem Demography model interfaces with the +CLM model in four ways: i) During initialization, ii) During the +calculation of surface processes (albedo, radiation absorption, canopy +fluxes) each model time step (typically half-hourly), iii) During the +main invokation of the ED model code at the end of each day. Daily +cohort-level NPP is used to grow plants and alter the cohort structures, +disturbance processes (fire and mortality) operate to alter the patch +structures, and all fragmenting carbon pool dynamics are calculated. iv) +during restart reading and writing. The net assimilation (NPP) fluxes +attributed to each cohort are accumulated throughout each daily cycle +and passed into the ED code as the major driver of vegetation dynamics. + +Initialization of vegetation from bare ground +============================================= + +[5]_If the model is restarted from a bare ground state (as opposed to a +pre-existing vegetation state), the state variables above are +initialized as follows. First, the number of plants per PFT is allocated +according to the initial seeding density (:math:`S_{init}`, individuals +per m\ :math:`^{2}`) and the area of the patch :math:`A_{patch}`, which +in the first timestep is the same as the area of the notional ecosystem +:math:`A_{tot}`. The model has no meaningful spatial dimension, but we +assign a notional area such that the values of ‘:math:`n_{coh}`’ can be +attributed. The default value of :math:`A_{tot}` is one hectare (10,000 +m\ :math:`^{2}`), but the model will behave identically irrepective of +the value of this parameter. + +.. math:: n_{coh,0} = S_{init}A_{patch} + +Each cohort is initialized at the minimum canopy height +:math:`h_{min,ft}`, which is specified as a parameter for each plant +functional type and denotes the smallest size of plant which is tracked +by the model. Smaller plants are not considered, and their emergence +from the recruitment processes is unresolved and therefore implicitly +parameterized in the seedling establishment model.. The diameter of each +cohort is then specified using the log-linear allometry between stem +diameter and canopy height + +.. math:: \mathit{dbh}_{coh} = 10^{\frac{\log_{10}(h_{coh}) - c_{allom}}{m_{allom}} } + +where the slope of the log-log relationship, :math:`m_{allom}` is 0.64 +and the intercept :math:`c_{allom}` is 0.37. The structural biomass +associated with a plant of this diameter and height is given (as a +function of wood density, :math:`\rho`, g cm\ :math:`^{-3}`) + +.. math:: b_{struc,coh} =c_{str}h_{coh}^{e_{str,hite}} dbh_{coh}^{e_{str,dbh}} \rho_{ft}^{e_{str,dens}} + +taken from the original ED1.0 allometry +:raw-latex:`\parencite{mc_2001}` (values of the allometric constants in +Table `[table:allom] <#table:allom>`__. The maximum amount of leaf +biomass associated with this diameter of tree is calculated according to +the following allometry + +.. math:: b_{max,leaf,coh} =c_{leaf}\it{dbh}_{coh}^{e_{leaf,dbh}} \rho_{ft}^{e_{leaf,dens}} + +from this quantity, we calculate the active/fine root biomass +:math:`b_{root,coh}` as + +.. math:: b_{root,coh} = b_{max,leaf,coh}\cdot f_{frla} + +where :math:`f_{frla}` is the fraction of fine root biomass to leaf +biomass, assigned per PFT + +.. raw:: latex + + \captionof{table}{Parameters needed for model initialization.} + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | Default Value | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`h_{min}` | Minimum plant | m | 1.5 | +| | height | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`S_{init}`| Initial | Individuals | | +| | Planting | m\ :math:`^{-2}`| | +| | density | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`A_{tot}` | Model area | m\ :math:`^{2}` | 10,000 | ++-----------------+-----------------+-----------------+-----------------+ + +[table:init] + +Allocation of live biomass to leaves roots and sapwood +------------------------------------------------------ + +[6]_Total live biomass :math:`b_{alive}` is the state variable of the model +that describes the sum of the three live biomass pools leaf +:math:`b_{leaf}`, root :math:`b_{root}` and sapwood :math:`b_{sw}` (all +in kGC individual\ :math:`^{-1}`). The quantities are constrained by the +following + +.. math:: b_{alive} = b_{leaf} + b_{root} + b_{sw} + +Sapwood volume is a function of tree height and leaf biomass + +.. math:: b_{sw} = b_{leaf}\cdot h_{coh}\cdot f_{swh} + +where :math:`f_{swh}` is the ratio of sapwood mass (kgC) to leaf mass +per unit tree height (m). Also, root mass is a function of leaf mass + +.. math:: b_{root} = b_{leaf}\cdot f_{swh} + +Thus + +.. math:: b_{alive} = b_{leaf} + b_{leaf}\cdot f_{frla} + b_{leaf}\cdot h_{coh}\cdot f_{swh} + +Rearranging gives the fraction of biomass in the leaf pool +:math:`f_{leaf}` as + +.. math:: f_{leaf} = \frac{1}{1+h_{coh}\cdot f_{swh}+f_{frla} } + +Thus, we can determine the leaf fraction from the height at the tissue +ratios, and the phenological status of the cohort :math:`S_{phen,coh}`. + +.. math:: b_{leaf} = b_{alive} \cdot l _{frac} + +To divide the live biomass pool at restart, or whenever it is +recalculated, into its consituent parts, we first + +.. math:: + + b_{leaf} = \left\{ \begin{array}{ll} + b_{alive} \cdot l _{frac}&\textrm{for } S_{phen,coh} = 1\\ + &\\ + 0&\textrm{for } S_{phen,coh} = 0\\ + \end{array} \right. + +Because sometimes the leaves are dropped, using leaf biomass as a +predictor of root and sapwood would produce zero live biomass in the +winter. To account for this, we add the LAI memory variable +:math:`l_{memory}` to the live biomass pool to account for the need to +maintain root biomass when leaf biomass is zero. Thus, to calculated the +root biomass, we use + +.. math:: b_{root} = (b_{alive}+l_{memory})\cdot l_{frac} \cdot f_{frla} + +To calculated the sapwood biomass, we use + +.. math:: b_{sw} = (b_{alive}+l_{memory})\cdot l_{frac} \cdot f_{swh} \cdot h_{coh} + +.. raw:: latex + + \captionof{table}{Allometric Constants} + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | Default Value | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`c_{allom | Allometry | | 0.37 | +| }` | intercept | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`m_{allom | Allometry slope | | 0.64 | +| }` | | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`c_{str}` | Structural | | 0.06896 | +| | biomass | | | +| | multiplier | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`e_{str,d | Structural | | 1.94 | +| bh}` | Biomass dbh | | | +| | exponent | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`e_{str,h | Structural | | 0.572 | +| ite}` | Biomass height | | | +| | exponent | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`e_{str,d | Structural | | 0.931 | +| ens}` | Biomass density | | | +| | exponent | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`c_{leaf}`| Leaf biomass | | 0.0419 | +| | multiplier | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`e_{leaf, | Leaf biomass | | 1.56 | +| dbh}` | dbh exponent | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`e_{leaf, | Leaf biomass | | 0.55 | +| dens}` | density | | | +| | exponent | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{swh}` | Ratio of | m\ :math:`^{-1}`| | +| | sapwood mass to | | | +| | height | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{frla}`| Ratio of fine | - | 1.0 | +| | root mass to | | | +| | leaf mass | | | ++-----------------+-----------------+-----------------+-----------------+ + +[table:allom] + +Canopy Structure and the Perfect Plasticity Approximation +========================================================= + + [7]_ + +During initialization and every subsequent daily ED timestep, the canopy +structure model is called to determine how the leaf area of the +different cohorts is arranged relative to the incoming radiation, which +will then be used to drive the radiation and photosynthesis +calculations. This task requires that some assumptions are made about 1) +the shape and depth of the canopy within which the plant leaves are +arranged and 2) how the leaves of different cohorts are arranged +relative to each other. This set of assumptions are critical to model +performance in ED-like cohort based models, since they determine how +light resources are partitioned between competing plants of varying +heights, which has a very significant impact on how vegetation +distribution emerges from competition +:raw-latex:`\parencite{fisher2010}`. + +The standard ED1.0 model makes a simple ’flat disk’ assumption, that the +leaf area of each cohort is spread in an homogenous layer at one exact +height across entire the ground area represented by each patch. The +CLM(ED) model has diverged from this representation due to (at least) +two problematic emergent properties that we identified as generating +unrealistic behaviours espetially for large-area patches. + +1. Over-estimation of light competition . The vertical stacking of +cohorts which have all their leaf area at the same nominal height means +that when one cohort is only very slightly taller than it’s competitor, +it is completely shaded by it. This means that any small advantage in +terms of height growth translates into a large advantage in terms of +light competition, even at the seedling stage. This property of the +model artificially exaggerates the process of light competition. In +reality, trees do not compete for light until their canopies begin to +overlap and canopy closure is approached. + +2. Unrealistic over-crowding. The ‘flat-disk’ assumption has no +consideration of the spatial extent of tree crowns. Therefore it has no +control on the packing density of plants in the model. Given a mismatch +between production and mortality, entirely unrealistic tree densities +are thus possible for some combinations of recruitment, growth and +mortality rates. + +To account for the filling of space in three dimensions using the +one-dimensional representation of the canopy employed by CLM, we +implement a new scheme derived from that of +:raw-latex:`\cite{purves2008}`. Their argument follows the development +of an individual-based variant of the SORTIE model, called SHELL, which +allows the location of individual plant crowns to be highly flexible in +space. Ultimately, the solutions of this model possess an emergent +property whereby the crowns of the plants simply fill all of the +available space in the canopy before forming a distinct understorey. + +Purves et al. developed a model that uses this feature, called the +‘perfect plasticity approximation’, which assumes the plants are able to +perfectly fill all of the available canopy space. That is, at canopy +closure, all of the available horizontal space is filled, with +negligible gaps, owing to lateral tree growth and the ability of tree +canopies to grow into the available gaps (this is of course, an +over-simplified but potential useful ecosystem property). The ‘perfect +plasticity approximation’ (PPA) implies that the community of trees is +subdivided into discrete canopy layers, and by extension, each cohort +represented by the CLM(ED) model is assigned a canopy layer status flag, +:math:`C_L`. In this version, we set the maximum number of canopy layers +at 2 for simplicity, although is possible to have a larger number of +layers in theory. :math:`C_{L,coh}` = 1 means that all the trees of +cohort :math:`coh` are in the upper canopy (overstory), and +:math:`C_{L,coh}` = 2 means that all the trees of cohort :math:`coh` are +in the understorey. + +In this model, all the trees in the canopy experience full light on +their uppermost leaf layer, and all trees in the understorey experience +the same light (full sunlight attenuated by the average LAI of the upper +canopy) on their uppermost leaves, as described in the radiation +transfer section (more nuanced versions of this approach may be +investigated in future model versions). The canopy is assumed to be +cylindrical, the lower layers of which experience self-shading by the +upper layers. + +To determine whether a second canopy layer is required, the model needs +to know the spatial extent of tree crowns. Crown area, +:math:`A_{crown}`, m\ :math:`^{2}`, is defined as + +.. math:: A_{crown,coh} = \pi (dbh_{coh} S_{c,patch,Cl})^{1.56} + +where :math:`A_{crown}` is the crown area of a single tree canopy +(m:math:`^{-2}`) and :math:`S_{c,patch,Cl}` is the ‘canopy spread’ +parameter (m cm^-1) of this canopy layer, which is assigned as a +function of canopy space filling, discussed below. In contrast to +:raw-latex:`\cite{purves2008}` , we use an exponent, identical to that +for leaf biomass, of 1.56, not 2.0, such that tree leaf area index does +not change as a function of diameter. + +To determine whether the canopy is closed, we calculate the total canopy +area as: + +.. math:: A_{canopy} = \sum_{coh=1}^{nc,patch}{A_{crown,coh}.n_{coh}} + +where :math:`nc_{patch}` is the number of cohorts in a given patch. If +the area of all crowns :math:`A_{canopy}` (m:math:`^{-2}`) is larger +than the total ground area of a patch (:math:`A_{patch}`), then some +fraction of each cohort is demoted to the understorey. + +Under these circumstances, the ‘extra’ crown area :math:`A_{loss}` +(i.e., :math:`A_{canopy}` - :math:`A_p`) is moved into the understorey. +For each cohort already in the canopy, we determine a fraction of trees +that are moved from the canopy (:math:`L_c`) to the understorey. +:math:`L_c` is calculated as :raw-latex:`\cite{fisher2010}` + +.. math:: L_{c}= \frac{A_{loss,patch} w_{coh}}{\sum_{coh=1}^{nc,patch}{w_{coh}}} , + +where :math:`w_{coh}` is a weighting of each cohort determined by basal +diameter :math:`dbh` (cm) and the competitive exclusion coefficient +:math:`C_{e}` + +.. math:: w_{coh}=dbh_{coh}C_{e}. + +The higher the value of :math:`C_e` the greater the impact of tree +diameter on the probability of a given tree obtaining a position in the +canopy layer. That is, for high :math:`C_e` values, competition is +highly deterministic. The smaller the value of :math:`C_e`, the greater +the influence of random factors on the competitive exclusion process, +and the higher the probability that slower growing trees will get into +the canopy. Appropriate values of :math:`C_e` are poorly constrained but +alter the outcome of competitive processes. + +The process by which trees are moved between canopy layers is complex +because 1) the crown area predicted for a cohort to lose may be larger +than the total crown area of the cohort, which requires iterative +solutions, and 2) on some occasions (e.g. after fire), the canopy may +open up and require ‘promotion’ of cohorts from the understorey, and 3) +canopy area may change due to the variations of canopy spread values ( +:math:`S_{c,patch,Cl}`, see the section below for details) when +fractions of cohorts are demoted or promoted. Further details can be +found in the code references in the footnote. + +Horizontal Canopy Spread +------------------------ + + [8]_ + +:raw-latex:`\cite{purves2008}` estimated the ratio between canopy and +stem diameter :math:`c_{p}` as  0.1 m cm\ :math:`^{-1}` for canopy trees +in North American forests, but this estimate was made on trees in closed +canopies, whose shape is subject to space competition from other +individuals. Sapling trees have no constraints in their horizontal +spatial structure, and as such, are more likely to display their leaves +to full sunlight. Also, prior to canopy closure, light interception by +leaves on the sides of the canopy is also higher than it would be in a +closed canopy forest. If the ‘canopy spread’ parameter is constant for +all trees, then we simulate high levels of self-shading for plants in +unclosed canopies, which is arguably unrealistic and can lower the +productivity of trees in areas of unclosed canopy (e.g. low productivity +areas of boreal or semi-arid regions where LAI and canopy cover might +naturally be low). We here interpret the degree of canopy spread, +:math:`S_{c}` as a function of how much tree crowns interfere with each +other in space, or the total canopy area :math:`A_{canopy}`. However +:math:`A_{canopy}` itself is a function of :math:`S_{c}`, leading to a +circularity. :math:`S_{c}` is thus solved iteratively through time. + +Each daily model step, :math:`A_{canopy}` and the fraction of the +gridcell occupied by tree canopies in each canopy layer +(:math:`A_{f,Cl}` = :math:`A_{canopy,Cl}`/:math:`A_{patch}`) is +calculated based on :math:`S_{c}` from the previous timestep. If +:math:`A_{f}` is greater than a threshold value :math:`A_{t}`, +:math:`S_{c}` is increased by a small increment :math:`i`. The threshold +:math:`A_{t}` is, hypothetically, the canopy fraction at which light +competition begins to impact on tree growth. This is less than 1.0 owing +to the non-perfect spatial spacing of tree canopies. If :math:`A_{f,Cl}` +is greater than :math:`A_{t}`, then :math:`S_{c}` is reduced by an +increment :math:`i`, to reduce the spatial extent of the canopy, thus. + +.. math:: + + S_{c,patch,Cl,t+1} = \left\{ \begin{array}{ll} + S_{c,patch,Cl,t} + i& \textrm{for $A_{f,Cl} < A_{t}$}\\ + &\\ + S_{c,patch,Cl,t} - i& \textrm{for $A_{f,Cl} > A_{t}$}\\ + \end{array} \right. + +The values of :math:`S_{c}` are bounded to upper and lower limits. The +lower limit corresponds to the observed canopy spread parameter for +canopy trees :math:`S_{c,min}` and the upper limit corresponds to the +largest canopy extent :math:`S_{c,max}` + +.. math:: + + S_{c,patch,Cl} = \left\{ \begin{array}{ll} + S_{c,min}& \textrm{for } S_{c,patch,Cl}< S_{c,\rm{min}}\\ + &\\ + S_{c,max}& \textrm{for } S_{c,patch,Cl} > S_{c,\rm{max}}\\ + \end{array} \right. + +This iterative scheme requires two additional parameters (:math:`i` and +:math:`A_{t}`). :math:`i` affects the speed with which canopy spread +(and hence leaf are index) increase as canopy closure is neared. +However, the model is relatively insensitive to the choice of either +:math:`i` or :math:`A_{t}`. + +Definition of Leaf Area Profile +------------------------------- + + [9]_ + +Within each patch, the model defines and tracks cohorts of multiple +plant functional types that exist either in the canopy or understorey. +Light on the top leaf surface of each cohort in the canopy is the same, +and the rate of decay through the canopy is also the same for each PFT. +Therefore, we accumulate all the cohorts of a given PFT together for the +sake of the radiation and photosynthesis calculations (to avoid separate +calculations for every cohort). + +Therefore, the leaf area index for each patch is defined as a +three-dimensional array :math:`\mathit{lai}_{Cl,ft,z}` where :math:`C_l` +is the canopy layer, :math:`ft` is the functional type and :math:`z` is +the leaf layer within each canopy. This three-dimensional structure is +the basis of the radiation and photosynthetic models. In addition to a +leaf area profile matrix, we also define, for each patch, the area which +is covered by leaves at each layer as :math:`\mathit{carea}_{Cl,ft,z}`. + +Each plant cohort is already defined as a member of a single canopy +layer and functional type. This means that to generate the +:math:`x_{Cl,ft,z}` matrix, it only remains to divide the leaf area of +each cohort into leaf layers. First, we determine how many leaf layers +are occupied by a single cohort, by calculating the ‘tree LAI’ as the +total leaf area of each cohort divided by its crown area (both in +m\ :math:`^{2}`) + +.. math:: \mathit{tree}_{lai,coh} = \frac{b_{leaf,coh}\cdot\mathrm{sla}_{ft}}{A_{crown,coh}} + +where :math:`\mathrm{sla}_{ft}` is the specific leaf area in +m\ :math:`^{2}` KgC\ :math:`^{-1}` and :math:`b_{leaf}` is in kGC per +plant. + +Stem Area Index +~~~~~~~~~~~~~~~ + +Stem area index (SAI) is ratio of the total area of all woody stems on a +plant to the area of ground covered by the plant. During winter in +deciduous areas, the extra absorption by woody stems can have a +significant impact on the surface energy budget. However, in previous +‘big leaf’ versions of the CLM, computing the circumstances under which +stem area was visible in the absence of leaves was difficult and the +algorithm was largely heuristic as a result. Given the multi-layer +canopy introduced for CLM(ED), we can determine the leaves in the higher +canopy layers will likely shade stem area in the lower layers when +leaves are on, and therefore stem area index can be calculated as a +function of woody biomass directly. + +Literature on stem area index is particularly poor, as it’s estimation +is complex and not particularly amenable to the use of, for example, +assumptions of random distribution in space that are typically used to +calculate leaf area from light interception. +:raw-latex:`\cite{kucharik1998}` estimated that SAI visible from an +LAI2000 sensor was around 0.5 m^2 m^-2. :raw-latex:`\cite{low2001}` +estimate that the wood area index for Ponderosa Pine forest is +0.27-0.33. The existing CLM(CN) algorithm sets the minimum SAI at 0.25 +to match MODIS observations, but then allows SAI to rise as a function +of the LAI lost, meaning than in some places, predicted SAI can reach +value of 8 or more. Clearly, greater scientific input on this quantity +is badly needed. Here we determine that SAI is a linear function of +woody biomass, to at very least provide a mechanistic link between the +existence of wood and radiation absorbed by it. The non-linearity +between how much woody area exists and how much radiation is absorbed is +provided by the radiation absorption algorithm. Specifically, the SAI of +an individual cohort (:math:`\mathrm{tree}_{sai,coh}`, m\ :math:`^{2}` +m\ :math:`^{-2}`) is calculated as follows, + +.. math:: \mathrm{tree}_{sai,coh} = k_{sai}\cdot b_{struc,coh} , + +where :math:`k_{sai}` is the coefficient linking structural biomass to +SAI. The number of occupied leaf layers for cohort :math:`coh` +(:math:`n_{z,coh}`) is then equal to the rounded up integer value of the +tree SAI (:math:`{tree}_{sai,coh}`) and LAI (:math:`{tree}_{lai,coh}`) +divided by the layer thickness (i.e., the resolution of the canopy layer +model, in units of vegetation index (:math:`lai`\ +\ :math:`sai`) with a +default value of 1.0, :math:`\delta _{vai}` ), + +.. math:: n_{z,coh} = {\frac{\mathrm{tree}_{lai,coh}+\mathrm{tree}_{sai,coh}}{\delta_{vai}}}. + +The fraction of each layer that is leaf (as opposed to stem) can then be +calculated as + +.. math:: f_{leaf,coh} = \frac{\mathrm{tree}_{lai,coh}}{\mathrm{tree}_{sai,coh}+\mathrm{tree}_{lai,coh}}. + +Finally, the leaf area in each leaf layer pertaining to this cohort is +thus + +.. math:: + + \mathit{lai}_{z,coh} = \left\{ \begin{array}{ll} + \delta_{vai} \cdot f_{leaf,coh} \frac{A_{canopy,coh}}{A_{canopy,patch}}& \textrm{for $i=1,..., i=n_{z,coh}-1$}\\ + &\\ + \delta_{vai} \cdot f_{leaf,coh} \frac{A_{canopy,coh}}{A_{canopy,patch}}\cdot r_{vai}& \textrm{for $i=n_{z,coh}$}\\ + \end{array} \right. + + and the stem area index is + +.. math:: + + \mathit{sai}_{z,coh} = \left\{ \begin{array}{ll} + \delta_{vai} \cdot (1-f_{leaf,coh})\frac{A_{canopy,coh}}{A_{canopy,patch}}& \textrm{for $i=1,..., i=n_{z,coh}-1$}\\ + &\\ + \delta_{vai} \cdot (1-f_{leaf,coh}) \frac{A_{canopy,coh}}{A_{canopy,patch}}\cdot r_{vai}& \textrm{for $i=n_{z,coh}$}\\ + \end{array} \right. + +where :math:`r_{vai}` is the remainder of the canopy that is below the +last full leaf layer + +.. math:: r_{vai} =(\mathrm{tree}_{lai,coh} + \mathrm{tree}_{sai,coh}) - (\delta _{vai} \cdot (n_{z,coh} -1)). + +:math:`A_{canopy,patch}` is the total canopy area occupied by plants in +a given patch (m:math:`^{2}`) and is calculated as follows, + +.. math:: A_{canopy,patch} = \textrm{min}\left( \sum_{coh=1}^{coh = ncoh}A_{canopy,coh}, A_{patch} \right). + +The canopy is conceived as a cylinder, although this assumption could be +altered given sufficient evidence that canopy shape was an important +determinant of competitive outcomes, and the area of ground covered by +each leaf layer is the same through the cohort canopy. With the +calculated SAI and LAI, we are able to calculate the complete canopy +profile. Specifically, the relative canopy area for the cohort +:math:`{coh}` is calculated as + +.. math:: \mathit{area}_{1:nz,coh} = \frac{A_{crown,coh}}{A_{canopy,patch}}. + +The total occupied canopy area for each canopy layer (:math:`Cl`), plant +functional type (:math:`ft`) and leaf layer (:math:`z`) bin is thus + +.. math:: + + \mathit{c}_{area,Cl,ft,z} = \sum_{coh=1}^{coh=ncoh} area_{1:nz,coh} + +where :math:`ft_{coh}=ft` and :math:`Cl_{coh} = Cl.` + +All of these quantities are summed across cohorts to give the complete +leaf and stem area profiles, + +.. math:: + + \mathit{lai} _{Cl,ft,z} = \sum_{coh=1}^{coh=ncoh} \mathit{lai}_{z,coh} + +.. math:: + + \mathit{sai}_{Cl,ft,z} = \sum_{coh=1}^{coh=ncoh} \mathit{sai}_{z,coh} + + +Burial of leaf area by snow +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The calculations above all pertain to the total leaf and stem area +indices which charecterize the vegetation structure. In addition, the +model must know when the vegetation is covered by snow, and by how much, +so that the albedo and energy balance calculations can be adjusted +accordingly. Therefore, we calculated a ‘total’ and ‘exposed’ +:math:`lai` and :math:`sai` profile using a representation of the bottom +and top canopy heights, and the depth of the average snow pack. For each +leaf layer :math:`z` of each cohort, we calculate an ‘exposed fraction +:math:`f_{exp,z}` via consideration of the top and bottom heights of +that layer :math:`h_{top,z}` and :math:`h_{bot,z}` (m), + +.. math:: + + \begin{array}{ll} + h_{top,z} = h_{coh} - h_{coh}\cdot f_{crown,ft}\cdot\frac{z}{n_{z,coh}}& \\ + &\\ + h_{bot,z} = h_{coh} - h_{coh}\cdot f_{crown,ft}\cdot\frac{z+1}{n_{z,coh}}&\\ + \end{array} + +where :math:`f_{crown,ft}` is the plant functional type (:math:`ft`) +specific fraction of the cohort height that is occupied by the crown. +Specifically, the ‘exposed fraction :math:`f_{exp,z}` is calculated as +follows, + +.. math:: + + f_{exp,z}\left\{ \begin{array}{ll} + = 1.0 & h_{bot,z}> d_{snow}\\ + &\\ + = \frac{d_{snow} -h_{bot,z}}{h_{top,z}-h_{bot,z}} & h_{top,z}> d_{snow}, h_{bot,z}< d_{snow}\\ + &\\ + = 0.0 & h_{top,z}< d_{snow}\\ + \end{array} \right. + +The resulting exposed (:math:`elai, esai`) and total +(:math:`tlai, tsai`) leaf and stem area indicies are calculated as + +.. math:: + + \begin{array}{ll} + \mathit{elai} _{Cl,ft,z} &= \mathit{lai} _{Cl,ft,z} \cdot f_{exp,z}\\ + \mathit{esai} _{Cl,ft,z} &= \mathit{sai} _{Cl,ft,z} \cdot f_{exp,z}\\ + \mathit{tlai} _{Cl,ft,z} &= \mathit{lai} _{Cl,ft,z}\\ + \mathit{tsai} _{Cl,ft,z} &= \mathit{sai} _{Cl,ft,z} \ + \end{array} , + +and are used in the radiation interception and photosynthesis algorithms +described later. + ++-------------+-------------+-------------+-------------+-------------+ +| Parameter | Parameter | Units | Notes | Indexed by | +| Symbol | Name | | | | ++=============+=============+=============+=============+=============+ +| :math:` | Thickness | m\ :math:`^ | | | +| \delta_ | of single | {-2}`\ m\ : | | | +| {vai}` | canopy | math:`^{-2}`| | | +| | layer | | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`C_e` | Competitive | none | | | +| | Exclusion | | | | +| | Parameter | | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`c_{p | Minimum | m\ :math:`^ | | | +| ,min}` | canopy | {2}` | | | +| | spread | cm\ :math:` | | | +| | | ^{-1}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`c_{p | Competitive | m\ :math:`^ | | | +| ,max}` | Exclusion | {2}` | | | +| | Parameter | cm\ :math:` | | | +| | | ^{-1}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`i` | Incremental | m\ :math:`^ | | | +| | change in | {2}` | | | +| | :math:`c_p` | cm\ :math:` | | | +| | | ^{-1}` | | | +| | | y\ :math:`^ | | | +| | | {-1}` | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`A_t` | Threshold | none | | | +| | canopy | | | | +| | closure | | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`f_{c | Crown | none | | :math:`ft` | +| rown,ft}` | fraction | | | | ++-------------+-------------+-------------+-------------+-------------+ +| :math:`k_{s | Stem area | m^2 KgC^-1 | | | +| ai}` | per unit | | | | +| | woody | | | | +| | biomass | | | | ++-------------+-------------+-------------+-------------+-------------+ + +.. raw:: latex + + \bigskip + +Radiation Transfer +================== + +Fundamental Radiation Transfer Theory +------------------------------------- + +[10]_The first interaction of the land surface with the properties of +vegetation concerns the partitioning of energy into that which is +absorbed by vegetation, reflected back into the atmosphere, and absorbed +by the ground surface. Older versions of the CLM have utilized a +‘two-stream’ approximation +:raw-latex:`\parencite{sellers1985,sellers1996}` that provided an +empirical solution for the radiation partitioning of a multi-layer +canopy for two streams, of diffuse and direct light. However, +implementation of the Ecosystem Demography model requires a) the +adoption of an explicit multiple layer canopy b) the implementation of a +multiple plant type canopy and c) the distinction of canopy and +under-storey layers, in-between which the radiation streams are fully +mixed. The radiation mixing between canopy layers is necessary as the +position of different plants in the under-storey is not defined +spatially or relative to the canopy trees above. In this new scheme, we +thus implemented a one-dimensional scheme that traces the absorption, +transmittance and reflectance of each canopy layer and the soil, +iterating the upwards and downwards passes of radiation through the +canopy until a pre-defined accuracy tolerance is reached. This approach +is based on the work of :raw-latex:`\cite{norman1979}`. + +Here we describe the basic theory of the radiation transfer model for +the case of a single homogenous canopy, and in the next section we +discuss how this is applied to the multi layer multi PFT canopy in the +CLM(ED) implementation. The code considers the fractions of a single +unit of incoming direct and a single unit of incoming diffuse light, +that are absorbed at each layer of the canopy for a given solar angle +(:math:`\alpha_{s}`, radians). Direct radiation is extinguished through +the canopy according to the coefficient :math:`k_{dir}` that is +calculated from the incoming solar angle and the dimensionless leaf +angle distribution parameter (:math:`\chi`) as + +.. math:: k_{dir} = g_{dir} / \sin(\alpha_s)\\ + +where + +.. math:: g_{dir} = \phi_1 + \phi_2 \cdot \sin(\alpha_s)\\ + +and + +.. math:: + + \begin{array} {l} + \phi_1 = 0.5 - 0.633\chi_{l} - 0.33\chi_l ^2\\ + \phi_2 =0.877 (1 - 2\phi_1)\\ + + \end{array} + +The leaf angle distribution is a descriptor of how leaf surfaces are +arranged in space. Values approaching 1.0 indicate that (on average) the +majority of leaves are horizontally arranged with respect to the ground. +Values approaching -1.0 indicate that leaves are mostly vertically +arranged, and a value of 0.0 denotes a canopy where leaf angle is random +(a ‘spherical’ distribution). + +According to Beer’s Law, the fraction of light that is transferred +through a single layer of vegetation (leaves or stems) of thickness +:math:`\delta_{vai}`, without being intercepted by any surface, is + +.. math:: \mathit{tr}_{dir} = e^{-k_{dir} \delta_{vai}} + +and the incident direct radiation transmitted to each layer of the +canopy (:math:`dir_{tr,z}`) is thus calculated from the cumulative leaf +area ( :math:`L_{above}` ) shading each layer (:math:`z`): + +.. math:: \mathit{dir}_{tr,z} = e^{-k_{dir} L_{above,z}} + +The fraction of the leaves :math:`f_{sun}` that are exposed to direct +light is also calculated from the decay coefficient :math:`k_{dir}`. + +.. math:: + + \begin{array}{l} + f_{sun,z} = e^{-k_{dir} L_{above,z}}\\ + \rm{and} + \\ f_{shade,z} = 1-f_{sun,z} + \end{array} + +where :math:`f_{shade,z}` is the fraction of leaves that are shaded +from direct radiation and only receive diffuse light. + +Diffuse radiation, by definition, enters the canopy from a spectrum of +potential incident directions, therefore the un-intercepted transfer +(:math:`tr_{dif}`) through a leaf layer of thickness :math:`\delta_l` is +calculated as the mean of the transfer rate from each of 9 different +incident light directions (:math:`\alpha_{s}`) between 0 and 180 degrees +to the horizontal. + +.. math:: \mathit{tr}_{dif} = \frac{1}{9} \sum\limits_{\alpha_s=5\pi/180}^{\alpha_s=85\pi/180} e^{-k_{dir,l} \delta_{vai}} \\ \\ + +.. math:: tr_{dif}= \frac{1}{9} \pi \sum_{\alpha s=0}^{ \pi / 2} \frac{e^{-gdir} \alpha_s}{\delta_{vai} \cdot \rm{sin}(\alpha_s) \rm{sin}(\alpha_s) \rm{cos}(\alpha_s)} + +The fraction (1-:math:`tr_{dif}`) of the diffuse radiation is +intercepted by leaves as it passes through each leaf layer. Of this, +some fraction is reflected by the leaf surfaces and some is transmitted +through. The fractions of diffuse radiation reflected from +(:math:`\mathit{refl}_{dif}`) and transmitted though +(:math:`\mathit{tran}_{dif}`) each layer of leaves are thus, +respectively + +.. math:: + + \begin{array}{l} + \mathit{refl_{dif}} = (1 - tr_{dif}) \rho_{l,ft}\\ + \mathit{tran}_{dif} = (1 - tr_{dif}) \tau_{l,ft} + tr_{dif} + \end{array} + +where :math:`\rho_{l,ft}` and :math:`\tau_{l,ft}` are the fractions of +incident light reflected and transmitted by individual leaf surfaces. + +Once we know the fractions of light that are transmitted and reflected +by each leaf layer, we begin the process of distributing light through +the canopy. Starting with the first leaf layer (:math:`z`\ =1), where +the incident downwards diffuse radiation (:math:`\mathit{dif}_{down}`) +is 1.0, we work downwards for :math:`n_z` layers, calculating the +radiation in the next layer down (:math:`z+1`) as: + +.. math:: \mathit{dif}_{down,z+1} = \frac{\mathit{dif}_{down,z} \mathit{tran}_{dif} } {1 - \mathit{r}_{z+1} \mathit{refl}_{dif}} + +Here, :math:`\mathit{dif}_{down,z} \mathit{tran}_{dif}` calculates the +fraction of incoming energy transmitted downwards onto layer +:math:`z+1`. This flux is then increased by the additional radiation +:math:`r_z` that is reflected upwards from further down in the canopy to +layer :math:`z`, and then is reflected back downwards according to the +reflected fraction :math:`\mathit{refl_{dif}}`. The more radiation in +:math:`\mathit{r}_{z+1} \mathit{refl}_{dif}`, the smaller the +denominator and the larger the downwards flux. :math:`r` is also +calculated sequentially, starting this time at the soil surface layer +(where :math:`z = n_z+1`) + +.. math:: r_{nz+1} = alb_s + +where :math:`alb_s` is the soil albedo characteristic. The upwards +reflected fraction :math:`r_z` for each leaf layer, moving upwards, is +then :raw-latex:`\cite{norman1979}` + +.. math:: r_z = \frac{r_{z+1} \times \mathit{tran}_{dif} ^{2} }{ (1 - r_{z+1} \mathit{refl_{dif}}) + \mathit{refl_{dif}}}. + +The corresponding upwards diffuse radiation flux is therefore the +fraction of downwards radiation that is incident on a particular layer, +multiplied by the fraction that is reflected from all the lower layers: + +.. math:: \mathit{dif}_{up,z} = r_z \mathit{dif}_{down,z+1} + +Now we have initial conditions for the upwards and downwards diffuse +fluxes, these must be modified to account for the fact that, on +interception with leaves, direct radiation is transformed into diffuse +radiation. In addition, the initial solutions to the upwards and +downwards radiation only allow a single ‘bounce’ of radiation through +the canopy, so some radiation which might be intercepted by leaves +higher up is potentially lost. Therefore, the solution to this model is +iterative. The iterative solution has upwards and a downwards components +that calculate the upwards and downwards fluxes of total radiation at +each leaf layer (:math:`rad_{dn, z}` and :math:`rad_{up, z}`) . The +downwards component begins at the top canopy layer (:math:`z=1`). Here +we define the incoming solar diffuse and direct radiation +(:math:`\it{solar}_{dir}` and :math:`\it{solar}_{dir}` respectively). + +.. math:: + + \begin{array}{l} + \mathit{dif}_{dn,1} = \it{solar}_{dif} \\ + \mathit{rad}_{dn, z+1} = \mathit{dif}_{dn,z} \cdot \mathit{tran}_{dif} +\mathit{dif}_{up,z+1} \cdot \mathit{refl}_{dif} + \mathit{solar}_{dir} \cdot dir_{tr,z} (1- tr_{dir}) \tau_l. + \end{array} + +The first term of the right-hand side deals with the diffuse radiation +transmitted downwards, the second with the diffuse radiation travelling +upwards, and the third with the direct radiation incoming at each layer +(:math:`dir_{tr,z}`) that is intercepted by leaves +(:math:`1- tr_{dir}`) and then transmitted through through the leaf +matrix as diffuse radiation (:math:`\tau_l`). At the bottom of the +canopy, the light reflected off the soil surface is calculated as + +.. math:: rad _{up, nz} = \rm{\it{dif}}_{down,z} \cdot salb_{dif} +\it{solar}_{dir} \cdot dir_{tr,z} salb_{dir}. + +The upwards propagation of the reflected radiation is then + +.. math:: rad_{up, z} = \mathit{dif}_{up,z+1} \cdot \mathit{tran}_{dif} +\mathit{dif}_{dn,z} \cdot \mathit{refl}_{dif} + \it{solar}_{dir} \cdot dir_{tr,z} (1- tr_{dir}) \rho_l. + +Here the first two terms deal with the diffuse downwards and upwards +fluxes, as before, and the third deals direct beam light that is +intercepted by leaves and reflected upwards. These upwards and downwards +fluxes are computed for multiple iterations, and at each iteration, +:math:`rad_{up, z}` and :math:`rad_{down, z}` are compared to their +values in the previous iteration. The iteration scheme stops once the +differences between iterations for all layers is below a predefined +tolerance factor, (set here at :math:`10^{-4}`). Subsequently, the +fractions of absorbed direct (:math:`abs_{dir,z}`) and diffuse +(:math:`abs_{dif,z}`) radiation for each leaf layer then + +.. math:: abs_{dir,z} = \it{solar}_{dir} \cdot dir_{tr,z} \cdot (1- tr_{dir}) \cdot (1 - \rho_l-\tau_l) + +.. math:: abs_{dif,z} = (\mathit{dif}_{dn,z} + \mathit{dif}_{up,z+1} ) \cdot (1 - tr_{dif}) \cdot (1 - \rho_l-\tau_l). + +and, the radiation energy absorbed by the soil for the diffuse and +direct streams is is calculated as + +.. math:: \it{abs}_{soil} = \mathit{dif}_{down,nz+1} \cdot (1 - salb_{dif}) +\it{solar}_{dir} \cdot dir_{tr,nz+1} \cdot (1- salb_{dir}). + +Canopy level albedo is denoted as the upwards flux from the top leaf +layer + +.. math:: \it{alb}_{canopy}= \frac{\mathit{dif}_{up,z+1} }{ \it{solar}_{dir} + \it{solar}_{dif}} + +and the division of absorbed energy into sunlit and shaded leaf +fractions, (required by the photosynthesis calculations), is + +.. math:: abs_{sha,z} = abs_{dif,z} \cdot f_{sha} + +.. math:: abs_{sun,z} = abs_{dif,z} \cdot f_{sun}+ abs_{dir,z} + +Resolution of radiation transfer theory within the CLM(ED) canopy structure +--------------------------------------------------------------------------- + +The radiation transfer theory above, was described with reference to a +single canopy of one plant functional type, for the sake of clarity of +explanation. The CLM(ED) model, however, calculates radiative and +photosynthetic fluxes for a more complex hierarchical structure within +each patch/time-since-disturbance class, as described in the leaf area +profile section. Firstly, we denote two or more canopy layers (denoted +:math:`C_l`). The concept of a ‘canopy layer’ refers to the idea that +plants are organized into discrete over and under-stories, as predicted +by the Perfect Plasticity Approximation +:raw-latex:`\parencite{purves2008,fisher2010}`. Within each canopy layer +there potentially exist multiple cohorts of different plant functional +types and heights. Within each canopy layer, :math:`C_l`, and functional +type, :math:`ft`, the model resolves numerous leaf layers ‘:math:`z`’, +and, for some processes, notably photosynthesis, each leaf layer is +split into a fraction of sun and shade leaves, :math:`f_{sun}` and +:math:`f_{sha}`, respectively. + +The radiation scheme described in Section is solved explicitly for this +structure, for both the visible and near-infrared wavebands, according +to the following assumptions. + +- A ‘canopy layer’ (:math:`C_{L}`) refers to either the over or understorey + +- A ‘leaf layer’ (:math:`z`) refers to the discretization of the LAI + within the canopy of a given plant functional type. + +- All PFT’s in the same canopy layer have the same solar radiation + incident on the top layer of the canopy + +- Light is transmitted through the canopy of each plant functional type independently + +- Between canopy layers, the light streams from different plant + functional types are mixed, such that the (undefined) spatial + location of plants in lower canopy layers does not impact the amount + of light received. + +- Where understorey layers fill less area than the overstorey layers, + radiation is directly transferred to the soil surface. + +- All these calculations pertain to a single patch, so we omit the + ‘patch’ subscript for simplicity in the following discussion. + +Within this framework, the majority of the terms in the radiative +transfer scheme are calculated with indices of :math:`C_L`, +:math:`\it{ft}` and :math:`z`. In the following text, we revisit the +simplified version of the radiation model described above, and explain +how it is modified to account for the more complex canopy structure used +by the CLM(ED). + +Firstly, the light penetration functions, :math:`k_{dir}` and +:math:`g_{dir}` are described as functions of :math:`\it{ft}`, because +the leaf angle distribution, :math:`\chi_l`, is a pft-specific +parameter. Thus, the diffuse irradiance transfer rate, :math:`tr_{dif}` +is also :math:`\it{ft}` specific because :math:`g_{dir}`, on which it +depends, is a function of :math:`\chi_l`. + +The amount of direct light reaching each leaf layer is a function of the +leaves existing above the layer in question. If a leaf layer ‘:math:`z`’ +is in the top canopy layer (the over-storey), it is only shaded by +leaves of the same PFT so :math:`k_{dir}` is unchanged from equation. If +there is more than one canopy layer (:math:`C_{l,max}>1`), then the +amount of direct light reaching the top leaf surfaces of the +second/lower layer is the weighted average of the light attenuated by +all the parallel tree canopies in the canopy layer above, thus. + +.. math:: dir_{tr,Cl,:,1} =\sum_{ft=1}^{npft}{(dir_{tr,Cl,ft,z_{max}} \cdot c_{area,Cl-1,ft,z_{max}})} + +where :math:`\it{pft}_{wt}` is the areal fraction of each canopy layer +occupied by each functional type and :math:`z_{max}` is the index of the +bottom canopy layer of each pft in each canopy layer (the subscripts +:math:`C_l` and :math:`ft` are implied but omitted from all +:math:`z_{max}` references to avoid additional complications) + +Similarly, the sunlit fraction for a leaf layer ‘:math:`z`’ in the +second canopy layer (where :math:`C_l > 1`) is + +.. math:: f_{sun,Cl,ft,z} = W_{sun,Cl} \cdot e^{k_{dir,ft,laic,z}} + +where :math:`W_{sun,Cl}` is the weighted average sunlit fraction in the +bottom layer of a given canopy layer. + +.. math:: W_{sun,Cl} = \sum_{ft=1}^{npft}{(f_{sun,Cl-1,ft,zmax} \cdot c_{area,Cl-1,ft,zmax})} + +Following through the sequence of equations for the simple single pft +and canopy layer approach above, the :math:`\mathit{refl}_{dif}` and +:math:`\mathit{tran}_{dif}` fluxes are also indexed by :math:`C_l`, +:math:`\it{ft}`, and :math:`z`. The diffuse radiation reflectance ratio +:math:`r_z` is also calculated in a manner that homogenizes fluxes +between canopy layers. For the canopy layer nearest the soil +(:math:`C_l` = :math:`C_{l,max}`). For the top canopy layer +(:math:`C_l`\ =1), a weighted average reflectance from the lower layers +is used as the baseline, in lieu of the soil albedo. Thus: + +.. math:: r_{z,Cl,:,1} = \sum_{ft=1}^{npft}{(r_{z,Cl-1,ft,1} \it{pft}_{wt,Cl-1,ft,1})} + +For the iterative flux resolution, the upwards and downwards fluxes are +also averaged between canopy layers, thus where :math:`C_l>1` + +.. math:: rad_{dn, Cl,ft,1} = \sum_{ft=1}^{npft}{(rad_{dn, Cl-1,ft,zmax} \cdot \it{pft}_{wt,Cl-1,ft,zmax})} + +and where :math:`C_l` =1, and :math:`C_{l,max}>1` + +.. math:: rad_{up,Cl,ft,zmax} = \sum_{ft=1}^{npft}{(rad_{up, Cl+1,ft,1} \cdot \it{pft}_{wt,Cl+1,ft,1})} + +The remaining terms in the radiation calculations are all also indexed +by :math:`C_l`, :math:`ft` and :math:`z` so that the fraction of +absorbed radiation outputs are termed :math:`abs_{dir,Cl,ft,z}` and +:math:`abs_{dif,Cl,ft,z}`. The sunlit and shaded absorption rates are +therefore + +.. math:: abs_{sha,Cl,ft,z} = abs_{dif,Cl,ft,z}\cdot f_{sha,Cl,ft,z} + +and + +.. math:: abs_{sun,Cl,ft,z} = abs_{dif,Cl,ft,z} \cdot f_{sun,Cl,ft,z}+ abs_{dir,Cl,ft,z} + +The albedo of the mixed pft canopy is calculated as the weighted average +of the upwards radiation from the top leaf layer of each pft where +:math:`C_l`\ =1: + +.. math:: \it{alb}_{canopy}= \sum_{ft=1}^{npft}{\frac{\mathit{dif}_{up,1,ft,1} \it{pft}_{wt,1,ft,1}} {\it{solar}_{dir} + \it{solar}_{dif}}} + +The radiation absorbed by the soil after passing through through +under-storey vegetation is: + +.. math:: \it{abs}_{soil}= \sum_{ft=1}^{npft}{ \it{pft}_{wt,1,ft,1}( \mathit{dif}_{down,nz+1} (1 - salb_{dif}) +\it{solar}_{dir} dir_{tr,nz+1} (1- salb_{dir}))} + +to which is added the diffuse flux coming directly from the upper +canopy and hitting no understorey vegetation. + +.. math:: \it{abs}_{soil}= \it{abs}_{soil}+dif_{dn,2,1} (1- \sum_{ft=1}^{npft}{\it{pft}_{wt,1,ft,1}}) (1 - salb_{dif}) + +and the direct flux coming directly from the upper canopy and hitting +no understorey vegetation. + +.. math:: \it{abs}_{soil}= \it{abs}_{soil}+\it{solar}_{dir} dir_{tr,2,1}(1- \sum_{ft=1}^{npft}{\it{pft}_{wt,1,ft,1}}) (1 - salb_{dir}) + +These changes to the radiation code are designed to be structurally +flexible, and the scheme may be collapsed down to only include on canopy +layer, functional type and pft for testing if necessary. + +.. raw:: latex + + \captionof{table}{Parameters needed for radiation transfer model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`\chi` | Leaf angle | none | *ft* | +| | distribution | | | +| | parameter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\rho_l` | Fraction of | none | *ft* | +| | light reflected | | | +| | by leaf surface | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\tau_l` | Fraction of | none | *ft* | +| | light | | | +| | transmitted by | | | +| | leaf surface | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`alb_s` | Fraction of | none | direct vs | +| | light reflected | | diffuse | +| | by soil | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Photosynthesis +============== + +Fundamental photosynthetic physiology theory +-------------------------------------------- + + [11]_ + +In this section we describe the physiological basis of the +photosynthesis model before describing its application to the CLM(ED) +canopy structure. This description in this section is largely repeated +from the Oleson et al. CLM4.5 technical note but included here for +comparison with its implementation in CLM(ED). Photosynthesis in C3 +plants is based on the model of :raw-latex:`\cite{farquhar1980}` as +modified by :raw-latex:`\cite{collatz1991}`. Photosynthetic assimilation +in C4 plants is based on the model of :raw-latex:`\cite{collatz1992}`. +In both models, leaf photosynthesis, :math:`\textrm{gpp}` +(:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`) is +calculated as the minimum of three potentially limiting fluxes, +described below: + +.. math:: \textrm{gpp} = \rm{min}(w_{j}, w_{c},w_{p}). + +The RuBP carboxylase (Rubisco) limited rate of carboxylation +:math:`w_{c}` (:math:`\mu`\ mol CO\ :math:`_{2}` m\ :math:`^{-2}` +s\ :math:`^{-1}`) is determined as + +.. math:: + + w_{c}= \left\{ \begin{array}{ll} + \frac{V_{c,max}(c_{i} - \Gamma_*)}{ci+K_{c}(1+o_{i}/K_{o})} & \textrm{for $C_{3}$ plants}\\ + &\\ + V_{c,max}& \textrm{for $C_{4}$ plants}\\ + \end{array} \right. + c_{i}-\Gamma_*\ge 0 + +where :math:`c_{i}` is the internal leaf CO\ :math:`_{2}` partial +pressure (Pa) and :math:`o_i (0.209P_{atm}`) is the O\ :math:`_{2}` +partial pressure (Pa). :math:`K_{c}` and :math:`K_{o}` are the +Michaelis-Menten constants (Pa) for CO\ :math:`_{2}` and +O\ :math:`_{2}`. These vary with vegetation temperature :math:`T_v` +(:math:`^{o}`\ C) according to an Arrhenious function described in +:raw-latex:`\cite{oleson2013}`. :math:`V_{c,max}` is the leaf layer +photosynthetic capacity (:math:`\mu` mol CO\ :math:`_2` m\ :math:`^{-2}` +s\ :math:`^{-1}`). + +The maximum rate of carboxylation allowed by the capacity to regenerate +RuBP (i.e., the light-limited rate) :math:`w_{j}` (:math:`\mu`\ mol +CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`) is + +.. math:: + + w_j= \left\{ \begin{array}{ll} + \frac{J(c_i - \Gamma_*)}{4ci+8\Gamma_*} & \textrm{for C$_3$ plants}\\ + &\\ + 4.6\phi\alpha & \textrm{for C$_4$ plants}\\ + \end{array} \right. + c_i-\Gamma_*\ge 0 + +To find :math:`J`, the electron transport rate (:math:`\mu` mol +CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`), we solve the +following quadratic term and take its smaller root, + +.. math:: \Theta_{psII}J^{2}-(I_{psII} +J_{max})J+I_{psII}J_{max} =0 + +where :math:`J_{max}` is the maximum potential rate of electron +transport (:math:`\mu`\ mol m\ :math:`_{-2}` s\ :math:`^{-1}`), +:math:`I_{PSII}` is the is the light utilized in electron transport by +photosystem II (:math:`\mu`\ mol m\ :math:`_{-2}` s\ :math:`^{-1}`) and +:math:`\Theta_{PSII}` is is curvature parameter. :math:`I_{PSII}` is +determined as + +.. math:: I_{PSII} =0.5 \Phi_{PSII}(4.6\phi) + +where :math:`\phi` is the absorbed photosynthetically active radiation +(Wm:math:`^{-2}`) for either sunlit or shaded leaves (:math:`abs_{sun}` +and :math:`abs_{sha}`). :math:`\phi` is converted to photosynthetic +photon flux assuming 4.6 :math:`\mu`\ mol photons per joule. Parameter +values are :math:`\Phi_{PSII}` = 0.7 for C3 and :math:`\Phi_{PSII}` = +0.85 for C4 plants. + +The export limited rate of carboxylation for C3 plants and the PEP +carboxylase limited rate of carboxylation for C4 plants :math:`w_e` +(also in :math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` +s\ :math:`^{-1}`) is + +.. math:: + + w_e= \left\{ \begin{array}{ll} + 3 T_{p,0} & \textrm{for $C_3$ plants}\\ + &\\ + k_{p} \frac{c_i}{P_{atm}}& \textrm{for $C_4$ plants}.\\ + \end{array} \right. + +:math:`T_{p}` is the triose-phosphate limited rate of photosynthesis, +which is equal to :math:`0.167 V_{c,max0}`. :math:`k_{p}` is the initial +slope of C4 CO\ :math:`_{2}` response curve. The Michaelis-Menten +constants :math:`K_{c}` and :math:`K_{o}` are modeled as follows, + +.. math:: K_{c} = K_{c,25}(a_{kc})^{\frac{T_v-25}{10}}, + +.. math:: K_{o} = K_{o,25}(a_{ko})^{\frac{T_v-25}{10}}, + +where :math:`K_{c,25}` = 30.0 and :math:`K_{o,25}` = 30000.0 are values +(Pa) at 25 :math:`^{o}`\ C, and :math:`a_{kc}` = 2.1 and :math:`a_{ko}` +=1.2 are the relative changes in :math:`K_{c,25}` and :math:`K_{o,25}` +respectively, for a 10\ :math:`^{o}`\ C change in temperature. The +CO\ :math:`_{2}` compensation point :math:`\Gamma_{*}` (Pa) is + +.. math:: \Gamma_* = \frac{1}{2} \frac{K_c}{K_o}0.21o_i + +where the term 0.21 represents the ratio of maximum rates of oxygenation +to carboxylation, which is virtually constant with temperature +:raw-latex:`\cite{farquhar1980}`. + +Resolution of the photosynthesis theory within the CLM(ED) canopy structure. +---------------------------------------------------------------------------- + +The photosynthesis scheme is modified from the CLM4.5 model to give +estimates of photosynthesis, respiration and stomatal conductance for a +three dimenstional matrix indexed by canopy level (:math:`C_l`), plant +functional type (:math:`ft`) and leaf layer (:math:`z`). We conduct the +photosynthesis calculations at each layer for both sunlit and shaded +leaves. Thus, the model also generates estimates of :math:`w_{c},w_{j}` +and :math:`w_{e}` indexed in the same three dimensional matrix. In this +implementation, some properties (stomatal conductance parameters, +top-of-canopy photosynthetic capacity) vary with plant functional type, +and some vary with both functional type and canopy depth (absorbed +photosynthetically active radiation, nitrogen-based variation in +photosynthetic properties). The remaining drivers of photosynthesis +(:math:`P_{atm}`, :math:`K_c`, :math:`o_i`, :math:`K_o`, temperature, +atmospheric CO\ :math:`_2`) remain the same throughout the canopy. The +rate of gross photosynthesis (:math:`gpp_{Cl,ft,z}`)is the smoothed +minimum of the three potentially limiting processes (carboxylation, +electron transport, export limitation), but calculated independently for +each leaf layer: + +.. math:: \textrm{gpp}_{Cl,ft,z} = \rm{min}(w_{c,Cl,ft,z},w_{j,Cl,ft,z},w_{e,Cl,ft,z}). + +For :math:`w_{c,Cl,ft,z},`, we use + +.. math:: + + w_{c,Cl,ft,z}= \left\{ \begin{array}{ll} + \frac{V_{c,max,Cl,ft,z}(c_{i,Cl,ft,z}- \Gamma_*)}{c_{i,Cl,ft,z}+K_c(1+o_i/K_o)} & \textrm{for $C_3$ plants}\\ + &\\ + V_{c,max,Cl,ft,z}& \textrm{for $C_4$ plants}\\ + \end{array} \right. + c_{i,Cl,ft,z}-\Gamma_*\ge 0 + +where :math:`V_{c,max}` now varies with PFT, canopy depth and layer +(see below). Internal leaf :math:`CO_{2}` (:math:`c_{i,Cl,ft,z})` is +tracked seperately for each leaf layer. For the light limited rate +:math:`w_j`, we use + +.. math:: + + w_j= \left\{ \begin{array}{ll} + \frac{J(c_i - \Gamma_*)4.6\phi\alpha}{4ci+8\Gamma_*} & \textrm{for C$_3$ plants}\\ + &\\ + 4.6\phi\alpha & \textrm{for C$_4$ plants}\\ + \end{array} \right. + +where :math:`J` is calculated as above but based on the absorbed +photosynthetically active radiation( :math:`\phi_{Cl,ft,z}`) for either +sunlit or shaded leaves in Wm\ :math:`^{-2}`. Specifically, + +.. math:: + + \phi_{Cl,ft,z}= \left\{ \begin{array}{ll} + abs_{sun,Cl,ft,z}& \textrm{for sunlit leaves}\\ + &\\ + abs_{sha,Cl,ft,z}& \textrm{for shaded leaves}\\ + \end{array} \right. + +The export limited rate of carboxylation for C3 plants and the PEP +carboxylase limited rate of carboxylation for C4 plants :math:`w_c` +(also in :math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` +s\ :math:`^{-1}`) is calculated in a similar fashion, + +.. math:: + + w_{e,Cl,ft,z}= \left\{ \begin{array}{ll} + 0.5V_{c,max,Cl,ft,z} & \textrm{for $C_3$ plants}\\ + &\\ + 4000 V_{c,max,Cl,ft,z} \frac{c_{i,Cl,ft,z}}{P_{atm}}& \textrm{for $C_4$ plants}.\\ + \end{array} \right. + +Variation in plant physiology with canopy depth +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Both :math:`V_{c,max}` and :math:`J_{max}` vary with vertical depth in +the canopy on account of the well-documented reduction in canopy +nitrogen through the leaf profile, see :raw-latex:`\cite{bonan2012}` for +details). Thus, both :math:`V_{c,max}` and :math:`J_{max}` are indexed +by by :math:`C_l`, :math:`ft` and :math:`z` according to the nitrogen +decay coefficient :math:`K_n` and the amount of vegetation area shading +each leaf layer :math:`V_{above}`, + +.. math:: + + \begin{array}{ll} + V_{c,max,Cl,ft,z} & = V_{c,max0,ft} e^{-K_{n,ft}V_{above,Cl,ft,z}},\\ + J_{max,Cl,ft,z} & = J_{max0,ft} e^{-K_{n,ft}V_{above,Cl,ft,z}},\\ + \end{array} + +where :math:`V_{c,max,0}` and :math:`J_{max,0}` are the top-of-canopy +photosynthetic rates. :math:`V_{above}` is the sum of exposed leaf area +index (:math:`\textrm{elai}_{Cl,ft,z}`) and the exposed stem area index +(:math:`\textrm{esai}_{Cl,ft,z}`)( m\ :math:`^{2}` m\ :math:`^{-2}` ). +Namely, + +.. math:: V_{Cl,ft,z} = \textrm{elai}_{Cl,ft,z} + \textrm{esai}_{Cl,ft,z}. + +The vegetation index shading a particular leaf layer in the top canopy +layer is equal to + +.. math:: + + \begin{array}{ll} + V_{above,Cl,ft,z}= \sum_{1}^{z} V_{Cl,ft,z} & \textrm{for $Cl= 1$. } + \end{array} + +For lower canopy layers, the weighted average vegetation index of the +canopy layer above (:math:`V_{canopy}`) is added to this within-canopy +shading. Thus, + +.. math:: + + \begin{array}{ll} + V_{above,Cl,ft,z}= \sum_{1}^{z} V_{Cl,ft,z} + V_{canopy,Cl-1} & \textrm{for $Cl >1$, }\\ + \end{array} + +where :math:`V_{canopy}` is calculated as + +.. math:: V_{canopy,Cl} = \sum_{ft=1}^{\emph{npft}} {\sum_{z=1}^{nz(ft)} (V_{Cl,ft,z} \cdot \it{pft}_{wt,Cl,ft,1}).} + +:math:`K_{n}` is the coefficient of nitrogen decay with canopy depth. +The value of this parameter is taken from the work of +:raw-latex:`\cite{lloyd2010}` who determined, from 204 vertical profiles +of leaf traits, that the decay rate of N through canopies of tropical +rainforests was a function of the :math:`V_{cmax}` at the top of the +canopy. They obtain the following term to predict :math:`K_{n}`, + +.. math:: K_{n,ft} = e^{0.00963 V_{c,max0,ft} - 2.43}, + +where :math:`V_{cmax}` is again in :math:`\mu`\ mol CO\ :math:`_2` +m\ :math:`^{-2}` s\ :math:`^{-1}`. + +Water Stress Function +~~~~~~~~~~~~~~~~~~~~~ + +[12]_ The top of canopy leaf photosynthetic capacity, :math:`V_{c,max0}`, is +also adjusted for the availability of water to plants as + +.. math:: V_{c,max0,25} = V_{c,max0,25} \beta_{sw}, + +where the adjusting factor :math:`\beta_{sw}` ranges from one when the +soil is wet to zero when the soil is dry. It depends on the soil water +potential of each soil layer, the root distribution of the plant +functional type, and a plant-dependent response to soil water stress, + +.. math:: \beta_{sw} = \sum_{j=1}^{nj}w_{j}r_{j}, + +where :math:`w_{j}` is a plant wilting factor for layer :math:`j` and +:math:`r_{j}` is the fraction of roots in layer :math:`j`.The plant +wilting factor :math:`w_{j}` is + +.. math:: + + w_{j}= \left\{ \begin{array}{ll} + \frac{\psi_c-\psi_{j}}{\psi_c - \psi_o} (\frac{\theta_{sat,j} - \theta_{ice,j}}{\theta_{sat,j}})& \textrm{for $T_i >$-2C}\\ + &\\ + 0 & \textrm{for $T_{j} \ge$-2C}\\ + \end{array} \right. + +where :math:`\psi_{i}` is the soil water matric potential (mm) and +:math:`\psi_{c}` and :math:`\psi_{o}` are the soil water potential (mm) +when stomata are fully closed or fully open, respectively. The term in +brackets scales :math:`w_{i}` the ratio of the effective porosity (after +accounting for the ice fraction) relative to the total porosity. +:math:`w_{i}` = 0 when the temperature of the soil layer (:math:`T_{i}` +) is below some threshold (-2:math:`^{o}`\ C) or when there is no liquid +water in the soil layer (:math:`\theta_{liq,i} \le 0`). For more details +on the calculation of soil matric potential, see the CLM4.5 technical +note. + +Variation of water stress and water uptake within tiles +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The remaining drivers of the photosynthesis model remain constant +(atmospheric CO\ :math:`_2` and O\ :math:`^2` and canopy temperature) +throughout the canopy, except for the water stress index +:math:`\beta_{sw}`. :math:`\beta_{sw}` must be indexed by :math:`ft`, +because plants of differing functional types have the capacity to have +varying root depth, and thus access different soil moisture profile and +experience differing stress functions. Thus, the water stress function +applied to gas exchange calculation is now calculated as + +.. math:: \beta_{sw,ft} = \sum_{j=1}^{nj}w_{j,ft} r_{j,ft}, + +where :math:`w_{j}` is the water stress at each soil layer :math:`j` +and :math:`r_{j,ft}` is the root fraction of each PFT’s root mass in +layer :math:`j`. Note that this alteration of the :math:`\beta_{sw}` +parameter also necessitates recalculation of the vertical water +extraction profiles. In the original model, the fraction of extraction +from each layer (:math:`r_{e,j,patch}`) is the product of a single root +distribution, because each patch only has one plant functional type. In +the CLM(ED), we need to calculate a new weighted patch effective rooting +depth profile :math:`r_{e,j,patch}` as the weighted average of the +functional-type level stress functions and their relative contributions +to canopy conductance. Thus for each layer :math:`j`, the extraction +fraction is summed over all PFTs as + +.. math:: r_{e,j,patch} = \sum_{ft=1}^{ft=npft} \frac{w_{j,ft}}{\sum_{j=1}^{=nj} w_{j,ft} }\frac{G_{s,ft}}{G_{s,canopy}}, + +where :math:`nj` is the number of soil layers, :math:`G_{s,canopy}`\ is +the total canopy (see section 9 for details) and :math:`G_{s,ft}` is the +canopy conductance for plant functional type :math:`ft`, + +.. math:: G_{s,ft}= \sum_{1}w_{ncoh,ft} {gs_{can,coh} n_{coh} }. + +Aggregation of assimilated carbon into cohorts +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The derivation of photosynthetic rates per leaf layer, as above, give us +the estimated rate of assimilation for a unit area of leaf at a given +point in the canopy in :math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` +s\ :math:`_{-1}`. To allow the integration of these rates into fluxes +per individual tree, or cohort of trees (gCO:math:`_2` +tree\ :math:`^{-1}` s\ :math:`^{-1}`), they must be multiplied by the +amount of leaf area placed in each layer by each cohort. Each cohort is +described by a single functional type, :math:`ft` and canopy layer +:math:`C_l` flag, so the problem is constrained to integrating these +fluxes through the vertical profile (:math:`z`). + +We fist make a weighted average of photosynthesis rates from sun +(:math:`\textrm{gpp}_{sun}`, :math:`\mu`\ mol CO\ :math:`_2` +m\ :math:`^{-2}` s\ :math:`^{-1}`) and shade leaves ( +:math:`\textrm{gpp}_{shade}`, :math:`\mu`\ mol CO\ :math:`_2` +m\ :math:`^{-2}` s\ :math:`^{-1}`) as + +.. math:: \textrm{gpp}_{Cl,ft,z} =\textrm{gpp}_{sun,Cl,ft,z} f_{sun,Cl,ft,z}+ \textrm{gpp}_{sha,Cl,ft,z}(1-f_{sun,Cl,ft,z}). + +The assimilation per leaf layer is then accumulated across all the leaf +layers in a given cohort (*coh*) to give the cohort-specific gross +primary productivity (:math:`\mathit{GPP}_{coh}`), + +.. math:: \textit{GPP}_{coh} = 12\times 10^{-9}\sum_{z=1}^{nz(coh)}gpp_{Cl,ft,z} A_{crown,coh} \textrm{elai}_{Cl,ft,z} + +The :math:`\textrm{elai}_{l,Cl,ft,z}` is the exposed leaf area which is +present in each leaf layer in m\ :math:`^{2}` m\ :math:`^{-2}`. (For all +the leaf layers that are completely occupied by a cohort, this is the +same as the leaf fraction of :math:`\delta_{vai}`). The fluxes are +converted from :math:`\mu`\ mol into mol and then multiplied by 12 (the +molecular weight of carbon) to give units for GPP\ :math:`_{coh}` of KgC +cohort\ :math:`^{-1}` s\ :math:`^{-1}`. These are integrated for each +timestep to give KgC cohort\ :math:`^{-1}` day\ :math:`^{-1}` + +.. raw:: latex + + \captionof{table}{Parameters needed for photosynthesis model.} + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`V_{c,max | Maximum | :math:`\mu` mol | *ft* | +| 0}` | carboxylation | CO :math:`_2` | | +| | capacity | m :math:`^{-2}` | | +| | | s :math:`^{-1}` | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`r_b` | Base Rate of | gC | | +| | Respiration | gN\ :math:`^{-1 | | +| | | } s^{-1}`) | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`q_{10}` | Temp. Response | | | +| | of stem and | | | +| | root | | | +| | respiration | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`R_{cn,le | CN ratio of | gC/gN | *ft* | +| af,ft}` | leaf matter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`R_{cn,ro | CN ratio of | gC/gN | *ft* | +| ot,ft}` | root matter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{gr}` | Growth | none | | +| | Respiration | | | +| | Fraction | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\psi_c` | Water content | Pa | *ft* | +| | when stomata | | | +| | close | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\psi_o` | Water content | Pa | *ft* | +| | above which | | | +| | stomata are | | | +| | open | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Plant respiration +================= + + [13]_ + +Plant respiration per individual :math:`R_{plant,coh}` (KgC individual +:math:`^{-1}` s\ :math:`^{-1}`) is the sum of two terms, growth and +maintenance respiration :math:`R_{g,coh}` and :math:`R_{m,coh}` + +.. math:: R_{plant} = R_{g,coh}+ R_{m,coh} + +Maintenance respiration is the sum of the respiration terms from four +different plant tissues, leaf, :math:`R_{m,leaf,coh}`, fine root +:math:`R_{m,froot,coh}`, coarse root :math:`R_{m,croot,coh}`\ and stem +:math:`R_{m,stem,coh}`, all also in (KgC individual :math:`^{-1}` +s\ :math:`^{-1}`) . + +.. math:: R_{m,coh} = R_{m,leaf,coh}+ R_{m,froot,coh}+R_{m,croot,coh}+R_{m,stem,coh} + +To calculate canopy leaf respiration, which varies through we canopy, we +first determine the top-of-canopy leaf respiration rate +(:math:`r_{m,leaf,ft,0}`, gC s\ :math:`^{-1}` m\ :math:`^{-2}`) is +calculated from a base rate of respiration per unit leaf nitrogen +derived from :raw-latex:`\cite{ryan1991}`. The base rate for leaf +respiration (:math:`r_{b}`) is 2.525 gC/gN s\ :math:`^{-1}`, + +.. math:: r_{m,leaf,ft,0} = r_{b} N_{a,ft}(1.5^{(25-20)/10}) + +where :math:`r_b` is the base rate of metabolism (2.525 x +10\ :math:`^6` gC/gN s\ :math:`^{-1}`. This base rate is adjusted +assuming a Q\ :math:`_{10}` of 1.5 to scale from the baseline of 20C to +the CLM default base rate temperature of 25C. For use in the +calculations of net photosynthesis and stomatal conductance, leaf +respiration is converted from gC s\ :math:`^{-1}` m\ :math:`^{-2}`, into +:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}` +(:math:`/12\cdot 10^{-6}`). + +This top-of-canopy flux is scaled to account for variation in +:math:`N_a` through the vertical canopy, in the same manner as the +:math:`V_{c,max}` values are scaled using :math:`V_{above}`. + +.. math:: r_{leaf,Cl,ft,z} = r_{m,leaf,ft,0} e^{-K_{n,ft}V_{above,Cl,ft,z}}\beta_{ft}f(t) + +Leaf respiration is also adjusted such that it is reduced by drought +stress, :math:`\beta_{ft}`, and canopy temperature, :math:`f(t_{veg})`. +For details of the temperature functions affecting leaf respiration see +the CLM4 technical note, Section 8, Equations 8.13 and 8.14. The +adjusted leaf level fluxes are scaled to individual-level (gC individual +:math:`^{-1}` s\ :math:`^{-1}`) in the same fashion as the +:math:`\rm{GPP}_{coh}` calculations + +.. math:: \rm{R}_{m,leaf,coh} = 12\times 10^{-9}\sum_{z=1}^{nz(coh)}r_{leaf,Cl,ft,z} A_{crown} \textrm{elai}_{Cl,ft,z} + +The stem and the coarse-root respiration terms are derived using the +same base rate of respiration per unit of tissue Nitrogen. + +.. math:: R_{m,croot,coh} = 10^{-3}r_b t_c \beta_{ft} N_{\rm{livecroot,coh}} + +.. math:: R_{m,stem,coh} = 10^{-3}r_b t_c \beta_{ft} N_{\rm{stem,coh}} + +Here, :math:`t_c` is a temperature relationship based on a +:math:`q_{10}` value of 1.5, where :math:`t_v` is the vegetation +temperature. We use a base rate of 20 here as, again, this is the +baseline temperature used by :raw-latex:`\cite{ryan1991}`. The +10\ :math:`^{-3}` converts from gC invididual\ :math:`^{-1}` +s\ :math:`^{-1}` to KgC invididual\ :math:`^{-1}` s\ :math:`^{-1}` + +.. math:: t_c=q_{10}^{(t_{v} - 20)/10} + +The tissue N contents for live sapwood are derived from the leaf CN +ratios, and for fine roots from the root CN ratio as: + +.. math:: N_{\rm{stem,coh}} = \frac{B_{\rm{sapwood,coh}}}{ R_{cn,leaf,ft}} + +and + +.. math:: N_{\rm{livecroot,coh}} = \frac{ B_{\rm{root,coh}}w_{frac,ft}}{R_{cn,root,ft}} + +where :math:`B_{\rm{sapwood,coh}}` and :math:`B_{\rm{root,coh}}` are +the biomass pools of sapwood and live root biomass respectively (KgC +individual) and :math:`w_{frac,ft}` is the fraction of coarse root +tissue in the root pool (0.5 for woody plants, 0.0 for grasses and +crops). We assume here that stem CN ratio is the same as the leaf C:N +ratio, for simplicity. The final maintenance respiration term is derived +from the fine root respiration, which accounts for gradients of +temperature in the soil profile and thus calculated for each soil layer +:math:`j` as follows: + +.. math:: R_{m,froot,j } = \frac{(1 - w_{frac,ft})B_{\rm{root,coh}}b_r\beta_{ft}}{10^3R_{cn,leaf,ft}} \sum_{j=1}^{nj}t_{c,soi,j} r_{i,ft,j} + +:math:`t_{c,soi}` is a function of soil temperature in layer :math:`j` +that has the same form as that for stem respiration, but uses vertically +resolved soil temperature instead of canopy temperature. In the CLM4.5, +only coarse and not fine root respriation varies as a function of soil +depth, and we maintain this assumption here, although it may be altered +in later versions. The growth respiration, :math:`R_{g,coh}` is a fixed +fraction :math:`f_{gr}` of the carbon remaining after maintenance +respiration has occurred. + +.. math:: R_{g,coh}=\textrm{max}(0,GPP_{g,coh} - \it R\rm_{m,coh})f_{gr} + +.. raw:: latex + + \captionof{table}{Parameters needed for plant respiration model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`-K_{n,ft | Rate of | none | - | +| }` | reduction of N | | | +| | through the | | | +| | canopy | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`r_b` | Base Rate of | gC | | +| | Respiration | gN\ :math:`^{-1 | | +| | | } s^{-1}`) | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`q_{10}` | Temp. Response | | | +| | of stem and | | | +| | root | | | +| | respiration | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`R_{cn,le | CN ratio of | gC/gN | *ft* | +| af,ft}` | leaf matter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`R_{cn,ro | CN ratio of | gC/gN | *ft* | +| ot,ft}` | root matter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{gr}` | Growth | none | | +| | Respiration | | | +| | Fraction | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Stomatal Conductance +==================== + +Fundamental stomatal conductance theory +--------------------------------------- + + [14]_ + +Stomatal conductance is unchanged in concept from the CLM4.5 approach. +Leaf stomatal resistance is calculated from the Ball-Berry conductance +model as described by :raw-latex:`\cite{collatz1991}` and implemented in +a global climate model by :raw-latex:`\cite{sellers1996}`. The model +relates stomatal conductance (i.e., the inverse of resistance) to net +leaf photosynthesis, scaled by the relative humidity at the leaf surface +and the CO\ :math:`_2` concentration at the leaf surface. The primary +difference between the CLM implementation and that used by +:raw-latex:`\cite{collatz1991}` and :raw-latex:`\cite{sellers1996}` is +that they used net photosynthesis (i.e., leaf photosynthesis minus leaf +respiration) instead of gross photosynthesis. As implemented here, +stomatal conductance equals the minimum conductance (:math:`b`) when +gross photosynthesis (:math:`A`) is zero. Leaf stomatal resistance is + +.. math:: \frac{1}{r_{s}} = m_{ft} \frac{A}{c_s}\frac{e_s}{e_i}P_{atm}+b_{ft} \beta_{sw} + +where :math:`r_{s}` is leaf stomatal resistance (s m\ :math:`^2` +:math:`\mu`\ mol\ :math:`^{-1}`), :math:`b_{ft}` is a plant functional +type dependent parameter equivalent to :math:`g_{0}` in the Ball-Berry +model literature. This parameter is also scaled by the water stress +index :math:`\beta_{sw}`. Similarly, :math:`m_{ft}` is the slope of the +relationship between the assimilation, :math:`c_s` and humidty dependant +term and the stomatal conductance, and so is equivalent to the +:math:`g_{1}` term in the stomatal literature. :math:`A` is leaf +photosynthesis (:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` +s\ :math:`^{-1}`), :math:`c_s` is the CO\ :math:`_2` partial pressure at +the leaf surface (Pa), :math:`e_s` is the vapor pressure at the leaf +surface (Pa), :math:`e_i` is the saturation vapor pressure (Pa) inside +the leaf at the vegetation temperature conductance (:math:`\mu`\ mol +m\ :math:`^{-2}` s\ :math:`^{-1}`) when :math:`A` = 0 . Typical values +are :math:`m_{ft}` = 9 for C\ :math:`_3` plants and :math:`m_{ft}` = 4 +for C\ :math:`_4` plants +:raw-latex:`\parencite{collatz1991,collatz1992,sellers1996}`. +:raw-latex:`\cite{sellers1996}` used :math:`b` = 10000 for C\ :math:`_3` +plants and :math:`b` = 40000 for C\ :math:`_4` plants. Here, :math:`b` +was chosen to give a maximum stomatal resistance of 20000 s +m\ :math:`^{-1}`. These terms are nevertheless plant strategy dependent, +and have been found to vary widely with plant type +:raw-latex:`\parencite{medlyn2011}`. + +Resistance is converted from units of s m\ :math:`^2 \mu` +mol\ :math:`^{-1}` to s m\ :math:`^{-1}` as: 1 s m\ :math:`^{-1}` = +:math:`1\times 10^{-9}`\ R\ :math:`_{\rm{gas}} \theta_{\rm{atm}}P_{\rm{atm}}` +(:math:`\mu`\ mol\ :math:`^{-1}` m\ :math:`^{2}` s), where +R\ :math:`_{gas}` is the universal gas constant (J K\ :math:`^{-1}` +kmol\ :math:`^{-1}`) and :math:`\theta_{atm}` is the atmospheric +potential temperature (K). + +Resolution of the stomatal conductance theory in the CLM(ED) canopy structure +----------------------------------------------------------------------------- + +The stomatal conductance is calculated, as with photosynthesis, for each +canopy, PFT and leaf layer. The CLM code requires a single canopy +conductance estimate to be generated from the multi-layer multi-PFT +array. In previous iterations of the CLM, sun and shade-leaf specific +values have been reported and then averaged by their respective leaf +areas. In this version, the total canopy condutance +:math:`G_{s,canopy}`, is calculated as the sum of the cohort-level +conductance values. + +.. math:: G_{s,canopy} = \sum{ \frac{gs_{can,coh} n_{coh} }{A_{patch}}} + +Cohort conductance is the sum of the inverse of the leaf resistances at +each canopy layer (:math:`r_{s,z}` ) multipled by the area of each +cohort. + +.. math:: gs_{can,coh} =\sum_{z=1}^{z=nv,coh}{\frac{ A_{crown,coh}}{r_{s,cl,ft,z}+r_{b}}} + + +.. raw:: latex + + \captionof{table}{Parameters needed for stomatal conductance model. } + ++------------------+--------------------------+-------+------------+ +| Parameter Symbol | Parameter Name | Units | indexed by | ++==================+==========================+=======+============+ +| :math:`b_{ft}` | Slope of Ball-Berry term | none | *ft* | ++------------------+--------------------------+-------+------------+ +| :math:`m_{ft}` | Slope of Ball-Berry term | none | *ft* | ++------------------+--------------------------+-------+------------+ + + +Allocation +========== + + [15]_ + +Total assimilation carbon enters the ED model each day as a +cohort-specific Net Primary Productivity :math:`\mathit{NPP}_{coh}`, +which is calculated as + +.. math:: \mathit{NPP}_{coh} = \mathit{GPP}_{coh} - R_{plant,coh} + +This flux of carbon is allocated between the demands of tissue turnover, +of carbohydrate storage and of growth (increase in size of one or many +plant organs). Priority is explicitly given to maintenance respiration, +followed by tissue maintenance and storage, then allocation to live +biomass and then to the expansion of structural and live biomass pools. +All fluxes here are first converted into in KgC +individual\ :math:`^{-1}` year\ :math:`^{-1}` and ultimately integrated +using a timesteps of 1/365 years for each day. + +Tissue maintenance demand +------------------------- + +We calculate a ‘tissue maintenance’ flux. The magnitude of this flux is +such that the quantity of biomass in each pool will remain constant, +given background turnover rates. For roots, this maintenenace demand is +simply + +.. math:: r_{md,coh} = b_{root}\cdot\alpha_{root,ft} + +Where :math:`\alpha_{root,ft}` is the root turnover rate in y^-1. Given +that, for deciduous trees, loss of leaves is assumed to happen only one +per growing season, the algorithm is dependent on phenological habit +(whether or not this PFT is evergreen), thus + +.. math:: + + l_{md,coh} = \left\{ \begin{array}{ll} + b_{leaf}\cdot\alpha_{leaf,ft}&\textrm{for } P_{evergreen}= 1\\ + &\\ + 0&\textrm{for } P_{evergreen}= 0\\ + \end{array} \right. + +Leaf litter resulting from deciduous senescence is handled in the +phenology section. The total quantity of maintenance demand +(:math:`t_{md,coh}`. KgC individual y\ :math:`^{-1}`) is therefore + +.. math:: t_{md,coh} = l_{md,coh} + r_{md,coh} + +Allocation to storage and turnover +---------------------------------- + +The model must now determine whether the NPP input is sufficient to meet +the maintenance demand and keep tissue levels constant. To determine +this, we introduce the idea of ‘carbon balance’ :math:`C_{bal,coh}` (KgC +individual\ :math:`^{-1}`) where + +.. math:: C_{bal,coh}= \mathit{NPP}_{coh} - t_{md,coh}\cdot f_{md,min,ft} + +where :math:`f_{md,min,ft}` is the minimum fraction of the maintenance +demand that the plant must meet each timestep, which is indexed by *ft* +and represents a life-history-strategy decision concerning whether +leaves should remain on in the case of low carbon uptake (a risky +strategy) or not be replaced (a conservative strategy). Subsequently, we +determine a flux to the storage pool, where the flux into the pool, as a +fraction of :math:`C_{bal,coh}`, is proportional to the discrepancy +between the target pool size and the actual pool size :math:`f_{tstore}` +where + +.. math:: f_{tstore} = \mathrm{max}\left(0,\frac{b_{store}}{b_{leaf}\cdot S_{cushion}}\right) + +The allocation to storage is a fourth power function of +:math:`f_{tstore}` to mimic the qualitative behaviour found for carbon +allocation in arabidopsis by :raw-latex:`\cite{smith2007}`. + +.. math:: + + \frac{\delta b_{store}}{\delta t} = \left\{ \begin{array}{ll} + C_{bal,coh} \cdot e^{-f_{tstore}^{4}} &\textrm{for }C_{bal,coh}>0\\ + &\\ + C_{bal,coh} &\textrm{for }C_{bal,coh}\leq0\\ + \end{array} \right. + +If the carbon remaining after the storage and minimum turnover fluxes +have been met, the next priority is the remaining flux to leaves +:math:`t_{md}\cdot(1-f_{md,min})`. If the quantity of carbon left +:math:`(C_{bal,coh}-\frac{\delta b_{store}}{\delta t})` is insufficient +to supply this amount of carbon, then the store of alive carbon is +depleted (to represent those leaves that have fallen off and not been +replaced) + +.. math:: + + \frac{\delta b_{alive}}{\delta t} = \left\{ \begin{array}{ll} + 0 &\textrm{ for } (C_{bal,coh}-\frac{\delta b_{store}}{\delta t}) > t_{md}\cdot(1-f_{md,min})\\ + &\\ + t_{md}\cdot(1-f_{md,min}) - \left(C_{bal,coh}-\frac{\delta b_{store}}{\delta t}\right)&\textrm{ for } (C_{bal,coh}-\frac{\delta b_{store}}{\delta t}) \leq t_{md}\cdot(1-f_{md,min})\\ + \end{array} \right. + +correspondingly, the carbon left over for growth (:math:`C_{growth}`: +(KgC individual\ :math:`^{-1}` year\ :math:`^{-1}`) is therefore + +.. math:: + + C_{growth} = \left\{ \begin{array}{ll} + C_{bal,coh}-\frac{\delta b_{store}}{\delta t} &\textrm{ for } (C_{bal,coh}-\frac{\delta b_{store}}{\delta t}) > 0\\ + &\\ + 0&\textrm{ for } (C_{bal,coh}-\frac{\delta b_{store}}{\delta t}) \leq 0\\ + \end{array} \right. + +to allocate the remaining carbon (if there is any), we first ascertain +whether the live biomass pool is at its target, or whether is has been +depleted by previous low carbon timesteps. Thus + +.. math:: + + \begin{array}{lll} + b_{alive,target}&= b_{leaf,target} (1+ f_{frla}+f_{swh}h_{coh}) &\textrm{for } S_{phen,coh} = 2\\ + b_{alive,target}&= b_{leaf,target} ( f_{frla}+f_{swh}h_{coh})&\textrm{for } S_{phen,coh} = 1\\ + \end{array} + +where the target leaf biomass :math:`b_{leaf.target}` ((Kg C +individual\ :math:`^{-1}`)) is the allometric relationship between dbh +and leaf biomass, ameliorated by the leaf trimming fraction (see +‘control of leaf area’ below) + +.. math:: b_{leaf.target} = c_{leaf}\cdot dbh_{coh}^{e_{leaf,dbh}} \rho_{ft} ^{e_{leaf,dens}}\cdot C_{trim,coh} + +:math:`\rho_{ft}` is the wood density, in g cm\ :math:`^{3}`. + +Allocation to Seeds +~~~~~~~~~~~~~~~~~~~ + +The fraction remaining for growth (expansion of live and structural +tissues) :math:`f_{growth}` is 1 minus that allocated to seeds. + +.. math:: f_{growth,coh} = 1 - f_{seed,coh} + +Allocation to seeds only occurs if the alive biomass is not below its +target, and then is a predefined fixed fraction of the carbon remaining +for growth. Allocation to clonal reproduction (primarily for grasses) +occurs when :math:`\textrm{max}_{dbh}` is achieved. + +.. math:: + + f_{seed,coh} = \left\{ \begin{array}{ll} + R_{frac,ft}&\textrm{ for } \textrm{max}_{dbh} < dbh_{coh} \\ + &\\ + \left( R_{frac,ft}+C_{frac,ft} \right) &\textrm{ for } \textrm{max}_{dbh} \geq dbh_{coh} \\ + \end{array} \right. + +the total amount allocated to seed production (:math:`p_{seed,coh}` in +KgC individual :math:`^{-1}` y\ :math:`^{-1}`) is thus + +.. math:: p_{seed,coh} = C_{growth}\cdot f_{seed,coh} + +Allocation to growing pools +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[16]_ The carbon is then partitioned into carbon available to grow the +:math:`b_{alive}` and :math:`b_{struc}` pools. A fraction :math:`v_{a}` +is available to live biomass pools, and a fraction :math:`v_{s}` is +available to structural pools. + +.. math:: \frac{\delta b_{alive}}{\delta t} = C_{growth}\cdot f_{growth} v_{a} + +.. math:: \frac{\delta b_{struc}}{\delta t} = C_{growth}\cdot f_{growth} v_{s} + +If the alive biomass is lower than its ideal target, all of the +available carbon is directed into that pool. Thus: + +.. math:: + + v_{a}= \left\{ \begin{array}{ll} + \frac{1}{1+u}&\textrm{ for } b_{alive} \geq b_{alive,target} \\ + &\\ + 1.0&\textrm{ for } b_{alive} < b_{alive,target} \\ + \end{array} \right. + +.. math:: + + v_{s}= \left\{ \begin{array}{ll} + \frac{u}{1+u}&\textrm{ for } b_{alive} \geq b_{alive,target} \\ + &\\ + 0.0&\textrm{ for } b_{alive} < b_{alive,target} \\ + \end{array} \right. + +In this case, the division of carbon between the live and structural +pools :math:`u` is derived as the inverse of the sum of the rates of +change in live biomass with respect to structural: + +.. math:: u = \frac{1}{\frac{\delta b_{leaf}}{ \delta b_{struc} } + \frac{\delta b_{root}}{ \delta b_{struc} } +\frac{\delta b_{sw}}{ \delta b_{struc} } } + +To calculate all these differentials, we first start with +:math:`\delta b_{leaf}/\delta b_{struc}`, where + +.. math:: \frac{\delta b_{leaf}}{ \delta b_{struc}}= \frac{\frac{\delta \mathrm{dbh}}{\delta b_{struc}}} {\frac{\delta \mathrm{dbh} }{\delta b_{leaf}} } + +The rates of change of dbh with respect to leaf and structural biomass +are the differentials of the allometric equations linking these terms to +each other. Hence, + +.. math:: \frac{\delta \mathrm{dbh} }{\delta b_{leaf}}=\frac{1}{b_{trim,coh}}\cdot (e_{leaf,dbh}-1)\exp {\big(c_{leaf} \mathrm{dbh}^{(e_{leaf,dbh})-1} \rho_{ft}^{e_{leaf,dens}} \big)} + +and where :math:`\mathrm{dbh}_{coh} > \mathrm{dbh}_{max}` + +.. math:: \frac{\delta b_{struc}}{\delta \mathrm{dbh}} = e_{str,dbh} \cdot c_{str}\cdot e_{str,hite} h_{coh}^{e_{str,dbh}-1} \mathrm{dbh}_{coh}^{e_{str,dbh}} \rho_{ft}^{e_{str,dens}} + +If :math:`\mathrm{dbh}_{coh} \leq \mathrm{dbh}_{max}` then we must +also account for allocation for growing taller as: + +.. math:: \frac{\delta b_{struc}}{\delta \mathrm{dbh}} = \frac{\delta b_{struc}}{\delta \mathrm{dbh}} + \frac{\delta h}{\delta \mathrm{dbh}} \cdot \frac{\delta b_{struc}}{\delta \mathrm{dbh} } + +where + +.. math:: \frac{\delta h}{\delta \mathrm{dbh}}= 1.4976 \mathrm{dbh}_{coh}^{m_{allom}-1} + +.. math:: \frac{\delta \mathrm{dbh} }{\delta b_{struc}} =\frac{1}{ \frac{\delta b_{struc}}{\delta \mathrm{dbh}} } + +Once we have the :math:`\delta b_{leaf}/\delta b_{struc}`, we calculate +:math:`\delta b_{root}/\delta b_{struc}` as + +.. math:: \frac{\delta b_{root}}{\delta b_{struc}} =\frac{\delta b_{leaf}}{\delta b_{struc}}\cdot f_{frla} + +and the sapwood differential as + +.. math:: \frac{\delta b_{sw}}{\delta b_{struc}} = f_{swh}\left( h_{coh} \frac{\delta b_{leaf}}{ \delta b_{struc}} + b_{leaf,coh}\frac{\delta h}{\delta b_{struc}} \right) + +where + +.. math:: \frac{\delta h}{\delta b_{struc}} = \frac{1}{c_{str}\times e_{str,hite} h_{coh}^{e_{str,dbh}-1} \mathrm{dbh}_{coh}^{e_{str,dbh}} \rho_{ft}^{e_{str,dens}}} + +In all of the above terms, height in in m, :math:`\mathrm{dbh}` is in +cm, and all biomass pools are in KgCm\ :math:`^{-2}`. The allometric +terms for the growth trajectory are all taken from the ED1.0 model, but +could in theory be altered to accomodate alternative allometric +relationships. Critically, the non-linear relationships between live and +structural biomass pools are maintained in this algorithm, which +diverges from the methodology currently deployed in the CLM4.5. + +Integration of allocated fluxes +------------------------------- + +All of the flux calculations generate differential of the biomass state +variables against time (in years). To integrate these differential rates +into changes in the state variables, we use a simple simple forward +Euler integration. Other methods exist (e.g. ODEINT solvers, Runge Kutta +methods etc.), but they are more prone to errors that become difficult +to diagnose, and the typically slow rates of change of carbon pools mean +that these are less important than they might be in strongly non-linear +systems (soil drainage, energy balance, etc.) + +.. math:: b_{alive,t+1} = \textrm{min}\left( 0,b_{alive,t} + \frac{\delta b_{alive}}{\delta t} \delta t \right) + +.. math:: b_{struc,t+1} = \textrm{min}\left(0, b_{struc,t} + \frac{\delta b_{struc}}{\delta t} \delta t \right) + +.. math:: b_{store,t+1} = \textrm{min}\left(0, b_{store,t} + \frac{\delta b_{store}}{\delta t} \delta t \right) + +In this case, :math:`\delta t` is set to be one day +(:math:`\frac{1}{365}` years). + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for allocation model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| S | Target stored | none | *ft* | +| | biomass as | | | +| | fraction of | | | +| | :math:`b_{leaf}`| | | +| | | | | ++-----------------+-----------------+-----------------+-----------------+ +| f | Minimum | none | *ft* | +| | fraction of | | | +| | turnover that | | | +| | must be met | | | ++-----------------+-----------------+-----------------+-----------------+ +| R | Fraction | none | *ft* | +| | allocated to | | | +| | seeds | | | ++-----------------+-----------------+-----------------+-----------------+ +| C | Fraction | none | *ft* | +| | allocated to | | | +| | clonal | | | +| | reproduction | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\textrm{ | Diameter at | m | *ft* | +| max}_{dbh}` | which maximum | | | +| | height is | | | +| | achieved | | | ++-----------------+-----------------+-----------------+-----------------+ +| P | Does this | 1=yes, 0=no | *ft* | +| | cohort have an | | | +| | evergreen | | | +| | phenological | | | +| | habit? | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Control of Leaf Area Index +========================== + + [17]_ + +The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is +calculated from leaf biomass :math:`b_{leaf,coh}` (kgC +individual\ :math:`^{-1}`) and specific leaf area (SLA, m\ :math:`^2` kg +C\ :math:`^{-1}`) + +.. math:: A_{leaf,coh} = b_{leaf,coh} \cdot SLA_{ft} + +For a given tree allometry, leaf biomass is determined from basal area +using the function used by :raw-latex:`\cite{mc_2001}` where :math:`d_w` +is wood density in g cm\ :math:`^{-3}`. + +.. math:: b_{leaf,coh} = c_{leaf} \cdot dbh_{coh}^{e_{leaf,dbh}} \rho_{ft}^{e_{leaf,dens}} + +However, using this model, where leaf area and crown area are both +functions of diameter, the leaf area index of each tree in a closed +canopy forest is always the same (where :math:`S_{c,patch}` = +:math:`S_{c,min}` , irrespective of the growth conditions. To allow +greater plasticity in tree canopy structure, and for tree leaf area +index to adapt to prevailing conditions, we implemented a methodology +for removing those leaves in the canopy that exist in negative carbon +balance. That is, their total annual assimilation rate is insufficient +to pay for the turnover and maintenance costs associated with their +supportive root and stem tissue, plus the costs of growing the leaf. The +tissue turnover maintenance cost (KgC m\ :math:`^{-2} y^{-1}` of leaf is +the total maintenance demand divided by the leaf area: + +.. math:: L_{cost,coh} = \frac{t_{md,coh}} {b_{leaf,coh} \cdot \textrm{SLA}} + +The net uptake for each leaf layer :math:`U_{net,z}` in (KgC +m\ :math:`^{-2}` year\ :math:`^{-1}`) is + +.. math:: U_{net,coh,z} = g_{coh,z}-r_{m,leaf,coh,z} + +where :math:`g_{z}` is the GPP of each layer of leaves in each tree (KgC +m\ :math:`^{-2}` year\ :math:`^{-1}`), :math:`r_{m,leaf,z}` is the rate +of leaf dark respiration (also KgC m\ :math:`^{-2}` +year\ :math:`^{-1}`). We use an iterative scheme to define the cohort +specific canopy trimming fraction :math:`C_{trim,coh}`, on an annual +time-step, where + +.. math:: b_{leaf,coh} = C_{trim} \times 0.0419 dbh_{coh}^{1.56} d_w^{0.55} + +If the annual maintenance cost of the bottom layer of leaves (KgC m-2 +year-1) is less than then the canopy is trimmed by an increment :math:`\iota_l`\ (0.01), which is applied until the end of next calander year. Because this is an optimality model, there is an +issue of the timescale over which net assimilation is evaluated, the +timescale of response, and the plasticity of plants to respond to these +pressures. These properties should be investigated further in future +efforts. + +.. math:: + + C_{trim,y+1} = \left\{ \begin{array}{ll} + \rm{max}(C_{trim,y}-\iota_l,1.0)&\rm{for} (L_{cost,coh} > U_{net,coh,nz})\\ + &\\ + \rm{min}(C_{trim,y}+\iota_l,L_{trim,min})&\rm{for} (L_{cost,coh} < U_{net,coh,nz})\\ + \end{array} \right. + +We impose an arbitrary minimum value on the scope of canopy trimming of +:math:`L_{trim,min}` (0.5). If plants are able simply to drop all of +their canopy in times of stress, with no consequences, then tree +mortality from carbon starvation is much less likely to occur because of +the greatly reduced maintenance and turnover requirements. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for leaf area control model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`\iota_l` | Fraction by | none | - | +| | which leaf mass | | | +| | is reduced next | | | +| | year | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`L_{trim, | Minimum | - | | +| min}` | fraction to | | | +| | which leaf mass | | | +| | can be reduced | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Phenology +========= + +Cold Deciduous Phenology +------------------------ + +Cold Leaf-out timing +~~~~~~~~~~~~~~~~~~~~ + +[18]_. The phenology model of :raw-latex:`\cite{botta2000}` is used in +CLM(ED) to determine the leaf-on timing. The Botta et al. model was +verified against satellite data and is one of the only globally verified +and published models of leaf-out phenology. This model differs from the +phenology model in the CLM4.5. The model simulates leaf-on date as a +function of the number of growing degree days (GDD), defined by the sum +of mean daily temperatures (:math:`T_{day}` :math:`^{o}`\ C) above a +given threshold :math:`T_{g}` (0 :math:`^{o}`\ C). + +.. math:: GDD=\sum \textrm{max}(T_{day}-T_{g},0) + +Budburst occurs when :math:`GDD` exceeds a threshold +(:math:`GDD_{crit}`). The threshold is modulated by the number of +chilling days experienced (NCD) where the mean daily temperature falls +below a threshold determined by :raw-latex:`\cite{botta2000}` as +5\ :math:`^{o}`\ C. A greater number of chilling days means that fewer +growing degree days are required before budburst: + +.. math:: GDD_{crit}=a+be^{c.NCD} + +where a = -68, b= 638 and c=-0.01 :raw-latex:`\cite{botta2000}`. In the +Northern Hemisphere, counting of degree days begins on 1st January, and +of chilling days on 1st November. The calendar opposite of these dates +is used for points in the Southern Hemisphere. + +If the growing degree days exceed the critical threshold, leaf-on is +triggered by a change in the gridcell phenology status flag +:math:`S_{phen,grid}` where ‘2’ indicates that leaves should come on and +‘1’ indicates that they should fall. + +.. math:: + + \begin{array}{ll} + S_{phen,grid} = 2 + &\textrm{ if } S_{phen,grid} = 1\textrm{ and } GDD_{grid} \ge GDD_{crit} \\ + \end{array} + +Cold Leaf-off timing +~~~~~~~~~~~~~~~~~~~~ + +The leaf-off model is taken from the Sheffield Dynamic Vegetation Model +(SDGVM) and is similar to that for LPJ +:raw-latex:`\parencite{sitch2003}` and IBIS +:raw-latex:`\parencite{foley1996}` models. The average daily +temperatures of the previous 10 day period are stored. Senescence is +triggered when the number of days with an average temperature below +7.5\ :math:`^{o}` (:math:`n_{colddays}`) rises above a threshold values +:math:`n_{crit,cold}`, set at 5 days. + +.. math:: + + \begin{array}{ll} + S_{phen,grid} = 1 + &\textrm{ if } S_{phen,grid} = 2\textrm{ and } n_{colddays} \ge n_{crit,cold} \\ + \end{array} + +Global implementation modifications +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Because of the global implementation of the cold-deciduous phenology +scheme, adjustments must be made to account for the possibility of +cold-deciduous plants experiencing situations where no chilling period +triggering leaf-off ever happens. If left unaccounted for, these leaves +will last indefinitely, resulting in highly unrealistic behaviour. +Therefore, we implement two additional rules. Firstly, if the number of +days since the last senescence event was triggered is larger than 364, +then leaf-off is triggered on that day. Secondly, if no chilling days +have occured during the winter accumulation period, then leaf-on is not +triggered. This means that in effect, where there are no cold periods, +leaves will fall off and not come back on, meaning that cold-deciduous +plants can only grow in places where there is a cold season. + +Further to this rule, we introduce a ‘buffer’ time periods after leaf-on +of 30 days, so that cold-snap periods in the spring cannot trigger a +leaf senescence. The 30 day limit is an arbitrary limit. In addition, we +constrain growing degree day accumulation to the second half of the year +(Jult onwards in the Northern hemisphere, or Jan-June in the Southern) +and only allow GDD accumulation while the leaves are off. + +Drought-deciduous Phenology +--------------------------- + +In the current version of the model, a drought deciduous algorithm +exists, but is not yet operational, due to issue detected in the exsting +CN and soil moisture modules, which also affect the behaviour of the +native ED drought deciduous model. This is a priority to address before +the science tag is released. + +Carbon Dynamics of deciduous plants +----------------------------------- + + [19]_ + +In the present version, leaf expansion and senescence happen over the +course of a single day. This is clearly not an empirically robust +representation of leaf behaviour, whereby leaf expansion occurs over a +period of 10-14 days, and senescence over a similar period. This will be +incorporated in later versions. When the cold or drought phenological +status of the gridcell status changes (:math:`S_{phen,grid}`) from ‘2’ +to ‘1’, and the leaves are still on (:math:`S_{phen,coh}` =2 ), the leaf +biomass at this timestep is ’remembered’ by the model state variable +:math:`l_{memory,coh}`. This provides a ‘target’ biomass for leaf onset +at the beginning of the next growing season (it is a target, since +depletion of stored carbon in the off season may render achieving the +target impossible). + +.. math:: l_{memory,coh} = b_{leaf,coh} + +Leaf carbon is then added to the leaf litter flux :math:`l_{leaf,coh}` +(KgC individual\ :math:`^{-1}`) + +.. math:: l_{leaf,coh} = b_{leaf,coh} + +The alive biomass is depleted by the quantity of leaf mass lost, and the +leaf biomass is set to zero + +.. math:: b_{alive,coh} = b_{alive,coh} - b_{leaf,coh} + +.. math:: b_{leaf,coh} = 0 + +Finally, the status :math:`S_{phen,coh}` is set to 1, indicating that +the leaves have fallen off. + +For bud burst, or leaf-on, the same occurs in reverse. If the leaves are +off (:math:`S_{phen,coh}`\ =1) and the phenological status triggers +budburst (:math:`S_{phen,grid}`\ =2) then the leaf mass is set the +maximum of the leaf memory and the available store + +.. math:: b_{leaf,coh} = \textrm{max}\left(l_{memory,coh}, b_{store,coh}\right.) + +this amount of carbon is removed from the store + +.. math:: b_{store,coh} = b_{store,coh} - b_{leaf,coh} + +and the new leaf biomass is added to the alive pool + +.. math:: b_{alive,coh} = b_{alive,coh} + b_{leaf,coh} + +Lastly, the leaf memory variable is set to zero and the phenological +status of the cohort back to ‘2’. No parameters are currently required +for this carbon accounting scheme. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for phenology model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`n_{crit, | Threshold of | none | - | +| cold}` | cold days for | | | +| | senescence | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`T_{g}` | Threshold for | :math:`^{o}`\ C | | +| | counting | | | +| | growing degree | | | +| | days | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Seed Dynamics and Recruitment +============================= + + [20]_ + +The production of seeds and their subsequent germination is a process +that must be captured explicitly or implicitly in vegetation models. The +CLM(ED) contains a seed bank model designed to allow the dynamics of +seed production and germination to be simulated independently. In the +ED1.0 model, seed recruitment occurs in the same timestep as allocation +to seeds, which prohibits the survival of a viable seed bank through a +period of disturbance or low productivity (winter, drought). In the +CLM(ED) model, a plant functional type specific seed bank is tracked in +each patch (:math:`Seeds_{patch}` KgC m\ :math:`^{-2}`), whose rate of +change (KgC m\ :math:`^{-2}` y\ :math:`^{-1}`) is the balance of inputs, +germination and decay: + +.. math:: \frac{\delta Seeds_{FT}}{\delta t } = Seed_{in,ft} - Seed_{germ,ft} - Seed_{decay,ft} + +where :math:`Seed_{in}`, :math:`Seed_{germ}` and :math:`Seed_{decay}` +are the production, germination and decay (or onset of inviability) of +seeds, all in KgC m\ :math:`^{-2}` year\ :math:`^{-1}`. + +Seeds are assumed to be distributed evenly across the site (in this +version of the model), so the total input to the seed pool is therefore +the sum of all of the reproductive output of all the cohorts in each +patch of the correct PFT type. + +.. math:: Seed_{in,ft} = \frac{\sum_{p=1}^{n_{patch}}\sum_{i=1}^{n_{coh}}p_{seed,i}.n_{coh}}{area_{site}} + +Seed decay is the sum of all the processes that reduce the number of +seeds, taken from :raw-latex:`\cite{lischke2006}`. Firstly, the rate at +which seeds become inviable is described as a constant rate :math:`\phi` +(y:math:`^{-1}`) which is set to 0.51, the mean of the parameters used +by :raw-latex:`\cite{lischke2006}`. + +.. math:: Seed_{decay,ft} = Seeds_{FT}.\phi + +The seed germination flux is also prescribed as a fraction of the +existing pool (:math:`\alpha_{sgerm}`), but with a cap on maximum +germination rate :math:`\beta_{sgerm}`, to prevent excessive dominance +of one plant functional type over the seed pool. + +.. math:: Seed_{germ,ft} = \textrm{max}(Seeds_{FT}\cdot \alpha_{sgerm},\beta_{sgerm}) + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for seed model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`K_s` | Maximum seed | kgC m\ | | +| | mass | :math:`^{-2}` | | +| | | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\alpha_{ | Proportional | - | | +| sgerm}` | germination | | | +| | rate | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\beta_{s | Maximum | KgC | | +| germ}` | germination | m\ :math:`^{-2}`| | +| | rate | | | +| | | y\ :math:`^{-1}`| | +| | | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\phi` | Decay rate of | none | FT | +| | viable seeds | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`R_{frac, | Fraction of | none | FT | +| ft}` | :math:`C_{bal}` | | | +| | devoted to | | | +| | reproduction | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Fragmenting Litter Pool Production and Turnover +=============================================== + +| The original CLM4.5 model contains streams of carbon pertaining to + different chemical properties of litter (lignin, cellulose and labile + streams, specifically). In the CLM(ED) model, the fire simulation + scheme in the SPITFIRE model requires that the model tracks the pools + of litter pools that differ with respect to their propensity to burn + (surface area-volume ratio, bulk density etc.). Therefore, this model + contains more complexity in the representation of coarse woody debris. + We also introduce the concept of ’fragmenting’ pools, which are pools + that can be burned, but are not available for decomposition or + respiration. In this way, we can both maintain above-ground pools that + affect the rate of burning, and the lag between tree mortality and + availability of woody material for decomposition. +| The CLM(ED) recognizes four classes of litter. Above- and below-ground + coarse woody debris (:math:`CWD_{AG}`, :math:`CWD_{BG}`) and leaf + litter (:math:`l_{leaf}` and fine root litter :math:`l_{root}`). All + pools are represented per patch, and with units of kGC + m\ :math:`{^-2}`. Further to this, :math:`CWD_{AG}`, :math:`CWD_{BG}` + are split into four litter size classes (:math:`lsc`) for the purposes + of proscribing this to the SPITFIRE fire model (seed ’Fuel Load’ + section for more detail. 1-hour (twigs), 10-hour (small branches), + 100-hour (large branches) and 1000-hour(boles or trunks). 4.5 %, 7.5%, + 21 % and 67% of the woody biomass (:math:`b_{store,coh} + b_{sw,coh}`) + is partitioned into each class, respectively. + +:math:`l_{leaf}` and :math:`l_{root}` are indexed by plant functional +type (:math:`ft`). The rational for indexing leaf and fine root by PFT +is that leaf and fine root matter typically vary in their +carbon:nitrogen ratio, whereas woody pools typically do not. + +Rates of change of litter, all in kGC m\ :math:`{^-2}` +year\ :math:`^{-1}`, are calculated as + +.. math:: \frac{\delta CWD_{AG,out,lsc}}{ \delta t }= CWD_{AG,in,lsc} - CWD_{AG,out,lsc} + +.. math:: \frac{\delta CWD_{BG,out,lsc}}{ \delta t } = CWD_{BG,in,lsc} - CWD_{BG,in,lsc} + +.. math:: \frac{\delta l_{leaf,out,ft} }{ \delta t } = l_{leaf,in,ft} - l_{leaf,out,ft} + +.. math:: \frac{\delta l_{root,out,ft} }{ \delta t } = l_{root,in,ft} - l_{root,out,ft} + +Litter Inputs +------------- + +[21]_Inputs into the litter pools come from tissue turnover, mortality of +canopy trees, mortality of understorey trees, mortality of seeds, and +leaf senescence of deciduous plants. + +.. math:: l_{leaf,in,ft} =\Big(\sum_{i=1}^{n_{coh,ft}} n_{coh}(l_{md,coh} + l_{leaf,coh}) + M_{t,coh}.b_{leaf,coh}\Big)/\sum_{p=1}^{n_{pat}}A_{patch} + +where :math:`l_{md,coh}` is the leaf turnover rate for evergreen trees +and :math:`l_{leaf,coh}` is the leaf loss from phenology in that +timestep (KgC :math:`m^{-2}`. :math:`M_{t,coh}` is the total mortality +flux in that timestep (in individuals). For fine root input. +:math:`n_{coh,ft}` is the number of cohorts of functional type +‘:math:`FT`’ in the current patch. + +.. math:: l_{root,in,ft} =\Big(\sum_{i=1}^{n_{coh,ft}} n_{coh}(r_{md,coh} ) + M_{t,coh}.b_{root,coh}\Big)/\sum_{p=1}^{n_{pat}}A_p + +where :math:`r_{md,coh}` is the root turnover rate. For coarse woody +debris input (:math:`\mathit{CWD}_{AG,in,lsc}` , we first calculate the +sum of the mortality :math:`M_{t,coh}.(b_{struc,coh}+b_{sw,coh})` and +turnover :math:`n_{coh}(w_{md,coh}`) fluxes, then separate these into +size classes and above/below ground fractions using the fixed fractions +assigned to each (:math:`f_{lsc}` and :math:`f_{ag}`) + +.. math:: \mathit{CWD}_{AG,in,lsc} =\Big(f_{lsc}.f_{ag}\sum_{i=1}^{n_{coh,ft}}n_{coh}w_{md,coh} + M_{t,coh}.(b_{struc,coh}+b_{sw,coh})\Big)/\sum_{p=1}^{n_{pat}}A_p + +.. math:: \mathit{CWD}_{BG,in,lsc} =\Big(f_{lsc}.(1-f_{ag})\sum_{i=1}^{n_{coh,ft}}n_{coh}w_{md,coh} + M_{t,coh}.(b_{struc,coh}+b_{sw,coh})\Big)/\sum_{p=1}^{n_{pat}}A_p + +Litter Outputs +-------------- + + [22]_ + +The fragmenting litter pool is available for burning but not for +respiration or decomposition. Fragmentation rates are calculated +according to a maximum fragmentation rate (:math:`\alpha_{cwd,lsc}` or +:math:`\alpha_{litter}`) which is ameliorated by a temperature and water +dependent scalar :math:`S_{tw}`. The form of the temperature scalar is +taken from the existing CLM4.5BGC decomposition cascade calculations). +The water scaler is equal to the water limitation on photosynthesis +(since the CLM4.5BGC water scaler pertains to the water potential of +individual soil layers, which it is difficult to meaningfully average, +given the non-linearities in the impact of soil moisture). The scaler +code is modular, and new functions may be implemented trivially. Rate +constants for the decay of the litter pools are extremely uncertain in +literature, as few studies either separate litter into size classes, nor +examine its decomposition under non-limiting moisture and temperature +conditions. Thus, these parameters should be considered as part of +sensitivity analyses of the model outputs. + +.. math:: \mathit{CWD}_{AG,out,lsc} = CWD_{AG,lsc}. \alpha_{cwd,lsc}.S_{tw} + +.. math:: \mathit{CWD}_{BG,out,lsc} = CWD_{BG,lsc} .\alpha_{cwd,lsc}.S_{tw} + +.. math:: l_{leaf,out,ft} = l_{leaf,ft}.\alpha_{litter}.S_{tw} + +.. math:: l_{root,out,ft} = l_{root,ft}.\alpha_{root,ft}.S_{tw} + +Flux into decompsition cascade +------------------------------ + + [23]_ + +Upon fragmentation and release from the litter pool, carbon is +transferred into the labile, lignin and cellulose decomposition pools. +These pools are vertically resolved in the biogeochemistry model. The +movement of carbon into each vertical layer is obviously different for +above- and below-ground fragmenting pools. For each layer :math:`z` and +chemical litter type :math:`i`, we derive a flux from ED into the +decomposition cascade as :math:`ED_{lit,i,z}` (kGC m\ :math:`^{-2}` +s\ :math:`^{-1}`) + +where :math:`t_c` is the time conversion factor from years to seconds, +:math:`f_{lab,l}`, :math:`f_{cel,l}` and :math:`f_{lig,l}` are the +fractions of labile, cellulose and lignin in leaf litter, and +:math:`f_{lab,r}`, :math:`f_{cel,r}` and :math:`f_{lig,r}` are their +counterparts for root matter. Similarly, :math:`l_{prof}`, +:math:`r_{f,prof}`\ and :math:`r_{c,prof}` are the fractions of leaf, +coarse root and fine root matter that are passed into each vertical soil +layer :math:`z`, derived from the CLM(BGC) model. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for litter model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`\alpha_{ | Maximum | y\ :math:`^{-1}`| | +| cwd,lsc}` | fragmentation | | | +| | rate of CWD | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\alpha_{ | Maximum | y\ :math:`^{-1}`| | +| litter}` | fragmentation | | | +| | rate of leaf | | | +| | litter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\alpha_{ | Maximum | y\ :math:`^{-1}`| | +| root}` | fragmentation | | | +| | rate of fine | | | +| | root litter | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{lab,l | Fraction of | none | | +| }` | leaf mass in | | | +| | labile carbon | | | +| | pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{cel,l | Fraction of | none | | +| }` | leaf mass in | | | +| | cellulose | | | +| | carbon pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{lig,l | Fraction of | none | | +| }` | leaf mass in | | | +| | lignin carbon | | | +| | pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{lab,r | Fraction of | none | | +| }` | root mass in | | | +| | labile carbon | | | +| | pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{cel,r | Fraction of | none | | +| }` | root mass in | | | +| | cellulose | | | +| | carbon pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{lig,r | Fraction of | none | | +| }` | root mass in | | | +| | lignin carbon | | | +| | pool | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`l_{prof, | Fraction of | none | soil layer | +| z}` | leaf matter | | | +| | directed to | | | +| | soil layer z | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`r_{c,pro | Fraction of | none | soil layer | +| f,z}` | coarse root | | | +| | matter directed | | | +| | to soil layer z | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`r_{f,pro | Fraction of | none | soil layer | +| f,z}` | fine root | | | +| | matter directed | | | +| | to soil layer z | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +Plant Mortality +=============== + +Total plant mortality per cohort :math:`M_{t,coh}`, (fraction +year\ :math:`^{-1}`) is simulated as the sum of four additive terms, + +.. math:: M_{t,coh}= M_{b,coh} + M_{cs,coh} + M_{hf,coh} + M_{f,coh}, + +where :math:`M_b` is the background mortality that is unaccounted by +any of the other mortality rates and is fixed at 0.014. :math:`M_{cs}` +is the carbon starvation derived mortality, which is a function of the +non-structural carbon storage term :math:`b_{store,coh}` and the +PFT-specific ‘target’ carbon storage, :math:`l_{targ,ft}`, as follows: + +.. math:: M_{cs,coh}= \rm{max} \left(0.0, S_{m,ft} \left(0.5 - \frac{b_{store,coh}}{l_{targ,ft}b_{leaf}}\right)\right) + +where :math:`S_{m,ft}` is the ‘stress mortality’ parameter, or the +fraction of trees in a landscape that die when the mean condition of a +given cohort triggers mortality. This parameter is needed to scale from +individual-level mortality simulation to grid-cell average conditions. + +Mechanistic simulation of hydraulic failure is not undertaken on account +of it’s mechanistic complexity (see :raw-latex:`\cite{mcdowell2013}`for +details). Instead, we use a proxy for hydraulic failure induced +mortality (:math:`M_{hf,coh}`) that uses a water potential threshold +beyond mortality is triggered, such that the tolerance of low water +potentials is a function of plant functional type (as expressed via the +:math:`\psi_c` parameter). For each day that the aggregate water +potential falls below a threshold value, a set fraction of the trees are +killed. The aggregation of soil moisture potential across the root zone +is expressed using the :math:`\beta` function. We thus determine plant +mortality caused by extremely low water potentials as + +.. math:: + + M_{hf,coh} = \left\{ \begin{array}{ll} + S_{m,ft}& \textrm{for } \beta_{ft} < 10^{-6}\\ + &\\ + 0.0& \textrm{for } \beta_{ft}>= 10^{-6}.\\ + \end{array} \right. + +The threshold value of 10\ :math:`^{-6}` represents a state where the +average soil moisture potential is within 10\ :math:`^{-6}` of the +wilting point (a PFT specific parameter :math:`\theta_{w,ft}`). + +:math:`M_{hf,coh}` is the fire-induced mortality, as described in the +fire modelling section. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for mortality model. } + ++---------------------+--------------------------------+-------+------------+ +| Parameter Symbol | Parameter Name | Units | indexed by | ++=====================+================================+=======+============+ +| :math:`S_{m,ft}` | Stress Mortality Scaler | none | | ++---------------------+--------------------------------+-------+------------+ +| :math:`l_{targ,ft}` | Target carbon storage fraction | none | ft | ++---------------------+--------------------------------+-------+------------+ + +.. raw:: latex + + \bigskip + +Fire +==== + + [24]_ + +The influence of fire on vegetation is estimated using the SPITFIRE +model, which has been modified for use in ED following it’s original +implementation in the LPJ-SPITFIRE model +(:raw-latex:`\parencite{thonicke2010,pfeiffer2013}`. This model as +described is substantially different from the existing CLM4.5 fire model +:raw-latex:`\parencite{li2012}`, however, further developments are +intended to increase the merging of SPITFIRE’s natural vegetation fire +scheme with the fire suppression, forest-clearing and peat fire +estimations in the existing model. The coupling to the ED model allows +fires to interact with vegetation in a ‘size-structured’ manner, so +small fires can burn only understorey vegetation. Also, the patch +structure and representation of succession in the ED model allows the +model to track the impacts of fire on different forest stands, therefore +removing the problem of area-averaging implicit in area-based DGVMs. The +SPITFIRE approach has also been coupled to the LPJ-GUESS +individual-based model (Forrest et al. in prep) and so this is not the +only implementation of this type of scheme in existence. + +The SPITFIRE model operates at a daily timestep and at the patch level, +meaning that different litter pools and vegetation charecteristics of +open and closed forests can be represented effectively (we omit the +‘patch’ subscript throughout for simplicity). + +Properties of fuel load +----------------------- + +Many fire processes are impacted by the properties of the litter pool in +the SPITFIRE model. There are one live (live grasses) and five dead fuel +categories (dead leaf litter and four pools of coarse woody debris). +Coarse woody debris is classified into 1h, 10h, 100h, and 1000h fuels, +defined by “\ *the order of magnitude of time required for fuel to lose +(or gain) 63% of the difference between its current moisture content and +the equilibrium moisture content under defined atmospheric conditions.*" +:raw-latex:`\parencite{thonicke2010}`. For the purposes of describing +the behaviour of fire, we introduce a new index ‘fuel class’ *fc*, the +values of which correspond to each of the six possible fuel categories +as follows. + ++------------+------------------+-------------+ +| *fc* index | Fuel type | Drying Time | ++============+==================+=============+ +| 1 | dead grass | n/a | ++------------+------------------+-------------+ +| 2 | twigs | 1h fuels | ++------------+------------------+-------------+ +| 3 | small branches | 10h fuel | ++------------+------------------+-------------+ +| 4 | large branches | 100h fuel | ++------------+------------------+-------------+ +| 5 | stems and trunks | 1000h fuel | ++------------+------------------+-------------+ +| 6 | live grasses | n/a | ++------------+------------------+-------------+ + +.. raw:: latex + + \bigskip + +Fuel load +~~~~~~~~~ + +Total fuel load :math:`F_{tot,patch}` for a given patch is the sum of +the above ground coarse woody debris and the leaf litter, plus the alive +grass leaf biomass :math:`b_{l,grass}` multiplied by the non-mineral +fraction (1-:math:`M_{f}`). + +.. math:: F_{tot,patch}=\left(\sum_{fc=1}^{fc=5} CWD_{AG,fc}+l_{litter}+b_{l,grass}\right)(1-M_{f}) + +Many of the model behaviours are affected by the patch-level weighted +average properties of the fuel load. Typically, these are calculated in +the absence of 1000-h fuels because these do not contribute greatly to +fire spread properties. + +Nesterov Index +~~~~~~~~~~~~~~ + +Dead fuel moisture (:math:`\emph{moist}_{df,fc}`), and several other +properties of fire behaviour, are a function of the ‘Nesterov Index’ +(:math:`N_{I}`) which is an accumulation over time of a function of +temperature and humidity (Eqn 5, :raw-latex:`\cite{thonicke2010}`). + +.. math:: N_{I}=\sum{\textrm{max}(T_{d}(T_{d}-D),0)} + +where :math:`T_{d}` is the daily mean temperature in :math:`^{o}`\ C and +:math:`D` is the dew point calculated as . + +.. math:: + + \begin{aligned} + \upsilon&=&\frac{17.27T_{d}}{237.70+T_{d}}+\log(RH/100)\\ + D&=&\frac{237.70\upsilon}{17.27-\upsilon}\end{aligned} + +where :math:`RH` is the relative humidity (%). + +Dead Fuel Moisture Content +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Dead fuel moisture is calculated as + +.. math:: \emph{moist}_{df,fc}=e^{-\alpha_{fmc,fc}N_{I}} + +where :math:`\alpha_{fmc,fc}` is a parameter defining how fuel moisture +content varies between the first four dead fuel classes. + +Live grass moisture Content +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The live grass fractional moisture content(\ :math:`\emph{moist}_{lg}`) +is a function of the soil moisture content. (Equation B2 in +:raw-latex:`\cite{thonicke2010}`) + +.. math:: \emph{moist}_{lg}=\textrm{max}(0.0,\frac{10}{9}\theta_{30}-\frac{1}{9}) + +where :math:`\theta_{30}` is the fractional moisture content of the top +30cm of soil. + +Patch Fuel Moisture +~~~~~~~~~~~~~~~~~~~ + +The total patch fuel moisture is based on the weighted average of the +different moisture contents associated with each of the different live +grass and dead fuel types available (except 1000-h fuels). + +.. math:: F_{m,patch}=\sum_{fc=1}^{fc=4} \frac{F_{fc}}{F_{tot}}\emph{moist}_{df,fc}+\frac{b_{l,grass}}{F_{tot}}\emph{moist}_{lg} + +Effective Fuel Moisture Content +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Effective Fuel Moisture Content is used for calculations of fuel +consumed, and is a function of the ratio of dead fuel moisture content +:math:`M_{df,fc}` and the moisture of extinction factor, +:math:`m_{ef,fc}` + +.. math:: E_{moist,fc}=\frac{\emph{moist}_{fc}}{m_{ef,fc}} + +where the :math:`m_{ef}` is a function of surface-area to volume ratio. + +.. math:: m_{ef,fc}=0.524-0.066\log_{10}{\sigma_{fc}} + +Patch Fuel Moisture of Extinction +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The patch ‘moisture of extinction’ factor (:math:`F_{mef}`) is the +weighted average of the :math:`m_{ef}` of the different fuel classes + +.. math:: F_{mef,patch}=\sum_{fc=1}^{fc=5} \frac{F_{fc}}{F_{tot}}m_{ef,fc}+\frac{b_{l,grass}}{F_{tot}}m_{ef,grass} + +Patch Fuel Bulk Density +~~~~~~~~~~~~~~~~~~~~~~~ + +The patch fuel bulk density is the weighted average of the bulk density +of the different fuel classes (except 1000-h fuels). + +.. math:: F_{bd,patch}=\sum_{fc=1}^{fc=4} \frac{F_{fc}}{F_{tot}}\beta_{fuel,fc}+\frac{b_{l,grass}}{F_{tot}}\beta_{fuel,lgrass} + +where :math:`\beta_{fuel,fc}` is the bulk density of each fuel size +class (kG m\ :math:`^{-3}`) + +Patch Fuel Surface Area to Volume +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The patch surface area to volume ratio (:math:`F_{\sigma}`) is the +weighted average of the surface area to volume ratios +(:math:`\sigma_{fuel}`) of the different fuel classes (except 1000-h +fuels). + +.. math:: F_{\sigma}=\sum_{fc=1}^{fc=4} \frac{F_{fc}}{F_{tot}}\sigma_{fuel,fc}+\frac{b_{l,grass}}{F_{tot}}\sigma_{fuel,grass} + +Forward rate of spread +---------------------- + +For each patch and each day, we calculate the rate of forward spread of +the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). + +.. math:: \emph{ros}_{f}=\frac{i_{r}x_{i}(1-\phi_{w})}{F_{bd,patch}e_{ps}q_{ig}} + +:math:`e_{ps}` is the effective heating number +(:math:`e^{\frac{-4.528}{F_{\sigma,patch}}}`). :math:`q_{ig}` is the +heat of pre-ignition (:math:`581+2594F_{m}`). :math:`x_{i}` is the +propagating flux calculated as (see :raw-latex:`\cite{thonicke2010}` +Appendix A). + +.. math:: + + x_{i}= \left\{ \begin{array}{ll} + 0.0& \textrm{for $F_{\sigma,patch}<0.00001$}\\ + \frac{e^{0.792+3.7597F_{\sigma,patch}^{0.5}(\frac{F_{bd,patch}}{p_{d}}+0.1)}}{192+7.9095F_{\sigma,patch}} & \textrm{for $F_{\sigma,patch}\geq 0.00001$}\\ + \end{array} \right. + +:math:`\phi_{w}` is the influence of windspeed on rate of spread. + +.. math:: \phi_{w}=cb_{w}^{b}.\beta^{-e} + +Where :math:`b`, :math:`c` and :math:`e` are all functions of +surface-area-volume ratio :math:`F_{\sigma,patch}`: +:math:`b=0.15988F_{\sigma,patch}^{0.54}`, +:math:`c=7.47e^{-0.8711F_{\sigma,patch}^{0.55}}`, +:math:`e=0.715e^{-0.01094F_{\sigma,patch}}`. :math:`b_{w}=196.86W` where +:math:`W` is the the windspeed in ms\ :math:`^{-1}`, and +:math:`\beta=\frac{F_{bd}/p_{d}}{0.200395F_{\sigma,patch}^{-0.8189}}` +where :math:`p_{d}` is the particle density (513). + +:math:`i_{r}` is the reaction intensity, calculated using the following +set of expressions (from :raw-latex:`\cite{thonicke2010}` Appendix A).: + +.. math:: + + \begin{aligned} + i_{r}&=&\Gamma_{opt}F_{tot}Hd_{moist}d_{miner}\\ + d_{moist}&=&\textrm{max}\Big(0.0,(1-2.59m_{w}+5.11m_{w}^{2}-3.52m_{w}^{3})\Big)\\ + m_{w}&=&\frac{F_{m,patch}}{F_{mef,patch}}\\ + \Gamma _{opt}&=&\Gamma_{max}\beta^{a}\lambda\\ + \Gamma _{max}&=&\frac{1}{0.0591+2.926F_{\sigma,patch}^{-1.5}}\\ + \lambda&=&e^{a(1-\beta)}\\ + a&=&8.9033F_{\sigma,patch}^{-0.7913}\end{aligned} + +:math:`\Gamma_{opt}` is the residence time of the fire, and +:math:`d_{miner}` is the mineral damping coefficient +(=0.174:math:`S_e^{-0.19}` , where :math:`S_e` is 0.01 and so = +:math:`d_{miner}` 0.41739). + +Fuel Consumption +---------------- + +The fuel consumption (fraction of biomass pools) of each dead biomass +pool in the area affected by fire on a given day (:math:`f_{c,dead,fc}`) +is a function of effective fuel moisture :math:`E_{moist,fc}` and size +class *fc* (Eqn B1, B4 and B5, :raw-latex:`\cite{thonicke2010}`). The +fraction of each fuel class that is consumed decreases as its moisture +content relative to its moisture of extinction (:math:`E_{moist,fc}`) +increases. + +.. math:: f_{cdead,fc}=\textrm{max}\left(0,\textrm{min}(1,m_{int,mc,fc}-m_{slope,mc,fc}E_{moist,fc})\Big)\right. + +:math:`m_{int}` and :math:`m_{slope}` are parameters, the value of which +is modulated by both size class :math:`fc` and by the effective fuel +moisture class :math:`mc`, defined by :math:`E_{moist,fc}`. +:math:`m_{int}` and :math:`m_{slope}` are defined for low-, mid-, and +high-moisture conditions, the boundaries of which are also functions of +the litter size class following :raw-latex:`\cite{peterson1986}` (page +802). The fuel burned, :math:`f_{cground,fc}` (Kg m\ :math:`^{-2}` +day\ :math:`^{-1}`) iscalculated from :math:`f_{cdead,fc}` for each fuel +class: + +.. math:: f_{cground,fc}=f_{c,dead,fc}(1-M_{f})\frac{F_{fc}}{0.45} + +Where 0.45 converts from carbon to biomass. The total fuel consumption, +:math:`f_{ctot,patch}`\ (Kg m\ :math:`^{-2}`), used to calculate fire +intensity, is then given by + +.. math:: f_{ctot,patch}=\sum_{fc=1}^{fc=4} f_{c,ground,fc} + f_{c,ground,lgrass} + +There is no contribution from the 1000 hour fuels to the patch-level +:math:`f_{ctot,patch}` used in the fire intensity calculation. + +Fire Intensity +-------------- + +Fire intensity at the front of the burning area (:math:`I_{surface}`, kW +m\ :math:`^{-2}`) is a function of the total fuel consumed +(:math:`f_{ctot,patch}`) and the rate of spread at the front of the +fire, :math:`\mathit{ros}_{f}` (m min\ :math:`^{-1}`) (Eqn 15 +:raw-latex:`\cite{thonicke2010}`) + +.. math:: I_{surface}=\frac{0.001}{60}f_{energy} f_{ctot,patch}\mathit{ros}_{f} + +where :math:`f_{energy}` is the energy content of fuel (kJ/kG - the +same for alll fuel classes). Fire intensity is used to define whether an +ignition is successful. If the fire intensity is greater than 50kw/m +then the ignition is successful. + +Fire Duration +------------- + +Fire duration is a function of the fire danger index with a maximum +length of :math:`F_{dur,max}` (240 minutes in +:raw-latex:`\cite{thonicke2010}` Eqn 14, derived from Canadian Forest +Fire Behaviour Predictions Systems) + +.. math:: D_{f}=\textrm{min}\Big(F_{dur,max},\frac{F_{dur,max}}{1+F_{dur,max}e^{-11.06fdi}}\Big) + +Fire Danger Index +----------------- + +Fire danger index (*fdi*) is a representation of the effect of +meteorological conditions on the likelihood of a fire. It is calculated +for each gridcell as a function of the Nesterov Index . +:math:`\emph{fdi}` is calculated from :math:`NI` as + +.. math:: \emph{fdi}=1-e^{\alpha N_{I}} + +where :math:`\alpha` = 0.00037 following +:raw-latex:`\cite{venevsky2002}`. + +Area Burned +----------- + +Total area burnt is assumed to be in the shape of an ellipse, whose +major axis :math:`f_{length}` (m) is determined by the forward and +backward rates of spread (:math:`ros_{f}` and :math:`ros_{b}` +respectively). + +.. math:: f_{length}=F_{d}(ros_{b}+ros_{f}) + +:math:`ros_{b}` is a function of :math:`ros_{f}` and windspeed (Eqn 10 +:raw-latex:`\cite{thonicke2010}`) + +.. math:: ros_{b}=ros_{f}e^{-0.72W} + +The minor axis to major axis ratio :math:`l_{b}` of the ellipse is +determined by the windspeed. If the windspeed (:math:`W`) is less than +16.67 ms\ :math:`^{-1}` then :math:`l_{b}=1`. Otherwise (Eqn 12 and 13, +:raw-latex:`\cite{thonicke2010}`) + +.. math:: l_{b}=\textrm{min}\Big(8,f_{tree}(1.0+8.729(1.0-e^{-0.108W})^{2.155})+(f_{grass}(1.1+3.6W^{0.0464}))\Big) + +:math:`f_{grass}` and :math:`f_{tree}` are the fractions of the patch +surface covered by grass and trees respectively. + +The total area burned (:math:`A_{burn}` in m\ :math:`^{2}`) is therefore +(Eqn 11, :raw-latex:`\cite{thonicke2010}`) + +.. math:: A_{burn}=\frac{n_{f}\frac{3.1416}{4l_{b}}(f_{length}^{2}))}{10000} + +where :math:`n_{f}` is the number of fires. + +Crown Damage +------------ + +:math:`c_{k}` is the fraction of the crown which is consumed by the +fire. This is calculated from scorch height :math:`H_{s}`, tree height +:math:`h` and the crown fraction parameter :math:`F_{crown}` (Eqn 17 +:raw-latex:`\cite{thonicke2010}`): + +.. math:: + + c_{k} = \left\{ \begin{array}{ll} + 0 & \textrm{for $H_{s}<(h-hF_{crown})$}\\ + 1-\frac{h-H_{s}}{h-F_{crown}}& \textrm{for $h>H_{s}>(h-hF_{crown})$}\\ + 1 & \textrm{for $H_{s}>h$ } + \end{array} \right. + +The scorch height :math:`H_{s}` (m) is a function of the fire intensity, +following :raw-latex:`\cite{byram1959}`, and is proportional to a plant +functional type specific parameter :math:`\alpha_{s,ft}` (Eqn 16 +:raw-latex:`\cite{thonicke2010}`): + +.. math:: H_{s}=\sum_{FT=1}^{NPFT}{\alpha_{s,p}\cdot f_{biomass,ft}} I_{surface}^{0.667} + +where :math:`f_{biomass,ft}` is the fraction of the above-ground +biomass in each plant functional type. + +Cambial Damage and Kill +----------------------- + +The cambial kill is a function of the fuel consumed :math:`f_{c,tot}`, +the bark thickness :math:`t_{b}`, and :math:`\tau_{l}`, the duration of +cambial heating (minutes) (Eqn 8, :raw-latex:`\cite{peterson1986}`): + +.. math:: \tau_{l}=\sum_{fc=1}^{fc=5}39.4F_{p,c}\frac{10000}{0.45}(1-(1-f_{c,dead,fc})^{0.5}) + +Bark thickness is a linear function of tree diameter :math:`dbh_{coh}`, +defined by PFT-specific parameters :math:`\beta_{1,bt}` and +:math:`\beta_{2,bt}` (Eqn 21 :raw-latex:`\cite{thonicke2010}`): + +.. math:: t_{b,coh}=\beta_{1,bt,ft}+\beta_{2,bt,ft}dbh_{coh} + +The critical time for cambial kill, :math:`\tau_{c}` (minutes) is given +as (Eqn 20 :raw-latex:`\cite{thonicke2010}`): + +.. math:: \tau_{c}=2.9t_{b}^{2} + +The mortality rate caused by cambial heating :math:`\tau_{pm}` of trees +within the area affected by fire is a function of the ratio between +:math:`\tau_{l}` and :math:`\tau_{c}` (Eqn 19, +:raw-latex:`\cite{thonicke2010}`): + +.. math:: + + \tau_{pm} = \left\{ \begin{array}{ll} + 1.0 & \textrm{for } \tau_{1}/\tau_{c}\geq \textrm{2.0}\\ + 0.563(\tau_{l}/\tau_{c}))-0.125 & \textrm{for } \textrm{2.0} > \tau_{1}/\tau_{c}\ge \textrm{0.22}\\ + 0.0 & \textrm{for } \tau_{1}/\tau_{c}< \textrm{0.22}\\ + \end{array} \right. + +.. raw:: latex + + \bigskip + +.. raw:: latex + + \captionof{table}{Parameters needed for fire model. } + ++-----------------+-----------------+-----------------+-----------------+ +| Parameter | Parameter Name | Units | indexed by | +| Symbol | | | | ++=================+=================+=================+=================+ +| :math:`\beta_{1 | Intercept of | mm | *FT* | +| ,bt}` | bark thickness | | | +| | function | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\beta_{2 | Slope of bark | mm | *FT* | +| ,bt}` | thickness | cm\ :math:`^{-1 | | +| | function | }` | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`F_{crown | Ratio of crown | none | *FT* | +| }` | height to total | | | +| | height | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\alpha_{ | Fuel moisture | :math:`{^o}`\ C | *fc* | +| fmc}` | parameter | \ :math:`^{-2}` | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\beta_{f | Fuel Bulk | kG | *fc* | +| uel}` | Density | m\ :math:`^{-3}`| | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\sigma_{ | Surface area to | cm | *fc* | +| fuel,fc}` | volume ratio | :math:`^{-1}` | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`m_{int}` | Intercept of | none | :math:`fc`, | +| | fuel burned | | moisture class | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`m_{slope | Slope of fuel | none | :math:`fc`, | +| }` | burned | | moisture class | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`M_f` | Fuel Mineral | | | +| | Fraction | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`F_{dur,m | Maximum | Minutes | | +| ax}` | Duration of | | | +| | Fire | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`f_{energ | Energy content | kJ/kG | | +| y}` | of fuel | | | ++-----------------+-----------------+-----------------+-----------------+ +| :math:`\alpha_{ | Flame height | | *FT* | +| s}` | parameter | | | ++-----------------+-----------------+-----------------+-----------------+ + +.. raw:: latex + + \bigskip + +| + +.. raw:: latex + + \printbibliography + +.. [1] + This description covers algorithms in the ‘fuse_cohorts’ subroutine. + +.. [2] + This description covers algorithms in the ‘fuse_patches’ subroutine. + +.. [3] + This description covers algorithms in the ‘fuse_2_patches’ + subroutine. + +.. [4] + This description covers the structure of code in all modules in + clm4_5 that are located in ‘ED’ subdirectories + +.. [5] + This description covers algorithms in the ‘init_cohorts’ subroutine + +.. [6] + This description relates to algorithms in the allocate_live_biomass + subroutine + +.. [7] + This description relates to algorithms in the EDCanopyStructure + subroutine + +.. [8] + This description relates to algorithms in the canopy_spread + subroutine + +.. [9] + This description relates to algorithms in the + canopy_leaf_area_profile subroutine + +.. [10] + This description relates to algorithms in the ED_norman_radiation + subroutine + +.. [11] + This description relates to algorithms in the ED_photosynthesis + subroutine + +.. [12] + This description relates to algorithms in the ED_btran subroutine + +.. [13] + This description relates to algorithms in the ED_photosynthesis + subroutine + +.. [14] + This description relates to algorithms in the ED_photosynthesis + subroutine + +.. [15] + This description relates to algorithms in the Growth_Derivatives + subroutine + +.. [16] + This description relates to algorithms in the ED_GrowthFunctions + subroutine + +.. [17] + This description relates to algorithms in the trim_canopy subroutine + +.. [18] + This description relates to algorithms in the phenology subroutine + +.. [19] + This description relates to algorithms in the phenology_leafoff + subroutine + +.. [20] + This description relates to algorithms in the seed_in, seed_decay and + seed_germination subroutines + +.. [21] + This description relates to algorithms in the CWD_input, + mortality_litter_fluxes and fire_litter_fluxes subroutines + +.. [22] + This description relates to algorithms in the CWD_out subroutine + +.. [23] + This description relates to algorithms in the flux_into_litter_pools + subroutine +.. [24] + This description relates to algorithms in the ’SFMainMod’ subroutines From 3f5bfd8a5aef75763075d85af2ca02f29d2ca691 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Thu, 7 Dec 2017 11:21:40 -0700 Subject: [PATCH 115/730] modified author section of FATES tech note --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 72001f2827..beb93f3ac0 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -1,7 +1,3 @@ -====================================== -CLM(ED) model: Technical Documentation -====================================== - .. _rst_Dynamic Global Vegetation Model: Dynamic Global Vegetation @@ -30,17 +26,6 @@ Preamble Apr 1;8(4). | https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf -Authors -======= - -Rosie Fisher, Stefan Muszala, Mariana Verteinstein, Peter Lawrence, Chonggang Xu,Nate McDowell, Ryan Knox, Charles Koven, Jennifer Holm, Brendan Rogers, David Lawrence, and Gordon Bonan. - -Acknowledgements -================ - -The development of the ideas in this document has benefitted from -conversation with many people, including William Bond, Peter Cox, Matthew Forest, Andrew Fox, William Hoffman, Peter Lawrence, Jeremy Lichstein, Heike Lischke, Mark Lomas, Nathan McDowell, Paul Moorcroft, Colin Prentice, Drew Purves, Naomi Tague, Benjamin Sanderson, Stephen Sitch, Abigail Swann, Anthony Walker, Mathew Williams, F.Ian Woodward \& S\"onke Zaehle. - Introduction ============ From 23a4006ea26fd41c155cf14ff663df443deeff9e Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Thu, 7 Dec 2017 14:14:49 -0700 Subject: [PATCH 116/730] altered headings on FATES chapter --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 277 ++++++++---------- 1 file changed, 120 insertions(+), 157 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index beb93f3ac0..c6f0558b6b 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -4,7 +4,7 @@ Dynamic Global Vegetation =================================== What has changed ----------------- +^^^^^^^^^^^^^^^^^^^^ - Deprecation of the dynamic global vegetation model (DGVM): The CLM5.0 model contains the legancy 'CNDV' code, which runs the CLM4(CN) model in combination with the LPJ-derived dynamics vegetation model introduced in CLM3. While this capacity has not technically been removed from the model, the DGVM has not been tested in the development of CLM5 and is no longer scientifically supported. @@ -12,25 +12,22 @@ What has changed Technical Documentation for FATES -================================== +=================================== -Preamble -======== +Introduction +^^^^^^^^^^^^^^^^^^^^ -| This document is a technical appendix to -| Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, + This document is a technical appendix to + Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, Knox RG, Koven C, Holm J, Rogers BM, Lawrence D. Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes. Geoscientific Model Development Discussions. 2015 Apr 1;8(4). -| https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf + https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf -Introduction -============ - -The CLM(ED) model is presented here as an option within the structure of +FATES is presented here as an option within the structure of the Community Land Model (CLM). Ecosystem Demography (‘ED’), is a concept derived from the work of :raw-latex:`\cite{mc_2001}` and is a cohort model of vegetation competition and co-existence, allowing a @@ -53,14 +50,11 @@ radiation transfer, for drought-deciduous and cold-deciduous phenology, for carbon storage allocation, and for tree mortality under carbon stress, are also included and presented here. -This Document -------------- +This Document UPDATE +---------------- This document describes the implementation of the Ecosystem Demography -concept within the Community Land Model. It is intended as a -supplementary document to the main CLM technical note, which is at the -time of writing, the CLM4.5 technical note -:raw-latex:`\parencite{oleson2013}`. The material covered describes how +concept within the Community Land Model. The material covered describes how the Ecosystem Demography code is organized, how it interacts with the pre-existing CLM routines, and the new aspects of plant physiology and vegetation dynamics that are introduced further to those already @@ -71,10 +65,10 @@ model, which is a fully operational land surface scheme concept and an array of physiological and ecological innovations surrounding the basic concept. Therefore, to avoid confusion between the concept of ‘Ecosystem Demography’ and the implementation of this concept -in different models, we refer our model as the ‘CLM(ED)’ throughout. +in different models, we refer our model as the ‘FATES’ (the functionally Assembled Terrestrial Ecosystem Simulator) throughout. -The representation of ecosystem heterogeneity in the CLM(ED) -============================================================ +The representation of ecosystem heterogeneity in FATES +^^^^^^^^^^^^^^^ The land surface of the Earth is heterogeneous for many reasons, driven by variations in climate, edaphic history, ecological variability, @@ -88,7 +82,7 @@ surface (e.g. soils, ice, lakes, bare ground) and then ‘columns’ referring to elements of the surface that share below ground resources (water & nutrients). Within the ‘soil’ landunit, for example, there are separate columns for crops, and for natural vegetation, as these are -assumed to use separate resource pools. The CLM(ED) model at present +assumed to use separate resource pools. The FATES model at present only operates on the naturally vegetated column. The ‘soil’ column is sub-divided into numerous tiles, that correspond to statistical fractions of the potentially vegetated land area. In the CLM 4.5 (and @@ -101,7 +95,7 @@ surface models deployed in climate prediction. The introduction of the Ecosystem Demography concept introduces significant alterations to the representation of the land surface in the -CLM. In the CLM(ED), the tiling structure represents the disturbance +CLM. In FATES, the tiling structure represents the disturbance history of the ecosystem. Thus, some fraction of the land surface is characterized as ‘recently disturbed’, some fraction has escaped disturbance for a long time, and other areas will have intermediate @@ -205,7 +199,7 @@ classes within those plant functional types. Each cohort is associated with a number of identical trees, :math:`n_{coh}` (where :math:`{coh}` denotes the identification or index number for a given cohort).. -The complete hierarchy of elements in the CLM(ED) is therefore now +The complete hierarchy of elements in FATES is therefore now described as follows: .. math:: @@ -274,7 +268,7 @@ common-disturbance-history units is less clear. Several alternative criteria are possible, including Leaf Area Index, total biomass and total stem basal area. -In this implementation of the CLM(ED) we assess the amount of +In this implementation of FATES we assess the amount of above-ground biomass in each PFT/plant diameter bin. Biomass is first grouped into fixed diameter bins for each PFT (:math:`ft`) and a significant difference in any bin will cause patches to remain @@ -318,7 +312,7 @@ co-occupy patch :math:`o`. The state properties of :math:`m` and :math:`n` (litter, seed pools, etc. ) are also averaged in accordance with mass conservation . -Linked Lists: the general code structure of CLM(ED) +Linked Lists: the general code structure of FATES --------------------------------------------------- [4]_ The number of patches in each natural vegetation column and the @@ -337,7 +331,7 @@ potential number of cohorts for every potential patch, which would result in very large amounts of wasted allocated memory, on account of the heterogeneity in the number of cohorts between complex and simple ecosystems (n.b. this does still happen for some variables at restart -timesteps). To resolve this, the cohort structure in the CLM(ED) model +timesteps). To resolve this, the cohort structure in FATES model does not use an array system for internal calculations. Instead it uses a system of *linked lists* where each cohort structure is linked to the cohorts larger than and smaller than itself using a system of pointers. @@ -361,10 +355,10 @@ Using this structure, it is therefore possible to have an unbounded oldest: -Indices used in CLM(ED) +Indices used in FATES ----------------------- -Some of the indices used in the CLM(ED) are similar to those used in the +Some of the indices used in FATES are similar to those used in the standard CLM4.5 model; column (:math:`c`), land unit(\ :math:`l`), grid cell(\ :math:`g`) and soil layer (:math:`j`). On account of the additional complexity of the new representation of plant function, @@ -471,7 +465,7 @@ restarted. The state variables of a cohort are as follows: +-----------------+-----------------+-----------------+-----------------+ Patch State Variables ---------------------- +------------------ A patch, as discuss earlier, is a fraction of the landscape which contains ecosystems with similar structure and disturbance history. A @@ -544,7 +538,7 @@ attributed to each cohort are accumulated throughout each daily cycle and passed into the ED code as the major driver of vegetation dynamics. Initialization of vegetation from bare ground -============================================= +^^^^^^^^^^^^^^^^ [5]_If the model is restarted from a bare ground state (as opposed to a pre-existing vegetation state), the state variables above are @@ -614,8 +608,8 @@ biomass, assigned per PFT [table:init] -Allocation of live biomass to leaves roots and sapwood ------------------------------------------------------- +Allocation of biomass +^^^^^^^^^^^^^^^^^^^^ [6]_Total live biomass :math:`b_{alive}` is the state variable of the model that describes the sum of the three live biomass pools leaf @@ -724,11 +718,9 @@ To calculated the sapwood biomass, we use [table:allom] Canopy Structure and the Perfect Plasticity Approximation -========================================================= +^^^^^^^^^^^^^^^^ - [7]_ - -During initialization and every subsequent daily ED timestep, the canopy +[7]_During initialization and every subsequent daily ED timestep, the canopy structure model is called to determine how the leaf area of the different cohorts is arranged relative to the incoming radiation, which will then be used to drive the radiation and photosynthesis @@ -744,10 +736,7 @@ distribution emerges from competition The standard ED1.0 model makes a simple ’flat disk’ assumption, that the leaf area of each cohort is spread in an homogenous layer at one exact -height across entire the ground area represented by each patch. The -CLM(ED) model has diverged from this representation due to (at least) -two problematic emergent properties that we identified as generating -unrealistic behaviours espetially for large-area patches. +height across entire the ground area represented by each patch. FATES has diverged from this representation due to (at least) two problematic emergent properties that we identified as generating unrealistic behaviours espetially for large-area patches. 1. Over-estimation of light competition . The vertical stacking of cohorts which have all their leaf area at the same nominal height means @@ -785,7 +774,7 @@ canopies to grow into the available gaps (this is of course, an over-simplified but potential useful ecosystem property). The ‘perfect plasticity approximation’ (PPA) implies that the community of trees is subdivided into discrete canopy layers, and by extension, each cohort -represented by the CLM(ED) model is assigned a canopy layer status flag, +represented by FATES model is assigned a canopy layer status flag, :math:`C_L`. In this version, we set the maximum number of canopy layers at 2 for simplicity, although is possible to have a larger number of layers in theory. :math:`C_{L,coh}` = 1 means that all the trees of @@ -860,11 +849,9 @@ fractions of cohorts are demoted or promoted. Further details can be found in the code references in the footnote. Horizontal Canopy Spread ------------------------- - - [8]_ +----------------- -:raw-latex:`\cite{purves2008}` estimated the ratio between canopy and +[8]_:raw-latex:`\cite{purves2008}` estimated the ratio between canopy and stem diameter :math:`c_{p}` as  0.1 m cm\ :math:`^{-1}` for canopy trees in North American forests, but this estimate was made on trees in closed canopies, whose shape is subject to space competition from other @@ -922,12 +909,10 @@ This iterative scheme requires two additional parameters (:math:`i` and However, the model is relatively insensitive to the choice of either :math:`i` or :math:`A_{t}`. -Definition of Leaf Area Profile -------------------------------- - - [9]_ +Definition of Leaf and Stem Area Profile +------------------- -Within each patch, the model defines and tracks cohorts of multiple +[9]_Within each patch, the model defines and tracks cohorts of multiple plant functional types that exist either in the canopy or understorey. Light on the top leaf surface of each cohort in the canopy is the same, and the rate of decay through the canopy is also the same for each PFT. @@ -957,9 +942,6 @@ where :math:`\mathrm{sla}_{ft}` is the specific leaf area in m\ :math:`^{2}` KgC\ :math:`^{-1}` and :math:`b_{leaf}` is in kGC per plant. -Stem Area Index -~~~~~~~~~~~~~~~ - Stem area index (SAI) is ratio of the total area of all woody stems on a plant to the area of ground covered by the plant. During winter in deciduous areas, the extra absorption by woody stems can have a @@ -967,7 +949,7 @@ significant impact on the surface energy budget. However, in previous ‘big leaf’ versions of the CLM, computing the circumstances under which stem area was visible in the absence of leaves was difficult and the algorithm was largely heuristic as a result. Given the multi-layer -canopy introduced for CLM(ED), we can determine the leaves in the higher +canopy introduced for FATES, we can determine the leaves in the higher canopy layers will likely shade stem area in the lower layers when leaves are on, and therefore stem area index can be calculated as a function of woody biomass directly. @@ -1071,7 +1053,7 @@ leaf and stem area profiles, Burial of leaf area by snow -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-------------------- The calculations above all pertain to the total leaf and stem area indices which charecterize the vegetation structure. In addition, the @@ -1170,10 +1152,10 @@ described later. \bigskip Radiation Transfer -================== +^^^^^^^^^^^^^^^^^^^ Fundamental Radiation Transfer Theory -------------------------------------- +------------------ [10]_The first interaction of the land surface with the properties of vegetation concerns the partitioning of energy into that which is @@ -1199,7 +1181,7 @@ is based on the work of :raw-latex:`\cite{norman1979}`. Here we describe the basic theory of the radiation transfer model for the case of a single homogenous canopy, and in the next section we discuss how this is applied to the multi layer multi PFT canopy in the -CLM(ED) implementation. The code considers the fractions of a single +FATES implementation. The code considers the fractions of a single unit of incoming direct and a single unit of incoming diffuse light, that are absorbed at each layer of the canopy for a given solar angle (:math:`\alpha_{s}`, radians). Direct radiation is extinguished through @@ -1386,12 +1368,12 @@ fractions, (required by the photosynthesis calculations), is .. math:: abs_{sun,z} = abs_{dif,z} \cdot f_{sun}+ abs_{dir,z} -Resolution of radiation transfer theory within the CLM(ED) canopy structure ---------------------------------------------------------------------------- +Resolution of radiation transfer theory within the FATES canopy structure +------------------ The radiation transfer theory above, was described with reference to a single canopy of one plant functional type, for the sake of clarity of -explanation. The CLM(ED) model, however, calculates radiative and +explanation. The FATES model, however, calculates radiative and photosynthetic fluxes for a more complex hierarchical structure within each patch/time-since-disturbance class, as described in the leaf area profile section. Firstly, we denote two or more canopy layers (denoted @@ -1436,7 +1418,7 @@ transfer scheme are calculated with indices of :math:`C_L`, :math:`\it{ft}` and :math:`z`. In the following text, we revisit the simplified version of the radiation model described above, and explain how it is modified to account for the more complex canopy structure used -by the CLM(ED). +by FATES. Firstly, the light penetration functions, :math:`k_{dir}` and :math:`g_{dir}` are described as functions of :math:`\it{ft}`, because @@ -1561,18 +1543,16 @@ layer, functional type and pft for testing if necessary. \bigskip Photosynthesis -============== +^^^^^^^^^^^^^^^^^^^^ Fundamental photosynthetic physiology theory --------------------------------------------- +------------------ - [11]_ - -In this section we describe the physiological basis of the -photosynthesis model before describing its application to the CLM(ED) +[11]_In this section we describe the physiological basis of the +photosynthesis model before describing its application to the FATES canopy structure. This description in this section is largely repeated from the Oleson et al. CLM4.5 technical note but included here for -comparison with its implementation in CLM(ED). Photosynthesis in C3 +comparison with its implementation in FATES. Photosynthesis in C3 plants is based on the model of :raw-latex:`\cite{farquhar1980}` as modified by :raw-latex:`\cite{collatz1991}`. Photosynthetic assimilation in C4 plants is based on the model of :raw-latex:`\cite{collatz1992}`. @@ -1675,8 +1655,8 @@ where the term 0.21 represents the ratio of maximum rates of oxygenation to carboxylation, which is virtually constant with temperature :raw-latex:`\cite{farquhar1980}`. -Resolution of the photosynthesis theory within the CLM(ED) canopy structure. ----------------------------------------------------------------------------- +Resolution of the photosynthesis theory within the FATES canopy structure. +------------------ The photosynthesis scheme is modified from the CLM4.5 model to give estimates of photosynthesis, respiration and stomatal conductance for a @@ -1749,7 +1729,7 @@ s\ :math:`^{-1}`) is calculated in a similar fashion, \end{array} \right. Variation in plant physiology with canopy depth -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------ Both :math:`V_{c,max}` and :math:`J_{max}` vary with vertical depth in the canopy on account of the well-documented reduction in canopy @@ -1809,8 +1789,8 @@ canopy. They obtain the following term to predict :math:`K_{n}`, where :math:`V_{cmax}` is again in :math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`. -Water Stress Function -~~~~~~~~~~~~~~~~~~~~~ +Water Stress on gas exchange +------------------ [12]_ The top of canopy leaf photosynthetic capacity, :math:`V_{c,max0}`, is also adjusted for the availability of water to plants as @@ -1848,7 +1828,7 @@ on the calculation of soil matric potential, see the CLM4.5 technical note. Variation of water stress and water uptake within tiles -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~ The remaining drivers of the photosynthesis model remain constant (atmospheric CO\ :math:`_2` and O\ :math:`^2` and canopy temperature) @@ -1868,7 +1848,7 @@ parameter also necessitates recalculation of the vertical water extraction profiles. In the original model, the fraction of extraction from each layer (:math:`r_{e,j,patch}`) is the product of a single root distribution, because each patch only has one plant functional type. In -the CLM(ED), we need to calculate a new weighted patch effective rooting +FATES, we need to calculate a new weighted patch effective rooting depth profile :math:`r_{e,j,patch}` as the weighted average of the functional-type level stress functions and their relative contributions to canopy conductance. Thus for each layer :math:`j`, the extraction @@ -1883,7 +1863,7 @@ canopy conductance for plant functional type :math:`ft`, .. math:: G_{s,ft}= \sum_{1}w_{ncoh,ft} {gs_{can,coh} n_{coh} }. Aggregation of assimilated carbon into cohorts -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------ The derivation of photosynthetic rates per leaf layer, as above, give us the estimated rate of assimilation for a unit area of leaf at a given @@ -1966,11 +1946,9 @@ timestep to give KgC cohort\ :math:`^{-1}` day\ :math:`^{-1}` \bigskip Plant respiration -================= +^^^^^^^^^^^^^^^^^^ - [13]_ - -Plant respiration per individual :math:`R_{plant,coh}` (KgC individual +[13]_Plant respiration per individual :math:`R_{plant,coh}` (KgC individual :math:`^{-1}` s\ :math:`^{-1}`) is the sum of two terms, growth and maintenance respiration :math:`R_{g,coh}` and :math:`R_{m,coh}` @@ -2104,14 +2082,12 @@ respiration has occurred. \bigskip Stomatal Conductance -==================== +^^^^^^^^^^^^^^^^^^ Fundamental stomatal conductance theory ---------------------------------------- - - [14]_ +------------------ -Stomatal conductance is unchanged in concept from the CLM4.5 approach. +[14]_Stomatal conductance is unchanged in concept from the CLM4.5 approach. Leaf stomatal resistance is calculated from the Ball-Berry conductance model as described by :raw-latex:`\cite{collatz1991}` and implemented in a global climate model by :raw-latex:`\cite{sellers1996}`. The model @@ -2159,8 +2135,8 @@ R\ :math:`_{gas}` is the universal gas constant (J K\ :math:`^{-1}` kmol\ :math:`^{-1}`) and :math:`\theta_{atm}` is the atmospheric potential temperature (K). -Resolution of the stomatal conductance theory in the CLM(ED) canopy structure ------------------------------------------------------------------------------ +Resolution of stomatal conductance theory in the FATES canopy structure +-------------- The stomatal conductance is calculated, as with photosynthesis, for each canopy, PFT and leaf layer. The CLM code requires a single canopy @@ -2193,12 +2169,10 @@ cohort. +------------------+--------------------------+-------+------------+ -Allocation -========== - - [15]_ +Allocation and Growth +^^^^^^^^^^^^^^^^ -Total assimilation carbon enters the ED model each day as a +[15]_Total assimilation carbon enters the ED model each day as a cohort-specific Net Primary Productivity :math:`\mathit{NPP}_{coh}`, which is calculated as @@ -2214,7 +2188,7 @@ individual\ :math:`^{-1}` year\ :math:`^{-1}` and ultimately integrated using a timesteps of 1/365 years for each day. Tissue maintenance demand -------------------------- +--------------- We calculate a ‘tissue maintenance’ flux. The magnitude of this flux is such that the quantity of biomass in each pool will remain constant, @@ -2243,7 +2217,7 @@ phenology section. The total quantity of maintenance demand .. math:: t_{md,coh} = l_{md,coh} + r_{md,coh} Allocation to storage and turnover ----------------------------------- +----------------- The model must now determine whether the NPP input is sufficient to meet the maintenance demand and keep tissue levels constant. To determine @@ -2324,7 +2298,7 @@ and leaf biomass, ameliorated by the leaf trimming fraction (see :math:`\rho_{ft}` is the wood density, in g cm\ :math:`^{3}`. Allocation to Seeds -~~~~~~~~~~~~~~~~~~~ +--------------- The fraction remaining for growth (expansion of live and structural tissues) :math:`f_{growth}` is 1 minus that allocated to seeds. @@ -2350,7 +2324,7 @@ KgC individual :math:`^{-1}` y\ :math:`^{-1}`) is thus .. math:: p_{seed,coh} = C_{growth}\cdot f_{seed,coh} Allocation to growing pools -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +---------------- [16]_ The carbon is then partitioned into carbon available to grow the :math:`b_{alive}` and :math:`b_{struc}` pools. A fraction :math:`v_{a}` @@ -2434,7 +2408,7 @@ structural biomass pools are maintained in this algorithm, which diverges from the methodology currently deployed in the CLM4.5. Integration of allocated fluxes -------------------------------- +---------------- All of the flux calculations generate differential of the biomass state variables against time (in years). To integrate these differential rates @@ -2503,11 +2477,9 @@ In this case, :math:`\delta t` is set to be one day \bigskip Control of Leaf Area Index -========================== +^^^^^^^^^^^^^^ - [17]_ - -The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is +[17]_The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is calculated from leaf biomass :math:`b_{leaf,coh}` (kgC individual\ :math:`^{-1}`) and specific leaf area (SLA, m\ :math:`^2` kg C\ :math:`^{-1}`) @@ -2598,16 +2570,16 @@ the greatly reduced maintenance and turnover requirements. \bigskip Phenology -========= +^^^^^^^^^^^^^^^^^^^^ Cold Deciduous Phenology ------------------------- +------------------ Cold Leaf-out timing ~~~~~~~~~~~~~~~~~~~~ [18]_. The phenology model of :raw-latex:`\cite{botta2000}` is used in -CLM(ED) to determine the leaf-on timing. The Botta et al. model was +FATES to determine the leaf-on timing. The Botta et al. model was verified against satellite data and is one of the only globally verified and published models of leaf-out phenology. This model differs from the phenology model in the CLM4.5. The model simulates leaf-on date as a @@ -2685,21 +2657,19 @@ constrain growing degree day accumulation to the second half of the year (Jult onwards in the Northern hemisphere, or Jan-June in the Southern) and only allow GDD accumulation while the leaves are off. -Drought-deciduous Phenology ---------------------------- +Drought-deciduous Phenology: TBD +------------------ In the current version of the model, a drought deciduous algorithm -exists, but is not yet operational, due to issue detected in the exsting +exists, but is not yet operational, due to issue detected in the existing CN and soil moisture modules, which also affect the behaviour of the native ED drought deciduous model. This is a priority to address before the science tag is released. Carbon Dynamics of deciduous plants ------------------------------------ - - [19]_ +------------------ -In the present version, leaf expansion and senescence happen over the +[19]_In the present version, leaf expansion and senescence happen over the course of a single day. This is clearly not an empirically robust representation of leaf behaviour, whereby leaf expansion occurs over a period of 10-14 days, and senescence over a similar period. This will be @@ -2775,18 +2745,15 @@ for this carbon accounting scheme. \bigskip Seed Dynamics and Recruitment -============================= +^^^^^^^^^^^^^^^^^^ - [20]_ -The production of seeds and their subsequent germination is a process -that must be captured explicitly or implicitly in vegetation models. The -CLM(ED) contains a seed bank model designed to allow the dynamics of +[20]_The production of seeds and their subsequent germination is a process +that must be captured explicitly or implicitly in vegetation models. FATES contains a seed bank model designed to allow the dynamics of seed production and germination to be simulated independently. In the ED1.0 model, seed recruitment occurs in the same timestep as allocation to seeds, which prohibits the survival of a viable seed bank through a -period of disturbance or low productivity (winter, drought). In the -CLM(ED) model, a plant functional type specific seed bank is tracked in +period of disturbance or low productivity (winter, drought). In FATES, a plant functional type specific seed bank is tracked in each patch (:math:`Seeds_{patch}` KgC m\ :math:`^{-2}`), whose rate of change (KgC m\ :math:`^{-2}` y\ :math:`^{-1}`) is the balance of inputs, germination and decay: @@ -2858,12 +2825,12 @@ of one plant functional type over the seed pool. \bigskip -Fragmenting Litter Pool Production and Turnover -=============================================== +Litter Production and Fragmentation +^^^^^^^^^^^^^^ | The original CLM4.5 model contains streams of carbon pertaining to different chemical properties of litter (lignin, cellulose and labile - streams, specifically). In the CLM(ED) model, the fire simulation + streams, specifically). In FATES model, the fire simulation scheme in the SPITFIRE model requires that the model tracks the pools of litter pools that differ with respect to their propensity to burn (surface area-volume ratio, bulk density etc.). Therefore, this model @@ -2873,7 +2840,7 @@ Fragmenting Litter Pool Production and Turnover respiration. In this way, we can both maintain above-ground pools that affect the rate of burning, and the lag between tree mortality and availability of woody material for decomposition. -| The CLM(ED) recognizes four classes of litter. Above- and below-ground +| FATES recognizes four classes of litter. Above- and below-ground coarse woody debris (:math:`CWD_{AG}`, :math:`CWD_{BG}`) and leaf litter (:math:`l_{leaf}` and fine root litter :math:`l_{root}`). All pools are represented per patch, and with units of kGC @@ -2933,9 +2900,7 @@ assigned to each (:math:`f_{lsc}` and :math:`f_{ag}`) Litter Outputs -------------- - [22]_ - -The fragmenting litter pool is available for burning but not for +[22]_The fragmenting litter pool is available for burning but not for respiration or decomposition. Fragmentation rates are calculated according to a maximum fragmentation rate (:math:`\alpha_{cwd,lsc}` or :math:`\alpha_{litter}`) which is ameliorated by a temperature and water @@ -2961,11 +2926,9 @@ sensitivity analyses of the model outputs. .. math:: l_{root,out,ft} = l_{root,ft}.\alpha_{root,ft}.S_{tw} Flux into decompsition cascade ------------------------------- - - [23]_ +-------------- -Upon fragmentation and release from the litter pool, carbon is +[23]_Upon fragmentation and release from the litter pool, carbon is transferred into the labile, lignin and cellulose decomposition pools. These pools are vertically resolved in the biogeochemistry model. The movement of carbon into each vertical layer is obviously different for @@ -3060,7 +3023,7 @@ layer :math:`z`, derived from the CLM(BGC) model. \bigskip Plant Mortality -=============== +^^^^^^^^^^^^^^^^ Total plant mortality per cohort :math:`M_{t,coh}`, (fraction year\ :math:`^{-1}`) is simulated as the sum of four additive terms, @@ -3127,12 +3090,10 @@ fire modelling section. \bigskip -Fire -==== +Fire (SPITFIRE) +^^^^^^^^^^^^^^^^^ - [24]_ - -The influence of fire on vegetation is estimated using the SPITFIRE +[24]_The influence of fire on vegetation is estimated using the SPITFIRE model, which has been modified for use in ED following it’s original implementation in the LPJ-SPITFIRE model (:raw-latex:`\parencite{thonicke2010,pfeiffer2013}`. This model as @@ -3156,7 +3117,7 @@ open and closed forests can be represented effectively (we omit the ‘patch’ subscript throughout for simplicity). Properties of fuel load ------------------------ +--------------- Many fire processes are impacted by the properties of the litter pool in the SPITFIRE model. There are one live (live grasses) and five dead fuel @@ -3190,23 +3151,8 @@ as follows. \bigskip -Fuel load -~~~~~~~~~ - -Total fuel load :math:`F_{tot,patch}` for a given patch is the sum of -the above ground coarse woody debris and the leaf litter, plus the alive -grass leaf biomass :math:`b_{l,grass}` multiplied by the non-mineral -fraction (1-:math:`M_{f}`). - -.. math:: F_{tot,patch}=\left(\sum_{fc=1}^{fc=5} CWD_{AG,fc}+l_{litter}+b_{l,grass}\right)(1-M_{f}) - -Many of the model behaviours are affected by the patch-level weighted -average properties of the fuel load. Typically, these are calculated in -the absence of 1000-h fuels because these do not contribute greatly to -fire spread properties. - Nesterov Index -~~~~~~~~~~~~~~ +--------------- Dead fuel moisture (:math:`\emph{moist}_{df,fc}`), and several other properties of fire behaviour, are a function of the ‘Nesterov Index’ @@ -3226,6 +3172,23 @@ where :math:`T_{d}` is the daily mean temperature in :math:`^{o}`\ C and where :math:`RH` is the relative humidity (%). + +Fuel properties +--------------- + +Total fuel load :math:`F_{tot,patch}` for a given patch is the sum of +the above ground coarse woody debris and the leaf litter, plus the alive +grass leaf biomass :math:`b_{l,grass}` multiplied by the non-mineral +fraction (1-:math:`M_{f}`). + +.. math:: F_{tot,patch}=\left(\sum_{fc=1}^{fc=5} CWD_{AG,fc}+l_{litter}+b_{l,grass}\right)(1-M_{f}) + +Many of the model behaviours are affected by the patch-level weighted +average properties of the fuel load. Typically, these are calculated in +the absence of 1000-h fuels because these do not contribute greatly to +fire spread properties. + + Dead Fuel Moisture Content ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3301,7 +3264,7 @@ fuels). .. math:: F_{\sigma}=\sum_{fc=1}^{fc=4} \frac{F_{fc}}{F_{tot}}\sigma_{fuel,fc}+\frac{b_{l,grass}}{F_{tot}}\sigma_{fuel,grass} Forward rate of spread ----------------------- +----------------- For each patch and each day, we calculate the rate of forward spread of the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). @@ -3414,7 +3377,7 @@ Fire Behaviour Predictions Systems) .. math:: D_{f}=\textrm{min}\Big(F_{dur,max},\frac{F_{dur,max}}{1+F_{dur,max}e^{-11.06fdi}}\Big) Fire Danger Index ------------------ +-------------- Fire danger index (*fdi*) is a representation of the effect of meteorological conditions on the likelihood of a fire. It is calculated @@ -3459,7 +3422,7 @@ The total area burned (:math:`A_{burn}` in m\ :math:`^{2}`) is therefore where :math:`n_{f}` is the number of fires. Crown Damage ------------- +------------- :math:`c_{k}` is the fraction of the crown which is consumed by the fire. This is calculated from scorch height :math:`H_{s}`, tree height @@ -3485,7 +3448,7 @@ where :math:`f_{biomass,ft}` is the fraction of the above-ground biomass in each plant functional type. Cambial Damage and Kill ------------------------ +------------- The cambial kill is a function of the fuel consumed :math:`f_{c,tot}`, the bark thickness :math:`t_{b}`, and :math:`\tau_{l}`, the duration of From 1b44cdbee18adcc88bb40d3050bdf4443eaa2da5 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Tue, 12 Dec 2017 14:47:06 -0700 Subject: [PATCH 117/730] fixed the references for the FATES tech note --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 290 ++++++++---------- .../References/CLM50_Tech_Note_References.rst | 131 ++++++++ 2 files changed, 263 insertions(+), 158 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index c6f0558b6b..3a0bfcdbb2 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -8,40 +8,42 @@ What has changed - Deprecation of the dynamic global vegetation model (DGVM): The CLM5.0 model contains the legancy 'CNDV' code, which runs the CLM4(CN) model in combination with the LPJ-derived dynamics vegetation model introduced in CLM3. While this capacity has not technically been removed from the model, the DGVM has not been tested in the development of CLM5 and is no longer scientifically supported. -- Introduction of FATES: The Functionally Assembled Terrestrial Ecosystem Simulator (FATES) is the actively developed DGVM for the CLM5. +- Introduction of FATES: The Functionally Assembled Terrestrial Ecosystem Simulator (FATES) is the actively developed DGVM for the CLM5. See +.. _rst_FATES: + Technical Documentation for FATES =================================== +FATES is the "Functionally Assembled Terrestrial Ecosystem Simulator". It is an external module which can run within a given "Host Land Model" (HLM). Currently (November 2017) implementations are supported in both the Community Land Model(CLM) and in the land model of the E3SM Dept. of Energy Earth System Model. -Introduction -^^^^^^^^^^^^^^^^^^^^ +FATES was derived from the CLM Ecosystem Demography model (CLM(ED)), which was documented in: - This document is a technical appendix to - Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, +Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, Knox RG, Koven C, Holm J, Rogers BM, Lawrence D. Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes. Geoscientific Model Development Discussions. 2015 Apr 1;8(4). - https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf - - -FATES is presented here as an option within the structure of -the Community Land Model (CLM). Ecosystem Demography (‘ED’), is a -concept derived from the work of :raw-latex:`\cite{mc_2001}` and is a -cohort model of vegetation competition and co-existence, allowing a -representation of the biosphere which accounts for the division of the -land surface into successional stages, and the competition for light -between height structured cohorts of representative trees of various -plant functional types. This implementation of the Ecosystem Demography -concept links the surface flux and canopy physiology concepts in the CLM + +and this technical note was first published as an appendix to that paper. + +https://pdfs.semanticscholar.org/396c/b9f172cb681421ed78325a2237bfb428eece.pdf + +Introduction +^^^^^^^^^^^^^^^^^^^ + +The Ecosystem Demography ('ED'), concept within FATES is derived from the work of :ref:`Moorcroft et al. (2001)` + +and is a cohort model of vegetation competition and co-existence, allowing a representation of the biosphere which accounts for the division of the land surface into successional stages, and for competition for light between height structured cohorts of representative trees of various plant functional types. + +The implementation of the Ecosystem Demography +concept within FATES links the surface flux and canopy physiology concepts in the CLM/E3SM with numerous additional developments necessary to accommodate the new model also documented here. These include a version of the SPITFIRE -(Spread and InTensity of Fire) model of -:raw-latex:`\parencite{thonicke2010}`, and an adoption of the concept of -‘perfect plasticity’ approach of -:raw-latex:`\parencite{purves2008,lichstein2011,weng2014}` in accounting +(Spread and InTensity of Fire) model of :ref:`Thonicke et al. (2010)`, and an adoption of the concept of +`Perfect Plasticity Approximation` approach of +:ref:`Purves et al. 2008`, :ref:`Lichstein et al. 2011` and :ref:`Weng et al. 2014`, in accounting for the spatial arrangement of crowns. Novel algorithms accounting for the fragmentation of coarse woody debris into chemical litter streams, for the physiological optimisation of canopy thickness, for the @@ -50,40 +52,28 @@ radiation transfer, for drought-deciduous and cold-deciduous phenology, for carbon storage allocation, and for tree mortality under carbon stress, are also included and presented here. -This Document UPDATE ----------------- - -This document describes the implementation of the Ecosystem Demography -concept within the Community Land Model. The material covered describes how -the Ecosystem Demography code is organized, how it interacts with the -pre-existing CLM routines, and the new aspects of plant physiology and -vegetation dynamics that are introduced further to those already -existing within the model. Numerous other implementations of the -Ecosystem Demography concept are in existence, in particular the ED2 -model, which is a fully operational land surface scheme -:raw-latex:`\parencite{medvigy2009}` which contains both the basic ED -concept and an array of physiological and ecological innovations -surrounding the basic concept. Therefore, to avoid confusion between the -concept of ‘Ecosystem Demography’ and the implementation of this concept -in different models, we refer our model as the ‘FATES’ (the functionally Assembled Terrestrial Ecosystem Simulator) throughout. +Numerous other implementations of the +Ecosystem Demography concept exist (See Fisher et al. 2017 for a review of these) Therefore, to avoid confusion between the +concept of 'Ecosystem Demography' and the implementation of this concept +in different models, the CLM(ED) implementation described by Fisher et al. (2015) will hereafter be called 'FATES' (the Functionally Assembled Terrestrial Ecosystem Simulator). The representation of ecosystem heterogeneity in FATES ^^^^^^^^^^^^^^^ -The land surface of the Earth is heterogeneous for many reasons, driven +The terrestrial surface of the Earth is heterogeneous for many reasons, driven by variations in climate, edaphic history, ecological variability, geological forcing and human interventions. Land surface models represent this variability first by introducing a grid structure to the land surface, allowing different atmospheric forcings to operate in each -grid cell, and subsequently by representing ‘sub-grid’ variability in +grid cell, and subsequently by representing 'sub-grid' variability in the surface properties. In the CLM, the land surface is divided into -numerous ‘landunits’ corresponding to the underlying condition of the -surface (e.g. soils, ice, lakes, bare ground) and then ‘columns’ +numerous 'landunits' corresponding to the underlying condition of the +surface (e.g. soils, ice, lakes, bare ground) and then 'columns' referring to elements of the surface that share below ground resources -(water & nutrients). Within the ‘soil’ landunit, for example, there are +(water & nutrients). Within the soil landunit, for example, there are separate columns for crops, and for natural vegetation, as these are assumed to use separate resource pools. The FATES model at present -only operates on the naturally vegetated column. The ‘soil’ column is +only operates on the naturally vegetated column. The soil column is sub-divided into numerous tiles, that correspond to statistical fractions of the potentially vegetated land area. In the CLM 4.5 (and all previous versions of the model), sub-grid tiling operates on the @@ -97,21 +87,21 @@ The introduction of the Ecosystem Demography concept introduces significant alterations to the representation of the land surface in the CLM. In FATES, the tiling structure represents the disturbance history of the ecosystem. Thus, some fraction of the land surface is -characterized as ‘recently disturbed’, some fraction has escaped +characterized as 'recently disturbed', some fraction has escaped disturbance for a long time, and other areas will have intermediate disturbances. Thus the ED concept essentially discretizes the trajectory -of succession from disturbed ground to ‘mature’ ecosystems. Within the -ED code, each ‘disturbance history class’ is referred to as a ‘patch’. -The word ‘patch’ has many possible interpretations, so it is important +of succession from disturbed ground to 'mature' ecosystems. Within +FATES, each "disturbance history class" is referred to as a ‘patch’. +The word "patch" has many possible interpretations, so it is important to note that: **there is no spatial location associated with the concept -of a ‘patch’. It refers to a fraction of the potential vegetated area +of a 'patch' . It refers to a fraction of the potential vegetated area consisting of all parts of the ecosystem with similar disturbance history.** -The ‘patch’ organizational structure in CLM thus replaces the previous -‘PFT’ structure in the organization heirarchy. The original hierarchical +The 'patch' organizational structure in CLM thus replaces the previous +'PFT' structure in the organization heirarchy. The original hierarchical land surface organizational structure of CLM as described in -:raw-latex:`\cite{oleson2013}` may be depicted as: +:ref:`Oleson et al. 2013` may be depicted as: .. math:: @@ -153,11 +143,11 @@ and the new structure is altered to the following: \mathbf{landunit} & \\ \end{array}\right. -Thus, each gridcell becomes a matrix of ‘patches’ that are -conceptualized by their ‘age since disturbance’ in years. This is the +Thus, each gridcell becomes a matrix of 'patches' that are +conceptualized by their 'age since disturbance' in years. This is the equivalent of grouping together all those areas of a gridcell that are -‘canopy gaps’, into a single entity, and all those areas that are -‘mature forest’ into a single entity. +'canopy gaps', into a single entity, and all those areas that are +'mature forest' into a single entity. Cohortized representation of tree populations --------------------------------------------- @@ -167,11 +157,11 @@ in reality contain numerous individual plants which vary in their physiological attributes, in height and in spatial position. One way of addressing this heterogeneity is to simulate a forest of specific individuals, and to monitor their behavior through time. This is the -approach taken by ‘gap’ and individual-based -:raw-latex:`\parencite{smith2001,sato2007,uriarte2009,fyllas2014}`. The +approach taken by "gap" and individual-based models +(:ref:`Smith et al. 2001`, :ref:`Sato et al. 2007`, :ref:`Uriarte et al. 2009`, :ref:`Fyllas et al. 2014 `). The depiction of individuals typically implies that the outcome of the model is stochastic. This is because we lack the necessary detailed knowledge -to simulate the individual plant’s fates. Thus gap models imply both +to simulate the individual plant's fates. Thus gap models imply both stochastic locations and mortality of plants. Thus, (with a genuinely random seed) each model outcome is different, and an ensemble of model runs is required to generate an average representative solution. Because @@ -180,19 +170,18 @@ deviations from the mean trajectory for a small plot (a typical simulated plot size is 30m x 30 m) the number of runs required to minimize these deviations is large and computationally expensive. For this reason, models that resolve individual trees typically use a -physiological timestep of one day or longer (e.g. -:raw-latex:`\cite{smith2001,xiaodong2005,sato2007}` +physiological timestep of one day or longer (e.g. :ref:`Smith et al. 2001`, :ref:`Xiaidong et al. 2005 `, :ref:`Sato et al. 2007` The approach introduced by the Ecosystem Demography model -:raw-latex:`\parencite{mc_2001}` is to group the hypothetical population -of plants into ‘cohorts’. In the notional ecosystem, after the +:ref:`Moorcroft et al. 2001` is to group the hypothetical population +of plants into "cohorts". In the notional ecosystem, after the land-surface is divided into common-disturbance-history patches, the population in each patch is divided first into plant functional types (the standard approach to representing plant diversity in large scale vegetation models), and then each plant type is represented as numerous height classes. Importantly, **for each PFT/height class bin, we model *one* representative individual plant, which tracks the average -properties of this ‘cohort’ of individual plants.** Thus, each +properties of this `cohort` of individual plants.** Thus, each common-disturbance-history patch is typically occupied by a set of cohorts of different plant functional types, and different height classes within those plant functional types. Each cohort is associated @@ -235,11 +224,11 @@ disturbance processes. If the new patches and cohorts established at *every* timestep were tracked by the model structure, the computational load would of course be extremely high (and thus equivalent to an individual-based approach). A signature feature of the ED model is the -system by which ‘functionally equivalent’ patches and cohorts are fused +system by which `functionally equivalent` patches and cohorts are fused into single model entities to save memory and computational time. [1]_ This functionality requires that criteria are established for the -meaning of `functional equivalence’, which are by necessity slightly +meaning of `functional equivalence`, which are by necessity slightly subjective, as they represent ways of abstracting reality into a more tractable mathematical representation. As an example of this, for height-structured cohorts, we calculate the relativized differences in @@ -343,16 +332,7 @@ Instead of iterating along a vector indexed by :math:`coh`, the code structures typically begin at the tallest cohort in a given patch, and iterate until a null pointer is encountered. -Using this structure, it is therefore possible to have an unbounded - upper limit on cohort number, and also to easily alter the ordering of - cohorts if, for example, a cohort of one functional type begins to - grow faster than a competitor of another functional type, and the - cohort list can easily be re-ordered by altering the pointer - structure. Each cohort has `pointers` indicating to which patch and - gridcell it belongs. The patch system is analogous to the cohort - system, except that patches are ordered in terms of their relative age, with - pointers to older and younger patches where cp\ :math:`_1` is the - oldest: +Using this structure, it is therefore possible to have an unbounded upper limit on cohort number, and also to easily alter the ordering of cohorts if, for example, a cohort of one functional type begins to grow faster than a competitor of another functional type, and the cohort list can easily be re-ordered by altering the pointer structure. Each cohort has `pointers` indicating to which patch and gridcell it belongs. The patch system is analogous to the cohort system, except that patches are ordered in terms of their relative age, with pointers to older and younger patches where cp\ :math:`_1` is the oldest: Indices used in FATES @@ -518,9 +498,6 @@ can be restarted, are as follows | Index | patch}}` | | | | +-------------+-------------+-------------+-------------+-------------+ -.. raw:: latex - - \bigskip Model Structure --------------- @@ -573,7 +550,7 @@ function of wood density, :math:`\rho`, g cm\ :math:`^{-3}`) .. math:: b_{struc,coh} =c_{str}h_{coh}^{e_{str,hite}} dbh_{coh}^{e_{str,dbh}} \rho_{ft}^{e_{str,dens}} taken from the original ED1.0 allometry -:raw-latex:`\parencite{mc_2001}` (values of the allometric constants in +:ref:`Moorcroft et al. 2001` (values of the allometric constants in Table `[table:allom] <#table:allom>`__. The maximum amount of leaf biomass associated with this diameter of tree is calculated according to the following allometry @@ -732,9 +709,9 @@ performance in ED-like cohort based models, since they determine how light resources are partitioned between competing plants of varying heights, which has a very significant impact on how vegetation distribution emerges from competition -:raw-latex:`\parencite{fisher2010}`. +:ref:`Fisher et al. 2010`. -The standard ED1.0 model makes a simple ’flat disk’ assumption, that the +The standard ED1.0 model makes a simple `flat disk' assumption, that the leaf area of each cohort is spread in an homogenous layer at one exact height across entire the ground area represented by each patch. FATES has diverged from this representation due to (at least) two problematic emergent properties that we identified as generating unrealistic behaviours espetially for large-area patches. @@ -748,7 +725,7 @@ model artificially exaggerates the process of light competition. In reality, trees do not compete for light until their canopies begin to overlap and canopy closure is approached. -2. Unrealistic over-crowding. The ‘flat-disk’ assumption has no +2. Unrealistic over-crowding. The 'flat-disk' assumption has no consideration of the spatial extent of tree crowns. Therefore it has no control on the packing density of plants in the model. Given a mismatch between production and mortality, entirely unrealistic tree densities @@ -758,7 +735,7 @@ mortality rates. To account for the filling of space in three dimensions using the one-dimensional representation of the canopy employed by CLM, we implement a new scheme derived from that of -:raw-latex:`\cite{purves2008}`. Their argument follows the development +:ref:`Purves et al. 2008`. Their argument follows the development of an individual-based variant of the SORTIE model, called SHELL, which allows the location of individual plant crowns to be highly flexible in space. Ultimately, the solutions of this model possess an emergent @@ -801,7 +778,7 @@ where :math:`A_{crown}` is the crown area of a single tree canopy (m:math:`^{-2}`) and :math:`S_{c,patch,Cl}` is the ‘canopy spread’ parameter (m cm^-1) of this canopy layer, which is assigned as a function of canopy space filling, discussed below. In contrast to -:raw-latex:`\cite{purves2008}` , we use an exponent, identical to that +:ref:`Purves et al. 2008` , we use an exponent, identical to that for leaf biomass, of 1.56, not 2.0, such that tree leaf area index does not change as a function of diameter. @@ -815,11 +792,11 @@ the area of all crowns :math:`A_{canopy}` (m:math:`^{-2}`) is larger than the total ground area of a patch (:math:`A_{patch}`), then some fraction of each cohort is demoted to the understorey. -Under these circumstances, the ‘extra’ crown area :math:`A_{loss}` +Under these circumstances, the `extra` crown area :math:`A_{loss}` (i.e., :math:`A_{canopy}` - :math:`A_p`) is moved into the understorey. For each cohort already in the canopy, we determine a fraction of trees that are moved from the canopy (:math:`L_c`) to the understorey. -:math:`L_c` is calculated as :raw-latex:`\cite{fisher2010}` +:math:`L_c` is calculated as :ref:`Fisher et al. 2010` .. math:: L_{c}= \frac{A_{loss,patch} w_{coh}}{\sum_{coh=1}^{nc,patch}{w_{coh}}} , @@ -851,8 +828,8 @@ found in the code references in the footnote. Horizontal Canopy Spread ----------------- -[8]_:raw-latex:`\cite{purves2008}` estimated the ratio between canopy and -stem diameter :math:`c_{p}` as  0.1 m cm\ :math:`^{-1}` for canopy trees +[8]_:ref:`Purves et al. 2008` estimated the ratio between canopy and +stem diameter :math:`c_{p}` as 0.1 m cm\ :math:`^{-1}` for canopy trees in North American forests, but this estimate was made on trees in closed canopies, whose shape is subject to space competition from other individuals. Sapling trees have no constraints in their horizontal @@ -946,7 +923,7 @@ Stem area index (SAI) is ratio of the total area of all woody stems on a plant to the area of ground covered by the plant. During winter in deciduous areas, the extra absorption by woody stems can have a significant impact on the surface energy budget. However, in previous -‘big leaf’ versions of the CLM, computing the circumstances under which +`big leaf` versions of the CLM, computing the circumstances under which stem area was visible in the absence of leaves was difficult and the algorithm was largely heuristic as a result. Given the multi-layer canopy introduced for FATES, we can determine the leaves in the higher @@ -958,8 +935,8 @@ Literature on stem area index is particularly poor, as it’s estimation is complex and not particularly amenable to the use of, for example, assumptions of random distribution in space that are typically used to calculate leaf area from light interception. -:raw-latex:`\cite{kucharik1998}` estimated that SAI visible from an -LAI2000 sensor was around 0.5 m^2 m^-2. :raw-latex:`\cite{low2001}` +:ref:`Kucharik et al. 1998` estimated that SAI visible from an +LAI2000 sensor was around 0.5 m^2 m^-2. :ref:`Low et al. 2001` estimate that the wood area index for Ponderosa Pine forest is 0.27-0.33. The existing CLM(CN) algorithm sets the minimum SAI at 0.25 to match MODIS observations, but then allows SAI to rise as a function @@ -1147,9 +1124,6 @@ described later. | | biomass | | | | +-------------+-------------+-------------+-------------+-------------+ -.. raw:: latex - - \bigskip Radiation Transfer ^^^^^^^^^^^^^^^^^^^ @@ -1161,8 +1135,8 @@ Fundamental Radiation Transfer Theory vegetation concerns the partitioning of energy into that which is absorbed by vegetation, reflected back into the atmosphere, and absorbed by the ground surface. Older versions of the CLM have utilized a -‘two-stream’ approximation -:raw-latex:`\parencite{sellers1985,sellers1996}` that provided an +"two-stream" approximation +:ref:`Sellers 1985`, :ref:`Sellers et al. 1986` that provided an empirical solution for the radiation partitioning of a multi-layer canopy for two streams, of diffuse and direct light. However, implementation of the Ecosystem Demography model requires a) the @@ -1176,7 +1150,7 @@ thus implemented a one-dimensional scheme that traces the absorption, transmittance and reflectance of each canopy layer and the soil, iterating the upwards and downwards passes of radiation through the canopy until a pre-defined accuracy tolerance is reached. This approach -is based on the work of :raw-latex:`\cite{norman1979}`. +is based on the work of :ref:`Norman 1979`. Here we describe the basic theory of the radiation transfer model for the case of a single homogenous canopy, and in the next section we @@ -1291,7 +1265,7 @@ calculated sequentially, starting this time at the soil surface layer where :math:`alb_s` is the soil albedo characteristic. The upwards reflected fraction :math:`r_z` for each leaf layer, moving upwards, is -then :raw-latex:`\cite{norman1979}` +then :ref:`Norman 1979` .. math:: r_z = \frac{r_{z+1} \times \mathit{tran}_{dif} ^{2} }{ (1 - r_{z+1} \mathit{refl_{dif}}) + \mathit{refl_{dif}}}. @@ -1380,10 +1354,10 @@ profile section. Firstly, we denote two or more canopy layers (denoted :math:`C_l`). The concept of a ‘canopy layer’ refers to the idea that plants are organized into discrete over and under-stories, as predicted by the Perfect Plasticity Approximation -:raw-latex:`\parencite{purves2008,fisher2010}`. Within each canopy layer +(:ref:`Purves et al. 2008`, :ref:`Fisher et al. 2010`). Within each canopy layer there potentially exist multiple cohorts of different plant functional types and heights. Within each canopy layer, :math:`C_l`, and functional -type, :math:`ft`, the model resolves numerous leaf layers ‘:math:`z`’, +type, :math:`ft`, the model resolves numerous leaf layers :math:`z`, and, for some processes, notably photosynthesis, each leaf layer is split into a fraction of sun and shade leaves, :math:`f_{sun}` and :math:`f_{sha}`, respectively. @@ -1392,12 +1366,12 @@ The radiation scheme described in Section is solved explicitly for this structure, for both the visible and near-infrared wavebands, according to the following assumptions. -- A ‘canopy layer’ (:math:`C_{L}`) refers to either the over or understorey +- A *canopy layer* (:math:`C_{L}`) refers to either the over or understorey -- A ‘leaf layer’ (:math:`z`) refers to the discretization of the LAI +- A *leaf layer* (:math:`z`) refers to the discretization of the LAI within the canopy of a given plant functional type. -- All PFT’s in the same canopy layer have the same solar radiation +- All PFTs in the same canopy layer have the same solar radiation incident on the top layer of the canopy - Light is transmitted through the canopy of each plant functional type independently @@ -1411,7 +1385,7 @@ to the following assumptions. radiation is directly transferred to the soil surface. - All these calculations pertain to a single patch, so we omit the - ‘patch’ subscript for simplicity in the following discussion. + `patch` subscript for simplicity in the following discussion. Within this framework, the majority of the terms in the radiative transfer scheme are calculated with indices of :math:`C_L`, @@ -1553,9 +1527,9 @@ photosynthesis model before describing its application to the FATES canopy structure. This description in this section is largely repeated from the Oleson et al. CLM4.5 technical note but included here for comparison with its implementation in FATES. Photosynthesis in C3 -plants is based on the model of :raw-latex:`\cite{farquhar1980}` as -modified by :raw-latex:`\cite{collatz1991}`. Photosynthetic assimilation -in C4 plants is based on the model of :raw-latex:`\cite{collatz1992}`. +plants is based on the model of :ref:`Farquhar 1980` as +modified by :ref:`Collatz et al. 1991`. Photosynthetic assimilation +in C4 plants is based on the model of :ref:`Collatz et al. 1991`. In both models, leaf photosynthesis, :math:`\textrm{gpp}` (:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`) is calculated as the minimum of three potentially limiting fluxes, @@ -1582,7 +1556,7 @@ partial pressure (Pa). :math:`K_{c}` and :math:`K_{o}` are the Michaelis-Menten constants (Pa) for CO\ :math:`_{2}` and O\ :math:`_{2}`. These vary with vegetation temperature :math:`T_v` (:math:`^{o}`\ C) according to an Arrhenious function described in -:raw-latex:`\cite{oleson2013}`. :math:`V_{c,max}` is the leaf layer +:ref:`Oleson et al. 2013`. :math:`V_{c,max}` is the leaf layer photosynthetic capacity (:math:`\mu` mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`). @@ -1653,7 +1627,7 @@ CO\ :math:`_{2}` compensation point :math:`\Gamma_{*}` (Pa) is where the term 0.21 represents the ratio of maximum rates of oxygenation to carboxylation, which is virtually constant with temperature -:raw-latex:`\cite{farquhar1980}`. +:ref:`Farquhar, 1980`. Resolution of the photosynthesis theory within the FATES canopy structure. ------------------ @@ -1733,7 +1707,7 @@ Variation in plant physiology with canopy depth Both :math:`V_{c,max}` and :math:`J_{max}` vary with vertical depth in the canopy on account of the well-documented reduction in canopy -nitrogen through the leaf profile, see :raw-latex:`\cite{bonan2012}` for +nitrogen through the leaf profile, see :ref:`Bonan et al. 2012` for details). Thus, both :math:`V_{c,max}` and :math:`J_{max}` are indexed by by :math:`C_l`, :math:`ft` and :math:`z` according to the nitrogen decay coefficient :math:`K_n` and the amount of vegetation area shading @@ -1779,7 +1753,7 @@ where :math:`V_{canopy}` is calculated as :math:`K_{n}` is the coefficient of nitrogen decay with canopy depth. The value of this parameter is taken from the work of -:raw-latex:`\cite{lloyd2010}` who determined, from 204 vertical profiles +:ref:`Lloyd et al. 2010` who determined, from 204 vertical profiles of leaf traits, that the decay rate of N through canopies of tropical rainforests was a function of the :math:`V_{cmax}` at the top of the canopy. They obtain the following term to predict :math:`K_{n}`, @@ -1966,7 +1940,7 @@ To calculate canopy leaf respiration, which varies through we canopy, we first determine the top-of-canopy leaf respiration rate (:math:`r_{m,leaf,ft,0}`, gC s\ :math:`^{-1}` m\ :math:`^{-2}`) is calculated from a base rate of respiration per unit leaf nitrogen -derived from :raw-latex:`\cite{ryan1991}`. The base rate for leaf +derived from :ref:`Ryan et al. 1991`. The base rate for leaf respiration (:math:`r_{b}`) is 2.525 gC/gN s\ :math:`^{-1}`, .. math:: r_{m,leaf,ft,0} = r_{b} N_{a,ft}(1.5^{(25-20)/10}) @@ -2006,7 +1980,7 @@ same base rate of respiration per unit of tissue Nitrogen. Here, :math:`t_c` is a temperature relationship based on a :math:`q_{10}` value of 1.5, where :math:`t_v` is the vegetation temperature. We use a base rate of 20 here as, again, this is the -baseline temperature used by :raw-latex:`\cite{ryan1991}`. The +baseline temperature used by :ref:`Ryan et al. 1991`. The 10\ :math:`^{-3}` converts from gC invididual\ :math:`^{-1}` s\ :math:`^{-1}` to KgC invididual\ :math:`^{-1}` s\ :math:`^{-1}` @@ -2089,13 +2063,13 @@ Fundamental stomatal conductance theory [14]_Stomatal conductance is unchanged in concept from the CLM4.5 approach. Leaf stomatal resistance is calculated from the Ball-Berry conductance -model as described by :raw-latex:`\cite{collatz1991}` and implemented in -a global climate model by :raw-latex:`\cite{sellers1996}`. The model +model as described by :ref:`Collatz et al. 1991` and implemented in +a global climate model by :ref:`Sellers et al. 1996`. The model relates stomatal conductance (i.e., the inverse of resistance) to net leaf photosynthesis, scaled by the relative humidity at the leaf surface and the CO\ :math:`_2` concentration at the leaf surface. The primary difference between the CLM implementation and that used by -:raw-latex:`\cite{collatz1991}` and :raw-latex:`\cite{sellers1996}` is +:ref:`Collatz et al. 1991` and :ref:`Sellers et al. 1996` is that they used net photosynthesis (i.e., leaf photosynthesis minus leaf respiration) instead of gross photosynthesis. As implemented here, stomatal conductance equals the minimum conductance (:math:`b`) when @@ -2118,14 +2092,14 @@ surface (Pa), :math:`e_i` is the saturation vapor pressure (Pa) inside the leaf at the vegetation temperature conductance (:math:`\mu`\ mol m\ :math:`^{-2}` s\ :math:`^{-1}`) when :math:`A` = 0 . Typical values are :math:`m_{ft}` = 9 for C\ :math:`_3` plants and :math:`m_{ft}` = 4 -for C\ :math:`_4` plants -:raw-latex:`\parencite{collatz1991,collatz1992,sellers1996}`. -:raw-latex:`\cite{sellers1996}` used :math:`b` = 10000 for C\ :math:`_3` +for C\ :math:`_4` plants ( +:ref:`Collatz et al. 1991`, :ref:`Collatz, 1992`, :ref:`Sellers et al 1996)`. +:ref:`Sellers et al. 1996` used :math:`b` = 10000 for C\ :math:`_3` plants and :math:`b` = 40000 for C\ :math:`_4` plants. Here, :math:`b` was chosen to give a maximum stomatal resistance of 20000 s m\ :math:`^{-1}`. These terms are nevertheless plant strategy dependent, and have been found to vary widely with plant type -:raw-latex:`\parencite{medlyn2011}`. +:ref:`Medlyn et al. 2001`. Resistance is converted from units of s m\ :math:`^2 \mu` mol\ :math:`^{-1}` to s m\ :math:`^{-1}` as: 1 s m\ :math:`^{-1}` = @@ -2240,7 +2214,7 @@ where The allocation to storage is a fourth power function of :math:`f_{tstore}` to mimic the qualitative behaviour found for carbon -allocation in arabidopsis by :raw-latex:`\cite{smith2007}`. +allocation in arabidopsis by :ref:`Smith et al. 2007`. .. math:: @@ -2487,7 +2461,7 @@ C\ :math:`^{-1}`) .. math:: A_{leaf,coh} = b_{leaf,coh} \cdot SLA_{ft} For a given tree allometry, leaf biomass is determined from basal area -using the function used by :raw-latex:`\cite{mc_2001}` where :math:`d_w` +using the function used by :ref:`Moorcroft et al. 2001` where :math:`d_w` is wood density in g cm\ :math:`^{-3}`. .. math:: b_{leaf,coh} = c_{leaf} \cdot dbh_{coh}^{e_{leaf,dbh}} \rho_{ft}^{e_{leaf,dens}} @@ -2578,7 +2552,7 @@ Cold Deciduous Phenology Cold Leaf-out timing ~~~~~~~~~~~~~~~~~~~~ -[18]_. The phenology model of :raw-latex:`\cite{botta2000}` is used in +[18]_. The phenology model of :ref:`Botta et al. 2000` is used in FATES to determine the leaf-on timing. The Botta et al. model was verified against satellite data and is one of the only globally verified and published models of leaf-out phenology. This model differs from the @@ -2592,13 +2566,13 @@ given threshold :math:`T_{g}` (0 :math:`^{o}`\ C). Budburst occurs when :math:`GDD` exceeds a threshold (:math:`GDD_{crit}`). The threshold is modulated by the number of chilling days experienced (NCD) where the mean daily temperature falls -below a threshold determined by :raw-latex:`\cite{botta2000}` as +below a threshold determined by `Botta et al. 2000` as 5\ :math:`^{o}`\ C. A greater number of chilling days means that fewer growing degree days are required before budburst: .. math:: GDD_{crit}=a+be^{c.NCD} -where a = -68, b= 638 and c=-0.01 :raw-latex:`\cite{botta2000}`. In the +where a = -68, b= 638 and c=-0.01 `Botta et al. 2000`. In the Northern Hemisphere, counting of degree days begins on 1st January, and of chilling days on 1st November. The calendar opposite of these dates is used for points in the Southern Hemisphere. @@ -2620,8 +2594,8 @@ Cold Leaf-off timing The leaf-off model is taken from the Sheffield Dynamic Vegetation Model (SDGVM) and is similar to that for LPJ -:raw-latex:`\parencite{sitch2003}` and IBIS -:raw-latex:`\parencite{foley1996}` models. The average daily +:ref:`Sitch et al. 2003` and IBIS +:ref:`Foley et al. 1996` models. The average daily temperatures of the previous 10 day period are stored. Senescence is triggered when the number of days with an average temperature below 7.5\ :math:`^{o}` (:math:`n_{colddays}`) rises above a threshold values @@ -2772,10 +2746,10 @@ patch of the correct PFT type. .. math:: Seed_{in,ft} = \frac{\sum_{p=1}^{n_{patch}}\sum_{i=1}^{n_{coh}}p_{seed,i}.n_{coh}}{area_{site}} Seed decay is the sum of all the processes that reduce the number of -seeds, taken from :raw-latex:`\cite{lischke2006}`. Firstly, the rate at +seeds, taken from :ref:`Lischke et al. 2006`. Firstly, the rate at which seeds become inviable is described as a constant rate :math:`\phi` (y:math:`^{-1}`) which is set to 0.51, the mean of the parameters used -by :raw-latex:`\cite{lischke2006}`. +by :ref:`Lischke et al. 2006`. .. math:: Seed_{decay,ft} = Seeds_{FT}.\phi @@ -3038,13 +3012,13 @@ PFT-specific ‘target’ carbon storage, :math:`l_{targ,ft}`, as follows: .. math:: M_{cs,coh}= \rm{max} \left(0.0, S_{m,ft} \left(0.5 - \frac{b_{store,coh}}{l_{targ,ft}b_{leaf}}\right)\right) -where :math:`S_{m,ft}` is the ‘stress mortality’ parameter, or the +where :math:`S_{m,ft}` is the `stress mortality` parameter, or the fraction of trees in a landscape that die when the mean condition of a given cohort triggers mortality. This parameter is needed to scale from individual-level mortality simulation to grid-cell average conditions. Mechanistic simulation of hydraulic failure is not undertaken on account -of it’s mechanistic complexity (see :raw-latex:`\cite{mcdowell2013}`for +of it’s mechanistic complexity (see :ref:`McDowell et al. 2013`for details). Instead, we use a proxy for hydraulic failure induced mortality (:math:`M_{hf,coh}`) that uses a water potential threshold beyond mortality is triggered, such that the tolerance of low water @@ -3096,13 +3070,13 @@ Fire (SPITFIRE) [24]_The influence of fire on vegetation is estimated using the SPITFIRE model, which has been modified for use in ED following it’s original implementation in the LPJ-SPITFIRE model -(:raw-latex:`\parencite{thonicke2010,pfeiffer2013}`. This model as +(:ref:`Thonicke et al. 2010, :ref:`Pfeiffer et al. 2013`). This model as described is substantially different from the existing CLM4.5 fire model -:raw-latex:`\parencite{li2012}`, however, further developments are +:ref:`Li et al. 2012`, however, further developments are intended to increase the merging of SPITFIRE’s natural vegetation fire scheme with the fire suppression, forest-clearing and peat fire estimations in the existing model. The coupling to the ED model allows -fires to interact with vegetation in a ‘size-structured’ manner, so +fires to interact with vegetation in a size-structured manner, so small fires can burn only understorey vegetation. Also, the patch structure and representation of succession in the ED model allows the model to track the impacts of fire on different forest stands, therefore @@ -3114,7 +3088,7 @@ only implementation of this type of scheme in existence. The SPITFIRE model operates at a daily timestep and at the patch level, meaning that different litter pools and vegetation charecteristics of open and closed forests can be represented effectively (we omit the -‘patch’ subscript throughout for simplicity). +`patch` subscript throughout for simplicity). Properties of fuel load --------------- @@ -3123,11 +3097,11 @@ Many fire processes are impacted by the properties of the litter pool in the SPITFIRE model. There are one live (live grasses) and five dead fuel categories (dead leaf litter and four pools of coarse woody debris). Coarse woody debris is classified into 1h, 10h, 100h, and 1000h fuels, -defined by “\ *the order of magnitude of time required for fuel to lose +defined by the order of magnitude of time required for fuel to lose (or gain) 63% of the difference between its current moisture content and -the equilibrium moisture content under defined atmospheric conditions.*" -:raw-latex:`\parencite{thonicke2010}`. For the purposes of describing -the behaviour of fire, we introduce a new index ‘fuel class’ *fc*, the +the equilibrium moisture content under defined atmospheric conditions. +:ref:`Thonicke et al. 2010`. For the purposes of describing +the behaviour of fire, we introduce a new index 'fuel class' *fc*, the values of which correspond to each of the six possible fuel categories as follows. @@ -3157,7 +3131,7 @@ Nesterov Index Dead fuel moisture (:math:`\emph{moist}_{df,fc}`), and several other properties of fire behaviour, are a function of the ‘Nesterov Index’ (:math:`N_{I}`) which is an accumulation over time of a function of -temperature and humidity (Eqn 5, :raw-latex:`\cite{thonicke2010}`). +temperature and humidity (Eqn 5, :ref:`Thonicke et al. 2010`). .. math:: N_{I}=\sum{\textrm{max}(T_{d}(T_{d}-D),0)} @@ -3204,7 +3178,7 @@ Live grass moisture Content The live grass fractional moisture content(\ :math:`\emph{moist}_{lg}`) is a function of the soil moisture content. (Equation B2 in -:raw-latex:`\cite{thonicke2010}`) +:ref:`Thonicke et al. 2010`) .. math:: \emph{moist}_{lg}=\textrm{max}(0.0,\frac{10}{9}\theta_{30}-\frac{1}{9}) @@ -3274,7 +3248,7 @@ the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). :math:`e_{ps}` is the effective heating number (:math:`e^{\frac{-4.528}{F_{\sigma,patch}}}`). :math:`q_{ig}` is the heat of pre-ignition (:math:`581+2594F_{m}`). :math:`x_{i}` is the -propagating flux calculated as (see :raw-latex:`\cite{thonicke2010}` +propagating flux calculated as (see :ref:`Thonicke et al. 2010` Appendix A). .. math:: @@ -3298,7 +3272,7 @@ surface-area-volume ratio :math:`F_{\sigma,patch}`: where :math:`p_{d}` is the particle density (513). :math:`i_{r}` is the reaction intensity, calculated using the following -set of expressions (from :raw-latex:`\cite{thonicke2010}` Appendix A).: +set of expressions (from :ref:`Thonicke et al. 2010` Appendix A).: .. math:: @@ -3322,7 +3296,7 @@ Fuel Consumption The fuel consumption (fraction of biomass pools) of each dead biomass pool in the area affected by fire on a given day (:math:`f_{c,dead,fc}`) is a function of effective fuel moisture :math:`E_{moist,fc}` and size -class *fc* (Eqn B1, B4 and B5, :raw-latex:`\cite{thonicke2010}`). The +class *fc* (Eqn B1, B4 and B5, :ref:`Thonicke et al. 2010`). The fraction of each fuel class that is consumed decreases as its moisture content relative to its moisture of extinction (:math:`E_{moist,fc}`) increases. @@ -3334,7 +3308,7 @@ is modulated by both size class :math:`fc` and by the effective fuel moisture class :math:`mc`, defined by :math:`E_{moist,fc}`. :math:`m_{int}` and :math:`m_{slope}` are defined for low-, mid-, and high-moisture conditions, the boundaries of which are also functions of -the litter size class following :raw-latex:`\cite{peterson1986}` (page +the litter size class following :ref:`Peterson and Ryan 1986 ` (page 802). The fuel burned, :math:`f_{cground,fc}` (Kg m\ :math:`^{-2}` day\ :math:`^{-1}`) iscalculated from :math:`f_{cdead,fc}` for each fuel class: @@ -3357,7 +3331,7 @@ Fire intensity at the front of the burning area (:math:`I_{surface}`, kW m\ :math:`^{-2}`) is a function of the total fuel consumed (:math:`f_{ctot,patch}`) and the rate of spread at the front of the fire, :math:`\mathit{ros}_{f}` (m min\ :math:`^{-1}`) (Eqn 15 -:raw-latex:`\cite{thonicke2010}`) +:ref:`Thonicke et al. 2010`) .. math:: I_{surface}=\frac{0.001}{60}f_{energy} f_{ctot,patch}\mathit{ros}_{f} @@ -3371,7 +3345,7 @@ Fire Duration Fire duration is a function of the fire danger index with a maximum length of :math:`F_{dur,max}` (240 minutes in -:raw-latex:`\cite{thonicke2010}` Eqn 14, derived from Canadian Forest +:ref:`Thonicke et al. 2010` Eqn 14, derived from Canadian Forest Fire Behaviour Predictions Systems) .. math:: D_{f}=\textrm{min}\Big(F_{dur,max},\frac{F_{dur,max}}{1+F_{dur,max}e^{-11.06fdi}}\Big) @@ -3387,7 +3361,7 @@ for each gridcell as a function of the Nesterov Index . .. math:: \emph{fdi}=1-e^{\alpha N_{I}} where :math:`\alpha` = 0.00037 following -:raw-latex:`\cite{venevsky2002}`. +:ref:`Venevsky et al. 2002`. Area Burned ----------- @@ -3400,14 +3374,14 @@ respectively). .. math:: f_{length}=F_{d}(ros_{b}+ros_{f}) :math:`ros_{b}` is a function of :math:`ros_{f}` and windspeed (Eqn 10 -:raw-latex:`\cite{thonicke2010}`) +:ref:`Thonicke et al. 2010`) .. math:: ros_{b}=ros_{f}e^{-0.72W} The minor axis to major axis ratio :math:`l_{b}` of the ellipse is determined by the windspeed. If the windspeed (:math:`W`) is less than 16.67 ms\ :math:`^{-1}` then :math:`l_{b}=1`. Otherwise (Eqn 12 and 13, -:raw-latex:`\cite{thonicke2010}`) +:ref:`Thonicke et al. 2010`) .. math:: l_{b}=\textrm{min}\Big(8,f_{tree}(1.0+8.729(1.0-e^{-0.108W})^{2.155})+(f_{grass}(1.1+3.6W^{0.0464}))\Big) @@ -3415,7 +3389,7 @@ determined by the windspeed. If the windspeed (:math:`W`) is less than surface covered by grass and trees respectively. The total area burned (:math:`A_{burn}` in m\ :math:`^{2}`) is therefore -(Eqn 11, :raw-latex:`\cite{thonicke2010}`) +(Eqn 11, :ref:`Thonicke et al. 2010`) .. math:: A_{burn}=\frac{n_{f}\frac{3.1416}{4l_{b}}(f_{length}^{2}))}{10000} @@ -3427,7 +3401,7 @@ Crown Damage :math:`c_{k}` is the fraction of the crown which is consumed by the fire. This is calculated from scorch height :math:`H_{s}`, tree height :math:`h` and the crown fraction parameter :math:`F_{crown}` (Eqn 17 -:raw-latex:`\cite{thonicke2010}`): +:ref:`Thonicke et al. 2010`): .. math:: @@ -3438,9 +3412,9 @@ fire. This is calculated from scorch height :math:`H_{s}`, tree height \end{array} \right. The scorch height :math:`H_{s}` (m) is a function of the fire intensity, -following :raw-latex:`\cite{byram1959}`, and is proportional to a plant +following :ref:`Byram, 1959`, and is proportional to a plant functional type specific parameter :math:`\alpha_{s,ft}` (Eqn 16 -:raw-latex:`\cite{thonicke2010}`): +:ref:`Thonicke et al. 2010`): .. math:: H_{s}=\sum_{FT=1}^{NPFT}{\alpha_{s,p}\cdot f_{biomass,ft}} I_{surface}^{0.667} @@ -3452,25 +3426,25 @@ Cambial Damage and Kill The cambial kill is a function of the fuel consumed :math:`f_{c,tot}`, the bark thickness :math:`t_{b}`, and :math:`\tau_{l}`, the duration of -cambial heating (minutes) (Eqn 8, :raw-latex:`\cite{peterson1986}`): +cambial heating (minutes) (Eqn 8, :ref:`Peterson and Ryan 1986`): .. math:: \tau_{l}=\sum_{fc=1}^{fc=5}39.4F_{p,c}\frac{10000}{0.45}(1-(1-f_{c,dead,fc})^{0.5}) Bark thickness is a linear function of tree diameter :math:`dbh_{coh}`, defined by PFT-specific parameters :math:`\beta_{1,bt}` and -:math:`\beta_{2,bt}` (Eqn 21 :raw-latex:`\cite{thonicke2010}`): +:math:`\beta_{2,bt}` (Eqn 21 :ref:`Thonicke et al. 2010`): .. math:: t_{b,coh}=\beta_{1,bt,ft}+\beta_{2,bt,ft}dbh_{coh} The critical time for cambial kill, :math:`\tau_{c}` (minutes) is given -as (Eqn 20 :raw-latex:`\cite{thonicke2010}`): +as (Eqn 20 :ref:`Thonicke et al. 2010`): .. math:: \tau_{c}=2.9t_{b}^{2} The mortality rate caused by cambial heating :math:`\tau_{pm}` of trees within the area affected by fire is a function of the ratio between :math:`\tau_{l}` and :math:`\tau_{c}` (Eqn 19, -:raw-latex:`\cite{thonicke2010}`): +:ref:`Thonicke et al. 2010`): .. math:: diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index e613dce3b4..4d0883ac14 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -2226,3 +2226,134 @@ Global Biogeochemical Cycles 18. DOI:10.1029/2004GB002239. Zilitinkevich, S.S. 1970. Dynamics of the Atmospheric Boundary Layer. Leningrad Gidrometeor. + +.. _bonan2012: + +Bonan, Gordon B et al. (2012). `Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4`. Journal of Geophysical Research: Biogeosciences (2005-2012) 117.G2. + +.. _botta2000: + +Botta, A et al. (2000). `A global prognostic scheme of leaf onset using satellite data`. Global Change Biology 6.7, pp. 709-725. + +.. _byram1959: + +Byram, GM (1959). Combustion of forest fuels. In Forest fire: control and use.(Ed. KP Davis) pp. 61-89. + +.. _collatz1991: + +Collatz, G James et al. (1991). `Physiological and environmental regulation of stomatal conductance, photosynthesis and transpiration: a model that includes a laminar boundary layer` Agricultural and Forest Meteorology 54.2, pp. 107-136. + +.. _collatz1992: + +Collatz, Go J, M Ribas-Carbo, and JA Berry (1992). `Coupled photosynthesis-stomatal conductance model for leaves of C4 plants`. Functional Plant Biology 19.5, pp. 519-538.
 + +.. _farquhar1980: + +Farquhar, GD, S von von Caemmerer, and JA Berry (1980). `A biochemical model of photosynthetic CO2 assimilation in leaves of C3 species`. Planta 149.1, pp. 780-90. + +.. _fisher2010: + +Fisher, JB et al. (2010). `Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation`. Global Biogeochemical Cycles 24.1. + +.. _foley1996: + +Foley, Jonathan A et al. (1996). `An integrated biosphere model of land surface processes, terrestrial carbon balance, and vegetation dynamics`. Global Biogeochemical Cycles 10.4, pp. 603-628. + +.. _fyllas2014: + +Fyllas, NM et al. (2014). `Analysing Amazonian forest productivity using a new individual and trait- based model (TFS v. 1)`. Geoscientific Model Development 7.4, pp. 1251-1269. + +.. _kucharik1998: + +Kucharik, Christopher J, John M Norman, and Stith T Gower (1998). `Measurements of branch area and adjusting leaf area index indirect measurements`. Agricultural and Forest Meteorology 91.1, pp. 69-88. + +.. _li2012: + +Li, F, XD Zeng, and S Levis (2012). `A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model`. Biogeosciences 9.7, pp. 2761-2780. + +.. _lichstein2011: + +Lichstein, Jeremy W and Stephen W Pacala (2011). `Local diversity in heterogeneous landscapes: quantitative assessment with a height-structured forest metacommunity model`. Theoretical Ecology 4.2, pp. 269-281. + +.. _lischke2006: + +Lischke, Heike et al. (2006). `TreeMig: a forest-landscape model for simulating spatio-temporal patterns from stand to landscape scale`. Ecological Modelling 199.4, pp. 409-420. 41 + +.. _lloyd2010: + +Lloyd, J et al. (2010). `Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees`. Biogeosciences 7.6, pp. 1833-1859. + +.. _mcdowell2013: + +McDowell, Nate G et al. (2013). `Evaluating theories of drought-induced vegetation mortality using a multimodel experiment framework`. New Phytologist 200.2, pp. 304-321. + +.. _medlyn2011: + +Medlyn, Belinda E et al. (2011). `Reconciling the optimal and empirical approaches to modelling stom- atal conductance`. Global Change Biology 17.6, pp. 2134-2144. + + +.. _mc_2001: + +Moorcroft, PR, GC Hurtt, and Stephen W Pacala (2001). `A method for scaling vegetation dynamics: the ecosystem demography model ED`. Ecological monographs 71.4, pp. 557-586. + +.. _norman1979: + +Norman, JM (1979). `Modeling the complete crop canopy`. Modification of the Aerial Environment of Crops, pp. 249-280. + +.. _oleson2013: + +Oleson, KW et al. (2013). `Technical description of version 4.5 of the Community Land Model (CLM)`. + +.. _peterson1986: + +Peterson, David L and Kevin C Ryan (1986). `Modeling postfire conifer mortality for long-range planning`. Environmental Management 10.6, pp. 797-808. + +.. _pfeiffer2013: + +Pfeiffer, M, A Spessa, and JO Kaplan (2013). `A model for global biomass burning in preindustrial time: LPJ-LMfire (v1. 0)`. Geoscientific Model Development 6.3, pp. 643-685. + +.. _purves2008: + +Purves, Drew W et al. (2008). `Predicting and understanding forest dynamics using a simple tractable model`. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. + +.. _sato2007: + +Sato, Hisashi, Akihiko Itoh, and Takashi Kohyama (2007). `SEIB–DGVM: A new Dynamic Global Vegetation Model using a spatially explicit individual-based approach`. Ecological Modelling 200.3, pp. 2793307. + +.. _sellers1996: + +Sellers, Piers J et al. (1996). `A revised land surface parameterization (SiB2) for atmospheric GCMs. Part II: The generation of global fields of terrestrial biophysical parameters from satellite data`. Journal of climate 9.4, pp. 706-737. + +.. _sitch2003: + +Sitch, S et al. (2003). `Evaluation of ecosystem dynamics, plant geography and terrestrial carbon cycling in the LPJ dynamic global vegetation model`. Global Change Biology 9.2, pp. 161-185. + +.. _smith2007: + +Smith, Alison M and Mark Stitt (2007). `Coordination of carbon supply and plant growth`. Plant, cell & environment 30.9, pp. 1126-1149. + +.. _smith2001: + +Smith, Benjamin, I Colin Prentice, and Martin T Sykes (2001). `Representation of vegetation dynamics in the modelling of terrestrial ecosystems: comparing two contrasting approaches within European climate space`. Global Ecology and Biogeography 10.6, pp. 621-637. + +.. _thonicke2010: + +Thonicke, K et al. (2010). `The influence of vegetation, fire spread and fire behaviour on biomass burning and trace gas emissions: results from a process-based model`. Biogeosciences 7.6, pp. 1991-2011. + +.. _uriarte2009: + +Uriarte, Maria et al. (2009). `Natural disturbance and human land use as determinants of tropical forest dynamics: results from a forest simulator`. Ecological Monographs 79.3, pp. 423-443. + +.. _venevsky2002: + +Venevsky, Sergey et al. (2002). `Simulating fire regimes in human-dominated ecosystems: Iberian Peninsula case study`. Global Change Biology 8.10, pp. 984-998. + +.. _weng2014: + +Weng, ES et al. (2014). `Scaling from individuals to ecosystems in an Earth System Model using a mathematically tractable model of height-structured competition for light`. Biogeosciences Discussions 11.12, pp. 17757-17860. + +.. _xiaodong2005: + +Xiaodong, Yan and HH Shugart (2005). `FAREAST: a forest gap model to simulate dynamics and patterns of eastern Eurasian forests`. Journal of Biogeography 32.9, pp. 1641-1658. +42 + From 97e56aa0500ddcee5ef9d4231a32136f88e4debf Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 13 Dec 2017 09:28:24 -0700 Subject: [PATCH 118/730] Update html and fix build errors --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 76 +++++++++---------- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 67 +--------------- ...LM50_Tech_Note_External_Nitrogen_Cycle.rst | 4 +- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 3 +- .../References/CLM50_Tech_Note_References.rst | 7 ++ .../CLM50_Tech_Note_Surface_Albedos.rst | 5 +- 6 files changed, 55 insertions(+), 107 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 3a0bfcdbb2..45953fdca8 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -58,7 +58,7 @@ concept of 'Ecosystem Demography' and the implementation of this concept in different models, the CLM(ED) implementation described by Fisher et al. (2015) will hereafter be called 'FATES' (the Functionally Assembled Terrestrial Ecosystem Simulator). The representation of ecosystem heterogeneity in FATES -^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The terrestrial surface of the Earth is heterogeneous for many reasons, driven by variations in climate, edaphic history, ecological variability, @@ -445,7 +445,7 @@ restarted. The state variables of a cohort are as follows: +-----------------+-----------------+-----------------+-----------------+ Patch State Variables ------------------- +--------------------- A patch, as discuss earlier, is a fraction of the landscape which contains ecosystems with similar structure and disturbance history. A @@ -515,7 +515,7 @@ attributed to each cohort are accumulated throughout each daily cycle and passed into the ED code as the major driver of vegetation dynamics. Initialization of vegetation from bare ground -^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [5]_If the model is restarted from a bare ground state (as opposed to a pre-existing vegetation state), the state variables above are @@ -586,7 +586,7 @@ biomass, assigned per PFT [table:init] Allocation of biomass -^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^ [6]_Total live biomass :math:`b_{alive}` is the state variable of the model that describes the sum of the three live biomass pools leaf @@ -695,7 +695,7 @@ To calculated the sapwood biomass, we use [table:allom] Canopy Structure and the Perfect Plasticity Approximation -^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [7]_During initialization and every subsequent daily ED timestep, the canopy structure model is called to determine how the leaf area of the @@ -711,7 +711,7 @@ heights, which has a very significant impact on how vegetation distribution emerges from competition :ref:`Fisher et al. 2010`. -The standard ED1.0 model makes a simple `flat disk' assumption, that the +The standard ED1.0 model makes a simple 'flat disk' assumption, that the leaf area of each cohort is spread in an homogenous layer at one exact height across entire the ground area represented by each patch. FATES has diverged from this representation due to (at least) two problematic emergent properties that we identified as generating unrealistic behaviours espetially for large-area patches. @@ -826,10 +826,10 @@ fractions of cohorts are demoted or promoted. Further details can be found in the code references in the footnote. Horizontal Canopy Spread ------------------ +------------------------- [8]_:ref:`Purves et al. 2008` estimated the ratio between canopy and -stem diameter :math:`c_{p}` as 0.1 m cm\ :math:`^{-1}` for canopy trees +stem diameter :math:`c_{p}` as 0.1 m cm\ :math:`^{-1}` for canopy trees in North American forests, but this estimate was made on trees in closed canopies, whose shape is subject to space competition from other individuals. Sapling trees have no constraints in their horizontal @@ -887,7 +887,7 @@ However, the model is relatively insensitive to the choice of either :math:`i` or :math:`A_{t}`. Definition of Leaf and Stem Area Profile -------------------- +---------------------------------------- [9]_Within each patch, the model defines and tracks cohorts of multiple plant functional types that exist either in the canopy or understorey. @@ -1030,7 +1030,7 @@ leaf and stem area profiles, Burial of leaf area by snow --------------------- +--------------------------- The calculations above all pertain to the total leaf and stem area indices which charecterize the vegetation structure. In addition, the @@ -1129,7 +1129,7 @@ Radiation Transfer ^^^^^^^^^^^^^^^^^^^ Fundamental Radiation Transfer Theory ------------------- +------------------------------------- [10]_The first interaction of the land surface with the properties of vegetation concerns the partitioning of energy into that which is @@ -1343,7 +1343,7 @@ fractions, (required by the photosynthesis calculations), is .. math:: abs_{sun,z} = abs_{dif,z} \cdot f_{sun}+ abs_{dir,z} Resolution of radiation transfer theory within the FATES canopy structure ------------------- +------------------------------------------------------------------------- The radiation transfer theory above, was described with reference to a single canopy of one plant functional type, for the sake of clarity of @@ -1520,7 +1520,7 @@ Photosynthesis ^^^^^^^^^^^^^^^^^^^^ Fundamental photosynthetic physiology theory ------------------- +-------------------------------------------- [11]_In this section we describe the physiological basis of the photosynthesis model before describing its application to the FATES @@ -1630,7 +1630,7 @@ to carboxylation, which is virtually constant with temperature :ref:`Farquhar, 1980`. Resolution of the photosynthesis theory within the FATES canopy structure. ------------------- +-------------------------------------------------------------------------- The photosynthesis scheme is modified from the CLM4.5 model to give estimates of photosynthesis, respiration and stomatal conductance for a @@ -1703,7 +1703,7 @@ s\ :math:`^{-1}`) is calculated in a similar fashion, \end{array} \right. Variation in plant physiology with canopy depth ------------------- +----------------------------------------------- Both :math:`V_{c,max}` and :math:`J_{max}` vary with vertical depth in the canopy on account of the well-documented reduction in canopy @@ -1764,7 +1764,7 @@ where :math:`V_{cmax}` is again in :math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`. Water Stress on gas exchange ------------------- +---------------------------- [12]_ The top of canopy leaf photosynthetic capacity, :math:`V_{c,max0}`, is also adjusted for the availability of water to plants as @@ -1802,7 +1802,7 @@ on the calculation of soil matric potential, see the CLM4.5 technical note. Variation of water stress and water uptake within tiles -~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The remaining drivers of the photosynthesis model remain constant (atmospheric CO\ :math:`_2` and O\ :math:`^2` and canopy temperature) @@ -1837,7 +1837,7 @@ canopy conductance for plant functional type :math:`ft`, .. math:: G_{s,ft}= \sum_{1}w_{ncoh,ft} {gs_{can,coh} n_{coh} }. Aggregation of assimilated carbon into cohorts ------------------- +---------------------------------------------- The derivation of photosynthetic rates per leaf layer, as above, give us the estimated rate of assimilation for a unit area of leaf at a given @@ -2056,10 +2056,10 @@ respiration has occurred. \bigskip Stomatal Conductance -^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^ Fundamental stomatal conductance theory ------------------- +--------------------------------------- [14]_Stomatal conductance is unchanged in concept from the CLM4.5 approach. Leaf stomatal resistance is calculated from the Ball-Berry conductance @@ -2110,7 +2110,7 @@ kmol\ :math:`^{-1}`) and :math:`\theta_{atm}` is the atmospheric potential temperature (K). Resolution of stomatal conductance theory in the FATES canopy structure --------------- +----------------------------------------------------------------------- The stomatal conductance is calculated, as with photosynthesis, for each canopy, PFT and leaf layer. The CLM code requires a single canopy @@ -2144,7 +2144,7 @@ cohort. Allocation and Growth -^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^ [15]_Total assimilation carbon enters the ED model each day as a cohort-specific Net Primary Productivity :math:`\mathit{NPP}_{coh}`, @@ -2162,7 +2162,7 @@ individual\ :math:`^{-1}` year\ :math:`^{-1}` and ultimately integrated using a timesteps of 1/365 years for each day. Tissue maintenance demand ---------------- +------------------------- We calculate a ‘tissue maintenance’ flux. The magnitude of this flux is such that the quantity of biomass in each pool will remain constant, @@ -2191,7 +2191,7 @@ phenology section. The total quantity of maintenance demand .. math:: t_{md,coh} = l_{md,coh} + r_{md,coh} Allocation to storage and turnover ------------------ +---------------------------------- The model must now determine whether the NPP input is sufficient to meet the maintenance demand and keep tissue levels constant. To determine @@ -2272,7 +2272,7 @@ and leaf biomass, ameliorated by the leaf trimming fraction (see :math:`\rho_{ft}` is the wood density, in g cm\ :math:`^{3}`. Allocation to Seeds ---------------- +------------------- The fraction remaining for growth (expansion of live and structural tissues) :math:`f_{growth}` is 1 minus that allocated to seeds. @@ -2298,7 +2298,7 @@ KgC individual :math:`^{-1}` y\ :math:`^{-1}`) is thus .. math:: p_{seed,coh} = C_{growth}\cdot f_{seed,coh} Allocation to growing pools ----------------- +--------------------------- [16]_ The carbon is then partitioned into carbon available to grow the :math:`b_{alive}` and :math:`b_{struc}` pools. A fraction :math:`v_{a}` @@ -2382,7 +2382,7 @@ structural biomass pools are maintained in this algorithm, which diverges from the methodology currently deployed in the CLM4.5. Integration of allocated fluxes ----------------- +------------------------------- All of the flux calculations generate differential of the biomass state variables against time (in years). To integrate these differential rates @@ -2451,7 +2451,7 @@ In this case, :math:`\delta t` is set to be one day \bigskip Control of Leaf Area Index -^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^ [17]_The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is calculated from leaf biomass :math:`b_{leaf,coh}` (kgC @@ -2547,7 +2547,7 @@ Phenology ^^^^^^^^^^^^^^^^^^^^ Cold Deciduous Phenology ------------------- +------------------------ Cold Leaf-out timing ~~~~~~~~~~~~~~~~~~~~ @@ -2632,7 +2632,7 @@ constrain growing degree day accumulation to the second half of the year and only allow GDD accumulation while the leaves are off. Drought-deciduous Phenology: TBD ------------------- +-------------------------------- In the current version of the model, a drought deciduous algorithm exists, but is not yet operational, due to issue detected in the existing @@ -2641,7 +2641,7 @@ native ED drought deciduous model. This is a priority to address before the science tag is released. Carbon Dynamics of deciduous plants ------------------- +----------------------------------- [19]_In the present version, leaf expansion and senescence happen over the course of a single day. This is clearly not an empirically robust @@ -2719,7 +2719,7 @@ for this carbon accounting scheme. \bigskip Seed Dynamics and Recruitment -^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [20]_The production of seeds and their subsequent germination is a process @@ -2800,7 +2800,7 @@ of one plant functional type over the seed pool. \bigskip Litter Production and Fragmentation -^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | The original CLM4.5 model contains streams of carbon pertaining to different chemical properties of litter (lignin, cellulose and labile @@ -2900,7 +2900,7 @@ sensitivity analyses of the model outputs. .. math:: l_{root,out,ft} = l_{root,ft}.\alpha_{root,ft}.S_{tw} Flux into decompsition cascade --------------- +------------------------------ [23]_Upon fragmentation and release from the litter pool, carbon is transferred into the labile, lignin and cellulose decomposition pools. @@ -3091,7 +3091,7 @@ open and closed forests can be represented effectively (we omit the `patch` subscript throughout for simplicity). Properties of fuel load ---------------- +----------------------- Many fire processes are impacted by the properties of the litter pool in the SPITFIRE model. There are one live (live grasses) and five dead fuel @@ -3238,7 +3238,7 @@ fuels). .. math:: F_{\sigma}=\sum_{fc=1}^{fc=4} \frac{F_{fc}}{F_{tot}}\sigma_{fuel,fc}+\frac{b_{l,grass}}{F_{tot}}\sigma_{fuel,grass} Forward rate of spread ------------------ +---------------------- For each patch and each day, we calculate the rate of forward spread of the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). @@ -3351,7 +3351,7 @@ Fire Behaviour Predictions Systems) .. math:: D_{f}=\textrm{min}\Big(F_{dur,max},\frac{F_{dur,max}}{1+F_{dur,max}e^{-11.06fdi}}\Big) Fire Danger Index --------------- +----------------- Fire danger index (*fdi*) is a representation of the effect of meteorological conditions on the likelihood of a fire. It is calculated @@ -3422,7 +3422,7 @@ where :math:`f_{biomass,ft}` is the fraction of the above-ground biomass in each plant functional type. Cambial Damage and Kill -------------- +----------------------- The cambial kill is a function of the fuel consumed :math:`f_{c,tot}`, the bark thickness :math:`t_{b}`, and :math:`\tau_{l}`, the duration of diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index e21c8e05d0..6d36046e41 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -187,74 +187,15 @@ Vegetation Structure ^^^^^^^^^^^^^^^^^^^^^^^^^^ Vegetation structure is defined by leaf and stem area indices -(:math:`L,\, S`) and canopy top and bottom heights (:math:`z_{top}`,\ :math:`z_{bot}` ) -(:numref:`Table Prescribed plant functional type heights`). Separate leaf and +(:math:`L,\, S`) and canopy top and bottom heights (:math:`z_{top}`,\ :math:`z_{bot}` ). +Separate leaf and stem area indices and canopy heights are prescribed or calculated for each PFT. Daily leaf and stem area indices are obtained from griddeddatasets of monthly values (section -:numref:`Surface Data`). Canopy top and bottom heights are also obtained from gridded datasets. -However, these are currently invariant in space and time and were obtained from PFT-specific -values (:ref:`Bonan et al. 2002a `). When the biogeochemistry model is active, +:numref:`Surface Data`). Canopy top and bottom heights are from ICESat (:ref:`Simard et al. (2011) `. +When the biogeochemistry model is active, vegetation state (LAI, SAI, canopy top and bottom heights) are calculated prognostically (see Chapter :numref:`rst_Vegetation Phenology and Turnover`). -.. _Table Prescribed plant functional type heights: - -.. table:: Prescribed plant functional type heights - - +-----------------------------------+------------------------+------------------------+ - | Plant functional type | :math:`z_{top}` (m) | :math:`z_{bot}` (m) | - +===================================+========================+========================+ - | NET Temperate | 17 | 8.5 | - +-----------------------------------+------------------------+------------------------+ - | NET Boreal | 17 | 8.5 | - +-----------------------------------+------------------------+------------------------+ - | NDT Boreal | 14 | 7 | - +-----------------------------------+------------------------+------------------------+ - | BET Tropical | 35 | 1 | - +-----------------------------------+------------------------+------------------------+ - | BET temperate | 35 | 1 | - +-----------------------------------+------------------------+------------------------+ - | BDT tropical | 18 | 10 | - +-----------------------------------+------------------------+------------------------+ - | BDT temperate | 20 | 11.5 | - +-----------------------------------+------------------------+------------------------+ - | BDT boreal | 20 | 11.5 | - +-----------------------------------+------------------------+------------------------+ - | BES temperate | 0.5 | 0.1 | - +-----------------------------------+------------------------+------------------------+ - | BDS temperate | 0.5 | 0.1 | - +-----------------------------------+------------------------+------------------------+ - | BDS boreal | 0.5 | 0.1 | - +-----------------------------------+------------------------+------------------------+ - | C\ :math:`{}_{3}` arctic grass | 0.5 | 0.01 | - +-----------------------------------+------------------------+------------------------+ - | C\ :math:`{}_{3}` grass | 0.5 | 0.01 | - +-----------------------------------+------------------------+------------------------+ - | C\ :math:`{}_{4}` grass | 0.5 | 0.01 | - +-----------------------------------+------------------------+------------------------+ - | Crop R | 0.5 | 0.01 | - +-----------------------------------+------------------------+------------------------+ - | Crop I | 0.5 | 0.01 | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Corn R | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Corn I | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Temp Cereal R | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Temp Cereal I | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Winter Cereal R | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Winter Cereal I | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Soybean R | - | - | - +-----------------------------------+------------------------+------------------------+ - | :sup:`1`\ Soybean I | - | - | - +-----------------------------------+------------------------+------------------------+ - -:sup:`1`\ Determined by the crop model (Chapter :numref:`rst_Crops and Irrigation`) - .. _Phenology and vegetation burial by snow: Phenology and vegetation burial by snow diff --git a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst index 6a4ff5479d..ca7a4a9d2c 100644 --- a/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst +++ b/doc/source/tech_note/External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst @@ -3,9 +3,9 @@ External Nitrogen Cycle =========================== -.. _Summary of CLM5.0 updates relative to the CLM4.5: +.. _Summary of CLM5.0 updates relative to CLM4.5: -Summary of CLM5.0 updates relative to the CLM4.5 +Summary of CLM5.0 updates relative to CLM4.5 ----------------------------------------------------- We describe external inputs to the nitrogen cycle in CLM5.0.  Much of the following information appeared in the CLM4.5 Technical Note (:ref:`Oleson et al. 2013 `) as well as :ref:`Koven et al. (2013) `. diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 04d0a6a83c..626ac7ea56 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1278,8 +1278,7 @@ adjusted for canopy density following :ref:`Zeng and Wang (2007) ` d = z_{top} R_{d} V -where :math:`z_{top}` is canopy top height (m) -(:numref:`Table Prescribed plant functional type heights`), +where :math:`z_{top}` is canopy top height (m), :math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness length and displacement height to canopy top height, respectively (:numref:`Table Plant functional type aerodynamic parameters`), and :math:`z_{0m,\, g}` diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 4d0883ac14..db3498f4e5 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -626,6 +626,7 @@ studies. Water Resour. Res. 35:583-587. .. _Gravenetal2017: Graven, H., C. E. Allison, D. M. Etheridge, S. Hammer, R. F. Keeling, I. Levin, H. A. J. Meijer, M. Rubino, P. P. Tans, C. M. Trudinger, B. H. Vaughn and J. W. C. White (2017) Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geoscientific Model Development, in review. doi: 10.5194/gmd-2017-166. + .. _GrenfellWarren1999: Grenfell, T.C., and Warren, S.G. 1999. Representation of a nonspherical @@ -1745,6 +1746,12 @@ Siebert, S., Döll, P., Hoogeveen, J., Faures, J.M., Frenken, K., Feick, S., 2005. Development and validation of the global map of irrigation areas. Hydrol Earth Syst Sc 9:535–547 +.. _Simardetal2011: + +Simard, M., Pinto, N., Fisher, J.B., and Baccini, A. (2011), Mapping +forest canopy height globally with spaceborne lidar. +J. Geophys. Res., 116, G04021, doi:10.1029/2011JG001708. + .. _Simpsonetal1983: Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 2548b228fa..386cf77bd2 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -919,8 +919,9 @@ Snow aging is represented as evolution of the ice effective grain size (:math:`r_{e}`). Previous studies have shown that use of spheres which conserve the surface area-to-volume ratio (or specific surface area) of ice media composed of more complex shapes produces relatively -small errors in simulated hemispheric fluxes (e.g., :ref:`Grenfell and Warren -1999 `). Effective radius is the surface area-weighted mean +small errors in simulated hemispheric fluxes +(e.g., :ref:`Grenfell and Warren 1999 `). +Effective radius is the surface area-weighted mean radius of an ensemble of spherical particles and is directly related to specific surface area (*SSA*) as :math:`r_{e} ={3\mathord{\left/ {\vphantom {3 \left(\rho _{ice} SSA\right)}} \right. \kern-\nulldelimiterspace} \left(\rho _{ice} SSA\right)}` , From d3f1812297569444adb72ba1fb743f7c75ba18ba Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 20 Dec 2017 10:54:39 -0700 Subject: [PATCH 119/730] fix rsoil / canmx --- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 2 +- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 46 ++++++++++++------- .../CLM50_Tech_Note_Introduction.rst | 2 +- 3 files changed, 32 insertions(+), 18 deletions(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 04d0a6a83c..b7ee11cdc9 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1252,7 +1252,7 @@ and to update the soil surface fluxes (section .. math:: :label: 5.124 - \frac{\partial E_{g} }{\partial T_{g} } =\frac{\beta _{soi} \rho _{atm} }{r'_{aw} +r_{litter} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . + \frac{\partial E_{g} }{\partial T_{g} } = \rho _{atm} }{r'_{aw} +r_{soil} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . The partial derivatives :math:`\frac{\partial r'_{ah} }{\partial T_{g} }` and diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 8b9a9df144..a6c9936245 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -47,41 +47,54 @@ al. 2008) ` and :math:`\Delta t` is the time step (s). Canopy Water ---------------- -Liquid precipitation is either intercepted by the canopy, falls directly to the -snow/soil surface (throughfall), or drips off the vegetation (canopy -drip). Solid precipitation is treated similiar, with the addition of unloading of previously intercepted snow. +Liquid precipitation is either intercepted by the canopy, falls +directly to the snow/soil surface (throughfall), or drips off the +vegetation (canopy drip). Solid precipitation is treated similarly, +with the addition of unloading of previously intercepted snow. Interception by vegetation is divided between liquid and solid phases -:math:`q_{intr,\,liq}` and :math:`q_{intr,\,ice}` (kg m\ :sup:`-2` s\ :sup:`-1`) +:math:`q_{intr,\,liq}` and :math:`q_{intr,\,ice}` +(kg m\ :sup:`-2` s\ :sup:`-1`) .. math:: :label: 7.2 - q_{intr,\,liq} =\alpha_{liq} q_{rain} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + q_{intr,\,liq} = f_{pi,\,liq} q_{rain} .. math:: :label: 7.3 - q_{intr,\,ice} =\alpha_{sno} q_{sno} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} + q_{intr,\,ice} = f_{pi,\,ice} q_{sno} - -where :math:`L` and :math:`S` are the exposed leaf and stem area index, +where :math:`f_{pi,\,liq}` and :math:`f_{pi,\,ice}` are the +fractions of intercepted precipitation of rain and snow, +respectively + +.. math:: + :label: 7.2b + + f_{pi,\,liq} = \alpha_{liq} \ tanh \left(L+S\right) + +.. math:: + :label: 7.3b + + f_{pi,\,ice} =\alpha_{sno} \ \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} \ , +and :math:`L` and :math:`S` are the exposed leaf and stem area index, respectively (section :numref:`Phenology and vegetation burial by snow`), and the :math:`\alpha`\'s scale the fractional area of a leaf that collects water -(:ref:`Lawrence et al. 2007 `). Values of -:math:`\alpha_{liq} = 0.25` and :math:`\alpha_{sno} = 1` reflect the increased -capacity one side of a leaf has for snow than liquid water. +(:ref:`Lawrence et al. 2007 `). Default values of +:math:`\alpha_{liq}` and :math:`\alpha_{sno}` are set to 1. Throughfall (kg m\ :sup:`-2` s\ :sup:`-1`) is also divided into liquid and solid phases, reaching the ground (soil or snow surface) as .. math:: :label: 7.4 - q_{thru,\, liq} =q_{rain} \left[1-\alpha_{liq} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right] + q_{thru,\, liq} = q_{rain} \left(1 - f_{pi,\,liq}\right) .. math:: :label: 7.5 - q_{thru,\, ice} =q_{sno} \left[1-\alpha_{sno} \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\}\right]. + q_{thru,\, ice} = q_{sno} \left(1 - f_{pi,\,ice}\right) Similarly, the liquid and solid canopy drip fluxes are @@ -126,8 +139,9 @@ They are defined by W_{can,\,sno}^{max } =p_{ice}\left(L+S\right). -The maximum storage of liquid water is :math:`p_{liq}=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. -1993 `), and that of snow is :math:`p_{sno}=6`, consistent with reported +The maximum storage of liquid water is :math:`p_{liq}=0.1` kg m\ :sup:`-2` +(:ref:`Dickinson et al. 1993 `), and that of snow +is :math:`p_{sno}=6` kg m\ :sup:`-2`, consistent with reported field measurements (:ref:`Pomeroy et al. 1998 `). Canopy snow unloading from wind speed :math:`u` and above-freezing temperatures are modeled from linear @@ -1143,7 +1157,7 @@ exist within the soil column. Sub-surface runoff is .. math:: :label: 7.168 - q_{subsurface} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) + q_{drai} = \Theta_{ice} K_{baseflow} tan \left( \beta \right) \Delta z_{sat}^{N_{baseflow}} \ , where :math:`K_{baseflow}` is a calibration parameter, :math:`\beta` is the diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index f71aed9712..794a829005 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -592,7 +592,7 @@ processes simulated include (:numref:`Figure Land processes`): #. Stomatal physiology, photosythetic capacity, and photosynthesis (Chapters :numref:`rst_Stomatal Resistance and Photosynthesis` and :numref:`rst_Photosynthetic Capacity`) -#. Plant hydraulics (Chapter :numref: `rst_Plant Hydraulics`) +#. Plant hydraulics (Chapter :numref:`rst_Plant Hydraulics`) #. Lake temperatures and fluxes (Chapter :numref:`rst_Lake Model`) From 6204b1aa0f9ef96c6e3add59e97f05256cc6008a Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 20 Dec 2017 10:57:30 -0700 Subject: [PATCH 120/730] fix rsoil / canmx --- .../tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst | 3 +-- doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst | 4 ++-- doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 4db8909b42..f3613a78a6 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -137,7 +137,7 @@ favorable growth environments (Allen et al., 2005; Vanninen and Makela, .. table:: Allocation and target carbon\:nitrogen ratio parameters +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ - | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`Target CN_{leaf}` | :math:`Target CN_{fr}` | :math:`Target CN_{lw}` | :math:`Target CN_{dw}` | + | Plant functional type | :math:`a_{1}` | :math:`a_{2}` | :math:`a_{3}` | :math:`a_{4}` | :math:`Target CN_{leaf}` | :math:`Target CN_{fr}` | :math:`Target CN_{lw}` | :math:`Target CN_{dw}` | +==================================+=======================+=======================+=======================+=======================+===========================+=========================+=========================+=========================+ | NET Temperate | 1 | 0.3 | -1 | 0.1 | 35 | 42 | 50 | 500 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ @@ -160,7 +160,6 @@ favorable growth environments (Allen et al., 2005; Vanninen and Makela, | BDS temperate | 1 | 0.3 | 0.2 | 0.5 | 25 | 42 | 50 | 500 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ | BDS boreal | 1 | 0.3 | 0.2 | 0.1 | 25 | 42 | 50 | 500 | - +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ | C\ :sub:`3` arctic grass | 1 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | +----------------------------------+-----------------------+-----------------------+-----------------------+-----------------------+---------------------------+-------------------------+-------------------------+-------------------------+ | C\ :sub:`3` grass | 2 | 0 | 0 | 0 | 25 | 42 | 0 | 0 | diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index b7ee11cdc9..95214580b4 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1247,12 +1247,12 @@ and to update the soil surface fluxes (section .. math:: :label: 5.123 - \frac{\partial H_{g} }{\partial T_{g} } =\frac{\rho _{atm} C_{p} }{r'_{ah} } \frac{c_{a}^{h} +c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } + \frac{\partial H_{g} }{\partial T_{g} } = \frac{\rho _{atm} C_{p} }{r'_{ah} } \frac{c_{a}^{h} +c_{v}^{h} }{c_{a}^{h} +c_{v}^{h} +c_{g}^{h} } .. math:: :label: 5.124 - \frac{\partial E_{g} }{\partial T_{g} } = \rho _{atm} }{r'_{aw} +r_{soil} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . + \frac{\partial E_{g} }{\partial T_{g} } = \frac{\rho _{atm} }{r'_{aw} +r_{soil} } \frac{c_{a}^{w} +c_{v}^{w} }{c_{a}^{w} +c_{v}^{w} +c_{g}^{w} } \frac{dq_{g} }{dT_{g} } . The partial derivatives :math:`\frac{\partial r'_{ah} }{\partial T_{g} }` and diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index a6c9936245..2ca572ee9e 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -58,12 +58,12 @@ Interception by vegetation is divided between liquid and solid phases .. math:: :label: 7.2 - q_{intr,\,liq} = f_{pi,\,liq} q_{rain} + q_{intr,\,liq} = f_{pi,\,liq} \ q_{rain} .. math:: :label: 7.3 - q_{intr,\,ice} = f_{pi,\,ice} q_{sno} + q_{intr,\,ice} = f_{pi,\,ice} \ q_{sno} where :math:`f_{pi,\,liq}` and :math:`f_{pi,\,ice}` are the fractions of intercepted precipitation of rain and snow, From e7cc6e3c7030df7989cc9f6e74b199893e5cd760 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 20 Dec 2017 11:02:59 -0700 Subject: [PATCH 121/730] fix rsoil / canmx --- .../CLM50_Tech_Note_CN_Allocation.rst | 89 +++++++++++++------ .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 3 +- 2 files changed, 63 insertions(+), 29 deletions(-) diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index 8bc3991dea..f3613a78a6 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -3,26 +3,29 @@ Carbon and Nitrogen Allocation ============================== -Summary of CLM5.0 updates relative to the CLM4.5 ------------------------------------------------------ -- CLM5 now defaults to a static allocation to woody biomass rather than the dynamic allocation term used in CLM4.5. The dynamic allocation is stil lkept as an option, for details, see the CLM4.5 Tech Note. - -- CLM5 now includes flexible C:N ratios of all plant tissues, which allows allocation of carbon to occur separately from allocation of nitrogen, thus removing the requirement to downregulate photosynthesis based on the instantaneous stoichiometric needs of allocation. - -- CLM5 accounts for the carbon expenditure on nitrogen aquisition, as determined by the FUN model, and the N uptake it determined by the environmental cost of Nitrogen from fixation, active uptake and retranslocation. - - Introduction ----------------- -The carbon and nitrogen allocation routines in CLM determine the fate of newly assimilated carbon, and absorbed nitrogen. The environmental cost of nitrogen estimated by the FUN model modulates the C:N ratios of the plant tissue pools around a target ratio, and absorbed nitrogen is allocated in proportion to the demand, as estimated by the ideal requirements of these target C:N ratios. +The carbon and nitrogen allocation routines in CLM determine the fate of +newly assimilated carbon, coming from the calculation of photosynthesis, +and available mineral nitrogen, coming from plant uptake of mineral +nitrogen in the soil or being drawn out of plant reserves. A significant change to CLM5 relative to prior versions is that allocation of carbon and nitrogen proceed independently rather than in a sequential manner. -Carbon Allocation to Cover Prior-Timestep Maintenance Respiration Costs ("Excess" Respiration) ----------------------------------------------------------------------------------------------- +Carbon Allocation for Maintenance Respiration Costs +-------------------------------------------------------- -After respiration of live tissues (Chapter :numref:`rst_Plant Respiration`), the next priority of the carbon allocation cascade is to replenish the plant carbon deficit pool that balances maintenance respiration that occurs during times when maintenance respiration exceeds photosynthesis (e.g. at night, during winter for perennial vegetation, or during periods of drought stress) (Sprugel et al., 1995). +Allocation of available carbon on each time step is prioritized, with +first priority given to the demand for carbon to support maintenance +respiration of live tissues (section 13.7). Second priority is to +replenish the internal plant carbon pool that supports maintenance +respiration during times when maintenance respiration exceeds +photosynthesis (e.g. at night, during winter for perennial vegetation, +or during periods of drought stress) (Sprugel et al., 1995). Third +priority is to support growth of new tissues, including allocation to +storage pools from which new growth will be displayed in subsequent time +steps. The total maintenance respiration demand (:math:`CF_{mr}`, gC m\ :sup:`-2` s\ :sup:`-1`) is calculated as a function of @@ -89,19 +92,16 @@ Carbon and Nitrogen Stoichiometry of New Growth ---------------------------------------------------- After accounting for the carbon cost of maintenance respiration, the -remaining carbon flux from photosynthesis which is allocated either to new -growth or to nitrogen acquisition processes (Chapter :numref:`rst_FUN`), (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is +remaining carbon flux from photosynthesis which can be allocated to new +growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: :label: 19.6 CF_{avail\_ alloc} =CF_{GPP} -CF_{GPP,mr} -CF_{GPP,xs} . - -The FUN model requires an estimate of the C:N requirements of the existing plant structure, given that different relative quantities of wood, root and leaf biomass will result in different necessary C:N ratios for expansion. - -These C and N allocation ratios are calculated for all of the plant -carbon and nitrogen state variables based on target C:N ratios for +Potential allocation to new growth is calculated for all of the plant +carbon and nitrogen state variables based on specified C:N ratios for each tissue type and allometric parameters that relate allocation between various tissue types. The allometric parameters are defined as follows: @@ -116,6 +116,21 @@ Parameters :math:`a_{1}`, :math:`a_{2}`, and :math:`a_{4}` are defined as consta constant for all PFTs, based on construction costs for a range of woody and non-woody tissues (Larcher, 1995). +The model includes a dynamic allocation scheme for woody vegetation +(parameter :math:`a_{3}` = -1, :numref:`Table Allocation and CN ratio parameters`), in which case the +ratio for carbon allocation between new stem and new leaf increases with +increasing net primary production (NPP), as + +.. math:: + :label: 19.8 + + a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 + +where :math:`NPP_{ann}` is the annual sum of NPP from the previous +year. This mechanism has the effect of increasing woody allocation in +favorable growth environments (Allen et al., 2005; Vanninen and Makela, +2005) and during the phase of stand growth prior to canopy closure +(Axelsson and Axelsson, 1986). .. _Table Allocation and CN ratio parameters: @@ -183,14 +198,17 @@ follows: where all C:N parameters are defined as constants for a given PFT (:numref:`Table Allocation and CN ratio parameters`). - -The target C:N stoichiometry for new growth allocation can be calculated as +Given values for the parameters in and , total carbon and nitrogen +allocation to new growth ( :math:`CF_{alloc}`, gC +m\ :sup:`-2` s\ :sup:`-1`, and :math:`NF_{alloc}`, gN +m\ :sup:`-2` s\ :sup:`-1`, respectively) can be expressed as +functions of new leaf carbon allocation (:math:`CF_{GPP,leaf}`, gC +m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: 19.13 - - CN_{plant\_ target} =\frac{N_{allom} }{C_{allom} } . + :label: 19.10 + \begin{array}{l} {CF_{alloc} =CF_{GPP,leaf} {\kern 1pt} C_{allom} } \\ {NF_{alloc} =CF_{GPP,leaf} {\kern 1pt} N_{allom} } \end{array} where @@ -204,7 +222,16 @@ where N_{allom} =\left\{\begin{array}{l} {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } +\frac{a_{3} a_{4} \left(1+a_{2} \right)}{CN_{lw} } +} \\ {\qquad \frac{a_{3} \left(1-a_{4} \right)\left(1+a_{2} \right)}{CN_{dw} } \qquad {\rm for\; woody\; PFT}} \\ {\frac{1}{CN_{leaf} } +\frac{a_{1} }{CN_{fr} } \qquad \qquad \qquad {\rm for\; non-woody\; PFT.}} \end{array}\right. +Since the C:N stoichiometry for new growth allocation is defined, from +Eq. , as :math:`C_{allom}`/ :math:`N_{allom}`, the total carbon available for new growth allocation +(:math:`CF_{avail\_alloc}`) can be used to calculate the total +plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, +gN m\ :sup:`-2` s\ :sup:`-1`) as: + +.. math:: + :label: 19.13 + NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . Carbon Allocation to New Growth ----------------------------------------- @@ -285,8 +312,14 @@ tissue types are given as: Nitrogen allocation ----------------------------------------- -The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{uptake}`. This is distribution in proportion to the demand for N from different tissues, calculated as: +The total flux of nitrogen to be allocated is given by the FUN model (Chapter :numref:`rst_FUN`). This gives a total N to be allocated within a given timestep, :math:`N_{supply}`. The total N allocated for a given tissue :math:`i` is the minimum between the supply and the demand: + +.. math:: + :label: 19.26 + + NF_{alloc,i} = min \left( NF_{demand, i}, NF_{supply, i} \right) +The demand for each tissue, calculated for the tissue to remain on stoichiometry during growth, is: .. math:: :label: 19.27 @@ -348,14 +381,14 @@ The total flux of nitrogen to be allocated is given by the FUN model (Chapter :n NF_{demand,deadcroot\_ stor} \_ =\frac{CF_{alloc,leaf} a_{2} a_{3} \left(1-a_{4} \right)}{CN_{dw} } \left(1-f_{cur} \right). -After each pool's demand is calculated, the total plant N demand is then the sum of each individual pool :math:`i` corresponding to each tissue: +After each pool's demand is calculated, the total plant N demand is then the sum of each individual pool :math: `i` corresponding to each tissue: .. math:: :label: 19.39 NF_{demand,tot} = \sum _{i=tissues} NF_{demand,i} -and the total supply for each tissue :math:`i` is the product of the fractional demand and the total available N, calculated as the term :math:`N_{uptake}` equal to the sum of the eight N uptake streams described in the FUN model (Chapter :numref:`rst_FUN`). +and the total supply for each tissue :math: `i` is the product of the fractional demand and the total available N, calculated as the term :math: `N_{uptake}` equal to the sum of the eight N uptake streams described in the FUN model (Chapter :numref:`rst_FUN`). .. math:: :label: 19.40 diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 9eb2b19ba2..95214580b4 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1278,7 +1278,8 @@ adjusted for canopy density following :ref:`Zeng and Wang (2007) ` d = z_{top} R_{d} V -where :math:`z_{top}` is canopy top height (m), +where :math:`z_{top}` is canopy top height (m) +(:numref:`Table Prescribed plant functional type heights`), :math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness length and displacement height to canopy top height, respectively (:numref:`Table Plant functional type aerodynamic parameters`), and :math:`z_{0m,\, g}` From e4abfbc48fd3cf30c055fbc536d0221811406a61 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 20 Dec 2017 11:37:10 -0700 Subject: [PATCH 122/730] Update html --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 -- doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 2c11d56ba5..723e8bf032 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -83,8 +83,6 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Plant functional types` Plant functional types -- :numref:`Table Prescribed plant functional type heights` Prescribed plant functional type heights - - :numref:`Table Soil layer structure` Soil layer structure - :numref:`Table Atmospheric input to land model` Atmospheric input to land model diff --git a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst index 4a6192aacb..e24ac723ea 100644 --- a/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst +++ b/doc/source/tech_note/Urban/CLM50_Tech_Note_Urban.rst @@ -120,7 +120,7 @@ resolution. Schematic of urban and atmospheric model coupling. The urban model is forced by the atmospheric model wind (:math:`u_{atm}` ), temperature (:math:`T_{atm}` ), specific humidity (:math:`q_{atm}` ), precipitation (:math:`P_{atm}` ), solar (:math:`S_{atm} \, \downarrow` ) and longwave (:math:`L_{atm} \, \downarrow` ) radiation at reference height :math:`z'_{atm}` (section :numref:`Atmospheric Coupling`). Fluxes from the urban landunit to the atmosphere are turbulent sensible (:math:`H`) and latent heat (:math:`\lambda E`), momentum (:math:`\tau` ), albedo (:math:`I\uparrow` ), emitted longwave (:math:`L\uparrow` ), and absorbed shortwave (:math:`\vec{S}`) radiation. Air temperature (:math:`T_{ac}` ), specific humidity (:math:`q_{ac}` ), and wind speed (:math:`u_{c}` ) within the urban canopy layer are diagnosed by the urban model. :math:`H` is the average building height. -The urban model that was first lreleased as a component of CLM4.0 is separately +The urban model that was first released as a component of CLM4.0 is separately described in the urban technical note (:ref:`Oleson et al. (2010b) `). The main changes in the urban model from CLM4.0 to CLM4.5 were 1) an expansion of the single urban landunit to up to three landunits per From 841b2d947983bb1d3b89e62477c8a71a93ebc7b2 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 3 Jan 2018 17:18:51 -0700 Subject: [PATCH 123/730] Updates to Introduction and Chapter 2 --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 45 ++++++------------- .../CLM50_Tech_Note_Introduction.rst | 6 ++- 2 files changed, 18 insertions(+), 33 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 6d36046e41..8a6d9890b0 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -31,9 +31,9 @@ The second subgrid level, the column, is intended to capture potential variability in the soil and snow state variables within a single land unit. For example, the vegetated land unit could contain several columns with independently evolving vertical profiles of soil water and -temperature. Similarly, the managed vegetation land unit could be -divided into two columns, irrigated and non-irrigated. The snow/soil -column is represented by fifteen layers for soil and up to five layers +temperature. Similarly, the managed vegetation land unit can be +divided into two columns, irrigated and non-irrigated. The default snow/soil +column is represented by 25 layers for ground (with up to 20 of these layers classified as soil layers and the remaining layers classified as bedrock layers) and up to 10 layers for snow, depending on snow depth. The central characteristic of the column subgrid level is that this is where the state variables for water and energy in the soil and snow are defined, as well as the fluxes of @@ -52,23 +52,19 @@ impervious canyon floor) (Oleson et al. 2010b). .. Figure:: image1.png - Configuration of the CLM subgrid hierarchy. + Configuration of the CLM subgrid hierarchy. Box in upper right shows hypothetical subgrid distribution for a single grid cell. Note that the Crop land unit is only used when the model is run with the crop model active. Abbreviations: TBD – Tall Building District; HD – High Density; MD – Medium Density, G – Glacier, L – Lake, U – Urban, C – Crop, V – Vegetated, PFT – Plant Functional Type, Irr – Irrigated, UIrr – Unirrigated. Red arrows indicate allowed land unit transitions. Purple arrows indicate allowed patch-level transitions. -Note that the Crop land unit is only used when the model is run with the -crop model active. Abbreviations: TBD – Tall Building District; HD – -High Density; MD – Medium Density, G – Glacier, L – Lake, U – Urban, C – -Crop, V – Vegetated, PFT – Plant Functional Type, I – Irrigated, U – -Unirrigated . - -The third subgrid level is referred to as the PFT level, but it also -includes the treatment for bare ground. It is intended to capture the +The third subgrid level is referred to as the patch level. Patches can be PFTs or bare ground on the vegetated land unit +and crop functional types (CFTs) on the crop land unit. +The patch level is intended to capture the biogeophysical and biogeochemical differences between broad categories of plants in terms of their functional characteristics. On the vegetated land unit, up to 16 possible PFTs that differ in physiology and structure may coexist on a single column. All fluxes to and from the surface are defined at the PFT level, as are the vegetation state variables (e.g. vegetation temperature and canopy water storage). On the -crop land unit, several different crop types can be represented on each +crop land unit, typically, different crop types can be represented on each + crop land unit column (see Chapter :numref:`rst_Crops and Irrigation` for details). In addition to state and flux variable data structures for conserved @@ -156,30 +152,17 @@ evolve with time if the model is run in transient landcover mode +--------------------------------------------------------------+-------------------+ | C\ :sub:`4` grass | - | +--------------------------------------------------------------+-------------------+ - | C\ :sub:`3` Unmanaged Rainfed Crop | Crop R | - +--------------------------------------------------------------+-------------------+ - | :sup:`1`\ C\ :sub:`3` Unmanaged Irrigated Crop | Crop I | - +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Rainfed Corn | Corn R | - +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Irrigated Corn | Corn I | - +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Rainfed Temperate Cereals | Temp Cereal R | - +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Irrigated Temperate Cereals | Temp Cereal I | - +--------------------------------------------------------------+-------------------+ - | :sup:`3`\ Rainfed Winter Cereals | Winter Cereal R | + | C\ :sub:`3` Unmanaged Rainfed Crop | UCrop UIrr | +--------------------------------------------------------------+-------------------+ - | :sup:`3`\ Irrigated Winter Cereals | Winter Cereal I | + | :sup:`1`\ C\ :sub:`3` Unmanaged Irrigated Crop | UCrop Irr | +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Rainfed Soybean | Soybean R | + | :sup:`2`\ Managed Rainfed Unirrigated Crops | Crop UIrr | +--------------------------------------------------------------+-------------------+ - | :sup:`2`\ Irrigated Soybean | Soybean I | + | :sup:`2`\ Managed Irrigated Crops | Crop Irr | +--------------------------------------------------------------+-------------------+ :sup:`1`\ Only used if irrigation is active (Chapter :numref:`rst_Crops and Irrigation`). -:sup:`2`\ Only used if crop model is active (Chapter :numref:`rst_Crops and Irrigation`). -:sup:`3`\ Reserved for future implementations of crop model (Chapter :numref:`rst_Crops and Irrigation`). +:sup:`2`\ Only used if crop model is active (see Chapter :numref:`rst_Crops and Irrigation` for list of represented crops). .. _Vegetation Structure: diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 723e8bf032..3892e7729a 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -528,7 +528,7 @@ Nitrogen for Assimilation (LUNA, :ref:`Xu et al., 2012` and :ref:`Al photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that light capture, carboxylation, and respiration are co-limiting. -CLM5 applies a fixed allocation scheme for woody vegetation. The decision to use a fixed allocation scheme in CLM5, rather than a dynamic allocation scheme based on NPP as was used in CLM4 and CLM4.5, was driven by the fact that observations indicate that biomass saturates with increasing productivity, in contrast to the behavior in CLM4 and CLM4.5 where biomass continuously increases with increasing productivity (:ref:`Negron-Juarez et al., 2015`). Soil carbon decomposition processes are unchanged in CLM5, but a new metric for apparent soil carbon turnover times (:ref:`Koven et al., 2017 `) suggested parameter changes that produce a weak intrinsic depth limitation on soil carbon turnover rates (rather than the strong depth limitaiton in CLM4.5) and that the thresholds for soil moisture limitation on soil carbon turnover rates in dry soils should be set at a wetter soil moisture level than that used in CLM4.5. +CLM5 applies a fixed allocation scheme for woody vegetation. The decision to use a fixed allocation scheme in CLM5, rather than a dynamic NPP-based allocation scheme, as was used in CLM4 and CLM4.5, was driven by the fact that observations indicate that biomass saturates with increasing productivity, in contrast to the behavior in CLM4 and CLM4.5 where biomass continuously increases with increasing productivity (:ref:`Negron-Juarez et al., 2015`). Soil carbon decomposition processes are unchanged in CLM5, but a new metric for apparent soil carbon turnover times (:ref:`Koven et al., 2017 `) suggested parameter changes that produce a weak intrinsic depth limitation on soil carbon turnover rates (rather than the strong depth limitaiton in CLM4.5) and that the thresholds for soil moisture limitation on soil carbon turnover rates in dry soils should be set at a wetter soil moisture level than that used in CLM4.5. Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016)`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. Fertilization rates and irrigation equipped area updated annually based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that @@ -540,7 +540,9 @@ is incorporated. The fire model is the same as utilized in CLM4.5 except that a modified scheme is used to estimate the dependence of fire occurrence and spread on fuel wetness for non-peat fires outside cropland and tropical closed forests :ref:`(Li and Lawrence, 2017)` and the dependence of agricultural fires on fuel load is removed. -Included with the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, :ref:`Fisher et al., 2015)`. A major motivation of this development is to allow the prediction of biome boundaries directly from plant physiological traits via their competitive interactions. The version of CLM5-FATES that is supported in this release is described here??? Short blurb on what FATES can do??? Note that the classical dynamic global vegetation model (DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. +Included with the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, :ref:`Fisher et al., 2015)`. A major motivation of FATES is to allow the prediction of biome boundaries directly from plant physiological traits via their competitive interactions. FATES is a cohort model of vegetation competition and co-existence, allowing a representation of the biosphere which accounts for the division of the land surface into successional stages, and for competition for light between height structured cohorts of representative trees of various plant functional types. FATES is not active by default in CLM5.0. + +Note that the classical dynamic global vegetation model (CLM-DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. During the course of the development of CLM5.0, it became clear that the increasing complexity of the model combined with the increasing number and range of model development projects required updates to the underlying CLM infrastructure. Many such software improvements From 67b529bda1d4eba92769b3f0700cf4b3bfe28559 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 11 Jan 2018 16:37:12 -0700 Subject: [PATCH 124/730] Canopy top and bottom heights --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 32 ++++++++++++++++++- .../CLM50_Tech_Note_Introduction.rst | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 8a6d9890b0..6463e9d255 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -174,11 +174,41 @@ Vegetation structure is defined by leaf and stem area indices Separate leaf and stem area indices and canopy heights are prescribed or calculated for each PFT. Daily leaf and stem area indices are obtained from griddeddatasets of monthly values (section -:numref:`Surface Data`). Canopy top and bottom heights are from ICESat (:ref:`Simard et al. (2011) `. +:numref:`Surface Data`). Canopy top and bottom heights for trees are from ICESat (:ref:`Simard et al. (2011) `). +Canopy top and bottom heights for short vegetation are obtained from gridded datasets but are invariant in space +and time and were obtained from PFT-specific values (:ref:`Bonan et al. (2002a) `) (:numref:`Table Plant functional type canopy top and bottom heights`). When the biogeochemistry model is active, vegetation state (LAI, SAI, canopy top and bottom heights) are calculated prognostically (see Chapter :numref:`rst_Vegetation Phenology and Turnover`). +.. _Table Plant functional type canopy top and bottom heights: + +.. table:: Plant functional type canopy top and bottom heights + + +--------------------------------------------------------------+-------------------+-------------------+ + | Plant functional type | :math:`z_{top}` | :math:`z_{bot}` | + +==============================================================+===================+===================+ + | BES Temperate | 0.5 | 0.1 | + +--------------------------------------------------------------+-------------------+-------------------+ + | BDS Temperate | 0.5 | 0.1 | + +--------------------------------------------------------------+-------------------+-------------------+ + | BDS Boreal | 0.5 | 0.1 | + +--------------------------------------------------------------+-------------------+-------------------+ + | C\ :sub:`3` arctic grass | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | C\ :sub:`3` grass | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | C\ :sub:`4` grass | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | UCrop UIrr | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | UCrop Irr | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | Crop UIrr | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + | Crop Irr | 0.5 | 0.01 | + +--------------------------------------------------------------+-------------------+-------------------+ + .. _Phenology and vegetation burial by snow: Phenology and vegetation burial by snow diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 3892e7729a..3024441363 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -83,6 +83,8 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Plant functional types` Plant functional types +- :numref:`Table Plant functional type canopy top and bottom heights` Plant functional type canopy top and bottom heights + - :numref:`Table Soil layer structure` Soil layer structure - :numref:`Table Atmospheric input to land model` Atmospheric input to land model From a5ae98e2f9cd0254db5241a30e8617817cbdf5ff Mon Sep 17 00:00:00 2001 From: mvertens Date: Tue, 16 Jan 2018 11:27:54 -0700 Subject: [PATCH 125/730] changes for getting a pdf file to work correctly --- doc/source/conf.py | 9 +- doc/source/index.rst | 12 +- .../CLM50_Tech_Note_CN_Allocation.rst | 35 +- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 1 - .../tech_note/Fire/CLM50_Tech_Note_Fire.rst | 2 +- .../CLM50_Tech_Note_Introduction.rst | 164 ++- .../References/CLM50_Tech_Note_References.rst | 941 ++++++++++++++++-- doc/source/tech_note/index.rst | 1 - doc/source/users_guide/index.rst | 1 - .../users_guide/overview/introduction.rst | 129 +-- 10 files changed, 1041 insertions(+), 254 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 2d69cb46bd..a866c7f3fb 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -120,7 +120,9 @@ # Additional stuff for the LaTeX preamble. # - # 'preamble': '', + 'preamble': '\\usepackage{hyperref}', + + 'fncychap': '\\usepackage[Conny]{fncychap}', # Latex figure (float) alignment # @@ -130,10 +132,7 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'clmdoc.tex', u'clmdoc Documentation', - u'Erik Kluzek, Bill Sacks, Ben Andre', 'manual'), -] +latex_documents = [(master_doc, 'clmdoc.tex', u'CLM5 Documentation', '', 'manual'),] # -- Options for manual page output --------------------------------------- diff --git a/doc/source/index.rst b/doc/source/index.rst index cc7ec3c27c..f7f35abeda 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,16 +6,12 @@ Welcome to the CLM documentation ================================== -This document has one major sections. - -The :ref:`CLM user's guide ` is a basic guide in utilizing CLM. - -Table of contents ------------------ +This document has two major sections. .. toctree:: - :maxdepth: 1 - + :maxdepth: 2 + :numbered: + users_guide/index.rst tech_note/index.rst diff --git a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst index f3613a78a6..25b2215e81 100644 --- a/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst +++ b/doc/source/tech_note/CN_Allocation/CLM50_Tech_Note_CN_Allocation.rst @@ -38,17 +38,17 @@ photosynthesis ( :math:`CF_{xs,mr}`, gC m\ :sup:`-2` s\ :sup:`-1`): .. math:: - :label: 19.1 + :label: 19.1 CF_{mr} =CF_{GPP,mr} +CF_{xs,mr} .. math:: - :label: 19.2 + :label: 19.2 CF_{GPP,mr} =\_ \left\{\begin{array}{l} {CF_{mr} \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPP} } \\ {CF_{GPP} \qquad {\rm for\; }CF_{mr} >CF_{GPP} } \end{array}\right. .. math:: - :label: 19.3 + :label: 19.3 CF_{xs,mr} =\_ \left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CF_{mr} \le CF_{GPP} } \\ {CF_{mr} -CF_{GPP} \qquad {\rm for\; }CF_{mr} >CF_{GPP} } \end{array}\right. @@ -72,12 +72,12 @@ flux to :math:`CS_{xs}` (:math:`CF_{GPP,xs}`, gC m\ :sup:`-2` s\ :sup:`-1`) is given as .. math:: - :label: 19.4 + :label: 19.4 CF_{GPP,xs,pot} =\left\{\begin{array}{l} {0\qquad \qquad \qquad {\rm for\; }CS_{xs} \ge 0} \\ {-CS_{xs} /(86400\tau _{xs} )\qquad {\rm for\; }CS_{xs} <0} \end{array}\right. .. math:: - :label: 19.5 + :label: 19.5 CF_{GPP,xs} =\left\{\begin{array}{l} {CF_{GPP,xs,pot} \qquad \qquad \qquad {\rm for\; }CF_{GPP,xs,pot} \le CF_{GPP} -CF_{GPP,mr} } \\ {\max (CF_{GPP} -CF_{GPP,mr} ,0)\qquad {\rm for\; }CF_{GPP,xs,pot} >CF_{GPP} -CF_{GPP,mr} } \end{array}\right. @@ -96,7 +96,7 @@ remaining carbon flux from photosynthesis which can be allocated to new growth (:math:`CF_{avail}`, gC m\ :sup:`-2` s\ :sup:`-1`) is .. math:: - :label: 19.6 + :label: 19.6 CF_{avail\_ alloc} =CF_{GPP} -CF_{GPP,mr} -CF_{GPP,xs} . @@ -122,7 +122,7 @@ ratio for carbon allocation between new stem and new leaf increases with increasing net primary production (NPP), as .. math:: - :label: 19.8 + :label: 19.8 a_{3} =\frac{2.7}{1+e^{-0.004NPP_{ann} -300} } -0.4 @@ -195,7 +195,7 @@ follows: \begin{array}{l} {CN_{leaf} =\_ {\rm \; C:N\; for\; leaf}} \\ {CN_{fr} =\_ {\rm \; C:N\; for\; fine\; root}} \\ {CN_{lw} =\_ {\rm \; C:N\; for\; live\; wood\; (in\; stem\; and\; coarse\; root)}} \\ {CN_{dw} =\_ {\rm \; C:N\; for\; dead\; wood\; (in\; stem\; and\; coarse\; root)}} \end{array} -where all C:N parameters are defined as constants for a given PFT +where all C:N parameters are defined as constants for a given PFT (:numref:`Table Allocation and CN ratio parameters`). Given values for the parameters in and , total carbon and nitrogen @@ -213,7 +213,7 @@ m\ :sup:`-2` s\ :sup:`-1`): where .. math:: - :label: 19.11 + :label: 19.11 \begin{array}{l} {C_{allom} =\left\{\begin{array}{l} {\left(1+g_{1} \right)\left(1+a_{1} +a_{3} \left(1+a_{2} \right)\right)\qquad {\rm for\; woody\; PFT}} \\ {1+g_{1} +a_{1} \left(1+g_{1} \right)\qquad \qquad {\rm for\; non-woody\; PFT}} \end{array}\right. } \\ {} \end{array} @@ -229,7 +229,7 @@ plant nitrogen demand for new growth ( :math:`NF_{plant\_demand}`, gN m\ :sup:`-2` s\ :sup:`-1`) as: .. math:: - :label: 19.13 + :label: 19.13 NF_{plant\_ demand} =CF_{avail\_ alloc} \frac{N_{allom} }{C_{allom} } . @@ -248,22 +248,22 @@ storage pools (where storage is indicated with *\_stor*) for the various tissue types are given as: .. math:: - :label: 19.14 + :label: 19.14 CF_{alloc,leaf} \_ =CF_{alloc,leaf\_ tot} f_{cur} .. math:: - :label: 19.15 + :label: 19.15 CF_{alloc,leaf\_ stor} \_ =CF_{alloc,leaf\_ tot} \left(1-f_{cur} \right) .. math:: - :label: 19.16 + :label: 19.16 CF_{alloc,froot} \_ =CF_{alloc,leaf\_ tot} a_{1} f_{cur} .. math:: - :label: 19.17 + :label: 19.17 CF_{alloc,froot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{1} \left(1-f_{cur} \right) @@ -308,7 +308,7 @@ tissue types are given as: CF_{alloc,deadcroot\_ stor} \_ =CF_{alloc,leaf\_ tot} a_{2} a_{3} \left(1-a_{4} \right)\left(1-f_{cur} \right). - + Nitrogen allocation ----------------------------------------- @@ -320,7 +320,7 @@ The total flux of nitrogen to be allocated is given by the FUN model (Chapter :n NF_{alloc,i} = min \left( NF_{demand, i}, NF_{supply, i} \right) The demand for each tissue, calculated for the tissue to remain on stoichiometry during growth, is: - + .. math:: :label: 19.27 @@ -394,6 +394,3 @@ and the total supply for each tissue :math: `i` is the product of the fractional :label: 19.40 NF_{alloc,i} = N_{uptake} NF_{demand,i} / NF_{demand,tot} - - - diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 45953fdca8..170d44eb7a 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -3515,7 +3515,6 @@ within the area affected by fire is a function of the ratio between .. raw:: latex - \printbibliography .. [1] This description covers algorithms in the ‘fuse_cohorts’ subroutine. diff --git a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst index caef87c2b3..912bc7e378 100644 --- a/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst +++ b/doc/source/tech_note/Fire/CLM50_Tech_Note_Fire.rst @@ -192,7 +192,7 @@ Average spread area of a fire Fire fighting capacity depends on socioeconomic conditions and affects fire spread area. Due to a lack of observations, we consider the socioeconomic impact on the average burned area rather than separately -on fire spread rate and fire duration: +on fire spread rate and fire duration: .. math:: :label: 23.14 diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 3024441363..339ec3d05f 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -1,5 +1,3 @@ - - **July 2017** **Technical Description of version 5.0 of the Community Land Model @@ -15,7 +13,7 @@ ***Contributing Authors*** -**Ben Andre, Ali Ashehad, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +**Ben Andre, Ali Ashehad, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** @@ -35,21 +33,21 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). -- :numref:`Figure CLM subgrid hierarchy` Configuration of the CLM subgrid hierarchy. +- :numref:`Figure CLM subgrid hierarchy` Configuration of the CLM subgrid hierarchy. -- :numref:`Figure Radiation Schematic` Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. +- :numref:`Figure Radiation Schematic` Schematic diagram of (a) direct beam radiation, (b) diffuse solar radiation, and (c) longwave radiation absorbed, transmitted, and reflected by vegetation and ground. -- :numref:`Figure Schematic diagram of sensible heat fluxes` Schematic diagram of sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. +- :numref:`Figure Schematic diagram of sensible heat fluxes` Schematic diagram of sensible heat fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. -- :numref:`Figure Schematic diagram of latent heat fluxes` Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. +- :numref:`Figure Schematic diagram of latent heat fluxes` Schematic diagram of water vapor fluxes for (a) non-vegetated surfaces and (b) vegetated surfaces. -- :numref:`Figure Soil Temperature Schematic`. Schematic diagram of numerical scheme used to solve for soil temperature. +- :numref:`Figure Soil Temperature Schematic`. Schematic diagram of numerical scheme used to solve for soil temperature. - :numref:`Figure Hydrologic processes` Hydrologic processes represented in CLM. -- :numref:`Figure Water flux schematic` Schematic diagram of numerical scheme used to solve for soil water fluxes. +- :numref:`Figure Water flux schematic` Schematic diagram of numerical scheme used to solve for soil water fluxes. -- :numref:`Figure three layer snow pack` Example of three layer snow pack (snl=-3). +- :numref:`Figure three layer snow pack` Example of three layer snow pack (snl=-3). - :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. @@ -57,31 +55,31 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Schematic of urban and atmospheric model coupling` Schematic of urban and atmospheric model coupling. -- :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. +- :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. -- :numref:`Figure Carbon and nitrogen pools` Carbon and nitrogen pools. +- :numref:`Figure Carbon and nitrogen pools` Carbon and nitrogen pools. -- :numref:`Figure annual phenology cycle` Example of annual phenology cycle for seasonal deciduous. +- :numref:`Figure annual phenology cycle` Example of annual phenology cycle for seasonal deciduous. - 14.2. Example fluxes and pools sizes for an onset growth period of 15 days, with initial transfer pool size of 100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool (e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). -- 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. +- 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. - :numref:`Figure Schematic of decomposition model in CLM` Schematic of decomposition model in CLM. -- :numref:`Figure Pool structure` Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. +- :numref:`Figure Pool structure` Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. -- :numref:`Figure Biological nitrogen fixation` Biological nitrogen fixation as a function of annual net primary production. +- :numref:`Figure Biological nitrogen fixation` Biological nitrogen fixation as a function of annual net primary production. -- :numref:`Figure Methane Schematic` Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. +- :numref:`Figure Methane Schematic` Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. -- :numref:`Figure Schematic of land cover change` Schematic of land cover change impacts on CLM carbon pools and fluxes. +- :numref:`Figure Schematic of land cover change` Schematic of land cover change impacts on CLM carbon pools and fluxes. -- :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. +- :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. **LIST OF TABLES** -- :numref:`Table Plant functional types` Plant functional types +- :numref:`Table Plant functional types` Plant functional types - :numref:`Table Plant functional type canopy top and bottom heights` Plant functional type canopy top and bottom heights @@ -89,73 +87,73 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Atmospheric input to land model` Atmospheric input to land model -- :numref:`Table Land model output to atmospheric model` Land model output to atmospheric model +- :numref:`Table Land model output to atmospheric model` Land model output to atmospheric model -- :numref:`Table Surface data required for CLM and their base spatial resolution` Surface data required for CLM4.5 and their base spatial resolution +- :numref:`Table Surface data required for CLM and their base spatial resolution` Surface data required for CLM4.5 and their base spatial resolution -- :numref:`Table Physical constants` Physical constants +- :numref:`Table Physical constants` Physical constants - :numref:`Table Plant functional type optical properties` Plant functional type optical properties -- :numref:`Table Intercepted snow optical properties` Intercepted snow optical properties +- :numref:`Table Intercepted snow optical properties` Intercepted snow optical properties -- :numref:`Table Dry and saturated soil albedos` Dry and saturated soil albedos +- :numref:`Table Dry and saturated soil albedos` Dry and saturated soil albedos -- :numref:`Table Spectral bands and weights used for snow radiative transfer` Spectral bands and weights used for snow radiative transfer +- :numref:`Table Spectral bands and weights used for snow radiative transfer` Spectral bands and weights used for snow radiative transfer -- :numref:`Table Single-scatter albedo values used for snowpack impurities and ice` Single-scatter albedo values used for snowpack impurities and ice +- :numref:`Table Single-scatter albedo values used for snowpack impurities and ice` Single-scatter albedo values used for snowpack impurities and ice -- :numref:`Table Mass extinction values` Mass extinction values (m2 kg-1) used for snowpack impurities and ice. +- :numref:`Table Mass extinction values` Mass extinction values (m2 kg-1) used for snowpack impurities and ice. -- :numref:`Table Asymmetry scattering parameters used for snowpack impurities and ice` Asymmetry scattering parameters used for snowpack impurities and ice. +- :numref:`Table Asymmetry scattering parameters used for snowpack impurities and ice` Asymmetry scattering parameters used for snowpack impurities and ice. -- :numref:`Table Orbital parameters` Orbital parameters +- :numref:`Table Orbital parameters` Orbital parameters -- :numref:`Table Plant functional type aerodynamic parameters` Plant functional type aerodynamic parameters +- :numref:`Table Plant functional type aerodynamic parameters` Plant functional type aerodynamic parameters -- :numref:`Table Coefficients for saturation vapor pressure` Coefficients for e\ :sub:`sat`\ :sup:`T` +- :numref:`Table Coefficients for saturation vapor pressure` Coefficients for e\ :sub:`sat`\ :sup:`T` - :numref:`Table Coefficients for derivative of esat` Coefficients for 112:numref:`` 6.1. Soil layer structure. - :numref:`Table Meltwater scavenging` Meltwater scavenging efficiency for particles within snow -- :numref:`Table snow layer thickness` Minimum and maximum thickness of snow layers (m) +- :numref:`Table snow layer thickness` Minimum and maximum thickness of snow layers (m) -- :numref:`Table Plant functional type (PFT) stomatal conductance parameters` Plant functional type (PFT) stomatal conductance parameters. +- :numref:`Table Plant functional type (PFT) stomatal conductance parameters` Plant functional type (PFT) stomatal conductance parameters. -- :numref:`Table Temperature dependence parameters for C3 photosynthesis` Temperature dependence parameters for C3 photosynthesis. +- :numref:`Table Temperature dependence parameters for C3 photosynthesis` Temperature dependence parameters for C3 photosynthesis. -- :numref:`Table Plant functional type root distribution parameters` Plant functional type root distribution parameters. +- :numref:`Table Plant functional type root distribution parameters` Plant functional type root distribution parameters. - :numref:`Table MOSART Parameters` List of parameters in the global hydrography dataset. -- :numref:`Table Allocation and CN ratio parameters` Allocation and carbon:nitrogen ratio parameters +- :numref:`Table Allocation and CN ratio parameters` Allocation and carbon:nitrogen ratio parameters -- :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. +- :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. -- :numref:`Table Respiration fractions for litter and SOM pools` Respiration fractions for litter and SOM pools +- :numref:`Table Respiration fractions for litter and SOM pools` Respiration fractions for litter and SOM pools -- :numref:`Table Turnover times` Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. +- :numref:`Table Turnover times` Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. -- :numref:`Table Respiration fractions for Century-based structure` Respiration fractions for litter and SOM pools for Century-based structure +- :numref:`Table Respiration fractions for Century-based structure` Respiration fractions for litter and SOM pools for Century-based structure -- :numref:`Table PFT-specific combustion completeness and fire mortality factors` PFT-specific combustion completeness and fire mortality factors. +- :numref:`Table PFT-specific combustion completeness and fire mortality factors` PFT-specific combustion completeness and fire mortality factors. -- :numref:`Table Methane Parameter descriptions` Parameter descriptions and sensitivity analysis ranges applied in the methane model. +- :numref:`Table Methane Parameter descriptions` Parameter descriptions and sensitivity analysis ranges applied in the methane model. - :numref:`Table Temperature dependence of aqueous and gaseous diffusion` Temperature dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. -- :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. +- :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - :numref:`Table Crop plant functional types` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - :numref:`Table Crop allocation parameters` Crop allocation parameters for the active crop plant functional types (pfts) in CLM5BGCCROP. Numbers in the first row correspond to the list of pfts in :numref:`Table Crop plant functional types`. -- :numref:`Table Plant functional type (PFT) biogeography rules` Plant functional type (PFT) biogeography rules with respect to climate. +- :numref:`Table Plant functional type (PFT) biogeography rules` Plant functional type (PFT) biogeography rules with respect to climate. -- :numref:`Table Dust Mass fraction` Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i +- :numref:`Table Dust Mass fraction` Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i -- :numref:`Table Dust Minimum and maximum particle diameters` Minimum and maximum particle diameters in each dust transport bin j +- :numref:`Table Dust Minimum and maximum particle diameters` Minimum and maximum particle diameters in each dust transport bin j **ACKNOWLEDGEMENTS** @@ -187,7 +185,7 @@ scientific papers (:ref:`rst_References`). This document and the CLM5.0 User’s Guide together provide the user with the scientific description and operating instructions for CLM. -Model History +Model History --------------- Inception of CLM @@ -315,11 +313,11 @@ added stability corrections to the diagnostic 2-m air temperature calculation which reduced biases in this temperature. Competition between PFTs for water, in which PFTs share a single soil column, is the default mode of operation in this model version. CLM3 was released to -the community in June 2004. :ref:`Dickinson et al. (2006)` -describe the climate statistics of CLM3 when coupled to CCSM3.0. -:ref:`Hack et al. (2006)` provide an analysis of selected +the community in June 2004. :ref:`Dickinson et al. (2006)` +describe the climate statistics of CLM3 when coupled to CCSM3.0. +:ref:`Hack et al. (2006)` provide an analysis of selected features of the land hydrological cycle. -:ref:`Lawrence et al. (2007)` examine the impact of +:ref:`Lawrence et al. (2007)` examine the impact of changes in CLM3 hydrological parameterizations on partitioning of evapotranspiration (ET) and its effect on the timescales of ET response to precipitation @@ -490,11 +488,11 @@ remains long. Finally, the predominantly low resolution input data for provided with CLM4 to create CLM4 surface datasets is replaced with newer and higher -resolution input datasets where possible (see section :numref:`Surface Data` +resolution input datasets where possible (see section :numref:`Surface Data` for details). The default meteorological forcing dataset provided with CLM4 -(:ref:`Qian et al. 2006)` is replaced with the 1901-2010 -CRUNCEP forcing dataset (see Chapter :numref:`rst_Land-Only Mode`) for CLM4.5, -though users can also still use the :ref:`Qian et al. (2006)` +(:ref:`Qian et al. 2006)` is replaced with the 1901-2010 +CRUNCEP forcing dataset (see Chapter :numref:`rst_Land-Only Mode`) for CLM4.5, +though users can also still use the :ref:`Qian et al. (2006)` dataset or other alternative forcing datasets. CLM4.5 was released to the community in June 2013 along with the @@ -504,55 +502,55 @@ CLM5.0 ^^^^^^^^^^^^ Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, -and crop modeling. -Much of the focus of development centered on a +notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, +and crop modeling. +Much of the focus of development centered on a push towards more mechanistic treatment of key processes, in addition to more comprehensive and explicit representation -of land use and land-cover change. Prior versions of CLM included relatively few options for physics parameterizations or structure. +of land use and land-cover change. Prior versions of CLM included relatively few options for physics parameterizations or structure. In CLM5, where new parameterizations or model decisions were made, in most cases, the CLM4.5 parameterization was maintained so that users could switch back and forth between different parameterizations via namelist control where appropriate or desirable. Throughout the CLM5 Technical Descpription, in general only the default parameterization for any given process is described. Readers are referred to the CLM4.5 or CLM4 Technical Descriptions for detailed descriptions of non-default parameterizations. The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Rooting profiles were used inconsistently in CLM4.5 with :ref:`Zeng (2001)` profiles used for water and :ref:`Jackson et al. (1996)` profiles used for carbon inputs. For CLM5, the Jackson et al. (1996) rooting profiles are used for both water and carbon. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. Several changes are included that are mainly targeted at improving the simulation of surface mass balance over ice -sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to +sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to dynamically adjust landunit weights means that a glacier can initiate, grow, shrink, or disappear during -a simulation when two-way coupling is active. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. +a simulation when two-way coupling is active. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:`(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. -Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model based on the work of :ref:`Fisher et al. (2010)`, :ref:`Brzostek et al. (2014)`, and :ref:`Shi et al. (2016)` is incorporated. The concept of FUN is that in most cases, N uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of N in the environment which a plant may exchange for carbon. The ratio of carbon expended to N acquired is therefore the cost, or exchange rate, of N acquisition. FUN calculates the rate of symbiotic N fixation, with this N passed straight to the plant, not the mineral N pool. Separately, CLM5 also calculates rates of symbiotic (or free living) N fixation as a function of evapotranspiration (:ref:`Cleveland et al. 1999 `), which -is added to the soil inorganic ammonium (NH\ :sub:`4`\ :sup:`+`) pool. The static plant carbon:nitrogen (C:N) ratios utilized in CLM4 and CLM4.5 are replaced with variable plant C:N ratios which -allows plants to adjust their C:N ratio, and therefore their leaf nitrogen content, with the cost of N uptake :ref:`(Ghimire et al. 2016)`. -The implementation of a flexible C:N ratio means that the model no longer relies on instantaneous downregulation -of potential photosynthesis rates based on soil mineral nitrogen availability to represent nutrient limitation. Furthermore, stomatal conductance -is now based on the N-limited photosynthesis rather than on potential photosynthesis. Finally, the Leaf Use of +Plant nutrient dynamics are substantially updated to resolve several deficiencies with the CLM4 and CLM4.5 nutrient cycling representation. The Fixation and Update of Nitrogen (FUN) model based on the work of :ref:`Fisher et al. (2010)`, :ref:`Brzostek et al. (2014)`, and :ref:`Shi et al. (2016)` is incorporated. The concept of FUN is that in most cases, N uptake requires the expenditure of energy in the form of carbon, and further, that there are numerous potential sources of N in the environment which a plant may exchange for carbon. The ratio of carbon expended to N acquired is therefore the cost, or exchange rate, of N acquisition. FUN calculates the rate of symbiotic N fixation, with this N passed straight to the plant, not the mineral N pool. Separately, CLM5 also calculates rates of symbiotic (or free living) N fixation as a function of evapotranspiration (:ref:`Cleveland et al. 1999 `), which +is added to the soil inorganic ammonium (NH\ :sub:`4`\ :sup:`+`) pool. The static plant carbon:nitrogen (C:N) ratios utilized in CLM4 and CLM4.5 are replaced with variable plant C:N ratios which +allows plants to adjust their C:N ratio, and therefore their leaf nitrogen content, with the cost of N uptake :ref:`(Ghimire et al. 2016)`. +The implementation of a flexible C:N ratio means that the model no longer relies on instantaneous downregulation +of potential photosynthesis rates based on soil mineral nitrogen availability to represent nutrient limitation. Furthermore, stomatal conductance +is now based on the N-limited photosynthesis rather than on potential photosynthesis. Finally, the Leaf Use of Nitrogen for Assimilation (LUNA, :ref:`Xu et al., 2012` and :ref:`Ali et al., 2016)` model is incorporated. The LUNA model calculates -photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that -light capture, carboxylation, and respiration are co-limiting. +photosynthetic capacity based on optimization of the use of leaf nitrogen under different environmental conditions such that +light capture, carboxylation, and respiration are co-limiting. -CLM5 applies a fixed allocation scheme for woody vegetation. The decision to use a fixed allocation scheme in CLM5, rather than a dynamic NPP-based allocation scheme, as was used in CLM4 and CLM4.5, was driven by the fact that observations indicate that biomass saturates with increasing productivity, in contrast to the behavior in CLM4 and CLM4.5 where biomass continuously increases with increasing productivity (:ref:`Negron-Juarez et al., 2015`). Soil carbon decomposition processes are unchanged in CLM5, but a new metric for apparent soil carbon turnover times (:ref:`Koven et al., 2017 `) suggested parameter changes that produce a weak intrinsic depth limitation on soil carbon turnover rates (rather than the strong depth limitaiton in CLM4.5) and that the thresholds for soil moisture limitation on soil carbon turnover rates in dry soils should be set at a wetter soil moisture level than that used in CLM4.5. +CLM5 applies a fixed allocation scheme for woody vegetation. The decision to use a fixed allocation scheme in CLM5, rather than a dynamic NPP-based allocation scheme, as was used in CLM4 and CLM4.5, was driven by the fact that observations indicate that biomass saturates with increasing productivity, in contrast to the behavior in CLM4 and CLM4.5 where biomass continuously increases with increasing productivity (:ref:`Negron-Juarez et al., 2015`). Soil carbon decomposition processes are unchanged in CLM5, but a new metric for apparent soil carbon turnover times (:ref:`Koven et al., 2017 `) suggested parameter changes that produce a weak intrinsic depth limitation on soil carbon turnover rates (rather than the strong depth limitaiton in CLM4.5) and that the thresholds for soil moisture limitation on soil carbon turnover rates in dry soils should be set at a wetter soil moisture level than that used in CLM4.5. -Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016)`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. -Fertilization rates and irrigation equipped area updated annually based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that +Representation of human management of the land (agriculture, wood harvest) is augmented in several ways. The CLM4.5 crop model is extended to operate globally through the addition of rice and sugarcane as well as tropical varieties of corn and soybean :ref:`(Badger and Dirmeyer, 2015` and :ref:`Levis et al., 2016)`. These crop types are added to the existing temperate corn, temperature soybean, spring wheat, and cotton crop types. +Fertilization rates and irrigation equipped area updated annually based on crop type and geographic region through an input dataset. The irrigation trigger is updated. Additional minor changes include crop phenological triggers that vary by latitude for selected crop types, grain C and N is now removed at harvest to a 1-year product pool with -the carbon for the next season's crop seed removed from the grain carbon at harvest. Through the introduction of +the carbon for the next season's crop seed removed from the grain carbon at harvest. Through the introduction of the capability to dynamically adjust landunit weights during a simulation, the crop model can now be run coincidentally with prescribed land use, which significantly expands the capabilities of the model. Mass-based rather than area-based wood harvest is applied. Several heat stress indices for both urban and rural areas are calculated and output by default :ref:`(Buzan et al., 2015)`. A more sophisticated and realistic building space heating and air conditioning submodel that prognoses interior building air temperature and includes more realistic space heating and air conditioning wasteheat factors -is incorporated. +is incorporated. The fire model is the same as utilized in CLM4.5 except that a modified scheme is used to estimate the dependence of fire occurrence and spread on fuel wetness for non-peat fires outside cropland and tropical closed forests :ref:`(Li and Lawrence, 2017)` and the dependence of agricultural fires on fuel load is removed. Included with the release of CLM5.0 is a functionally supported version of the Functionally-Assembled Terrestrial Ecosystem Simulator (FATES, :ref:`Fisher et al., 2015)`. A major motivation of FATES is to allow the prediction of biome boundaries directly from plant physiological traits via their competitive interactions. FATES is a cohort model of vegetation competition and co-existence, allowing a representation of the biosphere which accounts for the division of the land surface into successional stages, and for competition for light between height structured cohorts of representative trees of various plant functional types. FATES is not active by default in CLM5.0. -Note that the classical dynamic global vegetation model (CLM-DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. +Note that the classical dynamic global vegetation model (CLM-DGVM) that has been available within CLM4 and CLM4.5 remains available, though it is largely untested. The technical description of the CLM-DGVM can be found within the CLM4.5 Technical Description (:ref:`Oleson et al. 2013)`. During the course of the development of CLM5.0, it became clear that the increasing complexity of the model combined with the increasing number and range of model development projects required updates to the underlying CLM infrastructure. Many such software improvements -are included in CLM5 including a partial transition to an object-oriented modular software structure. Many hard coded model -parameters have been extracted into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at -specific locations or to conduct parameter sensitivity studies. As part of the effort to increase -the scientific utility of the code, in most instances older generation parameterizations (i.e., the parameterizations -available in CLM4 or CLM4.5) are retained under namelist switches, allowing the user to revert to CLM4.5 +are included in CLM5 including a partial transition to an object-oriented modular software structure. Many hard coded model +parameters have been extracted into either the parameter file or the CLM namelist, which allows users to more readily calibrate the model for use at +specific locations or to conduct parameter sensitivity studies. As part of the effort to increase +the scientific utility of the code, in most instances older generation parameterizations (i.e., the parameterizations +available in CLM4 or CLM4.5) are retained under namelist switches, allowing the user to revert to CLM4.5 from the same code base or to revert individual parameterizations where the old parameterizations are compatible with the new code. Finally, multiple vertical soil layer structures are defined and it is relatively easy to add additional structures. @@ -562,7 +560,7 @@ Biogeophysical and Biogeochemical Processes Biogeophysical and biogeochemical processes are simulated for each subgrid land unit, column, and plant functional type (PFT) independently and each subgrid unit maintains its own prognostic variables (see -section :numref:`Surface Heterogeneity and Data Structure` for definitions +section :numref:`Surface Heterogeneity and Data Structure` for definitions of subgrid units). The same atmospheric forcing is used to force all subgrid units within a grid cell. The surface variables and fluxes required by the atmosphere are obtained by @@ -590,7 +588,7 @@ processes simulated include (:numref:`Figure Land processes`): #. Snow hydrology (snow accumulation and melt, compaction, water transfer between snow layers) (Chapter :numref:`rst_Snow Hydrology`) -#. Stomatal physiology, photosythetic capacity, and photosynthesis (Chapters :numref:`rst_Stomatal Resistance and Photosynthesis` and +#. Stomatal physiology, photosythetic capacity, and photosynthesis (Chapters :numref:`rst_Stomatal Resistance and Photosynthesis` and :numref:`rst_Photosynthetic Capacity`) #. Plant hydraulics (Chapter :numref:`rst_Plant Hydraulics`) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index db3498f4e5..5168284551 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1,10 +1,17 @@ .. _rst_References: + +.. |br| raw:: latex + + \\ + References ============== .. _Aberetal1990: +|br| + Aber, J.D., Melillo, J.M. and McClaugherty, C.A., 1990. Predicting long-term patterns of mass loss, nitrogen dynamics, and soil organic matter formation from initial fime litter chemistry in temperate forest @@ -12,6 +19,8 @@ ecosystems. Canadian Journal of Botany, 68: 2201-2208. .. _Aberetal2003: +|br| + Aber, J.D., Goodale, C.L., Ollinger, S.V., Smith, M.-L., Magill, A.H., Martin, M.E., Hallett, R.A., and Stoddard, J.L. 2003. Is nitrogen deposition altering the nitrogen status of northeastern forests? @@ -19,22 +28,32 @@ BioScience 53:375-389. .. _Alietal2016: -Ali, A. A., C. Xu, A. Rogers, R. A. Fisher, S. D. Wullschleger, E. Massoud, J. A. Vrugt, J. D. Muss, N. McDowell, and J. Fisher, 2016: A global scale mechanistic model of photosynthetic capacity (LUNA V1. 0). Geosci. Mod. Dev., 9:587-606. +|br| + +Ali, A. A., C. Xu, A. Rogers, R. A. Fisher, S. D. Wullschleger, E. Massoud, J. A. Vrugt, J. D. Muss, N. McDowell, +and J. Fisher, 2016: A global scale mechanistic model of +photosynthetic capacity (LUNA V1. 0). Geosci. Mod. Dev., 9:587-606. .. _Allenetal2005: +|br| + Allen, C.B., Will, R.E., and Jacobson, M.A. 2005. Production efficiency and radiation use efficiency of four tree species receiving irrigation and fertilization. Forest Science 51:556-569. .. _Anderson1976: +|br| + Anderson, E.A. 1976. A point energy and mass balance model of a snow cover. NOAA Technical Report NWS 19, Office of Hydrology, National Weather Service, Silver Spring, MD. .. _Andréetal1986: +|br| + André, J.-C., Goutorbe, J.-P., and Perrier, A. 1986. HAPEX-MOBILHY: A hydrologic atmosphere experiment for the study of water budget and evaporation flux at the climatic scale. Bull. Amer. Meteor. Soc. @@ -42,39 +61,53 @@ evaporation flux at the climatic scale. Bull. Amer. Meteor. Soc. .. _AndrénPaustian1987: +|br| + Andrén, O. and Paustian, K., 1987. Barley straw decomposition in the field: a comparison of models. Ecology 68:1190-1200. .. _ArahStephen1998: +|br| + Arah, J.R.M. and Stephen, K.D., 1998. A model of the processes leading to methane emission from peatland. Atmos. Environ. 32:3257-3264. .. _ArahVinten1995: +|br| + Arah, J. and Vinten, A., 1995. Simplified models of anoxia and denitrification in aggregated and simple-structured soils. European Journal of Soil Science 46:507-517. .. _Arendtetal2012: +|br| + Arendt, A., et al. 2012. Randolph Glacier Inventory: A Dataset of Global Glacier Outlines Version: 1.0, Global Land Ice Measurements from Space, Boulder Colorado, USA. Digital Media. .. _AroraBoer2005: +|br| + Arora, V.K. and Boer, G.J. 2005. Fire as an interactive component of dynamic vegetation models. J. Geophys. Res. 110:G02008. DOI:10.1029/2005JG000042. .. _Arya2001: +|br| + Arya, S.P. 2001. Introduction to Meteorology. Academic Press, San Diego, CA. .. _Asneretal1998: +|br| + Asner, G.P., Wessman, C.A., Schimel, D.S., and Archer, S. 1998. Variability in leaf and litter optical properties: implications for BRDF model inversions using AVHRR, MODIS, and MISR. Remote Sens. Environ. @@ -82,47 +115,63 @@ model inversions using AVHRR, MODIS, and MISR. Remote Sens. Environ. .. _AxelssonAxelsson1986: +|br| + Axelsson, E., and Axelsson, B. 1986. Changes in carbon allocation patterns in spruce and pine trees following irrigation and fertilization. Tree Phys. 2:189-204. .. _BadgerandDirmeyer2015: +|br| + Badger, A.M., and Dirmeyer, P.A., 2015. Climate response to Amazon forest replacement by heterogeneous crop cover. Hydrol. Earth. Syst. Sci. 19:4547- -4557. +4557. .. _Bairdetal2004: +|br| + Baird, A.J., Beckwith, C.W., Waldron, S. and Waddington, J.M., 2004. Ebullition of methane-containing gas bubbles from near-surface Sphagnum peat. Geophys. Res. Lett. 31. DOI:10.1029/2004GL021157. .. _Baldocchietal2001: +|br| + Baldocchi, D., et al. 2001. FLUXNET: A new tool to study the temporal and spatial variability of ecosystem-scale carbon dioxide, water vapor, and energy flux densities. Bull. Amer. Meteor. Soc. 82:2415-2433. .. _Barbottinetal2005: +|br| + Barbottin, A., Lecomte, C., Bouchard, C., and Jeuffroy, M.-H. 2005. Nitrogen remobilization during grain filling in wheat: Genotypic and environmental effects. Crop Sci. 45:1141-1150. .. _Batjes2006: +|br| + Batjes, N.H., 2006. ISRIC-WISE derived soil properties on a 5 by 5 arc-minutes global grid. Report 2006/02 (available through : http://www.isric.org) .. _Berger1978a: +|br| + Berger, A.L. 1978a. Long-term variations of daily insolation and quaternary climatic changes. J. Atmos. Sci. 35:2362-2367. .. _Berger1978b: +|br| + Berger, A.L. 1978b. A simple algorithm to compute long-term variations of daily or monthly insolation. Contribution de l’Institut d’Astronomie et de Géophysique, Université Catholique de Louvain, Louvain-la-Neuve, @@ -130,27 +179,37 @@ No. 18. .. _Bergeretal1993: +|br| + Berger, A., Loutre, M.-F., and Tricot, C. 1993. Insolation and Earth’s orbital periods. J. Geophys. Res. 98:10341-10362. .. _BerkowitzBalberg1992: +|br| + Berkowitz, B., and Balberg, I. 1992. Percolation approach to the problem of hydraulic conductivity in porous media. Transport in Porous Media 9:275–286. .. _BevenKirkby1979: +|br| + Beven, K.J., and Kirkby, M.J. 1979. A physically based variable contributing area model of basin hydrology. Hydrol. Sci. Bull. 24:43-69. .. _BohrenHuffman1983: +|br| + Bohren, C. F., and Huffman, D. R. 1983. Absorption and scattering of light by small particles. John Wiley & Sons, New York, NY. .. _Bonan1996: +|br| + Bonan, G.B. 1996. A land surface model (LSM version 1.0) for ecological, hydrological, and atmospheric studies: Technical description and user’s guide. NCAR Technical Note NCAR/TN-417+STR, National Center for @@ -158,17 +217,23 @@ Atmospheric Research, Boulder, CO, 150 pp. .. _Bonan1998: +|br| + Bonan, G.B. 1998. The land surface climatology of the NCAR Land Surface Model coupled to the NCAR Community Climate Model. J. Climate 11:1307-1326. .. _Bonan2002: +|br| + Bonan, G.B. 2002. Ecological Climatology: Concepts and Applications. Cambridge University Press. .. _Bonanetal2002a: +|br| + Bonan, G.B., Oleson, K.W., Vertenstein, M., Levis, S., Zeng, X., Dai, Y., Dickinson, R.E., and Yang, Z.-L. 2002a. The land surface climatology of the Community Land Model coupled to the NCAR Community Climate Model. @@ -176,18 +241,24 @@ J. Climate 15: 3123-3149. .. _Bonanetal2002b: +|br| + Bonan, G.B., Levis, S., Kergoat, L., and Oleson, K.W. 2002b. Landscapes as patches of plant functional types: An integrating concept for climate and ecosystem models. Global Biogeochem. Cycles 16: 5.1-5.23. .. _BonanLevis2006: +|br| + Bonan, G.B., and Levis, S. 2006. Evaluating aspects of the Community Land and Atmosphere Models (CLM3 and CAM3) using a dynamic global vegetation model. J. Climate 19:2290-2301. .. _Bonanetal2011: +|br| + Bonan, G.B., Lawrence P.J., Oleson K.W., Levis S., Jung M., Reichstein M., Lawrence, D.M., and Swenson, S.C. 2011. Improving canopy processes in the Community Land Model (CLM4) using global flux fields empirically @@ -196,6 +267,8 @@ DOI:10.1029/2010JG001593. .. _Bonanetal2012: +|br| + Bonan, G. B., Oleson, K.W., Fisher, R.A., Lasslop, G., and Reichstein, M. 2012. Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4, @@ -203,47 +276,65 @@ J. Geophys. Res., 117, G02026. DOI:10.1029/2011JG001913. .. _Bonanetal2014: -Bonan, G.B., Williams, M., Fisher, R.A., and Oleson, K.W. 2014. Modeling -stomatal conductance in the earth system: linking leaf water-use -efficiency and water transport along the soil–plant–atmosphere continuum, +|br| + +Bonan, G.B., Williams, M., Fisher, R.A., and Oleson, K.W. 2014. Modeling +stomatal conductance in the earth system: linking leaf water-use +efficiency and water transport along the soil–plant–atmosphere continuum, Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. .. _Brun1989: +|br| + Brun, E. 1989. Investigation of wet-snow metamorphism in respect of liquid water content. Ann. Glaciol. 13:22-26. .. _Brunkeetal2016: +|br| + Brunke, M. A., P. Broxton, J. Pelletier, D. Gochis, P. Hazenberg, D. M. Lawrence, L. R. Leung, G.-Y. Niu, P. A. Troch, and X. Zeng, 2016: Implementing and Evaluating Variable Soil Thickness in the Community Land Model, Version 4.5 (CLM4.5). J. Clim. 29:3441-3461. .. _Brzosteketal2014: +|br| + Brzostek, E. R., J. B. Fisher, and R. P. Phillips, 2014. Modeling the carbon cost of plant nitrogen acquisition: Mycorrhizal trade-offs and multipath resistance uptake improve predictions of retranslocation. J. Geophys. Res. Biogeosci., 119, 1684–1697, doi:10.1002/2014JG002660. .. _BugmannSolomon2000: +|br| + Bugmann, H., and Solomon, A.M. 2000. Explaining forest composition and biomass across multiple biogeographical regions. Ecol. Appl. 10:95-114. .. _Busing2005: +|br| + Busing, R.T. 2005. Tree mortality, canopy turnover, and woody detritus in old cove forests of the southern Appalachians. Ecology 86:73-84. .. _Buzanetal2015: -Buzan, J.R., Oleson, K., and Huber, M. 2015: Implementation and -comparison of a suite of heat stress metrics within the Community Land +|br| + +Buzan, J.R., Oleson, K., and Huber, M. 2015: Implementation and +comparison of a suite of heat stress metrics within the Community Land Model version 4.5, Geosci. Model Dev., 8, 151-170, doi:10.5194/gmd-8-151-2015. .. _CampbellNorman1998: +|br| + Campbell, G.S., and Norman, J.M. 1998. An Introduction to Environmental Biophysics (2:math:`{}^{nd}` edition). Springer-Verlag, New York. .. _Castilloetal2012: +|br| + Castillo, G., Kendra, C., Levis, S., and Thornton, P. 2012. Evaluation of the new CNDV option of the Community Land Model: effects of dynamic vegetation and interactive nitrogen on CLM4 means and variability. J. @@ -251,25 +342,33 @@ Climate 25:3702–3714. .. _Caoetal1996: +|br| + Cao, M., Marshall, S. and Gregson, K., 1996. Global carbon exchange and methane emissions from natural wetlands: Application of a process-based model. J. Geophys. Res. 101(D9):14,399-14,414. .. _Chuangetal2006: -Chuang Y.L., Oren R., Bertozzi A.L, Phillips N., Katul G.G. 2006. The -porous media model for the hydraulic system of a conifer tree: Linking -sap flux data to transpiration rate, Ecological Modelling, 191, 447-468, +|br| + +Chuang Y.L., Oren R., Bertozzi A.L, Phillips N., Katul G.G. 2006. The +porous media model for the hydraulic system of a conifer tree: Linking +sap flux data to transpiration rate, Ecological Modelling, 191, 447-468, doi:10.1016/j.ecolmodel.2005.03.027. .. _Churkinaetal2003: +|br| + Churkina, G. et al., 2003. Analyzing the ecosystem carbon dynamics of four European coniferous forests using a biogeochemistry model. Ecosystems, 6: 168-184. .. _CIESIN2005: +|br| + CIESIN: Gridded population of the world version 3 (GPWv3), 2005. Population density grids, Technical report, Socioeconomic Data and Applications Center (SEDAC), Columbia University, Palisades, New York, @@ -277,17 +376,23 @@ USA. .. _ClappHornberger1978: +|br| + Clapp, R.B., and Hornberger, G.M. 1978. Empirical equations for some soil hydraulic properties. Water Resour. Res. 14:601-604. .. _ClauserHuenges1995: +|br| + Clauser, C., and Huenges, E. 1995. Thermal conductivity of rocks and minerals. pp. 105-126. In: T. J. Ahrens (editor) Rock Physics and Phase Relations: A Handbook of Physical Constants. Washington, D.C. .. _Clevelandetal1999: +|br| + Cleveland, C.C., Townsend, A.R., Schimel, D.S., Fisher, H., Howarth, R.W., Hedin, L.O., Perakis, S.S., Latty, E.F., Von Fischer, J.C., Elseroad, A., and Wasson, M.F. 1999. Global patterns of terrestrial @@ -296,6 +401,8 @@ Biogeochem. Cycles 13:623-645. .. _Collatzetal1991: +|br| + Collatz, G.J., Ball, J.T., Grivet, C., and Berry, J.A. 1991. Physiological and environmental regulation of stomatal conductance, photosynthesis, and transpiration: A model that includes a laminar @@ -303,23 +410,31 @@ boundary layer. Agric. For. Meteor. 54:107-136. .. _Collatzetal1992: +|br| + Collatz, G.J., Ribas-Carbo, M., and Berry, J.A. 1992. Coupled photosynthesis-stomatal conductance model for leaves of C\ :math:`{}_{4}` plants. Aust. J. Plant Physiol. 19:519-538. .. _Colmer2003: +|br| + Colmer, T.D., 2003. Long-distance transport of gases in plants: a perspective on internal aeration and radial oxygen loss from roots. Plant Cell and Environment 26:17-36. .. _Conwayetal1996: +|br| + Conway, H., Gades, A., and Raymond, C.F. 1996. Albedo of dirty snow during conditions of melt. Water Resour. Res. 32:1713-1718. .. _Cosbyetal1984: +|br| + Cosby, B.J., Hornberger, G.M., Clapp, R.B., and Ginn, T.R. 1984. A statistical exploration of the relationships of soil moisture characteristics to the physical properties of soils. Water Resour. Res. @@ -327,28 +442,38 @@ characteristics to the physical properties of soils. Water Resour. Res. .. _Crawfordetal1982: +|br| + Crawford, T. W., Rendig, V. V., and Broadent, F. E. 1982. Sources, fluxes, and sinks of nitrogen during early reproductive growth of maize (Zea mays L.). Plant Physiol. 70:1645-1660. .. _Dahlinetal2015: +|br| + Dahlin, K., R. Fisher, and P. Lawrence, 2015: Environmental drivers of drought deciduous phenology in the Community Land Model. Biogeosciences, 12:5061-5074. .. _DaiZeng1997: +|br| + Dai, Y., and Zeng, Q. 1997. A land surface model (IAP94) for climate studies. Part I: formulation and validation in off-line experiments. Adv. Atmos. Sci. 14:433-460. .. _Daietal2001: +|br| + Dai, Y., et al. 2001. Common Land Model: Technical documentation and user’s guide [Available online at http://climate.eas.gatech.edu/dai/clmdoc.pdf]. .. _Daietal2003: +|br| + Dai, Y., Zeng, X., Dickinson, R.E., Baker, I., Bonan, G.B., Bosilovich, M.G., Denning, A.S., Dirmeyer, P.A., Houser, P.R., Niu, G., Oleson, K.W., Schlosser, C.A., and Yang, Z.-L. 2003. The Common Land Model. @@ -356,24 +481,32 @@ Bull. Amer. Meteor. Soc. 84:1013-1023. .. _Daietal2004: +|br| + Dai, Y., Dickinson, R.E., and Wang, Y.-P. 2004. A two-big-leaf model for canopy temperature, photosynthesis, and stomatal conductance. J. Climate 17:2281-2299. .. _DaiTrenberth2002: +|br| + Dai, A., and Trenberth, K.E. 2002. Estimates of freshwater discharge from continents: Latitudinal and seasonal variations. J. Hydrometeor. 3:660-687. .. _DeFriesetal2000: +|br| + DeFries, R.S., Hansen, M.C., Townshend, J.R.G., Janetos, A.C., and Loveland, T.R. 2000. A new global 1-km dataset of percentage tree cover derived from remote sensing. Global Change Biol. 6:247-254. .. _DegensSparling1996: +|br| + Degens, B. and Sparling, G., 1996. Changes in aggregation do not correspond with changes in labile organic C fractions in soil amended with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): @@ -381,16 +514,22 @@ with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): .. _deVries1963: +|br| + de Vries, D.A. 1963. Thermal Properties of Soils. In: W.R. van Wijk (editor) Physics of the Plant Environment. North-Holland, Amsterdam. .. _Dickinson1983: +|br| + Dickinson, R.E. 1983. Land surface processes and climate-surface albedos and energy balance. Adv. Geophys. 25:305-353. .. _Dickinsonetal1993: +|br| + Dickinson, R.E., Henderson-Sellers, A., and Kennedy, P.J. 1993. Biosphere-Atmosphere Transfer Scheme (BATS) version 1e as coupled to the NCAR Community Climate Model. NCAR Technical Note NCAR/TN-387+STR. @@ -398,6 +537,8 @@ National Center for Atmospheric Research, Boulder, CO. .. _Dickinsonetal2006: +|br| + Dickinson, R.E., Oleson, K.W., Bonan, G., Hoffman, F., Thornton, P., Vertenstein, M., Yang, Z.-L., and Zeng, X. 2006. The Community Land Model and its climate statistics as a component of the Community Climate @@ -405,22 +546,30 @@ System Model. J. Climate 19:2302-2324. .. _Dingman2002: +|br| + Dingman, S.L. 2002. Physical Hydrology. Second Edition. Prentice Hall, NJ. .. _Dirmeyeretal1999: +|br| + Dirmeyer, P.A., Dolman, A.J., and Sato, N. 1999. The pilot phase of the Global Soil Wetness Project. Bull. Amer. Meteor. Soc. 80:851-878. .. _Dobsonetal2000: +|br| + Dobson, J.E., Bright, E.A., Coleman, P.R., Durfee, R.C., and Worley, B.A. 2000. LandScan: A global population database for estimating populations at risk. Photogramm. Eng. Rem. Sens. 66:849-857. .. _DormanSellers1989: +|br| + Dorman, J.L., and Sellers, P.J. 1989. A global climatology of albedo, roughness length and stomatal resistance for atmospheric general circulation models as represented by the simple biosphere model (SiB). @@ -428,47 +577,63 @@ J. Appl. Meteor. 28:833-855. .. _Doughertyetal1994: +|br| + Dougherty, R.L., Bradford, J.A., Coyne, P.I., and Sims, P.L. 1994. Applying an empirical model of stomatal conductance to three C4 grasses. Agric. For. Meteor. 67:269-290. .. _Drewniaketal2013: +|br| + Drewniak, B., Song, J., Prell, J., Kotamarthi, V.R., and Jacob, R. 2013. Modeling agriculture in the Community Land Model. Geosci. Model Dev. 6:495-515. DOI:10.5194/gmd-6-495-2013. .. _Dunfieldetal1993: +|br| + Dunfield, P., Knowles, R., Dumont, R. and Moore, T.R., 1993. Methane Production and Consumption in Temperate and Sub-Arctic Peat Soils - Response to Temperature and Ph. Soil Biology & Biochemistry 25:321-326. .. _EntekhabiEagleson1989: +|br| + Entekhabi, D., and Eagleson, P.S. 1989. Land surface hydrology parameterization for atmospheric general circulation models including subgrid scale spatial variability. J. Climate 2:816-831. .. _FangStefan1996: +|br| + Fang, X. and Stefan, H.G., 1996. Long-term lake water temperature and ice cover simulations/measurements. Cold Regions Science and Technology 24:289-304. .. _Farouki1981: +|br| + Farouki, O.T. 1981. The thermal properties of soils in cold regions. Cold Regions Sci. and Tech. 5:67-75. .. _Farquharetal1980: +|br| + Farquhar, G.D., von Caemmerer, S., and Berry, J.A. 1980. A biochemical model of photosynthetic CO\ :sub:`2` assimilation in leaves of C\ :math:`{}_{3}` species. Planta 149:78-90. .. _FarquharvonCaemmerer1982: +|br| + Farquhar, G.D., and von Caemmerer, S. 1982. Modeling of photosynthetic response to environmental conditions. pp. 549-587. In: O.L. Lange, P.S. Nobel, C.B. Osmond, and H. Zeigler (editors) Encyclopedia of Plant @@ -477,48 +642,66 @@ and Carbon Assimilation. Springer-Verlag, New York. .. _Ferrari1999: +|br| + Ferrari, J.B., 1999. Fine-scale patterns of leaf litterfall and nitrogen cycling in an old-growth forest. Canadian Journal of Forest Research, 29: 291-302. .. _FirestoneDavidson1989: +|br| + Firestone, M.K. and Davidson, E.A. 1989. Exchange of Trace Gases between Terrestrial Ecosystems and the Atmosphere. In: M.O. Andreae and D.S. Schimel (Editors). John Wiley and Sons, pp. 7-21. .. _Fisheretal2015: +|br| + Fisher, R. A., S. Muszala, M. Verteinstein, P. Lawrence, C. Xu, N. G. McDowell, R. G. Knox, C. Koven, J. Holm, B. M. Rogers, A. Spessa, D. Lawrence, and G. Bonan, 2015: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED). Geosci. Model Dev., 8: 3593-3619, doi:10.5194/gmd-8-3593-2015. .. _Fisheretal2010: +|br| + Fisher, J. B., S. Sitch, Y. Malhi, R. A. Fisher, C. Huntingford, and S.-Y. Tan, 2010. Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation. Global Biogeochem. Cycles, 24, GB1014, doi:10.1029/2009GB003621. .. _FlannerZender2005: +|br| + Flanner, M.G., and Zender. C.S. 2005. Snowpack radiative heating: Influence on Tibetan Plateau climate. Geophys. Res. Lett. 32:L06501. DOI:10.1029/2004GL022076. .. _FlannerZender2006: +|br| + Flanner, M.G., and Zender, C.S. 2006. Linking snowpack microphysics and albedo evolution. J. Geophys. Res. 111:D12208. DOI:10.1029/2005JD006834. .. _Flanneretal2007: +|br| + Flanner, M.G., Zender, C.S., Randerson, J.T., and Rasch, P.J. 2007. Present day climate forcing and response from black carbon in snow. J. Geophys. Res. 112:D11202. DOI:10.1029/2006JD008003. .. _Flatauetal1992: +|br| + Flatau, P.J., Walko, R.L., and Cotton, W.R. 1992. Polynomial fits to saturation vapor pressure. J. Appl. Meteor. 31:1507-1513. .. _Friedl,etal2002: +|br| + Friedl, M.A., McIver, D.K., Hodges, J.C.F., Zhang, X.Y., Muchoney, D., Strahler, A.H., Woodcock, C.E., Gopal, S., Schneider, A., Cooper, A., Baccini, A., Gao, F., and Schaaf, C. 2002. Global land cover mapping @@ -527,17 +710,23 @@ from MODIS: algorithms and early results. Remote Sens. Environ. .. _Frolkingetal2001: +|br| + Frolking, S., et al. 2001. Modeling Northern Peatland Decomposition and Peat Accumulation. Ecosystems. 4:479-498. .. _Gallaisetal2006: +|br| + Gallais, A., Coque, M. Quillere, I., Prioul, J., and Hirel, B. 2006. Modeling postsilking nitrogen fluxes in maize (Zea mays) using 15N-labeling field experiments. New Phytologist 172:696-707. .. _Gallaisetal2007: +|br| + Gallais, A., Coque, M., Gouis, J. L., Prioul, J. L., Hirel, B., and Quillere, I. 2007. Estimating the proportion of nitrogen remobilization and of postsilking nitrogen uptake allocated to maize kernels by @@ -545,11 +734,15 @@ Nitrogen-15 labeling. Crop Sci. 47:685-693. .. _Gallowayetal2004: +|br| + Galloway, J.N., et al. 2004. Nitrogen cycles: past, present, and future. Biogeochem. 70:153-226. .. _Garciaetal1988: +|br| + Garcia, R.L., Kanemasu, E.T., Blad, B.L., Bauer, A., Hatfield, J.L., Major, D.A., Reginato, R.J., and Hubbard, K.G. 1988. Interception and use efficiency of light in winter wheat under different nitrogen @@ -557,11 +750,15 @@ regimes. Agric. For. Meteor. 44:175-186. .. _Gardner1960: -Gardner, W. R. 1960. Dynamic aspects of water availability to plants, +|br| + +Gardner, W. R. 1960. Dynamic aspects of water availability to plants, Soil Sci., 89, 63–73. .. _Gashetal1996: +|br| + Gash, J.H.C., Nobre, C.A., Roberts, J.M., and Victoria, R.L. 1996. An overview of ABRACOS. pp. 1-14. In: J.H.C. Gash, C.A. Nobre, J.M. Roberts, and R.L. Victoria (editors) Amazonian Deforestation and @@ -569,16 +766,22 @@ Climate. John Wiley and Sons, Chichester, England. .. _Getiranaetal2012: +|br| + Getirana, A. C. V., A. Boone, D. Yamazaki, B. Decharme, F. Papa, and N. Mognard. 2012. The hydrological modeling and analysis platform (HyMAP): Evaluation in the Amazon basin, J. Hydrometeorol., 13, 1641-1665. .. _Ghimireetal2016: +|br| + Ghimire, B., W. J. Riley, C. D. Koven, M. Mu, and J. T. Randerson, 2016: Representing leaf and root physiological traits in CLM improves global carbon and nitrogen cycling predictions. J. Adv. Mod. Earth Sys. 8: 598-613. .. _Gholzetal1985: +|br| + Gholz, H.L., Perry, C.S., Cropper, W.P., Jr. and Hendry, L.C., 1985. Litterfall, decomposition, and nitrogen and phosphorous dynamics in a chronosequence of slash pine (*Pinus elliottii*) plantations. Forest @@ -586,6 +789,8 @@ Science, 31: 463-478. .. _Giglioetal2006: +|br| + Giglio, L., Csiszar, I., and Justice, C.O. 2006. Global distribution and seasonality of active fires as observed with the Terra and Aqua Moderate Resolution Imaging Spectroradiometer (MODIS) sensors. J. Geophys. Res. @@ -593,24 +798,32 @@ Resolution Imaging Spectroradiometer (MODIS) sensors. J. Geophys. Res. .. _GlobalSoilDataTask2000: +|br| + Global Soil Data Task 2000. Global soil data products CD-ROM (IGBP-DIS). International Geosphere-Biosphere Programme-Data and Information Available Services [Available online at http://www.daac.ornl.gov]. .. _Gomesetal2003: +|br| + Gomes, E.P.C., Mantovani, W., and Kageyama, P.Y. 2003. Mortality and recruitment of trees in a secondary montane rain forest in southeastern Brazil. Brazilian Journal of Biology 63:47-60. .. _Goszetal1973: +|br| + Gosz, J.R., Likens, G.E., and Bormann, F.H. 1973. Nutrient release from decomposing leaf and branch litter in the Hubbard Brook Forest, New Hampshire. Ecological Monographs 43:173-191. .. _GotangcoCastilloetal2012: +|br| + Gotangco Castillo C., Levis S., and Thornton P. 2012. Evaluation of the new CNDV option of the Community Land Model: Effects of dynamic vegetation and interactive nitrogen on CLM4 means and variability. J. @@ -618,29 +831,39 @@ Climate 25:3702-3714. DOI:10.1175/JCLID-11-00372.1. .. _Grahametal1999: +|br| + Graham, S.T., Famiglietti, J.S., and Maidment, D.R. 1999. Five-minute, 1/2º, and 1º data sets of continental watersheds and river networks for use in regional and global hydrologic and climate system modeling studies. Water Resour. Res. 35:583-587. -.. _Gravenetal2017: +.. _Gravenetal2017: + +|br| Graven, H., C. E. Allison, D. M. Etheridge, S. Hammer, R. F. Keeling, I. Levin, H. A. J. Meijer, M. Rubino, P. P. Tans, C. M. Trudinger, B. H. Vaughn and J. W. C. White (2017) Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geoscientific Model Development, in review. doi: 10.5194/gmd-2017-166. .. _GrenfellWarren1999: +|br| + Grenfell, T.C., and Warren, S.G. 1999. Representation of a nonspherical ice particle by a collection of independent spheres for scattering and absorption of radiation. J. Geophys. Res. 104(D24):37697-37709. .. _delGrossoetal2000: +|br| + del Grosso, S.J., et al. 2000. General model for N2O and N2 gas emissions from soils due to dentrification. Global Biogeochem. Cycles 14:1045-1060. .. _Guentheretal1995: +|br| + Guenther, A., Hewitt, C.N., Erickson, D., Fall, R., Geron, C., Graedel, T., Harley, P., Klinger, L., Lerdau, M., McKay, W.A., Pierce, T., Scholes, B., Steinbrecher, R., Tallamraju, R., Taylor, J., and @@ -649,6 +872,8 @@ emissions. J. Geophys. Res. 100:8873-8892. .. _Guentheretal2006: +|br| + Guenther, A., Karl, T., Harley, P., Wiedinmyer, C., Palmer. P.I., and Geron, C. 2006. Estimates of global terrestrial isoprene emissions using MEGAN (Model of Emissions of Gases and Aerosols from Nature). Atmos. @@ -656,6 +881,8 @@ Chem. Phys. 6:3181–3210. .. _Guentheretal2012: +|br| + Guenther, A. B., Jiang, X., Heald, C. L., Sakulyanontvittaya, T., Duhl, T., Emmons, L. K., & Wang, X., 2012. The Model of Emissions of Gases and Aerosols from Nature version 2.1 (MEGAN2.1): an extended and updated @@ -664,6 +891,8 @@ framework for modeling biogenic emissions, Geosci. Model Dev., 5, .. _Hacketal2006: +|br| + Hack, J.J., Caron, J.M., Yeager, S.G., Oleson, K.W., Holland, M.M., Truesdale, J.E., and Rasch, P.J. 2006. Simulation of the global hydrological cycle in the CCSM Community Atmosphere Model version 3 @@ -671,6 +900,8 @@ hydrological cycle in the CCSM Community Atmosphere Model version 3 .. _Hansenetal2003: +|br| + Hansen, M., DeFries, R.S., Townshend, J.R.G., Carroll, M., Dimiceli, C., and Sohlberg, R.A. 2003. Global percent tree cover at a spatial resolution of 500 meters: first results of the MODIS vegetation @@ -678,6 +909,8 @@ continuous fields algorithm. Earth Interactions 7:1-15. .. _Hastingsetal1999: +|br| + Hastings, D.A., Dunbar, P.K., Elphingstone, G.M., Bootz, M., Murakami, H., Maruyama, H., Masaharu, H., Holland, P., Payne, J., Bryant, N.A., Logan, T.L., Muller, J.-P., Schreier, G., and MacDonald, J.S., eds., @@ -688,6 +921,8 @@ Colorado 80305-3328, U.S.A. .. _Healdetal2008: +|br| + Heald, C.L., Henze, D.K., Horowitz, L.W., Feddema, J., Lamarque, J.-F., Guenther, A., Hess, P.G., Vitt, F., Seinfeld, J.H., Goldstein, A.H., and Fung, I. 2008. Predicted change in global secondary organic aerosol @@ -696,6 +931,8 @@ change. J. Geophys. Res. 113:D05211. DOI:10.1029/2007JD009092. .. _Healdetal2009: +|br| + Heald, C.L., Wilkinson, M.J., Monson, R.K., Alo, C.A., Wang, G.L., and Guenther, A. 2009. Response of isoprene emission to ambient CO\ :sub:`2` changes and implications for global budgets. Global @@ -703,40 +940,54 @@ Change Biol. 15:1127-1140. DOI:10.1111/j.1365-2486.2008.01802.x .. _Henderson-Sellers1985: +|br| + Henderson-Sellers, B. 1985. New formulation of eddy diffusion thermocline models. Appl. Math. Modelling 9:441-446. .. _Henderson-Sellers1986: +|br| + Henderson-Sellers, B. 1986. Calculating the surface energy balance for lake and reservoir modeling: A review. Rev. Geophys. 24:625-649. .. _Henderson-Sellersetal1993: +|br| + Henderson-Sellers, A., Yang, Z.-L., and Dickinson, R.E. 1993. The project for intercomparison of land-surface parameterization schemes. Bull. Amer. Meteor. Soc. 74: 1335-1349. .. _HostetlerBartlein1990: +|br| + Hostetler, S.W., and Bartlein, P.J. 1990. Simulation of lake evaporation with application to modeling lake level variations of Harney-Malheur Lake, Oregon. Water Resour. Res. 26:2603-2612. .. _Hostetleretal1993: +|br| + Hostetler, S.W., Bates, G.T., and Giorgi, F. 1993. Interactive coupling of a lake thermal model with a regional climate model. J. Geophys. Res. 98:5045-5057. .. _Hostetleretal1994: +|br| + Hostetler, S.W., Giorgi, F., Bates, G.T., and Bartlein, P.J. 1994. Lake-atmosphere feedbacks associated with paleolakes Bonneville and Lahontan. Science 263:665-668. .. _Houetal2012: +|br| + Hou, Z., Huang, M., Leung, L.R., Lin, G., and Ricciuto, D.M. 2012. Sensitivity of surface flux simulations to hydrologic parameters based on an uncertainty quantification framework applied to the Community Land @@ -744,10 +995,14 @@ Model. J. Geophys. Res. 117:D15108. .. _Houltonetal2008: +|br| + Houlton, B.Z., Wang, Y.P., Vitousek, P.M. and Field, C.B., 2008. A unifying framework for dinitrogen fixation in the terrestrial biosphere. Nature, 454(7202), p.327. .. _HuangLiang2006: +|br| + Huang, M., and Liang, X. 2006. On the assessment of the impact of reducing parameters and identification of parameter uncertainties for a hydrologic model with applications to ungauged basins. J. Hydrol. @@ -755,6 +1010,8 @@ hydrologic model with applications to ungauged basins. J. Hydrol. .. _Hugeliusetal2012: +|br| + Hugelius, G., C. Tarnocai, G. Broll, J.G. Canadell, P. Kuhry, adn D.K. Swanson, 2012. The Northern Circumpolar Soil Carbon Database: spatially distributed datasets of soil coverage and soil carbon storage in the @@ -763,18 +1020,24 @@ northern permafrost regions. Earth Syst. Sci. Data Discuss., 5, 707-733 .. _Huntetal1988: +|br| + Hunt, H.W., Ingham, E.R., Coleman, D.C., Elliott, E.T., and Reid, C.P.P. 1988. Nitrogen limitation of production and decomposition in prairie, mountain meadow, and pine forest. Ecology 69:1009-1016. .. _HuntRunning1992: +|br| + Hunt, E.R., Jr. and Running, S.W., 1992. Simulated dry matter yields for aspen and spruce stands in the north american boreal forest. Canadian Journal of Remote Sensing, 18: 126-133. .. _Huntetal1996: +|br| + Hunt, E.R., Jr. et al., 1996. Global net carbon exchange and intra-annual atmospheric CO\ :sub:`2` concentrations predicted by an ecosystem process model and three-dimensional atmospheric transport @@ -782,6 +1045,8 @@ model. Global Biogeochemical Cycles, 10: 431-456. .. _Hurttetal2006: +|br| + Hurtt, G.C., Frolking, S., Fearon, M.G., Moore, B., Shevliakova, E., Malyshev, S., Pacala, S.W., and Houghton, R.A. 2006. The underpinnings of land-use history: three centuries of global gridded land-use @@ -790,6 +1055,8 @@ Global Change Biol. 12:1208-1229. .. _Hurttetal2011: +|br| + Hurtt, G.C., et al. 2011. Harmonization of land-use scenarios for the period 1500-2100: 600 years of global gridded annual land-use transitions, wood harvest, and resulting secondary lands. Climatic @@ -797,23 +1064,31 @@ Change 109:117-161. DOI:10.1007/s10584-011-0153-2. .. _Idso1981: +|br| + Idso, S.B. 1981. A set of equations for full spectrum and 8- to 14-\ :math:`\mu` \ m and 10.5- to 12.5-\ :math:`\mu` \ m thermal radiation from cloudless skies. Water Resour. Res. 17:295-304. .. _IiyamaHasegawa2005: +|br| + Iiyama, I. and Hasegawa, S., 2005. Gas diffusion coefficient of undisturbed peat soils. Soil Science and Plant Nutrition 51:431-435. .. _Jacksonetal1996: +|br| + Jacksonetal1996: E., and Schulze, E. D. 1996. A global analysis of root distributions for terrestrial biomes Oecologia 108:389–411. DOI:10.1007/BF00333714. .. _Jacksonetal2010: +|br| + Jackson, T.L., Feddema, J.J., Oleson, K.W., Bonan, G.B., and Bauer, J.T. 2010. Parameterization of urban characteristics for global climate modeling. Annals of the Association of American Geographers. @@ -821,24 +1096,32 @@ modeling. Annals of the Association of American Geographers. .. _JenkinsonColeman2008: +|br| + Jenkinson, D. and Coleman, K. 2008. The turnover of organic carbon in subsoils. Part 2. Modelling carbon turnover. European Journal of Soil Science 59:400-413. .. _Jordan1991: +|br| + Jordan, R. 1991. A One-dimensional Temperature Model for a Snow Cover: Technical Documentation for SNTHERM.89. U.S. Army Cold Regions Research and Engineering Laboratory, Special Report 91-16. .. _KattgeKnorr2007: +|br| + Kattge, J., and Knorr, W. 2007. Temperature acclimation in a biochemical model of photosynthesis: a reanalysis of data from 36 species. Plant Cell Environ. 30:1176-1190. DOI:10.1111/j.1365-3040.2007.01690.x. .. _Kattgeetal2009: +|br| + Kattge, J., Knorr, W., Raddatz, T., and Wirth C. 2009: Quantifying photosynthetic capacity and its relationship to leaf nitrogen content for global–scale terrestrial biosphere models. Global Change Biol. @@ -846,18 +1129,24 @@ for global–scale terrestrial biosphere models. Global Change Biol. .. _Kavetskietal2002: -Kavetski, D., Binning, P. and Sloan, S.W., 2002. Noniterative time -stepping schemes with adaptive truncation error control for the +|br| + +Kavetski, D., Binning, P. and Sloan, S.W., 2002. Noniterative time +stepping schemes with adaptive truncation error control for the solution of Richards equation. Water Resources Research, 38(10). .. _Kelleretal2004: +|br| + Keller, M., Palace, M., Asner, G.P., Pereira, R., Jr. and Silva, J.N.M., 2004. Coarse woody debris in undisturbed and logged forests in the eastern Brazilian Amazon. Global Change Biology, 10: 784-795. .. _Kellneretal2006: +|br| + Kellner, E., Baird, A.J., Oosterwoud, M., Harrison, K. and Waddington, J.M., 2006. Effect of temperature and atmospheric pressure on methane (CH4) ebullition from near-surface peats. Geophys. Res. Lett. 33. @@ -865,24 +1154,32 @@ DOI:10.1029/2006GL027509. .. _Kimballetal1997: +|br| + Kimball, J.S., Thornton, P.E., White, M.A. and Running, S.W. 1997. Simulating forest productivity and surface-atmosphere exchange in the BOREAS study region. Tree Physiology 17:589-599. .. _Kohyamaetal2001: +|br| + Kohyama, T., Suzuki, E., Partomihardjo, T., and Yamada, T. 2001. Dynamic steady state of patch-mosaic tree size structure of a mixed diptocarp forest regulated by local crowding. Ecological Research 16:85-98. .. _Kourzeneva2009: +|br| + Kourzeneva, E., 2009. Global dataset for the parameterization of lakes in Numerical Weather Prediction and Climate modeling. ALADIN Newsletter, No 37, July-December, 2009, F. Bouttier and C. Fischer, Eds., Meteo-France, Toulouse, France, 46-53. -.. _Kourzeneva2010: +.. _Kourzeneva2010: + +|br| Kourzeneva, E., 2010: External data for lake parameterization in Numerical Weather Prediction and climate modeling. Boreal Environment @@ -890,30 +1187,40 @@ Research, 15, 165-177. .. _Kourzenevaetal2012: +|br| + Kourzeneva, E., Asensio, H., Martin, E. and Faroux, S., 2012. Global gridded dataset of lake coverage and lake depth for use in numerical weather prediction and climate modelling. Tellus A 64. .. _Kovenetal2009: +|br| + Koven, C., et al. 2009. On the formation of high-latitude soil carbon stocks: The effects of cryoturbation and insulation by organic matter in a land surface model. Geophys. Res. Lett. 36: L21501. .. _Kovenetal2011: +|br| + Koven, C.D., et al. 2011. Permafrost carbon-climate feedbacks accelerate global warming. Proceedings of the National Academy of Sciences 108:14769-14774. .. _Kovenetal2013: +|br| + Koven, C.D. et al. 2013. The effect of vertically-resolved soil biogeochemistry and alternate soil C and N models on C dynamics of CLM4. Biogeosciences Discussions 10:7201-7256. .. _Kovenetal2015: +|br| + Koven, C.D. et al. 2015. Permafrost carbon-climate feedback is sensitive to deep soil carbon decomposability but not deep soil nitrogen dynamics. Proceedings of the National Academies of Science, @@ -921,10 +1228,14 @@ nitrogen dynamics. Proceedings of the National Academies of Science, .. _Kovenetal2017: +|br| + Koven, C.D., G. Hugelius, D.M. Lawrence, and W.R. Wieder, 2017: Higher climatological temperature sensitivity of soil carbon in cold than warm climates. Nature Clim. Change, 7, doi:10.1038/nclimate3421. .. _Kuchariketal2000: +|br| + Kucharik, C.J., Foley, J.A., Delire, C., Fisher, V.A., Coe, M.T., Lenters, J.D., Young-Molling, C., and Ramankutty, N. 2000. Testing the performance of a dynamic global ecosystem model: water balance, carbon @@ -933,6 +1244,8 @@ balance, and vegetation structure. Global Biogeochem. Cycles 14: .. _KucharikBrye2003: +|br| + Kucharik, C.J., and Brye, K.R. 2003. Integrated BIosphere Simulator (IBIS) yield and nitrate loss predictions for Wisconsin maize receiving varied amounts of nitrogen fertilizer. Journal of Environmental Quality @@ -940,6 +1253,8 @@ varied amounts of nitrogen fertilizer. Journal of Environmental Quality .. _Laddetal2992: +|br| + Ladd, J.N., Jocteur-Monrozier, L. and Amato, M., 1992. Carbon turnover and nitrogen transformations in an alfisol and vertisol amended with [U-:math:`{}^{14}`\ C] glucose and [:math:`{}^{15}`\ N] ammonium @@ -947,6 +1262,8 @@ sulfate. Soil Biology and Biochemistry, 24: 359-371. .. _Lamarqueetal2010: +|br| + Lamarque, J.-F., et al. 2010. Historical (1850-2000) gridded anthropogenic and biomass burning emissions of reactive gases and aerosols: methodology and application. Atmos. Chem. Phys. Discuss. @@ -954,23 +1271,31 @@ aerosols: methodology and application. Atmos. Chem. Phys. Discuss. .. _Larcher1995: +|br| + Larcher, W. 1995. Physiological Plant Ecology, Springer-Verlag, Berlin Heidelberg. .. _LavigneRyan1997: +|br| + Lavigne, M.B., and Ryan, M.G. 1997. Growth and maintenance respiration rates of aspen, black spruce, and jack pine stems at northern and southern BOREAS sites. Tree Phys. 17:543-551. .. _Lawetal2003: +|br| + Law, B.E., Sun, O.J., Campbell, J., Van Tuyl, S. and Thornton, P.E. 2003. Changes in carbon storage and fluxes in a chronosequence of ponderosa pine. Global Change Biology, 9: 510-514. .. _Lawrenceetal2007: +|br| + Lawrence, D.M., Thornton, P.E., Oleson, K.W., and Bonan, G.B. 2007. The partitioning of evapotranspiration into transpiration, soil evaporation, and canopy evaporation in a GCM: Impacts on land-atmosphere interaction. @@ -978,11 +1303,15 @@ J. Hydrometeor. 8:862-880. .. _LawrenceSlater2008: +|br| + Lawrence, D.M., and Slater, A.G. 2008. Incorporating organic soil into a global climate model. Clim. Dyn. 30. DOI:10.1007/s00382-007-0278-1. .. _Lawrenceetal2008: +|br| + Lawrence, D.M., Slater, A.G., Romanovsky, V.E., and Nicolsky, D.J. 2008. The sensitivity of a model projection of near-surface permafrost degradation to soil column depth and inclusion of soil organic matter. @@ -990,6 +1319,8 @@ J. Geophys. Res. 113:F02011. DOI:10.1029/2007JF000883. .. _Lawrenceetal2011: +|br| + Lawrence, D.M., K.W. Oleson, M.G. Flanner, P.E. Thornton, S.C. Swenson, P.J. Lawrence, X. Zeng, Z.-L. Yang, S. Levis, K. Sakaguchi, G.B. Bonan, and A.G. Slater, 2011. Parameterization improvements and functional and @@ -998,27 +1329,35 @@ Model. Earth Sys. 3. DOI:10.1029/2011MS000045. .. _Lawrenceetal2016: -Lawrence, D.M., Hurtt, G.C., Arneth, A., Brovkin, V., Calvin, K.V., +|br| + +Lawrence, D.M., Hurtt, G.C., Arneth, A., Brovkin, V., Calvin, K.V., Jones, A.D., Jones, C.D., Lawrence, P.J., de Noblet-Ducoudré, N., Pongratz, -J., Seneviratne, S.I., and Shevliakova, E. 2016. The Land Use Model +J., Seneviratne, S.I., and Shevliakova, E. 2016. The Land Use Model Intercomparison Project (LUMIP) contribution to CMIP6: rationale and experimental design. Geosci. Model Dev. 9:2973-2998. -DOI:10.5194/gmd-9-2973-2016. +DOI:10.5194/gmd-9-2973-2016. .. _LawrenceChase2007: +|br| + Lawrence, P.J., and Chase, T.N. 2007. Representing a MODIS consistent land surface in the Community Land Model (CLM 3.0). J. Geophys. Res. 112:G01023. DOI:10.1029/2006JG000168. .. _LawrenceChase2010: +|br| + Lawrence, P.J., and Chase, T.N. 2010. Investigating the climate impacts of global land cover change in the Community Climate System Model. Int. J. Climatol. 30:2066-2087. DOI:10.1002/joc.2061. .. _Lawrenceetal2012: +|br| + Lawrence, P.J., et al. 2012. Simulating the biogeochemical and biogeophysical impacts of transient land cover change and wood harvest in the Community Climate System Model (CCSM4) from 1850 to 2100. J. @@ -1026,16 +1365,22 @@ Climate 25:3071-3095. DOI:10.1175/JCLI-D-11-00256.1. .. _LehnerDoll2004: +|br| + Lehner, B. and Döll, P., 2004. Development and validation of a global database of lakes, reservoirs and wetlands, J. Hydrol., 296, 1–22. .. _Lehneretal2008: +|br| + Lehner, B., Verdin, K. and Jarvis, A., 2008. New global hydrograhy derived from spaceborne elevation data. Eos Trans., AGU, 89, 93 – 94. .. _LePageetal2010: +|br| + Le Page, Y., van der Werf, G.R., Morton, D.C., and Pereira, J.M.C. 2010. Modeling fire-driven deforestation potential in Amazonia under current and projected climate conditions. J. Geophys. Res. 115:G03012. @@ -1043,17 +1388,23 @@ DOI:10.1029/2009JG001190. .. _Lerman1979: +|br| + Lerman, A., 1979. Geochemical processes: Water and sediment environments. John Wiley and Sons, New York, N.Y. .. _Lettsetal2000: +|br| + Letts, M.G., Roulet, N.T., Comer, N.T., Skarupa, M.R., and Verseghy, D.L. 2000. Parametrization of peatland hydraulic properties for the Canadian Land Surface Scheme. Atmos.-Ocean 38:141-160. .. _Levisetal2003: +|br| + Levis, S., Wiedinmyer, C., Bonan, G.B., and Guenther, A. 2003. Simulating biogenic volatile organic compound emissions in the Community Climate System Model. J. Geophys. Res. 108:4659. @@ -1061,6 +1412,8 @@ DOI:10.1029/2002JD003203. .. _Levisetal2004: +|br| + Levis, S., Bonan, G.B., Vertenstein, M., and Oleson, K.W. 2004. The community land model’s dynamic global vegetation model (CLM-DGVM): technical description and user’s guide. NCAR Technical Note @@ -1069,12 +1422,16 @@ Colorado. 50 pp. .. _Levisetal2009: +|br| + Levis, S., Thornton, P., Bonan, G., and Kucharik, C. 2009. Modeling land use and land management with the Community Land Model. iLeaps newsletter, No. 7. .. _Levisetal2012: +|br| + Levis, S., Bonan, G., Kluzek, E., Thornton, P., Jones, A., Sacks, W., and Kucharik, C 2012. Interactive crop management in the Community Earth System Model (CESM1): Seasonal influences on land-atmosphere fluxes. J. @@ -1082,24 +1439,32 @@ Climate 25: 4839-4859. DOI:10.1175/JCLI-D-11-00446.1. .. _Levisetal2016: +|br| + Levis, S., Badger, A., Drewniak, B., Nevison, C., Ren, X. 2016. CLMcrop yields and water requirements: avoided impacts by choosing RCP 4.5 over 8.5. -Climatic Change. DOI:10.1007/s10584-016-1654-9. +Climatic Change. DOI:10.1007/s10584-016-1654-9. .. _Lietal2000: +|br| + Li, C., Aber, J., Stange, F., Butterbach-Bahl, K. and Papen, H. 2000. A process-oriented model of N2O and NO emissions from forest soils: 1. Model development. J. Geophys. Res. 105(D4):4369-4384. .. _Lietal2012a: +|br| + Li, F., Zeng, X.-D., and Levis, S. 2012a. A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model. Biogeosciences 9:2761-2780. .. _Lietal2012b: +|br| + Li, F., Zeng, X. D., and Levis, S. 2012b. Corrigendum to “A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model†published in Biogeosciences, 9, @@ -1107,18 +1472,24 @@ Dynamic Global Vegetation Model†published in Biogeosciences, 9, .. _Lietal2013a: +|br| + Li, F., Levis, S., and Ward, D. S. 2013a. Quantifying the role of fire in the Earth system – Part 1: Improved global fire modeling in the Community Earth System Model (CESM1). Biogeosciences 10:2293-2314. .. _LiLawrence2017: -Li, F., and Lawrence, D. 2017. Role of fire in the global land water -budget during the 20th century through changing ecosystems. +|br| + +Li, F., and Lawrence, D. 2017. Role of fire in the global land water +budget during the 20th century through changing ecosystems. J. Clim. 30: 1894-1908. .. _Lietal2013b: +|br| + Li, H.-Y., Huang, M., Tesfa, T., Ke, Y., Sun, Y., Liu, Y., and Leung, L. R. 2013b. A subbasin-based framework to represent land surface processes in an Earth System Model, Geosci. Model Dev. Discuss. 6:2699-2730. @@ -1126,6 +1497,8 @@ DOI:10.5194/gmdd-6-2699-2013. .. _Lietal2011: +|br| + Li, H., Huang, M., Wigmosta, M.S., Ke, Y., Coleman, A.M., Leung, L.R., Wang, A., and Ricciuto, D.M. 2011. Evaluating runoff simulations from the Community Land Model 4.0 using observations from flux towers and a @@ -1134,13 +1507,17 @@ DOI:10.1029/2011JD016276. .. _Lietal2015a: -Li, H., L. Leung, A. Getirana, M. Huang, H. Wu, Y. Xu, J. Guo and -N. Voisin. 2015a. Evaluating global streamflow simulations by a -physically-based routing model coupled with the Community Land Model, +|br| + +Li, H., L. Leung, A. Getirana, M. Huang, H. Wu, Y. Xu, J. Guo and +N. Voisin. 2015a. Evaluating global streamflow simulations by a +physically-based routing model coupled with the Community Land Model, J. of Hydromet., 16(2):948-971, doi: 10.1175/JHM-D-14-0079.1 .. _Lietal2015b: +|br| + Li, H., L. Leung, T. Tesfa, N. Voisin, M. Hejazi, L. Liu, Y. Liu, J. Rice, H. Wu, and X. Yang. 2015. Modeling stream temperature in the Anthropocene: An earth system modeling approach, J. Adv. Model. @@ -1148,41 +1525,55 @@ Earth Syst., 7, doi:10.1002/2015MS000471. .. _Liangetal1994: +|br| + Liang, X., Lettenmaier, D.P., Wood, E.F., and Burges, S.J. 1994. A simple hydrologically based model of land surface water and energy fluxes for GSMs. J. Geophys. Res. 99(D7):14,415–14,428. .. _LipscombSacks2012: +|br| + Lipscomb, W., and Sacks, W. 2012. The CESM land ice model documentation and user’s guide. 46 pp. [Available online at http://www.cesm.ucar.edu/models/cesm1.1/cism/]. .. _LloydTaylor1994: +|br| + Lloyd, J. and Taylor, J.A., 1994. On the temperature dependence of soil respiration. Functional Ecology, 8: 315-323. .. _Lloydetal2010: +|br| + Lloyd, J., et al. 2010. Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees. Biogeosci. 7:1833-1859. DOI:10.5194/bg-7-1833-2010. .. _Lobelletal2006: +|br| + Lobell, D.B., Bala, G., and Duffy, P.B. 2006. Biogeophysical impacts of cropland management changes on climate. Geophys. Res. Lett. 33:L06708. DOI:10.1029/2005GL025492. .. _Lombardozzietal2015: +|br| + Lombardozzi, D.L., Bonan, G.B., Smith, N.G., Dukes, J.S. 2015. Temperature -acclimation of photosynthesis and respiration: A key uncertainty in the +acclimation of photosynthesis and respiration: A key uncertainty in the carbon cycle-climate feedback. Geophys. Res. Lett. 42:8624-8631. .. _Lovelandetal2000: +|br| + Loveland, T.R., Reed, B.C., Brown, J.F., Ohlen, D.O., Zhu, Z., Yang, L., and Merchant, J.W. 2000. Development of a global land cover characteristics database and IGBP DISCover from 1 km AVHRR data. Int. J. @@ -1190,23 +1581,31 @@ Remote Sens. 21:1303-1330. .. _Lowe1977: +|br| + Lowe, P.R. 1977. An approximating polynomial for the computation of saturation vapor pressure. J. Appl. Meteor. 16:100-103. .. _Luoetal2006: +|br| + Luo, Y., Hui, D., and Zhang, D. 2006. Elevated CO2 stimulates net accumulations of carbon and nitrogen in land ecosystems: a meta-analysis. Ecology 87:53-63. .. _Magilletal1997: +|br| + Magill, A.H. et al., 1997. Biogeochemical response of forest ecosystems to simulated chronic nitrogen deposition. Ecological Applications, 7: 402-415. .. _Mahowaldetal2006: +|br| + Mahowald, N.M., Muhs, D.R., Levis, S., Rasch, P.J., Yoshioka, M., Zender, C.S., and Luo, C. 2006. Change in atmospheric mineral aerosols in response to climate: last glacial period, pre-industrial, modern and @@ -1215,17 +1614,23 @@ DOI:10.1029/2005JD006653. .. _Makela2002: +|br| + Makela, A. 2002. Derivation of stem taper from the pipe model theory in a carbon balance framework. Tree Phys. 22:891-905. .. _Maoetal2012: +|br| + Mao, J., Thornton, P.E., Shi, X., Zhao, M., and Post, W.M. 2012. Remote sensing evaluation of CLM4 GPP for the period 2000 to 2009. J. Climate 25:5327-5342. .. _Maoetal2013: +|br| + Mao, J., Shi, X., Thornton, P.E., Hoffman, F.M., Zhu, Z., and Ranga B. Myneni, R.B. 2013. Global latitudinal-asymmetric vegetation growth trends and their driving mechanisms: 1982-2009. Remote Sensing @@ -1233,18 +1638,24 @@ trends and their driving mechanisms: 1982-2009. Remote Sensing .. _Martinetal1980: +|br| + Martin, J.P., Haider, K. and Kassim, G., 1980. Biodegradation and stabilization after 2 years of specific crop, lignin, and polysaccharide carbons in soils. Soil Science Society of America Journal 44:1250-1255. .. _Maryetal1993: +|br| + Mary, B., Fresneau, C., Morel, J.L. and Mariotti, A., 1993. C and N cycling during decomposition of root mucilage, roots and glucose in soil. Soil Biology and Biochemistry 25:1005-1014. .. _McGuireetal1992: +|br| + McGuire, A.D., Melillo, J.M., Joyce, L.A., Kicklighter, D.W., Grace, A.L., Moore III, B., and Vorosmarty, C.J. 1992. Interactions between carbon and nitrogen dynamics in estimating net primary productivity for @@ -1253,53 +1664,71 @@ potential vegetation in North America. Global Biogeochem. Cycles .. _Medlynetal2011: -Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., -Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and -Wingate, L. (2011), Reconciling the optimal and empirical approaches to -modelling stomatal conductance. Global Change Biology, 17: 2134–2144. +|br| + +Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., +Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and +Wingate, L. (2011), Reconciling the optimal and empirical approaches to +modelling stomatal conductance. Global Change Biology, 17: 2134–2144. doi:10.1111/j.1365-2486.2010.02375.x .. _MelzerOLeary1987: +|br| + Melzer, E., and O’Leary, M.H. 1987. Anapleurotic CO2 Fixation by Phosphoenolpyruvate Carboxylase in C3 Plants. Plant. Physiol. 84:58. .. _Milleretal1994: +|br| + Miller, J.R., Russell, G.L., and Caliri, G. 1994. Continental-scale river flow in climate models. J. Climate 7:914-928. .. _MillingtonQuirk1961: +|br| + Millington, R. and Quirk, J.P., 1961. Permeability of Porous Solids. Transactions of the Faraday Society 57:1200-1207. .. _Mironovetal2010: +|br| + Mironov, D. et al., 2010. Implementation of the lake parameterisation scheme FLake into the numerical weather prediction model COSMO. Boreal Environment Research 15:218-230. .. _MitchellJones2005: +|br| + Mitchell, T.D., and Jones, P.D. 2005. An improved method of constructing a database of monthly climate observations and associated high-resolution grids. Int. J. Climatol. 25:693-712. .. _Moldrupetal2003: +|br| + Moldrup, P. et al. 2003. Modeling diffusion and reaction in soils: X. A unifying model for solute and gas diffusivity in unsaturated soil. Soil Science 168:321-337. .. _Mynenietal2002: +|br| + Myneni, R.B., et al. 2002. Global products of vegetation leaf area and fraction absorbed PAR from year one of MODIS data. Remote Sens. Environ. 83:214-231. .. _Neffetal2005: +|br| + Neff, J.C., Harden, J.W. and Gleixner, G. 2005. Fire effects on soil organic matter content, composition, and nutrients in boreal interior Alaska. Canadian Journal of Forest Research-Revue Canadienne De @@ -1307,6 +1736,8 @@ Recherche Forestiere 35:2178-2187. .. _Neitschetal2005: +|br| + Neitsch, S.L., Arnold, J.G., Kiniry, J.R., and Williams J.R. 2005. Soil and Water Assessment Tool, Theoretical Documentation: Version 2005. Temple, TX. USDA Agricultural Research Service and Texas A&M Blackland @@ -1314,17 +1745,23 @@ Research Center. .. _NegronJuarezetal2015: +|br| + Negron-Juarez, R. Koven, C.D., Riley, W.J., Knox, R.G., Chambers, J.Q. 2015. Environmental Research Letters 10:064017. DOI:10.1088/1748-9326/10/6/064017. .. _NemaniRunning1996: +|br| + Nemani, R.R., and Running, S.W. 1996. Implementation of a hierarchical global vegetation classification in ecosystem function models. J. Veg. Sci. 7:337-346. .. _Niinemetstal1998: +|br| + Niinemets, U., Kull, O., and Tenhunen, J.D. 1998. An analysis of light effects on foliar morphology, physiology, and light interception in temperate deciduous woody species of contrasting shade tolerance. Tree @@ -1332,12 +1769,16 @@ Phys. 18:681-696. .. _Niuetal2005: +|br| + Niu, G.-Y., Yang, Z.-L., Dickinson, R.E., and Gulden, L.E. 2005. A simple TOPMODEL-based runoff parameterization (SIMTOP) for use in global climate models. J. Geophys. Res. 110:D21106. DOI:10.1029/2005JD006111. .. _NiuYang2006: +|br| + Niu, G.-Y., and Yang, Z.-L. 2006. Effects of frozen soil on snowmelt runoff and soil water storage at a continental scale. J. Hydrometeor. 7:937-952. @@ -1353,17 +1794,23 @@ basins. J. Geophys. Res. 112:D21101. DOI:10.1029/2007JD008674. .. _Oikawaetal2005: +|br| + Oikawa, S., Hikosaka, K. and Hirose, T., 2005. Dynamics of leaf area and nitrogen in the canopy of an annual herb, Xanthium canadense. Oecologia, 143: 517-526. .. _Oke1987: +|br| + Oke, T. 1987. Boundary Layer Climates (2:math:`{}^{nd}` edition). Routledge, London and New York. .. _OlesonBonan2000: +|br| + Oleson, K.W., and Bonan, G.B. 2000. The effects of remotely-sensed plant functional type and leaf area index on simulations of boreal forest surface fluxes by the NCAR land surface model. J. Hydrometeor. @@ -1371,6 +1818,8 @@ surface fluxes by the NCAR land surface model. J. Hydrometeor. .. _Olesonetal2004: +|br| + Oleson, K.W., Dai, Y., Bonan, G., Bosilovich, M., Dickinson, R., Dirmeyer, P., Hoffman, F., Houser, P., Levis, S., Niu, G.-Y., Thornton, P., Vertenstein, M., Yang, Z.-L., and Zeng. X. 2004. Technical @@ -1380,6 +1829,8 @@ Colorado. 173 pp. .. _Olesonetal2008a: +|br| + Oleson, K.W., Niu, G.-Y., Yang, Z.-L., Lawrence, D.M., Thornton, P.E., Lawrence, P.J., Stöckli, R., Dickinson, R.E., Bonan, G.B., Levis, S., Dai, A., and Qian, T. 2008a. Improvements to the Community Land Model @@ -1388,6 +1839,8 @@ DOI:10.1029/2007JG000563. .. _Olesonetal2008b: +|br| + Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Grimmond, C.S.B. 2008b. An urban parameterization for a global climate model. 1. Formulation and evaluation for two cities. J. Appl. Meteor. Clim. @@ -1395,6 +1848,8 @@ Formulation and evaluation for two cities. J. Appl. Meteor. Clim. .. _Olesonetal2008c: +|br| + Oleson, K.W., Bonan, G.B., Feddema, J., and Vertenstein, M. 2008c. An urban parameterization for a global climate model. 2. Sensitivity to input parameters and the simulated urban heat island in offline @@ -1402,12 +1857,16 @@ simulations. J. Appl. Meteor. Clim. 47:1061-1076. .. _Olesonetal2010a: +|br| + Oleson, K.W., et al. 2010a. Technical description of version 4.0 of the Community Land model (CLM). NCAR Technical Note NCAR/TN-478+STR, National Center for Atmospheric Research, Boulder, CO, 257 pp. .. _Olesonetal2010b: +|br| + Oleson, K.W., Bonan, G.B., Feddema, J., Vertenstein, M., and Kluzek, E. 2010b. Technical description of an urban parameterization for the Community Land Model (CLMU). NCAR Technical Note NCAR/TN-480+STR, @@ -1415,17 +1874,23 @@ National Center for Atmospheric Research, Boulder, CO, 169 pp. .. _Olesonetal2013: -Oleson, K.W., et al. 2013. Technical description of version 4.5 of the +|br| + +Oleson, K.W., et al. 2013. Technical description of version 4.5 of the Community Land Model (CLM). NCAR Technical Note NCAR/TN-503+STR, National Center for Atmospheric Research, Boulder, CO, 420 pp. .. _Olson1963: +|br| + Olson, J.S., 1963. Energy storage and the balance of producers and decomposers in ecological systems. Ecology 44:322-331. .. _Olsonetal2001: +|br| + Olson, D.M., Dinerstein, E., Wikramanayake, E.D., Burgess, N.D., Powell, G.V.N., Underwood, E.C., D’Amico, J.A., Itoua, I., Strand, H. E., Morrison, J. C., Loucks, C. J., Allnutt, T. F., Ricketts, T. H., Kura, @@ -1435,17 +1900,23 @@ Bioscience, 51, 933–938. .. _OrchardCook1983: +|br| + Orchard, V.A. and Cook, F.J., 1983. Relationship between soil respiration and soil moisture. Soil Biology and Biochemistry, 15: 447-453. .. _Owen1964: +|br| + Owen, P.R. 1964. Saltation of uniform grains in air. J. Fluid Mech\ *.* 20:225-242. .. _Ozdoganetal2010: +|br| + Ozdogan, M., Rodell, M., Beaudoing, H.K., and Toll, D.L. 2010. Simulating the effects of irrigation over the United States in a land surface model based on satellite-derived agricultural data. Journal of @@ -1453,80 +1924,110 @@ Hydrometeorology 11:171-184. .. _Pageetal2002: +|br| + Page, S.E., Siegert, F., Rieley, J.O., Boehm, H-D.V., Jaya, A., and Limin, S. 2002. The amount of carbon released from peat and forest fires in Indonesia in 1997. Nature 420:61-65. .. _PanofskyDutton1984: +|br| + Panofsky, H.A., and Dutton, J.A. 1984. Atmospheric Turbulence: Models and Methods for Engineering Applications. John Wiley and Sons, New York. .. _Partonetal1988: +|br| + Parton, W., Stewart, J. and Cole, C., 1988. Dynamics of C, N, P And S in Grassland Soils - A Model. Biogeochemistry 5:109-131. .. _Partonetal1993: +|br| + Parton, W.J., et al. 1993. Observations and modeling of biomass and soil organic matter dynamics for the grassland biome worlwide. Global Biogeochemical Cycles 7:785-809. .. _Partonetal1996: +|br| + Parton, W. et al. 1996. Generalized model for N2 and N2O production from nitrification and denitrification. Global Biogeochemical Cycles 10:401-412. .. _Partonetal2001: +|br| + Parton, W.J. et al. 2001. Generalized model for NOx and N2O emissions from soils. J. Geophys. Res. 106(D15):17403-17419. .. _Paterson1994: +|br| + Paterson, W.S.B., 1994. The Physics of Glaciers. Elsevier Science Inc., New York, 480 pp. .. _Pelletieretal2016: +|br| + Pelletier, J. D., P. D. Broxton, P. Hazenberg, X. Zeng, P. A. Troch, G. Y. Niu, Z. Williams, M. A. Brunke, and D. Gochis, 2016: A gridded global data set of soil, intact regolith, and sedimentary deposit thicknesses for regional and global land surface modeling. J. Adv. Mod. Earth Sys. 8:41-65. .. _Petrescuetal2010: +|br| + Petrescu, A.M.R. et al. 2010. Modeling regional to global CH4 emissions of boreal and arctic wetlands. Global Biogeochemical Cycles, 24(GB4009). .. _Philip1957: +|br| + Philip, J.R. 1957. Evaporation, and moisture and heat fields in the soil. J. Meteor. 14:354-366. .. _Piaoetal2012: +|br| + Piao, S.L., et al. 2012. The carbon budget of terrestrial ecosystems in East Asia over the last two decades. Biogeosciences 9:3571-3586. .. _Pivovarov1972: +|br| + Pivovarov, A.A., 1972. Thermal Conditions in Freezing Lakes and Reservoirs. John Wiley, New York. .. _Pollmeretal1979: +|br| + Pollmer, W.G., Eberhard, D., Klein, D., and Dhillon, B.S. 1979. Genetic control of nitrogen uptake and translocation in maize. Crop Sci. 19:82-86. .. _Pomeroyetal1998: +|br| + Pomeroy, J. W., D. M. Gray, K. R. Shook, B. Toth, R. L. H. Essery, A. Pietroniro, and N. Hedstrom. 1998. An evaluation of snow accumulation and ablation processes for land surface modelling. Hydrol. Process. 12:2339–2367. .. _Portmannetal2010: +|br| + Portmann, F.T., Siebert, S., and Döll, P. 2010. MIRCA2000 - Global monthly irrigated and rainfed crop areas around the year 2000: A new high-resolution data set for agricultural and hydrological modeling. @@ -1534,18 +2035,24 @@ Global Biogeochem. Cycles. 24, GB1011. DOI:10.1029/2008GB003435. .. _Pressetal1992: +|br| + Press, W.H., Teukolsky, S.A., Vetterling, W.T., and Flannery, B.P. 1992. Numerical Recipes in FORTRAN: The Art of Scientific Computing. Cambridge University Press, New York. .. _Prigentetal2007: +|br| + Prigent, C., Papa, F., Aires, F., Rossow, W.B. and Matthews, E. 2007. Global inundation dynamics inferred from multiple satellite observations, 1993-2000. J. Geophys. Res. 112(D12). .. _Pritchardetal2008: +|br| + Pritchard, M.S., Bush, A.B.G., and Marshall, S.J. 2008. Neglecting ice-atmosphere interactions underestimates ice sheet melt in millennial-scale deglaciation simulations. Geophys. Res. Lett. ** @@ -1553,18 +2060,24 @@ millennial-scale deglaciation simulations. Geophys. Res. Lett. ** .. _Qianetal2006: +|br| + Qian, T., Dai, A., Trenberth, K.E., and Oleson, K.W. 2006. Simulation of global land surface conditions from 1948 to 2004: Part I: Forcing data and evaluations. J. Hydrometeor. 7:953-975. .. _RamankuttyFoley1998: +|br| + Ramankutty, N., and Foley, J. A., 1998. Characterizing patterns of global land use: An analysis of global croplands data. Global Biogeochemical Cycles, 12, 667-685. .. _Ramankuttyetal2008: +|br| + Ramankutty, N., Evan, A., Monfreda, C., and Foley, J.A. 2008. Farming the Planet. Part 1: The Geographic Distribution of Global Agricultural Lands in the Year 2000. Global Biogeochem. Cycles. 22:GB1003. @@ -1572,6 +2085,8 @@ DOI:10.1029/2007GB002952. .. _Randlettetal1996: +|br| + Randlett, D.L., Zak, D.R., Pregitzer, K.S., and Curtis, P.S. 1996. Elevated atmospheric carbon dioxide and leaf litter chemistry: Influences on microbial respiration and net nitrogen mineralization. @@ -1579,6 +2094,8 @@ Soil Sci. Soc. Am. J. 60:1571-1577. .. _Rastetteretal1991: +|br| + Rastetter, E.B., Ryan, M.G., Shaver, G.R., Melillo, J.M., Nadelhoffer, K.J., Hobbie, J.E., and Aber, J.D. 1991. A general biogeochemical model describing the responses of the C and N cycles in terrestrial ecosystems @@ -1586,12 +2103,16 @@ to changes in CO2, climate and N deposition. Tree Phys. 9:101-126. .. _Rastneretal2012: +|br| + Rastner, P., Bolch, T., Mölg, N., Machguth, H., and Paul, F., 2012. The first complete glacier inventory for the whole of Greenland, The Cryosphere Discuss., 6, 2399-2436, 10.5194/tcd-6-2399-2012. .. _Rileyetal2011a: +|br| + Riley, W. J., Z. M. Subin, D. M. Lawrence, S. C. Swenson, M. S. Torn, L. Meng, N. Mahowald, and P. Hess, 2011a. Barriers to predicting global terrestrial methane fluxes: Analyses using a methane biogeochemistry @@ -1600,26 +2121,36 @@ DOI:10.5194/bg-8-1925-2011. .. _Rileyetal2011b: +|br| + Riley, W.J. et al. 2011b. CLM4Me, a Methane Biogeochemistry Model Integrated in CESM, Land and Biogeochemistry Model Working Group Meeting, Boulder, CO. .. _Roeschetal2001: +|br| + Roesch, A., M. Wild, H. Gilgen, and A. Ohmura. 2001. A new snow cover fraction parametrization for the ECHAM4 GCM, Clim. Dyn., 17:933–946. .. _Rogersetal2017: +|br| + Rogers, A., B. E. Medlyn, J. S. Dukes, G. Bonan, S. Caemmerer, M. C. Dietze, J. Kattge, A. D. Leakey, L. M. Mercado, and U. Niinemets, 2017: A roadmap for improving the representation of photosynthesis in Earth system models. New Phytologist, 213:22-42. .. _Ryan1991: +|br| + Ryan, M. G. 1991. A simple method for estimating gross carbon budgets for vegetation in forest ecosystems. Tree Phys. 9:255-266. .. _RunningCoughlan1988: +|br| + Running, S.W. and Coughlan, J.C., 1988. A general model of forest ecosystem processes for regional applications. I. Hydrological balance, canopy gas exchange and primary production processes. Ecological @@ -1627,18 +2158,24 @@ Modelling, 42: 125-154. .. _Runningetal1989: +|br| + Running, S.W. et al., 1989. Mapping regional forest evapotranspiration and photosynthesis by coupling satellite data with ecosystem simlation. Ecology, 70: 1090-1101. .. _RunningGower1991: +|br| + Running, S.W. and Gower, S.T., 1991. FOREST BGC, A general model of forest ecosystem processes for regional applications. II. Dynamic carbon allocation and nitrogen budgets. Tree Physiology, 9: 147-160. .. _RunningHunt1993: +|br| + Running, S.W. and Hunt, E.R., Jr., 1993. Generalization of a forest ecosystem process model for other biomes, BIOME-BGC, and an applicationfor global-scale models. In: J.R. Ehleringer and C. Field @@ -1647,12 +2184,16 @@ Press, San Diego, CA, pp. 141-158. .. _Sacksetal2009: -Sacks, W. J., Cook, B. I., Buenning, N., Levis, S., and Helkowski, J. H. +|br| + +Sacks, W. J., Cook, B. I., Buenning, N., Levis, S., and Helkowski, J. H. 2009. Effects of global irrigation on the near-surface climate. Climate Dyn., 33, 159–175. DOI:10.1007/s00382-008-0445-z. .. _Saggaretal1994: +|br| + Saggar, S., Tate, K.R., Feltham, C.W., Childs, C.W. and Parshotam, A., 1994. Carbon turnover in a range of allophanic soils amended with :math:`{}^{14}`\ C-labelled glucose. Soil Biology and Biochemistry, 26: @@ -1665,6 +2206,8 @@ DOI:10.1029/2008JD010834. .. _Schaafetal2002: +|br| + Schaaf, C.B., Gao, F., Strahler, A.H., Lucht, W., Li, X., Tsang, T., Strugnell, N.C., Zhang, X., Jin, Y., and Muller, J.-P. 2002. First operational BRDF, albedo nadir reflectance products from MODIS. Remote @@ -1672,40 +2215,54 @@ Sens. Environ. 83:135-148. .. _Schlesinger1997: +|br| + Schlesinger, W.H., 1997. Biogeochemistry: an analysis of global change. Academic Press, London, 588 pp. .. _SchnellKing1996: +|br| + Schnell, S. and King, G.M., 1996. Responses of methanotrophic activity in soils and cultures to water stress. Applied and Environmental Microbiology 62:3203-3209. .. _Segers1998: +|br| + Segers, R., 1998. Methane production and methane consumption: a review of processes underlying wetland methane fluxes. Biogeochemistry 41:23-51. .. _Sellers1985: +|br| + Sellers, P.J. 1985. Canopy reflectance, photosynthesis and transpiration. Int. J. Remote Sens. 6:1335-1372. .. _Sellersetal1986: +|br| + Sellers, P.J., Mintz, Y., Sud, Y.C., and Dalcher, A. 1986. A simple biosphere model (SiB) for use within general circulation models. J. Atmos. Sci. 43:505-531. .. _Sellersetal1988: +|br| + Sellers, P.J., Hall, F.G., Asrar, G., Strebel, D.E., and Murphy, R.E. 1988. The First ISLSCP Field Experiment (FIFE). Bull. Amer. Meteor. Soc. 69:22-27. .. _Sellersetal1992: +|br| + Sellers, P.J., Berry, J.A., Collatz, G.J., Field, C.B., and Hall, F.G. 1992. Canopy reflectance, photosynthesis, and transpiration. III. A reanalysis using improved leaf models and a new canopy integration @@ -1713,12 +2270,16 @@ scheme. Remote Sens. Environ. 42:187-216. .. _Sellersetal1995: +|br| + Sellers, P.J., et al. 1995. The Boreal Ecosystem-Atmosphere Study (BOREAS): An overview and early results from the 1994 field year. Bull. Amer. Meteor. Soc. 76:1549-1577. .. _Sellersetal1996: +|br| + Sellers, P.J., Randall, D.A., Collatz, G.J., Berry, J.A., Field, C.B., Dazlich, D.A., Zhang, C., Collelo, G.D., and Bounoua, L. 1996. A revised land surface parameterization (SiB2) for atmospheric GCMs. Part I: Model @@ -1726,6 +2287,8 @@ formulation. J. Climate 9:676-705. .. _Shietal2013: +|br| + Shi, X., Mao, J., Thornton, P.E., and Huang, M. 2013. Spatiotemporal patterns of evapotranspiration in response to multiple environmental factors simulated by the Community Land Model. Environ. Res. Lett. @@ -1733,39 +2296,53 @@ factors simulated by the Community Land Model. Environ. Res. Lett. .. _Shietal2016: +|br| + Shi, M., J. B. Fisher, E. R. Brzostek, and R. P. Phillips, 2016: Carbon cost of plant nitrogen acquisition: global carbon cycle impact from an improved plant nitrogen cycle in the Community Land Model. Glob. Change Biol., 22:1299-1314. .. _Shiklomanov2000: +|br| + Shiklomanov, I.A. 2000. Appraisal and assessment of world water resources. Water International 25:11-32. .. _Siebertetal2005: +|br| + Siebert, S., Döll, P., Hoogeveen, J., Faures, J.M., Frenken, K., Feick, S., 2005. Development and validation of the global map of irrigation areas. Hydrol Earth Syst Sc 9:535–547 .. _Simardetal2011: -Simard, M., Pinto, N., Fisher, J.B., and Baccini, A. (2011), Mapping +|br| + +Simard, M., Pinto, N., Fisher, J.B., and Baccini, A. (2011), Mapping forest canopy height globally with spaceborne lidar. J. Geophys. Res., 116, G04021, doi:10.1029/2011JG001708. .. _Simpsonetal1983: +|br| + Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen redistribution during grain growth in wheat (Triticum avestivum L.). Plant Physiol. 71:7-14. .. _Sivak2013: +|br| + Sivak, M. 2013. Air conditioning versus heating: climate control is more -energy demanding in Minneapolis than in Miami. Environ. Res. Lett., 8, +energy demanding in Minneapolis than in Miami. Environ. Res. Lett., 8, doi:10.1088/1748-9326/8/1/014050. .. _Smithetal2005: +|br| + Smith, A.M.S., Wooster, M.J., Drake, N.A., Dipotso, F.M. and Perry, G.L.W., 2005. Fire in African savanna: Testing the impact of incomplete combustion on pyrogenic emissions estimates. Ecological Applications, @@ -1773,37 +2350,49 @@ combustion on pyrogenic emissions estimates. Ecological Applications, .. _Sollins1982: +|br| + Sollins, P., 1982. Input and decay of coarse woody debris in coniferous stands in western Oregon and Washington. Canadian Journal of Forest Research, 12: 18-28. .. _SonGower1991: +|br| + Son, Y. and Gower, S.T., 1991. Aboveground nitrogen and phosphorus use by five plantation-grown trees with different leaf longevities. Biogeochemistry, 14: 167-191. .. _Sorensen1981: +|br| + Sørensen, L.H., 1981. Carbon-nitrogen relationships during the humification of cellulose in soils containing different amounts of clay. Soil Biology and Biochemistry, 13: 313-321. .. _Sperryetal1998: -Sperry, J.S., Adler, F.R., Campbell, G.S. and Comstock, J.P. 1998. -Limitation of plant water use by rhizosphere and xylem conductance: -results from a model. Plant, Cell & Environment, 21: 347–359. +|br| + +Sperry, J.S., Adler, F.R., Campbell, G.S. and Comstock, J.P. 1998. +Limitation of plant water use by rhizosphere and xylem conductance: +results from a model. Plant, Cell & Environment, 21: 347–359. doi:10.1046/j.1365-3040.1998.00287.x .. _SperryandLove2015: -Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us -about responses to climate-change droughts. New Phytol, 207: 14–27. +|br| + +Sperry, J.S. and Love, D.M. 2015. What plant hydraulics can tell us +about responses to climate-change droughts. New Phytol, 207: 14–27. doi:10.1111/nph.13354 .. _Sprugeletal1995: +|br| + Sprugel, D.G., Ryan, M.G., Brooks, J.R., Vogt, K.A., and Martin, T.A. 1995. Respiration from the organ level to stand level. pp. 255-299. In: W. K. Smith and T. M. Hinkley (editors) Resource Physiology of Conifers. @@ -1811,17 +2400,23 @@ Academic Press, San Diego,CA. .. _StaufferAharony1994: +|br| + Stauffer, D., and Aharony, A. 1994. Introduction to Percolation Theory. Taylor and Francis, London. .. _Stilletal2003: +|br| + Still, C.J., Berry, J.A., Collatz, G.J., and DeFries, R.S. 2003. Global distribution of C3 and C4 vegetation: carbon cycle implications. Global Biogeochem. Cycles 17:1006. DOI:10.1029/2001GB001807. .. _Stocklietal2008: +|br| + Stöckli, R., Lawrence, D.M., Niu, G.-Y., Oleson, K.W., Thornton, P.E., Yang, Z.-L., Bonan, G.B., Denning, A.S., and Running, S.W. 2008. Use of FLUXNET in the Community Land Model development. J. Geophys. Res. @@ -1829,29 +2424,39 @@ FLUXNET in the Community Land Model development. J. Geophys. Res. .. _Stracketal2006: +|br| + Strack, M., Kellner, E. and Waddington, J.M., 2006. Effect of entrapped gas on peatland surface level fluctuations. Hydrological Processes 20:3611-3622. .. _Strahleretal1999: +|br| + Strahler, A.H., Muchoney, D., Borak, J., Friedl, M., Gopal, S., Lambin, E., and Moody. A. 1999. MODIS Land Cover Product: Algorithm Theoretical Basis Document (Version 5.0). Boston University, Boston. .. _Stull1988: +|br| + Stull, R.B. 1988. An Introduction to Boundary Layer Meteorology. Kluwer Academic Publishers, Dordrecht. .. _Subinetal2012a: +|br| + Subin, Z.M., Riley, W.J. and Mironov, D. 2012a. Improved lake model for climate simulations, J. Adv. Model. Earth Syst., 4, M02001. DOI:10.1029/2011MS000072. .. _Subinetal2012b: +|br| + Subin, Z.M., Murphy, L.N., Li, F., Bonfils, C. and Riley, W.J., 2012b. Boreal lakes moderate seasonal and diurnal temperature variation and perturb atmospheric circulation: analyses in the Community Earth System @@ -1859,42 +2464,56 @@ Model 1 (CESM1). Tellus A, North America, 64. .. _Sunetal2012: +|br| + Sun, Y., Gu, L., and Dickinson, R. E. 2012. A numerical issue in calculating the coupled carbon and water fluxes in a climate model, J. Geophys. Res., 117, D22103. DOI:10.1029/2012JD018059. .. _Swensonetal2012: +|br| + Swenson, S.C., Lawrence, D.M., and Lee, H. 2012. Improved Simulation of the Terrestrial Hydrological Cycle in Permafrost Regions by the Community Land Model. JAMES, 4, M08002. DOI:10.1029/2012MS000165. .. _SwensonLawrence2012: +|br| + Swenson, S.C. and Lawrence, D.M. 2012. A New Fractional Snow Covered Area Parameterization for the Community Land Model and its Effect on the Surface Energy Balance. JGR, 117, D21107. DOI:10.1029/2012JD018178. .. _SwensonLawrence2014: -Swenson, S.C., and D. M. Lawrence. 2014. Assessing a dry surface -layer-based soil resistance parameterization for the Community Land Model -using GRACE and FLUXNET-MTE data. JGR, 119, 10, 299–10,312, +|br| + +Swenson, S.C., and D. M. Lawrence. 2014. Assessing a dry surface +layer-based soil resistance parameterization for the Community Land Model +using GRACE and FLUXNET-MTE data. JGR, 119, 10, 299–10,312, DOI:10.1002/2014JD022314. .. _SwensonLawrence2015: -Swenson, S.C., and D. M. Lawrence. 2015. A GRACE-based assessment of -interannual groundwater dynamics in the Community Land Model. WRR, 51, +|br| + +Swenson, S.C., and D. M. Lawrence. 2015. A GRACE-based assessment of +interannual groundwater dynamics in the Community Land Model. WRR, 51, doi:10.1002/2015WR017582. .. _TaWeiland1992: +|br| + Ta, C.T. and Weiland, R.T. 1992. Nitrogen partitioning in maize during ear development. Crop Sci. 32:443-451. .. _TangRiley2013: +|br| + Tang, J.Y. and Riley, W.J. 2013. A new top boundary condition for modeling surface diffusive exchange of a generic volatile tracer: Theoretical analysis and application to soil evaporation. Hydrol. Earth @@ -1902,22 +2521,30 @@ Syst. Sci. 17:873-893. .. _Tarnocaietal2011: +|br| + Tarnocai, C., Kettles, I. M., and Lacelle, B., 2011. Peatlands of Canada, Geological Survey of Canada, Open File 6561, CD-ROM. DOI:10.495/288786. .. _Tayloretal1989: +|br| + Taylor, B.R., Parkinson, D. and Parsons, W.F.J., 1989. Nitrogen and lignin content as predictors of litter decay rates: A microcosm test. Ecology, 70: 97-104. .. _Thomasetal2015: +|br| + Thomas R.Q., Brookshire E.N., Gerber S. 2015. Nitrogen limitation on land: how can it occur in Earth system models? Global Change Biology, 21, 1777-1793, doi:10.1111/gcb.12813. .. _Thonickeetal2001: +|br| + Thonicke, K., Venevsky, S., Sitch, S., and Cramer, W. 2001. The role of fire disturbance for global vegetation dynamics: coupling fire into a Dynamic Global Vegetation Model. Global Ecology and Biogeography @@ -1925,6 +2552,8 @@ Dynamic Global Vegetation Model. Global Ecology and Biogeography .. _Thornton1998: +|br| + Thornton, P.E., 1998. Regional ecosystem simulation: combining surface- and satellite-based observations to study linkages between terrestrial energy and mass budgets. Ph.D. Thesis, The University of Montana, @@ -1932,6 +2561,8 @@ Missoula, 280 pp. .. _Thorntonetal2002: +|br| + Thornton, P.E., Law, B.E., Gholz, H.L., Clark, K.L., Falge, E., Ellsworth, D.S., Goldstein, A.H., Monson, R.K., Hollinger, D., Falk, M., Chen, J., and Sparks, J.P. 2002. Modeling and measuring the effects of @@ -1940,18 +2571,24 @@ needleleaf forests. Agric. For. Meteor. 113:185-222. .. _ThorntonRosenbloom2005: +|br| + Thornton, P.E., and Rosenbloom, N.A. 2005. Ecosystem model spin-up: estimating steady state conditions in a coupled terrestrial carbon and nitrogen cycle model. Ecological Modelling 189:25-48. .. _ThorntonZimmermann2007: +|br| + Thornton, P.E., and Zimmermann, N.E. 2007. An improved canopy integration scheme for a land surface model with prognostic canopy structure. J. Climate 20:3902-3923. .. _Thorntonetal2007: +|br| + Thornton, P.E., Lamarque, J.-F., Rosenbloom, N.A., and Mahowald, N.M. 2007. Influence of carbon-nitrogen cycle coupling on land model response to CO\ :sub:`2` fertilization and climate variability. Global @@ -1959,6 +2596,8 @@ Biogeochem. Cycles 21:GB4018. .. _Thorntonetal2009: +|br| + Thornton, P.E., Doney, S.C., Lindsay, K., Moore, J.K., Mahowald, N., Randerson, J.T., Fung, I., Lamarque, J.F., Feddema, J.J., and Lee, Y.H. 2009. Carbon-nitrogen interactions regulate climate-carbon cycle @@ -1967,6 +2606,8 @@ Biogeosci. 6:2099-2120. .. _Tianetal2010: +|br| + Tian, H. et al. 2010. Spatial and temporal patterns of CH4 and N2O fluxes in terrestrial ecosystems of North America during 1979-2008: application of a global biogeochemistry model. Biogeosciences @@ -1974,6 +2615,8 @@ application of a global biogeochemistry model. Biogeosciences .. _Toonetal1989: +|br| + Toon, O.B., McKay, C.P., Ackerman, T.P., and Santhanam, K. 1989. Rapid calculation of radiative heating rates and photodissociation rates in inhomogeneous multiple scattering atmospheres. J. Geophys. Res. @@ -1981,12 +2624,16 @@ inhomogeneous multiple scattering atmospheres. J. Geophys. Res. .. _Turetskyetal2002: +|br| + Turetsky, M.R., Wieder, R.K., Halsey, L.A., and Vitt, D.H. 2002. Current disturbance and the diminishing peatland carbon sink. Geophys. Res. Lett. 29:1526. DOI:10.1029/2001GL014000. .. _Turetskyetal2004: +|br| + Turetsky, M.R., Amiro, B.D., Bosch, E., and Bhatti, J.S. 2004. Historical burn area in western Canadian peatlands and its relationship to fire weather indices. Global Biogeochem. Cycles 18:GB4014. @@ -1994,23 +2641,31 @@ DOI:10.1029/2004GB002222. .. _Tyeetal2005: +|br| + Tye, A.M., et al. 2005. The fate of N-15 added to high Arctic tundra to mimic increased inputs of atmospheric nitrogen released from a melting snowpack. Global Change Biology 11:1640-1654. .. _Unlandetal1996: +|br| + Unland, H.E., Houser, P.R., Shuttleworth, W.J., and Yang, Z.-L. 1996. Surface flux measurement and modeling at a semi-arid Sonoran Desert site. Agric. For. Meteor. 82:119-153. .. _UNSTAT2005: +|br| + UNSTAT, 2005. National Accounts Main Aggregates Database, United Nations Statistics Division. .. _VallanoSparks2007: +|br| + Vallano, D.M. and Sparks, J.P. 2007. Quantifying foliar uptake of gaseous itrogen dioxide using enriched foliar :math:`\delta^{15}`\ N values. New Phytologist @@ -2018,6 +2673,8 @@ gaseous itrogen dioxide using enriched foliar .. _vanderWerfetal2010: +|br| + van der Werf, G.R., Randerson, J.T., Giglio, L., Collatz, G.J., Mu, M., Kasibhatla, S.P., Morton, D.C., DeFries, R.S., Jin, Y., van Leeuwen, T.T. 2010. Global fire emissions and the contribution of deforestation, @@ -2026,19 +2683,25 @@ Phys. 10:11707-11735. .. _van Veenetal1984: +|br| + van Veen, J.A., Ladd, J.N. and Frissel, M.J., 1984. Modelling C and N turnover through the microbial biomass in soil. Plant and Soil, 76: 257-274. .. _vanKampenhoutetal2017: -van Kampenhout, L., J.T.M. Lenaerts, W.H. Lipscomb, W.J. Sacks, D.M. -Lawrence, A.G. Slater, and M.R. van den Broeke, 2017. -Improving the representation of polar snow and firn in the +|br| + +van Kampenhout, L., J.T.M. Lenaerts, W.H. Lipscomb, W.J. Sacks, D.M. +Lawrence, A.G. Slater, and M.R. van den Broeke, 2017. +Improving the representation of polar snow and firn in the Community Earth System Model, submitted. .. _VanVuurenetal2006: +|br| + Van Vuuren, D.P., Lucas, P.S., and Hilderink, H.B.M., 2006. Downscaling drivers of global environmental change: enabling use of global SRES scenarios at the national and grid levels, Report 550025001, Netherlands @@ -2046,12 +2709,16 @@ Environmental Assessment Agency, 45 pp. .. _VanninenMakela2005: +|br| + Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: effects of size, competition and site fertility on growth allocation and production. Tree Phys. 25:17-30. .. _VerdinGreenlee1996: +|br| + Verdin, K. L., and S. K. Greenlee, 1996. Development of continental scale digital elevation models and extraction of hydrographic features, paper presented at the Third International Conference/Workshop on @@ -2060,6 +2727,8 @@ January, Natl. Cent. for Geogr. Inf. and Anal., Santa Barbara, Calif. .. _Viovy2011: +|br| + Viovy, N. 2011. CRUNCEP dataset. [Description available at http://dods.extra.cea.fr/data/p529viov/cruncep/readme.htm. Data available at @@ -2067,17 +2736,23 @@ http://dods.extra.cea.fr/store/p529viov/cruncep/V4\_1901\_2011/]. .. _VitousekHowarth1991: +|br| + Vitousek, P.M., and Howarth, R.W. 1991. Nitrogen limitation on land and in the sea: How can it occur? Biogeochem. 13:87-115. .. _Walteretal2001: +|br| + Walter, B.P., Heimann, M. and Matthews, E., 2001. Modeling modern methane emissions from natural wetlands 1. Model description and results. J. Geophys. Res. 106(D24):34189-34206. .. _Waniaetal2009: +|br| + Wania, R., Ross, I. and Prentice, I.C. 2009. Integrating peatlands and permafrost into a dynamic global vegetation model: 2. Evaluation and sensitivity of vegetation and carbon cycle processes. Global Biogeochem. @@ -2085,6 +2760,8 @@ Cycles 23. .. _Waniaetal2010: +|br| + Wania, R., Ross, I. and Prentice, I.C. 2010. Implementation and evaluation of a new methane model within a dynamic global vegetation model LPJ-WHyMe v1.3. Geoscientific Model Development Discussions @@ -2092,18 +2769,24 @@ model LPJ-WHyMe v1.3. Geoscientific Model Development Discussions .. _WangZeng2009: +|br| + Wang, A., and Zeng, X. 2009. Improving the treatment of vertical snow burial fraction over short vegetation in the NCAR CLM3. Adv. Atmos. Sci. 26:877-886. DOI:10.1007/s00376-009-8098-3. .. _Whiteetal1997: +|br| + White, M.A., Thornton, P.E., and Running, S.W. 1997. A continental phenology model for monitoring vegetation responses to interannual climatic variability. Global Biogeochem. Cycles 11:217-234. .. _Whiteetal2000: +|br| + White, M.A., Thornton, P.E., Running, S.W., and Nemani, R.R. 2000. Parameterization and sensitivity analysis of the Biome-BGC terrestrial ecosystem model: net primary production controls. Earth Interactions @@ -2111,28 +2794,36 @@ ecosystem model: net primary production controls. Earth Interactions .. _Wiederetal2015: -Wieder, W. R., Cleveland, C. C., Lawrence, D. M., and Bonan, G. B. 2015. -Effects of model structural uncertainty on carbon cycle projections: -biological nitrogen fixation as a case study. Environmental Research +|br| + +Wieder, W. R., Cleveland, C. C., Lawrence, D. M., and Bonan, G. B. 2015. +Effects of model structural uncertainty on carbon cycle projections: +biological nitrogen fixation as a case study. Environmental Research Letters, 10(4), 044016. .. _Williamsetal1996: -Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., -Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. -and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere -continuum in a Quercus–Acer stand at Harvard Forest: the regulation -of stomatal conductance by light, nitrogen and soil/plant hydraulic -properties. Plant, Cell & Environment, 19: 911–927. +|br| + +Williams, M., Rastetter, E.B., Fernandes, D.N., Goulden, M.L., +Wofsy, S.C., Shaver, G.R., Melillo, J.M., Munger, J.W., Fan, S.M. +and Nadelhoffer, K.J. 1996. Modelling the soil-plant-atmosphere +continuum in a Quercus–Acer stand at Harvard Forest: the regulation +of stomatal conductance by light, nitrogen and soil/plant hydraulic +properties. Plant, Cell & Environment, 19: 911–927. doi:10.1111/j.1365-3040.1996.tb00456.x .. _WiscombeWarren1980: +|br| + Wiscombe, W.J., and Warren, S.G. 1980. A model for the spectral albedo of snow. I. Pure snow. J. Atmos. Sci. 37:2712-2733. .. _Woodetal1992: +|br| + Wood, E.F., Lettenmaier, D.P., and Zartarian, V.G. 1992. A land-surface hydrology parameterization with subgrid variability for general circulation models. J. Geophys. Res. 97(D3):2717–2728. @@ -2140,66 +2831,90 @@ DOI:10.1029/91JD01786. .. _WorldBank2004: +|br| + World Bank, 2004. World development indicators 2004, Oxford University Press, New York, 416 pp. .. _Wuetal2011: +|br| + Wu, H., J. S. Kimball, N. Mantua, and J. Stanford, 2011: Automated upscaling of river networks for macroscale hydrological modeling. Water Resour. Res., 47, W03517, doi:10.1029/2009WR008871. .. _Wuetal2012: +|br| + Wu, H., J. S. Kimball, H. Li, M. Huang, L. R. Leung, and R. F. Adler (2012), A New Global River Network Database for Macroscale Hydrologic modeling, Water Resour. Res., 48, W09701, doi:10.1029/2012WR012313. .. _Xuetal2012: +|br| + Xu, C., R. Fisher, S. D. Wullschleger, C. J. Wilson, M. Cai, and N. G. McDowell, 2012: Toward a mechanistic modeling of nitrogen limitation on vegetation dynamics. PloS one, 7:e37914. .. _Yang1998: +|br| + Yang, Z.-L. 1998. Technical note of a 10-layer soil moisture and temperature model. Unpublished manuscript. .. _Zenderetal2003: +|br| + Zender, C.S., Bian, H., and Newman, D. 2003. Mineral dust entrainment and deposition (DEAD) model: Description and 1990s dust climatology. ** J. Geophys. Res\ *.* 108(D14):4416. DOI:10.1029/2002JD002775. .. _ZengDickinson1998: +|br| + Zeng, X., and Dickinson, R.E. 1998. Effect of surface sublayer on surface skin temperature and fluxes. J.Climate 11:537-550. .. _Zengetal1998: +|br| + Zeng, X., Zhao, M., and Dickinson, R.E. 1998. Intercomparison of bulk aerodynamic algorithms for the computation of sea surface fluxes using the TOGA COARE and TAO data. J. Climate 11:2628-2644. .. _Zeng2001: +|br| + Zeng, X. 2001. Global vegetation root distribution for land modeling. J. Hydrometeor. 2:525-530. .. _Zengetal2002: +|br| + Zeng, X., Shaikh, M., Dai, Y., Dickinson, R.E., and Myneni, R. 2002. Coupling of the Common Land Model to the NCAR Community Climate Model. J. Climate 15:1832-1854. .. _Zengetal2005: +|br| + Zeng, X., Dickinson, R.E., Barlage, M., Dai, Y., Wang, G., and Oleson, K. 2005. Treatment of under-canopy turbulence in land models. J. Climate 18:5086-5094. .. _ZengWang2007: +|br| + Zeng, X., and Wang, A. 2007. Consistent parameterization of roughness length and displacement height for sparse and dense canopies in land models. J. Hydrometeor. 8:730-737. @@ -2210,6 +2925,8 @@ water table. J. Hydrometeor. 10:308-319. .. _Zengetal2008: +|br| + Zeng, X., Zeng, X., and Barlage, M. 2008. Growing temperate shrubs over arid and semiarid regions in the Community Land Model - Dynamic Global Vegetation Model. Global Biogeochem. Cycles 22:GB3003. @@ -2217,6 +2934,8 @@ DOI:10.1029/2007GB003014. .. _Zhangetal2002: +|br| + Zhang, Y., Li, C.S., Trettin, C.C., Li, H. and Sun, G., 2002. An integrated model of soil, hydrology, and vegetation for carbon dynamics in wetland ecosystems. Global Biogeochemical Cycles 16. @@ -2224,6 +2943,8 @@ DOI:10.1029/2001GB001838. .. _Zhuangetal2004: +|br| + Zhuang, Q., et al. 2004. Methane fluxes between terrestrial ecosystems and the atmosphere at northern high latitudes during the past century: A retrospective analysis with a process-based biogeochemistry model. @@ -2231,136 +2952,200 @@ Global Biogeochemical Cycles 18. DOI:10.1029/2004GB002239. .. _Zilitinkevich1970: +|br| + Zilitinkevich, S.S. 1970. Dynamics of the Atmospheric Boundary Layer. Leningrad Gidrometeor. .. _bonan2012: -Bonan, Gordon B et al. (2012). `Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4`. Journal of Geophysical Research: Biogeosciences (2005-2012) 117.G2. +|br| + +Bonan, Gordon B et al. (2012). `Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4`. Journal of Geophysical Research: Biogeosciences (2005-2012) 117.G2. .. _botta2000: -Botta, A et al. (2000). `A global prognostic scheme of leaf onset using satellite data`. Global Change Biology 6.7, pp. 709-725. +|br| + +Botta, A et al. (2000). `A global prognostic scheme of leaf onset using satellite data`. Global Change Biology 6.7, pp. 709-725. .. _byram1959: -Byram, GM (1959). Combustion of forest fuels. In Forest fire: control and use.(Ed. KP Davis) pp. 61-89. +|br| + +Byram, GM (1959). Combustion of forest fuels. In Forest fire: control and use.(Ed. KP Davis) pp. 61-89. .. _collatz1991: +|br| + Collatz, G James et al. (1991). `Physiological and environmental regulation of stomatal conductance, photosynthesis and transpiration: a model that includes a laminar boundary layer` Agricultural and Forest Meteorology 54.2, pp. 107-136. .. _collatz1992: +|br| + Collatz, Go J, M Ribas-Carbo, and JA Berry (1992). `Coupled photosynthesis-stomatal conductance model for leaves of C4 plants`. Functional Plant Biology 19.5, pp. 519-538.
 .. _farquhar1980: +|br| + Farquhar, GD, S von von Caemmerer, and JA Berry (1980). `A biochemical model of photosynthetic CO2 assimilation in leaves of C3 species`. Planta 149.1, pp. 780-90. .. _fisher2010: -Fisher, JB et al. (2010). `Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation`. Global Biogeochemical Cycles 24.1. +|br| + +Fisher, JB et al. (2010). `Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation`. Global Biogeochemical Cycles 24.1. .. _foley1996: -Foley, Jonathan A et al. (1996). `An integrated biosphere model of land surface processes, terrestrial carbon balance, and vegetation dynamics`. Global Biogeochemical Cycles 10.4, pp. 603-628. +|br| + +Foley, Jonathan A et al. (1996). `An integrated biosphere model of land surface processes, terrestrial carbon balance, and vegetation dynamics`. Global Biogeochemical Cycles 10.4, pp. 603-628. .. _fyllas2014: +|br| + Fyllas, NM et al. (2014). `Analysing Amazonian forest productivity using a new individual and trait- based model (TFS v. 1)`. Geoscientific Model Development 7.4, pp. 1251-1269. .. _kucharik1998: +|br| + Kucharik, Christopher J, John M Norman, and Stith T Gower (1998). `Measurements of branch area and adjusting leaf area index indirect measurements`. Agricultural and Forest Meteorology 91.1, pp. 69-88. .. _li2012: +|br| + Li, F, XD Zeng, and S Levis (2012). `A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model`. Biogeosciences 9.7, pp. 2761-2780. .. _lichstein2011: +|br| + Lichstein, Jeremy W and Stephen W Pacala (2011). `Local diversity in heterogeneous landscapes: quantitative assessment with a height-structured forest metacommunity model`. Theoretical Ecology 4.2, pp. 269-281. .. _lischke2006: +|br| + Lischke, Heike et al. (2006). `TreeMig: a forest-landscape model for simulating spatio-temporal patterns from stand to landscape scale`. Ecological Modelling 199.4, pp. 409-420. 41 .. _lloyd2010: - -Lloyd, J et al. (2010). `Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees`. Biogeosciences 7.6, pp. 1833-1859. + +|br| + +Lloyd, J et al. (2010). `Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees`. Biogeosciences 7.6, pp. 1833-1859. .. _mcdowell2013: -McDowell, Nate G et al. (2013). `Evaluating theories of drought-induced vegetation mortality using a multimodel experiment framework`. New Phytologist 200.2, pp. 304-321. +|br| + +McDowell, Nate G et al. (2013). `Evaluating theories of drought-induced vegetation mortality using a multimodel experiment framework`. New Phytologist 200.2, pp. 304-321. .. _medlyn2011: -Medlyn, Belinda E et al. (2011). `Reconciling the optimal and empirical approaches to modelling stom- atal conductance`. Global Change Biology 17.6, pp. 2134-2144. +|br| + +Medlyn, Belinda E et al. (2011). `Reconciling the optimal and empirical approaches to modelling stom- atal conductance`. Global Change Biology 17.6, pp. 2134-2144. .. _mc_2001: +|br| + Moorcroft, PR, GC Hurtt, and Stephen W Pacala (2001). `A method for scaling vegetation dynamics: the ecosystem demography model ED`. Ecological monographs 71.4, pp. 557-586. .. _norman1979: - -Norman, JM (1979). `Modeling the complete crop canopy`. Modification of the Aerial Environment of Crops, pp. 249-280. + +|br| + +Norman, JM (1979). `Modeling the complete crop canopy`. Modification of the Aerial Environment of Crops, pp. 249-280. .. _oleson2013: -Oleson, KW et al. (2013). `Technical description of version 4.5 of the Community Land Model (CLM)`. +|br| + +Oleson, KW et al. (2013). `Technical description of version 4.5 of the Community Land Model (CLM)`. .. _peterson1986: -Peterson, David L and Kevin C Ryan (1986). `Modeling postfire conifer mortality for long-range planning`. Environmental Management 10.6, pp. 797-808. +|br| + +Peterson, David L and Kevin C Ryan (1986). `Modeling postfire conifer mortality for long-range planning`. Environmental Management 10.6, pp. 797-808. .. _pfeiffer2013: -Pfeiffer, M, A Spessa, and JO Kaplan (2013). `A model for global biomass burning in preindustrial time: LPJ-LMfire (v1. 0)`. Geoscientific Model Development 6.3, pp. 643-685. +|br| + +Pfeiffer, M, A Spessa, and JO Kaplan (2013). `A model for global biomass burning in preindustrial time: LPJ-LMfire (v1. 0)`. Geoscientific Model Development 6.3, pp. 643-685. .. _purves2008: -Purves, Drew W et al. (2008). `Predicting and understanding forest dynamics using a simple tractable model`. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. +|br| + +Purves, Drew W et al. (2008). `Predicting and understanding forest dynamics using a simple tractable model`. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. .. _sato2007: -Sato, Hisashi, Akihiko Itoh, and Takashi Kohyama (2007). `SEIB–DGVM: A new Dynamic Global Vegetation Model using a spatially explicit individual-based approach`. Ecological Modelling 200.3, pp. 2793307. +|br| + +Sato, Hisashi, Akihiko Itoh, and Takashi Kohyama (2007). `SEIB–DGVM: A new Dynamic Global Vegetation Model using a spatially explicit individual-based approach`. Ecological Modelling 200.3, pp. 2793307. .. _sellers1996: -Sellers, Piers J et al. (1996). `A revised land surface parameterization (SiB2) for atmospheric GCMs. Part II: The generation of global fields of terrestrial biophysical parameters from satellite data`. Journal of climate 9.4, pp. 706-737. +|br| + +Sellers, Piers J et al. (1996). `A revised land surface parameterization (SiB2) for atmospheric GCMs. Part II: The generation of global fields of terrestrial biophysical parameters from satellite data`. Journal of climate 9.4, pp. 706-737. .. _sitch2003: -Sitch, S et al. (2003). `Evaluation of ecosystem dynamics, plant geography and terrestrial carbon cycling in the LPJ dynamic global vegetation model`. Global Change Biology 9.2, pp. 161-185. +|br| + +Sitch, S et al. (2003). `Evaluation of ecosystem dynamics, plant geography and terrestrial carbon cycling in the LPJ dynamic global vegetation model`. Global Change Biology 9.2, pp. 161-185. .. _smith2007: -Smith, Alison M and Mark Stitt (2007). `Coordination of carbon supply and plant growth`. Plant, cell & environment 30.9, pp. 1126-1149. +|br| + +Smith, Alison M and Mark Stitt (2007). `Coordination of carbon supply and plant growth`. Plant, cell & environment 30.9, pp. 1126-1149. .. _smith2001: -Smith, Benjamin, I Colin Prentice, and Martin T Sykes (2001). `Representation of vegetation dynamics in the modelling of terrestrial ecosystems: comparing two contrasting approaches within European climate space`. Global Ecology and Biogeography 10.6, pp. 621-637. +|br| + +Smith, Benjamin, I Colin Prentice, and Martin T Sykes (2001). `Representation of vegetation dynamics in the modelling of terrestrial ecosystems: comparing two contrasting approaches within European climate space`. Global Ecology and Biogeography 10.6, pp. 621-637. .. _thonicke2010: -Thonicke, K et al. (2010). `The influence of vegetation, fire spread and fire behaviour on biomass burning and trace gas emissions: results from a process-based model`. Biogeosciences 7.6, pp. 1991-2011. +|br| + +Thonicke, K et al. (2010). `The influence of vegetation, fire spread and fire behaviour on biomass burning and trace gas emissions: results from a process-based model`. Biogeosciences 7.6, pp. 1991-2011. .. _uriarte2009: +|br| + Uriarte, Maria et al. (2009). `Natural disturbance and human land use as determinants of tropical forest dynamics: results from a forest simulator`. Ecological Monographs 79.3, pp. 423-443. .. _venevsky2002: +|br| + Venevsky, Sergey et al. (2002). `Simulating fire regimes in human-dominated ecosystems: Iberian Peninsula case study`. Global Change Biology 8.10, pp. 984-998. .. _weng2014: +|br| + Weng, ES et al. (2014). `Scaling from individuals to ecosystems in an Earth System Model using a mathematically tractable model of height-structured competition for light`. Biogeosciences Discussions 11.12, pp. 17757-17860. .. _xiaodong2005: -Xiaodong, Yan and HH Shugart (2005). `FAREAST: a forest gap model to simulate dynamics and patterns of eastern Eurasian forests`. Journal of Biogeography 32.9, pp. 1641-1658. -42 +|br| +Xiaodong, Yan and HH Shugart (2005). `FAREAST: a forest gap model to simulate dynamics and patterns of eastern Eurasian forests`. Journal of Biogeography 32.9, pp. 1641-1658. diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index 3f60029854..d54e70f1e9 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -11,7 +11,6 @@ CLM Technical Note .. toctree:: :maxdepth: 2 - :numbered: Introduction/CLM50_Tech_Note_Introduction.rst Ecosystem/CLM50_Tech_Note_Ecosystem.rst diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 510d4b22a2..bdb52253a1 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -11,7 +11,6 @@ CLM User's Guide .. toctree:: :maxdepth: 2 - :numbered: overview/index.rst setting-up-and-running-a-case/index.rst diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index de8dcc25fa..d6c5781a17 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -1,5 +1,21 @@ .. _introduction: +**User's Guide to version 5.0 of the Community Land Model (CLM)** + +**Authors: Benjamin Andre, Erik Kluzek, William Sacks** + +The National Center for Atmospheric Research (NCAR) is operated by the +nonprofit University Corporation for Atmospheric Research (UCAR) under +the sponsorship of the National Science Foundation. Any opinions, +findings, conclusions, or recommendations expressed in this publication +are those of the author(s) and do not necessarily reflect the views of +the National Science Foundation. + +National Center for Atmospheric Research +P. O. Box 3000, Boulder, Colorado 80307-300 + +.. _rst_Users_Guide_Introduction: + ============== Introduction ============== @@ -69,10 +85,10 @@ machine is working correctly. What is New with CLM4.5 ========================= -The CESM1.2.0 `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. +The CESM1.2.0 `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. More details are given in the `CLM ChangeLog file `_. -Previous release pages give similar list of changes for previous versions of the model. +Previous release pages give similar list of changes for previous versions of the model. The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates for versions up to CLM4 in CESM1.0.5. .. _users-guide-overview: @@ -81,51 +97,51 @@ The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates Overview of User's Guide ========================== -In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. -The next section `What is new with CLM4.5 in CESM1.2.0 since previous public releases? `_ gives references to describe the differences between CLM4.5 in CESM1.2.0 and previous CESM releases both from a scientific as well as a software engineering point of view. -For information on previous releases of CLM4.5 before CLM4.5 in CESM1.2.0 see the CESM1.1.1 documentation. -The next section `Quickstart to using CLM4.5 `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use CLM4.5. -The next `What is scientifically validated and functional in CLM4.5 in CESM1.2.0? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. -`What are the UNIX utilities required to use CLM4.5? `_ lists the UNIX utilities required to use CLM4.5 and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. -Next we have `Important Notes and Best Practices for Usage of CLM4.5 `_ to detail some of the best practices for using CLM4.5 for science. +In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. +The next section `What is new with CLM4.5 in CESM1.2.0 since previous public releases? `_ gives references to describe the differences between CLM4.5 in CESM1.2.0 and previous CESM releases both from a scientific as well as a software engineering point of view. +For information on previous releases of CLM4.5 before CLM4.5 in CESM1.2.0 see the CESM1.1.1 documentation. +The next section `Quickstart to using CLM4.5 `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use CLM4.5. +The next `What is scientifically validated and functional in CLM4.5 in CESM1.2.0? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. +`What are the UNIX utilities required to use CLM4.5? `_ lists the UNIX utilities required to use CLM4.5 and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. +Next we have `Important Notes and Best Practices for Usage of CLM4.5 `_ to detail some of the best practices for using CLM4.5 for science. The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and CLM4.5. -`Chapter 1 `_ goes into detail on how to setup and run simulations with CLM4.5 and especially how to customize cases. +`Chapter 1 `_ goes into detail on how to setup and run simulations with CLM4.5 and especially how to customize cases. Details of cesm_setup modes and build-namelist options as well as namelist options are given in this chapter. -`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or CLM4.5 physics for creating input datasets for use by CLM, for the expert user. -There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. -Then each tool is described in detail along with different ways in which the tool might be used. +`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or CLM4.5 physics for creating input datasets for use by CLM, for the expert user. +There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. +Then each tool is described in detail along with different ways in which the tool might be used. A final section on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. -As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. +As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and CLM4.5 physics). -In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. -For example, we give the protocol for spinning up the CLM4.5-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). -We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. -We also give instructions on running both the prognostic crop and irrigation models. +In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. +For example, we give the protocol for spinning up the CLM4.5-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). +We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. +We also give instructions on running both the prognostic crop and irrigation models. Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. -`Chapter 5 `_ outlines how to do single-point or regional simulations using CLM4.5. -This is useful to either compare CLM4.5 simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. -There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into `Chapter 2 `_ and also `Chapter 3 `_ to add the files into the build-namelist XML database. -The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). +`Chapter 5 `_ outlines how to do single-point or regional simulations using CLM4.5. +This is useful to either compare CLM4.5 simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. +There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into `Chapter 2 `_ and also `Chapter 3 `_ to add the files into the build-namelist XML database. +The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). CLM4 in CESM1.0.5 has a fully working versions of PTCLM. Need `Chapter 6 `_ blurb... -`Chapter 7 `_ gives some guidance on trouble-shooting problems when using CLM4.5. +`Chapter 7 `_ gives some guidance on trouble-shooting problems when using CLM4.5. It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. -`Chapter 8 `_ goes over the automated testing scripts for validating that the CLM is working correctly. -The test scripts run many different configurations and options with CLM4.0 physics as well and CLM4.5 physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. +`Chapter 8 `_ goes over the automated testing scripts for validating that the CLM is working correctly. +The test scripts run many different configurations and options with CLM4.0 physics as well and CLM4.5 physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. In general this is an activity important only for a developer of CLM4.5, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. In the appendices we talk about some issues that are useful for advanced users and developers of CLM4.5. -Finally in `Appendix A `_ we give instructions on how to build the documentation associated with CLM4.5 (i.e. how to build this document). -This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. +Finally in `Appendix A `_ we give instructions on how to build the documentation associated with CLM4.5 (i.e. how to build this document). +This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. This also could be useful for developers who need to update the documentation due to changes they have made. .. _best-practices-for-usage: @@ -134,40 +150,40 @@ This also could be useful for developers who need to update the documentation du Best Practices ================ -- CLM4.5 includes BOTH the old CLM4.0 physics AND the new CLM4.5 physics and you can toggle between two. - The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. - While the "standard" practice for CLM4.5 is to run with BGC on, and CRUNCEP atmospheric forcing. +- CLM4.5 includes BOTH the old CLM4.0 physics AND the new CLM4.5 physics and you can toggle between two. + The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. + While the "standard" practice for CLM4.5 is to run with BGC on, and CRUNCEP atmospheric forcing. "BGC" is the new CLM4.5 biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). -- When running with CLMCN (either CLM4.0 or CLM4.5 physics) or CLM4.5-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for CLM4.5 or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). - Simulations without a proper spinup will effectively be starting from an unvegetated world. +- When running with CLMCN (either CLM4.0 or CLM4.5 physics) or CLM4.5-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for CLM4.5 or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). + Simulations without a proper spinup will effectively be starting from an unvegetated world. See `the Section called Setting Your Initial Conditions File in Chapter 1 `_ for information on how to provide initial conditions for your simulation. -- Initial condition files are provided for CLM4.0-CN as before, for fully coupled BCN and offline ICN cases for 1850 and 2000 at finite volume grids: 1deg (0.9x1.25), 2deg (1.9x2.5), and T31 resolutions. - We also have interpolated initial conditions for BCN for 1850 and 2000 for two finite volume grids: 10x15, 4x5 and two HOMME grids (ne30np4 and ne120np4). - There's also an initial condition file for ICN with the prognostic crop model for 2000 at 2deg resolution, and one with CLMSP for 2000 at 2deg resolution. - We also have initial conditions for offline CNDV for 1850. - The 1850 initial condition files are in 'reasonable' equilibrium. - The 2000 initial condition files represent the model state for the year 2000, and have been taken from transient simulations. - Therefore, by design the year 2000 initial condition files do not represent an equilibrium state. +- Initial condition files are provided for CLM4.0-CN as before, for fully coupled BCN and offline ICN cases for 1850 and 2000 at finite volume grids: 1deg (0.9x1.25), 2deg (1.9x2.5), and T31 resolutions. + We also have interpolated initial conditions for BCN for 1850 and 2000 for two finite volume grids: 10x15, 4x5 and two HOMME grids (ne30np4 and ne120np4). + There's also an initial condition file for ICN with the prognostic crop model for 2000 at 2deg resolution, and one with CLMSP for 2000 at 2deg resolution. + We also have initial conditions for offline CNDV for 1850. + The 1850 initial condition files are in 'reasonable' equilibrium. + The 2000 initial condition files represent the model state for the year 2000, and have been taken from transient simulations. + Therefore, by design the year 2000 initial condition files do not represent an equilibrium state. Note also that spinning the 2000 initial conditions out to equilibrium will not reflect the best estimate of the real carbon/nitrogen state for the year 2000. - -- Initial condition files are also provided for CLM4.5 for several configurations and resolutions. - For CLM4.5-SP and CLM4.5-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. - The CLM4.5-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. + +- Initial condition files are also provided for CLM4.5 for several configurations and resolutions. + For CLM4.5-SP and CLM4.5-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. + The CLM4.5-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. Also the CLM4.5-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg CLM4.5-BGC-DV and 2deg CLM4.5-BGC-Crop. - -- Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. + +- Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. Interpolated initial condition files may no longer be in 'reasonable' equilibrium. -- In CLM4.5 for both CLM4.5-CN and CLM4.5-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). - By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. - Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. +- In CLM4.5 for both CLM4.5-CN and CLM4.5-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). + By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. + Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. If you are running with an atmosphere model or forcing that is significantly different than present day -- the lightning frequency may NOT appropriately correspond to your atmosphere forcing and fire initiation would be inappropriate. - -- Aerosol deposition is a required field to both CLM4.0 and CLM4.5 physics, sent from the atmosphere model. - Simulations without aerosol deposition will exhibit unreasonably high snow albedos. - The model sends aerosol deposition from the atmospheric model (either CAM or DATM). + +- Aerosol deposition is a required field to both CLM4.0 and CLM4.5 physics, sent from the atmosphere model. + Simulations without aerosol deposition will exhibit unreasonably high snow albedos. + The model sends aerosol deposition from the atmospheric model (either CAM or DATM). When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. .. _how-to-use-this-document: @@ -185,15 +201,14 @@ Links to descriptions and definitions have been provided in the code below. We u Where examples from an interactive shell session are presented, lines starting with > indicate the shell prompt. A backslash "\" at the end of a line means the line continues onto the next one (as it does in - standard UNIX shell). Note that $EDITOR" is used to refer to the - text editor of your choice. $EDITOR is a standard UNIX environment - variable and should be set on most UNIX systems. Comment lines are + standard UNIX shell). Note that $EDITOR" is used to refer to the + text editor of your choice. $EDITOR is a standard UNIX environment + variable and should be set on most UNIX systems. Comment lines are signaled with a "#" sign, which is the standard UNIX comment sign as well. $CSMDATA is used to denote the path to the inputdata directory for - your CESM data. + your CESM data. > This is a shell prompt with commands \ that continues to the following line. > $EDITOR filename # means you are using a text editor to edit "filename" # This is a comment line - From 4a4604b93962339cc7c9ed06aa8bf76f2925b299 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Mon, 29 Jan 2018 14:50:22 -0700 Subject: [PATCH 126/730] Updated Stomatal Resistance chapter based on comments from Gordon --- .../CLM50_Tech_Note_Photosynthesis.rst | 69 ++++++++----------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index b8e443f10a..8dad4faf3e 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -40,9 +40,6 @@ area indices (section :numref:`Solar Fluxes`). Canopy conductance is :math:`\frac{1}{r_{b} +r_{s}^{sun} } L^{sun} +\frac{1}{r_{b} +r_{s}^{sha} } L^{sha}` , where :math:`r_{b}` is the leaf boundary layer resistance (section :numref:`Sensible and Latent Heat Fluxes and Temperature for Vegetated Surfaces`). -The implementation is described by Bonan et al. (:ref:`2011 `), though different -methods of calculating stomatal conductance, :math:`J_{max}`, and the nitrogen variables -used to calculate :math:`V_{cmax25}` are used in CLM5. .. _Stomatal resistance: @@ -60,7 +57,7 @@ Leaf stomatal resistance is: .. math:: :label: 9.1 - \frac{1}{r_{s} } =g_{s} = g_{o} + (1 + \frac{g_{1} }{\sqrt{D}}) \frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } + \frac{1}{r_{s} } =g_{s} = g_{o} + 1.6(1 + \frac{g_{1} }{\sqrt{D}}) \frac{A_{n} }{{c_{s} \mathord{\left/ {\vphantom {c_{s} P_{atm} }} \right. \kern-\nulldelimiterspace} P_{atm} } } where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` :math:`\mu`\ mol\ :sup:`-1`), :math:`g_{o}` is the minimum stomatal conductance @@ -68,20 +65,9 @@ where :math:`r_{s}` is leaf stomatal resistance (s m\ :sup:`2` photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric -pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (Pa). -:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`) -and can be calculated as +pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (kPa). +:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`). -.. math:: - :label: 9.2 - - g_{1} = {\sqrt{\frac{3\Gamma\lambda}{1.6}}} - -where :math:`\Gamma` (mol mol\ :sup:`-1`) is the CO\ :sub:`2` compensation point -for photosynthesis without dark respiration, -1.6 is the ratio of diffusivity of CO\ :sub:`2` to H\ :sub:`2` O and :math:`\lambda` -(mol H\ :sub:`2` O mol\ :sup:`-1`) is a parameter -describing the marginal water cost of carbon gain. The value for :math:`g_{o}=100` :math:`\mu` mol m :sup:`-2` s\ :sup:`-1` for C\ :sub:`3` and C\ :sub:`4` plants. Photosynthesis is calculated for sunlit (:math:`A^{sun}`) and shaded @@ -93,7 +79,7 @@ the :ref:`rst_Plant Hydraulics` chapter. Resistance is converted from units of s m\ :sup:`2` :math:`\mu` mol\ :sup:`-1` to s m\ :sup:`-1` as: 1 s m\ :sup:`-1` = :math:`1\times 10^{-9} R_{gas} \frac{\theta _{atm} }{P_{atm} }` -:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, [same as 4.5, but units seem off. check that units are correct] +:math:`\mu` mol\ :sup:`-1` m\ :sup:`2` s, where :math:`R_{gas}` is the universal gas constant (J K\ :sup:`-1` kmol\ :sup:`-1`) (:numref:`Table Physical constants`) and :math:`\theta _{atm}` is the atmospheric potential temperature (K). @@ -270,6 +256,7 @@ depend on temperature. Values at 25 :sup:`o` \ C are :math:`\Gamma _{25} {\rm =42}.75\times 10^{-6} P_{atm}`. :math:`V_{c\max }`, :math:`J_{\max }`, :math:`T_{p}`, :math:`k_{p}`, and :math:`R_{d}` also vary with temperature. Parameter values at 25 +[verify with Rosie that LUNA doesn't do this otherwise] :sup:`o`\ C are calculated from :math:`V_{c\max }` \ at 25 :sup:`\o`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}`, :math:`T_{p25} =0.167V_{c\max 25}`, and @@ -293,7 +280,7 @@ The parameters :math:`V_{c\max 25}`, \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma } & {=} & {\Gamma _{25} \; f\left(T_{v} \right)} \end{array} -with +[check with Rosie about Rd equation above and below (eq. 14)] with .. math:: :label: 9.11 @@ -522,14 +509,33 @@ resistance (:math:`r_{s}` ) as a function of photosynthesis .. math:: :label: 9.36 - c_{s} g_{s}^{2} +\left[c_{s} \left(g_{b} -b\right)-m{\it A}_{n} P_{atm} \right]g_{s} -g_{b} \left[c_{s} b+mA_{n} P_{atm} {e_{a} \mathord{\left/ {\vphantom {e_{a} e_{\*} \left(T_{v} \right)}} \right. \kern-\nulldelimiterspace} e_{\*} \left(T_{v} \right)} \right]=0. + g_{s}^{2} + bg_{s} + c = 0 -Stomatal conductance is the larger of the two roots that satisfy the -quadratic equation. Values for :math:`c_{i}` are given by +where .. math:: :label: 9.37 + b = 2(g_{o} * 10^{-6} + d) + \frac{(g_{1}d)^{2}}{g_{b}*10^{-6}D} + + c = (g_{o}*10^{-6})^{2} + [2g_{o}*10^{-6} + d \frac{1-g_{1}^{2}} {D}]d + +and + +.. math:: + :label: 9.38 + + d = \frac {1.6 A_{n}} {c_{s} / P_{atm} * 10^{6}} + + D = \frac {e_{i} - e_{a}} {1000} + + +Stomatal conductance, as solved by equation :eq:`9.36` (mol m :sup:`-2` s :sup:`-1`), is the larger of the two roots that satisfy the +quadratic equation. Values for :math:`c_{i}` are given by + +.. math:: + :label: 9.39 + c_{i} =c_{a} -\left(1.4r_{b} +1.6r_{s} \right)P_{atm} A{}_{n} The equations for :math:`c_{i}` , :math:`c_{s}` , :math:`r_{s}` , and @@ -541,23 +547,4 @@ combines the secant method and Brent’s method to solve for (:math:`A_{n}^{sun}` , :math:`r_{s}^{sun}` ) and shaded (:math:`A_{n}^{sha}` , :math:`r_{s}^{sha}` ) leaves. -The model has an optional (though not supported) multi-layer canopy, as -described by :ref:`Bonan et al. (2012)`. The multi-layer model is only intended -to address the non-linearity of light profiles, photosynthesis, and -stomatal conductance in the plant canopy. In the multi-layer canopy, -sunlit (:math:`A_{n}^{sun}` , :math:`r_{s}^{sun}` ) and shaded -(:math:`A_{n}^{sha}` , :math:`r_{s}^{sha}` ) leaves are explicitly -resolved at depths in the canopy using a light profile (Chapter :numref:`rst_Radiative Fluxes`). In -this case, :math:`V_{c\max 25}` is not integrated over the canopy, but -is instead given explicitly for each canopy layer using equation :eq:`9.18`. This -also uses the :ref:`Lloyd et al. (2010)` relationship whereby -K\ :sub:`n` scales with V\ :sub:`cmax` as - -.. math:: - :label: 9.38 - - K_{n} =\exp \left(0.00963V_{c\max } -2.43\right) -such that higher values of V\ :sub:`cmax` imply steeper declines -in photosynthetic capacity through the canopy with respect to cumulative -leaf area. From f52ce6c93555d6bec7f0436893dc78fe759556ea Mon Sep 17 00:00:00 2001 From: mvertens Date: Mon, 29 Jan 2018 20:03:36 -0700 Subject: [PATCH 127/730] new Makefiles introduced: to build pdf issue "make -f Makefile.tech_note latexpdf" TWICE and then open the file build/tech_note/latex/clmdoc.pdf --- doc/Makefile.tech_note | 20 ++++ doc/Makefile.users_guide | 20 ++++ doc/source/tech_note/conf.py | 170 +++++++++++++++++++++++++++++++++ doc/source/users_guide/conf.py | 170 +++++++++++++++++++++++++++++++++ 4 files changed, 380 insertions(+) create mode 100644 doc/Makefile.tech_note create mode 100644 doc/Makefile.users_guide create mode 100644 doc/source/tech_note/conf.py create mode 100644 doc/source/users_guide/conf.py diff --git a/doc/Makefile.tech_note b/doc/Makefile.tech_note new file mode 100644 index 0000000000..07ebab36e6 --- /dev/null +++ b/doc/Makefile.tech_note @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = clmdoc +SOURCEDIR = source/tech_note +BUILDDIR = build/tech_note + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile.tech_note + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/Makefile.users_guide b/doc/Makefile.users_guide new file mode 100644 index 0000000000..08562d18ca --- /dev/null +++ b/doc/Makefile.users_guide @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = clmdoc +SOURCEDIR = source/users_guide +BUILDDIR = build/users_guide + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile.users_guide + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/doc/source/tech_note/conf.py b/doc/source/tech_note/conf.py new file mode 100644 index 0000000000..a866c7f3fb --- /dev/null +++ b/doc/source/tech_note/conf.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +# +# clmdoc documentation build configuration file, created by +# sphinx-quickstart on Thu Feb 23 17:14:30 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.imgmath', + 'sphinx.ext.githubpages'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'clmdoc' +copyright = u'2017, Erik Kluzek, Bill Sacks, Ben Andre' +author = u'Erik Kluzek, Bill Sacks, Ben Andre' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'' +# The full version, including alpha/beta/rc tags. +release = u'' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'bizstyle' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'clmdocdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + 'preamble': '\\usepackage{hyperref}', + + 'fncychap': '\\usepackage[Conny]{fncychap}', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [(master_doc, 'clmdoc.tex', u'CLM5 Documentation', '', 'manual'),] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + author, 'clmdoc', 'One line description of project.', + 'Miscellaneous'), +] + + + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} + +numfig = True +numfig_format = {'figure': 'Figure %s', + 'table': 'Table %s', + 'code-block': 'Code %s', + 'section': '%s', + } diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py new file mode 100644 index 0000000000..a866c7f3fb --- /dev/null +++ b/doc/source/users_guide/conf.py @@ -0,0 +1,170 @@ +# -*- coding: utf-8 -*- +# +# clmdoc documentation build configuration file, created by +# sphinx-quickstart on Thu Feb 23 17:14:30 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.imgmath', + 'sphinx.ext.githubpages'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'clmdoc' +copyright = u'2017, Erik Kluzek, Bill Sacks, Ben Andre' +author = u'Erik Kluzek, Bill Sacks, Ben Andre' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'' +# The full version, including alpha/beta/rc tags. +release = u'' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'bizstyle' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'clmdocdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + 'preamble': '\\usepackage{hyperref}', + + 'fncychap': '\\usepackage[Conny]{fncychap}', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [(master_doc, 'clmdoc.tex', u'CLM5 Documentation', '', 'manual'),] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'clmdoc', u'clmdoc Documentation', + author, 'clmdoc', 'One line description of project.', + 'Miscellaneous'), +] + + + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} + +numfig = True +numfig_format = {'figure': 'Figure %s', + 'table': 'Table %s', + 'code-block': 'Code %s', + 'section': '%s', + } From 9564f466a4f1de4079f3add4d8ba1fa00383f629 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 31 Jan 2018 11:46:32 -0700 Subject: [PATCH 128/730] Updated figure 1, fixed Figure and Table descriptions and links --- .../CLM50_Tech_Note_Decomposition.rst | 4 +-- .../CLM50_Tech_Note_Introduction.rst | 36 ++++++++----------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst index 30c9b3988d..0d2ad98687 100644 --- a/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst +++ b/doc/source/tech_note/Decomposition/CLM50_Tech_Note_Decomposition.rst @@ -101,7 +101,7 @@ for the coarse woody debris pool (CWD). .. _Table Decomposition rate constants: -.. table:: Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. +.. table:: Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters for the CLM-CN decomposition pool structure. +--------------------------+------------------------------------------------+-----------------------------------------------+---------------+-----------------------------------------+ | | Biome-BGC | CLM-CN | | | @@ -195,7 +195,7 @@ those described in Parton et al. (1988) (:numref:`Table Turnover times`). .. _Table Turnover times: -.. table:: Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. +.. table:: Turnover times, C:N ratios, and acceleration parameters for the Century-based decomposition cascade. +------------+------------------------+-------------+-------------------------------------------+ | | Turnover time (year) | C:N ratio | Acceleration term (:math:`{a}_{i}`) | diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 339ec3d05f..a887e5d9fc 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -1,4 +1,4 @@ -**July 2017** +**February 2018** **Technical Description of version 5.0 of the Community Land Model (CLM)** @@ -31,7 +31,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 **LIST OF FIGURES** -- :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM4.5). +- :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM5.0). - :numref:`Figure CLM subgrid hierarchy` Configuration of the CLM subgrid hierarchy. @@ -57,25 +57,19 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. -- :numref:`Figure Carbon and nitrogen pools` Carbon and nitrogen pools. - - :numref:`Figure annual phenology cycle` Example of annual phenology cycle for seasonal deciduous. -- 14.2. Example fluxes and pools sizes for an onset growth period of 15 days, with initial transfer pool size of 100 gC m-2 and a timestep of one hour. a) Flux leaving transfer pool (e.g. CFleaf\_xfer,leaf). b) Carbon content of transfer pool and its associated display pool (e.g. CSleaf\_xfer and CSleaf, respectively). - -- 14.3. Example fluxes and pool sizes for an offset (litterfall) period of 15 days, with initial display pool size of 100 gC m-2 and a timestep of one hour. a) Litterfall flux (e.g CFleaf,litter). b) Carbon content of display pool and litter pool through the litterfall period, ignoring the losses from litter pool due to decomposition during this period. - - :numref:`Figure Schematic of decomposition model in CLM` Schematic of decomposition model in CLM. -- :numref:`Figure Pool structure` Pool structure, transitions, respired fractions (numbers at end of arrows), and turnover times (numbers in boxes) for the 2 alternate soil decomposition models included in CLM. +- :numref:`Figure Pool structure` Pool structure, transitions, respired fractions, and turnover times for the 2 alternate soil decomposition models included in CLM. - :numref:`Figure Biological nitrogen fixation` Biological nitrogen fixation as a function of annual net primary production. -- :numref:`Figure Methane Schematic` Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. (left) Fully inundated portion of a CLM gridcell and (right) variably saturated portion of a gridcell. +- :numref:`Figure Methane Schematic` Schematic representation of biological and physical processes integrated in CLM that affect the net CH4 surface flux. - :numref:`Figure Schematic of land cover change` Schematic of land cover change impacts on CLM carbon pools and fluxes. -- :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM4 plant functional types. +- :numref:`Figure Schematic of translation of annual LUH2 land units` Schematic of translation of annual UNH land units to CLM plant functional types. **LIST OF TABLES** @@ -89,7 +83,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Land model output to atmospheric model` Land model output to atmospheric model -- :numref:`Table Surface data required for CLM and their base spatial resolution` Surface data required for CLM4.5 and their base spatial resolution +- :numref:`Table Surface data required for CLM and their base spatial resolution` Surface data required for CLM and their base spatial resolution - :numref:`Table Physical constants` Physical constants @@ -113,7 +107,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Coefficients for saturation vapor pressure` Coefficients for e\ :sub:`sat`\ :sup:`T` -- :numref:`Table Coefficients for derivative of esat` Coefficients for 112:numref:`` 6.1. Soil layer structure. +- :numref:`Table Coefficients for derivative of esat` Coefficients for the derivative of e\ :sub:`sat`\ :sup:`T` - :numref:`Table Meltwater scavenging` Meltwater scavenging efficiency for particles within snow @@ -129,11 +123,11 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Allocation and CN ratio parameters` Allocation and carbon:nitrogen ratio parameters -- :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the CLM-CN decomposition pool structure. +- :numref:`Table Decomposition rate constants` Decomposition rate constants for litter and SOM pools, C:N ratios, and acceleration parameters for the CLM-CN decomposition pool structure. - :numref:`Table Respiration fractions for litter and SOM pools` Respiration fractions for litter and SOM pools -- :numref:`Table Turnover times` Turnover times, C:N ratios, and acceleration parameters (see section 15.8 for explanation) for the Century-based decomposition cascade. +- :numref:`Table Turnover times` Turnover times, C:N ratios, and acceleration parameters for the Century-based decomposition cascade. - :numref:`Table Respiration fractions for Century-based structure` Respiration fractions for litter and SOM pools for Century-based structure @@ -143,13 +137,11 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Table Temperature dependence of aqueous and gaseous diffusion` Temperature dependence of aqueous and gaseous diffusion coefficients for CH4 and O2. -- :numref:`Table Crop plant functional types` Crop plant functional types (pfts) in CLM4.5CNcrop and their parameters relating to phenology and morphology. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. - -- :numref:`Table Crop plant functional types` Crop pfts in CLM4.5CNcrop and their parameters relating to allocation. Numbers in the first column correspond to the list of pfts in :numref:`Table Plant functional types`. +- :numref:`Table Crop plant functional types` Crop plant functional types (PFTs). -- :numref:`Table Crop allocation parameters` Crop allocation parameters for the active crop plant functional types (pfts) in CLM5BGCCROP. Numbers in the first row correspond to the list of pfts in :numref:`Table Crop plant functional types`. +- :numref:`Table Crop phenology parameters` Crop phenology and morphology parameters. -- :numref:`Table Plant functional type (PFT) biogeography rules` Plant functional type (PFT) biogeography rules with respect to climate. +- :numref:`Table Crop allocation parameters` Crop allocation parameters. - :numref:`Table Dust Mass fraction` Mass fraction m\ :sub:`i` , mass median diameter :sub:`v, i` , and geometric standard deviation :sub:`g, i` , per dust source mode i @@ -614,7 +606,7 @@ processes simulated include (:numref:`Figure Land processes`): #. External nitrogen cycling including deposition, denitrification, leaching, and losses due to fire (Chapter :numref:`rst_External Nitrogen Cycle`) -#. Plant mortality (Chapter :numref:`rst_Plant_Mortality`) +#. Plant mortality (Chapter :numref:`rst_Plant Mortality`) #. Fire ignition, suppression, spread, and emissions, including natural, deforestation, and agricultural fire (Chapter :numref:`rst_Fire`) @@ -635,4 +627,4 @@ processes simulated include (:numref:`Figure Land processes`): .. figure:: image1.png - Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from :ref:`Lawrence et al. (2011)` for CLM4.5). + Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from :ref:`Lawrence et al. (2011)` for CLM5.0). From 617a481ac2350376a9dd5a5c1405e83d54efd562 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 31 Jan 2018 13:32:17 -0700 Subject: [PATCH 129/730] Use svn rather than the default png for math images This makes the images appear much more crisp - less blurry. I did a quick visual inspection of the resulting html, and found a few problems with the svg images that I needed to fix: - CLM50_Tech_Note_Soil_Snow_Temperatures.rst There was a long array equation that didn't get rendered properly. I fixed this by breaking it into a bunch of separate equations. (Breaking it into two arrays worked, too, but it seemed cleaner just to break it into all of its pieces.) - CLM50_Tech_Note_Transient_Landcover.rst There were a few buggy math equations. I also cleaned this up a bit by removing some unnecessary '\' characters. --- doc/source/conf.py | 1 + ...CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 22 ++++++++++++++----- .../CLM50_Tech_Note_Transient_Landcover.rst | 18 +++++++-------- doc/source/tech_note/conf.py | 1 + doc/source/users_guide/conf.py | 1 + 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a866c7f3fb..5c5b1d86ad 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -81,6 +81,7 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True +imgmath_image_format = 'svg' # -- Options for HTML output ---------------------------------------------- diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 780ccb4752..10c00ae1e5 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -71,24 +71,29 @@ and the thickness of each layer is a function of snow depth .. math:: - \begin{array}{lr} - \left\{ \begin{array}{l} snl=-1 \\ \Delta z_{0} = z_{sno} \end{array} \right\} & \qquad {\rm for\; 0.01}\le {\rm z}_{{\rm sno}} \le 0.03 \\ +.. math:: + \left\{ \begin{array}{l} snl=-2 \\ \Delta z_{-1} ={z_{sno} \mathord{\left/ {\vphantom {z_{sno} 2}} \right. \kern-\nulldelimiterspace} 2} \\ \Delta z_{0} = \Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.03}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.04 \\ +.. math:: + \left\{ \begin{array}{l} snl=-2 \\ \Delta z_{-1} = 0.02 \\ \Delta z_{0} = z_{sno} -\Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.04}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.07 \\ + +.. math:: + \left\{ \begin{array}{l} snl=-3 \\ \Delta z_{-2} = 0.02 \\ @@ -96,6 +101,8 @@ and the thickness of each layer is a function of snow depth \Delta z_{0} = \Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.07}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.12 \\ +.. math:: + \left\{ \begin{array}{l} snl=-3 \\ \Delta z_{-2} = 0.02 \\ @@ -103,6 +110,8 @@ and the thickness of each layer is a function of snow depth \Delta z_{0} = z_{sno} -\Delta z_{-2} -\Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.12}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.18 \\ +.. math:: + \left\{ \begin{array}{l} snl=-4 \\ \Delta z_{-3} = 0.02 \\ @@ -111,6 +120,8 @@ and the thickness of each layer is a function of snow depth \Delta z_{0} =\Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.18}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.29 \\ +.. math:: + \left\{ \begin{array}{l} snl=-4 \\ \Delta z_{-3} = 0.02 \\ @@ -119,6 +130,8 @@ and the thickness of each layer is a function of snow depth \Delta z_{0} = z_{sno} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.29}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.41 \\ +.. math:: + \left\{ \begin{array}{l} snl=-5 \\ \Delta z_{-4} = 0.02 \\ @@ -126,9 +139,10 @@ and the thickness of each layer is a function of snow depth \Delta z_{-2} = 0.11 \\ \Delta z_{-1} = {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right)\mathord{\left/ {\vphantom {\left(z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} \right) 2}} \right. \kern-\nulldelimiterspace} 2} \\ \Delta z_{0} = \Delta z_{-1} - \end{array} \right\} & \qquad {\rm for\; 0.41}\, {\rm <}\, {\rm z}_{{\rm sno}} \le 0.64 \\ +.. math:: + \left\{ \begin{array}{l} snl=-5 \\ \Delta z_{-4} = 0.02 \\ @@ -138,8 +152,6 @@ and the thickness of each layer is a function of snow depth \Delta z_{0} = z_{sno} -\Delta z_{-4} -\Delta z_{-3} -\Delta z_{-2} -\Delta z_{-1} \end{array} \right\} & \qquad {\rm for\; 0.64}\, {\rm <}\, {\rm z}_{{\rm sno}} - \end{array} - The node depths, which are located at the midpoint of the snow layers, and the layer interfaces are both referenced from the soil surface and are defined as negative values diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index e8edb60222..493cfb2829 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -55,7 +55,7 @@ the calendar year for the current timestep, :math:`landuse.timeseries\_ year(nyears)` are the first and last calendar years in the *landuse.timeseries* dataset, respectively, :math:`nyears` is the number of years in the *landuse.timeseries* dataset, :math:`nt_{1}` and :math:`nt_{2}` -:math:`{}_{ }`\ are the two bracketing years used in the interpolation +are the two bracketing years used in the interpolation algorithm, and :math:`n` is the index value for the :math:`landuse.timeseries\_ year` array corresponding to :math:`landuse.timeseries\_ year(n)=year_{cur}` : @@ -75,7 +75,7 @@ dataset uses a simple linear algorithm, based on the conversion of the current time step information into a floating-point value for the number of calendar days since January 1 of the current model year (:math:`cday`). The interpolation weight for the current time step -:math:`tw_{cday}` \ :math:`{}_{ }`\ is +:math:`tw_{cday}` is .. math:: :label: 26.3) @@ -85,9 +85,9 @@ of calendar days since January 1 of the current model year where the numerator is 366 instead of 365 because the time manager function for CLM returns a value of :math:`cday=1.0` for midnight Greenwich mean time on January 1. With weights :math:`w_{p} (nt_{1} )` -and :math:`w_{p} (nt_{2} )`\ obtained from the *landuse.timeseries* dataset for fertilizer and wood harvest +and :math:`w_{p} (nt_{2} )` obtained from the *landuse.timeseries* dataset for fertilizer and wood harvest *p* at the bracketing annual time slices -:math:`nt_{1}` \ :math:`{}_{ }`\ and :math:`nt_{2}` , the interpolated +:math:`nt_{1}` and :math:`nt_{2}` , the interpolated application rate for the current time step (:math:`w_{p,t}` ) is .. math:: @@ -98,7 +98,7 @@ application rate for the current time step (:math:`w_{p,t}` ) is The form of this equation is designed to improve roundoff accuracy performance, and guarantees :math:`w_{p,t}` stays in the range [0,1]. Note that values for :math:`w_{p} (nt_{1} )`, :math:`w_{p} (nt_{2} )`, -and :math:`w_{p,t}` \ :math:`{}_{ }`\ are fractional weights at the +and :math:`w_{p,t}` are fractional weights at the column level of the subgrid hierarchy. The change in weight for a fertilizer or wood harvest rate between the current and previous time @@ -130,14 +130,14 @@ balance is calculated, W_{tot,1} =W_{a} +W_{sno} +\sum _{i=1}^{N_{levgrnd} }\left(w_{liq,i} +w_{ice,i} \right) +\sum _{j=1}^{npft}\left(W_{can,j} wt_{j,1} \right) where :math:`W_{a}` is the aquifer water, :math:`W_{sno}` is the snow -water, :math:`w_{liq,i}` and :math:`w_{ice,i}` \ are the liquid and ice -soil water contents, :math:`W_{can,j}` \ is the canopy water content for +water, :math:`w_{liq,i}` and :math:`w_{ice,i}` are the liquid and ice +soil water contents, :math:`W_{can,j}` is the canopy water content for PFT and CFT :math:`j`, and :math:`wt_{j,1}` is the PFT or CFT weight for :math:`j`. For the situation where PFT and CFT weights are changing, any difference -between :math:`W_{tot,1}` and :math:`W_{tot,2}` \ are due to +between :math:`W_{tot,1}` and :math:`W_{tot,2}` are due to differences in the total canopy water before and after the PFT and CFT weight change. To ensure conservation, the typically very small -difference between :math:`W_{tot,2}` \ and :math:`W_{tot,1}` is +difference between :math:`W_{tot,2}` and :math:`W_{tot,1}` is subtracted from the grid cell runoff .. math:: diff --git a/doc/source/tech_note/conf.py b/doc/source/tech_note/conf.py index a866c7f3fb..5c5b1d86ad 100644 --- a/doc/source/tech_note/conf.py +++ b/doc/source/tech_note/conf.py @@ -81,6 +81,7 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True +imgmath_image_format = 'svg' # -- Options for HTML output ---------------------------------------------- diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index a866c7f3fb..5c5b1d86ad 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -81,6 +81,7 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True +imgmath_image_format = 'svg' # -- Options for HTML output ---------------------------------------------- From 7b61cfddaf0e8b1304665b76e7400e21c4e2e199 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 31 Jan 2018 22:10:30 -0700 Subject: [PATCH 130/730] Work on glacier and ice sheet section and related documentation elsewhere --- .../Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 69 ++-- .../Glacier/CLM50_Tech_Note_Glacier.rst | 306 ++++++++++++------ .../CLM50_Tech_Note_Introduction.rst | 4 +- .../References/CLM50_Tech_Note_References.rst | 9 + 4 files changed, 262 insertions(+), 126 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 6463e9d255..139aea37df 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -31,22 +31,25 @@ The second subgrid level, the column, is intended to capture potential variability in the soil and snow state variables within a single land unit. For example, the vegetated land unit could contain several columns with independently evolving vertical profiles of soil water and -temperature. Similarly, the managed vegetation land unit can be -divided into two columns, irrigated and non-irrigated. The default snow/soil -column is represented by 25 layers for ground (with up to 20 of these layers classified as soil layers and the remaining layers classified as bedrock layers) and up to 10 layers -for snow, depending on snow depth. The central characteristic of the -column subgrid level is that this is where the state variables for water -and energy in the soil and snow are defined, as well as the fluxes of -these components within the soil and snow. Regardless of the number and -type of PFTs occupying space on the column, the column physics operates -with a single set of upper boundary fluxes, as well as a single set of -transpiration fluxes from multiple soil levels. These boundary fluxes -are weighted averages over all PFTs. Currently, for glacier, lake, and -vegetated land units, a single column is assigned to each land unit. The -crop land unit is split into irrigated and unirrigated columns with a -single crop occupying each column. The urban land units have five -columns (roof, sunlit walls and shaded walls, and pervious and -impervious canyon floor) (Oleson et al. 2010b). +temperature. Similarly, the managed vegetation land unit can be divided +into two columns, irrigated and non-irrigated. The default snow/soil +column is represented by 25 layers for ground (with up to 20 of these +layers classified as soil layers and the remaining layers classified as +bedrock layers) and up to 10 layers for snow, depending on snow +depth. The central characteristic of the column subgrid level is that +this is where the state variables for water and energy in the soil and +snow are defined, as well as the fluxes of these components within the +soil and snow. Regardless of the number and type of PFTs occupying space +on the column, the column physics operates with a single set of upper +boundary fluxes, as well as a single set of transpiration fluxes from +multiple soil levels. These boundary fluxes are weighted averages over +all PFTs. Currently, for lake and vegetated land units, a single column +is assigned to each land unit. The crop land unit is split into +irrigated and unirrigated columns with a single crop occupying each +column. The urban land units have five columns (roof, sunlit walls and +shaded walls, and pervious and impervious canyon floor) (Oleson et +al. 2010b). The glacier land unit is separated into up to 10 elevation +classes. .. _Figure CLM subgrid hierarchy: @@ -431,6 +434,15 @@ to\ :math:`z_{atm}` . and solid precipitation, which are added to yield total liquid precipitation :math:`q_{rain}` and solid precipitation :math:`q_{sno}` . +However, in CLM5, the atmosphere's partitioning into liquid and solid +precipitation is ignored. Instead, CLM repartitions total precipitation +using a linear ramp. For most landunits, this ramp generates all snow +below :math:`0 \textdegree C`, all rain above :math:`2 \textdegree C`, +and a mix of rain and snow for intermediate temperatures. For glaciers, +the end points of the ramp are :math:`-2 \textdegree C` and :math:`0 +\textdegree C`, respectively. Changes to the phase of precipitation are +accompanied by a sensible heat flux (positive or negative) to conserve +energy. :sup:`3`\ There are 14 aerosol deposition rates required depending on species and affinity for bonding with water; 8 of these are dust @@ -680,14 +692,14 @@ The percentage glacier mask was derived from vector data of global glacier and ice sheet spatial coverage. Vector data for glaciers (ice caps, icefields and mountain glaciers) were taken from the first globally complete glacier inventory, the Randolph Glacier Inventory -version 1.0 (RGIv1.0: :ref:`Arendt et al. 2012 `). -Vector data for the Greenland Ice Sheet were provided by Frank Paul and -Tobias Bolch (University of Zurich: :ref:`Rastner et al. 2012 `). -Antarctic Ice Sheet data were provided by -Andrew Bliss (University of Alaska) and were extracted from the -Scientific Committee on Antarctic Research (SCAR) Antarctic Digital -Database version 5.0. Floating ice is only provided for the Antarctic -and does not include the small area of Arctic ice shelves. High spatial +version 1.0 (RGIv1.0: :ref:`Arendt et al. 2012 `). +Vector data for the Greenland Ice Sheet were provided by Frank Paul and +Tobias Bolch (University of Zurich: :ref:`Rastner et al. 2012 +`). Antarctic Ice Sheet data were provided by Andrew +Bliss (University of Alaska) and were extracted from the Scientific +Committee on Antarctic Research (SCAR) Antarctic Digital Database +version 5.0. Floating ice is only provided for the Antarctic and does +not include the small area of Arctic ice shelves. High spatial resolution vector data were then processed to determine the area of glacier, ice sheet and floating ice within 30-second grid cells globally. The 30-second glacier, ice sheet and Antarctic ice shelf masks @@ -704,8 +716,13 @@ by elevation and areal ice sheet fractional coverage by elevation. Ice fractions were binned at 100 meter intervals, with bin edges defined from 0 to 6000 meters (plus one top bin encompassing all remaining high-elevation ice, primarily in the Himalaya). These distributions by -elevation are needed when running CLM4 with multiple glacier elevation -classes. +elevation are used to divide each glacier land unit into columns based +on elevation class. + +When running with the CISM ice sheet model, CISM dictates glacier areas +and elevations in its domain, overriding the values specified by CLM's +datasets. In typical CLM5 configurations, this means that CISM dictates +glacier areas and elevations over Greenland. Percent lake and lake depth are area-averaged from the 90-second resolution data of :ref:`Kourzeneva (2009, 2010) ` to the 0.05\ :sup:`o` diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index 84752b5429..28d4f9cc15 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -4,134 +4,241 @@ Glaciers ============ This chapter describes features of CLM that are specific to coupling to -an ice sheet model (in the CESM context, this is the Glimmer-CISM model; -:ref:`Lipscomb and Sacks (2012)` provide documentation -and user’s guide for Glimmer-CISM). General information about glacier -land units can be found elsewhere in this document (see Chapter -:numref:`rst_Surface Characterization, Vertical Discretization, and -Model Input Requirements` for an overview). +an ice sheet model (in the CESM context, this is the CISM model; +:ref:`Lipscomb and Sacks (2012)` provide +documentation and user’s guide for CISM). General information +about glacier land units can be found elsewhere in this document (see +Chapter :numref:`rst_Surface Characterization, Vertical Discretization, +and Model Input Requirements` for an overview). .. _Overview Glaciers: Overview -------------- +-------- -CLM is responsible for computing three quantities that are passed to the +CLM is responsible for computing two quantities that are passed to the ice sheet model: -#. Surface mass balance (SMB) – the net annual accumulation/ablation of +#. Surface mass balance (SMB) - the net annual accumulation/ablation of mass at the upper surface (section :numref:`Computation of the surface mass balance`) #. Ground surface temperature, which serves as an upper boundary - condition for Glimmer-CISM’s temperature calculation - -#. Surface topography, which currently is fixed in time, and is provided - on CLM’s surface dataset + condition for CISM's temperature calculation The ice sheet model is typically run at much higher resolution than CLM (e.g., :math:`\sim`\ 5 km rather than :math:`\sim`\ 100 km). To improve the downscaling from CLM’s grid to the ice sheet grid, the glaciated portion of each grid cell is divided into multiple elevation classes -(section 10.2). The above quantities are computed separately in each -elevation class. Glimmer-CISM then computes high-resolution quantities -via horizontal and vertical interpolation. +(section :numref:`Multiple elevation class scheme`). The above +quantities are computed separately in each elevation class. The CESM +coupler then computes high-resolution quantities via horizontal and +vertical interpolation, and passes these high-resolution quantities to +CISM. There are several reasons for computing the SMB in CLM rather than in -Glimmer-CISM: +CISM: #. It is much cheaper to compute the SMB in CLM for :math:`\sim`\ 10 - elevation classes than in Glimmer-CISM. For example, suppose we are - running CLM at a resolution of :math:`\sim`\ 50 km and Glimmer at + elevation classes than in CISM. For example, suppose we are + running CLM at a resolution of :math:`\sim`\ 50 km and CISM at :math:`\sim`\ 5 km. Greenland has dimensions of about 1000 x 2000 km. For CLM we would have 20 x 40 x 10 = 8,000 columns, whereas for - Glimmer we would have 200 x 400 = 80,000 columns. + CISM we would have 200 x 400 = 80,000 columns. #. We can use the sophisticated snow physics parameterization already in - CLM instead of implementing a separate scheme for Glimmer-CISM. Any + CLM instead of implementing a separate scheme for CISM. Any improvements to the CLM are applied to ice sheets automatically. #. The atmosphere model can respond during runtime to ice-sheet surface - changes. As shown by :ref:`Pritchard et al. (2008)`, - runtime albedo feedback - from the ice sheet is critical for simulating ice-sheet retreat on - paleoclimate time scales. Without this feedback the atmosphere warms - much less, and the retreat is delayed. - -#. Mass is more nearly conserved, given that the rate of surface ice - growth or melting computed in CLM is equal to the rate seen by the - dynamic ice sheet model. (Mass conservation is not exact, however, - because of approximations made in interpolating from the CLM grid to - the ice-sheet grid.) + changes (even in the absence of two-way feedbacks with CISM). As + shown by :ref:`Pritchard et al. (2008)`, runtime + albedo feedback from the ice sheet is critical for simulating + ice-sheet retreat on paleoclimate time scales. Without this feedback + the atmosphere warms much less, and the retreat is delayed. #. The improved SMB is available in CLM for all glaciated grid cells (e.g., in the Alps, Rockies, Andes, and Himalayas), not just those which are part of ice sheets. -The current coupling between CLM and Glimmer-CISM is one-way only. That -is, CLM sends the SMB and surface temperature to Glimmer-CISM but does -not do anything with the fields that are returned. The CLM glacier -fraction and surface topography are therefore fixed in time. One-way -coupling is reasonable for runs of :math:`\sim`\ 100 years or less, in -which ice-sheet elevation changes are modest. For longer runs with -larger elevation changes, two-way coupling is highly desirable. A -two-way coupling scheme is under development. +In typical runs, CLM computes the SMB and sends it to CISM, but CISM's +ice sheet geometry remains fixed over the course of the run. In these +runs, CISM serves two roles in the system: + +#. Over the CISM domain (typically Greenland in CESM2), CISM dictates + glacier areas and topographic elevations, overriding the values on + CLM's surface dataset. CISM also dictates the elevation of + non-glacier land units in its domain, and atmospheric fields are + downscaled to non-glacier land units only in this domain. (So if you + run with a stub glacier model - SGLC - then glacier areas and + elevations will be taken entirely from CLM's surface dataset, and no + downscaling will be done over non-glacier land units.) + +#. CISM provides the grid onto which SMB is downscaled. (If you run with + SGLC then SMB will still be computed in CLM, but it won't be + downscaled to a high-resolution ice sheet grid.) + +However, it is also possible to run CESM with an evolving ice sheet. In +this case, CLM responds to CISM's evolution by adjusting the areas of +the glacier landunit and each elevation class within this landunit, as +well as the mean topographic heights of each elevation class. Thus, +CLM's glacier areas and elevations remain in sync with +CISM's. Conservation of mass and energy is done as for other landcover +change (see Chapter :numref:`rst_Transient Landcover Change`). + +.. _Glacier regions: + +Glacier regions and their behaviors +----------------------------------- + +The world's glaciers and ice sheets are broken down into a number of +different regions (four by default) that differ in three respects: + +#. Whether the gridcell's glacier landunit contains: + + a. Multiple elevation classes (section :numref:`Multiple elevation + class scheme`) + + b. Multiple elevation classes plus virtual elevation classes + + c. Just a single elevation class whose elevation matches the + atmosphere's topographic height (so there is no adjustment in + atmospheric forcings due to downscaling). + +#. Treatment of glacial melt water: + + a. Glacial melt water runs off and is replaced by ice, thus keeping + the column always frozen. This behavior is discussed in more + detail in section :numref:`Computation of the surface mass + balance`. + + b. Glacial melt water remains in place until it refreezes - possibly + remaining in place indefinitely if the glacier column is in a warm + climate. With this behavior, ice melt does not result in any + runoff. Regions with this behavior cannot compute SMB, because + negative SMB would be meaningless (due to the liquid water on top + of the ice column). This behavior produces less realistic glacier + physics. However, it avoids the negative ice runoff that is needed + for the "replaced by ice" behavior to conserve mass and energy (as + described in section :numref:`Computation of the surface mass + balance`). Thus, in regions where CLM has glaciers but the + atmospheric forcings are too warm to sustain those glaciers, this + behavior avoids persistent negative ice runoff. This situation can + often occur for mountain glaciers, where topographic smoothing in + the atmosphere results in a too-warm climate. There, avoiding + persistent negative ice runoff can be more important than getting + the right glacier ice physics. + +#. Treatment of ice runoff from snow capping (as described in section + :numref:`Runoff from glaciers and snow-capped surfaces`). Note that this + is irrelevant in regions with an evolving, two-way-coupled ice sheet + (where the snow capping term is sent to CISM rather than running off): + + a. Ice runoff from snow capping remains ice. This is a crude + parameterization of iceberg calving, and so is appropriate in + regions where there is substantial iceberg calving in reality. + + b. Ice runoff from snow capping is melted (generating a negative + sensible heat flux) and runs off as liquid. This matches the + behavior for non-glacier columns. This is appropriate in regions + that have little iceberg calving in reality. This can be important + to avoid unrealistic cooling of the ocean and consequent runaway + sea ice growth. + +The default behaviors for the world's glacier and ice sheet regions are +described in :numref:`Table Glacier region behaviors`. Note that the +standard CISM grid covers Greenland plus enough surrounding area to +allow for ice sheet growth and to have a regular rectangular grid. We +need to have the "replaced by ice" melt behavior within the CISM domain +in order to compute SMB there, and we need virtual elevation classes in +that domain in order to compute SMB for all elevation classes and to +facilitate glacial advance and retreat in the two-way-coupled +case. However, this domain is split into Greenland itself and areas +outside Greenland so that ice runoff in the Canadian archipelago (which +is inside the CISM domain) is melted before reaching the ocean, to avoid +runaway sea ice growth in that region. + +.. _Table Glacier region behaviors: + +.. table:: Glacier region behaviors + + +---------------+---------------+---------------+---------------+ + | Region | Elevation | Glacial melt | Ice runoff | + | | classes | | | + +===============+===============+===============+===============+ + | Greenland | Virtual | Replaced by | Remains ice | + | | | ice | | + +---------------+---------------+---------------+---------------+ + | Inside | Virtual | Replaced by | Melted | + | standard CISM | | ice | | + | grid but | | | | + | outside | | | | + | Greenland | | | | + | itself | | | | + +---------------+---------------+---------------+---------------+ + | Antarctica | Multiple | Replaced by | Remains ice | + | | | ice | | + +---------------+---------------+---------------+---------------+ + | All others | Single | Remains in | Melted | + | | | place | | + +---------------+---------------+---------------+---------------+ + .. _Multiple elevation class scheme: Multiple elevation class scheme ------------------------------------- - -In the typical operation of CLM, the glacier land unit contains a single -column (section :numref:`Surface Heterogeneity and Data Structure`). -However, when running CESM with an active ice -sheet model, the glacier land unit is replaced by a glacier\_mec land -unit, where “mec†denotes “multiple elevation classesâ€. In most ways, -glacier\_mec land units behave the same as standard glacier land units. -However, each glacier\_mec land unit is divided into a user-defined set -of columns based on surface elevation. The default is 10 elevation -classes whose lower limits are 0, 200, 400, 700, 1000, 1300, 1600, 2000, -2500, and 3000 m. Each column is characterized by a fractional area and -surface elevation that are read in during model initialization. Each -glacier\_mec column within a grid cell has distinct ice and snow -temperatures, snow water content, surface fluxes, and SMB. - -Glacier\_mec columns, like glacier columns, are initialized with a -temperature of 250 K. While glacier columns are initialized with a snow -liquid water equivalent (LWE) equal to the maximum allowed value of 1 m, -glacier\_mec columns begin with a snow LWE of 0.5 m so that they will -reach their equilibrium mean snow depth sooner. Glacier\_mec columns -typically require several decades of spin-up to equilibrate with a given -climate. +------------------------------- + +The glacier landunit contains multiple columns based on surface +elevation. These are known as elevation classes, and the land unit is +referred to as glacier\_mec. (As described in section :numref:`Glacier +regions`, some regions have only a single elevation class, but they are +still referred to as glacier\_mec landunits.) The default is to have 10 +elevation classes whose lower limits are 0, 200, 400, 700, 1000, 1300, +1600, 2000, 2500, and 3000 m. Each column is characterized by a +fractional area and surface elevation that are read in during model +initialization, and then possibly overridden by CISM as the run +progresses. Each glacier\_mec column within a grid cell has distinct ice +and snow temperatures, snow water content, surface fluxes, and SMB. The atmospheric surface temperature, potential temperature, specific -humidity, density, and pressure are downscaled from the mean grid cell -elevation to the glacier\_mec column elevation using a specified lapse -rate (typically 6.0 deg/km) and an assumption of uniform relative -humidity. At a given time, lower-elevation columns can undergo surface +humidity, density, and pressure are downscaled from the atmosphere's +mean grid cell elevation to the glacier\_mec column elevation using a +specified lapse rate (typically 6.0 deg/km) and an assumption of uniform +relative humidity. Longwave radiation is downscaled by assuming a linear +decrease in downwelling longwave radiation with increasing elevation +(0.032 W m :sup:`-2` m :sup:`-1`, limited to 0.5 - 1.5 times the +gridcell mean value, then normalized to conserve gridcell total energy) +:ref:`(Van Tricht et al., 2016)`. Total precipitation +is partitioned into rain vs. snow as described in Chapter +:numref:`rst_Surface Characterization, Vertical Discretization, and +Model Input Requirements`. The partitioning of precipitation is based on +the downscaled temperature, allowing rain to fall at lower elevations +while snow falls at higher elevations. + +This downscaling allows lower-elevation columns to undergo surface melting while columns at higher elevations remain frozen. This gives a more accurate simulation of summer melting, which is a highly nonlinear -function of air temperature. The precipitation rate and radiative fluxes -are not currently downscaled, but could be in the future if care were -taken to preserve the cell-integrated values. +function of air temperature. + +Within the CISM domain, this same downscaling procedure is also applied +to all non-urban land units. The elevation of non-glacier land units is +taken from the mean elevation of ice-free grid cells in CISM. This is +done in order to keep the glaciated and non-glaciated portions of the +CISM domain as consistent as possible. In contrast to most CLM subgrid units, glacier\_mec columns can be active (i.e., have model calculations run there) even if their area is -zero. This is done because the ice sheet model may require a SMB even -for some grid cells where CLM does not have glacier land units. To allow -for this, grid overlap files have been pre-computed. For given -resolutions of CLM and Glimmer-CISM, these files identify all -land-covered grid cells that overlap any part of the ice sheet grid. In -these overlapping cells, glacier\_mec columns are defined in all -elevation classes. Some columns may have zero area and are called -“virtual†columns. These columns do not affect energy exchange between -the land and the atmosphere, but are included for potential forcing of -Glimmer-CISM. +zero. These are known as "virtual" columns. This is done because the ice +sheet model may require a SMB even for some grid cells where CLM does +not have glacier land units. Virtual columns do not affect energy +exchange between the land and the atmosphere, but are included for +potential forcing of CISM. .. _Computation of the surface mass balance: Computation of the surface mass balance --------------------------------------------- +--------------------------------------- The SMB of a glacier or ice sheet is the net annual accumulation/ablation of mass at the upper surface. Ablation is defined @@ -144,17 +251,6 @@ the melting depends on the sum of the radiative, turbulent, and conductive fluxes reaching the surface, as described elsewhere in this document. -CLM has a somewhat unrealistic treatment of accumulation and melting for -standard glacier land units. The snow depth is limited to a prescribed -depth of 1 m liquid water equivalent, with any additional snow assumed -to run off to the ocean. (This amounts to a crude parameterization of -iceberg calving.) Snow melting is treated in a realistic fashion, with -meltwater percolating downward through snow layers as long as the snow -is unsaturated. Once the underlying snow is saturated, any additional -meltwater runs off. When glacier ice melts, however, the meltwater is -assumed to remain in place until it refreezes. In warm parts of the ice -sheet, the meltwater does not refreeze, but stays in place indefinitely. - In the modified glacier\_mec columns, the treatment of melting and freezing depends on the logical variable *glc\_dyntopo*. This variable controls whether CLM surface topography changes dynamically as the ice @@ -171,12 +267,26 @@ for glacier\_mec land units is computed as for glacier land units: Any snow in excess of 1 m LWE runs off to the ocean, and Melted ice remains in place until it refreezes. Excess snow and melted ice still contribute to positive and negative values, respectively, of *qice*, but only for -the purpose of forcing Glimmer-CISM. Currently, *glc\_dyntopo* = false +the purpose of forcing CISM. Currently, *glc\_dyntopo* = false is the default, and the only supported option. Note that the SMB typically is defined as the total accumulation of ice -and snow, minus the total ablation. The *qice* flux passed to -Glimmer-CISM is the mass balance for ice alone, not snow. We can think -of CLM as owning the snow, whereas Glimmer-CISM owns the underlying ice. -Fluctuations in snow depth between 0 and 1 m LWE are not reflected in -the SMB passed to Glimmer-CISM. +and snow, minus the total ablation. The *qice* flux passed to CISM is +the mass balance for ice alone, not snow. We can think of CLM as owning +the snow, whereas CISM owns the underlying ice. Fluctuations in snow +depth between 0 and 10 m water equivalent are not reflected in the SMB +passed to CISM. In transient runs, this can lead to delays of a few +decades in the onset of accumulation or ablation in a given glacier +column. + +In regions where SMB is computed for glaciers, SMB is also computed for +the natural vegetated land unit. Because there is no ice to melt in this +land unit, it can only generate a zero or positive SMB. A positive SMB +is generated once the snow pack reaches its maximum depth. When running +with an evolving ice sheet, this condition triggers glacial inception. + +FIXME: Make sure I talk about the positive liquid runoff and negative +ice runoff that result from melted ice. + +FIXME: With interactive CISM, snow capping is applied to the surface +mass balance, not ice runoff. diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index a887e5d9fc..853385f36b 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -504,9 +504,9 @@ In CLM5, where new parameterizations or model decisions were made, in most cases The hydrology updates include the introduction of a dry surface layer-based soil evaporation resistance parameterization :ref:`(Swenson and Lawrence, 2014)` and a revised canopy interception parameterization. Canopy interception is now divided into liquid and solid phases, with the intercepted snow subject to unloading events due to wind or above-freezing temperatures. The snow-covered fraction of the canopy is used within the canopy radiation and surface albedo calculation. Instead of applying a spatially uniform soil thickness, soil thickness can vary in space :ref:`(Brunke et al. 2016` and :ref:`Swenson and Lawrence, 2015)` and is set to values within a range of 0.4m to 8.5m depth, derived from a spatially explicit soil thickness data product :ref:`(Pelletier et al., 2016)`. The explicit treatment of soil thickness allows for the deprecation of the unconfined aquifer parameterization used in CLM4.5, which is replaced with a zero flux boundary condition and explicit modeling of both the saturated and unsaturated zones. The default model soil layer resolution is increased, especially within the top 3m, to more explicitly represent active layer thickness within the permafrost zone. Rooting profiles were used inconsistently in CLM4.5 with :ref:`Zeng (2001)` profiles used for water and :ref:`Jackson et al. (1996)` profiles used for carbon inputs. For CLM5, the Jackson et al. (1996) rooting profiles are used for both water and carbon. Roots are deepened for the broadleaf evergreen tropical tree and broadleaf deciduous tropical tree types. Finally, an adaptive time-stepping solution to the Richard's equation is introduced, which improves the accuracy and stability of the numerical soil water solution. The River Transport Model (RTM) is replaced with the Model for Scale Adaptive River Transport (MOSART, :ref:`Li et al., 2013b)` in which surface runoff is routed across hillslopes and then discharged along with subsurface runoff into a tributary subnetwork before entering the main channel. Several changes are included that are mainly targeted at improving the simulation of surface mass balance over ice -sheets. The fresh snow density parameterization is updated to more realistically capture the temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is active for Greenland by default with one-way coupling (surface mass balance impacts ice sheet dynamics, but ice sheet dynamics do not feedback onto surface elevation). Two-way coupling can be activated through a namelist switch. The introduction in CLM5 of the capability to +sheets. The fresh snow density parameterization is updated to more realistically capture temperature effects and to additionally account for wind effects on new snow density :ref:`(van Kampenhout et al., 2017)`. The maximum number of snow layers and snow amount is increased from 5 layers and 1m snow water equivalent to 12 layers and 10m snow water equivalent to allow for the formation of firn in regions of persistent snow-cover (e.g., glaciers and ice sheets) :ref:`(van Kampenhout et al., 2017)`. The CISM2 ice sheet model is included for Greenland by default. The ice sheet does not evolve for typical configurations, but ice sheet evolution can be turned on by choosing an appropriate compset. The introduction in CLM5 of the capability to dynamically adjust landunit weights means that a glacier can initiate, grow, shrink, or disappear during -a simulation when two-way coupling is active. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. +a simulation when ice evolution is active. That is, there are two-way feedbacks between CLM and CISM. Multiple elevation classes (10 elevation classes by default) and associated temperature, rain/snow partitioning, and downwelling longwave downscaling are used for glacier landunits to account for the strong topographic elevation heterogeneity over glaciers and ice sheets. A plant hydraulic stress routine is introduced which explicitly models water transport through the vegetation according to a simple hydraulic framework (Kennedy et al., to be submitted). The water supply equations are used to solve for vegetation water potential forced by transpiration demand and a set of layer-by-layer soil water potentials. Stomatal conductance, therefore, is a function of prognostic leaf water potential. Water stress is calculated as the ratio of attenuated stomatal conductance to maximum stomatal conductance. An emergent feature of the plant hydraulics is soil hydraulic redistribution. In CLM5, maximum stomatal conductance is obtained from the Medlyn conductance model :ref:`(Medlyn et al., 2011)`, rather than the Ball-Berry stomatal conductance model that was utilized in CLM4.5 and prior versions of the model. The Medlyn stomatal conductance model is preferred mainly for it's more realistic behavior at low humidity levels :ref:`(Rogers et al., 2017)`. The stress deciduous vegetation phenology trigger is augmented with a antecedent precipitation requirement :ref:`(Dahlin et al. 2015)`. diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 5168284551..ba331704d0 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -2698,6 +2698,15 @@ Lawrence, A.G. Slater, and M.R. van den Broeke, 2017. Improving the representation of polar snow and firn in the Community Earth System Model, submitted. +.. _VanTrichtetal2016: + +|br| + +Van Tricht, K., Lhermitte, S., Gorodetskaya, I.V. and van Lipzig, +N.P.M., 2016. Improving satellite-retrieved surface radiative fluxes in +polar regions using a smart sampling approach. The Cryosphere +10:2379-2397. doi:10.5194/tc-10-2379-2016 + .. _VanVuurenetal2006: |br| From 74b2220c084a1d888639fe894e2581c0ca885fef Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 1 Feb 2018 06:27:09 -0700 Subject: [PATCH 131/730] add information on glc_dyn_runoff_routing --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index 28d4f9cc15..e125a1141e 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -240,6 +240,13 @@ potential forcing of CISM. Computation of the surface mass balance --------------------------------------- +This section describes the computation of surface mass balance and +associated runoff terms. The description here only applies to regions +where glacial melt runs off and is replaced by ice, not to regions where +glacial melt remains in place. Thus, by default, this only applies to +Greenland and Antarctica, not to mountain glaciers elsewhere in the +world. (See also :numref:`Glacier regions`.) + The SMB of a glacier or ice sheet is the net annual accumulation/ablation of mass at the upper surface. Ablation is defined as the mass of water that runs off to the ocean. Not all the surface @@ -251,6 +258,26 @@ the melting depends on the sum of the radiative, turbulent, and conductive fluxes reaching the surface, as described elsewhere in this document. +SMB is computed and sent to the CESM coupler regardless of whether and +where CISM is operating. However, the effect of SMB terms on runoff +fluxes differs depending on whether and where CISM is evolving in +two-way-coupled mode. This is described by the variable +*glc\_dyn\_runoff\_routing*. (This is real-valued in the code to handle +the edge case where a CLM grid cell partially overlaps with the CISM +grid, but we describe it as a logical variable here for simplicity.) In +typical cases where CISM is not evolving, *glc\_dyn\_runoff\_routing* +will be false everywhere. In cases where CISM is evolving and sending +its own calving flux to the coupler, *glc\_dyn\_runoff\_routing* will be +true over the CISM domain and false elsewhere. + +FIXME: Rewrite the following paragraph + +FIXME: Make sure I talk about the positive liquid runoff and negative +ice runoff that result from melted ice. + +FIXME: With interactive CISM, snow capping is applied to the surface +mass balance, not ice runoff. + In the modified glacier\_mec columns, the treatment of melting and freezing depends on the logical variable *glc\_dyntopo*. This variable controls whether CLM surface topography changes dynamically as the ice @@ -285,8 +312,3 @@ land unit, it can only generate a zero or positive SMB. A positive SMB is generated once the snow pack reaches its maximum depth. When running with an evolving ice sheet, this condition triggers glacial inception. -FIXME: Make sure I talk about the positive liquid runoff and negative -ice runoff that result from melted ice. - -FIXME: With interactive CISM, snow capping is applied to the surface -mass balance, not ice runoff. From 3311d37fa59e748db552f074fca1ce942c9cff78 Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Thu, 1 Feb 2018 07:55:18 -0700 Subject: [PATCH 132/730] changed snow layers --- .../CLM50_Tech_Note_Snow_Hydrology.rst | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index a97e161526..14ceeaa968 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -6,10 +6,10 @@ Snow Hydrology The parameterizations for snow are based primarily on :ref:`Anderson (1976) `, :ref:`Jordan (1991) `, and :ref:`Dai and Zeng (1997) `. The snowpack -can have up to five layers. These layers are indexed in the Fortran code -as :math:`i=-4,-3,-2,-1,0` where layer :math:`i=0` is the snow layer -next to the top soil layer and layer :math:`i=-4` is the top layer of a -five-layer snow pack. Since the number of snow layers varies according +can have up to twelve layers. These layers are indexed in the Fortran code +as :math:`i=-11,-10,...,-1,0` where layer :math:`i=0` is the snow layer +next to the top soil layer and layer :math:`i=-11` is the top layer of a +twelve-layer snow pack. Since the number of snow layers varies according to the snow depth, we use the notation :math:`snl+1` to describe the top layer of snow for the variable layer snow pack, where :math:`snl` is the negative of the number of snow layers. Refer to :numref:`Figure three layer @@ -697,7 +697,21 @@ where :math:`\Delta z_{i}` is the layer thickness. +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ | 4 | 0.055 | 4 | :math:`>`\ 4 | 0.41 | 0.23 | +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ - | 5 (bottom) | 0.115 | 5 | - | - | - | + | 5 | 0.115 | 5 | :math:`>`\ 5 | 0.88 | 0.47 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 6 | 0.235 | 6 | :math:`>`\ 6 | 1.83 | 0.95 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 7 | 0.475 | 7 | :math:`>`\ 7 | 3.74 | 1.91 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 8 | 0.955 | 8 | :math:`>`\ 8 | 7.57 | 3.83 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 9 | 1.915 | 9 | :math:`>`\ 9 | 15.24 | 7.67 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 10 | 3.835 | 10 | :math:`>`\ 10 | 30.59 | 15.35 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 11 | 7.675 | 11 | :math:`>`\ 11 | 61.30 | 30.71 | + +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ + | 12 (bottom) | 15.355 | 12 | - | - | - | +--------------+-----------------------------+------------------+------------------+-----------------------------------------------+---------------------------------------------------------+ The maximum snow layer thickness, :math:`\Delta z_{\max }` , depends on From c894f733684bc21083f6b5abe91b0357a62e3cff Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Thu, 1 Feb 2018 15:37:41 +0100 Subject: [PATCH 133/730] Update CLM50_Tech_Note_References.rst --- .../tech_note/References/CLM50_Tech_Note_References.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index ba331704d0..06dfb22835 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -2695,8 +2695,8 @@ turnover through the microbial biomass in soil. Plant and Soil, 76: van Kampenhout, L., J.T.M. Lenaerts, W.H. Lipscomb, W.J. Sacks, D.M. Lawrence, A.G. Slater, and M.R. van den Broeke, 2017. -Improving the representation of polar snow and firn in the -Community Earth System Model, submitted. +Improving the Representation of Polar Snow and Firn in the +Community Earth System Model. Journal of Advances in Modeling Earth Systems 9, no. 7: 2583–2600. https://doi.org/10.1002/2017MS000988. .. _VanTrichtetal2016: From 4d7440c8eab951b07150f2c6e87de6f64884085a Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Thu, 1 Feb 2018 16:05:20 +0100 Subject: [PATCH 134/730] Update CLM50_Tech_Note_Hydrology.rst Update the most obvious things that have changed in 2.7.6. Runoff from glaciers and snow-capped surface --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 2ca572ee9e..fb0dff13ab 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -1240,22 +1240,15 @@ Runoff from glaciers and snow-capped surfaces ------------------------------------------------- All surfaces are constrained to have a snow water equivalent -:math:`W_{sno} \le 1000` kg m\ :sup:`-2`. For snow-capped -surfaces, the solid and liquid precipitation reaching the snow surface -and dew in solid or liquid form, is separated into solid -:math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms - -.. math:: - :label: 7.178 - - q_{snwcp,ice} =q_{grnd,ice} +q_{frost} - -.. math:: - :label: 7.179 - - q_{snwcp,liq} =q_{grnd,liq} +q_{dew} - -and snow pack properties are unchanged. The :math:`q_{snwcp,ice}` +:math:`W_{sno} \le W_{cap} = 10,000` kg m\ :sup:`-2`. For snow-capped +columns, any addition of mass at the top (precipitation, dew/riping) is +balanced by an equally large mass flux at the bottom of the snow column. +This so-called capping flux is separated into solid +:math:`q_{snwcp,ice}` \ and liquid :math:`q_{snwcp,liq}` runoff terms. +The partitioning of these phases is based on the phase ratio in the bottom snow +layer at the time of the capping, such that phase ratio in this layer is unaltered. + +The :math:`q_{snwcp,ice}` runoff is sent to the River Transport Model (RTM) (Chapter 11) where it is routed to the ocean as an ice stream and, if applicable, the ice is melted there. @@ -1284,5 +1277,3 @@ The contribution of lake runoff to :math:`q_{rgwl}` is described in section :numref:`Precipitation, Evaporation, and Runoff Lake`. The runoff term :math:`q_{rgwl}` may be negative for glaciers and lakes, which reduces the total amount of runoff available to the river routing model (Chapter :numref:`rst_River Transport Model (RTM)`). - -> From 0b7b34d5af4735805996018f91889cdb0375342a Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Thu, 1 Feb 2018 17:01:20 +0100 Subject: [PATCH 135/730] fresh snow grain size is temperature dependent in CLM5 --- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 386cf77bd2..3ecf53e0f2 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -956,8 +956,13 @@ each time step *t* as r_{e} \left(t\right)=\left[r_{e} \left(t-1\right)+dr_{e,\, dry} +dr_{e,\, wet} \right]f_{old} +r_{e,\, 0} f_{new} +r_{e,\, rfz} f_{rfrz} Here, the effective radius of freshly-fallen snow -(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sup:`-1`), and the effective -radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. +(:math:`r_{e,0}`) is based on a simple linear temperature-relationship. +Below -30 degrees Celcius, a minimum value is enforced of 54.5 :math:`\mu` m +(corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sup:`-1`). +Above 0 degrees Celcius, a maximum value is enforced of 204.5 :math:`\mu` m. +Between -30 and 0 a linear ramp is used. + +The effective radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. Dry snow aging is based on a microphysical model described by :ref:`Flanner and Zender (2006) `. This model simulates diffusive vapor flux From c23747d2b0d6a01ec43c2f0e83c11808d3365582 Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Thu, 1 Feb 2018 17:01:20 +0100 Subject: [PATCH 136/730] fresh snow grain size is temperature dependent in CLM5 --- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 386cf77bd2..3ecf53e0f2 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -956,8 +956,13 @@ each time step *t* as r_{e} \left(t\right)=\left[r_{e} \left(t-1\right)+dr_{e,\, dry} +dr_{e,\, wet} \right]f_{old} +r_{e,\, 0} f_{new} +r_{e,\, rfz} f_{rfrz} Here, the effective radius of freshly-fallen snow -(:math:`r_{e,0}`) is fixed globally at 54.5 :math:`\mu` m (corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sup:`-1`), and the effective -radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. +(:math:`r_{e,0}`) is based on a simple linear temperature-relationship. +Below -30 degrees Celcius, a minimum value is enforced of 54.5 :math:`\mu` m +(corresponding to a specific surface area of 60 m\ :sup:`2` kg\ :sup:`-1`). +Above 0 degrees Celcius, a maximum value is enforced of 204.5 :math:`\mu` m. +Between -30 and 0 a linear ramp is used. + +The effective radius of refrozen liquid water (:math:`r_{e,rfz}`) is set to 1000\ :math:`\mu` m. Dry snow aging is based on a microphysical model described by :ref:`Flanner and Zender (2006) `. This model simulates diffusive vapor flux From e030158745504eeeb3a6773be2bcfc0e46cb5d77 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 1 Feb 2018 09:36:05 -0700 Subject: [PATCH 137/730] Reordered and edited references and minor fixes in FATES/DGVM chapters --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 44 +-- .../CLM50_Tech_Note_Introduction.rst | 2 +- .../References/CLM50_Tech_Note_References.rst | 354 ++++++++---------- 3 files changed, 173 insertions(+), 227 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 170d44eb7a..4c3ae84448 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -6,9 +6,9 @@ Dynamic Global Vegetation What has changed ^^^^^^^^^^^^^^^^^^^^ -- Deprecation of the dynamic global vegetation model (DGVM): The CLM5.0 model contains the legancy 'CNDV' code, which runs the CLM4(CN) model in combination with the LPJ-derived dynamics vegetation model introduced in CLM3. While this capacity has not technically been removed from the model, the DGVM has not been tested in the development of CLM5 and is no longer scientifically supported. +- Deprecation of the dynamic global vegetation model (DGVM): The CLM5.0 model contains the legacy 'CNDV' code, which runs the CLM biogeochemistry model in combination with the LPJ-derived dynamics vegetation model introduced in CLM3. While this capacity has not technically been removed from the model, the DGVM has not been tested in the development of CLM5 and is no longer scientifically supported. -- Introduction of FATES: The Functionally Assembled Terrestrial Ecosystem Simulator (FATES) is the actively developed DGVM for the CLM5. See +- Introduction of FATES: The Functionally Assembled Terrestrial Ecosystem Simulator (FATES) is the actively developed DGVM for the CLM5. .. _rst_FATES: @@ -20,11 +20,7 @@ FATES is the "Functionally Assembled Terrestrial Ecosystem Simulator". It is an FATES was derived from the CLM Ecosystem Demography model (CLM(ED)), which was documented in: -Fisher RA, Muszala S, Verteinstein M, Lawrence P, Xu C, McDowell NG, - Knox RG, Koven C, Holm J, Rogers BM, Lawrence D. Taking off the - training wheels: the properties of a dynamic vegetation model without - climate envelopes. Geoscientific Model Development Discussions. 2015 - Apr 1;8(4). +Fisher, R. A., Muszala, S., Verteinstein, M., Lawrence, P., Xu, C., McDowell, N. G., Knox, R. G., Koven, C., Holm, J., Rogers, B. M., Spessa, A., Lawrence, D., and Bonan, G.: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED), Geosci. Model Dev., 8, 3593-3619, https://doi.org/10.5194/gmd-8-3593-2015, 2015. and this technical note was first published as an appendix to that paper. @@ -53,9 +49,9 @@ for carbon storage allocation, and for tree mortality under carbon stress, are also included and presented here. Numerous other implementations of the -Ecosystem Demography concept exist (See Fisher et al. 2017 for a review of these) Therefore, to avoid confusion between the +Ecosystem Demography concept exist (See :ref:`Fisher et al. (2018)` for a review of these) Therefore, to avoid confusion between the concept of 'Ecosystem Demography' and the implementation of this concept -in different models, the CLM(ED) implementation described by Fisher et al. (2015) will hereafter be called 'FATES' (the Functionally Assembled Terrestrial Ecosystem Simulator). +in different models, the CLM(ED) implementation described by :ref:`Fisher et al. (2015)` will hereafter be called 'FATES' (the Functionally Assembled Terrestrial Ecosystem Simulator). The representation of ecosystem heterogeneity in FATES ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,7 +97,7 @@ history.** The 'patch' organizational structure in CLM thus replaces the previous 'PFT' structure in the organization heirarchy. The original hierarchical land surface organizational structure of CLM as described in -:ref:`Oleson et al. 2013` may be depicted as: +:ref:`Oleson et al. 2013` may be depicted as: .. math:: @@ -709,7 +705,7 @@ performance in ED-like cohort based models, since they determine how light resources are partitioned between competing plants of varying heights, which has a very significant impact on how vegetation distribution emerges from competition -:ref:`Fisher et al. 2010`. +:ref:`Fisher et al. 2010`. The standard ED1.0 model makes a simple 'flat disk' assumption, that the leaf area of each cohort is spread in an homogenous layer at one exact @@ -796,7 +792,7 @@ Under these circumstances, the `extra` crown area :math:`A_{loss}` (i.e., :math:`A_{canopy}` - :math:`A_p`) is moved into the understorey. For each cohort already in the canopy, we determine a fraction of trees that are moved from the canopy (:math:`L_c`) to the understorey. -:math:`L_c` is calculated as :ref:`Fisher et al. 2010` +:math:`L_c` is calculated as :ref:`Fisher et al. 2010` .. math:: L_{c}= \frac{A_{loss,patch} w_{coh}}{\sum_{coh=1}^{nc,patch}{w_{coh}}} , @@ -1354,7 +1350,7 @@ profile section. Firstly, we denote two or more canopy layers (denoted :math:`C_l`). The concept of a ‘canopy layer’ refers to the idea that plants are organized into discrete over and under-stories, as predicted by the Perfect Plasticity Approximation -(:ref:`Purves et al. 2008`, :ref:`Fisher et al. 2010`). Within each canopy layer +(:ref:`Purves et al. 2008`, :ref:`Fisher et al. 2010`). Within each canopy layer there potentially exist multiple cohorts of different plant functional types and heights. Within each canopy layer, :math:`C_l`, and functional type, :math:`ft`, the model resolves numerous leaf layers :math:`z`, @@ -1527,9 +1523,9 @@ photosynthesis model before describing its application to the FATES canopy structure. This description in this section is largely repeated from the Oleson et al. CLM4.5 technical note but included here for comparison with its implementation in FATES. Photosynthesis in C3 -plants is based on the model of :ref:`Farquhar 1980` as -modified by :ref:`Collatz et al. 1991`. Photosynthetic assimilation -in C4 plants is based on the model of :ref:`Collatz et al. 1991`. +plants is based on the model of :ref:`Farquhar 1980` as +modified by :ref:`Collatz et al. (1991)`. Photosynthetic assimilation +in C4 plants is based on the model of :ref:`Collatz et al. (1991)`. In both models, leaf photosynthesis, :math:`\textrm{gpp}` (:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`) is calculated as the minimum of three potentially limiting fluxes, @@ -1556,7 +1552,7 @@ partial pressure (Pa). :math:`K_{c}` and :math:`K_{o}` are the Michaelis-Menten constants (Pa) for CO\ :math:`_{2}` and O\ :math:`_{2}`. These vary with vegetation temperature :math:`T_v` (:math:`^{o}`\ C) according to an Arrhenious function described in -:ref:`Oleson et al. 2013`. :math:`V_{c,max}` is the leaf layer +:ref:`Oleson et al. 2013`. :math:`V_{c,max}` is the leaf layer photosynthetic capacity (:math:`\mu` mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`). @@ -1627,7 +1623,7 @@ CO\ :math:`_{2}` compensation point :math:`\Gamma_{*}` (Pa) is where the term 0.21 represents the ratio of maximum rates of oxygenation to carboxylation, which is virtually constant with temperature -:ref:`Farquhar, 1980`. +:ref:`Farquhar, 1980`. Resolution of the photosynthesis theory within the FATES canopy structure. -------------------------------------------------------------------------- @@ -1753,7 +1749,7 @@ where :math:`V_{canopy}` is calculated as :math:`K_{n}` is the coefficient of nitrogen decay with canopy depth. The value of this parameter is taken from the work of -:ref:`Lloyd et al. 2010` who determined, from 204 vertical profiles +:ref:`Lloyd et al. 2010` who determined, from 204 vertical profiles of leaf traits, that the decay rate of N through canopies of tropical rainforests was a function of the :math:`V_{cmax}` at the top of the canopy. They obtain the following term to predict :math:`K_{n}`, @@ -2063,13 +2059,13 @@ Fundamental stomatal conductance theory [14]_Stomatal conductance is unchanged in concept from the CLM4.5 approach. Leaf stomatal resistance is calculated from the Ball-Berry conductance -model as described by :ref:`Collatz et al. 1991` and implemented in +model as described by :ref:`Collatz et al. (1991)` and implemented in a global climate model by :ref:`Sellers et al. 1996`. The model relates stomatal conductance (i.e., the inverse of resistance) to net leaf photosynthesis, scaled by the relative humidity at the leaf surface and the CO\ :math:`_2` concentration at the leaf surface. The primary difference between the CLM implementation and that used by -:ref:`Collatz et al. 1991` and :ref:`Sellers et al. 1996` is +:ref:`Collatz et al. (1991)` and :ref:`Sellers et al. (1996)` is that they used net photosynthesis (i.e., leaf photosynthesis minus leaf respiration) instead of gross photosynthesis. As implemented here, stomatal conductance equals the minimum conductance (:math:`b`) when @@ -2093,13 +2089,13 @@ the leaf at the vegetation temperature conductance (:math:`\mu`\ mol m\ :math:`^{-2}` s\ :math:`^{-1}`) when :math:`A` = 0 . Typical values are :math:`m_{ft}` = 9 for C\ :math:`_3` plants and :math:`m_{ft}` = 4 for C\ :math:`_4` plants ( -:ref:`Collatz et al. 1991`, :ref:`Collatz, 1992`, :ref:`Sellers et al 1996)`. +:ref:`Collatz et al. 1991`, :ref:`Collatz, 1992`, :ref:`Sellers et al 1996)`. :ref:`Sellers et al. 1996` used :math:`b` = 10000 for C\ :math:`_3` plants and :math:`b` = 40000 for C\ :math:`_4` plants. Here, :math:`b` was chosen to give a maximum stomatal resistance of 20000 s m\ :math:`^{-1}`. These terms are nevertheless plant strategy dependent, and have been found to vary widely with plant type -:ref:`Medlyn et al. 2001`. +:ref:`Medlyn et al. 2011`. Resistance is converted from units of s m\ :math:`^2 \mu` mol\ :math:`^{-1}` to s m\ :math:`^{-1}` as: 1 s m\ :math:`^{-1}` = @@ -3072,7 +3068,7 @@ model, which has been modified for use in ED following it’s original implementation in the LPJ-SPITFIRE model (:ref:`Thonicke et al. 2010, :ref:`Pfeiffer et al. 2013`). This model as described is substantially different from the existing CLM4.5 fire model -:ref:`Li et al. 2012`, however, further developments are +:ref:`Li et al. 2012`, however, further developments are intended to increase the merging of SPITFIRE’s natural vegetation fire scheme with the fire suppression, forest-clearing and peat fire estimations in the existing model. The coupling to the ED model allows diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 853385f36b..562b772c51 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -13,7 +13,7 @@ ***Contributing Authors*** -**Ben Andre, Ali Ashehad, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +**Ashehad Ali, Ben Andre, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Ryan Knox, Jan Lenaerts, Sam Levis, L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index ba331704d0..74223d2887 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -283,6 +283,12 @@ stomatal conductance in the earth system: linking leaf water-use efficiency and water transport along the soil–plant–atmosphere continuum, Geosci. Model Dev., 7, 2193-2222, doi:10.5194/gmd-7-2193-2014. +.. _botta2000: + +|br| + +Botta, A et al., 2000. A global prognostic scheme of leaf onset using satellite data. Global Change Biology 6.7, pp. 709-725. + .. _Brun1989: |br| @@ -324,6 +330,12 @@ Buzan, J.R., Oleson, K., and Huber, M. 2015: Implementation and comparison of a suite of heat stress metrics within the Community Land Model version 4.5, Geosci. Model Dev., 8, 151-170, doi:10.5194/gmd-8-151-2015. +.. _byram1959: + +|br| + +Byram, G.M., 1959. Combustion of forest fuels. In Forest fire: control and use.(Ed. KP Davis) pp. 61-89. + .. _CampbellNorman1998: |br| @@ -656,17 +668,23 @@ Firestone, M.K. and Davidson, E.A. 1989. Exchange of Trace Gases between Terrestrial Ecosystems and the Atmosphere. In: M.O. Andreae and D.S. Schimel (Editors). John Wiley and Sons, pp. 7-21. +.. _Fisheretal2010: + +|br| + +Fisher, J. B., S. Sitch, Y. Malhi, R. A. Fisher, C. Huntingford, and S.-Y. Tan, 2010. Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation. Global Biogeochem. Cycles, 24, GB1014, doi:10.1029/2009GB003621. + .. _Fisheretal2015: |br| Fisher, R. A., S. Muszala, M. Verteinstein, P. Lawrence, C. Xu, N. G. McDowell, R. G. Knox, C. Koven, J. Holm, B. M. Rogers, A. Spessa, D. Lawrence, and G. Bonan, 2015: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED). Geosci. Model Dev., 8: 3593-3619, doi:10.5194/gmd-8-3593-2015. -.. _Fisheretal2010: +.. _Fisheretal2017: |br| -Fisher, J. B., S. Sitch, Y. Malhi, R. A. Fisher, C. Huntingford, and S.-Y. Tan, 2010. Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation. Global Biogeochem. Cycles, 24, GB1014, doi:10.1029/2009GB003621. +Fisher, R.A., C.D. Koven, W.R.L. Anderegg, et al., 2018: Vegetation demographics in Earth System Models: A review of progress and priorities. Glob Change Biol. 2018;24:35–54. https://doi.org/10.1111/gcb.13910 .. _FlannerZender2005: @@ -698,6 +716,12 @@ Geophys. Res. 112:D11202. DOI:10.1029/2006JD008003. Flatau, P.J., Walko, R.L., and Cotton, W.R. 1992. Polynomial fits to saturation vapor pressure. J. Appl. Meteor. 31:1507-1513. +.. _foley1996: + +|br| + +Foley, J.A. et al., 1996. An integrated biosphere model of land surface processes, terrestrial carbon balance, and vegetation dynamics. Global Biogeochemical Cycles 10.4, pp. 603-628. + .. _Friedl,etal2002: |br| @@ -715,6 +739,12 @@ from MODIS: algorithms and early results. Remote Sens. Environ. Frolking, S., et al. 2001. Modeling Northern Peatland Decomposition and Peat Accumulation. Ecosystems. 4:479-498. +.. _fyllas2014: + +|br| + +Fyllas, N.M. et al., 2014. Analysing Amazonian forest productivity using a new individual and trait- based model (TFS v. 1). Geoscientific Model Development 7.4, pp. 1251-1269. + .. _Gallaisetal2006: |br| @@ -842,7 +872,7 @@ studies. Water Resour. Res. 35:583-587. |br| -Graven, H., C. E. Allison, D. M. Etheridge, S. Hammer, R. F. Keeling, I. Levin, H. A. J. Meijer, M. Rubino, P. P. Tans, C. M. Trudinger, B. H. Vaughn and J. W. C. White (2017) Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geoscientific Model Development, in review. doi: 10.5194/gmd-2017-166. +Graven, H., C. E. Allison, D. M. Etheridge, S. Hammer, R. F. Keeling, I. Levin, H. A. J. Meijer, M. Rubino, P. P. Tans, C. M. Trudinger, B. H. Vaughn and J. W. C. White, 2017. Compiled records of carbon isotopes in atmospheric CO2 for historical simulations in CMIP6, Geoscientific Model Development, in review. doi: 10.5194/gmd-2017-166. .. _GrenfellWarren1999: @@ -1232,6 +1262,12 @@ nitrogen dynamics. Proceedings of the National Academies of Science, Koven, C.D., G. Hugelius, D.M. Lawrence, and W.R. Wieder, 2017: Higher climatological temperature sensitivity of soil carbon in cold than warm climates. Nature Clim. Change, 7, doi:10.1038/nclimate3421. +.. _kucharik1998: + +|br| + +Kucharik, C.J., J.M. Norman, and S.T. Gower, 1998. Measurements of branch area and adjusting leaf area index indirect measurements. Agricultural and Forest Meteorology 91.1, pp. 69-88. + .. _Kuchariketal2000: |br| @@ -1531,6 +1567,12 @@ Liang, X., Lettenmaier, D.P., Wood, E.F., and Burges, S.J. 1994. A simple hydrologically based model of land surface water and energy fluxes for GSMs. J. Geophys. Res. 99(D7):14,415–14,428. +.. _lichstein2011: + +|br| + +Lichstein, J.W. and S.W. Pacala, 2011. Local diversity in heterogeneous landscapes: quantitative assessment with a height-structured forest metacommunity model`. Theoretical Ecology 4.2, pp. 269-281. + .. _LipscombSacks2012: |br| @@ -1539,6 +1581,13 @@ Lipscomb, W., and Sacks, W. 2012. The CESM land ice model documentation and user’s guide. 46 pp. [Available online at http://www.cesm.ucar.edu/models/cesm1.1/cism/]. +.. _lischke2006: + +|br| + +Lischke, H. et al., 2006. TreeMig: a forest-landscape model for simulating spatio-temporal patterns from stand to landscape scale. Ecological Modelling 199.4, pp. 409-420. 41 + + .. _LloydTaylor1994: |br| @@ -1652,6 +1701,12 @@ Mary, B., Fresneau, C., Morel, J.L. and Mariotti, A., 1993. C and N cycling during decomposition of root mucilage, roots and glucose in soil. Soil Biology and Biochemistry 25:1005-1014. +.. _mcdowell2013: + +|br| + +McDowell, N.G. et al., 2013. Evaluating theories of drought-induced vegetation mortality using a multimodel experiment framework. New Phytologist 200.2, pp. 304-321. + .. _McGuireetal1992: |br| @@ -1668,7 +1723,7 @@ potential vegetation in North America. Global Biogeochem. Cycles Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., Barton, C.V.M., Crous, K.Y., De Angelis, P., Freeman, M., and -Wingate, L. (2011), Reconciling the optimal and empirical approaches to +Wingate, L., 2011. Reconciling the optimal and empirical approaches to modelling stomatal conductance. Global Change Biology, 17: 2134–2144. doi:10.1111/j.1365-2486.2010.02375.x @@ -1717,6 +1772,12 @@ Moldrup, P. et al. 2003. Modeling diffusion and reaction in soils: X. A unifying model for solute and gas diffusivity in unsaturated soil. Soil Science 168:321-337. +.. _mc_2001: + +|br| + +Moorcroft, P.R., G.C. Hurtt, and S.W. Pacala, 2001. A method for scaling vegetation dynamics: the ecosystem demography model ED. Ecological monographs 71.4, pp. 557-586. + .. _Mynenietal2002: |br| @@ -1792,6 +1853,12 @@ Niu, G.-Y., and Yang, Z.-L. 2007. An observation-based formulation of snow cover fraction and its evaluation over large North American river basins. J. Geophys. Res. 112:D21101. DOI:10.1029/2007JD008674. +.. _norman1979: + +|br| + +Norman, J.M., 1979. Modeling the complete crop canopy. Modification of the Aerial Environment of Crops, pp. 249-280. + .. _Oikawaetal2005: |br| @@ -1980,6 +2047,12 @@ New York, 480 pp. Pelletier, J. D., P. D. Broxton, P. Hazenberg, X. Zeng, P. A. Troch, G. Y. Niu, Z. Williams, M. A. Brunke, and D. Gochis, 2016: A gridded global data set of soil, intact regolith, and sedimentary deposit thicknesses for regional and global land surface modeling. J. Adv. Mod. Earth Sys. 8:41-65. +.. _peterson1986: + +|br| + +Peterson, D.L. and K.C. Ryan, 1986. Modeling postfire conifer mortality for long-range planning. Environmental Management 10.6, pp. 797-808. + .. _Petrescuetal2010: |br| @@ -1987,6 +2060,12 @@ Pelletier, J. D., P. D. Broxton, P. Hazenberg, X. Zeng, P. A. Troch, G. Y. Niu, Petrescu, A.M.R. et al. 2010. Modeling regional to global CH4 emissions of boreal and arctic wetlands. Global Biogeochemical Cycles, 24(GB4009). +.. _pfeiffer2013: + +|br| + +Pfeiffer, M., A. Spessa, and J.O. Kaplan, 2013. A model for global biomass burning in preindustrial time: LPJ-LMfire (v1. 0). Geoscientific Model Development 6.3, pp. 643-685. + .. _Philip1957: |br| @@ -2058,13 +2137,11 @@ ice-atmosphere interactions underestimates ice sheet melt in millennial-scale deglaciation simulations. Geophys. Res. Lett. ** 35:L01503. DOI:10.1029/2007GL031738. -.. _Qianetal2006: +.. _purves2008: |br| -Qian, T., Dai, A., Trenberth, K.E., and Oleson, K.W. 2006. Simulation of -global land surface conditions from 1948 to 2004: Part I: Forcing data -and evaluations. J. Hydrometeor. 7:953-975. +Purves, D.W. et al., 2008. Predicting and understanding forest dynamics using a simple tractable model. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. .. _RamankuttyFoley1998: @@ -2199,11 +2276,21 @@ Saggar, S., Tate, K.R., Feltham, C.W., Childs, C.W. and Parshotam, A., :math:`{}^{14}`\ C-labelled glucose. Soil Biology and Biochemistry, 26: 1263-1271. +.. _Sakaguchietal2009: + +|br| + Sakaguchi, K., and Zeng, X. 2009. Effects of soil wetness, plant litter, and under-canopy atmospheric stability on ground evaporation in the Community Land Model (CLM3.5). J. Geophys. Res. 114:D01107. DOI:10.1029/2008JD010834. +.. _sato2007: + +|br| + +Sato, H., A. Itoh, and T. Kohyama, 2007. SEIB-DGVM: A new Dynamic Global Vegetation Model using a spatially explicit individual-based approach. Ecological Modelling 200.3, pp. 2793307. + .. _Schaafetal2002: |br| @@ -2285,6 +2372,12 @@ Dazlich, D.A., Zhang, C., Collelo, G.D., and Bounoua, L. 1996. A revised land surface parameterization (SiB2) for atmospheric GCMs. Part I: Model formulation. J. Climate 9:676-705. +.. _sellers1996: + +|br| + +Sellers, Piers J et al. (1996). A revised land surface parameterization (SiB2) for atmospheric GCMs. Part II: The generation of global fields of terrestrial biophysical parameters from satellite data. Journal of climate 9.4, pp. 706-737. + .. _Shietal2013: |br| @@ -2331,6 +2424,12 @@ Simpson, R.J., Lambers, H., and Dalling, M.J. 1983. Nitrogen redistribution during grain growth in wheat (Triticum avestivum L.). Plant Physiol. 71:7-14. +.. _sitch2003: + +|br| + +Sitch, S et al. (2003). Evaluation of ecosystem dynamics, plant geography and terrestrial carbon cycling in the LPJ dynamic global vegetation model. Global Change Biology 9.2, pp. 161-185. + .. _Sivak2013: |br| @@ -2339,6 +2438,12 @@ Sivak, M. 2013. Air conditioning versus heating: climate control is more energy demanding in Minneapolis than in Miami. Environ. Res. Lett., 8, doi:10.1088/1748-9326/8/1/014050. +.. _smith2001: + +|br| + +Smith, B., I.C. Prentice, and M.T. Sykes, 2001. Representation of vegetation dynamics in the modelling of terrestrial ecosystems: comparing two contrasting approaches within European climate space. Global Ecology and Biogeography 10.6, pp. 621-637. + .. _Smithetal2005: |br| @@ -2348,6 +2453,12 @@ G.L.W., 2005. Fire in African savanna: Testing the impact of incomplete combustion on pyrogenic emissions estimates. Ecological Applications, 15: 1074-1082. +.. _smith2007: + +|br| + +Smith, A.M. and M. Stitt, 2007. Coordination of carbon supply and plant growth. Plant, cell & environment 30.9, pp. 1126-1149. + .. _Sollins1982: |br| @@ -2550,6 +2661,13 @@ fire disturbance for global vegetation dynamics: coupling fire into a Dynamic Global Vegetation Model. Global Ecology and Biogeography 10:661-667. +.. _thonicke2010: + +|br| + +Thonicke, K. et al., 2010. The influence of vegetation, fire spread and fire behaviour on biomass burning and trace gas emissions: results from a process-based model. Biogeosciences 7.6, pp. 1991-2011. + + .. _Thornton1998: |br| @@ -2662,6 +2780,12 @@ site. Agric. For. Meteor. 82:119-153. UNSTAT, 2005. National Accounts Main Aggregates Database, United Nations Statistics Division. +.. _uriarte2009: + +|br| + +Uriarte, M. et al., 2009. Natural disturbance and human land use as determinants of tropical forest dynamics: results from a forest simulator. Ecological Monographs 79.3, pp. 423-443. + .. _VallanoSparks2007: |br| @@ -2724,6 +2848,12 @@ Vanninen, P., and Makela, A. 2005. Carbon budget for Scots pine trees: effects of size, competition and site fertility on growth allocation and production. Tree Phys. 25:17-30. +.. _venevsky2002: + +|br| + +Venevsky, S. et al., 2002. Simulating fire regimes in human-dominated ecosystems: Iberian Peninsula case study. Global Change Biology 8.10, pp. 984-998. + .. _VerdinGreenlee1996: |br| @@ -2784,6 +2914,12 @@ Wang, A., and Zeng, X. 2009. Improving the treatment of vertical snow burial fraction over short vegetation in the NCAR CLM3. Adv. Atmos. Sci. 26:877-886. DOI:10.1007/s00376-009-8098-3. +.. _weng2014: + +|br| + +Weng, E.S. et al., 2014. Scaling from individuals to ecosystems in an Earth System Model using a mathematically tractable model of height-structured competition for light. Biogeosciences Discussions 11.12, pp. 17757-17860. + .. _Whiteetal1997: |br| @@ -2857,10 +2993,16 @@ Water Resour. Res., 47, W03517, doi:10.1029/2009WR008871. |br| -Wu, H., J. S. Kimball, H. Li, M. Huang, L. R. Leung, and R. F. Adler -(2012), A New Global River Network Database for Macroscale Hydrologic +Wu, H., J. S. Kimball, H. Li, M. Huang, L. R. Leung, and R. F. Adler, +2012. A New Global River Network Database for Macroscale Hydrologic modeling, Water Resour. Res., 48, W09701, doi:10.1029/2012WR012313. +.. _xiaodong2005: + +|br| + +Xiaodong, Y. and H.H. Shugart, 2005. FAREAST: a forest gap model to simulate dynamics and patterns of eastern Eurasian forests. Journal of Biogeography 32.9, pp. 1641-1658. + .. _Xuetal2012: |br| @@ -2966,195 +3108,3 @@ Global Biogeochemical Cycles 18. DOI:10.1029/2004GB002239. Zilitinkevich, S.S. 1970. Dynamics of the Atmospheric Boundary Layer. Leningrad Gidrometeor. -.. _bonan2012: - -|br| - -Bonan, Gordon B et al. (2012). `Reconciling leaf physiological traits and canopy flux data: Use of the TRY and FLUXNET databases in the Community Land Model version 4`. Journal of Geophysical Research: Biogeosciences (2005-2012) 117.G2. - -.. _botta2000: - -|br| - -Botta, A et al. (2000). `A global prognostic scheme of leaf onset using satellite data`. Global Change Biology 6.7, pp. 709-725. - -.. _byram1959: - -|br| - -Byram, GM (1959). Combustion of forest fuels. In Forest fire: control and use.(Ed. KP Davis) pp. 61-89. - -.. _collatz1991: - -|br| - -Collatz, G James et al. (1991). `Physiological and environmental regulation of stomatal conductance, photosynthesis and transpiration: a model that includes a laminar boundary layer` Agricultural and Forest Meteorology 54.2, pp. 107-136. - -.. _collatz1992: - -|br| - -Collatz, Go J, M Ribas-Carbo, and JA Berry (1992). `Coupled photosynthesis-stomatal conductance model for leaves of C4 plants`. Functional Plant Biology 19.5, pp. 519-538.
 - -.. _farquhar1980: - -|br| - -Farquhar, GD, S von von Caemmerer, and JA Berry (1980). `A biochemical model of photosynthetic CO2 assimilation in leaves of C3 species`. Planta 149.1, pp. 780-90. - -.. _fisher2010: - -|br| - -Fisher, JB et al. (2010). `Carbon cost of plant nitrogen acquisition: A mechanistic, globally applicable model of plant nitrogen uptake, retranslocation, and fixation`. Global Biogeochemical Cycles 24.1. - -.. _foley1996: - -|br| - -Foley, Jonathan A et al. (1996). `An integrated biosphere model of land surface processes, terrestrial carbon balance, and vegetation dynamics`. Global Biogeochemical Cycles 10.4, pp. 603-628. - -.. _fyllas2014: - -|br| - -Fyllas, NM et al. (2014). `Analysing Amazonian forest productivity using a new individual and trait- based model (TFS v. 1)`. Geoscientific Model Development 7.4, pp. 1251-1269. - -.. _kucharik1998: - -|br| - -Kucharik, Christopher J, John M Norman, and Stith T Gower (1998). `Measurements of branch area and adjusting leaf area index indirect measurements`. Agricultural and Forest Meteorology 91.1, pp. 69-88. - -.. _li2012: - -|br| - -Li, F, XD Zeng, and S Levis (2012). `A process-based fire parameterization of intermediate complexity in a Dynamic Global Vegetation Model`. Biogeosciences 9.7, pp. 2761-2780. - -.. _lichstein2011: - -|br| - -Lichstein, Jeremy W and Stephen W Pacala (2011). `Local diversity in heterogeneous landscapes: quantitative assessment with a height-structured forest metacommunity model`. Theoretical Ecology 4.2, pp. 269-281. - -.. _lischke2006: - -|br| - -Lischke, Heike et al. (2006). `TreeMig: a forest-landscape model for simulating spatio-temporal patterns from stand to landscape scale`. Ecological Modelling 199.4, pp. 409-420. 41 - -.. _lloyd2010: - -|br| - -Lloyd, J et al. (2010). `Optimisation of photosynthetic carbon gain and within-canopy gradients of associated foliar traits for Amazon forest trees`. Biogeosciences 7.6, pp. 1833-1859. - -.. _mcdowell2013: - -|br| - -McDowell, Nate G et al. (2013). `Evaluating theories of drought-induced vegetation mortality using a multimodel experiment framework`. New Phytologist 200.2, pp. 304-321. - -.. _medlyn2011: - -|br| - -Medlyn, Belinda E et al. (2011). `Reconciling the optimal and empirical approaches to modelling stom- atal conductance`. Global Change Biology 17.6, pp. 2134-2144. - - -.. _mc_2001: - -|br| - -Moorcroft, PR, GC Hurtt, and Stephen W Pacala (2001). `A method for scaling vegetation dynamics: the ecosystem demography model ED`. Ecological monographs 71.4, pp. 557-586. - -.. _norman1979: - -|br| - -Norman, JM (1979). `Modeling the complete crop canopy`. Modification of the Aerial Environment of Crops, pp. 249-280. - -.. _oleson2013: - -|br| - -Oleson, KW et al. (2013). `Technical description of version 4.5 of the Community Land Model (CLM)`. - -.. _peterson1986: - -|br| - -Peterson, David L and Kevin C Ryan (1986). `Modeling postfire conifer mortality for long-range planning`. Environmental Management 10.6, pp. 797-808. - -.. _pfeiffer2013: - -|br| - -Pfeiffer, M, A Spessa, and JO Kaplan (2013). `A model for global biomass burning in preindustrial time: LPJ-LMfire (v1. 0)`. Geoscientific Model Development 6.3, pp. 643-685. - -.. _purves2008: - -|br| - -Purves, Drew W et al. (2008). `Predicting and understanding forest dynamics using a simple tractable model`. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. - -.. _sato2007: - -|br| - -Sato, Hisashi, Akihiko Itoh, and Takashi Kohyama (2007). `SEIB–DGVM: A new Dynamic Global Vegetation Model using a spatially explicit individual-based approach`. Ecological Modelling 200.3, pp. 2793307. - -.. _sellers1996: - -|br| - -Sellers, Piers J et al. (1996). `A revised land surface parameterization (SiB2) for atmospheric GCMs. Part II: The generation of global fields of terrestrial biophysical parameters from satellite data`. Journal of climate 9.4, pp. 706-737. - -.. _sitch2003: - -|br| - -Sitch, S et al. (2003). `Evaluation of ecosystem dynamics, plant geography and terrestrial carbon cycling in the LPJ dynamic global vegetation model`. Global Change Biology 9.2, pp. 161-185. - -.. _smith2007: - -|br| - -Smith, Alison M and Mark Stitt (2007). `Coordination of carbon supply and plant growth`. Plant, cell & environment 30.9, pp. 1126-1149. - -.. _smith2001: - -|br| - -Smith, Benjamin, I Colin Prentice, and Martin T Sykes (2001). `Representation of vegetation dynamics in the modelling of terrestrial ecosystems: comparing two contrasting approaches within European climate space`. Global Ecology and Biogeography 10.6, pp. 621-637. - -.. _thonicke2010: - -|br| - -Thonicke, K et al. (2010). `The influence of vegetation, fire spread and fire behaviour on biomass burning and trace gas emissions: results from a process-based model`. Biogeosciences 7.6, pp. 1991-2011. - -.. _uriarte2009: - -|br| - -Uriarte, Maria et al. (2009). `Natural disturbance and human land use as determinants of tropical forest dynamics: results from a forest simulator`. Ecological Monographs 79.3, pp. 423-443. - -.. _venevsky2002: - -|br| - -Venevsky, Sergey et al. (2002). `Simulating fire regimes in human-dominated ecosystems: Iberian Peninsula case study`. Global Change Biology 8.10, pp. 984-998. - -.. _weng2014: - -|br| - -Weng, ES et al. (2014). `Scaling from individuals to ecosystems in an Earth System Model using a mathematically tractable model of height-structured competition for light`. Biogeosciences Discussions 11.12, pp. 17757-17860. - -.. _xiaodong2005: - -|br| - -Xiaodong, Yan and HH Shugart (2005). `FAREAST: a forest gap model to simulate dynamics and patterns of eastern Eurasian forests`. Journal of Biogeography 32.9, pp. 1641-1658. From 180ed91cf10893e222a4858e0a0e0f340651a288 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 1 Feb 2018 13:59:54 -0700 Subject: [PATCH 138/730] Rewrite portions of the SMB section --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 115 +++++++++++------- 1 file changed, 73 insertions(+), 42 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index e125a1141e..a7f2100478 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -61,9 +61,9 @@ CISM: (e.g., in the Alps, Rockies, Andes, and Himalayas), not just those which are part of ice sheets. -In typical runs, CLM computes the SMB and sends it to CISM, but CISM's -ice sheet geometry remains fixed over the course of the run. In these -runs, CISM serves two roles in the system: +In typical runs, CISM is not evolving; CLM computes the SMB and sends it +to CISM, but CISM's ice sheet geometry remains fixed over the course of +the run. In these runs, CISM serves two roles in the system: #. Over the CISM domain (typically Greenland in CESM2), CISM dictates glacier areas and topographic elevations, overriding the values on @@ -258,6 +258,14 @@ the melting depends on the sum of the radiative, turbulent, and conductive fluxes reaching the surface, as described elsewhere in this document. +Note that the SMB typically is defined as the total accumulation of ice +and snow, minus the total ablation. The SMB flux passed to CISM is the +mass balance for ice alone, not snow. We can think of CLM as owning the +snow, whereas CISM owns the underlying ice. Fluctuations in snow depth +between 0 and 10 m water equivalent are not reflected in the SMB passed +to CISM. In transient runs, this can lead to delays of a few decades in +the onset of accumulation or ablation in a given glacier column. + SMB is computed and sent to the CESM coupler regardless of whether and where CISM is operating. However, the effect of SMB terms on runoff fluxes differs depending on whether and where CISM is evolving in @@ -266,45 +274,68 @@ two-way-coupled mode. This is described by the variable the edge case where a CLM grid cell partially overlaps with the CISM grid, but we describe it as a logical variable here for simplicity.) In typical cases where CISM is not evolving, *glc\_dyn\_runoff\_routing* -will be false everywhere. In cases where CISM is evolving and sending -its own calving flux to the coupler, *glc\_dyn\_runoff\_routing* will be -true over the CISM domain and false elsewhere. - -FIXME: Rewrite the following paragraph - -FIXME: Make sure I talk about the positive liquid runoff and negative -ice runoff that result from melted ice. - -FIXME: With interactive CISM, snow capping is applied to the surface -mass balance, not ice runoff. - -In the modified glacier\_mec columns, the treatment of melting and -freezing depends on the logical variable *glc\_dyntopo*. This variable -controls whether CLM surface topography changes dynamically as the ice -sheet evolves (i.e., whether the coupling is one-way or two-way). If -*glc\_dyntopo* is true, then CLM receives updated topographic -information from the ice sheet model. In this case, snow in excess of -the prescribed maximum depth is assumed to turn into ice, contributing a -positive SMB to the ice sheet model. Melting ice is assumed to run off -to the ocean, giving a negative SMB. The net SMB associated with ice -formation (by conversion from snow) and melting/runoff is computed for -each column, averaged over the coupling interval, and sent to the -coupler (*qice, mm/s*). If *glc\_dyntopo* is false, then surface runoff -for glacier\_mec land units is computed as for glacier land units: Any -snow in excess of 1 m LWE runs off to the ocean, and Melted ice remains -in place until it refreezes. Excess snow and melted ice still contribute -to positive and negative values, respectively, of *qice*, but only for -the purpose of forcing CISM. Currently, *glc\_dyntopo* = false -is the default, and the only supported option. - -Note that the SMB typically is defined as the total accumulation of ice -and snow, minus the total ablation. The *qice* flux passed to CISM is -the mass balance for ice alone, not snow. We can think of CLM as owning -the snow, whereas CISM owns the underlying ice. Fluctuations in snow -depth between 0 and 10 m water equivalent are not reflected in the SMB -passed to CISM. In transient runs, this can lead to delays of a few -decades in the onset of accumulation or ablation in a given glacier -column. +will be false everywhere; in these cases, CISM's mass is not considered +to be part of the coupled system. In cases where CISM is evolving and +sending its own calving flux to the coupler, *glc\_dyn\_runoff\_routing* +will be true over the CISM domain and false elsewhere. + +Any snow capping (section :numref:`Runoff from glaciers and snow-capped +surfaces`) is added to :math:`q_{ice,frz}`. Any liquid water (i.e., +melted ice) below the snow pack in the glacier column is added to +:math:`q_{ice,melt}`, then is converted back to ice to maintain a +pure-ice column. Then the total SMB is given by :math:`q_{ice,tot}`: + +.. math:: + :label: 13.1 + + q_{ice,tot} = q_{ice,frz} - q_{ice,melt} + +CLM is responsible for generating glacial surface melt, even when +running with an evolving ice sheet. Thus, :math:`q_{ice,melt}` is always +added to liquid runoff (:math:`q_{rgwl}`), regardless of +*glc\_dyn\_runoff\_routing*. However, the ice runoff flux depends on +*glc\_dyn\_runoff\_routing*. If *glc\_dyn\_runoff\_routing* is true, +then CISM controls the fate of the snow capping mass in +:math:`q_{ice,frz}` (e.g., eventually transporting it to lower +elevations where it can be melted or calved). Since CISM will now own +this mass, the snow capping flux does *not* contribute to any runoff +fluxes generated by CLM. + +If *glc\_dyn\_runoff\_routing* is false, then CLM sends the snow capping +flux as runoff, as a crude representation of ice calving (see also +sections :numref:`Runoff from glaciers and snow-capped surfaces` and +:numref:`Glacier regions`). However, this ice runoff flux is reduced by +:math:`q_{ice,melt}`. This reduction is needed for conservation; its +need is subtle, but can be understood with either of these explanations: + +- When ice melts, we let the liquid run off and replace it with new + ice. That new ice needs to come from somewhere to keep the coupled + system in water balance. We "request" the new ice from the ocean by + generating a negative ice runoff equivalent to the amount we have + melted. + +- Ice melt removes mass from the system, as it should. But the snow + capping flux also removes mass from the system. The latter is a crude + parameterization of calving, assuming steady state - i.e., all ice + gain is balanced by ice loss. This removal of mass due to both + accumulation and melt represents a double-counting. Each unit of melt + indicates that one unit of accumulation should not have made it to the + ocean as ice, but instead melted before it got there. So we need to + correct for this double-counting by removing one unit of ice runoff + for each unit of melt. + +For a given point in space or time, this reduction can result in +negative ice runoff. However, when integrated over time and space, for +an ice sheet that is near equilibrium, this just serves to decrease the +too-high positive ice runoff from snow capping. (This near-equilibrium +assumption is a key point in the treatment of snow capping with +*glc\_dyn\_runoff\_routing* false. For glaciers and ice sheets that +violate this assumption, either because they are far out of equilibrium +with the climate or because the model is being run for hundreds of +years, there are two ways to avoid the unrealistic ice runoff from snow +capping: by running with an evolving, two-way-coupled ice sheet or by +changing a glacier region's ice runoff behavior as described in section +:numref:`Glacier regions`.) In regions where SMB is computed for glaciers, SMB is also computed for the natural vegetated land unit. Because there is no ice to melt in this From 1d062cbc0616a9c13776d01d9c572a9baec17972 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 1 Feb 2018 15:40:50 -0700 Subject: [PATCH 139/730] fix formatting of mosart page --- doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst index b844b4a433..eabdb50763 100644 --- a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -228,14 +228,17 @@ Difference between CLM5.0 and CLM4.5 1. Routing methods: RTM, a linear reservoir method, is used in CLM4.5 for river routing, whilst in CLM5.0, MOSART is an added option for river routing -based on the more physically-based kinematic wave method. +based on the more physically-based kinematic wave method. + 2. Runoff treatment: In RTM runoff is routed regardless of its sign so negative streamflow can be simulated at times. MOSART routes only nonnegative runoff and always produces positive streamflow, which is important for future extension for modeling riverine heat and biogeochemical fluxes. + 3. Input parameters: RTM in CLM4.5 only requires one layer of spatial variable of channel velocity, whilst MOSART in CLM5.0 requires 13 parameters that -are all available globally at 0.5 :sup:`o` resolution. +are all available globally at 0.5 :sup:`o` resolution. + 4. Outputs: RTM only produces streamflow simulation, whilst MOSART additionally simulates the time-varying channel velocities and channel water depth and channel surface water variation. From e2edd92eddb2b8a74729479c5d0b01d674a5baae Mon Sep 17 00:00:00 2001 From: Katie Dagon Date: Thu, 1 Feb 2018 16:30:49 -0700 Subject: [PATCH 140/730] Fixed some typos and errors --- .../Fluxes/CLM50_Tech_Note_Fluxes.rst | 4 +- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 2 +- .../CLM50_Tech_Note_Introduction.rst | 2 +- .../CLM50_Tech_Note_Photosynthesis.rst | 2 +- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 38 +++++++-------- .../CLM50_Tech_Note_Plant_Hydraulics.rst | 48 +++++++++---------- .../CLM50_Tech_Note_Plant_Mortality.rst | 8 ++-- doc/source/tech_note/index.rst | 1 + 8 files changed, 53 insertions(+), 52 deletions(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 95214580b4..fdd6873346 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1236,7 +1236,7 @@ The leaf boundary layer resistance :math:`r_{b}` is where :math:`C_{v} =0.01` m\ s\ :sup:`-1/2` is the turbulent transfer coefficient between the canopy surface and canopy air, and :math:`d_{leaf}` is the characteristic dimension of the leaves in the -direction of wind flow (:numref:`Table Coefficients for saturation vapor pressure`). +direction of wind flow (:numref:`Table Plant functional type aerodynamic parameters`). The partial derivatives of the fluxes from the soil beneath the canopy with respect to ground temperature, which are needed for the soil @@ -1279,7 +1279,7 @@ adjusted for canopy density following :ref:`Zeng and Wang (2007) ` d = z_{top} R_{d} V where :math:`z_{top}` is canopy top height (m) -(:numref:`Table Prescribed plant functional type heights`), +(:numref:`Table Plant functional type canopy top and bottom heights`), :math:`R_{z0m}` and :math:`R_{d}` are the ratio of momentum roughness length and displacement height to canopy top height, respectively (:numref:`Table Plant functional type aerodynamic parameters`), and :math:`z_{0m,\, g}` diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index fb0dff13ab..b1153c3a5d 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -137,7 +137,7 @@ They are defined by .. math:: :label: 7.11 - W_{can,\,sno}^{max } =p_{ice}\left(L+S\right). + W_{can,\,sno}^{max } =p_{sno}\left(L+S\right). The maximum storage of liquid water is :math:`p_{liq}=0.1` kg m\ :sup:`-2` (:ref:`Dickinson et al. 1993 `), and that of snow diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 562b772c51..0993904323 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -31,7 +31,7 @@ P. O. Box 3000, Boulder, Colorado 80307-300 **LIST OF FIGURES** -- :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from Lawrence et al. (2011) for CLM5.0). +- :numref:`Figure Land processes` Land biogeophysical, biogeochemical, and landscape processes simulated by CLM (adapted from :ref:`Lawrence et al. (2011)` for CLM5.0). - :numref:`Figure CLM subgrid hierarchy` Configuration of the CLM subgrid hierarchy. diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 8dad4faf3e..258fa3f182 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -89,7 +89,7 @@ atmospheric potential temperature (K). .. table:: Plant functional type (PFT) stomatal conductance parameters. +----------------------------------+-------------------+ - | PFT | g\ :sub:`1` (Pa) | + | PFT | g\ :sub:`1` | +==================================+===================+ | NET Temperate | 2.35 | +----------------------------------+-------------------+ diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index 0c99101fa0..c47ce0e624 100755 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -6,7 +6,7 @@ Photosynthetic Capacity The photosynthetic capacity is represented by two key parameters: 1) the maximum rate of carboxylation at 25 :sup:`o`\ C, :math:`V_{\text{c,max25}}`; and 2) the maximum rate of electron transport at 25 :sup:`o`\ C, :math:`J_{\text{max25}}` . They are predicted by a mechanistic model of leaf -utilization of nitrogen for assimilation (LUNA V1.0) (Ali et al. 2016) based on an optimality hypothesis to nitrogen allocation +utilization of nitrogen for assimilation (LUNA V1.0) (:ref:`Ali et al. 2016`) based on an optimality hypothesis to nitrogen allocation among light capture, electron transport, carboxylation, respiration and storage. Specifically, the model allocates the nitrogen by maximizing the daily net photosynthetic carbon gain under following two key assumptions: @@ -30,7 +30,7 @@ The LUNA model includes the following four unitless parameters: - :math:`H` , which determines the response of electron transport rate to relative humidity. The above four parameters are estimated by fitting the LUNA model to a global compilation of >800 obervations -located at different biomes, canopy locations, and time of the year from 1993-2013 (Ali et al 2015). The model inputs +located at different biomes, canopy locations, and time of the year from 1993-2013 (Ali et al. 2015). The model inputs are area-based leaf nitrogen content, leaf mass per unit leaf area and the driving environmental conditions (average of past 10 days) including temperature, CO :sub:`2` concentrations, daily mean and maximum radiation, relative humidity and day length. The estimated values in CLM5 for the listed parameters are 0.0311, 0.1745, 0.8054, and 6.0999, repectively. In LUNA V1.0, the estimated @@ -51,9 +51,9 @@ Model structure Plant Nitrogen '''''''''''''''''''''''''' -The structure of the LUNA model is adapted from Xu et al.(2012), where the plant nitrogen at the leaf level ( :math:`\text{LNC}_{a}`; gN/ m :sup:`2` leaf) is divided into +The structure of the LUNA model is adapted from :ref:`Xu et al. (2012)`, where the plant nitrogen at the leaf level ( :math:`\text{LNC}_{a}`; gN/ m :sup:`2` leaf) is divided into four pools: structural nitrogen( :math:`N_{\text{str}}`; gN/m :sup:`2` leaf), -photosynthetic nitrogen ( :math:`N_{\text{psn}}`; gN/ m:sup:`2` leaf), +photosynthetic nitrogen ( :math:`N_{\text{psn}}`; gN/m :sup:`2` leaf), storage nitrogen( :math:`N_{\text{store}}`; gN/m :sup:`2` leaf), and respiratory nitrogen ( :math:`N_{\text{resp}}`; gN/m :sup:`2` leaf). Namely, @@ -75,14 +75,14 @@ Namely, N_{\text{psn}} =N_{\text{et}} + N_{\text{cb}} + N_{\text{lc}}. The structural nitrogen, :math:`N_{\text{str}}`, is calculated as the -multiplication of leaf mass per unit area (LMA: g biomass/m :sup:`2` leaf), and the structural nitrogen content (SNC; gN/g biomass). Namely, +multiplication of leaf mass per unit area (:math:`\text{LMA}`; g biomass/m :sup:`2` leaf), and the structural nitrogen content (:math:`\text{SNC}`; gN/g biomass). Namely, .. math:: :label: 10.3) N_{\text{str}} = \text{SNC} \cdot \text{LMA} -where SNC is set to be fixed at 0.002 (gN/g biomass), based on data on C:N ratio from dead wood (White etal.,2000). +where :math:`\text{SNC}` is set to be fixed at 0.002 (gN/g biomass), based on data on C:N ratio from dead wood (White etal.,2000). We assume that plants optimize their nitrogen allocations (i.e., :math:`N_{\text{store}}`, :math:`N_{\text{resp}}`, :math:`N_{\text{lc}}`, :math:`N_{\text{et}}`, :math:`N_{\text{cb}}`) to maximize the photosynthetic carbon gain, defined as the gross photosynthesis ( :math:`A` ) minus the maintenance respiration for @@ -99,18 +99,18 @@ use. Namely, the solutions of nitrogen allocations \{ :math:`N_{\text{store}}`, where :math:`\text{FNC}_{a}` is the functional nitrogen content defined as the total leaf nitrogen content ( :math:`\text{LNC}_{a}`) minus the structural nitrogen content ( :math:`N_{\text{str}}` ). -The gross photosynthesis, :math:`A`, was calculated with a coupled leaf gas exchange model based on the Farquhar et al. (1980) model of -photosynthesis and Ball--Berry-type stomatal conductance model (Ball et al., 1987). The maintenance respiration for photosynthetic enzymes, :math:`R_{\text{psn}}`, is +The gross photosynthesis, :math:`A`, was calculated with a coupled leaf gas exchange model based on the :ref:`Farquhar et al. (1980)` model of +photosynthesis and Ball--Berry-type stomatal conductance model (Ball et al. 1987). The maintenance respiration for photosynthetic enzymes, :math:`R_{\text{psn}}`, is calculated by the multiplication of total photosynthetic nitrogen ( :math:`N_{\text{psn}}` ) and the maintenance respiration cost for photosynthetic enzymes. Maximum electron transport rate ''''''''''''''''''''''''''''''''' In the LUNA model, the maximum electron transport rate -( :math:`J_{\text{max}}`; :math:`{\mu} mol` electron / m :sup:`-2`/s) +( :math:`J_{\text{max}}`; :math:`{\mu} mol` electron / m :sup:`2`/s) is simulated to have a baseline allocation of nitrogen and additional nitrogen allocation to change depending on the average daytime -photosynthetic active radiation (PAR; :math:`{\mu} mol` electron / m :sup:`-2`/s), day length (hours) and air humidity. +photosynthetic active radiation (PAR; :math:`{\mu} mol` electron / m :sup:`2`/s), day length (hours) and air humidity. Specifically, the LUNA model has .. math:: @@ -134,7 +134,7 @@ is the nitrogen use efficiency of :math:`J_{\text{{max}}}`. :math:`J_{\text{max} transport rate to amount of absorbed light (i.e., :math:`\alpha \text{PAR}`). :math:`f\left(\text{day length} \right)` is a function specifies the impact of day length (hours) on :math:`J_{\text{max}}` in view that longer day length has been demonstrated by previous studies to alter :math:`V_{\mathrm{c}\text{max}25}` and -:math:`J_{\text{max}25}` (Bauerle et al., 2012; Comstock and Ehleringer, 1986) through photoperiod sensing and regulation (e.g. Song et al., 2013). +:math:`J_{\text{max}25}` (Bauerle et al. 2012; Comstock and Ehleringer 1986) through photoperiod sensing and regulation (e.g., Song et al. 2013). Following Bauerle et al. (2012), :math:`f\left(\text{day length} \right)` is simulated as follows, .. math:: @@ -193,7 +193,7 @@ Maximum rate of carboxylation The maximum rate of carboxylation at 25 :sup:`o`\ C varies with foliage nitrogen concentration and specific leaf area and is calculated -as in Thornton and Zimmermann (2007). At 25ºC, +as in :ref:`Thornton and Zimmermann (2007)`. At 25ºC, .. math:: :label: 10.11) @@ -235,7 +235,7 @@ Hemisphere). Implementation of Photosynthetic Capacity '''''''''''''''''''''''''''''''''''''''''' -Based on Farquhar et al. (1980) and Wullschleger (1993), we can calculate the +Based on :ref:`Farquhar et al. (1980)` and Wullschleger (1993), we can calculate the electron-limited photosynthetic rate under daily maximum radiation ( :math:`W_{jx}`) and the Rubisco-limited photosynthetic rate ( :math:`W_{\mathrm{c}}`) as follows, @@ -254,7 +254,7 @@ and the Rubisco-limited photosynthetic rate ( :math:`W_{\mathrm{c}}`) as follows where :math:`K_{j}` and :math:`K_{\mathrm{c}}` as the conversion factors for :math:`J_{x}` and :math:`V_{{\mathrm{c}, \text{max}}}` ( :math:`V_{{\mathrm{c}, \text{max}}}` to :math:`W_{\mathrm{c}}` and :math:`J_{x}` to :math:`W_{J_{x}}`), respectively. Based on -Xu et al. (2012), Maire et al. (2012) and Walker et al. (2014), we +:ref:`Xu et al. (2012)`, Maire et al. (2012) and Walker et al. (2014), we assume that :math:`W_{\mathrm{c}}` is proportional to :math:`W_{J_{x}}`. Specifically, we have @@ -266,14 +266,14 @@ assume that :math:`W_{\mathrm{c}}` is proportional to where :math:`t_{\mathrm{c}, j0}` is the baseline ratio of :math:`W_{\mathrm{c}}` to :math:`W_{J_{x}}`. We recognize that this ratio may change depending on the -nitrogen use efficiency of carboxylation and electron transport (Ainsworth and Rogers, 2007), +nitrogen use efficiency of carboxylation and electron transport (Ainsworth and Rogers 2007), therefore the LUNA model has the modification factor, :math:`t_{\alpha}`, to adjust baseline -the ratio depending on the nitrogen use efficiency for electron vs carboxylation (Ali et al 2016). +the ratio depending on the nitrogen use efficiency for electron vs carboxylation (:ref:`Ali et al. 2016`). Total Respiration ''''''''''''''''''' -Following Collatz et al.(1991a), the total respiration ( :math:`R_{\mathrm{t}}`) is +Following :ref:`Collatz et al. (1991)`, the total respiration ( :math:`R_{\mathrm{t}}`) is calculated in proportion to :math:`V_{\text{c,max}}`, .. math:: @@ -295,7 +295,7 @@ Accounting for the daytime and nighttime temperature, the daily respirations is where :math:`D_{\text{day}}` and :math:`D_{\text{night}}` are daytime and nighttime durations in seconds. :math:`f_{\mathrm{r}}(T_{\text{night}})` and :math:`f_{\mathrm{r}}(T_{\text{day}})` are the temperature response functions for -respiration [see Appendix B in Ali et al (2016) for details ]. +respiration (see Appendix B in :ref:`Ali et al. (2016)` for details). .. _Numerical scheme: @@ -304,7 +304,7 @@ Numerical scheme --------------------------------------------------------- The LUNA model searches for the "optimal" nitrogen allocations for maximum net photosynthetic carbon gain -by incrementally increase the nitrogen allocated for light capture (i.e., :math:`N_{\text{lc}}`) (see Ali et al 2016 for details) . +by incrementally increase the nitrogen allocated for light capture (i.e., :math:`N_{\text{lc}}`) (see :ref:`Ali et al. (2016)` for details). We assume that plants only optimize the nitrogen allocation when they can grow (i.e., GPP>0.0). If GPP become zero under stress, then the LUNA model assume a certain amount of enzyme will decay at daily rates of 0.1, in view that the half-life time for photosynthetic enzymes are short (~7 days) (Suzuki et al. 2001). diff --git a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst index 0a0e2ff370..b2afa06646 100644 --- a/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst +++ b/doc/source/tech_note/Plant_Hydraulics/CLM50_Tech_Note_Plant_Hydraulics.rst @@ -183,7 +183,7 @@ modeled according to Darcy's Law for porous media flow as: q = kA\left( \psi_1 - \psi_2 \right) -:math:`q` is the flux of water (mmH\ :sub:`2`\ O) spanning the segment +:math:`q` is the flux of water (mmH\ :sub:`2`\ O/s) spanning the segment between :math:`\psi_1` and :math:`\psi_2` :math:`k` is the hydraulic conductance (s\ :sup:`-1`\ ) @@ -206,11 +206,11 @@ conductivity (:math:`p50`) and a shape fitting parameter (:math:`c_k`). k=k_{max}\cdot 2^{-\left(\dfrac{\psi_1}{p50}\right)^{c_k}} -:math:`k_{max}` is the maximum segment conductance (s-1) +:math:`k_{max}` is the maximum segment conductance (s\ :sup:`-1`\ ) -:math:`p50` is the water potential at 50% loss of conductivity (mmH2O) +:math:`p50` is the water potential at 50% loss of conductivity (mmH\ :sub:`2`\ O) -:math:`\psi_1` is the water potential of the lower segment terminus (mmH2O) +:math:`\psi_1` is the water potential of the lower segment terminus (mmH\ :sub:`2`\ O) .. _Stem-to-leaf: @@ -255,27 +255,27 @@ basis is the leaf area index (either sunlit or shaded). Variables: -:math:`q_{1a}` = flux of water (mmH2O/s) from stem to sunlit leaf +:math:`q_{1a}` = flux of water (mmH\ :sub:`2`\ O/s) from stem to sunlit leaf -:math:`q_{1b}` = flux of water (mmH2O/s) from stem to shaded leaf +:math:`q_{1b}` = flux of water (mmH\ :sub:`2`\ O/s) from stem to shaded leaf :math:`LAI_{sun}` = sunlit leaf area index (m2/m2) :math:`LAI_{shade}` = shaded leaf area index (m2/m2) -:math:`\psi_{stem}` = stem water potential (mmH2O) +:math:`\psi_{stem}` = stem water potential (mmH\ :sub:`2`\ O) -:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH2O) +:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH\ :sub:`2`\ O) -:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH2O) +:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH\ :sub:`2`\ O) Parameters: -:math:`k_{1a,max}` = maximum leaf conductance (s-1) +:math:`k_{1a,max}` = maximum leaf conductance (s\ :sup:`-1`\ ) -:math:`k_{1b,max}` = maximum leaf conductance (s-1) +:math:`k_{1b,max}` = maximum leaf conductance (s\ :sup:`-1`\ ) -:math:`p50_{1}` = water potential at 50% loss of conductance (mmH2O) +:math:`p50_{1}` = water potential at 50% loss of conductance (mmH\ :sub:`2`\ O) :math:`c_{k}` = vulnerability curve shape-fitting parameter (-) @@ -309,21 +309,21 @@ gravitational potential. Variables: -:math:`q_2` = flux of water (mmH2O/s) from root to stem +:math:`q_2` = flux of water (mmH\ :sub:`2`\ O/s) from root to stem :math:`SAI` = stem area index (m2/m2) -:math:`\Delta\psi_z` = gravitational potential (mmH2O) +:math:`\Delta\psi_z` = gravitational potential (mmH\ :sub:`2`\ O) -:math:`\psi_{root}` = root water potential (mmH2O) +:math:`\psi_{root}` = root water potential (mmH\ :sub:`2`\ O) -:math:`\psi_{stem}` = stem water potential (mmH2O) +:math:`\psi_{stem}` = stem water potential (mmH\ :sub:`2`\ O) Parameters: :math:`k_{2,max}` = maximum stem conductivity (m/s) -:math:`p50_2` = water potential at 50% loss of conductivity (mmH2O) +:math:`p50_2` = water potential at 50% loss of conductivity (mmH\ :sub:`2`\ O) :math:`z_2` = vegetation height (m) @@ -392,17 +392,17 @@ from the characteristic root spacing (section :numref:`Root Spacing`). Variables: -:math:`q_{3,i}` = flux of water (mmH2O/s) from soil layer :math:`i` to root +:math:`q_{3,i}` = flux of water (mmH\ :sub:`2`\ O/s) from soil layer :math:`i` to root -:math:`\Delta\psi_{z,i}` = change in gravitational potential from soil layer :math:`i` to surface (mmH2O) +:math:`\Delta\psi_{z,i}` = change in gravitational potential from soil layer :math:`i` to surface (mmH\ :sub:`2`\ O) :math:`LAI` = total leaf area index (m2/m2) :math:`SAI` = stem area index (m2/m2) -:math:`\psi_{soil,i}` = water potential in soil layer :math:`i` (mmH2O) +:math:`\psi_{soil,i}` = water potential in soil layer :math:`i` (mmH\ :sub:`2`\ O) -:math:`\psi_{root}` = root water potential (mmH2O) +:math:`\psi_{root}` = root water potential (mmH\ :sub:`2`\ O) :math:`z_{3,i}` = length of root tissue conducting path = soil layer depth + root lateral length (m) @@ -414,7 +414,7 @@ Parameters: :math:`f_{root-leaf}` = root-to-shoot ratio (-) -:math:`p50_3` = water potential at 50% loss of root tissue conductance (mmH2O) +:math:`p50_3` = water potential at 50% loss of root tissue conductance (mmH\ :sub:`2`\ O) :math:`ck` = shape-fitting parameter for vulnerability curve (-) @@ -461,9 +461,9 @@ Vegetation water stress is calculated based on leaf water potential and is used :math:`E_{shade,max}` = shaded leaf transpiration absent water stress (mm/s) -:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH2O) +:math:`\psi_{sunleaf}` = sunlit leaf water potential (mmH\ :sub:`2`\ O) -:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH2O) +:math:`\psi_{shadeleaf}` = shaded leaf water potential (mmH\ :sub:`2`\ O) :math:`\beta_{t,sun}` = sunlit transpiration water stress (-) diff --git a/doc/source/tech_note/Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst b/doc/source/tech_note/Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst index d087e1d06a..4c2cb71a26 100644 --- a/doc/source/tech_note/Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst +++ b/doc/source/tech_note/Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst @@ -9,7 +9,7 @@ plants due to the aggregate of processes such as wind throw, insect attack, disease, extreme temperatures or drought, and age-related decline in vigor. These processes are referred to in aggregate as “gap-phase†mortality. Mortality due to fire and anthropogenic land -cover change are treated separately (see Chapters 18 and 21, +cover change are treated separately (see Chapters :numref:`rst_Fire` and :numref:`rst_Transient Landcover Change`, respectively). Mortality Fluxes Leaving Vegetation Pools @@ -19,9 +19,9 @@ Whole-plant mortality is parameterized very simply, assuming a mortality rate of 2% yr\ :sup:`-1` for all vegetation types. This is clearly a gross oversimplification of an important process, and additional work is required to better constrain this process in different climate zones -(Keller et al. 2004; Sollins 1982), for different species mixtures -(Gomes et al. 2003), and for different size and age classes (Busing -2005; Law et al. 2003). Literature values for forest mortality rates +(:ref:`Keller et al. 2004`; :ref:`Sollins 1982`), for different species mixtures +(:ref:`Gomes et al. 2003`), and for different size and age classes (:ref:`Busing +2005`; :ref:`Law et al. 2003`). Literature values for forest mortality rates range from at least 0.7% to 3.0% yr\ :sup:`-1`. Taking the annual rate of mortality (*am*, proportion yr\ :sup:`-1`) as 0.02, a mortality rate per second (*m*) is calculated as diff --git a/doc/source/tech_note/index.rst b/doc/source/tech_note/index.rst index d54e70f1e9..5f72de7d9b 100644 --- a/doc/source/tech_note/index.rst +++ b/doc/source/tech_note/index.rst @@ -34,6 +34,7 @@ CLM Technical Note Vegetation_Phenology_Turnover/CLM50_Tech_Note_Vegetation_Phenology_Turnover.rst Decomposition/CLM50_Tech_Note_Decomposition.rst External_Nitrogen_Cycle/CLM50_Tech_Note_External_Nitrogen_Cycle.rst + Plant_Mortality/CLM50_Tech_Note_Plant_Mortality.rst Fire/CLM50_Tech_Note_Fire.rst Methane/CLM50_Tech_Note_Methane.rst Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst From b5c0ae92aeb43ca4cd2159723227707c39dae0ff Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 1 Feb 2018 16:58:47 -0700 Subject: [PATCH 141/730] Add what's new with glaciers, and some minor edits --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 97 +++++++++++++------ 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index a7f2100478..7c9d98bcd6 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -1,7 +1,7 @@ .. _rst_Glaciers: Glaciers -============ +======== This chapter describes features of CLM that are specific to coupling to an ice sheet model (in the CESM context, this is the CISM model; @@ -11,6 +11,42 @@ about glacier land units can be found elsewhere in this document (see Chapter :numref:`rst_Surface Characterization, Vertical Discretization, and Model Input Requirements` for an overview). +.. _Glaciers summary of CLM5.0 updates relative to CLM4.5: + +Summary of CLM5.0 updates relative to CLM4.5 +-------------------------------------------- + +Compared with CLM4.5 (:ref:`Oleson et al. 2013 `), +CLM5.0 contains substantial improvements in its capabilities for +land-ice science. This section summarizes these improvements, and the +following sections provide more details. + +- All runs include multiple glacier elevation classes over Greenland and + Antarctica and compute ice sheet surface mass balance in those + regions. + +- A number of namelist parameters offer fine-grained control over + glacier behavior in different regions of the world (section + :numref:`Glacier regions`). (The options used outside of Greenland and + Antarctica reproduce the standard CLM4.5 glacier behavior.) + +- CLM can now keep its glacier areas and elevations in sync with CISM + when running with an evolving ice sheet. (However, in typical + configurations, the ice sheet geometry still remains fixed throughout + the run.) + +- The downscaling to elevation classes now includes downwelling longwave + radiation and partitioning of precipitation into rain vs. snow + (section :numref:`Multiple elevation class scheme`). + +- Other land units within the CISM domain undergo the same downscaling + as the glacier land unit, and surface mass balance is computed for the + natural vegetated land unit. This allows CLM to produce glacial + inception when running with an evolving ice sheet model. + +- There have also been substantial improvements to CLM's snow physics, + as described in other chapters of this document. + .. _Overview Glaciers: Overview @@ -48,7 +84,7 @@ CISM: #. We can use the sophisticated snow physics parameterization already in CLM instead of implementing a separate scheme for CISM. Any - improvements to the CLM are applied to ice sheets automatically. + improvements to CLM are applied to ice sheets automatically. #. The atmosphere model can respond during runtime to ice-sheet surface changes (even in the absence of two-way feedbacks with CISM). As @@ -78,13 +114,13 @@ the run. In these runs, CISM serves two roles in the system: SGLC then SMB will still be computed in CLM, but it won't be downscaled to a high-resolution ice sheet grid.) -However, it is also possible to run CESM with an evolving ice sheet. In -this case, CLM responds to CISM's evolution by adjusting the areas of -the glacier landunit and each elevation class within this landunit, as -well as the mean topographic heights of each elevation class. Thus, -CLM's glacier areas and elevations remain in sync with -CISM's. Conservation of mass and energy is done as for other landcover -change (see Chapter :numref:`rst_Transient Landcover Change`). +It is also possible to run CESM with an evolving ice sheet. In this +case, CLM responds to CISM's evolution by adjusting the areas of the +glacier land unit and each elevation class within this land unit, as well +as the mean topographic heights of each elevation class. Thus, CLM's +glacier areas and elevations remain in sync with CISM's. Conservation of +mass and energy is done as for other landcover change (see Chapter +:numref:`rst_Transient Landcover Change`). .. _Glacier regions: @@ -94,7 +130,7 @@ Glacier regions and their behaviors The world's glaciers and ice sheets are broken down into a number of different regions (four by default) that differ in three respects: -#. Whether the gridcell's glacier landunit contains: +#. Whether the gridcell's glacier land unit contains: a. Multiple elevation classes (section :numref:`Multiple elevation class scheme`) @@ -189,21 +225,21 @@ runaway sea ice growth in that region. Multiple elevation class scheme ------------------------------- -The glacier landunit contains multiple columns based on surface +The glacier land unit contains multiple columns based on surface elevation. These are known as elevation classes, and the land unit is -referred to as glacier\_mec. (As described in section :numref:`Glacier +referred to as *glacier\_mec*. (As described in section :numref:`Glacier regions`, some regions have only a single elevation class, but they are -still referred to as glacier\_mec landunits.) The default is to have 10 +still referred to as *glacier\_mec* land units.) The default is to have 10 elevation classes whose lower limits are 0, 200, 400, 700, 1000, 1300, 1600, 2000, 2500, and 3000 m. Each column is characterized by a fractional area and surface elevation that are read in during model initialization, and then possibly overridden by CISM as the run -progresses. Each glacier\_mec column within a grid cell has distinct ice +progresses. Each *glacier\_mec* column within a grid cell has distinct ice and snow temperatures, snow water content, surface fluxes, and SMB. The atmospheric surface temperature, potential temperature, specific humidity, density, and pressure are downscaled from the atmosphere's -mean grid cell elevation to the glacier\_mec column elevation using a +mean grid cell elevation to the *glacier\_mec* column elevation using a specified lapse rate (typically 6.0 deg/km) and an assumption of uniform relative humidity. Longwave radiation is downscaled by assuming a linear decrease in downwelling longwave radiation with increasing elevation @@ -231,9 +267,9 @@ In contrast to most CLM subgrid units, glacier\_mec columns can be active (i.e., have model calculations run there) even if their area is zero. These are known as "virtual" columns. This is done because the ice sheet model may require a SMB even for some grid cells where CLM does -not have glacier land units. Virtual columns do not affect energy -exchange between the land and the atmosphere, but are included for -potential forcing of CISM. +not have glacier land units. Virtual columns also facilitate glacial +advance and retreat in the two-way coupled case. Virtual columns do not +affect energy exchange between the land and the atmosphere. .. _Computation of the surface mass balance: @@ -245,7 +281,7 @@ associated runoff terms. The description here only applies to regions where glacial melt runs off and is replaced by ice, not to regions where glacial melt remains in place. Thus, by default, this only applies to Greenland and Antarctica, not to mountain glaciers elsewhere in the -world. (See also :numref:`Glacier regions`.) +world. (See also section :numref:`Glacier regions`.) The SMB of a glacier or ice sheet is the net annual accumulation/ablation of mass at the upper surface. Ablation is defined @@ -299,7 +335,7 @@ then CISM controls the fate of the snow capping mass in :math:`q_{ice,frz}` (e.g., eventually transporting it to lower elevations where it can be melted or calved). Since CISM will now own this mass, the snow capping flux does *not* contribute to any runoff -fluxes generated by CLM. +fluxes generated by CLM in this case. If *glc\_dyn\_runoff\_routing* is false, then CLM sends the snow capping flux as runoff, as a crude representation of ice calving (see also @@ -325,17 +361,18 @@ need is subtle, but can be understood with either of these explanations: for each unit of melt. For a given point in space or time, this reduction can result in -negative ice runoff. However, when integrated over time and space, for +negative ice runoff. However, when integrated over space and time, for an ice sheet that is near equilibrium, this just serves to decrease the -too-high positive ice runoff from snow capping. (This near-equilibrium -assumption is a key point in the treatment of snow capping with -*glc\_dyn\_runoff\_routing* false. For glaciers and ice sheets that -violate this assumption, either because they are far out of equilibrium -with the climate or because the model is being run for hundreds of -years, there are two ways to avoid the unrealistic ice runoff from snow -capping: by running with an evolving, two-way-coupled ice sheet or by -changing a glacier region's ice runoff behavior as described in section -:numref:`Glacier regions`.) +too-high positive ice runoff from snow capping. (The treatment of snow +capping with *glc\_dyn\_runoff\_routing* false is based on this +near-equilibrium assumption - i.e., that ice accumulation is roughly +balanced by :math:`calving + melt`, integrated across space and time. +For glaciers and ice sheets that violate this assumption, either because +they are far out of equilibrium with the climate or because the model is +being run for hundreds of years, there are two ways to avoid the +unrealistic ice runoff from snow capping: by running with an evolving, +two-way-coupled ice sheet or by changing a glacier region's ice runoff +behavior as described in section :numref:`Glacier regions`.) In regions where SMB is computed for glaciers, SMB is also computed for the natural vegetated land unit. Because there is no ice to melt in this From d572279fc56d35cbe9861fbdc65ebbd7c2713704 Mon Sep 17 00:00:00 2001 From: Katie Dagon Date: Thu, 1 Feb 2018 22:04:34 -0700 Subject: [PATCH 142/730] A few more typos --- doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 5 ++--- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- .../Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 139aea37df..ddca9ed4ca 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -67,7 +67,6 @@ structure may coexist on a single column. All fluxes to and from the surface are defined at the PFT level, as are the vegetation state variables (e.g. vegetation temperature and canopy water storage). On the crop land unit, typically, different crop types can be represented on each - crop land unit column (see Chapter :numref:`rst_Crops and Irrigation` for details). In addition to state and flux variable data structures for conserved @@ -462,11 +461,11 @@ file defined in the namelist (see the CLM4.5 User’s Guide). Aerosol deposition rates were calculated in a transient 1850-2009 CAM simulation (at a resolution of 1.9x2.5x26L) with interactive chemistry (troposphere and stratosphere) driven by CCSM3 20\ :sup:`th` century -sea-surface temperatures and emissions (Lamarque et al. 2010) for +sea-surface temperatures and emissions (:ref:`Lamarque et al. 2010`) for short-lived gases and aerosols; observed concentrations were specified for methane, N\ :sub:`2`\ O, the ozone-depleting substances (CFCs) ,and CO\ :sub:`2`. The fluxes are used by the snow-related -parameterizations (Chapters :numref:`rst_Surface Albedos` and numref:`rst_Snow Hydrology`). +parameterizations (Chapters :numref:`rst_Surface Albedos` and :numref:`rst_Snow Hydrology`). :sup:`4`\ The nitrogen deposition rate is required by the biogeochemistry model when active and represents the total deposition of diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 0993904323..d08f3e87db 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -173,7 +173,7 @@ The purpose of this document is to fully describe the biogeophysical and biogeochemical parameterizations and numerical implementation of version 5.0 of the Community Land Model (CLM5.0). Scientific justification and evaluation of these parameterizations can be found in the referenced -scientific papers (:ref:`rst_References`). This document and the CLM5.0 +scientific papers (Chapter :numref:`rst_References`). This document and the CLM5.0 User’s Guide together provide the user with the scientific description and operating instructions for CLM. diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index 14ceeaa968..d9dee6581a 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -725,7 +725,7 @@ Subdivision The snow layers are subdivided when the layer thickness exceeds the prescribed maximum thickness :math:`\Delta z_{\max }` with lower and -upper bounds that depend on the number of snow layers (numref:`Table snow layer thickness`). For +upper bounds that depend on the number of snow layers (:numref:`Table snow layer thickness`). For example, if there is only one layer, then the maximum thickness of that layer is 0.03 m, however, if there is more than one layer, then the maximum thickness of the top layer is 0.02 m. Layers are checked From 8b21b15e923d953cfc7c5fe70c5febbdcbdf3fe0 Mon Sep 17 00:00:00 2001 From: Katie Dagon Date: Thu, 1 Feb 2018 22:29:09 -0700 Subject: [PATCH 143/730] Still trying to fix References link --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index d08f3e87db..0993904323 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -173,7 +173,7 @@ The purpose of this document is to fully describe the biogeophysical and biogeochemical parameterizations and numerical implementation of version 5.0 of the Community Land Model (CLM5.0). Scientific justification and evaluation of these parameterizations can be found in the referenced -scientific papers (Chapter :numref:`rst_References`). This document and the CLM5.0 +scientific papers (:ref:`rst_References`). This document and the CLM5.0 User’s Guide together provide the user with the scientific description and operating instructions for CLM. From 9c1dc25e7fc189f2c353e47b900b1941adcecd19 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 2 Feb 2018 06:00:25 -0700 Subject: [PATCH 144/730] Minor edits from Bill Lipscomb --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index 7c9d98bcd6..cb11d05c76 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -93,9 +93,9 @@ CISM: ice-sheet retreat on paleoclimate time scales. Without this feedback the atmosphere warms much less, and the retreat is delayed. -#. The improved SMB is available in CLM for all glaciated grid cells - (e.g., in the Alps, Rockies, Andes, and Himalayas), not just those - which are part of ice sheets. +#. The improved SMB is potentially available in CLM for all glaciated + grid cells (e.g., in the Alps, Rockies, Andes, and Himalayas), not + just those which are part of ice sheets. In typical runs, CISM is not evolving; CLM computes the SMB and sends it to CISM, but CISM's ice sheet geometry remains fixed over the course of @@ -104,8 +104,8 @@ the run. In these runs, CISM serves two roles in the system: #. Over the CISM domain (typically Greenland in CESM2), CISM dictates glacier areas and topographic elevations, overriding the values on CLM's surface dataset. CISM also dictates the elevation of - non-glacier land units in its domain, and atmospheric fields are - downscaled to non-glacier land units only in this domain. (So if you + non-glacier land units in its domain, and only in this domain are + atmospheric fields downscaled to non-glacier land units. (So if you run with a stub glacier model - SGLC - then glacier areas and elevations will be taken entirely from CLM's surface dataset, and no downscaling will be done over non-glacier land units.) @@ -266,10 +266,10 @@ CISM domain as consistent as possible. In contrast to most CLM subgrid units, glacier\_mec columns can be active (i.e., have model calculations run there) even if their area is zero. These are known as "virtual" columns. This is done because the ice -sheet model may require a SMB even for some grid cells where CLM does -not have glacier land units. Virtual columns also facilitate glacial -advance and retreat in the two-way coupled case. Virtual columns do not -affect energy exchange between the land and the atmosphere. +sheet model may require a SMB for some grid cells where CLM has zero +glacier area in that elevation range. Virtual columns also facilitate +glacial advance and retreat in the two-way coupled case. Virtual columns +do not affect energy exchange between the land and the atmosphere. .. _Computation of the surface mass balance: From 05a5eb7f2646bef8ab920bd1d47ae327ff4b737f Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Fri, 2 Feb 2018 15:52:55 +0100 Subject: [PATCH 145/730] update portions of the Snow Hydrology chapter --- .../CLM50_Tech_Note_Snow_Hydrology.rst | 182 +++++++++++++----- 1 file changed, 137 insertions(+), 45 deletions(-) diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index d9dee6581a..44bf0ac9c7 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -37,7 +37,7 @@ the state variable is the mass of snow :math:`W_{sno}` (kg m\ :sup:`-2`). Section :numref:`Snow Covered Area Fraction` describes the calculation of fractional snow covered area, which is used in the surface albedo -calculation (Chapter :numref:`rst_Surface Albedos`) and thesurface flux +calculation (Chapter :numref:`rst_Surface Albedos`) and the surface flux calculations (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes`). The following two sections (:numref:`Ice Content` and :numref:`Water Content`) describe the ice and water content of the snow @@ -90,7 +90,12 @@ reset to zero. The depletion curve shape parameter is defined as The standard deviation of the elevation within a grid cell, :math:`\sigma _{topo}` , is calculated from a high resolution DEM (a -1km DEM is used for CLM). +1km DEM is used for CLM). +Note that *glacier\_mec* columns (section :numref:`Multiple elevation class scheme`) +are treated differently in this respect, as they already account for the +subgrid topography in a grid cell in their own way. +Therefore, in each *glacier\_mec* column very flat terrain is assumed, +implemented as :math:`N_{melt}=10`. .. _Ice Content: @@ -141,13 +146,20 @@ where \Delta z_{sno} =\frac{q_{grnd,\, ice} \Delta t}{f_{sno} \rho _{sno} } and :math:`\rho _{sno}` is the bulk density of newly fallen snow (kg -m\ :sup:`-3`) (:ref:`van Kampenhout et al. (2017) `, -:ref:`Anderson (1976) `) +m\ :sup:`-3`), which parameterized by a temperature-dependent and a +wind-dependent term: .. math:: - :label: 8.21 + :label: 8.21a - \rho_{sno} = + \rho_{sno} = \rho_{T} + \rho_{w}. + +The temperature dependent term is given by (:ref:`van Kampenhout et al. (2017) `) + +.. math:: + :label: 8.21b + + \rho_{T} = \left\{\begin{array}{lr} 50 + 1.7 \left(17\right)^{1.5} & \qquad T_{atm} >T_{f} +2 \ \\ 50+1.7 \left(T_{atm} -T_{f} + 15\right)^{1.5} & \qquad T_{f} - 15 < T_{atm} \le T_{f} + 2 \ \\ @@ -158,21 +170,21 @@ m\ :sup:`-3`) (:ref:`van Kampenhout et al. (2017) `, .. bifall(c) = -(50._r8/15._r8 + 0.0333_r8*15_r8)*(forc_t(c)-tfrz) - 0.0333_r8*(forc_t(c)-tfrz)**2 where :math:`T_{atm}` is the atmospheric temperature (K), and :math:`T_{f}` is -the freezing temperature of water (K) (:numref:`Table Physical Constants`). When -wind speed :math:`W_{atm}` is greater than 0.1 m :sub:`-1`, snow density +the freezing temperature of water (K) (:numref:`Table Physical Constants`). +When 10 m wind speed :math:`W_{atm}` is greater than 0.1 m\ :sup:`-1`, snow density increases due to wind-driven compaction according to -:ref:`(van Kampenhout et al. 2017) ` +:ref:`van Kampenhout et al. 2017 ` .. math:: - :label: 8.21b - - \Delta \rho_{sno} = 266.861 \left(\frac{1 + tanh(\frac{W_{atm}}{5})}{2}\right)^{8.8} + :label: 8.21c -where :math:`\Delta \rho_{sno}` (kg m\ :sup:`-3`) is the increase in snow -density relative to :eq:`8.21`. + \rho_{w} = 266.861 \left(\frac{1 + \tanh(\frac{W_{atm}}{5})}{2}\right)^{8.8} .. bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + TANH(forc_wind(g)/5.0_r8))/2._r8)**8.8_r8) +which is added to the temperature-dependent term (cf. equation :eq:`8.21a`). + + The mass of snow :math:`W_{sno}` is .. math:: @@ -213,9 +225,9 @@ content is reset to zero and the liquid water content :math:`w_{liq,\, snl+1}` is reduced by the amount required to bring :math:`w_{ice,\, snl+1}^{n+1}` up to zero. -The snow water equivalent :math:`W_{sno}` is capped to not exceed 1000 +The snow water equivalent :math:`W_{sno}` is capped to not exceed 10,000 kg m\ :sup:`-2`. If the addition of :math:`q_{frost}` were to -result in :math:`W_{sno} >1000` kg m\ :sup:`-2`, the frost term +result in :math:`W_{sno} > 10,000` kg m\ :sup:`-2`, the frost term :math:`q_{frost}` is instead added to the ice runoff term :math:`q_{snwcp,\, ice}` (section :numref:`Runoff from glaciers and snow-capped surfaces`). @@ -447,18 +459,22 @@ Snow Compaction Snow compaction is initiated after the soil hydrology calculations [surface runoff (section :numref:`Surface Runoff`), infiltration (section :numref:`Infiltration`), soil water (section :numref:`Soil Water`)] are -complete. Compaction of snow includes three types of processes: -destructive metamorphism of new snow (crystal breakdown due to wind or -thermodynamic stress); snow load or overburden (pressure); and melting -(changes in snow structure due to melt-freeze cycles plus changes in -crystals due to liquid water). The total fractional compaction rate for +complete. Currently, there are four processes included that lead to snow +compaction: + + #. destructive metamorphism of new snow (crystal breakdown due to wind or thermodynamic stress) + #. snow load or compaction by overburden pressure + #. melting (changes in snow structure due to melt-freeze cycles plus changes in crystals due to liquid water) + #. drifting snow compaction. + +The total fractional compaction rate for each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the three compaction processes .. math:: :label: 8.41 - C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} . + C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} +C_{R4,\, i} . Compaction is not allowed if the layer is saturated @@ -469,8 +485,21 @@ Compaction is not allowed if the layer is saturated or if the ice content is below a minimum value (:math:`w_{ice,\, i} \le 0.1`). +The snow layer thickness after compaction is -Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sub:`-1`) is temperature dependent (:ref:`Anderson (1976) `) +.. math:: + :label: 8.50 + + \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). + + + +.. _Destructive metamorphism: + +Destructive metamorphism +'''''''''''''''''''''''' + +Compaction as a result of destructive metamorphism :math:`C_{R1,\; i}` (s\ :sup:`-1`) is temperature dependent (:ref:`Anderson (1976) `) .. math:: :label: 8.43 @@ -483,36 +512,34 @@ where :math:`c_{3} =2.777\times 10^{-6}` (s\ :sup:`-1`) is the fractional compa :label: 8.44 \begin{array}{lr} - c_{1} = 1 & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 100{\rm \; kg\; m}^{{\rm -3}} \\ - c_{1} = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -100\right)\right] & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >100{\rm \; kg\; m}^{{\rm -3}} \\ + c_{1} = 1 & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \le 175{\rm \; kg\; m}^{{\rm -3}} \\ + c_{1} = \exp \left[-0.046\left(\frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } -175\right)\right] & \qquad \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } >175{\rm \; kg\; m}^{{\rm -3}} \\ c_{2} = 2 & \qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } >0.01 \\ c_{2} = 1 & \qquad \frac{w_{liq,\, i} }{f_{sno} \Delta z_{i} } \le 0.01 \end{array} +.. upper limit (upplim_destruct_metamorph) used to be 100 but was changed to 175 for CLM5 (Van Kampenhout et al., 2017) + where :math:`{w_{ice,\, i} \mathord{\left/ {\vphantom {w_{ice,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` and :math:`{w_{liq,\, i} \mathord{\left/ {\vphantom {w_{liq,\, i} \left(f_{sno} \Delta z_{i} \right)}} \right. \kern-\nulldelimiterspace} \left(f_{sno} \Delta z_{i} \right)}` are the bulk densities of liquid water and ice (kg m\ :sup:`-3`). -The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (:ref:`Anderson (1976) `) -.. math:: - :label: 8.45 +.. _Overburden pressure compaction: - C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } +Overburden pressure compaction +'''''''''''''''''''''''''''''' -where :math:`\eta` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and temperature as +The compaction rate as a result of overburden :math:`C_{R2,\; i}` (s\ :sup:`-1`) is a linear function of the snow load pressure :math:`P_{s,\, i}` (kg m\ :sup:`-2`) (:ref:`Anderson (1976) `): .. math:: - :label: 8.46 + :label: 8.45 - \eta =\eta _{0} \exp \left[c_{5} \left(T_{f} -T_{i} \right)+c_{6} \frac{w_{ice,\, i} }{f_{sno} \Delta z_{i} } \right] + C_{R2,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{overburden} =-\frac{P_{s,\, i} }{\eta } -where :math:`\eta _{0} =9\times 10^{5}` kg s m\ :sup:`-2`, and -:math:`c_{5} =0.08` K\ :sup:`-1`, :math:`c_{6} =0.023` -m\ :sup:`3` kg\ :sup:`-1` are constants. The snow load -pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of +The snow load pressure :math:`P_{s,\, i}` is calculated for each layer as the sum of the ice :math:`w_{ice,\, i}` and liquid water contents :math:`w_{liq,\, i}` of the layers above plus half the ice and liquid water contents of the layer being compacted @@ -522,6 +549,32 @@ water contents of the layer being compacted P_{s,\, i} =\frac{w_{ice,\, i} +w_{liq,\, i} }{2} +\sum _{j=snl+1}^{j=i-1}\left(w_{ice,\, j} +w_{liq,\, j} \right) . + +Variable :math:`\eta` in :eq:`8.45` is a viscosity coefficient (kg s m\ :sup:`-2`) that varies with density and +temperature as + +.. math:: + :label: 8.46 + + \eta = f_{1} f_{2} \eta_{0} \frac{\rho_{i}}{c_{\eta}} \exp \left[ a_{\eta} \left(T_{f} -T_{i} \right) + b_{\eta} \rho_{i} \right] + +with constant factors :math:`\eta _{0} = 7.62237 \times 10^{6}` kg s\ :sup:`-1` m\ :sup:`-2`, +:math:`a_{\eta} = 0.1` K\ :sup:`-1`, :math:`b_{\eta} = 0.023` m\ :sup:`-3` kg\ :sup:`-1`, +and :math:`c_{\eta} = 358` kg m\ :sup:`-3` (:ref:`van Kampenhout et al. (2017) `). +Further, factor :math:`f_1` accounts for the presence of liquid water (:ref:`Vionnet et al. (2012) `): + +.. math:: + :label: 8.46b + + f_{1} = \frac{1}{1+ 60 \frac{w_{\mathrm{liq},\, i}}{\rho_{\mathrm{liq}} \Delta z_{i} }}. + +Factor :math:`f_2` originally accounts for the presence of angular grains, but since grain shape is not modelled +:math:`f_2` is fixed to the value 4. + +.. _Compaction by melt: + +Compaction by melt +'''''''''''''''''' The compaction rate due to melting :math:`C_{R3,\; i}` (s\ :sup:`-1`) is taken to be the ratio of the change in snow ice mass after the melting to the mass before melting @@ -531,21 +584,60 @@ mass after the melting to the mass before melting C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) and melting is identified during the phase change calculations (section -:numref:`Phase Change`). Because snow depth is defined as the average depth of the snow -covered area, the snow depth must also be updated for changes in -:math:`f_{sno}` . +:numref:`Phase Change`). + + +.. _Compaction by drifting snow: + +Compaction by drifting snow +''''''''''''''''''''''''''' +Crystal breaking by drifting snow leads to higher snow densities at the surface. +This process is particularly important on ice sheets, where destructive metamorphism is slow due to low temperatures +but high wind speeds (katabatic winds) are prevailing. +Therefore a drifting snow compaction parametrization was introduced, based on (:ref:`Vionnet et al. (2012) `). .. math:: :label: 8.49 - C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) + C_{R4,\, i} = \left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{drift} = - \frac{\rho_{\max} - \rho_i}{\tau_{i}}. -The snow layer thickness after compaction is then +Here, :math:`\rho_{\max} = 350` kg m\ :sup:`-3` is the upper limit to which this process is active, and +:math:`\tau_{i}` is a timescale which is depth dependent: .. math:: - :label: 8.50 + :label: 8.49b + + \tau_i = \frac{\tau}{\Gamma_{\mathrm{drift}}^i} \quad \mathrm{,} \:\; \Gamma^i_\mathrm{drift} = \max\left[ 0, S_\mathrm{I}^i \exp(-z_i / 0.1) \right]. + +Here, :math:`\tau` is a characteristic time scale for drifting snow compaction and is empirically set to 48 h, and +:math:`z_i` is a pseudo-depth which takes into account previous hardening of snow layers above the current layer: +:math:`z_i = \sum_j \Delta z_j \cdot (3.25 - S_\mathrm{I}^j)`. +The driftability index :math:`S_\mathrm{I}` reflects how well snow can be drifted and depends on the mobility of the snow +as well as the 10 m wind speed: + +.. math:: + :label: 8.49c + + \begin{array}{rcl} + S_\mathrm{I} & = & -2.868 \exp(-0.085 U) + 1 + M_{\mathrm{O}} \\ + M_\mathrm{O} & = & -0.069 + 0.66 F(\rho) + \end{array} + +The latter equation (for the mobility index :math:`M_\mathrm{O}`) is a simplification from the original paper +by removing the dependency on grain size and assuming spherical grains +(see :ref:`van Kampenhout et al. (2017) `). + +.. Because snow depth is defined as the average depth of the snow +.. covered area, the snow depth must also be updated for changes in +.. :math:`f_{sno}` . +.. +.. .. math:: +.. :label: 8.49 +.. +.. C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) + + - \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). .. _Snow Layer Combination and Subdivision: @@ -725,8 +817,8 @@ Subdivision The snow layers are subdivided when the layer thickness exceeds the prescribed maximum thickness :math:`\Delta z_{\max }` with lower and -upper bounds that depend on the number of snow layers (:numref:`Table snow layer thickness`). For -example, if there is only one layer, then the maximum thickness of that +upper bounds that depend on the number of snow layers (:numref:`Table snow layer thickness`). +For example, if there is only one layer, then the maximum thickness of that layer is 0.03 m, however, if there is more than one layer, then the maximum thickness of the top layer is 0.02 m. Layers are checked sequentially from top to bottom for this limit. If there is only one From bcf7f9e9a5a39ac71da73611ee7644be2b09c391 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Fri, 2 Feb 2018 08:50:37 -0700 Subject: [PATCH 146/730] Removed old references to wetland land unit --- doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst | 6 +++--- .../tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 2 +- doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst | 4 ++-- .../tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 4 ++-- .../Introduction/CLM50_Tech_Note_Introduction.rst | 8 ++++---- .../Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst | 4 ++-- .../Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst | 6 ------ .../CLM50_Tech_Note_Soil_Snow_Temperatures.rst | 4 ++-- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 6 +++--- .../CLM50_Tech_Note_Transient_Landcover.rst | 2 +- 10 files changed, 20 insertions(+), 26 deletions(-) diff --git a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst index c40ac583f7..2b3064c921 100644 --- a/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst +++ b/doc/source/tech_note/Dust/CLM50_Tech_Note_Dust.rst @@ -34,10 +34,10 @@ mobilization :math:`f_{m}` is given by .. math:: :label: 29.2 - f_{m} =\left(1-f_{lake} -f_{wetl} \right)\left(1-f_{sno} \right)\left(1-f_{v} \right)\frac{w_{liq,1} }{w_{liq,1} +w_{ice,1} } + f_{m} =\left(1-f_{lake} \right)\left(1-f_{sno} \right)\left(1-f_{v} \right)\frac{w_{liq,1} }{w_{liq,1} +w_{ice,1} } -where :math:`f_{lake}` and :math:`f_{wetl}` and :math:`f_{sno}` -are the CLM grid cell fractions of lake and wetland (section +where :math:`f_{lake}` and :math:`f_{sno}` +are the CLM grid cell fractions of lake (section :numref:`Surface Data`) and snow cover (section :numref:`Snow Covered Area Fraction`), all ranging from zero to one. Not mentioned by :ref:`Zender et al. (2003)`, :math:`w_{liq,\, 1}` and diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index ddca9ed4ca..86b3bbb5a9 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -680,7 +680,7 @@ are obtained from a variety of sources described below. At the base spatial resolution of 0.05\ :sup:`o`, the percentage of each PFT is defined with respect to the vegetated portion of the grid -cell and the sum of the PFTs is 100%. The percent lake, wetland, +cell and the sum of the PFTs is 100%. The percent lake, glacier, and urban at their base resolution are specified with respect to the entire grid cell. The surface dataset creation routines re-adjust the PFT percentages to ensure that the sum of all land cover types in diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index fdd6873346..7abed081fd 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -583,7 +583,7 @@ Sensible and Latent Heat Fluxes for Non-Vegetated Surfaces Surfaces are considered non-vegetated for the surface flux calculations if leaf plus stem area index :math:`L+S<0.05` (section :numref:`Phenology and vegetation burial by snow`). By -definition, this includes bare soil, wetlands, and glaciers. The +definition, this includes bare soil and glaciers. The solution for lakes is described in Chapter :numref:`rst_Lake Model`. For these surfaces, the surface may be exposed to the atmosphere, snow covered, and/or surface water covered, so that the sensible heat flux :math:`H_{g}` (W @@ -785,7 +785,7 @@ The roughness lengths used to calculate :math:`r_{am}` , :math:`r_{ah}` , and :math:`r_{aw}` are :math:`z_{0m} =z_{0m,\, g}` , :math:`z_{0h} =z_{0h,\, g}` , and :math:`z_{0w} =z_{0w,\, g}` . The displacement height :math:`d=0`. The momentum roughness length is -:math:`z_{0m,\, g} =0.01` for soil, glaciers, and wetland, and +:math:`z_{0m,\, g} =0.01` for soil, glaciers, and :math:`z_{0m,\, g} =0.0024` for snow-covered surfaces (:math:`f_{sno} >0`). In general, :math:`z_{0m}` is different from :math:`z_{0h}` because the transfer of momentum is affected by pressure diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index b1153c3a5d..2bcd8f24b0 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -28,7 +28,7 @@ ET from vegetation (Chapter :numref:`rst_Momentum, Sensible Heat, and Latent Hea :math:`q_{h2osfc}` is runoff from surface water storage (section :numref:`Surface Runoff`), :math:`q_{drai}` is sub-surface drainage (section :numref:`Lateral Sub-surface Runoff`), :math:`q_{rgwl}` and :math:`q_{snwcp,ice}` are liquid and solid runoff -from glaciers, wetlands, and lakes, and runoff from other surface types +from glaciers and lakes, and runoff from other surface types due to snow capping (section :numref:`Runoff from glaciers and snow-capped surfaces`) (all in kg m\ :sup:`-2` s\ :sup:`-1`), :math:`N_{levsoi}` is the number of soil layers (note that hydrology calculations are only done over soil layers 1 to @@ -334,7 +334,7 @@ Surface Water Storage A surface water store has been added to the model to represent wetlands and small, sub-grid scale water bodies. As a result, the wetland land -unit has been removed. The state variables for surface water are the +unit has been removed as of CLM4.5. The state variables for surface water are the mass of water :math:`W_{sfc}` (kg m\ :sup:`-2`) and temperature :math:`T_{h2osfc}` (Chapter :numref:`rst_Soil and Snow Temperatures`). Surface water storage and outflow are diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 0993904323..3fc79b5e09 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -5,16 +5,16 @@ ***Coordinating Lead Authors*** -**David M. Lawrence, Rosie Fisher, Charles D. Koven, Keith W. Oleson, Sean Swenson** +**David Lawrence, Rosie Fisher, Charles Koven, Keith Oleson, Sean Swenson** ***Lead Authors*** -**Gordon Bonan, Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Peter J. Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William J. Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu** +**Ben Andre, Gordon Bonan, Bardan Ghimire, Leo van Kampenhout, Daniel Kennedy, Erik Kluzek, Ryan Knox, Peter Lawrence, Fang Li, Hongyi Li, Danica Lombardozzi, Yaqiong Lu, Justin Perket, William Riley, William Sacks, Mingjie Shi, Will Wieder, Chonggang Xu** ***Contributing Authors*** -**Ashehad Ali, Ben Andre, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Ryan Knox, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Andrew Slater, Zachary M. Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** +**Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index cc32f0c1f3..5e09da13c5 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -288,8 +288,8 @@ emissivity of the ground is \varepsilon _{g} =\varepsilon _{soi} \left(1-f_{sno} \right)+\varepsilon _{sno} f_{sno} -where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, and -0.96 for wetland, :math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` +where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, + :math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` is the fraction of ground covered by snow (section :numref:`Snow Covered Area Fraction`). The vegetation emissivity is diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index 44bf0ac9c7..5cef68f618 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -204,12 +204,6 @@ The ice content of the top layer and the layer thickness are updated as \Delta z_{snl+1}^{n+1} =\Delta z_{snl+1}^{n} +\Delta z_{sno} . -Since wetlands are modeled as columns of water (no soil), snow is not -allowed to accumulate if the surface temperature is above freezing -(:math:`T_{g} >T_{f}` ). In this case, the incoming solid precipitation -is assigned to the runoff term :math:`q_{rgwl}` (section -:numref:`Runoff from glaciers and snow-capped surfaces`). - In the second step, after surface fluxes and snow/soil temperatures have been determined (Chapters :numref:`rst_Momentum, Sensible Heat, and Latent Heat Fluxes` and :numref:`rst_Soil and Snow Temperatures`), diff --git a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst index 10c00ae1e5..56b6adff3f 100644 --- a/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst +++ b/doc/source/tech_note/Soil_Snow_Temperatures/CLM50_Tech_Note_Soil_Snow_Temperatures.rst @@ -835,7 +835,7 @@ conductivity, :math:`K_{e,\, i}` is the Kersten number, saturation, and :math:`\lambda _{bedrock} =3` W m\ :sup:`-1` K\ :sup:`-1` is the thermal conductivity assumed for the deep ground layers (typical of saturated granitic rock; -:ref:`Clauser and Huenges 1995 `). For glaciers and wetlands, +:ref:`Clauser and Huenges 1995 `). For glaciers, .. math:: :label: 6.79 @@ -962,7 +962,7 @@ where :math:`c_{s,bedrock} =2\times 10^{6}` J m\ :sup:`-3` K\ :sup:`-1` is the heat capacity of bedrock and :math:`c_{s,om} =2.5\times 10^{6}` \ J m\ :sup:`-3` K\ :sup:`-1` (:ref:`Farouki 1981 `) is the heat capacity of organic -matter. For glaciers, wetlands, and snow +matter. For glaciers and snow .. math:: :label: 6.92 diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 55323eabf5..2770917358 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -523,14 +523,14 @@ where :math:`f_{sno}` is the fraction of the ground covered with snow (section :numref:`Snow Covered Area Fraction`). :math:`\alpha _{soi,\, \Lambda }^{\mu }` and -:math:`\alpha _{soi,\, \Lambda }` vary with glacier, lake, wetland, and +:math:`\alpha _{soi,\, \Lambda }` vary with glacier, lake, and soil surfaces. Glacier albedos are from :ref:`Paterson (1994) ` .. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.6 .. math:: \alpha _{soi,\, nir}^{\mu } =\alpha _{soi,\, nir} =0.4. -Unfrozen lake and wetland albedos depend on the cosine of the solar +Unfrozen lake albedos depend on the cosine of the solar zenith angle :math:`\mu` .. math:: @@ -538,7 +538,7 @@ zenith angle :math:`\mu` \alpha _{soi,\, \Lambda }^{\mu } =\alpha _{soi,\, \Lambda } =0.05\left(\mu +0.15\right)^{-1} . -Frozen lake and wetland albedos are from NCAR LSM (:ref:`Bonan 1996 `) +Frozen lake albedos are from NCAR LSM (:ref:`Bonan 1996 `) .. math:: \alpha _{soi,\, vis}^{\mu } =\alpha _{soi,\, vis} =0.60 diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index 493cfb2829..ebb6d3762b 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -227,7 +227,7 @@ To represent the LUH2 transient LULCC dataset in CLM5, the annual fractional composition of the twelve land units specified in the dataset needs to be faithfully represented with a corresponding PFT and CFT mosaics of CLM. CLM5 represents the land surface as a hierarchy of sub-grid types: -glacier; lake; wetland; urban; vegetated land; and crop land. The vegetated land is +glacier; lake; urban; vegetated land; and crop land. The vegetated land is further divided into a mosaic of Plant Functional Types (PFTs), while the crop land is divided into a mosaic of Crop Functional Types (CFTs). From 8fb004c2bbfc5ddc3078f47ba6bf9cb47c916157 Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Fri, 2 Feb 2018 17:06:21 +0100 Subject: [PATCH 147/730] add reference Vionnetetal 2012 --- .../tech_note/References/CLM50_Tech_Note_References.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 9e2277cdff..924e265b0a 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -2864,6 +2864,14 @@ paper presented at the Third International Conference/Workshop on Integrating GIS and Environmental Modeling, Santa Fe, New Mexico, 21–26 January, Natl. Cent. for Geogr. Inf. and Anal., Santa Barbara, Calif. +.. _Vionnetetal2012: + +|br| + +Vionnet, V., E. Brun, S. Morin, A. Boone, S. Faroux, P. Le Moigne, E. Martin, and J.-M. Willemet. +The Detailed Snowpack Scheme Crocus and Its Implementation in SURFEX v7.2. +GMD 5, no. 3 (May 24, 2012): 773-91. https://doi.org/10.5194/gmd-5-773-2012. + .. _Viovy2011: |br| From 9c0e0c5ce1976bf44c3a928fad5226d3519edf0b Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 2 Feb 2018 10:29:30 -0700 Subject: [PATCH 148/730] minor edits --- doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst | 1 + .../Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index 2bcd8f24b0..fb387d25c2 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -78,6 +78,7 @@ respectively :label: 7.3b f_{pi,\,ice} =\alpha_{sno} \ \left\{1-\exp \left[-0.5\left(L+S\right)\right]\right\} \ , + and :math:`L` and :math:`S` are the exposed leaf and stem area index, respectively (section :numref:`Phenology and vegetation burial by snow`), and the :math:`\alpha`\'s scale the fractional area of a leaf that collects water diff --git a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst index 5e09da13c5..5e368456ba 100644 --- a/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst +++ b/doc/source/tech_note/Radiative_Fluxes/CLM50_Tech_Note_Radiative_Fluxes.rst @@ -288,8 +288,8 @@ emissivity of the ground is \varepsilon _{g} =\varepsilon _{soi} \left(1-f_{sno} \right)+\varepsilon _{sno} f_{sno} -where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, - :math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` +where :math:`\varepsilon _{soi} =0.96` for soil, 0.97 for glacier, +:math:`\varepsilon _{sno} =0.97`, and :math:`f_{sno}` is the fraction of ground covered by snow (section :numref:`Snow Covered Area Fraction`). The vegetation emissivity is From 3c4d72891340a08bad4442343ddc0a8db6491fad Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Fri, 2 Feb 2018 11:24:45 -0700 Subject: [PATCH 149/730] fix snow hydrology compaction --- .../CLM50_Tech_Note_Snow_Hydrology.rst | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index 5cef68f618..d0022225b0 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -461,14 +461,13 @@ compaction: #. melting (changes in snow structure due to melt-freeze cycles plus changes in crystals due to liquid water) #. drifting snow compaction. -The total fractional compaction rate for -each snow layer :math:`C_{R,\, i}` (s\ :sup:`-1`) is the sum of the -three compaction processes +The total fractional compaction rate for each snow layer :math:`C_{R,\, i}` +(s\ :sup:`-1`) is the sum of multiple compaction processes .. math:: :label: 8.41 - C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} +C_{R4,\, i} . + C_{R,\, i} =\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} =C_{R1,\, i} +C_{R2,\, i} +C_{R3,\, i} +C_{R4,\, i} +C_{R5,\, i} . Compaction is not allowed if the layer is saturated @@ -479,10 +478,11 @@ Compaction is not allowed if the layer is saturated or if the ice content is below a minimum value (:math:`w_{ice,\, i} \le 0.1`). + The snow layer thickness after compaction is .. math:: - :label: 8.50 + :label: 8.42b \Delta z_{i}^{n+1} =\Delta z_{i}^{n} \left(1+C_{R,\, i} \Delta t\right). @@ -575,11 +575,18 @@ mass after the melting to the mass before melting .. math:: :label: 8.48 - C_{R3,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} =-\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) + C_{R3,\, i} = \left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{melt} + = -\frac{1}{\Delta t} \max \left(0,\frac{W_{sno,\, i}^{n} -W_{sno,\, i}^{n+1} }{W_{sno,\, i}^{n} } \right) and melting is identified during the phase change calculations (section -:numref:`Phase Change`). - +:numref:`Phase Change`). Because snow depth is defined as the average +depth of the snow covered area, the snow depth must also be updated for +changes in :math:`f_{sno}` when :math:`W_{sno}` has changed. + + .. math:: + :label: 8.49 + + C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) .. _Compaction by drifting snow: @@ -591,15 +598,15 @@ but high wind speeds (katabatic winds) are prevailing. Therefore a drifting snow compaction parametrization was introduced, based on (:ref:`Vionnet et al. (2012) `). .. math:: - :label: 8.49 + :label: 8.50 - C_{R4,\, i} = \left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{drift} = - \frac{\rho_{\max} - \rho_i}{\tau_{i}}. + C_{R5,\, i} = \left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{drift} = - \frac{\rho_{\max} - \rho_i}{\tau_{i}}. Here, :math:`\rho_{\max} = 350` kg m\ :sup:`-3` is the upper limit to which this process is active, and :math:`\tau_{i}` is a timescale which is depth dependent: .. math:: - :label: 8.49b + :label: 8.50b \tau_i = \frac{\tau}{\Gamma_{\mathrm{drift}}^i} \quad \mathrm{,} \:\; \Gamma^i_\mathrm{drift} = \max\left[ 0, S_\mathrm{I}^i \exp(-z_i / 0.1) \right]. @@ -610,7 +617,7 @@ The driftability index :math:`S_\mathrm{I}` reflects how well snow can be drifte as well as the 10 m wind speed: .. math:: - :label: 8.49c + :label: 8.50c \begin{array}{rcl} S_\mathrm{I} & = & -2.868 \exp(-0.085 U) + 1 + M_{\mathrm{O}} \\ @@ -621,18 +628,6 @@ The latter equation (for the mobility index :math:`M_\mathrm{O}`) is a simplific by removing the dependency on grain size and assuming spherical grains (see :ref:`van Kampenhout et al. (2017) `). -.. Because snow depth is defined as the average depth of the snow -.. covered area, the snow depth must also be updated for changes in -.. :math:`f_{sno}` . -.. -.. .. math:: -.. :label: 8.49 -.. -.. C_{R4,\, i} =\left[\frac{1}{\Delta z_{i} } \frac{\partial \Delta z_{i} }{\partial t} \right]_{fsno} =-\frac{1}{\Delta t} \max \left(0,\frac{f_{sno,\, i}^{n} -f_{sno,\, i}^{n+1} }{f_{sno,\, i}^{n} } \right) - - - - .. _Snow Layer Combination and Subdivision: Snow Layer Combination and Subdivision From 10d9daf47b4e0a53dd0df1436bcac0610750d888 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 2 Feb 2018 13:56:36 -0700 Subject: [PATCH 150/730] Fix errors and update html --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 44 +++++++++---------- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 2 +- .../References/CLM50_Tech_Note_References.rst | 17 ++++--- 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 4c3ae84448..8d44f55216 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -37,7 +37,7 @@ The implementation of the Ecosystem Demography concept within FATES links the surface flux and canopy physiology concepts in the CLM/E3SM with numerous additional developments necessary to accommodate the new model also documented here. These include a version of the SPITFIRE -(Spread and InTensity of Fire) model of :ref:`Thonicke et al. (2010)`, and an adoption of the concept of +(Spread and InTensity of Fire) model of :ref:`Thonicke et al. (2010)`, and an adoption of the concept of `Perfect Plasticity Approximation` approach of :ref:`Purves et al. 2008`, :ref:`Lichstein et al. 2011` and :ref:`Weng et al. 2014`, in accounting for the spatial arrangement of crowns. Novel algorithms accounting for @@ -1524,7 +1524,7 @@ canopy structure. This description in this section is largely repeated from the Oleson et al. CLM4.5 technical note but included here for comparison with its implementation in FATES. Photosynthesis in C3 plants is based on the model of :ref:`Farquhar 1980` as -modified by :ref:`Collatz et al. (1991)`. Photosynthetic assimilation +modified by :ref:`Collatz et al. (1991)`. Photosynthetic assimilation in C4 plants is based on the model of :ref:`Collatz et al. (1991)`. In both models, leaf photosynthesis, :math:`\textrm{gpp}` (:math:`\mu`\ mol CO\ :math:`_2` m\ :math:`^{-2}` s\ :math:`^{-1}`) is @@ -1703,7 +1703,7 @@ Variation in plant physiology with canopy depth Both :math:`V_{c,max}` and :math:`J_{max}` vary with vertical depth in the canopy on account of the well-documented reduction in canopy -nitrogen through the leaf profile, see :ref:`Bonan et al. 2012` for +nitrogen through the leaf profile, see :ref:`Bonan et al. 2012` for details). Thus, both :math:`V_{c,max}` and :math:`J_{max}` are indexed by by :math:`C_l`, :math:`ft` and :math:`z` according to the nitrogen decay coefficient :math:`K_n` and the amount of vegetation area shading @@ -2089,7 +2089,7 @@ the leaf at the vegetation temperature conductance (:math:`\mu`\ mol m\ :math:`^{-2}` s\ :math:`^{-1}`) when :math:`A` = 0 . Typical values are :math:`m_{ft}` = 9 for C\ :math:`_3` plants and :math:`m_{ft}` = 4 for C\ :math:`_4` plants ( -:ref:`Collatz et al. 1991`, :ref:`Collatz, 1992`, :ref:`Sellers et al 1996)`. +:ref:`Collatz et al. 1991`, :ref:`Collatz, 1992`, :ref:`Sellers et al 1996`). :ref:`Sellers et al. 1996` used :math:`b` = 10000 for C\ :math:`_3` plants and :math:`b` = 40000 for C\ :math:`_4` plants. Here, :math:`b` was chosen to give a maximum stomatal resistance of 20000 s @@ -3014,7 +3014,7 @@ given cohort triggers mortality. This parameter is needed to scale from individual-level mortality simulation to grid-cell average conditions. Mechanistic simulation of hydraulic failure is not undertaken on account -of it’s mechanistic complexity (see :ref:`McDowell et al. 2013`for +of it’s mechanistic complexity (see :ref:`McDowell et al. 2013` for details). Instead, we use a proxy for hydraulic failure induced mortality (:math:`M_{hf,coh}`) that uses a water potential threshold beyond mortality is triggered, such that the tolerance of low water @@ -3066,7 +3066,7 @@ Fire (SPITFIRE) [24]_The influence of fire on vegetation is estimated using the SPITFIRE model, which has been modified for use in ED following it’s original implementation in the LPJ-SPITFIRE model -(:ref:`Thonicke et al. 2010, :ref:`Pfeiffer et al. 2013`). This model as +(:ref:`Thonicke et al. 2010`, :ref:`Pfeiffer et al. 2013`). This model as described is substantially different from the existing CLM4.5 fire model :ref:`Li et al. 2012`, however, further developments are intended to increase the merging of SPITFIRE’s natural vegetation fire @@ -3096,7 +3096,7 @@ Coarse woody debris is classified into 1h, 10h, 100h, and 1000h fuels, defined by the order of magnitude of time required for fuel to lose (or gain) 63% of the difference between its current moisture content and the equilibrium moisture content under defined atmospheric conditions. -:ref:`Thonicke et al. 2010`. For the purposes of describing +:ref:`Thonicke et al. 2010`. For the purposes of describing the behaviour of fire, we introduce a new index 'fuel class' *fc*, the values of which correspond to each of the six possible fuel categories as follows. @@ -3127,7 +3127,7 @@ Nesterov Index Dead fuel moisture (:math:`\emph{moist}_{df,fc}`), and several other properties of fire behaviour, are a function of the ‘Nesterov Index’ (:math:`N_{I}`) which is an accumulation over time of a function of -temperature and humidity (Eqn 5, :ref:`Thonicke et al. 2010`). +temperature and humidity (Eqn 5, :ref:`Thonicke et al. 2010`). .. math:: N_{I}=\sum{\textrm{max}(T_{d}(T_{d}-D),0)} @@ -3174,7 +3174,7 @@ Live grass moisture Content The live grass fractional moisture content(\ :math:`\emph{moist}_{lg}`) is a function of the soil moisture content. (Equation B2 in -:ref:`Thonicke et al. 2010`) +:ref:`Thonicke et al. 2010`) .. math:: \emph{moist}_{lg}=\textrm{max}(0.0,\frac{10}{9}\theta_{30}-\frac{1}{9}) @@ -3244,7 +3244,7 @@ the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). :math:`e_{ps}` is the effective heating number (:math:`e^{\frac{-4.528}{F_{\sigma,patch}}}`). :math:`q_{ig}` is the heat of pre-ignition (:math:`581+2594F_{m}`). :math:`x_{i}` is the -propagating flux calculated as (see :ref:`Thonicke et al. 2010` +propagating flux calculated as (see :ref:`Thonicke et al. 2010` Appendix A). .. math:: @@ -3268,7 +3268,7 @@ surface-area-volume ratio :math:`F_{\sigma,patch}`: where :math:`p_{d}` is the particle density (513). :math:`i_{r}` is the reaction intensity, calculated using the following -set of expressions (from :ref:`Thonicke et al. 2010` Appendix A).: +set of expressions (from :ref:`Thonicke et al. 2010` Appendix A).: .. math:: @@ -3292,7 +3292,7 @@ Fuel Consumption The fuel consumption (fraction of biomass pools) of each dead biomass pool in the area affected by fire on a given day (:math:`f_{c,dead,fc}`) is a function of effective fuel moisture :math:`E_{moist,fc}` and size -class *fc* (Eqn B1, B4 and B5, :ref:`Thonicke et al. 2010`). The +class *fc* (Eqn B1, B4 and B5, :ref:`Thonicke et al. 2010`). The fraction of each fuel class that is consumed decreases as its moisture content relative to its moisture of extinction (:math:`E_{moist,fc}`) increases. @@ -3327,7 +3327,7 @@ Fire intensity at the front of the burning area (:math:`I_{surface}`, kW m\ :math:`^{-2}`) is a function of the total fuel consumed (:math:`f_{ctot,patch}`) and the rate of spread at the front of the fire, :math:`\mathit{ros}_{f}` (m min\ :math:`^{-1}`) (Eqn 15 -:ref:`Thonicke et al. 2010`) +:ref:`Thonicke et al. 2010`) .. math:: I_{surface}=\frac{0.001}{60}f_{energy} f_{ctot,patch}\mathit{ros}_{f} @@ -3341,7 +3341,7 @@ Fire Duration Fire duration is a function of the fire danger index with a maximum length of :math:`F_{dur,max}` (240 minutes in -:ref:`Thonicke et al. 2010` Eqn 14, derived from Canadian Forest +:ref:`Thonicke et al. 2010` Eqn 14, derived from Canadian Forest Fire Behaviour Predictions Systems) .. math:: D_{f}=\textrm{min}\Big(F_{dur,max},\frac{F_{dur,max}}{1+F_{dur,max}e^{-11.06fdi}}\Big) @@ -3370,14 +3370,14 @@ respectively). .. math:: f_{length}=F_{d}(ros_{b}+ros_{f}) :math:`ros_{b}` is a function of :math:`ros_{f}` and windspeed (Eqn 10 -:ref:`Thonicke et al. 2010`) +:ref:`Thonicke et al. 2010`) .. math:: ros_{b}=ros_{f}e^{-0.72W} The minor axis to major axis ratio :math:`l_{b}` of the ellipse is determined by the windspeed. If the windspeed (:math:`W`) is less than 16.67 ms\ :math:`^{-1}` then :math:`l_{b}=1`. Otherwise (Eqn 12 and 13, -:ref:`Thonicke et al. 2010`) +:ref:`Thonicke et al. 2010`) .. math:: l_{b}=\textrm{min}\Big(8,f_{tree}(1.0+8.729(1.0-e^{-0.108W})^{2.155})+(f_{grass}(1.1+3.6W^{0.0464}))\Big) @@ -3385,7 +3385,7 @@ determined by the windspeed. If the windspeed (:math:`W`) is less than surface covered by grass and trees respectively. The total area burned (:math:`A_{burn}` in m\ :math:`^{2}`) is therefore -(Eqn 11, :ref:`Thonicke et al. 2010`) +(Eqn 11, :ref:`Thonicke et al. 2010`) .. math:: A_{burn}=\frac{n_{f}\frac{3.1416}{4l_{b}}(f_{length}^{2}))}{10000} @@ -3397,7 +3397,7 @@ Crown Damage :math:`c_{k}` is the fraction of the crown which is consumed by the fire. This is calculated from scorch height :math:`H_{s}`, tree height :math:`h` and the crown fraction parameter :math:`F_{crown}` (Eqn 17 -:ref:`Thonicke et al. 2010`): +:ref:`Thonicke et al. 2010`): .. math:: @@ -3410,7 +3410,7 @@ fire. This is calculated from scorch height :math:`H_{s}`, tree height The scorch height :math:`H_{s}` (m) is a function of the fire intensity, following :ref:`Byram, 1959`, and is proportional to a plant functional type specific parameter :math:`\alpha_{s,ft}` (Eqn 16 -:ref:`Thonicke et al. 2010`): +:ref:`Thonicke et al. 2010`): .. math:: H_{s}=\sum_{FT=1}^{NPFT}{\alpha_{s,p}\cdot f_{biomass,ft}} I_{surface}^{0.667} @@ -3428,19 +3428,19 @@ cambial heating (minutes) (Eqn 8, :ref:`Peterson and Ryan 1986`): Bark thickness is a linear function of tree diameter :math:`dbh_{coh}`, defined by PFT-specific parameters :math:`\beta_{1,bt}` and -:math:`\beta_{2,bt}` (Eqn 21 :ref:`Thonicke et al. 2010`): +:math:`\beta_{2,bt}` (Eqn 21 :ref:`Thonicke et al. 2010`): .. math:: t_{b,coh}=\beta_{1,bt,ft}+\beta_{2,bt,ft}dbh_{coh} The critical time for cambial kill, :math:`\tau_{c}` (minutes) is given -as (Eqn 20 :ref:`Thonicke et al. 2010`): +as (Eqn 20 :ref:`Thonicke et al. 2010`): .. math:: \tau_{c}=2.9t_{b}^{2} The mortality rate caused by cambial heating :math:`\tau_{pm}` of trees within the area affected by fire is a function of the ratio between :math:`\tau_{l}` and :math:`\tau_{c}` (Eqn 19, -:ref:`Thonicke et al. 2010`): +:ref:`Thonicke et al. 2010`): .. math:: diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index e10698858b..74dc2cf6dd 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -89,7 +89,7 @@ where m=1 pertains to the fraction of the PFT that is ecotmycorrhizal, as oppose Resolving N cost across simultaneous uptake streams -------------------------------------------------------- -The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN :ref:`(Fisher et al., 2010))` utilized a scheme whereby plants only took up N from the cheapest pathway. :ref:`Brzostek et al. (2014)` introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: +The total cost of N uptake is calculated based on the assumption that carbon is partitioned to each stream in proportion to the inverse of the cost of uptake. So, more expensive pathways receive less carbon. Earlier versions of FUN :ref:`(Fisher et al., 2010)`) utilized a scheme whereby plants only took up N from the cheapest pathway. :ref:`Brzostek et al. (2014)` introduced a scheme for the simultaneous uptake from different pathways. Here we calcualate a 'conductance' to N uptake (analagous to the inverse of the cost function conceptualized as a resistance term) :math:`N_{conductance}` ( gN/gC) as: .. math:: diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 924e265b0a..35c50dc038 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -1,13 +1,12 @@ .. _rst_References: +References +============== .. |br| raw:: latex \\ -References -============== - .. _Aberetal1990: |br| @@ -680,7 +679,7 @@ Fisher, J. B., S. Sitch, Y. Malhi, R. A. Fisher, C. Huntingford, and S.-Y. Tan, Fisher, R. A., S. Muszala, M. Verteinstein, P. Lawrence, C. Xu, N. G. McDowell, R. G. Knox, C. Koven, J. Holm, B. M. Rogers, A. Spessa, D. Lawrence, and G. Bonan, 2015: Taking off the training wheels: the properties of a dynamic vegetation model without climate envelopes, CLM4.5(ED). Geosci. Model Dev., 8: 3593-3619, doi:10.5194/gmd-8-3593-2015. -.. _Fisheretal2017: +.. _Fisheretal2018: |br| @@ -1701,7 +1700,7 @@ Mary, B., Fresneau, C., Morel, J.L. and Mariotti, A., 1993. C and N cycling during decomposition of root mucilage, roots and glucose in soil. Soil Biology and Biochemistry 25:1005-1014. -.. _mcdowell2013: +.. _Mcdowelletal2013: |br| @@ -2143,6 +2142,12 @@ millennial-scale deglaciation simulations. Geophys. Res. Lett. ** Purves, D.W. et al., 2008. Predicting and understanding forest dynamics using a simple tractable model. Proceedings of the National Academy of Sciences 105.44, pp. 17018-17022. +.. _Qianetal2006: + +|br| + +Qian, T et al., 2006. Simulation of global land surface conditions from 1948 to 2004: Part I: Forcing data and evaluations. J. Hydrometeorology 7, pp. 953-975. + .. _RamankuttyFoley1998: |br| @@ -2661,7 +2666,7 @@ fire disturbance for global vegetation dynamics: coupling fire into a Dynamic Global Vegetation Model. Global Ecology and Biogeography 10:661-667. -.. _thonicke2010: +.. _thonickeetal2010: |br| From 15c1d946d2b2e291606fcba917cf729a73c69924 Mon Sep 17 00:00:00 2001 From: Leo van Kampenhout Date: Mon, 5 Feb 2018 10:33:02 +0100 Subject: [PATCH 151/730] make snow doc consistent with code overburden compaction parameter c_eta = 450 kg/m3 in the code. This should have been 358 kg/m3 but it's too late to make that change now, this is post-CESM2. This commit updates the doc to make the doc consistent with the code. also see: https://github.com/ESCOMP/ctsm/pull/250 --- .../tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst index d0022225b0..8d22a19bc9 100644 --- a/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst +++ b/doc/source/tech_note/Snow_Hydrology/CLM50_Tech_Note_Snow_Hydrology.rst @@ -554,7 +554,7 @@ temperature as with constant factors :math:`\eta _{0} = 7.62237 \times 10^{6}` kg s\ :sup:`-1` m\ :sup:`-2`, :math:`a_{\eta} = 0.1` K\ :sup:`-1`, :math:`b_{\eta} = 0.023` m\ :sup:`-3` kg\ :sup:`-1`, -and :math:`c_{\eta} = 358` kg m\ :sup:`-3` (:ref:`van Kampenhout et al. (2017) `). +and :math:`c_{\eta} = 450` kg m\ :sup:`-3` (:ref:`van Kampenhout et al. (2017) `). Further, factor :math:`f_1` accounts for the presence of liquid water (:ref:`Vionnet et al. (2012) `): .. math:: From f56195fa5cb5661b186fb69d36cbdf5b15b95cd1 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 6 Feb 2018 08:14:28 -0700 Subject: [PATCH 152/730] Edit authors and update html --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 3fc79b5e09..08bdf4ec29 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -5,7 +5,7 @@ ***Coordinating Lead Authors*** -**David Lawrence, Rosie Fisher, Charles Koven, Keith Oleson, Sean Swenson** +**David Lawrence, Rosie Fisher, Charles Koven, Keith Oleson, Sean Swenson, Mariana Vertenstein** ***Lead Authors*** @@ -14,7 +14,7 @@ ***Contributing Authors*** **Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Mariana Vertenstein, Francis Vitt, Xubin Zeng** +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the From 4b60d25e5782c2392ef591b4cec7e27d74ad464d Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 8 Feb 2018 14:23:47 -0700 Subject: [PATCH 153/730] Add disclaimer for Users Guide --- doc/source/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index f7f35abeda..517f62e8eb 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,7 +6,7 @@ Welcome to the CLM documentation ================================== -This document has two major sections. +This document has two major sections. NOTE THAT THE USER'S GUIDE CURRENTLY PROVIDES INSTRUCTIONS FOR CLM4.5 AND IS A WORK IN PROGRESS. .. toctree:: :maxdepth: 2 From 9691ce7d15e40b938227f1763d952b4a0decee37 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 26 Feb 2018 09:11:44 -0700 Subject: [PATCH 154/730] Update Transient Landcover chapter for CLM5 Much of the information there was no longer correct for CLM5, so I have rewritten much of this chapter. Also, small tweaks to the Glacier chapter. --- .../Glacier/CLM50_Tech_Note_Glacier.rst | 11 +- .../CLM50_Tech_Note_Transient_Landcover.rst | 379 +++++++++++------- 2 files changed, 240 insertions(+), 150 deletions(-) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index cb11d05c76..9f6c79ff98 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -144,9 +144,12 @@ different regions (four by default) that differ in three respects: #. Treatment of glacial melt water: a. Glacial melt water runs off and is replaced by ice, thus keeping - the column always frozen. This behavior is discussed in more - detail in section :numref:`Computation of the surface mass - balance`. + the column always frozen. In the absence of a dynamic ice sheet + model, this behavior implicitly assumes an infinite store of + glacial ice that can be melted (with appropriate adjustments made + to ensure mass and energy conservation). This behavior is + discussed in more detail in section :numref:`Computation of the + surface mass balance`. b. Glacial melt water remains in place until it refreezes - possibly remaining in place indefinitely if the glacier column is in a warm @@ -243,7 +246,7 @@ mean grid cell elevation to the *glacier\_mec* column elevation using a specified lapse rate (typically 6.0 deg/km) and an assumption of uniform relative humidity. Longwave radiation is downscaled by assuming a linear decrease in downwelling longwave radiation with increasing elevation -(0.032 W m :sup:`-2` m :sup:`-1`, limited to 0.5 - 1.5 times the +(0.032 W m\ :sup:`-2` m\ :sup:`-1`, limited to 0.5 - 1.5 times the gridcell mean value, then normalized to conserve gridcell total energy) :ref:`(Van Tricht et al., 2016)`. Total precipitation is partitioned into rain vs. snow as described in Chapter diff --git a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst index ebb6d3762b..de7ef86173 100644 --- a/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst +++ b/doc/source/tech_note/Transient_Landcover/CLM50_Tech_Note_Transient_Landcover.rst @@ -1,156 +1,243 @@ .. _rst_Transient Landcover Change: Transient Land Use and Land Cover Change -=========================================== +======================================== CLM includes a treatment of mass and energy fluxes associated with -prescribed temporal land use and land cover change (LULCC). The model uses an annual -time series of the spatial distribution of the natural and crop land units -of each grid cell, in combination with the distribution of PFTs and CFTs -that exist in those land units. Additional land use is prescribed through annual -crop specific management of nitrogen fertilizer and irrigation described further -in Chapter 25, and through wood harvest on tree PFTs. For changes in the distributions -of natural and crop vegetation CLM diagnoses the change in area of the PFTs and CFTs -on January 1st of each model year and then performs mass and energy balance accounting -necessary to represent the expansion and contraction of the PFT and CFT areas. The -biogeophysical impacts of LULCC are simulated through changes -in surface properties which in turn impact the surface albedo, hydrology, and roughness -which then impact fluxes of energy, moisture and momentum to the atmosphere under the -altered properties. Additionally changes in energy and moisture associated with changes -in the natural and crop vegetation distribution are accounted for through small -fluxes to the atmosphere. The biogeochemical impacts of LULCC -are simulated through changes in CLM carbon pools and fluxes as shown in Figure xx.x and -described further in Chapter 16. - -Annual Transient Land Use and Land Cover Data and Time Interpolation ------------------------------------------------------------------------ - -The changes in area over time associated with changes in natural and crop -vegetation and the land use on that vegetation are prescribed through a forcing dataset, -referred to here as the *landuse.timeseries* dataset. The *landuse.timeseries* dataset -consists of an annual time series of global grids, where each annual time slice describes -the fractional area occupied by all PFTs and CFTs along with the nitrogen fertilizer and -irrigation fraction of each crop CFT, and the annual wood harvest applied to tree PFTs. -Changes in area of PFTs and CFTs are performed annually on the first time step of January -1st of the year. Fertilizer application, irrigation and wood harvest for each PFT and CFT -are performed at each model time step depending on rules from the crop and natural vegetation -phenology models. The irrigation fraction is set annually however fertlizer application and -wood harvest are set from a time-interpolation of the application rates from the two bracketing -annual time slices in the *landuse.timeseries* dataset. - -As a special case, when the time dimension of the *landuse.timeseries* dataset -starts at a later year than the current model time step, the first time -slice from the *landuse.timeseries* dataset is used to represent the current time -step PFT and CFT fractional area distributions. Similarly, when the time -dimension of the *landuse.timeseries* dataset stops at an earlier year than the -current model time step, the last time slice of the *landuse.timeseries* dataset is -used. Thus, the simulation will have invariant representations of PFT and CFT -distributions through time for the periods prior to and following the -time duration of the *landuse.timeseries* dataset, with transient PFT and CFT distributions -during the period covered by the *landuse.timeseries* dataset. - -The following equations capture this logic, where :math:`year_{cur}` is -the calendar year for the current timestep, -:math:`landuse.timeseries\_ year(1)` and -:math:`landuse.timeseries\_ year(nyears)` are the first and last calendar years in -the *landuse.timeseries* dataset, respectively, :math:`nyears` is the number of -years in the *landuse.timeseries* dataset, :math:`nt_{1}` and :math:`nt_{2}` -are the two bracketing years used in the interpolation -algorithm, and :math:`n` is the index value for the -:math:`landuse.timeseries\_ year` array corresponding to -:math:`landuse.timeseries\_ year(n)=year_{cur}` : - -.. math:: - :label: 26.1) - - nt_{1} =\left\{\begin{array}{l} {1\qquad {\rm for}\qquad year_{cur} 0` and decreases for -:math:`\Delta w_{p} <0`. +prescribed temporal land use and land cover change (LULCC). The model +uses an annual time series of the spatial distribution of the natural +and crop land units of each grid cell, in combination with the +distribution of PFTs and CFTs that exist in those land units. Additional +land use is prescribed through annual crop-specific management of +nitrogen fertilizer and irrigation (described further in +:numref:`rst_Crops and Irrigation`), and through wood harvest on tree +PFTs. For changes in the distributions of natural and crop vegetation, +CLM diagnoses the change in area of the PFTs and CFTs on January 1 of +each model year and then performs mass and energy balance accounting +necessary to represent the expansion and contraction of the PFT and CFT +areas. The biogeophysical impacts of LULCC are simulated through changes +in surface properties which in turn impact the surface albedo, +hydrology, and roughness which then impact fluxes of energy, moisture +and momentum to the atmosphere under the altered +properties. Additionally, changes in energy and moisture associated with +changes in the natural and crop vegetation distribution are accounted +for through small fluxes to the river and atmosphere. The biogeochemical +impacts of LULCC are simulated through changes in CLM carbon pools and +fluxes (see also Chapter :numref:`rst_CN Pools`). + +CLM can also respond to changes in ice sheet areas and elevations when +it is coupled to an evolving ice sheet model (in the CESM context, this +is the Community Ice Sheet Model, CISM; see also Chapter +:numref:`rst_Glaciers`). Conservation of water, energy, carbon and +nitrogen is handled similarly for glacier-vegetation transitions as for +natural vegetation-crop transitions. + +.. _Transient land use and land cover data: + +Annual Transient Land Use and Land Cover Data +--------------------------------------------- + +The changes in area over time associated with changes in natural and crop vegetation and +the land use on that vegetation are prescribed through a forcing dataset, referred to here +as the *landuse.timeseries* dataset. The *landuse.timeseries* dataset consists of an +annual time series of global grids, where each annual time slice describes the fractional +area occupied by all PFTs and CFTs along with the nitrogen fertilizer and irrigation +fraction of each crop CFT, and the annual wood harvest applied to tree PFTs. Changes in +area of PFTs and CFTs are performed annually on the first time step of January 1 of the +year. Wood harvest for each PFT is also performed on the first time step of the +year. Fertilizer application and irrigation for each CFT are performed at each model time +step depending on rules from the crop model. Fertilizer application rates are set +annually. The irrigation fraction is also set annually; irrigated crops are placed on +separate columns from their unirrigated counterparts, so changes in irrigated fraction +triggers the changes in subgrid areas discussed below (sections :numref:`Transient +landcover reconciling changes in area` and :numref:`Transient landcover mass and energy +conservation`). + +As a special case, when the time dimension of the *landuse.timeseries* dataset starts at a +later year than the current model time step, the first time slice from the +*landuse.timeseries* dataset is used to represent the current time step PFT and CFT +fractional area distributions. Similarly, when the time dimension of the +*landuse.timeseries* dataset stops at an earlier year than the current model time step, +the last time slice of the *landuse.timeseries* dataset is used. Thus, the simulation will +have invariant representations of PFT and CFT distributions through time for the periods +prior to and following the time duration of the *landuse.timeseries* dataset, with +transient PFT and CFT distributions during the period covered by the *landuse.timeseries* +dataset. + +.. _Transient landcover reconciling changes in area: + +Reconciling Changes in Area +--------------------------- + +In the first time step of January 1, changes in land unit weights can +potentially come from two sources: Changes in the area of the crop land +unit come from the *landuse.timeseries* dataset (section +:numref:`Transient land use and land cover data`), and changes in the +area of the glacier land unit come from the ice sheet model. The areas +of other land units are then adjusted so that the total land unit area +remains 100%. + +If the total land unit area of glaciers and crops has decreased, then +the natural vegetated landunit is increased to fill in the abandoned +land. If the total land unit area of glaciers and crops has increased, +then other land unit areas are decreased in a specified order until the +total is once again 100%. The order of decrease is: natural vegetation, +crop, urban medium density, urban high density, urban tall building +district, wetland, lake. + +These rules have two important implications: + +1. We always match CISM's glacier areas exactly, even if that means a + disagreement with prescribed crop areas. This is needed for + conservation when CISM is evolving in two-way-coupled mode. + +2. For land units other than crop, glacier and natural vegetation, their + areas can decrease (due to encroaching crops or glaciers), but can + never increase. So, for example, if a grid cell starts as 5% lake, + crops expand to fill the entire grid cell, then later crop area + decreases, the lake area will not return: instead, the abandoned + cropland will become entirely natural vegetation. + +For all levels of the subgrid hierarchy (land unit, column and patch), +we only track net changes in area, not gross transitions. So, for +example, if part of a gridcell experiences an increase in glacier area +while another part of that gridcell experiences an equal decrease in +glacier area (in the same glacier elevation class), CLM acts as if there +were no changes. As another example, consider a gridcell containing +natural vegetation, crop and glacier. If there is a decrease in glacier +area and an equal increase in crop area, CLM will assume that the crop +expands into the old glacier area, and nothing happened to the natural +vegetation area. A more realistic alternative would be that the crop +expanded into natural vegetation, and natural vegetation expanded into +glacier. The final areas will be correct in these cases, but the +adjustments of carbon and nitrogen states (section :numref:`Transient +landcover carbon and nitrogen conservation`) will be less accurate than what +would be obtained with a full tracking of gross transitions. + +.. _Transient landcover mass and energy conservation: Mass and Energy Conservation ---------------------------------- - -Mass conservation is maintained across PFT and CFT weight transitions by -summing up all the carbon, nitrogen, water and energy state variables to get the total vegetated land -units value before (:math:`W_{tot,1}` ) and after -(:math:`W_{tot,2}` ) the new PFT and CFT weights are calculated. Transitions are performed on above ground -variables first and then at the land unit level for below ground variables second. For example the hydrological -balance is calculated, -:math:`W_{tot,1}` is - -.. math:: - :label: 26.6) - - W_{tot,1} =W_{a} +W_{sno} +\sum _{i=1}^{N_{levgrnd} }\left(w_{liq,i} +w_{ice,i} \right) +\sum _{j=1}^{npft}\left(W_{can,j} wt_{j,1} \right) - -where :math:`W_{a}` is the aquifer water, :math:`W_{sno}` is the snow -water, :math:`w_{liq,i}` and :math:`w_{ice,i}` are the liquid and ice -soil water contents, :math:`W_{can,j}` is the canopy water content for -PFT and CFT :math:`j`, and :math:`wt_{j,1}` is the PFT or CFT weight for -:math:`j`. For the situation where PFT and CFT weights are changing, any difference -between :math:`W_{tot,1}` and :math:`W_{tot,2}` are due to -differences in the total canopy water before and after the PFT and CFT weight -change. To ensure conservation, the typically very small -difference between :math:`W_{tot,2}` and :math:`W_{tot,1}` is -subtracted from the grid cell runoff - -.. math:: - :label: 26.7) - - R_{liq} =R_{liq} +W_{tot,2} -W_{tot,1} . - -Total energy is unperturbed in this case and therefore an energy -conservation treatment is not required. Changing the area of natural and crop land units -in association with the change in PFTs and CFTs results in changes in the soil/snow columns -and land unit area. To address these additional changes, conservation of mass and -energy among the soil/snow columns and land units is performed as a secondary calculation once -all above ground PFT and CFT changes have been done. +---------------------------- + +.. _Transient landcover water and energy conservation: + +Water and Energy Conservation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When subgrid areas change, the water and energy states remain unchanged +on a per-area basis. This can lead to changes in the total gridcell +water and energy content. + +For example, consider a gridcell with two columns: column 1 has a water +mass of 1 kg m\ :sup:`-2` and column 2 has a water mass of 2 kg m\ +:sup:`-2` for a given water state variable, where these are expressed +per unit column area. If column 1 increases in area at the expense of +column 2, then column 1 will still have a water mass of 1 kg m\ +:sup:`-2`, but now expressed over the new column area. This results in a +decrease in the total gridcell water content. + +Water and energy are conserved by summing up the total water and energy +content of each gridcell before and after a change in area. Differences +in liquid and ice water content are balanced by liquid and ice runoff +terms, which can be either positive or negative. (Negative runoff is +effectively a withdrawal of water from the ocean.) Differences in energy +content are balanced by a sensible heat flux term, which again can be +either positive or negative. These balancing fluxes are spread evenly +throughout the following year. + +There is a special case when a given crop column type newly comes into +existence - for example, when temperate corn first comes into existence +in a gridcell. In this case, the column's below-ground temperature and +water states are copied from the natural vegetated column in its +gridcell, so that these state variables begin in a close-to-spun-up +state. Other state variables (most of which spin up relatively quickly) +begin at their cold start initialization values. This initialization is +not necessary for the two other land unit types that currently can +grow - natural vegetation and glacier: Those land unit types are always +active, even when they have zero area on the gridcell, so their state +variables will be spun up immediately when they come into +existence. After this initialization, the conservation code described +above takes effect. + +.. _Transient landcover carbon and nitrogen conservation: + +Carbon and Nitrogen Conservation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Because of the long timescales involved with below-ground carbon and +nitrogen dynamics, it is more important that these state variables be +adjusted properly when subgrid areas change. Carbon and nitrogen +variables are adjusted with the following three-step process: + +(1) Patch-level (i.e., vegetation) state variables are adjusted for any + changes in patch areas; this may lead to fluxes into column-level + (i.e., soil) state variables + +(2) Column-level (i.e., soil) state variables are updated based on the + fluxes generated in (1) + +(3) Column-level (i.e., soil) state variables are adjusted for any + changes in column areas + +First, patch-level (i.e., vegetation) state variables are adjusted for +any changes in patch areas. This includes changes in column or land unit +areas, even if the relative proportions of each patch remain constant: +the relevant quantities are the patch weights relative to the +gridcell. + +For a patch that decreases in area, the carbon and nitrogen density on +the remaining patch area remains the same as before (i.e., expressed as +g per m\ :sup:`2` patch area). Because the area has decreased, this +represents a decrease in total carbon or nitrogen mass (i.e., expressed +as g per m\ :sup:`2` gridcell area). The lost mass meets a variety of +fates: some is immediately lost to the atmosphere, some is sent to +product pools (which are lost to the atmosphere over longer time +scales), and some is sent to litter pools. + +For a patch that increases in area, the carbon and nitrogen density on +the new patch area is decreased in order to conserve mass. This decrease +is basically proportional to the relative increase in patch +area. However, a small amount of seed carbon and nitrogen is added to +the leaf and dead stem pools in the new patch area. + +Next, column-level (i.e., soil) state variables are updated based on any +fluxes to soil pools due to decreases in patch areas. This step is +needed so that any lost vegetation carbon and nitrogen is conserved when +column areas are changing. + +Finally, column-level state variables are adjusted for any changes in +column areas. Similarly to patches, for a column that decreases in area, +the carbon and nitrogen density on the remaining column area remains the +same as before (i.e., expressed as g per m\ :sup:`2` column area). This +represents a decrease in total carbon or nitrogen mass on the gridcell, +and this lost mass is tracked for each gridcell. After these mass losses +are summed for all shrinking columns, they are distributed amongst the +growing columns in order to conserve mass. Thus, a growing column's new +carbon density will be a weighted sum of its original carbon density and +the carbon densities of all shrinking columns in its gridcell. + +This operation makes some simplifying assumptions. First, as described +in section :numref:`Transient landcover reconciling changes in area`, we +only track net area changes, not gross changes. Second, we assume that +growing columns all grow proportionally into each of the shrinking +columns. + +Non-vegetated land units (e.g., glacier) do not typically track soil +carbon and nitrogen. When columns from these land units initially +shrink, they are assumed to contribute zero carbon and +nitrogen. However, when they grow into previously-vegetated areas, they +store any pre-existing soil carbon and nitrogen from the shrinking +columns. This stored carbon and nitrogen will remain unchanged until the +column later shrinks, at which point it will contribute to the carbon +and nitrogen in the growing columns (exactly as would happen for a +vegetated column). + +In contrast to water and energy (section :numref:`Transient landcover +water and energy conservation`), no special treatment is needed for +carbon and nitrogen states in columns that newly come into +existence. The state of a new column is derived from a weighted average +of the states of shrinking columns. This behavior falls out from the +above general rules. Annual Transient Land Cover Dataset Development ---------------------------------------------------- From 48c80453b445172de984e5b0eeffa7f08be935dc Mon Sep 17 00:00:00 2001 From: Sean Swenson Date: Wed, 28 Feb 2018 12:14:34 -0700 Subject: [PATCH 155/730] add bedrock reference --- doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst index 86b3bbb5a9..d90c8cab40 100644 --- a/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst +++ b/doc/source/tech_note/Ecosystem/CLM50_Tech_Note_Ecosystem.rst @@ -345,7 +345,9 @@ The hydrologically and biogeochemically active portion of the soil column can be restricted to a thickness less than that of the maximum soil depth. By providing a depth-to-bedrock dataset, which may vary spatially, the number of layers used in the hydrologic and biogeochemical calculations, :math:`N_{bedrock}`, may be -specified, subject to the constraint :math:`N_{bedrock} \le N_{levsoi}` +specified, subject to the constraint :math:`N_{bedrock} \le N_{levsoi}`. +The default depth-to-bedrock values are from +:ref:`Pelletier et al. [2016]`. .. _Model Input Requirements: From 21361da3d5c99e2c1f70b16da0415c8a6e3b9db0 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Wed, 28 Feb 2018 14:46:10 -0700 Subject: [PATCH 156/730] Modifications to photosynthesis tech note to remove 'ask rosie' references --- .../CLM50_Tech_Note_Photosynthesis.rst | 91 ++++++------------- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 2 +- 2 files changed, 29 insertions(+), 64 deletions(-) diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 258fa3f182..84136f7868 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -14,7 +14,7 @@ CLM5 includes the following new changes to photosynthesis and stomatal conductan - Default stomatal conductance calculation uses the Medlyn conductance model -- :math:`J_{max}` is predicted by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) +- :math:`V_{c,max}` and :math:`J_{max}` at 25 :sup:`\o`\ C: are now prognostic, and predicted via optimality by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) - Leaf N concentration and the fraction of leaf N in Rubisco used to calculate :math:`V_{cmax25}` are determined by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) @@ -255,20 +255,21 @@ depend on temperature. Values at 25 :sup:`o` \ C are :math:`K_{o25} =278.4\times 10^{-3} P_{atm}`, and :math:`\Gamma _{25} {\rm =42}.75\times 10^{-6} P_{atm}`. :math:`V_{c\max }`, :math:`J_{\max }`, :math:`T_{p}`, :math:`k_{p}`, -and :math:`R_{d}` also vary with temperature. Parameter values at 25 -[verify with Rosie that LUNA doesn't do this otherwise] -:sup:`o`\ C are calculated from :math:`V_{c\max }` \ at 25 -:sup:`\o`\ C: :math:`J_{\max 25} =1.97V_{c\max 25}`, +and :math:`R_{d}` also vary with temperature. + +:math:`J_{\max 25}` at 25 :sup:`\o`\ C: is calculated by the LUNA model (Chapter :numref:`rst_Photosynthetic Capacity`) + +Parameter values at 25 :sup:`\o`\ C are calculated from :math:`V_{c\max }` \ at 25 +:sup:`\o`\ C:, including: :math:`T_{p25} =0.167V_{c\max 25}`, and :math:`R_{d25} =0.015V_{c\max 25}` (C\ :sub:`3`) and -:math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). For -C\ :sub:`4` plants, :math:`k_{p25} =20000\; V_{c\max 25}`. -However, when the biogeochemistry is active, :math:`R_{d25}` is -calculated from leaf nitrogen as :math:`R_{d25} = 0.2577LNC_{a}`, -where :math:`LNC_{a}` is the area-based leaf nitrogen concentration -(g N m\ :sup:`-2` leaf area, Chapter :numref:`rst_Photosynthetic Capacity`), -and 0.2577 :math:`\mu`\ mol CO\ :sub:`2` g\ :sup:`-1` N s\ :sup:`-1` is the base respiration rate. -[this doesn't look correct based on the code, which lists two options; verify with Rosie] +:math:`R_{d25} =0.025V_{c\max 25}` (C\ :sub:`4`). + +For C\ :sub:`4` plants, :math:`k_{p25} =20000\; V_{c\max 25}`. + +However, when the biogeochemistry is active (the default mode), :math:`R_{d25}` is +calculated from leaf nitrogen as described in (Chapter :numref:`rst_Plant Respiration`) + The parameters :math:`V_{c\max 25}`, :math:`J_{\max 25}`, :math:`T_{p25}`, :math:`k_{p25}`, and :math:`R_{d25}` are scaled over the canopy for sunlit and shaded leaves @@ -280,8 +281,6 @@ The parameters :math:`V_{c\max 25}`, \begin{array}{rcl} {V_{c\max } } & {=} & {V_{c\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {J_{\max } } & {=} & {J_{\max 25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {T_{p} } & {=} & {T_{p25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {R_{d} } & {=} & {R_{d25} \; f\left(T_{v} \right)f_{H} \left(T_{v} \right)} \\ {K_{c} } & {=} & {K_{c25} \; f\left(T_{v} \right)} \\ {K_{o} } & {=} & {K_{o25} \; f\left(T_{v} \right)} \\ {\Gamma } & {=} & {\Gamma _{25} \; f\left(T_{v} \right)} \end{array} -[check with Rosie about Rd equation above and below (eq. 14)] with - .. math:: :label: 9.11 @@ -384,64 +383,30 @@ range :math:`T_{10} -T_{f} \ge 11`\ :sup:`o`\ C and :math:`T_{10} -T_{f} \le 35` Canopy scaling -------------------------------------------- -:math:`V_{c\max 25}` is calculated separately for sunlit and shaded -leaves using an exponential profile to area-based leaf nitrogen -(:math:`LNC_{a}`, see Chapter :numref:`rst_Photosynthetic Capacity` ), -as in :ref:`Bonan et al. (2011)`. :math:`V_{c\max 25}` at -cumulative leaf area index :math:`x` from the canopy top scales directly -with :math:`LNC_{a}` , which decreases exponentially with greater -cumulative leaf area, so that [Verify with Rosie- different based on Vcmax option 0, 3, & 4] - -.. math:: - :label: 9.18 - - V_{c\; \max 25}^{} \left(x\right)=V_{c\; \max 25}^{} \left(0\right)e^{-K_{n} x} - -where :math:`V_{c\; \max 25}^{} \left(0\right)` is defined at the top of -the canopy using :math:`SLA_{0}`, which is the specific leaf area at -the canopy top and :math:`K_{n}` is the decay -coefficient for nitrogen. The canopy integrated value for sunlit and -shaded leaves is - -.. math:: - :label: 9.20 +When LUNA is on, the :math:`V_{c\max 25}` for sun leaves is scaled to the shaded leaves +:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}`, and +:math:`R_{d25}` scale similarly. - \begin{array}{rcl} {V_{c\; \max 25}^{sun} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)f_{sun} \left(x\right)\, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} } \end{array} .. math:: - :label: 9.21 - - \begin{array}{rcl} {V_{c\; \max 25}^{sha} } & {=} & {\int _{0}^{L}V_{c\; \max 25}^{} \left(x\right)\left[1-f_{sun} \left(x\right)\right] \, dx} \\ {} & {=} & {V_{c\; \max 25}^{} \left(0\right)\left\{\left[1-e^{-K_{n} L} \right]\frac{1}{K_{n} } -\left[1-e^{-\left(K_{n} +K\right)L} \right]\frac{1}{K_{n} +K} \right\}} \end{array} + :label: 9.18 -and the average value for the sunlit and shaded leaves is + \begin{array}{rcl} + {V_{c\max 25 sha}} & {=} & {V_{c\max 25 sha} \frac{i_{v,sha}}{i_{v,sun}}} \\ + {J_{\max 25 sha}} & {=} & {J_{\max 25 sun} \frac{i_{v,sha}}{i_{v,sun}}} \\ + {T_{p sha}} & {=} & {T_{p sun} \frac{i_{v,sha}}{i_{v,sun}}} \end{array} -.. math:: - :label: 9.22 - - \bar{V}_{c\; \max 25}^{sun} ={V_{c\; \max 25}^{sun} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sun} L^{sun} }} \right. \kern-\nulldelimiterspace} L^{sun} } +Where :math:`i_{v,sun}` and :math:`i_{v,sha}` are the leaf-to-canopy scaling coefficients of the twostream radiation model, calculated as .. math:: - :label: 9.23 - - \bar{V}_{c\; \max 25}^{sha} ={V_{c\; \max 25}^{sha} \mathord{\left/ {\vphantom {V_{c\; \max 25}^{sha} L^{sha} }} \right. \kern-\nulldelimiterspace} L^{sha} } . + :label: 9.19 -This integration is over all leaf area (:math:`L`) with -:math:`f_{sun} (x)=\exp \left(-Kx\right)` and :math:`K` the direct beam -extinction coefficient (equation :eq:`4.8` in chapter :numref:`rst_Radiative Fluxes`). Photosynthetic parameters -:math:`J_{\max 25}` , :math:`T_{p25}` , :math:`k_{p25}`, and -:math:`R_{d25}` scale similarly. + i_{v,sun} = \frac{(1 - e^{-(k_{n,ext}+k_{b,ext})*lai_e)} / (k_{n,ext}+k_{b,ext})}{f_{sun}*lai_e}\\ + i_{v,sha} = \frac{(1 - e^{-(k_{n,ext}+k_{b,ext})*lai_e)} / (k_{n,ext}+k_{b,ext})}{(1 - f_{sun})*lai_e} -The model uses :math:`K_{n} =0.30` to match an explicit multi-layer canopy, as in -:ref:`Bonan et al. (2012)`. -The value :math:`K_{n} = 0.11` chosen by :ref:`Bonan et al. (2011)` is -consistent with observationally-derived estimates for forests, mostly -tropical, and provides a gradient in V\ :sub:`cmax` similar to -the original CLM4 specific leaf area scaling. However, -:ref:`Bonan et al. (2012)` showed that the sunlit/shaded canopy parameterization does not -match an explicit multi-layer canopy parameterization. The discrepancy -arises from absorption of scattered radiation by shaded leaves and can -be tuned out with higher :math:`K_{n}`. +k_{n,ext} is the extinction coefficient for N through the canopy (0.3). k_{b,ext} is the direct beam extinction coefficient calculated in the surface albedo routine, and :math:`f_{sun}` is the fraction of sunlit leaves, both derived from Chapter :numref:`rst_Surface Albedos`. +When LUNA is off, scaling defaults to the mechanism used in CLM4.5. .. _Numerical implementation photosynthesis: diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index c47ce0e624..4c3e857ade 100755 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -142,7 +142,7 @@ Following Bauerle et al. (2012), :math:`f\left(\text{day length} \right)` is sim f\left(\text{day length} \right) = \left(\frac{\text{day length}}{12} \right)^{2}. -:math:`f\left(\text{humidity} \right)` represents the impact of air humitidy on +:math:`f\left(\text{humidity} \right)` represents the impact of air humidity on :math:`J_{\text{{max}}}`. We assume that higher humidity leads to higher :math:`J_{\text{{max}}}` with less water limiation on stomta opening and that low relative humidity has a stronger impact on nitrogen allocation due to greater From b7cc3082250b578ac12784554790fb64427757c4 Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Wed, 28 Feb 2018 15:15:35 -0700 Subject: [PATCH 157/730] Modifications to FATES fire documentation --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 8d44f55216..01442e5eb9 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -974,7 +974,7 @@ thus \delta_{vai} \cdot f_{leaf,coh} \frac{A_{canopy,coh}}{A_{canopy,patch}}\cdot r_{vai}& \textrm{for $i=n_{z,coh}$}\\ \end{array} \right. - and the stem area index is +and the stem area index is .. math:: @@ -3127,7 +3127,7 @@ Nesterov Index Dead fuel moisture (:math:`\emph{moist}_{df,fc}`), and several other properties of fire behaviour, are a function of the ‘Nesterov Index’ (:math:`N_{I}`) which is an accumulation over time of a function of -temperature and humidity (Eqn 5, :ref:`Thonicke et al. 2010`). +temperature and humidity (Eqn 5, :ref:`Thonicke et al. 2010`), .. math:: N_{I}=\sum{\textrm{max}(T_{d}(T_{d}-D),0)} @@ -3142,6 +3142,7 @@ where :math:`T_{d}` is the daily mean temperature in :math:`^{o}`\ C and where :math:`RH` is the relative humidity (%). +On days when the total precipitation exceeds 3.0mm, the Nesterov index accumulator is reset back to zero. Fuel properties --------------- @@ -3239,7 +3240,7 @@ Forward rate of spread For each patch and each day, we calculate the rate of forward spread of the fire *ros*\ :math:`_{f}` (nominally in the direction of the wind). -.. math:: \emph{ros}_{f}=\frac{i_{r}x_{i}(1-\phi_{w})}{F_{bd,patch}e_{ps}q_{ig}} +.. math:: \emph{ros}_{f}=\frac{i_{r}x_{i}(1+\phi_{w})}{F_{bd,patch}e_{ps}q_{ig}} :math:`e_{ps}` is the effective heating number (:math:`e^{\frac{-4.528}{F_{\sigma,patch}}}`). :math:`q_{ig}` is the @@ -3249,10 +3250,7 @@ Appendix A). .. math:: - x_{i}= \left\{ \begin{array}{ll} - 0.0& \textrm{for $F_{\sigma,patch}<0.00001$}\\ - \frac{e^{0.792+3.7597F_{\sigma,patch}^{0.5}(\frac{F_{bd,patch}}{p_{d}}+0.1)}}{192+7.9095F_{\sigma,patch}} & \textrm{for $F_{\sigma,patch}\geq 0.00001$}\\ - \end{array} \right. + x_{i}= \frac{e^{0.792+3.7597F_{\sigma,patch}^{0.5}(\frac{F_{bd,patch}}{p_{d}}+0.1)}}{192+7.9095F_{\sigma,patch}} :math:`\phi_{w}` is the influence of windspeed on rate of spread. @@ -3331,9 +3329,9 @@ fire, :math:`\mathit{ros}_{f}` (m min\ :math:`^{-1}`) (Eqn 15 .. math:: I_{surface}=\frac{0.001}{60}f_{energy} f_{ctot,patch}\mathit{ros}_{f} -where :math:`f_{energy}` is the energy content of fuel (kJ/kG - the -same for alll fuel classes). Fire intensity is used to define whether an -ignition is successful. If the fire intensity is greater than 50kw/m +where :math:`f_{energy}` is the energy content of fuel (Kj/Kg - the +same, 18000 Kj/Kg for all fuel classes). Fire intensity is used to define whether an +ignition is successful. If the fire intensity is greater than 50Kw/m then the ignition is successful. Fire Duration @@ -3372,7 +3370,7 @@ respectively). :math:`ros_{b}` is a function of :math:`ros_{f}` and windspeed (Eqn 10 :ref:`Thonicke et al. 2010`) -.. math:: ros_{b}=ros_{f}e^{-0.72W} +.. math:: ros_{b}=ros_{f}e^{-0.012W} The minor axis to major axis ratio :math:`l_{b}` of the ellipse is determined by the windspeed. If the windspeed (:math:`W`) is less than From 025d7de236febfbb47d2fcbe5b6477ab68dd969d Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Mon, 5 Mar 2018 16:23:39 -0700 Subject: [PATCH 158/730] modified error notices in FUN tech note --- .../tech_note/DGVM/CLM50_Tech_Note_DGVM.rst | 144 +++--------------- .../tech_note/FUN/CLM50_Tech_Note_FUN.rst | 8 +- .../CLM50_Tech_Note_Plant_Respiration.rst | 11 +- .../References/CLM50_Tech_Note_References.rst | 13 ++ 4 files changed, 49 insertions(+), 127 deletions(-) diff --git a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst index 01442e5eb9..eb6d3370d9 100644 --- a/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst +++ b/doc/source/tech_note/DGVM/CLM50_Tech_Note_DGVM.rst @@ -223,7 +223,7 @@ individual-based approach). A signature feature of the ED model is the system by which `functionally equivalent` patches and cohorts are fused into single model entities to save memory and computational time. -[1]_ This functionality requires that criteria are established for the +This functionality requires that criteria are established for the meaning of `functional equivalence`, which are by necessity slightly subjective, as they represent ways of abstracting reality into a more tractable mathematical representation. As an example of this, for @@ -242,7 +242,7 @@ adjust the trade-off between simulation accuracy and computational load. There is no theoretical optimal value for this threshold but it may be altered to have finer or coarser model resolutions as needed. -[2]_ Similarly, for common-disturbance-history patches, we again assign +Similarly, for common-disturbance-history patches, we again assign a threshold criteria, which is then compared to the difference between patches :math:`m` and :math:`n`, and if the difference is less than some threshold value (:math:`t_{p}`) then patches are merged together, @@ -287,7 +287,7 @@ similar patches reach their fusion threshold. This approach maintains an even discretization along the biomass gradient, in contrast to, for example, simply fusing the oldest or youngest patches together. -[3]_ The area of the new patch (:math:`A_{patch,o}`, m\ :math:`^{2}`) +The area of the new patch (:math:`A_{patch,o}`, m\ :math:`^{2}`) is the sum of the area of the two existing patches, .. math:: A_{patch,o} = A_{patch,n} + A_{patch,m} @@ -300,7 +300,7 @@ with mass conservation . Linked Lists: the general code structure of FATES --------------------------------------------------- -[4]_ The number of patches in each natural vegetation column and the +The number of patches in each natural vegetation column and the number of cohorts in any given patch are variable through time because they are re-calculated for each daily timestep of the model. The more complex an ecosystem, the larger the number of patches and cohorts. For @@ -513,7 +513,7 @@ and passed into the ED code as the major driver of vegetation dynamics. Initialization of vegetation from bare ground ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -[5]_If the model is restarted from a bare ground state (as opposed to a +If the model is restarted from a bare ground state (as opposed to a pre-existing vegetation state), the state variables above are initialized as follows. First, the number of plants per PFT is allocated according to the initial seeding density (:math:`S_{init}`, individuals @@ -584,7 +584,7 @@ biomass, assigned per PFT Allocation of biomass ^^^^^^^^^^^^^^^^^^^^^ -[6]_Total live biomass :math:`b_{alive}` is the state variable of the model +Total live biomass :math:`b_{alive}` is the state variable of the model that describes the sum of the three live biomass pools leaf :math:`b_{leaf}`, root :math:`b_{root}` and sapwood :math:`b_{sw}` (all in kGC individual\ :math:`^{-1}`). The quantities are constrained by the @@ -693,7 +693,7 @@ To calculated the sapwood biomass, we use Canopy Structure and the Perfect Plasticity Approximation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -[7]_During initialization and every subsequent daily ED timestep, the canopy +During initialization and every subsequent daily ED timestep, the canopy structure model is called to determine how the leaf area of the different cohorts is arranged relative to the incoming radiation, which will then be used to drive the radiation and photosynthesis @@ -824,7 +824,7 @@ found in the code references in the footnote. Horizontal Canopy Spread ------------------------- -[8]_:ref:`Purves et al. 2008` estimated the ratio between canopy and +:ref:`Purves et al. 2008` estimated the ratio between canopy and stem diameter :math:`c_{p}` as 0.1 m cm\ :math:`^{-1}` for canopy trees in North American forests, but this estimate was made on trees in closed canopies, whose shape is subject to space competition from other @@ -885,7 +885,7 @@ However, the model is relatively insensitive to the choice of either Definition of Leaf and Stem Area Profile ---------------------------------------- -[9]_Within each patch, the model defines and tracks cohorts of multiple +Within each patch, the model defines and tracks cohorts of multiple plant functional types that exist either in the canopy or understorey. Light on the top leaf surface of each cohort in the canopy is the same, and the rate of decay through the canopy is also the same for each PFT. @@ -932,7 +932,7 @@ is complex and not particularly amenable to the use of, for example, assumptions of random distribution in space that are typically used to calculate leaf area from light interception. :ref:`Kucharik et al. 1998` estimated that SAI visible from an -LAI2000 sensor was around 0.5 m^2 m^-2. :ref:`Low et al. 2001` +LAI2000 sensor was around 0.5 m^2 m^-2. Low et al. 2001 estimate that the wood area index for Ponderosa Pine forest is 0.27-0.33. The existing CLM(CN) algorithm sets the minimum SAI at 0.25 to match MODIS observations, but then allows SAI to rise as a function @@ -1127,7 +1127,7 @@ Radiation Transfer Fundamental Radiation Transfer Theory ------------------------------------- -[10]_The first interaction of the land surface with the properties of +The first interaction of the land surface with the properties of vegetation concerns the partitioning of energy into that which is absorbed by vegetation, reflected back into the atmosphere, and absorbed by the ground surface. Older versions of the CLM have utilized a @@ -1518,7 +1518,7 @@ Photosynthesis Fundamental photosynthetic physiology theory -------------------------------------------- -[11]_In this section we describe the physiological basis of the +In this section we describe the physiological basis of the photosynthesis model before describing its application to the FATES canopy structure. This description in this section is largely repeated from the Oleson et al. CLM4.5 technical note but included here for @@ -1762,7 +1762,7 @@ m\ :math:`^{-2}` s\ :math:`^{-1}`. Water Stress on gas exchange ---------------------------- -[12]_ The top of canopy leaf photosynthetic capacity, :math:`V_{c,max0}`, is +The top of canopy leaf photosynthetic capacity, :math:`V_{c,max0}`, is also adjusted for the availability of water to plants as .. math:: V_{c,max0,25} = V_{c,max0,25} \beta_{sw}, @@ -1918,7 +1918,7 @@ timestep to give KgC cohort\ :math:`^{-1}` day\ :math:`^{-1}` Plant respiration ^^^^^^^^^^^^^^^^^^ -[13]_Plant respiration per individual :math:`R_{plant,coh}` (KgC individual +Plant respiration per individual :math:`R_{plant,coh}` (KgC individual :math:`^{-1}` s\ :math:`^{-1}`) is the sum of two terms, growth and maintenance respiration :math:`R_{g,coh}` and :math:`R_{m,coh}` @@ -2057,7 +2057,7 @@ Stomatal Conductance Fundamental stomatal conductance theory --------------------------------------- -[14]_Stomatal conductance is unchanged in concept from the CLM4.5 approach. +Stomatal conductance is unchanged in concept from the CLM4.5 approach. Leaf stomatal resistance is calculated from the Ball-Berry conductance model as described by :ref:`Collatz et al. (1991)` and implemented in a global climate model by :ref:`Sellers et al. 1996`. The model @@ -2142,7 +2142,7 @@ cohort. Allocation and Growth ^^^^^^^^^^^^^^^^^^^^^ -[15]_Total assimilation carbon enters the ED model each day as a +Total assimilation carbon enters the ED model each day as a cohort-specific Net Primary Productivity :math:`\mathit{NPP}_{coh}`, which is calculated as @@ -2296,7 +2296,7 @@ KgC individual :math:`^{-1}` y\ :math:`^{-1}`) is thus Allocation to growing pools --------------------------- -[16]_ The carbon is then partitioned into carbon available to grow the +The carbon is then partitioned into carbon available to grow the :math:`b_{alive}` and :math:`b_{struc}` pools. A fraction :math:`v_{a}` is available to live biomass pools, and a fraction :math:`v_{s}` is available to structural pools. @@ -2449,7 +2449,7 @@ In this case, :math:`\delta t` is set to be one day Control of Leaf Area Index ^^^^^^^^^^^^^^^^^^^^^^^^^^ -[17]_The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is +The leaf area :math:`A_{leaf}` (m:math:`^{-2}`) of each cohort is calculated from leaf biomass :math:`b_{leaf,coh}` (kgC individual\ :math:`^{-1}`) and specific leaf area (SLA, m\ :math:`^2` kg C\ :math:`^{-1}`) @@ -2548,7 +2548,7 @@ Cold Deciduous Phenology Cold Leaf-out timing ~~~~~~~~~~~~~~~~~~~~ -[18]_. The phenology model of :ref:`Botta et al. 2000` is used in +The phenology model of :ref:`Botta et al. 2000` is used in FATES to determine the leaf-on timing. The Botta et al. model was verified against satellite data and is one of the only globally verified and published models of leaf-out phenology. This model differs from the @@ -2639,7 +2639,7 @@ the science tag is released. Carbon Dynamics of deciduous plants ----------------------------------- -[19]_In the present version, leaf expansion and senescence happen over the +In the present version, leaf expansion and senescence happen over the course of a single day. This is clearly not an empirically robust representation of leaf behaviour, whereby leaf expansion occurs over a period of 10-14 days, and senescence over a similar period. This will be @@ -2718,7 +2718,7 @@ Seed Dynamics and Recruitment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -[20]_The production of seeds and their subsequent germination is a process +The production of seeds and their subsequent germination is a process that must be captured explicitly or implicitly in vegetation models. FATES contains a seed bank model designed to allow the dynamics of seed production and germination to be simulated independently. In the ED1.0 model, seed recruitment occurs in the same timestep as allocation @@ -2841,7 +2841,7 @@ year\ :math:`^{-1}`, are calculated as Litter Inputs ------------- -[21]_Inputs into the litter pools come from tissue turnover, mortality of +Inputs into the litter pools come from tissue turnover, mortality of canopy trees, mortality of understorey trees, mortality of seeds, and leaf senescence of deciduous plants. @@ -2870,7 +2870,7 @@ assigned to each (:math:`f_{lsc}` and :math:`f_{ag}`) Litter Outputs -------------- -[22]_The fragmenting litter pool is available for burning but not for +The fragmenting litter pool is available for burning but not for respiration or decomposition. Fragmentation rates are calculated according to a maximum fragmentation rate (:math:`\alpha_{cwd,lsc}` or :math:`\alpha_{litter}`) which is ameliorated by a temperature and water @@ -2898,7 +2898,7 @@ sensitivity analyses of the model outputs. Flux into decompsition cascade ------------------------------ -[23]_Upon fragmentation and release from the litter pool, carbon is +Upon fragmentation and release from the litter pool, carbon is transferred into the labile, lignin and cellulose decomposition pools. These pools are vertically resolved in the biogeochemistry model. The movement of carbon into each vertical layer is obviously different for @@ -3063,7 +3063,7 @@ fire modelling section. Fire (SPITFIRE) ^^^^^^^^^^^^^^^^^ -[24]_The influence of fire on vegetation is estimated using the SPITFIRE +The influence of fire on vegetation is estimated using the SPITFIRE model, which has been modified for use in ED following it’s original implementation in the LPJ-SPITFIRE model (:ref:`Thonicke et al. 2010`, :ref:`Pfeiffer et al. 2013`). This model as @@ -3501,99 +3501,5 @@ within the area affected by fire is a function of the ratio between | s}` | parameter | | | +-----------------+-----------------+-----------------+-----------------+ -.. raw:: latex - - \bigskip - -| - -.. raw:: latex - - -.. [1] - This description covers algorithms in the ‘fuse_cohorts’ subroutine. - -.. [2] - This description covers algorithms in the ‘fuse_patches’ subroutine. - -.. [3] - This description covers algorithms in the ‘fuse_2_patches’ - subroutine. - -.. [4] - This description covers the structure of code in all modules in - clm4_5 that are located in ‘ED’ subdirectories - -.. [5] - This description covers algorithms in the ‘init_cohorts’ subroutine - -.. [6] - This description relates to algorithms in the allocate_live_biomass - subroutine - -.. [7] - This description relates to algorithms in the EDCanopyStructure - subroutine - -.. [8] - This description relates to algorithms in the canopy_spread - subroutine - -.. [9] - This description relates to algorithms in the - canopy_leaf_area_profile subroutine - -.. [10] - This description relates to algorithms in the ED_norman_radiation - subroutine - -.. [11] - This description relates to algorithms in the ED_photosynthesis - subroutine - -.. [12] - This description relates to algorithms in the ED_btran subroutine - -.. [13] - This description relates to algorithms in the ED_photosynthesis - subroutine - -.. [14] - This description relates to algorithms in the ED_photosynthesis - subroutine - -.. [15] - This description relates to algorithms in the Growth_Derivatives - subroutine - -.. [16] - This description relates to algorithms in the ED_GrowthFunctions - subroutine - -.. [17] - This description relates to algorithms in the trim_canopy subroutine - -.. [18] - This description relates to algorithms in the phenology subroutine - -.. [19] - This description relates to algorithms in the phenology_leafoff - subroutine - -.. [20] - This description relates to algorithms in the seed_in, seed_decay and - seed_germination subroutines - -.. [21] - This description relates to algorithms in the CWD_input, - mortality_litter_fluxes and fire_litter_fluxes subroutines - -.. [22] - This description relates to algorithms in the CWD_out subroutine -.. [23] - This description relates to algorithms in the flux_into_litter_pools - subroutine -.. [24] - This description relates to algorithms in the ’SFMainMod’ subroutines diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 74dc2cf6dd..1b769042f7 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -175,7 +175,7 @@ First we calculate the cost of extraction (:math:`cost_{retrans}`, gC/gN) for th cost_{retrans}= k_{retrans} / (1/CN_{fallingleaf})^{1.3} -where :math:`k_{retrans}` is a parameter controlling the overall cost of resorption, which also increases exponentially as the C:N ratio increases **Say something about 1.3 exponent**). +where :math:`k_{retrans}` is a parameter controlling the overall cost of resorption, which also increases exponentially as the C:N ratio increases Next, we calculate the amount of C needed to be spent to increase the falling leaf C:N ratio by 1.0 in this iteration :math:`i` (:math:`C_{retrans_spent,i}`, gC m\ :sup:`-2`) as: .. math:: @@ -274,12 +274,12 @@ and the other C and N fluxes can be determined following the logic above. Modifications to allow variation in C:N ratios -------------------------------------------------------- -The original FUN model as developed by :ref:`Fisher et al. (2010)` and :ref:`Brzostek et al. (2014)` assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. **lit review on CN ratios** +The original FUN model as developed by :ref:`Fisher et al. (2010)` and :ref:`Brzostek et al. (2014)` assumes a fixed plant tissue C:N ratio. This means that in the case where N is especially limiting, all excess carbon will be utilized in an attempt to take up more Nitrogen. It has been repeatedly observed, however, that in these circumstances in real life, plants have some flexibility in the C:N stoichiometry of their tissues, and therefore, this assumption may not be realistic. However, the degree to which the C:N ratio varies with N availability is poorly documented, and existing global nitrogen models use a variety of heuristic methods by which to incorporate changing C:N ratios (Zaehle and Friend 2010; Ghimire et al. 2016). This algorithm exists as a placeholder to allow variable C:N ratios to occur, and to allow exploration of how much the parameters controlling their flexibility has on model outcomes. Incorporation of emerging understanding of the controls on tissue stoichiometry should ultimately replace this scheme. Thus, in CLM5, we introduce the capacity for tissue C:N ratios to be prognostic, rather than static. Overall N and C availability (:math:`N_{uptake}` and :math:`C_{growth}`) and hence tissue C:N ratios, are both determined by FUN. Allocation to individual tissues is discussed in the allocation chapter Here we introduce an algorithm which adjusts the C expenditure on uptake to allow varying tissue C:N ratios. Increasing C spent on uptake will directly reduce the C:N ratio, and reducing C spent on uptake (retaining more for tissue growth) will increase it. C spent on uptake is impacted by both the N cost in the environment, and the existing tissue C:N ratio of the plant. The output of this algorithm is :math:`\gamma_{FUN}`, the fraction of the ideal :math:`C_{nuptake}` calculated from -the FUN equation above (**link equation**). +the FUN equation above .. math:: C_{nuptake} = C_{nuptake}.\gamma_{FUN} @@ -297,7 +297,7 @@ where :math:`a_{cnflex}` and :math:`b_{cnflex}` are parameters fitted to give fl Response of C expenditure to plant C:N ratios ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -We first calculate a :math:`\delta_{CN}`, which is the difference between the target C:N (:math:`target_{CN}`) a model parameter, and the existing C:N ratio (:math:`CN_{plant}`) **This isn't strictly how it is worked out. Need to remember why we use c_allometry instead**. +We first calculate a :math:`\delta_{CN}`, which is the difference between the target C:N (:math:`target_{CN}`) a model parameter, and the existing C:N ratio (:math:`CN_{plant}`) .. math:: diff --git a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst index 33b9477ed1..8ec6f1d1fb 100644 --- a/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst +++ b/doc/source/tech_note/Plant_Respiration/CLM50_Tech_Note_Plant_Respiration.rst @@ -2,7 +2,9 @@ Plant Respiration ================= - +CLM5 includes changes to plant respiration including + - A new leaf respiration algorithm based on Atkin et al. (2016) + - A lower growth respiration coefficient, based on Atkin et al. (2017) Autotrophic Respiration ---------------------------- @@ -17,7 +19,7 @@ carbon cost for the synthesis of new growth. Maintenance Respiration ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Atkin et al. (2016) propose a model for respiration that is based on the leaf nitrogen content per unit area (:math:`NS_{narea}` (gN m :sup:`2` leaf), with an intercept parameter that is PFT dependant, and an acclimation term that depends upon the average temperature of the previous 10 day period :math:`t_{2m,10days}`, in Celsius. +Atkin et al. (2016) propose a model for leaf respiration that is based on the leaf nitrogen content per unit area (:math:`NS_{narea}` (gN m :sup:`2` leaf), with an intercept parameter that is PFT dependant, and an acclimation term that depends upon the average temperature of the previous 10 day period :math:`t_{2m,10days}`, in Celsius. .. math:: :label: 17.46) @@ -89,8 +91,9 @@ Growth Respiration Growth respiration is calculated as a factor of 0.11 times the total carbon allocation to new growth (:math:`CF_{growth}`, after allocating carbon for N acquisition, -Chapter :numref:`rst_FUN`.)on a given timestep, based on construction costs -for a range of woody and non-woody tissues (Atkin et al. in prep). For new +Chapter :numref:`rst_FUN`.) on a given timestep, based on construction costs +for a range of woody and non-woody tissues, with estimates of the growth +respiration flux revised downswards following (Atkin et al. 2017). For new carbon and nitrogen allocation that enters storage pools for subsequent display, it is not clear what fraction of the associated growth respiration should occur at the time of initial allocation, and what diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index 35c50dc038..cafba90dc3 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -120,6 +120,19 @@ Axelsson, E., and Axelsson, B. 1986. Changes in carbon allocation patterns in spruce and pine trees following irrigation and fertilization. Tree Phys. 2:189-204. +.. _Atkin2016: + +|br| + +Atkin OK, Bloomfield KJ, Reich PB, Tjoelker MG, Asner GP, Bonal D et al (2015) Global variability in leaf respiration in relation to climate, plant functional types and leaf traits. New Phytologist 206:614–636 + +.. _Atkin2017: + +|br| + +Leaf Respiration in Terrestrial Biosphere Models. In Plant Respiration: Metabolic Fluxes and Carbon Balance, Advances +in Photosynthesis and Respiration 43, G. Tcherkez, J. Ghashghaie (eds.) Springer International Publishing AG 2017 + .. _BadgerandDirmeyer2015: |br| From 3b5434e4f5014f3d40dc655af6673664669f8c0a Mon Sep 17 00:00:00 2001 From: Rosemary Fisher Date: Thu, 8 Mar 2018 11:16:15 -0700 Subject: [PATCH 159/730] removed nonsense text from end of FUN chapter --- doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst index 1b769042f7..658653da48 100644 --- a/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst +++ b/doc/source/tech_note/FUN/CLM50_Tech_Note_FUN.rst @@ -391,19 +391,3 @@ Following this, we determine how much carbon is accounted for for each soil laye -Types of N uptake streams --------------------------------------------------------- -Arbuscular mycorrhizal fungi: -Ectomycorrhizal fungi: -Nonmycorrhizal plants. - - -ECK_active (step 1) sets active components for Ectomycorrhizal fungi -ACK_active (step 2) sets active components for Arbuscular fungi - -kc_nonmyc (step 1) sets nonmyc components for Ectomycorrhizal fungi -kc_nonmyc (step 2) sets active components for Arbuscular fungi - -ACTIVE vs NONMYC -ECTO vs ARBU for ACTIVE. - From cc34bd25d0918494143e82fecac52121021e937b Mon Sep 17 00:00:00 2001 From: rgknox Date: Tue, 13 Mar 2018 10:34:01 -0700 Subject: [PATCH 160/730] FATES: Modified fates test group, updated default fates parameter file to have a freezing tolerance. --- .../namelist_defaults_clm4_5.xml | 2 +- cime_config/testdefs/testlist_clm.xml | 36 +++++++++++++------ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index f78b54ef5c..ef7afd8844 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_2troppftclones.c171018.nc +lnd/clm2/paramdata/fates_params_2troppftclones_f0.c180220.nc diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 8933e9f884..ba8127a869 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1780,9 +1780,10 @@ - + + @@ -1791,6 +1792,7 @@ + @@ -1799,6 +1801,7 @@ + @@ -1808,6 +1811,7 @@ + @@ -1817,22 +1821,25 @@ + - + + - + + @@ -1842,6 +1849,7 @@ + @@ -1850,64 +1858,72 @@ + - + + - + + - + + - + + - + + - + + - + + From fc7d5c269d86f052c0722aff3873748b2b1fdfdc Mon Sep 17 00:00:00 2001 From: rgknox Date: Tue, 13 Mar 2018 14:33:07 -0700 Subject: [PATCH 161/730] fates: changed all fates tests in aux_clm to use FatesColdDef. --- cime_config/testdefs/testlist_clm.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ba8127a869..366e7d2778 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1649,7 +1649,7 @@ - + @@ -1666,7 +1666,7 @@ - + @@ -1694,7 +1694,7 @@ - + @@ -1712,7 +1712,7 @@ - + @@ -1720,7 +1720,7 @@ - + @@ -1789,7 +1789,7 @@ - + @@ -1817,7 +1817,7 @@ - + @@ -1864,7 +1864,7 @@ - + @@ -1875,7 +1875,7 @@ - + @@ -1884,7 +1884,7 @@ - + @@ -1893,7 +1893,7 @@ - + @@ -1902,7 +1902,7 @@ - + @@ -1911,7 +1911,7 @@ - + From 25719a19bd428f64c7b87a47be7cb740b99d5087 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 15 Mar 2018 11:48:37 -0700 Subject: [PATCH 162/730] Fates tests: modifications to the set of tests for fates category. Changed some of the specificatios in the test dirs. --- cime_config/testdefs/testlist_clm.xml | 10 +++++----- .../testdefs/testmods_dirs/clm/Fates/user_nl_clm | 2 +- .../testmods_dirs/clm/FatesAllVars/user_nl_clm | 1 - .../testmods_dirs/clm/FatesColdDef/include_user_mods | 1 - .../testmods_dirs/clm/FatesColdDef/user_nl_clm | 4 ++++ .../testmods_dirs/clm/FatesShortList/include_user_mods | 1 - .../{FatesAllVars => FatesShortList}/shell_commands | 0 7 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{FatesAllVars => FatesShortList}/shell_commands (100%) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 366e7d2778..22efed96bd 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1789,7 +1789,7 @@ - + @@ -1807,7 +1807,7 @@ - + @@ -1827,7 +1827,7 @@ - + @@ -1845,7 +1845,7 @@ - + @@ -1920,7 +1920,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 487ad09863..3f6a4dbc56 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -1,4 +1,4 @@ -!!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-1x1br.clm2.r.0111-01-01-00000.nc' +!! USES THE DEFAULT INITIALIZATION FILE SPECIFIED IN bld/namelist_files/namelist_defaults_clm4_5.xml hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index a869310636..dd29aef032 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -1,4 +1,3 @@ -!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-f45.clm2.r.0111-01-01-00000.nc' hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm index 144569c412..bae4c2cb9e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm @@ -1,3 +1,7 @@ +hist_mfilt = 365 +hist_nhtfrq = -24 +hist_empty_htapes = .true. +use_fates_spitfire= .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/shell_commands similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands rename to cime_config/testdefs/testmods_dirs/clm/FatesShortList/shell_commands From c4bcbbd303d0e2e6f577559e1dc807de65608093 Mon Sep 17 00:00:00 2001 From: rgknox Date: Thu, 15 Mar 2018 14:48:27 -0700 Subject: [PATCH 163/730] fates tests: modified fates category tests to have I2000Clm45BgcCrop --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 22efed96bd..c2e570c9be 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1827,7 +1827,7 @@ - + From 98bbb9ad33e72cc793eb2952472689f001d69583 Mon Sep 17 00:00:00 2001 From: rgknox Date: Fri, 16 Mar 2018 12:43:52 -0700 Subject: [PATCH 164/730] fates testing: updated finitdat file to work with new fates category tests. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index ef7afd8844..09cb779a57 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -584,13 +584,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0121-01-01.4x5_mgx3v7_simyr2000_c180122.nc - - -lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0101-01-01.1x1_brazil_simyr2000_c180120.nc +>lnd/clm2/initdata_map/clmi.I2000CLM50FATESCRUGS.0006-01-01.f45_f45_mg37_s1.4.1_a3.0.0_rev3_c180316.nc From 1feb5bf46f586c6f4cf5e99ec048cc5ea4aac91c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 12 Apr 2018 07:27:16 -0600 Subject: [PATCH 165/730] Fix co-author name --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index 08bdf4ec29..e5a075cca5 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -13,7 +13,7 @@ ***Contributing Authors*** -**Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathon Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, +**Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathan Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** From 6416fd1c03dbc2dc04fbd4c31f7a5b3d30027be9 Mon Sep 17 00:00:00 2001 From: ckoven Date: Fri, 27 Apr 2018 18:03:30 -0600 Subject: [PATCH 166/730] commented out lines that caused inventory inititalization to not build despite valid filename --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 00807d049c..214fe4d213 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3742,8 +3742,8 @@ sub setup_logic_fates { $var = "fates_inventory_ctrl_filename"; if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_inventory_init is set" ); - } elsif ( ! -f "$nl->get_value($var)" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); + # } elsif ( ! -f "$nl->get_value($var)" ) { + # $log->fatal_error("$var does NOT point to a valid filename" ); } } } From 379f28f2ef0416441d6bb7df7087d6c6c311228e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 7 May 2018 14:55:25 -0700 Subject: [PATCH 167/730] Removing static number of soil layers to fates-clm interface. --- src/utils/clmfates_interfaceMod.F90 | 146 ++++++++++++++++------------ 1 file changed, 83 insertions(+), 63 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index fbbfbf99ea..6892cf5e8e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -62,7 +62,6 @@ module CLMFatesInterfaceMod use clm_varpar , only : ivis use clm_varpar , only : inir use clm_varpar , only : nlevgrnd - use clm_varpar , only : nlevsoi use clm_varpar , only : nlevdecomp use clm_varpar , only : nlevdecomp_full use PhotosynthesisMod , only : photosyns_type @@ -286,7 +285,6 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('nir_sw_index',ival=inir) call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) - call set_fates_ctrlparms('num_lev_soil',ival=nlevsoi) call set_fates_ctrlparms('num_levdecomp',ival=nlevdecomp) call set_fates_ctrlparms('num_levdecomp_full',ival=nlevdecomp_full) call set_fates_ctrlparms('hlm_name',cval='CLM') @@ -442,7 +440,10 @@ subroutine init(this, bounds_proc ) ! No information about the patch or cohort structure is needed at this step do s = 1, this%fates(nc)%nsites - call allocate_bcin(this%fates(nc)%bc_in(s)) + + c = this%f2hmap(nc)%fcolumn(s) + + call allocate_bcin(this%fates(nc)%bc_in(s),col%nbedrock(c)) call allocate_bcout(this%fates(nc)%bc_out(s)) call this%fates(nc)%zero_bcs(s) @@ -563,6 +564,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: mon ! month (1, ..., 12) integer :: day ! day of month (1, ..., 31) integer :: sec ! seconds of the day + integer :: nlevsoil ! number of soil layers at the site integer :: current_year integer :: current_month integer :: current_day @@ -604,16 +606,21 @@ subroutine dynamics_driv(this, nc, bounds_clump, & do s=1,this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(1:nlevsoi) = & - waterstate_inst%h2osoi_vol_col(c,1:nlevsoi) + + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + + this%fates(nc)%bc_in(s)%h2o_liqvol_sl(1:nlevsoil) = & + waterstate_inst%h2osoi_vol_col(c,1:nlevsoil) ! TO-DO: SHOULD THIS BE LIQVOL OR IS VOL OK? (RGK-02-2017) this%fates(nc)%bc_in(s)%t_veg24_si = & temperature_inst%t_veg24_patch(col%patchi(c)) - this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = canopystate_inst%altmax_lastyear_indx_col(c) + this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = & + min(nlevsoil, canopystate_inst%altmax_lastyear_indx_col(c)) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) @@ -633,12 +640,12 @@ subroutine dynamics_driv(this, nc, bounds_clump, & if(use_fates_planthydro)then - this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoi) = soilstate_inst%hksat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = soilstate_inst%watsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = soilstate_inst%watres_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = soilstate_inst%sucsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = soilstate_inst%bsw_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = soilstate_inst%hksat_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = soilstate_inst%watsat_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoil) = soilstate_inst%watres_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = soilstate_inst%sucsat_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoil) = soilstate_inst%bsw_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = waterstate_inst%h2osoi_liq_col(c,1:nlevsoil) end if @@ -1139,6 +1146,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins ! locals real(r8) :: vol_ice real(r8) :: eff_porosity + integer :: nlevsoil ! Number of soil layers at each site integer :: j integer :: s integer :: c @@ -1169,29 +1177,31 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins do s = 1,this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = & - soilstate_inst%watsat_col(c,1:nlevsoi) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + + this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = & + soilstate_inst%watsat_col(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = & - soilstate_inst%watres_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoil) = & + soilstate_inst%watres_col(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = & - soilstate_inst%sucsat_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = & + soilstate_inst%sucsat_col(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = & - soilstate_inst%bsw_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoil) = & + soilstate_inst%bsw_col(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = & - waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = & + waterstate_inst%h2osoi_liq_col(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoi) = & - soilstate_inst%hksat_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = & + soilstate_inst%hksat_col(c,1:nlevsoil) - do j = 1, nlevsoi + do j = 1, nlevsoil vol_ice = min(soilstate_inst%watsat_col(c,j), & waterstate_inst%h2osoi_ice_col(c,j)/(col%dz(c,j)*denice)) eff_porosity = max(0.01_r8,soilstate_inst%watsat_col(c,j)-vol_ice) - this%fates(nc)%bc_in(s)%eff_porosity_gl(j) = eff_porosity + this%fates(nc)%bc_in(s)%eff_porosity_sl(j) = eff_porosity end do end do @@ -1384,6 +1394,7 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & integer :: j integer :: ifp integer :: p + integer :: nlevsoil associate(& sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) @@ -1418,24 +1429,25 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil ! Check to see if this column is in the exposed veg filter if( any(filterc==c) )then this%fates(nc)%bc_in(s)%filter_btran = .true. - do j = 1,nlevgrnd - this%fates(nc)%bc_in(s)%tempk_gl(j) = t_soisno(c,j) - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(j) = h2osoi_liqvol(c,j) - this%fates(nc)%bc_in(s)%eff_porosity_gl(j) = eff_porosity(c,j) - this%fates(nc)%bc_in(s)%watsat_gl(j) = watsat(c,j) + do j = 1,nlevsoil + this%fates(nc)%bc_in(s)%tempk_sl(j) = t_soisno(c,j) + this%fates(nc)%bc_in(s)%h2o_liqvol_sl(j) = h2osoi_liqvol(c,j) + this%fates(nc)%bc_in(s)%eff_porosity_sl(j) = eff_porosity(c,j) + this%fates(nc)%bc_in(s)%watsat_sl(j) = watsat(c,j) end do else this%fates(nc)%bc_in(s)%filter_btran = .false. - this%fates(nc)%bc_in(s)%tempk_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%eff_porosity_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%watsat_gl(:) = -999._r8 + this%fates(nc)%bc_in(s)%tempk_sl(:) = -999._r8 + this%fates(nc)%bc_in(s)%h2o_liqvol_sl(:) = -999._r8 + this%fates(nc)%bc_in(s)%eff_porosity_sl(:) = -999._r8 + this%fates(nc)%bc_in(s)%watsat_sl(:) = -999._r8 end if end do @@ -1456,15 +1468,16 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & ! Now that the active layers of water uptake have been decided by fates ! Calculate the suction that is passed back to fates - ! Note that the filter_btran is unioned with active_suction_gl + ! Note that the filter_btran is unioned with active_suction_sl do s = 1, this%fates(nc)%nsites + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil c = this%f2hmap(nc)%fcolumn(s) - do j = 1,nlevgrnd - if(this%fates(nc)%bc_out(s)%active_suction_gl(j)) then + do j = 1,nlevsoil + if(this%fates(nc)%bc_out(s)%active_suction_sl(j)) then s_node = max(h2osoi_liqvol(c,j)/eff_porosity(c,j),0.01_r8) call soil_water_retention_curve%soil_suction(c,j,s_node, soilstate_inst, smp_node) - this%fates(nc)%bc_in(s)%smp_gl(j) = smp_node + this%fates(nc)%bc_in(s)%smp_sl(j) = smp_node end if end do end do @@ -1493,13 +1506,13 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & ! ------------------------------------------------------------------------------- do s = 1, this%fates(nc)%nsites - + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil c = this%f2hmap(nc)%fcolumn(s) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) - do j = 1,nlevgrnd + do j = 1,nlevsoil rresis(p,j) = -999.9 ! We do not calculate this correctly ! it should not thought of as valid output until we decide to. @@ -1523,8 +1536,7 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use decompMod , only : bounds_type - use clm_varcon , only : rgas, tfrz, namep - use clm_varpar , only : nlevsoi + use clm_varcon , only : rgas, tfrz, namep use clm_varctl , only : iulog use pftconMod , only : pftcon use perf_mod , only : t_startf, t_stopf @@ -1550,7 +1562,7 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & type(temperature_type) , intent(in) :: temperature_inst type(canopystate_type) , intent(inout) :: canopystate_inst type(photosyns_type) , intent(inout) :: photosyns_inst - + integer :: nlevsoil ! number of soil layers in this site integer :: s,c,p,ifp,j,icp real(r8) :: dtime @@ -1568,9 +1580,10 @@ subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - - do j = 1,nlevsoi - this%fates(nc)%bc_in(s)%t_soisno_gl(j) = t_soisno(c,j) ! soil temperature (Kelvin) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + + do j = 1,nlevsoil + this%fates(nc)%bc_in(s)%t_soisno_sl(j) = t_soisno(c,j) ! soil temperature (Kelvin) end do this%fates(nc)%bc_in(s)%forc_pbot = forc_pbot(c) ! atmospheric pressure (Pa) @@ -2140,9 +2153,11 @@ subroutine init_soil_depths(this, nc) do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%zi_sisl(0:hlm_numlevsoil) = col%zi(c,0:hlm_numlevsoil) - this%fates(nc)%bc_in(s)%dz_sisl(1:hlm_numlevsoil) = col%dz(c,1:hlm_numlevsoil) - this%fates(nc)%bc_in(s)%z_sisl(1:hlm_numlevsoil) = col%z(c,1:hlm_numlevsoil) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + + this%fates(nc)%bc_in(s)%zi_sisl(0:nlevsoil) = col%zi(c,0:nlevsoil) + this%fates(nc)%bc_in(s)%dz_sisl(1:nlevsoil) = col%dz(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%z_sisl(1:nlevsoil) = col%z(c,1:nlevsoil) this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:hlm_numlevdecomp_full) = & dzsoi_decomp(1:hlm_numlevdecomp_full) end do @@ -2249,6 +2264,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & integer :: j integer :: ifp integer :: p + integer :: nlevsoil real(r8) :: dtime @@ -2261,21 +2277,25 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & ! ------------------------------------------------------------------------------------ do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) + + c = this%f2hmap(nc)%fcolumn(s) + + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + this%fates(nc)%bc_in(s)%smpmin_si = & soilstate_inst%smpmin_col(c) - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = & - soilstate_inst%watsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = & - soilstate_inst%watres_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = & - soilstate_inst%sucsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = & - soilstate_inst%bsw_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = & - waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%eff_porosity_gl(1:nlevsoi) = & - soilstate_inst%eff_porosity_col(c,1:nlevsoi) + this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoil) = & + soilstate_inst%watsat_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoil) = & + soilstate_inst%watres_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoil) = & + soilstate_inst%sucsat_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoil) = & + soilstate_inst%bsw_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = & + waterstate_inst%h2osoi_liq_col(c,1:nlevsoil) + this%fates(nc)%bc_in(s)%eff_porosity_sl(1:nlevsoil) = & + soilstate_inst%eff_porosity_col(c,1:nlevsoil) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) From eacd8d669b6a936a414cf68c12561a97d1e446cd Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 10 May 2018 12:18:49 -0700 Subject: [PATCH 168/730] added site-level nlevdecomp and arguments to populate it --- src/utils/clmfates_interfaceMod.F90 | 46 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 6892cf5e8e..343c51fb10 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -108,7 +108,7 @@ module CLMFatesInterfaceMod use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type use FatesHydraulicsMemMod , only : nlevsoi_hyd - use FatesInterfaceMod , only : hlm_numlevgrnd, hlm_numlevsoil, hlm_numlevdecomp_full + use FatesInterfaceMod , only : hlm_numlevgrnd use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site use EDInitMod , only : zero_site @@ -253,6 +253,7 @@ subroutine init(this, bounds_proc ) integer, allocatable :: collist (:) type(bounds_type) :: bounds_clump integer :: nmaxcol + integer :: ndecomp ! Initialize the FATES communicators with the HLM ! This involves to stages @@ -285,8 +286,6 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('nir_sw_index',ival=inir) call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) - call set_fates_ctrlparms('num_levdecomp',ival=nlevdecomp) - call set_fates_ctrlparms('num_levdecomp_full',ival=nlevdecomp_full) call set_fates_ctrlparms('hlm_name',cval='CLM') call set_fates_ctrlparms('hio_ignore_val',rval=spval) call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) @@ -443,8 +442,14 @@ subroutine init(this, bounds_proc ) c = this%f2hmap(nc)%fcolumn(s) - call allocate_bcin(this%fates(nc)%bc_in(s),col%nbedrock(c)) - call allocate_bcout(this%fates(nc)%bc_out(s)) + if (use_vertsoilc) then + ndecomp = col%nbedrock(c) + else + ndecomp = 1 + end if + + call allocate_bcin(this%fates(nc)%bc_in(s),col%nbedrock(c),ndecomp) + call allocate_bcout(this%fates(nc)%bc_out(s),col%nbedrock(c),ndecomp) call this%fates(nc)%zero_bcs(s) ! Pass any grid-cell derived attributes to the site @@ -565,6 +570,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: day ! day of month (1, ..., 31) integer :: sec ! seconds of the day integer :: nlevsoil ! number of soil layers at the site + integer :: nld_si ! site specific number of decomposition layers integer :: current_year integer :: current_month integer :: current_day @@ -681,12 +687,19 @@ subroutine dynamics_driv(this, nc, bounds_clump, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lab_c_col(:) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_cel_c_col(:) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lig_c_col(:) + + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,1:nlevdecomp) = 0.0_r8 + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,1:nlevdecomp) = 0.0_r8 + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nlevdecomp) = 0.0_r8 + + nld_si = this%fates(nc)%bc_in(s)%nlevdecomp + + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,1:nld_si) = & + this%fates(nc)%bc_out(s)%FATES_c_to_litr_lab_c_col(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,1:nld_si) = & + this%fates(nc)%bc_out(s)%FATES_c_to_litr_cel_c_col(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nld_si) = & + this%fates(nc)%bc_out(s)%FATES_c_to_litr_lig_c_col(1:nld_si) end do @@ -1516,7 +1529,7 @@ subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & rresis(p,j) = -999.9 ! We do not calculate this correctly ! it should not thought of as valid output until we decide to. - rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pagl(ifp,j) + rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pasl(ifp,j) btran(p) = this%fates(nc)%bc_out(s)%btran_pa(ifp) btran2(p) = -999.9 ! Not available, force to nonsense @@ -2149,17 +2162,20 @@ subroutine init_soil_depths(this, nc) integer :: s ! site index integer :: c ! column index integer :: j ! Depth index + integer :: nlevsoil + integer :: nlevdecomp do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil - + nlevdecomp = this%fates(nc)%bc_in(s)%nlevdecomp + this%fates(nc)%bc_in(s)%zi_sisl(0:nlevsoil) = col%zi(c,0:nlevsoil) this%fates(nc)%bc_in(s)%dz_sisl(1:nlevsoil) = col%dz(c,1:nlevsoil) this%fates(nc)%bc_in(s)%z_sisl(1:nlevsoil) = col%z(c,1:nlevsoil) - this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:hlm_numlevdecomp_full) = & - dzsoi_decomp(1:hlm_numlevdecomp_full) + this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:nlevdecomp) = & + dzsoi_decomp(1:nlevdecomp) end do return From 08c5fe5a0e4afa3e1ab49ae93bb27148d957b51e Mon Sep 17 00:00:00 2001 From: Charles Koven Date: Fri, 2 Feb 2018 16:45:57 -0800 Subject: [PATCH 169/730] merged over hostside changes for new age*pft and size*age*pft hist dims from fates-clm --- src/main/histFileMod.F90 | 27 +++++++++++++++++++++++++++ src/utils/clmfates_interfaceMod.F90 | 26 +++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index fea351a17d..091e845b86 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -2055,6 +2055,8 @@ subroutine htape_create (t, histrest) if(use_fates)then call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) + call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) @@ -2484,6 +2486,11 @@ subroutine htape_timeconst(t, mode) use FatesInterfaceMod, only : fates_hdim_levpft use FatesInterfaceMod, only : fates_hdim_scmap_levscag use FatesInterfaceMod, only : fates_hdim_agmap_levscag + use FatesInterfaceMod, only : fates_hdim_scmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_agmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_pftmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_agmap_levagepft + use FatesInterfaceMod, only : fates_hdim_pftmap_levagepft use FatesInterfaceMod, only : fates_hdim_levfuel use FatesInterfaceMod, only : fates_hdim_levcwdsc use FatesInterfaceMod, only : fates_hdim_levcan @@ -2576,6 +2583,17 @@ subroutine htape_timeconst(t, mode) long_name='FATES leaf level of combined canopy x leaf x pft dimension', ncid=nfid(t)) call ncd_defvar(varname='fates_pftmap_levcnlfpf',xtype=ncd_int, dim1name='fates_levcnlfpf', & long_name='FATES PFT level of combined canopy x leaf x pft dimension', ncid=nfid(t)) + call ncd_defvar(varname='fates_scmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES size-class map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES age-class map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES pft map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & + long_name='FATES pft map into patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & + long_name='FATES age-class map into patch age x pft', units='-', ncid=nfid(t)) + end if @@ -2605,6 +2623,11 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_canmap_levcnlfpf',data=fates_hdim_canmap_levcnlfpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_lfmap_levcnlfpf',data=fates_hdim_lfmap_levcnlfpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levcnlfpf',data=fates_hdim_pftmap_levcnlfpf, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_scmap_levscagpft',data=fates_hdim_scmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levscagpft',data=fates_hdim_agmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_pftmap_levscagpft',data=fates_hdim_pftmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_pftmap_levagepft',data=fates_hdim_pftmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') end if endif @@ -4768,6 +4791,10 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, num2d = nlevsclass*numpft_ed case ('fates_levscag') num2d = nlevsclass*nlevage + case ('fates_levscagpf') + num2d = nlevsclass*nlevage*numpft_ed + case ('fates_levagepft') + num2d = nlevage*numpft_ed case ('fates_levcan') num2d = nclmax case ('fates_levcnlf') diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index fbbfbf99ea..13971b0ea9 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1873,6 +1873,7 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_r8, site_ground_r8, site_size_pft_r8 use FatesIOVariableKindMod, only : site_size_r8, site_pft_r8, site_age_r8 use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 + use FatesIOVariableKindMod, only : site_scagpft_r8, site_agepft_r8 use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -2112,7 +2113,24 @@ subroutine init_history_io(this,bounds_proc) ptr_col=this%fates_hist%hvars(ivar)%r82d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) - + case(site_scagpft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) + case(site_agepft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) case default write(iulog,*) 'A FATES iotype was created that was not registerred' @@ -2358,6 +2376,12 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%sizeage_class_begin = 1 fates%sizeage_class_end = nlevsclass * nlevage + + fates%agepft_class_begin = 1 + fates%agepft_class_end = nlevage * numpft_ed + + fates%sizeagepft_class_begin = 1 + fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_ed fates%fuel_begin = 1 fates%fuel_end = nfsc From 92c325ac931fd8cedfdf4cf9ecb865657cc0c560 Mon Sep 17 00:00:00 2001 From: Charles Koven Date: Thu, 10 May 2018 16:49:04 -0700 Subject: [PATCH 170/730] added height dimension to FATES history --- src/main/histFileMod.F90 | 8 ++++++++ src/utils/clmfates_interfaceMod.F90 | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 091e845b86..0aaa2afae5 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -23,6 +23,7 @@ module histFileMod use EDTypesMod , only : nclmax use EDTypesMod , only : nlevleaf use FatesInterfaceMod , only : nlevsclass, nlevage + use FatesInterfaceMod , only : nlevheight use EDTypesMod , only : nfsc, ncwd use FatesInterfaceMod , only : numpft_ed => numpft use ncdio_pio @@ -2060,6 +2061,7 @@ subroutine htape_create (t, histrest) call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) + call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid) call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) @@ -2483,6 +2485,7 @@ subroutine htape_timeconst(t, mode) use FatesInterfaceMod, only : fates_hdim_pfmap_levscpf use FatesInterfaceMod, only : fates_hdim_scmap_levscpf use FatesInterfaceMod, only : fates_hdim_levage + use FatesInterfaceMod, only : fates_hdim_levheight use FatesInterfaceMod, only : fates_hdim_levpft use FatesInterfaceMod, only : fates_hdim_scmap_levscag use FatesInterfaceMod, only : fates_hdim_agmap_levscag @@ -2565,6 +2568,8 @@ subroutine htape_timeconst(t, mode) long_name='FATES size index of the combined pft-size class dimension', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_levage',xtype=tape(t)%ncprec, dim1name='fates_levage', & long_name='FATES patch age (yr)', ncid=nfid(t)) + call ncd_defvar(varname='fates_levheight',xtype=tape(t)%ncprec, dim1name='fates_levheight', & + long_name='FATES height (m)', ncid=nfid(t)) call ncd_defvar(varname='fates_levpft',xtype=ncd_int, dim1name='fates_levpft', & long_name='FATES pft number', ncid=nfid(t)) call ncd_defvar(varname='fates_levfuel',xtype=ncd_int, dim1name='fates_levfuel', & @@ -2614,6 +2619,7 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_pftmap_levscpf',data=fates_hdim_pfmap_levscpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_scmap_levscpf',data=fates_hdim_scmap_levscpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levage',data=fates_hdim_levage, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_levheight',data=fates_hdim_levheight, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levpft',data=fates_hdim_levpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levfuel',data=fates_hdim_levfuel, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levcwdsc',data=fates_hdim_levcwdsc, ncid=nfid(t), flag='write') @@ -4783,6 +4789,8 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, num2d = numpft_ed case ('fates_levage') num2d = nlevage + case ('fates_levheight') + num2d = nlevheight case ('fates_levfuel') num2d = nfsc case ('fates_levcwdsc') diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 13971b0ea9..7876924455 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1875,6 +1875,7 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 use FatesIOVariableKindMod, only : site_scagpft_r8, site_agepft_r8 use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 + use FatesIOVariableKindMod, only : site_height_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -2059,6 +2060,15 @@ subroutine init_history_io(this,bounds_proc) ptr_col=this%fates_hist%hvars(ivar)%r82d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) + case(site_height_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) case(site_fuel_r8) d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name @@ -2340,6 +2350,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type use FatesInterfaceMod, only : nlevsclass, nlevage + use FatesInterfaceMod, only : nlevheight use EDtypesMod, only : nfsc, ncwd use EDtypesMod, only : nlevleaf, nclmax use FatesInterfaceMod, only : numpft_ed => numpft @@ -2374,6 +2385,9 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%age_class_begin = 1 fates%age_class_end = nlevage + fates%height_begin = 1 + fates%height_end = nlevheight + fates%sizeage_class_begin = 1 fates%sizeage_class_end = nlevsclass * nlevage From e1deb0f6300d40ace2a20084e67dcf5a4512ebc1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 18 May 2018 18:32:50 -0600 Subject: [PATCH 171/730] Removed deprecated variables from allvars test. Temporary update of the fates finidat file. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 +++++--- .../testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 09cb779a57..27d1cf7031 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_2troppftclones_f0.c180220.nc +/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_2trop.c180512.nc + + @@ -583,8 +585,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I2000CLM50FATESCRUGS.0006-01-01.f45_f45_mg37_s1.4.1_a3.0.0_rev3_c180316.nc + ic_tod="0" glc_nec="10" use_crop=".false." irrigate=".true."> +/glade/scratch/rgknox/fates-clm-tests/iclm50fates-finit-s.1.12.3_a.4.0.0-f45/run/iclm50fates-finit-s.1.12.3_a.4.0.0-f45.clm2.r.0056-01-01-00000.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index dd29aef032..38ff54ebf1 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -6,7 +6,7 @@ hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE',' 'PARSHA_Z_CNLFPFT','PARSUN_Z_CAN','PARSHA_Z_CAN','LAISUN_Z_CNLF','LAISHA_Z_CNLF','LAISUN_Z_CNLFPFT','LAISHA_Z_CNLFPFT', 'LAISUN_TOP_CAN','LAISHA_TOP_CAN','FABD_SUN_CNLFPFT','FABD_SHA_CNLFPFT','FABI_SUN_CNLFPFT','FABI_SHA_CNLFPFT', 'FABD_SUN_CNLF','FABD_SHA_CNLF','FABI_SUN_CNLF','FABI_SHA_CNLF','FABD_SUN_TOPLF_BYCANLAYER','FABD_SHA_TOPLF_BYCANLAYER', - 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','TS_NET_UPTAKE_CNLF','YEAR_NET_UPTAKE_CNLF','CROWNAREA_CNLF', + 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','NET_C_UPTAKE_CNLF','CROWNAREA_CNLF', 'MORTALITY_CARBONFLUX_CANOPY','MORTALITY_CARBONFLUX_UNDERSTORY','NPLANT_SCAG','NPLANT_CANOPY_SCAG','NPLANT_UNDERSTORY_SCAG', 'DDBH_CANOPY_SCAG','DDBH_UNDERSTORY_SCAG','MORTALITY_CANOPY_SCAG','MORTALITY_UNDERSTORY_SCAG','GPP_SCPF','GPP_CANOPY_SCPF', 'AR_CANOPY_SCPF','GPP_UNDERSTORY_SCPF','AR_UNDERSTORY_SCPF','NPP_SCPF','NPP_LEAF_SCPF','NPP_SEED_SCPF','NPP_FNRT_SCPF', From ae46cb6284b647327bac0c601833e43f8d8aed28 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 18 May 2018 18:35:41 -0600 Subject: [PATCH 172/730] updating default fates parameter file to include new hydro parameter --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index c3a2bf4dfb..fd0e586e4b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_2troppftclones_f0.c180220.nc +lnd/clm2/paramdata/fates_params_default_2trop.c180518.nc From bb94902e04d46c747061151d388d3aef58aef68d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 18 May 2018 18:41:29 -0600 Subject: [PATCH 173/730] Added a fates hydro testmod, (but not the test entry itself) --- .../testdefs/testmods_dirs/clm/FatesHydro/shell_commands | 1 + .../testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands new file mode 100644 index 0000000000..2a9f09bd75 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/shell_commands @@ -0,0 +1 @@ +./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm new file mode 100644 index 0000000000..e6dd831a5f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm @@ -0,0 +1,6 @@ +hist_empty_htapes = .true. +use_fates_ed_st3= .true. +use_fates_planthydro= .true. +hist_fincl1 = 'FATES_ERRH2O_SCPF','FATES_TRAN_SCPF','FATES_ROOTUPTAKE_SCPF','FATES_ROOTUPTAKE01_SCPF', +'FATES_SAPFLOW_COL_SCPF','FATES_ITERH1_COL_SCPF','FATES_ATH_COL_SCPF','FATES_TTH_COL_SCPF', +'FATES_STH_COL_SCPF','FATES_LTH_COL_SCPF','FATES_AWP_COL_SCPF','FATES_BTRAN_COL_SCPF' From d27e2c7f5903db6dd1b7d2a3b2d91713aa8cd213 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 18 May 2018 18:44:08 -0600 Subject: [PATCH 174/730] Modified interface to fix plant hydro bugs --- src/utils/clmfates_interfaceMod.F90 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index fbbfbf99ea..fe08e18c08 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -775,17 +775,17 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! ! Diagnose water storage in canopy if hydraulics is on ! ! This updates the internal value and the bc_out value. ! ! If hydraulics is off, it returns 0 storage - ! if ( use_fates_planthydro ) then + if ( use_fates_planthydro ) then ! call UpdateH2OVeg(this%fates(nc)%nsites, & ! this%fates(nc)%sites, & ! this%fates(nc)%bc_out) ! - ! do s = 1, this%fates(nc)%nsites - ! c = this%f2hmap(nc)%fcolumn(s) - ! waterstate_inst%total_plant_stored_h2o_col(c) = & - ! this%fates(nc)%bc_out(s)%plant_stored_h2o_si - ! end do - ! end if + do s = 1, this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + waterstate_inst%total_plant_stored_h2o_col(c) = & + this%fates(nc)%bc_out(s)%plant_stored_h2o_si + end do + end if !--------------------------------------------------------------------------------- ! Convert FATES dynamics into HLM usable information @@ -2192,7 +2192,7 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - waterflux_inst%qflx_rootsoi_col(c,:) = this%fates(nc)%bc_out(s)%qflx_soil2root_sisl(:) + waterflux_inst%qflx_rootsoi_col(c,1:nlevsoi) = this%fates(nc)%bc_out(s)%qflx_soil2root_sisl(1:nlevsoi) end do end subroutine ComputeRootSoilFlux From 1a4466f50d36442b00c927bd1972d6c48d39a87a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 21 May 2018 12:33:06 -0700 Subject: [PATCH 175/730] Updated the external to match the released fates-hydro tag. --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index f4de1ff433..d9b14d300d 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.8.1_a3.0.0 +repo_url = https://github.com/NGEET/fates +tag = sci.1.13.0_api.3.2.0 required = True [PTCLM] From 34d8a33b80528b49cd94cd76645eefac26acd11b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 21 May 2018 17:48:52 -0600 Subject: [PATCH 176/730] Removing finidat files from fates test (temporarily?). Fixed variable list in FatesAllvars test. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 4 ++-- cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands | 1 + .../testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods | 2 +- .../testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm | 2 +- .../testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods | 2 +- .../testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods | 2 +- .../testdefs/testmods_dirs/clm/FatesST3/include_user_mods | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index fd0e586e4b..8579aa9b94 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -584,10 +584,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + lnd/clm2/initdata_map/clmi.I2000CLM50FATESCRUGS.0006-01-01.f45_f45_mg37_s1.4.1_a3.0.0_rev3_c180316.nc + ic_tod="0" glc_nec="10" use_crop=".false." irrigate=".true."> diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands index d81ed7dbc5..a0f3738e2c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands @@ -1 +1,2 @@ ./xmlchange CLM_BLDNML_OPTS="-no-megan" --append +./xmlchange CLM_FORCE_COLDSTART="on" \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods index 4c7aa0f2b4..1f2c03aebe 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods @@ -1 +1 @@ -../Fates +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index dd29aef032..38ff54ebf1 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -6,7 +6,7 @@ hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE',' 'PARSHA_Z_CNLFPFT','PARSUN_Z_CAN','PARSHA_Z_CAN','LAISUN_Z_CNLF','LAISHA_Z_CNLF','LAISUN_Z_CNLFPFT','LAISHA_Z_CNLFPFT', 'LAISUN_TOP_CAN','LAISHA_TOP_CAN','FABD_SUN_CNLFPFT','FABD_SHA_CNLFPFT','FABI_SUN_CNLFPFT','FABI_SHA_CNLFPFT', 'FABD_SUN_CNLF','FABD_SHA_CNLF','FABI_SUN_CNLF','FABI_SHA_CNLF','FABD_SUN_TOPLF_BYCANLAYER','FABD_SHA_TOPLF_BYCANLAYER', - 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','TS_NET_UPTAKE_CNLF','YEAR_NET_UPTAKE_CNLF','CROWNAREA_CNLF', + 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','NET_C_UPTAKE_CNLF','CROWNAREA_CNLF', 'MORTALITY_CARBONFLUX_CANOPY','MORTALITY_CARBONFLUX_UNDERSTORY','NPLANT_SCAG','NPLANT_CANOPY_SCAG','NPLANT_UNDERSTORY_SCAG', 'DDBH_CANOPY_SCAG','DDBH_UNDERSTORY_SCAG','MORTALITY_CANOPY_SCAG','MORTALITY_UNDERSTORY_SCAG','GPP_SCPF','GPP_CANOPY_SCPF', 'AR_CANOPY_SCPF','GPP_UNDERSTORY_SCPF','AR_UNDERSTORY_SCPF','NPP_SCPF','NPP_LEAF_SCPF','NPP_SEED_SCPF','NPP_FNRT_SCPF', diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods index 4c7aa0f2b4..1f2c03aebe 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods @@ -1 +1 @@ -../Fates +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods index 4c7aa0f2b4..1f2c03aebe 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods @@ -1 +1 @@ -../Fates +../FatesColdDef diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods index 4c7aa0f2b4..1f2c03aebe 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods @@ -1 +1 @@ -../Fates +../FatesColdDef From d84d88d76bfaf124367a32dc5aaa2451c0d6cbb6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 21 May 2018 17:49:39 -0600 Subject: [PATCH 177/730] Removing finidat files from fates logging test --- .../testdefs/testmods_dirs/clm/FatesLogging/include_user_mods | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods index 4c7aa0f2b4..1f2c03aebe 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods @@ -1 +1 @@ -../Fates +../FatesColdDef From d2aec8513275cd081b8f2edf3d041563e2607036 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 22 May 2018 16:06:49 -0700 Subject: [PATCH 178/730] compatibility fix for variable soil depth and fates hydro --- src/utils/clmfates_interfaceMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 343c51fb10..7ef57f4633 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -107,7 +107,6 @@ module CLMFatesInterfaceMod use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type - use FatesHydraulicsMemMod , only : nlevsoi_hyd use FatesInterfaceMod , only : hlm_numlevgrnd use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site @@ -467,8 +466,9 @@ subroutine init(this, bounds_proc ) call this%init_soil_depths(nc) - if (use_fates_planthydro) call InitHydrSites(this%fates(nc)%sites) - + if (use_fates_planthydro) then + call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in) + end if if( this%fates(nc)%nsites == 0 ) then write(iulog,*) 'Clump ',nc,' had no valid FATES sites' From 7f5e785a478b9a665f55cd3472204819573af6ea Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 22 May 2018 21:02:20 -0600 Subject: [PATCH 179/730] Updated bounding array on plant-hydraulics interface. --- src/utils/clmfates_interfaceMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index cd40c53ebc..c74f0296b7 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -2199,6 +2199,7 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & integer :: l integer :: nc integer :: num_filter_fates + integer :: nlevsoil if( .not. use_fates_planthydro ) return @@ -2223,7 +2224,8 @@ subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) - waterflux_inst%qflx_rootsoi_col(c,1:nlevsoi) = this%fates(nc)%bc_out(s)%qflx_soil2root_sisl(1:nlevsoi) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + waterflux_inst%qflx_rootsoi_col(c,1:nlevsoil) = this%fates(nc)%bc_out(s)%qflx_soil2root_sisl(1:nlevsoil) end do end subroutine ComputeRootSoilFlux From e9b7b689d432c4eafd592139216a8e77bdb4a29e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 25 May 2018 11:55:56 -0700 Subject: [PATCH 180/730] Updating fates external to sci.1.14.0_api.4.0.0 --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index d9b14d300d..a5da56b1eb 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.13.0_api.3.2.0 +tag = sci.1.14.0_api.4.0.0 required = True [PTCLM] From 8eb90b1dcdd43a2b967ddc897ec6a1848547eaa3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 31 May 2018 15:00:04 -0600 Subject: [PATCH 181/730] Changed a 1.0 r4 to r8 --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index c74f0296b7..0b9f6fd05b 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -842,7 +842,7 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! Set the bareground patch indicator patch%is_bareground(col%patchi(c)) = .true. npatch = this%fates(nc)%sites(s)%youngest_patch%patchno - patch%wt_ed(col%patchi(c)) = 1.0-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch)) + patch%wt_ed(col%patchi(c)) = 1.0_r8-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch)) if(sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))>1.0_r8)then write(iulog,*)'Projected Canopy Area of all FATES patches' From f1cbb8a0c46f93a1dbfe2407d3f760dc1d05f69d Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 5 Jun 2018 14:45:52 -0600 Subject: [PATCH 182/730] Fixed some MOSART chapter typos --- .../MOSART/CLM50_Tech_Note_MOSART.rst | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst index eabdb50763..e9f07d7752 100644 --- a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -11,9 +11,9 @@ Overview MOSART is a river transport model designed for applications across local, regional and global scales :ref:`(Li et al., 2013b) `. A major purpose of MOSART is to provide freshwater input for the ocean -model in coupled Earth system model. MOSART also provides an effective +model in coupled Earth System Models. MOSART also provides an effective way of evaluating and diagnosing the soil hydrology simulated by land -surface models through direction comparison of the simulated river flow +surface models through direct comparison of the simulated river flow with observations of natural streamflow at gauging stations :ref:`(Li et al., 2015a)`. Moreover, MOSART provides a modeling framework for representing riverine transport and transformation @@ -28,9 +28,9 @@ Routing Processes MOSART divides each spatial unit such as a lat/lon grid or watershed into three categories of hydrologic units (as shown in :numref:`Figure MOSART conceptual diagram`): hillslopes -that contribute both surface and subsurface runoff into tributaries, +that convert both surface and subsurface runoff into tributaries, tributaries that discharge into a single main channel, and the main channel -connects the local spatial unit with upstream/downstream units through the +that connects the local spatial unit with upstream/downstream units through the river network. MOSART assumes that all the tributaries within a spatial unit can be treated as a single hypothetical sub-network channel with a transport capacity equivalent to all the tributaries combined. Correspondingly, three @@ -50,14 +50,14 @@ and discharges the water to its downstream spatial unit or the ocean. :height: 400px -MOSART only route positive runoff, although negative runoff could be generated +MOSART only routes positive runoff, although negative runoff can be generated occasionally by the land model (e.g., :math:`q_{gwl}`). Negative runoff in any runoff component including :math:`q_{sur}`, :math:`q_{sub}`, :math:`q_{gwl}` is not routed through MOSART, but instead is mapped directly from the spatial unit where it is generated at any time step to the coupler. In MOSART, the travel velocities of water across hillslopes, sub-network and main -channel are all estimated using the Manning’s equation with different levels of +channel are all estimated using Manning’s equation with different levels of simplifications. Generally the Manning’s equation is in the form of .. math:: @@ -65,9 +65,9 @@ simplifications. Generally the Manning’s equation is in the form of V = \frac{R^{\frac{2}{3}} S_{f}}{n} -where :math: `V` is the travel velocity (m s :sup:`-1` ), :math:`R` is the hydraulic -radius (m). :math:`S_{f}` is the friction slope, and accounting for the effects -of gravity, friction, inertia and other forces onthe water. If the channel slope +where :math:`V` is the travel velocity (m s :sup:`-1` ), :math:`R` is the hydraulic +radius (m). :math:`S_{f}` is the friction slope that accounts for the effects +of gravity, friction, inertia and other forces on the water. If the channel slope is steep enough, the gravity force dominates over the others so one can approximate :math:`S_{f}` by the channel bed slope :math:`S` , which is the key assumption underpinning the kinematic wave method. :math:`n` is the Manning’s roughness @@ -97,7 +97,7 @@ For the main channel, the hydraulic radius is given by where :math:`A_{r}` (m :sup:`2` ) is the wetted area defined as the part of the channel cross-section area below the water surface, :math:`P_{r}` (m) is the -wetted perimeter (m), the perimeter confines in the wetted area. +wetted perimeter, the perimeter confined in the wetted area. For hillslopes, sub-network and main channels, a common continuity equation can be written as @@ -134,14 +134,14 @@ scheme and a local time-stepping algorithm. There are two levels of subcycling. For convenience, we denote :math:`T_{inputs}` (s), :math:`T_{mosart}` (s), :math:`T_{hillslope}` (s) and :math:`T_{channel}` (s) as the time steps of runoff inputs (from CLM -to MOSART via the flux coupler), MOSART routing, hillslope routing and -channel routing respectively. The first level of subcycling is between +to MOSART via the flux coupler), MOSART routing, hillslope routing, and +channel routing, respectively. The first level of subcycling is between the runoff inputs and MOSART routing. If :math:`T_{inputs}` is 10800s and :math:`T_{mosart}` is 3600s, three MOSART time steps will be invoked each time the runoff inputs are updated. The second level of subcycling is between the hillslope routing and channel routing. This is to account for the fact that the travel velocity of water across -hillslope is usually much slower than that in the channels. +hillslopes is usually much slower than that in the channels. :math:`T_{hillslope}` is usually set as the same as :math:`T_{mosart}`, but within each time step of hillslope routing there are a few time steps for channel routing, i.e., @@ -154,7 +154,7 @@ step of local channel routing is given as :math:`T_{local}=T_{channel}/D_{local}`. :math:`D_{local}` is currently estimated empirically as a function of local channel slope, width, length and upstream drainage area. If MOSART crashes due to a -numerical issue, we recommend to increase :math:`D_{levelH2R}` and, if +numerical issue, we recommend increasing :math:`D_{levelH2R}` and, if the issue remains, reducing :math:`T_{mosart}`. .. _Parameters and Input Data: @@ -165,7 +165,7 @@ Parameters and Input Data MOSART is supported by a comprehensive, global hydrography dataset at 0.5 :sup:`o` resolution. As such, the fundamental spatial unit of MOSART is a 0.5 :sup:`o` lat/lon grid. The topographic parameters (such as flow direction, -channel length, topographic and channel slopes etc.) were derived using the +channel length, topographic and channel slopes, etc.) were derived using the Dominant River Tracing (DRT) algorithm (:ref:`Wu et al., 2011` ; :ref:`Wu et al. 2012 `). The DRT algorithm produces the topographic parameters in a scale-consistent way to preserve/upscale the key features of @@ -183,7 +183,7 @@ on the methodology to derive channel geometry and the Manning’s roughness coefficients, please refer to :ref:`Getirana et al. (2012) ` . The full list of parameters included in this global hydrography dataset is provided in -the :numref:`Table MOSART Parameters`. Evaluation of global simulations +:numref:`Table MOSART Parameters`. Evaluation of global simulations by MOSART using the aforementioned parameters is described in :ref:`Li et al. (2015b) ` . @@ -231,16 +231,16 @@ river routing, whilst in CLM5.0, MOSART is an added option for river routing based on the more physically-based kinematic wave method. 2. Runoff treatment: In RTM runoff is routed regardless of its sign so -negative streamflow can be simulated at times. MOSART routes only nonnegative +negative streamflow can be simulated at times. MOSART routes only non-negative runoff and always produces positive streamflow, which is important for -future extension for modeling riverine heat and biogeochemical fluxes. +future extensions to model riverine heat and biogeochemical fluxes. -3. Input parameters: RTM in CLM4.5 only requires one layer of spatial variable -of channel velocity, whilst MOSART in CLM5.0 requires 13 parameters that +3. Input parameters: RTM in CLM4.5 only requires one layer of a spatially varying +variable of channel velocity, whilst MOSART in CLM5.0 requires 13 parameters that are all available globally at 0.5 :sup:`o` resolution. 4. Outputs: RTM only produces streamflow simulation, whilst MOSART -additionally simulates the time-varying channel velocities and channel -water depth and channel surface water variation. +additionally simulates the time-varying channel velocities, channel water depth, and +channel surface water variations. From fdce2b224b9274d3388ad9f2e8f7e1d58439e709 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 6 Jun 2018 16:44:20 -0600 Subject: [PATCH 183/730] Protected fates calculation of bare-soil area to not go below 0 --- src/utils/clmfates_interfaceMod.F90 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 16bbaea573..18b0d5ca53 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -842,7 +842,15 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! Set the bareground patch indicator patch%is_bareground(col%patchi(c)) = .true. npatch = this%fates(nc)%sites(s)%youngest_patch%patchno - patch%wt_ed(col%patchi(c)) = 1.0_r8-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch)) + + ! Precision errors on the canopy_fraction_pa sum, even small (e-12) + ! do exist, and can create potentially negetive bare-soil fractions + ! (ie -1e-12 or smaller). Even though this is effectively zero, + ! it can generate weird logic scenarios in the ctsm/elm code, so we + ! protext it here with a lower bound of 0.0_r8. + + patch%wt_ed(col%patchi(c)) = max(0.0_r8, & + 1.0_r8-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))) if(sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))>1.0_r8)then write(iulog,*)'Projected Canopy Area of all FATES patches' From cf94e258ff1321ae78a0331479beecc1aa14afd5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Jun 2018 23:02:13 -0600 Subject: [PATCH 184/730] Include README file directly, rather than repeat it --- .../users_guide/overview/quickstart.rst | 80 +------------------ 1 file changed, 1 insertion(+), 79 deletions(-) diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index f6784da2ef..93c9b5b7cd 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -32,83 +32,5 @@ The ChangeLog/ChangeSum talk about advances in different versions of CLM. The co Note other directories have README files that explain different components and tools used when running CLM and are useful in understanding how those parts of the model work and should be consulted when using tools in those directories. For more details on configuring and customizing a case with CLM see `Chapter 1 `_. The Quickstart.GUIDE (which can be found in ``models/lnd/clm/doc``) is repeated here. -:: - - Quick-Start to Using cpl7 Scripts for clm4_5 - - Assumptions: You want to use yellowstone with clm4_5 BGC - to do a clm simulation with data atmosphere and the - latest CRUNCEP atm forcing files and settings. You also want to cycle - the CRUNCEP atm data between 1901 to 1920 and you want to run at - 0.9x1.25 degree resolution. - - Process: - - # Create the case - - cd scripts - - ./create_newcase -case -mach yellowstone_intel -res f09_g16 -compset I1850CRUCLM45BGC - (./create_newcase -help -- to get help on the script) - - # Setup the case - - cd - ./xmlchange id1=val1,id2=val2 # to make changes to any settings in the env_*.xml files - ./cesm_setup - (./cesm_setup -help -- to get help on the script, this creates the ./.run \ - script) - - # Add any namelist changes to the user_nl_* files - - $EDITOR user_nl_* - - # Compile the code - - ./.build - - # Submit the run - - ./.submit - -Information on Compsets: - - "I" compsets are the ones with clm and datm7 without ice and ocean. They - specify either CLM4.0 physics or CLM4.5 physics. - Most of the "I" compsets for CLM4.0 use the CLM_QIAN data with solar following - the cosine of solar zenith angle, precipitation constant, and other - variables linear interpolated in time (and with appropriate time-stamps on - the date). Useful "I" compsets for CLM4.5 use the CRUNCEP data in place - of the CLM_QIAN data. - - To list all the compsets use: - ./create_newcase -list compsets - - Some of the CLM4.5 I compsets are: - - Alias Description - 1850CRUCLM45 CLM4.5 to simulate year=1850 with CLMN45SP (Satellite Phenology) - I1850CRUCLM45BGC CLM4.5 to simulate year=1850 with CLM45BGC biogeophysics model (BGC) - I20TRCRUCLM45BGC CLM4.5 with BGC on with transient PFT over 1850-2000 - - While some of the CLM4 I compsets are: - - Alias Description - ICN CLM4.0 to simulate year=2000 with Carbon-Nitrogen BGC model (CN) - I1850CN CLM4.0 to simulate year=1850 with Carbon-Nitrogen BGC model (CN) - I20TRCN CLM4.0 with CN on with transient PFT over 1850-2000 - IRCP26CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=2.6 scenario - IRCP45CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=4.5 scenario - IRCP60CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=6.0 scenario - IRCP85CN CLM4.0 with CN on with transient PFT over 1850-2100 for RCP=8.5 scenario - -Automatically resubmitting jobs: - - After doing a short simulation that you believe is correct - - ./xmlchange CONTINUE_RUN=TRUE - - # Change RESUBMIT to number greater than 0, and CONTINUE_RUN to TRUE... - - ./.submit +.. include:: ../../clm5.0/doc/Quickstart.GUIDE From 94a19acc63557a8eb395e35372bc20cf5ba04697 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 10:17:33 -0600 Subject: [PATCH 185/730] Add a top level README file. Setup version and release in configure files. Start using versiona and release. Rather than repeat README text files, actually include them from a clm5.0 checkout, so the updated version from the code can be used. --- doc/source/conf.py | 10 +- doc/source/tech_note/conf.py | 6 +- doc/source/users_guide/conf.py | 14 +- doc/source/users_guide/index.rst | 3 +- .../users_guide/overview/introduction.rst | 10 +- .../users_guide/overview/quickstart.rst | 1 + doc/source/users_guide/testing/index.rst | 3 +- .../building-the-clm-tools.rst | 54 +-- .../creating-surface-datasets.rst | 313 +----------------- .../users_guide/using-clm-tools/index.rst | 1 + 10 files changed, 35 insertions(+), 380 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5c5b1d86ad..a573b2a1d0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -59,9 +59,9 @@ # built documents. # # The short X.Y version. -version = u'' +version = u'clm5.0' # The full version, including alpha/beta/rc tags. -release = u'' +release = u'release-clm5.0.01' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -73,7 +73,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = [] +exclude_patterns = [ + "clm5.0/manage_externals", + "**/README_EXTERNALS.rst", + "clm5.0/README.rst" +] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' diff --git a/doc/source/tech_note/conf.py b/doc/source/tech_note/conf.py index 5c5b1d86ad..a1827c71c5 100644 --- a/doc/source/tech_note/conf.py +++ b/doc/source/tech_note/conf.py @@ -73,7 +73,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = [] +exclude_patterns = [ + "manage_externals/*", + "README_EXTERNALS.rst", + "clm5.0//README.rs" +] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index 5c5b1d86ad..c717685979 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -51,17 +51,17 @@ # General information about the project. project = u'clmdoc' -copyright = u'2017, Erik Kluzek, Bill Sacks, Ben Andre' -author = u'Erik Kluzek, Bill Sacks, Ben Andre' +copyright = u'2018, Erik Kluzek, Bill Sacks, Ben Andre, Alice Bertini' +author = u'Erik Kluzek, Bill Sacks, Ben Andre, Alice Bertini' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = u'' +version = u'clm5.0' # The full version, including alpha/beta/rc tags. -release = u'' +release = u'release-clm5.0.01' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -73,7 +73,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path -exclude_patterns = [] +exclude_patterns = [ + "clm5.0/manage_externals", + "**/README_EXTERNALS.rst", + "clm5.0/README.rst" +] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index bdb52253a1..f3160a30ed 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -6,7 +6,7 @@ .. _users-guide: ##################################### -CLM User's Guide +|version| User's Guide ##################################### .. toctree:: @@ -20,3 +20,4 @@ CLM User's Guide running-single-points/index.rst running-PTCLM/index.rst trouble-shooting/index.rst + testing/index.rst diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index d6c5781a17..80b2b1e0c3 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -1,6 +1,6 @@ .. _introduction: -**User's Guide to version 5.0 of the Community Land Model (CLM)** +**User's Guide to version +|version| of the Community Land Model (CLM)** **Authors: Benjamin Andre, Erik Kluzek, William Sacks** @@ -20,18 +20,18 @@ P. O. Box 3000, Boulder, Colorado 80307-300 Introduction ============== -The Community Land Model (CLM5.0 in CESM2.0) is the latest in a -series of global land models developed by t he CESM Land Model Working +The Community Land Model (+|release| in CESM2.0) is the latest in a +series of global land models developed by the CESM Land Model Working Group (LMWG) and maintained at the National Center for Atmospheric Research (NCAR). This guide is intended to instruct both the novice and experienced user on running CLM. This guide pertains to the latest -version CLM5.0 in CESM2.0 available for download from the public +version +|version| in CESM2.0 available for download from the public release subversion repository as a part of CESM1.2.0. Documentation may be different if you are using an older version, you should either use the documentation for that release version, update to the latest version, or use the documentation inside your own source tree. There is information in the ChangeLog file and in the `What is new with -CLM5.0 in CESM2.0 since previous public releases? `_ ++|version| in CESM2.0 since previous public releases? `_ regarding the changes from previous versions of CESM. .. note:: This release of CLM5.0 in CESM1.2.0 includes BOTH CLM4.0 diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index 93c9b5b7cd..edcd0bc2fe 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -34,3 +34,4 @@ Note other directories have README files that explain different components and t The Quickstart.GUIDE (which can be found in ``models/lnd/clm/doc``) is repeated here. .. include:: ../../clm5.0/doc/Quickstart.GUIDE + :literal: diff --git a/doc/source/users_guide/testing/index.rst b/doc/source/users_guide/testing/index.rst index 18c418fca4..09575a1442 100644 --- a/doc/source/users_guide/testing/index.rst +++ b/doc/source/users_guide/testing/index.rst @@ -3,7 +3,7 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -.. _testing: +.. _testing_section: ##################################### Testing @@ -11,7 +11,6 @@ Testing .. toctree:: :maxdepth: 2 - :numbered: testing.rst diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index c2633e6522..ec626641e5 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -107,56 +107,6 @@ More details on each environment variable. .. note:: There are several files that are copies of the original files from either models``/lnd/clm/src/util_share``, ``models/csm_share/shr``, or copies from other tool directories. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. The *README.filecopies* (which can be found in ``models/lnd/clm/tools``) is repeated here. -:: - - models/lnd/clm/tools/README.filecopies Jun/04/2013 - - There are several files that are copies of the original files from - either models/lnd/clm/src/main, models/csm_share/shr, - models/csm_share/unit_testers, or copies from other tool - directories. By having copies the tools can all be made stand-alone, - but any changes to the originals will have to be put into the tool - directories as well. - - I. Files that are IDENTICAL: - - 1. csm_share files copied that should be identical to models/csm_share/shr: - - shr_const_mod.F90 - shr_log_mod.F90 - shr_timer_mod.F90 - - 2. csm_share files copied that should be identical to models/csm_share/unit_testers: - - test_mod.F90 - - 3. clm/src files copied that should be identical to models/lnd/clm/src/util_share: - - nanMod.F90 - - II. Files with differences - - 1. csm_share files copied with differences: - - shr_kind_mod.F90 --- SHR_KIND_CXX is new - shr_sys_mod.F90 ---- Remove mpi abort and reference to shr_mpi_mod.F90. - shr_infnan_mod.F90 - Earlier version - shr_string_mod.F90 - Earlier version - shr_file_mod.F90 --- mkprocdata_map version is stripped down - clm_varctl.F90 ----- Earlier version - - 2. clm/src files with differences: - - fileutils.F90 --- Remove use of masterproc and spmdMod and endrun in abortutils. - - 4. Files in mkmapgrids - - domainMod.F90 ---- Highly customized based off an earlier version of clm code. - Remove use of abortutils, spmdMod. clm version uses latlon - this version uses domain in names. Distributed memory - parallelism is removed. - - 5. Files in mksurfdata_map - - mkvarpar.F90 --- clm4_0 and clm4_5 versions are different and different from main clm versions. +.. include:: ../../clm5.0/tools/README.filecopies + :literal: diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index e42a46f81f..d1ab21e2b7 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -61,316 +61,7 @@ Creating a Complete Set of Files for Input to CLM The last optional thing to do is to enter the new datasets into the build-namelist XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. The ``models/lnd/clm/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: -:: - models/lnd/clm/tools/README Jun/04/2013 - - CLM tools for analysis of CLM history files -- or for creation or - modification of CLM input files. - - I. General directory structure: - - clm4_0 - mksurfdata_map --- Create surface datasets. - interpinic ------- Interpolate initial datasets to a different resolution. - (has optimized and OMP options) - clm4_5 - mksurfdata_map --- Create surface datasets. - interpinic ------- Interpolate initial datasets to a different resolution. - (has optimized and OMP options) - - shared - mkmapgrids ------- Create SCRIP grid files needed by mkmapdata - [input is CLM grid files] - (deprecated) - mkmapdata -------- Create SCRIP mapping data from SCRIP grid files (uses ESMF) - gen_domain ------- Create data model domain datasets from SCRIP mapping datasets. - (also in the top level mapping directory [../../../../tools/mapping]) - mkprocdata_map --- Convert output unstructured grids into a 2D format that - can be plotted easily - ncl_scripts ------ NCL post or pre processing scripts. - - - Note that there are different versions of mksurfdata_map and interpinic for - CLM4.0 vs. CLM4.5. Other tools are shared between the two model - versions. - - However, note that mkmapdata makes mapping files for CLM4.5 by default; to - make mapping files for CLM4.0, run the tool with the option: - -p clm4_0 - - II. Notes on building/running for each of the above tools: - - Each tool that has FORTRAN source code has the following files: - - README -------------- Specific help for using the specific tool and help on specific - files in that directory. - src/Filepath -------- List of directories needed to build the tool - (some files in ../src directories are required). - src/Makefile -------- Customization of the make for the particular tool in question - src/Makefile.common - General GNU Makefile for creating FORTRAN tools - (these are identical between tools). - src/Srcfiles -------- List of source files that are needed. - src/Mkdepends ------- Dependency generator program - - mkmapdata and ncl_scripts only contain scripts so don't have the above build files. - - Most tools have copies of files from other directories -- see the README.filecopies - file for more information on this. - - Tools may also have files with the directory name followed by: namelist, or runoptions. - - .namelist ------ Namelist to create a global file. - .runoptions ---- Command line options to use the given tool. - - These files are also used by the test scripts to test the tools (see the - README.testing) file. - - NOTE: Be sure to change the path of the datasets references by these namelists to - point to where you have exported your CESM inputdata datasets. - - To build: - - cd - setenv INC_NETCDF - setenv LIB_NETCDF - gmake - - The process will create a file called "Depends" which has the dependencies - for the build of each file on other files. - - By default some codes may be compiled non-optimized - so that you can use the debugger, and with bounds-checking, and float trapping on. - To speed up do the following... - - gmake OPT=TRUE (by default already on for interpinic and mksurfdata_map) - - Also some of the tools allow for OpenMP shared memory parallelism - (such as interpinic) with - - gmake SMP=TRUE - - To run a program with a namelist: - - ./program < namelist - - To get help on running a program with command line options (e.g., interpinic): - - ./program - - To run a program built with SMP=TRUE: - - setenv OMP_NUM_THREADS= - - run normally as above - - III. Process sequence to create input datasets needed to run CLM - - NOTE: The following assumes you want to create files for CLM4.5. If you want to - use CLM4.0, you will need to do the following: - - In the following commands, change references to the clm4_5 directory to clm4_0 - - Add the option '-p clm4_0' to the mkmapdata.sh command. - - 1.) Create SCRIP grid files (if needed) - - a.) For standard resolutions these files will already be created. (done) - - b.) To create regular lat-lon regional/single-point grids run mknoocnmap.pl - - This will create both SCRIP grid files and a mapping file that will - be valid if the region includes NO ocean whatsoever (so you can skip step 2). - You can also use this script to create SCRIP grid files for a region - (or even a global grid) that DOES include ocean if you use step 2 to - create mapping files for it (simply discard the non-ocean map created by - this script). - - Example, for single-point over Boulder Colorado. - - cd shared/mkmapdata - ./mknoocnmap.pl -p 40,255 -n 1x1_boulderCO - - c.) General case - - You'll need to convert or create SCRIP grid files on your own (using scripts - or other tools) for the general case where you have an unstructured grid, or - a grid that is not regular in latitude and longitude. - - example format - ================== - netcdf fv1.9x2.5_090205 { - dimensions: - grid_size = 13824 ; - grid_corners = 4 ; - grid_rank = 2 ; - variables: - double grid_center_lat(grid_size) ; - grid_center_lat:units = "degrees" ; - double grid_center_lon(grid_size) ; - grid_center_lon:units = "degrees" ; - double grid_corner_lat(grid_size, grid_corners) ; - grid_corner_lat:units = "degrees" ; - double grid_corner_lon(grid_size, grid_corners) ; - grid_corner_lon:units = "degrees" ; - int grid_dims(grid_rank) ; - int grid_imask(grid_size) ; - grid_imask:units = "unitless" ; - - 2.) Create ocean to atmosphere mapping file (if needed) - - a.) Standard resolutions (done) - - If this is a standard resolution with a standard ocean resolution -- this - step is already done, the files already exist. - - b.) Region without Ocean (done in step 1.b) - - IF YOU RAN mknoocnmap.pl FOR A REGION WITHOUT OCEAN THIS STEP IS ALREADY DONE. - - c.) New atmosphere or ocean resolution - - If the region DOES include ocean, use gen_domain to create a - mapping file for it. - - Example: - - cd ../../../../tools/mapping/gen_domain_files/src - ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME - - - 3.) Add SCRIP grid file(s) created in (1) into XML database in CLM (optional) - - See the "Adding New Resolutions or New Files to the build-namelist Database" - Chapter in the CLM User's Guide - - http://www.cesm.ucar.edu/models/cesm1.0/clm/models/lnd/clm/doc/UsersGuide/book1.html - - If you don't do this step, you'll need to specify the file to mkmapdata - in step (3) using the "-f" option. - - 4.) Create mapping files for use by mksurfdata_map with mkmapdata - (See mkmapdata/README for more help on doing this) - - - this step uses the results of (1) that were entered into the XML database - by step (3). If you don't enter datasets in, you need to specify the - SCRIP grid file using the "-f" option to mkmapdata.sh. - - - note that mkmapdata generates maps for CLM4.5 by default; to generate - mapping files for CLM4.0, add the option '-p clm4_0' - - Example: to generate all necessary mapping files for the ne30np4 grid - - cd shared/mkmapdata - ./mkmapdata.sh -r ne30np4 - - 5.) Add mapping file(s) created in step (4) into XML database in CLM (optional) - - See notes on doing this in step (3) above. - Edit ../bld/namelist_files/namelist_defaults_clm.xml to incorporate new - mapping files. - - If you don't do this step, you'll need to specify the grid resolution name - and file creation dates to mksurfdata_map in step (5) below. - - 6.) Convert map of ocean to atm for use by DATM and CLM with gen_domain - (See tools/mapping/README for more help on doing this) - - - gen_domain uses the map from step (2) (or previously created CESM maps) - - Example: - - cd ../../../../tools/mapping/gen_domain_files/src - gmake - cd .. - setenv CDATE 090206 - setenv OCNGRIDNAME gx1v6 - setenv ATMGRIDNAME fv1.9x2.5 - setenv MAPFILE $CSMDATA/cpl/cpl6/map_${OCNGRIDNAME}_to_${ATMGRIDNAME}_aave_da_${CDATE}.nc - ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME - - Normally for I compsets running CLM only you will discard the ocean domain - file, and only use the atmosphere domain file for datm and as the fatmlndfrc - file for CLM. Output domain files will be named according to the input OCN/LND - gridnames. - - 7.) Create surface datasets with mksurfdata_map - (See mksurfdata_map/README for more help on doing this) - - - Run clm4_5/mksurfdata_map/mksurfdata.pl - - This step uses the results of step (4) entered into the XML database - in step (5). - - If datasets were NOT entered into the XML database, set the resolution - to "usrspec" and use the "-usr_gname", and "-usr_gdate" options. - - Example: for 0.9x1.25 resolution - - cd clm4_5/mksurfdata_map/src - gmake - cd .. - ./mksurfdata.pl -r 0.9x1.25 - - NOTE that surface dataset will be used by default for fatmgrid - and it will - contain the lat,lon,edges and area values for the atm grid - ASSUMING that - the atm and land grid are the same - - 8.) Interpolate initial conditions using interpinic (optional) - (See interpinic/README for more help on doing this) - IMPORTANT NOTE on interpinic!!!:: BE SURE TO USE NetCDF4.3 WHEN BUILDING! - If your template file was written using pnetcdf -- interpinic will corrupt - the resulting file and make it unusable! - - 9.) Add new files to XML data or using user_nl_clm (optional) - - See notes on doing this in step (3) above. - - IV. Example of creating single-point datasets without entering into XML database. - - Here we apply the process described in III. for a single-point dataset - where we don't enter the datasets into the XML database (thus skipping - steps 3, 5 and 9), but use the needed command line options to specify where the - files are. This also skips step (2) since step 1 creates the needed mapping file. - We also skip step (8) and do NOT create a finidat file. - - 0.) Set name of grid to use and the creation date to be used later... - setenv GRIDNAME 1x1_boulderCO - setenv CDATE `date +%y%m%d` - 1.) SCRIP grid and atm to ocn mapping file - cd shared/mkmapdata - ./mknoocnmap.pl -p 40,255 -n $GRIDNAME - # Set pointer to MAPFILE that will be used in step (6) - setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc - cd ../.. - 2.) skip - 3.) skip - 4.) Mapping files needed for mksurfdata_map - cd shared/mkmapdata - setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc - ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional - cd .. - 5.) skip - 6.) Generate domain file for datm and CLM - cd ../../../../tools/mapping/gen_domain_files/src - gmake - cd .. - setenv OCNDOM domain.ocn_noocean.nc - setenv ATMDOM domain.lnd.{$GRIDNAME}_noocean.nc - ./gen_domain -m $MAPFILE -o $OCNDOM -l $ATMDOM - cd ../../../../lnd/clm/tools - 7.) Create surface dataset for CLM - cd clm4_5/mksurfdata_map/src - gmake - cd .. - ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE - 8.) skip - 9.) skip - - V. Notes on which input datasets are needed for CLM - - global or regional/single-point grids - - need fsurdata and fatmlndfrc - - fsurdata ---- from mksurfdata_map in step (III.7) - fatmlndfrc -- use the domain.lnd file from gen_domain in step (III.6) - (NOTE: THIS FILE IS POINTED TO USING ATM_DOMAIN_PATH/ATM_DOMAIN_FILE/LND_DOMAIN_PATH/ \ - LND_DOMAIN_FILE - env_run.xml variables -- do NOT simply add this to your user_nl_clm as it will fail) +.. include:: ../../clm5.0/tools/README + :literal: diff --git a/doc/source/users_guide/using-clm-tools/index.rst b/doc/source/users_guide/using-clm-tools/index.rst index 583122cdcd..030cda7495 100644 --- a/doc/source/users_guide/using-clm-tools/index.rst +++ b/doc/source/users_guide/using-clm-tools/index.rst @@ -18,4 +18,5 @@ Using CLM tools creating-surface-datasets.rst datasts-for-observational-sites.rst creating-domain-files.rst + observational-sites-datasets.rst cprnc.rst From 173d208bc79f5962bee2a39011540037c20d22c1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 13:00:26 -0600 Subject: [PATCH 186/730] Change some of the hardcoded versions into using the variable --- doc/source/users_guide/conf.py | 2 ++ doc/source/users_guide/overview/getting-help.rst | 6 +++--- doc/source/users_guide/overview/introduction.rst | 11 ++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index c717685979..0294e7cef8 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -63,6 +63,8 @@ # The full version, including alpha/beta/rc tags. release = u'release-clm5.0.01' +cesmrelease = u'release-cesm2.0.00' + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index 8d45c71bcb..5f9c63ab26 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -8,10 +8,10 @@ In addition to this users-guide there are several other resources that are avail --------------------------- The CESM User's-Guide --------------------------- ++|release| ++|release| in +|cesmrelease| is always run from within the standard +|cesmrelease| build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the +|cesmrelease| scripts and understand how to work with them. User's-Guide documentation on the +|cesmrelease| scripts are available from the following web-page. The purpose of this +|version| in +|cesmrelease| User's Guide is to give the +|version| user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the +|cesmrelease| Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. -CLM5.0 in CESM2.0 is always run from within the standard CESM2.0 build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the CESM1.2.0 scripts and understand how to work with them. User's-Guide documentation on the CESM1.2.0 scripts are available from the following web-page. The purpose of this CLM4.5 in CESM1.2.0 User's Guide is to give the CLM4.5 user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the CESM1.2.0 Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. - -`cesmrel; Scripts User's-Guide (http://www.cesm.ucar.edu/models/cesm1.2/cesm/doc/usersguide/book1.html) `_ +`+|cesmrelease| Quickstart Guide `_ ----------------------- The CESM Bulletin Board diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 80b2b1e0c3..02e6237e2b 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -20,18 +20,18 @@ P. O. Box 3000, Boulder, Colorado 80307-300 Introduction ============== -The Community Land Model (+|release| in CESM2.0) is the latest in a +The Community Land Model (+|release| in +|cesmrelease|) is the latest in a series of global land models developed by the CESM Land Model Working Group (LMWG) and maintained at the National Center for Atmospheric Research (NCAR). This guide is intended to instruct both the novice and experienced user on running CLM. This guide pertains to the latest -version +|version| in CESM2.0 available for download from the public +version +|version| in +|cesmrelease| available for download from the public release subversion repository as a part of CESM1.2.0. Documentation may be different if you are using an older version, you should either use the documentation for that release version, update to the latest version, or use the documentation inside your own source tree. There is information in the ChangeLog file and in the `What is new with -+|version| in CESM2.0 since previous public releases? `_ ++|version| in +|cesmrelease| since previous public releases? `_ regarding the changes from previous versions of CESM. .. note:: This release of CLM5.0 in CESM1.2.0 includes BOTH CLM4.0 @@ -79,12 +79,13 @@ and then finally do it by hand. If you are using non supported machines you may also want to use the test scripts to make sure your machine is working correctly. -.. _what-is-new-with-clm4.5: +.. _what-is-new-with-+|version|: ========================= - What is New with CLM4.5 + What is New with +|version| ========================= +`What's new with +|version| science `_ The CESM1.2.0 `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. More details are given in the `CLM ChangeLog file `_. From bc6fa69978dcbdfa173ee8a1469c2d4359080f41 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 14:26:05 -0600 Subject: [PATCH 187/730] Run the sed script to make a bunch of global changes --- ...w-Files-to-the-build-namelist-Database.rst | 4 +- .../CLM-3.1-Managing-Your-Own-Data-files.rst | 4 +- .../CLM-3.2-Adding-Resolution-Names.rst | 4 +- ...3-Adding-or-Changing-Default-Filenames.rst | 8 +- .../users_guide/overview/getting-help.rst | 40 ++++----- .../users_guide/overview/introduction.rst | 84 +++++++++---------- .../users_guide/overview/quickstart.rst | 18 ++-- .../overview/scientific_validation.rst | 18 ++-- .../running-PTCLM/adding-ptclm-site-data.rst | 2 +- .../running-PTCLM/introduction-to-ptclm.rst | 10 +-- .../running-PTCLM/ptclm-examples.rst | 6 +- .../users_guide/running-PTCLM/using-ptclm.rst | 10 +-- .../running-pts_mode-configurations.rst | 6 +- .../running-single-point-configurations.rst | 18 ++-- ...CLM4.5-biogeochemistry-(CLMBGC-spinup).rst | 18 ++-- ...tmospheric-forcing-to-spinup-the-model.rst | 10 +-- ...tmospheric-forcing-to-spinup-the-model.rst | 12 +-- ...transient-historical-CO2-concentration.rst | 12 +-- .../running-special-cases/index.rst | 2 +- .../running-the-prognostic-crop-model.rst | 4 +- .../running-with-irrigation.rst | 6 +- doc/source/users_guide/runsed.csh | 6 ++ doc/source/users_guide/sedscript.txt | 17 ++++ .../choosing-a-compset.rst | 18 ++-- .../customizing-the-clm-configuration.rst | 48 +++++------ .../customizing-the-clm-namelist.rst | 10 +-- doc/source/users_guide/testing/testing.rst | 20 ++--- .../trouble-shooting/trouble-shooting.rst | 16 ++-- .../building-the-clm-tools.rst | 4 +- .../users_guide/using-clm-tools/cprnc.rst | 2 +- ...g-input-for-surface-dataset-generation.rst | 16 ++-- .../creating-surface-datasets.rst | 14 ++-- .../what-are-the-clm-tools.rst | 26 +++--- 33 files changed, 258 insertions(+), 235 deletions(-) create mode 100755 doc/source/users_guide/runsed.csh create mode 100644 doc/source/users_guide/sedscript.txt diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index de13570b3d..8854d9e4d9 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -14,11 +14,11 @@ If you have a LOT of files to keep track of it also might be easier than keeping If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. There are two parts to adding files to the build-namelist database. -The first part is adding new resolution names which is done in the ``models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml`` file (and in the ``models/lnd/clm/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). +The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml`` file (and in the ``$CTSMROOT/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``scripts/ccsm_utils/Case.template/config_grid.xml`` file. -The second part is actually adding the new filenames which is done in the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml`` file (``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). +The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst index a8ebc81ac8..558c877157 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst @@ -4,7 +4,7 @@ Managing Your Data Own Files ============================== -If you are running on a supported machine (such as yellowstone or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `CESM1.2.0 Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. +If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `+|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. @@ -39,7 +39,7 @@ You can also use **find** to list files that have a particular pattern in the na -If you are running on a supported machine (such as yellowstone or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `CESM1.2.0 Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. +If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `+|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst index 6d44f73b5b..e7896e1206 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst @@ -5,7 +5,7 @@ ========================= If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. -The list of valid resolutions is in the id="res" entry in the ``models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml`` file. +The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the id="res" entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. @@ -29,7 +29,7 @@ The only hard requirement is that names be unique for different grid files. Here As you can see you just add your new resolution names to the end of the valid_values list. -When using PTCLM and adding supported single-point resolutions, you'll also want to add these resolutions to the ``models/lnd/clm/bld/config_files/config_definition.xml`` under the ``sitespf_pt`` name. +When using PTCLM and adding supported single-point resolutions, you'll also want to add these resolutions to the ``$CTSMROOT/bld/config_files/config_definition.xml`` under the ``sitespf_pt`` name. The entry in that file looks like: :: diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst index c539d0fd8c..6393a74ce3 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst @@ -4,7 +4,7 @@ Changing Default Filenames ============================ -To add or change the default filenames you edit the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml`` and either change an existing filename or add a new one. +To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml`` and either change an existing filename or add a new one. Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. Attributes include the: resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (rcp) for future scenarios, and the type of biogeochemistry (bgc) model used. For example the fatmgrid for the 1.9x2.5 resolution is as follows: @@ -18,8 +18,8 @@ lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c130415.nc Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (crop) attributes. -To add or change the default filenames for CLM tools edit the ``models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` and either change an existing filename or add a new one. -Editing this file is similar to the ``namelist_defaults_clm4_5.xml`` talked about above. +To add or change the default filenames for CLM tools edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|_tools.xml`` and either change an existing filename or add a new one. +Editing this file is similar to the ``namelist_defaults_+|version|.xml`` talked about above. ---------------------------- @@ -27,7 +27,7 @@ What are the required files? ---------------------------- Different types of simulations and different types of configurations for CLM require different lists of files. -The CLM4.5-BGC or Carbon Nitrogen (cn) Biogeochemistry model for example requires ``stream_fldfilename_ndep`` files, which are NOT required by CLMSP. +The +|version|-BGC or Carbon Nitrogen (cn) Biogeochemistry model for example requires ``stream_fldfilename_ndep`` files, which are NOT required by CLMSP. Transient simulations also require transient datasets, and the names of these datasets are sometimes different from the static versions (sometimes both are required as in the dynamic PFT cases). diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index 5f9c63ab26..42df1b989a 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -3,13 +3,13 @@ ============== Getting Help ============== -In addition to this users-guide there are several other resources that are available to help you use CLM5.0. The first one is the CESM1.2.0 User's-Guide, which documents the entire process of creating cases with CESM1.2.0. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in CESM1.2.0. +In addition to this users-guide there are several other resources that are available to help you use +|version|. The first one is the +|cesmrelease| User's-Guide, which documents the entire process of creating cases with +|cesmrelease|. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in +|cesmrelease|. --------------------------- The CESM User's-Guide --------------------------- +|release| -+|release| in +|cesmrelease| is always run from within the standard +|cesmrelease| build and run scripts. Therefore, the user of CLM4.5 should familiarize themselves with the +|cesmrelease| scripts and understand how to work with them. User's-Guide documentation on the +|cesmrelease| scripts are available from the following web-page. The purpose of this +|version| in +|cesmrelease| User's Guide is to give the +|version| user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the +|cesmrelease| Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. ++|release| in +|cesmrelease| is always run from within the standard +|cesmrelease| build and run scripts. Therefore, the user of +|version| should familiarize themselves with the +|cesmrelease| scripts and understand how to work with them. User's-Guide documentation on the +|cesmrelease| scripts are available from the following web-page. The purpose of this +|version| in +|cesmrelease| User's Guide is to give the +|version| user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the +|cesmrelease| Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. `+|cesmrelease| Quickstart Guide `_ @@ -25,28 +25,28 @@ There is a rich and diverse set of people that use the CESM, and often it is use The CLM web pages ----------------- -The main CLM web page contains information on the CLM, it's history, developers, as well as downloads for previous model versions. There are also documentation text files in the models/lnd/clm/doc directory that give some quick information on using CLM. +The main CLM web page contains information on the CLM, it's history, developers, as well as downloads for previous model versions. There are also documentation text files in the $CTSMROOT/doc directory that give some quick information on using CLM. `CLM web page `_ `CLM Documentation Text Files `_ Also note that several of the XML database files can be viewed in a web browser to get a nice table of namelist options, namelist defaults, or compsets. Simply view them as a local file and bring up one of the following files: -- `models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml `_ -- definition of CLM4.0 namelist items. -- `models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml `_ -- definition of CLM4.0 namelist items. -- `models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml `_ -- default values for CLM4.0 namelist items. -- `models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml `_ -- default values for CLM4.5 namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_definition_clm4_0.xml `_ -- definition of CLM4.0 namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml `_ -- definition of CLM4.0 namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_0.xml `_ -- default values for CLM4.0 namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml `_ -- default values for +|version| namelist items. - `scripts/ccsm_utils/Case.template/config_definition.xml `_ -- definition of all env_*.xml items. - `scripts/ccsm_utils/Case.template/config_compsets.xml `_ -- definition of all the compsets. -- `models/lnd/clm/bld/namelist_files/history_fields_clm4_0.xml `_ -- definition of CLM4.0 history fields. -- `models/lnd/clm/bld/namelist_files/history_fields_clm4_5.xml `_ -- definition of CLM4.5 history fields. +- `$CTSMROOT/bld/namelist_files/history_fields_clm4_0.xml `_ -- definition of CLM4.0 history fields. +- `$CTSMROOT/bld/namelist_files/history_fields_+|version|.xml `_ -- definition of +|version| history fields. ------------------------ -Reporting bugs in CLM4.5 +Reporting bugs in +|version| ------------------------ -If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for CLM4.5 in CESM1.2.0 is in the models/lnd/clm/doc/KnownBugs file, and the list of issues for CESM1.2.0 is at... -`http://www.cesm.ucar.edu/models/cesm1.2//tags/cesm1_2_0/#PROBLEMS `_. +If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for +|version| in +|cesmrelease| is in the $CTSMROOT/doc/KnownBugs file, and the list of issues for +|cesmrelease| is at... +`http://www.cesm.ucar.edu/models/cesm1.2//tags/+|cesmrelease|/#PROBLEMS `_. --------------------------------------- Some Acronym's and Terms We'll be Using @@ -62,22 +62,22 @@ CLM Community Land Model (CLM). The prognostically active land model component of CESM. CLMBGC - Community Land Model (CLM4.5) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is + Community Land Model (+|version|) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is - ``./xmlchange CLM_CONFIG_OPTS="phys clm4_5 -bgc cn -vsoilc_centbgc on -clm4me on"`` + ``./xmlchange CLM_CONFIG_OPTS="phys +|version| -bgc cn -vsoilc_centbgc on -clm4me on"`` CLMCN - Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or CLM4.5) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or +|version|) The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cn" -append`` CLMSP - Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or CLM4.5) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or +|version|) The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc none" -append`` CLMU - Community Land Model (CLM) Urban Model (either CLM4.0 or CLM4.5). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). + Community Land Model (CLM) Urban Model (either CLM4.0 or +|version|). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). CRUNCEP The Climate Research Unit (CRU) analysis of the NCEP atmosphere reanalysis atmosphere forcing data. This can be used to drive CLM with atmosphere forcing from 1901 to 2010. We also DO expect to be able to update this dataset beyond 2010 as newer data becomes available. @@ -86,7 +86,7 @@ DATM Data Atmosphere Model (DATM) the prescribed data atmosphere component for CESM. Forcing data that we provide are either the Qian or CRUNCEP forcing datasets (see below). DV - Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either CLM4.5-BGC or CLMCN for either CLM4.0 or CLM4.5). The CLM_CONFIG_OPTS option for this is + Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either +|version|-BGC or CLMCN for either CLM4.0 or +|version|). The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cndv" -append`` @@ -103,7 +103,7 @@ PFT Plant Function Type (PFT). A type of vegetation that CLM parameterizes. PTCLM - PoinT CLM (PTCLM) a python script that operates on top of CLM for CLM4.5 to run single point simulations for CLM. + PoinT CLM (PTCLM) a python script that operates on top of CLM for +|version| to run single point simulations for CLM. Qian The Qian et. al. analysis of the NCEP forcing data. This can be used to drive CLM with atmosphere forcing from 1948 to 2004. We do NOT expect to be able to update this dataset beyond 2004. @@ -112,6 +112,6 @@ SCRIP Spherical Coordinate Remapping and Interpolation Package (SCRIP). We use it's file format for specifying both grid coordinates as well as mapping between different grids. VIC - Variable Infiltration Capacity (VIC) model for hydrology. This is an option to CLM4.5 in place of the standard CLM4.5 hydrology. The CLM_CONFIG_OPTS option for this is + Variable Infiltration Capacity (VIC) model for hydrology. This is an option to +|version| in place of the standard +|version| hydrology. The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-vichydro on" -append`` diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 02e6237e2b..b65e622b45 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -26,7 +26,7 @@ Group (LMWG) and maintained at the National Center for Atmospheric Research (NCAR). This guide is intended to instruct both the novice and experienced user on running CLM. This guide pertains to the latest version +|version| in +|cesmrelease| available for download from the public -release subversion repository as a part of CESM1.2.0. Documentation +release subversion repository as a part of +|cesmrelease|. Documentation may be different if you are using an older version, you should either use the documentation for that release version, update to the latest version, or use the documentation inside your own source tree. There @@ -34,19 +34,19 @@ is information in the ChangeLog file and in the `What is new with +|version| in +|cesmrelease| since previous public releases? `_ regarding the changes from previous versions of CESM. -.. note:: This release of CLM5.0 in CESM1.2.0 includes BOTH CLM4.0 - physics used in previous releases as well as the updated CLM4.5 +.. note:: This release of +|version| in +|cesmrelease| includes BOTH CLM4.0 + physics used in previous releases as well as the updated +|version| physics. Both CLM as well as CLM support tools allow you to trigger between the two physics modes. Most often when we refer to CLM4.0 we - are referring to the CLM4.0 physics in CLM4.5 in CESM1.2.0 rather + are referring to the CLM4.0 physics in +|version| in +|cesmrelease| rather than to a specific version of CLM4.0 (where we would give the exact - version). Likewise, when referring to CLM4.5 we are referring to the - CLM4.5 physics in CLM4.5 in CESM1.2.0. + version). Likewise, when referring to +|version| we are referring to the + +|version| physics in +|version| in +|cesmrelease|. The novice user should read `Chapter 1 `_ in detail before beginning work, while the expert user should read `What is new with -CLM4.5 in CESM1.2.0 since previous public releases? `_ and -`Quickstart to using CLM4.5 `_ chapters, and then use the ++|version| in +|cesmrelease| since previous public releases? `_ and +`Quickstart to using +|version| `_ chapters, and then use the more detailed chapters as reference. Before novice users go onto more technical problems covered in `Chapter 2 `_, `Chapter 3 `_, `Chapter 4 `_, or `Chapter 5 `_ they @@ -56,12 +56,12 @@ to replicate some of the examples given there. All users should read the `How to Use This Document `_ and `Other resources to get help from `_ sections to understand the document conventions and the various ways of getting help on using -CLM4.5. Users should also read the `What is scientifically validated -and functional in CLM4.5 in CESM1.2.0? `_ section to see if ++|version|. Users should also read the `What is scientifically validated +and functional in +|version| in +|cesmrelease|? `_ section to see if their planned use of the model is something that has been scientifically validated and well tested. Users that are NOT using NCAR machines or our list of well tested machines should also read the -What are the UNIX utilities required to use CLM4.5? section to make +What are the UNIX utilities required to use +|version|? section to make sure they have all the required UNIX utilities on the system they want to do their work. @@ -85,8 +85,8 @@ machine is working correctly. What is New with +|version| ========================= -`What's new with +|version| science `_ -The CESM1.2.0 `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. +`What's new with +|version| science `_ +The +|cesmrelease| `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. More details are given in the `CLM ChangeLog file `_. Previous release pages give similar list of changes for previous versions of the model. @@ -99,49 +99,49 @@ The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates ========================== In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. -The next section `What is new with CLM4.5 in CESM1.2.0 since previous public releases? `_ gives references to describe the differences between CLM4.5 in CESM1.2.0 and previous CESM releases both from a scientific as well as a software engineering point of view. -For information on previous releases of CLM4.5 before CLM4.5 in CESM1.2.0 see the CESM1.1.1 documentation. -The next section `Quickstart to using CLM4.5 `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use CLM4.5. -The next `What is scientifically validated and functional in CLM4.5 in CESM1.2.0? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. -`What are the UNIX utilities required to use CLM4.5? `_ lists the UNIX utilities required to use CLM4.5 and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. -Next we have `Important Notes and Best Practices for Usage of CLM4.5 `_ to detail some of the best practices for using CLM4.5 for science. -The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and CLM4.5. - -`Chapter 1 `_ goes into detail on how to setup and run simulations with CLM4.5 and especially how to customize cases. +The next section `What is new with +|version| in +|cesmrelease| since previous public releases? `_ gives references to describe the differences between +|version| in +|cesmrelease| and previous CESM releases both from a scientific as well as a software engineering point of view. +For information on previous releases of +|version| before +|version| in +|cesmrelease| see the CESM1.1.1 documentation. +The next section `Quickstart to using +|version| `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use +|version|. +The next `What is scientifically validated and functional in +|version| in +|cesmrelease|? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. +`What are the UNIX utilities required to use +|version|? `_ lists the UNIX utilities required to use +|version| and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. +Next we have `Important Notes and Best Practices for Usage of +|version| `_ to detail some of the best practices for using +|version| for science. +The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and +|version|. + +`Chapter 1 `_ goes into detail on how to setup and run simulations with +|version| and especially how to customize cases. Details of cesm_setup modes and build-namelist options as well as namelist options are given in this chapter. -`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or CLM4.5 physics for creating input datasets for use by CLM, for the expert user. +`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or +|version| physics for creating input datasets for use by CLM, for the expert user. There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. Then each tool is described in detail along with different ways in which the tool might be used. A final section on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. -This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and CLM4.5 physics). +This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and +|version| physics). In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. -For example, we give the protocol for spinning up the CLM4.5-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). +For example, we give the protocol for spinning up the +|version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. We also give instructions on running both the prognostic crop and irrigation models. Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. -`Chapter 5 `_ outlines how to do single-point or regional simulations using CLM4.5. -This is useful to either compare CLM4.5 simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. +`Chapter 5 `_ outlines how to do single-point or regional simulations using +|version|. +This is useful to either compare +|version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into `Chapter 2 `_ and also `Chapter 3 `_ to add the files into the build-namelist XML database. The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). CLM4 in CESM1.0.5 has a fully working versions of PTCLM. Need `Chapter 6 `_ blurb... -`Chapter 7 `_ gives some guidance on trouble-shooting problems when using CLM4.5. +`Chapter 7 `_ gives some guidance on trouble-shooting problems when using +|version|. It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. `Chapter 8 `_ goes over the automated testing scripts for validating that the CLM is working correctly. -The test scripts run many different configurations and options with CLM4.0 physics as well and CLM4.5 physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. -In general this is an activity important only for a developer of CLM4.5, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. +The test scripts run many different configurations and options with CLM4.0 physics as well and +|version| physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. +In general this is an activity important only for a developer of +|version|, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. -In the appendices we talk about some issues that are useful for advanced users and developers of CLM4.5. +In the appendices we talk about some issues that are useful for advanced users and developers of +|version|. -Finally in `Appendix A `_ we give instructions on how to build the documentation associated with CLM4.5 (i.e. how to build this document). +Finally in `Appendix A `_ we give instructions on how to build the documentation associated with +|version| (i.e. how to build this document). This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. This also could be useful for developers who need to update the documentation due to changes they have made. @@ -151,12 +151,12 @@ This also could be useful for developers who need to update the documentation du Best Practices ================ -- CLM4.5 includes BOTH the old CLM4.0 physics AND the new CLM4.5 physics and you can toggle between two. +- +|version| includes BOTH the old CLM4.0 physics AND the new +|version| physics and you can toggle between two. The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. - While the "standard" practice for CLM4.5 is to run with BGC on, and CRUNCEP atmospheric forcing. - "BGC" is the new CLM4.5 biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). + While the "standard" practice for +|version| is to run with BGC on, and CRUNCEP atmospheric forcing. + "BGC" is the new +|version| biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). -- When running with CLMCN (either CLM4.0 or CLM4.5 physics) or CLM4.5-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for CLM4.5 or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). +- When running with CLMCN (either CLM4.0 or +|version| physics) or +|version|-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the +|version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for +|version| or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). Simulations without a proper spinup will effectively be starting from an unvegetated world. See `the Section called Setting Your Initial Conditions File in Chapter 1 `_ for information on how to provide initial conditions for your simulation. @@ -169,20 +169,20 @@ This also could be useful for developers who need to update the documentation du Therefore, by design the year 2000 initial condition files do not represent an equilibrium state. Note also that spinning the 2000 initial conditions out to equilibrium will not reflect the best estimate of the real carbon/nitrogen state for the year 2000. -- Initial condition files are also provided for CLM4.5 for several configurations and resolutions. - For CLM4.5-SP and CLM4.5-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. - The CLM4.5-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. - Also the CLM4.5-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg CLM4.5-BGC-DV and 2deg CLM4.5-BGC-Crop. +- Initial condition files are also provided for +|version| for several configurations and resolutions. + For +|version|-SP and +|version|-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. + The +|version|-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. + Also the +|version|-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg +|version|-BGC-DV and 2deg +|version|-BGC-Crop. - Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. Interpolated initial condition files may no longer be in 'reasonable' equilibrium. -- In CLM4.5 for both CLM4.5-CN and CLM4.5-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). +- In +|version| for both +|version|-CN and +|version|-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. If you are running with an atmosphere model or forcing that is significantly different than present day -- the lightning frequency may NOT appropriately correspond to your atmosphere forcing and fire initiation would be inappropriate. -- Aerosol deposition is a required field to both CLM4.0 and CLM4.5 physics, sent from the atmosphere model. +- Aerosol deposition is a required field to both CLM4.0 and +|version| physics, sent from the atmosphere model. Simulations without aerosol deposition will exhibit unreasonably high snow albedos. The model sends aerosol deposition from the atmospheric model (either CAM or DATM). When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index edcd0bc2fe..3091595c68 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -7,31 +7,31 @@ Running the CLM requires a suite of UNIX utilities and programs and you should make sure you have all of these available before trying to go forward with using it. If you are missing one of these you should contact the systems administrator for the machine you wish to run on and make sure they are installed. -List of utilities required for CESM in the "CESM1.2.0 Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ +List of utilities required for CESM in the "+|cesmrelease| Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ - UNIX bash shell (for some of the CLM tools scripts) - NCL (for some of the offline tools for creating/modifying CLM input datasets see `Chapter 2 `_ for more information on NCL) - Python (optional, needed for PTCLM) - xsltproc, docbook and docbook utilities (optional, needed to build the Users-Guide) -Before working with CLM4.5 read the QuickStart Guide in the `CESM1.2.0 Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. +Before working with +|version| read the QuickStart Guide in the `+|cesmrelease| Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. -For some of the details of setting up cases for CLM4.5 read the README and text files available from the "models/lnd/clm/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. +For some of the details of setting up cases for +|version| read the README and text files available from the "$CTSMROOT/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. 1. `README file `_ describing the directory structure. 2. `Quickstart.userdatasets `_ file describing how to use your own datasets in the model (also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_). -3. `models/lnd/clm/doc/KnownBugs `_ file describing known problems in CLM4.5 (that we expect to eventually fix). +3. `$CTSMROOT/doc/KnownBugs `_ file describing known problems in +|version| (that we expect to eventually fix). -4. `models/lnd/clm/doc/KnownLimitationss `_ file describing known limitations in CLM4.5 and workarounds that we do NOT expect to fix. +4. `$CTSMROOT/doc/KnownLimitationss `_ file describing known limitations in +|version| and workarounds that we do NOT expect to fix. -The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in CLM4.5 in CESM1.2.0?" `_. +The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in +|version| in +|cesmrelease|?" `_. -The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with CLM4.5 in CESM1.2.0 since previous public releases?" `_. +The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with +|version| in +|cesmrelease| since previous public releases?" `_. Note other directories have README files that explain different components and tools used when running CLM and are useful in understanding how those parts of the model work and should be consulted when using tools in those directories. For more details on configuring and customizing a case with CLM see `Chapter 1 `_. -The Quickstart.GUIDE (which can be found in ``models/lnd/clm/doc``) is repeated here. +The Quickstart.GUIDE (which can be found in ``$CTSMROOT/doc``) is repeated here. -.. include:: ../../clm5.0/doc/Quickstart.GUIDE +.. include:: ../../+|version|/doc/Quickstart.GUIDE :literal: diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index 7d4408bcc8..a238bee4a6 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -4,16 +4,16 @@ Scientific Validation ======================== -In this section we go over what has been extensively tested and scientifically validated with CLM4.5, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. +In this section we go over what has been extensively tested and scientifically validated with +|version|, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. -------------------------------------------------------------- Standard Configuration and Namelist Options that are Validated -------------------------------------------------------------- See -`http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for CLM4.5. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. +`http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for +|version|. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. -In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for CLM4.5 while others are for both CLM4.0 AND CLM4.5 we explicitly say which they apply to. +In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for +|version| while others are for both CLM4.0 AND +|version| we explicitly say which they apply to. --------------------------------------------------------------------------------------------------------------- Configure Modes NOT scientifically validated, documented, supported or, in some cases, even advised to be used: @@ -21,13 +21,13 @@ Configure Modes NOT scientifically validated, documented, supported or, in some These are options that you would add to ``CLM_CONFIG_OPTS``. -1. exlaklayers on[CLM4.5 only] This mode is NOT tested and may NOT be even functional. +1. exlaklayers on[+|version| only] This mode is NOT tested and may NOT be even functional. -2. snicar_frc on[CLM4.0 AND CLM4.5] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. +2. snicar_frc on[CLM4.0 AND +|version|] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. -3. vichydro on[CLM4.5 only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. +3. vichydro on[+|version| only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. -4. vsoilc_centbgc[CLM4.5 only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `models/lnd/clm/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. +4. vsoilc_centbgc[+|version| only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `$CTSMROOT/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. ---------------------------------------------- Namelist options that should NOT be exercised: @@ -36,10 +36,10 @@ Namelist options that should NOT be exercised: ---------------------------------------------------- Build-Namelist options that should NOT be exercised: ---------------------------------------------------- -1. -irrig with -bgc cn and -phys clm4_0 We have only run the irrigation model with CLMSP (i.e. without the CN model). We recommend that if you want to run the irrigation model with CN, that you do a spinup. But, more than that you may need to make adjustments to irrig_factor in models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90. See the notes on this in the description of the irrigation model in the +1. -irrig with -bgc cn and -phys clm4_0 We have only run the irrigation model with CLMSP (i.e. without the CN model). We recommend that if you want to run the irrigation model with CN, that you do a spinup. But, more than that you may need to make adjustments to irrig_factor in $CTSMROOT/src/biogeophys/CanopyFluxesMod.F90. See the notes on this in the description of the irrigation model in the `Technical Descriptions of the Interactive Crop Management and Interactive Irrigation Models `_. -2. -irrig with -crop on and -phys clm4_0 Irrigation doesn't work with the prognostic crop model. Irrigation is only applied to generic crop currently, which negates it's practical usage. We also have a known problem when both are on (see bug 1326 in the `models/lnd/clm/doc/KnownBugs `_ file). If you try to run in this mode, the CLM build-namelist will return with an error. +2. -irrig with -crop on and -phys clm4_0 Irrigation doesn't work with the prognostic crop model. Irrigation is only applied to generic crop currently, which negates it's practical usage. We also have a known problem when both are on (see bug 1326 in the `$CTSMROOT/doc/KnownBugs `_ file). If you try to run in this mode, the CLM build-namelist will return with an error. -------------------------------------------- Namelist items that should NOT be exercised: diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst index 81f45a038f..1e7a5437eb 100644 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst @@ -89,7 +89,7 @@ Also note that this site has a site-specific dynamic land-use change file for it # Note: When creating the fpftdyn dataset for this site it will use the # PTCLM_sitedata/US-Ha1_dynpftdata.txt # file for land-use change and harvesting - > ./PTCLM.py -m yellowstone_intel -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux -c I20TRCRUCLM45BGC + > ./PTCLM.py -m cheyenne_intel -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux -c I20TRCRUCLM45BGC > mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 > cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 # Copy data in NetCDF format to this directory, filenames should be YYYY-MM.nc diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst index f710ed0bb4..30068b600c 100644 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -104,10 +104,10 @@ The output to the above command is as follows: Main Script Version Id: $Id: PTCLM.py 47576 2013-05-29 19:11:16Z erik $ Scripts URL: $HeadURL: https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM1_130529/PTCLM.py $: -Here we give a simple example of using PTCLM1 for a straightforward case of running at the US-UMB Fluxnet site on yellowstone where we already have the meteorology data on the machine. +Here we give a simple example of using PTCLM1 for a straightforward case of running at the US-UMB Fluxnet site on cheyenne where we already have the meteorology data on the machine. Note, see `the Section called Converting AmeriFlux Data for use by PTCLM `_ for permission information to use this data. -Example 6-1. Example of running PTCLM1 for US-UMB on yellowstone +Example 6-1. Example of running PTCLM1 for US-UMB on cheyenne ---------------------------------------------------------------- :: @@ -115,18 +115,18 @@ Example 6-1. Example of running PTCLM1 for US-UMB on yellowstone > setenv CSMDATA $CESMDATAROOT/inputdata > setenv MYCSMDATA $HOME/inputdata > setenv SITE US-UMB - > setenv MYMACH yellowstone_intel + > setenv MYMACH cheyenne_intel > setenv MYCASE testPTCLM # First link the standard input files to a location you have write access > cd scripts > ./link_dirtree $CSMDATA $MYCSMDATA # Next build all of the clm tools you will need - > cd ../models/lnd/clm/tools/clm4_5/mksurfdata_map + > cd ../$CTSMROOT/tools/+|version|/mksurfdata_map > gmake > gmake clean > cd ../../../../../../tools/mapping/gen_domain_files/src - > ../../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > ../../../../scripts/ccsm_utils/Machines/configure -mach cheyenne -compiler intel > gmake > gmake clean # next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst index e9a887e89c..172f041420 100644 --- a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst +++ b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst @@ -13,7 +13,7 @@ Example: Running PTCLM for the Mexicocity supported single point dataset :: > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py -m yellowstone_intel -s 1x1_mexicocityMEX -d $CSMDATA --nopointdata \ + > ./PTCLM.py -m cheyenne_intel -s 1x1_mexicocityMEX -d $CSMDATA --nopointdata \ --stdurbpt -c ICRUCLM45 --caseidprefix `pwd`/myPTCLMcases/site > cd myPTCLMcases/site_1x1_mexicocityMEX_I > ./cesm_setup @@ -29,7 +29,7 @@ Example: Running PTCLM for a spinup simulation with Qian data for tower years. :: > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py -m yellowstone_intel -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --useQIAN --QIAN_tower_yrs + > ./PTCLM.py -m cheyenne_intel -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --useQIAN --QIAN_tower_yrs > cd ../../../../../US-Ha1_ICRUCLM45BGC_QIAN > ./cesm_setup # Now build and run normally @@ -67,4 +67,4 @@ Example: Running PTCLM on a user-defined machine with global PFT and soil types # Here we show running interactively > ./US-UMB_ICRUCLM45BGC.userdefined_intel.run -.. warning: Because of Bug 1364, when running this case as above we get a floating point error after reaching time-step 124 for the example exactly as above. Other machines or compilers probably won't have this problem. See the `models/lnd/clm/doc/KnownBugs `_ file for more information on this problem. +.. warning: Because of Bug 1364, when running this case as above we get a floating point error after reaching time-step 124 for the example exactly as above. Other machines or compilers probably won't have this problem. See the `$CTSMROOT/doc/KnownBugs `_ file for more information on this problem. diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst index b644337239..73cf45ff88 100644 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/using-ptclm.rst @@ -8,7 +8,7 @@ There are three types of options to PTCLM1: required, setup/run-time, and datase The three required options are the three settings that MUST be specified for PTCLM to work at all. The other settings have default values that will default to something useful. The setup/run-time options control how the simulation will be setup and run. The dataset generation options control the generation of datasets needed when PTCLM is run. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash (such as -m instead of --machine). The required options to PTCLM are: inputdata directory (-d), machine (-m) and site-name (-s). -Inputdata directory is the directory where you have the CESM inputdata files, you need to have write access to this directory, so if you are running on a machine that you do NOT have write access to the standard inputdata location (such as NCAR yellowstone or LBNL hopper) you need to link the standard files to a location you do have control over. We recommend using the ``scripts/link_dirtree`` tool to do that. "machine" is the scripts name for the machine/compiler you will be using for your case. And finally site-name is the name of the site that you want to run for. Site-name can either be a valid supported dataset name or a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). +Inputdata directory is the directory where you have the CESM inputdata files, you need to have write access to this directory, so if you are running on a machine that you do NOT have write access to the standard inputdata location (such as NCAR cheyenne or LBNL hopper) you need to link the standard files to a location you do have control over. We recommend using the ``scripts/link_dirtree`` tool to do that. "machine" is the scripts name for the machine/compiler you will be using for your case. And finally site-name is the name of the site that you want to run for. Site-name can either be a valid supported dataset name or a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). After PTCLM is run a case directory where you can then setup, build and run your CESM case as normal. It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLM that were used to create it. @@ -33,7 +33,7 @@ Steps in running PTCLM You need to setup an inputdata directory where you have write access to it. Normally, for NCAR machines the data is on an inputdata where the user does NOT have write access to it. A way that you can get around this is to use the **link_dirtree** script to create softlinks from the normal location to a location you have write access to. - So for example on yellowstone: + So for example on cheyenne: :: > setenv CSMDATA $CESMDATAROOT/inputdata @@ -48,11 +48,11 @@ Steps in running PTCLM Next you need to make sure all the CLM FORTRAN tools are built. :: - > cd models/lnd/clm/tools/clm4_5/mksurfdata_map + > cd $CTSMROOT/tools/+|version|/mksurfdata_map > gmake > gmake clean > cd ../../../../../../tools/mapping/gen_domain_files/src - > ../../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > ../../../../scripts/ccsm_utils/Machines/configure -mach cheyenne -compiler intel > gmake > gmake clean @@ -77,7 +77,7 @@ Steps in running PTCLM :: > cd scripts - > ./PTCLM.py -m yellowstone_intel -s US-UMB -d $MYCSMDATA -c ICRUCLM45BGC --use QIAN "US-UMB_I_2000_CN_QIAN" + > ./PTCLM.py -m cheyenne_intel -s US-UMB -d $MYCSMDATA -c ICRUCLM45BGC --use QIAN "US-UMB_I_2000_CN_QIAN" b. PTCLM creates datasets for you It will populate $MYCSMDATA with new datasets it creates using the CLM tools. diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index 56d70b1d7d..ca794ac326 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -11,7 +11,7 @@ To setup a ``PTS_MODE`` simulation you use the "-pts_lat" and "-pts_lon" argumen :: > cd scripts - > ./create_newcase -case testPTS_MODE -res f19_g16 -compset I1850CRUCLM45BGC -pts_lat 40.0 -pts_lon -105 + > ./create_newcase -case testPTS_MODE -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -pts_lat 40.0 -pts_lon -105 > cd testPTS_MODE # We make sure the model will start up cold rather than using initial conditions @@ -21,7 +21,7 @@ Then setup, build and run as normal. We make sure initial conditions are NOT use .. note:: By default it sets up to run with MPILIB=mpi-serial (in the env_build.xml file) turned on, which allows you to run the model interactively. On some machines this mode is NOT supported and you may need to change it to FALSE before you are able to build. -.. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. See bugs "1017 and 1025" in the `models/lnd/clm/doc/KnownLimitationss `_ file. +.. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. See bugs "1017 and 1025" in the `$CTSMROOT/doc/KnownLimitationss `_ file. .. note:: You can change the point you are simulating for at run-time by changing the values of ``PTS_LAT`` and ``PTS_LON`` in the ``env_run.xml`` file. @@ -35,6 +35,6 @@ You might also want to set the ``env_build.xml`` variable: ``MPILIB=mpi-serial`` On many machines, batch queues have a minimum number of nodes or processors that can be used. On these machines you may have to change the queue and possibly the time-limits of the job, to get it to run in the batch queue. -On the NCAR machine, yellowstone, this is done for you automatically, and the "caldera" queue is used for such single-processor simulations. +On the NCAR machine, cheyenne, this is done for you automatically, and the "caldera" queue is used for such single-processor simulations. Another way to get around this problem is to run the job interactively using ``MPILIB=mpi-serial`` so that you don't submit the job to the batch queue. For single point mode you also may want to consider using a smaller workstation or cluster, rather than a super-computer, because you can't take advantage of the multi-processing power of the super-computer anyway. diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 3445b0cab7..accc5381a7 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -11,7 +11,7 @@ However, users can create their own dataset. To get the list of supported dataset resolutions do this: :: - > cd models/lnd/clm/doc + > cd $CTSMROOT/doc > ../bld/build-namelist -res list @@ -120,7 +120,7 @@ Example: Running CLM over the single-point of Vancouver Canada with supplied atm > ./case.setup -.. warning:: If you don't set the start-year and run-length carefully as shown above the model will abort with a "dtlimit error" in the atmosphere model (see bug 1110 in the `models/lnd/clm/doc/KnownLimitationss `_ file for documentation on this). Since, the forcing data for this site (and the MexicoCity site) is less than a year, the model won't be able to run for a full year. The ``1x1_urbanc_alpha`` site has data for more than a full year, but neither year is complete hence, it has the same problem (see the problem for this site above). +.. warning:: If you don't set the start-year and run-length carefully as shown above the model will abort with a "dtlimit error" in the atmosphere model (see bug 1110 in the `$CTSMROOT/doc/KnownLimitationss `_ file for documentation on this). Since, the forcing data for this site (and the MexicoCity site) is less than a year, the model won't be able to run for a full year. The ``1x1_urbanc_alpha`` site has data for more than a full year, but neither year is complete hence, it has the same problem (see the problem for this site above). .. note:: Just like ``PTS_MODE`` above, By default it sets up to run with ``MPILIB=mpi-serial`` (in the env_build.xml file) turned on, which allows you to run the model interactively. @@ -164,17 +164,17 @@ Example: Creating a surface dataset for a single point > setenv GRIDNAME 1x1_boulderCO > setenv CDATE `date +%y%m%d` # Create the SCRIP grid file for the location and create a unity mapping file for it. - > cd models/lnd/clm/tools/shared/mkmapdata + > cd $CTSMROOT/tools/mkmapdata > ./mknoocnmap.pl -p 40,255 -n $GRIDNAME # Set pointer to MAPFILE just created that will be used later > setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc # create the mapping files needed by mksurfdata_map. - > cd ../../shared/mkmapdata + > cd ../.././mkmapdata > setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc > ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional # create the domain file > cd ../../../../tools/mapping/gen_domain_files/src - > ../../../scripts/ccsm_utils/Machines/configure -mach yellowstone -compiler intel + > ../../../scripts/ccsm_utils/Machines/configure -mach cheyenne -compiler intel > gmake > cd .. > setenv OCNDOM domain.ocn_noocean.nc @@ -183,7 +183,7 @@ Example: Creating a surface dataset for a single point # Save the location where the domain file was created > setenv GENDOM_PATH `pwd` # Finally create the surface dataset - > cd ../../../../lnd/clm/tools/clm4_5/mksurfdata_map/src + > cd ../../../../lnd/clm/tools/+|version|/mksurfdata_map/src > gmake > cd .. > ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE @@ -202,11 +202,11 @@ Example: Setting up a case from the single-point surface dataset just created > ./link_dirtree $CSMDATA $MYCSMDATA # Copy the file you created above to your new $MYCSMDATA location following the CLMUSRDAT # naming convention (leave off the creation date) - > cp $CESMROOT/models/lnd/clm/tools/clm4_5/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ + > cp $CESMROOT/$CTSMROOT/tools/+|version|/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc > cd $CESMROOT/scripts - > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850CRUCLM45BGC \ - -mach yellowstone_intel + > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850Clm50BgcCropCru \ + -mach cheyenne_intel > cd my_usernldatasets_test > ./xmlchange DIN_LOC_ROOT=$MYCSMDATA # Set the path to the location of gen_domain set in the creation step above diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst index efb2f6b4aa..c92892ba8d 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst @@ -1,21 +1,21 @@ .. _spinning-up-clm45-bgc: ====================== - Spinup of CLM4.5-BGC + Spinup of +|version|-BGC ====================== -To get the CLM4.5-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. +To get the +|version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). **1. 45_AD_SPINUP** For the first step of running 1000+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: -Example:: AD_SPINUP Simulation for CLM4.5-BGC +Example:: AD_SPINUP Simulation for +|version|-BGC -------------------------------------------------------- :: > cd scripts - > ./create_newcase -case BGC_spinup -res f19_g16 -compset I1850CRUCLM45BGC -mach yellowstone_intel + > ./create_newcase -case BGC_spinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -mach cheyenne_intel > cd BGC_spinup # Append "-spinup on" to CLM_BLDNML_OPTS > ./xmlchange CLM_BLDNML_OPTS="-bgc_spinup on" -append @@ -33,19 +33,19 @@ Example:: AD_SPINUP Simulation for CLM4.5-BGC # Now run normally > ./BGC_spinup.submit -.. note:: This same procedure works for CLM4.5-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. +.. note:: This same procedure works for +|version|-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. Afterwards save the last restart file from this simulation to use in the next step. -**2. Final spinup for CLM4.5-BGC** +**2. Final spinup for +|version|-BGC** Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 200+ years in normal mode. So do the following: -Example: Final CLMBGC Spinup Simulation for CLM4.5-BGC +Example: Final CLMBGC Spinup Simulation for +|version|-BGC ------------------------------------------------------------------ :: > cd scripts - > ./create_newcase -case BGC_finalspinup -res f19_g16 -compset I1850CRUCLM45BGC -mach yellowstone_intel + > ./create_newcase -case BGC_finalspinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -mach cheyenne_intel > cd BGC_finalspinup # Now, Copy the last CLM restart file from the earlier case into your run directory > cp /ptmp/$LOGIN/archive/BGC_spinup/rest/BGC_spinup.clm*.r*.1002-01-01-00000.nc \ @@ -69,7 +69,7 @@ Example: Final CLMBGC Spinup Simulation for CLM4.5-BGC To assess if the model is spunup plot trends of CLMBGC variables of interest. If you see a trend, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. -.. note:: This same final spinup procedure works for CLM4.5-CN as well, you can typically shorten the spinup time from 200 years to 50 though. +.. note:: This same final spinup procedure works for +|version|-CN as well, you can typically shorten the spinup time from 200 years to 50 though. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index 709a1b26a6..36f2266493 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -7,15 +7,15 @@ Because it takes so long to spinup the CN model (as we just saw previously), if you are doing fully coupled simulations with active atmosphere and ocean, you will want to do the spinup portion of this "offline". So instead of doing expensive fully coupled simulations for the spinup duration, you run CLM in a very cheap "I" compset using atmospheric forcing from a shorter fully coupled simulation (or a simulation run previously by someone else). -In this example we will use the ``I1850SPINUPCN compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on yellowstone. -There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than yellowstone, but would need to download the data from the Earth System Grid and change the datapath similar to `Example 4-11 `_. +In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on cheyenne. +There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to `Example 4-11 `_. -Example: Simulation with MOAR Data on yellowstone +Example: Simulation with MOAR Data on cheyenne ------------------------------------------------------------- :: > cd scripts - > ./create_newcase -case MOARforce1850 -res f19_g16 -compset I1850SPINUPCN -mach yellowstone_intel + > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup -mach cheyenne_intel > cd MOARforce1850 # The following sets the casename to point to for atm forcing (you could also use an editor) > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a @@ -28,4 +28,4 @@ Example: Simulation with MOAR Data on yellowstone > ./MOARforce1850.submit -.. warning: Because of bug 1339 (see the `models/lnd/clm/doc/KnownBugs `_ file on this) you can't run with 83 or more years of forcing. If you do need to run with more years of forcing, you'll need to address the issue as outlined in the `models/lnd/clm/doc/KnownBugs `_ file. +.. warning: Because of bug 1339 (see the `$CTSMROOT/doc/KnownBugs `_ file on this) you can't run with 83 or more years of forcing. If you do need to run with more years of forcing, you'll need to address the issue as outlined in the `$CTSMROOT/doc/KnownBugs `_ file. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index 7d523f7324..5cad7c1c5e 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -7,14 +7,14 @@ Another way that you might want to spinup the model is to run your own simulation for a relatively short period (either a B, E, or F compset) and then use it as forcing for your "I" case later. By only running 20 to 50 years for the fully coupled case, you'll save a substantial amount of computer time rather than running the entire spinup period with a fully coupled model. -The first thing we need to do is to run a fully coupled case and save the atmospheric coupling fields on a three hourly basis. In this example, we will run on yellowstone and archive the data to a local disk that we can then use in the next simulation. +The first thing we need to do is to run a fully coupled case and save the atmospheric coupling fields on a three hourly basis. In this example, we will run on cheyenne and archive the data to a local disk that we can then use in the next simulation. Example: Fully Coupled Simulation to Create Data to Force Next Example Simulation ---------------------------------------------------------------------------------------------- :: > cd scripts - > ./create_newcase -case myBCN1850 -res f09_g16 -compset B1850CN -mach yellowstone_intel + > ./create_newcase -case myBCN1850 -res f09_g17_gl4 -compset B1850CN -mach cheyenne_intel > cd myBCN1850 > ./cesm_setup # Set histaux_a2x3hr to .true. in your user_nl_cpl output from the atmosphere model @@ -35,7 +35,7 @@ Example: Fully Coupled Simulation to Create Data to Force Next Example Simulatio # Now run as normal > ./myBCN1850.submit -.. warning:: Because of bug 1733 (see the `models/lnd/clm/doc/KnownBugs `_ file on this) you'll need to edit the driver code in order for it to produce the correct list of fields needed to run the model later. +.. warning:: Because of bug 1733 (see the `$CTSMROOT/doc/KnownBugs `_ file on this) you'll need to edit the driver code in order for it to produce the correct list of fields needed to run the model later. Now we run an I compset forced with the data from the previous simulation using the ``CPLHIST3HrWx`` option to DATM_MODE. See `the Section called CPLHIST3HrWx mode and it's DATM settings in Chapter 1 `_ for more information on the DATM settings for ``CPLHIST3HrWx`` mode. @@ -44,7 +44,7 @@ Example: Simulation Forced with Data from the Previous Simulation :: > cd scripts - > ./create_newcase -case frcwmyBCN1850 -res f09_g16 -compset I1850SPINUPCN -mach yellowstone_intel + > ./create_newcase -case frcwmyBCN1850 -res f09_g17_gl4 -compset I1850Clm50BgcSpinup -mach cheyenne_intel > cd frcWmyBCN1850 # The following sets the casename to point to for atm forcing (you could also use an editor) > ./xmlchange DATM_CPLHIST_CASE="myBCN1850" @@ -53,7 +53,7 @@ Example: Simulation Forced with Data from the Previous Simulation > ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20 # Set the strm_datdir in the namelist_defaults_datm.xml # file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist - # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850SPINUPCN COMPSET CASES MADE AFTER THIS! + # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850Clm50BgcSpinup COMPSET CASES MADE AFTER THIS! > $EDITOR ../../models/atm/datm/bld/namelist_files/namelist_defaults_datm.xml > ./cesm_setup # Now build and run as normal @@ -61,7 +61,7 @@ Example: Simulation Forced with Data from the Previous Simulation > ./frcwmyBCN1850.submit -.. note:: We did this by editing the "namelist_defaults_datm.xml" which will change the settings for ALL future ``I1850SPINUPCN`` cases you run. You could also do this by editing the path in the resulting streams text files in the CaseDocs directory, and then create a "user\_" streams file with the correct path. This would change the streams file JUST for this case. The steps do it this way are: +.. note:: We did this by editing the "namelist_defaults_datm.xml" which will change the settings for ALL future ``I1850Clm50BgcSpinup`` cases you run. You could also do this by editing the path in the resulting streams text files in the CaseDocs directory, and then create a "user\_" streams file with the correct path. This would change the streams file JUST for this case. The steps do it this way are: :: diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index 854450ff12..f81634d456 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -27,7 +27,7 @@ The datafile is a CF-compliant NetCDF file with the data that will be mapped. The streams text file is the XML-like file that tells datm how to find the files and how to map the variables datm knows about to the variable names on the NetCDF files. Note, that in our case the domain file and the data file are the same file. In other cases, the domain file may be separate from the data file. First we are going to create a case, and we will edit the ``user_nl_datm`` so that we add a CO2 data stream in. -There is a streams text file available in ``models/lnd/clm/doc/UsersGuide/co2_streams.txt``, that includes file with a CO2 time-series from 1765 to 2007. +There is a streams text file available in ``$CTSMROOT/doc/UsersGuide/co2_streams.txt``, that includes file with a CO2 time-series from 1765 to 2007. Example: Transient Simulation with Historical CO2 @@ -35,7 +35,7 @@ Example: Transient Simulation with Historical CO2 :: > cd scripts - > ./create_newcase -case DATM_CO2_TSERIES -res f19_g16 -compset I20TRCRUCLM45BGC + > ./create_newcase -case DATM_CO2_TSERIES -res f19_g17_gl4 -compset I20TRCRUCLM45BGC > cd DATM_CO2_TSERIES # Set CCSM_BGC to CO2A so that CO2 will be passed from atmosphere to land @@ -50,7 +50,7 @@ Example: Transient Simulation with Historical CO2 This is a streams file to pass historical CO2 from datm8 to the other surface models. It reads in a historical dataset derived from data used - by CAM. The getco2_historical.ncl script in models/lnd/clm2/tools/ncl_scripts + by CAM. The getco2_historical.ncl script in $CTSMROOT2/tools/ncl_scripts was used to convert the CAM file to a streams compatible format (adding domain information and making CO2 have latitude/longitude even if only for a single point. @@ -106,7 +106,7 @@ Example: Transient Simulation with Historical CO2 > ./preview_namelists The first thing we will do is to edit the ``user_nl_datm`` file to add a CO2 file stream in. -To do this we will copy a ``user_nl_datm`` in with the changes needed. The file ``addco2_user_nl_datm.user_nl`` is in ``models/lnd/clm/doc/UsersGuide`` and looks like this... +To do this we will copy a ``user_nl_datm`` in with the changes needed. The file ``addco2_user_nl_datm.user_nl`` is in ``$CTSMROOT/doc/UsersGuide`` and looks like this... :: dtlimit = 1.5,1.5,1.5,1.5,1.5 @@ -123,12 +123,12 @@ To do this we will copy a ``user_nl_datm`` in with the changes needed. The file You just copy this into your case directory. But, also compare it to the version in ``CaseDocs`` to make sure the changes are just to add in the new CO2 stream. Check to see that filenames, and start, end and align years are correct. :: - > cp ../../models/lnd/clm/doc/UsersGuide/addco2_user_nl_datm.user_nl user_nl_datm + > cp ../../$CTSMROOT/doc/UsersGuide/addco2_user_nl_datm.user_nl user_nl_datm > diff user_nl_datm CaseDocs/datm_atm_in Once, you've done that you can build and run your case normally. -.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard CLM4.5 CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. +.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard +|version| CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. .. note:: The intent of the ``user_nl_datm`` is to add an extra streams file for CO2 to the end of the streams variable, and other arrays associated with streams (adding mapalgo as a new array with bilinear for everything, but the CO2 file which should be "nn" for nearest neighbor). Other variables should be the same as the other stream values. diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index af69b010da..95231e9041 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -16,7 +16,7 @@ Running Special Cases running-the-prognostic-crop-model.rst running-with-irrigation.rst CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst - CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst + CLM-4.4-Spinning-up-the-+|version|-biogeochemistry-(CLMBGC-spinup).rst CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst diff --git a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst index 31691e721d..3ed3b3f0f1 100644 --- a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst @@ -4,7 +4,7 @@ Running the prognostic crop model =================================== -The prognostic crop model is setup to work with CLM4.5-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. +The prognostic crop model is setup to work with +|version|-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. To activate the crop model you can choose a compset that has "CROP" in the name such as "ICRUCLM45BGCCROP" or simply add "-crop on" to ``CLM_CONFIG_OPTS``. @@ -13,7 +13,7 @@ Example: Crop Simulation :: > cd scripts - > ./create_newcase -case CROP -res f19_g16 -compset I1850CRUCLM45BGC + > ./create_newcase -case CROP -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd CROP # Append "-crop on" to CLM_CONFIG_OPTS in env_build.xml (you could also use an editor) diff --git a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst index 4a39f6ec5f..feef7d0bd4 100644 --- a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst @@ -4,8 +4,8 @@ Running with irrigation =================================== -In CLM4.5 irrigation can ONLY be used WITH crop. -To turn on irrigation in CLM4.5 we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. +In +|version| irrigation can ONLY be used WITH crop. +To turn on irrigation in +|version| we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. Just as in the crop example we also change ``RUN_TYPE`` to ``startup`` so that we don't use an initial condition file that is incompatible with irrigation. Example: Irrigation Simulation @@ -14,7 +14,7 @@ Example: Irrigation Simulation # Note here we do a CLMSP simulation as that is what has been validated > cd scripts - > ./create_newcase -case IRRIG -res f19_g16 -compset I + > ./create_newcase -case IRRIG -res f19_g17_gl4 -compset I > cd IRRIG # Append "-irrig" to CLM_BLDNML_OPTS in env_run.xml (you could also use an editor) diff --git a/doc/source/users_guide/runsed.csh b/doc/source/users_guide/runsed.csh new file mode 100755 index 0000000000..56e3445397 --- /dev/null +++ b/doc/source/users_guide/runsed.csh @@ -0,0 +1,6 @@ +#!/bin/csh + +foreach file ( */*.rst ) + sed -f sedscript.txt $file > $file.tmp + mv $file.tmp $file +end diff --git a/doc/source/users_guide/sedscript.txt b/doc/source/users_guide/sedscript.txt new file mode 100644 index 0000000000..ca537f84a6 --- /dev/null +++ b/doc/source/users_guide/sedscript.txt @@ -0,0 +1,17 @@ +s/CLM4.5/+|version|/g +s/clm4.5/+|version|/g +s/CLM5.0/+|version|/g +s/clm5.0/+|version|/g +s/CESM2.0/+|cesmrelease|/g +s/cesm2.0/+|cesmrelease|/g +s/CESM1.2.0/+|cesmrelease|/g +s/cesm1.2.0/+|cesmrelease|/g +s#models/lnd/clm#$CTSMROOT#g +s#tools/shared/#tools/#g +s#shared/#./#g +s/yellowstone/cheyenne/g +s/I1850SPINUPCN/I1850Clm50BgcSpinup/g +s/I1850CRUCLM45BGC/I1850Clm50BgcCropCru/g +s/I1850CRUCLM45BGC/I1850Clm50BgcCrop/g +s/f19_g16/f19_g17_gl4/g +s/f09_g16/f09_g17_gl4/g diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst index 806d76d966..e108901b27 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst @@ -25,12 +25,12 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) | Short Name | Description | Atm. | Compset Alias | Period | | | | Forcing | Name | | +============+==============+===========+=================+================+ -| CLM4.5SP | Satellite | CRUNCEP | 1850CRUCLM45 | 1850 | +| +|version|SP | Satellite | CRUNCEP | 1850CRUCLM45 | 1850 | | | phenology | | | | | | with new | | | | | | biogeophys | | | | +------------+--------------+-----------+-----------------+----------------+ -| CLM4.5SP | New | CRUNCEP | I1850CRUCLM45BGC| 1850 | +| +|version|SP | New | CRUNCEP | I1850Clm50BgcCropCru| 1850 | | | biogeophys | +-----------------+----------------+ | | + CENTURY- | | I20TRCRUCLM45BGC| 20th Century | | | like | | | | @@ -42,7 +42,7 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) | | nitrogen | | | | | | updates | | | | +------------+--------------+-----------+-----------------+----------------+ -| CLM4.5CN | New | CRUNCEP | I1850CRUCLM45CN | 1850 | +| +|version|CN | New | CRUNCEP | I1850CRUCLM45CN | 1850 | | | biogeophys | | | | | | + CN soil | | | | | | BGC, updates | | | | @@ -74,7 +74,7 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) | Short Name | Description | Atm. | Compset Alias | Period | | | | Forcing | Name | | +============+===================+===================+=================+========+ -| CLM4.5BGC- | ICRUCLM45BGCCROP | New biogeophys + | CRUNCEP | 2000 | +| +|version|BGC- | ICRUCLM45BGCCROP | New biogeophys + | CRUNCEP | 2000 | | CROP | | CENTURY-like | | | | | | vertically | | | | | | resolved soil | | | @@ -85,7 +85,7 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) | | | CROP | | | | | | | | | +------------+-------------------+-------------------+-----------------+--------+ -| CLM4.5BGC- | I1850CRUCLM45BGCDV| New biogeophys | CRUNCEP | 1850 | +| +|version|BGC- | I1850Clm50BgcCropCruDV| New biogeophys | CRUNCEP | 1850 | | DV | | + CENTURY-like | | | | | | vertically | | | | | | resolved soil | | | @@ -97,7 +97,7 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) | | | | | | | | | | | | +------------+-------------------+-------------------+-----------------+--------+ -| CLM4.5SP- | ICLM45VIC | Satellite | Qian | 2000 | +| +|version|SP- | ICLM45VIC | Satellite | Qian | 2000 | | VIC | | phenology with new| | | | | | biogeophys with | | | | | | VIC hydrology | | | @@ -132,9 +132,9 @@ Alias (Long-name with time-period and each component) #. ``I1850CRUCLM45`` (1850_DATM%CRU_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) -#. ``I1850CRUCLM45BGC`` (1850_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) +#. ``I1850Clm50BgcCropCru`` (1850_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) -#. ``I1850CRUCLM45BGCDV`` (1850_DATM%CRU_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) +#. ``I1850Clm50BgcCropCruDV`` (1850_DATM%CRU_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) #. ``I1850CRUCLM45CN`` (1850_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) @@ -142,7 +142,7 @@ Alias (Long-name with time-period and each component) #. ``I1850SPINUPCLM45BGC`` (1850_DATM%S1850_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) -#. ``I1850SPINUPCN`` (1850_DATM%S1850_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) +#. ``I1850Clm50BgcSpinup`` (1850_DATM%S1850_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) #. ``I1PT`` (2000_DATM%1PT_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index e4cafcf046..4e211894d6 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -4,7 +4,7 @@ Customizing CLM's Configuration ******************************* -The "Creating a Case" section of the `CESM1.2.0 Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. +The "Creating a Case" section of the `+|cesmrelease| Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called there are two steps that take place: @@ -12,9 +12,9 @@ For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called 2. The CLM "**build-namelist**" script is called to generate the run-time namelist for CLM (more information on **build-namelist** is given below in `the Section called Definition of Namelist items and their default values `_. -When customizing your case at the *8cesm_setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "models/lnd/clm/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. +When customizing your case at the *8cesm_setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "$CTSMROOT/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. -There are five different types of customization for the configuration that we will discuss: CLM4.5 in CESM1.2.0 build-time options, CLM4.5 in CESM1.2.0 run-time options, User Namelist, other noteworthy CESM1.2.0 configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. +There are five different types of customization for the configuration that we will discuss: +|version| in +|cesmrelease| build-time options, +|version| in +|cesmrelease| run-time options, User Namelist, other noteworthy +|cesmrelease| configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. Information on all of the script, configuration, build and run items is found under ``scripts/ccsm_utils/Case.template`` in the `config_definition.xml `_ file. @@ -51,7 +51,7 @@ CLM_NML_USE_CASE ``CLM_NML_USE_CASE`` is used to set a particular set of conditions that set multiple namelist items, all centering around a particular usage of the model. To list the valid options do the following: :: - > cd models/lnd/clm/doc + > cd $CTSMROOT/doc > ../bld/build-namelist -use_case list The output of the above command is: @@ -109,7 +109,7 @@ CLM_BLDNML_OPTS As with the CLM "configure" script the CLM clm.buildnml.csh may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the "build-namelist" script is to do :: - > cd models/lnd/clm/bld + > cd $CTSMROOT/bld > ./build-namelist -help Here is the output from the above. @@ -179,7 +179,7 @@ CLM_BLDNML_OPTS -inputdata "filepath" Writes out a list containing pathnames for required input datasets in file specified. - -irrig "value" If .true. turn irrigation on with namelist logical irrigate (for CLM4.5 physics) + -irrig "value" If .true. turn irrigation on with namelist logical irrigate (for +|version| physics) (requires crop to be on in the clm configuration) Seek surface datasets with irrigation turned on. (for CLM4.0 physics) Default: .false. @@ -284,7 +284,7 @@ Hence only the following different options can be set: #. -verbose -"-bgc_spinup" is an option only available for CLM4.5 for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the CLM4.5 biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. +"-bgc_spinup" is an option only available for +|version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the +|version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. "-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **$CASE.build** or **$CASE.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. @@ -296,7 +296,7 @@ Hence only the following different options can be set: To see a list of valid variables that you could set do this: :: - > cd models/lnd/clm/doc + > cd $CTSMROOT/doc > ../bld/build-namelist -clm_demand list @@ -317,13 +317,13 @@ When "-irrig" is used **build-namelist** will try to find surface datasets that "-rcp" is used to set the representative concentration pathway for the future scenarios you want the data-sets to simulate conditions for, in the input datasets. To list the valid options do the following: :: - > cd models/lnd/clm/doc + > cd $CTSMROOT/doc > ../bld/build-namelist -rcp list "-sim_year" is used to set the simulation year you want the data-sets to simulate conditions for in the input datasets. The simulation "year" can also be a range of years in order to do simulations with changes in the dataset values as the simulation progresses. To list the valid options do the following: :: - > cd models/lnd/clm/doc + > cd $CTSMROOT/doc > ../bld/build-namelist -sim_year list ``CLM_NAMELIST_OPTS`` @@ -355,7 +355,7 @@ When "-irrig" is used **build-namelist** will try to find surface datasets that For example if your ``CLM_USRDAT_NAME`` will be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, the following will list what your filenames should be: :: - > cd models/lnd/clm/bld + > cd $CTSMROOT/bld > queryDefaultNamelist.pl -usrname "1x1_boulderCO" -options mask=navy,sim_year=1850,sim_year_range="constant" -csmdata $CSMDATA An example of using ``CLM_USRDAT_NAME`` for a simulation is given in `Example 5-4 `_. @@ -464,11 +464,11 @@ Especially with CLMBGC and CLMCN starting from initial conditions is very import Doing a hybrid simulation to provide initial conditions ------------------------------------------------------- -The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup most cases, at the standard resolutions of "f09" or "f19" it will already do this for you. For example, if you run an "I2000CN" compset at "f09_g16" resolution the following settings will already be done for you. +The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup most cases, at the standard resolutions of "f09" or "f19" it will already do this for you. For example, if you run an "I2000CN" compset at "f09_g17_gl4" resolution the following settings will already be done for you. -``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=I2000CN_f09_g16_c100503,RUN_REFDATE=0001-01-01,GET_REFCASE=TRUE`` +``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=I2000CN_f09_g17_gl4_c100503,RUN_REFDATE=0001-01-01,GET_REFCASE=TRUE`` -Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the: ``$DIN_LOC_ROOT/ccsm4_init/I2000CN_f09_g16_c100503/0001-01-01`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. +Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the: ``$DIN_LOC_ROOT/ccsm4_init/I2000CN_f09_g17_gl4_c100503/0001-01-01`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. ------------------------------------------------------- Doing a branch simulation to provide initial conditions @@ -483,7 +483,7 @@ Providing a finidat file in your user_nl_clm file Setting up a branch or hybrid simulation requires the initial condition file to follow a standard naming convention, and a standard input directory if you use the ``GET_REFCASE`` option. If you want to name your file willy nilly and place it anywhere, you can set it in your ``user_nl_clm`` file as in this example. :: - finidat = '/glade/home/$USER/myinitdata/clmi_I1850CN_f09_g16_0182-01-01.c120329.nc' + finidat = '/glade/home/$USER/myinitdata/clmi_I1850CN_f09_g17_gl4_0182-01-01.c120329.nc' Note, if you provide an initial condition file -- you can NOT set ``CLM_FORCE_COLDSTART`` to ``TRUE``. @@ -530,7 +530,7 @@ If you are running an B, E, or F case that doesn't use the DATM obviously the DA CPLHIST3HrWx ``CLMCRUNCEP`` - The standard mode for CLM4.5 of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. + The standard mode for +|version| of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. See `the Section called CLMCRUNCEP mode and it's DATM settings `_ for more information on the DATM settings for ``CLMCRUNCEP`` mode. ``CLM_QIAN`` @@ -582,9 +582,9 @@ Downloading DATM Forcing Data In Chapter One of the `CESM User's Guide `_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well. -The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of it's size you may also need to download it onto a separate disk space. We have done that on yellowstone for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use **check_input_data** to export the data. +The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of it's size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use **check_input_data** to export the data. -The ``CPLHIST3HrWx`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on yellowstone. The DATM assumes the path for the previous NCAR machine yellowstone of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHIST3HrWx`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. -------------------------------------- Customizing via the build script files @@ -601,7 +601,7 @@ The final thing that the user may wish to do before **cesm_setup** is run is to More information on the CLM configure script -------------------------------------------- -The CLM **configure** script defines the details of a clm configuration and summarizes it into a ``config_cache.xml`` file. The ``config_cache.xml`` will be placed in your case directory under ``Buildconf/clmconf``. The `config_definition.xml `_ in ``models/lnd/clm/bld/config_files`` gives a definition of each CLM configuration item, it is viewable in a web-browser. Many of these items are things that you would NOT change, but looking through the list gives you the valid options, and a good description of each. Below we repeat the ``config_definition.xml`` files contents: +The CLM **configure** script defines the details of a clm configuration and summarizes it into a ``config_cache.xml`` file. The ``config_cache.xml`` will be placed in your case directory under ``Buildconf/clmconf``. The `config_definition.xml `_ in ``$CTSMROOT/bld/config_files`` gives a definition of each CLM configuration item, it is viewable in a web-browser. Many of these items are things that you would NOT change, but looking through the list gives you the valid options, and a good description of each. Below we repeat the ``config_definition.xml`` files contents: Help on CLM configure --------------------- @@ -609,7 +609,7 @@ Help on CLM configure Coupling this with looking at the options to CLM **configure** with "-help" as below will enable you to understand how to set the different options. :: - > cd models/lnd/clm/bld + > cd $CTSMROOT/bld > configure -help The output to the above command is as follows: @@ -632,7 +632,7 @@ The output to the above command is as follows: (default: CLM build directory). -clm4me Turn Methane model: [on | off] Requires bgc=cn/cndv (Carbon Nitrogen model) - (ONLY valid for CLM4.5!) + (ONLY valid for +|version|!) -clm_root Root directory of clm source code (default: directory above location of this script) -cppdefs A string of user specified CPP defines. Appended to @@ -647,12 +647,12 @@ The output to the above command is as follows: Parameters relating to the build which are system dependent will be ignored. -exlaklayers Turn on extra lake layers (25 layers instead of 10) [on | off] - (ONLY valid for CLM4.5!) + (ONLY valid for +|version|!) -help [or -h] Print usage to STDOUT. -nofire Turn off wildfires for BGC setting of CN (default includes fire for CN) -noio Turn history output completely off (typically for testing). - -phys Value of clm4_0 or clm4_5 (default is clm4_0) + -phys Value of clm4_0 or +|version| (default is clm4_0) -silent [or -s] Turns on silent mode - only fatal messages issued. -sitespf_pt Setup for the given site specific single-point resolution. -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] @@ -676,7 +676,7 @@ The output to the above command is as follows: eliminate inconsistent duplicate soil hydraulic parameters used in soil biogeochem. (requires either CN or CNDV) - (ONLY valid for CLM4.5!) + (ONLY valid for +|version|!) [on,off or colon delimited list of no options] (default off) no-vert Turn vertical soil Carbon profile off no-cent Turn CENTURY off diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 131078c648..2300c8ad60 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -16,16 +16,16 @@ Definition of Namelist items and their default values Here we point to you where you can find the definition of each namelist item and separately the default values for them. The default values may change depending on the resolution, land-mask, simulation-year and other attributes. Both of these files are viewable in your web browser, and then expand each in turn. -1. `Definition of Namelists Relevant for CLM4.5 `_ +1. `Definition of Namelists Relevant for +|version| `_ 2. `Default values of each CLM4.0 Namelist Item `_ -3. `Default values of each CLM4.5 Namelist Item `_ +3. `Default values of each +|version| Namelist Item `_ List of fields that can be added to your output history files by namelist ------------------------------------------------------------------------- -One set of the namelist items allows you to add fields to the output history files: ``hist_fincl1``, ``hist_fincl2``, ``hist_fincl3``, ``hist_fincl4``, ``hist_fincl5``, and ``hist_fincl6``. The following links for `CLM4.0 History Fields `_ and `CLM4.5 History Fields `_ documents all of the history fields available and gives the long-name and units for each. The table below lists all the CLM4.5 history fields. +One set of the namelist items allows you to add fields to the output history files: ``hist_fincl1``, ``hist_fincl2``, ``hist_fincl3``, ``hist_fincl4``, ``hist_fincl5``, and ``hist_fincl6``. The following links for `CLM4.0 History Fields `_ and `+|version| History Fields `_ documents all of the history fields available and gives the long-name and units for each. The table below lists all the +|version| history fields. Definition of CLM history variables ----------------------------------- @@ -53,7 +53,7 @@ Below we will give examples of user namelists that activate different commonly u The default namelist -------------------- -Here we give the default namelist as it would be created for an "I1850CRUCLM45BGC" compset at 0.9x1.25 resolution with a gx1v6 land-mask on yellowstone. To edit the namelist you would edit the ``user_nl_clm`` user namelist with just the items you want to change. For simplicity we will just show the CLM namelist and NOT the entire file. In the sections below, for simplicity we will just show the user namelist (``user_nl_clm``) that will add (or modify existing) namelist items to the namelist. +Here we give the default namelist as it would be created for an "I1850Clm50BgcCropCru" compset at 0.9x1.25 resolution with a gx1v6 land-mask on cheyenne. To edit the namelist you would edit the ``user_nl_clm`` user namelist with just the items you want to change. For simplicity we will just show the CLM namelist and NOT the entire file. In the sections below, for simplicity we will just show the user namelist (``user_nl_clm``) that will add (or modify existing) namelist items to the namelist. Example 1-2. Default CLM Namelist --------------------------------- @@ -66,7 +66,7 @@ Example 1-2. Default CLM Namelist create_crop_landunit = .false. dtime = 1800 fatmlndfrc = '/glade/p/cesm/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' - finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850CRUCLM45BGC.0241-01-01.0.9x1.25_g1v6_simyr1850_c130531.nc' + finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850Clm50BgcCropCru.0241-01-01.0.9x1.25_g1v6_simyr1850_c130531.nc' fpftcon = '/glade/p/cesm/cseg/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc' fsnowaging = '/glade/p/cesm/cseg/inputdata/lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc' fsnowoptics = '/glade/p/cesm/cseg/inputdata/lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc' diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index 91db57fc70..d41124f8ba 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -20,37 +20,37 @@ CIME Testing scripts We first introduce the test scripts that work for all CESM components. The CIME script **create_test** runs a specific type of test, at a given resolution, for a given compset using a given machine. There is a list of different tests, but the "ERI" tests do several things at once, running from startup, as well as doing exact branch and restart tests. -So to run "ERI" testing at 2-degree with the I1850CRUCLM45 compset on yellowstone_intel you do the following. +So to run "ERI" testing at 2-degree with the I1850CRUCLM45 compset on cheyenne_intel you do the following. :: > cd scripts - > ./create_test -testname ERI.f19_g16.I1850CRUCLM45.yellowstone_intel - > cd ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id - > ./ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id.build - > ERI.f19_g16.I1850CRUCLM45.yellowstone_intel.$id.submit + > ./create_test -testname ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel + > cd ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id + > ./ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id.build + > ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id.submit When the test is done it will update the file TestStatus with either a PASS or FAIL message. -We already have a standard list of tests for clm (the "aux_clm" list of tests). To run the CLM yellowstone intel compiler test list, for the same machine and compiler you would do the following: +We already have a standard list of tests for clm (the "aux_clm" list of tests). To run the CLM cheyenne intel compiler test list, for the same machine and compiler you would do the following: :: > cd scripts - > ./create_test -xml_mach yellowstone -xml_compiler intel -xml_category aux_clm -mach yellowstone -compiler intel + > ./create_test -xml_mach cheyenne -xml_compiler intel -xml_category aux_clm -mach cheyenne -compiler intel # Normally it will submit the jobs as they are ready, but if it's interrupted you # may need to submit by hand as follows... # Submit the suite of tests (note $id refers to the integer job number for this job) - > ./cs.submit.$id.yellowstone + > ./cs.submit.$id.cheyenne # Later check the tests with... > ./cs.status.$id # The above will give a PASS or FAIL message for each test. -For more information on doing testing with the CESM scripts see the `CESM1.2.0 User's Guide `_ on testing. +For more information on doing testing with the CESM scripts see the `+|cesmrelease| User's Guide `_ on testing. Testing PTCLM ============= There is a simple test script for PTCLM called ``testcases.csh`` in the PTCLM directory (``scripts/ccsm_utils/Tools/lnd/clm/PTCLM``). -The test script is setup to run on the machines: yellowstone, frankfurt, yong, and titan. +The test script is setup to run on the machines: cheyenne, frankfurt, yong, and titan. You simply run the script interactively. The script will write out the status of tests to a file called: ``tc.job#.status``. diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 5a2fb07192..625865b7c1 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -18,7 +18,7 @@ Setup Problems The first type of problem happens when you invoke the **case.setup** command. This indicates there is something wrong with your input datasets, or the details of what you are trying to setup the model to do. -There's also a trouble-shooting chapter in the `CESM1.2.0 Scripts User's Guide `_. +There's also a trouble-shooting chapter in the `+|cesmrelease| Scripts User's Guide `_. Many of the problems with configuration can be resolved with the guidelines given there. Here we will restrict ourselves to problems from the input files. @@ -27,7 +27,7 @@ Example: Missing datasets :: > ./create_newcase -case ne60rcp6 -res ne60_g16 -compset IRCP60CN \ - -mach yellowstone_intel + -mach cheyenne_intel > ./case.setup The following is what is displayed to the screen. @@ -100,7 +100,7 @@ Below we show the log file results of a job that aborted while running. Sun Jun 20 18:24:35 MDT 2010 -- CSM EXECUTION HAS FINISHED Model did not complete - see /ptmp/erik/test_run/run/cpl.log.100620-182358 -In the next section we will talk about using the different log files to track down problems, and find out where the problem is coming from. In the section after that we give some general advice on debugging problems and some suggestions on ideas that may be helpful to track the problem down. Some of the examples below are from the `models/lnd/clm/doc/KnownBugs `_ file. +In the next section we will talk about using the different log files to track down problems, and find out where the problem is coming from. In the section after that we give some general advice on debugging problems and some suggestions on ideas that may be helpful to track the problem down. Some of the examples below are from the `$CTSMROOT/doc/KnownBugs `_ file. Tracking Problems by Querying Log Files --------------------------------------- @@ -146,10 +146,10 @@ For example, here is some output from an older version of CESM (CESM1.0.2) where NODE# NAME ( 0) be1105en.ucar.edu - "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line + "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/$CTSMROOT/src/riverroute/RtmMod.F90", line 239: 1525-155 The file name provided in the OPEN statement for unit 1 has zero length or contains all blanks. The program will recover by ignoring the OPEN statement. - "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line + "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/$CTSMROOT/src/riverroute/RtmMod.F90", line 241: 1525-001 The READ statement on the file fort.1 cannot be completed because the end of the file was reached. The program will stop. @@ -291,12 +291,12 @@ The CLM log file Of course when you are working with and making changes to CLM, most of your focus will be on the CLM log file and the errors it shows. As already pointed out if you don't see errors in the ``lnd.log.*`` file you should look in the ``cesm.log.*`` to see if any errors showed up there. -Here's an example of the ``lnd.log.*`` file when running ``PTS_MODE`` with initial conditions (this is bug 1025 in the `models/lnd/clm/doc/KnownLimitationss `_ file). +Here's an example of the ``lnd.log.*`` file when running ``PTS_MODE`` with initial conditions (this is bug 1025 in the `$CTSMROOT/doc/KnownLimitationss `_ file). :: Successfully initialized variables for accumulation - reading restart file I2000CN_f09_g16_c100503.clm2.r.0001-01-01-00000.nc + reading restart file I2000CN_f09_g17_gl4_c100503.clm2.r.0001-01-01-00000.nc Reading restart dataset ERROR - setlatlon.F:Cant get variable dim for lat or lsmlat ENDRUN: called without a message string @@ -319,7 +319,7 @@ Here's an example of a problem that occurs when the wrong prescribed aerosol fil The batch log files ------------------- -The names of the batch log files will depend on the batch system of the machine that is being used. They will normally be in the script directory. Usually, they don't contain important information, but they are a last resort place to look for error messages. On the NCAR system "yellowstone" the batch files are called with names that start with the batch submission script and then either "stderr.o" or "stdout.o", with the job number at the end. +The names of the batch log files will depend on the batch system of the machine that is being used. They will normally be in the script directory. Usually, they don't contain important information, but they are a last resort place to look for error messages. On the NCAR system "cheyenne" the batch files are called with names that start with the batch submission script and then either "stderr.o" or "stdout.o", with the job number at the end. General Advice on Debugging Run time Problems ============================================= diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index ec626641e5..774e4651e6 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -106,7 +106,7 @@ More details on each environment variable. .. note:: There are several files that are copies of the original files from either models``/lnd/clm/src/util_share``, ``models/csm_share/shr``, or copies from other tool directories. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. -The *README.filecopies* (which can be found in ``models/lnd/clm/tools``) is repeated here. +The *README.filecopies* (which can be found in ``$CTSMROOT/tools``) is repeated here. -.. include:: ../../clm5.0/tools/README.filecopies +.. include:: ../../+|version|/tools/README.filecopies :literal: diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst index e921858b4c..53169513f0 100644 --- a/doc/source/users_guide/using-clm-tools/cprnc.rst +++ b/doc/source/users_guide/using-clm-tools/cprnc.rst @@ -26,4 +26,4 @@ Options: See the **cprnc** `README `_ file for more details. -.. note:: To compare files with OUT a time axis you can use the **cprnc.ncl** NCL script in ``models/lnd/clm/tools/shared/ncl_scripts``. It won't give you the details on the differences but will report if the files are identical or different. +.. note:: To compare files with OUT a time axis you can use the **cprnc.ncl** NCL script in ``$CTSMROOT/tools/ncl_scripts``. It won't give you the details on the differences but will report if the files are identical or different. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index 332aa5bd65..006c6b679b 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -15,7 +15,7 @@ SCRIP grid files for all the standard model resolutions and the raw surface data Using mknocnmap.pl to create grid and maps for single-point regional grids -------------------------------------------------------------------------- -If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use **mknoocnmap.pl** in ``models/lnd/clm/tools/shared/mkmapdata`` which will create both the SCRIP grid file you need (using ``models/lnd/clm/tools/shared/mkmapgrids/mkscripgrid.ncl`` AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use **ESMF_RegridWeightGen** to create the mapping file, and **gen_domain** to create the domain file. Like other tools, ``shared/mkmapdata/mknoocnmap.pl`` has a help option with the following: +If you want to create a regular latitude/longitude single-point or regional grid, we suggest you use **mknoocnmap.pl** in ``$CTSMROOT/tools/mkmapdata`` which will create both the SCRIP grid file you need (using ``$CTSMROOT/tools/mkmapgrids/mkscripgrid.ncl`` AND an identity mapping file assuming there is NO ocean in your grid domain. If you HAVE ocean in your domain you could modify the mask in the SCRIP grid file for ocean, and then use **ESMF_RegridWeightGen** to create the mapping file, and **gen_domain** to create the domain file. Like other tools, ``./mkmapdata/mknoocnmap.pl`` has a help option with the following: :: SYNOPSIS @@ -43,20 +43,20 @@ See `Figure 2-5 `_ for a visual representation of this process. ``mkmapdata.sh`` uses the above SCRIP grid input files to create SCRIP mapping data files (uses ESMF). -The bash shell script ``models/lnd/clm/tools/shared/mkmapgrids/mkmapdata.sh`` uses **ESMF_RegridWeightGen** to create a list of maps from the raw datasets that are input to **mksurfdata_map**. +The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses **ESMF_RegridWeightGen** to create a list of maps from the raw datasets that are input to **mksurfdata_map**. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each DIFFERENT raw dataset. See `Figure 2-3 `_ for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs **ESMF_RegridWeightGen** for each one. You can then either enter the datasets into the XML database (see `Chapter 3 `_ or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to **mksurfdata_map** (see `the Section called Running mksurfdata.pl `_ below). -Use the "-phys" option to specify if you are creating mapping files for clm4_0 or clm4_5 (the list of raw datafiles is somewhat different between the two). +Use the "-phys" option to specify if you are creating mapping files for clm4_0 or +|version| (the list of raw datafiles is somewhat different between the two). mkmapdata.sh has a help option with the following :: - ../../tools/shared/mkmapdata/mkmapdata.sh + ../../tools/mkmapdata/mkmapdata.sh ********************** - usage on yellowstone: + usage on cheyenne: ./mkmapdata.sh valid arguments: @@ -74,8 +74,8 @@ mkmapdata.sh has a help option with the following Model output grid type supported values are [regional,global], (default is global) [-p|--phys ] - Whether to generate mapping files for clm4_0 or clm4_5 - supported values are [clm4_0,clm4_5], (default is clm4_5) + Whether to generate mapping files for clm4_0 or +|version| + supported values are [clm4_0,+|version|], (default is +|version|) [-b|--batch] Toggles batch mode usage. If you want to run in batch mode @@ -107,7 +107,7 @@ mkmapdata.sh has a help option with the following ********************** -.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is CLM4.5. +.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is +|version|. Figure 2-3. Details of running mkmapdata.sh ------------------------------------------- diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index d1ab21e2b7..8f43d8ac0a 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -25,7 +25,7 @@ Creating a Complete Set of Files for Input to CLM 1. Create SCRIP grid datasets (if NOT already done) - First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: $CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc. The mkmapgrids and mkscripgrid.ncl NCL script in the models/lnd/clm/tools/shared/mkmapgrids directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. + First you need to create a descriptor file for your grid, that includes the locations of cell centers and cell corners. There is also a "mask" field, but in this case the mask is set to one everywhere (i.e. all of the masks for the output model grid are "nomask"). An example SCRIP grid file is: $CSMDATA/lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc. The mkmapgrids and mkscripgrid.ncl NCL script in the $CTSMROOT/tools/mkmapgrids directory can help you with this. SCRIP grid files for all the standard CLM grids are already created for you. See the Section called Creating an output SCRIP grid file at a resolution to run the model on for more information on this. 2. Create domain dataset (if NOT already done) @@ -33,11 +33,11 @@ Creating a Complete Set of Files for Input to CLM 3. Create mapping files for mksurfdata_map (if NOT already done) - Create mapping files for mksurfdata_map with mkmapdata.sh in models/lnd/clm/tools/shared/mkmapdata. See the Section called Creating mapping files that mksurfdata_map will use for more information on this. + Create mapping files for mksurfdata_map with mkmapdata.sh in $CTSMROOT/tools/mkmapdata. See the Section called Creating mapping files that mksurfdata_map will use for more information on this. 4. Create surface datasets - Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or clm4_5 for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. + Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or +|version| for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. 5. Create some sort of initial condition dataset @@ -49,19 +49,19 @@ Creating a Complete Set of Files for Input to CLM b. Use interpinic to interpolate existing initial condition datasets - The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or clm4_5 for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. + The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or +|version| for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. c. Start up from arbitrary initial conditions - The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using CLM4.5-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. + The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using +|version|-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. .. warning:: This is NOT recommended as many fields in CLM take a long time to equilibrate. 6. Enter the new datasets into the build-namelist XML database The last optional thing to do is to enter the new datasets into the build-namelist XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. -The ``models/lnd/clm/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: +The ``$CTSMROOT/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: -.. include:: ../../clm5.0/tools/README +.. include:: ../../+|version|/tools/README :literal: diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index e71c97cf3d..4bb40f21c6 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -5,28 +5,28 @@ ======================== There are several tools provided with CLM that allow you to create your own input datasets at resolutions you choose, or to interpolate initial conditions to a different resolution, or used to compare CLM history files between different cases. -The tools are all available in the ``models/lnd/clm/tools`` directory. -Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``shared/ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. +The tools are all available in the ``$CTSMROOT/tools`` directory. +Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``./ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. Some of the NCL scripts are very specialized and not meant for general use, and we won't document them here. They still contain documentation in the script itself and the README file in the tools directory. -The tools are divided into three directories for three categories: clm4_0, clm4_5, and shared. -The first two are of course for tools that are designed to work with either the CLM4.0 or CLM4.5 versions of the model. +The tools are divided into three directories for three categories: clm4_0, +|version|, and shared. +The first two are of course for tools that are designed to work with either the CLM4.0 or +|version| versions of the model. The last one are shared utilities that can be used by either, or have a "-phys" option so you can specify which version you want to use. The list of generally important scripts and programs are as follows. 1. *tools/cprnc* (relative to top level directory) to compare NetCDF files with a time axis. -#. *shared/mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``shared/mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. +#. *./mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``./mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. -#. *shared/mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). +#. *./mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). -#. *shared/gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. +#. *./gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. -#. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and clm4_5 versions). +#. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and +|version| versions). -#. *shared/mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or clm4_5. +#. *./mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or +|version|. In the sections to come we will go into detailed description of how to use each of these tools in turn. First, however we will discuss the common environment variables and options that are used by all of the FORTRAN tools. @@ -56,9 +56,9 @@ Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: :: - models/lnd/clm/bld/namelist_files/namelist_definition.xml`` file + $CTSMROOT/bld/namelist_files/namelist_definition.xml`` file and default values in the: - models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml`` file. + $CTSMROOT/bld/namelist_files/namelist_defaults_clm_tools.xml`` file. ----------------------------------------------- Running FORTRAN tools with command line options @@ -75,14 +75,14 @@ Running FORTRAN tools built with SMP=TRUE When you enable ``SMP=TRUE`` on your build of one of the tools that make use of it, you are using OpenMP for shared memory parallelism (SMP). In SMP loops are run in parallel with different threads run on different processors all of which access the same memory (called on-node). Thus you can only usefully run up to the number of processors that are available on a single-node of the machine you are running on. -For example, on the NCAR machine yellowstone there are 16 processors per node, but the SMT hardware on the machine allows you to submit twice as many threads or 32 threads. +For example, on the NCAR machine cheyenne there are 16 processors per node, but the SMT hardware on the machine allows you to submit twice as many threads or 32 threads. --------- Using NCL --------- -In the tools directory ``models/lnd/clm/tools/shared/ncl_scripts`` and in a few other locations there are scripts that use NCAR Command Language (NCL). +In the tools directory ``$CTSMROOT/tools/ncl_scripts`` and in a few other locations there are scripts that use NCAR Command Language (NCL). Unlike the FORTRAN tools, you will need to get a copy of NCL in order to use them. You also won't have to build an executable in order to use them, hence no Makefile is provided. NCL is provided for free download as either binaries or source code from: `http://www.ncl.ucar.edu/ `_. From 518d92c09fcfc7ad85eaa37715bf2d804ea09097 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 15:08:14 -0600 Subject: [PATCH 188/730] Straighten out some of the issues from the global sed script --- .../users_guide/overview/getting-help.rst | 12 +- .../users_guide/overview/quickstart.rst | 2 +- ...LM5.0-biogeochemistry-(CLMBGC-spinup).rst} | 0 .../running-special-cases/index.rst | 2 +- .../choosing-a-compset.rst | 282 ------------------ .../building-the-clm-tools.rst | 2 +- .../creating-surface-datasets.rst | 2 +- 7 files changed, 10 insertions(+), 292 deletions(-) rename doc/source/users_guide/running-special-cases/{CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst => CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst} (100%) diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index 42df1b989a..f78349e1ff 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -33,17 +33,17 @@ The main CLM web page contains information on the CLM, it's history, developers, Also note that several of the XML database files can be viewed in a web browser to get a nice table of namelist options, namelist defaults, or compsets. Simply view them as a local file and bring up one of the following files: - `$CTSMROOT/bld/namelist_files/namelist_definition_clm4_0.xml `_ -- definition of CLM4.0 namelist items. -- `$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml `_ -- definition of CLM4.0 namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml `_ -- definition of CLM4.5/CLM5.0 namelist items. - `$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_0.xml `_ -- default values for CLM4.0 namelist items. -- `$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml `_ -- default values for +|version| namelist items. +- `$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml `_ -- default values for CLM4.5/CLM5.0 namelist items. - `scripts/ccsm_utils/Case.template/config_definition.xml `_ -- definition of all env_*.xml items. - `scripts/ccsm_utils/Case.template/config_compsets.xml `_ -- definition of all the compsets. - `$CTSMROOT/bld/namelist_files/history_fields_clm4_0.xml `_ -- definition of CLM4.0 history fields. -- `$CTSMROOT/bld/namelist_files/history_fields_+|version|.xml `_ -- definition of +|version| history fields. +- `$CTSMROOT/bld/namelist_files/history_fields_clm4_5.xml `_ -- definition of CLM4.5/CLM5.0 history fields. ------------------------- +---------------------------- Reporting bugs in +|version| ------------------------- +---------------------------- If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for +|version| in +|cesmrelease| is in the $CTSMROOT/doc/KnownBugs file, and the list of issues for +|cesmrelease| is at... `http://www.cesm.ucar.edu/models/cesm1.2//tags/+|cesmrelease|/#PROBLEMS `_. @@ -64,7 +64,7 @@ CLM CLMBGC Community Land Model (+|version|) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is - ``./xmlchange CLM_CONFIG_OPTS="phys +|version| -bgc cn -vsoilc_centbgc on -clm4me on"`` + ``./xmlchange CLM_CONFIG_OPTS="phys clm5_0 -bgc cn -vsoilc_centbgc on -clm4me on"`` CLMCN Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or +|version|) The CLM_CONFIG_OPTS option for this is diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index 3091595c68..fa62be5422 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -33,5 +33,5 @@ Note other directories have README files that explain different components and t The Quickstart.GUIDE (which can be found in ``$CTSMROOT/doc``) is repeated here. -.. include:: ../../+|version|/doc/Quickstart.GUIDE +.. include:: ../../clm5.0/doc/Quickstart.GUIDE :literal: diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM4.5-biogeochemistry-(CLMBGC-spinup).rst rename to doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index 95231e9041..693c83d550 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -16,7 +16,7 @@ Running Special Cases running-the-prognostic-crop-model.rst running-with-irrigation.rst CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst - CLM-4.4-Spinning-up-the-+|version|-biogeochemistry-(CLMBGC-spinup).rst + CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst index e108901b27..38bfcd7da1 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst @@ -19,293 +19,11 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) `Supported CLM Configurations `_ are listed in `Table 1-1 `_ for the Scientifically Supported compsets (have been scientifically validated with long simulations) and in `Table 1-2 `_ for the Functionally Supported compsets (we've only checked that they function). -**Scientifically Supported I Compsets:** - -+------------+--------------+-----------+-----------------+----------------+ -| Short Name | Description | Atm. | Compset Alias | Period | -| | | Forcing | Name | | -+============+==============+===========+=================+================+ -| +|version|SP | Satellite | CRUNCEP | 1850CRUCLM45 | 1850 | -| | phenology | | | | -| | with new | | | | -| | biogeophys | | | | -+------------+--------------+-----------+-----------------+----------------+ -| +|version|SP | New | CRUNCEP | I1850Clm50BgcCropCru| 1850 | -| | biogeophys | +-----------------+----------------+ -| | + CENTURY- | | I20TRCRUCLM45BGC| 20th Century | -| | like | | | | -| | vertically | | | | -| | resolved | | | | -| | soil | | | | -| | BGC + CH4 | | | | -| | emissions, | | | | -| | nitrogen | | | | -| | updates | | | | -+------------+--------------+-----------+-----------------+----------------+ -| +|version|CN | New | CRUNCEP | I1850CRUCLM45CN | 1850 | -| | biogeophys | | | | -| | + CN soil | | | | -| | BGC, updates | | | | -+------------+--------------+-----------+-----------------+----------------+ -| CLM4SP | As in | Qian | I1850 | 1850 | -| | CCSM4/CESM1 | +-----------------+----------------+ -| | release | | I | 2000 | -| | | +-----------------+----------------+ -| | | | I20TR | 20th Century | -+------------+--------------+-----------+-----------------+----------------+ -| CLM4CN | As in | Qian | I1850CN | 1850 | -| | CCSM4/CESM1 | +-----------------+----------------+ -| | release | | ICN | 2000 | -| | | +-----------------+----------------+ -| | | | I20TRCN | 20th Century | -| | | +-----------------+----------------+ -| | | | IRCP26CN | RCP 2.6 to 2100| -| | | +-----------------+----------------+ -| | | | IRCP45CN | RCP 4.5 to 2100| -| | | +-----------------+----------------+ -| | | | IRCP60CN | RCP 6.0 to 2100| -| | | +-----------------+----------------+ -| | | | IRCP85CN | RCP 8.5 to 2100| -+------------+--------------+-----------+-----------------+----------------+ - -**Functionally Supported I Compsets:** - -+------------+-------------------+-------------------+-----------------+--------+ -| Short Name | Description | Atm. | Compset Alias | Period | -| | | Forcing | Name | | -+============+===================+===================+=================+========+ -| +|version|BGC- | ICRUCLM45BGCCROP | New biogeophys + | CRUNCEP | 2000 | -| CROP | | CENTURY-like | | | -| | | vertically | | | -| | | resolved soil | | | -| | | BGC + CH4 | | | -| | | emissions, | | | -| | | nitrogen updates | | | -| | | with prognostic | | | -| | | CROP | | | -| | | | | | -+------------+-------------------+-------------------+-----------------+--------+ -| +|version|BGC- | I1850Clm50BgcCropCruDV| New biogeophys | CRUNCEP | 1850 | -| DV | | + CENTURY-like | | | -| | | vertically | | | -| | | resolved soil | | | -| | | BGC + CH4 | | | -| | | emissions, | | | -| | | nitrogen updates | | | -| | | with DV | | | -| | | | | | -| | | | | | -| | | | | | -+------------+-------------------+-------------------+-----------------+--------+ -| +|version|SP- | ICLM45VIC | Satellite | Qian | 2000 | -| VIC | | phenology with new| | | -| | | biogeophys with | | | -| | | VIC hydrology | | | -+------------+-------------------+-------------------+-----------------+--------+ -|CLM4CN-CROP | ICNCROP | As in CCSM4/CESM1 | Qian | 2000 | -| | | release | | | -+------------+-------------------+-------------------+-----------------+--------+ -|CLM4CN-DV | ICNDV | As in CCSM4/CESM1 | Qian | 1850 | -| | | release | | | -+------------+-------------------+-------------------+-----------------+--------+ - Here is the entire list of compsets available. Note that using the "-user_compset" option even more combinations are possible. In the list below we give the alias name and then the long name which describes each component in parenthesis. Alias (Long-name with time-period and each component) -1. ``I`` (2000_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850`` (1850_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CLM45`` (1850_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CLM45BGC`` (1850_DATM%QIA_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CLM45CN`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CLM45CNF`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM%FLOOD_SGLC_SWAV) - -#. ``I1850CN`` (1850_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CRU`` (1850_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CRUCLM45`` (1850_DATM%CRU_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850Clm50BgcCropCru`` (1850_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850Clm50BgcCropCruDV`` (1850_DATM%CRU_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CRUCLM45CN`` (1850_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850CRUCN`` (1850_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850SPINUPCLM45BGC`` (1850_DATM%S1850_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1850Clm50BgcSpinup`` (1850_DATM%S1850_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1PT`` (2000_DATM%1PT_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I1PTCLM45`` (2000_DATM%1PT_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TR`` (20TR_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCLM45`` (20TR_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCLM45CN`` (20TR_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCN`` (20TR_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCRU`` (20TR_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCRUCLM45`` (20TR_DATM%CRU_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCRUCLM45BGC`` (20TR_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCRUCLM45CN`` (20TR_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I20TRCRUCN`` (20TR_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I4804`` (4804_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I4804CLM45`` (4804_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I4804CLM45CN`` (4804_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``I4804CN`` (4804_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45`` (2000_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45BGC`` (2000_DATM%QIA_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45BGCCROP`` (2000_DATM%QIA_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45BGCDV`` (2000_DATM%QIA_CLM45%BGCDV_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45BGCDVCROP`` (2000_DATM%QIA_CLM45%BGCDV-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45BGCNoVS`` (2000_DATM%QIA_CLM45%NoVS_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45CN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45CNCROP`` (2000_DATM%QIA_CLM45%CN-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45CNDV`` (2000_DATM%QIA_CLM45%CNDV_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45CNTEST`` (2003_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV_TEST) - -#. ``ICLM45CRUBGC`` (2000_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45GLCMEC`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV_TEST) - -#. ``ICLM45SNCRFRC`` (2000_DATM%QIA_CLM45%SP-SNCR_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45USUMB`` (2000_DATM%1PT_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%1x1_US-UMB) - -#. ``ICLM45VIC`` (2000_DATM%QIA_CLM45%SP-VIC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICLM45alaskaCN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%13x12pt_f19_alaskaUSA) - -#. ``ICN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICNCROP`` (2000_DATM%QIA_CLM40%CN-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICNDV`` (2000_DATM%QIA_CLM40%CNDV_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICNDVCROP`` (2000_DATM%QIA_CLM40%CNDV-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICNTEST`` (2003_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV_TEST) - -#. ``ICRU`` (2000_DATM%CRU_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICRUCLM45`` (2000_DATM%CRU_CLM45_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICRUCLM45BGC`` (2000_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICRUCLM45BGCCROP`` (2000_DATM%CRU_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICRUCLM45BGCTEST`` (2003_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV_TEST) - -#. ``ICRUCLM45CN`` (2000_DATM%CRU_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ICRUCN`` (2000_DATM%CRU_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IG`` (2000_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG1850`` (1850_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG1850CLM45`` (1850_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG1850CLM45CN`` (1850_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG1850CN`` (1850_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG20TR`` (20TR_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG20TRCLM45`` (20TR_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG20TRCLM45CN`` (20TR_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG20TRCN`` (20TR_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG4804`` (4804_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG4804CLM45`` (4804_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG4804CLM45CN`` (4804_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IG4804CN`` (4804_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGCLM45`` (2000_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGCLM45CN`` (2000_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGCN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGLCMEC`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV_TEST) - -#. ``IGRCP26CLM45CN`` (RCP2_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP26CN`` (RCP2_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP45CLM45CN`` (RCP4_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP45CN`` (RCP4_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP60CLM45CN`` (RCP6_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP60CN`` (RCP6_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP85CLM45CN`` (RCP8_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IGRCP85CN`` (RCP8_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_CISM1_SWAV) - -#. ``IRCP26CLM45CN`` (RCP2_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP26CN`` (RCP2_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP45CLM45CN`` (RCP4_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP45CN`` (RCP4_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP60CLM45CN`` (RCP6_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP60CN`` (RCP6_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP85CLM45CN`` (RCP8_DATM%QIA_CLM45%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``IRCP85CN`` (RCP8_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ISNCRFRC`` (2000_DATM%QIA_CLM40%SP-SNCR_SICE_SOCN_RTM_SGLC_SWAV) - -#. ``ITEST`` (2003_DATM%QIA_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV_TEST) - -#. ``ITESTCLM45`` (2003_DATM%QIA_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV_TEST) - -#. ``IUSUMB`` (2000_DATM%1PT_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%1x1_US-UMB) - -#. ``IalaskaCN`` (2000_DATM%QIA_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV_CLMUSRDAT%13x12pt_f19_alaskaUSA) - Compsets coupled to active atmosphere with data ocean ----------------------------------------------------- CAM compsets are compsets that start with "E" or "F" in the name. They are described more fully in the scripts documentation or the CAM documentation. "E" compsets have a slab ocean model while "F" compsets have a data ocean model. diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 774e4651e6..4f51314d48 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -108,5 +108,5 @@ More details on each environment variable. The *README.filecopies* (which can be found in ``$CTSMROOT/tools``) is repeated here. -.. include:: ../../+|version|/tools/README.filecopies +.. include:: ../../clm5.0/tools/README.filecopies :literal: diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index 8f43d8ac0a..ae90a3609b 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -62,6 +62,6 @@ Creating a Complete Set of Files for Input to CLM The ``$CTSMROOT/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: -.. include:: ../../+|version|/tools/README +.. include:: ../../clm5.0/tools/README :literal: From 4372fd30e4fced8a665071085ccef50320d97a24 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 15:11:08 -0600 Subject: [PATCH 189/730] Fix a warning about header --- ...Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst index c92892ba8d..50437d56b5 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst @@ -1,8 +1,8 @@ .. _spinning-up-clm45-bgc: -====================== +========================= Spinup of +|version|-BGC -====================== +========================= To get the +|version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). From 29fb4e4f03d7a10b8259f3d8a30f9d5bcb801a79 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Jun 2018 16:14:27 -0600 Subject: [PATCH 190/730] Fix a couple issues --- doc/source/conf.py | 2 +- doc/source/users_guide/overview/introduction.rst | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a573b2a1d0..9a112db91b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -51,7 +51,7 @@ # General information about the project. project = u'clmdoc' -copyright = u'2017, Erik Kluzek, Bill Sacks, Ben Andre' +copyright = u'2018, Erik Kluzek, Bill Sacks, Ben Andre' author = u'Erik Kluzek, Bill Sacks, Ben Andre' # The version info for the project you're documenting, acts as replacement for diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index b65e622b45..706c4f5628 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -79,11 +79,11 @@ and then finally do it by hand. If you are using non supported machines you may also want to use the test scripts to make sure your machine is working correctly. -.. _what-is-new-with-+|version|: +.. _what-is-new-with-clm5_0: -========================= +============================ What is New with +|version| -========================= +============================ `What's new with +|version| science `_ The +|cesmrelease| `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. From e1063a221b6f8b9e0b8d12bf07126978ff863928 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 15 Jun 2018 10:45:35 -0600 Subject: [PATCH 191/730] Write out clm version in title, rather than use variable substitution --- ...inning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst index 50437d56b5..9065869bb4 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst @@ -1,8 +1,8 @@ .. _spinning-up-clm45-bgc: -========================= - Spinup of +|version|-BGC -========================= +===================== + Spinup of CLM5.0-BGC +===================== To get the +|version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). From 7a687480f6bcd5f91a3674c86f3d75681e758a6c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 15 Jun 2018 12:01:37 -0600 Subject: [PATCH 192/730] Get version/release substitutions working correctly, and add subs for cesmrelease and cesmversion --- ...w-Files-to-the-build-namelist-Database.rst | 4 +- .../CLM-3.1-Managing-Your-Own-Data-files.rst | 4 +- .../CLM-3.2-Adding-Resolution-Names.rst | 2 +- ...3-Adding-or-Changing-Default-Filenames.rst | 8 +- doc/source/users_guide/conf.py | 2 - doc/source/users_guide/index.rst | 2 + .../users_guide/overview/getting-help.rst | 28 +++--- .../users_guide/overview/introduction.rst | 94 +++++++++---------- .../users_guide/overview/quickstart.rst | 14 +-- .../overview/scientific_validation.rst | 14 +-- .../running-PTCLM/introduction-to-ptclm.rst | 2 +- .../users_guide/running-PTCLM/using-ptclm.rst | 2 +- .../running-single-point-configurations.rst | 4 +- ...CLM5.0-biogeochemistry-(CLMBGC-spinup).rst | 12 +-- ...transient-historical-CO2-concentration.rst | 2 +- .../running-the-prognostic-crop-model.rst | 2 +- .../running-with-irrigation.rst | 4 +- .../customizing-the-clm-configuration.rst | 18 ++-- .../customizing-the-clm-namelist.rst | 6 +- doc/source/users_guide/testing/testing.rst | 2 +- .../trouble-shooting/trouble-shooting.rst | 2 +- ...g-input-for-surface-dataset-generation.rst | 8 +- .../creating-surface-datasets.rst | 6 +- .../what-are-the-clm-tools.rst | 8 +- 24 files changed, 125 insertions(+), 125 deletions(-) diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 8854d9e4d9..60137563db 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -14,11 +14,11 @@ If you have a LOT of files to keep track of it also might be easier than keeping If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. There are two parts to adding files to the build-namelist database. -The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml`` file (and in the ``$CTSMROOT/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). +The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_|version|.xml`` file (and in the ``$CTSMROOT/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). You can then use the new resolution by using ``CLM_USRDAT_NAME``. If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``scripts/ccsm_utils/Case.template/config_grid.xml`` file. -The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|_tools.xml`` file for CLM tools). +The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst index 558c877157..6d4a65657e 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst @@ -4,7 +4,7 @@ Managing Your Data Own Files ============================== -If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `+|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. +If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. @@ -39,7 +39,7 @@ You can also use **find** to list files that have a particular pattern in the na -If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `+|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. +If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst index e7896e1206..b9b767ca06 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst @@ -5,7 +5,7 @@ ========================= If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. -The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_+|version|.xml`` file. +The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_|version|.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the id="res" entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst index 6393a74ce3..4c8c9884de 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst @@ -4,7 +4,7 @@ Changing Default Filenames ============================ -To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|.xml`` and either change an existing filename or add a new one. +To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|.xml`` and either change an existing filename or add a new one. Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. Attributes include the: resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (rcp) for future scenarios, and the type of biogeochemistry (bgc) model used. For example the fatmgrid for the 1.9x2.5 resolution is as follows: @@ -18,8 +18,8 @@ lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c130415.nc Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (crop) attributes. -To add or change the default filenames for CLM tools edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_+|version|_tools.xml`` and either change an existing filename or add a new one. -Editing this file is similar to the ``namelist_defaults_+|version|.xml`` talked about above. +To add or change the default filenames for CLM tools edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` and either change an existing filename or add a new one. +Editing this file is similar to the ``namelist_defaults_|version|.xml`` talked about above. ---------------------------- @@ -27,7 +27,7 @@ What are the required files? ---------------------------- Different types of simulations and different types of configurations for CLM require different lists of files. -The +|version|-BGC or Carbon Nitrogen (cn) Biogeochemistry model for example requires ``stream_fldfilename_ndep`` files, which are NOT required by CLMSP. +The |version|-BGC or Carbon Nitrogen (cn) Biogeochemistry model for example requires ``stream_fldfilename_ndep`` files, which are NOT required by CLMSP. Transient simulations also require transient datasets, and the names of these datasets are sometimes different from the static versions (sometimes both are required as in the dynamic PFT cases). diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index 0294e7cef8..c717685979 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -63,8 +63,6 @@ # The full version, including alpha/beta/rc tags. release = u'release-clm5.0.01' -cesmrelease = u'release-cesm2.0.00' - # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index f3160a30ed..625bd84107 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -5,6 +5,8 @@ .. _users-guide: +.. |cesmrelease| replace:: CESM2.0.0 + ##################################### |version| User's Guide ##################################### diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index f78349e1ff..f5e5a0f059 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -3,15 +3,15 @@ ============== Getting Help ============== -In addition to this users-guide there are several other resources that are available to help you use +|version|. The first one is the +|cesmrelease| User's-Guide, which documents the entire process of creating cases with +|cesmrelease|. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in +|cesmrelease|. +In addition to this users-guide there are several other resources that are available to help you use |version|. The first one is the |cesmrelease| User's-Guide, which documents the entire process of creating cases with |cesmrelease|. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in |cesmrelease|. --------------------------- The CESM User's-Guide --------------------------- -+|release| -+|release| in +|cesmrelease| is always run from within the standard +|cesmrelease| build and run scripts. Therefore, the user of +|version| should familiarize themselves with the +|cesmrelease| scripts and understand how to work with them. User's-Guide documentation on the +|cesmrelease| scripts are available from the following web-page. The purpose of this +|version| in +|cesmrelease| User's Guide is to give the +|version| user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the +|cesmrelease| Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. +|release| +|release| in |cesmrelease| is always run from within the standard |cesmrelease| build and run scripts. Therefore, the user of |version| should familiarize themselves with the |cesmrelease| scripts and understand how to work with them. User's-Guide documentation on the |cesmrelease| scripts are available from the following web-page. The purpose of this |version| in |cesmrelease| User's Guide is to give the |version| user more complete details on how to work with CLM and the set of tools that support CLM, as well as to give examples that are unique to the use of CLM. However, the |cesmrelease| Scripts User's-Guide remains the primary source to get detailed information on how to build and run the CESM system. -`+|cesmrelease| Quickstart Guide `_ +`|cesmrelease| Quickstart Guide `_ ----------------------- The CESM Bulletin Board @@ -42,11 +42,11 @@ Also note that several of the XML database files can be viewed in a web browser - `$CTSMROOT/bld/namelist_files/history_fields_clm4_5.xml `_ -- definition of CLM4.5/CLM5.0 history fields. ---------------------------- -Reporting bugs in +|version| +Reporting bugs in |version| ---------------------------- -If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for +|version| in +|cesmrelease| is in the $CTSMROOT/doc/KnownBugs file, and the list of issues for +|cesmrelease| is at... -`http://www.cesm.ucar.edu/models/cesm1.2//tags/+|cesmrelease|/#PROBLEMS `_. +If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for |version| in |cesmrelease| is in the $CTSMROOT/doc/KnownBugs file, and the list of issues for |cesmrelease| is at... +`http://www.cesm.ucar.edu/models/cesm1.2//tags/|cesmrelease|/#PROBLEMS `_. --------------------------------------- Some Acronym's and Terms We'll be Using @@ -62,22 +62,22 @@ CLM Community Land Model (CLM). The prognostically active land model component of CESM. CLMBGC - Community Land Model (+|version|) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is + Community Land Model (|version|) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="phys clm5_0 -bgc cn -vsoilc_centbgc on -clm4me on"`` CLMCN - Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or +|version|) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or |version|) The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cn" -append`` CLMSP - Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or +|version|) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or |version|) The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc none" -append`` CLMU - Community Land Model (CLM) Urban Model (either CLM4.0 or +|version|). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). + Community Land Model (CLM) Urban Model (either CLM4.0 or |version|). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). CRUNCEP The Climate Research Unit (CRU) analysis of the NCEP atmosphere reanalysis atmosphere forcing data. This can be used to drive CLM with atmosphere forcing from 1901 to 2010. We also DO expect to be able to update this dataset beyond 2010 as newer data becomes available. @@ -86,7 +86,7 @@ DATM Data Atmosphere Model (DATM) the prescribed data atmosphere component for CESM. Forcing data that we provide are either the Qian or CRUNCEP forcing datasets (see below). DV - Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either +|version|-BGC or CLMCN for either CLM4.0 or +|version|). The CLM_CONFIG_OPTS option for this is + Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either |version|-BGC or CLMCN for either CLM4.0 or |version|). The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cndv" -append`` @@ -103,7 +103,7 @@ PFT Plant Function Type (PFT). A type of vegetation that CLM parameterizes. PTCLM - PoinT CLM (PTCLM) a python script that operates on top of CLM for +|version| to run single point simulations for CLM. + PoinT CLM (PTCLM) a python script that operates on top of CLM for |version| to run single point simulations for CLM. Qian The Qian et. al. analysis of the NCEP forcing data. This can be used to drive CLM with atmosphere forcing from 1948 to 2004. We do NOT expect to be able to update this dataset beyond 2004. @@ -112,6 +112,6 @@ SCRIP Spherical Coordinate Remapping and Interpolation Package (SCRIP). We use it's file format for specifying both grid coordinates as well as mapping between different grids. VIC - Variable Infiltration Capacity (VIC) model for hydrology. This is an option to +|version| in place of the standard +|version| hydrology. The CLM_CONFIG_OPTS option for this is + Variable Infiltration Capacity (VIC) model for hydrology. This is an option to |version| in place of the standard |version| hydrology. The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-vichydro on" -append`` diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 706c4f5628..a7e1f6c050 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -1,6 +1,6 @@ .. _introduction: -**User's Guide to version +|version| of the Community Land Model (CLM)** +**User's Guide to version |version| of the Community Land Model (CLM)** **Authors: Benjamin Andre, Erik Kluzek, William Sacks** @@ -20,33 +20,33 @@ P. O. Box 3000, Boulder, Colorado 80307-300 Introduction ============== -The Community Land Model (+|release| in +|cesmrelease|) is the latest in a +The Community Land Model (|release| in |cesmrelease|) is the latest in a series of global land models developed by the CESM Land Model Working Group (LMWG) and maintained at the National Center for Atmospheric Research (NCAR). This guide is intended to instruct both the novice and experienced user on running CLM. This guide pertains to the latest -version +|version| in +|cesmrelease| available for download from the public -release subversion repository as a part of +|cesmrelease|. Documentation +version |version| in |cesmrelease| available for download from the public +release subversion repository as a part of |cesmrelease|. Documentation may be different if you are using an older version, you should either use the documentation for that release version, update to the latest version, or use the documentation inside your own source tree. There is information in the ChangeLog file and in the `What is new with -+|version| in +|cesmrelease| since previous public releases? `_ +|version| in |cesmrelease| since previous public releases? `_ regarding the changes from previous versions of CESM. -.. note:: This release of +|version| in +|cesmrelease| includes BOTH CLM4.0 - physics used in previous releases as well as the updated +|version| +.. note:: This release of |version| in |cesmrelease| includes BOTH CLM4.0 + physics used in previous releases as well as the updated |version| physics. Both CLM as well as CLM support tools allow you to trigger between the two physics modes. Most often when we refer to CLM4.0 we - are referring to the CLM4.0 physics in +|version| in +|cesmrelease| rather + are referring to the CLM4.0 physics in |version| in |cesmrelease| rather than to a specific version of CLM4.0 (where we would give the exact - version). Likewise, when referring to +|version| we are referring to the - +|version| physics in +|version| in +|cesmrelease|. + version). Likewise, when referring to |version| we are referring to the + |version| physics in |version| in |cesmrelease|. The novice user should read `Chapter 1 `_ in detail before beginning work, while the expert user should read `What is new with -+|version| in +|cesmrelease| since previous public releases? `_ and -`Quickstart to using +|version| `_ chapters, and then use the +|version| in |cesmrelease| since previous public releases? `_ and +`Quickstart to using |version| `_ chapters, and then use the more detailed chapters as reference. Before novice users go onto more technical problems covered in `Chapter 2 `_, `Chapter 3 `_, `Chapter 4 `_, or `Chapter 5 `_ they @@ -56,12 +56,12 @@ to replicate some of the examples given there. All users should read the `How to Use This Document `_ and `Other resources to get help from `_ sections to understand the document conventions and the various ways of getting help on using -+|version|. Users should also read the `What is scientifically validated -and functional in +|version| in +|cesmrelease|? `_ section to see if +|version|. Users should also read the `What is scientifically validated +and functional in |version| in |cesmrelease|? `_ section to see if their planned use of the model is something that has been scientifically validated and well tested. Users that are NOT using NCAR machines or our list of well tested machines should also read the -What are the UNIX utilities required to use +|version|? section to make +What are the UNIX utilities required to use |version|? section to make sure they have all the required UNIX utilities on the system they want to do their work. @@ -82,11 +82,11 @@ machine is working correctly. .. _what-is-new-with-clm5_0: ============================ - What is New with +|version| + What is New with |version| ============================ -`What's new with +|version| science `_ -The +|cesmrelease| `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. +`What's new with |version| science `_ +The |cesmrelease| `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. More details are given in the `CLM ChangeLog file `_. Previous release pages give similar list of changes for previous versions of the model. @@ -99,49 +99,49 @@ The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates ========================== In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. -The next section `What is new with +|version| in +|cesmrelease| since previous public releases? `_ gives references to describe the differences between +|version| in +|cesmrelease| and previous CESM releases both from a scientific as well as a software engineering point of view. -For information on previous releases of +|version| before +|version| in +|cesmrelease| see the CESM1.1.1 documentation. -The next section `Quickstart to using +|version| `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use +|version|. -The next `What is scientifically validated and functional in +|version| in +|cesmrelease|? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. -`What are the UNIX utilities required to use +|version|? `_ lists the UNIX utilities required to use +|version| and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. -Next we have `Important Notes and Best Practices for Usage of +|version| `_ to detail some of the best practices for using +|version| for science. -The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and +|version|. - -`Chapter 1 `_ goes into detail on how to setup and run simulations with +|version| and especially how to customize cases. +The next section `What is new with |version| in |cesmrelease| since previous public releases? `_ gives references to describe the differences between |version| in |cesmrelease| and previous CESM releases both from a scientific as well as a software engineering point of view. +For information on previous releases of |version| before |version| in |cesmrelease| see the CESM1.1.1 documentation. +The next section `Quickstart to using |version| `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use |version|. +The next `What is scientifically validated and functional in |version| in |cesmrelease|? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. +`What are the UNIX utilities required to use |version|? `_ lists the UNIX utilities required to use |version| and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. +Next we have `Important Notes and Best Practices for Usage of |version| `_ to detail some of the best practices for using |version| for science. +The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and |version|. + +`Chapter 1 `_ goes into detail on how to setup and run simulations with |version| and especially how to customize cases. Details of cesm_setup modes and build-namelist options as well as namelist options are given in this chapter. -`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or +|version| physics for creating input datasets for use by CLM, for the expert user. +`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or |version| physics for creating input datasets for use by CLM, for the expert user. There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. Then each tool is described in detail along with different ways in which the tool might be used. A final section on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. -This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and +|version| physics). +This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and |version| physics). In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. -For example, we give the protocol for spinning up the +|version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). +For example, we give the protocol for spinning up the |version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. We also give instructions on running both the prognostic crop and irrigation models. Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. -`Chapter 5 `_ outlines how to do single-point or regional simulations using +|version|. -This is useful to either compare +|version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. +`Chapter 5 `_ outlines how to do single-point or regional simulations using |version|. +This is useful to either compare |version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into `Chapter 2 `_ and also `Chapter 3 `_ to add the files into the build-namelist XML database. The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). CLM4 in CESM1.0.5 has a fully working versions of PTCLM. Need `Chapter 6 `_ blurb... -`Chapter 7 `_ gives some guidance on trouble-shooting problems when using +|version|. +`Chapter 7 `_ gives some guidance on trouble-shooting problems when using |version|. It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. `Chapter 8 `_ goes over the automated testing scripts for validating that the CLM is working correctly. -The test scripts run many different configurations and options with CLM4.0 physics as well and +|version| physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. -In general this is an activity important only for a developer of +|version|, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. +The test scripts run many different configurations and options with CLM4.0 physics as well and |version| physics making sure that they work, as well as doing automated testing to verify restarts are working correctly, and testing at many different resolutions. +In general this is an activity important only for a developer of |version|, but could also be used by users who are doing extensive code modifications and want to ensure that the model continues to work correctly. -In the appendices we talk about some issues that are useful for advanced users and developers of +|version|. +In the appendices we talk about some issues that are useful for advanced users and developers of |version|. -Finally in `Appendix A `_ we give instructions on how to build the documentation associated with +|version| (i.e. how to build this document). +Finally in `Appendix A `_ we give instructions on how to build the documentation associated with |version| (i.e. how to build this document). This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. This also could be useful for developers who need to update the documentation due to changes they have made. @@ -151,12 +151,12 @@ This also could be useful for developers who need to update the documentation du Best Practices ================ -- +|version| includes BOTH the old CLM4.0 physics AND the new +|version| physics and you can toggle between two. +- |version| includes BOTH the old CLM4.0 physics AND the new |version| physics and you can toggle between two. The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. - While the "standard" practice for +|version| is to run with BGC on, and CRUNCEP atmospheric forcing. - "BGC" is the new +|version| biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). + While the "standard" practice for |version| is to run with BGC on, and CRUNCEP atmospheric forcing. + "BGC" is the new |version| biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). -- When running with CLMCN (either CLM4.0 or +|version| physics) or +|version|-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the +|version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for +|version| or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). +- When running with CLMCN (either CLM4.0 or |version| physics) or |version|-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the |version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for |version| or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). Simulations without a proper spinup will effectively be starting from an unvegetated world. See `the Section called Setting Your Initial Conditions File in Chapter 1 `_ for information on how to provide initial conditions for your simulation. @@ -169,20 +169,20 @@ This also could be useful for developers who need to update the documentation du Therefore, by design the year 2000 initial condition files do not represent an equilibrium state. Note also that spinning the 2000 initial conditions out to equilibrium will not reflect the best estimate of the real carbon/nitrogen state for the year 2000. -- Initial condition files are also provided for +|version| for several configurations and resolutions. - For +|version|-SP and +|version|-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. - The +|version|-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. - Also the +|version|-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg +|version|-BGC-DV and 2deg +|version|-BGC-Crop. +- Initial condition files are also provided for |version| for several configurations and resolutions. + For |version|-SP and |version|-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. + The |version|-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. + Also the |version|-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg |version|-BGC-DV and 2deg |version|-BGC-Crop. - Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. Interpolated initial condition files may no longer be in 'reasonable' equilibrium. -- In +|version| for both +|version|-CN and +|version|-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). +- In |version| for both |version|-CN and |version|-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. If you are running with an atmosphere model or forcing that is significantly different than present day -- the lightning frequency may NOT appropriately correspond to your atmosphere forcing and fire initiation would be inappropriate. -- Aerosol deposition is a required field to both CLM4.0 and +|version| physics, sent from the atmosphere model. +- Aerosol deposition is a required field to both CLM4.0 and |version| physics, sent from the atmosphere model. Simulations without aerosol deposition will exhibit unreasonably high snow albedos. The model sends aerosol deposition from the atmospheric model (either CAM or DATM). When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index fa62be5422..935934f6c5 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -7,27 +7,27 @@ Running the CLM requires a suite of UNIX utilities and programs and you should make sure you have all of these available before trying to go forward with using it. If you are missing one of these you should contact the systems administrator for the machine you wish to run on and make sure they are installed. -List of utilities required for CESM in the "+|cesmrelease| Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ +List of utilities required for CESM in the "|cesmrelease| Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ - UNIX bash shell (for some of the CLM tools scripts) - NCL (for some of the offline tools for creating/modifying CLM input datasets see `Chapter 2 `_ for more information on NCL) - Python (optional, needed for PTCLM) - xsltproc, docbook and docbook utilities (optional, needed to build the Users-Guide) -Before working with +|version| read the QuickStart Guide in the `+|cesmrelease| Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. +Before working with |version| read the QuickStart Guide in the `|cesmrelease| Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. -For some of the details of setting up cases for +|version| read the README and text files available from the "$CTSMROOT/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. +For some of the details of setting up cases for |version| read the README and text files available from the "$CTSMROOT/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. 1. `README file `_ describing the directory structure. 2. `Quickstart.userdatasets `_ file describing how to use your own datasets in the model (also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_). -3. `$CTSMROOT/doc/KnownBugs `_ file describing known problems in +|version| (that we expect to eventually fix). +3. `$CTSMROOT/doc/KnownBugs `_ file describing known problems in |version| (that we expect to eventually fix). -4. `$CTSMROOT/doc/KnownLimitationss `_ file describing known limitations in +|version| and workarounds that we do NOT expect to fix. +4. `$CTSMROOT/doc/KnownLimitationss `_ file describing known limitations in |version| and workarounds that we do NOT expect to fix. -The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in +|version| in +|cesmrelease|?" `_. +The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in |version| in |cesmrelease|?" `_. -The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with +|version| in +|cesmrelease| since previous public releases?" `_. +The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with |version| in |cesmrelease| since previous public releases?" `_. Note other directories have README files that explain different components and tools used when running CLM and are useful in understanding how those parts of the model work and should be consulted when using tools in those directories. For more details on configuring and customizing a case with CLM see `Chapter 1 `_. diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index a238bee4a6..d96eb29bf4 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -4,16 +4,16 @@ Scientific Validation ======================== -In this section we go over what has been extensively tested and scientifically validated with +|version|, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. +In this section we go over what has been extensively tested and scientifically validated with |version|, and maybe more importantly what has NOT been tested and may NOT be scientifically validated. You can use all features of CLM, but need to realize that some things haven't been tested extensively or validated scientifically. When you use these features you may run into trouble doing so, and will need to do your own work to make sure the science is reasonable. -------------------------------------------------------------- Standard Configuration and Namelist Options that are Validated -------------------------------------------------------------- See -`http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for +|version|. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. +`http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for |version|. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. -In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for +|version| while others are for both CLM4.0 AND +|version| we explicitly say which they apply to. +In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for |version| while others are for both CLM4.0 AND |version| we explicitly say which they apply to. --------------------------------------------------------------------------------------------------------------- Configure Modes NOT scientifically validated, documented, supported or, in some cases, even advised to be used: @@ -21,13 +21,13 @@ Configure Modes NOT scientifically validated, documented, supported or, in some These are options that you would add to ``CLM_CONFIG_OPTS``. -1. exlaklayers on[+|version| only] This mode is NOT tested and may NOT be even functional. +1. exlaklayers on[|version| only] This mode is NOT tested and may NOT be even functional. -2. snicar_frc on[CLM4.0 AND +|version|] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. +2. snicar_frc on[CLM4.0 AND |version|] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. -3. vichydro on[+|version| only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. +3. vichydro on[|version| only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. -4. vsoilc_centbgc[+|version| only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `$CTSMROOT/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. +4. vsoilc_centbgc[|version| only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `$CTSMROOT/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. ---------------------------------------------- Namelist options that should NOT be exercised: diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst index 30068b600c..bca036a8e9 100644 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -122,7 +122,7 @@ Example 6-1. Example of running PTCLM1 for US-UMB on cheyenne > ./link_dirtree $CSMDATA $MYCSMDATA # Next build all of the clm tools you will need - > cd ../$CTSMROOT/tools/+|version|/mksurfdata_map + > cd ../$CTSMROOT/tools/|version|/mksurfdata_map > gmake > gmake clean > cd ../../../../../../tools/mapping/gen_domain_files/src diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst index 73cf45ff88..fbdd258bbf 100644 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/using-ptclm.rst @@ -48,7 +48,7 @@ Steps in running PTCLM Next you need to make sure all the CLM FORTRAN tools are built. :: - > cd $CTSMROOT/tools/+|version|/mksurfdata_map + > cd $CTSMROOT/tools/|version|/mksurfdata_map > gmake > gmake clean > cd ../../../../../../tools/mapping/gen_domain_files/src diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index accc5381a7..e5735a1453 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -183,7 +183,7 @@ Example: Creating a surface dataset for a single point # Save the location where the domain file was created > setenv GENDOM_PATH `pwd` # Finally create the surface dataset - > cd ../../../../lnd/clm/tools/+|version|/mksurfdata_map/src + > cd ../../../../lnd/clm/tools/|version|/mksurfdata_map/src > gmake > cd .. > ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE @@ -202,7 +202,7 @@ Example: Setting up a case from the single-point surface dataset just created > ./link_dirtree $CSMDATA $MYCSMDATA # Copy the file you created above to your new $MYCSMDATA location following the CLMUSRDAT # naming convention (leave off the creation date) - > cp $CESMROOT/$CTSMROOT/tools/+|version|/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ + > cp $CESMROOT/$CTSMROOT/tools/|version|/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc > cd $CESMROOT/scripts > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850Clm50BgcCropCru \ diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst index 9065869bb4..5876c2bca2 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst @@ -4,13 +4,13 @@ Spinup of CLM5.0-BGC ===================== -To get the +|version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. +To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). **1. 45_AD_SPINUP** For the first step of running 1000+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: -Example:: AD_SPINUP Simulation for +|version|-BGC +Example:: AD_SPINUP Simulation for |version|-BGC -------------------------------------------------------- :: @@ -33,14 +33,14 @@ Example:: AD_SPINUP Simulation for +|version|-BGC # Now run normally > ./BGC_spinup.submit -.. note:: This same procedure works for +|version|-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. +.. note:: This same procedure works for |version|-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. Afterwards save the last restart file from this simulation to use in the next step. -**2. Final spinup for +|version|-BGC** +**2. Final spinup for |version|-BGC** Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 200+ years in normal mode. So do the following: -Example: Final CLMBGC Spinup Simulation for +|version|-BGC +Example: Final CLMBGC Spinup Simulation for |version|-BGC ------------------------------------------------------------------ :: @@ -69,7 +69,7 @@ Example: Final CLMBGC Spinup Simulation for +|version|-BGC To assess if the model is spunup plot trends of CLMBGC variables of interest. If you see a trend, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. -.. note:: This same final spinup procedure works for +|version|-CN as well, you can typically shorten the spinup time from 200 years to 50 though. +.. note:: This same final spinup procedure works for |version|-CN as well, you can typically shorten the spinup time from 200 years to 50 though. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index f81634d456..d00509e301 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -128,7 +128,7 @@ You just copy this into your case directory. But, also compare it to the version Once, you've done that you can build and run your case normally. -.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard +|version| CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. +.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard |version| CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. .. note:: The intent of the ``user_nl_datm`` is to add an extra streams file for CO2 to the end of the streams variable, and other arrays associated with streams (adding mapalgo as a new array with bilinear for everything, but the CO2 file which should be "nn" for nearest neighbor). Other variables should be the same as the other stream values. diff --git a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst index 3ed3b3f0f1..944a4a93f0 100644 --- a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst @@ -4,7 +4,7 @@ Running the prognostic crop model =================================== -The prognostic crop model is setup to work with +|version|-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. +The prognostic crop model is setup to work with |version|-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. To activate the crop model you can choose a compset that has "CROP" in the name such as "ICRUCLM45BGCCROP" or simply add "-crop on" to ``CLM_CONFIG_OPTS``. diff --git a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst index feef7d0bd4..767836c180 100644 --- a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst @@ -4,8 +4,8 @@ Running with irrigation =================================== -In +|version| irrigation can ONLY be used WITH crop. -To turn on irrigation in +|version| we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. +In |version| irrigation can ONLY be used WITH crop. +To turn on irrigation in |version| we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. Just as in the crop example we also change ``RUN_TYPE`` to ``startup`` so that we don't use an initial condition file that is incompatible with irrigation. Example: Irrigation Simulation diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 4e211894d6..23845b1da7 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -4,7 +4,7 @@ Customizing CLM's Configuration ******************************* -The "Creating a Case" section of the `+|cesmrelease| Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. +The "Creating a Case" section of the `|cesmrelease| Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called there are two steps that take place: @@ -14,7 +14,7 @@ For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called When customizing your case at the *8cesm_setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "$CTSMROOT/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. -There are five different types of customization for the configuration that we will discuss: +|version| in +|cesmrelease| build-time options, +|version| in +|cesmrelease| run-time options, User Namelist, other noteworthy +|cesmrelease| configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. +There are five different types of customization for the configuration that we will discuss: |version| in |cesmrelease| build-time options, |version| in |cesmrelease| run-time options, User Namelist, other noteworthy |cesmrelease| configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. Information on all of the script, configuration, build and run items is found under ``scripts/ccsm_utils/Case.template`` in the `config_definition.xml `_ file. @@ -179,7 +179,7 @@ CLM_BLDNML_OPTS -inputdata "filepath" Writes out a list containing pathnames for required input datasets in file specified. - -irrig "value" If .true. turn irrigation on with namelist logical irrigate (for +|version| physics) + -irrig "value" If .true. turn irrigation on with namelist logical irrigate (for |version| physics) (requires crop to be on in the clm configuration) Seek surface datasets with irrigation turned on. (for CLM4.0 physics) Default: .false. @@ -284,7 +284,7 @@ Hence only the following different options can be set: #. -verbose -"-bgc_spinup" is an option only available for +|version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the +|version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. +"-bgc_spinup" is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the |version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. "-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **$CASE.build** or **$CASE.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. @@ -530,7 +530,7 @@ If you are running an B, E, or F case that doesn't use the DATM obviously the DA CPLHIST3HrWx ``CLMCRUNCEP`` - The standard mode for +|version| of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. + The standard mode for |version| of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. See `the Section called CLMCRUNCEP mode and it's DATM settings `_ for more information on the DATM settings for ``CLMCRUNCEP`` mode. ``CLM_QIAN`` @@ -632,7 +632,7 @@ The output to the above command is as follows: (default: CLM build directory). -clm4me Turn Methane model: [on | off] Requires bgc=cn/cndv (Carbon Nitrogen model) - (ONLY valid for +|version|!) + (ONLY valid for |version|!) -clm_root Root directory of clm source code (default: directory above location of this script) -cppdefs A string of user specified CPP defines. Appended to @@ -647,12 +647,12 @@ The output to the above command is as follows: Parameters relating to the build which are system dependent will be ignored. -exlaklayers Turn on extra lake layers (25 layers instead of 10) [on | off] - (ONLY valid for +|version|!) + (ONLY valid for |version|!) -help [or -h] Print usage to STDOUT. -nofire Turn off wildfires for BGC setting of CN (default includes fire for CN) -noio Turn history output completely off (typically for testing). - -phys Value of clm4_0 or +|version| (default is clm4_0) + -phys Value of clm4_0 or |version| (default is clm4_0) -silent [or -s] Turns on silent mode - only fatal messages issued. -sitespf_pt Setup for the given site specific single-point resolution. -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] @@ -676,7 +676,7 @@ The output to the above command is as follows: eliminate inconsistent duplicate soil hydraulic parameters used in soil biogeochem. (requires either CN or CNDV) - (ONLY valid for +|version|!) + (ONLY valid for |version|!) [on,off or colon delimited list of no options] (default off) no-vert Turn vertical soil Carbon profile off no-cent Turn CENTURY off diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 2300c8ad60..256397329e 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -16,16 +16,16 @@ Definition of Namelist items and their default values Here we point to you where you can find the definition of each namelist item and separately the default values for them. The default values may change depending on the resolution, land-mask, simulation-year and other attributes. Both of these files are viewable in your web browser, and then expand each in turn. -1. `Definition of Namelists Relevant for +|version| `_ +1. `Definition of Namelists Relevant for |version| `_ 2. `Default values of each CLM4.0 Namelist Item `_ -3. `Default values of each +|version| Namelist Item `_ +3. `Default values of each |version| Namelist Item `_ List of fields that can be added to your output history files by namelist ------------------------------------------------------------------------- -One set of the namelist items allows you to add fields to the output history files: ``hist_fincl1``, ``hist_fincl2``, ``hist_fincl3``, ``hist_fincl4``, ``hist_fincl5``, and ``hist_fincl6``. The following links for `CLM4.0 History Fields `_ and `+|version| History Fields `_ documents all of the history fields available and gives the long-name and units for each. The table below lists all the +|version| history fields. +One set of the namelist items allows you to add fields to the output history files: ``hist_fincl1``, ``hist_fincl2``, ``hist_fincl3``, ``hist_fincl4``, ``hist_fincl5``, and ``hist_fincl6``. The following links for `CLM4.0 History Fields `_ and `|version| History Fields `_ documents all of the history fields available and gives the long-name and units for each. The table below lists all the |version| history fields. Definition of CLM history variables ----------------------------------- diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index d41124f8ba..55f5ad2ed7 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -44,7 +44,7 @@ We already have a standard list of tests for clm (the "aux_clm" list of tests). > ./cs.status.$id # The above will give a PASS or FAIL message for each test. -For more information on doing testing with the CESM scripts see the `+|cesmrelease| User's Guide `_ on testing. +For more information on doing testing with the CESM scripts see the `|cesmrelease| User's Guide `_ on testing. Testing PTCLM ============= diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 625865b7c1..3a30659752 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -18,7 +18,7 @@ Setup Problems The first type of problem happens when you invoke the **case.setup** command. This indicates there is something wrong with your input datasets, or the details of what you are trying to setup the model to do. -There's also a trouble-shooting chapter in the `+|cesmrelease| Scripts User's Guide `_. +There's also a trouble-shooting chapter in the `|cesmrelease| Scripts User's Guide `_. Many of the problems with configuration can be resolved with the guidelines given there. Here we will restrict ourselves to problems from the input files. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index 006c6b679b..848b96131f 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -49,7 +49,7 @@ Hence, there doesn't need to be a different mapping file for EACH raw dataset -- See `Figure 2-3 `_ for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs **ESMF_RegridWeightGen** for each one. You can then either enter the datasets into the XML database (see `Chapter 3 `_ or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to **mksurfdata_map** (see `the Section called Running mksurfdata.pl `_ below). -Use the "-phys" option to specify if you are creating mapping files for clm4_0 or +|version| (the list of raw datafiles is somewhat different between the two). +Use the "-phys" option to specify if you are creating mapping files for clm4_0 or |version| (the list of raw datafiles is somewhat different between the two). mkmapdata.sh has a help option with the following :: @@ -74,8 +74,8 @@ mkmapdata.sh has a help option with the following Model output grid type supported values are [regional,global], (default is global) [-p|--phys ] - Whether to generate mapping files for clm4_0 or +|version| - supported values are [clm4_0,+|version|], (default is +|version|) + Whether to generate mapping files for clm4_0 or |version| + supported values are [clm4_0,|version|], (default is |version|) [-b|--batch] Toggles batch mode usage. If you want to run in batch mode @@ -107,7 +107,7 @@ mkmapdata.sh has a help option with the following ********************** -.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is +|version|. +.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is |version|. Figure 2-3. Details of running mkmapdata.sh ------------------------------------------- diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index ae90a3609b..4675720af1 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -37,7 +37,7 @@ Creating a Complete Set of Files for Input to CLM 4. Create surface datasets - Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or +|version| for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. + Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or |version| for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. 5. Create some sort of initial condition dataset @@ -49,11 +49,11 @@ Creating a Complete Set of Files for Input to CLM b. Use interpinic to interpolate existing initial condition datasets - The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or +|version| for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. + The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or |version| for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. c. Start up from arbitrary initial conditions - The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using +|version|-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. + The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using |version|-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. .. warning:: This is NOT recommended as many fields in CLM take a long time to equilibrate. diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 4bb40f21c6..59d7776016 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -10,8 +10,8 @@ Most of the tools are FORTRAN stand-alone programs in their own directory, but t Some of the NCL scripts are very specialized and not meant for general use, and we won't document them here. They still contain documentation in the script itself and the README file in the tools directory. -The tools are divided into three directories for three categories: clm4_0, +|version|, and shared. -The first two are of course for tools that are designed to work with either the CLM4.0 or +|version| versions of the model. +The tools are divided into three directories for three categories: clm4_0, |version|, and shared. +The first two are of course for tools that are designed to work with either the CLM4.0 or |version| versions of the model. The last one are shared utilities that can be used by either, or have a "-phys" option so you can specify which version you want to use. The list of generally important scripts and programs are as follows. @@ -24,9 +24,9 @@ The list of generally important scripts and programs are as follows. #. *./gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. -#. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and +|version| versions). +#. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and |version| versions). -#. *./mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or +|version|. +#. *./mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or |version|. In the sections to come we will go into detailed description of how to use each of these tools in turn. First, however we will discuss the common environment variables and options that are used by all of the FORTRAN tools. From 9dfe4bd350ca1cf3d0f957d28642ef4e001937e1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 15 Jun 2018 12:21:59 -0600 Subject: [PATCH 193/730] Add substitution file to get substitutions properly working for UG, checkin of new UG html --- ...esolutions-or-New-Files-to-the-build-namelist-Database.rst | 2 ++ .../CLM-3.1-Managing-Your-Own-Data-files.rst | 2 ++ .../CLM-3.2-Adding-Resolution-Names.rst | 2 ++ .../CLM-3.3-Adding-or-Changing-Default-Filenames.rst | 2 ++ doc/source/users_guide/adding-new-resolutions/index.rst | 2 ++ doc/source/users_guide/index.rst | 2 +- doc/source/users_guide/overview/getting-help.rst | 2 ++ doc/source/users_guide/overview/index.rst | 2 ++ doc/source/users_guide/overview/introduction.rst | 2 ++ doc/source/users_guide/overview/quickstart.rst | 2 ++ doc/source/users_guide/overview/scientific_validation.rst | 2 ++ .../users_guide/running-PTCLM/adding-ptclm-site-data.rst | 2 ++ doc/source/users_guide/running-PTCLM/index.rst | 2 ++ .../users_guide/running-PTCLM/introduction-to-ptclm.rst | 2 ++ doc/source/users_guide/running-PTCLM/ptclm-examples.rst | 2 ++ doc/source/users_guide/running-PTCLM/using-ptclm.rst | 2 ++ doc/source/users_guide/running-single-points/index.rst | 2 ++ .../running-single-points/running-pts_mode-configurations.rst | 2 ++ .../running-single-point-configurations.rst | 2 ++ .../single-point-and-regional-grid-configurations.rst | 2 ++ ...inning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst | 2 ++ ...Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst | 2 ++ ...h-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst | 2 ++ ...-simulation-as-atmospheric-forcing-to-spinup-the-model.rst | 2 ++ ...-alone-CLM-with-transient-historical-CO2-concentration.rst | 2 ++ doc/source/users_guide/running-special-cases/index.rst | 2 ++ .../running-the-prognostic-crop-model.rst | 2 ++ .../running-special-cases/running-with-irrigation.rst | 2 ++ .../running-special-cases/what-is-a-special-case.rst | 2 ++ .../setting-up-and-running-a-case/choosing-a-compset.rst | 2 ++ .../customizing-the-clm-configuration.rst | 4 +++- .../customizing-the-clm-namelist.rst | 2 ++ .../customizing-the-datm-namelist.rst | 2 ++ .../users_guide/setting-up-and-running-a-case/index.rst | 2 ++ doc/source/users_guide/substitutions.rst | 2 ++ doc/source/users_guide/testing/index.rst | 2 ++ doc/source/users_guide/testing/testing.rst | 2 ++ doc/source/users_guide/trouble-shooting/index.rst | 2 ++ doc/source/users_guide/trouble-shooting/trouble-shooting.rst | 2 ++ .../users_guide/using-clm-tools/building-the-clm-tools.rst | 2 ++ doc/source/users_guide/using-clm-tools/cprnc.rst | 2 ++ .../users_guide/using-clm-tools/creating-domain-files.rst | 2 ++ .../creating-input-for-surface-dataset-generation.rst | 2 ++ .../users_guide/using-clm-tools/creating-surface-datasets.rst | 2 ++ .../using-clm-tools/datasts-for-observational-sites.rst | 2 ++ doc/source/users_guide/using-clm-tools/index.rst | 2 ++ .../using-clm-tools/observational-sites-datasets.rst | 2 ++ .../users_guide/using-clm-tools/what-are-the-clm-tools.rst | 2 ++ 48 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 doc/source/users_guide/substitutions.rst diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 60137563db..76d8a7aef1 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -1,5 +1,7 @@ .. _adding-resolutions: +.. include:: ../substitutions.rst + ======================== Adding New Resolutions ======================== diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst index 6d4a65657e..41ccdde35b 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst @@ -1,5 +1,7 @@ .. _managing-your-data-files: +.. include:: ../substitutions.rst + ============================== Managing Your Data Own Files ============================== diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst index b9b767ca06..aa8265e8a9 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst @@ -1,5 +1,7 @@ .. _adding-resolution-names: +.. include:: ../substitutions.rst + ========================= Adding Resolution Names ========================= diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst index 4c8c9884de..52344bd5a0 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst @@ -1,5 +1,7 @@ .. _changing-default-filenames: +.. include:: ../substitutions.rst + ============================ Changing Default Filenames ============================ diff --git a/doc/source/users_guide/adding-new-resolutions/index.rst b/doc/source/users_guide/adding-new-resolutions/index.rst index c01aa36ca0..fded236989 100644 --- a/doc/source/users_guide/adding-new-resolutions/index.rst +++ b/doc/source/users_guide/adding-new-resolutions/index.rst @@ -5,6 +5,8 @@ .. _adding-new-resolutions-section: +.. include:: ../substitutions.rst + ##################################### Adding New Resolutions ##################################### diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 625bd84107..31d00bcb38 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -5,7 +5,7 @@ .. _users-guide: -.. |cesmrelease| replace:: CESM2.0.0 +.. include:: substitutions.rst ##################################### |version| User's Guide diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index f5e5a0f059..aafeb057f5 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -1,5 +1,7 @@ .. _getting-help: +.. include:: ../substitutions.rst + ============== Getting Help ============== diff --git a/doc/source/users_guide/overview/index.rst b/doc/source/users_guide/overview/index.rst index 1f31037460..b03eae4034 100644 --- a/doc/source/users_guide/overview/index.rst +++ b/doc/source/users_guide/overview/index.rst @@ -5,6 +5,8 @@ .. _overview_section: +.. include:: ../substitutions.rst + ##################################### Overview ##################################### diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index a7e1f6c050..7dd868b3f7 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -1,5 +1,7 @@ .. _introduction: +.. include:: ../substitutions.rst + **User's Guide to version |version| of the Community Land Model (CLM)** **Authors: Benjamin Andre, Erik Kluzek, William Sacks** diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index 935934f6c5..3c9964ee38 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -1,5 +1,7 @@ .. _quickstart: +.. include:: ../substitutions.rst + ============ Quickstart ============ diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index d96eb29bf4..b7e80c4b37 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -1,5 +1,7 @@ .. _scientific-validiation: +.. include:: ../substitutions.rst + ======================== Scientific Validation ======================== diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst index 1e7a5437eb..425e6d9c25 100644 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst @@ -1,5 +1,7 @@ .. _adding-ptclm-site-data: +.. include:: ../substitutions.rst + ====================== Adding PTCLM Site Data ====================== diff --git a/doc/source/users_guide/running-PTCLM/index.rst b/doc/source/users_guide/running-PTCLM/index.rst index d82b7f9624..26e18d3a73 100644 --- a/doc/source/users_guide/running-PTCLM/index.rst +++ b/doc/source/users_guide/running-PTCLM/index.rst @@ -5,6 +5,8 @@ .. _running-PTCLM: +.. include:: ../substitutions.rst + ##################################### Running PTCLM ##################################### diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst index bca036a8e9..0c49f6ad78 100644 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -1,5 +1,7 @@ .. _introduction-to-ptclm.rst: +.. include:: ../substitutions.rst + .. _what-is-ptclm: =============== diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst index 172f041420..d3d85da0b1 100644 --- a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst +++ b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst @@ -1,5 +1,7 @@ .. _ptclm-examples: +.. include:: ../substitutions.rst + ========================= Examples of using PTCLM ========================= diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst index fbdd258bbf..2055cc81a1 100644 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/using-ptclm.rst @@ -1,5 +1,7 @@ .. _using-ptclm.rst: +.. include:: ../substitutions.rst + ************************** Using PTCLM ************************** diff --git a/doc/source/users_guide/running-single-points/index.rst b/doc/source/users_guide/running-single-points/index.rst index 2c4ea71bdb..e1d955ac0a 100644 --- a/doc/source/users_guide/running-single-points/index.rst +++ b/doc/source/users_guide/running-single-points/index.rst @@ -5,6 +5,8 @@ .. _running-single-points: +.. include:: ../substitutions.rst + ##################################### Running Single Point Regional Cases ##################################### diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index ca794ac326..c7a1ed0def 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -1,5 +1,7 @@ .. _pts_mode: +.. include:: ../substitutions.rst + **************************************************** Running a single point using global data - PTS_MODE **************************************************** diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index e5735a1453..6a2dc4e44d 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -1,5 +1,7 @@ .. _running-single-point-datasets: +.. include:: ../substitutions.rst + ****************************************** Running Single Point Configurations ****************************************** diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index a1514768ee..41f55e38f1 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -1,5 +1,7 @@ .. _single-point-configurations: +.. include:: ../substitutions.rst + ***************************************** Single and Regional Grid Configurations ***************************************** diff --git a/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst index 7c8bd313c5..a017c42ae0 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst @@ -1,5 +1,7 @@ .. _spinning-up-sp: +.. include:: ../substitutions.rst + =========================================== Spinning up the Satellite Phenology Model =========================================== diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst index 5876c2bca2..99fa3fdd47 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst @@ -1,5 +1,7 @@ .. _spinning-up-clm45-bgc: +.. include:: ../substitutions.rst + ===================== Spinup of CLM5.0-BGC ===================== diff --git a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index 36f2266493..deb5fa1238 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -1,5 +1,7 @@ .. _running-with-moar-data: +.. include:: ../substitutions.rst + ======================== Running with MOAR data ======================== diff --git a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index 5cad7c1c5e..0999f7b366 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -1,5 +1,7 @@ .. _running-with-previous-simulation-forcing: +.. include:: ../substitutions.rst + ============================================================= Running with atmospheric forcing from a previous simulation ============================================================= diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index d00509e301..b7d063a2a2 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -1,5 +1,7 @@ .. _running-with-historical-co2-forcing: +.. include:: ../substitutions.rst + ===================================== Running with historical CO2 forcing ===================================== diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index 693c83d550..18ef7a96b0 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -5,6 +5,8 @@ .. _running-special-cases-section: +.. include:: ../substitutions.rst + ##################################### Running Special Cases ##################################### diff --git a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst index 944a4a93f0..308c749adc 100644 --- a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst @@ -1,5 +1,7 @@ .. running-prognostic-crop-model: +.. include:: ../substitutions.rst + =================================== Running the prognostic crop model =================================== diff --git a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst index 767836c180..3a7b0e3ccf 100644 --- a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst @@ -1,5 +1,7 @@ .. running-with-irrigation: +.. include:: ../substitutions.rst + =================================== Running with irrigation =================================== diff --git a/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst b/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst index 32daabafc6..5a42858818 100644 --- a/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst +++ b/doc/source/users_guide/running-special-cases/what-is-a-special-case.rst @@ -1,5 +1,7 @@ .. _what is a special case: +.. include:: ../substitutions.rst + ========================= What is a special case? ========================= diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst index 38bfcd7da1..df702e0185 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst @@ -1,5 +1,7 @@ .. _choosing-a-compset: +.. include:: ../substitutions.rst + ==================== Choosing a compset ==================== diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 23845b1da7..38f61c2c4d 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -1,10 +1,12 @@ .. _configuring-clm: +.. include:: ../substitutions.rst + ******************************* Customizing CLM's Configuration ******************************* -The "Creating a Case" section of the `|cesmrelease| Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. +The "Creating a Case" section of the |cesmrelease| `Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called there are two steps that take place: diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 256397329e..41eec17598 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -1,5 +1,7 @@ .. _customizing-a-case: +.. include:: ../substitutions.rst + ============================ Customizing CLM's namelist ============================ diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst index 8cf0916717..4140dad87a 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst @@ -1,5 +1,7 @@ .. customizing-the-datm-namelist: +.. include:: ../substitutions.rst + =============================== Customizing the DATM namelist =============================== diff --git a/doc/source/users_guide/setting-up-and-running-a-case/index.rst b/doc/source/users_guide/setting-up-and-running-a-case/index.rst index a9c1cb7d13..3fb9a41391 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/index.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/index.rst @@ -5,6 +5,8 @@ .. _customizing_section: +.. include:: ../substitutions.rst + ##################################### Setting Up and Running a Case ##################################### diff --git a/doc/source/users_guide/substitutions.rst b/doc/source/users_guide/substitutions.rst new file mode 100644 index 0000000000..821ebb071e --- /dev/null +++ b/doc/source/users_guide/substitutions.rst @@ -0,0 +1,2 @@ +.. |cesmrelease| replace:: CESM2.0.0 + diff --git a/doc/source/users_guide/testing/index.rst b/doc/source/users_guide/testing/index.rst index 09575a1442..b9e99506e1 100644 --- a/doc/source/users_guide/testing/index.rst +++ b/doc/source/users_guide/testing/index.rst @@ -5,6 +5,8 @@ .. _testing_section: +.. include:: ../substitutions.rst + ##################################### Testing ##################################### diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index 55f5ad2ed7..0594bc9157 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -1,5 +1,7 @@ .. _testing: +.. include:: ../substitutions.rst + ******* Testing ******* diff --git a/doc/source/users_guide/trouble-shooting/index.rst b/doc/source/users_guide/trouble-shooting/index.rst index f4c6d813fc..64b0cecee3 100644 --- a/doc/source/users_guide/trouble-shooting/index.rst +++ b/doc/source/users_guide/trouble-shooting/index.rst @@ -5,6 +5,8 @@ .. _troubleshooting: +.. include:: ../substitutions.rst + ##################################### Troubleshooting ##################################### diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index 3a30659752..c7e38cf645 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -1,5 +1,7 @@ .. _trouble-shooting: +.. include:: ../substitutions.rst + ********************* Trouble Shooting ********************* diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 4f51314d48..1dd1129b6c 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -2,6 +2,8 @@ Building the CLM tools ======================== +.. include:: ../substitutions.rst + The FORTRAN tools all have similar makefiles, and similar options for building. All of the Makefiles use GNU Make extensions and thus require that you use GNU make to use them. They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst index 53169513f0..de90f7a88e 100644 --- a/doc/source/users_guide/using-clm-tools/cprnc.rst +++ b/doc/source/users_guide/using-clm-tools/cprnc.rst @@ -1,5 +1,7 @@ .. comparing-history-files: +.. include:: ../substitutions.rst + ========================= Comparing History Files ========================= diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index 6d4ec7bc12..d72427d3d5 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -1,5 +1,7 @@ .. _creating-domain-files: +.. include:: ../substitutions.rst + ***************************** Creating CLM domain files ***************************** diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index 848b96131f..dcfcbbbdff 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -1,5 +1,7 @@ .. _creating-maps-for-mksurfdata: +.. include:: ../substitutions.rst + ********************************************* Creating input for surface dataset generation ********************************************* diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index 4675720af1..f2cb8eed4d 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -1,5 +1,7 @@ .. _creating-surface-datasets: +.. include:: ../substitutions.rst + =========================== Creating Surface Datasets =========================== diff --git a/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst b/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst index d1824d432e..7fb915a6ed 100644 --- a/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst +++ b/doc/source/users_guide/using-clm-tools/datasts-for-observational-sites.rst @@ -1,3 +1,5 @@ +.. include:: ../substitutions.rst + ================================== Datasets for Observational Sites ================================== diff --git a/doc/source/users_guide/using-clm-tools/index.rst b/doc/source/users_guide/using-clm-tools/index.rst index 030cda7495..58435f92aa 100644 --- a/doc/source/users_guide/using-clm-tools/index.rst +++ b/doc/source/users_guide/using-clm-tools/index.rst @@ -5,6 +5,8 @@ .. _using-clm-tools-section: +.. include:: ../substitutions.rst + ##################################### Using CLM tools ##################################### diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst index b5e47e861f..b5cc2efad9 100644 --- a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst @@ -1,5 +1,7 @@ .. _observational-sites-datasets: +.. include:: ../substitutions.rst + ******************************* Observational Sites Datasets ******************************* diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 59d7776016..3c67965e73 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -1,5 +1,7 @@ .. _what-are-the-clm-tools: +.. include:: ../substitutions.rst + ======================== What are the CLM tools ======================== From 565a93f7f55744b41e685f40279fbb4ae9e17343 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 15 Jun 2018 15:32:10 -0600 Subject: [PATCH 194/730] More updates, add today's date under UG index --- doc/source/users_guide/conf.py | 3 + doc/source/users_guide/index.rst | 2 + .../users_guide/overview/introduction.rst | 55 ++++++++++------ .../users_guide/overview/quickstart.rst | 14 ++--- .../overview/scientific_validation.rst | 62 ------------------- doc/source/users_guide/substitutions.rst | 3 + 6 files changed, 48 insertions(+), 91 deletions(-) diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index c717685979..b8e187efd5 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -63,6 +63,9 @@ # The full version, including alpha/beta/rc tags. release = u'release-clm5.0.01' +# The format to print out today in +today_fmt = u'%Y-%m-%D %H:%M' + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 31d00bcb38..f4cf0e5123 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -23,3 +23,5 @@ running-PTCLM/index.rst trouble-shooting/index.rst testing/index.rst + +Documentation was built: |today| diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 7dd868b3f7..9705057439 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -14,7 +14,7 @@ are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. National Center for Atmospheric Research -P. O. Box 3000, Boulder, Colorado 80307-300 +P. O. Box 3000, Boulder, Colorado 80307-3000 .. _rst_Users_Guide_Introduction: @@ -37,12 +37,13 @@ is information in the ChangeLog file and in the `What is new with regarding the changes from previous versions of CESM. .. note:: This release of |version| in |cesmrelease| includes BOTH CLM4.0 - physics used in previous releases as well as the updated |version| - physics. Both CLM as well as CLM support tools allow you to trigger - between the two physics modes. Most often when we refer to CLM4.0 we + physics and CLM4.5 physics used in previous releases as well as the updated |version| + physics. CLM allow you to trigger between the three physics modes. Most often when we refer to CLM4.0 we are referring to the CLM4.0 physics in |version| in |cesmrelease| rather than to a specific version of CLM4.0 (where we would give the exact - version). Likewise, when referring to |version| we are referring to the + version). And when we refer to CLM4.5 we are referring to the CLM4.5 + physics in |version| in |cesmrelease| rather + than to a specific version of CLM4.5. Likewise, when referring to |version| we are referring to the |version| physics in |version| in |cesmrelease|. The novice user should read `Chapter 1 `_ in detail before @@ -88,11 +89,10 @@ machine is working correctly. ============================ `What's new with |version| science `_ -The |cesmrelease| `What's New Science `_ and `What's New Software `_ pages gives a synopsis of the changes to all CESM components since the CESM1.1.1 release. +gives a synopsis of the changes to CLM since the CLM4.5 release. More details are given in the `CLM ChangeLog file `_. Previous release pages give similar list of changes for previous versions of the model. -The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates for versions up to CLM4 in CESM1.0.5. .. _users-guide-overview: @@ -102,23 +102,23 @@ The `CLM4 in CESM1.0.5 User's Guide `_ gives information on the updates In this introduction we first give a simple guide to understand the document conventions in `How to Use This Document `_. The next section `What is new with |version| in |cesmrelease| since previous public releases? `_ gives references to describe the differences between |version| in |cesmrelease| and previous CESM releases both from a scientific as well as a software engineering point of view. -For information on previous releases of |version| before |version| in |cesmrelease| see the CESM1.1.1 documentation. +For information on previous releases of |version| before |version| in |cesmrelease| see the CESM1.2.2 documentation. The next section `Quickstart to using |version| `_ is for users that are already experts in using CLM and gives a quickstart guide to the bare details on how to use |version|. The next `What is scientifically validated and functional in |version| in |cesmrelease|? `_ tells you about what has been extensively tested and scientifically validated (and maybe more importantly) what has NOT. `What are the UNIX utilities required to use |version|? `_ lists the UNIX utilities required to use |version| and is important if you are running on non-NCAR machines, generic local machines, or machines NOT as well tested by us at NCAR. Next we have `Important Notes and Best Practices for Usage of |version| `_ to detail some of the best practices for using |version| for science. -The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with CESM1.0 and |version|. +The last introductory section is `Other resources `_ to get help from which lists different resources for getting help with |version| and |cesmrelease|. `Chapter 1 `_ goes into detail on how to setup and run simulations with |version| and especially how to customize cases. Details of cesm_setup modes and build-namelist options as well as namelist options are given in this chapter. -`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.0 or |version| physics for creating input datasets for use by CLM, for the expert user. +`Chapter 2 `_ gives instructions on the CLM tools for either CLM4.5 or |version| physics for creating input datasets for use by CLM, for the expert user. There's an overview of what each tool does, and some general notes on how to build the FORTRAN tools. Then each tool is described in detail along with different ways in which the tool might be used. A final section on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. As a followup to the tools chapter, `Chapter 3 `_ tells how to add files to the XML database for build-namelist to use. -This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (both CLM4.0 and |version| physics). +This is important if you want to use the XML database to automatically select user-created input files that you have created when you setup new cases with CLM (CLM4.0, CLM4.5 and |version| physics). In `Chapter 4 `_, again for the expert user, we give details on how to do some particularly difficult special cases. For example, we give the protocol for spinning up the |version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). @@ -153,9 +153,11 @@ This also could be useful for developers who need to update the documentation du Best Practices ================ -- |version| includes BOTH the old CLM4.0 physics AND the new |version| physics and you can toggle between two. +- |version| includes BOTH the old CLM4.0, CLM4.5 physics AND the new |version| physics and you can toggle between those three. The "standard" practice for CLM4.0 is to run with CN on, and with Qian atmospheric forcing. - While the "standard" practice for |version| is to run with BGC on, and CRUNCEP atmospheric forcing. + While the "standard" practice for CLM4.5 is to run with BGC on, and CRUNCEP atmospheric forcing. + And finally the "standard" practice for |version| is to run with BGC and Prognostic Crop on, with the MOSART model for river routing, as well as the CISM + ice sheet model, and using GSWP3 atmospheric forcing. "BGC" is the new |version| biogeochemistry and include CENTURY-like pools, vertical resolved carbon, as well as Nitrification and de-Nitrification (see `the Section called Some Acronym's and Terms We'll be Using in Other resources to get help from `_ ). - When running with CLMCN (either CLM4.0 or |version| physics) or |version|-BGC, it is critical to begin with initial conditions that are provided with the release or to spin the model up following the CN spinup procedure before conducting scientific runs (see `the Section called Spinning up the |version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for |version| or `the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4 `_ for CLM4.0). @@ -172,23 +174,34 @@ This also could be useful for developers who need to update the documentation du Note also that spinning the 2000 initial conditions out to equilibrium will not reflect the best estimate of the real carbon/nitrogen state for the year 2000. - Initial condition files are also provided for |version| for several configurations and resolutions. - For |version|-SP and |version|-BGC with CRUNCEP forcing we have initial conditions at 1deg resolution for both 1850 and 2000. - The |version|-BGC initial conditions for 1850 (again with CRUNCEP forcing) were also interpolated to 2deg, CRUNCEP half degree (360x720cru), and ne30np4 resolutions. - Also the |version|-BGC initial conditions for 1850 (with CRUNCEP forcing) were interpolated to 1deg |version|-BGC-DV and 2deg |version|-BGC-Crop. + For CLM4.5-SP and CLM4.5-BGC with both CRUNCEP and GSWP3 forcing we have initial conditions at 1deg resolution for 1850. + For |version|-SP and |version|-BGC-Crop with both CRUNCEP and GSWP3 forcing we have initial conditions at 1deg resolution for 1850. + Normally, these files are interpolated to any other resolution that you run at. -- Users can generate initial condition files at different resolutions by using the CLM tool interpinic to interpolate from one of the provided resolutions to the resolution of interest. +- Users can interpolate initial condition files at different resolutions at startup of a CLM4.5 or |version| simulation. And the file created can be stored for later use. Interpolated initial condition files may no longer be in 'reasonable' equilibrium. -- In |version| for both |version|-CN and |version|-BGC the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). - By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2010 for population density. +- In |version| for both |version|-CN, |version|-BGC, and |version|-BGC-Crop the new fire model requires lightning frequency data, and human population density (both are read inside of CLM). + By default we have provided a climatology dataset for lightning frequency and a dataset with coverage from 1850 to 2014 for population density. Both of these datasets are interpolated from the native resolution of the datasets to the resolution you are running the model on. If you are running with an atmosphere model or forcing that is significantly different than present day -- the lightning frequency may NOT appropriately correspond to your atmosphere forcing and fire initiation would be inappropriate. -- Aerosol deposition is a required field to both CLM4.0 and |version| physics, sent from the atmosphere model. +- Aerosol deposition is a required field to both CLM4.0, CLM4.5 and |version| physics, sent from the atmosphere model. Simulations without aerosol deposition will exhibit unreasonably high snow albedos. The model sends aerosol deposition from the atmospheric model (either CAM or DATM). When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. +.. _CTSM_vs_CESM_checkout: + +============================= +A CTSM versus a CESM checkout +============================= + +The directory structure for |version| is different depending on if it's checked out from |release| or |cesmrelease|. +If |version| is checked out from |ctsm_gh| the CLM source code is directly under the top level directory. If |cesmrelease| +is checkout out from |cesm_gh| then the CLM source directories are under "components/clm" from the top level directory. We +will refer to this directory for the CLM source directories in the User's Guide as "$CTSMROOT". + .. _how-to-use-this-document: ======================================================== @@ -215,3 +228,5 @@ Links to descriptions and definitions have been provided in the code below. We u that continues to the following line. > $EDITOR filename # means you are using a text editor to edit "filename" # This is a comment line + + $CTSMROOT means the path to the root of the CTSM model diff --git a/doc/source/users_guide/overview/quickstart.rst b/doc/source/users_guide/overview/quickstart.rst index 3c9964ee38..9160666051 100644 --- a/doc/source/users_guide/overview/quickstart.rst +++ b/doc/source/users_guide/overview/quickstart.rst @@ -12,25 +12,21 @@ If you are missing one of these you should contact the systems administrator for List of utilities required for CESM in the "|cesmrelease| Software/Operating System Prerequisites" section in `http://www.cesm.ucar.edu/models/cesm1.2//cesm/doc/usersguide/book1.html `_ - UNIX bash shell (for some of the CLM tools scripts) - NCL (for some of the offline tools for creating/modifying CLM input datasets see `Chapter 2 `_ for more information on NCL) -- Python (optional, needed for PTCLM) -- xsltproc, docbook and docbook utilities (optional, needed to build the Users-Guide) +- Python Before working with |version| read the QuickStart Guide in the `|cesmrelease| Scripts User's Guide `_. Once you are familiar with how to setup cases for any type of simulation with CESM you will want to direct your attention to the specifics of using CLM. For some of the details of setting up cases for |version| read the README and text files available from the "$CTSMROOT/doc" directory (see the "CLM Web pages" section for a link to the list of these files). Here are the important ones that you should be familiar with. -1. `README file `_ describing the directory structure. - -2. `Quickstart.userdatasets `_ file describing how to use your own datasets in the model (also see `the Section called Creating your own single-point/regional surface datasets in Chapter 5 `_). - -3. `$CTSMROOT/doc/KnownBugs `_ file describing known problems in |version| (that we expect to eventually fix). - -4. `$CTSMROOT/doc/KnownLimitationss `_ file describing known limitations in |version| and workarounds that we do NOT expect to fix. +`README file `_ describing the directory structure. The IMPORTANT_NOTES file talks about important things for users to know about using the model scientifically. It content is given in the next chapter on `"What is scientifically validated and functional in |version| in |cesmrelease|?" `_. The ChangeLog/ChangeSum talk about advances in different versions of CLM. The content of these files is largely explained in the previous chapter on `"What is new with |version| in |cesmrelease| since previous public releases?" `_. +The release-clm5.0.ChangeLog gives the specific changes that have gone on the release-clm5.0 branch. clm3_0_ChangeLog, clm4_0_ChangeLog, clm4_5_ChangeLog gives the changes that +culimated in that given version of the CLM. + Note other directories have README files that explain different components and tools used when running CLM and are useful in understanding how those parts of the model work and should be consulted when using tools in those directories. For more details on configuring and customizing a case with CLM see `Chapter 1 `_. The Quickstart.GUIDE (which can be found in ``$CTSMROOT/doc``) is repeated here. diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index b7e80c4b37..12afe4bbf5 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -16,65 +16,3 @@ See `http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for |version|. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for |version| while others are for both CLM4.0 AND |version| we explicitly say which they apply to. - ---------------------------------------------------------------------------------------------------------------- -Configure Modes NOT scientifically validated, documented, supported or, in some cases, even advised to be used: ---------------------------------------------------------------------------------------------------------------- - -These are options that you would add to ``CLM_CONFIG_OPTS``. - -1. exlaklayers on[|version| only] This mode is NOT tested and may NOT be even functional. - -2. snicar_frc on[CLM4.0 AND |version|] This mode is tested and functional, but is NOT constantly scientifically validated, and should be considered experimental. - -3. vichydro on[|version| only] This mode is tested and functional, but does NOT have long scientific validation simulations run with it so, should be considered experimental. - -4. vsoilc_centbgc[|version| only] This option is extensively tested for both "on" and "off". The "no-vert" option has limited testing performed on it, but isn't scientifically validated (and it currently has a bug -- see 1746 and 1672 in `$CTSMROOT/doc/KnownBugs `_). The "no-cent" and "no-nitrif" options are NOT tested and as such may NOT ben even functional. - ----------------------------------------------- -Namelist options that should NOT be exercised: ----------------------------------------------- - ----------------------------------------------------- -Build-Namelist options that should NOT be exercised: ----------------------------------------------------- -1. -irrig with -bgc cn and -phys clm4_0 We have only run the irrigation model with CLMSP (i.e. without the CN model). We recommend that if you want to run the irrigation model with CN, that you do a spinup. But, more than that you may need to make adjustments to irrig_factor in $CTSMROOT/src/biogeophys/CanopyFluxesMod.F90. See the notes on this in the description of the irrigation model in the -`Technical Descriptions of the Interactive Crop Management and Interactive Irrigation Models `_. - -2. -irrig with -crop on and -phys clm4_0 Irrigation doesn't work with the prognostic crop model. Irrigation is only applied to generic crop currently, which negates it's practical usage. We also have a known problem when both are on (see bug 1326 in the `$CTSMROOT/doc/KnownBugs `_ file). If you try to run in this mode, the CLM build-namelist will return with an error. - --------------------------------------------- -Namelist items that should NOT be exercised: --------------------------------------------- - -suplnitro='ALL' The suplnitro namelist option to the CN Biogeochemistry model supplies unlimited nitrogen and therefore vegetation is over-productive in this mode. - -urban_traffic:Not currently functional - -allowlakeprod:Considered experimental. - -anoxia_wtsat:Considered experimental (deprecated will be removed). - -atm_c14_filename:Considered experimental (dataset not provided). - -exponential_rooting_profile:Considered experimental. - -fin_use_fsat:Considered experimental. - -glc_dyntopo:Not currently functional. - -lake_decomp_fact:Considered experimental. - -more_vertlayers:Considered experimental. - -no_frozen_nitrif_denitrif:Considered experimental. - -perchroot:Considered experimental. - -perchroot_alt:Considered experimental. - -replenishlakec:Considered experimental. - -use_c14_bombspike:Considered experimental (dataset not provided). - -usefrootc:Considered experimental. diff --git a/doc/source/users_guide/substitutions.rst b/doc/source/users_guide/substitutions.rst index 821ebb071e..c5406a4d4e 100644 --- a/doc/source/users_guide/substitutions.rst +++ b/doc/source/users_guide/substitutions.rst @@ -1,2 +1,5 @@ .. |cesmrelease| replace:: CESM2.0.0 +.. |ctsm_gh| replace:: https://github.com/ESCOMP/ctsm + +.. |cesm_gh| replace:: https://github.com/ESCOMP/cesm From 9a1167db2f54fb8256aab9e3a7655d84cf7aa3e1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 18 Jun 2018 22:35:48 -0600 Subject: [PATCH 195/730] More work on overview and add README to the UG --- .../users_guide/overview/getting-help.rst | 80 +++++++++++++++---- .../users_guide/overview/introduction.rst | 9 +++ .../overview/scientific_validation.rst | 13 +++ 3 files changed, 87 insertions(+), 15 deletions(-) diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index aafeb057f5..cf45bc79a4 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -5,7 +5,9 @@ ============== Getting Help ============== -In addition to this users-guide there are several other resources that are available to help you use |version|. The first one is the |cesmrelease| User's-Guide, which documents the entire process of creating cases with |cesmrelease|. The next is the CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in |cesmrelease|. +In addition to this users-guide there are several other resources that are available to help you use |version|. The first one is the |cesmrelease| User's-Guide, which documents the entire process of creating cases with |cesmrelease|. +And next is the CIME User's Guide which goes over the scripts and infrastructure used for running |version| in |cesmrelease|. +The CESM bulletin board which is a web-site for exchanging information between users of CESM. There are also CLM web-pages specific for CLM, and finally there is an email address to report bugs that you find in |cesmrelease|. --------------------------- The CESM User's-Guide @@ -15,6 +17,13 @@ The CESM User's-Guide `|cesmrelease| Quickstart Guide `_ +--------------------------- +The CIME User's-Guide +--------------------------- + +The CIME Users'-Guide goes into the how to use the scripts and infrastructure of the CESM. +`CIME Users Guide `_ + ----------------------- The CESM Bulletin Board ----------------------- @@ -30,6 +39,7 @@ The CLM web pages The main CLM web page contains information on the CLM, it's history, developers, as well as downloads for previous model versions. There are also documentation text files in the $CTSMROOT/doc directory that give some quick information on using CLM. `CLM web page `_ +`|cesmrelease| |version| web page `_ `CLM Documentation Text Files `_ Also note that several of the XML database files can be viewed in a web browser to get a nice table of namelist options, namelist defaults, or compsets. Simply view them as a local file and bring up one of the following files: @@ -38,8 +48,8 @@ Also note that several of the XML database files can be viewed in a web browser - `$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml `_ -- definition of CLM4.5/CLM5.0 namelist items. - `$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_0.xml `_ -- default values for CLM4.0 namelist items. - `$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml `_ -- default values for CLM4.5/CLM5.0 namelist items. -- `scripts/ccsm_utils/Case.template/config_definition.xml `_ -- definition of all env_*.xml items. -- `scripts/ccsm_utils/Case.template/config_compsets.xml `_ -- definition of all the compsets. +- `$CTSMROOT/cime_config/config_component.xml `_ -- definition of all the CLM specific XML variables. +- `$CTSMROOT/cime_config/config_compsets.xml `_ -- definition of all the CLM compsets. - `$CTSMROOT/bld/namelist_files/history_fields_clm4_0.xml `_ -- definition of CLM4.0 history fields. - `$CTSMROOT/bld/namelist_files/history_fields_clm4_5.xml `_ -- definition of CLM4.5/CLM5.0 history fields. @@ -47,8 +57,11 @@ Also note that several of the XML database files can be viewed in a web browser Reporting bugs in |version| ---------------------------- -If you have any problems, additional questions, bug reports, or any other feedback, please send an email to <`cesmhelp@cgd.ucar.edu `_>. If you find bad, wrong, or misleading information in this users guide send an email to <`erik@ucar.edu `_>. The current list of known issues for |version| in |cesmrelease| is in the $CTSMROOT/doc/KnownBugs file, and the list of issues for |cesmrelease| is at... -`http://www.cesm.ucar.edu/models/cesm1.2//tags/|cesmrelease|/#PROBLEMS `_. +If you have any problems, additional questions, bug reports, or any other feedback, please report it as an issue +on GitHub https://github.com/ESCOMP/ctsm/issues or for CIME scripts and infrastructure to https://github.com/ESMCI/CIME/issues. +Or send an email to +<`cesmhelp@cgd.ucar.edu `_> or <`ctsm-software@ucar.edu `_>. +If you find bad, wrong, or misleading information in this users guide report it as an issue on CTSM. --------------------------------------- Some Acronym's and Terms We'll be Using @@ -60,55 +73,92 @@ CAM CESM Community Earth System Model (CESM). The coupled earth system model that CLM is a component of. +CIME + The Common Infrastructure for Modeling the Earth (CIME - pronounced “SEAMâ€) provides a Case Control System for configuring, compiling and executing Earth system models, data and stub model components, a driver and associated tools and libraries. + CLM Community Land Model (CLM). The prognostically active land model component of CESM. CLMBGC Community Land Model (|version|) with BGC Biogeochemistry. Uses CN Biogeochemistry with vertically resolved soil Carbon, CENTURY model like pools, and Nitrification/De-Nitrification. The CLM_CONFIG_OPTS option for this is - ``./xmlchange CLM_CONFIG_OPTS="phys clm5_0 -bgc cn -vsoilc_centbgc on -clm4me on"`` + ``./xmlchange CLM_CONFIG_OPTS="phys clm5_0 -bgc bgc`` + +CLMBGC-Crop + Community Land Model (|version|) with BGC Biogeochemistry and prognotic crop. The CLM_CONFIG_OPTS option for this is + + ``./xmlchange CLM_CONFIG_OPTS="phys clm5_0 -bgc bgc -crop`` CLMCN - Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0 or |version|) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Carbon Nitrogen (CN) Biogeochemistry (either CLM4.0, CLM4.5 or |version|) The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cn" -append`` CLMSP - Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0 or |version|) The CLM_CONFIG_OPTS option for this is + Community Land Model (CLM) with Satellite Phenology (SP) (either CLM4.0, CLM4.5 or |version|) The CLM_CONFIG_OPTS option for this is - ``./xmlchange CLM_CONFIG_OPTS="-bgc none" -append`` + ``./xmlchange CLM_CONFIG_OPTS="-bgc sp" -append`` CLMU - Community Land Model (CLM) Urban Model (either CLM4.0 or |version|). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). + Community Land Model (CLM) Urban Model (either CLM4.0, CLM4.5 or |version|). The urban model component of CLM is ALWAYS active (unless you create special surface datasets that have zero urban percent, or for regional/single-point simulations for a non-urban area). CRUNCEP - The Climate Research Unit (CRU) analysis of the NCEP atmosphere reanalysis atmosphere forcing data. This can be used to drive CLM with atmosphere forcing from 1901 to 2010. We also DO expect to be able to update this dataset beyond 2010 as newer data becomes available. + The Climate Research Unit (CRU) analysis of the NCEP atmosphere reanalysis atmosphere forcing data. This can be used to drive CLM with atmosphere forcing from 1901 to 2016. This data is updated every year, the version we are currently using is Version-7. The las CESM1.2.2 release used Version-4 data. + +CTSM + The Community Terrestrial Systems Model, of which |version| and CLM4.5 are namelist option sets of. CTSM is a wider community + that includes using CTSM for Numerical Weather Prediction (NWP) as well as climate. DATM - Data Atmosphere Model (DATM) the prescribed data atmosphere component for CESM. Forcing data that we provide are either the Qian or CRUNCEP forcing datasets (see below). + Data Atmosphere Model (DATM) the prescribed data atmosphere component for CESM. Forcing data that we provide are either the CRUNCEP, Qian, or GSWP3 forcing datasets (see below). DV - Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either |version|-BGC or CLMCN for either CLM4.0 or |version|). The CLM_CONFIG_OPTS option for this is + Dynamic global vegetation, where fractional PFT (see PFT below) changes in time prognostically. Can NOT be used with prescribed transient PFT (requires either CLMBGC or CLMCN for either CLM4.0, CLM4.5 or |version|). The CLM_CONFIG_OPTS option for this is ``./xmlchange CLM_CONFIG_OPTS="-bgc cndv" -append`` + This option is being phased out for the different methodology of FATES (see below). DV is not currently scientifically validated + and as such should be considered experimental. + ESMF Earth System Modeling Framework (ESMF). They are a software project that provides a software library to support Earth System modeling. We provide interfaces for ESMF as well as use their regridding capabilities for offline CLM tools. +FATES + Functionally Assembled Terrestrial Ecosystem Simulator. This is being developed by the Next Generation Ecosystem Experiment Tropics’ (NGEE-T) + project and uses both |version| and the land model component of E3SM (Energy Exascale Earth System Model). + +FUN + Fixation and Uptake of Nitrogen model, a parameter option of |version|. + +GSWP3 + Global Soil Wetness Project (GSPW3) atmospheric forcing data. It is a 3-hourly 0.5° global forcing product (1901-2014) that is based on the NCEP 20th Century Reanalysis, with additional bias corrections added by GSWP3. + +LUNA + Leaf Utilization of Nitrogen for Assimilation parameterization option as part of |version|. + NCAR National Center for Atmospheric Research (NCAR). This is the research facility that maintains CLM with contributions from other national labs and Universities. NCEP The National Center for Environmental Prediction (NCEP). In this document this normally refers to the reanalysis atmosphere data produced by NCEP. +MOSART + Model for Scale Adaptive River Transport, ROF model component option added as part of |version|. It is the standard + ROF model used in |version| compsets. + PFT Plant Function Type (PFT). A type of vegetation that CLM parameterizes. PTCLM PoinT CLM (PTCLM) a python script that operates on top of CLM for |version| to run single point simulations for CLM. -Qian - The Qian et. al. analysis of the NCEP forcing data. This can be used to drive CLM with atmosphere forcing from 1948 to 2004. We do NOT expect to be able to update this dataset beyond 2004. +ROF + River runOff Model to route flow of surface water over land out to the ocean. |cesmrelease| has two components options for this + the new model MOSART and previous model RTM. + +RTM + River Transport Model, ROF model component option that has been a part of all versions of CESM. It is the standard ROF + model used in CLM4.5 and CLM4.0 compsets. SCRIP Spherical Coordinate Remapping and Interpolation Package (SCRIP). We use it's file format for specifying both grid coordinates as well as mapping between different grids. diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 9705057439..075462d35f 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -147,6 +147,15 @@ Finally in `Appendix A `_ we give instructions on how to build the docu This document is included in every CLM distribution and can be built so that you can view a local copy rather than having to go to the CESM website. This also could be useful for developers who need to update the documentation due to changes they have made. +================================ +README file describing |version| +================================ + +The README (which can be found in ``$CTSMROOT/doc``) is repeated here. + +.. include:: ../../clm5.0/README + :literal: + .. _best-practices-for-usage: ================ diff --git a/doc/source/users_guide/overview/scientific_validation.rst b/doc/source/users_guide/overview/scientific_validation.rst index 12afe4bbf5..9b38be4808 100644 --- a/doc/source/users_guide/overview/scientific_validation.rst +++ b/doc/source/users_guide/overview/scientific_validation.rst @@ -16,3 +16,16 @@ See `http://www.cesm.ucar.edu/models/cesm1.2/clm/CLM_configurations_CESM1.2.pdf `_ for an explanation of what configurations are scientifically validated for |version|. For CLM4.0 changes to the science of the model are minimal since CESM1.1.1 so we expect answers to be very similar to using it. In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case you will need to go through more extensive work to validate these options from a scientific standpoint. Some of these options are only for |version| while others are for both CLM4.0 AND |version| we explicitly say which they apply to. + +----------------------------------------------- +Configurations that should be used with caution +----------------------------------------------- + +There are some options in |version| that are available but either not tested extensively, or not scientifically evaluated. These +options should be used with caution. And any options that deviate from the scientifically supported configurations can have issues. +The IMPORTANT_NODES file goes into more details on this. + +The IMPORTANT_NOTES (which can be found in ``$CTSMROOT/doc``) is repeated here. + +.. include:: ../../clm5.0/doc/IMPORTANT_NOTES + :literal: From b7b3fd3ab5194fb143887afa8d2ea4d03d2c489f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Jun 2018 22:16:21 -0600 Subject: [PATCH 196/730] Work on the setting up a case section --- .../users_guide/overview/introduction.rst | 2 +- .../choosing-a-compset.rst | 17 +++- .../customizing-the-clm-configuration.rst | 97 +++++++++++-------- .../customizing-the-clm-namelist.rst | 8 +- .../customizing-the-datm-namelist.rst | 30 ++++-- 5 files changed, 95 insertions(+), 59 deletions(-) diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index 075462d35f..c3d29ab83b 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -200,7 +200,7 @@ The README (which can be found in ``$CTSMROOT/doc``) is repeated here. The model sends aerosol deposition from the atmospheric model (either CAM or DATM). When running with prescribed aerosol the atmosphere model will interpolate the aerosols from 2-degree resolution to the resolution the atmosphere model is running at. -.. _CTSM_vs_CESM_checkout: +.. _ctsm_vs_cesm_checkout: ============================= A CTSM versus a CESM checkout diff --git a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst index df702e0185..c2bb0b606b 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/choosing-a-compset.rst @@ -3,7 +3,7 @@ .. include:: ../substitutions.rst ==================== - Choosing a compset +Choosing a compset ==================== When setting up a new case one of the first choices to make is which "component set" (or compset) to use. @@ -12,6 +12,8 @@ We label the different types of compsets with a different letter of the alphabet The compsets of interest when working with CLM are the "I" compsets (which contain CLM with a data atmosphere model and a stub ocean, and stub sea-ice models), "E" and "F" compsets (which contain CLM with the active atmosphere model (CAM), prescribed sea-ice model, and a data ocean model), and "B" compsets which have all active components. Below we go into details on the "I" compsets which emphasize CLM as the only active model, and just mention the two other categories. +To run CLM coupled to CAM ("E" or "F" compsets) or fully coupled ("B compsets) you need to be running CLM from a CESM checkout rather than a CTSM checkout (see :ref:`ctsm_vs_cesm_checkout`). + When working with CLM you usually want to start with a relevant "I" compset before moving to the more complex cases that involve other active model components. The "I" compsets can exercise CLM in a way that is similar to the coupled modes, but with much lower computational cost and faster turnaround times. @@ -22,9 +24,14 @@ Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) Here is the entire list of compsets available. -Note that using the "-user_compset" option even more combinations are possible. -In the list below we give the alias name and then the long name which describes each component in parenthesis. -Alias (Long-name with time-period and each component) + +`CESM compsets `_ + +Note that using the "-user_compset" option even more combinations are possible. To get a list of the compsets use the "query_config" +command as follows: +:: + + $CTSMROOT/cime/scripts/query_config --compsets clm Compsets coupled to active atmosphere with data ocean ----------------------------------------------------- @@ -37,5 +44,5 @@ Fully coupled compsets are compsets that start with "B" in the name. They are de Conclusion to choosing a compset -------------------------------- We've introduced the basic type of compsets that use CLM and given some further details for the "standalone CLM" (or "I" compsets). -The `config_compsets.xml `_ lists all of the compsets and gives a full description of each of them. +The `$CTSMROOT/cime_config/config_compsets.xml `_ lists all of the compsets and gives a full description of each of them. In the next section we look into customizing the setup time options for compsets using CLM. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index 38f61c2c4d..f752b1a766 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -2,23 +2,26 @@ .. include:: ../substitutions.rst -******************************* -Customizing CLM's Configuration -******************************* +******************************** + Customizing CLM's Configuration +******************************** -The "Creating a Case" section of the |cesmrelease| `Scripts User's-Guide `_ gives instructions on creating a case. What is of interest here is how to customize your use of CLM for the case that you created. +The section of the |cesmrelease| Quickstart `CESM Create a Case `_ gives instructions on creating a case. +Also see a similar section in the CIME User's-Guide `CIME Create a case `_. +What is of interest here is how to customize your use of CLM for the case that you created. -For CLM when **preview_namelist**, **$CASE.build**, or **$CASE.run** are called there are two steps that take place: +For CLM when **preview_namelist**, **case.build**, or **case.run** are called there are two steps that take place: -1. The CLM "**configure**" script is called to setup the build-time configuration for CLM (more information on **configure** is given in `the Section called More information on the CLM configure script `_). The env variables for **configure** are locked after the **$CASE.build** step. So the results of the CLM **configure** are locked after the build has taken place. +1. The CLM "**configure**" script is called to setup the build-time configuration for CLM (more information on **configure** is given in `the Section called More information on the CLM configure script `_). The env variables for **configure** are locked after the **case.build** step. So the results of the CLM **configure** are locked after the build has taken place. 2. The CLM "**build-namelist**" script is called to generate the run-time namelist for CLM (more information on **build-namelist** is given below in `the Section called Definition of Namelist items and their default values `_. -When customizing your case at the *8cesm_setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "$CTSMROOT/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. +When customizing your case at the **case.setup** step you are able to modify the process by effecting either one or both of these steps. The CLM "**configure**" and "**build-namelist**" scripts are both available in the "$CTSMROOT/bld" directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what types of options you can give either of them. There are five different types of customization for the configuration that we will discuss: |version| in |cesmrelease| build-time options, |version| in |cesmrelease| run-time options, User Namelist, other noteworthy |cesmrelease| configuration items, the CLM **configure** script options, and the CLM **build-namelist** script options. -Information on all of the script, configuration, build and run items is found under ``scripts/ccsm_utils/Case.template`` in the `config_definition.xml `_ file. +Information on all of the CLM script, configuration, build and run items is found under ``$CTSMROOT/cime_config/config_component.xml``. +See `CLM CASEROOT Variable Definitions `_. ================================ CLM Script configuration items @@ -27,13 +30,16 @@ Information on all of the script, configuration, build and run items is found un Below we list each of the CESM configuration items that are specific to CLM. All of these are available in your: ``env_build.xml`` and ``env_run.xml`` files. :: - CLM_CONFIG_OPTS + CLM_ACCELERATED_SPINUP CLM_BLDNML_OPTS - CLM_NAMELIST_OPTS + CLM_CO2_TYPE + CLM_CONFIG_OPTS + CLM_CPPDEFS CLM_FORCE_COLDSTART + CLM_NAMELIST_OPTS CLM_NML_USE_CASE CLM_USRDAT_NAME - CLM_CO2_TYPE + COMP_LND For the precedence of the different options to **build-namelist** see the section on precedence below. @@ -45,16 +51,16 @@ CLM_CONFIG_OPTS You can still add more options to your ``CLM_CONFIG_OPTS`` but make sure you add to what is already there rather than replacing it. Hence, we recommend using the "-append" option to the xmlchange script. In `the Section called More information on the CLM configure script `_ below we will go into more details on options that can be customized in the CLM "**configure**" script. - It's also important to note that the **clm.buildnml.csh** script may already invoke certain CLM **configure** options and as such those command line options are NOT going to be available to change at this step (nor would you want to change them). + It's also important to note that the **$CTSMROOT/cime_config/buildnml** script may already invoke certain CLM **configure** options and as such those command line options are NOT going to be available to change at this step (nor would you want to change them). The options to CLM **configure** are given with the "-help" option which is given in `the Section called More information on the CLM configure script `_. - .. note:: ``CLM_CONFIG_OPTS`` is locked after the **$CASE.build** script is run. If you want to change something in ``CLM_CONFIG_OPTS`` you'll need to clean the build and rerun **$CASE.build**. The other env variables can be changed at run-time so are never locked. + .. note:: ``CLM_CONFIG_OPTS`` is locked after the **case.build** script is run. If you want to change something in ``CLM_CONFIG_OPTS`` you'll need to clean the build and rerun **case.build**. The other env variables can be changed at run-time so are never locked. CLM_NML_USE_CASE ``CLM_NML_USE_CASE`` is used to set a particular set of conditions that set multiple namelist items, all centering around a particular usage of the model. To list the valid options do the following: :: - > cd $CTSMROOT/doc - > ../bld/build-namelist -use_case list + > cd $CTSMROOT + > ./bld/build-namelist -use_case list The output of the above command is: :: @@ -108,7 +114,7 @@ CLM_NML_USE_CASE CLM_BLDNML_OPTS The option CLM_BLDNML_OPTS is for passing options to the CLM "build-namelist" script. - As with the CLM "configure" script the CLM clm.buildnml.csh may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the "build-namelist" script is to do + As with the CLM "configure" script the CLM $CTSMROOT/cime_config/buildnml may already invoke certain options and as such those options will NOT be available to be set here. The best way to see what options can be sent to the "build-namelist" script is to do :: > cd $CTSMROOT/bld @@ -257,7 +263,7 @@ CLM_BLDNML_OPTS 5. values from the namelist defaults file. -The **clm.buildnml.csh** script already sets the resolution and mask as well as the CLM **configure** file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. +The **$CTSMROOT/cime_config/buildnml** script already sets the resolution and mask as well as the CLM **configure** file, and defines an input namelist and namelist input file, and the output namelist directory, and sets the start-type (from ``RUN_TYPE``), namelist options (from ``CLM_NAMELIST_OPTS``), co2_ppmv (from ``CCSM_CO2_PPMV``, co2_type (from ``CLM_CO2_TYPE``), lnd_frac (from ``LND_DOMAIN_PATH`` and ``LND_DOMAIN_FILE``), l_ncpl (from ``LND_NCPL``, glc_grid, glc_smb, glc_nec (from ``GLC_GRID``, ``GLC_SMB``, and ``GLC_NEC``), and "clm_usr_name" is set (to ``CLM_USRDAT_NAME >``when the grid is set to ``CLM_USRDAT_NAME``. Hence only the following different options can be set: 1. @@ -288,7 +294,7 @@ Hence only the following different options can be set: "-bgc_spinup" is an option only available for |version| for any configuration when CN is turned on (so either CLMCN or CLMBGC). It can be set to "on" or "off". If "on" the model will go into Accelerated Decomposition mode, while for "off" (the default) it will have standard decomposition rates. If you are starting up from initial condition files the model will check what mode the initial condition file is in and do the appropriate action on the first time-step to change the Carbon pools to the appropriate spinup setting. See `the Section called Spinning up the |version| biogeochemistry (CLMBGC spinup) in Chapter 4 `_ for an example using this option. -"-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **$CASE.build** or **$CASE.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. +"-chk_res" ensures that the resolution chosen is supported by CLM. If the resolution is NOT supported it will cause the CLM **build-namelist** to abort when run. So when either **preview_namelist**, **case.build** or **case.run** is executed it will abort early. Since, the CESM scripts only support certain resolutions anyway, in general this option is NOT needed in the context of running CESM cases. "-clm_demand" asks the **build-namelist** step to require that the list of variables entered be set. Typically, this is used to require that optional filenames be used and ensure they are set before continuing. For example, you may want to require that fpftdyn be set to get dynamically changing vegetation types. To do this you would do the following. :: @@ -310,7 +316,9 @@ To see a list of valid variables that you could set do this: "-ignore_ic_year" ignores the Initial Conditions (IC) year for finding initial condition files to startup from. The date is used, but the year is ignored. Without this option or the "-ignore_ic_date" option below, the date and year of the file comes into play. -When "-irrig" is used **build-namelist** will try to find surface datasets that have the irrigation model enabled. +When "-irrig on" is used **build-namelist** will try to find surface datasets that have the irrigation model enabled (when running +with Sattellitte Phenology). When running with the prognostic crop model on, "-irrig on" will turn irrigate crops on, while "-irrig off" +will manage all crop areas as rain-fed without irrigation. "no-megan" means do NOT add the MEGAN model Biogenic Volatile Organic Compounds (BVOC) namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless "no-megan" is specified the CLM **build-namelist** will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). @@ -374,7 +382,7 @@ When "-irrig" is used **build-namelist** will try to find surface datasets that User Namelist =============== -``CLM_NAMELIST_OPTS`` as described above allows you to set any extra namelist items you would like to appear in your namelist. However, it only allows you a single line to enter namelist items, and strings must be quoted with ' which is a bit awkward. If you have a long list of namelist items you want to set (such as a long list of history fields) a convenient way to do it is to add to the ``user_nl_clm`` that is created after the **cesm_setup** command runs. The file needs to be in valid FORTRAN namelist format (with the exception that the namelist name &namelist and the end of namelist marker "/" are excluded". The **preview_namelist** or **$CASE.run** step will abort if there are syntax errors. All the variable names must be valid and the values must be valid for the datatype and any restrictions for valid values for that variable. Here's an example ``user_nl_clm`` namelist that sets a bunch of history file related items, to create output history files monthly, daily, every six and 1 hours. +``CLM_NAMELIST_OPTS`` as described above allows you to set any extra namelist items you would like to appear in your namelist. However, it only allows you a single line to enter namelist items, and strings must be quoted with ' which is a bit awkward. If you have a long list of namelist items you want to set (such as a long list of history fields) a convenient way to do it is to add to the ``user_nl_clm`` that is created after the **case.setup** command runs. The file needs to be in valid FORTRAN namelist format (with the exception that the namelist name &namelist and the end of namelist marker "/" are excluded". The **preview_namelist** or **case.run** step will abort if there are syntax errors. All the variable names must be valid and the values must be valid for the datatype and any restrictions for valid values for that variable. Here's an example ``user_nl_clm`` namelist that sets a bunch of history file related items, to create output history files monthly, daily, every six and 1 hours. ---------------------------------- Example: user_nl_clm namelist file @@ -460,17 +468,17 @@ Especially with CLMBGC and CLMCN starting from initial conditions is very import - `the Section called Providing a finidat file in your user_nl_clm file `_ - `the Section called Adding a finidat file to the XML database `_ - **Note:** Your initial condition file MUST agree with the surface dataset you are using to run the simulation. If the two files do NOT agree you will get a run-time about a mis-match in PFT weights, or in the number of PFT's or columns. To get around this you'll need to use the `Section called Using interpinic to interpolate initial conditions to different resolutions in Chapter 2 `_ to interpolate your initial condition dataset. + **Note:** Your initial condition file MUST agree with the surface dataset you are using to run the simulation. If the two files do NOT agree you will get a run-time about a mis-match in PFT weights, or in the number of PFT's or columns. To get around this you'll need to add the "use_init_interp=T" namelist flag in your namelist so that the initial conditions will be interpolated on startup.** ------------------------------------------------------- Doing a hybrid simulation to provide initial conditions ------------------------------------------------------- -The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup most cases, at the standard resolutions of "f09" or "f19" it will already do this for you. For example, if you run an "I2000CN" compset at "f09_g17_gl4" resolution the following settings will already be done for you. +The first option is to setup a hybrid simulation and give a ``RUN_REFCASE`` and ``RUN_REFDATE`` to specify the reference case simulation name to use. When you setup coupled cases (assuming a CESM checkout), at the standard resolution of "f09" it will already do this for you. For example, if you run an "B1850" compset at "f09_g17_gl4" resolution the following settings will already be done for you. -``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=I2000CN_f09_g17_gl4_c100503,RUN_REFDATE=0001-01-01,GET_REFCASE=TRUE`` +``./xmlchange RUN_TYPE=hybrid,RUN_REFCASE=b.e20.B1850.f09_g17.pi_control.all.297,RUN_REFDATE=0130-01-01,GET_REFCASE=TRUE`` -Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the: ``$DIN_LOC_ROOT/ccsm4_init/I2000CN_f09_g17_gl4_c100503/0001-01-01`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. +Setting the ``GET_REFCASE`` option to ``TRUE means`` it will copy the files from the RUN_REFDIR usually under: ``$DIN_LOC_ROOT/cesm2_init/$RUN_REFCASE/$RUN_REFDATE`` directory. Note, that the ``RUN_REFCASE`` and ``RUN_REFDATE`` variables are expanded to get the directory name above. If you do NOT set ``GET_REFCASE`` to ``TRUE`` then you will need to have placed the file in your run directory yourself. In either case, the file is expected to be named: ``$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc`` with the variables expanded of course. ------------------------------------------------------- Doing a branch simulation to provide initial conditions @@ -500,12 +508,13 @@ Other noteworthy configuration items ------------------------------------ For running "I" cases there are several other noteworthy configuration items that you may want to work with. -Most of these involve settings for the DATM, but one ``CCSM_CO2_PPMV`` applies to all models. +Most of these involve settings for the DATM, but one ``CCSM_CO2_PPMV`` applies to all models. The list of DATM +settings is `here `_. If you are running an B, E, or F case that doesn't use the DATM obviously the DATM_* settings will not be used. All of the settings below are in your ``env_build.xml`` and ``env_run.xml`` files :: CCSM_CO2_PPMV - CCSM_VOC + CCSM_BGC DATM_MODE DATM_PRESAERO DATM_CLMNCEP_YR_ALIGN @@ -519,24 +528,30 @@ If you are running an B, E, or F case that doesn't use the DATM obviously the DA ``CCSM_CO2_PPMV`` Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the CCSM_BGC variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item co2_type tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. -``CCSM_VOC`` - Enables passing of the Volatile Organic Compounds (VOC) from CLM to the atmospheric model. This of course is only important if the atmosphere model is a fully active model that can use these fields in it's chemistry calculations. - ``DATM_MODE`` - Sets the mode that the DATM model should run in this determines how data is handled as well as what the source of the data will be. Many of the modes are setup specifically to be used for ocean and/or sea-ice modeling. The modes that are designed for use by CLM are: + Sets the mode that the DATM model should run in this determines how data is handled as well as what the source of the data will be. Many of the modes are setup specifically to be used for ocean and/or sea-ice modeling. The modes that are designed for use by CLM are (CLM_QIAN, CLMCRUNCEP, CLMCRUNCEPv7, CLMGSWP3v1 and CLM1PT): :: CLMCRUNCEP + CLMCRUNCEPv7 + CLMGSWP3v1 CLM_QIAN - CLM1PT> - CPLHIST3HrWx + CLM1PT + CPLHISTForcing ``CLMCRUNCEP`` - The standard mode for |version| of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010. + The standard mode for CLM4.5 of using global atmospheric data that was developed by CRU using NCEP data from 1901 to 2010 (version 4 of this series). See `the Section called CLMCRUNCEP mode and it's DATM settings `_ for more information on the DATM settings for ``CLMCRUNCEP`` mode. +``CLMCRUNCEPv7`` + Version 7 of the CRUNCEP data from 1901 to 2016. + See `the Section called CLMCRUNCEPv7 mode and it's DATM settings `_ for more information on the DATM settings for ``CLMCRUNCEP`` mode. + +``CLMGSWP3v1`` + GSWP3 version 1 forcing data based on NCEP reanalysis with bias corrections by GSWP3 from 1901 to 2010. + ``CLM_QIAN`` - The standard mode for CLM4.0 of using global atmospheric data that was developed by Qian et. al. for CLM using NCEP data from 1948 to 2004. See the `Section called CLM_QIAN mode and it's DATM settings `_ for more information on the DATM settings for ``CLM_QIAN`` mode. ``CLM1PT`` is for the special cases where we have single-point tower data for particular sites. Right now we only have data for three urban locations: MexicoCity Mexico, Vancouver Canada, and the urban-c alpha site. And we have data for the US-UMB AmeriFlux tower site for University of Michigan Biological Station. See `the Section called CLM1PT mode and it's DATM settings `_ for more information on the DATM settings for ``CLM1PT`` mode. ``CPLHIST3HrWx`` is for running with atmospheric forcing from a previous CESM simulation. See `the Section called CPLHIST3HrWx mode and it's DATM settings `_ for more information on the DATM settings for ``CPLHIST3HrWx`` mode. + The standard mode for CLM4.0 of using global atmospheric data that was developed by Qian et. al. for CLM using NCEP data from 1948 to 2004. See the `Section called CLM_QIAN mode and it's DATM settings `_ for more information on the DATM settings for ``CLM_QIAN`` mode. ``CLM1PT`` is for the special cases where we have single-point tower data for particular sites. Right now we only have data for three urban locations: MexicoCity Mexico, Vancouver Canada, and the urban-c alpha site. And we have data for the US-UMB AmeriFlux tower site for University of Michigan Biological Station. See `the Section called CLM1PT mode and it's DATM settings `_ for more information on the DATM settings for ``CLM1PT`` mode. ``CPLHISTForcing`` is for running with atmospheric forcing from a previous CESM simulation. See `the Section called CPLHISTForcing mode and it's DATM settings `_ for more information on the DATM settings for ``CPLHISTForcing`` mode. ``DATM_PRESAERO`` sets the prescribed aerosol mode for the data atmosphere model. The list of valid options include: @@ -567,13 +582,13 @@ DATM_CLMNCEP_YR_ALIGN ``DATM_CLMNCEP_YR_START`` and ``DATM_CLMNCEP_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CLMNCEP_YR_ALIGN`` determines which year in that range of years the simulation will start with. DATM_CPL_CASE - ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHIST3HrWx`` mode. + ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. DATM_CPL_YR_START - ``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHIST3HrWx`` mode. + ``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. DATM_CPL_YR_END - ``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHIST3HrWx`` mode. + ``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. DATM_CPL_YR_ALIGN ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CPL_YR_ALIGN`` determines which year in that range of years the simulation will start with. @@ -586,16 +601,16 @@ In Chapter One of the `CESM User's Guide `_ there is a section The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of it's size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use **check_input_data** to export the data. -The ``CPLHIST3HrWx`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. -------------------------------------- Customizing via the build script files -------------------------------------- -The final thing that the user may wish to do before **cesm_setup** is run is to edit the build script files which determine the configuration and namelist. The variables in ``env_build.xml`` or ``env_run.xml`` typically mean you will NOT have to edit build script files. But, there are rare instances where it is useful to do so. The build script files are copied to your case directory and are available under Buildconf. The list of build script files you might wish to edit are: +The final thing that the user may wish to do before **case.setup** is run is to edit the build script files which determine the configuration and namelist. The variables in ``env_build.xml`` or ``env_run.xml`` typically mean you will NOT have to edit build script files. But, there are rare instances where it is useful to do so. The build script files are copied to your case directory and are available under Buildconf. The list of build script files you might wish to edit are: **clm.buildexe.csh** -**clm.buildnml.csh** +**$CTSMROOT/cime_config/buildnml** **datm.buildexe.csh** **datm.buildnml.csh** @@ -687,4 +702,4 @@ The output to the above command is as follows: We've given details on how to use the options in env_build.xml and env_run.xml to interact with the CLM "configure" and "build-namelist" scripts, as well as giving a good understanding of how these scripts work and the options to them. -In the next section we give further details on the CLM namelist. You could customize the namelist for these options after "cesm_setup" is run. +In the next section we give further details on the CLM namelist. You could customize the namelist for these options after "case.setup" is run. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index 41eec17598..93f30f8a29 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -6,7 +6,7 @@ Customizing CLM's namelist ============================ -Once a case is **cesm_setup**, we can then customize the case further, by editing the run-time namelist for CLM. First let's list the definition of each namelist item and their valid values, and then we'll list the default values for them. Next for some of the most used or tricky namelist items we'll give examples of their use, and give you example namelists that highlight these features. +Once a case has run **case.setup**, we can then customize the case further, by editing the run-time namelist for CLM. First let's list the definition of each namelist item and their valid values, and then we'll list the default values for them. Next for some of the most used or tricky namelist items we'll give examples of their use, and give you example namelists that highlight these features. In the following, various examples of namelists are provided that feature the use of different namelist options to customize a case for particular uses. Most the examples revolve around how to customize the output history fields. @@ -55,7 +55,7 @@ Below we will give examples of user namelists that activate different commonly u The default namelist -------------------- -Here we give the default namelist as it would be created for an "I1850Clm50BgcCropCru" compset at 0.9x1.25 resolution with a gx1v6 land-mask on cheyenne. To edit the namelist you would edit the ``user_nl_clm`` user namelist with just the items you want to change. For simplicity we will just show the CLM namelist and NOT the entire file. In the sections below, for simplicity we will just show the user namelist (``user_nl_clm``) that will add (or modify existing) namelist items to the namelist. +Here we give the default namelist as it would be created for an "I1850Clm50BgcCropCru" compset at 0.9x1.25 resolution with a gx1v7 land-mask on cheyenne. To edit the namelist you would edit the ``user_nl_clm`` user namelist with just the items you want to change. For simplicity we will just show the CLM namelist and NOT the entire file. In the sections below, for simplicity we will just show the user namelist (``user_nl_clm``) that will add (or modify existing) namelist items to the namelist. Example 1-2. Default CLM Namelist --------------------------------- @@ -141,7 +141,7 @@ The number of samples on each history file stream is given by the namelist varia A sample user namelist ``user_nl_clm`` turning on four extra file streams for output: daily, six-hourly, hourly, and every time-step, leaving the primary history files as monthly, and changing the number of samples on the streams to: yearly (12), thirty, weekly (28), daily (24), and daily (48) is: Example: user_nl_clm namelist adding auxiliary history files and changing output frequency ------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------------------ :: hist_fincl2 = 'TG', 'TV' @@ -242,8 +242,6 @@ Example: user_nl_clm namelist outputting some files in 1D Vector format .. note:: Technically the default for hist_nhtfrq is for primary files output monthly and the other auxiliary tapes for daily, so we don't actually have to include hist_nhtfrq, we could use the default for it. Here we specify it for clarity. -.. caution:: LAND and COLS are also options to the pertape averaging, but currently there is a bug with them and they fail to work. - Visualizing global 1D vector files will take effort. You'll probably want to do some post-processing and possibly just extract out single points of interest to see what is going on. Since, the output is a 1D vector, of only land-points traditional plots won't be helpful. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst index 4140dad87a..dcc7fa3cbb 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-datm-namelist.rst @@ -11,7 +11,7 @@ When running "I" compsets with CLM you use the DATM model to give atmospheric fo 1. **DATM Main Namelist and Stream Namlist gorup** (``datm_in``) 2. **DATM stream files** -The `Data Model Documentation `_ gives the details of all the options for the data models and for DATM specifically. +The `Data Model Documentation `_ gives the details of all the options for the data models and for DATM specifically. It goes into detail on all namelist items both for DATM and for DATM streams. So here we won't list ALL of the DATM namelist options, nor go into great details about stream files. But, we will talk about a few of the different options that are relevant for running with CLM. @@ -51,10 +51,20 @@ tintalgo In the sections below we go over each of the relevant ``DATM_MODE`` options and what the above DATM settings are for each. This gives you examples of actual usage for the settings. We also describe in what ways you might want to customize them for your own case. -------------------------------------- -CLMCRUNCEP mode and it's DATM settings +CLMGSWP3v1 mode and it's DATM settings -------------------------------------- -In ``CLMCRUNCEP`` mode the CRUNCEP dataset is used and all of it's data is on a 6-hourly interval. +In ``CLMGSWP3v1`` mode the GSWP3 NCEP forcing dataset is used and all of it's data is on a 3-hourly interval. +Like ``CLM_QIAN`` the dataset is divided into those three data streams: solar, precipitation, and everything else (temperature, pressure, humidity, Long-Wave down and wind). +The time-stamps of the data were also adjusted so that they are the beginning of the interval for solar, and the middle for the other two. +Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is: ``coszen``, ``nearest``, and ``linear`` for the solar, precipitation and other data respectively. +``taxmode`` is set to ``cycle`` and ``mapalgo`` is set to ``bilinear`` so that the data is spatially interpolated from the input exact half degree grid to the grid the atmosphere model is being run at (to run at this same model resolution use the 360x720cru_360x720cru resolution). + +---------------------------------------- +CLMCRUNCEPv7 mode and it's DATM settings +---------------------------------------- + +In ``CLMCRUNCEPv7`` mode the CRUNCEP dataset is used and all of it's data is on a 6-hourly interval. Like ``CLM_QIAN`` the dataset is divided into those three data streams: solar, precipitation, and everything else (temperature, pressure, humidity and wind). The time-stamps of the data were also adjusted so that they are the beginning of the interval for solar, and the middle for the other two. Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is: ``coszen``, ``nearest``, and ``linear`` for the solar, precipitation and other data respectively. @@ -64,6 +74,12 @@ Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is: ``cosze For more information on CRUNCEP forcing see `http://dods.extra.cea.fr/data/p529viov/cruncep/ `_. +-------------------------------------- +CLMCRUNCEP mode and it's DATM settings +-------------------------------------- + +``CLMCRUNCEP`` is similar to the ``CLMCRUNCEPv7`` mode above, except it uses Version 4 of the CRUNCEP data rather than version 7. + ------------------------------------ CLM_QIAN mode and it's DATM settings ------------------------------------ @@ -92,11 +108,11 @@ Because, of this the ``offset`` is set to zero, and the ``tintalgo`` is set to ` If you are using your own data for this mode and it's not at least hourly you'll want to adjust the DATM settings for it. If the data is three or six hourly, you'll need to divide it up into separate streams like in ``CLM_QIAN`` mode which will require fairly extensive changes to the DATM namelist and streams files. For an example of doing this see `Example 5-8 `_. ----------------------------------------- -CPLHIST3HrWx mode and it's DATM settings ----------------------------------------- +------------------------------------------ +CPLHISTForcing mode and it's DATM settings +------------------------------------------ -In ``CPLHIST3HrWx`` mode the model is assumed to have 3-hourly for a global grid from a previous CESM simulation. +In ``CPLHISTForcing`` mode the model is assumed to have 3-hourly for a global grid from a previous CESM simulation. Like ``CLM_QIAN`` mode the data is divided into three streams: one for precipitation, one for solar, and one for everything else. The time-stamps for Coupler history files for CESM is at the end of the interval, so the ``offset`` needs to be set in order to adjust the time-stamps to what it needs to be for the ``tintalgo`` settings. For precipitation ``taxmode`` is set to ``nearest`` so the ``offset`` is set to ``-5400`` seconds so that the ending time-step is adjusted by an hour and half to the middle of the interval. From 6e59daa67289608b4595c59c7e5e2ccfc16e289d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Jun 2018 15:23:57 -0600 Subject: [PATCH 197/730] Work on the tools chapter --- .../building-the-clm-tools.rst | 42 +++++++++---------- .../users_guide/using-clm-tools/cprnc.rst | 5 +-- .../using-clm-tools/creating-domain-files.rst | 6 +-- ...g-input-for-surface-dataset-generation.rst | 10 +---- .../creating-surface-datasets.rst | 20 +-------- .../what-are-the-clm-tools.rst | 31 +++++++------- 6 files changed, 43 insertions(+), 71 deletions(-) diff --git a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst index 1dd1129b6c..1b64786d99 100644 --- a/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/building-the-clm-tools.rst @@ -4,24 +4,24 @@ .. include:: ../substitutions.rst -The FORTRAN tools all have similar makefiles, and similar options for building. -All of the Makefiles use GNU Make extensions and thus require that you use GNU make to use them. +The CLM FORTRAN tools all have similar makefiles, and similar options for building. The tools +**cprnc** and **gen_domain** use the CIME configure/build system which is described in the next section. + +The Makefiles (for **mksurfdata_map** and **mkprocdata_map**) use GNU Make extensions and thus require that you use GNU make to use them. They also auto detect the type of platform you are on, using "uname -s" and set the compiler, compiler flags and such accordingly. There are also environment variables that can be set to set things that must be customized. All the tools use NetCDF and hence require the path to the NetCDF libraries and include files. On some platforms (such as Linux) multiple compilers can be used, and hence there are env variables that can be set to change the FORTRAN and/or "C" compilers used. -The tools other than cprnc also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. -Finally the tools other than **cprnc** allow you to turn optimization on (which is off by default but on for the **mksurfdata_map** and **interpinic** programs) with the OPT flag so that the tool will run faster. -To get even faster performance, the **interpinic**, program allows you to also use the SMP to turn on multiple shared memory processors. -When ``SMP=TRUE`` you set the number of threads used by the program with the ``OMP_NUM_THREADS`` environment variable. +The tools also allow finer control, by also allowing the user to add compiler flags they choose, for both FORTRAN and "C", as well as picking the compiler, linker and and add linker options. +Finally the tools allow you to turn optimization on (which is off by default but on for **mksurfdata_map**) with the OPT flag so that the tool will run faster. -Options used by all: **cprnc**, **interpinic**, and **mksurfdata_map** +Options used by all: **mksurfdata_map** - ``LIB_NETCDF`` -- sets the location of the NetCDF library. - ``INC_NETCDF`` -- sets the location of the NetCDF include files. - ``USER_FC`` -- sets the name of the FORTRAN compiler. -Options used by: **interpinic**, **mkprocdata_map**, **mkmapgrids**, and **mksurfdata_map** +Options used by: **mkprocdata_map**, and **mksurfdata_map** - ``MOD_NETCDF`` -- sets the location of the NetCDF FORTRAN module. - ``USER_LINKER`` -- sets the name of the linker to use. @@ -38,11 +38,6 @@ Options used by: **interpinic**, **mkprocdata_map**, **mkmapgrids**, and **mksur - ``mkDepends`` -- figure out dependencies between source files, so make can compile in order.. - ``Makefile.common`` -- General tool Makefile that should be the same between all tools. -Options used only by **cprnc**: - -- ``EXEDIR`` -- sets the location where the executable will be built. -- ``VPATH`` -- colon delimited path list to find the source files. - More details on each environment variable. ``LIB_NETCDF`` @@ -81,7 +76,7 @@ More details on each environment variable. .. warning:: Note, that depending on the compiler answers may be different when SMP is activated. ``OPT`` - This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to ``FALSE`` for **mkmapgrids** and ``TRUE`` for **mksurfdata_map**, **mkprocdata_map** and **interpinic**. Turning this on should make the tool run much faster. + This variable flags if compiler optimization should be used when compiling the tool. It can be set to either ``TRUE`` or ``FALSE``, by default it is set to for both **mksurfdata_map** and **mkprocdata_map**. Turning this on should make the tool run much faster. .. warning:: Note, you should expect that answers will be different when ``OPT`` is activated. @@ -100,15 +95,20 @@ More details on each environment variable. ``mkDepends`` The ``mkDepends`` is the copy of the perl script used by the ``Makefile.common`` to figure out the dependencies between the source files so that it can compile in the necessary order. This file should be identical between the different tools. -``EXEDIR`` - The cprnc tool uses this variable to set the location of where the executable will be built. The default is the current directory. - -``VPATH`` - The **cprnc** tool uses this variable to set the colon delimited pathnames of where the source code exists. The default is the current directory. - -.. note:: There are several files that are copies of the original files from either models``/lnd/clm/src/util_share``, ``models/csm_share/shr``, or copies from other tool directories. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. +.. note:: There are several files that are copies of the original files. By having copies the tools can all be made stand-alone, but any changes to the originals will have to be put into the tool directories as well. The *README.filecopies* (which can be found in ``$CTSMROOT/tools``) is repeated here. .. include:: ../../clm5.0/tools/README.filecopies :literal: + +================================================================ + Building the CLM tools that use the CIME configure/build system +================================================================ + +**cprnc** and *gen_domain** both use the CIME configure/build system rather than the CLM specific version described above. + +See `CIME documentation on adding grids `_ for +more information on adding grids, creating mapping files, and running **gen_domain**. Also see the CIME file: +``$CTSMROOT/tools/mapping/gen_domain_files/INSTALL`` for how to build **gen_domain**. + diff --git a/doc/source/users_guide/using-clm-tools/cprnc.rst b/doc/source/users_guide/using-clm-tools/cprnc.rst index de90f7a88e..050e059296 100644 --- a/doc/source/users_guide/using-clm-tools/cprnc.rst +++ b/doc/source/users_guide/using-clm-tools/cprnc.rst @@ -6,8 +6,8 @@ Comparing History Files ========================= -**cprnc** is a tool shared by both CAM and CLM to compare two NetCDF history files. -It differences every field that has a time-axis that is also shared on both files, and reports a summary of the difference. +**cprnc** is a tool shared by |cesmrelease| to compare two NetCDF history files. +It differences every field that is shared on both files, and reports a summary of the difference. The summary includes the three largest differences, as well as the root mean square (RMS) difference. It also gives some summary information on the field as well. You have to enter at least one file, and up to two files. @@ -28,4 +28,3 @@ Options: See the **cprnc** `README `_ file for more details. -.. note:: To compare files with OUT a time axis you can use the **cprnc.ncl** NCL script in ``$CTSMROOT/tools/ncl_scripts``. It won't give you the details on the differences but will report if the files are identical or different. diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index d72427d3d5..c804a7bea7 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -6,8 +6,8 @@ Creating CLM domain files ***************************** -*gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. `Figure 2-4 `_ shows the general flow for a general global case (or for a regional grid that DOES include ocean). `Figure 2-5 `_ shows the use of **mknoocnmap.pl** (see `the Section called Using mknocnmap.pl to create grid and maps for single-point regional grids `_) to create a regional or single-point map file that is then run through **gen_domain** to create the domain file for it. As stated before `Figure 2-2 `_ is the legend for both of these figures. See `the -tools/mapping/gen_domain_files/README `_ file for more help on **gen_domain**. +*gen_domain* to create a domain file for datm from a mapping file. **gen_domain** is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. `Figure 2-4 `_ shows the general flow for a general global case (or for a regional grid that DOES include ocean). `Figure 2-5 `_ shows the use of **mknoocnmap.pl** (see `the Section called Using mknocnmap.pl to create grid and maps for single-point regional grids `_) to create a regional or single-point map file that is then run through **gen_domain** to create the domain file for it. As stated before `Figure 2-2 `_ is the legend for both of these figures. See `the +$CIMEROOT/tools/mapping/gen_domain_files/README `_ file for more help on **gen_domain**. Here we create domain files for a regular global domain. @@ -16,7 +16,7 @@ Figure 2-4. Global Domain file creation Insert figure 2-4 -Starting from SCRIP grid files for both your atmosphere and ocean, you use **tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see `Figure 2-5 `_. (See `Figure 2-2 `_ for the legend for this figure.) +Starting from SCRIP grid files for both your atmosphere and ocean, you use **$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see `Figure 2-5 `_. (See `Figure 2-2 `_ for the legend for this figure.) Note, that the SCRIP grid file used to start this process, is also used in **mkmapdata.sh** (see `the Section called Creating mapping files that mksurfdata_map will use `_). Next we create domain files for a single-point or regional domain. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index dcfcbbbdff..c044c283af 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -12,7 +12,7 @@ Creating input for surface dataset generation The utility ``mkmapdata.sh`` requires SCRIP format input files to describe the input and output grids that maps are generated for. CLM provides a utility, ``mkmapgrids`` that generates those files. The program converts old formats of CAM or CLM grid files to SCRIP grid format. There is also a NCL script (``mkscripgrid.ncl``) to create regular latitude longitude regional or single-point grids at the resolution the user desires. -SCRIP grid files for all the standard model resolutions and the raw surface datasets have already been done and the files are in the XML database. Hence, this step doesn't need to be done -- EXCEPT WHEN YOU ARE CREATING YOUR OWN GRIDS. If you have a CLM grid or CAM file from previous versions and you want to convert it you can use **mkmapgrids**. +SCRIP grid files for all the standard model resolutions and the raw surface datasets have already been done and the files are in the XML database. Hence, this step doesn't need to be done -- EXCEPT WHEN YOU ARE CREATING YOUR OWN GRIDS. Using mknocnmap.pl to create grid and maps for single-point regional grids -------------------------------------------------------------------------- @@ -47,11 +47,10 @@ See `Figure 2-5 `_ for a visual representation of this process. The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses **ESMF_RegridWeightGen** to create a list of maps from the raw datasets that are input to **mksurfdata_map**. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. -Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each DIFFERENT raw dataset. +Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each raw dataset that has a DIFFERENT grid or land-mask.. See `Figure 2-3 `_ for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs **ESMF_RegridWeightGen** for each one. You can then either enter the datasets into the XML database (see `Chapter 3 `_ or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to **mksurfdata_map** (see `the Section called Running mksurfdata.pl `_ below). -Use the "-phys" option to specify if you are creating mapping files for clm4_0 or |version| (the list of raw datafiles is somewhat different between the two). mkmapdata.sh has a help option with the following :: @@ -75,9 +74,6 @@ mkmapdata.sh has a help option with the following [-t|--gridtype ] Model output grid type supported values are [regional,global], (default is global) - [-p|--phys ] - Whether to generate mapping files for clm4_0 or |version| - supported values are [clm4_0,|version|], (default is |version|) [-b|--batch] Toggles batch mode usage. If you want to run in batch mode @@ -109,8 +105,6 @@ mkmapdata.sh has a help option with the following ********************** -.. warning:: Make sure you specify with the "-phys" option if you are creating files for CLM4.0! The default is |version|. - Figure 2-3. Details of running mkmapdata.sh ------------------------------------------- Insert figure 2-3 diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index f2cb8eed4d..c5a5644034 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -41,25 +41,7 @@ Creating a Complete Set of Files for Input to CLM Next use mksurfdata_map to create a surface dataset, using the mapping datasets created on the previous step as input. There is a version for either clm4_0 or |version| for this program. See the Section called Using mksurfdata_map to create surface datasets from grid datasets for more information on this. -5. Create some sort of initial condition dataset - - You then need to do one of the following three options to have an initial dataset to start from. - - a. Use spinup-procedures to create initial condition datasets - - The first option is to do the spinup procedures from arbitrary initial conditions to get good initial datasets. This is the most robust method to use. See the Section called Spinning up the Satellite Phenology Model (CLMSP spinup) in Chapter 4, the Section called Spinning up the CLM4.0 biogeochemistry Carbon-Nitrogen Model (CN spinup) in Chapter 4, or the Section called Spinning up the CLM4.0 Carbon-Nitrogen Dynamic Global Vegetation Model (CNDV spinup) in Chapter 4 for more information on this. - - b. Use interpinic to interpolate existing initial condition datasets - - The next option is to interpolate from spunup datasets at a different resolution, using interpinic. There is a version for either clm4_0 or |version| for this program. See the Section called Using interpinic to interpolate initial conditions to different resolutions for more information on this. - - c. Start up from arbitrary initial conditions - - The last alternative is to run from arbitrary initial conditions without using any spun-up datasets. This is inappropriate when using |version|-BGC or CLMCN (bgc=cn or cndv) as it takes a long time to spinup Carbon pools. - -.. warning:: This is NOT recommended as many fields in CLM take a long time to equilibrate. - -6. Enter the new datasets into the build-namelist XML database +5. Enter the new datasets into the build-namelist XML database The last optional thing to do is to enter the new datasets into the build-namelist XML database. See Chapter 3 for more information on doing this. This is optional because the user may enter these files into their namelists manually. The advantage of entering them into the database is so that they automatically come up when you create new cases. The ``$CTSMROOT/tools/README`` goes through the complete process for creating input files needed to run CLM. We repeat that file here: diff --git a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst index 3c67965e73..a8663176e1 100644 --- a/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst +++ b/doc/source/users_guide/using-clm-tools/what-are-the-clm-tools.rst @@ -8,35 +8,33 @@ There are several tools provided with CLM that allow you to create your own input datasets at resolutions you choose, or to interpolate initial conditions to a different resolution, or used to compare CLM history files between different cases. The tools are all available in the ``$CTSMROOT/tools`` directory. -Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``./ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. +Most of the tools are FORTRAN stand-alone programs in their own directory, but there is also a suite of NCL scripts in the ``$CTSMROOT/tools//ncl_scripts`` directory, and some of the tools are scripts that may also call the ESMF regridding program. Some of the NCL scripts are very specialized and not meant for general use, and we won't document them here. They still contain documentation in the script itself and the README file in the tools directory. -The tools are divided into three directories for three categories: clm4_0, |version|, and shared. -The first two are of course for tools that are designed to work with either the CLM4.0 or |version| versions of the model. -The last one are shared utilities that can be used by either, or have a "-phys" option so you can specify which version you want to use. +The tools produce files that can be used for CLM4.5 and |version|. They do **NOT** produce files that can be used for CLM4.0. +If you need files for CLM4.0, you'll need to use a previous version of CLM. The list of generally important scripts and programs are as follows. -1. *tools/cprnc* (relative to top level directory) to compare NetCDF files with a time axis. - -#. *./mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``./mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. +1. *./mkmapgrids* to create SCRIP grid data files from old CLM format grid files that can then be used to create new CLM datasets (deprecated). There is also a NCL script (``./mkmapgrids/mkscripgrid.ncl`` to create SCRIP grid files for regular latitude/longitude grids. #. *./mkmapdata* to create SCRIP mapping data file from SCRIP grid files (uses ESMF). -#. *./gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. - #. *mksurfdata_map* to create surface datasets from grid datasets (clm4_0 and |version| versions). #. *./mkprocdata_map* to interpolate output unstructured grids (such as the CAM HOMME dy-core "ne" grids like ne30np4) into a 2D regular lat/long grid format that can be plotted easily. Can be used by either clm4_0 or |version|. +#. *$CIMEROOT/tools/mapping/gen_domain_files/gen_domain* to create a domain file for datm from a mapping file. The domain file is then used by BOTH datm AND CLM to define the grid and land-mask. + +#. *$CIMEROOT/tools/cprnc* to compare two NetCDF files. + In the sections to come we will go into detailed description of how to use each of these tools in turn. First, however we will discuss the common environment variables and options that are used by all of the FORTRAN tools. Second, we go over the outline of the entire file creation process for all input files needed by CLM for a new resolution, then we turn to each tool. In the last section we will discuss how to customize files for particular observational sites. -The tools run either one of two ways, with a namelist to provide options, or with command line arguments (and NOT both). -**gen_domain** and **cprnc** run with command line arguments, and the other tools run with namelists. +The FORTRAN tools (mksurfdata_map and mkprocdata_map) run, with a namelist (mksurfdata_map) to provide options, or with command line arguments (mkprocdata_map). In the following sections, we will outline how to make these files available for build-namelist so that you can easily create simulations that include them. In the chapter on single-point and regional datasets we also give an alternative way to enter new datasets without having to edit files. @@ -45,15 +43,14 @@ In the chapter on single-point and regional datasets we also give an alternative Running FORTRAN tools with namelists ------------------------------------ -**mksurfdata_map** and **mkmapgrids** run with namelists that are read from standard input. +**mksurfdata_map** runs with a namelist that is read from standard input. Hence, you create a namelist and then run them by redirecting the namelist file into standard input as follows: :: ./program < namelist -For programs with namelists there is at least one sample namelist with the name "program".namelist (i.e. -``mksurfdata_map.namelist`` for the **mksurfdata_map** program). -There may also be other sample namelists that end in a different name besides "namelist". +There is a sample namelist called ``$CTSMROOT/tools/mksurfdata_map/mksurfdata_map.namleist`` that shows you what the +namelist should look like. **mksurfdata_map** also has a script that creates the namelist and runs the program for you. Namelists that you create should be similar to the example namelist. The namelist values are also documented along with the other namelists in the: :: @@ -66,7 +63,7 @@ The namelist values are also documented along with the other namelists in the: Running FORTRAN tools with command line options ----------------------------------------------- -**gen_domain**, and **cprnc** run with command line arguments. +**gen_domain**, mkprocdata_map, and **cprnc** run with command line arguments. The detailed sections below will give you more information on the command line arguments specific to each tool. Also running the tool without any arguments will give you a general synopsis on how to run the tool. @@ -77,7 +74,7 @@ Running FORTRAN tools built with SMP=TRUE When you enable ``SMP=TRUE`` on your build of one of the tools that make use of it, you are using OpenMP for shared memory parallelism (SMP). In SMP loops are run in parallel with different threads run on different processors all of which access the same memory (called on-node). Thus you can only usefully run up to the number of processors that are available on a single-node of the machine you are running on. -For example, on the NCAR machine cheyenne there are 16 processors per node, but the SMT hardware on the machine allows you to submit twice as many threads or 32 threads. +For example, on the NCAR machine cheyenne there are 36 processors per node, so you can use up to 36 processors. --------- From efb91653f886d26b947b3246ef293153f556a857 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 20 Jun 2018 20:06:11 -0600 Subject: [PATCH 198/730] Add a note about a subtle interaction This refers to https://github.com/ESCOMP/ctsm/issues/423 --- .../tech_note/Glacier/CLM50_Tech_Note_Glacier.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst index 9f6c79ff98..52313b9a5c 100644 --- a/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst +++ b/doc/source/tech_note/Glacier/CLM50_Tech_Note_Glacier.rst @@ -222,6 +222,16 @@ runaway sea ice growth in that region. | | | place | | +---------------+---------------+---------------+---------------+ +.. note:: + + In regions that have both the ``Glacial melt = Replaced by ice`` and the ``Ice runoff = + Melted`` behaviors (by default, this is just the region inside the standard CISM grid + but outside Greenland itself): During periods of glacial melt, a negative ice runoff is + generated (due to the ``Glacial melt = Replaced by ice`` behavior); this negative ice + runoff is converted to a negative liquid runoff plus a positive sensible heat flux (due + to the ``Ice runoff = Melted`` behavior). We recommend that you limit the portion of + the globe with both of these behaviors combined, in order to avoid having too large of + an impact of this non-physical behavior. .. _Multiple elevation class scheme: From ccc98566fb9463625cfe79d17df99d3cae3c644d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Jun 2018 23:11:43 -0600 Subject: [PATCH 199/730] Work on adding-new-resolutions chapter and exclude cime directories --- doc/source/conf.py | 5 +- doc/source/tech_note/conf.py | 4 +- ...w-Files-to-the-build-namelist-Database.rst | 6 +- .../CLM-3.1-Managing-Your-Own-Data-files.rst | 75 ------------------- .../CLM-3.2-Adding-Resolution-Names.rst | 17 +---- ...3-Adding-or-Changing-Default-Filenames.rst | 12 +-- .../adding-new-resolutions/index.rst | 1 - doc/source/users_guide/conf.py | 7 ++ 8 files changed, 20 insertions(+), 107 deletions(-) delete mode 100644 doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst diff --git a/doc/source/conf.py b/doc/source/conf.py index 9a112db91b..27c0df6e3c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -74,9 +74,8 @@ # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [ - "clm5.0/manage_externals", - "**/README_EXTERNALS.rst", - "clm5.0/README.rst" + "clm5.0", + "**/README_EXTERNALS.rst" ] # The name of the Pygments (syntax highlighting) style to use. diff --git a/doc/source/tech_note/conf.py b/doc/source/tech_note/conf.py index a1827c71c5..69d97bf9eb 100644 --- a/doc/source/tech_note/conf.py +++ b/doc/source/tech_note/conf.py @@ -74,9 +74,7 @@ # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [ - "manage_externals/*", - "README_EXTERNALS.rst", - "clm5.0//README.rs" + "clm5.0/*" ] # The name of the Pygments (syntax highlighting) style to use. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst index 76d8a7aef1..a828c37e98 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst @@ -16,11 +16,11 @@ If you have a LOT of files to keep track of it also might be easier than keeping If you just have a few quick experiments to try, for a short time period you might be best off using the other methods mentioned above. There are two parts to adding files to the build-namelist database. -The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_|version|.xml`` file (and in the ``$CTSMROOT/bld/config_files/config_definition.xml`` file when adding supported single-point datasets). +The first part is adding new resolution names which is done in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You can then use the new resolution by using ``CLM_USRDAT_NAME``. -If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``scripts/ccsm_utils/Case.template/config_grid.xml`` file. +If you also want to be able to give the resolution into **create_newcase** -- you'll need to add the grid to the ``$CIMEROOT/config/cesm/config_grid.xml`` file. -The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` file for CLM tools). +The second part is actually adding the new filenames which is done in the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` file (``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5_tools.xml`` file for CLM tools). If you aren't adding any new resolutions, and you are just changing the files for existing resolutions, you don't need to edit the namelist_definition file. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst deleted file mode 100644 index 41ccdde35b..0000000000 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.1-Managing-Your-Own-Data-files.rst +++ /dev/null @@ -1,75 +0,0 @@ -.. _managing-your-data-files: - -.. include:: ../substitutions.rst - -============================== - Managing Your Data Own Files -============================== - -If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. - -Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. - -``` -> cd scripts -# First make sure you have a inputdata location that you can write to -# You only need to do this step once, so you won't need to do this in the future -# (except to bring in any updated files in the original $CSMDATA location). -> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data -> ./link_dirtree $CSMDATA $MYCSMDATA -``` - -Then when you create a case you will change ``DIN_LOC_ROOT_CSMDATA`` to point to the location you linked to rather than the default location. - -``> ./xmlchange DIN_LOC_ROOT_CSMDATA=$MYCSMDATA`` - -In order to list the files that you have created you merely need to use the UNIX command find to find the files that are NOT softlinks. So for example executing the following command: - -``> find $MYCSMDATA -type f -print`` - -for me gives the following truncated list of CLM_USRDAT_NAME files that I have created. - -``` -/glade/p/work/erik/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-01.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-02.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-03.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-04.nc -``` - -You can also use **find** to list files that have a particular pattern in the name as well (using the -name option with wildcards). Also you can always rerun the **link_dirtree** command if any new files are added that you need to be linked into your directory tree. Since, the files are soft-links -- it doesn't take up much space other than the files that you add there. This way all of the files are kept in one place, they are organized by usage according to CESM standards, and you can easily find your own files, and CLM can find them as well. - - - -If you are running on a supported machine (such as cheyenne or hopper) the standard input datasets will already be available and you won't have to check them out of the subversion inputdata server. However, you also will NOT be able to add your own datafiles to these standard inputdata directories -- because most likely you won't have permissions to do so. In order to add files to the XML database or to use ``CLM_USRDAT_NAME`` you need to put data in the standard locations so that they can be found. The recommended way to do this is to use the **link_dirtree** tool in the CESM scripts. Some information on **link_dirtree** is available in the `|cesmrelease| Scripts User's Guide `_. We also have some examples of it's use here and in other sections of this User's Guide. - -Using **link_dirtree** is quite simple, you give the directory where data exists and then the directory that you want to create where datasets will point to the original source files. In the example below we use "$HOME/inputdata", but MYCSMDATA could be any directory you have access to where you want to put your data. - -``` -> cd scripts -# First make sure you have a inputdata location that you can write to -# You only need to do this step once, so you won't need to do this in the future -# (except to bring in any updated files in the original $CSMDATA location). -> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data -> ./link_dirtree $CSMDATA $MYCSMDATA -``` - -Then when you create a case you will change ``DIN_LOC_ROOT_CSMDATA`` to point to the location you linked to rather than the default location. - -``> ./xmlchange DIN_LOC_ROOT_CSMDATA=$MYCSMDATA`` - -In order to list the files that you have created you merely need to use the UNIX command find to find the files that are NOT softlinks. So for example executing the following command: - -``> find $MYCSMDATA -type f -print`` - -for me gives the following truncated list of CLM_USRDAT_NAME files that I have created. - -``` -/glade/p/work/erik/inputdata/lnd/clm2/pftdata/pft-physiology.c130503.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-01.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-02.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-03.nc -/glade/p/work/erik/inputdata/atm/datm7/CLM1PT_data/1x1pt_BE-Vie/1997-04.nc -``` - -You can also use **find** to list files that have a particular pattern in the name as well (using the -name option with wildcards). Also you can always rerun the **link_dirtree** command if any new files are added that you need to be linked into your directory tree. Since, the files are soft-links -- it doesn't take up much space other than the files that you add there. This way all of the files are kept in one place, they are organized by usage according to CESM standards, and you can easily find your own files, and CLM can find them as well. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst index aa8265e8a9..1bc7810021 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst @@ -7,7 +7,7 @@ ========================= If you are adding files for new resolutions which aren't covered in the namelist_definition file -- you'll need to add them in. -The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_|version|.xml`` file. +The list of valid resolutions is in the id="res" entry in the ``$CTSMROOT/bld/namelist_files/namelist_definition_clm4_5.xml`` file. You need to choose a name for your new resolution and simply add it to the comma delimited list of valid_values for the id="res" entry. The convention for global Gaussian grids is number_of_latitudes x number_of_longitudes. The convention for global finite volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude is measured in degrees. @@ -30,18 +30,3 @@ The only hard requirement is that names be unique for different grid files. Here As you can see you just add your new resolution names to the end of the valid_values list. - -When using PTCLM and adding supported single-point resolutions, you'll also want to add these resolutions to the ``$CTSMROOT/bld/config_files/config_definition.xml`` under the ``sitespf_pt`` name. -The entry in that file looks like: -:: - - - Flag to turn on site specific special configuration flags for supported single - point resolutions. See the specific config_defaults_*.xml file for the special - settings that are set for a particular site. - - -PTCLM assumes that any supported single-point resolutions are valid settings for ``sitespf_pt``. diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst index 52344bd5a0..cc360fba47 100644 --- a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst +++ b/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst @@ -6,22 +6,22 @@ Changing Default Filenames ============================ -To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|.xml`` and either change an existing filename or add a new one. +To add or change the default filenames you edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_clm4_5.xml`` and either change an existing filename or add a new one. Most entries in the default namelist files, include different attributes that describe the different properties that describe the differences in the datasets. Attributes include the: resolution, year to simulation, range of years to simulate for transient datafiles, the land-mask, the representative concentration pathway (rcp) for future scenarios, and the type of biogeochemistry (bgc) model used. -For example the fatmgrid for the 1.9x2.5 resolution is as follows: +For example the fsurdat for the 1.9x2.5 resolution is as follows: ``` - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_c130415.nc + +lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc ``` -Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (crop) attributes. +Other ``fsurdat`` files are distinguished from this one by their resolution (hgrid), simulation year (sim_year) and prognostic crop (use_crop) attributes. To add or change the default filenames for CLM tools edit the ``$CTSMROOT/bld/namelist_files/namelist_defaults_|version|_tools.xml`` and either change an existing filename or add a new one. -Editing this file is similar to the ``namelist_defaults_|version|.xml`` talked about above. +Editing this file is similar to the ``namelist_defaults_clm4_5.xml`` talked about above. ---------------------------- diff --git a/doc/source/users_guide/adding-new-resolutions/index.rst b/doc/source/users_guide/adding-new-resolutions/index.rst index fded236989..97d97b0cc0 100644 --- a/doc/source/users_guide/adding-new-resolutions/index.rst +++ b/doc/source/users_guide/adding-new-resolutions/index.rst @@ -15,6 +15,5 @@ Adding New Resolutions :maxdepth: 2 CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst - CLM-3.1-Managing-Your-Own-Data-files.rst CLM-3.2-Adding-Resolution-Names.rst CLM-3.3-Adding-or-Changing-Default-Filenames.rst diff --git a/doc/source/users_guide/conf.py b/doc/source/users_guide/conf.py index b8e187efd5..687732893a 100644 --- a/doc/source/users_guide/conf.py +++ b/doc/source/users_guide/conf.py @@ -78,6 +78,13 @@ # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [ "clm5.0/manage_externals", + "clm5.0/components", + "clm5.0/cime/scripts", + "clm5.0/cime/doc", + "clm5.0/cime/config", + "clm5.0/cime/tools/statistical_ensemble_test", + "clm5.0/cime/src", + "clm5.0/cime/utils", "**/README_EXTERNALS.rst", "clm5.0/README.rst" ] From 1013e1c7451d0503102b651d9f6a7f971756934d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Jun 2018 16:12:37 -0600 Subject: [PATCH 200/730] Update special cases chapter --- ...CLM5.0-biogeochemistry-(CLMBGC-spinup).rst | 34 +++---- ...tmospheric-forcing-to-spinup-the-model.rst | 10 +- ...tmospheric-forcing-to-spinup-the-model.rst | 26 +++-- ...transient-historical-CO2-concentration.rst | 97 +------------------ .../running-the-prognostic-crop-model.rst | 13 +-- .../running-with-irrigation.rst | 17 ++-- 6 files changed, 47 insertions(+), 150 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst index 99fa3fdd47..0bbeda8e41 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst @@ -1,15 +1,15 @@ -.. _spinning-up-clm45-bgc: +.. _spinning-up-clm50-bgc: .. include:: ../substitutions.rst -===================== - Spinup of CLM5.0-BGC -===================== +========================== + Spinup of CLM5.0-BGC-Crop +========================== To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). -**1. 45_AD_SPINUP** +**1. 50_AD_SPINUP** For the first step of running 1000+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: Example:: AD_SPINUP Simulation for |version|-BGC @@ -17,23 +17,19 @@ Example:: AD_SPINUP Simulation for |version|-BGC :: > cd scripts - > ./create_newcase -case BGC_spinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -mach cheyenne_intel + > ./create_newcase -case BGC_spinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd BGC_spinup - # Append "-spinup on" to CLM_BLDNML_OPTS - > ./xmlchange CLM_BLDNML_OPTS="-bgc_spinup on" -append - # The following sets CLM_FORCE_COLDSTART to "on", and run-type to startup (you could also use an editor) - > ./xmlchange CLM_FORCE_COLDSTART=on,RUN_TYPE=startup - # Make the output history files only annual, by adding the following to the user_nl_clm namelist - > echo 'hist_nhtfrq = -8760' >> user_nl_clm + # Change accelerated spinup mode + > ./xmlchange CLM_ACCELERATED_SPINUP="on" # Now setup - > ./cesm_setup -case + > ./case.setup -case # Now build - > ./BGC_spinup.build + > ./case.build # The following sets RESUBMIT to 30 times in env_run.xml (you could also use an editor) # The following sets STOP_DATE,STOP_N and STOP_OPTION to Jan/1/1001, 20, "nyears" in env_run.xml (you could also use an editor) > ./xmlchange RESUBMIT=20,STOP_N=50,STOP_OPTION=nyears,STOP_DATE=10010101 # Now run normally - > ./BGC_spinup.submit + > ./case.submit .. note:: This same procedure works for |version|-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. @@ -47,7 +43,7 @@ Example: Final CLMBGC Spinup Simulation for |version|-BGC :: > cd scripts - > ./create_newcase -case BGC_finalspinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru -mach cheyenne_intel + > ./create_newcase -case BGC_finalspinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd BGC_finalspinup # Now, Copy the last CLM restart file from the earlier case into your run directory > cp /ptmp/$LOGIN/archive/BGC_spinup/rest/BGC_spinup.clm*.r*.1002-01-01-00000.nc \ @@ -60,14 +56,14 @@ Example: Final CLMBGC Spinup Simulation for |version|-BGC # Set the finidat file to the last restart file saved in previous step > echo ' finidat = "BGC_spinup.clm2.r.1002-01-01-00000.nc"' > user_nl_clm # Now setup - > ./cesm_setup + > ./case.setup > Now build - > ./BGC_finalspinup.build + > ./case.build # The following sets RESUBMIT to 4 times in env_run.xml (you could also use an editor) # The following sets STOP_N and STOP_OPTION to 50 and "nyears" in env_run.xml (you could also use an editor) > ./xmlchange RESUBMIT=4,STOP_OPTION=nyears,STOP_N=50 > Now run as normal - > ./BGC_finalspinup.submit + > ./case.submit To assess if the model is spunup plot trends of CLMBGC variables of interest. If you see a trend, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index deb5fa1238..12903a18b5 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -17,17 +17,15 @@ Example: Simulation with MOAR Data on cheyenne :: > cd scripts - > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup -mach cheyenne_intel + > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup > cd MOARforce1850 # The following sets the casename to point to for atm forcing (you could also use an editor) > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a # The following sets the align year and years to run over for atm forcing # (you could also use an editor) > ./xmlchange DATM_CPL_YR_ALIGN=1,DATM_CPL_YR_START=960,DATM_CPL_YR_END=1030 - > ./cesm_setup + > ./case.setup # Now build and run as normal - > ./MOARforce1850.build - > ./MOARforce1850.submit + > ./case.build + > ./case.submit - -.. warning: Because of bug 1339 (see the `$CTSMROOT/doc/KnownBugs `_ file on this) you can't run with 83 or more years of forcing. If you do need to run with more years of forcing, you'll need to address the issue as outlined in the `$CTSMROOT/doc/KnownBugs `_ file. diff --git a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index 0999f7b366..34bb12ab49 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -16,9 +16,9 @@ Example: Fully Coupled Simulation to Create Data to Force Next Example Simulatio :: > cd scripts - > ./create_newcase -case myBCN1850 -res f09_g17_gl4 -compset B1850CN -mach cheyenne_intel - > cd myBCN1850 - > ./cesm_setup + > ./create_newcase -case myB1850 -res f09_g17_gl4 -compset B1850 + > cd myB1850 + > ./case.setup # Set histaux_a2x3hr to .true. in your user_nl_cpl output from the atmosphere model # will be saved 3 hourly echo "histaux_a2x3hr=.true." >> user_nl_cpl @@ -26,7 +26,7 @@ Example: Fully Coupled Simulation to Create Data to Force Next Example Simulatio > cp ../../models/drv/driver/ccsm_comp_mod.F90 SourceMods/src.cpl > $EDITOR SourceMods/src.cpl # Now build - > ./myBCN1850.build + > ./case.build # The following sets the archival disk space (you could also use an editor) > ./xmlchange DOUT_S_ROOT='/glade/home/$USER/$CASE' # Make sure files are archived to disk, but NOT to long term storage @@ -35,21 +35,19 @@ Example: Fully Coupled Simulation to Create Data to Force Next Example Simulatio # Set the run length to run a total of 20 years (you could also use an editor) > ./xmlchange RESUBMIT=9,STOP_OPTION=nyears,STOP_N=2 # Now run as normal - > ./myBCN1850.submit + > ./case.submit -.. warning:: Because of bug 1733 (see the `$CTSMROOT/doc/KnownBugs `_ file on this) you'll need to edit the driver code in order for it to produce the correct list of fields needed to run the model later. - -Now we run an I compset forced with the data from the previous simulation using the ``CPLHIST3HrWx`` option to DATM_MODE. See `the Section called CPLHIST3HrWx mode and it's DATM settings in Chapter 1 `_ for more information on the DATM settings for ``CPLHIST3HrWx`` mode. +Now we run an I compset forced with the data from the previous simulation using the CPLHISTForcing`` option to DATM_MODE. See `the Section called CPLHISTForcing mode and it's DATM settings in Chapter 1 `_ for more information on the DATM settings for ``CPLHISTForcing`` mode. Example: Simulation Forced with Data from the Previous Simulation ------------------------------------------------------------------------------ :: > cd scripts - > ./create_newcase -case frcwmyBCN1850 -res f09_g17_gl4 -compset I1850Clm50BgcSpinup -mach cheyenne_intel - > cd frcWmyBCN1850 + > ./create_newcase -case frcwmyB1850 -res f09_g17_gl4 -compset I1850Clm50BgcSpinup + > cd frcWmyB1850 # The following sets the casename to point to for atm forcing (you could also use an editor) - > ./xmlchange DATM_CPLHIST_CASE="myBCN1850" + > ./xmlchange DATM_CPLHIST_CASE="myB1850" # The following sets the align year and years to run over for atm forcing # (you could also use an editor) > ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20 @@ -57,10 +55,10 @@ Example: Simulation Forced with Data from the Previous Simulation # file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850Clm50BgcSpinup COMPSET CASES MADE AFTER THIS! > $EDITOR ../../models/atm/datm/bld/namelist_files/namelist_defaults_datm.xml - > ./cesm_setup + > ./case.setup # Now build and run as normal - > ./frcwmyBCN1850.build - > ./frcwmyBCN1850.submit + > ./case.build + > ./case.submit .. note:: We did this by editing the "namelist_defaults_datm.xml" which will change the settings for ALL future ``I1850Clm50BgcSpinup`` cases you run. You could also do this by editing the path in the resulting streams text files in the CaseDocs directory, and then create a "user\_" streams file with the correct path. This would change the streams file JUST for this case. The steps do it this way are: diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst index b7d063a2a2..9883662a4b 100644 --- a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst +++ b/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst @@ -37,104 +37,17 @@ Example: Transient Simulation with Historical CO2 :: > cd scripts - > ./create_newcase -case DATM_CO2_TSERIES -res f19_g17_gl4 -compset I20TRCRUCLM45BGC + > ./create_newcase -case DATM_CO2_TSERIES -res f19_g17_gl4 -compset IHistClm50BgcCrop > cd DATM_CO2_TSERIES - # Set CCSM_BGC to CO2A so that CO2 will be passed from atmosphere to land - # Set CLM_CO2_TYPE to diagnostic so that the land will use the value sent from the atmosphere - > ./xmlchange CCSM_BGC=CO2A,CLM_CO2_TYPE=diagnostic + # Historical CO2 will already be setup correctly for this compset + # to check that look at the variables: CCSM_BGC,CLM_CO2_TYPE, and DATM_CO2_TSERIES + > ./xmlquery CCSM_BGC,CLM_CO2_TYPE,DATM_CO2_TSERIES + # Expect: CCSM_BGC=CO2A,CLM_CO2_TYPE=diagnostic,DATM_CO2_TSERIES=20tr > ./case.setup - # Create the streams file for CO2 - > cat << EOF >> datm.streams.txt.co2tseries - - - - This is a streams file to pass historical CO2 from datm8 to the other - surface models. It reads in a historical dataset derived from data used - by CAM. The getco2_historical.ncl script in $CTSMROOT2/tools/ncl_scripts - was used to convert the CAM file to a streams compatible format (adding domain - information and making CO2 have latitude/longitude even if only for a single - point. - - - - Input stream description file for historical CO2 reconstruction data - - 04 March 2010: Converted to form that can be used by datm8 by Erik Kluzek - 18 December 2009: Prepared by B. Eaton using data provided by - Jean-Francois Lamarque. All variables except f11 are directly from - PRE2005_MIDYR_CONC.DAT. Data from 1765 to 2007 with 2006/2007 just - a repeat of 2005. - - - CLMNCEP - - - - time time - lonc lon - latc lat - area area - mask mask - - - $CSMDATA/atm/datm7/CO2 - - - fco2_datm_1765-2007_c100614.nc - - - - - CO2 co2diag - - - $CSMDATA/atm/datm7/CO2 - - - fco2_datm_1765-2007_c100614.nc - - - - - - EOF - - # And copy it to the run directory - > cp datm.streams.txt.co2tseries $RUNDIR - # Run preview namelist so we have the namelist in CaseDocs > ./preview_namelists -The first thing we will do is to edit the ``user_nl_datm`` file to add a CO2 file stream in. -To do this we will copy a ``user_nl_datm`` in with the changes needed. The file ``addco2_user_nl_datm.user_nl`` is in ``$CTSMROOT/doc/UsersGuide`` and looks like this... -:: - - dtlimit = 1.5,1.5,1.5,1.5,1.5 - fillalgo = 'nn','nn','nn','nn','nn' - fillmask = 'nomask','nomask','nomask','nomask','nomask' - mapalgo = 'bilinear','bilinear','bilinear','bilinear','nn' - mapmask = 'nomask','nomask','nomask','nomask',nomask' - streams = "datm.streams.txt.CLM_QIAN.Solar 1895 1948 1972 ", "datm.streams.txt.CLM_QIAN.Precip 1895 1948 1972 ", - "datm.streams.txt.CLM_QIAN.TPQW 1895 1948 1972 ", "datm.streams.txt.presaero.trans_1850-2000 1849 1849 2006", - "datm.streams.txt.co2tseries 1766 1766 2005 " - taxmode = 'cycle','cycle','cycle','cycle','extend' - tintalgo = 'coszen','nearest','linear','linear','linear' - -You just copy this into your case directory. But, also compare it to the version in ``CaseDocs`` to make sure the changes are just to add in the new CO2 stream. Check to see that filenames, and start, end and align years are correct. -:: - - > cp ../../$CTSMROOT/doc/UsersGuide/addco2_user_nl_datm.user_nl user_nl_datm - > diff user_nl_datm CaseDocs/datm_atm_in - Once, you've done that you can build and run your case normally. -.. warning:: This procedure assumes you are using a ``I20TRCRUCLM45BGC`` compset out of the box, with ``DATM_PRESAERO`` equal to trans_1850-2000. So it assumes standard |version| CRUNCEP atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes anything here your ``user_nl_datm`` file will need to be adjusted to work with it. - -.. note:: The intent of the ``user_nl_datm`` is to add an extra streams file for CO2 to the end of the streams variable, and other arrays associated with streams (adding mapalgo as a new array with bilinear for everything, but the CO2 file which should be "nn" for nearest neighbor). Other variables should be the same as the other stream values. - -.. warning:: The streams file above is hard-coded for the path of the file on NCAR computers. To use it on an outside machine you'll need to edit the filepath in the streams file to point to the location where you have the file. - -After going through these steps, you will have a case where you have datm reading in an extra streams text file that points to a data file with CO2 data on it that will send that data to the CLM. - diff --git a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst index 308c749adc..20ea12e91f 100644 --- a/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst +++ b/doc/source/users_guide/running-special-cases/running-the-prognostic-crop-model.rst @@ -6,9 +6,10 @@ Running the prognostic crop model =================================== -The prognostic crop model is setup to work with |version|-BGC or CLM4.0-CN (with or without DV) for present day conditions and we have surface and initial condition datasets at f19 resolution. +The prognostic crop model is setup to work with CLM4.0, CLM4.5 or |version| with either BGC or CN (with or without DV). In order to use the initial condition file, we need to set the ``RUN_TYPE`` to startup rather than ``hybrid`` since the compset for f19 sets up to use an initial condition file without crop active. -To activate the crop model you can choose a compset that has "CROP" in the name such as "ICRUCLM45BGCCROP" or simply add "-crop on" to ``CLM_CONFIG_OPTS``. +To activate the crop model you can choose a compset that has "Crop" in the name such as "I1850Clm50BgcCropCru" or simply add +"-crop" to ``CLM_BLDNML_OPTS`` (or for CLM4.0 add "-crop on" to ``CLM_CONFIG_OPTS``). Example: Crop Simulation ------------------------------------ @@ -18,14 +19,6 @@ Example: Crop Simulation > ./create_newcase -case CROP -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd CROP - # Append "-crop on" to CLM_CONFIG_OPTS in env_build.xml (you could also use an editor) - > ./xmlchange CLM_CONFIG_OPTS="-crop on" -append - - # Change to startup type so uses spunup initial conditions file for crop if it exists - # By default the model will do a hybrid startup with an initial condition file - # incompatible with the crop surface dataset. - - > ./xmlchange RUN_TYPE=startup > ./case.setup # Now build and run normally diff --git a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst index 3a7b0e3ccf..aa99179971 100644 --- a/doc/source/users_guide/running-special-cases/running-with-irrigation.rst +++ b/doc/source/users_guide/running-special-cases/running-with-irrigation.rst @@ -6,9 +6,12 @@ Running with irrigation =================================== -In |version| irrigation can ONLY be used WITH crop. +In CLM4.0 irrigation isn't an allowed option. +In CLM4.5 irrigation can ONLY be used WITH crop. With CLM5.0 irrigation can be used whether crop is on or not -- **BUT** +if crop is off, your surface datasets **HAVE** to have irrigation defined appropriately. Right now *ALL* surface +datasets without crop enabled have irrigation hard-wired on. In order to create datasets with irrigation off, you'd need +to make changes to ``mksurfdata_map`` in order to have all generic crops to be non-irrigated. To turn on irrigation in |version| we simply add "-irrig on" to ``CLM_BLDNML_OPTS``. -Just as in the crop example we also change ``RUN_TYPE`` to ``startup`` so that we don't use an initial condition file that is incompatible with irrigation. Example: Irrigation Simulation ------------------------------------------ @@ -16,16 +19,12 @@ Example: Irrigation Simulation # Note here we do a CLMSP simulation as that is what has been validated > cd scripts - > ./create_newcase -case IRRIG -res f19_g17_gl4 -compset I + > ./create_newcase -case IRRIG -res f19_g17_gl4 -compset I1850Clm50BgcCrop > cd IRRIG - # Append "-irrig" to CLM_BLDNML_OPTS in env_run.xml (you could also use an editor) - > ./xmlchange CLM_BLDNML_OPTS="-irrig" -append + # Append "-irrig on" to CLM_BLDNML_OPTS in env_run.xml (you could also use an editor) + > ./xmlchange CLM_BLDNML_OPTS="-irrig on" -append - # Change to startup type so uses spunup initial conditions file for irrigation if it exists - # By default the model will do a hybrid startup with an initial condition file - # incompatible with the irrigation surface dataset. - > ./xmlchange RUN_TYPE=startup > ./case.setup # Now build and run normally From 12905cdce7746c96f85d868e0151a2c20ff446e0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Jun 2018 14:24:02 -0600 Subject: [PATCH 201/730] Pass over the running-single-points chapter --- .../running-pts_mode-configurations.rst | 5 +--- .../running-single-point-configurations.rst | 29 +++++++------------ ...point-and-regional-grid-configurations.rst | 10 +++---- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index c7a1ed0def..a75f18b977 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -21,8 +21,6 @@ To setup a ``PTS_MODE`` simulation you use the "-pts_lat" and "-pts_lon" argumen Then setup, build and run as normal. We make sure initial conditions are NOT used since ``PTS_MODE`` currently CAN NOT run with initial conditions. -.. note:: By default it sets up to run with MPILIB=mpi-serial (in the env_build.xml file) turned on, which allows you to run the model interactively. On some machines this mode is NOT supported and you may need to change it to FALSE before you are able to build. - .. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. See bugs "1017 and 1025" in the `$CTSMROOT/doc/KnownLimitationss `_ file. .. note:: You can change the point you are simulating for at run-time by changing the values of ``PTS_LAT`` and ``PTS_LON`` in the ``env_run.xml`` file. @@ -37,6 +35,5 @@ You might also want to set the ``env_build.xml`` variable: ``MPILIB=mpi-serial`` On many machines, batch queues have a minimum number of nodes or processors that can be used. On these machines you may have to change the queue and possibly the time-limits of the job, to get it to run in the batch queue. -On the NCAR machine, cheyenne, this is done for you automatically, and the "caldera" queue is used for such single-processor simulations. -Another way to get around this problem is to run the job interactively using ``MPILIB=mpi-serial`` so that you don't submit the job to the batch queue. +On the NCAR machine, cheyenne, this is done for you automatically, and the "share" or "caldera" queue is used for such single-processor simulations. For single point mode you also may want to consider using a smaller workstation or cluster, rather than a super-computer, because you can't take advantage of the multi-processing power of the super-computer anyway. diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 6a2dc4e44d..02a7345e79 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -34,13 +34,13 @@ The resolution names that have an underscore in them ("_") are all single-point To run for the Brazil test site do the following: -Example: Running CLM over a single-point test site in Brazil with the default Qian atmosphere data forcing. --------------------------------------------------------------------------------------------------------------------------- +Example: Running CLM over a single-point test site in Brazil +------------------------------------------------------------ :: > cd scripts > set SITE=1x1_brazil - > ./create_newcase -case testSPDATASET -res $SITE -compset I + > ./create_newcase -case testSPDATASET -res $SITE -compset I2000Clm50SpGs > cd testSPDATASET Then setup, build and run normally. @@ -54,11 +54,8 @@ Example: Running CLM over the single-point of Mexicocity Mexico with the default > cd scripts # Set a variable to the site you want to use (as it's used several times below) > set SITE=1x1_mexicocityMEX - > ./create_newcase -case testSPDATASET -res $SITE -compset I + > ./create_newcase -case testSPDATASET -res $SITE -compset I1PtClm50SpGs > cd testSPDATASET - # Set DATM prescribed aerosols to single-point dataset - # Will then use the dataset with just the point for this $SITE - > ./xmlchange DATM_PRESAERO=pt1_pt1 Then setup, build and run normally. @@ -72,9 +69,9 @@ Using Supported Single-point Datasets that have their own Atmospheric Forcing ================================================================================ Of the supported single-point datasets we have three that also have atmospheric forcing data that go with them: Mexico City (Mexico), Vancouver, (Canada, British Columbia), and ``urbanc_alpha`` (test data for an Urban inter-comparison project). -Mexico city and Vancouver also have "#ifdef" in the source code for them to work with modified urban data parameters that are particular to these locations. -They can be turned on by using the ``CLM_CONFIG_OPTS env_build.xml`` variable to set the "-sitespf_pt" option in the CLM **configure**. +Mexico city and Vancouver also have namelist options in the source code for them to work with modified urban data parameters that are particular to these locations. To turn on the atmospheric forcing for these datasets, you set the ``env_run.xml DATM_MODE`` variable to ``CLM1PT``, and then the atmospheric forcing datasets will be used for the point picked. +If you use one of the compsets that has "I1Pt" in the name that will be set automatically. When running with datasets that have their own atmospheric forcing you need to be careful to run over the period that data is available. If you have at least one year of forcing it will cycle over the available data over and over again no matter how long of a simulation you run. @@ -94,12 +91,9 @@ Example: Running CLM over the single-point of Vancouver Canada with supplied atm > set SITE=1x1_vancouverCAN # Create a case at the single-point resolutions with their forcing - > ./create_newcase -case testSPDATASETnAtmForcing -res $SITE -compset I1PTCLM45 + > ./create_newcase -case testSPDATASETnAtmForcing -res $SITE -compset I1PtClm50SpGs > cd testSPDATASETnAtmForcing - # Set namelist options for urban test site - > ./xmlchange CLM_NML_USE_CASE=stdurbpt_pd - # Figure out the start and end date for this dataset # You can do this by examining the datafile. > set STOP_N=330 @@ -116,13 +110,10 @@ Example: Running CLM over the single-point of Vancouver Canada with supplied atm hist_nhtfrq = -1,1,1 EOF - # Set DATM prescribed aerosols to single-point dataset - # Will then use the dataset with just the point for this site - > ./xmlchange DATM_PRESAERO=pt1_pt1 > ./case.setup -.. warning:: If you don't set the start-year and run-length carefully as shown above the model will abort with a "dtlimit error" in the atmosphere model (see bug 1110 in the `$CTSMROOT/doc/KnownLimitationss `_ file for documentation on this). Since, the forcing data for this site (and the MexicoCity site) is less than a year, the model won't be able to run for a full year. The ``1x1_urbanc_alpha`` site has data for more than a full year, but neither year is complete hence, it has the same problem (see the problem for this site above). +.. warning:: If you don't set the start-year and run-length carefully as shown above the model will abort with a "dtlimit error" in the atmosphere model. Since, the forcing data for this site (and the MexicoCity site) is less than a year, the model won't be able to run for a full year. The ``1x1_urbanc_alpha`` site has data for more than a full year, but neither year is complete hence, it has the same problem (see the problem for this site above). .. note:: Just like ``PTS_MODE`` above, By default it sets up to run with ``MPILIB=mpi-serial`` (in the env_build.xml file) turned on, which allows you to run the model interactively. @@ -140,7 +131,7 @@ Example: Using CLM_USRDAT_NAME to run a simulation using user datasets for a spe :: > cd scripts - > ./create_newcase -case my_userdataset_test -res CLM_USRDAT -compset ICRUCLM45 + > ./create_newcase -case my_userdataset_test -res CLM_USRDAT -compset I2000Clm50BgcCruGs > cd my_userdataset_test/ > set GRIDNAME=13x12pt_f19_alaskaUSA > set LMASK=gx1v6 @@ -204,7 +195,7 @@ Example: Setting up a case from the single-point surface dataset just created > ./link_dirtree $CSMDATA $MYCSMDATA # Copy the file you created above to your new $MYCSMDATA location following the CLMUSRDAT # naming convention (leave off the creation date) - > cp $CESMROOT/$CTSMROOT/tools/|version|/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ + > cp $CESMROOT/$CTSMROOT/tools/mksurfdata_map/surfdata_${GRIDNAME}_simyr1850_$CDATE.nc \ $MYCSMDATA/lnd/clm2/surfdata_map/surfdata_${GRIDNAME}_simyr1850.nc > cd $CESMROOT/scripts > ./create_newcase -case my_usernldatasets_test -res CLM_USRDAT -compset I1850Clm50BgcCropCru \ diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index 41f55e38f1..9564b1649c 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -17,10 +17,10 @@ There are three different ways to do this for normal-supported site ``CLM_USRDAT_NAME`` runs using your own datasets (single-point or regional). -``PTCLM`` +``PTCLMmkdata`` easily setup simulations to run for tower sites.. -.. note:: ``PTS_MODE`` and ``PTCLM`` only works for a single point, while the other two options can also work for regional datasets as well. +.. note:: ``PTS_MODE`` and ``PTCLMmkdata`` only works for a single point, while the other two options can also work for regional datasets as well. .. _options-for-single-points: @@ -42,12 +42,12 @@ With this method you don't have to change DATM or add files to the XML database However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. -Lastly *PTCLM* is a great way to easily create datasets, setup simulations and run simulations for tower sites. +Lastly *PTCLMmkdata* is a great way to easily create datasets, setup simulations and run simulations for tower sites. It takes advantage of both normal supported site functionality and CLM_USRDAT_NAME internally. -A big advantage to it, is that it's one-stop shopping, it runs tools to create datasets, and runs **create_newcase** and sets the appropriate env variables for you. So you only have to learn how to run one tool, rather than work with many different ones. PTCLM is described in the next chapter `Chapter 6 `_. +A big advantage to it, is that it's one-stop shopping, it runs tools to create datasets, and runs **create_newcase** and sets the appropriate env variables for you. So you only have to learn how to run one tool, rather than work with many different ones. PTCLMmkdata is described in the next chapter `Chapter 6 `_. Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in `the Section called Running with your own atmosphere forcing `_. You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. You may also need to modify DATM to use your forcing data. -And you'll need to change your forcing data to be in a format that DATM can use. In the PTCLM chapter `the Section called Converting AmeriFlux Data for use by PTCLM in Chapter 6 `_ section tells you how to use AmeriFlux data for atmospheric forcing. +And you'll need to change your forcing data to be in a format that DATM can use. In the PTCLMmkdata chapter `the Section called Converting AmeriFlux Data for use by PTCLMmkdata in Chapter 6 `_ section tells you how to use AmeriFlux data for atmospheric forcing. From 6f4998024b845263d0910791b334bc74b596bdfe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Jun 2018 15:11:17 -0600 Subject: [PATCH 202/730] Remove pointing to KnownLimitations file, correct some grammar and remove mention of linkdirtree that is now gone --- .../running-pts_mode-configurations.rst | 8 ++++---- .../running-single-point-configurations.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst index a75f18b977..b5ce4eadb7 100644 --- a/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-pts_mode-configurations.rst @@ -21,13 +21,13 @@ To setup a ``PTS_MODE`` simulation you use the "-pts_lat" and "-pts_lon" argumen Then setup, build and run as normal. We make sure initial conditions are NOT used since ``PTS_MODE`` currently CAN NOT run with initial conditions. -.. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. See bugs "1017 and 1025" in the `$CTSMROOT/doc/KnownLimitationss `_ file. +.. warning:: ``PTS_MODE`` currently does NOT restart nor is it able to startup from global initial condition files. This is a known issue we are unlikely to fix. .. note:: You can change the point you are simulating for at run-time by changing the values of ``PTS_LAT`` and ``PTS_LON`` in the ``env_run.xml`` file. -================================== - Running on in a single processor -================================== +============================== + Running in a single processor +============================== Note, that when running with ``PTS_MODE`` the number of processors is automatically set to one. When running a single grid point you can only use a single processor. diff --git a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst index 02a7345e79..fd71d44de5 100644 --- a/doc/source/users_guide/running-single-points/running-single-point-configurations.rst +++ b/doc/source/users_guide/running-single-points/running-single-point-configurations.rst @@ -208,4 +208,4 @@ Example: Setting up a case from the single-point surface dataset just created > ./xmlchange CLM_USRDAT_NAME=$GRIDNAME > ./case.setup -.. note:: With this and previous versions of the model we recommended using ``CLM_USRDAT_NAME`` as a way to identify your own datasets without having to enter them into the XML database. This has two down-sides. First you can't include creation dates in your filenames, which means you can't keep track of different versions by date. It also means you HAVE to rename the files after you created them with **mksurfdata.pl**. And secondly, you have to use **linkdirtree** in order to place the files in a location outside of the usual ``DIN_LOC_ROOT`` (assuming you don't have write access to adding new files to the standard location on the machine you are using). Now, since ``user_nl`` files are supported for ALL model components, and the same domain files are read by both CLM and DATM and set using the envxml variables: ``ATM_DOMAIN_PATH``, ``ATM_DOMAIN_FILE``, ``LND_DOMAIN_PATH``, and ``LND_DOMAIN_FILE`` -- you can use this mechanism (``user_nl_clm`` and ``user_nl_datm`` and those envxml variables) to point to your datasets in any location. In the future we will deprecate ``CLM_USRDAT_NAME`` and recommend ``user_nl_clm`` and ``user_nl_datm`` and the ``DOMAIN`` envxml variables. +.. note:: With this and previous versions of the model we recommended using ``CLM_USRDAT_NAME`` as a way to identify your own datasets without having to enter them into the XML database. This has the down-side that you can't include creation dates in your filenames, which means you can't keep track of different versions by date. It also means you HAVE to rename the files after you created them with **mksurfdata.pl**. Now, since ``user_nl`` files are supported for ALL model components, and the same domain files are read by both CLM and DATM and set using the envxml variables: ``ATM_DOMAIN_PATH``, ``ATM_DOMAIN_FILE``, ``LND_DOMAIN_PATH``, and ``LND_DOMAIN_FILE`` -- you can use this mechanism (``user_nl_clm`` and ``user_nl_datm`` and those envxml variables) to point to your datasets in any location. In the future we will deprecate ``CLM_USRDAT_NAME`` and recommend ``user_nl_clm`` and ``user_nl_datm`` and the ``DOMAIN`` envxml variables. From a956812b6e4417d4cd63da739368cea62a554fc2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Jun 2018 14:28:55 -0600 Subject: [PATCH 203/730] Work on PTCLMmkdata chapter --- .../running-PTCLM/adding-ptclm-site-data.rst | 44 +++-- .../running-PTCLM/introduction-to-ptclm.rst | 71 ++++---- .../running-PTCLM/ptclm-examples.rst | 63 ++----- .../users_guide/running-PTCLM/using-ptclm.rst | 168 +++++------------- 4 files changed, 108 insertions(+), 238 deletions(-) diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst index 425e6d9c25..b643e79a28 100644 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst @@ -2,13 +2,13 @@ .. include:: ../substitutions.rst -====================== -Adding PTCLM Site Data -====================== +============================ +Adding PTCLMmkdata Site Data +============================ -The "sitegroupname" option to PTCLM1.110726 looks for groups of sites in the files in the ``PTCLM_sitedata`` directory under the PTCLM directory. +The "sitegroupname" option to PTCLMmkdata looks for groups of sites in the files in the ``PTCLM_sitedata`` directory under the PTCLMmkdata directory. You can add new names available for this option including your own lists of sites, by adding more files in this directory. -There are three files for each "sitegroupname": ``$SITEGROUP_sitedata.txt``, ``$SITEGROUP_soildata.txt`` and ``$SITEGROUP_pftdata.txt`` (where ``$SITEGROUP`` is the name that would be entered as "sitegroupname" to PTCLM). +There are three files for each "sitegroupname": ``$SITEGROUP_sitedata.txt``, ``$SITEGROUP_soildata.txt`` and ``$SITEGROUP_pftdata.txt`` (where ``$SITEGROUP`` is the name that would be entered as "sitegroupname" to PTCLMmkdata). Each file needs to have the same list of sites, but gives different information: site data, PFT data, and soil data respectively. Although the site codes need to be the same between the three files, the files do NOT have to be in the same order. Each file has a one-line header that lists the contents of each column which are separated by commas. @@ -36,20 +36,20 @@ PFT data file: ``$SITEGROUP_pftdata.txt```): The header for this file is: This file gives the vegetation coverage for the different vegetation types for the site. The file only supports up to five PFT's at the same time. The columns with "pft_f" are the fractions for each PFT, and the columns with "pft_c" is the integer index of the given PFT. Look at the pft-physiology file to see what the PFT index for each PFT type is. ----------------------------------------------- -Dynamic Land-Use Change Files for use by PTCLM ----------------------------------------------- +---------------------------------------------------- +Dynamic Land-Use Change Files for use by PTCLMmkdata +---------------------------------------------------- -There is a mechanism for giving site-specific land-use change in PTCLM. Adding site specific files to the ``PTCLM_sitedata`` directory under PTCLM allows you to specify the change in vegetation and change in harvesting (for the CN model) for that site. Files are named: ``$SITE_dynpftdata.txt``. There is a sample file for the US-Ha1 site called: ``US-Ha1_dynpftdata.txt``. The file has a one-line header with the information that the file has, and then one-line for each year with a transition. The header line is as follows: +There is a mechanism for giving site-specific land-use change in PTCLMmkdata. Adding site specific files to the ``PTCLM_sitedata`` directory under PTCLMmkdata allows you to specify the change in vegetation and change in harvesting (for the CN model) for that site. Files are named: ``$SITE_dynpftdata.txt``. There is a sample file for the US-Ha1 site called: ``US-Ha1_dynpftdata.txt``. The file has a one-line header with the information that the file has, and then one-line for each year with a transition. The header line is as follows: :: trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze -This file only requires a line for each year where a transition or harvest happens. As in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the PFT index, and only up to five vegetation types are allowed to co-exist. The last eight columns have to do with harvesting and grazing. The last two columns are whether to hold harvesting and/or grazing constant until the next transition year and will just be either 1 or 0. This file will be converted by the **PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl** script in the PTCLM directory to a format that **mksurfdata_map** can read that has an entry for each year for the range of years valid for the compset in question. +This file only requires a line for each year where a transition or harvest happens. As in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the PFT index, and only up to five vegetation types are allowed to co-exist. The last eight columns have to do with harvesting and grazing. The last two columns are whether to hold harvesting and/or grazing constant until the next transition year and will just be either 1 or 0. This file will be converted by the **PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl** script in the PTCLMmkdata directory to a format that **mksurfdata_map** can read that has an entry for each year for the range of years valid for the compset in question. ------------------------------------------- -Converting AmeriFlux Data for use by PTCLM ------------------------------------------- +------------------------------------------------ +Converting AmeriFlux Data for use by PTCLMmkdata +------------------------------------------------ AmeriFlux data comes in comma separated format and is available from: `http://public.ornl.gov/ameriflux/dataproducts.shtml `_. Before you download the data you need to agree to the usage terms. @@ -75,23 +75,23 @@ The units of Temperature need to be converted from "Celsius" to "Kelvin" (use th The units of Pressure also need to be converted from "kPa" to "Pa". LATIXY, and LONGXY should also be set to the latitude and longitude of the site. ------------------------------------------------------------ -Example: PTCLM transient example over a shorter time period ------------------------------------------------------------ +----------------------------------------------------------------- +Example: PTCLMmkdata transient example over a shorter time period +----------------------------------------------------------------- -This is an example of using PTCLM for Harvard Forest (AmeriFlux site code US-Ha1) for transient land use 1991-2006. -In order to do this we would've needed to have converted the AmeriFlux data into NetCDF format as show in the `the Section called Converting AmeriFlux Data for use by PTCLM `_ section above. -Also note that this site has a site-specific dynamic land-use change file for it ``PTCLM_sitedata/US-Ha1_dynpftdata.txt`` in the PTCLM directory and this file will be used for land-use change and harvesting rather than the global dataset. +This is an example of using PTCLMmkdata for Harvard Forest (AmeriFlux site code US-Ha1) for transient land use 1991-2006. +In order to do this we would've needed to have converted the AmeriFlux data into NetCDF format as show in the `the Section called Converting AmeriFlux Data for use by PTCLMmkdata `_ section above. +Also note that this site has a site-specific dynamic land-use change file for it ``PTCLM_sitedata/US-Ha1_dynpftdata.txt`` in the PTCLMmkdata directory and this file will be used for land-use change and harvesting rather than the global dataset. :: - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM + > cd $CTSMROOT/tools/PTCLM # We are going to use forcing data over 1991 to 2006, but we need to start with # a transient compset to do so, so we use the 20th Century transient: 1850-2000 # Note: When creating the fpftdyn dataset for this site it will use the # PTCLM_sitedata/US-Ha1_dynpftdata.txt # file for land-use change and harvesting - > ./PTCLM.py -m cheyenne_intel -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux -c I20TRCRUCLM45BGC + > ./PTCLMmkdata -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux > mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 > cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 # Copy data in NetCDF format to this directory, filenames should be YYYY-MM.nc @@ -107,5 +107,3 @@ Also note that this site has a site-specific dynamic land-use change file for it > cat << EOF >> user_nl_clm model_year_align_ndep=1991,stream_year_first_ndep=1991,stream_year_last_ndep=2006 EOF - # Now setup the case, and we'll edit the datm namelist for prescribed aerosols - > ./cesm_setup diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst index 0c49f6ad78..50476e0261 100644 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -4,38 +4,39 @@ .. _what-is-ptclm: -=============== - What is PTCLM -=============== +===================== + What is PTCLMmkdata? +===================== -PTCLM (pronounced either as point clime or Pee-Tee clime) is a Python script to help you set up PoinT CLM simulations. +PTCLMmkdata (pronounced Pee-Tee Cee-L-M make data is a Python script to help you set up PoinT CLM simulations. -It runs the CLM tools for you to get datasets set up, and copies them to a location you can use them according to the ``CLM_USRDAT_NAME`` naming convention. +It runs the CLM tools for you to get datasets set up, and copies them to a location you can use them including the changes +needed for a case to use the dataset with namelist and XML changes. -Then it runs **create_newcase** for you and modifies the env settings and namelist appropriately. +Then you run **create_newcase** and point to the directory so that the namelist and XML changes are automatically applied. -PTCLM has a simple ASCII text file for storing basic information for your sites. +PTCLMmkdata has a simple ASCII text file for storing basic information for your sites. We also have complete lists for AmeriFlux and Fluxnet-Canada sites, although we only have the meteorology data for one site. For other sites you will need to obtain the meteorology data and translate it to a format that the CESM datm model can use. -But, even without meteorology data PTCLM is useful to setup datasets to run with standard ``CLM_QIAN`` data. +But, even without meteorology data PTCLMmkdata is useful to setup datasets to run with standard ``CLM_QIAN`` data. -The original authors of PTCLM are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) and R. Quinn Thomas at Cornell University. It was then modified fairly extensively by Erik Kluzek at NCAR. We want to thank all of these individuals for this contribution to the CESM effort. We also want to thank the folks at University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet station data and import it into our inputdata repository, especially Gil Bohrer the PI on record for this site. +The original authors of PTCLMmkdata are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) and R. Quinn Thomas at Cornell University. It was then modified fairly extensively by Erik Kluzek at NCAR. We want to thank all of these individuals for this contribution to the CESM effort. We also want to thank the folks at University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet station data and import it into our inputdata repository, especially Gil Bohrer the PI on record for this site. .. _details-of-ptclm: -================== - Details of PTCLM -================== +======================= + Details of PTCLMmkdata +======================= -To get help on PTCLM1.110726 use the "--help" option as follows. +To get help on PTCLM2_180611 use the "--help" option as follows. :: - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py --help + > cd $CTSMROOT/tools/PTCLM + > ./PTCLMmkdata --help The output to the above command is as follows: :: @@ -106,36 +107,34 @@ The output to the above command is as follows: Main Script Version Id: $Id: PTCLM.py 47576 2013-05-29 19:11:16Z erik $ Scripts URL: $HeadURL: https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM1_130529/PTCLM.py $: -Here we give a simple example of using PTCLM1 for a straightforward case of running at the US-UMB Fluxnet site on cheyenne where we already have the meteorology data on the machine. -Note, see `the Section called Converting AmeriFlux Data for use by PTCLM `_ for permission information to use this data. +Here we give a simple example of using PTCLMmkdata for a straightforward case of running at the US-UMB Fluxnet site on cheyenne where we already have the meteorology data on the machine. +Note, see `the Section called Converting AmeriFlux Data for use by PTCLMmkdata `_ for permission information to use this data. -Example 6-1. Example of running PTCLM1 for US-UMB on cheyenne +Example 6-1. Example of running PTCLMmkdata for US-UMB on cheyenne ---------------------------------------------------------------- :: > setenv CSMDATA $CESMDATAROOT/inputdata - > setenv MYCSMDATA $HOME/inputdata + > setenv MYDATAFILES `pwd`/mydatafiles > setenv SITE US-UMB - > setenv MYMACH cheyenne_intel > setenv MYCASE testPTCLM - # First link the standard input files to a location you have write access - > cd scripts - > ./link_dirtree $CSMDATA $MYCSMDATA # Next build all of the clm tools you will need - > cd ../$CTSMROOT/tools/|version|/mksurfdata_map - > gmake - > gmake clean - > cd ../../../../../../tools/mapping/gen_domain_files/src - > ../../../../scripts/ccsm_utils/Machines/configure -mach cheyenne -compiler intel - > gmake - > gmake clean + > cd $CTSMROOT/tools/PTCLM + > buildtools # next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) - > cd ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py -m $MYMACH --case=$MYCASE --site=$SITE --csmdata=$MYCSMDATA --aerdepgrid --ndepgrid - # NOTE: we use --aerdepgrid --ndepgrid so that you use the global - # aerosol and Nitrogen deposition files rather than site-specific ones. - > cd ../../../../../$MYCASE - # Finally setup, build, and run the case as normal + > cd $CTSMROOT/tools/PTCLM + # Here we run it using qcmd so that it will be run on a batch node + > qcmd -- ./PTCLMmkdata --site=$SITE --csmdata=$CSMDATA --mydatadir=$MYDATAFILES >& ptclmrun.log & + > cd $CIMEROOT/scripts + > ./create_newcase --user-mods-dir $MYDATAFILES/1x1pt_$SITE --case $MYCASE --res CLM_USRDAT --compset I1PtClm50SpGs + # Next setup, build and run as normal + > cd $MYCASE + > ./case.setup + +PTCLMmkdata includes a README file that gives some extra details and a simple example. + +.. include:: ../../clm5.0/tools/PTCLM/README + :literal: diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst index d3d85da0b1..e36b1e686a 100644 --- a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst +++ b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst @@ -2,71 +2,32 @@ .. include:: ../substitutions.rst -========================= - Examples of using PTCLM -========================= +============================== + Examples of using PTCLMmkdata +============================== Now let's give a few more complex examples using some of the options we have discussed above. -In this first example, we'll demonstrate using a supported single point dataset, which then requires using the "nopointdata". We'll also demonstrate the compset option, "stdurbpt" and "caseidprefix" options. - -Example: Running PTCLM for the Mexicocity supported single point dataset ------------------------------------------------------------------------- -:: - - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py -m cheyenne_intel -s 1x1_mexicocityMEX -d $CSMDATA --nopointdata \ - --stdurbpt -c ICRUCLM45 --caseidprefix `pwd`/myPTCLMcases/site - > cd myPTCLMcases/site_1x1_mexicocityMEX_I - > ./cesm_setup - # Now build and run normally - > ./site_1x1_mexicocityMEX_I.build - # Here we show running interactively - > ./site_1x1_mexicocityMEX_I.run - Now, let's demonstrate using a different group list, doing a spinup, running with Qian global forcing data, but using tower years to set the years to run over. This uses the options: sitegroupname, useQIAN, and QIANtower_years. -Example: Running PTCLM for a spinup simulation with Qian data for tower years. ------------------------------------------------------------------------------- +Example: Running PTCLMmkdata without tower years +------------------------------------------------ :: - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py -m cheyenne_intel -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --useQIAN --QIAN_tower_yrs + > cd $CTSMROOT/tools/PTCLM + > ./PTCLMmkdata -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --donot_use_tower_yrs > cd ../../../../../US-Ha1_ICRUCLM45BGC_QIAN - > ./cesm_setup # Now build and run normally - > ./US-Ha1_ICRUCLM45BGC_QIAN.build - # Here we show running interactively - > ./US-Ha1_ICRUCLM45BGC_QIAN.run ``` Finally, let's demonstrate using a generic machine (which then requires the scratchroot option), using the global grid for PFT and soil types, and setting the run length to two months. -Example: Running PTCLM on a user-defined machine with global PFT and soil types dataset ---------------------------------------------------------------------------------------- +Example: Running PTCLMmkdata with global PFT and soil types dataset +------------------------------------------------------------------- :: - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - # Note, see the the Section called Converting AmeriFlux Data for use by PTCLM with permission information + > cd $CTSMROOT/tools/PTCLM + # Note, see the the Section called Converting AmeriFlux Data for use by PTCLMmkdata with permission information # to use the US-UMB data. - > ./PTCLM.py -m userdefined_intel -s US-UMB -d $CSMDATA --pftgrid --soilgrid \ - --scratchroot $HOME --run_n 2 --run_units nmonths + > ./PTCLMmkdata -s US-UMB -d $CSMDATA --pftgrid --soilgrid > cd ../../../../../US-UMB_ICRUCLM45BGC - # If userdefined is NOT set up for you Uncomment the following and set OS, NTASKS_PER_NODE, TMPDIR - # > ./xmlchange OS=$OS,MAX_TASKS_PER_NODE=$NTASKS_PER_NODE,MPILIB=mpi-serial - # > ./xmlchange RUNDIR=$TMPDIR/$USER/\$CASE/run,DIN_LOC_ROOT=$CSMDATA,COMPILER=intel - # > ./xmlchange EXEROOT=$TMPDIR/$USER/\$CASE - > ./cesm_setup - # Now build - > ./US-UMB_ICRUCLM45BGC.userdefined_intel.build - # To get the files from the svn server... - # First list the files from the streams text file - > ../ccsm_utils/Tools/listfilesin_streams \ - -t $HOME/US-UMB_ICRUCLM45BGC/run/clm1PT.1x1pt_US-UMB.stream.txt -l \ - > Buildconf/datm.input_data_list - # And now run the script to export data to your machine - > ../ccsm_utils/Tools/check_input_data -export - # Here we show running interactively - > ./US-UMB_ICRUCLM45BGC.userdefined_intel.run - -.. warning: Because of Bug 1364, when running this case as above we get a floating point error after reaching time-step 124 for the example exactly as above. Other machines or compilers probably won't have this problem. See the `$CTSMROOT/doc/KnownBugs `_ file for more information on this problem. diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst index 2055cc81a1..e657608b67 100644 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/using-ptclm.rst @@ -3,144 +3,98 @@ .. include:: ../substitutions.rst ************************** -Using PTCLM +Using PTCLMmkdata ************************** -There are three types of options to PTCLM1: required, setup/run-time, and dataset generation options. -The three required options are the three settings that MUST be specified for PTCLM to work at all. The other settings have default values that will default to something useful. The setup/run-time options control how the simulation will be setup and run. The dataset generation options control the generation of datasets needed when PTCLM is run. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash (such as -m instead of --machine). +There are two types of options to PTCLMmkdata: required and optional. +The three required options are the three settings that MUST be specified for PTCLMmkdata to work at all. The other settings have default values that will default to something useful. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash. -The required options to PTCLM are: inputdata directory (-d), machine (-m) and site-name (-s). -Inputdata directory is the directory where you have the CESM inputdata files, you need to have write access to this directory, so if you are running on a machine that you do NOT have write access to the standard inputdata location (such as NCAR cheyenne or LBNL hopper) you need to link the standard files to a location you do have control over. We recommend using the ``scripts/link_dirtree`` tool to do that. "machine" is the scripts name for the machine/compiler you will be using for your case. And finally site-name is the name of the site that you want to run for. Site-name can either be a valid supported dataset name or a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). +The required options to PTCLMmkdata are: inputdata directory (-d) and site-name (-s). +Inputdata directory is the directory where you have the CESM inputdata files. Finally site-name is the name of the site that you want to run for. Site-name is a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). -After PTCLM is run a case directory where you can then setup, build and run your CESM case as normal. -It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLM that were used to create it. +After PTCLMmkdata is run you can run **create_newcase** to setup a case to use the datasets created. +It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLMmkdata that were used to create it. -After "help" the "list" option is one of the most useful options for getting help on using PTCLM. -This option gives you information about some of the other options to PTCLM. To get a list of the machine, sites, and compsets that can be used for PTCLM use the "--list" option as follows. +After "help" the "list" option is one of the most useful options for getting help on using PTCLMmkdata. +This option gives you information about some of the other options to PTCLMmkdata. To get a list of the sites that can be used for PTCLMmkdata use the "--list" option as follows. :: - > cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM - > ./PTCLM.py --list + > cd $CTSMROOT/tools/PTCLM + > ./PTCLMmkdata --list The output to the above command is as follows: :: - /bin/sh: line 1: PTCLM.py: command not found + /bin/sh: line 1: PTCLMmkdata: command not found -Steps in running PTCLM -========================= - -1. Setup Inputdata directory with write access (use link_dirtree script) - - You need to setup an inputdata directory where you have write access to it. - Normally, for NCAR machines the data is on an inputdata where the user does NOT have write access to it. - A way that you can get around this is to use the **link_dirtree** script to create softlinks from the normal location to a location you have write access to. - So for example on cheyenne: - :: +Steps in running PTCLMmkdata +============================ - > setenv CSMDATA $CESMDATAROOT/inputdata - > setenv MYCSMDATA $HOME/inputdata - > mkdir $MYCSMDATA - > cd scripts - > ./link_dirtree $CSMDATA $MYCSMDATA - - See `the Section called Managing Your Own Data-files in Chapter 3 `_ for more information on this. - -2. Build the CLM tools +1. Build the CLM tools Next you need to make sure all the CLM FORTRAN tools are built. :: - > cd $CTSMROOT/tools/|version|/mksurfdata_map - > gmake - > gmake clean - > cd ../../../../../../tools/mapping/gen_domain_files/src - > ../../../../scripts/ccsm_utils/Machines/configure -mach cheyenne -compiler intel - > gmake + > cd $CTSMROOT/tools/PTCLM + > ./buildtools > gmake clean -3. Run PTCLM - Next you actually run PTCLM1 which does the different things listed below: +2. Run PTCLMmkdata + Next you actually run PTCLMmkdata which does the different things listed below: - a. PTCLM names your case based on your input + a. PTCLMmkdata names your output file directory based on your input :: - [Prefix_]SiteCode_Compset[_QIAN] + [Prefix_]SiteCode Where: ``Prefix`` is from the caseidprefix option (or blank if not used). ``SiteCode`` is the site name you entered with the -s option. - ``Compset`` is the compset name you entered with the -c option. - - ``_QIAN`` is part of the name only if the useQIAN is used. - For example, the casename for the following will be: :: > cd scripts - > ./PTCLM.py -m cheyenne_intel -s US-UMB -d $MYCSMDATA -c ICRUCLM45BGC --use QIAN "US-UMB_I_2000_CN_QIAN" + > ./PTCLMmkdata -s US-UMB -d $MYCSMDATA - b. PTCLM creates datasets for you + b. PTCLMmkdata creates datasets for you It will populate $MYCSMDATA with new datasets it creates using the CLM tools. - c. If a transient compset and PTCLM1 finds a _dynpftdata.txt file - If you are running a transient compset (such as the "I_1850-2000_CN" compset) AND you there is a file in the PTCLM_sitedata directory under the PTCLM directory called $SITE_dynpftdata.txt it will use this file for the land-use changes. + c. If a transient compset and PTCLMmkdata finds a _dynpftdata.txt file + If you are running a transient compset (such as the "I_1850-2000_CN" compset) AND you there is a file in the PTCLM_sitedata directory under the PTCLMmkdata directory called $SITE_dynpftdata.txt it will use this file for the land-use changes. Otherwise it will leave land-use constant, unless you use the pftgrid option so it uses the global dataset for landuse changes. - See the Section called Dynamic Land-Use Change Files for use by PTCLM for more information on this. + See the Section called Dynamic Land-Use Change Files for use by PTCLMmkdata for more information on this. There is a sample transient dataset called US-Ha1_dynpftdata.txt. Transient compsets, are compsets that create transient land-use change and forcing conditions such as: 'I_1850-2000', 'I_1850-2000_CN', 'I_RCP8.5_CN', 'I_RCP6.0_CN', 'I_RCP4.5_CN', or 'I_RCP2.6_CN'. - d. PTCLM creates a pft-physiology for you - PTCLM1 will create a local copy of the pft-physiology specific for your site that you could then customize with changes specific for that site. + d. PTCLMmkdata creates a pft-physiology for you + PTCLMmkdata will create a local copy of the pft-physiology specific for your site that you could then customize with changes specific for that site. + + e. PTCLMmkdata creates a README.PTCLM for you + PTCLMmkdata will create a simple text file with the command line for it in a file called README.PTCLM in the case directory it creates for you. - e. PTCLM creates a README.PTCLM for you - PTCLM1 will create a simple text file with the command line for it in a file called README.PTCLM in the case directory it creates for you. +3. Run create_newcase pointing to the directory created 4. Customize, setup, build and run case as normal You then customize your case as you would normally. See the Chapter 1 chapter for more information on doing this. -PTCLM options +PTCLMmkdata options ========================= Next we discuss the setup and run-time options, dividing them up into setup, initial condition (IC), and run-time options. Configure options include: -- --compset=MYCOMPSET -- --caseidprefix=MYCASEID - --cesm_root=BASE_CESM -- --namelist=NAMELIST -- --rmold -- --scratchroot=SCRATCHROOT - --sitegroupname=SITEGROUP -- --QIAN_tower_yrs -- --useQIAN - -``--compset`` - The "-c" option is the most commonly used option after the required options, as it specifies the CESM scripts component set to use with PTCLM1. - The default compset is the "ICN" compset with CN on for present day conditions. - -``--caseidprefix`` - This option gives a prefix to include in the casename when the case is created, in case you want to customize your casenames a bit. - By default, casenames are figured out based on the other options. The argument to this option can either be a name to prefix casenames with and/or a pathname to include. - Hence, if you want cases to appear in a specific directory you can give the pathname to that directory with this option. +- --donot_use_tower_yrs ``--cesm_root`` - This option is for running PTCLM1 with a different root directory to CESM than the version PTCLM exists in. Normally you do NOT need to use this option. - -``--namelist`` - This option adds any items given into the CLM user_nl_clm namelist. This allows you to add customizations to the namelist before the clm.buildnml.csh file is created for the case. - -``--rmold`` - This option will remove an old case directory of the same name if one exists. Otherwise, if an old case directory already exists and you try to run PTCLM it will return with an error. - -``--scratchroot`` - This option is ONLY valid when using one of the generic machines (the -m option). This passed onto **create_newcase** and gives the location where cases will be built and run. + This option is for running PTCLMmkdata with a different root directory to CESM than the version PTCLMmkdata exists in. Normally you do NOT need to use this option. ``--sitegroupname`` - In the PTCLM directory there is a subdirectory "PTCLM_sitedata" that contains files with the site, PFT and soil data information for groups of sites. - These site groups are all separate ASCII files with the same prefix followed by a "_*data.txt" name. See `the Section called PTCLM Group Site Lists `_ for more information on these files. By default we have provided three different valid group names: + In the PTCLMmkdata directory there is a subdirectory "PTCLM_sitedata" that contains files with the site, PFT and soil data information for groups of sites. + These site groups are all separate ASCII files with the same prefix followed by a "_*data.txt" name. See `the Section called PTCLMmkdata Group Site Lists `_ for more information on these files. By default we have provided three different valid group names: EXAMPLE ------- @@ -152,52 +106,21 @@ The EXAMPLE is the group used by default and ONLY includes the US-UMB site as th The other two site groups include the site information for all of both the AmeriFlux and Fluxnet-Canada sites. You can use the "sitegroupname" option to use one of the other lists, or you can create your own lists using the EXAMPLE file as an example. Your list of sites could be real world locations or could be theoretical "virtual" sites given to exercise CLM on differing biomes for example. -Note, see `the Section called Converting AmeriFlux Data for use by PTCLM `_ with permission information to use the US-UMB data. +Note, see `the Section called Converting AmeriFlux Data for use by PTCLMmkdata `_ with permission information to use the US-UMB data. -``--useQIAN`` - This option says to use the standard CLM global Qian T62 atmospheric forcing rather than any tower site forcing data available. Otherwise, PTCLM will try to find tower forcing data for the specific site entered. - -``--QIAN_tower_yrs`` +``--donot_use_tower_yrs`` This option is used with the "useQIAN" option to set the years to cycle over for the Qian data. In this case Qian atmospheric forcing will be used, but the simulation will run over the same years that tower site is available for this site. -**IC options include:** - -- --coldstart -- --finidat=FINIDAT - -The coldstart option says to startup with OUT an initial condition file, while the finidat option explicitly gives the initial condition file to use. Obviously, the coldstart and finidat options can NOT be used together. - -``--coldstart`` - This option ensures that a cold-start will be done with arbitrary initial conditions. - -``--finidat`` - This option sets the initial condition file to startup the simulation from. - **Run-time options include:** -- --debug -- --run_n=MYRUN_N -- --run_units=MYRUN_UNITS -- --stdurbpt - --debug -This option tells PTCLM to echo what it would do if it were run, but NOT actually run anything. So it will show you the dataset creation commands it would use. It does however, run **create_newcase**, but then it only displays the **xmlchange** commands and changes that it would do. Also note that if you give the "--rmold" option it won't delete the case directory beforehand. Primarily this is intended for debugging the operation of PTCLM. - -``--run_n`` - This option along with run_units is used to set the length for the simulation. "run_n" is the number of units to use. The default run length depends on the site, compset, and configuration. - -``--run_units`` - This option is the units of time to use for the length of the simulation. It is used along with "run_n" to set the length of the simulation. The default run length depends on the site, compset, and configuration. - -``--stdurbpt`` - This option turns on the "stdurbpt_pd" use-case for CLM_NML_USE_CASE. This option can NOT be used for compsets that set the use-case to something besides present-day. +This option tells PTCLMmkdata to echo what it would do if it were run, but NOT actually run anything. So it will show you the dataset creation commands it would use. It does however, run **create_newcase**, but then it only displays the **xmlchange** commands and changes that it would do. Also note that if you give the "--rmold" option it won't delete the case directory beforehand. Primarily this is intended for debugging the operation of PTCLMmkdata. **The dataset generation options are:** - --pftgrid - --soilgrid -- --nopointdata -- --owritesrfaer The options that with a "grid" suffix all mean to create datasets using the global gridded information rather than using the site specific point data. By default the site specific point data is used. The "nopointdata" and "owritesrfaer" options have to do with file creation. @@ -211,14 +134,3 @@ Because supported single-point datasets already have the data created for them, This option says to use the soil values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_soildata.txt file when creating the surface dataset. This option must NOT be used when you you are using a site that is a supported single point dataset. -``--nopointdata`` - This option says to NOT create any input datasets -- assume this step has already been done. - If datasets weren't already created, your case will fail when you try to run it. - In general the first time you run PTCLM for a new site you want it to generate new datasets, but the next time and future times you want to use this option so that it doesn't waste a lot of time rebuilding datasets over again. - - .. note:: This option is required when you you are using a site that is a supported single point dataset. - -``--owritesrfaer`` - This option says to overwrite any surface and/or aerosol deposition datasets that were already created. - Otherwise, the creation of these files will be skipped if a file is already found (but it WILL create files if they don't exist). - This option must NOT be used when you you are using a site that is a supported single point dataset. From e2bb9b23d2128b80a753dd7849d88aba9e5ad37e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Jun 2018 14:30:30 -0600 Subject: [PATCH 204/730] Update build --- doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst index 50476e0261..1eaf471739 100644 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst @@ -111,8 +111,7 @@ Here we give a simple example of using PTCLMmkdata for a straightforward case of Note, see `the Section called Converting AmeriFlux Data for use by PTCLMmkdata `_ for permission information to use this data. Example 6-1. Example of running PTCLMmkdata for US-UMB on cheyenne ----------------------------------------------------------------- - +------------------------------------------------------------------ :: > setenv CSMDATA $CESMDATAROOT/inputdata From 29943cc54e605d4a22e5a5330f18d2c95b1ff8fc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 29 Jun 2018 14:58:25 -0600 Subject: [PATCH 205/730] Work on trouble-shooting and testing chapters --- doc/source/users_guide/testing/testing.rst | 57 ++-- .../trouble-shooting/trouble-shooting.rst | 313 +----------------- 2 files changed, 31 insertions(+), 339 deletions(-) diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index 0594bc9157..04f90fc3d3 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -21,44 +21,41 @@ CIME Testing scripts We first introduce the test scripts that work for all CESM components. The CIME script **create_test** runs a specific type of test, at a given resolution, for a given compset using a given machine. -There is a list of different tests, but the "ERI" tests do several things at once, running from startup, as well as doing exact branch and restart tests. -So to run "ERI" testing at 2-degree with the I1850CRUCLM45 compset on cheyenne_intel you do the following. -:: +See `CIME Chapter on Testing `_ for how to use it to run single +tests as well as lists of tests. The standard testname for CLM is "aux_clm" for cheyenne with intel and gnu compilers as +well as the CGD machine hobart for intel, nag, and pgi compilers. There's also a shorter test list called "clm_short". Also +see the `CTSM Wiki on Testing `_. - > cd scripts - > ./create_test -testname ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel - > cd ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id - > ./ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id.build - > ERI.f19_g17_gl4.I1850CRUCLM45.cheyenne_intel.$id.submit +CTSM Tools Testing +================== -When the test is done it will update the file TestStatus with either a PASS or FAIL message. +.. include:: ../../clm5.0/test/tools/README + :literal: -We already have a standard list of tests for clm (the "aux_clm" list of tests). To run the CLM cheyenne intel compiler test list, for the same machine and compiler you would do the following: -:: +CTSM Fortran Unit Tests +======================= - > cd scripts - > ./create_test -xml_mach cheyenne -xml_compiler intel -xml_category aux_clm -mach cheyenne -compiler intel - # Normally it will submit the jobs as they are ready, but if it's interrupted you - # may need to submit by hand as follows... - # Submit the suite of tests (note $id refers to the integer job number for this job) - > ./cs.submit.$id.cheyenne - # Later check the tests with... - > ./cs.status.$id - # The above will give a PASS or FAIL message for each test. +.. include:: ../../clm5.0/src/README.unit_testing + :literal: + +CTSM Build-namelist Tests +========================= + +Run the following perl tester that + +:: + > cd bld/unit_testers + > ./build-namelist_test.pl -For more information on doing testing with the CESM scripts see the `|cesmrelease| User's Guide `_ on testing. Testing PTCLM ============= -There is a simple test script for PTCLM called ``testcases.csh`` in the PTCLM directory (``scripts/ccsm_utils/Tools/lnd/clm/PTCLM``). -The test script is setup to run on the machines: cheyenne, frankfurt, yong, and titan. -You simply run the script interactively. -The script will write out the status of tests to a file called: ``tc.job#.status``. +.. include:: ../../clm5.0/tools/PTCLM/README + :literal: + +To run on cheyenne, you do the following: -There are a few environment variables that can be used with ``testcases.csh`` to change it's operation. -``CESM_ROOT``: To test with a separate root to CESM code set this env variable to the root directory to use. -``CLM_SOFF``: If set to ``TRUE`` - stop on first failed test rather than continuing to run. -``CLM_RETAIN_FILES``: If set to ``FALSE`` - cleanup tools build first. -``DEBUG``: If set to ``TRUE`` - setup cases, but do not build or run. +.. include:: ../../clm5.0/tools/PTCLM/test/README.run_cheyenne + :literal: diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index c7e38cf645..9af807041f 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -10,318 +10,13 @@ In this chapter we give some guidance on what to do when you encounter some of t In general you will run into one of three type of problems: -1. *setup-time* +1. *case-creation* +#. *setup-time* #. *build-time* #. *run-time* +See the `CIME Trouble Shooting Guide `_ for some help on the first three. -Setup Problems -============== - -The first type of problem happens when you invoke the **case.setup** command. -This indicates there is something wrong with your input datasets, or the details of what you are trying to setup the model to do. -There's also a trouble-shooting chapter in the `|cesmrelease| Scripts User's Guide `_. -Many of the problems with configuration can be resolved with the guidelines given there. -Here we will restrict ourselves to problems from the input files. - -Example: Missing datasets ----------------------------------------------------------------- -:: - - > ./create_newcase -case ne60rcp6 -res ne60_g16 -compset IRCP60CN \ - -mach cheyenne_intel - > ./case.setup - -The following is what is displayed to the screen. -:: - - . - . - . - Running preview_namelist script - CLM configure done. - CLM adding use_case 1850-2100_rcp6_transient defaults for var clm_demand with val fpftdyn - CLM adding use_case 1850-2100_rcp6_transient defaults for var clm_start_type with val startup - CLM adding use_case 1850-2100_rcp6_transient defaults for var model_year_align_ndep with val 1850 - CLM adding use_case 1850-2100_rcp6_transient defaults for var rcp with val 6 - CLM adding use_case 1850-2100_rcp6_transient defaults for var sim_year with val 1850 - CLM adding use_case 1850-2100_rcp6_transient defaults for var sim_year_range with val 1850-2100 - CLM adding use_case 1850-2100_rcp6_transient defaults for var stream_year_first_ndep with val 1850 - CLM adding use_case 1850-2100_rcp6_transient defaults for var stream_year_last_ndep with val 2100 - CLM adding use_case 1850-2100_rcp6_transient defaults for var use_case_desc with val Simulate transient land-use, aerosol and Nitrogen deposition changes - with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - build-namelist - No default value found for fpftdyn. - Are defaults provided for this resolution and land mask? - ERROR: clm.buildnml.csh failed - ERROR: /Users/erik/clm_cesm1_1_1_rel/scripts/ne60rcp6/preview_namelists failed: 25344 - -The important thing to note here is the line: -:: - - ERROR: clm.buildnml.csh failed - -which tells us that the problem is in the land **clm.buildnml.csh**. It may also indicate problems in one of the other buildnml.csh files (atm, cesm, cpl, glc, ice, or ocn), in which case you should consult the appropriate model user's guide. - -In the example, the error is that the CLM XML database does NOT have a ``finidat`` for the given resolution, rcp scenario and ocean mask. That means you will need to create the file and then supply the file into your case. See `Chapter 2 `_ for more information on creating files, and see `Chapter 3 `_ for more information on adding files to the XML database. Alternatively, you can provide the file to your case by creating a user namelist as shown in `the Section called User Namelist in Chapter 1 `_. - -.. note:: The two most common problems from your **clm.buildnml.csh** will be errors from the CLM **configure** or **build-namelist**. For more information on these scripts see: `the Section called More information on the CLM configure script in Chapter 1 `_ and `the section on CLM_BLDNML_OPTS `_. - - -Build problems -================ - -The following is an example of running the build for a case and having it fail in the land model build. -As you can see it lists which model component is being built and the build log for that component. -:: - - CCSM BUILDEXE SCRIPT STARTING - - Build Libraries: mct pio csm_share - Sat Jun 19 21:21:19 MDT 2010 /ptmp/erik/test_build/mct/mct.bldlog.100619-212107 - Sat Jun 19 21:22:18 MDT 2010 /ptmp/erik/test_build/pio/pio.bldlog.100619-212107 - Sat Jun 19 21:23:18 MDT 2010 - /ptmp/erik/test_build/csm_share/csm_share.bldlog.100619-212107 - Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/cpl.bldlog.100619-212107 - Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/atm.bldlog.100619-212107 - Sat Jun 19 21:24:06 MDT 2010 /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 - ERROR: clm.buildexe.csh failed, see /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 - ERROR: cat /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 - -You can then examine the build log that failed and see what went wrong. Most compilers will give the full filepath and line number for the file that filed to compile. - -Run Time Problems -================= - -Tracking down problems while the model is running is much more difficult to do than setup or build problems. -In this section we will give some suggestions on how to find run time problems. -Below we show the log file results of a job that aborted while running. -:: - - CCSM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY - Sun Jun 20 18:24:06 MDT 2010 -- CSM EXECUTION BEGINS HERE - Sun Jun 20 18:24:35 MDT 2010 -- CSM EXECUTION HAS FINISHED - Model did not complete - see /ptmp/erik/test_run/run/cpl.log.100620-182358 - -In the next section we will talk about using the different log files to track down problems, and find out where the problem is coming from. In the section after that we give some general advice on debugging problems and some suggestions on ideas that may be helpful to track the problem down. Some of the examples below are from the `$CTSMROOT/doc/KnownBugs `_ file. - -Tracking Problems by Querying Log Files ---------------------------------------- - -The first thing to do when tracking down problems is to query the different log files to see if you can discover where the problem occurs, and any error messages about it. -It's important to figure out if the problem comes in at initialization or in the run phase of the model, and in which model component the problem happens. -There are different log files for the different major components, and they all end with the date and time in YYMMDD-HHMMSS format (2-digit: year, month, day, hour minute and second). -When the model runs to completion the log files will be copied to the logs directory in the script directory, but when the model fails they will remain in the run directory. -Here's an example list of log files from an "I" case where the model dies in the land model initialization. -For "I" cases the sea-ice and ocean components are just stubs and don't create log files (and unless running with the active land-ice model "glc" log files won't be created either). -:: - - atm.log.100620-182358 - cesm.log.100620-182358 - cpl.log.100620-182358 - lnd.log.100620-182358 - -The coupler log file --------------------- - -The first log file to check is the coupler log file so that you can see where the model dies and which model component it fails in. When the model dies at initialization the last model component listed is the component that failed. - -Example of a case that fails in the CLM land model initialization. -:: - - (seq_timemgr_clockPrint) Prev Time = 00001201 00000 - (seq_timemgr_clockPrint) Next Time = 99991201 00000 - (seq_timemgr_clockPrint) Intervl yms = 9999 0 0 - - (seq_mct_drv) : Initialize each component: atm, lnd, ocn, and ice - (seq_mct_drv) : Initialize atm component - (seq_mct_drv) : Initialize lnd component - -The cesm log file ------------------ - -The cesm log files are to some extent the "garbage collection" of log output. -The CLM sends it's output from it's master processor, but sends other output and possibly errors to the cesm log file. -Because, of this, often error messages are somewhere in the cesm log file. -However, since there is so much other output it may be difficult to find. -For example, here is some output from an older version of CESM (CESM1.0.2) where the RTM river routing file (before it was converted to NetCDF) was not provided and the error on the open statement for the file was embedded near the end of the cesm log file. -:: - - NODE# NAME - ( 0) be1105en.ucar.edu - "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/$CTSMROOT/src/riverroute/RtmMod.F90", line - 239: 1525-155 The file name provided in the OPEN statement for unit 1 has zero length or - contains all blanks. The program will recover by ignoring the OPEN statement. - "/gpfs/proj2/fis/cgd/home/erik/clm_trunk/$CTSMROOT/src/riverroute/RtmMod.F90", line - 241: 1525-001 The READ statement on the file fort.1 cannot be completed because the end - of the file was reached. The program will stop. - - Running: ./cesm.exe - Please wait... - - Memory usage for ./cesm.exe (task # 0) is: 51696 KB. Exit status: 1. Signal: 0 - -Although the example is from an earlier version of the model it still serves to illustrate finding problems from the cesm log file. - -When working with the cesm log file, for a run-time problem, you will need to be able to separate it's output into three categories: pre-crash, crash, and post-crash. -The pre-crash section is everything that is normal output for good operation of the model. -The crash section is the section where the model dies and reports on the actual problem. -the post-crash section is the cleanup and finalization after the model dies. -The most important part of this of course is the crash section. -The tricky part is distinguishing it from the other sections. -Also because the cesm log file most likely has duplicated output from multiple processors it is even more difficult to distinguish the different sections and to some extent the sections may be intertwined, as different processors reach the different sections at different times. -Because, of this reducing the number of processors for your simulation may help you sort out the output in the file (see `the Section called Run with a smaller set of processors `_). -Also much of the output from the cesm log file are system level information having to do with MPI multiprocessing. -Usually you can ignore this information, but it makes it more difficult to trudge through. - - -Sometimes the cesm log file is the ONLY file available, because the model terminates early in initialization. -In this case understanding the output in the cesm log file becomes even more important. -This also indicates the model did NOT advance far enough to reach the initialization of the individual model components. -This may mean that the initialization of the multiprocessing for MPI and/or OpenMP failed, or that the reading of the driver namelist file "drv_in" failed. - - -Here we show those three sections for a cesm log file where a two task job failed on reading the namelist file. -For a typical job with many tasks similar sections of this will be repeated not just twice but for each task and hence make it harder to read. - - -*Pre-crash section of the cesm log file* -:: - - ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. - - ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. - ATTENTION: 0031-378 MP_EUIDEVICE setting ignored when LoadLeveler is not being used. - ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. - 0:INFO: 0031-724 Executing program: - 1:INFO: 0031-724 Executing program: - 0:/contrib/bin/cesm_launch: process 401894 bound to logical CPU 0 on host be0310en.ucar.edu ... - 1:/contrib/bin/cesm_launch: process 439264 bound to logical CPU 1 on host be0310en.ucar.edu ... - 0:INFO: 0031-619 64bit(us, Packet striping on) ppe_rmas MPCI_MSG: MPI/MPCI library was compiled on Wed Aug 5 13:36:06 2009 - 0: - 1:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 - 1:. - 1:LAPI is using lightweight lock. - 0:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 - 0:. - 0:LAPI is using lightweight lock. - 0:Use health ping for failover/recovery - 1:Use health ping for failover/recovery - 0:Initial communication over instance 2. - 1:Initial communication over instance 0. - 1:IB RDMA initialization completed successfully - 1:The MPI shared memory protocol is used for the job - 0:IB RDMA initialization completed successfully - 0:LAPI job ID for this job is: 1684890719 - 0:The MPI shared memory protocol is used for the job - 0:(seq_comm_setcomm) initialize ID ( 7 GLOBAL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 2 ATM ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 1 LND ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 4 ICE ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 5 GLC ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 3 OCN ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 6 CPL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 8 CPLATM ) join IDs = 6 2 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 9 CPLLND ) join IDs = 6 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 10 CPLICE ) join IDs = 6 4 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 11 CPLOCN ) join IDs = 6 3 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 12 CPLGLC ) join IDs = 6 5 ( npes = 2) ( nthreads = 1) - 0: - 0: (seq_comm_printcomms) ID layout : global pes vs local pe for each ID - 0: gpe LND ATM OCN ICE GLC CPL GLOBAL CPLATM CPLLND CPLICE CPLOCN CPLGLC nthrds - 0: --- ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ - 0: 0 : 0 0 0 0 0 0 0 0 0 0 0 0 1 - 1: 1 : 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1: - 0: (t_initf) Read in prof_inparm namelist from: drv_in - 1: (seq_io_init) cpl_io_stride, iotasks or root out of bounds - resetting to defaults 4 0 1 - 0: piolib_mod.f90 1353 1 2 1 2 - 1: piolib_mod.f90 1353 1 2 1 2 - 0: pio_support::pio_die:: myrank= 0 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride - 1: pio_support::pio_die:: myrank= 1 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride - -*Crash section of the cesm log file* -:: - - 0: - 0: Traceback: - 1: - 1: Traceback: - 0: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in - 1: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in - 0: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 - 1: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 - 1: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 - 0: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 - 0: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 - 0: --- End of call chain --- - 1: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 - 1: --- End of call chain --- - -*Post-crash section of the cesm log file* -:: - - 1:Communication statistics of task 1 is associated with task key: 1684890719_1 - 0:Communication statistics of task 0 is associated with task key: 1684890719_0 - 0: - 0:Running: ./cesm.exe - 0:Please wait... - 0: - 0:Memory usage for ./cesm.exe (task # 0) is: 198892 KB. Exit status: 134. Signal: 0 - 1: - 1:Running: ./cesm.exe - 1:Please wait... - 1: - 1:Memory usage for ./cesm.exe (task # 0) is: 198572 KB. Exit status: 134. Signal: 0 - INFO: 0031-656 I/O file STDOUT closed by task 0 - INFO: 0031-656 I/O file STDERR closed by task 0 - ERROR: 0031-250 task 0: IOT/Abort trap - INFO: 0031-656 I/O file STDOUT closed by task 1 - INFO: 0031-656 I/O file STDERR closed by task 1 - ERROR: 0031-250 task 1: IOT/Abort trap - INFO: 0031-639 Exit status from pm_respond = 0 - ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. - Job /usr/local/lsf/7.0/aix5-64/bin/poejob /contrib/bin/ccsm_launch /contrib/bin/job_memusage.exe ./cesm.exe - - TID HOST_NAME COMMAND_LINE STATUS TERMINATION_TIME - ===== ========== ================ ======================= =================== - 00000 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 - 00001 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 - -The CLM log file ----------------- - -Of course when you are working with and making changes to CLM, most of your focus will be on the CLM log file and the errors it shows. -As already pointed out if you don't see errors in the ``lnd.log.*`` file you should look in the ``cesm.log.*`` to see if any errors showed up there. - -Here's an example of the ``lnd.log.*`` file when running ``PTS_MODE`` with initial conditions (this is bug 1025 in the `$CTSMROOT/doc/KnownLimitationss `_ file). -:: - - Successfully initialized variables for accumulation - - reading restart file I2000CN_f09_g17_gl4_c100503.clm2.r.0001-01-01-00000.nc - Reading restart dataset - ERROR - setlatlon.F:Cant get variable dim for lat or lsmlat - ENDRUN: called without a message string - -The DATM log file ------------------ - -When working with "I cases" the second most common problems after CLM problems are problems with the data atmosphere model. So examining the ``atm.log.*`` is important. - -Here's an example of a problem that occurs when the wrong prescribed aerosol file is given to a ``pt1_pt1`` simulation. -:: - - (datm_comp_init) atm mode = CLMNCEP - (shr_strdata_init) calling shr_dmodel_mapSet for fill - (shr_strdata_init) calling shr_dmodel_mapSet for remap - ('shr_map_getWts') ERROR: yd outside bounds 19.5000000000000000 - (shr_sys_abort) ERROR: ('shr_map_getWts') ERROR yd outside 90 degree bounds - (shr_sys_abort) WARNING: calling shr_mpi_abort() and stopping - -The batch log files -------------------- - -The names of the batch log files will depend on the batch system of the machine that is being used. They will normally be in the script directory. Usually, they don't contain important information, but they are a last resort place to look for error messages. On the NCAR system "cheyenne" the batch files are called with names that start with the batch submission script and then either "stderr.o" or "stdout.o", with the job number at the end. General Advice on Debugging Run time Problems ============================================= @@ -389,7 +84,7 @@ Along the same lines, you might try running a simpler case, trying another comps Run with a debugger ------------------- -Another suggestion is to run the model with a debugger such as: **dbx**, **gdb**, or **totalview**. +Another suggestion is to run the model with a debugger such as: **ddt**, **dbx**, **gdb**, or **totalview**. Often to run with a debugger you will need to reduce the number of processors as outlined above. Some debuggers such as **dbx** will only work with one processor, while more advanced debuggers such as **totalview** can work with both MPI tasks and OMP threads. Even simple debuggers though can be used to query core files, to see where the code was at when it died (for example using the **where** in **dbx** for a core file can be very helpful. From 910793f522db57edb85fd3fa5866ed2d17c694e5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 30 Jun 2018 14:28:51 -0600 Subject: [PATCH 206/730] Do a fresh new build of everything --- doc/Makefile | 2 +- doc/Makefile.tech_note | 2 +- doc/Makefile.users_guide | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 6d3ce5f50d..6e8d96d485 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/Makefile.tech_note b/doc/Makefile.tech_note index 07ebab36e6..3ba843c70e 100644 --- a/doc/Makefile.tech_note +++ b/doc/Makefile.tech_note @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile.tech_note - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/Makefile.users_guide b/doc/Makefile.users_guide index 08562d18ca..babfffa52c 100644 --- a/doc/Makefile.users_guide +++ b/doc/Makefile.users_guide @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile.users_guide - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) From 2aabc98bef5307b599c84242ff2ad60c0ba0d0b7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 30 Jun 2018 15:42:12 -0600 Subject: [PATCH 207/730] Renames to get rid of hardwired chapter names and rebuild --- ...ns-or-New-Files-to-the-build-namelist-Database.rst} | 0 ...esolution-Names.rst => Adding-Resolution-Names.rst} | 0 ...es.rst => Adding-or-Changing-Default-Filenames.rst} | 0 .../users_guide/adding-new-resolutions/index.rst | 6 +++--- ...LM-with-transient-historical-CO2-concentration.rst} | 0 ...ata-as-atmospheric-forcing-to-spinup-the-model.rst} | 0 ...ion-as-atmospheric-forcing-to-spinup-the-model.rst} | 0 ...-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst} | 0 ... => Spinning-up-the-biogeochemistry-BGC-spinup.rst} | 0 doc/source/users_guide/running-special-cases/index.rst | 10 +++++----- 10 files changed, 8 insertions(+), 8 deletions(-) rename doc/source/users_guide/adding-new-resolutions/{CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst => Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst} (100%) rename doc/source/users_guide/adding-new-resolutions/{CLM-3.2-Adding-Resolution-Names.rst => Adding-Resolution-Names.rst} (100%) rename doc/source/users_guide/adding-new-resolutions/{CLM-3.3-Adding-or-Changing-Default-Filenames.rst => Adding-or-Changing-Default-Filenames.rst} (100%) rename doc/source/users_guide/running-special-cases/{CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst => Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst} (100%) rename doc/source/users_guide/running-special-cases/{CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst => Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst} (100%) rename doc/source/users_guide/running-special-cases/{CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst => Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst} (100%) rename doc/source/users_guide/running-special-cases/{CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst => Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst} (100%) rename doc/source/users_guide/running-special-cases/{CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst => Spinning-up-the-biogeochemistry-BGC-spinup.rst} (100%) diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst b/doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst similarity index 100% rename from doc/source/users_guide/adding-new-resolutions/CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst rename to doc/source/users_guide/adding-new-resolutions/Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst b/doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst similarity index 100% rename from doc/source/users_guide/adding-new-resolutions/CLM-3.2-Adding-Resolution-Names.rst rename to doc/source/users_guide/adding-new-resolutions/Adding-Resolution-Names.rst diff --git a/doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst b/doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst similarity index 100% rename from doc/source/users_guide/adding-new-resolutions/CLM-3.3-Adding-or-Changing-Default-Filenames.rst rename to doc/source/users_guide/adding-new-resolutions/Adding-or-Changing-Default-Filenames.rst diff --git a/doc/source/users_guide/adding-new-resolutions/index.rst b/doc/source/users_guide/adding-new-resolutions/index.rst index 97d97b0cc0..88bbda3f5b 100644 --- a/doc/source/users_guide/adding-new-resolutions/index.rst +++ b/doc/source/users_guide/adding-new-resolutions/index.rst @@ -14,6 +14,6 @@ Adding New Resolutions .. toctree:: :maxdepth: 2 - CLM-3.0-Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst - CLM-3.2-Adding-Resolution-Names.rst - CLM-3.3-Adding-or-Changing-Default-Filenames.rst + Adding-New-Resolutions-or-New-Files-to-the-build-namelist-Database.rst + Adding-Resolution-Names.rst + Adding-or-Changing-Default-Filenames.rst diff --git a/doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst b/doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst rename to doc/source/users_guide/running-special-cases/Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst diff --git a/doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst rename to doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst diff --git a/doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst rename to doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst diff --git a/doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst rename to doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst diff --git a/doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst similarity index 100% rename from doc/source/users_guide/running-special-cases/CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst rename to doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst diff --git a/doc/source/users_guide/running-special-cases/index.rst b/doc/source/users_guide/running-special-cases/index.rst index 18ef7a96b0..f063992c67 100644 --- a/doc/source/users_guide/running-special-cases/index.rst +++ b/doc/source/users_guide/running-special-cases/index.rst @@ -17,8 +17,8 @@ Running Special Cases what-is-a-special-case.rst running-the-prognostic-crop-model.rst running-with-irrigation.rst - CLM-4.3-Spinning-up-the-Satellite-Phenology-Model-(CLMSP-spinup).rst - CLM-4.4-Spinning-up-the-CLM5.0-biogeochemistry-(CLMBGC-spinup).rst - CLM-4.7-Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst - CLM-4.8-Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst - CLM-4.9-Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst + Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst + Spinning-up-the-biogeochemistry-BGC-spinup.rst + Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst + Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst + Running-stand-alone-CLM-with-transient-historical-CO2-concentration.rst From 9558e7844814d10335ab13c4d4920876d60aae41 Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Thu, 12 Jul 2018 15:29:26 -0600 Subject: [PATCH 208/730] Added a reference for g1 values and two tables, one with target leaf CN, another with SLAtop and flnr --- .../CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 56 ++++++++++++++++- .../CLM50_Tech_Note_Crop_Irrigation.rst | 2 +- .../CLM50_Tech_Note_Photosynthesis.rst | 3 +- ...LM50_Tech_Note_Photosynthetic_Capacity.rst | 61 ++++++++++++++++++- .../References/CLM50_Tech_Note_References.rst | 9 +++ 5 files changed, 126 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst index 469bc96f33..14704b0b5f 100644 --- a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -54,7 +54,7 @@ Tissue Stoichiometry As of CLM5, vegetation tissues have a flexible stoichiometry, as described in :ref:`Ghimire et al. (2016) `. Each -tissue has a target C\:N ratio, and nitrogen is allocated at each +tissue has a target C\:N ratio (see :numref:`Table Plant functional type (PFT) target CN parameters`), and nitrogen is allocated at each timestep in order to allow the plant to best match the target stoichiometry. Nitrogen downregulation of productivity acts by increasing the C\:N ratio of leaves when insufficient nitrogen is @@ -63,3 +63,57 @@ reducing the N available for photosynthesis and reducing the :math:`V_{\text{c,m :math:`J_{\text{max25}}` terms, as described in Chapter :numref:`rst_Photosynthetic Capacity`. Details of the flexible tissue stoichiometry are described in Chapter :numref:`rst_CN Allocation`. + +.. _Table Plant functional type (PFT) target CN parameters: + +.. table:: Plant functional type (PFT) target C:N parameters. + + +----------------------------------+-------------------+ + | PFT | target leaf C:N | + +==================================+===================+ + | NET Temperate | 58.00 | + +----------------------------------+-------------------+ + | NET Boreal | 58.00 | + +----------------------------------+-------------------+ + | NDT Boreal | 25.81 | + +----------------------------------+-------------------+ + | BET Tropical | 29.60 | + +----------------------------------+-------------------+ + | BET temperate | 29.60 | + +----------------------------------+-------------------+ + | BDT tropical | 23.45 | + +----------------------------------+-------------------+ + | BDT temperate | 23.45 | + +----------------------------------+-------------------+ + | BDT boreal | 23.45 | + +----------------------------------+-------------------+ + | BES temperate | 36.42 | + +----------------------------------+-------------------+ + | BDS temperate | 23.26 | + +----------------------------------+-------------------+ + | BDS boreal | 23.26 | + +----------------------------------+-------------------+ + | C\ :sub:`3` arctic grass | 28.03 | + +----------------------------------+-------------------+ + | C\ :sub:`3` grass | 28.03 | + +----------------------------------+-------------------+ + | C\ :sub:`4` grass | 35.36 | + +----------------------------------+-------------------+ + | Temperate Corn | 25.00 | + +----------------------------------+-------------------+ + | Spring Wheat | 20.00 | + +----------------------------------+-------------------+ + | Temperate Soybean | 20.00 | + +----------------------------------+-------------------+ + | Cotton | 20.00 | + +----------------------------------+-------------------+ + | Rice | 20.00 | + +----------------------------------+-------------------+ + | Sugarcane | 25.00 | + +----------------------------------+-------------------+ + | Tropical Corn | 25.00 | + +----------------------------------+-------------------+ + | Tropical Soybean | 20.00 | + +----------------------------------+-------------------+ + + diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index fb6a180edd..8f0b975fce 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -372,7 +372,7 @@ Harvest occurs in one time step using the BGC leaf offset algorithm. Notes: :math:`Date_{planting}^{min}` and :math:`Date_{planting}^{max}` are the minimum and maximum planting date in the Northern Hemisphere, the corresponding dates in the Southern Hemisphere apply 6 months later. -:math:`T_{p}` and :math:`T_{p}^{ min }` are crop-specific coldest planting temperatures. +:math:`T_{p}` and :math:`T_{p}^{ min }` are crop-specific average and coldest planting temperatures, respectively. :math:`{GDD}_{min}` is the lowest (for planting) 20-year running mean growing degree-days based on the base temperature threshold in the 7\ :sup:`th` row, tracked from April to September (NH). :math:`{GDD}_{mat}` is a crop’s 20-year running mean growing diff --git a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst index 84136f7868..f7171f1a10 100644 --- a/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst +++ b/doc/source/tech_note/Photosynthesis/CLM50_Tech_Note_Photosynthesis.rst @@ -66,7 +66,8 @@ photosynthesis (:math:`\mu`\ mol CO\ :sub:`2` m\ :sup:`-2` s\ :sup:`-1`), :math:`c_{s}` is the CO\ :sub:`2` partial pressure at the leaf surface (Pa), :math:`P_{atm}` is the atmospheric pressure (Pa), and :math:`D` is the vapor pressure deficit at the leaf surface (kPa). -:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`). +:math:`g_{1}` is a plant functional type dependent parameter (:numref:`Table Plant functional type (PFT) stomatal conductance parameters`) +and are the same as those used in the CABLE model (:ref:`de Kauwe et al. 2015 `). The value for :math:`g_{o}=100` :math:`\mu` mol m :sup:`-2` s\ :sup:`-1` for C\ :sub:`3` and C\ :sub:`4` plants. diff --git a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst index 4c3e857ade..c75c9f2b39 100755 --- a/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst +++ b/doc/source/tech_note/Photosynthetic_Capacity/CLM50_Tech_Note_Photosynthetic_Capacity.rst @@ -82,7 +82,64 @@ multiplication of leaf mass per unit area (:math:`\text{LMA}`; g biomass/m :sup: N_{\text{str}} = \text{SNC} \cdot \text{LMA} -where :math:`\text{SNC}` is set to be fixed at 0.002 (gN/g biomass), based on data on C:N ratio from dead wood (White etal.,2000). +where :math:`\text{SNC}` is set to be fixed at 0.002 (gN/g biomass), based on data on C:N ratio from dead wood (White etal.,2000), +and :math:`\text{LMA}` is the inverse of specific leaf area at the canopy top (:math:`SLA_{\text{0}}`), a PFT-level parameter (:numref:`Table Plant functional type (PFT) leaf N parameters`). + +.. _Table Plant functional type (PFT) leaf N parameters: + +.. table:: Plant functional type (PFT) leaf N parameters. + + +----------------------------------+--------------------------+--------------------------+ + | PFT | :math:`SLA_{\text{0}}` | :math:`N_{\text{cb}}` | + +==================================+==========================+==========================+ + | NET Temperate | 0.0100 | 0.0509 | + +----------------------------------+--------------------------+--------------------------+ + | NET Boreal | 0.0100 | 0.0466 | + +----------------------------------+--------------------------+--------------------------+ + | NDT Boreal | 0.0202 | 0.0546 | + +----------------------------------+--------------------------+--------------------------+ + | BET Tropical | 0.0190 | 0.0461 | + +----------------------------------+--------------------------+--------------------------+ + | BET temperate | 0.0190 | 0.0515 | + +----------------------------------+--------------------------+--------------------------+ + | BDT tropical | 0.0308 | 0.0716 | + +----------------------------------+--------------------------+--------------------------+ + | BDT temperate | 0.0308 | 0.1007 | + +----------------------------------+--------------------------+--------------------------+ + | BDT boreal | 0.0308 | 0.1007 | + +----------------------------------+--------------------------+--------------------------+ + | BES temperate | 0.0180 | 0.0517 | + +----------------------------------+--------------------------+--------------------------+ + | BDS temperate | 0.0307 | 0.0943 | + +----------------------------------+--------------------------+--------------------------+ + | BDS boreal | 0.0307 | 0.0943 | + +----------------------------------+--------------------------+--------------------------+ + | C\ :sub:`3` arctic grass | 0.0402 | 0.1365 | + +----------------------------------+--------------------------+--------------------------+ + | C\ :sub:`3` grass | 0.0402 | 0.1365 | + +----------------------------------+--------------------------+--------------------------+ + | C\ :sub:`4` grass | 0.0385 | 0.0900 | + +----------------------------------+--------------------------+--------------------------+ + | Temperate Corn | 0.0500 | 0.2930 | + +----------------------------------+--------------------------+--------------------------+ + | Spring Wheat | 0.0350 | 0.4102 | + +----------------------------------+--------------------------+--------------------------+ + | Temperate Soybean | 0.0350 | 0.4102 | + +----------------------------------+--------------------------+--------------------------+ + | Cotton | 0.0350 | 0.4102 | + +----------------------------------+--------------------------+--------------------------+ + | Rice | 0.0350 | 0.4102 | + +----------------------------------+--------------------------+--------------------------+ + | Sugarcane | 0.0500 | 0.2930 | + +----------------------------------+--------------------------+--------------------------+ + | Tropical Corn | 0.0500 | 0.2930 | + +----------------------------------+--------------------------+--------------------------+ + | Tropical Soybean | 0.0350 | 0.4102 | + +----------------------------------+--------------------------+--------------------------+ + +Notes: :math:`SLA_{\text{0}}` is the specific leaf area at the canopy top (m :sup:`2` leaf/g biomass), +and :math:`N_{\text{cb}}` is the fraction of leaf nitrogen in Rubisco (g N in Rubisco g :sup:`-1` N) + We assume that plants optimize their nitrogen allocations (i.e., :math:`N_{\text{store}}`, :math:`N_{\text{resp}}`, :math:`N_{\text{lc}}`, :math:`N_{\text{et}}`, :math:`N_{\text{cb}}`) to maximize the photosynthetic carbon gain, defined as the gross photosynthesis ( :math:`A` ) minus the maintenance respiration for @@ -202,7 +259,7 @@ as in :ref:`Thornton and Zimmermann (2007)`. At 25ºC, where :math:`N_{str}` is the area-based leaf nitrogen concentration (g N m\ :sup:`-2` leaf area), :math:`N_{cb}` is the fraction of leaf -nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N), +nitrogen in Rubisco (g N in Rubisco g\ :sup:`-1` N, :numref:`Table Plant functional type (PFT) leaf N parameters`), :math:`F_{NR} =7.16` is the mass ratio of total Rubisco molecular mass to nitrogen in Rubisco (g Rubisco g\ :sup:`-1` N in Rubisco), and :math:`a_{R25} =60` is the specific activity of Rubisco (µmol diff --git a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst index cafba90dc3..e6b2222c75 100644 --- a/doc/source/tech_note/References/CLM50_Tech_Note_References.rst +++ b/doc/source/tech_note/References/CLM50_Tech_Note_References.rst @@ -536,6 +536,15 @@ correspond with changes in labile organic C fractions in soil amended with :math:`{}^{14}`\ C-glucose. Soil Biology and Biochemistry, 28(4/5): 453-462. +.. _deKauwe2015: + +|br| + +de Kauwe, D.A., Kala, J., Lin, Y.-S., Pitman, A.J., Medlyn, B.E., Duursma, R.A., +Abramowitz, G., Wang, Y.-P., Miralles, D.G. 2015. A test of an optimal stomatal +conductance scheme within the CABLE land surface model. Geosci. Model Dev. +8(2):431-452. + .. _deVries1963: |br| From 91bdfba827a3b701877ed17e2b1ef5312fa5389d Mon Sep 17 00:00:00 2001 From: Danica Lombardozzi Date: Mon, 16 Jul 2018 11:12:42 -0600 Subject: [PATCH 209/730] Updated the parameter values in Table 3 of the crop chapter, and adding clarifying text to the CN pools chapter --- doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst | 3 ++- .../Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst index 14704b0b5f..9bddee21ca 100644 --- a/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst +++ b/doc/source/tech_note/CN_Pools/CLM50_Tech_Note_CN_Pools.rst @@ -54,7 +54,8 @@ Tissue Stoichiometry As of CLM5, vegetation tissues have a flexible stoichiometry, as described in :ref:`Ghimire et al. (2016) `. Each -tissue has a target C\:N ratio (see :numref:`Table Plant functional type (PFT) target CN parameters`), and nitrogen is allocated at each +tissue has a target C\:N ratio, with the target leaf C\:N varying by plant functional type +(see :numref:`Table Plant functional type (PFT) target CN parameters`), and nitrogen is allocated at each timestep in order to allow the plant to best match the target stoichiometry. Nitrogen downregulation of productivity acts by increasing the C\:N ratio of leaves when insufficient nitrogen is diff --git a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst index 8f0b975fce..3b8f07f44c 100644 --- a/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst +++ b/doc/source/tech_note/Crop_Irrigation/CLM50_Tech_Note_Crop_Irrigation.rst @@ -565,9 +565,9 @@ efficiency of 85%. \ temperate corn spring wheat temperatue soybean cotton rice sugarcane tropical corn tropical soybean =========================================== ============== ============ ================== ====== ====== ========= ============= ================ IVT 17, 18 19, 20 23, 24 41, 42 61, 62 67, 68 75, 76 77, 78 - :math:`a_{leaf}^{i}` 0.8 0.9 0.85 0.85 0.75 0.8 0.8 0.85 + :math:`a_{leaf}^{i}` 0.6 0.9 0.85 0.85 0.75 0.6 0.6 0.85 :math:`{L}_{max}` (m :sup:`2` m :sup:`-2`) 5 7 6 6 7 5 5 6 - :math:`a_{froot}^{i}` 0.4 0.1 0.2 0.2 0.1 0.4 0.4 0.2 + :math:`a_{froot}^{i}` 0.1 0.05 0.2 0.2 0.1 0.1 0.1 0.2 :math:`a_{froot}^{f}` 0.05 0 0.2 0.2 0 0.05 0.05 0.2 :math:`a_{leaf}^{f}` 0 0 0 0 0 0 0 0 :math:`a_{livestem}^{f}` 0 0.05 0.3 0.3 0.05 0 0 0.3 From 67290ab6e8b05eaad3906b103935a2fcb97894f7 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 25 Jul 2018 19:41:38 -0600 Subject: [PATCH 210/730] Updated fates default parameter file --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 78a2b10e86..1967681dc7 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c180518.nc +lnd/clm2/paramdata/fates_params_2trop.c180725.nc From cf864e3ee0665d8e039be1a063ece48a784ef872 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 5 Sep 2018 13:18:53 -0600 Subject: [PATCH 211/730] Updating default FATES parameter file path --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 1967681dc7..e065a3b41b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_2trop.c180725.nc +lnd/clm2/paramdata/fates_params_default_2trop.c180905.nc From 0a92b24e28fff7d450395b8ebe962c06999a7df3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 18 Sep 2018 18:58:23 -0700 Subject: [PATCH 212/730] Added the parteh_model index for fates --- src/main/clm_varctl.F90 | 3 +++ src/utils/clmfates_interfaceMod.F90 | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 938155c5dd..e0ae6fc0fc 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -196,6 +196,9 @@ module clm_varctl logical, public :: use_fates = .false. ! true => use fates ! These are INTERNAL to the FATES module + integer, public :: fates_parteh_model = -9 ! 1 => carbon only + ! 2 => C+N+P + ! no others enabled logical, public :: use_fates_spitfire = .false. ! true => use spitfire model logical, public :: use_fates_logging = .false. ! true => turn on logging module logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 18b0d5ca53..51921b5d25 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -43,7 +43,8 @@ module CLMFatesInterfaceMod use SoilStateType , only : soilstate_type use clm_varctl , only : iulog - use clm_varctl , only : use_vertsoilc + use clm_varctl , only : use_vertsoilc + use clm_varctl , only : fates_parteh_model use clm_varctl , only : use_fates_spitfire use clm_varctl , only : use_fates_planthydro use clm_varctl , only : use_fates_ed_st3 @@ -236,7 +237,7 @@ subroutine init(this, bounds_proc ) logical :: verbose_output integer :: pass_masterproc integer :: pass_vertsoilc - integer :: pass_spitfire + integer :: pass_spitfire integer :: pass_ed_st3 integer :: pass_ed_prescribed_phys integer :: pass_logging @@ -291,6 +292,8 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES ! AND DOESNT TOUCH ! THE BARE SOIL PATCH + call set_fates_ctrlparms('parteh_model',ival=fates_parteh_model) + if(is_restart()) then pass_is_restart = 1 From b5460a9698d5b1c4a060c3c1ab66efdb17e254ab Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 21 Sep 2018 14:16:49 -0600 Subject: [PATCH 213/730] Updated path to fates default parameter file --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index e065a3b41b..09660c4ca3 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c180905.nc +lnd/clm2/paramdata/fates_params_default_2trop.c180921.nc From c33cc3f7da23e03e025685fb9e7d3f50473ad4df Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 24 Sep 2018 12:43:19 -0700 Subject: [PATCH 214/730] Added call to initialize the PARTEH global mappings in FATES --- src/utils/clmfates_interfaceMod.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 51921b5d25..525a796c4a 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -102,6 +102,7 @@ module CLMFatesInterfaceMod use FatesInterfaceMod , only : allocate_bcout use FatesInterfaceMod , only : SetFatesTime use FatesInterfaceMod , only : set_fates_ctrlparms + use FatesInterfaceMod , only : InitPARTEHGlobals use FatesHistoryInterfaceMod, only : fates_history_interface_type use FatesRestartInterfaceMod, only : fates_restart_interface_type @@ -463,6 +464,7 @@ subroutine init(this, bounds_proc ) end do + ! Initialize site-level static quantities dictated by the HLM ! currently ground layering depth @@ -494,8 +496,17 @@ subroutine init(this, bounds_proc ) end do !$OMP END PARALLEL DO + + ! This will initialize all globals associated with the chosen + ! Plant Allocation and Reactive Transport hypothesis. This includes + ! mapping tables and global variables. These will be read-only + ! and only required once per machine instance (thus no requirements + ! to have it instanced on each thread + + call InitPARTEHGlobals() + call this%init_history_io(bounds_proc) ! Report Fates Parameters (debug flag in lower level routines) From 6e4609ebc76f28c1ed9ea7d328b3ba5a6ce14db9 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 24 Sep 2018 15:55:36 -0700 Subject: [PATCH 215/730] Updated the externals definition for most up-to-date fates tag --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index a5da56b1eb..b99ec27b9e 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.14.0_api.4.0.0 +tag = sci.1.16.1_api.4.1.0 required = True [PTCLM] From c8f0646579856150275a0af67c1566ffec10101a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 Sep 2018 18:17:40 -0700 Subject: [PATCH 216/730] Added the parteh subfolder to fates --- bld/configure | 1 + cime_config/buildlib | 1 + 2 files changed, 2 insertions(+) diff --git a/bld/configure b/bld/configure index fb5fe9bf7f..1343f3afd4 100755 --- a/bld/configure +++ b/bld/configure @@ -670,6 +670,7 @@ sub write_filepath_cesmbld "fates/biogeophys", "fates/biogeochem", "fates/fire", + "fates/parteh", "utils", "cpl" ); diff --git a/cime_config/buildlib b/cime_config/buildlib index 6b86bb0b65..cc80f4093f 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -81,6 +81,7 @@ def _main_func(): os.path.join(lnd_root,"src","fates","biogeophys"), os.path.join(lnd_root,"src","fates","biogeochem"), os.path.join(lnd_root,"src","fates","fire"), + os.path.join(lnd_root,"src","fates","parteh"), os.path.join(lnd_root,"src","utils"), os.path.join(lnd_root,"src","cpl")] with open(filepath_file, "w") as filepath: From 6558a142c7560fd7910c4fb55621fb583cc70cad Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 28 Sep 2018 14:59:43 -0700 Subject: [PATCH 217/730] Added fates_parteh_mode to more nl memory structures. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 1 + bld/namelist_files/namelist_definition_clm4_5.xml | 5 +++++ src/main/clm_varctl.F90 | 2 +- src/main/controlMod.F90 | 5 ++++- src/utils/clmfates_interfaceMod.F90 | 5 ++--- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 1967681dc7..ae837c09e6 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2415,5 +2415,6 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc.false. .false. .false. +1 diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 44b98a18b4..51459be47f 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -596,6 +596,11 @@ Toggle to turn on the FATES model (use_fates= '.true.' is EXPERIMENTAL NOT SUPPORTED!) + +Switch deciding which nutrient model to use in FATES. + + Toggle to turn on spitfire module for modeling fire (only relevant if FATES is being used). diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index e0ae6fc0fc..f3938af858 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -196,7 +196,7 @@ module clm_varctl logical, public :: use_fates = .false. ! true => use fates ! These are INTERNAL to the FATES module - integer, public :: fates_parteh_model = -9 ! 1 => carbon only + integer, public :: fates_parteh_mode = -9 ! 1 => carbon only ! 2 => C+N+P ! no others enabled logical, public :: use_fates_spitfire = .false. ! true => use spitfire model diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 9cc442d026..91f10e2828 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -216,7 +216,8 @@ subroutine control_init( ) use_fates_planthydro, use_fates_ed_st3, & use_fates_ed_prescribed_phys, & use_fates_inventory_init, & - fates_inventory_ctrl_filename + fates_inventory_ctrl_filename, & + fates_parteh_mode ! CLM 5.0 nitrogen flags @@ -630,6 +631,7 @@ subroutine control_spmd() call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) ! flexibleCN nitrogen model call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -956,6 +958,7 @@ subroutine control_print () write(iulog, *) ' use_fates_spitfire = ', use_fates_spitfire write(iulog, *) ' use_fates_logging = ', use_fates_logging write(iulog, *) ' fates_paramfile = ', fates_paramfile + write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3 write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 525a796c4a..a8fa67f48e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -44,7 +44,7 @@ module CLMFatesInterfaceMod use SoilStateType , only : soilstate_type use clm_varctl , only : iulog use clm_varctl , only : use_vertsoilc - use clm_varctl , only : fates_parteh_model + use clm_varctl , only : fates_parteh_mode use clm_varctl , only : use_fates_spitfire use clm_varctl , only : use_fates_planthydro use clm_varctl , only : use_fates_ed_st3 @@ -293,7 +293,7 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES ! AND DOESNT TOUCH ! THE BARE SOIL PATCH - call set_fates_ctrlparms('parteh_model',ival=fates_parteh_model) + call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) if(is_restart()) then @@ -463,7 +463,6 @@ subroutine init(this, bounds_proc ) this%fates(nc)%sites(s)%lon = grc%londeg(g) end do - ! Initialize site-level static quantities dictated by the HLM From e38b7256f1d02320bad1394ae198067c463203be Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 Sep 2018 18:17:40 -0700 Subject: [PATCH 218/730] Added the parteh subfolder to fates --- bld/configure | 1 + cime_config/buildlib | 1 + 2 files changed, 2 insertions(+) diff --git a/bld/configure b/bld/configure index fb5fe9bf7f..1343f3afd4 100755 --- a/bld/configure +++ b/bld/configure @@ -670,6 +670,7 @@ sub write_filepath_cesmbld "fates/biogeophys", "fates/biogeochem", "fates/fire", + "fates/parteh", "utils", "cpl" ); diff --git a/cime_config/buildlib b/cime_config/buildlib index 6b86bb0b65..cc80f4093f 100755 --- a/cime_config/buildlib +++ b/cime_config/buildlib @@ -81,6 +81,7 @@ def _main_func(): os.path.join(lnd_root,"src","fates","biogeophys"), os.path.join(lnd_root,"src","fates","biogeochem"), os.path.join(lnd_root,"src","fates","fire"), + os.path.join(lnd_root,"src","fates","parteh"), os.path.join(lnd_root,"src","utils"), os.path.join(lnd_root,"src","cpl")] with open(filepath_file, "w") as filepath: From 65270086002cde0cb933429e6ebd8f6c6d0903da Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 18 Sep 2018 18:58:23 -0700 Subject: [PATCH 219/730] Added the parteh_model index for fates --- src/main/clm_varctl.F90 | 3 +++ src/utils/clmfates_interfaceMod.F90 | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 938155c5dd..e0ae6fc0fc 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -196,6 +196,9 @@ module clm_varctl logical, public :: use_fates = .false. ! true => use fates ! These are INTERNAL to the FATES module + integer, public :: fates_parteh_model = -9 ! 1 => carbon only + ! 2 => C+N+P + ! no others enabled logical, public :: use_fates_spitfire = .false. ! true => use spitfire model logical, public :: use_fates_logging = .false. ! true => turn on logging module logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 18b0d5ca53..51921b5d25 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -43,7 +43,8 @@ module CLMFatesInterfaceMod use SoilStateType , only : soilstate_type use clm_varctl , only : iulog - use clm_varctl , only : use_vertsoilc + use clm_varctl , only : use_vertsoilc + use clm_varctl , only : fates_parteh_model use clm_varctl , only : use_fates_spitfire use clm_varctl , only : use_fates_planthydro use clm_varctl , only : use_fates_ed_st3 @@ -236,7 +237,7 @@ subroutine init(this, bounds_proc ) logical :: verbose_output integer :: pass_masterproc integer :: pass_vertsoilc - integer :: pass_spitfire + integer :: pass_spitfire integer :: pass_ed_st3 integer :: pass_ed_prescribed_phys integer :: pass_logging @@ -291,6 +292,8 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES ! AND DOESNT TOUCH ! THE BARE SOIL PATCH + call set_fates_ctrlparms('parteh_model',ival=fates_parteh_model) + if(is_restart()) then pass_is_restart = 1 From 061d34fef39a1b5a6a114fedaa37f20de926ebde Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 24 Sep 2018 12:43:19 -0700 Subject: [PATCH 220/730] Added call to initialize the PARTEH global mappings in FATES --- src/utils/clmfates_interfaceMod.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 51921b5d25..525a796c4a 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -102,6 +102,7 @@ module CLMFatesInterfaceMod use FatesInterfaceMod , only : allocate_bcout use FatesInterfaceMod , only : SetFatesTime use FatesInterfaceMod , only : set_fates_ctrlparms + use FatesInterfaceMod , only : InitPARTEHGlobals use FatesHistoryInterfaceMod, only : fates_history_interface_type use FatesRestartInterfaceMod, only : fates_restart_interface_type @@ -463,6 +464,7 @@ subroutine init(this, bounds_proc ) end do + ! Initialize site-level static quantities dictated by the HLM ! currently ground layering depth @@ -494,8 +496,17 @@ subroutine init(this, bounds_proc ) end do !$OMP END PARALLEL DO + + ! This will initialize all globals associated with the chosen + ! Plant Allocation and Reactive Transport hypothesis. This includes + ! mapping tables and global variables. These will be read-only + ! and only required once per machine instance (thus no requirements + ! to have it instanced on each thread + + call InitPARTEHGlobals() + call this%init_history_io(bounds_proc) ! Report Fates Parameters (debug flag in lower level routines) From c8707b198c3d7c7255db6dcba1d95e4d2ce14208 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 28 Sep 2018 14:59:43 -0700 Subject: [PATCH 221/730] Added fates_parteh_mode to more nl memory structures. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 1 + bld/namelist_files/namelist_definition_clm4_5.xml | 5 +++++ src/main/clm_varctl.F90 | 2 +- src/main/controlMod.F90 | 5 ++++- src/utils/clmfates_interfaceMod.F90 | 5 ++--- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 09660c4ca3..2716dde51e 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2415,5 +2415,6 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc.false. .false. .false. +1 diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 44b98a18b4..51459be47f 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -596,6 +596,11 @@ Toggle to turn on the FATES model (use_fates= '.true.' is EXPERIMENTAL NOT SUPPORTED!) + +Switch deciding which nutrient model to use in FATES. + + Toggle to turn on spitfire module for modeling fire (only relevant if FATES is being used). diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index e0ae6fc0fc..f3938af858 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -196,7 +196,7 @@ module clm_varctl logical, public :: use_fates = .false. ! true => use fates ! These are INTERNAL to the FATES module - integer, public :: fates_parteh_model = -9 ! 1 => carbon only + integer, public :: fates_parteh_mode = -9 ! 1 => carbon only ! 2 => C+N+P ! no others enabled logical, public :: use_fates_spitfire = .false. ! true => use spitfire model diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 9cc442d026..91f10e2828 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -216,7 +216,8 @@ subroutine control_init( ) use_fates_planthydro, use_fates_ed_st3, & use_fates_ed_prescribed_phys, & use_fates_inventory_init, & - fates_inventory_ctrl_filename + fates_inventory_ctrl_filename, & + fates_parteh_mode ! CLM 5.0 nitrogen flags @@ -630,6 +631,7 @@ subroutine control_spmd() call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) ! flexibleCN nitrogen model call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -956,6 +958,7 @@ subroutine control_print () write(iulog, *) ' use_fates_spitfire = ', use_fates_spitfire write(iulog, *) ' use_fates_logging = ', use_fates_logging write(iulog, *) ' fates_paramfile = ', fates_paramfile + write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3 write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 525a796c4a..a8fa67f48e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -44,7 +44,7 @@ module CLMFatesInterfaceMod use SoilStateType , only : soilstate_type use clm_varctl , only : iulog use clm_varctl , only : use_vertsoilc - use clm_varctl , only : fates_parteh_model + use clm_varctl , only : fates_parteh_mode use clm_varctl , only : use_fates_spitfire use clm_varctl , only : use_fates_planthydro use clm_varctl , only : use_fates_ed_st3 @@ -293,7 +293,7 @@ subroutine init(this, bounds_proc ) call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES ! AND DOESNT TOUCH ! THE BARE SOIL PATCH - call set_fates_ctrlparms('parteh_model',ival=fates_parteh_model) + call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) if(is_restart()) then @@ -463,7 +463,6 @@ subroutine init(this, bounds_proc ) this%fates(nc)%sites(s)%lon = grc%londeg(g) end do - ! Initialize site-level static quantities dictated by the HLM From bd6b414c2cbfd288d7c447f3234493825dc64c86 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 3 Oct 2018 16:50:25 -0700 Subject: [PATCH 222/730] Added fates_parteh_mode to the default build sequence for fates. --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 00807d049c..5f3f887499 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -774,7 +774,7 @@ sub setup_cmdl_fates_mode { } else { # dis-allow fates specific namelist items with non-fates runs my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init", "fates_inventory_ctrl_filename","use_fates_logging" ); + "use_fates_inventory_init", "fates_inventory_ctrl_filename","use_fates_logging","fates_parteh_mode" ); foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { $log->fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n"); @@ -3732,7 +3732,7 @@ sub setup_logic_fates { if ($physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true( $nl_flags->{'use_fates'}) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init", "use_fates_logging" ); + "use_fates_inventory_init", "use_fates_logging","fates_parteh_mode" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} ); } From f0470d196adc5a5472bd600905dc475a09489f8a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 23 Oct 2018 11:01:52 -0600 Subject: [PATCH 223/730] Updated test lists for fates-parteh changes. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- .../testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm | 6 +++--- src/main/clm_varctl.F90 | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 2716dde51e..a92be319dc 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c180921.nc +lnd/clm2/paramdata/fates_params_default_2trop.c181022.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index 38ff54ebf1..66c94f3cc2 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -19,12 +19,12 @@ hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE',' 'YESTERDAYCANLEV_UNDERSTORY_SCLS','BA_SCLS','DEMOTION_RATE_SCLS','PROMOTION_RATE_SCLS','NPLANT_CANOPY_SCLS', 'MORTALITY_CANOPY_SCLS','NPLANT_UNDERSTORY_SCLS','MORTALITY_UNDERSTORY_SCLS','TRIMMING_CANOPY_SCLS','TRIMMING_UNDERSTORY_SCLS', 'CROWN_AREA_CANOPY_SCLS','CROWN_AREA_UNDERSTORY_SCLS','LEAF_MD_CANOPY_SCLS','ROOT_MD_CANOPY_SCLS','CARBON_BALANCE_CANOPY_SCLS', - 'SEED_PROD_CANOPY_SCLS','DBALIVEDT_CANOPY_SCLS','DBDEADDT_CANOPY_SCLS','DBSTOREDT_CANOPY_SCLS','STORAGE_FLUX_CANOPY_SCLS', + 'SEED_PROD_CANOPY_SCLS', 'NPP_LEAF_CANOPY_SCLS','NPP_FROOT_CANOPY_SCLS','NPP_BSW_CANOPY_SCLS','NPP_BDEAD_CANOPY_SCLS','NPP_BSEED_CANOPY_SCLS', 'NPP_STORE_CANOPY_SCLS','RDARK_CANOPY_SCLS','LIVESTEM_MR_CANOPY_SCLS','LIVECROOT_MR_CANOPY_SCLS','FROOT_MR_CANOPY_SCLS', 'RESP_G_CANOPY_SCLS','RESP_M_CANOPY_SCLS','LEAF_MD_UNDERSTORY_SCLS','ROOT_MD_UNDERSTORY_SCLS','CARBON_BALANCE_UNDERSTORY_SCLS', - 'SEED_PROD_UNDERSTORY_SCLS','DBALIVEDT_UNDERSTORY_SCLS','DBDEADDT_UNDERSTORY_SCLS','DBSTOREDT_UNDERSTORY_SCLS', - 'STORAGE_FLUX_UNDERSTORY_SCLS','NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', + 'SEED_PROD_UNDERSTORY_SCLS', + 'NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', 'NPP_BDEAD_UNDERSTORY_SCLS','NPP_BSEED_UNDERSTORY_SCLS','NPP_STORE_UNDERSTORY_SCLS','RDARK_UNDERSTORY_SCLS', 'LIVESTEM_MR_UNDERSTORY_SCLS','LIVECROOT_MR_UNDERSTORY_SCLS','FROOT_MR_UNDERSTORY_SCLS','RESP_G_UNDERSTORY_SCLS', 'RESP_M_UNDERSTORY_SCLS' diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index f3938af858..b0e93f2f9d 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -197,7 +197,7 @@ module clm_varctl ! These are INTERNAL to the FATES module integer, public :: fates_parteh_mode = -9 ! 1 => carbon only - ! 2 => C+N+P + ! 2 => C+N+P (not enabled yet) ! no others enabled logical, public :: use_fates_spitfire = .false. ! true => use spitfire model logical, public :: use_fates_logging = .false. ! true => turn on logging module From 50294d456f2178365d2302e0a037ed8081e8568b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 24 Oct 2018 13:02:05 -0700 Subject: [PATCH 224/730] Updated FATES to the PARTEH release tag. Major API change. --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index b99ec27b9e..6285df42b0 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.16.1_api.4.1.0 +tag = sci.1.17.0_api.5.0.0 required = True [PTCLM] From 46895e99761782f223e1c67ad22633a0e043cdb6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 16 Oct 2018 17:28:44 -0700 Subject: [PATCH 225/730] Added a call in the interface that updates some fates internal data structures following restart --- src/utils/clmfates_interfaceMod.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index a8fa67f48e..61e9e7d3d1 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1138,12 +1138,23 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%bc_in(s) ) end do + ! ------------------------------------------------------------------------ ! Update diagnostics of FATES ecosystem structure used in HLM. ! ------------------------------------------------------------------------ call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & waterstate_inst,canopystate_inst,frictionvel_inst) + + ! ------------------------------------------------------------------------ + ! Update the 3D patch level radiation absorption fractions + ! ------------------------------------------------------------------------ + call this%fates_restart%update_3dpatch_radiation(nc, & + this%fates(nc)%nsites, & + this%fates(nc)%sites, & + this%fates(nc)%bc_out) + + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ From 8e56e1650a0a701998dc01a973beae28d3394379 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 6 Nov 2018 13:43:36 -0500 Subject: [PATCH 226/730] Updated fates external tag --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 6285df42b0..37766d222e 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.17.0_api.5.0.0 +tag = sci.1.17.1_api.6.0.0 required = True [PTCLM] From 6a09bdff31ada8e3a77560dbe378830a99a1b861 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Nov 2018 14:27:50 -0800 Subject: [PATCH 227/730] Updated interface to accomodate fixes to fates-hydro --- src/utils/clmfates_interfaceMod.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 61e9e7d3d1..f8be142557 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -224,7 +224,7 @@ subroutine init(this, bounds_proc ) ! --------------------------------------------------------------------------------- use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters - use FatesInterfaceMod, only : numpft_ed => numpft + use FatesInterfaceMod, only : numpft_fates => numpft use FatesParameterDerivedMod, only : param_derived implicit none @@ -263,7 +263,7 @@ subroutine init(this, bounds_proc ) ! Parameter Routines - call param_derived%Init( numpft_ed ) + call param_derived%Init( numpft_fates ) verbose_output = .false. @@ -471,7 +471,7 @@ subroutine init(this, bounds_proc ) call this%init_soil_depths(nc) if (use_fates_planthydro) then - call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in) + call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in,numpft_fates) end if if( this%fates(nc)%nsites == 0 ) then @@ -2423,7 +2423,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesInterfaceMod, only : nlevheight use EDtypesMod, only : nfsc, ncwd use EDtypesMod, only : nlevleaf, nclmax - use FatesInterfaceMod, only : numpft_ed => numpft + use FatesInterfaceMod, only : numpft_fates => numpft use clm_varpar, only : nlevgrnd implicit none @@ -2444,13 +2444,13 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%ground_end = nlevgrnd fates%sizepft_class_begin = 1 - fates%sizepft_class_end = nlevsclass * numpft_ed + fates%sizepft_class_end = nlevsclass * numpft_fates fates%size_class_begin = 1 fates%size_class_end = nlevsclass fates%pft_class_begin = 1 - fates%pft_class_end = numpft_ed + fates%pft_class_end = numpft_fates fates%age_class_begin = 1 fates%age_class_end = nlevage @@ -2462,10 +2462,10 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%sizeage_class_end = nlevsclass * nlevage fates%agepft_class_begin = 1 - fates%agepft_class_end = nlevage * numpft_ed + fates%agepft_class_end = nlevage * numpft_fates fates%sizeagepft_class_begin = 1 - fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_ed + fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_fates fates%fuel_begin = 1 fates%fuel_end = nfsc @@ -2480,7 +2480,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%cnlf_end = nlevleaf * nclmax fates%cnlfpft_begin = 1 - fates%cnlfpft_end = nlevleaf * nclmax * numpft_ed + fates%cnlfpft_end = nlevleaf * nclmax * numpft_fates end subroutine hlm_bounds_to_fates_bounds From 3ffb360276408a164222018b96092f0e45d5fe31 Mon Sep 17 00:00:00 2001 From: Peter Lawrence Date: Thu, 8 Nov 2018 15:34:46 -0700 Subject: [PATCH 228/730] The logic of mksurfdata_map has been updated to include the glaciers as well as lakes and wetlands outside of the landmask with new code: < ! Assume wetland, glacier and/or lake when dataset landmask implies ocean < if (pctgla(n) < 1.e-6_r8) then < pctwet(n) = 100._r8 - pctlak(n) < pctgla(n) = 0._r8 < else < pctwet(n) = 100._r8 - pctgla(n) - pctlak(n) < end if from > ! Assume wetland and/or lake when dataset landmask implies ocean > pctwet(n) = 100._r8 - pctlak(n) > pctgla(n) = 0._r8 --- tools/mksurfdata_map/src/mksurfdat.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 5089fabf7d..b7ee945511 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -704,16 +704,20 @@ program mksurfdat do n = 1,ns_o - ! Assume wetland and/or lake when dataset landmask implies ocean + ! Assume wetland, glacier and/or lake when dataset landmask implies ocean ! (assume medium soil color (15) and loamy texture). ! Also set pftdata_mask here if (pctlnd_pft(n) < 1.e-6_r8) then pftdata_mask(n) = 0 soicol(n) = 15 - pctwet(n) = 100._r8 - pctlak(n) + if (pctgla(n) < 1.e-6_r8) then + pctwet(n) = 100._r8 - pctlak(n) + pctgla(n) = 0._r8 + else + pctwet(n) = 100._r8 - pctgla(n) - pctlak(n) + end if pcturb(n) = 0._r8 - pctgla(n) = 0._r8 call pctnatpft(n)%set_pct_l2g(0._r8) call pctcft(n)%set_pct_l2g(0._r8) pctsand(n,:) = 43._r8 From 6368933982651bedf40aeeb797eeeafe71f72dc5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 14 Nov 2018 14:06:07 -0700 Subject: [PATCH 229/730] Changes so that sim_year=PtVg can be done for mksurfdata.pl --- bld/CLMBuildNamelist.pm | 2 +- .../namelist_defaults_clm4_5_tools.xml | 10 ++++++++++ .../namelist_definition_clm4_5.xml | 7 ++++--- tools/mksurfdata_map/mksurfdata.pl | 18 +++++++++--------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 46840cdaf7..492b6170cb 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -75,7 +75,7 @@ REQUIRED OPTIONS "-res list" to list valid resolutions. (default: 0.9x1.25) -sim_year "year" Year to simulate for input datasets - (i.e. 1850, 2000, 2010, 1850-2000, 1850-2100) + (i.e. PtVg, 1850, 2000, 2010, 1850-2000, 1850-2100) "-sim_year list" to list valid simulation years (default 2000) OPTIONS diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 0683f52b88..a3126ace12 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -623,6 +623,16 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2015.c170629.nc + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.simyrPtVg.c181106/mksrf_landuse_potvegclm50_LUH2.c181106.nc + + + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 09af1a1756..f83b973b1f 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1801,12 +1801,13 @@ to run with a different type of atmospheric forcing. If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - +"PtVg,1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1955,1965,1975,1980,1985,1995,2000,2005,2010,2015,2025,2035,2045,2055,2065,2075,2085,2095,2105"> Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year greater than 2005 corresponds to rcp scenario data +A sim_year greater than 2015 corresponds to rcp scenario data +A sim_year of PtVg refers to the Potential Vegetation dataset, that doesn't include human influences Most years are only used for clm_tools and there aren't CLM datasets that correspond to them. CLM datasets exist for years: 1000 (for testing), 1850, and 2000 diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index f0589d8437..dbdbc59c55 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -267,10 +267,10 @@ sub write_transient_timeseries_file { $fh_landuse_timeseries->open( ">$landuse_timeseries_text_file" ) or die "** can't open file: $landuse_timeseries_text_file\n"; print "Writing out landuse_timeseries text file: $landuse_timeseries_text_file\n"; for( my $yr = $sim_yr0; $yr <= $sim_yrn; $yr++ ) { - my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year=$yr,ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year='$yr',ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $vegtypyr ); printf $fh_landuse_timeseries $dynpft_format, $vegtypyr, $yr; - my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year=$yr,ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year='$yr',ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $hrvtypyr ); printf $fh_landuse_timeseries $dynpft_format, $hrvtypyr, $yr; if ( $yr % 100 == 0 ) { @@ -519,7 +519,7 @@ sub write_namelist_file { } } else { # single year. - if ( ! $definition->is_valid_value( "sim_year", $sim_year ) ) { + if ( ! $definition->is_valid_value( "sim_year", "'$sim_year'" ) ) { print "** Invalid simulation year: $sim_year\n"; usage(); } @@ -697,7 +697,7 @@ sub write_namelist_file { # # Skip if urban unless sim_year=2000 # - if ( $urb_pt && $sim_year != 2000 ) { + if ( $urb_pt && $sim_year ne '2000' ) { print "For urban -- skip this simulation year = $sim_year\n"; next SIM_YEAR; } @@ -721,15 +721,15 @@ sub write_namelist_file { $transient = 1; } # determine simulation year to use for the surface dataset: - my $sim_yr_surfdat = $sim_yr0; + my $sim_yr_surfdat = "$sim_yr0"; - my $cmd = "$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year=${sim_yr_surfdat}$mkcrop -var mksrf_fvegtyp -namelist clmexp"; + my $cmd = "$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year='${sim_yr_surfdat}'$mkcrop -var mksrf_fvegtyp -namelist clmexp"; my $vegtyp = `$cmd`; chomp( $vegtyp ); if ( $vegtyp eq "" ) { die "** trouble getting vegtyp file with: $cmd\n"; } - my $cmd = "$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year=${sim_yr_surfdat}$mkcrop -var mksrf_fvegtyp -namelist clmexp"; + my $cmd = "$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year='${sim_yr_surfdat}'$mkcrop -var mksrf_fvegtyp -namelist clmexp"; my $hrvtyp = `$cmd`; chomp( $hrvtyp ); if ( $hrvtyp eq "" ) { @@ -743,8 +743,8 @@ sub write_namelist_file { if ( $mkcrop ne "" ) { $options = "-options $mkcrop"; } - $desc = sprintf( "%s_%s_%s_simyr%4.4d-%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); - $desc_surfdat = sprintf( "%s_%s_%s_simyr%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); + $desc = sprintf( "%s_%s_%s_simyr%s-%4.4d", $ssp_rcp, $crpdes, $cmip_series, $sim_yr0, $sim_yrn ); + $desc_surfdat = sprintf( "%s_%s_%s_simyr%s", $ssp_rcp, $crpdes, $cmip_series, $sim_yr_surfdat ); my $fsurdat_fname_base = ""; my $fsurdat_fname = ""; From 510665862a3dadbdb658cabe7391422486b805c8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 14 Nov 2018 18:34:45 -0700 Subject: [PATCH 230/730] Get working for main build-namelist --- bld/CLMBuildNamelist.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 492b6170cb..36b06f9c76 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1219,19 +1219,19 @@ sub setup_cmdl_simulation_year { } $nl_flags->{'sim_year_range'} = $defaults->get_value("sim_year_range"); - $nl_flags->{'sim_year'} = $val; + $nl_flags->{'sim_year'} = &remove_leading_and_trailing_quotes($val); if ( $val =~ /([0-9]+)-([0-9]+)/ ) { $nl_flags->{'sim_year'} = $1; $nl_flags->{'sim_year_range'} = $val; } $val = $nl_flags->{'sim_year'}; my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val ); + $nl->set_variable_value($group, $var, "'$val'" ); if ( ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) { my @valid_values = $definition->get_valid_values( $var ); $log->fatal_error("$var of $val is NOT valid. Valid values are: @valid_values"); } - $nl->set_variable_value($group, $var, $val ); + $nl->set_variable_value($group, $var, "'$val'" ); $log->verbose_message("CLM sim_year is $nl_flags->{'sim_year'}"); $var = "sim_year_range"; From 00de9465e483cb28439086cba88881a84817277d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 14 Nov 2018 18:52:10 -0800 Subject: [PATCH 231/730] Added a call to fates interface to process derived plant hydraulics info after key variables have been read in from restarts --- src/utils/clmfates_interfaceMod.F90 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index f8be142557..7cdd470397 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -128,6 +128,7 @@ module CLMFatesInterfaceMod use FatesPlantHydraulicsMod, only : HydrSiteColdStart use FatesPlantHydraulicsMod, only : InitHydrSites use FatesPlantHydraulicsMod, only : UpdateH2OVeg + use FatesPlantHydraulicsMod, only : RestartHydrStates implicit none @@ -1138,6 +1139,16 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%bc_in(s) ) end do + ! ------------------------------------------------------------------------ + ! Re-populate all the hydraulics variables that are dependent + ! on the key hydro state variables and plant carbon/geometry + ! ------------------------------------------------------------------------ + if (use_fates_planthydro) then + call RestartHydrStates(this%fates(nc)%sites, & + this%fates(nc)%nsites, & + this%fates(nc)%bc_in, & + this%fates(nc)%bc_out) + end if ! ------------------------------------------------------------------------ ! Update diagnostics of FATES ecosystem structure used in HLM. @@ -1148,12 +1159,11 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! ------------------------------------------------------------------------ ! Update the 3D patch level radiation absorption fractions ! ------------------------------------------------------------------------ - call this%fates_restart%update_3dpatch_radiation(nc, & - this%fates(nc)%nsites, & + call this%fates_restart%update_3dpatch_radiation(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_out) - + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics From c75f79e06fbb1829f6128b7a76e8314e4fdf0e93 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 16 Nov 2018 18:22:46 -0800 Subject: [PATCH 232/730] Removed unnecessary logic on use_fates_planthydro --- src/utils/clmfates_interfaceMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 7cdd470397..b8d579f909 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1227,6 +1227,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins ! Called prior to init_patches(). Site level rhizosphere shells must ! be set prior to cohort initialization. ! ---------------------------------------------------------------------------- + if (use_fates_planthydro) then do s = 1,this%fates(nc)%nsites @@ -1258,10 +1259,10 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins eff_porosity = max(0.01_r8,soilstate_inst%watsat_col(c,j)-vol_ice) this%fates(nc)%bc_in(s)%eff_porosity_sl(j) = eff_porosity end do - + end do - if (use_fates_planthydro) call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) + call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) end if call init_patches(this%fates(nc)%nsites, this%fates(nc)%sites, & From ed90179dbb59817ef907ca5b062fae0659612122 Mon Sep 17 00:00:00 2001 From: Charles Koven Date: Sat, 17 Nov 2018 13:53:58 -0800 Subject: [PATCH 233/730] trying fo properly fix the inventory init problem --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 5f3f887499..c0c4026ce6 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3742,7 +3742,7 @@ sub setup_logic_fates { $var = "fates_inventory_ctrl_filename"; if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_inventory_init is set" ); - } elsif ( ! -f "$nl->get_value($var)" ) { + } elsif ( ! -f $nl->get_value($var) ) { $log->fatal_error("$var does NOT point to a valid filename" ); } } From 5bcfad1292339eec9ddace3dcc28a15e9e489c16 Mon Sep 17 00:00:00 2001 From: Charles Koven Date: Sat, 17 Nov 2018 14:16:21 -0800 Subject: [PATCH 234/730] fixed inventory filename issue --- bld/CLMBuildNamelist.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c0c4026ce6..f9869d05e9 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3740,10 +3740,11 @@ sub setup_logic_fates { if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { $var = "fates_inventory_ctrl_filename"; + my $fname = substr $nl->get_value($var), 1, -1; # ignore first and last positions of string because those are quote characters if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_inventory_init is set" ); - } elsif ( ! -f $nl->get_value($var) ) { - $log->fatal_error("$var does NOT point to a valid filename" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$fname does NOT point to a valid filename" ); } } } From a792bc04b151f98a282df264b7143e58e649cab8 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 19 Nov 2018 14:44:30 -0800 Subject: [PATCH 235/730] fates-hydro: modified interface to accomodate boundary conditions during restarts --- src/main/clm_instMod.F90 | 3 ++- src/utils/clmfates_interfaceMod.F90 | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 1b1b44adba..d072672bf8 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -543,7 +543,8 @@ subroutine clm_instRest(bounds, ncid, flag) call clm_fates%restart(bounds, ncid, flag=flag, & waterstate_inst=waterstate_inst, & canopystate_inst=canopystate_inst, & - frictionvel_inst=frictionvel_inst) + frictionvel_inst=frictionvel_inst, & + soilstate_inst=soilstate_inst) end if diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index b8d579f909..46714ceff8 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -908,7 +908,7 @@ end subroutine wrap_update_hlmfates_dyn ! ==================================================================================== subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & - canopystate_inst, frictionvel_inst ) + canopystate_inst, frictionvel_inst, soilstate_inst) ! --------------------------------------------------------------------------------- ! The ability to restart the model is handled through three different types of calls @@ -943,6 +943,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & type(waterstate_type) , intent(inout) :: waterstate_inst type(canopystate_type) , intent(inout) :: canopystate_inst type(frictionvel_type) , intent(inout) :: frictionvel_inst + type(soilstate_type) , intent(inout) :: soilstate_inst ! Locals type(bounds_type) :: bounds_clump @@ -954,6 +955,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & integer :: s ! Fates site index integer :: g ! grid-cell index integer :: dk_index + integer :: nlevsoil character(len=fates_long_string_length) :: ioname integer :: nvar integer :: ivar @@ -1144,6 +1146,14 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! on the key hydro state variables and plant carbon/geometry ! ------------------------------------------------------------------------ if (use_fates_planthydro) then + + do s = 1,this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = & + soilstate_inst%hksat_col(c,1:nlevsoil) + end do + call RestartHydrStates(this%fates(nc)%sites, & this%fates(nc)%nsites, & this%fates(nc)%bc_in, & From a020d276e5cc800737b6269cea16c49a5ee89129 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 3 Dec 2018 12:39:27 -0700 Subject: [PATCH 236/730] Updating default fates parameter file to accomodate new parameters for coastal grasses --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index a92be319dc..049933004c 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c181022.nc +lnd/clm2/paramdata/fates_params_default_2trop.c181203.nc From f32045cefaa64c984118ff0f255d086f06872db6 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 3 Oct 2018 12:45:15 -0600 Subject: [PATCH 237/730] Move unit test of sens_heat_from_precip_conversion to a higher level I think this will make it easier to introduce some upcoming changes that I think will require changing the interface of this routine. --- src/main/atm2lndMod.F90 | 16 +++---- src/main/test/atm2lnd_test/CMakeLists.txt | 3 +- .../atm2lnd_test/test_partition_precip.pf | 27 +++++++++--- .../test_sens_heat_from_precip_conversion.pf | 43 ------------------- 4 files changed, 31 insertions(+), 58 deletions(-) delete mode 100644 src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf diff --git a/src/main/atm2lndMod.F90 b/src/main/atm2lndMod.F90 index c54ddcd12a..eef475d589 100644 --- a/src/main/atm2lndMod.F90 +++ b/src/main/atm2lndMod.F90 @@ -31,17 +31,17 @@ module atm2lndMod ! !PUBLIC MEMBER FUNCTIONS: public :: downscale_forcings ! Downscale atm forcing fields from gridcell to column - ! The following routines are public for the sake of unit testing; they should not be + ! The following routine is public for the sake of unit testing; it should not be ! called by production code outside this module - public :: partition_precip ! Partition precipitation into rain/snow - public :: sens_heat_from_precip_conversion ! Compute sensible heat flux needed to compensate for rain-snow conversion + public :: partition_precip ! Partition precipitation into rain/snow ! ! !PRIVATE MEMBER FUNCTIONS: - private :: rhos ! calculate atmospheric density - private :: repartition_rain_snow_one_col ! Re-partition precipitation for a single column - private :: downscale_longwave ! Downscale longwave radiation from gridcell to column - private :: build_normalization ! Compute normalization factors so that downscaled fields are conservative - private :: check_downscale_consistency ! Check consistency of downscaling + private :: rhos ! calculate atmospheric density + private :: repartition_rain_snow_one_col ! Re-partition precipitation for a single column + private :: sens_heat_from_precip_conversion ! Compute sensible heat flux needed to compensate for rain-snow conversion + private :: downscale_longwave ! Downscale longwave radiation from gridcell to column + private :: build_normalization ! Compute normalization factors so that downscaled fields are conservative + private :: check_downscale_consistency ! Check consistency of downscaling character(len=*), parameter, private :: sourcefile = & __FILE__ diff --git a/src/main/test/atm2lnd_test/CMakeLists.txt b/src/main/test/atm2lnd_test/CMakeLists.txt index 018b875a27..e42192b45b 100644 --- a/src/main/test/atm2lnd_test/CMakeLists.txt +++ b/src/main/test/atm2lnd_test/CMakeLists.txt @@ -1,7 +1,6 @@ set(pfunit_sources test_downscale_forcings.pf - test_partition_precip.pf - test_sens_heat_from_precip_conversion.pf) + test_partition_precip.pf) create_pFUnit_test(atm2lnd test_atm2lnd_exe "${pfunit_sources}" "") diff --git a/src/main/test/atm2lnd_test/test_partition_precip.pf b/src/main/test/atm2lnd_test/test_partition_precip.pf index 4e996988d0..d24cc7347e 100644 --- a/src/main/test/atm2lnd_test/test_partition_precip.pf +++ b/src/main/test/atm2lnd_test/test_partition_precip.pf @@ -121,21 +121,38 @@ contains end subroutine highTemp_resultsInCorrectPartitioning @Test - subroutine intermediateTemp_resultsInCorrectPartitioning(this) + subroutine intermediateTemp_resultsInCorrectPartitioningAndHeatFlux(this) + ! Unlike other tests, where we check for either correct partitioning or correct heat + ! flux in a given test: This test checks both for convenience (to avoid duplication + ! between two tests which would require us to update both of them if the ramp for + ! rain-snow conversion changed). class(TestPartitionPrecip), intent(inout) :: this + real(r8), parameter :: rain_orig = 1._r8 + real(r8), parameter :: snow_orig = 2._r8 + real(r8) :: tot_precip + real(r8) :: expected_rain + real(r8) :: expected_snow + real(r8) :: expected_heat_flux call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[SHR_CONST_TKFRZ + 1.5_r8]) + call this%set_inputs(rain=[rain_orig], snow=[snow_orig], temperature=[SHR_CONST_TKFRZ + 1.5_r8]) call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) associate(& rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(3._r8 * 0.75_r8, rain_col(begc), tolerance=tol) - @assertEqual(3._r8 * 0.25_r8, snow_col(begc), tolerance=tol) + tot_precip = rain_orig + snow_orig + expected_rain = tot_precip * 0.75_r8 + expected_snow = tot_precip * 0.25_r8 + @assertEqual(expected_rain, rain_col(begc), tolerance=tol) + @assertEqual(expected_snow, snow_col(begc), tolerance=tol) + + ! Snow to rain extracts energy, so results in a negative heat flux to atm + expected_heat_flux = (rain_orig - expected_rain) * mm_to_m * denh2o * hfus + @assertEqual([expected_heat_flux], this%sh_from_conversion, tolerance=tol) end associate - end subroutine intermediateTemp_resultsInCorrectPartitioning + end subroutine intermediateTemp_resultsInCorrectPartitioningAndHeatFlux @Test subroutine intermediateTemp_glacier_resultsInCorrectPartitioning(this) diff --git a/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf b/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf deleted file mode 100644 index 44ca36b9ec..0000000000 --- a/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf +++ /dev/null @@ -1,43 +0,0 @@ -module test_sens_heat_from_precip_conversion - - ! Tests of atm2lndMod: sens_heat_from_precip_conversion - ! This module just tests edge cases that would be difficult to test from the - ! multi-point wrapper. - - use pfunit_mod - use atm2lndMod - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varcon, only : hfus ! latent heat of fusion for ice [J/kg] - use clm_varcon, only : denh2o ! density of liquid water [kg/m3] - - implicit none - - real(r8), parameter :: tol = 1.e-13_r8 - real(r8), parameter :: mm_to_m = 1.e-3_r8 ! multiply by this to convert from mm to m - -contains - - @Test - subroutine partialConversion_resultsInCorrectHeatFlux() - real(r8), parameter :: rain_old = 2._r8 ! [mm] - real(r8), parameter :: snow_old = 5._r8 ! [mm] - real(r8), parameter :: rain_new = 6._r8 ! [mm] - real(r8), parameter :: snow_new = 1._r8 ! [mm] - real(r8) :: sens_heat_flux ! [W/m2 to atm] - real(r8) :: expected - - call sens_heat_from_precip_conversion( & - rain_old = rain_old, & - snow_old = snow_old, & - rain_new = rain_new, & - snow_new = snow_new, & - sens_heat_flux = sens_heat_flux) - - ! Snow to rain extracts energy, so results in a negative heat flux to atm - expected = -4._r8 * mm_to_m * denh2o * hfus - @assertEqual(expected, sens_heat_flux, tolerance=tol) - - end subroutine partialConversion_resultsInCorrectHeatFlux - -end module test_sens_heat_from_precip_conversion - From 71b3a0a93d174ff13e888d7638c0729fdc8936d8 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 5 Dec 2018 09:31:47 -0700 Subject: [PATCH 238/730] Option for rain-to-snow to immediately run off in some regions Up until now: When repartition_rain_snow is .true. (which is the default for CLM5), rain that falls when the near-surface temperature is cold is converted to snow. This repartitioning was put in place for two reasons: (1) Downscaling to elevation classes: changing the balance between rain and snow for different elevation classes; (2) Correcting problems in CAM. However, members of the Land Ice Working Group would like to change this behavior so that, when CAM produces cold-temperature rain, this rain immediately runs off rather than being converted to snow. The purpose of this is to reduce the too-high SMB over portions of Greenland in CESM2 coupled runs (which results in part from CAM's generation of liquid precipitation despite very cold temperatures). This new behavior is implemented in a glacier region-specific manner, based on a new namelist flag, glacier_region_rain_to_snow_behavior. It is not at all ideal to make this aspect of the physics differ by region, but this has been requested by members of the Land Ice Working Group in order to address biases over Greenland while having minimal impact on the climate (so that the climate can stay very similar to that of the official CMIP6 runs). Note that, unlike other glacier region-specific behaviors, this one applies to all landunits, not just glaciers. This also seems a bit non-ideal, but we want the physics to be the same for all landunit types in a given region, and we also want this behavior to apply to vegetated columns because they are used for glacial inception (and we want this alternate behavior to apply to glacial inception, too, in order to decrease some instances of inception). The justification for this new physics is: In the case of (1) above: If CAM is generating rain at a given elevation / temperature, that doesn't necessarily imply that an equal water equivalent of snow would be generated at a higher elevation / lower temperature: indeed, in reality, there might not be any precipitation falling at that higher elevation / lower temperature. In the case of (2) above: There seem to be problems with CAM's microphysics that cause it to produce too much rain when temperatures are very cold; it seems (at least to some people) equally justifiable to throw this cold rain away (by sending it to the ocean as runoff) as it is to convert this cold rain to snow. Note: I don't think any changes are needed in BalanceCheck (unfortunately), since BalanceCheck currently uses the post-downscaling precipitation fluxes, and the pre-lnd2atm runoff fluxes (i.e., the new runoff flux isn't included in the terms in BalanceCheck, and it doesn't need to be because BalanceCheck uses the post-downscaling precipitation fluxes). (See also https://github.com/ESCOMP/ctsm/issues/201#issuecomment-444264954 .) --- bld/CLMBuildNamelist.pm | 1 + .../namelist_defaults_clm4_5.xml | 2 + .../namelist_definition_clm4_5.xml | 17 +++ src/biogeophys/WaterfluxType.F90 | 8 ++ src/main/atm2lndMod.F90 | 47 +++++-- src/main/clm_driver.F90 | 7 +- src/main/glcBehaviorMod.F90 | 118 +++++++++++++++--- src/main/lnd2atmMod.F90 | 12 +- .../atm2lnd_test/test_downscale_forcings.pf | 13 +- .../atm2lnd_test/test_partition_precip.pf | 98 +++++++++++++-- .../test/glcBehavior_test/test_glcBehavior.pf | 63 ++++++++-- 11 files changed, 335 insertions(+), 51 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 46840cdaf7..9cfa537ff8 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2039,6 +2039,7 @@ sub setup_logic_glacier { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_behavior'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_melt_behavior'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_ice_runoff_behavior'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_rain_to_snow_behavior'); } } diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 21809bcf9c..280217f661 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -336,6 +336,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Antarctica: remains_ice --> 'melted','melted','remains_ice','remains_ice' +'converted_to_snow','converted_to_snow','converted_to_snow','converted_to_snow' + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP26_clm5_2100.c181217.nc + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From 0fd0fa28e2cfa7d7f5181c36f13b8d225dad0837 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 19 Dec 2018 16:29:32 -0700 Subject: [PATCH 246/730] add SSP3-7.0 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 341 ++++++++++++++++++ 2 files changed, 344 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index 4a4cacc00e..176c722b34 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP1-2.6" - subdir = "pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2016-2100.c181217" + ssp_rcp = "SSP3-7.0" + subdir = "pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP1RCP26_clm5" + desc = "SSP3RCP70_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 5cb85b97d9..e04d952da9 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -974,6 +974,347 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2100.c181217.nc + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From 2f68683f04b1a7f6287e595f7453ba3e642e9abd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 20 Dec 2018 09:52:42 -0700 Subject: [PATCH 247/730] Add in SSP5-3.4 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 343 ++++++++++++++++++ 2 files changed, 346 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index 176c722b34..0b2197ea4d 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP3-7.0" - subdir = "pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217" + ssp_rcp = "SSP5-3.4" + subdir = "pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP3RCP70_clm5" + desc = "SSP5RCP34_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index e04d952da9..5561c967c6 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -1315,6 +1315,349 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2016-2100.c181217/mksrf_landuse_SSP3RCP70_clm5_2100.c181217.nc + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP5RCP34_clm5_2100.c181217.nc + + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From 357036590b9a2a5666c20c9beda4cb38e0b8db0c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 20 Dec 2018 09:55:17 -0700 Subject: [PATCH 248/730] Add SSP2-4.5 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 341 ++++++++++++++++++ 2 files changed, 344 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index 0b2197ea4d..bf8a310201 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP5-3.4" - subdir = "pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2016-2100.c181217" + ssp_rcp = "SSP2-4.5" + subdir = "pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP5RCP34_clm5" + desc = "SSP2RCP45_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 5561c967c6..50206b69ed 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -1657,6 +1657,347 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217/mksrf_landuse_SSP2RCP45_clm5_2100.c181217.nc + + Date: Thu, 20 Dec 2018 09:58:38 -0700 Subject: [PATCH 249/730] Add SSP1-1.9 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 342 ++++++++++++++++++ 2 files changed, 345 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index bf8a310201..4c8b2ed672 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP2-4.5" - subdir = "pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2016-2100.c181217" + ssp_rcp = "SSP1-1.9" + subdir = "pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP2RCP45_clm5" + desc = "SSP1RCP19_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 50206b69ed..766fda5b54 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -1999,6 +1999,348 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217/mksrf_landuse_SSP1RCP19_clm5_2100.c181217.nc + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From 523471befa0b711f53ad76ff764f639a24c651b7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 20 Dec 2018 10:01:20 -0700 Subject: [PATCH 250/730] Add SSP4-3.4 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 344 +++++++++++++++++- 2 files changed, 346 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index 4c8b2ed672..e56b6c6cd3 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP1-1.9" - subdir = "pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2016-2100.c181217" + ssp_rcp = "SSP4-3.4" + subdir = "pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP1RCP19_clm5" + desc = "SSP4RCP34_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 766fda5b54..4cef0237b1 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -2341,7 +2341,349 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP34_clm5_2100.c181217.nc + + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From 9956363875cdeb8805a052200be6e156138f1cd5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 20 Dec 2018 10:04:42 -0700 Subject: [PATCH 251/730] Add SSP4-6.0 --- bld/namelist_files/createMkSrfEntry.py | 6 +- .../namelist_defaults_clm4_5_tools.xml | 343 ++++++++++++++++++ 2 files changed, 346 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index e56b6c6cd3..462173cd9c 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -7,10 +7,10 @@ class mksrfDataEntry_prog: # Class data year_start = 2016 year_end = 2100 - ssp_rcp = "SSP4-3.4" - subdir = "pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2016-2100.c181217" + ssp_rcp = "SSP4-6.0" + subdir = "pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217" cdate = 181217 - desc = "SSP4RCP34_clm5" + desc = "SSP4RCP60_clm5" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 4cef0237b1..17ed9ba4d5 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -2683,6 +2683,349 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2016.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2017.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2018.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2019.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2020.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2021.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2022.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2023.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2024.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2025.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2026.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2027.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2028.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2029.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2030.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2031.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2032.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2033.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2034.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2035.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2036.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2037.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2038.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2039.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2040.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2041.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2042.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2043.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2044.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2045.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2046.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2047.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2048.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2049.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2050.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2051.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2052.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2053.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2054.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2055.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2056.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2057.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2058.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2059.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2060.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2061.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2062.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2063.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2064.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2065.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2066.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2067.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2068.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2069.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2070.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2071.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2072.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2073.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2074.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2075.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2076.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2077.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2078.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2079.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2080.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2081.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2082.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2083.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2084.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2085.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2086.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2087.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2088.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2089.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2090.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2091.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2092.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2093.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2094.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2095.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2096.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2097.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2098.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2099.c181217.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217/mksrf_landuse_SSP4RCP60_clm5_2100.c181217.nc + + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005/mksrf_landuse_SSP5RCP85_clm5_2016.c171005.nc From b590776a3515fae0f997c2038f05572a57749509 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 20 Dec 2018 11:16:23 -0700 Subject: [PATCH 252/730] Add in all of the SSP-RCP scenario names --- bld/namelist_files/namelist_definition_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index f83b973b1f..e3d1ed4919 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1773,7 +1773,7 @@ Representative concentration pathway for future scenarios [radiative forcing at + valid_values="hist,SSP1-2.6,SSP3-7.0,SSP5-3.4,SSP2-4.5,SSP1-1.9,SSP4-3.4,SSP4-6.0,SSP5-8.5"> Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios The form is SSPn-m.m Where n is the SSP number and m.m is RCP radiative forcing at peak or 2100 in W/m^2 n is just the whole number of the specific SSP scenario. The lower numbers have higher mitigation From c8e69e360e14148c4fecea8ece74a3c442d9b0b6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Nov 2018 14:27:50 -0800 Subject: [PATCH 253/730] Updated interface to accomodate fixes to fates-hydro --- src/utils/clmfates_interfaceMod.F90 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 61e9e7d3d1..f8be142557 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -224,7 +224,7 @@ subroutine init(this, bounds_proc ) ! --------------------------------------------------------------------------------- use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters - use FatesInterfaceMod, only : numpft_ed => numpft + use FatesInterfaceMod, only : numpft_fates => numpft use FatesParameterDerivedMod, only : param_derived implicit none @@ -263,7 +263,7 @@ subroutine init(this, bounds_proc ) ! Parameter Routines - call param_derived%Init( numpft_ed ) + call param_derived%Init( numpft_fates ) verbose_output = .false. @@ -471,7 +471,7 @@ subroutine init(this, bounds_proc ) call this%init_soil_depths(nc) if (use_fates_planthydro) then - call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in) + call InitHydrSites(this%fates(nc)%sites,this%fates(nc)%bc_in,numpft_fates) end if if( this%fates(nc)%nsites == 0 ) then @@ -2423,7 +2423,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesInterfaceMod, only : nlevheight use EDtypesMod, only : nfsc, ncwd use EDtypesMod, only : nlevleaf, nclmax - use FatesInterfaceMod, only : numpft_ed => numpft + use FatesInterfaceMod, only : numpft_fates => numpft use clm_varpar, only : nlevgrnd implicit none @@ -2444,13 +2444,13 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%ground_end = nlevgrnd fates%sizepft_class_begin = 1 - fates%sizepft_class_end = nlevsclass * numpft_ed + fates%sizepft_class_end = nlevsclass * numpft_fates fates%size_class_begin = 1 fates%size_class_end = nlevsclass fates%pft_class_begin = 1 - fates%pft_class_end = numpft_ed + fates%pft_class_end = numpft_fates fates%age_class_begin = 1 fates%age_class_end = nlevage @@ -2462,10 +2462,10 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%sizeage_class_end = nlevsclass * nlevage fates%agepft_class_begin = 1 - fates%agepft_class_end = nlevage * numpft_ed + fates%agepft_class_end = nlevage * numpft_fates fates%sizeagepft_class_begin = 1 - fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_ed + fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_fates fates%fuel_begin = 1 fates%fuel_end = nfsc @@ -2480,7 +2480,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%cnlf_end = nlevleaf * nclmax fates%cnlfpft_begin = 1 - fates%cnlfpft_end = nlevleaf * nclmax * numpft_ed + fates%cnlfpft_end = nlevleaf * nclmax * numpft_fates end subroutine hlm_bounds_to_fates_bounds From 2f42705d884017d34b5184728aee5ae29fc29a23 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 14 Nov 2018 18:52:10 -0800 Subject: [PATCH 254/730] Added a call to fates interface to process derived plant hydraulics info after key variables have been read in from restarts --- src/utils/clmfates_interfaceMod.F90 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index f8be142557..7cdd470397 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -128,6 +128,7 @@ module CLMFatesInterfaceMod use FatesPlantHydraulicsMod, only : HydrSiteColdStart use FatesPlantHydraulicsMod, only : InitHydrSites use FatesPlantHydraulicsMod, only : UpdateH2OVeg + use FatesPlantHydraulicsMod, only : RestartHydrStates implicit none @@ -1138,6 +1139,16 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%bc_in(s) ) end do + ! ------------------------------------------------------------------------ + ! Re-populate all the hydraulics variables that are dependent + ! on the key hydro state variables and plant carbon/geometry + ! ------------------------------------------------------------------------ + if (use_fates_planthydro) then + call RestartHydrStates(this%fates(nc)%sites, & + this%fates(nc)%nsites, & + this%fates(nc)%bc_in, & + this%fates(nc)%bc_out) + end if ! ------------------------------------------------------------------------ ! Update diagnostics of FATES ecosystem structure used in HLM. @@ -1148,12 +1159,11 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! ------------------------------------------------------------------------ ! Update the 3D patch level radiation absorption fractions ! ------------------------------------------------------------------------ - call this%fates_restart%update_3dpatch_radiation(nc, & - this%fates(nc)%nsites, & + call this%fates_restart%update_3dpatch_radiation(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_out) - + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics From 7728fc961f5c8e4db843ba19b56dd8abc420d93c Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 16 Nov 2018 18:22:46 -0800 Subject: [PATCH 255/730] Removed unnecessary logic on use_fates_planthydro --- src/utils/clmfates_interfaceMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 7cdd470397..b8d579f909 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1227,6 +1227,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins ! Called prior to init_patches(). Site level rhizosphere shells must ! be set prior to cohort initialization. ! ---------------------------------------------------------------------------- + if (use_fates_planthydro) then do s = 1,this%fates(nc)%nsites @@ -1258,10 +1259,10 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins eff_porosity = max(0.01_r8,soilstate_inst%watsat_col(c,j)-vol_ice) this%fates(nc)%bc_in(s)%eff_porosity_sl(j) = eff_porosity end do - + end do - if (use_fates_planthydro) call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) + call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) end if call init_patches(this%fates(nc)%nsites, this%fates(nc)%sites, & From 4835e593688b76d8508bda48a4fd2bd5cec7d7c6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 19 Nov 2018 14:44:30 -0800 Subject: [PATCH 256/730] fates-hydro: modified interface to accomodate boundary conditions during restarts --- src/main/clm_instMod.F90 | 3 ++- src/utils/clmfates_interfaceMod.F90 | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 1b1b44adba..d072672bf8 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -543,7 +543,8 @@ subroutine clm_instRest(bounds, ncid, flag) call clm_fates%restart(bounds, ncid, flag=flag, & waterstate_inst=waterstate_inst, & canopystate_inst=canopystate_inst, & - frictionvel_inst=frictionvel_inst) + frictionvel_inst=frictionvel_inst, & + soilstate_inst=soilstate_inst) end if diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index b8d579f909..46714ceff8 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -908,7 +908,7 @@ end subroutine wrap_update_hlmfates_dyn ! ==================================================================================== subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & - canopystate_inst, frictionvel_inst ) + canopystate_inst, frictionvel_inst, soilstate_inst) ! --------------------------------------------------------------------------------- ! The ability to restart the model is handled through three different types of calls @@ -943,6 +943,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & type(waterstate_type) , intent(inout) :: waterstate_inst type(canopystate_type) , intent(inout) :: canopystate_inst type(frictionvel_type) , intent(inout) :: frictionvel_inst + type(soilstate_type) , intent(inout) :: soilstate_inst ! Locals type(bounds_type) :: bounds_clump @@ -954,6 +955,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & integer :: s ! Fates site index integer :: g ! grid-cell index integer :: dk_index + integer :: nlevsoil character(len=fates_long_string_length) :: ioname integer :: nvar integer :: ivar @@ -1144,6 +1146,14 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! on the key hydro state variables and plant carbon/geometry ! ------------------------------------------------------------------------ if (use_fates_planthydro) then + + do s = 1,this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil + this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoil) = & + soilstate_inst%hksat_col(c,1:nlevsoil) + end do + call RestartHydrStates(this%fates(nc)%sites, & this%fates(nc)%nsites, & this%fates(nc)%bc_in, & From 860971fbe109cccf728a0d46a340aed73f0c62b6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 3 Dec 2018 12:35:52 -0700 Subject: [PATCH 257/730] Trying out a new hydro test --- cime_config/testdefs/testlist_clm.xml | 11 +++++++++++ .../testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 793518e7d2..fa0ad3ab56 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1870,6 +1870,17 @@ + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm index e6dd831a5f..2435b5bc7e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesHydro/user_nl_clm @@ -1,5 +1,4 @@ hist_empty_htapes = .true. -use_fates_ed_st3= .true. use_fates_planthydro= .true. hist_fincl1 = 'FATES_ERRH2O_SCPF','FATES_TRAN_SCPF','FATES_ROOTUPTAKE_SCPF','FATES_ROOTUPTAKE01_SCPF', 'FATES_SAPFLOW_COL_SCPF','FATES_ITERH1_COL_SCPF','FATES_ATH_COL_SCPF','FATES_TTH_COL_SCPF', From fd0f7aa3ac8950c1b7a28b3710a92ab21c5b1000 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 31 Dec 2018 13:15:26 -0700 Subject: [PATCH 258/730] Updated default fates parameter file to include updates to hydro --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 049933004c..247e4ca864 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c181203.nc +lnd/clm2/paramdata/fates_params_default_2trop.c181231.nc From 001470384407e72bcd17ba5fe903eab741486ac7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 2 Jan 2019 14:11:29 -0700 Subject: [PATCH 259/730] ssp_rcp had a typo of ssp-rcp, so everything came out as SSP1-2.6, correcting that now allows each one to work correctly --- tools/mksurfdata_map/mksurfdata.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index dbdbc59c55..deac02ae7c 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -267,10 +267,10 @@ sub write_transient_timeseries_file { $fh_landuse_timeseries->open( ">$landuse_timeseries_text_file" ) or die "** can't open file: $landuse_timeseries_text_file\n"; print "Writing out landuse_timeseries text file: $landuse_timeseries_text_file\n"; for( my $yr = $sim_yr0; $yr <= $sim_yrn; $yr++ ) { - my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year='$yr',ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $vegtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resol -options sim_year='$yr',ssp_rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $vegtypyr ); printf $fh_landuse_timeseries $dynpft_format, $vegtypyr, $yr; - my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year='$yr',ssp-rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; + my $hrvtypyr = `$scrdir/../../bld/queryDefaultNamelist.pl $queryfilopts $resolhrv -options sim_year='$yr',ssp_rcp=${ssp_rcp}${mkcrop} -var mksrf_fvegtyp -namelist clmexp`; chomp( $hrvtypyr ); printf $fh_landuse_timeseries $dynpft_format, $hrvtypyr, $yr; if ( $yr % 100 == 0 ) { @@ -526,12 +526,12 @@ sub write_namelist_file { } } # - # Set ssp-rcp to use + # Set ssp_rcp to use # my @rcpaths = split( ",", $opts{'ssp_rcp'} ); - # Check that ssp-rcp is valid + # Check that ssp_rcp is valid foreach my $ssp_rcp ( @rcpaths ) { - if ( ! $definition->is_valid_value( "ssp-rcp", $ssp_rcp ) ) { + if ( ! $definition->is_valid_value( "ssp_rcp", $ssp_rcp ) ) { print "** Invalid ssp_rcp: $ssp_rcp\n"; usage(); } @@ -781,7 +781,7 @@ sub write_namelist_file { $sim_yr_surfdat); print "CSMDATA is $CSMDATA \n"; - print "resolution: $res ssp-rcp=$ssp_rcp sim_year = $sim_year\n"; + print "resolution: $res ssp_rcp=$ssp_rcp sim_year = $sim_year\n"; print "namelist: $namelist_fname\n"; write_namelist_file( From d38b12c4fa3d2bea2e9adc5b003a5de16fc01343 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 6 Jan 2019 18:10:16 -0700 Subject: [PATCH 260/730] Read in new namelist item harvest_xsmrpool_2atm, and pass it around as needed --- src/biogeochem/CNCStateUpdate1Mod.F90 | 3 ++- src/biogeochem/CNDriverMod.F90 | 9 ++++---- src/biogeochem/CNVegCarbonFluxType.F90 | 3 ++- src/biogeochem/CNVegCarbonStateType.F90 | 3 ++- src/biogeochem/CNVegetationFacade.F90 | 30 ++++++++++++++++--------- src/biogeochem/EDBGCDynMod.F90 | 2 +- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 678cf79be2..c9590d37ea 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -142,7 +142,7 @@ end subroutine CStateUpdate0 !----------------------------------------------------------------------- subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) + soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) ! ! !DESCRIPTION: ! On the radiation time step, update all the prognostic carbon state @@ -158,6 +158,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst ! See note below for xsmrpool_to_atm_patch type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst + logical , intent(in) :: harvest_xsmrpool_2atm ! ! !LOCAL VARIABLES: integer :: c,p,j,k,l ! indices diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index a2823fc557..2e2b957a59 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -92,7 +92,7 @@ subroutine CNDriverNoLeaching(bounds, atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, cnfire_method) + nutrient_competition_method, cnfire_method, harvest_xsmrpool_2atm) ! ! !DESCRIPTION: ! The core CN code is executed here. Calculates fluxes for maintenance @@ -179,6 +179,7 @@ subroutine CNDriverNoLeaching(bounds, type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method class(cnfire_method_type) , intent(inout) :: cnfire_method + logical , intent(in) :: harvest_xsmrpool_2atm ! ! !LOCAL VARIABLES: real(r8):: cn_decomp_pools(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_pools) @@ -549,16 +550,16 @@ subroutine CNDriverNoLeaching(bounds, ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) + soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) if ( use_c13 ) then call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst) + c13_soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) end if if ( use_c14 ) then call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst) + c14_soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) end if ! Update all prognostic nitrogen state variables (except for gap-phase mortality and fire fluxes) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 6c78c0de54..5d20653a5a 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -391,11 +391,12 @@ module CNVegCarbonFluxType contains !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type) + subroutine Init(this, bounds, carbon_type, harvest_xsmrpool_2atm) class(cnveg_carbonflux_type) :: this type(bounds_type), intent(in) :: bounds character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] + logical , intent(in) :: harvest_xsmrpool_2atm call this%InitAllocate ( bounds, carbon_type) call this%InitHistory ( bounds, carbon_type ) diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index 7dd5a236fb..523cd7e064 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -116,13 +116,14 @@ module CNVegCarbonStateType !------------------------------------------------------------------------ subroutine Init(this, bounds, carbon_type, ratio, NLFilename, & - c12_cnveg_carbonstate_inst) + harvest_xsmrpool_2atm, c12_cnveg_carbonstate_inst) class(cnveg_carbonstate_type) :: this type(bounds_type) , intent(in) :: bounds real(r8) , intent(in) :: ratio character(len=*) , intent(in) :: carbon_type ! Carbon isotope type C12, C13 or C1 character(len=*) , intent(in) :: NLFilename ! Namelist filename + logical , intent(in) :: harvest_xsmrpool_2atm type(cnveg_carbonstate_type) , intent(in), optional :: c12_cnveg_carbonstate_inst ! cnveg_carbonstate for C12 (if C13 or C14) !----------------------------------------------------------------------- diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 1e24a98193..1db0693811 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -124,7 +124,8 @@ module CNVegetationFacade type(dgvs_type) :: dgvs_inst ! Control variables - logical, private :: reseed_dead_plants ! Flag to indicate if should reseed dead plants when starting up the model + logical, private :: reseed_dead_plants ! Flag to indicate if should reseed dead plants when starting up the model + logical, private :: harvest_xsmrpool_2atm = .False. ! Flag to indicate if should harvest xsmrpool to the atmosphere ! TODO(wjs, 2016-02-19) Evaluate whether some other variables should be moved in ! here. Whether they should be moved in depends on how tightly they are tied in with @@ -224,21 +225,24 @@ subroutine Init(this, bounds, NLFilename, nskip_steps) ! Read in the general CN namelist call this%CNReadNML( NLFilename ) ! MUST be called first as passes down control information to others - call this%cnveg_carbonstate_inst%Init(bounds, carbon_type='c12', ratio=1._r8, NLFilename=NLFilename) + call this%cnveg_carbonstate_inst%Init(bounds, carbon_type='c12', ratio=1._r8, & + NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm ) if (use_c13) then call this%c13_cnveg_carbonstate_inst%Init(bounds, carbon_type='c13', ratio=c13ratio, & - NLFilename=NLFilename, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) + NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm, & + c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) end if if (use_c14) then call this%c14_cnveg_carbonstate_inst%Init(bounds, carbon_type='c14', ratio=c14ratio, & - NLFilename=NLFilename, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) + NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm, & + c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) end if - call this%cnveg_carbonflux_inst%Init(bounds, carbon_type='c12') + call this%cnveg_carbonflux_inst%Init(bounds, carbon_type='c12', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm ) if (use_c13) then - call this%c13_cnveg_carbonflux_inst%Init(bounds, carbon_type='c13') + call this%c13_cnveg_carbonflux_inst%Init(bounds, carbon_type='c13', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm) end if if (use_c14) then - call this%c14_cnveg_carbonflux_inst%Init(bounds, carbon_type='c14') + call this%c14_cnveg_carbonflux_inst%Init(bounds, carbon_type='c14', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm) end if call this%cnveg_nitrogenstate_inst%Init(bounds, & this%cnveg_carbonstate_inst%leafc_patch(begp:endp), & @@ -295,9 +299,11 @@ subroutine CNReadNML( this, NLFilename ) character(len=*), parameter :: nmlname = 'cn_general' ! MUST match what is in namelist below !----------------------------------------------------------------------- logical :: reseed_dead_plants - namelist /cn_general/ reseed_dead_plants + logical :: harvest_xsmrpool_2atm + namelist /cn_general/ reseed_dead_plants, harvest_xsmrpool_2atm - reseed_dead_plants = this%reseed_dead_plants + reseed_dead_plants = this%reseed_dead_plants + harvest_xsmrpool_2atm = this%harvest_xsmrpool_2atm if (masterproc) then unitn = getavu() @@ -315,9 +321,11 @@ subroutine CNReadNML( this, NLFilename ) call relavu( unitn ) end if - call shr_mpi_bcast (reseed_dead_plants , mpicom) + call shr_mpi_bcast (reseed_dead_plants , mpicom) + call shr_mpi_bcast (harvest_xsmrpool_2atm , mpicom) this%reseed_dead_plants = reseed_dead_plants + this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm if (masterproc) then write(iulog,*) ' ' @@ -860,7 +868,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & this%dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, this%cnfire_method) + nutrient_competition_method, this%cnfire_method, this%harvest_xsmrpool_2atm) ! fire carbon emissions call CNFireEmisUpdate(bounds, num_soilp, filter_soilp, & diff --git a/src/biogeochem/EDBGCDynMod.F90 b/src/biogeochem/EDBGCDynMod.F90 index 107cdf91c0..ce154112b0 100644 --- a/src/biogeochem/EDBGCDynMod.F90 +++ b/src/biogeochem/EDBGCDynMod.F90 @@ -237,7 +237,7 @@ subroutine EDBGCDyn(bounds, & ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) + soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm=.False.) call t_stopf('BNGCUpdate1') From 5442c6ac74f2836b52ccd254179fed419ab7f33c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 6 Jan 2019 22:34:32 -0700 Subject: [PATCH 261/730] Add in changes so harvest_xsmrpool_2atm can be set to false, initialize the new fluxes to zero everywhere --- src/biogeochem/CNCStateUpdate1Mod.F90 | 24 ++++++++++++++++-------- src/biogeochem/CNVegCarbonFluxType.F90 | 20 ++++++++++++-------- src/biogeochem/CNVegCarbonStateType.F90 | 3 +++ 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index c9590d37ea..8311b26af8 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -484,20 +484,28 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! atmosphere solved many of the crop isotope problems ! Save xsmrpool, cpool, frootc to loss state variable for dribbling - cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & - cs_veg%xsmrpool_patch(p) + & - cs_veg%cpool_patch(p) + & - cs_veg%frootc_patch(p) + if ( .not. harvest_xsmrpool_2atm ) then + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt + else + cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & + cs_veg%xsmrpool_patch(p) + & + cs_veg%cpool_patch(p) + & + cs_veg%frootc_patch(p) + end if cs_veg%xsmrpool_patch(p) = 0._r8 cs_veg%cpool_patch(p) = 0._r8 cs_veg%frootc_patch(p) = 0._r8 end if - ! calculate flux of xsmrpool loss to atm - cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 + if ( harvest_xsmrpool_2atm ) then + ! calculate flux of xsmrpool loss to atm + cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 - ! update xsmrpool loss state - cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) - cf_veg%xsmrpool_to_atm_patch(p) * dt + ! update xsmrpool loss state + cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) - cf_veg%xsmrpool_to_atm_patch(p) * dt + end if end if diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 5d20653a5a..64dae31132 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -369,6 +369,7 @@ module CNVegCarbonFluxType ! that are dribbled throughout the year type(annual_flux_dribbler_type) :: dwt_conv_cflux_dribbler type(annual_flux_dribbler_type) :: hrv_xsmrpool_to_atm_dribbler + logical, private :: harvest_xsmrpool_2atm contains procedure , public :: Init @@ -398,6 +399,7 @@ subroutine Init(this, bounds, carbon_type, harvest_xsmrpool_2atm) character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] logical , intent(in) :: harvest_xsmrpool_2atm + this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm call this%InitAllocate ( bounds, carbon_type) call this%InitHistory ( bounds, carbon_type ) call this%InitCold (bounds ) @@ -463,7 +465,7 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%hrv_deadcrootc_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadcrootc_xfer_to_litter_patch (:) = nan allocate(this%hrv_gresp_storage_to_litter_patch (begp:endp)) ; this%hrv_gresp_storage_to_litter_patch (:) = nan allocate(this%hrv_gresp_xfer_to_litter_patch (begp:endp)) ; this%hrv_gresp_xfer_to_litter_patch (:) = nan - allocate(this%hrv_xsmrpool_to_atm_patch (begp:endp)) ; this%hrv_xsmrpool_to_atm_patch (:) = nan + allocate(this%hrv_xsmrpool_to_atm_patch (begp:endp)) ; this%hrv_xsmrpool_to_atm_patch (:) = 0.0d00 allocate(this%m_leafc_to_fire_patch (begp:endp)) ; this%m_leafc_to_fire_patch (:) = nan allocate(this%m_leafc_storage_to_fire_patch (begp:endp)) ; this%m_leafc_storage_to_fire_patch (:) = nan allocate(this%m_leafc_xfer_to_fire_patch (begp:endp)) ; this%m_leafc_xfer_to_fire_patch (:) = nan @@ -603,9 +605,9 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%cpool_grain_gr_patch (begp:endp)) ; this%cpool_grain_gr_patch (:) = nan allocate(this%cpool_grain_storage_gr_patch (begp:endp)) ; this%cpool_grain_storage_gr_patch (:) = nan allocate(this%transfer_grain_gr_patch (begp:endp)) ; this%transfer_grain_gr_patch (:) = nan - allocate(this%xsmrpool_to_atm_patch (begp:endp)) ; this%xsmrpool_to_atm_patch (:) = nan - allocate(this%xsmrpool_to_atm_col (begc:endc)) ; this%xsmrpool_to_atm_col (:) = nan - allocate(this%xsmrpool_to_atm_grc (begg:endg)) ; this%xsmrpool_to_atm_grc (:) = nan + allocate(this%xsmrpool_to_atm_patch (begp:endp)) ; this%xsmrpool_to_atm_patch (:) = 0.0d00 + allocate(this%xsmrpool_to_atm_col (begc:endc)) ; this%xsmrpool_to_atm_col (:) = 0.0d00 + allocate(this%xsmrpool_to_atm_grc (begg:endg)) ; this%xsmrpool_to_atm_grc (:) = 0.0d00 allocate(this%grainc_storage_to_xfer_patch (begp:endp)) ; this%grainc_storage_to_xfer_patch (:) = nan allocate(this%frootc_alloc_patch (begp:endp)) ; this%frootc_alloc_patch (:) = nan allocate(this%frootc_loss_patch (begp:endp)) ; this%frootc_loss_patch (:) = nan @@ -701,7 +703,7 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%fire_closs_p2c_col (begc:endc)) ; this%fire_closs_p2c_col (:) = nan allocate(this%fire_closs_col (begc:endc)) ; this%fire_closs_col (:) = nan allocate(this%wood_harvestc_col (begc:endc)) ; this%wood_harvestc_col (:) = nan - allocate(this%hrv_xsmrpool_to_atm_col (begc:endc)) ; this%hrv_xsmrpool_to_atm_col (:) = nan + allocate(this%hrv_xsmrpool_to_atm_col (begc:endc)) ; this%hrv_xsmrpool_to_atm_col (:) = 0.0d00 allocate(this%tempsum_npp_patch (begp:endp)) ; this%tempsum_npp_patch (:) = nan allocate(this%annsum_npp_patch (begp:endp)) ; this%annsum_npp_patch (:) = nan allocate(this%tempsum_litfall_patch (begp:endp)) ; this%tempsum_litfall_patch (:) = nan @@ -4126,6 +4128,8 @@ subroutine Summary_carbonflux(this, & this%ar_patch(p) = & this%mr_patch(p) + & this%gr_patch(p) + if ( .not. this%harvest_xsmrpool_2atm ) this%ar_patch(p) = this%ar_patch(p) + & + this%xsmrpool_to_atm_patch(p) ! xsmr... is -ve (slevis) else this%ar_patch(p) = & this%mr_patch(p) + & @@ -4408,7 +4412,7 @@ subroutine Summary_carbonflux(this, & this%hrv_xsmrpool_to_atm_patch(bounds%begp:bounds%endp), & this%hrv_xsmrpool_to_atm_col(bounds%begc:bounds%endc)) - if (use_crop) then + if (use_crop .and. this%harvest_xsmrpool_2atm) then call p2c(bounds, num_soilc, filter_soilc, & this%xsmrpool_to_atm_patch(bounds%begp:bounds%endp), & this%xsmrpool_to_atm_col(bounds%begc:bounds%endc)) @@ -4563,8 +4567,8 @@ subroutine Summary_carbonflux(this, & ! net biome production of carbon, positive for sink this%nbp_grc(g) = & -this%nee_grc(g) - & - this%landuseflux_grc(g) - & - this%xsmrpool_to_atm_grc(g) + this%landuseflux_grc(g) + if ( this%harvest_xsmrpool_2atm ) this%nbp_grc(g) = this%nbp_grc(g) - this%xsmrpool_to_atm_grc(g) end do ! coarse woody debris C loss diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index 523cd7e064..17fe53a021 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -84,6 +84,7 @@ module CNVegCarbonStateType real(r8), pointer :: totc_col (:) ! (gC/m2) total column carbon, incl veg and cpool real(r8), pointer :: totecosysc_col (:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool + logical, private :: harvest_xsmrpool_2atm contains procedure , public :: Init @@ -129,6 +130,8 @@ subroutine Init(this, bounds, carbon_type, ratio, NLFilename, & this%species = species_from_string(carbon_type) + this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm + call this%InitAllocate ( bounds) call this%InitReadNML ( NLFilename ) call this%InitHistory ( bounds, carbon_type) From 084919ab2243a2ab9d8e299a9d677076d827c940 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 6 Jan 2019 22:48:32 -0700 Subject: [PATCH 262/730] Add new harvest_xsmrpool_2atm namelist item --- bld/namelist_files/namelist_definition_clm4_5.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 3ea41dbacf..d1702af75d 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1969,6 +1969,11 @@ Number of days over which to use exponential relaxation of NPP in N fixation cal Flag to reseed any dead plants on startup from reading the initial conditions file + +Harvest the XSMR pool in CN to the atmosphere slowly at an exponential rate + + From 0d6507bd8f0c4cfe173d9a37a97cf0fa47a73160 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 7 Jan 2019 14:59:38 -0700 Subject: [PATCH 263/730] Change name of harvest control namelist item to dribble_crophrv_xsmrpool_2atm --- .../namelist_definition_clm4_5.xml | 4 +-- src/biogeochem/CNCStateUpdate1Mod.F90 | 8 +++--- src/biogeochem/CNDriverMod.F90 | 10 +++---- src/biogeochem/CNVegCarbonFluxType.F90 | 14 +++++----- src/biogeochem/CNVegCarbonStateType.F90 | 8 +++--- src/biogeochem/CNVegetationFacade.F90 | 26 +++++++++---------- src/biogeochem/EDBGCDynMod.F90 | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index d1702af75d..ba888e1f8e 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1969,9 +1969,9 @@ Number of days over which to use exponential relaxation of NPP in N fixation cal Flag to reseed any dead plants on startup from reading the initial conditions file - -Harvest the XSMR pool in CN to the atmosphere slowly at an exponential rate +Harvest the XSMR pool at crop harvest time to the atmosphere slowly at an exponential rate diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 8311b26af8..18076a74d0 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -142,7 +142,7 @@ end subroutine CStateUpdate0 !----------------------------------------------------------------------- subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) + soilbiogeochem_carbonflux_inst, dribble_crophrv_xsmrpool_2atm) ! ! !DESCRIPTION: ! On the radiation time step, update all the prognostic carbon state @@ -158,7 +158,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst ! See note below for xsmrpool_to_atm_patch type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - logical , intent(in) :: harvest_xsmrpool_2atm + logical , intent(in) :: dribble_crophrv_xsmrpool_2atm ! ! !LOCAL VARIABLES: integer :: c,p,j,k,l ! indices @@ -484,7 +484,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! atmosphere solved many of the crop isotope problems ! Save xsmrpool, cpool, frootc to loss state variable for dribbling - if ( .not. harvest_xsmrpool_2atm ) then + if ( .not. dribble_crophrv_xsmrpool_2atm ) then cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt @@ -499,7 +499,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%frootc_patch(p) = 0._r8 end if - if ( harvest_xsmrpool_2atm ) then + if ( dribble_crophrv_xsmrpool_2atm ) then ! calculate flux of xsmrpool loss to atm cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 2e2b957a59..94bc3f3554 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -92,7 +92,7 @@ subroutine CNDriverNoLeaching(bounds, atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, cnfire_method, harvest_xsmrpool_2atm) + nutrient_competition_method, cnfire_method, dribble_crophrv_xsmrpool_2atm) ! ! !DESCRIPTION: ! The core CN code is executed here. Calculates fluxes for maintenance @@ -179,7 +179,7 @@ subroutine CNDriverNoLeaching(bounds, type(energyflux_type) , intent(in) :: energyflux_inst class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method class(cnfire_method_type) , intent(inout) :: cnfire_method - logical , intent(in) :: harvest_xsmrpool_2atm + logical , intent(in) :: dribble_crophrv_xsmrpool_2atm ! ! !LOCAL VARIABLES: real(r8):: cn_decomp_pools(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_pools) @@ -550,16 +550,16 @@ subroutine CNDriverNoLeaching(bounds, ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) + soilbiogeochem_carbonflux_inst, dribble_crophrv_xsmrpool_2atm) if ( use_c13 ) then call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) + c13_soilbiogeochem_carbonflux_inst, dribble_crophrv_xsmrpool_2atm) end if if ( use_c14 ) then call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm) + c14_soilbiogeochem_carbonflux_inst, dribble_crophrv_xsmrpool_2atm) end if ! Update all prognostic nitrogen state variables (except for gap-phase mortality and fire fluxes) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 64dae31132..3fd276751f 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -369,7 +369,7 @@ module CNVegCarbonFluxType ! that are dribbled throughout the year type(annual_flux_dribbler_type) :: dwt_conv_cflux_dribbler type(annual_flux_dribbler_type) :: hrv_xsmrpool_to_atm_dribbler - logical, private :: harvest_xsmrpool_2atm + logical, private :: dribble_crophrv_xsmrpool_2atm contains procedure , public :: Init @@ -392,14 +392,14 @@ module CNVegCarbonFluxType contains !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type, harvest_xsmrpool_2atm) + subroutine Init(this, bounds, carbon_type, dribble_crophrv_xsmrpool_2atm) class(cnveg_carbonflux_type) :: this type(bounds_type), intent(in) :: bounds character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - logical , intent(in) :: harvest_xsmrpool_2atm + logical , intent(in) :: dribble_crophrv_xsmrpool_2atm - this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm + this%dribble_crophrv_xsmrpool_2atm = dribble_crophrv_xsmrpool_2atm call this%InitAllocate ( bounds, carbon_type) call this%InitHistory ( bounds, carbon_type ) call this%InitCold (bounds ) @@ -4128,7 +4128,7 @@ subroutine Summary_carbonflux(this, & this%ar_patch(p) = & this%mr_patch(p) + & this%gr_patch(p) - if ( .not. this%harvest_xsmrpool_2atm ) this%ar_patch(p) = this%ar_patch(p) + & + if ( .not. this%dribble_crophrv_xsmrpool_2atm ) this%ar_patch(p) = this%ar_patch(p) + & this%xsmrpool_to_atm_patch(p) ! xsmr... is -ve (slevis) else this%ar_patch(p) = & @@ -4412,7 +4412,7 @@ subroutine Summary_carbonflux(this, & this%hrv_xsmrpool_to_atm_patch(bounds%begp:bounds%endp), & this%hrv_xsmrpool_to_atm_col(bounds%begc:bounds%endc)) - if (use_crop .and. this%harvest_xsmrpool_2atm) then + if (use_crop .and. this%dribble_crophrv_xsmrpool_2atm) then call p2c(bounds, num_soilc, filter_soilc, & this%xsmrpool_to_atm_patch(bounds%begp:bounds%endp), & this%xsmrpool_to_atm_col(bounds%begc:bounds%endc)) @@ -4568,7 +4568,7 @@ subroutine Summary_carbonflux(this, & this%nbp_grc(g) = & -this%nee_grc(g) - & this%landuseflux_grc(g) - if ( this%harvest_xsmrpool_2atm ) this%nbp_grc(g) = this%nbp_grc(g) - this%xsmrpool_to_atm_grc(g) + if ( this%dribble_crophrv_xsmrpool_2atm ) this%nbp_grc(g) = this%nbp_grc(g) - this%xsmrpool_to_atm_grc(g) end do ! coarse woody debris C loss diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index 17fe53a021..b9bfae799f 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -84,7 +84,7 @@ module CNVegCarbonStateType real(r8), pointer :: totc_col (:) ! (gC/m2) total column carbon, incl veg and cpool real(r8), pointer :: totecosysc_col (:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - logical, private :: harvest_xsmrpool_2atm + logical, private :: dribble_crophrv_xsmrpool_2atm contains procedure , public :: Init @@ -117,20 +117,20 @@ module CNVegCarbonStateType !------------------------------------------------------------------------ subroutine Init(this, bounds, carbon_type, ratio, NLFilename, & - harvest_xsmrpool_2atm, c12_cnveg_carbonstate_inst) + dribble_crophrv_xsmrpool_2atm, c12_cnveg_carbonstate_inst) class(cnveg_carbonstate_type) :: this type(bounds_type) , intent(in) :: bounds real(r8) , intent(in) :: ratio character(len=*) , intent(in) :: carbon_type ! Carbon isotope type C12, C13 or C1 character(len=*) , intent(in) :: NLFilename ! Namelist filename - logical , intent(in) :: harvest_xsmrpool_2atm + logical , intent(in) :: dribble_crophrv_xsmrpool_2atm type(cnveg_carbonstate_type) , intent(in), optional :: c12_cnveg_carbonstate_inst ! cnveg_carbonstate for C12 (if C13 or C14) !----------------------------------------------------------------------- this%species = species_from_string(carbon_type) - this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm + this%dribble_crophrv_xsmrpool_2atm = dribble_crophrv_xsmrpool_2atm call this%InitAllocate ( bounds) call this%InitReadNML ( NLFilename ) diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 1db0693811..22de5bd8b6 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -125,7 +125,7 @@ module CNVegetationFacade ! Control variables logical, private :: reseed_dead_plants ! Flag to indicate if should reseed dead plants when starting up the model - logical, private :: harvest_xsmrpool_2atm = .False. ! Flag to indicate if should harvest xsmrpool to the atmosphere + logical, private :: dribble_crophrv_xsmrpool_2atm = .False. ! Flag to indicate if should harvest xsmrpool to the atmosphere ! TODO(wjs, 2016-02-19) Evaluate whether some other variables should be moved in ! here. Whether they should be moved in depends on how tightly they are tied in with @@ -226,23 +226,23 @@ subroutine Init(this, bounds, NLFilename, nskip_steps) call this%CNReadNML( NLFilename ) ! MUST be called first as passes down control information to others call this%cnveg_carbonstate_inst%Init(bounds, carbon_type='c12', ratio=1._r8, & - NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm ) + NLFilename=NLFilename, dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm ) if (use_c13) then call this%c13_cnveg_carbonstate_inst%Init(bounds, carbon_type='c13', ratio=c13ratio, & - NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm, & + NLFilename=NLFilename, dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm, & c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) end if if (use_c14) then call this%c14_cnveg_carbonstate_inst%Init(bounds, carbon_type='c14', ratio=c14ratio, & - NLFilename=NLFilename, harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm, & + NLFilename=NLFilename, dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm, & c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) end if - call this%cnveg_carbonflux_inst%Init(bounds, carbon_type='c12', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm ) + call this%cnveg_carbonflux_inst%Init(bounds, carbon_type='c12', dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm ) if (use_c13) then - call this%c13_cnveg_carbonflux_inst%Init(bounds, carbon_type='c13', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm) + call this%c13_cnveg_carbonflux_inst%Init(bounds, carbon_type='c13', dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm) end if if (use_c14) then - call this%c14_cnveg_carbonflux_inst%Init(bounds, carbon_type='c14', harvest_xsmrpool_2atm=this%harvest_xsmrpool_2atm) + call this%c14_cnveg_carbonflux_inst%Init(bounds, carbon_type='c14', dribble_crophrv_xsmrpool_2atm=this%dribble_crophrv_xsmrpool_2atm) end if call this%cnveg_nitrogenstate_inst%Init(bounds, & this%cnveg_carbonstate_inst%leafc_patch(begp:endp), & @@ -299,11 +299,11 @@ subroutine CNReadNML( this, NLFilename ) character(len=*), parameter :: nmlname = 'cn_general' ! MUST match what is in namelist below !----------------------------------------------------------------------- logical :: reseed_dead_plants - logical :: harvest_xsmrpool_2atm - namelist /cn_general/ reseed_dead_plants, harvest_xsmrpool_2atm + logical :: dribble_crophrv_xsmrpool_2atm + namelist /cn_general/ reseed_dead_plants, dribble_crophrv_xsmrpool_2atm reseed_dead_plants = this%reseed_dead_plants - harvest_xsmrpool_2atm = this%harvest_xsmrpool_2atm + dribble_crophrv_xsmrpool_2atm = this%dribble_crophrv_xsmrpool_2atm if (masterproc) then unitn = getavu() @@ -322,10 +322,10 @@ subroutine CNReadNML( this, NLFilename ) end if call shr_mpi_bcast (reseed_dead_plants , mpicom) - call shr_mpi_bcast (harvest_xsmrpool_2atm , mpicom) + call shr_mpi_bcast (dribble_crophrv_xsmrpool_2atm , mpicom) this%reseed_dead_plants = reseed_dead_plants - this%harvest_xsmrpool_2atm = harvest_xsmrpool_2atm + this%dribble_crophrv_xsmrpool_2atm = dribble_crophrv_xsmrpool_2atm if (masterproc) then write(iulog,*) ' ' @@ -868,7 +868,7 @@ subroutine EcosystemDynamicsPreDrainage(this, bounds, & atm2lnd_inst, waterstate_inst, waterflux_inst, & canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & this%dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, this%cnfire_method, this%harvest_xsmrpool_2atm) + nutrient_competition_method, this%cnfire_method, this%dribble_crophrv_xsmrpool_2atm) ! fire carbon emissions call CNFireEmisUpdate(bounds, num_soilp, filter_soilp, & diff --git a/src/biogeochem/EDBGCDynMod.F90 b/src/biogeochem/EDBGCDynMod.F90 index ce154112b0..56801ecd05 100644 --- a/src/biogeochem/EDBGCDynMod.F90 +++ b/src/biogeochem/EDBGCDynMod.F90 @@ -237,7 +237,7 @@ subroutine EDBGCDyn(bounds, & ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst, harvest_xsmrpool_2atm=.False.) + soilbiogeochem_carbonflux_inst, dribble_crophrv_xsmrpool_2atm=.False.) call t_stopf('BNGCUpdate1') From 497cf02c5d56bdd95a85a52f33bb1af5500e499c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 9 Jan 2019 11:14:32 -0700 Subject: [PATCH 264/730] Set variables that need to be zero'd at init to 0.0_r8, checked that each of these do need to be zeroed --- src/biogeochem/CNVegCarbonFluxType.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 index 3fd276751f..f88c7f5e66 100644 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ b/src/biogeochem/CNVegCarbonFluxType.F90 @@ -465,7 +465,7 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%hrv_deadcrootc_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadcrootc_xfer_to_litter_patch (:) = nan allocate(this%hrv_gresp_storage_to_litter_patch (begp:endp)) ; this%hrv_gresp_storage_to_litter_patch (:) = nan allocate(this%hrv_gresp_xfer_to_litter_patch (begp:endp)) ; this%hrv_gresp_xfer_to_litter_patch (:) = nan - allocate(this%hrv_xsmrpool_to_atm_patch (begp:endp)) ; this%hrv_xsmrpool_to_atm_patch (:) = 0.0d00 + allocate(this%hrv_xsmrpool_to_atm_patch (begp:endp)) ; this%hrv_xsmrpool_to_atm_patch (:) = 0.0_r8 allocate(this%m_leafc_to_fire_patch (begp:endp)) ; this%m_leafc_to_fire_patch (:) = nan allocate(this%m_leafc_storage_to_fire_patch (begp:endp)) ; this%m_leafc_storage_to_fire_patch (:) = nan allocate(this%m_leafc_xfer_to_fire_patch (begp:endp)) ; this%m_leafc_xfer_to_fire_patch (:) = nan @@ -605,9 +605,9 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%cpool_grain_gr_patch (begp:endp)) ; this%cpool_grain_gr_patch (:) = nan allocate(this%cpool_grain_storage_gr_patch (begp:endp)) ; this%cpool_grain_storage_gr_patch (:) = nan allocate(this%transfer_grain_gr_patch (begp:endp)) ; this%transfer_grain_gr_patch (:) = nan - allocate(this%xsmrpool_to_atm_patch (begp:endp)) ; this%xsmrpool_to_atm_patch (:) = 0.0d00 - allocate(this%xsmrpool_to_atm_col (begc:endc)) ; this%xsmrpool_to_atm_col (:) = 0.0d00 - allocate(this%xsmrpool_to_atm_grc (begg:endg)) ; this%xsmrpool_to_atm_grc (:) = 0.0d00 + allocate(this%xsmrpool_to_atm_patch (begp:endp)) ; this%xsmrpool_to_atm_patch (:) = 0.0_r8 + allocate(this%xsmrpool_to_atm_col (begc:endc)) ; this%xsmrpool_to_atm_col (:) = 0.0_r8 + allocate(this%xsmrpool_to_atm_grc (begg:endg)) ; this%xsmrpool_to_atm_grc (:) = 0.0_r8 allocate(this%grainc_storage_to_xfer_patch (begp:endp)) ; this%grainc_storage_to_xfer_patch (:) = nan allocate(this%frootc_alloc_patch (begp:endp)) ; this%frootc_alloc_patch (:) = nan allocate(this%frootc_loss_patch (begp:endp)) ; this%frootc_loss_patch (:) = nan @@ -703,7 +703,7 @@ subroutine InitAllocate(this, bounds, carbon_type) allocate(this%fire_closs_p2c_col (begc:endc)) ; this%fire_closs_p2c_col (:) = nan allocate(this%fire_closs_col (begc:endc)) ; this%fire_closs_col (:) = nan allocate(this%wood_harvestc_col (begc:endc)) ; this%wood_harvestc_col (:) = nan - allocate(this%hrv_xsmrpool_to_atm_col (begc:endc)) ; this%hrv_xsmrpool_to_atm_col (:) = 0.0d00 + allocate(this%hrv_xsmrpool_to_atm_col (begc:endc)) ; this%hrv_xsmrpool_to_atm_col (:) = 0.0_r8 allocate(this%tempsum_npp_patch (begp:endp)) ; this%tempsum_npp_patch (:) = nan allocate(this%annsum_npp_patch (begp:endp)) ; this%annsum_npp_patch (:) = nan allocate(this%tempsum_litfall_patch (begp:endp)) ; this%tempsum_litfall_patch (:) = nan From b8d41ceda67d8241b02201c88616f71b01c20e87 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 9 Jan 2019 13:18:03 -0700 Subject: [PATCH 265/730] Make kprod a parameter, add some comments, if XSMRPOOL_LOSS doesn't exist on startup set it to zero --- src/biogeochem/CNCStateUpdate1Mod.F90 | 10 ++++------ src/biogeochem/CNVegCarbonStateType.F90 | 5 ++++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 18076a74d0..9f7b5d529a 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -166,7 +166,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & real(r8) :: dt ! radiation time step (seconds) real(r8) :: check_cpool real(r8) :: cpool_delta - real(r8) :: kprod05 ! decay constant for 0.5-year product pool + real(r8), parameter :: kprod05 = 1.44e-7 ! decay constant for 0.5-year product pool (1/s) (lose ~90% over a half year) !----------------------------------------------------------------------- associate( & @@ -246,10 +246,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end if end do - ! the following (1/s) rate constant results in ~90% loss of initial state over 0.5 years, - ! using a discrete-time fractional decay algorithm. - kprod05 = 1.44e-7 - if (.not. use_fates) then do fp = 1,num_soilp p = filter_soilp(fp) @@ -483,11 +479,12 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! bounds. Zeroing out these small pools and putting them into the flux to the ! atmosphere solved many of the crop isotope problems - ! Save xsmrpool, cpool, frootc to loss state variable for dribbling + ! Instantly release XSMRPOOL to atmosphere if ( .not. dribble_crophrv_xsmrpool_2atm ) then cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt + ! Save xsmrpool, cpool, frootc to loss state variable for dribbling else cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & cs_veg%xsmrpool_patch(p) + & @@ -499,6 +496,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%frootc_patch(p) = 0._r8 end if + ! Slowly release xsmrpool to atmosphere if ( dribble_crophrv_xsmrpool_2atm ) then ! calculate flux of xsmrpool loss to atm cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index b9bfae799f..cd0f4fc4d5 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -322,7 +322,7 @@ subroutine InitHistory(this, bounds, carbon_type) this%xsmrpool_loss_patch(begp:endp) = spval call hist_addfld1d (fname='XSMRPOOL_LOSS', units='gC/m^2', & avgflag='A', long_name='temporary photosynthate C pool loss', & - ptr_patch=this%xsmrpool_loss_patch) + ptr_patch=this%xsmrpool_loss_patch, default='inactive') end if this%woodc_patch(begp:endp) = spval @@ -1230,6 +1230,9 @@ subroutine Restart ( this, bounds, ncid, flag, carbon_type, reseed_dead_plants, call restartvar(ncid=ncid, flag=flag, varname='xsmrpool_loss', xtype=ncd_double, & dim1name='pft', long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%xsmrpool_loss_patch) + if (flag == 'read' .and. (.not. readvar) ) then + this%xsmrpool_loss_patch(bounds%begp:bounds%endp) = 0._r8 + end if call restartvar(ncid=ncid, flag=flag, varname='pft_ctrunc', xtype=ncd_double, & dim1name='pft', long_name='', units='', & From af876e35e3e93d9d115e6d0e2a2841f6e41666fe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 9 Jan 2019 18:04:36 -0700 Subject: [PATCH 266/730] Fix indentation formatting, remove extra use_crop if statement --- src/biogeochem/CNCStateUpdate1Mod.F90 | 529 ++++++++++++------------ src/biogeochem/CNVegCarbonStateType.F90 | 19 +- 2 files changed, 271 insertions(+), 277 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 9f7b5d529a..e1da2f354f 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -191,23 +191,23 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! plant to litter fluxes if (.not. use_fates) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! phenology and dynamic land cover fluxes - cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = & - cf_veg%phenology_c_to_litr_met_c_col(c,j) *dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = & - cf_veg%phenology_c_to_litr_cel_c_col(c,j) *dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = & - cf_veg%phenology_c_to_litr_lig_c_col(c,j) *dt - - ! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the - ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every - ! time step, but to be safe, I'm explicitly setting it to zero here. - cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 + do j = 1,nlevdecomp + do fc = 1,num_soilc + c = filter_soilc(fc) + ! phenology and dynamic land cover fluxes + cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = & + cf_veg%phenology_c_to_litr_met_c_col(c,j) *dt + cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = & + cf_veg%phenology_c_to_litr_cel_c_col(c,j) *dt + cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = & + cf_veg%phenology_c_to_litr_lig_c_col(c,j) *dt + + ! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the + ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every + ! time step, but to be safe, I'm explicitly setting it to zero here. + cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 + end do end do - end do else !use_fates ! here add all fates litterfall and CWD breakdown to litter fluxes do j = 1,nlevdecomp @@ -246,270 +246,267 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end if end do - if (.not. use_fates) then - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! phenology: transfer growth fluxes - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%leafc_xfer_to_leafc_patch(p)*dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) - cf_veg%leafc_xfer_to_leafc_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%frootc_xfer_to_frootc_patch(p)*dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) - cf_veg%frootc_xfer_to_frootc_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) - cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) - cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) - cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%grainc_xfer_to_grainc_patch(p)*dt - cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) - cf_veg%grainc_xfer_to_grainc_patch(p)*dt - end if - - ! phenology: litterfall fluxes - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - cf_veg%leafc_to_litter_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - cf_veg%frootc_to_litter_patch(p)*dt - - - - - ! livewood turnover fluxes - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%livestemc_to_deadstemc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) - cf_veg%livecrootc_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%livecrootc_to_deadcrootc_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_litter_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) & - - (cf_veg%grainc_to_food_patch(p) + cf_veg%grainc_to_seed_patch(p))*dt - cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & - - cf_veg%crop_seedc_to_leaf_patch(p) * dt & - + cf_veg%grainc_to_seed_patch(p) * dt - end if + if (.not. use_fates) then + do fp = 1,num_soilp + p = filter_soilp(fp) + c = patch%column(p) + + ! phenology: transfer growth fluxes + cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%leafc_xfer_to_leafc_patch(p)*dt + cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) - cf_veg%leafc_xfer_to_leafc_patch(p)*dt + cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%frootc_xfer_to_frootc_patch(p)*dt + cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) - cf_veg%frootc_xfer_to_frootc_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt + cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt + cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt + cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) - cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt + cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt + cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) - cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt + cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt + cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) - cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + ! lines here for consistency; the transfer terms are zero + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt + cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt + cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%grainc_xfer_to_grainc_patch(p)*dt + cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) - cf_veg%grainc_xfer_to_grainc_patch(p)*dt + end if + + ! phenology: litterfall fluxes + cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - cf_veg%leafc_to_litter_patch(p)*dt + cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - cf_veg%frootc_to_litter_patch(p)*dt - check_cpool = cs_veg%cpool_patch(p)- cf_veg%psnsun_to_cpool_patch(p)*dt-cf_veg%psnshade_to_cpool_patch(p)*dt - cpool_delta = cs_veg%cpool_patch(p) + ! livewood turnover fluxes + if (woody(ivt(p)) == 1._r8) then + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_deadstemc_patch(p)*dt + cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%livestemc_to_deadstemc_patch(p)*dt + cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) - cf_veg%livecrootc_to_deadcrootc_patch(p)*dt + cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%livecrootc_to_deadcrootc_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_litter_patch(p)*dt + cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) & + - (cf_veg%grainc_to_food_patch(p) + cf_veg%grainc_to_seed_patch(p))*dt + cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & + - cf_veg%crop_seedc_to_leaf_patch(p) * dt & + + cf_veg%grainc_to_seed_patch(p) * dt + end if - ! maintenance respiration fluxes from cpool - - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%leaf_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%froot_curmr_patch(p)*dt - If (woody(ivt(p)) == 1._r8) then - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livecroot_curmr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%grain_curmr_patch(p)*dt - end if + check_cpool = cs_veg%cpool_patch(p)- cf_veg%psnsun_to_cpool_patch(p)*dt-cf_veg%psnshade_to_cpool_patch(p)*dt + cpool_delta = cs_veg%cpool_patch(p) + ! maintenance respiration fluxes from cpool + + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_xsmrpool_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%leaf_curmr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%froot_curmr_patch(p)*dt + If (woody(ivt(p)) == 1._r8) then + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livecroot_curmr_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%grain_curmr_patch(p)*dt + end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_resp_patch(p)*dt - - !RF Add in the carbon spent on uptake respiration. - cs_veg%cpool_patch(p)= cs_veg%cpool_patch(p) - cf_veg%soilc_change_patch(p)*dt - ! maintenance respiration fluxes from xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) + cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%leaf_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%froot_xsmr_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livecroot_xsmr_patch(p)*dt - end if - - ! allocation fluxes - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_leafc_patch(p) = cf_veg%cpool_to_leafc_patch(p) - cf_veg%cpool_to_leafc_resp_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p) = cf_veg%cpool_to_leafc_storage_patch(p) - & - cf_veg%cpool_to_leafc_storage_resp_patch(p) - cf_veg%cpool_to_frootc_patch(p) = cf_veg%cpool_to_frootc_patch(p) - cf_veg%cpool_to_frootc_resp_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p) = cf_veg%cpool_to_frootc_storage_patch(p) & + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_resp_patch(p)*dt + + !RF Add in the carbon spent on uptake respiration. + cs_veg%cpool_patch(p)= cs_veg%cpool_patch(p) - cf_veg%soilc_change_patch(p)*dt + + ! maintenance respiration fluxes from xsmrpool + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) + cf_veg%cpool_to_xsmrpool_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%leaf_xsmr_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%froot_xsmr_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livecroot_xsmr_patch(p)*dt + end if + + ! allocation fluxes + if (carbon_resp_opt == 1) then + cf_veg%cpool_to_leafc_patch(p) = cf_veg%cpool_to_leafc_patch(p) - cf_veg%cpool_to_leafc_resp_patch(p) + cf_veg%cpool_to_leafc_storage_patch(p) = cf_veg%cpool_to_leafc_storage_patch(p) - & + cf_veg%cpool_to_leafc_storage_resp_patch(p) + cf_veg%cpool_to_frootc_patch(p) = cf_veg%cpool_to_frootc_patch(p) - cf_veg%cpool_to_frootc_resp_patch(p) + cf_veg%cpool_to_frootc_storage_patch(p) = cf_veg%cpool_to_frootc_storage_patch(p) & - cf_veg%cpool_to_frootc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_patch(p)*dt - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%cpool_to_leafc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p)*dt - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) + cf_veg%cpool_to_leafc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%cpool_to_frootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p)*dt - - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) + cf_veg%cpool_to_frootc_storage_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_livecrootc_patch(p) = cf_veg%cpool_to_livecrootc_patch(p) - cf_veg%cpool_to_livecrootc_resp_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p) = cf_veg%cpool_to_livecrootc_storage_patch(p) - & - cf_veg%cpool_to_livecrootc_storage_resp_patch(p) - cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & + end if + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_patch(p)*dt + cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%cpool_to_leafc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p)*dt + cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) + cf_veg%cpool_to_leafc_storage_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_patch(p)*dt + cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%cpool_to_frootc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p)*dt + + cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) + cf_veg%cpool_to_frootc_storage_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then + if (carbon_resp_opt == 1) then + cf_veg%cpool_to_livecrootc_patch(p) = cf_veg%cpool_to_livecrootc_patch(p) - cf_veg%cpool_to_livecrootc_resp_patch(p) + cf_veg%cpool_to_livecrootc_storage_patch(p) = cf_veg%cpool_to_livecrootc_storage_patch(p) - & + cf_veg%cpool_to_livecrootc_storage_resp_patch(p) + cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & cf_veg%cpool_to_livestemc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%cpool_to_deadstemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_storage_patch(p)*dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) + cf_veg%cpool_to_deadstemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%cpool_to_livecrootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p)*dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) + cf_veg%cpool_to_livecrootc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%cpool_to_deadcrootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) + cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & + end if + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt + cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_patch(p)*dt + cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%cpool_to_deadstemc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_storage_patch(p)*dt + cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) + cf_veg%cpool_to_deadstemc_storage_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_patch(p)*dt + cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%cpool_to_livecrootc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p)*dt + cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) + cf_veg%cpool_to_livecrootc_storage_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_patch(p)*dt + cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%cpool_to_deadcrootc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt + cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) + cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + if (carbon_resp_opt == 1) then + cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & cf_veg%cpool_to_livestemc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%cpool_to_grainc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_storage_patch(p)*dt - cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) + cf_veg%cpool_to_grainc_storage_patch(p)*dt - end if - - ! growth respiration fluxes for current growth - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_gr_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadstem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livecroot_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadcroot_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_gr_patch(p)*dt - end if - - ! growth respiration for transfer growth - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_leaf_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_froot_gr_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadstem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livecroot_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadcroot_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_grain_gr_patch(p)*dt - end if - - ! growth respiration at time of storage - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_storage_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_storage_gr_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then + end if + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt + cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_patch(p)*dt + cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%cpool_to_grainc_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_storage_patch(p)*dt + cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) + cf_veg%cpool_to_grainc_storage_patch(p)*dt + end if + + ! growth respiration fluxes for current growth + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_gr_patch(p)*dt + + if (woody(ivt(p)) == 1._r8) then + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadstem_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livecroot_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadcroot_gr_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_gr_patch(p)*dt + end if + + ! growth respiration for transfer growth + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_leaf_gr_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_froot_gr_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadstem_gr_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livecroot_gr_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadcroot_gr_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_grain_gr_patch(p)*dt + end if + + ! growth respiration at time of storage + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_storage_gr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_storage_gr_patch(p)*dt + + if (woody(ivt(p)) == 1._r8) then cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_storage_gr_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadstem_storage_gr_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livecroot_storage_gr_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadcroot_storage_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_storage_gr_patch(p)*dt - - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_storage_gr_patch(p)*dt - - end if - - ! growth respiration stored for release during transfer growth - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_gresp_storage_patch(p)*dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) + cf_veg%cpool_to_gresp_storage_patch(p)*dt - - ! move storage pools into transfer pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) + cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - cf_veg%frootc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) + cf_veg%frootc_storage_to_xfer_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) - cf_veg%deadstemc_storage_to_xfer_patch(p)*dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) + cf_veg%deadstemc_storage_to_xfer_patch(p)*dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p)- cf_veg%livecrootc_storage_to_xfer_patch(p)*dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) + cf_veg%livecrootc_storage_to_xfer_patch(p)*dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p)- cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) + cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - cf_veg%gresp_storage_to_xfer_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) + cf_veg%gresp_storage_to_xfer_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) - cf_veg%grainc_storage_to_xfer_patch(p)*dt - cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) + cf_veg%grainc_storage_to_xfer_patch(p)*dt - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%grain_xsmr_patch(p)*dt - if (harvdate(p) < 999) then ! beginning at harvest, send to atm - ! TODO (mv, 11-02-2014) the following lines are why the cf_veg is - ! an intent(inout) - ! fluxes should not be updated in this module - not sure where - ! this belongs - ! DML (06-20-2017) While debugging crop isotope code, found that cpool_patch and frootc_patch - ! could occasionally be very small but nonzero numbers after crop harvest, which persists - ! through to next planting and for reasons that could not 100% - ! isolate, caused C12/C13 ratios to occasionally go out of - ! bounds. Zeroing out these small pools and putting them into the flux to the - ! atmosphere solved many of the crop isotope problems - - ! Instantly release XSMRPOOL to atmosphere - if ( .not. dribble_crophrv_xsmrpool_2atm ) then - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt - ! Save xsmrpool, cpool, frootc to loss state variable for dribbling - else - cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & - cs_veg%xsmrpool_patch(p) + & - cs_veg%cpool_patch(p) + & - cs_veg%frootc_patch(p) - end if - cs_veg%xsmrpool_patch(p) = 0._r8 - cs_veg%cpool_patch(p) = 0._r8 - cs_veg%frootc_patch(p) = 0._r8 - end if - - ! Slowly release xsmrpool to atmosphere - if ( dribble_crophrv_xsmrpool_2atm ) then - ! calculate flux of xsmrpool loss to atm - cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 - - ! update xsmrpool loss state - cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) - cf_veg%xsmrpool_to_atm_patch(p) * dt - end if - - end if + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_storage_gr_patch(p)*dt + + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_storage_gr_patch(p)*dt + + end if + + ! growth respiration stored for release during transfer growth + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_gresp_storage_patch(p)*dt + cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) + cf_veg%cpool_to_gresp_storage_patch(p)*dt + + ! move storage pools into transfer pools + cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - cf_veg%leafc_storage_to_xfer_patch(p)*dt + cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) + cf_veg%leafc_storage_to_xfer_patch(p)*dt + cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - cf_veg%frootc_storage_to_xfer_patch(p)*dt + cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) + cf_veg%frootc_storage_to_xfer_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then + cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt + cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt + cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) - cf_veg%deadstemc_storage_to_xfer_patch(p)*dt + cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) + cf_veg%deadstemc_storage_to_xfer_patch(p)*dt + cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p)- cf_veg%livecrootc_storage_to_xfer_patch(p)*dt + cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) + cf_veg%livecrootc_storage_to_xfer_patch(p)*dt + cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p)- cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt + cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) + cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt + cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - cf_veg%gresp_storage_to_xfer_patch(p)*dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) + cf_veg%gresp_storage_to_xfer_patch(p)*dt + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + ! lines here for consistency; the transfer terms are zero + cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt + cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt + cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) - cf_veg%grainc_storage_to_xfer_patch(p)*dt + cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) + cf_veg%grainc_storage_to_xfer_patch(p)*dt + end if + + if (ivt(p) >= npcropmin) then ! skip 2 generic crops + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%grain_xsmr_patch(p)*dt + if (harvdate(p) < 999) then ! beginning at harvest, send to atm + ! TODO (mv, 11-02-2014) the following lines are why the cf_veg is + ! an intent(inout) + ! fluxes should not be updated in this module - not sure where + ! this belongs + ! DML (06-20-2017) While debugging crop isotope code, found that cpool_patch and frootc_patch + ! could occasionally be very small but nonzero numbers after crop harvest, which persists + ! through to next planting and for reasons that could not 100% + ! isolate, caused C12/C13 ratios to occasionally go out of + ! bounds. Zeroing out these small pools and putting them into the flux to the + ! atmosphere solved many of the crop isotope problems + + ! Instantly release XSMRPOOL to atmosphere + if ( .not. dribble_crophrv_xsmrpool_2atm ) then + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt + cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt + ! Save xsmrpool, cpool, frootc to loss state variable for dribbling + else + cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & + cs_veg%xsmrpool_patch(p) + & + cs_veg%cpool_patch(p) + & + cs_veg%frootc_patch(p) + end if + cs_veg%xsmrpool_patch(p) = 0._r8 + cs_veg%cpool_patch(p) = 0._r8 + cs_veg%frootc_patch(p) = 0._r8 + end if + + ! Slowly release xsmrpool to atmosphere + if ( dribble_crophrv_xsmrpool_2atm ) then + ! calculate flux of xsmrpool loss to atm + cf_veg%xsmrpool_to_atm_patch(p) = cs_veg%xsmrpool_loss_patch(p) * kprod05 + + ! update xsmrpool loss state + cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) - cf_veg%xsmrpool_to_atm_patch(p) * dt + end if + + end if - end do ! end of patch loop - end if + end do ! end of patch loop + end if ! end of NOT fates end associate diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 index cd0f4fc4d5..3921e66c19 100644 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ b/src/biogeochem/CNVegCarbonStateType.F90 @@ -2769,18 +2769,15 @@ subroutine DynamicPatchAdjustments(this, bounds, & var = this%grainc_xfer_patch(begp:endp), & flux_out_grc_area = conv_cflux(begp:endp)) -!KO WHY ARE THERE TWO use_crop's HERE? - if (use_crop) then - ! This is a negative pool. So any deficit that we haven't repaid gets sucked out - ! of the atmosphere. - call update_patch_state( & - var = this%cropseedc_deficit_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) + ! This is a negative pool. So any deficit that we haven't repaid gets sucked out + ! of the atmosphere. + call update_patch_state( & + var = this%cropseedc_deficit_patch(begp:endp), & + flux_out_grc_area = conv_cflux(begp:endp)) - call update_patch_state( & - var = this%xsmrpool_loss_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - end if + call update_patch_state( & + var = this%xsmrpool_loss_patch(begp:endp), & + flux_out_grc_area = conv_cflux(begp:endp)) end if contains From 3f37d958c60f5a9ff013b6384c95fff25a397cf3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 9 Jan 2019 18:05:15 -0700 Subject: [PATCH 267/730] Add handling of cngeneral namelist and some error conditions for it, and add new tests for it --- bld/CLMBuildNamelist.pm | 29 +++++++++++++++++++++++++ bld/unit_testers/build-namelist_test.pl | 17 ++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 9cfa537ff8..bf03776a0e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1705,6 +1705,10 @@ sub process_namelist_inline_logic { ################################################ setup_logic_century_soilbgcdecompcascade($opts, $nl_flags, $definition, $defaults, $nl, $physv); + ############################# + # namelist group: cngeneral # + ############################# + setup_logic_cngeneral($opts, $nl_flags, $definition, $defaults, $nl, $physv); #################################### # namelist group: cnvegcarbonstate # #################################### @@ -3598,6 +3602,31 @@ sub setup_logic_cnvegcarbonstate { #------------------------------------------------------------------------------- +sub setup_logic_cngeneral { + # Must be set after setup_logic_co2_type + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + + if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl->get_value('use_cn')) ) { + if ( &value_is_true($nl->get_value('use_crop')) ) { + #add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dribble_crophrv_xsmrpool_2atm', + #'co2_type' => $nl->get_value('co2_type') ); + } else { + if ( defined($nl->get_value('dribble_crophrv_xsmrpool_2atm')) ) { + $log->fatal_error("When CROP is NOT on dribble_crophrv_xsmrpool_2atm can NOT be set\n" ); + } + } + } else { + if ( defined($nl->get_value('reseed_dead_plants')) || + defined($nl->get_value('dribble_crophrv_xsmrpool_2atm')) ) { + $log->fatal_error("When CN is not on none of the following can be set: ,\n" . + "dribble_crophrv_xsmrpool_2atm nor reseed_dead_plantsr\n" . + "(eg. don't use these options with SP mode)."); + } + } +} + +#------------------------------------------------------------------------------- + sub setup_logic_rooting_profile { # my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index aa48d37059..b72934424a 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,7 +123,7 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 943; +my $ntests = 946; if ( defined($opts{'compare'}) ) { $ntests += 597; } @@ -387,6 +387,21 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm4_5", }, + "reseed without CN" =>{ options=>" -envxml_dir . -bgc sp", + namelst=>"reseed_dead_plants=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, + "dribble_crphrv w/o CN" =>{ options=>" -envxml_dir . -bgc sp", + namelst=>"dribble_crophrv_xsmrpool_2atm=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, + "dribble_crphrv w/o crop" =>{ options=>" -envxml_dir . -bgc cn -no-crop", + namelst=>"dribble_crophrv_xsmrpool_2atm=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, "CNDV with flanduse_timeseries" =>{ options=>" -envxml_dir .", namelst=>"flanduse_timeseries='my_flanduse_timeseries_file.nc'", GLC_TWO_WAY_COUPLING=>"FALSE", From f98e289eabab89ba6f5fbb9b8b92ff015d054b6e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Jan 2019 16:04:31 -0700 Subject: [PATCH 268/730] Set dribble_crophrv_xsmrpool_2atm by co2_type, should be on for prognostic off otherwise --- bld/CLMBuildNamelist.pm | 5 +++-- bld/namelist_files/namelist_defaults_clm4_5.xml | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index bf03776a0e..0e36d4e79d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3608,8 +3608,9 @@ sub setup_logic_cngeneral { if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl->get_value('use_cn')) ) { if ( &value_is_true($nl->get_value('use_crop')) ) { - #add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dribble_crophrv_xsmrpool_2atm', - #'co2_type' => $nl->get_value('co2_type') ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dribble_crophrv_xsmrpool_2atm', + 'co2_type' => remove_leading_and_trailing_quotes($nl->get_value('co2_type')), + 'use_crop' => $nl->get_value('use_crop') ); } else { if ( defined($nl->get_value('dribble_crophrv_xsmrpool_2atm')) ) { $log->fatal_error("When CROP is NOT on dribble_crophrv_xsmrpool_2atm can NOT be set\n" ); diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 280217f661..3b6389c9a7 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -447,6 +447,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .false. .true. + + +.true. +.false. + -lnd/clm2/paramdata/fates_params_default_2trop.c181203.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190111.nc From 76108c46dc06267eac3102e7cb076c3ad5b9ec7b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 14 Jan 2019 11:25:03 -0700 Subject: [PATCH 275/730] Updated default fates file to contain hydro updates --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 247e4ca864..51331f0c81 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c181231.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc From f48330bfd7b1d5a22499b8cbb1a0277e0a17c493 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 14 Jan 2019 13:01:24 -0700 Subject: [PATCH 276/730] Updated FATES tag to encapsulate FATES-HYDRO updates (major API change) --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 37766d222e..eb7077fd75 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.17.1_api.6.0.0 +tag = sci.1.21.0_api.7.0.0 required = True [PTCLM] From ff77942a039c0c33034d1bbb2bba56a9f87071cd Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 14 Jan 2019 13:41:20 -0700 Subject: [PATCH 277/730] Update version of cime in externals for fates_next_api branch --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index e416af8aa0..d747e21035 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -29,8 +29,8 @@ required = True [cime] local_path = cime protocol = git -repo_url = https://github.com/CESM-Development/cime -tag = clm4518/n04/cime5.4.0-alpha.03 +repo_url = https://github.com/ESMCI/cime +tag = ctsm/ctsm1.0/cime5.7.5/n01 required = True [externals_description] From 413e729d290bc073c0d609393f44d994590cd350 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 14 Jan 2019 16:50:29 -0700 Subject: [PATCH 278/730] Put changes from #561 on release branch --- tools/mksurfdata_map/README.developers | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/mksurfdata_map/README.developers b/tools/mksurfdata_map/README.developers index 7b0ac50c5d..0821e54ca1 100644 --- a/tools/mksurfdata_map/README.developers +++ b/tools/mksurfdata_map/README.developers @@ -14,6 +14,8 @@ I. Adding a new raw data file II. Adding mapping files for a raw data file with a new grid / landmask +III. Checks that should be done when making new surface datasets + ============================================================================ I. Adding a new raw data file ============================================================================ @@ -176,3 +178,50 @@ laid out here. directory yourself +============================================================================ +III. Checks that should be done when making new surface datasets +============================================================================ + +Remaking all surface datasets carries the risk of introducing unintended +changes, particularly when you are expecting answer changes (so you +don't notice unintended answer changes that are mixed with the expected +changes). + +Here are some things to check after making a new set of surface +datasets: + +- For at least one global dataset (probably a production resolution + rather than a low resolution that is just used for testing): Compare + the new dataset against the previous version: + + - Compare header (via ncdump -h) and/or log file: ensure that the same + source data were used, except where you expect differences + + - Compare all fields with a tool like cprnc: make sure that the only + fields that differ are those you expect to differ + + - Visually compare all fields that differ: make sure differences look + reasonable and as expected + +And here are some things to check for when making new landuse.timeseries +datasets (which often happens at the same time, and most of the above applies +as well): + +- Compare one of the productive resolution datasets to a previous version. + + - If part of it should be identical (for example the historical period) make + sure it is identical as expected (using cprnc make sure the historical period + is identical and only the future scenario changes). + + - If the historical period should be identical, make sure the 1850 surface dataset + created is identical to the previous one. + + - Visually compare all fields/times that differ: make sure differences look + reasonable and as expected. Go through at least the first and last time to see + that the change in time is as expected. + + - Quickly going through the time differences for at least one field that changes + can also be useful to see that there isn't a sudden jump for a particular time. + + - Go through the list of raw PFT files that were used to create the dataset and make + sure it appears to be correct (ncdump -v input_pftdata_filename) From 5b20669d6b367f3483885276617f866ba9ea5656 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 14 Jan 2019 16:52:40 -0700 Subject: [PATCH 279/730] Add changes from #567 to release branch --- .gitignore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitignore b/.gitignore index d8000a5537..e5b448c04d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,23 @@ manage_externals.log *.swp *~ +# vim files (from https://github.com/github/gitignore/blob/master/Global/Vim.gitignore) +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] +# Session +Session.vim +# Temporary +.netrwhist +# (removed *~ because it is listed above) +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + # mac files .DS_Store From 4f550bd2261c26f2de7dc6de1d9b0a748541ccf9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 14 Jan 2019 22:19:00 -0700 Subject: [PATCH 280/730] Add conus_20_x8 option and files, #547 --- .../namelist_defaults_clm4_5.xml | 58 +++++++++++++++++++ .../namelist_defaults_clm4_5_tools.xml | 3 + .../namelist_definition_clm4_5.xml | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 280217f661..63bb9c6c64 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -712,6 +712,9 @@ lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc lnd/clm2/surfdata_map/surfdata_ne16np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc + +lnd/clm2/surfdata_map/surfdata_conus_30_x8_16pfts_Irrig_CMIP6_simyr2000_c181003.nc + lnd/clm2/surfdata_map/surfdata_5x5_amazon_16pfts_Irrig_CMIP6_simyr2000_c171214.nc @@ -746,6 +749,9 @@ lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr2000_c170824.nc lnd/clm2/surfdata_map/surfdata_ne16np4_78pfts_CMIP6_simyr2000_c170824.nc + +lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr2000_c181003.nc + lnd/clm2/surfdata_map/surfdata_1x1_camdenNJ_16pfts_Irrig_CMIP6_simyr2000_c171214.nc @@ -782,6 +788,9 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc< lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc + +lnd/clm2/surfdata_map/surfdata_conus_30_x8_16pfts_Irrig_CMIP6_simyr1850_c181003.nc + lnd/clm2/surfdata_map/surfdata_360x720cru_78pfts_CMIP6_simyr1850_c170824.nc @@ -811,6 +820,9 @@ lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr1850_c170824.nc lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc + +lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr1850_c181003.nc + lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc +lnd/clm2/surfdata_map/landuse.timeseries_conus_30_x8_hist_78pfts_CMIP6_simyr1850-2015_c181004.nc + + + + +lnd/clm2/mappingdata/maps/conus_30_x8/map_5x5min_nomask_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_GLOBE-Gardner_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_LandScan2004_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_10x10min_nomask_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_0.5x0.5_MODIS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_5x5min_ORNL-Soil_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_0.5x0.5_AVHRR_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_MODIS-wCsp_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_1km-merge-10min_HYDRO1K-merge-nomask_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_360x720cru_cruncep_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_10x10min_IGBPmergeICESatGIS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_GLOBE-Gardner-mergeGIS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_0.9x1.25_GRDC_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_5x5min_ISRIC-WISE_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_USGS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_0.25x0.25_MODIS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_5x5min_IGBP-GSDP_to_conus_30_x8_nomask_aave_da_c181003.nc + + + diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 17ed9ba4d5..b6c6ad64fc 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -46,6 +46,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/mappingdata/grids/SCRIPgrid_ne16np4_nomask_c110512.nc lnd/clm2/mappingdata/grids/SCRIPgrid_ne4np4_nomask_c110808.nc + +lnd/clm2/mappingdata/grids/SCRIPgrid_conus_30_x8_nomask_c170111.nc + lnd/clm2/mappingdata/grids/SCRIPgrid_0.125x0.125_nomask_c140702.nc diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 59d8289c45..ac30ea5ecb 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1776,7 +1776,7 @@ CLM run type. +"conus_30_x8,512x1024,360x720cru,128x256,64x128,48x96,32x64,8x16,94x192,0.23x0.31,0.47x0.63,0.9x1.25,1.9x2.5,2.5x3.33,4x5,10x15,5x5_amazon,1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ,1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.1x0.1,0.25x0.25,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.33,0.125x0.125,ne4np4,ne16np4,ne30np4,ne60np4,ne120np4,ne240np4,1km-merge-10min"> Horizontal resolutions Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools From 5d0d54a7d6cf97632656af1fab820b054428e992 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 15 Jan 2019 10:39:18 -0700 Subject: [PATCH 281/730] Get working with addition of conus res and make sim_year a char same as sim_year for clm4_5 --- bld/namelist_files/namelist_definition_clm4_0.xml | 2 +- bld/unit_testers/build-namelist_test.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition_clm4_0.xml b/bld/namelist_files/namelist_definition_clm4_0.xml index 220a033e4e..2aa49b23b4 100644 --- a/bld/namelist_files/namelist_definition_clm4_0.xml +++ b/bld/namelist_files/namelist_definition_clm4_0.xml @@ -715,7 +715,7 @@ If TRUE, irrigation will be active (find surface datasets with active irrigation If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index aa48d37059..c73d3415d7 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,7 +123,7 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 943; +my $ntests = 947; if ( defined($opts{'compare'}) ) { $ntests += 597; } From 086a034f5fddeda21bff3aa29da8017cd38f4115 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 15 Jan 2019 11:04:00 -0700 Subject: [PATCH 282/730] Correct number of compare tests --- bld/unit_testers/build-namelist_test.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c73d3415d7..f3f6fb8999 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -125,7 +125,7 @@ sub make_env_run { # my $ntests = 947; if ( defined($opts{'compare'}) ) { - $ntests += 597; + $ntests += 600; } plan( tests=>$ntests ); From dee81795aac990a0c62e1ce356f8792e9b861d54 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 15 Jan 2019 14:18:25 -0700 Subject: [PATCH 283/730] Add standard running of ssp_rcp future scenarios --- tools/mksurfdata_map/Makefile.data | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/mksurfdata_map/Makefile.data b/tools/mksurfdata_map/Makefile.data index abac6af279..30bfcb463a 100644 --- a/tools/mksurfdata_map/Makefile.data +++ b/tools/mksurfdata_map/Makefile.data @@ -58,6 +58,8 @@ MKSURFDATA = $(BATCHJOBS) $(PWD)/mksurfdata.pl # ne30np4 is standard resolution for SE dycore in CAM, T31 is for paleo, 360x720cru is for same resolution as forcing data STANDARD_RES = 360x720cru,48x96,0.9x1.25,1.9x2.5,10x15,4x5,ne30np4 +FUTURE_RES = 0.9x1.25,1.9x2.5,10x15 + # ne120np4 is for high resolution SE dycore, ne16 is for testing SE dycore # T42 is for SCAM # f05 is needed for running full chemistry model @@ -71,6 +73,7 @@ STANDARD = \ global-historical-ne120np4 \ global-transient-f05 \ global-transient \ + global-future \ global-transient-ne120np4 TROPICS = \ @@ -95,6 +98,7 @@ CROP = \ crop-global-historical-ne120np4 \ crop-global-transient-f05 \ crop-global-transient \ + crop-global-future \ crop-global-transient-ne120np4 all : standard tropics crop urban landuse-timeseries @@ -143,6 +147,13 @@ global-transient-ne120np4 : FORCE global-transient-f05 : FORCE $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2000 -res 0.47x0.63 $(BACKGROUND) +# +# global with future scenarios +# +global-future : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-2.6,SSP3-7.0,SSP5-3.4,SSP2-4.5,SSP1-1.9,SSP4-3.4,SSP4-6.0,SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) + # # tropics # @@ -222,6 +233,15 @@ crop-global-transient-ne120np4 : FORCE crop-global-transient-f05 : FORCE $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2000 -res 0.47x0.63 $(BACKGROUND) + +# +# Crop with future scenarios +# +crop-global-future : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-2.6,SSP3-7.0,SSP5-3.4,SSP2-4.5,SSP1-1.9,SSP4-3.4,SSP4-6.0,SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) + + # # urban # From adf1428da08d5c6b11530c378bd3a788563922de Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 15 Jan 2019 14:18:53 -0700 Subject: [PATCH 284/730] Correct name of ssp_rcp scenarios, so it will properly check for valid names --- bld/namelist_files/namelist_definition_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index dd21fbbf6a..23a393494b 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1788,7 +1788,7 @@ Representative concentration pathway for future scenarios [radiative forcing at -999.9 means do NOT use a future scenario, just use historical data. - Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios From e2944f5f56eea684365fc8dd884410269cc56f42 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 15 Jan 2019 15:13:59 -0700 Subject: [PATCH 285/730] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 99 ++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 88caaeffdb..9bb694f080 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.16 erik 01/15/2019 PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere release-clm5.0.15 sacks 12/06/2018 Option for rain-to-snow to immediately run off in some regions release-clm5.0.14 erik 11/29/2018 Update cime and fix surface dataset for f05 1850 non-crop case release-clm5.0.13 erik 11/14/2018 Update externals with new CO2/presearo/rtm/mosart, add science_support, change testing diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index fafdfe6902..783713ad60 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,103 @@ =============================================================== +Tag name: release-clm5.0.16 +Originator(s): erik (Erik Kluzek) +Date: Tue Jan 15 15:13:43 MST 2019 +One-line Summary: PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere + +Purpose of this version: +------------------------ + +no-anthro changes on release branch. Update of mksurfdata for Antarctic. Also start adding in newly created SSP-RCP datasets that are easy to add in. +Also add in new option for dribble_crophrv_xsmrpool_2atm. + +CTSM Master Tag This Corresponds To: N/A + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #553 #533 #589 #547 #545 + #553 -- More robust mksurfdata_map logic for determining where to put wetlands + #533 -- Add -no-anthro option to mksurfdata_map + #589 -- Existence of content in the lai_streams namelist makes it confusing to users + #547 -- Add conus_30_x8 grid as valid option for CTSM and mksurfdata_map + #545 -- Antarctica ice shelves are being treated as wetlands rather than glaciers + +Science changes since: release-clm5.0.15 + mksurfdata now properly makes Antarctica teated as glacier rather than wetland + Add in option to create all of the SSP-RCP future scenarios in mksurfdata_map + Add dribble_crophrv_xsmrpool_2atm, to do slow release of crop harvested XSMRPOOL to atmosphere + (only active by default when co2_type="prognostic") + +Software changes since: release-clm5.0.15 + Add no-anthro option for mksurfdata_map + +Changes to User Interface since: release-clm5.0.15 + New namelist option: dribble_crophrv_xsmrpool_2atm + Add SSP-RCP future scenarios can be done in mksurfdata_map + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.15 + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime_cesm2_1_rel_06 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: N/A + +Pull Requests that document the changes (include PR ids): #567 #561 #564 #616 #610 +(https://github.com/ESCOMP/ctsm/pull) + + #616 -- No anthro options to tools, and all future scenarios in place, plus a few small issue fixes + #610 -- Add option to dribble XSMRPOOL at crop harvest to atmosphere over a half year + #567 -- ignore patterns for vim + #564 -- Update mksurfdata_map to include glaciers outside of pft landmask + #561 -- Add list of checks for new surface datasets + +=============================================================== +=============================================================== Tag name: release-clm5.0.15 Originator(s): sacks (Bill Sacks) Date: Thu Dec 6 10:14:30 MST 2018 From fa499286c5a4842c6912285d6eb9b604efb09edb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 16 Jan 2019 12:01:49 -0700 Subject: [PATCH 286/730] Initial add of noanthro_control file, name needs to change --- .../use_cases/noanthro_control.xml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 bld/namelist_files/use_cases/noanthro_control.xml diff --git a/bld/namelist_files/use_cases/noanthro_control.xml b/bld/namelist_files/use_cases/noanthro_control.xml new file mode 100644 index 0000000000..9e5fc6344f --- /dev/null +++ b/bld/namelist_files/use_cases/noanthro_control.xml @@ -0,0 +1,60 @@ + + + + +Simulate current conditions without ANY anthropogenic influnces + +PtVg + +constant + +.false. + +1850 +1850 + +1850 +1850 + +1850 +1850 + +1850 +1850 + +cycle +NDEP_month + +1925 +1925 + +1925 +1925 + +1925 +1925 + + +lnd/clm2/firedata/clmforc.no_anthro_zero_hdm_1x1_simyr1925_181113.nc +nn + +1850 +1850 + + +NONE + + +OFF +.false. + + +0.0 +0.0 + + +lnd/clm2/surfdata_map/surfdata_0.9x1.25_hist_16pfts_nourb_CMIP6_simyrPtVg_c181114.nc + + From 75f60895cf91526d003f273d0a8c9a8c0f2d745c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 16 Jan 2019 12:04:23 -0700 Subject: [PATCH 287/730] Rename use-case so it will pass the convention --- .../use_cases/{noanthro_control.xml => 1850_noanthro_control.xml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename bld/namelist_files/use_cases/{noanthro_control.xml => 1850_noanthro_control.xml} (100%) diff --git a/bld/namelist_files/use_cases/noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml similarity index 100% rename from bld/namelist_files/use_cases/noanthro_control.xml rename to bld/namelist_files/use_cases/1850_noanthro_control.xml From 13bb0e90b26c853bf53ad0059a7fc56d6aa8172b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 17 Jan 2019 10:24:23 -0700 Subject: [PATCH 288/730] Get noanthro use_case and PtVg sim_year fully working add some more namelist tests for it --- bld/CLMBuildNamelist.pm | 7 ++++++- bld/namelist_files/namelist_defaults_clm4_5.xml | 5 +++++ .../use_cases/1850_noanthro_control.xml | 4 ---- bld/unit_testers/build-namelist_test.pl | 15 +++++++++++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e1e394f15c..85b88ed992 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2428,7 +2428,12 @@ sub setup_logic_initial_conditions { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_how_close" ); my $close = $nl->get_value("init_interp_how_close"); foreach my $sim_yr ( split( /,/, $nl->get_value("init_interp_sim_years") )) { - my $how_close = abs($st_year - $sim_yr); + my $how_close = undef; + if ( $nl_flags->{'sim_year'} eq "PtVg" ) { + $how_close = abs(1850 - $sim_yr); + } else { + $how_close = abs($st_year - $sim_yr); + } if ( ($how_close < $nl->get_value("init_interp_how_close")) && ($how_close < $close) ) { $close = $how_close; $settings{'sim_year'} = $sim_yr; diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 9b914406c5..5c60c11624 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -27,6 +27,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 379.0 388.8 284.7 +284.7 constant @@ -828,6 +829,10 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr1850_c181003.nc + +lnd/clm2/surfdata_map/surfdata_0.9x1.25_hist_16pfts_nourb_CMIP6_simyrPtVg_c181114.nc + -lnd/clm2/surfdata_map/surfdata_0.9x1.25_hist_16pfts_nourb_CMIP6_simyrPtVg_c181114.nc - diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2d158639be..5a8bc4c60b 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 950; +my $ntests = 956; if ( defined($opts{'compare'}) ) { - $ntests += 600; + $ntests += 603; } plan( tests=>$ntests ); @@ -317,6 +317,7 @@ sub make_env_run { "-bgc fates -use_case 2000_control -no-megan", "-bgc cn -use_case 1850-2100_rcp8.5_transient -namelist '&a start_ymd=19201023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", + "-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res 360x720", ) { my $file = $startfile; &make_env_run(); @@ -863,6 +864,16 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, + "noanthro_w_crop" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -crop -use_case 1850_noanthro_control", + namelst=>"", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, + "noanthro_w_irrig" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control", + namelst=>"irrigate=T", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, "spdotransconflict" =>{ options=>"-envxml_dir . -bgc sp -use_case 20thC_transient", namelst=>"do_transient_pfts=T,do_transient_crops=.false.", GLC_TWO_WAY_COUPLING=>"FALSE", From ba09473ca60cac84312c8af8c1e4ce0490e08b19 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 17 Jan 2019 16:34:46 -0700 Subject: [PATCH 289/730] Add a couple noanthro compsets and tests --- cime_config/config_component.xml | 25 ++++++++++++++----------- cime_config/config_compsets.xml | 10 ++++++++++ cime_config/testdefs/testlist_clm.xml | 8 ++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 90173fea2c..1375bf1dd2 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -16,7 +16,7 @@ clm4.0: clm4.5: - clm5.0: + clm5.0: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation @@ -24,8 +24,10 @@ CNDV with prognostic crop: Satellite phenology with VIC hydrology: + Satellite phenology without anthropomorphic influences BGC (vert. resol. CN and methane): BGC (vert. resol. CN and methane) with prognostic crop: + BGC (vert. resol. CN and methane) without anthropomorphic influences: FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental) BGC (vert. resol. CN and methane) with dynamic vegetation: BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop: @@ -102,16 +104,17 @@ UNSET - 2010_control - 2000_control - 1850_control - 20thC_transient - 1850-2100_rcp6_transient - 1850-2100_rcp4.5_transient - 1850-2100_rcp2.6_transient - 1850-2100_rcp8.5_transient - 20thC_transient - 1850-2100_rcp4.5_transient + 2010_control + 2000_control + 1850_control + 1850_noanthro_control + 20thC_transient + 1850-2100_rcp6_transient + 1850-2100_rcp4.5_transient + 1850-2100_rcp2.6_transient + 1850-2100_rcp8.5_transient + 20thC_transient + 1850-2100_rcp4.5_transient run_component_clm env_run.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 04a6c0cdb0..d8502fc686 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -163,6 +163,16 @@ 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + I1850Clm50BgcNoAnthro + 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + + + I1850Clm50SpNoAnthro + 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + + IHistClm50BgcCrop HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3055bfb17e..c811c3fa9d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -8,6 +8,14 @@ + + + + + + + + From d7114d0752d5462ab97dd8c43c423da86f9ecaef Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 29 Oct 2018 09:42:46 -0600 Subject: [PATCH 290/730] Add history fields for vertically-resolved sums of SOIL1C, SOIL2C, SOIL3C for C12, C13, and C14 --- .../SoilBiogeochemCarbonStateType.F90 | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 index 9b1f288f63..64da935dea 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 @@ -25,6 +25,7 @@ module SoilBiogeochemCarbonStateType ! all c pools involved in decomposition real(r8), pointer :: decomp_cpools_vr_col (:,:,:) ! (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools + real(r8), pointer :: decomp_soil_vr_col(:,:) ! (gC/m3) vertically-resolved decomposing total soil c pool real(r8), pointer :: ctrunc_vr_col (:,:) ! (gC/m3) vertically-resolved column-level sink for C truncation ! summary (diagnostic) state variables, not involved in mass balance @@ -102,6 +103,8 @@ subroutine InitAllocate(this, bounds) allocate(this%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) this%decomp_cpools_vr_col(:,:,:)= nan + allocate(this%decomp_soil_vr_col(begc:endc,1:nlevdecomp_full)) + this%decomp_soil_vr_col(:,:)= nan allocate(this%ctrunc_col (begc :endc)) ; this%ctrunc_col (:) = nan if ( .not. use_fates ) then @@ -145,6 +148,13 @@ subroutine InitHistory(this, bounds, carbon_type) if (carbon_type == 'c12') then + if ( nlevdecomp_full > 1 ) then + this%decomp_soil_vr_col(begc:endc,:) = spval + call hist_addfld2d (fname='SOILC_vr', units='gC/m^3', type2d='levsoi', & + avgflag='A', long_name='SOIL C (vertically resolved)', & + ptr_col=this%decomp_soil_vr_col) + end if + this%decomp_cpools_col(begc:endc,:) = spval do l = 1, ndecomp_pools if ( nlevdecomp_full > 1 ) then @@ -217,6 +227,13 @@ subroutine InitHistory(this, bounds, carbon_type) if ( carbon_type == 'c13' ) then + if ( nlevdecomp_full > 1 ) then + this%decomp_soil_vr_col(begc:endc,:) = spval + call hist_addfld2d (fname='C13_SOILC_vr', units='gC13/m^3', type2d='levsoi', & + avgflag='A', long_name='C13 SOIL C (vertically resolved)', & + ptr_col=this%decomp_soil_vr_col, default='inactive') + end if + this%decomp_cpools_vr_col(begc:endc,:,:) = spval do l = 1, ndecomp_pools if ( nlevdecomp_full > 1 ) then @@ -279,6 +296,13 @@ subroutine InitHistory(this, bounds, carbon_type) if ( carbon_type == 'c14' ) then + if ( nlevdecomp_full > 1 ) then + this%decomp_soil_vr_col(begc:endc,:) = spval + call hist_addfld2d (fname='C14_SOILC_vr', units='gC14/m^3', type2d='levsoi', & + avgflag='A', long_name='C14 SOIL C (vertically resolved)', & + ptr_col=this%decomp_soil_vr_col) + end if + this%decomp_cpools_vr_col(begc:endc,:,:) = spval do l = 1, ndecomp_pools if ( nlevdecomp_full > 1 ) then @@ -780,6 +804,9 @@ subroutine Summary(this, bounds, num_allc, filter_allc) integer :: c,j,k,l ! indices integer :: fc ! filter indices real(r8) :: maxdepth ! depth to integrate soil variables + integer :: i_soil1 ! ndecomp_pools index for SOIL1 + integer :: i_soil2 ! ndecomp_pools index for SOIL2 + integer :: i_soil3 ! ndecomp_pools index for SOIL3 !----------------------------------------------------------------------- ! vertically integrate each of the decomposing C pools @@ -832,6 +859,32 @@ subroutine Summary(this, bounds, num_allc, filter_allc) endif + ! Find ndecomp_pools indices for SOIL1, SOIL2, and SOIL3 and add together to + ! produce vertically-resolved decomposing total soil c pool + do l = 1, ndecomp_pools + if ( nlevdecomp_full > 1 ) then + if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL1") then + i_soil1 = l + end if + if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL2") then + i_soil2 = l + end if + if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL3") then + i_soil3 = l + end if + end if + end do + if ( nlevdecomp_full > 1 ) then + do j = 1, nlevdecomp + do fc = 1,num_allc + c = filter_allc(fc) + this%decomp_soil_vr_col(c,j) = this%decomp_cpools_vr_col(c,j,i_soil1) + & + this%decomp_cpools_vr_col(c,j,i_soil2) + & + this%decomp_cpools_vr_col(c,j,i_soil3) + end do + end do + end if + ! truncation carbon do fc = 1,num_allc c = filter_allc(fc) From 6d560e47890ec1b045063e5818dea3140a97511c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 31 Oct 2018 08:48:49 -0600 Subject: [PATCH 291/730] Rewrote to be more general using decomp_cascade_con%is_soil. Added SOILN_vr (sum of SOIL1N_vr, SOIL2N_vr, SOIL3N_vr). Adjusted cime_config/usermods_dirs variables. --- .../cmip6_carbon_isotopes/user_nl_clm | 4 +- .../usermods_dirs/output_bgc/user_nl_clm | 4 +- .../SoilBiogeochemCarbonStateType.F90 | 54 ++++++++----------- .../SoilBiogeochemNitrogenStateType.F90 | 32 +++++++++++ 4 files changed, 60 insertions(+), 34 deletions(-) diff --git a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm index e7c6fbf7e8..4afeb952ee 100644 --- a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm +++ b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm @@ -7,6 +7,8 @@ use_c14 = .true. use_c13_timeseries = .true. use_c14_bombspike = .true. +! h0 stream (monthly average, gridcell-level) +hist_fexcl1 += 'C14_SOILC_vr' ! h3 stream (yearly average, gridcell-level) -hist_fincl4 += 'C14_SOIL1C_vr', 'C14_SOIL2C_vr', 'C14_SOIL3C_vr' +hist_fincl4 += 'C14_SOILC_vr' diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm index c97c282ff6..de136ad4b4 100644 --- a/cime_config/usermods_dirs/output_bgc/user_nl_clm +++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm @@ -3,7 +3,7 @@ !---------------------------------------------------------------------------------- ! h0 stream (monthly average, gridcell-level) -hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' +hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'SOILC_vr','SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' ! h1 stream (monthly average, finest sub-grid) @@ -14,7 +14,7 @@ hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTO hist_fincl3 += 'GPP', 'NPP', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'SLASH_HARVESTC', 'COL_FIRE_CLOSS', 'DWT_SLASH_CFLUX', 'FROOTC:I', 'HTOP' ! h3 stream (yearly average, gridcell-level) -hist_fincl4 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I' +hist_fincl4 += 'SOILC_vr', 'SOILN_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I' ! h4 stream (yearly average, landunit-level) hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 index 64da935dea..1c2fdd01bc 100644 --- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 @@ -25,7 +25,7 @@ module SoilBiogeochemCarbonStateType ! all c pools involved in decomposition real(r8), pointer :: decomp_cpools_vr_col (:,:,:) ! (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - real(r8), pointer :: decomp_soil_vr_col(:,:) ! (gC/m3) vertically-resolved decomposing total soil c pool + real(r8), pointer :: decomp_soilc_vr_col (:,:) ! (gC/m3) vertically-resolved decomposing total soil c pool real(r8), pointer :: ctrunc_vr_col (:,:) ! (gC/m3) vertically-resolved column-level sink for C truncation ! summary (diagnostic) state variables, not involved in mass balance @@ -103,8 +103,8 @@ subroutine InitAllocate(this, bounds) allocate(this%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) this%decomp_cpools_vr_col(:,:,:)= nan - allocate(this%decomp_soil_vr_col(begc:endc,1:nlevdecomp_full)) - this%decomp_soil_vr_col(:,:)= nan + allocate(this%decomp_soilc_vr_col(begc:endc,1:nlevdecomp_full)) + this%decomp_soilc_vr_col(:,:)= nan allocate(this%ctrunc_col (begc :endc)) ; this%ctrunc_col (:) = nan if ( .not. use_fates ) then @@ -149,10 +149,10 @@ subroutine InitHistory(this, bounds, carbon_type) if (carbon_type == 'c12') then if ( nlevdecomp_full > 1 ) then - this%decomp_soil_vr_col(begc:endc,:) = spval + this%decomp_soilc_vr_col(begc:endc,:) = spval call hist_addfld2d (fname='SOILC_vr', units='gC/m^3', type2d='levsoi', & avgflag='A', long_name='SOIL C (vertically resolved)', & - ptr_col=this%decomp_soil_vr_col) + ptr_col=this%decomp_soilc_vr_col) end if this%decomp_cpools_col(begc:endc,:) = spval @@ -228,10 +228,10 @@ subroutine InitHistory(this, bounds, carbon_type) if ( carbon_type == 'c13' ) then if ( nlevdecomp_full > 1 ) then - this%decomp_soil_vr_col(begc:endc,:) = spval + this%decomp_soilc_vr_col(begc:endc,:) = spval call hist_addfld2d (fname='C13_SOILC_vr', units='gC13/m^3', type2d='levsoi', & avgflag='A', long_name='C13 SOIL C (vertically resolved)', & - ptr_col=this%decomp_soil_vr_col, default='inactive') + ptr_col=this%decomp_soilc_vr_col, default='inactive') end if this%decomp_cpools_vr_col(begc:endc,:,:) = spval @@ -297,10 +297,10 @@ subroutine InitHistory(this, bounds, carbon_type) if ( carbon_type == 'c14' ) then if ( nlevdecomp_full > 1 ) then - this%decomp_soil_vr_col(begc:endc,:) = spval + this%decomp_soilc_vr_col(begc:endc,:) = spval call hist_addfld2d (fname='C14_SOILC_vr', units='gC14/m^3', type2d='levsoi', & avgflag='A', long_name='C14 SOIL C (vertically resolved)', & - ptr_col=this%decomp_soil_vr_col) + ptr_col=this%decomp_soilc_vr_col) end if this%decomp_cpools_vr_col(begc:endc,:,:) = spval @@ -804,9 +804,6 @@ subroutine Summary(this, bounds, num_allc, filter_allc) integer :: c,j,k,l ! indices integer :: fc ! filter indices real(r8) :: maxdepth ! depth to integrate soil variables - integer :: i_soil1 ! ndecomp_pools index for SOIL1 - integer :: i_soil2 ! ndecomp_pools index for SOIL2 - integer :: i_soil3 ! ndecomp_pools index for SOIL3 !----------------------------------------------------------------------- ! vertically integrate each of the decomposing C pools @@ -859,30 +856,25 @@ subroutine Summary(this, bounds, num_allc, filter_allc) endif - ! Find ndecomp_pools indices for SOIL1, SOIL2, and SOIL3 and add together to - ! produce vertically-resolved decomposing total soil c pool - do l = 1, ndecomp_pools - if ( nlevdecomp_full > 1 ) then - if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL1") then - i_soil1 = l - end if - if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL2") then - i_soil2 = l - end if - if (trim(decomp_cascade_con%decomp_pool_name_history(l)) == "SOIL3") then - i_soil3 = l - end if - end if - end do + ! Add soil carbon pools together to produce vertically-resolved decomposing total soil c pool if ( nlevdecomp_full > 1 ) then do j = 1, nlevdecomp do fc = 1,num_allc c = filter_allc(fc) - this%decomp_soil_vr_col(c,j) = this%decomp_cpools_vr_col(c,j,i_soil1) + & - this%decomp_cpools_vr_col(c,j,i_soil2) + & - this%decomp_cpools_vr_col(c,j,i_soil3) + this%decomp_soilc_vr_col(c,j) = 0._r8 end do - end do + end do + do l = 1, ndecomp_pools + if ( decomp_cascade_con%is_soil(l) ) then + do j = 1, nlevdecomp + do fc = 1,num_allc + c = filter_allc(fc) + this%decomp_soilc_vr_col(c,j) = this%decomp_soilc_vr_col(c,j) + & + this%decomp_cpools_vr_col(c,j,l) + end do + end do + end if + end do end if ! truncation carbon diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 index ca09e63624..7b045785e0 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 @@ -27,6 +27,8 @@ module SoilBiogeochemNitrogenStateType type, public :: soilbiogeochem_nitrogenstate_type real(r8), pointer :: decomp_npools_vr_col (:,:,:) ! col (gN/m3) vertically-resolved decomposing (litter, cwd, soil) N pools + real(r8), pointer :: decomp_soiln_vr_col (:,:) ! col (gN/m3) vertically-resolved decomposing total soil N pool + real(r8), pointer :: sminn_vr_col (:,:) ! col (gN/m3) vertically-resolved soil mineral N real(r8), pointer :: ntrunc_vr_col (:,:) ! col (gN/m3) vertically-resolved column-level sink for N truncation @@ -128,6 +130,8 @@ subroutine InitAllocate(this, bounds) allocate(this%decomp_npools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); this%decomp_npools_vr_col(:,:,:)= nan + allocate(this%decomp_soiln_vr_col(begc:endc,1:nlevdecomp_full)) + this%decomp_soiln_vr_col(:,:)= nan end subroutine InitAllocate @@ -160,6 +164,13 @@ subroutine InitHistory(this, bounds) begc = bounds%begc; endc = bounds%endc + if ( nlevdecomp_full > 1 ) then + this%decomp_soiln_vr_col(begc:endc,:) = spval + call hist_addfld2d (fname='SOILN_vr', units='gN/m^3', type2d='levdcmp', & + avgflag='A', long_name='SOIL N (vertically resolved)', & + ptr_col=this%decomp_soiln_vr_col) + end if + if ( nlevdecomp_full > 1 ) then this%decomp_npools_vr_col(begc:endc,:,:) = spval this%decomp_npools_1m_col(begc:endc,:) = spval @@ -801,6 +812,27 @@ subroutine Summary(this, bounds, num_allc, filter_allc) endif end do end do + + ! Add soil nitrogen pools together to produce vertically-resolved decomposing total soil N pool + if ( nlevdecomp_full > 1 ) then + do j = 1, nlevdecomp + do fc = 1,num_allc + c = filter_allc(fc) + this%decomp_soiln_vr_col(c,j) = 0._r8 + end do + end do + do l = 1, ndecomp_pools + if ( decomp_cascade_con%is_soil(l) ) then + do j = 1, nlevdecomp + do fc = 1,num_allc + c = filter_allc(fc) + this%decomp_soiln_vr_col(c,j) = this%decomp_soiln_vr_col(c,j) + & + this%decomp_npools_vr_col(c,j,l) + end do + end do + end if + end do + end if ! total litter nitrogen to 1 meter (TOTLITN_1m) do fc = 1,num_allc From 3ef3512f556feb561f30d2510b5ec1b3d01c91e0 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 18 Jan 2019 14:21:07 -0700 Subject: [PATCH 292/730] Output cpl hist files in SSP test Fixes ESCOMP/ctsm#61 --- cime_config/config_tests.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index 33f8b4a692..3453d55be0 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -57,12 +57,15 @@ SSP smoke CLM spinup test (only valid for CLM compsets with CLM45) - smoke CLM spinup test (only valid for CLM45 or CLM50 compsets) + smoke CLM spinup test 1 ndays startup 4 FALSE + FALSE + $STOP_OPTION + $STOP_N From 80119044f2681431416cc279a3de2c2d18fd6e6f Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 18 Jan 2019 14:50:53 -0700 Subject: [PATCH 293/730] Remove FATES-related commented-out code in OzoneMod This has been moved to https://github.com/ESCOMP/ctsm/issues/618 --- src/biogeophys/OzoneMod.F90 | 60 ++++++++++--------------------------- 1 file changed, 15 insertions(+), 45 deletions(-) diff --git a/src/biogeophys/OzoneMod.F90 b/src/biogeophys/OzoneMod.F90 index 29b94fa34f..78bf64a8fe 100644 --- a/src/biogeophys/OzoneMod.F90 +++ b/src/biogeophys/OzoneMod.F90 @@ -361,51 +361,21 @@ subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, & p = filter_exposedvegp(fp) c = patch%column(p) -! if (.not.patch%is_fates(p)) then ! When FATES coexists with other vegetation, - ! or when it has an ozone compatible module, this - ! logic will likely come into play - - ! Ozone stress for shaded leaves - call CalcOzoneStressOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssha(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesha(p), o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p)) - - ! Ozone stress for sunlit leaves - call CalcOzoneStressOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssun(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesun(p), o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p)) - - tlai_old(p) = tlai(p) - -! else -! ! FATES is fundamentlaly incompatible with this type of patch-level -! ! association with plant functional type, so for the time -! ! being, fates patches will just push these values to invalid -! o3uptakesha(p) = spval -! o3coefvsha(p) = spval -! o3coefgsha(p) = spval -! o3uptakesun(p) = spval -! o3coefvsun(p) = spval -! o3coefgsun(p) = spval -! -! end if - -! else -! ! FATES is fundamentlaly incompatible with this type of patch-level -! ! association with plant functional type, so for the time -! ! being, fates patches will just push these values to invalid -! o3uptakesha(p) = spval -! o3coefvsha(p) = spval -! o3coefgsha(p) = spval -! o3uptakesun(p) = spval -! o3coefvsun(p) = spval -! o3coefgsun(p) = spval -! -! end if + ! Ozone stress for shaded leaves + call CalcOzoneStressOnePoint( & + forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & + rs=rssha(p), rb=rb(p), ram=ram(p), & + tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & + o3uptake=o3uptakesha(p), o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p)) + + ! Ozone stress for sunlit leaves + call CalcOzoneStressOnePoint( & + forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & + rs=rssun(p), rb=rb(p), ram=ram(p), & + tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & + o3uptake=o3uptakesun(p), o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p)) + + tlai_old(p) = tlai(p) end do From 3558384f172d9190422abfb79473d2d857e1f848 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 18 Jan 2019 15:16:43 -0700 Subject: [PATCH 294/730] Re-add note that SSP is only valid for clm45/clm50 --- cime_config/config_tests.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index 3453d55be0..fb04cfb692 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -57,7 +57,7 @@ SSP smoke CLM spinup test (only valid for CLM compsets with CLM45) - smoke CLM spinup test + smoke CLM spinup test (only valid for CLM45 or CLM50 compsets) 1 ndays startup From e4054b4535b15f608835bc671e303ec48150169d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 23 Jan 2019 11:03:31 -0700 Subject: [PATCH 295/730] Update ChangeLog --- doc/ChangeLog | 106 ++++++++++++++++++++++++++++++++++ doc/ChangeSum | 2 + doc/release-clm5.0.ChangeLog | 109 +++++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8870afa69e..52fef26586 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,110 @@ =============================================================== +Tag name: ctsm1.0.dev025 +Originator(s): Keith Oleson, Bill Sacks +Date: Wed Jan 23 10:48:01 MST 2019 +One-line Summary: History fields for vertically-resolved sums of soil C and N, and minor fixes + +Purpose of changes +------------------ + +Main change is from Keith Oleson: Add history fields for +vertically-resolved sums of SOIL1C, SOIL2C, and SOIL3C for C12, C13, +C14, and similarly for N. New fields are SOILC_vr, C13_SOILC_vr, and +C14_SOILC_vr, and SOILN_vr. For runs that use the output_bgc usermods, +including cmip6 runs, we no longer output 'SOIL1C_vr', 'SOIL1N_vr', +'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr'; instead we output +'SOILC_vr', 'SOILN_vr', and similarly for C isotopes. + +Also minor fixes: +- Output cpl hist files in SSP test (resolves ESCOMP/ctsm#61) +- Remove FATES-related commented-out code in OzoneMod (this has been + moved to https://github.com/ESCOMP/ctsm/issues/618) +- Minor tweak to run_sys_tests + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#61 + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): +- For runs that use the output_bgc usermods, including cmip6 runs, we no + longer output 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', + 'SOIL3C_vr', 'SOIL3N_vr'; instead we output 'SOILC_vr', 'SOILN_vr', + and similarly for C isotopes. + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: none + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +Code reviewed by: Bill Sacks; Erik Kluzek reviewed the changes to the SSP test + + +CTSM testing: + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + regular tests (aux_clm): + + cheyenne ---- pass + hobart ------ pass + +CTSM tag used for the baseline comparisons: ctsm1.0.dev024 + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/551 + +=============================================================== +=============================================================== Tag name: ctsm1.0.dev015 Originator(s): sacks (Bill Sacks) Date: Sun Oct 28 14:29:30 MDT 2018 diff --git a/doc/ChangeSum b/doc/ChangeSum index 9bb694f080..9fc609ebbb 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,7 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.17 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes + ctsm1.0.dev025 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes release-clm5.0.16 erik 01/15/2019 PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere release-clm5.0.15 sacks 12/06/2018 Option for rain-to-snow to immediately run off in some regions release-clm5.0.14 erik 11/29/2018 Update cime and fix surface dataset for f05 1850 non-crop case diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 783713ad60..d9004d3c81 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,113 @@ =============================================================== +Tag name: release-clm5.0.17 +Originator(s): Keith Oleson, Bill Sacks +Date: Wed Jan 23 11:03:22 MST 2019 +One-line Summary: History fields for vertically-resolved sums of soil C and N, and minor fixes + +Purpose of this version: +------------------------ + +Main change is from Keith Oleson: Add history fields for +vertically-resolved sums of SOIL1C, SOIL2C, and SOIL3C for C12, C13, +C14, and similarly for N. New fields are SOILC_vr, C13_SOILC_vr, and +C14_SOILC_vr, and SOILN_vr. For runs that use the output_bgc usermods, +including cmip6 runs, we no longer output 'SOIL1C_vr', 'SOIL1N_vr', +'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr'; instead we output +'SOILC_vr', 'SOILN_vr', and similarly for C isotopes. + +Also minor fixes: +- Output cpl hist files in SSP test (resolves ESCOMP/ctsm#61) +- Remove FATES-related commented-out code in OzoneMod (this has been + moved to https://github.com/ESCOMP/ctsm/issues/618) +- Minor tweak to run_sys_tests + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#61 + +Science changes since: release-clm5.0.16 + None + +Software changes since: release-clm5.0.16 + See above + +Changes to User Interface since: release-clm5.0.16 + None + +Testing: +-------- + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - pass + hobart --- not run + + tools-tests (components/clm/test/tools): + + cheyenne - not run + hobart --- not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + hobart --- not run + + regular tests (aux_clm): + + cheyenne_intel ---- pass + cheyenne_gnu ------ pass + hobart_nag -------- pass + hobart_pgi -------- pass + hobart_intel ------ pass + + regular tests (prealpha): + + cheyenne_intel - not run + cheyenne_gnu --- not run + hobart_nag ----- not run + + regular tests (prebeta): + + cheyenne_intel - not run + cheyenne_gnu --- not run + hobart_nag ----- not run + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.16 + +Changes answers relative to baseline: NO + + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime_cesm2_1_rel_06 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: ctsm1.0.dev025 + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/ctsm/pull/551 + +=============================================================== +=============================================================== Tag name: release-clm5.0.16 Originator(s): erik (Erik Kluzek) Date: Tue Jan 15 15:13:43 MST 2019 From bb1bd0be733c09976dac3e69267546df24364460 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 23 Jan 2019 11:31:45 -0700 Subject: [PATCH 296/730] Correct name of pointer for QSNOEVAP in history, this fixes #624 --- src/biogeophys/WaterfluxType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 index 849a0dd21f..40dd0f5979 100644 --- a/src/biogeophys/WaterfluxType.F90 +++ b/src/biogeophys/WaterfluxType.F90 @@ -432,7 +432,7 @@ subroutine InitHistory(this, bounds) this%qflx_ev_snow_patch(begp:endp) = spval call hist_addfld1d (fname='QSNOEVAP', units='mm/s', & avgflag='A', long_name='evaporation from snow', & - ptr_patch=this%qflx_tran_veg_patch, set_lake=0._r8, c2l_scale_type='urbanf') + ptr_patch=this%qflx_ev_snow_patch, set_lake=0._r8, c2l_scale_type='urbanf') this%qflx_snowindunload_patch(begp:endp) = spval call hist_addfld1d (fname='QSNO_WINDUNLOAD', units='mm/s', & From 6b226d51660b3881920bdcf4a1399244962b7f3a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:32:55 -0700 Subject: [PATCH 297/730] Start adding notes about the contrib directory and add some initial scripts --- README | 4 + tools/README | 5 + tools/contrib/README | 31 ++ tools/contrib/SpinupStability_v6.ncl | 667 ++++++++++++++++++++++++ tools/contrib/run_clm_historical.v1.csh | 149 ++++++ 5 files changed, 856 insertions(+) create mode 100755 tools/contrib/README create mode 100644 tools/contrib/SpinupStability_v6.ncl create mode 100755 tools/contrib/run_clm_historical.v1.csh diff --git a/README b/README index e3d7c0930b..92e7a77e81 100644 --- a/README +++ b/README @@ -121,6 +121,10 @@ tools/ncl_scripts ------------ Directory of NCL and perl scripts to do various tasks. Most notably to plot perturbation error growth testing and to extract regional information from global datasets for single-point/regional simulations. +tools/contrib ----------------- Miscellansous useful scripts for pre and post processing + as well as case management of CTSM. These scripts are + contributed by users and may not be as well tested or + supported as other tools. ============================================================================================= diff --git a/tools/README b/tools/README index 006d3ac063..780e9f6e91 100644 --- a/tools/README +++ b/tools/README @@ -15,6 +15,11 @@ I. General directory structure: can be plotted easily ncl_scripts ------ NCL post or pre processing scripts. + contrib ---------- Miscellaneous tools for pre or post processing of CTSM. + Typically these are contributed by anyone who has something + they think might be helpful to the community. They may not + be as well tested or supported as other tools. + cime-tools ($CIMEROOT/tools/) (CIMEROOT is ../cime for a CTSM checkout and ../../../cime for a CESM checkout) $CIMEROOT/mapping/gen_domain_files gen_domain ------- Create data model domain datasets from SCRIP mapping datasets. diff --git a/tools/contrib/README b/tools/contrib/README new file mode 100755 index 0000000000..3ae1ec4f83 --- /dev/null +++ b/tools/contrib/README @@ -0,0 +1,31 @@ +$CTSMROOT/tools/contrib/README Jan/24/2019 + +The purpose of this directory is for users of CTSM to contribute scripts for pre or post processing or +case management of CTSM that others might find useful. The script should have some documentation made +available before adding it. These scripts may not be as well tested or supported as other CTSM +tools. + + +Brief description of scripts: + +run_clm_historical.csh + does all the setup and submission required to do a 1850-2010 CLM + historical simulation in three separate submissions + v1 - Andrew Slater+Dave Lawrence, 8/2015 + +subset_surfdata.py + create regional domain, surface data, and rtm directional files by + extracting data from global datasets + v1 - Sean Swenson 8/2015 + +singlept.py + create single point domain, surface data, and datm forcing files by + extracting data from global datasets + v1 - Sean Swenson 8/2015 + +SpinupStability_v6.ncl + This script assesses the equilibrium state of a spinup run + v6, works on either monthly or annual mean history files - Keith Oleson 7/2016 + + + diff --git a/tools/contrib/SpinupStability_v6.ncl b/tools/contrib/SpinupStability_v6.ncl new file mode 100644 index 0000000000..08fba17859 --- /dev/null +++ b/tools/contrib/SpinupStability_v6.ncl @@ -0,0 +1,667 @@ +; NCL script +; SpinupStability_v6.ncl +; Script to examine stability of spinup simulation. +; This version operates on either monthly mean or multi-annual mean multi-variable history files +; Keith Oleson, May 2016 + +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" +load "~oleson/lnd_diag/run/contributed.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" + +begin + + print ("=========================================") + print ("Start Time: "+systemfunc("date") ) + print ("=========================================") + +;=======================================================================; +; This script produces a page of plots of various variables that are evaluated +; as to whether they are spunup or not. A summary of variables in equilibrium +; and/or in disequilibrium is also produced to standard out. The postscript output +; is $caseid_spinup.ps in the pwd. +; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS. +; The percentage of land area in TOTECOSYSC disequilibrium is also examined. +; Thresholds are defined below (i.e., global_thresh_*) and can be changed for individual +; variables. +; To run this script, just enter in your case name and username below. +; AND set the annual_hist flag to "True" if your case has annual mean history files or set +; annual_hist flag to "False" if your case has monthly mean history files. +; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist +;=======================================================================; +; caseid = "clm458r177_wwparam_1850spin" +; username = "oleson" +; annual_hist = "False" + +; caseid = "respn14r172_wwparam_1850spinACC" +; username = "oleson" +; annual_hist = "False" + +; caseid = "respn14r172_1850spin" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm458r177_modRESORB1_wwparam_1850spin" +; username = "wwieder" +; annual_hist = "False" + +; caseid = "respmods_n19_clm4_5_8_r174_4x5_bareground_ADspin_3" +; username = "rfisher" +; annual_hist = "True" + +; caseid = "respn19r174_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respmods_r78397_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respmods_5_4x5_bareground_PADspin_4" +; username = "rfisher" +; annual_hist = "False" + +; caseid = "respmods_r78397crop_1850spin" +; username = "rfisher" +; annual_hist = "False" + +; caseid = "respmods_r78397crop_1850postADspin" +; username = "rfisher" +; annual_hist = "False" + +; caseid = "respn24r174crop_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respn24r174crop_1850PostADspin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respn24r174crop_1850PostADspin2" +; username = "oleson" +; annual_hist = "True" + +; caseid = "b.e15.B1850.f09_g16.pi_control.all.72_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "b.e15.B1850.f09_g16.pi_control.all.72_1850spinn24" +; username = "oleson" +; annual_hist = "False" + +; caseid = "respn27r174crop_2deg_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respn27r174Con_2deg_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respn27r174BenPRootWC_2deg_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "respn27r174BenPRootWCcrop_2deg_1850spin" +; username = "oleson" +; annual_hist = "True" + +; caseid = "i.e15.a06.B1850.f09_g16.21ka_cpl.04" +; username = "tomas" +; annual_hist = "False" + +; caseid = "respmods_n30_clm4_5_8_r182_4x5_bareground_AD_1" +; username = "rfisher" +; annual_hist = "True" + + caseid = "respmods_n30_clm4_5_8_r182_4x5_kattge_hydr_08072016params" + username = "rfisher" + annual_hist = "True" + + do_plot = "True" +; do_plot = "False" +;=======================================================================; + + data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" +; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" + + subper = 20 ; Subsampling period in years +; subper = 5 ; Subsampling period in years + +; Thresholds + glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) + glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) + glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta PgC / yr) + glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) + glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) + glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) + glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr + totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) + + if (annual_hist .eq. "True") then + fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*-*-*"+".nc") + else + fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*"+".nc") + end if + flsdims = dimsizes(fls) + + if (annual_hist .eq. "True") then + lstfile = addfile(fls(flsdims-1),"r") + else + lstfile = addfile(fls(flsdims-12),"r") ;last month (DEC) of any year has mdate for next year + ;so grab JAN of last year + end if + + if (annual_hist .eq. "True") then + lstyrdim = dimsizes(lstfile->mcdate) + mcdate_lst = lstfile->mcdate(lstyrdim-1) + else + mcdate_lst = lstfile->mcdate + end if + lstyr = toint(mcdate_lst)/10000 + + fstfile = addfile(fls(0),"r") + if (annual_hist .eq. "True") then + mcdate_fst = fstfile->mcdate(0) + else + mcdate_fst = fstfile->mcdate + end if + fstyr = toint(mcdate_fst)/10000 + + yearplt = ispan(fstyr,lstyr,subper) + yearpltrev = yearplt(::-1) + year = ispan(fstyr,lstyr,subper) - fstyr + nyrs = dimsizes(year) + yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-1),subper) + +; Build an array of monthly indices + monstr = new(nyrs*12,"integer") + do i = 0,nyrs-1 + monstr(i*12:i*12+11) = ispan(year(i)*12,year(i)*12+11,1) + end do + +; Add the data files together + if (annual_hist .eq. "True") then + data = addfiles(fls, "r") + ListSetType (data, "cat") + else + data = addfiles(fls(monstr), "r") + end if + +; Convert to annual means + if (annual_hist .eq. "True") then + totecosysc = data[:]->TOTECOSYSC(year,:,:) + totsomc = data[:]->TOTSOMC(year,:,:) + totvegc = data[:]->TOTVEGC(year,:,:) + tlai = data[:]->TLAI(year,:,:) + gpp = data[:]->GPP(year,:,:) + tws = data[:]->TWS(year,:,:) + else + totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) + totsomc = month_to_annual(data[:]->TOTSOMC,1) + totvegc = month_to_annual(data[:]->TOTVEGC,1) + tlai = month_to_annual(data[:]->TLAI,1) + gpp = month_to_annual(data[:]->GPP,1) + tws = month_to_annual(data[:]->TWS,1) + end if + lat = data[0]->lat + nlat = dimsizes(lat) + lon = data[0]->lon + nlon = dimsizes(lon) + landfrac = data[0]->landfrac + area = data[0]->area + aream = area*1.e6 + landarea = landfrac*aream + gtoPg = 1e-15 + secinyr = 60.*60.*24.*365. + +; TOTECOSYSC + landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc + totecosysc_area = totecosysc*landareaC ; correcting totecosysc for total land area + totecosysc_pg = totecosysc_area*gtoPg ; g to Pg + totecosysc_glob = dim_sum_n(totecosysc_pg, (/1,2/)) ; sums over all latitudes + totecosysc_glob!0 = "year" + totecosysc_glob&year = yearplt + totecosysc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totecosysc_glob_del(i) = (totecosysc_glob(i+1) - totecosysc_glob(i))/subper + end do + totecosysc_glob_del!0 = "year" + totecosysc_glob_del&year = yearpltmid + indx = where(abs(totecosysc_glob_del) .lt. glob_thresh_totecosysc,1,0) + if (all(indx .eq. 1)) then + totecosysc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totecosysc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totecosysc_glob_equil = -999 + end if + end if + totecosysc_glob_equil@_FillValue = -999 + delete(indx) + +; Land area not in TOTECOSYSC equilibrium + landarea_noequil = new((/nyrs-1,nlat,nlon/),"float") + do i = 0,nyrs-2 + landarea_noequil(i,:,:) = where((totecosysc(i+1,:,:) - totecosysc(i,:,:))/subper .gt. totecosysc_thresh, landarea, 0.) + end do + perc_landarea_noequil = 100.*(dim_sum_n(landarea_noequil,(/1,2/))/sum(landarea)) + indx = where(abs(perc_landarea_noequil) .lt. glob_thresh_area,1,0) + if (all(indx .eq. 1)) then + perc_landarea_glob_noequil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + perc_landarea_glob_noequil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + perc_landarea_glob_noequil = -999 + end if + end if + perc_landarea_glob_noequil@_FillValue = -999 + delete(indx) + totecosysc_1_map = where(landarea_noequil(nyrs-2,:,:) .ne. 0.,(totecosysc(nyrs-1,:,:)-totecosysc(nyrs-2,:,:))/subper,totecosysc@_FillValue) + totecosysc_1_map!0 = "lat" + totecosysc_1_map&lat = lat + totecosysc_1_map!1 = "lon" + totecosysc_1_map&lon = lon + totecosysc_2_map = where(landarea_noequil(nyrs-3,:,:) .ne. 0.,(totecosysc(nyrs-2,:,:)-totecosysc(nyrs-3,:,:))/subper,totecosysc@_FillValue) + copy_VarCoords(totecosysc_1_map,totecosysc_2_map) + +; TOTSOMC + totsomc_area = totsomc*landareaC ; correcting totsomc for total land area + totsomc_pg = totsomc_area*gtoPg ; g to Pg + totsomc_glob = dim_sum_n(totsomc_pg, (/1,2/)) ; sums over all latitudes + totsomc_glob!0 = "year" + totsomc_glob&year = yearplt + totsomc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totsomc_glob_del(i) = (totsomc_glob(i+1) - totsomc_glob(i))/subper + end do + totsomc_glob_del!0 = "year" + totsomc_glob_del&year = yearpltmid + indx = where(abs(totsomc_glob_del) .lt. glob_thresh_totsomc,1,0) + if (all(indx .eq. 1)) then + totsomc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totsomc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totsomc_glob_equil = -999 + end if + end if + totsomc_glob_equil@_FillValue = -999 + delete(indx) + +; TOTVEGC + totvegc_area = totvegc*landareaC ; correcting totvegc for total land area + totvegc_pg = totvegc_area*gtoPg ; g to Pg + totvegc_glob = dim_sum_n(totvegc_pg, (/1,2/)) ; sums over all latitudes + totvegc_glob!0 = "year" + totvegc_glob&year = yearplt + totvegc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totvegc_glob_del(i) = (totvegc_glob(i+1) - totvegc_glob(i))/subper + end do + totvegc_glob_del!0 = "year" + totvegc_glob_del&year = yearpltmid + indx = where(abs(totvegc_glob_del) .lt. glob_thresh_totvegc,1,0) + if (all(indx .eq. 1)) then + totvegc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totvegc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totvegc_glob_equil = -999 + end if + end if + totvegc_glob_equil@_FillValue = -999 + delete(indx) + +; TLAI + areasum = sum(area*landfrac) + areaL = area*landfrac + landareaL = conform_dims(dimsizes(tlai),areaL,(/1,2/)) ; conforming dimensions of areaL to tlai + tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1,2/)) ; weighted global tlai + tlai_glob!0 = "year" + tlai_glob&year = yearplt + tlai_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + tlai_glob_del(i) = (tlai_glob(i+1) - tlai_glob(i))/subper + end do + tlai_glob_del!0 = "year" + tlai_glob_del&year = yearpltmid + indx = where(abs(tlai_glob_del) .lt. glob_thresh_tlai,1,0) + if (all(indx .eq. 1)) then + tlai_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + tlai_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + tlai_glob_equil = -999 + end if + end if + tlai_glob_equil@_FillValue = -999 + delete(indx) + +; GPP + gpp_area = gpp*landareaC ; correcting gpp for total land area + gpp_pg = gpp_area*gtoPg*secinyr ; g to Pg and sec to yrs + gpp_glob = dim_sum_n(gpp_pg, (/1,2/)) ; sums over all latitudes + gpp_glob!0 = "year" + gpp_glob&year = yearplt + gpp_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + gpp_glob_del(i) = (gpp_glob(i+1) - gpp_glob(i))/subper + end do + gpp_glob_del!0 = "year" + gpp_glob_del&year = yearpltmid + indx = where(abs(gpp_glob_del) .lt. glob_thresh_gpp,1,0) + if (all(indx .eq. 1)) then + gpp_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + gpp_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + gpp_glob_equil = -999 + end if + end if + gpp_glob_equil@_FillValue = -999 + delete(indx) + +; TWS + tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) + tws_glob!0 = "year" + tws_glob&year = yearplt + tws_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + tws_glob_del(i) = (tws_glob(i+1) - tws_glob(i))/subper + end do + tws_glob_del!0 = "year" + tws_glob_del&year = yearpltmid + indx = where(abs(tws_glob_del) .lt. glob_thresh_tws,1,0) + if (all(indx .eq. 1)) then + tws_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + tws_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + tws_glob_equil = -999 + end if + end if + tws_glob_equil@_FillValue = -999 + delete(indx) + +;===============================Plotting====================================; + if (do_plot .eq. "True") then + +; wks_type = "png" +; wks_type@wkWidth = 2500 +; wks_type@wkHeight = 2500 +; wks_type = "x11" + wks_type = "ps" +; wks_type = "pdf" + wks = gsn_open_wks (wks_type, caseid+"_Spinup") + gsn_define_colormap(wks, "ViBlGrWhYeOrRe") + + plot = new(13,"graphic") + + resP = True +; resP@gsnMaximize = True + resP@gsnPaperOrientation = "portrait" + resP@gsnFrame = False + resP@gsnDraw = True + resP@txString = caseid + " Annual Mean " + resP@gsnPanelXWhiteSpacePercent = 2. + resP@gsnPanelCenter = False +; resP@gsnPanelDebug = True + + res = True + res@gsnFrame = False + res@gsnDraw = False + res@xyLineThicknessF = 2 + + polyres1 = True + polyres1@gsLineDashPattern = 16 + polyres2 = True + polyres2@gsLineDashPattern = 2 + + res@tiXAxisString = " " + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTECOSYSC" + plot(0) = gsn_csm_xy(wks,yearplt,totecosysc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTECOSYSC " + "EqYr: "+totecosysc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(1) = gsn_csm_xy(wks,yearpltmid,totecosysc_glob_del,res) + prim1 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim2 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totecosysc,-glob_thresh_totecosysc/),polyres2) + prim3 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totecosysc,glob_thresh_totecosysc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTSOMC" + plot(2) = gsn_csm_xy(wks,yearplt,totsomc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTSOMC " + "EqYr: "+totsomc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(3) = gsn_csm_xy(wks,yearpltmid,totsomc_glob_del,res) + prim4 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim5 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totsomc,-glob_thresh_totsomc/),polyres2) + prim6 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totsomc,glob_thresh_totsomc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTVEGC" + plot(4) = gsn_csm_xy(wks,yearplt,totvegc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTVEGC " + "EqYr: "+totvegc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(5) = gsn_csm_xy(wks,yearpltmid,totvegc_glob_del,res) + prim7 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim8 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totvegc,-glob_thresh_totvegc/),polyres2) + prim9 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totvegc,glob_thresh_totvegc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" + res@tiMainString = "TLAI" + plot(6) = gsn_csm_xy(wks,yearplt,tlai_glob,res) + + res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" + res@tiMainString = "Delta TLAI " + "EqYr: "+tlai_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(7) = gsn_csm_xy(wks,yearpltmid,tlai_glob_del,res) + prim10 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim11 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tlai,-glob_thresh_tlai/),polyres2) + prim12 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tlai,glob_thresh_tlai/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiMainString = "GPP" + plot(8) = gsn_csm_xy(wks,yearplt,gpp_glob,res) + + res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiXAxisString = "Spinup Year" + res@tiMainString = "Delta GPP " + "EqYr: "+gpp_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(9) = gsn_csm_xy(wks,yearpltmid,gpp_glob_del,res) + prim13 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim14 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_gpp,-glob_thresh_gpp/),polyres2) + prim15 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_gpp,glob_thresh_gpp/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "m" + res@tiMainString = "TWS" + plot(10) = gsn_csm_xy(wks,yearplt,tws_glob,res) + + res@tiYAxisString = "m" + res@tiMainString = "Delta TWS " + "EqYr: "+tws_glob_equil + res@trYMaxF = 0.05 + res@trYMinF = -0.05 + plot(11) = gsn_csm_xy(wks,yearpltmid,tws_glob_del,res) + prim16 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim17 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tws,-glob_thresh_tws/),polyres2) + prim18 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tws,glob_thresh_tws/),polyres2) + + res@tiYAxisString = "%" + res@tiMainString = "% Land Area in TOTECOSYSC Disequil " + "EqYr: "+perc_landarea_glob_noequil + res@trYMaxF = 80.0 + res@trYMinF = 0.0 + plot(12) = gsn_csm_xy(wks,yearpltmid,perc_landarea_noequil,res) + prim19 = gsn_add_polyline(wks,plot(12),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_area,glob_thresh_area/),polyres2) + + gsn_panel(wks,plot,(/4,4/),resP) + + delete(plot) + resc = True ; turn on plotting options + resc@gsnSpreadColors = True ; spans all colors in colormap + resc@cnFillMode = "RasterFill" ; raster mode + resc@cnFillOn = True ; turn on color fill + resc@cnLinesOn = False ; turn off contour lines + resc@cnLineLabelsOn = False ; turn off contour line labels + resc@cnLevelSelectionMode = "ExplicitLevels" + resc@mpProjection = "robinson" ; Robinson grid projection + resc@gsnDraw = True + resc@gsnFrame = False + resc@lbAutoManage = False + resc@lbLabelFontHeightF = 0.010 + resc@txFontHeightF = 0.008 + resc@cnLevels = (/-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0/) + resc@gsnLeftString = "gC m~S~-2~N~" + resc@gsnRightString = "" + + resc@vpXF = 0.30 ; position and sizes + resc@vpYF = 0.28 ; for XY plot + resc@vpWidthF = 0.30 + resc@vpHeightF = 0.30 + resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-1) + " - " + yearplt(nyrs-2) + plot = gsn_csm_contour_map(wks,totecosysc_1_map,resc) + + resc@vpXF = 0.65 ; position and sizes + resc@vpYF = 0.28 ; for XY plot + resc@vpWidthF = 0.30 + resc@vpHeightF = 0.30 + resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-2) + " - " + yearplt(nyrs-3) + plot = gsn_csm_contour_map(wks,totecosysc_2_map,resc) + + frame(wks) + + end if ; end do_plot + +; Equilibrium summary + print((/"======================================================================="/)) + print((/"======================================================================="/)) + print((/"EQUILIBRIUM SUMMARY"/)) + print((/"======================================================================="/)) + if (.not.(ismissing(totecosysc_glob_equil))) then + print((/"TOTECOSYSC is in equilibrium. Eq. Yr. = "+totecosysc_glob_equil/)) + else + print((/"FATAL: TOTECOSYSC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(totsomc_glob_equil))) then + print((/"TOTSOMC is in equilibrium. Eq. Yr. = "+totsomc_glob_equil/)) + else + print((/"FATAL: TOTSOMC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(totvegc_glob_equil))) then + print((/"TOTVEGC is in equilibrium. Eq. Yr. = "+totvegc_glob_equil/)) + else + print((/"FATAL: TOTVEGC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(tlai_glob_equil))) then + print((/"TLAI is in equilibrium. Eq. Yr. = "+tlai_glob_equil/)) + else + print((/"FATAL: TLAI is NOT in equilibrium"/)) + end if + if (.not.(ismissing(gpp_glob_equil))) then + print((/"GPP is in equilibrium. Eq. Yr. = "+gpp_glob_equil/)) + else + print((/"FATAL: GPP is NOT in equilibrium"/)) + end if + if (.not.(ismissing(tws_glob_equil))) then + print((/"TWS is in equilibrium. Eq. Yr. = "+tws_glob_equil/)) + else + print((/"WARNING: TWS is NOT in equilibrium"/)) + end if + if (.not.(ismissing(perc_landarea_glob_noequil))) then + print((/"At least "+(100.-glob_thresh_area)+" percent of the land surface is in TOTECOSYSC equilibrium. Eq. Yr. = "+perc_landarea_glob_noequil/)) + else + print((/"FATAL: Not enough of the land surface is in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% > "+sprintf("%6.2f",glob_thresh_area)+"%)"/)) + end if + if (.not.(ismissing(totecosysc_glob_equil)) .and. \ + .not.(ismissing(totsomc_glob_equil)) .and. \ + .not.(ismissing(totvegc_glob_equil)) .and. \ + .not.(ismissing(tlai_glob_equil)) .and. \ + .not.(ismissing(gpp_glob_equil)) .and. \ + .not.(ismissing(perc_landarea_glob_noequil))) then + print((/"Congratulations! Your simulation is in equilibrium"/)) + else + print((/"FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again"/)) + end if + print((/"======================================================================="/)) + + print ("=========================================") + print ("Finish Time: "+systemfunc("date") ) + print ("=========================================") + +end diff --git a/tools/contrib/run_clm_historical.v1.csh b/tools/contrib/run_clm_historical.v1.csh new file mode 100755 index 0000000000..7b3ccc5d52 --- /dev/null +++ b/tools/contrib/run_clm_historical.v1.csh @@ -0,0 +1,149 @@ +#!/bin/csh + +######################################################################################### +# +# - Execute this script to do a CLM historical simulation from 1850 - 2010. This +# script will complete all the changes required at year 1901 to deal with the +# fact that met forcing data does not go back to 1850. +# +# - Unmodified script will do the following. +# Simulation 1: 1850 - 1901 (51 years) using repeated 1901-1920 forcing +# Simulation 2+3: 1901-2010 (two 55 year) simulations +# +# - Script assumes that can simulation > 60 years within a 12 hour block on +# Yellowstone. To find the timing in an equivalent sample run, look in the timing +# directory and grep as follows > grep 'simulated_years/day' cesm_timing* +# +# - In the $CASENAME.run file ensure the following: #BSUB -W 12:00 +# that way you can use up to 12:00 hours of wall-clock computer time per run block +# +# - Before submitting script, make a copy of your modified or unmodified user_nl_clm file i +# into "original_user_nl_clm". If you wish to make additional changes to user_nl_clm +# via this script, you can do that by editing thee Set the user namelist file section below. +# +# - The data files start in 1901 for CRUNCEP, so with : +# ALIGN year of 1901, (this is in units of RUN or simulation years) +# START year of 1901, (this is in units of FORCE'ing data years) +# +# RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1899 1900 1901 +# FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1919 1920 1901 +# +# - The script could be broken up into two parts if you want to check the initial set of +# simulations. +# +# - Written by Andrew Slater - Late July, 2015; aslater@kryos.colorado.edu +# - Modified by Dave Lawrence, August, 2015 +######################################################################################### + +# --- CASENAME is your case name +set CASENAME = 'clm45bgc_2deg45r118_hist_test' + +# --- Set the user namelist file. i.e. add the snow alterations for my run. Others may have +# diferent needs +set UNLCLM = 'script_user_nl_clm' +cat original_user_nl_clm > $UNLCLM + +# Examples of how to modify user_nl_clm using this script. Uncomment and edit as desired. +#echo "hist_empty_htapes = .true." >> $UNLCLM +#echo "hist_fincl1 = 'TSA'" >> $UNLCLM +cat $UNLCLM > user_nl_clm + + +# --- Check that you end up using the correct env_run.xml file +set nenvr = `ls -1 env_run*.xml | wc -l` +if ($nenvr > 1) then + echo 'There is more than one file of the type env_run*.xml' + echo 'There should only be one such file' + exit +endif + + +# --- Ensure that the env_run.xml file has the correct content +./xmlchange RUN_TYPE=startup +./xmlchange RUN_STARTDATE=1850-01-01 +./xmlchange STOP_OPTION=nyears +./xmlchange STOP_N=51 +./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 +./xmlchange DATM_CLMNCEP_YR_START=1901 +./xmlchange DATM_CLMNCEP_YR_END=1920 +./xmlchange CONTINUE_RUN=FALSE +./xmlchange RESUBMIT=0 + +# --- If you have not already built the code, then do so now +./$CASENAME.clean_build +./$CASENAME.build + +# --- Now submit the job and let it run +./$CASENAME.submit + + +######################################################################################### +# PART 2 +######################################################################################### +# +# This portion checks to see if the 1850-1901 portion of the run is done (or it waits +# 10 minutes before checking again). It then removes (or rather moves and renames) the +# datm files so that the model will use the full array of data from 1901-2010. +# This part runs with forcing data files that actually exist +# +# This will start the run from 1901 (hence the CONTINUE=TRUE) and do two 55 year +# simulations: 1901 + 2*55 - 1 = 2010 (minus 1 becase we do 1901) +# +# The new values for env_run.xml are put in place +# The values for user_nl_clm are put in place +# Then submit the job +# +######################################################################################### + + + +set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' +set DDIR = $WDIR'restart_dump/' +set DONE_RUNA = 0 +set DONE_FILE = $WDIR$CASENAME'.clm2.r.1901-01-01-00000.nc' + +# --- Check if the first set of simulations have been done (every ten minutes) +while ($DONE_RUNA == 0) + if (-e $DONE_FILE) then + set DONE_RUNA = 1 + echo '1850-1900 run is complete' + sleep 300 + else + sleep 600 + date + endif +end + +# --- If the first set of simulations are done, move the datm files and compress them +if (! -d $DDIR) then + mkdir $DDIR +endif +mv -i $WDIR$CASENAME.datm.rs1*.bin $DDIR +gzip $DDIR$CASENAME*.bin + + +# --- Note that the name list file (user_nl_clm) has not changed from before + + +# --- Check that you end up using the correct env_run.xml file +set nenvr = `ls -1 env_run*.xml | wc -l` +if ($nenvr > 1) then + echo 'There is more than one file of the type env_run*.xml' + echo 'There should only be one such file' + exit +endif + + +# --- Ensure that the env_run.xml file has the correct content +# We want to do a 110 year simulation, but in two 55 year chunks, thus +# we have to resubmit the job once. +./xmlchange STOP_OPTION=nyears +./xmlchange STOP_N=55 +./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 +./xmlchange DATM_CLMNCEP_YR_START=1901 +./xmlchange DATM_CLMNCEP_YR_END=2010 +./xmlchange CONTINUE_RUN=TRUE +./xmlchange RESUBMIT=1 + +./$CASENAME.submit + From 411ca1fa55bbc34458744de5e5169fa09daa6245 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:34:14 -0700 Subject: [PATCH 298/730] Rename file --- .../{run_clm_historical.v1.csh => run_clm_historical.v2.csh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{run_clm_historical.v1.csh => run_clm_historical.v2.csh} (100%) diff --git a/tools/contrib/run_clm_historical.v1.csh b/tools/contrib/run_clm_historical.v2.csh similarity index 100% rename from tools/contrib/run_clm_historical.v1.csh rename to tools/contrib/run_clm_historical.v2.csh From 94ec6602b9592a4d902f144fb87ab912cf8db163 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:35:30 -0700 Subject: [PATCH 299/730] Updated with better check that run has also been archived to short term - Dave Lawrence October, 2015 --- tools/contrib/run_clm_historical.v2.csh | 40 +++++++++++++++++-------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/tools/contrib/run_clm_historical.v2.csh b/tools/contrib/run_clm_historical.v2.csh index 7b3ccc5d52..78ed1d3f47 100755 --- a/tools/contrib/run_clm_historical.v2.csh +++ b/tools/contrib/run_clm_historical.v2.csh @@ -33,20 +33,26 @@ # # - Written by Andrew Slater - Late July, 2015; aslater@kryos.colorado.edu # - Modified by Dave Lawrence, August, 2015 +# - Updated with better check that run has also been archived to short term - Dave Lawrence +# October, 2015 +# +# Execute with following command: +# +# ./run_clm_historical.v2.csh ! > & run_historical.out & ######################################################################################### # --- CASENAME is your case name -set CASENAME = 'clm45bgc_2deg45r118_hist_test' +set CASENAME = 'cesm130_clm45_firemodule_20tr_01' # --- Set the user namelist file. i.e. add the snow alterations for my run. Others may have # diferent needs -set UNLCLM = 'script_user_nl_clm' -cat original_user_nl_clm > $UNLCLM +#set UNLCLM = 'script_user_nl_clm' +#cat original_user_nl_clm > $UNLCLM # Examples of how to modify user_nl_clm using this script. Uncomment and edit as desired. #echo "hist_empty_htapes = .true." >> $UNLCLM #echo "hist_fincl1 = 'TSA'" >> $UNLCLM -cat $UNLCLM > user_nl_clm +#cat $UNLCLM > user_nl_clm # --- Check that you end up using the correct env_run.xml file @@ -70,8 +76,8 @@ endif ./xmlchange RESUBMIT=0 # --- If you have not already built the code, then do so now -./$CASENAME.clean_build -./$CASENAME.build +#./$CASENAME.clean_build +#./$CASENAME.build # --- Now submit the job and let it run ./$CASENAME.submit @@ -100,16 +106,26 @@ endif set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' set DDIR = $WDIR'restart_dump/' set DONE_RUNA = 0 -set DONE_FILE = $WDIR$CASENAME'.clm2.r.1901-01-01-00000.nc' +set DONE_ARCHIVE = 0 +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1901-01-01-00000.nc' -# --- Check if the first set of simulations have been done (every ten minutes) +# --- Check if the first set of simulations have completed and the data archived (every ten minutes) while ($DONE_RUNA == 0) - if (-e $DONE_FILE) then + if (-e $RESTART_FILE) then set DONE_RUNA = 1 echo '1850-1900 run is complete' - sleep 300 + while ($DONE_ARCHIVE == 0) + set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + echo $nh0 + if ($nh0 == 1) then + set DONE_ARCHIVE = 1 + echo 'Files have been archived' + else + sleep 300 + date + endif else - sleep 600 + sleep 300 date endif end @@ -138,7 +154,7 @@ endif # We want to do a 110 year simulation, but in two 55 year chunks, thus # we have to resubmit the job once. ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=55 +./xmlchange STOP_N=52 ./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 ./xmlchange DATM_CLMNCEP_YR_START=1901 ./xmlchange DATM_CLMNCEP_YR_END=2010 From b5691ad24a459f9c0eb4831953bf508b0e89de02 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:36:33 -0700 Subject: [PATCH 300/730] File rename --- .../{run_clm_historical.v2.csh => run_clm_historical.v3.csh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{run_clm_historical.v2.csh => run_clm_historical.v3.csh} (100%) diff --git a/tools/contrib/run_clm_historical.v2.csh b/tools/contrib/run_clm_historical.v3.csh similarity index 100% rename from tools/contrib/run_clm_historical.v2.csh rename to tools/contrib/run_clm_historical.v3.csh From b4cb8b4af14e15af628b081cc0778cf7ac92ee8a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:38:57 -0700 Subject: [PATCH 301/730] Name of CIME scripts changed so CASENAME is no longer in the name --- tools/contrib/run_clm_historical.v3.csh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/contrib/run_clm_historical.v3.csh b/tools/contrib/run_clm_historical.v3.csh index 78ed1d3f47..2b5a5f0f83 100755 --- a/tools/contrib/run_clm_historical.v3.csh +++ b/tools/contrib/run_clm_historical.v3.csh @@ -35,14 +35,11 @@ # - Modified by Dave Lawrence, August, 2015 # - Updated with better check that run has also been archived to short term - Dave Lawrence # October, 2015 -# -# Execute with following command: -# -# ./run_clm_historical.v2.csh ! > & run_historical.out & +# - ./run_clm_historical.v3.csh ! > & run_historical.out & ######################################################################################### # --- CASENAME is your case name -set CASENAME = 'cesm130_clm45_firemodule_20tr_01' +set CASENAME = 'clm5_respn05r162_2degGSWP3_hist_allN_v01' # --- Set the user namelist file. i.e. add the snow alterations for my run. Others may have # diferent needs @@ -76,11 +73,11 @@ endif ./xmlchange RESUBMIT=0 # --- If you have not already built the code, then do so now -#./$CASENAME.clean_build -#./$CASENAME.build +#./case.clean_build +#./case.build # --- Now submit the job and let it run -./$CASENAME.submit +./case.submit ######################################################################################### @@ -154,12 +151,12 @@ endif # We want to do a 110 year simulation, but in two 55 year chunks, thus # we have to resubmit the job once. ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=52 +./xmlchange STOP_N=55 ./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 ./xmlchange DATM_CLMNCEP_YR_START=1901 ./xmlchange DATM_CLMNCEP_YR_END=2010 ./xmlchange CONTINUE_RUN=TRUE ./xmlchange RESUBMIT=1 -./$CASENAME.submit +./case.submit From de9ed0f4fd6d6a36a1e4aae5fca3c5a26538c75f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 12:40:47 -0700 Subject: [PATCH 302/730] Remove version number from name of script --- tools/contrib/{SpinupStability_v6.ncl => SpinupStability.ncl} | 0 .../contrib/{run_clm_historical.v3.csh => run_clm_historical.csh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{SpinupStability_v6.ncl => SpinupStability.ncl} (100%) rename tools/contrib/{run_clm_historical.v3.csh => run_clm_historical.csh} (100%) diff --git a/tools/contrib/SpinupStability_v6.ncl b/tools/contrib/SpinupStability.ncl similarity index 100% rename from tools/contrib/SpinupStability_v6.ncl rename to tools/contrib/SpinupStability.ncl diff --git a/tools/contrib/run_clm_historical.v3.csh b/tools/contrib/run_clm_historical.csh similarity index 100% rename from tools/contrib/run_clm_historical.v3.csh rename to tools/contrib/run_clm_historical.csh From 05ff7cc11421ae6f6d271fc35f7a0a149607655c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:27:20 -0700 Subject: [PATCH 303/730] Version 1 of subset_surfdata.py --- tools/contrib/README | 4 +- tools/contrib/subset_surfdata.v1.py | 399 ++++++++++++++++++++++++++++ 2 files changed, 401 insertions(+), 2 deletions(-) create mode 100755 tools/contrib/subset_surfdata.v1.py diff --git a/tools/contrib/README b/tools/contrib/README index 3ae1ec4f83..30dfcd2da9 100755 --- a/tools/contrib/README +++ b/tools/contrib/README @@ -23,9 +23,9 @@ singlept.py extracting data from global datasets v1 - Sean Swenson 8/2015 -SpinupStability_v6.ncl +SpinupStability.ncl This script assesses the equilibrium state of a spinup run - v6, works on either monthly or annual mean history files - Keith Oleson 7/2016 + works on either monthly or annual mean history files - Keith Oleson 7/2016 diff --git a/tools/contrib/subset_surfdata.v1.py b/tools/contrib/subset_surfdata.v1.py new file mode 100755 index 0000000000..902991b67a --- /dev/null +++ b/tools/contrib/subset_surfdata.v1.py @@ -0,0 +1,399 @@ +#! /usr/bin/env python +import sys +import string +import subprocess +import numpy as np +from scipy.io import netcdf +import netCDF4 as netcdf4 + +''' +# load proper modules first, i.e. + module load python/2.7.7 + module load all-python-libs +''' +#creates regional surface dataset and domain file + +dir_input='/glade/p/cesm/cseg/inputdata/lnd/clm2/' +# must change this to a directory to which you have permissions +dir_output='/glade/scratch/' + +#-- create regional CLM domain file +create_domain = 0 +#-- create ergional CLM surface data file +create_surfdata = 1 +#-- create river direction file +create_rdirc = 1 + +tagnum=1 +if tagnum == 1: + tag='NE.US' + rnum=2 + resnum=2 +if tagnum == 2: + tag='Western.US' + rnum=2 + resnum=2 +if tagnum == 3: + tag='S.America' + rnum=2 + resnum=1 +if tagnum == 4: + tag='California' + rnum=2 + resnum=2 + +if resnum == 1: + fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' + + fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr2000_c141219.nc' + + rdirc='/glade/p/cesmdata/cseg/inputdata/lnd/clm2/rtmdata/rdirc_0.5x0.5_simyr2000_slpmxvl_c120717.nc' + + fdomain2=dir_output+'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.nc' + + fsurf2=dir_output+'surfdata_0.9x1.25_16pfts_simyr2000_UHDMedian_'+tag+'.nc' + rdirc2=dir_output+'rdirc_0.5x0.5_simyr2000_slpmxvl_'+tag+'.nc' + +if resnum == 2: + fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.clm/domain.lnd.0.125x0.125_tx0.1v2.140704.nc' + fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.125x0.125_simyr2000_c150114.nc' + rdirc='/glade/p/cesmdata/cseg/inputdata/lnd/clm2/rtmdata/rdirc_0.1x0.1_simyr2000_c110712.nc' + + fdomain2=dir_output+'domain.lnd.0.125x0.125_tx0.1v2.'+tag+'.nc' + fsurf2=dir_output+'surfdata_0.125x0.125_simyr2000.'+tag+'.nc' + rdirc2=dir_output+'rdirc_0.1x0.1_'+tag+'.nc' + + + +#-- read in coordinates from original domain file +f1 = netcdf4.Dataset(fdomain, 'r', format='NETCDF4') +xc = f1.variables['xc'] +yc = f1.variables['yc'] +mask = np.copy(f1.variables['mask']) + +#-- convert coordinates to 1d +lon=np.asarray(xc[0,:]) +lat=np.asarray(yc[:,0]) +im=lon.size +jm=lat.size + +if rnum == 2: + if tagnum == 1: # NE.US + ln1=284. + ln2=296. + lt1=44. + lt2=53. + if tagnum == 2: # W.US + ln1=235. + ln2=270. + lt1=27. + lt2=50. + + if tagnum == 3: # S.America + ln1=275. + ln2=330. + lt1=-40. + lt2=15. + if tagnum == 4: # California + ln1=235 + ln2=246.5 + lt1=31.5 + lt2=45. + + #-- create regional mask/area arrays + #mask=np.zeros((jm,im)) + #where returns a tuple, extract list w/ '[0]' + xind=np.where((lon >= ln1) & (lon <= ln2))[0] + yind=np.where((lat >= lt1) & (lat <= lt2))[0] + im_new=xind.size + jm_new=yind.size + + mask=mask[yind,:]; mask=mask[:,xind] + + lonc=np.copy(xc) ; latc=np.copy(yc) + lonc=lonc[yind,:]; lonc=lonc[:,xind] + latc=latc[yind,:]; latc=latc[:,xind] + + #print lonc + +dlon = np.abs(lon[0] - lon[1]) +dlat = np.abs(lat[0] - lat[1]) + +#-- create domain file +##1 +if create_domain == 1: + frac = np.copy(f1.variables['frac']) + area = np.copy(f1.variables['area']) + + frac=frac[yind,:]; frac=frac[:,xind] + area=area[yind,:]; area=area[:,xind] + + + nv = 4 +#-- Create vertex matrices ---------------------------- + lonv=np.empty((jm_new,im_new,nv), dtype='float64') + latv=np.empty((jm_new,im_new,nv), dtype='float64') +#-- order is SW, SE, NE, NW + lonv[:,:,0] = lonc - 0.5*dlon + latv[:,:,0] = latc - 0.5*dlat + lonv[:,:,1] = lonc + 0.5*dlon + latv[:,:,1] = latc - 0.5*dlat + lonv[:,:,2] = lonc + 0.5*dlon + latv[:,:,2] = latc + 0.5*dlat + lonv[:,:,3] = lonc - 0.5*dlon + latv[:,:,3] = latc + 0.5*dlat + + #-- Check whether file exists --------------------------------- + command=['ls',fdomain2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + + w = netcdf4.Dataset(fdomain2, 'w', format='NETCDF4') + + if file_exists > 0: + print 'creating new file: ', fdomain2 + else: + print 'overwriting file: ', fdomain2 + command='date "+%y%m%d"' + x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') + x=x2.communicate() + timetag = x[0].strip() + w.creation_date = timetag + w.source_file = fdomain + w.title = 'CESM domain data' + w.createDimension('nv',int(nv)) + w.createDimension('ni',int(im_new)) + w.createDimension('nj',int(jm_new)) + + wyc = w.createVariable('yc','f8',('nj','ni')) + wxc = w.createVariable('xc','f8',('nj','ni')) + wyv = w.createVariable('yv','f8',('nj','ni','nv')) + wxv = w.createVariable('xv','f8',('nj','ni','nv')) + wmask = w.createVariable('mask','i4',('nj','ni')) + warea = w.createVariable('area','f8',('nj','ni')) + wfrac = w.createVariable('frac','f8',('nj','ni')) + + wyc.units = 'degrees north' + wxc.units = 'degrees east' + wyv.units = 'degrees north' + wxv.units = 'degrees east' + wmask.units = 'unitless' + warea.units = 'radians squared' + wfrac.units = 'unitless' + + wyc.long_name = 'latitude of grid cell center' + wxc.long_name = 'longitude of grid cell center' + wyv.long_name = 'latitude of grid cell vertices' + wxv.long_name = 'longitude of grid cell vertices' + wmask.long_name = 'land domain mask' + warea.long_name = 'area of grid cell in radians squared' + wfrac.long_name = 'fraction of grid cell that is active' + + # write to file -------------------------------------------- + wyc[:,:] = latc + wxc[:,:] = lonc + wyv[:,:,:] = latv + wxv[:,:,:] = lonv + wmask[:,:] = mask + warea[:,:] = area + wfrac[:,:] = frac + + w.close() + +#-- create surface data file -------------------------------------- +##2 +if create_surfdata == 1: + f2 = netcdf4.Dataset(fsurf, 'r', format='NETCDF4') + global_attributes = f2.ncattrs() + variables = f2.variables + dimensions = f2.dimensions + + #-- Check whether file exists --------------------------------- + command=['ls',fsurf2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + if file_exists > 0: + print 'creating new file: ', fsurf2 + else: + print 'overwriting file: ', fsurf2 + + #-- Open output file + w = netcdf4.Dataset(fsurf2, 'w', format='NETCDF4') + + #-- Set global attributes + for ga in global_attributes: + setattr(w,ga,f2.getncattr(ga)) + #-- Set dimensions of output file + for dim in dimensions.keys(): + print dim + if dim == 'lsmlon': + w.createDimension(dim,int(im_new)) + elif dim == 'lsmlat': + w.createDimension(dim,int(jm_new)) + else: + w.createDimension(dim,len(dimensions[dim])) + + for var in variables.keys(): + y=f2.variables[var].dimensions + x2 = [x.encode('ascii') for x in y] + vtype = f2.variables[var].datatype + print var, vtype, x2 + wvar = w.createVariable(var, vtype, x2) + + if len(x2) > 0: + fvar=np.copy(f2.variables[var]) + + #-- Subset input variables + for n in range(len(x2)): + fdim = x2[n] + if fdim == 'lsmlon': + if n == 0: + fvar = fvar[xind,] + if n == 1: + fvar = fvar[:,xind,] + if n == 2: + fvar = fvar[:,:,xind,] + if n == 3: + fvar = fvar[:,:,:,xind,] + if fdim == 'lsmlat': + if n == 0: + fvar = fvar[yind,] + if n == 1: + fvar = fvar[:,yind,] + if n == 2: + fvar = fvar[:,:,yind,] + if n == 3: + fvar = fvar[:,:,:,yind,] + + #-- Set attribute values + att=f2.variables[var].ncattrs() + print att, '\n' + km=len(att) + for attname in att: + print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) + w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) + + #-- Write variable data to output file + if len(x2) == 0: + wvar[:] = np.copy(f2.variables[var][:]) + if len(wvar.shape) == 1: + wvar[:] = fvar + if len(wvar.shape) == 2: + wvar[:,:] = fvar + if len(wvar.shape) == 3: + wvar[:,:,:] = fvar + if len(wvar.shape) == 4: + wvar[:,:,:,:] = fvar + + #-- Close output file + w.close + +#-- create river direction file +##3 +if create_rdirc == 1: + f2 = netcdf4.Dataset(rdirc, 'r', format='NETCDF4') + global_attributes = f2.ncattrs() + variables = f2.variables + dimensions = f2.dimensions + + #-- create regional indices + xc2 = np.copy(f2.variables['xc']) + yc2 = np.copy(f2.variables['yc']) + #-- convert coordinates to 1d + rlon=np.asarray(xc2[0,:]) + rlon[rlon < 0] += 360.0 + rlat=np.asarray(yc2[:,0]) + rim=rlon.size + rjm=rlat.size + #where returns a tuple, extract list w/ '[0]' + xind2=np.where((rlon >= ln1) & (rlon <= ln2))[0] + yind2=np.where((rlat >= lt1) & (rlat <= lt2))[0] + ni_new=xind2.size + nj_new=yind2.size + + #-- Check whether file exists --------------------------------- + command=['ls',rdirc2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + if file_exists > 0: + print 'creating new file: ', rdirc2 + else: + print 'overwriting file: ', rdirc2 + + #-- Open output file + w = netcdf4.Dataset(rdirc2, 'w', format='NETCDF4') + + #-- Set global attributes + for ga in global_attributes: + setattr(w,ga,f2.getncattr(ga)) + #-- Set dimensions of output file + for dim in dimensions.keys(): + print dim + if dim == 'ni': + w.createDimension(dim,int(ni_new)) + elif dim == 'nj': + w.createDimension(dim,int(nj_new)) + else: + w.createDimension(dim,len(dimensions[dim])) + + for var in variables.keys(): + y=f2.variables[var].dimensions + x2 = [x.encode('ascii') for x in y] + vtype = f2.variables[var].datatype + print var, vtype, x2 + wvar = w.createVariable(var, vtype, x2) + + if len(x2) > 1: + fvar=np.copy(f2.variables[var]) + + #-- Subset input variables + for n in range(len(x2)): + fdim = x2[n] + if fdim == 'ni': + if n == 0: + fvar = fvar[xind2,] + if n == 1: + fvar = fvar[:,xind2,] + if n == 2: + fvar = fvar[:,:,xind2,] + if n == 3: + fvar = fvar[:,:,:,xind2,] + if fdim == 'nj': + if n == 0: + fvar = fvar[yind2,] + if n == 1: + fvar = fvar[:,yind2,] + if n == 2: + fvar = fvar[:,:,yind2,] + if n == 3: + fvar = fvar[:,:,:,yind2,] + + #-- Set attribute values + att=f2.variables[var].ncattrs() + print att, '\n' + km=len(att) + for attname in att: + print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) + w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) + + #-- Set edges to zero + if var == 'RTM_FLOW_DIRECTION': + rjm2=fvar.shape[0] + rim2=fvar.shape[1] + fvar[:,0] = 0 + fvar[:,rim2-1] = 0 + fvar[0,:] = 0 + fvar[rjm2-1.:] = 0 + + #-- Write variable data to output file + if len(wvar.shape) == 1: + wvar[:] = f2.variables[var][:] + if len(wvar.shape) == 2: + wvar[:,:] = fvar + if len(wvar.shape) == 3: + wvar[:,:,:] = fvar + if len(wvar.shape) == 4: + wvar[:,:,:,:] = fvar + + #-- Close output file + w.close + +#-- Close output file +f1.close From f0cf49aecb1f3166f83530935d51cffd5dc3e0a9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:28:03 -0700 Subject: [PATCH 304/730] Rename file --- tools/contrib/{subset_surfdata.v1.py => subset_surfdata.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{subset_surfdata.v1.py => subset_surfdata.py} (100%) diff --git a/tools/contrib/subset_surfdata.v1.py b/tools/contrib/subset_surfdata.py similarity index 100% rename from tools/contrib/subset_surfdata.v1.py rename to tools/contrib/subset_surfdata.py From 424ca5f9aed9a5af40dac31f291166fd800dd860 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:29:49 -0700 Subject: [PATCH 305/730] Rename file --- tools/contrib/{subset_surfdata.py => subset_surfdata_xr.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{subset_surfdata.py => subset_surfdata_xr.py} (100%) diff --git a/tools/contrib/subset_surfdata.py b/tools/contrib/subset_surfdata_xr.py similarity index 100% rename from tools/contrib/subset_surfdata.py rename to tools/contrib/subset_surfdata_xr.py From 04d7c05113de472d9e4d745f1e5211372f685334 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:30:40 -0700 Subject: [PATCH 306/730] Changes from Sean Swenson to base it around the X-array module --- tools/contrib/subset_surfdata_xr.py | 498 +++++++--------------------- 1 file changed, 120 insertions(+), 378 deletions(-) diff --git a/tools/contrib/subset_surfdata_xr.py b/tools/contrib/subset_surfdata_xr.py index 902991b67a..4dbcbf3468 100755 --- a/tools/contrib/subset_surfdata_xr.py +++ b/tools/contrib/subset_surfdata_xr.py @@ -1,399 +1,141 @@ #! /usr/bin/env python import sys +import os +from getpass import getuser import string import subprocess import numpy as np -from scipy.io import netcdf -import netCDF4 as netcdf4 +import xarray as xr + +def mprint(mstr): + vnum=sys.version_info[0] + if vnum == 3: + print(mstr) + if vnum == 2: + print mstr + +myname=getuser() +pwd=os.getcwd() +mprint(myname) +mprint(pwd) -''' -# load proper modules first, i.e. - module load python/2.7.7 - module load all-python-libs -''' #creates regional surface dataset and domain file -dir_input='/glade/p/cesm/cseg/inputdata/lnd/clm2/' -# must change this to a directory to which you have permissions -dir_output='/glade/scratch/' +#-- Specify input and output directories +dir_output='/glade/scratch/'+myname+'/regional/' -#-- create regional CLM domain file -create_domain = 0 -#-- create ergional CLM surface data file -create_surfdata = 1 -#-- create river direction file -create_rdirc = 1 +#-- Create regional CLM domain file +create_domain = True +#-- Create CLM surface data file +create_surfdata = True +#-- Create CLM surface data file +create_landuse = False tagnum=1 if tagnum == 1: - tag='NE.US' - rnum=2 - resnum=2 -if tagnum == 2: - tag='Western.US' - rnum=2 - resnum=2 -if tagnum == 3: tag='S.America' - rnum=2 - resnum=1 -if tagnum == 4: - tag='California' - rnum=2 - resnum=2 - -if resnum == 1: - fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' - - fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr2000_c141219.nc' - - rdirc='/glade/p/cesmdata/cseg/inputdata/lnd/clm2/rtmdata/rdirc_0.5x0.5_simyr2000_slpmxvl_c120717.nc' - - fdomain2=dir_output+'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.nc' - - fsurf2=dir_output+'surfdata_0.9x1.25_16pfts_simyr2000_UHDMedian_'+tag+'.nc' - rdirc2=dir_output+'rdirc_0.5x0.5_simyr2000_slpmxvl_'+tag+'.nc' - -if resnum == 2: - fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.clm/domain.lnd.0.125x0.125_tx0.1v2.140704.nc' - fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.125x0.125_simyr2000_c150114.nc' - rdirc='/glade/p/cesmdata/cseg/inputdata/lnd/clm2/rtmdata/rdirc_0.1x0.1_simyr2000_c110712.nc' - - fdomain2=dir_output+'domain.lnd.0.125x0.125_tx0.1v2.'+tag+'.nc' - fsurf2=dir_output+'surfdata_0.125x0.125_simyr2000.'+tag+'.nc' - rdirc2=dir_output+'rdirc_0.1x0.1_'+tag+'.nc' - - - -#-- read in coordinates from original domain file -f1 = netcdf4.Dataset(fdomain, 'r', format='NETCDF4') -xc = f1.variables['xc'] -yc = f1.variables['yc'] -mask = np.copy(f1.variables['mask']) - -#-- convert coordinates to 1d -lon=np.asarray(xc[0,:]) -lat=np.asarray(yc[:,0]) -im=lon.size -jm=lat.size -if rnum == 2: - if tagnum == 1: # NE.US - ln1=284. - ln2=296. - lt1=44. - lt2=53. - if tagnum == 2: # W.US - ln1=235. - ln2=270. - lt1=27. - lt2=50. + ln1=275. + ln2=330. + lt1=-40. + lt2=15. - if tagnum == 3: # S.America - ln1=275. - ln2=330. - lt1=-40. - lt2=15. - if tagnum == 4: # California - ln1=235 - ln2=246.5 - lt1=31.5 - lt2=45. +if tagnum == 2: + tag='Western.US' - #-- create regional mask/area arrays - #mask=np.zeros((jm,im)) - #where returns a tuple, extract list w/ '[0]' + ln1=284. + ln2=296. + lt1=44. + lt2=53. + +#-- Set time stamp +command='date "+%y%m%d"' +x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') +x=x2.communicate() +timetag = x[0].strip() + +#-- Specify land domain file --------------------------------- +fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv1.9x2.5_gx1v7.170518.nc' +#fdomain2 = dir_output + 'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.090309.nc' +fdomain2 = dir_output + 'domain.lnd.fv1.9x2.5_gx1v7.'+tag+'_170518.nc' + +#-- Specify surface data file -------------------------------- +fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc' +#fsurf2 = dir_output + 'surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_'+tag+'.c170706.nc' +fsurf2 = dir_output + 'surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_'+tag+'_c170824.nc' + +#-- Specify landuse file ------------------------------------- +fluse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc' +fluse2 = dir_output + 'landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_'+tag+'.c170824.nc' + +#-- Create CTSM domain file +if create_domain: + f1 = xr.open_dataset(fdomain) + # create 1d coordinate variables to enable sel() method + lon0=np.asarray(f1['xc'][0,:]) + lat0=np.asarray(f1['yc'][:,0]) + lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0}) + lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0}) + # assign() not working on cheyenne + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + f2.reset_coords(['xc','yc'],inplace=True) + + # subset longitude and latitude arrays xind=np.where((lon >= ln1) & (lon <= ln2))[0] yind=np.where((lat >= lt1) & (lat <= lt2))[0] - im_new=xind.size - jm_new=yind.size - - mask=mask[yind,:]; mask=mask[:,xind] - - lonc=np.copy(xc) ; latc=np.copy(yc) - lonc=lonc[yind,:]; lonc=lonc[:,xind] - latc=latc[yind,:]; latc=latc[:,xind] - - #print lonc - -dlon = np.abs(lon[0] - lon[1]) -dlat = np.abs(lat[0] - lat[1]) - -#-- create domain file -##1 -if create_domain == 1: - frac = np.copy(f1.variables['frac']) - area = np.copy(f1.variables['area']) - - frac=frac[yind,:]; frac=frac[:,xind] - area=area[yind,:]; area=area[:,xind] - - - nv = 4 -#-- Create vertex matrices ---------------------------- - lonv=np.empty((jm_new,im_new,nv), dtype='float64') - latv=np.empty((jm_new,im_new,nv), dtype='float64') -#-- order is SW, SE, NE, NW - lonv[:,:,0] = lonc - 0.5*dlon - latv[:,:,0] = latc - 0.5*dlat - lonv[:,:,1] = lonc + 0.5*dlon - latv[:,:,1] = latc - 0.5*dlat - lonv[:,:,2] = lonc + 0.5*dlon - latv[:,:,2] = latc + 0.5*dlat - lonv[:,:,3] = lonc - 0.5*dlon - latv[:,:,3] = latc + 0.5*dlat - - #-- Check whether file exists --------------------------------- - command=['ls',fdomain2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - - w = netcdf4.Dataset(fdomain2, 'w', format='NETCDF4') - - if file_exists > 0: - print 'creating new file: ', fdomain2 - else: - print 'overwriting file: ', fdomain2 - command='date "+%y%m%d"' - x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') - x=x2.communicate() - timetag = x[0].strip() - w.creation_date = timetag - w.source_file = fdomain - w.title = 'CESM domain data' - w.createDimension('nv',int(nv)) - w.createDimension('ni',int(im_new)) - w.createDimension('nj',int(jm_new)) - - wyc = w.createVariable('yc','f8',('nj','ni')) - wxc = w.createVariable('xc','f8',('nj','ni')) - wyv = w.createVariable('yv','f8',('nj','ni','nv')) - wxv = w.createVariable('xv','f8',('nj','ni','nv')) - wmask = w.createVariable('mask','i4',('nj','ni')) - warea = w.createVariable('area','f8',('nj','ni')) - wfrac = w.createVariable('frac','f8',('nj','ni')) - - wyc.units = 'degrees north' - wxc.units = 'degrees east' - wyv.units = 'degrees north' - wxv.units = 'degrees east' - wmask.units = 'unitless' - warea.units = 'radians squared' - wfrac.units = 'unitless' - - wyc.long_name = 'latitude of grid cell center' - wxc.long_name = 'longitude of grid cell center' - wyv.long_name = 'latitude of grid cell vertices' - wxv.long_name = 'longitude of grid cell vertices' - wmask.long_name = 'land domain mask' - warea.long_name = 'area of grid cell in radians squared' - wfrac.long_name = 'fraction of grid cell that is active' - - # write to file -------------------------------------------- - wyc[:,:] = latc - wxc[:,:] = lonc - wyv[:,:,:] = latv - wxv[:,:,:] = lonv - wmask[:,:] = mask - warea[:,:] = area - wfrac[:,:] = frac - - w.close() - -#-- create surface data file -------------------------------------- -##2 -if create_surfdata == 1: - f2 = netcdf4.Dataset(fsurf, 'r', format='NETCDF4') - global_attributes = f2.ncattrs() - variables = f2.variables - dimensions = f2.dimensions - - #-- Check whether file exists --------------------------------- - command=['ls',fsurf2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - if file_exists > 0: - print 'creating new file: ', fsurf2 - else: - print 'overwriting file: ', fsurf2 - - #-- Open output file - w = netcdf4.Dataset(fsurf2, 'w', format='NETCDF4') - - #-- Set global attributes - for ga in global_attributes: - setattr(w,ga,f2.getncattr(ga)) - #-- Set dimensions of output file - for dim in dimensions.keys(): - print dim - if dim == 'lsmlon': - w.createDimension(dim,int(im_new)) - elif dim == 'lsmlat': - w.createDimension(dim,int(jm_new)) - else: - w.createDimension(dim,len(dimensions[dim])) - - for var in variables.keys(): - y=f2.variables[var].dimensions - x2 = [x.encode('ascii') for x in y] - vtype = f2.variables[var].datatype - print var, vtype, x2 - wvar = w.createVariable(var, vtype, x2) - - if len(x2) > 0: - fvar=np.copy(f2.variables[var]) - - #-- Subset input variables - for n in range(len(x2)): - fdim = x2[n] - if fdim == 'lsmlon': - if n == 0: - fvar = fvar[xind,] - if n == 1: - fvar = fvar[:,xind,] - if n == 2: - fvar = fvar[:,:,xind,] - if n == 3: - fvar = fvar[:,:,:,xind,] - if fdim == 'lsmlat': - if n == 0: - fvar = fvar[yind,] - if n == 1: - fvar = fvar[:,yind,] - if n == 2: - fvar = fvar[:,:,yind,] - if n == 3: - fvar = fvar[:,:,:,yind,] - - #-- Set attribute values - att=f2.variables[var].ncattrs() - print att, '\n' - km=len(att) - for attname in att: - print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) - w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) - - #-- Write variable data to output file - if len(x2) == 0: - wvar[:] = np.copy(f2.variables[var][:]) - if len(wvar.shape) == 1: - wvar[:] = fvar - if len(wvar.shape) == 2: - wvar[:,:] = fvar - if len(wvar.shape) == 3: - wvar[:,:,:] = fvar - if len(wvar.shape) == 4: - wvar[:,:,:,:] = fvar - - #-- Close output file - w.close - -#-- create river direction file -##3 -if create_rdirc == 1: - f2 = netcdf4.Dataset(rdirc, 'r', format='NETCDF4') - global_attributes = f2.ncattrs() - variables = f2.variables - dimensions = f2.dimensions - - #-- create regional indices - xc2 = np.copy(f2.variables['xc']) - yc2 = np.copy(f2.variables['yc']) - #-- convert coordinates to 1d - rlon=np.asarray(xc2[0,:]) - rlon[rlon < 0] += 360.0 - rlat=np.asarray(yc2[:,0]) - rim=rlon.size - rjm=rlat.size - #where returns a tuple, extract list w/ '[0]' - xind2=np.where((rlon >= ln1) & (rlon <= ln2))[0] - yind2=np.where((rlat >= lt1) & (rlat <= lt2))[0] - ni_new=xind2.size - nj_new=yind2.size - - #-- Check whether file exists --------------------------------- - command=['ls',rdirc2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - if file_exists > 0: - print 'creating new file: ', rdirc2 - else: - print 'overwriting file: ', rdirc2 - - #-- Open output file - w = netcdf4.Dataset(rdirc2, 'w', format='NETCDF4') - - #-- Set global attributes - for ga in global_attributes: - setattr(w,ga,f2.getncattr(ga)) - #-- Set dimensions of output file - for dim in dimensions.keys(): - print dim - if dim == 'ni': - w.createDimension(dim,int(ni_new)) - elif dim == 'nj': - w.createDimension(dim,int(nj_new)) - else: - w.createDimension(dim,len(dimensions[dim])) - - for var in variables.keys(): - y=f2.variables[var].dimensions - x2 = [x.encode('ascii') for x in y] - vtype = f2.variables[var].datatype - print var, vtype, x2 - wvar = w.createVariable(var, vtype, x2) - - if len(x2) > 1: - fvar=np.copy(f2.variables[var]) - - #-- Subset input variables - for n in range(len(x2)): - fdim = x2[n] - if fdim == 'ni': - if n == 0: - fvar = fvar[xind2,] - if n == 1: - fvar = fvar[:,xind2,] - if n == 2: - fvar = fvar[:,:,xind2,] - if n == 3: - fvar = fvar[:,:,:,xind2,] - if fdim == 'nj': - if n == 0: - fvar = fvar[yind2,] - if n == 1: - fvar = fvar[:,yind2,] - if n == 2: - fvar = fvar[:,:,yind2,] - if n == 3: - fvar = fvar[:,:,:,yind2,] - - #-- Set attribute values - att=f2.variables[var].ncattrs() - print att, '\n' - km=len(att) - for attname in att: - print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) - w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) - - #-- Set edges to zero - if var == 'RTM_FLOW_DIRECTION': - rjm2=fvar.shape[0] - rim2=fvar.shape[1] - fvar[:,0] = 0 - fvar[:,rim2-1] = 0 - fvar[0,:] = 0 - fvar[rjm2-1.:] = 0 + f3=f2.isel(nj=yind,ni=xind) + + wfile=fdomain2 + # mode 'w' overwrites file + f3.to_netcdf(path=wfile, mode='w') + mprint('created file '+fdomain2) + f1.close(); f2.close(); f3.close() + +#-- Create CTSM surface data file +if create_surfdata: + f1 = xr.open_dataset(fsurf) + # create 1d variables + lon0=np.asarray(f1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0}) + lat0=np.asarray(f1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + # subset longitude and latitude arrays + xind=np.where((lon >= ln1) & (lon <= ln2))[0] + yind=np.where((lat >= lt1) & (lat <= lt2))[0] + f3=f2.isel(lsmlat=yind,lsmlon=xind) + + # mode 'w' overwrites file + f3.to_netcdf(path=fsurf2, mode='w') + mprint('created file '+fsurf2) + f1.close(); f2.close(); f3.close() + +#-- Create CTSM transient landuse data file +if create_landuse: + f1 = xr.open_dataset(fluse) + # create 1d variables + lon0=np.asarray(f1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0}) + lat0=np.asarray(f1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + # subset longitude and latitude arrays + xind=np.where((lon >= ln1) & (lon <= ln2))[0] + yind=np.where((lat >= lt1) & (lat <= lt2))[0] + f3=f2.isel(lsmlat=yind,lsmlon=xind) + # mode 'w' overwrites file + f3.to_netcdf(path=fluse2, mode='w') + mprint('created file '+fluse2) + f1.close(); f2.close(); f3.close() - #-- Write variable data to output file - if len(wvar.shape) == 1: - wvar[:] = f2.variables[var][:] - if len(wvar.shape) == 2: - wvar[:,:] = fvar - if len(wvar.shape) == 3: - wvar[:,:,:] = fvar - if len(wvar.shape) == 4: - wvar[:,:,:,:] = fvar - #-- Close output file - w.close -#-- Close output file -f1.close From 238843a822bcfb09d51572bb29d5630a9a64d6e4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:31:17 -0700 Subject: [PATCH 307/730] Rename file --- tools/contrib/{subset_surfdata_xr.py => subset_surfdata.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{subset_surfdata_xr.py => subset_surfdata.py} (100%) diff --git a/tools/contrib/subset_surfdata_xr.py b/tools/contrib/subset_surfdata.py similarity index 100% rename from tools/contrib/subset_surfdata_xr.py rename to tools/contrib/subset_surfdata.py From 5a96be8c6db88f291ab2af8e0c206059a67666b2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:32:07 -0700 Subject: [PATCH 308/730] Initial version of single point version --- tools/contrib/singlept.py | 729 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 729 insertions(+) create mode 100755 tools/contrib/singlept.py diff --git a/tools/contrib/singlept.py b/tools/contrib/singlept.py new file mode 100755 index 0000000000..ce417e20aa --- /dev/null +++ b/tools/contrib/singlept.py @@ -0,0 +1,729 @@ +#! /usr/bin/env python +import sys +import string +import subprocess +import numpy as np +from scipy.io import netcdf +import netCDF4 as netcdf4 + +''' +# load proper modules first, i.e. + module load python/2.7.7 + module load all-python-libs +''' +# creates single point surface datasets, atmospheric forcing data, +# and domain file by extracting data from global datasets. + +''' +#------------------------------------------------------------------# +#--------------------- Instructions -----------------------------# +#------------------------------------------------------------------# +After creating a case using a global compset, run preview_namelist. +From the resulting lnd_in file in the run directory, find the name +of the domain file, and the surface data file. +From the datm streams files (e.g. datm.streams.txt.CLMGSWP3v1.Precip) +find the name of the datm forcing data domain file and forcing files. +Use these file names as the sources for the single point files to +be created (see below). + +After running this script, point to the new CLM domain and surface +dataset using the user_nl_clm file in the case directory. In addition, +copy the datm.streams files to the case directory, with the prefix +'user_', e.g. user_datm.streams.txt.CLMGSWP3v1.Precip. Change the +information in the user_datm.streams* files to point to the single +point datm data (domain and forcing files) created using this script. + +The domain file is not set via user_nl_clm, but requires changing +LND_DOMAIN and ATM_DOMAIN (and their paths) in env_run.xml. + +Using single point forcing data requires specifying the nearest +neighbor mapping algorithm for the datm streams (usually they are +the first three in the list) in user_nl_datm: mapalgo = 'nn','nn','nn', +..., where the '...' can still be 'bilinear', etc, depending on the +other streams that are being used, e.g. aerosols, anomaly forcing, +bias correction. + +Single point simulations require a single processor. The various +"NTASKS_*" xml variables in env_mach_pes.xml should therefore be +set to 1 and "ROOTPE_" should be set to zero. The mpi-serial +libraries should also be used, and can be set in env_build.xml +by changing "MPILIB" to "mpi-serial" prior to setting up the case. +PIO can be changed in env_run.xml to serial as well by changing +PIO_TYPENAME to "netcdf". + +River routing can be turned off either in env_run.xml or in user_nl_mosart +by setting "MOSART_MODE" to "NULL". + +No initial conditions are available, so set use_init_interp = .true. +in user_nl_clm, or CLM_FORCE_COLDSTART to "on" in env_run.xml. + +Single point runs should be run on caldera, in that case change the +JOB_QUEUE to caldera from regular in env_batch.xml + +''' + +# set 'create_' variables to 1 to create desired file type +#-- create single point CLM domain file +create_domain = 0 +#-- create single point CLM surface data file +create_surfdata = 0 +#-- create single point DATM atmospheric forcing data +create_datm = 0 +#-- create single point dynamic landuse file +create_landuse = 0 + +# change plon/plat to values of point to be extracted from global dataset +tagnum=1 +if tagnum == 1: #Single point + plon =270.0 + plat = 35.0 + rnum = 1 + tag=str(plon)+'_'+str(plat) + +# First specify input data locations, then specify output data locations +# Directory names should end in '/' + +# specify CLM domain and surface dataset; this information can be +# found in the lnd_in file + +fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' +fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc' +flanduse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_rcp8.5_simyr1850-2100_c141219.nc' + +# specify DATM domain and forcing dataset; this information can be +# found in the datm.streams.txt* files + +dir_input_datm='/glade/p/cesm/lmwg/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' +fdatmdomain = '/glade/p/cesmdata/cseg/lmwg/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc' + +solrdir = 'Solar/' +precdir = 'Precip/' +tpqwldir = 'TPHWL/' + +solrtag = 'clmforc.GSWP3.c2011.0.5x0.5.Solr.' +prectag = 'clmforc.GSWP3.c2011.0.5x0.5.Prec.' +tpqwtag = 'clmforc.GSWP3.c2011.0.5x0.5.TPQWL.' + +# specify locations for output; must change this to a directory to +# which you have permissions + +dir_output ='/glade/scratch/' +dir_output_datm='/glade/scratch/' + +# specify new name for CLM domain file and surface data file +fdomain2 = dir_output+'domain.lnd.fv0.9x1.25_'+tag+'.nc' +fsurf2 = dir_output+'surfdata_0.9x1.25_'+tag+'.nc' +flanduse2 = dir_output+'landuse.timeseries_0.9x1.25_rcp8.5_simyr1850-2100_'+tag+'.nc' + +# specify new name for DATM domain file +fdatmdomain2 = dir_output_datm+'domain.lnd.360x720_'+tag+'.nc' + +# specify years of atm data to extract +syr=1991 +eyr=1991 + +''' ------------------------------------------------------ + +End of user specification section + + ------------------------------------------------------ ''' + + +#-- read in coordinates from original domain file +f1 = netcdf4.Dataset(fdomain, 'r', format='NETCDF4') +xc = f1.variables['xc'] +yc = f1.variables['yc'] +mask = np.copy(f1.variables['mask']) + +#-- convert coordinates to 1d +lon=np.asarray(xc[0,:]) +lat=np.asarray(yc[:,0]) +im=lon.size +jm=lat.size + +dlon = np.abs(lon[0] - lon[1]) +dlat = np.abs(lat[0] - lat[1]) + +rnum = 1 +if rnum == 1: + + #-- create single point mask/area arrays + xind = np.argmin(abs(lon - plon)) + yind = np.argmin(abs(lat - plat)) + im_new=xind.size + jm_new=yind.size + + mask=mask[yind,:]; mask=mask[xind] + + lonc=np.copy(xc) ; latc=np.copy(yc) + lonc=lonc[yind,:]; lonc=lonc[xind] + latc=latc[yind,:]; latc=latc[xind] + +#-- create CLM domain file +##1 +if create_domain == 1: + frac = np.copy(f1.variables['frac']) + area = np.copy(f1.variables['area']) + + frac=frac[yind,:]; frac=frac[xind] + area=area[yind,:]; area=area[xind] + + + nv = 4 + #-- Create vertex matrices ---------------------------- + lonv=np.empty((nv), dtype='float64') + latv=np.empty((nv), dtype='float64') + #-- order is SW, SE, NE, NW + lonv[0] = lonc - 0.5*dlon + latv[0] = latc - 0.5*dlat + lonv[1] = lonc + 0.5*dlon + latv[1] = latc - 0.5*dlat + lonv[2] = lonc + 0.5*dlon + latv[2] = latc + 0.5*dlat + lonv[3] = lonc - 0.5*dlon + latv[3] = latc + 0.5*dlat + + #-- Check whether file exists --------------------------------- + command=['ls',fdomain2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + print file_exists + + w = netcdf4.Dataset(fdomain2, 'w', format='NETCDF4') + + if file_exists > 0: + print 'creating new file: ', fdomain2 + else: + print 'overwriting file: ', fdomain2 + command='date "+%y%m%d"' + x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') + x=x2.communicate() + timetag = x[0].strip() + w.creation_date = timetag + w.source_file = fdomain + w.title = 'CESM domain data' + w.createDimension('nv',int(nv)) + w.createDimension('ni',int(im_new)) + w.createDimension('nj',int(jm_new)) + + wyc = w.createVariable('yc','f8',('nj','ni')) + wxc = w.createVariable('xc','f8',('nj','ni')) + wyv = w.createVariable('yv','f8',('nj','ni','nv')) + wxv = w.createVariable('xv','f8',('nj','ni','nv')) + wmask = w.createVariable('mask','i4',('nj','ni')) + warea = w.createVariable('area','f8',('nj','ni')) + wfrac = w.createVariable('frac','f8',('nj','ni')) + + wyc.units = 'degrees north' + wxc.units = 'degrees east' + wyv.units = 'degrees north' + wxv.units = 'degrees east' + wmask.units = 'unitless' + warea.units = 'radians squared' + wfrac.units = 'unitless' + + wyc.long_name = 'latitude of grid cell center' + wxc.long_name = 'longitude of grid cell center' + wyv.long_name = 'latitude of grid cell vertices' + wxv.long_name = 'longitude of grid cell vertices' + wmask.long_name = 'land domain mask' + warea.long_name = 'area of grid cell in radians squared' + wfrac.long_name = 'fraction of grid cell that is active' + + # write to file -------------------------------------------- + wyc[:,:] = latc + wxc[:,:] = lonc + wyv[:,:,:] = latv + wxv[:,:,:] = lonv + wmask[:,:] = mask + warea[:,:] = area + wfrac[:,:] = frac + + w.close() + +#-- create CLM surface data file ---------------------------------- +##2 +if create_surfdata == 1: + f2 = netcdf4.Dataset(fsurf, 'r', format='NETCDF4') + global_attributes = f2.ncattrs() + variables = f2.variables + dimensions = f2.dimensions + + #-- Check whether file exists --------------------------------- + command=['ls',fsurf2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + if file_exists > 0: + print 'creating new file: ', fsurf2 + else: + print 'overwriting file: ', fsurf2 + + #-- Open output file + w = netcdf4.Dataset(fsurf2, 'w', format='NETCDF4') + + #-- Set global attributes + for ga in global_attributes: + setattr(w,ga,f2.getncattr(ga)) + #-- Set dimensions of output file + for dim in dimensions.keys(): + print dim + if dim == 'lsmlon': + w.createDimension(dim,int(im_new)) + elif dim == 'lsmlat': + w.createDimension(dim,int(jm_new)) + else: + w.createDimension(dim,len(dimensions[dim])) + + for var in variables.keys(): + y=f2.variables[var].dimensions + x2 = [x.encode('ascii') for x in y] + vtype = f2.variables[var].datatype + print var, vtype, x2 + wvar = w.createVariable(var, vtype, x2) + + if len(x2) > 0: + fvar=np.copy(f2.variables[var]) + + #-- Subset input variables + for n in range(len(x2)): + fdim = x2[n] + if fdim == 'lsmlon': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[xind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,xind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,xind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,xind,] + fvar = tmp + if fdim == 'lsmlat': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[yind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,yind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,yind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,yind,] + fvar = tmp + + #-- Set attribute values + att=f2.variables[var].ncattrs() + print att, '\n' + km=len(att) + for attname in att: + print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) + w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) + + #-- Write variable data to output file + if len(x2) == 0: + wvar[:] = np.copy(f2.variables[var][:]) + if len(wvar.shape) == 1: + wvar[:] = fvar + if len(wvar.shape) == 2: + wvar[:,:] = fvar + if len(wvar.shape) == 3: + wvar[:,:,:] = fvar + if len(wvar.shape) == 4: + wvar[:,:,:,:] = fvar + + #-- Close output file + w.close + +#-- create datm data files -------------------------------------- +##3 +if create_datm == 1: + +#-- create datm domain file + f2 = netcdf4.Dataset(fdatmdomain, 'r', format='NETCDF4') + xc = f2.variables['xc'] + yc = f2.variables['yc'] + mask = np.copy(f2.variables['mask']) + +#-- convert coordinates to 1d + lon=np.asarray(xc[0,:]) + lat=np.asarray(yc[:,0]) + im=lon.size + jm=lat.size + + dlon = np.abs(lon[0] - lon[1]) + dlat = np.abs(lat[0] - lat[1]) + xind = np.argmin(abs(lon - plon)) + yind = np.argmin(abs(lat - plat)) + im_new=xind.size + jm_new=yind.size + + mask=mask[yind,:]; mask=mask[xind] + + lonc=np.copy(xc) ; latc=np.copy(yc) + lonc=lonc[yind,:]; lonc=lonc[xind] + latc=latc[yind,:]; latc=latc[xind] + #frac = np.copy(f2.variables['frac']) + area = np.copy(f2.variables['area']) + + # if no frac on dataset, use all 1s + frac=np.ones((jm,im)) + + frac=frac[yind,:]; frac=frac[xind] + area=area[yind,:]; area=area[xind] + + + nv = 4 + #-- Create vertex matrices ---------------------------- + lonv=np.empty((nv), dtype='float64') + latv=np.empty((nv), dtype='float64') + #-- order is SW, SE, NE, NW + lonv[0] = lonc - 0.5*dlon + latv[0] = latc - 0.5*dlat + lonv[1] = lonc + 0.5*dlon + latv[1] = latc - 0.5*dlat + lonv[2] = lonc + 0.5*dlon + latv[2] = latc + 0.5*dlat + lonv[3] = lonc - 0.5*dlon + latv[3] = latc + 0.5*dlat + + #-- Check whether file exists --------------------------------- + command=['ls',fdatmdomain2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + print command + print file_exists + + w = netcdf4.Dataset(fdatmdomain2, 'w', format='NETCDF4') + + if file_exists > 0: + print 'creating new file: ', fdatmdomain2 + else: + print 'overwriting file: ', fdatmdomain2 + command='date "+%y%m%d"' + x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') + x=x2.communicate() + timetag = x[0].strip() + w.creation_date = timetag + w.source_file = fdatmdomain + w.title = 'CESM datm domain data' + w.createDimension('nv',int(nv)) + w.createDimension('ni',int(im_new)) + w.createDimension('nj',int(jm_new)) + + wyc = w.createVariable('yc','f8',('nj','ni')) + wxc = w.createVariable('xc','f8',('nj','ni')) + wyv = w.createVariable('yv','f8',('nj','ni','nv')) + wxv = w.createVariable('xv','f8',('nj','ni','nv')) + wmask = w.createVariable('mask','i4',('nj','ni')) + warea = w.createVariable('area','f8',('nj','ni')) + wfrac = w.createVariable('frac','f8',('nj','ni')) + + wyc.units = 'degrees north' + wxc.units = 'degrees east' + wyv.units = 'degrees north' + wxv.units = 'degrees east' + wmask.units = 'unitless' + warea.units = 'radians squared' + wfrac.units = 'unitless' + + wyc.long_name = 'latitude of grid cell center' + wxc.long_name = 'longitude of grid cell center' + wyv.long_name = 'latitude of grid cell vertices' + wxv.long_name = 'longitude of grid cell vertices' + wmask.long_name = 'land domain mask' + warea.long_name = 'area of grid cell in radians squared' + wfrac.long_name = 'fraction of grid cell that is active' + + # write to file -------------------------------------------- + wyc[:,:] = latc + wxc[:,:] = lonc + wyv[:,:,:] = latv + wxv[:,:,:] = lonv + wmask[:,:] = mask + warea[:,:] = area + wfrac[:,:] = frac + + w.close() + print 'successfully created datm domain file: ', fdatmdomain2 + f2.close() + + infile=[] + outfile=[] + for y in range(syr,eyr+1): + ystr=str(y) + for m in range(1,13): + mstr=str(m) + if m < 10: + mstr='0'+mstr + + dtag=ystr+'-'+mstr + + fsolar=dir_input_datm+solrdir+solrtag+dtag+'.nc' + fsolar2=dir_output_datm+solrtag+tag+'.'+dtag+'.nc' + fprecip=dir_input_datm+precdir+prectag+dtag+'.nc' + fprecip2=dir_output_datm+prectag+tag+'.'+dtag+'.nc' + ftpqw=dir_input_datm+tpqwldir+tpqwtag+dtag+'.nc' + ftpqw2=dir_output_datm+tpqwtag+tag+'.'+dtag+'.nc' + + infile+=[fsolar,fprecip,ftpqw] + outfile+=[fsolar2,fprecip2,ftpqw2] + + nm=len(infile) + for n in range(nm): + print outfile[n], '\n' + file_in = infile[n] + file_out = outfile[n] + + f2 = netcdf4.Dataset(file_in, 'r', format='NETCDF4') + global_attributes = f2.ncattrs() + variables = f2.variables + dimensions = f2.dimensions + + #-- Open output file + w = netcdf4.Dataset(file_out, 'w', format='NETCDF4') + + #-- Set global attributes + for ga in global_attributes: + setattr(w,ga,f2.getncattr(ga)) + #-- Set dimensions of output file + for dim in dimensions.keys(): + print dim + if dim == 'lon': + w.createDimension(dim,int(im_new)) + elif dim == 'lat': + w.createDimension(dim,int(jm_new)) + else: + w.createDimension(dim,len(dimensions[dim])) + + for var in variables.keys(): + y=f2.variables[var].dimensions + x2 = [x.encode('ascii') for x in y] + vtype = f2.variables[var].datatype + print var, vtype, x2 + wvar = w.createVariable(var, vtype, x2) + + if len(x2) > 0: + fvar=np.copy(f2.variables[var]) + + #-- Subset input variables + for n in range(len(x2)): + fdim = x2[n] + if fdim == 'lon': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[xind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,xind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,xind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,xind,] + fvar = tmp + if fdim == 'lat': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[yind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,yind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,yind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,yind,] + fvar = tmp + + #-- Set attribute values + att=f2.variables[var].ncattrs() + print att, '\n' + km=len(att) + for attname in att: + print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) + w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) + + #-- Write variable data to output file + if len(x2) == 0: + wvar[:] = np.copy(f2.variables[var][:]) + if len(wvar.shape) == 1: + wvar[:] = fvar + if len(wvar.shape) == 2: + wvar[:,:] = fvar + if len(wvar.shape) == 3: + wvar[:,:,:] = fvar + if len(wvar.shape) == 4: + wvar[:,:,:,:] = fvar + + #-- Close output file + w.close + print 'datm files written to: ', dir_output_datm + +#-- create landuse data file -------------------------------------- +#46 +if create_landuse == 1: + f2 = netcdf4.Dataset(flanduse, 'r', format='NETCDF4') + global_attributes = f2.ncattrs() + variables = f2.variables + dimensions = f2.dimensions + + #-- Check whether file exists --------------------------------- + command=['ls',flanduse2] + file_exists=subprocess.call(command,stderr=subprocess.PIPE) + if file_exists > 0: + print 'creating new file: ', flanduse2 + else: + print 'overwriting file: ', flanduse2 + + #-- Open output file + w = netcdf4.Dataset(flanduse2, 'w', format='NETCDF4') + + #-- Set global attributes + for ga in global_attributes: + setattr(w,ga,f2.getncattr(ga)) + #-- Set dimensions of output file + for dim in dimensions.keys(): + print dim + if dim == 'lsmlon': + w.createDimension(dim,int(im_new)) + elif dim == 'lsmlat': + w.createDimension(dim,int(jm_new)) + else: + w.createDimension(dim,len(dimensions[dim])) + + for var in variables.keys(): + y=f2.variables[var].dimensions + x2 = [x.encode('ascii') for x in y] + vtype = f2.variables[var].datatype + print var, vtype, x2 + wvar = w.createVariable(var, vtype, x2) + + if len(x2) > 0: + fvar=np.copy(f2.variables[var]) + + #-- Subset input variables + for n in range(len(x2)): + fdim = x2[n] + if fdim == 'lsmlon': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[xind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,xind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,xind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,xind,] + fvar = tmp + if fdim == 'lsmlat': + if n == 0: + shp=np.asarray(fvar.shape) + shp[0] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[0,] = fvar[yind,] + fvar = tmp + if n == 1: + shp=np.asarray(fvar.shape) + shp[1] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,0,] = fvar[:,yind,] + fvar = tmp + if n == 2: + shp=np.asarray(fvar.shape) + shp[2] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,0,] = fvar[:,:,yind,] + fvar = tmp + if n == 3: + shp=np.asarray(fvar.shape) + shp[3] = 1 + tmp=np.empty(shp, dtype='float64') + tmp[:,:,:,0,] = fvar[:,:,:,yind,] + fvar = tmp + + #-- Set attribute values + att=f2.variables[var].ncattrs() + print att, '\n' + km=len(att) + for attname in att: + print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) + w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) + + #-- Write variable data to output file + if len(x2) == 0: + wvar[:] = np.copy(f2.variables[var][:]) + if len(wvar.shape) == 1: + wvar[:] = fvar + if len(wvar.shape) == 2: + wvar[:,:] = fvar + if len(wvar.shape) == 3: + wvar[:,:,:] = fvar + if len(wvar.shape) == 4: + wvar[:,:,:,:] = fvar + + #-- Close output file + w.close + print 'successfully created landuse data file: ', flanduse2 + From d721f50584af7d37c1ab13c3d33663152f11b50f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:32:37 -0700 Subject: [PATCH 309/730] Rename file --- tools/contrib/{singlept.py => singlept_xr.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{singlept.py => singlept_xr.py} (100%) diff --git a/tools/contrib/singlept.py b/tools/contrib/singlept_xr.py similarity index 100% rename from tools/contrib/singlept.py rename to tools/contrib/singlept_xr.py From b0bac40d2cb37a1b11469c75008897d1e5fced0a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:33:18 -0700 Subject: [PATCH 310/730] Changes from Sean Swenson to base it around the X-array module --- tools/contrib/singlept_xr.py | 942 ++++++++++------------------------- 1 file changed, 271 insertions(+), 671 deletions(-) diff --git a/tools/contrib/singlept_xr.py b/tools/contrib/singlept_xr.py index ce417e20aa..4b4d6b0b46 100755 --- a/tools/contrib/singlept_xr.py +++ b/tools/contrib/singlept_xr.py @@ -1,18 +1,24 @@ #! /usr/bin/env python +# Import libraries import sys +import os +from getpass import getuser import string import subprocess import numpy as np -from scipy.io import netcdf -import netCDF4 as netcdf4 - -''' -# load proper modules first, i.e. - module load python/2.7.7 - module load all-python-libs -''' -# creates single point surface datasets, atmospheric forcing data, -# and domain file by extracting data from global datasets. +import xarray as xr + +def mprint(mstr): + vnum=sys.version_info[0] + if vnum == 3: + print(mstr) + if vnum == 2: + print mstr + +myname=getuser() +pwd=os.getcwd() +mprint(myname) +mprint(pwd) ''' #------------------------------------------------------------------# @@ -43,437 +49,234 @@ other streams that are being used, e.g. aerosols, anomaly forcing, bias correction. -Single point simulations require a single processor. The various -"NTASKS_*" xml variables in env_mach_pes.xml should therefore be -set to 1 and "ROOTPE_" should be set to zero. The mpi-serial -libraries should also be used, and can be set in env_build.xml -by changing "MPILIB" to "mpi-serial" prior to setting up the case. -PIO can be changed in env_run.xml to serial as well by changing -PIO_TYPENAME to "netcdf". - -River routing can be turned off either in env_run.xml or in user_nl_mosart -by setting "MOSART_MODE" to "NULL". - -No initial conditions are available, so set use_init_interp = .true. -in user_nl_clm, or CLM_FORCE_COLDSTART to "on" in env_run.xml. - -Single point runs should be run on caldera, in that case change the -JOB_QUEUE to caldera from regular in env_batch.xml +The file env_mach_pes.xml should be modified to specify a single +processor. The mpi-serial libraries should also be used, and can be +set in env_build.xml by changing "MPILIB" to "mpi-serial" prior to +setting up the case. +The case for the single point simulation should have river routing +and land ice models turned off (i.e. the compset should use stub +models SROF and SGLC) ''' -# set 'create_' variables to 1 to create desired file type -#-- create single point CLM domain file -create_domain = 0 -#-- create single point CLM surface data file -create_surfdata = 0 -#-- create single point DATM atmospheric forcing data -create_datm = 0 -#-- create single point dynamic landuse file -create_landuse = 0 - -# change plon/plat to values of point to be extracted from global dataset -tagnum=1 -if tagnum == 1: #Single point - plon =270.0 - plat = 35.0 - rnum = 1 - tag=str(plon)+'_'+str(plat) - -# First specify input data locations, then specify output data locations -# Directory names should end in '/' - -# specify CLM domain and surface dataset; this information can be -# found in the lnd_in file - -fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv0.9x1.25_gx1v6.090309.nc' -fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc' -flanduse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_rcp8.5_simyr1850-2100_c141219.nc' - -# specify DATM domain and forcing dataset; this information can be -# found in the datm.streams.txt* files - -dir_input_datm='/glade/p/cesm/lmwg/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' -fdatmdomain = '/glade/p/cesmdata/cseg/lmwg/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc' - -solrdir = 'Solar/' -precdir = 'Precip/' -tpqwldir = 'TPHWL/' - -solrtag = 'clmforc.GSWP3.c2011.0.5x0.5.Solr.' -prectag = 'clmforc.GSWP3.c2011.0.5x0.5.Prec.' -tpqwtag = 'clmforc.GSWP3.c2011.0.5x0.5.TPQWL.' - -# specify locations for output; must change this to a directory to -# which you have permissions - -dir_output ='/glade/scratch/' -dir_output_datm='/glade/scratch/' - -# specify new name for CLM domain file and surface data file -fdomain2 = dir_output+'domain.lnd.fv0.9x1.25_'+tag+'.nc' -fsurf2 = dir_output+'surfdata_0.9x1.25_'+tag+'.nc' -flanduse2 = dir_output+'landuse.timeseries_0.9x1.25_rcp8.5_simyr1850-2100_'+tag+'.nc' - -# specify new name for DATM domain file -fdatmdomain2 = dir_output_datm+'domain.lnd.360x720_'+tag+'.nc' - -# specify years of atm data to extract -syr=1991 -eyr=1991 - -''' ------------------------------------------------------ - -End of user specification section - - ------------------------------------------------------ ''' - - -#-- read in coordinates from original domain file -f1 = netcdf4.Dataset(fdomain, 'r', format='NETCDF4') -xc = f1.variables['xc'] -yc = f1.variables['yc'] -mask = np.copy(f1.variables['mask']) - -#-- convert coordinates to 1d -lon=np.asarray(xc[0,:]) -lat=np.asarray(yc[:,0]) -im=lon.size -jm=lat.size - -dlon = np.abs(lon[0] - lon[1]) -dlat = np.abs(lat[0] - lat[1]) - -rnum = 1 -if rnum == 1: - - #-- create single point mask/area arrays - xind = np.argmin(abs(lon - plon)) - yind = np.argmin(abs(lat - plat)) - im_new=xind.size - jm_new=yind.size - - mask=mask[yind,:]; mask=mask[xind] - - lonc=np.copy(xc) ; latc=np.copy(yc) - lonc=lonc[yind,:]; lonc=lonc[xind] - latc=latc[yind,:]; latc=latc[xind] - -#-- create CLM domain file -##1 -if create_domain == 1: - frac = np.copy(f1.variables['frac']) - area = np.copy(f1.variables['area']) - - frac=frac[yind,:]; frac=frac[xind] - area=area[yind,:]; area=area[xind] - - - nv = 4 - #-- Create vertex matrices ---------------------------- - lonv=np.empty((nv), dtype='float64') - latv=np.empty((nv), dtype='float64') - #-- order is SW, SE, NE, NW - lonv[0] = lonc - 0.5*dlon - latv[0] = latc - 0.5*dlat - lonv[1] = lonc + 0.5*dlon - latv[1] = latc - 0.5*dlat - lonv[2] = lonc + 0.5*dlon - latv[2] = latc + 0.5*dlat - lonv[3] = lonc - 0.5*dlon - latv[3] = latc + 0.5*dlat - - #-- Check whether file exists --------------------------------- - command=['ls',fdomain2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - print file_exists - - w = netcdf4.Dataset(fdomain2, 'w', format='NETCDF4') - - if file_exists > 0: - print 'creating new file: ', fdomain2 - else: - print 'overwriting file: ', fdomain2 - command='date "+%y%m%d"' - x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') - x=x2.communicate() - timetag = x[0].strip() - w.creation_date = timetag - w.source_file = fdomain - w.title = 'CESM domain data' - w.createDimension('nv',int(nv)) - w.createDimension('ni',int(im_new)) - w.createDimension('nj',int(jm_new)) - - wyc = w.createVariable('yc','f8',('nj','ni')) - wxc = w.createVariable('xc','f8',('nj','ni')) - wyv = w.createVariable('yv','f8',('nj','ni','nv')) - wxv = w.createVariable('xv','f8',('nj','ni','nv')) - wmask = w.createVariable('mask','i4',('nj','ni')) - warea = w.createVariable('area','f8',('nj','ni')) - wfrac = w.createVariable('frac','f8',('nj','ni')) - - wyc.units = 'degrees north' - wxc.units = 'degrees east' - wyv.units = 'degrees north' - wxv.units = 'degrees east' - wmask.units = 'unitless' - warea.units = 'radians squared' - wfrac.units = 'unitless' - - wyc.long_name = 'latitude of grid cell center' - wxc.long_name = 'longitude of grid cell center' - wyv.long_name = 'latitude of grid cell vertices' - wxv.long_name = 'longitude of grid cell vertices' - wmask.long_name = 'land domain mask' - warea.long_name = 'area of grid cell in radians squared' - wfrac.long_name = 'fraction of grid cell that is active' - - # write to file -------------------------------------------- - wyc[:,:] = latc - wxc[:,:] = lonc - wyv[:,:,:] = latv - wxv[:,:,:] = lonv - wmask[:,:] = mask - warea[:,:] = area - wfrac[:,:] = frac - - w.close() - -#-- create CLM surface data file ---------------------------------- -##2 -if create_surfdata == 1: - f2 = netcdf4.Dataset(fsurf, 'r', format='NETCDF4') - global_attributes = f2.ncattrs() - variables = f2.variables - dimensions = f2.dimensions - - #-- Check whether file exists --------------------------------- - command=['ls',fsurf2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - if file_exists > 0: - print 'creating new file: ', fsurf2 - else: - print 'overwriting file: ', fsurf2 - - #-- Open output file - w = netcdf4.Dataset(fsurf2, 'w', format='NETCDF4') - - #-- Set global attributes - for ga in global_attributes: - setattr(w,ga,f2.getncattr(ga)) - #-- Set dimensions of output file - for dim in dimensions.keys(): - print dim - if dim == 'lsmlon': - w.createDimension(dim,int(im_new)) - elif dim == 'lsmlat': - w.createDimension(dim,int(jm_new)) - else: - w.createDimension(dim,len(dimensions[dim])) - - for var in variables.keys(): - y=f2.variables[var].dimensions - x2 = [x.encode('ascii') for x in y] - vtype = f2.variables[var].datatype - print var, vtype, x2 - wvar = w.createVariable(var, vtype, x2) - - if len(x2) > 0: - fvar=np.copy(f2.variables[var]) - - #-- Subset input variables - for n in range(len(x2)): - fdim = x2[n] - if fdim == 'lsmlon': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[xind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,xind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,xind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,xind,] - fvar = tmp - if fdim == 'lsmlat': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[yind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,yind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,yind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,yind,] - fvar = tmp - - #-- Set attribute values - att=f2.variables[var].ncattrs() - print att, '\n' - km=len(att) - for attname in att: - print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) - w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) - - #-- Write variable data to output file - if len(x2) == 0: - wvar[:] = np.copy(f2.variables[var][:]) - if len(wvar.shape) == 1: - wvar[:] = fvar - if len(wvar.shape) == 2: - wvar[:,:] = fvar - if len(wvar.shape) == 3: - wvar[:,:,:] = fvar - if len(wvar.shape) == 4: - wvar[:,:,:,:] = fvar - - #-- Close output file - w.close - -#-- create datm data files -------------------------------------- -##3 -if create_datm == 1: - -#-- create datm domain file - f2 = netcdf4.Dataset(fdatmdomain, 'r', format='NETCDF4') - xc = f2.variables['xc'] - yc = f2.variables['yc'] - mask = np.copy(f2.variables['mask']) - -#-- convert coordinates to 1d - lon=np.asarray(xc[0,:]) - lat=np.asarray(yc[:,0]) - im=lon.size - jm=lat.size - - dlon = np.abs(lon[0] - lon[1]) - dlat = np.abs(lat[0] - lat[1]) - xind = np.argmin(abs(lon - plon)) - yind = np.argmin(abs(lat - plat)) - im_new=xind.size - jm_new=yind.size - - mask=mask[yind,:]; mask=mask[xind] - - lonc=np.copy(xc) ; latc=np.copy(yc) - lonc=lonc[yind,:]; lonc=lonc[xind] - latc=latc[yind,:]; latc=latc[xind] - #frac = np.copy(f2.variables['frac']) - area = np.copy(f2.variables['area']) - - # if no frac on dataset, use all 1s - frac=np.ones((jm,im)) - - frac=frac[yind,:]; frac=frac[xind] - area=area[yind,:]; area=area[xind] - - - nv = 4 - #-- Create vertex matrices ---------------------------- - lonv=np.empty((nv), dtype='float64') - latv=np.empty((nv), dtype='float64') - #-- order is SW, SE, NE, NW - lonv[0] = lonc - 0.5*dlon - latv[0] = latc - 0.5*dlat - lonv[1] = lonc + 0.5*dlon - latv[1] = latc - 0.5*dlat - lonv[2] = lonc + 0.5*dlon - latv[2] = latc + 0.5*dlat - lonv[3] = lonc - 0.5*dlon - latv[3] = latc + 0.5*dlat - - #-- Check whether file exists --------------------------------- - command=['ls',fdatmdomain2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - print command - print file_exists - - w = netcdf4.Dataset(fdatmdomain2, 'w', format='NETCDF4') - - if file_exists > 0: - print 'creating new file: ', fdatmdomain2 - else: - print 'overwriting file: ', fdatmdomain2 - command='date "+%y%m%d"' - x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') - x=x2.communicate() - timetag = x[0].strip() - w.creation_date = timetag - w.source_file = fdatmdomain - w.title = 'CESM datm domain data' - w.createDimension('nv',int(nv)) - w.createDimension('ni',int(im_new)) - w.createDimension('nj',int(jm_new)) - - wyc = w.createVariable('yc','f8',('nj','ni')) - wxc = w.createVariable('xc','f8',('nj','ni')) - wyv = w.createVariable('yv','f8',('nj','ni','nv')) - wxv = w.createVariable('xv','f8',('nj','ni','nv')) - wmask = w.createVariable('mask','i4',('nj','ni')) - warea = w.createVariable('area','f8',('nj','ni')) - wfrac = w.createVariable('frac','f8',('nj','ni')) - - wyc.units = 'degrees north' - wxc.units = 'degrees east' - wyv.units = 'degrees north' - wxv.units = 'degrees east' - wmask.units = 'unitless' - warea.units = 'radians squared' - wfrac.units = 'unitless' - - wyc.long_name = 'latitude of grid cell center' - wxc.long_name = 'longitude of grid cell center' - wyv.long_name = 'latitude of grid cell vertices' - wxv.long_name = 'longitude of grid cell vertices' - wmask.long_name = 'land domain mask' - warea.long_name = 'area of grid cell in radians squared' - wfrac.long_name = 'fraction of grid cell that is active' - - # write to file -------------------------------------------- - wyc[:,:] = latc - wxc[:,:] = lonc - wyv[:,:,:] = latv - wxv[:,:,:] = lonv - wmask[:,:] = mask - warea[:,:] = area - wfrac[:,:] = frac - - w.close() - print 'successfully created datm domain file: ', fdatmdomain2 - f2.close() - - infile=[] - outfile=[] - for y in range(syr,eyr+1): +# Set control flags + +#-- Specify point to extract +plon = 300.0 +plat = -5.0 + +#-- Create regional CLM domain file +create_domain = False +#-- Create CLM surface data file +create_surfdata = True +#-- Create CLM surface data file +create_landuse = False +#-- Create single point DATM atmospheric forcing data +create_datm = False +datm_syr=1901 +datm_eyr=2014 + +#-- Modify landunit structure +overwrite_single_pft = True +dominant_pft = 4 #BETr +zero_nonveg_pfts = True +uniform_snowpack = False +no_saturation_excess = False + +#-- Specify input and output directories +dir_output='/glade/scratch/'+myname+'/single_point/' +dir_input_datm='/glade/p/cgd/tss/CTSM_datm_forcing_data/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' +dir_output_datm=dir_output + 'datmdata/' + +#-- Set input and output filenames +tag=str(plon)+'_'+str(plat) + +#-- Set time stamp +command='date "+%y%m%d"' +x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') +x=x2.communicate() +timetag = x[0].strip() + +#-- Specify land domain file --------------------------------- +fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv1.9x2.5_gx1v7.170518.nc' +#fdomain2 = dir_output + 'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.090309.nc' +fdomain2 = dir_output + 'domain.lnd.fv1.9x2.5_gx1v7.'+tag+'_170518.nc' + +#-- Specify surface data file -------------------------------- +fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc' +#fsurf2 = dir_output + 'surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_'+tag+'.c170706.nc' +fsurf2 = dir_output + 'surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_'+tag+'_c170824.nc' + +#-- Specify landuse file ------------------------------------- +fluse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc' +fluse2 = dir_output + 'landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_'+tag+'.c170824.nc' + +#-- Specify datm domain file --------------------------------- +fdatmdomain = '/glade/p/cgd/tss/CTSM_datm_forcing_data/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc' +fdatmdomain2 = dir_output_datm+'domain.lnd.360x720_gswp3.0v1.'+tag+'_c170606.nc' + +#-- Create CTSM domain file +if create_domain: + f1 = xr.open_dataset(fdomain) + # create 1d coordinate variables to enable sel() method + lon0=np.asarray(f1['xc'][0,:]) + lat0=np.asarray(f1['yc'][:,0]) + lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0}) + lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0}) + # assign() not working on cheyenne + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + f2.reset_coords(['xc','yc'],inplace=True) + # extract gridcell closest to plon/plat + f3 = f2.sel(ni=plon,nj=plat,method='nearest') + # expand dimensions + f3 = f3.expand_dims(['nj','ni']) + + wfile=fdomain2 + # mode 'w' overwrites file + f3.to_netcdf(path=wfile, mode='w') + mprint('created file '+fdomain2) + f1.close(); f2.close(); f3.close() + +#-- Create CTSM surface data file +if create_surfdata: + f1 = xr.open_dataset(fsurf) + # create 1d variables + lon0=np.asarray(f1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0}) + lat0=np.asarray(f1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + # extract gridcell closest to plon/plat + f3 = f2.sel(lsmlon=plon,lsmlat=plat,method='nearest') + # expand dimensions + f3 = f3.expand_dims(['lsmlat','lsmlon']) + + # modify surface data properties + if overwrite_single_pft: + f3['PCT_NAT_PFT'][:,:,:] = 0 + f3['PCT_NAT_PFT'][:,:,dominant_pft] = 100 + if zero_nonveg_pfts: + f3['PCT_NATVEG'][:,:] = 100 + f3['PCT_CROP'][:,:] = 0 + f3['PCT_LAKE'][:,:] = 0. + f3['PCT_WETLAND'][:,:] = 0. + f3['PCT_URBAN'][:,:,] = 0. + f3['PCT_GLACIER'][:,:] = 0. + if uniform_snowpack: + f3['STD_ELEV'][:,:] = 20. + if no_saturation_excess: + f3['FMAX'][:,:] = 0. + + # specify dimension order + #f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon') + f3 = f3.transpose(u'time', u'cft', u'lsmpft', u'natpft', u'nglcec', u'nglcecp1', u'nlevsoi', u'nlevurb', u'numrad', u'numurbl', 'lsmlat', 'lsmlon') + # mode 'w' overwrites file + f3.to_netcdf(path=fsurf2, mode='w') + mprint('created file '+fsurf2) + f1.close(); f2.close(); f3.close() + + ''' this is buggy; can't re-write a file within the same session + # modify new surface data file + if overwrite_single_pft: + f1 = xr.open_dataset(fsurf2) + f1['PCT_NAT_PFT'][:,:,:] = 0 + f1['PCT_NAT_PFT'][:,:,dominant_pft] = 100 + f1.to_netcdf(path='~/junk.nc', mode='w') + #f1.to_netcdf(path=fsurf2, mode='w') + f1.close() + if zero_nonveg_pfts: + #f1 = xr.open_dataset(fsurf2) + f1 = xr.open_dataset('~/junk.nc') + f1['PCT_NATVEG'] = 100 + f1['PCT_CROP'] = 0 + f1['PCT_LAKE'] = 0. + f1['PCT_WETLAND'] = 0. + f1['PCT_URBAN'] = 0. + f1['PCT_GLACIER'] = 0. + #f1.to_netcdf(path=fsurf2, mode='w') + f1.to_netcdf(path='~/junk2.nc', mode='w') + f1.close() + ''' +#-- Create CTSM transient landuse data file +if create_landuse: + f1 = xr.open_dataset(fluse) + # create 1d variables + lon0=np.asarray(f1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0}) + lat0=np.asarray(f1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + # extract gridcell closest to plon/plat + f3 = f2.sel(lsmlon=plon,lsmlat=plat,method='nearest') + + # expand dimensions + f3 = f3.expand_dims(['lsmlat','lsmlon']) + # specify dimension order + #f3 = f3.transpose('time','lat','lon') + f3 = f3.transpose(u'time', u'cft', u'natpft', u'lsmlat', u'lsmlon') + #f3['YEAR'] = f3['YEAR'].squeeze() + + # revert expand dimensions of YEAR + year = np.squeeze(np.asarray(f3['YEAR'])) + x = xr.DataArray(year, coords={'time':f3['time']}, dims='time', name='YEAR') + x.attrs['units']='unitless' + x.attrs['long_name']='Year of PFT data' + f3['YEAR'] = x + #print(x) + #mprint(f3) + #stop + # mode 'w' overwrites file + f3.to_netcdf(path=fluse2, mode='w') + mprint('created file '+fluse2) + f1.close(); f2.close(); f3.close() + +#-- Create single point atmospheric forcing data +if create_datm: + #-- create datm domain file + f1 = xr.open_dataset(fdatmdomain) + # create 1d coordinate variables to enable sel() method + lon0=np.asarray(f1['xc'][0,:]) + lat0=np.asarray(f1['yc'][:,0]) + lon=xr.DataArray(lon0,name='lon',dims='ni',coords={'ni':lon0}) + lat=xr.DataArray(lat0,name='lat',dims='nj',coords={'nj':lat0}) + + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + f2.reset_coords(['xc','yc'],inplace=True) + # extract gridcell closest to plon/plat + f3 = f2.sel(ni=plon,nj=plat,method='nearest') + # expand dimensions + f3 = f3.expand_dims(['nj','ni']) + + wfile=fdatmdomain2 + # mode 'w' overwrites file + f3.to_netcdf(path=wfile, mode='w') + mprint('created file '+fdatmdomain2) + f1.close(); f2.close(); f3.close() + + #-- specify subdirectory names and filename prefixes + solrdir = 'Solar/' + precdir = 'Precip/' + tpqwldir = 'TPHWL/' + prectag = 'clmforc.GSWP3.c2011.0.5x0.5.Prec.' + solrtag = 'clmforc.GSWP3.c2011.0.5x0.5.Solr.' + tpqwtag = 'clmforc.GSWP3.c2011.0.5x0.5.TPQWL.' + + #-- create data files + infile=[] + outfile=[] + for y in range(datm_syr,datm_eyr+1): ystr=str(y) for m in range(1,13): mstr=str(m) @@ -488,242 +291,39 @@ fprecip2=dir_output_datm+prectag+tag+'.'+dtag+'.nc' ftpqw=dir_input_datm+tpqwldir+tpqwtag+dtag+'.nc' ftpqw2=dir_output_datm+tpqwtag+tag+'.'+dtag+'.nc' - + infile+=[fsolar,fprecip,ftpqw] outfile+=[fsolar2,fprecip2,ftpqw2] - nm=len(infile) - for n in range(nm): - print outfile[n], '\n' - file_in = infile[n] - file_out = outfile[n] - - f2 = netcdf4.Dataset(file_in, 'r', format='NETCDF4') - global_attributes = f2.ncattrs() - variables = f2.variables - dimensions = f2.dimensions + nm=len(infile) + for n in range(nm): + mprint(outfile[n]+'\n') + file_in = infile[n] + file_out = outfile[n] + + + f1 = xr.open_dataset(file_in) + # create 1d coordinate variables to enable sel() method + lon0=np.asarray(f1['LONGXY'][0,:]) + lat0=np.asarray(f1['LATIXY'][:,0]) + lon=xr.DataArray(lon0,name='lon',dims='lon',coords={'lon':lon0}) + lat=xr.DataArray(lat0,name='lat',dims='lat',coords={'lat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + f2.reset_coords(['LONGXY','LATIXY'],inplace=True) + # extract gridcell closest to plon/plat + f3 = f2.sel(lon=plon,lat=plat,method='nearest') + # expand dimensions + f3 = f3.expand_dims(['lat','lon']) + # specify dimension order + f3 = f3.transpose(u'scalar','time','lat','lon') + + # mode 'w' overwrites file + f3.to_netcdf(path=file_out, mode='w') + f1.close(); f2.close(); f3.close() - #-- Open output file - w = netcdf4.Dataset(file_out, 'w', format='NETCDF4') - #-- Set global attributes - for ga in global_attributes: - setattr(w,ga,f2.getncattr(ga)) - #-- Set dimensions of output file - for dim in dimensions.keys(): - print dim - if dim == 'lon': - w.createDimension(dim,int(im_new)) - elif dim == 'lat': - w.createDimension(dim,int(jm_new)) - else: - w.createDimension(dim,len(dimensions[dim])) - - for var in variables.keys(): - y=f2.variables[var].dimensions - x2 = [x.encode('ascii') for x in y] - vtype = f2.variables[var].datatype - print var, vtype, x2 - wvar = w.createVariable(var, vtype, x2) - - if len(x2) > 0: - fvar=np.copy(f2.variables[var]) - - #-- Subset input variables - for n in range(len(x2)): - fdim = x2[n] - if fdim == 'lon': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[xind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,xind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,xind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,xind,] - fvar = tmp - if fdim == 'lat': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[yind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,yind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,yind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,yind,] - fvar = tmp - - #-- Set attribute values - att=f2.variables[var].ncattrs() - print att, '\n' - km=len(att) - for attname in att: - print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) - w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) - - #-- Write variable data to output file - if len(x2) == 0: - wvar[:] = np.copy(f2.variables[var][:]) - if len(wvar.shape) == 1: - wvar[:] = fvar - if len(wvar.shape) == 2: - wvar[:,:] = fvar - if len(wvar.shape) == 3: - wvar[:,:,:] = fvar - if len(wvar.shape) == 4: - wvar[:,:,:,:] = fvar - - #-- Close output file - w.close - print 'datm files written to: ', dir_output_datm - -#-- create landuse data file -------------------------------------- -#46 -if create_landuse == 1: - f2 = netcdf4.Dataset(flanduse, 'r', format='NETCDF4') - global_attributes = f2.ncattrs() - variables = f2.variables - dimensions = f2.dimensions - - #-- Check whether file exists --------------------------------- - command=['ls',flanduse2] - file_exists=subprocess.call(command,stderr=subprocess.PIPE) - if file_exists > 0: - print 'creating new file: ', flanduse2 - else: - print 'overwriting file: ', flanduse2 - - #-- Open output file - w = netcdf4.Dataset(flanduse2, 'w', format='NETCDF4') - - #-- Set global attributes - for ga in global_attributes: - setattr(w,ga,f2.getncattr(ga)) - #-- Set dimensions of output file - for dim in dimensions.keys(): - print dim - if dim == 'lsmlon': - w.createDimension(dim,int(im_new)) - elif dim == 'lsmlat': - w.createDimension(dim,int(jm_new)) - else: - w.createDimension(dim,len(dimensions[dim])) - - for var in variables.keys(): - y=f2.variables[var].dimensions - x2 = [x.encode('ascii') for x in y] - vtype = f2.variables[var].datatype - print var, vtype, x2 - wvar = w.createVariable(var, vtype, x2) - - if len(x2) > 0: - fvar=np.copy(f2.variables[var]) - - #-- Subset input variables - for n in range(len(x2)): - fdim = x2[n] - if fdim == 'lsmlon': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[xind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,xind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,xind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,xind,] - fvar = tmp - if fdim == 'lsmlat': - if n == 0: - shp=np.asarray(fvar.shape) - shp[0] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[0,] = fvar[yind,] - fvar = tmp - if n == 1: - shp=np.asarray(fvar.shape) - shp[1] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,0,] = fvar[:,yind,] - fvar = tmp - if n == 2: - shp=np.asarray(fvar.shape) - shp[2] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,0,] = fvar[:,:,yind,] - fvar = tmp - if n == 3: - shp=np.asarray(fvar.shape) - shp[3] = 1 - tmp=np.empty(shp, dtype='float64') - tmp[:,:,:,0,] = fvar[:,:,:,yind,] - fvar = tmp - - #-- Set attribute values - att=f2.variables[var].ncattrs() - print att, '\n' - km=len(att) - for attname in att: - print 'name: ',attname,' value: ',f2.variables[var].getncattr(attname) - w.variables[var].setncattr(attname,f2.variables[var].getncattr(attname)) - - #-- Write variable data to output file - if len(x2) == 0: - wvar[:] = np.copy(f2.variables[var][:]) - if len(wvar.shape) == 1: - wvar[:] = fvar - if len(wvar.shape) == 2: - wvar[:,:] = fvar - if len(wvar.shape) == 3: - wvar[:,:,:] = fvar - if len(wvar.shape) == 4: - wvar[:,:,:,:] = fvar - - #-- Close output file - w.close - print 'successfully created landuse data file: ', flanduse2 + mprint('datm files written to: '+dir_output_datm) From d34eb0916158dd8e28d24884705f711e5874f43b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:33:38 -0700 Subject: [PATCH 311/730] Rename file --- tools/contrib/{singlept_xr.py => singlept.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{singlept_xr.py => singlept.py} (100%) diff --git a/tools/contrib/singlept_xr.py b/tools/contrib/singlept.py similarity index 100% rename from tools/contrib/singlept_xr.py rename to tools/contrib/singlept.py From a1af8dec60d121347b5e65eb7bfac614b011d6e6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:34:39 -0700 Subject: [PATCH 312/730] Initial add of script to modify a surface dataset for single-point --- tools/contrib/modify_singlept_site_xr.py | 392 +++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100755 tools/contrib/modify_singlept_site_xr.py diff --git a/tools/contrib/modify_singlept_site_xr.py b/tools/contrib/modify_singlept_site_xr.py new file mode 100755 index 0000000000..112f16a40e --- /dev/null +++ b/tools/contrib/modify_singlept_site_xr.py @@ -0,0 +1,392 @@ +#! /usr/bin/env python +import sys +import string +import subprocess +import numpy as np +import netCDF4 as netcdf4 +import xarray as xr + +def mprint(mstr): + vnum=sys.version_info[0] + if vnum == 3: + print(mstr) + if vnum == 2: + print mstr + +''' +#------------------------------------------------------------------# +#--------------------- Instructions -----------------------------# +#------------------------------------------------------------------# +After creating a single point surface data file from a global +surface data file, use this script to overwrite some fields with +site-specific data. +''' + +#-- Create single point CLM surface data file +create_surfdata = True + +#-- specify site from which to extract data ---------- +#sitename='US-ARM' +sitename='US-Ho1' +sitename='US-Ha1' + +#-- Site level data directory ------------------------ +site_dir='/glade/work/swensosc/ctsm_code/ctsm/tools/PTCLM/PTCLM_sitedata/' + +#-- Specify original file +fsurf = '/glade/scratch/swensosc/sfcdata/surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_US-Ho1.c190117.nc' +fsurf = '/glade/scratch/wwieder/single_point/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr1850_287.8_42.5_c230119.nc' + +#-- Output directory --------------------------------- +dir_output='/glade/scratch/swensosc/sfcdata/' + +#-- Specify new file name ----------------------------- +command='date "+%y%m%d"' +x2=subprocess.Popen(command,stdout=subprocess.PIPE,shell='True') +x=x2.communicate() +timetag = x[0].strip() +fsurf2 = dir_output + 'surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_'+sitename+'_site.c'+timetag+'.nc' + +#== End User Mods ===================================== + +#site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 +pftfile =site_dir+'PTCLMDATA_pftdata.txt' +#site_code,name,state,lon,lat,elev,startyear,endyear,alignyear,timestep,campaign +sitefile=site_dir+'PTCLMDATA_sitedata.txt' +#site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% +soilfile=site_dir+'PTCLMDATA_soildata.txt' + +#-- Raw datafiles ------------------------ +rawdatafile = '/glade/work/swensosc/ctsm_code/ctsm/tools/mksurfdata_map/mksurfdata_map.namelist' + +mstr='Checking for data for site: '+sitename +mprint(mstr) + +#-- Read raw datafiles ------------------------ +with open(rawdatafile, 'r') as t1: + for tmp in t1: + x=tmp.split('=') + if x[0].strip() == 'mksrf_fsoitex': + fsoitex = x[1].strip() + fsoitex = fsoitex.strip("'") + if x[0].strip() == 'mksrf_forganic': + forganic = x[1].strip() + forganic = forganic.strip("'") + if x[0].strip() == 'mksrf_flakwat': + flakwat= x[1].strip() + flakwat= flakwat.strip("'") + if x[0].strip() == 'mksrf_fwetlnd': + fwetlnd = x[1].strip() + fwetlnd = fwetlnd.strip("'") + if x[0].strip() == 'mksrf_fmax': + fmax = x[1].strip() + fmax = fmax.strip("'") + if x[0].strip() == 'mksrf_fglacier': + fglacier= x[1].strip() + fglacier= fglacier.strip("'") + if x[0].strip() == 'mksrf_fglacierregion': + fglacierregion= x[1].strip() + fglacierregion= fglacierregion.strip("'") + if x[0].strip() == 'mksrf_fvocef': + fvocef= x[1].strip() + fvocef= fvocef.strip("'") + if x[0].strip() == 'mksrf_furbtopo': + furbtopo = x[1].strip() + furbtopo = furbtopo.strip("'") + if x[0].strip() == 'mksrf_fgdp': + fgdp = x[1].strip() + fgdp = fgdp.strip("'") + if x[0].strip() == 'mksrf_fpeat': + fpeat = x[1].strip() + fpeat = fpeat.strip("'") + if x[0].strip() == 'mksrf_fsoildepth': + fsoildepth= x[1].strip() + fsoildepth= fsoildepth.strip("'") + if x[0].strip() == 'mksrf_fabm': + fabm = x[1].strip() + fabm = fabm.strip("'") + if x[0].strip() == 'mksrf_ftopostats': + ftopostats = x[1].strip() + ftopostats = ftopostats.strip("'") + if x[0].strip() == 'mksrf_fvic': + fvic = x[1].strip() + fvic = fvic.strip("'") + if x[0].strip() == 'mksrf_fch4': + fch4 = x[1].strip() + fch4 = fch4.strip("'") + if x[0].strip() == 'mksrf_furban': + furban = x[1].strip() + furban = furban.strip("'") + if x[0].strip() == 'mksrf_fvegtyp': + fvegtyp= x[1].strip() + fvegtyp= fvegtyp.strip("'") + if x[0].strip() == 'mksrf_fhrvtyp': + fhrvtyp= x[1].strip() + fhrvtyp= fhrvtyp.strip("'") + if x[0].strip() == 'mksrf_fsoicol': + fsoicol = x[1].strip() + fsoicol = fsoicol.strip("'") + if x[0].strip() == 'mksrf_flai': + flai = x[1].strip() + flai = flai.strip("'") + +#Open site file and extract data +site_found = False +with open(sitefile, 'r') as t1: + for tmp in t1: + x=tmp.split(',') + if x[0] == sitename: + site_found = True + site_header = tmp + name = x[1] + state = x[2] + plon = np.float32(x[3]) + plat = np.float32(x[4]) + elev = np.float32(x[5]) + startyear= np.int32(x[6]) + endyear = np.int32(x[7]) + alignyear= np.int32(x[8]) + timestep = np.float32(x[9]) + campaign = x[10] + exit + +if not site_found: + mprint('No site matching '+sitename+' was found') + stop +else: + mprint(site_header) + +# convert longitude to east if needed +if plon < 0: + plon+=360.0 + +#-- Open pft file and extract data --------------------------------- +site_found = False +with open(pftfile, 'r') as t1: + for tmp in t1: + x=tmp.split(',') + if x[0] == sitename: + site_found = True + pft_f1= np.int32(x[1]) + pft_c1= np.int32(x[2]) + pft_f2= np.int32(x[3]) + pft_c2= np.int32(x[4]) + pft_f3= np.int32(x[5]) + pft_c3= np.int32(x[6]) + pft_f4= np.int32(x[7]) + pft_c4= np.int32(x[8]) + pft_f5= np.int32(x[9]) + pft_c5= np.int32(x[10]) + exit + + +#-- Open soil file and extract data --------------------------------- +site_found = False +with open(soilfile, 'r') as t1: + for tmp in t1: + x=tmp.split(',') + if x[0] == sitename: + site_found = True + soil_depth = np.float32(x[1]) + n_layers = np.int32(x[2]) + layer_depth = np.float32(x[3]) + layer_sand_pct = np.float32(x[4]) + layer_clay_pct = np.float32(x[5]) + exit + +#-- create surface data file -------------------------------------- +##2 +if create_surfdata: + f1 = xr.open_dataset(fsurf) + # expand dimensions + #f1 = f1.expand_dims(['lsmlat','lsmlon']) + + # create 1d variables + lon0=np.asarray(f1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0}) + lat0=np.asarray(f1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0}) + #f2=f1.assign({'lon':lon,'lat':lat}) + # the above doesn't work now + f2=f1.assign() + f2['lon'] = lon + f2['lat'] = lat + + # make gridcell entirely natural vegetation *or* entirely crop + new_pct_natveg = 0. + new_pct_crop = 0. + if np.logical_and( + np.any([pft_f1,pft_f2,pft_f3,pft_f4,pft_f5]), + np.any([(pft_c1 < 15),(pft_c2 < 15),(pft_c3 < 15),(pft_c4 < 15),(pft_c5 < 15)])): + new_pct_natveg = 100. + if np.logical_and( + np.any([pft_f1,pft_f2,pft_f3,pft_f4,pft_f5]), + np.any([(pft_c1 >= 15),(pft_c2 >= 15),(pft_c3 >= 15),(pft_c4 >= 15),(pft_c5 >= 15)])): + new_pct_crop = 100. + + if new_pct_natveg == new_pct_crop: + print 'both natveg and crop set to 100, exiting' + stop + + #-- Remove non-vegetated landunits --------------------------------- + f2['PCT_NATVEG'] = new_pct_natveg + f2['PCT_CROP'] = new_pct_crop + f2['PCT_LAKE'] = 0. + f2['PCT_WETLAND'] = 0. + f2['PCT_URBAN'] = 0. + f2['PCT_GLACIER'] = 0. + + #-- Overwrite global data with raw data ---------------------------- + f2['LONGXY'] = plon + f2['LATIXY'] = plat + + #-- Soil texture + r1 = xr.open_dataset(fsoitex) + plonc = plon + if plonc > 180.0: + plonc -= 360.0 + + # set coordinates (seems to require 'lon' and 'lat' to recognize... + r1=r1.rename({'LON':'lon','LAT':'lat'}) + r1.set_coords(['lon','lat'],inplace=True) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + # extract sand/clay profiles for given mapunit + mapunit = np.int32(r2['MAPUNITS']) + + f2['PCT_SAND'][:,0,0] = np.asarray(r2['PCT_SAND'][:,mapunit]) + f2['PCT_CLAY'][:,0,0] = np.asarray(r2['PCT_CLAY'][:,mapunit]) + + r1.close() ; r2.close() + + #-- Organic + r1 = xr.open_dataset(forganic) + r1=r1.rename({'LON':'lon','LAT':'lat'}) + r1.set_coords(['lon','lat'],inplace=True) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['ORGANIC'][:,0,0] = np.asarray(r2['ORGANIC']) + r1.close() ; r2.close() + + #-- Fmax + r1 = xr.open_dataset(fmax) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['FMAX'] = np.asarray(r2['FMAX']) + r1.close() ; r2.close() + + #-- VOC + r1 = xr.open_dataset(fvocef) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['EF1_BTR'] = np.asarray(r2['ef_btr']) + f2['EF1_CRP'] = np.asarray(r2['ef_crp']) + f2['EF1_FDT'] = np.asarray(r2['ef_fdt']) + f2['EF1_FET'] = np.asarray(r2['ef_fet']) + f2['EF1_GRS'] = np.asarray(r2['ef_grs']) + f2['EF1_SHR'] = np.asarray(r2['ef_shr']) + r1.close() ; r2.close() + + #-- GDP + r1 = xr.open_dataset(fgdp) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['gdp'] = np.asarray(r2['gdp']) + r1.close() ; r2.close() + + #-- Peat + r1 = xr.open_dataset(fpeat) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['peatf'] = np.asarray(r2['peatf']) + r1.close() ; r2.close() + + #-- Soil Depth + r1 = xr.open_dataset(fsoildepth) + # create 1d variables + lon0=np.asarray(r1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lon',coords={'lon':lon0}) + lat0=np.asarray(r1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lat',coords={'lat':lat0}) + r1['lon'] = lon + r1['lat'] = lat + r1=r1.rename({'lsmlon':'lon','lsmlat':'lat'}) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['zbedrock'] = np.asarray(r2['Avg_Depth_Median']) + #f2['zbedrock'] = np.asarray(r2['Avg_Depth_Mean']) + r1.close() ; r2.close() + + #-- ABM + r1 = xr.open_dataset(fabm) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['abm'] = np.asarray(r2['abm']) + r1.close() ; r2.close() + + #-- SLOPE + r1 = xr.open_dataset(ftopostats) + rlon=np.asarray(r1['LONGITUDE']) + rlat=np.asarray(r1['LATITUDE']) + # extract gridcell closest to plon/plat (data are 1-d) (lon [0,360]) + k1 = np.argmin(np.power(rlon - plon,2)+np.power(rlat - plat,2)) + f2['SLOPE'] = np.asarray(r1['SLOPE'][k1]) + r1.close() ; r2.close() + + #-- VIC + r1 = xr.open_dataset(fvic) + r1=r1.rename({'lsmlon':'lon','lsmlat':'lat'}) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['Ws'] = np.asarray(r2['Ws']) + f2['Dsmax'] = np.asarray(r2['Dsmax']) + f2['Ds'] = np.asarray(r2['Ds']) + r1.close() ; r2.close() + + #-- Methane + r1 = xr.open_dataset(fch4) + # create 1d variables + lon0=np.asarray(r1['LONGXY'][0,:]) + lon=xr.DataArray(lon0,name='lon',dims='lon',coords={'lon':lon0}) + lat0=np.asarray(r1['LATIXY'][:,0]) + lat=xr.DataArray(lat0,name='lat',dims='lat',coords={'lat':lat0}) + r1['lon'] = lon + r1['lat'] = lat + r1=r1.rename({'lsmlon':'lon','lsmlat':'lat'}) + # extract gridcell closest to plon/plat (this file is [0,360] + r2 = r1.sel(lon=plon,lat=plat,method='nearest') + f2['P3'] = np.asarray(r2['P3']) + f2['ZWT0'] = np.asarray(r2['ZWT0']) + f2['F0'] = np.asarray(r2['F0']) + r1.close() ; r2.close() + + #-- Soil Color + r1 = xr.open_dataset(fsoicol) + r1=r1.rename({'LON':'lon','LAT':'lat'}) + r1.set_coords(['lon','lat'],inplace=True) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + f2['SOIL_COLOR'] = np.asarray(r2['SOIL_COLOR']) + r1.close() ; r2.close() + + #-- LAI / Height + r1 = xr.open_dataset(flai) + r1=r1.rename({'LON':'lon','LAT':'lat'}) + r1.set_coords(['lon','lat'],inplace=True) + # extract gridcell closest to plonc/plat + r2 = r1.sel(lon=plonc,lat=plat,method='nearest') + + # ignoring crop, i.e. excluding index 15 + f2['MONTHLY_HEIGHT_BOT'][:,0:15,0,0] = np.asarray(r2['MONTHLY_HEIGHT_BOT'][:,0:15]) + f2['MONTHLY_HEIGHT_TOP'][:,0:15,0,0] = np.asarray(r2['MONTHLY_HEIGHT_TOP'][:,0:15]) + f2['MONTHLY_LAI'][:,0:15,0,0] = np.asarray(r2['MONTHLY_LAI'][:,0:15]) + f2['MONTHLY_SAI'][:,0:15,0,0] = np.asarray(r2['MONTHLY_SAI'][:,0:15]) + r1.close() ; r2.close() + + #-- Close output file + # mode 'w' overwrites file + f2.to_netcdf(path=fsurf2, mode='w') + mprint('created file '+fsurf2) + f1.close(); f2.close(); f2.close() + mprint('successfully created surface data file: '+fsurf2) + From ab934d6a8e01027617a5f9aa3c44ca43f01408d0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:35:00 -0700 Subject: [PATCH 313/730] Rename file --- .../{modify_singlept_site_xr.py => modify_singlept_site.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{modify_singlept_site_xr.py => modify_singlept_site.py} (100%) diff --git a/tools/contrib/modify_singlept_site_xr.py b/tools/contrib/modify_singlept_site.py similarity index 100% rename from tools/contrib/modify_singlept_site_xr.py rename to tools/contrib/modify_singlept_site.py From d9e0a8c135a3acdfc741ed6441890d76a1941511 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:54:21 -0700 Subject: [PATCH 314/730] Initial add of script from Keith Oleson to run many towers based on surface datasets created by PTCLM --- tools/contrib/run_clmtowers.v1.csh | 274 +++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100755 tools/contrib/run_clmtowers.v1.csh diff --git a/tools/contrib/run_clmtowers.v1.csh b/tools/contrib/run_clmtowers.v1.csh new file mode 100755 index 0000000000..5bc5398143 --- /dev/null +++ b/tools/contrib/run_clmtowers.v1.csh @@ -0,0 +1,274 @@ +#!/bin/csh -f +# +# run_clmtowers.v1.csh +# Purpose: This script will run any number of flux tower sites. You will need to +# run the script for each spinup and post spinup set of simulations (i.e., +# for BGC on, run it separately for AD, PostAD, and post spinup simulations; +# for BGC off, run it separately for spinup and post spinup simulations) +# You will need to do two things: +# 1. Copy this script into $Clm_Tag_Dir/components/clm/tools/shared/PTCLM +# where $Clm_Tag_Dir is the location of your clm tag +# 2. Set up a directory structure where you can put any sourcemods you might want. +# These sourcemods will be copied into the appropriate case directory. +# The structure is up to you but here is an example: +# cd $Clm_Tag_Dir/components/clm/tools/shared/PTCLM +# mkdir SourceMods +# mkdir SourceMods/clm4_5 +# mkdir SourceMods/clm5_0 +# mkdir SourceMods/clm4_5/BASE ; This might contain any sourcemods that you want +# ; to use in your clm4_5 control experiment +# mkdir SourceMods/clm5_0/BASE ; This might contain any sourcemods that you want +# ; to use in your clm5_0 control experiment +# mkdir SourceMods/clm4_5/EXP1 ; This might contain any sourcemods that you want +# ; to use in your first clm4_5 experiment +# mkdir SourceMods/clm5_0/EXP1 ; This might contain any sourcemods that you want +# ; to use in your first clm5_0 experiment +# Author: Keith Oleson +# Last Revised: Aug 25 2015 +# Last CLM Tag that this worked on: clm4_5_1_r111 +# Warning: This script is complicated and does not have good (any) error checking currently. +# You might want to come see me for a quick tutorial before using this. +# +# Assumes that PTCLMmkdata has already been run for the tower sites chosen below +# (Surface datasets and shell commands have already been created) +# + +set pwd=`pwd` + +# =================================Start User Mods================================ +# Pick a compset (these are the only two compsets supported) +#set compset = I1PTCLM45 +set compset = I1PTCLM50 +if ($compset == I1PTCLM45) then + set model = clm4_5 +else + set model = clm5_0 +endif + +# Set location of your run directories +set rundata = /glade/scratch/oleson +# Set the location of your CLM tag +set Clm_Tag_Dir = /glade/p/work/oleson/clm4_5_1_r111 +# Set the location of your surface datasets and shell commands. This will not necessarily be in the +# same location as the CLM tag that you are running above +set User_Mods_Dir = /glade/p/work/oleson/clm4_5_1_r111 + +# What sites to run? +# These are the sites that can be evaluated with some combination of level 2 data and synthesis (gap-filled) data +#set sites = ( US-Var US-Bo1 US-UMB US-Brw US-ARM US-Ho1 US-Me4 US-Me2 US-Dk3 US-NR1 DE-Tha ES-ES1 FL-Hyy CA-Man BR-Sa3 BR-Sa1 IT-Cpz US-Dk2 US-MOz US-WCr US-MMS US-Ha1 BE-Vie IT-Col CA-Let US-FPe FL-Kaa US-IB1 US-Ne3 CA-Qfo BR-Sa1LBA BR-Sa3LBA BR-Ma1LBA BR-RJA BR-Ji1 ) +#set startyear = ( 2000 1996 1999 1998 2000 1996 1996 2002 1998 1998 1998 1999 1997 1994 2001 2002 2001 2003 2004 1998 1999 1991 1997 1996 1998 2000 2000 2005 2001 2004 2002 2001 2000 2000 1999 ) +#set endyear = ( 2007 2008 2006 2006 2007 2004 2000 2010 2005 2007 2003 2005 2005 2003 2003 2004 2005 2005 2007 2006 2007 2006 2005 2001 2007 2007 2005 2007 2006 2006 2004 2003 2005 2002 2001 ) +# Or you could just do one site +set sites = ( US-Var ) +set startyear = ( 2000 ) +set endyear = ( 2007 ) + +# USER MODS FOR BGC ON +# For BGC on, the sequence of simulations is AD spinup (1000 years), +# PostAD spinup (500 years), +# post spinup (the number of tower years with atmospheric forcing) +# For BGC on, AD spinup is SPINUP_P1=TRUE, SPINUP_P2=FALSE +# PostAD spinup is SPINUP_P1=TRUE, SPINUP_P2=TRUE +# post spinup is SPINUP_P1=FALSE, SPINUP_P2=FALSE +#set BGC = "ON" +#setenv SPINUP_P1 "FALSE" +#setenv SPINUP_P2 "FALSE" + +# For BGC on, you could use these for either type of spinup (AD or PostAD) +#set newcase = spinADbgc +#set clonecase = spinPostADbgc +# For BGC on, you could use these for post spinup (the number of tower years with atmospheric forcing) +# You should change the "t111" for the clonecase to whatever tag you are using (e.g., t111 is used here to +# denote clm4_5_1_r111) and/or add some designation for your particular experiment with that tag (e.g., +# t111exp1wspinbgc) +#set newcase = spinPostADbgc +#set clonecase = t111wspinbgc + +# USER MODS FOR BGC OFF +# For BGC off, the sequence of simulations is normal spinup (32 years) +# post spinup (the number of tower years with atmospheric forcing) +# For BGC off, normal spinup is SPINUP_P1=true, SPINUP_P2=false +# post spinup is SPINUP_P1=false, SPINUP_P2=false +set BGC = "OFF" +setenv SPINUP_P1 "FALSE" +setenv SPINUP_P2 "FALSE" + +# For BGC off, use these for either normal spinup or post spinup +# You should change the "t111" for the clonecase to whatever tag you are using (e.g., t111 is used here to +# denote clm4_5_1_r111) and/or add some designation for your particular experiment with that tag (e.g., +# t111exp1wspinsp) +set newcase = spinsp +set clonecase = t111wspinsp + +# These sourcemods will be copied into every case directory (you will need to setup a +# directory structure for your sourcemods, see instructions at top of script) +set sourcemods_dir = {$Clm_Tag_Dir}/components/clm/tools/shared/PTCLM/SourceMods/ +set sourcemods = $sourcemods_dir{$model}/BASE/*.F90 + +# =================================End User Mods================================ + +@ cnt = 1 +foreach mysite ( $sites ) + @ numyears = $endyear[$cnt] - $startyear[$cnt] + 1 + if ($SPINUP_P1 == TRUE) then + @ numfour = $numyears / 4 + # If have three years or less (numfour = 0) just repeat first year + # unless first year is leap year then use next year. + # Since just using one year that is not a leap year we can use + # an alignyear of 1 and endyear is the startyear + if ( $numfour == 0 ) then + if ( $startyear[$cnt] % 4 == 0 ) then + @ startyears = $startyear[$cnt] + 1 + @ endyears = $startyears + else + @ endyears = $startyear[$cnt] + @ startyears = $endyears + endif + @ alignyear = 1 + endif + if ( $numfour != 0 ) then + @ startyears = $startyear[$cnt] + @ endyears = $startyear[$cnt] + $numfour * 4 - 1 + @ alignyear = $startyear[$cnt] + endif + echo $endyear[$cnt] + echo $endyears + echo $startyears + echo $alignyear + endif + cd {$Clm_Tag_Dir}/cime/scripts + if ($SPINUP_P1 == FALSE) then + set casename = ${clonecase}_${mysite}_$compset + ./create_clone -case $casename -clone ${newcase}_${mysite}_${compset} + else + if ($BGC == ON && $SPINUP_P2 == TRUE) then + set casename = ${clonecase}_${mysite}_$compset + echo $casename + ./create_clone -case $casename -clone ${newcase}_${mysite}_${compset} + else + set casename = ${newcase}_${mysite}_$compset + ./create_newcase -user_mods_dir {$User_Mods_Dir}/components/clm/tools/shared/PTCLM/mydatafiles/1x1pt_${mysite} -case $casename -mach yellowstone_intel -compset $compset -res CLM_USRDAT + endif + endif + cd {$Clm_Tag_Dir}/cime/scripts/${casename} + if ($SPINUP_P1 == FALSE) then + rm -f cesm.stderr* + rm -f cesm.stdout* + rm -f STATUS.out + ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears + ./xmlchange -file env_run.xml -id STOP_N -val $numyears + ./xmlchange -file env_run.xml -id RUN_STARTDATE -val $startyear[$cnt]-01-01 + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_ALIGN -val $startyear[$cnt] + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_START -val $startyear[$cnt] + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_END -val $endyear[$cnt] + ./xmlchange -file env_build.xml -id CALENDAR -val GREGORIAN + if ($BGC == ON) then + ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup off" + endif + else + if ($BGC == ON && $SPINUP_P2 == TRUE) then + rm -f cesm.stderr* + rm -f cesm.stdout* + rm -f STATUS.out + ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears + ./xmlchange -file env_run.xml -id STOP_N -val 500 + ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup off" + else + ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears + if ($BGC == ON) then + ./xmlchange -file env_run.xml -id STOP_N -val 1000 + else + ./xmlchange -file env_run.xml -id STOP_N -val 32 + endif + if ($alignyear == 1) then + ./xmlchange -file env_run.xml -id RUN_STARTDATE -val 000{$alignyear}-01-01 + else + ./xmlchange -file env_run.xml -id RUN_STARTDATE -val $startyear[$cnt]-01-01 + endif + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_ALIGN -val $alignyear + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_START -val $startyears + ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_END -val $endyears + if ($alignyear == 1) then + ./xmlchange -file env_build.xml -id CALENDAR -val NO_LEAP + endif + if ($BGC == ON) then + ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup on" + endif + endif + endif + if ($mysite == BR-Sa1LBA || $mysite == BR-Sa3LBA || $mysite == BR-Ma1LBA || $mysite == BR-RJA || $mysite == BR-Ji1) then + if ($SPINUP_P1 == FALSE) then + rm -f user_datm.streams.txt.CLM1PT.CLM_USRDAT + endif + endif + ./cesm_setup + if ( $status != 0 )then + echo "CESM_SETUP FAIL $status" >> ./STATUS.out + exit -1 + else + echo "CESM_SETUP PASS" >> ./STATUS.out + endif + if ($SPINUP_P1 == TRUE && $BGC == ON) then + sed "/BSUB -R/d;s/BSUB -P P93300641/BSUB -P P93300041/g;s/BSUB -W 2:00/BSUB -W 23:59/g" ./${casename}.run > tmp.run + else + sed "/BSUB -R/d;s/BSUB -P P93300641/BSUB -P P93300041/g" ./${casename}.run > tmp.run + endif + mv tmp.run ./${casename}.run + chmod u+x ./${casename}.run + cp $sourcemods SourceMods/src.clm + echo $mysite + if ($mysite == BR-Sa1LBA || $mysite == BR-Sa3LBA || $mysite == BR-Ma1LBA || $mysite == BR-RJA || $mysite == BR-Ji1) then + cp CaseDocs/datm.streams.txt.CLM1PT.CLM_USRDAT ./user_datm.streams.txt.CLM1PT.CLM_USRDAT + chmod u+wx ./user_datm.streams.txt.CLM1PT.CLM_USRDAT + sed "s/RH /QBOT /g" user_datm.streams.txt.CLM1PT.CLM_USRDAT > tmp.user_datm.streams.txt.CLM1PT.CLM_USRDAT + sed "s/ rh/ shum/g" tmp.user_datm.streams.txt.CLM1PT.CLM_USRDAT > tmp2.user_datm.streams.txt.CLM1PT.CLM_USRDAT + rm -f tmp.user_datm.streams.txt.CLM1PT.CLM_USRDAT + mv tmp2.user_datm.streams.txt.CLM1PT.CLM_USRDAT ./user_datm.streams.txt.CLM1PT.CLM_USRDAT + endif + if ($SPINUP_P1 == FALSE) then + sed "/taxmode = 'cycle','cycle'/d" user_nl_datm > tmp.user_nl_datm + mv tmp.user_nl_datm ./user_nl_datm + sed "s/hist_nhtfrq = 0/hist_nhtfrq = 0,1/g" ./user_nl_clm > tmp.user_nl_clm + sed "s/hist_mfilt = 1200/hist_mfilt = 1,350400/g" ./tmp.user_nl_clm > tmp2.user_nl_clm + rm -f tmp.user_nl_clm + sed "/finidat/d" ./tmp2.user_nl_clm > tmp3.user_nl_clm + rm -f tmp2.user_nl_clm + if ($BGC == ON) then + echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','GPP','NEE','ELAI','BTRAN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV'" >> tmp3.user_nl_clm + else + echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','ELAI','BTRAN','FPSN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV'" >> tmp3.user_nl_clm + endif + set finidat=`ls -1 $rundata/${newcase}_${mysite}_${compset}/run/${newcase}_${mysite}_${compset}.clm?.r.*.nc | tail -1` + echo $finidat + echo " finidat = '$finidat'" >> tmp3.user_nl_clm + mv tmp3.user_nl_clm ./user_nl_clm + else + if ($BGC == ON && $SPINUP_P2 == TRUE) then + set finidat=`ls -1 $rundata/${newcase}_${mysite}_${compset}/run/${newcase}_${mysite}_${compset}.clm?.r.*.nc | tail -1` + echo $finidat + echo " finidat = '$finidat'" >> user_nl_clm + else + echo "taxmode = 'cycle','cycle'" >> user_nl_datm + if ($BGC == ON) then + sed "s/hist_mfilt = 1200/hist_mfilt = 12000/g" ./user_nl_clm > tmp.user_nl_clm + mv tmp.user_nl_clm ./user_nl_clm + endif + endif + endif + ./{$casename}.build + if ( $status != 0 )then + echo "BUILD FAIL $status" >> ./STATUS.out + exit -1 + else + echo "BUILD PASS" >> ./STATUS.out + endif + ./${casename}.submit + if ( $status != 0 )then + echo "SUBMIT FAIL $status" >> ./STATUS.out + exit -1 + else + echo "SUBMIT PASS" >> ./STATUS.out + endif + cd $pwd + @ cnt++ +end From 29eaa6b28c1d05a37825ce2b8f4e2b1458675583 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:54:46 -0700 Subject: [PATCH 315/730] Rename file without version --- tools/contrib/{run_clmtowers.v1.csh => run_clmtowers.csh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{run_clmtowers.v1.csh => run_clmtowers.csh} (100%) diff --git a/tools/contrib/run_clmtowers.v1.csh b/tools/contrib/run_clmtowers.csh similarity index 100% rename from tools/contrib/run_clmtowers.v1.csh rename to tools/contrib/run_clmtowers.csh From ca0bf06d3c356431902e3d0c4521dc2ff7f0eafc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 14:55:57 -0700 Subject: [PATCH 316/730] Add note about new script --- tools/contrib/README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/contrib/README b/tools/contrib/README index 30dfcd2da9..1ca45a7203 100755 --- a/tools/contrib/README +++ b/tools/contrib/README @@ -27,5 +27,10 @@ SpinupStability.ncl This script assesses the equilibrium state of a spinup run works on either monthly or annual mean history files - Keith Oleson 7/2016 +run_clmtowers.v1.csh + This script will run any number of flux tower sites. + It's based on having created surface datasets with PTCLM. + v1 - Keith Oleson, 8/2015 + From 58159259a40fdf0c27001d3d82053c5b401729c0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 24 Jan 2019 15:39:47 -0700 Subject: [PATCH 317/730] Remove exec status from README --- tools/contrib/README | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 tools/contrib/README diff --git a/tools/contrib/README b/tools/contrib/README old mode 100755 new mode 100644 From 3aec178e9765d1826f8464e7561eceb80d779e9a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:19:42 -0700 Subject: [PATCH 318/730] Rename file to v6 --- tools/contrib/{SpinupStability.ncl => SpinupStability_v6.nc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{SpinupStability.ncl => SpinupStability_v6.nc} (100%) diff --git a/tools/contrib/SpinupStability.ncl b/tools/contrib/SpinupStability_v6.nc similarity index 100% rename from tools/contrib/SpinupStability.ncl rename to tools/contrib/SpinupStability_v6.nc From 039f919cbc40a4bc44e8fd6cd9ea8b7862d2349a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:20:26 -0700 Subject: [PATCH 319/730] Changes from /gpfs/u/home/oleson/lnd_diag/run/ version that just change some of the settings --- tools/contrib/SpinupStability_v6.nc | 99 +++++------------------------ 1 file changed, 16 insertions(+), 83 deletions(-) diff --git a/tools/contrib/SpinupStability_v6.nc b/tools/contrib/SpinupStability_v6.nc index 08fba17859..11ba974629 100644 --- a/tools/contrib/SpinupStability_v6.nc +++ b/tools/contrib/SpinupStability_v6.nc @@ -29,102 +29,26 @@ begin ; annual_hist flag to "False" if your case has monthly mean history files. ; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist ;=======================================================================; -; caseid = "clm458r177_wwparam_1850spin" -; username = "oleson" -; annual_hist = "False" -; caseid = "respn14r172_wwparam_1850spinACC" -; username = "oleson" -; annual_hist = "False" + caseid = "clm5r221_2deg_calpv9_savetandg_1850ADspin" + username = "oleson" + annual_hist = "False" -; caseid = "respn14r172_1850spin" +; caseid = "clm5r221_2deg_calpv9_savetandg_c3c4_1850ADspin" ; username = "oleson" ; annual_hist = "False" -; caseid = "clm458r177_modRESORB1_wwparam_1850spin" -; username = "wwieder" -; annual_hist = "False" - -; caseid = "respmods_n19_clm4_5_8_r174_4x5_bareground_ADspin_3" -; username = "rfisher" -; annual_hist = "True" - -; caseid = "respn19r174_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respmods_r78397_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respmods_5_4x5_bareground_PADspin_4" -; username = "rfisher" -; annual_hist = "False" - -; caseid = "respmods_r78397crop_1850spin" -; username = "rfisher" -; annual_hist = "False" - -; caseid = "respmods_r78397crop_1850postADspin" -; username = "rfisher" -; annual_hist = "False" - -; caseid = "respn24r174crop_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respn24r174crop_1850PostADspin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respn24r174crop_1850PostADspin2" -; username = "oleson" -; annual_hist = "True" - -; caseid = "b.e15.B1850.f09_g16.pi_control.all.72_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "b.e15.B1850.f09_g16.pi_control.all.72_1850spinn24" -; username = "oleson" -; annual_hist = "False" - -; caseid = "respn27r174crop_2deg_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respn27r174Con_2deg_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respn27r174BenPRootWC_2deg_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "respn27r174BenPRootWCcrop_2deg_1850spin" -; username = "oleson" -; annual_hist = "True" - -; caseid = "i.e15.a06.B1850.f09_g16.21ka_cpl.04" -; username = "tomas" -; annual_hist = "False" - -; caseid = "respmods_n30_clm4_5_8_r182_4x5_bareground_AD_1" -; username = "rfisher" -; annual_hist = "True" - - caseid = "respmods_n30_clm4_5_8_r182_4x5_kattge_hydr_08072016params" - username = "rfisher" - annual_hist = "True" - do_plot = "True" ; do_plot = "False" ;=======================================================================; data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" ; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" +; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/F.e15.cam54_clm45_plio_fire_plio/lnd/hist/" +; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/BGC_final_spinup_plio/lnd/hist/" subper = 20 ; Subsampling period in years +; subper = 30 ; Subsampling period in years ; subper = 5 ; Subsampling period in years ; Thresholds @@ -195,6 +119,7 @@ begin tlai = data[:]->TLAI(year,:,:) gpp = data[:]->GPP(year,:,:) tws = data[:]->TWS(year,:,:) +; fert = data[:]->FERT(year,:,:) else totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) totsomc = month_to_annual(data[:]->TOTSOMC,1) @@ -202,6 +127,7 @@ begin tlai = month_to_annual(data[:]->TLAI,1) gpp = month_to_annual(data[:]->GPP,1) tws = month_to_annual(data[:]->TWS,1) +; fert = month_to_annual(data[:]->FERT,1) end if lat = data[0]->lat nlat = dimsizes(lat) @@ -439,6 +365,13 @@ begin tws_glob_equil@_FillValue = -999 delete(indx) +; FERT +; landareaC = conform_dims(dimsizes(fert),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc +; fert_area = fert*landareaC ; correcting totecosysc for total land area +; fert_pg = fert_area*gtoPg*secinyr ; g to Pg and sec to yrs +; fert_glob = dim_sum_n(fert_pg, (/1,2/)) ; sums over all latitudes +; print(fert_glob) + ;===============================Plotting====================================; if (do_plot .eq. "True") then From 26882f31282306eb21fdba6a6d45427f01f839ba Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:21:25 -0700 Subject: [PATCH 320/730] Change version to v7 --- tools/contrib/SpinupStability_v7.ncl | 600 +++++++++++++++++++++++++++ 1 file changed, 600 insertions(+) create mode 100644 tools/contrib/SpinupStability_v7.ncl diff --git a/tools/contrib/SpinupStability_v7.ncl b/tools/contrib/SpinupStability_v7.ncl new file mode 100644 index 0000000000..11ba974629 --- /dev/null +++ b/tools/contrib/SpinupStability_v7.ncl @@ -0,0 +1,600 @@ +; NCL script +; SpinupStability_v6.ncl +; Script to examine stability of spinup simulation. +; This version operates on either monthly mean or multi-annual mean multi-variable history files +; Keith Oleson, May 2016 + +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" +load "~oleson/lnd_diag/run/contributed.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" + +begin + + print ("=========================================") + print ("Start Time: "+systemfunc("date") ) + print ("=========================================") + +;=======================================================================; +; This script produces a page of plots of various variables that are evaluated +; as to whether they are spunup or not. A summary of variables in equilibrium +; and/or in disequilibrium is also produced to standard out. The postscript output +; is $caseid_spinup.ps in the pwd. +; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS. +; The percentage of land area in TOTECOSYSC disequilibrium is also examined. +; Thresholds are defined below (i.e., global_thresh_*) and can be changed for individual +; variables. +; To run this script, just enter in your case name and username below. +; AND set the annual_hist flag to "True" if your case has annual mean history files or set +; annual_hist flag to "False" if your case has monthly mean history files. +; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist +;=======================================================================; + + caseid = "clm5r221_2deg_calpv9_savetandg_1850ADspin" + username = "oleson" + annual_hist = "False" + +; caseid = "clm5r221_2deg_calpv9_savetandg_c3c4_1850ADspin" +; username = "oleson" +; annual_hist = "False" + + do_plot = "True" +; do_plot = "False" +;=======================================================================; + + data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" +; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" +; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/F.e15.cam54_clm45_plio_fire_plio/lnd/hist/" +; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/BGC_final_spinup_plio/lnd/hist/" + + subper = 20 ; Subsampling period in years +; subper = 30 ; Subsampling period in years +; subper = 5 ; Subsampling period in years + +; Thresholds + glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) + glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) + glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta PgC / yr) + glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) + glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) + glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) + glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr + totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) + + if (annual_hist .eq. "True") then + fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*-*-*"+".nc") + else + fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*"+".nc") + end if + flsdims = dimsizes(fls) + + if (annual_hist .eq. "True") then + lstfile = addfile(fls(flsdims-1),"r") + else + lstfile = addfile(fls(flsdims-12),"r") ;last month (DEC) of any year has mdate for next year + ;so grab JAN of last year + end if + + if (annual_hist .eq. "True") then + lstyrdim = dimsizes(lstfile->mcdate) + mcdate_lst = lstfile->mcdate(lstyrdim-1) + else + mcdate_lst = lstfile->mcdate + end if + lstyr = toint(mcdate_lst)/10000 + + fstfile = addfile(fls(0),"r") + if (annual_hist .eq. "True") then + mcdate_fst = fstfile->mcdate(0) + else + mcdate_fst = fstfile->mcdate + end if + fstyr = toint(mcdate_fst)/10000 + + yearplt = ispan(fstyr,lstyr,subper) + yearpltrev = yearplt(::-1) + year = ispan(fstyr,lstyr,subper) - fstyr + nyrs = dimsizes(year) + yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-1),subper) + +; Build an array of monthly indices + monstr = new(nyrs*12,"integer") + do i = 0,nyrs-1 + monstr(i*12:i*12+11) = ispan(year(i)*12,year(i)*12+11,1) + end do + +; Add the data files together + if (annual_hist .eq. "True") then + data = addfiles(fls, "r") + ListSetType (data, "cat") + else + data = addfiles(fls(monstr), "r") + end if + +; Convert to annual means + if (annual_hist .eq. "True") then + totecosysc = data[:]->TOTECOSYSC(year,:,:) + totsomc = data[:]->TOTSOMC(year,:,:) + totvegc = data[:]->TOTVEGC(year,:,:) + tlai = data[:]->TLAI(year,:,:) + gpp = data[:]->GPP(year,:,:) + tws = data[:]->TWS(year,:,:) +; fert = data[:]->FERT(year,:,:) + else + totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) + totsomc = month_to_annual(data[:]->TOTSOMC,1) + totvegc = month_to_annual(data[:]->TOTVEGC,1) + tlai = month_to_annual(data[:]->TLAI,1) + gpp = month_to_annual(data[:]->GPP,1) + tws = month_to_annual(data[:]->TWS,1) +; fert = month_to_annual(data[:]->FERT,1) + end if + lat = data[0]->lat + nlat = dimsizes(lat) + lon = data[0]->lon + nlon = dimsizes(lon) + landfrac = data[0]->landfrac + area = data[0]->area + aream = area*1.e6 + landarea = landfrac*aream + gtoPg = 1e-15 + secinyr = 60.*60.*24.*365. + +; TOTECOSYSC + landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc + totecosysc_area = totecosysc*landareaC ; correcting totecosysc for total land area + totecosysc_pg = totecosysc_area*gtoPg ; g to Pg + totecosysc_glob = dim_sum_n(totecosysc_pg, (/1,2/)) ; sums over all latitudes + totecosysc_glob!0 = "year" + totecosysc_glob&year = yearplt + totecosysc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totecosysc_glob_del(i) = (totecosysc_glob(i+1) - totecosysc_glob(i))/subper + end do + totecosysc_glob_del!0 = "year" + totecosysc_glob_del&year = yearpltmid + indx = where(abs(totecosysc_glob_del) .lt. glob_thresh_totecosysc,1,0) + if (all(indx .eq. 1)) then + totecosysc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totecosysc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totecosysc_glob_equil = -999 + end if + end if + totecosysc_glob_equil@_FillValue = -999 + delete(indx) + +; Land area not in TOTECOSYSC equilibrium + landarea_noequil = new((/nyrs-1,nlat,nlon/),"float") + do i = 0,nyrs-2 + landarea_noequil(i,:,:) = where((totecosysc(i+1,:,:) - totecosysc(i,:,:))/subper .gt. totecosysc_thresh, landarea, 0.) + end do + perc_landarea_noequil = 100.*(dim_sum_n(landarea_noequil,(/1,2/))/sum(landarea)) + indx = where(abs(perc_landarea_noequil) .lt. glob_thresh_area,1,0) + if (all(indx .eq. 1)) then + perc_landarea_glob_noequil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + perc_landarea_glob_noequil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + perc_landarea_glob_noequil = -999 + end if + end if + perc_landarea_glob_noequil@_FillValue = -999 + delete(indx) + totecosysc_1_map = where(landarea_noequil(nyrs-2,:,:) .ne. 0.,(totecosysc(nyrs-1,:,:)-totecosysc(nyrs-2,:,:))/subper,totecosysc@_FillValue) + totecosysc_1_map!0 = "lat" + totecosysc_1_map&lat = lat + totecosysc_1_map!1 = "lon" + totecosysc_1_map&lon = lon + totecosysc_2_map = where(landarea_noequil(nyrs-3,:,:) .ne. 0.,(totecosysc(nyrs-2,:,:)-totecosysc(nyrs-3,:,:))/subper,totecosysc@_FillValue) + copy_VarCoords(totecosysc_1_map,totecosysc_2_map) + +; TOTSOMC + totsomc_area = totsomc*landareaC ; correcting totsomc for total land area + totsomc_pg = totsomc_area*gtoPg ; g to Pg + totsomc_glob = dim_sum_n(totsomc_pg, (/1,2/)) ; sums over all latitudes + totsomc_glob!0 = "year" + totsomc_glob&year = yearplt + totsomc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totsomc_glob_del(i) = (totsomc_glob(i+1) - totsomc_glob(i))/subper + end do + totsomc_glob_del!0 = "year" + totsomc_glob_del&year = yearpltmid + indx = where(abs(totsomc_glob_del) .lt. glob_thresh_totsomc,1,0) + if (all(indx .eq. 1)) then + totsomc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totsomc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totsomc_glob_equil = -999 + end if + end if + totsomc_glob_equil@_FillValue = -999 + delete(indx) + +; TOTVEGC + totvegc_area = totvegc*landareaC ; correcting totvegc for total land area + totvegc_pg = totvegc_area*gtoPg ; g to Pg + totvegc_glob = dim_sum_n(totvegc_pg, (/1,2/)) ; sums over all latitudes + totvegc_glob!0 = "year" + totvegc_glob&year = yearplt + totvegc_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + totvegc_glob_del(i) = (totvegc_glob(i+1) - totvegc_glob(i))/subper + end do + totvegc_glob_del!0 = "year" + totvegc_glob_del&year = yearpltmid + indx = where(abs(totvegc_glob_del) .lt. glob_thresh_totvegc,1,0) + if (all(indx .eq. 1)) then + totvegc_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + totvegc_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + totvegc_glob_equil = -999 + end if + end if + totvegc_glob_equil@_FillValue = -999 + delete(indx) + +; TLAI + areasum = sum(area*landfrac) + areaL = area*landfrac + landareaL = conform_dims(dimsizes(tlai),areaL,(/1,2/)) ; conforming dimensions of areaL to tlai + tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1,2/)) ; weighted global tlai + tlai_glob!0 = "year" + tlai_glob&year = yearplt + tlai_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + tlai_glob_del(i) = (tlai_glob(i+1) - tlai_glob(i))/subper + end do + tlai_glob_del!0 = "year" + tlai_glob_del&year = yearpltmid + indx = where(abs(tlai_glob_del) .lt. glob_thresh_tlai,1,0) + if (all(indx .eq. 1)) then + tlai_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + tlai_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + tlai_glob_equil = -999 + end if + end if + tlai_glob_equil@_FillValue = -999 + delete(indx) + +; GPP + gpp_area = gpp*landareaC ; correcting gpp for total land area + gpp_pg = gpp_area*gtoPg*secinyr ; g to Pg and sec to yrs + gpp_glob = dim_sum_n(gpp_pg, (/1,2/)) ; sums over all latitudes + gpp_glob!0 = "year" + gpp_glob&year = yearplt + gpp_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + gpp_glob_del(i) = (gpp_glob(i+1) - gpp_glob(i))/subper + end do + gpp_glob_del!0 = "year" + gpp_glob_del&year = yearpltmid + indx = where(abs(gpp_glob_del) .lt. glob_thresh_gpp,1,0) + if (all(indx .eq. 1)) then + gpp_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + gpp_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + gpp_glob_equil = -999 + end if + end if + gpp_glob_equil@_FillValue = -999 + delete(indx) + +; TWS + tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) + tws_glob!0 = "year" + tws_glob&year = yearplt + tws_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + tws_glob_del(i) = (tws_glob(i+1) - tws_glob(i))/subper + end do + tws_glob_del!0 = "year" + tws_glob_del&year = yearpltmid + indx = where(abs(tws_glob_del) .lt. glob_thresh_tws,1,0) + if (all(indx .eq. 1)) then + tws_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + tws_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + tws_glob_equil = -999 + end if + end if + tws_glob_equil@_FillValue = -999 + delete(indx) + +; FERT +; landareaC = conform_dims(dimsizes(fert),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc +; fert_area = fert*landareaC ; correcting totecosysc for total land area +; fert_pg = fert_area*gtoPg*secinyr ; g to Pg and sec to yrs +; fert_glob = dim_sum_n(fert_pg, (/1,2/)) ; sums over all latitudes +; print(fert_glob) + +;===============================Plotting====================================; + if (do_plot .eq. "True") then + +; wks_type = "png" +; wks_type@wkWidth = 2500 +; wks_type@wkHeight = 2500 +; wks_type = "x11" + wks_type = "ps" +; wks_type = "pdf" + wks = gsn_open_wks (wks_type, caseid+"_Spinup") + gsn_define_colormap(wks, "ViBlGrWhYeOrRe") + + plot = new(13,"graphic") + + resP = True +; resP@gsnMaximize = True + resP@gsnPaperOrientation = "portrait" + resP@gsnFrame = False + resP@gsnDraw = True + resP@txString = caseid + " Annual Mean " + resP@gsnPanelXWhiteSpacePercent = 2. + resP@gsnPanelCenter = False +; resP@gsnPanelDebug = True + + res = True + res@gsnFrame = False + res@gsnDraw = False + res@xyLineThicknessF = 2 + + polyres1 = True + polyres1@gsLineDashPattern = 16 + polyres2 = True + polyres2@gsLineDashPattern = 2 + + res@tiXAxisString = " " + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTECOSYSC" + plot(0) = gsn_csm_xy(wks,yearplt,totecosysc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTECOSYSC " + "EqYr: "+totecosysc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(1) = gsn_csm_xy(wks,yearpltmid,totecosysc_glob_del,res) + prim1 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim2 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totecosysc,-glob_thresh_totecosysc/),polyres2) + prim3 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totecosysc,glob_thresh_totecosysc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTSOMC" + plot(2) = gsn_csm_xy(wks,yearplt,totsomc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTSOMC " + "EqYr: "+totsomc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(3) = gsn_csm_xy(wks,yearpltmid,totsomc_glob_del,res) + prim4 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim5 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totsomc,-glob_thresh_totsomc/),polyres2) + prim6 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totsomc,glob_thresh_totsomc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C" + res@tiMainString = "TOTVEGC" + plot(4) = gsn_csm_xy(wks,yearplt,totvegc_glob,res) + + res@tiYAxisString = "Pg C" + res@tiMainString = "Delta TOTVEGC " + "EqYr: "+totvegc_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(5) = gsn_csm_xy(wks,yearpltmid,totvegc_glob_del,res) + prim7 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim8 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totvegc,-glob_thresh_totvegc/),polyres2) + prim9 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totvegc,glob_thresh_totvegc/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" + res@tiMainString = "TLAI" + plot(6) = gsn_csm_xy(wks,yearplt,tlai_glob,res) + + res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" + res@tiMainString = "Delta TLAI " + "EqYr: "+tlai_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(7) = gsn_csm_xy(wks,yearpltmid,tlai_glob_del,res) + prim10 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim11 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tlai,-glob_thresh_tlai/),polyres2) + prim12 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tlai,glob_thresh_tlai/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiMainString = "GPP" + plot(8) = gsn_csm_xy(wks,yearplt,gpp_glob,res) + + res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiXAxisString = "Spinup Year" + res@tiMainString = "Delta GPP " + "EqYr: "+gpp_glob_equil + res@trYMaxF = 0.2 + res@trYMinF = -0.2 + plot(9) = gsn_csm_xy(wks,yearpltmid,gpp_glob_del,res) + prim13 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim14 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_gpp,-glob_thresh_gpp/),polyres2) + prim15 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_gpp,glob_thresh_gpp/),polyres2) + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "m" + res@tiMainString = "TWS" + plot(10) = gsn_csm_xy(wks,yearplt,tws_glob,res) + + res@tiYAxisString = "m" + res@tiMainString = "Delta TWS " + "EqYr: "+tws_glob_equil + res@trYMaxF = 0.05 + res@trYMinF = -0.05 + plot(11) = gsn_csm_xy(wks,yearpltmid,tws_glob_del,res) + prim16 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim17 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tws,-glob_thresh_tws/),polyres2) + prim18 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tws,glob_thresh_tws/),polyres2) + + res@tiYAxisString = "%" + res@tiMainString = "% Land Area in TOTECOSYSC Disequil " + "EqYr: "+perc_landarea_glob_noequil + res@trYMaxF = 80.0 + res@trYMinF = 0.0 + plot(12) = gsn_csm_xy(wks,yearpltmid,perc_landarea_noequil,res) + prim19 = gsn_add_polyline(wks,plot(12),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_area,glob_thresh_area/),polyres2) + + gsn_panel(wks,plot,(/4,4/),resP) + + delete(plot) + resc = True ; turn on plotting options + resc@gsnSpreadColors = True ; spans all colors in colormap + resc@cnFillMode = "RasterFill" ; raster mode + resc@cnFillOn = True ; turn on color fill + resc@cnLinesOn = False ; turn off contour lines + resc@cnLineLabelsOn = False ; turn off contour line labels + resc@cnLevelSelectionMode = "ExplicitLevels" + resc@mpProjection = "robinson" ; Robinson grid projection + resc@gsnDraw = True + resc@gsnFrame = False + resc@lbAutoManage = False + resc@lbLabelFontHeightF = 0.010 + resc@txFontHeightF = 0.008 + resc@cnLevels = (/-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0/) + resc@gsnLeftString = "gC m~S~-2~N~" + resc@gsnRightString = "" + + resc@vpXF = 0.30 ; position and sizes + resc@vpYF = 0.28 ; for XY plot + resc@vpWidthF = 0.30 + resc@vpHeightF = 0.30 + resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-1) + " - " + yearplt(nyrs-2) + plot = gsn_csm_contour_map(wks,totecosysc_1_map,resc) + + resc@vpXF = 0.65 ; position and sizes + resc@vpYF = 0.28 ; for XY plot + resc@vpWidthF = 0.30 + resc@vpHeightF = 0.30 + resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-2) + " - " + yearplt(nyrs-3) + plot = gsn_csm_contour_map(wks,totecosysc_2_map,resc) + + frame(wks) + + end if ; end do_plot + +; Equilibrium summary + print((/"======================================================================="/)) + print((/"======================================================================="/)) + print((/"EQUILIBRIUM SUMMARY"/)) + print((/"======================================================================="/)) + if (.not.(ismissing(totecosysc_glob_equil))) then + print((/"TOTECOSYSC is in equilibrium. Eq. Yr. = "+totecosysc_glob_equil/)) + else + print((/"FATAL: TOTECOSYSC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(totsomc_glob_equil))) then + print((/"TOTSOMC is in equilibrium. Eq. Yr. = "+totsomc_glob_equil/)) + else + print((/"FATAL: TOTSOMC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(totvegc_glob_equil))) then + print((/"TOTVEGC is in equilibrium. Eq. Yr. = "+totvegc_glob_equil/)) + else + print((/"FATAL: TOTVEGC is NOT in equilibrium"/)) + end if + if (.not.(ismissing(tlai_glob_equil))) then + print((/"TLAI is in equilibrium. Eq. Yr. = "+tlai_glob_equil/)) + else + print((/"FATAL: TLAI is NOT in equilibrium"/)) + end if + if (.not.(ismissing(gpp_glob_equil))) then + print((/"GPP is in equilibrium. Eq. Yr. = "+gpp_glob_equil/)) + else + print((/"FATAL: GPP is NOT in equilibrium"/)) + end if + if (.not.(ismissing(tws_glob_equil))) then + print((/"TWS is in equilibrium. Eq. Yr. = "+tws_glob_equil/)) + else + print((/"WARNING: TWS is NOT in equilibrium"/)) + end if + if (.not.(ismissing(perc_landarea_glob_noequil))) then + print((/"At least "+(100.-glob_thresh_area)+" percent of the land surface is in TOTECOSYSC equilibrium. Eq. Yr. = "+perc_landarea_glob_noequil/)) + else + print((/"FATAL: Not enough of the land surface is in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% > "+sprintf("%6.2f",glob_thresh_area)+"%)"/)) + end if + if (.not.(ismissing(totecosysc_glob_equil)) .and. \ + .not.(ismissing(totsomc_glob_equil)) .and. \ + .not.(ismissing(totvegc_glob_equil)) .and. \ + .not.(ismissing(tlai_glob_equil)) .and. \ + .not.(ismissing(gpp_glob_equil)) .and. \ + .not.(ismissing(perc_landarea_glob_noequil))) then + print((/"Congratulations! Your simulation is in equilibrium"/)) + else + print((/"FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again"/)) + end if + print((/"======================================================================="/)) + + print ("=========================================") + print ("Finish Time: "+systemfunc("date") ) + print ("=========================================") + +end From c53e60dde169eb967a4648d292b98e41016599ae Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:23:12 -0700 Subject: [PATCH 321/730] Rename to v7 --- tools/contrib/SpinupStability_v6.nc | 600 ---------------------------- 1 file changed, 600 deletions(-) delete mode 100644 tools/contrib/SpinupStability_v6.nc diff --git a/tools/contrib/SpinupStability_v6.nc b/tools/contrib/SpinupStability_v6.nc deleted file mode 100644 index 11ba974629..0000000000 --- a/tools/contrib/SpinupStability_v6.nc +++ /dev/null @@ -1,600 +0,0 @@ -; NCL script -; SpinupStability_v6.ncl -; Script to examine stability of spinup simulation. -; This version operates on either monthly mean or multi-annual mean multi-variable history files -; Keith Oleson, May 2016 - -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "~oleson/lnd_diag/run/contributed.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" - -begin - - print ("=========================================") - print ("Start Time: "+systemfunc("date") ) - print ("=========================================") - -;=======================================================================; -; This script produces a page of plots of various variables that are evaluated -; as to whether they are spunup or not. A summary of variables in equilibrium -; and/or in disequilibrium is also produced to standard out. The postscript output -; is $caseid_spinup.ps in the pwd. -; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS. -; The percentage of land area in TOTECOSYSC disequilibrium is also examined. -; Thresholds are defined below (i.e., global_thresh_*) and can be changed for individual -; variables. -; To run this script, just enter in your case name and username below. -; AND set the annual_hist flag to "True" if your case has annual mean history files or set -; annual_hist flag to "False" if your case has monthly mean history files. -; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist -;=======================================================================; - - caseid = "clm5r221_2deg_calpv9_savetandg_1850ADspin" - username = "oleson" - annual_hist = "False" - -; caseid = "clm5r221_2deg_calpv9_savetandg_c3c4_1850ADspin" -; username = "oleson" -; annual_hist = "False" - - do_plot = "True" -; do_plot = "False" -;=======================================================================; - - data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" -; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" -; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/F.e15.cam54_clm45_plio_fire_plio/lnd/hist/" -; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/BGC_final_spinup_plio/lnd/hist/" - - subper = 20 ; Subsampling period in years -; subper = 30 ; Subsampling period in years -; subper = 5 ; Subsampling period in years - -; Thresholds - glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) - glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) - glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta PgC / yr) - glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) - glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) - glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) - glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr - totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) - - if (annual_hist .eq. "True") then - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*-*-*"+".nc") - else - fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*"+".nc") - end if - flsdims = dimsizes(fls) - - if (annual_hist .eq. "True") then - lstfile = addfile(fls(flsdims-1),"r") - else - lstfile = addfile(fls(flsdims-12),"r") ;last month (DEC) of any year has mdate for next year - ;so grab JAN of last year - end if - - if (annual_hist .eq. "True") then - lstyrdim = dimsizes(lstfile->mcdate) - mcdate_lst = lstfile->mcdate(lstyrdim-1) - else - mcdate_lst = lstfile->mcdate - end if - lstyr = toint(mcdate_lst)/10000 - - fstfile = addfile(fls(0),"r") - if (annual_hist .eq. "True") then - mcdate_fst = fstfile->mcdate(0) - else - mcdate_fst = fstfile->mcdate - end if - fstyr = toint(mcdate_fst)/10000 - - yearplt = ispan(fstyr,lstyr,subper) - yearpltrev = yearplt(::-1) - year = ispan(fstyr,lstyr,subper) - fstyr - nyrs = dimsizes(year) - yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-1),subper) - -; Build an array of monthly indices - monstr = new(nyrs*12,"integer") - do i = 0,nyrs-1 - monstr(i*12:i*12+11) = ispan(year(i)*12,year(i)*12+11,1) - end do - -; Add the data files together - if (annual_hist .eq. "True") then - data = addfiles(fls, "r") - ListSetType (data, "cat") - else - data = addfiles(fls(monstr), "r") - end if - -; Convert to annual means - if (annual_hist .eq. "True") then - totecosysc = data[:]->TOTECOSYSC(year,:,:) - totsomc = data[:]->TOTSOMC(year,:,:) - totvegc = data[:]->TOTVEGC(year,:,:) - tlai = data[:]->TLAI(year,:,:) - gpp = data[:]->GPP(year,:,:) - tws = data[:]->TWS(year,:,:) -; fert = data[:]->FERT(year,:,:) - else - totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) - totsomc = month_to_annual(data[:]->TOTSOMC,1) - totvegc = month_to_annual(data[:]->TOTVEGC,1) - tlai = month_to_annual(data[:]->TLAI,1) - gpp = month_to_annual(data[:]->GPP,1) - tws = month_to_annual(data[:]->TWS,1) -; fert = month_to_annual(data[:]->FERT,1) - end if - lat = data[0]->lat - nlat = dimsizes(lat) - lon = data[0]->lon - nlon = dimsizes(lon) - landfrac = data[0]->landfrac - area = data[0]->area - aream = area*1.e6 - landarea = landfrac*aream - gtoPg = 1e-15 - secinyr = 60.*60.*24.*365. - -; TOTECOSYSC - landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc - totecosysc_area = totecosysc*landareaC ; correcting totecosysc for total land area - totecosysc_pg = totecosysc_area*gtoPg ; g to Pg - totecosysc_glob = dim_sum_n(totecosysc_pg, (/1,2/)) ; sums over all latitudes - totecosysc_glob!0 = "year" - totecosysc_glob&year = yearplt - totecosysc_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - totecosysc_glob_del(i) = (totecosysc_glob(i+1) - totecosysc_glob(i))/subper - end do - totecosysc_glob_del!0 = "year" - totecosysc_glob_del&year = yearpltmid - indx = where(abs(totecosysc_glob_del) .lt. glob_thresh_totecosysc,1,0) - if (all(indx .eq. 1)) then - totecosysc_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - totecosysc_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - totecosysc_glob_equil = -999 - end if - end if - totecosysc_glob_equil@_FillValue = -999 - delete(indx) - -; Land area not in TOTECOSYSC equilibrium - landarea_noequil = new((/nyrs-1,nlat,nlon/),"float") - do i = 0,nyrs-2 - landarea_noequil(i,:,:) = where((totecosysc(i+1,:,:) - totecosysc(i,:,:))/subper .gt. totecosysc_thresh, landarea, 0.) - end do - perc_landarea_noequil = 100.*(dim_sum_n(landarea_noequil,(/1,2/))/sum(landarea)) - indx = where(abs(perc_landarea_noequil) .lt. glob_thresh_area,1,0) - if (all(indx .eq. 1)) then - perc_landarea_glob_noequil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - perc_landarea_glob_noequil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - perc_landarea_glob_noequil = -999 - end if - end if - perc_landarea_glob_noequil@_FillValue = -999 - delete(indx) - totecosysc_1_map = where(landarea_noequil(nyrs-2,:,:) .ne. 0.,(totecosysc(nyrs-1,:,:)-totecosysc(nyrs-2,:,:))/subper,totecosysc@_FillValue) - totecosysc_1_map!0 = "lat" - totecosysc_1_map&lat = lat - totecosysc_1_map!1 = "lon" - totecosysc_1_map&lon = lon - totecosysc_2_map = where(landarea_noequil(nyrs-3,:,:) .ne. 0.,(totecosysc(nyrs-2,:,:)-totecosysc(nyrs-3,:,:))/subper,totecosysc@_FillValue) - copy_VarCoords(totecosysc_1_map,totecosysc_2_map) - -; TOTSOMC - totsomc_area = totsomc*landareaC ; correcting totsomc for total land area - totsomc_pg = totsomc_area*gtoPg ; g to Pg - totsomc_glob = dim_sum_n(totsomc_pg, (/1,2/)) ; sums over all latitudes - totsomc_glob!0 = "year" - totsomc_glob&year = yearplt - totsomc_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - totsomc_glob_del(i) = (totsomc_glob(i+1) - totsomc_glob(i))/subper - end do - totsomc_glob_del!0 = "year" - totsomc_glob_del&year = yearpltmid - indx = where(abs(totsomc_glob_del) .lt. glob_thresh_totsomc,1,0) - if (all(indx .eq. 1)) then - totsomc_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - totsomc_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - totsomc_glob_equil = -999 - end if - end if - totsomc_glob_equil@_FillValue = -999 - delete(indx) - -; TOTVEGC - totvegc_area = totvegc*landareaC ; correcting totvegc for total land area - totvegc_pg = totvegc_area*gtoPg ; g to Pg - totvegc_glob = dim_sum_n(totvegc_pg, (/1,2/)) ; sums over all latitudes - totvegc_glob!0 = "year" - totvegc_glob&year = yearplt - totvegc_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - totvegc_glob_del(i) = (totvegc_glob(i+1) - totvegc_glob(i))/subper - end do - totvegc_glob_del!0 = "year" - totvegc_glob_del&year = yearpltmid - indx = where(abs(totvegc_glob_del) .lt. glob_thresh_totvegc,1,0) - if (all(indx .eq. 1)) then - totvegc_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - totvegc_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - totvegc_glob_equil = -999 - end if - end if - totvegc_glob_equil@_FillValue = -999 - delete(indx) - -; TLAI - areasum = sum(area*landfrac) - areaL = area*landfrac - landareaL = conform_dims(dimsizes(tlai),areaL,(/1,2/)) ; conforming dimensions of areaL to tlai - tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1,2/)) ; weighted global tlai - tlai_glob!0 = "year" - tlai_glob&year = yearplt - tlai_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - tlai_glob_del(i) = (tlai_glob(i+1) - tlai_glob(i))/subper - end do - tlai_glob_del!0 = "year" - tlai_glob_del&year = yearpltmid - indx = where(abs(tlai_glob_del) .lt. glob_thresh_tlai,1,0) - if (all(indx .eq. 1)) then - tlai_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - tlai_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - tlai_glob_equil = -999 - end if - end if - tlai_glob_equil@_FillValue = -999 - delete(indx) - -; GPP - gpp_area = gpp*landareaC ; correcting gpp for total land area - gpp_pg = gpp_area*gtoPg*secinyr ; g to Pg and sec to yrs - gpp_glob = dim_sum_n(gpp_pg, (/1,2/)) ; sums over all latitudes - gpp_glob!0 = "year" - gpp_glob&year = yearplt - gpp_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - gpp_glob_del(i) = (gpp_glob(i+1) - gpp_glob(i))/subper - end do - gpp_glob_del!0 = "year" - gpp_glob_del&year = yearpltmid - indx = where(abs(gpp_glob_del) .lt. glob_thresh_gpp,1,0) - if (all(indx .eq. 1)) then - gpp_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - gpp_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - gpp_glob_equil = -999 - end if - end if - gpp_glob_equil@_FillValue = -999 - delete(indx) - -; TWS - tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) - tws_glob!0 = "year" - tws_glob&year = yearplt - tws_glob_del = new(nyrs-1,"float") - do i = 0,nyrs-2 - tws_glob_del(i) = (tws_glob(i+1) - tws_glob(i))/subper - end do - tws_glob_del!0 = "year" - tws_glob_del&year = yearpltmid - indx = where(abs(tws_glob_del) .lt. glob_thresh_tws,1,0) - if (all(indx .eq. 1)) then - tws_glob_equil = yearplt(0) - else - if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then - indxrev = indx(::-1) - do i = 0,dimsizes(indxrev)-1 - if (indxrev(i) .eq. 0) then - tws_glob_equil = yearpltrev(i-1) - break - end if - end do - delete(indxrev) - else - tws_glob_equil = -999 - end if - end if - tws_glob_equil@_FillValue = -999 - delete(indx) - -; FERT -; landareaC = conform_dims(dimsizes(fert),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc -; fert_area = fert*landareaC ; correcting totecosysc for total land area -; fert_pg = fert_area*gtoPg*secinyr ; g to Pg and sec to yrs -; fert_glob = dim_sum_n(fert_pg, (/1,2/)) ; sums over all latitudes -; print(fert_glob) - -;===============================Plotting====================================; - if (do_plot .eq. "True") then - -; wks_type = "png" -; wks_type@wkWidth = 2500 -; wks_type@wkHeight = 2500 -; wks_type = "x11" - wks_type = "ps" -; wks_type = "pdf" - wks = gsn_open_wks (wks_type, caseid+"_Spinup") - gsn_define_colormap(wks, "ViBlGrWhYeOrRe") - - plot = new(13,"graphic") - - resP = True -; resP@gsnMaximize = True - resP@gsnPaperOrientation = "portrait" - resP@gsnFrame = False - resP@gsnDraw = True - resP@txString = caseid + " Annual Mean " - resP@gsnPanelXWhiteSpacePercent = 2. - resP@gsnPanelCenter = False -; resP@gsnPanelDebug = True - - res = True - res@gsnFrame = False - res@gsnDraw = False - res@xyLineThicknessF = 2 - - polyres1 = True - polyres1@gsLineDashPattern = 16 - polyres2 = True - polyres2@gsLineDashPattern = 2 - - res@tiXAxisString = " " - res@tiYAxisString = "Pg C" - res@tiMainString = "TOTECOSYSC" - plot(0) = gsn_csm_xy(wks,yearplt,totecosysc_glob,res) - - res@tiYAxisString = "Pg C" - res@tiMainString = "Delta TOTECOSYSC " + "EqYr: "+totecosysc_glob_equil - res@trYMaxF = 0.2 - res@trYMinF = -0.2 - plot(1) = gsn_csm_xy(wks,yearpltmid,totecosysc_glob_del,res) - prim1 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim2 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totecosysc,-glob_thresh_totecosysc/),polyres2) - prim3 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totecosysc,glob_thresh_totecosysc/),polyres2) - - delete(res@trYMaxF) - delete(res@trYMinF) - res@tiYAxisString = "Pg C" - res@tiMainString = "TOTSOMC" - plot(2) = gsn_csm_xy(wks,yearplt,totsomc_glob,res) - - res@tiYAxisString = "Pg C" - res@tiMainString = "Delta TOTSOMC " + "EqYr: "+totsomc_glob_equil - res@trYMaxF = 0.2 - res@trYMinF = -0.2 - plot(3) = gsn_csm_xy(wks,yearpltmid,totsomc_glob_del,res) - prim4 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim5 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totsomc,-glob_thresh_totsomc/),polyres2) - prim6 = gsn_add_polyline(wks,plot(3),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totsomc,glob_thresh_totsomc/),polyres2) - - delete(res@trYMaxF) - delete(res@trYMinF) - res@tiYAxisString = "Pg C" - res@tiMainString = "TOTVEGC" - plot(4) = gsn_csm_xy(wks,yearplt,totvegc_glob,res) - - res@tiYAxisString = "Pg C" - res@tiMainString = "Delta TOTVEGC " + "EqYr: "+totvegc_glob_equil - res@trYMaxF = 0.2 - res@trYMinF = -0.2 - plot(5) = gsn_csm_xy(wks,yearpltmid,totvegc_glob_del,res) - prim7 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim8 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_totvegc,-glob_thresh_totvegc/),polyres2) - prim9 = gsn_add_polyline(wks,plot(5),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_totvegc,glob_thresh_totvegc/),polyres2) - - delete(res@trYMaxF) - delete(res@trYMinF) - res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" - res@tiMainString = "TLAI" - plot(6) = gsn_csm_xy(wks,yearplt,tlai_glob,res) - - res@tiYAxisString = "m ~S~2~N~ m~S~-2~N~" - res@tiMainString = "Delta TLAI " + "EqYr: "+tlai_glob_equil - res@trYMaxF = 0.2 - res@trYMinF = -0.2 - plot(7) = gsn_csm_xy(wks,yearpltmid,tlai_glob_del,res) - prim10 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim11 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tlai,-glob_thresh_tlai/),polyres2) - prim12 = gsn_add_polyline(wks,plot(7),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tlai,glob_thresh_tlai/),polyres2) - - delete(res@trYMaxF) - delete(res@trYMinF) - res@tiYAxisString = "Pg C yr~S~-1~N~" - res@tiMainString = "GPP" - plot(8) = gsn_csm_xy(wks,yearplt,gpp_glob,res) - - res@tiYAxisString = "Pg C yr~S~-1~N~" - res@tiXAxisString = "Spinup Year" - res@tiMainString = "Delta GPP " + "EqYr: "+gpp_glob_equil - res@trYMaxF = 0.2 - res@trYMinF = -0.2 - plot(9) = gsn_csm_xy(wks,yearpltmid,gpp_glob_del,res) - prim13 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim14 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_gpp,-glob_thresh_gpp/),polyres2) - prim15 = gsn_add_polyline(wks,plot(9),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_gpp,glob_thresh_gpp/),polyres2) - - delete(res@trYMaxF) - delete(res@trYMinF) - res@tiYAxisString = "m" - res@tiMainString = "TWS" - plot(10) = gsn_csm_xy(wks,yearplt,tws_glob,res) - - res@tiYAxisString = "m" - res@tiMainString = "Delta TWS " + "EqYr: "+tws_glob_equil - res@trYMaxF = 0.05 - res@trYMinF = -0.05 - plot(11) = gsn_csm_xy(wks,yearpltmid,tws_glob_del,res) - prim16 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) - prim17 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tws,-glob_thresh_tws/),polyres2) - prim18 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tws,glob_thresh_tws/),polyres2) - - res@tiYAxisString = "%" - res@tiMainString = "% Land Area in TOTECOSYSC Disequil " + "EqYr: "+perc_landarea_glob_noequil - res@trYMaxF = 80.0 - res@trYMinF = 0.0 - plot(12) = gsn_csm_xy(wks,yearpltmid,perc_landarea_noequil,res) - prim19 = gsn_add_polyline(wks,plot(12),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_area,glob_thresh_area/),polyres2) - - gsn_panel(wks,plot,(/4,4/),resP) - - delete(plot) - resc = True ; turn on plotting options - resc@gsnSpreadColors = True ; spans all colors in colormap - resc@cnFillMode = "RasterFill" ; raster mode - resc@cnFillOn = True ; turn on color fill - resc@cnLinesOn = False ; turn off contour lines - resc@cnLineLabelsOn = False ; turn off contour line labels - resc@cnLevelSelectionMode = "ExplicitLevels" - resc@mpProjection = "robinson" ; Robinson grid projection - resc@gsnDraw = True - resc@gsnFrame = False - resc@lbAutoManage = False - resc@lbLabelFontHeightF = 0.010 - resc@txFontHeightF = 0.008 - resc@cnLevels = (/-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0/) - resc@gsnLeftString = "gC m~S~-2~N~" - resc@gsnRightString = "" - - resc@vpXF = 0.30 ; position and sizes - resc@vpYF = 0.28 ; for XY plot - resc@vpWidthF = 0.30 - resc@vpHeightF = 0.30 - resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-1) + " - " + yearplt(nyrs-2) - plot = gsn_csm_contour_map(wks,totecosysc_1_map,resc) - - resc@vpXF = 0.65 ; position and sizes - resc@vpYF = 0.28 ; for XY plot - resc@vpWidthF = 0.30 - resc@vpHeightF = 0.30 - resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-2) + " - " + yearplt(nyrs-3) - plot = gsn_csm_contour_map(wks,totecosysc_2_map,resc) - - frame(wks) - - end if ; end do_plot - -; Equilibrium summary - print((/"======================================================================="/)) - print((/"======================================================================="/)) - print((/"EQUILIBRIUM SUMMARY"/)) - print((/"======================================================================="/)) - if (.not.(ismissing(totecosysc_glob_equil))) then - print((/"TOTECOSYSC is in equilibrium. Eq. Yr. = "+totecosysc_glob_equil/)) - else - print((/"FATAL: TOTECOSYSC is NOT in equilibrium"/)) - end if - if (.not.(ismissing(totsomc_glob_equil))) then - print((/"TOTSOMC is in equilibrium. Eq. Yr. = "+totsomc_glob_equil/)) - else - print((/"FATAL: TOTSOMC is NOT in equilibrium"/)) - end if - if (.not.(ismissing(totvegc_glob_equil))) then - print((/"TOTVEGC is in equilibrium. Eq. Yr. = "+totvegc_glob_equil/)) - else - print((/"FATAL: TOTVEGC is NOT in equilibrium"/)) - end if - if (.not.(ismissing(tlai_glob_equil))) then - print((/"TLAI is in equilibrium. Eq. Yr. = "+tlai_glob_equil/)) - else - print((/"FATAL: TLAI is NOT in equilibrium"/)) - end if - if (.not.(ismissing(gpp_glob_equil))) then - print((/"GPP is in equilibrium. Eq. Yr. = "+gpp_glob_equil/)) - else - print((/"FATAL: GPP is NOT in equilibrium"/)) - end if - if (.not.(ismissing(tws_glob_equil))) then - print((/"TWS is in equilibrium. Eq. Yr. = "+tws_glob_equil/)) - else - print((/"WARNING: TWS is NOT in equilibrium"/)) - end if - if (.not.(ismissing(perc_landarea_glob_noequil))) then - print((/"At least "+(100.-glob_thresh_area)+" percent of the land surface is in TOTECOSYSC equilibrium. Eq. Yr. = "+perc_landarea_glob_noequil/)) - else - print((/"FATAL: Not enough of the land surface is in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% > "+sprintf("%6.2f",glob_thresh_area)+"%)"/)) - end if - if (.not.(ismissing(totecosysc_glob_equil)) .and. \ - .not.(ismissing(totsomc_glob_equil)) .and. \ - .not.(ismissing(totvegc_glob_equil)) .and. \ - .not.(ismissing(tlai_glob_equil)) .and. \ - .not.(ismissing(gpp_glob_equil)) .and. \ - .not.(ismissing(perc_landarea_glob_noequil))) then - print((/"Congratulations! Your simulation is in equilibrium"/)) - else - print((/"FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again"/)) - end if - print((/"======================================================================="/)) - - print ("=========================================") - print ("Finish Time: "+systemfunc("date") ) - print ("=========================================") - -end From 31c4b34d395d7aa9e5023b009c3afd721b2e4db6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:24:48 -0700 Subject: [PATCH 322/730] Add some more plottings options and different settings from @olyson /gpfs/u/home/oleson/lnd_diag/run/ --- tools/contrib/SpinupStability_v7.ncl | 445 ++++++++++++++++++++++++++- 1 file changed, 432 insertions(+), 13 deletions(-) diff --git a/tools/contrib/SpinupStability_v7.ncl b/tools/contrib/SpinupStability_v7.ncl index 11ba974629..c30da114d4 100644 --- a/tools/contrib/SpinupStability_v7.ncl +++ b/tools/contrib/SpinupStability_v7.ncl @@ -1,5 +1,5 @@ ; NCL script -; SpinupStability_v6.ncl +; SpinupStability_v7.ncl ; Script to examine stability of spinup simulation. ; This version operates on either monthly mean or multi-annual mean multi-variable history files ; Keith Oleson, May 2016 @@ -20,7 +20,7 @@ begin ; as to whether they are spunup or not. A summary of variables in equilibrium ; and/or in disequilibrium is also produced to standard out. The postscript output ; is $caseid_spinup.ps in the pwd. -; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS. +; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS,H2OSNO. ; The percentage of land area in TOTECOSYSC disequilibrium is also examined. ; Thresholds are defined below (i.e., global_thresh_*) and can be changed for individual ; variables. @@ -30,27 +30,332 @@ begin ; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist ;=======================================================================; - caseid = "clm5r221_2deg_calpv9_savetandg_1850ADspin" - username = "oleson" - annual_hist = "False" +; FINAL CLM4/4.5 SIMULATIONS + +; caseid = "clm40_n26r233_1deg_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm40_n26r233_1deg_GSWP3V2_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm40_r243_1deg_GSWP3V2_CMIP6_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm40_r243_1deg_CRUNCEPV7_CMIP6_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm45_n26r233_1deg_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm45_n26r233_1deg_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm45_r243_1deg_GSWP3V2_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm45_r243_1deg_GSWP3V2_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; PRELIMINARY CLM5.0 SIMULATIONS + +; caseid = "clm50_r243_1deg_CRUNCEPV7_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r243_1deg_CRUNCEPV7_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r243_1deg_CRUNCEPV7_sc_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r243_1deg_GSWP3V2_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r243_1deg_GSWP3V2_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r243_1deg_GSWP3V2_sc_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r243_1deg_GSWP3V2_stemleaf_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r256_1deg_GSWP3V1_stemleaf_ncosts_psi50_BLDTT_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r243_1deg_GSWP3V2_sc_emergeV2C_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; FINAL CLM5.0 SIMULATIONS + +; caseid = "clm50_r265_1deg_GSWP3V1_cs_1700" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r265_1deg_GSWP3V1_400i_ccrit_1700pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r265_1deg_GSWP3V1_iso_1850" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r265_1deg_GSWP3V1_iso_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r265_1deg_GSWP3V1_iso_400i_ccrit_1850pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_1850pAD" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_ch_1850pAD" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r268_1deg_WATCH_iso_1850" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r268_1deg_WATCH_iso_1850pAD" +; username = "oleson" +; annual_hist = "True" + +; caseid = "clm50_r268_1deg_WATCH_iso_ch_1850pAD" +; username = "oleson" +; annual_hist = "True" + +; MISC SIMULATIONS + +; caseid = "clm5_nbug_test_case" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_case" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_test_casepAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_casepAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm50_CRUNCEP_1800_postAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_case" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_casepAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_case460pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_case660pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_caselat100" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_caselat25" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_caselat100pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "clm5_nbug_control_equil_ntasks3_caselat25pAD" +; username = "oleson" +; annual_hist = "False" + +; caseid = "cesm20exp10j_1deg_CPLHST_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 21 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 21 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 21 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_nndep_iAD_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 21 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 21 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_GSWP3init_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 1 ; Subsampling period in years + +; caseid = "cesm20exp10j_1deg_CPLHST_GSWP3init_pdco2_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Global" +; subper = 1 ; Subsampling period in years + +; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1ss_ddp10_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1ss_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1ss_1850AD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1_1850pAD" +; username = "oleson" +; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years -; caseid = "clm5r221_2deg_calpv9_savetandg_c3c4_1850ADspin" +; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1_1850pAD" ; username = "oleson" ; annual_hist = "False" +; cplot = "Arctic" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_cesm201R_1deg_GSWP3V1_phsoff_1850AD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_cesm201R_1deg_GSWP3V1_phsoff_1850pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_1850pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_f_1850pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_1700pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850AD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + +; caseid = "clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850pAD" +; username = "oleson" +; annual_hist = "True" +; cplot = "Global" +; subper = 20 ; Subsampling period in years + + caseid = "i.e21.B1850.f09_g17.PMIP4-midHolo.proto008" + username = "tomas" + annual_hist = "False" + cplot = "Global" + subper = 20 ; Subsampling period in years do_plot = "True" ; do_plot = "False" ;=======================================================================; data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" +; data_dir = "/glade/p_old/cesm0005"+"/archive/"+caseid+"/lnd/hist/" ; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" ; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/F.e15.cam54_clm45_plio_fire_plio/lnd/hist/" ; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/BGC_final_spinup_plio/lnd/hist/" - subper = 20 ; Subsampling period in years -; subper = 30 ; Subsampling period in years -; subper = 5 ; Subsampling period in years - ; Thresholds glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) @@ -58,6 +363,7 @@ begin glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) + glob_thresh_h2osno = 1.0 ; global threshold for H2OSNO equilibrium (delta mm / yr) glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) @@ -95,7 +401,11 @@ begin yearpltrev = yearplt(::-1) year = ispan(fstyr,lstyr,subper) - fstyr nyrs = dimsizes(year) - yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-1),subper) + if (subper .eq. 1) then + yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-2),subper) + else + yearpltmid = ispan(fstyr+subper/2,yearplt(nyrs-1),subper) + end if ; Build an array of monthly indices monstr = new(nyrs*12,"integer") @@ -119,6 +429,12 @@ begin tlai = data[:]->TLAI(year,:,:) gpp = data[:]->GPP(year,:,:) tws = data[:]->TWS(year,:,:) + if (isfilevar(data[0],"H2OSNO")) then + h2osno = data[:]->H2OSNO(year,:,:) + else + h2osno = tws + h2osno = h2osno@_FillValue + end if ; fert = data[:]->FERT(year,:,:) else totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) @@ -126,7 +442,18 @@ begin totvegc = month_to_annual(data[:]->TOTVEGC,1) tlai = month_to_annual(data[:]->TLAI,1) gpp = month_to_annual(data[:]->GPP,1) - tws = month_to_annual(data[:]->TWS,1) + if (isfilevar(data[0],"TWS")) then + tws = month_to_annual(data[:]->TWS,1) + else + tws = gpp + tws = tws@_FillValue + end if + if (isfilevar(data[0],"H2OSNO")) then + h2osno = month_to_annual(data[:]->H2OSNO,1) + else + h2osno = tws + h2osno = h2osno@_FillValue + end if ; fert = month_to_annual(data[:]->FERT,1) end if lat = data[0]->lat @@ -151,6 +478,8 @@ begin do i = 0,nyrs-2 totecosysc_glob_del(i) = (totecosysc_glob(i+1) - totecosysc_glob(i))/subper end do + printVarSummary(totecosysc_glob_del) + print(yearpltmid) totecosysc_glob_del!0 = "year" totecosysc_glob_del&year = yearpltmid indx = where(abs(totecosysc_glob_del) .lt. glob_thresh_totecosysc,1,0) @@ -336,6 +665,8 @@ begin delete(indx) ; TWS + if (isfilevar(data[0],"TWS")) then + tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) tws_glob!0 = "year" tws_glob&year = yearplt @@ -365,6 +696,58 @@ begin tws_glob_equil@_FillValue = -999 delete(indx) + else + tws_glob_equil = new(1,typeof(yearplt),-999) + tws_glob_equil = -999 + printVarSummary(tws_glob_equil) + tws_glob = new(dimsizes(dim_sum_n(tws,(/1,2/))),typeof(tws),-999) + tws_glob = -999 + tws_glob_del = new(nyrs-1,"float",-999.) + tws_glob_del = -999. + end if + +; H2OSNO + if (isfilevar(data[0],"H2OSNO")) then + + h2osno_glob = dim_sum_n(h2osno*landareaL/areasum,(/1,2/)) ; weighted global h2osno (mm) + h2osno_glob!0 = "year" + h2osno_glob&year = yearplt + h2osno_glob_del = new(nyrs-1,"float") + do i = 0,nyrs-2 + h2osno_glob_del(i) = (h2osno_glob(i+1) - h2osno_glob(i))/subper + end do + h2osno_glob_del!0 = "year" + h2osno_glob_del&year = yearpltmid + indx = where(abs(h2osno_glob_del) .lt. glob_thresh_h2osno,1,0) + if (all(indx .eq. 1)) then + h2osno_glob_equil = yearplt(0) + else + if (.not.(all(indx .eq. 0)) .and. indx(dimsizes(indx)-1) .ne. 0) then + indxrev = indx(::-1) + do i = 0,dimsizes(indxrev)-1 + if (indxrev(i) .eq. 0) then + h2osno_glob_equil = yearpltrev(i-1) + break + end if + end do + delete(indxrev) + else + h2osno_glob_equil = -999 + end if + end if + h2osno_glob_equil@_FillValue = -999 + delete(indx) + + else + h2osno_glob_equil = -999 + h2osno_glob_equil = new(1,typeof(yearplt),-999) + h2osno_glob_equil = -999 + h2osno_glob = new(dimsizes(dim_sum_n(h2osno,(/1,2/))),typeof(h2osno),-999) + h2osno_glob = -999 + h2osno_glob_del = new(nyrs-1,"float",-999.) + h2osno_glob_del = -999. + end if + ; FERT ; landareaC = conform_dims(dimsizes(fert),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc ; fert_area = fert*landareaC ; correcting totecosysc for total land area @@ -514,6 +897,15 @@ begin resc@cnLineLabelsOn = False ; turn off contour line labels resc@cnLevelSelectionMode = "ExplicitLevels" resc@mpProjection = "robinson" ; Robinson grid projection + if (cplot .eq. "Arctic") then + resc@mpLimitMode = "LatLon" + resc@mpMinLatF = 50. + resc@mpMaxLatF = 85. + resc@mpMinLonF = -180. + resc@mpMaxLonF = -95. + resc@gsnAddCyclic = False + resc@mpProjection = "CylindricalEquidistant" + end if resc@gsnDraw = True resc@gsnFrame = False resc@lbAutoManage = False @@ -539,6 +931,27 @@ begin frame(wks) + delete(plot) + plot = new(2,"graphic") + + delete(res@trYMaxF) + delete(res@trYMinF) + res@tiYAxisString = "mm" + res@tiMainString = "H2OSNO" + plot(0) = gsn_csm_xy(wks,yearplt,h2osno_glob,res) + + res@tiYAxisString = "mm" + res@tiMainString = "Delta H2OSNO " + "EqYr: "+h2osno_glob_equil + res@trYMaxF = 5.0 + res@trYMinF = -5.0 + plot(1) = gsn_csm_xy(wks,yearpltmid,h2osno_glob_del,res) + prim20 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/0.,0./),polyres1) + prim21 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_h2osno,-glob_thresh_h2osno/),polyres2) + prim22 = gsn_add_polyline(wks,plot(1),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_h2osno,glob_thresh_h2osno/),polyres2) + + gsn_panel(wks,plot,(/4,4/),resP) + frame(wks) + end if ; end do_plot ; Equilibrium summary @@ -574,10 +987,16 @@ begin if (.not.(ismissing(tws_glob_equil))) then print((/"TWS is in equilibrium. Eq. Yr. = "+tws_glob_equil/)) else - print((/"WARNING: TWS is NOT in equilibrium"/)) + print((/"WARNING: TWS is NOT in equilibrium or is missing"/)) + end if + if (.not.(ismissing(h2osno_glob_equil))) then + print((/"H2OSNO is in equilibrium. Eq. Yr. = "+h2osno_glob_equil/)) + else + print((/"WARNING: H2OSNO is NOT in equilibrium or is missing"/)) end if if (.not.(ismissing(perc_landarea_glob_noequil))) then print((/"At least "+(100.-glob_thresh_area)+" percent of the land surface is in TOTECOSYSC equilibrium. Eq. Yr. = "+perc_landarea_glob_noequil/)) + print((/"Percent of the land surface not in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% )"/)) else print((/"FATAL: Not enough of the land surface is in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% > "+sprintf("%6.2f",glob_thresh_area)+"%)"/)) end if From 1319c43fc45757ceb33ba6e2b85053706096ec54 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:25:13 -0700 Subject: [PATCH 323/730] Rename to v8 --- tools/contrib/{SpinupStability_v7.ncl => SpinupStability_v8.ncl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{SpinupStability_v7.ncl => SpinupStability_v8.ncl} (100%) diff --git a/tools/contrib/SpinupStability_v7.ncl b/tools/contrib/SpinupStability_v8.ncl similarity index 100% rename from tools/contrib/SpinupStability_v7.ncl rename to tools/contrib/SpinupStability_v8.ncl From 88a7bb71360496ee27e53ea5a1287a585f49d7e4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:27:31 -0700 Subject: [PATCH 324/730] Improve documentation, remove commented out code, improve formating, add some more specific options and if sections, change some if statements to just check logical status rather than explicitly comparing to True from @olyson /gpfs/u/home/oleson/lnd_diag/run/ --- tools/contrib/SpinupStability_v8.ncl | 552 ++++++++------------------- 1 file changed, 159 insertions(+), 393 deletions(-) diff --git a/tools/contrib/SpinupStability_v8.ncl b/tools/contrib/SpinupStability_v8.ncl index c30da114d4..abd512500c 100644 --- a/tools/contrib/SpinupStability_v8.ncl +++ b/tools/contrib/SpinupStability_v8.ncl @@ -1,8 +1,8 @@ ; NCL script -; SpinupStability_v7.ncl +; SpinupStability_v8.ncl ; Script to examine stability of spinup simulation. ; This version operates on either monthly mean or multi-annual mean multi-variable history files -; Keith Oleson, May 2016 +; Keith Oleson, Jan 2019 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" @@ -21,367 +21,75 @@ begin ; and/or in disequilibrium is also produced to standard out. The postscript output ; is $caseid_spinup.ps in the pwd. ; The variables examined are TOTECOSYSC,TOTSOMC,TOTVEGC,TLAI,GPP,TWS,H2OSNO. -; The percentage of land area in TOTECOSYSC disequilibrium is also examined. +; The percentage of land area in TOTECOSYSC disequilibrium is also examined (not for single point). ; Thresholds are defined below (i.e., global_thresh_*) and can be changed for individual ; variables. ; To run this script, just enter in your case name and username below. -; AND set the annual_hist flag to "True" if your case has annual mean history files or set -; annual_hist flag to "False" if your case has monthly mean history files. -; The script ; assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist +; AND set the annual_hist flag to True if your case has annual mean history files or set +; annual_hist flag to False if your case has monthly mean history files. +; AND set the region (supported options: Global, Arctic, SPT). +; AND set the subper (subsampling period in years, number of years that atm forcing repeats). +; The script assumes that your history files are in /glade/scratch/$username/archive/$caseid/lnd/hist ;=======================================================================; -; FINAL CLM4/4.5 SIMULATIONS - -; caseid = "clm40_n26r233_1deg_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm40_n26r233_1deg_GSWP3V2_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm40_r243_1deg_GSWP3V2_CMIP6_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm40_r243_1deg_CRUNCEPV7_CMIP6_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm45_n26r233_1deg_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm45_n26r233_1deg_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm45_r243_1deg_GSWP3V2_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm45_r243_1deg_GSWP3V2_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; PRELIMINARY CLM5.0 SIMULATIONS - -; caseid = "clm50_r243_1deg_CRUNCEPV7_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r243_1deg_CRUNCEPV7_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r243_1deg_CRUNCEPV7_sc_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r243_1deg_GSWP3V2_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r243_1deg_GSWP3V2_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r243_1deg_GSWP3V2_sc_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r243_1deg_GSWP3V2_stemleaf_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r256_1deg_GSWP3V1_stemleaf_ncosts_psi50_BLDTT_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r243_1deg_GSWP3V2_sc_emergeV2C_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; FINAL CLM5.0 SIMULATIONS - -; caseid = "clm50_r265_1deg_GSWP3V1_cs_1700" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r265_1deg_GSWP3V1_400i_ccrit_1700pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r265_1deg_GSWP3V1_iso_1850" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r265_1deg_GSWP3V1_iso_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r265_1deg_GSWP3V1_iso_400i_ccrit_1850pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_1850pAD" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r266_1deg_CRUNCEPV7_iso_ch_1850pAD" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r268_1deg_WATCH_iso_1850" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r268_1deg_WATCH_iso_1850pAD" -; username = "oleson" -; annual_hist = "True" - -; caseid = "clm50_r268_1deg_WATCH_iso_ch_1850pAD" -; username = "oleson" -; annual_hist = "True" - -; MISC SIMULATIONS - -; caseid = "clm5_nbug_test_case" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_case" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_test_casepAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_casepAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm50_CRUNCEP_1800_postAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_case" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_casepAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_case460pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_case660pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_caselat100" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_caselat25" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_caselat100pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "clm5_nbug_control_equil_ntasks3_caselat25pAD" -; username = "oleson" -; annual_hist = "False" - -; caseid = "cesm20exp10j_1deg_CPLHST_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 21 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 21 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 21 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_nndep_iAD_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 21 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_nndep_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 21 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_GSWP3init_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 1 ; Subsampling period in years - -; caseid = "cesm20exp10j_1deg_CPLHST_GSWP3init_pdco2_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Global" -; subper = 1 ; Subsampling period in years - -; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1ss_ddp10_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1ss_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1ss_1850AD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50d008_ArcticWF_hcru_GSWP3V1_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm45d008_ArcticWF_hcru_GSWP3V1_1850pAD" -; username = "oleson" -; annual_hist = "False" -; cplot = "Arctic" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_cesm201R_1deg_GSWP3V1_phsoff_1850AD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_cesm201R_1deg_GSWP3V1_phsoff_1850pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_1850pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_f_1850pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_Rclm5007_1deg_GSWP3V1_land-hist_1700pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - +; GLOBAL EXAMPLE ; caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD" ; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - -; caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" +; annual_hist = True +; region = "Global" ; Global, Arctic, or SPT (single point) ; subper = 20 ; Subsampling period in years -; caseid = "clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850AD" +; SPT (single point) EXAMPLE +; caseid = "clm50_release-clm5.0.15_SPT_GSWP3V1_1850spin" ; username = "oleson" -; annual_hist = "True" -; cplot = "Global" +; annual_hist = True +; region = "SPT" ; Global, Arctic, or SPT (single point) ; subper = 20 ; Subsampling period in years -; caseid = "clm50_release-clm5.0.15_delta_CN_FUNbug_2deg_GSWP3V1_1850pAD" -; username = "oleson" -; annual_hist = "True" -; cplot = "Global" -; subper = 20 ; Subsampling period in years - - caseid = "i.e21.B1850.f09_g17.PMIP4-midHolo.proto008" - username = "tomas" - annual_hist = "False" - cplot = "Global" - subper = 20 ; Subsampling period in years - - do_plot = "True" -; do_plot = "False" + do_plot = True +; do_plot = False ;=======================================================================; data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" -; data_dir = "/glade/p_old/cesm0005"+"/archive/"+caseid+"/lnd/hist/" -; data_dir = "/glade/scratch/"+username+"/"+caseid+"/run/" -; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/F.e15.cam54_clm45_plio_fire_plio/lnd/hist/" -; data_dir = "/glade/p/cesm/palwg_dev/pliocene/archive/BGC_final_spinup_plio/lnd/hist/" ; Thresholds - glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) - glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) - glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta PgC / yr) - glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) - glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) - glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) - glob_thresh_h2osno = 1.0 ; global threshold for H2OSNO equilibrium (delta mm / yr) - glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr - totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) - - if (annual_hist .eq. "True") then + if (region .eq. "SPT") then + glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta MgC / yr) + glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta MgC / yr) + glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta MgC / yr) + glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) + glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta MgC / yr) + glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) + glob_thresh_h2osno = 1.0 ; global threshold for H2OSNO equilibrium (delta mm / yr) + glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr (not used) + totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) (not used) + else + glob_thresh_totecosysc = 0.02 ; global threshold for TOTECOSYSC equilibrium (delta PgC / yr) + glob_thresh_totsomc = 0.02 ; global threshold for TOTSOMC equilibrium (delta PgC / yr) + glob_thresh_totvegc = 0.02 ; global threshold for TOTVEGC equilibrium (delta PgC / yr) + glob_thresh_tlai = 0.02 ; global threshold for TLAI equilibrium (delta m2/m2 / yr) + glob_thresh_gpp = 0.02 ; global threshold for GPP equilibrium (delta PgC / yr) + glob_thresh_tws = 0.001 ; global threshold for TWS equilibrium (delta m / yr) + glob_thresh_h2osno = 1.0 ; global threshold for H2OSNO equilibrium (delta mm / yr) + glob_thresh_area = 3.0 ; global threshold percent area with TOTECOSYSC disequilibrium gt 1 g C/m2/yr + totecosysc_thresh = 1. ; disequilibrium threshold for individual gridcells (gC/m2/yr) + end if + + if (annual_hist) then fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*-*-*"+".nc") else fls = systemfunc("ls " + data_dir + caseid+".clm2.h0.*-*"+".nc") end if flsdims = dimsizes(fls) - if (annual_hist .eq. "True") then + if (annual_hist) then lstfile = addfile(fls(flsdims-1),"r") else lstfile = addfile(fls(flsdims-12),"r") ;last month (DEC) of any year has mdate for next year ;so grab JAN of last year end if - if (annual_hist .eq. "True") then + if (annual_hist) then lstyrdim = dimsizes(lstfile->mcdate) mcdate_lst = lstfile->mcdate(lstyrdim-1) else @@ -390,7 +98,7 @@ begin lstyr = toint(mcdate_lst)/10000 fstfile = addfile(fls(0),"r") - if (annual_hist .eq. "True") then + if (annual_hist) then mcdate_fst = fstfile->mcdate(0) else mcdate_fst = fstfile->mcdate @@ -414,28 +122,42 @@ begin end do ; Add the data files together - if (annual_hist .eq. "True") then + if (annual_hist) then data = addfiles(fls, "r") ListSetType (data, "cat") else data = addfiles(fls(monstr), "r") end if -; Convert to annual means - if (annual_hist .eq. "True") then - totecosysc = data[:]->TOTECOSYSC(year,:,:) - totsomc = data[:]->TOTSOMC(year,:,:) - totvegc = data[:]->TOTVEGC(year,:,:) - tlai = data[:]->TLAI(year,:,:) - gpp = data[:]->GPP(year,:,:) - tws = data[:]->TWS(year,:,:) - if (isfilevar(data[0],"H2OSNO")) then - h2osno = data[:]->H2OSNO(year,:,:) +; Convert to annual means if required + if (annual_hist) then + if (region .eq. "SPT") then + totecosysc = data[:]->TOTECOSYSC(year,:) + totsomc = data[:]->TOTSOMC(year,:) + totvegc = data[:]->TOTVEGC(year,:) + tlai = data[:]->TLAI(year,:) + gpp = data[:]->GPP(year,:) + tws = data[:]->TWS(year,:) + if (isfilevar(data[0],"H2OSNO")) then + h2osno = data[:]->H2OSNO(year,:) + else + h2osno = tws + h2osno = h2osno@_FillValue + end if else - h2osno = tws - h2osno = h2osno@_FillValue + totecosysc = data[:]->TOTECOSYSC(year,:,:) + totsomc = data[:]->TOTSOMC(year,:,:) + totvegc = data[:]->TOTVEGC(year,:,:) + tlai = data[:]->TLAI(year,:,:) + gpp = data[:]->GPP(year,:,:) + tws = data[:]->TWS(year,:,:) + if (isfilevar(data[0],"H2OSNO")) then + h2osno = data[:]->H2OSNO(year,:,:) + else + h2osno = tws + h2osno = h2osno@_FillValue + end if end if -; fert = data[:]->FERT(year,:,:) else totecosysc = month_to_annual(data[:]->TOTECOSYSC,1) totsomc = month_to_annual(data[:]->TOTSOMC,1) @@ -454,7 +176,6 @@ begin h2osno = tws h2osno = h2osno@_FillValue end if -; fert = month_to_annual(data[:]->FERT,1) end if lat = data[0]->lat nlat = dimsizes(lat) @@ -464,22 +185,34 @@ begin area = data[0]->area aream = area*1.e6 landarea = landfrac*aream - gtoPg = 1e-15 + if (region .eq. "SPT") then + gtoXg = 1e-12 ;Tg + units = "Tg C" + else + gtoXg = 1e-15 ;Pg + units = "Pg C" + end if secinyr = 60.*60.*24.*365. ; TOTECOSYSC - landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc + if (region .eq. "SPT") then + landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1/)) ; conforming dimensions of landarea to totecosysc + else + landareaC = conform_dims(dimsizes(totecosysc),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc + end if totecosysc_area = totecosysc*landareaC ; correcting totecosysc for total land area - totecosysc_pg = totecosysc_area*gtoPg ; g to Pg - totecosysc_glob = dim_sum_n(totecosysc_pg, (/1,2/)) ; sums over all latitudes + totecosysc_Xg = totecosysc_area*gtoXg ; g to Xg + if (region .eq. "SPT") then + totecosysc_glob = dim_sum_n(totecosysc_Xg, (/1/)) ; sums over single point + else + totecosysc_glob = dim_sum_n(totecosysc_Xg, (/1,2/)) ; sums over all latitudes + end if totecosysc_glob!0 = "year" totecosysc_glob&year = yearplt totecosysc_glob_del = new(nyrs-1,"float") do i = 0,nyrs-2 totecosysc_glob_del(i) = (totecosysc_glob(i+1) - totecosysc_glob(i))/subper end do - printVarSummary(totecosysc_glob_del) - print(yearpltmid) totecosysc_glob_del!0 = "year" totecosysc_glob_del&year = yearpltmid indx = where(abs(totecosysc_glob_del) .lt. glob_thresh_totecosysc,1,0) @@ -503,6 +236,7 @@ begin delete(indx) ; Land area not in TOTECOSYSC equilibrium + if (region .ne. "SPT") then landarea_noequil = new((/nyrs-1,nlat,nlon/),"float") do i = 0,nyrs-2 landarea_noequil(i,:,:) = where((totecosysc(i+1,:,:) - totecosysc(i,:,:))/subper .gt. totecosysc_thresh, landarea, 0.) @@ -534,11 +268,16 @@ begin totecosysc_1_map&lon = lon totecosysc_2_map = where(landarea_noequil(nyrs-3,:,:) .ne. 0.,(totecosysc(nyrs-2,:,:)-totecosysc(nyrs-3,:,:))/subper,totecosysc@_FillValue) copy_VarCoords(totecosysc_1_map,totecosysc_2_map) + end if ; TOTSOMC totsomc_area = totsomc*landareaC ; correcting totsomc for total land area - totsomc_pg = totsomc_area*gtoPg ; g to Pg - totsomc_glob = dim_sum_n(totsomc_pg, (/1,2/)) ; sums over all latitudes + totsomc_Xg = totsomc_area*gtoXg ; g to Xg + if (region .eq. "SPT") then + totsomc_glob = dim_sum_n(totsomc_Xg, (/1/)) ; sums over single point + else + totsomc_glob = dim_sum_n(totsomc_Xg, (/1,2/)) ; sums over all latitudes + end if totsomc_glob!0 = "year" totsomc_glob&year = yearplt totsomc_glob_del = new(nyrs-1,"float") @@ -569,8 +308,12 @@ begin ; TOTVEGC totvegc_area = totvegc*landareaC ; correcting totvegc for total land area - totvegc_pg = totvegc_area*gtoPg ; g to Pg - totvegc_glob = dim_sum_n(totvegc_pg, (/1,2/)) ; sums over all latitudes + totvegc_Xg = totvegc_area*gtoXg ; g to Xg + if (region .eq. "SPT") then + totvegc_glob = dim_sum_n(totvegc_Xg, (/1/)) ; sums over single point + else + totvegc_glob = dim_sum_n(totvegc_Xg, (/1,2/)) ; sums over all latitudes + end if totvegc_glob!0 = "year" totvegc_glob&year = yearplt totvegc_glob_del = new(nyrs-1,"float") @@ -602,8 +345,13 @@ begin ; TLAI areasum = sum(area*landfrac) areaL = area*landfrac - landareaL = conform_dims(dimsizes(tlai),areaL,(/1,2/)) ; conforming dimensions of areaL to tlai - tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1,2/)) ; weighted global tlai + if (region .eq. "SPT") then + landareaL = conform_dims(dimsizes(tlai),areaL,(/1/)) ; conforming dimensions of areaL to tlai + tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1/)) ; weighted tlai + else + landareaL = conform_dims(dimsizes(tlai),areaL,(/1,2/)) ; conforming dimensions of areaL to tlai + tlai_glob = dim_sum_n(tlai*landareaL/areasum,(/1,2/)) ; weighted global tlai + end if tlai_glob!0 = "year" tlai_glob&year = yearplt tlai_glob_del = new(nyrs-1,"float") @@ -634,8 +382,12 @@ begin ; GPP gpp_area = gpp*landareaC ; correcting gpp for total land area - gpp_pg = gpp_area*gtoPg*secinyr ; g to Pg and sec to yrs - gpp_glob = dim_sum_n(gpp_pg, (/1,2/)) ; sums over all latitudes + gpp_Xg = gpp_area*gtoXg*secinyr ; g to Xg and sec to yrs + if (region .eq. "SPT") then + gpp_glob = dim_sum_n(gpp_Xg, (/1/)) ; sums over single point + else + gpp_glob = dim_sum_n(gpp_Xg, (/1,2/)) ; sums over all latitudes + end if gpp_glob!0 = "year" gpp_glob&year = yearplt gpp_glob_del = new(nyrs-1,"float") @@ -667,7 +419,11 @@ begin ; TWS if (isfilevar(data[0],"TWS")) then - tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) + if (region .eq. "SPT") then + tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1/)))/1.e3 ; weighted tws (meters) + else + tws_glob = (dim_sum_n(tws*landareaL/areasum,(/1,2/)))/1.e3 ; weighted global tws (meters) + end if tws_glob!0 = "year" tws_glob&year = yearplt tws_glob_del = new(nyrs-1,"float") @@ -699,8 +455,11 @@ begin else tws_glob_equil = new(1,typeof(yearplt),-999) tws_glob_equil = -999 - printVarSummary(tws_glob_equil) - tws_glob = new(dimsizes(dim_sum_n(tws,(/1,2/))),typeof(tws),-999) + if (region .eq. "SPT") then + tws_glob = new(dimsizes(dim_sum_n(tws,(/1/))),typeof(tws),-999) + else + tws_glob = new(dimsizes(dim_sum_n(tws,(/1,2/))),typeof(tws),-999) + end if tws_glob = -999 tws_glob_del = new(nyrs-1,"float",-999.) tws_glob_del = -999. @@ -709,7 +468,11 @@ begin ; H2OSNO if (isfilevar(data[0],"H2OSNO")) then - h2osno_glob = dim_sum_n(h2osno*landareaL/areasum,(/1,2/)) ; weighted global h2osno (mm) + if (region .eq. "SPT") then + h2osno_glob = dim_sum_n(h2osno*landareaL/areasum,(/1/)) ; weighted h2osno (mm) + else + h2osno_glob = dim_sum_n(h2osno*landareaL/areasum,(/1,2/)) ; weighted global h2osno (mm) + end if h2osno_glob!0 = "year" h2osno_glob&year = yearplt h2osno_glob_del = new(nyrs-1,"float") @@ -742,21 +505,18 @@ begin h2osno_glob_equil = -999 h2osno_glob_equil = new(1,typeof(yearplt),-999) h2osno_glob_equil = -999 - h2osno_glob = new(dimsizes(dim_sum_n(h2osno,(/1,2/))),typeof(h2osno),-999) + if (region .eq. "SPT") then + h2osno_glob = new(dimsizes(dim_sum_n(h2osno,(/1/))),typeof(h2osno),-999) + else + h2osno_glob = new(dimsizes(dim_sum_n(h2osno,(/1,2/))),typeof(h2osno),-999) + end if h2osno_glob = -999 h2osno_glob_del = new(nyrs-1,"float",-999.) h2osno_glob_del = -999. end if -; FERT -; landareaC = conform_dims(dimsizes(fert),landarea,(/1,2/)) ; conforming dimensions of landarea to totecosysc -; fert_area = fert*landareaC ; correcting totecosysc for total land area -; fert_pg = fert_area*gtoPg*secinyr ; g to Pg and sec to yrs -; fert_glob = dim_sum_n(fert_pg, (/1,2/)) ; sums over all latitudes -; print(fert_glob) - ;===============================Plotting====================================; - if (do_plot .eq. "True") then + if (do_plot) then ; wks_type = "png" ; wks_type@wkWidth = 2500 @@ -790,11 +550,11 @@ begin polyres2@gsLineDashPattern = 2 res@tiXAxisString = " " - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "TOTECOSYSC" plot(0) = gsn_csm_xy(wks,yearplt,totecosysc_glob,res) - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "Delta TOTECOSYSC " + "EqYr: "+totecosysc_glob_equil res@trYMaxF = 0.2 res@trYMinF = -0.2 @@ -805,11 +565,11 @@ begin delete(res@trYMaxF) delete(res@trYMinF) - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "TOTSOMC" plot(2) = gsn_csm_xy(wks,yearplt,totsomc_glob,res) - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "Delta TOTSOMC " + "EqYr: "+totsomc_glob_equil res@trYMaxF = 0.2 res@trYMinF = -0.2 @@ -820,11 +580,11 @@ begin delete(res@trYMaxF) delete(res@trYMinF) - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "TOTVEGC" plot(4) = gsn_csm_xy(wks,yearplt,totvegc_glob,res) - res@tiYAxisString = "Pg C" + res@tiYAxisString = units res@tiMainString = "Delta TOTVEGC " + "EqYr: "+totvegc_glob_equil res@trYMaxF = 0.2 res@trYMinF = -0.2 @@ -850,11 +610,11 @@ begin delete(res@trYMaxF) delete(res@trYMinF) - res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiYAxisString = units+" yr~S~-1~N~" res@tiMainString = "GPP" plot(8) = gsn_csm_xy(wks,yearplt,gpp_glob,res) - res@tiYAxisString = "Pg C yr~S~-1~N~" + res@tiYAxisString = units+" yr~S~-1~N~" res@tiXAxisString = "Spinup Year" res@tiMainString = "Delta GPP " + "EqYr: "+gpp_glob_equil res@trYMaxF = 0.2 @@ -879,15 +639,18 @@ begin prim17 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/-glob_thresh_tws,-glob_thresh_tws/),polyres2) prim18 = gsn_add_polyline(wks,plot(11),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_tws,glob_thresh_tws/),polyres2) - res@tiYAxisString = "%" - res@tiMainString = "% Land Area in TOTECOSYSC Disequil " + "EqYr: "+perc_landarea_glob_noequil - res@trYMaxF = 80.0 - res@trYMinF = 0.0 - plot(12) = gsn_csm_xy(wks,yearpltmid,perc_landarea_noequil,res) - prim19 = gsn_add_polyline(wks,plot(12),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_area,glob_thresh_area/),polyres2) + if (region .ne. "SPT") then + res@tiYAxisString = "%" + res@tiMainString = "% Land Area in TOTECOSYSC Disequil " + "EqYr: "+perc_landarea_glob_noequil + res@trYMaxF = 80.0 + res@trYMinF = 0.0 + plot(12) = gsn_csm_xy(wks,yearpltmid,perc_landarea_noequil,res) + prim19 = gsn_add_polyline(wks,plot(12),(/0.,yearpltmid(nyrs-2)/),(/glob_thresh_area,glob_thresh_area/),polyres2) + end if gsn_panel(wks,plot,(/4,4/),resP) + if (region .ne. "SPT") then delete(plot) resc = True ; turn on plotting options resc@gsnSpreadColors = True ; spans all colors in colormap @@ -897,7 +660,7 @@ begin resc@cnLineLabelsOn = False ; turn off contour line labels resc@cnLevelSelectionMode = "ExplicitLevels" resc@mpProjection = "robinson" ; Robinson grid projection - if (cplot .eq. "Arctic") then + if (region .eq. "Arctic") then resc@mpLimitMode = "LatLon" resc@mpMinLatF = 50. resc@mpMaxLatF = 85. @@ -929,8 +692,9 @@ begin resc@gsnCenterString = "TOTECOSYSC Disequil Yr " + yearplt(nyrs-2) + " - " + yearplt(nyrs-3) plot = gsn_csm_contour_map(wks,totecosysc_2_map,resc) - frame(wks) + end if + frame(wks) delete(plot) plot = new(2,"graphic") @@ -994,6 +758,7 @@ begin else print((/"WARNING: H2OSNO is NOT in equilibrium or is missing"/)) end if + if (region .ne. "SPT") then if (.not.(ismissing(perc_landarea_glob_noequil))) then print((/"At least "+(100.-glob_thresh_area)+" percent of the land surface is in TOTECOSYSC equilibrium. Eq. Yr. = "+perc_landarea_glob_noequil/)) print((/"Percent of the land surface not in equilibrium ("+sprintf("%6.2f",perc_landarea_noequil(nyrs-2))+"% )"/)) @@ -1011,6 +776,7 @@ begin print((/"FATAL: Your simulation is not in equilibrium, 8 hours have been deducted from your PTO bank, try again"/)) end if print((/"======================================================================="/)) + end if print ("=========================================") print ("Finish Time: "+systemfunc("date") ) From f8e1a4a9791ec29058081e7daae845761af27c6f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:48:31 -0700 Subject: [PATCH 325/730] Rename to run_clm_historical.v7.csh --- tools/contrib/{SpinupStability_v8.ncl => SpinupStability.ncl} | 0 .../contrib/{run_clm_historical.csh => run_clm_historical.v7.csh} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{SpinupStability_v8.ncl => SpinupStability.ncl} (100%) rename tools/contrib/{run_clm_historical.csh => run_clm_historical.v7.csh} (100%) diff --git a/tools/contrib/SpinupStability_v8.ncl b/tools/contrib/SpinupStability.ncl similarity index 100% rename from tools/contrib/SpinupStability_v8.ncl rename to tools/contrib/SpinupStability.ncl diff --git a/tools/contrib/run_clm_historical.csh b/tools/contrib/run_clm_historical.v7.csh similarity index 100% rename from tools/contrib/run_clm_historical.csh rename to tools/contrib/run_clm_historical.v7.csh From 2f99c206d92bec151493f58f23c9acf2316017dd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:50:27 -0700 Subject: [PATCH 326/730] Improved documentation from @olyson, and also do a few more sections and things done from /gpfs/u/home/oleson/run_hist_1850_files/BGC/run_clm_historical.v7.csh --- tools/contrib/run_clm_historical.v7.csh | 317 +++++++++++++++++++----- 1 file changed, 260 insertions(+), 57 deletions(-) diff --git a/tools/contrib/run_clm_historical.v7.csh b/tools/contrib/run_clm_historical.v7.csh index 2b5a5f0f83..d161f1c43b 100755 --- a/tools/contrib/run_clm_historical.v7.csh +++ b/tools/contrib/run_clm_historical.v7.csh @@ -2,55 +2,86 @@ ######################################################################################### # -# - Execute this script to do a CLM historical simulation from 1850 - 2010. This +# - Execute this script to do a CLM historical simulation from 1850 - 2014. This # script will complete all the changes required at year 1901 to deal with the # fact that met forcing data does not go back to 1850. # # - Unmodified script will do the following. -# Simulation 1: 1850 - 1901 (51 years) using repeated 1901-1920 forcing -# Simulation 2+3: 1901-2010 (two 55 year) simulations +# Part 1: Simulation 1: 1850 - 1870 (21 years) using repeated 1901-1920 forcing +# Part 2: Simulation 2: 1871 - 1900 (30 years) using repeated 1901-1920 forcing +# Part 3: Simulation 3+4+5+6: 1901-1988 (four 22 year) simulations using 1901-1988 forcing +# Part 4: Simulation 7: 1989-2004 (one 16 year) branch simulation w/daily output using 1989-2004 forcing +# Part 5: Simulation 8: 2005-2014 (one 10 year) branch simulation w/daily & subdaily output using 2005-2014 forcing # -# - Script assumes that can simulation > 60 years within a 12 hour block on -# Yellowstone. To find the timing in an equivalent sample run, look in the timing +# - Script assumes that simulation can run at least 30 years within a 12 hour block on +# Cheyenne. To find the timing in an equivalent sample run, look in the timing # directory and grep as follows > grep 'simulated_years/day' cesm_timing* # -# - In the $CASENAME.run file ensure the following: #BSUB -W 12:00 +# - In the env_batch.xml file for the case.run group ensure the following: # that way you can use up to 12:00 hours of wall-clock computer time per run block # -# - Before submitting script, make a copy of your modified or unmodified user_nl_clm file i -# into "original_user_nl_clm". If you wish to make additional changes to user_nl_clm -# via this script, you can do that by editing thee Set the user namelist file section below. +# - This script assumes that env_mach_pes.xml has been setup and case.setup has already been run # -# - The data files start in 1901 for CRUNCEP, so with : +# - This script makes use of user_nl_datm1901-1920 and user_nl_datm1901-2014 +# +# - Before submitting script, make a copy of your modified or unmodified user_nl_clm file +# into "original_user_nl_clm". This should only contain namelist items that will not change throughout +# the run. +# Create a file called user_nl_clm_histdaily that contains the desired history output namelist items +# for the 1989-2004 simulation +# Create a file called user_nl_clm_histsubdaily that contains the desired history output namelist items +# for the 2005-2014 simulation +# +# - The atm data files start in 1901, so with : # ALIGN year of 1901, (this is in units of RUN or simulation years) # START year of 1901, (this is in units of FORCE'ing data years) # -# RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1899 1900 1901 -# FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1919 1920 1901 +# RUN Year : 1850 ... 1860 1861 ... 1870 ... 1880 1881 ... 1890 ... 1900 1901 ... 2014 +# FORCE Year : 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 1910 ... 1920 1901 ... 2014 # -# - The script could be broken up into two parts if you want to check the initial set of +# - The script could be broken up into several parts if you want to check the initial set of # simulations. # # - Written by Andrew Slater - Late July, 2015; aslater@kryos.colorado.edu # - Modified by Dave Lawrence, August, 2015 # - Updated with better check that run has also been archived to short term - Dave Lawrence # October, 2015 -# - ./run_clm_historical.v3.csh ! > & run_historical.out & +# - Updated to adjust for the fact that the model is now slower - Keith Oleson December, 2016 +# ./run_clm_historical.v5.csh ! > & run_historical.out & +# - Extend to 2014 and obtain daily & sub-daily output for end of run - Keith Oleson January, 2018 +# ./run_clm_historical.v6.csh ! > & run_historical.out & +# - Modify history output for CMIP6 - Keith Oleson January, 2019 +# ./run_clm_historical.v7.csh ! > & run_historical.out & +######################################################################################### + +######################################################################################### +# PART 1 +######################################################################################### +# +# This portion does the initial setup and the initial 21 year run (1850-1870) +# ######################################################################################### # --- CASENAME is your case name -set CASENAME = 'clm5_respn05r162_2degGSWP3_hist_allN_v01' +set CASENAME = 'clm50_release-clm5.0.15_2deg_GSWP3V1_hist' -# --- Set the user namelist file. i.e. add the snow alterations for my run. Others may have -# diferent needs -#set UNLCLM = 'script_user_nl_clm' -#cat original_user_nl_clm > $UNLCLM +# --- Set the user namelist file. +cp original_user_nl_clm user_nl_clm -# Examples of how to modify user_nl_clm using this script. Uncomment and edit as desired. -#echo "hist_empty_htapes = .true." >> $UNLCLM -#echo "hist_fincl1 = 'TSA'" >> $UNLCLM -#cat $UNLCLM > user_nl_clm +# --- Ensure that the env_run.xml file has the correct content +# Since this particular run won't go for 51 years in 12 hours (as in v4 script), set it up for 21 years first +./xmlchange RUN_TYPE=startup +./xmlchange RUN_STARTDATE=1850-01-01 +./xmlchange STOP_OPTION=nyears +./xmlchange STOP_N=21 +./xmlchange CONTINUE_RUN=FALSE +./xmlchange RESUBMIT=0 +./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 +./xmlchange DATM_CLMNCEP_YR_START=1901 +./xmlchange DATM_CLMNCEP_YR_END=1920 +# need to use user_nl_datm files to get years right +cp user_nl_datm1901-1920 user_nl_datm # --- Check that you end up using the correct env_run.xml file set nenvr = `ls -1 env_run*.xml | wc -l` @@ -60,45 +91,79 @@ if ($nenvr > 1) then exit endif - -# --- Ensure that the env_run.xml file has the correct content -./xmlchange RUN_TYPE=startup -./xmlchange RUN_STARTDATE=1850-01-01 -./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=51 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=1920 -./xmlchange CONTINUE_RUN=FALSE -./xmlchange RESUBMIT=0 - # --- If you have not already built the code, then do so now #./case.clean_build -#./case.build +qcmd -- ./case.build # --- Now submit the job and let it run ./case.submit - ######################################################################################### # PART 2 ######################################################################################### # -# This portion checks to see if the 1850-1901 portion of the run is done (or it waits -# 10 minutes before checking again). It then removes (or rather moves and renames) the -# datm files so that the model will use the full array of data from 1901-2010. -# This part runs with forcing data files that actually exist +# This portion checks to see if the 1850-1870 portion of the run is done (or it waits +# 10 minutes before checking again). # -# This will start the run from 1901 (hence the CONTINUE=TRUE) and do two 55 year -# simulations: 1901 + 2*55 - 1 = 2010 (minus 1 becase we do 1901) +# This will then start the run from 1871 (hence the CONTINUE_RUN=TRUE) and do one 30 year +# simulation # # The new values for env_run.xml are put in place -# The values for user_nl_clm are put in place # Then submit the job # ######################################################################################### +set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' +set DONE_RUNA = 0 +set DONE_ARCHIVE = 0 +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1871-01-01-00000.nc' + +# --- Check if the first set of simulations have completed and the data archived (every ten minutes) +while ($DONE_RUNA == 0) + if (-e $RESTART_FILE) then + set DONE_RUNA = 1 + echo '1850-1870 run is complete' + while ($DONE_ARCHIVE == 0) + set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + echo $nh0 + if ($nh0 == 1) then + set DONE_ARCHIVE = 1 + echo 'Files have been archived' + else + sleep 600 + date + endif + else + sleep 600 + date + endif +end + +# These are the proper settings to let this script continue the run through 1900 +./xmlchange STOP_N=30 +./xmlchange CONTINUE_RUN=TRUE + +# --- Now submit the job and let it run +./case.submit + +######################################################################################### +# PART 3 +######################################################################################### +# +# This portion checks to see if the 1871-1900 portion of the run is done (or it waits +# 10 minutes before checking again). It then removes (or rather moves and renames) the +# datm files so that the model will use the full array of data from 1901-2014. +# This part runs with forcing data files that actually exist for 1901-2014 +# +# This will start the run from 1901 (hence the CONTINUE_RUN=TRUE) and do four 22 year +# simulations: 1901 + 4*22 - 1 = 1988 (minus 1 because we do 1901) +# +# The new values for env_run.xml are put in place +# Then submit the job +# +######################################################################################### + set WDIR = '/glade/scratch/'$USER'/'$CASENAME'/run/' set DDIR = $WDIR'restart_dump/' @@ -118,25 +183,34 @@ while ($DONE_RUNA == 0) set DONE_ARCHIVE = 1 echo 'Files have been archived' else - sleep 300 + sleep 600 date endif else - sleep 300 + sleep 600 date endif end -# --- If the first set of simulations are done, move the datm files and compress them +# --- If the first two sets of simulations are done, move the datm files and compress them if (! -d $DDIR) then mkdir $DDIR endif mv -i $WDIR$CASENAME.datm.rs1*.bin $DDIR gzip $DDIR$CASENAME*.bin +# Since this particular run won't go for 55 years in 12 hours, do this in four 22 year chunks, thus +# we have to resubmit the job 3 times. +./xmlchange STOP_OPTION=nyears +./xmlchange STOP_N=22 +./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 +./xmlchange DATM_CLMNCEP_YR_START=1901 +./xmlchange DATM_CLMNCEP_YR_END=2014 +./xmlchange CONTINUE_RUN=TRUE +./xmlchange RESUBMIT=3 -# --- Note that the name list file (user_nl_clm) has not changed from before - +# need to use user_nl_datm files to get years right +cp user_nl_datm1901-2014 user_nl_datm # --- Check that you end up using the correct env_run.xml file set nenvr = `ls -1 env_run*.xml | wc -l` @@ -146,17 +220,146 @@ if ($nenvr > 1) then exit endif +# --- Now submit the job and let it run +./case.submit + +######################################################################################### +# PART 4 +######################################################################################### +# +# This portion checks to see if the 1901-1988 part of the run is complete +# and then runs the model for 1989-2004 as a branch run to get daily output +# +######################################################################################### + +set DONE_RUNA = 0 +set DONE_ARCHIVE = 0 +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.1989-01-01-00000.nc' + +# --- Check if the second set of simulations have completed and the data archived (every ten minutes) +while ($DONE_RUNA == 0) + if (-e $RESTART_FILE) then + set DONE_RUNA = 1 + echo '1901-1989 run is complete' + while ($DONE_ARCHIVE == 0) + set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + echo $nh0 + if ($nh0 == 1) then + set DONE_ARCHIVE = 1 + echo 'Files have been archived' + else + sleep 600 + date + endif + else + sleep 600 + date + endif +end # --- Ensure that the env_run.xml file has the correct content -# We want to do a 110 year simulation, but in two 55 year chunks, thus -# we have to resubmit the job once. +./xmlchange RUN_TYPE=branch +./xmlchange RUN_REFCASE={$CASENAME} +./xmlchange RUN_REFDATE=1989-01-01 ./xmlchange STOP_OPTION=nyears -./xmlchange STOP_N=55 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=2010 -./xmlchange CONTINUE_RUN=TRUE -./xmlchange RESUBMIT=1 +./xmlchange STOP_N=16 +./xmlchange CONTINUE_RUN=FALSE +./xmlchange RESUBMIT=0 + +# --- Add in the daily output streams +# --- Reset the user namelist file. +cp original_user_nl_clm user_nl_clm + +# --- Add in the daily history output items +cat user_nl_clm_histdaily >> user_nl_clm + +# --- Now submit the job and let it run +./case.submit + +######################################################################################### +# PART 5 +######################################################################################### +# +# This portion checks to see if the 1989-2004 part of the run is complete +# and then runs the model for 2005-2014 as a branch run to get daily and subdaily output +# +######################################################################################### + +set DONE_RUNA = 0 +set DONE_ARCHIVE = 0 +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2005-01-01-00000.nc' + +# --- Check if the second set of simulations have completed and the data archived (every ten minutes) +while ($DONE_RUNA == 0) + if (-e $RESTART_FILE) then + set DONE_RUNA = 1 + echo '1989-2004 run is complete' + while ($DONE_ARCHIVE == 0) + set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + echo $nh0 + if ($nh0 == 1) then + set DONE_ARCHIVE = 1 + echo 'Files have been archived' + else + sleep 600 + date + endif + else + sleep 600 + date + endif +end +# --- Ensure that the env_run.xml file has the correct content +./xmlchange RUN_TYPE=branch +./xmlchange RUN_REFCASE={$CASENAME} +./xmlchange RUN_REFDATE=2005-01-01 +./xmlchange STOP_OPTION=nyears +./xmlchange STOP_N=10 +./xmlchange CONTINUE_RUN=FALSE +./xmlchange RESUBMIT=0 + +# --- Add in the subdaily output streams +# --- Reset the user namelist file. +cp original_user_nl_clm user_nl_clm + +# --- Add in the daily history output items +cat user_nl_clm_histdaily >> user_nl_clm + +# --- Add in the subdaily history output items +cat user_nl_clm_histsubdaily >> user_nl_clm + +# --- Now submit the job and let it run ./case.submit +######################################################################################### +# +# This portion checks to see if the 2005-2014 part of the run is complete +# and ends the script +# +######################################################################################### + +set DONE_RUNA = 0 +set DONE_ARCHIVE = 0 +set RESTART_FILE = $WDIR$CASENAME'.clm2.r.2015-01-01-00000.nc' + +# --- Check if the second set of simulations have completed and the data archived (every ten minutes) +while ($DONE_RUNA == 0) + if (-e $RESTART_FILE) then + set DONE_RUNA = 1 + echo '2005-2014 run is complete' + while ($DONE_ARCHIVE == 0) + set nh0 = `ls -l $WDIR/*clm2.h0.* | egrep -c '^-'` + echo $nh0 + if ($nh0 == 1) then + set DONE_ARCHIVE = 1 + echo 'Files have been archived' + else + sleep 600 + date + endif + else + sleep 600 + date + endif +end From c4e0a321f38e1d7b1af6d8b57248da0f7f63d3b7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:51:11 -0700 Subject: [PATCH 327/730] Rename run_clm_historical.v7.csh run_clm_historical.csh --- .../contrib/{run_clm_historical.v7.csh => run_clm_historical.csh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/contrib/{run_clm_historical.v7.csh => run_clm_historical.csh} (100%) diff --git a/tools/contrib/run_clm_historical.v7.csh b/tools/contrib/run_clm_historical.csh similarity index 100% rename from tools/contrib/run_clm_historical.v7.csh rename to tools/contrib/run_clm_historical.csh From cfa7a5163d4ed6b22ecc04f5135737496da3646a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:54:45 -0700 Subject: [PATCH 328/730] Updates from @olyson to work with the latest CTSM from /gpfs/fs1/work/oleson/release-clm5.0.12/tools/PTCLM/run_clmtowers.csh --- tools/contrib/run_clmtowers.csh | 232 +++++++++++++++++++++----------- 1 file changed, 157 insertions(+), 75 deletions(-) diff --git a/tools/contrib/run_clmtowers.csh b/tools/contrib/run_clmtowers.csh index 5bc5398143..59b276260f 100755 --- a/tools/contrib/run_clmtowers.csh +++ b/tools/contrib/run_clmtowers.csh @@ -1,17 +1,17 @@ #!/bin/csh -f # -# run_clmtowers.v1.csh +# run_clmtowers.csh # Purpose: This script will run any number of flux tower sites. You will need to # run the script for each spinup and post spinup set of simulations (i.e., # for BGC on, run it separately for AD, PostAD, and post spinup simulations; # for BGC off, run it separately for spinup and post spinup simulations) # You will need to do two things: -# 1. Copy this script into $Clm_Tag_Dir/components/clm/tools/shared/PTCLM +# 1. Copy this script into $Clm_Tag_Dir/tools/shared/PTCLM # where $Clm_Tag_Dir is the location of your clm tag # 2. Set up a directory structure where you can put any sourcemods you might want. # These sourcemods will be copied into the appropriate case directory. # The structure is up to you but here is an example: -# cd $Clm_Tag_Dir/components/clm/tools/shared/PTCLM +# cd $Clm_Tag_Dir/tools/shared/PTCLM # mkdir SourceMods # mkdir SourceMods/clm4_5 # mkdir SourceMods/clm5_0 @@ -24,22 +24,24 @@ # mkdir SourceMods/clm5_0/EXP1 ; This might contain any sourcemods that you want # ; to use in your first clm5_0 experiment # Author: Keith Oleson -# Last Revised: Aug 25 2015 -# Last CLM Tag that this worked on: clm4_5_1_r111 +# Last Revised: Jan 24 2019 +# Last CLM Tag that this worked on: release-clm5.0.12 # Warning: This script is complicated and does not have good (any) error checking currently. -# You might want to come see me for a quick tutorial before using this. +# You might want to ask me for a quick tutorial before using this. # -# Assumes that PTCLMmkdata has already been run for the tower sites chosen below +# ASSUMES that PTCLMmkdata has already been run for the tower sites chosen below # (Surface datasets and shell commands have already been created) +# To run this script on cheyenne: qcmd -- ./run_clmtowers.csh >&! run_clmtowers.out & # set pwd=`pwd` # =================================Start User Mods================================ -# Pick a compset (these are the only two compsets supported) -#set compset = I1PTCLM45 -set compset = I1PTCLM50 -if ($compset == I1PTCLM45) then +# Pick a compset (these are the only two compsets supported, they are both SP compsets +# but BGC will be added if requested below) +#set compset = I1PtClm45SpGs +set compset = I1PtClm50SpGs +if ($compset == I1PtClm45SpGs) then set model = clm4_5 else set model = clm5_0 @@ -48,62 +50,111 @@ endif # Set location of your run directories set rundata = /glade/scratch/oleson # Set the location of your CLM tag -set Clm_Tag_Dir = /glade/p/work/oleson/clm4_5_1_r111 -# Set the location of your surface datasets and shell commands. This will not necessarily be in the -# same location as the CLM tag that you are running above -set User_Mods_Dir = /glade/p/work/oleson/clm4_5_1_r111 +set Clm_Tag_Dir = /glade/work/oleson/release-clm5.0.12 +# Set the location of your surface datasets and shell commands that were generated by PTCLM. +# This will not necessarily be in the same location as the CLM tag that you are running above +#set User_Mods_Dir = /glade/scratch/oleson/release-clm5.0.12 # This is my version for SP simulations +set User_Mods_Dir = /glade/scratch/oleson/release-clm5.0.12.BGC # This is my version for BGC simulations # What sites to run? # These are the sites that can be evaluated with some combination of level 2 data and synthesis (gap-filled) data -#set sites = ( US-Var US-Bo1 US-UMB US-Brw US-ARM US-Ho1 US-Me4 US-Me2 US-Dk3 US-NR1 DE-Tha ES-ES1 FL-Hyy CA-Man BR-Sa3 BR-Sa1 IT-Cpz US-Dk2 US-MOz US-WCr US-MMS US-Ha1 BE-Vie IT-Col CA-Let US-FPe FL-Kaa US-IB1 US-Ne3 CA-Qfo BR-Sa1LBA BR-Sa3LBA BR-Ma1LBA BR-RJA BR-Ji1 ) -#set startyear = ( 2000 1996 1999 1998 2000 1996 1996 2002 1998 1998 1998 1999 1997 1994 2001 2002 2001 2003 2004 1998 1999 1991 1997 1996 1998 2000 2000 2005 2001 2004 2002 2001 2000 2000 1999 ) -#set endyear = ( 2007 2008 2006 2006 2007 2004 2000 2010 2005 2007 2003 2005 2005 2003 2003 2004 2005 2005 2007 2006 2007 2006 2005 2001 2007 2007 2005 2007 2006 2006 2004 2003 2005 2002 2001 ) +#set sites = ( US-Var US-Bo1 US-UMB US-Brw US-ARM US-Ho1 US-Me4 US-Me2 US-Dk3 US-NR1 DE-Tha ES-ES1 FL-Hyy CA-Man BR-Sa3 BR-Sa1 IT-Cpz US-Dk2 US-MOz US-WCr US-MMS US-Ha1 BE-Vie IT-Col CA-Let US-FPe FL-Kaa US-IB1 US-Ne3 CA-Qfo BR-Sa1LBA BR-Sa3LBA BR-Ma1LBA BR-RJA BR-Ji1 CA-Obs CA-Ojp CA-Ca1 CA-Oas US-Dk1) +#set startyear = ( 2000 1996 1999 1998 2000 1996 1996 2002 1998 1998 1998 1999 1997 1994 2001 2002 2001 2003 2004 1998 1999 1991 1997 1996 1998 2000 2000 2005 2001 2004 2002 2001 2000 2000 1999 2000 2000 1998 1997 2001) +#set endyear = ( 2007 2008 2006 2006 2007 2004 2000 2010 2005 2007 2003 2005 2005 2003 2003 2004 2005 2005 2007 2006 2007 2006 2005 2001 2007 2007 2005 2007 2006 2006 2004 2003 2005 2002 2001 2006 2006 2006 2006 2005) # Or you could just do one site set sites = ( US-Var ) set startyear = ( 2000 ) -set endyear = ( 2007 ) +set endyear = ( 2007 ) + +set BGC = "ON" # ON or OFF # USER MODS FOR BGC ON -# For BGC on, the sequence of simulations is AD spinup (1000 years), -# PostAD spinup (500 years), +# For BGC on, the sequence of simulations is AD spinup (300 years), +# PostAD spinup (100 years), # post spinup (the number of tower years with atmospheric forcing) # For BGC on, AD spinup is SPINUP_P1=TRUE, SPINUP_P2=FALSE # PostAD spinup is SPINUP_P1=TRUE, SPINUP_P2=TRUE # post spinup is SPINUP_P1=FALSE, SPINUP_P2=FALSE -#set BGC = "ON" -#setenv SPINUP_P1 "FALSE" -#setenv SPINUP_P2 "FALSE" + +if ($BGC == ON) then + setenv SPINUP_P1 "TRUE" + setenv SPINUP_P2 "TRUE" +endif # For BGC on, you could use these for either type of spinup (AD or PostAD) -#set newcase = spinADbgc -#set clonecase = spinPostADbgc +if ($BGC == ON) then + if ($SPINUP_P1 == TRUE) then + if ($model == clm5_0) then + set newcase = spinclm50conr12AD + set clonecase = spinclm50conr12pAD + else + if ($model == clm4_5) then + set newcase = spinclm45conr12AD + set clonecase = spinclm45conr12pAD + endif + endif + endif +endif + # For BGC on, you could use these for post spinup (the number of tower years with atmospheric forcing) -# You should change the "t111" for the clonecase to whatever tag you are using (e.g., t111 is used here to -# denote clm4_5_1_r111) and/or add some designation for your particular experiment with that tag (e.g., -# t111exp1wspinbgc) -#set newcase = spinPostADbgc -#set clonecase = t111wspinbgc +# You should change the "r12" for the clonecase to whatever tag you are using (e.g., r12 is used here to +# denote release-clm5.0.12) and/or add some designation for your particular experiment with that tag (e.g., +# conclm50r12wspinbgc) +if ($BGC == ON) then + if ($SPINUP_P1 == FALSE) then + if ($model == clm5_0) then + set newcase = spinclm50conr12pAD + set clonecase = conclm50r12wspinbgc + else + if ($model == clm4_5) then + set newcase = spinclm45conr12pAD + set clonecase = conclm45r12wspinbgc + endif + endif + endif +endif # USER MODS FOR BGC OFF # For BGC off, the sequence of simulations is normal spinup (32 years) # post spinup (the number of tower years with atmospheric forcing) -# For BGC off, normal spinup is SPINUP_P1=true, SPINUP_P2=false -# post spinup is SPINUP_P1=false, SPINUP_P2=false -set BGC = "OFF" -setenv SPINUP_P1 "FALSE" -setenv SPINUP_P2 "FALSE" +# For BGC off, normal spinup is SPINUP_P1=TRUE, SPINUP_P2=FALSE +# post spinup is SPINUP_P1=FALSE, SPINUP_P2=FALSE +if ($BGC == OFF) then + setenv SPINUP_P1 "FALSE" + setenv SPINUP_P2 "FALSE" +endif # For BGC off, use these for either normal spinup or post spinup -# You should change the "t111" for the clonecase to whatever tag you are using (e.g., t111 is used here to -# denote clm4_5_1_r111) and/or add some designation for your particular experiment with that tag (e.g., -# t111exp1wspinsp) -set newcase = spinsp -set clonecase = t111wspinsp +# You should change the "r12" for the clonecase to whatever tag you are using (e.g., r12 is used here to +# denote release-clm5.0.12) and/or add some designation for your particular experiment with that tag (e.g., +# conclm50r12wspinsp) +if ($BGC == OFF) then + if ($model == clm5_0) then + set newcase = spinclm50conr12sp + set clonecase = conclm50r12wspinsp + else + if ($model == clm4_5) then + set newcase = spinclm45conr12sp + set clonecase = conclm45r12wspinsp + endif + endif +endif # These sourcemods will be copied into every case directory (you will need to setup a # directory structure for your sourcemods, see instructions at top of script) -set sourcemods_dir = {$Clm_Tag_Dir}/components/clm/tools/shared/PTCLM/SourceMods/ -set sourcemods = $sourcemods_dir{$model}/BASE/*.F90 +set sourcemods_dir = {$Clm_Tag_Dir}/tools/PTCLM/SourceMods/ +echo $sourcemods_dir +set sourcemods = {$sourcemods_dir}{$model}/BASE/*.F90 +echo $sourcemods + +# Set some namelist options if required +# If you set any of these you will need to also set them below (search on namelist_opts) +#set namelist_opts1 = "paramfile='/glade/p/cgd/tss/people/oleson/modify_param/CLM5_SP_ens_dec_5D_mcalib_psi50BET3_BETKr9_Cropkrmax5e-10_calmbboptleafcn.nc'" +#set namelist_opts2 = "baseflow_scalar= 0.001d00" +# BGC +#set namelist_opts3 = "pot_hmn_ign_counts_alpha= 0.012d00" +#set namelist_opts4 = "cli_scale= 0.022d00" +#set namelist_opts5 = "boreal_peatfire_c= 0.2d-4" # =================================End User Mods================================ @@ -139,60 +190,65 @@ foreach mysite ( $sites ) cd {$Clm_Tag_Dir}/cime/scripts if ($SPINUP_P1 == FALSE) then set casename = ${clonecase}_${mysite}_$compset - ./create_clone -case $casename -clone ${newcase}_${mysite}_${compset} + ./create_clone --case $casename --clone ${newcase}_${mysite}_${compset} else if ($BGC == ON && $SPINUP_P2 == TRUE) then set casename = ${clonecase}_${mysite}_$compset echo $casename - ./create_clone -case $casename -clone ${newcase}_${mysite}_${compset} + ./create_clone --case $casename --clone ${newcase}_${mysite}_${compset} else set casename = ${newcase}_${mysite}_$compset - ./create_newcase -user_mods_dir {$User_Mods_Dir}/components/clm/tools/shared/PTCLM/mydatafiles/1x1pt_${mysite} -case $casename -mach yellowstone_intel -compset $compset -res CLM_USRDAT + ./create_newcase --user-mods-dir {$User_Mods_Dir}/tools/PTCLM/mydatafiles/1x1pt_${mysite} --case $casename --mach cheyenne --compset $compset --res CLM_USRDAT --project P93300041 --run-unsupported endif endif cd {$Clm_Tag_Dir}/cime/scripts/${casename} + ./xmlchange --id PIO_TYPENAME --val netcdf + ./xmlchange --id PIO_REARRANGER --val 1 if ($SPINUP_P1 == FALSE) then rm -f cesm.stderr* rm -f cesm.stdout* rm -f STATUS.out - ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears - ./xmlchange -file env_run.xml -id STOP_N -val $numyears - ./xmlchange -file env_run.xml -id RUN_STARTDATE -val $startyear[$cnt]-01-01 - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_ALIGN -val $startyear[$cnt] - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_START -val $startyear[$cnt] - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_END -val $endyear[$cnt] - ./xmlchange -file env_build.xml -id CALENDAR -val GREGORIAN + ./xmlchange --id STOP_OPTION --val nyears + ./xmlchange --id STOP_N --val $numyears + ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 + ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $startyear[$cnt] + ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyear[$cnt] + ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./xmlchange --id CALENDAR --val GREGORIAN if ($BGC == ON) then - ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup off" + ./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop" + ./xmlchange --id CLM_ACCELERATED_SPINUP --val "off" endif else if ($BGC == ON && $SPINUP_P2 == TRUE) then rm -f cesm.stderr* rm -f cesm.stdout* rm -f STATUS.out - ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears - ./xmlchange -file env_run.xml -id STOP_N -val 500 - ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup off" + ./xmlchange --id STOP_OPTION --val nyears + ./xmlchange --id STOP_N --val 100 + ./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop" + ./xmlchange --id CLM_ACCELERATED_SPINUP --val "off" else - ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears + ./xmlchange --id STOP_OPTION --val nyears if ($BGC == ON) then - ./xmlchange -file env_run.xml -id STOP_N -val 1000 + ./xmlchange --id STOP_N --val 300 else - ./xmlchange -file env_run.xml -id STOP_N -val 32 + ./xmlchange --id STOP_N --val 32 endif if ($alignyear == 1) then - ./xmlchange -file env_run.xml -id RUN_STARTDATE -val 000{$alignyear}-01-01 + ./xmlchange --id RUN_STARTDATE --val 000{$alignyear}-01-01 else - ./xmlchange -file env_run.xml -id RUN_STARTDATE -val $startyear[$cnt]-01-01 + ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 endif - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_ALIGN -val $alignyear - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_START -val $startyears - ./xmlchange -file env_run.xml -id DATM_CLMNCEP_YR_END -val $endyears + ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $alignyear + ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyears + ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyears if ($alignyear == 1) then - ./xmlchange -file env_build.xml -id CALENDAR -val NO_LEAP + ./xmlchange --id CALENDAR --val NO_LEAP endif if ($BGC == ON) then - ./xmlchange -file env_run.xml -id CLM_BLDNML_OPTS -val "-mask navy -bgc bgc -bgc_spinup on" + ./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop" + ./xmlchange --id CLM_ACCELERATED_SPINUP --val "on" endif endif endif @@ -201,7 +257,15 @@ foreach mysite ( $sites ) rm -f user_datm.streams.txt.CLM1PT.CLM_USRDAT endif endif - ./cesm_setup + ./xmlchange --id MAX_TASKS_PER_NODE --val 1 + ./xmlchange --id MAX_MPITASKS_PER_NODE --val 1 + ./case.setup + ./preview_namelists + # Have to force this for some reason + if ($SPINUP_P1 == FALSE) then + ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./preview_namelists + endif if ( $status != 0 )then echo "CESM_SETUP FAIL $status" >> ./STATUS.out exit -1 @@ -209,12 +273,20 @@ foreach mysite ( $sites ) echo "CESM_SETUP PASS" >> ./STATUS.out endif if ($SPINUP_P1 == TRUE && $BGC == ON) then - sed "/BSUB -R/d;s/BSUB -P P93300641/BSUB -P P93300041/g;s/BSUB -W 2:00/BSUB -W 23:59/g" ./${casename}.run > tmp.run + sed "/BSUB -R/d" ./.case.run > tmp.run + ./xmlchange --subgroup case.run --id JOB_WALLCLOCK_TIME --val 5:59 +# ./xmlchange --subgroup case.run --id JOB_QUEUE --val regular + ./xmlchange --subgroup case.run --id JOB_QUEUE --val share + ./xmlchange --subgroup case.run --id PROJECT --val P93300041 else - sed "/BSUB -R/d;s/BSUB -P P93300641/BSUB -P P93300041/g" ./${casename}.run > tmp.run + sed "/BSUB -R/d" ./.case.run > tmp.run +# ./xmlchange --subgroup case.run --id JOB_QUEUE --val regular + ./xmlchange --subgroup case.run --id JOB_WALLCLOCK_TIME --val 5:59 + ./xmlchange --subgroup case.run --id JOB_QUEUE --val share + ./xmlchange --subgroup case.run --id PROJECT --val P93300041 endif - mv tmp.run ./${casename}.run - chmod u+x ./${casename}.run + mv tmp.run ./.case.run + chmod u+x ./.case.run cp $sourcemods SourceMods/src.clm echo $mysite if ($mysite == BR-Sa1LBA || $mysite == BR-Sa3LBA || $mysite == BR-Ma1LBA || $mysite == BR-RJA || $mysite == BR-Ji1) then @@ -236,7 +308,11 @@ foreach mysite ( $sites ) if ($BGC == ON) then echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','GPP','NEE','ELAI','BTRAN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV'" >> tmp3.user_nl_clm else - echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','ELAI','BTRAN','FPSN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV'" >> tmp3.user_nl_clm + if ($model == clm5_0) then + echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','ELAI','BTRAN','FPSN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV','VEGWP'" >> tmp3.user_nl_clm + else + echo " hist_fincl2 = 'FSDS','FLDS','FSR','FSA','FIRE','FIRA','FSH','FCTR','FCEV','FGEV','FGR','FGR12','FSM','TSOI','COSZEN','RAIN','SNOW','H2OSOI','WA','ZWT','ELAI','BTRAN','FPSN','TV','RSSUN','RSSHA','FSH_G','RHAF','RH_LEAF','RH','T10','TG','SABG','SABV'" >> tmp3.user_nl_clm + endif endif set finidat=`ls -1 $rundata/${newcase}_${mysite}_${compset}/run/${newcase}_${mysite}_${compset}.clm?.r.*.nc | tail -1` echo $finidat @@ -249,20 +325,26 @@ foreach mysite ( $sites ) echo " finidat = '$finidat'" >> user_nl_clm else echo "taxmode = 'cycle','cycle'" >> user_nl_datm +# echo $namelist_opts1 >> user_nl_clm +# echo $namelist_opts2 >> user_nl_clm +# echo $namelist_opts3 >> user_nl_clm +# echo $namelist_opts4 >> user_nl_clm +# echo $namelist_opts5 >> user_nl_clm if ($BGC == ON) then sed "s/hist_mfilt = 1200/hist_mfilt = 12000/g" ./user_nl_clm > tmp.user_nl_clm + echo " hist_fincl1 = 'TOTECOSYSC', 'TOTECOSYSN', 'TOTSOMC', 'TOTSOMN', 'TOTVEGC', 'TOTVEGN', 'TLAI', 'GPP', 'CPOOL', 'NPP', 'TWS', 'FSH', 'FCTR', 'FCEV', 'FGEV', 'QRUNOFF', 'ZWT', 'NEE', 'NEP'" >> tmp.user_nl_clm mv tmp.user_nl_clm ./user_nl_clm endif endif endif - ./{$casename}.build + ./case.build if ( $status != 0 )then echo "BUILD FAIL $status" >> ./STATUS.out exit -1 else echo "BUILD PASS" >> ./STATUS.out endif - ./${casename}.submit + ./case.submit if ( $status != 0 )then echo "SUBMIT FAIL $status" >> ./STATUS.out exit -1 From bcb708ef78949619dc311d39643e67d07c9d8378 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 14:59:01 -0700 Subject: [PATCH 329/730] Rename to remove file extension from top level script names, so that you can change the underlying language the script is written in without changing the script name --- tools/contrib/README | 8 ++++---- .../{modify_singlept_site.py => modify_singlept_site} | 0 .../{run_clm_historical.csh => run_clm_historical} | 0 tools/contrib/{run_clmtowers.csh => run_clmtowers} | 0 tools/contrib/{singlept.py => singlept} | 0 tools/contrib/{subset_surfdata.py => subset_surfdata} | 0 6 files changed, 4 insertions(+), 4 deletions(-) rename tools/contrib/{modify_singlept_site.py => modify_singlept_site} (100%) rename tools/contrib/{run_clm_historical.csh => run_clm_historical} (100%) rename tools/contrib/{run_clmtowers.csh => run_clmtowers} (100%) rename tools/contrib/{singlept.py => singlept} (100%) rename tools/contrib/{subset_surfdata.py => subset_surfdata} (100%) diff --git a/tools/contrib/README b/tools/contrib/README index 1ca45a7203..1501c60ef9 100644 --- a/tools/contrib/README +++ b/tools/contrib/README @@ -8,17 +8,17 @@ tools. Brief description of scripts: -run_clm_historical.csh +run_clm_historical does all the setup and submission required to do a 1850-2010 CLM historical simulation in three separate submissions v1 - Andrew Slater+Dave Lawrence, 8/2015 -subset_surfdata.py +subset_surfdata create regional domain, surface data, and rtm directional files by extracting data from global datasets v1 - Sean Swenson 8/2015 -singlept.py +singlept create single point domain, surface data, and datm forcing files by extracting data from global datasets v1 - Sean Swenson 8/2015 @@ -27,7 +27,7 @@ SpinupStability.ncl This script assesses the equilibrium state of a spinup run works on either monthly or annual mean history files - Keith Oleson 7/2016 -run_clmtowers.v1.csh +run_clmtowers This script will run any number of flux tower sites. It's based on having created surface datasets with PTCLM. v1 - Keith Oleson, 8/2015 diff --git a/tools/contrib/modify_singlept_site.py b/tools/contrib/modify_singlept_site similarity index 100% rename from tools/contrib/modify_singlept_site.py rename to tools/contrib/modify_singlept_site diff --git a/tools/contrib/run_clm_historical.csh b/tools/contrib/run_clm_historical similarity index 100% rename from tools/contrib/run_clm_historical.csh rename to tools/contrib/run_clm_historical diff --git a/tools/contrib/run_clmtowers.csh b/tools/contrib/run_clmtowers similarity index 100% rename from tools/contrib/run_clmtowers.csh rename to tools/contrib/run_clmtowers diff --git a/tools/contrib/singlept.py b/tools/contrib/singlept similarity index 100% rename from tools/contrib/singlept.py rename to tools/contrib/singlept diff --git a/tools/contrib/subset_surfdata.py b/tools/contrib/subset_surfdata similarity index 100% rename from tools/contrib/subset_surfdata.py rename to tools/contrib/subset_surfdata From f74368fb5ea7b10977db6ac8501e9a55edcad942 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 25 Jan 2019 15:23:51 -0700 Subject: [PATCH 330/730] Use default version of contributed.ncl scripts, rather than @olysons local specific one, also set it up to run one of his cases by default so that it actually does something --- tools/contrib/SpinupStability.ncl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/contrib/SpinupStability.ncl b/tools/contrib/SpinupStability.ncl index abd512500c..bf5a28187a 100644 --- a/tools/contrib/SpinupStability.ncl +++ b/tools/contrib/SpinupStability.ncl @@ -6,7 +6,7 @@ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "~oleson/lnd_diag/run/contributed.ncl" +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" begin @@ -33,11 +33,11 @@ begin ;=======================================================================; ; GLOBAL EXAMPLE -; caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD" -; username = "oleson" -; annual_hist = True -; region = "Global" ; Global, Arctic, or SPT (single point) -; subper = 20 ; Subsampling period in years + caseid = "clm50_release-clm5.0.15_2deg_GSWP3V1_1850AD" + username = "oleson" + annual_hist = True + region = "Global" ; Global, Arctic, or SPT (single point) + subper = 20 ; Subsampling period in years ; SPT (single point) EXAMPLE ; caseid = "clm50_release-clm5.0.15_SPT_GSWP3V1_1850spin" From 6c6e162d807403cb28793137d9a691ca2a276dba Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 28 Jan 2019 13:03:43 -0700 Subject: [PATCH 331/730] Remove rcp, and make only ssp_rcp valid --- bld/CLMBuildNamelist.pm | 43 ++--- .../namelist_defaults_clm4_0.xml | 60 ------- .../namelist_defaults_clm4_5.xml | 155 +----------------- .../namelist_defaults_overall.xml | 2 +- .../namelist_defaults_usr_files.xml | 10 +- .../namelist_definition_clm4_0.xml | 10 +- .../namelist_definition_clm4_5.xml | 9 +- .../use_cases/1850-2100_rcp2.6_transient.xml | 60 ------- .../use_cases/1850-2100_rcp4.5_transient.xml | 59 ------- .../use_cases/1850-2100_rcp6_transient.xml | 61 ------- .../use_cases/1850-2100_rcp8.5_transient.xml | 59 ------- bld/unit_testers/build-namelist_test.pl | 28 ++-- 12 files changed, 52 insertions(+), 504 deletions(-) delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e1e394f15c..c7cda6598f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -206,9 +206,10 @@ OPTIONS -[no-]note Add note to output namelist [do NOT add note] about the arguments to build-namelist. -output_reals Output real parameters to the given output file. - -rcp "value" Representative concentration pathway (rcp) to use for + -ssp_rcp "value" Shared Socioeconomic Pathway (SSP) and + Representative Concentration Pathway (RCP) combination to use for future scenarios. - "-rcp list" to list valid rcp settings. + "-ssp_rcp list" to list valid ssp_rcp settings. -s Turns on silent mode - only fatal messages issued. -test Enable checking that input datasets exist on local filesystem. -use_case "case" Specify a use case which will provide default values. @@ -260,7 +261,7 @@ sub process_commandline { lnd_tuning_mode => "default", lnd_frac => undef, dir => "$cwd", - rcp => "default", + ssp_rcp => "default", sim_year => "default", clm_accelerated_spinup=> "default", chk_res => undef, @@ -313,7 +314,7 @@ sub process_commandline { "mask=s" => \$opts{'mask'}, "namelist=s" => \$opts{'namelist'}, "res=s" => \$opts{'res'}, - "rcp=s" => \$opts{'rcp'}, + "ssp_rcp=s" => \$opts{'ssp_rcp'}, "s|silent" => \$opts{'silent'}, "sim_year=s" => \$opts{'sim_year'}, "output_reals=s" => \$opts{'output_reals_filename'}, @@ -626,7 +627,7 @@ sub process_namelist_commandline_options { # # First get the command-line specified overall values or their defaults # Obtain default values for the following build-namelist input arguments - # : res, mask, rcp, sim_year, sim_year_range, and clm_accelerated_spinup. + # : res, mask, ssp_rcp, sim_year, sim_year_range, and clm_accelerated_spinup. # # NOTE: cfg only needs to be passed to functions that work with # clm4_0 compile time functionality! @@ -643,7 +644,7 @@ sub process_namelist_commandline_options { setup_cmdl_maxpft($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); setup_cmdl_glc_nec($opts, $nl_flags, $definition, $defaults, $nl); setup_cmdl_irrigation($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_cmdl_rcp($opts, $nl_flags, $definition, $defaults, $nl); + setup_cmdl_ssp_rcp($opts, $nl_flags, $definition, $defaults, $nl); setup_cmdl_simulation_year($opts, $nl_flags, $definition, $defaults, $nl); setup_cmdl_dynamic_vegetation($opts, $nl_flags, $definition, $defaults, $nl, $physv); setup_cmdl_fates_mode($opts, $nl_flags, $definition, $defaults, $nl, $physv); @@ -1114,26 +1115,26 @@ sub setup_cmdl_irrigation { #------------------------------------------------------------------------------- -sub setup_cmdl_rcp { - # representative concentration pathway +sub setup_cmdl_ssp_rcp { + # shared socioeconmic pathway and representative concentration pathway combination my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; my $val; - my $var = "rcp"; + my $var = "ssp_rcp"; if ( $opts->{$var} ne "default" ) { $val = $opts->{$var}; } else { $val = $defaults->get_value($var); } - $nl_flags->{'rcp'} = $val; - $opts->{'rcp'} = $nl_flags->{'rcp'}; + $nl_flags->{'ssp_rcp'} = $val; + $opts->{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; my $group = $definition->get_group_name($var); $nl->set_variable_value($group, $var, $val); if ( ! $definition->is_valid_value( $var, $val ) ) { my @valid_values = $definition->get_valid_values( $var ); $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); } - $log->verbose_message("CLM future scenario representative concentration is $nl_flags->{'rcp'}"); + $log->verbose_message("CLM future scenario SSP-RCP combination is $nl_flags->{'ssp_rcp'}"); } #------------------------------------------------------------------------------- @@ -1442,7 +1443,7 @@ sub process_namelist_commandline_clm_usr_name { my %settings; $settings{'mask'} = $nl_flags->{'mask'}; $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; + $settings{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; $settings{'clm_accelerated_spinup'} = $nl_flags->{'clm_accelerated_spinup'}; $settings{'clm_usr_name'} = $opts->{'clm_usr_name'}; @@ -1489,7 +1490,7 @@ sub process_namelist_commandline_use_case { my %settings; $settings{'res'} = $nl_flags->{'res'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; + $settings{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; $settings{'mask'} = $nl_flags->{'mask'}; $settings{'sim_year'} = $nl_flags->{'sim_year'}; $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; @@ -2235,7 +2236,7 @@ sub setup_logic_demand { $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; $settings{'mask'} = $nl_flags->{'mask'}; $settings{'crop'} = $nl_flags->{'crop'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; + $settings{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; $settings{'glc_nec'} = $nl_flags->{'glc_nec'}; if ( $physv->as_long() >= $physv->as_long("clm4_5")) { # necessary for demand to be set correctly (flanduse_timeseries requires @@ -3210,7 +3211,7 @@ sub setup_logic_nitrogen_deposition { } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'}, - 'bgc'=>$nl_flags->{'bgc_mode'}, 'rcp'=>$nl_flags->{'rcp'}, + 'bgc'=>$nl_flags->{'bgc_mode'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'hgrid'=>"1.9x2.5" ); } elsif ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) { @@ -4193,10 +4194,10 @@ sub check_use_case_name { my $diestring = "bad use_case name $use_case, follow the conventions " . "in namelist_files/use_cases/README\n"; my $desc = "[a-zA-Z0-9]*"; - my $rcp = "rcp[0-9\.]+"; + my $ssp_rcp = "SSP[0-9]-[0-9\.]+"; if ( $use_case =~ /^[0-9]+-[0-9]+([a-zA-Z0-9_\.]*)_transient$/ ) { my $string = $1; - if ( $string =~ /^_($rcp)_*($desc)$/ ) { + if ( $string =~ /^_($ssp_rcp)_*($desc)$/ ) { # valid name } elsif ( $string =~ /^_*($desc)$/ ) { # valid name @@ -4205,7 +4206,7 @@ sub check_use_case_name { } } elsif ( $use_case =~ /^20thC([a-zA-Z0-9_\.]*)_transient$/ ) { my $string = $1; - if ( $string =~ /^_($rcp)_*($desc)$/ ) { + if ( $string =~ /^_($ssp_rcp)_*($desc)$/ ) { # valid name } elsif ( $string =~ /^_*($desc)$/ ) { # valid name @@ -4281,9 +4282,9 @@ sub list_options { my ($opts_cmdl, $definition, $defaults) = @_; # options to list values that are in the defaults files - my @opts_list = ( "res", "mask", "sim_year", "rcp" ); + my @opts_list = ( "res", "mask", "sim_year", "ssp_rcp" ); my %opts_local; - foreach my $var ( "res", "mask", "sim_year", "rcp" ) { + foreach my $var ( "res", "mask", "sim_year", "ssp_rcp" ) { my $val; if ( $opts_cmdl->{$var} eq "list" ) { $val = "default"; diff --git a/bld/namelist_files/namelist_defaults_clm4_0.xml b/bld/namelist_files/namelist_defaults_clm4_0.xml index 3dc98acb75..4e9ddb10c9 100644 --- a/bld/namelist_files/namelist_defaults_clm4_0.xml +++ b/bld/namelist_files/namelist_defaults_clm4_0.xml @@ -400,58 +400,6 @@ lnd/clm2/surfdata_map/surfdata_ne240np4_simyr1850_c130313.nc lnd/clm2/surfdata_map/surfdata.pftdyn_ne60np4_hist_simyr1850-2005_c120907.nc lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_hist_simyr1850-2005_c130313.nc - - - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp2.6_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp2.6_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp2.6_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp4.5_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp4.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp4.5_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp6.0_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp6.0_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp6.0_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp8.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp8.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp8.5_simyr1850-2100_glcmec10_c120928.nc - - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp8.5_simyr1850-2100_c120224.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp8.5_simyr1850-2100_c130702.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp8.5_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp8.5_simyr1850-2100_c130311.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp6.0_simyr1850-2100_c120223.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp6.0_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp6.0_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp6.0_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp6.0_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp6.0_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp6.0_simyr1850-2100_c130313.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp4.5_simyr1850-2100_c120217.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp4.5_simyr1850-2100_c100406.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp4.5_simyr1850-2100_c100322.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp4.5_simyr1850-2100_c100322.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp4.5_simyr1850-2100_c120123.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp4.5_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp4.5_simyr1850-2100_c130313.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp2.6_simyr1850-2100_c120215.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp2.6_simyr1850-2100_c100323.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp2.6_simyr1850-2100_c100322.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp2.6_simyr1850-2100_c100322.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp2.6_simyr1850-2100_c120123.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp2.6_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp2.6_simyr1850-2100_c130313.nc - glc/cism/griddata/glcmaskdata_48x96_gland_c141105.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc .true. @@ -1107,13 +964,17 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr1850_c181003.ncNDEP_year lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc +lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc +lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc cycle diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index 20158c7dd4..4ea8fa4f39 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -52,7 +52,7 @@ determine default values for namelists. 0 --999.9 +hist .false. diff --git a/bld/namelist_files/namelist_defaults_usr_files.xml b/bld/namelist_files/namelist_defaults_usr_files.xml index 14ba49de23..41e6dcd47b 100644 --- a/bld/namelist_files/namelist_defaults_usr_files.xml +++ b/bld/namelist_files/namelist_defaults_usr_files.xml @@ -27,10 +27,10 @@ provided they are in the valid list expressed above. lnd/clm2/surfdata_map/surfdata_${clm_usr_name}_simyr${sim_year}.nc -null -lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr${sim_year_range}.nc -lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr1849-2006.nc -lnd/clm2/surfdata/landuse.timeseries_rcp${rcp}_${clm_usr_name}_simyr${sim_year_range}.nc -lnd/clm2/surfdata/landuse.timeseries_rcp${rcp}_${clm_usr_name}_simyr1849-2006.nc +null +lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr${sim_year_range}.nc +lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr1849-2006.nc +lnd/clm2/surfdata/landuse.timeseries_${ssp_rcp}_${clm_usr_name}_simyr${sim_year_range}.nc +lnd/clm2/surfdata/landuse.timeseries_${ssp_rcp}_${clm_usr_name}_simyr1849-2006.nc diff --git a/bld/namelist_files/namelist_definition_clm4_0.xml b/bld/namelist_files/namelist_definition_clm4_0.xml index 2aa49b23b4..9aec275fc7 100644 --- a/bld/namelist_files/namelist_definition_clm4_0.xml +++ b/bld/namelist_files/namelist_definition_clm4_0.xml @@ -673,13 +673,6 @@ Horizontal resolutions Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools - -Representative concentration pathway for future scenarios [radiative forcing at peak or 2100 in W/m^2] --999.9 means do NOT use a future scenario, just use historical data. - - @@ -717,10 +710,9 @@ If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) +"1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1955,1965,1975,1985,1995,2000,2005"> Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year greater than 2005 corresponds to rcp scenario data Most years are only used for clm_tools and there aren't CLM datasets that correspond to them. CLM datasets exist for years: 1000 (for testing), 1850, and 2000 diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 23a393494b..7171e58bc6 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1781,13 +1781,6 @@ Horizontal resolutions Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools - -Representative concentration pathway for future scenarios [radiative forcing at peak or 2100 in W/m^2] --999.9 means do NOT use a future scenario, just use historical data. - - @@ -1823,7 +1816,7 @@ If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) "PtVg,1000,850,1100,1350,1600,1850,1855,1865,1875,1885,1895,1905,1915,1925,1935,1945,1955,1965,1975,1980,1985,1995,2000,2005,2010,2015,2025,2035,2045,2055,2065,2075,2085,2095,2105"> Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year greater than 2015 corresponds to rcp scenario data +A sim_year greater than 2015 corresponds to ssp_rcp scenario data A sim_year of PtVg refers to the Potential Vegetation dataset, that doesn't include human influences Most years are only used for clm_tools and there aren't CLM datasets that correspond to them. CLM datasets exist for years: 1000 (for testing), 1850, and 2000 diff --git a/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml deleted file mode 100644 index ce2a23e26d..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - - -1850 - -1850-2100 - -2.6 - -flanduse_timeseries - -.true. -.false. -.false. - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml deleted file mode 100644 index 6bc4d67d1d..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - - -1850 - -1850-2100 - -4.5 - -flanduse_timeseries - -arb_ic - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml deleted file mode 100644 index 73d5f5334f..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -1850 - -1850-2100 - -6 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml deleted file mode 100644 index 4d854cad2c..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -1850 - -1850-2100 - -8.5 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2d158639be..ba7ed7da6a 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -195,7 +195,7 @@ sub make_env_run { $cfiles->copyfiles( "default", $mode ); &cleanup(); # Simple test -- run all the list options -foreach my $options ( "clm_demand", "rcp", "res", +foreach my $options ( "clm_demand", "ssp_rcp", "res", "sim_year", "use_case" ) { &make_env_run(); eval{ system( "$bldnml -${options} list > $tempfile 2>&1 " ); }; @@ -218,7 +218,7 @@ sub make_env_run { # Exercise a bunch of options my $options = "-co2_ppmv 250 "; - $options .= " -res 0.9x1.25 -rcp 2.6 -envxml_dir ."; + $options .= " -res 0.9x1.25 -ssp_rcp SSP-2.6 -envxml_dir ."; &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; @@ -269,12 +269,12 @@ sub make_env_run { system( "../configure -s $mode" ); print "\n===============================================================================\n"; -print "Test irrig, verbose, clm_demand, rcp, test, sim_year, use_case, l_ncpl\n"; +print "Test irrig, verbose, clm_demand, ssp_rcp, test, sim_year, use_case, l_ncpl\n"; print "=================================================================================\n"; -# irrig, verbose, clm_demand, rcp, test, sim_year, use_case, l_ncpl +# irrig, verbose, clm_demand, ssp_rcp, test, sim_year, use_case, l_ncpl my $startfile = "clmrun.clm2.r.1964-05-27-00000.nc"; -foreach my $options ( "-namelist '&a irrigate=.true./'", "-verbose", "-rcp 2.6", "-test", "-sim_year 1850", +foreach my $options ( "-namelist '&a irrigate=.true./'", "-verbose", "-ssp_rcp SSP2-2.6", "-test", "-sim_year 1850", "-use_case 1850_control", "-l_ncpl 1", "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", "-envxml_dir . -infile myuser_nl_clm", @@ -311,11 +311,11 @@ sub make_env_run { $mode = "-phys clm5_0"; system( "../configure -s $mode" ); foreach my $options ( - "-bgc bgc -use_case 1850-2100_rcp2.6_transient -namelist '&a start_ymd=20100101/'", - "-bgc sp -use_case 1850-2100_rcp4.5_transient -namelist '&a start_ymd=18501223/'", - "-bgc bgc -use_case 1850-2100_rcp6_transient -namelist '&a start_ymd=20701029/'", + "-bgc bgc -use_case 1850-2100_SSP1-2.6_transient -namelist '&a start_ymd=20100101/'", + "-bgc sp -use_case 1850-2100_SSP2-4.5_transient -namelist '&a start_ymd=18501223/'", + "-bgc bgc -use_case 1850-2100_SSP4-6.0_transient -namelist '&a start_ymd=20701029/'", "-bgc fates -use_case 2000_control -no-megan", - "-bgc cn -use_case 1850-2100_rcp8.5_transient -namelist '&a start_ymd=19201023/'", + "-bgc cn -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19201023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", ) { my $file = $startfile; @@ -1224,10 +1224,10 @@ sub make_env_run { $mode = "-phys clm4_5"; system( "../configure -s $mode" ); my @glc_res = ( "48x96", "0.9x1.25", "1.9x2.5" ); -my @use_cases = ( "1850-2100_rcp2.6_transient", - "1850-2100_rcp4.5_transient", - "1850-2100_rcp6_transient", - "1850-2100_rcp8.5_transient", +my @use_cases = ( "1850-2100_SSP1-2.6_transient", + "1850-2100_SSP3-4.5_transient", + "1850-2100_SSP4-6.0_transient", + "1850-2100_SSP5-8.5_transient", "1850_control", "2000_control", "2010_control", @@ -1274,7 +1274,7 @@ sub make_env_run { } &cleanup(); } -# Transient rcp scenarios +# Transient ssp_rcp scenarios $mode = "-phys clm5_0"; system( "../configure -s $mode" ); my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "10x15" ); From 386c49ac17003ab0289ace1c4e618a4c4cbd95e0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 28 Jan 2019 16:40:34 -0700 Subject: [PATCH 332/730] Add last millenium files, and get mksurfdata.pl to work for 850-1100 sim_year range --- bld/namelist_files/createMkSrfEntry.py | 12 +- .../namelist_defaults_clm4_5_tools.xml | 4002 +++++++++++++++++ tools/mksurfdata_map/mksurfdata.pl | 2 +- 3 files changed, 4009 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/createMkSrfEntry.py b/bld/namelist_files/createMkSrfEntry.py index 462173cd9c..b76e83af4d 100755 --- a/bld/namelist_files/createMkSrfEntry.py +++ b/bld/namelist_files/createMkSrfEntry.py @@ -5,12 +5,12 @@ class mksrfDataEntry_prog: # Class data - year_start = 2016 - year_end = 2100 - ssp_rcp = "SSP4-6.0" - subdir = "pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2016-2100.c181217" - cdate = 181217 - desc = "SSP4RCP60_clm5" + year_start = 850 + year_end = 1849 + ssp_rcp = "hist" + subdir = "pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012" + cdate = 171012 + desc = "histclm50_LUH2" def parse_cmdline_args( self ): "Parse the command line arguments for create data entry list" diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index b6c6ad64fc..329e9b1c7b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -292,6 +292,4008 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_850.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_851.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_852.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_853.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_854.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_855.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_856.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_857.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_858.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_859.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_860.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_861.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_862.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_863.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_864.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_865.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_866.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_867.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_868.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_869.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_870.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_871.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_872.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_873.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_874.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_875.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_876.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_877.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_878.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_879.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_880.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_881.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_882.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_883.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_884.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_885.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_886.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_887.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_888.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_889.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_890.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_891.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_892.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_893.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_894.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_895.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_896.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_897.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_898.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_899.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_900.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_901.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_902.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_903.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_904.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_905.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_906.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_907.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_908.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_909.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_910.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_911.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_912.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_913.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_914.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_915.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_916.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_917.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_918.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_919.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_920.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_921.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_922.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_923.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_924.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_925.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_926.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_927.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_928.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_929.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_930.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_931.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_932.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_933.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_934.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_935.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_936.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_937.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_938.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_939.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_940.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_941.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_942.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_943.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_944.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_945.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_946.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_947.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_948.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_949.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_950.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_951.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_952.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_953.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_954.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_955.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_956.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_957.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_958.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_959.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_960.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_961.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_962.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_963.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_964.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_965.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_966.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_967.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_968.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_969.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_970.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_971.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_972.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_973.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_974.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_975.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_976.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_977.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_978.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_979.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_980.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_981.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_982.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_983.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_984.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_985.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_986.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_987.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_988.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_989.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_990.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_991.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_992.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_993.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_994.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_995.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_996.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_997.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_998.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_999.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1000.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1001.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1002.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1003.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1004.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1005.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1006.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1007.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1008.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1009.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1010.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1011.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1012.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1013.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1014.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1015.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1016.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1017.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1018.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1019.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1020.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1021.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1022.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1023.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1024.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1025.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1026.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1027.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1028.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1029.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1030.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1031.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1032.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1033.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1034.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1035.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1036.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1037.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1038.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1039.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1040.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1041.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1042.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1043.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1044.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1045.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1046.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1047.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1048.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1049.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1050.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1051.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1052.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1053.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1054.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1055.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1056.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1057.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1058.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1059.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1060.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1061.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1062.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1063.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1064.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1065.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1066.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1067.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1068.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1069.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1070.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1071.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1072.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1073.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1074.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1075.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1076.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1077.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1078.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1079.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1080.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1081.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1082.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1083.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1084.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1085.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1086.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1087.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1088.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1089.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1090.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1091.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1092.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1093.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1094.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1095.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1096.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1097.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1098.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1099.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1100.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1101.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1102.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1103.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1104.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1105.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1106.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1107.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1108.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1109.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1110.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1111.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1112.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1113.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1114.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1115.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1116.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1117.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1118.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1119.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1120.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1121.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1122.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1123.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1124.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1125.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1126.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1127.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1128.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1129.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1130.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1131.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1132.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1133.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1134.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1135.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1136.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1137.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1138.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1139.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1140.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1141.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1142.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1143.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1144.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1145.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1146.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1147.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1148.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1149.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1150.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1151.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1152.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1153.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1154.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1155.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1156.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1157.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1158.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1159.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1160.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1161.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1162.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1163.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1164.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1165.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1166.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1167.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1168.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1169.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1170.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1171.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1172.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1173.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1174.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1175.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1176.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1177.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1178.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1179.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1180.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1181.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1182.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1183.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1184.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1185.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1186.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1187.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1188.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1189.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1190.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1191.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1192.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1193.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1194.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1195.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1196.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1197.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1198.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1199.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1200.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1201.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1202.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1203.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1204.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1205.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1206.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1207.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1208.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1209.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1210.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1211.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1212.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1213.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1214.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1215.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1216.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1217.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1218.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1219.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1220.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1221.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1222.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1223.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1224.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1225.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1226.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1227.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1228.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1229.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1230.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1231.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1232.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1233.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1234.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1235.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1236.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1237.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1238.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1239.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1240.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1241.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1242.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1243.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1244.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1245.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1246.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1247.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1248.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1249.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1250.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1251.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1252.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1253.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1254.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1255.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1256.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1257.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1258.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1259.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1260.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1261.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1262.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1263.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1264.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1265.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1266.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1267.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1268.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1269.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1270.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1271.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1272.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1273.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1274.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1275.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1276.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1277.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1278.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1279.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1280.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1281.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1282.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1283.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1284.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1285.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1286.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1287.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1288.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1289.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1290.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1291.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1292.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1293.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1294.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1295.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1296.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1297.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1298.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1299.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1300.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1301.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1302.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1303.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1304.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1305.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1306.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1307.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1308.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1309.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1310.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1311.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1312.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1313.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1314.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1315.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1316.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1317.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1318.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1319.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1320.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1321.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1322.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1323.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1324.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1325.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1326.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1327.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1328.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1329.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1330.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1331.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1332.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1333.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1334.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1335.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1336.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1337.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1338.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1339.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1340.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1341.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1342.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1343.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1344.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1345.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1346.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1347.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1348.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1349.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1350.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1351.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1352.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1353.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1354.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1355.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1356.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1357.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1358.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1359.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1360.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1361.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1362.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1363.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1364.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1365.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1366.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1367.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1368.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1369.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1370.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1371.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1372.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1373.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1374.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1375.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1376.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1377.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1378.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1379.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1380.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1381.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1382.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1383.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1384.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1385.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1386.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1387.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1388.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1389.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1390.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1391.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1392.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1393.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1394.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1395.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1396.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1397.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1398.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1399.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1400.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1401.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1402.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1403.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1404.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1405.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1406.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1407.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1408.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1409.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1410.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1411.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1412.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1413.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1414.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1415.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1416.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1417.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1418.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1419.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1420.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1421.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1422.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1423.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1424.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1425.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1426.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1427.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1428.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1429.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1430.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1431.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1432.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1433.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1434.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1435.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1436.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1437.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1438.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1439.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1440.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1441.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1442.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1443.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1444.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1445.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1446.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1447.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1448.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1449.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1450.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1451.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1452.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1453.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1454.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1455.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1456.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1457.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1458.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1459.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1460.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1461.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1462.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1463.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1464.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1465.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1466.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1467.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1468.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1469.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1470.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1471.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1472.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1473.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1474.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1475.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1476.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1477.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1478.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1479.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1480.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1481.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1482.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1483.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1484.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1485.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1486.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1487.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1488.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1489.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1490.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1491.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1492.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1493.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1494.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1495.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1496.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1497.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1498.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1499.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1500.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1501.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1502.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1503.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1504.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1505.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1506.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1507.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1508.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1509.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1510.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1511.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1512.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1513.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1514.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1515.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1516.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1517.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1518.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1519.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1520.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1521.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1522.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1523.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1524.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1525.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1526.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1527.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1528.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1529.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1530.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1531.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1532.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1533.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1534.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1535.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1536.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1537.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1538.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1539.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1540.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1541.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1542.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1543.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1544.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1545.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1546.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1547.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1548.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1549.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1550.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1551.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1552.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1553.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1554.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1555.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1556.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1557.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1558.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1559.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1560.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1561.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1562.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1563.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1564.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1565.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1566.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1567.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1568.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1569.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1570.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1571.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1572.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1573.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1574.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1575.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1576.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1577.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1578.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1579.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1580.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1581.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1582.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1583.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1584.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1585.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1586.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1587.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1588.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1589.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1590.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1591.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1592.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1593.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1594.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1595.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1596.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1597.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1598.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1599.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1600.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1601.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1602.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1603.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1604.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1605.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1606.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1607.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1608.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1609.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1610.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1611.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1612.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1613.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1614.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1615.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1616.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1617.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1618.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1619.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1620.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1621.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1622.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1623.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1624.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1625.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1626.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1627.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1628.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1629.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1630.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1631.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1632.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1633.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1634.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1635.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1636.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1637.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1638.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1639.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1640.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1641.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1642.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1643.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1644.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1645.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1646.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1647.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1648.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1649.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1650.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1651.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1652.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1653.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1654.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1655.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1656.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1657.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1658.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1659.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1660.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1661.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1662.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1663.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1664.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1665.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1666.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1667.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1668.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1669.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1670.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1671.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1672.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1673.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1674.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1675.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1676.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1677.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1678.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1679.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1680.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1681.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1682.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1683.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1684.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1685.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1686.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1687.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1688.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1689.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1690.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1691.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1692.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1693.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1694.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1695.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1696.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1697.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1698.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1699.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1700.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1701.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1702.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1703.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1704.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1705.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1706.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1707.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1708.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1709.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1710.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1711.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1712.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1713.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1714.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1715.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1716.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1717.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1718.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1719.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1720.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1721.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1722.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1723.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1724.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1725.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1726.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1727.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1728.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1729.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1730.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1731.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1732.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1733.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1734.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1735.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1736.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1737.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1738.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1739.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1740.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1741.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1742.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1743.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1744.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1745.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1746.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1747.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1748.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1749.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1750.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1751.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1752.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1753.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1754.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1755.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1756.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1757.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1758.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1759.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1760.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1761.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1762.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1763.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1764.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1765.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1766.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1767.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1768.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1769.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1770.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1771.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1772.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1773.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1774.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1775.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1776.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1777.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1778.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1779.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1780.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1781.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1782.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1783.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1784.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1785.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1786.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1787.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1788.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1789.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1790.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1791.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1792.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1793.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1794.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1795.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1796.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1797.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1798.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1799.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1800.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1801.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1802.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1803.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1804.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1805.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1806.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1807.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1808.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1809.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1810.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1811.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1812.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1813.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1814.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1815.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1816.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1817.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1818.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1819.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1820.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1821.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1822.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1823.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1824.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1825.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1826.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1827.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1828.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1829.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1830.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1831.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1832.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1833.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1834.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1835.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1836.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1837.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1838.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1839.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1840.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1841.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1842.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1843.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1844.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1845.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1846.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1847.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1848.c171012.nc + + +lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_1849.c171012.nc + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1850.c170629.nc diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index deac02ae7c..4a4addfdb4 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -511,7 +511,7 @@ sub write_namelist_file { my @years = split( ",", $opts{'years'} ); # Check that resolutions are valid foreach my $sim_year ( @years ) { - if ("-" eq substr($sim_year, 4, 1)) { + if ( ("-" eq substr($sim_year, 4, 1)) || ("-" eq substr($sim_year, 3, 1)) ) { # range of years for transient run if ( ! $definition->is_valid_value( "sim_year_range", "'$sim_year'" ) ) { print "** Invalid simulation simulation year range: $sim_year\n"; From a97c12b74dba480e87a3349acd557c7015a6817e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Jan 2019 13:23:06 -0700 Subject: [PATCH 333/730] Add a Success message at the end, and add a check that the directory exists --- tools/contrib/SpinupStability.ncl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/contrib/SpinupStability.ncl b/tools/contrib/SpinupStability.ncl index bf5a28187a..9f0eb30302 100644 --- a/tools/contrib/SpinupStability.ncl +++ b/tools/contrib/SpinupStability.ncl @@ -51,6 +51,11 @@ begin ;=======================================================================; data_dir = "/glade/scratch/"+username+"/archive/"+caseid+"/lnd/hist/" + if ( systemfunc("test -d "+data_dir+"; echo $?" ) .ne. 0 )then + print( "Input directory does not exist or not found: "+data_dir ); + print( "Make sure username and caseid and base directory is set correctly" ) + status_exit( -1 ) + end if ; Thresholds if (region .eq. "SPT") then @@ -781,5 +786,6 @@ begin print ("=========================================") print ("Finish Time: "+systemfunc("date") ) print ("=========================================") + print ("Successfully ran the script") end From 5c50424651d8a5a614e76cb90c18bdebb94eb552 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Jan 2019 13:27:24 -0700 Subject: [PATCH 334/730] Setup for Harvard Forest as for tutorial, add a function to add a tag to the filename, add some more diagnostic printing, update README with modules that need to be run, test for existance of directory and make it if not --- tools/contrib/README | 8 ++++- tools/contrib/singlept | 77 +++++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 21 deletions(-) diff --git a/tools/contrib/README b/tools/contrib/README index 1501c60ef9..c8338a1a8e 100644 --- a/tools/contrib/README +++ b/tools/contrib/README @@ -3,8 +3,14 @@ $CTSMROOT/tools/contrib/README The purpose of this directory is for users of CTSM to contribute scripts for pre or post processing or case management of CTSM that others might find useful. The script should have some documentation made available before adding it. These scripts may not be as well tested or supported as other CTSM -tools. +tools. They are also ONLY assumed to work on the NCAR supercomputer. So paths will be hardwired to +assume NCAR directory structures. +The python scripts require the following settings before running on cheyenne: +(Currently that's the singlept and subset_surfdata scripts) + +module load python/2.7.14 +ncar_pylib Brief description of scripts: diff --git a/tools/contrib/singlept b/tools/contrib/singlept index 4b4d6b0b46..380ef05c7d 100755 --- a/tools/contrib/singlept +++ b/tools/contrib/singlept @@ -1,4 +1,10 @@ #! /usr/bin/env python +# +# singlept +# +# Script to extract a single grid point from global datasets +# + # Import libraries import sys import os @@ -8,17 +14,37 @@ import subprocess import numpy as np import xarray as xr +def error( desc ): + "error function" + mprint( "ERROR:: "+desc ) + os.abort() + def mprint(mstr): + "Print function whether python-2 or python-3" + # six.py or import __future__ print_function could be used instead... vnum=sys.version_info[0] if vnum == 3: print(mstr) if vnum == 2: print mstr + +def AddTagToFilename(filename, tag): + "Add a tag to a filename" + # Expects file to end with [._]cYYMMDD.nc or [._]YYMMDD.nc + # Add the tag to just before that ending part + basename = os.path.basename(filename) + cend = -10 + if ( basename[cend] == "c" ): + cend = cend - 1 + if ( (basename[cend] != ".") and (basename[cend] != "_") ): + error( "Trouble figuring out where to add tag to filename:"+filename ) + return( basename[:cend]+"_"+tag+basename[cend:] ) +mprint( "singlept script to extract out a single point from the global CTSM inputdata datasets\n" ) myname=getuser() pwd=os.getcwd() -mprint(myname) -mprint(pwd) +mprint("User = "+myname) +mprint("Current directory = "+pwd+"\n") ''' #------------------------------------------------------------------# @@ -61,16 +87,18 @@ models SROF and SGLC) # Set control flags +#-- Setup by default to run for Harvard Forest + #-- Specify point to extract -plon = 300.0 -plat = -5.0 +plon = 287.8 +plat = 42.5 #-- Create regional CLM domain file -create_domain = False +create_domain = True #-- Create CLM surface data file create_surfdata = True #-- Create CLM surface data file -create_landuse = False +create_landuse = True #-- Create single point DATM atmospheric forcing data create_datm = False datm_syr=1901 @@ -78,15 +106,21 @@ datm_eyr=2014 #-- Modify landunit structure overwrite_single_pft = True -dominant_pft = 4 #BETr +dominant_pft = 7 #BETr zero_nonveg_pfts = True -uniform_snowpack = False -no_saturation_excess = False +uniform_snowpack = True +no_saturation_excess = True #-- Specify input and output directories dir_output='/glade/scratch/'+myname+'/single_point/' -dir_input_datm='/glade/p/cgd/tss/CTSM_datm_forcing_data/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' +if ( not os.path.isdir( dir_output ) ): + os.mkdir( dir_output ) +dir_inputdata='/glade/p/cesmdata/cseg/inputdata/' +dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data' +dir_input_datm=dir_clm_forcedata+'/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' dir_output_datm=dir_output + 'datmdata/' +if ( not os.path.isdir( dir_output_datm ) ): + os.mkdir( dir_output_datm ) #-- Set input and output filenames tag=str(plon)+'_'+str(plat) @@ -98,25 +132,24 @@ x=x2.communicate() timetag = x[0].strip() #-- Specify land domain file --------------------------------- -fdomain = '/glade/p/cesmdata/cseg/inputdata/share/domains/domain.lnd.fv1.9x2.5_gx1v7.170518.nc' -#fdomain2 = dir_output + 'domain.lnd.fv0.9x1.25_gx1v6.'+tag+'.090309.nc' -fdomain2 = dir_output + 'domain.lnd.fv1.9x2.5_gx1v7.'+tag+'_170518.nc' +fdomain = dir_inputdata+'share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc' +fdomain2 = dir_output + AddTagToFilename( fdomain, tag ) #-- Specify surface data file -------------------------------- -fsurf = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc' -#fsurf2 = dir_output + 'surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_'+tag+'.c170706.nc' -fsurf2 = dir_output + 'surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_'+tag+'_c170824.nc' +fsurf = dir_inputdata+'lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_CMIP6_simyr1850_c170706.nc' +fsurf2 = dir_output + AddTagToFilename( fsurf, tag ) #-- Specify landuse file ------------------------------------- -fluse = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc' -fluse2 = dir_output + 'landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_'+tag+'.c170824.nc' +fluse = dir_inputdata+'lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc' +fluse2 = dir_output + AddTagToFilename( fluse, tag ) #-- Specify datm domain file --------------------------------- -fdatmdomain = '/glade/p/cgd/tss/CTSM_datm_forcing_data/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc' -fdatmdomain2 = dir_output_datm+'domain.lnd.360x720_gswp3.0v1.'+tag+'_c170606.nc' +fdatmdomain = dir_clm_forcedata+'atm_forcing.datm7.GSWP3.0.5d.v1.c170516/domain.lnd.360x720_gswp3.0v1.c170606.nc' +fdatmdomain2 = dir_output_datm+AddTagToFilename( fdatmdomain, tag ) #-- Create CTSM domain file if create_domain: + mprint( "Open: "+fdomain ) f1 = xr.open_dataset(fdomain) # create 1d coordinate variables to enable sel() method lon0=np.asarray(f1['xc'][0,:]) @@ -142,6 +175,7 @@ if create_domain: #-- Create CTSM surface data file if create_surfdata: + mprint( "Open: "+fsurf ) f1 = xr.open_dataset(fsurf) # create 1d variables lon0=np.asarray(f1['LONGXY'][0,:]) @@ -205,6 +239,7 @@ if create_surfdata: ''' #-- Create CTSM transient landuse data file if create_landuse: + mprint( "Open: "+fluse ) f1 = xr.open_dataset(fluse) # create 1d variables lon0=np.asarray(f1['LONGXY'][0,:]) @@ -242,6 +277,7 @@ if create_landuse: #-- Create single point atmospheric forcing data if create_datm: #-- create datm domain file + mprint( "Open: "+fdatmdomain ) f1 = xr.open_dataset(fdatmdomain) # create 1d coordinate variables to enable sel() method lon0=np.asarray(f1['xc'][0,:]) @@ -327,3 +363,4 @@ if create_datm: mprint('datm files written to: '+dir_output_datm) +mprint( "\nSuccessfully ran script\n\n" ) From 26b274caeb964b76710ea3bbc1ed874f03076ebc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Jan 2019 13:48:52 -0700 Subject: [PATCH 335/730] Get it to work with more generic paths, use relatives paths for tools --- tools/contrib/modify_singlept_site | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tools/contrib/modify_singlept_site b/tools/contrib/modify_singlept_site index 112f16a40e..4345109ca4 100755 --- a/tools/contrib/modify_singlept_site +++ b/tools/contrib/modify_singlept_site @@ -2,6 +2,7 @@ import sys import string import subprocess +from getpass import getuser import numpy as np import netCDF4 as netcdf4 import xarray as xr @@ -22,23 +23,21 @@ surface data file, use this script to overwrite some fields with site-specific data. ''' +myname = getuser() #-- Create single point CLM surface data file create_surfdata = True #-- specify site from which to extract data ---------- -#sitename='US-ARM' -sitename='US-Ho1' sitename='US-Ha1' #-- Site level data directory ------------------------ -site_dir='/glade/work/swensosc/ctsm_code/ctsm/tools/PTCLM/PTCLM_sitedata/' +site_dir='../PTCLM/PTCLM_sitedata/' #-- Specify original file -fsurf = '/glade/scratch/swensosc/sfcdata/surfdata_0.9x1.25_16pfts_CMIP6_simyr2000_US-Ho1.c190117.nc' -fsurf = '/glade/scratch/wwieder/single_point/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr1850_287.8_42.5_c230119.nc' +fsurf = '/glade/scratch/'+myname+'/single_point/surfdata_0.9x1.25_16pfts_CMIP6_simyr1850_287.8_42.5_c170706.nc' #-- Output directory --------------------------------- -dir_output='/glade/scratch/swensosc/sfcdata/' +dir_output='/glade/scratch/'+myname+'/single_point/' #-- Specify new file name ----------------------------- command='date "+%y%m%d"' @@ -57,7 +56,7 @@ sitefile=site_dir+'PTCLMDATA_sitedata.txt' soilfile=site_dir+'PTCLMDATA_soildata.txt' #-- Raw datafiles ------------------------ -rawdatafile = '/glade/work/swensosc/ctsm_code/ctsm/tools/mksurfdata_map/mksurfdata_map.namelist' +rawdatafile = '../mksurfdata_map/mksurfdata_map.namelist' mstr='Checking for data for site: '+sitename mprint(mstr) From 275f00a559d6077d59076cde730e80803dbcb920 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 31 Jan 2019 13:25:53 -0700 Subject: [PATCH 336/730] temp location for fates leaf age default file during testing --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 6d4876a4b2..adad2a786b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc +/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_default_2trop.c190131.nc From 8262c936047914e511d40512b1d469177f746f9b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 31 Jan 2019 15:21:52 -0700 Subject: [PATCH 337/730] Fix Jackie's name and update html --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index e5a075cca5..ed4fcb234c 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -14,7 +14,7 @@ ***Contributing Authors*** **Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathan Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacquelyn Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the From ca1e160e4eb3f5ec21efd9c30bbca051a172392c Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 31 Jan 2019 15:31:18 -0700 Subject: [PATCH 338/730] Revert "Fix Jackie's name and update html" This reverts commit 8262c936047914e511d40512b1d469177f746f9b. --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index ed4fcb234c..e5a075cca5 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -14,7 +14,7 @@ ***Contributing Authors*** **Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathan Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacquelyn Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the From 9ae9ff53cc3d136888c3cf375f72eecec4a0d8ad Mon Sep 17 00:00:00 2001 From: wwieder Date: Fri, 1 Feb 2019 14:39:04 -0700 Subject: [PATCH 339/730] minor changes to instructions and code --- tools/contrib/singlept | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/contrib/singlept b/tools/contrib/singlept index 380ef05c7d..d8c344f53e 100755 --- a/tools/contrib/singlept +++ b/tools/contrib/singlept @@ -50,6 +50,10 @@ mprint("Current directory = "+pwd+"\n") #------------------------------------------------------------------# #--------------------- Instructions -----------------------------# #------------------------------------------------------------------# +load the following into your local environment +module load python/2.7.14 +ncar_pylib + After creating a case using a global compset, run preview_namelist. From the resulting lnd_in file in the run directory, find the name of the domain file, and the surface data file. @@ -83,6 +87,11 @@ setting up the case. The case for the single point simulation should have river routing and land ice models turned off (i.e. the compset should use stub models SROF and SGLC) + +to run the script +./singlept +deactivate # to remove NPL from environment + ''' # Set control flags @@ -116,7 +125,7 @@ dir_output='/glade/scratch/'+myname+'/single_point/' if ( not os.path.isdir( dir_output ) ): os.mkdir( dir_output ) dir_inputdata='/glade/p/cesmdata/cseg/inputdata/' -dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data' +dir_clm_forcedata='/glade/p/cgd/tss/CTSM_datm_forcing_data/' dir_input_datm=dir_clm_forcedata+'/atm_forcing.datm7.GSWP3.0.5d.v1.c170516/' dir_output_datm=dir_output + 'datmdata/' if ( not os.path.isdir( dir_output_datm ) ): From 366dc268263b9a394cddb65829f4c9f79cc25eb0 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 4 Feb 2019 15:40:28 -0700 Subject: [PATCH 340/730] temporary testing parameter file for fates with leaf age bins --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index adad2a786b..621006eebd 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_default_2trop.c190131.nc +/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_default_2trop.c190204.nc From 22623ea28b98034067322c8e1bb298dc91b398dd Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 4 Feb 2019 17:26:56 -0700 Subject: [PATCH 341/730] Updated fates parameter file to svn location --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 621006eebd..d0522d97cc 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_default_2trop.c190204.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190205.nc From fb3e5c208bb8d8cde824e4de95ff7f851727555b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Feb 2019 17:10:22 -0700 Subject: [PATCH 342/730] Remove CH4 inversion fields, only output LAI/SAI if non-crop, optionally output VIC fields --- tools/mksurfdata_map/mksurfdata.pl | 9 + tools/mksurfdata_map/src/Srcfiles | 1 - .../mksurfdata_map/src/mkCH4inversionMod.F90 | 172 ------------------ tools/mksurfdata_map/src/mkfileMod.F90 | 77 +++----- tools/mksurfdata_map/src/mkglcmecMod.F90 | 45 +---- tools/mksurfdata_map/src/mksurfdat.F90 | 95 +++------- tools/mksurfdata_map/src/mkvarctl.F90 | 1 + 7 files changed, 66 insertions(+), 334 deletions(-) delete mode 100644 tools/mksurfdata_map/src/mkCH4inversionMod.F90 diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index deac02ae7c..3c5a920b34 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -51,6 +51,7 @@ my %opts = ( hgrid=>"all", + vic=>0, ssp_rcp=>"hist", debug=>0, exedir=>undef, @@ -144,6 +145,8 @@ sub usage { -usrname "clm_usrdat_name" CLM user data name to find grid file with. + -vic Add the fields required for the VIC model + NOTE: years, res, and ssp_rcp can be comma delimited lists. @@ -359,6 +362,11 @@ sub write_namelist_file { mksrf_furban = '$datfil->{'urb'}' gitdescribe = '$gitdescribe' EOF + if ( $opts{'vic'} ) { + print $fh <<"EOF"; + outnc_vic = .true. +EOF + } if ( ! $opts{'fast_maps'} ) { print $fh <<"EOF"; map_ftopostats = '$map->{'topostats'}' @@ -450,6 +458,7 @@ sub write_namelist_file { "pft_frc=s" => \$opts{'pft_frc'}, "pft_idx=s" => \$opts{'pft_idx'}, "ssp_rcp=s" => \$opts{'ssp_rcp'}, + "vic" => \$opts{'vic'}, "rundir=s" => \$opts{'rundir'}, "soil_col=i" => \$opts{'soil_col'}, "soil_fmx=f" => \$opts{'soil_fmx'}, diff --git a/tools/mksurfdata_map/src/Srcfiles b/tools/mksurfdata_map/src/Srcfiles index 25e50d3f95..94985557dc 100644 --- a/tools/mksurfdata_map/src/Srcfiles +++ b/tools/mksurfdata_map/src/Srcfiles @@ -29,7 +29,6 @@ mkpeatMod.F90 mksoildepthMod.F90 mktopostatsMod.F90 mkVICparamsMod.F90 -mkCH4inversionMod.F90 nanMod.F90 shr_file_mod.F90 shr_sys_mod.F90 diff --git a/tools/mksurfdata_map/src/mkCH4inversionMod.F90 b/tools/mksurfdata_map/src/mkCH4inversionMod.F90 deleted file mode 100644 index d5124408cb..0000000000 --- a/tools/mksurfdata_map/src/mkCH4inversionMod.F90 +++ /dev/null @@ -1,172 +0,0 @@ -module mkCH4inversionMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: mkCH4inversionMod -! -! !DESCRIPTION: -! make inversion-derived parameters for CH4 -! -! !REVISION HISTORY: -! Author: Bill Sacks -! -!----------------------------------------------------------------------- -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use mkdomainMod , only : domain_checksame - - implicit none - - private - -! !PUBLIC MEMBER FUNCTIONS: - public mkCH4inversion ! make inversion-derived parameters for CH4 -! -!EOP -!=============================================================== -contains -!=============================================================== - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: mkCH4inversion -! -! !INTERFACE: -subroutine mkCH4inversion(ldomain, mapfname, datfname, ndiag, & - f0_o, p3_o, zwt0_o) -! -! !DESCRIPTION: -! make inversion-derived parameters for CH4 -! -! !USES: - use mkdomainMod, only : domain_type, domain_clean, domain_read - use mkgridmapMod - use mkncdio - use mkdiagnosticsMod, only : output_diagnostics_continuous - use mkchecksMod, only : min_bad, max_bad -! -! !ARGUMENTS: - - implicit none - type(domain_type) , intent(in) :: ldomain - character(len=*) , intent(in) :: mapfname ! input mapping file name - character(len=*) , intent(in) :: datfname ! input data file name - integer , intent(in) :: ndiag ! unit number for diag out - real(r8) , intent(out):: f0_o(:) ! output grid: maximum gridcell fractional inundated area (unitless) - real(r8) , intent(out):: p3_o(:) ! output grid: coefficient for qflx_surf_lag for finundated (s/mm) - real(r8) , intent(out):: zwt0_o(:) ! output grid: decay factor for finundated (m) -! -! !CALLED FROM: -! subroutine mksrfdat in module mksrfdatMod -! -! !REVISION HISTORY: -! Author: Bill Sacks -! -! -! !LOCAL VARIABLES: -!EOP - type(gridmap_type) :: tgridmap - type(domain_type) :: tdomain ! local domain - real(r8), allocatable :: data_i(:) ! data on input grid - integer :: ncid,varid ! input netCDF id's - integer :: ier ! error status - - real(r8), parameter :: min_valid_f0 = 0._r8 - real(r8), parameter :: max_valid_f0 = 1._r8 + 1.0e-14_r8 - real(r8), parameter :: min_valid_p3 = 0._r8 - real(r8), parameter :: min_valid_zwt0 = 0._r8 - - character(len=32) :: subname = 'mkCH4inversion' -!----------------------------------------------------------------------- - - write (6,*) 'Attempting to make inversion-derived CH4 parameters.....' - call shr_sys_flush(6) - - ! ----------------------------------------------------------------- - ! Read domain and mapping information, check for consistency - ! ----------------------------------------------------------------- - - call domain_read(tdomain,datfname) - - call gridmap_mapread(tgridmap, mapfname ) - call gridmap_check( tgridmap, subname ) - - call domain_checksame( tdomain, ldomain, tgridmap ) - - ! ----------------------------------------------------------------- - ! Open input file, allocate memory for input data - ! ----------------------------------------------------------------- - - write(6,*)'Open CH4 parameter file: ', trim(datfname) - call check_ret(nf_open(datfname, 0, ncid), subname) - - allocate(data_i(tdomain%ns), stat=ier) - if (ier/=0) call abort() - - ! ----------------------------------------------------------------- - ! Regrid f0 - ! ----------------------------------------------------------------- - - call check_ret(nf_inq_varid (ncid, 'F0', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, data_i), subname) - call gridmap_areaave(tgridmap, data_i, f0_o, nodata=0.01_r8) - - ! Check validity of output data - if (min_bad(f0_o, min_valid_f0, 'f0') .or. & - max_bad(f0_o, max_valid_f0, 'f0')) then - stop - end if - - call output_diagnostics_continuous(data_i, f0_o, tgridmap, "F0: max inundated area", "unitless", ndiag) - - ! ----------------------------------------------------------------- - ! Regrid p3 - ! ----------------------------------------------------------------- - - call check_ret(nf_inq_varid (ncid, 'P3', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, data_i), subname) - call gridmap_areaave(tgridmap, data_i, p3_o, nodata=10._r8) - - ! Check validity of output data - if (min_bad(p3_o, min_valid_p3, 'p3')) then - stop - end if - - call output_diagnostics_continuous(data_i, p3_o, tgridmap, "P3: finundated coeff", "s/mm", ndiag) - - ! ----------------------------------------------------------------- - ! Regrid zwt0 - ! ----------------------------------------------------------------- - - call check_ret(nf_inq_varid (ncid, 'ZWT0', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, data_i), subname) - call gridmap_areaave(tgridmap, data_i, zwt0_o, nodata=0.01_r8) - - ! Check validity of output data - if (min_bad(zwt0_o, min_valid_zwt0, 'zwt0')) then - stop - end if - - call output_diagnostics_continuous(data_i, zwt0_o, tgridmap, "ZWT0: finundated decay factor", "m", ndiag) - - ! ----------------------------------------------------------------- - ! Close files and deallocate dynamic memory - ! ----------------------------------------------------------------- - - call check_ret(nf_close(ncid), subname) - call domain_clean(tdomain) - call gridmap_clean(tgridmap) - deallocate (data_i) - - write (6,*) 'Successfully made inversion-derived CH4 parameters' - write (6,*) - call shr_sys_flush(6) - -end subroutine mkCH4inversion - - -end module mkCH4inversionMod diff --git a/tools/mksurfdata_map/src/mkfileMod.F90 b/tools/mksurfdata_map/src/mkfileMod.F90 index 80001b008a..3c5852796a 100644 --- a/tools/mksurfdata_map/src/mkfileMod.F90 +++ b/tools/mksurfdata_map/src/mkfileMod.F90 @@ -8,7 +8,7 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) use shr_kind_mod , only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_getenv use fileutils , only : get_filename - use mkvarpar , only : nlevsoi, nlevurb, numrad + use mkvarpar , only : nlevsoi, nlevurb, numrad, numstdpft use mkvarctl use mkurbanparMod, only : numurbl use mkglcmecMod , only : nglcec @@ -160,7 +160,7 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & 'Urban_raw_data_file_name', len_trim(str), trim(str)), subname) - if (.not. dynlanduse) then + if (.not. dynlanduse .and. (numpft == numstdpft) ) then str = get_filename(mksrf_flai) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & 'Lai_raw_data_file_name', len_trim(str), trim(str)), subname) @@ -186,13 +186,11 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & 'topography_stats_raw_data_file_name', len_trim(str), trim(str)), subname) - str = get_filename(mksrf_fvic) - call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & - 'vic_raw_data_file_name', len_trim(str), trim(str)), subname) - - str = get_filename(mksrf_fch4) - call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & - 'ch4_params_raw_data_file_name', len_trim(str), trim(str)), subname) + if ( outnc_vic )then + str = get_filename(mksrf_fvic) + call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & + 'vic_raw_data_file_name', len_trim(str), trim(str)), subname) + end if ! Mapping file names @@ -244,9 +242,11 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & 'map_harvest_file', len_trim(str), trim(str)), subname) - str = get_filename(map_flai) - call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & - 'map_lai_sai_file', len_trim(str), trim(str)), subname) + if ( numpft == numstdpft )then + str = get_filename(map_flai) + call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & + 'map_lai_sai_file', len_trim(str), trim(str)), subname) + end if str = get_filename(map_furbtopo) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & @@ -272,13 +272,11 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & 'map_topography_stats_file', len_trim(str), trim(str)), subname) - str = get_filename(map_fvic) - call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & - 'map_vic_file', len_trim(str), trim(str)), subname) - - str = get_filename(map_fch4) - call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & - 'map_ch4_params_file', len_trim(str), trim(str)), subname) + if ( outnc_vic )then + str = get_filename(map_fvic) + call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & + 'map_vic_file', len_trim(str), trim(str)), subname) + end if ! ---------------------------------------------------------------------- ! Define variables @@ -448,30 +446,23 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) call ncd_def_spatial_var(ncid=ncid, varname='STD_ELEV', xtype=xtype, & long_name='standard deviation of elevation', units='m') - call ncd_def_spatial_var(ncid=ncid, varname='binfl', xtype=xtype, & - long_name='VIC b parameter for the Variable Infiltration Capacity Curve', units='unitless') + if ( outnc_vic )then + call ncd_def_spatial_var(ncid=ncid, varname='binfl', xtype=xtype, & + long_name='VIC b parameter for the Variable Infiltration Capacity Curve', units='unitless') - call ncd_def_spatial_var(ncid=ncid, varname='Ws', xtype=xtype, & - long_name='VIC Ws parameter for the ARNO curve', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='Ws', xtype=xtype, & + long_name='VIC Ws parameter for the ARNO curve', units='unitless') - call ncd_def_spatial_var(ncid=ncid, varname='Dsmax', xtype=xtype, & - long_name='VIC Dsmax parameter for the ARNO curve', units='mm/day') + call ncd_def_spatial_var(ncid=ncid, varname='Dsmax', xtype=xtype, & + long_name='VIC Dsmax parameter for the ARNO curve', units='mm/day') - call ncd_def_spatial_var(ncid=ncid, varname='Ds', xtype=xtype, & - long_name='VIC Ds parameter for the ARNO curve', units='unitless') + call ncd_def_spatial_var(ncid=ncid, varname='Ds', xtype=xtype, & + long_name='VIC Ds parameter for the ARNO curve', units='unitless') + end if call ncd_def_spatial_var(ncid=ncid, varname='LAKEDEPTH', xtype=xtype, & long_name='lake depth', units='m') - call ncd_def_spatial_var(ncid=ncid, varname='F0', xtype=xtype, & - long_name='maximum gridcell fractional inundated area', units='unitless') - - call ncd_def_spatial_var(ncid=ncid, varname='P3', xtype=xtype, & - long_name='coefficient for qflx_surf_lag for finundated', units='s/mm') - - call ncd_def_spatial_var(ncid=ncid, varname='ZWT0', xtype=xtype, & - long_name='decay factor for finundated', units='m') - call ncd_def_spatial_var(ncid=ncid, varname='PCT_WETLAND', xtype=xtype, & long_name='percent wetland', units='unitless') @@ -491,20 +482,6 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) lev1name='nglcec', & long_name='percent glacier for each glacier elevation class (% of landunit)', units='unitless') - call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_MEC_GIC', xtype=xtype, & - lev1name='nglcec', & - long_name='percent smaller glaciers and ice caps for each glacier elevation class (% of landunit)', units='unitless') - - call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_MEC_ICESHEET', xtype=xtype, & - lev1name='nglcec', & - long_name='percent ice sheet for each glacier elevation class (% of landunit)', units='unitless') - - call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_GIC', xtype=xtype, & - long_name='percent ice caps/glaciers (% of landunit)', units='unitless') - - call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_ICESHEET', xtype=xtype, & - long_name='percent ice sheet (% of landunit)', units='unitless') - call ncd_def_spatial_var(ncid=ncid, varname='TOPO_GLC_MEC', xtype=xtype, & lev1name='nglcec', & long_name='mean elevation on glacier elevation classes', units='m') diff --git a/tools/mksurfdata_map/src/mkglcmecMod.F90 b/tools/mksurfdata_map/src/mkglcmecMod.F90 index 9e5a1cc2a0..8ee41dd5ba 100644 --- a/tools/mksurfdata_map/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_map/src/mkglcmecMod.F90 @@ -125,9 +125,7 @@ end subroutine mkglcmecInit ! !INTERFACE: subroutine mkglcmec(ldomain, mapfname, & datfname_fglacier, ndiag, & - pctglcmec_o, topoglcmec_o, & - pctglcmec_gic_o, pctglcmec_icesheet_o, & - pctglc_gic_o, pctglc_icesheet_o) + pctglcmec_o, topoglcmec_o ) ! ! !DESCRIPTION: ! make percent glacier on multiple elevation classes, mean elevation for each @@ -160,10 +158,6 @@ subroutine mkglcmec(ldomain, mapfname, & integer , intent(in) :: ndiag ! unit number for diag out real(r8) , intent(out):: pctglcmec_o (:,:) ! % for each elevation class on output glacier grid (% of landunit) real(r8) , intent(out):: topoglcmec_o(:,:) ! mean elevation for each elevation classs on output glacier grid - real(r8) , intent(out):: pctglcmec_gic_o(:,:) ! % glc gic on output grid, by elevation class (% of landunit) - real(r8) , intent(out):: pctglcmec_icesheet_o(:,:) ! % glc ice sheet on output grid, by elevation class (% of landunit) - real(r8) , intent(out):: pctglc_gic_o(:) ! % glc gic on output grid, summed across elevation classes (% of landunit) - real(r8) , intent(out):: pctglc_icesheet_o(:) ! % glc ice sheet on output grid, summed across elevation classes (% of landunit) ! ! !CALLED FROM: ! subroutine mksrfdat in module mksrfdatMod @@ -209,10 +203,6 @@ subroutine mkglcmec(ldomain, mapfname, & pctglcmec_o(:,:) = 0. topoglcmec_o(:,:) = 0. - pctglcmec_gic_o(:,:) = 0. - pctglcmec_icesheet_o(:,:) = 0. - pctglc_gic_o(:) = 0. - pctglc_icesheet_o(:) = 0. ! Set number of output points @@ -314,8 +304,6 @@ subroutine mkglcmec(ldomain, mapfname, & if (frac > 0) then pctglc_i = pctglc_gic_i(ni) + pctglc_icesheet_i(ni) pctglcmec_o(no,m) = pctglcmec_o(no,m) + wt*pctglc_i / frac - pctglcmec_gic_o(no,m) = pctglcmec_gic_o(no,m) + wt*pctglc_gic_i(ni) / frac - pctglcmec_icesheet_o(no,m) = pctglcmec_icesheet_o(no,m) + wt*pctglc_icesheet_i(ni) / frac ! note that, by weighting the following by pctglc_i, we are getting something ! like the average topographic height over glaciated areas - NOT the average @@ -371,21 +359,14 @@ subroutine mkglcmec(ldomain, mapfname, & if (pctglc_tot_o(no) > 0._r8) then pctglcmec_o(no,:) = pctglcmec_o(no,:) / pctglc_tot_o(no) * 100._r8 - pctglcmec_gic_o(no,:) = pctglcmec_gic_o(no,:) / pctglc_tot_o(no) * 100._r8 - pctglcmec_icesheet_o(no,:) = pctglcmec_icesheet_o(no,:) / pctglc_tot_o(no) * 100._r8 else ! Division of landunit is ambiguous. Apply the rule that all area is assigned to ! the lowest elevation class, and all GIC. pctglcmec_o(no,1) = 100._r8 - pctglcmec_gic_o(no,1) = 100._r8 end if end do - ! Set pctglc_gic_o to sum of pctglcmec_gic_o across elevation classes, and similarly for pctglc_icesheet_o - pctglc_gic_o = sum(pctglcmec_gic_o, dim=2) - pctglc_icesheet_o = sum(pctglcmec_icesheet_o, dim=2) - ! -------------------------------------------------------------------- ! Perform various sanity checks ! -------------------------------------------------------------------- @@ -401,30 +382,6 @@ subroutine mkglcmec(ldomain, mapfname, & end if end do - ! Confirm that GIC + ICESHEET = 100% - do no = 1,ns_o - if (abs((pctglc_gic_o(no) + pctglc_icesheet_o(no)) - 100._r8) > eps) then - write(6,*)'GIC + ICESHEET differs from 100% at no,pctglc_gic,pctglc_icesheet,lon,lat=', & - no,pctglc_gic_o(no),pctglc_icesheet_o(no),& - tgridmap%xc_dst(no),tgridmap%yc_dst(no) - errors = .true. - end if - end do - - ! Check that GIC + ICESHEET = total glacier at each elevation class - do m = 1, nglcec - do no = 1,ns_o - if (abs((pctglcmec_gic_o(no,m) + pctglcmec_icesheet_o(no,m)) - & - pctglcmec_o(no,m)) > eps) then - write(6,*)'GIC + ICESHEET differs from total GLC ' - write(6,*)'at no,m,pctglcmec,pctglcmec_gic,pctglcmec_icesheet = ' - write(6,*) no,m,pctglcmec_o(no,m),pctglcmec_gic_o(no,m),pctglcmec_icesheet_o(no,m) - errors = .true. - end if - end do - end do - - ! Error check: are all elevations within elevation class range do no = 1,ns_o do m = 1,nglcec diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index b7ee945511..34dd842c2e 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -32,7 +32,7 @@ program mksurfdat use mkurbanparMod , only : mkurbanInit, mkurban, mkurbanpar, numurbl use mkutilsMod , only : normalize_classes_by_gcell use mkfileMod , only : mkfile - use mkvarpar , only : nlevsoi, elev_thresh + use mkvarpar , only : nlevsoi, elev_thresh, numstdpft use mkvarctl use nanMod , only : nan, bigint use mkncdio , only : check_ret, ncd_put_time_slice @@ -44,7 +44,6 @@ program mksurfdat use mkagfirepkmonthMod , only : mkagfirepkmon use mktopostatsMod , only : mktopostats use mkVICparamsMod , only : mkVICparams - use mkCH4inversionMod , only : mkCH4inversion ! ! !ARGUMENTS: implicit none @@ -98,12 +97,8 @@ program mksurfdat real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier - real(r8), allocatable :: pctglc_gic(:) ! percent of grid cell that is gic (% of glc landunit) - real(r8), allocatable :: pctglc_icesheet(:) ! percent of grid cell that is ice sheet (% of glc landunit) real(r8), allocatable :: pctglcmec(:,:) ! glacier_mec pct coverage in each class (% of landunit) real(r8), allocatable :: topoglcmec(:,:) ! glacier_mec sfc elevation in each gridcell and class - real(r8), allocatable :: pctglcmec_gic(:,:) ! GIC pct coverage in each class (% of landunit) - real(r8), allocatable :: pctglcmec_icesheet(:,:) ! icesheet pct coverage in each class (% of landunit) real(r8), allocatable :: elevclass(:) ! glacier_mec elevation classes integer, allocatable :: glacier_region(:) ! glacier region ID real(r8), allocatable :: pctlak(:) ! percent of grid cell that is lake @@ -135,9 +130,6 @@ program mksurfdat real(r8), allocatable :: vic_dsmax(:) ! VIC Dsmax parameter (mm/day) real(r8), allocatable :: vic_ds(:) ! VIC Ds parameter (unitless) real(r8), allocatable :: lakedepth(:) ! lake depth (m) - real(r8), allocatable :: f0(:) ! max fractional inundated area (unitless) - real(r8), allocatable :: p3(:) ! coefficient for qflx_surf_lag for finundated (s/mm) - real(r8), allocatable :: zwt0(:) ! decay factor for finundated (m) real(r8) :: std_elev = -999.99_r8 ! Standard deviation of elevation (m) to use for entire grid @@ -213,6 +205,7 @@ program mksurfdat outnc_large_files, & outnc_double, & outnc_dims, & + outnc_vic, & fsurdat, & fdyndat, & fsurlog, & @@ -282,6 +275,7 @@ program mksurfdat ! mksrf_gridtype ---- Type of grid (default is 'global') ! outnc_double ------ If output should be in double precision ! outnc_large_files - If output should be in NetCDF large file format + ! outnc_vic --------- Output fields needed for VIC ! nglcec ------------ If you want to change the number of Glacier elevation classes ! gitdescribe ------- Description of this version from git ! ====================================== @@ -308,6 +302,7 @@ program mksurfdat mksrf_gridtype = 'global' outnc_large_files = .false. outnc_double = .true. + outnc_vic = .false. all_urban = .false. no_inlandwet = .true. @@ -354,6 +349,9 @@ program mksurfdat if ( outnc_double )then write(6,*)'Output ALL data in file as 64-bit' end if + if ( outnc_vic )then + write(6,*)'Output VIC fields' + end if if ( all_urban )then write(6,*) 'Output ALL data in file as 100% urban' end if @@ -446,9 +444,6 @@ program mksurfdat vic_dsmax(ns_o) , & vic_ds(ns_o) , & lakedepth(ns_o) , & - f0(ns_o) , & - p3(ns_o) , & - zwt0(ns_o) , & glacier_region(ns_o) ) landfrac_pft(:) = spval pctlnd_pft(:) = spval @@ -474,9 +469,6 @@ program mksurfdat vic_dsmax(:) = spval vic_ds(:) = spval lakedepth(:) = spval - f0(:) = spval - p3(:) = spval - zwt0(:) = spval glacier_region(:) = -999 ! ---------------------------------------------------------------------- @@ -661,17 +653,15 @@ program mksurfdat ndiag=ndiag, topo_stddev_o=topo_stddev, slope_o=slope, std_elev=std_elev) ! Make VIC parameters [binfl, ws, dsmax, ds] from [fvic] - call mkVICparams (ldomain, mapfname=map_fvic, datfname=mksrf_fvic, ndiag=ndiag, & - binfl_o=vic_binfl, ws_o=vic_ws, dsmax_o=vic_dsmax, ds_o=vic_ds) + if ( outnc_vic )then + call mkVICparams (ldomain, mapfname=map_fvic, datfname=mksrf_fvic, ndiag=ndiag, & + binfl_o=vic_binfl, ws_o=vic_ws, dsmax_o=vic_dsmax, ds_o=vic_ds) + end if ! Make lake depth [lakedepth] from [flakwat] call mklakparams (ldomain, mapfname=map_flakwat, datfname=mksrf_flakwat, ndiag=ndiag, & lakedepth_o=lakedepth) - ! Make inversion-derived CH4 parameters [f0, p3, zwt0] from [fch4] - call mkCH4inversion (ldomain, mapfname=map_fch4, datfname=mksrf_fch4, ndiag=ndiag, & - f0_o=f0, p3_o=p3, zwt0_o=zwt0) - ! Make organic matter density [organic] [forganic] allocate (organic(ns_o,nlevsoi)) organic(:,:) = spval @@ -790,24 +780,14 @@ program mksurfdat ! This call needs to occur after pctgla has been adjusted for the final time allocate (pctglcmec(ns_o,nglcec), & - topoglcmec(ns_o,nglcec), & - pctglcmec_gic(ns_o,nglcec), & - pctglcmec_icesheet(ns_o,nglcec)) - allocate (pctglc_gic(ns_o)) - allocate (pctglc_icesheet(ns_o)) + topoglcmec(ns_o,nglcec) ) pctglcmec(:,:) = spval topoglcmec(:,:) = spval - pctglcmec_gic(:,:) = spval - pctglcmec_icesheet(:,:) = spval - pctglc_gic(:) = spval - pctglc_icesheet(:) = spval call mkglcmec (ldomain, mapfname=map_fglacier, & datfname_fglacier=mksrf_fglacier, ndiag=ndiag, & - pctglcmec_o=pctglcmec, topoglcmec_o=topoglcmec, & - pctglcmec_gic_o=pctglcmec_gic, pctglcmec_icesheet_o=pctglcmec_icesheet, & - pctglc_gic_o=pctglc_gic, pctglc_icesheet_o=pctglc_icesheet) + pctglcmec_o=pctglcmec, topoglcmec_o=topoglcmec ) ! Determine fractional land from pft dataset @@ -889,18 +869,6 @@ program mksurfdat call check_ret(nf_inq_varid(ncid, 'TOPO_GLC_MEC', varid), subname) call check_ret(nf_put_var_double(ncid, varid, topoglcmec), subname) - call check_ret(nf_inq_varid(ncid, 'PCT_GLC_MEC_GIC', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, pctglcmec_gic), subname) - - call check_ret(nf_inq_varid(ncid, 'PCT_GLC_MEC_ICESHEET', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, pctglcmec_icesheet), subname) - - call check_ret(nf_inq_varid(ncid, 'PCT_GLC_GIC', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, pctglc_gic), subname) - - call check_ret(nf_inq_varid(ncid, 'PCT_GLC_ICESHEET', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, pctglc_icesheet), subname) - call check_ret(nf_inq_varid(ncid, 'PCT_URBAN', varid), subname) call check_ret(nf_put_var_double(ncid, varid, urbn_classes_g), subname) @@ -954,30 +922,23 @@ program mksurfdat call check_ret(nf_inq_varid(ncid, 'STD_ELEV', varid), subname) call check_ret(nf_put_var_double(ncid, varid, topo_stddev), subname) - call check_ret(nf_inq_varid(ncid, 'binfl', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, vic_binfl), subname) + if ( outnc_vic )then + call check_ret(nf_inq_varid(ncid, 'binfl', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, vic_binfl), subname) - call check_ret(nf_inq_varid(ncid, 'Ws', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, vic_ws), subname) + call check_ret(nf_inq_varid(ncid, 'Ws', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, vic_ws), subname) - call check_ret(nf_inq_varid(ncid, 'Dsmax', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, vic_dsmax), subname) + call check_ret(nf_inq_varid(ncid, 'Dsmax', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, vic_dsmax), subname) - call check_ret(nf_inq_varid(ncid, 'Ds', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, vic_ds), subname) + call check_ret(nf_inq_varid(ncid, 'Ds', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, vic_ds), subname) + end if call check_ret(nf_inq_varid(ncid, 'LAKEDEPTH', varid), subname) call check_ret(nf_put_var_double(ncid, varid, lakedepth), subname) - call check_ret(nf_inq_varid(ncid, 'F0', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, f0), subname) - - call check_ret(nf_inq_varid(ncid, 'P3', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, p3), subname) - - call check_ret(nf_inq_varid(ncid, 'ZWT0', varid), subname) - call check_ret(nf_put_var_double(ncid, varid, zwt0), subname) - call check_ret(nf_inq_varid(ncid, 'EF1_BTR', varid), subname) call check_ret(nf_put_var_double(ncid, varid, ef1_btr), subname) @@ -1021,9 +982,11 @@ program mksurfdat ! Write to netcdf file is done inside mklai routine ! ---------------------------------------------------------------------- - write(6,*)'calling mklai' - call mklai(ldomain, mapfname=map_flai, datfname=mksrf_flai, & - ndiag=ndiag, ncido=ncid ) + if ( numpft == numstdpft )then + write(6,*)'calling mklai' + call mklai(ldomain, mapfname=map_flai, datfname=mksrf_flai, & + ndiag=ndiag, ncido=ncid ) + end if ! Close surface dataset @@ -1044,7 +1007,6 @@ program mksurfdat deallocate ( organic ) deallocate ( ef1_btr, ef1_fet, ef1_fdt, ef1_shr, ef1_grs, ef1_crp ) deallocate ( pctglcmec, topoglcmec) - deallocate ( pctglc_gic, pctglc_icesheet) deallocate ( elevclass ) deallocate ( fmax ) deallocate ( pctsand, pctclay ) @@ -1054,7 +1016,6 @@ program mksurfdat deallocate ( topo_stddev, slope ) deallocate ( vic_binfl, vic_ws, vic_dsmax, vic_ds ) deallocate ( lakedepth ) - deallocate ( f0, p3, zwt0 ) deallocate ( glacier_region ) call harvdata%clean() diff --git a/tools/mksurfdata_map/src/mkvarctl.F90 b/tools/mksurfdata_map/src/mkvarctl.F90 index 26ee85f6fa..44585b7fc0 100644 --- a/tools/mksurfdata_map/src/mkvarctl.F90 +++ b/tools/mksurfdata_map/src/mkvarctl.F90 @@ -22,6 +22,7 @@ module mkvarctl logical, public :: outnc_double ! output ALL data in files as 64-bit integer, public :: outnc_dims = 2 ! only applicable to lat/lon grids logical, public :: outnc_1d ! true => output file is 1d + logical, public :: outnc_vic ! true => output file is 1d character(len= 32), public :: mksrf_gridnm = ' ' ! name of grid to use on output file character(len=256), public :: mksrf_fgrid = ' ' ! land grid file name to use From 138b756d4b9da21e3aed678fa2022340f15ecfb5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Feb 2019 00:09:13 -0700 Subject: [PATCH 343/730] Remove vic from namelist depending on settings, turn back lai even for Crop because it's needed for drydep --- tools/mksurfdata_map/mksurfdata.pl | 13 +++++++------ tools/mksurfdata_map/src/mksurfdat.F90 | 6 ++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 3c5a920b34..bdfb3b0a73 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -339,8 +339,6 @@ sub write_namelist_file { map_fpeat = '$map->{'peat'}' map_fsoildepth = '$map->{'soildepth'}' map_fabm = '$map->{'abm'}' - map_fvic = '$map->{'vic'}' - map_fch4 = '$map->{'ch4'}' mksrf_fsoitex = '$datfil->{'tex'}' mksrf_forganic = '$datfil->{'org'}' mksrf_flakwat = '$datfil->{'lak'}' @@ -354,8 +352,6 @@ sub write_namelist_file { mksrf_fpeat = '$datfil->{'peat'}' mksrf_fsoildepth = '$datfil->{'soildepth'}' mksrf_fabm = '$datfil->{'abm'}' - mksrf_fvic = '$datfil->{'vic'}' - mksrf_fch4 = '$datfil->{'ch4'}' outnc_double = $double all_urban = $all_urb no_inlandwet = $no_inlandwet @@ -364,6 +360,8 @@ sub write_namelist_file { EOF if ( $opts{'vic'} ) { print $fh <<"EOF"; + map_fvic = '$map->{'vic'}' + mksrf_fvic = '$datfil->{'vic'}' outnc_vic = .true. EOF } @@ -458,7 +456,7 @@ sub write_namelist_file { "pft_frc=s" => \$opts{'pft_frc'}, "pft_idx=s" => \$opts{'pft_idx'}, "ssp_rcp=s" => \$opts{'ssp_rcp'}, - "vic" => \$opts{'vic'}, + "vic!" => \$opts{'vic'}, "rundir=s" => \$opts{'rundir'}, "soil_col=i" => \$opts{'soil_col'}, "soil_fmx=f" => \$opts{'soil_fmx'}, @@ -628,7 +626,10 @@ sub write_namelist_file { my $mkopts = "-csmdata $CSMDATA -silent -justvalue -namelist clmexp $usrnam"; my @typlist = ( "lak", "veg", "voc", "tex", "col", "hrv", "fmx", "lai", "urb", "org", "glc", "glcregion", "utp", "wet", - "gdp", "peat","soildepth","abm", "vic", "ch4"); + "gdp", "peat","soildepth","abm"); + if ( $opts{'vic'} ) { + push( @typlist, "vic" ); + } if ( ! $opts{'fast_maps'} ) { push( @typlist, "topostats" ); } diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 34dd842c2e..173807dd9c 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -982,11 +982,9 @@ program mksurfdat ! Write to netcdf file is done inside mklai routine ! ---------------------------------------------------------------------- - if ( numpft == numstdpft )then - write(6,*)'calling mklai' - call mklai(ldomain, mapfname=map_flai, datfname=mksrf_flai, & + write(6,*)'calling mklai' + call mklai(ldomain, mapfname=map_flai, datfname=mksrf_flai, & ndiag=ndiag, ncido=ncid ) - end if ! Close surface dataset From d070bd320b2ce6b3be5aea23a76dfc3c669e1726 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 12 Feb 2019 09:48:56 -0700 Subject: [PATCH 344/730] Fix Shuman's name, remove user's guide disclaimer, fix equation numbers --- doc/source/conf.py | 1 + doc/source/index.rst | 2 +- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 27c0df6e3c..a561207501 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -172,3 +172,4 @@ 'code-block': 'Code %s', 'section': '%s', } +numfig_secnum_depth = 2 diff --git a/doc/source/index.rst b/doc/source/index.rst index 517f62e8eb..f7f35abeda 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,7 +6,7 @@ Welcome to the CLM documentation ================================== -This document has two major sections. NOTE THAT THE USER'S GUIDE CURRENTLY PROVIDES INSTRUCTIONS FOR CLM4.5 AND IS A WORK IN PROGRESS. +This document has two major sections. .. toctree:: :maxdepth: 2 diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index e5a075cca5..ed4fcb234c 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -14,7 +14,7 @@ ***Contributing Authors*** **Ashehad Ali, Andrew Badger, Gautam Bisht, Patrick Broxton, Michael Brunke, Jonathan Buzan, Martyn Clark, Tony Craig, Kyla Dahlin, Beth Drewniak, Louisa Emmons, Josh Fisher, Mark Flanner, Pierre Gentine, Jan Lenaerts, Sam Levis, -L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacqueline Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** +L. Ruby Leung, William Lipscomb, Jon Pelletier, Daniel M. Ricciuto, Ben Sanderson, Jacquelyn Shuman, Andrew Slater, Zachary Subin, Jinyun Tang, Ahmed Tawfik, Quinn Thomas, Simone Tilmes, Francis Vitt, Xubin Zeng** The National Center for Atmospheric Research (NCAR) is operated by the From 6599ac994a401bda495904ac890cd3a5da9dddb9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 12 Feb 2019 10:30:05 -0700 Subject: [PATCH 345/730] Fix MOSART and urban figure captions --- .../tech_note/Introduction/CLM50_Tech_Note_Introduction.rst | 6 ++++-- doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst index ed4fcb234c..7240dfa8d9 100644 --- a/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst +++ b/doc/source/tech_note/Introduction/CLM50_Tech_Note_Introduction.rst @@ -49,12 +49,14 @@ P. O. Box 3000, Boulder, Colorado 80307-300 - :numref:`Figure three layer snow pack` Example of three layer snow pack (snl=-3). -- :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. - - :numref:`Figure MOSART conceptual diagram` MOSART conceptual diagram. +- :numref:`Figure Schematic representation of the urban landunit` Schematic representation of the urban land unit. + - :numref:`Figure Schematic of urban and atmospheric model coupling` Schematic of urban and atmospheric model coupling. +- :numref:`Figure Schematic of THESIS urban properties tool` Schematic of THESIS urban properties tool. + - :numref:`Figure Vegetation fluxes and pools` Vegetation fluxes and pools. - :numref:`Figure annual phenology cycle` Example of annual phenology cycle for seasonal deciduous. diff --git a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst index e9f07d7752..439de8a7a1 100644 --- a/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst +++ b/doc/source/tech_note/MOSART/CLM50_Tech_Note_MOSART.rst @@ -43,13 +43,14 @@ it into the main channel; 3) main channel routing: the main channel receives wat from the sub-network channel and/or inflow, if any, from the upstream spatial units, and discharges the water to its downstream spatial unit or the ocean. +.. Figure 14.1. MOSART conceptual diagram + .. _Figure MOSART conceptual diagram: .. figure:: mosart_diagram.png :width: 800px :height: 400px - - + MOSART only routes positive runoff, although negative runoff can be generated occasionally by the land model (e.g., :math:`q_{gwl}`). Negative runoff in any runoff component including :math:`q_{sur}`, :math:`q_{sub}`, :math:`q_{gwl}` From 327d29a9666bc4bd3fe18bc78bacaed5eec8b0a7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Feb 2019 15:26:40 -0700 Subject: [PATCH 346/730] Only run a few surface datasets with vic, also do one of the tests with vic on --- test/tools/nl_files/mksrfdt_10x15_1850 | 2 +- tools/mksurfdata_map/Makefile.data | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tools/nl_files/mksrfdt_10x15_1850 b/test/tools/nl_files/mksrfdt_10x15_1850 index daa822804c..cdbb7c13dc 100644 --- a/test/tools/nl_files/mksrfdt_10x15_1850 +++ b/test/tools/nl_files/mksrfdt_10x15_1850 @@ -1 +1 @@ --l CSMDATA -r 10x15 -no-crop -y 1850 -exedir EXEDIR +-l CSMDATA -vic -r 10x15 -no-crop -y 1850 -exedir EXEDIR diff --git a/tools/mksurfdata_map/Makefile.data b/tools/mksurfdata_map/Makefile.data index 30bfcb463a..e0c20da779 100644 --- a/tools/mksurfdata_map/Makefile.data +++ b/tools/mksurfdata_map/Makefile.data @@ -114,7 +114,7 @@ DEBUG: standard : $(STANDARD) global-present : FORCE - $(MKSURFDATA) -no-crop -glc_nec 10 -y 2000 -res $(STANDARD_RES) $(BACKGROUND) + $(MKSURFDATA) -no-crop -vic -glc_nec 10 -y 2000 -res $(STANDARD_RES) $(BACKGROUND) global-present-f05 : FORCE $(MKSURFDATA) -no-crop -glc_nec 10 -y 1850,2000 -res 0.47x0.63 $(BACKGROUND) From 524266abf646755de1c23db9635e74d64c2517be Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Feb 2019 23:06:37 -0700 Subject: [PATCH 347/730] Add hi res datasets for 2005 --- .../namelist_defaults_clm4_5_tools.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 329e9b1c7b..f81491bbfa 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -133,11 +133,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). AVHRR AVHRR MODIS +MODIS MODIS MODIS MODIS LandScan2004 MODIS +MODIS ISRIC-WISE GLOBE-Gardner GLOBE-Gardner-mergeGIS @@ -159,11 +161,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5x0.5 0.5x0.5 0.25x0.25 +3x3min 0.25x0.25 3x3min 0.25x0.25 3x3min 0.25x0.25 +3x3min 5x5min 3x3min 10x10min @@ -207,6 +211,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc + + lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_lai_78pfts_simyr2005.c170413.nc @@ -218,6 +226,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc + + lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_soilcolor_CMIP6_simyr2005.c170623.nc @@ -292,6 +304,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). + +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc + + + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012/mksrf_landuse_histclm50_LUH2_850.c171012.nc From eb37c6b24963ca7f72f7ab48b31fa574f7a12b7e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Feb 2019 23:34:58 -0700 Subject: [PATCH 348/730] Update to cime version in the next cesm2.1.1 tag --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 34e461e9b2..f8242a6763 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime_cesm2_1_rel_06 +tag = cime5.6.11 required = True [externals_description] From 67dcac6fbc0bf833c13da426903961a3c452e2d1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Feb 2019 13:28:13 -0700 Subject: [PATCH 349/730] Fix needed for NOATNTHRO compset so the vic compsets will also work --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 1375bf1dd2..2a817eeaad 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -16,7 +16,7 @@ clm4.0: clm4.5: - clm5.0: + clm5.0: Satellite phenology: CN: Carbon Nitrogen model CNDV: CN with Dynamic Vegetation From 2fe70606081a60783ccf18546440b26718a0f773 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Feb 2019 16:17:17 -0700 Subject: [PATCH 350/730] Add change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 121 +++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 9fc609ebbb..050dd0942d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.18 erik 02/13/2019 Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory release-clm5.0.17 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes ctsm1.0.dev025 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes release-clm5.0.16 erik 01/15/2019 PtVg and ssp_rcp future scenario options and Antarctica wetlands fix to mksurfdata, and option to dribble crop harvest XSMRPOOL flux to atmosphere diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index d9004d3c81..ee7ae1cbb3 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,125 @@ =============================================================== +Tag name: release-clm5.0.18 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed Feb 13 16:15:32 MST 2019 +One-line Summary: Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory + +Purpose of this version: +------------------------ + +New NoAnthro compsets: I1850Clm50BgcNoAnthro, I1850Clm50SpNoAnthro and tests for it. +More updates to surface dataset generation, to reduce the fields that are output, removing ones +that aren't used. + +New tools/contrib directory with initial add of some useful scripts for users. Currently unsupported +and only expected to run on cheyenne. The following scripts are added: + + run_clm_historical ---- does all the setup and submission required to do a 1850-2010 CLM historical + subset_surfdata ------- create regional domain, surface data, and rtm directional files by + extracting data from global datasets + singlept -------------- create single point domain, surface data, and datm forcing files by + extracting data from global datasets + SpinupStability.ncl --- This script assesses the equilibrium state of a spinup run + run_clmtowers --------- This script will run any number of flux tower sites. + +Add new default f09 Potential Vegetation (PtVg) surface dataset. For mksurfdata new high resolution +PFT datasets (at 3x3min) for 2005. New rawdata PFT files from 0850-1849. + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many changes missing) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): Fixes #629 #557 #262 + #629 -- Unused fields from fsurdat files + #557 -- No anthro compset + #262 -- hirespft option doesn't work for mksurfdata.pl + +Science changes since: release-clm5.0.17 + None + +Software changes since: release-clm5.0.17 + PtVg and pre-millenial raw PFT datasets + reduce fields created on fsurdat files + +Changes to User Interface since: release-clm5.0.17 + New NoAnthro compsets: I1850Clm50BgcNoAnthro, I1850Clm50SpNoAnthro + Add new option "-vic" to mksurfdata.pl to output fields needed for VIC (only have a few resolutions with VIC on by default) + Add 2005 high resolution datasets that can be used for the -hirespft option to mksrfdata.pl + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK + hobart --- OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + regular tests (prealpha): + + cheyenne_intel - OK + cheyenne_gnu --- OK + hobart_nag ----- OK + + regular tests (prebeta): + + cheyenne_intel - OK + cheyenne_gnu --- OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.17 + +Changes answers relative to baseline: No (bit-for-bit) + +Detailed list of changes: +------------------------ + +Externals being used: Change cime to cime5.6.11 (just a name change) + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime5.6.11 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #619 #620 #634 +(https://github.com/ESCOMP/ctsm/pull) + + #619 -- Begin adding "contrib" tools directory + #620 -- Add NoAnthro compset and tests + #634 -- Remove some of the fields added to fsurdat files in mksurfdata_map + + +=============================================================== +=============================================================== Tag name: release-clm5.0.17 Originator(s): Keith Oleson, Bill Sacks Date: Wed Jan 23 11:03:22 MST 2019 From 7b67ac4548f6081f081133fb9b0c7260c4384437 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Feb 2019 19:01:39 -0700 Subject: [PATCH 351/730] Update date --- doc/release-clm5.0.ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index ee7ae1cbb3..7092fb3dfb 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.18 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Feb 13 16:15:32 MST 2019 +Date: Wed Feb 13 19:01:26 MST 2019 One-line Summary: Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory Purpose of this version: From 96d4b5a986732df29ca2844469ba43a25c31d384 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 14 Feb 2019 09:48:40 -0700 Subject: [PATCH 352/730] Add more detail to BGC and SP spinup in User's Guide --- ...Satellite-Phenology-Model-CLMSP-spinup.rst | 23 +++++- ...ning-up-the-biogeochemistry-BGC-spinup.rst | 72 +++++++++++++++---- 2 files changed, 80 insertions(+), 15 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst index a017c42ae0..d6b6c74d91 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-Satellite-Phenology-Model-CLMSP-spinup.rst @@ -6,7 +6,28 @@ Spinning up the Satellite Phenology Model =========================================== -To spin-up the CLMSP model you merely need to run CLMSP for 50 simulation years starting from arbitrary initial conditions. +To spin-up the CLMSP model you merely need to run CLMSP for about 50 simulation years starting from arbitrary initial conditions. You then use the final restart file for initial conditions in other simulations. Because, this is a straight forward operation we will NOT give the details on how to do that here, but leave it as an exercise for the reader. See the `Example 4-7 `_ as an example of doing this as the last step for CLMCN. + +You can also start from a default initial file that is setup as part of the selected compset. :numref:`Figure SP spinup plot for 1850` shows +spinup behavior for an 1850 SP case that loops over one year of coupler history output for atmospheric forcing (generated from the fully coupled model), +initialized with an initial file generated from a GSWP3 atmospheric forcing case. Note that it takes less than 10 years for state variables +such as FSH (sensible heat flux), EFLX_LH_TOT (latent heat flux), GPP (photosynthesis), H2OSOI (soil water), and TSOI (soil temperature) to reach +a specified equilibrium state (denoted by the dotted lines) due to the different atmospheric forcing. TWS (total water storage) may take a bit longer. + +.. _Figure SP spinup plot for 1850: + +.. figure:: image1.png + + SP spinup plot for year 1850. Variables examined are FSH (sensible heat flux), EFLX_LH_TOT (latent heat flux), GPP (photosynthesis), TWS (total water storage), H2OSOI (volumetric soil water in layer 8) and TSOI (soil temperature in layer 10). Generated using .../tools/contrib/SpinupStability_SP.ncl. + +:numref:`Figure SP spinup plot for 2000 CO2` shows spinup behavior for the same case but also changes CO2 to present-day conditions (379ppmv). +Again, it takes about 10 years to reach equilibrium. + +.. _Figure SP spinup plot for 2000 CO2: + +.. figure:: image2.png + + SP spinup plot for year 2000 CO2. Variables examined are FSH (sensible heat flux), EFLX_LH_TOT (latent heat flux), GPP (photosynthesis), TWS (total water storage), H2OSOI (volumetric soil water in layer 8) and TSOI (soil temperature in layer 10). Generated using .../tools/contrib/SpinupStability_SP.ncl. diff --git a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst index 0bbeda8e41..9808ceb05b 100644 --- a/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst +++ b/doc/source/users_guide/running-special-cases/Spinning-up-the-biogeochemistry-BGC-spinup.rst @@ -6,11 +6,55 @@ Spinup of CLM5.0-BGC-Crop ========================== -To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**) mode for 1000 simulation years. -After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**), and run for (at least 200+ simulation years). +To get the |version|-BGC model to a steady state, you first run it from arbitrary initial conditions using the "accelerated decomposition spinup" (-bgc_spinup on in CLM **configure**, see example below) mode for about 200 simulation years. :numref:`Figure BGC AD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 +BGC accelerated decomposition (AD) case using GSWP3 atmospheric forcing. Generally, the criteria that less than 3% of the land surface be in +total ecosystem carbon disequilibrium takes the longest to satisfy due to slow soil carbon (TOTSOMC) turnover times in the Arctic. + +.. _Figure BGC AD spinup plot for 1850 GSWP3: + +.. figure:: image3.png + + BGC AD spinup plot for a year 1850 case with GSWP3 atmospheric forcing. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. + +After this you branch from this mode in the "final spinup" (-bgc_spinup off in CLM **configure**, see example below), and run for several hundred simulation years. +:numref:`Figure BGC pAD spinup plot for 1850 GSWP3` shows spinup behavior for an 1850 +BGC post accelerated decomposition (pAD) case using GSWP3 atmospheric forcing. As before, the criteria that less than 3% of the land surface be in +total ecosystem carbon disequilibrium takes the longest to satisfy. It can be difficult to meet this strict criteria in less than 1000 years and users may want to relax this +criteria depending on their application. + +.. _Figure BGC pAD spinup plot for 1850 GSWP3: + +.. figure:: image4.png + + BGC pAD spinup plot for a year 1850 case with GSWP3 atmospheric forcing and initialization from the end of the BGC AD spinup case. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. + +You can also start from a default initial file that is setup as part of the selected compset. :numref:`Figure BGC initialized spinup plot for 1850` shows +spinup behavior for an 1850 pAD BGC case that loops over one year of coupler history output for atmospheric forcing (generated from the fully coupled model), +initialized with a BGC initial file generated from a GSWP3 atmospheric forcing case. Note that it takes about 10 years for variables +such as TLAI (total leaf area index), GPP (gross primary production), and TWS (total water storage) to reach a specified equilibrium state (denoted by the dotted lines) due to the different atmospheric forcing. + +.. _Figure BGC initialized spinup plot for 1850: + +.. figure:: image5.png + + BGC initialized spinup plot for year 1850. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. + +:numref:`Figure BGC initialized spinup plot for 2000 CO2` shows spinup behavior for the same case but also changes CO2 to present-day conditions (379ppmv). +Again, it takes about 10 years to reach equilibrium for TLAI, GPP, and TWS. + +.. _Figure BGC initialized spinup plot for 2000 CO2: + +.. figure:: image6.png + + BGC initialized spinup plot for year 2000 CO2. Variables examined are TOTECOSYSC (total ecosystem carbon), TOTSOMC (total soil organic matter carbon), TOTVEGC (total vegetation carbon), TLAI (total leaf area index), GPP (gross primary production) and TWS (total water storage). Generated using .../tools/contrib/SpinupStability.ncl. + +If you use the default initial file and you signficantly change model behavior or atmospheric forcing, and you are concerned about the carbon +equilibrium (e.g., TOTECOSYSC, TOTSOMC, TOTVEGC), particularly at high latitudes, then we recommend you put the model back into AD mode to +reach a new equilibrium. In this configuration, this will also automatically reseed "dead" plant functional types in the initial file with a +bit of leaf carbon to give those plant functional types another chance to grow under the new atmospheric forcing or model conditions. **1. 50_AD_SPINUP** - For the first step of running 1000+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: + For the first step of running 200+ years in "-bgc_spinup on" mode, you will setup a case, and then edit the values in env_build.xml and env_run.xml so that the right configuration is turned on and the simulation is setup to run for the required length of simulation time. So do the following: Example:: AD_SPINUP Simulation for |version|-BGC -------------------------------------------------------- @@ -25,18 +69,18 @@ Example:: AD_SPINUP Simulation for |version|-BGC > ./case.setup -case # Now build > ./case.build - # The following sets RESUBMIT to 30 times in env_run.xml (you could also use an editor) - # The following sets STOP_DATE,STOP_N and STOP_OPTION to Jan/1/1001, 20, "nyears" in env_run.xml (you could also use an editor) - > ./xmlchange RESUBMIT=20,STOP_N=50,STOP_OPTION=nyears,STOP_DATE=10010101 + # The following sets RESUBMIT to 3 times in env_run.xml (you could also use an editor) + # The following sets STOP_DATE,STOP_N and STOP_OPTION to Jan/1/0201, 20, "nyears" in env_run.xml (you could also use an editor) + > ./xmlchange RESUBMIT=3,STOP_N=50,STOP_OPTION=nyears,STOP_DATE=02010101 # Now run normally > ./case.submit -.. note:: This same procedure works for |version|-CN as well, you can typically shorten the spinup time from 1000 years to 600 though. +.. note:: This same procedure works for |version|-CN as well. Afterwards save the last restart file from this simulation to use in the next step. **2. Final spinup for |version|-BGC** - Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 200+ years in normal mode. So do the following: + Next save the last restart file from this step and use it as the "finidat" file to use for one more spinup for at least 400+ years in normal mode. So do the following: Example: Final CLMBGC Spinup Simulation for |version|-BGC ------------------------------------------------------------------ @@ -46,7 +90,7 @@ Example: Final CLMBGC Spinup Simulation for |version|-BGC > ./create_newcase -case BGC_finalspinup -res f19_g17_gl4 -compset I1850Clm50BgcCropCru > cd BGC_finalspinup # Now, Copy the last CLM restart file from the earlier case into your run directory - > cp /ptmp/$LOGIN/archive/BGC_spinup/rest/BGC_spinup.clm*.r*.1002-01-01-00000.nc \ + > cp /ptmp/$LOGIN/archive/BGC_spinup/rest/BGC_spinup.clm*.r*.0201-01-01-00000.nc \ /glade/scratch/$LOGIN/CN_finalspinup # Set the runtype to startup > ./xmlchange RUN_TYPE=startup @@ -54,20 +98,20 @@ Example: Final CLMBGC Spinup Simulation for |version|-BGC > cp /glade/scratch/$LOGIN/archive/BGC_spinup/rest/rpointer.atm /ptmp/$LOGIN/CN_finalspinup > cp /glade/scratch/$LOGIN/archive/BGC_spinup/rest/rpointer.drv /ptmp/$LOGIN/CN_finalspinup # Set the finidat file to the last restart file saved in previous step - > echo ' finidat = "BGC_spinup.clm2.r.1002-01-01-00000.nc"' > user_nl_clm + > echo ' finidat = "BGC_spinup.clm2.r.0201-01-01-00000.nc"' > user_nl_clm # Now setup > ./case.setup > Now build > ./case.build - # The following sets RESUBMIT to 4 times in env_run.xml (you could also use an editor) + # The following sets RESUBMIT to 7 times in env_run.xml (you could also use an editor) # The following sets STOP_N and STOP_OPTION to 50 and "nyears" in env_run.xml (you could also use an editor) - > ./xmlchange RESUBMIT=4,STOP_OPTION=nyears,STOP_N=50 + > ./xmlchange RESUBMIT=7,STOP_OPTION=nyears,STOP_N=50 > Now run as normal > ./case.submit -To assess if the model is spunup plot trends of CLMBGC variables of interest. If you see a trend, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. +To assess if the model is spunup, plot trends for CLMBGC variables of interest using .../tools/contrib/SpinupStability.ncl. If you don't meet the equilibrium criteria, you may need to run the simulation longer. Finally save the restart file from the end of this simulation to use as an "finidat" file for future simulations. -.. note:: This same final spinup procedure works for |version|-CN as well, you can typically shorten the spinup time from 200 years to 50 though. +.. note:: This same final spinup procedure works for |version|-CN as well. From 64586e91f6cac81148f875a08238d8339a99932a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 27 Feb 2019 10:02:49 -0800 Subject: [PATCH 353/730] Passing bc_in to fates set_site_properties for initializatoin purposes --- src/utils/clmfates_interfaceMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..79f719515d 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1230,7 +1230,9 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call zero_site(this%fates(nc)%sites(s)) end do - call set_site_properties(this%fates(nc)%nsites, this%fates(nc)%sites) + call set_site_properties(this%fates(nc)%nsites, & + this%fates(nc)%sites, & + this%fates(nc)%bc_in) ! ---------------------------------------------------------------------------- ! Initialize Hydraulics Code if turned on From cd3f4df3bb47793563080dee7b41488b7231dfed Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Feb 2019 12:06:08 -0700 Subject: [PATCH 354/730] Update datasets get CMIP6 ssp_rcp combinations working --- bld/CLMBuildNamelist.pm | 8 +- .../namelist_defaults_clm4_5.xml | 279 ++++++++++++++---- .../namelist_definition_clm4_0.xml | 10 + .../namelist_definition_clm4_5.xml | 2 +- .../1850-2100_SSP1-1.9_transient.xml | 44 +++ .../1850-2100_SSP1-2.6_transient.xml | 44 +++ .../1850-2100_SSP2-4.5_transient.xml | 44 +++ .../1850-2100_SSP3-7.0_transient.xml | 44 +++ .../1850-2100_SSP4-6.0_transient.xml | 44 +++ .../1850-2100_SSP5-3.4_transient.xml | 44 +++ .../1850-2100_SSP5-8.5_transient.xml | 44 +++ .../use_cases/2000-2100_rcp8.5_transient.xml | 58 ---- bld/namelist_files/use_cases/README | 6 +- bld/unit_testers/build-namelist_test.pl | 16 +- 14 files changed, 553 insertions(+), 134 deletions(-) create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml delete mode 100644 bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c7cda6598f..c0282ed52d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1124,13 +1124,13 @@ sub setup_cmdl_ssp_rcp { if ( $opts->{$var} ne "default" ) { $val = $opts->{$var}; } else { - $val = $defaults->get_value($var); + $val = remove_leading_and_trailing_quotes( $defaults->get_value($var) ); } $nl_flags->{'ssp_rcp'} = $val; $opts->{'ssp_rcp'} = $nl_flags->{'ssp_rcp'}; my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { + $nl->set_variable_value($group, $var, quote_string($val) ); + if ( ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) { my @valid_values = $definition->get_valid_values( $var ); $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); } @@ -4195,7 +4195,7 @@ sub check_use_case_name { "in namelist_files/use_cases/README\n"; my $desc = "[a-zA-Z0-9]*"; my $ssp_rcp = "SSP[0-9]-[0-9\.]+"; - if ( $use_case =~ /^[0-9]+-[0-9]+([a-zA-Z0-9_\.]*)_transient$/ ) { + if ( $use_case =~ /^[0-9]+-[0-9]+([a-zA-Z0-9_\.-]*)_transient$/ ) { my $string = $1; if ( $string =~ /^_($ssp_rcp)_*($desc)$/ ) { # valid name diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 666fb493cc..8c4851b26d 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -695,145 +695,141 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr2000_c170919.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne16np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/surfdata_conus_30_x8_16pfts_Irrig_CMIP6_simyr2000_c181003.nc + +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr2000_c190128.nc -lnd/clm2/surfdata_map/surfdata_5x5_amazon_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_5x5_amazon_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/surfdata_64x128_16pfts_Irrig_CMIP6_simyr2000_c170824.nc +>lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_64x128_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr2000_c170919.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.125x0.125_mp24_simyr2000_c150114.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.125x0.125_mp24_simyr2000_c150114.nc -lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_numaIA_78pfts_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_smallvilleIA_78pfts_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_smallvilleIA_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne16np4_78pfts_CMIP6_simyr2000_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr2000_c181003.nc +lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr2000_c190128.nc -lnd/clm2/surfdata_map/surfdata_1x1_camdenNJ_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_camdenNJ_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_vancouverCAN_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_vancouverCAN_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_mexicocityMEX_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_mexicocityMEX_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_urbanc_alpha_16pfts_Irrig_CMIP6_simyr2000_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_urbanc_alpha_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr1850_c170919.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr1850_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_conus_30_x8_16pfts_Irrig_CMIP6_simyr1850_c181003.nc +lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr1850_c190128.nc -lnd/clm2/surfdata_map/surfdata_360x720cru_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_48x96_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr1850_c170919.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_smallvilleIA_78pfts_CMIP6_simyr1850_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_smallvilleIA_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_numaIA_78pfts_CMIP6_simyr1850_c170917.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_1x1_brazil_78pfts_CMIP6_simyr1850_c171214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/surfdata_conus_30_x8_78pfts_CMIP6_simyr1850_c181003.nc +lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.nc - - lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc - - + + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + + + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + + +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc .true. diff --git a/bld/namelist_files/namelist_definition_clm4_0.xml b/bld/namelist_files/namelist_definition_clm4_0.xml index 9aec275fc7..7f51c5c874 100644 --- a/bld/namelist_files/namelist_definition_clm4_0.xml +++ b/bld/namelist_files/namelist_definition_clm4_0.xml @@ -649,6 +649,16 @@ Horizontal grid resolutions for mksurfdata input files Check that the resolution and land-mask is valid before continuing. + +Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios +The form is SSPn-m.m Where n is the SSP number and m.m is RCP radiative forcing at peak or 2100 in W/m^2 +n is just the whole number of the specific SSP scenario. The lower numbers have higher mitigation +- the higher numbers less mitigation, more than one SSP can result in the same RCP forcing +hist means do NOT use a future scenario, just use historical data. + + Add a note to the output namelist about the options given to build-namelist diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 7171e58bc6..94419322cf 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1781,7 +1781,7 @@ Horizontal resolutions Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools - Shared Socioeconomic Pathway (SSP) and Representative Concentration Pathway (RCP) combination for future scenarios diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml new file mode 100644 index 0000000000..6902720034 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario + +1850 + +1850-2100 + +arb_ic + +SSP1-1.9 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml new file mode 100644 index 0000000000..f6ac494d72 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario + +1850 + +1850-2100 + +arb_ic + +SSP1-2.6 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml new file mode 100644 index 0000000000..2313acc5de --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario + +1850 + +1850-2100 + +arb_ic + +SSP2-4.5 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml new file mode 100644 index 0000000000..89888ec498 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario + +1850 + +1850-2100 + +arb_ic + +SSP3-7.0 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml new file mode 100644 index 0000000000..d63fa1db71 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario + +1850 + +1850-2100 + +arb_ic + +SSP4-6.0 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml new file mode 100644 index 0000000000..ec6d8de9b6 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario + +1850 + +1850-2100 + +arb_ic + +SSP5-3.4 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml new file mode 100644 index 0000000000..6081ac08dc --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml @@ -0,0 +1,44 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario + +1850 + +1850-2100 + +arb_ic + +SSP5-8.5 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 +extend + +1850 +2100 +1850 +extend + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + diff --git a/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml b/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml deleted file mode 100644 index e2bd97460c..0000000000 --- a/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -20050101 - -1850 - -2000-2100 - -8.5 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -2000 -2100 -2000 - -2000 -2015 -2000 - -2000 -2100 -2000 -extend - -2000 -2015 -2000 -extend - -2000 -2010 -2000 - -2000 -2010 -2000 - -2000 -2100 -2000 - - diff --git a/bld/namelist_files/use_cases/README b/bld/namelist_files/use_cases/README index 40b992332b..4ccaf00bdc 100644 --- a/bld/namelist_files/use_cases/README +++ b/bld/namelist_files/use_cases/README @@ -11,7 +11,7 @@ Ending suffix requires one of these endings: _transient, _control or _pd Transient cases: - yyyy-yyyy_$rcp$desc_transient (for example 1850-2100_rcp8.5_transient) + yyyy-yyyy_$ssp_rcp$desc_transient (for example 1850-2100_SSP5-8.5_transient) or @@ -30,9 +30,9 @@ Where yyyy = Simulation year (such as 1850 or 2000). yyyy-yyyy = Range of simulation years to run over (i.e.. 1850-2000). -$rcp = Representative concentration pathway (rcp) description string +$ssp_rcp = Shared Socieconomic Pathway (SSP) Representative concentration pathway (RCP) description string for future scenarios: - rcp#.# (for example: rcp8.5, rcp6, rcp4.5, rcp2.6) + SSP#-#.# (for example: SSP5-8.5, SSP1-2.6, SSP4-6.0 [can be blank for historical cases]. $desc = Description of anything else -- alpha-numeric. Should start with an underscore ("_") if not by itself diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index ba7ed7da6a..2103bcd431 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,7 +123,7 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 950; +my $ntests = 946; if ( defined($opts{'compare'}) ) { $ntests += 600; } @@ -218,7 +218,7 @@ sub make_env_run { # Exercise a bunch of options my $options = "-co2_ppmv 250 "; - $options .= " -res 0.9x1.25 -ssp_rcp SSP-2.6 -envxml_dir ."; + $options .= " -res 0.9x1.25 -ssp_rcp SSP1-2.6 -envxml_dir ."; &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; @@ -274,7 +274,7 @@ sub make_env_run { # irrig, verbose, clm_demand, ssp_rcp, test, sim_year, use_case, l_ncpl my $startfile = "clmrun.clm2.r.1964-05-27-00000.nc"; -foreach my $options ( "-namelist '&a irrigate=.true./'", "-verbose", "-ssp_rcp SSP2-2.6", "-test", "-sim_year 1850", +foreach my $options ( "-namelist '&a irrigate=.true./'", "-verbose", "-ssp_rcp SSP1-2.6", "-test", "-sim_year 1850", "-use_case 1850_control", "-l_ncpl 1", "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", "-envxml_dir . -infile myuser_nl_clm", @@ -283,7 +283,7 @@ sub make_env_run { ) { my $file = $startfile; &make_env_run(); - eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; + eval{ system( "$bldnml -res 0.9x1.25 -envxml_dir . $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); $cfiles->checkfilesexist( "$options", $mode ); $cfiles->shownmldiff( "default", $mode ); @@ -320,7 +320,7 @@ sub make_env_run { ) { my $file = $startfile; &make_env_run(); - eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; + eval{ system( "$bldnml -res 0.9x1.25 -envxml_dir . $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); $cfiles->checkfilesexist( "$options", $mode ); $cfiles->shownmldiff( "default", $mode ); @@ -1277,8 +1277,10 @@ sub make_env_run { # Transient ssp_rcp scenarios $mode = "-phys clm5_0"; system( "../configure -s $mode" ); -my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "10x15" ); -foreach my $usecase ( "1850_control", "1850-2100_rcp2.6_transient", "1850-2100_rcp4.5_transient", "1850-2100_rcp6_transient", "1850-2100_rcp8.5_transient" ) { +my @tran_res = ( "0.9x1.25", "1.9x2.5", "10x15" ); +foreach my $usecase ( "1850_control", "1850-2100_SSP5-8.5_transient", "1850-2100_SSP1-2.6_transient", "1850-2100_SSP3-7.0_transient", + "1850-2100_SSP5-3.4_transient", "1850-2100_SSP2-4.5_transient", "1850-2100_SSP1-1.9_transient", + "1850-2100_SSP4-6.0_transient" ) { foreach my $res ( @tran_res ) { $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . "; &make_env_run(); From 516f27a866a9f2279e6aab4ee04fe548b03d55f2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Feb 2019 14:40:04 -0700 Subject: [PATCH 355/730] Break up future scenarios generation by specific scenario --- tools/mksurfdata_map/Makefile.data | 71 +++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/tools/mksurfdata_map/Makefile.data b/tools/mksurfdata_map/Makefile.data index 30bfcb463a..38706b75b2 100644 --- a/tools/mksurfdata_map/Makefile.data +++ b/tools/mksurfdata_map/Makefile.data @@ -114,7 +114,7 @@ DEBUG: standard : $(STANDARD) global-present : FORCE - $(MKSURFDATA) -no-crop -glc_nec 10 -y 2000 -res $(STANDARD_RES) $(BACKGROUND) + $(MKSURFDATA) -no-crop -vic -glc_nec 10 -y 2000 -res $(STANDARD_RES) $(BACKGROUND) global-present-f05 : FORCE $(MKSURFDATA) -no-crop -glc_nec 10 -y 1850,2000 -res 0.47x0.63 $(BACKGROUND) @@ -150,9 +150,40 @@ global-transient-f05 : FORCE # # global with future scenarios # -global-future : FORCE +global-future : global-SSP1-2.6 global-SSP3-7.0 global-SSP5-3.4 global-SSP2-4.5 \ + global-SSP1-1.9 global-SSP4-3.4 global-SSP4-6.0 global-SSP5-8.5 + +global-SSP1-2.6 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-2.6 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP3-7.0 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP3-7.0 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP5-3.4 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP5-3.4 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP2-4.5 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP2-4.5 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP1-1.9 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-1.9 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP4-3.4 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP4-3.4 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP4-6.0 : FORCE + $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP4-6.0 -res $(FUTURE_RES) $(BACKGROUND) + +global-SSP5-8.5 : FORCE $(MKSURFDATA) -no-crop -no_surfdata -glc_nec 10 -y 1850-2100 \ - -ssp_rcp SSP1-2.6,SSP3-7.0,SSP5-3.4,SSP2-4.5,SSP1-1.9,SSP4-3.4,SSP4-6.0,SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) + -ssp_rcp SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) # # tropics @@ -237,10 +268,40 @@ crop-global-transient-f05 : FORCE # # Crop with future scenarios # -crop-global-future : FORCE +crop-global-future : crop-global-SSP1-2.6 crop-global-SSP3-7.0 crop-global-SSP5-3.4 crop-global-SSP2-4.5 \ + crop-global-SSP1-1.9 crop-global-SSP4-3.4 crop-global-SSP4-6.0 crop-global-SSP5-8.5 + +crop-global-SSP1-2.6 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-2.6 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP3-7.0 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP3-7.0 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP5-3.4 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP5-3.4 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP2-4.5 : FORCE $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ - -ssp_rcp SSP1-2.6,SSP3-7.0,SSP5-3.4,SSP2-4.5,SSP1-1.9,SSP4-3.4,SSP4-6.0,SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) + -ssp_rcp SSP2-4.5 -res $(FUTURE_RES) $(BACKGROUND) +crop-global-SSP1-1.9 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP1-1.9 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP4-3.4 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP4-3.4 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP4-6.0 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP4-6.0 -res $(FUTURE_RES) $(BACKGROUND) + +crop-global-SSP5-8.5 : FORCE + $(MKSURFDATA) -no_surfdata -glc_nec 10 -y 1850-2100 \ + -ssp_rcp SSP5-8.5 -res $(FUTURE_RES) $(BACKGROUND) # # urban From d1d3bf1a1a2214e8e4a5d0b2cf410eb2b7f51fb1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 1 Mar 2019 16:54:26 -0700 Subject: [PATCH 356/730] Straighten out ndep settings, and also make sure ssp_rcp is required for atm_c13_filename and atm_c14_filename so it will abort on the missing files --- .../namelist_defaults_clm4_5.xml | 28 ++++++++++++------- .../1850-2100_SSP1-1.9_transient.xml | 2 -- .../1850-2100_SSP1-2.6_transient.xml | 2 -- .../1850-2100_SSP2-4.5_transient.xml | 2 -- .../1850-2100_SSP3-7.0_transient.xml | 2 -- .../1850-2100_SSP4-6.0_transient.xml | 2 -- .../1850-2100_SSP5-3.4_transient.xml | 2 -- .../1850-2100_SSP5-8.5_transient.xml | 2 -- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 3f2f47c371..82279be2bc 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -89,7 +89,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Ball-Berry1987 -lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c171012.nc +lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c171012.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP119_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP126_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP245_1850-2100_yearly_c181209.nc @@ -97,7 +97,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP34os_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP5B_1850-2100_yearly_c181209.nc -lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c171012.nc +lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c171012.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP119_3x1_global_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP126_3x1_global_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP245_3x1_global_1850-2100_yearly_c181209.nc @@ -1136,11 +1136,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - -extend -NDEP_year -lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc @@ -1151,8 +1146,18 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-1.9-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +cycle +NDEP_month +cycle +NDEP_month +cycle +NDEP_month +cycle +NDEP_month +cycle +NDEP_month lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc + +extend +NDEP_year +lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc + lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc @@ -1180,9 +1191,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -cycle -NDEP_month - bilinear nn diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml index 6902720034..d585570673 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml index f6ac494d72..28bac6785a 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml index 2313acc5de..e82bfaab67 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml index 89888ec498..12fa2c7866 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml index d63fa1db71..a208780c11 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml index ec6d8de9b6..4cceea86d0 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml index 6081ac08dc..0373a3d695 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml @@ -22,12 +22,10 @@ 1850 2100 1850 -extend 1850 2100 1850 -extend 1850 2100 From b9ab34ddd30fa58e02954e5bff3681106413891c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 5 Mar 2019 00:57:17 -0700 Subject: [PATCH 357/730] Update datasets, and get unit test working, and make sure all datasets exist --- bld/CLMBuildNamelist.pm | 26 +-- .../namelist_defaults_clm4_5.xml | 157 ++++++------------ bld/unit_testers/build-namelist_test.pl | 16 +- 3 files changed, 73 insertions(+), 126 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 73f1ece9ba..b767f4506e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1164,18 +1164,20 @@ sub setup_cmdl_spinup { if ( $physv->as_long() == $physv->as_long("clm4_0") ) { $nl_flags->{'spinup'} = $cfg->get('spinup'); } elsif ( $physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, - $defaults, $nl, "spinup_state", clm_accelerated_spinup=>$nl_flags->{$var}, - use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'} ); - if ( $nl->get_value("spinup_state") ne 0 ) { - $nl_flags->{'bgc_spinup'} = "on"; - if ( $nl_flags->{'bgc_mode'} eq "sp" ) { - $log->fatal_error("spinup_state is accelerated (=1 or 2) which is for a BGC mode of CN or BGC," . - " but the BGC mode is Satellite Phenology, change one or the other"); - } - if ( $nl_flags->{'clm_accelerated_spinup'} eq "off" ) { - $log->fatal_error("spinup_state is accelerated, but clm_accelerated_spinup is off, change one or the other"); - } + if ( &value_is_true($nl_flags->{'use_cn'}) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, + $defaults, $nl, "spinup_state", clm_accelerated_spinup=>$nl_flags->{$var}, + use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'} ); + if ( $nl->get_value("spinup_state") ne 0 ) { + $nl_flags->{'bgc_spinup'} = "on"; + if ( $nl_flags->{'bgc_mode'} eq "sp" ) { + $log->fatal_error("spinup_state is accelerated (=1 or 2) which is for a BGC mode of CN or BGC," . + " but the BGC mode is Satellite Phenology, change one or the other"); + } + if ( $nl_flags->{'clm_accelerated_spinup'} eq "off" ) { + $log->fatal_error("spinup_state is accelerated, but clm_accelerated_spinup is off, change one or the other"); + } + } } else { $nl_flags->{'bgc_spinup'} = "off"; $val = $defaults->get_value($var); diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 82279be2bc..5bb2e0ed5d 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -710,26 +710,22 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190304.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190303.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc @@ -746,14 +742,10 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_16pfts_Irrig_CM >lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_64x128_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_78pfts_CMIP6_simyr2000_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.125x0.125_mp24_simyr2000_c150114.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_78pfts_CMIP6_simyr2000_c190214.nc @@ -763,10 +755,10 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_si lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_smallvilleIA_hist_78pfts_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr2000_c190214.nc + +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr2000_c190304.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr2000_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr2000_c190303.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_78pfts_CMIP6_simyr2000_c190214.nc @@ -784,17 +776,13 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_mexicocityMEX_hist_16pfts_I lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_urbanc_alpha_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc @@ -805,25 +793,21 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_16pfts_Irrig_CM -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190304.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190303.nc lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr1850_c190128.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_hist_78pfts_CMIP6_simyr1850_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_78pfts_CMIP6_simyr1850_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.47x0.63_hist_78pfts_CMIP6_simyr1850_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr1850_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr1850_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_78pfts_CMIP6_simyr1850_c190214.nc @@ -836,10 +820,10 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_si lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_78pfts_CMIP6_simyr1850_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr1850_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr1850_c190214.nc +lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr1850_c190304.nc + +lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.nc @@ -850,10 +834,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc + use_crop=".false." >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c1908304.nc lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc @@ -878,10 +858,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc lnd/clm2/surfdata_map/landuse.timeseries_1x1_numaIA_hist_78pfts_CMIP6_simyr1850-2015_c170917.nc lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc + use_crop=".true." >lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c190304.nc lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc + use_crop=".true." >lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c179824.nc lnd/clm2/surfdata_map/landuse.timeseries_conus_30_x8_hist_78pfts_CMIP6_simyr1850-2015_c181004.nc @@ -917,81 +893,64 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190214.nc - + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190214.nc + use_crop=".true." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_78pfts_CMIP6_simyr1850-2100_c190228.nc @@ -999,81 +958,65 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-8.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-2.6_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP2-4.5_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP3-7.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP1-1.9_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP4-6.0_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_0.9x1.25_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_1.9x2.5_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc -lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_4x5_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190214.nc + use_crop=".false." >lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc .true. @@ -1145,7 +1088,7 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n >lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-1.9-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +>lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc cycle NDEP_month diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 1415233af5..501d060466 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 952; +my $ntests = 860; if ( defined($opts{'compare'}) ) { - $ntests += 600; + $ntests += 531; } plan( tests=>$ntests ); @@ -1079,10 +1079,12 @@ sub make_env_run { $res eq "ne4np4" || $res eq "2.5x3.33" || $res eq "0.23x0.31" || + $res eq "0.47x0.63" || $res eq "94x192" || $res eq "8x16" || $res eq "32x64" || $res eq "128x256" || + $res eq "360x720cru" || $res eq "512x1024" ) { next; } @@ -1112,7 +1114,7 @@ sub make_env_run { $mode = "-phys clm4_5"; system( "../configure -s $mode" ); -my @resolutions = ( "4x5", "10x15", "ne30np4", "ne120np4", "ne16np4", "1.9x2.5", "0.9x1.25" ); +my @resolutions = ( "4x5", "10x15", "ne30np4", "ne16np4", "1.9x2.5", "0.9x1.25" ); my @regional; my $nlbgcmode = "bgc"; my $mode = "clm45-$nlbgcmode"; @@ -1199,7 +1201,7 @@ sub make_env_run { # Check for crop resolutions $mode = "-phys clm5_0"; system( "../configure -s $mode" ); -my @crop_res = ( "1x1_numaIA", "1x1_smallvilleIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne30np4", "ne120np4" ); +my @crop_res = ( "1x1_numaIA", "1x1_smallvilleIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne30np4" ); foreach my $res ( @crop_res ) { $options = "-bgc bgc -crop -res $res -envxml_dir ."; &make_env_run(); @@ -1265,7 +1267,7 @@ sub make_env_run { # Transient 20th Century simulations $mode = "-phys clm5_0"; system( "../configure -s $mode" ); -my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "ne120np4", "10x15" ); +my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "10x15" ); my $usecase = "20thC_transient"; my $GLC_NEC = 10; foreach my $res ( @tran_res ) { @@ -1322,7 +1324,7 @@ sub make_env_run { "-bgc sp -envxml_dir . -vichydro", "-bgc bgc -dynamic_vegetation", "-bgc bgc -clm_demand flanduse_timeseries -sim_year 1850-2000", "-bgc bgc -envxml_dir . -namelist '&a use_c13=.true.,use_c14=.true.,use_c14_bombspike=.true./'" ); foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "ne120np4", "10x15", "0.9x1.25", "1.9x2.5" ); + my @clmres = ( "10x15", "0.9x1.25", "1.9x2.5" ); foreach my $res ( @clmres ) { $options = "-res $res -envxml_dir . "; &make_env_run( ); @@ -1343,7 +1345,7 @@ sub make_env_run { my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc sp -envxml_dir .", ); foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "ne16np4", "360x720cru" ); + my @clmres = ( "ne16np4" ); foreach my $res ( @clmres ) { $options = "-res $res -envxml_dir . "; &make_env_run( ); From 7ff3cf88934e4c2de7b183c0865f24ee07e05df9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 5 Mar 2019 00:58:45 -0700 Subject: [PATCH 358/730] Add missing SSP scenario --- .../1850-2100_SSP4-3.4_transient.xml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml new file mode 100644 index 0000000000..7818a49791 --- /dev/null +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml @@ -0,0 +1,42 @@ + + + + +Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario +Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario + +1850 + +1850-2100 + +arb_ic + +SSP4-3.4 + +flanduse_timeseries + +.true. +.false. +.false. + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2100 +1850 + +1850 +2106 +1850 + + From 560967d6d27bc4f51ef8880ef848265134a43b34 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 5 Mar 2019 11:23:54 -0700 Subject: [PATCH 359/730] Change for of SSP-RCP period in compset longnames, so it doesn't include dots and dash, so for example SSP585_ rather than SSP5-8.5 --- cime_config/config_component.xml | 20 ++++++++++---------- cime_config/config_compsets.xml | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 492cccb0f1..aaa3d53bce 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -109,16 +109,16 @@ 1850_control 1850_noanthro_control 20thC_transient - 1850-2100_SSP5-8.5_transient - 1850-2100_SSP1-2.6_transient - 1850-2100_SSP3-7.0_transient - 1850-2100_SSP5-3.4_transient - 1850-2100_SSP2-4.5_transient - 1850-2100_SSP1-1.9_transient - 1850-2100_SSP4-3.4_transient - 1850-2100_SSP4-6.0_transient - 1850-2100_SSP5-8.5_transient - 20thC_transient + 1850-2100_SSP5-8.5_transient + 1850-2100_SSP1-2.6_transient + 1850-2100_SSP3-7.0_transient + 1850-2100_SSP5-3.4_transient + 1850-2100_SSP2-4.5_transient + 1850-2100_SSP1-1.9_transient + 1850-2100_SSP4-3.4_transient + 1850-2100_SSP4-6.0_transient + 1850-2100_SSP5-8.5_transient + 20thC_transient 1850-2100_rcp4.5_transient run_component_clm diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index a3258df899..32f170cd77 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -12,7 +12,7 @@ The notation for the compset longname is TIME_ATM[%phys]_LND[%phys]_ICE[%phys]_OCN[%phys]_ROF[%phys]_GLC[%phys]_WAV[%phys][_BGC%phys] Where for the CAM specific compsets below the following is supported - TIME = Time period (e.g. 2000, HIST, SSP5-8.5...) + TIME = Time period (e.g. 2000, HIST, SSP585...) ATM = [CAM40, CAM50, CAM55] LND = [CLM40, CLM45, CLM50, SLND] ICE = [CICE, DICE, SICE] @@ -238,47 +238,47 @@ ISSP585Clm50BgcCrop - SSP5-8.5_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP585_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP226Clm50BgcCrop - SSP2-2.6_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP226_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP119Clm50BgcCrop - SSP1-1.9_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP119_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP245Clm50BgcCrop - SSP2-4.5_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP245_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP370Clm50BgcCrop - SSP3-7.0_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP370_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP334Clm50BgcCrop - SSP3-3.4_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP334_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP434Clm50BgcCrop - SSP4-3.4_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP434_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP460Clm50BgcCrop - SSP4-6.0_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP460_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV ISSP534Clm50BgcCrop - SSP5-3.4_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + SSP534_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV From 824835ceef9bbb444caed453c8be86f1d8cdf22e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 5 Mar 2019 18:03:48 -0800 Subject: [PATCH 360/730] Adding decomp to soil layer mapping table --- src/utils/clmfates_interfaceMod.F90 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..87acba3fe9 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -2257,6 +2257,27 @@ subroutine init_soil_depths(this, nc) this%fates(nc)%bc_in(s)%z_sisl(1:nlevsoil) = col%z(c,1:nlevsoil) this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:nlevdecomp) = & dzsoi_decomp(1:nlevdecomp) + + if (use_vertsoilc) then + do j=1,nlevsoil + this%fates(nc)%bc_in(s)%decomp_id(j) = j + ! Check to make sure that dz = dz_decomp_sisl when vertical soil dynamics + ! are active + if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))<1.e-10_r8)then + write(iulog,*) 'when vertical soil decomp dynamics are on' + write(iulog,*) 'fates assumes that the decomposition depths equal the soil depths' + write(iulog,*) 'layer: ',j + write(iulog,*) 'dz_decomp_sisl(j): ',this%fates(nc)%bc_in(s)%dz_decomp_sisl(j) + write(iulog,*) 'dz_sisl(j): ',this%fates(nc)%bc_in(s)%dz_sisl(j) + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end do + else + do j=1,nlevsoil + this%fates(nc)%bc_in(s)%decomp_id(j) = 1 + end do + end if + end do return From 88993581bd7faf1ec7408a8881018999e87cb77a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Mar 2019 12:10:57 -0700 Subject: [PATCH 361/730] Get rid of reading ZWT0, F0, and P3 fields from the surface dataset, and read it from the ch4FInundated stream file instead, for clm4_5 that uses ZWT_inversion --- bld/CLMBuildNamelist.pm | 12 ++-- .../namelist_defaults_clm4_5.xml | 3 + src/biogeochem/ch4Mod.F90 | 70 +++---------------- 3 files changed, 18 insertions(+), 67 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b767f4506e..c3c2c34b3e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2897,13 +2897,11 @@ sub setup_logic_methane { # Get resolution to read streams file for # my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' )); - if ( $finundation_method eq "TWS_inversion" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_res', - 'finundation_method'=>$finundation_method ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', - 'finundation_method'=>$finundation_method, - 'finundation_res'=>$nl->get_value('finundation_res') ); - } + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_res', + 'finundation_method'=>$finundation_method ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', + 'finundation_method'=>$finundation_method, + 'finundation_res'=>$nl->get_value('finundation_res') ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog', 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); # diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 5bb2e0ed5d..a4d69cdc71 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2603,9 +2603,12 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n .true. 1.9x2.5 +1.9x2.5 lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc +lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 26dc791f72..a35d92c7f7 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -166,9 +166,6 @@ module ch4Mod real(r8), pointer, private :: qflx_surf_lag_col (:) ! col time-lagged surface runoff (mm H2O /s) real(r8), pointer, private :: finundated_lag_col (:) ! col time-lagged fractional inundated area real(r8), pointer, private :: layer_sat_lag_col (:,:) ! col Lagged saturation status of soil layer in the unsaturated zone (1 = sat) - real(r8), pointer, private :: zwt0_col (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: f0_col (:) ! col maximum inundated fraction for a gridcell (for methane code) - real(r8), pointer, private :: p3_col (:) ! col coefficient for determining finundated (m) real(r8), pointer, private :: pH_col (:) ! col pH values for methane production ! real(r8), pointer, private :: dyn_ch4bal_adjustments_col (:) ! adjustments to each column made in this timestep via dynamic column area adjustments (only makes sense at the column-level: meaningless if averaged to the gridcell-level) (g C / m^2) @@ -316,9 +313,6 @@ subroutine InitAllocate(this, bounds) allocate(this%qflx_surf_lag_col (begc:endc)) ; this%qflx_surf_lag_col (:) = nan allocate(this%finundated_lag_col (begc:endc)) ; this%finundated_lag_col (:) = nan allocate(this%layer_sat_lag_col (begc:endc,1:nlevgrnd)) ; this%layer_sat_lag_col (:,:) = nan - allocate(this%zwt0_col (begc:endc)) ; this%zwt0_col (:) = nan - allocate(this%f0_col (begc:endc)) ; this%f0_col (:) = nan - allocate(this%p3_col (begc:endc)) ; this%p3_col (:) = nan allocate(this%pH_col (begc:endc)) ; this%pH_col (:) = nan allocate(this%ch4_surf_flux_tot_col (begc:endc)) ; this%ch4_surf_flux_tot_col (:) = nan allocate(this%dyn_ch4bal_adjustments_col (begc:endc)) ; this%dyn_ch4bal_adjustments_col (:) = nan @@ -752,9 +746,6 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) ! !LOCAL VARIABLES: integer :: j ,g, l,c,p ! indices type(file_desc_t) :: ncid ! netcdf id - real(r8) ,pointer :: zwt0_in (:) ! read in - zwt0 - real(r8) ,pointer :: f0_in (:) ! read in - f0 - real(r8) ,pointer :: p3_in (:) ! read in - p3 real(r8) ,pointer :: pH_in (:) ! read in - pH character(len=256) :: locfn ! local file name logical :: readvar ! If read variable from file or not @@ -766,32 +757,12 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) ! Initialize time constant variables !---------------------------------------- - allocate(zwt0_in (bounds%begg:bounds%endg)) - allocate(f0_in (bounds%begg:bounds%endg)) - allocate(p3_in (bounds%begg:bounds%endg)) if (usephfact) allocate(ph_in(bounds%begg:bounds%endg)) ! Methane code parameters for finundated call getfil( fsurdat, locfn, 0 ) call ncd_pio_openfile (ncid, trim(locfn), 0) - if ( finundation_mtd == finundation_mtd_zwt_inversion ) then - call ncd_io(ncid=ncid, varname='ZWT0', flag='read', data=zwt0_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but ZWT0 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='F0', flag='read', data=f0_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but F0 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='P3', flag='read', data=p3_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but P3 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - end if ! pH factor for methane model if (usephfact) then @@ -803,18 +774,14 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) end if call ncd_pio_closefile(ncid) - do c = bounds%begc, bounds%endc - g = col%gridcell(c) + if ( usephfact )then + do c = bounds%begc, bounds%endc + g = col%gridcell(c) - if (finundation_mtd == finundation_mtd_ZWT_inversion ) then - this%zwt0_col(c) = zwt0_in(g) - this%f0_col(c) = f0_in(g) - this%p3_col(c) = p3_in(g) - end if - if (usephfact) this%pH_col(c) = pH_in(g) - end do + this%pH_col(c) = pH_in(g) + end do + end if - deallocate(zwt0_in, f0_in, p3_in) if (usephfact) deallocate(pH_in) !---------------------------------------- @@ -1686,7 +1653,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & real(r8) :: rootfraction(bounds%begp:bounds%endp, 1:nlevgrnd) real(r8) :: fsat_bef(bounds%begc:bounds%endc) ! finundated from previous timestep real(r8) :: errch4 ! g C / m^2 - real(r8) :: zwt_actual + !real(r8) :: zwt_actual real(r8) :: qflxlags ! Time to lag qflx_surf_lag (s) real(r8) :: redoxlag ! Redox time lag real(r8) :: redoxlag_vertical ! Vertical redox lag time @@ -1716,8 +1683,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] CO2 partial pressure (Pa) forc_pch4 => atm2lnd_inst%forc_pch4_grc , & ! Input: [real(r8) (:) ] CH4 partial pressure (Pa) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) rootfr_col => soilstate_inst%rootfr_col , & ! Output: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) (p2c) @@ -1728,9 +1695,6 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m) - f0 => ch4_inst%f0_col , & ! Input: [real(r8) (:) ] maximum gridcell fractional inundated area - p3 => ch4_inst%p3_col , & ! Input: [real(r8) (:) ] coefficient for qflx_surf_lag for finunated (s/mm) totcolch4_bef => ch4_inst%totcolch4_bef_col , & ! Input: [real(r8) (:) ] total methane in soil column, start of timestep (g C / m^2) grnd_ch4_cond_patch => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] @@ -1847,21 +1811,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & qflx_surf_lag(begc:endc), finundated(begc:endc) ) else - ! Calculate finundated with ZWT inversion from surface dataset - do fc = 1, num_soilc - c = filter_soilc(fc) - if (zwt0(c) > 0._r8) then - if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - zwt_actual = zwt_perched(c) - else - zwt_actual = zwt(c) - end if - finundated(c) = f0(c) * exp(-zwt_actual/zwt0(c)) + p3(c)*qflx_surf_lag(c) - else - finundated(c) = p3(c)*qflx_surf_lag(c) - end if - - end do + call endrun( "ERROR:: finundation method MUST now use a streams file to run, it can no longer read from the fsurdat file" ) end if ! Calculate finundated before snow and lagged version of finundated From 60df8029235a95c7b667ee3f59c8c9b98edec289 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Mar 2019 13:26:07 -0700 Subject: [PATCH 362/730] Correct the ISSP126Clm50BgcCrop compset, remove the extra SSP3 compset, have the PIPD point to SSP5-8.5 transient --- cime_config/config_component.xml | 4 ++-- cime_config/config_compsets.xml | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index aaa3d53bce..7aed50cc0b 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -103,7 +103,7 @@ char UNSET - + 2010_control 2000_control 1850_control @@ -119,7 +119,7 @@ 1850-2100_SSP4-6.0_transient 1850-2100_SSP5-8.5_transient 20thC_transient - 1850-2100_rcp4.5_transient + 1850-2100_SSP5-8.5_transient run_component_clm env_run.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 32f170cd77..6f9f1b1c86 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -242,8 +242,8 @@ - ISSP226Clm50BgcCrop - SSP226_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV + ISSP126Clm50BgcCrop + SSP126_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV @@ -261,11 +261,6 @@ SSP370_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - ISSP334Clm50BgcCrop - SSP334_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - ISSP434Clm50BgcCrop SSP434_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV From 25eb04f703554653e519faf1d79725366a14563e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Mar 2019 13:58:18 -0700 Subject: [PATCH 363/730] Add a test for one future scenario with isotopes on, and a dec 2050 start date, so needs a new test_mod for it --- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ .../clm/ciso_dec2050Start/include_user_mods | 2 ++ .../testmods_dirs/clm/ciso_dec2050Start/shell_commands | 1 + 3 files changed, 12 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/include_user_mods create mode 100755 cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/shell_commands diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c811c3fa9d..ed0762b748 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1551,6 +1551,15 @@ + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/include_user_mods new file mode 100644 index 0000000000..c9053f7b07 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/include_user_mods @@ -0,0 +1,2 @@ +../ciso +../decStart diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/shell_commands new file mode 100755 index 0000000000..8bd67a0031 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=2050-12-30 From 9486dd99e8fdf6d41b5a22ec0e5e4c49d44e4f4f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Mar 2019 16:27:25 -0700 Subject: [PATCH 364/730] Make new use_case files cleaner by reducing the amount of information they are required to have, by moving it into the ngeneral namelist_defaults files, and having more attributes for some fields --- bld/CLMBuildNamelist.pm | 3 +- .../namelist_defaults_clm4_5.xml | 25 +++++++++++++++ .../namelist_defaults_overall.xml | 8 +++++ .../1850-2100_SSP1-1.9_transient.xml | 31 ++----------------- .../1850-2100_SSP1-2.6_transient.xml | 31 ++----------------- .../1850-2100_SSP2-4.5_transient.xml | 31 ++----------------- .../1850-2100_SSP3-7.0_transient.xml | 31 ++----------------- .../1850-2100_SSP4-3.4_transient.xml | 31 ++----------------- .../1850-2100_SSP4-6.0_transient.xml | 31 ++----------------- .../1850-2100_SSP5-3.4_transient.xml | 31 ++----------------- .../1850-2100_SSP5-8.5_transient.xml | 31 ++----------------- 11 files changed, 59 insertions(+), 225 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c3c2c34b3e..ce2e6e1432 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1890,7 +1890,8 @@ sub setup_logic_irrigate { if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate', - 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'} ); + 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, + 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, ); if ( &value_is_true($nl->get_value('irrigate') ) ) { $nl_flags->{'irrigate'} = ".true." } else { diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index a4d69cdc71..5db09805df 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -106,9 +106,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP5B_3x1_global_1850-2100_yearly_c181209.nc +.true. +.false. +.false. + .false. .true. + 0 1 @@ -1050,6 +1055,14 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc +1850 +2100 +1850 + +1850 +2100 +1850 + 2010 2010 @@ -1193,6 +1206,14 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n nn +1850 +2100 +1850 + +1850 +2100 +1850 + 2010 2010 @@ -1249,6 +1270,10 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n nn +1850 +2106 +1850 + 2000 2000 diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index 68b31a080c..3b2721fbbf 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -26,6 +26,14 @@ determine default values for namelists. arb_ic cold +arb_ic + + + +flanduse_timeseries +flanduse_timeseries + + /fs/cgd/csm/inputdata diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml index d585570673..93e5e24372 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-1.9_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-1.9 scenario + + 1850 1850-2100 -arb_ic - SSP1-1.9 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml index 28bac6785a..d10ef6d45f 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP1-2.6_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP1-2.6 scenario + + 1850 1850-2100 -arb_ic - SSP1-2.6 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml index e82bfaab67..85859517f1 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP2-4.5_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP2-4.5 scenario + + 1850 1850-2100 -arb_ic - SSP2-4.5 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml index 12fa2c7866..317ca3fbcd 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP3-7.0_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP3-7.0 scenario + + 1850 1850-2100 -arb_ic - SSP3-7.0 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml index 7818a49791..0e42bbd724 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-3.4_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-3.4 scenario + + 1850 1850-2100 -arb_ic - SSP4-3.4 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml index a208780c11..b2b67a4d5b 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP4-6.0_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP4-6.0 scenario + + 1850 1850-2100 -arb_ic - SSP4-6.0 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml index 4cceea86d0..e4ae71ca94 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-3.4_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-3.4 scenario + + 1850 1850-2100 -arb_ic - SSP5-3.4 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - diff --git a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml index 0373a3d695..fbb8af4d10 100644 --- a/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml +++ b/bld/namelist_files/use_cases/1850-2100_SSP5-8.5_transient.xml @@ -5,38 +5,13 @@ Simulate transient land-use, and aerosol deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to current day with historical data, and then to 2100 with the CMIP6 SSP5-8.5 scenario + + 1850 1850-2100 -arb_ic - SSP5-8.5 -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2106 -1850 - From c31c662a8c099e82031f2cd1ffa7881596b25dd5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Mar 2019 16:29:50 -0700 Subject: [PATCH 365/730] Do NOT set CO2 to diagnostic for SSP cases, as this needs to be coordinated with a cime tag --- cime_config/config_component.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 7aed50cc0b..2988e615dd 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -173,7 +173,9 @@ diagnostic prognostic diagnostic + run_component_clm env_run.xml From 2158b8f50c379e1dcb79dafb5e0bd13489e47f79 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 7 Mar 2019 12:49:19 -0700 Subject: [PATCH 366/730] Update to cime version that works on cheyenne after the mar/5th/2019 downtime --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index f8242a6763..a9052b4434 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.11 +tag = cime5.6.12 required = True [externals_description] From ee140863f6fd5117dc9e642e6a1fee3ddd37817f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Mar 2019 13:58:40 -0700 Subject: [PATCH 367/730] Update ChangeLog --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 91 ++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 050dd0942d..78dbdb51a5 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.19 erik 03/08/2019 Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used release-clm5.0.18 erik 02/13/2019 Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory release-clm5.0.17 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes ctsm1.0.dev025 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 7092fb3dfb..0b42561b03 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,95 @@ =============================================================== +Tag name: release-clm5.0.19 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri Mar 8 13:58:16 MST 2019 +One-line Summary: Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used + +Purpose of this version: +------------------------ + +Update cime version with changes needed to run on cheyenne after the Mar/5th/2019 downtime that resulted in the model +NOT being able to run + +CIME important updates: + Update fv1.9x2.5,gx1v7 grids + Initial port to CGD machine izumi + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many changes missing) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #655 #654 + +Science changes since: None + +Software changes since: New f19_g17 grids, works on izumi, works on cheyenne_intel after the downtime + +Changes to User Interface since: None + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + hobart --- PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.18 + +Changes answers relative to baseline: Yes, but only f19_g17 resolutions + + Summarize any changes to answers, i.e., + - what code configurations: any at f19_g17 resolution + - what platforms/compilers: All + - nature of change: larger than roundoff/same climate + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime5.6.12 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #656 +(https://github.com/ESCOMP/ctsm/pull) + #656 -- update cime + +=============================================================== +=============================================================== Tag name: release-clm5.0.18 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed Feb 13 19:01:26 MST 2019 From 4084bc73ee93966d8d268e8e41f5fd916e630726 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Mar 2019 14:22:47 -0700 Subject: [PATCH 368/730] Update fates to point to fates_s1.14.0_a4.0.0 --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index d6e68c79f0..47908d906d 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.8.1_a3.0.0 +tag = fates_s1.14.0_a4.0.0 required = True [PTCLM] From 81a6d8d47eb87708fbd4f0f196db387e8af002b6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Mar 2019 16:29:27 -0700 Subject: [PATCH 369/730] Merge commit '92c325ac9' into updatefatesvers added height dimension to FATES history from Cdkoven --- src/main/histFileMod.F90 | 35 +++++++++++++++++++++++++ src/utils/clmfates_interfaceMod.F90 | 40 ++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index a4eb5331ed..b1df43d6b4 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -23,6 +23,7 @@ module histFileMod use EDTypesMod , only : nclmax use EDTypesMod , only : nlevleaf use FatesInterfaceMod , only : nlevsclass, nlevage + use FatesInterfaceMod , only : nlevheight use EDTypesMod , only : nfsc, ncwd use FatesInterfaceMod , only : numpft_ed => numpft use ncdio_pio @@ -2057,9 +2058,12 @@ subroutine htape_create (t, histrest) if(use_fates)then call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) + call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) + call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid) call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) @@ -2483,9 +2487,15 @@ subroutine htape_timeconst(t, mode) use FatesInterfaceMod, only : fates_hdim_pfmap_levscpf use FatesInterfaceMod, only : fates_hdim_scmap_levscpf use FatesInterfaceMod, only : fates_hdim_levage + use FatesInterfaceMod, only : fates_hdim_levheight use FatesInterfaceMod, only : fates_hdim_levpft use FatesInterfaceMod, only : fates_hdim_scmap_levscag use FatesInterfaceMod, only : fates_hdim_agmap_levscag + use FatesInterfaceMod, only : fates_hdim_scmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_agmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_pftmap_levscagpft + use FatesInterfaceMod, only : fates_hdim_agmap_levagepft + use FatesInterfaceMod, only : fates_hdim_pftmap_levagepft use FatesInterfaceMod, only : fates_hdim_levfuel use FatesInterfaceMod, only : fates_hdim_levcwdsc use FatesInterfaceMod, only : fates_hdim_levcan @@ -2560,6 +2570,8 @@ subroutine htape_timeconst(t, mode) long_name='FATES size index of the combined pft-size class dimension', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_levage',xtype=tape(t)%ncprec, dim1name='fates_levage', & long_name='FATES patch age (yr)', ncid=nfid(t)) + call ncd_defvar(varname='fates_levheight',xtype=tape(t)%ncprec, dim1name='fates_levheight', & + long_name='FATES height (m)', ncid=nfid(t)) call ncd_defvar(varname='fates_levpft',xtype=ncd_int, dim1name='fates_levpft', & long_name='FATES pft number', ncid=nfid(t)) call ncd_defvar(varname='fates_levfuel',xtype=ncd_int, dim1name='fates_levfuel', & @@ -2578,6 +2590,17 @@ subroutine htape_timeconst(t, mode) long_name='FATES leaf level of combined canopy x leaf x pft dimension', ncid=nfid(t)) call ncd_defvar(varname='fates_pftmap_levcnlfpf',xtype=ncd_int, dim1name='fates_levcnlfpf', & long_name='FATES PFT level of combined canopy x leaf x pft dimension', ncid=nfid(t)) + call ncd_defvar(varname='fates_scmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES size-class map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES age-class map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levscagpft', xtype=ncd_int, dim1name='fates_levscagpf', & + long_name='FATES pft map into size x patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & + long_name='FATES pft map into patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & + long_name='FATES age-class map into patch age x pft', units='-', ncid=nfid(t)) + end if @@ -2598,6 +2621,7 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_pftmap_levscpf',data=fates_hdim_pfmap_levscpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_scmap_levscpf',data=fates_hdim_scmap_levscpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levage',data=fates_hdim_levage, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_levheight',data=fates_hdim_levheight, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levpft',data=fates_hdim_levpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levfuel',data=fates_hdim_levfuel, ncid=nfid(t), flag='write') call ncd_io(varname='fates_levcwdsc',data=fates_hdim_levcwdsc, ncid=nfid(t), flag='write') @@ -2607,6 +2631,11 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_canmap_levcnlfpf',data=fates_hdim_canmap_levcnlfpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_lfmap_levcnlfpf',data=fates_hdim_lfmap_levcnlfpf, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levcnlfpf',data=fates_hdim_pftmap_levcnlfpf, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_scmap_levscagpft',data=fates_hdim_scmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levscagpft',data=fates_hdim_agmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_pftmap_levscagpft',data=fates_hdim_pftmap_levscagpft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_pftmap_levagepft',data=fates_hdim_pftmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') end if endif @@ -4838,6 +4867,8 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, num2d = numpft_ed case ('fates_levage') num2d = nlevage + case ('fates_levheight') + num2d = nlevheight case ('fates_levfuel') num2d = nfsc case ('fates_levcwdsc') @@ -4846,6 +4877,10 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, num2d = nlevsclass*numpft_ed case ('fates_levscag') num2d = nlevsclass*nlevage + case ('fates_levscagpf') + num2d = nlevsclass*nlevage*numpft_ed + case ('fates_levagepft') + num2d = nlevage*numpft_ed case ('fates_levcan') num2d = nclmax case ('fates_levcnlf') diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 437fd39e8f..971db9a81f 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1899,7 +1899,9 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_r8, site_ground_r8, site_size_pft_r8 use FatesIOVariableKindMod, only : site_size_r8, site_pft_r8, site_age_r8 use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 + use FatesIOVariableKindMod, only : site_scagpft_r8, site_agepft_r8 use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 + use FatesIOVariableKindMod, only : site_height_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -2084,6 +2086,15 @@ subroutine init_history_io(this,bounds_proc) ptr_col=this%fates_hist%hvars(ivar)%r82d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) + case(site_height_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) case(site_fuel_r8) d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name @@ -2138,7 +2149,24 @@ subroutine init_history_io(this,bounds_proc) ptr_col=this%fates_hist%hvars(ivar)%r82d, & default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) - + case(site_scagpft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) + case(site_agepft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index + dim2name = this%fates_hist%dim_bounds(d_index)%name + call hist_addfld2d(fname=trim(vname),units=trim(vunits), & + type2d=trim(dim2name), & + avgflag=trim(vavgflag),long_name=trim(vlong), & + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault), & + set_lake=0._r8,set_urb=0._r8) case default write(iulog,*) 'A FATES iotype was created that was not registerred' @@ -2360,6 +2388,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type use FatesInterfaceMod, only : nlevsclass, nlevage + use FatesInterfaceMod, only : nlevheight use EDtypesMod, only : nfsc, ncwd use EDtypesMod, only : nlevleaf, nclmax use FatesInterfaceMod, only : numpft_ed => numpft @@ -2394,8 +2423,17 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%age_class_begin = 1 fates%age_class_end = nlevage + fates%height_begin = 1 + fates%height_end = nlevheight + fates%sizeage_class_begin = 1 fates%sizeage_class_end = nlevsclass * nlevage + + fates%agepft_class_begin = 1 + fates%agepft_class_end = nlevage * numpft_ed + + fates%sizeagepft_class_begin = 1 + fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_ed fates%fuel_begin = 1 fates%fuel_end = nfsc From 57295153bfe28b691e27683ee67f60a66a944a8a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Mar 2019 22:04:34 -0700 Subject: [PATCH 370/730] Revert "Merge commit '46895e99761782f223e1c67ad22633a0e043cdb6' into updatefatesvers" This reverts commit 4a7fb056921ffbddbf8805c1e2d8e96d66fdc1f4, reversing changes made to 54673319a4c86470e907c8fcf0b5a6432f23a48a. --- src/utils/clmfates_interfaceMod.F90 | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 9206567001..d3fcad2e21 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1138,23 +1138,12 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%bc_in(s) ) end do - ! ------------------------------------------------------------------------ ! Update diagnostics of FATES ecosystem structure used in HLM. ! ------------------------------------------------------------------------ call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & waterstate_inst,canopystate_inst,frictionvel_inst) - - ! ------------------------------------------------------------------------ - ! Update the 3D patch level radiation absorption fractions - ! ------------------------------------------------------------------------ - call this%fates_restart%update_3dpatch_radiation(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_out) - - ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ From 76a47ce3eb619449c746654db15fe6440db6da3b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 9 Mar 2019 11:26:23 -0700 Subject: [PATCH 371/730] Revert "Merge commit '6d007f3d3f6074ac0bb27a9e8ca9158ce3c86fea' into updatefatesvers" This reverts commit 6b3b7edbdb74400dba5d873fa3b61f814dd6e98b, reversing changes made to 41a5cc17e0dcee6ff953e74ef8d5b76b8be4b610. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- src/biogeophys/SurfaceRadiationMod.F90 | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 220a86a68e..fc7a76f2c9 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -359,7 +359,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190111.nc +lnd/clm2/paramdata/fates_params_default_2trop.c181203.nc diff --git a/src/biogeophys/SurfaceRadiationMod.F90 b/src/biogeophys/SurfaceRadiationMod.F90 index 66ac7fa639..e28dc0b6a5 100644 --- a/src/biogeophys/SurfaceRadiationMod.F90 +++ b/src/biogeophys/SurfaceRadiationMod.F90 @@ -25,7 +25,7 @@ module SurfaceRadiationMod implicit none private - logical :: debug = .false. ! for debugging this module + logical, parameter :: debug = .false. ! for debugging this module ! ! !PUBLIC MEMBER FUNCTIONS: @@ -976,12 +976,9 @@ subroutine SurfaceRadiation(bounds, num_nourbanp, filter_nourbanp, & p = filter_urbanp(fp) g = patch%gridcell(p) - local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - - if(elai(p)==0.0_r8.and.fabd(p,1)>0._r8)then - if ( debug ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p - endif + if(elai(p)==0.0_r8.and.fabd(p,1)>0._r8)then + if ( debug ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p + endif ! Solar incident fsds_vis_d(p) = forc_solad(g,1) From 00d835c0a3fc2374604675eb081fdd3df6e67a85 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 9 Mar 2019 11:41:08 -0700 Subject: [PATCH 372/730] Update fates parameter file to work with fates_s1.20.1_a6.0.0 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index fc7a76f2c9..220a86a68e 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -359,7 +359,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c181203.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190111.nc From 87f0aa300a6db89fcb52314084ad63671fa3e61d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 9 Mar 2019 14:43:27 -0700 Subject: [PATCH 373/730] Update to fates_s1.23.0_a7.1.0_rev2 in the ncar fates-release repo --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 67a1cd58be..508943860a 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.21.0_api.7.0.0 +repo_url = https://github.com/ncar/fates-release +tag = fates_s1.23.0_a7.1.0_rev2 required = True [PTCLM] From c8a0b50b51d211550b2733d201b2dde59ecd0648 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 11 Mar 2019 13:06:54 -0600 Subject: [PATCH 374/730] Updated finidat files that are interpolated from the previous ones for f19 one for regular and one for lcMEC_spunup_1way --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 ++++---- .../testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 5db09805df..c3b4e19cbf 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -645,7 +645,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc @@ -653,7 +653,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc @@ -661,7 +661,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc @@ -669,7 +669,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm index c269a24911..ad22edcfb8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm @@ -2,4 +2,4 @@ ! ! Initial condition file at the desired configuration to run, so can verify that interpolating from it gives the same result ! Note that this was generated with GLC_TWO_WAY_COUPLING=FALSE -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180306.nc' +finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_dynglc_c190311.nc' From 35feefa0ab2d76c6c18d2012e05ec36d66386872 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 01:21:59 -0600 Subject: [PATCH 375/730] Update finidat file, as previous one somehow got removed --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index c3b4e19cbf..b0771d992c 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -645,7 +645,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -653,7 +653,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm4_5_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -661,7 +661,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_GSWP3v1" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc @@ -669,7 +669,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" use_nitrif_denitrif=".true." use_vertsoilc=".true." sim_year="2000" ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_0_CRUv7" ->lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190311.nc +>lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c190312.nc From 013db0bbea4a157889e690322c05e4731f684af2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 14:10:09 -0600 Subject: [PATCH 376/730] Fix a couple tests --- .../testdefs/testmods_dirs/clm/ciso_dec2050Start/user_nl_clm | 3 +++ .../testmods_dirs/clm/compatible_finidat_f09/user_nl_clm | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/user_nl_clm new file mode 100644 index 0000000000..f5f43b3aff --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_dec2050Start/user_nl_clm @@ -0,0 +1,3 @@ +! Initial condition file from a coupled run at 2015 that will work with this setup.. + finidat = "$DIN_LOC_ROOT/cesm2_init/b.e21.BHIST.f09_g17.CMIP6-historical.010/2015-01-01/b.e21.BHIST.f09_g17.CMIP6-historical.010.clm2.r.2015-01-01-00000.nc" + use_init_interp = T diff --git a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm index dc3dedf6c4..1e4306e7f5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm @@ -1 +1 @@ -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop.1366-01-01.0.9x1.25_gx1v6_simyr1850_c180424.nc' +finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop.1366-01-01.0.9x1.25_gx1v6_simyr1850_c190312.nc' From 6da3eaa987c58b26de0341d4e91f72fb0ad42924 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 15:25:38 -0600 Subject: [PATCH 377/730] Increase wall clock limit --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ed0762b748..c5a37e3387 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1050,7 +1050,7 @@ - + From 5ea8ee0c26c4aee9e7a45da2a18f8ae2b43fbf2d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 15:53:24 -0600 Subject: [PATCH 378/730] Remove test as hcru_hcru resolution was removed, and ERP_D tests and same compset are already being done, also change so that bgc_spinup test is for equal to on rather than not equal to off, so is more general --- bld/CLMBuildNamelist.pm | 2 +- cime_config/testdefs/testlist_clm.xml | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ce2e6e1432..b9448fa880 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2756,7 +2756,7 @@ sub setup_logic_supplemental_nitrogen { $log->fatal_error("There is no need to use a spinup mode when supplemental Nitrogen is on for all PFT's, as these modes spinup Nitrogen\n" . "when spinup != normal you can NOT set supplemental Nitrogen (suplnitro) to ALL"); } - if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_spinup'} ne "off" ) { + if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_spinup'} eq "on" ) { $log->warning("There is no need to use a bgc_spinup mode when supplemental Nitrogen is on for all PFT's, as these modes spinup Nitrogen" ); } } diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ed0762b748..b2b1c79f27 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -289,14 +289,6 @@ - - - - - - - - From f3eb2a203e37a2c937ef914daf82e194c1b583d7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 16:05:08 -0600 Subject: [PATCH 379/730] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 94 ++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 78dbdb51a5..87e086ae48 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes release-clm5.0.19 erik 03/08/2019 Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used release-clm5.0.18 erik 02/13/2019 Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory release-clm5.0.17 sacks 01/23/2019 History fields for vertically-resolved sums of soil C and N, and minor fixes diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 0b42561b03..716fafea6a 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,98 @@ =============================================================== +Tag name: release-clm5.0.20 +Originator(s): erik (Erik Kluzek) +Date: Tue Mar 12 15:14:05 MDT 2019 +One-line Summary: Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes + +Purpose of this version: +------------------------ + +Update all surface datasets and add datasets needed for future scenarios. Remove CLM40-RCP options. + +Also bring in change for reseeding so that reseeding happens for generic crop and +to increase the threshold from exactly zero to 1 (still very small). Fix QSNOEVAP history field. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many changes missing) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #621, #608, #624 #653 + #621 -- Fully remove CMIP5 rcp's (for clm40,clm45,clm50) and implement CMIP6 ssp_rcp's for clm45/clm50 + #608 -- Odd (blocky) spatial patterns in generic crop leafc for BGC simulation when initialized from BGC-Crop + #624 -- QSNOEVAP history output incorrect + #653 -- To save disk on fsurdat files use zwt0 on finindated file + +Science changes since: release-clm5.0.19 + Surface datasets no longer have wetland over Antarctica + QSNOEVAP output corrected + reseeding changes so that it happens over generic crop and also raise the threshold from identically zero + to 1 (which is still very small) + +Software changes since: release-clm5.0.19 + Remove the option to run CMIP5 rcp scenarios + +Changes to User Interface since: release-clm5.0.19 + "-rcp" option to build-namelist is removed and replaced with "-ssp_rcp" + New use-cases for all eight of the SSP's + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.19 + +Changes answers relative to baseline: Yes! (for clm4_5/clm5_0) + + Summarize any changes to answers, i.e., + - what code configurations: clm4_5/clm5_0 + - what platforms/compilers: All + - nature of change: similar climate, new fsurdat files (Antarctica fix), and QSNOEVAP, and reseed fix + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime5.6.12 + FATES: fates_s1.8.1_a3.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #625 #611 #651 +(https://github.com/ESCOMP/ctsm/pull) + #651 -- New datasets and capability to run CMIP6 future scenarios + #625 -- Correct QSNOEVAP history variable + #611 -- Reseed generic crops and increase totvegc threshold from 0 to 1 for reseeding + +=============================================================== +=============================================================== Tag name: release-clm5.0.19 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri Mar 8 13:58:16 MST 2019 From aa0d0ffec26983bdfa55679ec563674ccc7ca7d2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 16:09:04 -0600 Subject: [PATCH 380/730] Update date --- doc/release-clm5.0.ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 716fafea6a..9225aff766 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.20 Originator(s): erik (Erik Kluzek) -Date: Tue Mar 12 15:14:05 MDT 2019 +Date: Tue Mar 12 16:08:55 MDT 2019 One-line Summary: Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes Purpose of this version: From 04e931e19d55eead0fa6f6990ed80a6f6bdd4156 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 12 Mar 2019 22:27:58 -0600 Subject: [PATCH 381/730] Update fates version which also allows the fates test suite to run --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index eb7077fd75..eaf16ffd2c 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.21.0_api.7.0.0 +tag = sci.1.23.0_api.7.1.0 required = True [PTCLM] From a7aa4f9b2833f119a456391b01b5bc8988eec2fe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 24 Mar 2019 23:47:32 -0600 Subject: [PATCH 382/730] Add a SMS test for FatesHydro, and increase wallclock for some fates tests --- cime_config/testdefs/testlist_clm.xml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index fa0ad3ab56..cfd91632ea 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1798,7 +1798,7 @@ - + @@ -1870,6 +1870,14 @@ + + + + + + + + @@ -1899,7 +1907,7 @@ - + @@ -1908,7 +1916,7 @@ - + @@ -1917,7 +1925,7 @@ - + @@ -1926,7 +1934,7 @@ - + @@ -1935,7 +1943,7 @@ - + From 10901501d23fb52d027e14cd37a7c0bc5370c4fc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 25 Mar 2019 11:14:34 -0600 Subject: [PATCH 383/730] Update externals to ones in ctsm1.0.dev031 --- Externals.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index d747e21035..723e6d98fd 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/cism-wrapper -tag = cism2_1_49 +tag = release-cesm2.0.04 externals = Externals_CISM.cfg required = True @@ -16,21 +16,21 @@ required = True local_path = components/rtm protocol = git repo_url = https://github.com/ESCOMP/rtm -tag = rtm1_0_65 +tag = release-cesm2.0.00 required = True [mosart] local_path = components/mosart protocol = git repo_url = https://github.com/ESCOMP/mosart -tag = mosart1_0_30 +tag = release-cesm2.0.00 required = True [cime] local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = ctsm/ctsm1.0/cime5.7.5/n01 +tag = ctsm/ctsm1.0/cime5.7.9/n01 required = True [externals_description] From 814ab9ad953d0e77076f529958a8a3026acf0281 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 25 Mar 2019 13:38:11 -0600 Subject: [PATCH 384/730] Update expected fails for fates, change FatesHydro SMS test to one that works --- cime_config/testdefs/ExpectedTestFails.xml | 9 +-------- cime_config/testdefs/testlist_clm.xml | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 9c2f8a3107..04634f199c 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -11,13 +11,6 @@ FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-FatesAllVars COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesLogging COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-Fates COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesNoFire COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesPPhys COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesST3 COMPARE_base_rest - FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesAllVars COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_gnu.clm-Fates COMPARE_base_rest + FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cfd91632ea..92769de56f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1838,7 +1838,7 @@ - + @@ -1870,7 +1870,7 @@ - + From 2625996b2c4127ce29aed95b9000d1868bf62310 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 25 Mar 2019 13:48:25 -0600 Subject: [PATCH 385/730] Add more tests on hobart fo some of the new features --- cime_config/testdefs/testlist_clm.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 92769de56f..56aefdaf5c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1873,6 +1873,7 @@ + @@ -1922,6 +1923,7 @@ + @@ -1931,6 +1933,7 @@ + @@ -1940,6 +1943,7 @@ + From d381e167f0cdb72994aeb222ef9c42ea461aea20 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 25 Mar 2019 15:13:45 -0600 Subject: [PATCH 386/730] Point to NCAR/fates-release version because it works on hobart --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index eaf16ffd2c..ec59161e20 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.23.0_api.7.1.0 +repo_url = https://github.com/NCAR/fates-release +tag = fates_s1.23.0_a7.1.0 required = True [PTCLM] From 576f76b1e24697a7ca227956d20e0cf1b9ea464b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 25 Mar 2019 16:30:32 -0600 Subject: [PATCH 387/730] Add failed tests on hobart --- cime_config/testdefs/ExpectedTestFails.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 04634f199c..ff9e56cd06 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -11,6 +11,8 @@ FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest + FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest + FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN + FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK From 553292e9f56006672499f85ca7a8bea1ab153d46 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 26 Mar 2019 14:16:25 -0600 Subject: [PATCH 388/730] fates version with FatesInterfaceMod default private --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index ec59161e20..7e84230e21 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.23.0_a7.1.0 +tag = fates_s1.23.0_a7.1.0_rev2 required = True [PTCLM] From 82617e0c1dc4e3c6a820a8bf0666a55f6337f89b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 26 Mar 2019 16:12:25 -0600 Subject: [PATCH 389/730] Move fates version back to the stable NGEET version desired, but get fates param file that works with it --- Externals_CLM.cfg | 4 ++-- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index ec59161e20..eb7077fd75 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.23.0_a7.1.0 +repo_url = https://github.com/NGEET/fates +tag = sci.1.21.0_api.7.0.0 required = True [PTCLM] diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index d0522d97cc..6d4876a4b2 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190205.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc From 00308188ca642a6c19cd4f617663d5938df1dcde Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Mar 2019 11:16:27 -0600 Subject: [PATCH 390/730] Add a new expected fail --- cime_config/testdefs/ExpectedTestFails.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ff9e56cd06..d996d6f65e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -14,5 +14,6 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK + FAIL ERS_D_Ld3.f19_g16.I2000Clm50FatesCruGs.cheyenne_gnu.clm-FatesColdDef SHAREDLIB_BUILD From 941b472e27d6fc82a0136bdf058687ac700c92e7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Mar 2019 14:10:04 -0600 Subject: [PATCH 391/730] Revert "Move fates version back to the stable NGEET version desired, but get fates param file that works with it" This reverts commit 82617e0c1dc4e3c6a820a8bf0666a55f6337f89b. --- Externals_CLM.cfg | 4 ++-- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index eb7077fd75..ec59161e20 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.21.0_api.7.0.0 +repo_url = https://github.com/NCAR/fates-release +tag = fates_s1.23.0_a7.1.0 required = True [PTCLM] diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 6d4876a4b2..d0522d97cc 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190205.nc From a3423844d35886317234afac1a46bf7c41165d76 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Mar 2019 10:57:00 -0600 Subject: [PATCH 392/730] Point to NGEET repo --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index ec59161e20..eaf16ffd2c 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.23.0_a7.1.0 +repo_url = https://github.com/NGEET/fates +tag = sci.1.23.0_api.7.1.0 required = True [PTCLM] From 7d9b479c73f7412e9b2ad63cd10c8bf2812b9d17 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 28 Mar 2019 11:53:46 -0600 Subject: [PATCH 393/730] remove expected fail as working in 1.23.0 fates tag --- cime_config/testdefs/ExpectedTestFails.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d996d6f65e..ff9e56cd06 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -14,6 +14,5 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK - FAIL ERS_D_Ld3.f19_g16.I2000Clm50FatesCruGs.cheyenne_gnu.clm-FatesColdDef SHAREDLIB_BUILD From 0a24f4bc069bef7f901239946ca1fa1c41746949 Mon Sep 17 00:00:00 2001 From: ckoven Date: Tue, 29 May 2018 11:12:30 -0600 Subject: [PATCH 394/730] applied changes in ctsm github issue #85 to fix mfilt error --- src/main/controlMod.F90 | 4 +--- src/main/histFileMod.F90 | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 91f10e2828..dd6d37ed20 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -323,9 +323,7 @@ subroutine control_init( ) ! History and restart files do i = 1, max_tapes - if (hist_nhtfrq(i) == 0) then - hist_mfilt(i) = 1 - else if (hist_nhtfrq(i) < 0) then + if (hist_nhtfrq(i) < 0) then hist_nhtfrq(i) = nint(-hist_nhtfrq(i)*SHR_CONST_CDAY/(24._r8*dtime)) endif end do diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 0aaa2afae5..31a3d13f1d 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -66,7 +66,7 @@ module histFileMod integer, public :: & hist_ndens(max_tapes) = 2 ! namelist: output density of netcdf history files integer, public :: & - hist_mfilt(max_tapes) = 30 ! namelist: number of time samples per tape + hist_mfilt(max_tapes) = (/ 1, (30, ni=2, max_tapes/) ! namelist: number of time samples per tape logical, public :: & hist_dov2xy(max_tapes) = (/.true.,(.true.,ni=2,max_tapes)/) ! namelist: true=> do grid averaging integer, public :: & From b9c92b7ca189a91d9b14720b3b466c62e03db812 Mon Sep 17 00:00:00 2001 From: ckoven Date: Tue, 29 May 2018 11:49:34 -0600 Subject: [PATCH 395/730] compile-time bugfix on prior --- src/main/histFileMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 31a3d13f1d..74b7aeea24 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -66,7 +66,7 @@ module histFileMod integer, public :: & hist_ndens(max_tapes) = 2 ! namelist: output density of netcdf history files integer, public :: & - hist_mfilt(max_tapes) = (/ 1, (30, ni=2, max_tapes/) ! namelist: number of time samples per tape + hist_mfilt(max_tapes) = (/ 1, (30, ni=2, max_tapes)/) ! namelist: number of time samples per tape logical, public :: & hist_dov2xy(max_tapes) = (/.true.,(.true.,ni=2,max_tapes)/) ! namelist: true=> do grid averaging integer, public :: & From e957144383f10f824e5779f70ca189326c28a9a6 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 3 Apr 2019 09:20:31 -0600 Subject: [PATCH 396/730] Fix equation 2.5.135 reference --- doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index 7abed081fd..d967cd5ff0 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1531,7 +1531,7 @@ where :math:`\Delta T_{v} =1{\rm \; or\; }-1`. The error The error :math:`\lambda \Delta _{3}` is added to the sensible heat flux later. -#. Sensible heat flux :math:`H_{v}` (:eq:`` ). The three energy error +#. Sensible heat flux :math:`H_{v}` (:eq:`5.135` ). The three energy error terms, :math:`\Delta _{1}` , :math:`\Delta _{2}` , and :math:`\lambda \Delta _{3}` are also added to the sensible heat flux. From 395ab0ef241cfc9b37f612b7844f9e3240d79625 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 4 Apr 2019 19:00:30 -0600 Subject: [PATCH 397/730] Using temporary testing parameter file location for fates, set z0m and displa from FATES as constant. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 4 +++- cime_config/testdefs/testlist_clm.xml | 2 +- src/biogeophys/CanopyTemperatureMod.F90 | 9 ++++++--- src/utils/clmfates_interfaceMod.F90 | 5 +++++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index d0522d97cc..c811f8b0d4 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190205.nc + +/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_12blt_api.7.2.0.nc + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 56aefdaf5c..5cc29275ce 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1965,7 +1965,7 @@ - + diff --git a/src/biogeophys/CanopyTemperatureMod.F90 b/src/biogeophys/CanopyTemperatureMod.F90 index 97fc45884f..8f26e9dde7 100644 --- a/src/biogeophys/CanopyTemperatureMod.F90 +++ b/src/biogeophys/CanopyTemperatureMod.F90 @@ -400,15 +400,18 @@ subroutine CanopyTemperature(bounds, & ! of its dynamics call. If and when crops are ! enabled simultaneously with FATES, we will ! have to apply a filter here. - if(use_fates) then - call clm_fates%TransferZ0mDisp(bounds,frictionvel_inst,canopystate_inst) - end if +! if(use_fates) then +! call clm_fates%TransferZ0mDisp(bounds,frictionvel_inst,canopystate_inst) +! end if do fp = 1,num_nolakep p = filter_nolakep(fp) if( .not.(patch%is_fates(p))) then z0m(p) = z0mr(patch%itype(p)) * htop(p) displa(p) = displar(patch%itype(p)) * htop(p) + else + z0m(p) = 1.0_r8 + displa(p) = 10.0_r8 end if end do diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..0ec9d2ca3b 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1931,6 +1931,11 @@ subroutine TransferZ0mDisp(this,bounds_clump,frictionvel_inst,canopystate_inst) frictionvel_inst%z0m_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 canopystate_inst%displa_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 + if(this%fates(ci)%sites(s)%youngest_patch%patchno<1 .or. this%fates(ci)%sites(s)%youngest_patch%patchno>14)then + write(iulog,*) 'weird patch numbers',this%fates(ci)%sites(s)%youngest_patch%patchno + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + do ifp = 1, this%fates(ci)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) frictionvel_inst%z0m_patch(p) = this%fates(ci)%bc_out(s)%z0m_pa(ifp) From 645e52097b4c07f07d66c3b913880ceba3f7a1c3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 5 Apr 2019 14:30:09 -0600 Subject: [PATCH 398/730] Updated temporary fate default file location --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- src/biogeophys/CanopyFluxesMod.F90 | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index c811f8b0d4..eb7b827a1b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -356,7 +356,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_12blt_api.7.2.0.nc +/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_api.7.2.0.nc diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 7c9feb8a25..42e403b5ec 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -21,7 +21,6 @@ module CanopyFluxesMod use decompMod , only : bounds_type use PhotosynthesisMod , only : Photosynthesis, PhotoSynthesisHydraulicStress, PhotosynthesisTotal, Fractionation use EDAccumulateFluxesMod , only : AccumulateFluxes_ED - use EDBtranMod , only : btran_ed use SoilMoistStressMod , only : calc_effective_soilporosity, calc_volumetric_h2oliq use SoilMoistStressMod , only : calc_root_moist_stress, set_perchroot_opt use SimpleMathMod , only : array_div_vector From 2b46317ea650942d97cf6e856bb45cc7c62e0b1e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Sat, 6 Apr 2019 14:23:44 -0600 Subject: [PATCH 399/730] update default file location to fates api 7.2.0 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 4 +--- src/biogeophys/CanopyTemperatureMod.F90 | 9 +++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index eb7b827a1b..2e8104f944 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,9 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - -/glade/u/home/rgknox/ctsm/src/fates/parameter_files/fates_params_api.7.2.0.nc - +lnd/clm2/paramdata/fates_params_api.7.2.0.nc diff --git a/src/biogeophys/CanopyTemperatureMod.F90 b/src/biogeophys/CanopyTemperatureMod.F90 index 8f26e9dde7..97fc45884f 100644 --- a/src/biogeophys/CanopyTemperatureMod.F90 +++ b/src/biogeophys/CanopyTemperatureMod.F90 @@ -400,18 +400,15 @@ subroutine CanopyTemperature(bounds, & ! of its dynamics call. If and when crops are ! enabled simultaneously with FATES, we will ! have to apply a filter here. -! if(use_fates) then -! call clm_fates%TransferZ0mDisp(bounds,frictionvel_inst,canopystate_inst) -! end if + if(use_fates) then + call clm_fates%TransferZ0mDisp(bounds,frictionvel_inst,canopystate_inst) + end if do fp = 1,num_nolakep p = filter_nolakep(fp) if( .not.(patch%is_fates(p))) then z0m(p) = z0mr(patch%itype(p)) * htop(p) displa(p) = displar(patch%itype(p)) * htop(p) - else - z0m(p) = 1.0_r8 - displa(p) = 10.0_r8 end if end do From 3439da7e07ee6174229568bae6bae148b550ed9d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Sat, 6 Apr 2019 14:50:03 -0600 Subject: [PATCH 400/730] Removed temporary in-code diagnostic in the fates interface --- src/utils/clmfates_interfaceMod.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 0ec9d2ca3b..84c4e5901f 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1931,11 +1931,6 @@ subroutine TransferZ0mDisp(this,bounds_clump,frictionvel_inst,canopystate_inst) frictionvel_inst%z0m_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 canopystate_inst%displa_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - if(this%fates(ci)%sites(s)%youngest_patch%patchno<1 .or. this%fates(ci)%sites(s)%youngest_patch%patchno>14)then - write(iulog,*) 'weird patch numbers',this%fates(ci)%sites(s)%youngest_patch%patchno - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - do ifp = 1, this%fates(ci)%sites(s)%youngest_patch%patchno p = ifp+col%patchi(c) frictionvel_inst%z0m_patch(p) = this%fates(ci)%bc_out(s)%z0m_pa(ifp) From c56da1833522fcfe01fa797739b12308064afb18 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 9 Apr 2019 15:29:56 -0600 Subject: [PATCH 401/730] Updated the fates default parameter file to use description and date as well as the tag. Added the long hydro test to expected fails. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- cime_config/testdefs/ExpectedTestFails.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 2e8104f944..979aa29bb7 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.2.0.nc +lnd/clm2/paramdata/fates_params_api.7.2.0_12pft_c190409.nc diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ff9e56cd06..3ab5e7cc64 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -14,5 +14,6 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK + FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro RUN From 6ae74215654996d9c6a6395c5e7a541278dbe60c Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 9 Apr 2019 22:59:28 -0600 Subject: [PATCH 402/730] Extended wallime of the fates ly2 1x1 brazil smoke test on cheyenne --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5cc29275ce..f2632b2fe8 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1965,7 +1965,7 @@ - + From e580a8908bbf7cc6c0d8fde85b964fc699dde16a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 10 Apr 2019 13:41:53 -0600 Subject: [PATCH 403/730] Reduced 2 year fates test to 13 months --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f2632b2fe8..0fc19a16d3 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1959,7 +1959,7 @@ - + From 2cb96c6577ebf9065e17946294b80071dbfe49d8 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 10 Apr 2019 17:02:49 -0600 Subject: [PATCH 404/730] Updated fates tag in externals --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index eaf16ffd2c..32431cb476 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.23.0_api.7.1.0 +tag = sci.1.26.1_api.7.2.0 required = True [PTCLM] From 9ee0e92298fdd88fd866b5345bdf819862dfb0d7 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 11 Apr 2019 10:51:41 -0700 Subject: [PATCH 405/730] update fates output flux variable names --- src/utils/clmfates_interfaceMod.F90 | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 79f719515d..41a561e2ee 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -109,6 +109,7 @@ module CLMFatesInterfaceMod use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type + use EDTypesMod , only : num_elements use FatesInterfaceMod , only : hlm_numlevgrnd use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site @@ -709,11 +710,14 @@ subroutine dynamics_driv(this, nc, bounds_clump, & nld_si = this%fates(nc)%bc_in(s)%nlevdecomp soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lab_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_lab_c_si(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_cel_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_cel_c_si(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lig_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_lig_c_si(1:nld_si) + end do @@ -2504,6 +2508,19 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%cnlfpft_begin = 1 fates%cnlfpft_end = nlevleaf * nclmax * numpft_fates + + fates%elem_begin = 1 + fates%elem_end = num_elements + + fates%elpft_begin = 1 + fates%elpft_end = num_elements * numpft_fates + + fates%elcwd_begin = 1 + fates%elcwd_end = num_elements * ncwd + + fates%elage_begin = 1 + fates%elage_end = num_elements * nlevage + end subroutine hlm_bounds_to_fates_bounds From 55129b8fa8f5e923be5f5f78e23e1a6819862083 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 18 Apr 2019 17:29:06 -0700 Subject: [PATCH 406/730] Changed call to fates routine FluxIntoLitterPools --- src/utils/clmfates_interfaceMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 87acba3fe9..42d2ae2457 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -123,7 +123,7 @@ module CLMFatesInterfaceMod use EDCanopyStructureMod , only : canopy_summarization, update_hlm_dynamics use FatesPlantRespPhotosynthMod, only : FatesPlantRespPhotosynthDrive use EDAccumulateFluxesMod , only : AccumulateFluxes_ED - use EDPhysiologyMod , only : flux_into_litter_pools + use EDPhysiologyMod , only : FluxIntoLitterPools use FatesPlantHydraulicsMod, only : hydraulics_drive use FatesPlantHydraulicsMod, only : HydrSiteColdStart use FatesPlantHydraulicsMod, only : InitHydrSites @@ -688,7 +688,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! call subroutine to aggregate fates litter output fluxes and ! package them for handing across interface - call flux_into_litter_pools(this%fates(nc)%nsites, & + call FluxIntoLitterPools(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out) From 1912158f512aaa0143f4ee1270358e8c3663abcd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 19 Apr 2019 15:54:23 -0600 Subject: [PATCH 407/730] Add SSP-RCP option for CO2 files --- bld/namelist_files/namelist_defaults_clm4_5_tools.xml | 10 ++++++++-- tools/ncl_scripts/getco2_historical.ncl | 8 ++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index f81491bbfa..6f84b8281e 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -7392,7 +7392,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc -/gpfs/fs1/p/acom/acom-climate/cesm2/inputdata/atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180905.nc +atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc +atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180926.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP126_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP245_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP370_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP460_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP534os_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP585_0p5degLat_c180905.nc diff --git a/tools/ncl_scripts/getco2_historical.ncl b/tools/ncl_scripts/getco2_historical.ncl index 7284dc88b7..8558f6dd01 100644 --- a/tools/ncl_scripts/getco2_historical.ncl +++ b/tools/ncl_scripts/getco2_historical.ncl @@ -19,6 +19,7 @@ begin csmdata = getenv("CSMDATA"); clmroot = getenv("CLM_ROOT"); hgrid = getenv("HGRID"); ; Get horizontal grid to use from env variable + ssp_rcp = getenv("SSP_RCP"); ; Get SSP-RCP future scenario to use from env variable querynml = "bld/queryDefaultNamelist.pl -silent -justvalue "; if ( .not. ismissing(csmdata) )then querynml = querynml+" -csmdata "+csmdata; @@ -31,12 +32,15 @@ begin if ( ismissing(hgrid) )then hgrid = "lat-bands" end if + if ( ismissing(ssp_rcp) )then + ssp_rcp = "hist" + end if ; ; Get input Greenhouse gas file and open it ; filetype = "mkghg_bndtvghg"; print( querynml+" -namelist clmexp -var "+filetype+" -options hgrid="+hgrid ); - ghgfile = systemfunc( querynml+" -namelist clmexp -var "+filetype+" -options hgrid="+hgrid ); + ghgfile = systemfunc( querynml+" -namelist clmexp -var "+filetype+" -options hgrid="+hgrid+",ssp_rcp="+ssp_rcp ); print( "Use "+filetype+" file: "+ghgfile ); if ( systemfunc("test -f "+ghgfile+"; echo $?" ) .ne. 0 )then print( "Input "+filetype+" file does not exist or not found: "+ghgfile ); @@ -57,7 +61,7 @@ begin sim_yr_rng = "_simyr_"+sim_yr0 + "-" + sim_yr2; cmip_vers = "_CMIP6_"; - outco2filename = "fco2_datm_"+hgrid+sim_yr_rng+cmip_vers+"c"+sdate+".nc"; + outco2filename = "fco2_datm_"+hgrid+ssp_rcp+"_"+sim_yr_rng+cmip_vers+"c"+sdate+".nc"; system( "/bin/rm -f "+outco2filename ); print( "output file: "+outco2filename ); nco = addfile( outco2filename, "c" ); From 60d17b93423a9b360be285b4438b78ad4ce729a6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 20 Apr 2019 23:18:35 -0600 Subject: [PATCH 408/730] Get mksurfdata.pl working fixing #672 --- tools/mksurfdata_map/mksurfdata.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index ee7b180ff4..72cc9eb93d 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -538,7 +538,7 @@ sub write_namelist_file { my @rcpaths = split( ",", $opts{'ssp_rcp'} ); # Check that ssp_rcp is valid foreach my $ssp_rcp ( @rcpaths ) { - if ( ! $definition->is_valid_value( "ssp_rcp", $ssp_rcp ) ) { + if ( ! $definition->is_valid_value( "ssp_rcp", "'$ssp_rcp'" ) ) { print "** Invalid ssp_rcp: $ssp_rcp\n"; usage(); } From 1db5b859398b59e9740ceff51c357a5cbbe8859e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 20 Apr 2019 23:19:45 -0600 Subject: [PATCH 409/730] Get hirespft option in mksurfdata.pl working, fix #262, use previous PFT land-mask rather than new one --- bld/namelist_files/namelist_defaults_clm4_5_tools.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 6f84b8281e..9c79f24c32 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -212,7 +212,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190420.nc lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190420.nc +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_1850.c190119.nc + lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_2005.c190420.nc From de6925805257cadd018837a88e8d3ae2d121a904 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 28 Mar 2019 20:32:06 -0600 Subject: [PATCH 410/730] Point to more recent esmf version ESMF version 7.0.0 has a bug that is fixed in 7.1.0r. Fixes ESCOMP/ctsm#642 --- tools/mkmapdata/README | 4 ++-- tools/mkmapdata/mkmapdata.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/mkmapdata/README b/tools/mkmapdata/README index b865e72f2d..3f5e9e92c2 100644 --- a/tools/mkmapdata/README +++ b/tools/mkmapdata/README @@ -12,7 +12,7 @@ two versions, one with mpiuni and one with mpi. Both versions also need to be built with NetCDF rather than the default IO version. -Currently uses: ESMF7.0.0 +Currently uses: ESMF7.1.0r Do the following for help with the different options to the script... @@ -44,7 +44,7 @@ and --src_type UGRID. http://www.earthsystemmodeling.org/ You may need more than one version to do everything above. On cheyenne -we use ESMF7.0.0. +we use ESMF7.1.0r. The version of NetCDF used with ESMF needs to be version 4.1 or higher and compiled with the NetCDF4 file format enabled (with HDF5 compression). diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index 2aad9f24fe..2d1ab6e85e 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -342,7 +342,7 @@ case $hostname in if [ -z "$REGRID_PROC" ]; then REGRID_PROC=36 fi - esmfvers=7.0.0 + esmfvers=7.1.0r intelvers=17.0.1 module load esmf_libs/$esmfvers module load intel/$intelvers @@ -371,7 +371,7 @@ case $hostname in if [ -z "$REGRID_PROC" ]; then REGRID_PROC=8 fi - esmfvers=7.0.0 + esmfvers=7.1.0r intelvers=15.0.0 #intelvers=12.1.5 module purge From 7a30257cb19c720b2953af1032a7bc916a553724 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 20 Apr 2019 23:41:06 -0600 Subject: [PATCH 411/730] Fix Typo in SSP5-3.4 C13 isotope file name #664 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index ebb43d15b6..bee12a73ea 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -94,7 +94,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP126_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP245_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP3B_1850-2100_yearly_c181209.nc -lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP34os_1850-2100_yearly_c181209.nc +lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP534os_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP5B_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c171012.nc From 77ea8009619900bba489abdcfa2f614f1a39a481 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 20 Apr 2019 23:42:22 -0600 Subject: [PATCH 412/730] Fix Mask name is wrong for gx1v7 for clm40 on release #678 --- bld/namelist_files/namelist_definition_clm4_0.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_clm4_0.xml b/bld/namelist_files/namelist_definition_clm4_0.xml index 7f51c5c874..b699022f8e 100644 --- a/bld/namelist_files/namelist_definition_clm4_0.xml +++ b/bld/namelist_files/namelist_definition_clm4_0.xml @@ -685,7 +685,7 @@ Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for + valid_values="USGS,gx3v7,gx1v6,gx1v7,navy,test,tx0.1v2,tx1v1,T62,cruncep"> Land mask description From 105fa47e02b824201242db2f05924043e4510dbc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 20 Apr 2019 23:57:21 -0600 Subject: [PATCH 413/730] Add SSP3-7.0 and SSP2-4.5 ndep files --- bld/namelist_files/namelist_defaults_clm4_5.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index bee12a73ea..6f703af52a 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1102,6 +1102,12 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc + +lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc + cycle NDEP_month From d2c28c2a4ca2fc41e7404bc95f990af05cee2887 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Apr 2019 16:37:30 -0600 Subject: [PATCH 414/730] Add CO2 global annual average files as well as lat-bnd ones --- bld/namelist_files/namelist_defaults_clm4_5_tools.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 9c79f24c32..75b3443d5b 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -7397,6 +7397,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180926.nc + atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP126_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP245_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP370_0p5degLat_c180905.nc @@ -7404,4 +7405,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP534os_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP585_0p5degLat_c180905.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP245_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP370_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP460_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP534os_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP585_0p5degLat_GlobAnnAvg_c190301.nc + From 770c3cd7560dabd9a777c2f1916dc237710857bd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Apr 2019 16:38:40 -0600 Subject: [PATCH 415/730] Add in new ndep files for SSP2-4.5 and SSP3-7.0, and point to new files instead of the CMIP5 files for the missing ones --- .../namelist_defaults_clm4_5.xml | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 6f703af52a..d02960c3bf 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1102,33 +1102,24 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc + +lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc + +lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc + cycle NDEP_month - -cycle -NDEP_month -cycle -NDEP_month -cycle -NDEP_month -cycle -NDEP_month -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc - extend NDEP_year @@ -1142,12 +1133,12 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n >lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc +>lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc +lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc Date: Tue, 23 Apr 2019 10:29:50 -0600 Subject: [PATCH 416/730] Update cime version --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index a9533d1007..a7c05ccdc6 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.13 +tag = cime5.6.14 required = True [externals_description] From 306599f95f721f0f4078e2c476e3382b44e1cd17 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 23 Apr 2019 14:02:14 -0700 Subject: [PATCH 417/730] Removed some outdated mass balance accounting code in fates interface --- src/utils/clmfates_interfaceMod.F90 | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 47798e4b53..d369ed0b9e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -107,7 +107,6 @@ module CLMFatesInterfaceMod use FatesHistoryInterfaceMod, only : fates_history_interface_type use FatesRestartInterfaceMod, only : fates_restart_interface_type - use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type use EDTypesMod , only : num_elements use FatesInterfaceMod , only : hlm_numlevgrnd @@ -1884,29 +1883,6 @@ subroutine wrap_bgc_summary(this, nc, soilbiogeochem_carbonflux_inst, & this%fates(nc)%bc_in(s)%tot_somc = totsomc(c) this%fates(nc)%bc_in(s)%tot_litc = totlitc(c) end do - - is_beg_day = is_beg_curr_day() - dtime = get_step_size() - nstep = get_nstep() - - call SummarizeNetFluxes(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day) - - - call FATES_BGC_Carbon_Balancecheck(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day, & - dtime, nstep) - - - ! Update history variables that track these variables - call this%fates_hist%update_history_cbal(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) - end associate end subroutine wrap_bgc_summary From 37de14159283c7405e396ea19a53b0912aba7f79 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Apr 2019 02:20:18 -0600 Subject: [PATCH 418/730] Add in ciso test to ensure Carbon isotopes on and off give the same answers to the bulk Carbon --- cime_config/config_tests.xml | 10 ++++++++++ cime_config/testdefs/testlist_clm.xml | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index fb04cfb692..911afe014b 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -56,6 +56,16 @@ SSP smoke CLM spinup test (only valid for CLM compsets with CLM45) never + + CTSM Land model test to ensure Carbon isotopes on or off does NOT change answers + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + smoke CLM spinup test (only valid for CLM45 or CLM50 compsets) 1 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b0ac7d123b..fdcac2d310 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1101,6 +1101,15 @@ + + + + + + + + + From edb1374cc8fe5800de3e2f4cb3eeabcc2a90883e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Apr 2019 16:08:55 -0600 Subject: [PATCH 419/730] Add in ciso fix for #686 on the release branch --- src/biogeochem/CNVegetationFacade.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index 22de5bd8b6..fed7889819 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -709,12 +709,12 @@ subroutine DynamicAreaConservation(this, bounds, clump_index, & if (use_c13) then call CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & this%c13_cnveg_carbonflux_inst, this%c13_cnveg_carbonstate_inst, & - soilbiogeochem_carbonstate_inst) + c13_soilbiogeochem_carbonstate_inst) end if if (use_c14) then call CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & this%c14_cnveg_carbonflux_inst, this%c14_cnveg_carbonstate_inst, & - soilbiogeochem_carbonstate_inst) + c14_soilbiogeochem_carbonstate_inst) end if call NStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & this%cnveg_nitrogenflux_inst, this%cnveg_nitrogenstate_inst, & From abb34e4aa35a77e601113f86967ed724c09c2f9d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2019 12:12:07 -0600 Subject: [PATCH 420/730] Use the correct fates param file for this version, and bring in the branch version that works on hobart nag --- Externals_CLM.cfg | 2 +- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 3a50edc1d7..23d74d10e2 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/ncar/fates-release -tag = fates_s1.21.0_a7.0.0 +tag = fates_s1.21.0_a7.0.0_br_rev2 required = True [PTCLM] diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index d02960c3bf..30f43ff9d0 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -378,7 +378,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190205.nc +lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc From 0b27b990f2465804dff0731739691431d7a63742 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2019 15:36:17 -0600 Subject: [PATCH 421/730] Fix #700 so SSP first and align years start with year 2015 as this is standard --- .../namelist_defaults_clm4_5.xml | 48 +++++-------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 30f43ff9d0..b91e92d4f8 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1055,13 +1055,13 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc -1850 +2015 2100 -1850 +2015 -1850 +2015 2100 -1850 +2015 2010 2010 @@ -1081,15 +1081,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n 2000 2000 -1850 -2015 - -1850 -2100 - -2000 -2100 - lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc cycle NDEP_month +limit extend @@ -1203,13 +1195,13 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n nn -1850 +2015 2100 -1850 +2015 -1850 +2015 2100 -1850 +2015 2010 2010 @@ -1229,15 +1221,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n 2000 2000 -1850 -2016 - -1850 -2016 - -1850 -2016 - lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc @@ -1267,9 +1250,9 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n nn -1850 +2015 2106 -1850 +2015 2000 2000 @@ -1289,15 +1272,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n 2000 2000 -1850 -2106 - -1850 -2106 - -1850 -2106 - lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc From 96fd4c164262e6b21e59cf83c3d9aba07d3e1bac Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2019 15:37:36 -0600 Subject: [PATCH 422/730] For 2-degree compsets use the no-Carbon-isotope option for CMIP6DECK cases --- cime_config/config_component.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 2988e615dd..2672fd133b 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -242,8 +242,9 @@ - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck run_component_clm env_case.xml From 71a4666b28437c654d982500196289e99033e09d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2019 15:38:27 -0600 Subject: [PATCH 423/730] Add a 2-degree CMIP6DECK test, and add some notes about the other existing short one --- cime_config/testdefs/testlist_clm.xml | 12 ++++++++++-- .../cmip6_nociso_deck/include_user_mods | 3 +++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 cime_config/usermods_dirs/cmip6_nociso_deck/include_user_mods diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index fdcac2d310..8c55610187 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1529,11 +1529,19 @@ - - + + + + + + + + + + diff --git a/cime_config/usermods_dirs/cmip6_nociso_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_nociso_deck/include_user_mods new file mode 100644 index 0000000000..1e912156d6 --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_nociso_deck/include_user_mods @@ -0,0 +1,3 @@ +../_includes/cmip6_glaciers_cplhist +../_includes/cmip6_glaciers_virtual_antarctica +../output_crop From da26df860deb60a451d1144230835856534b4a30 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2019 23:37:35 -0600 Subject: [PATCH 424/730] Add hirespft mksurfdata_map test --- test/tools/nl_files/mksrfdt_5x5_amazon_hirespft_2005 | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/tools/nl_files/mksrfdt_5x5_amazon_hirespft_2005 diff --git a/test/tools/nl_files/mksrfdt_5x5_amazon_hirespft_2005 b/test/tools/nl_files/mksrfdt_5x5_amazon_hirespft_2005 new file mode 100644 index 0000000000..47a5391c84 --- /dev/null +++ b/test/tools/nl_files/mksrfdt_5x5_amazon_hirespft_2005 @@ -0,0 +1 @@ +-l CSMDATA -r 5x5_amazon -y 2005 -hirespft -exedir EXEDIR From 3e794ed5728f6fd10bf08eeabab9ee6e1b0fe86a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 12:02:18 -0600 Subject: [PATCH 425/730] Add MODISv2 3minx3min SCRIP grid for the new hirespft files, fix the termination of the CO2 files --- .../namelist_defaults_clm4_5_tools.xml | 15 +++++--- .../namelist_definition_clm4_5.xml | 2 +- cime_config/SystemTests/lciso.py | 37 +++++++++++++++++++ cime_config/testdefs/ExpectedTestFails.xml | 1 + test/tools/README.testnames | 1 + test/tools/input_tests_master | 3 ++ test/tools/tests_pretag_cheyenne_nompi | 1 + tools/mkmapdata/mkmapdata.sh | 35 +++++++++--------- 8 files changed, 71 insertions(+), 24 deletions(-) create mode 100644 cime_config/SystemTests/lciso.py diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 75b3443d5b..01b26fd9f7 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -78,9 +78,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/mappingdata/grids/SCRIPgrid_10x10min_IGBPmergeICESatGIS_c110818.nc lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODIS_c110915.nc +lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODISv2_c190503.nc lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODISwcspsea_c151020.nc 64bit_offset +64bit_offset 64bit_offset lnd/clm2/mappingdata/grids/SCRIPgrid_3x3_USGS_c120912.nc @@ -7405,11 +7408,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP534os_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP585_0p5degLat_c180905.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP245_0p5degLat_GlobAnnAvg_c190301.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP370_0p5degLat_GlobAnnAvg_c190301.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP460_0p5degLat_GlobAnnAvg_c190301.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP534os_0p5degLat_GlobAnnAvg_c190301.nc -atm/waccm/lb/LBC_2014-2500_CMIP6_SSP585_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP245_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP370_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP460_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP534os_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP585_0p5degLat_GlobAnnAvg_c190301.nc diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 5aaeec2e90..9458c7776b 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1729,7 +1729,7 @@ Mapping file to go from one resolution/land-mask to another resolution/land-mask + valid_values="nomask,navy,AVHRR,MODIS,MODISv2,USGS,IGBPmergeICESatGIS,IGBP-GSDP,ISRIC-WISE,LandScan2004,GLOBE-Gardner,GLOBE-Gardner-mergeGIS,GRDC,HYDRO1K-merge-nomask,ORNL-Soil"> Land mask description for mksurfdata input files diff --git a/cime_config/SystemTests/lciso.py b/cime_config/SystemTests/lciso.py new file mode 100644 index 0000000000..214d2c4ccc --- /dev/null +++ b/cime_config/SystemTests/lciso.py @@ -0,0 +1,37 @@ +""" +Implementation of the CIME LCISO (Land Carbon Isotope) test. +This is a CTSM specific test: +Verifies turning on carbon isotopes doesn't change answers +(1) do a run with Carbon isotopes off (suffix base) +(2) add C13 and C14 carbon isotopes on with their time-series (suffix cisoallon) +""" + +from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo +from CIME.XML.standard_module_setup import * +from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files + +logger = logging.getLogger(__name__) + +class LCISO(SystemTestsCompareTwo): + + def __init__(self, case): + SystemTestsCompareTwo.__init__(self, case, + separate_builds = False, + run_two_suffix = 'cisoallon', + run_one_description = 'carbon isotopes off', + run_two_description = 'c13 and c14 isotopes on as well as C isotope time series') + + def _case_one_setup(self): + append_to_user_nl_files(caseroot = self._get_caseroot(), + component = "clm", + contents = "use_c13=F, use_c14=F") + + def _case_two_setup(self): + append_to_user_nl_files(caseroot = self._get_caseroot(), + component = "clm", + contents = "use_c13=.true.,use_c14=.true.,use_c13_timeseries=.true.,use_c14_bombspike=.true.," + \ + "hist_fexcl1='C13_AR','C13_GPP','C13_HR','C13_NBP','C13_SOILC_vr','C13_TOTECOSYSC'," + \ + "'C13_TOTLITC','C13_TOTSOMC','C13_TOTVEGC','C14_AR','C14_GPP','C14_HR','C14_NBP'," + \ + "'C14_SOILC_vr','C14_TOTECOSYSC','C14_TOTLITC','C14_TOTSOMC','C14_TOTVEGC'") + + diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d6edb6d0f4..c99b312819 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -8,6 +8,7 @@ FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN + FAIL LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly COMPARE FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest diff --git a/test/tools/README.testnames b/test/tools/README.testnames index 5cb5de027a..2795a14f0a 100644 --- a/test/tools/README.testnames +++ b/test/tools/README.testnames @@ -36,6 +36,7 @@ m is the resolution 1 -- 48x96 5 -- 10x15 +6 -- 5x5_amazon 7 -- 1x1 brazil 8 -- US-UMB 9 -- 4x5 diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index 90b8aa293a..78f323fb3a 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -23,6 +23,9 @@ bli57 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ smi58 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_crp_1850-2000^tools__do bli58 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_crp_1850-2000^tools__do +smi64 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_5x5_amazon_hirespft_2005^tools__ds +bli64 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_5x5_amazon_hirespft_2005^tools__ds + smi74 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds bli74 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds smi78 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds diff --git a/test/tools/tests_pretag_cheyenne_nompi b/test/tools/tests_pretag_cheyenne_nompi index c3a2325cea..1f35731f8d 100644 --- a/test/tools/tests_pretag_cheyenne_nompi +++ b/test/tools/tests_pretag_cheyenne_nompi @@ -4,6 +4,7 @@ sme@4 ble@4 smg54 blg54 smi24 bli24 smi53 bli53 +smi64 bli64 smi54 bli54 smi57 bli57 smi58 bli58 diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index 2d1ab6e85e..37b54521d9 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -263,23 +263,24 @@ fi if [ "$phys" = "clm4_5" ]; then grids=( \ - "0.5x0.5_AVHRR" \ - "0.25x0.25_MODIS" \ - "0.5x0.5_MODIS" \ - "3x3min_LandScan2004" \ - "3x3min_MODIS-wCsp" \ - "3x3min_USGS" \ - "5x5min_nomask" \ - "5x5min_IGBP-GSDP" \ - "5x5min_ISRIC-WISE" \ - "5x5min_ORNL-Soil" \ - "10x10min_nomask" \ - "10x10min_IGBPmergeICESatGIS" \ - "3x3min_GLOBE-Gardner" \ - "3x3min_GLOBE-Gardner-mergeGIS" \ - "0.9x1.25_GRDC" \ - "360x720cru_cruncep" \ - "1km-merge-10min_HYDRO1K-merge-nomask" \ + #"0.5x0.5_AVHRR" \ + #"0.25x0.25_MODIS" \ + #"0.5x0.5_MODIS" \ + #"3x3min_LandScan2004" \ + "3x3min_MODIS-2005" \ + #"3x3min_MODIS-wCsp" \ + #"3x3min_USGS" \ + #"5x5min_nomask" \ + #"5x5min_IGBP-GSDP" \ + #"5x5min_ISRIC-WISE" \ + #"5x5min_ORNL-Soil" \ + #"10x10min_nomask" \ + #"10x10min_IGBPmergeICESatGIS" \ + #"3x3min_GLOBE-Gardner" \ + #"3x3min_GLOBE-Gardner-mergeGIS" \ + #"0.9x1.25_GRDC" \ + #"360x720cru_cruncep" \ + #"1km-merge-10min_HYDRO1K-merge-nomask" \ ) else From 27f8484fa61cbf72995255a05de2f9fc0e7667f6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 12:06:42 -0600 Subject: [PATCH 426/730] Revert the last commit for mkmapdata, but also add the 3x3min_MODISv2 to the list of maps that are made --- tools/mkmapdata/mkmapdata.sh | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index 37b54521d9..bf5214d27b 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -263,24 +263,24 @@ fi if [ "$phys" = "clm4_5" ]; then grids=( \ - #"0.5x0.5_AVHRR" \ - #"0.25x0.25_MODIS" \ - #"0.5x0.5_MODIS" \ - #"3x3min_LandScan2004" \ - "3x3min_MODIS-2005" \ - #"3x3min_MODIS-wCsp" \ - #"3x3min_USGS" \ - #"5x5min_nomask" \ - #"5x5min_IGBP-GSDP" \ - #"5x5min_ISRIC-WISE" \ - #"5x5min_ORNL-Soil" \ - #"10x10min_nomask" \ - #"10x10min_IGBPmergeICESatGIS" \ - #"3x3min_GLOBE-Gardner" \ - #"3x3min_GLOBE-Gardner-mergeGIS" \ - #"0.9x1.25_GRDC" \ - #"360x720cru_cruncep" \ - #"1km-merge-10min_HYDRO1K-merge-nomask" \ + "0.5x0.5_AVHRR" \ + "0.25x0.25_MODIS" \ + "0.5x0.5_MODIS" \ + "3x3min_LandScan2004" \ + "3x3min_MODISv2" \ + "3x3min_MODIS-wCsp" \ + "3x3min_USGS" \ + "5x5min_nomask" \ + "5x5min_IGBP-GSDP" \ + "5x5min_ISRIC-WISE" \ + "5x5min_ORNL-Soil" \ + "10x10min_nomask" \ + "10x10min_IGBPmergeICESatGIS" \ + "3x3min_GLOBE-Gardner" \ + "3x3min_GLOBE-Gardner-mergeGIS" \ + "0.9x1.25_GRDC" \ + "360x720cru_cruncep" \ + "1km-merge-10min_HYDRO1K-merge-nomask" \ ) else From 1454eaabe559c98d45713861a8b2547617c47bc8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 14:47:41 -0600 Subject: [PATCH 427/730] Point to the previous version of the hirespft dataset, and setup the maps for it to be MODISv2, as there aren't mapping files, mksurfdata.pl -hirespft will NOT run because of the missing files, also correct the fail message for the LCISO test that fails --- .../namelist_defaults_clm4_5_tools.xml | 16 ++++++++-------- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 01b26fd9f7..363d5a3eee 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -136,13 +136,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). AVHRR AVHRR MODIS -MODIS +MODISv2 MODIS -MODIS +MODISv2 MODIS LandScan2004 MODIS -MODIS +MODISv2 ISRIC-WISE GLOBE-Gardner GLOBE-Gardner-mergeGIS @@ -214,8 +214,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190420.nc +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc -lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190420.nc +lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_1850.c190119.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_2005.c190420.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_2005.c190119.nc diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index c99b312819..71881f6b99 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -8,7 +8,7 @@ FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN - FAIL LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly COMPARE + FAIL LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly COMPARE_base_cisoallon FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest From 3576702b3b4d61d1d0313e8f4fd5a0a5a41c1f87 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 15:57:25 -0600 Subject: [PATCH 428/730] Remove the build of fates/main since there currently are not any unit tests and the build is failing --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index be66201047..3e4ab93151 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -35,7 +35,6 @@ add_subdirectory(${CLM_ROOT}/src/biogeophys clm_biogeophys) add_subdirectory(${CLM_ROOT}/src/dyn_subgrid clm_dyn_subgrid) add_subdirectory(${CLM_ROOT}/src/main clm_main) add_subdirectory(${CLM_ROOT}/src/init_interp clm_init_interp) -add_subdirectory(${CLM_ROOT}/src/fates/main fates_main) # Add general unit test directories (stubbed out files, etc.) add_subdirectory(unit_test_stubs) From 730df1bd240620458848e77a325e773e932c9aa7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 15:58:07 -0600 Subject: [PATCH 429/730] Add the last missing SSP --- bld/unit_testers/build-namelist_test.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 501d060466..be58b1991d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 860; +my $ntests = 872; if ( defined($opts{'compare'}) ) { - $ntests += 531; + $ntests += 540; } plan( tests=>$ntests ); @@ -1292,7 +1292,7 @@ sub make_env_run { system( "../configure -s $mode" ); my @tran_res = ( "0.9x1.25", "1.9x2.5", "10x15" ); foreach my $usecase ( "1850_control", "1850-2100_SSP5-8.5_transient", "1850-2100_SSP1-2.6_transient", "1850-2100_SSP3-7.0_transient", - "1850-2100_SSP5-3.4_transient", "1850-2100_SSP2-4.5_transient", "1850-2100_SSP1-1.9_transient", + "1850-2100_SSP4-3.4_transient", "1850-2100_SSP5-3.4_transient", "1850-2100_SSP2-4.5_transient", "1850-2100_SSP1-1.9_transient", "1850-2100_SSP4-6.0_transient" ) { foreach my $res ( @tran_res ) { $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . "; From 5a72bb9dca7f995dd7176195aab276ff74fd05ac Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 3 May 2019 16:11:25 -0600 Subject: [PATCH 430/730] Update change files --- doc/.ChangeLog_template | 5 +- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 129 +++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 3 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 3d73dbee63..5900998e46 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -99,12 +99,11 @@ CTSM testing: hobart_pgi -------- hobart_intel ------ -CTSM tag used for the baseline comparisons: - - Answer changes -------------- +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + Changes answers relative to baseline: If a tag changes answers relative to baseline comparison the diff --git a/doc/ChangeSum b/doc/ChangeSum index 87e086ae48..1e6d371863 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.21 erik 05/03/2019 New ndep files, update fates, fix some issues release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes release-clm5.0.19 erik 03/08/2019 Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used release-clm5.0.18 erik 02/13/2019 Add NoAnthro compset, reduce fields on fsurdat in mksurfdata_map, initial add of tools/contrib directory diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 9225aff766..1bbae40299 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,133 @@ =============================================================== +Tag name: release-clm5.0.21 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri May 3 16:10:35 MDT 2019 +One-line Summary: New ndep files, update fates, fix some issues + +Purpose of this version: +------------------------ + +New nitrogen deposition files for future scenarios: SSP245 and SSP370. And now points +to the closest reasonable new CMIP6 SSP ndep file that we have (for clm50, clm45 points +to the old RCP files). + +Update FATES to s1.21.0.a7.0.0. Which brings in a list of improvements and bug fixes. New +options include fates-hydro and fates-parteh + +Point to all of the available CO2 files, so we can convert them for use by datm. + +Bring in new high resolution PFT land-mask SCRIP grid file (MODISv2), as a start to get the -hirespft +option to work in mksrfdata.pl. Mapping files still need to be created. + +Add a test that turning on Carbon isotopes does NOT change answers (currently triggered because of #667) + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #706, #700, #678, #664, #642, #672, and #262 + Fix #706 -- Add cmip6_nociso_deck user-mods directory and point to it for f19 CMIP6DECK compsets + Fix #700 -- Stream start/align incorrect for SSP's + Fix #678 -- Wrong mask name for clm40 + Fix #664 -- Typo in SSP5-3.4 c13 isotope file + Fix #642 -- Update ESMF libarary for maps to ESMF7.1.0r + Fix #672 -- mksurfdata.pl aborts with error + Fix #262 -- hirespft option to mksurfdata.pl doesn't work (partial now needs maps) + +Science changes since: release-clm5.0.20 + Updated domain files for f19 resolution causes a small change in answers + + FATES updated from version 1.8.1 to 1.21.0. List of improvements include: + Some new options that came in various versions: fates-hydro, variable SLA Profile and Wood CN Ratio, parteh, + optional maintenance respiration throttling, optional trimming logic to roots + Changes to Norman Canopy radiation + A bug to some pointers that spread outside where they should have. + Some bug fixes in allometry + The Plant Allocation Reactive Transport Extensible Hypotheses (PARTEH) v1 software infrastructure has been added. + Key changes that enable simulation of a coastal salt mars + Remove Lasslop wind effects on fire Rate of Spread + Fixes to fire mortality diagnostics, patch disturbance area checks and trimming + +Software changes since: release-clm5.0.20 + + hirespft dataset now uses the MODISv2 mask + +Changes to User Interface since: release-clm5.0.20 + New ndep files for SSP245 and SSP370. For Clm50 point to one of the new ndep files for every SSP + even if the exact one isn't yet available (for Clm45 it points to the CMIP5 RCP scenarios) + + New fates namelist option: fates_parteh_mode (switches nutrient model in FATES) + + Remove fates finidat file + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - OK (67 tests different because of new fates parameter file, and first/align changes for SSP's) + + unit-tests (components/clm/src): + + cheyenne - OK + + tools-tests (components/clm/test/tools): + + cheyenne - OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: FATES and f19 resolution + - what platforms/compilers: All + - nature of change: + f19 is a small change due to updated domain files + FATES science changed from version 1.8.1 to 1.21.0 + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime5.6.14 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + + +CTSM Tag versions pulled over from master development branch: Pull LCISO test from ctsm1.0.dev036 + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #695 -- Add more ndep files, fix some bugs, point to new SSP CO2 files + #687 -- Update fates version on release branch + +=============================================================== +=============================================================== Tag name: release-clm5.0.20 Originator(s): erik (Erik Kluzek) Date: Tue Mar 12 16:08:55 MDT 2019 From 1bbb71975c0434c1d69687e2d53e0e49dabf02b6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 6 May 2019 01:49:18 -0600 Subject: [PATCH 431/730] Start adding in 3x3min MODISv2 mapping files in --- .../namelist_defaults_clm4_5.xml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index b91e92d4f8..0f1b4f06dd 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1698,6 +1698,8 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n >lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_GLOBE-Gardner_to_0.47x0.63_nomask_aave_da_c170914.nc lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_LandScan2004_to_0.47x0.63_nomask_aave_da_c170914.nc +lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_MODISv2_to_0.47x0.63_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_MODIS-wCsp_to_0.47x0.63_nomask_aave_da_c170914.nc lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_ORNL-Soil_to_0.9x1.25_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODIS_to_0.9x1.25_nomask_aave_da_c120523.nc +lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODISv2_to_0.9x1.25_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODIS-wCsp_to_0.9x1.25_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_ORNL-Soil_to_1.9x2.5_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODIS_to_1.9x2.5_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODISv2_to_1.9x2.5_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODIS-wCsp_to_1.9x2.5_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/10x15/map_5x5min_ORNL-Soil_to_10x15_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS_to_10x15_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODISv2_to_10x15_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS-wCsp_to_10x15_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/360x720/map_5x5min_ORNL-Soil_to_360x720cru_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODIS_to_360x720_nomask_aave_da_c120830.nc +lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODISv2_to_360x720cru_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODIS-wCsp_to_360x720cru_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/512x1024/map_5x5min_ORNL-Soil_to_512x1024_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODIS_to_512x1024_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODISv2_to_512x1024_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODIS-wCsp_to_512x1024_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/128x256/map_5x5min_ORNL-Soil_to_128x256_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODIS_to_128x256_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODISv2_to_128x256_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODIS-wCsp_to_128x256_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/64x128/map_5x5min_ORNL-Soil_to_64x128_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODIS_to_64x128_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODISv2_to_64x128_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODIS-wCsp_to_64x128_nomask_aave_da_c160428.nc lnd/clm2/mappingdata/maps/48x96/map_5x5min_ORNL-Soil_to_48x96_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODIS_to_48x96_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODISv2_to_48x96_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODIS-wCsp_to_48x96_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/32x64/map_5x5min_ORNL-Soil_to_32x64_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS_to_32x64_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODISv2_to_32x64_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS-wCsp_to_32x64_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/8x16/map_5x5min_ORNL-Soil_to_8x16_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS_to_8x16_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODISv2_to_8x16_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS-wCsp_to_8x16_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/4x5/map_5x5min_ORNL-Soil_to_4x5_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODIS_to_4x5_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODISv2_to_4x5_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODIS-wCsp_to_4x5_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_ORNL-Soil_to_0.23x0.31_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODIS_to_0.23x0.31_nomask_aave_da_c110930.nc +lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODISv2_to_0.23x0.31_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODIS-wCsp_to_0.23x0.31_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_ORNL-Soil_to_2.5x3.33_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODIS_to_2.5x3.33_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODISv2_to_2.5x3.33_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODIS-wCsp_to_2.5x3.33_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ORNL-Soil_to_5x5_amazon_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS_to_5x5_amazon_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODISv2_to_5x5_amazon_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS-wCsp_to_5x5_amazon_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_USGS_to_conus_30_x8_nomask_aave_da_c181003.nc lnd/clm2/mappingdata/maps/conus_30_x8/map_0.25x0.25_MODIS_to_conus_30_x8_nomask_aave_da_c181003.nc +lnd/clm2/mappingdata/maps/conus_30_x8/map_3x3min_MODISv2_to_conus_30_x8_nomask_aave_da_c190505.nc lnd/clm2/mappingdata/maps/conus_30_x8/map_5x5min_IGBP-GSDP_to_conus_30_x8_nomask_aave_da_c181003.nc From 56306b41bfccdf1dc416e012f962e0dd0d52cf22 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 6 May 2019 11:16:44 -0600 Subject: [PATCH 432/730] These two tests are now passing with the ciso fix in place --- cime_config/testdefs/ExpectedTestFails.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 71881f6b99..a1191cbcb4 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -2,13 +2,11 @@ - FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN - FAIL LCISO_Lm13.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_monthly COMPARE_base_cisoallon FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest From a40df0c24ecd45c19ccb90eed7dab502fc4a3ada Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 6 May 2019 13:50:15 -0700 Subject: [PATCH 433/730] Fates: updating history dimensions for multi-element, fixed a dimension check --- src/main/histFileMod.F90 | 67 +++++++++--- src/utils/clmfates_interfaceMod.F90 | 155 ++++------------------------ 2 files changed, 75 insertions(+), 147 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 74b7aeea24..1aa2bead57 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -25,7 +25,8 @@ module histFileMod use FatesInterfaceMod , only : nlevsclass, nlevage use FatesInterfaceMod , only : nlevheight use EDTypesMod , only : nfsc, ncwd - use FatesInterfaceMod , only : numpft_ed => numpft + use EDTypesMod , only : num_elements_fates => num_elements + use FatesInterfaceMod , only : numpft_fates => numpft use ncdio_pio ! @@ -2056,18 +2057,22 @@ subroutine htape_create (t, histrest) if(use_fates)then call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) - call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_ed, dimid) - call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) - call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levpft', numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid) call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) - call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levcan', nclmax, dimid) call ncd_defdim(lnfid, 'fates_levcnlf', nlevleaf * nclmax, dimid) - call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelem', num_elements_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelpft', num_elements_fates * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelcwd', num_elements_fates * ncwd, dimid) + call ncd_defdim(lnfid, 'fates_levelage', num_elements_fates * nlevage, dimid) end if if ( .not. lhistrest )then @@ -2502,6 +2507,15 @@ subroutine htape_timeconst(t, mode) use FatesInterfaceMod, only : fates_hdim_canmap_levcnlfpf use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlfpf use FatesInterfaceMod, only : fates_hdim_pftmap_levcnlfpf + use FatesInterfaceMod, only : fates_hdim_levelem + use FatesInterfaceMod, only : fates_hdim_elmap_levelpft + use FatesInterfaceMod, only : fates_hdim_pftmap_levelpft + use FatesInterfaceMod, only : fates_hdim_elmap_levelcwd + use FatesInterfaceMod, only : fates_hdim_cwdmap_levelcwd + use FatesInterfaceMod, only : fates_hdim_elmap_levelage + use FatesInterfaceMod, only : fates_hdim_agemap_levelage + + ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -2598,6 +2612,20 @@ subroutine htape_timeconst(t, mode) long_name='FATES pft map into patch age x pft', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_agmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & long_name='FATES age-class map into patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_levelem',xtype=ncd_int, dim1name='fates_levelem', & + long_name='FATES element (C,N,P,...) identifier', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & + long_name='FATES element map into element x pft ', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & + long_name='FATES pft map into element x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelcwd', xtype=ncd_int, dim1name='fates_levelcwd', & + long_name='FATES element map into element x cwd', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_cwdmap_levelcwd', xtype=ncd_int, dim1name='fates_levelcwd', & + long_name='FATES cwd map into element x cwd', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelage', xtype=ncd_int, dim1name='fates_levelage', & + long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agemap_levelage', xtype=ncd_int, dim1name='fates_levage', & + long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) end if @@ -2633,7 +2661,14 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_agmap_levscagpft',data=fates_hdim_agmap_levscagpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levscagpft',data=fates_hdim_pftmap_levscagpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levagepft',data=fates_hdim_pftmap_levagepft, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_levelem',data=fates_hdim_levelem, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelpft',data=fates_hdim_elmap_levelpft, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_pftmap_levelpft',data=fates_hdim_pftmap_levelpft, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelcwd',data=fates_hdim_elmap_levelcwd, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_cwdmap_levelcwd',data=fates_hdim_cwdmap_levelcwd, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelage',data=fates_hdim_elmap_levelage, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_agemap_levelage',data=fates_hdim_agemap_levelage, ncid=nfid(t),flag='write') end if endif @@ -4786,7 +4821,7 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levscls') num2d = nlevsclass case ('fates_levpft') - num2d = numpft_ed + num2d = numpft_fates case ('fates_levage') num2d = nlevage case ('fates_levheight') @@ -4796,23 +4831,31 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levcwdsc') num2d = ncwd case ('fates_levscpf') - num2d = nlevsclass*numpft_ed + num2d = nlevsclass*numpft_fates case ('fates_levscag') num2d = nlevsclass*nlevage case ('fates_levscagpf') - num2d = nlevsclass*nlevage*numpft_ed + num2d = nlevsclass*nlevage*numpft_fates case ('fates_levagepft') - num2d = nlevage*numpft_ed + num2d = nlevage*numpft_fates case ('fates_levcan') num2d = nclmax case ('fates_levcnlf') num2d = nlevleaf * nclmax case ('fates_levcnlfpf') - num2d = nlevleaf * nclmax * numpft_ed + num2d = nlevleaf * nclmax * numpft_fates case ('ltype') num2d = max_lunit case ('natpft') num2d = natpft_size + case ('fates_levelem') + num2d = num_elements_fates + case ('fates_levelpft') + num2d = num_elements_fates*numpft_fates + case ('fates_levelcwd') + num2d = num_elements_fates*ncwd + case ('fates_levelage') + num2d = num_elements_fates*nlevage case('cft') if (cft_size > 0) then num2d = cft_size diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index d369ed0b9e..520acfa5dc 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1884,6 +1884,12 @@ subroutine wrap_bgc_summary(this, nc, soilbiogeochem_carbonflux_inst, & this%fates(nc)%bc_in(s)%tot_litc = totlitc(c) end do + ! Update history variables that track these variables + call this%fates_hist%update_history_cbal(nc, & + this%fates(nc)%nsites, & + this%fates(nc)%sites, & + this%fates(nc)%bc_in) + end associate end subroutine wrap_bgc_summary @@ -1936,7 +1942,8 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 use FatesIOVariableKindMod, only : site_scagpft_r8, site_agepft_r8 use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 - use FatesIOVariableKindMod, only : site_height_r8 + use FatesIOVariableKindMod, only : site_height_r8, site_elem_r8, site_elpft_r8 + use FatesIOVariableKindMod, only : site_elcwd_r8, site_elage_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -2057,151 +2064,29 @@ subroutine init_history_io(this,bounds_proc) default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) - case(patch_ground_r8) + case(patch_ground_r8, patch_size_pft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name call hist_addfld2d(fname=trim(vname),units=trim(vunits), & ! <--- addfld2d type2d=trim(dim2name), & ! <--- type2d avgflag=trim(vavgflag),long_name=trim(vlong), & ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) + default=trim(vdefault)) - case(patch_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_ground_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_age_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_height_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_fuel_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cwdsc_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_can_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlf_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlfpft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_scag_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_scagpft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_agepft_r8) + case(site_ground_r8, site_size_pft_r8, site_size_r8, site_pft_r8, & + site_age_r8, site_height_r8, site_fuel_r8, site_cwdsc_r8, & + site_can_r8,site_cnlf_r8, site_cnlfpft_r8, site_scag_r8, & + site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, & + site_elcwd_r8, site_elage_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name call hist_addfld2d(fname=trim(vname),units=trim(vunits), & type2d=trim(dim2name), & avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault)) case default write(iulog,*) 'A FATES iotype was created that was not registerred' @@ -2245,7 +2130,7 @@ subroutine init_soil_depths(this, nc) this%fates(nc)%bc_in(s)%decomp_id(j) = j ! Check to make sure that dz = dz_decomp_sisl when vertical soil dynamics ! are active - if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))<1.e-10_r8)then + if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))>1.e-10_r8)then write(iulog,*) 'when vertical soil decomp dynamics are on' write(iulog,*) 'fates assumes that the decomposition depths equal the soil depths' write(iulog,*) 'layer: ',j From c082bfea39fc69ff45beb099d8c39f6a46956730 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 6 May 2019 20:50:47 -0700 Subject: [PATCH 434/730] Updated site intiailization in fates --- src/utils/clmfates_interfaceMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 520acfa5dc..a4ee325a48 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1229,7 +1229,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call get_clump_bounds(nc, bounds_clump) do s = 1,this%fates(nc)%nsites - call init_site_vars(this%fates(nc)%sites(s)) + call init_site_vars(this%fates(nc)%sites(s),this%fates(nc)%bc_in(s) ) call zero_site(this%fates(nc)%sites(s)) end do @@ -1306,7 +1306,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins end if end do !$OMP END PARALLEL DO - + end subroutine init_coldstart ! ====================================================================================== From 32f5004b04dcde6fc8a9af388b33af9767196edc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2019 13:35:35 -0600 Subject: [PATCH 435/730] Setup to work on the DAV cluster Casper, rename the batch script for that purpose --- tools/mkmapdata/README | 2 +- tools/mkmapdata/mkmapdata.sh | 40 ++++++++++--------- .../{regridgeyser.sh => regriddav.sh} | 0 3 files changed, 23 insertions(+), 19 deletions(-) rename tools/mkmapdata/{regridgeyser.sh => regriddav.sh} (100%) diff --git a/tools/mkmapdata/README b/tools/mkmapdata/README index 3f5e9e92c2..f2a0b793db 100644 --- a/tools/mkmapdata/README +++ b/tools/mkmapdata/README @@ -76,7 +76,7 @@ That will enable the --netcdf4 and --64bit_offset options to be used. Important files: regridbatch.sh ------- Script to run mkmapdata.sh for many resolutions on cheyenne - regridgeyser.sh ------ Script to run mkmapdata.sh for many resolutions on geyser + regriddav.sh --------- Script to run mkmapdata.sh for many resolutions on the DAV cluster (Casper) mvNimport.sh --------- Script to copy and import mapping files in for many resolutions mkmapdata.sh --------- Script to create mapping datasets for a given resolution diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index bf5214d27b..a744e2798e 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -90,7 +90,7 @@ usage() { echo " REGRID_PROC -- Number of MPI processors to use" echo " (default is $REGRID_PROC)" echo "" - echo "**defaults can be determined on the machines: cheyenne or geyser" + echo "**defaults can be determined on the machines: cheyenne or casper" echo "" echo "**pass environment variables by preceding above commands " echo " with 'env var1=setting var2=setting '" @@ -350,12 +350,10 @@ case $hostname in module load ncl module load nco - if [ "$interactive" = "NO" ]; then + if [[ $REGRID_PROC > 1 ]]; then mpi=mpi - mpitype="mpich2" else mpi=uni - mpitype="mpiuni" fi module load esmf-${esmfvers}-ncdfio-${mpi}-O if [ -z "$ESMFBIN_PATH" ]; then @@ -367,35 +365,43 @@ case $hostname in ;; ## DAV - pronghorn* | caldera* | geyser* ) + pronghorn* | casper* ) . /glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/bash if [ -z "$REGRID_PROC" ]; then REGRID_PROC=8 fi + echo "REGRID_PROC=$REGRID_PROC" esmfvers=7.1.0r - intelvers=15.0.0 - #intelvers=12.1.5 + intelvers=17.0.1 module purge module load intel/$intelvers + if [ $? != 0 ]; then + echo "Error doing module load: intel/$intelvers" + exit 1 + fi module load ncl module load nco - #module load impi - module load mpich-slurm - module load netcdf/4.3.3.1 - #module load netcdf/4.3.0 + module load netcdf module load ncarcompilers - module load esmf + module load esmflibs/$esmfvers + if [ $? != 0 ]; then + echo "Error doing module load: esmflibs/$esmfvers" + exit 1 + fi - if [ "$interactive" = "NO" ]; then + if [[ $REGRID_PROC > 1 ]]; then mpi=mpi - mpitype="mpich2" + echo "MPI option is NOT currently available" + exit 1 else mpi=uni - mpitype="mpiuni" fi - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/lib64:/glade/apps/opt/usr/lib:/usr/lib:/glade/u/ssg/ys/opt/intel/12.1.0.233/composer_xe_2011_sp1.11.339/compiler/lib/intel64:/lib:/lib64" module load esmf-${esmfvers}-ncdfio-${mpi}-O + if [ $? != 0 ]; then + echo "Error doing module load: esmf-${esmfvers}-ncdfio-${mpi}-O" + exit 1 + fi if [ -z "$ESMFBIN_PATH" ]; then ESMFBIN_PATH=`grep ESMF_APPSDIR $ESMFMKFILE | awk -F= '{print $2}'` fi @@ -405,8 +411,6 @@ case $hostname in if [ -z "$MPIEXEC" ]; then MPIEXEC="mpiexec -n $REGRID_PROC" fi - echo "ERROR: Currently can NOT run on the DAV cluster, because ESMF is not configured correctly" - exit 1 ;; ##no other machine currently supported diff --git a/tools/mkmapdata/regridgeyser.sh b/tools/mkmapdata/regriddav.sh similarity index 100% rename from tools/mkmapdata/regridgeyser.sh rename to tools/mkmapdata/regriddav.sh From 8f12de5b18bce7f8ff4ccb15ec4dc18cb6c0411b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2019 15:51:10 -0600 Subject: [PATCH 436/730] Update changelog --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 108 +++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 1e6d371863..c74361e5d4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.22 erik 05/07/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change release-clm5.0.21 erik 05/03/2019 New ndep files, update fates, fix some issues release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes release-clm5.0.19 erik 03/08/2019 Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 1bbae40299..9844fbcfcd 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,112 @@ =============================================================== +Tag name: release-clm5.0.22 +Originator(s): erik (Erik Kluzek) +Date: Tue May 7 15:50:50 MDT 2019 +One-line Summary: Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change + +Purpose of this version: +------------------------ + +We currently have a bug so that for transient land-use change cases answers are different starting in soil +carbon when Carbon isotopes (use_c13, or use_c14) are on versus off. Answers are identical if there is no +land-use change. The bug does cause bulk Carbon (C12) to be slightly different, but qualitatively the same. +There is a significant impact to the Carbon isotope simulation however. The bug was causing changes in isotopic +pools to be directed to the bulk Carbon. Because, isotopes are so much smaller than bulk Carbon, this doesn't +cause a marked difference in the bulk Carbon simulation. But, the lack of the change in the isotopic pool +does have a meaningful impact on the simulation of the Carbon isotopic fields. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #262 #675 + #675 -- Carbon isotopes under transient land-use change + #262 -- hirespft option to mksurfdata.pl + +Science changes since: release-clm5.0.21 + Fix Carbon isotope issue under transient land-use change + +Software changes since: release-clm5.0.21 + Bring in mapping files for 3x3min MODISv2 grid for most resolutions + +Changes to User Interface since: release-clm5.0.21 + None + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart ---PASS + + tools-tests (components/clm/test/tools): + + cheyenne - + hobart --- + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - + hobart --- + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.21 + +Changes answers relative to baseline: Yes, but only when Carbon isotopes on under transient land-use change! + + Summarize any changes to answers: + - what code configurations: Bgc with use_c13 or use_c14 T and with a transient land-use change after each year boundary + - what platforms/compilers: All + - nature of change: same climate for bulk Carbon, isotopic Carbon is quite different for regions with land-use change + + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + /oleson/clm50_release-clm5.0.20_1deg_GSWP3V1_isofix2_hist + + URL for LMWG diagnostics output for new climate: +http://webext.cgd.ucar.edu/I20TR/clm50_release-clm5.0.20_1deg_GSWP3V1_isofix2_hist/lnd/clm50_release-clm5.0.20_1deg_GSWP3V1_isofix2_hist.1995_2014-clm50_release-clm5.0.20_1deg_GSWP3V1_isofix_hist.1995_2014/setsIndex.html + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cime5.6.14 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: ctsm1.0.dev036 + +Pull Requests that document the changes (include PR ids): #698 +(https://github.com/ESCOMP/ctsm/pull) + + #698 -- Bring the carbon isotope fix to the release branch + +=============================================================== +=============================================================== Tag name: release-clm5.0.21 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri May 3 16:10:35 MDT 2019 From afb4497ad7354d3b6eb09b39d7e21396e1daa1fb Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 7 May 2019 16:51:03 -0700 Subject: [PATCH 437/730] fates: fixed an incorrect dimension in fates history writing --- src/main/histFileMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 1aa2bead57..bca6de08b4 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -2624,7 +2624,7 @@ subroutine htape_timeconst(t, mode) long_name='FATES cwd map into element x cwd', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_elmap_levelage', xtype=ncd_int, dim1name='fates_levelage', & long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) - call ncd_defvar(varname='fates_agemap_levelage', xtype=ncd_int, dim1name='fates_levage', & + call ncd_defvar(varname='fates_agemap_levelage', xtype=ncd_int, dim1name='fates_levelage', & long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) end if From 257686e607dcd5e850c480a4bfb53efad32d9aaa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2019 11:12:20 -0600 Subject: [PATCH 438/730] Add 3x3min_MODISv2 mapping files for more grids, single point and ne30/ne60 --- .../namelist_defaults_clm4_5.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 0f1b4f06dd..3b3855e51e 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1360,6 +1360,8 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n >lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_10x10min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODISv2_to_1x1_asphaltjungleNJ_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODIS-wCsp_to_1x1_asphaltjungleNJ_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_brazil/map_10x10min_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODIS_to_1x1_brazil_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODISv2_to_1x1_brazil_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODIS-wCsp_to_1x1_brazil_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_10x10min_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODIS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODISv2_to_1x1_camdenNJ_nomask_aave_da_c190506.nc lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODIS-wCsp_to_1x1_camdenNJ_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_10x10min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODISv2_to_1x1_mexicocityMEX_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODIS-wCsp_to_1x1_mexicocityMEX_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_numaIA/map_10x10min_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODIS_to_1x1_numaIA_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODISv2_to_1x1_numaIA_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODIS-wCsp_to_1x1_numaIA_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_10x10min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODISv2_to_1x1_smallvilleIA_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODIS-wCsp_to_1x1_smallvilleIA_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_10x10min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODISv2_to_1x1_urbanc_alpha_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODIS-wCsp_to_1x1_urbanc_alpha_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_10x10min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc +lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODISv2_to_1x1_vancouverCAN_nomask_aave_da_c190506.nc lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODIS-wCsp_to_1x1_vancouverCAN_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ORNL-Soil_to_ne30np4_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS_to_ne30np4_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODISv2_to_ne30np4_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS-wCsp_to_ne30np4_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ORNL-Soil_to_ne60np4_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS_to_ne60np4_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODISv2_to_ne60np4_nomask_aave_da_c190507.nc lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS-wCsp_to_ne60np4_nomask_aave_da_c160425.nc Date: Wed, 8 May 2019 11:13:32 -0600 Subject: [PATCH 439/730] Update changelog date --- doc/ChangeSum | 2 +- doc/release-clm5.0.ChangeLog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeSum b/doc/ChangeSum index c74361e5d4..b6219ec405 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ -release-clm5.0.22 erik 05/07/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change +release-clm5.0.22 erik 05/08/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change release-clm5.0.21 erik 05/03/2019 New ndep files, update fates, fix some issues release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes release-clm5.0.19 erik 03/08/2019 Update cime version to one with updates for cheyenne after the Mar/5th/2019 downtime that resulting in mpt2.16 not being able to be used diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 9844fbcfcd..0a354cd32d 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.22 Originator(s): erik (Erik Kluzek) -Date: Tue May 7 15:50:50 MDT 2019 +Date: Wed May 8 11:13:14 MDT 2019 One-line Summary: Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change Purpose of this version: From 9c620a3da0393269ddb777797dd040b578413d4e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2019 13:33:06 -0600 Subject: [PATCH 440/730] Minor update to change files --- doc/release-clm5.0.ChangeLog | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 0a354cd32d..5b175a45db 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.22 Originator(s): erik (Erik Kluzek) -Date: Wed May 8 11:13:14 MDT 2019 +Date: Wed May 8 13:32:51 MDT 2019 One-line Summary: Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change Purpose of this version: @@ -22,8 +22,11 @@ Summary of changes: ------------------- Issues fixed (include CTSM Issue #): #262 #675 - #675 -- Carbon isotopes under transient land-use change - #262 -- hirespft option to mksurfdata.pl + Fixes #675 -- Carbon isotopes under transient land-use change + Fixes #262 -- hirespft option to mksurfdata.pl + +Issues found: #707 + #707 -- missing hirespft mapping files Science changes since: release-clm5.0.21 Fix Carbon isotope issue under transient land-use change @@ -48,16 +51,6 @@ Testing: cheyenne - PASS hobart ---PASS - tools-tests (components/clm/test/tools): - - cheyenne - - hobart --- - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - - hobart --- - regular tests (aux_clm): cheyenne_intel ---- OK From ebd16eec60f440a46b9068bd467e0f269a0abac1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 13 May 2019 14:54:25 -0600 Subject: [PATCH 441/730] Updates the default fates parameter file (backwards compatible). --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 979aa29bb7..27acd68256 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.2.0_12pft_c190409.nc +lnd/clm2/paramdata/fates_params_api.7.2.1_12pft_c190513.nc From 85b3d12e87e3558de13bf26540ae4f8745e751dd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2019 16:28:46 -0600 Subject: [PATCH 442/730] Point to cime branch, and make CO2 diagnostic for SSP compsets --- Externals.cfg | 4 ++-- cime_config/config_component.xml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index a7c05ccdc6..8944836d33 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -29,8 +29,8 @@ required = True [cime] local_path = cime protocol = git -repo_url = https://github.com/ESMCI/cime -tag = cime5.6.14 +repo_url = https://github.com/ekluzek/cime +branch = addSSPCO2npresaero required = True [externals_description] diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 2672fd133b..7025283ae4 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -169,10 +169,11 @@ constant,diagnostic,prognostic constant - diagnostic + diagnostic diagnostic prognostic diagnostic + diagnostic From b33be7fddbe2025baf792c9b3e09c2ac664b0141 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2019 16:43:25 -0600 Subject: [PATCH 443/730] Change lname to long_name, add in time_bnds from the originating file, and remove extra _ in filename, this resolves issues in #708 --- tools/ncl_scripts/getco2_historical.ncl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ncl_scripts/getco2_historical.ncl b/tools/ncl_scripts/getco2_historical.ncl index 8558f6dd01..1df0f82fbd 100644 --- a/tools/ncl_scripts/getco2_historical.ncl +++ b/tools/ncl_scripts/getco2_historical.ncl @@ -58,7 +58,7 @@ begin ntime = dimsizes( ncg->date ); sim_yr2 = ncg->date(ntime-1) / 10000; - sim_yr_rng = "_simyr_"+sim_yr0 + "-" + sim_yr2; + sim_yr_rng = "simyr_"+sim_yr0 + "-" + sim_yr2; cmip_vers = "_CMIP6_"; outco2filename = "fco2_datm_"+hgrid+ssp_rcp+"_"+sim_yr_rng+cmip_vers+"c"+sdate+".nc"; @@ -103,7 +103,7 @@ begin end if end if nco->$vars(i)$@units = units(i); - nco->$vars(i)$@lname = lname(i); + nco->$vars(i)$@long_name = lname(i); end do filevardef ( nco, "time", "float", (/ "time" /) ); filevardef ( nco, "time_bnds", "float", (/ "time", "bounds" /) ); @@ -170,6 +170,7 @@ begin ; nco->date = (/ ncg->date /); nco->time = (/ ncg->time /); + nco->time_bnds = (/ ncg->time_bnds /); nco->date@comment = "This variable is NOT used when read by datm, the time coordinate is used"; ; ; CO2 From 4b21a1318d0c2e13c72cb0ffc5beb5a1912c6a1b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 14 May 2019 17:51:27 -0700 Subject: [PATCH 444/730] Adding history field_info member numdims, which will allow 2nd dimensions of 1. --- src/main/histFileMod.F90 | 49 ++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index bca6de08b4..9375225d2f 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -192,6 +192,9 @@ module histFileMod integer :: beg1d_out ! on-node 1d hbuf pointer start index integer :: end1d_out ! on-node 1d hbuf pointer end index integer :: num1d_out ! size of hbuf first dimension (all nodes) + integer :: numdims ! the actual number of dimensions, this allows + ! for 2D arrays, where the second dimension is allowed + ! to be 1 integer :: num2d ! size of hbuf second dimension (e.g. number of vertical levels) integer :: hpindex ! history pointer index character(len=scale_type_strlen) :: p2c_scale_type ! scale factor when averaging patch to column @@ -307,7 +310,7 @@ subroutine hist_printflds() end subroutine hist_printflds !----------------------------------------------------------------------- - subroutine masterlist_addfld (fname, type1d, type1d_out, & + subroutine masterlist_addfld (fname, numdims, type1d, type1d_out, & type2d, num2d, units, avgflag, long_name, hpindex, & p2c_scale_type, c2l_scale_type, l2g_scale_type, & no_snow_behavior) @@ -323,6 +326,7 @@ subroutine masterlist_addfld (fname, type1d, type1d_out, & ! ! !ARGUMENTS: character(len=*), intent(in) :: fname ! field name + integer , intent(in) :: numdims ! number of dimensions character(len=*), intent(in) :: type1d ! 1d data type character(len=*), intent(in) :: type1d_out ! 1d output type character(len=*), intent(in) :: type2d ! 2d output type @@ -401,6 +405,7 @@ subroutine masterlist_addfld (fname, type1d, type1d_out, & masterlist(f)%field%type1d = type1d masterlist(f)%field%type1d_out = type1d_out masterlist(f)%field%type2d = type2d + masterlist(f)%field%numdims = numdims masterlist(f)%field%num2d = num2d masterlist(f)%field%hpindex = hpindex masterlist(f)%field%p2c_scale_type = p2c_scale_type @@ -1055,6 +1060,7 @@ subroutine hist_update_hbuf(bounds) integer :: t ! tape index integer :: f ! field index integer :: num2d ! size of second dimension (e.g. number of vertical levels) + integer :: numdims ! number of dimensions character(len=*),parameter :: subname = 'hist_update_hbuf' character(len=hist_dim_name_length) :: type2d ! hbuf second dimension type ["levgrnd","levlak","numrad","ltype","natpft","cft","glc_nec","elevclas","subname(n)"] !----------------------------------------------------------------------- @@ -1062,10 +1068,12 @@ subroutine hist_update_hbuf(bounds) do t = 1,ntapes !$OMP PARALLEL DO PRIVATE (f, num2d) do f = 1,tape(t)%nflds - num2d = tape(t)%hlist(f)%field%num2d - if ( num2d == 1) then + numdims = tape(t)%hlist(f)%field%numdims + + if ( numdims == 1) then call hist_update_hbuf_field_1d (t, f, bounds) else + num2d = tape(t)%hlist(f)%field%num2d call hist_update_hbuf_field_2d (t, f, bounds, num2d) end if end do @@ -2613,7 +2621,7 @@ subroutine htape_timeconst(t, mode) call ncd_defvar(varname='fates_agmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & long_name='FATES age-class map into patch age x pft', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_levelem',xtype=ncd_int, dim1name='fates_levelem', & - long_name='FATES element (C,N,P,...) identifier', ncid=nfid(t)) + long_name='FATES element (C,N,P,...) identifier', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_elmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & long_name='FATES element map into element x pft ', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_pftmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & @@ -2914,6 +2922,7 @@ subroutine hfields_write(t, mode) integer :: num2d ! hbuf second dimension size integer :: nt ! time index integer :: ier ! error status + integer :: numdims ! number of dimensions character(len=avgflag_strlen) :: avgflag ! time averaging flag character(len=max_chars) :: long_name! long name character(len=max_chars) :: units ! units @@ -2957,6 +2966,7 @@ subroutine hfields_write(t, mode) end1d_out = tape(t)%hlist(f)%field%end1d_out num1d_out = tape(t)%hlist(f)%field%num1d_out type2d = tape(t)%hlist(f)%field%type2d + numdims = tape(t)%hlist(f)%field%numdims num2d = tape(t)%hlist(f)%field%num2d nt = tape(t)%ntimes @@ -2989,7 +2999,7 @@ subroutine hfields_write(t, mode) endif if (dim2name == 'undefined') then - if (num2d == 1) then + if (numdims == 1) then call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & dim1name=dim1name, dim2name='time', & long_name=long_name, units=units, cell_method=avgstr, & @@ -3001,7 +3011,7 @@ subroutine hfields_write(t, mode) missing_value=spval, fill_value=spval) end if else - if (num2d == 1) then + if (numdims == 1) then call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & dim1name=dim1name, dim2name=dim2name, dim3name='time', & long_name=long_name, units=units, cell_method=avgstr, & @@ -3022,7 +3032,7 @@ subroutine hfields_write(t, mode) ! Allocate dynamic memory - if (num2d == 1) then + if (numdims == 1) then allocate(hist1do(beg1d_out:end1d_out), stat=ier) if (ier /= 0) then write(iulog,*) trim(subname),' ERROR: allocation' @@ -3033,7 +3043,7 @@ subroutine hfields_write(t, mode) ! Write history output. Always output land and ocean runoff on xy grid. - if (num2d == 1) then + if (numdims == 1) then call ncd_io(flag='write', varname=varname, & dim1name=type1d_out, data=hist1do, ncid=nfid(t), nt=nt) else @@ -3044,7 +3054,7 @@ subroutine hfields_write(t, mode) ! Deallocate dynamic memory - if (num2d == 1) then + if (numdims == 1) then deallocate(hist1do) end if @@ -4702,10 +4712,11 @@ subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, & ! Add field to masterlist - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d='unset', num2d=1, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g) + call masterlist_addfld (fname=trim(fname), numdims=1, type1d=l_type1d, & + type1d_out=l_type1d_out, type2d='unset', num2d=1, & + units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & + p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, & + l2g_scale_type=scale_type_l2g) l_default = 'active' if (present(default)) then @@ -5017,12 +5028,12 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, ! Add field to masterlist - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d=type2d, num2d=num2d, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g, & - no_snow_behavior=no_snow_behavior) - + call masterlist_addfld (fname=trim(fname), numdims=2, type1d=l_type1d, & + type1d_out=l_type1d_out, type2d=type2d, num2d=num2d, & + units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & + p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, & + l2g_scale_type=scale_type_l2g, no_snow_behavior=no_snow_behavior) + l_default = 'active' if (present(default)) then l_default = default From ed2061a94e8a59147aaaa16a699fdf93402c688b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 May 2019 23:27:52 -0600 Subject: [PATCH 445/730] Use a branch_tag for cime to point to --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 8944836d33..ae434f268e 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -29,8 +29,8 @@ required = True [cime] local_path = cime protocol = git -repo_url = https://github.com/ekluzek/cime -branch = addSSPCO2npresaero +repo_url = https://github.com/ESMCI/cime +tag = branch_tags/cime5.6.15_a01 required = True [externals_description] From 0e2d81247072c6283687516f032d3474e25d9bba Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 May 2019 23:30:32 -0600 Subject: [PATCH 446/730] Add two more SSP tests so we test each of the three fully working SSP scenarios --- cime_config/testdefs/testlist_clm.xml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 8c55610187..698208591d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1566,7 +1566,24 @@ - + + + + + + + + + + + + + + + + + + From 49427406eecb3ccf52b4311d96272d7b6071722a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 May 2019 23:37:56 -0600 Subject: [PATCH 447/730] Add missing CO2 files for SSP1-1.9 and SSP4-3.4 fixes #712 --- bld/namelist_files/namelist_defaults_clm4_5_tools.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 363d5a3eee..1606698182 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -7401,16 +7401,20 @@ attributes from the config_cache.xml file (with keys converted to upper-case). atm/waccm/lb/LBC_17500116-20150116_CMIP6_0p5degLat_c180905.nc atm/waccm/lb/LBC_1750-2015_CMIP6_GlobAnnAvg_c180926.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP119_0p5degLat_c190514.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP126_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP245_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP370_0p5degLat_c180905.nc +atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP119_0p5degLat_c190514.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP460_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP534os_0p5degLat_c180905.nc atm/waccm/lb/LBC_20140116-25001216_CMIP6_SSP585_0p5degLat_c180905.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP119_0p5degLat_GlobAnnAvg_c190514.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP126_0p5degLat_GlobAnnAvg_c190301.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP245_0p5degLat_GlobAnnAvg_c190301.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP370_0p5degLat_GlobAnnAvg_c190301.nc +atm/waccm/lb/LBC_2014-2500_CMIP6_SSP434_0p5degLat_GlobAnnAvg_c190514.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP460_0p5degLat_GlobAnnAvg_c190301.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP534os_0p5degLat_GlobAnnAvg_c190301.nc atm/waccm/lb/LBC_2014-2500_CMIP6_SSP585_0p5degLat_GlobAnnAvg_c190301.nc From c55f9b478c833cc7aa799b23e379b8348d46d0af Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 May 2019 23:40:11 -0600 Subject: [PATCH 448/730] Remove the missing ndep SSP files (rather than use the closest one) and use CMIP6 for CLM4.5 as well fixes #711 --- .../namelist_defaults_clm4_5.xml | 46 +++++-------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 3b3855e51e..0ba9cab4c5 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1085,57 +1085,35 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc - -lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc -lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc - -lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc + lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc - lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc - -lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc - -lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + + +lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc +lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc cycle NDEP_month limit - extend NDEP_year lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc - -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc - bilinear nn From 6db21b93483739dab1a92d6908406d51d03b697a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 May 2019 23:54:00 -0600 Subject: [PATCH 449/730] Add note about needing to make new REFCASES, this fixes #661 --- doc/.ChangeLog_template | 2 ++ doc/.release-ChangeLog_template | 3 +++ 2 files changed, 5 insertions(+) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 5900998e46..27699a0582 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -123,6 +123,8 @@ Changes answers relative to baseline: URL for LMWG diagnostics output used to validate new climate: + Will new REFCASES need to be made for cesm and/or CAM?: No + (This will likely be true if the LII tests failed) Detailed list of changes ------------------------ diff --git a/doc/.release-ChangeLog_template b/doc/.release-ChangeLog_template index 7d3bad891f..404cbc5364 100644 --- a/doc/.release-ChangeLog_template +++ b/doc/.release-ChangeLog_template @@ -85,6 +85,9 @@ Changes answers relative to baseline: URL for LMWG diagnostics output for new climate: + Will new REFCASES need to be made for cesm and/or CAM?: No + (This will likely be true if the LII tests failed) + Detailed list of changes: ------------------------ From e7460df8ed7e89a59850eda7f411eaeee4397368 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2019 00:38:55 -0600 Subject: [PATCH 450/730] Fix missing xml close --- cime_config/testdefs/testlist_clm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 698208591d..0fded562b8 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1577,6 +1577,7 @@ + From 2d7371c4840e4efd3cab4217ae5ffc36f7ea3471 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2019 01:23:46 -0600 Subject: [PATCH 451/730] Fix ndep settings to use CMIP6 files rather than just CMIP5 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 0ba9cab4c5..656be4f923 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1109,10 +1109,9 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n NDEP_month limit -extend -NDEP_year -lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc +cycle +NDEP_month +limit bilinear From 3325d5ad951fd90b32777a922b74639db4215d27 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2019 12:27:20 -0600 Subject: [PATCH 452/730] Add new expected fails due to new issue #714 --- cime_config/testdefs/ExpectedTestFails.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index a1191cbcb4..08e6c189b0 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -11,6 +11,11 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN + PEND ERS_Lm40_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN + PEND ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN + PEND ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN + PEND ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN + PEND ERS_Ly20_Mmpi-serial.1x1_numaIA.I2000Clm50BgcDvCropQianGs.cheyenne_gnu.clm-cropMonthOutput RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK From 11c88fa6b94395481a6554faf410cb70b8096a06 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2019 14:44:35 -0600 Subject: [PATCH 453/730] Get tests to work again since now four of the SSP cases fail because of lack of ndep files --- bld/unit_testers/build-namelist_test.pl | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index be58b1991d..e07de30143 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 872; +my $ntests = 828; if ( defined($opts{'compare'}) ) { - $ntests += 540; + $ntests += 504; } plan( tests=>$ntests ); @@ -313,7 +313,7 @@ sub make_env_run { foreach my $options ( "-bgc bgc -use_case 1850-2100_SSP1-2.6_transient -namelist '&a start_ymd=20100101/'", "-bgc sp -use_case 1850-2100_SSP2-4.5_transient -namelist '&a start_ymd=18501223/'", - "-bgc bgc -use_case 1850-2100_SSP4-6.0_transient -namelist '&a start_ymd=20701029/'", + "-bgc bgc -use_case 1850-2100_SSP3-7.0_transient -namelist '&a start_ymd=20701029/'", "-bgc fates -use_case 2000_control -no-megan", "-bgc cn -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19201023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", @@ -1238,8 +1238,8 @@ sub make_env_run { system( "../configure -s $mode" ); my @glc_res = ( "48x96", "0.9x1.25", "1.9x2.5" ); my @use_cases = ( "1850-2100_SSP1-2.6_transient", - "1850-2100_SSP3-4.5_transient", - "1850-2100_SSP4-6.0_transient", + "1850-2100_SSP2-4.5_transient", + "1850-2100_SSP3-7.0_transient", "1850-2100_SSP5-8.5_transient", "1850_control", "2000_control", @@ -1287,13 +1287,12 @@ sub make_env_run { } &cleanup(); } -# Transient ssp_rcp scenarios +# Transient ssp_rcp scenarios that work $mode = "-phys clm5_0"; system( "../configure -s $mode" ); my @tran_res = ( "0.9x1.25", "1.9x2.5", "10x15" ); foreach my $usecase ( "1850_control", "1850-2100_SSP5-8.5_transient", "1850-2100_SSP1-2.6_transient", "1850-2100_SSP3-7.0_transient", - "1850-2100_SSP4-3.4_transient", "1850-2100_SSP5-3.4_transient", "1850-2100_SSP2-4.5_transient", "1850-2100_SSP1-1.9_transient", - "1850-2100_SSP4-6.0_transient" ) { + "1850-2100_SSP2-4.5_transient" ) { foreach my $res ( @tran_res ) { $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . "; &make_env_run(); @@ -1312,6 +1311,16 @@ sub make_env_run { &cleanup(); } } +# The SSP's that fail... +my $res = "0.9x1.25"; +foreach my $usecase ( "1850-2100_SSP4-3.4_transient", "1850-2100_SSP5-3.4_transient", "1850-2100_SSP1-1.9_transient", + "1850-2100_SSP4-6.0_transient" ) { + $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . "; + &make_env_run(); + eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; + isnt( $?, 0, $usecase ); + system( "cat $tempfile" ); +} print "\n==================================================\n"; print "Test clm4.5/clm5.0 resolutions \n"; From 9a7fae3a6775ee167b0f775059dcfa1d671bee40 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 15 May 2019 15:04:10 -0600 Subject: [PATCH 454/730] Updated to default file api7.2.2 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 27acd68256..392a556a0d 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.2.1_12pft_c190513.nc +lnd/clm2/paramdata/fates_params_api.7.2.2_12pft_c190513.nc From 70304232d58a15bf2f637d4be847fb992bc6ce55 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2019 15:25:51 -0600 Subject: [PATCH 455/730] Add the missing mapping files for high res PFT as documented in #707 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 656be4f923..e9e222db82 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2269,6 +2269,8 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n >lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_ORNL-Soil_to_ne4np4_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODIS_to_ne4np4_nomask_aave_da_c120906.nc +lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODISv2_to_ne4np4_nomask_aave_da_c190514.nc lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODIS-wCsp_to_ne4np4_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_MODIS_to_ne16np4_nomask_aave_da_c110922.nc lnd/clm2/mappingdata/maps/ne16np4/map_0.25x0.25_MODIS_to_ne16np4_nomask_aave_da_c170321.nc +lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODISv2_to_ne16np4_nomask_aave_da_c190514.nc lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_AVHRR_to_ne16np4_nomask_aave_da_c110922.nc lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_irrig_to_ne120np4_aave_da_110817.nc lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS_to_ne120np4_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODISv2_to_ne120np4_nomask_aave_da_c190514.nc lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS-wCsp_to_ne120np4_nomask_aave_da_c160425.nc lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ORNL-Soil_to_ne240np4_nomask_aave_da_c170706.nc lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS_to_ne240np4_nomask_aave_da_c111111.nc +lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODISv2_to_ne240np4_nomask_aave_da_c190514.nc lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS-wCsp_to_ne240np4_nomask_aave_da_c160425.nc Date: Wed, 15 May 2019 15:32:06 -0600 Subject: [PATCH 456/730] Update Change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 110 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index b6219ec405..a6583fb273 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.23 erik 05/15/2019 Update cime to bring in CO2 transient files for the CMIP6 SSP's as well as presaero for three of them release-clm5.0.22 erik 05/08/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change release-clm5.0.21 erik 05/03/2019 New ndep files, update fates, fix some issues release-clm5.0.20 erik 03/12/2019 Update all fsurdat files and bring in files for future scenarios, remove CMIP5 rcp options, bring in some bug fixes diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 5b175a45db..2dd38bd856 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,114 @@ =============================================================== +Tag name: release-clm5.0.23 +Originator(s): erik (Erik Kluzek) +Date: Wed May 15 15:31:15 MDT 2019 +One-line Summary: Update cime to bring in CO2 transient files for the CMIP6 SSP's as well as presaero for three of them + +Purpose of this version: +------------------------ + +With updated cime with transient CO2 for all CMIP6 SSP scenarios and prescribed aerosol files for three of +the CMIP6 SSP scenarios (SSP3-7.0, SSP2-4.5, SSP5-8.5). Previously all SSP scenaros would run, and use the +closest SSP nitrogen deposition file, now only the ones that are available work (Tier I). Also CLM4.5 used +the old CMIP5 ndep files, and now they use the CMIP6 ones available. + +Fix some small issues with some of the tools + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #707 #708 #711 #712 + Fixes #707 -- Missing mapping files for hirespft + Fixes #708 -- time_bnds not set by tools/ncl_scripts/getco2_historical.ncl + Fixes #711 -- Model assumes the closest SSP scenario for ndep + Fixes #712 -- Missing CO2 files for SSP1-1.9 and SSP4-3.4 + +New issues found: #714 -- Fails with cheyenne_gnu for some longer single point tests + +Science changes since: release-clm5.0.22 + Forcing period is different for present day compsets (I2000, I2003, and I2010) + SSP scenarios now have CMIP6 transient CO2 and presaero (for SP3-7.0, SSP2-4.5, SSP5-8.5) + clm4.5 will use CMIP6 SSP ndep datasets rather than CMIP5 + +Software changes since: release-clm5.0.22 + None + +Changes to User Interface since: release-clm5.0.22 + Now SSP cases that don't have needed datasets will fail + +Testing: regular +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - OK (36 tests are different as expected) + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + regular tests (fates): + + cheyenne_intel - OK + cheyenne_gnu --- OK + hobart_nag ----- OK + +Summary of Answer changes: +------------------------- + +Baseline version for comparison: release-clm5.0.22 + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: Present day compsets, SSP compsets, and Clm45 compsets + - what platforms/compilers: All + - nature of change: New datasets, new forcing period for present day + + Will new REFCASES need to be made for cesm and/or CAM?: No + (This will likely be true if the LII tests failed) + +Detailed list of changes: +------------------------ + +Externals being used: + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: branch_tags/cime5.6.15_a01 (same as cim5.6.16) + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #713 +(https://github.com/ESCOMP/ctsm/pull) + #713 -- Fix a few issues, and update cime to a version with CO2 SSP files as well as three presaero SSP files + +=============================================================== +=============================================================== Tag name: release-clm5.0.22 Originator(s): erik (Erik Kluzek) Date: Wed May 8 13:32:51 MDT 2019 From 67671482d9200f59620f09be828dc2c4bfaedb38 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 15 May 2019 15:33:16 -0600 Subject: [PATCH 457/730] Updated default fates param file --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 392a556a0d..c9098697b6 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.2.2_12pft_c190513.nc +lnd/clm2/paramdata/fates_params_api.7.2.2_12pft_c190515.nc From d878635ec6b1dd6aa20e986d3133e43abf5e6e7d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Sun, 19 May 2019 13:54:07 -0700 Subject: [PATCH 458/730] fates multi-element, updated arguments to set_site_properties --- src/utils/clmfates_interfaceMod.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index a4ee325a48..7e35b2a702 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1234,8 +1234,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins end do call set_site_properties(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in) + this%fates(nc)%sites) ! ---------------------------------------------------------------------------- ! Initialize Hydraulics Code if turned on From be690d4fa9bf214b933f5324a615feb2ace34c9e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2019 10:20:33 -0600 Subject: [PATCH 459/730] Update externals, the previous branch tag is identical to this tag --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index ae434f268e..c9b77c9691 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = branch_tags/cime5.6.15_a01 +tag = cime5.6.16 required = True [externals_description] From 5bfd72eecb7069ecb2c3d06337e71ae72ebaf3f3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2019 10:23:21 -0600 Subject: [PATCH 460/730] Change year end for ndep for SSP's to 2101, so can go to the end of 2100, fixes #717 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index e9e222db82..a8fd450071 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1056,11 +1056,11 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n 2015 -2100 +2101 2015 2015 -2100 +2101 2015 2010 From 3909af28dff36694692abe88c20498dc37e5b40f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2019 10:24:54 -0600 Subject: [PATCH 461/730] Add a 2-degre WACCM test (for #716), and change some of the single point tests that were failing --- cime_config/testdefs/testlist_clm.xml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0fded562b8..85c9e7b043 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -961,7 +961,7 @@ - + @@ -971,7 +971,7 @@ - + @@ -981,10 +981,9 @@ - + - @@ -994,7 +993,6 @@ - @@ -1018,7 +1016,7 @@ - + @@ -1063,9 +1061,8 @@ - + - @@ -2045,6 +2042,16 @@ + + + + + + + + + From c427c337396cb4063ad963593fbe661ad69a073c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2019 10:25:32 -0600 Subject: [PATCH 462/730] Add a no-Carbon isotope WACCM deck needed for 2-degree cases --- .../cmip6_waccm_nociso_deck/README | 17 +++++++++++++++++ .../cmip6_waccm_nociso_deck/include_user_mods | 2 ++ 2 files changed, 19 insertions(+) create mode 100644 cime_config/usermods_dirs/cmip6_waccm_nociso_deck/README create mode 100644 cime_config/usermods_dirs/cmip6_waccm_nociso_deck/include_user_mods diff --git a/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/README b/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/README new file mode 100644 index 0000000000..79cbbeefe8 --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/README @@ -0,0 +1,17 @@ +WACCM DECK runs should be configured similarly to CAM DECK runs, but +without virtual elevation classes over Antarctica. At 2-degree we ++also decided to NOT turn on Carbon isotopes. + +(2018-10-22) In discussions between Bill Sacks and Bill Lipscomb: We +have decided NOT to turn on virtual Antarctica columns for any of the +WACCM simulations (DECK or ScenarioMIP): these weren't turned on in the +WACCM PI-Control or historical runs (either by accident or +intentionally: I'm not sure which, and can't find emails describing this +decision). Since this setting needs to be compatible with the REFCASE, +it's simpler if we keep it consistent for all WACCM runs, and there +seems to be only limited value in turning on virtual Antarctica columns +in the remaining WACCM runs (1% CO2, 4xCO2 and ScenarioMIP) when they +weren't on in the WACCM PI-Control or Historical runs. And Mike Mills +says that there won't be any more sharing of initial conditions between +CAM and WACCM CMIP6 runs, so it's fine if the two sets remain different +in this respect. diff --git a/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/include_user_mods new file mode 100644 index 0000000000..64c3f6f670 --- /dev/null +++ b/cime_config/usermods_dirs/cmip6_waccm_nociso_deck/include_user_mods @@ -0,0 +1,2 @@ +../_includes/cmip6_glaciers_cplhist +../output_crop From 440d5e0690b94d9ad4ba5eb127396609cc3cc7df Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2019 11:41:05 -0600 Subject: [PATCH 463/730] Point to the nociso waccm deck for 2-degree --- cime_config/config_component.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 7025283ae4..4a5ababeeb 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -246,6 +246,7 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck run_component_clm env_case.xml From 0115e0912bc0935611e2bf45a7273fe08cd22b1a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2019 12:08:42 -0600 Subject: [PATCH 464/730] Add checks for negative special landunit types --- tools/mksurfdata_map/src/mksurfdat.F90 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 173807dd9c..f0672a8840 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -1319,6 +1319,26 @@ subroutine normalizencheck_landuse(ldomain) do n = 1,ns_o ! Check preconditions + if ( pctlak(n) < 0.0_r8 )then + write(6,*) subname, ' ERROR: pctlak is negative!' + write(6,*) 'n, pctlak = ', n, pctlak(n) + call abort() + end if + if ( pctwet(n) < 0.0_r8 )then + write(6,*) subname, ' ERROR: pctwet is negative!' + write(6,*) 'n, pctwet = ', n, pctwet(n) + call abort() + end if + if ( pcturb(n) < 0.0_r8 )then + write(6,*) subname, ' ERROR: pcturb is negative!' + write(6,*) 'n, pcturb = ', n, pcturb(n) + call abort() + end if + if ( pctgla(n) < 0.0_r8 )then + write(6,*) subname, ' ERROR: pctgla is negative!' + write(6,*) 'n, pctgla = ', n, pctgla(n) + call abort() + end if suma = pctlak(n) + pctwet(n) + pcturb(n) + pctgla(n) if (suma > (100._r8 + tol_loose)) then From 4f4d4e38b3f520d937ae3b084b6ef1d4e1b10529 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2019 13:17:19 -0600 Subject: [PATCH 465/730] Remove 8x16 and 32x64 from clm4.5/5.0 because of issue #726 where the surface datasets can't be created --- .../namelist_defaults_clm4_5.xml | 74 ------------------- .../namelist_definition_clm4_5.xml | 4 +- 2 files changed, 2 insertions(+), 76 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index a8fd450071..6ac3adc568 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2009,80 +2009,6 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/mappingdata/maps/48x96/map_1km-merge-10min_HYDRO1K-merge-nomask_to_48x96_nomask_aave_da_c130405.nc -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_MODIS_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_0.25x0.25_MODIS_to_32x64_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_AVHRR_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_10x10min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_IGBP-GSDP_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_ISRIC-WISE_to_32x64_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_ORNL-Soil_to_32x64_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS_to_32x64_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODISv2_to_32x64_nomask_aave_da_c190505.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS-wCsp_to_32x64_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_USGS_to_32x64_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_LandScan2004_to_32x64_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner_to_32x64_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner-mergeGIS_to_32x64_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/32x64/map_0.9x1.25_GRDC_to_32x64_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/32x64/map_360x720_cruncep_to_32x64_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/32x64/map_1km-merge-10min_HYDRO1K-merge-nomask_to_32x64_nomask_aave_da_c130405.nc - -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_MODIS_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_0.25x0.25_MODIS_to_8x16_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_AVHRR_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_10x10min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_IGBP-GSDP_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_ISRIC-WISE_to_8x16_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_ORNL-Soil_to_8x16_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS_to_8x16_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODISv2_to_8x16_nomask_aave_da_c190505.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS-wCsp_to_8x16_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_USGS_to_8x16_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_LandScan2004_to_8x16_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner_to_8x16_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner-mergeGIS_to_8x16_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/8x16/map_0.9x1.25_GRDC_to_8x16_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/8x16/map_360x720_cruncep_to_8x16_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/8x16/map_1km-merge-10min_HYDRO1K-merge-nomask_to_8x16_nomask_aave_da_c130411.nc - lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_MODIS_to_4x5_nomask_aave_da_c110822.nc +"conus_30_x8,512x1024,360x720cru,128x256,64x128,48x96,,94x192,0.23x0.31,0.47x0.63,0.9x1.25,1.9x2.5,2.5x3.33,4x5,10x15,5x5_amazon,1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ,1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.1x0.1,0.25x0.25,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.33,0.125x0.125,ne4np4,ne16np4,ne30np4,ne60np4,ne120np4,ne240np4,1km-merge-10min"> Horizontal resolutions -Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools +Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min and 0.33x0.33 are only used for CLM tools Date: Tue, 21 May 2019 15:06:47 -0600 Subject: [PATCH 466/730] Add mapping files for 94x192 and add compsets with Qian for single point tests (for speed and less memory usage) --- .../namelist_defaults_clm4_5.xml | 47 +++++++++++++++++++ cime_config/config_compsets.xml | 19 ++++++++ 2 files changed, 66 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 6ac3adc568..48b09faca7 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2545,6 +2545,53 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n + + + +lnd/clm2/mappingdata/maps/94x192/map_3x3min_USGS_to_94x192_nomask_aave_da_c120926.nc +lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_nomask_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_5x5min_ORNL-Soil_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_94x192_nomask_to_0.5x0.5_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_5x5min_IGBP-GSDP_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_3x3min_MODIS-wCsp_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_1km-merge-10min_HYDRO1K-merge-nomask_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_MODIS_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_5x5min_nomask_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_USGS_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_0.9x1.25_GRDC_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_10x10min_nomask_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_10x10min_IGBPmergeICESatGIS_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_3x3min_LandScan2004_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_360x720cru_cruncep_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_3x3min_GLOBE-Gardner_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_0.25x0.25_MODIS_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_0.5x0.5_AVHRR_to_94x192_nomask_aave_da_c110823.nc +lnd/clm2/mappingdata/maps/94x192/map_5x5min_ISRIC-WISE_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_3x3min_GLOBE-Gardner-mergeGIS_to_94x192_nomask_aave_da_c190521.nc +lnd/clm2/mappingdata/maps/94x192/map_3x3min_MODISv2_to_94x192_nomask_aave_da_c190521.nc + + diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 6f9f1b1c86..cff59f02fa 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -131,6 +131,15 @@ 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + + I2000Clm50BgcCropQianGs + 2000_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + I2000Clm50BgcCruGs 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV @@ -208,6 +217,16 @@ HIST_DATM%QIA_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV + + + + IHistClm50BgcCropQianGs + HIST_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV + + IHistClm50BgcCropGs From b9d2c55e5774d5ae2918dc884357be91ab611547 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2019 15:12:59 -0600 Subject: [PATCH 467/730] Update expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 08e6c189b0..39ebe743ed 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -2,8 +2,8 @@ - FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN - FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN + FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_gnu.clm-monthly RUN + FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_intel.clm-monthly RUN FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN @@ -11,11 +11,6 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN - PEND ERS_Lm40_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN - PEND ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN - PEND ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN - PEND ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN - PEND ERS_Ly20_Mmpi-serial.1x1_numaIA.I2000Clm50BgcDvCropQianGs.cheyenne_gnu.clm-cropMonthOutput RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK From 027faafe52e24b7857e3958a09f4ea03f8f68adc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2019 00:57:32 -0600 Subject: [PATCH 468/730] Make sure pctwet can not be negative --- tools/mksurfdata_map/src/mksurfdat.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index f0672a8840..85d8d72703 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -705,7 +705,7 @@ program mksurfdat pctwet(n) = 100._r8 - pctlak(n) pctgla(n) = 0._r8 else - pctwet(n) = 100._r8 - pctgla(n) - pctlak(n) + pctwet(n) = max(100._r8 - pctgla(n) - pctlak(n), 0.0_r8) end if pcturb(n) = 0._r8 call pctnatpft(n)%set_pct_l2g(0._r8) From c90c9af4b32e2c32a692a8afd0e3096b24d5bacb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2019 11:30:25 -0600 Subject: [PATCH 469/730] Remove the ne120 and conus_30_x8 surface datasets since the files are bad with negative pctwet (issue #673) --- .../namelist_defaults_clm4_5.xml | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 48b09faca7..678bf29b57 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -727,16 +727,11 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_sim lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_10x15_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190303.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr2000_c190128.nc - lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_5x5_amazon_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc @@ -760,16 +755,11 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_si lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_smallvilleIA_hist_78pfts_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr2000_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_78pfts_CMIP6_simyr2000_c190303.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne16np4_hist_78pfts_CMIP6_simyr2000_c190214.nc - -lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr2000_c190128.nc - lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_camdenNJ_hist_16pfts_Irrig_CMIP6_simyr2000_c190214.nc @@ -797,14 +787,9 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_4x5_hist_16pfts_Irrig_CMIP6_sim lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190304.nc lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850_c190303.nc - -lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr1850_c190128.nc - lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_48x96_hist_78pfts_CMIP6_simyr1850_c190214.nc @@ -825,14 +810,9 @@ lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_numaIA_hist_78pfts_CMIP6_si lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1x1_brazil_hist_78pfts_CMIP6_simyr1850_c190214.nc - -lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_ne120np4_hist_78pfts_CMIP6_simyr1850_c190304.nc lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.nc - lnd/clm2/surfdata_map/surfdata_0.9x1.25_hist_16pfts_nourb_CMIP6_simyrPtVg_c181114.nc @@ -853,14 +833,9 @@ lnd/clm2/surfdata_map/surfdata_conus_30_x8_hist_78pfts_CMIP6_simyr1850_c190128.n lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c1908304.nc lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_conus_30_x8_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c181003.nc - lnd/clm2/surfdata_map/landuse.timeseries_1x1_numaIA_hist_78pfts_CMIP6_simyr1850-2015_c170917.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c190304.nc lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c179824.nc -lnd/clm2/surfdata_map/landuse.timeseries_conus_30_x8_hist_78pfts_CMIP6_simyr1850-2015_c181004.nc - Date: Wed, 22 May 2019 13:00:44 -0600 Subject: [PATCH 470/730] Update change files --- doc/.release-ChangeLog_template | 2 +- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 98 +++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/doc/.release-ChangeLog_template b/doc/.release-ChangeLog_template index 404cbc5364..19c997d86d 100644 --- a/doc/.release-ChangeLog_template +++ b/doc/.release-ChangeLog_template @@ -71,7 +71,7 @@ Testing: Summary of Answer changes: ------------------------- -Baseline version for comparison: +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous Changes answers relative to baseline: diff --git a/doc/ChangeSum b/doc/ChangeSum index a6583fb273..550011e40f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.24 erik 05/22/2019 Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution release-clm5.0.23 erik 05/15/2019 Update cime to bring in CO2 transient files for the CMIP6 SSP's as well as presaero for three of them release-clm5.0.22 erik 05/08/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change release-clm5.0.21 erik 05/03/2019 New ndep files, update fates, fix some issues diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 2dd38bd856..382ab59de3 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,102 @@ =============================================================== +Tag name: release-clm5.0.24 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed May 22 12:57:45 MDT 2019 +One-line Summary: Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution + +Purpose of this version: +------------------------ + +Fix a couple small issues. Correct end year for ndep for SSP's so can run to the end of 2100. Some fixes to mksurfdata_map for high +resolution surface datasets. Have 2-degree WACCM-CMIP6DECK match a user-mod directory without carbon isotopes on. Remove the +ne120np4 and conus_30_x8 surface dataset files, as they can't be used (see #673). + +Remove 8x16, 32x64 resolutions as they are no longer needed and there are problems with them. Add in the mapping files needed for +94x192. Check that special landunit percent area's is not less than 0.0, and don't let PCT_WET be less than zero for areas with +ocean (see #673). + +Change some of the longer single point tests to use Qian forcing (as faster, less memory, less problems). Add compsets for this. +This change was also done on master. + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #673, #714, #716, #717, #726 + + Fixes #726 -- Some resolutions fail in mksurfdata_map + Fixes #717 -- Change end year for ndep to 2101 for SSP's + Fixes #716 -- 2 degree CMIP6WACCMDECK needs Carbon isotopes off + Fixes #714 -- Fails on cheyenne for some longer single point simulations + Fixes #673 -- Ice shelf wetland fix in mksurfdata_map can lead to glacier+lake > 100% on surface datasets + +Science changes since: release-clm5.0.23 + Turn Carbon isotopes off for 2-degree CMIP6WACCMDECK + +Software changes since: release-clm5.0.23 + End year for ndep is now 2101, so will run to end of 2100 + Fixes to mksurfdata_map for high resolutions + +Changes to User Interface since: release-clm5.0.23 + Remove ne120np, conus_30_x8 surface datasets + Remove 8x16, and 32x64 resolutions + Add 94x192 mapping files, so can work in mksurfdata_map + +Testinw: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart ---PASS + + tools-tests (components/clm/test/tools): + + cheyenne - PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: No + +Detailed list of changes: +------------------------ + +Externals being used: (cime goes from branch to full tag) + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cim5.6.16 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #720 +(https://github.com/ESCOMP/ctsm/pull) + + #720 -- Fix a couple small issues, 2-degree no-ciso for WACCMDECK and ndep end year 2101 + +=============================================================== +=============================================================== Tag name: release-clm5.0.23 Originator(s): erik (Erik Kluzek) Date: Wed May 15 15:31:15 MDT 2019 From ccc12ef060113d9835df65d166b242664cee7b96 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2019 13:32:11 -0600 Subject: [PATCH 471/730] Correct build-namelist unit tests for removal of ne120 and conus_30_x8 tests, fix list of resolutions, build-namelist tests now runs correctly --- bld/namelist_files/namelist_definition_clm4_5.xml | 2 +- bld/unit_testers/build-namelist_test.pl | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 1a54365be3..ca6361ab7c 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1781,7 +1781,7 @@ CLM run type. +"conus_30_x8,512x1024,360x720cru,128x256,64x128,48x96,94x192,0.23x0.31,0.47x0.63,0.9x1.25,1.9x2.5,2.5x3.33,4x5,10x15,5x5_amazon,1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ,1x1_brazil,1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA,0.1x0.1,0.25x0.25,0.5x0.5,3x3min,5x5min,10x10min,0.33x0.33,0.125x0.125,ne4np4,ne16np4,ne30np4,ne60np4,ne120np4,ne240np4,1km-merge-10min"> Horizontal resolutions Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min, 1km-merge-10min and 0.33x0.33 are only used for CLM tools diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index e07de30143..00a1c6234b 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 828; +my $ntests = 820; if ( defined($opts{'compare'}) ) { - $ntests += 504; + $ntests += 498; } plan( tests=>$ntests ); @@ -1087,6 +1087,10 @@ sub make_env_run { $res eq "360x720cru" || $res eq "512x1024" ) { next; + # Resolutions not supported on release branch + } elsif ( $res eq "ne120np4" || + $res eq "conus_30_x8" ) { + next; } &make_env_run(); From 9fe54291d527ea432e39d18235aa6b207a196000 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2019 13:33:59 -0600 Subject: [PATCH 472/730] Changelog update --- doc/release-clm5.0.ChangeLog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 382ab59de3..4ae1eebd6c 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.24 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed May 22 12:57:45 MDT 2019 +Date: Wed May 22 13:33:48 MDT 2019 One-line Summary: Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution Purpose of this version: @@ -50,7 +50,7 @@ Testinw: build-namelist tests: - cheyenne - PASS + cheyenne - PASS (15 SSP tests are different as expected) unit-tests (components/clm/src): @@ -60,6 +60,7 @@ Testinw: tools-tests (components/clm/test/tools): cheyenne - PASS + hobart --- PASS regular tests (aux_clm): From 263b5e299713712c5b8c9380090b0638552f7c9f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 28 May 2019 15:21:45 -0600 Subject: [PATCH 473/730] Convert the file from NetCDF-4 classic format to NetCDF-3 classic format, fixes #734 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 678bf29b57..fcb22841bd 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -89,7 +89,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Ball-Berry1987 -lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c171012.nc +lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c190528.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP119_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP126_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP245_1850-2100_yearly_c181209.nc @@ -97,7 +97,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP534os_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP5B_1850-2100_yearly_c181209.nc -lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c171012.nc +lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c190528.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP119_3x1_global_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP126_3x1_global_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP245_3x1_global_1850-2100_yearly_c181209.nc From 9a8e7676d2a10c0be8f0f74c273a98443b3a7cd0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 29 May 2019 11:16:24 -0600 Subject: [PATCH 474/730] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 89 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 550011e40f..b61ceae1e4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.25 erik 05/29/2019 Change two files from NetCDF-4 format to NetCDF-3 (because some machines have trouble with NetCDF-4 in pnetcdf) release-clm5.0.24 erik 05/22/2019 Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution release-clm5.0.23 erik 05/15/2019 Update cime to bring in CO2 transient files for the CMIP6 SSP's as well as presaero for three of them release-clm5.0.22 erik 05/08/2019 Fix carbon isotope bug that caused wrong answers for isotopes under transient land-use change diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 4ae1eebd6c..fad475126f 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,93 @@ =============================================================== +Tag name: release-clm5.0.25 +Originator(s): erik (Erik Kluzek) +Date: Wed May 29 11:16:13 MDT 2019 +One-line Summary: Change two files from NetCDF-4 format to NetCDF-3 (because some machines have trouble with NetCDF-4 in pnetcdf) + +Purpose of this version: +------------------------ + +There are two files in NetCDF-4 format that the model uses. Copy these files to NetCDF-3 classic format and point +to the new version in the CLM XML database (use nccopy -k classic). There are some machines that have trouble with +reading NetCDF-4 files in pnetcdf. + +There are still some NetCDF-4 files for mksurfdata_map, but some of these are required to be in NetCDF-4 format. And we only +support mksurfdata_map and mkmapdata on cheyenne. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #734 + Fixes #734 -- Isotope historical files are in NetCDF-4 format need them in NetCDF-3 or NetCDF-5 + +Science changes since: release-clm5.0.24 + None + +Software changes since: release-clm5.0.24 + None + +Changes to User Interface since: release-clm5.0.24 + None + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (6 tests compare different to baseline) + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + + regular tests (prealpha): + + cheyenne_intel - OK + cheyenne_gnu --- OK + hobart_nag ----- OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: No! bit-for-bit + +Detailed list of changes: +------------------------ + +Externals being used: No updates + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cim5.6.16 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #737 +(https://github.com/ESCOMP/ctsm/pull) + + #737 -- Convert the file from NetCDF-4 classic format to NetCDF-3 classic format + +=============================================================== +=============================================================== Tag name: release-clm5.0.24 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed May 22 13:33:48 MDT 2019 From 5acdd7b39dcb9fc2c4444b4245fdfdf9c60fd3bd Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 31 May 2019 11:32:09 -0600 Subject: [PATCH 475/730] Update hooks for fates sci1.27.1_api7.3.0 --- Externals_CLM.cfg | 2 +- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 32431cb476..b440c99ea3 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.26.1_api.7.2.0 +tag = sci.1.27.1_api.7.3.0 required = True [PTCLM] diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index c9098697b6..bfd5b7ce2d 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.2.2_12pft_c190515.nc +lnd/clm2/paramdata/fates_params_api.7.3.0_12pft_c190530.nc From de7dcb0e87296a3fc505a1afc92b40cd989abeb3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 18 Jun 2019 11:40:44 -0700 Subject: [PATCH 476/730] fates multi-element: we moved ncwd to a new module, now pointing to correct place. --- src/main/histFileMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 9375225d2f..822dc249ce 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -24,7 +24,8 @@ module histFileMod use EDTypesMod , only : nlevleaf use FatesInterfaceMod , only : nlevsclass, nlevage use FatesInterfaceMod , only : nlevheight - use EDTypesMod , only : nfsc, ncwd + use EDTypesMod , only : nfsc + use FatesLitterMod , only : ncwd use EDTypesMod , only : num_elements_fates => num_elements use FatesInterfaceMod , only : numpft_fates => numpft use ncdio_pio From 946519e0e5cfe70e3b094d07d166e32357436cf1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 18 Jun 2019 12:00:05 -0700 Subject: [PATCH 477/730] fates-multi-element: pointing to correct location of ncwd --- src/utils/clmfates_interfaceMod.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 7e35b2a702..d1d3d45308 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -2329,10 +2329,11 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type use FatesInterfaceMod, only : nlevsclass, nlevage use FatesInterfaceMod, only : nlevheight - use EDtypesMod, only : nfsc, ncwd - use EDtypesMod, only : nlevleaf, nclmax + use EDtypesMod, only : nfsc + use FatesLitterMod, only : ncwd + use EDtypesMod, only : nlevleaf, nclmax use FatesInterfaceMod, only : numpft_fates => numpft - use clm_varpar, only : nlevgrnd + use clm_varpar, only : nlevgrnd implicit none From 77a2298e64cd11cec1a8f91567a888ccc8d6446a Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 19 Jul 2019 15:05:33 -0600 Subject: [PATCH 478/730] Fix negative values generated during BGC DynamicAreaConservation When running a transient case with C isotopes, people occasionally ran into a problem whereby C13_HR, C13_NBP, FPI values result in numeric conversion not representable error. At least part of the problem can be explained as: frootc can sometimes be negative; this is intentional. Negative frootc causes negative dwt_frootc_to_litter if the patch in question is shrinking. The resulting negative fluxes cause problems in the ciso calculation. This can be worked around by inserting an extra precision control call between the calculation of the dwt fluxes and the ciso fluxes, so that small negative dwt fluxes are set to 0. For more details, see https://github.com/ESCOMP/ctsm/issues/741 Resolves ESCOMP/ctsm#741 --- src/biogeochem/CNVegetationFacade.F90 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 index fed7889819..c3b42209f9 100644 --- a/src/biogeochem/CNVegetationFacade.F90 +++ b/src/biogeochem/CNVegetationFacade.F90 @@ -721,6 +721,13 @@ subroutine DynamicAreaConservation(this, bounds, clump_index, & soilbiogeochem_nitrogenstate_inst) call t_stopf('CNUpdateDynPatch') + ! This call fixes issue #741 by performing precision control on decomp_cpools_vr_col + call t_startf('SoilBiogeochemPrecisionControl') + call SoilBiogeochemPrecisionControl(num_soilc_with_inactive, filter_soilc_with_inactive, & + soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & + c14_soilbiogeochem_carbonstate_inst,soilbiogeochem_nitrogenstate_inst) + call t_stopf('SoilBiogeochemPrecisionControl') + call t_startf('dyn_cnbal_col') call dyn_cnbal_col(bounds, clump_index, column_state_updater, & soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & From 5ce83852b7a8dc78570524ee44b60016ebf7eab0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 23 Jul 2019 15:37:54 -0600 Subject: [PATCH 479/730] Add in missing MODISv2 mapping file needed for 0.125x0.125 resolution, remove the pre-millenial year sections no longer needed --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 ++ bld/namelist_files/namelist_definition_clm4_5.xml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index fcb22841bd..bdde71de90 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -2458,6 +2458,8 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 >lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_LandScan2004_to_0.125x0.125_nomask_aave_da_c140702.nc lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS_to_0.125x0.125_nomask_aave_da_c140702.nc +lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODISv2_to_0.125x0.125_nomask_aave_da_c190613.nc lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS-wCsp_to_0.125x0.125_nomask_aave_da_c160427.nc +"constant,1000-1002,1000-1004,850-1850,1850-1855,1850-2000,1850-2005,1850-2100,1980-2015,2000-2100"> Range of years to simulate transitory datasets for (such as dynamic: land-use datasets, aerosol-deposition, Nitrogen deposition rates etc.) Constant means simulation will be held at a constant year given in sim_year. A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing only, NOT corresponding to any real datasets. From a0513e042f896746eb4add5332bb5454ee09f402 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 23 Jul 2019 15:56:33 -0600 Subject: [PATCH 480/730] Update cime --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index c9b77c9691..ec8450c084 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.16 +tag = cime5.6.20 required = True [externals_description] From d017c3afeab786458266bdf5747aacdaa98ada73 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 23 Jul 2019 16:02:17 -0600 Subject: [PATCH 481/730] Bring in changes from ctsm1.0.dev052 by hand using patch --- tools/mksurfdata_map/src/CMakeLists.txt | 1 + tools/mksurfdata_map/src/Srcfiles | 1 + tools/mksurfdata_map/src/mkpftMod.F90 | 6 +- tools/mksurfdata_map/src/mksoilMod.F90 | 162 +------------ tools/mksurfdata_map/src/mksoilUtilsMod.F90 | 224 ++++++++++++++++++ tools/mksurfdata_map/src/test/CMakeLists.txt | 3 +- .../src/test/mksoilUtils_test/CMakeLists.txt | 7 + .../test_dominant_soil_color.pf | 140 +++++++++++ 8 files changed, 388 insertions(+), 156 deletions(-) create mode 100644 tools/mksurfdata_map/src/mksoilUtilsMod.F90 create mode 100644 tools/mksurfdata_map/src/test/mksoilUtils_test/CMakeLists.txt create mode 100644 tools/mksurfdata_map/src/test/mksoilUtils_test/test_dominant_soil_color.pf diff --git a/tools/mksurfdata_map/src/CMakeLists.txt b/tools/mksurfdata_map/src/CMakeLists.txt index 4cd91e8a39..0cf2ca90b0 100644 --- a/tools/mksurfdata_map/src/CMakeLists.txt +++ b/tools/mksurfdata_map/src/CMakeLists.txt @@ -17,6 +17,7 @@ list(APPEND mksurfdat_sources mkpctPftTypeMod.F90 mkutilsMod.F90 mkpftUtilsMod.F90 + mksoilUtilsMod.F90 mkvarctl.F90 mkvarpar.F90 shr_const_mod.F90 diff --git a/tools/mksurfdata_map/src/Srcfiles b/tools/mksurfdata_map/src/Srcfiles index 94985557dc..d639688890 100644 --- a/tools/mksurfdata_map/src/Srcfiles +++ b/tools/mksurfdata_map/src/Srcfiles @@ -12,6 +12,7 @@ mkpftConstantsMod.F90 mkpftUtilsMod.F90 mkpctPftTypeMod.F90 mkpftMod.F90 +mksoilUtilsMod.F90 mksoilMod.F90 mkvocefMod.F90 mksurfdat.F90 diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index c99d66c9ac..fb86543944 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -524,7 +524,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & call gridmap_areaave(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8) do m = 0, num_natpft - call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) + call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), & + nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) do no = 1,ns_o if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then if (m == 0) then @@ -536,7 +537,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & enddo end do do m = 1, num_cft - call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) + call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), & + nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) do no = 1,ns_o if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then if (m == 1) then diff --git a/tools/mksurfdata_map/src/mksoilMod.F90 b/tools/mksurfdata_map/src/mksoilMod.F90 index 1192863737..e73c611308 100644 --- a/tools/mksurfdata_map/src/mksoilMod.F90 +++ b/tools/mksurfdata_map/src/mksoilMod.F90 @@ -15,6 +15,7 @@ module mksoilMod use shr_kind_mod, only : r8 => shr_kind_r8, r4=>shr_kind_r4 use shr_sys_mod , only : shr_sys_flush use mkdomainMod , only : domain_checksame + use mksoilUtilsMod, only : mkrank, dominant_soil_color implicit none SAVE @@ -43,7 +44,6 @@ module mksoilMod ! !PRIVATE DATA MEMBERS: ! ! !PRIVATE MEMBER FUNCTIONS: - private :: mkrank private :: mksoiltexInit ! Soil texture Initialization private :: mksoilcolInit ! Soil color Initialization private :: mksoilfmaxInit ! Soil fmax Initialization @@ -597,21 +597,15 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, & !EOP type(gridmap_type) :: tgridmap type(domain_type) :: tdomain ! local domain - integer, parameter :: num=2 ! set soil mapunit number - integer :: wsti(num) ! index to 1st and 2nd largest wst - real(r8), allocatable :: wst(:,:) ! overlap weights, by surface type real(r8), allocatable :: gast_i(:) ! global area, by surface type real(r8), allocatable :: gast_o(:) ! global area, by surface type integer , allocatable :: soil_color_i(:) ! input grid: BATS soil color - integer , allocatable :: color(:) ! 0: none; 1: some - real(r8) :: wt ! map overlap weight real(r8) :: sum_fldi ! global sum of dummy input fld real(r8) :: sum_fldo ! global sum of dummy output fld character(len=35), allocatable :: col(:) ! name of each color - integer :: k,l,n,m,ni,no,ns_i,ns_o ! indices + integer :: k,l,m,ni,no,ns_i,ns_o ! indices integer :: ncid,dimid,varid ! input netCDF id's integer :: ier ! error status - integer :: miss = 99999 ! missing data indicator real(r8) :: relerr = 0.00001 ! max error: sum overlap wts ne 1 character(len=32) :: subname = 'mksoilcol' !----------------------------------------------------------------------- @@ -703,62 +697,14 @@ subroutine mksoilcol(ldomain, mapfname, datfname, ndiag, & call domain_checksame( tdomain, ldomain, tgridmap ) - ! find area of overlap for each soil color for each no - - allocate(wst(0:nsoicol,ns_o)) - wst(0:nsoicol,:) = 0 - allocate(color(ns_o)) - color(:) = 0 - - ! TODO: need to do a loop to determine - ! the maximum number of over lap cells throughout the grid - ! first get an array that is novr(ns_o) and fill this in - then set - ! maxovr - to max(novr) - then allocate the array wst to be size of - ! maxovr,ns_o or 0:nsoilcol,ns_o - - do n = 1,tgridmap%ns - ni = tgridmap%src_indx(n) - no = tgridmap%dst_indx(n) - wt = tgridmap%wovr(n) - k = soil_color_i(ni) * tdomain%mask(ni) - wst(k,no) = wst(k,no) + wt - if (k>0 .and. wst(k,no)>0.) then - color(no) = 1 - wst(0,no) = 0.0 - end if - enddo - - soil_color_o(:) = 0 - do no = 1,ns_o - - ! Rank non-zero weights by color type. wsti(1) is the most extensive - ! color type. - - if (color(no) == 1) then - call mkrank (nsoicol, wst(0:nsoicol,no), miss, wsti, num) - soil_color_o(no) = wsti(1) - end if - - ! If land but no color, set color to 15 (in older dataset generic - ! soil color 4) - - if (nsoicol == 8) then - if (soil_color_o(no)==0) soil_color_o(no) = 4 - else if (nsoicol == 20) then - if (soil_color_o(no)==0) soil_color_o(no) = 15 - end if - - ! Error checks + ! Determine dominant soil color for each output cell - if (soil_color_o(no) < 0 .or. soil_color_o(no) > nsoicol) then - write (6,*) 'MKSOILCOL error: land model soil color = ', & - soil_color_o(no),' is not valid for lon,lat = ',no - call abort() - end if - - enddo - deallocate (wst) - deallocate (color) + call dominant_soil_color( & + tgridmap = tgridmap, & + mask_i = tdomain%mask, & + soil_color_i = soil_color_i, & + nsoicol = nsoicol, & + soil_color_o = soil_color_o) ! Global sum of output field @@ -983,96 +929,6 @@ subroutine mkorganic(ldomain, mapfname, datfname, ndiag, organic_o) end subroutine mkorganic -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: mkrank -! -! !INTERFACE: -subroutine mkrank (n, a, miss, iv, num) -! -! !DESCRIPTION: -! Return indices of largest [num] values in array [a]. Private method -! only used for soil color and soil texture. -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: n !array length - real(r8), intent(in) :: a(0:n) !array to be ranked - integer , intent(in) :: miss !missing data value - integer , intent(in) :: num !number of largest values requested - integer , intent(out):: iv(num) !index to [num] largest values in array [a] -! -! !CALLED FROM: -! subroutine mksoilcol -! subroutine mksoiltex -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) a_max !maximum value in array - integer i !array index - real(r8) delmax !tolerance for finding if larger value - integer m !do loop index - integer k !do loop index - logical exclude !true if data value has already been chosen -!----------------------------------------------------------------------- - - delmax = 1.e-06 - - ! Find index of largest non-zero number - - iv(1) = miss - a_max = -9999. - - do i = 0, n - if (a(i)>0. .and. (a(i)-a_max)>delmax) then - a_max = a(i) - iv(1) = i - end if - end do - - ! iv(1) = miss indicates no values > 0. this is an error - - if (iv(1) == miss) then - write (6,*) 'MKRANK error: iv(1) = missing' - call abort() - end if - - ! Find indices of the next [num]-1 largest non-zero number. - ! iv(m) = miss if there are no more values > 0 - - do m = 2, num - iv(m) = miss - a_max = -9999. - do i = 0, n - - ! exclude if data value has already been chosen - - exclude = .false. - do k = 1, m-1 - if (i == iv(k)) exclude = .true. - end do - - ! if not already chosen, see if it is the largest of - ! the remaining values - - if (.not. exclude) then - if (a(i)>0. .and. (a(i)-a_max)>delmax) then - a_max = a(i) - iv(m) = i - end if - end if - end do - end do - -end subroutine mkrank - !----------------------------------------------------------------------- !BOP ! diff --git a/tools/mksurfdata_map/src/mksoilUtilsMod.F90 b/tools/mksurfdata_map/src/mksoilUtilsMod.F90 new file mode 100644 index 0000000000..e8c672590d --- /dev/null +++ b/tools/mksurfdata_map/src/mksoilUtilsMod.F90 @@ -0,0 +1,224 @@ +module mksoilUtilsMod + + !----------------------------------------------------------------------- + !BOP + ! + ! !MODULE: mksoilUtils + ! + ! !DESCRIPTION: + ! Lower-level utilities used in making soil data. + ! + ! These are separated out from mksoilMod mainly as an aid to testing. + ! + ! !REVISION HISTORY: + ! Author: Bill Sacks + ! + !----------------------------------------------------------------------- + !!USES: + use shr_kind_mod, only : r8 => shr_kind_r8 + use mkgridmapMod, only : gridmap_type + + implicit none + private + + ! + ! !PUBLIC MEMBER FUNCTIONS: + ! + public :: dominant_soil_color + public :: mkrank + + ! + ! !PRIVATE MEMBER FUNCTIONS: + ! + + !EOP + !=============================================================== +contains + !=============================================================== + + !----------------------------------------------------------------------- + subroutine dominant_soil_color(tgridmap, mask_i, soil_color_i, nsoicol, soil_color_o) + ! + ! !DESCRIPTION: + ! Determine the dominant soil color in each output cell + ! + ! !ARGUMENTS: + type(gridmap_type) , intent(in) :: tgridmap + integer , intent(in) :: mask_i(:) ! input grid: land mask (1 = land, 0 = ocean) + integer , intent(in) :: soil_color_i(:) ! input grid: BATS soil color + integer , intent(in) :: nsoicol ! number of soil colors + integer , intent(out) :: soil_color_o(:) ! output grid: soil color classes + ! + ! !LOCAL VARIABLES: + integer, parameter :: num = 2 ! set soil mapunit number + integer :: wsti(num) ! index to 1st and 2nd largest wst + integer :: k, n, ni, no, ns_i, ns_o + real(r8) :: wt ! map overlap weight + real(r8), allocatable :: wst(:,:) ! overlap weights, by surface type + logical :: has_color ! whether this grid cell has non-zero color + integer, parameter :: miss = 99999 ! missing data indicator + + character(len=*), parameter :: subname = 'dominant_soil_color' + !----------------------------------------------------------------------- + + ns_i = size(mask_i) + if (size(soil_color_i) /= ns_i) then + write(6,*) subname, ' ERROR: size of soil_color_i should match size of mask_i' + write(6,*) 'size(mask_i), size(soil_color_i) = ', & + size(mask_i), size(soil_color_i) + call abort() + end if + + ! find area of overlap for each soil color for each no + + ns_o = size(soil_color_o) + allocate(wst(0:nsoicol,ns_o)) + wst(0:nsoicol,:) = 0 + + ! TODO: need to do a loop to determine + ! the maximum number of over lap cells throughout the grid + ! first get an array that is novr(ns_o) and fill this in - then set + ! maxovr - to max(novr) - then allocate the array wst to be size of + ! maxovr,ns_o or 0:nsoilcol,ns_o + + do n = 1,tgridmap%ns + ni = tgridmap%src_indx(n) + no = tgridmap%dst_indx(n) + wt = tgridmap%wovr(n) + k = soil_color_i(ni) * mask_i(ni) + wst(k,no) = wst(k,no) + wt + enddo + + soil_color_o(:) = 0 + do no = 1,ns_o + + ! If the output cell has any non-zero-colored inputs, then set the weight of + ! zero-colored inputs to 0, to ensure that the zero-color is NOT dominant. + if (any(wst(1:nsoicol,no) > 0.)) then + has_color = .true. + wst(0,no) = 0.0 + else + has_color = .false. + end if + + ! Rank non-zero weights by color type. wsti(1) is the most extensive + ! color type. + + if (has_color) then + call mkrank (nsoicol, wst(0:nsoicol,no), miss, wsti, num) + soil_color_o(no) = wsti(1) + end if + + ! If land but no color, set color to 15 (in older dataset generic + ! soil color 4) + + if (nsoicol == 8) then + if (soil_color_o(no)==0) then + soil_color_o(no) = 4 + end if + else if (nsoicol == 20) then + if (soil_color_o(no)==0) then + soil_color_o(no) = 15 + end if + else + write(6,*) 'MKSOILCOL error: unhandled nsoicol: ', nsoicol + call abort() + end if + + ! Error checks + + if (soil_color_o(no) < 0 .or. soil_color_o(no) > nsoicol) then + write (6,*) 'MKSOILCOL error: land model soil color = ', & + soil_color_o(no),' is not valid for lon,lat = ',no + call abort() + end if + + end do + + deallocate (wst) + + end subroutine dominant_soil_color + + + !----------------------------------------------------------------------- + !BOP + ! + ! !ROUTINE: mkrank + ! + ! !INTERFACE: + subroutine mkrank (n, a, miss, iv, num) + ! + ! !DESCRIPTION: + ! Return indices of largest [num] values in array [a]. + ! + ! !ARGUMENTS: + integer , intent(in) :: n !array length + real(r8), intent(in) :: a(0:n) !array to be ranked + integer , intent(in) :: miss !missing data value + integer , intent(in) :: num !number of largest values requested + integer , intent(out):: iv(num) !index to [num] largest values in array [a] + ! + ! !REVISION HISTORY: + ! Author: Gordon Bonan + ! + ! !LOCAL VARIABLES: + !EOP + real(r8) a_max !maximum value in array + integer i !array index + real(r8) delmax !tolerance for finding if larger value + integer m !do loop index + integer k !do loop index + logical exclude !true if data value has already been chosen + !----------------------------------------------------------------------- + + delmax = 1.e-06 + + ! Find index of largest non-zero number + + iv(1) = miss + a_max = -9999. + + do i = 0, n + if (a(i)>0. .and. (a(i)-a_max)>delmax) then + a_max = a(i) + iv(1) = i + end if + end do + + ! iv(1) = miss indicates no values > 0. this is an error + + if (iv(1) == miss) then + write (6,*) 'MKRANK error: iv(1) = missing' + call abort() + end if + + ! Find indices of the next [num]-1 largest non-zero number. + ! iv(m) = miss if there are no more values > 0 + + do m = 2, num + iv(m) = miss + a_max = -9999. + do i = 0, n + + ! exclude if data value has already been chosen + + exclude = .false. + do k = 1, m-1 + if (i == iv(k)) exclude = .true. + end do + + ! if not already chosen, see if it is the largest of + ! the remaining values + + if (.not. exclude) then + if (a(i)>0. .and. (a(i)-a_max)>delmax) then + a_max = a(i) + iv(m) = i + end if + end if + end do + end do + + end subroutine mkrank + +end module mksoilUtilsMod diff --git a/tools/mksurfdata_map/src/test/CMakeLists.txt b/tools/mksurfdata_map/src/test/CMakeLists.txt index 690bee396e..5cfb20f21b 100644 --- a/tools/mksurfdata_map/src/test/CMakeLists.txt +++ b/tools/mksurfdata_map/src/test/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(mkpctPftType_test) add_subdirectory(mkpftUtils_test) add_subdirectory(mkgridmap_test) -add_subdirectory(mkindexmap_test) \ No newline at end of file +add_subdirectory(mkindexmap_test) +add_subdirectory(mksoilUtils_test) \ No newline at end of file diff --git a/tools/mksurfdata_map/src/test/mksoilUtils_test/CMakeLists.txt b/tools/mksurfdata_map/src/test/mksoilUtils_test/CMakeLists.txt new file mode 100644 index 0000000000..4d94b8114b --- /dev/null +++ b/tools/mksurfdata_map/src/test/mksoilUtils_test/CMakeLists.txt @@ -0,0 +1,7 @@ +set (pfunit_sources + test_dominant_soil_color.pf) + +create_pFUnit_test(mksoilUtils test_mksoilUtils_exe + "${pfunit_sources}" "") + +target_link_libraries(test_mksoilUtils_exe mksurfdat) \ No newline at end of file diff --git a/tools/mksurfdata_map/src/test/mksoilUtils_test/test_dominant_soil_color.pf b/tools/mksurfdata_map/src/test/mksoilUtils_test/test_dominant_soil_color.pf new file mode 100644 index 0000000000..b506549d87 --- /dev/null +++ b/tools/mksurfdata_map/src/test/mksoilUtils_test/test_dominant_soil_color.pf @@ -0,0 +1,140 @@ +module test_dominant_soil_color + + ! Tests of mksoilUtilsMod: dominant_soil_color + + use pfunit_mod + use mksoilUtilsMod + use shr_kind_mod , only : r8 => shr_kind_r8 + use mkgridmapMod, only : gridmap_type, gridmap_clean, for_test_create_gridmap + + implicit none + + @TestCase + type, extends(TestCase) :: tdsc + type(gridmap_type) :: gridmap + contains + procedure :: setUp + procedure :: tearDown + procedure :: createGridmap1dst + end type tdsc + + real(r8), parameter :: tol = 1.e-13_r8 + +contains + + subroutine setUp(this) + class(tdsc), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(tdsc), intent(inout) :: this + call gridmap_clean(this%gridmap) + end subroutine tearDown + + subroutine createGridmap1dst(this, wovr) + ! Create this%gridmap with a single destination point + class(tdsc), intent(inout) :: this + real(r8), intent(in) :: wovr(:) ! overlap weights + + integer :: i + integer :: npts + integer :: src_indx(size(wovr)) + integer :: dst_indx(size(wovr)) + + dst_indx(:) = 1 + npts = size(wovr) + src_indx(:) = [(i, i = 1, npts)] + + call for_test_create_gridmap(this%gridmap, na = npts, nb = 1, ns = npts, & + src_indx = src_indx, dst_indx = dst_indx, wovr = wovr) + end subroutine createGridmap1dst + + @Test + subroutine equalWeights(this) + ! Four inputs with equal weight; two of one class, one of each of two other classes + class(tdsc), intent(inout) :: this + integer :: mask_i(4) + integer :: soil_color_i(4) + integer :: soil_color_o(1) + + call this%createGridmap1dst([0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8]) + mask_i(:) = 1 + soil_color_i(:) = [1, 2, 2, 3] + + call dominant_soil_color(this%gridmap, mask_i, soil_color_i, 20, soil_color_o) + + @assertEqual(2, soil_color_o(1)) + end subroutine equalWeights + + @Test + subroutine inequalWeights(this) + ! Four inputs with inequal weight + class(tdsc), intent(inout) :: this + integer :: mask_i(4) + integer :: soil_color_i(4) + integer :: soil_color_o(1) + + call this%createGridmap1dst([0.5_r8, 0.2_r8, 0.2_r8, 0.1_r8]) + mask_i(:) = 1 + soil_color_i(:) = [3, 1, 1, 2] + + call dominant_soil_color(this%gridmap, mask_i, soil_color_i, 20, soil_color_o) + + @assertEqual(3, soil_color_o(1)) + end subroutine inequalWeights + + @Test + subroutine noColor(this) + ! No color in input + class(tdsc), intent(inout) :: this + integer :: mask_i(4) + integer :: soil_color_i(4) + integer :: soil_color_o(1) + + call this%createGridmap1dst([0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8]) + ! Some points are inside the mask with color = 0, other points are outside the mask + mask_i(:) = [1, 0, 0, 1] + soil_color_i(:) = [0, 1, 1, 0] + + call dominant_soil_color(this%gridmap, mask_i, soil_color_i, 20, soil_color_o) + + @assertEqual(15, soil_color_o(1)) + end subroutine noColor + + @Test + subroutine noColorInFirstPoints(this) + ! No color in the first points, but a color in the last point + class(tdsc), intent(inout) :: this + integer :: mask_i(4) + integer :: soil_color_i(4) + integer :: soil_color_o(1) + + call this%createGridmap1dst([0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8]) + ! Some points are inside the mask with color = 0, other points are outside the mask + mask_i(:) = 1 + soil_color_i(:) = [0, 0, 0, 1] + + call dominant_soil_color(this%gridmap, mask_i, soil_color_i, 20, soil_color_o) + + @assertEqual(1, soil_color_o(1)) + end subroutine noColorInFirstPoints + + @Test + subroutine noColorInLastPoints(this) + ! No color in the last points, but a color in the first point + class(tdsc), intent(inout) :: this + integer :: mask_i(4) + integer :: soil_color_i(4) + integer :: soil_color_o(1) + + call this%createGridmap1dst([0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8]) + ! Some points are inside the mask with color = 0, other points are outside the mask + mask_i(:) = 1 + soil_color_i(:) = [1, 0, 0, 0] + + call dominant_soil_color(this%gridmap, mask_i, soil_color_i, 20, soil_color_o) + + @assertEqual(1, soil_color_o(1)) + end subroutine noColorInLastPoints + +end module test_dominant_soil_color From 9f11aed307e274517d93e6543a79724e3038f955 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 23 Jul 2019 16:07:19 -0600 Subject: [PATCH 482/730] Add config_archive.xml fixing #343 --- cime_config/config_archive.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cime_config/config_archive.xml diff --git a/cime_config/config_archive.xml b/cime_config/config_archive.xml new file mode 100644 index 0000000000..4c2412a0e3 --- /dev/null +++ b/cime_config/config_archive.xml @@ -0,0 +1,24 @@ + + + r + rh\d? + h\d*.*\.nc$ + e + locfnh + + rpointer.lnd$NINST_STRING + ./$CASE.clm2$NINST_STRING.r.$DATENAME.nc + + + rpointer.lnd + rpointer.lnd_9999 + casename.clm2.r.1976-01-01-00000.nc + casename.clm2.rh4.1976-01-01-00000.nc + casename.clm2.h0.1976-01-01-00000.nc + casename.clm2.h0.1976-01-01-00000.nc.base + casename.clm2_0002.e.postassim.1976-01-01-00000.nc + casename.clm2_0002.e.preassim.1976-01-01-00000.nc + anothercasename.clm2.i.1976-01-01-00000.nc + + + From 3aded435024348fe87c62009af166b3d47143398 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 25 Jul 2019 15:42:40 -0600 Subject: [PATCH 483/730] Bring in changes from ctsm1.0.dev0523...branch_tags/prescribed_soil_moisture.n02_ctsm1.0.dev052 and make sure they work on cheyenne_intel --- bld/CLMBuildNamelist.pm | 46 ++++++++++++++- .../namelist_defaults_clm4_5.xml | 11 ++++ .../namelist_definition_clm4_5.xml | 33 ++++++++++- bld/unit_testers/build-namelist_test.pl | 10 +++- cime_config/testdefs/testlist_clm.xml | 10 ++++ src/main/clm_driver.F90 | 9 +++ src/main/clm_initializeMod.F90 | 12 +++- src/main/clm_varctl.F90 | 6 ++ src/main/controlMod.F90 | 4 ++ src/main/decompInitMod.F90 | 59 +++++++++++++++++++ src/main/decompMod.F90 | 14 +++-- src/main/ndepStreamMod.F90 | 35 +++++++++-- 12 files changed, 231 insertions(+), 18 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index af4e355d89..c1afff586b 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1637,6 +1637,11 @@ sub process_namelist_inline_logic { ############################### setup_logic_nitrogen_deposition($opts, $nl_flags, $definition, $defaults, $nl, $physv); + ########################################## + # namelist group: soil_moisture_streams # + ########################################## + setup_logic_soilm_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); + ################################## # namelist group: cnmresp_inparm # ################################## @@ -3518,6 +3523,45 @@ sub setup_logic_megan { #------------------------------------------------------------------------------- +sub setup_logic_soilm_streams { + # prescribed soil moisture streams require clm4_5/clm5_0 + my ($test_files, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + + if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams'); + if ( &value_is_true( $nl->get_value('use_soil_moisture_streams') ) ) { + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_tintalgo', + 'hgrid'=>$nl_flags->{'res'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_soilm', 'phys'=>$nl_flags->{'phys'}, + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_soilm', 'phys'=>$nl_flags->{'phys'}, + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + # Set align year, if first and last years are different + if ( $nl->get_value('stream_year_first_soilm') != + $nl->get_value('stream_year_last_soilm') ) { + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, + 'model_year_align_soilm', 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + } + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_soilm', 'phys'=>$nl_flags->{'phys'}, + 'hgrid'=>$nl_flags->{'res'} ); + } else { + if ( defined($nl->get_value('stream_year_first_soilm')) || + defined($nl->get_value('model_year_align_soilm')) || + defined($nl->get_value('stream_fldfilename_soilm')) || + defined($nl->get_value('stream_year_last_soilm')) ) { + $log->fatal_error("One of the soilm streams namelist items (stream_year_first_soilm, " . + " model_year_align_soilm, stream_fldfilename_soilm, stream_fldfilename_soilm)" . + " is defined, but use_soil_moisture_streams option NOT set to true"); + } + } + } +} + +#------------------------------------------------------------------------------- + sub setup_logic_lai_streams { # lai streams require clm4_5/clm5_0 my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; @@ -3871,7 +3915,7 @@ sub write_output_files { } else { @groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams - lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology + soil_moisture_streams lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology clm_soilhydrology_inparm dynamic_subgrid cnvegcarbonstate finidat_consistency_checks dynpft_consistency_checks clm_initinterp_inparm century_soilbgcdecompcascade diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index bdde71de90..20b8850daa 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1093,6 +1093,17 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 nn nn + + +.false. +1997 +1997 +1997 + +lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc + +linear + .false. 2001 diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index d3386ebb9f..5c93ee849f 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1544,7 +1544,7 @@ Mapping method from Nitrogen deposition input file to the model resolution - + + + +Toggle to turn on use of input prescribed soil moisture streams rather than have CLM prognose it (EXPERIMENTAL) + + + +First year to loop over for prescribed soil moisture streams data + + + +Last year to loop over for prescribed soil moisture streams data + + + +Simulation year that aligns with stream_year_first_soilm value + + + +Filename of input stream data for prescribed soil moisture streams data + + + +Time interpolation method to use for prescribed soil moisture streams data + + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 00a1c6234b..64df3c4efc 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 820; +my $ntests = 825; if ( defined($opts{'compare'}) ) { - $ntests += 498; + $ntests += 501; } plan( tests=>$ntests ); @@ -315,6 +315,7 @@ sub make_env_run { "-bgc sp -use_case 1850-2100_SSP2-4.5_transient -namelist '&a start_ymd=18501223/'", "-bgc bgc -use_case 1850-2100_SSP3-7.0_transient -namelist '&a start_ymd=20701029/'", "-bgc fates -use_case 2000_control -no-megan", + "-bgc sp -use_case 2000_control -res 0.9x1.25 -namelist '&a use_soil_moisture_streams = T/'", "-bgc cn -use_case 1850-2100_SSP5-8.5_transient -namelist '&a start_ymd=19201023/'", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", "-res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control -drydep -fire_emis -light_res 360x720", @@ -408,6 +409,11 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-bgc cndv", }, + "soilm_stream wo use" =>{ options=>"-res 0.9x1.25 -envxml_dir .", + namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='missing_file'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 85c9e7b043..f6daa6a183 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -73,6 +73,16 @@ + + + + + + + + + + diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 8f6e372090..a324dfd3ef 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -12,6 +12,7 @@ module clm_driver use clm_varctl , only : wrtdia, iulog, use_fates use clm_varctl , only : use_cn, use_lch4, use_noio, use_c13, use_c14 use clm_varctl , only : use_crop, ndep_from_cpl + use clm_varctl , only : use_soil_moisture_streams use clm_time_manager , only : get_nstep, is_beg_curr_day use clm_time_manager , only : get_prev_date, is_first_step use clm_varpar , only : nlevsno, nlevgrnd @@ -79,6 +80,7 @@ module clm_driver use clm_instMod use clm_initializeMod , only : soil_water_retention_curve use EDBGCDynMod , only : EDBGCDyn, EDBGCDynSummary + use SoilMoistureStreamMod , only : PrescribedSoilMoistureInterp ! ! !PUBLIC TYPES: implicit none @@ -332,6 +334,13 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) + if (use_soil_moisture_streams) then + call t_startf('prescribed_sm') + call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & + waterstate_inst) + call t_stopf('prescribed_sm') + endif + call t_startf('begwbal') call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 692ba83ab8..73c71f90d9 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -13,6 +13,7 @@ module clm_initializeMod use clm_varctl , only : is_cold_start, is_interpolated_start use clm_varctl , only : iulog use clm_varctl , only : use_lch4, use_cn, use_cndv, use_c13, use_c14, use_fates + use clm_varctl , only : use_soil_moisture_streams use clm_instur , only : wt_lunit, urban_valid, wt_nat_patch, wt_cft, fert_cft, wt_glc_mec, topo_glc_mec use perf_mod , only : t_startf, t_stopf use readParamsMod , only : readParameters @@ -25,7 +26,8 @@ module clm_initializeMod use filterMod , only : allocFilters, filter use FatesInterfaceMod, only : set_fates_global_elements - use clm_instMod + use clm_instMod + use SoilMoistureStreamMod, only : PrescribedSoilMoistureInit ! implicit none public ! By default everything is public @@ -43,12 +45,12 @@ subroutine initialize1( ) ! CLM initialization first phase ! ! !USES: - use clm_varpar , only: clm_varpar_init, natpft_lb, natpft_ub, cft_lb, cft_ub, maxpatch_glcmec + use clm_varpar , only: clm_varpar_init, natpft_lb, natpft_ub, cft_lb, cft_ub, maxpatch_glcmec, nlevsoi use clm_varcon , only: clm_varcon_init use landunit_varcon , only: landunit_varcon_init, max_lunit use clm_varctl , only: fsurdat, fatmlndfrc, noland, version use pftconMod , only: pftcon - use decompInitMod , only: decompInit_lnd, decompInit_clumps, decompInit_glcp + use decompInitMod , only: decompInit_lnd, decompInit_clumps, decompInit_glcp, decompInit_lnd3D use domainMod , only: domain_check, ldomain, domain_init use surfrdMod , only: surfrd_get_globmask, surfrd_get_grid, surfrd_get_data use controlMod , only: control_init, control_print, NLFilename @@ -122,6 +124,7 @@ subroutine initialize1( ) call decompInit_lnd(ni, nj, amask) deallocate(amask) + if(use_soil_moisture_streams) call decompInit_lnd3D(ni, nj, nlevsoi) ! *** Get JUST gridcell processor bounds *** ! Remaining bounds (landunits, columns, patches) will be determined ! after the call to decompInit_glcp - so get_proc_bounds is called @@ -472,6 +475,9 @@ subroutine initialize2( ) call SatellitePhenologyInit(bounds_proc) end if + if(use_soil_moisture_streams) then + call PrescribedSoilMoistureInit(bounds_proc) + endif diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 7c3a747f6d..c89e3d12da 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -242,6 +242,12 @@ module clm_varctl integer, public :: CN_evergreen_phenology_opt = 0 integer, public :: carbon_resp_opt = 0 + !---------------------------------------------------------- + ! prescribed soil moisture streams switch + !---------------------------------------------------------- + + logical, public :: use_soil_moisture_streams = .false. ! true => use prescribed soil moisture stream + !---------------------------------------------------------- ! lai streams switch for Sat. Phenology !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 1d049def7b..06038ddd99 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -235,6 +235,8 @@ subroutine control_init( ) CNratio_floating, lnc_opt, reduce_dayl_factor, vcmax_opt, CN_residual_opt, & CN_partition_opt, CN_evergreen_phenology_opt, carbon_resp_opt + namelist /clm_inparm/ use_soil_moisture_streams + namelist /clm_inparm/ use_lai_streams namelist /clm_inparm/ use_bedrock @@ -663,6 +665,8 @@ subroutine control_spmd() call mpi_bcast (use_luna, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_soil_moisture_streams, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_lai_streams, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_bedrock, 1, MPI_LOGICAL, 0, mpicom, ier) diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90 index 709c0b5e36..c6b8e1764b 100644 --- a/src/main/decompInitMod.F90 +++ b/src/main/decompInitMod.F90 @@ -27,6 +27,7 @@ module decompInitMod ! ! !PUBLIC MEMBER FUNCTIONS: public decompInit_lnd ! initializes lnd grid decomposition into clumps and processors + public decompInit_lnd3D ! initializes lnd grid 3D decomposition public decompInit_clumps ! initializes atm grid decomposition into clumps public decompInit_glcp ! initializes g,l,c,p decomp info ! @@ -285,6 +286,7 @@ subroutine decompInit_lnd(lni,lnj,amask) ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points) call get_proc_bounds(beg, end) + allocate(gindex(beg:end)) do n = beg,end gindex(n) = ldecomp%gdc2glo(n) @@ -312,6 +314,63 @@ subroutine decompInit_lnd(lni,lnj,amask) end subroutine decompInit_lnd + !------------------------------------------------------------------------------ + subroutine decompInit_lnd3D(lni,lnj,lnk) + ! + ! !DESCRIPTION: + ! + ! Create a 3D decomposition gsmap for the global 2D grid with soil levels + ! as the 3rd dimesnion. + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + integer , intent(in) :: lni,lnj,lnk ! domain global size + ! + ! !LOCAL VARIABLES: + integer :: m,n,k ! indices + integer :: begg,endg,lsize,gsize ! used for gsmap init + integer :: begg3d,endg3d + integer, pointer :: gindex(:) ! global index for gsmap init + + + ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points) + call get_proc_bounds(begg, endg) + begg3d = (begg-1)*lnk + 1 + endg3d = endg*lnk + lsize = (endg3d - begg3d + 1 ) + allocate(gindex(begg3d:endg3d)) + do k = 1, lnk + do n = begg,endg + m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1) + gindex(m) = ldecomp%gdc2glo(n) + (k-1)*(lni*lnj) + enddo + enddo + gsize = lni * lnj * lnk + call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) + + ! Diagnostic output + + if (masterproc) then + write(iulog,*)' 3D GSMap' + write(iulog,*)' longitude points = ',lni + write(iulog,*)' latitude points = ',lnj + write(iulog,*)' soil levels = ',lnk + write(iulog,*)' gsize = ',gsize + write(iulog,*)' lsize = ',lsize + write(iulog,*)' bounds(gindex) = ',size(gindex) + write(iulog,*)' gsMap Characteristics' + write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd2Dsoi_gdc2glo) + write(iulog,*) + end if + + deallocate(gindex) + + call shr_sys_flush(iulog) + + end subroutine decompInit_lnd3D + !------------------------------------------------------------------------------ subroutine decompInit_clumps(lns,lni,lnj,glc_behavior) ! diff --git a/src/main/decompMod.F90 b/src/main/decompMod.F90 index 13204fabca..3f885e090b 100644 --- a/src/main/decompMod.F90 +++ b/src/main/decompMod.F90 @@ -118,12 +118,14 @@ module decompMod public decomp_type type(decomp_type),public,target :: ldecomp - type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_patch_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_cohort_gdc2glo + type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo ! GS map for full 2D land grid + type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo ! GS map for 1D gridcells + type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo ! GS map for 1D landunits + type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo ! GS map for 1d columns + type(mct_gsMap) ,public,target :: gsMap_patch_gdc2glo ! GS map for 1D patches + type(mct_gsMap) ,public,target :: gsMap_cohort_gdc2glo ! GS map for 1D cohorts (only for FATES) + + type(mct_gsMap) ,public,target :: gsMap_lnd2Dsoi_gdc2glo ! GS map for full 3D land grid with soil levels as 3rd dim !------------------------------------------------------------------------------ contains diff --git a/src/main/ndepStreamMod.F90 b/src/main/ndepStreamMod.F90 index e4acd648b8..79bd86234d 100644 --- a/src/main/ndepStreamMod.F90 +++ b/src/main/ndepStreamMod.F90 @@ -15,7 +15,7 @@ module ndepStreamMod use clm_varctl , only: iulog use abortutils , only: endrun use fileutils , only: getavu, relavu - use decompMod , only: bounds_type, ldecomp, gsmap_lnd_gdc2glo + use decompMod , only: bounds_type, ldecomp use domainMod , only: ldomain ! !PUBLIC TYPES: @@ -58,6 +58,7 @@ subroutine ndep_init(bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast + use decompMod , only : gsmap_lnd_gdc2glo ! ! arguments implicit none @@ -258,7 +259,7 @@ subroutine ndep_interp(bounds, atm2lnd_inst) end subroutine ndep_interp !============================================================================== - subroutine clm_domain_mct(bounds, dom_clm) + subroutine clm_domain_mct(bounds, dom_clm, nlevels) !------------------------------------------------------------------- ! Set domain data type for internal clm grid @@ -268,24 +269,37 @@ subroutine clm_domain_mct(bounds, dom_clm) use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr use mct_mod , only : mct_gGrid_importRAttr + use mct_mod , only : mct_gsMap + use decompMod , only : gsmap_lnd_gdc2glo, gsMap_lnd2Dsoi_gdc2glo implicit none ! ! arguments type(bounds_type), intent(in) :: bounds type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model + integer, intent(in), optional :: nlevels ! Number of levels if this is a 3D field ! ! local variables - integer :: g,i,j ! index + integer :: g,i,j,k ! index integer :: lsize ! land model domain data size real(r8), pointer :: data(:) ! temporary integer , pointer :: idata(:) ! temporary + integer :: nlevs ! Number of vertical levels + type(mct_gsMap), pointer :: gsmap => null() ! MCT GS map !------------------------------------------------------------------- + ! SEt number of levels, and get the GS map for either the 2D or 3D grid + nlevs = 1 + if ( present(nlevels) ) nlevs = nlevels + if ( nlevs == 1 ) then + gsmap => gsmap_lnd_gdc2glo + else + gsmap => gsMap_lnd2Dsoi_gdc2glo + end if ! ! Initialize mct domain type ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) ! Note that in addition land carries around landfrac for the purposes of domain checking ! - lsize = mct_gsMap_lsize(gsmap_lnd_gdc2glo, mpicom) + lsize = mct_gsMap_lsize(gsmap, mpicom) call mct_gGrid_init( GGrid=dom_clm, CoordChars=trim(seq_flds_dom_coord), & OtherChars=trim(seq_flds_dom_other), lsize=lsize ) ! @@ -295,7 +309,8 @@ subroutine clm_domain_mct(bounds, dom_clm) ! ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT ! - call mct_gsMap_orderedPoints(gsmap_lnd_gdc2glo, iam, idata) + call mct_gsMap_orderedPoints(gsmap, iam, idata) + gsmap => null() call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) ! ! Determine domain (numbering scheme is: West to East and South to North to South pole) @@ -314,34 +329,44 @@ subroutine clm_domain_mct(bounds, dom_clm) ! Fill in correct values for domain components ! Note aream will be filled in in the atm-lnd mapper ! + do k = 1, nlevs do g = bounds%begg,bounds%endg i = 1 + (g - bounds%begg) data(i) = ldomain%lonc(g) end do + end do call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) + do k = 1, nlevs do g = bounds%begg,bounds%endg i = 1 + (g - bounds%begg) data(i) = ldomain%latc(g) end do + end do call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) + do k = 1, nlevs do g = bounds%begg,bounds%endg i = 1 + (g - bounds%begg) data(i) = ldomain%area(g)/(re*re) end do + end do call mct_gGrid_importRattr(dom_clm,"area",data,lsize) + do k = 1, nlevs do g = bounds%begg,bounds%endg i = 1 + (g - bounds%begg) data(i) = real(ldomain%mask(g), r8) end do + end do call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) + do k = 1, nlevs do g = bounds%begg,bounds%endg i = 1 + (g - bounds%begg) data(i) = real(ldomain%frac(g), r8) end do + end do call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) deallocate(data) From 79cb366e38b45ae42f503369848adc2da91ad52e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2019 11:24:44 -0600 Subject: [PATCH 484/730] Apply the patch from 0f9009a1fa4f4a0757c5b90663a5250104f97432 that adds outnc_3dglc as optional fields with git apply --- tools/mksurfdata_map/mksurfdata.pl | 8 ++++ tools/mksurfdata_map/src/mkfileMod.F90 | 17 +++++++ tools/mksurfdata_map/src/mkglcmecMod.F90 | 61 +++++++++++++++++++++++- tools/mksurfdata_map/src/mksurfdat.F90 | 46 ++++++++++++++++-- tools/mksurfdata_map/src/mkvarctl.F90 | 3 +- 5 files changed, 130 insertions(+), 5 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 72cc9eb93d..341520bf64 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -52,6 +52,7 @@ my %opts = ( hgrid=>"all", vic=>0, + 3dglc=>0, ssp_rcp=>"hist", debug=>0, exedir=>undef, @@ -146,6 +147,7 @@ sub usage { -usrname "clm_usrdat_name" CLM user data name to find grid file with. -vic Add the fields required for the VIC model + -3dglc Add the optional 3D glacier fields for verification of the glacier model NOTE: years, res, and ssp_rcp can be comma delimited lists. @@ -363,6 +365,11 @@ sub write_namelist_file { map_fvic = '$map->{'vic'}' mksrf_fvic = '$datfil->{'vic'}' outnc_vic = .true. +EOF + } + if ( $opts{'3dglc'} ) { + print $fh <<"EOF"; + outnc_3dglc = .true. EOF } if ( ! $opts{'fast_maps'} ) { @@ -457,6 +464,7 @@ sub write_namelist_file { "pft_idx=s" => \$opts{'pft_idx'}, "ssp_rcp=s" => \$opts{'ssp_rcp'}, "vic!" => \$opts{'vic'}, + "3dglc!" => \$opts{'3dglc'}, "rundir=s" => \$opts{'rundir'}, "soil_col=i" => \$opts{'soil_col'}, "soil_fmx=f" => \$opts{'soil_fmx'}, diff --git a/tools/mksurfdata_map/src/mkfileMod.F90 b/tools/mksurfdata_map/src/mkfileMod.F90 index 3c5852796a..52e819623b 100644 --- a/tools/mksurfdata_map/src/mkfileMod.F90 +++ b/tools/mksurfdata_map/src/mkfileMod.F90 @@ -486,6 +486,23 @@ subroutine mkfile(domain, fname, harvdata, dynlanduse) lev1name='nglcec', & long_name='mean elevation on glacier elevation classes', units='m') + if ( outnc_3dglc ) then + call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_MEC_GIC', xtype=xtype, & + lev1name='nglcec', & + long_name='percent smaller glaciers and ice caps for each glacier elevation class (% of landunit)', units='unitless') + + call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_MEC_ICESHEET', xtype=xtype, & + lev1name='nglcec', & + long_name='percent ice sheet for each glacier elevation class (% of landunit)', units='unitless') + + call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_GIC', xtype=xtype, & + long_name='percent ice caps/glaciers (% of landunit)', units='unitless') + + call ncd_def_spatial_var(ncid=ncid, varname='PCT_GLC_ICESHEET', xtype=xtype, & + long_name='percent ice sheet (% of landunit)', units='unitless') + + end if + call ncd_def_spatial_var(ncid=ncid, varname='PCT_URBAN', xtype=xtype, & lev1name='numurbl', & long_name='percent urban for each density type', units='unitless') diff --git a/tools/mksurfdata_map/src/mkglcmecMod.F90 b/tools/mksurfdata_map/src/mkglcmecMod.F90 index 8ee41dd5ba..b750d34206 100644 --- a/tools/mksurfdata_map/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_map/src/mkglcmecMod.F90 @@ -125,7 +125,9 @@ end subroutine mkglcmecInit ! !INTERFACE: subroutine mkglcmec(ldomain, mapfname, & datfname_fglacier, ndiag, & - pctglcmec_o, topoglcmec_o ) + pctglcmec_o, topoglcmec_o, & + pctglcmec_gic_o, pctglcmec_icesheet_o, & + pctglc_gic_o, pctglc_icesheet_o) ! ! !DESCRIPTION: ! make percent glacier on multiple elevation classes, mean elevation for each @@ -158,6 +160,10 @@ subroutine mkglcmec(ldomain, mapfname, & integer , intent(in) :: ndiag ! unit number for diag out real(r8) , intent(out):: pctglcmec_o (:,:) ! % for each elevation class on output glacier grid (% of landunit) real(r8) , intent(out):: topoglcmec_o(:,:) ! mean elevation for each elevation classs on output glacier grid + real(r8), optional, intent(out):: pctglcmec_gic_o(:,:) ! % glc gic on output grid, by elevation class (% of landunit) + real(r8), optional, intent(out):: pctglcmec_icesheet_o(:,:) ! % glc ice sheet on output grid, by elevation class (% of landunit) + real(r8), optional, intent(out):: pctglc_gic_o(:) ! % glc gic on output grid, summed across elevation classes (% of landunit) + real(r8), optional, intent(out):: pctglc_icesheet_o(:) ! % glc ice sheet on output grid, summed across elevation classes (% of landunit) ! ! !CALLED FROM: ! subroutine mksrfdat in module mksrfdatMod @@ -203,6 +209,16 @@ subroutine mkglcmec(ldomain, mapfname, & pctglcmec_o(:,:) = 0. topoglcmec_o(:,:) = 0. + if ( outnc_3dglc )then + if ( (.not. present(pctglcmec_gic_o)) .or. (.not. present(pctglcmec_icesheet_o)) .or. & + (.not. present(pctglc_gic_o) .or. (.not. present(pctglc_icesheet_o) )then + call shr_sys_abort( subname//' ERROR: 3D glacier fields were NOT sent in and they are required' ) + end if + pctglcmec_gic_o(:,:) = 0. + pctglcmec_icesheet_o(:,:) = 0. + pctglc_gic_o(:) = 0. + pctglc_icesheet_o(:) = 0. + end if ! Set number of output points @@ -304,6 +320,10 @@ subroutine mkglcmec(ldomain, mapfname, & if (frac > 0) then pctglc_i = pctglc_gic_i(ni) + pctglc_icesheet_i(ni) pctglcmec_o(no,m) = pctglcmec_o(no,m) + wt*pctglc_i / frac + if ( outnc_3dglc )then + pctglcmec_gic_o(no,m) = pctglcmec_gic_o(no,m) + wt*pctglc_gic_i(ni) / frac + pctglcmec_icesheet_o(no,m) = pctglcmec_icesheet_o(no,m) + wt*pctglc_icesheet_i(ni) / frac + end if ! note that, by weighting the following by pctglc_i, we are getting something ! like the average topographic height over glaciated areas - NOT the average @@ -359,14 +379,27 @@ subroutine mkglcmec(ldomain, mapfname, & if (pctglc_tot_o(no) > 0._r8) then pctglcmec_o(no,:) = pctglcmec_o(no,:) / pctglc_tot_o(no) * 100._r8 + if ( outnc_3dglc )then + pctglcmec_gic_o(no,:) = pctglcmec_gic_o(no,:) / pctglc_tot_o(no) * 100._r8 + pctglcmec_icesheet_o(no,:) = pctglcmec_icesheet_o(no,:) / pctglc_tot_o(no) * 100._r8 + end if else ! Division of landunit is ambiguous. Apply the rule that all area is assigned to ! the lowest elevation class, and all GIC. pctglcmec_o(no,1) = 100._r8 + if ( outnc_3dglc )then + pctglcmec_gic_o(no,1) = 100._r8 + end if end if end do + ! Set pctglc_gic_o to sum of pctglcmec_gic_o across elevation classes, and similarly for pctglc_icesheet_o + if ( outnc_3dglc )then + pctglc_gic_o = sum(pctglcmec_gic_o, dim=2) + pctglc_icesheet_o = sum(pctglcmec_icesheet_o, dim=2) + end if + ! -------------------------------------------------------------------- ! Perform various sanity checks ! -------------------------------------------------------------------- @@ -382,6 +415,32 @@ subroutine mkglcmec(ldomain, mapfname, & end if end do + ! Confirm that GIC + ICESHEET = 100% + if ( outnc_3dglc )then + do no = 1,ns_o + if (abs((pctglc_gic_o(no) + pctglc_icesheet_o(no)) - 100._r8) > eps) then + write(6,*)'GIC + ICESHEET differs from 100% at no,pctglc_gic,pctglc_icesheet,lon,lat=', & + no,pctglc_gic_o(no),pctglc_icesheet_o(no),& + tgridmap%xc_dst(no),tgridmap%yc_dst(no) + errors = .true. + end if + end do + + ! Check that GIC + ICESHEET = total glacier at each elevation class + do m = 1, nglcec + do no = 1,ns_o + if (abs((pctglcmec_gic_o(no,m) + pctglcmec_icesheet_o(no,m)) - & + pctglcmec_o(no,m)) > eps) then + write(6,*)'GIC + ICESHEET differs from total GLC ' + write(6,*)'at no,m,pctglcmec,pctglcmec_gic,pctglcmec_icesheet = ' + write(6,*) no,m,pctglcmec_o(no,m),pctglcmec_gic_o(no,m),pctglcmec_icesheet_o(no,m) + errors = .true. + end if + end do + end do + end if + + ! Error check: are all elevations within elevation class range do no = 1,ns_o do m = 1,nglcec diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 85d8d72703..84e285d2b5 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -97,8 +97,12 @@ program mksurfdat real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier + real(r8), allocatable :: pctglc_gic(:) ! percent of grid cell that is gic (% of glc landunit) + real(r8), allocatable :: pctglc_icesheet(:) ! percent of grid cell that is ice sheet (% of glc landunit) real(r8), allocatable :: pctglcmec(:,:) ! glacier_mec pct coverage in each class (% of landunit) real(r8), allocatable :: topoglcmec(:,:) ! glacier_mec sfc elevation in each gridcell and class + real(r8), allocatable :: pctglcmec_gic(:,:) ! GIC pct coverage in each class (% of landunit) + real(r8), allocatable :: pctglcmec_icesheet(:,:) ! icesheet pct coverage in each class (% of landunit) real(r8), allocatable :: elevclass(:) ! glacier_mec elevation classes integer, allocatable :: glacier_region(:) ! glacier region ID real(r8), allocatable :: pctlak(:) ! percent of grid cell that is lake @@ -206,6 +210,7 @@ program mksurfdat outnc_double, & outnc_dims, & outnc_vic, & + outnc_3dglc, & fsurdat, & fdyndat, & fsurlog, & @@ -276,6 +281,7 @@ program mksurfdat ! outnc_double ------ If output should be in double precision ! outnc_large_files - If output should be in NetCDF large file format ! outnc_vic --------- Output fields needed for VIC + ! outnc_3dglc ------- Output 3D glacier fields (normally only needed for comparasion) ! nglcec ------------ If you want to change the number of Glacier elevation classes ! gitdescribe ------- Description of this version from git ! ====================================== @@ -303,6 +309,7 @@ program mksurfdat outnc_large_files = .false. outnc_double = .true. outnc_vic = .false. + outnc_3dglc = .false. all_urban = .false. no_inlandwet = .true. @@ -352,6 +359,9 @@ program mksurfdat if ( outnc_vic )then write(6,*)'Output VIC fields' end if + if ( outnc_3dglc )then + write(6,*)'Output optional 3D glacier fields (mostly used for verification of the glacier model)' + end if if ( all_urban )then write(6,*) 'Output ALL data in file as 100% urban' end if @@ -781,13 +791,28 @@ program mksurfdat allocate (pctglcmec(ns_o,nglcec), & topoglcmec(ns_o,nglcec) ) + if ( outnc_3dglc )then + allocate( & + pctglcmec_gic(ns_o,nglcec), & + pctglcmec_icesheet(ns_o,nglcec)) + allocate (pctglc_gic(ns_o)) + allocate (pctglc_icesheet(ns_o)) + end if pctglcmec(:,:) = spval topoglcmec(:,:) = spval - call mkglcmec (ldomain, mapfname=map_fglacier, & - datfname_fglacier=mksrf_fglacier, ndiag=ndiag, & - pctglcmec_o=pctglcmec, topoglcmec_o=topoglcmec ) + if ( outnc_3dglc )then + call mkglcmec (ldomain, mapfname=map_fglacier, & + datfname_fglacier=mksrf_fglacier, ndiag=ndiag, & + pctglcmec_o=pctglcmec, topoglcmec_o=topoglcmec, & + pctglcmec_gic_o=pctglcmec_gic, pctglcmec_icesheet_o=pctglcmec_icesheet, & + pctglc_gic_o=pctglc_gic, pctglc_icesheet_o=pctglc_icesheet) + else + call mkglcmec (ldomain, mapfname=map_fglacier, & + datfname_fglacier=mksrf_fglacier, ndiag=ndiag, & + pctglcmec_o=pctglcmec, topoglcmec_o=topoglcmec ) + end if ! Determine fractional land from pft dataset @@ -869,6 +894,20 @@ program mksurfdat call check_ret(nf_inq_varid(ncid, 'TOPO_GLC_MEC', varid), subname) call check_ret(nf_put_var_double(ncid, varid, topoglcmec), subname) + if ( outnc_3dglc )then + call check_ret(nf_inq_varid(ncid, 'PCT_GLC_MEC_GIC', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, pctglcmec_gic), subname) + + call check_ret(nf_inq_varid(ncid, 'PCT_GLC_MEC_ICESHEET', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, pctglcmec_icesheet), subname) + + call check_ret(nf_inq_varid(ncid, 'PCT_GLC_GIC', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, pctglc_gic), subname) + + call check_ret(nf_inq_varid(ncid, 'PCT_GLC_ICESHEET', varid), subname) + call check_ret(nf_put_var_double(ncid, varid, pctglc_icesheet), subname) + end if + call check_ret(nf_inq_varid(ncid, 'PCT_URBAN', varid), subname) call check_ret(nf_put_var_double(ncid, varid, urbn_classes_g), subname) @@ -1005,6 +1044,7 @@ program mksurfdat deallocate ( organic ) deallocate ( ef1_btr, ef1_fet, ef1_fdt, ef1_shr, ef1_grs, ef1_crp ) deallocate ( pctglcmec, topoglcmec) + if ( outnc_3dglc ) deallocate ( pctglc_gic, pctglc_icesheet) deallocate ( elevclass ) deallocate ( fmax ) deallocate ( pctsand, pctclay ) diff --git a/tools/mksurfdata_map/src/mkvarctl.F90 b/tools/mksurfdata_map/src/mkvarctl.F90 index 44585b7fc0..8c8172c22d 100644 --- a/tools/mksurfdata_map/src/mkvarctl.F90 +++ b/tools/mksurfdata_map/src/mkvarctl.F90 @@ -22,7 +22,8 @@ module mkvarctl logical, public :: outnc_double ! output ALL data in files as 64-bit integer, public :: outnc_dims = 2 ! only applicable to lat/lon grids logical, public :: outnc_1d ! true => output file is 1d - logical, public :: outnc_vic ! true => output file is 1d + logical, public :: outnc_vic ! true => output VIC fields + logical, public :: outnc_3dglc ! true => output 3D glacier fields character(len= 32), public :: mksrf_gridnm = ' ' ! name of grid to use on output file character(len=256), public :: mksrf_fgrid = ' ' ! land grid file name to use From 0b6f4bee32365f1b3497dc1a683dec3f5b8f4413 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2019 16:30:04 -0600 Subject: [PATCH 485/730] Get mksurfdata script and fortran program working --- tools/mksurfdata_map/mksurfdata.pl | 8 ++++---- tools/mksurfdata_map/src/mkglcmecMod.F90 | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 341520bf64..4cc838a532 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -52,7 +52,7 @@ my %opts = ( hgrid=>"all", vic=>0, - 3dglc=>0, + glc=>0, ssp_rcp=>"hist", debug=>0, exedir=>undef, @@ -147,7 +147,7 @@ sub usage { -usrname "clm_usrdat_name" CLM user data name to find grid file with. -vic Add the fields required for the VIC model - -3dglc Add the optional 3D glacier fields for verification of the glacier model + -glc Add the optional 3D glacier fields for verification of the glacier model NOTE: years, res, and ssp_rcp can be comma delimited lists. @@ -367,7 +367,7 @@ sub write_namelist_file { outnc_vic = .true. EOF } - if ( $opts{'3dglc'} ) { + if ( $opts{'glc'} ) { print $fh <<"EOF"; outnc_3dglc = .true. EOF @@ -464,7 +464,7 @@ sub write_namelist_file { "pft_idx=s" => \$opts{'pft_idx'}, "ssp_rcp=s" => \$opts{'ssp_rcp'}, "vic!" => \$opts{'vic'}, - "3dglc!" => \$opts{'3dglc'}, + "glc!" => \$opts{'glc'}, "rundir=s" => \$opts{'rundir'}, "soil_col=i" => \$opts{'soil_col'}, "soil_fmx=f" => \$opts{'soil_fmx'}, diff --git a/tools/mksurfdata_map/src/mkglcmecMod.F90 b/tools/mksurfdata_map/src/mkglcmecMod.F90 index b750d34206..6ff0754950 100644 --- a/tools/mksurfdata_map/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_map/src/mkglcmecMod.F90 @@ -146,11 +146,13 @@ subroutine mkglcmec(ldomain, mapfname, & ! variables in an arbitrary way. ! ! !USES: + use shr_sys_mod, only : shr_sys_abort use mkdomainMod, only : domain_type, domain_clean, domain_read use mkgridmapMod use mkvarpar use mkutilsMod, only : slightly_below, slightly_above use mkncdio + use mkvarctl , only : outnc_3dglc ! ! !ARGUMENTS: implicit none @@ -211,7 +213,7 @@ subroutine mkglcmec(ldomain, mapfname, & topoglcmec_o(:,:) = 0. if ( outnc_3dglc )then if ( (.not. present(pctglcmec_gic_o)) .or. (.not. present(pctglcmec_icesheet_o)) .or. & - (.not. present(pctglc_gic_o) .or. (.not. present(pctglc_icesheet_o) )then + (.not. present(pctglc_gic_o) ) .or. (.not. present(pctglc_icesheet_o) ) )then call shr_sys_abort( subname//' ERROR: 3D glacier fields were NOT sent in and they are required' ) end if pctglcmec_gic_o(:,:) = 0. From 8fdd6bee147b2816b80171097365a0b1d6cada85 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 29 Jul 2019 18:11:31 -0600 Subject: [PATCH 486/730] Update ChangeLog --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 163 +++++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index b61ceae1e4..7567b779e0 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.26 sacks 07/29/2019 Add a CN precision control call to fix problems related to small negative values release-clm5.0.25 erik 05/29/2019 Change two files from NetCDF-4 format to NetCDF-3 (because some machines have trouble with NetCDF-4 in pnetcdf) release-clm5.0.24 erik 05/22/2019 Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution release-clm5.0.23 erik 05/15/2019 Update cime to bring in CO2 transient files for the CMIP6 SSP's as well as presaero for three of them diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index fad475126f..48093e5361 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,167 @@ =============================================================== +Tag name: release-clm5.0.26 +Originator(s): sacks (Bill Sacks) +Date: Mon Jul 29 18:11:26 MDT 2019 +One-line Summary: Add a CN precision control call to fix problems related to small negative values + +Purpose of this version: +------------------------ + +Small negative values (roughly roundoff-level different from zero) in +frootc (and possibly other quantities) were occasionally creating +problems with carbon isotope fluxes and FPI in the first time step of +the year, at the time of transient landcover change. This tag fixes the +problem by introducing an extra call to SoilBiogeochemPrecisionControl +in between computing the patch-level transient landcover fluxes and +moving these to column-level. In particular, this truncates small +negative values of decomp_cpools_vr_col to zero, which prevents the +previous blow-ups. + +For most of the problematic fields, the explanation seems to be: frootc +can sometimes be negative; this is intentional. Negative frootc causes +negative dwt_frootc_to_litter if the patch in question is shrinking. The +resulting negative fluxes cause problems in the ciso calculation. This +can be worked around by inserting an extra precision control call +between the calculation of the dwt fluxes and the ciso fluxes, so that +small negative dwt fluxes are set to 0. + +This does not necessarily fully explain the issue with FPI, but the +insertion of the extra precision control call fixes that issue, too. + +For more details, see the discussion in +https://github.com/ESCOMP/ctsm/issues/741 + + +CTSM Master Tag This Corresponds To: N/A + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/ctsm#741 + +Science changes since: release-clm5.0.25 + None + +Software changes since: release-clm5.0.25 + Extra call to SoilBiogeochemPrecisionControl + +Changes to User Interface since: release-clm5.0.25 + None + +Testing: +-------- + + build-namelist tests: + + cheyenne - not run + + unit-tests (components/clm/src): + + cheyenne - not run + hobart --- not run + + tools-tests (components/clm/test/tools): + + cheyenne - not run + hobart --- not run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - not run + hobart --- not run + + regular tests (aux_clm): + + cheyenne_intel ---- ok + cheyenne_gnu ------ ok + hobart_nag -------- ok + hobart_pgi -------- ok + hobart_intel ------ ok + + ok means tests pass (other thana expected failures), answers change + as expected for some tests + + regular tests (prealpha): + + cheyenne_intel - not run + cheyenne_gnu --- not run + hobart_nag ----- not run + + regular tests (prebeta): + + cheyenne_intel - not run + cheyenne_gnu --- not run + hobart_nag ----- not run + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: YES + + If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section): + + Summarize any changes to answers, i.e., + - what code configurations: Transient cases and a few other + configurations as noted below + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Larger than roundoff / same climate + + According to Keith Oleson's analysis of the LMWG diagnostics: + Changes are possibly greater than roundoff-level, but are not + climate changing or scientifically meaningful. + + Other than transient cases (including cases with transient glacier + area as well as those with transient natural vegetation / crop + area), the test suite showed differences in the following cases: + + - Two present-day tests that specify changes in soil layer + structure + (ERI_D_Ld9.ne30_g16.I2000Clm50BgcCruGs.cheyenne_intel.clm-vrtlay + and + ERS_D_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_intel.clm-deepsoil_bedrock), + have changes in many fields (for the latter: mostly looks + roundoff-level, but a few greater than roundoff-level diffs) + + - The present-day ciso test, + ERP_D_Ld5.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_gnu.clm-ciso_flexCN_FUN, + has changes in a few c13 and c14 fields + + - There are changes in many fields in SSP tests + + - ERP_D_P36x2_Ld3.f10_f10_musgs.I2000Clm50BgcCruGs.cheyenne_intel.clm-noFUN_flexCN + (and a similar test on hobart) have roundoff-level changes in + SMINN_vr, SMIN_NH4_vr and SMIN_NO3_vr + + URL for LMWG diagnostics output for new climate: + http://webext.cgd.ucar.edu/I20TR/clm50_cesm20R_2deg_GSWP3V1_issue741_hist/lnd/clm50_cesm20R_2deg_GSWP3V1_issue741_hist.1995_2014-clm50_cesm20R_2deg_GSWP3V1_hist.1995_2014/setsIndex.html + + Will new REFCASES need to be made for cesm and/or CAM?: No + (This will likely be true if the LII tests failed) + +Detailed list of changes: +------------------------ + +Externals being used: No updates + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.02 + mosart: release-cesm2.0.03 + cime: cim5.6.16 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): None +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== Tag name: release-clm5.0.25 Originator(s): erik (Erik Kluzek) Date: Wed May 29 11:16:13 MDT 2019 From cc0b01b47294b359710a4c828193fb384bf45987 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 30 Jul 2019 14:21:45 -0700 Subject: [PATCH 487/730] fixes to transpiration boundary condition to FATES-HYDRO. --- src/biogeophys/CanopyFluxesMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 37 +++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 42e403b5ec..862a7248df 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -1266,7 +1266,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, call clm_fates%wrap_accumulatefluxes(nc,fn,filterp(1:fn)) - call clm_fates%wrap_hydraulics_drive(bounds,nc,soilstate_inst, & + call clm_fates%wrap_hydraulics_drive(bounds,nc,fn,filterp(1:fn),soilstate_inst, & waterstate_inst,waterflux_inst,solarabs_inst,energyflux_inst) else diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..2c9ae8b53d 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1419,6 +1419,13 @@ subroutine prep_canopyfluxes(this, nc, fn, filterp, photosyns_inst) do s = 1, this%fates(nc)%nsites ! filter flag == 1 means that this patch has not been called for photosynthesis this%fates(nc)%bc_in(s)%filter_photo_pa(:) = 1 + + ! set transpiration input boundary condition to zero. The exposed + ! vegetation filter may not even call every patch. + + this%fates(nc)%bc_in(s)%qflx_transp_pa(:) = 0._r8 + + end do end subroutine prep_canopyfluxes @@ -2343,6 +2350,7 @@ end subroutine ComputeRootSoilFlux ! ====================================================================================== subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & + fn, filterp, & soilstate_inst, waterstate_inst, waterflux_inst, & solarabs_inst, energyflux_inst) @@ -2351,6 +2359,8 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type),intent(in) :: bounds_clump integer,intent(in) :: nc + integer, intent(in) :: fn + integer, intent(in) :: filterp(fn) type(soilstate_type) , intent(inout) :: soilstate_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst @@ -2361,6 +2371,7 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & integer :: s integer :: c integer :: j + integer :: f ! loop index for the patch filter integer :: ifp integer :: p integer :: nlevsoil @@ -2397,12 +2408,28 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & soilstate_inst%eff_porosity_col(c,1:nlevsoil) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) - this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) - this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterflux_inst%qflx_tran_veg_patch(p) + p = ifp+col%patchi(c) + ! fsa_patch was filled on the nourban_pa filter, which should cover + ! all fates patches. + ! These are not currently used anyway (RGK 07/30/19) + this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) + this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) end do - end do + + end do + + + ! The exposed vegetation filter "filterp" dictates which patches + ! had their transpiration updated during canopy_fluxes(). Patches + ! not in the filter had been zero'd during prep_canopyfluxes(). + + do f = 1,fn + p = filterp(f) + c = patch%column(p) + s = this%f2hmap(nc)%hsites(c) + ifp = p - col%patchi(c) + this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterflux_inst%qflx_tran_veg_patch(p) + end do ! Call Fates Hydraulics ! ------------------------------------------------------------------------------------ From 4e50a445db9f40c7590b49cbc11f81025c30bc3a Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 1 Aug 2019 13:34:44 -0600 Subject: [PATCH 488/730] Updated FATES testmods_dirs to reflect changes in history variables. --- cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm | 8 +++++--- .../testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm | 4 +++- .../testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm | 2 +- .../testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 3f6a4dbc56..c40769a62e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -3,9 +3,11 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_spitfire= .true. -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', +hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN_ELEM','LITTER_OUT_ELEM', 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', + 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN', + 'LITTER_FINES_AG_ELEM','LITTER_FINES_BG_ELEM','LITTER_CWD_AG_ELEM','LITTER_CWD_BG_ELEM', + 'SEED_BANK' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index 66c94f3cc2..9b9243cee5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -27,4 +27,6 @@ hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE',' 'NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', 'NPP_BDEAD_UNDERSTORY_SCLS','NPP_BSEED_UNDERSTORY_SCLS','NPP_STORE_UNDERSTORY_SCLS','RDARK_UNDERSTORY_SCLS', 'LIVESTEM_MR_UNDERSTORY_SCLS','LIVECROOT_MR_UNDERSTORY_SCLS','FROOT_MR_UNDERSTORY_SCLS','RESP_G_UNDERSTORY_SCLS', - 'RESP_M_UNDERSTORY_SCLS' + 'RESP_M_UNDERSTORY_SCLS','LITTER_IN_ELEM','LITTER_OUT_ELEM','SEED_BANK_ELEM','SEEDS_IN_LOCAL_ELEM','SEEDS_IN_EXTERN_ELEM', + 'SEED_GERM_ELEM','SEED_DECAY','CBALANCE_ERROR_FATES','ERROR_FATES','LITTER_FINES_AG_ELEM','LITTER_FINES_BG_ELEM','LITTER_CWD_BG_ELEM', + 'LITTER_CWD_AG_ELEM','LITTER_CWD' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm index bae4c2cb9e..97cafd9d42 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm @@ -6,5 +6,5 @@ hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT' 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm index f9d31eecbb..fc057c0be3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm @@ -2,4 +2,4 @@ hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT' 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC' + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR' From b9ecba980ca17d4733af58474b9632280f029122 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 1 Aug 2019 16:21:21 -0600 Subject: [PATCH 489/730] Point to new subdirectory for high resolution PFT,soil-col,LAI rawdata files to fix #757 --- bld/namelist_files/namelist_defaults_clm4_5_tools.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml index 1606698182..a1598f3bf1 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml @@ -215,7 +215,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_lai_histclm52deg005_earthstatmirca_2005.c190119.nc lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.c190116.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_1850.c190119.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_landuse_clm52deg005_histLUH2_1850.c190119.nc lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190119/mksrf_landuse_clm52deg005_histLUH2_2005.c190119.nc +>lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_landuse_clm52deg005_histLUH2_2005.c190119.nc From 1b19b3c427b35b67cb626d264d7b6e5f654c645e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 1 Aug 2019 22:39:07 -0600 Subject: [PATCH 490/730] Update rtm --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index ec8450c084..61da74039b 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -16,7 +16,7 @@ required = True local_path = components/rtm protocol = git repo_url = https://github.com/ESCOMP/rtm -tag = release-cesm2.0.02 +tag = release-cesm2.0.03 required = True [mosart] From efe14626f7894d177ec83a3c16d8b8353929474c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 8 Aug 2019 16:46:18 -0600 Subject: [PATCH 491/730] Finally add in new SoilMoistureStreamMod.F90 file, was neglected to be added in previous commits --- src/biogeophys/SoilMoistureStreamMod.F90 | 305 +++++++++++++++++++++++ 1 file changed, 305 insertions(+) create mode 100644 src/biogeophys/SoilMoistureStreamMod.F90 diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 new file mode 100644 index 0000000000..9146ee0114 --- /dev/null +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -0,0 +1,305 @@ +module SoilMoistureStreamMod + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Read in soil moisture from data stream + ! + ! !USES: + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create + use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_kind_mod , only : CL => shr_kind_CL + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type + use abortutils , only : endrun + use clm_varctl , only : scmlat,scmlon,single_column + use clm_varctl , only : iulog, use_soil_moisture_streams + use clm_varcon , only : grlnd + use controlMod , only : NLFilename + use decompMod , only : gsMap_lnd2Dsoi_gdc2glo + use domainMod , only : ldomain + use fileutils , only : getavu, relavu + use LandunitType , only : lun + use ColumnType , only : col + use SoilStateType , only : soilstate_type + use WaterStateType , only : waterstate_type + use perf_mod , only : t_startf, t_stopf + use spmdMod , only : masterproc + use spmdMod , only : mpicom, comp_id + use mct_mod + use ncdio_pio + ! + ! !PUBLIC TYPES: + implicit none + private + ! + ! !PUBLIC MEMBER FUNCTIONS: + public :: PrescribedSoilMoistureInit ! position datasets for soil moisture + public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data + + ! !PRIVATE MEMBER DATA: + type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream + ! + ! !PRIVATE TYPES: + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + !----------------------------------------------------------------------- + +contains + + !----------------------------------------------------------------------- + ! + ! soil_moisture_init + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInit(bounds) + ! + ! Initialize data stream information for soil moisture. + ! + ! + ! !USES: + use clm_varctl , only : inst_name + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use histFileMod , only : hist_addfld1d + use shr_stream_mod , only : shr_stream_file_null + use shr_string_mod , only : shr_string_listCreateField + use clm_varpar , only : nlevsoi + ! + ! !ARGUMENTS: + implicit none + type(bounds_type), intent(in) :: bounds ! bounds + ! + ! !LOCAL VARIABLES: + integer :: i ! index + integer :: stream_year_first_soilm ! first year in Ustar stream to use + integer :: stream_year_last_soilm ! last year in Ustar stream to use + integer :: model_year_align_soilm ! align stream_year_first_soilm with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read + character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm + + character(*), parameter :: subName = "('soil_moisture_init')" + character(*), parameter :: F00 = "('(soil_moisture_init) ',4a)" + character(*), parameter :: soilmString = "H2OSOI" ! base string for field string + character(SHR_KIND_CXX) :: fldList ! field string + !----------------------------------------------------------------------- + ! + ! deal with namelist variables here in init + ! + namelist /soil_moisture_streams/ & + stream_year_first_soilm, & + stream_year_last_soilm, & + model_year_align_soilm, & + soilm_tintalgo, & + stream_fldfilename_soilm + + ! Default values for namelist + stream_year_first_soilm = 1 ! first year in stream to use + stream_year_last_soilm = 1 ! last year in stream to use + model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year + stream_fldfilename_soilm = shr_stream_file_null + + ! Read soilm_streams namelist + if (masterproc) then + nu_nml = getavu() + open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(subname // ':: ERROR reading soil_moisture_streams namelist') + end if + else + call endrun(subname // ':: ERROR finding soilm_streams namelist') + end if + close(nu_nml) + call relavu( nu_nml ) + endif + + call shr_mpi_bcast(stream_year_first_soilm, mpicom) + call shr_mpi_bcast(stream_year_last_soilm, mpicom) + call shr_mpi_bcast(model_year_align_soilm, mpicom) + call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) + call shr_mpi_bcast(soilm_tintalgo, mpicom) + + if (masterproc) then + + write(iulog,*) ' ' + write(iulog,*) 'soil_moisture_stream settings:' + write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm + write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm + write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm + write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) + write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) + + endif + + call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi) + + ! + ! create the field list for these fields...use in shr_strdata_create + ! + fldList = trim(soilmString) + + if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) + + call shr_strdata_create(sdat_soilm,name="soil_moisture", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsMap_lnd2Dsoi_gdc2glo, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + nzg=nlevsoi, & + yearFirst=stream_year_first_soilm, & + yearLast=stream_year_last_soilm, & + yearAlign=model_year_align_soilm, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_soilm), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domZvarName='levsoi' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/stream_fldFileName_soilm/), & + fldListFile=fldList, & + fldListModel=fldList, & + fillalgo='none', & + mapalgo='none', & + tintalgo=soilm_tintalgo, & + calendar=get_calendar(), & + dtlimit = 15._r8, & + taxmode='cycle' ) + + if (masterproc) then + call shr_strdata_print(sdat_soilm,'soil moisture data') + endif + + end subroutine PrescribedSoilMoistureInit + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureInterp + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & + waterstate_inst) + ! + ! Assign data stream information for prescribed soil moisture. + ! + ! !USES: + use clm_time_manager, only : get_curr_date + use clm_varpar , only : nlevsoi + use clm_varcon , only : denh2o, denice, watmin + use landunit_varcon , only : istsoil + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterstate_type) , intent(inout) :: waterstate_inst + ! + ! !LOCAL VARIABLES: + integer :: c, g, j, ism, ig, n + integer :: year ! year (0, ...) for nstep+1 + integer :: mon ! month (1, ..., 12) for nstep+1 + integer :: day ! day of month (1, ..., 31) for nstep+1 + integer :: sec ! seconds into current date for nstep+1 + integer :: mcdate ! Current model date (yyyymmdd) + integer :: ier ! error code + integer, allocatable :: g_to_ig(:) + real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture + real(r8) :: soilm_ice_frac ! ice fraction of soil moisture + real(r8) :: moisture_increment ! soil moisture adjustment increment + real(r8) :: h2osoi_vol_initial ! initial vwc value + character(len=CL) :: stream_var_name + + !----------------------------------------------------------------------- + + associate( & + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) + h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) + h2osoi_vol => waterstate_inst%h2osoi_vol_col & ! Output: volumetric soil water (m3/m3) + ) + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + stream_var_name = 'H2OSOI' + + ! Determine variable index + ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) + + call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) + + ! Map gridcell to AV index + ier = 0 + allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) + if (ier /= 0) then + write(iulog,*) 'Prescribed soil moisture allocation error' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + + ! Read data from stream into column level variable + + do c = bounds%begc, bounds%endc + if(lun%itype(col%landunit(c)) == istsoil) then + ! + ! Set variable for each gridcell/column combination + ! + ig = g_to_ig(col%gridcell(c)) + + ! this is a 2d field (gridcell/nlevsoi) ! + do j = 1, nlevsoi + + n = ig + (j-1)*(bounds%endg-bounds%begg+1) + + ! if soil water is zero, liq/ice fractions cannot be calculated + if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then + + ! save original soil moisture value + h2osoi_vol_initial = h2osoi_vol(c,j) + + ! update volumetric soil moisture + h2osoi_vol(c,j) = sdat_soilm%avs(1)%rAttr(ism,n) + + ! calculate liq/ice mass fractions + soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + soilm_ice_frac = h2osoi_ice(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + + ! calculate moisture increment + moisture_increment = h2osoi_vol(c,j) - h2osoi_vol_initial + ! add limitation check + moisture_increment = min((watsat(c,j) - h2osoi_vol_initial),max(-(h2osoi_vol_initial-watmin),moisture_increment)) + + ! update liq/ice water mass due to (volumetric) moisture increment + h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) + h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) + + endif + enddo + endif + end do + + end associate + + end subroutine PrescribedSoilMoistureInterp + +end module SoilMoistureStreamMod From 7ab770ec71483ee3114920d68a6907edea4442ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 12 Aug 2019 13:27:17 -0600 Subject: [PATCH 492/730] Remove test from expected fails thats now working --- cime_config/testdefs/ExpectedTestFails.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 39ebe743ed..24f2a42afc 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -4,7 +4,6 @@ FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_gnu.clm-monthly RUN FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_intel.clm-monthly RUN - FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN From 1c23c32a67b6180cab6880a1bdfde8ce32a30914 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Aug 2019 10:21:20 -0600 Subject: [PATCH 493/730] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 105 +++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 7567b779e0..9b8b1db285 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.27 erik 08/13/2019 Add presoribed soil moisture streams as an option, and a few fixes release-clm5.0.26 sacks 07/29/2019 Add a CN precision control call to fix problems related to small negative values release-clm5.0.25 erik 05/29/2019 Change two files from NetCDF-4 format to NetCDF-3 (because some machines have trouble with NetCDF-4 in pnetcdf) release-clm5.0.24 erik 05/22/2019 Correct ndep end year for SSPs, 2-degree CMIP6WACCMDECK with C-isotopes off, fixes mksurfdata for high resolution diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 48093e5361..484911681d 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,109 @@ =============================================================== +Tag name: release-clm5.0.27 +Originator(s): erik (Erik Kluzek) +Date: Tue Aug 13 10:21:07 MDT 2019 +One-line Summary: Add presoribed soil moisture streams as an option, and a few fixes + +Purpose of this version: +------------------------ + +Add new prescribed moisture streams feature from Sean Swenson. This allows the user +to specify a steams file for soil moisture and use it in place of the model prognostically +determining soil moisture. To turn it on set use_soil_moisture_streams=T. You can also +set the filename to use with stream_fldfilename_soilm, and there are other _soilm namelist +items to control the years to run over. The file MUST be on the same grid as the model resolution. + +Update 0.125x0.125 mapping and surfdata data, and fix hirespft data issues. Update cime +with SSP1-2.6 presaero data. So now can run the SSP1-2.6 CMIP6 future scenario. +Update rtm release branch to rtm1_0_69, which brings in a fix for cold starts. + +Move mksurfdata changes from ctsm1.0.dev053 over, which fixes a rare soil color bug. + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #757 #629 #343 #276 + Fixes #757 -- Softlinks in inputdata repo saved as a link rather than a datafile + Fixes #629 -- Remove unused fields on surface datasets (add option for glc fields) + Fixes #343 -- Move config_archive to ctsm + Fixes #276 -- Add some CLM tests for CESM to run + +CIME Issues fixed (include issue #): #3163 #3170 + #3170 -- fixes creation of empty file from inputdata download + #3163 -- JOB_WALLCLOCK error + +Science changes since: release-clm5.0.26 + Add SSP1-2.6 prescribed aerosol + Fix soil color bug in mksurfdata_map + +Software changes since: release-clm5.0.26 + Add ability to run with prescribed soil moisture streams + +Changes to User Interface since: release-clm5.0.26 + New soil_moisture_streams namelist + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - OK + hobart --- OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + hobart --- OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_pgi -------- OK + hobart_intel ------ OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: No bit-for-bit + +Detailed list of changes: +------------------------ + +Externals being used: Update cime and rtm + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.03 + mosart: release-cesm2.0.03 + cime: cim5.6.20 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: ctsm1.0.dev053 + +Pull Requests that document the changes (include PR ids): #781 +(https://github.com/ESCOMP/ctsm/pull) + + #781 -- Prescribed soil moisture on release branch and some other updates and fixes + +=============================================================== +=============================================================== Tag name: release-clm5.0.26 Originator(s): sacks (Bill Sacks) Date: Mon Jul 29 18:11:26 MDT 2019 From 87020c31c1615259ba1c5a174384c011c1476756 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Aug 2019 12:09:36 -0600 Subject: [PATCH 494/730] Add more tests to prealpha,prebeta, and aux_cime_baselines for #276 --- cime_config/testdefs/testlist_clm.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f6daa6a183..5e46a6cadf 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -11,6 +11,7 @@ + @@ -128,6 +129,7 @@ + @@ -294,6 +296,7 @@ + @@ -335,6 +338,7 @@ + @@ -472,6 +476,7 @@ + @@ -523,6 +528,7 @@ + @@ -1111,6 +1117,7 @@ + @@ -1153,6 +1160,7 @@ + @@ -1173,6 +1181,7 @@ + @@ -1181,6 +1190,7 @@ + @@ -1331,6 +1341,7 @@ + @@ -1384,6 +1395,7 @@ + @@ -1402,6 +1414,7 @@ + @@ -1570,6 +1583,7 @@ + @@ -1579,6 +1593,7 @@ + @@ -1701,6 +1716,7 @@ + @@ -2046,6 +2062,7 @@ + @@ -2055,6 +2072,7 @@ + From f2f00cfb98ff3e1f05ecd5ec190eaaf36aa74204 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Aug 2019 14:20:52 -0600 Subject: [PATCH 495/730] Move around prealpha/prebeta tests so they are paired with aux_clm, or in a few cases add aux_clm to a prealpha/prebeta test, make sure aux_cime_baseline tests have a close match to a prealpha test --- cime_config/testdefs/testlist_clm.xml | 85 ++++++++------------------- 1 file changed, 23 insertions(+), 62 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5e46a6cadf..c34328ce70 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -19,6 +19,7 @@ + @@ -87,6 +88,7 @@ + @@ -116,16 +118,6 @@ - - - - - - - - - - @@ -135,16 +127,6 @@ - - - - - - - - - - @@ -194,14 +176,6 @@ - - - - - - - - @@ -220,14 +194,6 @@ - - - - - - - - @@ -236,14 +202,6 @@ - - - - - - - - @@ -486,6 +444,7 @@ + @@ -527,9 +486,9 @@ + - @@ -629,6 +588,7 @@ + @@ -653,7 +613,6 @@ - @@ -673,7 +632,6 @@ - @@ -709,6 +667,7 @@ + @@ -735,6 +694,15 @@ + + + + + + + + + @@ -857,6 +825,9 @@ + + + @@ -956,13 +927,6 @@ - - - - - - - @@ -1124,17 +1088,10 @@ - - - - - - - - + @@ -1143,6 +1100,7 @@ + @@ -1150,6 +1108,7 @@ + @@ -1299,6 +1258,7 @@ + @@ -1506,6 +1466,7 @@ + From dcebbf453de2da1a9d3b1428fe6775c59bd33925 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Aug 2019 14:32:03 -0600 Subject: [PATCH 496/730] Update change files --- doc/release-clm5.0.ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 484911681d..f5ad3ca456 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.27 Originator(s): erik (Erik Kluzek) -Date: Tue Aug 13 10:21:07 MDT 2019 +Date: Tue Aug 13 14:31:50 MDT 2019 One-line Summary: Add presoribed soil moisture streams as an option, and a few fixes Purpose of this version: From 90c01807431a4a71edde29e5968888f29bfa38a8 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 20 Aug 2019 11:29:46 -0700 Subject: [PATCH 497/730] created new procedure to condense setting FATES time --- src/utils/clmfates_interfaceMod.F90 | 113 ++++++++++++++++++---------- 1 file changed, 75 insertions(+), 38 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..925c9b30f5 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -197,6 +197,11 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds + ! ThGetAndSetFatesTimeis function is used to get the current time from the CIME + ! time procedures and then set to the fates global time variables during restart, + ! init_coldstart, and dynamics_driv function calls + private :: GetAndSetTime + logical :: debug = .false. character(len=*), parameter, private :: sourcefile = & @@ -513,11 +518,11 @@ subroutine init(this, bounds_proc ) call FatesReportParameters(masterproc) end subroutine init - - ! =================================================================================== - - subroutine check_hlm_active(this, nc, bounds_clump) - +init +init================================= +init +init +init ! --------------------------------------------------------------------------------- ! This subroutine is not currently used. It is just a utility that may come ! in handy when we have dynamic sites in FATES @@ -579,22 +584,9 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: c ! column index (HLM) integer :: ifp ! patch index integer :: p ! HLM patch index - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day integer :: nlevsoil ! number of soil layers at the site integer :: nld_si ! site specific number of decomposition layers - integer :: current_year - integer :: current_month - integer :: current_day - integer :: current_tod - integer :: current_date - integer :: jan01_curr_year - integer :: reference_date - integer :: days_per_year - real(r8) :: model_day - real(r8) :: day_of_year + !----------------------------------------------------------------------- ! --------------------------------------------------------------------------------- @@ -606,24 +598,8 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! and it keeps all the boundaries in one location ! --------------------------------------------------------------------------------- - days_per_year = get_days_per_year() - call get_curr_date(current_year,current_month,current_day,current_tod) - current_date = current_year*10000 + current_month*100 + current_day - jan01_curr_year = current_year*10000 + 100 + 1 - - call get_ref_date(yr, mon, day, sec) - reference_date = yr*10000 + mon*100 + day - - call timemgr_datediff(reference_date, sec, current_date, current_tod, model_day) - - call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) - - call SetFatesTime(current_year, current_month, & - current_day, current_tod, & - current_date, reference_date, & - model_day, floor(day_of_year), & - days_per_year, 1.0_r8/dble(days_per_year)) - + ! Set the FATES global time and date variables + call GetAndSetTime do s=1,this%fates(nc)%nsites @@ -1173,7 +1149,8 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%sites, & this%fates(nc)%bc_out) - + ! Set the FATES global time and date variables + !call GetAndSetTime ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics @@ -1289,6 +1266,9 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & waterstate_inst,canopystate_inst,frictionvel_inst) + ! Set the FATES global time and date variables + !call GetAndSetTime + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ @@ -2505,4 +2485,61 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) end subroutine hlm_bounds_to_fates_bounds + ! ====================================================================================== + + subroutine GetAndSetTime() + + ! CLM MODULES + use clm_time_manager , only : get_days_per_year, & + get_curr_date, & + get_ref_date, & + timemgr_datediff, & + + ! FATES MODULES + use FatesInterfaceMod , only : SetFatesTime + + ! LOCAL VARIABLES + integer :: yr ! year (0, ...) + integer :: mon ! month (1, ..., 12) + integer :: day ! day of month (1, ..., 31) + integer :: sec ! seconds of the day + integer :: current_year + integer :: current_month + integer :: current_day + integer :: current_tod + integer :: current_date + integer :: jan01_curr_year + integer :: reference_date + integer :: days_per_year + real(r8) :: model_day + real(r8) :: day_of_year + + + ! Get the current date and determine the set the start of the current year + call get_curr_date(current_year,current_month,current_day,current_tod) + current_date = current_year*10000 + current_month*100 + current_day + jan01_curr_year = current_year*10000 + 100 + 1 + + ! Get the reference date components and compute the date + call get_ref_date(yr, mon, day, sec) + reference_date = yr*10000 + mon*100 + day + + ! Get the defined number of days per year + days_per_year = get_days_per_year() + + ! Determine the model day + call timemgr_datediff(reference_date, sec, current_date, current_tod, model_day) + + ! Determine the current DOY + call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) + + ! Set the FATES global time variables + call SetFatesTime(current_year, current_month, & + current_day, current_tod, & + current_date, reference_date, & + model_day, floor(day_of_year), & + days_per_year, 1.0_r8/dble(days_per_year)) + + end subroutine GetAndSetTime + end module CLMFatesInterfaceMod From c7a45bdfc85996366539e6aefcd498f78affec10 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 20 Aug 2019 13:31:55 -0600 Subject: [PATCH 498/730] Add prescribed test directory that got left off in the last tag --- cime_config/testdefs/testmods_dirs/clm/prescribed/README | 7 +++++++ .../testmods_dirs/clm/prescribed/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/prescribed/user_nl_clm | 2 ++ 3 files changed, 10 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/prescribed/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/README b/cime_config/testdefs/testmods_dirs/clm/prescribed/README new file mode 100644 index 0000000000..4c0c56bb8c --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/README @@ -0,0 +1,7 @@ +This test-mods turns on using the prescribed moisture streams file +(rather than prognosing it in the model). And it turns on the lai streams +to test that's working as well. + +The only resolution we currently have data for is f09, so this must be done +at 0.9x1.25 resolution. And it makes the most sense for present day and +Satellite Phenology (Sp). diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm new file mode 100644 index 0000000000..2e3ab9129b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm @@ -0,0 +1,2 @@ + use_soil_moisture_streams = .true. + use_lai_streams = .true. From 31ce51c67e8058acc1e0cefa6aacdfd08c4a6f29 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 20 Aug 2019 12:38:42 -0700 Subject: [PATCH 499/730] fixing accidental deletion --- src/utils/clmfates_interfaceMod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 925c9b30f5..5f542e5cb7 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -518,11 +518,11 @@ subroutine init(this, bounds_proc ) call FatesReportParameters(masterproc) end subroutine init -init -init================================= -init -init -init + + ! =================================================================================== + + subroutine check_hlm_active(this, nc, bounds_clump) + ! --------------------------------------------------------------------------------- ! This subroutine is not currently used. It is just a utility that may come ! in handy when we have dynamic sites in FATES From d8003c32262086441927faf7b2e24d62bad316fe Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 20 Aug 2019 13:20:15 -0700 Subject: [PATCH 500/730] Correcting small error --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 5f542e5cb7..7f1be3fa27 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -2493,7 +2493,7 @@ subroutine GetAndSetTime() use clm_time_manager , only : get_days_per_year, & get_curr_date, & get_ref_date, & - timemgr_datediff, & + timemgr_datediff ! FATES MODULES use FatesInterfaceMod , only : SetFatesTime From 320a80dc9858d79a9f89d3ea580faf6261a08229 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 26 Aug 2019 12:36:48 -0600 Subject: [PATCH 501/730] fates_next_api: udpated tag to fates api 8.0.0 --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index b440c99ea3..9e1fae0333 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.27.1_api.7.3.0 +tag = sci.1.30.0_api.8.0.0 required = True [PTCLM] From cd30b77bc5f322df903d1ac60a0427ec7fafee10 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 27 Aug 2019 14:25:49 -0700 Subject: [PATCH 502/730] adding in GetAndSet procedure call --- src/utils/clmfates_interfaceMod.F90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 7f1be3fa27..f2d5d557cd 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -197,7 +197,7 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - ! ThGetAndSetFatesTimeis function is used to get the current time from the CIME + ! The GetAndSetFatesTimeis function is used to get the current time from the CIME ! time procedures and then set to the fates global time variables during restart, ! init_coldstart, and dynamics_driv function calls private :: GetAndSetTime @@ -1149,9 +1149,6 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%sites, & this%fates(nc)%bc_out) - ! Set the FATES global time and date variables - !call GetAndSetTime - ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ @@ -1193,6 +1190,10 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins integer :: s integer :: c + + ! Set the FATES global time and date variables + call GetAndSetTime + nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) From c40e1efdc7478be64628f18498d7798214c6c278 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 13 Sep 2019 16:30:30 -0600 Subject: [PATCH 503/730] Update to latest cime5.6 version --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 61da74039b..f6bb44e321 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.20 +tag = cime5.6.23 required = True [externals_description] From ed821fa82a16e034b875557fc84f8034863c8860 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 00:05:57 -0600 Subject: [PATCH 504/730] Add mkpftMod.F90 to the list of subroutines to compile, which also requires other subroutines to the list as well as some additional functons to mkncdio.F90 --- tools/mksurfdata_map/src/CMakeLists.txt | 12 ++++- .../src/unit_test_stubs/mkncdio.F90 | 51 +++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/tools/mksurfdata_map/src/CMakeLists.txt b/tools/mksurfdata_map/src/CMakeLists.txt index 0cf2ca90b0..4aa1b82211 100644 --- a/tools/mksurfdata_map/src/CMakeLists.txt +++ b/tools/mksurfdata_map/src/CMakeLists.txt @@ -11,16 +11,26 @@ include(CIME_utils) # Build library containing stuff needed for the unit tests list(APPEND mksurfdat_sources shr_kind_mod.F90 + shr_log_mod.F90 + nanMod.F90 + shr_string_mod.F90 + fileutils.F90 + shr_timer_mod.F90 + shr_file_mod.F90 mkgridmapMod.F90 mkindexmapMod.F90 mkpftConstantsMod.F90 mkpctPftTypeMod.F90 + mkpftMod.F90 + mkdomainMod.F90 + mkgridmapMod.F90 mkutilsMod.F90 mkpftUtilsMod.F90 mksoilUtilsMod.F90 mkvarctl.F90 mkvarpar.F90 shr_const_mod.F90 + shr_sys_mod.F90 unit_test_stubs/mkncdio.F90) add_library(mksurfdat ${mksurfdat_sources}) @@ -29,4 +39,4 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR}) # Add the test directory -add_subdirectory(test) \ No newline at end of file +add_subdirectory(test) diff --git a/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 b/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 index f8768b7b08..33a6012adc 100644 --- a/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 +++ b/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 @@ -20,10 +20,17 @@ module mkncdio public :: nf_get_var_int public :: nf_get_vara_double public :: nf_get_att_double + public :: ncd_defvar + public :: ncd_def_spatial_var public :: check_ret public :: convert_latlon + interface nf_get_var_double + module procedure nf_get_var_double_1d + module procedure nf_get_var_double_2d + end interface nf_get_var_double + interface nf_get_vara_double module procedure nf_get_vara_double_2d end interface nf_get_vara_double @@ -33,6 +40,34 @@ module mkncdio integer, parameter, public :: nf_max_name = 64 contains + +!----------------------------------------------------------------------- + subroutine ncd_defvar(ncid, varname, xtype, & + dim1name, dim2name, & + long_name, units ) +! + implicit none + integer , intent(in) :: ncid ! input unit + character(len=*), intent(in) :: varname ! variable name + integer , intent(in) :: xtype ! external type + character(len=*), intent(in), optional :: dim1name ! dimension name + character(len=*), intent(in), optional :: dim2name ! dimension name + character(len=*), intent(in), optional :: long_name ! attribute + character(len=*), intent(in), optional :: units ! attribute +! + end subroutine ncd_defvar + + !----------------------------------------------------------------------- + subroutine ncd_def_spatial_var(ncid, varname, xtype, long_name, units, lev1name, lev2name) + integer , intent(in) :: ncid ! input unit + character(len=*) , intent(in) :: varname ! variable name + integer , intent(in) :: xtype ! external type + character(len=*) , intent(in) :: long_name ! attribute + character(len=*) , intent(in) :: units ! attribute + character(len=*) , optional, intent(in) :: lev1name ! name of first level (or time) dimension + character(len=*) , optional, intent(in) :: lev2name ! name of second level (or time) dimension + end subroutine ncd_def_spatial_var + integer function nf_open(filename, mode, ncid) character(len=*), intent(in) :: filename integer, intent(in) :: mode @@ -109,14 +144,23 @@ integer function nf_inq_vardimid(ncid, varid, dimids) nf_inq_vardimid = 0 end function nf_inq_vardimid - integer function nf_get_var_double(ncid, vid, data) + integer function nf_get_var_double_1d(ncid, vid, data) integer, intent(in) :: ncid integer, intent(in) :: vid real(r8), intent(out) :: data(:) data(:) = 0._r8 - nf_get_var_double = 0 - end function nf_get_var_double + nf_get_var_double_1d = 0 + end function nf_get_var_double_1d + + integer function nf_get_var_double_2d(ncid, vid, data) + integer, intent(in) :: ncid + integer, intent(in) :: vid + real(r8), intent(out) :: data(:,:) + + data(:,:) = 0._r8 + nf_get_var_double_2d = 0 + end function nf_get_var_double_2d integer function nf_get_var_int(ncid, vid, data) integer, intent(in) :: ncid @@ -145,6 +189,7 @@ integer function nf_get_att_double(ncid, varid, attname, attval) real(r8), intent(out) :: attval attval = 0._r8 + nf_get_att_double = 0 end function nf_get_att_double subroutine check_ret(ret, calling, varexists) From 3c04ffa6c8fe1f9bb41f2adee7066718faa5f5d4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 00:40:00 -0600 Subject: [PATCH 505/730] Add a simple test that just runs pftInit --- tools/mksurfdata_map/src/test/CMakeLists.txt | 3 ++- .../src/test/mkpftmod_test/CMakeLists.txt | 7 ++++++ .../test/mkpftmod_test/test_pft_override.pf | 25 +++++++++++++++++++ .../src/unit_test_stubs/mkncdio.F90 | 11 ++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt create mode 100644 tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf diff --git a/tools/mksurfdata_map/src/test/CMakeLists.txt b/tools/mksurfdata_map/src/test/CMakeLists.txt index 5cfb20f21b..81e413cb85 100644 --- a/tools/mksurfdata_map/src/test/CMakeLists.txt +++ b/tools/mksurfdata_map/src/test/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory(mkpctPftType_test) add_subdirectory(mkpftUtils_test) +add_subdirectory(mkpftmod_test) add_subdirectory(mkgridmap_test) add_subdirectory(mkindexmap_test) -add_subdirectory(mksoilUtils_test) \ No newline at end of file +add_subdirectory(mksoilUtils_test) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt new file mode 100644 index 0000000000..0d755ccc14 --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt @@ -0,0 +1,7 @@ +set (pfunit_sources + test_pft_override.pf) + +create_pFUnit_test(mkpftMod test_mkpft_exe + "${pfunit_sources}" "") + +target_link_libraries(test_mkpft_exe mksurfdat) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf new file mode 100644 index 0000000000..7bb2c44e3a --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -0,0 +1,25 @@ +module test_pft_override + + ! Tests of mkpftMod: pft_override functions + + use pfunit_mod + + use shr_kind_mod, only : r8 => shr_kind_r8 + use mkpftMod + + implicit none + save + +contains + + @Test + subroutine test_runmkpftInit + logical :: zero_out, all_veg + + zero_out = .false. + all_veg = .false. + call mkpftInit( zero_out, all_veg ) + + end subroutine test_runmkpftInit + +end module test_pft_override diff --git a/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 b/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 index 33a6012adc..1bf6a8afdf 100644 --- a/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 +++ b/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 @@ -23,6 +23,8 @@ module mkncdio public :: ncd_defvar public :: ncd_def_spatial_var + public :: get_dim_lengths + public :: check_ret public :: convert_latlon @@ -68,6 +70,15 @@ subroutine ncd_def_spatial_var(ncid, varname, xtype, long_name, units, lev1name, character(len=*) , optional, intent(in) :: lev2name ! name of second level (or time) dimension end subroutine ncd_def_spatial_var + subroutine get_dim_lengths(ncid, varname, ndims, dim_lengths) + integer , intent(in) :: ncid ! netcdf id of an open netcdf file + character(len=*), intent(in) :: varname ! name of variable of interest + integer , intent(out):: ndims ! number of dimensions of variable + integer , intent(out):: dim_lengths(:) ! lengths of dimensions of variable + + dim_lengths = 0 + end subroutine get_dim_lengths + integer function nf_open(filename, mode, ncid) character(len=*), intent(in) :: filename integer, intent(in) :: mode From 6698b81c45d8432c6faf01d1f949e9d64e2e5f5c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 13:51:40 -0600 Subject: [PATCH 506/730] Some changes for unit testing, and add more tests --- tools/mksurfdata_map/src/mkpftMod.F90 | 15 ++++++++-- .../test/mkpftmod_test/test_pft_override.pf | 29 ++++++++++++++++++- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index fb86543944..c225702e15 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -47,9 +47,9 @@ module mkpftMod ! ! !PRIVATE DATA MEMBERS: ! - logical, private :: zero_out = .false. ! Flag to zero out PFT - logical, private :: use_input_pft = .false. ! Flag to override PFT with input values - integer, private :: nzero ! index of first zero fraction + logical, private :: zero_out = .false. ! Flag to zero out PFT + logical, public, protected :: use_input_pft = .false. ! Flag to override PFT with input values + integer, private :: nzero ! index of first zero fraction ! ! !PRIVATE MEMBER FUNCTIONS: ! @@ -96,6 +96,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) if ( maxpft < numpft ) then write(6,*) subname//'number PFT is > max allowed!' call abort() + return end if write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero-1) write(6,*) 'With PFT index : ', pft_idx(0:nzero-1) @@ -106,6 +107,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) if ( zero_out_l .and. all_veg )then write(6,*) subname//'zeroing out vegetation and setting vegetation to 100% is a contradiction!' call abort() + return end if ! Copy local zero out to module data version @@ -138,6 +140,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) if (cft_ub /= numpft) then write(6,*) 'CFT_UB set up incorrectly: cft_ub, numpft = ', cft_ub, numpft call abort() + return end if end subroutine mkpftInit @@ -860,6 +863,7 @@ subroutine mkpft_check_oride( ) write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero-1) write(6,*) 'With PFT index : ', pft_idx(0:nzero-1) call abort() + return else use_input_pft = .true. nzero = 0 @@ -874,20 +878,24 @@ subroutine mkpft_check_oride( ) if ( pft_frc(i) < 0.0_r8 .or. pft_frc(i) > hndrd )then write(6,*) subname//'PFT fraction is out of range: pft_frc=', pft_frc(i) call abort() + return else if ( pft_frc(i) > 0.0_r8 .and. pft_idx(i) == -1 )then write(6,*) subname//'PFT fraction > zero, but index NOT set: pft_idx=', pft_idx(i) call abort() + return end if ! PFT index out of range if ( pft_idx(i) < 0 .or. pft_idx(i) > numpft )then write(6,*) subname//'PFT index is out of range: ', pft_idx(i) call abort() + return end if ! Make sure index values NOT used twice do j = 0, i-1 if ( pft_idx(i) == pft_idx(j) )then write(6,*) subname//'Same PFT index is used twice: ', pft_idx(i) call abort() + return end if end do end do @@ -896,6 +904,7 @@ subroutine mkpft_check_oride( ) if ( pft_frc(i) /= 0.0_r8 .or. pft_idx(i) /= -1 )then write(6,*) subname//'After PFT fraction is zeroed out, fraction is non zero, or index set' call abort() + return end if end do end if diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf index 7bb2c44e3a..f892efee66 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -17,9 +17,36 @@ contains logical :: zero_out, all_veg zero_out = .false. - all_veg = .false. call mkpftInit( zero_out, all_veg ) + @assertFalse( use_input_pft ) + @assertFalse( all_veg ) end subroutine test_runmkpftInit + @Test + subroutine test_runmkpftInitZero + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + + zero_out = .true. + call mkpftInit( zero_out, all_veg ) + @assertFalse( use_input_pft ) + @assertFalse( all_veg ) + + end subroutine test_runmkpftInitZero + + @Test + subroutine test_runmkpftInitPftORide + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + + zero_out = .false. + pft_idx(0) = 1 + pft_frc(0) = 100._r8 + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + + end subroutine test_runmkpftInitPftORide + end module test_pft_override From 77e06f62f518583302b4dfc884cdf55d28bc809e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 19:10:34 -0600 Subject: [PATCH 507/730] Add a abort subroutine for unit testing, and add a test that uses it, also add the unit test build to the git ignore --- .gitignore | 3 ++ tools/mksurfdata_map/src/CMakeLists.txt | 1 + .../test/mkpftmod_test/test_pft_override.pf | 32 +++++++++++++++++++ .../src/unit_test_stubs/abort.F90 | 25 +++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 tools/mksurfdata_map/src/unit_test_stubs/abort.F90 diff --git a/.gitignore b/.gitignore index e5b448c04d..789237bc12 100644 --- a/.gitignore +++ b/.gitignore @@ -89,6 +89,9 @@ clm.input_data_list clm.input_data_list.previous *.stdout.txt.o* +# mksurfdata unit tests +unit_test_build + # Tools executables /tools/mksurfdata_map/mksurfdata_map /tools/mkprocdata_map/mkprocdata_map diff --git a/tools/mksurfdata_map/src/CMakeLists.txt b/tools/mksurfdata_map/src/CMakeLists.txt index 4aa1b82211..3179c3cdc9 100644 --- a/tools/mksurfdata_map/src/CMakeLists.txt +++ b/tools/mksurfdata_map/src/CMakeLists.txt @@ -31,6 +31,7 @@ list(APPEND mksurfdat_sources mkvarpar.F90 shr_const_mod.F90 shr_sys_mod.F90 + unit_test_stubs/abort.F90 unit_test_stubs/mkncdio.F90) add_library(mksurfdat ${mksurfdat_sources}) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf index f892efee66..84b5631e42 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -6,6 +6,7 @@ module test_pft_override use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod + use mkvarctl, only: numpft implicit none save @@ -49,4 +50,35 @@ contains end subroutine test_runmkpftInitPftORide + + @Test + subroutine test_runmkpftInitPftORideCrop + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 78 + pft_idx(0) = 17 + pft_frc(0) = 100._r8 + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + + end subroutine test_runmkpftInitPftORideCrop + + @Test + subroutine test_runmkpftInitBad + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + character(len=:), allocatable :: expected_msg + + zero_out = .true. + numpft = 78 + pft_idx(0) = 17 + pft_frc(0) = 100._r8 + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBad + end module test_pft_override diff --git a/tools/mksurfdata_map/src/unit_test_stubs/abort.F90 b/tools/mksurfdata_map/src/unit_test_stubs/abort.F90 new file mode 100644 index 0000000000..aa1d8b76c2 --- /dev/null +++ b/tools/mksurfdata_map/src/unit_test_stubs/abort.F90 @@ -0,0 +1,25 @@ +subroutine abort() + ! Replacement for abort that throws a pfunit exception rather than aborting + ! + ! This can be used to test expected errors (i.e., failure testing). + ! + ! If this occurs within a pFUnit-based test: + ! + ! - If you have code like: + ! + ! @assertExceptionRaised("ABORTED:") + ! + ! - If you don't have + ! + ! @assertExceptionRaised + ! + ! or + ! + ! call assertExceptionRaised + ! + ! then this will result in the given pFUnit test failing. + use pfunit_mod, only : throw + implicit none + + call throw("ABORTED:") +end subroutine abort From 29a169aefebae85b857b900ae79a5291b750774f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 19:46:40 -0600 Subject: [PATCH 508/730] Add some more exception tests --- .../test/mkpftmod_test/test_pft_override.pf | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf index 84b5631e42..131bdad808 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -67,7 +67,7 @@ contains end subroutine test_runmkpftInitPftORideCrop @Test - subroutine test_runmkpftInitBad + subroutine test_runmkpftInitBadZeroNInput use mkpftMod, only : use_input_pft logical :: zero_out, all_veg character(len=:), allocatable :: expected_msg @@ -79,6 +79,37 @@ contains call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) - end subroutine test_runmkpftInitBad + end subroutine test_runmkpftInitBadZeroNInput + + @Test + subroutine test_runmkpftInitBadNotSum + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + character(len=:), allocatable :: expected_msg + + zero_out = .false. + numpft = 78 + pft_idx(0) = 17 + pft_frc(0) = 99._r8 + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadNotSum + + @Test + subroutine test_runmkpftInitBadPFTOutRange + use mkpftMod, only : use_input_pft + logical :: zero_out, all_veg + character(len=:), allocatable :: expected_msg + + zero_out = .false. + numpft = 16 + pft_idx(0) = 17 + pft_frc(0) = 100._r8 + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadPFTOutRange + end module test_pft_override From e13c35cddfd0d9295c36e36ad07ba1948de39fb3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 21:18:34 -0600 Subject: [PATCH 509/730] Add more exception tests, fix two issues in mkpft one to do test on numpft outside of if, and handle case when all PFTs are set --- tools/mksurfdata_map/src/mkpftMod.F90 | 26 ++-- .../test/mkpftmod_test/test_pft_override.pf | 117 +++++++++++++++--- 2 files changed, 114 insertions(+), 29 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index c225702e15..454c6f7e1b 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -91,15 +91,15 @@ subroutine mkpftInit( zero_out_l, all_veg ) character(len=32) :: subname = 'mkpftMod::mkpftInit() ' !----------------------------------------------------------------------- write (6, '(a, a, a)') "In ", trim(subname), "..." + if ( maxpft < numpft ) then + write(6,*) subname//'number PFT is > max allowed!' + call abort() + return + end if call mkpft_check_oride( ) if ( use_input_pft ) then - if ( maxpft < numpft ) then - write(6,*) subname//'number PFT is > max allowed!' - call abort() - return - end if - write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero-1) - write(6,*) 'With PFT index : ', pft_idx(0:nzero-1) + write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) + write(6,*) 'With PFT index : ', pft_idx(0:nzero) end if all_veg = use_input_pft @@ -860,21 +860,21 @@ subroutine mkpft_check_oride( ) use_input_pft = .false. else if ( abs(sumpft - hndrd) > 1.e-6 )then write(6, '(a, a, f15.12)') trim(subname), 'Sum of PFT fraction is NOT equal to 100% =', sumpft - write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero-1) - write(6,*) 'With PFT index : ', pft_idx(0:nzero-1) + write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) + write(6,*) 'With PFT index : ', pft_idx(0:nzero) call abort() return else use_input_pft = .true. - nzero = 0 + nzero = numpft do i = 0, numpft if ( pft_frc(i) == 0.0_r8 )then - nzero = i + nzero = i-1 exit end if end do ! PFT fraction IS used, and sum is OK, now check details - do i = 0, nzero -1 + do i = 0, nzero if ( pft_frc(i) < 0.0_r8 .or. pft_frc(i) > hndrd )then write(6,*) subname//'PFT fraction is out of range: pft_frc=', pft_frc(i) call abort() @@ -900,7 +900,7 @@ subroutine mkpft_check_oride( ) end do end do ! Make sure the rest of the fraction is zero and index are not set as well - do i = nzero, numpft + do i = nzero+1, numpft if ( pft_frc(i) /= 0.0_r8 .or. pft_idx(i) /= -1 )then write(6,*) subname//'After PFT fraction is zeroed out, fraction is non zero, or index set' call abort() diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf index 131bdad808..d4d0b26e21 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -7,14 +7,35 @@ module test_pft_override use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod use mkvarctl, only: numpft + use mkpftConstantsMod, only: maxpft implicit none save + @TestCase + type, extends(TestCase) :: TestMkPFT + contains + procedure :: setUp + procedure :: tearDown + end type TestMkPFT + contains + subroutine setUp(this) + class(TestMkPFT), intent(inout) :: this + numpft = 16 + pft_idx(0:maxpft) = -1 + pft_frc(0:maxpft) = 0.0_r8 + end subroutine setUp + + subroutine tearDown(this) + class(TestMkPFT), intent(inout) :: this + + end subroutine tearDown + @Test - subroutine test_runmkpftInit + subroutine test_runmkpftInit(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg zero_out = .false. @@ -25,8 +46,8 @@ contains end subroutine test_runmkpftInit @Test - subroutine test_runmkpftInitZero - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitZero(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg zero_out = .true. @@ -37,8 +58,8 @@ contains end subroutine test_runmkpftInitZero @Test - subroutine test_runmkpftInitPftORide - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitPftORide(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg zero_out = .false. @@ -52,8 +73,8 @@ contains @Test - subroutine test_runmkpftInitPftORideCrop - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitPftORideCrop(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg zero_out = .false. @@ -67,10 +88,9 @@ contains end subroutine test_runmkpftInitPftORideCrop @Test - subroutine test_runmkpftInitBadZeroNInput - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitBadZeroNInput(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg - character(len=:), allocatable :: expected_msg zero_out = .true. numpft = 78 @@ -82,10 +102,9 @@ contains end subroutine test_runmkpftInitBadZeroNInput @Test - subroutine test_runmkpftInitBadNotSum - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitBadNotSum(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg - character(len=:), allocatable :: expected_msg zero_out = .false. numpft = 78 @@ -97,10 +116,9 @@ contains end subroutine test_runmkpftInitBadNotSum @Test - subroutine test_runmkpftInitBadPFTOutRange - use mkpftMod, only : use_input_pft + subroutine test_runmkpftInitBadPFTOutRange(this) + class(TestMkPFT), intent(inout) :: this logical :: zero_out, all_veg - character(len=:), allocatable :: expected_msg zero_out = .false. numpft = 16 @@ -111,5 +129,72 @@ contains end subroutine test_runmkpftInitBadPFTOutRange + @Test + subroutine test_runmkpftInitBadPFTBadVals(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 78 + pft_idx(0:1) = (/ 17, 18 /) + pft_frc(0:1) = (/ 101._r8, -1._r8 /) + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadPFTBadVals + + @Test + subroutine test_runmkpftInitBadnumpft(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 79 + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadnumpft + + @Test + subroutine test_runmkpftInitBadFrcNotIdx(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 78 + pft_idx(0) = 17 + pft_frc(0:1) = (/ 99._r8, 1._r8 /) + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadFrcNotIdx + + @Test + subroutine test_runmkpftInitBadIdxTwice(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 78 + pft_idx(0:1) = (/ 17, 17 /) + pft_frc(0:1) = (/ 99._r8, 1._r8 /) + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadIdxTwice + + @Test + subroutine test_runmkpftInitBadFrcAfterZero(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 78 + pft_idx(0:2) = (/ 17, -1, 18 /) + pft_frc(0:2) = (/ 99._r8, 0.0_r8, 1._r8 /) + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + end subroutine test_runmkpftInitBadFrcAfterZero + end module test_pft_override From cda9280694f3b6ce9cd4c9c1e6c612e7de890005 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2019 21:42:49 -0600 Subject: [PATCH 510/730] Add a test to set all the PFT's. This test detects a problem in the earlier mkpftMod.F90 version --- .../test/mkpftmod_test/test_pft_override.pf | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf index d4d0b26e21..3694e310d8 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf @@ -87,6 +87,27 @@ contains end subroutine test_runmkpftInitPftORideCrop + + @Test + subroutine test_runmkpftInitPftORideAll(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + integer :: i + + zero_out = .false. + numpft = 16 + do i = 0, numpft + pft_idx(i) = i + pft_frc(i) = 1.0_r8 + end do + pft_frc(numpft) = 100._r8 - sum(pft_frc(0:numpft-1)) + @assertEqual( 100.0_r8, sum(pft_frc) ) + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + + end subroutine test_runmkpftInitPftORideAll + @Test subroutine test_runmkpftInitBadZeroNInput(this) class(TestMkPFT), intent(inout) :: this From 43dbdacc741cbbb0b9a55f5cbb27bb80838f7d1c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 09:14:27 -0600 Subject: [PATCH 511/730] Start adding tests for the main mkpft subroutine (just for zero_out and pft override) --- .../src/test/mkpftmod_test/CMakeLists.txt | 3 +- .../{test_pft_override.pf => test_pftInit.pf} | 4 +- .../src/test/mkpftmod_test/test_pftrun.pf | 62 +++++++++++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) rename tools/mksurfdata_map/src/test/mkpftmod_test/{test_pft_override.pf => test_pftInit.pf} (98%) create mode 100644 tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt index 0d755ccc14..cae1d5be19 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt @@ -1,5 +1,6 @@ set (pfunit_sources - test_pft_override.pf) + test_pftrun.pf + test_pftInit.pf) create_pFUnit_test(mkpftMod test_mkpft_exe "${pfunit_sources}" "") diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf similarity index 98% rename from tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf rename to tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf index 3694e310d8..6a82d2915c 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_override.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf @@ -1,4 +1,4 @@ -module test_pft_override +module test_pftInit ! Tests of mkpftMod: pft_override functions @@ -218,4 +218,4 @@ contains end subroutine test_runmkpftInitBadFrcAfterZero -end module test_pft_override +end module test_pftInit diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf new file mode 100644 index 0000000000..3264ba0a1f --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -0,0 +1,62 @@ +module test_pftrun + + ! Tests of mkpftMod: pft_override functions + + use pfunit_mod + + use shr_kind_mod, only : r8 => shr_kind_r8 + use mkpftMod + use mkvarctl, only: numpft + use mkpftConstantsMod, only: maxpft + + implicit none + save + + @TestCase + type, extends(TestCase) :: TestMkPFTRun + contains + procedure :: setUp + procedure :: tearDown + end type TestMkPFTRun + +contains + + subroutine setUp(this) + class(TestMkPFTRun), intent(inout) :: this + numpft = 16 + pft_idx(0:maxpft) = -1 + pft_frc(0:maxpft) = 0.0_r8 + end subroutine setUp + + subroutine tearDown(this) + class(TestMkPFTRun), intent(inout) :: this + + end subroutine tearDown + + @Test + subroutine test_runmkpftZero(this) + class(TestMkPFTRun), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .true. + call mkpftInit( zero_out, all_veg ) + @assertFalse( use_input_pft ) + @assertFalse( all_veg ) + + end subroutine test_runmkpftZero + + @Test + subroutine test_runmkpftPftORide(this) + class(TestMkPFTRun), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + pft_idx(0) = 1 + pft_frc(0) = 100._r8 + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + + end subroutine test_runmkpftPftORide + +end module test_pftrun From a31ffe637bbaad5c24d93990d1ce83074b93cc74 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 12:09:38 -0600 Subject: [PATCH 512/730] Add a method to set domain for unit-testing, and call mkpft for the zero-out and pft unit tests, also zero-out doesn't need to read in datasets in mkpft and tgridmap doesn't need to be cleaned at the end of mkpft for these two cases --- tools/mksurfdata_map/src/mkdomainMod.F90 | 42 ++++++++++++++++++- tools/mksurfdata_map/src/mkpftMod.F90 | 4 +- .../src/test/mkpftmod_test/test_pftrun.pf | 28 +++++++++++++ 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/tools/mksurfdata_map/src/mkdomainMod.F90 b/tools/mksurfdata_map/src/mkdomainMod.F90 index 94cc2594ec..1a66c0f4c5 100644 --- a/tools/mksurfdata_map/src/mkdomainMod.F90 +++ b/tools/mksurfdata_map/src/mkdomainMod.F90 @@ -49,6 +49,7 @@ module mkdomainMod public domain_read_map public domain_write public domain_checksame + public for_test_create_domain ! For unit testing create a simple domain ! ! ! !REVISION HISTORY: @@ -916,7 +917,46 @@ subroutine domain_checksame( srcdomain, dstdomain, tgridmap ) call abort() end if end do - end subroutine domain_checksame +!----------------------------------------------------------------------- +!BOP +! +! !IROUTINE: for_test_create_domain +! +! !INTERFACE: + subroutine for_test_create_domain( domain ) +! +! !DESCRIPTION: +! Create a simple domain for unit testing +! +! USES: + implicit none +! !ARGUMENTS: + type(domain_type), intent(inout) :: domain ! input domain +! !LOCAL VARIABLES: + integer, parameter :: ns_o = 2 + + call domain_init( domain, ns_o ) + domain%latc = (/ 42.0_r8, 40.0_r8 /) + domain%lonc = (/ -105.0_r8, -100.0_r8 /) + domain%latn = (/ 43.0_r8, 41.0_r8 /) + domain%lats = (/ 41.0_r8, 39.0_r8 /) + domain%lone = (/ -104.0_r8, -99.0_r8 /) + domain%lonw = (/ -106.0_r8, -101.0_r8 /) + domain%mask = (/ 1, 1 /) + domain%frac = (/ 1.0_r8, 1.0_r8 /) + domain%area = (/ 49284.0_r8, 49284.0_r8 /) ! This is NOT the correct area! + + domain%edgen = maxval( domain%latn ) + domain%edges = minval( domain%lats ) + domain%edgew = minval( domain%lonw ) + domain%edgee = maxval( domain%lone ) + + domain%maskset = .true. + domain%fracset = .true. + domain%is_2d = .false. + + end subroutine for_test_create_domain + end module mkdomainMod diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 454c6f7e1b..e29f577393 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -362,7 +362,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & ns_o = ldomain%ns - if ( .not. use_input_pft ) then + if ( .not. (zero_out .or. use_input_pft) ) then ! Obtain input grid info, read PCT_PFT call domain_read(tdomain,fpft) @@ -747,8 +747,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & else deallocate(pctpft_o) end if - call domain_clean(tdomain) if ( .not. zero_out .and. .not. use_input_pft ) then + call domain_clean(tdomain) call gridmap_clean(tgridmap) end if diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 3264ba0a1f..5bbbf6e580 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -8,12 +8,21 @@ module test_pftrun use mkpftMod use mkvarctl, only: numpft use mkpftConstantsMod, only: maxpft + use mkpctPftTypeMod , only : pct_pft_type + use mkdomainMod , only : domain_type, for_test_create_domain, domain_clean implicit none save @TestCase type, extends(TestCase) :: TestMkPFTRun + character(len=12) :: mapfname + character(len=12) :: fpft + type(domain_type) :: ldomain + integer :: ndiag + type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs + real(r8), allocatable :: pctlnd_pft(:) ! PFT data: % of gridcell for PFTs + type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs contains procedure :: setUp procedure :: tearDown @@ -23,14 +32,29 @@ contains subroutine setUp(this) class(TestMkPFTRun), intent(inout) :: this + integer :: ns_o + numpft = 16 pft_idx(0:maxpft) = -1 pft_frc(0:maxpft) = 0.0_r8 + this%ndiag = 6 + this%mapfname = "none" + this%fpft = "none" + call for_test_create_domain( this%ldomain ) + ns_o = this%ldomain%ns + allocate( this%pctnatpft(ns_o) ) + allocate( this%pctlnd_pft(ns_o) ) + allocate( this%pctcft(ns_o) ) end subroutine setUp subroutine tearDown(this) class(TestMkPFTRun), intent(inout) :: this + deallocate( this%pctnatpft ) + deallocate( this%pctlnd_pft ) + deallocate( this%pctcft ) + call domain_clean( this%ldomain ) + end subroutine tearDown @Test @@ -42,6 +66,8 @@ contains call mkpftInit( zero_out, all_veg ) @assertFalse( use_input_pft ) @assertFalse( all_veg ) + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) end subroutine test_runmkpftZero @@ -56,6 +82,8 @@ contains call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) @assertTrue( all_veg ) + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) end subroutine test_runmkpftPftORide From a62d4d8b164299a31bcd2ecd660b36bff00c774e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 14:41:24 -0600 Subject: [PATCH 513/730] Start checking more things --- .../src/test/mkpftmod_test/test_pftrun.pf | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 5bbbf6e580..0dc3a3cfcb 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -20,6 +20,9 @@ module test_pftrun character(len=12) :: fpft type(domain_type) :: ldomain integer :: ndiag + real(r8), allocatable :: expected(:) + real(r8) :: expected_cft(2) + real(r8) :: expected_pft(0:14) type(pct_pft_type), allocatable :: pctnatpft(:) ! % of grid cell that is nat veg, and breakdown into PFTs real(r8), allocatable :: pctlnd_pft(:) ! PFT data: % of gridcell for PFTs type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs @@ -45,6 +48,10 @@ contains allocate( this%pctnatpft(ns_o) ) allocate( this%pctlnd_pft(ns_o) ) allocate( this%pctcft(ns_o) ) + allocate( this%expected(ns_o) ) + this%expected = 0.0_r8 + this%expected_cft = 0.0_r8 + this%expected_pft = 0.0_r8 end subroutine setUp subroutine tearDown(this) @@ -53,6 +60,7 @@ contains deallocate( this%pctnatpft ) deallocate( this%pctlnd_pft ) deallocate( this%pctcft ) + deallocate( this%expected ) call domain_clean( this%ldomain ) end subroutine tearDown @@ -61,6 +69,7 @@ contains subroutine test_runmkpftZero(this) class(TestMkPFTRun), intent(inout) :: this logical :: zero_out, all_veg + integer :: n zero_out = .true. call mkpftInit( zero_out, all_veg ) @@ -68,6 +77,11 @@ contains @assertFalse( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) + this%expected = 100.0_r8 + @assertEqual( this%expected, this%pctlnd_pft ) + do n = 1, this%ldomain%ns + @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 0.0_r8 ) + end do end subroutine test_runmkpftZero @@ -75,6 +89,7 @@ contains subroutine test_runmkpftPftORide(this) class(TestMkPFTRun), intent(inout) :: this logical :: zero_out, all_veg + integer :: n zero_out = .false. pft_idx(0) = 1 @@ -84,6 +99,11 @@ contains @assertTrue( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) + this%expected = 100.0_r8 + @assertEqual( this%expected, this%pctlnd_pft ) + do n = 1, this%ldomain%ns + @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 100.0_r8 ) + end do end subroutine test_runmkpftPftORide From 09e98c774324d85140f280f24f71ba01fbbd575f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 20:10:16 -0600 Subject: [PATCH 514/730] Add some more checks that results are correct after running mkpft --- .../src/test/mkpftmod_test/test_pftrun.pf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 0dc3a3cfcb..7a7dd3fd76 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -81,6 +81,13 @@ contains @assertEqual( this%expected, this%pctlnd_pft ) do n = 1, this%ldomain%ns @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 0.0_r8 ) + @assertEqual( this%pctcft(n)%get_pct_l2g(), 0.0_r8 ) + this%expected_pft = 0.0_r8 + this%expected_pft(0) = 100.0_r8 + this%expected_cft = 0.0_r8 + this%expected_cft(1) = 100.0_r8 + @assertEqual( this%pctnatpft(n)%get_pct_p2l(), this%expected_pft ) + @assertEqual( this%pctcft(n)%get_pct_p2l(), this%expected_cft ) end do end subroutine test_runmkpftZero @@ -90,9 +97,10 @@ contains class(TestMkPFTRun), intent(inout) :: this logical :: zero_out, all_veg integer :: n + integer, parameter :: pftidx = 1 zero_out = .false. - pft_idx(0) = 1 + pft_idx(0) = pftidx pft_frc(0) = 100._r8 call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) @@ -103,6 +111,13 @@ contains @assertEqual( this%expected, this%pctlnd_pft ) do n = 1, this%ldomain%ns @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 100.0_r8 ) + @assertEqual( this%pctcft(n)%get_pct_l2g(), 0.0_r8 ) + this%expected_pft = 0.0_r8 + this%expected_pft(pftidx) = 100.0_r8 + this%expected_cft = 0.0_r8 + this%expected_cft(1) = 100.0_r8 + @assertEqual( this%pctnatpft(n)%get_pct_p2l(), this%expected_pft ) + @assertEqual( this%pctcft(n)%get_pct_p2l(), this%expected_cft ) end do end subroutine test_runmkpftPftORide From 32c394c7a6fb32bb23242c5141bdb5df0c7f0b04 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 20:31:14 -0600 Subject: [PATCH 515/730] Add a test that includes a crop and natural PFT index, so divided between the two --- .../src/test/mkpftmod_test/test_pftrun.pf | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 7a7dd3fd76..3ac3d8d3f3 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -122,4 +122,38 @@ contains end subroutine test_runmkpftPftORide + + @Test + subroutine test_runmkpftPftORideWCrop(this) + use mkvarpar, only: numstdpft, numstdcft + class(TestMkPFTRun), intent(inout) :: this + logical :: zero_out, all_veg + integer :: n + integer, parameter :: pftidx = 1, cftidx = 15 + + zero_out = .false. + @assertLessThan( pftidx, numstdpft-numstdcft+1 ) + @assertGreaterThan( cftidx, numstdpft-numstdcft ) + pft_idx(0:1) = (/ pftidx, cftidx /) + pft_frc(0:1) = (/ 50.0_r8, 50.0_r8 /) + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) + this%expected = 100.0_r8 + @assertEqual( this%expected, this%pctlnd_pft ) + do n = 1, this%ldomain%ns + @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 50.0_r8 ) + @assertEqual( this%pctcft(n)%get_pct_l2g(), 50.0_r8 ) + this%expected_pft = 0.0_r8 + this%expected_pft(pftidx) = 100.0_r8 + this%expected_cft = 0.0_r8 + this%expected_cft(numstdpft-cftidx) = 100.0_r8 + @assertEqual( this%pctnatpft(n)%get_pct_p2l(), this%expected_pft ) + @assertEqual( this%pctcft(n)%get_pct_p2l(), this%expected_cft ) + end do + + end subroutine test_runmkpftPftORideWCrop + end module test_pftrun From 162c393f46f11b96ab7d653fb2315dca676d147a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2019 20:44:44 -0600 Subject: [PATCH 516/730] Add another more complicated test with two nat-veg PFTs and two crop CFTs --- .../src/test/mkpftmod_test/test_pftrun.pf | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 3ac3d8d3f3..b26cf9458c 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -156,4 +156,39 @@ contains end subroutine test_runmkpftPftORideWCrop + @Test + subroutine test_runmkpft4PftORideWCrop(this) + use mkvarpar, only: numstdpft, numstdcft + class(TestMkPFTRun), intent(inout) :: this + logical :: zero_out, all_veg + integer :: n + integer, parameter :: pftidx = 1, pftidx2 = 2, cftidx = 15, cftidx2 = 16 + + zero_out = .false. + @assertLessThan( pftidx, numstdpft-numstdcft+1 ) + @assertLessThan( pftidx2, numstdpft-numstdcft+1 ) + @assertGreaterThan( cftidx, numstdpft-numstdcft ) + @assertGreaterThan( cftidx2, numstdpft-numstdcft ) + pft_idx(0:3) = (/ pftidx, pftidx2, cftidx, cftidx2 /) + pft_frc(0:3) = (/ 25.0_r8, 25.0_r8, 25.0_r8, 25.0_r8 /) + call mkpftInit( zero_out, all_veg ) + @assertTrue( use_input_pft ) + @assertTrue( all_veg ) + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) + this%expected = 100.0_r8 + @assertEqual( this%expected, this%pctlnd_pft ) + do n = 1, this%ldomain%ns + @assertEqual( this%pctnatpft(n)%get_pct_l2g(), 50.0_r8 ) + @assertEqual( this%pctcft(n)%get_pct_l2g(), 50.0_r8 ) + this%expected_pft = 0.0_r8 + this%expected_pft(pftidx) = 50.0_r8 + this%expected_pft(pftidx2) = 50.0_r8 + this%expected_cft = 50.0_r8 + @assertEqual( this%pctnatpft(n)%get_pct_p2l(), this%expected_pft ) + @assertEqual( this%pctcft(n)%get_pct_p2l(), this%expected_cft ) + end do + + end subroutine test_runmkpft4PftORideWCrop + end module test_pftrun From f57efe3a513d8064211f2b6a216f853f8b25307a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 11:19:03 -0600 Subject: [PATCH 517/730] Remove allow_no_crops and missing_crops --- tools/mksurfdata_map/src/mkpftMod.F90 | 53 +++---------------- tools/mksurfdata_map/src/mksurfdat.F90 | 13 +---- .../src/test/mkpftmod_test/test_pftrun.pf | 8 +-- 3 files changed, 13 insertions(+), 61 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index e29f577393..9fc60fd70a 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -151,9 +151,8 @@ end subroutine mkpftInit ! !IROUTINE: mkpft ! ! !INTERFACE: -subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & - pctlnd_o, pctnatpft_o, pctcft_o, & - pctcft_o_saved) +subroutine mkpft(ldomain, mapfname, fpft, ndiag, & + pctlnd_o, pctnatpft_o, pctcft_o) ! ! !DESCRIPTION: ! Make PFT data @@ -168,14 +167,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & ! Upon return from this routine, the % cover of the natural veg + crop landunits is ! generally 100% everywhere; this will be normalized later to account for special landunits. ! -! If allow_no_crops is true, then we allow the input dataset to have no prognostic crop -! information (i.e., only contain information about the "standard" PFTs). In this case, -! pctcft_o_saved MUST be given. If the input dataset is found to not have information -! about the prognostic crops, then we take the generic c3 crop cover from the input -! dataset to specify the crop landunit area, and we take the individual crop breakdown -! from pctcft_o_saved (which will generally have come from some other input dataset that -! DID contain prognostic crop information). -! ! !USES: use mkdomainMod, only : domain_type, domain_clean, domain_read use mkgridmapMod @@ -192,13 +183,9 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & character(len=*) , intent(in) :: mapfname ! input mapping file name character(len=*) , intent(in) :: fpft ! input pft dataset file name integer , intent(in) :: ndiag ! unit number for diag out - logical , intent(in) :: allow_no_crops ! if it's okay to not have prognostic crops in the input file real(r8) , intent(out):: pctlnd_o(:) ! output grid:%land/gridcell type(pct_pft_type), intent(out):: pctnatpft_o(:) ! natural PFT cover type(pct_pft_type), intent(out):: pctcft_o(:) ! crop (CFT) cover - -! saved crop cover information, in case the input dataset does not contain information about prognostic crops - type(pct_pft_type), intent(in), optional :: pctcft_o_saved(:) ! ! !CALLED FROM: ! subroutine mksrfdat in module mksrfdatMod @@ -239,7 +226,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & integer :: ndims ! number of dimensions for a variable on the file integer :: dimlens(3) ! dimension lengths for a variable on the file integer :: ier ! error status - logical :: missing_crops ! if we need prognostic crop info, but the input dataset is missing this crop info real(r8) :: relerr = 0.0001_r8 ! max error: sum overlap wts ne 1 logical :: oldformat ! if input file is in the old format or not (based on what variables exist) @@ -252,16 +238,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & write (6,*) 'Attempting to make PFTs .....' call shr_sys_flush(6) - if (allow_no_crops) then - if (.not. present(pctcft_o_saved)) then - write(6,*) subname, ' ERROR: when allow_no_crops is true, pctcft_o_saved must be given' - call abort() - end if - end if - - ! Start by assuming the input dataset is NOT missing crop info - missing_crops = .false. - ! ----------------------------------------------------------------- ! Set the vegetation types ! ----------------------------------------------------------------- @@ -386,22 +362,12 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & end if ! Check if the number of pfts on the input matches the expected number. A mismatch - ! is okay in the case that the input has the standard number of pfts (i.e., no - ! prognostic crop info), if allow_no_crops is true. Otherwise, a mismatch is an error. + ! is okay if the input raw dataset has prognostic crops and the output does not. if (numpft_i .ne. numpft+1) then if (numpft_i .eq. numstdpft+1) then - if (allow_no_crops) then - write(6,*) subname//': using non-crop input file for a surface dataset with crops' - write(6,*) "(this is okay: we'll use the saved crop breakdown from the non-transient input file)" - missing_crops = .true. - else - write(6,*) subname//' ERROR: trying to use non-crop input file' - write(6,*) 'for a surface dataset with crops, but allow_no_crops is false' - write(6,*) "(This can happen if you're trying to use a non-crop input file" - write(6,*) "for the surface dataset itself: a non-crop input file is only" - write(6,*) "allowed for the transient PFT information.)" - call abort() - end if + write(6,*) subname//' ERROR: trying to use non-crop input file' + write(6,*) 'for a surface dataset with crops.' + call abort() else if (numpft_i > numstdpft+1 .and. numpft_i == maxpft+1 .and. .not. oldformat) then write(6,*) subname//' WARNING: using a crop input raw dataset for a non-crop output surface dataset' else @@ -635,12 +601,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, allow_no_crops, & ! Convert % pft as % of grid cell to % pft on the landunit and % of landunit on the ! grid cell - if (missing_crops) then - do no = 1,ns_o - call convert_from_p2g(pct_p2g=pctpft_o(no,:), pctcft_saved=pctcft_o_saved(no), & - pctnatpft=pctnatpft_o(no), pctcft=pctcft_o(no)) - end do - else if ( .not. oldformat ) then + if ( .not. oldformat ) then do no = 1,ns_o pctnatpft_o(no) = pct_pft_type( pct_nat_pft_o(no,:), pctnatveg_o(no), first_pft_index=natpft_lb ) pctcft_o(no) = pct_pft_type( pct_cft_o(no,:), pctcrop_o(no), first_pft_index=cft_lb ) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 84e285d2b5..c341744573 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -93,7 +93,6 @@ program mksurfdat type(pct_pft_type), allocatable :: pctnatpft_max(:) ! % of grid cell maximum PFTs of the time series type(pct_pft_type), allocatable :: pctcft(:) ! % of grid cell that is crop, and breakdown into CFTs type(pct_pft_type), allocatable :: pctcft_max(:) ! % of grid cell maximum CFTs of the time series - type(pct_pft_type), allocatable :: pctcft_saved(:) ! version of pctcft saved from the initial call to mkpft real(r8), pointer :: harvest1D(:) ! harvest 1D data: normalized harvesting real(r8), pointer :: harvest2D(:,:) ! harvest 1D data: normalized harvesting real(r8), allocatable :: pctgla(:) ! percent of grid cell that is glacier @@ -432,7 +431,6 @@ program mksurfdat pctnatpft_max(ns_o) , & pctcft(ns_o) , & pctcft_max(ns_o) , & - pctcft_saved(ns_o) , & pctgla(ns_o) , & pctlak(ns_o) , & pctwet(ns_o) , & @@ -561,8 +559,7 @@ program mksurfdat ! Make PFTs [pctnatpft, pctcft] from dataset [fvegtyp] call mkpft(ldomain, mapfname=map_fpft, fpft=mksrf_fvegtyp, & - ndiag=ndiag, allow_no_crops=.false., & - pctlnd_o=pctlnd_pft, pctnatpft_o=pctnatpft, pctcft_o=pctcft) + ndiag=ndiag, pctlnd_o=pctlnd_pft, pctnatpft_o=pctnatpft, pctcft_o=pctcft) ! Create harvesting data at model resolution call mkharvest_init( ns_o, spval, harvdata, mksrf_fhrvtyp ) @@ -572,10 +569,6 @@ program mksurfdat ndiag=ndiag, harvdata=harvdata ) end if - ! Save the version of pctcft before any corrections are made. In particular, we want - ! to save the version before remove_small_cover is called. - pctcft_saved = pctcft - ! Make inland water [pctlak, pctwet] [flakwat] [fwetlnd] call mklakwat (ldomain, mapfname=map_flakwat, datfname=mksrf_flakwat, & @@ -1143,9 +1136,7 @@ program mksurfdat ! Create pctpft data at model resolution call mkpft(ldomain, mapfname=map_fpft, fpft=fname, & - ndiag=ndiag, allow_no_crops=.false., & - pctlnd_o=pctlnd_pft_dyn, pctnatpft_o=pctnatpft, pctcft_o=pctcft, & - pctcft_o_saved=pctcft_saved) + ndiag=ndiag, pctlnd_o=pctlnd_pft_dyn, pctnatpft_o=pctnatpft, pctcft_o=pctcft ) ! Create harvesting data at model resolution diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index b26cf9458c..8437c97fa7 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -75,7 +75,7 @@ contains call mkpftInit( zero_out, all_veg ) @assertFalse( use_input_pft ) @assertFalse( all_veg ) - call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @assertEqual( this%expected, this%pctlnd_pft ) @@ -105,7 +105,7 @@ contains call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) @assertTrue( all_veg ) - call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @assertEqual( this%expected, this%pctlnd_pft ) @@ -139,7 +139,7 @@ contains call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) @assertTrue( all_veg ) - call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @assertEqual( this%expected, this%pctlnd_pft ) @@ -174,7 +174,7 @@ contains call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) @assertTrue( all_veg ) - call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, allow_no_crops=.false., & + call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @assertEqual( this%expected, this%pctlnd_pft ) From 4a64e181b84c3f529f830150e87d6d02ee902196 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 11:30:48 -0600 Subject: [PATCH 518/730] Remove the oldformat option from the reading section, now will die if oldformat is flagged --- tools/mksurfdata_map/src/mkpftMod.F90 | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 9fc60fd70a..4019c9f755 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -357,8 +357,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call check_ret(nf_inq_dimlen (ncid, dimid, ncft_i), subname) numpft_i = natpft_i + ncft_i else - call check_ret(nf_inq_dimid (ncid, 'pft', dimid), subname) - call check_ret(nf_inq_dimlen (ncid, dimid, numpft_i), subname) + write(6,*) subname//' ERROR: PCT_PFT field on the the file so it is in the old format, which is no longer supported' + call abort() end if ! Check if the number of pfts on the input matches the expected number. A mismatch @@ -419,15 +419,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) - ! Read in from the old format with PCT_PFT alone - else - allocate(pctpft_i(ns_i,0:(numpft_i-1)), & - pctpft_o(ns_o,0:(numpft_i-1)), & - stat=ier) - if (ier/=0) call abort() - - call check_ret(nf_inq_varid (ncid, 'PCT_PFT', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, pctpft_i), subname) end if call check_ret(nf_close(ncid), subname) @@ -520,18 +511,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & end do ! Old format with just PCTPFT else - do m = 0, numpft_i - 1 - call gridmap_areaave(tgridmap, pctpft_i(:,m), pctpft_o(:,m), nodata=0._r8) - do no = 1,ns_o - if (pctlnd_o(no) < 1.0e-6) then - if (m == 0) then - pctpft_o(no,m) = 100._r8 - else - pctpft_o(no,m) = 0._r8 - endif - end if - enddo - enddo end if end if From b01ff1dff390fc64e0e842e457a6e9ec59da6d74 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 13:52:00 -0600 Subject: [PATCH 519/730] Start adding a pft override object to handle the overriding the PFT from both zeroout and index provided methods --- tools/mksurfdata_map/src/mkpftMod.F90 | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 4019c9f755..2c9977d003 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -50,6 +50,16 @@ module mkpftMod logical, private :: zero_out = .false. ! Flag to zero out PFT logical, public, protected :: use_input_pft = .false. ! Flag to override PFT with input values integer, private :: nzero ! index of first zero fraction + + type, public :: pft_oride + real(r8) :: crop ! Percent covered by crops + real(r8) :: natveg ! Percent covered by natural vegetation + real(r8), allocatable :: natpft(:) ! Percent of each natural PFT within the natural veg landunit + real(r8), allocatable :: cft(:) ! Percent of each crop CFT within the crop landunit + contains + procedure, public :: InitZeroOut ! Initialize the PFT override object to zero out all vegetation + procedure, public :: InitAllPFTIndex ! Initialize the PFT override object with PFT indeces for all veg and crop types + end type pft_oride ! ! !PRIVATE MEMBER FUNCTIONS: ! @@ -1032,6 +1042,64 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) end subroutine mkpftAtt +!----------------------------------------------------------------------- +!BOP +! +! !IROUTINE: InitZeroOut +! +! !INTERFACE: +subroutine InitZeroOut( this ) +! +! !DESCRIPTION: +! Initialize a pft_oride object with vegetation that's zeroed out +! +! !USES: + use mkvarpar, only : noveg +! !ARGUMENTS: + implicit none + class(pft_oride), intent(inout) :: this +! +! !REVISION HISTORY: +! Author: Erik Kluzek +! +! +! !LOCAL VARIABLES: +!EOP + this%crop = 0.0_r8 + this%natveg = 0.0_r8 + allocate( this%natpft(noveg:num_natpft) ) + allocate( this%cft(1:num_cft) ) + this%natpft = 0.0_r8 + this%natpft(noveg) = 100.0_r8 + this%cft = 0.0_r8 + this%cft(1) = 100.0_r8 +end subroutine InitZeroOut + +!----------------------------------------------------------------------- +!BOP +! +! !IROUTINE: InitZeroOut +! +! !INTERFACE: +subroutine InitAllPFTIndex( this ) +! +! !DESCRIPTION: +! Initialize a pft_oride object with vegetation that's zeroed out +! +! !ARGUMENTS: + implicit none + class(pft_oride), intent(inout) :: this +! +! !REVISION HISTORY: +! Author: Erik Kluzek +! +! +! !LOCAL VARIABLES: +!EOP + call this%InitZeroOut() + +end subroutine InitAllPFTIndex + !----------------------------------------------------------------------- end module mkpftMod From 2d2a3cdc6e47972cfd136bd99b4927249c38c453 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 15:26:43 -0600 Subject: [PATCH 520/730] Add pft_oride constructor and Clean methods as well as a simple test for the zero out option --- tools/mksurfdata_map/src/mkpftMod.F90 | 70 +++++++++++++++---- .../src/test/mkpftmod_test/CMakeLists.txt | 1 + .../src/test/mkpftmod_test/test_pft_oride.pf | 53 ++++++++++++++ 3 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 2c9977d003..3e2c805434 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -59,7 +59,12 @@ module mkpftMod contains procedure, public :: InitZeroOut ! Initialize the PFT override object to zero out all vegetation procedure, public :: InitAllPFTIndex ! Initialize the PFT override object with PFT indeces for all veg and crop types + procedure, public :: Clean ! Clean up a PFT Override object end type pft_oride + + interface pft_oride + module procedure :: constructor ! PFT Overide object constructor + end interface pft_oride ! ! !PRIVATE MEMBER FUNCTIONS: ! @@ -1042,6 +1047,33 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) end subroutine mkpftAtt +!----------------------------------------------------------------------- +!BOP +! +! !IROUTINE: constructor +! +! !INTERFACE: +function constructor( ) result(this) +! +! !DESCRIPTION: +! Construct a new PFT override object +! +! !USES: + use mkvarpar, only : noveg +! !ARGUMENTS: + implicit none + type(pft_oride) :: this +!EOP + this%crop = -1.0_r8 + this%natveg = -1.0_r8 + allocate( this%natpft(noveg:num_natpft) ) + allocate( this%cft(1:num_cft) ) + this%natpft(:) = -1.0_r8 + this%cft(:) = -1.0_r8 + call this%InitZeroOut() +end function constructor + + !----------------------------------------------------------------------- !BOP ! @@ -1058,17 +1090,10 @@ subroutine InitZeroOut( this ) ! !ARGUMENTS: implicit none class(pft_oride), intent(inout) :: this -! -! !REVISION HISTORY: -! Author: Erik Kluzek -! -! -! !LOCAL VARIABLES: !EOP - this%crop = 0.0_r8 - this%natveg = 0.0_r8 - allocate( this%natpft(noveg:num_natpft) ) - allocate( this%cft(1:num_cft) ) + this%crop = 0.0_r8 + this%natveg = 0.0_r8 + this%natpft = 0.0_r8 this%natpft(noveg) = 100.0_r8 this%cft = 0.0_r8 @@ -1089,16 +1114,31 @@ subroutine InitAllPFTIndex( this ) ! !ARGUMENTS: implicit none class(pft_oride), intent(inout) :: this +!EOP + +end subroutine InitAllPFTIndex + +!----------------------------------------------------------------------- +!BOP ! -! !REVISION HISTORY: -! Author: Erik Kluzek +! !IROUTINE: clean ! +! !INTERFACE: +subroutine Clean( this ) ! -! !LOCAL VARIABLES: +! !DESCRIPTION: +! Clean up a PFT Oride object +! +! !ARGUMENTS: + implicit none + class(pft_oride), intent(inout) :: this !EOP - call this%InitZeroOut() + this%crop = -1.0_r8 + this%natveg = -1.0_r8 + deallocate( this%natpft ) + deallocate( this%cft ) -end subroutine InitAllPFTIndex +end subroutine Clean !----------------------------------------------------------------------- diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt index cae1d5be19..8fcb75145f 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/CMakeLists.txt @@ -1,5 +1,6 @@ set (pfunit_sources test_pftrun.pf + test_pft_oride.pf test_pftInit.pf) create_pFUnit_test(mkpftMod test_mkpft_exe diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf new file mode 100644 index 0000000000..cbbe3f6fd8 --- /dev/null +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf @@ -0,0 +1,53 @@ +module test_pft_oride + + ! Tests of mkpftMod: pft_override functions + + use pfunit_mod + + use shr_kind_mod, only : r8 => shr_kind_r8 + use mkpftMod + use mkvarctl, only : numpft + + implicit none + save + + @TestCase + type, extends(TestCase) :: TestPFTORide + type(pft_oride) :: pftoverride + contains + procedure :: setUp + procedure :: tearDown + end type TestPFTORide + +contains + + subroutine setUp(this) + class(TestPFTORide), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + numpft = 16 + call mkpftInit( zero_out, all_veg ) + this%pftoverride = pft_oride( ) + end subroutine setUp + + subroutine tearDown(this) + class(TestPFTORide), intent(inout) :: this + + call this%pftoverride%Clean() + + end subroutine tearDown + + @Test + subroutine test_runmkpftZero(this) + class(TestPFTORide), intent(inout) :: this + + call this%pftoverride%InitZeroOut() + @assertEqual( this%pftoverride%crop, 0.0_r8 ) + @assertEqual( this%pftoverride%natveg, 0.0_r8 ) + @assertEqual( sum(this%pftoverride%cft), 100.0_r8 ) + @assertEqual( sum(this%pftoverride%natpft), 100.0_r8 ) + + end subroutine test_runmkpftZero + +end module test_pft_oride From b0e7f80871c74d80183a18cf0e916d013f7a944f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 16:46:31 -0600 Subject: [PATCH 521/730] Implement the InitAllPFTIndex method, and add some tests for it, also start using stored indices for some values --- .../mksurfdata_map/src/mkpftConstantsMod.F90 | 2 +- tools/mksurfdata_map/src/mkpftMod.F90 | 36 +++++++++++-- .../src/test/mkpftmod_test/test_pftInit.pf | 31 +++++------ .../src/test/mkpftmod_test/test_pft_oride.pf | 53 ++++++++++++++++--- .../src/test/mkpftmod_test/test_pftrun.pf | 14 +++-- 5 files changed, 106 insertions(+), 30 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftConstantsMod.F90 b/tools/mksurfdata_map/src/mkpftConstantsMod.F90 index 0355f9b696..241873c339 100644 --- a/tools/mksurfdata_map/src/mkpftConstantsMod.F90 +++ b/tools/mksurfdata_map/src/mkpftConstantsMod.F90 @@ -23,7 +23,7 @@ module mkpftConstantsMod integer, parameter, public :: maxpft = 78 ! maximum # of PFT - integer, public :: num_natpft ! number of PFTs on the natural vegetation + integer, public :: num_natpft = -1 ! number of PFTs on the natural vegetation ! landunit, NOT including bare ground ! (includes generic crops for runs with ! create_crop_landunit=false) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 3e2c805434..6769e08f2d 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -15,6 +15,7 @@ module mkpftMod !!USES: use shr_kind_mod, only : r8 => shr_kind_r8 use shr_sys_mod , only : shr_sys_flush + use mkvarpar , only : noveg use mkvarctl , only : numpft use mkdomainMod , only : domain_checksame use mkpftConstantsMod @@ -1058,8 +1059,6 @@ function constructor( ) result(this) ! !DESCRIPTION: ! Construct a new PFT override object ! -! !USES: - use mkvarpar, only : noveg ! !ARGUMENTS: implicit none type(pft_oride) :: this @@ -1085,8 +1084,6 @@ subroutine InitZeroOut( this ) ! !DESCRIPTION: ! Initialize a pft_oride object with vegetation that's zeroed out ! -! !USES: - use mkvarpar, only : noveg ! !ARGUMENTS: implicit none class(pft_oride), intent(inout) :: this @@ -1115,6 +1112,37 @@ subroutine InitAllPFTIndex( this ) implicit none class(pft_oride), intent(inout) :: this !EOP + integer :: m, i ! Indices + real(r8) :: croptot ! Total of crop + real(r8) :: natvegtot ! Total of natural vegetation + + croptot = 0.0_r8 + natvegtot = 0.0_r8 + this%natpft = 0.0_r8 + this%cft = 0.0_r8 + do m = noveg, nzero + i = pft_idx(m) + if ( i <= num_natpft )then + this%natpft(i) = pft_frc(m) + natvegtot = natvegtot + pft_frc(m) + else + this%cft(i-num_natpft) = pft_frc(m) + croptot = croptot + pft_frc(m) + end if + end do + this%crop = croptot + this%natveg = natvegtot + ! Renormalize + if ( natvegtot > 0.0_r8 )then + this%natpft = 100.0_r8 * this%natpft / natvegtot + else + this%natpft(noveg) = 100.0_r8 + end if + if (croptot > 0.0_r8 )then + this%cft = 100.0_r8 * this%cft / croptot + else + this%cft(1) = 100.0_r8 + end if end subroutine InitAllPFTIndex diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf index 6a82d2915c..cd3684d3b6 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf @@ -7,6 +7,7 @@ module test_pftInit use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod use mkvarctl, only: numpft + use mkvarpar, only: numstdpft use mkpftConstantsMod, only: maxpft implicit none @@ -23,7 +24,7 @@ contains subroutine setUp(this) class(TestMkPFT), intent(inout) :: this - numpft = 16 + numpft = numstdpft pft_idx(0:maxpft) = -1 pft_frc(0:maxpft) = 0.0_r8 end subroutine setUp @@ -78,7 +79,7 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 + numpft = maxpft pft_idx(0) = 17 pft_frc(0) = 100._r8 call mkpftInit( zero_out, all_veg ) @@ -95,7 +96,7 @@ contains integer :: i zero_out = .false. - numpft = 16 + numpft = numstdpft do i = 0, numpft pft_idx(i) = i pft_frc(i) = 1.0_r8 @@ -114,8 +115,8 @@ contains logical :: zero_out, all_veg zero_out = .true. - numpft = 78 - pft_idx(0) = 17 + numpft = maxpft + pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -128,8 +129,8 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 - pft_idx(0) = 17 + numpft = maxpft + pft_idx(0) = numstdpft+1 pft_frc(0) = 99._r8 call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -142,8 +143,8 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 16 - pft_idx(0) = 17 + numpft = numstdpft + pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -156,8 +157,8 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 - pft_idx(0:1) = (/ 17, 18 /) + numpft = maxpft + pft_idx(0:1) = (/ numstdpft+1, numstdpft+2 /) pft_frc(0:1) = (/ 101._r8, -1._r8 /) call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -182,8 +183,8 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 - pft_idx(0) = 17 + numpft = maxpft + pft_idx(0) = numstdpft+1 pft_frc(0:1) = (/ 99._r8, 1._r8 /) call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -196,7 +197,7 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 + numpft = maxpft pft_idx(0:1) = (/ 17, 17 /) pft_frc(0:1) = (/ 99._r8, 1._r8 /) call mkpftInit( zero_out, all_veg ) @@ -210,7 +211,7 @@ contains logical :: zero_out, all_veg zero_out = .false. - numpft = 78 + numpft = maxpft pft_idx(0:2) = (/ 17, -1, 18 /) pft_frc(0:2) = (/ 99._r8, 0.0_r8, 1._r8 /) call mkpftInit( zero_out, all_veg ) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf index cbbe3f6fd8..926b84f511 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf @@ -7,6 +7,8 @@ module test_pft_oride use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod use mkvarctl, only : numpft + use mkvarpar, only : numstdpft + use mkpftConstantsMod, only : c3cropindex implicit none save @@ -19,14 +21,17 @@ module test_pft_oride procedure :: tearDown end type TestPFTORide + logical :: zero_out, all_veg + contains subroutine setUp(this) class(TestPFTORide), intent(inout) :: this - logical :: zero_out, all_veg + pft_idx(:) = -1 + pft_frc(:) = 0.0_r8 zero_out = .false. - numpft = 16 + numpft = numstdpft call mkpftInit( zero_out, all_veg ) this%pftoverride = pft_oride( ) end subroutine setUp @@ -42,12 +47,48 @@ contains subroutine test_runmkpftZero(this) class(TestPFTORide), intent(inout) :: this + call mkpftInit( zero_out, all_veg ) call this%pftoverride%InitZeroOut() - @assertEqual( this%pftoverride%crop, 0.0_r8 ) - @assertEqual( this%pftoverride%natveg, 0.0_r8 ) - @assertEqual( sum(this%pftoverride%cft), 100.0_r8 ) - @assertEqual( sum(this%pftoverride%natpft), 100.0_r8 ) + @assertEqual( 0.0_r8, this%pftoverride%crop ) + @assertEqual( 0.0_r8, this%pftoverride%natveg ) + @assertEqual( 100.0_r8, sum(this%pftoverride%cft)) + @assertEqual( 100.0_r8, sum(this%pftoverride%natpft)) end subroutine test_runmkpftZero + @Test + subroutine test_runSetpft(this) + class(TestPFTORide), intent(inout) :: this + integer, parameter :: pftidx = 1 + + pft_idx(0) = pftidx + pft_frc(0) = 100.0_r8 + call mkpftInit( zero_out, all_veg ) + call this%pftoverride%InitAllPFTIndex() + @assertEqual( 0.0_r8, this%pftoverride%crop ) + @assertEqual( 100.0_r8, this%pftoverride%natveg ) + @assertEqual( 100.0_r8, sum(this%pftoverride%cft) ) + @assertEqual( 100.0_r8, sum(this%pftoverride%natpft) ) + @assertEqual( 100.0_r8, this%pftoverride%natpft(pftidx) ) + + end subroutine test_runSetpft + + @Test + subroutine test_runSetCrop(this) + class(TestPFTORide), intent(inout) :: this + integer :: cftidx + + cftidx = c3cropindex + pft_idx(0) = cftidx + pft_frc(0) = 100.0_r8 + call mkpftInit( zero_out, all_veg ) + call this%pftoverride%InitAllPFTIndex() + @assertEqual( 100.0_r8, this%pftoverride%crop ) + @assertEqual( 0.0_r8, this%pftoverride%natveg ) + @assertEqual( 100.0_r8, sum(this%pftoverride%cft) ) + @assertEqual( 100.0_r8, sum(this%pftoverride%natpft) ) + @assertEqual( 100.0_r8, this%pftoverride%cft(numpft-cftidx) ) + + end subroutine test_runSetCrop + end module test_pft_oride diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 8437c97fa7..2b706c5be6 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -7,7 +7,8 @@ module test_pftrun use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod use mkvarctl, only: numpft - use mkpftConstantsMod, only: maxpft + use mkvarpar, only: numstdpft + use mkpftConstantsMod, only: maxpft, c3cropindex, c3irrcropindex use mkpctPftTypeMod , only : pct_pft_type use mkdomainMod , only : domain_type, for_test_create_domain, domain_clean @@ -37,7 +38,7 @@ contains class(TestMkPFTRun), intent(inout) :: this integer :: ns_o - numpft = 16 + numpft = numstdpft pft_idx(0:maxpft) = -1 pft_frc(0:maxpft) = 0.0_r8 this%ndiag = 6 @@ -129,8 +130,10 @@ contains class(TestMkPFTRun), intent(inout) :: this logical :: zero_out, all_veg integer :: n - integer, parameter :: pftidx = 1, cftidx = 15 + integer :: cftidx + integer, parameter :: pftidx = 1 + cftidx = c3cropindex zero_out = .false. @assertLessThan( pftidx, numstdpft-numstdcft+1 ) @assertGreaterThan( cftidx, numstdpft-numstdcft ) @@ -162,8 +165,11 @@ contains class(TestMkPFTRun), intent(inout) :: this logical :: zero_out, all_veg integer :: n - integer, parameter :: pftidx = 1, pftidx2 = 2, cftidx = 15, cftidx2 = 16 + integer :: cftidx, cftidx2 + integer, parameter :: pftidx = 1, pftidx2 = 2 + cftidx = c3cropindex + cftidx2 = c3irrcropindex zero_out = .false. @assertLessThan( pftidx, numstdpft-numstdcft+1 ) @assertLessThan( pftidx2, numstdpft-numstdcft+1 ) From 6f25e7915ee03b9cbac8816d5af3abb36f1d7545 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2019 17:12:13 -0600 Subject: [PATCH 522/730] Add a mixed crop and nat-veg test for 4 total --- .../src/test/mkpftmod_test/test_pft_oride.pf | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf index 926b84f511..00db6b1f03 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf @@ -8,7 +8,7 @@ module test_pft_oride use mkpftMod use mkvarctl, only : numpft use mkvarpar, only : numstdpft - use mkpftConstantsMod, only : c3cropindex + use mkpftConstantsMod, only : c3cropindex, c3irrcropindex implicit none save @@ -47,6 +47,7 @@ contains subroutine test_runmkpftZero(this) class(TestPFTORide), intent(inout) :: this + zero_out = .true. call mkpftInit( zero_out, all_veg ) call this%pftoverride%InitZeroOut() @assertEqual( 0.0_r8, this%pftoverride%crop ) @@ -63,6 +64,7 @@ contains pft_idx(0) = pftidx pft_frc(0) = 100.0_r8 + zero_out = .false. call mkpftInit( zero_out, all_veg ) call this%pftoverride%InitAllPFTIndex() @assertEqual( 0.0_r8, this%pftoverride%crop ) @@ -81,6 +83,7 @@ contains cftidx = c3cropindex pft_idx(0) = cftidx pft_frc(0) = 100.0_r8 + zero_out = .false. call mkpftInit( zero_out, all_veg ) call this%pftoverride%InitAllPFTIndex() @assertEqual( 100.0_r8, this%pftoverride%crop ) @@ -91,4 +94,29 @@ contains end subroutine test_runSetCrop + @Test + subroutine test_runSetMix(this) + class(TestPFTORide), intent(inout) :: this + integer :: cftidx, cftidx2, pftidx2 + integer, parameter :: pftidx = 1 + + zero_out = .false. + pftidx2 = c3cropindex-1 + cftidx = c3cropindex + cftidx2 = c3irrcropindex + pft_idx(0:3) = (/ pftidx, pftidx2, cftidx, cftidx2 /) + pft_frc(0:3) = (/ 25.0_r8, 25.0_r8, 25.0_r8, 25.0_r8 /) + call mkpftInit( zero_out, all_veg ) + call this%pftoverride%InitAllPFTIndex() + @assertEqual( 50.0_r8, this%pftoverride%crop ) + @assertEqual( 50.0_r8, this%pftoverride%natveg ) + @assertEqual( 100.0_r8, sum(this%pftoverride%cft) ) + @assertEqual( 100.0_r8, sum(this%pftoverride%natpft) ) + @assertEqual( 50.0_r8, this%pftoverride%natpft(pftidx) ) + @assertEqual( 50.0_r8, this%pftoverride%natpft(pftidx2) ) + @assertEqual( 50.0_r8, this%pftoverride%cft(1) ) + @assertEqual( 50.0_r8, this%pftoverride%cft(2) ) + + end subroutine test_runSetMix + end module test_pft_oride From 303e2331d8c58343bb8d7fd79eb73e7d68331787 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 13:27:39 -0600 Subject: [PATCH 523/730] Add PFT override object and set it inside the mkpftInit --- tools/mksurfdata_map/src/mkpftMod.F90 | 81 +++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 10 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 6769e08f2d..4c85d8925f 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -66,6 +66,8 @@ module mkpftMod interface pft_oride module procedure :: constructor ! PFT Overide object constructor end interface pft_oride + + type(pft_oride), private :: pft_override ! Module instance of PFT override object ! ! !PRIVATE MEMBER FUNCTIONS: ! @@ -112,7 +114,11 @@ subroutine mkpftInit( zero_out_l, all_veg ) call abort() return end if - call mkpft_check_oride( ) + nzero = -1 + if ( mkpft_check_oride( ) )then + write(6,*) subname//'Problem setting pft override settings' + return + end if if ( use_input_pft ) then write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) write(6,*) 'With PFT index : ', pft_idx(0:nzero) @@ -158,6 +164,16 @@ subroutine mkpftInit( zero_out_l, all_veg ) call abort() return end if + ! + ! Set the PFT override values if applicable + ! + pft_override = pft_oride() + if( zero_out )then + call pft_override%InitZeroOut() + end if + if ( use_input_pft ) then + call pft_override%InitAllPFTIndex() + end if end subroutine mkpftInit @@ -346,6 +362,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & else write(6,*) subname//': parameter numpft is NOT set to a known value (should be 16 or more) =',numpft call abort() + return end if ! ----------------------------------------------------------------- @@ -375,6 +392,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & else write(6,*) subname//' ERROR: PCT_PFT field on the the file so it is in the old format, which is no longer supported' call abort() + return end if ! Check if the number of pfts on the input matches the expected number. A mismatch @@ -384,12 +402,14 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & write(6,*) subname//' ERROR: trying to use non-crop input file' write(6,*) 'for a surface dataset with crops.' call abort() + return else if (numpft_i > numstdpft+1 .and. numpft_i == maxpft+1 .and. .not. oldformat) then write(6,*) subname//' WARNING: using a crop input raw dataset for a non-crop output surface dataset' else write(6,*) subname//': parameter numpft+1= ',numpft+1, & 'does not equal input dataset numpft= ',numpft_i call abort() + return end if endif @@ -406,7 +426,10 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & pct_nat_pft_i(ns_i,0:num_natpft), & pct_nat_pft_o(ns_o,0:num_natpft), & stat=ier) - if (ier/=0) call abort() + if (ier/=0)then + call abort() + return + end if call check_ret(nf_inq_varid (ncid, 'PCT_NATVEG', varid), subname) call check_ret(nf_get_var_double (ncid, varid, pctnatveg_i), subname) @@ -431,6 +454,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & else write(6,*) subname//': ERROR: dimensions for PCT_CROP are NOT what is expected' call abort() + return end if call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) @@ -444,7 +468,10 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ns_i = 1 numpft_i = numpft+1 allocate(pctpft_o(ns_o,0:numpft), stat=ier) - if (ier/=0) call abort() + if (ier/=0)then + call abort() + return + end if end if ! Determine pctpft_o on output grid @@ -462,7 +489,11 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & else if ( use_input_pft ) then - call mkpft_check_oride( ) + if ( mkpft_check_oride( ) )then + write(6,*) subname//'Problem setting pft override settings' + call abort() + return + end if ! set PFT based on input pft_frc and pft_idx pctpft_o(:,:) = 0._r8 @@ -622,7 +653,10 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & pctnatpft_i(ns_i), & pctcft_i(ns_i), & stat=ier) - if (ier/=0) call abort() + if (ier/=0)then + call abort() + return + end if do ni = 1, ns_i pctnatpft_i(ni) = pct_pft_type( pct_nat_pft_i(ni,:), pctnatveg_i(ni), first_pft_index=natpft_lb ) pctcft_i(ni) = pct_pft_type( pct_cft_i(ni,:), pctcrop_i(ni), first_pft_index=cft_lb ) @@ -764,6 +798,7 @@ subroutine mkpft_parse_oride( string ) if ( rc /= 0 )then write(6,*) subname//'Trouble finding pft_frac start end tags' call abort() + return end if num_elms = shr_string_countChar( substring, ",", rc ) read(substring,*) pft_frc(0:num_elms) @@ -771,10 +806,12 @@ subroutine mkpft_parse_oride( string ) if ( rc /= 0 )then write(6,*) subname//'Trouble finding pft_index start end tags' call abort() + return end if if ( num_elms /= shr_string_countChar( substring, ",", rc ) )then write(6,*) subname//'number of elements different between frc and idx fields' call abort() + return end if read(substring,*) pft_idx(0:num_elms) !----------------------------------------------------------------------- @@ -789,14 +826,14 @@ end subroutine mkpft_parse_oride ! !IROUTINE: mkpft_check_oride ! ! !INTERFACE: -subroutine mkpft_check_oride( ) +function mkpft_check_oride( ) result(error_happened) ! ! !DESCRIPTION: ! Check that the pft override values are valid ! !USES: -! -! !ARGUMENTS: implicit none +! !ARGUMENTS: + logical :: error_happened ! Result, true if there was a problem ! ! !REVISION HISTORY: ! Author: Erik Kluzek @@ -810,6 +847,7 @@ subroutine mkpft_check_oride( ) character(len=32) :: subname = 'mkpftMod::mkpft_check_oride() ' !----------------------------------------------------------------------- + error_happened = .false. sumpft = sum(pft_frc) if ( sumpft == 0.0 )then ! PFT fraction is NOT used @@ -818,6 +856,7 @@ subroutine mkpft_check_oride( ) write(6, '(a, a, f15.12)') trim(subname), 'Sum of PFT fraction is NOT equal to 100% =', sumpft write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) write(6,*) 'With PFT index : ', pft_idx(0:nzero) + error_happened = .true. call abort() return else @@ -833,16 +872,19 @@ subroutine mkpft_check_oride( ) do i = 0, nzero if ( pft_frc(i) < 0.0_r8 .or. pft_frc(i) > hndrd )then write(6,*) subname//'PFT fraction is out of range: pft_frc=', pft_frc(i) + error_happened = .true. call abort() return else if ( pft_frc(i) > 0.0_r8 .and. pft_idx(i) == -1 )then write(6,*) subname//'PFT fraction > zero, but index NOT set: pft_idx=', pft_idx(i) + error_happened = .true. call abort() return end if ! PFT index out of range if ( pft_idx(i) < 0 .or. pft_idx(i) > numpft )then write(6,*) subname//'PFT index is out of range: ', pft_idx(i) + error_happened = .true. call abort() return end if @@ -850,6 +892,7 @@ subroutine mkpft_check_oride( ) do j = 0, i-1 if ( pft_idx(i) == pft_idx(j) )then write(6,*) subname//'Same PFT index is used twice: ', pft_idx(i) + error_happened = .true. call abort() return end if @@ -859,13 +902,14 @@ subroutine mkpft_check_oride( ) do i = nzero+1, numpft if ( pft_frc(i) /= 0.0_r8 .or. pft_idx(i) /= -1 )then write(6,*) subname//'After PFT fraction is zeroed out, fraction is non zero, or index set' + error_happened = .true. call abort() return end if end do end if -end subroutine mkpft_check_oride +end function mkpft_check_oride !----------------------------------------------------------------------- !BOP @@ -1063,8 +1107,20 @@ function constructor( ) result(this) implicit none type(pft_oride) :: this !EOP + character(len=32) :: subname = 'mkpftMod::constructor() ' + this%crop = -1.0_r8 this%natveg = -1.0_r8 + if ( num_natpft < 0 )then + write(6,*) subname//'num_natpft is NOT set = ', num_natpft + call abort() + return + end if + if ( num_cft < 0 )then + write(6,*) subname//'num_cft is NOT set = ', num_cft + call abort() + return + end if allocate( this%natpft(noveg:num_natpft) ) allocate( this%cft(1:num_cft) ) this%natpft(:) = -1.0_r8 @@ -1115,6 +1171,7 @@ subroutine InitAllPFTIndex( this ) integer :: m, i ! Indices real(r8) :: croptot ! Total of crop real(r8) :: natvegtot ! Total of natural vegetation + character(len=32) :: subname = 'mkpftMod::coInitAllPFTIndex() ' croptot = 0.0_r8 natvegtot = 0.0_r8 @@ -1122,7 +1179,11 @@ subroutine InitAllPFTIndex( this ) this%cft = 0.0_r8 do m = noveg, nzero i = pft_idx(m) - if ( i <= num_natpft )then + if ( (i < noveg) .or. (i > numpft) )then + write(6,*) subname//'PFT index is out of valid range' + call abort() + return + else if ( i <= num_natpft )then this%natpft(i) = pft_frc(m) natvegtot = natvegtot + pft_frc(m) else From a82183b6dda8e3ff071f01991cd796fb4857a283 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 13:40:10 -0600 Subject: [PATCH 524/730] Handle error from mkpft_check_oride more clearly --- tools/mksurfdata_map/src/mkpftMod.F90 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 4c85d8925f..224f1e7614 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -107,6 +107,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) !EOP real(r8), parameter :: hndrd = 100.0_r8 ! A hundred percent character(len=32) :: subname = 'mkpftMod::mkpftInit() ' + logical :: error_happened ! If an error was triggered so should return !----------------------------------------------------------------------- write (6, '(a, a, a)') "In ", trim(subname), "..." if ( maxpft < numpft ) then @@ -115,7 +116,8 @@ subroutine mkpftInit( zero_out_l, all_veg ) return end if nzero = -1 - if ( mkpft_check_oride( ) )then + call mkpft_check_oride( error_happened ) + if ( error_happened )then write(6,*) subname//'Problem setting pft override settings' return end if @@ -170,8 +172,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) pft_override = pft_oride() if( zero_out )then call pft_override%InitZeroOut() - end if - if ( use_input_pft ) then + else if ( use_input_pft ) then call pft_override%InitAllPFTIndex() end if @@ -260,6 +261,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & integer :: ier ! error status real(r8) :: relerr = 0.0001_r8 ! max error: sum overlap wts ne 1 logical :: oldformat ! if input file is in the old format or not (based on what variables exist) + logical :: error_happened ! If an error was triggered so should return character(len=35) veg(0:maxpft) ! vegetation types character(len=32) :: subname = 'mkpftMod::mkpft()' @@ -489,7 +491,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & else if ( use_input_pft ) then - if ( mkpft_check_oride( ) )then + call mkpft_check_oride( error_happened ) + if ( error_happened )then write(6,*) subname//'Problem setting pft override settings' call abort() return @@ -826,14 +829,14 @@ end subroutine mkpft_parse_oride ! !IROUTINE: mkpft_check_oride ! ! !INTERFACE: -function mkpft_check_oride( ) result(error_happened) +subroutine mkpft_check_oride( error_happened ) ! ! !DESCRIPTION: ! Check that the pft override values are valid ! !USES: implicit none ! !ARGUMENTS: - logical :: error_happened ! Result, true if there was a problem + logical, intent(out) :: error_happened ! Result, true if there was a problem ! ! !REVISION HISTORY: ! Author: Erik Kluzek @@ -909,7 +912,7 @@ function mkpft_check_oride( ) result(error_happened) end do end if -end function mkpft_check_oride +end subroutine mkpft_check_oride !----------------------------------------------------------------------- !BOP From 27df3e2d620fc92fef7d7a7d88373906c38e8cb6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 14:40:31 -0600 Subject: [PATCH 525/730] Remove use of oldformat for zero_out and use_input_pft options --- tools/mksurfdata_map/src/mkpftMod.F90 | 103 +++++++++++--------------- 1 file changed, 42 insertions(+), 61 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 224f1e7614..4754996b15 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -154,7 +154,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) ! these are set up so that they always span 0:numpft, so that there is a 1:1 ! correspondence between an element in a full 0:numpft array and an element with the ! same index in either a natpft array or a cft array. - natpft_lb = 0 + natpft_lb = noveg natpft_ub = num_natpft cft_lb = num_natpft+1 cft_ub = cft_lb + num_cft - 1 @@ -466,15 +466,32 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call check_ret(nf_close(ncid), subname) else - oldformat = .true. + oldformat = .false. ns_i = 1 numpft_i = numpft+1 - allocate(pctpft_o(ns_o,0:numpft), stat=ier) + allocate(pctnatveg_i(ns_i), & + pctnatveg_o(ns_o), & + pctcrop_i(ns_i), & + pctcrop_o(ns_o), & + pct_cft_i(ns_i,1:num_cft), & + pct_cft_o(ns_o,1:num_cft), & + pct_nat_pft_i(ns_i,0:num_natpft), & + pct_nat_pft_o(ns_o,0:num_natpft), & + stat=ier) if (ier/=0)then call abort() return end if end if + allocate(pctpft_i(ns_i,0:(numpft_i-1)), & + pctpft_o(ns_o,0:(numpft_i-1)), & + pctnatpft_i(ns_i), & + pctcft_i(ns_i), & + stat=ier) + if (ier/=0)then + call abort() + return + end if ! Determine pctpft_o on output grid @@ -498,15 +515,14 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & return end if - ! set PFT based on input pft_frc and pft_idx - pctpft_o(:,:) = 0._r8 - pctlnd_o(:) = 100._r8 - do m = 0, numpft - ! Once reach a PFT where fraction goes to zero -- exit - if ( pft_frc(m) .eq. 0.0_r8 ) exit - do no = 1,ns_o - pctpft_o(no,pft_idx(m)) = pft_frc(m) - end do + do no = 1,ns_o + pctlnd_o(no) = 100._r8 + pctnatveg_o(no) = pft_override%natveg + pctcrop_o(no) = pft_override%crop + pct_nat_pft_o(no,noveg:num_natpft) = pft_override%natpft(noveg:num_natpft) + pct_cft_o(no,1:num_cft) = pft_override%cft(1:num_cft) + pctpft_o(no,natpft_lb:natpft_ub) = pct_nat_pft_o(no,0:num_natpft) + pctpft_o(no,cft_lb:cft_ub) = pct_cft_o(no,1:num_cft) end do else @@ -569,27 +585,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Also correct sums so that if they differ slightly from 100, they are corrected to ! equal 100 more exactly. - if ( (.not. zero_out) .and. oldformat) then - do no = 1,ns_o - wst_sum = 0. - do m = 0, numpft_i - 1 - wst_sum = wst_sum + pctpft_o(no,m) - enddo - if (abs(wst_sum-100._r8) > relerr) then - write (6,*) subname//'error: pft = ', & - (pctpft_o(no,m), m = 0, numpft_i-1), & - ' do not sum to 100. at no = ',no,' but to ', wst_sum - stop - end if - - ! Correct sum so that if it differs slightly from 100, it is corrected to equal - ! 100 more exactly - do m = 0, numpft_i - 1 - pctpft_o(no,m) = pctpft_o(no,m) * 100._r8 / wst_sum - end do - - end do - else if ( (.not. zero_out) .and. (.not. oldformat) ) then + if ( (.not. zero_out) .and. (.not. oldformat) ) then do no = 1,ns_o wst_sum = 0. do m = 0, num_natpft @@ -636,10 +632,8 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & pctcft_o(no) = pct_pft_type( pct_cft_o(no,:), pctcrop_o(no), first_pft_index=cft_lb ) end do else - do no = 1,ns_o - call convert_from_p2g(pct_p2g=pctpft_o(no,:), & - pctnatpft=pctnatpft_o(no), pctcft=pctcft_o(no)) - end do + write(6,*) "oldformat and should NOT be" + call abort() end if ! ----------------------------------------------------------------- @@ -651,15 +645,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Convert to pctpft over grid if using new format if ( .not. oldformat ) then - allocate(pctpft_i(ns_i,0:(numpft_i-1)), & - pctpft_o(ns_o,0:(numpft_i-1)), & - pctnatpft_i(ns_i), & - pctcft_i(ns_i), & - stat=ier) - if (ier/=0)then - call abort() - return - end if do ni = 1, ns_i pctnatpft_i(ni) = pct_pft_type( pct_nat_pft_i(ni,:), pctnatveg_i(ni), first_pft_index=natpft_lb ) pctcft_i(ni) = pct_pft_type( pct_cft_i(ni,:), pctcrop_i(ni), first_pft_index=cft_lb ) @@ -719,27 +704,23 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call shr_sys_flush(ndiag) deallocate(gpft_i, gpft_o) - if ( .not. oldformat ) then - deallocate(pctpft_o) - end if end if + deallocate( pctnatpft_i ) + deallocate( pctcft_i ) + deallocate(pctpft_o) ! Deallocate dynamic memory - if ( .not. oldformat ) then - deallocate(pctnatveg_i) - deallocate(pctnatveg_o) - deallocate(pctcrop_i) - deallocate(pctcrop_o) - deallocate(pct_cft_i) - deallocate(pct_cft_o) - deallocate(pct_nat_pft_i) - deallocate(pct_nat_pft_o) - else - deallocate(pctpft_o) - end if + deallocate(pctnatveg_i) + deallocate(pctnatveg_o) + deallocate(pctcrop_i) + deallocate(pctcrop_o) + deallocate(pct_cft_i) + deallocate(pct_cft_o) + deallocate(pct_nat_pft_i) + deallocate(pct_nat_pft_o) if ( .not. zero_out .and. .not. use_input_pft ) then call domain_clean(tdomain) call gridmap_clean(tgridmap) From d9d52ccc28e9e2b9cc0105c3b3ac9a64f55ecb24 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 14:49:48 -0600 Subject: [PATCH 526/730] Remove oldformat option except on read of file followed by an abort if true --- tools/mksurfdata_map/src/mkpftMod.F90 | 175 ++++++++++++-------------- 1 file changed, 80 insertions(+), 95 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 4754996b15..676db2cc32 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -405,7 +405,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & write(6,*) 'for a surface dataset with crops.' call abort() return - else if (numpft_i > numstdpft+1 .and. numpft_i == maxpft+1 .and. .not. oldformat) then + else if (numpft_i > numstdpft+1 .and. numpft_i == maxpft+1) then write(6,*) subname//' WARNING: using a crop input raw dataset for a non-crop output surface dataset' else write(6,*) subname//': parameter numpft+1= ',numpft+1, & @@ -418,55 +418,51 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! If file is in the new format, expect the following variables: ! PCT_NATVEG, PCT_CROP, PCT_NAT_PFT, PCT_CFT - if ( .not. oldformat )then - allocate(pctnatveg_i(ns_i), & - pctnatveg_o(ns_o), & - pctcrop_i(ns_i), & - pctcrop_o(ns_o), & - pct_cft_i(ns_i,1:num_cft), & - pct_cft_o(ns_o,1:num_cft), & - pct_nat_pft_i(ns_i,0:num_natpft), & - pct_nat_pft_o(ns_o,0:num_natpft), & - stat=ier) - if (ier/=0)then - call abort() - return - end if + allocate(pctnatveg_i(ns_i), & + pctnatveg_o(ns_o), & + pctcrop_i(ns_i), & + pctcrop_o(ns_o), & + pct_cft_i(ns_i,1:num_cft), & + pct_cft_o(ns_o,1:num_cft), & + pct_nat_pft_i(ns_i,0:num_natpft), & + pct_nat_pft_o(ns_o,0:num_natpft), & + stat=ier) + if (ier/=0)then + call abort() + return + end if - call check_ret(nf_inq_varid (ncid, 'PCT_NATVEG', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, pctnatveg_i), subname) - call check_ret(nf_inq_varid (ncid, 'PCT_CROP', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, pctcrop_i), subname) - call check_ret(nf_inq_varid (ncid, 'PCT_CFT', varid), subname) - call get_dim_lengths(ncid, 'PCT_CFT', ndims, dimlens(:) ) - if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) == num_cft )then - call check_ret(nf_get_var_double (ncid, varid, pct_cft_i), subname) - else if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) > num_cft )then - ! Read in the whole array: then sum the rainfed and irrigated - ! seperately - allocate( temp_i(ns_i,dimlens(3)) ) - call check_ret(nf_get_var_double (ncid, varid, temp_i), subname) - do n = 1, num_cft - pct_cft_i(:,n) = 0.0_r8 - do m = n, dimlens(3), 2 - pct_cft_i(:,n) = pct_cft_i(:,n) + temp_i(:,m) - end do + call check_ret(nf_inq_varid (ncid, 'PCT_NATVEG', varid), subname) + call check_ret(nf_get_var_double (ncid, varid, pctnatveg_i), subname) + call check_ret(nf_inq_varid (ncid, 'PCT_CROP', varid), subname) + call check_ret(nf_get_var_double (ncid, varid, pctcrop_i), subname) + call check_ret(nf_inq_varid (ncid, 'PCT_CFT', varid), subname) + call get_dim_lengths(ncid, 'PCT_CFT', ndims, dimlens(:) ) + if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) == num_cft )then + call check_ret(nf_get_var_double (ncid, varid, pct_cft_i), subname) + else if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) > num_cft )then + ! Read in the whole array: then sum the rainfed and irrigated + ! seperately + allocate( temp_i(ns_i,dimlens(3)) ) + call check_ret(nf_get_var_double (ncid, varid, temp_i), subname) + do n = 1, num_cft + pct_cft_i(:,n) = 0.0_r8 + do m = n, dimlens(3), 2 + pct_cft_i(:,n) = pct_cft_i(:,n) + temp_i(:,m) end do - deallocate( temp_i ) - else - write(6,*) subname//': ERROR: dimensions for PCT_CROP are NOT what is expected' - call abort() - return - end if - call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) - + end do + deallocate( temp_i ) + else + write(6,*) subname//': ERROR: dimensions for PCT_CROP are NOT what is expected' + call abort() + return end if + call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) + call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) call check_ret(nf_close(ncid), subname) else - oldformat = .false. ns_i = 1 numpft_i = numpft+1 allocate(pctnatveg_i(ns_i), & @@ -545,39 +541,35 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & end do ! New format with extra variables on input - if ( .not. oldformat ) then - call gridmap_areaave(tgridmap, pctnatveg_i, pctnatveg_o, nodata=0._r8) - call gridmap_areaave(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8) + call gridmap_areaave(tgridmap, pctnatveg_i, pctnatveg_o, nodata=0._r8) + call gridmap_areaave(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8) - do m = 0, num_natpft - call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), & - nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) - do no = 1,ns_o - if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then - if (m == 0) then - pct_nat_pft_o(no,m) = 100._r8 - else - pct_nat_pft_o(no,m) = 0._r8 - endif - end if - enddo - end do - do m = 1, num_cft - call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), & - nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) - do no = 1,ns_o - if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then - if (m == 1) then - pct_cft_o(no,m) = 100._r8 - else - pct_cft_o(no,m) = 0._r8 - endif - end if - enddo - end do - ! Old format with just PCTPFT - else - end if + do m = 0, num_natpft + call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), & + nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) + do no = 1,ns_o + if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then + if (m == 0) then + pct_nat_pft_o(no,m) = 100._r8 + else + pct_nat_pft_o(no,m) = 0._r8 + endif + end if + enddo + end do + do m = 1, num_cft + call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), & + nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) + do no = 1,ns_o + if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then + if (m == 1) then + pct_cft_o(no,m) = 100._r8 + else + pct_cft_o(no,m) = 0._r8 + endif + end if + enddo + end do end if @@ -585,7 +577,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Also correct sums so that if they differ slightly from 100, they are corrected to ! equal 100 more exactly. - if ( (.not. zero_out) .and. (.not. oldformat) ) then + if ( .not. zero_out )then do no = 1,ns_o wst_sum = 0. do m = 0, num_natpft @@ -626,15 +618,10 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Convert % pft as % of grid cell to % pft on the landunit and % of landunit on the ! grid cell - if ( .not. oldformat ) then - do no = 1,ns_o - pctnatpft_o(no) = pct_pft_type( pct_nat_pft_o(no,:), pctnatveg_o(no), first_pft_index=natpft_lb ) - pctcft_o(no) = pct_pft_type( pct_cft_o(no,:), pctcrop_o(no), first_pft_index=cft_lb ) - end do - else - write(6,*) "oldformat and should NOT be" - call abort() - end if + do no = 1,ns_o + pctnatpft_o(no) = pct_pft_type( pct_nat_pft_o(no,:), pctnatveg_o(no), first_pft_index=natpft_lb ) + pctcft_o(no) = pct_pft_type( pct_cft_o(no,:), pctcrop_o(no), first_pft_index=cft_lb ) + end do ! ----------------------------------------------------------------- ! Error check @@ -644,17 +631,15 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & if ( .not. (zero_out .or. use_input_pft) ) then ! Convert to pctpft over grid if using new format - if ( .not. oldformat ) then - do ni = 1, ns_i - pctnatpft_i(ni) = pct_pft_type( pct_nat_pft_i(ni,:), pctnatveg_i(ni), first_pft_index=natpft_lb ) - pctcft_i(ni) = pct_pft_type( pct_cft_i(ni,:), pctcrop_i(ni), first_pft_index=cft_lb ) - end do + do ni = 1, ns_i + pctnatpft_i(ni) = pct_pft_type( pct_nat_pft_i(ni,:), pctnatveg_i(ni), first_pft_index=natpft_lb ) + pctcft_i(ni) = pct_pft_type( pct_cft_i(ni,:), pctcrop_i(ni), first_pft_index=cft_lb ) + end do - do no = 1,ns_o - pctpft_o(no,natpft_lb:natpft_ub) = pctnatpft_o(no)%get_pct_p2g() - pctpft_o(no,cft_lb:cft_ub) = pctcft_o(no)%get_pct_p2g() - end do - end if + do no = 1,ns_o + pctpft_o(no,natpft_lb:natpft_ub) = pctnatpft_o(no)%get_pct_p2g() + pctpft_o(no,cft_lb:cft_ub) = pctcft_o(no)%get_pct_p2g() + end do allocate(gpft_i(0:numpft_i-1)) allocate(gpft_o(0:numpft_i-1)) From cee61f50b8753a209daaf72639bd96aa0d9c3d5c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 16:41:47 -0600 Subject: [PATCH 527/730] Remove global zero_out, and use PFT oride settings to set PFT's as a special case of use_input_pft, make all_veg a local input to mkpftInit and create a global one that is set in mkpftInit, also add it to the namelist --- tools/mksurfdata_map/mksurfdata.pl | 1 + tools/mksurfdata_map/src/mkpftMod.F90 | 135 ++++++++---------- tools/mksurfdata_map/src/mksurfdat.F90 | 3 + .../src/test/mkpftmod_test/test_pftInit.pf | 24 +++- .../src/test/mkpftmod_test/test_pft_oride.pf | 17 ++- .../src/test/mkpftmod_test/test_pftrun.pf | 30 ++-- 6 files changed, 112 insertions(+), 98 deletions(-) diff --git a/tools/mksurfdata_map/mksurfdata.pl b/tools/mksurfdata_map/mksurfdata.pl index 4cc838a532..0e45ed717d 100755 --- a/tools/mksurfdata_map/mksurfdata.pl +++ b/tools/mksurfdata_map/mksurfdata.pl @@ -390,6 +390,7 @@ sub write_namelist_file { } if ( defined($opts{'pft_override'}) ) { print $fh <<"EOF"; + all_veg = .true. pft_frc = $opts{'pft_frc'} pft_idx = $opts{'pft_idx'} EOF diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 676db2cc32..57c7479e7b 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -48,11 +48,11 @@ module mkpftMod ! ! !PRIVATE DATA MEMBERS: ! - logical, private :: zero_out = .false. ! Flag to zero out PFT logical, public, protected :: use_input_pft = .false. ! Flag to override PFT with input values + logical, public, protected :: all_veg = .false. ! Flag to override all areas with vegetated PFT's integer, private :: nzero ! index of first zero fraction - type, public :: pft_oride + type, public :: pft_oride ! Public only for unit testing real(r8) :: crop ! Percent covered by crops real(r8) :: natveg ! Percent covered by natural vegetation real(r8), allocatable :: natpft(:) ! Percent of each natural PFT within the natural veg landunit @@ -68,6 +68,8 @@ module mkpftMod end interface pft_oride type(pft_oride), private :: pft_override ! Module instance of PFT override object + ! Used for both zeroing out PFT's as well + ! as setting specified PFT's over the gridcell ! ! !PRIVATE MEMBER FUNCTIONS: ! @@ -83,7 +85,7 @@ module mkpftMod ! !IROUTINE: mkpftInit ! ! !INTERFACE: -subroutine mkpftInit( zero_out_l, all_veg ) +subroutine mkpftInit( zero_out_l, all_veg_l ) ! ! !DESCRIPTION: ! Initialize of Make PFT data @@ -92,9 +94,9 @@ subroutine mkpftInit( zero_out_l, all_veg ) ! ! !ARGUMENTS: implicit none - logical, intent(IN) :: zero_out_l ! If veg should be zero'ed out - logical, intent(OUT) :: all_veg ! If should zero out other fractions so that - ! all land-cover is vegetation + logical, intent(IN) :: zero_out_l ! If veg should be zero'ed out + logical, intent(IN) :: all_veg_l ! If should zero out other fractions so that + ! all land-cover is vegetation ! ! !CALLED FROM: ! subroutine mksrfdat in module mksrfdatMod @@ -121,12 +123,28 @@ subroutine mkpftInit( zero_out_l, all_veg ) write(6,*) subname//'Problem setting pft override settings' return end if + if ( zero_out_l .and. use_input_pft )then + write(6,*) subname//"trying to both zero out all PFT's as well as set them to specific values" + call abort() + return + end if + ! If zeroing out, set use_input_pft to true so the pft_override will be used + if( zero_out_l )then + nzero = 0 + pft_frc(0) = 0.0_r8 + pft_idx(0) = noveg + use_input_pft = .true. + end if if ( use_input_pft ) then write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) write(6,*) 'With PFT index : ', pft_idx(0:nzero) end if - - all_veg = use_input_pft + all_veg = all_veg_l + if ( all_veg .and. .not. use_input_pft )then + write(6,*) subname//'if all_veg is set to true then specified PFT indices must be provided (i.e. pft_frc and pft_idx)' + call abort() + return + end if if ( zero_out_l .and. all_veg )then write(6,*) subname//'zeroing out vegetation and setting vegetation to 100% is a contradiction!' @@ -134,9 +152,6 @@ subroutine mkpftInit( zero_out_l, all_veg ) return end if - ! Copy local zero out to module data version - zero_out = zero_out_l - ! Determine number of PFTs on the natural vegetation landunit, and number of CFTs on ! the crop landunit. ! @@ -170,7 +185,7 @@ subroutine mkpftInit( zero_out_l, all_veg ) ! Set the PFT override values if applicable ! pft_override = pft_oride() - if( zero_out )then + if( zero_out_l )then call pft_override%InitZeroOut() else if ( use_input_pft ) then call pft_override%InitAllPFTIndex() @@ -373,7 +388,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ns_o = ldomain%ns - if ( .not. (zero_out .or. use_input_pft) ) then + if ( .not. use_input_pft ) then ! Obtain input grid info, read PCT_PFT call domain_read(tdomain,fpft) @@ -491,25 +506,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Determine pctpft_o on output grid - if ( zero_out ) then - - pctpft_o(:,:) = 0._r8 - pctlnd_o(:) = 100._r8 - pctnatveg_o(:) = 0._r8 - pctcrop_o(:) = 0._r8 - pct_nat_pft_o(:,:) = 0._r8 - pct_nat_pft_o(:,0) = 100._r8 - pct_cft_o(:,:) = 0._r8 - pct_cft_o(:,1) = 100._r8 - - else if ( use_input_pft ) then - - call mkpft_check_oride( error_happened ) - if ( error_happened )then - write(6,*) subname//'Problem setting pft override settings' - call abort() - return - end if + if ( use_input_pft ) then do no = 1,ns_o pctlnd_o(no) = 100._r8 @@ -577,44 +574,42 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Also correct sums so that if they differ slightly from 100, they are corrected to ! equal 100 more exactly. - if ( .not. zero_out )then - do no = 1,ns_o - wst_sum = 0. - do m = 0, num_natpft - wst_sum = wst_sum + pct_nat_pft_o(no,m) - enddo - if (abs(wst_sum-100._r8) > relerr) then - write (6,*) subname//'error: nat pft = ', & - (pct_nat_pft_o(no,m), m = 0, num_natpft), & - ' do not sum to 100. at no = ',no,' but to ', wst_sum - stop - end if - - ! Correct sum so that if it differs slightly from 100, it is corrected to equal - ! 100 more exactly - do m = 1, num_natpft - pct_nat_pft_o(no,m) = pct_nat_pft_o(no,m) * 100._r8 / wst_sum - end do + do no = 1,ns_o + wst_sum = 0. + do m = 0, num_natpft + wst_sum = wst_sum + pct_nat_pft_o(no,m) + enddo + if (abs(wst_sum-100._r8) > relerr) then + write (6,*) subname//'error: nat pft = ', & + (pct_nat_pft_o(no,m), m = 0, num_natpft), & + ' do not sum to 100. at no = ',no,' but to ', wst_sum + stop + end if - wst_sum = 0. - do m = 1, num_cft - wst_sum = wst_sum + pct_cft_o(no,m) - enddo - if (abs(wst_sum-100._r8) > relerr) then - write (6,*) subname//'error: crop cft = ', & - (pct_cft_o(no,m), m = 1, num_cft), & - ' do not sum to 100. at no = ',no,' but to ', wst_sum - stop - end if + ! Correct sum so that if it differs slightly from 100, it is corrected to equal + ! 100 more exactly + do m = 1, num_natpft + pct_nat_pft_o(no,m) = pct_nat_pft_o(no,m) * 100._r8 / wst_sum + end do - ! Correct sum so that if it differs slightly from 100, it is corrected to equal - ! 100 more exactly - do m = 1, num_cft - pct_cft_o(no,m) = pct_cft_o(no,m) * 100._r8 / wst_sum - end do + wst_sum = 0. + do m = 1, num_cft + wst_sum = wst_sum + pct_cft_o(no,m) + enddo + if (abs(wst_sum-100._r8) > relerr) then + write (6,*) subname//'error: crop cft = ', & + (pct_cft_o(no,m), m = 1, num_cft), & + ' do not sum to 100. at no = ',no,' but to ', wst_sum + stop + end if + ! Correct sum so that if it differs slightly from 100, it is corrected to equal + ! 100 more exactly + do m = 1, num_cft + pct_cft_o(no,m) = pct_cft_o(no,m) * 100._r8 / wst_sum end do - end if + + end do ! Convert % pft as % of grid cell to % pft on the landunit and % of landunit on the ! grid cell @@ -628,7 +623,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Compare global areas on input and output grids ! ----------------------------------------------------------------- - if ( .not. (zero_out .or. use_input_pft) ) then + if ( .not. use_input_pft ) then ! Convert to pctpft over grid if using new format do ni = 1, ns_i @@ -706,7 +701,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & deallocate(pct_cft_o) deallocate(pct_nat_pft_i) deallocate(pct_nat_pft_o) - if ( .not. zero_out .and. .not. use_input_pft ) then + if ( .not. use_input_pft ) then call domain_clean(tdomain) call gridmap_clean(tgridmap) end if @@ -947,10 +942,6 @@ subroutine mkpftAtt( ncid, dynlanduse, xtype ) str = 'TRUE' call check_ret(nf_put_att_text (ncid, NF_GLOBAL, & 'pft_override', len_trim(str), trim(str)), subname) - else if ( zero_out )then - str = 'TRUE' - call check_ret(nf_put_att_text (ncid, NF_GLOBAL, & - 'zero_out_pft_override', len_trim(str), trim(str)), subname) else str = get_filename(mksrf_fvegtyp) call check_ret(nf_put_att_text(ncid, NF_GLOBAL, & diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index c341744573..2aa73c43b5 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -180,6 +180,7 @@ program mksurfdat soil_fmax, & soil_clay, & pft_idx, & + all_veg, & pft_frc, & all_urban, & no_inlandwet, & @@ -287,6 +288,7 @@ program mksurfdat ! Optional settings to change values for entire area ! ====================================== ! all_urban --------- If entire area is urban + ! all_veg ----------- If entire area is to be vegetated (pft_idx and pft_frc then required) ! no_inlandwet ------ If wetland should be set to 0% over land ! soil_color -------- If you want to change the soil_color to this value everywhere ! soil_clay --------- If you want to change the soil_clay % to this value everywhere @@ -310,6 +312,7 @@ program mksurfdat outnc_vic = .false. outnc_3dglc = .false. all_urban = .false. + all_veg = .false. no_inlandwet = .true. ! default value for bug work around diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf index cd3684d3b6..ad34ca16a1 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf @@ -7,7 +7,7 @@ module test_pftInit use shr_kind_mod, only : r8 => shr_kind_r8 use mkpftMod use mkvarctl, only: numpft - use mkvarpar, only: numstdpft + use mkvarpar, only: numstdpft, noveg use mkpftConstantsMod, only: maxpft implicit none @@ -40,9 +40,9 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .false. call mkpftInit( zero_out, all_veg ) @assertFalse( use_input_pft ) - @assertFalse( all_veg ) end subroutine test_runmkpftInit @@ -52,9 +52,11 @@ contains logical :: zero_out, all_veg zero_out = .true. + all_veg = .false. call mkpftInit( zero_out, all_veg ) - @assertFalse( use_input_pft ) - @assertFalse( all_veg ) + @assertTrue( use_input_pft ) + @assertEqual( pft_idx(0), noveg ) + @assertEqual( pft_frc(0), 0.0_r8 ) end subroutine test_runmkpftInitZero @@ -66,9 +68,9 @@ contains zero_out = .false. pft_idx(0) = 1 pft_frc(0) = 100._r8 + all_veg = .true. call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) end subroutine test_runmkpftInitPftORide @@ -82,9 +84,9 @@ contains numpft = maxpft pft_idx(0) = 17 pft_frc(0) = 100._r8 + all_veg = .true. call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) end subroutine test_runmkpftInitPftORideCrop @@ -103,9 +105,9 @@ contains end do pft_frc(numpft) = 100._r8 - sum(pft_frc(0:numpft-1)) @assertEqual( 100.0_r8, sum(pft_frc) ) + all_veg = .true. call mkpftInit( zero_out, all_veg ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) end subroutine test_runmkpftInitPftORideAll @@ -118,6 +120,7 @@ contains numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 + all_veg = .true. call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -129,6 +132,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0) = 99._r8 @@ -143,6 +147,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = numstdpft pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 @@ -157,6 +162,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = maxpft pft_idx(0:1) = (/ numstdpft+1, numstdpft+2 /) pft_frc(0:1) = (/ 101._r8, -1._r8 /) @@ -171,6 +177,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = 79 call mkpftInit( zero_out, all_veg ) @assertExceptionRaised( "ABORTED:" ) @@ -183,6 +190,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0:1) = (/ 99._r8, 1._r8 /) @@ -197,6 +205,7 @@ contains logical :: zero_out, all_veg zero_out = .false. + all_veg = .true. numpft = maxpft pft_idx(0:1) = (/ 17, 17 /) pft_frc(0:1) = (/ 99._r8, 1._r8 /) @@ -212,6 +221,7 @@ contains zero_out = .false. numpft = maxpft + all_veg = .true. pft_idx(0:2) = (/ 17, -1, 18 /) pft_frc(0:2) = (/ 99._r8, 0.0_r8, 1._r8 /) call mkpftInit( zero_out, all_veg ) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf index 00db6b1f03..97cfc66d1e 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pft_oride.pf @@ -21,7 +21,7 @@ module test_pft_oride procedure :: tearDown end type TestPFTORide - logical :: zero_out, all_veg + logical :: zero_out, all_veg_l contains @@ -32,7 +32,8 @@ contains pft_frc(:) = 0.0_r8 zero_out = .false. numpft = numstdpft - call mkpftInit( zero_out, all_veg ) + all_veg_l = .false. + call mkpftInit( zero_out, all_veg_l ) this%pftoverride = pft_oride( ) end subroutine setUp @@ -48,7 +49,8 @@ contains class(TestPFTORide), intent(inout) :: this zero_out = .true. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .false. + call mkpftInit( zero_out, all_veg_l ) call this%pftoverride%InitZeroOut() @assertEqual( 0.0_r8, this%pftoverride%crop ) @assertEqual( 0.0_r8, this%pftoverride%natveg ) @@ -65,7 +67,8 @@ contains pft_idx(0) = pftidx pft_frc(0) = 100.0_r8 zero_out = .false. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out, all_veg_l ) call this%pftoverride%InitAllPFTIndex() @assertEqual( 0.0_r8, this%pftoverride%crop ) @assertEqual( 100.0_r8, this%pftoverride%natveg ) @@ -84,7 +87,8 @@ contains pft_idx(0) = cftidx pft_frc(0) = 100.0_r8 zero_out = .false. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out, all_veg_l ) call this%pftoverride%InitAllPFTIndex() @assertEqual( 100.0_r8, this%pftoverride%crop ) @assertEqual( 0.0_r8, this%pftoverride%natveg ) @@ -106,7 +110,8 @@ contains cftidx2 = c3irrcropindex pft_idx(0:3) = (/ pftidx, pftidx2, cftidx, cftidx2 /) pft_frc(0:3) = (/ 25.0_r8, 25.0_r8, 25.0_r8, 25.0_r8 /) - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out, all_veg_l ) call this%pftoverride%InitAllPFTIndex() @assertEqual( 50.0_r8, this%pftoverride%crop ) @assertEqual( 50.0_r8, this%pftoverride%natveg ) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index 2b706c5be6..d08eb2fd3e 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -69,13 +69,14 @@ contains @Test subroutine test_runmkpftZero(this) class(TestMkPFTRun), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out, all_veg_l integer :: n zero_out = .true. - call mkpftInit( zero_out, all_veg ) - @assertFalse( use_input_pft ) - @assertFalse( all_veg ) + all_veg_l = .false. + call mkpftInit( zero_out, all_veg_l ) + @assertTrue( use_input_pft ) + @assertFalse( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -96,16 +97,17 @@ contains @Test subroutine test_runmkpftPftORide(this) class(TestMkPFTRun), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out, all_veg_l integer :: n integer, parameter :: pftidx = 1 zero_out = .false. + all_veg_l = .true. pft_idx(0) = pftidx pft_frc(0) = 100._r8 - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -128,20 +130,21 @@ contains subroutine test_runmkpftPftORideWCrop(this) use mkvarpar, only: numstdpft, numstdcft class(TestMkPFTRun), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out, all_veg_l integer :: n integer :: cftidx integer, parameter :: pftidx = 1 cftidx = c3cropindex zero_out = .false. + all_veg_l = .true. @assertLessThan( pftidx, numstdpft-numstdcft+1 ) @assertGreaterThan( cftidx, numstdpft-numstdcft ) pft_idx(0:1) = (/ pftidx, cftidx /) pft_frc(0:1) = (/ 50.0_r8, 50.0_r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -163,7 +166,7 @@ contains subroutine test_runmkpft4PftORideWCrop(this) use mkvarpar, only: numstdpft, numstdcft class(TestMkPFTRun), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out, all_veg_l integer :: n integer :: cftidx, cftidx2 integer, parameter :: pftidx = 1, pftidx2 = 2 @@ -171,15 +174,16 @@ contains cftidx = c3cropindex cftidx2 = c3irrcropindex zero_out = .false. + all_veg_l = .true. @assertLessThan( pftidx, numstdpft-numstdcft+1 ) @assertLessThan( pftidx2, numstdpft-numstdcft+1 ) @assertGreaterThan( cftidx, numstdpft-numstdcft ) @assertGreaterThan( cftidx2, numstdpft-numstdcft ) pft_idx(0:3) = (/ pftidx, pftidx2, cftidx, cftidx2 /) pft_frc(0:3) = (/ 25.0_r8, 25.0_r8, 25.0_r8, 25.0_r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( all_veg ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 From a75bb788337eae8b3167953d0c5b086a4b7eb427 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2019 16:51:04 -0600 Subject: [PATCH 528/730] Add a test to check for a bad all_veg setting --- .../src/test/mkpftmod_test/test_pftInit.pf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf index ad34ca16a1..fcaf78779b 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf @@ -126,6 +126,18 @@ contains end subroutine test_runmkpftInitBadZeroNInput + @Test + subroutine test_runmkpftInitBadAllVeg(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out, all_veg + + zero_out = .false. + all_veg = .true. + call mkpftInit( zero_out, all_veg ) + @assertExceptionRaised( "ABORTED:" ) + + end subroutine test_runmkpftInitBadAllVeg + @Test subroutine test_runmkpftInitBadNotSum(this) class(TestMkPFT), intent(inout) :: this From ca0be0736eae27389e3d4f7b92d053ad64a2810b Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2019 13:47:15 -0700 Subject: [PATCH 529/730] adding GetandSetTime to restart subroutine --- src/utils/clmfates_interfaceMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index f2d5d557cd..3ac39debf5 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -962,6 +962,9 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! I think that is it... ! --------------------------------------------------------------------------------- + ! Set the FATES global time and date variables + call GetAndSetTime + if(.not.initialized) then initialized=.true. @@ -1267,9 +1270,6 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & waterstate_inst,canopystate_inst,frictionvel_inst) - ! Set the FATES global time and date variables - !call GetAndSetTime - ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ From be671e40f04183b3546ee75a25d740cd178a2ed5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 11:05:53 -0600 Subject: [PATCH 530/730] Allow PFT's to be prescribed but use overall veg cover from dataset Remove global all_veg and add in presc_cover in it's place. all_veg now comes as input to mkpftInit and helps set presc_cover. Unit tests updated and working. --- tools/mksurfdata_map/src/mkpftMod.F90 | 194 ++++++++++++------ tools/mksurfdata_map/src/mksurfdat.F90 | 2 +- .../src/test/mkpftmod_test/test_pftInit.pf | 167 ++++++++++----- .../src/test/mkpftmod_test/test_pftrun.pf | 8 +- 4 files changed, 244 insertions(+), 127 deletions(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 57c7479e7b..200e0c1bda 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -49,7 +49,7 @@ module mkpftMod ! !PRIVATE DATA MEMBERS: ! logical, public, protected :: use_input_pft = .false. ! Flag to override PFT with input values - logical, public, protected :: all_veg = .false. ! Flag to override all areas with vegetated PFT's + logical, public, protected :: presc_cover = .false. ! Flag to prescribe vegetation coverage integer, private :: nzero ! index of first zero fraction type, public :: pft_oride ! Public only for unit testing @@ -139,14 +139,13 @@ subroutine mkpftInit( zero_out_l, all_veg_l ) write(6,*) 'Set PFT fraction to : ', pft_frc(0:nzero) write(6,*) 'With PFT index : ', pft_idx(0:nzero) end if - all_veg = all_veg_l - if ( all_veg .and. .not. use_input_pft )then + if ( all_veg_l .and. .not. use_input_pft )then write(6,*) subname//'if all_veg is set to true then specified PFT indices must be provided (i.e. pft_frc and pft_idx)' call abort() return end if - if ( zero_out_l .and. all_veg )then + if ( zero_out_l .and. all_veg_l )then write(6,*) subname//'zeroing out vegetation and setting vegetation to 100% is a contradiction!' call abort() return @@ -185,10 +184,23 @@ subroutine mkpftInit( zero_out_l, all_veg_l ) ! Set the PFT override values if applicable ! pft_override = pft_oride() + presc_cover = .false. if( zero_out_l )then call pft_override%InitZeroOut() + presc_cover = .true. else if ( use_input_pft ) then call pft_override%InitAllPFTIndex() + if ( .not. all_veg_l )then + if ( pft_override%crop <= 0.0 )then + write(6,*) "Warning: PFT/CFT's are being overridden, but no crop type is being asked for" + end if + if ( pft_override%natveg <= 0.0 )then + write(6,*) "Warning: PFT/CFT's are being overridden, but no natural vegetation type is being asked for" + end if + presc_cover = .false. + else + presc_cover = .true. + end if end if end subroutine mkpftInit @@ -382,13 +394,12 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & return end if + ns_o = ldomain%ns + ! ----------------------------------------------------------------- ! Read input PFT file ! ----------------------------------------------------------------- - - ns_o = ldomain%ns - - if ( .not. use_input_pft ) then + if ( .not. presc_cover ) then ! Obtain input grid info, read PCT_PFT call domain_read(tdomain,fpft) @@ -400,17 +411,16 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Check what variables exist to determine what format the file is in call check_ret(nf_inq_varid (ncid, 'PCT_PFT', varid), subname, varexists=oldformat) - if ( .not. oldformat ) then - call check_ret(nf_inq_dimid (ncid, 'natpft', dimid), subname) - call check_ret(nf_inq_dimlen (ncid, dimid, natpft_i), subname) - call check_ret(nf_inq_dimid (ncid, 'cft', dimid), subname) - call check_ret(nf_inq_dimlen (ncid, dimid, ncft_i), subname) - numpft_i = natpft_i + ncft_i - else + if ( oldformat ) then write(6,*) subname//' ERROR: PCT_PFT field on the the file so it is in the old format, which is no longer supported' call abort() return end if + call check_ret(nf_inq_dimid (ncid, 'natpft', dimid), subname) + call check_ret(nf_inq_dimlen (ncid, dimid, natpft_i), subname) + call check_ret(nf_inq_dimid (ncid, 'cft', dimid), subname) + call check_ret(nf_inq_dimlen (ncid, dimid, ncft_i), subname) + numpft_i = natpft_i + ncft_i ! Check if the number of pfts on the input matches the expected number. A mismatch ! is okay if the input raw dataset has prognostic crops and the output does not. @@ -451,32 +461,38 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call check_ret(nf_get_var_double (ncid, varid, pctnatveg_i), subname) call check_ret(nf_inq_varid (ncid, 'PCT_CROP', varid), subname) call check_ret(nf_get_var_double (ncid, varid, pctcrop_i), subname) - call check_ret(nf_inq_varid (ncid, 'PCT_CFT', varid), subname) - call get_dim_lengths(ncid, 'PCT_CFT', ndims, dimlens(:) ) - if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) == num_cft )then - call check_ret(nf_get_var_double (ncid, varid, pct_cft_i), subname) - else if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) > num_cft )then - ! Read in the whole array: then sum the rainfed and irrigated - ! seperately - allocate( temp_i(ns_i,dimlens(3)) ) - call check_ret(nf_get_var_double (ncid, varid, temp_i), subname) - do n = 1, num_cft - pct_cft_i(:,n) = 0.0_r8 - do m = n, dimlens(3), 2 - pct_cft_i(:,n) = pct_cft_i(:,n) + temp_i(:,m) + if ( .not. use_input_pft )then + call check_ret(nf_inq_varid (ncid, 'PCT_CFT', varid), subname) + call get_dim_lengths(ncid, 'PCT_CFT', ndims, dimlens(:) ) + if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) == num_cft )then + call check_ret(nf_get_var_double (ncid, varid, pct_cft_i), subname) + else if ( ndims == 3 .and. dimlens(1)*dimlens(2) == ns_i .and. dimlens(3) > num_cft )then + ! Read in the whole array: then sum the rainfed and irrigated + ! seperately + allocate( temp_i(ns_i,dimlens(3)) ) + call check_ret(nf_get_var_double (ncid, varid, temp_i), subname) + do n = 1, num_cft + pct_cft_i(:,n) = 0.0_r8 + do m = n, dimlens(3), 2 + pct_cft_i(:,n) = pct_cft_i(:,n) + temp_i(:,m) + end do end do - end do - deallocate( temp_i ) + deallocate( temp_i ) + else + write(6,*) subname//': ERROR: dimensions for PCT_CROP are NOT what is expected' + call abort() + return + end if + call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) + call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) else - write(6,*) subname//': ERROR: dimensions for PCT_CROP are NOT what is expected' - call abort() - return end if - call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) call check_ret(nf_close(ncid), subname) + ! ----------------------------------------------------------------- + ! Otherwise if vegetation is prescribed everywhere + ! ----------------------------------------------------------------- else ns_i = 1 numpft_i = numpft+1 @@ -506,18 +522,16 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! Determine pctpft_o on output grid - if ( use_input_pft ) then + ! If total vegetation cover is prescribed from input... + if ( use_input_pft .and. presc_cover ) then do no = 1,ns_o pctlnd_o(no) = 100._r8 pctnatveg_o(no) = pft_override%natveg pctcrop_o(no) = pft_override%crop - pct_nat_pft_o(no,noveg:num_natpft) = pft_override%natpft(noveg:num_natpft) - pct_cft_o(no,1:num_cft) = pft_override%cft(1:num_cft) - pctpft_o(no,natpft_lb:natpft_ub) = pct_nat_pft_o(no,0:num_natpft) - pctpft_o(no,cft_lb:cft_ub) = pct_cft_o(no,1:num_cft) end do + ! otherewise if total cover isn't prescribed read it from the datasets else ! Compute pctlnd_o, pctpft_o @@ -541,35 +555,81 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & call gridmap_areaave(tgridmap, pctnatveg_i, pctnatveg_o, nodata=0._r8) call gridmap_areaave(tgridmap, pctcrop_i, pctcrop_o, nodata=0._r8) - do m = 0, num_natpft - call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), & - nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) + ! + ! If specific PFT/CFT's are NOT prescribed set them from the input file + ! + if ( .not. use_input_pft )then + do m = 0, num_natpft + call gridmap_areaave_scs(tgridmap, pct_nat_pft_i(:,m), pct_nat_pft_o(:,m), & + nodata=0._r8,src_wt=pctnatveg_i*0.01_r8,dst_wt=pctnatveg_o*0.01_r8) + do no = 1,ns_o + if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then + if (m == 0) then + pct_nat_pft_o(no,m) = 100._r8 + else + pct_nat_pft_o(no,m) = 0._r8 + endif + end if + enddo + end do + do m = 1, num_cft + call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), & + nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) + do no = 1,ns_o + if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then + if (m == 1) then + pct_cft_o(no,m) = 100._r8 + else + pct_cft_o(no,m) = 0._r8 + endif + end if + enddo + end do + ! Otherwise do some error checking to make sure specific veg types are given where nat-veg and crop is assigned + else do no = 1,ns_o - if (pctlnd_o(no) < 1.0e-6 .or. pctnatveg_o(no) < 1.0e-6) then - if (m == 0) then - pct_nat_pft_o(no,m) = 100._r8 - else - pct_nat_pft_o(no,m) = 0._r8 - endif + if (pctlnd_o(no) > 1.0e-6 .and. pctnatveg_o(no) > 1.0e-6) then + if ( pft_override%natveg <= 0.0_r8 )then + write(6,*) subname//': ERROR: no natural vegetation PFTs are being prescribed but there are natural '// & + 'vegetation areas: provide at least one natural veg PFT' + call abort() + return + end if end if - enddo - end do - do m = 1, num_cft - call gridmap_areaave_scs(tgridmap, pct_cft_i(:,m), pct_cft_o(:,m), & - nodata=0._r8,src_wt=pctcrop_i*0.01_r8,dst_wt=pctcrop_o*0.01_r8) - do no = 1,ns_o - if (pctlnd_o(no) < 1.0e-6 .or. pctcrop_o(no) < 1.0e-6) then - if (m == 1) then - pct_cft_o(no,m) = 100._r8 - else - pct_cft_o(no,m) = 0._r8 - endif + if (pctlnd_o(no) > 1.0e-6 .and. pctcrop_o(no) > 1.0e-6) then + if ( pft_override%crop <= 0.0_r8 )then + write(6,*) subname//': ERROR: no crop CFTs are being prescribed but there are crop areas: provide at least one CFT' + call abort() + return + end if end if - enddo - end do + end do + end if + end if + ! + ! If specific PFT/CFT's are prescribed set them directly + ! + if ( use_input_pft )then + do no = 1,ns_o + if (pctlnd_o(no) > 1.0e-6 .and. pctnatveg_o(no) > 1.0e-6) then + pct_nat_pft_o(no,noveg:num_natpft) = pft_override%natpft(noveg:num_natpft) + else + pct_nat_pft_o(no,noveg) = 100._r8 + pct_nat_pft_o(no,noveg+1:) = 0._r8 + end if + if (pctlnd_o(no) > 1.0e-6 .and. pctcrop_o(no) > 1.0e-6) then + pct_cft_o(no,1:num_cft) = pft_override%cft(1:num_cft) + else + pct_cft_o(no,1) = 100._r8 + pct_cft_o(no,2:) = 0._r8 + end if + pctpft_o(no,natpft_lb:natpft_ub) = pct_nat_pft_o(no,0:num_natpft) + pctpft_o(no,cft_lb:cft_ub) = pct_cft_o(no,1:num_cft) + end do end if + ! Error check: percents should sum to 100 for land grid cells, within roundoff ! Also correct sums so that if they differ slightly from 100, they are corrected to ! equal 100 more exactly. @@ -621,9 +681,13 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & ! ----------------------------------------------------------------- ! Error check ! Compare global areas on input and output grids + ! Only when you aren't prescribing the vegetation coverage everywhere + ! If use_input_pft is set this will compare the global coverage of + ! the prescribed vegetation to the coverage of PFT/CFT's on the input + ! datasets. ! ----------------------------------------------------------------- - if ( .not. use_input_pft ) then + if ( .not. presc_cover ) then ! Convert to pctpft over grid if using new format do ni = 1, ns_i @@ -701,7 +765,7 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & deallocate(pct_cft_o) deallocate(pct_nat_pft_i) deallocate(pct_nat_pft_o) - if ( .not. use_input_pft ) then + if ( .not. presc_cover ) then call domain_clean(tdomain) call gridmap_clean(tgridmap) end if diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 2aa73c43b5..7dda30b7fe 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -379,7 +379,7 @@ program mksurfdat ! Call module initialization routines ! call mksoilInit( ) - call mkpftInit( all_urban, all_veg ) + call mkpftInit( zero_out_l=all_urban, all_veg_l=all_veg ) allocate ( elevclass(nglcec+1) ) call mkglcmecInit (elevclass) call mkurbanInit (mksrf_furban) diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf index fcaf78779b..1ddb143961 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftInit.pf @@ -8,7 +8,7 @@ module test_pftInit use mkpftMod use mkvarctl, only: numpft use mkvarpar, only: numstdpft, noveg - use mkpftConstantsMod, only: maxpft + use mkpftConstantsMod, only: maxpft, c3cropindex implicit none save @@ -37,24 +37,26 @@ contains @Test subroutine test_runmkpftInit(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .false. - call mkpftInit( zero_out, all_veg ) + zero_out_l = .false. + all_veg_l = .false. + call mkpftInit( zero_out_l, all_veg_l ) @assertFalse( use_input_pft ) + @assertFalse( presc_cover ) end subroutine test_runmkpftInit @Test subroutine test_runmkpftInitZero(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .true. - all_veg = .false. - call mkpftInit( zero_out, all_veg ) + zero_out_l = .true. + all_veg_l = .false. + call mkpftInit( zero_out_l, all_veg_l ) @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) @assertEqual( pft_idx(0), noveg ) @assertEqual( pft_frc(0), 0.0_r8 ) @@ -63,30 +65,48 @@ contains @Test subroutine test_runmkpftInitPftORide(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. + zero_out_l = .false. pft_idx(0) = 1 pft_frc(0) = 100._r8 - all_veg = .true. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) end subroutine test_runmkpftInitPftORide + @Test + subroutine test_runmkpftInitPftORideButNOTAllVeg(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out_l, all_veg_l + + zero_out_l = .false. + pft_idx(0:1) = (/ 1, c3cropindex /) + pft_frc(0:1) = (/ 50._r8, 50.0_r8 /) + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) + @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) + + end subroutine test_runmkpftInitPftORideButNOTAllVeg + + @Test subroutine test_runmkpftInitPftORideCrop(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. + zero_out_l = .false. numpft = maxpft pft_idx(0) = 17 pft_frc(0) = 100._r8 - all_veg = .true. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) end subroutine test_runmkpftInitPftORideCrop @@ -94,10 +114,10 @@ contains @Test subroutine test_runmkpftInitPftORideAll(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l integer :: i - zero_out = .false. + zero_out_l = .false. numpft = numstdpft do i = 0, numpft pft_idx(i) = i @@ -105,23 +125,56 @@ contains end do pft_frc(numpft) = 100._r8 - sum(pft_frc(0:numpft-1)) @assertEqual( 100.0_r8, sum(pft_frc) ) - all_veg = .true. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) end subroutine test_runmkpftInitPftORideAll + @Test + subroutine test_runmkpftInitPFTOrideWarnNoCrop(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out_l, all_veg_l + + zero_out_l = .false. + numpft = maxpft + pft_idx(0) = 1 + pft_frc(0) = 100._r8 + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) + @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) + + end subroutine test_runmkpftInitPFTOrideWarnNoCrop + + @Test + subroutine test_runmkpftInitPFTOrideWarnNoNatVeg(this) + class(TestMkPFT), intent(inout) :: this + logical :: zero_out_l, all_veg_l + + zero_out_l = .false. + numpft = maxpft + pft_idx(0) = c3cropindex + pft_frc(0) = 100._r8 + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) + @assertTrue( use_input_pft ) + @assertTrue( presc_cover ) + + end subroutine test_runmkpftInitPFTOrideWarnNoNatVeg + @Test subroutine test_runmkpftInitBadZeroNInput(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .true. + zero_out_l = .true. numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 - all_veg = .true. - call mkpftInit( zero_out, all_veg ) + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadZeroNInput @@ -129,11 +182,11 @@ contains @Test subroutine test_runmkpftInitBadAllVeg(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. - call mkpftInit( zero_out, all_veg ) + zero_out_l = .false. + all_veg_l = .true. + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadAllVeg @@ -141,14 +194,14 @@ contains @Test subroutine test_runmkpftInitBadNotSum(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0) = 99._r8 - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadNotSum @@ -156,14 +209,14 @@ contains @Test subroutine test_runmkpftInitBadPFTOutRange(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = numstdpft pft_idx(0) = numstdpft+1 pft_frc(0) = 100._r8 - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadPFTOutRange @@ -171,14 +224,14 @@ contains @Test subroutine test_runmkpftInitBadPFTBadVals(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = maxpft pft_idx(0:1) = (/ numstdpft+1, numstdpft+2 /) pft_frc(0:1) = (/ 101._r8, -1._r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadPFTBadVals @@ -186,12 +239,12 @@ contains @Test subroutine test_runmkpftInitBadnumpft(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = 79 - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadnumpft @@ -199,14 +252,14 @@ contains @Test subroutine test_runmkpftInitBadFrcNotIdx(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = maxpft pft_idx(0) = numstdpft+1 pft_frc(0:1) = (/ 99._r8, 1._r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadFrcNotIdx @@ -214,14 +267,14 @@ contains @Test subroutine test_runmkpftInitBadIdxTwice(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. - all_veg = .true. + zero_out_l = .false. + all_veg_l = .true. numpft = maxpft pft_idx(0:1) = (/ 17, 17 /) pft_frc(0:1) = (/ 99._r8, 1._r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadIdxTwice @@ -229,14 +282,14 @@ contains @Test subroutine test_runmkpftInitBadFrcAfterZero(this) class(TestMkPFT), intent(inout) :: this - logical :: zero_out, all_veg + logical :: zero_out_l, all_veg_l - zero_out = .false. + zero_out_l = .false. numpft = maxpft - all_veg = .true. + all_veg_l = .true. pft_idx(0:2) = (/ 17, -1, 18 /) pft_frc(0:2) = (/ 99._r8, 0.0_r8, 1._r8 /) - call mkpftInit( zero_out, all_veg ) + call mkpftInit( zero_out_l, all_veg_l ) @assertExceptionRaised( "ABORTED:" ) end subroutine test_runmkpftInitBadFrcAfterZero diff --git a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf index d08eb2fd3e..389748764b 100644 --- a/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf +++ b/tools/mksurfdata_map/src/test/mkpftmod_test/test_pftrun.pf @@ -76,7 +76,7 @@ contains all_veg_l = .false. call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertFalse( all_veg ) + @assertTrue( presc_cover ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -107,7 +107,7 @@ contains pft_frc(0) = 100._r8 call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( presc_cover ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -144,7 +144,7 @@ contains pft_frc(0:1) = (/ 50.0_r8, 50.0_r8 /) call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( presc_cover ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 @@ -183,7 +183,7 @@ contains pft_frc(0:3) = (/ 25.0_r8, 25.0_r8, 25.0_r8, 25.0_r8 /) call mkpftInit( zero_out, all_veg_l ) @assertTrue( use_input_pft ) - @assertTrue( all_veg ) + @assertTrue( presc_cover ) call mkpft(this%ldomain, this%mapfname, this%fpft, this%ndiag, & pctlnd_o=this%pctlnd_pft, pctnatpft_o=this%pctnatpft, pctcft_o=this%pctcft) this%expected = 100.0_r8 From af31c18b7ea72787aee229ce85f0658c12057556 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 13:13:34 -0600 Subject: [PATCH 531/730] Remove an unneeded else --- tools/mksurfdata_map/src/mkpftMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/mksurfdata_map/src/mkpftMod.F90 b/tools/mksurfdata_map/src/mkpftMod.F90 index 200e0c1bda..35928af530 100644 --- a/tools/mksurfdata_map/src/mkpftMod.F90 +++ b/tools/mksurfdata_map/src/mkpftMod.F90 @@ -485,7 +485,6 @@ subroutine mkpft(ldomain, mapfname, fpft, ndiag, & end if call check_ret(nf_inq_varid (ncid, 'PCT_NAT_PFT', varid), subname) call check_ret(nf_get_var_double (ncid, varid, pct_nat_pft_i), subname) - else end if call check_ret(nf_close(ncid), subname) From e5e67aaf89ce9a4fd73017c97050f56265da0dbb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 13:36:56 -0600 Subject: [PATCH 532/730] Have mkharv listen to all_veg rather than pft_frc>0, so harvesting will be set for prescribed PFT cases that use dataset PCT_NAT_VEG and PCT_CROP --- tools/mksurfdata_map/src/mksurfdat.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 7dda30b7fe..54babef5fe 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -566,7 +566,7 @@ program mksurfdat ! Create harvesting data at model resolution call mkharvest_init( ns_o, spval, harvdata, mksrf_fhrvtyp ) - if ( .not. any(pft_frc > 0.0_r8 ) )then + if ( .not. all_veg )then call mkharvest( ldomain, mapfname=map_fharvest, datfname=mksrf_fhrvtyp, & ndiag=ndiag, harvdata=harvdata ) @@ -1115,7 +1115,7 @@ program mksurfdat ! ! If pft fraction override is set, than intrepret string as PFT and harvesting override values ! - if ( any(pft_frc > 0.0_r8 ) )then + if ( .not. all_veg )then fname = ' ' fhrvname = ' ' call mkpft_parse_oride(string) From b79a6efa0f61b2d59d8ec1cee007a33e3fedac60 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 15:04:42 -0600 Subject: [PATCH 533/730] Update intel version to fix #809 --- tools/mkmapdata/mkmapdata.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh index a744e2798e..593c885a5d 100755 --- a/tools/mkmapdata/mkmapdata.sh +++ b/tools/mkmapdata/mkmapdata.sh @@ -344,7 +344,7 @@ case $hostname in REGRID_PROC=36 fi esmfvers=7.1.0r - intelvers=17.0.1 + intelvers=18.0.5 # Could also use intel/19.0.2 EBK 10/4/2019 module load esmf_libs/$esmfvers module load intel/$intelvers module load ncl From 43529b6af7288faec0ec4589534775b81094aef6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 15:24:38 -0600 Subject: [PATCH 534/730] Set stream_year_*_urbantv for clm4_5 to fix issue #175 --- .../namelist_defaults_clm4_5.xml | 20 +++++++++++++++++-- bld/namelist_files/use_cases/1850_control.xml | 3 +++ .../use_cases/1850_noanthro_control.xml | 3 +++ bld/namelist_files/use_cases/2000_control.xml | 3 +++ .../use_cases/20thC_transient.xml | 4 ++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 20b8850daa..4a48995eed 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1212,8 +1212,9 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2106 2015 -2000 -2000 +2015 +2106 +2015 2000 2000 @@ -1224,12 +1225,27 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2000 2000 +2000 +2000 + +1850 +1850 + +2000 +2000 + 2000 2000 2000 2000 +2000 +2000 + +2000 +2000 + lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 18c5959c78..48bc573a05 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -29,6 +29,9 @@ 1850 1850 +1850 +1850 + 1850 1850 diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index bba281aee6..971b0cf410 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -42,6 +42,9 @@ 1850 1850 +1850 +1850 + NONE diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index ca7c1ac5cd..7ec02e7bb8 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -30,6 +30,9 @@ 2000 2000 +2000 +2000 + 2000 2000 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index e8970b59bf..48e5f595f1 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -45,6 +45,10 @@ 2016 1850 +1850 +2106 +1850 + 1850 2106 1850 From a297c0b26ffbbceef8db51fcc2b9e59c169f8a69 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 15:35:06 -0600 Subject: [PATCH 535/730] Update cime version to latest available --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index f6bb44e321..94dc921733 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.23 +tag = cime5.6.24 required = True [externals_description] From 9b71ec6429f578667a70397a149fe5b7d1b55d58 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 4 Oct 2019 16:38:39 -0600 Subject: [PATCH 536/730] Move lai_interp and SoilMoistureStreamsInterp outside of OMP loops so can run with threading on fixing #791 --- src/biogeochem/SatellitePhenologyMod.F90 | 6 +----- src/main/clm_driver.F90 | 27 +++++++++++++++++------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index 78b2cf0e24..dd9e7c9f56 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -39,11 +39,11 @@ module SatellitePhenologyMod public :: SatellitePhenologyInit ! Dynamically allocate memory public :: interpMonthlyVeg ! interpolate monthly vegetation data public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition) + public :: lai_interp ! interpolates between two years of LAI data (when LAI streams are being used) ! ! !PRIVATE MEMBER FUNCTIONS: private :: readMonthlyVegetation ! read monthly vegetation data for two months private :: lai_init ! position datasets for LAI - private :: lai_interp ! interpolates between two years of LAI data ! !PRIVATE MEMBER DATA: type(shr_strdata_type) :: sdat_lai ! LAI input data stream @@ -332,10 +332,6 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] ) - if (use_lai_streams) then - call lai_interp(bounds, canopystate_inst) - endif - do fp = 1, num_nolakep p = filter_nolakep(fp) c = patch%column(p) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index a324dfd3ef..96c73ca16d 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -108,7 +108,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! the calling tree is given in the description of this module. ! ! !USES: - use clm_time_manager, only : get_curr_date + use clm_time_manager , only : get_curr_date + use clm_varctl , only : use_lai_streams + use SatellitePhenologyMod, only : lai_interp ! ! !ARGUMENTS: implicit none @@ -315,6 +317,16 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro glc_behavior) call t_stopf('dyn_subgrid') + ! ============================================================================ + ! If soil moisture is prescribed from data streams set it here + ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe). + ! ============================================================================ + if (use_soil_moisture_streams) then + call t_startf('prescribed_sm') + call PrescribedSoilMoistureInterp(bounds_proc, soilstate_inst, & + waterstate_inst) + call t_stopf('prescribed_sm') + endif ! ============================================================================ ! Initialize the column-level mass balance checks for water, carbon & nitrogen. ! @@ -334,13 +346,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) - if (use_soil_moisture_streams) then - call t_startf('prescribed_sm') - call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & - waterstate_inst) - call t_stopf('prescribed_sm') - endif - call t_startf('begwbal') call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & @@ -390,6 +395,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! Get time varying urban data call urbantv_inst%urbantv_interp(bounds_proc) + ! When LAI streams are being used + ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) + if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then + call lai_interp(bounds_proc, canopystate_inst) + endif + ! ============================================================================ ! Initialize variables from previous time step, downscale atm forcings, and ! Determine canopy interception and precipitation onto ground surface. From 199392664a1301f4bf9b324e3a14b5ac4974a558 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 5 Oct 2019 20:18:49 -0600 Subject: [PATCH 537/730] Change the error when use_init_interp=T for a branch run to a warning --- src/main/controlMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 06038ddd99..3d1d8a7dca 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -1014,7 +1014,7 @@ subroutine apply_use_init_interp(finidat, finidat_interp_source) !----------------------------------------------------------------------- if (finidat == ' ') then - call endrun(msg=' ERROR: Can only set use_init_interp if finidat is set') + write(iulog,*)' WARNING: Setting use_init_interp has no effect if finidat is not also set' end if if (finidat_interp_source /= ' ') then From 626c038d7603fb41320c9fc72fc22001a36e79f1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 5 Oct 2019 22:49:34 -0600 Subject: [PATCH 538/730] Print a warning if branch and use_init_interp=T, and add a test for it --- bld/CLMBuildNamelist.pm | 6 ++++++ bld/unit_testers/build-namelist_test.pl | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c1afff586b..712c56c0da 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1931,6 +1931,12 @@ sub setup_logic_start_type { if (not defined $nl->get_value('nrevsn')) { $log->fatal_error("nrevsn is required for a branch type."); } + if (defined $nl->get_value('use_init_interp')) { + if ( &value_is_true($nl->get_value('use_init_interp') ) ) { + # Always print this warning, but don't stop if it happens + print "\nWARNING: use_init_interp will NOT happen for a branch case.\n\n"; + } + } } else { if (defined $nl->get_value('nrevsn')) { $log->fatal_error("nrevsn should ONLY be set for a branch type."); diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 64df3c4efc..4b9594b6b3 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,9 +123,9 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 825; +my $ntests = 829; if ( defined($opts{'compare'}) ) { - $ntests += 501; + $ntests += 504; } plan( tests=>$ntests ); @@ -279,6 +279,7 @@ sub make_env_run { "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", "-envxml_dir . -infile myuser_nl_clm", "-ignore_ic_date -clm_start_type branch -namelist '&a nrevsn=\"thing.nc\"/' -bgc bgc -crop", + "-clm_start_type branch -namelist '&a nrevsn=\"thing.nc\",use_init_interp=T/'", "-ignore_ic_date -clm_start_type startup -namelist '&a finidat=\"thing.nc\"/' -bgc bgc -crop", ) { my $file = $startfile; From d54d51cf0bab395d132e408763f6dde4b561e7ff Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 7 Oct 2019 16:34:08 -0600 Subject: [PATCH 539/730] Point ndep SSP files to ones that have historical period 1849-2013 added to the front of them --- .../namelist_defaults_clm4_5.xml | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 4a48995eed..b19f7883bd 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1053,27 +1053,24 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc + lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc - +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP2-4.5-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP3-7.0-WACCM_1849-2101_monthly_c191007.nc -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - - lnd/clm2/ndepdata/fndep_clm_SSP585_b.e21.BWSSP585cmip6.f09_g17.CMIP6-SSP5-8.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190211.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP126_b.e21.BWSSP126cmip6.f09_g17.CMIP6-SSP1-2.6-WACCM.001_2014-2101_monthly_0.9x1.25_c190221.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP1-2.6-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP245_b.e21.BWSSP245cmip6.f09_g17.CMIP6-SSP2-4.5-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc lnd/clm2/ndepdata/fndep_clm_SSP370_b.e21.BWSSP370cmip6.f09_g17.CMIP6-SSP3-7.0-WACCM.001_2014-2101_monthly_0.9x1.25_c190401.nc +>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP3-7.0-WACCM_1849-2101_monthly_c191007.nc cycle NDEP_month From fcb4b0c82373ec5e16c4ecd304fb4cf8e4f1263b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 7 Oct 2019 16:48:49 -0600 Subject: [PATCH 540/730] Change hobart tests to izumi and remove edison tests, because edison is decommisioned --- cime_config/testdefs/testlist_clm.xml | 145 ++++++++++++-------------- 1 file changed, 65 insertions(+), 80 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c34328ce70..58abca1a9f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -87,8 +87,8 @@ - - + + @@ -96,7 +96,7 @@ - + @@ -104,7 +104,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -321,7 +321,7 @@ - + @@ -329,7 +329,7 @@ - + @@ -443,8 +443,8 @@ - - + + @@ -486,9 +486,9 @@ - - - + + + @@ -512,7 +512,7 @@ - + @@ -528,7 +528,7 @@ - + @@ -536,7 +536,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -552,7 +552,7 @@ - + @@ -560,7 +560,7 @@ - + @@ -825,9 +825,8 @@ - - - + + @@ -868,7 +867,7 @@ - + @@ -927,7 +926,7 @@ - + @@ -1017,7 +1016,7 @@ - + @@ -1108,8 +1107,8 @@ - - + + @@ -1129,9 +1128,9 @@ - - - + + + @@ -1166,9 +1165,9 @@ - - - + + + @@ -1176,8 +1175,8 @@ - - + + @@ -1193,7 +1192,7 @@ - + @@ -1209,7 +1208,7 @@ - + @@ -1221,9 +1220,9 @@ - + - + @@ -1232,7 +1231,7 @@ - + @@ -1240,7 +1239,7 @@ - + @@ -1317,7 +1316,7 @@ - + @@ -1373,8 +1372,8 @@ - - + + @@ -1408,7 +1407,6 @@ - @@ -1441,7 +1439,7 @@ - + @@ -1466,8 +1464,8 @@ - - + + @@ -1491,14 +1489,6 @@ - - - - - - - - @@ -1527,7 +1517,7 @@ - + @@ -1535,7 +1525,7 @@ - + @@ -1631,7 +1621,7 @@ - + @@ -1656,7 +1646,7 @@ - + @@ -1666,7 +1656,7 @@ - + @@ -1675,7 +1665,7 @@ - + @@ -1694,7 +1684,7 @@ - + @@ -1711,7 +1701,7 @@ - + @@ -1720,7 +1710,7 @@ - + @@ -1737,7 +1727,7 @@ - + @@ -1755,7 +1745,7 @@ - + @@ -1773,7 +1763,7 @@ - + @@ -1875,8 +1865,7 @@ - - + @@ -1886,7 +1875,6 @@ - @@ -1915,8 +1903,7 @@ - - + @@ -1926,7 +1913,7 @@ - + @@ -1935,8 +1922,7 @@ - - + @@ -1955,8 +1941,7 @@ - - + @@ -1975,7 +1960,7 @@ - + @@ -1985,7 +1970,7 @@ - + @@ -1995,7 +1980,7 @@ - + From 892bb90ab1b3ae30569bd4a716d0c8585c58581d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 8 Oct 2019 14:00:24 -0600 Subject: [PATCH 541/730] Add clm4_5 version of ndep for 1850/hist (same as for clm5_0) --- bld/namelist_files/namelist_defaults_clm4_5.xml | 1 + bld/namelist_files/use_cases/1850_control.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index b19f7883bd..89835acfc8 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1052,6 +1052,7 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2000 lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc +lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc cycle From e9ccd6b5b31268ade075409f5207804296b089f1 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 9 Oct 2019 11:04:07 -0600 Subject: [PATCH 542/730] Update soil organic matter properties in Hydrology chapter --- .../Hydrology/CLM50_Tech_Note_Hydrology.rst | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst index fb387d25c2..c4e0824ea7 100644 --- a/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst +++ b/doc/source/tech_note/Hydrology/CLM50_Tech_Note_Hydrology.rst @@ -620,9 +620,8 @@ organic components. The water content at saturation (i.e. porosity) is \theta_{sat,i} =(1-f_{om,i} )\theta_{sat,\min ,i} +f_{om,i} \theta_{sat,om} where :math:`f_{om,i}` is the soil organic matter fraction, -:math:`\theta_{sat,om} =0.9` (:ref:`Farouki 1981 `; -:ref:`Letts et al. 2000 `) is the -porosity of organic matter and the porosity of the mineral soil +:math:`\theta_{sat,om}` is the +porosity of organic matter, and the porosity of the mineral soil :math:`\theta_{sat,\min ,i}` is .. math:: @@ -637,7 +636,7 @@ The exponent :math:`B_{i}` is B_{i} =(1-f_{om,i} )B_{\min ,i} +f_{om,i} B_{om} -where :math:`B_{om} = 2.7` \ (:ref:`Letts et al. 2000 `) and +where :math:`B_{om}` is for organic matter and .. math:: :label: 7.93 @@ -659,7 +658,7 @@ where the saturated soil matric potential (mm) is \psi _{sat,i} =(1-f_{om,i} )\psi _{sat,\min ,i} +f_{om,i} \psi _{sat,om} -where :math:`\psi _{sat,om} = -10.3` \ mm (:ref:`Letts et al. 2000 `) is the +where :math:`\psi _{sat,om}` \ is the saturated organic matter matric potential and the saturated mineral soil matric potential :math:`\psi _{sat,\min ,i}` \ is @@ -723,6 +722,31 @@ as k_{sat} \left[z_{h,\, i} \right]=f_{uncon,\, i} k_{sat,\, uncon} \left[z_{h,\, i} \right]+(1-f_{uncon,\, i} )k_{sat,\, om} \left[z_{h,\, i} \right]. +The soil organic matter properties implicitly account for the standard observed profile of organic matter +properties as + +.. math:: + :label: 1.101 + + \theta_{sat,om} = max(0.93 - 0.1\times z_{i} / zsapric, 0.83). + +.. math:: + :label: 1.102 + + B_{om} = min(2.7 + 9.3\times z_{i} / zsapric, 12.0). + +.. math:: + :label: 1.103 + + \psi_{sat,om} = min(10.3 - 0.2\times z_{i} / zsapric, 10.1). + +.. math:: + :label: 1.104 + + k_{sat,om} = max(0.28 - 0.2799\times z_{i} / zsapric, k_{sat,\, \min } \left[z_{h,\, i} \right]). + +where :math:`zsapric =0.5` \m is the depth that organic matter takes on the characteristics of sapric peat. + .. _Numerical Solution Hydrology: Numerical Solution From 06f9611de476c4b47c6f0ff032e53d5da8272c70 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2019 15:39:35 -0600 Subject: [PATCH 543/730] Fix wallclock for a test --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 58abca1a9f..081877b553 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -437,7 +437,7 @@ - + From 8e4a2c36ec12f1d51767534c4eaac1003b8bfc4a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2019 16:35:48 -0600 Subject: [PATCH 544/730] Remove the update of pointing clm4_5 for 1850_control to the 1850-PI control fndep file, continue to use the historical fndep file so that answers don't change --- bld/namelist_files/use_cases/1850_control.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 0b90738698..48bc573a05 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -38,8 +38,6 @@ lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc cycle From 709bd85846d80da94f58a6393ccd54298309d8e2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 11 Oct 2019 12:10:27 -0600 Subject: [PATCH 545/730] Revert "Set stream_year_*_urbantv for clm4_5 to fix issue #175" This reverts commit 43529b6af7288faec0ec4589534775b81094: Revert the change in urbantv for clm4_5 as it changes answers in some cases. --- .../namelist_defaults_clm4_5.xml | 20 ++----------------- bld/namelist_files/use_cases/1850_control.xml | 3 --- .../use_cases/1850_noanthro_control.xml | 3 --- bld/namelist_files/use_cases/2000_control.xml | 3 --- .../use_cases/20thC_transient.xml | 4 ---- 5 files changed, 2 insertions(+), 31 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 89835acfc8..657f510361 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1210,9 +1210,8 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2106 2015 -2015 -2106 -2015 +2000 +2000 2000 2000 @@ -1223,27 +1222,12 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2000 2000 -2000 -2000 - -1850 -1850 - -2000 -2000 - 2000 2000 2000 2000 -2000 -2000 - -2000 -2000 - lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 48bc573a05..18c5959c78 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -29,9 +29,6 @@ 1850 1850 -1850 -1850 - 1850 1850 diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index 971b0cf410..bba281aee6 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -42,9 +42,6 @@ 1850 1850 -1850 -1850 - NONE diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index 7ec02e7bb8..ca7c1ac5cd 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -30,9 +30,6 @@ 2000 2000 -2000 -2000 - 2000 2000 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index 48e5f595f1..e8970b59bf 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -45,10 +45,6 @@ 2016 1850 -1850 -2106 -1850 - 1850 2106 1850 From ac16068ef6a75ecf5ee344d24c2e3cbadaa014c7 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 11 Oct 2019 11:26:59 -0700 Subject: [PATCH 546/730] removing calls to GetandSet in restart and cold_init subroutines. First appears to be not necessary and second screws up the cold start --- src/utils/clmfates_interfaceMod.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 6079a7017a..3c81cf928b 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -965,9 +965,6 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! I think that is it... ! --------------------------------------------------------------------------------- - ! Set the FATES global time and date variables - call GetAndSetTime - if(.not.initialized) then initialized=.true. @@ -1197,9 +1194,6 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins integer :: c - ! Set the FATES global time and date variables - call GetAndSetTime - nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) From 11efa7cb3a82686797b3ea06061f3694d9e2a7d9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 11 Oct 2019 12:58:58 -0600 Subject: [PATCH 547/730] Update to cime version that works (without cime bug ESMCI/cime#3259) --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 94dc921733..6e6bf92b3a 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.24 +tag = cime5.6.22 required = True [externals_description] From 6173fe4f48bf9efe89599a1e7d2fea045fb41863 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 29 Oct 2019 01:18:08 -0600 Subject: [PATCH 548/730] Seperate out PrescribedSoilMoistureAdvance to different subroutine to seperate part of driver can be called from. Also add some SHR_ASSERT calls for checking it, add a new diagonstic history variable for H2OSOI as read from streams so can compare to input, make the calls to new subroutine in the original place which shouldn't change answers, but it does unexpectedly --- src/biogeophys/SoilMoistureStreamMod.F90 | 123 ++++++++++++++++------- src/biogeophys/WaterStateType.F90 | 12 ++- src/main/clm_driver.F90 | 17 +++- 3 files changed, 108 insertions(+), 44 deletions(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 9146ee0114..d59453bd7d 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -1,5 +1,7 @@ module SoilMoistureStreamMod +#include "shr_assert.h" + !----------------------------------------------------------------------- ! !DESCRIPTION: ! Read in soil moisture from data stream @@ -35,10 +37,13 @@ module SoilMoistureStreamMod ! ! !PUBLIC MEMBER FUNCTIONS: public :: PrescribedSoilMoistureInit ! position datasets for soil moisture + public :: PrescribedSoilMoistureAdvance ! Advance the soil moisture stream (outside of Open-MP loops) public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data ! !PRIVATE MEMBER DATA: type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream + integer :: ism ! Soil moisture steram index + integer, allocatable :: g_to_ig(:) ! ! !PRIVATE TYPES: @@ -85,8 +90,8 @@ subroutine PrescribedSoilMoistureInit(bounds) character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm - character(*), parameter :: subName = "('soil_moisture_init')" - character(*), parameter :: F00 = "('(soil_moisture_init) ',4a)" + character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" + character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" character(*), parameter :: soilmString = "H2OSOI" ! base string for field string character(SHR_KIND_CXX) :: fldList ! field string !----------------------------------------------------------------------- @@ -186,6 +191,60 @@ subroutine PrescribedSoilMoistureInit(bounds) end subroutine PrescribedSoilMoistureInit + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureAdvance + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureAdvance( bounds ) + ! + ! Advanace the prescribed soil moisture stream + ! + ! !USES: + use clm_time_manager, only : get_curr_date + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + character(len=CL) :: stream_var_name + integer :: g, ig + integer :: ier ! error code + integer :: year ! year (0, ...) for nstep+1 + integer :: mon ! month (1, ..., 12) for nstep+1 + integer :: day ! day of month (1, ..., 31) for nstep+1 + integer :: sec ! seconds into current date for nstep+1 + integer :: mcdate ! Current model date (yyyymmdd) + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + stream_var_name = 'H2OSOI' + + ! Determine variable index + ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) + + call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) + + ! Map gridcell to AV index + ier = 0 + if ( .not. allocated(g_to_ig) )then + allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) + if (ier /= 0) then + write(iulog,*) 'Prescribed soil moisture allocation error' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + end if + + end subroutine PrescribedSoilMoistureAdvance + !----------------------------------------------------------------------- ! ! PrescribedSoilMoistureInterp @@ -200,7 +259,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & use clm_time_manager, only : get_curr_date use clm_varpar , only : nlevsoi use clm_varcon , only : denh2o, denice, watmin - use landunit_varcon , only : istsoil + use landunit_varcon , only : istsoil, istcrop ! ! !ARGUMENTS: implicit none @@ -209,58 +268,43 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & type(waterstate_type) , intent(inout) :: waterstate_inst ! ! !LOCAL VARIABLES: - integer :: c, g, j, ism, ig, n - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - integer :: ier ! error code - integer, allocatable :: g_to_ig(:) + integer :: c, g, j, ig, n real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture real(r8) :: soilm_ice_frac ! ice fraction of soil moisture real(r8) :: moisture_increment ! soil moisture adjustment increment real(r8) :: h2osoi_vol_initial ! initial vwc value - character(len=CL) :: stream_var_name + character(*), parameter :: subName = "('PrescribedSoilMoistureInterp')" !----------------------------------------------------------------------- + SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) == g_to_ig(bounds%begg) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) == g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) associate( & dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col & ! Output: volumetric soil water (m3/m3) + h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) + h2osoi_vol_prs => waterstate_inst%h2osoi_vol_prs_col & ! Output: prescribed volumetric soil water (m3/m3) ) + SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - stream_var_name = 'H2OSOI' - - ! Determine variable index - ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) - - call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) - - ! Map gridcell to AV index - ier = 0 - allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) - if (ier /= 0) then - write(iulog,*) 'Prescribed soil moisture allocation error' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - g_to_ig(g) = ig - end do ! Read data from stream into column level variable do c = bounds%begc, bounds%endc - if(lun%itype(col%landunit(c)) == istsoil) then + if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c)) == istcrop) then ! ! Set variable for each gridcell/column combination ! @@ -269,7 +313,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi - n = ig + (j-1)*(bounds%endg-bounds%begg+1) + n = ig + (j-1)*size(g_to_ig) ! if soil water is zero, liq/ice fractions cannot be calculated if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then @@ -279,6 +323,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! update volumetric soil moisture h2osoi_vol(c,j) = sdat_soilm%avs(1)%rAttr(ism,n) + h2osoi_vol_prs(c,j) = sdat_soilm%avs(1)%rAttr(ism,n) ! calculate liq/ice mass fractions soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) @@ -293,6 +338,8 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) + else + call endrun(subname // ':: ERROR h2osoil liquid plus ice is zero') endif enddo endif diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 9493a8a68a..6d79e5c633 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -40,6 +40,7 @@ module WaterstateType real(r8), pointer :: h2osoi_ice_tot_col (:) ! vertically summed col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd) real(r8), pointer :: h2osoi_liqice_10cm_col (:) ! col liquid water + ice lens in top 10cm of soil (kg/m2) real(r8), pointer :: h2osoi_vol_col (:,:) ! col volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) + real(r8), pointer :: h2osoi_vol_prs_col (:,:) ! col volumetric soil water prescribed (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) real(r8), pointer :: air_vol_col (:,:) ! col air filled porosity real(r8), pointer :: h2osoi_liqvol_col (:,:) ! col volumetric liquid water content (v/v) real(r8), pointer :: h2ocan_patch (:) ! patch canopy water (mm H2O) @@ -184,6 +185,7 @@ subroutine InitAllocate(this, bounds) allocate(this%h2osno_old_col (begc:endc)) ; this%h2osno_old_col (:) = nan allocate(this%h2osoi_liqice_10cm_col (begc:endc)) ; this%h2osoi_liqice_10cm_col (:) = nan allocate(this%h2osoi_vol_col (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol_col (:,:) = nan + allocate(this%h2osoi_vol_prs_col (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol_prs_col (:,:) = nan allocate(this%air_vol_col (begc:endc, 1:nlevgrnd)) ; this%air_vol_col (:,:) = nan allocate(this%h2osoi_liqvol_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_liqvol_col (:,:) = nan allocate(this%h2osoi_ice_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_ice_col (:,:) = nan @@ -248,7 +250,7 @@ subroutine InitHistory(this, bounds) ! ! !USES: use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varctl , only : use_cn, use_lch4 + use clm_varctl , only : use_cn, use_lch4, use_soil_moisture_streams use clm_varctl , only : hist_wrtch4diag use clm_varpar , only : nlevsno, nlevsoi use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal, no_snow_zero @@ -287,6 +289,13 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='volumetric soil water (vegetated landunits only)', & ptr_col=this%h2osoi_vol_col, l2g_scale_type='veg') + if ( use_soil_moisture_streams )then + data2dptr => this%h2osoi_vol_prs_col(begc:endc,1:nlevsoi) + call hist_addfld2d (fname='H2OSOI_PRESCRIBED', units='mm3/mm3', type2d='levsoi', & + avgflag='A', long_name='volumetric soil water prescribed (vegetated landunits only)', & + ptr_col=this%h2osoi_vol_prs_col, l2g_scale_type='veg') + end if + ! this%h2osoi_liq_col(begc:endc,:) = spval ! call hist_addfld2d (fname='SOILLIQ', units='kg/m2', type2d='levgrnd', & ! avgflag='A', long_name='soil liquid water (vegetated landunits only)', & @@ -738,6 +747,7 @@ subroutine InitCold(this, bounds, & ! and urban pervious road (other urban columns have zero soil water) this%h2osoi_vol_col(bounds%begc:bounds%endc, 1:) = spval + this%h2osoi_vol_prs_col(bounds%begc:bounds%endc, 1:) = spval this%h2osoi_liq_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval this%h2osoi_ice_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval do c = bounds%begc,bounds%endc diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 96c73ca16d..2e8b8b5f23 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -80,7 +80,7 @@ module clm_driver use clm_instMod use clm_initializeMod , only : soil_water_retention_curve use EDBGCDynMod , only : EDBGCDyn, EDBGCDynSummary - use SoilMoistureStreamMod , only : PrescribedSoilMoistureInterp + use SoilMoistureStreamMod , only : PrescribedSoilMoistureInterp, PrescribedSoilMoistureAdvance ! ! !PUBLIC TYPES: implicit none @@ -322,10 +322,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe). ! ============================================================================ if (use_soil_moisture_streams) then - call t_startf('prescribed_sm') - call PrescribedSoilMoistureInterp(bounds_proc, soilstate_inst, & - waterstate_inst) - call t_stopf('prescribed_sm') + !call t_startf('prescribed_sm') + !call PrescribedSoilMoistureAdvance( bounds_proc ) + !call t_stopf('prescribed_sm') endif ! ============================================================================ ! Initialize the column-level mass balance checks for water, carbon & nitrogen. @@ -346,6 +345,14 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) + if (use_soil_moisture_streams) then + call t_startf('prescribed_sm') + call PrescribedSoilMoistureAdvance( bounds_clump ) + call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & + waterstate_inst) + call t_stopf('prescribed_sm') + endif + call t_startf('begwbal') call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & From 391722efa672fb1b33dd94487d8726aaccc96f4b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 31 Oct 2019 18:24:46 -0600 Subject: [PATCH 549/730] Correct arguments to setup_logic_soilm_streams Properly send $opts down to it, and use it in calls inside. Also add a check that this isn't a transient use case for soil streams with linear time-interpolation as that will likely cause an error going from a vegetated point that is missing to not, or vice versa. Also add a check for that. And fix the soilm test which had phys in place of conopts. --- bld/CLMBuildNamelist.pm | 19 ++++++++++++------- bld/unit_testers/build-namelist_test.pl | 9 +++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 712c56c0da..4367062454 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3531,28 +3531,33 @@ sub setup_logic_megan { sub setup_logic_soilm_streams { # prescribed soil moisture streams require clm4_5/clm5_0 - my ($test_files, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams'); if ( &value_is_true( $nl->get_value('use_soil_moisture_streams') ) ) { - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_tintalgo', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_tintalgo', 'hgrid'=>$nl_flags->{'res'} ); - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_soilm', 'phys'=>$nl_flags->{'phys'}, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_soilm', 'phys'=>$nl_flags->{'phys'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_soilm', 'phys'=>$nl_flags->{'phys'}, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_soilm', 'phys'=>$nl_flags->{'phys'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); # Set align year, if first and last years are different if ( $nl->get_value('stream_year_first_soilm') != $nl->get_value('stream_year_last_soilm') ) { - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_soilm', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); } - add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_soilm', 'phys'=>$nl_flags->{'phys'}, + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_soilm', 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'} ); + if ( ($opts->{'use_case'} =~ /_transient$/) && + (remove_leading_and_trailing_quotes($nl->get_value("soilm_tintalgo")) eq "linear") ) { + $log->fatal_error("For a transient case, soil moisture streams, must NOT use soilm_tintalgo='linear'" . + " since vegetated areas could go from missing to not missing or vice versa" ); + } } else { if ( defined($nl->get_value('stream_year_first_soilm')) || defined($nl->get_value('model_year_align_soilm')) || diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 4b9594b6b3..763be3628f 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,7 +123,7 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 829; +my $ntests = 830; if ( defined($opts{'compare'}) ) { $ntests += 504; } @@ -413,7 +413,12 @@ sub make_env_run { "soilm_stream wo use" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='missing_file'", GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", + conopts=>"-phys clm5_0", + }, + "soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient", + namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15", namelst=>"", From 31ed3848305d91c9b7149c86430930803bf12b51 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 31 Oct 2019 21:21:44 -0600 Subject: [PATCH 550/730] Change H2OSOI_PRESRIBED to be gridcell only Change h2osoi_prs to be on gridcell. Do some checking for spval in soil moisture streams. Added a check that prints a warning and a commented out endrun (until we have a dataset in full agreement). --- src/biogeophys/SoilMoistureStreamMod.F90 | 53 +++++++++++++++++------- src/biogeophys/WaterStateType.F90 | 12 +++--- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index d59453bd7d..a512232ace 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -258,7 +258,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! !USES: use clm_time_manager, only : get_curr_date use clm_varpar , only : nlevsoi - use clm_varcon , only : denh2o, denice, watmin + use clm_varcon , only : denh2o, denice, watmin, spval use landunit_varcon , only : istsoil, istcrop ! ! !ARGUMENTS: @@ -289,27 +289,44 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) - h2osoi_vol_prs => waterstate_inst%h2osoi_vol_prs_col & ! Output: prescribed volumetric soil water (m3/m3) + h2osoi_vol_prs => waterstate_inst%h2osoi_vol_prs_grc & ! Output: prescribed volumetric soil water (m3/m3) ) SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) + ! + ! Set the prescribed soil moisture read from the file everywhere + ! + do g = bounds%begg, bounds%endg + ig = g_to_ig(g) + do j = 1, nlevsoi + + n = ig + (j-1)*size(g_to_ig) - - ! Read data from stream into column level variable + h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) + + ! If soil moiture is being interpolated in time and the result is + ! large that probably means one of the two data points is missing (set to spval) + if ( h2osoi_vol_prs(g,j) > 10.0_r8 )then + h2osoi_vol_prs(g,j) = spval + end if + + end do + end do do c = bounds%begc, bounds%endc - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c)) == istcrop) then - ! - ! Set variable for each gridcell/column combination - ! - ig = g_to_ig(col%gridcell(c)) + ! + ! Set variable for each gridcell/column combination + ! + g = col%gridcell(c) + ig = g_to_ig(g) + if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c)) == istcrop) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi @@ -321,9 +338,17 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! save original soil moisture value h2osoi_vol_initial = h2osoi_vol(c,j) - ! update volumetric soil moisture - h2osoi_vol(c,j) = sdat_soilm%avs(1)%rAttr(ism,n) - h2osoi_vol_prs(c,j) = sdat_soilm%avs(1)%rAttr(ism,n) + ! Check if the vegetated land mask from the dataset on the + ! file is different + if ( h2osoi_vol_prs(g,j) == spval )then + write(iulog,*) 'WARNING: Input soil moisture dataset is not vegetated as expected', g, j + !call endrun(subname // ':: The input soil moisture stream is NOT vegetated for one of the land points' ) + !cycle + end if + + ! update volumetric soil moisture from data prescribed from the file + h2osoi_vol(c,j) = h2osoi_vol_prs(g,j) + ! calculate liq/ice mass fractions soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 6d79e5c633..47253d710c 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -40,7 +40,7 @@ module WaterstateType real(r8), pointer :: h2osoi_ice_tot_col (:) ! vertically summed col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd) real(r8), pointer :: h2osoi_liqice_10cm_col (:) ! col liquid water + ice lens in top 10cm of soil (kg/m2) real(r8), pointer :: h2osoi_vol_col (:,:) ! col volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) - real(r8), pointer :: h2osoi_vol_prs_col (:,:) ! col volumetric soil water prescribed (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) + real(r8), pointer :: h2osoi_vol_prs_grc (:,:) ! grc volumetric soil water prescribed (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) real(r8), pointer :: air_vol_col (:,:) ! col air filled porosity real(r8), pointer :: h2osoi_liqvol_col (:,:) ! col volumetric liquid water content (v/v) real(r8), pointer :: h2ocan_patch (:) ! patch canopy water (mm H2O) @@ -185,7 +185,7 @@ subroutine InitAllocate(this, bounds) allocate(this%h2osno_old_col (begc:endc)) ; this%h2osno_old_col (:) = nan allocate(this%h2osoi_liqice_10cm_col (begc:endc)) ; this%h2osoi_liqice_10cm_col (:) = nan allocate(this%h2osoi_vol_col (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol_col (:,:) = nan - allocate(this%h2osoi_vol_prs_col (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol_prs_col (:,:) = nan + allocate(this%h2osoi_vol_prs_grc (begg:endg, 1:nlevgrnd)) ; this%h2osoi_vol_prs_grc (:,:) = nan allocate(this%air_vol_col (begc:endc, 1:nlevgrnd)) ; this%air_vol_col (:,:) = nan allocate(this%h2osoi_liqvol_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_liqvol_col (:,:) = nan allocate(this%h2osoi_ice_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_ice_col (:,:) = nan @@ -290,10 +290,10 @@ subroutine InitHistory(this, bounds) ptr_col=this%h2osoi_vol_col, l2g_scale_type='veg') if ( use_soil_moisture_streams )then - data2dptr => this%h2osoi_vol_prs_col(begc:endc,1:nlevsoi) - call hist_addfld2d (fname='H2OSOI_PRESCRIBED', units='mm3/mm3', type2d='levsoi', & + data2dptr => this%h2osoi_vol_prs_grc(begg:endg,1:nlevsoi) + call hist_addfld2d (fname='H2OSOI_PRESCRIBED_GRC', units='mm3/mm3', type2d='levsoi', & avgflag='A', long_name='volumetric soil water prescribed (vegetated landunits only)', & - ptr_col=this%h2osoi_vol_prs_col, l2g_scale_type='veg') + ptr_gcell=this%h2osoi_vol_prs_grc ) end if ! this%h2osoi_liq_col(begc:endc,:) = spval @@ -747,7 +747,7 @@ subroutine InitCold(this, bounds, & ! and urban pervious road (other urban columns have zero soil water) this%h2osoi_vol_col(bounds%begc:bounds%endc, 1:) = spval - this%h2osoi_vol_prs_col(bounds%begc:bounds%endc, 1:) = spval + this%h2osoi_vol_prs_grc(bounds%begg:bounds%endg, 1:) = spval this%h2osoi_liq_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval this%h2osoi_ice_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval do c = bounds%begc,bounds%endc From ef35f631516701f1e4223e67ae2979e3bee785ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 31 Oct 2019 21:25:12 -0600 Subject: [PATCH 551/730] Move it back to just operating over nat-veg --- src/biogeophys/SoilMoistureStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index a512232ace..ab7a60111a 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -326,7 +326,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & g = col%gridcell(c) ig = g_to_ig(g) - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c)) == istcrop) then + if (lun%itype(col%landunit(c)) == istsoil ) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi From 0710e2983981de101a56eaf6e7708994399928f3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 31 Oct 2019 23:40:02 -0600 Subject: [PATCH 552/730] Add in soilm_offset --- bld/CLMBuildNamelist.pm | 5 +++++ bld/namelist_files/namelist_defaults_clm4_5.xml | 1 + bld/namelist_files/namelist_definition_clm4_5.xml | 5 +++++ src/biogeophys/SoilMoistureStreamMod.F90 | 9 +++++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 712c56c0da..58b266088a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3538,6 +3538,8 @@ sub setup_logic_soilm_streams { if ( &value_is_true( $nl->get_value('use_soil_moisture_streams') ) ) { add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_tintalgo', 'hgrid'=>$nl_flags->{'res'} ); + add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilm_offset', + 'hgrid'=>$nl_flags->{'res'} ); add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_soilm', 'phys'=>$nl_flags->{'phys'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); @@ -3557,9 +3559,12 @@ sub setup_logic_soilm_streams { if ( defined($nl->get_value('stream_year_first_soilm')) || defined($nl->get_value('model_year_align_soilm')) || defined($nl->get_value('stream_fldfilename_soilm')) || + defined($nl->get_value('soilm_tintalgo')) || + defined($nl->get_value('soilm_offset')) || defined($nl->get_value('stream_year_last_soilm')) ) { $log->fatal_error("One of the soilm streams namelist items (stream_year_first_soilm, " . " model_year_align_soilm, stream_fldfilename_soilm, stream_fldfilename_soilm)" . + " soilm_tintalgo soilm_offset" . " is defined, but use_soil_moisture_streams option NOT set to true"); } } diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 657f510361..69463518b3 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1101,6 +1101,7 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc linear +0 .false. diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 5c93ee849f..6756932f1e 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1584,6 +1584,11 @@ Filename of input stream data for prescribed soil moisture streams data Time interpolation method to use for prescribed soil moisture streams data + +Offset in time coordinate for soil moisture streams (sec) + + diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index d59453bd7d..87674f2718 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -86,6 +86,7 @@ subroutine PrescribedSoilMoistureInit(bounds) integer :: model_year_align_soilm ! align stream_year_first_soilm with integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag + integer :: soilm_offset ! Offset in time for dataset (sec) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm @@ -102,7 +103,8 @@ subroutine PrescribedSoilMoistureInit(bounds) stream_year_first_soilm, & stream_year_last_soilm, & model_year_align_soilm, & - soilm_tintalgo, & + soilm_tintalgo, & + soilm_offset, & stream_fldfilename_soilm ! Default values for namelist @@ -110,6 +112,7 @@ subroutine PrescribedSoilMoistureInit(bounds) stream_year_last_soilm = 1 ! last year in stream to use model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year stream_fldfilename_soilm = shr_stream_file_null + soilm_offset = 0 ! Read soilm_streams namelist if (masterproc) then @@ -133,6 +136,7 @@ subroutine PrescribedSoilMoistureInit(bounds) call shr_mpi_bcast(model_year_align_soilm, mpicom) call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) call shr_mpi_bcast(soilm_tintalgo, mpicom) + call shr_mpi_bcast(soilm_offset, mpicom) if (masterproc) then @@ -143,6 +147,7 @@ subroutine PrescribedSoilMoistureInit(bounds) write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) + write(iulog,*) ' soilm_offset = ',trim(soilm_offset) endif @@ -165,7 +170,7 @@ subroutine PrescribedSoilMoistureInit(bounds) yearFirst=stream_year_first_soilm, & yearLast=stream_year_last_soilm, & yearAlign=model_year_align_soilm, & - offset=0, & + offset=soilm_offset, & domFilePath='', & domFileName=trim(stream_fldFileName_soilm), & domTvarName='time', & From 9bd6929502acf3a861ba4255c732fca97ff999b0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 31 Oct 2019 23:47:00 -0600 Subject: [PATCH 553/730] Fix write of soilm_offset --- src/biogeophys/SoilMoistureStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 87674f2718..52e5cfe0e6 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -147,7 +147,7 @@ subroutine PrescribedSoilMoistureInit(bounds) write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) - write(iulog,*) ' soilm_offset = ',trim(soilm_offset) + write(iulog,*) ' soilm_offset = ',soilm_offset endif From c8a0ccb0aad6da1caa34b1b87b37819e4264596b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 3 Nov 2019 23:57:12 -0700 Subject: [PATCH 554/730] Add soilm_ignore_data_if_missing as a namelist option --- bld/namelist_files/namelist_definition_clm4_5.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index 6756932f1e..af30e8d87e 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1589,6 +1589,14 @@ Time interpolation method to use for prescribed soil moisture streams data Offset in time coordinate for soil moisture streams (sec) + +If false will abort if using soil moisture streams and find a point where the model shows H2OSOI_VOL +should be set because it's vegetated, but the input soilm streams dataset shows that point is missing. +If true, will ignore the prescribed soilm data for that point and let the model run for that point without +prescribed data. + + From c8b41274cfcc00cee11285d3e58b3e7d846b0e82 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Nov 2019 12:11:38 -0700 Subject: [PATCH 555/730] Add soilm_ignore_data_if_missing Add new namelist item soilm_ignore_data_if_missing and react to it. Also use old way for the indexing in an attempt to reproduce the previous results. If soilm_ignore_data_if_missing is true and find a missing point expected continue calculation as before. If not abort when that point is found. Also comment out the section where values greater than 10 were set to spval as that changes answers. --- src/biogeophys/SoilMoistureStreamMod.F90 | 78 +++++++++++++++++------- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index b9e8ec2f01..64ea80a4ac 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -41,9 +41,12 @@ module SoilMoistureStreamMod public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data ! !PRIVATE MEMBER DATA: - type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream - integer :: ism ! Soil moisture steram index + type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream + integer :: ism ! Soil moisture steram index integer, allocatable :: g_to_ig(:) + logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data + ! from the streams file, if the streams file shows that point + ! as missing (namelist item) ! ! !PRIVATE TYPES: @@ -99,20 +102,22 @@ subroutine PrescribedSoilMoistureInit(bounds) ! ! deal with namelist variables here in init ! - namelist /soil_moisture_streams/ & - stream_year_first_soilm, & - stream_year_last_soilm, & - model_year_align_soilm, & - soilm_tintalgo, & - soilm_offset, & + namelist /soil_moisture_streams/ & + stream_year_first_soilm, & + stream_year_last_soilm, & + model_year_align_soilm, & + soilm_tintalgo, & + soilm_offset, & + soilm_ignore_data_if_missing, & stream_fldfilename_soilm ! Default values for namelist - stream_year_first_soilm = 1 ! first year in stream to use - stream_year_last_soilm = 1 ! last year in stream to use - model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year - stream_fldfilename_soilm = shr_stream_file_null - soilm_offset = 0 + stream_year_first_soilm = 1 ! first year in stream to use + stream_year_last_soilm = 1 ! last year in stream to use + model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year + stream_fldfilename_soilm = shr_stream_file_null + soilm_offset = 0 + soilm_ignore_data_if_missing = .false. ! Read soilm_streams namelist if (masterproc) then @@ -137,6 +142,7 @@ subroutine PrescribedSoilMoistureInit(bounds) call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) call shr_mpi_bcast(soilm_tintalgo, mpicom) call shr_mpi_bcast(soilm_offset, mpicom) + call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) if (masterproc) then @@ -148,6 +154,11 @@ subroutine PrescribedSoilMoistureInit(bounds) write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) write(iulog,*) ' soilm_offset = ',soilm_offset + if ( soilm_ignore_data_if_missing )then + write(iulog,*) ' Do NOT override a point with streams data if the streams data is missing' + else + write(iulog,*) ' Abort, if you find a model point where the input streams data is set to missing value' + end if endif @@ -300,6 +311,22 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,2) >= nlevsoi ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) @@ -311,15 +338,16 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ig = g_to_ig(g) do j = 1, nlevsoi - n = ig + (j-1)*size(g_to_ig) + !n = ig + (j-1)*size(g_to_ig) + n = ig + (j-1)*(bounds%endg-bounds%begg+1) h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) ! If soil moiture is being interpolated in time and the result is ! large that probably means one of the two data points is missing (set to spval) - if ( h2osoi_vol_prs(g,j) > 10.0_r8 )then - h2osoi_vol_prs(g,j) = spval - end if + !if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then + !h2osoi_vol_prs(g,j) = spval + !end if end do end do @@ -332,10 +360,12 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ig = g_to_ig(g) if (lun%itype(col%landunit(c)) == istsoil ) then + !if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) ) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi - n = ig + (j-1)*size(g_to_ig) + !n = ig + (j-1)*size(g_to_ig) + n = ig + (j-1)*(bounds%endg-bounds%begg+1) ! if soil water is zero, liq/ice fractions cannot be calculated if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then @@ -345,10 +375,14 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! Check if the vegetated land mask from the dataset on the ! file is different - if ( h2osoi_vol_prs(g,j) == spval )then - write(iulog,*) 'WARNING: Input soil moisture dataset is not vegetated as expected', g, j - !call endrun(subname // ':: The input soil moisture stream is NOT vegetated for one of the land points' ) - !cycle + if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then + if ( soilm_ignore_data_if_missing )then + !cycle + else + write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & + g, ' active = ', col%active(c) + call endrun(subname // ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) + end if end if ! update volumetric soil moisture from data prescribed from the file From 46a146c24d73f8ee2433277dd4755926221136a2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 7 Nov 2019 13:08:19 -0700 Subject: [PATCH 556/730] Checkin version that is identical to release-clm5.0.27 OK, this is a version that is identical to release-clm5.0.27. Found out the issue was that lai_interp can't be moved the way I did. It needs to be divided into the streams part and non-streams part like is being done in SoilMoistureStreams. So this replicates answers for SMS_P720x1_D_Ld3.f09_g17.I2000Clm50SpGs.cheyenne_intel.clm-prescribed --- src/biogeochem/SatellitePhenologyMod.F90 | 5 +++++ src/main/clm_driver.F90 | 22 ++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index dd9e7c9f56..a7d8249916 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -332,6 +332,11 @@ subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] ) + if (use_lai_streams) then + call lai_interp(bounds, canopystate_inst) + endif + + do fp = 1, num_nolakep p = filter_nolakep(fp) c = patch%column(p) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 2e8b8b5f23..26ae25b19f 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -322,9 +322,11 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe). ! ============================================================================ if (use_soil_moisture_streams) then - !call t_startf('prescribed_sm') - !call PrescribedSoilMoistureAdvance( bounds_proc ) - !call t_stopf('prescribed_sm') + call t_startf('prescribed_sm') + call PrescribedSoilMoistureAdvance( bounds_proc ) + call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & + waterstate_inst) + call t_stopf('prescribed_sm') endif ! ============================================================================ ! Initialize the column-level mass balance checks for water, carbon & nitrogen. @@ -345,14 +347,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) - if (use_soil_moisture_streams) then - call t_startf('prescribed_sm') - call PrescribedSoilMoistureAdvance( bounds_clump ) - call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & - waterstate_inst) - call t_stopf('prescribed_sm') - endif - call t_startf('begwbal') call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & @@ -404,9 +398,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! When LAI streams are being used ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) - if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then - call lai_interp(bounds_proc, canopystate_inst) - endif + !if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then + !call lai_interp(bounds_proc, canopystate_inst) + !endif ! ============================================================================ ! Initialize variables from previous time step, downscale atm forcings, and From 8f85fe00bc0b21271f6b72b650e176121c448572 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 7 Nov 2019 13:20:09 -0700 Subject: [PATCH 557/730] OK now separate out the calls to SoilMoistureAdvance to the processor level and SoilMoistureInterp to the OMP clump level --- src/main/clm_driver.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 26ae25b19f..64e031b286 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -324,8 +324,6 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro if (use_soil_moisture_streams) then call t_startf('prescribed_sm') call PrescribedSoilMoistureAdvance( bounds_proc ) - call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & - waterstate_inst) call t_stopf('prescribed_sm') endif ! ============================================================================ @@ -347,6 +345,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) + if (use_soil_moisture_streams) then + call t_startf('prescribed_sm') + call PrescribedSoilMoistureInterp(bounds_clump, soilstate_inst, & + waterstate_inst) + call t_stopf('prescribed_sm') + endif call t_startf('begwbal') call BeginWaterBalance(bounds_clump, & filter(nc)%num_nolakec, filter(nc)%nolakec, & From 6b9c698a129943db1fdcc32901d1b5bc12a0c4b9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 7 Nov 2019 13:31:25 -0700 Subject: [PATCH 558/730] Divide LAI into lai_advance for streams to be in a non-OpenMP area, and lai_interp called from within an OpenMP threading loop --- src/biogeochem/SatellitePhenologyMod.F90 | 41 ++++++++++++++++++------ src/main/clm_driver.F90 | 8 ++--- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index a7d8249916..e294238d3d 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -39,11 +39,12 @@ module SatellitePhenologyMod public :: SatellitePhenologyInit ! Dynamically allocate memory public :: interpMonthlyVeg ! interpolate monthly vegetation data public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition) - public :: lai_interp ! interpolates between two years of LAI data (when LAI streams are being used) + public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop) ! ! !PRIVATE MEMBER FUNCTIONS: private :: readMonthlyVegetation ! read monthly vegetation data for two months - private :: lai_init ! position datasets for LAI + private :: lai_init ! position datasets for LAI + private :: lai_interp ! interpolates between two years of LAI data (when LAI streams are being used) ! !PRIVATE MEMBER DATA: type(shr_strdata_type) :: sdat_lai ! LAI input data stream @@ -194,30 +195,25 @@ end subroutine lai_init !----------------------------------------------------------------------- ! - ! lai_interp + ! lai_advance ! !----------------------------------------------------------------------- - subroutine lai_interp(bounds, canopystate_inst) + subroutine lai_advance() ! - ! Interpolate data stream information for Lai. + ! Advance LAI streams ! ! !USES: use clm_time_manager, only : get_curr_date - use pftconMod , only : noveg ! ! !ARGUMENTS: implicit none - type(bounds_type) , intent(in) :: bounds - type(canopystate_type) , intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: - integer :: ivt, p, g, ip, ig, gpft integer :: year ! year (0, ...) for nstep+1 integer :: mon ! month (1, ..., 12) for nstep+1 integer :: day ! day of month (1, ..., 31) for nstep+1 integer :: sec ! seconds into current date for nstep+1 integer :: mcdate ! Current model date (yyyymmdd) - character(len=CL) :: stream_var_name !----------------------------------------------------------------------- call get_curr_date(year, mon, day, sec) @@ -225,6 +221,31 @@ subroutine lai_interp(bounds, canopystate_inst) call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') + end subroutine lai_advance + + + !----------------------------------------------------------------------- + ! + ! lai_interp + ! + !----------------------------------------------------------------------- + subroutine lai_interp(bounds, canopystate_inst) + ! + ! Interpolate data stream information for Lai. + ! + ! !USES: + use pftconMod , only : noveg + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + type(canopystate_type) , intent(inout) :: canopystate_inst + ! + ! !LOCAL VARIABLES: + integer :: ivt, p, g, ip, ig, gpft + character(len=CL) :: stream_var_name + !----------------------------------------------------------------------- + do p = bounds%begp, bounds%endp ivt = patch%itype(p) if (ivt /= noveg) then ! vegetated pft diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 64e031b286..1803b6ae5e 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -110,7 +110,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! !USES: use clm_time_manager , only : get_curr_date use clm_varctl , only : use_lai_streams - use SatellitePhenologyMod, only : lai_interp + use SatellitePhenologyMod, only : lai_advance ! ! !ARGUMENTS: implicit none @@ -402,9 +402,9 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! When LAI streams are being used ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) - !if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then - !call lai_interp(bounds_proc, canopystate_inst) - !endif + if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then + call lai_advance() + endif ! ============================================================================ ! Initialize variables from previous time step, downscale atm forcings, and From beabec6635cccddea68fd1b973005f46d3ebe964 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 10 Nov 2019 00:53:19 -0700 Subject: [PATCH 559/730] Get working with threading --- src/biogeochem/SatellitePhenologyMod.F90 | 35 ++++++++++++++---------- src/biogeophys/SoilMoistureStreamMod.F90 | 11 ++++---- src/main/clm_driver.F90 | 2 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index e294238d3d..76d46d8ac7 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -1,5 +1,7 @@ module SatellitePhenologyMod +#include "shr_assert.h" + !----------------------------------------------------------------------- ! !DESCRIPTION: ! CLM Satelitte Phenology model (SP) ecosystem dynamics (phenology, vegetation). @@ -50,6 +52,7 @@ module SatellitePhenologyMod type(shr_strdata_type) :: sdat_lai ! LAI input data stream ! ! !PRIVATE TYPES: + integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index integer , private :: InterpMonths1 ! saved month index real(r8), private :: timwt(2) ! time weights for month 1 and month 2 real(r8), private, allocatable :: mlai2t(:,:) ! lai for interpolation (2 months) @@ -198,7 +201,7 @@ end subroutine lai_init ! lai_advance ! !----------------------------------------------------------------------- - subroutine lai_advance() + subroutine lai_advance( bounds ) ! ! Advance LAI streams ! @@ -207,8 +210,10 @@ subroutine lai_advance() ! ! !ARGUMENTS: implicit none + type(bounds_type) , intent(in) :: bounds ! ! !LOCAL VARIABLES: + integer :: g, ig ! Indices integer :: year ! year (0, ...) for nstep+1 integer :: mon ! month (1, ..., 12) for nstep+1 integer :: day ! day of month (1, ..., 31) for nstep+1 @@ -220,6 +225,15 @@ subroutine lai_advance() mcdate = year*10000 + mon*100 + day call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') + if ( .not. allocated(g_to_ig) )then + allocate (g_to_ig(bounds%begg:bounds%endg) ) + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + end if end subroutine lai_advance @@ -242,10 +256,13 @@ subroutine lai_interp(bounds, canopystate_inst) type(canopystate_type) , intent(inout) :: canopystate_inst ! ! !LOCAL VARIABLES: - integer :: ivt, p, g, ip, ig, gpft + integer :: ivt, p, ip, ig character(len=CL) :: stream_var_name !----------------------------------------------------------------------- - + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__) do p = bounds%begp, bounds%endp ivt = patch%itype(p) if (ivt /= noveg) then ! vegetated pft @@ -253,17 +270,7 @@ subroutine lai_interp(bounds, canopystate_inst) stream_var_name = 'LAI_'//trim(adjustl(stream_var_name)) ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name)) endif - gpft = patch%gridcell(p) - - ! - ! Determine vector index corresponding to gpft - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == gpft) exit - end do - + ig = g_to_ig(patch%gridcell(p)) ! ! Set lai for each gridcell/patch combination ! diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 64ea80a4ac..27a1043af9 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -43,7 +43,7 @@ module SoilMoistureStreamMod ! !PRIVATE MEMBER DATA: type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream integer :: ism ! Soil moisture steram index - integer, allocatable :: g_to_ig(:) + integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data ! from the streams file, if the streams file shows that point ! as missing (namelist item) @@ -297,8 +297,8 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) == g_to_ig(bounds%begg) ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) == g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) >= g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) associate( & dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) @@ -339,7 +339,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & do j = 1, nlevsoi !n = ig + (j-1)*size(g_to_ig) - n = ig + (j-1)*(bounds%endg-bounds%begg+1) + n = ig + (j-1)*size(g_to_ig) h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) @@ -364,8 +364,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi - !n = ig + (j-1)*size(g_to_ig) - n = ig + (j-1)*(bounds%endg-bounds%begg+1) + n = ig + (j-1)*size(g_to_ig) ! if soil water is zero, liq/ice fractions cannot be calculated if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 1803b6ae5e..216e383bbb 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -403,7 +403,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! When LAI streams are being used ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb) .and. use_lai_streams) then - call lai_advance() + call lai_advance( bounds_proc ) endif ! ============================================================================ From ec59232c4e3bbbfcfc64f638d24ea399b623d4f5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 10 Nov 2019 01:07:44 -0700 Subject: [PATCH 560/730] Make H2OSOI_PRESCRIBED_GRC optional, and add it to the prescribed test case --- cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm | 1 + src/biogeophys/SoilMoistureStreamMod.F90 | 1 - src/biogeophys/WaterStateType.F90 | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm index 2e3ab9129b..635c2f9562 100644 --- a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm @@ -1,2 +1,3 @@ use_soil_moisture_streams = .true. use_lai_streams = .true. + hist_fincl1 += 'H2OSOI_PRESCRIBED_GRC' diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 27a1043af9..6a6f2fa3b5 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -73,7 +73,6 @@ subroutine PrescribedSoilMoistureInit(bounds) use shr_pio_mod , only : shr_pio_getiotype use clm_nlUtilsMod , only : find_nlgroup_name use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d use shr_stream_mod , only : shr_stream_file_null use shr_string_mod , only : shr_string_listCreateField use clm_varpar , only : nlevsoi diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 47253d710c..dfcf93011f 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -293,7 +293,7 @@ subroutine InitHistory(this, bounds) data2dptr => this%h2osoi_vol_prs_grc(begg:endg,1:nlevsoi) call hist_addfld2d (fname='H2OSOI_PRESCRIBED_GRC', units='mm3/mm3', type2d='levsoi', & avgflag='A', long_name='volumetric soil water prescribed (vegetated landunits only)', & - ptr_gcell=this%h2osoi_vol_prs_grc ) + ptr_gcell=this%h2osoi_vol_prs_grc, default='inactive' ) end if ! this%h2osoi_liq_col(begc:endc,:) = spval From e803762f1b4755612a9f30eb1d816ad6cb4bc08e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 10 Nov 2019 14:27:03 -0700 Subject: [PATCH 561/730] Make a theading test run with the prescribed streams --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 081877b553..cf6d44d71c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -575,14 +575,14 @@ - + - + From dbc5ac96775df3d7995569aea5f128be98d734fb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 10 Nov 2019 21:31:38 -0700 Subject: [PATCH 562/730] Add tintalgo for: lai, lightning, pop-dens, urbantv, and ndep Add tintalgo settings for most of the streams. Also change the buildnml fatal-error for soilm_tintalgo='linear' for transient to a warning that can be overridden if desired. Also fix the build-namelist unit test for warnings, so it verifies that warnings die, but will run if -ignore_warnings is set. Also get maxpatch_pft to normally die if the two valid settings are used (79 or 17). --- bld/CLMBuildNamelist.pm | 33 +++++++++++++------ .../namelist_definition_clm4_5.xml | 25 ++++++++++++++ bld/unit_testers/build-namelist_test.pl | 17 +++++----- src/biogeochem/CNFireBaseMod.F90 | 15 +++++++-- src/biogeochem/SatellitePhenologyMod.F90 | 7 +++- src/biogeophys/UrbanTimeVarType.F90 | 8 +++-- src/main/ndepStreamMod.F90 | 11 +++++-- 7 files changed, 89 insertions(+), 27 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e6f3ca4eff..4a587971ea 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1041,12 +1041,22 @@ sub setup_cmdl_maxpft { $log->verbose_message("Using $nl_flags->{'maxpft'} for maxpft."); $var = "maxpatch_pft"; - $val = $nl_flags->{'maxpft'}; my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); + if ( ! defined($nl->get_variable_value($group, $var)) ) { + $val = $nl_flags->{'maxpft'}; + $nl->set_variable_value($group, $var, $val); + } + $val = $nl->get_variable_value($group, $var); + my @valid_values = ($maxpatchpft{'.true.'}, $maxpatchpft{'.false.'} ); + my $found = 0; + foreach my $valid_val ( @valid_values ) { + if ( $val == $valid_val ) { + $found = 1; + last; + } + } + if ( ! $found ) { + $log->warning("$var has a value ($val) that is normally NOT valid. Normal valid values are: @valid_values"); } } } @@ -3385,9 +3395,10 @@ sub setup_logic_popd_streams { if ( defined($nl->get_value('stream_year_first_popdens')) || defined($nl->get_value('stream_year_last_popdens')) || defined($nl->get_value('model_year_align_popdens')) || + defined($nl->get_value('popdens_tintalgo' )) || defined($nl->get_value('stream_fldfilename_popdens')) ) { $log->fatal_error("When bgc is SP (NOT CN or BGC) or fire_method==nofire none of: stream_year_first_popdens,\n" . - "stream_year_last_popdens, model_year_align_popdens, nor\n" . + "stream_year_last_popdens, model_year_align_popdens, popdens_tintalgo nor\n" . "stream_fldfilename_popdens can be set!"); } } @@ -3451,9 +3462,10 @@ sub setup_logic_lightning_streams { if ( defined($nl->get_value('stream_year_first_lightng')) || defined($nl->get_value('stream_year_last_lightng')) || defined($nl->get_value('model_year_align_lightng')) || + defined($nl->get_value('lightng_tintalgo' )) || defined($nl->get_value('stream_fldfilename_lightng')) ) { $log->fatal_error("When bgc is SP (NOT CN or BGC) or fire_method==nofire none of: stream_year_first_lightng,\n" . - "stream_year_last_lightng, model_year_align_lightng, nor\n" . + "stream_year_last_lightng, model_year_align_lightng, lightng_tintalgo nor\n" . "stream_fldfilename_lightng can be set!"); } } @@ -3557,8 +3569,8 @@ sub setup_logic_soilm_streams { 'hgrid'=>$nl_flags->{'res'} ); if ( ($opts->{'use_case'} =~ /_transient$/) && (remove_leading_and_trailing_quotes($nl->get_value("soilm_tintalgo")) eq "linear") ) { - $log->fatal_error("For a transient case, soil moisture streams, must NOT use soilm_tintalgo='linear'" . - " since vegetated areas could go from missing to not missing or vice versa" ); + $log->warning("For a transient case, soil moisture streams, should NOT use soilm_tintalgo='linear'" . + " since vegetated areas could go from missing to not missing or vice versa" ); } } else { if ( defined($nl->get_value('stream_year_first_soilm')) || @@ -3615,9 +3627,10 @@ sub setup_logic_lai_streams { if ( defined($nl->get_value('stream_year_first_lai')) || defined($nl->get_value('stream_year_last_lai')) || defined($nl->get_value('model_year_align_lai')) || + defined($nl->get_value('lai_tintalgo' )) || defined($nl->get_value('stream_fldfilename_lai')) ) { $log->fatal_error("When bgc is NOT SP none of the following can be set: stream_year_first_lai,\n" . - "stream_year_last_lai, model_year_align_lai, nor\n" . + "stream_year_last_lai, model_year_align_lai, lai_tintalgo nor\n" . "stream_fldfilename_lai (eg. don't use this option with BGC,CN,CNDV nor BGDCV)."); } } diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml index af30e8d87e..92508c7d06 100644 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ b/bld/namelist_files/namelist_definition_clm4_5.xml @@ -1526,6 +1526,11 @@ Time interpolation mode to determine how to handle data before and after the tim limit = Only use the data within the times available -- abort if the model tries to go outside it + +Time interpolation method to use for Nitrogen Deposition + + Colon delimited list of variables to read from the streams file for nitrogen deposition @@ -1628,6 +1633,11 @@ Simulation year that aligns with stream_year_first_lai value Filename of input stream data for LAI + +Time interpolation method to use with LAI streams + + Mapping method from LAI input file to the model resolution @@ -1664,6 +1674,11 @@ Simulation year that aligns with stream_year_first_lightng value Filename of input stream data for Lightning + +Time interpolation method to use with Lightning streams + + Mapping method from Lightning input file to the model resolution @@ -1701,6 +1716,11 @@ Simulation year that aligns with stream_year_first_popdens value Filename of input stream data for human population density + +Time interpolation method to use with human population density streams + + Mapping method from human population density input file to the model resolution @@ -1738,6 +1758,11 @@ Simulation year that aligns with stream_year_first_urbantv value Filename of input stream data for urban time varying + +Time interpolation method to use with urban time varying streams + + Mapping method from urban time varying input file to the model resolution diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 763be3628f..63407442f6 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -123,7 +123,7 @@ sub make_env_run { # # Figure out number of tests that will run # -my $ntests = 830; +my $ntests = 838; if ( defined($opts{'compare'}) ) { $ntests += 504; } @@ -415,11 +415,6 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient", - namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1022,16 +1017,21 @@ sub make_env_run { GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "use_c14_wo_bgc" =>{ options=>"-envxml_dir . -bgc cndv", + "use_c14_wo_bgc" =>{ options=>"-envxml_dir . -bgc cn", namelst=>"use_c14=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, - "maxpft_wrong" =>{ options=>"-envxml_dir . -bgc cndv", + "maxpft_wrong" =>{ options=>"-envxml_dir . -bgc cn", namelst=>"maxpatch_pft=19", GLC_TWO_WAY_COUPLING=>"FALSE", conopts=>"-phys clm5_0", }, + "soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient", + namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'", + GLC_TWO_WAY_COUPLING=>"FALSE", + conopts=>"-phys clm5_0", + }, "bad_megan_spec" =>{ options=>"-envxml_dir . -bgc bgc -megan", namelst=>"megan_specifier='ZZTOP=zztop'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1050,6 +1050,7 @@ sub make_env_run { # Now run with -ignore_warnings and make sure it works $options .= " -ignore_warnings"; eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; + is( $?, 0, $key ); is( $@, '', "$options" ); system( "cat $tempfile" ); } diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 04c3e232ed..e2b0273cd5 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -983,6 +983,7 @@ subroutine hdm_init( this, bounds, NLFilename ) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_popdens ! population density streams filename character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density + character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density character(*), parameter :: subName = "('hdmdyn_init')" character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" !----------------------------------------------------------------------- @@ -992,7 +993,8 @@ subroutine hdm_init( this, bounds, NLFilename ) stream_year_last_popdens, & model_year_align_popdens, & popdensmapalgo, & - stream_fldFileName_popdens + stream_fldFileName_popdens, & + popdens_tintalgo ! Default values for namelist stream_year_first_popdens = 1 ! first year in stream to use @@ -1019,6 +1021,7 @@ subroutine hdm_init( this, bounds, NLFilename ) call shr_mpi_bcast(stream_year_last_popdens, mpicom) call shr_mpi_bcast(model_year_align_popdens, mpicom) call shr_mpi_bcast(stream_fldFileName_popdens, mpicom) + call shr_mpi_bcast(popdens_tintalgo, mpicom) if (masterproc) then write(iulog,*) ' ' @@ -1027,6 +1030,7 @@ subroutine hdm_init( this, bounds, NLFilename ) write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens + write(iulog,*) ' popdens_tintalgo = ',popdens_tintalgo write(iulog,*) ' ' endif @@ -1056,7 +1060,7 @@ subroutine hdm_init( this, bounds, NLFilename ) fillalgo='none', & mapalgo=popdensmapalgo, & calendar=get_calendar(), & - tintalgo='nearest', & + tintalgo=popdens_tintalgo, & taxmode='extend' ) if (masterproc) then @@ -1135,6 +1139,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) integer :: nml_error ! namelist i/o error flag type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read + character(len=CL) :: lightng_tintalgo = 'linear'! time interpolation alogrithm character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm character(*), parameter :: subName = "('lnfmdyn_init')" character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)" @@ -1145,7 +1150,8 @@ subroutine lnfm_init( this, bounds, NLFilename ) stream_year_last_lightng, & model_year_align_lightng, & lightngmapalgo, & - stream_fldFileName_lightng + stream_fldFileName_lightng, & + lightng_tintalgo ! Default values for namelist stream_year_first_lightng = 1 ! first year in stream to use @@ -1172,6 +1178,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) call shr_mpi_bcast(stream_year_last_lightng, mpicom) call shr_mpi_bcast(model_year_align_lightng, mpicom) call shr_mpi_bcast(stream_fldFileName_lightng, mpicom) + call shr_mpi_bcast(lightng_tintalgo, mpicom) if (masterproc) then write(iulog,*) ' ' @@ -1180,6 +1187,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng + write(iulog,*) ' lightng_tintalgo = ',lightng_tintalgo write(iulog,*) ' ' endif @@ -1207,6 +1215,7 @@ subroutine lnfm_init( this, bounds, NLFilename ) fldListFile='lnfm', & fldListModel='lnfm', & fillalgo='none', & + tintalgo=lightng_tintalgo, & mapalgo=lightngmapalgo, & calendar=get_calendar(), & taxmode='cycle' ) diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 index 76d46d8ac7..fedf81e4d7 100644 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ b/src/biogeochem/SatellitePhenologyMod.F90 @@ -101,6 +101,7 @@ subroutine lai_init(bounds) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm + character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm character(*), parameter :: subName = "('laidyn_init')" character(*), parameter :: F00 = "('(laidyn_init) ',4a)" @@ -116,7 +117,8 @@ subroutine lai_init(bounds) stream_year_last_lai, & model_year_align_lai, & lai_mapalgo, & - stream_fldFileName_lai + stream_fldFileName_lai, & + lai_tintalgo ! Default values for namelist stream_year_first_lai = 1 ! first year in stream to use @@ -145,6 +147,7 @@ subroutine lai_init(bounds) call shr_mpi_bcast(stream_year_last_lai, mpicom) call shr_mpi_bcast(model_year_align_lai, mpicom) call shr_mpi_bcast(stream_fldFileName_lai, mpicom) + call shr_mpi_bcast(lai_tintalgo, mpicom) if (masterproc) then @@ -154,6 +157,7 @@ subroutine lai_init(bounds) write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai write(iulog,*) ' model_year_align_lai = ',model_year_align_lai write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) + write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo) endif @@ -187,6 +191,7 @@ subroutine lai_init(bounds) fldListModel=fldList, & fillalgo='none', & mapalgo=lai_mapalgo, & + tintalgo=lai_tintalgo, & calendar=get_calendar(), & taxmode='cycle' ) diff --git a/src/biogeophys/UrbanTimeVarType.F90 b/src/biogeophys/UrbanTimeVarType.F90 index 81ceb9cf1e..8c51bdf2fa 100644 --- a/src/biogeophys/UrbanTimeVarType.F90 +++ b/src/biogeophys/UrbanTimeVarType.F90 @@ -124,6 +124,7 @@ subroutine urbantv_init(this, bounds, NLFilename) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac + character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm character(SHR_KIND_CL) :: fldList ! field string character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string character(*), parameter :: subName = "('urbantv_init')" @@ -134,7 +135,8 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_year_last_urbantv, & model_year_align_urbantv, & urbantvmapalgo, & - stream_fldFileName_urbantv + stream_fldFileName_urbantv, & + urbantv_tintalgo !----------------------------------------------------------------------- begl = bounds%begl; endl = bounds%endl @@ -164,6 +166,7 @@ subroutine urbantv_init(this, bounds, NLFilename) call shr_mpi_bcast(stream_year_last_urbantv, mpicom) call shr_mpi_bcast(model_year_align_urbantv, mpicom) call shr_mpi_bcast(stream_fldFileName_urbantv, mpicom) + call shr_mpi_bcast(urbantv_tintalgo, mpicom) if (masterproc) then write(iulog,*) ' ' @@ -172,6 +175,7 @@ subroutine urbantv_init(this, bounds, NLFilename) write(iulog,*) ' stream_year_last_urbantv = ',stream_year_last_urbantv write(iulog,*) ' model_year_align_urbantv = ',model_year_align_urbantv write(iulog,*) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv + write(iulog,*) ' urbantv_tintalgo = ',urbantv_tintalgo write(iulog,*) ' ' endif @@ -211,7 +215,7 @@ subroutine urbantv_init(this, bounds, NLFilename) fillalgo='none', & mapalgo=urbantvmapalgo, & calendar=get_calendar(), & - tintalgo='linear', & + tintalgo=urbantv_tintalgo, & taxmode='extend' ) if (masterproc) then diff --git a/src/main/ndepStreamMod.F90 b/src/main/ndepStreamMod.F90 index 79bd86234d..1edc61d271 100644 --- a/src/main/ndepStreamMod.F90 +++ b/src/main/ndepStreamMod.F90 @@ -71,6 +71,7 @@ subroutine ndep_init(bounds, NLFilename) type(mct_ggrid) :: dom_clm ! domain information character(len=CL) :: stream_fldFileName_ndep character(len=CL) :: ndepmapalgo = 'bilinear' + character(len=CL) :: ndep_tintalgo = 'linear' character(len=CS) :: ndep_taxmode = 'extend' character(len=CL) :: ndep_varlist = 'NDEP_year' character(*), parameter :: shr_strdata_unset = 'NOT_SET' @@ -80,11 +81,12 @@ subroutine ndep_init(bounds, NLFilename) namelist /ndepdyn_nml/ & stream_year_first_ndep, & - stream_year_last_ndep, & + stream_year_last_ndep, & model_year_align_ndep, & ndepmapalgo, ndep_taxmode, & ndep_varlist, & - stream_fldFileName_ndep + stream_fldFileName_ndep, & + ndep_tintalgo ! Default values for namelist stream_year_first_ndep = 1 ! first year in stream to use @@ -115,6 +117,7 @@ subroutine ndep_init(bounds, NLFilename) call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) call shr_mpi_bcast(ndep_varlist , mpicom) call shr_mpi_bcast(ndep_taxmode , mpicom) + call shr_mpi_bcast(ndep_tintalgo , mpicom) if (masterproc) then write(iulog,*) ' ' @@ -125,6 +128,7 @@ subroutine ndep_init(bounds, NLFilename) write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep write(iulog,*) ' ndep_varList = ',ndep_varList write(iulog,*) ' ndep_taxmode = ',ndep_taxmode + write(iulog,*) ' ndep_tintalgo = ',ndep_tintalgo write(iulog,*) ' ' endif ! Read in units @@ -156,8 +160,9 @@ subroutine ndep_init(bounds, NLFilename) fldListModel=ndep_varlist, & fillalgo='none', & mapalgo=ndepmapalgo, & + tintalgo=ndep_tintalgo, & calendar=get_calendar(), & - taxmode=ndep_taxmode ) + taxmode=ndep_taxmode ) if (masterproc) then From 4591d1fa64a2f2ac3bdb7efd896dbd7f7f4f60f0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 10 Nov 2019 22:06:50 -0700 Subject: [PATCH 563/730] Point to cime5.6.25 --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 6e6bf92b3a..08a6d0695e 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.22 +tag = cime5.6.25 required = True [externals_description] From e71b025f6aa1b9f8a432dbdd895e2bdcd0989c54 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 11 Nov 2019 11:54:55 -0700 Subject: [PATCH 564/730] Change threaded prescribed test to f09 and present-day (as required for soil moisture streams) --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cf6d44d71c..d7d36fbbf3 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -575,14 +575,14 @@ - + - + From f3d9807748edfc68bc332cc1d189c72821fb9a08 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 11 Nov 2019 13:51:52 -0700 Subject: [PATCH 565/730] Rename testname with mp24 to crp for crop turned on --- test/tools/input_tests_master | 4 ++-- ...srfdt_1x1_numaIA_mp24_2000 => mksrfdt_1x1_numaIA_crp_2000} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename test/tools/nl_files/{mksrfdt_1x1_numaIA_mp24_2000 => mksrfdt_1x1_numaIA_crp_2000} (100%) diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master index 78f323fb3a..4050873b42 100644 --- a/test/tools/input_tests_master +++ b/test/tools/input_tests_master @@ -30,8 +30,8 @@ smi74 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-20 bli74 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds smi78 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds bli78 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds -smiT4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds -bliT4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds +smiT4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_2000^tools__ds +bliT4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_2000^tools__ds smiT2 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s bliT2 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_crp_SSP5-8.5_1850-2100^tools__s diff --git a/test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 b/test/tools/nl_files/mksrfdt_1x1_numaIA_crp_2000 similarity index 100% rename from test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 rename to test/tools/nl_files/mksrfdt_1x1_numaIA_crp_2000 From 4adf9863c04f1f9e3985ca0c5eac9e96abe40915 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 12 Nov 2019 13:34:39 -0800 Subject: [PATCH 566/730] Revert "removing calls to GetandSet in restart and cold_init subroutines. First appears to be not necessary and second screws up the cold start" This reverts commit ac16068ef6a75ecf5ee344d24c2e3cbadaa014c7. --- src/utils/clmfates_interfaceMod.F90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 3c81cf928b..6079a7017a 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -965,6 +965,9 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! I think that is it... ! --------------------------------------------------------------------------------- + ! Set the FATES global time and date variables + call GetAndSetTime + if(.not.initialized) then initialized=.true. @@ -1194,6 +1197,9 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins integer :: c + ! Set the FATES global time and date variables + call GetAndSetTime + nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) From 4d492dd02bdb994dd4af49cca09f0c2f232972ad Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Nov 2019 11:44:58 -0700 Subject: [PATCH 567/730] Correct to compset that can run for this --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d7d36fbbf3..07f98bf3c6 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -575,7 +575,7 @@ - + From b9023afc66b692c8735ada02419b72f740425133 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Nov 2019 11:59:28 -0700 Subject: [PATCH 568/730] Add support to run tools tests on izumi --- test/tools/test_driver.sh | 84 +++++++++++++++++++++++++++- test/tools/tests_posttag_izumi_nompi | 6 ++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 test/tools/tests_posttag_izumi_nompi diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 935b7d2dd2..618b7a8d08 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -225,12 +225,92 @@ dataroot="/fs/cgd/csm" export TOOLSSLIBS="" echo_arg="-e" +EOF +##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ + ;; + + ## izumi + izumi* | i*.unified.ucar.edu) + submit_script="test_driver_izumi_${cur_time}.sh" + export PATH=/cluster/torque/bin:${PATH} + +##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv +cat > ./${submit_script} << EOF +#!/bin/sh +# + +# Name of the queue (CHANGE THIS if needed) +#PBS -q long +# Number of nodes (CHANGE THIS if needed) +#PBS -l nodes=1:ppn=24 +# output file base name +#PBS -N test_dr +# Put standard error and standard out in same file +#PBS -j oe +# Export all Environment variables +#PBS -V +# End of options + +if [ -n "\$PBS_JOBID" ]; then #batch job + export JOBID=\`echo \${PBS_JOBID} | cut -f1 -d'.'\` + initdir=\${PBS_O_WORKDIR} +fi + +if [ "\$PBS_ENVIRONMENT" = "PBS_BATCH" ]; then + interactive="NO" + input_file="tests_posttag_izumi" +else + interactive="YES" + input_file="tests_posttag_izumi_nompi" +fi + +##omp threads +if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line + export CLM_THREADS=2 +fi +export CLM_RESTART_THREADS=1 + +##mpi tasks +export CLM_TASKS=24 +export CLM_RESTART_TASKS=20 + +export P4_GLOBMEMSIZE=500000000 + + +export CESM_MACH="izumi" + +ulimit -s unlimited +ulimit -c unlimited + +export CESM_COMP="intel" +export TOOLS_MAKE_STRING="USER_FC=ifort USER_CC=icc " +export TOOLS_CONF_STRING=" -mpilib mpi-serial" +export CFG_STRING="" +export INITMODULES="/usr/share/Modules/init/sh" + +. \$INITMODULES +module purge +module load compiler/intel/19.0.1 +module load tool/nco/4.7.5 +module load tool/netcdf/4.6.1/intel + +export NETCDF_DIR=\$NETCDF_PATH +export INC_NETCDF=\${NETCDF_PATH}/include +export LIB_NETCDF=\${NETCDF_PATH}/lib +export MAKE_CMD="gmake -j 5" ##using hyper-threading on izumi +export MACH_WORKSPACE="/scratch/cluster" +export CPRNC_EXE=/fs/cgd/csm/tools/cprnc_izumi/cprnc +export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" +dataroot="/fs/cgd/csm" +export TOOLSSLIBS="" +echo_arg="-e" + EOF ##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ ;; * ) - echo "Only setup to work on: cheyenne and hobart" + echo "Only setup to work on: cheyenne, hobart and izumi" exit @@ -542,7 +622,7 @@ case $arg1 in * ) echo "" echo "**********************" - echo "usage on cheyenne and hobart: " + echo "usage on cheyenne, hobart, and izumi: " echo "./test_driver.sh -i" echo "" echo "valid arguments: " diff --git a/test/tools/tests_posttag_izumi_nompi b/test/tools/tests_posttag_izumi_nompi new file mode 100644 index 0000000000..4655f29853 --- /dev/null +++ b/test/tools/tests_posttag_izumi_nompi @@ -0,0 +1,6 @@ +smc#4 blc#4 +smi54 bli54 +smi57 bli57 +smiT4 bliT4 +smf84 blf84 +smfc4 blfc4 From 790a61dc85ecdc494f28ad6e84be7431e931d933 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Nov 2019 12:00:01 -0700 Subject: [PATCH 569/730] Mark PGI tests as failing on izumi as well (until we get a fix for cime that gets them to work) --- cime_config/testdefs/ExpectedTestFails.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 24f2a42afc..d455390293 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -6,6 +6,8 @@ FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropQianGs.cheyenne_intel.clm-monthly RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN + FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop RUN + FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop RUN FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest From 0467225b030230e487dbbf5e7a339cd62f1d67bc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 13 Nov 2019 13:56:11 -0700 Subject: [PATCH 570/730] all_veg if was backwards --- tools/mksurfdata_map/src/mksurfdat.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_map/src/mksurfdat.F90 b/tools/mksurfdata_map/src/mksurfdat.F90 index 54babef5fe..ddd5b0b9cf 100644 --- a/tools/mksurfdata_map/src/mksurfdat.F90 +++ b/tools/mksurfdata_map/src/mksurfdat.F90 @@ -1115,7 +1115,7 @@ program mksurfdat ! ! If pft fraction override is set, than intrepret string as PFT and harvesting override values ! - if ( .not. all_veg )then + if ( all_veg )then fname = ' ' fhrvname = ' ' call mkpft_parse_oride(string) From bc6972578595945e287b958cc5af7e66d702a053 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 17:45:53 -0700 Subject: [PATCH 571/730] Fix CPRNC version to point to --- test/tools/test_driver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 618b7a8d08..39b945fcdc 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -219,7 +219,7 @@ export INC_NETCDF=\${NETCDF_PATH}/include export LIB_NETCDF=\${NETCDF_PATH}/lib export MAKE_CMD="gmake -j 5" ##using hyper-threading on hobart export MACH_WORKSPACE="/scratch/cluster" -export CPRNC_EXE=/fs/cgd/csm/tools/cprnc_hobart/cprnc +export CPRNC_EXE=/fs/cgd/csm/tools/cprnc/cprnc export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" dataroot="/fs/cgd/csm" export TOOLSSLIBS="" @@ -299,7 +299,7 @@ export INC_NETCDF=\${NETCDF_PATH}/include export LIB_NETCDF=\${NETCDF_PATH}/lib export MAKE_CMD="gmake -j 5" ##using hyper-threading on izumi export MACH_WORKSPACE="/scratch/cluster" -export CPRNC_EXE=/fs/cgd/csm/tools/cprnc_izumi/cprnc +export CPRNC_EXE=/fs/cgd/csm/tools/cprnc/cprnc.izumi export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" dataroot="/fs/cgd/csm" export TOOLSSLIBS="" From 3d968d6a6dce6544c9d1951456aa4722ba492357 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 17:53:03 -0700 Subject: [PATCH 572/730] 10x15 grid for both hobart and izumi should be single node --- cime_config/config_pes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml index 4362bed475..4de8baaa1d 100644 --- a/cime_config/config_pes.xml +++ b/cime_config/config_pes.xml @@ -634,7 +634,7 @@ - + none From ad95aef97a18c4dd72d3be9ef9d78410749d7fe1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 22:27:01 -0700 Subject: [PATCH 573/730] Add an expected fail, and increase the time limit on a test --- cime_config/testdefs/ExpectedTestFails.xml | 1 + cime_config/testdefs/testlist_clm.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d455390293..ca1fa904fa 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -8,6 +8,7 @@ FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop RUN FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.izumi_pgi.clm-crop RUN + FAIL PEPEM_Ld1.f10_f10_musgs.I2000Clm50BgcCrop.hobart_intel.clm-crop RUN FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 07f98bf3c6..ec2fb4746d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -99,7 +99,7 @@ - + From 93444b3955770664be335a209cc4690d741296da Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:04:36 -0700 Subject: [PATCH 574/730] Update Change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 132 +++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 9b8b1db285..39801fcae5 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.28 erik 11/14/2019 Several bit-for-bit fixes especially around soil-moisture streams release-clm5.0.27 erik 08/13/2019 Add presoribed soil moisture streams as an option, and a few fixes release-clm5.0.26 sacks 07/29/2019 Add a CN precision control call to fix problems related to small negative values release-clm5.0.25 erik 05/29/2019 Change two files from NetCDF-4 format to NetCDF-3 (because some machines have trouble with NetCDF-4 in pnetcdf) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index f5ad3ca456..fdf02512f8 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,136 @@ =============================================================== +Tag name: release-clm5.0.28 +Originator(s): erik (Erik Kluzek) +Date: Thu Nov 14 23:03:39 MST 2019 +One-line Summary: Several bit-for-bit fixes especially around soil-moisture streams + +Purpose of this version: +------------------------ + +A list of several bit-for-bit fixes. Some very minor and other's more extensive. + +mksurfdata_map was extended so that when you specify vegetation types, you can let it use the natural and crop coverage +from the input datasets. This allows you to for example run a global simulation with all vegetation types in every grid cell. +This can be useful in seeing what types of vegetation grow in each grid cell. Also simplify some of the logic that allowed +for old format PFT datasets that didn't include crop information. Since, we don't have or need to work with such datasets +this complex logic could be removed. Also added some new unit tests for mksurfdata and the defining PFT values. + +Add time interpolation alogrithm type to most of the stream files, so it can be changed via namelist. Add historical data to the +Nitrogen deposition future scenario datasets. + +Add namelist control variables for soilm_offset, and tint_algo for most of the streams. tint_algo allows you to control the time +interpolation and change it to a simpler one (like upper) in order to show that the streams output agrees with the streams data +input. soilm_offset allows the user to change the time-stamp offset if the time-stamp isn't at the middle of averaging interval. +This is important for the soil moisture streams for a case where you want to use the output of a CTSM simulation for soil-moisture +as normally the time-stamp is the end of the interval (so you could use -1296000 to roughly compensate for the time-stamps to be +at the end of the month rather than mid-month). Add a namelist item to continue when soil moisture is prescribed and a gridpoint +is missing on the input streams file, but required for the simulation running. Also add an optional history field H2OSOI_PRESCRIBED_GRC +that corresponds to the input soil moisture streams, so you can ensure the prescribe soil moisture is working correctly and agrees +with the input dataset. + +Fix the threading bug for soil-moisture and LAI streams. This is done by adding a new "advance" subroutine that does the streams +advance part of the calculation in a non-OpenMP area of the CLM driver, while the "interp" subroutine remains in the Open-MP +loop. + +Include missing prescribed testmods directory. Allow branches with use_init_interp=T with a log message about it. +Move tests from hobart to izumi. + +This is bit-for-bit + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #809, #804, #786, #702, #791, #150 #830, #831, #832, #836 + Fixes #809 -- mkmapdata old version of intel + Fixes #804 -- allow mksurfdata_map to prescribe vegetation cover for globe + Fixes #786 -- allow use_init_interp for a branch + Fixes #702 -- add historical period to start of ndep SSP files + Fixes #791 -- fix threading for prescribed LAI and soil-moisture + Fixes #150 -- remove extra logic in mksurfdata_map for old format and missing crops + Fixes #830 -- time offset is assumed to be zero for soil moisture streams + Fixes #831 -- add namelist tint_algo settings for input streams + partial for #832 -- an option to override if soil moisture stream has missing data where needed + Fixes #836 -- add izumi as a place that can run tools tests + +Science changes since: release-clm6.0.27 + None, answers are the same. Some more flexibility was added with namelist control as follows in the next section. + +Software changes since: release-clm6.0.27 + New namelist items: ndep_tintalgo, soilm_offset, soilm_ignore_data_if_missing, lai_tintalgo, lightng_tintalgo, popdens_tintalgo + urbantv_tintalgo + If maxpatch_pft's is not set to a regular value (with or without crops) will now abort, with an option to override if needed + + Move tests from hobart to izumi. prescribed test-mod directory that wasn't there before is now there. + Add some assert debug checking for lai and soilm streams. + Add some new unit tests for mksurfdata_map + +Changes to User Interface since: release-clm6.0.27 + Note, that streams text files are now legitimate XML files + +Testing: regular +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + izumi ---- Not working (needs a cime update) + + tools-tests (components/clm/test/tools): + + cheyenne - OK + hobart --- OK + izumi ---- OK + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - OK + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + hobart_nag -------- OK + hobart_intel ------ OK + izumi_nag --------- OK + izumi_pgi --------- OK (fail on run needs some cime updates) + izumi_intel ------- OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: No (bit-for-bit) (other than two tests on hobart because of cime issue #3302) + +Detailed list of changes: +------------------------ + +Externals being used: Update cime + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.03 + mosart: release-cesm2.0.03 + cime: cim5.6.25 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #814 +(https://github.com/ESCOMP/ctsm/pull) + #814 -- A few fixes and extend mksurfdata to set PFT/CFT fractions but use veg-cover from dataset + +=============================================================== +=============================================================== Tag name: release-clm5.0.27 Originator(s): erik (Erik Kluzek) Date: Tue Aug 13 14:31:50 MDT 2019 From 743ff6c66d02c0f5cb66d3dd655e5c15b2ac76fc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:39:25 -0700 Subject: [PATCH 575/730] Point to the newer prescribed soil moisture file that was used in simulations and has time-stamps at the mid-point of the month --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 69463518b3..6e6baef32f 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1098,7 +1098,7 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 1997 1997 -lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.climo1980-2014.MONS_c190709.nc +lnd/clm2/prescribed_data/LFMIP-pdLC-SST.H2OSOI.0.9x1.25.20levsoi.natveg.1980-2014.MONS_climo.c190716.nc linear 0 From 85fc6062f57c88e8dfd0d50a95988785b9535b26 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:43:11 -0700 Subject: [PATCH 576/730] if soilm_ignore_data_if_missing is set and the point is missing from the input soilm dataset, cycle so that the data isn't modified and CTSM just runs for that point, rather than doing a strange modification to it by using the missing value data from the file, also if h2osoi_vol_prs is large set to spval rather than using it, these two changes resolve: #832 #833 --- src/biogeophys/SoilMoistureStreamMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 6a6f2fa3b5..549404ee6f 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -344,9 +344,9 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! If soil moiture is being interpolated in time and the result is ! large that probably means one of the two data points is missing (set to spval) - !if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then - !h2osoi_vol_prs(g,j) = spval - !end if + if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then + h2osoi_vol_prs(g,j) = spval + end if end do end do @@ -375,7 +375,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & ! file is different if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then if ( soilm_ignore_data_if_missing )then - !cycle + cycle else write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & g, ' active = ', col%active(c) From 007e18c8619033b9b370851c183f4e00e44d08a7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:46:13 -0700 Subject: [PATCH 577/730] Have clm4_5 use the same 1850 ndep dataset as clm5_0, fixes #817 --- bld/namelist_files/use_cases/1850_control.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 18c5959c78..daed0cbea5 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -35,6 +35,9 @@ lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc + +lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc cycle From 3d3967c69852993953e5d8cad939926211402c93 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:53:59 -0700 Subject: [PATCH 578/730] Set urbantv years for clm4_5 the same as clm5_0 --- .../namelist_defaults_clm4_5.xml | 20 +++++++++++++++++-- bld/namelist_files/use_cases/1850_control.xml | 3 +++ .../use_cases/1850_noanthro_control.xml | 3 +++ bld/namelist_files/use_cases/2000_control.xml | 3 +++ bld/namelist_files/use_cases/2010_control.xml | 3 +++ .../use_cases/20thC_transient.xml | 4 ++++ 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 6e6baef32f..01384e9e6f 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -1211,24 +1211,40 @@ lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr18 2106 2015 -2000 -2000 +2015 +2106 +2015 2000 2000 +2000 +2000 + 1850 1850 +1850 +1850 + 2000 2000 +2000 +2000 + 2000 2000 2000 2000 +2000 +2000 + +2000 +2000 + lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index daed0cbea5..31d3b3eb3d 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -32,6 +32,9 @@ 1850 1850 +1850 +1850 + lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index bba281aee6..971b0cf410 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -42,6 +42,9 @@ 1850 1850 +1850 +1850 + NONE diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index ca7c1ac5cd..31a7eb1a50 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -33,4 +33,7 @@ 2000 2000 +2000 +2000 + diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index e61ac4dd4b..244009df02 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -33,4 +33,7 @@ 2010 2010 +2010 +2010 + diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index e8970b59bf..c9de2a1f58 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -49,4 +49,8 @@ 2106 1850 +1850 +2106 +1850 + From 70706a3d6c0393223991ecf9ef0a88f044b2b9b4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 14 Nov 2019 23:57:43 -0700 Subject: [PATCH 579/730] Set tintalgo for soilm and lai, so you could compare to the input stream dataset easier --- cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm index 635c2f9562..73ea3a597e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm @@ -1,3 +1,5 @@ use_soil_moisture_streams = .true. use_lai_streams = .true. hist_fincl1 += 'H2OSOI_PRESCRIBED_GRC' + soilm_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare to input dataset + lai_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare more directly to input dataset From 0be8a1d802c87d111802ab84407af46acf10ddcf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 15 Nov 2019 00:27:40 -0700 Subject: [PATCH 580/730] Set prescribe soil moisture over both nat-veg and crop landunits --- src/biogeophys/SoilMoistureStreamMod.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 549404ee6f..6f625c52a4 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -358,8 +358,7 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & g = col%gridcell(c) ig = g_to_ig(g) - if (lun%itype(col%landunit(c)) == istsoil ) then - !if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) ) then + if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) ) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi From 8861b8e4c7b8997c6c1969f8327a269dff33478f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 17 Nov 2019 22:38:49 -0700 Subject: [PATCH 581/730] Add soilm_ignore_data_if_missing=T to the prescribed testmod --- cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm index 73ea3a597e..c2290397dd 100644 --- a/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/user_nl_clm @@ -3,3 +3,4 @@ hist_fincl1 += 'H2OSOI_PRESCRIBED_GRC' soilm_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare to input dataset lai_tintalgo = 'lower' ! set time interpolation to use lower value, so can compare more directly to input dataset + soilm_ignore_data_if_missing = .true. From d387bd715ad1b58f24ca41f9065190fc485b67b4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 11:09:58 -0700 Subject: [PATCH 582/730] Apply changes to update to latest fates_next_api apply this diff rgknox/fates_next_api_5.0.21...escomp/fates_next_api This updates fates from sci.1.27.1_api.7.3.0 to sci.1.30.0_api.8.0.0. --- Externals_CLM.cfg | 4 +- .../testmods_dirs/clm/Fates/user_nl_clm | 8 +- .../clm/FatesAllVars/user_nl_clm | 4 +- .../clm/FatesColdDef/user_nl_clm | 2 +- .../clm/FatesShortList/user_nl_clm | 2 +- src/main/histFileMod.F90 | 117 ++++++--- src/utils/clmfates_interfaceMod.F90 | 233 +++++------------- 7 files changed, 165 insertions(+), 205 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 23d74d10e2..b1436326b1 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/ncar/fates-release -tag = fates_s1.21.0_a7.0.0_br_rev2 +repo_url = https://github.com/NGEET/fates +tag = sci.1.30.0_api.8.0.0 required = True [PTCLM] diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 3f6a4dbc56..c40769a62e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -3,9 +3,11 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_spitfire= .true. -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', +hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN_ELEM','LITTER_OUT_ELEM', 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', + 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN', + 'LITTER_FINES_AG_ELEM','LITTER_FINES_BG_ELEM','LITTER_CWD_AG_ELEM','LITTER_CWD_BG_ELEM', + 'SEED_BANK' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm index 66c94f3cc2..9b9243cee5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm @@ -27,4 +27,6 @@ hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE',' 'NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', 'NPP_BDEAD_UNDERSTORY_SCLS','NPP_BSEED_UNDERSTORY_SCLS','NPP_STORE_UNDERSTORY_SCLS','RDARK_UNDERSTORY_SCLS', 'LIVESTEM_MR_UNDERSTORY_SCLS','LIVECROOT_MR_UNDERSTORY_SCLS','FROOT_MR_UNDERSTORY_SCLS','RESP_G_UNDERSTORY_SCLS', - 'RESP_M_UNDERSTORY_SCLS' + 'RESP_M_UNDERSTORY_SCLS','LITTER_IN_ELEM','LITTER_OUT_ELEM','SEED_BANK_ELEM','SEEDS_IN_LOCAL_ELEM','SEEDS_IN_EXTERN_ELEM', + 'SEED_GERM_ELEM','SEED_DECAY','CBALANCE_ERROR_FATES','ERROR_FATES','LITTER_FINES_AG_ELEM','LITTER_FINES_BG_ELEM','LITTER_CWD_BG_ELEM', + 'LITTER_CWD_AG_ELEM','LITTER_CWD' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm index bae4c2cb9e..97cafd9d42 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm @@ -6,5 +6,5 @@ hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT' 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm index f9d31eecbb..fc057c0be3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm @@ -2,4 +2,4 @@ hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT' 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC' + 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR' diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index b1df43d6b4..e1c16415e3 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -24,8 +24,10 @@ module histFileMod use EDTypesMod , only : nlevleaf use FatesInterfaceMod , only : nlevsclass, nlevage use FatesInterfaceMod , only : nlevheight - use EDTypesMod , only : nfsc, ncwd - use FatesInterfaceMod , only : numpft_ed => numpft + use EDTypesMod , only : nfsc + use FatesLitterMod , only : ncwd + use EDTypesMod , only : num_elements_fates => num_elements + use FatesInterfaceMod , only : numpft_fates => numpft use ncdio_pio ! @@ -195,6 +197,9 @@ module histFileMod integer :: beg1d_out ! on-node 1d hbuf pointer start index integer :: end1d_out ! on-node 1d hbuf pointer end index integer :: num1d_out ! size of hbuf first dimension (all nodes) + integer :: numdims ! the actual number of dimensions, this allows + ! for 2D arrays, where the second dimension is allowed + ! to be 1 integer :: num2d ! size of hbuf second dimension (e.g. number of vertical levels) integer :: hpindex ! history pointer index character(len=scale_type_strlen) :: p2c_scale_type ! scale factor when averaging patch to column @@ -315,7 +320,7 @@ subroutine hist_printflds() end subroutine hist_printflds !----------------------------------------------------------------------- - subroutine masterlist_addfld (fname, type1d, type1d_out, & + subroutine masterlist_addfld (fname, numdims, type1d, type1d_out, & type2d, num2d, units, avgflag, long_name, hpindex, & p2c_scale_type, c2l_scale_type, l2g_scale_type, & no_snow_behavior) @@ -331,6 +336,7 @@ subroutine masterlist_addfld (fname, type1d, type1d_out, & ! ! !ARGUMENTS: character(len=*), intent(in) :: fname ! field name + integer , intent(in) :: numdims ! number of dimensions character(len=*), intent(in) :: type1d ! 1d data type character(len=*), intent(in) :: type1d_out ! 1d output type character(len=*), intent(in) :: type2d ! 2d output type @@ -409,6 +415,7 @@ subroutine masterlist_addfld (fname, type1d, type1d_out, & masterlist(f)%field%type1d = type1d masterlist(f)%field%type1d_out = type1d_out masterlist(f)%field%type2d = type2d + masterlist(f)%field%numdims = numdims masterlist(f)%field%num2d = num2d masterlist(f)%field%hpindex = hpindex masterlist(f)%field%p2c_scale_type = p2c_scale_type @@ -1056,6 +1063,7 @@ subroutine hist_update_hbuf(bounds) integer :: t ! tape index integer :: f ! field index integer :: num2d ! size of second dimension (e.g. number of vertical levels) + integer :: numdims ! number of dimensions character(len=*),parameter :: subname = 'hist_update_hbuf' character(len=hist_dim_name_length) :: type2d ! hbuf second dimension type ["levgrnd","levlak","numrad","ltype","natpft","cft","glc_nec","elevclas","subname(n)"] !----------------------------------------------------------------------- @@ -1063,10 +1071,12 @@ subroutine hist_update_hbuf(bounds) do t = 1,ntapes !$OMP PARALLEL DO PRIVATE (f, num2d) do f = 1,tape(t)%nflds - num2d = tape(t)%hlist(f)%field%num2d - if ( num2d == 1) then + numdims = tape(t)%hlist(f)%field%numdims + + if ( numdims == 1) then call hist_update_hbuf_field_1d (t, f, bounds) else + num2d = tape(t)%hlist(f)%field%num2d call hist_update_hbuf_field_2d (t, f, bounds, num2d) end if end do @@ -2058,18 +2068,22 @@ subroutine htape_create (t, histrest) if(use_fates)then call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) - call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_ed, dimid) - call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levscagpf', nlevsclass * nlevage * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levagepft', nlevage * numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) - call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levpft', numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid) call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) - call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levcan', nclmax, dimid) call ncd_defdim(lnfid, 'fates_levcnlf', nlevleaf * nclmax, dimid) - call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_ed, dimid) + call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelem', num_elements_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelpft', num_elements_fates * numpft_fates, dimid) + call ncd_defdim(lnfid, 'fates_levelcwd', num_elements_fates * ncwd, dimid) + call ncd_defdim(lnfid, 'fates_levelage', num_elements_fates * nlevage, dimid) end if if ( .not. lhistrest )then @@ -2504,6 +2518,15 @@ subroutine htape_timeconst(t, mode) use FatesInterfaceMod, only : fates_hdim_canmap_levcnlfpf use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlfpf use FatesInterfaceMod, only : fates_hdim_pftmap_levcnlfpf + use FatesInterfaceMod, only : fates_hdim_levelem + use FatesInterfaceMod, only : fates_hdim_elmap_levelpft + use FatesInterfaceMod, only : fates_hdim_pftmap_levelpft + use FatesInterfaceMod, only : fates_hdim_elmap_levelcwd + use FatesInterfaceMod, only : fates_hdim_cwdmap_levelcwd + use FatesInterfaceMod, only : fates_hdim_elmap_levelage + use FatesInterfaceMod, only : fates_hdim_agemap_levelage + + ! ! !ARGUMENTS: integer, intent(in) :: t ! tape index @@ -2600,6 +2623,20 @@ subroutine htape_timeconst(t, mode) long_name='FATES pft map into patch age x pft', units='-', ncid=nfid(t)) call ncd_defvar(varname='fates_agmap_levagepft', xtype=ncd_int, dim1name='fates_levagepft', & long_name='FATES age-class map into patch age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_levelem',xtype=ncd_int, dim1name='fates_levelem', & + long_name='FATES element (C,N,P,...) identifier', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & + long_name='FATES element map into element x pft ', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_pftmap_levelpft', xtype=ncd_int, dim1name='fates_levelpft', & + long_name='FATES pft map into element x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelcwd', xtype=ncd_int, dim1name='fates_levelcwd', & + long_name='FATES element map into element x cwd', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_cwdmap_levelcwd', xtype=ncd_int, dim1name='fates_levelcwd', & + long_name='FATES cwd map into element x cwd', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_elmap_levelage', xtype=ncd_int, dim1name='fates_levelage', & + long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) + call ncd_defvar(varname='fates_agemap_levelage', xtype=ncd_int, dim1name='fates_levelage', & + long_name='FATES element map into age x pft', units='-', ncid=nfid(t)) end if @@ -2635,7 +2672,14 @@ subroutine htape_timeconst(t, mode) call ncd_io(varname='fates_agmap_levscagpft',data=fates_hdim_agmap_levscagpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levscagpft',data=fates_hdim_pftmap_levscagpft, ncid=nfid(t), flag='write') call ncd_io(varname='fates_pftmap_levagepft',data=fates_hdim_pftmap_levagepft, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_agmap_levagepft',data=fates_hdim_agmap_levagepft, ncid=nfid(t), flag='write') + call ncd_io(varname='fates_levelem',data=fates_hdim_levelem, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelpft',data=fates_hdim_elmap_levelpft, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_pftmap_levelpft',data=fates_hdim_pftmap_levelpft, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelcwd',data=fates_hdim_elmap_levelcwd, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_cwdmap_levelcwd',data=fates_hdim_cwdmap_levelcwd, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_elmap_levelage',data=fates_hdim_elmap_levelage, ncid=nfid(t),flag='write') + call ncd_io(varname='fates_agemap_levelage',data=fates_hdim_agemap_levelage, ncid=nfid(t),flag='write') end if endif @@ -2881,6 +2925,7 @@ subroutine hfields_write(t, mode) integer :: num2d ! hbuf second dimension size integer :: nt ! time index integer :: ier ! error status + integer :: numdims ! number of dimensions character(len=avgflag_strlen) :: avgflag ! time averaging flag character(len=max_chars) :: long_name! long name character(len=max_chars) :: units ! units @@ -2924,6 +2969,7 @@ subroutine hfields_write(t, mode) end1d_out = tape(t)%hlist(f)%field%end1d_out num1d_out = tape(t)%hlist(f)%field%num1d_out type2d = tape(t)%hlist(f)%field%type2d + numdims = tape(t)%hlist(f)%field%numdims num2d = tape(t)%hlist(f)%field%num2d nt = tape(t)%ntimes @@ -2956,7 +3002,7 @@ subroutine hfields_write(t, mode) endif if (dim2name == 'undefined') then - if (num2d == 1) then + if (numdims == 1) then call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & dim1name=dim1name, dim2name='time', & long_name=long_name, units=units, cell_method=avgstr, & @@ -2968,7 +3014,7 @@ subroutine hfields_write(t, mode) missing_value=spval, fill_value=spval) end if else - if (num2d == 1) then + if (numdims == 1) then call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & dim1name=dim1name, dim2name=dim2name, dim3name='time', & long_name=long_name, units=units, cell_method=avgstr, & @@ -2989,7 +3035,7 @@ subroutine hfields_write(t, mode) ! Allocate dynamic memory - if (num2d == 1) then + if (numdims == 1) then allocate(hist1do(beg1d_out:end1d_out), stat=ier) if (ier /= 0) then write(iulog,*) trim(subname),' ERROR: allocation' @@ -3000,7 +3046,7 @@ subroutine hfields_write(t, mode) ! Write history output. Always output land and ocean runoff on xy grid. - if (num2d == 1) then + if (numdims == 1) then call ncd_io(flag='write', varname=varname, & dim1name=type1d_out, data=hist1do, ncid=nfid(t), nt=nt) else @@ -3011,7 +3057,7 @@ subroutine hfields_write(t, mode) ! Deallocate dynamic memory - if (num2d == 1) then + if (numdims == 1) then deallocate(hist1do) end if @@ -4745,10 +4791,11 @@ subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, & ! Add field to masterlist - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d='unset', num2d=1, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g) + call masterlist_addfld (fname=trim(fname), numdims=1, type1d=l_type1d, & + type1d_out=l_type1d_out, type2d='unset', num2d=1, & + units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & + p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, & + l2g_scale_type=scale_type_l2g) l_default = 'active' if (present(default)) then @@ -4864,7 +4911,7 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levscls') num2d = nlevsclass case ('fates_levpft') - num2d = numpft_ed + num2d = numpft_fates case ('fates_levage') num2d = nlevage case ('fates_levheight') @@ -4874,23 +4921,31 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levcwdsc') num2d = ncwd case ('fates_levscpf') - num2d = nlevsclass*numpft_ed + num2d = nlevsclass*numpft_fates case ('fates_levscag') num2d = nlevsclass*nlevage case ('fates_levscagpf') - num2d = nlevsclass*nlevage*numpft_ed + num2d = nlevsclass*nlevage*numpft_fates case ('fates_levagepft') - num2d = nlevage*numpft_ed + num2d = nlevage*numpft_fates case ('fates_levcan') num2d = nclmax case ('fates_levcnlf') num2d = nlevleaf * nclmax case ('fates_levcnlfpf') - num2d = nlevleaf * nclmax * numpft_ed + num2d = nlevleaf * nclmax * numpft_fates case ('ltype') num2d = max_lunit case ('natpft') num2d = natpft_size + case ('fates_levelem') + num2d = num_elements_fates + case ('fates_levelpft') + num2d = num_elements_fates*numpft_fates + case ('fates_levelcwd') + num2d = num_elements_fates*ncwd + case ('fates_levelage') + num2d = num_elements_fates*nlevage case('cft') if (cft_size > 0) then num2d = cft_size @@ -5052,12 +5107,12 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, ! Add field to masterlist - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d=type2d, num2d=num2d, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g, & - no_snow_behavior=no_snow_behavior) - + call masterlist_addfld (fname=trim(fname), numdims=2, type1d=l_type1d, & + type1d_out=l_type1d_out, type2d=type2d, num2d=num2d, & + units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & + p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, & + l2g_scale_type=scale_type_l2g, no_snow_behavior=no_snow_behavior) + l_default = 'active' if (present(default)) then l_default = default diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 84c4e5901f..d1d3d45308 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -107,8 +107,8 @@ module CLMFatesInterfaceMod use FatesHistoryInterfaceMod, only : fates_history_interface_type use FatesRestartInterfaceMod, only : fates_restart_interface_type - use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck use EDTypesMod , only : ed_patch_type + use EDTypesMod , only : num_elements use FatesInterfaceMod , only : hlm_numlevgrnd use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site @@ -123,7 +123,7 @@ module CLMFatesInterfaceMod use EDCanopyStructureMod , only : canopy_summarization, update_hlm_dynamics use FatesPlantRespPhotosynthMod, only : FatesPlantRespPhotosynthDrive use EDAccumulateFluxesMod , only : AccumulateFluxes_ED - use EDPhysiologyMod , only : flux_into_litter_pools + use EDPhysiologyMod , only : FluxIntoLitterPools use FatesPlantHydraulicsMod, only : hydraulics_drive use FatesPlantHydraulicsMod, only : HydrSiteColdStart use FatesPlantHydraulicsMod, only : InitHydrSites @@ -688,7 +688,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! call subroutine to aggregate fates litter output fluxes and ! package them for handing across interface - call flux_into_litter_pools(this%fates(nc)%nsites, & + call FluxIntoLitterPools(this%fates(nc)%nsites, & this%fates(nc)%sites, & this%fates(nc)%bc_in, & this%fates(nc)%bc_out) @@ -709,11 +709,14 @@ subroutine dynamics_driv(this, nc, bounds_clump, & nld_si = this%fates(nc)%bc_in(s)%nlevdecomp soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lab_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_lab_c_si(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_cel_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_cel_c_si(1:nld_si) + soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,1:nld_si) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lig_c_col(1:nld_si) + this%fates(nc)%bc_out(s)%litt_flux_lig_c_si(1:nld_si) + end do @@ -1226,11 +1229,12 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins call get_clump_bounds(nc, bounds_clump) do s = 1,this%fates(nc)%nsites - call init_site_vars(this%fates(nc)%sites(s)) + call init_site_vars(this%fates(nc)%sites(s),this%fates(nc)%bc_in(s) ) call zero_site(this%fates(nc)%sites(s)) end do - call set_site_properties(this%fates(nc)%nsites, this%fates(nc)%sites) + call set_site_properties(this%fates(nc)%nsites, & + this%fates(nc)%sites) ! ---------------------------------------------------------------------------- ! Initialize Hydraulics Code if turned on @@ -1301,7 +1305,7 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins end if end do !$OMP END PARALLEL DO - + end subroutine init_coldstart ! ====================================================================================== @@ -1878,30 +1882,13 @@ subroutine wrap_bgc_summary(this, nc, soilbiogeochem_carbonflux_inst, & this%fates(nc)%bc_in(s)%tot_somc = totsomc(c) this%fates(nc)%bc_in(s)%tot_litc = totlitc(c) end do - - is_beg_day = is_beg_curr_day() - dtime = get_step_size() - nstep = get_nstep() - - call SummarizeNetFluxes(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day) - - call FATES_BGC_Carbon_Balancecheck(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day, & - dtime, nstep) - - ! Update history variables that track these variables call this%fates_hist%update_history_cbal(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) + this%fates(nc)%nsites, & + this%fates(nc)%sites, & + this%fates(nc)%bc_in) - end associate end subroutine wrap_bgc_summary @@ -1954,7 +1941,8 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 use FatesIOVariableKindMod, only : site_scagpft_r8, site_agepft_r8 use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 - use FatesIOVariableKindMod, only : site_height_r8 + use FatesIOVariableKindMod, only : site_height_r8, site_elem_r8, site_elpft_r8 + use FatesIOVariableKindMod, only : site_elcwd_r8, site_elage_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -2075,151 +2063,29 @@ subroutine init_history_io(this,bounds_proc) default=trim(vdefault), & set_lake=0._r8,set_urb=0._r8) - case(patch_ground_r8) + case(patch_ground_r8, patch_size_pft_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name call hist_addfld2d(fname=trim(vname),units=trim(vunits), & ! <--- addfld2d type2d=trim(dim2name), & ! <--- type2d avgflag=trim(vavgflag),long_name=trim(vlong), & ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) + default=trim(vdefault)) - case(patch_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_ground_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_age_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_height_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_fuel_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cwdsc_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_can_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlf_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlfpft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_scag_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_scagpft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_agepft_r8) + case(site_ground_r8, site_size_pft_r8, site_size_r8, site_pft_r8, & + site_age_r8, site_height_r8, site_fuel_r8, site_cwdsc_r8, & + site_can_r8,site_cnlf_r8, site_cnlfpft_r8, site_scag_r8, & + site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, & + site_elcwd_r8, site_elage_r8) + d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index dim2name = this%fates_hist%dim_bounds(d_index)%name call hist_addfld2d(fname=trim(vname),units=trim(vunits), & type2d=trim(dim2name), & avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) + ptr_col=this%fates_hist%hvars(ivar)%r82d, & + default=trim(vdefault)) case default write(iulog,*) 'A FATES iotype was created that was not registerred' @@ -2257,6 +2123,27 @@ subroutine init_soil_depths(this, nc) this%fates(nc)%bc_in(s)%z_sisl(1:nlevsoil) = col%z(c,1:nlevsoil) this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:nlevdecomp) = & dzsoi_decomp(1:nlevdecomp) + + if (use_vertsoilc) then + do j=1,nlevsoil + this%fates(nc)%bc_in(s)%decomp_id(j) = j + ! Check to make sure that dz = dz_decomp_sisl when vertical soil dynamics + ! are active + if(abs(this%fates(nc)%bc_in(s)%dz_decomp_sisl(j)-this%fates(nc)%bc_in(s)%dz_sisl(j))>1.e-10_r8)then + write(iulog,*) 'when vertical soil decomp dynamics are on' + write(iulog,*) 'fates assumes that the decomposition depths equal the soil depths' + write(iulog,*) 'layer: ',j + write(iulog,*) 'dz_decomp_sisl(j): ',this%fates(nc)%bc_in(s)%dz_decomp_sisl(j) + write(iulog,*) 'dz_sisl(j): ',this%fates(nc)%bc_in(s)%dz_sisl(j) + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end do + else + do j=1,nlevsoil + this%fates(nc)%bc_in(s)%decomp_id(j) = 1 + end do + end if + end do return @@ -2442,10 +2329,11 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type use FatesInterfaceMod, only : nlevsclass, nlevage use FatesInterfaceMod, only : nlevheight - use EDtypesMod, only : nfsc, ncwd - use EDtypesMod, only : nlevleaf, nclmax + use EDtypesMod, only : nfsc + use FatesLitterMod, only : ncwd + use EDtypesMod, only : nlevleaf, nclmax use FatesInterfaceMod, only : numpft_fates => numpft - use clm_varpar, only : nlevgrnd + use clm_varpar, only : nlevgrnd implicit none @@ -2502,6 +2390,19 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%cnlfpft_begin = 1 fates%cnlfpft_end = nlevleaf * nclmax * numpft_fates + + fates%elem_begin = 1 + fates%elem_end = num_elements + + fates%elpft_begin = 1 + fates%elpft_end = num_elements * numpft_fates + + fates%elcwd_begin = 1 + fates%elcwd_end = num_elements * ncwd + + fates%elage_begin = 1 + fates%elage_end = num_elements * nlevage + end subroutine hlm_bounds_to_fates_bounds From 6e972f5ca161da7affd9008989dcf64fe7e1be7a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 11:36:22 -0700 Subject: [PATCH 583/730] Mark new izimu failed fates tests --- cime_config/testdefs/ExpectedTestFails.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ca1fa904fa..9be3edee3b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -14,5 +14,7 @@ FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK + FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.izumi_nag.clm-FatesHydro RUN + FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.izumi_nag.clm-FatesHydro MEMLEAK From 2e88c88757fedab68a247605c796c7e5997f3a7e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 12:14:25 -0700 Subject: [PATCH 584/730] Update change files --- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 114 +++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/doc/ChangeSum b/doc/ChangeSum index 39801fcae5..9f24b313a4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.29 erik 11/19/2019 Some answer changes needed for prescribed soil-moisture and clm4_5 defaults (1850-ndep, and urbantv settings) release-clm5.0.28 erik 11/14/2019 Several bit-for-bit fixes especially around soil-moisture streams release-clm5.0.27 erik 08/13/2019 Add presoribed soil moisture streams as an option, and a few fixes release-clm5.0.26 sacks 07/29/2019 Add a CN precision control call to fix problems related to small negative values diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index fdf02512f8..06e77c0a1d 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,118 @@ =============================================================== +Tag name: release-clm5.0.29 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Nov 19 12:14:02 MST 2019 +One-line Summary: Some answer changes needed for prescribed soil-moisture and clm4_5 defaults (1850-ndep, and urbantv settings) + +Purpose of this version: +------------------------ + +Some answer changes needed for prescribed soil-moisture. And clm4_5 defaults for 1850 Nitrogen deposition and or urbantv +settings were made to be consistent with clm5_0. + + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): #175, #817, #832 #833 + + Fixes #817 -- Have clm4_5 use the same ndep file as clm5_0 for 1850 + Fixes #175 -- Have clm4_5 use the same settings for urbantv years as clm5_0 + Fixes #832 -- don't override with missing value, let the model set it + Fixes #833 -- time interpolation of soilm causes bad values for some missing points + +Science changes since: release-clm5.0.28 + + Defaults for clm4_5, prescribed soil-moisture + + Some defaults were changed for clm4_5 to be consistent with clm5_0 (use of the same 1850-ndep file, + and changes in the urbantv year settings) + + Prescribed soil-moisture was changes so that if time-interpolation produces large values, they + will be marked as missing (spval). Also points where the input prescribed soil moisture is missing + are now ignored (and run normally). + +Software changes since: release-clm5.0.28 + + +Changes to User Interface since: release-clm5.0.28 + + Behavior of soilm_ignore_data_if_missing changes! + + Behavior of soilm_ignore_data_if_missing changes. Now if true will ignore any points + where the prescribed soil moisture dataset is missing. So for these points the model + will run normally (as if prescribed soil moisture was off). Before it would mark them + as missing, but modify h2osoi_ice/liq in an odd fashion. + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (10 tests are different) + + unit-tests (components/clm/src): + + cheyenne - PASS + hobart --- PASS + + tools-tests (components/clm/test/tools): + + cheyenne - NOT run + hobart --- NOT run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - NOT run + hobart --- NOT run + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + izumi_nag --------- OK + izumi_pgi --------- OK + izumi_intel ------- OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: Yes for some! prescribed soil-moisture and clm4_5 (1850-ndep, and urbantv settings) + + Summarize any changes to answers, i.e., + - what code configurations: prescribed soil-moisture, or clm4_5 due to default changes in 1850-ndep and urbantv + - what platforms/compilers: all + - nature of change: similar climate + + Will new REFCASES need to be made for cesm and/or CAM?: No + +Detailed list of changes: +------------------------ + +Externals being used: No changes + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.03 + mosart: release-cesm2.0.03 + cime: cim5.6.25 + FATES: fates_s1.21.0_a7.0.0_br_rev2 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #841 +(https://github.com/ESCOMP/ctsm/pull) + + #841 -- Some answer changes for release branch + +=============================================================== +=============================================================== Tag name: release-clm5.0.28 Originator(s): erik (Erik Kluzek) Date: Thu Nov 14 23:03:39 MST 2019 From 13fb2731cfef0a5bec1e2b443ffea2c43ebc2d48 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 14:11:02 -0700 Subject: [PATCH 585/730] Update fates paramfile to one being pointed to on fates_next_api branch --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 01384e9e6f..90946cd240 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -378,7 +378,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_default_2trop.c190114.nc +lnd/clm2/paramdata/fates_params_api.7.3.0_12pft_c190530.nc From 7e8e51c240d04973d948c03f926ca8c031dbcfc1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 14:36:21 -0700 Subject: [PATCH 586/730] Add note about expected fail --- cime_config/testdefs/ExpectedTestFails.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 9be3edee3b..250e24fb1f 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -11,6 +11,7 @@ FAIL PEPEM_Ld1.f10_f10_musgs.I2000Clm50BgcCrop.hobart_intel.clm-crop RUN + FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro RUN FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK From fb4d55398d6a55c406c138cde6c5291cf6e15fcc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2019 16:43:21 -0700 Subject: [PATCH 587/730] Update change files --- doc/.ChangeLog_template | 6 +-- doc/ChangeSum | 1 + doc/release-clm5.0.ChangeLog | 88 ++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 3 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 27699a0582..bfe250c85c 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -95,9 +95,9 @@ CTSM testing: cheyenne_intel ---- cheyenne_gnu ------ - hobart_nag -------- - hobart_pgi -------- - hobart_intel ------ + izumi_nag --------- + izumi_pgi --------- + izumi_intel ------- Answer changes -------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index 9f24b313a4..8008353413 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +release-clm5.0.30 erik 11/19/2019 Update FATES to sci.1.30.0_api.8.0.0 release-clm5.0.29 erik 11/19/2019 Some answer changes needed for prescribed soil-moisture and clm4_5 defaults (1850-ndep, and urbantv settings) release-clm5.0.28 erik 11/14/2019 Several bit-for-bit fixes especially around soil-moisture streams release-clm5.0.27 erik 08/13/2019 Add presoribed soil moisture streams as an option, and a few fixes diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 06e77c0a1d..1a93c93ce8 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,4 +1,92 @@ =============================================================== +Tag name: release-clm5.0.30 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue Nov 19 16:34:38 MST 2019 +One-line Summary: Update FATES to sci.1.30.0_api.8.0.0 + +Purpose of this version: +------------------------ + +Update FATES to sci.1.30.0_api.8.0.0, and point to the NGEET version, rather +than NCAR/fates-release version. + +CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) + +Summary of changes: +------------------- + +Issues fixed (include CTSM Issue #): None + +Science changes since: release-clm5.0.28 + FATES science update from sci-1.27.1 to sci.1.30.0 + +Software changes since: release-clm5.0.28 + FATES API update from api.7.3.0 to api.8.0.0 + +Changes to User Interface since: release-clm5.0.28 + fates paramfile is updated + +Testing: +-------- + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - PASS (35 tests are different because of fates param file update) + + unit-tests (components/clm/src): + + cheyenne - PASS + + tools-tests (components/clm/test/tools): + + cheyenne - NOT run + + PTCLM testing (components/clm/tools/shared/PTCLM/test): + + cheyenne - NOT run + + regular tests (aux_clm): + + cheyenne_intel ---- OK + cheyenne_gnu ------ OK + izumi_nag --------- OK + izumi_pgi --------- OK + izumi_intel ------- OK + +Summary of Answer changes: +------------------------- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: previous + +Changes answers relative to baseline: Yes, but only when running with FATES + + Summarize any changes to answers, i.e., + - what code configurations: with FATES active + - what platforms/compilers: all + - nature of change: similar climate + +Detailed list of changes: +------------------------ + +Externals being used: FATES updated + + cism: release-cesm2.0.04 + rtm: release-cesm2.0.03 + mosart: release-cesm2.0.03 + cime: cim5.6.25 + FATES: sci.1.30.0_api.8.0.0 + PTCLM: PTCLM2_180611 + +CTSM Tag versions pulled over from master development branch: None + +Pull Requests that document the changes (include PR ids): #846 +(https://github.com/ESCOMP/ctsm/pull) + #846 -- Update to fates sci.1.30.0_api.8.0.0 + +=============================================================== +=============================================================== Tag name: release-clm5.0.29 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue Nov 19 12:14:02 MST 2019 From 8dce9a6c9f3788792456c34890967a98293dd983 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 13 Dec 2019 14:09:44 -0700 Subject: [PATCH 588/730] Updated default fates parameter file for new api 7.4.0 format. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index bfd5b7ce2d..709bea253e 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.3.0_12pft_c190530.nc +lnd/clm2/paramdata/fates_params_api.7.4.0_12pft_c191213.nc From 76d28ae8b1ce271d5697690b1324dd49b8ece955 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 13 Dec 2019 14:19:06 -0700 Subject: [PATCH 589/730] corrected wrong fates api, we are on 8.1 not 7.4. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 709bea253e..5b518ec6b6 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.7.4.0_12pft_c191213.nc +lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191213.nc From 020a0a309f61dcb428cfff6eb9c626050cbc91d1 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 16 Dec 2019 13:32:52 -0800 Subject: [PATCH 590/730] updating GetandSetTime function comment referencing correct time function source --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 6079a7017a..803c298d37 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -197,7 +197,7 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - ! The GetAndSetFatesTimeis function is used to get the current time from the CIME + ! The GetAndSetFatesTime function is used to get the current time from the CLM ! time procedures and then set to the fates global time variables during restart, ! init_coldstart, and dynamics_driv function calls private :: GetAndSetTime From f6f871b0cfc6fc14a07f363c726400bb76fd84bf Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 16 Dec 2019 13:36:33 -0800 Subject: [PATCH 591/730] fixing comment typo --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 803c298d37..9986fb5e74 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -197,7 +197,7 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - ! The GetAndSetFatesTime function is used to get the current time from the CLM + ! The GetAndSetTime function is used to get the current time from the CLM ! time procedures and then set to the fates global time variables during restart, ! init_coldstart, and dynamics_driv function calls private :: GetAndSetTime From 56c334efe002fd2c7c25985ef0863abfadd83864 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 16 Dec 2019 15:36:19 -0700 Subject: [PATCH 592/730] Updated default fates parameter file again after some new changes. --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 5b518ec6b6..117bb75171 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191213.nc +lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191216.nc From eac0131912254457e3c619cd77e8dcffa419037f Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 17 Dec 2019 17:38:10 -0700 Subject: [PATCH 593/730] Updated fates default filename, again, for new parameters --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 117bb75171..95242dc7d8 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191216.nc +lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191217.nc From 913c4476c4991397270474148b2697d9006527fe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 Jan 2020 14:21:52 -0700 Subject: [PATCH 594/730] Add figures for tools chapter, the section on the details of running mksurfdata_map seems to be missing --- .../using-clm-tools/creating-domain-files.rst | 27 ++++++++++++------- ...g-input-for-surface-dataset-generation.rst | 14 +++++----- .../creating-surface-datasets.rst | 22 +++++++++------ 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index c804a7bea7..eb4f19471d 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -6,24 +6,33 @@ Creating CLM domain files ***************************** -*gen_domain* to create a domain file for datm from a mapping file. **gen_domain** is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. `Figure 2-4 `_ shows the general flow for a general global case (or for a regional grid that DOES include ocean). `Figure 2-5 `_ shows the use of **mknoocnmap.pl** (see `the Section called Using mknocnmap.pl to create grid and maps for single-point regional grids `_) to create a regional or single-point map file that is then run through **gen_domain** to create the domain file for it. As stated before `Figure 2-2 `_ is the legend for both of these figures. See `the +*gen_domain* to create a domain file for datm from a mapping file. **gen_domain** is a tool that is a part of CIME. The domain file is then used by BOTH DATM AND CLM to define the grid and land-mask. The general data flow is shown in two figures. :numref:`Figure mkmapdata.sh` shows the general flow for a general global case (or for a regional grid that DOES include ocean). :numref:`Figure mknoocnmap.pl` shows the use of **mknoocnmap.pl** (see `the Section called Using mknocnmap.pl to create grid and maps for single-point regional grids `_) to create a regional or single-point map file that is then run through **gen_domain** to create the domain file for it. As stated before :numref:`Figure Data_Flow_Legend` is the legend for both of these figures. See `the $CIMEROOT/tools/mapping/gen_domain_files/README `_ file for more help on **gen_domain**. Here we create domain files for a regular global domain. -Figure 2-4. Global Domain file creation -======================================= +Global Domain file creation +=========================== -Insert figure 2-4 +.. _Figure Global-Domain -Starting from SCRIP grid files for both your atmosphere and ocean, you use **$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see `Figure 2-5 `_. (See `Figure 2-2 `_ for the legend for this figure.) +.. figure:: GlobalDomain.jpeg + +Global Domain file creation + +Starting from SCRIP grid files for both your atmosphere and ocean, you use **$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see :numref:`Figure mknoocnmap.pl`. (See :numref:`Figure Global-Domain` for the legend for this figure.) Note, that the SCRIP grid file used to start this process, is also used in **mkmapdata.sh** (see `the Section called Creating mapping files that mksurfdata_map will use `_). Next we create domain files for a single-point or regional domain. -Figure 2-5. Domain file creation using mknoocnmap.pl -==================================================== -Insert figure 2-5 +Domain file creation using mknoocnmap.pl +======================================== + +.. _Figure mknoocnmap.pl + +.. figure:: mknoocnmap.jpeg + +Domain file creation using mknoocnmap.pl -For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use **mknoocnmap.pl**. It creates a SCRIP grid file that can then be used as input to **mkmapdata.sh** as well as a SCRIP mapping file that is then input to **gen_domain**. The output of **gen_domain** is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See `Figure 2-2 `_ for the legend for this figure.) +For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use **mknoocnmap.pl**. It creates a SCRIP grid file that can then be used as input to **mkmapdata.sh** as well as a SCRIP mapping file that is then input to **gen_domain**. The output of **gen_domain** is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See :numref:`Figure mknoocnmap.pl` for the legend for this figure.) In this case the process creates both SCRIP grid files to be used by **mkmapdata.sh** as well as the domain files that will be used by both CLM and DATM. diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index c044c283af..c1a2f1e637 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -37,7 +37,7 @@ If you want to create a regular latitude/longitude single-point or regional grid -nx Number of longitudes (default is 1) -ny Number of latitudes (default is 1) -See `Figure 2-5 `_ for a visual representation of this process. +See :numref:`Figure mknoocnmap.pl` for a visual representation of this process. 2. Creating mapping files for mksurfdata_map @@ -48,7 +48,7 @@ See `Figure 2-5 `_ for a visual representation of this process. The bash shell script ``$CTSMROOT/tools/mkmapgrids/mkmapdata.sh`` uses **ESMF_RegridWeightGen** to create a list of maps from the raw datasets that are input to **mksurfdata_map**. Each dataset that has a different grid, or land-mask needs a different mapping file for it, but many different raw datasets share the same grid/land-mask as other files. Hence, there doesn't need to be a different mapping file for EACH raw dataset -- just for each raw dataset that has a DIFFERENT grid or land-mask.. -See `Figure 2-3 `_ for a visual representation of how this works. +See :numref:`Figure mkmapdata.sh` for a visual representation of how this works. The bash script figures out which mapping files it needs to create and then runs **ESMF_RegridWeightGen** for each one. You can then either enter the datasets into the XML database (see `Chapter 3 `_ or leave the files in place, and use the "-res usrspec -usr_gname -usr_gdate" options to **mksurfdata_map** (see `the Section called Running mksurfdata.pl `_ below). mkmapdata.sh has a help option with the following @@ -105,8 +105,10 @@ mkmapdata.sh has a help option with the following ********************** -Figure 2-3. Details of running mkmapdata.sh -------------------------------------------- -Insert figure 2-3 +.. _Figure mkmapdata.sh -Each of the raw datasets for **mksurfdata_map** needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what **mkmapdata.sh** does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in **mksurfdata_map**. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into **mksurfdata_map** see `Figure 2-6 `_. +.. figure:: mkmapdata_details.jpeg + +Details of running mkmapdata.sh + +Each of the raw datasets for **mksurfdata_map** needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what **mkmapdata.sh** does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in **mksurfdata_map**. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into **mksurfdata_map** see :numref:`Figure mksurfdatamap`. diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index c5a5644034..bc9469a4ad 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -6,17 +6,23 @@ Creating Surface Datasets =========================== -When just creating a replacement file for an existing one, the relevant tool should be used directly to create the file. When you are creating a set of files for a new resolution there are some dependencies between the tools that you need to keep in mind when creating them. The main dependency is that you MUST create a SCRIP grid file first as the SCRIP grid dataset is then input into the other tools. Also look at `Table 3-1 `_ which gives information on the files required and when. `Figure 2-1 `_ shows an overview of the general data-flow for creation of the fsurdat datasets. +When just creating a replacement file for an existing one, the relevant tool should be used directly to create the file. When you are creating a set of files for a new resolution there are some dependencies between the tools that you need to keep in mind when creating them. The main dependency is that you MUST create a SCRIP grid file first as the SCRIP grid dataset is then input into the other tools. Also look at `Table 3-1 `_ which gives information on the files required and when. :numref:`Figure Data_Flow` shows an overview of the general data-flow for creation of the fsurdat datasets. -Figure 2-1. Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files --------------------------------------------------------------------------------- -Insert figure 2-1 +.. _Figure Data_Flow -Starting from a SCRIP grid file that describes the grid you will run the model on, you first run **mkmapdata.sh** to create a list of mapping files. See `Figure 2-3 `_ for a more detailed view of how **mkmapdata.sh** works. The mapping files tell **mksurfdata_map** how to map between the output grid and the raw datasets that it uses as input. The output of **mksurfdata_map** is a surface dataset that you then use for running the model. See `Figure 2-6 `_ for a more detailed view of how **mksurfdata_map** works. +.. figure:: mkmapdata_mksurfdata.jpeg -`Figure 2-2 `_ is the legend for this figure (`Figure 2-1 `_) and other figures in this chapter (`Figure 2-4 `_, `Figure 2-5 `_, and `Figure 2-6 `_). -Figure 2-2. Legend for Data Flow Figures -Insert figure 2-2 +Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files + +Starting from a SCRIP grid file that describes the grid you will run the model on, you first run **mkmapdata.sh** to create a list of mapping files. See :numref:`Figure mkmapdata.sh` for a more detailed view of how **mkmapdata.sh** works. The mapping files tell **mksurfdata_map** how to map between the output grid and the raw datasets that it uses as input. The output of **mksurfdata_map** is a surface dataset that you then use for running the model. See `Figure :numref:`Figure mksurfdatamap` for a more detailed view of how **mksurfdata_map** works. + +:numref:`Figure Data_Flow_Legend` is the legend for this figure (:numref:`Figure Data_Flow`) and other figures in this chapter (:numref:`Figure Global_Domain`, :numref:`Figure mknoocnmap.pl` and :numref:`Figure mksurfdatamap`). + +.. _Figure Data_Flow_Legend + +.. figure:: LegendCLMToolDataFlow.jpeg + +Legend for Data Flow Figures Green arrows define the input to a program, while red arrows define the output. Cylinders define files that are either created by a program or used as input for a program. Boxes are programs. From 48be76a4cc0fa9853eae7ecfbdbbba5f9f941c29 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 Jan 2020 15:33:21 -0700 Subject: [PATCH 595/730] Add figures to tools for users guide --- .../users_guide/using-clm-tools/creating-domain-files.rst | 4 ++-- .../creating-input-for-surface-dataset-generation.rst | 2 +- .../users_guide/using-clm-tools/creating-surface-datasets.rst | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index eb4f19471d..9e61bfce7f 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -18,7 +18,7 @@ Global Domain file creation .. figure:: GlobalDomain.jpeg -Global Domain file creation + Global Domain file creation Starting from SCRIP grid files for both your atmosphere and ocean, you use **$CIMEROOT/tools/mapping/gen_mapping_files/gen_cesm_maps.sh** to create a mapping file between the atmosphere and ocean. That mapping file is then used as input to **gen_domain** to create output domain files for both atmosphere and ocean. The atmosphere domain file is then used by both CLM and DATM for I compsets, while the ocean domain file is ignored. For this process you have to define your SCRIP grid files on your own. For a regional or single-point case that doesn't include ocean see :numref:`Figure mknoocnmap.pl`. (See :numref:`Figure Global-Domain` for the legend for this figure.) @@ -31,7 +31,7 @@ Domain file creation using mknoocnmap.pl .. figure:: mknoocnmap.jpeg -Domain file creation using mknoocnmap.pl + Domain file creation using mknoocnmap.pl For a regular latitude/longitude grid that can be used for regional or single point simulations -- you can use **mknoocnmap.pl**. It creates a SCRIP grid file that can then be used as input to **mkmapdata.sh** as well as a SCRIP mapping file that is then input to **gen_domain**. The output of **gen_domain** is a atmosphere domain file used by both CLM and DATM and a ocean domain file that is ignored. (See :numref:`Figure mknoocnmap.pl` for the legend for this figure.) diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index c1a2f1e637..6877a1f1e5 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -109,6 +109,6 @@ mkmapdata.sh has a help option with the following .. figure:: mkmapdata_details.jpeg -Details of running mkmapdata.sh + Details of running mkmapdata.sh Each of the raw datasets for **mksurfdata_map** needs a mapping file to map from the output grid you are running on to the grid and land-mask for that dataset. This is what **mkmapdata.sh** does. To create the mapping files you need a SCRIP grid file to correspond with each resolution and land mask that you have a raw data file in **mksurfdata_map**. Some raw datasets share the same grid and land mask -- hence they can share the same SCRIP grid file. The output maps created here go into **mksurfdata_map** see :numref:`Figure mksurfdatamap`. diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index bc9469a4ad..7db5817adf 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -12,7 +12,7 @@ When just creating a replacement file for an existing one, the relevant tool sho .. figure:: mkmapdata_mksurfdata.jpeg -Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files + Data Flow for Creation of Surface Datasets from Raw SCRIP Grid Files Starting from a SCRIP grid file that describes the grid you will run the model on, you first run **mkmapdata.sh** to create a list of mapping files. See :numref:`Figure mkmapdata.sh` for a more detailed view of how **mkmapdata.sh** works. The mapping files tell **mksurfdata_map** how to map between the output grid and the raw datasets that it uses as input. The output of **mksurfdata_map** is a surface dataset that you then use for running the model. See `Figure :numref:`Figure mksurfdatamap` for a more detailed view of how **mksurfdata_map** works. @@ -22,7 +22,7 @@ Starting from a SCRIP grid file that describes the grid you will run the model o .. figure:: LegendCLMToolDataFlow.jpeg -Legend for Data Flow Figures + Legend for Data Flow Figures Green arrows define the input to a program, while red arrows define the output. Cylinders define files that are either created by a program or used as input for a program. Boxes are programs. From bc307472162ac8393ef5bb06e68013341fe89025 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 Jan 2020 16:59:24 -0700 Subject: [PATCH 596/730] Add missing colons to figure targets --- .../users_guide/using-clm-tools/creating-domain-files.rst | 4 ++-- .../creating-input-for-surface-dataset-generation.rst | 2 +- .../users_guide/using-clm-tools/creating-surface-datasets.rst | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst index 9e61bfce7f..972967da0c 100644 --- a/doc/source/users_guide/using-clm-tools/creating-domain-files.rst +++ b/doc/source/users_guide/using-clm-tools/creating-domain-files.rst @@ -14,7 +14,7 @@ Here we create domain files for a regular global domain. Global Domain file creation =========================== -.. _Figure Global-Domain +.. _Figure Global-Domain: .. figure:: GlobalDomain.jpeg @@ -27,7 +27,7 @@ Note, that the SCRIP grid file used to start this process, is also used in **mkm Domain file creation using mknoocnmap.pl ======================================== -.. _Figure mknoocnmap.pl +.. _Figure mknoocnmap.pl: .. figure:: mknoocnmap.jpeg diff --git a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst index 6877a1f1e5..6048baa98c 100644 --- a/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst +++ b/doc/source/users_guide/using-clm-tools/creating-input-for-surface-dataset-generation.rst @@ -105,7 +105,7 @@ mkmapdata.sh has a help option with the following ********************** -.. _Figure mkmapdata.sh +.. _Figure mkmapdata.sh: .. figure:: mkmapdata_details.jpeg diff --git a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst index 7db5817adf..ce02fec2f6 100644 --- a/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/creating-surface-datasets.rst @@ -8,7 +8,7 @@ When just creating a replacement file for an existing one, the relevant tool should be used directly to create the file. When you are creating a set of files for a new resolution there are some dependencies between the tools that you need to keep in mind when creating them. The main dependency is that you MUST create a SCRIP grid file first as the SCRIP grid dataset is then input into the other tools. Also look at `Table 3-1 `_ which gives information on the files required and when. :numref:`Figure Data_Flow` shows an overview of the general data-flow for creation of the fsurdat datasets. -.. _Figure Data_Flow +.. _Figure Data_Flow: .. figure:: mkmapdata_mksurfdata.jpeg @@ -18,7 +18,7 @@ Starting from a SCRIP grid file that describes the grid you will run the model o :numref:`Figure Data_Flow_Legend` is the legend for this figure (:numref:`Figure Data_Flow`) and other figures in this chapter (:numref:`Figure Global_Domain`, :numref:`Figure mknoocnmap.pl` and :numref:`Figure mksurfdatamap`). -.. _Figure Data_Flow_Legend +.. _Figure Data_Flow_Legend: .. figure:: LegendCLMToolDataFlow.jpeg From 195c9b2e6993cbad7d8a13cd68243187a2c8ca18 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 3 Jan 2020 12:56:10 -0700 Subject: [PATCH 597/730] Updated fates default file to newer version of api 8.1 --- bld/namelist_files/namelist_defaults_clm4_5.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 95242dc7d8..7ff499fe39 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -355,7 +355,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c191217.nc +lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c200103.nc From 5d57fffd65b11658842660eac3e370c3b2f8fe55 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Sat, 4 Jan 2020 12:00:37 -0700 Subject: [PATCH 598/730] Updated fates tag to match api 8.1.0 --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 9e1fae0333..23deb68027 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.30.0_api.8.0.0 +tag = sci.1.31.1_api.8.1.0 required = True [PTCLM] From f9c1c88f7522194c8a275d4e5f334e28906f99b2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 Jan 2020 15:39:24 -0700 Subject: [PATCH 599/730] Update externals for rtm mosart and cime --- Externals.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 08a6d0695e..395d2f70a1 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -15,22 +15,22 @@ required = True [rtm] local_path = components/rtm protocol = git -repo_url = https://github.com/ESCOMP/rtm -tag = release-cesm2.0.03 +repo_url = https://github.com/ekluzek/rtm +branch = release-cesm2.0 required = True [mosart] local_path = components/mosart protocol = git -repo_url = https://github.com/ESCOMP/mosart -tag = release-cesm2.0.03 +repo_url = https://github.com/ekluzek/mosart +branch = release-cesm2.0 required = True [cime] local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime5.6.25 +tag = cime5.6.28 required = True [externals_description] From a7eab48e1eeec701bb8e96079c32e5d38bdeaa60 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 Jan 2020 15:58:39 -0700 Subject: [PATCH 600/730] Also add a check for gridcell weights, fixing #847 --- src/biogeophys/SoilMoistureStreamMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/SoilMoistureStreamMod.F90 b/src/biogeophys/SoilMoistureStreamMod.F90 index 6f625c52a4..8e606418f6 100644 --- a/src/biogeophys/SoilMoistureStreamMod.F90 +++ b/src/biogeophys/SoilMoistureStreamMod.F90 @@ -358,7 +358,9 @@ subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & g = col%gridcell(c) ig = g_to_ig(g) - if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) ) then + ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) + if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) .and. & + (col%wtgcell(c) /= 0._r8) ) then ! this is a 2d field (gridcell/nlevsoi) ! do j = 1, nlevsoi From 34ba59ab268e28fa1f9e33dbe1886f69fbc013a2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 Jan 2020 13:32:55 -0700 Subject: [PATCH 601/730] Update to RTM and MOSART tags, rather than branch, and uppercase ESCOMP modules as they are now all handled that way --- Externals.cfg | 10 +++++----- Externals_CLM.cfg | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 395d2f70a1..da82eb82b7 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -7,7 +7,7 @@ required = True [cism] local_path = components/cism protocol = git -repo_url = https://github.com/ESCOMP/cism-wrapper +repo_url = https://github.com/ESCOMP/CISM-wrapper tag = release-cesm2.0.04 externals = Externals_CISM.cfg required = True @@ -15,15 +15,15 @@ required = True [rtm] local_path = components/rtm protocol = git -repo_url = https://github.com/ekluzek/rtm -branch = release-cesm2.0 +repo_url = https://github.com/ESCOMP/RTM +tag = release-cesm2.0.04 required = True [mosart] local_path = components/mosart protocol = git -repo_url = https://github.com/ekluzek/mosart -branch = release-cesm2.0 +repo_url = https://github.com/ESCOMP/MOSART +tag = release-cesm2.0.04 required = True [cime] diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index b1436326b1..c289adec62 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -8,7 +8,7 @@ required = True [PTCLM] local_path = tools/PTCLM protocol = git -repo_url = https://github.com/ESCOMP/ptclm +repo_url = https://github.com/ESCOMP/PTCLM tag = PTCLM2_180611 required = True From 9a10f7b0650b63085a2ffcf6ace1b8b9aeb3738d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 Jan 2020 15:56:02 -0700 Subject: [PATCH 602/730] Remove the non-fates test with the land-ice model from the fates test list, and add a comment for the remaining non-fates test in the fates test list to say, that it's just there to ensure that any changes for fates won't mess up the mainline model without fates --- cime_config/testdefs/testlist_clm.xml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d16728194c..97ced69e17 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1882,15 +1882,6 @@ - - - - - - - - - @@ -1898,6 +1889,7 @@ + From 0569c62c759de39098f0680216f65b7d23420178 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 Jan 2020 15:25:37 -0700 Subject: [PATCH 603/730] Backup fates update to sci.1.30.0_api.8.0.0 rather than very latest of sci.1.31.1_api.8.1.0 --- Externals_CLM.cfg | 2 +- .../namelist_defaults_clm4_5.xml | 2 +- cime_config/testdefs/ExpectedTestFails.xml | 2 + src/biogeophys/CanopyFluxesMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 143 +++++------------- 5 files changed, 44 insertions(+), 107 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 170f5f5d3a..c289adec62 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.31.1_api.8.1.0 +tag = sci.1.30.0_api.8.0.0 required = True [PTCLM] diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml index 3aac2ffefc..63816ced70 100644 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ b/bld/namelist_files/namelist_defaults_clm4_5.xml @@ -378,7 +378,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.8.1.0_12pft_c200103.nc +lnd/clm2/paramdata/fates_params_api.8.0.0_12pft_c191216.nc diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index f13846af5f..9f41cc2e52 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -14,7 +14,9 @@ FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro RUN FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro COMPARE_base_rest FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro RUN + FAIL ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruGs.izumi_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.hobart_nag.clm-FatesHydro MEMLEAK + FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.izumi_nag.clm-FatesHydro RUN FAIL SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruGs.cheyenne_intel.clm-FatesHydro RUN diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index b2673f6bec..5890ad9869 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -1277,7 +1277,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, call clm_fates%wrap_accumulatefluxes(nc,fn,filterp(1:fn)) - call clm_fates%wrap_hydraulics_drive(bounds,nc,fn,filterp(1:fn),soilstate_inst, & + call clm_fates%wrap_hydraulics_drive(bounds,nc,soilstate_inst, & waterstate_inst,waterflux_inst,solarabs_inst,energyflux_inst) else diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 69a64ca020..090cd2826e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -197,11 +197,6 @@ module CLMFatesInterfaceMod ! developer will at least question its usage (RGK) private :: hlm_bounds_to_fates_bounds - ! The GetAndSetTime function is used to get the current time from the CLM - ! time procedures and then set to the fates global time variables during restart, - ! init_coldstart, and dynamics_driv function calls - private :: GetAndSetTime - logical :: debug = .false. character(len=*), parameter, private :: sourcefile = & @@ -584,9 +579,22 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: c ! column index (HLM) integer :: ifp ! patch index integer :: p ! HLM patch index + integer :: yr ! year (0, ...) + integer :: mon ! month (1, ..., 12) + integer :: day ! day of month (1, ..., 31) + integer :: sec ! seconds of the day integer :: nlevsoil ! number of soil layers at the site integer :: nld_si ! site specific number of decomposition layers - + integer :: current_year + integer :: current_month + integer :: current_day + integer :: current_tod + integer :: current_date + integer :: jan01_curr_year + integer :: reference_date + integer :: days_per_year + real(r8) :: model_day + real(r8) :: day_of_year !----------------------------------------------------------------------- ! --------------------------------------------------------------------------------- @@ -598,8 +606,24 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! and it keeps all the boundaries in one location ! --------------------------------------------------------------------------------- - ! Set the FATES global time and date variables - call GetAndSetTime + days_per_year = get_days_per_year() + call get_curr_date(current_year,current_month,current_day,current_tod) + current_date = current_year*10000 + current_month*100 + current_day + jan01_curr_year = current_year*10000 + 100 + 1 + + call get_ref_date(yr, mon, day, sec) + reference_date = yr*10000 + mon*100 + day + + call timemgr_datediff(reference_date, sec, current_date, current_tod, model_day) + + call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) + + call SetFatesTime(current_year, current_month, & + current_day, current_tod, & + current_date, reference_date, & + model_day, floor(day_of_year), & + days_per_year, 1.0_r8/dble(days_per_year)) + do s=1,this%fates(nc)%nsites @@ -965,9 +989,6 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & ! I think that is it... ! --------------------------------------------------------------------------------- - ! Set the FATES global time and date variables - call GetAndSetTime - if(.not.initialized) then initialized=.true. @@ -1155,6 +1176,8 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & this%fates(nc)%sites, & this%fates(nc)%bc_out) + + ! ------------------------------------------------------------------------ ! Update history IO fields that depend on ecosystem dynamics ! ------------------------------------------------------------------------ @@ -1196,10 +1219,6 @@ subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_ins integer :: s integer :: c - - ! Set the FATES global time and date variables - call GetAndSetTime - nclumps = get_proc_clumps() !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) @@ -1404,13 +1423,6 @@ subroutine prep_canopyfluxes(this, nc, fn, filterp, photosyns_inst) do s = 1, this%fates(nc)%nsites ! filter flag == 1 means that this patch has not been called for photosynthesis this%fates(nc)%bc_in(s)%filter_photo_pa(:) = 1 - - ! set transpiration input boundary condition to zero. The exposed - ! vegetation filter may not even call every patch. - - this%fates(nc)%bc_in(s)%qflx_transp_pa(:) = 0._r8 - - end do end subroutine prep_canopyfluxes @@ -2219,7 +2231,6 @@ end subroutine ComputeRootSoilFlux ! ====================================================================================== subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & - fn, filterp, & soilstate_inst, waterstate_inst, waterflux_inst, & solarabs_inst, energyflux_inst) @@ -2228,8 +2239,6 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type),intent(in) :: bounds_clump integer,intent(in) :: nc - integer, intent(in) :: fn - integer, intent(in) :: filterp(fn) type(soilstate_type) , intent(inout) :: soilstate_inst type(waterstate_type) , intent(inout) :: waterstate_inst type(waterflux_type) , intent(inout) :: waterflux_inst @@ -2240,7 +2249,6 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & integer :: s integer :: c integer :: j - integer :: f ! loop index for the patch filter integer :: ifp integer :: p integer :: nlevsoil @@ -2277,28 +2285,12 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & soilstate_inst%eff_porosity_col(c,1:nlevsoil) do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - ! fsa_patch was filled on the nourban_pa filter, which should cover - ! all fates patches. - ! These are not currently used anyway (RGK 07/30/19) - this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) - this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) + p = ifp+col%patchi(c) + this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) + this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) + this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterflux_inst%qflx_tran_veg_patch(p) end do - - end do - - - ! The exposed vegetation filter "filterp" dictates which patches - ! had their transpiration updated during canopy_fluxes(). Patches - ! not in the filter had been zero'd during prep_canopyfluxes(). - - do f = 1,fn - p = filterp(f) - c = patch%column(p) - s = this%f2hmap(nc)%hsites(c) - ifp = p - col%patchi(c) - this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterflux_inst%qflx_tran_veg_patch(p) - end do + end do ! Call Fates Hydraulics ! ------------------------------------------------------------------------------------ @@ -2415,61 +2407,4 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) end subroutine hlm_bounds_to_fates_bounds - ! ====================================================================================== - - subroutine GetAndSetTime() - - ! CLM MODULES - use clm_time_manager , only : get_days_per_year, & - get_curr_date, & - get_ref_date, & - timemgr_datediff - - ! FATES MODULES - use FatesInterfaceMod , only : SetFatesTime - - ! LOCAL VARIABLES - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - integer :: current_year - integer :: current_month - integer :: current_day - integer :: current_tod - integer :: current_date - integer :: jan01_curr_year - integer :: reference_date - integer :: days_per_year - real(r8) :: model_day - real(r8) :: day_of_year - - - ! Get the current date and determine the set the start of the current year - call get_curr_date(current_year,current_month,current_day,current_tod) - current_date = current_year*10000 + current_month*100 + current_day - jan01_curr_year = current_year*10000 + 100 + 1 - - ! Get the reference date components and compute the date - call get_ref_date(yr, mon, day, sec) - reference_date = yr*10000 + mon*100 + day - - ! Get the defined number of days per year - days_per_year = get_days_per_year() - - ! Determine the model day - call timemgr_datediff(reference_date, sec, current_date, current_tod, model_day) - - ! Determine the current DOY - call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) - - ! Set the FATES global time variables - call SetFatesTime(current_year, current_month, & - current_day, current_tod, & - current_date, reference_date, & - model_day, floor(day_of_year), & - days_per_year, 1.0_r8/dble(days_per_year)) - - end subroutine GetAndSetTime - end module CLMFatesInterfaceMod From 615a306612fb1c2f726ee9fa489ab019175243ad Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 Jan 2020 15:31:43 -0700 Subject: [PATCH 604/730] Fix #871 so resolution is NOT checked before running build-namelist --- bld/namelist_files/namelist_defaults_overall.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index 3b2721fbbf..44da084342 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -55,9 +55,8 @@ determine default values for namelists. constant - -1 -0 + +0 1 From 137cd0e396e7bfeafd352ad4093debc2182f60a7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 Jan 2020 15:34:06 -0700 Subject: [PATCH 605/730] Update to latest cism release version for cesm2.1.2 --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index da82eb82b7..090732ee79 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/CISM-wrapper -tag = release-cesm2.0.04 +tag = cism-release-cesm2.1.2_01 externals = Externals_CISM.cfg required = True From 2887c561e9972bca166fd0dfc300657505a678c1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 17 Jan 2020 22:31:35 -0700 Subject: [PATCH 606/730] Fix the threading problem by declaring numdims as private --- src/main/histFileMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index e1c16415e3..ca9c64e476 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -1069,7 +1069,7 @@ subroutine hist_update_hbuf(bounds) !----------------------------------------------------------------------- do t = 1,ntapes -!$OMP PARALLEL DO PRIVATE (f, num2d) +!$OMP PARALLEL DO PRIVATE (f, num2d, numdims) do f = 1,tape(t)%nflds numdims = tape(t)%hlist(f)%field%numdims From 73977e54b791cbdc60a2de1496b949b408a66890 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 Jan 2020 00:08:01 -0700 Subject: [PATCH 607/730] Update module init version, and remove version specific information from all of the module module settings --- test/tools/test_driver.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index 39b945fcdc..0cd322b9d2 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -40,15 +40,15 @@ input_file="tests_pretag_cheyenne_nompi" c_threads=36 -export INITMODULES="/glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/sh" +export INITMODULES="/glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh" . \$INITMODULES module purge -module load ncarenv/1.0 -module load intel/17.0.1 +module load ncarenv +module load intel module load mkl -module load ncarcompilers/0.3.5 -module load netcdf/4.4.1.1 +module load ncarcompilers +module load netcdf module load nco module load python @@ -88,7 +88,7 @@ EOF ;; ## DAV cluster - geyser* | caldera* | pronghorn*) + casper* | pronghorn*) submit_script="test_driver_dav${cur_time}.sh" ##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv @@ -101,16 +101,16 @@ input_file="tests_posttag_dav_mpi" c_threads=36 -export INITMODULES="/glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/sh" +export INITMODULES="/glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh" . \$INITMODULES module purge -module load ncarenv/1.0 -module load intel/12.1.5 +module load ncarenv +module load intel module load mkl module load ncarcompilers -module load netcdf/4.3.3.1 -module load mpich-slurm/3.2.1 +module load netcdf +module load openmpi module load nco module load python @@ -210,9 +210,9 @@ export INITMODULES="/usr/share/Modules/init/sh" . \$INITMODULES module purge -module load compiler/intel/18.0.3 -module load tool/nco/4.7.5 -module load tool/netcdf/4.6.1/intel +module load compiler/intel +module load tool/nco +module load tool/netcdf export NETCDF_DIR=\$NETCDF_PATH export INC_NETCDF=\${NETCDF_PATH}/include @@ -290,9 +290,9 @@ export INITMODULES="/usr/share/Modules/init/sh" . \$INITMODULES module purge -module load compiler/intel/19.0.1 -module load tool/nco/4.7.5 -module load tool/netcdf/4.6.1/intel +module load compiler/intel +module load tool/nco +module load tool/netcdf export NETCDF_DIR=\$NETCDF_PATH export INC_NETCDF=\${NETCDF_PATH}/include From 258bdea52d840f63782c5ee79e5eb234673d0416 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 Jan 2020 13:27:32 -0700 Subject: [PATCH 608/730] Update change files --- doc/ChangeSum | 2 +- doc/release-clm5.0.ChangeLog | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/doc/ChangeSum b/doc/ChangeSum index 8008353413..b377f166a2 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ -release-clm5.0.30 erik 11/19/2019 Update FATES to sci.1.30.0_api.8.0.0 +release-clm5.0.30 erik 01/21/2020 Update FATES to sci.1.30.0_api.8.0.0 release-clm5.0.29 erik 11/19/2019 Some answer changes needed for prescribed soil-moisture and clm4_5 defaults (1850-ndep, and urbantv settings) release-clm5.0.28 erik 11/14/2019 Several bit-for-bit fixes especially around soil-moisture streams release-clm5.0.27 erik 08/13/2019 Add presoribed soil moisture streams as an option, and a few fixes diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 1a93c93ce8..7a414dbbc8 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.30 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Nov 19 16:34:38 MST 2019 +Date: Tue Jan 21 13:27:16 MST 2020 One-line Summary: Update FATES to sci.1.30.0_api.8.0.0 Purpose of this version: @@ -10,12 +10,19 @@ Purpose of this version: Update FATES to sci.1.30.0_api.8.0.0, and point to the NGEET version, rather than NCAR/fates-release version. +One change to soil-moisture (also check if gridcell weight is non-zero, before specifying prescribed soil moisture. +Also update mosart with cold start bug fix. Update rtm, cism, and cime to versions on cesm2.1.2 release tag. +Fix some issues with PTCLM. + +Fixes #847 + CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) Summary of changes: ------------------- -Issues fixed (include CTSM Issue #): None +Issues fixed (include CTSM Issue #): #847 + #847 -- issues with prescribed soil moisture Science changes since: release-clm5.0.28 FATES science update from sci-1.27.1 to sci.1.30.0 @@ -41,11 +48,11 @@ Testing: tools-tests (components/clm/test/tools): - cheyenne - NOT run + cheyenne - PASS PTCLM testing (components/clm/tools/shared/PTCLM/test): - cheyenne - NOT run + cheyenne - OK regular tests (aux_clm): @@ -70,12 +77,12 @@ Changes answers relative to baseline: Yes, but only when running with FATES Detailed list of changes: ------------------------ -Externals being used: FATES updated +Externals being used: all externals updated - cism: release-cesm2.0.04 - rtm: release-cesm2.0.03 - mosart: release-cesm2.0.03 - cime: cim5.6.25 + cism: cism-release-cesm2.1.2_01 + rtm: release-cesm2.0.04 + mosart: release-cesm2.0.04 + cime: cim5.6.28 FATES: sci.1.30.0_api.8.0.0 PTCLM: PTCLM2_180611 From 90f598958ed8552323848ba5eb7ef69df8fd3300 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 Jan 2020 13:40:47 -0700 Subject: [PATCH 609/730] Pass git-describe down, since you can only get it from within the git clone (so potentially have to cd to it), also make files in current directory (unless within the CTSM structure, so that testing will work --- tools/mkmapdata/mknoocnmap.pl | 23 ++++++++++++++--------- tools/mkmapdata/mkunitymap.ncl | 8 +++++++- tools/mkmapgrids/mkscripgrid.ncl | 8 +++++++- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/tools/mkmapdata/mknoocnmap.pl b/tools/mkmapdata/mknoocnmap.pl index 67e65e6a70..5438c8bcd3 100755 --- a/tools/mkmapdata/mknoocnmap.pl +++ b/tools/mkmapdata/mknoocnmap.pl @@ -256,13 +256,19 @@ sub absolute_path { print "\n\nCreate SCRIP grid and mapping files for a single-point\n"; } # land grid... +my $GITDES = `cd $scrdir; git describe; cd -`; +$GITDES =~ s/\n//g; my $grddir = absolute_path( "$scrdir/../mkmapgrids" ); -my $grid1 = "$grddir/SCRIPgrid_${name}_nomask_c${cdate}.nc"; +my $cwd = getcwd(); +my $datdir = $grddir; +if ( $cwd ne $scrdir ) { + $datdir = $cwd; +} +my $grid1 = "$datdir/SCRIPgrid_${name}_nomask_c${cdate}.nc"; my $cmdenv = "env S_LAT=$S_lat W_LON=$W_lon N_LAT=$N_lat E_LON=$E_lon " . - "NX=$nx NY=$ny PTNAME=$name $print "; + "NX=$nx NY=$ny PTNAME=$name GITDES=$GITDES $print "; -chdir( "$grddir" ); -my $cmd = "$cmdenv GRIDFILE=$grid1 ncl mkscripgrid.ncl"; +my $cmd = "$cmdenv GRIDFILE=$grid1 ncl $scrdir/../mkmapgrids/mkscripgrid.ncl"; if ( $printlev > 0 ) { print "Create land SCRIP gridfile\n"; print "Execute: $cmd\n"; @@ -270,8 +276,8 @@ sub absolute_path { system( $cmd ); # ocean grid... -my $grid2 = "$grddir/SCRIPgrid_${name}_noocean_c${cdate}.nc"; -my $cmd = "$cmdenv GRIDFILE=$grid2 IMASK=0 ncl mkscripgrid.ncl"; +my $grid2 = "$datdir/SCRIPgrid_${name}_noocean_c${cdate}.nc"; +my $cmd = "$cmdenv GRIDFILE=$grid2 IMASK=0 ncl $scrdir/../mkmapgrids/mkscripgrid.ncl"; if ( $printlev > 0 ) { print "Create ocean SCRIP gridfile\n"; print "Execute: $cmd\n"; @@ -281,10 +287,9 @@ sub absolute_path { # Now create a unity mapping between the two... # Note reversal of grid1 & grid2, because we want an ocean -> land # mapping file -chdir( "$scrdir" ); -my $mapfile = "map_${name}_noocean_to_${name}_nomask_aave_da_${cdate}.nc"; +my $mapfile = "$datdir/map_${name}_noocean_to_${name}_nomask_aave_da_${cdate}.nc"; my $cmd = "env GRIDFILE1=$grid2 GRIDFILE2=$grid1 MAPFILE=$mapfile " . - "$print ncl $scrdir/mkunitymap.ncl"; + "GITDES=$GITDES $print ncl $scrdir/mkunitymap.ncl"; if ( $printlev > 0 ) { print "Create unity mapping file between the two gridfile\n"; diff --git a/tools/mkmapdata/mkunitymap.ncl b/tools/mkmapdata/mkunitymap.ncl index ce0c17f988..7570f7eedd 100644 --- a/tools/mkmapdata/mkunitymap.ncl +++ b/tools/mkmapdata/mkunitymap.ncl @@ -23,6 +23,8 @@ begin print_str = getenv("PRINT"); ; Do Extra printing for debugging + gitdescribe = getenv("GITDES"); ; Git describe from the source clone + if ( ismissing(gridfile1) )then print( "ERROR: GRIDFILE1 is missing!" ); exit @@ -45,6 +47,10 @@ begin end if end if + if ( ismissing(gitdescribe) )then + gitdescribe = systemfunc( "git describe" ) + end if + ; ; Open up the input grid files ; @@ -134,7 +140,7 @@ begin nc@grid_file_dst = gridfile2; nc@title = "SCRIP mapping file between identical grids without ocean"; nc@history = ldate+": create using mkunitymap.ncl"; - nc@Version = systemfunc( "git describe" ); + nc@Version = gitdescribe; ; ; Fraction diff --git a/tools/mkmapgrids/mkscripgrid.ncl b/tools/mkmapgrids/mkscripgrid.ncl index 0bfb26671c..65b9306f2d 100644 --- a/tools/mkmapgrids/mkscripgrid.ncl +++ b/tools/mkmapgrids/mkscripgrid.ncl @@ -36,6 +36,8 @@ begin outfilename = getenv("GRIDFILE"); ; Get filename from env variable + gitdescribe = getenv("GITDES"); ; Git describe from the source clone + if ( ismissing(nx) )then nx = 1; end if @@ -82,6 +84,10 @@ begin end if end if + if ( ismissing(gitdescribe) )then + gitdescribe = systemfunc( "git describe" ) + end if + system( "/bin/rm -f "+outfilename ); if ( printn )then print( "output file: "+outfilename ); @@ -156,7 +162,7 @@ end nc = addfile( outfilename, "w" ); nc@history = ldate+": create using mkscripgrid.ncl"; nc@comment = "Ocean is assumed to non-existant at this point"; - nc@Version = systemfunc( "git describe" ); + nc@Version = gitdescribe; if ( printn )then print( "================================================================================================" ); print( "Successfully created SCRIP grid file: "+outfilename); From 4713406a8a83ffca59754e07932bf5714a455429 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 Jan 2020 13:45:42 -0700 Subject: [PATCH 610/730] Update PTCLM --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index c289adec62..f38a229b9f 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -9,7 +9,7 @@ required = True local_path = tools/PTCLM protocol = git repo_url = https://github.com/ESCOMP/PTCLM -tag = PTCLM2_180611 +tag = PTCLM2_20200121 required = True [externals_description] From 30ceef044893df94a7207912902364af125184ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 Jan 2020 13:47:50 -0700 Subject: [PATCH 611/730] Update change file --- doc/release-clm5.0.ChangeLog | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 7a414dbbc8..1241f36d0f 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.30 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jan 21 13:27:16 MST 2020 +Date: Tue Jan 21 13:46:01 MST 2020 One-line Summary: Update FATES to sci.1.30.0_api.8.0.0 Purpose of this version: @@ -14,8 +14,6 @@ One change to soil-moisture (also check if gridcell weight is non-zero, before s Also update mosart with cold start bug fix. Update rtm, cism, and cime to versions on cesm2.1.2 release tag. Fix some issues with PTCLM. -Fixes #847 - CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) Summary of changes: @@ -84,7 +82,7 @@ Externals being used: all externals updated mosart: release-cesm2.0.04 cime: cim5.6.28 FATES: sci.1.30.0_api.8.0.0 - PTCLM: PTCLM2_180611 + PTCLM: PTCLM2_20200121 CTSM Tag versions pulled over from master development branch: None From eea20afff7a90128057e259993fa7b9ae3d3ebac Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 Jan 2020 13:51:02 -0700 Subject: [PATCH 612/730] Update doc --- doc/release-clm5.0.ChangeLog | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog index 1241f36d0f..4d43ab1115 100644 --- a/doc/release-clm5.0.ChangeLog +++ b/doc/release-clm5.0.ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: release-clm5.0.30 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jan 21 13:46:01 MST 2020 +Date: Tue Jan 21 13:50:48 MST 2020 One-line Summary: Update FATES to sci.1.30.0_api.8.0.0 Purpose of this version: @@ -19,8 +19,9 @@ CTSM Master Tag This Corresponds To: ctsm1.0.dev025 (with many other changes) Summary of changes: ------------------- -Issues fixed (include CTSM Issue #): #847 - #847 -- issues with prescribed soil moisture +Issues fixed (include CTSM Issue #): #847 #871 + Fixes #847 -- issues with prescribed soil moisture + Fixes #871 -- don't check for valid resolution for CESM cases by default Science changes since: release-clm5.0.28 FATES science update from sci-1.27.1 to sci.1.30.0 From 3d52a387bacb3b15c9a34fb4e02d25318f4d68cd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 23 Mar 2020 15:04:50 -0600 Subject: [PATCH 613/730] Fix #921 --- src/utils/clmfates_paraminterfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_paraminterfaceMod.F90 b/src/utils/clmfates_paraminterfaceMod.F90 index 9a3ce58ff7..2f63389ad4 100644 --- a/src/utils/clmfates_paraminterfaceMod.F90 +++ b/src/utils/clmfates_paraminterfaceMod.F90 @@ -2,6 +2,7 @@ module CLMFatesParamInterfaceMod ! NOTE(bja, 2017-01) this code can not go into the main clm-fates ! interface module because of circular dependancies with pftvarcon. + use shr_kind_mod, only : r8 => shr_kind_r8 use FatesGlobals, only : fates_log implicit none @@ -172,7 +173,6 @@ end subroutine GetUsedDimensionSizes !----------------------------------------------------------------------- subroutine ParametersFromNetCDF(filename, is_host_file, fates_params) - use shr_kind_mod, only: r8 => shr_kind_r8 use abortutils, only : endrun use fileutils , only : getfil use ncdio_pio , only : file_desc_t, ncd_pio_closefile, ncd_pio_openfile From 60efa371be6e3993dda50cd60eeccb0aa035a6d3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 23 Mar 2020 15:17:05 -0600 Subject: [PATCH 614/730] Squashed 'manage_externals/' changes from fc5acdab..fde04e4d fde04e4d Merge pull request #138 from billsacks/add_python38_tests 37e4c4a5 Do not update dictionary in-place in loop 7e8474bb Remove testing on mac os 7f41c563 Fix pylint issue 3065b0d6 Add travis-ci tests with python3.7 and python3.8 34fbf556 Add support for git sparse checkout 6c6ef9fe Fix pylint errors 6a659ad3 Added test for sparse checkout and updated documentation 14432439 Support for git sparsecheckout via read-tree. a48558d8 Merge pull request #119 from gold2718/submodules f72ffe7f Do not try git submodule update if no .gitmodules file (git bug) 804e0afb Fix a pylint error 45aef95e Addressed review concerns 7da50314 New capability to use git submodule information to checkout externals 1926530f Merge pull request #118 from mnlevy1981/svn_switch b1b028d9 Updates after testing 9ea73e66 Add --svn-ignore-ancestry argument git-subtree-dir: manage_externals git-subtree-split: fde04e4d9a758b3aa277aa5fa44a59f5153f2958 --- .CTSMTrunkChecklist | 58 - .config_files.xml | 31 - .../.dir_locals.el => .dir_locals.el | 0 .../.github => .github}/ISSUE_TEMPLATE.md | 0 .github/ISSUE_TEMPLATE/01_bug_report.md | 29 - .github/ISSUE_TEMPLATE/02_support_needed.md | 36 - .../ISSUE_TEMPLATE/03_science_discussion.md | 7 - .github/ISSUE_TEMPLATE/04_other.md | 7 - .github/PULL_REQUEST_TEMPLATE.md | 27 +- .gitignore | 99 +- .travis.yml | 19 + CODE_OF_CONDUCT.md | 49 - CONTRIBUTING.md | 48 - Copyright | 75 - Externals.cfg | 38 - Externals_CLM.cfg | 17 - LICENSE | 34 - manage_externals/LICENSE.txt => LICENSE.txt | 0 README | 162 - manage_externals/README.md => README.md | 17 +- README.rst | 31 - README_EXTERNALS.rst | 124 - manage_externals/README_FIRST => README_FIRST | 0 bld/CLMBuildNamelist.pm | 4505 -- bld/README | 73 - bld/build-namelist | 23 - bld/config_files/clm_phys_vers.pm | 198 - bld/config_files/config_defaults.xml | 7 - .../config_defaults_1x1_mexicocityMEX.xml | 9 - .../config_defaults_1x1_numaIA.xml | 10 - .../config_defaults_1x1_smallvilleIA.xml | 10 - .../config_defaults_1x1_vancouverCAN.xml | 9 - bld/config_files/config_definition.xsl | 72 - bld/config_files/config_definition_clm4_0.xml | 115 - bld/config_files/config_definition_clm4_5.xml | 45 - bld/configure | 755 - bld/env_run.xml | 13 - bld/listDefaultNamelist.pl | 358 - bld/namelist_files/LogMessages.pm | 244 - bld/namelist_files/checkmapfiles.ncl | 236 - bld/namelist_files/createMapEntry.pl | 67 - bld/namelist_files/history_fields.xsl | 46 - bld/namelist_files/namelist_defaults.xsl | 177 - .../namelist_defaults_clm4_0.xml | 1069 - .../namelist_defaults_clm4_0_tools.xml | 9 - .../namelist_defaults_clm4_5.xml | 2453 - .../namelist_defaults_clm4_5_tools.xml | 633 - bld/namelist_files/namelist_defaults_drv.xml | 9 - .../namelist_defaults_drydep.xml | 30 - .../namelist_defaults_fire_emis.xml | 22 - .../namelist_defaults_overall.xml | 103 - .../namelist_defaults_usr_files.xml | 36 - bld/namelist_files/namelist_definition.xsl | 363 - .../namelist_definition_clm4_0.xml | 820 - .../namelist_definition_clm4_5.xml | 2456 - .../namelist_definition_drv.xml | 17 - .../namelist_definition_drv_flds.xml | 131 - .../use_cases/1850-2100_rcp2.6_transient.xml | 60 - .../use_cases/1850-2100_rcp4.5_transient.xml | 59 - .../use_cases/1850-2100_rcp6_transient.xml | 61 - .../use_cases/1850-2100_rcp8.5_transient.xml | 59 - bld/namelist_files/use_cases/1850_control.xml | 43 - .../use_cases/2000-2100_rcp8.5_transient.xml | 58 - bld/namelist_files/use_cases/2000_control.xml | 36 - .../use_cases/20thC_transient.xml | 52 - bld/namelist_files/use_cases/README | 39 - bld/namelist_files/use_cases/stdurbpt_pd.xml | 25 - bld/queryDefaultNamelist.pl | 319 - bld/queryDefaultXML.pm | 161 - bld/unit_testers/NMLTest/CompFiles.pm | 218 - bld/unit_testers/build-namelist_test.pl | 1420 - bld/unit_testers/myuser_nl_clm | 3 - .../xFail/expectedClmTestFails.xml | 58 - bld/unit_testers/xFail/expectedFail.pm | 668 - bld/unit_testers/xFail/wrapClmTests.pl | 128 - .../checkout_externals => checkout_externals | 0 cime_config/SystemTests/lii.py | 56 - cime_config/SystemTests/lii2finidatareas.py | 76 - cime_config/SystemTests/lvg.py | 37 - cime_config/SystemTests/ssp.py | 100 - cime_config/buildcpp | 52 - cime_config/buildlib | 117 - cime_config/buildnml | 272 - cime_config/config_component.xml | 235 - cime_config/config_compsets.xml | 408 - cime_config/config_pes.xml | 690 - cime_config/config_tests.xml | 68 - cime_config/testdefs/ExpectedTestFails.xml | 24 - cime_config/testdefs/testlist_clm.xml | 1921 - .../clm/40crop/include_user_mods | 1 - .../testmods_dirs/clm/40crop/user_nl_clm | 3 - .../clm/40default/shell_commands | 3 - .../testmods_dirs/clm/40default/user_nl_clm | 25 - .../testdefs/testmods_dirs/clm/40pts/README | 5 - .../testmods_dirs/clm/40pts/include_user_mods | 1 - .../testmods_dirs/clm/40pts/shell_commands | 24 - .../clm/40ptsRLA/include_user_mods | 1 - .../testmods_dirs/clm/40ptsRLA/shell_commands | 2 - .../clm/40ptsRLB/include_user_mods | 1 - .../testmods_dirs/clm/40ptsRLB/shell_commands | 2 - .../clm/40ptsROA/include_user_mods | 1 - .../testmods_dirs/clm/40ptsROA/shell_commands | 2 - .../clm/40reduceOutput/shell_commands | 4 - .../clm/40reduceOutput/user_nl_clm | 12 - .../clm/DA_multidrv/include_user_mods | 1 - .../clm/DA_multidrv/shell_commands | 6 - .../clm/DA_multidrv/user_nl_clm_0001 | 13 - .../clm/DA_multidrv/user_nl_clm_0002 | 13 - .../testmods_dirs/clm/Fates/shell_commands | 2 - .../testmods_dirs/clm/Fates/user_nl_clm | 11 - .../clm/FatesAllVars/include_user_mods | 1 - .../clm/FatesAllVars/shell_commands | 1 - .../clm/FatesAllVars/user_nl_clm | 31 - .../clm/FatesColdDef/include_user_mods | 1 - .../clm/FatesColdDef/shell_commands | 1 - .../clm/FatesColdDef/user_nl_clm | 6 - .../clm/FatesLogging/include_user_mods | 1 - .../clm/FatesLogging/user_nl_clm | 1 - .../clm/FatesNoFire/include_user_mods | 1 - .../testmods_dirs/clm/FatesNoFire/user_nl_clm | 1 - .../clm/FatesPPhys/include_user_mods | 1 - .../testmods_dirs/clm/FatesPPhys/user_nl_clm | 1 - .../clm/FatesST3/include_user_mods | 1 - .../testmods_dirs/clm/FatesST3/user_nl_clm | 1 - .../clm/FatesShortList/include_user_mods | 1 - .../clm/FatesShortList/user_nl_clm | 5 - .../clm/NoVSNoNI/include_user_mods | 1 - .../testmods_dirs/clm/NoVSNoNI/user_nl_clm | 4 - .../clm/SNICARFRC/include_user_mods | 1 - .../testmods_dirs/clm/SNICARFRC/user_nl_clm | 1 - .../testmods_dirs/clm/USUMB/shell_commands | 19 - .../testmods_dirs/clm/USUMB/user_nl_clm | 5 - .../clm/af_bias_v7/shell_commands | 3 - .../testmods_dirs/clm/af_bias_v7/user_nl_clm | 1 - .../testmods_dirs/clm/af_bias_v7/user_nl_datm | 1 - .../clm/allActive/include_user_mods | 1 - .../clm/allActive/shell_commands | 12 - .../testmods_dirs/clm/allActive/user_nl_clm | 15 - .../testmods_dirs/clm/ciso/include_user_mods | 1 - .../testmods_dirs/clm/ciso/user_nl_clm | 2 - .../clm/ciso_bombspike1963/include_user_mods | 1 - .../clm/ciso_bombspike1963/shell_commands | 1 - .../clm/ciso_bombspike1963/user_nl_clm | 6 - .../clm/ciso_decStart/include_user_mods | 2 - .../clm/ciso_flexCN_FUN/include_user_mods | 1 - .../clm/ciso_flexCN_FUN/user_nl_clm | 4 - .../clm/ciso_monthly/include_user_mods | 1 - .../clm/ciso_monthly/user_nl_clm | 2 - .../clm/ciso_rtmColdSSP/include_user_mods | 2 - .../clm/clm50CMIP6frc/include_user_mods | 1 - .../clm/clm50CMIP6frc/user_nl_clm | 3 - .../clm/clm50KSinkMOut/include_user_mods | 1 - .../clm/clm50KSinkMOut/user_nl_clm | 2 - .../clm/clm50KitchenSink/include_user_mods | 1 - .../clm/clm50KitchenSink/user_nl_clm | 6 - .../clm/clm50cropIrrigMonth_interp/README | 1 - .../include_user_mods | 1 - .../clm50cropIrrigMonth_interp/user_nl_clm | 6 - .../clm/clm50dynroots/include_user_mods | 1 - .../clm/clm50dynroots/user_nl_clm | 2 - .../testdefs/testmods_dirs/clm/cmip6/README | 6 - .../testmods_dirs/clm/cmip6/include_user_mods | 1 - .../testmods_dirs/clm/cmip6/shell_commands | 4 - .../clm/cn_conly/include_user_mods | 1 - .../testmods_dirs/clm/cn_conly/user_nl_clm | 1 - .../clm/compatible_finidat_f09/README | 23 - .../compatible_finidat_f09/include_user_mods | 1 - .../clm/compatible_finidat_f09/user_nl_clm | 1 - .../clm/cplhist/include_user_mods | 1 - .../testmods_dirs/clm/cplhist/shell_commands | 5 - .../testmods_dirs/clm/crop/include_user_mods | 1 - .../testmods_dirs/clm/crop/user_nl_clm | 8 - .../clm/cropColdStart/include_user_mods | 1 - .../clm/cropColdStart/shell_commands | 1 - .../clm/cropMonthOutput/include_user_mods | 1 - .../clm/cropMonthOutput/user_nl_clm | 2 - .../clm/decStart/include_user_mods | 1 - .../testmods_dirs/clm/decStart/shell_commands | 2 - .../testmods_dirs/clm/decStart/user_nl_cism | 9 - .../clm/decStart1851_noinitial/README | 8 - .../decStart1851_noinitial/include_user_mods | 1 - .../clm/decStart1851_noinitial/shell_commands | 2 - .../clm/deepsoil_bedrock/include_user_mods | 1 - .../clm/deepsoil_bedrock/user_nl_clm | 3 - .../testmods_dirs/clm/default/shell_commands | 5 - .../testmods_dirs/clm/default/user_nl_clm | 27 - .../clm/drydepnomegan/include_user_mods | 1 - .../clm/drydepnomegan/shell_commands | 1 - .../clm/fatesFire/include_user_mods | 1 - .../clm/fatesFire/shell_commands | 1 - .../testmods_dirs/clm/fatesFire/user_nl_clm | 2 - .../clm/fire_emis/include_user_mods | 1 - .../testmods_dirs/clm/fire_emis/user_nl_clm | 33 - .../clm/flexCN_FUN/include_user_mods | 1 - .../testmods_dirs/clm/flexCN_FUN/user_nl_clm | 4 - .../clm/glcMEC/include_user_mods | 1 - .../testmods_dirs/clm/glcMEC/user_nl_clm | 4 - .../clm/glcMEC_changeFlags/README | 4 - .../clm/glcMEC_changeFlags/include_user_mods | 1 - .../clm/glcMEC_changeFlags/shell_commands | 1 - .../clm/glcMEC_changeFlags/user_nl_clm | 1 - .../testmods_dirs/clm/glcMEC_decrease/README | 2 - .../clm/glcMEC_decrease/include_user_mods | 1 - .../clm/glcMEC_decrease/user_nl_cism | 6 - .../clm/glcMEC_decrease/user_nl_clm | 1 - .../testmods_dirs/clm/glcMEC_increase/README | 2 - .../clm/glcMEC_increase/include_user_mods | 1 - .../clm/glcMEC_increase/user_nl_cism | 4 - .../clm/glcMEC_increase/user_nl_clm | 1 - .../testmods_dirs/clm/glcMEC_long/README | 2 - .../clm/glcMEC_long/include_user_mods | 1 - .../testmods_dirs/clm/glcMEC_long/user_nl_clm | 2 - .../clm/glcMEC_spunup_1way/README | 34 - .../clm/glcMEC_spunup_1way/include_user_mods | 1 - .../clm/glcMEC_spunup_1way/shell_commands | 1 - .../clm/glcMEC_spunup_1way/user_nl_clm | 5 - .../clm/glcMEC_spunup_inc_dec_bgc/README | 12 - .../include_user_mods | 1 - .../glcMEC_spunup_inc_dec_bgc/user_nl_cism | 4 - .../clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm | 26 - .../irrigOn_reduceOutput/include_user_mods | 1 - .../clm/irrigOn_reduceOutput/shell_commands | 4 - .../clm/irrigOn_reduceOutput/user_nl_clm | 11 - .../clm/irrig_o3_reduceOutput/README | 3 - .../irrig_o3_reduceOutput/include_user_mods | 1 - .../clm/irrig_o3_reduceOutput/user_nl_clm | 6 - .../testmods_dirs/clm/irrig_spunup/README | 4 - .../clm/irrig_spunup/include_user_mods | 1 - .../clm/irrig_spunup/user_nl_clm | 6 - .../testmods_dirs/clm/luna/include_user_mods | 1 - .../testmods_dirs/clm/luna/user_nl_clm | 3 - .../clm/monthly/include_user_mods | 1 - .../testmods_dirs/clm/monthly/user_nl_clm | 5 - .../testmods_dirs/clm/monthly/user_nl_cpl | 1 - .../clm/monthly_noinitial/include_user_mods | 1 - .../clm/monthly_noinitial/shell_commands | 4 - .../clm/noFUN_flexCN/include_user_mods | 1 - .../clm/noFUN_flexCN/user_nl_clm | 3 - .../testmods_dirs/clm/no_vector_output/README | 2 - .../clm/no_vector_output/include_user_mods | 1 - .../clm/no_vector_output/user_nl_clm | 1 - .../testmods_dirs/clm/nofire/shell_commands | 5 - .../testmods_dirs/clm/nofire/user_nl_clm | 26 - .../testmods_dirs/clm/o3/include_user_mods | 1 - .../testdefs/testmods_dirs/clm/o3/user_nl_clm | 2 - .../testmods_dirs/clm/oldhyd/shell_commands | 2 - .../testmods_dirs/clm/oldhyd/user_nl_clm | 5 - .../clm/pauseResume/include_user_mods | 1 - .../clm/pauseResume/shell_commands | 4 - .../testdefs/testmods_dirs/clm/pts/README | 5 - .../testmods_dirs/clm/pts/include_user_mods | 1 - .../testmods_dirs/clm/pts/shell_commands | 24 - .../clm/ptsRLA/include_user_mods | 1 - .../testmods_dirs/clm/ptsRLA/shell_commands | 2 - .../clm/ptsRLB/include_user_mods | 1 - .../testmods_dirs/clm/ptsRLB/shell_commands | 2 - .../clm/ptsROA/include_user_mods | 1 - .../testmods_dirs/clm/ptsROA/shell_commands | 2 - .../rad_hrly_light_res_half/shell_commands | 2 - .../clm/rad_hrly_light_res_half/user_nl_datm | 1 - .../clm/reduceOutput/shell_commands | 8 - .../clm/reduceOutput/user_nl_clm | 12 - .../clm/reseedresetsnow/include_user_mods | 1 - .../clm/reseedresetsnow/user_nl_clm | 8 - .../clm/rootlit/include_user_mods | 1 - .../testmods_dirs/clm/rootlit/user_nl_clm | 3 - .../clm/rtmColdSSP/include_user_mods | 1 - .../testmods_dirs/clm/rtmColdSSP/user_nl_rtm | 4 - .../snowlayers_3_monthly/include_user_mods | 1 - .../clm/snowlayers_3_monthly/user_nl_clm | 4 - .../clm/vrtlay/include_user_mods | 1 - .../testmods_dirs/clm/vrtlay/user_nl_clm | 1 - cime_config/user_nl_clm | 22 - .../usermods_dirs/cmip6/include_user_mods | 2 - .../cmip6_evolving_icesheet/include_user_mods | 1 - .../cmip6_evolving_icesheet/user_nl_clm | 1 - .../usermods_dirs/cmip6_glaciers/user_nl_clm | 5 - cime_config/usermods_dirs/cmip6_output/README | 5 - .../usermods_dirs/cmip6_output/shell_commands | 4 - .../usermods_dirs/cmip6_output/user_nl_clm | 77 - .../usermods_dirs/cmip6_output/user_nl_cpl | 1 - doc/.ChangeLog_template | 136 - doc/.release-ChangeLog_template | 98 - doc/ChangeLog | 841 - doc/ChangeSum | 539 - doc/IMPORTANT_NOTES | 69 - doc/Quickstart.GUIDE | 60 - doc/UpdateChangelog.pl | 207 - doc/UsersGuide/Makefile | 193 - doc/UsersGuide/addco2_datm.buildnml.diff | 59 - doc/UsersGuide/adding_files.xml | 357 - doc/UsersGuide/addxhtmlhead.pl | 78 - doc/UsersGuide/appendix.xml | 305 - doc/UsersGuide/badpergro.jpg | Bin 40077 -> 0 bytes doc/UsersGuide/clm_stylesheet.dsl | 154 - doc/UsersGuide/clm_ug.xml | 191 - doc/UsersGuide/co2_streams.txt | 50 - doc/UsersGuide/custom.xml | 1615 - doc/UsersGuide/get_Icaselist.pl | 136 - doc/UsersGuide/limitLineLen.pl | 104 - doc/UsersGuide/modelnl/Makefile | 85 - doc/UsersGuide/modelnl/index.cpp | 45 - doc/UsersGuide/modelnl/showinfo.js | 193 - doc/UsersGuide/modelnl/xmldef2html_compsets | 162 - doc/UsersGuide/pergro.jpg | Bin 35642 -> 0 bytes doc/UsersGuide/preface.xml | 1419 - doc/UsersGuide/ptclm.xml | 992 - doc/UsersGuide/single_point.xml | 930 - doc/UsersGuide/special_cases.xml | 916 - doc/UsersGuide/stylesheethtml2docbook.xsl | 579 - doc/UsersGuide/tools.xml | 1396 - doc/UsersGuide/trouble_shooting.xml | 545 - doc/clm3_0_ChangeLog | 13104 ----- doc/clm4_0_ChangeLog | 16442 ------ doc/clm4_5_ChangeLog | 41442 ---------------- doc/clm5_0_ChangeLog | 1742 - doc/design/oo_design.rst | 17 - doc/release-clm5.0.ChangeLog | 767 - .../.github/PULL_REQUEST_TEMPLATE.md | 17 - manage_externals/.gitignore | 14 - manage_externals/.travis.yml | 32 - .../repos/simple-ext.git/refs/heads/master | 1 - {manage_externals/manic => manic}/__init__.py | 0 {manage_externals/manic => manic}/checkout.py | 24 +- .../manic => manic}/externals_description.py | 359 +- .../manic => manic}/externals_status.py | 0 .../manic => manic}/global_constants.py | 0 .../manic => manic}/repository.py | 20 +- .../manic => manic}/repository_factory.py | 4 +- .../manic => manic}/repository_git.py | 124 +- .../manic => manic}/repository_svn.py | 25 +- .../manic => manic}/sourcetree.py | 86 +- {manage_externals/manic => manic}/utils.py | 0 parse_cime.cs.status | 416 - src/CMakeLists.txt | 108 - src/README.unit_testing | 13 - src/biogeochem/CMakeLists.txt | 13 - src/biogeochem/CNAnnualUpdateMod.F90 | 113 - src/biogeochem/CNBalanceCheckMod.F90 | 358 - src/biogeochem/CNC14DecayMod.F90 | 159 - src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 | 319 - src/biogeochem/CNCIsoFluxMod.F90 | 1606 - src/biogeochem/CNCStateUpdate1Mod.F90 | 497 - src/biogeochem/CNCStateUpdate2Mod.F90 | 247 - src/biogeochem/CNCStateUpdate3Mod.F90 | 187 - src/biogeochem/CNDVDriverMod.F90 | 467 - src/biogeochem/CNDVEstablishmentMod.F90 | 451 - src/biogeochem/CNDVLightMod.F90 | 231 - src/biogeochem/CNDVType.F90 | 519 - src/biogeochem/CNDriverMod.F90 | 1057 - src/biogeochem/CNFUNMod.F90 | 1801 - src/biogeochem/CNFireBaseMod.F90 | 1260 - src/biogeochem/CNFireEmissionsMod.F90 | 377 - src/biogeochem/CNFireFactoryMod.F90 | 125 - src/biogeochem/CNFireLi2014Mod.F90 | 1268 - src/biogeochem/CNFireLi2016Mod.F90 | 657 - src/biogeochem/CNFireMethodMod.F90 | 191 - src/biogeochem/CNFireNoFireMod.F90 | 130 - src/biogeochem/CNGRespMod.F90 | 214 - src/biogeochem/CNGapMortalityMod.F90 | 493 - src/biogeochem/CNMRespMod.F90 | 298 - src/biogeochem/CNNDynamicsMod.F90 | 441 - src/biogeochem/CNNStateUpdate1Mod.F90 | 287 - src/biogeochem/CNNStateUpdate2Mod.F90 | 238 - src/biogeochem/CNNStateUpdate3Mod.F90 | 210 - src/biogeochem/CNPhenologyMod.F90 | 3014 -- src/biogeochem/CNPrecisionControlMod.F90 | 615 - src/biogeochem/CNProductsMod.F90 | 741 - src/biogeochem/CNRootDynMod.F90 | 277 - src/biogeochem/CNSharedParamsMod.F90 | 192 - src/biogeochem/CNSpeciesMod.F90 | 68 - src/biogeochem/CNVegCarbonFluxType.F90 | 4597 -- src/biogeochem/CNVegCarbonStateType.F90 | 2743 - src/biogeochem/CNVegComputeSeedMod.F90 | 259 - src/biogeochem/CNVegNitrogenFluxType.F90 | 1881 - src/biogeochem/CNVegNitrogenStateType.F90 | 1286 - src/biogeochem/CNVegStateType.F90 | 948 - src/biogeochem/CNVegStructUpdateMod.F90 | 307 - src/biogeochem/CNVegetationFacade.F90 | 1437 - src/biogeochem/CropType.F90 | 723 - src/biogeochem/DUSTMod.F90 | 925 - src/biogeochem/DryDepVelocity.F90 | 678 - src/biogeochem/EDBGCDynMod.F90 | 362 - src/biogeochem/FireEmisFactorsMod.F90 | 262 - src/biogeochem/MEGANFactorsMod.F90 | 307 - .../NutrientCompetitionCLM45defaultMod.F90 | 992 - .../NutrientCompetitionFactoryMod.F90 | 87 - .../NutrientCompetitionFlexibleCNMod.F90 | 1773 - .../NutrientCompetitionMethodMod.F90 | 202 - src/biogeochem/SatellitePhenologyMod.F90 | 684 - src/biogeochem/SpeciesBaseType.F90 | 67 - src/biogeochem/SpeciesIsotopeType.F90 | 136 - src/biogeochem/SpeciesNonIsotopeType.F90 | 125 - src/biogeochem/VOCEmissionMod.F90 | 1102 - src/biogeochem/ch4FInundatedStreamType.F90 | 393 - src/biogeochem/ch4Mod.F90 | 4197 -- src/biogeochem/ch4varcon.F90 | 192 - src/biogeochem/dynCNDVMod.F90 | 110 - src/biogeochem/dynConsBiogeochemMod.F90 | 886 - src/biogeochem/dynHarvestMod.F90 | 648 - src/biogeochem/test/CMakeLists.txt | 2 - .../test/CNVegComputeSeed_test/CMakeLists.txt | 7 - .../test_ComputeSeedAmounts.pf | 361 - .../test/Species_test/CMakeLists.txt | 8 - .../test/Species_test/test_SpeciesIsotope.pf | 95 - .../Species_test/test_SpeciesNonIsotope.pf | 83 - src/biogeophys/ActiveLayerMod.F90 | 155 - src/biogeophys/AerosolMod.F90 | 797 - src/biogeophys/BalanceCheckMod.F90 | 637 - src/biogeophys/BandDiagonalMod.F90 | 224 - src/biogeophys/BareGroundFluxesMod.F90 | 431 - src/biogeophys/CMakeLists.txt | 25 - src/biogeophys/CanopyFluxesMod.F90 | 1372 - src/biogeophys/CanopyHydrologyMod.F90 | 923 - src/biogeophys/CanopyStateType.F90 | 640 - src/biogeophys/CanopyTemperatureMod.F90 | 502 - src/biogeophys/DaylengthMod.F90 | 215 - src/biogeophys/EnergyFluxType.F90 | 1036 - src/biogeophys/FrictionVelocityMod.F90 | 834 - .../GlacierSurfaceMassBalanceMod.F90 | 452 - src/biogeophys/HumanIndexMod.F90 | 1354 - src/biogeophys/HydrologyDrainageMod.F90 | 225 - src/biogeophys/HydrologyNoDrainageMod.F90 | 574 - src/biogeophys/IrrigationMod.F90 | 1206 - src/biogeophys/LakeCon.F90 | 178 - src/biogeophys/LakeFluxesMod.F90 | 668 - src/biogeophys/LakeHydrologyMod.F90 | 684 - src/biogeophys/LakeStateType.F90 | 296 - src/biogeophys/LakeTemperatureMod.F90 | 1466 - src/biogeophys/LunaMod.F90 | 1358 - src/biogeophys/OzoneBaseMod.F90 | 146 - src/biogeophys/OzoneFactoryMod.F90 | 53 - src/biogeophys/OzoneMod.F90 | 543 - src/biogeophys/OzoneOffMod.F90 | 118 - src/biogeophys/PhotosynthesisMod.F90 | 4948 -- src/biogeophys/QSatMod.F90 | 167 - src/biogeophys/RootBiophysMod.F90 | 332 - src/biogeophys/SnowHydrologyMod.F90 | 2143 - src/biogeophys/SnowSnicarMod.F90 | 1480 - src/biogeophys/SoilFluxesMod.F90 | 461 - .../SoilHydrologyInitTimeConstMod.F90 | 568 - src/biogeophys/SoilHydrologyMod.F90 | 2337 - src/biogeophys/SoilHydrologyType.F90 | 338 - src/biogeophys/SoilMoistStressMod.F90 | 520 - src/biogeophys/SoilStateInitTimeConstMod.F90 | 630 - src/biogeophys/SoilStateType.F90 | 417 - src/biogeophys/SoilTemperatureMod.F90 | 4763 -- src/biogeophys/SoilWaterMovementMod.F90 | 2233 - src/biogeophys/SoilWaterPlantSinkMod.F90 | 444 - ...aterRetentionCurveClappHornberg1978Mod.F90 | 162 - .../SoilWaterRetentionCurveFactoryMod.F90 | 71 - src/biogeophys/SoilWaterRetentionCurveMod.F90 | 111 - ...WaterRetentionCurveVanGenuchten1980Mod.F90 | 162 - src/biogeophys/SolarAbsorbedType.F90 | 423 - src/biogeophys/SurfaceAlbedoMod.F90 | 1602 - src/biogeophys/SurfaceAlbedoType.F90 | 636 - src/biogeophys/SurfaceRadiationMod.F90 | 953 - src/biogeophys/SurfaceResistanceMod.F90 | 416 - src/biogeophys/TemperatureType.F90 | 1502 - src/biogeophys/TotalWaterAndHeatMod.F90 | 909 - src/biogeophys/TridiagonalMod.F90 | 118 - src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 938 - src/biogeophys/UrbanAlbedoMod.F90 | 1286 - src/biogeophys/UrbanFluxesMod.F90 | 1115 - src/biogeophys/UrbanParamsType.F90 | 961 - src/biogeophys/UrbanRadiationMod.F90 | 720 - src/biogeophys/UrbanTimeVarType.F90 | 310 - src/biogeophys/WaterStateType.F90 | 1137 - src/biogeophys/WaterfluxType.F90 | 736 - src/biogeophys/test/CMakeLists.txt | 5 - .../test/Daylength_test/CMakeLists.txt | 8 - .../test_compute_max_daylength.pf | 100 - .../test/Daylength_test/test_daylength.pf | 76 - .../test/HumanStress_test/CMakeLists.txt | 4 - .../test/HumanStress_test/test_humanstress.pf | 139 - .../test/Irrigation_test/CMakeLists.txt | 12 - src/biogeophys/test/Irrigation_test/README | 68 - .../test/Irrigation_test/test_irrigation.pf | 976 - .../test/SnowHydrology_test/CMakeLists.txt | 9 - src/biogeophys/test/SnowHydrology_test/README | 4 - .../test_SnowHydrology_SnowCappingExcess.pf | 230 - .../test_SnowHydrology_initSnowLayers.pf | 73 - .../test_SnowHydrology_newSnowBulkDensity.pf | 260 - .../TotalWaterAndHeat_test/CMakeLists.txt | 12 - .../test_total_water_and_heat.pf | 187 - src/cpl/clm_cpl_indices.F90 | 330 - src/cpl/lnd_comp_mct.F90 | 697 - src/cpl/lnd_import_export.F90 | 429 - src/dyn_subgrid/CMakeLists.txt | 26 - src/dyn_subgrid/dynColumnStateUpdaterMod.F90 | 951 - src/dyn_subgrid/dynColumnTemplateMod.F90 | 168 - src/dyn_subgrid/dynConsBiogeophysMod.F90 | 337 - src/dyn_subgrid/dynEDMod.F90 | 43 - src/dyn_subgrid/dynFileMod.F90 | 91 - src/dyn_subgrid/dynInitColumnsMod.F90 | 263 - src/dyn_subgrid/dynLandunitAreaMod.F90 | 166 - src/dyn_subgrid/dynPatchStateUpdaterMod.F90 | 455 - src/dyn_subgrid/dynPriorWeightsMod.F90 | 95 - src/dyn_subgrid/dynSubgridControlMod.F90 | 348 - src/dyn_subgrid/dynSubgridDriverMod.F90 | 347 - src/dyn_subgrid/dynTimeInfoMod.F90 | 375 - src/dyn_subgrid/dynVarMod.F90.in | 375 - src/dyn_subgrid/dynVarTimeInterpMod.F90.in | 219 - src/dyn_subgrid/dynVarTimeUninterpMod.F90.in | 181 - src/dyn_subgrid/dyncropFileMod.F90 | 201 - src/dyn_subgrid/dynpftFileMod.F90 | 295 - src/dyn_subgrid/test/CMakeLists.txt | 7 - .../dynColumnStateUpdater_test/CMakeLists.txt | 4 - .../test_column_state_updater.pf | 1213 - .../dynColumnTemplate_test/CMakeLists.txt | 4 - .../test_column_template.pf | 179 - .../test/dynInitColumns_test/CMakeLists.txt | 4 - .../dynInitColumns_test/test_init_columns.pf | 219 - .../test/dynLandunitArea_test/CMakeLists.txt | 9 - .../test_update_landunit_weights.pf | 147 - .../test_update_landunit_weights_one_gcell.pf | 135 - .../dynPatchStateUpdater_test/CMakeLists.txt | 4 - .../test_patch_state_updater.pf | 510 - .../test/dynTimeInfo_test/CMakeLists.txt | 4 - .../test/dynTimeInfo_test/test_dynTimeInfo.pf | 559 - .../test/dynVar_test/CMakeLists.txt | 12 - .../test/dynVar_test/test_dynVarShared.F90 | 49 - .../test/dynVar_test/test_dynVarTimeInterp.pf | 356 - .../dynVar_test/test_dynVarTimeUninterp.pf | 198 - src/init_interp/CMakeLists.txt | 14 - src/init_interp/initInterp.F90 | 1261 - src/init_interp/initInterp1dData.F90 | 126 - src/init_interp/initInterp2dvar.F90.in | 383 - src/init_interp/initInterpBounds.F90 | 198 - src/init_interp/initInterpMindist.F90 | 699 - src/init_interp/initInterpMultilevelBase.F90 | 91 - .../initInterpMultilevelContainer.F90 | 494 - src/init_interp/initInterpMultilevelCopy.F90 | 139 - .../initInterpMultilevelInterp.F90 | 599 - src/init_interp/initInterpMultilevelSnow.F90 | 227 - src/init_interp/initInterpMultilevelSplit.F90 | 209 - src/init_interp/initInterpUtils.F90 | 112 - src/init_interp/test/CMakeLists.txt | 3 - .../initInterpMindist_test/CMakeLists.txt | 9 - .../initInterpMindistTestUtils.pf | 136 - .../test_set_mindist.pf | 849 - .../test_set_single_match.pf | 359 - .../initInterpMultilevel_test/CMakeLists.txt | 14 - .../initInterpMultilevelMock.pf | 112 - .../multilevel_interp_factory.F90 | 179 - .../test_init_interp_multilevel_interp.pf | 352 - .../test_init_interp_multilevel_snow.pf | 172 - .../test_init_interp_multilevel_split.pf | 140 - .../test/initInterpUtils_test/CMakeLists.txt | 7 - .../test_glc_elevclasses_are_same.pf | 103 - src/main/CMakeLists.txt | 35 - src/main/ColumnType.F90 | 208 - src/main/FuncPedotransferMod.F90 | 141 - src/main/GetGlobalValuesMod.F90 | 153 - src/main/GridcellType.F90 | 106 - src/main/LandunitType.F90 | 140 - src/main/PatchType.F90 | 207 - src/main/TopoMod.F90 | 321 - src/main/abortutils.F90 | 95 - src/main/accumulMod.F90 | 827 - src/main/atm2lndMod.F90 | 682 - src/main/atm2lndType.F90 | 1304 - src/main/clm_driver.F90 | 1446 - src/main/clm_initializeMod.F90 | 691 - src/main/clm_instMod.F90 | 553 - src/main/clm_varcon.F90 | 304 - src/main/clm_varctl.F90 | 394 - src/main/clm_varpar.F90 | 215 - src/main/clm_varsur.F90 | 45 - src/main/column_varcon.F90 | 171 - src/main/controlMod.F90 | 1019 - src/main/decompInitMod.F90 | 888 - src/main/decompMod.F90 | 483 - src/main/dtypes.h | 6 - src/main/filterColMod.F90 | 444 - src/main/filterMod.F90 | 584 - src/main/findHistFields.pl | 546 - src/main/glc2lndMod.F90 | 674 - src/main/glcBehaviorMod.F90 | 1077 - src/main/histFileMod.F90 | 5201 -- src/main/initGridCellsMod.F90 | 600 - src/main/initSubgridMod.F90 | 475 - src/main/initVerticalMod.F90 | 795 - src/main/init_hydrology.F90 | 39 - src/main/landunit_varcon.F90 | 133 - src/main/lnd2atmMod.F90 | 491 - src/main/lnd2atmType.F90 | 329 - src/main/lnd2glcMod.F90 | 304 - src/main/ncdio_pio.F90.in | 2419 - src/main/ncdio_utils.F90 | 70 - src/main/ndepStreamMod.F90 | 353 - src/main/organicFileMod.F90 | 113 - src/main/paramUtilMod.F90 | 291 - src/main/pftconMod.F90 | 1381 - src/main/readParamsMod.F90 | 107 - src/main/restFileMod.F90 | 933 - src/main/reweightMod.F90 | 61 - src/main/subgridAveMod.F90 | 1347 - src/main/subgridMod.F90 | 564 - src/main/subgridRestMod.F90 | 733 - src/main/subgridWeightsMod.F90 | 872 - src/main/surfrdMod.F90 | 819 - src/main/surfrdUtilsMod.F90 | 243 - src/main/test/CMakeLists.txt | 9 - src/main/test/accumul_test/CMakeLists.txt | 7 - src/main/test/accumul_test/test_accumul.pf | 720 - src/main/test/atm2lnd_test/CMakeLists.txt | 9 - .../atm2lnd_test/test_downscale_forcings.pf | 460 - .../atm2lnd_test/test_partition_precip.pf | 271 - .../test_sens_heat_from_precip_conversion.pf | 43 - src/main/test/clm_glclnd_test/CMakeLists.txt | 4 - .../test/clm_glclnd_test/test_clm_glclnd.pf | 76 - src/main/test/filter_test/CMakeLists.txt | 4 - src/main/test/filter_test/test_filter_col.pf | 474 - src/main/test/glcBehavior_test/CMakeLists.txt | 4 - .../test/glcBehavior_test/test_glcBehavior.pf | 318 - src/main/test/ncdio_utils_test/CMakeLists.txt | 4 - .../test/ncdio_utils_test/test_ncdio_utils.pf | 131 - .../test/subgridWeights_test/CMakeLists.txt | 4 - .../test_subgridWeights.pf | 86 - src/main/test/surfrdUtils_test/CMakeLists.txt | 4 - .../test/surfrdUtils_test/test_surfrdUtils.pf | 217 - src/main/test/topo_test/CMakeLists.txt | 4 - src/main/test/topo_test/test_topo.pf | 389 - src/soilbiogeochem/CMakeLists.txt | 8 - .../SoilBiogeochemCarbonFluxType.F90 | 828 - .../SoilBiogeochemCarbonStateType.F90 | 1004 - .../SoilBiogeochemCompetitionMod.F90 | 948 - .../SoilBiogeochemDecompCascadeBGCMod.F90 | 1120 - .../SoilBiogeochemDecompCascadeCNMod.F90 | 952 - .../SoilBiogeochemDecompCascadeConType.F90 | 104 - .../SoilBiogeochemDecompMod.F90 | 277 - .../SoilBiogeochemLittVertTranspMod.F90 | 516 - .../SoilBiogeochemNLeachingMod.F90 | 289 - .../SoilBiogeochemNStateUpdate1Mod.F90 | 267 - .../SoilBiogeochemNitrifDenitrifMod.F90 | 469 - .../SoilBiogeochemNitrogenFluxType.F90 | 1279 - .../SoilBiogeochemNitrogenStateType.F90 | 1023 - .../SoilBiogeochemNitrogenUptakeMod.F90 | 81 - .../SoilBiogeochemPotentialMod.F90 | 266 - .../SoilBiogeochemPrecisionControlMod.F90 | 196 - .../SoilBiogeochemStateType.F90 | 336 - .../SoilBiogeochemVerticalProfileMod.F90 | 277 - .../test/ACSpinup_test/CMakeLists.txt | 4 - .../test/ACSpinup_test/test_acspinup.pf | 46 - src/soilbiogeochem/test/CMakeLists.txt | 1 - src/unit_test_shr/CMakeLists.txt | 20 - src/unit_test_shr/test/CMakeLists.txt | 3 - .../test/unittestArray_test/CMakeLists.txt | 4 - .../unittestArray_test/test_unittestArray.pf | 86 - .../unittestFilterBuilder_test/CMakeLists.txt | 4 - .../test_filterBuilder.pf | 46 - .../test/unittestSubgrid_test/CMakeLists.txt | 4 - .../test_unittestSubgrid.pf | 39 - src/unit_test_shr/unittestArrayMod.F90.in | 220 - .../unittestFilterBuilderMod.F90 | 71 - src/unit_test_shr/unittestGlcMec.F90 | 68 - .../unittestSimpleSubgridSetupsMod.F90 | 313 - src/unit_test_shr/unittestSubgridMod.F90 | 483 - src/unit_test_shr/unittestTimeManagerMod.F90 | 222 - src/unit_test_shr/unittestUtils.F90 | 33 - src/unit_test_stubs/CMakeLists.txt | 8 - src/unit_test_stubs/csm_share/CMakeLists.txt | 7 - .../csm_share/mct_mod_stub.F90 | 30 - .../csm_share/seq_comm_mct.F90 | 10 - .../csm_share/shr_mpi_mod_stub.F90 | 469 - .../dyn_subgrid/CMakeLists.txt | 5 - .../dyn_subgrid/dynFileMod_stub.F90 | 47 - src/unit_test_stubs/main/CMakeLists.txt | 20 - .../main/GetGlobalValuesMod_stub.F90 | 19 - src/unit_test_stubs/main/histFileMod_stub.F90 | 111 - src/unit_test_stubs/main/ncdio_dim.F90 | 58 - .../main/ncdio_pio_fake.F90.in | 822 - src/unit_test_stubs/main/ncdio_var.F90.in | 141 - src/unit_test_stubs/utils/CMakeLists.txt | 17 - .../utils/clmfates_paraminterfaceMod_stub.F90 | 11 - .../utils/restUtilMod_stub.F90.in | 150 - src/unit_test_stubs/utils/spmdMod_stub.F90 | 15 - src/utils/AnnualFluxDribbler.F90 | 615 - src/utils/CMakeLists.txt | 23 - src/utils/SimpleMathMod.F90 | 230 - src/utils/array_utils.F90.in | 99 - src/utils/clm_nlUtilsMod.F90 | 116 - src/utils/clm_time_manager.F90 | 1956 - src/utils/clm_varorb.F90 | 17 - src/utils/clmfates_interfaceMod.F90 | 2379 - src/utils/clmfates_paraminterfaceMod.F90 | 240 - src/utils/domainMod.F90 | 233 - src/utils/dtypes.h | 6 - src/utils/fileutils.F90 | 179 - src/utils/getdatetime.F90 | 53 - src/utils/quadraticMod.F90 | 76 - src/utils/restUtilMod.F90.in | 701 - src/utils/spmdGathScatMod.F90 | 540 - src/utils/spmdMod.F90 | 142 - src/utils/test/CMakeLists.txt | 3 - .../annual_flux_dribbler_test/CMakeLists.txt | 4 - .../test_annual_flux_dribbler.pf | 300 - .../test/clm_time_manager_test/CMakeLists.txt | 4 - .../test_clm_time_manager.pf | 223 - src/utils/test/quadratic_test/CMakeLists.txt | 4 - .../test/quadratic_test/test_quadratic.pf | 187 - src_clm40/biogeochem/C13SummaryMod.F90 | 820 - src_clm40/biogeochem/CNAllocationMod.F90 | 902 - src_clm40/biogeochem/CNAnnualUpdateMod.F90 | 195 - src_clm40/biogeochem/CNBalanceCheckMod.F90 | 396 - src_clm40/biogeochem/CNC13FluxMod.F90 | 1448 - src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 | 591 - src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 | 576 - src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 | 244 - src_clm40/biogeochem/CNCStateUpdate1Mod.F90 | 688 - src_clm40/biogeochem/CNCStateUpdate2Mod.F90 | 569 - src_clm40/biogeochem/CNCStateUpdate3Mod.F90 | 238 - .../biogeochem/CNDVEcosystemDynIniMod.F90 | 93 - src_clm40/biogeochem/CNDVEstablishmentMod.F90 | 518 - src_clm40/biogeochem/CNDVLightMod.F90 | 273 - src_clm40/biogeochem/CNDVMod.F90 | 558 - src_clm40/biogeochem/CNDecompMod.F90 | 674 - src_clm40/biogeochem/CNEcosystemDynMod.F90 | 259 - src_clm40/biogeochem/CNFireMod.F90 | 668 - src_clm40/biogeochem/CNGRespMod.F90 | 221 - src_clm40/biogeochem/CNGapMortalityMod.F90 | 717 - src_clm40/biogeochem/CNMRespMod.F90 | 180 - src_clm40/biogeochem/CNNDynamicsMod.F90 | 268 - src_clm40/biogeochem/CNNStateUpdate1Mod.F90 | 537 - src_clm40/biogeochem/CNNStateUpdate2Mod.F90 | 550 - src_clm40/biogeochem/CNNStateUpdate3Mod.F90 | 243 - src_clm40/biogeochem/CNPhenologyMod.F90 | 2750 - .../biogeochem/CNPrecisionControlMod.F90 | 737 - src_clm40/biogeochem/CNSetValueMod.F90 | 1280 - src_clm40/biogeochem/CNSummaryMod.F90 | 1402 - src_clm40/biogeochem/CNVegStructUpdateMod.F90 | 317 - src_clm40/biogeochem/CNWoodProductsMod.F90 | 138 - src_clm40/biogeochem/CNrestMod.F90 | 2339 - src_clm40/biogeochem/CropRestMod.F90 | 744 - src_clm40/biogeochem/DUSTMod.F90 | 900 - src_clm40/biogeochem/DryDepVelocity.F90 | 608 - src_clm40/biogeochem/MEGANFactorsMod.F90 | 319 - src_clm40/biogeochem/STATICEcosysDynMod.F90 | 549 - src_clm40/biogeochem/VOCEmissionMod.F90 | 1023 - src_clm40/biogeophys/BalanceCheckMod.F90 | 735 - src_clm40/biogeophys/BareGroundFluxesMod.F90 | 441 - src_clm40/biogeophys/BiogeophysRestMod.F90 | 2137 - src_clm40/biogeophys/Biogeophysics1Mod.F90 | 544 - src_clm40/biogeophys/Biogeophysics2Mod.F90 | 509 - src_clm40/biogeophys/BiogeophysicsLakeMod.F90 | 764 - src_clm40/biogeophys/CanopyFluxesMod.F90 | 1434 - src_clm40/biogeophys/FracWetMod.F90 | 115 - src_clm40/biogeophys/FrictionVelocityMod.F90 | 572 - src_clm40/biogeophys/Hydrology1Mod.F90 | 499 - src_clm40/biogeophys/Hydrology2Mod.F90 | 757 - src_clm40/biogeophys/HydrologyLakeMod.F90 | 322 - src_clm40/biogeophys/QSatMod.F90 | 149 - src_clm40/biogeophys/SNICARMod.F90 | 1494 - src_clm40/biogeophys/SnowHydrologyMod.F90 | 1650 - src_clm40/biogeophys/SoilHydrologyMod.F90 | 1243 - src_clm40/biogeophys/SoilTemperatureMod.F90 | 1225 - src_clm40/biogeophys/SurfaceAlbedoMod.F90 | 1045 - src_clm40/biogeophys/SurfaceRadiationMod.F90 | 801 - src_clm40/biogeophys/TridiagonalMod.F90 | 106 - src_clm40/biogeophys/UrbanInitMod.F90 | 477 - src_clm40/biogeophys/UrbanInputMod.F90 | 355 - src_clm40/biogeophys/UrbanMod.F90 | 3464 -- src_clm40/biogeophys/clm_driverInitMod.F90 | 247 - src_clm40/main/CMakeLists.txt | 6 - src_clm40/main/CNiniSpecial.F90 | 223 - src_clm40/main/CNiniTimeVar.F90 | 875 - src_clm40/main/GetGlobalValuesMod.F90 | 145 - src_clm40/main/SimpleMathMod.F90 | 226 - src_clm40/main/abortutils.F90 | 82 - src_clm40/main/accFldsMod.F90 | 1044 - src_clm40/main/accumulMod.F90 | 656 - src_clm40/main/clm_atmlnd.F90 | 551 - src_clm40/main/clm_cpl_indices.F90 | 311 - src_clm40/main/clm_driver.F90 | 903 - src_clm40/main/clm_glclnd.F90 | 242 - src_clm40/main/clm_initializeMod.F90 | 684 - src_clm40/main/clm_nlUtilsMod.F90 | 116 - src_clm40/main/clm_time_manager.F90 | 1625 - src_clm40/main/clm_varcon.F90 | 167 - src_clm40/main/clm_varctl.F90 | 318 - src_clm40/main/clm_varorb.F90 | 17 - src_clm40/main/clm_varpar.F90 | 118 - src_clm40/main/clm_varsur.F90 | 37 - src_clm40/main/clmtype.F90 | 1991 - src_clm40/main/clmtypeInitMod.F90 | 4116 -- src_clm40/main/controlMod.F90 | 556 - src_clm40/main/decompInitMod.F90 | 762 - src_clm40/main/decompMod.F90 | 359 - src_clm40/main/domainMod.F90 | 241 - src_clm40/main/dtypes.h | 6 - src_clm40/main/dynlandMod.F90 | 255 - src_clm40/main/fileutils.F90 | 179 - src_clm40/main/filterMod.F90 | 390 - src_clm40/main/findHistFields.pl | 265 - src_clm40/main/getdatetime.F90 | 53 - src_clm40/main/histFileMod.F90 | 4497 -- src_clm40/main/histFldsMod.F90 | 4599 -- src_clm40/main/iniTimeConst.F90 | 828 - src_clm40/main/initGridCellsMod.F90 | 1187 - src_clm40/main/initSurfAlbMod.F90 | 344 - src_clm40/main/lnd_comp_mct.F90 | 649 - src_clm40/main/lnd_import_export.F90 | 334 - src_clm40/main/mkarbinitMod.F90 | 762 - src_clm40/main/ncdio_pio.F90.in | 2285 - src_clm40/main/ndepStreamMod.F90 | 284 - src_clm40/main/organicFileMod.F90 | 113 - src_clm40/main/pft2colMod.F90 | 143 - src_clm40/main/pftdynMod.F90 | 3224 -- src_clm40/main/pftvarcon.F90 | 489 - src_clm40/main/quadraticMod.F90 | 57 - src_clm40/main/restFileMod.F90 | 729 - src_clm40/main/restUtilMod.F90 | 1319 - src_clm40/main/restUtilMod.F90.in | 426 - src_clm40/main/spmdGathScatMod.F90 | 537 - src_clm40/main/spmdMod.F90 | 142 - src_clm40/main/subgridAveMod.F90 | 1695 - src_clm40/main/subgridMod.F90 | 282 - src_clm40/main/subgridRestMod.F90 | 286 - src_clm40/main/surfrdMod.F90 | 1121 - {manage_externals/test => test}/.coveragerc | 0 {manage_externals/test => test}/.gitignore | 0 {manage_externals/test => test}/.pylint.rc | 0 {manage_externals/test => test}/Makefile | 0 {manage_externals/test => test}/README.md | 0 .../test => test}/doc/.gitignore | 0 {manage_externals/test => test}/doc/Makefile | 0 {manage_externals/test => test}/doc/conf.py | 0 .../test => test}/doc/develop.rst | 0 {manage_externals/test => test}/doc/index.rst | 0 .../test => test}/doc/testing.rst | 0 .../test => test}/repos/container.git/HEAD | 0 .../test => test}/repos/container.git/config | 0 .../repos/container.git/description | 0 .../repos/container.git/info/exclude | 0 .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin .../71/5b8f3e4afe1802a178e1d603af404ba45d59de | Bin .../b0/f87705e2b9601cb831878f3d51efa78b910d7b | Bin .../f9/e08370a737e941de6f6492e3f427c2ef4c1a03 | Bin .../repos/container.git/refs/heads/master | 0 .../test => test}/repos/error/readme.txt | 0 .../repos/mixed-cont-ext.git/HEAD | 0 .../repos/mixed-cont-ext.git/config | 0 .../repos/mixed-cont-ext.git/description | 0 .../repos/mixed-cont-ext.git/info/exclude | 0 .../00/437ac2000d5f06fb8a572a01a5bbdae98b17cb | Bin .../01/97458f2dbe5fcd6bc44fa46983be0a30282379 | Bin .../06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 | Bin .../14/368b701616a8c53820b610414a4b9a07540cf6 | 0 .../15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 | 0 .../1f/01fa46c17b1f38b37e6259f6e9d041bda3144f | Bin .../37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 | Bin .../38/9a2b876b8965d3c91a3db8d28a483eaf019d5c | Bin .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin .../6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 | Bin .../6f/c379457ecb4e576a13c7610ae1fa73f845ee6a | 0 .../93/a159deb9175bfeb2820a0006ddd92d78131332 | Bin .../95/80ecc12f16334ce44e42287d5d46f927bb7b75 | 0 .../a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd | Bin .../e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 | Bin .../fd/15a5ad5204356229c60a831d2a8120a43ac901 | 0 .../mixed-cont-ext.git/refs/heads/master | 0 .../mixed-cont-ext.git/refs/heads/new-feature | 0 .../repos/simple-ext-fork.git/HEAD | 0 .../repos/simple-ext-fork.git/config | 0 .../repos/simple-ext-fork.git/description | 0 .../repos/simple-ext-fork.git/info/exclude | 0 .../00/fd13e76189f9134b0506b4b8ed3172723b467f | Bin .../0b/15e8af3d4615b42314216efeae3fff184046a8 | Bin .../0b/67df4e7e8e6e1c6e401542738b352d18744677 | Bin .../11/a76e3d9a67313dec7ce1230852ab5c86352c5c | 0 .../16/5506a7408a482f50493434e13fffeb44af893f | Bin .../24/4386e788c9bc608613e127a329c742450a60e4 | Bin .../32/7e97d86e941047d809dba58f2804740c6c30cf | Bin .../36/418b4e5665956a90725c9a1b5a8e551c5f3d48 | Bin .../3d/7099c35404ae6c8640ce263b38bef06e98cc26 | 0 .../3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b | 0 .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin .../4d/837135915ed93eed6fff6b439f284ce317296f | Bin .../56/175e017ad38bf3d33d74b6bd7c74624b28466a | Bin .../5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae | Bin .../67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 | Bin .../7b/0bd630ac13865735a1dff3437a137d8ab50663 | Bin .../88/cf20868e0cc445f5642a480ed034c71e0d7e9f | 0 .../8d/2b3b35126224c975d23f109aa1e3cbac452989 | 0 .../9b/75494003deca69527bb64bcaa352e801611dd2 | Bin .../a2/2a5da9119328ea6d693f88861457c07e14ac04 | 0 .../a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 | 0 .../b9/3737be3ea6b19f6255983748a0a0f4d622f936 | Bin .../c5/32bc8fde96fa63103a52057f0baffcc9f00c6b | 0 .../c5/b315915742133dbdfbeed0753e481b55c1d364 | 0 .../f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca | 0 .../repos/simple-ext-fork.git/packed-refs | 0 .../simple-ext-fork.git/refs/heads/feature2 | 0 .../refs/tags/abandoned-feature | 0 .../refs/tags/forked-feature-v1 | 0 .../test => test}/repos/simple-ext.git/HEAD | 0 .../test => test}/repos/simple-ext.git/config | 0 .../repos/simple-ext.git/description | 0 .../repos/simple-ext.git/info/exclude | 0 .../00/fd13e76189f9134b0506b4b8ed3172723b467f | Bin .../09/0e1034746b2c865f7b0280813dbf4061a700e8 | Bin .../0b/15e8af3d4615b42314216efeae3fff184046a8 | Bin .../11/a76e3d9a67313dec7ce1230852ab5c86352c5c | 0 .../14/2711fdbbcb8034d7cad6bae6801887b12fe61d | Bin 0 -> 83 bytes .../31/dbcd6de441e671a467ef317146539b7ffabb11 | Bin .../36/418b4e5665956a90725c9a1b5a8e551c5f3d48 | Bin .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin .../60/7ec299c17dd285c029edc41a0109e49d441380 | Bin 0 -> 168 bytes .../60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5 | 0 .../63/a99393d1baff97ccef967af30380659867b139 | 0 .../95/3256da5612fcd9263590a353bc18c6f224e74f | 0 .../9b/75494003deca69527bb64bcaa352e801611dd2 | Bin .../a2/2a5da9119328ea6d693f88861457c07e14ac04 | 0 .../b7/692b6d391899680da7b9b6fd8af4c413f06fe7 | Bin 0 -> 137 bytes .../c5/b315915742133dbdfbeed0753e481b55c1d364 | 0 .../d1/163870d19c3dee34fada3a76b785cfa2a8424b | Bin 0 -> 130 bytes .../d8/ed2f33179d751937f8fde2e33921e4827babf4 | Bin 0 -> 60 bytes .../df/312890f93ba4d2c694208599b665c4a08afeff | Bin .../repos/simple-ext.git/refs/heads/feature2 | 0 .../repos/simple-ext.git/refs/heads/feature3 | 0 test/repos/simple-ext.git/refs/heads/master | 1 + .../repos/simple-ext.git/refs/tags/tag1 | 0 test/repos/simple-ext.git/refs/tags/tag2 | 1 + .../test => test}/requirements.txt | 0 .../test => test}/test_sys_checkout.py | 393 +- .../test => test}/test_sys_repository_git.py | 0 .../test_unit_externals_description.py | 12 +- .../test_unit_externals_status.py | 0 .../test => test}/test_unit_repository.py | 25 +- .../test => test}/test_unit_repository_git.py | 3 +- .../test => test}/test_unit_repository_svn.py | 0 .../test => test}/test_unit_utils.py | 0 test/tools/CLM_compare.sh | 39 - test/tools/Makefile | 12 - test/tools/README | 55 - test/tools/README.testnames | 55 - test/tools/TBLCFGtools.sh | 120 - test/tools/TBLscript_tools.sh | 148 - test/tools/TBLtools.sh | 119 - test/tools/TCBCFGtools.sh | 135 - test/tools/TCBscripttools.sh | 80 - test/tools/TCBtools.sh | 130 - test/tools/TOPtools.sh | 120 - test/tools/TSMCFGtools.sh | 113 - test/tools/TSMncl_tools.sh | 74 - test/tools/TSMscript_tools.sh | 114 - test/tools/TSMtools.sh | 117 - test/tools/config_files/CFGtools__ds | 0 test/tools/config_files/PTCLM__s | 1 - test/tools/config_files/README | 9 - test/tools/config_files/gen_domain | 0 test/tools/config_files/tools__do | 1 - test/tools/config_files/tools__ds | 1 - test/tools/config_files/tools__o | 1 - test/tools/config_files/tools__s | 1 - test/tools/gen_test_table.sh | 80 - test/tools/get_cprnc_diffs.sh | 56 - test/tools/input_tests_master | 54 - test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 | 1 - test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 | 1 - test/tools/nl_files/PTCLM_USUMB_clm4_5 | 1 - test/tools/nl_files/gen_domain.T31.runoptions | 1 - .../tools/nl_files/gen_domain.ne30.runoptions | 1 - test/tools/nl_files/getregional | 1 - test/tools/nl_files/getregional_05popd | 1 - test/tools/nl_files/getregional_T62 | 1 - test/tools/nl_files/getregional_ndep | 1 - test/tools/nl_files/mkmapdata_if10 | 1 - test/tools/nl_files/mkmapdata_ne30np4 | 1 - .../nl_files/mkprocdata_ne30_to_f19_I2000 | 1 - test/tools/nl_files/mksrfdt_10x15_1850 | 1 - .../nl_files/mksrfdt_10x15_crp_1850-2000 | 1 - test/tools/nl_files/mksrfdt_1x1_brazil_1850 | 1 - .../nl_files/mksrfdt_1x1_brazil_1850-2000 | 1 - .../nl_files/mksrfdt_1x1_numaIA_mp24_2000 | 1 - .../nl_files/mksrfdt_1x1_vancouverCAN_2000 | 1 - test/tools/nl_files/mksrfdt_T31_crpglc_2000 | 1 - test/tools/show_var_diffs.sh | 79 - test/tools/test_driver.sh | 572 - test/tools/tests_posttag_dav_mpi | 2 - test/tools/tests_posttag_hobart_nompi | 6 - test/tools/tests_posttag_nompi_regression | 20 - test/tools/tests_pretag_cheyenne_nompi | 15 - tools/README | 280 - tools/README.filecopies | 38 - tools/README.testing | 58 - tools/mkmapdata/README | 87 - tools/mkmapdata/createXMLEntries.pl | 116 - tools/mkmapdata/mkmapdata.sh | 539 - tools/mkmapdata/mknoocnmap.pl | 297 - tools/mkmapdata/mkunitymap.ncl | 160 - tools/mkmapdata/mvNimport.sh | 75 - tools/mkmapdata/regridbatch.sh | 80 - tools/mkmapdata/regridgeyser.sh | 87 - tools/mkmapdata/rmdups.ncl | 131 - tools/mkmapgrids/README | 22 - tools/mkmapgrids/mkscripgrid.ncl | 167 - tools/mkprocdata_map/README | 152 - tools/mkprocdata_map/README.filedescriptions | 25 - tools/mkprocdata_map/mkprocdata_map_all | 202 - .../mkprocdata_map_functions.bash | 57 - tools/mkprocdata_map/mkprocdata_map_wrap | 250 - tools/mkprocdata_map/src/Filepath | 1 - tools/mkprocdata_map/src/Makefile | 10 - tools/mkprocdata_map/src/Makefile.common | 360 - tools/mkprocdata_map/src/Mkdepends | 327 - tools/mkprocdata_map/src/Srcfiles | 8 - tools/mkprocdata_map/src/constMod.F90 | 11 - tools/mkprocdata_map/src/fileutils.F90 | 282 - tools/mkprocdata_map/src/fmain.F90 | 78 - tools/mkprocdata_map/src/gridmapMod.F90 | 289 - tools/mkprocdata_map/src/mkprocdata_map.F90 | 525 - tools/mkprocdata_map/src/nanMod.F90 | 41 - tools/mkprocdata_map/src/shr_file_mod.F90 | 164 - tools/mkprocdata_map/src/shr_kind_mod.F90 | 19 - tools/mksurfdata_map/Makefile.data | 267 - tools/mksurfdata_map/README | 70 - tools/mksurfdata_map/README.developers | 178 - ..._timeseries_hist_78pfts_simyr1850-2015.txt | 332 - tools/mksurfdata_map/mksurfdata.pl | 818 - tools/mksurfdata_map/mksurfdata_map.namelist | 54 - .../single_point_dynpft_files/README | 4 - ...imeseries_smallvilleIA_hist_simyr1850-1855 | 23 - ...eries_smallvilleIA_hist_simyr1850-1855.txt | 6 - tools/mksurfdata_map/src/CMakeLists.txt | 31 - tools/mksurfdata_map/src/Filepath | 1 - tools/mksurfdata_map/src/Makefile | 10 - tools/mksurfdata_map/src/Makefile.common | 360 - tools/mksurfdata_map/src/Mkdepends | 327 - tools/mksurfdata_map/src/README.unit_testing | 9 - tools/mksurfdata_map/src/Srcfiles | 40 - tools/mksurfdata_map/src/fileutils.F90 | 254 - .../mksurfdata_map/src/mkCH4inversionMod.F90 | 172 - tools/mksurfdata_map/src/mkVICparamsMod.F90 | 187 - .../mksurfdata_map/src/mkagfirepkmonthMod.F90 | 263 - tools/mksurfdata_map/src/mkchecksMod.F90 | 233 - tools/mksurfdata_map/src/mkdiagnosticsMod.F90 | 410 - tools/mksurfdata_map/src/mkdomainMod.F90 | 922 - tools/mksurfdata_map/src/mkfileMod.F90 | 555 - tools/mksurfdata_map/src/mkgdpMod.F90 | 134 - .../mksurfdata_map/src/mkglacierregionMod.F90 | 124 - tools/mksurfdata_map/src/mkglcmecMod.F90 | 778 - tools/mksurfdata_map/src/mkgridmapMod.F90 | 935 - tools/mksurfdata_map/src/mkharvestMod.F90 | 1098 - tools/mksurfdata_map/src/mkindexmapMod.F90 | 762 - tools/mksurfdata_map/src/mklaiMod.F90 | 444 - tools/mksurfdata_map/src/mklanwatMod.F90 | 509 - tools/mksurfdata_map/src/mkncdio.F90 | 558 - tools/mksurfdata_map/src/mkpctPftTypeMod.F90 | 626 - tools/mksurfdata_map/src/mkpeatMod.F90 | 136 - .../mksurfdata_map/src/mkpftConstantsMod.F90 | 43 - tools/mksurfdata_map/src/mkpftMod.F90 | 1086 - tools/mksurfdata_map/src/mkpftUtilsMod.F90 | 257 - tools/mksurfdata_map/src/mksoilMod.F90 | 1409 - tools/mksurfdata_map/src/mksoildepthMod.F90 | 159 - tools/mksurfdata_map/src/mksurfdat.F90 | 1586 - tools/mksurfdata_map/src/mktopostatsMod.F90 | 155 - .../src/mkurbanparCommonMod.F90 | 354 - tools/mksurfdata_map/src/mkurbanparMod.F90 | 749 - tools/mksurfdata_map/src/mkutilsMod.F90 | 197 - tools/mksurfdata_map/src/mkvarctl.F90 | 89 - tools/mksurfdata_map/src/mkvarpar.F90 | 33 - tools/mksurfdata_map/src/mkvocefMod.F90 | 218 - tools/mksurfdata_map/src/nanMod.F90 | 41 - tools/mksurfdata_map/src/shr_const_mod.F90 | 58 - tools/mksurfdata_map/src/shr_file_mod.F90 | 1023 - tools/mksurfdata_map/src/shr_kind_mod.F90 | 19 - tools/mksurfdata_map/src/shr_log_mod.F90 | 13 - tools/mksurfdata_map/src/shr_string_mod.F90 | 1753 - tools/mksurfdata_map/src/shr_sys_mod.F90 | 352 - tools/mksurfdata_map/src/shr_timer_mod.F90 | 425 - tools/mksurfdata_map/src/test/CMakeLists.txt | 4 - .../src/test/mkgridmap_test/CMakeLists.txt | 4 - .../src/test/mkgridmap_test/test_mkgridmap.pf | 114 - .../src/test/mkindexmap_test/CMakeLists.txt | 4 - .../test/mkindexmap_test/test_mkindexmap.pf | 251 - .../src/test/mkpctPftType_test/CMakeLists.txt | 4 - .../mkpctPftType_test/test_mkpctPftType.pf | 253 - .../src/test/mkpftUtils_test/CMakeLists.txt | 8 - .../test_adjust_total_veg_area.pf | 59 - .../mkpftUtils_test/test_convert_from_p2g.pf | 151 - .../src/unit_test_stubs/mkncdio.F90 | 167 - tools/mksurfdata_map/unit_testers/Filepath | 2 - tools/mksurfdata_map/unit_testers/Makefile | 10 - tools/mksurfdata_map/unit_testers/README | 6 - tools/mksurfdata_map/unit_testers/Srcfiles | 32 - .../unit_testers/test_mkchecksMod.F90 | 101 - .../unit_testers/test_mkdomainMod.F90 | 95 - .../unit_testers/test_mkgridmapMod.F90 | 664 - .../unit_testers/test_mkharvest.F90 | 316 - .../unit_testers/test_mkindexmapMod.F90 | 676 - .../unit_testers/test_mkncdio.F90 | 82 - .../unit_testers/test_mksurfdata_map.F90 | 54 - .../unit_testers/test_mkurbanparMod.F90 | 75 - .../unit_testers/test_mkutilsMod.F90 | 112 - .../mksurfdata_map/unit_testers/test_mod.F90 | 339 - tools/ncl_scripts/README | 23 - tools/ncl_scripts/README.getregional | 35 - tools/ncl_scripts/getco2_historical.ncl | 139 - tools/ncl_scripts/getregional_datasets.ncl | 268 - tools/ncl_scripts/getregional_datasets.pl | 375 - tools/ncl_scripts/sample_inlist | 18 - tools/ncl_scripts/sample_inlist_0.5popd | 22 - tools/ncl_scripts/sample_inlist_T62 | 23 - tools/ncl_scripts/sample_inlist_ndep | 22 - tools/ncl_scripts/sample_outlist | 14 - tools/ncl_scripts/sample_outlist_0.5popd | 14 - tools/ncl_scripts/sample_outlist_T62 | 16 - tools/ncl_scripts/sample_outlist_ndep | 15 - 1110 files changed, 1009 insertions(+), 413203 deletions(-) delete mode 100644 .CTSMTrunkChecklist delete mode 100644 .config_files.xml rename manage_externals/.dir_locals.el => .dir_locals.el (100%) rename {manage_externals/.github => .github}/ISSUE_TEMPLATE.md (100%) delete mode 100644 .github/ISSUE_TEMPLATE/01_bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/02_support_needed.md delete mode 100644 .github/ISSUE_TEMPLATE/03_science_discussion.md delete mode 100644 .github/ISSUE_TEMPLATE/04_other.md create mode 100644 .travis.yml delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 CONTRIBUTING.md delete mode 100644 Copyright delete mode 100644 Externals.cfg delete mode 100644 Externals_CLM.cfg delete mode 100644 LICENSE rename manage_externals/LICENSE.txt => LICENSE.txt (100%) delete mode 100644 README rename manage_externals/README.md => README.md (91%) delete mode 100644 README.rst delete mode 100644 README_EXTERNALS.rst rename manage_externals/README_FIRST => README_FIRST (100%) delete mode 100755 bld/CLMBuildNamelist.pm delete mode 100644 bld/README delete mode 100755 bld/build-namelist delete mode 100755 bld/config_files/clm_phys_vers.pm delete mode 100644 bld/config_files/config_defaults.xml delete mode 100644 bld/config_files/config_defaults_1x1_mexicocityMEX.xml delete mode 100644 bld/config_files/config_defaults_1x1_numaIA.xml delete mode 100644 bld/config_files/config_defaults_1x1_smallvilleIA.xml delete mode 100644 bld/config_files/config_defaults_1x1_vancouverCAN.xml delete mode 100644 bld/config_files/config_definition.xsl delete mode 100644 bld/config_files/config_definition_clm4_0.xml delete mode 100644 bld/config_files/config_definition_clm4_5.xml delete mode 100755 bld/configure delete mode 100644 bld/env_run.xml delete mode 100755 bld/listDefaultNamelist.pl delete mode 100755 bld/namelist_files/LogMessages.pm delete mode 100644 bld/namelist_files/checkmapfiles.ncl delete mode 100755 bld/namelist_files/createMapEntry.pl delete mode 100644 bld/namelist_files/history_fields.xsl delete mode 100644 bld/namelist_files/namelist_defaults.xsl delete mode 100644 bld/namelist_files/namelist_defaults_clm4_0.xml delete mode 100644 bld/namelist_files/namelist_defaults_clm4_0_tools.xml delete mode 100644 bld/namelist_files/namelist_defaults_clm4_5.xml delete mode 100644 bld/namelist_files/namelist_defaults_clm4_5_tools.xml delete mode 100644 bld/namelist_files/namelist_defaults_drv.xml delete mode 100644 bld/namelist_files/namelist_defaults_drydep.xml delete mode 100644 bld/namelist_files/namelist_defaults_fire_emis.xml delete mode 100644 bld/namelist_files/namelist_defaults_overall.xml delete mode 100644 bld/namelist_files/namelist_defaults_usr_files.xml delete mode 100644 bld/namelist_files/namelist_definition.xsl delete mode 100644 bld/namelist_files/namelist_definition_clm4_0.xml delete mode 100644 bld/namelist_files/namelist_definition_clm4_5.xml delete mode 100644 bld/namelist_files/namelist_definition_drv.xml delete mode 100644 bld/namelist_files/namelist_definition_drv_flds.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml delete mode 100644 bld/namelist_files/use_cases/1850_control.xml delete mode 100644 bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml delete mode 100644 bld/namelist_files/use_cases/2000_control.xml delete mode 100644 bld/namelist_files/use_cases/20thC_transient.xml delete mode 100644 bld/namelist_files/use_cases/README delete mode 100644 bld/namelist_files/use_cases/stdurbpt_pd.xml delete mode 100755 bld/queryDefaultNamelist.pl delete mode 100644 bld/queryDefaultXML.pm delete mode 100644 bld/unit_testers/NMLTest/CompFiles.pm delete mode 100755 bld/unit_testers/build-namelist_test.pl delete mode 100644 bld/unit_testers/myuser_nl_clm delete mode 100644 bld/unit_testers/xFail/expectedClmTestFails.xml delete mode 100755 bld/unit_testers/xFail/expectedFail.pm delete mode 100755 bld/unit_testers/xFail/wrapClmTests.pl rename manage_externals/checkout_externals => checkout_externals (100%) delete mode 100644 cime_config/SystemTests/lii.py delete mode 100644 cime_config/SystemTests/lii2finidatareas.py delete mode 100644 cime_config/SystemTests/lvg.py delete mode 100644 cime_config/SystemTests/ssp.py delete mode 100644 cime_config/buildcpp delete mode 100755 cime_config/buildlib delete mode 100755 cime_config/buildnml delete mode 100644 cime_config/config_component.xml delete mode 100644 cime_config/config_compsets.xml delete mode 100644 cime_config/config_pes.xml delete mode 100644 cime_config/config_tests.xml delete mode 100644 cime_config/testdefs/ExpectedTestFails.xml delete mode 100644 cime_config/testdefs/testlist_clm.xml delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40crop/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40crop/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40default/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40default/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40pts/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40pts/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40pts/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsRLA/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsRLB/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsROA/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40reduceOutput/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/40reduceOutput/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/DA_multidrv/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 delete mode 100644 cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 delete mode 100644 cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/SNICARFRC/user_nl_clm delete mode 100755 cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/af_bias_v7/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_datm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/allActive/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/allActive/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_decStart/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_monthly/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_monthly/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_rtmColdSSP/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cn_conly/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cn_conly/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cplhist/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cropColdStart/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/cropColdStart/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/decStart/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism delete mode 100644 cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/default/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/drydepnomegan/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/drydepnomegan/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fire_emis/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_long/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_long/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_cism delete mode 100644 cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_spunup/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_spunup/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/luna/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/monthly/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_cpl delete mode 100644 cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/include_user_mods delete mode 100755 cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/no_vector_output/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/no_vector_output/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/no_vector_output/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/oldhyd/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/pts/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/pts/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsRLA/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsRLB/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsROA/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/user_nl_datm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/reduceOutput/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/vrtlay/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm delete mode 100644 cime_config/user_nl_clm delete mode 100644 cime_config/usermods_dirs/cmip6/include_user_mods delete mode 100644 cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods delete mode 100644 cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm delete mode 100644 cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm delete mode 100644 cime_config/usermods_dirs/cmip6_output/README delete mode 100644 cime_config/usermods_dirs/cmip6_output/shell_commands delete mode 100644 cime_config/usermods_dirs/cmip6_output/user_nl_clm delete mode 100644 cime_config/usermods_dirs/cmip6_output/user_nl_cpl delete mode 100644 doc/.ChangeLog_template delete mode 100644 doc/.release-ChangeLog_template delete mode 100644 doc/ChangeLog delete mode 100644 doc/ChangeSum delete mode 100644 doc/IMPORTANT_NOTES delete mode 100644 doc/Quickstart.GUIDE delete mode 100755 doc/UpdateChangelog.pl delete mode 100644 doc/UsersGuide/Makefile delete mode 100644 doc/UsersGuide/addco2_datm.buildnml.diff delete mode 100644 doc/UsersGuide/adding_files.xml delete mode 100755 doc/UsersGuide/addxhtmlhead.pl delete mode 100644 doc/UsersGuide/appendix.xml delete mode 100644 doc/UsersGuide/badpergro.jpg delete mode 100644 doc/UsersGuide/clm_stylesheet.dsl delete mode 100644 doc/UsersGuide/clm_ug.xml delete mode 100644 doc/UsersGuide/co2_streams.txt delete mode 100644 doc/UsersGuide/custom.xml delete mode 100755 doc/UsersGuide/get_Icaselist.pl delete mode 100755 doc/UsersGuide/limitLineLen.pl delete mode 100644 doc/UsersGuide/modelnl/Makefile delete mode 100644 doc/UsersGuide/modelnl/index.cpp delete mode 100644 doc/UsersGuide/modelnl/showinfo.js delete mode 100755 doc/UsersGuide/modelnl/xmldef2html_compsets delete mode 100644 doc/UsersGuide/pergro.jpg delete mode 100644 doc/UsersGuide/preface.xml delete mode 100644 doc/UsersGuide/ptclm.xml delete mode 100644 doc/UsersGuide/single_point.xml delete mode 100644 doc/UsersGuide/special_cases.xml delete mode 100644 doc/UsersGuide/stylesheethtml2docbook.xsl delete mode 100644 doc/UsersGuide/tools.xml delete mode 100644 doc/UsersGuide/trouble_shooting.xml delete mode 100644 doc/clm3_0_ChangeLog delete mode 100644 doc/clm4_0_ChangeLog delete mode 100644 doc/clm4_5_ChangeLog delete mode 100644 doc/clm5_0_ChangeLog delete mode 100644 doc/design/oo_design.rst delete mode 100644 doc/release-clm5.0.ChangeLog delete mode 100644 manage_externals/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 manage_externals/.gitignore delete mode 100644 manage_externals/.travis.yml delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/heads/master rename {manage_externals/manic => manic}/__init__.py (100%) rename {manage_externals/manic => manic}/checkout.py (91%) rename {manage_externals/manic => manic}/externals_description.py (56%) rename {manage_externals/manic => manic}/externals_status.py (100%) rename {manage_externals/manic => manic}/global_constants.py (100%) rename {manage_externals/manic => manic}/repository.py (78%) rename {manage_externals/manic => manic}/repository_factory.py (83%) rename {manage_externals/manic => manic}/repository_git.py (85%) rename {manage_externals/manic => manic}/repository_svn.py (92%) rename {manage_externals/manic => manic}/sourcetree.py (80%) rename {manage_externals/manic => manic}/utils.py (100%) delete mode 100755 parse_cime.cs.status delete mode 100644 src/CMakeLists.txt delete mode 100644 src/README.unit_testing delete mode 100644 src/biogeochem/CMakeLists.txt delete mode 100644 src/biogeochem/CNAnnualUpdateMod.F90 delete mode 100644 src/biogeochem/CNBalanceCheckMod.F90 delete mode 100644 src/biogeochem/CNC14DecayMod.F90 delete mode 100644 src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 delete mode 100644 src/biogeochem/CNCIsoFluxMod.F90 delete mode 100644 src/biogeochem/CNCStateUpdate1Mod.F90 delete mode 100644 src/biogeochem/CNCStateUpdate2Mod.F90 delete mode 100644 src/biogeochem/CNCStateUpdate3Mod.F90 delete mode 100644 src/biogeochem/CNDVDriverMod.F90 delete mode 100644 src/biogeochem/CNDVEstablishmentMod.F90 delete mode 100644 src/biogeochem/CNDVLightMod.F90 delete mode 100644 src/biogeochem/CNDVType.F90 delete mode 100644 src/biogeochem/CNDriverMod.F90 delete mode 100644 src/biogeochem/CNFUNMod.F90 delete mode 100644 src/biogeochem/CNFireBaseMod.F90 delete mode 100644 src/biogeochem/CNFireEmissionsMod.F90 delete mode 100644 src/biogeochem/CNFireFactoryMod.F90 delete mode 100644 src/biogeochem/CNFireLi2014Mod.F90 delete mode 100644 src/biogeochem/CNFireLi2016Mod.F90 delete mode 100644 src/biogeochem/CNFireMethodMod.F90 delete mode 100644 src/biogeochem/CNFireNoFireMod.F90 delete mode 100644 src/biogeochem/CNGRespMod.F90 delete mode 100644 src/biogeochem/CNGapMortalityMod.F90 delete mode 100644 src/biogeochem/CNMRespMod.F90 delete mode 100644 src/biogeochem/CNNDynamicsMod.F90 delete mode 100644 src/biogeochem/CNNStateUpdate1Mod.F90 delete mode 100644 src/biogeochem/CNNStateUpdate2Mod.F90 delete mode 100644 src/biogeochem/CNNStateUpdate3Mod.F90 delete mode 100644 src/biogeochem/CNPhenologyMod.F90 delete mode 100644 src/biogeochem/CNPrecisionControlMod.F90 delete mode 100644 src/biogeochem/CNProductsMod.F90 delete mode 100644 src/biogeochem/CNRootDynMod.F90 delete mode 100644 src/biogeochem/CNSharedParamsMod.F90 delete mode 100644 src/biogeochem/CNSpeciesMod.F90 delete mode 100644 src/biogeochem/CNVegCarbonFluxType.F90 delete mode 100644 src/biogeochem/CNVegCarbonStateType.F90 delete mode 100644 src/biogeochem/CNVegComputeSeedMod.F90 delete mode 100644 src/biogeochem/CNVegNitrogenFluxType.F90 delete mode 100644 src/biogeochem/CNVegNitrogenStateType.F90 delete mode 100644 src/biogeochem/CNVegStateType.F90 delete mode 100644 src/biogeochem/CNVegStructUpdateMod.F90 delete mode 100644 src/biogeochem/CNVegetationFacade.F90 delete mode 100644 src/biogeochem/CropType.F90 delete mode 100644 src/biogeochem/DUSTMod.F90 delete mode 100644 src/biogeochem/DryDepVelocity.F90 delete mode 100644 src/biogeochem/EDBGCDynMod.F90 delete mode 100644 src/biogeochem/FireEmisFactorsMod.F90 delete mode 100644 src/biogeochem/MEGANFactorsMod.F90 delete mode 100644 src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 delete mode 100644 src/biogeochem/NutrientCompetitionFactoryMod.F90 delete mode 100644 src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 delete mode 100644 src/biogeochem/NutrientCompetitionMethodMod.F90 delete mode 100644 src/biogeochem/SatellitePhenologyMod.F90 delete mode 100644 src/biogeochem/SpeciesBaseType.F90 delete mode 100644 src/biogeochem/SpeciesIsotopeType.F90 delete mode 100644 src/biogeochem/SpeciesNonIsotopeType.F90 delete mode 100644 src/biogeochem/VOCEmissionMod.F90 delete mode 100644 src/biogeochem/ch4FInundatedStreamType.F90 delete mode 100644 src/biogeochem/ch4Mod.F90 delete mode 100644 src/biogeochem/ch4varcon.F90 delete mode 100644 src/biogeochem/dynCNDVMod.F90 delete mode 100644 src/biogeochem/dynConsBiogeochemMod.F90 delete mode 100644 src/biogeochem/dynHarvestMod.F90 delete mode 100644 src/biogeochem/test/CMakeLists.txt delete mode 100644 src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt delete mode 100644 src/biogeochem/test/CNVegComputeSeed_test/test_ComputeSeedAmounts.pf delete mode 100644 src/biogeochem/test/Species_test/CMakeLists.txt delete mode 100644 src/biogeochem/test/Species_test/test_SpeciesIsotope.pf delete mode 100644 src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf delete mode 100644 src/biogeophys/ActiveLayerMod.F90 delete mode 100644 src/biogeophys/AerosolMod.F90 delete mode 100644 src/biogeophys/BalanceCheckMod.F90 delete mode 100644 src/biogeophys/BandDiagonalMod.F90 delete mode 100644 src/biogeophys/BareGroundFluxesMod.F90 delete mode 100644 src/biogeophys/CMakeLists.txt delete mode 100644 src/biogeophys/CanopyFluxesMod.F90 delete mode 100644 src/biogeophys/CanopyHydrologyMod.F90 delete mode 100644 src/biogeophys/CanopyStateType.F90 delete mode 100644 src/biogeophys/CanopyTemperatureMod.F90 delete mode 100644 src/biogeophys/DaylengthMod.F90 delete mode 100644 src/biogeophys/EnergyFluxType.F90 delete mode 100644 src/biogeophys/FrictionVelocityMod.F90 delete mode 100644 src/biogeophys/GlacierSurfaceMassBalanceMod.F90 delete mode 100644 src/biogeophys/HumanIndexMod.F90 delete mode 100644 src/biogeophys/HydrologyDrainageMod.F90 delete mode 100644 src/biogeophys/HydrologyNoDrainageMod.F90 delete mode 100644 src/biogeophys/IrrigationMod.F90 delete mode 100644 src/biogeophys/LakeCon.F90 delete mode 100644 src/biogeophys/LakeFluxesMod.F90 delete mode 100644 src/biogeophys/LakeHydrologyMod.F90 delete mode 100644 src/biogeophys/LakeStateType.F90 delete mode 100644 src/biogeophys/LakeTemperatureMod.F90 delete mode 100644 src/biogeophys/LunaMod.F90 delete mode 100644 src/biogeophys/OzoneBaseMod.F90 delete mode 100644 src/biogeophys/OzoneFactoryMod.F90 delete mode 100644 src/biogeophys/OzoneMod.F90 delete mode 100644 src/biogeophys/OzoneOffMod.F90 delete mode 100644 src/biogeophys/PhotosynthesisMod.F90 delete mode 100644 src/biogeophys/QSatMod.F90 delete mode 100644 src/biogeophys/RootBiophysMod.F90 delete mode 100644 src/biogeophys/SnowHydrologyMod.F90 delete mode 100644 src/biogeophys/SnowSnicarMod.F90 delete mode 100644 src/biogeophys/SoilFluxesMod.F90 delete mode 100644 src/biogeophys/SoilHydrologyInitTimeConstMod.F90 delete mode 100644 src/biogeophys/SoilHydrologyMod.F90 delete mode 100644 src/biogeophys/SoilHydrologyType.F90 delete mode 100644 src/biogeophys/SoilMoistStressMod.F90 delete mode 100644 src/biogeophys/SoilStateInitTimeConstMod.F90 delete mode 100644 src/biogeophys/SoilStateType.F90 delete mode 100644 src/biogeophys/SoilTemperatureMod.F90 delete mode 100644 src/biogeophys/SoilWaterMovementMod.F90 delete mode 100644 src/biogeophys/SoilWaterPlantSinkMod.F90 delete mode 100644 src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 delete mode 100644 src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 delete mode 100644 src/biogeophys/SoilWaterRetentionCurveMod.F90 delete mode 100644 src/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90 delete mode 100644 src/biogeophys/SolarAbsorbedType.F90 delete mode 100644 src/biogeophys/SurfaceAlbedoMod.F90 delete mode 100644 src/biogeophys/SurfaceAlbedoType.F90 delete mode 100644 src/biogeophys/SurfaceRadiationMod.F90 delete mode 100644 src/biogeophys/SurfaceResistanceMod.F90 delete mode 100644 src/biogeophys/TemperatureType.F90 delete mode 100644 src/biogeophys/TotalWaterAndHeatMod.F90 delete mode 100644 src/biogeophys/TridiagonalMod.F90 delete mode 100644 src/biogeophys/UrbBuildTempOleson2015Mod.F90 delete mode 100644 src/biogeophys/UrbanAlbedoMod.F90 delete mode 100644 src/biogeophys/UrbanFluxesMod.F90 delete mode 100644 src/biogeophys/UrbanParamsType.F90 delete mode 100644 src/biogeophys/UrbanRadiationMod.F90 delete mode 100644 src/biogeophys/UrbanTimeVarType.F90 delete mode 100644 src/biogeophys/WaterStateType.F90 delete mode 100644 src/biogeophys/WaterfluxType.F90 delete mode 100644 src/biogeophys/test/CMakeLists.txt delete mode 100644 src/biogeophys/test/Daylength_test/CMakeLists.txt delete mode 100644 src/biogeophys/test/Daylength_test/test_compute_max_daylength.pf delete mode 100644 src/biogeophys/test/Daylength_test/test_daylength.pf delete mode 100644 src/biogeophys/test/HumanStress_test/CMakeLists.txt delete mode 100644 src/biogeophys/test/HumanStress_test/test_humanstress.pf delete mode 100644 src/biogeophys/test/Irrigation_test/CMakeLists.txt delete mode 100644 src/biogeophys/test/Irrigation_test/README delete mode 100644 src/biogeophys/test/Irrigation_test/test_irrigation.pf delete mode 100644 src/biogeophys/test/SnowHydrology_test/CMakeLists.txt delete mode 100644 src/biogeophys/test/SnowHydrology_test/README delete mode 100644 src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf delete mode 100644 src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_initSnowLayers.pf delete mode 100644 src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf delete mode 100644 src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt delete mode 100644 src/biogeophys/test/TotalWaterAndHeat_test/test_total_water_and_heat.pf delete mode 100644 src/cpl/clm_cpl_indices.F90 delete mode 100644 src/cpl/lnd_comp_mct.F90 delete mode 100644 src/cpl/lnd_import_export.F90 delete mode 100644 src/dyn_subgrid/CMakeLists.txt delete mode 100644 src/dyn_subgrid/dynColumnStateUpdaterMod.F90 delete mode 100644 src/dyn_subgrid/dynColumnTemplateMod.F90 delete mode 100644 src/dyn_subgrid/dynConsBiogeophysMod.F90 delete mode 100644 src/dyn_subgrid/dynEDMod.F90 delete mode 100644 src/dyn_subgrid/dynFileMod.F90 delete mode 100644 src/dyn_subgrid/dynInitColumnsMod.F90 delete mode 100644 src/dyn_subgrid/dynLandunitAreaMod.F90 delete mode 100644 src/dyn_subgrid/dynPatchStateUpdaterMod.F90 delete mode 100644 src/dyn_subgrid/dynPriorWeightsMod.F90 delete mode 100644 src/dyn_subgrid/dynSubgridControlMod.F90 delete mode 100644 src/dyn_subgrid/dynSubgridDriverMod.F90 delete mode 100644 src/dyn_subgrid/dynTimeInfoMod.F90 delete mode 100644 src/dyn_subgrid/dynVarMod.F90.in delete mode 100644 src/dyn_subgrid/dynVarTimeInterpMod.F90.in delete mode 100644 src/dyn_subgrid/dynVarTimeUninterpMod.F90.in delete mode 100644 src/dyn_subgrid/dyncropFileMod.F90 delete mode 100644 src/dyn_subgrid/dynpftFileMod.F90 delete mode 100644 src/dyn_subgrid/test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynColumnStateUpdater_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf delete mode 100644 src/dyn_subgrid/test/dynColumnTemplate_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynColumnTemplate_test/test_column_template.pf delete mode 100644 src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf delete mode 100644 src/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf delete mode 100644 src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf delete mode 100644 src/dyn_subgrid/test/dynPatchStateUpdater_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf delete mode 100644 src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf delete mode 100644 src/dyn_subgrid/test/dynVar_test/CMakeLists.txt delete mode 100644 src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 delete mode 100644 src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf delete mode 100644 src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf delete mode 100644 src/init_interp/CMakeLists.txt delete mode 100644 src/init_interp/initInterp.F90 delete mode 100644 src/init_interp/initInterp1dData.F90 delete mode 100644 src/init_interp/initInterp2dvar.F90.in delete mode 100644 src/init_interp/initInterpBounds.F90 delete mode 100644 src/init_interp/initInterpMindist.F90 delete mode 100644 src/init_interp/initInterpMultilevelBase.F90 delete mode 100644 src/init_interp/initInterpMultilevelContainer.F90 delete mode 100644 src/init_interp/initInterpMultilevelCopy.F90 delete mode 100644 src/init_interp/initInterpMultilevelInterp.F90 delete mode 100644 src/init_interp/initInterpMultilevelSnow.F90 delete mode 100644 src/init_interp/initInterpMultilevelSplit.F90 delete mode 100644 src/init_interp/initInterpUtils.F90 delete mode 100644 src/init_interp/test/CMakeLists.txt delete mode 100644 src/init_interp/test/initInterpMindist_test/CMakeLists.txt delete mode 100644 src/init_interp/test/initInterpMindist_test/initInterpMindistTestUtils.pf delete mode 100644 src/init_interp/test/initInterpMindist_test/test_set_mindist.pf delete mode 100644 src/init_interp/test/initInterpMindist_test/test_set_single_match.pf delete mode 100644 src/init_interp/test/initInterpMultilevel_test/CMakeLists.txt delete mode 100644 src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf delete mode 100644 src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 delete mode 100644 src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf delete mode 100644 src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf delete mode 100644 src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf delete mode 100644 src/init_interp/test/initInterpUtils_test/CMakeLists.txt delete mode 100644 src/init_interp/test/initInterpUtils_test/test_glc_elevclasses_are_same.pf delete mode 100644 src/main/CMakeLists.txt delete mode 100644 src/main/ColumnType.F90 delete mode 100644 src/main/FuncPedotransferMod.F90 delete mode 100644 src/main/GetGlobalValuesMod.F90 delete mode 100644 src/main/GridcellType.F90 delete mode 100644 src/main/LandunitType.F90 delete mode 100644 src/main/PatchType.F90 delete mode 100644 src/main/TopoMod.F90 delete mode 100644 src/main/abortutils.F90 delete mode 100644 src/main/accumulMod.F90 delete mode 100644 src/main/atm2lndMod.F90 delete mode 100644 src/main/atm2lndType.F90 delete mode 100644 src/main/clm_driver.F90 delete mode 100644 src/main/clm_initializeMod.F90 delete mode 100644 src/main/clm_instMod.F90 delete mode 100644 src/main/clm_varcon.F90 delete mode 100644 src/main/clm_varctl.F90 delete mode 100644 src/main/clm_varpar.F90 delete mode 100644 src/main/clm_varsur.F90 delete mode 100644 src/main/column_varcon.F90 delete mode 100644 src/main/controlMod.F90 delete mode 100644 src/main/decompInitMod.F90 delete mode 100644 src/main/decompMod.F90 delete mode 100644 src/main/dtypes.h delete mode 100644 src/main/filterColMod.F90 delete mode 100644 src/main/filterMod.F90 delete mode 100755 src/main/findHistFields.pl delete mode 100644 src/main/glc2lndMod.F90 delete mode 100644 src/main/glcBehaviorMod.F90 delete mode 100644 src/main/histFileMod.F90 delete mode 100644 src/main/initGridCellsMod.F90 delete mode 100644 src/main/initSubgridMod.F90 delete mode 100644 src/main/initVerticalMod.F90 delete mode 100644 src/main/init_hydrology.F90 delete mode 100644 src/main/landunit_varcon.F90 delete mode 100644 src/main/lnd2atmMod.F90 delete mode 100644 src/main/lnd2atmType.F90 delete mode 100644 src/main/lnd2glcMod.F90 delete mode 100644 src/main/ncdio_pio.F90.in delete mode 100644 src/main/ncdio_utils.F90 delete mode 100644 src/main/ndepStreamMod.F90 delete mode 100644 src/main/organicFileMod.F90 delete mode 100644 src/main/paramUtilMod.F90 delete mode 100644 src/main/pftconMod.F90 delete mode 100644 src/main/readParamsMod.F90 delete mode 100644 src/main/restFileMod.F90 delete mode 100644 src/main/reweightMod.F90 delete mode 100644 src/main/subgridAveMod.F90 delete mode 100644 src/main/subgridMod.F90 delete mode 100644 src/main/subgridRestMod.F90 delete mode 100644 src/main/subgridWeightsMod.F90 delete mode 100644 src/main/surfrdMod.F90 delete mode 100644 src/main/surfrdUtilsMod.F90 delete mode 100644 src/main/test/CMakeLists.txt delete mode 100644 src/main/test/accumul_test/CMakeLists.txt delete mode 100644 src/main/test/accumul_test/test_accumul.pf delete mode 100644 src/main/test/atm2lnd_test/CMakeLists.txt delete mode 100644 src/main/test/atm2lnd_test/test_downscale_forcings.pf delete mode 100644 src/main/test/atm2lnd_test/test_partition_precip.pf delete mode 100644 src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf delete mode 100644 src/main/test/clm_glclnd_test/CMakeLists.txt delete mode 100644 src/main/test/clm_glclnd_test/test_clm_glclnd.pf delete mode 100644 src/main/test/filter_test/CMakeLists.txt delete mode 100644 src/main/test/filter_test/test_filter_col.pf delete mode 100644 src/main/test/glcBehavior_test/CMakeLists.txt delete mode 100644 src/main/test/glcBehavior_test/test_glcBehavior.pf delete mode 100644 src/main/test/ncdio_utils_test/CMakeLists.txt delete mode 100644 src/main/test/ncdio_utils_test/test_ncdio_utils.pf delete mode 100644 src/main/test/subgridWeights_test/CMakeLists.txt delete mode 100644 src/main/test/subgridWeights_test/test_subgridWeights.pf delete mode 100644 src/main/test/surfrdUtils_test/CMakeLists.txt delete mode 100644 src/main/test/surfrdUtils_test/test_surfrdUtils.pf delete mode 100644 src/main/test/topo_test/CMakeLists.txt delete mode 100644 src/main/test/topo_test/test_topo.pf delete mode 100644 src/soilbiogeochem/CMakeLists.txt delete mode 100644 src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemDecompMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemStateType.F90 delete mode 100644 src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 delete mode 100644 src/soilbiogeochem/test/ACSpinup_test/CMakeLists.txt delete mode 100644 src/soilbiogeochem/test/ACSpinup_test/test_acspinup.pf delete mode 100644 src/soilbiogeochem/test/CMakeLists.txt delete mode 100644 src/unit_test_shr/CMakeLists.txt delete mode 100644 src/unit_test_shr/test/CMakeLists.txt delete mode 100644 src/unit_test_shr/test/unittestArray_test/CMakeLists.txt delete mode 100644 src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf delete mode 100644 src/unit_test_shr/test/unittestFilterBuilder_test/CMakeLists.txt delete mode 100644 src/unit_test_shr/test/unittestFilterBuilder_test/test_filterBuilder.pf delete mode 100644 src/unit_test_shr/test/unittestSubgrid_test/CMakeLists.txt delete mode 100644 src/unit_test_shr/test/unittestSubgrid_test/test_unittestSubgrid.pf delete mode 100644 src/unit_test_shr/unittestArrayMod.F90.in delete mode 100644 src/unit_test_shr/unittestFilterBuilderMod.F90 delete mode 100644 src/unit_test_shr/unittestGlcMec.F90 delete mode 100644 src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 delete mode 100644 src/unit_test_shr/unittestSubgridMod.F90 delete mode 100644 src/unit_test_shr/unittestTimeManagerMod.F90 delete mode 100644 src/unit_test_shr/unittestUtils.F90 delete mode 100644 src/unit_test_stubs/CMakeLists.txt delete mode 100644 src/unit_test_stubs/csm_share/CMakeLists.txt delete mode 100644 src/unit_test_stubs/csm_share/mct_mod_stub.F90 delete mode 100644 src/unit_test_stubs/csm_share/seq_comm_mct.F90 delete mode 100644 src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 delete mode 100644 src/unit_test_stubs/dyn_subgrid/CMakeLists.txt delete mode 100644 src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 delete mode 100644 src/unit_test_stubs/main/CMakeLists.txt delete mode 100644 src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 delete mode 100644 src/unit_test_stubs/main/histFileMod_stub.F90 delete mode 100644 src/unit_test_stubs/main/ncdio_dim.F90 delete mode 100644 src/unit_test_stubs/main/ncdio_pio_fake.F90.in delete mode 100644 src/unit_test_stubs/main/ncdio_var.F90.in delete mode 100644 src/unit_test_stubs/utils/CMakeLists.txt delete mode 100644 src/unit_test_stubs/utils/clmfates_paraminterfaceMod_stub.F90 delete mode 100644 src/unit_test_stubs/utils/restUtilMod_stub.F90.in delete mode 100644 src/unit_test_stubs/utils/spmdMod_stub.F90 delete mode 100644 src/utils/AnnualFluxDribbler.F90 delete mode 100644 src/utils/CMakeLists.txt delete mode 100644 src/utils/SimpleMathMod.F90 delete mode 100644 src/utils/array_utils.F90.in delete mode 100644 src/utils/clm_nlUtilsMod.F90 delete mode 100644 src/utils/clm_time_manager.F90 delete mode 100644 src/utils/clm_varorb.F90 delete mode 100644 src/utils/clmfates_interfaceMod.F90 delete mode 100644 src/utils/clmfates_paraminterfaceMod.F90 delete mode 100644 src/utils/domainMod.F90 delete mode 100644 src/utils/dtypes.h delete mode 100644 src/utils/fileutils.F90 delete mode 100644 src/utils/getdatetime.F90 delete mode 100644 src/utils/quadraticMod.F90 delete mode 100644 src/utils/restUtilMod.F90.in delete mode 100644 src/utils/spmdGathScatMod.F90 delete mode 100644 src/utils/spmdMod.F90 delete mode 100644 src/utils/test/CMakeLists.txt delete mode 100644 src/utils/test/annual_flux_dribbler_test/CMakeLists.txt delete mode 100644 src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf delete mode 100644 src/utils/test/clm_time_manager_test/CMakeLists.txt delete mode 100644 src/utils/test/clm_time_manager_test/test_clm_time_manager.pf delete mode 100644 src/utils/test/quadratic_test/CMakeLists.txt delete mode 100644 src/utils/test/quadratic_test/test_quadratic.pf delete mode 100644 src_clm40/biogeochem/C13SummaryMod.F90 delete mode 100644 src_clm40/biogeochem/CNAllocationMod.F90 delete mode 100644 src_clm40/biogeochem/CNAnnualUpdateMod.F90 delete mode 100644 src_clm40/biogeochem/CNBalanceCheckMod.F90 delete mode 100644 src_clm40/biogeochem/CNC13FluxMod.F90 delete mode 100644 src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 delete mode 100644 src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 delete mode 100644 src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 delete mode 100644 src_clm40/biogeochem/CNCStateUpdate1Mod.F90 delete mode 100644 src_clm40/biogeochem/CNCStateUpdate2Mod.F90 delete mode 100644 src_clm40/biogeochem/CNCStateUpdate3Mod.F90 delete mode 100644 src_clm40/biogeochem/CNDVEcosystemDynIniMod.F90 delete mode 100644 src_clm40/biogeochem/CNDVEstablishmentMod.F90 delete mode 100644 src_clm40/biogeochem/CNDVLightMod.F90 delete mode 100644 src_clm40/biogeochem/CNDVMod.F90 delete mode 100644 src_clm40/biogeochem/CNDecompMod.F90 delete mode 100644 src_clm40/biogeochem/CNEcosystemDynMod.F90 delete mode 100644 src_clm40/biogeochem/CNFireMod.F90 delete mode 100644 src_clm40/biogeochem/CNGRespMod.F90 delete mode 100644 src_clm40/biogeochem/CNGapMortalityMod.F90 delete mode 100644 src_clm40/biogeochem/CNMRespMod.F90 delete mode 100644 src_clm40/biogeochem/CNNDynamicsMod.F90 delete mode 100644 src_clm40/biogeochem/CNNStateUpdate1Mod.F90 delete mode 100644 src_clm40/biogeochem/CNNStateUpdate2Mod.F90 delete mode 100644 src_clm40/biogeochem/CNNStateUpdate3Mod.F90 delete mode 100644 src_clm40/biogeochem/CNPhenologyMod.F90 delete mode 100644 src_clm40/biogeochem/CNPrecisionControlMod.F90 delete mode 100644 src_clm40/biogeochem/CNSetValueMod.F90 delete mode 100644 src_clm40/biogeochem/CNSummaryMod.F90 delete mode 100644 src_clm40/biogeochem/CNVegStructUpdateMod.F90 delete mode 100644 src_clm40/biogeochem/CNWoodProductsMod.F90 delete mode 100644 src_clm40/biogeochem/CNrestMod.F90 delete mode 100644 src_clm40/biogeochem/CropRestMod.F90 delete mode 100644 src_clm40/biogeochem/DUSTMod.F90 delete mode 100644 src_clm40/biogeochem/DryDepVelocity.F90 delete mode 100644 src_clm40/biogeochem/MEGANFactorsMod.F90 delete mode 100644 src_clm40/biogeochem/STATICEcosysDynMod.F90 delete mode 100644 src_clm40/biogeochem/VOCEmissionMod.F90 delete mode 100644 src_clm40/biogeophys/BalanceCheckMod.F90 delete mode 100644 src_clm40/biogeophys/BareGroundFluxesMod.F90 delete mode 100644 src_clm40/biogeophys/BiogeophysRestMod.F90 delete mode 100644 src_clm40/biogeophys/Biogeophysics1Mod.F90 delete mode 100644 src_clm40/biogeophys/Biogeophysics2Mod.F90 delete mode 100644 src_clm40/biogeophys/BiogeophysicsLakeMod.F90 delete mode 100644 src_clm40/biogeophys/CanopyFluxesMod.F90 delete mode 100644 src_clm40/biogeophys/FracWetMod.F90 delete mode 100644 src_clm40/biogeophys/FrictionVelocityMod.F90 delete mode 100644 src_clm40/biogeophys/Hydrology1Mod.F90 delete mode 100644 src_clm40/biogeophys/Hydrology2Mod.F90 delete mode 100644 src_clm40/biogeophys/HydrologyLakeMod.F90 delete mode 100644 src_clm40/biogeophys/QSatMod.F90 delete mode 100644 src_clm40/biogeophys/SNICARMod.F90 delete mode 100644 src_clm40/biogeophys/SnowHydrologyMod.F90 delete mode 100644 src_clm40/biogeophys/SoilHydrologyMod.F90 delete mode 100644 src_clm40/biogeophys/SoilTemperatureMod.F90 delete mode 100644 src_clm40/biogeophys/SurfaceAlbedoMod.F90 delete mode 100644 src_clm40/biogeophys/SurfaceRadiationMod.F90 delete mode 100644 src_clm40/biogeophys/TridiagonalMod.F90 delete mode 100644 src_clm40/biogeophys/UrbanInitMod.F90 delete mode 100644 src_clm40/biogeophys/UrbanInputMod.F90 delete mode 100644 src_clm40/biogeophys/UrbanMod.F90 delete mode 100644 src_clm40/biogeophys/clm_driverInitMod.F90 delete mode 100644 src_clm40/main/CMakeLists.txt delete mode 100644 src_clm40/main/CNiniSpecial.F90 delete mode 100644 src_clm40/main/CNiniTimeVar.F90 delete mode 100644 src_clm40/main/GetGlobalValuesMod.F90 delete mode 100644 src_clm40/main/SimpleMathMod.F90 delete mode 100644 src_clm40/main/abortutils.F90 delete mode 100644 src_clm40/main/accFldsMod.F90 delete mode 100644 src_clm40/main/accumulMod.F90 delete mode 100644 src_clm40/main/clm_atmlnd.F90 delete mode 100644 src_clm40/main/clm_cpl_indices.F90 delete mode 100644 src_clm40/main/clm_driver.F90 delete mode 100644 src_clm40/main/clm_glclnd.F90 delete mode 100644 src_clm40/main/clm_initializeMod.F90 delete mode 100644 src_clm40/main/clm_nlUtilsMod.F90 delete mode 100644 src_clm40/main/clm_time_manager.F90 delete mode 100644 src_clm40/main/clm_varcon.F90 delete mode 100644 src_clm40/main/clm_varctl.F90 delete mode 100644 src_clm40/main/clm_varorb.F90 delete mode 100644 src_clm40/main/clm_varpar.F90 delete mode 100644 src_clm40/main/clm_varsur.F90 delete mode 100644 src_clm40/main/clmtype.F90 delete mode 100644 src_clm40/main/clmtypeInitMod.F90 delete mode 100644 src_clm40/main/controlMod.F90 delete mode 100644 src_clm40/main/decompInitMod.F90 delete mode 100644 src_clm40/main/decompMod.F90 delete mode 100644 src_clm40/main/domainMod.F90 delete mode 100644 src_clm40/main/dtypes.h delete mode 100644 src_clm40/main/dynlandMod.F90 delete mode 100644 src_clm40/main/fileutils.F90 delete mode 100644 src_clm40/main/filterMod.F90 delete mode 100755 src_clm40/main/findHistFields.pl delete mode 100644 src_clm40/main/getdatetime.F90 delete mode 100644 src_clm40/main/histFileMod.F90 delete mode 100644 src_clm40/main/histFldsMod.F90 delete mode 100644 src_clm40/main/iniTimeConst.F90 delete mode 100644 src_clm40/main/initGridCellsMod.F90 delete mode 100644 src_clm40/main/initSurfAlbMod.F90 delete mode 100644 src_clm40/main/lnd_comp_mct.F90 delete mode 100644 src_clm40/main/lnd_import_export.F90 delete mode 100644 src_clm40/main/mkarbinitMod.F90 delete mode 100644 src_clm40/main/ncdio_pio.F90.in delete mode 100644 src_clm40/main/ndepStreamMod.F90 delete mode 100644 src_clm40/main/organicFileMod.F90 delete mode 100644 src_clm40/main/pft2colMod.F90 delete mode 100644 src_clm40/main/pftdynMod.F90 delete mode 100644 src_clm40/main/pftvarcon.F90 delete mode 100644 src_clm40/main/quadraticMod.F90 delete mode 100644 src_clm40/main/restFileMod.F90 delete mode 100644 src_clm40/main/restUtilMod.F90 delete mode 100644 src_clm40/main/restUtilMod.F90.in delete mode 100644 src_clm40/main/spmdGathScatMod.F90 delete mode 100644 src_clm40/main/spmdMod.F90 delete mode 100644 src_clm40/main/subgridAveMod.F90 delete mode 100644 src_clm40/main/subgridMod.F90 delete mode 100644 src_clm40/main/subgridRestMod.F90 delete mode 100644 src_clm40/main/surfrdMod.F90 rename {manage_externals/test => test}/.coveragerc (100%) rename {manage_externals/test => test}/.gitignore (100%) rename {manage_externals/test => test}/.pylint.rc (100%) rename {manage_externals/test => test}/Makefile (100%) rename {manage_externals/test => test}/README.md (100%) rename {manage_externals/test => test}/doc/.gitignore (100%) rename {manage_externals/test => test}/doc/Makefile (100%) rename {manage_externals/test => test}/doc/conf.py (100%) rename {manage_externals/test => test}/doc/develop.rst (100%) rename {manage_externals/test => test}/doc/index.rst (100%) rename {manage_externals/test => test}/doc/testing.rst (100%) rename {manage_externals/test => test}/repos/container.git/HEAD (100%) rename {manage_externals/test => test}/repos/container.git/config (100%) rename {manage_externals/test => test}/repos/container.git/description (100%) rename {manage_externals/test => test}/repos/container.git/info/exclude (100%) rename {manage_externals/test => test}/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 (100%) rename {manage_externals/test => test}/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de (100%) rename {manage_externals/test => test}/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b (100%) rename {manage_externals/test => test}/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 (100%) rename {manage_externals/test => test}/repos/container.git/refs/heads/master (100%) rename {manage_externals/test => test}/repos/error/readme.txt (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/HEAD (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/config (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/description (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/info/exclude (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/refs/heads/master (100%) rename {manage_externals/test => test}/repos/mixed-cont-ext.git/refs/heads/new-feature (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/HEAD (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/config (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/description (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/info/exclude (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/packed-refs (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/refs/heads/feature2 (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/refs/tags/abandoned-feature (100%) rename {manage_externals/test => test}/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/HEAD (100%) rename {manage_externals/test => test}/repos/simple-ext.git/config (100%) rename {manage_externals/test => test}/repos/simple-ext.git/description (100%) rename {manage_externals/test => test}/repos/simple-ext.git/info/exclude (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c (100%) create mode 100644 test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d rename {manage_externals/test => test}/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 (100%) create mode 100644 test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380 rename {manage_externals/test => test}/repos/simple-ext.git/objects/60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/63/a99393d1baff97ccef967af30380659867b139 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/95/3256da5612fcd9263590a353bc18c6f224e74f (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 (100%) create mode 100644 test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7 rename {manage_externals/test => test}/repos/simple-ext.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 (100%) create mode 100644 test/repos/simple-ext.git/objects/d1/163870d19c3dee34fada3a76b785cfa2a8424b create mode 100644 test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 rename {manage_externals/test => test}/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff (100%) rename {manage_externals/test => test}/repos/simple-ext.git/refs/heads/feature2 (100%) rename {manage_externals/test => test}/repos/simple-ext.git/refs/heads/feature3 (100%) create mode 100644 test/repos/simple-ext.git/refs/heads/master rename {manage_externals/test => test}/repos/simple-ext.git/refs/tags/tag1 (100%) create mode 100644 test/repos/simple-ext.git/refs/tags/tag2 rename {manage_externals/test => test}/requirements.txt (100%) rename {manage_externals/test => test}/test_sys_checkout.py (78%) rename {manage_externals/test => test}/test_sys_repository_git.py (100%) rename {manage_externals/test => test}/test_unit_externals_description.py (96%) rename {manage_externals/test => test}/test_unit_externals_status.py (100%) rename {manage_externals/test => test}/test_unit_repository.py (87%) rename {manage_externals/test => test}/test_unit_repository_git.py (99%) rename {manage_externals/test => test}/test_unit_repository_svn.py (100%) rename {manage_externals/test => test}/test_unit_utils.py (100%) delete mode 100755 test/tools/CLM_compare.sh delete mode 100644 test/tools/Makefile delete mode 100644 test/tools/README delete mode 100644 test/tools/README.testnames delete mode 100755 test/tools/TBLCFGtools.sh delete mode 100755 test/tools/TBLscript_tools.sh delete mode 100755 test/tools/TBLtools.sh delete mode 100755 test/tools/TCBCFGtools.sh delete mode 100755 test/tools/TCBscripttools.sh delete mode 100755 test/tools/TCBtools.sh delete mode 100755 test/tools/TOPtools.sh delete mode 100755 test/tools/TSMCFGtools.sh delete mode 100755 test/tools/TSMncl_tools.sh delete mode 100755 test/tools/TSMscript_tools.sh delete mode 100755 test/tools/TSMtools.sh delete mode 100644 test/tools/config_files/CFGtools__ds delete mode 100644 test/tools/config_files/PTCLM__s delete mode 100644 test/tools/config_files/README delete mode 100644 test/tools/config_files/gen_domain delete mode 100644 test/tools/config_files/tools__do delete mode 100644 test/tools/config_files/tools__ds delete mode 100644 test/tools/config_files/tools__o delete mode 100644 test/tools/config_files/tools__s delete mode 100755 test/tools/gen_test_table.sh delete mode 100755 test/tools/get_cprnc_diffs.sh delete mode 100644 test/tools/input_tests_master delete mode 100644 test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 delete mode 100644 test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 delete mode 100644 test/tools/nl_files/PTCLM_USUMB_clm4_5 delete mode 100644 test/tools/nl_files/gen_domain.T31.runoptions delete mode 100644 test/tools/nl_files/gen_domain.ne30.runoptions delete mode 100644 test/tools/nl_files/getregional delete mode 100644 test/tools/nl_files/getregional_05popd delete mode 100644 test/tools/nl_files/getregional_T62 delete mode 100644 test/tools/nl_files/getregional_ndep delete mode 100644 test/tools/nl_files/mkmapdata_if10 delete mode 100644 test/tools/nl_files/mkmapdata_ne30np4 delete mode 100644 test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 delete mode 100644 test/tools/nl_files/mksrfdt_10x15_1850 delete mode 100644 test/tools/nl_files/mksrfdt_10x15_crp_1850-2000 delete mode 100644 test/tools/nl_files/mksrfdt_1x1_brazil_1850 delete mode 100644 test/tools/nl_files/mksrfdt_1x1_brazil_1850-2000 delete mode 100644 test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 delete mode 100644 test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 delete mode 100644 test/tools/nl_files/mksrfdt_T31_crpglc_2000 delete mode 100755 test/tools/show_var_diffs.sh delete mode 100755 test/tools/test_driver.sh delete mode 100644 test/tools/tests_posttag_dav_mpi delete mode 100644 test/tools/tests_posttag_hobart_nompi delete mode 100644 test/tools/tests_posttag_nompi_regression delete mode 100644 test/tools/tests_pretag_cheyenne_nompi delete mode 100644 tools/README delete mode 100644 tools/README.filecopies delete mode 100644 tools/README.testing delete mode 100644 tools/mkmapdata/README delete mode 100755 tools/mkmapdata/createXMLEntries.pl delete mode 100755 tools/mkmapdata/mkmapdata.sh delete mode 100755 tools/mkmapdata/mknoocnmap.pl delete mode 100644 tools/mkmapdata/mkunitymap.ncl delete mode 100755 tools/mkmapdata/mvNimport.sh delete mode 100755 tools/mkmapdata/regridbatch.sh delete mode 100755 tools/mkmapdata/regridgeyser.sh delete mode 100644 tools/mkmapdata/rmdups.ncl delete mode 100644 tools/mkmapgrids/README delete mode 100644 tools/mkmapgrids/mkscripgrid.ncl delete mode 100644 tools/mkprocdata_map/README delete mode 100644 tools/mkprocdata_map/README.filedescriptions delete mode 100755 tools/mkprocdata_map/mkprocdata_map_all delete mode 100644 tools/mkprocdata_map/mkprocdata_map_functions.bash delete mode 100755 tools/mkprocdata_map/mkprocdata_map_wrap delete mode 100644 tools/mkprocdata_map/src/Filepath delete mode 100644 tools/mkprocdata_map/src/Makefile delete mode 100644 tools/mkprocdata_map/src/Makefile.common delete mode 100755 tools/mkprocdata_map/src/Mkdepends delete mode 100644 tools/mkprocdata_map/src/Srcfiles delete mode 100644 tools/mkprocdata_map/src/constMod.F90 delete mode 100644 tools/mkprocdata_map/src/fileutils.F90 delete mode 100644 tools/mkprocdata_map/src/fmain.F90 delete mode 100644 tools/mkprocdata_map/src/gridmapMod.F90 delete mode 100644 tools/mkprocdata_map/src/mkprocdata_map.F90 delete mode 100644 tools/mkprocdata_map/src/nanMod.F90 delete mode 100644 tools/mkprocdata_map/src/shr_file_mod.F90 delete mode 100644 tools/mkprocdata_map/src/shr_kind_mod.F90 delete mode 100644 tools/mksurfdata_map/Makefile.data delete mode 100644 tools/mksurfdata_map/README delete mode 100644 tools/mksurfdata_map/README.developers delete mode 100644 tools/mksurfdata_map/landuse_timeseries_hist_78pfts_simyr1850-2015.txt delete mode 100755 tools/mksurfdata_map/mksurfdata.pl delete mode 100644 tools/mksurfdata_map/mksurfdata_map.namelist delete mode 100644 tools/mksurfdata_map/single_point_dynpft_files/README delete mode 100644 tools/mksurfdata_map/single_point_dynpft_files/README.landuse_timeseries_smallvilleIA_hist_simyr1850-1855 delete mode 100644 tools/mksurfdata_map/single_point_dynpft_files/landuse_timeseries_smallvilleIA_hist_simyr1850-1855.txt delete mode 100644 tools/mksurfdata_map/src/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/Filepath delete mode 100644 tools/mksurfdata_map/src/Makefile delete mode 100644 tools/mksurfdata_map/src/Makefile.common delete mode 100755 tools/mksurfdata_map/src/Mkdepends delete mode 100644 tools/mksurfdata_map/src/README.unit_testing delete mode 100644 tools/mksurfdata_map/src/Srcfiles delete mode 100644 tools/mksurfdata_map/src/fileutils.F90 delete mode 100644 tools/mksurfdata_map/src/mkCH4inversionMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkVICparamsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkagfirepkmonthMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkchecksMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkdiagnosticsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkdomainMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkfileMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkgdpMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkglacierregionMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkglcmecMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkgridmapMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkharvestMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkindexmapMod.F90 delete mode 100644 tools/mksurfdata_map/src/mklaiMod.F90 delete mode 100644 tools/mksurfdata_map/src/mklanwatMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkncdio.F90 delete mode 100644 tools/mksurfdata_map/src/mkpctPftTypeMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkpeatMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkpftConstantsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkpftMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkpftUtilsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mksoilMod.F90 delete mode 100644 tools/mksurfdata_map/src/mksoildepthMod.F90 delete mode 100644 tools/mksurfdata_map/src/mksurfdat.F90 delete mode 100644 tools/mksurfdata_map/src/mktopostatsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkurbanparCommonMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkurbanparMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkutilsMod.F90 delete mode 100644 tools/mksurfdata_map/src/mkvarctl.F90 delete mode 100644 tools/mksurfdata_map/src/mkvarpar.F90 delete mode 100644 tools/mksurfdata_map/src/mkvocefMod.F90 delete mode 100644 tools/mksurfdata_map/src/nanMod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_const_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_file_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_kind_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_log_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_string_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_sys_mod.F90 delete mode 100644 tools/mksurfdata_map/src/shr_timer_mod.F90 delete mode 100644 tools/mksurfdata_map/src/test/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/test/mkgridmap_test/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf delete mode 100644 tools/mksurfdata_map/src/test/mkindexmap_test/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf delete mode 100644 tools/mksurfdata_map/src/test/mkpctPftType_test/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/test/mkpctPftType_test/test_mkpctPftType.pf delete mode 100644 tools/mksurfdata_map/src/test/mkpftUtils_test/CMakeLists.txt delete mode 100644 tools/mksurfdata_map/src/test/mkpftUtils_test/test_adjust_total_veg_area.pf delete mode 100644 tools/mksurfdata_map/src/test/mkpftUtils_test/test_convert_from_p2g.pf delete mode 100644 tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/Filepath delete mode 100644 tools/mksurfdata_map/unit_testers/Makefile delete mode 100644 tools/mksurfdata_map/unit_testers/README delete mode 100644 tools/mksurfdata_map/unit_testers/Srcfiles delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkchecksMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkdomainMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkgridmapMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkharvest.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkindexmapMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkncdio.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkurbanparMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mkutilsMod.F90 delete mode 100644 tools/mksurfdata_map/unit_testers/test_mod.F90 delete mode 100644 tools/ncl_scripts/README delete mode 100644 tools/ncl_scripts/README.getregional delete mode 100644 tools/ncl_scripts/getco2_historical.ncl delete mode 100644 tools/ncl_scripts/getregional_datasets.ncl delete mode 100755 tools/ncl_scripts/getregional_datasets.pl delete mode 100644 tools/ncl_scripts/sample_inlist delete mode 100644 tools/ncl_scripts/sample_inlist_0.5popd delete mode 100644 tools/ncl_scripts/sample_inlist_T62 delete mode 100644 tools/ncl_scripts/sample_inlist_ndep delete mode 100644 tools/ncl_scripts/sample_outlist delete mode 100644 tools/ncl_scripts/sample_outlist_0.5popd delete mode 100644 tools/ncl_scripts/sample_outlist_T62 delete mode 100644 tools/ncl_scripts/sample_outlist_ndep diff --git a/.CTSMTrunkChecklist b/.CTSMTrunkChecklist deleted file mode 100644 index 116233a969..0000000000 --- a/.CTSMTrunkChecklist +++ /dev/null @@ -1,58 +0,0 @@ -Checklist of steps to do to make a CTSM Trunk Tag Mar/7th/2017 - -CTSM Software Management team. - -See the wiki page for this on: - -https://github.com/ESCOMP/ctsm/wiki/CTSM-development-workflow - -(1) Do all testing on your fork/feature-branch - - 1a -- make sure any new failing tests are either fixed or approved as a new expected - fail - 1b -- update the ExpectedFails list if expected fails changes in 1a - $EDITOR cime_config/testdefs/ExpectedTestFails.xml - 1c -- make sure you understand any changes to the baselines -- to document in ChangeLog - -(2) Use diff and status to make sure any new files are in the repo and only the correct -changes are on the branch - - 2a -- 'git status' to check that you've added any new files and haven't - added any non source files that aren't needed in the repository - 2b -- 'git diff' to check that your changes are correct and you didn't accidentally - add something unintentionally - 2c -- you could also update the content of the changelog here on the branch - -(3) Submit a pull request (PR) for the changes - Have someone review it if you are able. At minimum review it youself. The PR mechanism - on git is an excellent way to code review code for both yourself and others. Also make - sure all your changes are correct, changes that shouldn't have gone in don't, and all new - files are added in. - -(4) Merge the PR to master when review is approved - -(5) Compare master to branch show that they are identical - -git diff master remote/feature-branch - -This should show no diffs - -(6) Update ChangeLog - 6a -- if you didn't update the content in 2c do it now - (Increment the science minor number if answers change in an important way) - 6b -- update date stamp on ChangeLog - ./UpDateChangeLog.pl -update - 6c -- commit new change files - -(7) Make the trunk tag - -(8) Send an email to clm-dev with the contents of the latest ChangeLog -entry (until we have automated this for the git repo) - -NOTES: - -(1) -- Always test on your fork with a feature-branch so that we can change tag order if needed. Put -baselines in the next tag name, as we can easily change afterwards if needed. -(6) or 2c -- Updating the ChangeLog needs to happen on the trunk shortly before the new -trunk tag is made. There is a cronjob that emails errors when the ChangeLog was updated -but the new trunk tag wasn't made. diff --git a/.config_files.xml b/.config_files.xml deleted file mode 100644 index 8e4868b94f..0000000000 --- a/.config_files.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - char - unset - - $SRCROOT - $CIMEROOT/src/components/data_comps/dlnd - $CIMEROOT/src/components/stub_comps/slnd - $CIMEROOT/src/components/xcpl_comps/xlnd - - case_comps - env_case.xml - Root directory of the case land model component - $CIMEROOT/config/xml_schemas/config_compsets.xsd - - - diff --git a/manage_externals/.dir_locals.el b/.dir_locals.el similarity index 100% rename from manage_externals/.dir_locals.el rename to .dir_locals.el diff --git a/manage_externals/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from manage_externals/.github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md deleted file mode 100644 index 427217bdfb..0000000000 --- a/.github/ISSUE_TEMPLATE/01_bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Bug report -about: Report a problem with the code - ---- - -### Brief summary of bug - -[Give a one or two sentence summary. This could be the same as the issue title if you feel that is a sufficient summary.] - -### General bug information - -**CTSM version you are using:** [output of `git describe`] - -**Does this bug cause significantly incorrect results in the model's science?** [Yes / No] - -**Configurations affected:** [Fill this in if known.] - -### Details of bug - -[Fill in details here.] - -### Important details of your setup / configuration so we can reproduce the bug - -[Specify anything relevant: the compset, resolution, machine, compiler, any xml or namelist changes, etc. You don't have to repeat anything that you have already noted above.] - -### Important output or errors that show the problem - -[Fill this in with anything relevant that you haven't already noted; if there is nothing to add, delete this section.] diff --git a/.github/ISSUE_TEMPLATE/02_support_needed.md b/.github/ISSUE_TEMPLATE/02_support_needed.md deleted file mode 100644 index d3c69aaf6a..0000000000 --- a/.github/ISSUE_TEMPLATE/02_support_needed.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Support needed for model use -about: Ask for help with using CTSM - ---- - -### NOTE: Be sure to read the relevant documentation and user forums - -We have limited staff and ability to provide support. Here are some resources that might provide help: -- User's Guide: https://escomp.github.io/ctsm-docs/doc/build/html/users_guide/index.html -- CLM Forum: https://bb.cgd.ucar.edu/forums/land-modeling-clm -- README files amongst the source code -- GitHub CTSM issues: https://github.com/escomp/ctsm/issues/ -- Also make sure this issue is unique to CTSM and not really an issue with CESM or CIME - -### Details of support request - -[Fill in details here.] - -### Important details of your setup / configuration so we can better assist you - -**CTSM version you are using:** [output of `git describe`] - -**Have you made any modifications to code, xml files, etc.?** [Yes / No] - -[If Yes: Please point us to your modifications. However: In general we can NOT support problems with modified code. Try to show the problem without modifications.] - -**If you are having problems with a specific case: Is your case on a machine accessible to most CTSM developers (e.g., an NCAR machine)?** [Yes / No] - -If Yes: - -- Location of case directory: [Fill this in] - -- Location of run directory: [Fill this in] - -[If No: Please make sure you have included all important input and output needed to understand your issue, either by pasting it into the issue text, or by attaching relevant files. However: We are less likely to be able to reproduce your problem if the issue is NOT on an NCAR machine.] diff --git a/.github/ISSUE_TEMPLATE/03_science_discussion.md b/.github/ISSUE_TEMPLATE/03_science_discussion.md deleted file mode 100644 index 25f47ff601..0000000000 --- a/.github/ISSUE_TEMPLATE/03_science_discussion.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Science discussion -about: We encourage the use of issues to discuss CTSM science developments - ---- - - diff --git a/.github/ISSUE_TEMPLATE/04_other.md b/.github/ISSUE_TEMPLATE/04_other.md deleted file mode 100644 index 61898d3a75..0000000000 --- a/.github/ISSUE_TEMPLATE/04_other.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Other -about: Other issues (enhancement, cleanup, documentation, etc.) - ---- - - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 36a87f49f1..b68b1fb5e2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,20 +1,17 @@ -### Description of changes +[ 50 character, one line summary ] -### Specific notes +[ Description of the changes in this commit. It should be enough + information for someone not following this development to understand. + Lines should be wrapped at about 72 characters. ] -Contributors other than yourself, if any: +User interface changes?: [ No/Yes ] +[ If yes, describe what changed, and steps taken to ensure backward compatibilty ] -CTSM Issues Fixed (include github issue #): +Fixes: [Github issue #s] And brief description of each issue. -Are answers expected to change (and if so in what way)? +Testing: + test removed: + unit tests: + system tests: + manual testing: -Any User Interface Changes (namelist or namelist defaults changes)? - -Testing performed, if any: -(List what testing you did to show your changes worked as expected) -(This can be manual testing or running of the different test suites) -(Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide) -(aux_clm on cheyenne for gnu/pgi and hobart for gnu/pgi/nag is the standard for tags on master) - -**NOTE: Be sure to check your Coding style against the standard:** -https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines diff --git a/.gitignore b/.gitignore index d8000a5537..411de5d96e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,97 +1,14 @@ -# directories checked out by manage_externals, and other files created -# by manage_externals -manage_externals.log -/src/fates/ -/tools/PTCLM/ -/cime/ -/components/ +# directories that are checked out by the tool +cime/ +cime_config/ +components/ -# ignore svn directories -**/.svn/** -.svn/ - -# binary files -*.nc +# generated local files +*.log # editor files -*.swp *~ +*.bak -# mac files -.DS_Store - -# cmake generated files -build/ -CMakeFiles/ - - -# unit testing directories -/src/unit_tests.* - -# files generated by the unit test build -/src/dyn_subgrid/dynVarMod.F90 -/src/dyn_subgrid/dynVarTimeInterpMod.F90 -/src/dyn_subgrid/dynVarTimeUninterpMod.F90 -/src/utils/array_utils.F90 -/src/unit_test_stubs/utils/restUtilMod_stub.F90 -/src/unit_test_stubs/main/ncdio_pio_fake.F90 -/src/unit_test_stubs/main/ncdio_var.F90 -/src/unit_test_shr/unittestArrayMod.F90 - -# cime_config -buildnmlc -buildcppc - -# configure / build files -/bld/**/CESM_cppdefs -/bld/**/Filepath -/bld/**/config_cache.xml -/bld/**/lnd_in -/bld/**/drv_flds_in - -# build-naemlist testing -/bld/unit_testers/lnd_in* -/bld/unit_testers/drv_flds_in* -/bld/unit_testers/temp_file.txt* -/bld/unit_testers/user_nl_clm_real_parameters* -/bld/unit_testers/env_run.xml - -# tools testing output -td.*.status -td.*.log -td.*.status.xFail -test_driver_*.sh - -# mksurfdata output -surfdata_*.log -surfdata_*.namelist -landuse.timeseries_*.namelist -landuse.timeseries_*.log -landuse_timeseries_*.txt -clm.input_data_list -clm.input_data_list.previous -*.stdout.txt.o* - -# Tools executables -/tools/mksurfdata_map/mksurfdata_map -/tools/mkprocdata_map/mkprocdata_map - -# mksurfdata output files -/tools/mksurfdata_map/surfdata_*.nc -/tools/mksurfdata_map/landuse.timeseries_*.nc - -# mkmapdata output files -/tools/mkmapdata/PET*.RegridWeightGen.Log -/tools/mkmapdata/regrid.*.out -/tools/mkmapdata/regrid.*.err -/tools/mkmapdata/regrid.o* -/tools/mkmapdata/map*.nc - -# build output -*.o -*.mod -core.* -*.gz -*.log !run.log +# generated python files *.pyc -Depends diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..1990cb9604 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,19 @@ +language: python +os: linux +python: + - "2.7" + - "3.4" + - "3.5" + - "3.6" + - "3.7" + - "3.8" +install: + - pip install -r test/requirements.txt +before_script: + - git --version +script: + - cd test; make test + - cd test; make lint +after_success: + - cd test; make coverage + - cd test; coveralls diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index 7ed198ec02..0000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,49 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, politcal affiliation, veteran status, pregnancy, genetic information, personal appearance, choice of text editor or operating system, race, religion, or sexual identity and orientation, or any other characteristic protected under applicable US federal or state law. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting -* Refusing to use the pronouns that someone requests -* Intimidating, threatening, or hostile conduct; physical or verbal abuse; vandalism; arson; and sabotage -* Alarming or threatening comments that might refer to, suggest, or promote a violent, intimidating, or threatening action - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ctsm-core@ucar.edu. Alternatively, this behavior can be reported to individuals on the CTSM team, who will then have the responsibility to talk about the behavior to the core team. Another alternative for NCAR employees (when all individuals involved are NCAR employees) is to use the reporting methods of NCAR for this behavior (these options include anonymous reporting methods). The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Retaliation against a person who initiates a complaint or an inquiry about such behaviors is equally prohibited. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 70bf041ba7..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,48 +0,0 @@ -## How to contribute: - -We recommend that you first open an issue (https://github.com/escomp/ctsm/issues/) to -discuss the changes or additions that you propose. Through the issue discussion, you can -work with other CTSM developers to think about the design and implementation of the changes -as well as the planning and scheduling for the change to come into CTSM. An alternative is -to contact the key software and science developers via ctsm-software@ucar.edu. Making -contact early in your project will increase the likelihood that your developments can come -into CTSM. - -We also recommend that you join the ctsm-dev@ucar.edu google groups in order -to be informed about the science that is happening in CTSM as well as the latest developments and tags. -The ctsm-dev group is here: - -https://groups.google.com/a/ucar.edu/forum/#!forum/ctsm-dev - -Use the help from the wiki below to setup a fork and personal branch in GitHub to put your developments -on and keep up to date with the master branch of CTSM. Once the changes are sufficiently advanced you -can form a Pull Request on GitHub. Either from your fork on GitHub, or from the main ESCOMP GitHub page -for CTSM (be sure to hit the "compare across forks" link at the top of the page when you first create -the pull request). - -https://github.com/ESCOMP/ctsm/pulls - -This allows you to show your proposed changes and start getting feedback on them (even if they aren't finished). -This also allows your changes to be planned for and slated for a time to come into CTSM master. In most -cases you won't merge the Pull Request yourself, but a software engineer responsible for CTSM will do -additional testing and bring the changes to CTSM master. - -### CTSM Developers Guide: - - https://wiki.ucar.edu/display/ccsm/Community+Land+Model+Developers+Guide - -## Getting Started: - -The following resources give you information on the project and how to get started. - -#### CTSM Wiki: - -https://github.com/ESCOMP/ctsm/wiki - -#### Coding Practices and Style: - -Code conventions: https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines - -#### Code of Conduct: - -See the `CODE_OF_CONDUCT.md` file for expectations of how to work in the community. diff --git a/Copyright b/Copyright deleted file mode 100644 index 21b9688874..0000000000 --- a/Copyright +++ /dev/null @@ -1,75 +0,0 @@ -CESM1.5: Copyright Notice and Disclaimer - -The Community Earth System Model (CESM was developed in cooperation with -the National Science Foundation, the Department of Energy, -the National Aeronautics and Space Administration, and -the University Corporation for Atmospheric Research National Center for Atmospheric Research. - -Except for the segregable components listed below, CESM is public domain software. -There may be other third party tools and libraries that are embedded, and -they may have their own copyright notices and terms. - -The following components are copyrighted and may only be used, modified, -or redistributed under the terms indicated below. - -Code Institution Copyright Terms of Use/Disclaimer ----- ----------- --------- ----------------------- -ESMF University of Copyright University of Illinois/NCSA Open Source License - Illinois/NCSA 2002-2009, - University of - Illinois/NCSA - Open Source - License - -POP,SCRIP,CICE Los Alamos National Copyright 2008 Los Alamos National Security, LLC - Laboratory Los Alamos - National - Security, LLC - -CISM NCAR/LANL/ORNL/SNL/ Copyright GNU Lesser General Public License v. 3 - LBNL/NYU/U. Bristol/ 2004-2018, CISM is free software: you can redistribute it - U. Edinburgh/ GNU Lesser and/or modify it under the terms of the GNU - U. Montana/U. Swansea General Public Lesser General Public License as published by the - License v. 3 Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - -AER RRTMG Atmospheric Copyright AER RRTMG Copyright - and 2002-2010, - Environmental Atmospheric - Research, Inc. and - Environmental - Research, Inc. - -MCT Argonne Copyright 2000, MCT Copyright - National 2010, - Laboratory University of - Chicago. - -ICSSP N/A Copyright 2003, ISCCP Simulator Software - 2010, Steve - Klein and Mark - Webb - -XML/Lite Wadsack-Allen Copyright 2001, The documentation for the Perl XML-Lite - Digital Group 2010 module is no longer available on-line. - Wadsack-Allen - Digital Group - -Inf_NaN Lahey Copyright(c) Copies of this source code, or standalone compiled -_Detection Computer 2003, Lahey files derived from this source may not be sold -module Systems, Inc. Computer without permission from Lahey Computers Systems. - Systems, Inc. All or part of this module may be freely incorporated - into executable programs which are offered for sale. - Otherwise, distribution of all or part of this file is - permitted, provided this copyright notice and header - are included. - - -THIS SOFTWARE IS PROVIDED BY UCAR AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL UCAR OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/Externals.cfg b/Externals.cfg deleted file mode 100644 index ca5522dc58..0000000000 --- a/Externals.cfg +++ /dev/null @@ -1,38 +0,0 @@ -[clm] -local_path = . -protocol = externals_only -externals = Externals_CLM.cfg -required = True - -[cism] -local_path = components/cism -protocol = git -repo_url = https://github.com/ESCOMP/cism-wrapper -tag = release-cesm2.0.04 -externals = Externals_CISM.cfg -required = True - -[rtm] -local_path = components/rtm -protocol = git -repo_url = https://github.com/ESCOMP/rtm -tag = release-cesm2.0.00 -required = True - -[mosart] -local_path = components/mosart -protocol = git -repo_url = https://github.com/ESCOMP/mosart -tag = release-cesm2.0.00 -required = True - -[cime] -local_path = cime -protocol = git -repo_url = https://github.com/ESMCI/cime -tag = cime_cesm2_0_rel_05 -required = True - -[externals_description] -schema_version = 1.0.0 - diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg deleted file mode 100644 index d6e68c79f0..0000000000 --- a/Externals_CLM.cfg +++ /dev/null @@ -1,17 +0,0 @@ -[fates] -local_path = src/fates -protocol = git -repo_url = https://github.com/NCAR/fates-release -tag = fates_s1.8.1_a3.0.0 -required = True - -[PTCLM] -local_path = tools/PTCLM -protocol = git -repo_url = https://github.com/ESCOMP/ptclm -tag = PTCLM2_180611 -required = True - -[externals_description] -schema_version = 1.0.0 - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2ba2f9c2d8..0000000000 --- a/LICENSE +++ /dev/null @@ -1,34 +0,0 @@ -Copyright (c) 2005-2018, University Corporation for Atmospheric Research (UCAR) -All rights reserved. - -Developed by: - University Corporation for Atmospheric Research - National Center for Atmospheric Research - https://www2.cesm.ucar.edu/working-groups/sewg - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal with the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the documentation - and/or other materials provided with the distribution. - - Neither the names of [Name of Development Group, UCAR], - nor the names of its contributors may be used to endorse or promote - products derived from this Software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/manage_externals/LICENSE.txt b/LICENSE.txt similarity index 100% rename from manage_externals/LICENSE.txt rename to LICENSE.txt diff --git a/README b/README deleted file mode 100644 index e3d7c0930b..0000000000 --- a/README +++ /dev/null @@ -1,162 +0,0 @@ -$CTSMROOT/README 06/08/2018 - -Community Land Surface Model (CLM) science version 5.0.0 series -- source code, tools, -offline-build and test scripts. This gives you everything you need -to run CLM with CESM with datm8 to provide CRU NCEP or GSWP3 forcing data in -place of a modeled atmosphere. - -For lists of current bugs (issues) and current development see the CTSM GitHub page: - -https://github.com/ESCOMP/ctsm - -IMPORTANT NOTE ON CESM CHECKOUT VERSUS A CTSM CHECKOUT: - -If this is the top level directory from making a clone of CTSM the -directory structure is a little bit different than if CTSM is from -a clone of the entire CESM. If this is part of CESM this directory -will be under components/clm alongside other CESM component models. -For a CTSM checkout this will be the top level directory. - -Other documentation will refer to $CTSMROOT and it means the directory -that this file is at. CIMEROOT is the directory where "cime" is for -this checkout. For a CESM checkout $CIMEROOT will be the "cime" directory -beneath the top level directory. For a CTSM checkout $CIMEROOT will -be $CTSMROOT/cime. - -General directory structure ($CTSMROOT): - -doc --------------- Documentation of CLM. -bld --------------- Template, configure and build-namelist scripts for clm. -src --------------- CLM Source code. -test -------------- CLM Testing scripts for CLM offline tools. -tools ------------- CLM Offline tools to prepare input datasets and process output. -cime_config ------- Configuration files of cime for compsets and CLM settings -manage_externals -- Script to manage the external source directories - -Directory structure only for a CTSM checkout: - -components -------- Other active sub-components needed for CLM to run (river routing and land-ice models) - -cime/scripts --------------- cesm/cime driver scripts - -cime/src/drivers/mct/main ----------- CESM top level driver source code. -cime/src/drivers/mct/shr ------------ CESM top level driver shared code. -cime/src/components/data_comps/datm - CESM Data model version 8 source code. -cime/src/components/stub_comps/sice - CESM stub sea-ice model source code. -cime/src/components/stub_comps/socn - CESM stub ocean model source code. -cime/src/components/stub_comps/sglc - CESM stub glacier model source code. -cime/src/externals ------------------ CESM external utility codes - (Model Coupling Toolkit (MCT) - (Earth System Model Framework) - (timing -- code timing utility) - (pio -- Parallel Input/Output) -components/cism --------------------- CESM Community land Ice Sheet Model. -components/mosart ------------------- Model for Scale Adaptive River Transport -components/rtm ---------------------- CESM River Transport Model. - -Top level documentation ($CTSMROOT): - -README ------------------- This file -README.rst --------------- File that displays under the project in github -README_EXTERNALS.rst ----- Information on how to work with subversion externals for clm -CODE_OF_CONDUCT.md ------- Code of Conduct for how to work with each other on the CTSM project -Copyright ---------------- CESM Copyright file -doc/UpdateChangeLog.pl ------- Script to add documentation on a tag to the - ChangeLog/ChangeSum files -doc/ChangeLog ---------------- Documents different CLM versions -doc/ChangeSum ---------------- Summary documentation of different CLM versions - -Documentation of Namelist Items: (view the following in a web browser) - -bld/namelist_files/namelist_definition.xml --- Definition of all namelist items -bld/namelist_files/namelist_defaults_clm4_5.xml - Default values for CLM4.5/CLM5.0 - -============================================================================================= -Important files in main directories (under $CTSMROOT): -============================================================================================= - -Externals.cfg --------------- File for management of the main high level externals -Externals_CLM.cfg ----------- File for management of the CLM specific externals (i.e. FATES) -parse_cime.cs.status -------- Script to parse test status files cs.status.* created by create_test -doc/Quickstart.GUIDE -------- Quick guide to using cpl7 scripts. -doc/IMPORTANT_NOTES --------- Some important notes about this version of - clm, configuration modes and namelist items - that are not validated or functional. -doc/ChangeLog --------------- Detailed list of changes for each model version. -doc/ChangeSum --------------- Summary one-line list of changes for each - model version. -doc/README ------------------ Documentation similar to this file -doc/UsersGuide -------------- CLM Users Guide -doc/CodeReference ----------- CLM Code Reference Guide - -bld/README ------------------ Description of how to use the configure and - build-namelist scripts. -bld/configure --------------- Script to prepare CLM to be built. -bld/build-namelist ---------- Script to build CLM namelists. - -cime_config/buildnml ------------- Build the CLM namelist for CIME -cime_config/buildlib ------------- Build the CLM library -cime_config/config_compsets.xml -- Define CLM compsets -cime_config/config_component.xml - Define CLM XML settings -cime_config/config_tests.xml ----- Define CLM specific tests -cime_config/config_pes.xml ------- Define Processor layouts for various CLM grids and compsets -cime_config/testdefs ------------- Directory for specification of CLM testing -cime_config/testdefs/ExpectedTestFails.xml -- List of tests that are expected to fail -cime_config/usermods_dirs -------- Directories of sets of user-modification subdirs - (These are directories that add specific user modifications to - simulations created using "cime/scripts/create_newcase --user-mods-dir". - Current sub directories are for various CMIP6 configurations) - -test/tools/test_driver.sh -- Script for general software testing of - CLM's offline tools. - -tools/mksurfdata_map ---------- Directory to build program to create surface dataset - at any resolution. -tools/mkdatadomain ------------ Directory to build program to create datm7 or docn7 - domain files from clm files. -tools/mkprocdata_map ---------- Process history data from unstructed grids to a gridded - format. -tools/mkmapgrids -------------- NCL script to create a SCRIP grid file for a regular lat/lon grid -tools/ncl_scripts ------------ Directory of NCL and perl scripts to do various - tasks. Most notably to plot perturbation error growth - testing and to extract regional information from - global datasets for single-point/regional simulations. - - -============================================================================================= -Source code directory structure: -============================================================================================= - -src/biogeochem ---- Biogeochemisty -src/main ---------- Main control and high level code -src/cpl ----------- Land model high level MCT and ESMF drivers -src/biogeophys ---- Biogeophysics (Hydrology) -src/dyn_subgrid --- Dynamic land unit change -src/init_interp --- Online interpolation -scr/fates --------- FATES model and sub-directories - Functionally Assembled Terrestrial Ecosystem Simulator (FATES) - Experimental Ecosystem Demography model -src/utils --------- Utility codes -src/unit_test_shr - Unit test shared modules for unit testing -src/unit_test_stubs Unit test stubs that replicate CTSM code simpler - -src_clm40 --------- CLM4.0 source code directory - -============================================================================================= - QUICKSTART: using the CPL7 scripts -============================================================================================= - - cd $CIMEROOT/scripts - ./create_newcase # get help on how to run create_newcase - ./create_newcase --case testI --res f19_g17_gl4 --compset I2000Clm50BgcCrop - # create new "I" case for default machine at 1.9x2.5_gx1v7 - # with 4km greenland ice sheetres resolution - # "I2000Clm50BgcCrop" case is clm5_0 active, datm8, and inactive ice/ocn - # With no-evolve ice-sheet, and MOSART for river-routing - cd testI - ./case.setup # create the $CASE.run file - ./case.build # build model and create namelists - ./case.submit # submit script - # (NOTE: ./xmlchange RESUBMIT=10 to set RESUBMIT to number - # # of times to automatically resubmit -- 10 in this example) - diff --git a/manage_externals/README.md b/README.md similarity index 91% rename from manage_externals/README.md rename to README.md index 15e45ffb71..c931c8e213 100644 --- a/manage_externals/README.md +++ b/README.md @@ -85,7 +85,7 @@ The root of the source tree will be referred to as `${SRC_ROOT}` below. description file: $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals --excernals my-externals.cfg + $ ./manage_externals/checkout_externals --externals my-externals.cfg * Status summary of the repositories managed by checkout_externals: @@ -202,6 +202,21 @@ The root of the source tree will be referred to as `${SRC_ROOT}` below. Then the main 'externals' field in the top level repo should point to 'sub-externals.cfg'. + * from_submodule (True / False) : used to pull the repo_url, local_path, + and hash properties for this external from the .gitmodules file in + this repository. Note that the section name (the entry in square + brackets) must match the name in the .gitmodules file. + If from_submodule is True, the protocol must be git and no repo_url, + local_path, hash, branch, or tag entries are allowed. + Default: False + + * sparse (string) : used to control a sparse checkout. This optional + entry should point to a filename (path relative to local_path) that + contains instructions on which repository paths to include (or + exclude) from the working tree. + See the "SPARSE CHECKOUT" section of https://git-scm.com/docs/git-read-tree + Default: sparse checkout is disabled + * Lines begining with '#' or ';' are comments and will be ignored. # Obtaining this tool, reporting issues, etc. diff --git a/README.rst b/README.rst deleted file mode 100644 index 6569f5f809..0000000000 --- a/README.rst +++ /dev/null @@ -1,31 +0,0 @@ -==== -CTSM -==== - -The Community Terrestrial Systems Model. - -This includes the Community Land Model (CLM5.0 and CLM4.5) of the Community Earth System Model. - -For documentation, quick start, diagnostics, model output and -references, see - -http://www.cesm.ucar.edu/models/cesm2.0/land/ - -and - -https://escomp.github.io/ctsm-docs/ - -For help with how to work with CTSM in git, see - -https://github.com/ESCOMP/ctsm/wiki/Getting-started-with-CTSM-in-git - -and - -https://github.com/ESCOMP/ctsm/wiki/Recommended-git-setup - -To get updates on CTSM tags and important notes on CTSM developments -join our low traffic email list: - -https://groups.google.com/a/ucar.edu/forum/#!forum/ctsm-dev - -(Send email to ctsm-software@ucar.edu if you have problems with any of this) diff --git a/README_EXTERNALS.rst b/README_EXTERNALS.rst deleted file mode 100644 index 82496dca62..0000000000 --- a/README_EXTERNALS.rst +++ /dev/null @@ -1,124 +0,0 @@ -Obtaining the full model code and associated scripting infrastructure -===================================================================== - -CTSM is released via GitHub. You will need some familiarity with git in order -to modify the code and commit these changes. However, to simply checkout and run the -code, no git knowledge is required other than what is documented in the following steps. - -To obtain the CTSM code you need to do the following: - -#. Clone the repository. :: - - git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox - - This will create a directory ``my_ctsm_sandbox/`` in your current working directory. - -#. Run the script **manage_externals/checkout_externals**. :: - - ./manage_externals/checkout_externals - - The **checkout_externals** script is a package manager that will - populate the ctsm directory with the relevant versions of each of the - components along with the CIME infrastructure code. - -At this point you have a working version of CTSM. - -To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ . - -More details on checkout_externals ----------------------------------- - -The file **Externals.cfg** in your top-level CTSM directory tells -**checkout_externals** which tag/branch of each component should be -brought in to generate your sandbox. (This file serves the same purpose -as SVN_EXTERNAL_DIRECTORIES when CLM was in a subversion repository.) - -NOTE: Just like svn externals, checkout_externals will always attempt -to make the working copy exactly match the externals description. If -you manually modify an external without updating Externals.cfg, e.g. switch -to a different tag, then rerunning checkout_externals will switch you -back to the external described in Externals.cfg. See below -documentation `Customizing your CTSM sandbox`_ for more details. - -**You need to rerun checkout_externals whenever Externals.cfg has -changed** (unless you have already manually updated the relevant -external(s) to have the correct branch/tag checked out). Common times -when this is needed are: - -* After checking out a new CTSM branch/tag - -* After merging some other CTSM branch/tag into your currently - checked-out branch - -**checkout_externals** must be run from the root of the source -tree. For example, if you cloned CTSM with:: - - git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox - -then you must run **checkout_externals** from -``/path/to/my_ctsm_sandbox``. - -To see more details of **checkout_externals**, issue :: - - ./manage_externals/checkout_externals --help - -Customizing your CTSM sandbox -============================= - -There are several use cases to consider when you want to customize or modify your CTSM sandbox. - -Switching to a different CTSM branch or tag -------------------------------------------- - -If you have already checked out a branch or tag and **HAVE NOT MADE ANY -MODIFICATIONS** it is simple to change your sandbox. Say that you -checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; -you would simply do the following:: - - git checkout ctsm1.1.0 - ./manage_externals/checkout_externals - -You should **not** use this method if you have made any source code -changes, or if you have any ongoing CTSM cases that were created from -this sandbox. In these cases, it is often easiest to do a second **git -clone**. - -Pointing to a different version of a component ----------------------------------------------- - -Each entry in **Externals.cfg** has the following form (we use CIME as an -example below):: - - [cime] - local_path = cime - protocol = git - repo_url = https://github.com/CESM-Development/cime - tag = cime5.4.0-alpha.20 - required = True - -Each entry specifies either a tag or a branch. To point to a new tag: - -#. Modify the relevant entry/entries in **Externals.cfg** (e.g., changing - ``cime5.4.0-alpha.20`` to ``cime5.4.0-alpha.21`` above) - -#. Checkout the new component(s):: - - ./manage_externals/checkout_externals - -Keep in mind that changing individual components from a tag may result -in an invalid model (won't compile, won't run, not scientifically -meaningful) and is unsupported. - -Committing your change to Externals.cfg -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After making this change, it's a good idea to commit the change in your -local CTSM git repository. First create a branch in your local -repository, then commit it. (Unlike with subversion, branches are stored -locally unless you explicitly push them up to GitHub. Feel free to -create whatever local branches you'd like.) For example:: - - git checkout -b my_ctsm_branch - git add Externals.cfg - git commit -m "Update CIME to cime5.4.0-alpha.20" - diff --git a/manage_externals/README_FIRST b/README_FIRST similarity index 100% rename from manage_externals/README_FIRST rename to README_FIRST diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm deleted file mode 100755 index 89295242cf..0000000000 --- a/bld/CLMBuildNamelist.pm +++ /dev/null @@ -1,4505 +0,0 @@ -# build-namelist -# -# This script builds the namelists for CLM -# -# The simplest use of build-namelist is to execute it from the build directory where configure -# was run. By default it will use the config_cache.xml file that was written by configure to -# determine the build time properties of the executable, and will write the files that contain -# the output namelists in that same directory. But if multiple runs are to made using the -# same executable, successive invocations of build-namelist will overwrite previously generated -# namelist files. So generally the best strategy is to invoke build-namelist from the run -# directory and use the -config option to provide the filepath of the config_cache.xml file. -# -# -# Date Contributor Modification -# ------------------------------------------------------------------------------------------- -# 2009-01-20 Vertenstein Original version -# 2010-04-27 Kluzek Add ndep streams capability -# 2011-07-25 Kluzek Add multiple ensemble's of namelists -# 2012-03-23 Kluzek Add megan namelist and do checking on it -# 2012-07-01 Kluzek Add some common CESM namelist options -# 2013-12 Andre Refactor everything into subroutines -# 2013-12 Muszala Add Ecosystem Demography functionality -#-------------------------------------------------------------------------------------------- - -package CLMBuildNamelist; - -require 5; - -use strict; -#use warnings; -#use diagnostics; - -use Cwd qw(getcwd abs_path); -use File::Basename qw(dirname); -use English; -use Getopt::Long; -use IO::File; -use File::Glob ':glob'; - -#------------------------------------------------------------------------------- -# -# Define a small number of global variables -# -#------------------------------------------------------------------------------- - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; -$ProgName = "CLM " . "$ProgName"; - -my $cwd = abs_path(getcwd()); # absolute path of the current working directory -my $log; # Log messages object -- will be set in main, declaring it global here means it can be used everywhere - -#------------------------------------------------------------------------------- - -sub usage { - die < Glacier number of elevation classes [0 | 3 | 5 | 10 | 36] - (default is 0) (standard option with land-ice model is 10) - -help [or -h] Print usage to STDOUT. - -light_res Resolution of lightning dataset to use for CN fire (hcru or T62) - -ignore_ic_date Ignore the date on the initial condition files - when determining what input initial condition file to use. - -ignore_ic_year Ignore just the year part of the date on the initial condition files - when determining what input initial condition file to use. - -ignore_warnings Allow build-namelist to continue, rather than stopping on - warnings - -infile "filepath" Specify a file (or list of files) containing namelists to - read values from. - - If used with a CLM build with multiple ensembles (ninst_lnd>1) - and the filename entered is a directory to files of the - form filepath/filepath and filepath/filepath_\$n where \$n - is the ensemble member number. the "filepath/filepath" - input namelist file is the master input namelist file - that is applied to ALL ensemble members. - - (by default for CESM this is setup for files of the - form \$CASEDIR/user_nl_clm/user_nl_clm_????) - -inputdata "filepath" Writes out a list containing pathnames for required input datasets in - file specified. - -irrig "value" If .true. week surface datasets with irrigation turned on. (only allowed for CLM4.0 physics) - Default: .false. - (for CLM4.5/CLM5.0 physics set the namelist flag irrigate=.true.) - -l_ncpl "LND_NCPL" Number of CLM coupling time-steps in a day. - -lnd_tuning_mode "value" Use the parameters tuned for the given configuration (CLM version and atmospheric forcing) - -mask "landmask" Type of land-mask (default, navy, gx3v5, gx1v5 etc.) - "-mask list" to list valid land masks. - -namelist "namelist" Specify namelist settings directly on the commandline by supplying - a string containing FORTRAN namelist syntax, e.g., - -namelist "&clm_inparm dt=1800 /" - -no-megan DO NOT PRODUCE a megan_emis_nl namelist that will go into the - "drv_flds_in" file for the driver to pass VOCs to the atm. - MEGAN (Model of Emissions of Gases and Aerosols from Nature) - (Note: buildnml copies the file for use by the driver) - -[no-]note Add note to output namelist [do NOT add note] about the - arguments to build-namelist. - -output_reals Output real parameters to the given output file. - -rcp "value" Representative concentration pathway (rcp) to use for - future scenarios. - "-rcp list" to list valid rcp settings. - -s Turns on silent mode - only fatal messages issued. - -test Enable checking that input datasets exist on local filesystem. - -use_case "case" Specify a use case which will provide default values. - "-use_case list" to list valid use-cases. - -verbose [or -v] Turn on verbose echoing of informational messages. - -version Echo the SVN tag name used to check out this CLM distribution. - -vichydro Toggle to turn on VIC hydrologic parameterizations (default is off) - This turns on the namelist variable: use_vichydro - - -Note: The precedence for setting the values of namelist variables is (highest to lowest): - 0. namelist values set by specific command-line options, like, -d, -sim_year - (i.e. compset choice and CLM_BLDNML_OPTS, CLM_ACCELERATED_SPINUP, LND_TUNING_MODE env_run variables) - (NOTE: If you try to contradict these settings by methods below, an error will be triggered) - 1. values set on the command-line using the -namelist option, - (i.e. CLM_NAMELIST_OPTS env_run variable) - 2. values read from the file(s) specified by -infile, - (i.e. user_nl_clm files) - 3. datasets from the -clm_usr_name option, - (i.e. CLM_USRDAT_NAME env_run variable) - 4. values set from a use-case scenario, e.g., -use_case - (i.e. CLM_NML_USE_CASE env_run variable) - 5. values from the namelist defaults file. -EOF -} - -#------------------------------------------------------------------------------- - -sub process_commandline { - # Process command-line options and return the hash - my ($nl_flags) = @_; - - # Save the command line arguments to the script. NOTE: this must be - # before GetOptions() is called because items are removed from from - # the array! - $nl_flags->{'cmdline'} = "@ARGV"; - - my %opts = ( cimeroot => undef, - config => "config_cache.xml", - csmdata => undef, - clm_usr_name => undef, - co2_type => undef, - co2_ppmv => undef, - clm_demand => "null", - help => 0, - glc_nec => "default", - light_res => "default", - l_ncpl => undef, - lnd_tuning_mode => "default", - lnd_frac => undef, - dir => "$cwd", - rcp => "default", - sim_year => "default", - clm_accelerated_spinup=> "default", - chk_res => undef, - note => undef, - drydep => 0, - output_reals_filename => undef, - fire_emis => 0, - megan => "default", - irrig => "default", - res => "default", - silent => 0, - ignore_warnings => 0, - mask => "default", - test => 0, - bgc => "default", - crop => 0, - dynamic_vegetation => 0, - envxml_dir => ".", - vichydro => 0, - maxpft => "default", - ); - - GetOptions( - "cimeroot=s" => \$opts{'cimeroot'}, - "clm_demand=s" => \$opts{'clm_demand'}, - "co2_ppmv=f" => \$opts{'co2_ppmv'}, - "co2_type=s" => \$opts{'co2_type'}, - "config=s" => \$opts{'config'}, - "csmdata=s" => \$opts{'csmdata'}, - "clm_usr_name=s" => \$opts{'clm_usr_name'}, - "envxml_dir=s" => \$opts{'envxml_dir'}, - "drydep!" => \$opts{'drydep'}, - "fire_emis!" => \$opts{'fire_emis'}, - "ignore_warnings!" => \$opts{'ignore_warnings'}, - "chk_res!" => \$opts{'chk_res'}, - "note!" => \$opts{'note'}, - "megan!" => \$opts{'megan'}, - "glc_nec=i" => \$opts{'glc_nec'}, - "light_res=s" => \$opts{'light_res'}, - "irrig=s" => \$opts{'irrig'}, - "d:s" => \$opts{'dir'}, - "h|help" => \$opts{'help'}, - "ignore_ic_date" => \$opts{'ignore_ic_date'}, - "ignore_ic_year" => \$opts{'ignore_ic_year'}, - "infile=s" => \$opts{'infile'}, - "lnd_frac=s" => \$opts{'lnd_frac'}, - "lnd_tuning_mode=s" => \$opts{'lnd_tuning_mode'}, - "l_ncpl=i" => \$opts{'l_ncpl'}, - "inputdata=s" => \$opts{'inputdata'}, - "mask=s" => \$opts{'mask'}, - "namelist=s" => \$opts{'namelist'}, - "res=s" => \$opts{'res'}, - "rcp=s" => \$opts{'rcp'}, - "s|silent" => \$opts{'silent'}, - "sim_year=s" => \$opts{'sim_year'}, - "output_reals=s" => \$opts{'output_reals_filename'}, - "clm_accelerated_spinup=s" => \$opts{'clm_accelerated_spinup'}, - "clm_start_type=s" => \$opts{'clm_start_type'}, - "test" => \$opts{'test'}, - "use_case=s" => \$opts{'use_case'}, - "bgc=s" => \$opts{'bgc'}, - "crop!" => \$opts{'crop'}, - "dynamic_vegetation" => \$opts{'dynamic_vegetation'}, - "vichydro" => \$opts{'vichydro'}, - "maxpft=i" => \$opts{'maxpft'}, - "v|verbose" => \$opts{'verbose'}, - "version" => \$opts{'version'}, - ) or usage(); - - # Give usage message. - usage() if $opts{'help'}; - - # Check for unparsed arguments - if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); - } - return %opts; -} - -#------------------------------------------------------------------------------- - -sub check_for_perl_utils { - - my $cfgdir = shift; - my $opts_ref = shift; - - # Determine CIME root directory and perl5lib root directory - my $cimeroot = $opts_ref->{'cimeroot'}; - if ( ! defined($cimeroot) ) { - $cimeroot = "$cfgdir/../cime"; - if ( -d $cimeroot ) { - } elsif ( -d "$cfgdir/../../../cime" ) { - $cimeroot = "$cfgdir/../../../cime"; - } else { - die <<"EOF"; -** Cannot find the root of the cime directory enter it using the -cimeroot option - Did you run the checkout_externals scripts? -EOF - } - } - - my $perl5lib_dir = "$cimeroot/utils/perl5lib"; - - #----------------------------------------------------------------------------- - # Add $perl5lib_dir to the list of paths that Perl searches for modules - my @dirs = ( $ProgDir, $cfgdir, "$perl5lib_dir"); - unshift @INC, @dirs; - - require config_files::clm_phys_vers; - require namelist_files::LogMessages; - - my $locallog = namelist_files::LogMessages->new( $ProgName, $opts_ref ); - # The XML::Lite module is required to parse the XML files. - (-f "$perl5lib_dir/XML/Lite.pm") or - $locallog->fatal_error("Cannot find perl module \"XML/Lite.pm\" in directory\n" . - "\"$perl5lib_dir\""); - - # The Build::Config module provides utilities to access the configuration information - # in the config_cache.xml file - (-f "$perl5lib_dir/Build/Config.pm") or - $locallog->fatal_error("Cannot find perl module \"Build/Config.pm\" in directory\n" . - "\"$perl5lib_dir\""); - - # The Build::NamelistDefinition module provides utilities to validate that the output - # namelists are consistent with the namelist definition file - (-f "$perl5lib_dir/Build/NamelistDefinition.pm") or - $locallog->fatal_error("Cannot find perl module \"Build/NamelistDefinition.pm\" in directory\n" . - "\"$perl5lib_dir\""); - - # The Build::NamelistDefaults module provides a utility to obtain default values of namelist - # variables based on finding a best fit with the attributes specified in the defaults file. - (-f "$perl5lib_dir/Build/NamelistDefaults.pm") or - $locallog->fatal_error("Cannot find perl module \"Build/NamelistDefaults.pm\" in directory\n" . - "\"$perl5lib_dir\""); - - # The Build::Namelist module provides utilities to parse input namelists, to query and modify - # namelists, and to write output namelists. - (-f "$perl5lib_dir/Build/Namelist.pm") or - $locallog->fatal_error("Cannot find perl module \"Build/Namelist.pm\" in directory\n" . - "\"$perl5lib_dir\""); - - - # required cesm perl modules - require XML::Lite; - require Build::Config; - require Build::NamelistDefinition; - require Build::NamelistDefaults; - require Build::Namelist; - require Config::SetupTools; -} - -#------------------------------------------------------------------------------- - -sub read_configure_definition { - # Read the configure definition and specific config_cache file for this case - # configure are the build-time settings for CLM - my ($cfgdir, $opts) = @_; - - $log->verbose_message("Setting CLM configuration script directory to $cfgdir"); - - # Create a configuration object from the default config_definition file - my $configfile; - if ( -f $opts->{'config'} ) { - $configfile = $opts->{'config'}; - } else { - $configfile = "$cfgdir/config_files/config_definition.xml"; - } - - # Check that configuration cache file exists. - $log->verbose_message("Using CLM configuration cache file $opts->{'config'}"); - if ( $configfile ne $opts->{'config'} ) { - $log->fatal_error("Cannot find configuration cache file: \"$opts->{'config'}\""); - } - - my $cfg = Build::Config->new("$configfile"); - - return $cfg; -} - -#----------------------------------------------------------------------------------------------- - -sub read_namelist_definition { - my ($cfgdir, $opts, $nl_flags, $physv) = @_; - - # The namelist definition file contains entries for all namelist - # variables that can be output by build-namelist. - my $phys = $physv->as_filename( ); - my @nl_definition_files = ( "$cfgdir/namelist_files/namelist_definition_drv.xml", - "$cfgdir/namelist_files/namelist_definition_drv_flds.xml", - "$cfgdir/namelist_files/namelist_definition_$phys.xml" ); - foreach my $nl_defin_file ( @nl_definition_files ) { - (-f "$nl_defin_file") or $log->fatal_error("Cannot find namelist definition file \"$nl_defin_file\""); - - $log->verbose_message("Using namelist definition file $nl_defin_file"); - } - - # Create a namelist definition object. This object provides a - # method for verifying that the output namelist variables are in the - # definition file, and are output in the correct namelist groups. - my $definition = Build::NamelistDefinition->new( shift(@nl_definition_files) ); - foreach my $nl_defin_file ( @nl_definition_files ) { - $definition->add( "$nl_defin_file" ); - } - - return $definition; -} - -#----------------------------------------------------------------------------------------------- - -sub read_envxml_case_files { - # read the contents of the env*.xml files in the case directory - my ($opts) = @_; - - my %envxml = (); - if ( defined($opts->{'envxml_dir'}) ) { - (-d $opts->{'envxml_dir'}) or $log->fatal_error( "envxml_dir is not a directory" ); - my @files = glob( $opts->{'envxml_dir'}."/env_*xml" ); - ($#files >= 0) or $log->fatal_error( "there are no env_*xml files in the envxml_dir" ); - foreach my $file (@files) { - $log->verbose_message( "Open env.xml file: $file" ); - my $xml = XML::Lite->new( "$file" ); - my @e = $xml->elements_by_name('entry'); - while ( my $e = shift @e ) { - my %a = $e->get_attributes(); - $envxml{$a{'id'}} = $a{'value'}; - } - } - foreach my $attr (keys %envxml) { - if ( $envxml{$attr} =~ m/\$/ ) { - $envxml{$attr} = SetupTools::expand_xml_var( $envxml{$attr}, \%envxml ); - } - } - } else { - $log->fatal_error( "The -envxml_dir option was NOT given and it is a REQUIRED option" ); - } - return( %envxml ); -} - -#----------------------------------------------------------------------------------------------- - -sub read_namelist_defaults { - my ($cfgdir, $opts, $nl_flags, $cfg, $physv) = @_; - - my $phys = $physv->as_filename( ); - # The namelist defaults file contains default values for all required namelist variables. - my @nl_defaults_files = ( "$cfgdir/namelist_files/namelist_defaults_overall.xml", - "$cfgdir/namelist_files/namelist_defaults_$phys.xml", - "$cfgdir/namelist_files/namelist_defaults_drv.xml", - "$cfgdir/namelist_files/namelist_defaults_fire_emis.xml", - "$cfgdir/namelist_files/namelist_defaults_drydep.xml" ); - - # Add the location of the use case defaults files to the options hash - $opts->{'use_case_dir'} = "$cfgdir/namelist_files/use_cases"; - - if (defined $opts->{'use_case'}) { - if ( $opts->{'use_case'} ne "list" ) { - unshift( @nl_defaults_files, "$opts->{'use_case_dir'}/$opts->{'use_case'}.xml" ); - } - } - - foreach my $nl_defaults_file ( @nl_defaults_files ) { - (-f "$nl_defaults_file") or $log->fatal_error("Cannot find namelist defaults file \"$nl_defaults_file\""); - - $log->verbose_message("Using namelist defaults file $nl_defaults_file"); - } - - # Create a namelist defaults object. This object provides default - # values for variables contained in the input defaults file. The - # configuration object provides attribute values that are relevent - # for the CLM executable for which the namelist is being produced. - my $defaults = Build::NamelistDefaults->new( shift( @nl_defaults_files ), $cfg); - foreach my $nl_defaults_file ( @nl_defaults_files ) { - $defaults->add( "$nl_defaults_file" ); - } - return $defaults; -} - -#------------------------------------------------------------------------------- - -sub check_cesm_inputdata { - # Check that the CESM inputdata root directory has been specified. This must be - # a local or nfs mounted directory. - - my ($opts, $nl_flags) = @_; - - $nl_flags->{'inputdata_rootdir'} = undef; - if (defined($opts->{'csmdata'})) { - $nl_flags->{'inputdata_rootdir'} = $opts->{'csmdata'}; - } - elsif (defined $ENV{'CSMDATA'}) { - $nl_flags->{'inputdata_rootdir'} = $ENV{'CSMDATA'}; - } - else { - $log->fatal_error("CESM inputdata root directory must be specified by either -csmdata\n" . - "argument or by the CSMDATA environment variable."); - } - if ( ! defined($ENV{'DIN_LOC_ROOT'}) ) { - $ENV{'DIN_LOC_ROOT'} = $nl_flags->{'inputdata_rootdir'}; - } - - if ($opts->{'test'}) { - (-d $nl_flags->{'inputdata_rootdir'}) or $log->fatal_error("CESM inputdata root is not a directory: \"$nl_flags->{'inputdata_rootdir'}\""); - } - - $log->verbose_message("CESM inputdata root directory: $nl_flags->{'inputdata_rootdir'}"); -} - -#------------------------------------------------------------------------------- - -sub process_namelist_user_input { - # Process the user input in general by order of precedence. At each point - # we'll only add new values to the namelist and not overwrite - # previously specified specified values which have higher - # precedence. The one exception to this rule are the specifc command-line - # options which are done last as if the user contradicts these settings - # CLM build-namelist will abort with an error. - # - # 1. values set on the command-line using the -namelist option, - # (i.e. CLM_NAMELIST_OPTS env_run variable) - # 2. values read from the file(s) specified by -infile, - # (i.e. user_nl_clm files) - # After the above are done the command line options are processed and they - # are made sure the user hasn't contradicted any of their settings with - # anything above. Because of this they are condsidered to have the highest - # precedence. - # 0. namelist values set by specific command-line options, like, -d, -sim_year - # (i.e. CLM_BLDNML_OPTS env_run variable) - # The results of these are needed for the final two user input - # 3. datasets from the -clm_usr_name option, - # (i.e. CLM_USRDAT_NAME env_run variable) - # 4. values set from a use-case scenario, e.g., -use_case - # (i.e. CLM_NML_USE_CASE env_run variable) - # - # Finally after all the above is done, the defaults are found from the - # namelist defaults file (outside of this routine). - # - - - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_; - - # Get the inputs that will be coming from the user... - process_namelist_commandline_namelist($opts, $definition, $nl, $envxml_ref); - process_namelist_commandline_infile($opts, $definition, $nl, $envxml_ref); - - # Apply the commandline options and make sure the user didn't change it above - process_namelist_commandline_options($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - - # The last two process command line arguments for usr_name and use_case - # They require that process_namelist_commandline_options was called before this - process_namelist_commandline_clm_usr_name($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref); - process_namelist_commandline_use_case($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv); - - # Set the start_type by the command line setting for clm_start_type - process_namelist_commandline_clm_start_type($opts, $nl_flags, $definition, $defaults, $nl); - -} - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_options { - # First process the commandline args that provide specific namelist values. - # - # First get the command-line specified overall values or their defaults - # Obtain default values for the following build-namelist input arguments - # : res, mask, rcp, sim_year, sim_year_range, and clm_accelerated_spinup. - # - # NOTE: cfg only needs to be passed to functions that work with - # clm4_0 compile time functionality! - - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - setup_cmdl_chk_res($opts, $defaults); - setup_cmdl_resolution($opts, $nl_flags, $definition, $defaults); - setup_cmdl_mask($opts, $nl_flags, $definition, $defaults, $nl); - setup_cmdl_bgc($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - setup_cmdl_fire_light_res($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - setup_cmdl_spinup($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - setup_cmdl_crop($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - setup_cmdl_maxpft($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv); - setup_cmdl_glc_nec($opts, $nl_flags, $definition, $defaults, $nl); - setup_cmdl_irrigation($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_cmdl_rcp($opts, $nl_flags, $definition, $defaults, $nl); - setup_cmdl_simulation_year($opts, $nl_flags, $definition, $defaults, $nl); - setup_cmdl_dynamic_vegetation($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_cmdl_fates_mode($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_cmdl_vichydro($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_cmdl_run_type($opts, $nl_flags, $definition, $defaults, $nl); - setup_cmdl_output_reals($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_lnd_tuning($opts, $nl_flags, $definition, $defaults, $nl, $physv); -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_chk_res { - my ($opts, $defaults) = @_; - - my $var = "chk_res"; - if ( ! defined($opts->{$var}) ) { - $opts->{$var} = $defaults->get_value($var); - } -} - -sub setup_cmdl_resolution { - my ($opts, $nl_flags, $definition, $defaults) = @_; - - my $var = "res"; - my $val; - - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - $val= $defaults->get_value($var); - } - - $nl_flags->{'res'} = $val; - $log->verbose_message("CLM atm resolution is $nl_flags->{'res'}"); - $opts->{$var} = $val; - if ( $opts->{'chk_res'} ) { - $val = "e_string( $nl_flags->{'res'} ); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - if ( ! defined($opts->{'clm_usr_name'}) || $nl_flags->{'res'} ne $opts->{'clm_usr_name'} ) { - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_mask { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $var = "mask"; - my $val; - - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - my %tmp = ( 'hgrid'=>$nl_flags->{'res'} ); - $val = $defaults->get_value($var, \%tmp ); - } - - $nl_flags->{'mask'} = $val; - $opts->{'mask'} = $nl_flags->{'mask'}; - if ( $opts->{'chk_res'} ) { - $val = "e_string( $val ); - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - $log->verbose_message("CLM land mask is $nl_flags->{'mask'}"); -} - -#------------------------------------------------------------------------------- -sub setup_cmdl_fates_mode { - # - # call this at least after crop check is called - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $val; - my $var = "bgc_mode"; - - if ( $physv->as_long() == $physv->as_long("clm4_0") || $nl_flags->{'crop'} eq "on" ) { - if ( $nl_flags->{$var} eq "fates" ) { - # ED is not a clm4_0 option and should not be used with crop and not with clm4_0 - $log->fatal_error("** Cannot turn fates mode on with crop or with clm4_0 physics." ); - } - } elsif ($nl_flags->{"bgc_mode"} eq "fates" && ! &value_is_true($nl_flags->{"use_fates"}) ) { - $log->fatal_error("DEV_ERROR: internal logic error: bgc_mode = fates and use_fates = false."); - - } else { - - $var = "use_fates"; - if ( &value_is_true($nl_flags->{$var}) ) { - # This section is a place-holder to test for modules that are not allowed with ED - # the defaults which are set in the logic section of the namelist builder will - # automatically set these correctly (well that is the assumption), but here we - # want to set a catch to fail and warn users if they explicitly set incompatible user namelist - # options - -# my $var = "use_somevar"; -# $val = $nl_flags->{$var}; -# if ( defined($nl->get_value($var)) ) { -# if ( &value_is_true($nl->get_value($var)) ) { -# $log->fatal_error("$var was set to .true., which is incompatible when -bgc fates option is used."); -# } -# } - - - # The following variables may be set by the user and are compatible with use_fates - # no need to set defaults, covered in a different routine - my @list = ( "use_vertsoilc", "use_century_decomp", "use_lch4" ); - foreach my $var ( @list ) { - if ( defined($nl->get_value($var)) ) { - $nl_flags->{$var} = $nl->get_value($var); - $val = $nl_flags->{$var}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - } - } else { - # dis-allow fates specific namelist items with non-fates runs - my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init", "fates_inventory_ctrl_filename","use_fates_logging" ); - foreach my $var ( @list ) { - if ( defined($nl->get_value($var)) ) { - $log->fatal_error("$var is being set, but can ONLY be set when -bgc fates option is used.\n"); - } - } - } - } -} - -#------------------------------------------------------------------------------- -sub setup_cmdl_bgc { - # BGC - alias for group of biogeochemistry related use_XXX namelists - - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - my $val; - my $var = "bgc"; - - $val = $opts->{$var}; - $nl_flags->{'bgc_mode'} = $val; - - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - if ( $nl_flags->{'bgc_mode'} ne "default" ) { - $log->fatal_error("-bgc option used with clm4_0 physics. -bgc can ONLY be used with clm4_5/clm5_0 physics"); - } - $nl_flags->{'bgc_mode'} = $cfg->get($var); - } else { - my $var = "bgc_mode"; - if ( $nl_flags->{$var} eq "default" ) { - $nl_flags->{$var} = $defaults->get_value($var); - } - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string( $nl_flags->{$var} ) ); - if ( ! $definition->is_valid_value( $var, quote_string( $nl_flags->{$var}) ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value (".$nl_flags->{$var}.") that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("Using $nl_flags->{$var} for bgc."); - - # now set the actual name list variables based on the bgc alias - if ($nl_flags->{$var} eq "cn" ) { - $nl_flags->{'use_cn'} = ".true."; - $nl_flags->{'use_fates'} = ".false."; - } elsif ($nl_flags->{$var} eq "bgc" ) { - $nl_flags->{'use_cn'} = ".true."; - $nl_flags->{'use_fates'} = ".false."; - } elsif ($nl_flags->{$var} eq "fates" ) { - $nl_flags->{'use_cn'} = ".false."; - $nl_flags->{'use_fates'} = ".true."; - } else { - $nl_flags->{'use_cn'} = ".false."; - $nl_flags->{'use_fates'} = ".false."; - } - if ( defined($nl->get_value("use_cn")) && ($nl_flags->{'use_cn'} ne $nl->get_value("use_cn")) ) { - $log->fatal_error("The namelist variable use_cn is inconsistent with the -bgc option"); - } - if ( defined($nl->get_value("use_fates")) && ($nl_flags->{'use_fates'} ne $nl->get_value("use_fates")) ) { - $log->fatal_error("The namelist variable use_fates is inconsistent with the -bgc option"); - } - - { - # If the variable has already been set use it, if not set to the value defined by the bgc_mode - my @list = ( "use_lch4", "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp" ); - my $ndiff = 0; - my %settings = ( 'bgc_mode'=>$nl_flags->{'bgc_mode'} ); - foreach my $var ( @list ) { - my $default_setting = $defaults->get_value($var, \%settings ); - if ( ! defined($nl->get_value($var)) ) { - $nl_flags->{$var} = $default_setting; - } else { - if ( $nl->get_value($var) ne $default_setting ) { - $ndiff += 1; - } - $nl_flags->{$var} = $nl->get_value($var); - } - $val = $nl_flags->{$var}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - # If all the variables are different report it as an error - if ( $ndiff == ($#list + 1) ) { - $log->fatal_error("You are contradicting the -bgc setting with the namelist variables: @list" ); - } - } - - # Now set use_cn and use_fates - foreach $var ( "use_cn", "use_fates" ) { - $val = $nl_flags->{$var}; - $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - } - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - my $var = "use_fun"; - if ( ! defined($nl->get_value($var)) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, - 'use_nitrif_denitrif'=>$nl_flags->{'use_nitrif_denitrif'} ); - } - if ( (! &value_is_true($nl_flags->{'use_nitrif_denitrif'}) ) && &value_is_true($nl->get_value('use_fun')) ) { - $log->fatal_error("When FUN is on, use_nitrif_denitrif MUST also be on!"); - } - } -} # end bgc - - -#------------------------------------------------------------------------------- -sub setup_cmdl_fire_light_res { - # light_res - alias for lightning resolution - - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - my $var = "light_res"; - my $val = $opts->{$var}; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - if ( $val !~ /default|none/ ) { - $log->fatal_error("-$var option used with clm4_0 physics. -$var can ONLY be used with clm4_5/clm5_0 physics"); - } - } else { - if ( $val eq "default" ) { - $nl_flags->{$var} = remove_leading_and_trailing_quotes($defaults->get_value($var)); - } else { - my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') ); - if ( defined($fire_method) && $val ne "none" ) { - if ( $fire_method eq "nofire" ) { - $log->fatal_error("-$var option used with fire_method='nofire'. -$var can ONLY be used without the nofire option"); - } - } - my $stream_fldfilename_lightng = remove_leading_and_trailing_quotes( $nl->get_value('stream_fldfilename_lightng') ); - if ( defined($stream_fldfilename_lightng) && $val ne "none" ) { - $log->fatal_error("-$var option used while also explicitly setting stream_fldfilename_lightng filename which is a contradiction. Use one or the other not both."); - } - if ( ! &value_is_true($nl->get_value('use_cn')) ) { - $log->fatal_error("-$var option used CN is NOT on. -$var can only be used when CN is on (with bgc: cn or bgc)"); - } - if ( &value_is_true($nl->get_value('use_cn')) && $val eq "none" ) { - $log->fatal_error("-$var option is set to none, but CN is on (with bgc: cn or bgc) which is a contradiction"); - } - $nl_flags->{$var} = $val; - } - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string($nl_flags->{$var}) ); - if ( ! $definition->is_valid_value( $var, $nl_flags->{$var}, 'noquotes'=>1 ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value (".$nl_flags->{$var}.") that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("Using $nl_flags->{$var} for $var."); - # - # Set flag if cn-fires are on or not - # - $var = "cnfireson"; - if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl->get_value('use_cn')) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_method'); - } - my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') ); - if ( defined($fire_method) && ! &value_is_true($nl_flags->{'use_cn'}) ) { - $log->fatal_error("fire_method is being set even though bgc is NOT cn or bgc."); - } - if ( defined($fire_method) && $fire_method eq "nofire" ) { - $nl_flags->{$var} = ".false."; - } elsif ( &value_is_true($nl->get_value('use_cn')) ) { - $nl_flags->{$var} = ".true."; - } else { - $nl_flags->{$var} = ".false."; - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_crop { - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - $nl_flags->{'use_crop'} = ".false."; - my $val; - my $var = "crop"; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - $nl_flags->{'crop'} = $cfg->get($var); - if ( $nl_flags->{'crop'} eq "on" ) { - $nl_flags->{'use_crop'} = ".true."; - } - } else { - $val = $opts->{$var}; - $nl_flags->{'crop'} = $val; - if ( $nl_flags->{'crop'} eq 1 ) { - $nl_flags->{'use_crop'} = ".true."; - } - if ( defined($nl->get_value("use_crop")) && ($nl_flags->{'use_crop'} ne $nl->get_value("use_crop")) ) { - $log->fatal_error("Namelist item use_crop contradicts the command-line option -crop, use the command line option"); - } - if ( ($nl_flags->{'crop'} eq 1 ) && ($nl_flags->{'bgc_mode'} eq "sp") ) { - $log->fatal_error("** Cannot turn crop mode on mode bgc=sp\n" . - "**\n" . - "** Set the bgc mode to 'cn' or 'bgc' by the following means from highest to lowest precedence:\n" . - "** * by the command-line options -bgc cn\n" . - "** * by a default configuration file, specified by -defaults"); - } - - $var = "use_crop"; - $val = ".false."; - if ($nl_flags->{'crop'} eq 1) { - $val = ".true."; - } - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_maxpft { - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - my $val; - my $var = "maxpft"; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - $nl_flags->{'maxpft'} = $cfg->get($var); - # NOTE: maxpatchpft sizes already checked for clm4_0 by configure. - } else { - my %maxpatchpft; - $maxpatchpft{'.true.'} = 79; - $maxpatchpft{'.false.'} = 17; - if ( $opts->{$var} ne "default") { - $val = $opts->{$var}; - } else { - $val = $maxpatchpft{$nl_flags->{'use_crop'}}; - } - $nl_flags->{'maxpft'} = $val; - - if ( ($nl_flags->{'bgc_mode'} ne "sp") && ($nl_flags->{'maxpft'} != $maxpatchpft{$nl_flags->{'use_crop'}}) ) { - $log->fatal_error("** For CN or BGC mode you MUST set max patch PFT's to $maxpatchpft{$nl_flags->{'use_crop'}}\n" . - "**\n" . - "** When the crop model is on then it must be set to $maxpatchpft{'crop'} otherwise to $maxpatchpft{'nocrop'}\n" . - "** Set the bgc mode, crop and maxpft by the following means from highest to lowest precedence:\n" . - "** * by the command-line options -bgc, -crop and -maxpft\n" . - "** * by a default configuration file, specified by -defaults\n" . - "**"); - } - if ( $nl_flags->{'maxpft'} > $maxpatchpft{$nl_flags->{'use_crop'}} ) { - $log->fatal_error("** Max patch PFT's can NOT exceed $maxpatchpft{$nl_flags->{'use_crop'}}\n" . - "**\n" . - "** Set maxpft by the following means from highest to lowest precedence:\n" . - "** * by the command-line options -maxpft\n" . - "** * by a default configuration file, specified by -defaults\n" . - "**"); - } - if ( $nl_flags->{'maxpft'} != $maxpatchpft{$nl_flags->{'use_crop'}} ) { - $log->warning("running with maxpft NOT equal to $maxpatchpft{$nl_flags->{'use_crop'}} is " . - "NOT validated / scientifically supported." ); - } - $log->verbose_message("Using $nl_flags->{'maxpft'} for maxpft."); - - $var = "maxpatch_pft"; - $val = $nl_flags->{'maxpft'}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_glc_nec { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $val; - my $var = "glc_nec"; - - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - $val = $defaults->get_value($var); - } - - $nl_flags->{'glc_nec'} = $val; - $opts->{'glc_nec'} = $val; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("Glacier number of elevation classes is $val"); -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_irrigation { - # Must be after setup_cmdl_crop - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = "irrig"; - - if ( $opts->{$var} eq "default" ) { - my %settings; - $settings{'use_crop'} = $nl_flags->{'use_crop'}; - $nl_flags->{$var} = $defaults->get_value($var, \%settings); - } else { - $nl_flags->{$var} = $opts->{$var}; - } - my $val = $nl_flags->{$var}; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("Irrigation $val"); - if ( &value_is_true($nl_flags->{'irrig'}) && &value_is_true($nl_flags->{'use_crop'}) ) { - $log->fatal_error("You've turned on both irrigation and crop.\n" . - "Irrigation is only applied to generic crop currently,\n" . - "which negates it's practical usage.\n." . - "We also have a known problem when both are on " . - "(see bug 1326 in the components/clm/doc/KnownBugs file)\n" . - "both irrigation and crop can NOT be on."); - } - } elsif ( $opts->{$var} ne "default" ) { - $log->fatal_error("The -irrig option can ONLY be used with clm4_0 physics"); - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_rcp { - # representative concentration pathway - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $val; - my $var = "rcp"; - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - $val = $defaults->get_value($var); - } - $nl_flags->{'rcp'} = $val; - $opts->{'rcp'} = $nl_flags->{'rcp'}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("CLM future scenario representative concentration is $nl_flags->{'rcp'}"); -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_spinup { - # CLM 4.0 --> BGC spinup mode controlled from "spinup" in configure - # CLM 4.5/5.0 --> BGC spinup mode controlled from "clm_accelerated_spinup" in build-namelist - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_; - - my $val; - my $var; - $nl_flags->{'spinup'} = undef; - $var = "clm_accelerated_spinup"; - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - $val = $defaults->get_value($var); - } - $nl_flags->{$var} = $val; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string($val) ); - if ( ! $definition->is_valid_value( $var, $val , 'noquotes' => 1) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has an invalid value ($val). Valid values are: @valid_values"); - } - $log->verbose_message("CLM accelerated spinup mode is $val"); - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - $nl_flags->{'spinup'} = $cfg->get('spinup'); - } elsif ( $physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, - $defaults, $nl, "spinup_state", clm_accelerated_spinup=>$nl_flags->{$var}, - use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'} ); - if ( $nl->get_value("spinup_state") ne 0 ) { - $nl_flags->{'bgc_spinup'} = "on"; - if ( $nl_flags->{'bgc_mode'} eq "sp" ) { - $log->fatal_error("spinup_state is accelerated (=1 or 2) which is for a BGC mode of CN or BGC," . - " but the BGC mode is Satellite Phenology, change one or the other"); - } - if ( $nl_flags->{'clm_accelerated_spinup'} eq "off" ) { - $log->fatal_error("spinup_state is accelerated, but clm_accelerated_spinup is off, change one or the other"); - } - } else { - $nl_flags->{'bgc_spinup'} = "off"; - $val = $defaults->get_value($var); - } - $nl_flags->{$var} = $val; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string($val) ); - if ( ! $definition->is_valid_value( $var, $val , 'noquotes' => 1) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has an invalid value ($val). Valid values are: @valid_values"); - } - if ( $nl_flags->{'bgc_spinup'} eq "on" && (not &value_is_true( $nl_flags->{'use_cn'} )) && (not &value_is_true($nl_flags->{'use_fates'})) ) { - $log->fatal_error("$var can not be '$nl_flags->{'bgc_spinup'}' if neither CN nor ED is turned on (use_cn=$nl_flags->{'use_cn'}, use_fates=$nl_flags->{'use_fates'})."); - } - if ( $nl->get_value("spinup_state") eq 0 && $nl_flags->{'bgc_spinup'} eq "on" ) { - $log->fatal_error("Namelist spinup_state contradicts the command line option bgc_spinup" ); - } - if ( $nl->get_value("spinup_state") eq 1 && $nl_flags->{'bgc_spinup'} eq "off" ) { - $log->fatal_error("Namelist spinup_state contradicts the command line option bgc_spinup" ); - } - } - - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - $val = $nl_flags->{'spinup'}; - } else { - $val = $nl_flags->{'bgc_spinup'}; - } - $log->verbose_message("CLM CN bgc_spinup mode is $val"); -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_simulation_year { - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg) = @_; - - my $val; - my $var = "sim_year"; - if ( $opts->{$var} ne "default" ) { - $val = $opts->{$var}; - } else { - $val = $defaults->get_value($var); - } - - $nl_flags->{'sim_year_range'} = $defaults->get_value("sim_year_range"); - $nl_flags->{'sim_year'} = $val; - if ( $val =~ /([0-9]+)-([0-9]+)/ ) { - $nl_flags->{'sim_year'} = $1; - $nl_flags->{'sim_year_range'} = $val; - } - $val = $nl_flags->{'sim_year'}; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val ); - if ( ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var of $val is NOT valid. Valid values are: @valid_values"); - } - $nl->set_variable_value($group, $var, $val ); - $log->verbose_message("CLM sim_year is $nl_flags->{'sim_year'}"); - - $var = "sim_year_range"; - $val = $nl_flags->{'sim_year_range'}; - if ( $val ne "constant" ) { - $opts->{$var} = $val; - $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val ); - if ( ! $definition->is_valid_value( $var, $val, 'noquotes'=>1 ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var of $val is NOT valid. Valid values are: @valid_values"); - } - $val = "'".$defaults->get_value($var)."'"; - $nl->set_variable_value($group, $var, $val ); - $log->verbose_message("CLM sim_year_range is $nl_flags->{'sim_year_range'}"); - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_run_type { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $val; - my $var = "clm_start_type"; - if (defined $opts->{$var}) { - if ($opts->{$var} eq "default" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'} ); - } else { - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) ); - } - } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'} ); - } - $nl_flags->{'clm_start_type'} = $nl->get_value($var); -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_dynamic_vegetation { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $val; - my $var = "dynamic_vegetation"; - $val = $opts->{$var}; - $nl_flags->{'dynamic_vegetation'} = $val; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - # not applicable - if ( $nl_flags->{'dynamic_vegetation'}eq 1) { - $log->fatal_error("** Turn dynamic_vegetation mode on with CLM_CONFIG_OPTS (-bgc cndv) for clm4_0 physics." ); - } - } else { - if ( ($nl_flags->{'dynamic_vegetation'} eq 1 ) && ($nl_flags->{'bgc_mode'} eq "sp") ) { - $log->fatal_error("** Cannot turn dynamic_vegetation mode on with bgc=sp.\n" . - "**\n" . - "** Set the bgc mode to 'cn' or 'bgc' by the following means from highest to lowest precedence:" . - "** * by the command-line options -bgc cn\n"); - } - - $var = "use_cndv"; - $nl_flags->{$var} = ".false."; - if ($nl_flags->{'dynamic_vegetation'} eq 1) { - $val = ".true."; - $nl_flags->{$var} = $val; - } - if ( defined($nl->get_value($var)) && $nl->get_value($var) ne $val ) { - $log->fatal_error("$var is inconsistent with the commandline setting of -dynamic_vegetation"); - } - if ( &value_is_true($nl_flags->{$var}) ) { - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - if ( ! $definition->is_valid_value( $var, $val ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - } -} -#------------------------------------------------------------------------------- - -sub setup_cmdl_output_reals { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = "output_reals_filename"; - my $file = $opts->{$var}; - if ( defined($file) ) { - # Make sure can open file and if not die with an error - my $fh = IO::File->new($file, '>') or $log->fatal_error("can't create real parameter filename: $file"); - $fh->close(); - } -} - -#------------------------------------------------------------------------------- - -sub setup_cmdl_vichydro { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $val; - my $var = "vichydro"; - $val = $opts->{$var}; - $nl_flags->{'vichydro'} = $val; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - # not relevant in clm4_0 - if ( $nl_flags->{'vichydro'}eq 1) { - $log->fatal_error("** Cannot turn vichydro on with clm4_0 physics." ); - } - } else { - if ($nl_flags->{'vichydro'} eq 1) { - $log->verbose_message("Using VIC hydrology for runoff calculations."); - } - - $var = "use_vichydro"; - $val = $nl->get_value($var); - if ($nl_flags->{'vichydro'} eq 1) { - my $group = $definition->get_group_name($var); - my $set = ".true."; - if ( defined($val) && $set ne $val ) { - $log->fatal_error("$var contradicts the command-line -vichydro option" ); - } - $nl->set_variable_value($group, $var, $set); - if ( ! $definition->is_valid_value($var, $val) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values"); - } - } - } -} - - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_namelist { - # Process the commandline '-namelist' arg. - my ($opts, $definition, $nl, $envxml_ref) = @_; - - if (defined $opts->{'namelist'}) { - # Parse commandline namelist - my $nl_arg = Build::Namelist->new($opts->{'namelist'}); - - # Validate input namelist -- trap exceptions - my $nl_arg_valid; - eval { $nl_arg_valid = $definition->validate($nl_arg); }; - if ($@) { - $log->fatal_error("Invalid namelist variable in commandline arg '-namelist'.\n $@"); - } - # Go through all variables and expand any XML env settings in them - expand_xml_variables_in_namelist( $nl_arg_valid, $envxml_ref ); - - # Merge input values into namelist. Previously specified values have higher precedence - # and are not overwritten. - $nl->merge_nl($nl_arg_valid); - } -} - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_infile { - # Process the commandline '-infile' arg. - my ($opts, $definition, $nl, $envxml_ref) = @_; - - if (defined $opts->{'infile'}) { - my @infiles = split( /,/, $opts->{'infile'} ); - foreach my $infile ( @infiles ) { - # Make sure a valid file was found - if ( -f "$infile" ) { - # Otherwise abort as a valid file doesn't exist - } else { - $log->fatal_error("input namelist file does NOT exist $infile.\n $@"); - } - # Parse namelist input from the next file - my $nl_infile = Build::Namelist->new($infile); - - # Validate input namelist -- trap exceptions - my $nl_infile_valid; - eval { $nl_infile_valid = $definition->validate($nl_infile); }; - if ($@) { - $log->fatal_error("Invalid namelist variable in '-infile' $infile.\n $@"); - } - # Go through all variables and expand any XML env settings in them - expand_xml_variables_in_namelist( $nl_infile_valid, $envxml_ref ); - - # Merge input values into namelist. Previously specified values have higher precedence - # and are not overwritten. - $nl->merge_nl($nl_infile_valid); - } - } -} - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_clm_usr_name { - # Process the -clm_usr_name argument - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref) = @_; - - if (defined $opts->{'clm_usr_name'}) { - # The user files definition is contained in an xml file with the same format as the defaults file. - - # The one difference is that variables are expanded. - # Create a new NamelistDefaults object. - my $nl_defaults_file = "$nl_flags->{'cfgdir'}/namelist_files/namelist_defaults_usr_files.xml"; - my $uf_defaults = Build::NamelistDefaults->new("$nl_defaults_file", $cfg ); - # Loop over the variables specified in the user files - # Add each one to the namelist. - my @vars = $uf_defaults->get_variable_names(); - my %settings; - $settings{'mask'} = $nl_flags->{'mask'}; - $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; - $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; - $settings{'clm_accelerated_spinup'} = $nl_flags->{'clm_accelerated_spinup'}; - $settings{'clm_usr_name'} = $opts->{'clm_usr_name'}; - - if ( $nl_flags->{'inputdata_rootdir'} eq "\$DIN_LOC_ROOT" ) { - $settings{'csmdata'} = $ENV{'DIN_LOC_ROOT'}; - } else { - $settings{'csmdata'} = $nl_flags->{'inputdata_rootdir'}; - } - - my $nvars = 0; - my $nl_usrfile = Build::Namelist->new(); - foreach my $var (@vars) { - my $val = $uf_defaults->get_usr_file($var, $definition, \%settings); - - if ($val) { - $log->message("adding clm user file defaults for var $var with val $val"); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl_usrfile, $var, 'val'=>$val); - $nvars++; - } - } - if ( $nvars == 0 ) { - $log->message("setting clm_usr_name -- but did NOT find any user datasets: $opts->{'clm_usr_name'}", $opts); - } - # Go through all variables and expand any XML env settings in them - expand_xml_variables_in_namelist( $nl_usrfile, $envxml_ref ); - # Merge input values into namelist. Previously specified values have higher precedence - # and are not overwritten. - $nl->merge_nl($nl_usrfile); - } -} - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_use_case { - # Now process the -use_case arg. - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_; - - if (defined $opts->{'use_case'}) { - - # The use case definition is contained in an xml file with the same format as the defaults file. - # Create a new NamelistDefaults object. - my $uc_defaults = Build::NamelistDefaults->new("$opts->{'use_case_dir'}/$opts->{'use_case'}.xml", $cfg); - - my %settings; - $settings{'res'} = $nl_flags->{'res'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; - $settings{'mask'} = $nl_flags->{'mask'}; - $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; - $settings{'phys'} = $nl_flags->{'phys'}; - $settings{'lnd_tuning_mode'}= $nl_flags->{'lnd_tuning_mode'}; - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - $settings{'use_cn'} = $nl_flags->{'use_cn'}; - $settings{'use_cndv'} = $nl_flags->{'use_cndv'}; - $settings{'use_crop'} = $nl_flags->{'use_crop'}; - $settings{'cnfireson'} = $nl_flags->{'cnfireson'}; - } else { - $settings{'bgc'} = $nl_flags->{'bgc_mode'}; - } - # Loop over the variables specified in the use case. - # Add each one to the namelist. - my @vars = $uc_defaults->get_variable_names(); - my $nl_usecase = Build::Namelist->new(); - foreach my $var (@vars) { - my $val = $uc_defaults->get_value($var, \%settings ); - - if ( defined($val) ) { - $log->message("CLM adding use_case $opts->{'use_case'} defaults for var '$var' with val '$val'"); - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl_usecase, $var, 'val'=>$val); - } - } - # Go through all variables and expand any XML env settings in them - expand_xml_variables_in_namelist( $nl_usecase, $envxml_ref ); - - # Merge input values into namelist. Previously specified values have higher precedence - # and are not overwritten. - $nl->merge_nl($nl_usecase); - } -} - -#------------------------------------------------------------------------------- - -sub process_namelist_commandline_clm_start_type { - # Set the start_type according to the command line clm_start_type option - - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - # Run type for driver namelist - note that arb_ic implies that the run is startup - my $var = "start_type"; - if ($nl_flags->{'clm_start_type'} eq "'cold'" || $nl_flags->{'clm_start_type'} eq "'arb_ic'") { - # Add default is used here, but the value is explicitly set - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>'startup' ); - } else { - # Add default is used here, but the value is explicitly set - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>$nl_flags->{'clm_start_type'} ); - } -} - -#------------------------------------------------------------------------------- - -sub process_namelist_inline_logic { - # Use the namelist default object to add default values for required - # namelist variables that have not been previously set. - my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $envxml_ref, $physv) = @_; - - - ############################## - # namelist group: clm_inparm # - ############################## - setup_logic_site_specific($nl_flags, $definition, $nl, $physv); - setup_logic_lnd_frac($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); - setup_logic_co2_type($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_irrigate($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_start_type($opts, $nl_flags, $nl); - setup_logic_delta_time($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_decomp_performance($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_snow($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_glacier($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref, $physv); - setup_logic_dynamic_plant_nitrogen_alloc($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_luna($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_hydrstress($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_dynamic_roots($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_params_file($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_create_crop_landunit($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_subgrid($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_fertilizer($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_grainproduct($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_soilstate($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_demand($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_surface_dataset($opts, $nl_flags, $definition, $defaults, $nl, $physv); - if ( remove_leading_and_trailing_quotes($nl_flags->{'clm_start_type'}) ne "branch" ) { - setup_logic_initial_conditions($opts, $nl_flags, $definition, $defaults, $nl, $physv); - } - setup_logic_dynamic_subgrid($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ######################################### - # namelist group: atm2lnd_inparm - ######################################### - setup_logic_atm_forcing($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ######################################### - # namelist group: lnd2atm_inparm - ######################################### - setup_logic_lnd2atm($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ######################################### - # namelist group: clm_humanindex_inparm # - ######################################### - setup_logic_humanindex($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################# - # namelist group: cnfire_inparm # - ################################# - setup_logic_cnfire($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ###################################### - # namelist group: cnprecision_inparm # - ###################################### - setup_logic_cnprec($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################### - # namelist group: clmu_inparm # - ############################### - setup_logic_urban($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################### - # namelist group: crop # - ############################### - setup_logic_crop($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################### - # namelist group: ch4par_in # - ############################### - setup_logic_methane($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################### - # namelist group: ndepdyn_nml # - ############################### - setup_logic_nitrogen_deposition($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################## - # namelist group: cnmresp_inparm # - ################################## - setup_logic_cnmresp($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################# - # namelist group: nitrif_inparm # - ################################# - setup_logic_nitrif_params( $nl_flags, $definition, $defaults, $nl ); - - #################################### - # namelist group: photosyns_inparm # - #################################### - setup_logic_photosyns($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################# - # namelist group: popd_streams # - ################################# - setup_logic_popd_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - #################################### - # namelist group: urbantv_streams # - #################################### - setup_logic_urbantv_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################## - # namelist group: light_streams # - ################################## - setup_logic_lightning_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################# - # namelist group: drydep_inparm # - ################################# - setup_logic_dry_deposition($opts, $nl_flags, $definition, $defaults, $nl); - - ################################# - # namelist group: fire_emis_nl # - ################################# - setup_logic_fire_emis($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################# - # namelist group: megan_emis_nl # - ################################# - setup_logic_megan($opts, $nl_flags, $definition, $defaults, $nl); - - ################################## - # namelist group: lai_streams # - ################################## - setup_logic_lai_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################## - # namelist group: bgc_shared - ################################## - setup_logic_bgc_shared($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: soilwater_movement_inparm # - ############################################# - setup_logic_soilwater_movement($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: rooting_profile_inparm # - ############################################# - setup_logic_rooting_profile($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: friction_velocity # - ############################################# - setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ################################################ - # namelist group: century_soilbgcdecompcascade # - ################################################ - setup_logic_century_soilbgcdecompcascade($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - #################################### - # namelist group: cnvegcarbonstate # - #################################### - setup_logic_cnvegcarbonstate($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: soil_resis_inparm # - ############################################# - setup_logic_soil_resis($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: canopyfluxes_inparm # - ############################################# - setup_logic_canopyfluxes($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ############################################# - # namelist group: canopyhydrology_inparm # - ############################################# - setup_logic_canopyhydrology($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ##################################### - # namelist group: clm_canopy_inparm # - ##################################### - setup_logic_canopy($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ######################################## - # namelist group: soilhydrology_inparm # - ######################################## - setup_logic_hydrology_params($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ##################################### - # namelist group: irrigation_inparm # - ##################################### - setup_logic_irrigation_parameters($opts, $nl_flags, $definition, $defaults, $nl, $physv); - - ####################################################################### - # namelist groups: clm_hydrology1_inparm and clm_soilhydrology_inparm # - ####################################################################### - setup_logic_hydrology_switches($nl, $physv); - - ######################################### - # namelist group: clm_initinterp_inparm # - ######################################### - setup_logic_initinterp($opts, $nl_flags, $definition, $defaults, $nl, $physv); -} - -#------------------------------------------------------------------------------- - -sub setup_logic_site_specific { - # site specific requirements - my ($nl_flags, $definition, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - # res check prevents polluting the namelist with an unnecessary - # false variable for every run - if ($nl_flags->{'res'} eq "1x1_vancouverCAN") { - my $var = "use_vancouver"; - my $val = ".true."; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - } - } - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - # res check prevents polluting the namelist with an unnecessary - # false variable for every run - if ($nl_flags->{'res'} eq "1x1_mexicocityMEX") { - my $var = "use_mexicocity"; - my $val = ".true."; - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $val); - } - } - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'res'} eq "1x1_smallvilleIA") { - if (! &value_is_true($nl_flags->{'use_cn'}) || ! &value_is_true($nl_flags->{'use_crop'})) { - $log->fatal_error("1x1_smallvilleIA grids must use a compset with CN and CROP turned on."); - } - } - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'res'} eq "1x1_numaIA") { - if (! &value_is_true($nl_flags->{'use_cn'}) || ! &value_is_true($nl_flags->{'use_crop'})) { - $log->fatal_error("1x1_numaIA grids must use a compset with CN and CROP turned on."); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_lnd_tuning { - - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = "lnd_tuning_mode"; - if ( $opts->{$var} eq "default" ) { - my %settings; - $settings{'phys'} = $nl_flags->{'phys'}; - $nl_flags->{$var} = $defaults->get_value($var, \%settings ); - } else { - $nl_flags->{$var} = $opts->{$var}; - } - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, quote_string( $nl_flags->{$var} ) ); - if ( ! $definition->is_valid_value( $var, quote_string( $nl_flags->{$var}) ) ) { - my @valid_values = $definition->get_valid_values( $var ); - $log->fatal_error("$var has a value (".$nl_flags->{$var}.") that is NOT valid. Valid values are: @valid_values"); - } - $log->verbose_message("Using $nl_flags->{$var} for lnd_tuning_mode"); - my $phys = $physv->as_string(); - if ( $nl_flags->{$var} !~ /^${phys}_/ ) { - $log->fatal_error("First part of lnd_tuning_mode MUST match the CLM version you are using."); - } -} - - -#------------------------------------------------------------------------------- - -sub setup_logic_lnd_frac { - - my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; - - my $var = "lnd_frac"; - if ( defined($opts->{$var}) ) { - if ( defined($nl->get_value('fatmlndfrc')) ) { - $log->fatal_error("Can NOT set both -lnd_frac option (set via LND_DOMAIN_PATH/LND_DOMAIN_FILE " . - "env variables) AND fatmlndfrac on namelist"); - } - my $lnd_frac = SetupTools::expand_xml_var( $opts->{$var}, $envxml_ref); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fatmlndfrc','val'=>$lnd_frac ); - } - - # Get the fraction file - if (defined $nl->get_value('fatmlndfrc')) { - # do nothing - use value provided by config_grid.xml and clm.cpl7.template - } else { - $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist."); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_co2_type { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $var = "co2_type"; - if ( defined($opts->{$var}) ) { - if ( ! defined($nl->get_value($var)) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'co2_type','val'=>"$opts->{'co2_type'}"); - } else { - $log->fatal_error("co2_type set on namelist as well as -co2_type option."); - } - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'co2_type'); - if ( $nl->get_value('co2_type') =~ /constant/ ) { - my $var = 'co2_ppmv'; - if ( defined($opts->{$var}) ) { - if ( $opts->{$var} <= 0.0 ) { - $log->fatal_error("co2_ppmv can NOT be less than or equal to zero."); - } - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, $opts->{$var}); - } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'sim_year'=>$nl_flags->{'sim_year'} ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_irrigate { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'irrigate', - 'use_crop'=>$nl_flags->{'use_crop'}, 'use_cndv'=>$nl_flags->{'use_cndv'} ); - $nl_flags->{'irrigate'} = lc($nl->get_value('irrigate')); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_start_type { - my ($opts, $nl_flags, $nl) = @_; - - my $var = "start_type"; - my $drv_start_type = $nl->get_value($var); - my $my_start_type = $nl_flags->{'clm_start_type'}; - my $nsrest = $nl->get_value('override_nsrest'); - - if ( defined($nsrest) ) { - if ( $nsrest == 0 ) { $my_start_type = "startup"; } - if ( $nsrest == 1 ) { $my_start_type = "continue"; } - if ( $nsrest == 3 ) { $my_start_type = "branch"; } - if ( "$my_start_type" eq "$drv_start_type" ) { - $log->fatal_error("no need to set override_nsrest to same as start_type."); - } - if ( "$drv_start_type" !~ /startup/ ) { - $log->fatal_error("can NOT set override_nsrest if driver is NOT a startup type."); - } - } - - if ( $my_start_type =~ /branch/ ) { - if (not defined $nl->get_value('nrevsn')) { - $log->fatal_error("nrevsn is required for a branch type."); - } - } else { - if (defined $nl->get_value('nrevsn')) { - $log->fatal_error("nrevsn should ONLY be set for a branch type."); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_delta_time { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - if ( defined($opts->{'l_ncpl'}) ) { - my $l_ncpl = $opts->{'l_ncpl'}; - if ( $l_ncpl <= 0 ) { - $log->fatal_error("bad value for -l_ncpl option."); - } - my $val = ( 3600 * 24 ) / $l_ncpl; - my $dtime = $nl->get_value('dtime'); - if ( ! defined($dtime) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dtime', 'val'=>$val); - } elsif ( $dtime ne $val ) { - $log->fatal_error("can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable."); - } - } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dtime', 'hgrid'=>$nl_flags->{'res'}); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_decomp_performance { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - # Set the number of segments per clump - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nsegspc', 'hgrid'=>$nl_flags->{'res'}); -} - -#------------------------------------------------------------------------------- - -sub setup_logic_snow { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snowveg_flag', 'phys'=>$nl_flags->{'phys'} ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsnowoptics' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsnowaging' ); -} - -#------------------------------------------------------------------------------- - -sub setup_logic_glacier { - # - # Glacier multiple elevation class options - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref, $physv) = @_; - - my $clm_upvar = "GLC_TWO_WAY_COUPLING"; - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - # glc_do_dynglacier is set via GLC_TWO_WAY_COUPLING; it cannot be set via - # user_nl_clm (this is because we might eventually want the coupler and glc - # to also respond to GLC_TWO_WAY_COUPLING, by not bothering to send / map - # these fields - so we want to ensure that CLM is truly listening to this - # shared xml variable and not overriding it) - my $var = "glc_do_dynglacier"; - my $val = logical_to_fortran($envxml_ref->{$clm_upvar}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>$val); - if (lc($nl->get_value($var)) ne lc($val)) { - $log->fatal_error("glc_do_dynglacier can only be set via the env variable $clm_upvar: it can NOT be set in user_nl_clm"); - } - - } else { - # Otherwise if CLM4.0 physics and GLC_TWO_WAY_COUPLING is TRUE -- trigger an error - if ( &value_is_true(logical_to_fortran($envxml_ref->{$clm_upvar})) ) { - $log->fatal_error( "clm4_0 physics are being used, but $clm_upvar variable is set to true. $clm_upvar can ONLY be set for physics after clm4_5" ); - } - } - - my $var = "maxpatch_glcmec"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>$nl_flags->{'glc_nec'} ); - - my $val = $nl->get_value($var); - if ( $val != $nl_flags->{'glc_nec'} ) { - $log->fatal_error("$var set to $val does NOT agree with -glc_nec argument of $nl_flags->{'glc_nec'} (set with GLC_NEC env variable)"); - } - - if ( $physv->as_long >= $physv->as_long("clm4_5") ) { - if ( $nl_flags->{'glc_nec'} < 1 ) { - $log->fatal_error("For clm4_5 and later, GLC_NEC must be at least 1."); - } - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glc_snow_persistence_max_days'); - - } else { - # clm4_0 - if ( $nl_flags->{'glc_nec'} > 0 ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'flndtopo' , 'hgrid'=>$nl_flags->{'res'}, 'mask'=>$nl_flags->{'mask'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fglcmask' , 'hgrid'=>$nl_flags->{'res'}); - - } else { - # glc_nec == 0 - - # Error checking for glacier multiple elevation class options when glc_mec off - # Make sure various glc_mec-specific logicals are not true, and fglcmask is not set - my $glc_dyntopo= $nl->get_value('glc_dyntopo'); - if ( defined($glc_dyntopo) ) { - if ( &value_is_true($glc_dyntopo) ) { - $log->fatal_error("glc_dyntopo is true, but glc_nec is equal to zero"); - } - } - my $fglcmask = $nl->get_value('fglcmask'); - if ( defined($fglcmask) ) { - $log->fatal_error("fglcmask is set, but glc_nec is equal to zero"); - } - } - } - - # Dependence of albice on glc_nec has gone away starting in CLM4_5. Thus, we - # can remove glc_nec from the following call once we ditch CLM4_0. - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'albice', 'glc_nec'=>$nl_flags->{'glc_nec'}); - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_behavior'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_melt_behavior'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glacier_region_ice_runoff_behavior'); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_params_file { - # get param data. For 4_0, pft-physiology, for 4_5 old - # pft-physiology was used but now now includes CN and BGC century - # parameters. - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'paramfile', - 'phys'=>$nl_flags->{'phys'}, - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fpftcon'); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_create_crop_landunit { - # Create crop land unit - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = 'create_crop_landunit'; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - if ( $nl_flags->{'crop'} eq "on" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'irrig'=>$nl_flags->{'irrig'} ); - } else { - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_fates'=>$nl_flags->{'use_fates'} ); - if ( &value_is_true($nl_flags->{'use_fates'}) && &value_is_true($nl->get_value($var)) ) { - $log->fatal_error( "$var is true and yet use_fates is being set, which contradicts that (use_fates requires $var to be .false." ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_subgrid { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = 'run_zero_weight_urban'; - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_cnfire { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my @fire_consts = ( "rh_low", "rh_hgh", "bt_min", "bt_max", "cli_scale", "boreal_peatfire_c", "non_boreal_peatfire_c", - "pot_hmn_ign_counts_alpha", "cropfire_a1", "occur_hi_gdp_tree", "lfuel", "ufuel", "cmb_cmplt_fact" ); - if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl->get_value('use_cn')) ) { - foreach my $item ( @fire_consts ) { - if ( ! &value_is_true($nl_flags->{'cnfireson'} ) ) { - if ( defined($nl->get_value($item)) ) { - $log->fatal_error( "fire_method is no_fire and yet $item is being set, which contradicts that" ); - } - } else { - my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'fire_method'=>$fire_method ); - } - } - } elsif ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - foreach my $item ( @fire_consts ) { - if ( defined($nl->get_value($item)) ) { - $log->fatal_error( "CN is off which implies that cnfire is off and yet a fire constant ($item) is being set, which contradicts that" ); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_cnprec { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl_flags->{'use_cn'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'ncrit', 'use_cn'=>$nl_flags->{'use_cn'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'cnegcrit', 'use_cn'=>$nl_flags->{'use_cn'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'nnegcrit', 'use_cn'=>$nl_flags->{'use_cn'}); - } -} -#------------------------------------------------------------------------------- - -sub setup_logic_humanindex { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'calc_human_stress_indices'); - } else { - if ( defined($nl->get_value('calc_human_stress_indices')) ) { - $log->fatal_error( "calc_human_stress_indices can NOT be set, for physics versions less than clm4_5" ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_urban { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method'); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_traffic'); -} - -#------------------------------------------------------------------------------- - -sub setup_logic_crop { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - if ( &value_is_true($nl->get_value('use_crop')) ) { - my $maptype = 'baset_mapping'; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $maptype, - 'use_crop'=>$nl->get_value('use_crop') ); - my $baset_mapping = remove_leading_and_trailing_quotes( $nl->get_value($maptype) ); - if ( $baset_mapping eq "varytropicsbylat" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "baset_latvary_slope", - 'use_crop'=>$nl->get_value('use_crop'), $maptype=>$baset_mapping ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "baset_latvary_intercept", - 'use_crop'=>$nl->get_value('use_crop'), $maptype=>$baset_mapping ); - } else { - error_if_set( $nl, "Can only be set if $maptype == varytropicsbylat", "baset_latvary_slope", "baset_latvary_intercept" ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "initial_seed_at_planting", - 'use_crop'=>$nl->get_value('use_crop') ); - } else { - error_if_set( $nl, "Can NOT be set without crop on", "baset_mapping", "baset_latvary_slope", "baset_latvary_intercept" ); - } - } -} - -#------------------------------------------------------------------------------- -sub error_if_set { - # do a fatal_error and exit if any of the input variable names are set - my ($nl, $error, @list) = @_; - foreach my $var ( @list ) { - if ( defined($nl->get_value($var)) ) { - $log->fatal_error( "$var $error" ); - } - } -} - - -#------------------------------------------------------------------------------- - -sub setup_logic_soilstate { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'organic_frac_squared' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soil_layerstruct' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_bedrock', - 'use_fates'=>$nl_flags->{'use_fates'}, 'vichydro'=>$nl_flags->{'vichydro'} ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_demand { - # - # Deal with options that the user has said are required... - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my %settings; - $settings{'hgrid'} = $nl_flags->{'res'}; - $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $settings{'sim_year_range'} = $nl_flags->{'sim_year_range'}; - $settings{'mask'} = $nl_flags->{'mask'}; - $settings{'crop'} = $nl_flags->{'crop'}; - $settings{'rcp'} = $nl_flags->{'rcp'}; - $settings{'glc_nec'} = $nl_flags->{'glc_nec'}; - if ( $physv->as_long() >= $physv->as_long("clm4_5")) { - # necessary for demand to be set correctly (flanduse_timeseries requires - # use_crop, maybe other options require other flags?)! - $settings{'irrigate'} = $nl_flags->{'irrigate'}; - $settings{'use_cn'} = $nl_flags->{'use_cn'}; - $settings{'use_cndv'} = $nl_flags->{'use_cndv'}; - $settings{'use_lch4'} = $nl_flags->{'use_lch4'}; - $settings{'use_nitrif_denitrif'} = $nl_flags->{'use_nitrif_denitrif'}; - $settings{'use_vertsoilc'} = $nl_flags->{'use_vertsoilc'}; - $settings{'use_century_decomp'} = $nl_flags->{'use_century_decomp'}; - $settings{'use_crop'} = $nl_flags->{'use_crop'}; - } elsif ( $physv->as_long() == $physv->as_long("clm4_0")) { - $settings{'irrig'} = $nl_flags->{'irrig'}; - } - - my $demand = $nl->get_value('clm_demand'); - if (defined($demand)) { - $demand =~ s/\'//g; # Remove quotes - if ( $demand =~ /.+/ ) { - $opts->{'clm_demand'} .= ",$demand"; - } - } - - $demand = $defaults->get_value('clm_demand', \%settings); - if (defined($demand)) { - $demand =~ s/\'//g; # Remove quotes - if ( $demand =~ /.+/ ) { - $opts->{'clm_demand'} .= ",$demand"; - } - } - - my @demandlist = split( ",", $opts->{'clm_demand'} ); - foreach my $item ( @demandlist ) { - if ( $item eq "null" ) { - next; - } - if ( $item eq "finidat" ) { - $log->fatal_error( "Do NOT put findat in the clm_demand list, set the clm_start_type=startup so initial conditions are required"); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, %settings ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_surface_dataset { - # - # Get surface dataset after flanduse_timeseries so that we can get surface data - # consistent with it - # MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - $nl_flags->{'flanduse_timeseries'} = "null"; - my $flanduse_timeseries = $nl->get_value('flanduse_timeseries'); - if (defined($flanduse_timeseries)) { - $flanduse_timeseries =~ s!(.*)/!!; - $flanduse_timeseries =~ s/\'//; - $flanduse_timeseries =~ s/\"//; - if ( $flanduse_timeseries ne "" ) { - $nl_flags->{'flanduse_timeseries'} = $flanduse_timeseries; - } - } - $flanduse_timeseries = $nl_flags->{'flanduse_timeseries'}; - - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - if ($flanduse_timeseries ne "null" && $nl_flags->{'bgc_mode'} eq "cndv" ) { - $log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with dynamic vegetation ('-bgc cndv' in CLM_CONFIG_OPTS)." ); - } - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsurdat', - 'hgrid'=>$nl_flags->{'res'}, - 'sim_year'=>$nl_flags->{'sim_year'}, 'irrig'=>$nl_flags->{'irrig'}, - 'crop'=>$nl_flags->{'crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'}); - } else{ - if ($flanduse_timeseries ne "null" && &value_is_true($nl_flags->{'use_cndv'}) ) { - $log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with dynamic vegetation (use_cndv=.true)." ); - } - if ($flanduse_timeseries ne "null" && &value_is_true($nl_flags->{'use_fates'}) ) { - $log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with ecosystem dynamics (use_fates=.true)." ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsurdat', - 'hgrid'=>$nl_flags->{'res'}, - 'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>$nl_flags->{'irrigate'}, - 'use_crop'=>$nl_flags->{'use_crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'}); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_initial_conditions { - # Initial conditions - # The initial date is an attribute in the defaults file which should be matched unless - # the user explicitly requests to ignore the initial date via the -ignore_ic_date option, - # or just ignore the year of the initial date via the -ignore_ic_year option. - # - # MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set - # AFTER: setup_logic_irrigate which is where irrig (or irrigate) is set - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = "finidat"; - my $finidat = $nl->get_value($var); - if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { - if (defined $finidat ) { - $log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" . - " (by setting CLM_FORCE_COLDSTART=on)." ); - $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." ); - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, "' '" ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - $var, 'val'=>"' '", 'no_abspath'=>1); - $finidat = $nl->get_value($var); - } elsif ( defined $finidat ) { - if ( string_is_undef_or_empty($finidat) ) { - print "You are setting $var to blank which signals arbitrary initial conditions.\n"; - print "But, CLM_FORCE_COLDSTART is off which is a contradiction. For arbitrary initial conditions just use the CLM_FORCE_COLDSTART option\n"; - $log->fatal_error("To do a cold-start set ./xmlchange CLM_FORCE_COLDSTART=on, and remove the setting of $var in the user_nl_clm file"); - } - } - my $useinitvar = "use_init_interp"; - - if (not defined $finidat ) { - my $ic_date = $nl->get_value('start_ymd'); - my $st_year = int( $ic_date / 10000); - my $nofail = 1; - my %settings; - $settings{'hgrid'} = $nl_flags->{'res'}; - $settings{'phys'} = $physv->as_string(); - $settings{'nofail'} = $nofail; - my $fsurdat = $nl->get_value('fsurdat'); - $fsurdat =~ s!(.*)/!!; - $settings{'fsurdat'} = $fsurdat; - # - # If not transient use sim_year, otherwise use date - # - if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { - $settings{'sim_year'} = $nl_flags->{'sim_year'}; - $opts->{'ignore_ic_year'} = 1; - } else { - delete( $settings{'sim_year'} ); - } - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - $settings{'bgc'} = $nl_flags->{'bgc_mode'}; - foreach my $item ( "mask", "maxpft", "irrig", "glc_nec", "crop", "lnd_tuning_mode" ) { - $settings{$item} = $nl_flags->{$item}; - } - } else { - foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv", - "use_nitrif_denitrif", "use_vertsoilc", "use_century_decomp", "use_fates", - "lnd_tuning_mode" - ) { - $settings{$item} = $nl_flags->{$item}; - } - } - if ($opts->{'ignore_ic_date'}) { - if ( &value_is_true($nl_flags->{'use_crop'}) ) { - $log->warning("using ignore_ic_date is incompatable with crop! If you choose to ignore this error, " . - "the counters since planting for crops will be messed up. \nSo you should ignore at " . - "least the first season for crops. And since it will impact the 20 year means, ideally the " . - "first 20 years should be ignored."); - } - } elsif ($opts->{'ignore_ic_year'}) { - $settings{'ic_md'} = $ic_date; - } else { - $settings{'ic_ymd'} = $ic_date; - } - my $try = 0; - my $done = 2; - my $use_init_interp_default = $nl->get_value($useinitvar); - if ( string_is_undef_or_empty( $use_init_interp_default ) ) { - $use_init_interp_default = ".false."; - } - $settings{$useinitvar} = $use_init_interp_default; - do { - $try++; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, %settings ); - # If couldn't find a matching finidat file, check if can turn on interpolation and try to find one again - $finidat = $nl->get_value($var); - if ( (not defined $finidat ) && ($physv->as_long() >= $physv->as_long("clm4_5")) ) { - # Delete any date settings, except for crop - delete( $settings{'ic_ymd'} ); - delete( $settings{'ic_md'} ); - #if ( &value_is_true($nl_flags->{'use_crop'}) ) { - #$settings{'ic_md'} = $ic_date; - #} - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_sim_years" ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_how_close" ); - foreach my $sim_yr ( split( /,/, $nl->get_value("init_interp_sim_years") )) { - if ( abs($st_year - $sim_yr) < $nl->get_value("init_interp_how_close") ) { - $settings{'sim_year'} = $sim_yr; - } - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $useinitvar, - 'use_cndv'=>$nl_flags->{'use_cndv'}, 'phys'=>$physv->as_string(), - 'sim_year'=>$settings{'sim_year'}, 'nofail'=>1, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'use_fates'=>$nl_flags->{'use_fates'} ); - $settings{$useinitvar} = $nl->get_value($useinitvar); - if ( $try > 1 ) { - my $group = $definition->get_group_name($useinitvar); - $nl->set_variable_value($group, $useinitvar, $use_init_interp_default ); - } - if ( &value_is_true($nl->get_value($useinitvar) ) ) { - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "init_interp_attributes", - 'sim_year'=>$settings{'sim_year'}, 'use_cndv'=>$nl_flags->{'use_cndv'}, - 'glc_nec'=>$nl_flags->{'glc_nec'}, 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},'nofail'=>1 ); - my $attributes_string = remove_leading_and_trailing_quotes($nl->get_value("init_interp_attributes")); - foreach my $pair ( split( /\s/, $attributes_string) ) { - if ( $pair =~ /^([a-z_]+)=([a-z._0-9]+)$/ ) { - $settings{$1} = $2; - } else { - $log->fatal_error("Problem interpreting init_interp_attributes"); - } - } - } else { - if ( $nl_flags->{'clm_start_type'} =~ /startup/ ) { - $log->fatal_error("clm_start_type is startup so an initial conditions ($var) file is required, but can't find one without $useinitvar being set to true"); - } - $try = $done; - } - } else { - $try = $done - } - } while( ($try < $done) && (not defined $finidat ) ); - if ( not defined $finidat ) { - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, "' '" ); - } - } - $finidat = $nl->get_value($var); - if ( &value_is_true($nl->get_value($useinitvar) ) && string_is_undef_or_empty($finidat) ) { - $log->fatal_error("$useinitvar is set BUT $var is NOT, need to set both" ); - } -} # end initial conditions - -#------------------------------------------------------------------------------- - -sub setup_logic_dynamic_subgrid { - # - # Options controlling which parts of flanduse_timeseries to use - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - setup_logic_do_transient_pfts($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_do_transient_crops($opts, $nl_flags, $definition, $defaults, $nl, $physv); - setup_logic_do_harvest($opts, $nl_flags, $definition, $defaults, $nl, $physv); - -} - -sub setup_logic_do_transient_pfts { - # - # Set do_transient_pfts default value, and perform error checking on do_transient_pfts - # - # Assumes the following are already set in the namelist (although it's okay - # for them to be unset if that will be their final state): - # - flanduse_timeseries - # - use_cndv - # - use_fates - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = 'do_transient_pfts'; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - # Start by assuming a default value of '.true.'. Then check a number of - # conditions under which do_transient_pfts cannot be true. Under these - # conditions: (1) set default value to '.false.'; (2) make sure that the - # value is indeed false (e.g., that the user didn't try to set it to true). - - my $default_val = ".true."; - - # cannot_be_true will be set to a non-empty string in any case where - # do_transient_pfts should not be true; if it turns out that - # do_transient_pfts IS true in any of these cases, a fatal error will be - # generated - my $cannot_be_true = ""; - - if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { - $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; - } - elsif (&value_is_true($nl->get_value('use_cndv'))) { - $cannot_be_true = "$var cannot be combined with use_cndv"; - } - elsif (&value_is_true($nl->get_value('use_fates'))) { - $cannot_be_true = "$var cannot be combined with use_fates"; - } - - if ($cannot_be_true) { - $default_val = ".false."; - } - - if (!$cannot_be_true) { - # Note that, if the variable cannot be true, we don't call add_default - # - so that we don't clutter up the namelist with variables that don't - # matter for this case - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, val=>$default_val); - } - - # Make sure the value is false when it needs to be false - i.e., that the - # user hasn't tried to set a true value at an inappropriate time. - - if (&value_is_true($nl->get_value($var)) && $cannot_be_true) { - $log->fatal_error($cannot_be_true); - } - - } -} - -sub setup_logic_do_transient_crops { - # - # Set do_transient_crops default value, and perform error checking on do_transient_crops - # - # Assumes the following are already set in the namelist (although it's okay - # for them to be unset if that will be their final state): - # - flanduse_timeseries - # - use_crop - # - use_fates - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = 'do_transient_crops'; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - # Start by assuming a default value of '.true.'. Then check a number of - # conditions under which do_transient_crops cannot be true. Under these - # conditions: (1) set default value to '.false.'; (2) make sure that the - # value is indeed false (e.g., that the user didn't try to set it to true). - - my $default_val = ".true."; - - # cannot_be_true will be set to a non-empty string in any case where - # do_transient_crops should not be true; if it turns out that - # do_transient_crops IS true in any of these cases, a fatal error will be - # generated - my $cannot_be_true = ""; - - if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { - $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; - } - elsif (!&value_is_true($nl->get_value('use_crop'))) { - $cannot_be_true = "$var can only be set to true when running with use_crop = true"; - } - elsif (&value_is_true($nl->get_value('use_fates'))) { - # In principle, use_fates should be compatible with - # do_transient_crops. However, this hasn't been tested, so to be safe, - # we are not allowing this combination for now. - $cannot_be_true = "$var has not been tested with ED, so for now these two options cannot be combined"; - } - - if ($cannot_be_true) { - $default_val = ".false."; - } - - if (!$cannot_be_true) { - # Note that, if the variable cannot be true, we don't call add_default - # - so that we don't clutter up the namelist with variables that don't - # matter for this case - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, val=>$default_val); - } - - # Make sure the value is false when it needs to be false - i.e., that the - # user hasn't tried to set a true value at an inappropriate time. - - if (&value_is_true($nl->get_value($var)) && $cannot_be_true) { - $log->fatal_error($cannot_be_true); - } - - } -} - -sub setup_logic_do_harvest { - # - # Set do_harvest default value, and perform error checking on do_harvest - # - # Assumes the following are already set in the namelist (although it's okay - # for them to be unset if that will be their final state): - # - flanduse_timeseries - # - use_cn - # - use_fates - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $var = 'do_harvest'; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - # Start by assuming a default value of '.true.'. Then check a number of - # conditions under which do_harvest cannot be true. Under these - # conditions: (1) set default value to '.false.'; (2) make sure that the - # value is indeed false (e.g., that the user didn't try to set it to true). - - my $default_val = ".true."; - - # cannot_be_true will be set to a non-empty string in any case where - # do_harvest should not be true; if it turns out that do_harvest IS true - # in any of these cases, a fatal error will be generated - my $cannot_be_true = ""; - - if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { - $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; - } - elsif (!&value_is_true($nl->get_value('use_cn'))) { - $cannot_be_true = "$var can only be set to true when running with CN (use_cn = true)"; - } - elsif (&value_is_true($nl->get_value('use_fates'))) { - $cannot_be_true = "$var currently doesn't work with ED"; - } - - if ($cannot_be_true) { - $default_val = ".false."; - } - - if (!$cannot_be_true) { - # Note that, if the variable cannot be true, we don't call add_default - # - so that we don't clutter up the namelist with variables that don't - # matter for this case - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, val=>$default_val); - } - - # Make sure the value is false when it needs to be false - i.e., that the - # user hasn't tried to set a true value at an inappropriate time. - - if (&value_is_true($nl->get_value($var)) && $cannot_be_true) { - $log->fatal_error($cannot_be_true); - } - - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_spinup { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5")) { - if ( $nl_flags->{'bgc_mode'} eq "sp" && defined($nl->get_value('override_bgc_restart_mismatch_dump'))) { - $log->fatal_error("CN must be on if override_bgc_restart_mismatch_dump is set."); - } - } - if ( $nl_flags->{'clm_accelerated_spinup'} eq "on" ) { - foreach my $var ( "hist_nhtfrq", "hist_fincl1", "hist_empty_htapes", "hist_mfilt" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - $var, use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'}, - use_cndv=>$nl_flags->{'use_cndv'} ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_bgc_shared { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5")) { - if ( $nl_flags->{'bgc_mode'} ne "sp" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'constrain_stress_deciduous_onset', 'phys'=>$physv->as_string() ); - } - # FIXME(bja, 201606) the logic around fates / bgc_mode / - # use_century_decomp is confusing and messed up. This is a hack - # workaround. - if ( &value_is_true($nl_flags->{'use_century_decomp'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() ); - } - - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_supplemental_nitrogen { - # - # Supplemental Nitrogen for prognostic crop cases - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $nl_flags->{'bgc_mode'} ne "sp" && $nl_flags->{'bgc_mode'} ne "fates" && &value_is_true($nl_flags->{'use_crop'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'suplnitro', 'use_cn'=>$nl_flags->{'use_cn'}, 'use_crop'=>$nl_flags->{'use_crop'}); - } - - # - # Error checking for suplnitro - # - my $suplnitro = $nl->get_value('suplnitro'); - if ( defined($suplnitro) ) { - if ( $nl_flags->{'bgc_mode'} eq "sp" ) { - $log->fatal_error("supplemental Nitrogen (suplnitro) is set, but neither CN nor CNDV is active!"); - } - if ( ! &value_is_true($nl_flags->{'use_crop'}) && $suplnitro =~ /PROG_CROP_ONLY/i ) { - $log->fatal_error("supplemental Nitrogen is set to run over prognostic crops, but prognostic crop is NOT active!"); - } - - if ( $suplnitro =~ /ALL/i ) { - if ( $physv->as_long() == $physv->as_long("clm4_0") && $nl_flags->{'spinup'} ne "normal" ) { - $log->fatal_error("There is no need to use a spinup mode when supplemental Nitrogen is on for all PFT's, as these modes spinup Nitrogen\n" . - "when spinup != normal you can NOT set supplemental Nitrogen (suplnitro) to ALL"); - } - if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_spinup'} ne "off" ) { - $log->warning("There is no need to use a bgc_spinup mode when supplemental Nitrogen is on for all PFT's, as these modes spinup Nitrogen" ); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_hydrology_params { - # - # Logic for hydrology parameters - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5")) { - my $lower = $nl->get_value( 'lower_boundary_condition' ); - my $var = "baseflow_scalar"; - if ( $lower == 1 || $lower == 2 ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - $var, 'lower_boundary_condition' => $lower ); - } - my $val = $nl->get_value( $var ); - if ( defined($val) ) { - if ( $lower != 1 && $lower != 2 ) { - $log->fatal_error("baseflow_scalar is only used for lower_boundary_condition of flux or zero-flux"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_irrigation_parameters { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5")) { - my $var; - foreach $var ("irrig_min_lai", "irrig_start_time", "irrig_length", - "irrig_target_smp", "irrig_depth", "irrig_threshold_fraction", - "limit_irrigation_if_rof_enabled") { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } - - $var = "irrig_river_volume_threshold"; - if ( &value_is_true($nl->get_value("limit_irrigation_if_rof_enabled")) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } else { - if (defined($nl->get_value($var))) { - $log->fatal_error("$var can only be set if limit_irrigation_if_rof_enabled is true"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_nitrif_params { - # - # Logic for nitrification parameters - # - my ($nl_flags, $definition, $defaults, $nl) = @_; - - if ( ! &value_is_true($nl_flags->{'use_nitrif_denitrif'}) ) { - my @vars = ( "k_nitr_max", "denitrif_respiration_coefficient", "denitrif_respiration_exponent", - "denitrif_nitrateconc_coefficient", "denitrif_nitrateconc_exponent" ); - foreach my $var ( @vars ) { - if ( defined($nl->get_value( $var ) ) ) { - $log->fatal_error("$var is only used when use_nitrif_denitrif is turned on"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_hydrology_switches { - # - # Check on Switches for hydrology - # - my ($nl, $physv) = @_; - - my $subgrid = $nl->get_value('subgridflag' ); - my $origflag = $nl->get_value('origflag' ); - my $h2osfcflag = $nl->get_value('h2osfcflag' ); - if ( $origflag == 1 && $subgrid == 1 ) { - $log->fatal_error("if origflag is ON, subgridflag can NOT also be on!"); - } - if ( $h2osfcflag == 1 && $subgrid != 1 ) { - $log->fatal_error("if h2osfcflag is ON, subgridflag can NOT be off!"); - } - # These should NOT be set for CLM5.0 and beyond - if ( $physv->as_long() > $physv->as_long("clm4_5") ) { - foreach my $var ( "origflag", "h2osfcflag", "oldfflag" ) { - my $val = $nl->get_value($var); - if ( defined($val) ) { - $log->fatal_error( "ERROR:: $var=$val is deprecated and can only be used with CLM4.5" ); - } - } - } - # Test bad configurations - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - my $lower = $nl->get_value( 'lower_boundary_condition' ); - my $use_vic = $nl->get_value( 'use_vichydro' ); - my $use_bed = $nl->get_value( 'use_bedrock' ); - my $soilmtd = $nl->get_value( 'soilwater_movement_method' ); - if ( defined($soilmtd) && defined($lower) && $soilmtd == 0 && $lower != 4 ) { - $log->fatal_error( "If soil water movement method is zeng-decker -- lower_boundary_condition can only be aquifer" ); - } - if ( defined($soilmtd) && defined($lower) && $soilmtd == 1 && $lower == 4 ) { - $log->fatal_error( "If soil water movement method is adaptive -- lower_boundary_condition can NOT be aquifer" ); - } - if ( defined($use_bed) && defined($lower) && (&value_is_true($use_bed)) && $lower != 2 ) { - $log->fatal_error( "If use_bedrock is on -- lower_boundary_condition can only be flux" ); - } - if ( defined($use_vic) && defined($lower) && (&value_is_true($use_vic)) && $lower != 3 && $lower != 4) { - $log->fatal_error( "If use_vichydro is on -- lower_boundary_condition can only be table or aquifer" ); - } - if ( defined($origflag) && defined($use_vic) && (&value_is_true($use_vic)) && $origflag == 1 ) { - $log->fatal_error( "If use_vichydro is on -- origflag can NOT be equal to 1" ); - } - if ( defined($h2osfcflag) && defined($lower) && $h2osfcflag == 0 && $lower != 4 ) { - $log->fatal_error( "If h2osfcflag is 0 lower_boundary_condition can only be aquifer" ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_methane { - # - # CH4 model if bgc=CN or CNDV - # - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - if ( &value_is_true($nl_flags->{'use_lch4'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method', - 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); - # - # Get resolution to read streams file for - # - my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' )); - if ( $finundation_method eq "TWS_inversion" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_res', - 'finundation_method'=>$finundation_method ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated', - 'finundation_method'=>$finundation_method, - 'finundation_res'=>$nl->get_value('finundation_res') ); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog', - 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} ); - # - # Check if use_aereoxid_prog is set. If no, then read value of aereoxid from - # parameters file - # - my $use_aereoxid_prog = $nl->get_value('use_aereoxid_prog'); - if ( defined($use_aereoxid_prog) && ! &value_is_true($use_aereoxid_prog) ) { - $log->warning("Using aereoxid value from parameters file." ); - } - } else { - my @vars = $nl->get_variable_names('ch4par_in'); - if ( $#vars >= 0 ) { - $log->fatal_error("ch4par_in namelist variables were set, but Methane model NOT defined in the configuration (use_lch4)"); - } - } - - # - # Ch4 namelist checking - # - if ( &value_is_true($nl_flags->{'use_lch4'}) ) { - my $allowlakeprod = $nl->get_value('allowlakeprod'); - if ( ! defined($allowlakeprod) || - (defined($allowlakeprod) && ! &value_is_true($allowlakeprod)) ) { - if ( defined($nl->get_value('lake_decomp_fact')) ) { - $log->fatal_error("lake_decomp_fact set without allowlakeprod=.true."); - } - } - my $anoxia = $nl->get_value('anoxia'); - if ( ! defined($anoxia) || - (defined($anoxia) && ! &value_is_true($anoxia)) ) { - if ( defined($nl->get_value('anoxia_wtsat')) ) { - $log->fatal_error("anoxia_wtsat set without anoxia=.true."); - } - } - my $pftspec_rootprof = $nl->get_value('pftspecific_rootingprofile'); - if ( ! defined($pftspec_rootprof) || - (defined($pftspec_rootprof) && &value_is_true($pftspec_rootprof) ) ) { - if ( defined($nl->get_value('rootprof_exp')) ) { - $log->fatal_error("rootprof_exp set without pftspecific_rootingprofile=.false."); - } - } - } else { - my @vars = ( "allowlakeprod", "anoxia", "anoxia_wtsat", "pftspecific_rootingprofile" ); - foreach my $var ( @vars ) { - if ( defined($nl->get_value($var)) ) { - $log->fatal_error("$var set without methane model configuration on (use_lch4)"); - } - } - } -} # end methane - -#------------------------------------------------------------------------------- - -sub setup_logic_dynamic_plant_nitrogen_alloc { - # - # dynamic plant nitrogen allocation model, bgc=bgc - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && - &value_is_true($nl_flags->{'use_cn'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_flexibleCN', - 'phys'=>$physv->as_string(), 'use_cn'=>$nl_flags->{'use_cn'} ); - $nl_flags->{'use_flexibleCN'} = $nl->get_value('use_flexibleCN'); - - if ( &value_is_true($nl_flags->{'use_flexibleCN'}) ) { - # TODO(bja, 2015-04) make this depend on > clm 5.0 and bgc mode at some point. - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'MM_Nuptake_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'downreg_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'plant_ndemand_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'substrate_term_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nscalar_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'temp_scalar_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'CNratio_floating', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reduce_dayl_factor', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'vcmax_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'CN_residual_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'CN_partition_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'CN_evergreen_phenology_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'carbon_resp_opt', - 'use_flexibleCN'=>$nl_flags->{'use_flexibleCN'}, 'use_fun'=>$nl->get_value('use_fun') ); - if ( $nl->get_value('carbon_resp_opt') == 1 && &value_is_true($nl->get_value('use_fun')) ) { - $log->fatal_error("carbon_resp_opt should NOT be set to 1 when FUN is also on"); - } - } - } elsif ( $physv->as_long() >= $physv->as_long("clm4_5") && ! &value_is_true($nl_flags->{'use_cn'}) ) { - if ( &value_is_true($nl->get_value('use_flexibleCN')) ) { - $log->fatal_error("use_flexibleCN can ONLY be set if CN is on"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_luna { - # - # LUNA model to calculate photosynthetic capacities based on environmental conditions - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_luna', - 'phys'=>$physv->as_string(), 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_nitrif_denitrif'=>$nl_flags->{'use_nitrif_denitrif'} ); - - if ( &value_is_true( $nl_flags->{'use_cn'} ) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_nguardrail', - 'use_cn'=>$nl_flags->{'use_cn'} ); - } - $nl_flags->{'use_luna'} = $nl->get_value('use_luna'); - my $vcmax_opt= $nl->get_value('vcmax_opt'); - # lnc_opt only applies if luna is on or for vcmax_opt=3/4 - if ( &value_is_true( $nl_flags->{'use_luna'} ) || $vcmax_opt == 3 || $vcmax_opt == 4 ) { - # lnc_opt can be set for both CN on and off - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lnc_opt', - 'use_cn'=>$nl_flags->{'use_cn'} ); - } - if ( &value_is_true($nl->get_value('lnc_opt') ) && not &value_is_true( $nl_flags->{'use_cn'}) ) { - $log->fatal_error("Cannot turn lnc_opt to true when bgc=sp" ); - } - my $var = "jmaxb1"; - if ( $physv->as_long() >= $physv->as_long("clm5_0") && &value_is_true( $nl_flags->{'use_luna'} ) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_luna'=>$nl_flags->{'use_luna'} ); - } - my $val = $nl->get_value($var); - if ( $physv->as_long() >= $physv->as_long("clm4_5") && ! &value_is_true( $nl_flags->{'use_luna'} ) ) { - if ( defined($val) ) { - $log->fatal_error("Cannot set $var when use_luna is NOT on" ); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_hydrstress { - # - # Plant hydraulic stress model - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - # TODO(kwo, 2015-09) make this depend on > clm 5.0 at some point. - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_hydrstress', - 'use_fates'=>$nl_flags->{'use_fates'} ); - $nl_flags->{'use_hydrstress'} = $nl->get_value('use_hydrstress'); - if ( &value_is_true( $nl_flags->{'use_fates'} ) && &value_is_true( $nl_flags->{'use_hydrstress'} ) ) { - $log->fatal_error("Cannot turn use_hydrstress on when use_fates is on" ); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_fertilizer { - # - # Flags to control fertilizer application - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - $nl_flags->{'use_crop'} = $nl->get_value('use_crop'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fertilizer', - 'use_crop'=>$nl_flags->{'use_crop'} ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_grainproduct { - # - # Flags to control 1-year grain product pool - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - $nl_flags->{'use_crop'} = $nl->get_value('use_crop'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_grainproduct', - 'use_crop'=>$nl_flags->{'use_crop'}, 'phys'=>$physv->as_string() ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_dynamic_roots { - # - # dynamic root model - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_dynroot', 'phys'=>$physv->as_string(), 'bgc_mode'=>$nl_flags->{'bgc_mode'}); - my $use_dynroot = $nl->get_value('use_dynroot'); - if ( &value_is_true($use_dynroot) && ($nl_flags->{'bgc_mode'} eq "sp") ) { - $log->fatal_error("Cannot turn dynroot mode on mode bgc=sp\n" . - "Set the bgc mode to 'cn' or 'bgc'."); - } - if ( &value_is_true( $use_dynroot ) && &value_is_true( $nl_flags->{'use_hydrstress'} ) ) { - $log->fatal_error("Cannot turn use_dynroot on when use_hydrstress is on" ); - } - } # else - not relevant in clm4_0, not part of namelist definition, will not run. -} - -#------------------------------------------------------------------------------- - -sub setup_logic_c_isotope { - # - # Error checking for C-isotope options - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - my $use_c13 = $nl->get_value('use_c13'); - my $use_c14 = $nl->get_value('use_c14'); - if ( $nl_flags->{'bgc_mode'} ne "sp" && $nl_flags->{'bgc_mode'} ne "fates" ) { - if ( $nl_flags->{'bgc_mode'} ne "bgc" ) { - if ( defined($use_c13) && &value_is_true($use_c13) ) { - $log->warning("use_c13 is ONLY scientifically validated with the bgc=BGC configuration" ); - } - if ( defined($use_c14) && &value_is_true($use_c14) ) { - $log->warning("use_c14 is ONLY scientifically validated with the bgc=BGC configuration" ); - } - } - if ( defined($use_c14) ) { - if ( &value_is_true($use_c14) ) { - my $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); - if ( defined($use_c14_bombspike) && &value_is_true($use_c14_bombspike) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename', - 'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike') ); - } - } else { - if ( defined($nl->get_value('use_c14_bombspike')) || - defined($nl->get_value('atm_c14_filename')) ) { - $log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set"); - } - } - } else { - if ( defined($nl->get_value('use_c14_bombspike')) || - defined($nl->get_value('atm_c14_filename')) ) { - $log->fatal_error("use_c14 NOT set to .true., but use_c14_bompspike/atm_c14_filename defined."); - } - } - if ( defined($use_c13) ) { - if ( &value_is_true($use_c13) ) { - my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); - if ( defined($use_c13_timeseries) && &value_is_true($use_c13_timeseries) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', - 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries') ); - } - } else { - if ( defined($nl->get_value('use_c13_timeseries')) || - defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set"); - } - } - } else { - if ( defined($nl->get_value('use_c13_timeseries')) || - defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("use_c13 NOT set to .true., but use_c13_bompspike/atm_c13_filename defined."); - } - } - } else { - if ( defined($use_c13) || - defined($use_c14) || - defined($nl->get_value('use_c14_bombspike')) || - defined($nl->get_value('atm_c14_filename')) || - defined($nl->get_value('use_c13_timeseries')) || - defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("bgc=sp and C isotope namelist variables were set, both can't be used at the same time"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_nitrogen_deposition { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - # - # Nitrogen deposition for bgc=CN - # - - if ( $physv->as_long() == $physv->as_long("clm4_0") && $nl_flags->{'bgc_mode'} ne "none" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'}, - 'bgc'=>$nl_flags->{'bgc_mode'}, 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_ndep', 'phys'=>$nl_flags->{'phys'}, - 'bgc'=>$nl_flags->{'bgc_mode'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_ndep', 'phys'=>$nl_flags->{'phys'}, - 'bgc'=>$nl_flags->{'bgc_mode'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_ndep') != $nl->get_value('stream_year_last_ndep') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_ndep', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'}, - 'bgc'=>$nl_flags->{'bgc_mode'}, 'rcp'=>$nl_flags->{'rcp'}, - 'hgrid'=>"1.9x2.5" ); - - } elsif ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_taxmode', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_varlist', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_ndep') != $nl->get_value('stream_year_last_ndep') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_ndep', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, - 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'}, - 'hgrid'=>"0.9x1.25" ); - } else { - # If bgc is NOT CN/CNDV then make sure none of the ndep settings are set! - if ( defined($nl->get_value('stream_year_first_ndep')) || - defined($nl->get_value('stream_year_last_ndep')) || - defined($nl->get_value('model_year_align_ndep')) || - defined($nl->get_value('ndep_taxmode' )) || - defined($nl->get_value('ndep_varlist' )) || - defined($nl->get_value('stream_fldfilename_ndep')) - ) { - $log->fatal_error("When bgc is NOT CN or CNDV none of: stream_year_first_ndep," . - "stream_year_last_ndep, model_year_align_ndep, ndep_taxmod, " . - "ndep_varlist, nor stream_fldfilename_ndep" . - " can be set!"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_cnmresp { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - # - # CN Maintence respiration for bgc=CN - # - if ( $physv->as_long() >= $physv->as_long("clm4_5") && $nl_flags->{'bgc_mode'} ne "sp" ) { - # When FUN is on and it's clm5_0 get a default value - if ( &value_is_true( $nl->get_value('use_fun') ) && $physv->as_long() >= $physv->as_long("clm5_0")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'br_root', 'phys'=>$nl_flags->{'phys'}, - 'use_fun'=>$nl->get_value('use_fun'), - 'use_cn'=>$nl_flags->{'use_cn'} ); - } - } else { - # If bgc is NOT CN/CNDV then make sure not set - if ( defined($nl->get_value('br_root'))) { - $log->fatal_error("br_root can NOT be set when phys==clm4_0 or bgc_mode==sp!"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_photosyns { - # MUST be after use_hydrstress is set - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - # - # Photo synthesis - # - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'rootstem_acc', 'phys'=>$nl_flags->{'phys'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'light_inhibit', 'phys'=>$nl_flags->{'phys'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'leafresp_method', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'modifyphoto_and_lmr_forcrop', 'phys'=>$nl_flags->{'phys'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'stomatalcond_method', 'phys'=>$nl_flags->{'phys'}, - 'use_hydrstress'=>$nl_flags->{'use_hydrstress'} ); - # When CN on, must NOT be scaled by vcmax25top - if ( &value_is_true( $nl_flags->{'use_cn'} ) ) { - if ( $nl->get_value('leafresp_method') == 0 ) { - $log->fatal_error("leafresp_method can NOT be set to scaled to vcmax (0) when CN is on!"); - } - # And when CN off, must NOT be anything besides scaled by vxmac25top - } else { - if ( $nl->get_value('leafresp_method') != 0 ) { - $log->fatal_error("leafresp_method can NOT be set to anything besides scaled to vcmax (0) when bgc_mode==sp!"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_canopy { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - # - # Canopy state - # - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, - $nl, 'leaf_mr_vcm', 'phys'=>$nl_flags->{'phys'} ) - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_popd_streams { - # population density streams require clm4_5/clm5_0 and CN/BGC - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - if ( &value_is_true($nl_flags->{'cnfireson'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'popdensmapalgo', 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'}, 'cnfireson'=>$nl_flags->{'cnfireson'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_popdens') != - $nl->get_value('stream_year_last_popdens') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_popdens', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}, 'cnfireson'=>$nl_flags->{'cnfireson'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'}, - 'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5" ); - } else { - # If bgc is NOT CN/CNDV or fire_method==nofire then make sure none of the popdens settings are set - if ( defined($nl->get_value('stream_year_first_popdens')) || - defined($nl->get_value('stream_year_last_popdens')) || - defined($nl->get_value('model_year_align_popdens')) || - defined($nl->get_value('stream_fldfilename_popdens')) ) { - $log->fatal_error("When bgc is SP (NOT CN or BGC) or fire_method==nofire none of: stream_year_first_popdens,\n" . - "stream_year_last_popdens, model_year_align_popdens, nor\n" . - "stream_fldfilename_popdens can be set!"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_urbantv_streams { - # urban time varying streams require clm4_5/clm5_0 - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urbantvmapalgo', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_urbantv') != - $nl->get_value('stream_year_last_urbantv') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_urbantv', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>"0.9x1.25" ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_lightning_streams { - # lightning streams require clm4_5/clm5_0 and CN/BGC - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - if ( &value_is_true($nl_flags->{'cnfireson'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lightngmapalgo', 'use_cn'=>$nl_flags->{'use_cn'}, - 'hgrid'=>$nl_flags->{'res'}, - 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lightng', 'use_cn'=>$nl_flags->{'use_cn'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lightng', 'use_cn'=>$nl_flags->{'use_cn'}, - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_lightng') != - $nl->get_value('stream_year_last_lightng') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_lightng', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng', 'use_cn'=>$nl_flags->{'use_cn'}, - 'hgrid'=>$nl_flags->{'light_res'} ); - } else { - # If bgc is NOT CN/CNDV then make sure none of the Lightng settings are set - if ( defined($nl->get_value('stream_year_first_lightng')) || - defined($nl->get_value('stream_year_last_lightng')) || - defined($nl->get_value('model_year_align_lightng')) || - defined($nl->get_value('stream_fldfilename_lightng')) ) { - $log->fatal_error("When bgc is SP (NOT CN or BGC) or fire_method==nofire none of: stream_year_first_lightng,\n" . - "stream_year_last_lightng, model_year_align_lightng, nor\n" . - "stream_fldfilename_lightng can be set!"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_dry_deposition { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - if ($opts->{'drydep'} ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'drydep_list'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'drydep_method'); - } else { - if ( defined($nl->get_value('drydep_list')) || - defined($nl->get_value('drydep_method')) ) { - $log->fatal_error("drydep_list or drydep_method defined, but drydep option NOT set"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_fire_emis { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($opts->{'fire_emis'} ) { - if ( $physv->as_long() < $physv->as_long("clm4_5") ) { - $log->fatal_error("fire_emis option can NOT be set for CLM versions before clm4_5"); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_factors_file'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_specifier'); - } else { - if ( defined($nl->get_value('fire_emis_elevated')) || - defined($nl->get_value('fire_emis_factors_file')) || - defined($nl->get_value('fire_emis_specifier')) ) { - $log->fatal_error("fire_emission setting defined: fire_emis_elevated, fire_emis_factors_file, or fire_emis_specifier, but fire_emis option NOT set"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_megan { - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - - my $var = "megan"; - - if ( $opts->{$var} eq "default" ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, -'megan', clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'} ); - $nl_flags->{$var} = $nl->get_value($var); - } else { - $nl_flags->{$var} = $opts->{$var}; - } - - if ($nl_flags->{'megan'} ) { - if ( &value_is_true( $nl_flags->{'use_fates'} ) ) { - $log->fatal_error("MEGAN can NOT be on when ED is also on.\n" . - " Use the '-no-megan' option when '-bgc fates' is activated"); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_specifier'); - check_megan_spec( $opts, $nl, $definition ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_factors_file'); - } else { - if ( defined($nl->get_value('megan_specifier')) || - defined($nl->get_value('megan_factors_file')) ) { - $log->fatal_error("megan_specifier or megan_factors_file defined, but megan option NOT set"); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_lai_streams { - # lai streams require clm4_5/clm5_0 - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - if ( &value_is_true($nl_flags->{'use_crop'}) && &value_is_true($nl_flags->{'use_lai_streams'}) ) { - $log->fatal_error("turning use_lai_streams on is incompatable with use_crop set to true."); - } - if ( $nl_flags->{'bgc_mode'} eq "sp" ) { - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lai_streams'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lai_mapalgo', - 'hgrid'=>$nl_flags->{'res'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_lai', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_lai', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_lai') != - $nl->get_value('stream_year_last_lai') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_lai', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lai', - 'hgrid'=>"360x720cru" ); - } else { - # If bgc is CN/CNDV then make sure none of the LAI settings are set - if ( defined($nl->get_value('stream_year_first_lai')) || - defined($nl->get_value('stream_year_last_lai')) || - defined($nl->get_value('model_year_align_lai')) || - defined($nl->get_value('stream_fldfilename_lai')) ) { - $log->fatal_error("When bgc is NOT SP none of the following can be set: stream_year_first_lai,\n" . - "stream_year_last_lai, model_year_align_lai, nor\n" . - "stream_fldfilename_lai (eg. don't use this option with BGC,CN,CNDV nor BGDCV)."); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_soilwater_movement { - # soilwater_movement require clm4_5/clm5_0 - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soilwater_movement_method' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upper_boundary_condition' ); - - my $soilmtd = $nl->get_value("soilwater_movement_method"); - my $use_bed = $nl->get_value('use_bedrock' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'lower_boundary_condition', 'vichydro'=>$nl_flags->{'vichydro'}, - 'soilwater_movement_method'=>$soilmtd, 'use_bedrock'=>$use_bed - ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dtmin' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'verySmall' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'xTolerUpper' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'xTolerLower' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'expensive' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'inexpensive' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'flux_calculation' ); - } -} -#------------------------------------------------------------------------------- - -sub setup_logic_century_soilbgcdecompcascade { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && - (&value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates'))) && - &value_is_true($nl->get_value('use_century_decomp')) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks', - 'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'), - 'use_century_decomp' => $nl->get_value('use_century_decomp') ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks_depth', - 'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'), - 'use_century_decomp' => $nl->get_value('use_century_decomp') ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_cnvegcarbonstate { - # MUST be AFTER: setup_logic_dynamic_plant_nitrogen_alloc as depends on mm_nuptake_opt which is set there - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true($nl->get_value('use_cn')) ) { - my $mmnuptake = $nl->get_value('mm_nuptake_opt'); - if ( ! defined($mmnuptake) ) { $mmnuptake = ".false."; } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_vegC', - 'use_cn' => $nl->get_value('use_cn'), 'mm_nuptake_opt' => $mmnuptake ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_rooting_profile { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'rooting_profile_method_water' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'rooting_profile_method_carbon' ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_friction_vel { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'zetamaxstable' ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_soil_resis { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soil_resis_method' ); - } -} -#------------------------------------------------------------------------------- - -sub setup_logic_canopyfluxes { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_undercanopy_stability' ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_canopyhydrology { - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'interception_fraction' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'maximum_leaf_wetted_fraction' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_clm5_fpi' ); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_snowpack { - # - # Snowpack related options - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nlevsno'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'h2osno_max'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'int_snow_max'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_melt_glcmec'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'wind_dependent_snow_density'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_overburden_compaction_method'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lotmp_snowdensity_method'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upplim_destruct_metamorph'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fresh_snw_rds_max'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc_ela'); - - if (remove_leading_and_trailing_quotes($nl->get_value('snow_overburden_compaction_method')) eq 'Vionnet2012') { - # overburden_compress_tfactor isn't used if we're using the Vionnet2012 - # snow overburden compaction method, so make sure the user hasn't tried - # to set it - if (defined($nl->get_value('overburden_compress_tfactor'))) { - $log->fatal_error('overburden_compress_tfactor is set, but does not apply when using snow_overburden_compaction_method=Vionnet2012'); - } - } else { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'overburden_compress_tfactor'); - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_atm_forcing { - # - # Options related to atmospheric forcings - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'glcmec_downscale_longwave'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'repartition_rain_snow'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lapse_rate'); - - my $var; - - foreach $var ("lapse_rate_longwave", - "longwave_downscaling_limit") { - if ( &value_is_true($nl->get_value("glcmec_downscale_longwave")) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } else { - if (defined($nl->get_value($var))) { - $log->fatal_error("$var can only be set if glcmec_downscale_longwave is true"); - } - } - } - - foreach $var ("precip_repartition_glc_all_snow_t", - "precip_repartition_glc_all_rain_t", - "precip_repartition_nonglc_all_snow_t", - "precip_repartition_nonglc_all_rain_t") { - if ( &value_is_true($nl->get_value("repartition_rain_snow")) ){ - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } else { - if (defined($nl->get_value($var))) { - $log->fatal_error("$var can only be set if repartition_rain_snow is true"); - } - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_lnd2atm { - # - # Options related to fields sent to atmosphere - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'melt_non_icesheet_ice_runoff'); - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_initinterp { - # - # Options related to init_interp - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($physv->as_long() >= $physv->as_long("clm4_5")) { - my $var = 'init_interp_method'; - if ( &value_is_true($nl->get_value("use_init_interp"))) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var); - } else { - if (defined($nl->get_value($var))) { - $log->fatal_error("$var can only be set if use_init_interp is true"); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub setup_logic_fates { - # - # Set some default options related to Ecosystem Demography - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - if ($physv->as_long() >= $physv->as_long("clm4_5") && &value_is_true( $nl_flags->{'use_fates'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); - my @list = ( "use_fates_spitfire", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init", "use_fates_logging" ); - foreach my $var ( @list ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'} ); - } - my $var = "use_fates_inventory_init"; - if ( defined($nl->get_value($var)) ) { - if ( &value_is_true($nl->get_value($var)) ) { - $var = "fates_inventory_ctrl_filename"; - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_inventory_init is set" ); - } elsif ( ! -f "$nl->get_value($var)" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); - } - } - } - } -} - -#------------------------------------------------------------------------------- - -sub write_output_files { - my ($opts, $nl_flags, $defaults, $nl, $physv) = @_; - - my $note = ""; - my $var = "note"; - if ( ! defined($opts->{$var}) ) { - $opts->{$var} = $defaults->get_value($var); - } - if ( $opts->{$var} ) { - $note = "Comment:\n" . - "This namelist was created using the following command-line:\n" . - " $nl_flags->{'cfgdir'}/$ProgName $nl_flags->{'cmdline'}\n" . - "For help on options use: $nl_flags->{'cfgdir'}/$ProgName -help"; - } - - # CLM component - my @groups; - if ( $physv->as_long() == $physv->as_long("clm4_0") ) { - @groups = qw(clm_inparm); - # Eventually only list namelists that are actually used when CN on - #if ( $nl_flags->{'bgc_mode'} eq "cn" ) { - push @groups, "ndepdyn_nml"; - #} - } else { - - @groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams - lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology - clm_soilhydrology_inparm dynamic_subgrid cnvegcarbonstate - finidat_consistency_checks dynpft_consistency_checks - clm_initinterp_inparm century_soilbgcdecompcascade - soilhydrology_inparm luna friction_velocity mineral_nitrogen_dynamics - soilwater_movement_inparm rooting_profile_inparm - soil_resis_inparm bgc_shared canopyfluxes_inparm aerosol - clmu_inparm clm_soilstate_inparm clm_nitrogen clm_snowhydrology_inparm - cnprecision_inparm clm_glacier_behavior crop irrigation_inparm); - - #@groups = qw(clm_inparm clm_canopyhydrology_inparm clm_soilhydrology_inparm - # finidat_consistency_checks dynpft_consistency_checks); - # Eventually only list namelists that are actually used when CN on - #if ( $nl_flags->{'bgc_mode'} eq "cn" ) { - # push @groups, qw(ndepdyn_nml popd_streams light_streams); - #} - if ( &value_is_true($nl_flags->{'use_lch4'}) ) { - push @groups, "ch4par_in"; - } - if ( $physv->as_long() >= $physv->as_long("clm4_5") ) { - push @groups, "clm_humanindex_inparm"; - push @groups, "cnmresp_inparm"; - push @groups, "photosyns_inparm"; - push @groups, "cnfire_inparm"; - push @groups, "cn_general"; - push @groups, "nitrif_inparm"; - push @groups, "lifire_inparm"; - push @groups, "ch4finundated"; - push @groups, "clm_canopy_inparm"; - } - } - - my $outfile; - $outfile = "$opts->{'dir'}/lnd_in"; - $nl->write($outfile, 'groups'=>\@groups, 'note'=>"$note" ); - $log->verbose_message("Writing clm namelist to $outfile"); - - # Drydep, fire-emission or MEGAN namelist for driver - @groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm); - $outfile = "$opts->{'dir'}/drv_flds_in"; - $nl->write($outfile, 'groups'=>\@groups, 'note'=>"$note" ); - $log->verbose_message("Writing @groups namelists to $outfile"); -} - -sub write_output_real_parameter_file { - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - # Output real parameters - if ( defined($opts->{'output_reals_filename'}) ) { - my $file = $opts->{'output_reals_filename'}; - my $fh = IO::File->new($file, '>>') or $log->fatal_error("can't create real parameter filename: $file"); - foreach my $var ( $definition->get_var_names() ) { - my $type = $definition->get_var_type($var); - my $doc = $definition->get_var_doc($var); - $doc =~ s/\n//g; - if ( $type =~ /real/ ) { - my $val = $nl->get_value($var); - if ( ! defined($val) ) { $val = "?.??"; } - print $fh "\! $doc\n$var = $val\n"; - } - } - $fh->close(); - } -} - -#------------------------------------------------------------------------------- - -sub add_default { - -# Add a value for the specified variable to the specified namelist object. The variables -# already in the object have the higher precedence, so if the specified variable is already -# defined in the object then don't overwrite it, just return. -# -# This method checks the definition file and adds the variable to the correct -# namelist group. -# -# The value can be provided by using the optional argument key 'val' in the -# calling list. Otherwise a default value is obtained from the namelist -# defaults object. If no default value is found this method throws an exception -# unless the 'nofail' option is set true. -# -# Example 1: Specify the default value $val for the namelist variable $var in namelist -# object $nl: -# -# add_default($inputdata_rootdir, $definition, $defaults, $nl, $var, 'val'=>$val) -# -# Example 2: Add a default for variable $var if an appropriate value is found. Otherwise -# don't add the variable -# -# add_default($inputdata_rootdir, $definition, $defaults, $nl, $var, 'nofail'=>1) -# -# -# ***** N.B. ***** This routine assumes the following variables are in package main:: -# $definition -- the namelist definition object -# $defaults -- the namelist defaults object -# $inputdata_rootdir -- CESM inputdata root directory - - my $opts = shift; - my $inputdata_rootdir = shift; - my $definition = shift; - my $defaults = shift; - my $nl = shift; - my $var = shift; - my %settings = @_; - - my $test_files = $opts->{'test'}; - #my $nl = shift; # namelist object - #my $var = shift; # name of namelist variable - #my %settings = @_; # options - - # If variable has quotes around it - if ( $var =~ /'(.+)'/ ) { - $var = $1; - } - # Query the definition to find which group the variable belongs to. Exit if not found. - - my $group = $definition->get_group_name($var); - unless ($group) { - my $fname = $definition->get_file_name(); - $log->fatal_error("variable \"$var\" not found in namelist definition file $fname."); - } - - # check whether the variable has a value in the namelist object -- if so then skip to end - my $val = $nl->get_variable_value($group, $var); - if (! defined $val) { - - # Look for a specified value in the options hash - - if (defined $settings{'val'}) { - $val = $settings{'val'}; - } - # or else get a value from namelist defaults object. - # Note that if the 'val' key isn't in the hash, then just pass anything else - # in %settings to the get_value method to be used as attributes that are matched - # when looking for default values. - else { - - $val = $defaults->get_value($var, \%settings); - - # Truncate model_version appropriately - - if ( $var eq "model_version" ) { - $val =~ /(URL: https:\/\/[a-zA-Z0-9._-]+\/)([a-zA-Z0-9\/._-]+)(\/bld\/.+)/; - $val = $2; - } - } - - # if no value is found then exit w/ error (unless 'nofail' option set) - unless ( defined($val) ) { - unless ($settings{'nofail'}) { - if ($var eq 'finidat') { - $log->message("No default value found for $var.\n" . - " Are defaults provided for this resolution and land mask?" ); - } else { - $log->fatal_error("No default value found for $var.\n" . - " Are defaults provided for this resolution and land mask?"); - } - } - else { - return; - } - } - - # query the definition to find out if the variable is an input pathname - my $is_input_pathname = $definition->is_input_pathname($var); - - # The default values for input pathnames are relative. If the namelist - # variable is defined to be an absolute pathname, then prepend - # the CESM inputdata root directory. - if (not defined $settings{'no_abspath'}) { - if (defined $settings{'set_abspath'}) { - $val = set_abs_filepath($val, $settings{'set_abspath'}); - } else { - if ($is_input_pathname eq 'abs') { - $val = set_abs_filepath($val, $inputdata_rootdir); - if ( $test_files and ($val !~ /null/) and (! -f "$val") ) { - $log->fatal_error("file not found: $var = $val"); - } - } - } - } - - # query the definition to find out if the variable takes a string value. - # The returned string length will be >0 if $var is a string, and 0 if not. - my $str_len = $definition->get_str_len($var); - - # If the variable is a string, then add quotes if they're missing - if ($str_len > 0) { - $val = quote_string($val); - } - - # set the value in the namelist - $nl->set_variable_value($group, $var, $val); - } - -} - -#------------------------------------------------------------------------------- - -sub expand_xml_variables_in_namelist { - # Go through all variables in the namelist and expand any XML env settings in them - my ($nl, $xmlvar_ref) = @_; - - foreach my $group ( $nl->get_group_names() ) { - foreach my $var ( $nl->get_variable_names($group) ) { - my $val = $nl->get_variable_value($group, $var); - my $newval = SetupTools::expand_xml_var( $val, $xmlvar_ref ); - if ( $newval ne $val ) { - $nl->set_variable_value($group, $var, $newval); - } - } - } -} - -#------------------------------------------------------------------------------- - -sub check_input_files { - -# For each variable in the namelist which is an input dataset, check to see if it -# exists locally. -# -# ***** N.B. ***** This routine assumes the following variables are in package main:: -# $definition -- the namelist definition object -# $nl -- namelist object -# $inputdata_rootdir -- if false prints test, else creates inputdata file - - my ($nl, $inputdata_rootdir, $outfile, $definition) = @_; - - open(OUTFILE, ">>$outfile") if defined $inputdata_rootdir; - - # Look through all namelist groups - my @groups = $nl->get_group_names(); - foreach my $group (@groups) { - - # Look through all variables in each group - my @vars = $nl->get_variable_names($group); - foreach my $var (@vars) { - - # Is the variable an input dataset? - my $input_pathname_type = $definition->is_input_pathname($var); - - # If it is, check whether it exists locally and print status - if ($input_pathname_type) { - - # Get pathname of input dataset - my $pathname = $nl->get_variable_value($group, $var); - # Need to strip the quotes - $pathname =~ s/['"]//g; - - if ($input_pathname_type eq 'abs') { - if ($inputdata_rootdir) { - #MV $pathname =~ s:$inputdata_rootdir::; - print OUTFILE "$var = $pathname\n"; - } - else { - if (-e $pathname) { # use -e rather than -f since the absolute pathname - # might be a directory - print "OK -- found $var = $pathname\n"; - } - else { - print "NOT FOUND: $var = $pathname\n"; - } - } - } - elsif ($input_pathname_type =~ m/rel:(.+)/o) { - # The match provides the namelist variable that contains the - # root directory for a relative filename - my $rootdir_var = $1; - my $rootdir = $nl->get_variable_value($group, $rootdir_var); - $rootdir =~ s/['"]//g; - if ($inputdata_rootdir) { - $pathname = "$rootdir/$pathname"; - #MV $pathname =~ s:$inputdata_rootdir::; - print OUTFILE "$var = $pathname\n"; - } - else { - if (-f "$rootdir/$pathname") { - print "OK -- found $var = $rootdir/$pathname\n"; - } - else { - print "NOT FOUND: $var = $rootdir/$pathname\n"; - } - } - } - } - } - } - close OUTFILE if defined $inputdata_rootdir; - return 0 if defined $inputdata_rootdir; -} - -#------------------------------------------------------------------------------- - -sub set_abs_filepath { - -# check whether the input filepath is an absolute path, and if it isn't then -# prepend a root directory - - my ($filepath, $rootdir) = @_; - - # strip any leading/trailing whitespace and quotes - $filepath = trim($filepath); - $filepath = remove_leading_and_trailing_quotes($filepath); - $rootdir = trim($rootdir); - $rootdir = remove_leading_and_trailing_quotes($rootdir); - - my $out = $filepath; - unless ( $filepath =~ /^\// ) { # unless $filepath starts with a / - $out = "$rootdir/$filepath"; # prepend the root directory - } - return $out; -} - -#------------------------------------------------------------------------------- - -sub valid_option { - - my ($val, @expect) = @_; - - my $expect; - - $val = trim($val); - - foreach $expect (@expect) { - if ($val =~ /^$expect$/i) { return $expect; } - } - return undef; -} - -#------------------------------------------------------------------------------- - -sub check_use_case_name { -# -# Check the use-case name and ensure it follows the naming convention. -# - my ($use_case) = @_; - - my $diestring = "bad use_case name $use_case, follow the conventions " . - "in namelist_files/use_cases/README\n"; - my $desc = "[a-zA-Z0-9]*"; - my $rcp = "rcp[0-9\.]+"; - if ( $use_case =~ /^[0-9]+-[0-9]+([a-zA-Z0-9_\.]*)_transient$/ ) { - my $string = $1; - if ( $string =~ /^_($rcp)_*($desc)$/ ) { - # valid name - } elsif ( $string =~ /^_*($desc)$/ ) { - # valid name - } else { - $log->fatal_error($diestring); - } - } elsif ( $use_case =~ /^20thC([a-zA-Z0-9_\.]*)_transient$/ ) { - my $string = $1; - if ( $string =~ /^_($rcp)_*($desc)$/ ) { - # valid name - } elsif ( $string =~ /^_*($desc)$/ ) { - # valid name - } else { - $log->fatal_error($diestring); - } - } elsif ( $use_case =~ /^([0-9]+)_*($desc)_control$/ ) { - # valid name - } elsif ( $use_case =~ /^($desc)_pd$/ ) { - # valid name - } else { - $log->fatal_error($diestring); - } -} - -#------------------------------------------------------------------------------- - -sub validate_options { - -# $source -- text string declaring the source of the options being validated -# $cfg -- configure object -# $opts -- reference to hash that contains the options - - my ($source, $cfg, $opts) = @_; - - my ($opt, $old, @expect); - - # use_case - $opt = 'use_case'; - if (defined $opts->{$opt}) { - - if ( $opts->{$opt} ne "list" ) { - # create the @expect array by listing the files in $use_case_dir - # and strip off the ".xml" part of the filename - @expect = (); - my @files = glob("$opts->{'use_case_dir'}/*.xml"); - foreach my $file (@files) { - $file =~ m{.*/(.*)\.xml}; - &check_use_case_name( $1 ); - push @expect, $1; - } - - $old = $opts->{$opt}; - $opts->{$opt} = valid_option($old, @expect) - or $log->fatal_error("invalid value of $opt ($old) specified in $source\n" . - "expected one of: @expect"); - } else { - print "Use cases are:...\n\n"; - my @ucases; - foreach my $file( sort( glob($opts->{'use_case_dir'}."/*.xml") ) ) { - my $use_case; - if ( $file =~ /\/([^\/]+)\.xml$/ ) { - &check_use_case_name( $1 ); - $use_case = $1; - } else { - $log->fatal_error("Bad name for use case file = $file"); - } - my $uc_defaults = Build::NamelistDefaults->new("$file", $cfg); - printf "%15s = %s\n", $use_case, $uc_defaults->get_value("use_case_desc"); - push @ucases, $use_case; - } - $log->exit_message("use cases : @ucases"); - } - } -} - -#------------------------------------------------------------------------------- - -sub list_options { -# -# List the options for different command line values if asked for -# - my ($opts_cmdl, $definition, $defaults) = @_; - - # options to list values that are in the defaults files - my @opts_list = ( "res", "mask", "sim_year", "rcp" ); - my %opts_local; - foreach my $var ( "res", "mask", "sim_year", "rcp" ) { - my $val; - if ( $opts_cmdl->{$var} eq "list" ) { - $val = "default"; - } elsif ( $opts_cmdl->{$var} eq "default" ) { - $val = $defaults->get_value($var, \%opts_local ); - } else { - $val = $opts_cmdl->{$var}; - } - my $vname = $var; - if ( $vname eq "res" ) { $vname = "hgrid"; } - $opts_local{$vname} = $val; - } - foreach my $var ( @opts_list ) { - if (defined $opts_cmdl->{$var}) { - - if ( $opts_cmdl->{$var} eq "list" ) { - my @valid_values = $definition->get_valid_values( $var ); - if ( $var eq "sim_year" ) { - unshift( @valid_values, - $definition->get_valid_values( "sim_year_range" ) ); - } - unshift( @valid_values, "default" ); - # Strip out quotes and the constant value - for( my $i = 0; $i <= $#valid_values; $i++ ) { - $valid_values[$i] =~ s/('|')//g; - if ( $valid_values[$i] eq "constant" ) { $valid_values[$i] = undef; } - } - my $val= $defaults->get_value($var, \%opts_local); - my $doc = $definition->get_var_doc( $var ); - $doc =~ s/\n//; - chomp( $doc ); - $log->exit_message("valid values for $var ($doc) :\n" . - " Values: @valid_values\n" . - " Default = $val\n" . - " (NOTE: resolution and mask and other settings may influence what the default is)"); - } - } - } - # clm_demand - my $var = 'clm_demand'; - if (defined $opts_cmdl->{$var}) { - - if ( $opts_cmdl->{$var} eq "list" ) { - my @vars = $definition->get_var_names( ); - my @demands = ( "null" ); - foreach my $var ( @vars ) { - if ( $definition->get_group_name( $var ) ne "clm_inparm" ) { next; } - if ( defined($defaults->get_value($var, $opts_cmdl ) ) ) { - push( @demands, $var ); - } - } - my $doc = $definition->get_var_doc( 'clm_demand' ); - $doc =~ s/\n//; - chomp( $doc ); - $log->exit_message("valid values for $var ($doc) :\n" . - "Namelist options to require: @demands\n" . - "any valid namelist item for clm_inparm can be set. However, not all are\n" . - "available in the clm defaults file. The defaults are also dependent on\n" . - "resolution and landmask, as well as other settings. Hence, the list above\n" . - "will vary depending on what you set for resolution and landmask."); - } - } -} - -#------------------------------------------------------------------------------- - -sub check_megan_spec { -# -# Check the megan specifier setting -# - my ($opts, $nl, $definition) = @_; - - my $megan_spec = $nl->get_value('megan_specifier'); - my @megan_spec_list = split( /\s*,\s*/, $megan_spec ); - foreach $megan_spec ( @megan_spec_list ) { - if ( $megan_spec =~ /^['"]+[A-Za-z0-9]+\s*\=\s*([\sA-Za-z0-9+_-]+)["']+$/ ) { - my $megan_list = $1; - my @megan_cmpds = split( /\s*\+\s*/, $megan_list ); - my $var = "megan_cmpds"; - my $warn = 0; - foreach my $megan_cmpd ( @megan_cmpds ) { - if ( ! $definition->is_valid_value( $var, $megan_cmpd, 'noquotes'=>1 ) ) { - $log->warning("megan_compound $megan_cmpd NOT found in list" ); - $warn++; - } - } - if ( $warn > 0 ) { - my @valid_values = $definition->get_valid_values( $var, 'noquotes'=>1 ); - $log->warning("list of megan compounds includes:\n" . - "@valid_values\n" . - "Does your megan_factors_file include more compounds?\n" . - "If NOT your simulation will fail." ); - } - } else { - $log->fatal_error("Bad format for megan_specifier = $megan_spec"); - } - } -} - -#------------------------------------------------------------------------------- - -sub trim { - # remove leading and trailing whitespace from a string. - my ($str) = @_; - $str =~ s/^\s+//; - $str =~ s/\s+$//; - return $str; -} - -#------------------------------------------------------------------------------- - -sub quote_string { - # Add quotes around a string, unless they are already there - my ($str) = @_; - $str = trim($str); - unless ($str =~ /^['"]/) { #"' - $str = "\'$str\'"; - } - return $str; - } - -#------------------------------------------------------------------------------- - -sub remove_leading_and_trailing_quotes { - # Remove leading and trailing single and double quotes from a string. Also - # removes leading spaces before the leading quotes, and trailing spaces after - # the trailing quotes. - - my ($str) = @_; - - $str = trim($str); - - # strip any leading/trailing quotes - $str =~ s/^['"]+//; - $str =~ s/["']+$//; - - return $str; -} - -#------------------------------------------------------------------------------- - -sub logical_to_fortran { - # Given a logical variable ('true' / 'false'), convert it to a fortran-style logical ('.true.' / '.false.') - # The result will be lowercase, regardless of the case of the input. - my ($var) = @_; - my $result; - - if (lc($var) eq 'true') { - $result = ".true."; - } - elsif (lc($var) eq 'false') { - $result = ".false."; - } - else { - $log->fatal_error("Unexpected value in logical_to_fortran: $var"); - } - - return $result; -} - -#------------------------------------------------------------------------------- - -sub string_is_undef_or_empty { - # Return true if the given string is undefined or only spaces, false otherwise. - # A quoted empty string (' ' or " ") is treated as being empty. - my ($str) = @_; - if (!defined($str)) { - return 1; - } - else { - $str = remove_leading_and_trailing_quotes($str); - if ($str =~ /^\s*$/) { - return 1; - } - else { - return 0; - } - } -} - -#------------------------------------------------------------------------------- - -sub value_is_true { - # Return true if the given namelist value is .true. - # An undefined value is treated as false (with the assumption that false is the default in the code) - my ($val) = @_; - - # Some regular expressions... - ###my $TRUE = qr/\.true\./i; - ###my $FALSE = qr/\.false\./i; - # **N.B.** the use of qr// for precompiling regexps isn't supported until perl 5.005. - my $TRUE = '\.?true\.?|[t]'; - my $FALSE = '\.?false\.?|[f]'; - my $is_true = 0; - if (defined($val)) { - if ($val =~ /$TRUE/i) { - $is_true = 1; - } - } - - return $is_true; -} - -#------------------------------------------------------------------------------- - -sub version { -# The version is found in CLM ChangeLog file. -# $cfgdir is set by the configure script to the name of its directory. - - my ($cfgdir) = @_; - - my $logfile = "$cfgdir/../doc/ChangeLog"; - - my $fh = IO::File->new($logfile, '<') or $log->fatal_error("can't open ChangeLog file: $logfile"); - - while (my $line = <$fh>) { - - if ($line =~ /^Tag name:\s*([a-zA-Z0-9_. -]*[clmcesm0-9_.-]+)$/ ) { - $log->exit_message("$1"); - } - } -} - -#------------------------------------------------------------------------------- - -sub main { - my %nl_flags; - $nl_flags{'cfgdir'} = dirname(abs_path($0)); - - my %opts = process_commandline(\%nl_flags); - my $cfgdir = $nl_flags{'cfgdir'}; - check_for_perl_utils($cfgdir, \%opts); - - $log = namelist_files::LogMessages->new( $ProgName, \%opts ); # global - version($cfgdir) if $opts{'version'}; - my $cfg = read_configure_definition($cfgdir, \%opts); - - my $physv = config_files::clm_phys_vers->new( $cfg->get('phys') ); - my $definition = read_namelist_definition($cfgdir, \%opts, \%nl_flags, $physv); - my $defaults = read_namelist_defaults($cfgdir, \%opts, \%nl_flags, $cfg, $physv); - - # List valid values if asked for - list_options(\%opts, $definition, $defaults); - - # Validate some of the commandline option values. - validate_options("commandline", $cfg, \%opts); - - # Create an empty namelist object. - my $nl = Build::Namelist->new(); - - check_cesm_inputdata(\%opts, \%nl_flags); - - # Read in the env_*.xml files - my %env_xml = read_envxml_case_files( \%opts ); - - # Process the user inputs - process_namelist_user_input(\%opts, \%nl_flags, $definition, $defaults, $nl, $cfg, \%env_xml, $physv ); - # Get any other defaults needed from the namelist defaults file - process_namelist_inline_logic(\%opts, \%nl_flags, $definition, $defaults, $nl, $cfg, \%env_xml, $physv); - - # Validate that the entire resultant namelist is valid - $definition->validate($nl); - write_output_files(\%opts, \%nl_flags, $defaults, $nl, $physv); - write_output_real_parameter_file(\%opts, \%nl_flags, $definition, $defaults, $nl, $physv); - - if ($opts{'inputdata'}) { - check_input_files($nl, $nl_flags{'inputdata_rootdir'}, $opts{'inputdata'}, $definition); - } - $log->final_exit("Successfully made CLM namelist file"); -} - -#------------------------------------------------------------------------------- - -1; diff --git a/bld/README b/bld/README deleted file mode 100644 index 9f31d22bd9..0000000000 --- a/bld/README +++ /dev/null @@ -1,73 +0,0 @@ -$CTSMROOT/bld/README Jun/08/2018 - -CLM build and configure directory and scripts. Scripts to help -you prepare to build CLM as a component within CESM, and setup -a namelist for it. - -Important files/directories: - ---------- Configure and build scripts ---------- (These scripts are also used by the cesm/cime scripts) - -configure ---------------- Configure script -- sets up the CPP Macro's needed to be - defined to build CLM (only actively used for clm4_0) - ----- configure --help - Configure help mode -- sends information on all configure options -config_files/clm_phys_vers.pm ------------- Perl module to handle different CLM versions -config_files/config_defaults.xml ---------- XML file of defaults for CLM -config_files/config_defaults_*.xml -------- XML file of defaults for CLM for a specific site -config_files/config_definition_clm4_0.xml - XML file definining all CLM4.0 configuration items -config_files/config_definition_clm4_5.xml - XML file definining all CLM5.5/CLM5.0 configuration items - ---------- Scripts to build the namelists ---------- (These scripts are also used by the cesm/cime scripts) -build-namelist --- Build the namelists needed - - -env_run.xml --- Sample case runtime environment variables, so build-namelist can run outside of a case directory. - ---------- Scripts to query namelist defaults -listDefaultNamelist.pl -- List the files needed, for a list of resolutions, - to run CLM that are currently NOT on your machine. - This file can then be used by - cime/scripts/Tools/check_input_data - to retreive them from the inputdata repository. - Setting up cases with create_newcase also does - this -- but only for the exact configuration - given. This tries to get all the files need - for several different resolutions and configurations - at once. -queryDefaultNamelist.pl - Query default namelist for settings of variables -queryDefaultXML.pm ------ Subroutines needed by queryDefaultNamelist.pl script - - ---------- Test scripts directory -unit_testers --- Directory of scripts to test scipts in this directory - (most notably build-namelist and possibly configure) - ----------- XML Files describing namelists in namelist_files -namelist_files/namelist_defaults_clm4_0.xml ------- List of default values for the clm4_0 namelist -namelist_files/namelist_defaults_clm4_5.xml ------- List of default values for the clm4_5 namelist -namelist_files/namelist_defaults_clm4_5_tools.xml - List of default values for the clm4_5 tools. -namelist_files/namelist_defaults_overall.xml ------ List of default values for overall settings -namelist_files/namelist_defaults_usr_files.xml ---- List of default values for the user-files -namelist_files/namelist_definition_clm4_0.xml ----- Definition of all namelist items for clm4_0 -namelist_files/namelist_definition_clm4_5.xml ----- Definition of all namelist items for clm4_5 -namelist_files/namelist_definition.xsl ------------ Describes how to view the xml file as html -namelist_files/namelist_defaults_drydep.xml ------- List of default values for the dry deposition module. -namelist_files/use_cases -------------------------- Specific configurations that build-namelist uses -namelist_files/use_cases/README ------------------- File explaining the naming convention for use_cases - ----------- Driver namelist files, duplicated information from cime/driver/cime_config -namelist_files/namelist_defaults_drv.xml ---------- List of default values for driver namelist defaults -namelist_files/namelist_defaults_drydep.xml ------- List of default values for dry deposition fields -namelist_files/namelist_defaults_fire_emis.xml ---- List of default values for fire emission fields -namelist_files/namelist_definition_drv.xml -------- Definition of all driver namelist items -namelist_files/namelist_definition_drv_flds.xml --- Definition of add driver fieldsnamelist items - - ----------- XML helper files -namelist_files/LogMessages.pm ---- Perl module to handle log output -namelist_files/checkmapfiles.ncl -- NCL script to check that all of the mapping files are valid -namelist_files/createMapEntry.pl -- Perl script to create a map entry for the -namelist_files/history_fields.xsl - Style sheet for history fields as created by script that lists all of the - history fields from the source files (../src/main/findHistFields.pl) diff --git a/bld/build-namelist b/bld/build-namelist deleted file mode 100755 index 46e485d17c..0000000000 --- a/bld/build-namelist +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env perl -#----------------------------------------------------------------------------------------------- -# -# clm build-namelist driver -# -# Placing all of build-namelist into CLMBuildNamelist.pm means we can unit test the module. -# -require 5; - -use strict; - -BEGIN { - # ensure that the cesm create_X scripts can find CLMBuildNamelist.pm - use File::Basename qw(dirname); - use Cwd qw(abs_path); - my $dirname = dirname(abs_path($0)); - my @dirs = ($dirname, ); - unshift @INC, @dirs; -} - -use CLMBuildNamelist qw(main); - -CLMBuildNamelist::main(); diff --git a/bld/config_files/clm_phys_vers.pm b/bld/config_files/clm_phys_vers.pm deleted file mode 100755 index af6d63a887..0000000000 --- a/bld/config_files/clm_phys_vers.pm +++ /dev/null @@ -1,198 +0,0 @@ -package config_files::clm_phys_vers; -my $pkg_nm = 'config_files::clm_phys_vers'; -#----------------------------------------------------------------------------------------------- -# -# SYNOPSIS -# -# require config_files::clm_phys_vers; -# -# my $phys = config_files::clm_phys_vers->new("clm4_0"); -# print $phys->as_float(); -# print $phys->as_long(); -# print $phys->as_string(); -# print $phys->as_filename(); -# -# DESCRIPTION -# -# Enter the physics version as a string, with a list of valid versions, and have the ability to convert it to -# different formats. -# -# COLLABORATORS: None -# -#----------------------------------------------------------------------------------------------- -# -# Date Author Modification -# 03/06/2014 Erik Kluzek creation -# -#-------------------------------------------------------------------------------------------- - -use strict; -use bigint; -#use warnings; -#use diagnostics; - -my $major_mask = 1000000; -my $minor_mask = 1000; -my @version_strings = ( "clm4_0", "clm4_5", "clm5_0" ); -my @version_long = ( 4*$major_mask, 4*$major_mask+5*$minor_mask, 5*$major_mask ); - -#------------------------------------------------------------------------------- - -sub new { - # Constructor, enter version string as argument - my $class = shift; - my $vers_string = shift; - - my $nm = "$class\:\:new"; - my $self = {}; - bless($self, $class); - $self->__validate_vers__( $vers_string ); - $self->{'vers_string'} = $vers_string; - return( $self ); -} - -#------------------------------------------------------------------------------- - -sub __validate_vers__ { - # Make sure the version string is a valid one - my $class = shift; - my $vers_string = shift; - - my $found = undef; - foreach my $i (0..$#version_strings) { - if ( $vers_string eq $version_strings[$i] ) { - $found = 1; - last; - } - } - if ( ! defined($found) ) { - die "NOT a valid CLM version: $vers_string\n"; - } -} - -#------------------------------------------------------------------------------- - -sub as_long { -# Return the physics version as a long - my $self = shift; - my $vers = shift; - - if ( ! defined($vers) ) { - $vers = $self->{'vers_string'}; - } else { - $self->__validate_vers__( $vers ); - } - my $phys = undef; - for( my $i = 0; $i <= $#version_strings; $i++ ) { - if ( $vers eq $version_strings[$i] ) { - $phys = $version_long[$i]; - last; - } - } - return( $phys ); -} - -#------------------------------------------------------------------------------- - -sub as_float { -# Return the physics version as a float - my $self = shift; - - my $long = $self->as_long(); - my $major = int($long / $major_mask); - my $minor = int(($long - $major*$major_mask)/ $minor_mask); - my $rev = $long - $major*$major_mask - $minor*$minor_mask; - { - no bigint; - use bignum; - - my $phys = $major*1.0 + $minor/10.0 + $rev / 10000.0; - return( $phys ); - } -} - -#------------------------------------------------------------------------------- - -sub as_string { -# Return the physics version as a string - my $self = shift; - - my $phys = $self->{'vers_string'}; - return( $phys ); -} - -#------------------------------------------------------------------------------- - -sub as_filename { -# Return the physics version string with clm4_5 and clm5_0 pointing to the same name - my $self = shift; - - my $phys = undef; - if ( $self->as_long() < 5*$major_mask ) { - $phys = $self->as_string(); - } else { - $phys = "clm4_5"; - } - return( $phys ); -} - -#----------------------------------------------------------------------------------------------- -# Unit testing of above -#----------------------------------------------------------------------------------------------- -if ( ! defined(caller) && $#ARGV == -1 ) { - package phys_vers_unit_tester; - - require Test::More; - Test::More->import( ); - - plan( tests=>13 ); - - sub testit { - print "unit tester\n"; - my %lastv; - my @vers_list = ( "clm4_0", "clm4_5", "clm5_0" ); - foreach my $vers ( @vers_list ) { - my $phys = config_files::clm_phys_vers->new($vers); - isa_ok($phys, "config_files::clm_phys_vers", "created clm_phys_vers object"); - print "$vers: long: ".$phys->as_long()." float: ".$phys->as_float()." string: ".$phys->as_string()." file: ".$phys->as_filename()."\n"; - if ( exists($lastv{"long"}) ) { - is( $phys->as_long() > $lastv{'long'}, 1, "Definition of long is not increasing\n" ); - } - if ( exists($lastv{"float"}) ) { - is( $phys->as_float() > $lastv{'float'}, 1, "Definition of float is not increasing\n" ); - } - # Check that also can get results of any valid value for long - foreach my $chvers ( @vers_list ) { - my $lvalue = $phys->as_long($chvers); - print "Long value of $chvers = $lvalue\n"; - } - # Check that a bad value gives an error - eval { $phys->as_long('xxx'); }; - like( $@, qr/NOT a valid CLM version:/, "check that a bad version fails" ); - # Save last values to make sure increasing - $lastv{'long'} = $phys->as_long(); - $lastv{'float'} = $phys->as_float(); - } - my $phys = config_files::clm_phys_vers->new("clm4_0"); - is( 4.0, $phys->as_float(), "Make sure clm4_0 correct float value" ); - $phys = config_files::clm_phys_vers->new("clm4_5"); - no bigint; - use bignum; - is( 4.5, $phys->as_float(), "Make sure clm4_5 correct float value" ); - no bignum; - use bigint; - $phys = config_files::clm_phys_vers->new("clm5_0"); - is( 5.0, $phys->as_float(), "Make sure clm5_0 correct float value" ); - print "\nSuccessfully ran all tests\n"; - } -} - -#----------------------------------------------------------------------------------------------- -# Determine if you should run the unit test or if this is being called from a require statement -#----------------------------------------------------------------------------------------------- - -if ( defined(caller) ) { - 1 # to make use or require happy -} elsif ( $#ARGV == -1 ) { - &phys_vers_unit_tester::testit(); -} diff --git a/bld/config_files/config_defaults.xml b/bld/config_files/config_defaults.xml deleted file mode 100644 index 09d5634bb7..0000000000 --- a/bld/config_files/config_defaults.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/bld/config_files/config_defaults_1x1_mexicocityMEX.xml b/bld/config_files/config_defaults_1x1_mexicocityMEX.xml deleted file mode 100644 index 660c16715b..0000000000 --- a/bld/config_files/config_defaults_1x1_mexicocityMEX.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bld/config_files/config_defaults_1x1_numaIA.xml b/bld/config_files/config_defaults_1x1_numaIA.xml deleted file mode 100644 index b4813d0211..0000000000 --- a/bld/config_files/config_defaults_1x1_numaIA.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/bld/config_files/config_defaults_1x1_smallvilleIA.xml b/bld/config_files/config_defaults_1x1_smallvilleIA.xml deleted file mode 100644 index b4813d0211..0000000000 --- a/bld/config_files/config_defaults_1x1_smallvilleIA.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/bld/config_files/config_defaults_1x1_vancouverCAN.xml b/bld/config_files/config_defaults_1x1_vancouverCAN.xml deleted file mode 100644 index 49d9a54afb..0000000000 --- a/bld/config_files/config_defaults_1x1_vancouverCAN.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bld/config_files/config_definition.xsl b/bld/config_files/config_definition.xsl deleted file mode 100644 index f2f88609ef..0000000000 --- a/bld/config_files/config_definition.xsl +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - CLM Configuration Definition - - -

CLM Configuration Definition

- - - - - - - - - - - - -
CLM Physics Configurations
NameValueDescription
Valid Values
- - - - - - - - - - - - -
CLM Biogeochemistry Configurations
NameValueDescription
Valid Value
- - - - - - - - - - - - -
Configuration Directories
NameValueDescription
Valid Value
- - -
- - - - - - - - - Valid values: - - - - -
diff --git a/bld/config_files/config_definition_clm4_0.xml b/bld/config_files/config_definition_clm4_0.xml deleted file mode 100644 index aeb78d387a..0000000000 --- a/bld/config_files/config_definition_clm4_0.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - -Specifies either clm4_0, clm4_5, or clm5_0 physics - - - -CLM 4.0 Only. For CLM 4.5/5.0, spinup is controlled from build-namelist. -Spinup mode for the CN Carbon Nitrogen BGC model - AD turn on accelerated decomposition spinup for CN biogeochemistry model - exit jump from AD spinup mode to normal mode - normal no acceleration of decompositon (i.e. "final spinup") - - - -Toggle to turn on calculation of SNow and Ice Aerosol Radiation model (SNICAR) radiative forcing -(SNICAR_FRC .true.is EXPERIMENTAL NOT SUPPORTED!) - - - -Flag to turn on site specific special configuration flags for supported single -point resolutions. See the specific config_defaults_*.xml file for the special -settings that are set for a particular site. - - - -CLM Biogeochemistry mode - none = Satellite Phenology (SP) - cn = Carbon Nitrogen model (CN) - (or CLM45BGC if phys=clm4_5/clm5_0, vsoilc_centbgc='on', and clm4me='on') - cndv = Carbon Nitrogen with Dynamic Global Vegetation Model (CNDV) - (or CLM45BGCDV if phys=clm4_5/clm5_0, vsoilc_centbgc='on', and clm4me='on') - - -Toggle to turn on the prognostic crop model - - - -Root directory of CLM source distribution (directory above CLM configure). - - - -Component framework interface to use -(Model Coupling Toolkit, or Earth System Modeling Framework) - - - -User source directories to prepend to the filepath. Multiple directories -are specified as a comma separated list with no embedded white space. -Normally this is SourceMods/src.clm in your case. - - - -User specified CPP defines to append to Makefile defaults. -Note: It's recommended to use configure options to set standard CPP values rather -than defining them here. - - - -Maximum number of plant function types (PFT) per gridcell -(Setting maxpft to anything other than 17 (or 25 for clm4_5/clm5_0 CROP or 21 for clm4_0 CROP) -is EXPERIMENTAL AND NOT SUPPORTED!) -(Either 17 for a standard vegetated case or -21 for prognostic clm4_0 CROP or 25 -for prognostic clm4_5/clm5_0 CROP) - - - -Toggle to make wild-fires inactive for biogeochemistry=CN mode - - - -Toggle to turn all history output completely OFF (possibly used for testing) - - - diff --git a/bld/config_files/config_definition_clm4_5.xml b/bld/config_files/config_definition_clm4_5.xml deleted file mode 100644 index 8f57fd1844..0000000000 --- a/bld/config_files/config_definition_clm4_5.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - -Specifies either clm4_0, clm4_5, or clm5_0 physics - - - -Root directory of CLM source distribution (directory above CLM configure). - - - -Component framework interface to use -(Model Coupling Toolkit, or Earth System Modeling Framework) - - - -User source directories to prepend to the filepath. Multiple directories -are specified as a comma separated list with no embedded white space. -Normally this is SourceMods/src.clm in your case. - - - -User specified CPP defines to append to Makefile defaults. -Note: It's recommended to use configure options to set standard CPP values rather -than defining them here. - - - diff --git a/bld/configure b/bld/configure deleted file mode 100755 index fb5fe9bf7f..0000000000 --- a/bld/configure +++ /dev/null @@ -1,755 +0,0 @@ -#!/usr/bin/env perl -#----------------------------------------------------------------------------------------------- -# -# configure -# -# -# This utility allows the CLM user to specify compile-time configuration -# options via a commandline interface. The output from configure is a -# Makefile and a cache file that contains all configuration parameters -# required to produce the Makefile. A subsequent invocation of configure -# can use the cache file as input (via the -defaults argument) to reproduce -# the CLM configuration contained in it. Note that when a cache file is -# used to set default values only the model parameters are used. The -# parameters that are platform dependent (e.g., compiler options, library -# locations, etc) are ignored. -# -# As the build time configurable options of CLM are changed, this script -# must also be changed. Thus configure is maintained under revision -# control in the CLM source tree and it is assumed that only the version of -# configure in the source tree will be used to build CLM. Thus we assume -# that the root of the source tree can be derived from the location of this -# script. -# -#----------------------------------------------------------------------------------------------- - -use strict; -#use warnings; -#use diagnostics; -use Cwd qw(getcwd abs_path); -use English; -use Getopt::Long; -use IO::File; -use IO::Handle; -use File::Copy; - -#----------------------------------------------------------------------------------------------- - -sub usage { - die <). Any value that contains - white-space must be quoted. Long option names may be supplied with either single - or double leading dashes. A consequence of this is that single letter options may - NOT be bundled. - - -bgc Build CLM with BGC package [ none | cn | cndv ] - (default is none). - -cache Name of output cache file (default: config_cache.xml). - -cachedir Name of directory where output cache file is written - (default: CLM build directory). - -cimeroot REQUIRED: Path to cime directory - -clm_root Root directory of clm source code - (default: directory above location of this script) - -cppdefs A string of user specified CPP defines. Appended to - Makefile defaults. e.g. -cppdefs '-DVAR1 -DVAR2' - -crop Toggle for prognostic crop model. [on | off] (default is off) - (can ONLY be turned on when BGC type is CN or CNDV) - -comp_intf Component interface to use (ESMF or MCT) (default MCT) - -defaults Specify full path to a configuration file which will be used - to supply defaults instead of the defaults in bld/config_files. - This file is used to specify model configuration parameters only. - Parameters relating to the build which are system dependent will - be ignored. - -help [or -h] Print usage to STDOUT. - -nofire Turn off wildfires for BGC setting of CN - (default includes fire for CN) - -noio Turn history output completely off (typically for testing). - -phys Value of clm4_0, clm4_5, or clm5_0 (default is clm4_0) - -silent [or -s] Turns on silent mode - only fatal messages issued. - -sitespf_pt Setup for the given site specific single-point resolution. - -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] - (default is off) - -spinup CLM 4.0 Only. For CLM 4.5, spinup is controlled from build-namelist. - Turn on given spinup mode for BGC setting of CN (level) - AD Turn on Accelerated Decomposition from (2) - bare-soil - exit Jump directly from AD spinup to normal mode (1) - normal Normal decomposition ("final spinup mode") (0) - (default) - The recommended sequence is 2-1-0 - -usr_src [,[,[...]]] - Directories containing user source code. - -verbose [or -v] Turn on verbose echoing of settings made by configure. - -version Echo the SVN tag name used to check out this CLM distribution. -EOF -} - -#----------------------------------------------------------------------------------------------- -# Setting autoflush (an IO::Handle method) on STDOUT helps in debugging. It forces the test -# descriptions to be printed to STDOUT before the error messages start. - -*STDOUT->autoflush(); - -#----------------------------------------------------------------------------------------------- -# Set the directory that contains the CLM configuration scripts. If the configure command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script is in - # the user's PATH -my $cwd = getcwd(); # current working directory -my $cfgdir; # absolute pathname of directory that contains this script -if ($ProgDir) { - $cfgdir = abs_path($ProgDir); -} else { - $cfgdir = $cwd; -} - -#----------------------------------------------------------------------------------------------- -# Save commandline -my $commandline = "$cfgdir/configure @ARGV"; - -#----------------------------------------------------------------------------------------------- -# Parse command-line options. -my %opts = ( - cache => "config_cache.xml", - phys => "clm4_0", - nofire => undef, - noio => undef, - cimeroot => undef, - clm_root => undef, - spinup => "normal", - ); -GetOptions( - "spinup=s" => \$opts{'spinup'}, - "bgc=s" => \$opts{'bgc'}, - "cache=s" => \$opts{'cache'}, - "cachedir=s" => \$opts{'cachedir'}, - "snicar_frc=s" => \$opts{'snicar_frc'}, - "cimeroot=s" => \$opts{'cimeroot'}, - "clm_root=s" => \$opts{'clm_root'}, - "cppdefs=s" => \$opts{'cppdefs'}, - "comp_intf=s" => \$opts{'comp_intf'}, - "defaults=s" => \$opts{'defaults'}, - "clm4me=s" => \$opts{'clm4me'}, - "h|help" => \$opts{'help'}, - "nofire" => \$opts{'nofire'}, - "noio" => \$opts{'noio'}, - "phys=s" => \$opts{'phys'}, - "snicar_frc=s" => \$opts{'snicar_frc'}, - "s|silent" => \$opts{'silent'}, - "sitespf_pt=s" => \$opts{'sitespf_pt'}, - "usr_src=s" => \$opts{'usr_src'}, - "v|verbose" => \$opts{'verbose'}, - "version" => \$opts{'version'}, - "crop=s" => \$opts{'crop'}, -) or usage(); - -# Give usage message. -usage() if $opts{'help'}; - -# Echo version info. -version($cfgdir) if $opts{'version'}; - -# Check for unparsed arguments -if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); -} - -# Define 3 print levels: -# 0 - only issue fatal error messages -# 1 - only informs what files are created (default) -# 2 - verbose -my $print = 1; -if ($opts{'silent'}) { $print = 0; } -if ($opts{'verbose'}) { $print = 2; } -my $eol = "\n"; - -my %cfg = (); # build configuration - -#----------------------------------------------------------------------------------------------- -# Make sure we can find required perl modules and configuration files. -# Look for them in the directory that contains the configure script. - -my $cimeroot = $opts{'cimeroot'}; -if ( ! defined($cimeroot) ) { - $cimeroot = "$cfgdir/../cime"; - if ( -d $cimeroot ) { - } elsif ( -d "$cfgdir/../../../cime" ) { - $cimeroot = "$cfgdir/../../../cime"; - } else { - die <<"EOF"; -** Cannot find the root of the cime directory enter it using the -cimeroot option - Did you run the checkout_externals scripts? -EOF - } -} -my $casecfgdir = "$cimeroot/scripts/Tools"; -my $perl5lib = "$cimeroot/utils/perl5lib/"; - -# The Build::Config module provides utilities to store and manipulate the configuration. -my $file = "$perl5lib/Build/Config.pm"; -(-f "$file") or die <<"EOF"; -** Cannot find perl module \"Build/Config.pm\" in path - \"$file\" ** -EOF -#----------------------------------------------------------------------------------------------- -# Add $cfgdir/perl5lib to the list of paths that Perl searches for modules -my @dirs = ( $cfgdir, "$perl5lib", $casecfgdir); -unshift @INC, @dirs; -require Build::Config; -require config_files::clm_phys_vers; - -# Get the physics version -my $phys = config_files::clm_phys_vers->new($opts{'phys'}); - -# Check for the physics specific configuration definition file. -my $phys_string = $phys->as_filename(); - -my $config_def_file = "config_definition_$phys_string.xml"; -(-f "$cfgdir/config_files/$config_def_file") or die <<"EOF"; -** Cannot find configuration definition file \"$config_def_file\" in directory - \"$cfgdir/config_files\" ** -EOF - -# The configuration defaults file modifies the generic defaults in the configuration -# definition file. Note that the -defaults option has precedence over all other options. -my $config_defaults_file; -my $std_config_defaults_file = "$cfgdir/config_files/config_defaults.xml"; -if ($opts{'defaults'}) { - $config_defaults_file = $opts{'defaults'}; -} elsif (defined($opts{'sitespf_pt'}) and $phys->as_long() == $phys->as_long( "clm4_0" ) ) { - $config_defaults_file = "$cfgdir/config_files/config_defaults_$opts{'sitespf_pt'}.xml"; - if ( ! -f $config_defaults_file ) { - $config_defaults_file = "$std_config_defaults_file"; - } -} else { - $config_defaults_file = "$std_config_defaults_file"; -} -(-f "$config_defaults_file") or die <<"EOF"; -** Cannot find configuration defaults file \"$config_defaults_file\" ** -EOF - -if ($print>=2) { print "Setting CLM configuration script directory to $cfgdir$eol"; } -if ($print>=2) { print "Using configuration defaults file $config_defaults_file$eol"; } - -# Initialize the configuration. The $config_def_file provides the definition of a CLM -# configuration, and the $config_defaults_file provides default values for a specific CLM -# configuration. $cfg_ref is a reference to the new configuration object. -my $cfg_ref = Build::Config->new("$cfgdir/config_files/$config_def_file", - "$config_defaults_file"); - -#----------------------------------------------------------------------------------------------- -# CLM root directory. -my $clm_root; - -if ( ! defined($opts{'clm_root'} ) ) { - $clm_root = abs_path("$cfgdir/.."); -} else { - $clm_root = $opts{'clm_root'}; -} - -if ( &is_valid_directory( "$clm_root/src", allowEnv=>0 ) ) { - $cfg_ref->set('clm_root', $clm_root); -} else { - die <<"EOF"; -** Invalid CLM root directory: $clm_root -** -** The CLM root directory must contain the subdirectory /src/. -** clm_root can be entered on the command line or it will be derived -** from the location of this script. -EOF -} - -if ($print>=2) { print "Setting CLM root directory to $clm_root$eol"; } - -#----------------------------------------------------------------------------------------------- -# CLM build directory is current directory -my $clm_bld = `pwd`; -chomp( $clm_bld ); - -# Make sure directory is valid -if ( ! &is_valid_directory( $clm_bld ) and ! mkdirp($clm_bld)) { - die <<"EOF"; -** Could not create the specified CLM build directory: $clm_bld -EOF -} - -if ($print>=2) { print "Setting CLM build directory to $clm_bld$eol"; } - -#----------------------------------------------------------------------------------------------- -# User source directories. -my $usr_src = ''; -if (defined $opts{'usr_src'}) { - my @dirs = split ',', $opts{'usr_src'}; - my @adirs; - while ( my $dir = shift @dirs ) { - if (&is_valid_directory( "$dir", allowEnv=>0 ) ) { - push @adirs, $dir; - } else { - die "** User source directory does not exist: $dir\n"; - } - } - $usr_src = join ',', @adirs; - $cfg_ref->set('usr_src', $usr_src); -} - -if ($print>=2) { print "Setting user source directories to $usr_src$eol"; } - -#----------------------------------------------------------------------------------------------- -# configuration cache directory and file. -my $config_cache_dir; -my $config_cache_file; -if (defined $opts{'cachedir'}) { - $config_cache_dir = abs_path($opts{'cachedir'}); -} -else { - $config_cache_dir = $clm_bld; -} - -if (&is_valid_directory( $config_cache_dir, allowEnv=>0 ) or mkdirp($config_cache_dir)) { - $config_cache_file = "$config_cache_dir/$opts{'cache'}"; -} else { - die <<"EOF"; -** Could not create the specified directory for configuration cache file: $config_cache_dir -EOF -} - -if ($print>=2) { print "The configuration cache file will be created in $config_cache_file$eol"; } - - -#----------------------------------------------------------------------------------------------- -# physics - -$cfg_ref->set('phys', $opts{'phys'}); -my $phys_string = $phys->as_string(); -if ($print>=2) { - if( defined($opts{'phys'}) ) { - print "Using version $phys_string physics.$eol"; - } -} - -#----------------------------------------------------------------------------------------------- -# supported single point configurations -my $sitespf_pt = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if( defined($opts{'sitespf_pt'}) ) { - $cfg_ref->set('sitespf_pt', $opts{'sitespf_pt'}); - } - $sitespf_pt = $cfg_ref->get('sitespf_pt'); - if ($print>=2) { - if( defined($opts{'sitespf_pt'}) ) { - print "Using $sitespf_pt for supported single point configuration.$eol"; - } - } -} - -#----------------------------------------------------------------------------------------------- -# NOIO option -my $noio = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'noio'}) { - $cfg_ref->set('noio', "on" ); - } - $noio = $cfg_ref->get('noio'); - if ($print>=2) { - if ( $noio eq "on") { print "ALL history output is turned OFF.$eol"; } - } -} -#----------------------------------------------------------------------------------------------- -# BGC option -my $bgc_mode = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'bgc'}) { - $cfg_ref->set('bgc', $opts{'bgc'}); - } - $bgc_mode = $cfg_ref->get('bgc'); - if ($print>=2) { print "Using $bgc_mode for bgc.$eol"; } - if ( $bgc_mode eq "casa" ) { - print "Warning:: bgc=casa is NOT validated / scientifically supported.$eol"; - } -} - -# NOFIRE option -- currently only in bgc=CN -my $nofire = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'nofire'}) { - $cfg_ref->set('nofire', "on" ); - } - $nofire = $cfg_ref->get('nofire'); - if ( ($nofire eq "on") && ($bgc_mode ne "cn") ) { - die <<"EOF"; -** Cannot turn nofire mode on -- without cn for bgc mode** -EOF - } - if ($print>=2 && $bgc_mode =~ /^cn/ ) { - if ( $nofire eq "off") { print "Wildfires are active as normal.$eol"; } - else { print "Wildfires are turned off.$eol"; } - } -} - -#----------------------------------------------------------------------------------------------- -# SPINUP option for BGC/CN mode only -my $spinup = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'spinup'}) { - $cfg_ref->set('spinup', $opts{'spinup'}); - } - $spinup = $cfg_ref->get('spinup'); - if ( ($spinup ne "normal" ) && ($bgc_mode ne "cn") ) { - die <<"EOF"; -** Cannot turn spinup mode on -- without cn for bgc mode** -** -** Set the bgc mode by the following means from highest to lowest precedence: -** * by the command-line option -bgc cn -** * by a default configuration file, specified by -defaults -EOF - } - if ($print>=2) { print "Using $spinup for spinup for cn mode.$eol"; } -} else { - if ($opts{'spinup'} ne "normal") { - die <<"EOF"; -** Spinup mode can only be controlled with configure for CLM 4.0. -** For CLM 4.5 use the bgc_spinup option to build-namelist -EOF - } -} - -#----------------------------------------------------------------------------------------------- -# comp_intf option -if (defined $opts{'comp_intf'}) { - $cfg_ref->set('comp_intf', $opts{'comp_intf'}); -} -my $comp_intf = $cfg_ref->get('comp_intf'); -if ($print>=2) { print "Using $comp_intf for comp_intf.$eol"; } - - -#----------------------------------------------------------------------------------------------- -# CROP option -my $crpmode = undef; -my $crop = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'crop'}) { - $cfg_ref->set('crop', $opts{'crop'}); - } - $crpmode = "nocrop"; - $crop = $cfg_ref->get('crop'); - if ( $crop eq "on" ) { - $crpmode = "crop"; - } - if ( ($crop eq "on" ) && ($bgc_mode ne "cn") && ($bgc_mode ne "cndv") ) { - die <<"EOF"; -** Cannot turn crop mode on -- without some form of cn for bgc mode** -** -** Set the bgc mode by the following means from highest to lowest precedence: -** * by the command-line options -bgc cn -** * by a default configuration file, specified by -defaults -EOF - } -} - -#----------------------------------------------------------------------------------------------- -# MAXPFT option - -my %maxpatchpft; -my $maxpft = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - $maxpatchpft{'crop'} = 21; - $maxpatchpft{'nocrop'} = 17; - - $cfg_ref->set('maxpft', $maxpatchpft{$crpmode} ); - $maxpft = $cfg_ref->get('maxpft'); - if ( (($bgc_mode eq "cn") || ($bgc_mode eq "cndv")) && ($maxpft != $maxpatchpft{$crpmode}) ) { - die <<"EOF"; -** For CN or CNDV BGC mode you MUST set max patch PFT's to $maxpatchpft{$crpmode} -** -** When the crop model is on then it must be set to $maxpatchpft{'crop'} otherwise to $maxpatchpft{'nocrop'} -** Set the bgc mode, crop and maxpft by the following means from highest to lowest precedence: -** * by the command-line options -bgc, -crop and -maxpft -** * by a default configuration file, specified by -defaults -** -EOF - } - if ( $maxpft > $maxpatchpft{$crpmode} ) { - die <<"EOF"; -** Max patch PFT's can NOT exceed $maxpatchpft{$crpmode} -** -** Set maxpft by the following means from highest to lowest precedence: -** * by the command-line options -maxpft -** * by a default configuration file, specified by -defaults -** -EOF - } - if ( $maxpft != $maxpatchpft{$crpmode} ) { - print "Warning:: running with maxpft NOT equal to $maxpatchpft{$crpmode} is " . - "NOT validated / scientifically supported.$eol"; - } - if ($print>=2) { print "Using $maxpft for maxpft.$eol"; } -} -#----------------------------------------------------------------------------------------------- -# SNICAR_FRC option -my $snicar_frc = undef; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - if (defined $opts{'snicar_frc'}) { - $cfg_ref->set('snicar_frc', $opts{'snicar_frc'}); - } - $snicar_frc = $cfg_ref->get('snicar_frc'); - if ($print>=2) { print "Using $snicar_frc for snicar_frc.$eol"; } -} - -#----------------------------------------------------------------------------------------------- -# Makefile configuration ####################################################################### -#----------------------------------------------------------------------------------------------- - -#----------------------------------------------------------------------------------------------- -# Name of CLM executable. -my $clm_exe = "clm"; - -if ($print>=2) { print "Name of CLM executable: $clm_exe.$eol"; } - -#----------------------------------------------------------------------------------------------- -# For the CPP tokens, start with the defaults (from defaults file) and append the specifications -# from the commandline. That way the user can override defaults since the commandline versions -# occur last. -my $usr_cppdefs = $cfg_ref->get('cppdefs'); -if (defined $opts{'cppdefs'}) { - $usr_cppdefs .= " $opts{'cppdefs'}"; - print "Warning:: running with user defined cppdefs is NOT validated / " . - "scientifically supported.$eol"; -} -$cfg_ref->set('cppdefs', $usr_cppdefs); - -if ($usr_cppdefs and $print>=2) { print "Default and user CPP definitions: \'$usr_cppdefs\'$eol";} - -# The following CPP macro definitions are used to implement the compile-time options. They are -# determined by the configuration parameters that have been set above. They will be appended to -# the CPP definitions that were explicitly set in the defaults file or by the user on the commandline. -my $cfg_cppdefs = ''; -if ($phys->as_long() == $phys->as_long("clm4_0") ) { - $cfg_cppdefs .= " -DMAXPATCH_PFT=$maxpft"; - - if ($bgc_mode eq 'cn') { - $cfg_cppdefs .= " -DCN"; - } - if ($crop eq 'on') { - $cfg_cppdefs .= " -DCROP"; - } - if ($bgc_mode eq 'cndv') { - $cfg_cppdefs .= " -DCNDV -DCN"; - } - if ($nofire eq 'on') { - $cfg_cppdefs .= " -DNOFIRE"; - } - if ($noio eq 'on') { - $cfg_cppdefs .= " -D_NOIO"; - } - if ($spinup eq 'AD') { - $cfg_cppdefs .= " -DAD_SPINUP"; - } elsif ($spinup eq 'exit') { - $cfg_cppdefs .= " -DEXIT_SPINUP"; - } - if ( $snicar_frc eq 'on' ) { - $cfg_cppdefs .= " -DSNICAR_FRC"; - } -} elsif ($phys->as_long() >= $phys->as_long("clm4_5") ) { - # clm4_5 cppdefs -- SHOULD NOT BE ANY! - if ( $cfg_cppdefs ne '' ) { - die <<"EOF"; -** CPP definitions should be empty for clm5_0 and is NOT ** -EOF - } -} elsif ($phys->as_long() == $phys->as_long("clm5_0") ) { - # clm5_0 cppdefs -- SHOULD NOT BE ANY! - if ( $cfg_cppdefs ne '' ) { - die <<"EOF"; -** CPP definitions should be empty for clm5_0 and is NOT ** -EOF - } -} else { - # this should NOT happen - die <<"EOF"; -** Bad CLM physics version ** -EOF -} -# CPP defines to put on Makefile -my $make_cppdefs = "$usr_cppdefs $cfg_cppdefs"; - -if ($print>=2) { print "CPP definitions set by configure: \'$cfg_cppdefs\'$eol"; } - -#----------------------------------------------------------------------------------------------- -# Write configuration files #################################################################### -#----------------------------------------------------------------------------------------------- - -my $fp_filename = 'Filepath'; # name of output filepath file -my $cpp_filename = 'CESM_cppdefs'; # name of output file for clm's cppdefs in cesm - -# Write the filepath file for cesm. -write_filepath_cesmbld("$clm_bld/$fp_filename", $cfg_ref, $phys, allowEnv=>0 ); -if ($print>=2) { print "creating $clm_bld/$fp_filename\n"; } - -# Write the file for clm's cppdefs needed in cesm. -write_cppdefs("$clm_bld/$cpp_filename", $make_cppdefs); -if ($print>=2) { print "creating $clm_bld/$cpp_filename\n"; } - -# Write the configuration file. -$cfg_ref->write_file($config_cache_file, $commandline); -if ($print>=2) { print "creating $config_cache_file\n"; } - -#----------------------------------------------------------------------------------------------- -# Done -chdir( $cwd ) || die <<"EOF"; -** Trouble changing directory back to $cwd -** -EOF -if ($print) { print "CLM configure done.\n"; } -exit; - -#----------------------------------------------------------------------------------------------- -# FINISHED #################################################################################### -#----------------------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- - -sub write_filepath_cesmbld -{ - my ($file, $cfg_ref, $phys, %opts) = @_; - my $fh = new IO::File; - - $fh->open(">$file") or die "** can't open filepath file: $file\n"; - - # configuration parameters used to determine paths - my $usr_src = $cfg_ref->get('usr_src'); - my $clm_root = $cfg_ref->get('clm_root'); - - # User specified source directories. - if ($usr_src =~ /\S+/) { - my @dirs = split ',', $usr_src; - while ( my $dir = shift @dirs ) { - print $fh "$dir\n"; - } - } else { - print $fh "../SourceMods/src.clm\n"; - } - - if ($phys->as_long() == $phys->as_long("clm4_0") ) { - # source root - my $srcdir = "$clm_root/src_clm40"; - if ( ! &is_valid_directory( "$srcdir", %opts ) ) { die "** source directory does not exist: $srcdir\n"; } - - # source directories under root - my @dirs = ( "main", "biogeophys", "biogeochem" ); - foreach my $dir ( @dirs ) { - if ( &is_valid_directory( "$srcdir/$dir", %opts ) ) { - print $fh "$srcdir/$dir\n"; - } else { - die "** source directory does not exist: $srcdir/$dir\n"; - } - } - } else { - # source root - my $srcdir = "$clm_root/src"; - if ( ! &is_valid_directory( "$srcdir", %opts ) ) { die "** source directory does not exist: $srcdir\n"; } - - # source directories under root - my @dirs = ( "main", - "biogeophys", - "biogeochem", - "soilbiogeochem", - "dyn_subgrid", - "init_interp", - "fates", - "fates/main", - "fates/biogeophys", - "fates/biogeochem", - "fates/fire", - "utils", - "cpl" ); - - foreach my $dir ( @dirs ) { - if ( &is_valid_directory( "$srcdir/$dir", %opts ) ) { - print $fh "$srcdir/$dir\n"; - } else { - die "** source directory does not exist: $srcdir/$dir\n"; - } - } - } - - - $fh->close; -} -#------------------------------------------------------------------------------- - -sub write_cppdefs -{ - my ($file, $make_cppdefs) = @_; - my $fh = new IO::File; - - $fh->open(">$file") or die "** can't open cpp defs file: $file\n"; - - print $fh "$make_cppdefs\n"; - $fh->close; -} - -#------------------------------------------------------------------------------- - -sub mkdirp { - my ($dir) = @_; - my (@dirs) = split /\//, $dir; - my (@subdirs, $path); - - # if $dir is absolute pathname then @dirs will start with "" - if ($dirs[0] eq "") { push @subdirs, shift @dirs; } - - while ( @dirs ) { # check that each subdir exists and mkdir if it doesn't - push @subdirs, shift @dirs; - $path = join '/', @subdirs; - unless (-d $path or mkdir($path, 0777)) { return 0; } - } - return 1; -} - -#------------------------------------------------------------------------------- - -sub version { -# The version is found in CLM's ChangeLog file. -# $cfgdir is set by the configure script to the name of its directory. - - my ($cfgdir) = @_; - - my $logfile = "$cfgdir/../doc/ChangeLog"; - - my $fh = IO::File->new($logfile, '<') or die "** can't open ChangeLog file: $logfile\n"; - - while (my $line = <$fh>) { - - if ($line =~ /^Tag name:\s*[clm0-9_.-]*\s*[toin]*\s*([cesmclm0-9_.-]+)$/ ) { - print "$1\n"; - exit; - } - } - -} - -#------------------------------------------------------------------------------- - -sub is_valid_directory { -# -# Validate that the input is a valid existing directory. -# - my ($dir, %opts) = @_; - my $nm = "is_valid_directory"; - - my $valid = 0; - if ( -d $dir ) { $valid = 1; } - return( $valid ); - -} - diff --git a/bld/env_run.xml b/bld/env_run.xml deleted file mode 100644 index 8bf59d0911..0000000000 --- a/bld/env_run.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/bld/listDefaultNamelist.pl b/bld/listDefaultNamelist.pl deleted file mode 100755 index 063b1e6af0..0000000000 --- a/bld/listDefaultNamelist.pl +++ /dev/null @@ -1,358 +0,0 @@ -#!/usr/bin/env perl -#======================================================================= -# -# This is a script to list the missing files in your CESM inputdata area -# for a list of resolutions and model configurations. The list goes -# out to the file: clm.input_data_list. The check_input_data script -# can then be used to get this list of files from the SVN inputdata -# repository. -# -# Usage: -# -# listDefaultNamelist.pl [options] -# -# To get help on options and usage: -# -# listDefaultNamelist.pl -help -# -# To then get the files from the CESM SVN repository: -# -# ../../cime/scripts/Tools/check_input_data -datalistdir . -export -# -#======================================================================= - -use strict; -use Cwd qw(getcwd abs_path); -use Getopt::Long; -use English; -#use diagnostics; - -#----------------------------------------------------------------------------------------------- - -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program -my $ProgDir = $1; # name of directory where program lives - -my $cwd = getcwd(); # current working directory -my $cfgdir; - -my $printTimes = 0; - -if ($ProgDir) { $cfgdir = $ProgDir; } -else { $cfgdir = $cwd; } - -#----------------------------------------------------------------------------------------------- -# Add $cfgdir to the list of paths that Perl searches for modules - -my @dirs = ( "$cfgdir", "../../../cime/utils/perl5lib" ); -unshift @INC, @dirs; - -require queryDefaultXML; - -# Defaults -my $cesmroot = abs_path( "$cfgdir/../../../"); - -# The namelist defaults file contains default values for all required namelist variables. -my @nl_defaults_files = ( "$cfgdir/namelist_files/namelist_defaults_overall.xml", - "$cfgdir/namelist_files/namelist_defaults_drv.xml", - ); -my $list = "clm.input_data_list"; -my %list_of_all_files; - -sub usage { - die < undef, - silent => undef, - csmdata => "default", - list => $list, - usrdat => undef, - help => undef, - phys => "clm4_5", - ); - - my $cmdline = "@ARGV"; - GetOptions( - "d|csmdata=s" => \$opts{'csmdata'}, - "r|res=s" => \$opts{'res'}, - "s|silent" => \$opts{'silent'}, - "u|usrdat=s" => \$opts{'usrdat'}, - "h|elp" => \$opts{'help'}, - ) or usage(); - - # Check for unparsed arguments - if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); - } - if ( $opts{'help'} ) { - usage(); - } - # Set if should do extra printing or not (if silent mode is not set) - my $printing = 1; - if ( defined($opts{'silent'}) ) { - $printing = 0; - } - # - # Check for required arguments - # - foreach my $req ( "res", "list" ) { - if ( ! defined($opts{$req}) ) { - print "ERROR: $req NOT set and it is a required argument\n"; - usage(); - } - } - my %inputopts; - my @nl_definition_files = ( - "$cfgdir/namelist_files/namelist_definition_$opts{'phys'}.xml" - ); - $inputopts{'nldef_files'} = \@nl_definition_files; - $inputopts{'empty_cfg_file'} = "$cfgdir/config_files/config_definition_$opts{'phys'}.xml"; - - my $definition = Build::NamelistDefinition->new( $nl_definition_files[0] ); - foreach my $nl_defin_file ( @nl_definition_files ) { - $definition->add( "$nl_defin_file" ); - } - my $cfg = Build::Config->new( $inputopts{'empty_cfg_file'} ); - - # Resolutions... - my @resolutions; - if ( $opts{'res'} eq "all" ) { - @resolutions = $definition->get_valid_values( "res", 'noquotes'=>1 ); - } else { - @resolutions = split( /,/, $opts{'res'} ); - } - - # Input options - push @nl_defaults_files, "$cfgdir/namelist_files/namelist_defaults_$opts{'phys'}.xml"; - if ( defined($opts{'usrdat'}) ) { - push @nl_defaults_files, "$cfgdir/namelist_files/namelist_defaults_usr_files.xml"; - } - $inputopts{'files'} = \@nl_defaults_files; - $inputopts{'printing'} = $printing; - $inputopts{'ProgName'} = $ProgName; - $inputopts{'cmdline'} = $cmdline; - $inputopts{'cfgdir'} = $cfgdir; - if ( $opts{'csmdata'} eq "default" && $ENV{'CSMDATA'} ne "" ) { - $opts{'csmdata'} = $ENV{'CSMDATA'}; - } - $inputopts{'csmdata'} = $opts{'csmdata'}; - $inputopts{'config'} = "noconfig"; - my %files; - # - # Loop over all resolutions asked for: 1.9x2.5, 10x15, 64x128 etc. - # - foreach my $res ( @resolutions ) { - if ( ! $definition->is_valid_value( "res", "'$res'" ) && $res ne $opts{'usrdat'} ) { - die "ERROR: Input resolution: $res is NOT a valid resolution\n"; - } - $inputopts{'hgrid'} = $res; - print "Resolution = $res\n" if $printing; - my %settings; - if ( $res eq $opts{'usrdat'} ) { - $settings{'clm_usr_name'} = $opts{'usrdat'}; - $settings{'csmdata'} = $opts{'csmdata'}; - $settings{'notest'} = 1; - } - # - # Loop for all possible land masks: USGS, gx1v6, gx3v5 etc. - # - foreach my $mask ( $definition->get_valid_values( "mask", 'noquotes'=>1 ) ) { - print "Mask = $mask \n" if $printing; - $settings{'mask'} = $mask; - # - # Loop over all possible simulation year: 1890, 2000, 2100 etc. - # - $settings{'sim_year_range'} = "constant"; - my @rcps = $definition->get_valid_values( "rcp", 'noquotes'=>1 ); - $settings{'rcp'} = $rcps[0]; -YEAR: foreach my $sim_year ( $definition->get_valid_values( "sim_year", 'noquotes'=>1 ) ) { - print "sim_year = $sim_year\n" if $printing; - $settings{'sim_year'} = $sim_year; - if ( $sim_year ne 1850 && $sim_year ne 2000 && $sim_year > 1800 ) { next YEAR; } - - my @bgcsettings = $cfg->get_valid_values( "bgc" ); - #my @glc_meclasses = $cfg->get_valid_values( "glc_nec" ); - my @glc_meclasses = ( 0, 10 ); - print "glc_nec = @glc_meclasses bgc=@bgcsettings\n" if $printing; - # - # Loop over all possible BGC settings - # - my $phys = $opts{'phys'}; - foreach my $bgc ( @bgcsettings ) { - $settings{'bgc'} = $bgc; - my @crop_vals; - if ( $bgc =~ /^cn/ ) { - @crop_vals = ( "on", "off" ); - } else { - @crop_vals = ( "off" ); - } - # - # Loop over all possible glc_nec settings - # - foreach my $glc_nec ( @glc_meclasses ) { - $settings{'glc_nec'} = $glc_nec; - # - # Loop over all possible crop settings - # - foreach my $crop ( @crop_vals ) { - $settings{'crop'} = $crop; - if ( $crop eq "on" ) { - $settings{'maxpft'} = 78; - } else { - $settings{'maxpft'} = 17; - } - my @irrigset; - if ( $glc_nec == 0 && $sim_year == 2000 ) { - @irrigset= ( ".true.", ".false." ); - } else { - @irrigset= ( ".false." ); - } - # - # Loop over irrigation settings - # - foreach my $irrig ( @irrigset ) { - $settings{'irrig'} = $irrig; - $inputopts{'namelist'} = "clm_inparm"; - &GetListofNeededFiles( \%inputopts, \%settings, \%files ); - if ( $printTimes >= 1 ) { - $inputopts{'printing'} = 0; - } - } - } - } - } - } - # - # Now do sim-year ranges - # - $settings{'bgc'} = "cn"; - $settings{'irrig'} = ".false."; - $inputopts{'namelist'} = "clm_inparm"; - foreach my $sim_year_range ( $definition->get_valid_values( "sim_year_range", 'noquotes'=>1 ) ) { - $settings{'sim_year_range'} = $sim_year_range; - if ( $sim_year_range =~ /([0-9]+)-([0-9]+)/ ) { - $settings{'sim_year'} = $1; - } - # - # Loop over all possible rcp's - # - print "sim_year_range=$sim_year_range rcp=@rcps\n" if $printing; - foreach my $rcp ( @rcps ) { - $settings{'rcp'} = $rcp; - &GetListofNeededFiles( \%inputopts, \%settings, \%files ); - if ( $printTimes >= 1 ) { - $inputopts{'printing'} = 0; - } - } - } - } - } - # - # Loop over directories that need to have files copied into - # - my $hostname; - my $csmdata = $inputopts{'csmdata'}; - open( OUT, ">$list" ) || die "ERROR: trouble opening output file: $list"; - foreach my $dir ( sort(keys(%files)) ) { - if ( $dir eq "." ) { next; } - if ( $dir eq "/" ) { next; } - if ( $dir eq "\n" ) { next; } - if ( $dir eq "" ) { next; } - if ( ! defined($dir) ) { next; } - my $files_ref = $files{$dir}; - my @files = @$files_ref; - foreach my $file ( @files ) { - if ( $file !~ /\n$/ ) { $file = "$file\n"; } - print OUT "file = \$DIN_LOC_ROOT/$file"; - } - } - close( OUT ); - if ( $printing ) { - print "\n\nSuccessful\n\n" - } diff --git a/bld/namelist_files/LogMessages.pm b/bld/namelist_files/LogMessages.pm deleted file mode 100755 index 77f0569bcc..0000000000 --- a/bld/namelist_files/LogMessages.pm +++ /dev/null @@ -1,244 +0,0 @@ -package namelist_files::LogMessages; -my $pkg_nm = 'namelist_files::LogMessages'; -#----------------------------------------------------------------------------------------------- -# -# SYNOPSIS -# -# require namelist_files::LogMessages; -# -# my %opts; -# my $log = namelist_files::LogMessages->new("ProgName", \%opts); -# $log->message("message to print"); -# $log->verbose_message("message to print only if verbose mode is on"); -# $log->warning("Warning message"); -# $log->exit_message("clean exit"); -# $log->fatal_error("die with fatal error"); -# $log->final_exit("Final message to send (and exit"); -# -# -# DESCRIPTION -# -# Handles log messages for perl. Sets up log messages according to verbose -# or silent setting. It also handles warnings printing them, but on finalization -# aborting unless ignore_warnings was set. -# -# COLLABORATORS: None -# -#----------------------------------------------------------------------------------------------- -# -# Date Author Modification -# 10/06/2017 Erik Kluzek creation -# -#-------------------------------------------------------------------------------------------- - -use strict; -#use warnings; -#use diagnostics; - -#------------------------------------------------------------------------------- - -sub new { - my $class = shift; - my $ProgName = shift; - my %opts = %{shift()}; - - my $nm = "$class\:\:new"; - my $self = {}; - bless($self, $class); - $self->{'nwarns'} = 0; - $self->{'verbosity'} = 1; - $self->{'NO_EXIT'} = $opts{'NO_EXIT'}; - $self->{'ProgName'} = $ProgName; - $self->{'ignore_warnings'} = $opts{'ignore_warnings'}; - $self->__set_print_level( \%opts ); - return( $self ); -} - - -#------------------------------------------------------------------------------- - -sub __set_print_level { - my $self = shift; - # Define print levels: - # 0 - only issue fatal error messages - # 1 - only informs what files are created (default) - # 2 - verbose - my %opts = %{shift()}; - - if ( $opts{'silent'} && $opts{'verbose'} ) { - $self->fatal_error( "Can not set both the -silent and the -verbose options -- set one or the other" ); - } - my $verbosity = 1; - if ($opts{'silent'}) { $verbosity = 0; } - if ($opts{'verbose'}) { $verbosity = 2; } - $self->{'verbosity'} = $verbosity; - $self->{'print_verbose'} = 2; -} - -#------------------------------------------------------------------------------- - -sub message { - my $self = shift; - my ($message) = @_; - if ($self->{'verbosity'} > 0) { - print "$message\n"; - } -} - -#------------------------------------------------------------------------------- - -sub verbose_message { - my $self = shift; - - my ($message) = @_; - if ($self->{'verbosity'} >= $self->{'print_verbose'}) { - print "$message\n"; - } -} -#------------------------------------------------------------------------------- - -sub nwarns { - my $self = shift; - - return( $self->{'nwarns'} ); -} - -#------------------------------------------------------------------------------- - -sub final_exit { - my $self = shift; - my ($message) = @_; - if ( $self->{'nwarns'} > 0 ) { - $self->message( "\n\nYou ran with the -ignore_warnings options and allowed $self->{'nwarns'} to go past\n" ); - } - $self->verbose_message( $message ); - if ( $self->{'NO_EXIT'} ) { - die - } else { - exit; - } -} - -#------------------------------------------------------------------------------- -# Some simple subroutines to do a clean exit, print warning, or a fatal error - -sub exit_message { - my $self = shift; - my ($message) = @_; - print "$self->{ProgName} : $message\n"; - if ( $self->{'NO_EXIT'} ) { - die - } else { - exit; - } -} - -#------------------------------------------------------------------------------- - -sub warning { - my $self = shift; - my $message = shift; - - $self->{'nwarns'} = $self->{'nwarns'} + 1; - my $func_name = (caller(1))[3]; - if ( $self->{'ignore_warnings'} ) { - print "Warning : $self->{ProgName}::${func_name}() : $message\n\n"; - } else { - die "Warning : $self->{ProgName}::${func_name}() : $message\n" . - " -- Add -ignore_warnings option to CLM_BLDNML_OPTS to ignore this warning\n\n"; - } -} - -#------------------------------------------------------------------------------- - -sub fatal_error { - my $self = shift; - my ($message) = @_; - my $func_name = (caller(1))[3]; - die "ERROR : $self->{ProgName}::${func_name}() : $message\n"; -} - -#------------------------------------------------------------------------------- - -#----------------------------------------------------------------------------------------------- -# Unit testing of above -#----------------------------------------------------------------------------------------------- -if ( ! defined(caller) && $#ARGV == -1 ) { - package LogMessage_unit_tester; - - require Test::More; - Test::More->import( ); - - plan( tests=>11 ); - - sub testit { - print "unit tester\n"; - my %opts; - my $message; - - # Standard verbose level, test all methods - $opts{'NO_EXIT'} = 1; - my $log = namelist_files::LogMessages->new("ProgName", \%opts); - isa_ok($log, "namelist_files::LogMessages", "Created LogMessages object"); - $log->message("message to print"); - $log->verbose_message("YOU SHOULD NOT SEE THIS MESSAGE BECAUSE IT IS VERBOSE AND VERBOSE NOT ON"); - $message = "Warning message"; - is ( $log->nwarns(), 0, "Make sure have zero warnings" ); - eval{ $log->warning($message); }; - like( $@, qr/$message/, "check that a warning dies without ignore_warnings option" ); - is ( $log->nwarns(), 1, "Make sure have one warning" ); - $message = "die with fatal error"; - eval{ $log->fatal_error($message); }; - like( $@, qr/$message/, "check that a fatal_error dies" ); - $message = "exit with exit message"; - eval{ $log->exit_message($message); }; - like( $@, qr/Died/, "check that a exit_message exits" ); - $message = "Final message to send"; - eval{ $log->final_exit($message); }; - like( $@, qr/Died/, "check that a final exits" ); - - # Test ignore_warnings option and verbose mode - $opts{'ignore_warnings'} = 1; - $opts{'verbose'} = 1; - $opts{'NO_EXIT'} = 1; - $log = namelist_files::LogMessages->new("ProgName", \%opts); - isa_ok($log, "namelist_files::LogMessages", "Created LogMessages object"); - $log->verbose_message("message to print only if verbose mode is on"); - $log->warning("Warning message"); - $log->warning("Warning message2"); - $log->warning("Warning message3"); - $log->warning("Warning message4"); - $log->warning("Warning message5"); - is ( $log->nwarns(), 5, "Make sure have five warnings" ); - eval{ $log->final_exit($message); }; - print "content: $@\n"; - like( $@, qr/Died/, "check that a final_exit with warning exits" ); - # silent mode - $opts{'ignore_warnings'} = 0; - $opts{'verbose'} = 0; - $opts{'silent'} = 1; - $opts{'NO_EXIT'} = 1; - $log = namelist_files::LogMessages->new("ProgName", \%opts); - $log->message("YOU SHOULD NOT SEE THIS MESSAGE BECAUSE SILENT MODE IS ON"); - $log->verbose_message("YOU SHOULD NOT SEE THIS VERBOSE MESSAGE BECAUSE SILENT MODE IS ON"); - # Should die with error if both silent and verbose mode is on - $opts{'ignore_warnings'} = 0; - $opts{'verbose'} = 1; - $opts{'silent'} = 1; - $opts{'NO_EXIT'} = 1; - eval{ $log = namelist_files::LogMessages->new("ProgName", \%opts); }; - print "content: $@\n"; - like( $@, qr/ERROR : /, "check that died if both verbose and silent mode is on" ); - print "\nSuccessfully ran all tests\n"; - } -} - -#----------------------------------------------------------------------------------------------- -# Determine if you should run the unit test or if this is being called from a require statement -#----------------------------------------------------------------------------------------------- - -if ( defined(caller) ) { - 1 # to make use or require happy -} elsif ( $#ARGV == -1 ) { - &LogMessage_unit_tester::testit(); -} diff --git a/bld/namelist_files/checkmapfiles.ncl b/bld/namelist_files/checkmapfiles.ncl deleted file mode 100644 index 6302615d1c..0000000000 --- a/bld/namelist_files/checkmapfiles.ncl +++ /dev/null @@ -1,236 +0,0 @@ -; -; Check that the *_b values are the same between the mapping files -; at the same output resolution. -; -; Erik Kluzek -; Nov/18/2011 -; $Id$ -; $HeadURL; -; - - print( "Check that datm mapping files are consistent" ); - resolutions = (/ "128x256", "64x128", "48x96", "32x64", "8x16", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /); - - space = " "; - badres = 0 - badresolutions = new( (/ 1000 /), string ) - chkres = 0 - chkresolutions = new( (/ 1000 /), string ) - -procedure checkit( desc:string, maxdiff:numeric, res:string, lmask:string, eps:numeric ) -; -; check that difference is within reasonable tolerance... -; -begin - reso = res+"_"+lmask; - if ( maxdiff .gt. eps )then - print( space+space+space+desc+" are off by more than tolerance for "+reso+" resolution" ); - print( space+space+space+"maximum difference = "+maxdiff ); - if ( .not. any(badresolutions .eq. reso ) )then - badresolutions(badres) = reso; - badres = badres + 1 - end if - else - print( space+space+space+"File OK for "+desc+"!" ); - end if - if ( .not. any(chkresolutions .eq. reso ) )then - chkresolutions(chkres) = reso; - chkres = chkres + 1 - end if -end - - -function checkdims( desc:string, dsizefile1 [*]:integer, dsizefile2 [*]:integer, res:string, lmask:string ) -; -; check that dimensions are the same between the file variables -; -begin - reso = res+"_"+lmask; - if ( any( dsizefile1 .ne. dsizefile2) )then - print( space+space+space+desc+" dimensions are different for "+reso+" resolution" ); - print( space+space+space+"dim first file "+dsizefile1 ); - print( space+space+space+"dim second file "+dsizefile2 ); - if ( .not. any(badresolutions .eq. reso ) )then - badresolutions(badres) = reso; - badres = badres + 1 - end if - return( False ); - else - print( space+space+space+"File dims OK for "+desc+"!" ); - return( True ); - end if - if ( .not. any(chkresolutions .eq. reso ) )then - chkresolutions(chkres) = reso; - chkres = chkres + 1 - end if -end - -begin - - csmdata = getenv("CSMDATA"); - clmroot = getenv("CLM_ROOT"); - querynml = "bld/queryDefaultNamelist.pl -silent -justvalue -namelist clmexp"; - if ( .not. ismissing(csmdata) )then - querynml = querynml+" -csmdata "+csmdata; - end if - if ( ismissing(clmroot) )then - querynml = "../../"+querynml; - else - querynml = clmroot+"/components/clm/"+querynml; - end if - - print( "query string="+querynml ) - - - mapgrids = (/"0.5x0.5_MODIS", "0.5x0.5_AVHRR", "0.5x0.5_MODIS", "5x5min_nomask", "5x5min_IGBP-GSDP", "5x5min_ISRIC-WISE", "10x10min_nomask", "3x3min_MODIS", "3x3min_LandScan2004", "3x3min_GLOBE-Gardner", "3x3min_GLOBE-Gardner-mergeGIS", "0.9x1.25_GRDC", "360x720cru_cruncep", "1km-merge-10min_HYDRO1K-merge-nomask"/); - do i = 0, dimsizes(resolutions)-1 - res = resolutions(i); - print( "Go through maps for Resolution: "+res ); - do j = 0, dimsizes(mapgrids)-1 - grid = str_get_field( mapgrids(j), 1, "_" ); - lmask = str_get_field( mapgrids(j), 2, "_" ); - print( space+"Look for maps from Grid: "+grid+"_"+lmask); - - querynmlres = querynml+" -options frm_lmask="+lmask+",frm_hgrid="+grid+",to_hgrid="+res+",to_lmask=nomask"; - ; - ; Get map filename and open it - ; - mapfile = systemfunc( querynmlres+" -var map" ); - if ( systemfunc("test -f "+mapfile+"; echo $?" ) .ne. 0 )then - delete( mapfile ); - continue; - end if - print( space+"Use mapfile: "+mapfile ); - ncm = addfile( mapfile, "r" ); - - if ( .not. isvar("ncm0") )then - ncm0 = ncm; - else - vars = (/"yc_b", "xc_b", "area_b", "xv_b", "yv_b" /); - k = 0; - if ( checkdims( vars(k), dimsizes(ncm->$vars(k)$), dimsizes(ncm0->$vars(k)$), res, "nomask" ) )then - do k = 0, dimsizes(vars)-1 - maxdiff = max( abs(ncm->$vars(k)$ - ncm0->$vars(k)$) ); - checkit( vars(k), maxdiff, res, "nomask", 1.e-12 ); - delete( maxdiff ); - end do - var = "mask_b" - imaxdiff = max( abs(ncm->$var$ - ncm0->$var$) ); - checkit( var, imaxdiff, res, "nomask", 1.e-12 ); - delete( imaxdiff ); - end if - delete( ncm ); - end if - delete( mapfile ); - - end do - - delete( grid ); - delete( lmask ); - delete( res ); - if ( isvar("ncm0") )then - delete( ncm0 ); - end if - - end do - ; - ; go the other direction now check the _a variables - ; - mksrf_files = (/"mksrf_fvegtyp", "mksrf_fglacier", "mksrf_furbtopo", "mksrf_flai", "mksrf_fsoitex", "mksrf_fsoicol", "mksrf_ffrac", "mksrf_fmax", "mksrf_ftopo", "mksrf_firrig", "mksrf_forganic", "mksrf_flakwat", "mksrf_fwetlnd", "mksrf_furban", "mksrf_fvocef"/) - do i = 0, dimsizes(mapgrids)-1 - grid = str_get_field( mapgrids(i), 1, "_" ); - lmask = str_get_field( mapgrids(i), 2, "_" ); - print( "Grid: "+grid); - print( "Mask: "+lmask); - do j = 0, dimsizes(resolutions)-1 - res = resolutions(j); - print( "res: "+res ); - - querynmlres = querynml+" -options frm_lmask="+lmask+",frm_hgrid="+grid+",to_hgrid="+res+",to_lmask=nomask"; - ; - ; Get map filename and open it - ; - mapfile = systemfunc( querynmlres+" -var map" ); - if ( systemfunc("test -f "+mapfile+"; echo $?" ) .ne. 0 )then - delete( mapfile ); - continue; - end if - print( space+"Use mapfile: "+mapfile ); - ncm = addfile( mapfile, "r" ); - - if ( .not. isvar("ncm0") )then - ncm0 = ncm; - else - vars = (/"yc_a", "xc_a", "area_a", "xv_a", "yv_a" /); - vars2 = (/"LATIXY", "LONGXY", "AREA" /); - k = 0; - if ( checkdims( vars(k), dimsizes(ncm->$vars(k)$), dimsizes(ncm0->$vars(k)$), res, "nomask" ) )then - do k = 0, dimsizes(vars)-1 - maxdiff = max( abs(ncm->$vars(k)$ - ncm0->$vars(k)$) ); - checkit( vars(k), maxdiff, res, "nomask", 1.e-12 ); - delete( maxdiff ); - end do - end if - var = "mask_a" - imaxdiff = max( abs(ncm->$var$ - ncm0->$var$) ); - checkit( var, imaxdiff, res, "nomask", 1.e-12 ); - delete( imaxdiff ); - ; - ; Get mksurfdata input datasets - ; - do k = 0, dimsizes(mksrf_files)-1 - srffile = systemfunc( querynmlres+" -var "+mksrf_files(k) ); - if ( systemfunc("test -f "+srffile+"; echo $?" ) .ne. 0 )then - delete( srffile ); - continue; - end if - print( space+"Use srffile: "+srffile ); - ncs = addfile( srffile, "r" ); - n = 0; - if ( checkdims( vars(n), dimsizes(ncm->$vars(n)$), ndtooned(dimsizes(ncs->$vars2(n)$)), res, "nomask" ) )then - do n = 0, dimsizes(vars2)-1 - maxdiff = max( abs(ncm->$vars(n)$ - ndtooned(ncs->$vars2(n)$)) ); - checkit( vars(n), maxdiff, res, "nomask", 1.e-12 ); - delete( maxdiff ); - end do - var = "mask_a" - var2 = "LANDMASK" - imaxdiff = max( abs(ncm->$var$ - ndtooned(ncs->$var2$)) ); - checkit( var, imaxdiff, res, "nomask", 1.e-12 ); - end if - delete( ncs ); - end do - delete( ncm ); - end if - delete( mapfile ); - - end do - - if ( isvar("vars") )then - delete( vars ) - end if - if ( isvar("vars2") )then - delete( vars2 ) - end if - delete( grid ); - delete( lmask ); - delete( res ); - if ( isvar("ncm0") )then - delete( ncm0 ); - end if - - end do - if ( chkres .gt. 0 )then - print( "resolutions checked = " ); - print( chkresolutions(0:chkres-1) ); - end if - if ( badres .gt. 0 )then - print( "badresolutions = " ); - print( badresolutions(0:badres-1) ); - end if - - print( "===============================" ); - print( "Successfully went through files" ); - -end - diff --git a/bld/namelist_files/createMapEntry.pl b/bld/namelist_files/createMapEntry.pl deleted file mode 100755 index d767eff939..0000000000 --- a/bld/namelist_files/createMapEntry.pl +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env perl -# -# July 18 2012 Muszala -# -# createMapEntry.pl - A simple script to dump a list of mappings for a specified resolution to then -# cut and paste into namelist_defaults_clm.xml. A better way is to write the output of this script -# to a file and then directly insert that file into namelist_defaults_clm.xml (using :r foo in vim for -# example). -# -# Example usage:>> ./createMapEntry.pl 1x1_brazil -# will create XML entries for maps in ../lnd/clm2/mappingdata/maps/1x1_brazil such as: -# -# lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_AVHRR_to_1x1_brazil_nomask_aave_da_c120717.nc -# -use Cwd; -use strict; -use English; -use IO::File; -use Getopt::Long; - - my $date = scalar localtime() ; - my $scriptName; - ($scriptName = $0) =~ s!(.*)/!!; # get name of script - my $cwd = getcwd(); - my $CSMDATA = "/glade/p/cesm/cseg/inputdata"; - - if ($#ARGV != 0 ) { - usage(); - exit; - } - my $grid=$ARGV[0]; - - sub usage { - die < - is the resolution to use to dump text to paste into namelist_defaults_clm.xml -EOF - } - - #~# set up directory paths - my $pathStub="lnd/clm2/mappingdata/maps"; - my $partialPath="$pathStub/$grid"; - my $fullPath = "$CSMDATA/$partialPath"; - - #~# open and read directory - opendir DIR, $fullPath or die "Cannot read dir! $fullPath"; - my @list = readdir DIR; - - #~# print a unique start string in the XML comments - print "\n"; - print "\n \n\n"; - - foreach my $foo ( @list ) { - next if ($foo =~ m/^\./); #~# skip anything in the directory with a leading or stand alone 'dot' - my @tokens = split(/_/, $foo); #~# split foo name by the underscore - #~# write out lines for namelist_defaults_clm.xml - print "$partialPath/$foo\n"; - } - - #~# print a unique end string in the XML comments - print "\n \n"; - closedir(DIR); - exit 0; diff --git a/bld/namelist_files/history_fields.xsl b/bld/namelist_files/history_fields.xsl deleted file mode 100644 index 25c2332e9d..0000000000 --- a/bld/namelist_files/history_fields.xsl +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - CLM History Fields - - -
-

Definition of CLM history variables

-

Included in the table are the following pieces of information:

-
    -
  • Variable name.
  • -
  • Long name description.
  • -
  • units
  • -
- - - - - - - - - - - - - - - - -
CLM History Fields
NameLong-nameUnits
-
- - -
- -
diff --git a/bld/namelist_files/namelist_defaults.xsl b/bld/namelist_files/namelist_defaults.xsl deleted file mode 100644 index bfebd0db89..0000000000 --- a/bld/namelist_files/namelist_defaults.xsl +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - CLM Namelist Defaults - - -

Default Values for Namelist Variables

-

Included in the table are the following pieces of information:

-

Table headers include:

-
    -
  • Name of variable
  • -
  • Horizontal grid resolution
  • -
  • Land ocean mask type
  • -
  • Simulation year
  • -
  • Simulation year range (for transient datasets)
  • -
-

Miscellaneous items include:

-
    -
  1. Biogeochemistry (BGC) type (none, CN, CNDV)
  2. -
  3. Initial condition date (ymd - year month day)
  4. -
  5. Initial condition time of day (tod) (sec)
  6. -
  7. Maximum number of Plant Function Types (maxpft)
  8. -
  9. Number of glacier multiple elevation classes (glc_nec)
  10. -
  11. Site specific point name (sitespf_pt)
  12. -
  13. Crop model (crop)
  14. -
  15. Irrigation model (irrig) (clm4_0 only)
  16. -
  17. Data model forcing source (forcing)
  18. -
  19. Representative concentration pathway for future scenarios (rcp)
  20. -
  21. New good wood harvest (newwoodharv)
  22. -
  23. CN Spin-up mode (spinup)
  24. -
  25. Type of file (type)
  26. -
  27. Grid mapping to (to_hgrid)
  28. -
  29. Land-mask mapping to (to_lmask)
  30. -
  31. High resolution file? (hires)
  32. -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Namelist Defaults
NameHorz. GridMaskSim yearSim year rangeMiscellaneous
Default Value for this Configuration
- - - - - - - - - - - All res - - - - - - - - - - - - - - - MODIS - - - All masks - - - - - - - - - All yrs - - - - - - - - - All sim-yr-rng - - - - - bgc= - - - ymd= - - - tod= - - - maxpft= - - - glc_nec= - - - sitespf_pt= - - - datm_presaero= - - - crop= - - - irrig= - - - spinup= - - - forcing= - - - rcp= - - - newwoodharv= - - - type= - - - to_hgrid= - - - to_lmask= - - - hires= - -
Value:
- - - - -
- -
diff --git a/bld/namelist_files/namelist_defaults_clm4_0.xml b/bld/namelist_files/namelist_defaults_clm4_0.xml deleted file mode 100644 index 3dc98acb75..0000000000 --- a/bld/namelist_files/namelist_defaults_clm4_0.xml +++ /dev/null @@ -1,1069 +0,0 @@ - - - - - - - - -1800 - - -379.0 -379.0 -284.7 - - -constant - - -PROG_CROP_ONLY -PROG_CROP_ONLY -NONE -NONE - - -clm4_0_CRUv7 - - -off - - -.true. -'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT' -'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS' -'TLAI','TWS' --8760 - - -.false. - - -0 -1 - - -0.80,0.55 -0.60,0.40 -0.60,0.40 -0.60,0.40 -0.60,0.40 -0.60,0.40 - - -ON_WASTEHEAT - - -.false. - - - - - -lnd/clm2/pftdata/pft-physiology.clm40.c130424.nc - - -lnd/clm2/initdata/clmi.BCN.0182-01-01_0.47x0.63_g1v6_simyr1850_c120324.nc - - -lnd/clm2/initdata/clmi.BCN.0182-01-01_0.47x0.63_g1v6_simyr1850_c120324.nc - - -lnd/clm2/initdata/clmi.BCN.0182-01-01_0.47x0.63_g1v6_simyr1850_c120324.nc - - - - - -lnd/clm2/initdata_map/clmi.I1850Clm40CnGswGs.1441-01-01.0.9x1.25_gx1v6_simyr1850_c170823.nc - - -lnd/clm2/initdata_map/clmi.I1850Clm40CnGswGs.1441-01-01.0.9x1.25_gx1v6_simyr1850_c170823.nc - - -lnd/clm2/initdata_map/clmi.I1850Clm40CnCruGs.3362-01-01.0.9x1.25_gx1v6_simyr1850_c171222.nc - - -lnd/clm2/initdata_map/clmi.I1850Clm40CnCruGs.3362-01-01.0.9x1.25_gx1v6_simyr1850_c171222.nc - - - - -lnd/clm2/initdata/clmi.IQirrcr_2000-01-01_1.9x2.5_gx1v6_c101115.nc - - -ccsm4_init/b40.1850.track1.2deg.003/year_401/b40.1850.track1.2deg.003.clm2.r.0401-01-01-00000.nc - - -ccsm4_init/b40.1850.track1.2deg.003/year_401/b40.1850.track1.2deg.003.clm2.r.0401-01-01-00000.nc - - -ccsm4_init/b40.1850.track1.2deg.003/year_401/b40.1850.track1.2deg.003.clm2.r.0401-01-01-00000.nc - - -lnd/clm2/initdata/clmi.IQCNDV.0201-01-01_1.9x2.5_gx1v6_simyr2000_c100316.nc - - -ccsm4_init/b40.1850.track1.1deg.006/0863-01-01/b40.1850.track1.1deg.006.clm2.r.0863-01-01-00000.nc - - -ccsm4_init/b40.1850.track1.1deg.006/0863-01-01/b40.1850.track1.1deg.006.clm2.r.0863-01-01-00000.nc - - -ccsm4_init/b40.1850.track1.1deg.006/0863-01-01/b40.1850.track1.1deg.006.clm2.r.0863-01-01-00000.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_0.9x1.25_gx1v6_simyr2000_c100303.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_0.9x1.25_gx1v6_simyr2000_c100303.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_0.9x1.25_gx1v6_simyr2000_c100303.nc - - - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_1.9x2.5_gx1v6_simyr2000_c100309.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_1.9x2.5_gx1v6_simyr2000_c100309.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_1.9x2.5_gx1v6_simyr2000_c100309.nc - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.IQCNCROPmp20_1992-01-01_1.9x2.5_gx1v6_simyr2000_c110427.nc - - - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_4x5_gx3v7_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_4x5_gx3v7_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.BCN.1949-01-01_4x5_gx3v7_simyr1850_c100322.nc - - -lnd/clm2/initdata/clmi.BCN.0507-01-01_48x96_gx3v7_simyr1850_c120929.nc - - -lnd/clm2/initdata/clmi.BCN.0507-01-01_48x96_gx3v7_simyr1850_c120929.nc - - -lnd/clm2/initdata/clmi.BCN.0507-01-01_48x96_gx3v7_simyr1850_c120929.nc - - -lnd/clm2/initdata/clmi.BCN_0051-01-01_48x96_gx3v7_simyr2000_c120930.nc - - -lnd/clm2/initdata/clmi.BCN_0051-01-01_48x96_gx3v7_simyr2000_c120930.nc - - -lnd/clm2/initdata/clmi.BCN_0051-01-01_48x96_gx3v7_simyr2000_c120930.nc - - -lnd/clm2/initdata_map/clmi.BCN.0170-01-01_ne30np4_gx1v6_simyr1850_c121001.nc - - -lnd/clm2/initdata_map/clmi.BCN.0170-01-01_ne30np4_gx1v6_simyr1850_c121001.nc - - -lnd/clm2/initdata_map/clmi.BCN.0170-01-01_ne30np4_gx1v6_simyr1850_c121001.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_ne30np4_gx1v6_simyr2000_c110328.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_ne30np4_gx1v6_simyr2000_c110328.nc - - -lnd/clm2/initdata/clmi.BCN.2000-01-01_ne30np4_gx1v6_simyr2000_c110328.nc - - - -lnd/clm2/surfdata/surfdata_10x15_USGS_070307.nc - - - - - - -lnd/clm2/surfdata_map/surfdata_48x96_simyr2000_glcmec10_c120927.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr2000_glcmec10_c120927.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_simyr2000_glcmec10_c120927.nc - - -lnd/clm2/surfdata_map/surfdata_48x96_simyr1850_glcmec10_c120927.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_simyr1850_glcmec10_c120927.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_simyr1850_glcmec10_c120927.nc - - - -lnd/clm2/surfdata/surfdata_360x720_nourb_simyr2000_c120620.nc - -lnd/clm2/surfdata/surfdata_128x256_simyr2000_c100406.nc - -lnd/clm2/surfdata/surfdata_64x128_simyr2000_c090928.nc - -lnd/clm2/surfdata_map/surfdata_48x96_simyr2000_c120126.nc - -lnd/clm2/surfdata/surfdata_32x64_simyr2000_c090928.nc - -lnd/clm2/surfdata/surfdata_8x16_simyr2000_c090928.nc - -lnd/clm2/surfdata/surfdata_94x192_urb3den_simyr2000_c091016.nc - - -lnd/clm2/surfdata/surfdata_0.23x0.31_simyr2000_c100406.nc - -lnd/clm2/surfdata/surfdata_0.47x0.63_simyr2000_c091023.nc - -lnd/clm2/surfdata/surfdata_0.9x1.25_simyr2000_c110921.nc - -lnd/clm2/surfdata/surfdata_1.9x2.5_simyr2000_c091005.nc - -lnd/clm2/surfdata/surfdata_2.5x3.33_simyr2000_c091023.nc - -lnd/clm2/surfdata/surfdata_4x5_simyr2000_c090928.nc - -lnd/clm2/surfdata/surfdata_10x15_simyr2000_c090928.nc - - -lnd/clm2/surfdata_map/surfdata_ne4np4_simyr2000_c120126.nc - -lnd/clm2/surfdata_map/surfdata_ne16np4_simyr2000_c120126.nc - -lnd/clm2/surfdata_map/surfdata_ne30np4_simyr2000_c110801.nc - -lnd/clm2/surfdata_map/surfdata_ne60np4_simyr2000_c120416.nc - -lnd/clm2/surfdata_map/surfdata_ne120np4_simyr2000_c130313.nc - -lnd/clm2/surfdata_map/surfdata_ne240np4_simyr2000_c130313.nc - - - - -lnd/clm2/surfdata/surfdata_1.9x2.5_mp20_simyr2000_irrcr_c110427.nc - -lnd/clm2/surfdata/surfdata_10x15_mp20_simyr2000_irrcr_c110427.nc - -lnd/clm2/surfdata/surfdata_1x1_numaIA_mp20_simyr2000_irrcr_c110427.nc - - - -lnd/clm2/surfdata/surfdata_1.9x2.5_mp20_simyr2000_c110427.nc - -lnd/clm2/surfdata/surfdata_10x15_mp20_simyr2000_c110427.nc - -lnd/clm2/surfdata/surfdata_1x1_numaIA_mp20_simyr2000_c110427.nc - -lnd/clm2/surfdata/surfdata_1x1_smallvilleIA_mp20_simyr2000_c110427.nc - - -lnd/clm2/surfdata/surfdata_5x5_amazon_simyr2000_c091026.nc - -lnd/clm2/surfdata/surfdata_1x1_brazil_simyr2000_c090928.nc - - - -lnd/clm2/surfdata/surfdata_1x1_camdenNJ_simyr2000_c100407.nc - -lnd/clm2/surfdata/surfdata_1x1_vancouverCAN_simyr2000_c100409.nc - -lnd/clm2/surfdata/surfdata_1x1_mexicocityMEX_simyr2000_c100409.nc - -lnd/clm2/surfdata/surfdata_1x1_urbanc_alpha_simyr2000_c110209.nc - -lnd/clm2/surfdata/surfdata_1x1_asphaltjungleNJ_simyr2000_c100409.nc - - - -lnd/clm2/surfdata/surfdata_0.9x1.25_simyr2000_irrcr_c100916.nc - -lnd/clm2/surfdata/surfdata_1.9x2.5_simyr2000_irrcr_c100916.nc - -lnd/clm2/surfdata/surfdata_10x15_simyr2000_irrcr_c100916.nc - - - -lnd/clm2/surfdata/surfdata_512x1024_simyr1850_c100315.nc - -lnd/clm2/surfdata/surfdata_360x720_nourb_simyr1850_c120717.nc - -lnd/clm2/surfdata/surfdata_128x256_simyr1850_c100406.nc - -lnd/clm2/surfdata/surfdata_64x128_simyr1850_c090928.nc - -lnd/clm2/surfdata_map/surfdata_48x96_simyr1850_c120126.nc - -lnd/clm2/surfdata/surfdata_32x64_simyr1850_c090928.nc - -lnd/clm2/surfdata/surfdata_8x16_simyr1850_c090928.nc - - -lnd/clm2/surfdata/surfdata_0.23x0.31_simyr1850_c100404.nc - -lnd/clm2/surfdata/surfdata_0.47x0.63_simyr1850_c100826.nc - -lnd/clm2/surfdata/surfdata_0.9x1.25_simyr1850_c110921.nc - -lnd/clm2/surfdata/surfdata_1.9x2.5_simyr1850_c091108.nc - -lnd/clm2/surfdata/surfdata_2.5x3.33_simyr1850_c091109.nc - -lnd/clm2/surfdata/surfdata_4x5_simyr1850_c090928.nc - -lnd/clm2/surfdata/surfdata_10x15_simyr1850_c100202.nc - - -lnd/clm2/surfdata_map/surfdata_ne4np4_simyr1850_c120126.nc - -lnd/clm2/surfdata_map/surfdata_ne16np4_simyr1850_c120126.nc - -lnd/clm2/surfdata_map/surfdata_ne30np4_simyr1850_c110727.nc - -lnd/clm2/surfdata_map/surfdata_ne60np4_simyr1850_c120416.nc - -lnd/clm2/surfdata_map/surfdata_ne120np4_simyr1850_c130311.nc - -lnd/clm2/surfdata_map/surfdata_ne240np4_simyr1850_c130313.nc - - - - - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_hist_simyr1850-2005_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_hist_simyr1850-2005_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_hist_simyr1850-2005_glcmec10_c120927.nc - - -lnd/clm2/surfdata/surfdata.pftdyn_10x15_USGS_070307.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_hist_simyr1850-2005_c100826.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_simyr1850-2005_c091008.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_simyr1850-2005_c091108.nc -lnd/clm2/surfdata/surfdata.pftdyn_2.5x3.33_simyr1850-2005_c091109.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_simyr1850-2005_c100205.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_hist_simyr1850-2005_c120127.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_hist_simyr1850-2005_c120907.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne60np4_hist_simyr1850-2005_c120907.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_hist_simyr1850-2005_c130313.nc - - - - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp2.6_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp2.6_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp2.6_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp4.5_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp4.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp4.5_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp6.0_simyr1850-2100_glcmec10_c120927.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp6.0_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp6.0_simyr1850-2100_glcmec10_c120928.nc - -lnd/clm2/surfdata_map/surfdata.pftdyn_0.9x1.25_rcp8.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_1.9x2.5_rcp8.5_simyr1850-2100_glcmec10_c120928.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp8.5_simyr1850-2100_glcmec10_c120928.nc - - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp8.5_simyr1850-2100_c120224.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp8.5_simyr1850-2100_c130702.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp8.5_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp8.5_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp8.5_simyr1850-2100_c130311.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp6.0_simyr1850-2100_c120223.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp6.0_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp6.0_simyr1850-2100_c130709.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp6.0_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp6.0_simyr1850-2100_c140520.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp6.0_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp6.0_simyr1850-2100_c130313.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp4.5_simyr1850-2100_c120217.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp4.5_simyr1850-2100_c100406.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp4.5_simyr1850-2100_c100322.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp4.5_simyr1850-2100_c100322.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp4.5_simyr1850-2100_c120123.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp4.5_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp4.5_simyr1850-2100_c130313.nc - -lnd/clm2/surfdata/surfdata.pftdyn_0.47x0.63_rcp2.6_simyr1850-2100_c120215.nc -lnd/clm2/surfdata/surfdata.pftdyn_0.9x1.25_rcp2.6_simyr1850-2100_c100323.nc -lnd/clm2/surfdata/surfdata.pftdyn_1.9x2.5_rcp2.6_simyr1850-2100_c100322.nc -lnd/clm2/surfdata/surfdata.pftdyn_10x15_rcp2.6_simyr1850-2100_c100322.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_48x96_rcp2.6_simyr1850-2100_c120123.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne30np4_rcp2.6_simyr1850-2100_c121001.nc -lnd/clm2/surfdata_map/surfdata.pftdyn_ne120np4_rcp2.6_simyr1850-2100_c130313.nc - - -glc/cism/griddata/glcmaskdata_48x96_gland_c141105.nc - -glc/cism/griddata/glcmaskdata_0.9x1.25_Gland5km.nc -glc/cism/griddata/glcmaskdata_1.9x2.5_gland_c141105.nc - - -lnd/clm2/griddata/topodata_0.9x1.25_USGS_070110.nc -lnd/clm2/griddata/topodata_1.9x2.5_USGS_061130.nc -lnd/clm2/griddata/topodata_48x96_USGS_070110.nc - - - -lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc -lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc - - -2000 -2000 -2000 -2000 - -1850 -1850 -1850 -1850 - -2000 -2000 -2000 -2000 - -2000 -2000 -2000 -2000 - -2000 -2000 -2000 -2000 - -1850 -2000 -1850 -2000 - -1850 -2100 -1850 -2100 - -2000 -2100 -2000 -2100 - -lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc - -bilinear -bilinear - -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn - - -.true. -.true. -.false. - -bilinear -bilinear - -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn - - - - - -20 - - - - - - - -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.1x0.1_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_AVHRR_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_MODIS_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_USGS_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_10x10min_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_3x3min_MODIS_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_IGBP-GSDP_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_ISRIC-WISE_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_ne120np4_nomask_to_0.1x0.1_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_4x5_nomask_to_0.1x0.1_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_1.9x2.5_nomask_to_0.1x0.1_nomask_aave_da_c120709.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_ne240np4_nomask_to_0.1x0.1_nomask_aave_da_c120711.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_AVHRR_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_USGS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_10x10min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_USGS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_IGBP-GSDP_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_ISRIC-WISE_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_GLOBE-Gardner_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_AVHRR_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_MODIS_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_USGS_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_10x10min_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODIS_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_USGS_to_1x1_brazil_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_IGBP-GSDP_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_ISRIC-WISE_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_GLOBE-Gardner_to_1x1_brazil_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_brazil_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_AVHRR_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_MODIS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_USGS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_10x10min_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODIS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_USGS_to_1x1_camdenNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_IGBP-GSDP_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_ISRIC-WISE_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_GLOBE-Gardner_to_1x1_camdenNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_camdenNJ_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_AVHRR_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_USGS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_10x10min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_USGS_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_IGBP-GSDP_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_ISRIC-WISE_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_GLOBE-Gardner_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_AVHRR_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_MODIS_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_USGS_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_10x10min_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODIS_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_USGS_to_1x1_numaIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_IGBP-GSDP_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_ISRIC-WISE_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_GLOBE-Gardner_to_1x1_numaIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_numaIA_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_AVHRR_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_USGS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_10x10min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_USGS_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_IGBP-GSDP_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_ISRIC-WISE_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_GLOBE-Gardner_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_AVHRR_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_USGS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_10x10min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_USGS_to_1x1_urbanc_alpha_nomask_aave_da_c120928.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_IGBP-GSDP_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_ISRIC-WISE_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_GLOBE-Gardner_to_1x1_urbanc_alpha_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_urbanc_alpha_nomask_aave_da_c120927.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_AVHRR_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_USGS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_10x10min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_USGS_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_IGBP-GSDP_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_ISRIC-WISE_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_GLOBE-Gardner_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc - - - -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_landuse_to_0.9x1.25_aave_da_110307.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_lanwat_to_0.9x1.25_aave_da_110307.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_fmax_to_0.9x1.25_aave_da_110725.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_10minx10min_topo_to_0.9x1.25_aave_da_110630.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5minx5min_soitex_to_0.9x1.25_aave_da_110722.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5minx5min_irrig_to_0.9x1.25_aave_da_110529.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_ISRIC-WISE_to_0.9x1.25_nomask_aave_da_c120525.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODIS_to_0.9x1.25_nomask_aave_da_c120523.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_USGS_to_0.9x1.25_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_LandScan2004_to_0.9x1.25_nomask_aave_da_c120522.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_GLOBE-Gardner_to_0.9x1.25_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.9x1.25_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_landuse_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_lanwat_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_fmax_to_1.9x2.5_aave_da_110725.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_10minx10min_topo_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5minx5min_soitex_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_nomask_to_1.9x2.5_nomask_aave_da_c120606.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_ISRIC-WISE_to_1.9x2.5_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODIS_to_1.9x2.5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_USGS_to_1.9x2.5_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_LandScan2004_to_1.9x2.5_nomask_aave_da_c120522.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_GLOBE-Gardner_to_1.9x2.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_GLOBE-Gardner-mergeGIS_to_1.9x2.5_nomask_aave_da_c120923.nc - - -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_landuse_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_fmax_to_10x15_aave_da_110725.nc -lnd/clm2/mappingdata/maps/10x15/map_10minx10min_topo_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_5minx5min_soitex_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c120327.nc -lnd/clm2/mappingdata/maps/10x15/map_5x5min_ISRIC-WISE_to_10x15_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS_to_10x15_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_USGS_to_10x15_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_LandScan2004_to_10x15_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_GLOBE-Gardner_to_10x15_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_GLOBE-Gardner-mergeGIS_to_10x15_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_MODIS_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_AVHRR_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_USGS_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_10x10min_nomask_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_IGBP-GSDP_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_nomask_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_ISRIC-WISE_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODIS_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_USGS_to_360x720_nomask_aave_da_c121128.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_LandScan2004_to_360x720_nomask_aave_da_c121017.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_GLOBE-Gardner_to_360x720_nomask_aave_da_c121128.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_GLOBE-Gardner-mergeGIS_to_360x720_nomask_aave_da_c121128.nc - - -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_MODIS_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_AVHRR_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_USGS_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_10x10min_nomask_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_IGBP-GSDP_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_nomask_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_ISRIC-WISE_to_512x1024_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODIS_to_512x1024_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_USGS_to_512x1024_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_LandScan2004_to_512x1024_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_GLOBE-Gardner_to_512x1024_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_GLOBE-Gardner-mergeGIS_to_512x1024_nomask_aave_da_c120923.nc - - -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_MODIS_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_AVHRR_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_USGS_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_10x10min_nomask_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_IGBP-GSDP_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_nomask_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_ISRIC-WISE_to_128x256_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODIS_to_128x256_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_USGS_to_128x256_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_LandScan2004_to_128x256_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_GLOBE-Gardner_to_128x256_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_GLOBE-Gardner-mergeGIS_to_128x256_nomask_aave_da_c120923.nc - - -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_MODIS_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_AVHRR_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_USGS_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_10x10min_nomask_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_IGBP-GSDP_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_nomask_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_ISRIC-WISE_to_64x128_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODIS_to_64x128_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_USGS_to_64x128_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_LandScan2004_to_64x128_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_GLOBE-Gardner_to_64x128_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_GLOBE-Gardner-mergeGIS_to_64x128_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_MODIS_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_AVHRR_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_USGS_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_10x10min_nomask_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_IGBP-GSDP_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_nomask_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_ISRIC-WISE_to_48x96_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODIS_to_48x96_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_USGS_to_48x96_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_LandScan2004_to_48x96_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_GLOBE-Gardner_to_48x96_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_GLOBE-Gardner-mergeGIS_to_48x96_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_MODIS_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_AVHRR_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_USGS_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_10x10min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_IGBP-GSDP_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_ISRIC-WISE_to_32x64_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS_to_32x64_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_USGS_to_32x64_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_LandScan2004_to_32x64_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner_to_32x64_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner-mergeGIS_to_32x64_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_MODIS_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_AVHRR_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_USGS_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_10x10min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_IGBP-GSDP_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_ISRIC-WISE_to_8x16_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS_to_8x16_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_USGS_to_8x16_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_LandScan2004_to_8x16_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner_to_8x16_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner-mergeGIS_to_8x16_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_MODIS_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_AVHRR_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_USGS_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_10x10min_nomask_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_IGBP-GSDP_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_nomask_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_ISRIC-WISE_to_4x5_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODIS_to_4x5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_USGS_to_4x5_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_LandScan2004_to_4x5_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_GLOBE-Gardner_to_4x5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_GLOBE-Gardner-mergeGIS_to_4x5_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_MODIS_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_AVHRR_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_USGS_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_10x10min_nomask_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_IGBP-GSDP_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_nomask_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_ISRIC-WISE_to_0.23x0.31_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODIS_to_0.23x0.31_nomask_aave_da_c110930.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_USGS_to_0.23x0.31_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_LandScan2004_to_0.23x0.31_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_GLOBE-Gardner_to_0.23x0.31_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.23x0.31_nomask_aave_da_c120923.nc - - - - - -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.1x0.1_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_AVHRR_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_MODIS_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_USGS_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_1.9x2.5_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_IGBPmergeICESatGIS_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_LandScan2004_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_MODIS_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_USGS_to_0.47x0.63_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_IGBP-GSDP_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_ISRIC-WISE_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_ne120np4_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_ne240np4_nomask_to_0.47x0.63_nomask_aave_da_c120914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_GLOBE-Gardner_to_0.47x0.63_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.47x0.63_nomask_aave_da_c120926.nc - - - -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_MODIS_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_AVHRR_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_USGS_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_10x10min_nomask_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_IGBP-GSDP_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_nomask_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_ISRIC-WISE_to_2.5x3.33_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODIS_to_2.5x3.33_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_USGS_to_2.5x3.33_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_LandScan2004_to_2.5x3.33_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_GLOBE-Gardner_to_2.5x3.33_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_GLOBE-Gardner-mergeGIS_to_2.5x3.33_nomask_aave_da_c120923.nc - - - - -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_AVHRR_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_MODIS_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_USGS_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_IGBPmergeICESatGIS_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_IGBP-GSDP_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_MODIS_to_0.5x0.5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_ISRIC-WISE_to_0.5x0.5_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_LandScan2004_to_0.5x0.5_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_GLOBE-Gardner_to_0.5x0.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.5x0.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.1x0.1_nomask_to_0.5x0.5_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_ne240np4_nomask_to_0.5x0.5_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_4x5_nomask_to_0.5x0.5_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_1.9x2.5_nomask_to_0.5x0.5_nomask_aave_da_c120709.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_ne120np4_nomask_to_0.5x0.5_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3_USGS_nomask_to_0.5x0.5_nomask_aave_da_c120912.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.47x0.63_nomask_to_0.5x0.5_nomask_aave_da_c120914.nc - - - -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_MODIS_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_AVHRR_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_USGS_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_10x10min_nomask_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_IGBP-GSDP_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_nomask_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_ISRIC-WISE_to_ne4np4_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODIS_to_ne4np4_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_USGS_to_ne4np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_LandScan2004_to_ne4np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_GLOBE-Gardner_to_ne4np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne4np4_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_ne4np4_nomask_to_0.5x0.5_nomask_aave_da_c110923.nc - - -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_MODIS_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_AVHRR_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_USGS_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_10x10min_nomask_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_IGBP-GSDP_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_nomask_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_ISRIC-WISE_to_ne16np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODIS_to_ne16np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_USGS_to_ne16np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_LandScan2004_to_ne16np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner_to_ne16np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne16np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne16np4/map_ne16np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - - -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_landuse_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_lanwat_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_fmax_to_ne30np4_aave_da_110725.nc -lnd/clm2/mappingdata/maps/ne30np4/map_10minx10min_topo_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_soitex_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_irrig_to_ne30np4_aave_da_110720.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ISRIC-WISE_to_ne30np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS_to_ne30np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_USGS_to_ne30np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_LandScan2004_to_ne30np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner_to_ne30np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne30np4_nomask_aave_da_c120924.nc - -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_MODIS_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_AVHRR_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_USGS_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_10x10min_nomask_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_IGBP-GSDP_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_nomask_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ISRIC-WISE_to_ne60np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS_to_ne60np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_USGS_to_ne60np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_LandScan2004_to_ne60np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner_to_ne60np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne60np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne60np4/map_ne60np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_landuse_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_lanwat_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_fmax_to_ne120np4_aave_da_110725.nc -lnd/clm2/mappingdata/maps/ne120np4/map_10minx10min_topo_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_soitex_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ISRIC-WISE_to_ne120np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_irrig_to_ne120np4_aave_da_110817.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS_to_ne120np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_LandScan2004_to_ne120np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner_to_ne120np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne120np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS_to_ne120np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ISRIC-WISE_to_ne120np4_nomask_aave_da_c111115.nc - - - - -lnd/clm2/mappingdata/maps/ne120np4/map_0.1x0.1_nomask_to_ne120np4_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc - - - -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_MODIS_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_AVHRR_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_USGS_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_10x10min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_IGBP-GSDP_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ISRIC-WISE_to_5x5_amazon_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS_to_5x5_amazon_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_USGS_to_5x5_amazon_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_LandScan2004_to_5x5_amazon_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner_to_5x5_amazon_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner-mergeGIS_to_5x5_amazon_nomask_aave_da_c120923.nc - -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_MODIS_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_AVHRR_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_USGS_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_10x10min_nomask_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_IGBP-GSDP_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_nomask_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ISRIC-WISE_to_ne240np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS_to_ne240np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_USGS_to_ne240np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_LandScan2004_to_ne240np4_nomask_aave_da_c120521.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner_to_ne240np4_nomask_aave_da_c120925.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne240np4_nomask_aave_da_c120925.nc -lnd/clm2/mappingdata/maps/ne240np4/map_ne240np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - - - - - -. -. - - diff --git a/bld/namelist_files/namelist_defaults_clm4_0_tools.xml b/bld/namelist_files/namelist_defaults_clm4_0_tools.xml deleted file mode 100644 index 23fb007430..0000000000 --- a/bld/namelist_files/namelist_defaults_clm4_0_tools.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/bld/namelist_files/namelist_defaults_clm4_5.xml b/bld/namelist_files/namelist_defaults_clm4_5.xml deleted file mode 100644 index 8177668942..0000000000 --- a/bld/namelist_files/namelist_defaults_clm4_5.xml +++ /dev/null @@ -1,2453 +0,0 @@ - - - - - - - - - - -0.9x1.25 - -2000 - - -1800 - - -379.0 -379.0 -284.7 - - -constant - - -sp - -clm4_0_cam6.0 -clm4_5_CRUv7 -clm5_0_cam6.0 - - -off - - -2 -1 -2 -1 -0 - - -.true. -'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT' -'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','CPOOL','NPP','TWS' -'TOTSOMC','TOTSOMN','TLAI','GPP','NPP','TWS' -'TLAI','TWS' --8760 -20 - - -.false. -.false. - - -.true. -.false. - - -.true. - - -2 -1 -0 - - -.true. -.false. - - -Medlyn2011 -Ball-Berry1987 -Ball-Berry1987 - - -lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c171012.nc -lnd/clm2/isotopes/atm_delta_C14_CMIP6_3x1_global_1850-2015_yearly_v2.0_c171012.nc - - -.false. -.true. - - -0 -1 - - -NONE -NONE - - -0.50,0.30 -0.60,0.40 - - -ON_WASTEHEAT -ON - -1 -0 - -.true. -.false. - - -.false. - - -.true. -.false. - -20SL_8.5m -10SL_3.5m - -.false. -.false. -.true. -.false. - - - -1 -0 - -1 -1 - - -1 -0 - - -1.d-2 -0.001d00 -1.d-2 -1.d-2 - - -2.0d00 -0.5d00 - - -.true. -.false. - -.true. - - -0.006 - - -0.032 - -0.5 - -0. -2. - -0. -2. - --2. -0. - - -.false. -.true. - - -li2016crufrc -li2014qianfrc - -30.0d00 -80.0d00 -0.3d00 -0.7d00 -0.035d00 -4.2d-5 -0.0035d00 -0.001d00 -0.3d00 -0.39d00 -75.d00 -1050.d00 -0.5d00, 0.25d00 - -30.0d00 -30.0d00 -20.0d00 -80.0d00 -0.85d00 -0.98d00 -0.033d00 -0.09d-4 -0.010d00 -0.010d00 -0.008d00 -0.17d-3 -1.6d-4 -0.33d00 -105.d00 -1050.d00 -0.5d00, 0.28d00 - - -.false. -.true. - - -.true. -1.0 -0.05 - -.false. -0.25 -1.0 - - -0 -1 - -1 -1 - -4 -2 -2 -3 - -60. -1.e-8 -1.e-1 -1.e-2 -42 -1 -1 - - -0.0 -21600 -14400 --3400. -0.6 -1.0 -0.5 -0.1 - - -.false. -.false. - - -OFF -ON_RAD - - -12 -5 -10000.0 -1000.0 - -2000. - -1.e30 - -10.0d00 -10.0 - -.true. -.false. - -'Vionnet2012' -'Anderson1976' - -'Slater2017' -'TruncatedAnderson1976' - -100.d00 -175.d00 - -54.526d00 -204.526d00 - -0.08d00 - -.false. -.false. - -1.e9 - - -'single_at_atm_topo','virtual','virtual','multiple' - - -'remains_in_place','replaced_by_ice','replaced_by_ice','replaced_by_ice' - - -'melted','melted','remains_ice','remains_ice' - - -0 -7300 - - - - -lnd/clm2/paramdata/clm5_params.c171117.nc -lnd/clm2/paramdata/clm_params.c170913.nc - - - - - -lnd/clm2/paramdata/fates_params_2troppftclones.c171018.nc - - - - -.true. -.false. -.false. - - -.true. -.false. -.false. - - -.true. -.false. -3 -.true. -.true. -.true. -.true. -.false. -3 -1 -1 -1 -1 -0 - - - - - - -.true. -.false. - -.false. -.true. -.true. - -0.093563 - -.false. -.false. -.true. - - -constant -varytropicsbylat -12.0d00 -0.4d00 - -3.d00 -1.d00 - - - -0.5 -10.0 - - -.false. -.true. - - -.false. -.false. -.false. -.false. -.false. - - -.false. -.false. -.true. - -1.d-9 -1.d-8 --6.d+1 --6.d+0 --6.d+2 --6.d+1 - - -.false. -.false. -.true. - - - -75 - - -1850,2000 - - -.true. -.true. -.false. - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.false. irrigate=.false. glc_nec=10 - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.false. irrigate=.false. glc_nec=10 - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 - - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v6 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 - - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v6 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v6 use_cn=.false. use_nitrif_denitrif=.false. use_vertsoilc=.false. use_crop=.false. irrigate=.true. glc_nec=10 - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.false. glc_nec=10 - - -hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_nitrif_denitrif=.true. use_vertsoilc=.true. use_crop=.true. irrigate=.true. glc_nec=10 - - - - -lnd/clm2/initdata_map/clmi.I1850Clm45BgcGs.0901-01-01.0.9x1.25_gx1v6_simyr1850_c180204.nc - - -lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v6_simyr1850_c180204.nc - - -lnd/clm2/initdata_map/clmi.B1850.0161-01-01.0.9x1.25_gx1v7_simyr1850_c180130.nc - - - -lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v6_simyr1850_c171214.nc - - - -lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop.1366-01-01.0.9x1.25_gx1v6_simyr1850_c171213.nc - - - -lnd/clm2/initdata_map/clmi.I1850Clm50BgcCropCru.1526-01-01.0.9x1.25_gx1v6_simyr1850_c180109b.nc - - - -lnd/clm2/initdata_map/clmi.B1850.0161-01-01.0.9x1.25_gx1v7_simyr1850_c180130.nc - - -lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v6_simyr1850_c180110.nc - - - - - - -lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc - - - -lnd/clm2/initdata_map/clmi.I2000Clm45Fates.0021-01-01.4x5_mgx3v7_simyr2000_c180306.nc - - - - - -lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr2000_c170919.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne16np4_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_5x5_amazon_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - - -lnd/clm2/surfdata_map/surfdata_64x128_16pfts_Irrig_CMIP6_simyr2000_c170824.nc - - - -lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr2000_c170919.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_0.125x0.125_mp24_simyr2000_c150114.nc - -lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1x1_numaIA_78pfts_CMIP6_simyr2000_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_smallvilleIA_78pfts_CMIP6_simyr2000_c171214.nc - - -lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr2000_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne16np4_78pfts_CMIP6_simyr2000_c170824.nc - - - -lnd/clm2/surfdata_map/surfdata_1x1_camdenNJ_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_vancouverCAN_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_mexicocityMEX_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_urbanc_alpha_16pfts_Irrig_CMIP6_simyr2000_c171214.nc - - - -lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr1850_c180508.nc - -lnd/clm2/surfdata_map/surfdata_360x720cru_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_48x96_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_0.47x0.63_16pfts_Irrig_CMIP6_simyr1850_c170919.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_10x15_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_4x5_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_1x1_brazil_16pfts_Irrig_CMIP6_simyr1850_c171214.nc - - - -lnd/clm2/surfdata_map/surfdata_ne120np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne30np4_16pfts_Irrig_CMIP6_simyr1850_c170824.nc - - - -lnd/clm2/surfdata_map/surfdata_360x720cru_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_48x96_78pfts_CMIP6_simyr1850_c170824.nc - - -lnd/clm2/surfdata_map/surfdata_0.47x0.63_78pfts_CMIP6_simyr1850_c170919.nc - -lnd/clm2/surfdata_map/surfdata_0.9x1.25_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_10x15_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_4x5_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_1x1_smallvilleIA_78pfts_CMIP6_simyr1850_c171214.nc - -lnd/clm2/surfdata_map/surfdata_1x1_numaIA_78pfts_CMIP6_simyr1850_c170917.nc - - -lnd/clm2/surfdata_map/surfdata_1x1_brazil_78pfts_CMIP6_simyr1850_c171214.nc - - -lnd/clm2/surfdata_map/surfdata_ne30np4_78pfts_CMIP6_simyr1850_c170824.nc - -lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_CMIP6_simyr1850_c170824.nc - - - - - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - - - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1x1_numaIA_hist_78pfts_CMIP6_simyr1850-2015_c170917.nc - -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_smallvilleIA_hist_78pfts_simyr1850-1855_c160127.nc - - - - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c171025.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_16pfts_Irrig_CMIP6_simyr1850-2015_c170824.nc - - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_1x1_brazil_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne120np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - -lnd/clm2/surfdata_map/landuse.timeseries_0.47x0.63_hist_78pfts_CMIP6_simyr1850-2015_c180508.nc -lnd/clm2/surfdata_map/landuse.timeseries_360x720cru_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_0.9x1.25_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_1.9x2.5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_10x15_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_4x5_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_48x96_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc -lnd/clm2/surfdata_map/landuse.timeseries_ne30np4_hist_78pfts_CMIP6_simyr1850-2015_c170824.nc - - -.true. -.false. - -0.83d-06 - - -0.015d00 -0.015d00 - - -20.0d00, 20.0d00, 20.0d00 -200.0d00, 200.0d00, 200.0d00 -20.0d00, 20.0d00, 20.0d00 -200.0d00, 200.0d00, 200.0d00 - -1.50d00 -0.3 -1.50d00 -0.3 - -100.d00 -20.d00 -1.d00 -1.d00 - - - -lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc -lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc - - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -1850 -2015 - -1850 -2100 - -2000 -2100 - -lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc - - -extend -NDEP_year -lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp8.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp6.0_simyr1849-2106_1.9x2.5_c100810.nc -lnd/clm2/ndepdata/fndep_clm_rcp4.5_simyr1849-2106_1.9x2.5_c100428.nc -lnd/clm2/ndepdata/fndep_clm_rcp2.6_simyr1849-2106_1.9x2.5_c100428.nc - -cycle -NDEP_month - -bilinear - -nn -nn -nn -nn -nn -nn -nn - - -.false. -2001 -2013 -2001 - -lnd/clm2/lai_streams/MODISPFTLAI_0.5x0.5_c140711.nc - -bilinear - -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn -nn - - - -none -none -94x192 -94x192 - -0001 -0001 - -atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc -atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc - -bilinear - -nn -nn -nn -nn -nn -nn -nn - - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -1850 -2016 - -1850 -2016 - -1850 -2016 - -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc - -bilinear - -nn -nn -nn -nn -nn -nn -nn - - -2000 -2000 - -2000 -2000 - -1850 -1850 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -1850 -2106 - -1850 -2106 - -1850 -2106 - -lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc - -lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc - -nn - -nn -nn -nn -nn -nn -nn -nn - - -.true. -.false. - -.false. - - - - - -35 - - - - - - - - -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.1x0.1_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_AVHRR_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_MODIS_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.25x0.25_MODIS_to_0.1x0.1_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.5x0.5_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_10x10min_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_3x3min_MODIS_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_3x3min_MODIS-wCsp_to_0.1x0.1_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_IGBP-GSDP_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_ISRIC-WISE_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_ORNL-Soil_to_0.1x0.1_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_5x5min_nomask_to_0.1x0.1_nomask_aave_da_c120406.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_ne120np4_nomask_to_0.1x0.1_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_4x5_nomask_to_0.1x0.1_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_1.9x2.5_nomask_to_0.1x0.1_nomask_aave_da_c120709.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_ne240np4_nomask_to_0.1x0.1_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_0.9x1.25_GRDC_to_0.1x0.1_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_360x720_cruncep_to_0.1x0.1_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/0.1x0.1/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.1x0.1_nomask_aave_da_c130405.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_AVHRR_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.25x0.25_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.5x0.5_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_10x10min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_MODIS-wCsp_to_1x1_asphaltjungleNJ_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_USGS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_LandScan2004_to_1x1_asphaltjungleNJ_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_IGBP-GSDP_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_ISRIC-WISE_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_ORNL-Soil_to_1x1_asphaltjungleNJ_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_5x5min_nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_GLOBE-Gardner_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_asphaltjungleNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_0.9x1.25_GRDC_to_1x1_asphaltjungleNJ_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_360x720_cruncep_to_1x1_asphaltjungleNJ_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_asphaltjungleNJ/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_asphaltjungleNJ_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_AVHRR_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_MODIS_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.25x0.25_MODIS_to_1x1_brazil_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.5x0.5_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_10x10min_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODIS_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_MODIS-wCsp_to_1x1_brazil_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_USGS_to_1x1_brazil_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_LandScan2004_to_1x1_brazil_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_IGBP-GSDP_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_ISRIC-WISE_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_ORNL-Soil_to_1x1_brazil_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_5x5min_nomask_to_1x1_brazil_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_GLOBE-Gardner_to_1x1_brazil_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_brazil_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_0.9x1.25_GRDC_to_1x1_brazil_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_360x720_cruncep_to_1x1_brazil_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_brazil/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_brazil_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_AVHRR_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_MODIS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.25x0.25_MODIS_to_1x1_camdenNJ_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.5x0.5_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_10x10min_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODIS_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_MODIS-wCsp_to_1x1_camdenNJ_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_USGS_to_1x1_camdenNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_LandScan2004_to_1x1_camdenNJ_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_IGBP-GSDP_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_ISRIC-WISE_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_ORNL-Soil_to_1x1_camdenNJ_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_5x5min_nomask_to_1x1_camdenNJ_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_GLOBE-Gardner_to_1x1_camdenNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_camdenNJ_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_0.9x1.25_GRDC_to_1x1_camdenNJ_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_360x720_cruncep_to_1x1_camdenNJ_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_camdenNJ/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_camdenNJ_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_AVHRR_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.25x0.25_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.5x0.5_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_10x10min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODIS_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_MODIS-wCsp_to_1x1_mexicocityMEX_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_USGS_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_LandScan2004_to_1x1_mexicocityMEX_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_IGBP-GSDP_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_ISRIC-WISE_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_ORNL-Soil_to_1x1_mexicocityMEX_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_5x5min_nomask_to_1x1_mexicocityMEX_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_GLOBE-Gardner_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_mexicocityMEX_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_0.9x1.25_GRDC_to_1x1_mexicocityMEX_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_360x720_cruncep_to_1x1_mexicocityMEX_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_mexicocityMEX/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_mexicocityMEX_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_AVHRR_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_MODIS_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.25x0.25_MODIS_to_1x1_numaIA_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.5x0.5_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_10x10min_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODIS_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_MODIS-wCsp_to_1x1_numaIA_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_USGS_to_1x1_numaIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_LandScan2004_to_1x1_numaIA_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_IGBP-GSDP_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_ISRIC-WISE_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_ORNL-Soil_to_1x1_numaIA_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_5x5min_nomask_to_1x1_numaIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_GLOBE-Gardner_to_1x1_numaIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_numaIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_0.9x1.25_GRDC_to_1x1_numaIA_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_360x720_cruncep_to_1x1_numaIA_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_numaIA/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_numaIA_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_AVHRR_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.25x0.25_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.5x0.5_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_10x10min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODIS_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_MODIS-wCsp_to_1x1_smallvilleIA_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_USGS_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_LandScan2004_to_1x1_smallvilleIA_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_IGBP-GSDP_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_ISRIC-WISE_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_ORNL-Soil_to_1x1_smallvilleIA_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_5x5min_nomask_to_1x1_smallvilleIA_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_GLOBE-Gardner_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_smallvilleIA_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_0.9x1.25_GRDC_to_1x1_smallvilleIA_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_360x720_cruncep_to_1x1_smallvilleIA_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_smallvilleIA/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_smallvilleIA_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_AVHRR_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.25x0.25_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.5x0.5_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_10x10min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODIS_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_MODIS-wCsp_to_1x1_urbanc_alpha_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_USGS_to_1x1_urbanc_alpha_nomask_aave_da_c120928.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_LandScan2004_to_1x1_urbanc_alpha_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_IGBP-GSDP_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_ISRIC-WISE_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_ORNL-Soil_to_1x1_urbanc_alpha_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_5x5min_nomask_to_1x1_urbanc_alpha_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_GLOBE-Gardner_to_1x1_urbanc_alpha_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_urbanc_alpha_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_0.9x1.25_GRDC_to_1x1_urbanc_alpha_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_360x720_cruncep_to_1x1_urbanc_alpha_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_urbanc_alpha/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_urbanc_alpha_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_AVHRR_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.25x0.25_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.5x0.5_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_10x10min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODIS_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_MODIS-wCsp_to_1x1_vancouverCAN_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_USGS_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_LandScan2004_to_1x1_vancouverCAN_nomask_aave_da_c121114.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_IGBP-GSDP_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_ISRIC-WISE_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_ORNL-Soil_to_1x1_vancouverCAN_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_5x5min_nomask_to_1x1_vancouverCAN_nomask_aave_da_c120717.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_GLOBE-Gardner_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_3x3min_GLOBE-Gardner-mergeGIS_to_1x1_vancouverCAN_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_0.9x1.25_GRDC_to_1x1_vancouverCAN_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_360x720_cruncep_to_1x1_vancouverCAN_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1x1_vancouverCAN/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1x1_vancouverCAN_nomask_aave_da_c130403.nc - - - - - -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.25x0.25_MODIS_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_AVHRR_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.5x0.5_MODIS_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_0.9x1.25_GRDC_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_IGBPmergeICESatGIS_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_10x10min_nomask_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_360x720cru_cruncep_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_GLOBE-Gardner_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_LandScan2004_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_MODIS-wCsp_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_3x3min_USGS_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_IGBP-GSDP_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_ISRIC-WISE_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_nomask_to_0.47x0.63_nomask_aave_da_c170914.nc -lnd/clm2/mappingdata/maps/0.47x0.63/map_5x5min_ORNL-Soil_to_0.47x0.63_nomask_aave_da_c170914.nc - - - - -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_landuse_to_0.9x1.25_aave_da_110307.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.25x0.25_MODIS_to_0.9x1.25_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.5x0.5_lanwat_to_0.9x1.25_aave_da_110307.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_10minx10min_topo_to_0.9x1.25_aave_da_110630.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5minx5min_soitex_to_0.9x1.25_aave_da_110722.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5minx5min_irrig_to_0.9x1.25_aave_da_110529.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_ISRIC-WISE_to_0.9x1.25_nomask_aave_da_c120525.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_5x5min_ORNL-Soil_to_0.9x1.25_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODIS_to_0.9x1.25_nomask_aave_da_c120523.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_MODIS-wCsp_to_0.9x1.25_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_USGS_to_0.9x1.25_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_LandScan2004_to_0.9x1.25_nomask_aave_da_c120522.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_GLOBE-Gardner_to_0.9x1.25_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.9x1.25_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_0.9x1.25_GRDC_to_0.9x1.25_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_360x720_cruncep_to_0.9x1.25_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/0.9x1.25/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.9x1.25_nomask_aave_da_c130405.nc - -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_landuse_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.25x0.25_MODIS_to_1.9x2.5_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.5x0.5_lanwat_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_10minx10min_topo_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5minx5min_soitex_to_1.9x2.5_aave_da_110307.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_nomask_to_1.9x2.5_nomask_aave_da_c120606.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_ISRIC-WISE_to_1.9x2.5_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_5x5min_ORNL-Soil_to_1.9x2.5_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODIS_to_1.9x2.5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_MODIS-wCsp_to_1.9x2.5_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_USGS_to_1.9x2.5_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_LandScan2004_to_1.9x2.5_nomask_aave_da_c120522.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_GLOBE-Gardner_to_1.9x2.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_3x3min_GLOBE-Gardner-mergeGIS_to_1.9x2.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_0.9x1.25_GRDC_to_1.9x2.5_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_360x720_cruncep_to_1.9x2.5_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/1.9x2.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_1.9x2.5_nomask_aave_da_c130405.nc - - -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_landuse_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_0.25x0.25_MODIS_to_10x15_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/10x15/map_0.5x0.5_lanwat_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_10minx10min_topo_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_5minx5min_soitex_to_10x15_aave_da_110307.nc -lnd/clm2/mappingdata/maps/10x15/map_5x5min_nomask_to_10x15_nomask_aave_da_c120327.nc -lnd/clm2/mappingdata/maps/10x15/map_5x5min_ISRIC-WISE_to_10x15_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/10x15/map_5x5min_ORNL-Soil_to_10x15_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS_to_10x15_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_MODIS-wCsp_to_10x15_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_USGS_to_10x15_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_LandScan2004_to_10x15_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_GLOBE-Gardner_to_10x15_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/10x15/map_3x3min_GLOBE-Gardner-mergeGIS_to_10x15_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/10x15/map_0.9x1.25_GRDC_to_10x15_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/10x15/map_360x720_cruncep_to_10x15_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/10x15/map_1km-merge-10min_HYDRO1K-merge-nomask_to_10x15_nomask_aave_da_c130411.nc - -lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_MODIS_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_0.25x0.25_MODIS_to_360x720cru_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/360x720/map_0.5x0.5_AVHRR_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_10x10min_nomask_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_IGBP-GSDP_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_nomask_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_ISRIC-WISE_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_5x5min_ORNL-Soil_to_360x720cru_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODIS_to_360x720_nomask_aave_da_c120830.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_MODIS-wCsp_to_360x720cru_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_USGS_to_360x720_nomask_aave_da_c121128.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_LandScan2004_to_360x720_nomask_aave_da_c121017.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_GLOBE-Gardner_to_360x720_nomask_aave_da_c121128.nc -lnd/clm2/mappingdata/maps/360x720/map_3x3min_GLOBE-Gardner-mergeGIS_to_360x720_nomask_aave_da_c121128.nc -lnd/clm2/mappingdata/maps/360x720/map_0.9x1.25_GRDC_to_360x720_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/360x720/map_360x720_cruncep_to_360x720_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/360x720/map_1km-merge-10min_HYDRO1K-merge-nomask_to_360x720_nomask_aave_da_c130403.nc - - -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_MODIS_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.25x0.25_MODIS_to_512x1024_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.5x0.5_AVHRR_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_10x10min_nomask_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_IGBP-GSDP_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_nomask_to_512x1024_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_ISRIC-WISE_to_512x1024_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/512x1024/map_5x5min_ORNL-Soil_to_512x1024_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODIS_to_512x1024_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_MODIS-wCsp_to_512x1024_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_USGS_to_512x1024_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_LandScan2004_to_512x1024_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_GLOBE-Gardner_to_512x1024_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/512x1024/map_3x3min_GLOBE-Gardner-mergeGIS_to_512x1024_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/512x1024/map_0.9x1.25_GRDC_to_512x1024_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/512x1024/map_360x720_cruncep_to_512x1024_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/512x1024/map_1km-merge-10min_HYDRO1K-merge-nomask_to_512x1024_nomask_aave_da_c130403.nc - - -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_MODIS_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_0.25x0.25_MODIS_to_128x256_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/128x256/map_0.5x0.5_AVHRR_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_10x10min_nomask_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_IGBP-GSDP_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_nomask_to_128x256_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_ISRIC-WISE_to_128x256_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/128x256/map_5x5min_ORNL-Soil_to_128x256_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODIS_to_128x256_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_MODIS-wCsp_to_128x256_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_USGS_to_128x256_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_LandScan2004_to_128x256_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_GLOBE-Gardner_to_128x256_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/128x256/map_3x3min_GLOBE-Gardner-mergeGIS_to_128x256_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/128x256/map_0.9x1.25_GRDC_to_128x256_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/128x256/map_360x720_cruncep_to_128x256_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/128x256/map_1km-merge-10min_HYDRO1K-merge-nomask_to_128x256_nomask_aave_da_c130403.nc - - -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_MODIS_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_0.25x0.25_MODIS_to_64x128_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/64x128/map_0.5x0.5_AVHRR_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_10x10min_nomask_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_IGBP-GSDP_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_nomask_to_64x128_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_ISRIC-WISE_to_64x128_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/64x128/map_5x5min_ORNL-Soil_to_64x128_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODIS_to_64x128_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_MODIS-wCsp_to_64x128_nomask_aave_da_c160428.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_USGS_to_64x128_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_LandScan2004_to_64x128_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_GLOBE-Gardner_to_64x128_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/64x128/map_3x3min_GLOBE-Gardner-mergeGIS_to_64x128_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/64x128/map_0.9x1.25_GRDC_to_64x128_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/64x128/map_360x720_cruncep_to_64x128_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/64x128/map_1km-merge-10min_HYDRO1K-merge-nomask_to_64x128_nomask_aave_da_c130403.nc - -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_MODIS_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_0.25x0.25_MODIS_to_48x96_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/48x96/map_0.5x0.5_AVHRR_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_10x10min_nomask_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_IGBP-GSDP_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_nomask_to_48x96_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_ISRIC-WISE_to_48x96_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/48x96/map_5x5min_ORNL-Soil_to_48x96_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODIS_to_48x96_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_MODIS-wCsp_to_48x96_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_USGS_to_48x96_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_LandScan2004_to_48x96_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_GLOBE-Gardner_to_48x96_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/48x96/map_3x3min_GLOBE-Gardner-mergeGIS_to_48x96_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/48x96/map_0.9x1.25_GRDC_to_48x96_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/48x96/map_360x720_cruncep_to_48x96_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/48x96/map_1km-merge-10min_HYDRO1K-merge-nomask_to_48x96_nomask_aave_da_c130405.nc - -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_MODIS_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_0.25x0.25_MODIS_to_32x64_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/32x64/map_0.5x0.5_AVHRR_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_10x10min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_IGBP-GSDP_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_nomask_to_32x64_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_ISRIC-WISE_to_32x64_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/32x64/map_5x5min_ORNL-Soil_to_32x64_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS_to_32x64_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_MODIS-wCsp_to_32x64_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_USGS_to_32x64_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_LandScan2004_to_32x64_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner_to_32x64_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/32x64/map_3x3min_GLOBE-Gardner-mergeGIS_to_32x64_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/32x64/map_0.9x1.25_GRDC_to_32x64_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/32x64/map_360x720_cruncep_to_32x64_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/32x64/map_1km-merge-10min_HYDRO1K-merge-nomask_to_32x64_nomask_aave_da_c130405.nc - -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_MODIS_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_0.25x0.25_MODIS_to_8x16_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/8x16/map_0.5x0.5_AVHRR_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_10x10min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_IGBP-GSDP_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_nomask_to_8x16_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_ISRIC-WISE_to_8x16_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/8x16/map_5x5min_ORNL-Soil_to_8x16_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS_to_8x16_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_MODIS-wCsp_to_8x16_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_USGS_to_8x16_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_LandScan2004_to_8x16_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner_to_8x16_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/8x16/map_3x3min_GLOBE-Gardner-mergeGIS_to_8x16_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/8x16/map_0.9x1.25_GRDC_to_8x16_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/8x16/map_360x720_cruncep_to_8x16_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/8x16/map_1km-merge-10min_HYDRO1K-merge-nomask_to_8x16_nomask_aave_da_c130411.nc - -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_MODIS_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_0.25x0.25_MODIS_to_4x5_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/4x5/map_0.5x0.5_AVHRR_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_10x10min_nomask_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_IGBP-GSDP_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_nomask_to_4x5_nomask_aave_da_c110822.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_ISRIC-WISE_to_4x5_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/4x5/map_5x5min_ORNL-Soil_to_4x5_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODIS_to_4x5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_MODIS-wCsp_to_4x5_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_USGS_to_4x5_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_LandScan2004_to_4x5_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_GLOBE-Gardner_to_4x5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/4x5/map_3x3min_GLOBE-Gardner-mergeGIS_to_4x5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/4x5/map_0.9x1.25_GRDC_to_4x5_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/4x5/map_360x720_cruncep_to_4x5_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/4x5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_4x5_nomask_aave_da_c130411.nc - -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_MODIS_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.25x0.25_MODIS_to_0.23x0.31_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.5x0.5_AVHRR_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_10x10min_nomask_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_IGBP-GSDP_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_nomask_to_0.23x0.31_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_ISRIC-WISE_to_0.23x0.31_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_5x5min_ORNL-Soil_to_0.23x0.31_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODIS_to_0.23x0.31_nomask_aave_da_c110930.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_MODIS-wCsp_to_0.23x0.31_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_USGS_to_0.23x0.31_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_LandScan2004_to_0.23x0.31_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_GLOBE-Gardner_to_0.23x0.31_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.23x0.31_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_3x3min_LandScan2004_to_0.23x0.31_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_0.9x1.25_GRDC_to_0.23x0.31_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_360x720_cruncep_to_0.23x0.31_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/0.23x0.31/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.23x0.31_nomask_aave_da_c130405.nc - - -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_MODIS_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.25x0.25_MODIS_to_2.5x3.33_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.5x0.5_AVHRR_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_10x10min_nomask_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_IGBP-GSDP_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_nomask_to_2.5x3.33_nomask_aave_da_c110823.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_ISRIC-WISE_to_2.5x3.33_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_5x5min_ORNL-Soil_to_2.5x3.33_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODIS_to_2.5x3.33_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_MODIS-wCsp_to_2.5x3.33_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_USGS_to_2.5x3.33_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_LandScan2004_to_2.5x3.33_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_GLOBE-Gardner_to_2.5x3.33_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_3x3min_GLOBE-Gardner-mergeGIS_to_2.5x3.33_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_0.9x1.25_GRDC_to_2.5x3.33_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_360x720_cruncep_to_2.5x3.33_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/2.5x3.33/map_1km-merge-10min_HYDRO1K-merge-nomask_to_2.5x3.33_nomask_aave_da_c130405.nc - - - - -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_AVHRR_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.25x0.25_MODIS_to_0.5x0.5_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_MODIS_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.5x0.5_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_IGBPmergeICESatGIS_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_10x10min_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_IGBP-GSDP_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_nomask_to_0.5x0.5_nomask_aave_da_c111021.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_MODIS_to_0.5x0.5_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_MODIS-wCsp_to_0.5x0.5_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_ISRIC-WISE_to_0.5x0.5_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_5x5min_ORNL-Soil_to_0.5x0.5_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_LandScan2004_to_0.5x0.5_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_GLOBE-Gardner_to_0.5x0.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.5x0.5_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.1x0.1_nomask_to_0.5x0.5_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_ne240np4_nomask_to_0.5x0.5_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_4x5_nomask_to_0.5x0.5_nomask_aave_da_c120706.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_1.9x2.5_nomask_to_0.5x0.5_nomask_aave_da_c120709.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_ne120np4_nomask_to_0.5x0.5_nomask_aave_da_c120711.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_3x3_USGS_nomask_to_0.5x0.5_nomask_aave_da_c120912.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_0.9x1.25_GRDC_to_0.5x0.5_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_360x720_cruncep_to_0.5x0.5_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/0.5x0.5/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.5x0.5_nomask_aave_da_c130405.nc - - - -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_MODIS_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.25x0.25_MODIS_to_ne4np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.5x0.5_AVHRR_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_10x10min_nomask_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_IGBP-GSDP_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_nomask_to_ne4np4_nomask_aave_da_c110923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_ISRIC-WISE_to_ne4np4_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/ne4np4/map_5x5min_ORNL-Soil_to_ne4np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODIS_to_ne4np4_nomask_aave_da_c120906.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_MODIS-wCsp_to_ne4np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_USGS_to_ne4np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_LandScan2004_to_ne4np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_GLOBE-Gardner_to_ne4np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne4np4_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/ne4np4/map_3x3min_LandScan2004_to_ne4np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne4np4/map_0.9x1.25_GRDC_to_ne4np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne4np4/map_360x720_cruncep_to_ne4np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne4np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne4np4_nomask_aave_da_c130411.nc -lnd/clm2/mappingdata/maps/ne4np4/map_ne4np4_nomask_to_0.5x0.5_nomask_aave_da_c110923.nc - - -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_MODIS_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.25x0.25_MODIS_to_ne16np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.5x0.5_AVHRR_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_10x10min_nomask_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_IGBP-GSDP_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_nomask_to_ne16np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_ISRIC-WISE_to_ne16np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne16np4/map_5x5min_ORNL-Soil_to_ne16np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODIS_to_ne16np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_MODIS-wCsp_to_ne16np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_USGS_to_ne16np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_LandScan2004_to_ne16np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner_to_ne16np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne16np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne16np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne16np4/map_0.9x1.25_GRDC_to_ne16np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne16np4/map_360x720_cruncep_to_ne16np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne16np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne16np4_nomask_aave_da_c130408.nc -lnd/clm2/mappingdata/maps/ne16np4/map_ne16np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - - -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_landuse_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.25x0.25_MODIS_to_ne30np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.5x0.5_lanwat_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_10minx10min_topo_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_soitex_to_ne30np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5minx5min_irrig_to_ne30np4_aave_da_110720.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ISRIC-WISE_to_ne30np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne30np4/map_5x5min_ORNL-Soil_to_ne30np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS_to_ne30np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_MODIS-wCsp_to_ne30np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_USGS_to_ne30np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_LandScan2004_to_ne30np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner_to_ne30np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne30np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne30np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne30np4/map_0.9x1.25_GRDC_to_ne30np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne30np4/map_360x720_cruncep_to_ne30np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne30np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne30np4_nomask_aave_da_c130405.nc - -lnd/clm2/mappingdata/maps/ne30np4/map_ne30np4_to_0.5x0.5rtm_aave_da_110320.nc - -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_MODIS_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.25x0.25_MODIS_to_ne60np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.5x0.5_AVHRR_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_10x10min_nomask_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_IGBP-GSDP_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_nomask_to_ne60np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ISRIC-WISE_to_ne60np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne60np4/map_5x5min_ORNL-Soil_to_ne60np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS_to_ne60np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_MODIS-wCsp_to_ne60np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_USGS_to_ne60np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_LandScan2004_to_ne60np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner_to_ne60np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne60np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne60np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne60np4/map_0.9x1.25_GRDC_to_ne60np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne60np4/map_360x720_cruncep_to_ne60np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne60np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne60np4_nomask_aave_da_c130405.nc -lnd/clm2/mappingdata/maps/ne60np4/map_ne60np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_landuse_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.25x0.25_MODIS_to_ne120np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.5x0.5_lanwat_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_10minx10min_topo_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_soitex_to_ne120np4_aave_da_110320.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ISRIC-WISE_to_ne120np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5x5min_ORNL-Soil_to_ne120np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne120np4/map_5minx5min_irrig_to_ne120np4_aave_da_110817.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS_to_ne120np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_MODIS-wCsp_to_ne120np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_LandScan2004_to_ne120np4_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner_to_ne120np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne120np4_nomask_aave_da_c120924.nc -lnd/clm2/mappingdata/maps/ne120np4/map_3x3min_USGS_to_ne120np4_nomask_aave_da_c120913.nc -lnd/clm2/mappingdata/maps/ne120np4/map_0.9x1.25_GRDC_to_ne120np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne120np4/map_360x720_cruncep_to_ne120np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne120np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne120np4_nomask_aave_da_c130405.nc - - - - -lnd/clm2/mappingdata/maps/ne120np4/map_0.1x0.1_nomask_to_ne120np4_nomask_aave_da_c120706.nc - - - -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_MODIS_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.25x0.25_MODIS_to_5x5_amazon_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.5x0.5_AVHRR_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_10x10min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_IGBP-GSDP_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_nomask_to_5x5_amazon_nomask_aave_da_c110920.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ISRIC-WISE_to_5x5_amazon_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_5x5min_ORNL-Soil_to_5x5_amazon_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS_to_5x5_amazon_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_MODIS-wCsp_to_5x5_amazon_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_USGS_to_5x5_amazon_nomask_aave_da_c120927.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_LandScan2004_to_5x5_amazon_nomask_aave_da_c120518.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner_to_5x5_amazon_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_3x3min_GLOBE-Gardner-mergeGIS_to_5x5_amazon_nomask_aave_da_c120923.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_0.9x1.25_GRDC_to_5x5_amazon_nomask_aave_da_c130309.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_360x720_cruncep_to_5x5_amazon_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/5x5_amazon/map_1km-merge-10min_HYDRO1K-merge-nomask_to_5x5_amazon_nomask_aave_da_c130403.nc - -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_MODIS_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.25x0.25_MODIS_to_ne240np4_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.5x0.5_AVHRR_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_10x10min_nomask_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_IGBP-GSDP_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_nomask_to_ne240np4_nomask_aave_da_c110922.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ISRIC-WISE_to_ne240np4_nomask_aave_da_c111115.nc -lnd/clm2/mappingdata/maps/ne240np4/map_5x5min_ORNL-Soil_to_ne240np4_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS_to_ne240np4_nomask_aave_da_c111111.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_MODIS-wCsp_to_ne240np4_nomask_aave_da_c160425.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_USGS_to_ne240np4_nomask_aave_da_c120926.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_LandScan2004_to_ne240np4_nomask_aave_da_c120521.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner_to_ne240np4_nomask_aave_da_c120925.nc -lnd/clm2/mappingdata/maps/ne240np4/map_3x3min_GLOBE-Gardner-mergeGIS_to_ne240np4_nomask_aave_da_c120925.nc -lnd/clm2/mappingdata/maps/ne240np4/map_0.9x1.25_GRDC_to_ne240np4_nomask_aave_da_c130308.nc -lnd/clm2/mappingdata/maps/ne240np4/map_360x720_cruncep_to_ne240np4_nomask_aave_da_c130326.nc -lnd/clm2/mappingdata/maps/ne240np4/map_1km-merge-10min_HYDRO1K-merge-nomask_to_ne240np4_nomask_aave_da_c130405.nc -lnd/clm2/mappingdata/maps/ne240np4/map_ne240np4_nomask_to_0.5x0.5_nomask_aave_da_c110922.nc - - - - -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_AVHRR_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.5x0.5_MODIS_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.25x0.25_MODIS_to_0.125x0.125_nomask_aave_da_c170321.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_0.9x1.25_GRDC_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_IGBPmergeICESatGIS_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_10x10min_nomask_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_1km-merge-10min_HYDRO1K-merge-nomask_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_360x720cru_cruncep_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner-mergeGIS_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_GLOBE-Gardner_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_LandScan2004_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_MODIS-wCsp_to_0.125x0.125_nomask_aave_da_c160427.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_3x3min_USGS_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_IGBP-GSDP_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_ISRIC-WISE_to_0.125x0.125_nomask_aave_da_c140702.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_ORNL-Soil_to_0.125x0.125_nomask_aave_da_c170706.nc -lnd/clm2/mappingdata/maps/0.125x0.125/map_5x5min_nomask_to_0.125x0.125_nomask_aave_da_c140702.nc - - - - - - - -. -. - - - - - -TWS_inversion -ZWT_inversion -.true. -.true. - -1.9x2.5 - -lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc - - - - - -.false. -.false. -.false. -.false. - -.false. -.false. -.false. -.false. - -.true. -.true. -.true. -.true. - -.true. -.true. -.false. -.false. - - -.false. -.false. -.false. -.false. -.false. -.false. - - - - - -general - - diff --git a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml b/bld/namelist_files/namelist_defaults_clm4_5_tools.xml deleted file mode 100644 index d6cece9e92..0000000000 --- a/bld/namelist_files/namelist_defaults_clm4_5_tools.xml +++ /dev/null @@ -1,633 +0,0 @@ - - - - - - - - - - - - -none -SCRIP - - -lnd/clm2/mappingdata/grids/SCRIPgrid_0.23x0.31_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.47x0.63_nomask_c170914.nc -lnd/clm2/mappingdata/grids/0.9x1.25_c110307.nc -lnd/clm2/mappingdata/grids/1.9x2.5_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_2.5x3.33_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_4x5_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_10x15_nomask_c110308.nc - - -lnd/clm2/mappingdata/grids/SCRIPgrid_512x1024_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_128x256_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_94x192_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_64x128_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_48x96_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_32x64_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_8x16_nomask_c110308.nc - - -lnd/clm2/mappingdata/grids/SCRIPgrid_ne240np4_nomask_c091227.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_ne120np4_nomask_c101123.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_ne60np4_nomask_c100408.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_ne30np4_nomask_c101123.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_ne16np4_nomask_c110512.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_ne4np4_nomask_c110808.nc - - -lnd/clm2/mappingdata/grids/SCRIPgrid_0.125x0.125_nomask_c140702.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.33x0.33_navy_c111207.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.1x0.1_nomask_c110712.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_AVHRR_c110228.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.5x0.5_MODIS_c110228.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.25x0.25_MODIS_c170321.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_nomask_c110530.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_IGBP-GSDP_c110228.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_ISRIC-WISE_c111114.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5min_ORNL-Soil_c170630.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_10x10min_nomask_c110228.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_10x10min_IGBPmergeICESatGIS_c110818.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODIS_c110915.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_MODISwcspsea_c151020.nc -64bit_offset -64bit_offset -lnd/clm2/mappingdata/grids/SCRIPgrid_3x3_USGS_c120912.nc -64bit_offset -lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_LandScan2004_c120517.nc -64bit_offset -lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_GLOBE-Gardner_c120922.nc -64bit_offset -lnd/clm2/mappingdata/grids/SCRIPgrid_3minx3min_GLOBE-Gardner-mergeGIS_c120922.nc -64bit_offset -lnd/clm2/mappingdata/grids/SCRIPgrid_360x720_cruncep_c120830.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_360x720_nomask_c120830.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_0.9x1.25_GRDC_c130307.nc - - - -lnd/clm2/mappingdata/grids/UGRID_1km-merge-10min_HYDRO1K-merge-nomask_c130402.nc -netcdf4 -UGRID -landmesh - - -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_camdenNJ_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_brazil_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_camdenNJ_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_mexicocityMEX_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_numaIA_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_smallvilleIA_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_urbanc_alpha_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_1x1pt_vancouverCAN_nomask_c110308.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5pt_amazon_nomask_c110308.nc - - -lnd/clm2/mappingdata/grids/SCRIPgrid_0.33x0.33_navy_c111207.nc -lnd/clm2/mappingdata/grids/SCRIPgrid_5x5_amazon_navy_c111207.nc -/glade/proj3/cseg/mapping/grids/gx1v6_090205.nc -/glade/proj3/cseg/mapping/grids/gx3v7_090903.nc -/glade/proj3/cseg/mapping/grids/tx1v1_090122.nc -/glade/proj3/cseg/mapping/grids/tx0.1v2_090127.nc - - -MODIS-wCsp -AVHRR -AVHRR -MODIS -MODIS -MODIS -MODIS -LandScan2004 -MODIS -ISRIC-WISE -GLOBE-Gardner -GLOBE-Gardner-mergeGIS -nomask -USGS -nomask -nomask -IGBP-GSDP -AVHRR -AVHRR -ORNL-Soil -AVHRR -HYDRO1K-merge-nomask -GRDC -cruncep - - -3x3min -0.5x0.5 -0.5x0.5 -0.25x0.25 -0.25x0.25 -3x3min -0.25x0.25 -3x3min -0.25x0.25 -5x5min -3x3min -10x10min -3x3min -5x5min -10x10min -5x5min -0.5x0.5 -0.5x0.5 -5x5min -0.5x0.5 -1km-merge-10min -0.9x1.25 -360x720cru - - -mksrf_flakwat -mksrf_fwetlnd -mksrf_fvocef -mksrf_flai -mksrf_fvegtyp -mksrf_fvegtyp -mksrf_furban -mksrf_fsoicol -mksrf_forganic -mksrf_fglacier -mksrf_fglacierregion -mksrf_fmax -mksrf_furbtopo -mksrf_fsoitex -mksrf_fgdp -mksrf_fpeat -mksrf_fsoildepth -mksrf_fabm -mksrf_ftopostats -mksrf_fvic -mksrf_fch4 - - -lnd/clm2/rawdata/mksrf_navyoro_20min.c010129.nc - - - -lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_lai_78pfts_simyr2005.c170413.nc - - - -lnd/clm2/rawdata/mksrf_irrig_2160x4320_simyr2000.c110527.nc - -lnd/clm2/rawdata/mksrf_soitex.10level.c010119.nc - -lnd/clm2/rawdata/pftcftlandusedynharv.0.25x0.25.MODIS.simyr1850-2015.c170412/mksrf_soilcolor_CMIP6_simyr2005.c170623.nc - -lnd/clm2/rawdata/mksrf_organic_10level_5x5min_ISRIC-WISE-NCSCD_nlev7_c120830.nc - -lnd/clm2/rawdata/mksrf_fmax_3x3min_USGS_c120911.nc - - -lnd/clm2/rawdata/mksrf_LakePnDepth_3x3min_simyr2004_csplk_c151015.nc - -lnd/clm2/rawdata/mksrf_lanwat.050425.nc - - -lnd/clm2/rawdata/mksrf_vocef_0.5x0.5_simyr2000.c110531.nc - - -lnd/clm2/rawdata/mksrf_urban_0.05x0.05_simyr2000.c120621.nc - - - -lnd/clm2/rawdata/mksrf_glacier_3x3min_simyr2000.c120926.nc -lnd/clm2/rawdata/mksrf_glacier_3x3min_simyr2000_mergeGreenland.c120921.nc - - -lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_c170616.nc - - -lnd/clm2/rawdata/mksrf_topo.10min.c080912.nc - - -lnd/clm2/rawdata/mksrf_gdp_0.5x0.5_AVHRR_simyr2000.c130228.nc - -lnd/clm2/rawdata/mksrf_peatf_0.5x0.5_AVHRR_simyr2000.c130228.nc - -lnd/clm2/rawdata/mksf_soilthk_5x5min_ORNL-Soil_simyr1900-2015_c170630.nc - -lnd/clm2/rawdata/mksrf_abm_0.5x0.5_AVHRR_simyr2000.c130201.nc - -lnd/clm2/rawdata/mksrf_topostats_1km-merge-10min_HYDRO1K-merge-nomask_simyr2000.c130402.nc - -lnd/clm2/rawdata/mksrf_vic_0.9x1.25_GRDC_simyr2000.c130307.nc - -lnd/clm2/rawdata/mksrf_ch4inversion_360x720_cruncep_simyr2000.c130322.nc - - - - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1850.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1851.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1852.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1853.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1854.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1855.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1856.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1857.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1858.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1859.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1860.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1861.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1862.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1863.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1864.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1865.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1866.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1867.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1868.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1869.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1870.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1871.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1872.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1873.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1874.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1875.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1876.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1877.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1878.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1879.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1880.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1881.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1882.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1883.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1884.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1885.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1886.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1887.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1888.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1889.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1890.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1891.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1892.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1893.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1894.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1895.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1896.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1897.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1898.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1899.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1900.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1901.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1902.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1903.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1904.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1905.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1906.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1907.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1908.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1909.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1910.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1911.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1912.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1913.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1914.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1915.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1916.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1917.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1918.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1919.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1920.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1921.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1922.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1923.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1924.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1925.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1926.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1927.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1928.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1929.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1930.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1931.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1932.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1933.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1934.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1935.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1936.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1937.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1938.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1939.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1940.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1941.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1942.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1943.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1944.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1945.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1946.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1947.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1948.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1949.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1950.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1951.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1952.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1953.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1954.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1955.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1956.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1957.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1958.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1959.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1960.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1961.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1962.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1963.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1964.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1965.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1966.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1967.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1968.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1969.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1970.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1971.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1972.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1973.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1974.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1975.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1976.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1977.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1978.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1979.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1980.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1981.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1982.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1983.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1984.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1985.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1986.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1987.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1988.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1989.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1990.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1991.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1992.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1993.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1994.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1995.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1996.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1997.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1998.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_1999.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2000.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2001.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2002.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2003.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2004.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2005.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2006.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2007.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2008.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2009.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2010.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2011.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2012.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2013.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2014.c170629.nc - -lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c170629/mksrf_landuse_histclm50_LUH2_2015.c170629.nc - - - -atm/cam/ggas/ghg_hist_1765-2005_c091218.nc -atm/cam/ggas/ghg_rcp26_1765-2500_c100405.nc -atm/cam/ggas/ghg_rcp45_1765-2500_c100405.nc -atm/cam/ggas/ghg_rcp60_1765-2500_c100901.nc -atm/cam/ggas/ghg_rcp85_1765-2500_c100203.nc - - diff --git a/bld/namelist_files/namelist_defaults_drv.xml b/bld/namelist_files/namelist_defaults_drv.xml deleted file mode 100644 index 2ad5c26013..0000000000 --- a/bld/namelist_files/namelist_defaults_drv.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -Buildconf/camconf/drv_flds_in,Buildconf/clmconf/drv_flds_in - - diff --git a/bld/namelist_files/namelist_defaults_drydep.xml b/bld/namelist_files/namelist_defaults_drydep.xml deleted file mode 100644 index 056f598d2b..0000000000 --- a/bld/namelist_files/namelist_defaults_drydep.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - -'O3','NO2','HNO3','NO','HO2NO2','CH3OOH','CH2O','CO','H2O2','CH3COOOH','PAN','MPAN','C2H5OOH','ONIT','POOH','C3H7OOH','ROOH','CH3COCHO','CH3COCH3','Pb','ONITR','MACROOH','XOOH','ISOPOOH','CH3OH','C2H5OH','CH3CHO','GLYALD','HYAC','HYDRALD','ALKOOH','MEKOOH','TOLOOH','TERPOOH','CH3COOH','CB1','CB2','OC1','OC2','SOA','SO2','SO4','NH3','NH4NO3' - -xactive_lnd - - - -'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a', 'CH3OH = methanol', 'C2H5OH = ethanol', 'CH2O = formaldehyde', 'CH3CHO = acetaldehyde', 'CH3COOH = acetic_acid', 'CH3COCH3 = acetone' - -atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc -atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc -atm/cam/chem/trop_mozart/emis/megan21_emis_factors_c20120313.nc - - diff --git a/bld/namelist_files/namelist_defaults_fire_emis.xml b/bld/namelist_files/namelist_defaults_fire_emis.xml deleted file mode 100644 index b7536ba66b..0000000000 --- a/bld/namelist_files/namelist_defaults_fire_emis.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - -'bc_a1 = BC','pom_a1 = 1.4*OC','SO2 = SO2' - -lnd/clm2/firedata/fire_emis_factors_c140116.nc - - diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml deleted file mode 100644 index 20158c7dd4..0000000000 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - -startup -startup -arb_ic -arb_ic -arb_ic -arb_ic -arb_ic -cold - - -/fs/cgd/csm/inputdata - - -1.9x2.5 -1x1_brazil -5x5_amazon -1x1_camdenNJ -1x1_vancouverCAN -1x1_mexicocityMEX -1x1_asphaltjungleNJ -1x1_urbanc_alpha -1x1_numaIA -1x1_smallvilleIA - - -2000 - - -constant - - -1 -0 - - -1 -0 - - --999.9 - - -.false. - - -gx1v6 -gx1v6 -gx1v6 -gx1v6 -gx3v7 -gx3v7 -USGS - -cruncep -USGS -USGS -gx3v7 -USGS -USGS - -T62 - -gx1v6 -gx1v6 -gx1v6 - -navy -navy -navy -navy -navy -navy -test -navy -test -gx1v6 - - - -.false. -0 -1 -3 -5 -10 -36 - - diff --git a/bld/namelist_files/namelist_defaults_usr_files.xml b/bld/namelist_files/namelist_defaults_usr_files.xml deleted file mode 100644 index 14ba49de23..0000000000 --- a/bld/namelist_files/namelist_defaults_usr_files.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - -lnd/clm2/initdata/clmi.${clm_usr_name}_${mask}_simyr${sim_year}.nc - - -lnd/clm2/surfdata/surfdata_${clm_usr_name}_simyr${sim_year}.nc -lnd/clm2/surfdata_map/surfdata_${clm_usr_name}_simyr${sim_year}.nc - - -null -lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr${sim_year_range}.nc -lnd/clm2/surfdata/landuse.timeseries_${clm_usr_name}_simyr1849-2006.nc -lnd/clm2/surfdata/landuse.timeseries_rcp${rcp}_${clm_usr_name}_simyr${sim_year_range}.nc -lnd/clm2/surfdata/landuse.timeseries_rcp${rcp}_${clm_usr_name}_simyr1849-2006.nc - - diff --git a/bld/namelist_files/namelist_definition.xsl b/bld/namelist_files/namelist_definition.xsl deleted file mode 100644 index 545d810e52..0000000000 --- a/bld/namelist_files/namelist_definition.xsl +++ /dev/null @@ -1,363 +0,0 @@ - - - - - - - - - - - - - CLM Namelist Definition - - -

-

-
-

-

-

Definition of CLM namelist variables

-

We list all of the relevant namelist variables for CLM I cases. This includes - CLM Namelist items as well as CLM build-namelist settings and namelist settings - for CLM offline tools.

-
-

Definition of CLM namelist variables

-

Note, these all would go into the user_nl_clm file - before configure):

-

Included in the table are the following pieces of information:

-
    -
  • Variable name.
  • -
  • Variable type (char, integer, - real, or logical). The type - char has the length appended - following an asterisk, e.g., char*256. Variables that are - arrays have their dimension specifier appended inside parentheses. For - example char*1(6) denotes a array of six - char*1 values. -
  • -
  • Variable description (includes information on defaults).
  • -
  • Valid values (if restricted).
  • -
- - - - - - - - - - - - -
CLM Namelist Physics Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Lake Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Biogeochemistry (BGC) Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Biogeochemistry Namelist Nitrogen Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Methane Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Vertical CN Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Carbon Isotope Model Options
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Datasets
NameTypeDescription -
Valid values
- - - - - - - - - - - - -
CLM Namelist History output settings
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Restart settings
NameTypeDescription
Valid values
- - - - - - - - - - - - -
CLM Namelist Performance Tuning
NameTypeDescription
Valid values
- -

-

-
-

-

-

Command Line Options to CLM Build-namelist

-

Variables that are entered as options to build-namelist (but NOT used by - namelists in code). Most of these are options that could be added to - CLM_BLDNML_OPTS. Included in the table are the following pieces - of information:

-
    -
  • Variable name.
  • -
  • Type.
  • -
  • Valid values.
  • -
  • Variable description.
  • -
- - - - - - - - - - - - -
CLM Namelist Default Settings
NameTypeDescription
Valid values, if restricted at all
-

-

-
-

-

-

Command Line Options to CLM Build-namelist

-

Variables that are entered as options to build-namelist (but NOT used by - namelists in code). Most of these are options that could be added to - CLM_BLDNML_OPTS. Included in the table are the following pieces - of information:

-
    -
  • Variable name.
  • -
  • Type.
  • -
  • Valid values.
  • -
  • Variable description.
  • -
- - - - - - - - - - - - -
CLM Namelist Default Settings
NameTypeDescription
Valid values, if restricted at all
-

-

-
-

-

-

Namelist items for CLM Tools

-

These are namelist items that appear in the CLM Tools under components/clm/tools. -

- - - - - - - - - - - -
CLM mksurfdata
NameTypeDescription
Valid values
- - - - - - - - - - - -
CLM mkgriddata
NameTypeDescription
Valid values
- - - - - - - - - - - -
CLM mkmapdata
NameTypeDescription
Valid values
- - - - - - - - - - - -
CLM mkgriddata
NameTypeDescription
Valid values
- - - - - - - - - - - -
Miscellaneous CLM tools
NameTypeDescription
Valid values
- -
- -

Namelist items for Driver MEGAN Physics

- - - - - - - - - - - -
Driver Physics
NameTypeDescription
Valid values
- - -

Namelist items for Driver Dry Deposition

- - - - - - - - - - - -
Driver Dry-Deposition Namelist Options
NameTypeDescription
Valid values, if restricted at all
- -
- - -
- - - - - - - - - Valid Values: - - - - -
diff --git a/bld/namelist_files/namelist_definition_clm4_0.xml b/bld/namelist_files/namelist_definition_clm4_0.xml deleted file mode 100644 index 220a033e4e..0000000000 --- a/bld/namelist_files/namelist_definition_clm4_0.xml +++ /dev/null @@ -1,820 +0,0 @@ - - - - - - - - - - - -Full pathname of initial conditions file. If blank CLM will startup from -arbitrary initial conditions. - - - -Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch) -(Set with RUN_REFCASE and RUN_REFDATE) - - - -Full pathname of land fraction data file. - - - -Clumps per processor. - - - -Atmospheric CO2 molar ratio (by volume) only used when co2_type==constant (umol/mol) -(Set by CCSM_CO2_PPMV) - - - -Type of CO2 feedback. - constant = use the input co2_ppmv value - prognostic = use the prognostic value sent from the atmosphere - diagnostic = use the diagnostic value sent from the atmosphere - - - - -Supplemental Nitrogen mode and for what type of vegetation it's turned on for. -In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is -over-productive. It does act as a proxy for fertilization for crops however. - NONE = No vegetation types get supplemental Nitrogen - PROG_CROP_ONLY = Supplemental Nitrogen is only active for prognostic Crops - ALL = Supplemental Nitrogen is active for all vegetation types - - - -If TRUE, separate the vegetated landunit into a crop landunit and a natural vegetation landunit - - - -Number of multiple elevation classes over glacier points. -Normally this is ONLY used when running CESM with the active glacier model. - - - -If TRUE, dynamically change topographic height over glacier points. -Only works when glc_nec is greater than zero. -(EXPERIMENTAL AND NOT FUNCTIONAL!) - - - -Visible and Near-infrared albedo's for glacier ice - - - -Time step (seconds) - - - -Override the start type from the driver: it can only be -set to 3 meaning branch. - - - -Full pathname of land-ice mask data file (on lnd grid). - - - -Full pathname of topography data file. Only required when -land-ice model is active. - - - -Full pathname datafile with plant function type (PFT) constants - - - -Full pathname of time varying PFT data file. This causes the land-use types of -the initial surface dataset to vary over time. - - - -Full pathname of surface data file. - - - -SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name - - - -SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name - - - -Per file averaging flag. - 'A' (average over history period) - 'I' (instantaneous) - 'X' (maximum over history period) - 'M' (minimum over history period) - - - -Averaging type of output for 1D vector output (when hist_dov2xy is false). - GRID means average all land-units up to the grid-point level - LAND means average all columns up to the land-unit level - COLS means average all PFT's up to the column level - PFTS means report everything on native PFT level - - - -If TRUE, implies output data on a 2D latitude/longitude grid. False means -output in 1D vector format. One setting per history tape series. - - - -If TRUE, indicates do NOT output any default history fields (requires you to use -hist_fincl* to set the exact output fields to use).. - - - -Fields to exclude from history tape series 1. - - - -Fields to exclude from history tape series 2. - - - -Fields to exclude from history tape series 3. - - - -Fields to exclude from history tape series 4. - - - -Fields to exclude from history tape series 5. - - - -Fields to exclude from history tape series 6. - - - -Fields to add to history tape series 1. - - - -Fields to add to history tape series 2. - - - -Fields to add to history tape series 3. - - - -Fields to add to history tape series 4. - - - -Fields to add to history tape series 5. - - - -Fields to add to history tape series 6. - - - -Per tape series maximum number of time samples. - - - -Per tape series history file density (i.e. output precision) - 1=double precision - 2=single precision -Default: 2,2,2,2,2,2 - - - -Per tape series history write frequency. - positive means in time steps - 0=monthly - negative means hours -(i.e. 5 means every 24 time-steps and -24 means every day -Default: 0,-24,-24,-24,-24,-24 - - - -number of segments per clump for decomposition -Default: 20 - - - -Perturbation limit when doing error growth test - - - -If FALSE, don't write any restart files. - - - -Turn urban air conditioning/heating ON or OFF and add wasteheat: - OFF = Air conditioning/heating is OFF in buildings, internal temperature allowed to float freely - ON = Air conditioning/heating is ON in buildings, internal temperature constrained - ON_WASTEHEAT = Air conditioning/heating is ON and waste-heat sent to urban canyon - - - -If TRUE, urban traffic flux will be activated (Currently NOT implemented). - - - -If TRUE, write diagnostic of global radiative temperature written to CLM log file. - - - - - - -SCRIP format grid data file - - - -Flag to pass to the ESMF mapping utility, telling it what kind of large -file support is needed for an output file generated with this grid as -either the source or destination ('none', '64bit_offset' or 'netcdf4'). - - - -Flag to pass to the ESMF mapping utility, telling it what kind of grid -file this is (SCRIP or UGRID). - - - -For UGRID files, flag to pass to the ESMF mapping utility, telling it the -name of the dummy variable that has all of the topology information stored -in its attributes. (Only used if scripgriddata_src_type = UGRID.) - - - - - - -Filename for mksurfdata_map to remap raw data into the output surface dataset - - - -Plant Function Type dataset for mksurfdata - - - -Dataset for percent glacier land-unit for mksurfdata - - - -Dataset for topography used to define urban threshold - - - -Dataset for land topography - - - -Leaf Area Index dataset for mksurfdata - - - -Soil texture dataset for mksurfdata - - - -Soil color dataset for mksurfdata - - - -Soil max fraction dataset for mksurfdata - - - -High resolution land mask/fraction dataset for mksurfdata -(used for glacier_mec land-units) - - - -Type of grid to create for mksurfdata - - - -Grid file at the output resolution for mksurfdata - - - -Text file with filepaths (or list of XML elements) for vegetation fractions -and harvesting for each year to run over for mksurfdata to be able to model -transient land-use change - - - -High resolution topography dataset for mksurfdata -(used for glacier_mec land-units) - - - -Irrigation dataset for mksurfdata - - - -Organic soil dataset for mksurfdata - - - -Lake water dataset for mksurfdata - - - -Wetland dataset for mksurfdata - - - -Urban dataset for mksurfdata - - - -Biogenic Volatile Organic Compounds (VOC) emissions dataset for mksurfdata - - - -If TRUE, output variables in double precision for mksurfdata - - - -If TRUE, ignore other files, and set the output percentage to 100% urban and -zero for other land-use types. - - - -Number of Plant Functional Types (excluding bare-soil) - - - -Plant Function Type index to override global file with for mksurfdata - - - -Plant Function Type fraction to override global file with for mksurfdata - - - -Soil color index to override global file with for mksurfdata - - - -Soil maximum fraction to override global file with for mksurfdata - - - -Soil percent sand to override global file with for mksurfdata - - - -Soil percent clay to override global file with for mksurfdata - - - - - - - -Orography file with surface heights and land area fraction - - - -CLM grid file - - - -CESM domain file - - - -CAM file - - - -Raw topography file - - - -CAM topography file - - - -Number of longitudes to use for a regional grid (for single-point set to 1) - - - -Number of latitudes to use for a regional grid (for single-point set to 1) - - - -Northern edge of the regional grid - - - -Southern edge of the regional grid - - - -Eastern edge of the regional grid - - - -Western edge of the regional grid - - - - - - - -Historical greenhouse gas concentrations from CAM, only used -by getco2_historical.ncl - - - - - - -Aerosol deposition file name (only used for aerdepregrid.ncl) - - - -Full pathname of CLM fraction dataset (only used for mkdatadomain). - - - -Full pathname of CLM grid dataset (only used for mkdatadomain). - - - -Full pathname of output domain dataset (only used for mkdatadomain). - - - -Type of domain file to create (ocean or atmosphere) (only used for mkdatadomain) - - - - - - - -First year to loop over for Nitrogen Deposition data - - - -Last year to loop over for Nitrogen Deposition data - - - -Simulation year that aligns with stream_year_first_ndep value - - - -Filename of input stream data for Nitrogen Deposition - - - -Mapping method from Nitrogen deposition input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - -datm input directory - - -datm output directory - - -Datm logfile name - - - - - - - -Mapping file to go from one resolution/land-mask to another resolution/land-mask - - - -Land mask description for mksurfdata input files - - - -Horizontal grid resolutions for mksurfdata input files - - - - - - - -Check that the resolution and land-mask is valid before continuing. - - - -Add a note to the output namelist about the options given to build-namelist - - - -CLM run type. - 'default' use the default type of clm_start type for this configuration - 'cold' is a run from arbitrary initial conditions - 'arb_ic' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found - 'startup' is an initial run with initial conditions provided. - 'continue' is a restart run. - 'branch' is a restart run in which properties of the output history files may be changed. - - - -Horizontal resolutions -Note: 0.1x0.1, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools - - - -Representative concentration pathway for future scenarios [radiative forcing at peak or 2100 in W/m^2] --999.9 means do NOT use a future scenario, just use historical data. - - - -Land mask description - - - -Command line argument for setting up your simulation in a mode for faster -throughput. By default turns off some options, and sets up for a lower level -of output. When bgc_mode is some level of prognostic BGC (so NOT Satellite Phenology) -it also sets up for accelerated decomposition. -NOTE: THIS CORRESPONDS DIRECTLY TO THE env_run.xml VARIABLE OF THE SAME NAME. - Set the env_run variable, rather than setting this directly. - - - -General configuration of model version and atmospheric forcing to tune the model to run under. -This sets the model to run with constants that were set to run well under the configuration -of model version and atmospheric forcing. To run well constants would need to be changed -to run with a different type of atmospheric forcing. - - - -If TRUE, irrigation will be active (find surface datasets with active irrigation). - - - -If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - - - -Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) -A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year greater than 2005 corresponds to rcp scenario data -Most years are only used for clm_tools and there aren't CLM datasets that correspond to them. -CLM datasets exist for years: 1000 (for testing), 1850, and 2000 - - - -Range of years to simulate transitory datasets for (such as dynamic: land-use datasets, aerosol-deposition, Nitrogen deposition rates etc.) -Constant means simulation will be held at a constant year given in sim_year. -A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 and then scenario data beyond that point. - - - -Namelist entries to demand be provided on the namelist. - - - -Description of the use case selected. - - - - - - - -Where dry deposition is calculated (from land, atmosphere, or from a table) - - - - -List of chemical constituents that dry deposition will be calculated for - - - - - - - -File containing MEGAN emissions factors. Includes the list of MEGAN compounds that can be -used in the Comp_Name variable on the file. - - - -MEGAN specifier. This is in the form of: Chem-compound = megan_compound(s) -where megan_compound(s) can be the sum of megan compounds with a "+" between them. -In each equation, the item to the left of the equal sign is a CAM chemistry compound, the -items to the right are compounds known to the MEGAN model (single or combinations). -For example, -megan_specifier = 'ISOP = isoprene', - 'C10H16 = pinene_a + carene_3 + thujene_a' - - - -MEGAN mapped isoprene emissions factors switch -If TRUE then use mapped MEGAN emissions factors for isoprene. - - - -List of possible MEGAN compounds to use - (the list used by the simulation is on the megan_factors_file as the Comp_Name) - - - - - -Enable C13 model - - - -Enable C14 model - - - diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml deleted file mode 100644 index 0a4bbd9a28..0000000000 --- a/bld/namelist_files/namelist_definition_clm4_5.xml +++ /dev/null @@ -1,2456 +0,0 @@ - - - - - - - - - - - -If use_init_interp is set to .true., interpinic will be called to interpolate -the file given by finidat, creating the output file specified by finidat_interp_dest. - - - -Full pathname of initial conditions file. If blank CLM will startup from -arbitrary initial conditions. - - - -If set to .true., interpinic will be called to interpolate the file given by finidat, -creating the output file specified by finidat_interp_dest. - -This requires that finidat be non-blank. - - - -Full pathname of master restart file for a branch run. (only used if RUN_TYPE=branch) -(Set with RUN_REFCASE and RUN_REFDATE) - - - -Full pathname of land fraction data file. - - - -Clumps per processor. - - - -Atmospheric CO2 molar ratio (by volume) only used when co2_type==constant (umol/mol) -(Set by CCSM_CO2_PPMV) - - - -Type of CO2 feedback. - constant = use the input co2_ppmv value - prognostic = use the prognostic value sent from the atmosphere - diagnostic = use the diagnostic value sent from the atmosphere - - - - -Supplemental Nitrogen mode and for what type of vegetation it's turned on for. -In this mode Nitrogen is unlimited rather than prognosed and in general vegetation is -over-productive. - NONE = No vegetation types get supplemental Nitrogen - ALL = Supplemental Nitrogen is active for all vegetation types - - - -If TRUE, separate the vegetated landunit into a crop landunit and a natural vegetation landunit - - - -If TRUE, run all urban landunits everywhere where we have valid urban data. -This forces memory to be allocated and calculations to be run even for 0-weight urban points. -This has a substantial impact on memory use and performance, and should only be used -if you're interested in potential urban behavior globally. - - - -If TRUE, make ALL pfts, columns and landunits active, even those with 0 weight. -This means that computations will be run even over these 0-weight points. - -THIS IS ONLY FOR TESTING PURPOSES - IT HAS NOT BEEN CHECKED FOR SCIENTIFIC VALIDITY. - - - -If TRUE, square the organic fraction when it's used (as was done in CLM4.5) -Otherwise use the fraction straight up (the default for CLM5.0) - - - -10SL_3.5m = standard CLM4 and CLM4.5 version -23SL_3.5m = more vertical layers for permafrost simulations -49SL_10m = 49 layer soil column, 10m of soil, 5 bedrock layers -20SL_8.5m = 20 layer soil column, 8m of soil, 5 bedrock layers - - - -If TRUE, use variable soil depth. - -If present on surface dataset, use depth to bedrock information to -specify spatially variable soil thickness. If not present, use bottom -of soil column (nlevsoi). - - - -Index of rooting profile for water - -Changes rooting profile from Zeng 2001 double exponential (0) to -Jackson 1996 single exponential (1) to Koven uniform exponential (2). - - - -Index of rooting profile for carbon - -Changes rooting profile from Zeng 2001 double exponential (0) to -Jackson 1996 single exponential (1) to Koven uniform exponential (2). - - - -Index of rooting profile for soil carbon - -Changes rooting profile from Zeng 2001 double exponential (0) to -Jackson 1996 single exponential (1) to Koven uniform exponential (2). - - - -Variant index of rooting profile for water -(Currently only used for Jackson 1996 method) - - - -Variant index of rooting profile for carbon and soil carbon -(Currently only used for Jackson 1996 method) - - - -Index of rooting profile for carbon - -Changes rooting profile from Zeng 2001 double exponential (0) to -Jackson 1996 single exponential (1) to Koven uniform exponential (2). - - - -Index of evaporative resistance method. - -Changes soil evaporative resistance method from Sakaguchi and Zeng -2009 Beta function (0) to Swenson and Lawrence 2014 dry surface layer -formulation (1). - - - -The method type to use for CNFire - -nofire: Turn fire effects off -li2014qianfrc: Reference paper Li, et. al.(2014) tuned with QIAN atmospheric forcing -li2016crufrc: Reference paper Li, et. al.(2016) tuned with CRU-NCEP atmospheric forcing - - - -Potential human ignition counts (/person/month) - - - -boreal peat fires (/hr) - - - -non-boreal peat fires (/hr) - - - -Scalar for cropfire (/hr) - - - -Critical RH for ignition (0-100) - - - -Saturation RH for ignition (0-100) - - - -Lower threshold for fuel mass needed for ignition - - - -Upper threshold for fuel mass needed for ignition - - - -Saturation BTRAN for ignition (0-1) - - - -Critical BTRAN for ignition (0-1) - - - -Global constant for deforestation fires (/day) - - - -Fire occurance for high GDP areas that are tree dominated (fraction) - - - -Combustion completeness factor (for litter and CWD[Course Woody Debris]) (unitless) - - - -Critical threshold for truncation of Nitrogen (truncate Nitrogen states to zero below this value) - - - -Critical threshold for truncation of Carbon (truncate Carbon states to zero below this value) - - - -Critical threshold of negative Nitrogen to die (abort when Nitrogen states are below this value) - - - -Critical threshold of negative Carbon to die (abort when Carbon states are below this value) - - - -Initial stocks of Carbon to use in soil organic matter pools for CENTURY decomposition - - - -Soil depth to place initial stocks of Carbon in soil organic matter pools for CENTURY decomposition - - - -Slope of free living Nitrogen fixation with annual ET - - - -Intercept of free living Nitrogen fixation with zero annual ET - - - -If TRUE use the undercanopy stability term used with CLM4.5 (Sakaguchi&Zeng, 2008) - - - -Fraction of intercepted precipitation - - - -If TRUE use clm5 equation for fraction of intercepted precipitation - - - -Maximum fraction of leaf that may be wet prior to drip occuring - - - -Scalar multiplier for base flow rate -(ONLY used if lower_boundary_condition is not aquifer or table) - - - -Index of solution method of Richards equation. - -Change method for richards equation solution and boundary -conditions. - -CLM 4.5 - soilwater_movement_method = 0 (Zeng and Decker, 2009, method). -CLM 5.0 - soilwater_movement_method = 1 (adaptive time stepping moisture form from Martyn Clark). - -1 (adaptive time stepping moisture form - - - -Index of upper boundary condition for Richards equation. - - - -Index of lower boundary condition for Richards equation. - -lower_boundary_condition = 1 : flux lower boundary condition (use with soilwater_movement_method=adaptive time stepping) -lower_boundary_condition = 2 : zero-flux lower boundary condition (use with soilwater_movement_method=adaptive time stepping) -lower_boundary_condition = 3 : water table head-based lower boundary condition w/ aquifer layer. (use with soilwater_movement_method=adaptive time stepping) -lower_boundary_condition = 4 : 11-layer solution w/ aquifer layer (only used with soilwater_movement_method=Zeng&Decker 2009) - -TODO(bja, 2015-09) these should be strings so they have meaningful names instead of ints. - - - -minimum time step length (seconds) for adaptive time stepping in richards equation - - -a very small number: used to check for sub step completion for adaptive time stepping in richards equation - - -tolerance to halve length of substep for adaptive time stepping in richards equation - - -tolerance to double length of substep for adaptive time stepping in richards equation - - - - - - - - - - - - -Minimum leaf area index for irrigation to occur - - - -Time of day to check whether we need irrigation, seconds (0 = midnight). -We start applying the irrigation in the time step FOLLOWING this time. - - - -Desired amount of time to irrigate per day (sec). -Actual time may differ if this is not a multiple of dtime. - - - -Target soil matric potential for irrigation (mm). -When we irrigate, we aim to bring the total soil moisture in the top (irrig_depth) m of soil up to this level. - - - -Soil depth to which we measure for irrigation (m) - - - -Determines soil moisture threshold at which we irrigate. -If h2osoi_liq_wilting_point is the soil moisture level at wilting point and -h2osoi_liq_target is the soil moisture level at the target irrigation level -(given by irrig_target_smp), then the threshold at which we irrigate is - h2osoi_liq_wilting_point + - irrig_threshold_fraction*(h2osoi_liq_target - h2osoi_liq_wilting_point) -A value of 1 means that we irrigate whenever soil moisture falls below the target. -A value of 0 means that we only irrigate when soil moisture falls below the wilting point. - - - -Threshold for river water volume below which irrigation is shut off (as a fraction of available river water), if limit_irrigation_if_rof_enabled is .true. -A threshold of 0 means allow all river water to be used; -a threshold of 0.1 means allow 90% of the river volume to be used; etc. - - - -If TRUE, limit irrigation when river storage drops below a threshold. -Only applies if using an active runoff (ROF) model; otherwise, river storage-based limitation -is turned off regardless of the setting of this namelist variable. - - - -If TRUE, irrigation will be active. - - - -Number of multiple elevation classes over glacier points. - - - -If TRUE, dynamically change areas and topographic heights over glacier points. -Only works when running with a non-stub glacier model. - - - -Behavior of each glacier region (GLACIER_REGION in surface dataset). -First item corresponds to GLACIER_REGION with ID 0 in the surface dataset, -second to GLACIER_REGION with ID 1, etc. -Allowed values are: -'multiple': grid cells can potentially have multiple glacier elevation classes, - but no virtual columns -'virtual': grid cells have virtual columns: values are computed for every glacier - elevation class, even those with 0 area (in order to provide surface mass - balance for every glacier elevation class). -'single_at_atm_topo': glacier landunits in these grid cells have a single column, - whose elevation matches the atmosphere's topographic height (so that there is no - adjustment due to downscaling) -Behavior of 'virtual' is required in the region where we have an ice sheet model - - - -Treatment of ice melt for each glacier region (GLACIER_REGION in surface dataset). -First item corresponds to GLACIER_REGION with ID 0 in the surface dataset, -second to GLACIER_REGION with ID 1, etc. -Allowed values are: -'replaced_by_ice': any melted ice runs off and is immediately replaced by solid ice; - this results in positive liquid runoff and negative ice runoff -'remains_in_place': any melted ice remains in place as liquid until it refreezes; - thus, ice melt does not result in any runoff -IMPORTANT NOTE: Regions with the 'remains_in_place' behavior also do not -compute SMB (because negative SMB would be pretty much meaningless in -those regions). Thus, you cannot use this behavior where GLC is -operating. -Regions with the 'replaced_by_ice' behavior also compute SMB for the -vegetated column. - - - -Treatment of ice runoff for each glacier region (GLACIER_REGION in surface dataset). -First item corresponds to GLACIER_REGION with ID 0 in the surface dataset, -second to GLACIER_REGION with ID 1, etc. -Allowed values are: -'remains_ice': ice runoff is sent to the river model as ice; this is a crude parameterization - of iceberg calving, and so is appropriate in regions where there is substantial iceberg calving - in reality -'melted': ice runoff generated by the CLM physics (primarily due to snow capping) is melted - (generating a negative sensible heat flux) and runs off as liquid; this is appropriate in - regions that have little iceberg calving in reality. This can be important to avoid unrealistic - cooling of the ocean and consequent runaway sea ice growth. -Only applies when melt_non_icesheet_ice_runoff is .true. - - - -Number of days before one considers the perennially snow-covered point 'land ice' -(and thus capable of generating a positive surface mass balance for the glacier model). -This is meant to compensate for the fact that, with small values of h2osno_max, -the onset of a snow-capped state (and thus conversion to land ice) can occur in an -unrealistically short amount of time. -Thus, in general, large values of h2osno_max should have glc_snow_persistence_max_days = 0; -small values of h2osno_max should have glc_snow_persistence_max_days > 0. - - - -Visible and Near-infrared albedo's for glacier ice - - - -CN Maintenence Respiration base rate for roots -(if NOT set, use the value for br_mr on the params file) - - - -Switch to turn on root and stem respiratory acclimation -Atkin, Fisher et al. (2008) and Lombardozzi et al. (2015) - - - -Switch to inihibit photosynthesis in daytime -Lloyd et al. 2010, & Metcalfe et al. 2012 - - - -Modify photosynthesis and leaf maintence respiration for crop - - - -Leaf maintencence respiration for canopy top at 25C method to use - - 0 Scaled by vcmax25top - 1 Ryan 1991 - 2 Atkin 2015 - - - -Stomatal conductance model method to use - - Ball-Berry1987 --- Ball Berry 1987 methodology - Medlyn2011 ------- Medlyn 2011 methodology - - - - -Scalar of leaf respiration to vcmax - - - -The maximum value to use for zeta under stable conditions - - - -baseline proportion of nitrogen allocated for electron transport (J) - - - -Time step (seconds) - - - -Override the start type from the driver: it can only be -set to 3 meaning branch. - - - -Toggle to turn on the FATES model -(use_fates= '.true.' is EXPERIMENTAL NOT SUPPORTED!) - - - -Toggle to turn on spitfire module for modeling fire (only relevant if FATES is being used). - - - -Toggle to turn on the logging module (only relevant if FATES is being used). - - - -Toggle to turn on plant hydraulics (only relevant if FATES is on). -(use_fates_planthydro=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) - - - -Toggle to turn on Static Stand Structure Mode (only relevant if FATES is being used). -(use_fates_ed_st3=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) - - - -Toggle to turn on prescribed physiology (only relevant if FATES is being used). - - - -Toggle to turn on inventory initialization to startup FATES (only relevant if FATES is being used). -(use_fates_inventory_init=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) - - - -Full pathname to the inventory initialization control file. -(Required, if use_fates_inventory_init=T) - - - -Toggle to turn on the LUNA model, to effect Photosynthesis by leaf Nitrogen -LUNA operates on C3 and non-crop vegetation (see vcmax_opt for how other veg is handled) -LUNA: Leaf Utilization of Nitrogen for Assimilation - - - -Toggle to turn on the plant hydraulic stress model - - - -How LUNA and Photosynthesis (if needed) will get Leaf nitrogen content - lnc_opt = true get from leaf N from CN model - lnc_opt = false get based on LAI and fixed CN ratio from parameter file - - - -Full pathname datafile with plant function type (PFT) constants combined with -constants for biogeochem modules - - - -Full pathname datafile with fates parameters - - - -Full pathname of surface data file. - - - -SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name - - - -SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name - - - -Per file averaging flag. - 'A' (average over history period) - 'I' (instantaneous) - 'X' (maximum over history period) - 'M' (minimum over history period) - - - -Averaging type of output for 1D vector output (when hist_dov2xy is false). - GRID means average all land-units up to the grid-point level - LAND means average all columns up to the land-unit level - COLS means average all PFT's up to the column level - PFTS means report everything on native PFT level - - - -If TRUE, implies output data on a 2D latitude/longitude grid. False means -output in 1D vector format. One setting per history tape series. - - - -If TRUE, indicates do NOT output any default history fields (requires you to use -hist_fincl* to set the exact output fields to use).. - - - -Fields to exclude from history tape series 1. - - - -Fields to exclude from history tape series 2. - - - -Fields to exclude from history tape series 3. - - - -Fields to exclude from history tape series 4. - - - -Fields to exclude from history tape series 5. - - - -Fields to exclude from history tape series 6. - - - -Fields to exclude from history tape series 7. - - - -Fields to exclude from history tape series 8. - - - -Fields to exclude from history tape series 9. - - - -Fields to exclude from history tape series 10. - - - -Fields to add to history tape series 1. - - - -Fields to add to history tape series 2. - - - -Fields to add to history tape series 3. - - - -Fields to add to history tape series 4. - - - -Fields to add to history tape series 5. - - - -Fields to add to history tape series 6. - - - -Fields to add to history tape series 7. - - - -Fields to add to history tape series 8. - - - -Fields to add to history tape series 9. - - - -Fields to add to history tape series 10. - - - -Per tape series maximum number of time samples. - - - -Per tape series history file density (i.e. output precision) - 1=double precision - 2=single precision -Default: 2,2,2,2,2,2,2,2,2,2 - - - -Per tape series history write frequency. - positive means in time steps - 0=monthly - negative means hours -(i.e. 5 means every 24 time-steps and -24 means every day -Default: 0,-24,-24,-24,-24,-24,-24,-24,-24,-24 - - - -number of segments per clump for decomposition -Default: 20 - - - -Perturbation limit when doing error growth test - - - -If FALSE, don't write any restart files. - - - -Turn urban air conditioning/heating ON or OFF and add wasteheat: - OFF = Air conditioning/heating is OFF in buildings, internal temperature allowed to float freely - ON = Air conditioning/heating is ON in buildings, internal temperature constrained - ON_WASTEHEAT = Air conditioning/heating is ON and waste-heat sent to urban canyon - - - -If TRUE, urban traffic flux will be activated (Currently NOT implemented). - - - -0 = simpler method (clm4_5) -1 = prognostic calculation of interior building temp (clm5_0) - - - -If TRUE, human stress indices will be calculated - - - -If TRUE, write diagnostic of global radiative temperature written to CLM log file. - - - -Subgrid fluxes for snow - - - -Turn vegetation snow canopy ON, OFF, or ON with albedo influence (ON_RAD) - - - - - - -Turn on methane model. Standard part of CLM45BGC model. - - - -CLM Biogeochemistry mode : Carbon Nitrogen model (CN) -(or CLM45BGC if phys=clm4_5, vsoilc_centbgc='on', and clm4me='on') - - - -CLM Biogeochemistry mode : Carbon Nitrogen with Dynamic Global Vegetation Model (CNDV) -(or CLM45BGCDV if phys=clm4_5, vsoilc_centbgc='on', and clm4me='on') - - - -Turn the Fixation and Uptate of Nitrogen model version 2 (FUN2.0) -Requires the CN model to work (either CN or CNDV). - - - -Nitrification/denitrification splits the prognostic mineral N pool into two - mineral N pools: NO3 and NH4, and includes the transformations between them. -Requires the CN model to work (either CN or CNDV). - - - -Multiplier for heterotrophic respiration for max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) - - - -Exponent power for heterotrophic respiration for max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) - - - -Multiplier for nitrate concentration for max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) - - - -Exponent power for nitrate concentrationfor max denitrification rates -(ONLY used if use_nitrif_denitrif is enabled) - - - -Maximum nitrification rate constant (1/s) -(ONLY used if use_nitrif_denitrif is enabled) - - - -Turn on vertical soil carbon. -Requires the CN or FATES model to work (either CN or CNDV). - - - -Use parameters for decomposition from the CENTURY Carbon model -Requires the CN or FATES model to work (either CN or CNDV). - - - -Toggle to use 25 lake layers instead of 10 -(extralaklayers=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) - - - -Toggle to turn on the VIC hydrologic parameterizations -(vichydro=".true." is EXPERIMENTAL NOT SUPPORTED!) - - - -Toggle to turn on the prognostic crop model - - - -Toggle to turn on the prognostic fertilizer for crop model - - - -Toggle to turn on the 1-year grain product pool in the crop model - - - -Type of mapping to use for base temperature for prognostic crop model -constant = Just use baset from the PFT parameter file -varytropicsbylat = Vary the tropics by latitude - - - -Only used when baset_mapping == varytropicsbylat -Slope with latitude in degrees to vary tropical baset by - - - -Only used when baset_mapping == varytropicsbylat -Intercept at zero latitude to add to baset from the PFT parameter file - - - -Initial seed Carbon to use at planting -(only used when CN is on as well as crop) - - - -Toggle to turn on ozone stress - - - -Toggle to turn on calculation of SNow and Ice Aerosol Radiation model (SNICAR) radiative forcing -(snicar_frc=".true." is EXPERIMENTAL NOT SUPPORTED!) - - - -Toggle to turn all history output completely OFF (possibly used for testing) - - - -Toggle for vancouver specific logic. - - - -Toggle for mexico city specific logic. - - - -Max number of plant functional types in naturally vegetated landunit. - - - -Toggle to turn on the dynamic root model - - - - - - -SCRIP format grid data file - - - -Flag to pass to the ESMF mapping utility, telling it what kind of large -file support is needed for an output file generated with this grid as -either the source or destination ('none', '64bit_offset' or 'netcdf4'). - - - -Flag to pass to the ESMF mapping utility, telling it what kind of grid -file this is (SCRIP or UGRID). - - - -For UGRID files, flag to pass to the ESMF mapping utility, telling it the -name of the dummy variable that has all of the topology information stored -in its attributes. (Only used if scripgriddata_src_type = UGRID.) - - - - - - -Output of "git describe" to give the tag/commit the version being used corresponds to - - - -Filename for mksurfdata_map to remap raw data into the output surface dataset - - - -Plant Function Type dataset for mksurfdata - - - -Harvest dataset for mksurfdata - - - -Dataset for percent glacier land-unit for mksurfdata - - - -Dataset for glacier region ID for mksurfdata - - - -Dataset for topography used to define urban threshold - - - -Leaf Area Index dataset for mksurfdata - - - -Soil texture dataset for mksurfdata - - - -Soil color dataset for mksurfdata - - - -Soil max fraction dataset for mksurfdata - - - -High resolution land mask/fraction dataset for mksurfdata -(used for glacier_mec land-units) - - - -Type of grid to create for mksurfdata - - - -Grid file at the output resolution for mksurfdata - - - -Text file with filepaths (or list of XML elements) for vegetation fractions -and harvesting for each year to run over for mksurfdata to be able to model -transient land-use change - - - -High resolution topography dataset for mksurfdata -(used for glacier_mec land-units) - - - -Irrigation dataset for mksurfdata - - - -Organic soil dataset for mksurfdata - - - -Lake water dataset for mksurfdata - - - -Wetland dataset for mksurfdata - - - -Urban dataset for mksurfdata - - - -Biogenic Volatile Organic Compounds (VOC) emissions dataset for mksurfdata - - - -GDP dataset for mksurfdata - - - -Peat dataset for mksurfdata - - - -Soil depth dataset for mksurfdata - - - -Agricultural burning dominant month dataset for mksurfdata - - - -Topography statistics dataset for mksurfdata - - - -VIC parameters dataset for mksurfdata - - - -Inversion-derived CH4 parameters dataset for mksurfdata - - - -If TRUE, output variables in double precision for mksurfdata - - - -If TRUE, ignore other files, and set the output percentage to 100% urban and -zero for other land-use types. - - - -If TRUE, set wetland to 0% over land (renormalizing other landcover types as needed); -wetland will only be used for ocean points. - - - -Number of Plant Functional Types (excluding bare-soil) - - - -Plant Function Type index to override global file with for mksurfdata - - - -Plant Function Type fraction to override global file with for mksurfdata - - - -Soil color index to override global file with for mksurfdata - - - -Soil maximum fraction to override global file with for mksurfdata - - - -Soil percent sand to override global file with for mksurfdata - - - -Soil percent clay to override global file with for mksurfdata - - - - - - - -Orography file with surface heights and land area fraction - - - -CLM grid file - - - -CESM domain file - - - -CAM file - - - -Raw topography file - - - -CAM topography file - - - -Number of longitudes to use for a regional grid (for single-point set to 1) - - - -Number of latitudes to use for a regional grid (for single-point set to 1) - - - -Northern edge of the regional grid - - - -Southern edge of the regional grid - - - -Eastern edge of the regional grid - - - -Western edge of the regional grid - - - - - - - -Historical greenhouse gas concentrations from CAM, only used -by getco2_historical.ncl - - - - - - -Aerosol deposition file name (only used for aerdepregrid.ncl) - - - -Full pathname of CLM fraction dataset (only used for mkdatadomain). - - - -Full pathname of CLM grid dataset (only used for mkdatadomain). - - - -Full pathname of output domain dataset (only used for mkdatadomain). - - - -Type of domain file to create (ocean or atmosphere) (only used for mkdatadomain) - - - - - - - -If TRUE, repartition rain/snow from atmosphere based on temperature. - - - -If TRUE, downscale longwave radiation over glc_mec landunits. -This downscaling is conservative. -Default: .true. - - - -Surface temperature lapse rate (K m-1) -A positive value means a decrease in temperature with increasing height - - - -Longwave radiation lapse rate (W m-2 m-1) -A positive value means a decrease in LW radiation with increasing height -Only relevant if glcmec_downscale_longwave is .true. - - - -Relative limit for how much longwave downscaling can be done (unitless) -The pre-normalized, downscaled longwave is restricted to be in the range -[lwrad*(1-longwave_downscaling_limit), lwrad*(1+longwave_downscaling_limit)] -This parameter must be in the range [0,1] -Only relevant if glcmec_downscale_longwave is .true. - - - -Temperature below which all precipitation falls as snow, for glacier columns (deg C) -Only relevant if repartition_rain_snow is .true. - - - -Temperature above which all precipitation falls as rain, for glacier columns (deg C) -Only relevant if repartition_rain_snow is .true. - - - -Temperature below which all precipitation falls as snow, for non-glacier columns (deg C) -Only relevant if repartition_rain_snow is .true. - - - -Temperature above which all precipitation falls as rain, for non-glacier columns (deg C) -Only relevant if repartition_rain_snow is .true. - - - - - - - -If TRUE, ice runoff generated from non-glacier columns and glacier columns outside icesheet regions -is converted to liquid, with an appropriate sensible heat flux. -That is, the atmosphere (rather than the ocean) melts the ice. -(Exception: ice runoff generated to ensure conservation with dynamic landunits remains as ice.) - - - - - - - -First year to loop over for Nitrogen Deposition data - - - -Last year to loop over for Nitrogen Deposition data - - - -Simulation year that aligns with stream_year_first_ndep value - - - -Filename of input stream data for Nitrogen Deposition - - - -Time interpolation mode to determine how to handle data before and after the times in the file - cycle = Always cycle over the data - extend = Use the first time before the available data, and use the last time after the available data - limit = Only use the data within the times available -- abort if the model tries to go outside it - - - -Colon delimited list of variables to read from the streams file for nitrogen deposition -(Normally just read the single variable NDEP_year or NDEP_month) - - - -Mapping method from Nitrogen deposition input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - - - - - -Filename of input stream data for finundated inversion of observed (from Prigent dataset) -to hydrologic variables (either TWS or ZWT) - - - - - - - - -Toggle to turn on use of LAI streams in place of the LAI on the surface dataset when using Satellite Phenology mode. -(EXPERIMENTAL and NOT tested) - - - -First year to loop over for LAI data - - - -Last year to loop over for LAI data - - - -Simulation year that aligns with stream_year_first_lai value - - - -Filename of input stream data for LAI - - - -Mapping method from LAI input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - - - - - - -First year to loop over for Lightning data - - - -Last year to loop over for Lightning data - - - -Simulation year that aligns with stream_year_first_lightng value - - - -Filename of input stream data for Lightning - - - -Mapping method from Lightning input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - - - - - - - -First year to loop over for human population density data - - - -Last year to loop over for human population density data - - - -Simulation year that aligns with stream_year_first_popdens value - - - -Filename of input stream data for human population density - - - -Mapping method from human population density input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - - - - - - - -First year to loop over for urban time varying data - - - -Last year to loop over for urban time varying data - - - -Simulation year that aligns with stream_year_first_urbantv value - - - -Filename of input stream data for urban time varying - - - -Mapping method from urban time varying input file to the model resolution - bilinear = bilinear interpolation - nn = nearest neighbor - nnoni = nearest neighbor on the "i" (longitude) axis - nnonj = nearest neighbor on the "j" (latitude) axis - spval = set to special value - copy = copy using the same indices - - - -datm input directory - - -datm output directory - - -Datm logfile name - - - - - - - -Mapping file to go from one resolution/land-mask to another resolution/land-mask - - - -Land mask description for mksurfdata input files - - - -Horizontal grid resolutions for mksurfdata input files - - - - - - - - -Resolution of finundated inversion streams dataset (stream_fldfilename_ch4finundated) -to use for methane model -(only applies when CN and methane model are turned on) - - - -Resolution of Lightning dataset to use for CN fire model -(only applies when CN and the CN fire model are turned on) - - - -Check that the resolution and land-mask is valid before continuing. - - - -Add a note to the output namelist about the options given to build-namelist - - - -CLM run type. - 'default' use the default type of clm_start type for this configuration - 'cold' is a run from arbitrary initial conditions - 'arb_ic' is a run using initial conditions if provided, OR arbitrary initial conditions if no files can be found - 'startup' is an initial run with initial conditions provided. - 'continue' is a restart run. - 'branch' is a restart run in which properties of the output history files may be changed. - - - -Horizontal resolutions -Note: 0.1x0.1, 0.25x0.25, 0.5x0.5, 5x5min, 10x10min, 3x3min and 0.33x0.33 are only used for CLM tools - - - -Representative concentration pathway for future scenarios [radiative forcing at peak or 2100 in W/m^2] --999.9 means do NOT use a future scenario, just use historical data. - - - -Land mask description - - - -General configuration of model version and atmospheric forcing to tune the model to run under. -This sets the model to run with constants and initial conditions that were set to run well under -the configuration of model version and atmospheric forcing. To run well constants would need to be changed -to run with a different type of atmospheric forcing. - - - -If 1, turn on the MEGAN model for BVOC's (Biogenic Volitile Organic Compounds) - - - -Year to simulate and to provide datasets for (such as surface datasets, initial conditions, aerosol-deposition, Nitrogen deposition rates etc.) -A sim_year of 1000 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year greater than 2005 corresponds to rcp scenario data -Most years are only used for clm_tools and there aren't CLM datasets that correspond to them. -CLM datasets exist for years: 1000 (for testing), 1850, and 2000 - - - -Range of years to simulate transitory datasets for (such as dynamic: land-use datasets, aerosol-deposition, Nitrogen deposition rates etc.) -Constant means simulation will be held at a constant year given in sim_year. -A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing only, NOT corresponding to any real datasets. -A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 and then scenario data beyond that point. - - - -Namelist entries to demand be provided on the namelist. - - - -Description of the use case selected. - - - -Attributes to use when looking for an initial condition file (finidat) if interpolation is turned on (use_init_interp is .true.) - - - -How close in years to use when looking for an initial condition file (finidat) if interpolation is turned on (use_init_interp is .true.) - - - -Simulation years you can look for in initial condition files (finidat) if interpolation is turned on (use_init_interp is .true.) - - - -Command line argument for setting up your simulation in a mode for faster -throughput. By default turns off some options, and sets up for a lower level -of output. When bgc_mode is some level of prognostic BGC (so NOT Satellite Phenology) -it also sets up for accelerated decomposition. -NOTE: THIS CORRESPONDS DIRECTLY TO THE env_run.xml VARIABLE OF THE SAME NAME. - Set the env_run variable, rather than setting this directly. - - - -Command line arguement for biogeochemistry mode for CLM4.5 - sp = Satellitte Phenology - cn = Carbon Nitrogen model - bgc = CLM4.5 BGC model with: - CENTURY model pools - Nitrification/De-nitrification - Methane model - Vertically resolved Carbon - fates = FATES/ED ecosystem demography model with below ground BGC: - - - - - - - -Flag for overriding the crash that should occur if user tries to start the model from a restart file made with a different version of the soil decomposition structure than is currently being used. - - - -Flag for setting the state of the Accelerated decomposition spinup state for the BGC model. - 0 = normal model behavior; - 1 = AD spinup (standard) - 2 = AD spinup (accelerated spinup from Ricciuto, doesn't work for CNDV and not implemented for CN soil decomposition) -Entering and exiting spinup mode occurs automatically by comparing the namelist and restart file values for this variable. -NOTE: THIS CAN ONLY BE SET TO NON-ZERO WHEN BGC_MODE IS NOT SATELITE PHENOLOGY! - - - - -Base advective flux (downwards) for SOM. - - - -Maximum depth to mix soils to by croturbation, in permafrost soils. - - - - -E-folding depth over which decomposition is slowed with depth in all soils. - - - -If TRUE, reduce heterotrophic respiration according to available oxygen predicted by CH4 submodel. - - - -If TRUE, weight calculation of oxygen limitation by the inundated fraction and diagnostic saturated column gas -concentration profile calculated in the CH4 submodel. Only applies if anoxia = TRUE. -(EXPERIMENTAL AND NOT FUNCTIONAL!) -(deprecated -- will be removed) - - - -separate q10 for frozen soil respiration rates. default to same as above zero rates - - - - - -If TRUE, add extra diagnostics for methane model to the history files - - - -Profile over which to distribute C and N coming from surface pools (leaves, stem, grain). - - - - -If true, no denitrification or nitrification in frozen soil layers. -(EXPERIMENTAL and NOT tested) - - - -Number of days over which to use exponential relaxation of NPP in N fixation calculation - - - - -Flag to reseed any dead plants on startup from reading the initial conditions file - - - - -Enable C13 model - - - -Enable C14 model - - - -Flag to use the atmospheric time series of C14 concentrations from bomb fallout and Seuss effect, rather than natural abundance C14 (nominally set as 10^-12 mol C14 / mol C) - - - -Filename with time series of atmospheric Delta C14 data. variables in file are "time" and "Delta14co2_in_air". time variable is in format: years since 1850-01-01 0:0:0.0 units are permil. - - - -Flag to use the atmospheric time series of C13 concentrations from natural abundance and the Seuss Effect, rather than static values. - - - -Filename with time series of atmospheric Delta C13 data, which use CMIP6 format. variables in file are "time" and "delta13co2_in_air". time variable is in format: years since 1850-01-01 0:0:0.0. units are permil. - - - - - - -If TRUE, weight btran (vegetation soil moisture availability) by unfrozen layers only, assuming that vegetation -will allocate roots preferentially to the active layer. -(EXPERIMENTAL and NOT tested) - - - -If TRUE, weight btran (vegetation soil moisture availability) by the active layer, as defined by the greatest thaw depth over the current and prior years. -(EXPERIMENTAL and NOT tested) - - - - -If TRUE use additional stress deciduous onset trigger - - - -Apply the guardrail for leaf-Nitrogen that ensures it doesn't go negative or too small - - - - - - - -Allow the CN ratio to flexibly change with the simulation, rather than being fixed - - - - Michaelis Menten nitrogen uptake kinetics - - - -How much Carbon to initialize vegetation pools (leafc/frootc and storage) to when -- Michaelis Menten nitrogen uptake kinetics is on - - - - GPP downregulation for use_flexibleCN option -(EXPERIMENTAL and NOT tested) - - - - Plant nitrogen demand for use_flexibleCN option -(EXPERIMENTAL and NOT tested) - - - - Michaelis Menten substrate limitation for use_flexibleCN option -(EXPERIMENTAL and NOT tested) - - - - Michaelis Menten nitrogen limitation for use_flexibleCN option -(EXPERIMENTAL and NOT tested) - - - - Michaelis Menten temperature limitation for use_flexibleCN option -(EXPERIMENTAL and NOT tested) - - - - Flexible CN ratio used for Phenology -(EXPERIMENTAL and NOT tested) - - - - Reduce day length factor -(NOT implemented) - - - -Vcmax calculation for Photosynthesis - vcmax_opt = 4 As for vcmax_opt=0, but using leafN, and exponential if tree (EXPERIMENTAL NOT TESTED!) - vcmax_opt = 3 Based on leafN and VCAD (used with Luna for crop and C4 vegetation) - vcmax_opt = 0 Based on canopy top and foilage Nitrogen limitation factor from params file (clm4.5) - - - -Residual option for flexible-CN -(EXPERIMENTAL and NOT tested) - - - -Partition option for flexible-CN - CN_partition_opt = 1 -(EXPERIMENTAL and NOT tested) - - - -Evergreen phenology option for CNPhenology -(EXPERIMENTAL and NOT tested) - - - -Carbon respiration option to burn off carbon when CN ratio is too high (do NOT use when FUN is on) -(EXPERIMENTAL and NOT tested) - - - - - - - - -Minimum lake depth to increase non-molecular thermal diffusivities by the factor deepmixing_mixfact. - - - -Factor to increase non-molecular thermal diffusivities for lakes deeper than deepmixing_depthcrit -to account for unresolved 3D processes. -Set to 1 to - - - -Visible and Near-infrared albedo values for melting lakes. Albedo will relax to these values as temperature -reaches melting when ice is present with no snow layers. Represents puddling, ice disintegration, and white ice. -Set to alblak values (0.6, 0.4) to keep albedo constant for ice-covered lakes without snow layers. - - - - - - - -Use old snow cover fraction from Niu et al. 2007 -(deprecated -- will be removed) - - - -If surface water is active or not -(deprecated -- will be removed) - - - -Use original CLM4 soil hydraulic properties -(deprecated -- will be removed) - - - - - - - -Allows user to tune the value of aereoxid. If set to FALSE, then use the value of aereoxid from -the parameter file (set to 0.0, but may be tuned with values in the range {0.0,1.0}. If set to TRUE, -then don't fix aere (see ch4Mod.F90). -Default: .true. - - - -If TRUE, turn on methane biogeochemistry model for lake columns, using a simplified version of the CH4 submodel. -(EXPERIMENTAL) - - - -If TRUE, apply a limitation to methane production based on the soil pH dataset. - - - -Michaelis-Mentin maximum methane oxidation rate (mol/m^3-water/s), in the unsaturated zone. - - - -If TRUE, maintain constant soil carbon under lakes, and use the methane submodel simply to predict the net conversion of -CO2 (via biological assimilation, decomposition, and methanogenesis) to CH4. If FALSE, transiently decompose initial -soil carbon stock based on soil carbon dataset. NOTE: if FALSE, a new transient source of C is added to the climate system, -so the coupled system will NOT conserve carbon in this mode if the methane model is coupled to the atmosphere. -(EXPERIMENTAL and NOT tested) - - - -Inundated fraction method type to use for the CH4 submodel (possibly affecting soil -heterotrophic respiration and denitrification depending on the configuration), - -h2osfc ----------- Use prognostic saturated fraction h2osfc value calculated in Soil Hydrology -ZWT_inversion ---- Use inversion of Prigent Satellite data to model ZWT -TWS_inversion ---- Use inversion of Prigent Satellite data to model TWS - -Inversion options require additional data on fsurdat or use of stream_fldfilename_ch4finundated files. -(h2osfc option is EXPERIMENTAL and NOT tested) - - - -If TRUE, use the fine root carbon predicted by CN when calculating the aerenchyma area, rather than the parametrization -based on annual NPP, aboveground NPP fraction, and LAI. -(EXPERIMENTAL and NOT tested) - - - -If TRUE, run the methane submodel decoupled from the atmosphere. The atmospheric methane concentration is prescribed by -atmch4, the methane flux is not passed to the atmosphere, and the CO2 flux to the atmosphere is not adjusted for -net methane production. NOTE: Currently this must be TRUE. -(EXPERIMENTAL and NOT functional) - - - - - - - -Full pathname of time varying landuse data file. This causes the land-use types of -the initial surface dataset to vary over time. - - - -If TRUE, apply transient natural PFTs from flanduse_timeseries file. -(Only valid for transient runs, where there is a flanduse_timeseries file.) - - - -If TRUE, apply transient crops from flanduse_timeseries file. -(Only valid for transient runs, where there is a flanduse_timeseries file.) -(Also, only valid for use_crop = true.) - - - -If TRUE, apply harvest from flanduse_timeseries file. -(Only valid for transient runs, where there is a flanduse_timeseries file.) -(Also, only valid for use_cn = true.) - - - -If TRUE, allow area changes at times other than the year boundary. This should -only arise in some test configurations where we artifically create changes more -frequently so that we can run short tests. This flag is only used for -error-checking, not controlling any model behavior. Do not set this in a -production (non-test) run unless you know what you're doing! - - - -If TRUE, set the dynbal water and energy fluxes to zero. This should typically -only be done for testing: This is needed in some tests where we have daily -rather than annual glacier dynamics: if we allow the true dynbal adjustment -fluxes in those tests, we end up with sensible heat fluxes of thousands of W m-2 -or more, which causes CAM to blow up. However, note that setting it to true will -break water and energy conservation! - - - - - - - -If TRUE (which is the default), check consistency between year on the finidat file -and the current model year. This check is only done for a transient run. - - - -If TRUE (which is the default), check consistency between pct_pft on the finidat file -and pct_pft read from the surface dataset. This check is only done for a NON-transient run. - - - - - - - -If TRUE (which is the default), check consistency between pct_nat_pft on the flanduse_timeseries file -and pct_nat_pft read from the surface dataset. - - - - - - - -Number of snow layers. -Values less than 5 are mainly useful for testing, and should not be used for science. - - - -Maximum snow depth in mm H2O equivalent. Additional mass gains will be capped when this depth -is exceeded. -Changes in this value should possibly be accompanied by changes in: -- nlevsno: larger values of h2osno_max should be accompanied by increases in nlevsno -- glc_snow_persistence_max_days: large values of h2osno_max should generally have - glc_snow_persistence_max_days = 0; small values of h2osno_max should generally have - glc_snow_persistence_max_days > 0. - - - -Limit applied to integrated snowfall when determining changes in snow-covered fraction during melt -(mm H2O) - - - -SCA shape parameter for glc_mec (glacier multiple elevation class) columns -For most columns, n_melt is based on the standard deviation of 1km topography in the grid cell; -but glc_mec columns already account for subgrid topographic variability through their use of -multiple elevation classes; thus, to avoid double-accounting for topographic variability -in these columns, we use a fixed value of n_melt. - - - -If TRUE, the density of new snow depends on wind speed, and there is also -wind-dependent snow compaction. - - - -Method used to compute snow overburden compaction -Anderson1976 -- older method, default in CLM45 -Vionnet2012 --- newer method, default in CLM50 - - - -Snow density method to use for low temperatures (below -15C) -TruncatedAnderson1976 -- Truncate the Anderson-1976 equation at the value for -15C -Slater2017 ------------- Use equation from Slater that increases snow density for very cold temperatures (Arctic, Antarctic) - - - -Upper Limit on Destructive Metamorphism Compaction [kg/m3] - - - -Snow compaction overburden exponential factor (1/K) -Not used for snow_overburden_compaction_method=Vionnet2012 - - - -Minimum wind speed tht results in compaction (m/s) - - - -maximum warm (at freezing) fresh snow effective radius [microns] - - - -If set to .true., then reset the snow pack over non-glacier columns to a small value. -This is useful when transitioning from a spinup under one set of atmospheric forcings -to a run under a different set of atmospheric forcings: By resetting too-large snow packs, -we make it more likely that points will remain only seasonally snow-covered under the new -atmospheric forcings. (This is particularly true in a coupled run, where starting with a -too-large snow pack can cool the atmosphere, thus maintaining the too-large snow pack.) - -WARNING: Setting this to .true. will break water conservation for approximately the first -day of the new run. This is by design: The excess snow is completely removed from the system. - - - -If set to .true., then reset the snow pack over glacier columns to a small value. -This is useful when transitioning from a spinup under one set of atmospheric forcings -to a run under a different set of atmospheric forcings: By resetting too-large snow packs, -we make it more likely that points will remain only seasonally snow-covered under the new -atmospheric forcings. (This is particularly true in a coupled run, where starting with a -too-large snow pack can cool the atmosphere, thus maintaining the too-large snow pack.) - -See also reset_snow_glc_ela, which controls the elevation below which -glacier columns are reset. - -WARNING: Setting this to .true. will break water conservation for approximately the first -day of the new run. This is by design: The excess snow is completely removed from the system. - -WARNING: This variable is intended for short test runs, and generally -should not be used for scientific production runs. By resetting snow -below a given elevation, you risk forcing the system to evolve -differently in areas below and above reset_snow_glc_ela. - - - -Only relevant if reset_snow_glc is .true. - -When resetting snow pack over glacier columns, one can choose to do this over all glacier -columns, or only those below a certain elevation. A typical use case is to reset only those -columns that have a seasonal snow pack in the real world, i.e. SMB less than 0, also known as -the equilibrium line altitude (ELA). This parameter sets a single global ELA value. By -setting this parameter to a large value (i.e. 10000 m), all glacier columns will be reset. - -WARNING: This variable is intended for short test runs, and generally -should not be used for scientific production runs. By resetting snow -below a given elevation, you risk forcing the system to evolve -differently in areas below and above reset_snow_glc_ela. - - - - - - - - -If FALSE (which is the default): If an output type cannot be found in the input for initInterp, -code aborts -If TRUE: If an output type cannot be found in the input, fill with closest natural veg column -(using bare soil for patch-level variables) - -NOTE: Natural vegetation and crop landunits always behave as if this were true. e.g., if -we can't find a column with the same type as a given crop column in the output, then we -always fill with the closest natural veg patch / column, regardless of the value of this -flag. So interpolation from non-crop to crop cases can be done without setting this flag. - - - -Method to use for init_interp. Only applies when use_init_interp = .true. - -'general': The general-purpose method that can be used when changing -grids, configurations, etc. This starts off with subgrid areas taken -from the surface dataset. - -'use_finidat_areas': This starts off with subgrid areas taken from the -input finidat file. This is needed to achieve bit-for-bit results in a -coupled case (where areas in initialization impact initial fields sent -to the atmosphere) (but using the 'general' method will typically have -only a very minor impact on results in this case). For this method to -work, the input finidat file needs to be at the same resolution as the -current configuration. So this is a less general form of -init_interp. However, it can be used in cases where the only difference -is in internal memory allocation. In order to catch possible problems, -this uses a different algorithm for finding the input point for each -output point, which ensures that each active output point is associated -with exactly one input point with the same latitude, longitude and -type. This method requires (a) the same grid for input and output, -within roundoff; (b) any non-zero-weight point in the input must have -memory allocated for it in this grid cell in the output (this will be -satisfied if the point is non-zero-weight on the surface dataset or if -it's a point for which we allocate memory even for zero-weight points); -(c) any active point in the output (based on the surface dataset and -rules for determining active points) must have a matching point in this -grid cell in the input. (Note that this generally can NOT be used when -transitioning from a spinup run to a transient run, because spinup runs -typically have irrigation off and transient runs have irrigation on, and -the presence/absence of irrigation affects the subgrid structure; if it -weren't for that difference, then this option would be useful for this -use case.) - - - - diff --git a/bld/namelist_files/namelist_definition_drv.xml b/bld/namelist_files/namelist_definition_drv.xml deleted file mode 100644 index 493f2f2a01..0000000000 --- a/bld/namelist_files/namelist_definition_drv.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - 1.0 - - - - - - - - - diff --git a/bld/namelist_files/namelist_definition_drv_flds.xml b/bld/namelist_files/namelist_definition_drv_flds.xml deleted file mode 100644 index b54082981a..0000000000 --- a/bld/namelist_files/namelist_definition_drv_flds.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - List of files to merge together that contains drv_flds_in namelists - The paths are relative to the case directory. drv_flds_in include the namelists that - the driver reads and gives information on additional fields to be passed to different - components that need to look at the same data. - - - - - - - - File containing MEGAN emissions factors. Includes the list of MEGAN compounds that can be - used in the Comp_Name variable on the file. - - - - MEGAN specifier. This is in the form of: Chem-compound = megan_compound(s) - where megan_compound(s) can be the sum of megan compounds with a "+" between them. - In each equation, the item to the left of the equal sign is a CAM chemistry compound, the - items to the right are compounds known to the MEGAN model (single or combinations). - For example: megan_specifier = 'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a' - - - - MEGAN mapped isoprene emissions factors switch - If TRUE then use mapped MEGAN emissions factors for isoprene. - - - - List of possible MEGAN compounds to use - (the list used by the simulation is on the megan_factors_file as the Comp_Name) - - - - - - - - Where dry deposition is calculated (from land, atmosphere, or from a table) - This specifies the method used to calculate dry - deposition velocities of gas-phase chemical species. The available methods - are: - 'table' - prescribed method in CAM - 'xactive_atm' - interactive method in CAM - 'xactive_lnd' - interactive method in CLM - - - - List of species that undergo dry deposition. - - - - - - - - - File containing fire emissions factors. - Default: none - - - - Fire emissions specifier. - Default: none - - - - If ture fire emissions are input into atmosphere as elevated forcings. - Otherwise they are treated as surface emissions. - Default: TRUE - - - - - - - - List of fluxes needed by the CARMA model, from CLM to CAM. - - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml deleted file mode 100644 index ce2a23e26d..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP2.6 scenario from IMAGE - - -1850 - -1850-2100 - -2.6 - -flanduse_timeseries - -.true. -.false. -.false. - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml deleted file mode 100644 index 6bc4d67d1d..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - - -1850 - -1850-2100 - -4.5 - -flanduse_timeseries - -arb_ic - -.true. -.false. -.false. - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml deleted file mode 100644 index 73d5f5334f..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP6 scenario from AIM - - -1850 - -1850-2100 - -6 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml b/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml deleted file mode 100644 index 4d854cad2c..0000000000 --- a/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -1850 - -1850-2100 - -8.5 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -1850 -2100 -1850 - -1850 -2100 -1850 - -1850 -2100 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2010 -1850 - -1850 -2010 -1850 - -1850 -2100 -1850 - - diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml deleted file mode 100644 index 18c5959c78..0000000000 --- a/bld/namelist_files/use_cases/1850_control.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - -Conditions to simulate 1850 land-use - -1850 - -constant - -.false. -.false. - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -cycle - -NDEP_month - - diff --git a/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml b/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml deleted file mode 100644 index e2bd97460c..0000000000 --- a/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - -Simulate transient land-use, aerosol and Nitrogen deposition changes with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - - -20050101 - -1850 - -2000-2100 - -8.5 - -.true. -.false. -.false. - -flanduse_timeseries - -arb_ic - -2000 -2100 -2000 - -2000 -2015 -2000 - -2000 -2100 -2000 -extend - -2000 -2015 -2000 -extend - -2000 -2010 -2000 - -2000 -2010 -2000 - -2000 -2100 -2000 - - diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml deleted file mode 100644 index ca7c1ac5cd..0000000000 --- a/bld/namelist_files/use_cases/2000_control.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - -Conditions to simulate 2000 land-use - -2000 - -constant - -.true. -.false. -.false. - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - - diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml deleted file mode 100644 index e8970b59bf..0000000000 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - -Simulate transient land-use, and aerosol deposition changes from 1850 to 2015 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 -Simulate transient land-use, aerosol deposition, and Nitrogen deposition changes from 1850 to 2015 - -1850 - -1850-2000 - -arb_ic - -flanduse_timeseries - -.true. -.false. -.false. - -1850 -2005 -1850 - -1850 -2005 -1850 - -1850 -2005 -1850 -extend - -1850 -2015 -1850 -extend - -1850 -2016 -1850 - -1850 -2016 -1850 - -1850 -2106 -1850 - - diff --git a/bld/namelist_files/use_cases/README b/bld/namelist_files/use_cases/README deleted file mode 100644 index 40b992332b..0000000000 --- a/bld/namelist_files/use_cases/README +++ /dev/null @@ -1,39 +0,0 @@ -$CTSMROOT/namelist_files/use_cases/README Jun/08/2018 - -Naming Convention for CLM use-cases - -It's important that this naming convention be followed so that the PTCLMmkdata.py -utility can parse the use-cases appropriately. The build-namelist script also -checks for conformance with these conventions and won't work for names that -don't follow the convention. - -Ending suffix requires one of these endings: _transient, _control or _pd - -Transient cases: - - yyyy-yyyy_$rcp$desc_transient (for example 1850-2100_rcp8.5_transient) - - or - - 20thC$desc_transient (means nominal 1850-2000 although some datasets are 1850-2005) - -Control cases: - - yyyy$desc_control - - -Present day options (uses default present-day simulation year -- which right now is 2000): - - $desc_pd - -Where - -yyyy = Simulation year (such as 1850 or 2000). -yyyy-yyyy = Range of simulation years to run over (i.e.. 1850-2000). -$rcp = Representative concentration pathway (rcp) description string - for future scenarios: - rcp#.# (for example: rcp8.5, rcp6, rcp4.5, rcp2.6) - [can be blank for historical cases]. -$desc = Description of anything else -- alpha-numeric. - Should start with an underscore ("_") if not by itself - (for _transient and _control). diff --git a/bld/namelist_files/use_cases/stdurbpt_pd.xml b/bld/namelist_files/use_cases/stdurbpt_pd.xml deleted file mode 100644 index 9114742e66..0000000000 --- a/bld/namelist_files/use_cases/stdurbpt_pd.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - -Standard Urban Point Namelist Settings - -.true. - -.true., .false., .true. - -'TBUILD','BUILDHEAT','TRAFFICFLUX','WASTEHEAT','SWup','LWup','Rnet','Qh','Qle','Qstor','Qtau','Qanth','Wind','Qair','Tair','PSurf','Rainf','SWdown','LWdown','COSZEN' - -'TG','TBOT','FIRE','FIRA','FLDS','FSDS','FSR','FSA','FGEV','FSH','FGR','TSOI','ERRSOI','BUILDHEAT','SABV','SABG','FSDSVD','FSDSND','FSDSVI','FSDSNI','FSRVD','FSRND','FSRVI','FSRNI','TSA','FCTR','FCEV','QBOT','Q2M','H2OSOI','H2OSNO','SOILLIQ','SOILICE','SWup','LWup','Rnet','Qh','Qle','Qstor','Qtau','Qanth','Wind','Qair','Tair','PSurf','Rainf','SWdown','LWdown','SoilAlpha_U','ZWT','WA' - - -'SWup','LWup','Rnet','Qh','Qle','Qstor','Qtau','Qanth','Wind','Qair','Tair','PSurf','Rainf','SWdown','LWdown','FSA','FIRA','TG','COSZEN','SoilAlpha_U','TBUILD','BUILDHEAT' - - -'OFF' - -.true. -.false. -.false. - - diff --git a/bld/queryDefaultNamelist.pl b/bld/queryDefaultNamelist.pl deleted file mode 100755 index 8c555d1f6d..0000000000 --- a/bld/queryDefaultNamelist.pl +++ /dev/null @@ -1,319 +0,0 @@ -#!/usr/bin/env perl -#======================================================================= -# -# This is a script to read the CLM namelist XML file -# -# Usage: -# -# queryDefaultNamelist.pl [options] -# -# To get help on options and usage: -# -# queryDefaultNamelist.pl -help -# -#======================================================================= - -use Cwd; -use strict; -#use diagnostics; -use Getopt::Long; -use English; - -#----------------------------------------------------------------------------------------------- - -#Figure out where configure directory is and where can use the XML/Lite module from -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program -my $ProgDir = $1; # name of directory where program lives - -my $cwd = getcwd(); # current working directory -my $cfgdir; - -if ($ProgDir) { $cfgdir = $ProgDir; } -else { $cfgdir = $cwd; } - -#----------------------------------------------------------------------------------------------- -# Add $cfgdir to the list of paths that Perl searches for modules -my @dirs = ( "$cfgdir", - "$cfgdir/../cime/utils/perl5lib", - "$cfgdir/../../../cime/utils/perl5lib" ); -unshift @INC, @dirs; -my $result = eval "require XML::Lite"; -if ( ! defined($result) ) { - die <<"EOF"; -** Cannot find perl module \"XML/Lite.pm\" from directories: @dirs ** -EOF -} -require Build::Config; -require Build::NamelistDefinition; -require queryDefaultXML; - -# Defaults -my $namelist = "clm_inparm"; -my $config = "config_cache.xml"; - - -sub usage { - die < $namelist, - model => "clm4_5", - var => undef, - hgrid => undef, - config => undef, - cesm => undef, - csmdata => undef, - demand => undef, - test => undef, - onlyfiles => undef, - fileonly => undef, - silent => undef, - usrname => undef, - help => undef, - options => undef, - ); - - my $cmdline = "@ARGV"; - GetOptions( - "f|file=s" => \$opts{'file'}, - "n|namelist=s" => \$opts{'namelist'}, - "v|var=s" => \$opts{'var'}, - "p|phys=s" => \$opts{'model'}, - "r|res=s" => \$opts{'hgrid'}, - "config=s" => \$opts{'config'}, - "cesm" => \$opts{'cesm'}, - "csmdata=s" => \$opts{'csmdata'}, - "demand" => \$opts{'demand'}, - "options=s" => \$opts{'options'}, - "t|test" => \$opts{'test'}, - "onlyfiles" => \$opts{'onlyfiles'}, - "filenameonly" => \$opts{'fileonly'}, - "justvalues" => \$opts{'justvalues'}, - "usrname=s" => \$opts{'usrname'}, - "s|silent" => \$opts{'silent'}, - "h|elp" => \$opts{'help'}, - ) or usage(); - - # Check for unparsed arguments - if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); - } - if ( $opts{'help'} ) { - usage(); - } - # Set if should do extra printing or not (if silent mode is not set) - my $printing = 1; - if ( defined($opts{'silent'}) ) { - $printing = 0; - } - # Get list of options from command-line into the settings hash - my %settings; - if ( defined($opts{'options'}) ) { - $opts{'options'} =~ s/\s//g; # Remove all white-space in options - my @optionlist = split( ",", $opts{'options'} ); - foreach my $item ( @optionlist ) { - my ($key,$value) = split( "=", $item ); - $settings{$key} = $value; - } - } - my $csmdata = ""; - if ( defined($opts{'fileonly'}) ) { - if ( ! defined($opts{'justvalues'}) ) { print "When -filenameonly option used, -justvalues is set as well\n" if $printing; } - if ( ! defined($opts{'onlyfiles'}) ) { print "When -filenameonly option used, -onlyfiles is set as well\n" if $printing; } - $opts{'justvalues'} = 1; - $opts{'onlyfiles'} = 1; - } - # List of input options - my %inputopts; - # This namelist files under the cime directories are in version 2 format and can't be read by perl code EBK 11/15/2016 - my $model = $opts{'model'}; - my @nl_definition_files = ("$cfgdir/namelist_files/namelist_definition_drv.xml", - "$cfgdir/namelist_files/namelist_definition_$model.xml" - ); - $inputopts{empty_cfg_file} = "$cfgdir/config_files/config_definition_$model.xml"; - $inputopts{nldef_files} = \@nl_definition_files; - $inputopts{namelist} = $opts{namelist}; - $inputopts{printing} = $printing; - $inputopts{cfgdir} = $cfgdir; - $inputopts{ProgName} = $ProgName; - $inputopts{cmdline} = $cmdline; - - my $exitearly = 0; - my $definition = Build::NamelistDefinition->new( $nl_definition_files[0] ); - foreach my $nl_defin_file ( @nl_definition_files ) { - if ( ! -f "$nl_defin_file" ) { - die "($ProgName $cmdline) ERROR:: bad namelist definition filename: $nl_defin_file.\n"; - } - $definition->add( "$nl_defin_file" ); - } - - if ( ! defined($opts{csmdata}) ) { - $inputopts{csmdata} = "default"; - } else { - $inputopts{csmdata} = $opts{csmdata}; - } - if ( defined($opts{cesm}) ) { - $inputopts{csmdata} = '$DIN_LOC_ROOT'; - } - if ( ! defined($opts{config}) ) { - $inputopts{config} = "noconfig"; - } else { - $inputopts{config} = $opts{config}; - } - if ( ! defined($opts{var}) ) { - $settings{'var'} = undef; - } elsif ( $opts{var} eq "list" ) { - print "Valid variables: " if $printing; - my @vars = $definition->get_var_names( ); - print "@vars\n"; - $exitearly = 1; - } else { - $settings{'var'} = $opts{'var'}; - } - if ( ! defined($opts{hgrid}) ) { - $inputopts{hgrid} = "any"; - } elsif ( $opts{hgrid} eq "list" ) { - print "Valid resolutions: " if $printing; - my @hgrids = $definition->get_valid_values( "res", 'noquotes'=>1 ); - print "@hgrids\n"; - $exitearly = 1; - } else { - if ( ! $definition->is_valid_value( "res", $opts{hgrid}, 'noquotes'=>1 ) ) { - if ( $opts{'hgrid'} ne $opts{'usrname'} ) { - die "($ProgName $cmdline) ERROR:: invalid resolution entered.\n"; - } - } - $inputopts{hgrid} = $opts{hgrid}; - } - # The namelist defaults file contains default values for all required namelist variables. - my @nl_defaults_files = ( "$cfgdir/namelist_files/namelist_defaults_overall.xml" ); - if ( defined($opts{'usrname'}) ) { - my $nl_defaults_file = "$cfgdir/namelist_files/namelist_defaults_usr_files.xml"; - push( @nl_defaults_files, $nl_defaults_file ); - $settings{'clm_usr_name'} = $opts{'usrname'}; - $settings{'notest'} = ! $opts{'test'}; - $settings{'csmdata'} = $inputopts{csmdata}; - } else { - my @files = ( "$cfgdir/namelist_files/namelist_defaults_${model}.xml", - "$cfgdir/namelist_files/namelist_defaults_${model}_tools.xml", - "$cfgdir/namelist_files/namelist_defaults_drv.xml", - "$cfgdir/namelist_files/namelist_defaults_drydep.xml", - ); - push( @nl_defaults_files, @files ); - } - if ( ! $exitearly ) { - $inputopts{files} = \@nl_defaults_files; - - my $defaults_ref = &queryDefaultXML::ReadDefaultXMLFile( \%inputopts, \%settings ); - my %defaults = %$defaults_ref; - my @keys = keys(%defaults); - if ( defined($opts{'demand'}) && ($#keys == -1) ) { - die "($ProgName $cmdline) ERROR:: demand option is set and nothing was found.\n"; - } - my $print; - foreach my $var ( @keys ) { - $print = 1; - my $value = $defaults{$var}{value}; - my $isadir = $defaults{$var}{isdir}; - my $isafile = $defaults{$var}{isfile}; - my $isastr = $defaults{$var}{isstr}; - # If onlyfiles option set do NOT print if is NOT a file - if ( defined($opts{'onlyfiles'}) && (! $isafile) ) { - $print = undef; - } - # If is a directory - if ( $isadir ) { - # Test that this directory exists - if ( defined($opts{'test'}) && defined($print) ) { - print "Test that directory $value exists\n" if $printing; - if ( ! -d "$value" ) { - die "($ProgName) ERROR:: directory $value does NOT exist!\n"; - } - } - } - # If is a file - if ( $isafile ) { - # Test that this file exists - if ( defined($opts{'test'}) && defined($print) ) { - chomp( $value ); - print "Test that file $value exists\n" if $printing; - if ( ! -f "$value" ) { - die "($ProgName) ERROR:: file $value does NOT exist!\n"; - } - } - } - # If a string - if ( (! defined($opts{'justvalues'}) ) && ($isastr) ) { - $value = "\'$value\'"; - } - # if you just want the filename -- not the full path with the directory - if ( defined($opts{'fileonly'}) ) { - $value =~ s!(.*)/!!; - } - if ( defined($print) ) { - if ( ! defined($opts{'justvalues'}) ) { - print "$var = "; - } - print "$value\n"; - } - } - } - if ( $printing && defined($opts{'test'}) ) { - print "\n\nTesting was successful\n\n" - } - diff --git a/bld/queryDefaultXML.pm b/bld/queryDefaultXML.pm deleted file mode 100644 index 85a81d8f9a..0000000000 --- a/bld/queryDefaultXML.pm +++ /dev/null @@ -1,161 +0,0 @@ -#======================================================================= -# -# This is a perl module to read in a list of namelist_default files. -# -#======================================================================= -use strict; -use Build::Config; -use Build::NamelistDefinition; -use Build::NamelistDefaults; -use Build::Namelist; - -package queryDefaultXML; - -#------------------------------------------------------------------------------- - -sub read_cfg_file -# -# Read in the configuration cache XML file on the build-time configuration -# -{ - my ($file, $empty_cfg_file, $printing, $settings_ref) = @_; - - my $cfg; - my %config; - if ( $file eq "noconfig" ) { - print "No configuration cache file to read in.\n" if $printing; - $cfg = Build::Config->new( $empty_cfg_file ); - } elsif ( -f "$file" ) { - $cfg = Build::Config->new($file); - } else { - die "Bad filename entered: $file does NOT exist or can not open it.\n"; - } - # - # Make sure variables are set to valid values - # - foreach my $key ( keys( %config ) ) { - if ( $cfg->is_valid_name( $key ) ) { - $cfg->set( $key, $config{$key} ); - } - } - foreach my $key ( $cfg->get_names( ) ) { - if ( defined($$settings_ref{$key}) ) { - if ( $cfg->is_valid_name( $key ) ) { - $cfg->set( $key, $$settings_ref{$key} ); - } - } - } - return( $cfg ); -} - -#------------------------------------------------------------------------------- - -sub ReadDefaultXMLFile { -# -# Read in the default XML file for the default namelist settings -# - my $opts_ref = shift; - my $settings_ref = shift; - - # Error check that input and opts hash has the expected variables - my $ProgName = $$opts_ref{'ProgName'}; - my $nm = "${ProgName}::ReadDefaultXMLFile"; - my @required_list = ( "files", "nldef_files", "empty_cfg_file", "config", "namelist", - "csmdata", "hgrid", "printing", "ProgName", "cmdline", - "cfgdir" ); - foreach my $var ( @required_list ) { - if ( ! defined($$opts_ref{$var}) ) { - die "ERROR($nm): Required input variable $var was not found\n"; - } - } - my $printing = $$opts_ref{'printing'}; - my $cmdline = $$opts_ref{'cmdline'}; - # Initialize some local variables - my $files_ref = $$opts_ref{'files'}; - my @files = @$files_ref; - my $nldef_ref = $$opts_ref{'nldef_files'}; - my @nl_definition_files= @$nldef_ref; - my $empty_config_file = $$opts_ref{'empty_cfg_file'}; - my $namelist = $$opts_ref{'namelist'}; - - my $cfg = read_cfg_file( $$opts_ref{'config'}, $$opts_ref{'empty_cfg_file'}, - $printing, $settings_ref ); - - # - # Set up options to send to namelist defaults object - # - my %nlopts; - foreach my $var ( keys( %$settings_ref) ) { - if ( $var ne "csmdata" ) { - $nlopts{$var} = $$settings_ref{$var}; - } - } - if ( $$opts_ref{'hgrid'} ne "any" ) { - $nlopts{'hgrid'} = $$opts_ref{'hgrid'}; - } - # - # Loop through all variables in files - # - print "($nm) Read: $files[0]\n" if $printing; - my %defaults; - my $nldefaults = Build::NamelistDefaults->new($files[0], $cfg); - for ( my $i = 1; $i <= $#files; $i++ ) { - print "($nm) Read: $files[$i]\n" if $printing; - $nldefaults->add( $files[$i] ); - } - my $definition = Build::NamelistDefinition->new( $nl_definition_files[0] ); - for ( my $i = 1; $i <= $#nl_definition_files; $i++ ) { - print "($nm) Read: $nl_definition_files[$i]\n" if $printing; - $definition->add( $nl_definition_files[$i] ); - } - if ( $$opts_ref{'csmdata'} eq "default" ) { - $$opts_ref{'csmdata'} = $nldefaults->get_value( "csmdata", \%nlopts ); - } - $nlopts{'csmdata'} = $$opts_ref{'csmdata'}; - foreach my $name ( $nldefaults->get_variable_names() ) { - my $value = $nldefaults->get_value( $name, \%nlopts ); - if ( $value eq "null" ) { next; } - if ( defined($$settings_ref{'var'}) ) { - if ( $name ne $$settings_ref{'var'} ) { next; } - } - $value =~ s/\n//g; - my $isafile = 0; - if ( $definition->is_input_pathname($name) ) { - - if ( defined($$settings_ref{'clm_usr_name'}) ) { - $value = $nldefaults->get_usr_file( $name, $definition, \%nlopts ); - } - if ( $value && ($value !~ /^\/.+$/) ) { - $value = $$opts_ref{'csmdata'} . "/" . $value; - } - $isafile = 1; - } - my $isadir = 0; - my $isastr = 0; - if ( $definition->get_str_len($name) > 0 ) { - $isastr = 1; - } - # - # If is a directory (is a file and csmdata or a var with dir in name) - # - if ( $isafile && (($name eq "csmdata") || ($name =~ /dir/)) ) { - if ( $name eq "csmdata" ) { - $value = $$opts_ref{'csmdata'}; - $isadir = 1; - } else { - $isadir = 1; - } - } - # Return hash with the results - my $group = $definition->get_group_name( $name ); - if ( $group eq $namelist && $value && (! exists($defaults{$name}{'value'})) ) { - $defaults{$name}{'value'} = $value; - $defaults{$name}{'isfile'} = $isafile; - $defaults{$name}{'isdir'} = $isadir; - $defaults{$name}{'isstr'} = $isastr; - } - } - return( \%defaults ); -} - -1 # To make use or require happy diff --git a/bld/unit_testers/NMLTest/CompFiles.pm b/bld/unit_testers/NMLTest/CompFiles.pm deleted file mode 100644 index c29d1b24a9..0000000000 --- a/bld/unit_testers/NMLTest/CompFiles.pm +++ /dev/null @@ -1,218 +0,0 @@ -############################################################################### -# -# Module: NMLTest::CompFiles -# -# Created by Erik Kluzek NCAR -# -# This is a tester built on top of Test::More to compare namelist files -# (or really any ASCII text files). There is a mechanism for telling the -# test object that you should (or should NOT) expect the comparison to be -# exact or not. -# -############################################################################### - -package NMLTest::CompFiles; -use strict; -use Test::More; -use IO::File; - -=head1 NAME - -NMLTest::CompFiles - A comparision tester for namelist (or ASCII text) files - -=head1 SYNOPSIS - -=head1 DESCRIPTION - -=cut - -sub new { - my $self = {}; - my $class = shift; - my $dir = shift; - my @files = @_; - - my $nm = ref($self)."\:\:new"; - - my %diffref = { }; - $self->{'diffref'} = \%diffref; - if ( ! -d "$dir" ) { - die "ERROR::($nm) Input directory ($dir) does NOT exist!\n"; - } - $self->{'dir'} = $dir; - $self->{'files'} = \@_; - bless( $self, $class ); -} - -sub checkfilesexist { -# -# Check that files exist -# - my $self = shift; - my $type = shift; - my $mode = shift; - my $nm = ref($self)."\:\:checkfilesexist"; - - my $filesref = $self->{'files'}; - my $confdir = $self->{'dir'}; - foreach my $file ( @$filesref ) { - my $exists = ( -f "$confdir/$file" ); - ok( $exists, "$type $mode: $file file exists" ); - if ( $exists ) { - $self->dodiffonfile( $file, $type, $mode ); - } else { - $self->doNOTdodiffonfile( $file, $type, $mode ); - } - } -} - -sub comparefiles { -# -# Compare the resultant files to the default versions -# - my $self = shift; - my $type = shift; - my $comp_mode = shift; - my $compdir = shift; - my $nm = ref($self)."\:\:comparefiles"; - - $type =~ s#[ '"&/]#+#g; - $comp_mode =~ s#[ '"&/]#+#g; - my $confdir = $self->{'dir'}; - my $diffref = $self->{'diffref'}; - if ( ! defined($type) ) { - $type = "default"; - } - my $compare = "compare to previous tag"; - if ( ! defined($compdir) ) { - $compdir = "."; - $compare = undef; - } - if ( ! -d "$compdir" ) { - die "ERROR($nm):: Compare directory $compdir does NOT exist!\n"; - } - print "Compare files for $type type MODE=$comp_mode $compare\n"; - my $diffstat; - my %diffhas = %$diffref; - my $same = "file the same as expected"; - my $diff = "file different as expected"; - my $filesref = $self->{'files'}; - foreach my $file ( @$filesref ) { - if ( ! -f "$compdir/${file}.$comp_mode.${type}" ) { - print "WARNING($nm):: File $compdir/${file}.$comp_mode.${type} does NOT exist!\n"; - fail( "compare file $file DNE for $comp_mode and $type" ); - } else { - if ( ! exists($diffhas{$comp_mode}{$type}{$file}) ) { - die "ERROR($nm):: difference is NOT setup for $comp_mode ${type} $file!\n"; - } - system( "diff $confdir/${file} $compdir/${file}.$comp_mode.${type} > /dev/null" ); - $diffstat = $?; - if ( $diffhas{$comp_mode}{$type}{$file} ) { - ok( ! $diffstat, "$file $same for $comp_mode" ); - } else { - ok( $diffstat, "$file different as expected for $comp_mode" ); - } - } - } - -} - -sub copyfiles { -# -# Copy the namelist files to default names for comparisions -# - my $self = shift; - my $type = shift; - my $mode = shift; - my $nm = ref($self)."\:\:copyfiles"; - - $type =~ s#[ '"&/]#+#g; - $mode =~ s#[ '"&/]#+#g; - my $diffref = $self->{'diffref'}; - my $filesref = $self->{'files'}; - my $confdir = $self->{'dir'}; - foreach my $file ( @$filesref ) { - system( "/bin/cp $confdir/$file ${file}.${mode}.${type}" ); - $$diffref{${mode}}{${type}}{$file} = 1; - } - print "$type namelists for $mode\n"; - foreach my $file ( @$filesref ) { - system( "/bin/cat $file.${mode}.${type}" ); - } -} - - -sub shownmldiff { -# -# Show the differences in the namelists -# - my $self = shift; - my $type = shift; - my $comp_mode = shift; - my $nm = ref($self)."\:\:shownmldiff"; - - $type =~ s#[ '"&/]#+#g; - $comp_mode =~ s#[ '"&/]#+#g; - my $filesref = $self->{'files'}; - my $confdir = $self->{'dir'}; - foreach my $file ( @$filesref ) { - my $file1 = "$confdir/$file"; - if ( ! -f "$file1" ) { - print "$file1 does NOT exist\n"; - return; - } - my $file2 = "${file}.${comp_mode}.${type}"; - if ( ! -f "$file2" ) { - print "$file2 does NOT exist\n"; - return; - } - print "Diff in in $file to $type $comp_mode version"; - system( "diff $file1 $file2" ); - } - -} - - - -sub dodiffonfile { -# -# Set it so that it does do a difference on the given input file -# - my $self = shift; - my $file = shift; - my $type = shift; - my $mode = shift; - my $nm = ref($self)."\:\:dodiffonfile"; - - $type =~ s#[ '"&/]#+#g; - $mode =~ s#[ '"&/]#+#g; - my $diffref = $self->{'diffref'}; - if ( ! defined($type) ) { - $type = "default"; - } - $$diffref{$mode}{$type}{$file} = 1; -} - - -sub doNOTdodiffonfile { -# -# Set it so that it does NOT do a difference on the given input file -# - my $self = shift; - my $file = shift; - my $type = shift; - my $mode = shift; - my $nm = ref($self)."\:\:doNOTdodiffonfile"; - - $type =~ s#[ '"&/]#+#g; - $mode =~ s#[ '"&/]#+#g; - my $diffref = $self->{'diffref'}; - if ( ! defined($type) ) { - $type = "default"; - } - $$diffref{$mode}{$type}{$file} = 0; -} - -#----------------------------------------------------------------------------------------------- - -1 # to make use or require happy diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl deleted file mode 100755 index 6358a9a6f4..0000000000 --- a/bld/unit_testers/build-namelist_test.pl +++ /dev/null @@ -1,1420 +0,0 @@ -#!/usr/bin/env perl - -# Test command line options of the build-namelist script. -# Try to test that all the different options at least work. -# Test that inconsistentcies are appropriately caught. - -######################### - -use Test::More; -use xFail::expectedFail; -use IO::File; - -######################### - -use strict; -use Getopt::Long; -use NMLTest::CompFiles; -use English; - -sub usage { - die < Compare namelists for this version to namelists - created by another version. - -generate Leave the namelists in place to do a later compare. - -test Use the -test option to make sure datasets exist. - -csmdata "dir" Root directory of CESM input data. - -EOF -} - -sub make_env_run { -# -# Create a env_run.xml file to read in -# - my %settings = @_; - - # Set default settings - my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE" ); - # Set any settings that came in from function call - foreach my $item ( keys(%settings) ) { - $env_vars{$item} = $settings{$item}; - } - - # Now write the file out - my $envfile = "env_run.xml"; - my $fh = IO::File->new($envfile, '>') or die "can't open file: $envfile"; - print $fh < - - - -EOF - foreach my $item ( keys(%env_vars) ) { - print $fh < -EOF - } - print $fh < -EOF - $fh->close(); -} - - -# -# Process command-line options. -# -my %opts = ( help => 0, - generate => 0, - test => 0, - compare => undef, - csmdata => undef, - ); - -GetOptions( - "h|help" => \$opts{'help'}, - "compare=s" => \$opts{'compare'}, - "generate" => \$opts{'generate'}, - "test" => \$opts{'test'}, - "csmdata=s" => \$opts{'csmdata'}, -) or usage(); - -# Give usage message. -usage() if $opts{'help'}; - -# Check that the CESM inputdata root directory has been specified. This must be -# a local or nfs mounted directory. -my $inputdata_rootdir = undef; -if (defined($opts{'csmdata'})) { - $inputdata_rootdir = $opts{'csmdata'}; -} elsif (defined $ENV{'CSMDATA'} ) { - $inputdata_rootdir = $ENV{'CSMDATA'}; -} else { - # use yellowstone location as default - $inputdata_rootdir="/glade/p/cesm/cseg/inputdata"; - print("WARNING: -csmdata nor CSMDATA are set, using default yellowstone location: $inputdata_rootdir\n"); -} - -################################### -#_# read in expected fail test list -################################### -my $compGen; -if ( $opts{'generate'} eq 1 && !(defined($opts{'compare'}) )) { - $compGen='generate'; -} elsif ( defined($opts{'compare'}) ) { - $compGen='compare'; -} elsif ( defined($opts{'compare'} && ($opts{'generate'} eq 1 ))) { - #_# if compare and generate are both given, use compare - $compGen='compare'; -} - -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; -my $testType="namelistTest"; - -# -# Figure out number of tests that will run -# -my $ntests = 939; -if ( defined($opts{'compare'}) ) { - $ntests += 597; -} -plan( tests=>$ntests ); - -#_# ============================================================ -#_# setup for xFail module -#_# ============================================================ -my $xFail = xFail::expectedFail->new($ProgName,$compGen,$ntests); -my $captOut=""; #_# variable to capture Test::More output -Test::More->builder->output(\$captOut); -#_# ============================================================ -#_# -#_# ============================================================ - -# Check for unparsed arguments -if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); -} -my $mode = "-phys clm5_0"; -system( "../configure -s $mode" ); - -my $DOMFILE = "$inputdata_rootdir/atm/datm7/domain.lnd.T31_gx3v7.090928.nc"; -my $real_par_file = "user_nl_clm_real_parameters"; -my $bldnml = "../build-namelist -verbose -csmdata $inputdata_rootdir -lnd_frac $DOMFILE -glc_nec 10 -no-note -output_reals $real_par_file"; -if ( $opts{'test'} ) { - $bldnml .= " -test"; -} - -my $tempfile = "temp_file.txt"; -if ( -f $tempfile ) { - system( "/bin/rm $tempfile" ); -} - -my @files = ( "lnd_in", $tempfile, $real_par_file ); -my $cwd = `pwd`; -chomp( $cwd ); -my $cfiles = NMLTest::CompFiles->new( $cwd, @files ); - -print "\n==================================================\n"; -print "Run simple tests \n"; -print "==================================================\n"; - -# Simple test -- just run build-namelist with -help option -eval{ system( "$bldnml -help > $tempfile 2>&1 " ); }; - is( $@, '', "help" ); - &cleanup(); -# Simple test -- just run build-namelist with -version option -eval{ system( "$bldnml -version > $tempfile 2>&1 " ); }; - is( $@, '', "version" ); - system( "/bin/cat $tempfile" ); - &cleanup(); -# Simple test -- just run build-namelist -&make_env_run(); -eval{ system( "$bldnml > $tempfile 2>&1 " ); }; - is( $@, '', "plain build-namelist" ); - $cfiles->checkfilesexist( "default", $mode ); - # Compare to baseline - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "default", $mode ); - $cfiles->comparefiles( "default", $mode, $opts{'compare'} ); - } - -print "\n==================================================\n"; -print "Run simple tests with all list options \n"; -print "==================================================\n"; - -$cfiles->copyfiles( "default", $mode ); -&cleanup(); -# Simple test -- run all the list options -foreach my $options ( "clm_demand", "rcp", "res", - "sim_year", "use_case" ) { - &make_env_run(); - eval{ system( "$bldnml -${options} list > $tempfile 2>&1 " ); }; - my $result = `cat $tempfile`; - my $expect; - if ( $options =~ /use_case/ ) { - $expect = "use cases :"; - } else { - $expect = "valid values for $options"; - } - $expect = "/CLM build-namelist : $expect/"; - like( $result, $expect, "$options list" ); - is( (-f "lnd_in"), undef, "Check that lnd_in file does NOT exist" ); - &cleanup(); -} - -print "\n==================================================\n"; -print "Run simple tests with additional options \n"; -print "==================================================\n"; - -# Exercise a bunch of options -my $options = "-co2_ppmv 250 "; - $options .= " -res 0.9x1.25 -rcp 2.6 -envxml_dir ."; - - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "default", $mode ); - $cfiles->copyfiles( "most_options", $mode ); - # Compare to default - $cfiles->doNOTdodiffonfile( "lnd_in", "default", $mode ); - $cfiles->doNOTdodiffonfile( "$real_par_file", "default", $mode ); - $cfiles->doNOTdodiffonfile( "$tempfile", "default", $mode ); - $cfiles->comparefiles( "default", $mode ); - # Compare to baseline - if ( defined($opts{'compare'}) ) { - $cfiles->dodiffonfile( "lnd_in", "most_options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "most_options", $mode ); - $cfiles->doNOTdodiffonfile( "$tempfile", "most_options", $mode ); - $cfiles->comparefiles( "most_options", $mode, $opts{'compare'} ); - } - &cleanup(); - -print "\n==================================================\n"; -print "Test drydep, fire_emis and megan namelists \n"; -print "==================================================\n"; - -# drydep and megan namelists -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -my @mfiles = ( "lnd_in", "drv_flds_in", $tempfile ); -my $mfiles = NMLTest::CompFiles->new( $cwd, @mfiles ); -foreach my $options ( "-drydep", "-megan", "-drydep -megan", "-fire_emis", "-drydep -megan -fire_emis" ) { - &make_env_run(); - eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $mfiles->checkfilesexist( "$options", $mode); - if ( $options ne "-drydep" ) { - $mfiles->shownmldiff( "-drydep", $mode ); - } - if ( defined($opts{'compare'}) ) { - $mfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $mfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $mfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); - -print "\n===============================================================================\n"; -print "Test irrig, verbose, clm_demand, rcp, test, sim_year, use_case, l_ncpl\n"; -print "=================================================================================\n"; - -# irrig, verbose, clm_demand, rcp, test, sim_year, use_case, l_ncpl -my $startfile = "clmrun.clm2.r.1964-05-27-00000.nc"; -foreach my $options ( "-namelist '&a irrigate=.true./'", "-verbose", "-rcp 2.6", "-test", "-sim_year 1850", - "-use_case 1850_control", "-l_ncpl 1", - "-clm_start_type startup", "-namelist '&a irrigate=.false./' -crop -bgc bgc", - "-envxml_dir . -infile myuser_nl_clm", - "-ignore_ic_date -clm_start_type branch -namelist '&a nrevsn=\"thing.nc\"/' -bgc bgc -crop", - "-ignore_ic_date -clm_start_type startup -namelist '&a finidat=\"thing.nc\"/' -bgc bgc -crop", - ) { - my $file = $startfile; - &make_env_run(); - eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", $mode ); - my $finidat = `grep finidat lnd_in`; - if ( $options eq "-l_ncpl 1" ) { - my $dtime = `grep dtime lnd_in`; - like( $dtime, "/ 86400\$/", "$options" ); - } elsif ( $options =~ /myuser_nl_clm/ ) { - my $fsurdat = `grep fsurdat lnd_in`; - like( $fsurdat, "/MYDINLOCROOT/lnd/clm2/PTCLMmydatafiles/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_simyr2000_clm4_5_c131122.nc/", "$options" ); - } - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} -print "\n==============================================================\n"; -print "Test several use_cases and specific configurations for clm5_0\n"; -print "==============================================================\n"; -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -foreach my $options ( - "-bgc bgc -use_case 1850-2100_rcp2.6_transient -namelist '&a start_ymd=20100101/'", - "-bgc sp -use_case 1850-2100_rcp4.5_transient -namelist '&a start_ymd=18501223/'", - "-bgc bgc -use_case 1850-2100_rcp6_transient -namelist '&a start_ymd=20701029/'", - "-bgc fates -use_case 2000_control -no-megan", - "-bgc cn -use_case 1850-2100_rcp8.5_transient -namelist '&a start_ymd=19201023/'", - "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", - ) { - my $file = $startfile; - &make_env_run(); - eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", $mode ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "lnd_in", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} - - - -print "\n==================================================\n"; -print "Start Failure testing. These should fail \n"; -print "==================================================\n"; - -# Failure testing, do things that SHOULD fail -my $finidat = "thing.nc"; -system( "touch $finidat" ); - -my %failtest = ( - "coldstart but with IC file"=>{ options=>"-clm_start_type cold -envxml_dir .", - namelst=>"finidat='$finidat'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "clm_demand on finidat" =>{ options=>"-clm_demand finidat -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "blank IC file, not cold" =>{ options=>"-clm_start_type startup -envxml_dir .", - namelst=>"finidat=' '", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "startup without interp" =>{ options=>"-clm_start_type startup -envxml_dir . -bgc sp -sim_year 1850", - namelst=>"use_init_interp=.false., start_ymd=19200901", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "l_ncpl is zero" =>{ options=>"-l_ncpl 0 -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "l_ncpl not integer" =>{ options=>"-l_ncpl 1.0 -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "both l_ncpl and dtime" =>{ options=>"-l_ncpl 24 -envxml_dir .", - namelst=>"dtime=1800", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "use_crop without -crop" =>{ options=>" -envxml_dir .", - namelst=>"use_crop=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "CNDV with flanduse_timeseries" =>{ options=>" -envxml_dir .", - namelst=>"flanduse_timeseries='my_flanduse_timeseries_file.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-bgc cndv", - }, - "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "CNDV with flanduse_timeseries - clm4_5"=>{ options=>"-bgc bgc -dynamic_vegetation -envxml_dir .", - namelst=>"flanduse_timeseries='my_flanduse_timeseries_file.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "use_cndv=T without bldnml op"=>{ options=>"-bgc cn -envxml_dir .", - namelst=>"use_cndv=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "use_cndv=F with dyn_veg op"=>{ options=>"-bgc cn -dynamic_vegetation -envxml_dir .", - namelst=>"use_cndv=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "crop with use_crop false" =>{ options=>"-crop -bgc bgc -envxml_dir .", - namelst=>"use_crop=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "crop without CN" =>{ options=>"-crop -bgc sp -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "baset_map without crop" =>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"baset_mapping='constant'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "mapvary var w/o varymap" =>{ options=>"-crop -bgc bgc -envxml_dir .", - namelst=>"baset_mapping='constant', baset_latvary_slope=1.0, baset_latvary_intercept=10.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "-irrig with clm5_0" =>{ options=>"-bgc bgc -crop -irrig .true. -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "-irrig with -crop" =>{ options=>"-irrig .true. -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0 -bgc cn -crop on", - }, - "-irrigate=T without -crop" =>{ options=>"-bgc cn -irrig .true. -envxml_dir .", - namelst=>"irrigate=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "interp without finidat" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_init_interp=.true. finidat=' '", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "sp and c13" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_c13=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "sp and c14" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_c14=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "bombspike no c14" =>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"use_c14=.false. use_c14_bombspike=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "use c13 timeseries no cn" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_c13_timeseries=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "use c13 timeseries no c13"=>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"use_c13=.false. use_c13_timeseries=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "bombspike no cn" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_c14_bombspike=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightres no cn" =>{ options=>"-bgc sp -envxml_dir . -light_res 360x720", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "spno-fire" =>{ options=>"-bgc sp -envxml_dir . -use_case 2000_control", - namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightres no fire" =>{ options=>"-bgc cn -envxml_dir . -light_res 360x720", - namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightres none bgc" =>{ options=>"-bgc bgc -envxml_dir . -light_res none", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightresnotnone-nofire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 94x192", - namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightresnonenofirelightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res none", - namelst=>"fire_method='nofire',stream_fldfilename_lightng='build-namelist_test.pl'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lightrescontradictlightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", - namelst=>"stream_fldfilename_lightng='build-namelist_test.pl'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bgc=cn and bgc settings" =>{ options=>"-bgc cn -envxml_dir .", - namelst=>"use_lch4=.true.,use_nitrif_denitrif=.true.,use_vertsoilc=.true.,use_century_decomp=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "finundated and not methane"=>{ options=>"-bgc cn -envxml_dir .", - namelst=>"use_lch4=.false.,finundation_method='h2osfc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bgc=bgc and cn-only set" =>{ options=>"-bgc bgc -envxml_dir .", - namelst=>"use_lch4=.false.,use_nitrif_denitrif=.false.,use_vertsoilc=.false.,use_century_decomp=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "use_cn=true bgc=sp" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"use_cn=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "use_cn=false bgc=cn" =>{ options=>"-bgc cn -envxml_dir .", - namelst=>"use_cn=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "lower=aqu-45 with/o Zeng" =>{ options=>"-envxml_dir .", - namelst=>"lower_boundary_condition=4,soilwater_movement_method=1,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "Zeng w lower=flux" =>{ options=>"-envxml_dir .", - namelst=>"lower_boundary_condition=1,soilwater_movement_method=0,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "Zeng w lower=zeroflux" =>{ options=>"-envxml_dir .", - namelst=>"lower_boundary_condition=2,soilwater_movement_method=0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "Zeng w lower=table" =>{ options=>"-envxml_dir .", - namelst=>"lower_boundary_condition=3,soilwater_movement_method=0,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "vichydro without clm4_5" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "use_vic=F with -vic op" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"use_vichydro=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "-vic with l_bnd=flux" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "-vic with l_bnd=zeroflux" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "-vic with origflag=1" =>{ options=>"-vichydro -envxml_dir .", - namelst=>"origflag=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "l_bnd=flux with origflag=0"=>{ options=>"-envxml_dir .", - namelst=>"origflag=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "l_bnd=zflux with origflag=0"=>{ options=>"-envxml_dir .", - namelst=>"origflag=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "bedrock with l_bnc=flux" =>{ options=>"-envxml_dir .", - namelst=>"use_bedrock=.true., lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bedrock with l_bnc=tabl" =>{ options=>"-envxml_dir .", - namelst=>"use_bedrock=.true., lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bedrock with l_bnc=aqui" =>{ options=>"-envxml_dir .", - namelst=>"use_bedrock=.true., lower_boundary_condition=4", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "zengdeck with l_bnc=flux" =>{ options=>"-envxml_dir .", - namelst=>"soilwater_movement_method=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "zengdeck with l_bnc=z-flux"=>{ options=>"-envxml_dir .", - namelst=>"soilwater_movement_method=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "zengdeck with l_bnc=tabl" =>{ options=>"-envxml_dir .", - namelst=>"soilwater_movement_method=0, lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "l_bnd=tabl with h2osfcfl=0"=>{ options=>"-envxml_dir .", - namelst=>"h2osfcflag=0, lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "l_bnd=flux with h2osfcfl=0"=>{ options=>"-envxml_dir .", - namelst=>"h2osfcflag=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "l_bnd=zflux with h2osfcfl=0"=>{ options=>"-envxml_dir .", - namelst=>"h2osfcflag=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "h2osfcfl=0 with clm5.0" =>{ options=>"-envxml_dir .", - namelst=>"h2osfcflag=0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "origflag=0 with clm5.0" =>{ options=>"-envxml_dir .", - namelst=>"origflag=0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "oldfflag=0 with clm5.0" =>{ options=>"-envxml_dir .", - namelst=>"oldfflag=0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bgc without clm4_5" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "spinup_state without clm4_5" =>{ options=>"-clm_accelerated_spinup on -envxml_dir .", - namelst=>"spinup_state=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "40bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm4_5_CRUNCEP -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "45bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm5_0_GSWP3 -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "50bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm4_5_CRUNCEP -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "DV without clm4_5" =>{ options=>"-dynamic_vegetation -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "bgc_spinup without cn" =>{ options=>"-clm_accelerated_spinup on -bgc sp -envxml_dir .", - namelst=>"spinup_state=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "spinup=1 without bldnml op"=>{ options=>"-clm_accelerated_spinup off -bgc bgc -envxml_dir .", - namelst=>"spinup_state=1",, - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "DV without clm4_5" =>{ options=>"-dynamic_vegetation -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "bgc_spinup without cn" =>{ options=>"-clm_accelerated_spinup on -bgc sp -envxml_dir .", - namelst=>"spinup_state=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "baseflow w aquifer" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"baseflow_scalar=1.0, lower_boundary_condition=4,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "baseflow w table" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"baseflow_scalar=1.0, lower_boundary_condition=3,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "br_root and bgc=sp" =>{ options=>"-bgc sp -envxml_dir .", - namelst=>"br_root=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "both co2_type and on nml" =>{ options=>"-co2_type constant -envxml_dir .", - namelst=>"co2_type='prognostic'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "both lnd_frac and on nml" =>{ options=>"-lnd_frac domain.nc -envxml_dir .", - namelst=>"fatmlndfrc='frac.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "branch but NO nrevsn" =>{ options=>"-clm_start_type branch -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "glc_nec inconsistent" =>{ options=>"-envxml_dir .", - namelst=>"maxpatch_glcmec=5", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "NoGLCMec" =>{ options=>"-envxml_dir . -glc_nec 0", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "UpdateGlcContradict" =>{ options=>"-envxml_dir .", - namelst=>"glc_do_dynglacier=.false.", - GLC_TWO_WAY_COUPLING=>"TRUE", - conopts=>"-phys clm4_5", - }, - "clm40andUpdateGlc" =>{ options=>"-envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"TRUE", - conopts=>"-phys clm4_0", - }, - "useFATESContradict" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useFATESContradict2" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"use_fates=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useFATESWCN" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_cn=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "useFATESWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"create_crop_landunit=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "useFATESWTransient" =>{ options=>"-bgc fates -use_case 20thC_transient -envxml_dir . -no-megan -res 10x15", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "useFATESclm40" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "usespitfireButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"use_fates_spitfire=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"use_fates_logging=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useinventorybutnotfile" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_inventory_init=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_inventory_init=.true., fates_inventory_ctrl_filename='zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useMEGANwithFATES" =>{ options=>"-bgc fates -envxml_dir . -megan", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - "useHYDSTwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_hydrstress=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "useHYDSTwithdynroot" =>{ options=>"-bgc bgc -envxml_dir . -megan", - namelst=>"use_hydrstress=.true., use_dynroot=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "fireemiswith40" =>{ options=>"-envxml_dir . -fire_emis", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_0", - }, - "specWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", - namelst=>"fire_emis_specifier='bc_a1 = BC'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "elevWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", - namelst=>"fire_emis_elevated=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lmr1WOcn" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"leafresp_method=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lmr2WOcn" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"leafresp_method=2", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lmr0Wcn" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"leafresp_method=0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "nofireButSetcli_scale" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"fire_method='nofire', cli_scale=5.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "nocnButSetrh_low" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"rh_low=5.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "funWOcn" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_fun=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "flexCNWOcn" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_flexibleCN=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "flexCNFUNwcarbonresp" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_flexibleCN=.true.,use_FUN=.true.,carbon_resp_opt=1", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "funWOnitrif" =>{ options=>"-envxml_dir .", - namelst=>"use_fun=.true., use_nitrif_denitrif=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "knitrmaxWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_nitrif_denitrif=.false., k_nitr_max=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "respcoefWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_nitrif_denitrif=.false., denitrif_respiration_coefficient=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "respexpWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_nitrif_denitrif=.false., denitrif_respiration_exponent=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "nitrcoefWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_nitrif_denitrif=.false., denitrif_nitrateconc_coefficient=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "nitrexpWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_nitrif_denitrif=.false., denitrif_nitrateconc_exponent=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "lunaWSPandlnctrue" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_luna=.true., lnc_opt=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "NOlunabutsetJmaxb1" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_luna=.false., jmaxb1=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "envxml_not_dir" =>{ options=>"-envxml_dir myuser_nl_clm", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - "envxml_emptydir" =>{ options=>"-envxml_dir xFail", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"", - }, - ); -foreach my $key ( keys(%failtest) ) { - print( "$key\n" ); - system( "../configure -s ".$failtest{$key}{"conopts"}); - my $options = $failtest{$key}{"options"}; - my $namelist = $failtest{$key}{"namelst"}; - &make_env_run( GLC_TWO_WAY_COUPLING=>$failtest{$key}{"GLC_TWO_WAY_COUPLING"} ); - eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; - isnt( $?, 0, $key ); - system( "cat $tempfile" ); -} - - -print "\n===============================================================================\n"; -print "Start Warning testing. These should fail unless -ignore_warnings option is used \n"; -print "=================================================================================\n"; - -# Warning testing, do things that give warnings, unless -ignore_warnings option is used - -my %warntest = ( - # Warnings without the -ignore_warnings option given - "coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold", - namelst=>"finidat = 'testfile.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bgcspin_w_suplnitro" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup on", - namelst=>"suplnitro='ALL'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "use_c13_wo_bgc" =>{ options=>"-envxml_dir . -bgc cn", - namelst=>"use_c13=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "use_c14_wo_bgc" =>{ options=>"-envxml_dir . -bgc cndv", - namelst=>"use_c14=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "maxpft_wrong" =>{ options=>"-envxml_dir . -bgc cndv", - namelst=>"maxpatch_pft=19", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm5_0", - }, - "bad_megan_spec" =>{ options=>"-envxml_dir . -bgc bgc -megan", - namelst=>"megan_specifier='ZZTOP=zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", - conopts=>"-phys clm4_5", - }, - ); -foreach my $key ( keys(%warntest) ) { - print( "$key\n" ); - system( "../configure -s ".$warntest{$key}{"conopts"}); - my $options = $warntest{$key}{"options"}; - my $namelist = $warntest{$key}{"namelst"}; - &make_env_run( GLC_TWO_WAY_COUPLING=>$warntest{$key}{"GLC_TWO_WAY_COUPLING"} ); - eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; - isnt( $?, 0, $key ); - system( "cat $tempfile" ); - # Now run with -ignore_warnings and make sure it works - $options .= " -ignore_warnings"; - eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - system( "cat $tempfile" ); -} - - -print "\n==================================================\n"; -print "Test ALL resolutions with CLM5.0 and SP \n"; -print "==================================================\n"; - -# Check for ALL resolutions with CLM50SP -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -my $reslist = `../queryDefaultNamelist.pl -res list -s`; -my @resolutions = split( / /, $reslist ); -my @regional; -foreach my $res ( @resolutions ) { - chomp($res); - print "=== Test $res === \n"; - my $options = "-res $res -bgc sp -envxml_dir ."; - - # Regional single point resolutions - if ( $res =~ /^([0-9]+x[0-9]+_[a-zA-Z]+)$/ ) { - push( @regional, $res ); - next; - # Resolutions for mksurfdata mapping - } elsif ( $res eq "0.5x0.5" || - $res eq "0.25x0.25" || - $res eq "0.1x0.1" || - $res eq "3x3min" || - $res eq "5x5min" || - $res eq "10x10min" || - $res eq "0.125x0.125" || - $res eq "0.33x0.33" || - $res eq "1km-merge-10min" ) { - next; - # Resolutions supported in clm40 but NOT clm45/clm50 - } elsif ( $res eq "ne240np4" || - $res eq "ne60np4" || - $res eq "ne4np4" || - $res eq "2.5x3.33" || - $res eq "0.23x0.31" || - $res eq "94x192" || - $res eq "8x16" || - $res eq "32x64" || - $res eq "128x256" || - $res eq "512x1024" ) { - next; - } - - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - - $cfiles->checkfilesexist( "$options", $mode ); - - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); print "\n"; -} - -print "\n==================================================\n"; -print " Test important resolutions for CLM4.5 and BGC\n"; -print "==================================================\n"; - -$mode = "-phys clm4_5"; -system( "../configure -s $mode" ); -my @resolutions = ( "4x5", "10x15", "ne30np4", "ne120np4", "ne16np4", "1.9x2.5", "0.9x1.25" ); -my @regional; -my $nlbgcmode = "bgc"; -my $mode = "clm45-$nlbgcmode"; -foreach my $res ( @resolutions ) { - chomp($res); - print "=== Test $res === \n"; - my $options = "-res $res -envxml_dir . -bgc $nlbgcmode"; - - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - - $cfiles->checkfilesexist( "$options", $mode ); - - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); print "\n"; -} - -print "\n==================================================\n"; -print " Test all use-cases \n"; -print "==================================================\n"; - -# Run over all use-cases... -my $list = `$bldnml -use_case list 2>&1 | grep "use case"`; -my @usecases; -if ( $list =~ /build-namelist : use cases : (.+)$/ ) { - my @usecases = split( / /, $list ); -} else { - die "ERROR:: Trouble getting list of use-cases\n"; -} -foreach my $usecase ( @usecases ) { - $options = "-use_case $usecase -envxml_dir ."; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} - -print "\n==================================================\n"; -print "Test single-point regional cases \n"; -print "==================================================\n"; - -# Run over single-point regional cases -foreach my $res ( @regional ) { - $mode = "-sitespf_pt $res -phys clm4_0"; - system( "../configure -s $mode" ); - &make_env_run(); - eval{ system( "$bldnml -envxml_dir . > $tempfile 2>&1 " ); }; - is( $@, '', "$res" ); - $cfiles->checkfilesexist( "$res", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$res", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$res", $mode ); - $cfiles->comparefiles( "$res", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$res", $mode ); - } - &cleanup(); -} - -print "\n==================================================\n"; -print "Test crop resolutions \n"; -print "==================================================\n"; - -# Check for crop resolutions -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -my @crop_res = ( "1x1_numaIA", "1x1_smallvilleIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne30np4", "ne120np4" ); -foreach my $res ( @crop_res ) { - $options = "-bgc bgc -crop -res $res -envxml_dir ."; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} -print "\n==================================================\n"; -print " Test glc_mec resolutions \n"; -print "==================================================\n"; - -# Check for glc_mec resolutions -# -# NOTE(wjs, 2017-12-17) I'm not sure if these glc_mec-specific tests are -# still needed: are they covered with other tests now that we always run -# with glc_mec? Some historical notes: (1) The three resolutions listed -# here used to be the only three with which you could run glc_mec; now -# you can run glc_mec with all resolutions. (2) This used to point to -# all of the glacierMEC use cases; now we don't have glacierMEC-specific -# use cases, but I've kept these pointing to the equivalent normal use -# cases; I'm not sure if it's actually important to test this with all -# of the different use cases. -$mode = "-phys clm4_5"; -system( "../configure -s $mode" ); -my @glc_res = ( "48x96", "0.9x1.25", "1.9x2.5" ); -my @use_cases = ( "1850-2100_rcp2.6_transient", - "1850-2100_rcp4.5_transient", - "1850-2100_rcp6_transient", - "1850-2100_rcp8.5_transient", - "1850_control", - "2000_control", - "20thC_transient", - ); -foreach my $res ( @glc_res ) { - foreach my $usecase ( @usecases ) { - $options = "-bgc bgc -res $res -use_case $usecase -envxml_dir . "; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); - } -} -# Transient 20th Century simulations -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "ne120np4", "10x15" ); -my $usecase = "20thC_transient"; -my $GLC_NEC = 10; -foreach my $res ( @tran_res ) { - $options = "-res $res -use_case $usecase -envxml_dir . "; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} -# Transient rcp scenarios -$mode = "-phys clm5_0"; -system( "../configure -s $mode" ); -my @tran_res = ( "48x96", "0.9x1.25", "1.9x2.5", "ne30np4", "10x15" ); -foreach my $usecase ( "1850_control", "1850-2100_rcp2.6_transient", "1850-2100_rcp4.5_transient", "1850-2100_rcp6_transient", "1850-2100_rcp8.5_transient" ) { - foreach my $res ( @tran_res ) { - $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . "; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->dodiffonfile( "$real_par_file", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); - } -} - -print "\n==================================================\n"; -print "Test clm4.5/clm5.0 resolutions \n"; -print "==================================================\n"; - -foreach my $phys ( "clm4_5", 'clm5_0' ) { - my $mode = "-phys $phys"; - system( "../configure -s $mode" ); - my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res 360x720", - "-bgc sp -envxml_dir . -vichydro", "-bgc bgc -dynamic_vegetation", "-bgc bgc -clm_demand flanduse_timeseries -sim_year 1850-2000", - "-bgc bgc -envxml_dir . -namelist '&a use_c13=.true.,use_c14=.true.,use_c14_bombspike=.true./'" ); - foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "ne120np4", "10x15", "0.9x1.25", "1.9x2.5" ); - foreach my $res ( @clmres ) { - $options = "-res $res -envxml_dir . "; - &make_env_run( ); - eval{ system( "$bldnml $options $clmopts > $tempfile 2>&1 " ); }; - is( $@, '', "$options $clmopts" ); - $cfiles->checkfilesexist( "$options $clmopts", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options $clmopts", $mode ); - $cfiles->comparefiles( "$options $clmopts", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options $clmopts", $mode ); - } - &cleanup(); - } - } - my @clmoptions = ( "-bgc bgc -envxml_dir .", - "-bgc sp -envxml_dir .", ); - foreach my $clmopts ( @clmoptions ) { - my @clmres = ( "ne16np4", "360x720cru" ); - foreach my $res ( @clmres ) { - $options = "-res $res -envxml_dir . "; - &make_env_run( ); - eval{ system( "$bldnml $options $clmopts > $tempfile 2>&1 " ); }; - is( $@, '', "$options $clmopts" ); - $cfiles->checkfilesexist( "$options $clmopts", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options $clmopts", $mode ); - $cfiles->comparefiles( "$options $clmopts", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options $clmopts", $mode ); - } - &cleanup(); - } - } - system( "../configure -s $mode" ); - my $clmopts = "-bgc cn -crop"; - my $res = "1.9x2.5"; - $options = "-res $res -namelist '&a irrigate=.true./' -crop -bgc cn -envxml_dir ."; - &make_env_run(); - eval{ system( "$bldnml $options $clmopts > $tempfile 2>&1 " ); }; - is( $@, '', "$options $clmopts" ); - $cfiles->checkfilesexist( "$options $clmopts", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options $clmopts", $mode ); - $cfiles->comparefiles( "$options $clmopts", "$mode", $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options $clmopts", $mode ); - } - &cleanup(); - # Run FATES mode for several resolutions and configurations - system( "../configure -s $mode" ); - my $clmoptions = "-bgc fates -envxml_dir . -no-megan"; - my @clmres = ( "1x1_brazil", "5x5_amazon", "10x15", "1.9x2.5" ); - foreach my $res ( @clmres ) { - $options = "-res $res"; - my @edoptions = ( "-use_case 2000_control", "", "-namelist \"&a use_lch4=.true.,use_nitrif_denitrif=.true./\"", "-clm_accelerated_spinup on" ); - foreach my $edop (@edoptions ) { - &make_env_run( ); - eval{ system( "$bldnml $options $clmoptions $edop > $tempfile 2>&1 " ); }; - is( $@, '', "$options $edop" ); - $cfiles->checkfilesexist( "$options $edop", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options $edop", $mode ); - $cfiles->comparefiles( "$options $edop", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options $edop", $mode ); - } - &cleanup(); - } - } -} -# -# Run over the differen lnd_tuning modes -# -my $res = "0.9x1.25"; -my $mask = "gx1v6"; -my $simyr = "1850"; -foreach my $phys ( "clm4_0", "clm4_5", 'clm5_0' ) { - my $mode = "-phys $phys"; - system( "../configure -s $mode" ); - foreach my $forc ( "CRUv7", "GSWP3v1", "cam6.0" ) { - foreach my $bgc ( "sp", "bgc" ) { - my $lndtuningmode = "${phys}_${forc}"; - my $clmoptions = "-res $res -mask $mask -sim_year $simyr -envxml_dir . -lnd_tuning_mod $lndtuningmode"; - if ( $phys eq "clm4_0" ) { - $clmoptions .= " -glc_nec 0"; - } else { - $clmoptions .= " -bgc $bgc"; - } - &make_env_run( ); - eval{ system( "$bldnml $clmoptions > $tempfile 2>&1 " ); }; - is( $@, '', "$clmoptions" ); - $cfiles->checkfilesexist( "$clmoptions", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$clmoptions", $mode ); - $cfiles->comparefiles( "$clmoptions", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$clmoptions", $mode ); - } - &cleanup(); - } - } -} -&cleanup(); - -system( "/bin/rm $finidat" ); - -print "\n==================================================\n"; -print " Dumping output \n"; -print "==================================================\n"; - -$xFail->parseOutput($captOut); - -print "Successfully ran all testing for build-namelist\n\n"; - -&cleanup( "config" ); -system( "/bin/rm $tempfile" ); - -sub cleanup { -# -# Cleanup files created -# - my $type = shift; - - print "Cleanup files created\n"; - system( "/bin/rm env_run.xml $real_par_file" ); - if ( defined($type) ) { - if ( $type eq "config" ) { - system( "/bin/rm Filepath config_cache.xml CESM_cppdefs" ); - } - } else { - system( "/bin/rm $tempfile *_in" ); - } -} - diff --git a/bld/unit_testers/myuser_nl_clm b/bld/unit_testers/myuser_nl_clm deleted file mode 100644 index e34958ca60..0000000000 --- a/bld/unit_testers/myuser_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -&clm_inparm -fsurdat = "$DIN_LOC_ROOT/lnd/clm2/PTCLMmydatafiles/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_simyr2000_clm4_5_c131122.nc" -/ diff --git a/bld/unit_testers/xFail/expectedClmTestFails.xml b/bld/unit_testers/xFail/expectedClmTestFails.xml deleted file mode 100644 index 12c954d38b..0000000000 --- a/bld/unit_testers/xFail/expectedClmTestFails.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - goldbach not recognized - goldbach not recognized - goldbach not recognized - - - - - - - - Doesn't check for valid values - - - - - - - - - - - - Internal compiler error - - - - - diff --git a/bld/unit_testers/xFail/expectedFail.pm b/bld/unit_testers/xFail/expectedFail.pm deleted file mode 100755 index 877d4a71ae..0000000000 --- a/bld/unit_testers/xFail/expectedFail.pm +++ /dev/null @@ -1,668 +0,0 @@ -=head1 expectedFail.pm - -Documentation for expectedFail.pm - -=head1 Overview - -The module expectedFail.pm supplies the capability of checking if a failed test is expected to fail. -It is called directly from either test_driver.sh (for batch and interactive tests) or build-namelist_test.pl. -Future plans involve integrating this module into cesm tests. - -=head1 Use Case - -This is a new feature being added to the existing CLM test infrastructure. The use case would roughly be -along the lines of: - - 1) Run the test suite (CLM batch,interactive or namelist) - 2) Search for test failures - a) Fix failed tests - b) -or- Add new xFail entries to XML file if a test is supposed to fail (eg. due to some missing resolution). - 3) Check for new tests that now pass. This is for modifying the ChangeLog. - 4) Update XML file by either adding new entries or removing old ones. - 5) update the ChangeLog to reflect important changes in test behavior (Tests that now pass that failed before, tests that - are now xFail, etc... - -=head2 Public methods - -There are two public methods needed. The "new" ctor and one of the parseOutput* methods. -Everything else is private. - - xFail::expectedFail->new - parseOutput - parseOutputCLM - -=head2 Private methods - - sub _searchExpectedFail - sub _readXml - sub _testNowPassing - sub _printOutput - sub _getTestType - sub _getMachInfo - -=cut - -package xFail::expectedFail; - -our $VERSION = '1.00'; - -use Cwd; -use strict; -use Getopt::Long; -use English; -use Scalar::Util qw(looks_like_number); - -my @testList={}; -my $DEBUG=0; - -my $pass=" PASS"; -my $fail=" FAIL"; -my $xfail="xFAIL"; - -############################################################################## -# -############################################################################## - -=head1 CTOR - -Constructor for the class. Reads in three arguments: - _callingName -> name of the script creating the new object - _compareGenerate -> compare or generate option - _totTests -> total number of tests to run - -Calls _readXml which reads the file expectedClmTestFails.xml and stores it memory -for later searches. - -returns: new object ($self) - -=cut - -############################################################################## -# -############################################################################## -sub new { - my ($class_name) = @_; - my $self = { - _className => shift, - _callingName => shift, - _compareGenerate => shift, - _totTests => shift, - _foundList => undef, - _numericalTestId => undef - }; - - if ($DEBUG) { - print "$self->{_callingName}\n"; - print "$self->{_compareGenerate}\n"; - } - - bless ($self, $class_name); - - $self->{_numericalTestId}=0; - $self->{_created} = 1; - - $self->_readXml(); - - return $self; -} - -############################################################################## -# -############################################################################## - -=head1 parseOutput - -parseOutput parsese the output from the build-namelist_test.pl script. It is similar -to, but not interchangable with parseOutputCLM. - -The only argument is that of the reference variable that contains the information dumped -by Test::More. - -returns: nothing - -=cut - -############################################################################## -# -############################################################################## -sub parseOutput -{ - - - my $report; - my $testId; - my @testName={}; - my $testReason; - - my ($self, $output) = @_ ; - - #_#=========================================== - #_# keep this in for logging - #_#=========================================== - print ("captured output is :: \n $output \n"); - - #_# split the output from Test::More output on newline - my @refList = split('\n', $output); - - #_# process any buffered output which happens when a subroutine from build-namelist_test.pl - #_# itself calls some testing routines - foreach my $refSplit (@refList) { - - #_# always look at the last element of refSplit since that will have the info. from the - #_# last test run - - my @outArr=split(/ /,$refSplit); - - if ($DEBUG) { - print ("\nxFail::expectedFail::parseOutput @outArr[0] \n"); - print ("xFail::expectedFail::parseOutput @outArr[1] \n"); - print ("xFail::expectedFail::parseOutput @outArr[2] \n"); - print ("xFail::expectedFail::parseOutput @outArr[3] \n"); - print ("xFail::expectedFail::parseOutput @outArr[4] \n"); - } - - my $size = @outArr-1; - - #_# first case, we have a passed (ok) test - if (@outArr[0] eq "ok") { - $self->{_numericalTestId}++; - - $report=$pass; - $testId=@outArr[1]; - @testName=@outArr[3..$size]; - $testReason=""; - - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - my $testReason=$self->_testNowPassing($testId,$retVal,$xFailText); - - if($DEBUG){ - print("$testReason \n"); - } - - $self->_printOutput($report,$testId,$testReason,@testName); - - - #_# deal with the case of a failed (not ok) test - } elsif (@outArr[0] eq "not") { - $self->{_numericalTestId}++; - - $testId=@outArr[2]; - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - if ($DEBUG) { - print ("xFail::expectedFail::parseOutput Id $retVal,$xFailText \n"); - } - - @testName=@outArr[4..$size]; - - if ($retVal eq "TRUE"){ - #_# found an expected FAIL (xFAIL) - $report=$xfail; - $testReason= ""; - } else { - #_# print a regular FAIL - $report=$fail; - $testReason=""; - } - - $self->_printOutput($report,$testId,$testReason,@testName); - - } else { - #_# skipping line. Trying to parse error code from Test::More - } - - } - - #_# this resets the reference that points to $output (\$captOut) on the caller side - @_[1]=""; - -} - -############################################################################## -# -############################################################################## - -=head1 parseOutputCLM - -parseOutputCLM parsese the output from the test_driver.sh script. It is similar -to, but not interchangable with parseOutput. - -parseOutputCLM takes one arguments: - $statFoo-> the name of the td..status file - -returns: nothing - -=cut - -############################################################################## -# -############################################################################## -sub parseOutputCLM -{ - - my $report; - my $testId; - my @testName={}; - my $testReason; - - my ($self, $statFoo) = @_ ; - - open(FOO, "< $statFoo"); # open for input - open(FOO_OUT, "> $statFoo.xFail"); # open for input - - my(@reportLines); - - while () { - - my($line) = $_; - - my @outArr=split(/ /,$line); - if (looks_like_number(@outArr[0])) { - - $self->{_numericalTestId}++; - - my $num=sprintf("%03d", $self->{_numericalTestId}); - my $totNum=sprintf("%03d", $self->{_totTests}); - - #_# last element has the pass/fail info. - chomp(@outArr[-1]); - my $repPass=substr(@outArr[-1], -4, 4); - - if ($DEBUG) { - print ("xFail::expectedFail::parseOutput @outArr[0] \n"); - print ("xFail::expectedFail::parseOutput @outArr[1] \n"); - print ("xFail::expectedFail::parseOutput @outArr[2] \n"); - print ("xFail::expectedFail::parseOutput @outArr[3] \n"); - print ("xFail::expectedFail::parseOutput @outArr[4] \n"); - print ("xFail::expectedFail::parseOutput @outArr[5] \n"); - print ("xFail::expectedFail::parseOutput @outArr[6] \n"); - print ("xFail::expectedFail::parseOutput @outArr[-1] \n"); - print ("xFail::expectedFail::parseOutput $repPass \n"); - } - - my $size = @outArr-1; - if ($DEBUG) { - print ("size of line $size \n"); - } - my $endOfDesc=$size-1; - - if ($repPass eq "PASS") { - $report=$pass; - $testId=@outArr[1]; - @testName=@outArr[2..$endOfDesc]; - - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - my $testReason=$self->_testNowPassing($testId,$retVal,$xFailText); - - #_# print out the test results - print FOO_OUT ("$num/$totNum <$report> $testReason \n"); - - } else { - $testId=@outArr[1]; - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - if ($DEBUG) { - print ("xFail::expectedFail::parseOutput Id $retVal,$xFailText \n"); - } - - @testName=@outArr[2..$endOfDesc]; - - if ($retVal eq "TRUE"){ - #_# found an expected FAIL (xFAIL) - $report=$xfail; - $testReason= ""; - } else { - #_# print a regular FAIL - $report=$fail; - $testReason=""; - } - - #_# print out the test results - print FOO_OUT ("$num/$totNum <$report> $testReason \n"); - - } - - } else { - print FOO_OUT $line; - } - } - close(FOO); - close(FOO_OUT); -} - -############################################################################## -# -############################################################################## - -=head1 _searchExpectedFail - -searches the list of expected fails for a match with testId. - -_searchExpectedFail takes one arguments: - $testId-> the test id (numerical or string) that we want to search for - -returns: $retVal (TRUE or FALSE) if id was found - $text text from XML file - -=cut - -############################################################################## -# -############################################################################## -sub _searchExpectedFail -{ - my ( $self,$testId) = @_; - - #search through list for test ID - my $retVal="FALSE"; - - if ($DEBUG) { - print ("here 2 Id $self->{_foundList} \n"); - } - if ($self->{_foundList} eq "FALSE"){ - if ($DEBUG) { - print ("returning early Id \n"); - } - return $retVal; - } - - my $failType; - my $text; - foreach my $tL (@testList) { - my %tAtts = $tL->get_attributes(); - my $tid=$tAtts{'testId'}; - if ($DEBUG) { - print ("_seachExpectedFail Id $tid $testId \n"); - } - if ($tid eq $testId) { - if ($DEBUG) { - print ("here Id \n"); - } - #~# found the test we're looking for - $text=$tL->get_text(); - $failType=$tAtts{'failType'}; - if ($failType eq "xFail"){ - $retVal="TRUE"; - } - } - } - return ($retVal,$text); -} - -############################################################################## -# -############################################################################## - -=head1 _readXml - -reads the xml file for a particular machine, compiler, test type and (compare -| generate) setup and saves it in memory for searching by _searchExpectedFail. - -_readXml takes no arguments - -returns: nothing - -=cut - -############################################################################## -# -############################################################################## -sub _readXml -{ - my ( $self ) = @_; - - #Figure out where configure directory is and where can use the XML/Lite module from - my $ProgName; - ($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program - my $ProgDir = $1; # name of directory where program lives - - my $cwd = getcwd(); # current working directory - my $cfgdir; - - if ($ProgDir) { $cfgdir = $ProgDir; } - else { $cfgdir = $cwd; } - - #----------------------------------------------------------------------------------------------- - # Add $cfgdir to the list of paths that Perl searches for modules - my @dirs = ( $cfgdir, "$cfgdir/perl5lib", - "$cfgdir/../../cime/utils/perl5lib", - "$cfgdir/../../../cime/utils/perl5lib" - ); - unshift @INC, @dirs; - my $result = eval "require XML::Lite"; - if ( ! defined($result) ) { - die <<"EOF"; - ** Cannot find perl module \"XML/Lite.pm\" from directories: @dirs ** -EOF - } - - #----------------------------------------------------------------------------------------------- - - my ($machine,$compiler)=_getMachInfo(); - - my $testType=$self->_getTestType($self->{_callingName}); - - - my $xmlFile=undef; - if ($testType eq "clmInteractive" || $testType eq "clmBatch") { - $xmlFile = "$cfgdir/expectedClmTestFails.xml"; - } elsif ($testType eq "namelistTest") { - $xmlFile = "xFail/expectedClmTestFails.xml"; - } else { - $xmlFile = "xFail/expectedClmTestFails.xml"; - } - my $xml = XML::Lite->new($xmlFile); - - my $root = $xml->root_element(); - - if ($DEBUG) { - print "_readXml $self->{_callingName}\n"; - print "_readXml $self->{_compareGenerate}\n"; - print "_readXml $xmlFile \n"; - print ("_readXml Debug testType $testType \n"); - print ("_readXml Debug machine $machine \n"); - print ("_readXml Debug compiler $compiler \n"); - } - - # Check for valid root node - my $name = $root->get_name(); - $name eq "expectedFails" or die - "readExpectedFail.pm::_readXml :: $xmlFile is not a file that contains expected test failures\n"; - - my @e = $xml->elements_by_name($testType); - - $self->{_foundList}="FALSE"; - - ### populate list of tests for a specfic test type, machine and compiler - ### there's got to be a better way to write this - while ( my $e = shift @e ) { - my @mChildren = $e->get_children(); - foreach my $mChild (@mChildren) { - my $mName=$mChild->get_name(); - if ($mName eq $machine){ - my @cChildren = $mChild->get_children(); - foreach my $cChild (@cChildren) { - my $cName=$cChild->get_name(); - if ($cName eq $compiler) { - my @cgChildren=$cChild->get_children(); - foreach my $cgChild (@cgChildren) { - my $cgName=$cgChild->get_name(); - if($cgName eq $self->{_compareGenerate}){ - @testList=$cgChild->get_children(); - $self->{_foundList}="TRUE"; - last; - } - } - } - } - } - } - } - if ($DEBUG) { - print ("here 1 $self->{_foundList} \n"); - } -} - -############################################################################## -# -############################################################################## - -=head1 _testNowPassing - -reads the xml file for a particular machine, compiler, test type and (compare -| generate) setup and saves it in memory for searching by _searchExpectedFail. - -_testNowPassing takes three arguments: - $id - test id to print out - $retVal - TRUE or FALSE. Was the id found in the expected fail list - $xmlText - text from the XML notes section of the file. (Currently not used, - may be used in future). - - returns: a text string - -=cut - -############################################################################## -# -############################################################################## -sub _testNowPassing -{ - - my ($self, $id, $retVal, $xmlText) = @_ ; - my $text=undef; - - if ($retVal eq "TRUE") { - #_# found a test that passes now, but is listed as an xFail - $text = "\n"; - - } else { - #_# this test passes and was not previously listed as an xFail - #_# noOp - } - - return $text; -} - -############################################################################## -# -############################################################################## - -=head1 _printOutput - -method that prints output for status files. - -_printOutput takes four arguments: - $report - PASS,FAIL,xFAIL - $testId - test id to print out - $testReason - for xFAIL and new PASSES, additional reporting - @testName - test description from original test - - returns: a text string - -=cut - -############################################################################## -# -############################################################################## -sub _printOutput -{ - - my ($self, $report, $testId, $testReason, @testName) = @_ ; - - #_# print out the test results - my $num=sprintf("%03d", $self->{_numericalTestId}); - my $totNum=sprintf("%03d", $self->{_totTests}); - print ("$num/$totNum <$report> $testReason \n"); - -} - -############################################################################## -# -############################################################################## - -=head1 _getTestType - -method that takes the name of the calling script and returns the type of -test. Used for searching the expected fail list. - -_getTestType takes four arguments: - $name - name of calling script - - returns: $type, the type of test - -=cut - -############################################################################## -# -############################################################################## -sub _getTestType -{ - - my ($self, $name) = @_ ; - - if($DEBUG){ - print ("_getTestType $name"); - } - - my %testTypes = ( - "build-namelist_test.pl" => "namelistTest", - "test_driver.sh-i" => "clmInteractive", - "test_driver.sh" => "clmBatch", - "clm-cesm.sh" => "cesm" - ); - - my $type = $testTypes {lc $name} || "unknown"; - return $type; - -} - -############################################################################## -# -############################################################################## - -=head1 _getMachInfo - -method that figures out on what platform this is running and returns a 2 digit -machine identifier and the compiler. This will eventually contain multiple -compiler for various machines. - -_getMachInfo takes no arguments - - returns: $mach - the machine I'm running on - $comp - the compiler being used - -=cut - -############################################################################## -# -############################################################################## -sub _getMachInfo -{ - - my $name=`uname -n`; - $name = substr($name, 0, 2); - - my %machNames = ( - "ys" => "yellowstone", - "fr" => "frankfurt" - ); - - my %compNames = ( - "ys" => "INTEL", - "fr" => "INTEL" - ); - - my $mach = $machNames {lc $name} || "unknown"; - my $comp = $compNames {lc $name} || "unknown"; - - return ($mach,$comp); - -} - -# A Perl module must end with a true value or else it is considered not to -# have loaded. By convention this value is usually 1 though it can be -# any true value. A module can end with false to indicate failure but -# this is rarely used and it would instead die() (exit with an error). -1; diff --git a/bld/unit_testers/xFail/wrapClmTests.pl b/bld/unit_testers/xFail/wrapClmTests.pl deleted file mode 100755 index 28238b9d5d..0000000000 --- a/bld/unit_testers/xFail/wrapClmTests.pl +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env perl - -#-# ========================================================================================= - -=head1 wrapClmTest.pl - -=head1 Overview - -This is a wrapper script that is called from test_driver.sh for either interactive or batch -tests. It calls the CTOR for the xFail::expectedFail.pm module and also parses the td*.status -file to create a new file with xFails listed. - -It takes the following arguments: - - numberOfTests -> number of tests from test_driver.sh - statusFile -> name of the td..status file - callingScript -> name of script calling this. For test_driver.sh it may be one of: - 1) test_driver.sh-i for interactive tests - 2) test_driver.sh for batch tests - -=head1 Notes - -This script may be run standalone which is useful for testing purposes. - -=cut - -#-# ========================================================================================= - -use strict; -use Getopt::Long; -use English; -use Cwd; -use Scalar::Util qw(looks_like_number); - -my $DEBUG=0; - -sub usage { - die < 0, - numberOfTests => undef, - statusFile => undef, - callingScript => undef, - ); - -GetOptions( - "h|help" => \$opts{'help'}, - "numberOfTests=s" => \$opts{'numberOfTests'}, - "statusFile=s" => \$opts{'statusFile'}, - "callingScript=s" => \$opts{'callingScript'}, -) or usage(); - -# Give usage message. -usage() if $opts{'help'}; - -my $statFoo = undef; -my $nTests = undef; -my $script= undef; - -if (defined($opts{'statusFile'})) { - $statFoo = $opts{'statusFile'}; -} -if (defined($opts{'numberOfTests'})) { - $nTests = $opts{'numberOfTests'}; -} -if (defined($opts{'callingScript'})) { - $script = $opts{'callingScript'}; -} - -my ( $self ) = @_; - -#Figure out where configure directory is and where can use the XML/Lite module from -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program -my $ProgDir = $1; # name of directory where program lives - -my $cwd = getcwd(); # current working directory -my $cfgdir; - -if ($ProgDir) { $cfgdir = $ProgDir; } -else { $cfgdir = $cwd; } - -#----------------------------------------------------------------------------------------------- -# Add $cfgdir to the list of paths that Perl searches for modules -#----------------------------------------------------------------------------------------------- -my @dirs = ( $cfgdir, - "$cfgdir/../", - "$cfgdir/../../../../../cime/utils/perl5lib"); -unshift @INC, @dirs; -my $result = eval "require expectedFail"; -if ( ! defined($result) ) { - die <<"EOF"; -** Cannot find perl module \"xFail/expectedFail.pm\" from directories: @dirs ** -EOF -} - -#_# ==================================== -#_# setup work complete. Now parse file -#_# ==================================== - -if ($DEBUG) { - print (" wrapClmTests.pl:: calling script $script \n"); - print (" wrapClmTests.pl:: number of tests $nTests \n"); - print (" wrapClmTests.pl:: processing $statFoo \n"); -} - -#_# compGen not used for CLM batch or interactive tests, but we use "compare" as the default in this case -my $compGen="compare"; -my $xFail = xFail::expectedFail->new($script,$compGen,$nTests); - -$xFail->parseOutputCLM($statFoo); - -exit(0); diff --git a/manage_externals/checkout_externals b/checkout_externals similarity index 100% rename from manage_externals/checkout_externals rename to checkout_externals diff --git a/cime_config/SystemTests/lii.py b/cime_config/SystemTests/lii.py deleted file mode 100644 index 0bf371ee9a..0000000000 --- a/cime_config/SystemTests/lii.py +++ /dev/null @@ -1,56 +0,0 @@ -""" -Implementation of the CIME LII test. - -This is a CLM specific test: -Verifies that interpolation of initial conditions onto an identical -configuration gives identical results: -(1) do a run with use_init_interp true (suffix base) -(2) do a run with use_init_interp false (suffix no_interp) - -It is more intuitive to think of the no_interp test as the "base". However, we -do the use_init_interp=true test first to facilitate updating initial conditions -whenever this is necessary, as documented below. - -The LII test needs to point to an initial conditions file that is compatible -with the given model configuration. Thus, the pointed-to initial conditions file -needs to be updated whenever surface datasets are changed, or the land-mask is -changed, or an imporant change is made to model physics (for example where new -fields are added to the restart file). The procedure for updating the initial -conditions files used by the LII test is as follows: - -(1) Run the LII test; the 'base' case should run to completion even if the -no_interp test fails. - -(2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata -space. Rename this to be similar to the name of the file pointed to in this -test's user_nl_clm file, but with a new creation date. - -(3) Update this test's user_nl_clm file (in the appropriate testmods directory) -to point to the new finidat file. -""" - -from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files - -logger = logging.getLogger(__name__) - -class LII(SystemTestsCompareTwo): - - def __init__(self, case): - SystemTestsCompareTwo.__init__(self, case, - separate_builds = False, - run_two_suffix = 'no_interp', - run_one_description = 'use_init_interp set to true', - run_two_description = 'use_init_interp set to false') - - def _case_one_setup(self): - append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", - contents = "use_init_interp = .true.") - - def _case_two_setup(self): - append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", - contents = "use_init_interp = .false.") - diff --git a/cime_config/SystemTests/lii2finidatareas.py b/cime_config/SystemTests/lii2finidatareas.py deleted file mode 100644 index 21ba082fff..0000000000 --- a/cime_config/SystemTests/lii2finidatareas.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -Implementation of the LII2FINIDATAREAS test. - -This is similar to the LII test, but tests init_interp with mode -'use_finidat_areas'. - -As with the standard LII test, this must be used in a configuration for -which we have a compatible out-of-the-box finidat file (so that the run -with use_init_interp = .false. runs successfully). In constrast to our -standard LII test (which uses glcMEC_spunup_1way), this one can use a -standard CISM2%NOEVOLVE configuration: we do *not* need to set -GLC_TWO_WAY_COUPLING=FALSE; in fact, it's a better test if we have -GLC_TWO_WAY_COUPLING=TRUE: with this mode of operation, areas should -match between the two runs. - -It may not be totally necessary to have a system test covering this -init_interp_method: between unit tests and inline checks, we have quite -a bit of testing of this code. It's important to have at least one LII -test to make sure we're interpolating all the fields we're supposed to -interpolate, but we don't necessarily need a LII test with this mode of -operation as long as we have one with the general mode of operation. - -However, this test is a good check that every point has a unique type -(because this mode of operation will fail if that's not the case); this -is something needed even for the 'general' init_interp method to work -correctly, but the 'general' mode won't catch problems in this regard. - -One other reason why this test is useful is to cover the threading -directives in the set_single_match routine, since those aren't covered -by unit tests. So this test mod should be used in a test with threading. - -To update the initial conditions (finidat) file for this test: - -(1) Run the test; the 'base' case should run to completion even if the -no_interp test fails. (If the 'base' case fails, you may need to retry -with init_interp_method='general'.) - -(2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata -space. Rename this to be similar to the out-of-the-box finidat file -currently used by this test, but with a new creation date. - -(3) Update namelist defaults to point to the new finidat file. If -updating the out-of-the-box file is not desired, then you could instead -point to this new finidat file with a user_nl_clm file in this testmod. -""" - -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files - -# We can import lii directly because the SystemTests directory has been -# added to sys.path. -# -# A cleaner and more general way to accomplish this would be: In cime: -# Rather than adding the SystemTests directory to sys.path and then -# importing an individual module from there: instead, allow each -# component to have a COMPNAME_pylib directory within its cime_config, -# and then have cime add each component's cime_config directory to -# sys.path and then do something like: -# import_module("COMPNAME_pylib.SystemTests.TESTNAME"). Then, for -# example, ctsm could access its own modules via "import -# ctsm_pylib.foo", or (in this case) "from ctsm_pylib.SystemTests.lii -# import LII". -from lii import LII - -logger = logging.getLogger(__name__) - -class LII2FINIDATAREAS(LII): - - def __init__(self, case): - super(LII2FINIDATAREAS, self).__init__(case) - - def _case_one_setup(self): - super(LII2FINIDATAREAS, self)._case_one_setup() - append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", - contents = "init_interp_method = 'use_finidat_areas'") diff --git a/cime_config/SystemTests/lvg.py b/cime_config/SystemTests/lvg.py deleted file mode 100644 index 36fae196b2..0000000000 --- a/cime_config/SystemTests/lvg.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -Implementation of the CIME LVG (Land Virtual Glacier) test. - -This is a CLM specific test: -Verifies that adding virtual glacier columns doesn't change answers -(1) do a run with the standard set of virtual columns (suffix base) -(2) add virtual columns over Antarctica (suffix more_virtual) - -This will only pass if there are no column or patch-level outputs in CLM's -history files. -""" - -from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files - -logger = logging.getLogger(__name__) - -class LVG(SystemTestsCompareTwo): - - def __init__(self, case): - SystemTestsCompareTwo.__init__(self, case, - separate_builds = False, - run_two_suffix = 'more_virtual', - run_one_description = 'standard set of virtual columns', - run_two_description = 'add virtual columns over Antarctica') - - def _case_one_setup(self): - append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", - contents = "glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'multiple'") - - def _case_two_setup(self): - append_to_user_nl_files(caseroot = self._get_caseroot(), - component = "clm", - contents = "glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'virtual'") - diff --git a/cime_config/SystemTests/ssp.py b/cime_config/SystemTests/ssp.py deleted file mode 100644 index a2aacc9e43..0000000000 --- a/cime_config/SystemTests/ssp.py +++ /dev/null @@ -1,100 +0,0 @@ -""" -Implementation of the CIME SSP test. This class inherits from SystemTestsCommon - -This is a CLM specific test: -Verifies that spinup works correctly -this test is only valid for CLM compsets with CLM45 or CLM50 -(1) do an initial spin test - - set CLM_ACCELERATED_SPINUP to on - - write restarts at the end of the run, turn on short term archiving - - turn MOSART off -(2) do a hybrid non-spinup simulation run - - start from the restart files generated in (1) - - turn MOSART off -""" -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.system_tests_common import SystemTestsCommon -import shutil, glob, os - -logger = logging.getLogger(__name__) - -class SSP(SystemTestsCommon): - - def __init__(self, case): - """ - initialize an object interface to the SSP system test - """ - SystemTestsCommon.__init__(self, case) - rof = self._case.get_value("COMP_ROF") - expect(rof == "mosart", "ERROR: SSP test requires that ROF component be mosart") - - def run_phase(self): - caseroot = self._case.get_value("CASEROOT") - orig_case = self._case - orig_casevar = self._case.get_value("CASE") - - # clone the main case to create ref1 - clone_path = "{}.ref1".format(caseroot) - if os.path.exists(clone_path): - shutil.rmtree(clone_path) - clone = self._case.create_clone(clone_path, keepexe=True) - - # determine run lengths needed below - stop_nf = self._case.get_value("STOP_N") - stop_n1 = stop_nf / 2 - stop_n2 = stop_nf - stop_n1 - - #------------------------------------------------------------------- - # (1) do a spinup run in the main case in the cloned ref case - # (short term archiving is on) - #------------------------------------------------------------------- - os.chdir(clone_path) - self._set_active_case(clone) - - logger.info("startup: doing a {} {} 00000 seconds startup run".format(stop_n1, stop_nf)) - logger.info(" writing restarts at end of run") - logger.info(" short term archiving is on ") - - clone.set_value("CLM_ACCELERATED_SPINUP", "on") - clone.set_value("MOSART_MODE", "NULL") - clone.set_value("STOP_N",stop_n1) - clone.flush() - - dout_sr = clone.get_value("DOUT_S_ROOT") - # No history files expected, set suffix=None to avoid compare error - self._skip_pnl = False - self.run_indv(suffix=None, st_archive=True) - - #------------------------------------------------------------------- - # (2) do a hybrid, non-spinup run in orig_case - #------------------------------------------------------------------- - os.chdir(caseroot) - self._set_active_case(orig_case) - - refdate = run_cmd_no_fail(r'ls -1dt {}/rest/*-00000* | head -1 | sed "s/-00000.*//" | sed "s/^.*rest\///"'.format(dout_sr)) - refsec = "00000" - - # obtain rpointer files and necessary restart files from short term archiving directory - rundir = self._case.get_value("RUNDIR") - - rest_path = os.path.join(dout_sr, "rest", "{}-{}".format(refdate, refsec)) - - for item in glob.glob("{}/*{}*".format(rest_path, refdate)): - os.symlink(item, os.path.join(rundir, os.path.basename(item))) - - for item in glob.glob("{}/*rpointer*".format(rest_path)): - shutil.copy(item, rundir) - - self._case.set_value("CLM_ACCELERATED_SPINUP", "off") - self._case.set_value("RUN_TYPE", "hybrid") - self._case.set_value("GET_REFCASE", False) - self._case.set_value("RUN_REFCASE", "{}.ref1".format(orig_casevar)) - self._case.set_value("MOSART_MODE", "NULL") - - self._case.set_value("RUN_REFDATE", refdate) - self._case.set_value("STOP_N", stop_n2) - self._case.set_value("DOUT_S", False) - self._case.flush() - - # do the restart run (short term archiving is off) - self.run_indv() diff --git a/cime_config/buildcpp b/cime_config/buildcpp deleted file mode 100644 index 7a3bf0083e..0000000000 --- a/cime_config/buildcpp +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python - -""" -API for clm's configure -""" - -from CIME.XML.standard_module_setup import * -from CIME.utils import run_cmd_no_fail, expect - -import glob, shutil -logger = logging.getLogger(__name__) - -def buildcpp(case): - """ - Invoke clm configure ONLY for clm4_0 - output goes in `caseroot`/Buildconf/camconf - """ - - caseroot = case.get_value("CASEROOT") - cimeroot = case.get_value("CIMEROOT") - lnd_root = case.get_value("COMP_ROOT_DIR_LND") - lnd_grid = case.get_value("LND_GRID") - mask_grid = case.get_value("MASK_GRID") - clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") - clm_config_opts = case.get_value("CLM_CONFIG_OPTS") - compset = case.get_value("COMPSET") - - if mask_grid == "reg" and lnd_grid != "CLM_USRDAT": - config_opts = "-sitespf_pt $lnd_grid" - else: - config_opts = "" - - if "1PT" in compset: - config_opts = " -sitespf_pt reg" - - clmconf = os.path.join(caseroot, "Buildconf", "clmconf") - if not os.path.isdir(clmconf): - os.makedirs(clmconf) - - cmd = os.path.join(lnd_root,"bld","configure") - command = "%s -cimeroot %s %s %s -usr_src %s -comp_intf mct " \ - %(cmd, cimeroot, config_opts, clm_config_opts, os.path.join(caseroot,"SourceMods","src.clm")) - - run_cmd_no_fail(command, from_dir=clmconf) - - # determine cppdefs - caseroot/clmconf/CESM_cppdefs is created by the call to configure - with open(os.path.join(clmconf, "CESM_cppdefs"), 'r') as f: - user_cppdefs = f.readline().rstrip() - if user_cppdefs: - case.set_value("CLM_CPPDEFS", user_cppdefs) - case.flush() - - return user_cppdefs diff --git a/cime_config/buildlib b/cime_config/buildlib deleted file mode 100755 index 6b86bb0b65..0000000000 --- a/cime_config/buildlib +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python - -""" -build clm library -""" -import sys, os, time, filecmp, shutil, imp - -_CIMEROOT = os.environ.get("CIMEROOT") -if _CIMEROOT is None: - raise SystemExit("ERROR: must set CIMEROOT environment variable") - -_LIBDIR = os.path.join(_CIMEROOT, "scripts", "Tools") -sys.path.append(_LIBDIR) - -from standard_script_setup import * -from CIME.buildlib import parse_input -from CIME.case import Case -from CIME.utils import run_cmd, expect - -logger = logging.getLogger(__name__) - -############################################################################### -def _main_func(): -############################################################################### - - caseroot, libroot, bldroot = parse_input(sys.argv) - - with Case(caseroot) as case: - - casetools = case.get_value("CASETOOLS") - lnd_root = case.get_value("COMP_ROOT_DIR_LND") - gmake_j = case.get_value("GMAKE_J") - gmake = case.get_value("GMAKE") - mach = case.get_value("MACH") - - clm_config_opts = case.get_value("CLM_CONFIG_OPTS") - if "clm4_5" in clm_config_opts: - clm_phys = "clm4_5" - elif "clm5_0" in clm_config_opts: - clm_phys = "clm5_0" - elif "clm4_0" in clm_config_opts: - clm_phys = "clm4_0" - else: - expect(False, "CLM_CONFIG_OPTS must support either clm4_5, clm5_0, or clm4_0 physics") - - if clm_phys == "clm4_0": - #------------------------------------------------------- - # create Filepath file and clm_cppdefs for clm4_0 - #------------------------------------------------------- - # the call to configure here creates BOTH the Filepath file and the clm_cppdefs - cmd = os.path.join(os.path.join(lnd_root,"cime_config","buildcpp")) - logger.info(" ...calling clm buildcpp to set build time options") - try: - mod = imp.load_source("buildcpp", cmd) - clm_cppdefs = mod.buildcpp(case) - except: - raise - - # the above call to buildcpp generates the Filepath file - if not os.path.isfile(os.path.join(bldroot, "Filepath")): - filesrc = os.path.join(caseroot, "Buildconf", "clmconf", "Filepath") - filedst = os.path.join(bldroot, "Filepath") - shutil.copy(filesrc,filedst) - - else: - #------------------------------------------------------- - # create Filepath file for clm4_5 or clm5_0 - #------------------------------------------------------- - filepath_file = os.path.join(bldroot,"Filepath") - if not os.path.isfile(filepath_file): - caseroot = case.get_value("CASEROOT") - paths = [os.path.join(caseroot,"SourceMods","src.clm"), - os.path.join(lnd_root,"src","main"), - os.path.join(lnd_root,"src","biogeophys"), - os.path.join(lnd_root,"src","biogeochem"), - os.path.join(lnd_root,"src","soilbiogeochem"), - os.path.join(lnd_root,"src","dyn_subgrid"), - os.path.join(lnd_root,"src","init_interp"), - os.path.join(lnd_root,"src","fates"), - os.path.join(lnd_root,"src","fates","main"), - os.path.join(lnd_root,"src","fates","biogeophys"), - os.path.join(lnd_root,"src","fates","biogeochem"), - os.path.join(lnd_root,"src","fates","fire"), - os.path.join(lnd_root,"src","utils"), - os.path.join(lnd_root,"src","cpl")] - with open(filepath_file, "w") as filepath: - filepath.write("\n".join(paths)) - filepath.write("\n") - - #------------------------------------------------------- - # create the library in libroot - #------------------------------------------------------- - - clm_config_opts = case.get_value("CLM_CONFIG_OPTS") - if clm_phys == "clm4_0": - complib = os.path.join(libroot,"liblnd.a") - else: - complib = os.path.join(libroot,"libclm.a") - makefile = os.path.join(casetools, "Makefile") - macfile = os.path.join(caseroot, "Macros.%s" % mach) - - if clm_phys == "clm4_0": - cmd = "%s complib -j %d MODEL=clm COMPLIB=%s -f %s MACFILE=%s USER_CPPDEFS='%s'" \ - % (gmake, gmake_j, complib, makefile, macfile, clm_cppdefs ) - else: - cmd = "%s complib -j %d MODEL=clm COMPLIB=%s -f %s MACFILE=%s " \ - % (gmake, gmake_j, complib, makefile, macfile ) - - rc, out, err = run_cmd(cmd) - logger.info("%s: \n\n output:\n %s \n\n err:\n\n%s\n"%(cmd,out,err)) - expect(rc == 0, "Command %s failed with rc=%s" % (cmd, rc)) - -############################################################################### - -if __name__ == "__main__": - _main_func() - diff --git a/cime_config/buildnml b/cime_config/buildnml deleted file mode 100755 index 73855da4dd..0000000000 --- a/cime_config/buildnml +++ /dev/null @@ -1,272 +0,0 @@ -#!/usr/bin/env python - -""" -CLM namelist creator -""" -import sys, os, time, shutil, re, imp, filecmp - -_CIMEROOT = os.environ.get("CIMEROOT") -if _CIMEROOT is None: - raise SystemExit("ERROR: must set CIMEROOT environment variable") - -_LIBDIR = os.path.join(_CIMEROOT, "scripts", "Tools") -sys.path.append(_LIBDIR) - -from standard_script_setup import * -from CIME.buildnml import create_namelist_infile, parse_input -from CIME.case import Case -from CIME.utils import expect, run_cmd - -logger = logging.getLogger(__name__) - -_config_cache_template = """ - - - -Specifies clm physics - -""" - -############################################################################### -def buildnml(case, caseroot, compname): -############################################################################### - """Build the clm namelist """ - - # Build the component namelist - if compname != "clm": - raise AttributeError - - lnd_root = case.get_value("COMP_ROOT_DIR_LND") - din_loc_root = case.get_value("DIN_LOC_ROOT") - ccsm_co2_ppmv = case.get_value("CCSM_CO2_PPMV") - clm_co2_type = case.get_value("CLM_CO2_TYPE") - clm_namelist_opts = case.get_value("CLM_NAMELIST_OPTS") - clm_bldnml_opts = case.get_value("CLM_BLDNML_OPTS") - clm_nml_use_case = case.get_value("CLM_NML_USE_CASE") - clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART") - lnd_tuning_mode = case.get_value("LND_TUNING_MODE") - clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP") - comp_glc = case.get_value("COMP_GLC") - comp_atm = case.get_value("COMP_ATM") - lnd_grid = case.get_value("LND_GRID") - lnd_ncpl = case.get_value("LND_NCPL") - lnd_domain_path = case.get_value("LND_DOMAIN_PATH") - lnd_domain_file = case.get_value("LND_DOMAIN_FILE") - ninst_lnd = case.get_value("NINST_LND") - rundir = case.get_value("RUNDIR") - run_type = case.get_value("RUN_TYPE") - run_startdate = case.get_value("RUN_STARTDATE") - run_refcase = case.get_value("RUN_REFCASE") - run_refdate = case.get_value("RUN_REFDATE") - run_reftod = case.get_value("RUN_REFTOD") - glc_nec = case.get_value("GLC_NEC") - mask = case.get_value("MASK_GRID") - - # ----------------------------------------------------- - # Clear out old data - # ----------------------------------------------------- - - input_data_list = os.path.join(caseroot,"Buildconf","clm.input_data_list") - if os.path.exists(input_data_list): - os.remove(input_data_list) - - # ----------------------------------------------------- - # Set clmconf - # ----------------------------------------------------- - - clmconf = os.path.join(caseroot, "Buildconf", "clmconf") - if not os.path.isdir(clmconf): - os.makedirs(clmconf) - - # ----------------------------------------------------- - # Create config_cache.xml file - # ----------------------------------------------------- - - # Note that build-namelist utilizes the contents of the config_cache.xml file in - # the namelist_defaults.xml file to obtain namelist variables - - clm_config_opts = case.get_value("CLM_CONFIG_OPTS") - if "clm4_5" in clm_config_opts: - clm_phys = "clm4_5" - elif "clm5_0" in clm_config_opts: - clm_phys = "clm5_0" - elif "clm4_0" in clm_config_opts: - clm_phys = "clm4_0" - else: - expect(False, "CLM_CONFIG_OPTS must support either clm4_5, clm5_0, or clm4_0 physics") - - if clm_phys == "clm4_0": - # call buildcpp to obtain clm_cppdefs if it is not set in env_build.xml - call_buildcpp = False - if not os.path.exists(os.path.join(caseroot,"LockedFiles","env_build.xml")): - call_buildcpp = True - else: - file1 = os.path.join(caseroot,"env_build.xml") - file2 = os.path.join(caseroot,"LockedFiles","env_build.xml") - if not filecmp.cmp(file1, file2): - call_buildcpp = True - if call_buildcpp: - cmd = os.path.join(os.path.join(lnd_root,"cime_config","buildcpp")) - logger.info(" ...calling clm buildcpp to set build time options") - try: - mod = imp.load_source("buildcpp", cmd) - mod.buildcpp(case) - except: - raise - else: - config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", "clmconf", "config_cache.xml") - with open(config_cache_path, 'w') as config_cache_file: - config_cache_file.write(config_cache_text) - - # ----------------------------------------------------- - # Determine input arguments into build-namelist - # ----------------------------------------------------- - - startfile_type = "finidat" - start_type = "default" - if run_type == "hybrid": - start_type = "startup" - elif run_type != "startup": - start_type = run_type - - if run_type == "branch": - startfile_type = "nrevsn" - if clm_force_coldstart == "on": - clm_force_coldstart = "off" - logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" + - " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning" - ) - - if (clm_force_coldstart == "on"): - logger.warning( "WARNING: CLM is starting up from a cold state" ) - start_type = "cold" - - if lnd_grid == 'T31': - lnd_grid = '48x96' - if lnd_grid == 'T42': - lnd_grid = '64x128' - if lnd_grid == 'T85': - lnd_grid = '128x256' - if lnd_grid == 'T341': - lnd_grid = '512x1024' - - clmusr = "" - if lnd_grid == "CLM_USRDAT": - clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") - lnd_grid = clm_usrdat_name - clmusr = " -clm_usr_name %s "%clm_usrdat_name - - if comp_atm != "datm": - nomeg = "-no-megan" - else: - nomeg = "" - - if clm_nml_use_case != "UNSET": - usecase = "-use_case %s" %clm_nml_use_case - else: - usecase = "" - - if ( (mask != "null") and (mask != "UNSET") ): - gridmask = "-mask %s" %mask - else: - gridmask = "" - - start_ymd = run_startdate.replace('-','') - - if ('-01-01' in run_startdate) or ('-09-01' in run_startdate): - ignore = "-ignore_ic_year" - else: - ignore = "-ignore_ic_date" - - tuning = "-lnd_tuning_mode %s "%lnd_tuning_mode - - spinup = "-clm_accelerated_spinup %s "%clm_accelerated_spinup - - infile = os.path.join(clmconf, "namelist") - - inputdata_file = os.path.join(caseroot,"Buildconf","clm.input_data_list") - - lndfrac_file = os.path.join(lnd_domain_path,lnd_domain_file) - - config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml") - - # ----------------------------------------------------- - # loop over instances - # ----------------------------------------------------- - - ninst = int(ninst_lnd) - for inst_counter in range(1, ninst+1): - - # determine instance string - inst_string = "" - if ninst > 1: - inst_string = '_' + '%04d' % inst_counter - - # If multi-instance case does not have restart file, use - # single-case restart for each instance - rpointer = "rpointer.lnd" - if (os.path.isfile(os.path.join(rundir,rpointer)) and - (not os.path.isfile(os.path.join(rundir,rpointer + inst_string)))): - shutil.copy(os.path.join(rundir, rpointer), - os.path.join(rundir, rpointer + inst_string)) - - # ----------------------------------------------------- - # call build-namelist - # ----------------------------------------------------- - - if run_type == "hybrid" or run_type == "branch": - clm_startfile = "%s.clm2%s.r.%s-%s.nc"%(run_refcase,inst_string,run_refdate,run_reftod) - if not os.path.exists(os.path.join(rundir, clm_startfile)): - clm_startfile = "%s.clm2.r.%s-%s.nc"%(run_refcase,run_refdate,run_reftod) - clm_icfile = "%s = \'%s\'"%(startfile_type, clm_startfile) - else: - clm_icfile = "" - - infile_lines = [] - infile_lines.append(clm_icfile) - - user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) - namelist_infile = os.path.join(clmconf, "namelist") - - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) - - cmd = os.path.join(lnd_root,"bld","build-namelist") - - command = ("%s -cimeroot %s -infile %s -csmdata %s -inputdata %s %s -namelist \"&clm_inparm start_ymd=%s %s/ \" " - "%s %s -res %s %s -clm_start_type %s -envxml_dir %s -l_ncpl %s " - "-lnd_frac %s -glc_nec %s -co2_ppmv %s -co2_type %s -config %s " - "%s %s %s %s" - %(cmd, _CIMEROOT, infile, din_loc_root, inputdata_file, ignore, start_ymd, clm_namelist_opts, - nomeg, usecase, lnd_grid, clmusr, start_type, caseroot, lnd_ncpl, - lndfrac_file, glc_nec, ccsm_co2_ppmv, clm_co2_type, config_cache_file, - clm_bldnml_opts, spinup, tuning, gridmask)) - - rc, out, err = run_cmd(command, from_dir=clmconf) - expect(rc==0,"Command %s failed rc=%d\nout=%s\nerr=%s"%(cmd,rc,out,err)) - if out is not None: - logger.debug(" %s"%out) - if err is not None: - logger.debug(" %s"%err) - - # ----------------------------------------------------- - # copy resolved namelist to rundir - # ----------------------------------------------------- - - if os.path.isdir(rundir): - file1 = os.path.join(clmconf, "lnd_in") - file2 = os.path.join(rundir, "lnd_in") - if ninst > 1: - file2 += inst_string - logger.debug("CLM namelist copy: file1 %s file2 %s " %(file1, file2)) - shutil.copy(file1,file2) - -############################################################################### -def _main_func(): - - caseroot = parse_input(sys.argv) - with Case(caseroot) as case: - buildnml(case, caseroot, "clm") - -if __name__ == "__main__": - _main_func() diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml deleted file mode 100644 index bd95959f94..0000000000 --- a/cime_config/config_component.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - - - - - clm4.0: - clm4.5: - clm5.0: - Satellite phenology: - CN: Carbon Nitrogen model - CNDV: CN with Dynamic Vegetation - CN with prognostic crop: - CNDV with prognostic crop: - - Satellite phenology with VIC hydrology: - BGC (vert. resol. CN and methane): - BGC (vert. resol. CN and methane) with prognostic crop: - FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental) - BGC (vert. resol. CN and methane) with dynamic vegetation: - BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop: - - - - char - clm - clm - case_comp - env_case.xml - Name of land component - - - - char - - UNSET - build_component_cam - env_build.xml - CLM cpp definitions (if-any) (setup automatically - DO NOT EDIT) - - - - char - run_component_clm - env_run.xml - Tuning parameters and initial conditions should be optimized for what CLM model version and what meteorlogical forcing combination? - - UNSET - clm4_0_CRUv7,clm4_0_GSWP3v1,clm5_0_cam6.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0 - - clm4_0_CRUv7 - clm4_0_CRUv7 - clm4_0_CRUv7 - clm4_0_GSWP3v1 - clm4_5_CRUv7 - clm4_5_CRUv7 - clm4_5_GSWP3v1 - clm4_5_cam6.0 - clm5_0_CRUv7 - clm5_0_CRUv7 - clm5_0_GSWP3v1 - clm5_0_cam6.0 - - - - - char - - - -phys clm4_0 - -bgc cn - -bgc cndv - -crop on - -phys clm4_5 - -phys clm5_0 - - build_component_clm - env_build.xml - Provides option(s) for the CLM configure utility. - CLM_CONFIG_OPTS are normally set as compset variables (e.g., -bgc cn) - and in general should not be modified for supported compsets. - It is recommended that if you want to modify this value for your experiment, - you should use your own user-defined component sets via using create_newcase - with a compset_file argument. - This is an advanced flag and should only be used by expert users. - - - - char - UNSET - - - 2000_control - 1850_control - 20thC_transient - 1850-2100_rcp6_transient - 1850-2100_rcp4.5_transient - 1850-2100_rcp2.6_transient - 1850-2100_rcp8.5_transient - 20thC_transient - 1850-2100_rcp4.5_transient - - run_component_clm - env_run.xml - CLM namelist use_case. - Determines the use-case that will be sent to the CLM build-namelist utility. - This is normally set by the component set. This is an advanced flag and should only be - used by expert users. - - - - - - char - - - -bgc sp - -bgc cn - -bgc bgc - -bgc cn -crop - -bgc bgc -crop - -bgc cn -dynamic_vegetation - -bgc bgc -dynamic_vegetation - -bgc cn -dynamic_vegetation -crop - -bgc bgc -dynamic_vegetation -crop - -bgc sp -vichydro - -bgc fates -no-megan - - -bgc sp - -bgc bgc - -bgc bgc -dynamic_vegetation - -bgc bgc -crop - -bgc cn - -bgc cn -crop - -bgc cn -dynamic_vegetation - -bgc cn -dynamic_vegetation -crop - -bgc bgc -dynamic_vegetation -crop - -bgc sp -vichydro - -bgc fates -no-megan - - run_component_clm - env_run.xml - CLM build-namelist options - - - - char - constant,diagnostic,prognostic - constant - - diagnostic - diagnostic - prognostic - diagnostic - diagnostic - - run_component_clm - env_run.xml - Determines how CLM will determine where CO2 is set. - If value is constant, it will be set to CCSM_CO2_PPMV, - if value is either diagnostic or prognostic, the atmosphere model - MUST send it to CLM. CLM_CO2_TYPE is normally set by the specific - compset, since it HAS to be coordinated with settings for the - atmospheric model. Do not modify this variable. If you want to modify for - your experiment, use your own user-defined component set - This is an advanced flag and should only be used by expert users. - - - - char - - run_component_clm - env_run.xml - CLM-specific namelist settings for -namelist option in the CLM - build-namelist. CLM_NAMELIST_OPTS is normally set as a compset variable - and in general should not be modified for supported compsets. - It is recommended that if you want to modify this value for your experiment, - you should use your own user-defined component sets via using create_newcase - with a compset_file argument. - This is an advanced flag and should only be used by expert users. - - - - char - on,off - off - run_component_clm - env_run.xml - Turn on any settings for accellerating the model spinup. - - - - - char - UNSET - run_component_clm - env_run.xml - Dataset name for user-created datasets. This is used as the argument - in Buildconf/clm.buildnml to build-namelist -clm_usr_name. An example of - such a dataset would be 1x1pt_boulderCO_c090722. The default value is UNSET. - This is an advanced flag and should only be used by expert users. - - - - char - on,off - off - run_component_clm - env_run.xml - Flag to the CLM build-namelist command to force CLM to do a - cold start (finidat will be set to blanks). - A value of on forces the model to spin up from a cold-start - (arbitrary initial conditions). Setting this value in the xml file will take - precedence over any settings for finidat in the $CASEROOT/user_clm_clm file. - - - - ========================================= - CLM naming conventions - ========================================= - note: [^_]* means match zero or more of any character BUT an underbar. - (in other words make sure there is NOT a underbar before the string afterwards) - - - diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml deleted file mode 100644 index c628110a9c..0000000000 --- a/cime_config/config_compsets.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - - - ========================================= - compset naming convention - ========================================= - The compset longname below has the specified order - atm, lnd, ice, ocn, river, glc wave cesm-options - - The notation for the compset longname is - TIME_ATM[%phys]_LND[%phys]_ICE[%phys]_OCN[%phys]_ROF[%phys]_GLC[%phys]_WAV[%phys][_BGC%phys] - Where for the CAM specific compsets below the following is supported - TIME = Time period (e.g. 2000, HIST, RCP8...) - ATM = [CAM40, CAM50, CAM55] - LND = [CLM40, CLM45, CLM50, SLND] - ICE = [CICE, DICE, SICE] - OCN = [DOCN, ,AQUAP, SOCN] - ROF = [RTM, SROF] - GLC = [CISM1, CISM2] - WAV = [SWAV] - BGC = optional BGC scenario - - The OPTIONAL %phys attributes specify submodes of the given system - For example DOCN%DOM is the data ocean model for DOCN - ALL the possible %phys choices for each component are listed - with the -list command for create_newcase - ALL data models must have a %phys option that corresponds to the data model mode - - Each compset node is associated with the following elements - - lname - - alias - - science_support (if this compset is supported scientifically with control simulations) - - - - - - I1PtClm50SpGs - 2000_DATM%1PT_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV - - - - I1PtClm45SpGs - 2000_DATM%1PT_CLM45%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - - - I2000Clm50Sp - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - I2000Clm50BgcCru - 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - I2000Clm50BgcCropRtm - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I2000Clm50BgcCrop - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - I2000Clm50Cn - 2000_DATM%GSWP3v1_CLM50%CN_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - I1850Clm50Sp - 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - I1850Clm50SpCru - 1850_DATM%CRUv7_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - I1850Clm50BgcCrop - 1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - I1850Clm50BgcCropCru - 1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - I2000Clm50SpGs - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_SGLC_SWAV - - - - - I2000Clm50BgcCropGs - 2000_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - - - - I2000Clm50BgcCruGs - 2000_DATM%CRUv7_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - - - - - I2000Clm50SpRtmFl - 2000_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_RTM%FLOOD_CISM2%NOEVOLVE_SWAV - - - - - I2000Clm50Fates - 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - I2000Clm50FatesCruGs - 2000_DATM%CRUv7_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV - - - - - I2000Clm50FatesGs - 2000_DATM%GSWP3v1_CLM50%FATES_SICE_SOCN_MOSART_SGLC_SWAV - - - - I1850Clm50Bgc - 1850_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - IHistClm50BgcCrop - HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - IHistClm50Sp - HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - IHistClm50Bgc - HIST_DATM%GSWP3v1_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - IHistClm50BgcQianGs - HIST_DATM%QIA_CLM50%BGC_SICE_SOCN_MOSART_SGLC_SWAV - - - - - IHistClm50BgcCropGs - HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_SGLC_SWAV - - - - - I2000Clm50BgcDvCrop - 2000_DATM%GSWP3v1_CLM50%BGCDV-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - I2000Clm50BgcDvCropQianGs - 2000_DATM%QIA_CLM50%BGCDV-CROP_SICE_SOCN_MOSART_SGLC_SWAV - - - - - - I1850Clm50BgcSpinup - 1850_DATM%CPLHIST_CLM50%BGC_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV - - - - - - - I1850Clm45BgcCrop - 1850_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I1850Clm45BgcCruGs - 1850_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - - - - - - - IHistClm45BgcCrop - HIST_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - - IHistClm45BgcCropQianGs - HIST_DATM%QIA_CLM45%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV - - - - I2000Clm45Sp - 2000_DATM%GSWP3v1_CLM45%SP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I2000Clm45BgcCrop - 2000_DATM%GSWP3v1_CLM45%BGC-CROP_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I2000Clm45Fates - 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - - I2000Clm45FatesGs - 2000_DATM%GSWP3v1_CLM45%FATES_SICE_SOCN_RTM_SGLC_SWAV - - - - I1850Clm45Cn - 1850_DATM%GSWP3v1_CLM45%CN_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I1850Clm45Bgc - 1850_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - I1850Clm45BgcGs - 1850_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - - - - - - I1850Clm45BgcCru - 1850_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - IHistClm45Bgc - HIST_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - IHistClm45BgcGs - HIST_DATM%GSWP3v1_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - - - - - - IHistClm45BgcCruGs - HIST_DATM%CRUv7_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV - - - - - - - I2000Clm50Vic - 2000_DATM%GSWP3v1_CLM50%SP-VIC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - I2000Clm45VicCru - 2000_DATM%CRUv7_CLM45%SP-VIC_SICE_SOCN_RTM_CISM2%NOEVOLVE_SWAV - - - - - - I1850Clm50SpG - 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV - - - - IHistClm50SpG - HIST_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV - - - - I1850Clm50BgcCropG - 1850_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV - - - - IHistClm50BgcCropG - HIST_DATM%GSWP3v1_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV - - - - - I2000Clm40SpCruGs - 2000_DATM%CRUv7_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - I1850Clm40SpCruGs - 1850_DATM%CRUv7_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - - - I1850Clm40SpGswGs - 1850_DATM%GSWP3v1_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - - - I1850Clm40CnGswGs - 1850_DATM%GSWP3v1_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV - - - - - - IHistClm40SpCruGs - HIST_DATM%CRUv7_CLM40%SP_SICE_SOCN_RTM_SGLC_SWAV - - - - IHistClm40CnGswGs - HIST_DATM%GSWP3v1_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV - - - - - - IHistClm40CnCruGs - HIST_DATM%CRUv7_CLM40%CN_SICE_SOCN_RTM_SGLC_SWAV - - - - - - - - - - - - - 1850-01-01 - 1980-01-15 - 1997-12-31 - 1993-12-01 - 1992-08-12 - 0001-08-12 - - - - - - nsteps - nsteps - nsteps - - - - - - 158 - 331 - 22772 - - - - - - diff --git a/cime_config/config_pes.xml b/cime_config/config_pes.xml deleted file mode 100644 index 4362bed475..0000000000 --- a/cime_config/config_pes.xml +++ /dev/null @@ -1,690 +0,0 @@ - - - - - - - - none - - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -1 - -9 - -9 - -9 - -9 - -9 - -9 - -9 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - - - - - - none - - -1 - -4 - -4 - -4 - -4 - -4 - -4 - -4 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - - - - - - none - - -2 - -2 - -2 - -2 - -2 - -2 - -2 - -2 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - 180 - 180 - 180 - 180 - 180 - 180 - 180 - 180 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -1 - -40 - -40 - -40 - -40 - -40 - -40 - -40 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - - - - - - none - - -4 - -4 - -4 - -4 - -4 - -4 - -4 - -4 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -1 - -50 - -50 - -50 - -50 - -50 - -50 - -50 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - - - - - - none - - -8 - -8 - -8 - -8 - -8 - -8 - -8 - -8 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -16 - -16 - -16 - -16 - -16 - -16 - -16 - -16 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -4 - -4 - -4 - -4 - -4 - -4 - -4 - -4 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -16 - -16 - -16 - -16 - -16 - -16 - -16 - -16 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -32 - -32 - -32 - -32 - -32 - -32 - -32 - -32 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - 5 - 5 - 5 - 5 - 5 - 5 - 5 - 5 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -4 - -4 - -4 - -4 - -4 - -4 - -4 - -4 - -4 - - - 1> - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -2 - -2 - -2 - -2 - -2 - -2 - -2 - -2 - -2 - - - 1> - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - none - - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - - - 1> - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - - - 1 - - - 1 - - - - - - - diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml deleted file mode 100644 index 33f8b4a692..0000000000 --- a/cime_config/config_tests.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - CLM initial condition interpolation test (requires configuration with non-blank finidat) - 1 - FALSE - FALSE - never - $STOP_OPTION - $STOP_N - - - - CLM initial condition interpolation test using finidat_areas (requires configuration with non-blank finidat) - 1 - FALSE - FALSE - never - $STOP_OPTION - $STOP_N - - - - CLM test: Verify that adding virtual glacier columns doesn't change answers - 1 - FALSE - FALSE - never - - never - - - - smoke CLM spinup test (only valid for CLM45 or CLM50 compsets) - 1 - ndays - startup - 4 - FALSE - - - diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml deleted file mode 100644 index da8d8e1080..0000000000 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN - FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN - FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN - FAIL ERS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-default COMPARE_base_rest - FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN - FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN - FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN - - - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates COMPARE_base_rest - FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-FatesAllVars COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesLogging COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-Fates COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesNoFire COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesPPhys COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesST3 COMPARE_base_rest - FAIL ERP_Ld9.f45_f45_mg37.I2000Clm45Fates.cheyenne_intel.clm-FatesAllVars COMPARE_base_rest - FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.cheyenne_gnu.clm-Fates COMPARE_base_rest - - diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml deleted file mode 100644 index 60eb71464d..0000000000 --- a/cime_config/testdefs/testlist_clm.xml +++ /dev/null @@ -1,1921 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cime_config/testdefs/testmods_dirs/clm/40crop/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/40crop/include_user_mods deleted file mode 100644 index e009e9a25a..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40crop/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../40default diff --git a/cime_config/testdefs/testmods_dirs/clm/40crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/40crop/user_nl_clm deleted file mode 100644 index 7ba5b8685b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40crop/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ - hist_fincl1 += 'GDD0', 'GDD8', 'GDD10', - 'GDD020', 'GDD820', 'GDD1020', - 'GDDPLANT', 'GDDTSOI', 'A5TMIN', 'A10TMIN' diff --git a/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands deleted file mode 100644 index c931cba688..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands +++ /dev/null @@ -1,3 +0,0 @@ -# Turn fire emission driver namelist off in case clm4_0 is being used -./xmlchange CLM_BLDNML_OPTS="-no-fire_emis" --append - diff --git a/cime_config/testdefs/testmods_dirs/clm/40default/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/40default/user_nl_clm deleted file mode 100644 index 4018165f31..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40default/user_nl_clm +++ /dev/null @@ -1,25 +0,0 @@ - wrtdia = .true. - hist_dov2xy = .true.,.false. -! Even though only 2 history tapes are defined here, set ndens to 1 for up to 6 history -! tapes, for the sake of mods that extend these default mods and may add other history tapes - hist_ndens = 1,1,1,1,1,1 - hist_nhtfrq =-24,-8 - hist_mfilt = 1,1 - hist_fincl1 = 'TRAFFICFLUX', 'SNOWLIQ:A','SNOWICE:A' - hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TSA_U', 'TSA_R', - 'TREFMNAV_U', 'TREFMNAV_R', - 'TREFMXAV_U', 'TREFMXAV_R', - 'TG_U', 'TG_R', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF_U', 'QRUNOFF_R', - 'SoilAlpha_U', - 'SWup', 'LWup', 'URBAN_AC', 'URBAN_HEAT' - - diff --git a/cime_config/testdefs/testmods_dirs/clm/40pts/README b/cime_config/testdefs/testmods_dirs/clm/40pts/README deleted file mode 100644 index 30d71a7c8b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40pts/README +++ /dev/null @@ -1,5 +0,0 @@ -This testmods directory should not be used directly. Instead, it should be -extended (i.e., included) by a mods directory that defines the point to run -over - something like: - -./xmlchange PTS_LAT=42,PTS_LON=260 diff --git a/cime_config/testdefs/testmods_dirs/clm/40pts/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/40pts/include_user_mods deleted file mode 100644 index e009e9a25a..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40pts/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../40default diff --git a/cime_config/testdefs/testmods_dirs/clm/40pts/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40pts/shell_commands deleted file mode 100644 index ad140e45e1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40pts/shell_commands +++ /dev/null @@ -1,24 +0,0 @@ -./xmlchange PTS_MODE=TRUE -./xmlchange ATM_NX=0 -./xmlchange ATM_NY=0 -./xmlchange LND_NX=0 -./xmlchange LND_NY=0 -./xmlchange ICE_NX=0 -./xmlchange ICE_NY=0 -./xmlchange OCN_NX=0 -./xmlchange OCN_NY=0 -./xmlchange ROF_NX=0 -./xmlchange ROF_NY=0 -./xmlchange GLC_NX=0 -./xmlchange GLC_NY=0 -./xmlchange WAV_NX=0 -./xmlchange WAV_NY=0 -./xmlchange NTASKS_ATM=1 -./xmlchange NTASKS_LND=1 -./xmlchange NTASKS_ICE=1 -./xmlchange NTASKS_OCN=1 -./xmlchange NTASKS_CPL=1 -./xmlchange NTASKS_GLC=1 -./xmlchange NTASKS_ROF=1 -./xmlchange NTASKS_WAV=1 -./xmlchange NTASKS_ESP=1 diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/include_user_mods deleted file mode 100644 index 85ea433e18..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../40pts diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands deleted file mode 100644 index 48287a2998..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=42,PTS_LON=260 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/include_user_mods deleted file mode 100644 index 85ea433e18..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../40pts diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands deleted file mode 100644 index 15fd1cced4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=-5,PTS_LON=290 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsROA/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/40ptsROA/include_user_mods deleted file mode 100644 index 85ea433e18..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsROA/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../40pts diff --git a/cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands deleted file mode 100644 index d5be09e860..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=30,PTS_LON=315 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/shell_commands b/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/shell_commands deleted file mode 100644 index e075bf29fd..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# Turn fire emission driver namelist off in case clm4_0 is being used -./xmlchange CLM_BLDNML_OPTS="-no-fire_emis" --append - diff --git a/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/user_nl_clm deleted file mode 100644 index 3d94564c47..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/40reduceOutput/user_nl_clm +++ /dev/null @@ -1,12 +0,0 @@ -hist_empty_htapes = .true. -hist_fincl1 = 'SNOWLIQ','SNOWICE' , - 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TG', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF' diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands deleted file mode 100644 index 3a08fbc8e7..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/shell_commands +++ /dev/null @@ -1,6 +0,0 @@ -# Test Data Assimilation with multi-driver on -./xmlchange LND_DATA_ASSIMILATION=TRUE -./xmlchange MULTI_DRIVER=TRUE - -# Set calendar, just because Gregorian is ussually used for DA -./xmlchange CALENDAR=GREGORIAN diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 deleted file mode 100644 index 62299f7ee4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0001 +++ /dev/null @@ -1,13 +0,0 @@ - ! Settings being used for DART cases - hist_empty_htapes = .true. - hist_fincl1 = 'NEP','TOTECOSYSC','TOTVEGC','TLAI' - hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R' - hist_fincl3 = 'TV','TLAI','PBOT','TBOT','TSA','RH2M_R','SNOWDP' - hist_nhtfrq = -24,1,-24 - hist_mfilt = 1,48,1 - hist_avgflag_pertape = 'A','A','I' - hist_dov2xy = .true.,.true.,.false. - hist_type1d_pertape = ' ',' ',' ' - - use_init_interp = .true. - finidat = '/glade/p_old/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0001.r.2001-01-01-00000.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 b/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 deleted file mode 100644 index 0df6e5a2a2..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/DA_multidrv/user_nl_clm_0002 +++ /dev/null @@ -1,13 +0,0 @@ - ! Settings being used for DART cases - hist_empty_htapes = .true. - hist_fincl1 = 'NEP','TOTECOSYSC','TOTVEGC','TLAI' - hist_fincl2 = 'NEP','FSH','EFLX_LH_TOT_R' - hist_fincl3 = 'TV','TLAI','PBOT','TBOT','TSA','RH2M_R','SNOWDP' - hist_nhtfrq = -24,1,-24 - hist_mfilt = 1,48,1 - hist_avgflag_pertape = 'A','A','I' - hist_dov2xy = .true.,.true.,.false. - hist_type1d_pertape = ' ',' ',' ' - - use_init_interp = .true. - finidat = '/glade/p_old/image/RDA_strawman/CESM_ensembles/CLM/CLM5BGC-Crop/ctsm_2001-01-01-00000/clm5_f09_spinup80.clm2_0002.r.2001-01-01-00000.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands deleted file mode 100644 index 41a2342a51..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange CLM_BLDNML_OPTS="-no-megan" --append -./xmlchange BFBFLAG="TRUE" diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm deleted file mode 100644 index 487ad09863..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ /dev/null @@ -1,11 +0,0 @@ -!!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-1x1br.clm2.r.0111-01-01-00000.nc' -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .true. -use_fates_spitfire= .true. -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands deleted file mode 100644 index 2a9f09bd75..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm deleted file mode 100644 index a869310636..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm +++ /dev/null @@ -1,31 +0,0 @@ -!finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/iclm45fates-finit-s1.4.0-a3.0.0-f45.clm2.r.0111-01-01-00000.nc' -hist_mfilt = 365 -hist_nhtfrq = -24 -hist_empty_htapes = .false. -use_fates_spitfire= .true. -hist_fincl1 = 'NCL_BY_AGE','NPATCH_BY_AGE','BIOMASS_BY_AGE','NPP_BY_AGE','GPP_BY_AGE','PARSUN_Z_CNLF','PARSHA_Z_CNLF','PARSUN_Z_CNLFPFT', - 'PARSHA_Z_CNLFPFT','PARSUN_Z_CAN','PARSHA_Z_CAN','LAISUN_Z_CNLF','LAISHA_Z_CNLF','LAISUN_Z_CNLFPFT','LAISHA_Z_CNLFPFT', - 'LAISUN_TOP_CAN','LAISHA_TOP_CAN','FABD_SUN_CNLFPFT','FABD_SHA_CNLFPFT','FABI_SUN_CNLFPFT','FABI_SHA_CNLFPFT', - 'FABD_SUN_CNLF','FABD_SHA_CNLF','FABI_SUN_CNLF','FABI_SHA_CNLF','FABD_SUN_TOPLF_BYCANLAYER','FABD_SHA_TOPLF_BYCANLAYER', - 'FABI_SUN_TOPLF_BYCANLAYER','FABI_SHA_TOPLF_BYCANLAYER','TS_NET_UPTAKE_CNLF','YEAR_NET_UPTAKE_CNLF','CROWNAREA_CNLF', - 'MORTALITY_CARBONFLUX_CANOPY','MORTALITY_CARBONFLUX_UNDERSTORY','NPLANT_SCAG','NPLANT_CANOPY_SCAG','NPLANT_UNDERSTORY_SCAG', - 'DDBH_CANOPY_SCAG','DDBH_UNDERSTORY_SCAG','MORTALITY_CANOPY_SCAG','MORTALITY_UNDERSTORY_SCAG','GPP_SCPF','GPP_CANOPY_SCPF', - 'AR_CANOPY_SCPF','GPP_UNDERSTORY_SCPF','AR_UNDERSTORY_SCPF','NPP_SCPF','NPP_LEAF_SCPF','NPP_SEED_SCPF','NPP_FNRT_SCPF', - 'NPP_BGSW_SCPF','NPP_BGDW_SCPF','NPP_AGSW_SCPF','NPP_AGDW_SCPF','NPP_STOR_SCPF','DDBH_SCPF','DDBH_CANOPY_SCPF', - 'DDBH_UNDERSTORY_SCPF','BA_SCPF','NPLANT_SCPF','M1_SCPF','M2_SCPF','M3_SCPF','M4_SCPF','M5_SCPF','M6_SCPF','M7_SCPF', - 'MORTALITY_CANOPY_SCPF','BSTOR_CANOPY_SCPF','BLEAF_CANOPY_SCPF','NPLANT_CANOPY_SCPF','MORTALITY_UNDERSTORY_SCPF', - 'BSTOR_UNDERSTORY_SCPF','BLEAF_UNDERSTORY_SCPF','NPLANT_UNDERSTORY_SCPF','CWD_AG_CWDSC','CWD_BG_CWDSC','CWD_AG_IN_CWDSC', - 'CWD_BG_IN_CWDSC','CWD_AG_OUT_CWDSC','CWD_BG_OUT_CWDSC','AR_SCPF','AR_GROW_SCPF','AR_MAINT_SCPF','AR_DARKM_SCPF','AR_AGSAPM_SCPF', - 'AR_CROOTM_SCPF','AR_FROOTM_SCPF','DDBH_CANOPY_SCLS','DDBH_UNDERSTORY_SCLS','YESTERDAYCANLEV_CANOPY_SCLS', - 'YESTERDAYCANLEV_UNDERSTORY_SCLS','BA_SCLS','DEMOTION_RATE_SCLS','PROMOTION_RATE_SCLS','NPLANT_CANOPY_SCLS', - 'MORTALITY_CANOPY_SCLS','NPLANT_UNDERSTORY_SCLS','MORTALITY_UNDERSTORY_SCLS','TRIMMING_CANOPY_SCLS','TRIMMING_UNDERSTORY_SCLS', - 'CROWN_AREA_CANOPY_SCLS','CROWN_AREA_UNDERSTORY_SCLS','LEAF_MD_CANOPY_SCLS','ROOT_MD_CANOPY_SCLS','CARBON_BALANCE_CANOPY_SCLS', - 'SEED_PROD_CANOPY_SCLS','DBALIVEDT_CANOPY_SCLS','DBDEADDT_CANOPY_SCLS','DBSTOREDT_CANOPY_SCLS','STORAGE_FLUX_CANOPY_SCLS', - 'NPP_LEAF_CANOPY_SCLS','NPP_FROOT_CANOPY_SCLS','NPP_BSW_CANOPY_SCLS','NPP_BDEAD_CANOPY_SCLS','NPP_BSEED_CANOPY_SCLS', - 'NPP_STORE_CANOPY_SCLS','RDARK_CANOPY_SCLS','LIVESTEM_MR_CANOPY_SCLS','LIVECROOT_MR_CANOPY_SCLS','FROOT_MR_CANOPY_SCLS', - 'RESP_G_CANOPY_SCLS','RESP_M_CANOPY_SCLS','LEAF_MD_UNDERSTORY_SCLS','ROOT_MD_UNDERSTORY_SCLS','CARBON_BALANCE_UNDERSTORY_SCLS', - 'SEED_PROD_UNDERSTORY_SCLS','DBALIVEDT_UNDERSTORY_SCLS','DBDEADDT_UNDERSTORY_SCLS','DBSTOREDT_UNDERSTORY_SCLS', - 'STORAGE_FLUX_UNDERSTORY_SCLS','NPP_LEAF_UNDERSTORY_SCLS','NPP_FROOT_UNDERSTORY_SCLS','NPP_BSW_UNDERSTORY_SCLS', - 'NPP_BDEAD_UNDERSTORY_SCLS','NPP_BSEED_UNDERSTORY_SCLS','NPP_STORE_UNDERSTORY_SCLS','RDARK_UNDERSTORY_SCLS', - 'LIVESTEM_MR_UNDERSTORY_SCLS','LIVECROOT_MR_UNDERSTORY_SCLS','FROOT_MR_UNDERSTORY_SCLS','RESP_G_UNDERSTORY_SCLS', - 'RESP_M_UNDERSTORY_SCLS' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands deleted file mode 100644 index 2a9f09bd75..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm deleted file mode 100644 index 144569c412..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC','NPLANT_SCAG','NPLANT_SCPF', - 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm deleted file mode 100644 index 3b74a4fd37..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_fates_logging= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm deleted file mode 100644 index dfdb775ec5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_fates_spitfire= .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm deleted file mode 100644 index 9da01bc3fe..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_fates_ed_prescribed_phys= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm deleted file mode 100644 index eca76c4b9c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_fates_ed_st3= .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods deleted file mode 100644 index 4c7aa0f2b4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm deleted file mode 100644 index f9d31eecbb..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', - 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', - 'TOTSOMC','TOTLITC','T_SCALAR','NEP','NBP','HR','TOTECOSYSC' diff --git a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm deleted file mode 100644 index f225dede82..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ - anoxia = .true. - use_vertsoilc = .false. - use_nitrif_denitrif = .false. - hist_wrtch4diag = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/user_nl_clm deleted file mode 100644 index d03efa953b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ - use_snicar_frc = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands b/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands deleted file mode 100755 index 446125abf9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands +++ /dev/null @@ -1,19 +0,0 @@ -# shell commands to execute xmlchange commands written by PTCLMmkdata: -# ./PTCLMmkdata --cesm_root ../../../.. -s US-UMB -d /glade/p/cesm/cseg/inputdata --mydatadir=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024 -./xmlchange CLM_USRDAT_NAME=1x1pt_US-UMB -./xmlchange DATM_CLMNCEP_YR_START=1999 -./xmlchange DATM_CLMNCEP_YR_END=2006 -# Comment this out if NINST_LND is greater than 1 (see: http://bugs.cgd.ucar.edu/show_bug.cgi?id=2521) -./xmlchange MPILIB=mpi-serial -./xmlchange ATM_DOMAIN_PATH=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024/1x1pt_US-UMB -./xmlchange LND_DOMAIN_PATH=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024/1x1pt_US-UMB -./xmlchange ATM_DOMAIN_FILE=domain.lnd.1x1pt_US-UMB_navy.171024.nc -./xmlchange LND_DOMAIN_FILE=domain.lnd.1x1pt_US-UMB_navy.171024.nc -./xmlchange --append CLM_BLDNML_OPTS='-mask navy -no-crop' -./xmlchange CALENDAR=GREGORIAN -./xmlchange DOUT_S=FALSE -./xmlchange ATM_NCPL=24 -./xmlchange RUN_STARTDATE=1999-01-01 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1999 -./xmlchange DIN_LOC_ROOT=/glade/p/cesm/cseg/inputdata -./xmlchange DIN_LOC_ROOT_CLMFORC=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024 diff --git a/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm deleted file mode 100644 index 38ce400297..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -! user_nl_clm namelist options written by PTCLMmkdata: -! ./PTCLMmkdata --cesm_root ../../../.. -s US-UMB -d /glade/p/cesm/cseg/inputdata --mydatadir=/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024 - fsurdat = '/glade/p/cesm/cseg/inputdata/lnd/clm2/PTCLMmydatafiles.c171024/1x1pt_US-UMB/surfdata_1x1pt_US-UMB_16pfts_Irrig_CMIP6_simyr2000_c171024.nc' - hist_nhtfrq = 0 - hist_mfilt = 1200 diff --git a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/shell_commands b/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/shell_commands deleted file mode 100644 index bfff1b36cd..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/shell_commands +++ /dev/null @@ -1,3 +0,0 @@ -./xmlchange DATM_MODE=CLMCRUNCEPv7 -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_clm deleted file mode 100644 index c7cfe279ee..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -use_lai_streams = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_datm b/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_datm deleted file mode 100644 index 6fb5f55ac4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_datm +++ /dev/null @@ -1 +0,0 @@ -bias_correct = 'BC.CRUNCEP.GPCP.Precip' diff --git a/cime_config/testdefs/testmods_dirs/clm/allActive/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/allActive/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/allActive/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/allActive/shell_commands b/cime_config/testdefs/testmods_dirs/clm/allActive/shell_commands deleted file mode 100644 index 9dc96f428b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/allActive/shell_commands +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -# This namelist tests turning all points to 'active'; the point of -# this is to make sure that all points in memory could conceivably -# become active in a dynamic landunit run without causing any -# trouble. This should be tested with a _D test. - -# Note that we don't necessarily expect this to work with an initial -# conditions file that wasn't itself generated with all_active = -# .true., so we set CLM_FORCE_COLDSTART=on for this - -./xmlchange CLM_FORCE_COLDSTART="on" - diff --git a/cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm deleted file mode 100644 index 0aec21699b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm +++ /dev/null @@ -1,15 +0,0 @@ -! This namelist tests turning all points to 'active'; the point of -! this is to make sure that all points in memory could conceivably -! become active in a dynamic landunit run without causing any -! trouble. This should be tested with a _D test. - -! Note that we don't necessarily expect this to work with an initial -! conditions file that wasn't itself generated with all_active = -! .true., so we set CLM_FORCE_COLDSTART=on for this (in shell_commands) - -all_active = .true. - -! Also run urban landunits everywhere possible; while a bit different -! from all_active, this is a related idea, so we test it as part of the -! same test mod. -run_zero_weight_urban = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm deleted file mode 100644 index 0a40cd33a8..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - use_c13 = .true. - use_c14 = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/include_user_mods deleted file mode 100644 index ce640345c5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../ciso diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/shell_commands deleted file mode 100755 index fdc79af2de..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange RUN_STARTDATE=1963-01-01 diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm deleted file mode 100644 index 37b7c1ac3d..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -use_c14_bombspike=.true. -use_c13_timeseries = .true. - -! This testmod is used in a long test, so change output frequency -hist_nhtfrq = 0,-240 -hist_mfilt = 1,1 diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_decStart/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_decStart/include_user_mods deleted file mode 100644 index c9053f7b07..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_decStart/include_user_mods +++ /dev/null @@ -1,2 +0,0 @@ -../ciso -../decStart diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm deleted file mode 100644 index 9db1957c1c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ - use_c13 = .true. - use_c14 = .true. - use_fun = .true. - use_flexibleCN = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/include_user_mods deleted file mode 100644 index ce640345c5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../ciso diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/user_nl_clm deleted file mode 100644 index b2a51bd5d5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - hist_nhtfrq = 0,-240 - hist_mfilt = 1,1 diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_rtmColdSSP/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_rtmColdSSP/include_user_mods deleted file mode 100644 index 7cded6662d..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_rtmColdSSP/include_user_mods +++ /dev/null @@ -1,2 +0,0 @@ -../ciso -../rtmColdSSP diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm deleted file mode 100644 index 588fa7d7a9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -ndep_varlist = 'NDEP_month' -ndep_taxmode = 'cycle' -stream_fldfilename_ndep = '$DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_simyr1850_0.9x1.25_CMIP6alpha01_c170330.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/include_user_mods deleted file mode 100644 index 0a64f1e6cc..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../clm50KitchenSink diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm deleted file mode 100644 index b2a51bd5d5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - hist_nhtfrq = 0,-240 - hist_mfilt = 1,1 diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm deleted file mode 100644 index b99b882838..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -limit_irrigation_if_rof_enabled = .false. -leaf_mr_vcm = 0.015d00 -use_bedrock = .true. -use_luna = .true. -use_flexibleCN = .true. -use_fun = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/README b/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/README deleted file mode 100644 index b570a324d1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/README +++ /dev/null @@ -1 +0,0 @@ -Setting use_init_interp = .true. is currently needed for clm50 tests with crop. diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/include_user_mods deleted file mode 100644 index 02ec13743f..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../cropMonthOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm deleted file mode 100644 index 44bf6a9457..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -use_init_interp = .true. - -hist_fincl1 += 'QIRRIG_DEMAND' - -! Turn irrigation on -irrigate = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm deleted file mode 100644 index e493c3e8e7..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -use_dynroot = .true. -use_hydrstress = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/README b/cime_config/testdefs/testmods_dirs/clm/cmip6/README deleted file mode 100644 index 40b90f9ce0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/README +++ /dev/null @@ -1,6 +0,0 @@ -Note that this testmod directory includes cmip6_evolving_icesheet rather -than simply cmip6: cmip6_evolving_icesheet includes cmip6 and adds to -it. So, rather than having tests of the cmip6 usermods and separate -tests of cmip6_evolving_icesheet, it's more efficient to just have tests -of the cmip6_evolving_icesheet usermods directory, which then also cover -the cmip6 usermods directory. diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods deleted file mode 100644 index 7e8fa5ec83..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../../../../usermods_dirs/cmip6_evolving_icesheet diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands deleted file mode 100644 index 33792ffaee..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/cn_conly/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cn_conly/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cn_conly/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/cn_conly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/cn_conly/user_nl_clm deleted file mode 100644 index 926e36cf39..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cn_conly/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ - suplnitro = 'ALL' diff --git a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/README b/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/README deleted file mode 100644 index 566826ac8e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/README +++ /dev/null @@ -1,23 +0,0 @@ -This testmod provides an finidat file compatible with the current model -configuration, at f09 resolution. - -This testmods directory is for running LII tests which compare the answers for a case where -initial condition interpolation is on (use_init_interp=T) to a case with it's off and ensures -they are exact. For the interpolated result to match uninterpolation, it needs to be a case that -essentially needs no interpolation so it's at the same resolution as the initial condition -file (finidat file). When surface datasets are changed, or the land-mask is changed, or an -important change is made to model physics (for example where new fields are added to the restart -file) -- you'll need to update the initial conditions file in this test (finidat file in -the user_nl_clm file). - -To update the initial conditions (finidat) file for this test: - -(1) Run the LII test; the 'base' case should run to completion even if the -no_interp test fails. - -(2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata -space. Rename this to be similar to the name of the file pointed to in this -test's user_nl_clm file, but with a new creation date. - -(3) Update this the user_nl_clm file in this directory to point to the new -finidat file. diff --git a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm deleted file mode 100644 index dc3dedf6c4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/compatible_finidat_f09/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850Clm50BgcCrop.1366-01-01.0.9x1.25_gx1v6_simyr1850_c180424.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/cplhist/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cplhist/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cplhist/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands deleted file mode 100755 index f33e602348..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cplhist/shell_commands +++ /dev/null @@ -1,5 +0,0 @@ -./xmlchange DATM_CPLHIST_CASE=b.e20.B1850.f09_g17.pi_control.all.221.cplhist -./xmlchange DATM_CPLHIST_DIR=/glade/p/cesm/bgcwg_dev/forcing/b.e20.B1850.f09_g17.pi_control.all.221.cplhist/cpl/hist.mon -./xmlchange DATM_CPLHIST_YR_ALIGN=1 -./xmlchange DATM_CPLHIST_YR_END=84 -./xmlchange DATM_CPLHIST_YR_START=82 diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm deleted file mode 100644 index c70d3dba9e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm +++ /dev/null @@ -1,8 +0,0 @@ - hist_fincl1 += 'GDD0', 'GDD8', 'GDD10', - 'GDD020', 'GDD820', 'GDD1020', - 'GDDPLANT', 'GDDTSOI', 'A5TMIN', 'A10TMIN' - -! The main point of including this field is to test the SUM history field infrastructure -! This is in the crop testmods because this field is mainly useful in transient crop runs -! This is on history tape 2 because this field is not meaningful at the gridcell level -hist_fincl2 += 'DYN_COL_SOIL_ADJUSTMENTS_C' diff --git a/cime_config/testdefs/testmods_dirs/clm/cropColdStart/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cropColdStart/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cropColdStart/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/cropColdStart/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cropColdStart/shell_commands deleted file mode 100755 index 2a9f09bd75..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cropColdStart/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/include_user_mods deleted file mode 100644 index 23ea3745e6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm deleted file mode 100644 index b2a51bd5d5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - hist_nhtfrq = 0,-240 - hist_mfilt = 1,1 diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/decStart/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands b/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands deleted file mode 100755 index f3e89bb4fa..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange RUN_STARTDATE=2001-12-30 -./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism b/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism deleted file mode 100644 index 85f5789000..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism +++ /dev/null @@ -1,9 +0,0 @@ -! The need for this is subtle. The problem is that this decStart testmod is used in short -! (multi-day) ERP tests, whose length is such that the end of the year occurs in the -! initial run but not in the restart run. Without setting history_option = 'coupler', this -! would mean that CISM outputs a history file in the initial run but not in the restart -! run, which causes the test to fail because the test system requires any component's -! final history file in one case to have a counterpart in the other case. Setting -! history_option = 'coupler' forces CISM to output a history file only at the end of the -! run. -history_option = 'coupler' diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README b/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README deleted file mode 100644 index 102dd97840..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README +++ /dev/null @@ -1,8 +0,0 @@ -This testmods directory was created for the sake of the smallville transient -test case. We need to use a cold-start to avoid this error message: - -ERROR : CLM build-namelist::CLMBuildNamelist::setup_logic_initial_conditions() : -using ignore_ic_date is incompatable with crop! - -Once the above problem is fixed, we should stop doing a coldstart in this -testmods diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands b/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands deleted file mode 100755 index 006ef22a12..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange RUN_STARTDATE=1851-12-30 -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm deleted file mode 100644 index 0c98d81ff0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -lower_boundary_condition = 2 -soil_layerstruct = '49SL_10m' -use_bedrock = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/default/shell_commands b/cime_config/testdefs/testmods_dirs/clm/default/shell_commands deleted file mode 100644 index adebdc5743..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/default/shell_commands +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -./xmlchange CLM_BLDNML_OPTS="-fire_emis" --append -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm deleted file mode 100644 index 6b0ba531b7..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm +++ /dev/null @@ -1,27 +0,0 @@ - wrtdia = .true. - hist_dov2xy = .true.,.false. -! Even though only 2 history tapes are defined here, set ndens to 1 for up to 6 history -! tapes, for the sake of mods that extend these default mods and may add other history tapes - hist_ndens = 1,1,1,1,1,1 - hist_nhtfrq =-24,-8 - hist_mfilt = 1,1 - hist_fincl1 = 'TRAFFICFLUX', 'SNOWLIQ:A','SNOWICE:A' -! Add FCO2 because few (if any) tests send this flux to the coupler, so it isn't checked via cpl hist files - hist_fincl1 += 'FCO2' - hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TSA_U', 'TSA_R', - 'TREFMNAV_U', 'TREFMNAV_R', - 'TREFMXAV_U', 'TREFMXAV_R', - 'TG_U', 'TG_R', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF_U', 'QRUNOFF_R', - 'SoilAlpha_U', - 'SWup', 'LWup', 'URBAN_AC', 'URBAN_HEAT' - - diff --git a/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/shell_commands b/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/shell_commands deleted file mode 100755 index ecd6d46239..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_BLDNML_OPTS='-drydep -no-megan' -append diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods deleted file mode 100644 index fb35ec8c90..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../fates diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands b/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands deleted file mode 100644 index d81ed7dbc5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange CLM_BLDNML_OPTS="-no-megan" --append diff --git a/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm deleted file mode 100644 index e3a3b76d71..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fatesFire/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -use_fates_spitfire = .true. - diff --git a/cime_config/testdefs/testmods_dirs/clm/fire_emis/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/fire_emis/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fire_emis/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm deleted file mode 100644 index 3f5749e61f..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm +++ /dev/null @@ -1,33 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options -! are set in the CLM_NAMELIST_OPTS env variable. -! -! EXCEPTIONS: -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set dtime with L_NCPL option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! Set glc_grid with CISM_GRID option -! Set maxpatch_glcmec with GLC_NEC option -!---------------------------------------------------------------------------------- - - hist_mfilt = 1,30 - hist_nhtfrq = 0,-24 - hist_avgflag_pertape = 'A','A' - hist_fincl1 = 'M_LEAFC_TO_FIRE','M_LEAFC_STORAGE_TO_FIRE','M_LEAFC_XFER_TO_FIRE','M_LIVESTEMC_TO_FIRE', - 'M_LIVESTEMC_STORAGE_TO_FIRE','M_LIVESTEMC_XFER_TO_FIRE','M_DEADSTEMC_TO_FIRE','M_DEADSTEMC_STORAGE_TO_FIRE', - 'M_DEADSTEMC_XFER_TO_FIRE','M_FROOTC_TO_FIRE','M_FROOTC_STORAGE_TO_FIRE','M_FROOTC_XFER_TO_FIRE', - 'M_LIVEROOTC_TO_FIRE','M_LIVEROOTC_STORAGE_TO_FIRE','M_LIVEROOTC_XFER_TO_FIRE','M_DEADROOTC_TO_FIRE', - 'M_DEADROOTC_STORAGE_TO_FIRE','M_DEADROOTC_XFER_TO_FIRE','M_GRESP_STORAGE_TO_FIRE','M_GRESP_XFER_TO_FIRE', - 'FireEmis_ZTOP','FireEmis_TOT','FireComp_BC','FireComp_OC','FireComp_SO2','FireMech_bc_a1','FireMech_pom_a1','FireMech_SO2', - hist_fincl2 = 'M_LEAFC_TO_FIRE','M_LEAFC_STORAGE_TO_FIRE','M_LEAFC_XFER_TO_FIRE','M_LIVESTEMC_TO_FIRE', - 'M_LIVESTEMC_STORAGE_TO_FIRE','M_LIVESTEMC_XFER_TO_FIRE','M_DEADSTEMC_TO_FIRE','M_DEADSTEMC_STORAGE_TO_FIRE', - 'M_DEADSTEMC_XFER_TO_FIRE','M_FROOTC_TO_FIRE','M_FROOTC_STORAGE_TO_FIRE','M_FROOTC_XFER_TO_FIRE', - 'M_LIVEROOTC_TO_FIRE','M_LIVEROOTC_STORAGE_TO_FIRE','M_LIVEROOTC_XFER_TO_FIRE','M_DEADROOTC_TO_FIRE', - 'M_DEADROOTC_STORAGE_TO_FIRE','M_DEADROOTC_XFER_TO_FIRE','M_GRESP_STORAGE_TO_FIRE','M_GRESP_XFER_TO_FIRE', - 'FireEmis_ZTOP','FireEmis_TOT','FireComp_BC','FireComp_OC','FireComp_SO2','FireMech_bc_a1','FireMech_pom_a1','FireMech_SO2' - fire_emis_elevated=.false. diff --git a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm deleted file mode 100644 index 8d82dc726b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ - use_flexibleCN = .true. - use_luna = .false. - use_fun = .true. - diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm deleted file mode 100644 index 0ba5e4892b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ -! add some special history fields: multi-layer snow fields, and a per-column forcing field - hist_fincl1 += 'SNO_EXISTENCE', 'SNO_ABS', 'SNO_T:M', 'SNO_GS:X', 'QICE_FORC' -! similarly, add a glc-specific field to the second history tape - hist_fincl2 += 'QICE' diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README deleted file mode 100644 index 2e8fcfc52e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README +++ /dev/null @@ -1,4 +0,0 @@ -This testmods directory switches some glc_mec-related flags in CLM, in order to -test different branches than are tested with the default options. - -It also turns off the feedback from CISM to CLM, to test that option. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/shell_commands b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/shell_commands deleted file mode 100644 index 404b22b006..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange GLC_TWO_WAY_COUPLING=FALSE diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm deleted file mode 100644 index cbb67daeef..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ - glcmec_downscale_longwave = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/README deleted file mode 100644 index 9d54f93b87..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/README +++ /dev/null @@ -1,2 +0,0 @@ -This testmods directory is like the standard glcMEC testmods directory, except -it forces a quick decrease in glacier area, along with rearranging the columns. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism b/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism deleted file mode 100644 index 9564455a56..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism +++ /dev/null @@ -1,6 +0,0 @@ -! For this test, we do a decrease in glacier area, along with rearranging the columns; -enable_frac_overrides = .true. -decrease_override_delay = 1 -rearrange_override_delay = 1 -decrease_frac = 0.04 -rearrange_freq = 3 diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_clm deleted file mode 100644 index c2bebaabd5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -for_testing_allow_non_annual_changes = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/README deleted file mode 100644 index 1833bf6a8c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/README +++ /dev/null @@ -1,2 +0,0 @@ -This testmods directory is like the standard glcMEC testmods directory, except -it forces a quick increas in glacier area. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism b/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism deleted file mode 100644 index de96a8545a..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism +++ /dev/null @@ -1,4 +0,0 @@ -! For this test, we do an increase in glacier area; -enable_frac_overrides = .true. -increase_override_delay = 1 -increase_frac = 0.5 diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_clm deleted file mode 100644 index c2bebaabd5..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -for_testing_allow_non_annual_changes = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/README deleted file mode 100644 index 9934bd02d9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory is similar to the glcMEC testmods directory, but is intended for -long (e.g., multi-year) runs. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm deleted file mode 100644 index dd99ceba50..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - hist_nhtfrq =0,0 - hist_mfilt = 1,12 diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README deleted file mode 100644 index ec74e38b4c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README +++ /dev/null @@ -1,34 +0,0 @@ -This testmods directory is for running LII tests which compare the answers for a case where -initial condition interpolation is on (use_init_interp=T) to a case with it's off and ensures -they are exact. For the interpolated result to match uninterpolation, it needs to be a case that -essentially needs no interpolation so it's at the same resolution as the initial condition -file (finidat file). When surface datasets are changed, or the land-mask is changed, or an -important change is made to model physics (for example where new fields are added to the restart -file) -- you'll need to update the initial conditions file in this test (finidat file in -the user_nl_clm file). - -This testmods also turns off the glc two-way coupling. This is done so that -glacier areas are taken from the restart file rather than from -CISM. This is partly so that changes in CISM don't affect the test -results, but more importantly so that LII tests can pass even if CISM -changes. (GLC two-way coupling was off in the generation of the -initial conditions file used here, too.) (4-24-18: I *think* we'll be -able to turn two-way coupling on once -https://github.com/ESCOMP/ctsm/issues/340 is resolved, though I'm not -positive about that. However, if -https://github.com/ESMCI/cime/issues/2484 is done, then we'd need this -testmods to turn off comparison of cpl initial hist files if we have -two-way coupling on, since areas will differ in initialization between -the two cases.) - -To update the initial conditions (finidat) file for this test: - -(1) Run the LII test; the 'base' case should run to completion even if the -no_interp test fails. - -(2) Copy the finidat_interp_dest.nc file from the 'base' case to the inputdata -space. Rename this to be similar to the name of the file pointed to in this -test's user_nl_clm file, but with a new creation date. - -(3) Update this the user_nl_clm file in this directory to point to the new -finidat file. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands deleted file mode 100755 index 404b22b006..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands +++ /dev/null @@ -1 +0,0 @@ -./xmlchange GLC_TWO_WAY_COUPLING=FALSE diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm deleted file mode 100644 index c269a24911..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -! See more notes in the README file in this directory and in the comments in the test list. -! -! Initial condition file at the desired configuration to run, so can verify that interpolating from it gives the same result -! Note that this was generated with GLC_TWO_WAY_COUPLING=FALSE -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I2000Clm50BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180306.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README deleted file mode 100644 index f6c97e00e6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README +++ /dev/null @@ -1,12 +0,0 @@ -In this test, glaciers: -- increase to 100% over 4 days -- then stay constant for 4 days -- then decrease to 0% over 4 days - -This also includes some extra bgc fields on the history file, because this test -is meant to be used to test bgc evolution as glaciers grow and shrink. - -This also ensures that spun-up initial conditions are used, in order to provide a more -reasonable test of BGC state variable evolution with dynamic landunits. With a -cold start run, the state variables are evolving so fast that it's hard to see -the effects of dynamic landunits. diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/include_user_mods deleted file mode 100644 index 1730b6b7cf..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../glcMEC diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_cism b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_cism deleted file mode 100644 index 130c2d9d94..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_cism +++ /dev/null @@ -1,4 +0,0 @@ -enable_frac_overrides = .true. -increase_frac = 0.25 -decrease_override_delay = 8 -decrease_frac = 0.25 diff --git a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm deleted file mode 100644 index 9ebe31d8e9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm +++ /dev/null @@ -1,26 +0,0 @@ -for_testing_allow_non_annual_changes = .true. - -! Add 1-d output for all variables that are conserved with dynamic landunits -! -! Most of these are already on the primary history tape; for those that aren't, we add -! them to the primary history tape, too -! -! Variables in CNVegCarbonStateType -hist_fincl2 += 'SEEDC' -! Variables in CNVegNitrogenStateType -hist_fincl2 += 'SEEDN' -! Variables in SoilBiogeochemCarbonStateType (note that TOTSOMC is taken to be a -! representative sample of the conserved variable decomp_cpools_vr_col) -hist_fincl2 += 'TOTSOMC', 'COL_CTRUNC' -! Variables in SoilBiogeochemNitrogenStateType (note that TOTSOMN is taken to be -! a representative sample of the conserved variable decomp_npools_vr_col) -hist_fincl2 += 'TOTSOMN', 'COL_NTRUNC', 'SMINN', 'SMIN_NO3', 'SMIN_NH4' -! Variables in ch4Mod -hist_wrtch4diag = .true. -hist_fincl1 += 'CONC_CH4_SAT', 'CONC_CH4_UNSAT' -hist_fincl2 += 'FINUNDATED', 'FINUNDATED_LAG', 'LAYER_SAT_LAG', - 'CONC_CH4_SAT', 'CONC_CH4_UNSAT', - 'CONC_O2_SAT', 'CONC_O2_UNSAT', - 'TOTCOLCH4' - - diff --git a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods deleted file mode 100644 index 2596fa3cb3..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../reduceOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands b/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands deleted file mode 100644 index 33792ffaee..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm deleted file mode 100644 index ee85bb983a..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm +++ /dev/null @@ -1,11 +0,0 @@ -hist_fincl1 += 'QIRRIG','QIRRIG_DEMAND' -hist_fincl2 += 'QIRRIG' -hist_dov2xy = .true.,.false. -hist_nhtfrq = 0, -8760 -hist_mfilt = 1,1 - -! In contrast to the standard reduceOutput, use double-precision -hist_ndens = 1,1 - -! Turn irrigation on -irrigate = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README b/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README deleted file mode 100644 index 2e7fcbeba6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README +++ /dev/null @@ -1,3 +0,0 @@ -This testmods directory turns on both irrigation and ozone. These two options -are unrelated, but are simply combined for convenience (so we can turn on a -number of things with a single test). diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods deleted file mode 100644 index af6f0ed80d..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../irrigOn_reduceOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm deleted file mode 100644 index 937cd64717..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -! explicitly include stuff needed for o3 here rather than including the o3 directory, -! since the o3 directory includes default, and we don't want that for this -! reducedOutput testmod -use_ozone = .true. -hist_fincl1 += 'O3UPTAKESUN', 'O3UPTAKESHA' -hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA' diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/README b/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/README deleted file mode 100644 index 316aabe6df..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/README +++ /dev/null @@ -1,4 +0,0 @@ -This tests irrigation using spun-up initial conditions. - -We currently don't have out-of-the-box initial conditions with irrigation on, so -we explicitly point to an initial conditions file for this test. diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/include_user_mods deleted file mode 100644 index 23ea3745e6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm deleted file mode 100644 index 44bf6a9457..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm +++ /dev/null @@ -1,6 +0,0 @@ -use_init_interp = .true. - -hist_fincl1 += 'QIRRIG_DEMAND' - -! Turn irrigation on -irrigate = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/luna/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/luna/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/luna/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm deleted file mode 100644 index cbfbb9f525..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ - use_luna = .true. - use_flexibleCN = .false. - diff --git a/cime_config/testdefs/testmods_dirs/clm/monthly/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/monthly/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/monthly/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_clm deleted file mode 100644 index a6ac15b7f0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -! Change hist frequency to something more appropriate for long tests, and add some snow -! fields in order to test those history fields - hist_nhtfrq = 0,-240 - hist_mfilt = 1,1 - hist_fincl1 += 'SNO_EXISTENCE', 'SNO_ABS', 'SNO_T:M', 'SNO_GS:X' diff --git a/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_cpl b/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_cpl deleted file mode 100644 index 3771552f9a..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_cpl +++ /dev/null @@ -1 +0,0 @@ -budget_inst = 1 diff --git a/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/include_user_mods deleted file mode 100644 index 399579f425..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../monthly diff --git a/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/shell_commands b/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/shell_commands deleted file mode 100755 index 30c088bf92..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -# This is useful for testing cases that are not set up with -# out-of-the-box initial conditions files, and would fail if -# a Cold start wasn't being done -./xmlchange CLM_FORCE_COLDSTART="on" diff --git a/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/user_nl_clm deleted file mode 100644 index b646c244ea..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -use_flexibleCN = .true. -use_luna = .false. -use_fun = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/README b/cime_config/testdefs/testmods_dirs/clm/no_vector_output/README deleted file mode 100644 index 055ad0b8b1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/README +++ /dev/null @@ -1,2 +0,0 @@ -This testmod is similar to the default test mod, but it empties out the 2nd -history tape, which is the vector-output tape. diff --git a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/no_vector_output/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/no_vector_output/user_nl_clm deleted file mode 100644 index 773d3738d9..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/no_vector_output/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -hist_fincl2 = ' ' diff --git a/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands b/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands deleted file mode 100644 index fe06fd1042..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands +++ /dev/null @@ -1,5 +0,0 @@ - -./xmlchange CLM_BLDNML_OPTS="-no-fire_emis" --append -./xmlchange BFBFLAG="TRUE" - - diff --git a/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm deleted file mode 100644 index e6e4f8f843..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/nofire/user_nl_clm +++ /dev/null @@ -1,26 +0,0 @@ - wrtdia = .true. - hist_dov2xy = .true.,.false. -! Even though only 2 history tapes are defined here, set ndens to 1 for up to 6 history -! tapes, for the sake of mods that extend these default mods and may add other history tapes - hist_ndens = 1,1,1,1,1,1 - fire_method = 'nofire' - hist_nhtfrq =-24,-8 - hist_mfilt = 1,1 - hist_fincl1 = 'TRAFFICFLUX', 'SNOWLIQ:A','SNOWICE:A' - hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TSA_U', 'TSA_R', - 'TREFMNAV_U', 'TREFMNAV_R', - 'TREFMXAV_U', 'TREFMXAV_R', - 'TG_U', 'TG_R', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF_U', 'QRUNOFF_R', - 'SoilAlpha_U', - 'SWup', 'LWup', 'URBAN_AC', 'URBAN_HEAT' - - diff --git a/cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm deleted file mode 100644 index a80360aaa0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - use_ozone = .true. - hist_fincl2 += 'O3UPTAKESUN', 'O3UPTAKESHA' diff --git a/cime_config/testdefs/testmods_dirs/clm/oldhyd/shell_commands b/cime_config/testdefs/testmods_dirs/clm/oldhyd/shell_commands deleted file mode 100644 index e2a2ce67e3..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/oldhyd/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange BFBFLAG="TRUE" - diff --git a/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm deleted file mode 100644 index 8e8f3b73fc..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ - hist_ndens = 1,1 - oldfflag = 1 - h2osfcflag = 0 - origflag = 1 - subgridflag = 0 diff --git a/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands b/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands deleted file mode 100644 index 4b6f8faeea..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/pauseResume/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -# Test PAUSE/RESUME functionality which is used for Data Assimulation (DA) -./xmlchange LND_PAUSE_ACTIVE=TRUE -# Set calendar, just because Gregorian is ussually used for DA -./xmlchange CALENDAR=GREGORIAN diff --git a/cime_config/testdefs/testmods_dirs/clm/pts/README b/cime_config/testdefs/testmods_dirs/clm/pts/README deleted file mode 100644 index 30d71a7c8b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/pts/README +++ /dev/null @@ -1,5 +0,0 @@ -This testmods directory should not be used directly. Instead, it should be -extended (i.e., included) by a mods directory that defines the point to run -over - something like: - -./xmlchange PTS_LAT=42,PTS_LON=260 diff --git a/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/pts/shell_commands b/cime_config/testdefs/testmods_dirs/clm/pts/shell_commands deleted file mode 100644 index ad140e45e1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/pts/shell_commands +++ /dev/null @@ -1,24 +0,0 @@ -./xmlchange PTS_MODE=TRUE -./xmlchange ATM_NX=0 -./xmlchange ATM_NY=0 -./xmlchange LND_NX=0 -./xmlchange LND_NY=0 -./xmlchange ICE_NX=0 -./xmlchange ICE_NY=0 -./xmlchange OCN_NX=0 -./xmlchange OCN_NY=0 -./xmlchange ROF_NX=0 -./xmlchange ROF_NY=0 -./xmlchange GLC_NX=0 -./xmlchange GLC_NY=0 -./xmlchange WAV_NX=0 -./xmlchange WAV_NY=0 -./xmlchange NTASKS_ATM=1 -./xmlchange NTASKS_LND=1 -./xmlchange NTASKS_ICE=1 -./xmlchange NTASKS_OCN=1 -./xmlchange NTASKS_CPL=1 -./xmlchange NTASKS_GLC=1 -./xmlchange NTASKS_ROF=1 -./xmlchange NTASKS_WAV=1 -./xmlchange NTASKS_ESP=1 diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsRLA/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ptsRLA/include_user_mods deleted file mode 100644 index cdb9d9f000..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsRLA/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../pts diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands deleted file mode 100644 index 48287a2998..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=42,PTS_LON=260 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsRLB/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ptsRLB/include_user_mods deleted file mode 100644 index cdb9d9f000..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsRLB/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../pts diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands deleted file mode 100644 index 15fd1cced4..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=-5,PTS_LON=290 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsROA/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ptsROA/include_user_mods deleted file mode 100644 index cdb9d9f000..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsROA/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../pts diff --git a/cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands deleted file mode 100644 index d5be09e860..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange PTS_LAT=30,PTS_LON=315 -./xmlchange --force CLM_FORCE_COLDSTART=on diff --git a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands b/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands deleted file mode 100644 index f7e0817ca2..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands +++ /dev/null @@ -1,2 +0,0 @@ -./xmlchange CLM_BLDNML_OPTS="-light_res 360x720" --append -./xmlchange BFBFLAG="TRUE" diff --git a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/user_nl_datm b/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/user_nl_datm deleted file mode 100644 index c88c84629e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/user_nl_datm +++ /dev/null @@ -1 +0,0 @@ -iradsw = -1 diff --git a/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands b/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands deleted file mode 100644 index 350466ae70..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# -# # Use SUBSET rearranger on hobart -if [ `hostname` == "hobart" ]; then - ./xmlchange LND_PIO_REARRANGER=2 -fi -./xmlchange BFBFLAG="TRUE" diff --git a/cime_config/testdefs/testmods_dirs/clm/reduceOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/reduceOutput/user_nl_clm deleted file mode 100644 index 3d94564c47..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/reduceOutput/user_nl_clm +++ /dev/null @@ -1,12 +0,0 @@ -hist_empty_htapes = .true. -hist_fincl1 = 'SNOWLIQ','SNOWICE' , - 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TG', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF' diff --git a/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm deleted file mode 100644 index c1c5ffe8d0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm +++ /dev/null @@ -1,8 +0,0 @@ - reseed_dead_plants = .true. - reset_snow = .true. - reset_snow_glc = .true. - - ! 1774 m was chosen by Leo van Kampenhout, based on the SMB field from the RACMO 2.3 - ! regional climate model, period 1960-1989. The elevation corresponds to the highest point - ! on the contiguous Greenland ice sheet (GrIS) where SMB <= 1 mmWE/yr - reset_snow_glc_ela = 1774. diff --git a/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm deleted file mode 100644 index 53d20a3a97..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ - use_vertsoilc = .false. - anoxia = .true. - hist_wrtch4diag = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm b/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm deleted file mode 100644 index d1a0254a0b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm +++ /dev/null @@ -1,4 +0,0 @@ -finidat_rtm = " " -rtmhist_mfilt = 1 -rtmhist_ndens = 2 -rtmhist_nhtfrq = 0 diff --git a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods deleted file mode 100644 index 399579f425..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../monthly diff --git a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm deleted file mode 100644 index e7500fff58..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm +++ /dev/null @@ -1,4 +0,0 @@ -nlevsno = 3 - -! Need to set use_init_interp because initial conditions file has 5 snow layers -use_init_interp = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/vrtlay/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/vrtlay/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/vrtlay/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm deleted file mode 100644 index cccaf2abf2..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -soil_layerstruct = '23SL_3.5m' diff --git a/cime_config/user_nl_clm b/cime_config/user_nl_clm deleted file mode 100644 index a4cfe51182..0000000000 --- a/cime_config/user_nl_clm +++ /dev/null @@ -1,22 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set irrigate by the CLM_BLDNML_OPTS -irrig .true. setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set dtime with L_NCPL option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! or with CLM_FORCE_COLDSTART to do a cold start -! or set it with an explicit filename here. -! Set maxpatch_glcmec with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - diff --git a/cime_config/usermods_dirs/cmip6/include_user_mods b/cime_config/usermods_dirs/cmip6/include_user_mods deleted file mode 100644 index 012ab60771..0000000000 --- a/cime_config/usermods_dirs/cmip6/include_user_mods +++ /dev/null @@ -1,2 +0,0 @@ -../cmip6_glaciers -../cmip6_output diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods b/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods deleted file mode 100644 index d8d7dacfae..0000000000 --- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../cmip6 diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm b/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm deleted file mode 100644 index 193f0624e7..0000000000 --- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -hist_fincl4 += 'ICE_MODEL_FRACTION' diff --git a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm b/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm deleted file mode 100644 index 4963c4945a..0000000000 --- a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ - -! This differs from the default in that it turns on virtual columns over Antarctica -! This is desired so that we have the output needed to drive a later offline CISM Antarctica simulation -! However, this increases the cost of CLM by about 10% -glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'virtual' diff --git a/cime_config/usermods_dirs/cmip6_output/README b/cime_config/usermods_dirs/cmip6_output/README deleted file mode 100644 index f073548a51..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/README +++ /dev/null @@ -1,5 +0,0 @@ -This directory turns on a variety of extra output fields that are desired for -cmip6 runs. - -To use these mods, you must be using a configuration with CLM50%BGC-CROP using -glc_mec (which is the standard cmip6 configuration). diff --git a/cime_config/usermods_dirs/cmip6_output/shell_commands b/cime_config/usermods_dirs/cmip6_output/shell_commands deleted file mode 100644 index d742a80f83..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/shell_commands +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -./xmlchange CCSM_BGC=CO2A - diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm deleted file mode 100644 index 5c9890a64f..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm +++ /dev/null @@ -1,77 +0,0 @@ -!---------------------------------------------------------------------------------- -! Users should add all user specific namelist changes below in the form of -! namelist_var = new_namelist_value -! -! EXCEPTIONS: -! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting -! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting -! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting -! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting -! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting -! Set irrigate by the CLM_BLDNML_OPTS -irrig setting -! Set co2_ppmv with CCSM_CO2_PPMV option -! Set dtime with L_NCPL option -! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options -! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases -! (includes $inst_string for multi-ensemble cases) -! Set maxpatch_glcmec with GLC_NEC option -! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable -!---------------------------------------------------------------------------------- - -! h0 stream (monthly average, gridcell-level) -! Emon, Lmon, LIMon -hist_fexcl1 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', -'PCT_NAT_PFT','SMIN_NO3_vr','CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr' - -! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level) -! Emon, Lmon, LIMon -hist_fincl1 = 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', -'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', -'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE', -'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', -'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH' - -! h1 stream (monthly average, finest sub-grid) -! Emon, Lmon -hist_fincl2 = 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD', -'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP', -'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN' - -! h2 stream (monthly average, landunit-level) -! Emon -! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level -hist_fincl3 = 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', -'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', -'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS', -'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TSKIN', 'FROOTC:I' - -! h3 stream (yearly average, gridcell-level) -! Eyr -hist_fincl4 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', -'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC' -'PCT_NAT_PFT','PCT_LANDUNIT','TOTLITC:I','TOT_WOODPRODC:I','CROPPROD1C:I','TOTSOMC:I','TOTVEGC:I','FSNO_ICE' - -! h4 stream (yearly average, landunit-level) -! Eyr landuse tiles -hist_fincl5 = 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I' - -! h5 stream (daily average, gridcell-level) -! day, Eday -hist_fincl6 = 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW' - -! h6 stream (daily average, landunit-level) -! Eday -hist_fincl7 = 'TREFMXAV','TREFMNAV' - -! h7 stream (3-hourly average, gridcell-level) -! 3hr, E3hr, CF3hr -! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I) -! E3hr requires GPP, AR, HR for time mean -! CF3hr requires QFLX_SUB_SNOW for time point (I) -hist_fincl8 = 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I' - -hist_mfilt = 1,1,1,1,1,365,365,2920 -hist_dov2xy = .true.,.false.,.false.,.true.,.false.,.true.,.false.,.true. -hist_nhtfrq = 0,0,0,-8760,-8760,-24,-24,-3 -hist_type1d_pertape = ' ',' ','LAND',' ','LAND',' ','LAND',' ' diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_cpl b/cime_config/usermods_dirs/cmip6_output/user_nl_cpl deleted file mode 100644 index ba776735ff..0000000000 --- a/cime_config/usermods_dirs/cmip6_output/user_nl_cpl +++ /dev/null @@ -1 +0,0 @@ -histaux_l2x1yrg = .true. diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template deleted file mode 100644 index b86cbbae0f..0000000000 --- a/doc/.ChangeLog_template +++ /dev/null @@ -1,136 +0,0 @@ -=============================================================== -Tag name: -Originator(s): -Date: -One-line Summary: - -Purpose of changes ------------------- - -[Fill this in with details] - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -CIME Issues fixed (include issue #): [If none, remove this line] - -Known bugs introduced in this tag (include github issue ID): [If none, remove this line] - -Known bugs found since the previous tag (include github issue ID): [If none, remove this line] - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - -Substantial timing or memory changes: - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - -Code reviewed by: - - -CTSM testing: - -[... Remove before making trunk_tag. Available test levels: - - a) regular (must be run before handing off a tag to SEs and must be run - before committing a tag) - b) build_namelist (if namelists and/or build_system changed)) - c) tools (only if tools are modified and no CTSM source is modified) - d) short (for use during development and in rare cases where only a small - change with known behavior is added ... eg. a minor bug fix) - e) doc (no source testing required) - -... ] - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - unit-tests (components/clm/src): - - cheyenne - - - tools-tests (components/clm/test/tools): - - cheyenne - - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - - - regular tests (aux_clm): - - cheyenne_intel ---- - cheyenne_gnu ------ - hobart_nag -------- - hobart_pgi -------- - hobart_intel ------ - -CTSM tag used for the baseline comparisons: - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - URL for LMWG diagnostics output used to validate new climate: - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -=============================================================== diff --git a/doc/.release-ChangeLog_template b/doc/.release-ChangeLog_template deleted file mode 100644 index 7d3bad891f..0000000000 --- a/doc/.release-ChangeLog_template +++ /dev/null @@ -1,98 +0,0 @@ -=============================================================== -Tag name: -Originator(s): -Date: -One-line Summary: - -Purpose of this version: ------------------------- - -[Fill this in with details] - - -CTSM Master Tag This Corresponds To: - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -CIME Issues fixed (include issue #): [If none, remove this line] - -Science changes since: - -Software changes since: - -Changes to User Interface since: - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - - - unit-tests (components/clm/src): - - cheyenne - - hobart --- - - tools-tests (components/clm/test/tools): - - cheyenne - - hobart --- - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - - hobart --- - - regular tests (aux_clm): - - cheyenne_intel ---- - cheyenne_gnu ------ - hobart_nag -------- - hobart_pgi -------- - hobart_intel ------ - - regular tests (prealpha): - - cheyenne_intel - - cheyenne_gnu --- - hobart_nag ----- - - regular tests (prebeta): - - cheyenne_intel - - cheyenne_gnu --- - hobart_nag ----- - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - URL for LMWG diagnostics output for new climate: - -Detailed list of changes: ------------------------- - -Externals being used: - -CTSM Tag versions pulled over from master development branch: - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -=============================================================== diff --git a/doc/ChangeLog b/doc/ChangeLog deleted file mode 100644 index 71f0db46c6..0000000000 --- a/doc/ChangeLog +++ /dev/null @@ -1,841 +0,0 @@ -=============================================================== -Tag name: ctsm1.0.dev009 -Originator(s): sacks (Bill Sacks) -Date: Wed Aug 22 20:32:36 MDT 2018 -One-line Summary: Fix initialization of AnnET in InitAccVars - -Purpose of changes ------------------- - -InitAccVars was mistakenly setting qflx_evap_tot_col rather than -AnnET. This fix allows us to remove now-redundant cold start and restart -code for AnnET. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #480 -- Partially addresses #285 - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: basic proposed changes reviewed by Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CTSM tag used for the baseline comparisons: ctsm1.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): none - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev008 -Originator(s): erik (Erik Kluzek) -Date: Tue Aug 14 10:25:12 MDT 2018 -One-line Summary: Update 1850 ndep file and last year for streams for Historical transient cases - -Purpose of changes ------------------- - -Bring in changes from release-clm5.0.05. Update to latest Nitrogen Deposition file from simulations with WACCM for 1850. -Also fix an issue with the last year for historical transient cases. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): 461 - #461 -- increase last year in streams for transient - -Known bugs found since the previous tag (include github issue ID): [If none, remove this line] - #478 -- Bare soil g1 should be missing value or zero - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): Last year extended for transient datasets - -Changes to the datasets (e.g., parameter, surface or initial files): New ndep dataset for 1850 - -Substantial timing or memory changes: - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Lengthen some tests - -Code reviewed by: self - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (11 show differences for 1850_control and 20thC_transient) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CTSM tag used for the baseline comparisons: ctsm1.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: 1850_control or 20thC_transient for Clm50 - - what platforms/compilers: all - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #477 -- Move changes from release-clm5.0.05 onto master - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev007 -Originator(s): sacks (Bill Sacks) -Date: Sun Aug 5 21:03:28 MDT 2018 -One-line Summary: Avoid glacier dynamic landunit adjustments in first time step - -Purpose of changes ------------------- - -Always avoid generating dynamic landunit adjustments for glacier area -changes in the first timestep of a startup or hybrid run - not just for -cold start or interpolated start. See the detailed discussion in -https://github.com/ESCOMP/ctsm/issues/340 for rationale. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for - glacier changes in the first timestep) - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - not run - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - ok means tests pass; baseline failures as expected in these two - tests that do not use init_interp: - - FAIL ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default BASELINE ctsm1.0.dev006 - FAIL SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput BASELINE ctsm1.0.dev006 - - (The glacier area on the finidat file used in these tests - - clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c180715.nc - - seems to have come from an finidat_interp_dest file, and thus does - not match the glacier area from CISM.) - -CTSM tag used for the baseline comparisons: ctsm1.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Startup / Hybrid runs that include CISM - (even NOEVOLVE) and do not use init_interp, due to: - - different PE layout in new case vs. the one that generated the - finidat (roundoff-level diffs) - - different glacier area on finidat file vs. what's in CISM - (greater than roundoff-level diffs) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Roundoff-level for different PE layout, larger than roundoff but - should be same climate when there is different glacier area on the - finidat file vs. what's in CISM - - The differences arise from dynamic landunit adjustments of the - below-ground C and N states in the old code, as CTSM adjusts its - areas to match CISM's. In the new code, there are no C and N - adjustments in the first time step from this adjustment. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- #470 (Avoid glacier dynamic landunit adjustments in first time step) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Sat Aug 4 07:48:09 MDT 2018 -One-line Summary: Minor bug fixes, cleanup, documentation and enhancements - -Purpose of changes ------------------- - -A collection of minor bug fixes, code cleanup, documentation and -enhancements, all bit-for-bit. See list of issues fixed below for -details. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #24 (ncd_io_1d_log_glob is broken) -- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 -- Fixes #217 (Change some cheyenne_gnu tests to cheyenne_intel) -- Fixes #245 (Put all .gitignore entries in top-level file) -- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR - is used) -- Fixes #283 (Add more helpful message about need to do init_interp with - wrong number of vertical layers) -- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a - TG compset) -- Fixes #412 (Fix documentation of init_interp_method) -- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) -- Fixes #464 (Some lines longer than 132 characters) -- Fixes #465 (Remove backwards compatibility check for snw_rds) -- Fixes #467 (Increase wallclock limit for test) - - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed a single-point test from gnu to intel to get better debugging - information - (SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm45BgcCropQianGs.cheyenne_intel.clm-cropMonthOutput) -- For some single-point tests on both gnu and intel: removed one - compiler, keeping the tests on just one - -Code reviewed by: self - - -CTSM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - NLCOMP failures as expected for tests with the cmip6 test mod - - Some long single-point gnu tests failed due to running out of - wallclock time; I have removed these, just keeping them on intel - (along with removing a few other tests after I ran the testing - see - commit 5c226bdf): - - FAIL ERS_Lm54_Mmpi-serial.1x1_numaIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=4803 - FAIL ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHistClm50BgcCropGs.cheyenne_gnu.clm-cropMonthOutput RUN time=6024 - - -CTSM tag used for the baseline comparisons: ctsm1.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -- #392 (Remove old code for snw_rds restart that looks no longer needed) -- (Other changes not documented in PRs) - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev004 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Jul 18 02:10:23 MDT 2018 -One-line Summary: Add some new diagnostic fields, fix a few issues, update cmip6 output - -Purpose of changes ------------------- - -Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. -Fix a couple issues. Get full list of history tapes working correctly. Check for valid range -of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): $210, #427, #429 - #210 -- increase number of history tapes - $427 -- Check for zero CO2 - #429 -- New IC for present day - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New history fields - TSKIN --- skin temperature - TSL ----- temperature of near-surface soil layer - GSSUNLN - sunlit leaf stomatal conductance at local noon - GSSHALN - shaded leaf stomatal conductance at local noon - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New finidat file f19_g17_gl4 2000 Clm50BgcCrop - New file is just interpolate from the previous file to a f19_g17_gl4 gridfor Clm50BgcCrop and 2000 simulation year - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: None - -Code reviewed by: self, oleson, abtawfik - - -CTSM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - OK (95 are different because of finidat file change) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- PASS - hobart_pgi -------- FAIL - hobart_intel ------ PASS - -CTSM tag used for the baseline comparisons: ctsm1.0.dev003 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes -- only 2000 cases because of new IC - - Summarize any changes to answers, i.e., - - what code configurations: Just 2000 cases - - what platforms/compilers: All - - nature of change: same climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - - #338 -- Radtemp and other new diagnostic fields - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev003 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sun Jul 15 00:26:46 MDT 2018 -One-line Summary: Update cime/cism to work on upgraded hobart and with glade changes on cheyenne - -Purpose of changes ------------------- - -Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found -in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was -changed to a new directory. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] - #441 -- Changes in glade invalidate previous softlinks and data locations - #438 -- Illegal argument aliasing caught by nag6.2 - #433 -- with hobart upgrade CTSM not working - -Known bugs introduced in this tag (include github issue ID): - #444 -- PGI fails on cheyenne and hobart - -Known bugs found since the previous tag (include github issue ID): - #443 -- Wood C:N ratios - #440 -- leafcn_max < target leafcn? - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? No -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[ ] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): DIN_LOC_ROOT_CLMFORC on cheyenne - DIN_LOC_ROOT_CLMFORC was change on cheyenne - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CTSMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: path for cheyenne specific test had to be changed - Add some gnu tests on hobart - Lengthen wallclock on a test - Fix path for DA test_mod - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- FAIL - hobart_gnu -------- PASS - hobart_intel ------ PASS - -CLM tag used for the baseline comparisons: ctsm1.0.dev002 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): cime, cism - cism-wrapper to release-cesm2.0.04 - cime to cime5.6.10 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #444 -- Get working on upgraded hobart and with glade changes on cheyenne - -=============================================================== -=============================================================== -Tag name: ctsm1.0.dev002 -Originator(s): erik (Erik Kluzek) -Date: Fri Jul 6 16:33:03 MDT 2018 -One-line Summary: Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases - -Purpose of changes ------------------- - -Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere -and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts -them to zero's. - -There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. - -And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory -for transient cases. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #435, #436, #433 (for tools) - #435 -- intel build for tools - #426 -- Nitrogen Fixation flux variables - #433 -- hobart broken, got it working for tools - -Known bugs found since the previous tag (include github issue ID): #433, #431 - - #433 -- with hobart upgrade, hobart build isn't working - #431 -- When set_* options are used to hist_addfld be careful of ordering - -Significant changes to scientifically-supported configurations --------------------------------------------------------------- - -Does this tag change answers significantly for any of the following physics configurations? -(Details of any changes will be given in the "Answer changes" section below.) - - [Put an [X] in the box for any configuration with significant answer changes.] - -[X] clm5_0 - -[ ] clm4_5 - -[ ] clm4_0 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): ndep file updated for clm5_0 for 1850 - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- -NOTE: Be sure to review the steps in .CLMTrunkChecklist as well as the coding style in the Developers Guide - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): NFIX flux variables - NFIX flux variables when read from restart have special-values (missing on non veg landunits) converted to zero's - They are now initialized to zero everywhere. - -Changes to tests or testing: None - -Code reviewed by: self, wwieder, and lawrence, sacks (mksurfdata_map code) - -CLM testing: regular (although none on hobart!) - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (5 tests differ from previous version) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - -CLM tag used for the baseline comparisons: ctsm1.0.dev001 - - -Answer changes --------------- - -Changes answers relative to baseline: clm5_0 BGC configurations with FUN and clm5_0 with BGC for new 1850 ndep file - - Summarize any changes to answers, i.e., - - what code configurations: All clm5_0 BGC due to NFIX fields, and clm5_0 1850 BGC due to new ndep file - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #437 -- ChangeLog template - #432 -- nfix - #331 -- _MAX fields on mksurfdata_map - -=============================================================== -=============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum deleted file mode 100644 index 478d39706a..0000000000 --- a/doc/ChangeSum +++ /dev/null @@ -1,539 +0,0 @@ -Tag Who Date Summary -============================================================================================================================ -<<<<<<< HEAD -release-clm5.0.08 erik 09/28/2018 Updated CMIP6 ndep file for historical transient Bgc cases, 1850_control same as before - ctsm1.0.dev009 sacks 08/22/2018 Fix initialization of AnnET in InitAccVars -release-clm5.0.07 erik 08/08/2018 Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 -release-clm5.0.06 erik 08/07/2018 Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 - ctsm1.0.dev008 erik 08/14/2018 Update 1850 ndep file and last year for streams for Historical transient cases (same as release-clm5.0.05) -release-clm5.0.05 erik 08/05/2018 Update 1850 ndep file, and last year for transient streams -||||||| parent of 3f7152f8... Update changelog - ctsm1.0.dev008 erik 08/14/2018 Update 1850 ndep file and last year for streams for Historical transient cases -======= - ctsm1.0.dev009 sacks 08/22/2018 Fix initialization of AnnET in InitAccVars - ctsm1.0.dev008 erik 08/14/2018 Update 1850 ndep file and last year for streams for Historical transient cases ->>>>>>> 3f7152f8... Update changelog - ctsm1.0.dev007 sacks 08/05/2018 Avoid glacier dynamic landunit adjustments in first time step - ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements -release-clm5.0.04 erik 07/18/2018 Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output - ctsm1.0.dev004 erik 07/18/2018 Add some new diagnostic fields, fix a few issues, update cmip6 output - ctsm1.0.dev003 erik 07/15/2018 Update cime/cism to work on upgraded hobart and with glade changes on cheyenne - ctsm1.0.dev002 erik 07/06/2018 Fix NFIX flux variables so special land-units are zeroed out, tools update, add some *_MAX fields on mksurfdata_map for transient cases -release-clm5.0.03 erik 06/12/2018 Second release branch tag for CESM2.0 release, fixing DA and tools and README files, identical to clm5.0.dev013 -release-clm5.0.02 erik 06/12/2018 Mistake tag identical to previous version - clm5.0.dev013 erik 06/12/2018 cleanup and update cime and cism -release-clm5.0.01 erik 05/22/2018 First release branch tag for CESM2.0 release, identical to clm5.0.dev012 - clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode - clm5.0.dev011 erik 05/16/2018 1850 ndep update, cism update, PE layouts, turn BFBFLAG for testing - clm5.0.dev010 erik 05/15/2018 Update cime version to version in cesm2.0.beta10, changes answers for 1850 compsets because of orbit - clm5.0.dev009 sacks 05/10/2018 New init_interp method - clm5.0.dev008 erik 04/27/2018 With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - clm5.0.dev007 erik 04/24/2018 Bring in a few answer changing things: FATES, cism updates, IC file fix, - testing 1850 compset use 1850 orbit - clm5.0.dev006 sacks 04/12/2018 Don't allocate memory for zero-weight natveg patches and urban - clm5.0.dev005 sacks 04/10/2018 Two fixes for init_interp - clm5.0.dev004 erik 04/09/2018 List of important bug fixes - clm5.0.dev003 erik 03/09/2018 Bug fixes for energy imbalance associated with surface water and lakes - clm5.0.dev002 sacks 02/25/2018 Add some land ice diagnostic vars needed for CMIP6 - clm5.0.dev001 erik 02/14/2018 Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - clm5.0.dev000 erik 02/05/2018 Double tag of clm5.0.000 with new naming convention, some updated documentation - clm5.0.000 erik 02/05/2018 Double tag of clm4_5_18_r275 for clm5.0 release - clm4_5_18_r275 erik 02/05/2018 Update initial condition files, update fates, new CMIP6 pop-dens, more lnd_tuning_mod options, updated ndep for fully coupled - clm4_5_18_r274 sacks 01/30/2018 Fix auto-detection of CIME_MODEL in a standalone checkout - clm4_5_18_r273 sacks 01/26/2018 Support a standalone checkout from git - clm4_5_18_r272 erik 01/25/2018 Bring in latest FATES release version to CLM trunk: fates_s1.4.1_a3.0.0_rev2 - clm4_5_18_r271 erik 01/20/2018 Update testlist to v2 and remove yellowstone - clm4_5_18_r270 sacks 12/20/2017 Always use multiple elevation classes for glacier, even with stub glc - clm4_5_18_r269 erik 12/16/2017 Move externals to version in github - clm4_5_18_r268 erik 12/11/2017 Fix calculation of stomatal resistence used in dry-deposition, increase threshold of totvegc for soil decomposition to 0.1 - clm4_5_18_r267 sacks 12/07/2017 Fixes to accumulator fields - clm4_5_17_r266 sacks 11/27/2017 Avoid negative snow densities - clm4_5_17_r265 erik 11/18/2017 Update the clm50 parameter file for better behavior with prognostic crop, and fix a bug in clm50 urban model - clm4_5_17_r264 erik 11/16/2017 Changes from Dave Lawrenece on resetting soil carbon for spinup - clm4_5_17_r263 erik 11/08/2017 Drydep vel. for SO2 doubled, influence of organic mater in soil calmed, max daylength not hardwired to present day - clm4_5_16_r262 sacks 10/27/2017 Rename atm2lnd history fields for downscaled fields, properly turn on vic for clm45, and other minor fixes - clm4_5_16_r261 sacks 10/25/2017 Add option to reset snow over glacier columns - clm4_5_16_r260 erik 10/24/2017 Update paramater file for CLM50 as well as fates, fix a few issues - clm4_5_16_r259 erik 10/17/2017 Update to latest cime from cesm2_0_beta07 and config_components version 3 - clm4_5_16_r258 erik 10/06/2017 Revert change to fire, set n_melt_glcmec=10, update mosart to version that doesn't accumulate water in short rivers - clm4_5_16_r257 erik 09/29/2017 Fix two bugs found by Hui Tang, one for Carbon isotopes and one in the fire model - clm4_5_16_r256 erik 09/20/2017 Fresh snow grain radius is temperature dependent - clm4_5_16_r255 erik 09/18/2017 Changes to crop and enabling Carbon isotopes for crop and some miscellaneous small changes - clm4_5_16_r254 erik 09/01/2017 Update surface datasets, and point to new CMIP6 population density dataset - clm4_5_16_r253 erik 08/04/2017 Check on reasonable import/export from CLM, check ndep units from input file - clm4_5_16_r252 erik 07/24/2017 Update parameter file for some crop albedo issues, and fix a bug in urban albedo for nightime - clm4_5_16_r251 erik 07/14/2017 Update mksurfdata_map for soil depth/color, add new mapping files - clm4_5_16_r250 erik 07/13/2017 Update finundation dataset, new fsurdat files with updated soil color and soil depth, - update mosart areas, fix cheyenne_gnu - clm4_5_16_r249 sacks 07/06/2017 All new compsets, reworked test lists, and related fixes - clm4_5_16_r248 sacks 06/28/2017 Melt most ice runoff - clm4_5_16_r247 sacks 06/26/2017 New GLACIER_REGION field with CISM domain split in two - clm4_5_16_r246 sacks 06/14/2017 Update to latest cime - clm4_5_16_r245 sacks 06/14/2017 Only adjust glc_mec topographic heights if glc_do_dynglacier is true - clm4_5_16_r244 erik 06/09/2017 Update cime and cism externals, changes answers for IG compsets, test g17 grids, fix a few - issues, update mksurfdata_map - clm4_5_16_r243 andre 05/23/2017 History output cleanup from Dave Lawrence - clm4_5_16_r242 erik 05/21/2017 Use finundated streams for CLM50, and use ndep if it comes from cpl - clm4_5_16_r241 sacks 05/16/2017 Fix ch4 subtle dependence on processor count - clm4_5_16_r240 sacks 05/15/2017 Make glc_dyn_runoff_routing real-valued - clm4_5_16_r239 sacks 05/13/2017 Avoid division by zero in snow WindDriftCompaction - clm4_5_16_r238 andre 05/13/2017 ED is now an external library 'fates' - clm4_5_16_r237 erik 05/09/2017 Latest parameter file and some changes for CLM50, CLM45-transient changes answers also - clm4_5_15_r236 erik 05/01/2017 New surface datasets, and landuse.timeseries files, as well as interpolating initial conditions for - almost all cases - clm4_5_15_r235 sacks 04/27/2017 Zero dynbal fluxes if namelist variable is set - clm4_5_15_r234 andre 04/14/2017 Update rtm and mosart externals - clm4_5_15_r233 erik 04/11/2017 Pull out some constants and options to namelist - clm4_5_15_r232 erik 04/05/2017 Some small changes that affect both clm4_5 and clm5_0 answers (can be considered bug fixes to clm4_5) - clm4_5_14_r231 sacks 04/02/2017 Add option to reset snow pack over non-glacier columns - clm4_5_14_r230 sacks 03/31/2017 Fix dynamic landunits water and energy conservation - clm4_5_14_r229 erik 03/10/2017 Update cime and make some changes to drv_flds_in namelist, fix some minor bugs - clm4_5_14_r228 erik 03/07/2017 Bring in changes that were accidentally dropped as part of the clm4_5_14_r226 tag - clm4_5_14_r227 sacks 03/06/2017 Improve performance of dynamic landunits code - clm4_5_14_r226 erik 03/02/2017 Update cime, mosart and ccism to a version that is cesm2_0_beta05 or part of beta06 - clm4_5_14_r225 sacks 02/19/2017 Fix GDD accumulation in new crop columns - clm4_5_14_r224 sacks 02/10/2017 Tweaks for glaciers and snow - clm4_5_14_r223 sacks 02/03/2017 Handle patch-level C&N variables correctly with dynamic landunits - clm4_5_14_r222 sacks 01/27/2017 Fix energy budget bug with fractional snow on glacier and wetland columns - clm4_5_14_r221 sacks 01/24/2017 Change rain-snow partitioning and ice albedo for glacier columns - clm4_5_14_r220 sacks 01/22/2017 Fix crop seeding - clm4_5_14_r219 erik 01/21/2017 Answer changes for CLM50 for several issues that lead to dead crops - clm4_5_14_r218 sacks 01/13/2017 For newly initiating columns: do not copy snow state - clm4_5_14_r217 sacks 01/13/2017 Bug fix for snow radiation absorption - clm4_5_14_r216 erik 01/12/2017 Fix previous broken tag - clm4_5_14_r215 erik 01/12/2017 Update mksurfdata_map to work with new updated datasets from Peter, and use hand-edited - surfdata/landuse.timeseries datasets for f09/f19 - clm4_5_14_r214 sacks 01/03/2017 Update column states based on dwt terms between dyn_cnbal_patch and dyn_cnbal_col, and minor fixes - clm4_5_14_r213 sacks 12/30/2016 Convert buildnml to python - clm4_5_14_r212 sacks 12/22/2016 Bump science version number due to changes in clm4_5_13_r211 - clm4_5_13_r211 sacks 12/22/2016 Apply transient land cover and harvest all at once in first time step of year - clm4_5_13_r210 sacks 12/17/2016 Update cime to cesm2_0_beta04 version - clm4_5_13_r209 sacks 12/11/2016 Change definition of NBP; bring back some r205 changes that were lost in r207 - clm4_5_13_r208 sacks 12/10/2016 Rework irrigation; remove glc_smb logical - clm4_5_13_r207 andre 12/08/2016 PHS - Calculate separate root water uptake resistances for soil and root pathways - clm4_5_13_r206 andre 11/29/2016 Bugfix for Luna causing arctic to die - clm4_5_13_r205 sacks 11/16/2016 Add diagnostics for snow and glacier; fix crash in Megan - clm4_5_13_r204 erik 11/15/2016 A few answer changing bug fixes - clm4_5_12_r203 sacks 11/10/2016 Bug fixes for snow-on-lake - clm4_5_12_r202 sacks 11/09/2016 Update to cime version used in cesm2_0_beta03 - clm4_5_12_r201 sacks 11/09/2016 Rework initialization of transient weights - important with use_init_interp - clm4_5_12_r200 erik 11/08/2016 Latest parameter updates from simulations, ignore surface soil layer for plant hydraulic stress - for greater variability in surface soil moisture - clm4_5_12_r199 sacks 10/29/2016 Use CISM2 by default - clm4_5_12_r198 sacks 10/20/2016 Rework mapping of irrigation from CLM to ROF - clm4_5_12_r197 erik 10/14/2016 Some cleanup for plant hydraulic stress and adding more namelist parameters - clm4_5_12_r196 erik 09/27/2016 Bring new cime5 to clm trunk - clm4_5_12_r195 sacks 09/18/2016 Remove dependence on column weights in fire code - clm4_5_12_r194 sacks 09/01/2016 Dribble annual dyn landunit adjustment fluxes; initialize water state for new crop columns - clm4_5_12_r193 andre 08/30/2016 Bugfix in BalanceCheckMod: revert tolerance change and removal of endrun call introduced in r192 - clm4_5_12_r192 andre 08/27/2016 ED bugfixes and initial refactoring for a standalone library - clm4_5_12_r191 sacks 08/21/2016 New parameterizations for snow overburden compaction and wind drift compaction - clm4_5_12_r190 sacks 08/20/2016 Fix snow capping bug - clm4_5_11_r189 erik 08/18/2016 Bring in time varying streams for urban data (currently triggers AC use) - clm4_5_11_r188 erik 08/05/2016 A set of small answer changing issues for both clm45 and clm50 - clm4_5_10_r187 erik 07/26/2016 CLM45/50 changes: seperate carbon and water root profile, turn off undercanopystability, - really turn PHS on, LUNA predict sunlit fraction N fractionation - clm4_5_9_r186 sacks 07/13/2016 Initialize biogeochem balance checks AFTER column area updates - clm4_5_9_r185 sacks 07/07/2016 Revert glacial melt behavior to the old treatment for mountain glaciers - clm4_5_9_r184 erik 07/06/2016 CLM50 changes: Atkin form of lmr changed, new parameters and files, turn PHS on by default, - new cold snow density, reseed at exit AD spinup, fix fire bug, fix npool and cpool errors - clm4_5_9_r183 erik 07/02/2016 Decomposition is not water limited after reaching a field capacity parameter (maxpsi_hr) - rather than only at soil saturation - clm4_5_8_r182 erik 06/24/2016 Bring in option for plant hydraulic stress for clm50 - clm4_5_8_r181 erik 06/17/2016 Update cime version which fixes several issues and changes answers - clm4_5_8_r180 sacks 06/06/2016 Refactor dyn_cnbal_patch - clm4_5_8_r179 sacks 05/27/2016 Update column-level BGC state variables with dynamic landunits - clm4_5_8_r178 sacks 04/17/2016 Remove some consistency checks, and merge crop_prog with use_crop in code - clm4_5_8_r177 sacks 04/14/2016 Move CN product pools to gridcell level - clm4_5_8_r176 sacks 04/13/2016 Calculate active flags and filters earlier in initialization - clm4_5_8_r175 sacks 04/09/2016 For glc_mec, change downscaling and where SMB is computed - clm4_5_8_r174 erik 03/25/2016 Bring Rosie's respiration changes to the trunk - clm4_5_8_r173 sacks 03/17/2016 Major refactor of CN Products - clm4_5_8_r172 sacks 03/08/2016 Exclude land use and product pools / fluxes from CN summary diagnostics - clm4_5_8_r171 erik 03/02/2016 Backout COMP_RUN_BARRIERS setting, and remove all ED tests from testlist (as they all fail) - clm4_5_8_r170 sacks 02/28/2016 Add a wrapper for CN Vegetation - clm4_5_8_r169 erik 02/23/2016 Add fire several fire constants to namelist, add some new clm45/50 surface datasets - clm4_5_8_r168 sacks 02/20/2016 Fix zero methane production - clm4_5_7_r167 sacks 02/20/2016 Fix carbon isotopes in transient runs - clm4_5_7_r166 sacks 02/02/2016 Infrastructure for carbon and nitrogen conservation with dynamic landunits - clm4_5_7_r165 sacks 01/29/2016 Remove fglcmask, recreate all surface datasets - clm4_5_7_r164 erik 01/12/2016 Update CIME and MOSART - clm4_5_7_r163 sacks 12/23/2015 Improve crop performance by allocating less memory - clm4_5_7_r162 andre 12/18/2015 negative runoff updates. - clm4_5_6_r161 sacks 12/17/2015 Collapse mountain glaciers to a single elevation class - clm4_5_6_r160 sacks 12/11/2015 For glc_mec, get gridcell topographic height from atm - clm4_5_6_r159 erik 12/10/2015 Update CIME version - clm4_5_6_r158 andre 12/04/2015 misc clm 5.0 bugfixes - clm4_5_6_r157 sacks 11/27/2015 Reduce memory use for init_interp - clm4_5_6_r156 sacks 11/24/2015 Fix QSNWCPICE and glacial inception - clm4_5_6_r155 erik 11/23/2015 Bring FUN (Fixation and Uptake of Nitrogen) code option to trunk - from Mingjie, as well as latitude varying spinup from Charlie, - and a fix for crop with dynamic roots from Beth - clm4_5_6_r154 andre 11/18/2015 one year grain product pool - clm4_5_6_r153 sacks 11/17/2015 Fix snow cover fraction bug - clm4_5_5_r152 sacks 11/17/2015 Fix glc_mec energy conservation bug - clm4_5_4_r151 erik 11/13/2015 Fix broken r150 tag, with bgc_spinup issue in it - clm4_5_4_r150 erik 11/13/2015 Some needed answer changing fixes for: fire, disallow - negative photosynthis, and reduce LAI of DBT in evergreen state - clm4_5_3_r149 sacks 11/08/2015 Change cold start initialization of snow pack - clm4_5_3_r148 sacks 11/07/2015 For CLM5, increase max snow depth to 20 m - clm4_5_3_r147 andre 11/05/2015 swenson bedrock and coupler runoff bugfixes - clm4_5_3_r146 sacks 11/04/2015 Implement vertical interpolation in init_interp - clm4_5_3_r145 andre 11/03/2015 update clm50 defaults, enable clm50 crop compsets - clm4_5_3_r144 sacks 10/27/2015 Better fix for bug that leads to infinite growth in snow depth - clm4_5_3_r143 andre 10/22/2015 flexibleCN and luna bugfixes. - clm4_5_3_r142 sacks 10/19/2015 Fix bug in initialization of 12-layer snow pack - clm4_5_3_r141 sacks 10/19/2015 Fix bug that leads to infinite growth in snow depth - clm4_5_3_r140 andre 10/15/2015 mosart direct to ocean runoff - clm4_5_3_r139 andre 10/13/2015 dynamic roots from Beth Drewniak - clm4_5_3_r138 andre 10/11/2015 new accelerated spinup and soil vertical structure - clm4_5_3_r137 erik 10/09/2015 Bring in changes for fire-emissions as well tuning changes to the fire model to be used with clm5_0 - clm4_5_3_r136 andre 10/08/2015 coupler field prep for mosart and externals update - clm4_5_3_r135 sacks 10/06/2015 Substantial reduction in memory allocation for prognostic crops - clm4_5_3_r134 sacks 10/04/2015 Fixes for transient and preindustrial crop cases - clm4_5_3_r133 andre 10/02/2015 Bugfix for mksurfdata_map - add file missed by clm4_5_2_r125. - clm4_5_3_r132 andre 10/02/2015 Modify soil BGC diffusion and cryoturbation code to allow for spatially variable soil thickness. - clm4_5_3_r131 sacks 09/30/2015 Bring in cime3 - clm4_5_3_r130 andre 09/28/2015 add namelist option to reduce lake evaporation and irrigation when river water storage falls below a threshold value, and add an additional constraint on stress deciduous leaf onset. - clm4_5_3_r129 andre 09/25/2015 bump tag revision number because clm4_5_2_r128 was climate changing. - clm4_5_2_r128 andre 09/24/2015 science bugfixes (not bfb) for root fraction and bedrock thermal properties - clm4_5_2_r127 sacks 09/18/2015 Fix interpolation of initial conditions for glc_mec and crop <-> non-crop - clm4_5_2_r126 andre 09/17/2015 New decomp_depth_efolding value for clm5.0, set as a namelist parameter instead of netcdf params file. - clm4_5_2_r125 andre 09/15/2015 clm 50 hydrology updates. - clm4_5_2_r124 sacks 09/13/2015 Wind-dependent snow density - clm4_5_2_r123 sacks 09/10/2015 Fix some problems with pgi and nag compilers - clm4_5_2_r122 sacks 09/09/2015 Update to latest cime - clm4_5_2_r121 sacks 09/04/2015 Rework snow capping - clm4_5_1_r120 andre 08/29/2015 CLM 5 nitrogen models Flexible CN and LUNA - clm4_5_1_r119 erik 08/26/2015 Bring hobart/nag bug fixes to trunk, and fix a few bugs - clm4_5_1_r118 sacks 08/05/2015 Minor rework of glc coupling fields - clm4_5_1_r117 sacks 07/28/2015 Repartition rain vs. snow from atmosphere - clm4_5_1_r116 sacks 07/22/2015 Rename some history fields - clm4_5_1_r115 sacks 07/15/2015 Remove redundant code, rename a variable - clm4_5_1_r114 sacks 07/10/2015 Update cime external, remove genf90-generated files - clm4_5_1_r113 sacks 07/09/2015 Support backwards compatibility of restart variable names - clm4_5_1_r112 oleson 07/01/2015 Justin Perket snow on vegetation - clm4_5_1_r111 sacks 06/12/2015 Remove temporary hack to get bfb results in InitSnowLayers - clm4_5_1_r110 sacks 06/12/2015 Add flexibility to have more snow layers - clm4_5_1_r109 sacks 06/06/2015 Fix bug in DivideSnowLayers - clm4_5_1_r108 andre 05/29/2015 Crop changes from Sam Levis - clm4_5_1_r107 andre 05/19/2015 Update externals to use github version of cime1.0.7. - clm4_5_1_r106 erik 05/14/2015 Fix CO2 forcing for MEGAN - clm4_5_1_r105 erik 04/16/2015 Move test lists to beneath active components, change build scripts from cshell to perl, move to new cime directory structure - clm4_5_1_r104 erik 01/27/2015 Update externals to latest cesm beta tag + bring in shared build for clm4_5/clm5_0 for testing - clm4_5_1_r103 sacks 01/01/2015 enable transient crops - clm4_5_1_r102 sacks 12/27/2014 make new input datasets to support transient crops - clm4_5_1_r101 sacks 12/09/2014 rework cold start initialization for transient runs - clm4_5_1_r100 sacks 12/03/2014 update pio calls to pio2 API - clm4_5_1_r099 sacks 12/02/2014 add ozone stress code from Danica Lombardozzi - clm4_5_1_r098 sacks 11/29/2014 update externals to cesm1_3_beta14 or beyond - clm4_5_1_r097 mvertens 11/24/2014 major refactorization to introduce new soilbiogeochem data types and routines that are independent of either ED or CN datatypes - clm4_5_1_r096 erik 11/19/2014 Several answer changing bug-fixes: snow grain size, lake hydrology, default settings, organic soil - clm4_5_1_r095 andre 11/10/2014 N comp refactoring by Jinyun Tang (LBL) and transpiration sink isolation by Gautam Bisht (LBL) - clm4_5_1_r094 sacks 11/07/2014 misc. glacier-related updates - clm4_5_1_r093 sacks 11/07/2014 change cold-start snow initialization, update cism external - clm4_5_1_r092 muszala 11/04/2014 bug fixes from santos that address valgrind problems. update rtm external - clm4_5_1_r091 muszala 10/27/2014 update externals. fix bug so CLM runs with Intel 14x. - clm4_5_1_r090 sacks 10/16/2014 modularize irrigation; do some unit test rework - clm4_5_1_r089 erik 10/13/2014 Bring new urban building temperature to trunk as a clm5.0 feature as well as human-stress index calculations - clm4_5_1_r088 muszala 10/01/2014 pull out ED deps. in TemperatureTypeMod, can now compile with pgi 14.7 - clm4_5_1_r087 erik 09/30/2014 Fix two balance check errors, and turn abort for balance check back on to appropriate levels - clm4_5_1_r086 muszala 09/25/2014 critical ED modifications from r fisher, fix bug 2043 - clm4_5_1_r085 sacks 09/19/2014 replace conditionals with polymorphism for soil water retention curve - clm4_5_1_r084 sacks 09/18/2014 make glc_dyn_runoff_routing spatially-varying, based on input from glc - clm4_5_1_r083 muszala 09/17/2014 only update scripts and run new baselines. this due to an error in yellowstone pgi test naming (clm_aux45 changed to aux_clm45) - clm4_5_1_r082 muszala 09/11/2014 Merge in a number of ED changes to address science bugs and infrastructure (partiulararly restarts) - clm4_5_1_r081 mvertens 08/24/2014 major infrastructure changes and directory reorganization under src - clm4_5_1_r080 erik 08/16/2014 Update externals to trunk version, allow eighth degree as a valid resolution - clm4_5_1_r079 andre 07/31/2014 G. Bisht (LBL) soil temperature refactor; machines update for goldbach-intel - clm4_5_1_r078 muszala 07/23/2014 add lai stream capability and the ability to run with V5 cruncep data - clm4_5_1_r077 andre 07/10/2014 Refactor from Jinyun Tang (LBL) to make hydrology more modular. - clm4_5_1_r076 erik 07/07/2014 Answer changes for fire code from Fang Li - clm4_5_75 muszala 05/30/2014 update externals to rtm1_0_38 and esmf_wrf_timemgr_140523 - clm4_5_74 sacks 05/28/2014 misc. bfb changes - see detailed summary below - clm4_5_73 erik 05/28/2014 Add the stub ability for clm5_0 physics to CLM build system - clm4_5_72 muszala 05/05/2014 Introduce code for Ecosystem Demography (CLM(ED)) Model - clm4_5_71 sacks 05/02/2014 2-way feedbacks for glacier, veg columns compute glacier SMB, and related changes - clm4_5_70 muszala 04/18/2014 bring in SHR_ASSERT macros - clm4_5_69 andre 03/18/2014 start unit testing build-namelist - clm4_5_68 erik 03/07/2014 Update scripts to version that turns on transient CO2 streams for transient compsets, and update CISM (changes answers) - clm4_5_67 mvertens 03/06/2014 removed initSurfAlb as part of the initialization - clm4_5_66 mvertens 03/03/2014 refactoring of initialization and introduction of run-time finidat interpolation - clm4_5_65 mvertens 02/25/2014 Turn off MEGAN vocs when crops is running - clm4_5_64 muszala 02/19/2014 fix and clean ncdio_pio.F90.in. clean clm_time_manager. update externals. - clm4_5_63 sacks 02/14/2014 add some code needed for dynamic landunits; activate 0-weight veg landunit sometimes - clm4_5_62 erik 02/10/2014 Get PTCLM working robustly, US-UMB test working, add CO2 streams to datm, add more consistency testing between compsets and user settings - clm4_5_61 sacks 02/04/2014 add 3-d snow history fields; continue harvest past end of pftdyn timeseries - clm4_5_60 andre 01/30/2014 refactor build-namelist - clm4_5_59 sacks 01/22/2014 use new get_curr_yearfrac function in clm_time_manager - clm4_5_58 sacks 01/22/2014 major refactor of transient pft code, in prep for dynamic landunits - clm4_5_57 sacks 01/07/2014 change CNDV water conservation to use the pftdyn method - clm4_5_56 sacks 01/02/2014 update scripts external to fix I20TRCLM45BGC compset - clm4_5_55 sacks 12/27/2013 add hooks to Sean Santos's unit test frameworks, and begin to add CLM unit tests - clm4_5_54 sacks 12/27/2013 update externals to cesm1_3_beta06 - clm4_5_53 muszala 12/19/2013 refactor restart interfaces - clm4_5_52 sacks 11/26/2013 turn on longwave radiation downscaling for glc_mec by default - clm4_5_51 sacks 11/26/2013 rework downscaling of atm fields for glc_mec - clm4_5_50 erik 11/24/2013 Bring in a bunch of b4b bugfixes, fix getregional script, start move of PTCLM to PTCLMmkdata tool - clm4_5_49 muszala 11/16/2013 swenson anomaly forcing - part 1 - clm4_5_48 muszala 11/14/2013 bug fixes for CLM dry deposition and MEGAN VOC emissions - clm4_5_47 muszala 11/12/2013 fix Bug 1858 - AGDD now reset annually - clm4_5_46 sacks 11/08/2013 remove zeroing out of slope for special landunits - clm4_5_45 sacks 11/08/2013 refactor daylength calculation, and other minor changes - clm4_5_44 sacks 11/08/2013 temporary hack to daylength initialization to provide baselines for the next tag - clm4_5_43 sacks 11/06/2013 allocate memory for most landunits in every grid cell (needed for dynamic landunits) - clm4_5_42 sacks 11/04/2013 fix bug 1857 for CLM4.5 - CNDV running temperature means are incorrect - clm4_5_41 andre 10/30/2013 update scripts to convert clm4_5 CPP flags to namelist variables. - clm4_5_40 muszala 10/24/2013 fix Bug 1752 - urban conductances depend on weights in an undesirable way - clm4_5_39 muszala 10/23/2013 bug fix from santos - h2osoi_vol not passed to atmosphere model on restart - clm4_5_38 sacks 10/18/2013 change irrigation variables to be pft-level - clm4_5_37 muszala 10/10/2013 Modifications to bring clm up to date with major driver refactoring in drvseq5_0_01 - clm4_5_36 sacks 10/04/2013 new surface datasets, and other minor fixes - clm4_5_35 sacks 10/01/2013 get CLM running on edison - clm4_5_34 erik 09/30/2013 Get PTCLM working, fix a few small bugs - clm4_5_33 muszala 09/26/2013 clean up from mistakes in previous tag - clm4_5_32 muszala 09/26/2013 bug fix tag - 1798, 1810 - clm4_5_31 sacks 09/25/2013 fix bug 1820: incomplete conditional in CNSoyfix leads to buggy results and decomposition dependence - clm4_5_30 sacks 09/24/2013 fix performance bug in decomposition initialization - clm4_5_29 sacks 09/24/2013 fix threading in CLM4.5, and other misc fixes - clm4_5_28 sacks 09/20/2013 fix FracH2oSfc bug - clm4_5_27 sacks 09/20/2013 fix crop nyrs bug - clm4_5_26 muszala 09/19/2013 water balance and SMS_Ly1.f19_g16.ICLM45BGCCROP fix - clm4_5_25 erik 09/13/2013 Bring in Tony's changes to kick sno all the way up to the coupler layer, makes all - CESM components more similar to each other - clm4_5_24 sacks 09/03/2013 update externals to cesm1_3_beta02 or later - clm4_5_23 muszala 08/22/2013 refactor to allow CH4 params. to be read from netcdf file and clean up clm4_5_20 - clm4_5_22 muszala 07/30/2013 aux_clm testlist reorganization - clm4_5_21 muszala 07/24/2013 ifdef and bounds refactor - clm4_5_20 muszala 07/20/2013 refactor to allow CN and BGC params. to be read from netcdf file - clm4_5_19 sacks 07/17/2013 fix setting of bd in iniTimeConst - clm4_5_18 sacks 07/09/2013 rework urban indexing - clm4_5_17 sacks 07/03/2013 misc cleanup and bug fixes - clm4_5_16 sacks 07/02/2013 only run filters over 'active' points - clm4_5_15 muszala 07/01/2013 complete associate refactor for pointers in clm4_5 source - clm4_5_14 muszala 06/20/2013 preparation for associate refactor in clm4_5_15 - clm4_5_13 andre 06/14/2013 hydrology reordering from Jinyun Tang - clm4_5_12 muszala 06/13/2013 NoVS test, NAG mods and remove TWS from restart file - clm4_5_11 sacks 06/11/2013 Change pct_pft and related surface dataset variables to be % of landunit - clm4_5_10 muszala 06/10/2013 refactor clmtype - clm4_5_09 muszala 06/04/2013 volr and vic fix, update mct and rtm - clm4_5_08 muszala 06/03/2013 port for NAG compiler - clm4_5_07 erik 05/31/2013 New spinup files for CLM45 AND RTM, work on PTCLM, turn drydep off by default, update externals - clm4_5_06 erik 05/15/2013 A few small bug fixes, more updates to README files - clm4_5_05 muszala 05/14/2013 hcru bug fixes - clm4_5_04 erik 05/13/2013 Fix the previous broken tag - clm4_5_03 erik 05/10/2013 Several bug fixes for release, urban and test single point surface datasets - clm4_5_02 sacks 05/07/2013 make 'shared' tools directory, and other minor tools fixes - clm4_5_01 muszala 05/06/2013 update externals - clm4_5_00 erik 05/02/2013 Official end to CLM4.5 development for CLM offline - clm4_0_81 bandre 04/29/2013 Charlie Koven's variable consolidation, cryoturbation and BSW CPP changes - clm4_0_80 erik 04/26/2013 Bring Fang Li. Fire model into CLM4.5 science, update ALL CLM4.5 surface datasets, - provide a working initial condition file for CLM45BGC@f19_g16-1850 - clm4_0_79 muszala 04/24/2013 pftdyn, pft-phys*.nc and datm8 update - clm4_0_78 muszala 04/23/2013 MEGAN fixes - clm4_0_77 sacks 04/23/2013 fix carbon balance bug in transient runs with VERTSOI, and fix Soil Hydrology bug - clm4_0_76 muszala 04/22/2013 spinup changes from Charlie Koven (part 1) - clm4_0_75 muszala 04/19/2013 run propset - clm4_0_74 muszala 04/17/2013 snow_depth changes, major scripts overhaul, bug fix for tools - clm4_0_73 sacks 04/15/2013 update mksurfdata_map for CLM4.5, and other misc. updates, mainly to tools - clm4_0_72 muszala 04/11/2013 maoyi bug fix for vic hydro - clm4_0_71 muszala 04/10/2013 compsets refactoring by mvertens - clm4_0_70 muszala 04/01/2013 bring in vic hydrology - clm4_0_69 muszala 03/26/2013 remove hydro reorder, volr and esmf mods - clm4_0_68 erik 03/16/2013 Fix some issues in mksurfdata_map for generation of ne120np surface data file. - Put error back in CLM if weights don't sum to 100. Add in Keith's photosynthesis change for CLM45. - clm4_0_67 muszala 03/12/2013 Jinyun photosynthesis and hydrology reorder - clm4_0_66 sacks 03/07/2013 turn off subgrid topography snow parameterization for glc_mec landunits - clm4_0_65 sacks 03/07/2013 back out Machines external to get more tests to pass, especially IG - clm4_0_64 muszala 03/06/2013 update externals. fixes 40/45 intial condition problem - clm4_0_63 muszala 03/04/2013 bug 1635 fix - 4_0 CN bug - clm4_0_62 sacks 02/24/2013 add active flags, change subgrid weighting convention, other misc fixes - clm4_0_61 muszala 02/20/2013 rtm, drv and clm mods: tws, olr, r01 rdric file and SoilHydroMod - clm4_0_60 erik 02/11/2013 Bring CLM4.5 code from clm45sci branch to trunk as an option set at configure time - clm4_0_59 mvertens 12/20/2012 restructure clmtype and all pointer references, new directory structure - clm4_0_58 erik 12/14/2012 Uncomment us20 and wus12 datasets, more testing to: bluefire, yellowstone, frankfurt - clm4_0_57 muszala 11/30/2012 update trunk with release mods, some rtm fixes - clm4_0_56 sacks 11/27/2012 fix s2x tsrf, add s2x diagnostics - clm4_0_55 muszala 11/14/2012 bring in flooding capability - clm4_0_54 erik 10/09/2012 Fix esmf for carma field, fix some CLM_USRDAT issues - clm4_0_53 erik 10/03/2012 Update to fsurdat, fpftdyn, finidat datasets, new high resolution organic/fmax/glacier raw datasets - clm4_0_52 sacks 09/27/2012 new pct_glacier raw data file - clm4_0_51 muszala 09/26/2012 bug fixes, pio performance and SCRIP files - clm4_0_50 muszala 09/21/2012 testing of clm and new rof component - clm4_0_49 erik 09/16/2012 Move clm testing to use CESM test framework - clm4_0_48 muszala 09/11/2012 bug fixes, xFail to tests and normalize test output for CLM - clm4_0_47 muszala 08/23/2012 bug fixes - clm4_0_46 muszala 08/08/2012 R01 support and update externals - clm4_0_45 sacks 07/20/2012 fix virtual columns; new urban mksurfdata_map - clm4_0_44 erik 07/09/2012 Add wrf resolutions, update externals to cesm1_1_beta15, all components use build-namelist now - clm4_0_43 sacks 04/06/2012 Add diagnostic fields, modify some existing history fields - clm4_0_42 erik 03/27/2012 Bring in Francis Vitt's MEGAN changes. - clm4_0_41 erik 03/13/2012 Bring rmfmesh/rtmmap branches to trunk - clm4_0_40 erik 02/16/2012 Back out update to new T31 surface datasets - clm4_0_39 erik 02/01/2012 Bring newgrid branch to trunk - clm4_0_38 erik 01/23/2012 Fix f09 surface datasets - clm4_0_37 erik 09/26/2011 Fix unstructured grids history files - clm4_0_36 erik 09/22/2011 Comment out RTM mapping files for f09 and f19 - clm4_0_35 erik 09/13/2011 Bring in Mariana's non2D grid branch to trunk, enabling HOMME grids: ne30np4/ne120np4 - clm4_0_34 erik 08/18/2011 Bring tcens branch to trunk, fix a few issues - clm4_0_33 erik 07/25/2011 Move changes on release branch over to trunk - clm4_0_32 erik 05/19/2011 Make I1850SPINUPCN compset use MOAR data, various bug fixes, work on test lists - clm4_0_31 erik 05/13/2011 Fix answers for transient_CN, fix interpinic - clm4_0_30 erik 05/11/2011 New finidat/fsurdat files for T31 - clm4_0_29 erik 05/05/2011 Backout interpinic changes to one that works - clm4_0_28 erik 05/03/2011 Remove DUST/PROGSSLT in land coupler layer, update driver and scripts - clm4_0_27 erik 05/02/2011 Move crop branch over to trunk - clm4_0_26 erik 03/23/2011 Update externals, driver update changes answers, drydep changes from fvitt, fix bugs - clm4_0_25 erik 03/22/2011 Always output restart-history files add more meta-data to them, fix urbanc_alpha and 2.5x3.33 datasets, Changes from Keith O on SNOWLIQ/SNOWICE - clm4_0_24 erik 02/09/2011 Fix mksurfdata and add ability to override soil_fmax - clm4_0_23 erik 02/03/2011 Add in new glacier-MEC use-cases - clm4_0_22 erik 01/20/2011 Move coupler field indicies to clm, move cpl_* directories up a level, add the cpl_share directory - clm4_0_21 jedwards 01/12/2011 Remove includes, finish PIO transition - clm4_0_20 erik 01/11/2011 Update for ESMF metadata, update doc. from release branch, bug fixes (doc of qflx_evap_tot, threading CNDV, aer/ndepregrid) - clm4_0_19 erik 12/08/2010 Bring irrigation branch to the trunk - clm4_0_18 erik 11/21/2010 Fix a problem with the clm template, update scripts version to fix bug with linking with ESMF - clm4_0_17 erik 11/20/2010 Update to externals that change answers to roundoff, use drv pio namelist, add in T341 datasets - clm4_0_16 erik/mverten 10/27/2010 Fix downscaling roundoff difference for same-grids by copying scale factor when needed - clm4_0_15 erik/mverten 10/24/2010 Move pio branch to trunk - clm4_0_14 erik 10/19/2010 Fix finidat file for T31 sim_year=2000 cases - clm4_0_13 erik 10/16/2010 Bring in PTCLM branch, add in T31 finidat file and turn off ice_runoff for T31 - clm4_0_12 erik 09/10/2010 Add U10 to history, cesm1_0_rel06 updates, PTCLM02 updates (except mksurfdata), remove ndepdat/dyn/faerdep - clm4_0_11 erik 08/27/2010 New files for rcp6, fix MPI bug, update externals - clm4_0_10 erik 08/04/2010 Update doc to cesm_rel05, bug-fixes, fix issues for single-point, mksurfdata/getregional scripts - clm4_0_09 erik 06/14/2010 Fix some small issues, update documentation, and externals - clm4_0_08 erik 06/04/2010 Snow hydrology bug fix from Keith and Dave - clm4_0_07 erik 06/03/2010 Some cleanup/fix bugs, add RTM var, add albice to namelist, allow last-millenium in mksurfdata, allow setting of datm_presaero in clm test-suite - clm4_0_06 erik 05/26/2010 Update gglc to cism - clm4_0_05 erik 05/25/2010 Move Nitrogen deposition stream branch to trunk - clm4_0_04 erik 05/20/2010 New namelist items: ice_runoff, scaled_harvest, carbon_only, - new RTM hist vars, new finidat files, update esmf interface, turn off aerosol read quicker - clm4_0_03 erik 05/17/2010 Changes from Francis for VOC and drydep - clm4_0_02 erik 05/13/2010 Make sure dtime is initialized, so that answers are consistently the same as clm4_0_00 - clm4_0_01 erik 05/11/2010 Move glacier multiple elevation class branch to the trunk so that we can work with the active glacier model - clm4_0_00 erik 05/04/2010 Update to datm8, redirect aquifer overflow - to drainage, add gx3v7 masks, script to extract regional - datasets, add harvesting for CN, modify shrubs, include urban - model, ice stream for snowcapping, new build-namelist system, - scale solar by solar zenith angle in datm, deep soil with - bedrock at bottom, organic matter in soils, SNICAR for snow - radiation, sparce dense aero, snow cover changes - clm3_8_00 erik 05/04/2010 Get future scenarios working, finalize - documentation, bring in MEGAN VOC and CNDV, simplify, - mksurfdata optimization, fix bugs: snow enthalpy, BMOZ, pergro, - use pft weights from fsurdat NOT finidat - clm3_7_15 erik 04/27/2010 Finish User's Guide, surfdata files for urban-1pt, fix mksurfdata ifort bugs, work with testing - clm3_7_14 erik 04/08/2010 Fix rcp=2.6/4.5 1-degree fndepdyn filenames - clm3_7_13 erik 04/08/2010 Add in missing rcp=2.6/6 use-cases, and fix syntax errors in the namelist_defaults file - clm3_7_12 erik 04/08/2010 rcp=2.6/4.5 datasets for fndepdyn and aerdepdat, fix some minor issues, new 1pt urban surfdata files - clm3_7_11 erik 04/07/2010 qtr-degree and T85 surfdata, rcp=2.6/4.5 datasets, doc updates - clm3_7_10 erik 03/22/2010 Fix drydep so that BMOZ case will work - clm3_7_09 erik 03/21/2010 Fix snow enthalpy bug, cndv datasets, various fixes - clm3_7_08 mvertens 03/12/2010 Removal of check for weights if dynamic land use is - used - clm3_7_07 erik 03/10/2010 New finidat datasets for 1-deg, 2-deg, and abort if weights from finidat/fsurdat files are too different, and use fsurdat files as truth - clm3_7_06 erik 03/10/2010 Bring cndv branch to trunk - clm3_7_05 erik 02/24/2010 Bring VOC branch source code to trunk - clm3_7_04 erik 02/17/2010 Bring VOC branch (vocemis-drydep18_clm3_7_03) tools, testing, and build to trunk (everything other than VOC code changes) - clm3_7_03 erik 02/10/2010 Add in more future scenario datasets, new history fields from Keith - clm3_7_02 erik 02/06/2010 Start adding in new rcp=8.5 datasets, remove some junk, change some env_conf variables, add user_nl_clm - clm3_7_01 erik 01/29/2010 OpenMP fix for pftdyn, start adding in rcp's, update ndeplintInterp.ncl script - clm3_7_00 erik 01/22/2010 Update to datm8, redirect aquifer overflow to drainage, add gx3v7 masks, script to extract regional datasets, add harvesting for CN, modify shrubs, include urban model, ice stream for snowcapping, new build-namelist system, scale solar by solar zenith angle in datm, deep soil with bedrock at bottom, organic matter in soils, SNICAR for snow radiation, sparce dense aero, snow cover changes - clm3_6_64 erik 01/22/2010 Update documentation and README/Quickstart files, set NetCDF large-file format on by default in template, update pio, update some fsurdat files to vocemis-drydep versions, add 2.5x3.33_gx3v7 frac file, make gx3v7 default for 4x5 res - clm3_6_63 erik 01/09/2010 Get answers to be identical with ccsm4_0_beta38 for 1 and 2 degree transient cases - clm3_6_62 erik 01/08/2010 Fix startup of PFT transient cases so properly use data from pftdyn file rather than finidat file - clm3_6_61 erik 01/07/2010 Comment out endrun on finidat and fsurdat weights being incomptable, and go back to using finidat weights - clm3_6_60 erik 01/05/2010 Fix clm template - clm3_6_59 erik 01/05/2010 Update to datm8, fix so wts used are from fsurdat file NOT finidat file - clm3_6_58 erik 12/08/2009 Fix rpointer, correct units for export of nee, start adding testing for intrepid - clm3_6_57 erik 11/20/2009 Redirect aquifer overflow to drainage, so doesn't end up in ocean - clm3_6_56 erik 11/10/2009 New ndepdat and ndepdyn datasets - clm3_6_55 erik 11/05/2009 Fix tool to create Nitrogen deposition datasets, and change configure to use CCSM Makefile as source for TopLevel Makefile - clm3_6_54 erik 10/28/2009 Allow comp_intf to change on ccsm build, reduce default hist fields, start adding 2.5x3.33, start adding VOC fsurdat datasets, new finidat files for f09 and f19 - clm3_6_53 erik 09/22/2009 Fix so that T31_gx3v7 file is actually included - clm3_6_52 erik 09/17/2009 Add T31_gx3v7 support, remove forganic, read from fsurdat, add script to extract regional datasets, work with CN output, add more urban/rural fields - clm3_6_51 erik 09/01/2009 Update fndepdyn and aerdep datasets (f02,f05,f09,f10) (1850,2000) and f09, f10 transient (1850-2000) - clm3_6_50 erik 08/28/2009 Fix ncl regridding scripts so that NO missing values are allowed for aerosol and nitrogen deposition - clm3_6_49 erik 08/25/2009 Fix ncl interpolation scripts, update externals, turn on CLM_CCSM_BLD for bluefire,jaguar, ESMF3 compliance - clm3_6_48 erik 08/12/2009 New aerosol/nitrogen deposition datasets, mksurfdata work, scm work, clm_usr_name option to build-namelist - clm3_6_47 erik 08/03/2009 Fix hybrid bug for dynpft case, update externals - clm3_6_46 erik 07/22/2009 Get more tests to work/document them, add use cases for 1850_control, 2000_control, and - 20thC_transient, straighten out single-point grids, Listen to LND_CDF64 env variable from - template, remove CLM_ARB_IC. - clm3_6_45 erik 07/10/2009 Remove inconsistent finidat file in clm3_6_44 - clm3_6_44 erik 07/09/2009 Fix C13 bug, update scripts, drv, datm. Add domain files for idmap atm-ocn grids for datm. Remove SEQ_MCT, add new ESMF env vars to template. Work with ndeplintInterp - clm3_6_43 erik 06/10/2009 Fix pftdyn bug, enable 1D primary hist files, fix time-const3D output, fix template bug, enable cpl_esmf/cpl_mct - clm3_6_42 erik 06/02/2009 Bring CN Harvest branch to trunk - clm3_6_41 kauff 05/29/2009 shrub mods, abort if nthreads > 1 (temporary, wrt bugz #965) - clm3_6_40 erik 05/28/2009 Fix openMP bug, add fndepdyn ncl script, fix interpinic for urban, add mkharvest to mksurfdata, new spinups, turn CLAMP on for CASA or CN - clm3_6_39 erik 05/07/2009 Bug fix for script version and maxpatchpft back to numpft+1 - clm3_6_38 erik 05/06/2009 New fsurdat for other resolutions, bug-fixes, deep wetlands to bedrock, new spinups for 1.9x2.5 1850, 2000 - clm3_6_37 erik 04/27/2009 Update faerdep dataset for 1.9x2.5 to point to version cice is using for 1850 and 2000 - clm3_6_36 erik 04/27/2009 Handle transient aersol, make maxpatchpft=numpft+1 default, new datasets for 1.9x2.5 and 0.9x1.25, change doalb - clm3_6_35 erik 04/20/2009 Fix major logic bug in mksurfdata - clm3_6_34 oleson 04/19/2009 Fix bangkok urban bug - clm3_6_33 erik 04/16/2009 Bring in dynpft changes from cbgc branch - clm3_6_32 erik 04/15/2009 Add irrigation area to mksrfdata, fix high-res and pftdyn problems - clm3_6_31 erik 04/01/2009 New surface datasets for 1850,2000, support for 0.9x1.25_gx1v6, urban always on. New pft-physiology file. Update scripts so remove some CLM_ env_conf vars. Fix CN for urban/pftdyn. - clm3_6_30 oleson 03/19/2009 Fix urban roof/wall layers - clm3_6_29 oleson 03/19/2009 CN SAI, CN testing fix, rad step size fix - clm3_6_28 oleson 03/17/2009 Fix permission denied error when reading surface dataset - clm3_6_27 oleson 03/16/2009 Urban model changes and FGR12 fix - clm3_6_25 dlawren 03/13/2009 Daylength control on Vcmax, 1%Lake,wetland,glacier in mksrfdat, remove ELEVATION in surface data file - clm3_6_24 oleson 03/09/2009 Fix urban testing and some history field changes - clm3_6_23 oleson 03/08/2009 Prune history fields and change to snowdp threshold for solar radiation penetration into snow - clm3_6_21 oleson 03/04/2009 History file changes and finish testing on tags clm3_6_19 and clm3_6_20 - clm3_6_19 oleson 02/27/2009 Changes to urban model and urban surface data - clm3_6_17 oleson 02/26/2009 Urban model changes and mksurfdata changes to incorporate urban data - clm3_6_16 erik 02/12/2009 Multiple elevation classes on surface dataset, urban fixes, mpi-serial and testing fixes - clm3_6_15 erik 01/19/2009 Bring clm36sci branch to the trunk - clm3_6_14 erik 10/10/2008 Fix some global urban issues, fix pftdyn, really get compile-only option - working in testing - clm3_6_13 erik 10/01/2008 Update to new version of cpl7 scripts and build, update externals for versions - needed for clm36sci branch, add new CASA tests - clm3_6_12 erik 09/21/2008 Fix restarts for urban, add capability to do global urban experiments, - add in new forcing height changes - clm3_6_11 dlawren 08/26/2008 Ice stream for snow capped regions - clm3_6_10 tcraig 08/15/2008 extend rtm tracer, ascale for tri-grids, AIX O3 to O2 - clm3_6_09 erik 08/11/2008 Fix clm.cpl7.template to run hybrid and branch cases - clm3_6_08 erik 08/06/2008 Fix bugs, and build changes for inputdata repo - clm3_6_07 erik 07/08/2008 Implement new build namelist system from Vertenstein/Eaton, bluefire, and BGP updates - clm3_6_06 erik 05/30/2008 Small fix needed for ccsm4_alpha30 - (use gx1v5 for some resolutions when OCN_GRID==ATM_GRID) - clm3_6_05 erik 05/27/2008 Fix to compile with PGI-6, update scripts, fix cpl7.template for new scripts LND_GRID, - fix 2.65x3.33 frac dataset. - clm3_6_04 erik 05/20/2008 Remove all MCT permutes, fix cpl7 script issues, remove offline mode, - add ability to run over a range of years - clm3_6_03 erik 05/08/2008 Fix so listen to next_swcday to calculate albedo rather than using irad - clm3_6_02 erik 03/25/2008 Minor fix in configure remove perl5lib version under models/lnd/clm/bld - clm3_6_01 erik 03/20/2008 40 m forcing height changes for clm - clm3_6_00 erik 03/20/2008 Fully implement sequential-ccsm mode, upgrade configure, build-namelist and testing, - upgrade interpolation tool, add mkdatadomain, write to iulog rather than 6 explicitly, - SCAM update, Update datasets, add archiving, and build-streams, add in point version - of Urban model, change directory structure to mimic CCSM - clm3_5_20 erik 03/17/2008 Bug fixes before spinning off clm3_6_00, put in changes from ccsm4a01_clm3_5_18 - to ccsm4a04_clm3_5_18 - clm3_5_19 erik 03/06/2008 Change directory structure to mimic CCSM, fix so no NaNS on BGC interpinic output, - new half degree CN clmi dataset - clm3_5_18 erik 02/21/2008 Update to latest seq-ccsm4.alpha tag - clm3_5_17 erik 02/06/2008 Merge Tony Craig's FMI branch fmi12_clm3_5_16 to the clm trunk - clm3_5_16 erik 01/28/2008 Get point version of Urban code onto trunk (urban code can not restart) - clm3_5_15 erik 12/10/2007 Fix interpinic for half degree grid, add in large-file support, - allow configure to work with ccsm directory structure - clm3_5_14 erik 11/27/2007 Use build-streams, and archiving, multiple bug-fixes - clm3_5_13 erik 11/16/2007 Update xml file with file needed for ccsm3_5_beta18 - clm3_5_12 erik 11/08/2007 Tag with new files needed for ccsm3_5_beta17 - clm3_5_11 erik 09/28/2007 Update datasets in the DefaultCLM file for 0.23x0.31, 0.47x0.63, 0.9x1.25 and - add fndepdyn file for 1.9x2.5 - clm3_5_10 jet 09/18/2007 SCAM update - clm3_5_09 erik 08/31/2007 Change configure to NOT have csm_share code for ccsm_con option, and add in 1x1.25 file, - and update datm7 and csm_share - clm3_5_08 tcraig 08/20/2007 convert 6 to iulog in logfile, updates for I/O - clm3_5_07 erik 08/17/2007 Add mkdatadomain tool, add cprnc and perl5lib as externals - clm3_5_06 erik 08/10/2007 Update: interpolation, testing, script namelist build, and scripts. Fix bugs, - and fix possible - clm3_5_05 tcraig 07/11/2007 seq clm mods and first hist refactor mods - clm3_5_04 mvertens 06/05/2007 lnd_comp_mct.F90 change to work with sequential diagnostics - clm3_5_03 tcraig 05/23/2007 reduce memory, partial I/O refactor, downscaling implementation - clm3_5_02 mvertens 05/22/2007 put in hourly coupling with sequential driver - clm3_5_01 erik 05/16/2007 Move newcn06 branch to trunk - clm3_5_00 erik 05/03/2007 New surface datasets, improved canopy integration, and various improvements to Hydrology diff --git a/doc/IMPORTANT_NOTES b/doc/IMPORTANT_NOTES deleted file mode 100644 index 1ff8949139..0000000000 --- a/doc/IMPORTANT_NOTES +++ /dev/null @@ -1,69 +0,0 @@ -$CTSMROOT/doc/IMPORTANT_NOTES Jun/08/2018 - Erik Kluzek - -I.) For clm4_0: - -Configure Modes NOT scientifically validated, documented, supported or even advised to be used: -(options to CLM_CONFIG_OPTS) - - SNICAR_FRC (-snicar_frc) - This mode is tested and functional, but is NOT constantly scientifcally validated, and should be - considered experimental. - -Namelist items that should NOT be exercised: - - glc_dyntopo Change topographic height over glacier MEC (Not functional) - suplnitro='ALL' (suplnitro='ALL' with -bgc cn) - The suplemental Nitrogen mode of the CN model is known - to be too productive. - urban_traffic: Not currently functional - -II.) For clm4_5/clm5_0: - -Namelist items that are not regularly tested or used. Some aren't even implemented. - - See - - ../bld/namelist_files/namelist_definition_clm4_5.xml -- for definitions - - CN_evergreen_phenology_opt - CN_partition_opt - CN_residual_opt - CNratio_floating - all_active - allowlakeprod - anoxia_wtsat - carbon_resp_opt - ch4offline - downreg_opt - fin_use_fsat - lake_decomp_fact - no_frozen_nitrif_denitrif - nscalar_opt - perchroot - perchroot_alt - plant_ndemand_opt - reduce_dayl_factor - replenishlakec - substrate_term_opt - temp_scalar_opt - urban_traffic - use_extralakelayers - use_lai_streams - use_snicar_frc - use_vichydro - usefrootc - vcmax_opt = 4 - - FATES namelist options: FATES is a new experiemental subcomponent where all of it's options are - under current development. As such FATES and all of it's options should - be considered experimental. - - use_fates - use_fates_spitfire - use_fates_logging - use_fates_planthydro - use_fates_ed_st3 - use_fates_ed_prescribed_phys - use_fates_inventory_init - fates_inventory_ctrl_filename diff --git a/doc/Quickstart.GUIDE b/doc/Quickstart.GUIDE deleted file mode 100644 index 86550653fd..0000000000 --- a/doc/Quickstart.GUIDE +++ /dev/null @@ -1,60 +0,0 @@ -$CTSMROOT/doc/Quickstart.GUIDE Jun/08/2018 - - Quick-Start to Using cpl7 Scripts for clm5_0 - ============================================ - -Assumptions: You want to use cheyenne with clm5_0 BGC - to do a clm simulation with data atmosphere and the - latest GSWP3v1 atm forcing files and settings. You also want to cycle - the GSWP3v1 atm data between 1950 to 2010 and you want to run at - 0.9x1.25 degree resolution. - -Process: - - # Create the case - - cd cime/scripts - - ./create_newcase --case --mach cheyenne --res f09_g16_gl4 -compset I2000Clm50BgcCrop - (./create_newcase -help -- to get help on the script) - - # Setup the case - - cd - ./xmlchange id1=val1,id2=val2 # to make changes to any settings in the env_*.xml files - ./case.setup - (./case.setup -help -- to get help on the script) - - # Add any namelist changes to the user_nl_* files - - $EDITOR user_nl_* - - # Compile the code - - ./case.build - - # Submit the run - - ./case.submit - -Information on Compsets: - - "I" compsets are the ones with clm and datm7 without ice and ocean. - Most of the "I" compsets for CLM5.0 use the GSWP3v1 data with solar following - the cosine of solar zenith angle, precipitation constant, and other - variables linear interpolated in time (and with appropriate time-stamps on - the date). - - To get a list of the "I" compsets use the "query_config" utility in cime/scripts - - ./query_config --compsets clm - -Automatically resubmitting jobs: - - After doing a short simulation that you believe is correct - - ./xmlchange CONTINUE_RUN=TRUE - - # Change RESUBMIT to number greater than 0, and CONTINUE_RUN to TRUE... - - ./case.submit diff --git a/doc/UpdateChangelog.pl b/doc/UpdateChangelog.pl deleted file mode 100755 index 78a3afe42d..0000000000 --- a/doc/UpdateChangelog.pl +++ /dev/null @@ -1,207 +0,0 @@ -#!/usr/bin/env perl -#======================================================================= -# -# This is a script to update the ChangeLog -# -# Usage: -# -# perl ChangeLog tag-name One-line summary -# -# -#======================================================================= - -use strict; -use Getopt::Long; -use IO::File; -#use warnings; -#use diagnostics; - -use English; - -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program -my $ProgDir = $1; # name of directory where program lives - -sub usage { - die < - -OPTIONS - -help [or -h] Help on this script. - -update [or -u] Just update the date/time for the latest tag - In this case no other arguments should be given. -ARGUMENTS - Tag name of tag to document - Short summary description of this tag -EXAMPLES: - To just update the date/time for the latest tag - - $ProgName -update - - To document a new tag - - $ProgName release-elm5.0.09 "Description of this tag" -EOF -} - -my %opts = { - help => 0, - update => 0, - }; -GetOptions( - "h|help" => \$opts{'help'}, - "u|update" => \$opts{'update'}, - ); -if ( $opts{'help'} ) { - usage(); -} -my $tag; my $sum; - -if ( ! $opts{'update'} ) { - if ( $#ARGV != 1 ) { - print "ERROR: wrong number of arguments: $ARGV\n"; - usage(); - } - - $tag = $ARGV[0]; - $sum = $ARGV[1]; - - if ( $tag !~ /release-clm[0-9]\.[0-9]\.([0-9][0-9])/ ) { - print "ERROR: bad tagname: $tag\n"; - usage(); - } -} else { - if ( $#ARGV != -1 ) { - print "ERROR: wrong number of arguments when update option picked: $ARGV\n"; - usage(); - } -} -my $EDITOR = $ENV{EDITOR}; -if ( $EDITOR !~ /.+/ ) { - print "ERROR: editor NOT set -- set the env variable EDITOR to the text editor you would like to use\n"; - usage(); -} - - -my $template = ".release-ChangeLog_template"; -my $changelog = "release-clm5.0.ChangeLog"; -my $changesum = "ChangeSum"; -my $changelog_tmp = "ChangeLog.tmp"; -my $changesum_tmp = "ChangeSum.tmp"; - -my $user = $ENV{USER}; -if ( $user !~ /.+/ ) { - die "ERROR: Could not get user name: $user"; -} -my @list = getpwnam( $user ); -my $fullname = $list[6]; -my $date = `date`; -chomp( $date ); - -if ( $date !~ /.+/ ) { - die "ERROR: Could not get date: $date\n"; -} - -# -# Deal with ChangeLog file -# -my $fh = IO::File->new($changelog_tmp, '>') or die "** $ProgName - can't open file: $changelog_tmp\n"; - -# -# If adding a new tag -- read in template and add information in -# -if ( ! $opts{'update'} ) { - open( TL, "<$template" ) || die "ERROR:: trouble opening file: $template"; - while( $_ = ) { - if ( $_ =~ /Tag name:/ ) { - chomp( $_ ); - print $fh "$_ $tag\n"; - } elsif ( $_ =~ /Originator/ ) { - chomp( $_ ); - print $fh "$_ $user ($fullname)\n"; - } elsif ( $_ =~ /Date:/ ) { - chomp( $_ ); - print $fh "$_ $date\n"; - } elsif ( $_ =~ /One-line Summary:/ ) { - chomp( $_ ); - print $fh "$_ $sum\n"; - } else { - print $fh $_; - } - } - close( TL ); -} -open( CL, "<$changelog" ) || die "ERROR:: trouble opening file: $changelog"; -my $update = $opts{'update'}; -my $oldTag = ""; -while( $_ = ) { - # If adding a new tag check that new tag name does NOT match any old tag - if ( $_ =~ /Tag name:[ ]*(release-clm.+)/ ) { - $oldTag = $1; - if ( (! $opts{'update'}) && ($tag eq $oldTag) ) { - close( CL ); - close( $fh ); - system( "/bin/rm -f $changelog_tmp" ); - print "ERROR:: New tag $tag matches a old tag name\n"; - usage(); - } - # If updating the date -- find first occurance of data and change it - # Then turn the update option to off - } elsif ( ($update) && ($_ =~ /(Date:)/) ) { - print $fh "Date: $date\n"; - print "Update $oldTag with new date: $date\n"; - $update = undef; - $_ = ; - } - print $fh $_; -} -# Close files and move to final name -close( CL ); -$fh->close( ); -system( "/bin/mv $changelog_tmp $changelog" ); -# -# Deal with ChangeSum file -# - -open( FH, ">$changesum_tmp" ) || die "ERROR:: trouble opening file: $changesum_tmp"; - -open( CS, "<$changesum" ) || die "ERROR:: trouble opening file: $changesum"; - -my $update = $opts{'update'}; - -$date = `date "+%m/%d/%Y"`; -chomp( $date ); - -while( $_ = ) { - # Find header line - if ( $_ =~ /=====================/ ) { - print FH $_; - my $format = "%17.17s %8.8s %10.10s %s\n"; - if ( $update ) { - $_ = ; - if ( /^(.{17}) (.{8}) (.{10}) (.+)$/ ) { - $tag = $1; - $user = $2; - $sum = $4; - } else { - die "ERROR: bad format for ChangeSum file\n"; - } - } - printf FH $format, $tag, $user, $date, $sum; - $_ = ; - } - print FH $_; -} -# Close files and move to final name -close( CS ); -close( FH ); -system( "/bin/mv $changesum_tmp $changesum" ); - -# -# Edit the files -# -if ( ! $opts{'update'} ) { - system( "$EDITOR $changelog" ); - system( "$EDITOR $changesum" ); -} diff --git a/doc/UsersGuide/Makefile b/doc/UsersGuide/Makefile deleted file mode 100644 index 1c76bc75bd..0000000000 --- a/doc/UsersGuide/Makefile +++ /dev/null @@ -1,193 +0,0 @@ -# -# Makefile to convert DocBook CLM Users-Guide into html and/or pdf -# (rtf, txt, ps, tex, man, dvi, and texi are also valid docbook formats) -# -VPATH := ../../tools/cprnc . .. ../../bld ../../tools/ncl_scripts \ - ../../tools/mksurfdata ../../test/system ../../bld/namelist_files \ - ../../bld/config_files ../../tools ../../../../../scripts/ccsm_utils/Tools \ - ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM/ ../../src/main - -PDFUG := clm_ug.pdf -HTMLUG := book1.html -DOCBKUG := clm_ug.xml -CFGLOG := config_help -CPRLOG := cprnc_readme -BNMLOG := buildnml_help -BSTLOG := build_streams_help -RESLOG := buildnml_resolutions -USCLOG := buildnml_usecases -QCKLOG := quickstart_guide -COPLOG := filecopies -MKSLOG := mksurfdata.pl -USRLOG := quickstart_usrdat -PTCLOG := ptclm_help -PTCLST := ptclm_list -TDRLOG := test_driver.sh -GETREG := getregional_datasets -CO2DIF := addco2_datm.buildnml -DATLOG := build_date -NMLDFTBL := namelist_definition_table -NMLDLTBL := namelist_defaults_clm_table -HSFLDTBL := history_fields_table -CFGDFTBL := config_definition_table -COMPLIST := compsets_list_ofIcases.xml -SOURCES := $(DOCBKUG) $(COMPLIST) $(CFGLOG).xml $(PTCLOG).xml $(BNMLOG).xml \ - $(RESLOG).xml $(USCLOG).xml $(QCKLOG).xml $(COPLOG).xml $(PTCLST).xml \ - $(USRLOG).xml $(GETREG).xml preface.xml custom.xml special_cases.xml \ - tools.xml adding_files.xml single_point.xml addco2_datm.buildnml.xml \ - appendix.xml trouble_shooting.xml ptclm.xml $(BSTLOG).xml \ - $(MKSLOG).xml $(TDRLOG).xml $(DATLOG).xml $(CPRLOG).xml \ - $(NMLDFTBL).xml $(NMLDLTBL).xml $(CFGDFTBL).xml $(HSFLDTBL).xml - -CONVAMP := sed 's/\&/\&/g' -CONVSIGNS := sed 's/>/\>/g' | sed 's/ tmpFile.txt - addxhtmlhead.pl tmpFile.txt > $@ - $(RM) tmpFile.txt - -$(NMLDLTBL).xhtml: namelist_defaults_clm.xml namelist_defaults.xsl - xsltproc ../../bld/namelist_files/namelist_defaults.xsl $< > tmpFile.txt - addxhtmlhead.pl tmpFile.txt > $@ - $(RM) tmpFile.txt - -$(CFGDFTBL).xhtml: config_definition.xml config_definition.xsl - xsltproc ../../bld/config_files/config_definition.xsl $< > tmpFile.txt - addxhtmlhead.pl tmpFile.txt > $@ - $(RM) tmpFile.txt - -history_fields.xml: findHistFields.pl - cd ../../src/main; ./findHistFields.pl >& tmpFile.txt - $(RM) tmpFile.txt - -$(HSFLDTBL).xhtml: history_fields.xml history_fields.xsl - xsltproc ../../bld/namelist_files/history_fields.xsl $< > tmpFile.txt - addxhtmlhead.pl tmpFile.txt > $@ - $(RM) tmpFile.txt - -.xhtml.xml: - xsltproc stylesheethtml2docbook.xsl $< > $@ - -.tlog.xml: - $(CONVAMP) $< | $(CONVSIGNS) > tempFile.txt - limitLineLen.pl tempFile.txt > $@ - $(RM) tempFile.txt - -.diff.xml: - $(CONVAMP) $< | $(CONVSIGNS) > $@ - -debug: - @echo "SOURCES: $(SOURCES)" - @echo "CONVAMP: $(CONVAMP)" - @echo "CONVSIGNS: $(CONVSIGNS)" - -$(COMPLIST): - ./get_Icaselist.pl > $@ - -$(HTMLUG): $(SOURCES) - docbook2html --dsl clm_stylesheet.dsl#html $< - -$(PDFUG): $(SOURCES) - docbook2pdf --dsl clm_stylesheet.dsl#print $< - -$(BNMLOG).tlog: build-namelist - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../bld/build-namelist -help >& $@ - -$(BSTLOG).tlog: build_streams - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../../../../scripts/ccsm_utils/Tools/build_streams --help >& $@ - -$(DATLOG).tlog: - @echo "Get current build date" - date +%b-%d-%Y >& $@ - -$(RESLOG).tlog: build-namelist - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../bld/build-namelist -res list >& $@ - -$(USCLOG).tlog: build-namelist - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../bld/build-namelist -use_case list >& $@ - -$(CFGLOG).tlog: configure - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../bld/configure -help >& $@ - -$(PTCLOG).tlog: PTCLM.py - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM/PTCLM.py --help >& $@ - -$(PTCLST).tlog: PTCLM.py - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - cd ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM; \ - PTCLM.py --list >& $(CURDIR)/$@ - -$(MKSLOG).tlog: mksurfdata.pl - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../tools/mksurfdata/mksurfdata.pl -help >& $@ - -$(TDRLOG).tlog: test_driver.sh - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $@ is good and redo your make" - ../../test/system/test_driver.sh -help >& $@ - -$(QCKLOG).tlog: Quickstart.GUIDE - cp $< $@ - -$(COPLOG).tlog: README.filecopies - cp $< $@ - -$(CPRLOG).tlog: README - cp $< $@ - -$(USRLOG).tlog: Quickstart.userdatasets - cp $< $@ - -$(GETREG).tlog: getregional_datasets.pl - @echo "The following line will fail in the make as it calls die -- but that is expected" - @echo "Check that the output $(GETREG) is good and redo your make" - ../../tools/ncl_scripts/getregional_datasets.pl -help >& $@ - -clean: - $(RM) -f $(HTMLUG) $(PDFUG) *.tlog $(DATLOG).xml *.xhtml *.tex - -realclean: clean - $(RM) -f f*.html c*.html x*.html a*.html i*.html $(COMPLIST) $(CFGLOG).xml \ - $(BNMLOG).xml $(BSTLOG).xml $(PTCLOG).xml $(PTCLST).xml \ - $(RESLOG).xml $(USCLOG).xml $(USRLOG).xml $(GETREG).xml $(QCKLOG).xml \ - $(CO2DIF).xml *.tlog $(MKSLOG).xml $(TDRLOG).xml $(DATLOG).xml \ - $(NMLDFTBL).xml $(NMLDLTBL).xml $(CFGDFTBL).xml $(CPRLOG).xml \ - $(COPLOG).xml diff --git a/doc/UsersGuide/addco2_datm.buildnml.diff b/doc/UsersGuide/addco2_datm.buildnml.diff deleted file mode 100644 index b8fbf34e36..0000000000 --- a/doc/UsersGuide/addco2_datm.buildnml.diff +++ /dev/null @@ -1,59 +0,0 @@ -*** datm.buildnml.csh.orig 2010-06-11 10:59:29.246523532 -0600 ---- datm.buildnml.csh 2010-06-11 11:06:30.710784206 -0600 -*************** -*** 34,48 **** - streams = 'clm_qian.T62.stream.Solar.txt 1895 1948 1972 ', - 'clm_qian.T62.stream.Precip.txt 1895 1948 1972 ', - 'clm_qian.T62.stream.TPQW.txt 1895 1948 1972 ', -! 'presaero.stream.txt 1849 1849 2006' - vectors = 'null' - mapmask = 'nomask', - 'nomask', - 'nomask', - 'nomask' - tintalgo = 'coszen', - 'nearest', - 'linear', - 'linear' - / - EOF1 ---- 34,56 ---- - streams = 'clm_qian.T62.stream.Solar.txt 1895 1948 1972 ', - 'clm_qian.T62.stream.Precip.txt 1895 1948 1972 ', - 'clm_qian.T62.stream.TPQW.txt 1895 1948 1972 ', -! 'presaero.stream.txt 1849 1849 2006', -! 'datm.global1val.stream.CO2.txt 1766 1766 2005 ' - vectors = 'null' - mapmask = 'nomask', - 'nomask', - 'nomask', -+ 'nomask', - 'nomask' -+ mapalgo = 'bilinear', -+ 'bilinear', -+ 'bilinear', -+ 'bilinear', -+ 'nn' - tintalgo = 'coszen', - 'nearest', - 'linear', -+ 'linear', - 'linear' - / - EOF1 -*************** -*** 1112,1121 **** ---- 1120,1132 ---- - - EOF1 - -+ cp $CASEBUILD/co2_streams.txt datm.global1val.stream.CO2.txt -+ - - $CASETOOLS/listfilesin_streams -input_data_list -t clm_qian.T62.stream.Solar.txt >> $CASEBUILD/datm.input_data_list - $CASETOOLS/listfilesin_streams -input_data_list -t clm_qian.T62.stream.Precip.txt >> $CASEBUILD/datm.input_data_list - $CASETOOLS/listfilesin_streams -input_data_list -t clm_qian.T62.stream.TPQW.txt >> $CASEBUILD/datm.input_data_list -+ $CASETOOLS/listfilesin_streams -input_data_list -t datm.global1val.stream.CO2.txt >> $CASEBUILD/datm.input_data_list - - cat >! presaero.stream.txt << EOF1 - diff --git a/doc/UsersGuide/adding_files.xml b/doc/UsersGuide/adding_files.xml deleted file mode 100644 index 18c034cbbb..0000000000 --- a/doc/UsersGuide/adding_files.xml +++ /dev/null @@ -1,357 +0,0 @@ - - -Adding New Resolutions or New Files to the build-namelist Database - -In the last chapter we gave the details on how to create new files for input into -CLM. These files could be either global resolutions, regional-grids or even a single -grid point. If you want to easily have these files available for continued use in your -development you will then want to include them in the build-namelist database so -that build-namelist can easily find them for you. You can deal with them, just by -editing your namelist by hand (or using a &usernlclm; namelist file), or by using -&CLMUSRDAT;. Another way to deal with them is to enter them into -the database for build-namelist, so that build-namelist can find them for you. -This keeps one central database for all your files, rather than having multiple locations -to keep track of files. If you have a LOT of files to keep track of it also might -be easier than keeping track by hand, especially if you have to periodically update -your files. If you just have a few quick experiments to try, for a short time period -you might be best off using the other methods mentioned above. - - -There are two parts to adding files to the build-namelist database. The first part -is adding new resolution names which is done in the -models/lnd/clm/bld/namelist_files/namelist_definition.xml file -(and in the -models/lnd/clm/bld/config_files/config_definition.xml file -when adding supported single-point datasets). -The second part is actually adding the new filenames which is done in the -models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml file -(models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml -file for CLM tools). -If you aren't adding any new resolutions, and you are just changing the files for existing -resolutions, you don't need to edit the namelist_definition file. - - - -Managing Your Own Data-files - -If you are running on a supported machine (such as bluefire or jaguar) the standard -input datasets will already be available and you won't have to check them out of the -subversion inputdata server. However, you also will NOT be able to add your own datafiles -to these standard inputdata directories -- because most likely you won't have permissions -to do so. In order to add files to the XML database or to use &CLMUSRDAT; you need -to put data in the standard locations so that they can be found. The recommended -way to do this is to use the link_dirtree tool in the &cesm; scripts. -Some information on link_dirtree is available in the -&cesmrel; Scripts User's Guide. We also have -some examples of it's use here and in other sections of this User's Guide. - - -Using link_dirtree is quite simple, you give the directory where -data exists and then the directory that you want to create where datasets will point -to the original source files. In the example below we use "$HOME/inputdata", but -MYCSMDATA could be any directory you have access to where you want to -put your data. - -> cd scripts -# First make sure you have a inputdata location that you can write to -# You only need to do this step once, so you won't need to do this in the future -# (except to bring in any updated files in the original $CSMDATA location). -> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data -> ./link_dirtree $CSMDATA $MYCSMDATA - -Then when you create a case you will change DIN_LOC_ROOT_CSMDATA to -point to the location you linked to rather than the default location. - -> ./xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA - - - -In order to list the files that you have created you merely need to use the UNIX -command find to find the files that are NOT softlinks. So for -example executing the following command: - -> find $MYCSMDATA -type f -print - -for me gives the following list of &CLMUSRDAT; files that I have created. - -/blhome/erik/inputdata/atm/cam/chem/trop_mozart_aero/aero/aerosoldep_monthly_1849-2006_1x1pt_US-Ha1.nc -/blhome/erik/inputdata/atm/cam/chem/trop_mozart_aero/aero/aerosoldep_monthly_1849-2006_13x12pt_f19_alaskaUSA.nc -/blhome/erik/inputdata/atm/cam/chem/trop_mozart_aero/aero/aerosoldep_rcp8.5_monthly_1850-2100_13x12pt_f19_alaskaUSA.nc -/blhome/erik/inputdata/atm/cam/chem/trop_mozart_aero/aero/aerosoldep_rcp4.5_monthly_1850-2100_13x12pt_f19_alaskaUSA.nc -/blhome/erik/inputdata/atm/datm7/domain.clm/domain.lnd.1x1pt_US-Ha1_USGS.nc -/blhome/erik/inputdata/atm/datm7/domain.clm/domain.lnd.13x12pt_f19_alaskaUSA_gx1v6.nc -/blhome/erik/inputdata/lnd/clm2/griddata/fracdata_13x12pt_f19_alaskaUSA_gx1v6.nc -/blhome/erik/inputdata/lnd/clm2/griddata/fracdata_1x1pt_US-Ha1_USGS.nc -/blhome/erik/inputdata/lnd/clm2/griddata/topodata_13x12pt_f19_alaskaUSA.nc -/blhome/erik/inputdata/lnd/clm2/griddata/griddata_1x1pt_US-Ha1.nc -/blhome/erik/inputdata/lnd/clm2/griddata/griddata_13x12pt_f19_alaskaUSA.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata_13x12pt_f19_alaskaUSA_simyr1850.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata_1x1pt_US-Ha1_simyr2000.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_rcp4.5_13x12pt_f19_alaskaUSA_simyr1850-2100.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata_1x1pt_US-Ha1_simyr1850.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata_13x12pt_f19_alaskaUSA_simyr2000.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_1x1pt_US-Ha1_simyr1849-2006.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_13x12pt_f19_alaskaUSA_simyr1850-2100.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_rcp8.5_13x12pt_f19_alaskaUSA_simyr1850-2100.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_13x12pt_f19_alaskaUSA_simyr1849-2006.nc -/blhome/erik/inputdata/lnd/clm2/surfdata/surfdata.pftdyn_1x1pt_US-Ha1_simyr1850-2100.nc - -You can also use find to list files that have a particular pattern -in the name as well (using the -name option with wildcards). Also you can always rerun the -link_dirtree command if any new files are added that you need to be -linked into your directory tree. Since, the files are soft-links -- it doesn't take up -much space other than the files that you add there. This way all of the files are kept -in one place, they are organized by usage according to &cesm; standards, and you can -easily find your own files, and &clm; can find them as well. - - - - -Adding Resolution Names - -If you are adding files for new resolutions which aren't covered in the -namelist_definition file -- you'll need to add them in. The list of valid resolutions -is in the id="res" entry in the -models/lnd/clm/bld/namelist_files/namelist_definition.xml file. -You need to choose a name for your new resolution and simply add it to the comma -delimited -list of valid_values for the id="res" entry. The convention for global Gaussian grids -is number_of_latitudes x number_of_longitudes. The convention for global finite -volume grids is latitude_grid_size x longitude_grid_size where latitude and longitude -is measured in degrees. For regional or single-point datasets the names have a grid size -number_of_latitudes x number_of_longitudes followed by an underscore and then a -descriptive name such as a City name followed by an abbreviation for the Country in caps. -The only hard requirement is that names be unique for different grid files. -Here's what the entry for resolutions looks like in the file: - -<entry id="res" type="char*30" category="default_settings" - group="default_settings" - valid_values= -"128x256,64x128,48x96,32x64,8x16,94x192,0.23x0.31,0.47x0.63, -0.9x1.25,1.9x2.5,2.65x3.33,4x5,10x15,5x5_amazon, -1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ, -1x1_brazil,1x1_urbanc_alpha,0.5x0.5"> -Horizontal resolutions -</entry> - -As you can see you just add your new resolution names to the end of the valid_values -list. - - -When using &ptclm; and adding supported single-point resolutions, you'll also want to -add these resolutions to the -models/lnd/clm/bld/config_files/config_definition.xml under -the sitespf_pt name. The entry in that file looks like: - -<entry id="sitespf_pt" -valid_values="none,1x1_brazil,5x5_amazon, -1x1_camdenNJ,1x1_vancouverCAN,1x1_mexicocityMEX,1x1_asphaltjungleNJ, -1x1_urbanc_alpha,1x1_numaIA,1x1_smallvilleIA" -value="none" category="physics"> -Flag to turn on site specific special configuration flags for supported single -point resolutions. -Currently the only special settings are for MEXICOCITY and VANCOUVER, which make -changes to urban parameters. -</entry> - -&ptclm; assumes that any supported single-point resolutions are valid settings for -sitespf_pt. - - - - -Adding or Changing Default Filenames - -To add or change the default filenames you edit the -models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -and either change an existing filename or add a new one. Most entries in the -default namelist files, include different attributes that describe the different -properties that describe the differences in the datasets. Attributes include -the: resolution, year to simulation, range of years to simulate for transient -datafiles, the land-mask, the representative concentration pathway (rcp) for future -scenarios, and the type of biogeochemistry (bgc) model used. For example the -fatmgrid for the 1.9x2.5 resolution is as follows: - -<fatmgrid hgrid="1.9x2.5" >lnd/clm2/griddata/griddata_1.9x2.5_060404.nc -</fatmgrid> - -Other fatmgrid files are distinguished from this one by -their resolution (hgrid) attribute. - - -To add or change the default filenames for &clm; tools edit the -models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml -and either change an existing filename or add a new one. Editing this file is -similar to the namelist_defaults_clm.xml talked about above. - - -What are the required files? - -Different types of simulations and different types of configurations for &clm; require -different lists of files. The Carbon Nitrogen (cn) Biogeochemistry model for example -requires stream_fldfilename_ndep files, which are NOT required by -other bgc modes. Transient simulations also require transient datasets, and the names -of these datasets are sometimes different from the static versions (sometimes both are -required as in the dynamic PFT cases). - - -In the following table we list the different files used by CLM, they are listed -in order of importance, dependencies, and customizing. So the required files -are all near the top, and the files used only under different conditions are listed -later, and files with the fewest dependencies are near the top, as are the files -that are least likely to be customized. - - -Required Files for Different Configurations and Simulation Types - - - - - - - Filename - Config. type - Simulation type - Resol. Dependent? - Other Dependencies? - - - Notes - - - - - - fpftcon - ALL - ALL - No - No - - - Not usually customized, as describes plant function -type properties. &ptclm; copies the file for you so that you can customize it if you -like, see . - - - fsnowoptics - ALL - ALL - No - No - - - Not usually customized as describes global snow optical properties. - - - fsnowaging - ALL - ALL - No - No - - - Not usually customized as describes global snow aging properties. - - - fatmgrid - ALL - ALL - Yes - No - - - Creating, using mkgriddata -usually gives you the amount of customization -you need, as it just describes the grid and grid extents. - - - fatmlndfrc - ALL - ALL - Yes - land-mask - - - Describes the land-mask for points with active land, as well as the fraction -of each grid-cell covered by land. You might customize it to make sure the land-fraction -of your grid-cell matches the expected values for your site. But, usually you will just -use what mkgriddata gives you. - - - fsurdat - ALL - ALL - Yes - simulation-year - - - Describes percentages of different land-units, columns and -vegetation types within each grid-cell. To customize for a specific point -or region you may want to use custom input datasets to mksurfdata when -creating the file. mksurfdata also allows you to customize the PFT, -and soil types to it see . &ptclm; takes -advantage of this to create customized datasets as well, see the chapter on &ptclm; -at . - - - flanduse_timeseries - ALL - transient land-use land-cover change - Yes - Simulation year range, and representative concentration pathway (rcp) - - - See notes on fsurdat files. - - - frivinp_rtm - RTM only - ALL - No - No - - - We only provide a half-degree global river routing file. If you want -to model river flow for a smaller scale, or a basin regional scale, you would -need to create your own custom file to do that. Normally, we turn river-routing -OFF for regional or single point simulations. - - - finidat - ALL - RUN_TYPE="startup", CLM_FORCE_COLDSTART="off" - Yes - mask, maxpft, bgc, simulation-year, start-date - - - Used for starting the model from a spun-up state. -Create these files by running the model -for multiple years and saving the restart file from the end of a spin-up -simulation. - - - - stream_fldfilename_ndep - bgc=cn/cndv - Yes - No - simulation-year - - - -You may customize this file to get the Nitrogen deposition characteristics -of your site if available. This file will be interpolated while the model is -running from it's resolution to the resolution that &clm; is running at. - - - - - -
-
- -
- -
- diff --git a/doc/UsersGuide/addxhtmlhead.pl b/doc/UsersGuide/addxhtmlhead.pl deleted file mode 100755 index d5f9615c58..0000000000 --- a/doc/UsersGuide/addxhtmlhead.pl +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env perl -# -use strict; -use Cwd; -use English; -use IO::File; -use Getopt::Long; -use IO::Handle; -#----------------------------------------------------------------------------------------------- - -# Get the directory name and filename of this script. If the command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume -# the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $nm = "$ProgName::"; # name to use if script dies -my $scrdir; -if ($ProgDir) { - $scrdir = $ProgDir; -} else { - $scrdir = getcwd() -} - -sub usage { - my $msg = shift; - - print "ERROR:: $msg\n"; - die < -OPTIONS - NONE -EOF -} - -my %opts = ( ); - -GetOptions( -) or usage(); - -if ( $#ARGV != 0 ) { - &usage( "Wrong number of command line arguments" ); -} - -my $inputFile = $ARGV[0]; - -if ( ! -f $inputFile ) { - &usage( "Input file does NOT exist : $inputFile" ); -} - -my $fh = IO::File->new($inputFile, '<') or die "** $nm - can't open input file: -$inputFile\n"; - -# -# Add in XML XHTML headers -# -print <<"EOF"; - - - -EOF -while (my $line = <$fh>) { - if ( $line =~ /^$/ ) { - print "
\n"; - } elsif ( $line =~ /^'."\n"; - } else { - print $line; - } -} -$fh->close(); diff --git a/doc/UsersGuide/appendix.xml b/doc/UsersGuide/appendix.xml deleted file mode 100644 index 058e67d577..0000000000 --- a/doc/UsersGuide/appendix.xml +++ /dev/null @@ -1,305 +0,0 @@ - -Editing Template Files Before Configure - -The last kind of customization that you can do for a case, before configure is run -is to edit the templates. The &clm; template is in -models/lnd/clm/bld/clm.cpl7.template, the &datm; template is -in models/atm/datm/bld/datm.cpl7.template, and the driver templates -are in the models/drv/bld directory and are named: -ccsm.template and cpl.template. When a case is -created they are also copied to the Tools/Templates directory -underneath your case. If you want to make changes that will impact all your cases, you -should edit the template files under the models directory, but -if you want to make a change ONLY for a particular case you should edit the template -under that specific case. - - - -Editing the template files is NOT for the faint of heart! We recommend this ONLY for -experts! It's difficult to do because the template is a script that actually creates -another script. So part of the script is echoing the script to be created and part of -it is a script that is run when "configure -case" is run. As a result any variables -in the part of the script that is being echoed have to be escaped like this: - -\$VARIABLE - -But, in other parts of the script that is run, you can NOT escape variables. So you -need to understand if you are in a part of the script that is echoing the script to -be created, or in the part of the script that is actually run. - - - -If you can customize your case using: compsets, env_*.xml variables, -or a user namelist, as outlined in you should do so. -The main reason to actually edit the template files, is if you are in a situation where -the template aborts when you try it run it when "configure -case" is run. The other -reason to edit the template is if you are &clm; developer and need to make adjustments -to the template because of code or script updates. An example of modifying the &datm; -template is in where sed is used to modify the path -for &CPLHIST; data. - - -Outline of the &clm; template - -The outline of the &clm; template is as follows: - -# set up options for clm configure and then run clm configure -$CODEROOT/lnd/clm*/bld/configure <options> -# set up options for clm build-namelist and then run clm build-namelist -$CODEROOT/lnd/clm*/bld/build-namelist <options> -# echo the $CASEBUILD/clm.buildnml.csh script out -cat >! $CASEBUILD/clm.buildnml.csh << EOF1 -# NOTE: variables in this section must be escaped -EOF1 -# Remove temporary namelist files - -# echo the $CASEBUILD/clm.buildexe.csh script out -cat > $CASEBUILD/clm.buildexe.csh <<EOF2 -# NOTE: variables in this section must be escaped -EOF2 -# Remove temporary configure files - - - - - -Outline of the &datm; template - -The outline of the &datm; template is as follows: - -# Check $GRID to set the $DOMAINFILE and $DOMAINPATH - -# Check DATM_PRESAERO to set the prescribed aerosol option -# If &CLMUSRDAT; is set and $DOMAINFILE is NOT -- set it by &CLMUSRDAT; -# Ensure $DOMAINFILE is set or else abort - -#============================================================================== -# Create resolved prestage data script -#============================================================================== -cat >! $CASEBUILD/datm.buildnml.csh << EOF1 -# NOTE: variables in this section must be escaped -EOF1 -# Major if blocks look at DATM_MODE: -# the if blocks setup streams and run Tools/build_streams to create stream files -#----- CLM_QIAN mode ---------------------------------------------------------- -else if ($DATM_MODE == "&CLMQIAN;" ) then -. - # Customize &CLMQIAN; options here - - # A.) Setup datm_atm_in namelist -cat >! $CASEBUILD/datm.buildnml.csh << EOF -cat >! datm_atm_in << EOF1 -# NOTE: variables in this section must be escaped -EOF1 -EOF - - # B.) Setup options to build_streams -. -. -. -#----- CLM1PT mode ---------------------------------------------------------- -else if ($DATM_MODE == "CLM1PT" ) then -. - # Customize CLM1PT options here - - # A.) Setup datm_atm_in namelist -cat >! $CASEBUILD/datm.buildnml.csh << EOF -cat >! datm_atm_in << EOF1 -# NOTE: variables in this section must be escaped -EOF1 -EOF - - # B.) Setup options to build_streams -. -. -. -. -#----- CPLHIST 3-hourly time-averaging mode ----------------------------------------------------------- -else if ($DATM_MODE == "&CPLHIST;" ) then -. - # Customize &CPLHIST; options here - - # A.) Setup datm_atm_in namelist -cat >! $CASEBUILD/datm.buildnml.csh << EOF -cat >! datm_atm_in << EOF1 -# NOTE: variables in this section must be escaped -EOF1 -EOF - - # B.) Setup options to build_streams -. -. -. -. - -#----- INVALID mode -----------------------------------------------------------else - echo "ERROR: unrecognized DATM_MODE = \$DATM_MODE " - exit -1 -endif - -#============================================================================== -# Create prescribed aero streams if appropriate -#============================================================================== -. -. -. -#============================================================================== -# Create remaining resolved namelist -#============================================================================== - -cat >! $CASEBUILD/datm.buildnml.csh << EOF -cat >! datm_in << EOF1 -# NOTE: variables in this section must be escaped -. -. -. -EOF1 - -EOF - -#============================================================================== -# Create script to build executable -#============================================================================== - -cat > $CASEBUILD/datm.buildexe.csh <<EOF -#! /bin/csh -f -# NOTE: variables in this section must be escaped -EOF - -#============================================================================== -# end of script -#============================================================================== - - - - - -Adding a new DATM_MODE to the &datm; template - - The steps to adding a new DATM_MODE - -Add a new "if" block to the &datm; template - -As you can see from above -there are major "if" blocks for the different DATM_MODE's. So adding a new -DATM_MODE means adding a new "if" block. The two major parts of each DATM_MODE -block are: - -Setup datm_atm_in namelist -Setup options to build_streams - - - - -In the "if" block create the <filename>datm_atm_in</filename> namelist - -See for some notes about the -&datm; namelist and streams files. That and the - -&datm; User's Guide should give you guidance on how to -setup the namelist for your case. - - - -In the "if" block create options to and call <command>build_streams</command> - -The next part of the "if" block in the &datm; template file to work with is the -call to build_streams. You may need to add additional options -to it. You may also need to call it multiple times for multiple streams. You will -also likely need to add a new source option to it with the "-s" option. For more -information on build_streams do the following. - -Getting help with <command>build_streams</command> for &datm; - -> scripts/ccsm_utils/Tools/build_streams -help - - -The output of the above command is: - - -&build_streams_help; - - - - - -Add new streams templates to the &datm; -<filename>datm.template.streams.xml</filename> file - -As part of modifying the behavior of build_streams you will also -have to edit the models/atm/datm7/bld/datm.template.streams.xml -file as well (or the local version in your -$CASENAME/Tools/Templates directory for a particular case). -The template is an XML file much like the output streams file, but there are attributes -to distinguish which fields will be used based on things like: RESOLUTION or datasource. -And there are filename indicators (starting with a "%") that get translated into various -things such as: - -%c = Case (from above -case command line option) -%do = Use domain file -%y = Year (through range given from begyear to endyear) -%ym = Year-Month (all 12 months through year range) -%6ym = Like %ym but 6 digit year (ie. %YYYYYY-MM). (can replace the 6 with any digit 1-9) - - - - -Add a new valid_value to the <filename>config_definition.xml</filename> file in -scripts. - -Adding a new DATM_MODE also requires adding a new valid_value to -scripts/ccsm_utils/Case.template/config_definition.xml. This -enables the scripts to recognize the new value as a valid option to DATM_MODE -in the &envconf; file. - - - - - - - -Building the Users-Guide Documentation for &clm; - -All of the documentation for &clm; can be built using GNU Makefiles that are -available in the appropriate directories. The Makefiles require the following -utilities: docbook2html, docbook2pdf, -protex, and latex2html. - - -To build the Users Guide for &clm; (requires docbook). - -> cd models/lnd/clm/doc/UsersGuide -> gmake - -Note, that when the Users-Guide is built it will get output from other &clm; -utilities that by nature abort, and hence stop the make from continuing. However, -this is expected so you should simply run gmake again until -it either completes or comes upon a legitimate issue. Here is what a sample -warning looks like when gmake is run. - -The following line will fail in the make as it calls die -- but that is expected -Check that the output config_help.tlog is good and redo your make -../../bld/configure -help >&` config_help.tlog -make: *** [config_help.tlog] Error 255 - -To build the Code Reference Guide for &clm; (requires protex and -latex2html). The make here uses a Filepath -file that points to the list of directories that you want protex -to run over. You should examine this file and make sure it is appropriate for what -you need to do, before running the make. - -> cd models/lnd/clm/doc/CodeReference -> gmake - -To build the table of tests for the &clm; test suite. The make here runs a UNIX -shell script to create a html table of the list of tests run on the different machines -from the &clm; test suite. - -> cd models/lnd/clm/test/system -> gmake - - - - - diff --git a/doc/UsersGuide/badpergro.jpg b/doc/UsersGuide/badpergro.jpg deleted file mode 100644 index 4a378cf52d71870efb21201d0bd38a9d364ebc2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40077 zcmce;cUV*1*ESfc0)l`Pk=~?(pmaovQW9yQ6N-SKlmtSr3J542LhlNM-b)g?(u;u7 zNkVVZr8mKk=eypSd44nRT-Q7Q%sRPp_Q}cFYoE2V_E~$~_s-wxzY73rpqi!{fPjDi zpmDPS{^9_t03yPF-H@|3NiozArUcvg!C2- z?d^M3ex6HhlXzW@!7` z-6P~fQr=Cq4{o&mqxJt#d9x=XCLtgsy*Z~q10eiIC*h5ah;EVm^OYN&G@Qh=;v~v? zT-Nt)>gSgDQbS6w0=7vUrQ><58uIP8zT3~m{l8ei9U_98nmL4J5=~#jt<1QXjz@zQPBd=dE1;K0uHUeA9s|cvD!; z(;a(8%R78u?;cZFdp`8k&qe~|1jRM~pka;Q%+?P#iT(W9fI6wkC=Yw0-RVZM2P}2B z%-erS{udBoDmLAw%RH0@_wtSDa7NCMIbpa2!en@m$FR`Q6t9&fWo|pVOJTF)h@rYQ z=@!&a{|@d2$G?Ei$i6g(0*U$8@_0}=W?7prn2ol!O5p4r&jH~85*%YL4BRW2o6HMo)D9cLg&=goNi)FbtpGbeQM#bu0x7xdM)gO^U+ zUfKrVk){R8v0dTo8rE%2kvIqMHjC*ZD0Xq(?Q>Fb0fk&L`506$qIm6)@lcA^68krmC}$UO?JQfFSj{ZElF-cP%oo8avdYnU zsxV-Jz@%;OdUpWz@)xHipMoC@7J|)Po|Qv6uf`6xK@5F`_zJ2ENRH^Tuv*Kv6q)26 z-=Z8t=j3z<&t!Q2GJJ{Ldm?98Xmo1-gtQ+F`_nZ zf>R+$W@^3AIhW(R$1^(2s+7};1I&!;Bd-PW(IuJ^t0@*%e^|__L$;M(&b5JEsKa>I9=zE3@*}P(gLa^Kqa;1q=E=c3gIVvAz&Iu(CJaBU9{PX z78j@PZu$#gYWCL`t$gx8WudkK3BV}O7Z=AhsPBA!vMMBgRNqVmY&HJ6uaM(qTfk6O zz;A-=(3-$SnHy7*r&B#SmMP*Jo{%1ZICv!&Kbax6tTJ8q~tG{y;%Qi_JUTwMqYnr9Rl7|~!Hmpzq?dKJl^~}P6-7K9BP3O z8m!M_tO>VGa(sYc8IVZCi2)ja%w0(JtB0w;FT$>El{W38XY#vhjfNM!O!i=gqbidF zRS5>#(WGymicYPZbGQny9jdchZ;@TgOizAc*2kh!<=CDn8fZAB)7*Jv9$1+4V^;aq zZdFhKa7jw?{pdf2e;gibUe!cIy8p$rk|G6EJF^aYPun)VeJH9|$2Q4iR z*nuEUVy?<$DxSpMW0}EY!tN|A{ykUDRnv@rw&;$OWHu*7>?o6JRhWoE zmdC7c=K$^BH^Nk+iOT`o;jm$t84rP198fzISCa< z7@w;GpR0cL`US2s%xUhk-MJKJ(p(J`B-Q9zIenF4w}bOYbG?#J;8FWD7FYk1@=MQT zk^sxB2Y*4vkE750R|M6o=%-5Kvrc{ckQ|}A@`+Ay4z>8CB+yF}n(?W!_yO_{qAf-A zzmw^`u&?=fVoE<_ezE1Lc6$a#1%7e#r@~~0XFLg~Gw}I-VW;^Te%9E8%HPetewZY^ zLWNUIBBmhi6g8S{cW&3aAX`d!@G=T^}*Q$mkU%CSEm zv<|i;x7Zp4=ieI+e?Q{iw~T6r)GwXFbbU1`T*fNKf6FIdy7-R;HyB)H zYM4fhcO3|gp}iW`-x1(aeY-}7`((6%r-HD?E>)51l8?x#+xOJALMD8DA7-1Izv$U} zV23iiq)BBhN_(zmX6mrFp|^={31sfJwYF`A zw!E;E#vXk~0ToQDt|m}f(hnT8vV?AIq>qXE{>Lvc!OdXtxxgRd&?gL^v3Q{7Z6PJ# z*}Z;FB_TV)TW0^W0m(pZDy!9XA}duZ8K&}}dU+Cpwfjh>Uz+=HWgt@k_ljDipJUg1 zmz~H(B3!85a+pndt*uk&wr&14MQ z*x@XQwc8oS2bdi?3UWZi*)0Xo_UxcBy3(RaPo1l*(W-f4_KvZCm47fa2;Kxef#5~V z^8E`DIf$^tQEGEp3m&ZFd&-J)0Uhi@uj%o}+4_G0Z=RH$PW1k+C#eADyF2k2G^WVy z1bbzRd}2+Yzupv+rl*;S$KjwG?*d!fdzy3VO5bmW?r>7}jB}!fw!eTt@277J{sLx(1h0((cbiwV{LZ`Y6SI^y@SGRR|zY0@A5_n|`pC8Bc8Z2r?r|d|RU44~Oh4L|T!^+|sknZ_xeI4<=hl=j2C40=iH`#<&jq!V za+k^uVtr#&+iPIYCxCr5mrM>YI^x1*uLuHd7{Ng>fBD^XCFYpZ;`V>_M=`3vCL8R? zAWz$|S_WLYjlN_(#E3D{yGd;om@YE=S#70#VgA$TqGWaSA3xlw5HTiV>+w%tBKR2&0l^oW!dMz-65twJoDj^Z&Q5_xNo#{-2s}(bajXNAxy6KC(>iW0Y@c z&e>|g>wg2Y3hl(LwRz23pZs7%K5y`s@qbyLD>bhK({A z091*Tnzuz=PcZ!3pBm^VqTiHKs*i5BYZu@=3g_lbZL+N;+A=UXBW2dkBtbUk92hC~ z$JL*KXD_a)7T8hk4F(a}`oX=2?!bV%*SH%8`%h;pF&#bioEjX?v#mDdQ=e|N-Rq0b zbQznXa-*m*S5{AJGe{D{fTeY{yMk^@ax&%WZS|RVr`K$_qZzm^dVfp|Z`MDWTi}sd z`1p;&=n_dBR!l;DTa&xD>tn7QkBjck0*y6R-?z#VO3xiUTiWi&Y<~#!^h)0h9 z@K?X3uKTCW5h<4<)T!i52D+^seagg?DJt5%-S9_FyUqC8a>QOt|EN&iY3BpmpXsf5 z!(XFg{I7W-FV5&H<@b#SPWKn4=uM;$PJE4TJ$0jt1l@oNi_55hH%z;^AJj)nqAU%^ zht@0xgzvb3QbgPWxreVF!zoL4Ie{uV$TQ3Vffa{0+d}Zq|FH6oB(H~YiM9t4* zSW3!F;;S}Q!*=2tUa-9qM0|dkBx!f-W5+j~t2*Y;IN9U(e?O@vARUps$KUzJ3u-2w zvZ|}kINs{kFjA);-J9&Da^>-B7Zx9%r$R2JdlrEw?^QnL&DPsw)EC>ft=;aA`)EUb zNeeTYDb;(4yJ!rx1P|V)J4}UV<%ryO}DRepRUw~<1sa-CF(EWIN*T_trszC-~1BpJ<+QtcK?qs z+Cb&BEW;(vF1}hGWev6EZmcijz%g9t9_7*ZqC)a$%>{o`8_?-gSLsC~14~avejt(s zlaZ(l=q2ri;hPI}2XZ%ae+F;<9nFFJo?EtCu?vw~F(MjXayhsUE}y?BYZZs_L1Vju zoa;*j=Ocrsx4jg5ng!iLw1HCtr|P9xN9-HNAMo=s_{WQdrIl3w0)P71KPn2$$TjTT zM(B1(P!XZZB}jmr9~`f&y?oJs&bl@Krm3S1Yi+qxd1|8*i%(&^Mli$|Dt_dfJ~HDP`gcc9IcV!?7WX(AoAY~}Tqcf4=8qwdnSDgN=^Z%17V?V0p! zd_g?AWRrItZNB;oAnC8)h$?tHBiVCn^maQWmGc{~Xg-W}RnwzsP!!rHLl_~>j-6GbYqpHiKji%_ zi$#ndPlg{fUxinFX_XX7MiPjbpeje+H^EZLz~IC?$~dH1a#(qIwhz%4VmC zoLmb6|1g`iH$H4NOrWpGR$93udf{i;j~J9*gKcZ3$E#X@(n}+AnCyKT1k6-jsrouQ zTEz`rH^QkKYA-Ue?taTP6-6^QU?s=sWBfz7?tAU&7O}+e*M1nmj6gY@>9WUVKh&^2 zn_0hw%8zu31ACi$LB(X9SS-IE7yl9s#cB=@wPGkE7eQE1as4 z!#z)J!#JUMGx#%;!GpP3=UtV6&oc1^NOMhkT&)9J`}DqW1SVTWTu7iDpN}_d8tGb! z(-?gKa*8#B4pYnuD3PDAXm>6>OdPv72{5UAyy@e;hnlju!Zde8%CU;($Zr~j<}w_c zg51^y#r1|JDt}km>*UpxGWcj=Lvim^#i#JT#+oHB)iU0^j{oV9&}ht6@Hu#qjKmTA zv3Dyq?HbxZHIq=s6?g&xd15A`oVHZI3iT<=7r;q4UpQ$TkS)=X7@s{Po8T=ILXV7i zuCuq9n3zTP(d^qVH}mom6MrN;RT~hHkGX1%30&TY)77zIEaSzMfXlvbl()i~JG*Qo zUa4y;Oz+UsHIBgd@Ab?3@cAwORLiV)s+`APzaI;5&qba+9Z$(A*s(Ogu5N>4aP4Og zG~Jfz>0uJu2NYVDVhy;RjRe6?TD`j#@)CpYnM%{haQxeNgyEtS@DFi(j(H>BDLYwo z=)8HdXV&)M0c~d;#L8Y(_)8n*mxg>8FHgm*xGl_0Ks#-GUopaoK{gq(cdl+AD+(gz z4s*fI)^){x{|r{ArwdWSe^?%gBle#veWrshf(z{m_-|6^uQ88L+M(UzJRNza1)LMH z);-uW-PRKmoDE=_Z}=)DP8;cMsQB0+pc&aQGIi^t1vu_ok)`0X#pvdK=>Z*vsKEhH zN<>AY?1{WRqPZ*lpb<)%-vQ&M?1cXyBUvAB2qh7U7g_)i5Pu=gkvw`?J~#L(*R!eH z=G@&BxP%k=M2T$R4-NlNS?s2S7tj`pxN;-K>k55mM`p6oBts4s%Pwl(B|=>>c>hU* zm9$}6M0S=lC#UU5&A$0`6K5XO?b~NqT&x?t?kj}ELp{go5+EExA*Jf)J-qvePOpJu&vEQIoZhAlxu{@>rJ#*}-)zo_CVd?{df+2eP zLV>*UQb9&-LgX{N&#B|ROOGWjxG3KVBbkMZ(aefFB{E3o!ud7^py#s)IVjm~kwrcJ zP1BS7x3hDXODmr%>{~S@2S7aGQzdeGfgl;-E5BYBw0}Vm-hKyt!ZqX?6A4j@{N?^W z^pd7+#ownAFfo@dA``9?-#0!f#=vYF4cQaZX!_p#sT2+bX$2u=YWg*ex{3O=FaL16 zOmgO@sTwm>`2`|<6h-b$2zRtYD)hRCP|UoOsR(htc!TZ48#V0e5KZ{q?(or*m+BxOcR_-#gU{^t!zNPA2&>T;gM z^N)UE@~WETHHE{RIF4b@zxbQ9Jpzu1#htd14}zK!HZr*ext1Tmk6KEmRxgYyDQZSU z+N%XA)9-S}D*?9YRP;}cM@PypR0&7k5B)CmWOyzNw$&{%<1{Oh;c3}S3MI{N%l?FC zJ)IMa=b18#S3^}5@pS0jWPxI%hT{qkm7)e2b|r2F9*|mJ67^k;O{TFNY;5$ z+73A%AuA{ax*G+kyclRh3G+ZDiU7sqT?=)j;AYaRQQi5#LC2Vby#}|o?0&vK#`%8f z;8}TKM)9g(ME5s&3p8C08~f3rTiICKXY2Xe+tbXTkmgo}!xP1}BE^HFL;W~QpEAcVsEhOrB$-*D%kFNPV;d+QqQR7Kb=va znLm^ct*EuDg#V0ldKn%J7XUYk^aj9p&r}G!pM7fZbP~|}fptLo0wMZwXK0|7WT&1JO(b^jZO?~k&yH?3k3ev6(9Dh| zz-;G!9r&(YM?=MWw&&QsKsSH!84p5JKC!jIyqP!sQqUsisH?w5Q>O@K_95yO<*AN4 z48(?W=T&uaKiD)x8W|$8K7alTXfPX??rwh9=KR|%rxMksqi4zdM$}mL(7$;;v!!`< zW|m0^Df(GV;t7!!+}TN0VmtChCPi(puh-zUM5QtY%H4>ym=Kdfs0VGmHJP{L<#UxZ zEPS0AQ^|6kQexCdYXV(=HJ}gl6C95RX)~mt1`s;5x($4;UV6+AhO;TO>iT}NkSee$ z!47%L*#_8Ah1gC~vZD$@#1b}i=&89t``zVc?~b$PgFs#KrIK-QtAix*eF{#)P!^$skd z-XalhO%oq4>Sx61=M~6Un5k|y*6>kG_Aymm#z4qK|H^cBbt?}&cBsy+ANt6GQ*{5B zbsQNubfPh7`j9(mu2Ri2-_VVM*bS@yYf%L)_k(-Zyg&`^pL>ehUmz!H^yw3p+0x7H z6LS@b8A|DHlUUPK6?msVc-th@hs7ol1OyMXvq_rg} zM3dV1wP(^ep8TwHilzl*2@}vMC0BvAUsnyHc%y$;!r~>nf z>M9yDm)o7w{7q(dkZi$wwf8VE&|6dO0d{H@O=1^}yq0@5uxZhot~09Oyb#3FL(3>P zoJJ~dX+Tc*8t9;`#OMBdr}ks6t56`_NX9rUuR-)=SkkK|{Lyz6v7$y<8dz}z`q-UR zXpcK$9i2=9OI)CgAX54-C_vTogMqN$%3LV zOS)PKK}hkn$17Zqe?duv$XACnnOV`&Pcl4>96g_Ly{nuatUax@yCO|C$|x~>$6|)x zbGEB*#cEGJQOsRu(9-PKKA)4_e9?4FFOl{#1*H9%okU3UM3>_OYPmN=t*3xKdsl8I z%ws)!?c~aNvd7BtO1ydZsRKM+tp5WIG)W+#n?yhvjwI%xChf|OjPd>ba!dCj5#-%M zA>Cq~)>_AN9A$vx*2wj)Pr*WNzea$=4K{iB(lx;ez3=Tv1UGn@1hC`twBBgOhMiO# zMegm|ix;M9eqkF0<)=?4>rnS_DVb=N43+$Jwt`pp1BWMWfI@l6(!~H@@tqppAt)M& zK@tP7WV2SZ2x%f{AG=&x?ObB{`JASEtDWD^vU?(ESy2tcU?y?<=}{x^9o_;C>goB{ zv5??H#p7q)M^?b_SC2+jsc8KI~E7d)G5lI@a+7G>l0m3}zaYzICRnwV*<$c)z9tFP3I{tIyS zq4LsizboM6Ce0DUvi!YX$#a~eY+69cMUO&cM^+IQm0f85(RqK{T9a2)3OnZqM5x4n zR;*!5Rtk~jOSlEy8q)sq`=nDFC11(hjQ08qxGElsy;*}IrU8dIaEga@gWcS?R(M6iUMLxJ-dNlTa;6flz2I6KS$AxAeR z?~#cty3?~a$t0%Z+|{DgXICGp?BV9#lq}~Tbpz872RAiJ76X6gMgIf0sXOVq1v6KR$Ys`h@81rlVXbelA5K@(-$PGsRfo+Y6h$LrG5;w+CX%+Qvo2@T6U& zpJtCh`Hp{9W385&=*TaVP(mqgSEozEa-uR5%EDEylP%L`nobo8xZX_KXT#coYg($# z;Z8)v`PAH4xrjyL)6fMbXWz*)UBI#&Y@>MqaMVZ%*kfvKB=owch(onoM20pm@r0gNn zEk;yWLB&?nI65UhAZU6zrnj%?F90uu^ZjXG8&$s1sOFh49L9SrH`Lhpw0OG!p(1lm z4Dh;nRZ&z-PJA0Fawt+beAW@QF64%v8hAS5QlK|Fq;6FlE#CE>rs_?@j?Q&uSKE2U zlFVqc_aDS8!N@z@C~fNPzX0!dR==x=%<_vWaaxN^p3Ogz`}bRle1bM~IC2#OgP$#0 zee@{O;W5{mg9(toZjizO-E_s=fYj94qqSfiy5KfkcFWWYAI1Bt7%Y8+=@prKi|uU@ z(#uTf$R}+)YQMd0g8SNAFwtp|f8FsIz2m)M^(1xtcY9(Fjm}b|t@{yj&n_1^|08Uv z=`?2LTu>N@?nkSourQn-BvFqya0d7kZS$?J&-b?BW{w~9*Kbh`3dc-~PHHR(yFQ0? zr~+e7QTi9{Vr;!G9OKe_wVT=`F<)asRuc-8L#88Zyp_E`l})D%m|~s}HDj_{^S(%5QdoI|DjSM!c#mn2hw171-bp&e7*jc4ZmK8W!@7LF!G3(8_YkI+0oU%Zqp%5PYknHVKKmdGaQ^?eAH6 zdD!yy3u^`!XMFJTJ=TEt;?OTmt;gwNIX)^ghmie_&yK|fY{Ek~t{(?On1XFl)gKX~ zkawoe-UaN;C61>DYL_n6=j4%jo7pz4(jp2DV9n-nM=*YS`K=Jo(v+`n@14Gi(F+T8 zvSa3nEaoG%d8$plI(LLtvrw5T<6u)=6FNiQs zJG^-Ay339KBY(z5z&sIV#pJrAW3Bh*g*`~<%6?YK%%v3et$Sfsu=`qmN zbUS56j6J8{>mjo0=kOzB>6p4R+~+A`X?`iLef1)Fi-{`M+s=Ob^-p6q=90j*F-}M8 z5>Xh@Z1DCbiaV9{&%M3I;?{gQl$C_$udaK1oG2`7V!ZeR1?dNn+7v>6^VEf)A`4d- z!8|mWtHK9k$xaeM^Th@g&XfW!!oluof{=V32L$r05j-wC7WO9gk2US(`5o#3w4pq_ z9Cu#NXKr~5we1?ASD`WkJ3fyEkLDLAyg@orW-Y+2R!c)z-p~~4JhA0KYVpv($=u(LH;UYOO7rn0?sHEscUe;~z$( zwCfOIE(MuG5BOX-*pEK(5LNFtlmY9+7W*6>^ z{RP|w0fjolj|UvuKdpOZbP6?J=Q@gX=u2#0v`XD_d@Nj&@1pW!`I8d4>-J{?J(B0n zUh^){vfne4Svu^9qh!cqf&Qdbs@8s|9DF&AIB0-|TDw4crVP^4} zZHAf+IhXdUcf5|WEnxLu9vGI4Wf@j4((U6s4D52wxnvYS3q4AZm=~jOnc;(sA};mQ zW{9(UzqW7r-dd4ndjTo|j{h93P>T%DE9ydAm+{Z{Fv#qWguZbs)vGWZ4wX{x#-X!X zuC7;^e^%N$w|T50Q8Fo)%VIcJ5G|{l9pbggmO#jWj>9Pgq(j-WfI<=~#PnvglnER) zRDrP@>o3JGEhFEYrb2xzQsm7hbD8Z0}#dSdN*=hDt#Egs?A0tGDZfo8td%E^So|9oxSN&8DL!kUhJ*hOV~AfG zphoU22q@8#Uc!{*13zL*XNkW_5)p@`D35U37QZ-s*tnvX?AZ8B%vwriR$ug%Z37wr zCJg`6a;7~8b<|}7@@Z!)zk98=G4M_&v=JHavfUQ7Cm`6~*Na6&Xf#yvy;TF@M@=L? zbn|A%+1?Cl4*#3#b3=e298wraW_zrdKDRtdo&03fhjqNZ?3)IghN9Fhzmcc1Wh_Q* zoA92;cbs^l&htMVroIYe6ZVkZ62qYis*yb9R6Gdp8O?J7GdY8lFFk&?e=eP+iWt8& zh?s+=<#{_Wy6y2*cy;vCFuy^MPoOov*TmZqw^csPs4fw? zz}ptKNoIitV&G$@at6A$s52`~tIAkX5!BIMa}*y8i0jk9zxUlgNzk{b_%c?1FurN` zRz3HUrxDu1Q#(iVMm@ixs)|)H+YSvO_`&WPnWWavHlU(`LIQtAXzAqA~ad} zDgvksZvSdPu)SK1sDQqenxJy~aoN@xTBMLRz&o{v*qh34x{zY@C)>L!DE7 zL7lg(OtXb)agVgQtm56`qP)=~tX}Z~Qh;}}wEeEEzk$VUOLNhTuob$jv9Ne$vbjjR zx}qlcyUTP-W2%7BB#W?W(7^;NIWPsBv(#1%pMP&7IPf#-g!lDWfcHHIs_8_V=%KLU zDc!W;rWLRF#4i3nug~~gZgLXd^>u*vT5wYF^z`h%0KueG^Mr>R{z+Exhm~v~-1~90 zzkt%TKrBjgMmSTNS+rSsmT#@!u%(;(=SR7IrVESPG?*$ zLDNsrY*>@G*)R5N_9524_UwgVD@eIGa?}usBG=jr+uaM;POLNMsm!pzDf+fa+V;T* zTl^89JIx1Qe|n~=I6!C1*(IRRDC9yWxQgab+&9l%6=M95rrO1AzO&cBHHWOWX=1hV zZ6KK8WDWvK3*2%M;NC7C8dQRpy~y!{+gD0F{0_xr7p(`7S?h2&R?FYLO|GbUvcK+# zs0rOD%mvk(i=1_e^9Y)JcmT2nnz8uM#X5q~x;${=y&7E{bTgx3vJ5C{urX>f>pS4n zPX05pwQ8_OmN!f>^#MDjVK!tBM}NO(#BuOg6MKS|u0yx@nw1pKs0^C*M>N-9QI?3ClO`cs^TnT-MUL z2dw{Xx)+?xByu1NWY>kp>#~y*CNI#lBBaj~%x}wmVDQ`>yZ7r@@@=2U(D(XTx(gqm zPe_CM;%*q}fDzdHW3Qzc|mQ>rK`9n#|;^0S7JI3 z90k@7L7{W@b6{f#*a7B57JmgA4Ir1Ik=T(E?swbAG5-oh+hfd49E8jWn78wXApQYg zPq3|0tc;D;DNgmyLQ?52=}(0jDEg=xST&~0;fi-9-Of;WB2@42^_0lDwkbmF;YU{8 zpRb$MqsS$PkdIQooSY3?g(kCEjOtw(iV8uflikbMT2;^7k>jOXJt3hLcKjE1PBODV zsQ_#HtvjiPlTG1?T9iUnZF?Sx^@w-r{Fr{pkEt_g{@>YKQQDv~BmPsVLj}pqTIjxN z4RQugqHo+Uu<+m+BNus+1^|#)Eg!jWnowqXd?JFq{@PX37fW(=|F+xn#Y5HRxZB*W z%0%C;!0$L6!L9GPvhbY7hG2u`>5oCrT4HCKU3`p;}!=@{q4!H#PEh#73)n63SG$qLh1oRBBcyn)a@01>@ zAKJSQ=QjxM_Q(g;@n#9#jW%g{PLrc|ua?9esFK`tS0s2I&t6+Oh`sMN_>?v$d`vL% z7rejXBli~ts?~8sd;!75*96Rb-)Z^In1`?%Y3ruDO!pyCQ@2bC7qT@Riw!0d^&33d zfI!=Ri*C~b8wtU>Qp_-=pNEA#sE!19#xIzHQPN@Avk4WomA`=a(!74(4rAKI@f7>z z6ODw$ira?$M|8(j-wfXmuf7hjLpN z4#;1u%OCTt-F%p7F3GT3NbP(}R}@iMn1A?UhcVCgbD|^>!6{FWL^ze6;zkgsftCmZg zkv_1$MF?#-V{v9ehxFZ*zHO973riK?kE3N43OqIP0znICk?a_Nmdb2xpDm+QKE2m~ zw{QZYxm2Ug4B7uuX3EJ+;ukak94Z2TC{tA*#^*JHuT{i0NJNplf#fRMio4-ry(xo> zEX^*D4%na&m^4eK_A(rU*Jr@YR-VY5f`%|k31XRjk;)Vf$^0odSopB(a-Tm5Own+% zbiBAs6Ya_U#%jE%Ek>qW%|P7qjaNmE@Ilq=n?0sME-}#_8)<9bh=esA)WDw9rU7<| z3nGdsC}vHfcx#07-xWf>?Q!vkVrveKndt^|A*mel8v0<}6efyrLY--ImI1fM!UN3KQVj*_R2aO4D9TQ`pKX z-UCS#WbkRkUME;Zr|zzBnxG;=L{4Lx}d&l!_VolePf4 zoSec^IWyR<-mE7S)rx5MIv6$Xve=30bL#YKeom1oWg6>`v zya->8J)^Am z`YW#ljOvd#3kyqB!%p8p4(3Hp?S@1%au7*x#})%|yYne?klh0Tph0)=f5V}dn13m^ z-Q8RyB3vhpd=U54^-&p*=QHvyR=YWBQ=KP5jr$xs7?tsV2FB6Fq}zB$zT^r~WEZi=QW{UsN$yK1XWm z-z=IaK-`x1;Z*W^OCoT?`P4o)%3DE53Nj#HKdP)NXUadpgxuljiKFHJKsjDLeb5kE zv3^&Y4q1$NM^j5n@(tKawd!}C@HX6T!ZY7wSC_59ywW?9;o)rQqq=Js>}u1@M_wUo zaF!Q{W)|*7yJVCs7dr}0f?Fmx)?}>;*ZA4&jqm8;kF6< zMP}Ylv-JF(K?8C1pd)-#ZGnTbf7<_Su0%_?AMRXM@>CPEB$4rs*+-jgU>ryO_7?GW zP(m#tal7CgTjX0=KK&a~W)zk3I0J9t8QMoR1DB5(3PK?HBD13helY$y{03p zj#4GjZvr(OwdQdDgo%&CtoH|vn}y44S5>@}Dm5K})D7Hr0ESz%D&dzOs%hTk-GH;8 zCx?2H5AD7+`oh5a(KbWf;E);GNhYYsF6nS6y;v{WIeUcLcrtUz@!OM2<_>(?3R>8! zxSHi=9y@-3a}WUcD+a{toQiEBbDr~mH%b*C`wb=T|is=6gnvT&i4{mQ#XEm>}jwuR_3(09E#A3hGP4rT_gg# zg}%LO#nqJYc5*ehn0;`H-0l|wl1G|Bd4ZhV{qjT$zRv`Ydjm^eO7n(=NgWV<(mgMT z`Bu2G2Bj zg+@u3iobwMG_5*Mf`#yzrM=A*v!XO>Z>2ZsOQ~_(&=)=M$uEh!l6S)Z$v(5{v0v{k zwWr=8?NmIpYolxV9>qsj&urCk_!ijt)|K5gS-6A`&-!Ou0iKdqK+!1 z2)`hQG`%tfsqll1$pVRTyoX;&V>9 zWhibk*>8OBt-WhH#?jL{8GB^% z4mp#n6)lN&AcDkyi0OT58S(h7n7Vv%EERIER+ddCVVA_e@R%k)0V?}+?cv*@#b_y8 zuS=YlNfmznqX3LybTlJ6th_8ufP-hJW*!=2->D2KF-$7ehtc>OIB#S9Ax`b3`n-=||&F95xM?$S?f*C}R zeQibJ8NPD7K{oPrX%l~#ncFR_qn_d&(=1vXjQxa#3|e=>&%Kh54p%J26|Q=fn^7^R zw~3x4%{^$!Bo43GMimHX+O6ZsC>2%S=joD@Xp#dmVs$1N_vGHqo~Y|!v&9+ZBkJXC z+-7JRcRuI82QM)S@PpVztpm`w-r*M2&qf7Bf;!{tZPK-M4rR}Nw;TQukhlLH{*+ZW z##A@AVrV?(EXr|M?7PM4dvfg=%|xf7!>rv-M!Z^>oMYQ6;h^SUz@yE-fWC1=sl0zv z1$4-5I{uNs)a}VkF4LYp#MbO}|e#kKC_YWg_*=XCi(pCHu=}PWZ00 zf1=l?BJw~WcP&xHz7BmwE#fm7E~TeHPf|zQ-f~#aj@7YJ+Y>aTn_=J4)2 zqsQ|SYh^*`LoRco2<`-V;=cfs$n(MREbROBuy(4S&4;JLQ0QZr#Q}(6FmPu=IPAjv zo99<7tt@>>Jk}PV&ZjPLegMnhzHhMJ~$Bt)}ZYbR%R=%IlKm#k^)U>RaC=I_NX_v*6#u zsg|hYBd7+TD;1NGqqT*Yg6-Cju`ZV(YYTPpntw?8HPJRubrrzv35`XKBit*ReYY^WF;kJM>`Vy)0N6hixA$C8n zDS&Gl(POsW21W(|T@|2SH+NiO{_QHm7YD|HRZDaDgIsIxg{&#IjkF~xaaZZAys=xq z(qQIqBJM$)yCQ@8U7E`ctsks5#ipHhwn?53`#0^a`;UFuLPu) zDNd-pxBRsdvyn=hc)`0gJKsLYGSAZA7gs4KDH3gO5NOcN^5%(e-`Q5kZZC6PvFj7m zGMkn8=Osi)(ylLcu6qMe#Fr%eWV=Tgjk!0AZYdt4VF0okcn5Q!7Bm&;ZgUiD2Ryi9 zW=+ZyvLB&{rgx9b)s9Is#>TOeUG_}Sw*T@Do8GZ%q`m>UFM5XN7frtvtAImOzq} zEVTt6U{U6Ftw$tNe&TsBiporsjxv|8_u`cppJa{?NA|eM{{oKE(JpHPP?OTrNF{#O zZ-B^yyZ@EiHnN~HoK?iFu`#J~-t>#X-#rw)DZ*L#rKeA-ot5 z-qD490p!SMs+Gmaf5$g%Y8NcnpY6=FSO(leG}NKLJm$Xjl50T&6h`v&hqNG&2SvXe zd-4=e`axyCRjKDdL^U!MOc`j*AjF!CB1{%gTOIeNgso+eBe~JhVqJ4J5PEY`WK?m0U z{#WB}hs~Xjl|Tn^W(UW33tW&hp@Ct0%*|?@YeThPSIatkf$EM16*8&z2~ai0Pg0u| z%GG@V+I{4~i_59BaqZCJyNv30Drh{D*B^lCuB%>0&1y~;!}|UL7MxTKJ@cy8_Pz}! zXW6CrAATCF{Di8+9%?`QU$nhtRGZN8JnLC&&bj7dZV`_E zq3Z*EW#q7m4@9Xi;E>q#lo@Q_s>mY#0>1bWw8|ItOsSgiyq)uTJ-cEx0UNW640o-2 z>l){tPCmIVgk0IN5KBqzCziqkCg%$tlPJVoRJC!t1$*{X%z(HAzES=z;Zkr7DXD(c zQE#XC@LA2VUuo@+Gr984HIJ^k(jN|9g|tozIFCkc3f7x?!%E9n zM8X|2HXSlrVOmA>a**?8U_p3#AfSJanI81{Qp!O3i_;XR1x`reMe)+pzDCiBPMU|1Tz8fC{w{7JQB9?>6(A!t0UlF% z;<*x2n`|})*Kc?va(A%E$rQu09|wt<{$+)75Zs(Jp?ddwZvE(C37uV>Xw*jU)L(!J z=QI07#MR9a-}L0~jOI77iv`%IlT(RR>JK@NqBcxgZI6Uv=MP*C-G>O9n0t2$IDC5< z@}3TXNr;1X1DqWZ?07h`djPWWDyrXdX58%_`@eiPEW(+s4w~o9&F3D;ajFWi7nsjH zvv;QJwtB~56V(uIRyVI@@^NcHEkOLdGH)`v?n_Cz!B`=s`F^X_wZ2d!?|h`a^kgC= zYIQ-+?KO!YSVkdi4X(;=U$zS!=N+P*xif5l1e9Gholt^+ZgGk>Htnz5EQ{n=s+9u!Np z>E=K<2nj_xH042HyT|Qptj5oVmO({*;6@4=Jael_ze*r-MqUIqb#L`~? z~f;x>c70MXSo^18g6q~i*UPCE_; z65{XszVCJ0KhTE5?smRI!}Rc<@P&0w>f|N|HbpKZp?>6K`Bt1?>J-DiqvY+y+)*p@ zj|NoNlTepQ#!)}Vz-2Nj_}YjjCGVV%tmy(LNp@4)O*R=S%pw9AE}+R7A~inSxd9|Q zP&@Gt#%PAKi=oFnRd``zF1Phfb#b9g!p|ZfjytQXXYJT0sy8n$z)hKk*gYR>^__No z+`ssb;m_e@-8kj-$#65eG|u4y2uBx<=fN?JqSfp`-T#YqjTKJ_?~r(v+#g5*g(Hqq zW{AGlWevJnh)!82+0Q&{RL$oBoIrr(5UoZ7stL-*#aQCm+(IkX9d zE3~6tLm1z7@odQ7=dgXG4(C6AW%T8?`L_K=4hHTmdqOMbJRP>=-Iv;I+0<@NWWVhB zW>pK>IT%DJWH;48J9QjQQ_V3n6G<%uw{`C*Tt~)?dRc!bQpn!`~;=L zBT}qba5Zr#d8ZK$YeqIuvhLb1Gfy2h^MyjXpgZZ&7?YvBGvfeXt88PblZ{*7B!YWJ z3nCU3yYdig1;AZe%KuSh{C10Za05E>j$x_c2RcbYb9!sVJFDxiF3d<8_gC#bouJtH z!qJiK&wmj$(k@0Hx~d7vbbP~D^!CEjltW6V!WR$9|8RgMU(0;nHH8!$1m)%mGTBK9 z+$U}cQcLd0fE|QSgbKfY!=Nw8Jji#*qQ=O%2a$xz&?3^T6p1&9i5`H1M4TD-4}YfERpNFm31x}yr4p;3R#4SE2=`T(P|DJ=wa3s@ z=|RN)yj}k*#_kQOs2}i(??E~EK$0y1d%?2fQER06d72It(<4(zMGZQV6+8di)Zy3|xb z3dsdc3Il3fS}8Rp8}{{8e*rl)!{$yIh-T*?&?_&fS6$|)zYhi{r&s?skCR)88{Twh z*>Lp<6{dL4$M_HzQ8feJzV_PTFe)yavuqn+-e`I4g4sey$e|$mNl_Gw zQQ~!ekpsa#6TA5*lqL4P+l%nT1xDr@z zm3QG8Ae{b=T=E~b4aKk=oKc2OTa&8^L+j*dJf-(^8$MjKKYW{szf3FGr{fH@_8N{5 zT$k{wxhX;=uU4z)HO}LhydIAb8tGJFI>&OZEw&!RDdjmW@|Uz1GOzjfFd7Fx`{rUB zf11?}{n=B>M+OB^tutA&$_Ofn0udOWtw z0|LXkNpJ-aFd^ZYGDFdBCM9LBA41Fp15tY)gUI7^$tOxcF=b{#(&KQZ1Kfwt^k?#X zwRQZ6zdJmV;16`{*ek_HwbMIK4Kf0+PaA4Oa!?Vp6sV~2x_|PP9BBO|Dm& zE8q!^BfEjav~1PAupf{lMUa_{TJI)O{f6snlC5xqLxzYjeN5w2pc7ha9ZHqg2rFLJkg{Xqs6+>K>BUd!C2?H%2+9jh`W$ed*!vpP*s zH#^UyFt0_(iI|7mGdN%L3W@amw!t&BK@p2n@>PjcF%E`-9ykc6;9pR~pJM z(<*(Bzlp}^Fu+>qek^8Y30zjc+n*%*Gay(spS|vjv4^QLPcD`~eto!1^kNZ<5T>l~ ztiT)2DLsO!7EysVE4{seBl8oTv<-LUR@Jklc!<^Fk_?9|ZcU>0sVj;Y9c>Rz1_nJ4 zZtTw8tDp$=K>j|!v+t){_+`YfCW!nf-=s{kSwqhYA!3kO0i2Ym)7#spSM~}AQR*jJ9PK}9$o9SRTwxrcdBW4r)(y*M>ku)u%e^U5h>n@ z+3|y6$Y5RbUk6V6hwWJn7=1FM;Ixs*1p2GHa?=S56Do~F9qr!e42E!krPhalYE9ZJ zS+_o3WF}B@m&l#R8rN{IuEIu^=fXO)ls%Qt$0A%+`$-ij)I(_r)ZztC4p)A@q6sY* zym6<RQAsqZ=*Ih&<8fCxrhT$PjfxQOv zSy-m=vYA%(*9)ek)vrx24&2X~os9ELDkyBjCoUwr&g*NDNu)}8(0cL!HU5~+z{|it zRngu_JbwY)w^J=v*vge+dXHcOQxCM}oP5oZS+U>Cf(Jzpt0ggXf_KdnM^pVKddR)k zucq(Ou#!lYyxVyRTkEh1xl!eezwi*$L)5N*&JyWW;a3-OtiK4H^+`GrxIu6<#$xJN z1iMVoe_8E4Yn5WYb#k{z8a$(qw(8o%G)^|(t9U%U)Uu`WEu-uEGsmd`|IFb11$ePB zZ$}?7LVb5tcPVTs=FV?^_X@RHeg< z{jyV^4Be6Ez4ncs2h7$zU$UElM$)V;G~DbydGXJyVKsMJ*o}DSuOg@j1NOo2Z_=US z{A3)w8c}-Yl1nb~2gn z4p4QJo1JEYSJMYv#=ebChP74GY~Gxl4Efzohm|)^P-utku**hfK13aXN z4;6~+Y%;bwWu+2VCD#QNYL+ebEZh{>D2o~=pVU&=MP({w9DislMe+aJe$aOnzn|5+apI1iwK|gibcBaC47-NT9@3kD;Gp9#Q7nQ=mp(qC~a(fY|g|5;J9jQJYy@ z`uve7x`hJ|PPrtmYt^SeSG%0!*G9w{-uZ%vswY$RHSsK^dIa%xdwi41D^f1cGwncH zvPWjm3Hz-5BBZ4iZUI%=|L|PH9&(LcZ?lU4S224BDuMCC z&|(QS7gE+NhAE?r_8oJ@HmM`TQdXBXjflZk%Y6)cb%^e)aRq>IOdyR?+4;)C;}1$U zJ7E-fb`^Y@bPvX?3r+|&)?(3z?J=m**YXt^wl+I&!C$v6UfFY(=o!zs3Vh=3 zlB8OcmtIG>%b!Fa-Xe3wvYs%@$lI&3Gg0vEuC~Pe1(4_c1$0*au<@(i*_dB*K(UDQ z^vpWb%wqmH6~C6^1)!k7;XX#Lj{3*d0v>2Gv%YZ6L&!E|6iqsqzK5s!Xrh^pFvQevuC>$CYSG^JIT-cetdm&g*9K3X<#(kVCNrUIQe*x3n-Q2Nd=5k(odoFM` z#Rx9U|9U&3WQwA)Y+1eKH2V0u2901>r~Egq(7lhBz+LHu&Rd^shP2M-;{BCUUv8J! z7p<|lkpr}U0dI%n4wm;yjTB5kg-}Fk)s?yJoq>s^PdonJ$WE(jxWc#^q@=BX{`>-J zvR>tW!}%=}@vW9%NwNgBx;qeK$M;Loc&m}dr^JiVrH${J!g+)K&Ey!P6Ztn z(OZq)Wi#UEn1|F_|5R~IO$rgik?5St-R74%rfAGQqF$)xh4x3wE;CdS39= z->9;O9XKKQ-}@&2T`K(F?mSuhxyk5RYi*ppRHVNmALG=q7j1gZhj;SIm4lH3$7xy7 zGNxnMDiUzZ*kipjn)TekHJdzOyJdlAG3srCVn?~v@qSGM29*CH2)vVWSYvH$6#EOP zXuG$S`e%uQ)jQA`tcxB(T4c5P1PuZuX&bZDE4`fW*#dO$Q%gw%SF2`u%RB+C5N zlpa`b`=fRsts1##x=@ii>rgv!ezom_98WZso>$j%v#THgCL)&%)OPI|^e)s4;MPe# zenzqzTm)GInwr~dGR)ugp|2Je;~xyz9in1_e3M$SM8=J{TvS$#ww8_u8g(=hho2v& z4%i8HB7~D4&BKt8OG-=RcrtxW+maFoIP&dI75|Vb-)CC7e*1KCzxNz+ixJ#?-p&x2 zVRE0_4v;m_GkeEfLM^yGCRES$U+at5cT2x6Rjrb}?__Uv%sQP#*jFxXa}dJ8p{RqV zeTa~`CDeV%nF5_QpVUDtoDOc;WZBw2>3-ogWJ8h?yb8N5CI(zKl+doo8KdNllk8Gy zL@n)`x+0`y;eG4*iGYJ#GSt@f_QRqDFEVLs?XauZGs2Sis`HJ`_!c2zH|{FVtay@O z!F#N;=j!3l)@jSIBhc}p#e0w6=Qmuii@yipmbGOTPTiw?<-ClZ|z#ENU+h@rHqAM@RMO zyCiioY4J^v+Usbzk$^Wm|cA+!#3 z1v4&U{VN80x;~C62`)w%77cq|>vefz9*@yyDS_u#H!(g=Ex@tQ9FXbhDC(R!KCxS7 z75xw|Ng5*NLkg6YcV+4h{MCpe5fU9 z?%bBwx5T8j-98xs%aQ%x+YJ3DXz}kBzm%GYR=@2b((N^6x}njUXxNejg++{`;@s26 z33$1yhV-I|q(nEjyXpq^$ld))>Vq-f5=Z+dLLB^IvA^9A1?&V$H@I|v0Wlv(!g*W5 zrt-Xf+#2V<#NpdNwb1$qPhYSP{AtFQE6YxZh{zT@f&%gGr2fS0D*S^Az$`&5i0x*C z-q|kR$LGz43mB!sf?kV3Q6Uvcw|;pjg22!V7xFqcuaCHJK?#Rb)XrVKir4Sqj{E?_ z?cugA!|QPmUDgNF^e~Usfx?6Zb?{@D0t)r;0H7#(pgL2jWRdC@N0_ENheY(`yfmAk zgm|D~A1Xp`2g$QKX5&O@=}5m^z&pl$Msk-^6Wr=OY793Q;?d+(@_yvlj#AJ928@?! z{wpTuBNW4msJ#cB{1CE=V%V8RB>g0N%1{Zr;Hv%oCTse_8QR1hpggSUs49JraoRfI zAw1u}D~*`@)RGlWAsT8J)@5nWhUYtNrWDE`cABS=1-16%+Dn{!$mwzpYXxIe?VUAC z1p+MOcrUSuDMC#T8q(}fq&!FZv6v2gkMRBiLe*Sat;e|Ef8niAp0ZDzM#q~hew!RLDOjjF7Cp`AS}PQ`N+@yumf`J~CYwq- zoEaDk6#YVA5xixVlQQ|xCqJ|0=96lZInm4U1n>ST<^J`o0ZX0*BTSv8scwN=a66Mn0Ktt<=hr9zi9j|&#xs|{qg+q)1%tdG=cJzSmYo@7I&0W?b0kyZ`LWzV{(WbeiE*^s^fXInR$2}Z?wza>JR~k4pBn@2DpIvl;_e3sClhPERa3su za~tZGR+Zdl+P~LAIOM;%W{Hgv1{vY(RPB6X*5-5_7HZ+Np%oVePO zsvkc%P8v>SpalF`5HB4_7lfND?)twRe;?%S=oh2xbZNR?Q`*k%hja9QojBoASDPPz@SP}~RU!3;hkJ&>&4lty;&TR`; zqiB*2k6V$j4x$T%e%sL=1uvC;jp%zgD;He7Bc@ztT{m=;X3Zy{u`##ui&cP={w z`{M1Cppu&lS-(C~r5ASY&cidms4UkX$6#JbwEfES$Uso%hOHc{aoM`ybB_2=YS0up zgEbQ4#p9y?WJ7PV#ji>SJ;V4?Oo^Bo&gRYR0!<~UCmMjNa>j#6;ZOs0vOd*}PoCq8 z&${2(#V86zyS4CaQu(%o413vlogzM-B~m+mpvC?m2=FYUNzQ%GAx#d}2`Mf(R$cRp zn}0vju7$wbXc9b`9)KxeM4WcQDdXrKI2mbHfZm-@eGCDajA+4d=l=$vM+Y6+1b)LYle;UqNq^dVQ`AY|ol%D$0|;a&EMUBD|F9vfxw8 zJO9|YlK?X>$9nzlrtWC~75tv}(9pm4~lxt`r#L)Oi4k)!$ia=WdBF8)Yj z0Ng*7G3+|*nlUdp9Di}XPUO}=yd+%%;t#SjA7gasoO5*l6+`}&1OAH#_;0DhN1AZ1 zt5?(n6LT{VzqvF%M<4pAz492BbjKGl&(NR251ml)SfWqEHw;9I+hX1bJStgOY@Hr@96^USUi2TM>W&vl4=l`tl^ikf%f|6S?_E;M2h6v4rO7w8h;NJB3 z*;J1ga#gzw%h&(fm$T|1`h|yY_7a@7XQb?}NgPsSQE;SXS&ntbFs;^&0agE%YdzF_ zJqhFNrO^@3-tt5s<`M?skB(eFcV?UVCMvaDEusGW%nVW-!5 zNkL{925~q?W!q1;tpA0iKOmv9Had+vWAY-q+l7)2U5E7dGU#H0`cW2+tWncYj~ z{w}S$)ggf;nvus()8)}8Fr!W1XxWG^d`-~3Xqj2ppGcl>x!kEe$cBr{1gp7hp-mv0 z8kjwfqm{B#Q~hijThaL7MQ<{3E!jLzX8CIFQxsjc= z8Pf8~`{A52g!p@GcnbWSv6Ct zTG-~C0X+Bg(6QMSZhL`X*Lbn|AMh84Q2bwj@Su~m@m(Wd(X$H%KJ;He=Gr|OBRDY` z&K3YzNIE9dg$}RY#cxC=eF7$%8!TlKj%NkskGd5Z&@ROfCfxPk?9!InbestKNUt1i+Bi!5p?U!94QU1R-3lZi%huhf+Qbvj!9+gkshK0GqmrWM+b z!~01nkWTS>{N|AiD}F7?!>u{AjcbOMc%Fwv3ZH=Uz+Q`DE9K^@Le!x_vRN|DwO%!j zkF+=b){A!$6eBhsz-~aED4i(vkl3AW+WdFiL#eSRkA8jXI(WoY&N8_6)QC2a<84cR zofjV(dVp#Wjs3Ok@OapUT;E1iF^;-`e*%gtO&p($ptA#D&te_tzW?WWhn%U9?W|iP zjDD|i)ORr3GrbZG`%#FUI3F>e;WpWJOdJZBg|I0wJ1J^LTn5g*yrG`<&*Gl7D~FJF z^08f>Z9FXnIr4f%%C=oAy7dT$I2%kqO?^j3i>#!UpCXhPS9Y~DNP>T_o}a#E;6FuV zE&EByan*$cp$zFc>2YynnH6Ax<&8d5U!IFJ4Z!ofU8lvJ-Flc83fB_qBj4zvI(KHJ zqbD?v=Xw>7E(pIjia2K$XuuQAyx#>V^;GCwFsj9)e=bKZ`>S~*2EPUw= z(IuBOv!>U9YaYUB1RBqr;Qoz@QDumZ&GGBpZbH85>}Qj6eB@f$yMb-A_>=KG^V(jq zJ6WS*6Q4~qPEVc~Z3-&kH5R^|AJui)YJ#&$^FD`UVrlYNP zNveK@ondy|ja#}%xL~y$9HwUn zxB`;1ygtTM72Z7#-};+H#!r`D#A`b@4>dHATUy9;)qZh;st(ZNsw;}d3o&Kp&<|9X zeQ+L5UU#>ahdkur->%>{ghC2#In|k2EeY?}v?|jfj?JpgJIya;Xgc+TY1rz79GvR= zv_^H~1IX3g7Xp@Ua$seXPE6jxbx9IN_@gNC+_bF5GEdn{XQH&&^&? z>eHOtU+66Zp3;$=3RFV_tj)@1v5Cg;ET2F(+O6SD+890oB6nVIv6?g$?@~#1tuLx> zM@4xNc*e4y4*Fd6<0iw%#<8rbMA&ifs?9+6+d);=>NFCALWK(s;s#yiQ#%liQ5&=_V%`Wg)0;L)n2-n2xCbFM~0@dJA;fo%4LDL*6`6*><+~WR7&m zH#)X!*yactjDv<}X)4Ez2F!y2e*|ebj?2+wx2?~*y?rJ`3kcd6ZCX`3xq{YLzH~V> z9Ohesi0mt_To&T}-M*SD#R$IDr0<8F(@Gmcr&CD7iRFJOF?Kwp?jU_U{U7IpuE;)o zWmb@yif8x;6bmeK8_3D4AfE-M^TCEExl__j<0TCyQw?b;@c<>VF(~36GWw@TgV%4| zFxc6)_|EqqP?rxI>;Yl$m(tT=G*%Fh=2K=6%zBP<9UjX}m(c#HSahvnU}EUj*I+xo zo!|{{9yLD?8&G9Kvlh8`MN4~N$>v0OE-%kcrW;FsMjPO5P`x?+;LKHUjsR`~OAUa-Oq(dDQ1 zmD~+=Aw)m1`z7whQMK0iZ>ih6e9CwG zNH{WK)7quoc48MP!O_oQrpfMBPwep!AsJj#WyD5g_r-xa)0!MFg}~*!4uMOY6*d1g zBsVAl%^3SVKq2m-E-*Ql;VLEPmzO4qJ;e`}DbI#{hB?y<*qBLj{DUa)d;wD~jcju0 zEme+$PBeu?L_FdKo+!(uh*ln)-8!??f1N0yee}K9LkNH2XbnQ7 zQyhOH4#dn$Os$H+hE;e>@TGv>t!;_*e!G4v(fI|7Z?`pF^u9FyVu3_YZ^Uf0t|pDu;%p_Lj)=&<-VSHTyH&5eNt(MC#DW3aR=mJ&%R9fNlBHT#oTNEk~_%Ix%F)- zbEKY8`ld;{fzy_m2tv;KB-ZTfR943V<@;w!mu=#^`kkRfi-ggBZH&BTy)droF76P) z2`CjayW*dC003(Rzu;P++jLF@(~Uks;j^A!n&;*K|XR0gUCK99KkPdvj`4qjbWA8!RbEJG@LjP+x594%^ ziM{)a-Qmu`gX!V1L9#+fQSV>CNm-7%Yc$BEgW)0#8um89C_SY3Xk(;CCW{+a5u6w{ zMUPKIiXbh>7A-zJuzmmA{?)cj&MbCOZDEHP$ zx&8(}^a5R2-q$dT+pT{^p7)Iz-FaPOq*at@|5J7F&r+JBVkhx+cL=yXlK1#ElL=JinKFbx#rf7ckP0 zv0owrDVTLFn~Ia%zbGq(phRDCPLu0db`SccT*Ch_akIO|XG`eB2Wd7k%J@64W$s^f zz?T04rcju#x1<}pg{@4Z4&Q~T*w;zN%o8ebM9} z+2q?CSRdV0!E!|UMvtq*jSUnP6>lt2vd*40__J`V+OeGO+%33@lPKLN4cWE*TJ0dV zM&g3RM`JS-5TRUMkle6N-XQWM0Hx0co`+GDMd;GkrB024`oGEdlT}^PjvY@U=R8f! zvq6&96{0xyqyaZTJw{h%Q{b$a*=5{1z`q1=*h zNKp^KT6IV%6$iw+;G@+-pVT35bIv%5&&dyI3_bTM&QBKPmmT=;@*7b%BiRf4&-do! zW~ftb)0pPBda`eb6g(eIn#Asq1GUe5ukvKhyzB*+0y+fmTTe^Zd@`;@zL#x|C17hkQsHWTPhXCPNnRXEjy1#9m6hlG$FP8xZ-k?LAiLNrd?R^Tjx$)r1ap z#HlEl7S&;8%WLA9M_{nznyOQ%2V=H>M1xuJ^=zim+p-sgeji+1IvoH674dLiXcN#cCrk(D$GkG3fXp7fac7G?*=%f|;z(1qj` z(bsuBChJ#pa10U@T`i?HY=l$^wGubav-V~^aCeZEvwF(_#hi!3iPf8>;34d^o9?}Kj+Z>UY}gFy8In`uk46GCIS>w%+3Ko zNFLzc$eF7~pHhHcU%v}pI3c7!F8E>mh2xn_9MKe}TNIS}hR{t2A2r89wi=Br_0-XG z2+5osat_n4ac=8tO-xrCF=o~a<>u>B#E3nmNgjZc1O73h6hQj8@V{g`|G>@Q#vfjO z@AWHgT*9HHXhLg-a4f|^-m%*mK1puLM`kW(sArFKfbh23nSv5YKTxKE=R+TCXM-mE zaD8}s>IOlM#{`Lo`yHv=>viZ8Dx@q|IZ(@r8VFx>7B=Y2v@4JKO^5>w6E9)05;q;J zUZ7*AGendGtD1thZ@iN zQ*>}Q#DPrf)u4!?70o?AGgA4L;t;O=9v{*`xAAY`V2tr3e0u~MZZ^9>uukC9NF7Ph zT*}+%@-p?M)+Dk)d1+ANb16=z@%7IG2^+U zNf#Iy%}?3^W$)rq`9qOWuX>>csG&|w??R%#tWU6hG+lKW$hhn%2{8x5hvmXMg~vCdZ|{GV8I)$135g5YNc5RsHDfO11S;M2v%M{oWK!oGXFO1pQvl6PdT`ec^;ItM7UaRj6UfwGXa@Iuxz> ztAbNuKtON}wd=~uoj0>cZMR2*Rr^MMkc;+V+}!sBu}eu47s9Nom(97yS1?0yyD^x- z6qTS+99kfYd{^!gB3HS5`c|cM63HUxwdJSCp}ApgxAYN*$%%Co5v3N18 zF}zrO1Mcd4!CZu3SE*5i|__w*o51$k_n7&J=_E$edYYv_v@s&XuF>Iy;3 z9O@t_mYAo-u=w7hQ}>@8s0TRZ*!V8RTPg-Ofg)m-t;W8H#QlcF`@7^0p-tLm(>e+ zb?obsjwWzBw`Us~Nq2vwcEY{)Ldyik?hXfGi?5=iykOD61^di9F3PV4EZiu{-G5x& zteQ4c&o16;P+M|ZAVW&npxh~#_lhtMNVIF!pjXr5c8*TiHOyiAP;FnAD&$h{z~trJ zOO=l9cg(#RHAciitMSPNSpj!i1sDs;Bi&YQkwr{E^A`9ED97|mA3!P$CUL07kX&|m z@1U@?lf*00nUxe~Z~erZgtbFVVmvM!OXu^HwJ)mWAETU})arR-GU)wQ4^57(AiY#N zrRJf;{(qnxuv8;W7~#KAj{hig{?t!%bIYuc`wvU_B2hysIyR&M&MiSI9Y_`T z*d}2k&6qiBz9)&lw*ocfZ3My$7~`Y07LJ$J?vae?-7>$Ju}OZ6e-vcug@Z&}wXLR< zg;2fyfia{_dPXGlY+8PpyDp)YH1HRb7cIxZc=AJRuq#BVo=|O_5}C1faZ_i_5l3S< zB=eSuzU~;T9#C^+hhPgitYNyVPpSE=Iu)by!Zflr7(3er0*!GTilhU@c zg^p;eaSe4Q2fI?PRQ~uC#XP&?R!{$0pfA%Rrja$C(dj_wp{`mbL@VHJ3uwijG& znT`H&24*_>h*uILN~|uMRNCfR9;#F=^+jpT`qUZJ`Fqh^Ort0n7H9SH#2%tj7)yr=^{UOo`uTQ+vaykh7(+5eF#`)7Snnq7*SytiD8iO-_1|09zB zw+p!}A6fdb=%7=7;!snPw{ntaeYyg)YOaIZDZl1H9*st;?{SL943)j4mQH*1^$2;H zxD|q<82c6J$V%Ao)vL#{Oo>3sk4~swu2*~?)K}?9{Ng-u<2EoQpoYx`0CfV(W;_qV*g|j|y>R-heMH9y>=Hb5uWBeqolXTa{a_por zYPrGPg5468cT**w=XxnYIag5hkc#gQUf0`vYJJ`?$bowsW-d(AQ2kq{gJ|sy$LvD_ zvv?{4gVj*hDG(9!3~|Vjb$GJ0`t8!_mHY{(-|An0{Ul9RttYSJ6-H#b^b7wq6=AaX`n?(#fw=@GD<$;7#rgiG*8pHrWnv>u|d5$+i!+b@(}luu=z10HI+4T>VR* z{8XBo{6vUXwJI%yn0wx{;oP6O_H$Dlzy%nFScXFC)8CBRPKgRjeA|8jBmDZQLdx3Z zSp9eW_)h{HVESr%GA)9ubcNv)dyU-~buhW1PsN5rESh;ny>l^a0g*k9P*5&LoO?Oj zwg}xR_&BGxTDpFO$c)lmo@22Q#^JCtPOayL9jUnNtxfg3k|*(_ z2~XOoieI-;DilH}tbu7dm0psb4(WCEC5as_CLS;zWRsc$0o6?Cce;w~H1wjJxpiwX z%{dYsZrF1R#7RDqGXD!&R(2@f$P2*bJLmHwLP}s z7Pa5w9xXeVHqxkX=>C_y69I@x+qNpQz=mqE}X`q!sL6Q zOjm!T9{NNL%qPWmcW$|{^xDOH?f)=XfOQE7<=?5W7E2LarbB z?5M^<+q{d8UsX}q{Bn-QQRbx!UjP$l0~HDR>rw^5k*i`^=a1*Vxu=+u9Q}wh;r0|{ zr`dP<9tlzucr0^%Ai$huj zZZdSG@JB+o2i$B7Mp&)a5!3?`F%<&>qLnoG(V3p|Vv7f3|HmYj4C2OW*Y@3dW1aMkQuE>YA-Yn~ zr8vX3L=f*quWkOzJZI#PvuG8cBRX2n#&lh5X&1(>)6x4A=rJcrT1=Wqcm&)?*d9?! zG1JVwqbO0~He$EQNclku!44aWhnF%KSmqAG7Z%|X{$e-(5qAu2*SMXKhm9^fC>Xa3rj%#*b{K z0H)zpxkEdvf6PSl2jc+j0s4MHo?O(>dL>douS!&? z=JDmfw45PD%eYkI0wrl4$B}vIu>2m9ah-WRcFUrw9aZ|tg{V%Ede3>wPR&UpgIOtM zZKFiuejh=1Uk#ux`)B}jpmOH2u3E6<_N) z<+RvGuF1V55VzpaY=ha+3pk%^8gqo2$1A6{C)^g?t8o5Y1Olh^LQx;Alic%7B7eDN zQ(urW7)qm`-QP*qla<(N<@_Ah#fN3UP{-6ZUjW)8x`JZcF|;c75|=ZphT7S4FCt>-?H`NSY`A!qNp# zAIaq1z-ir@9TIKbKr;%cFR_)BG&l#UuNf<~pQ6~`jij5stF7d%d`wr3J}5NQi7A+uRHsyUAFIWeSQZr;FccWp*Q-+r^@%>OGP{^I!|m`3ArN32AV9A`?ymyT7TAS z;i_z~cqzt7es2+T8f*yNtoInc0g-%$CQY8Yzmu|r@X!4T5Sqo>6Vu+nbOZiVi~JAC zj>hGIl9=e+O{qa2ZP6(@5x&zpL)LKm7_OvABAcOWS7 zcurE=k9O8UZ&~@;&#s^D|0wOcquKuZeXJraRa>npYE&pcqh^bmAqcfqjnGtLRurYE zQMJ$*_$JiZo~gk&Qqrd?pt zav|WrnbkryANsCCJYCa<_8&>ITDghvd$%r~yF|HF>!Ey%!D1vN*@{>Jf49XFY*7H< z=h3Lx)mHTw8ryiq2xNFCFvm?X-OV$EpY0P68o$*O(ZJQ3)@9xIRdDkJsrt%THMX6U z8tUbY$Q|u|Q)>dE%f7*o-|Ov)Zl`dzlp_XIO%qKm&Zh%0kiu%ud%pdA5>K;?nu_?s z^Q5usfiao=Q}3~d$*P8jfH-ivF2nsw&BrxUz`f7zqYBf3Z>ixQme#*3!ud8^ym#97 zc7lDNQ6)7USpSFF8**O20ZAAAQE+Ng?p!l=a07IjGwRcOM0j}G({|J^fFbDoQI_0K zwT?*ns@s;_DER2e83mExWNn9QPDL3!=B=xKVM}LE6K{yX&a4zJh-kkZoNK#Z!kZB} zh`ld3e}&JsQ5snG8zHn8?Q0kEduUuIyRw7i%}ZC}m%j*Dz0_8aP(QD{A&z*S^=$ca zu}yT%Igt)hj8}lAh^-U$)j@;zIycZcQ(7r({I_|dCow3~I719aO zF?w3x^aq>pyOCMSyM}70w3ITLG!*LOS`=+Be4ck1OFC;cXC=tAqoezidL!2x{M~t$ zC?3Ka*d&RMAN}6r7d{PPOucqr^Dv|$62oNu`+slTj*Nk?JXRYOgjEf-Je)oOyD%Gw z@XC5j6E72aVPeXvln8li=oVh)@d??{^`O)z2i3Eg)qmiVKQWicS-U>i;v@vcoPx_H ze}-LF)#P+Qe^=E^$&*69I`{8oUX?Gm$hMNzV#fnxcMv)5V@^(<+wU*q6y8716llyZ z%~mx@Ol{CD!(NQ}KxAFJQBl@X)@h&wXJzi%sYkc1Mi+mC*zyXQND-%vNkNygue9a2se8WDPke(9#u?N>fJumMa1jE=Ir!vIsP?@=NEn4qWYu-V26F;r%elm*QJE)%jjcwyqru2m0 zS+L~L>hR`lUmf2zZ9uqD=X204xO)4>V^BP&FmT55xK2sO(oC!`(5=MNrg(k z0A~3b>&TC#Te2@G;+{P=KVhJ-_i)QprEN^0>(zO80kB-NZd4fUJ z!Ucf4hB2K1IUjYX+x~ib*8ROeY<-O&;ad42+B|e8&$mCp1664x&{WJ;+|Qa6+#$=2 zmwY%>s7k(Bj@E->Qu?KOAG>J$y^r=!3wrF)pT@LUEp&$=n)DGyNJwk_CPu>7;wzm4 zS&$Y4^`?IHB`nXVun(6xbgx(3F%gA;Hilcd@u;mae3x0|JMcDd3o)VJO`*v2;?jco z$E>Ll^TfH@njO#Cs?nPX%&nSLGD01Zl%~pHQR)10Z8i9FGsR1%iZ6r!KO|GtC2I#Y zrVOIn^xu09Dj~I2{6t3)drXjXPYg*joOZXyCEw9j;%?8GcUp`jTo{i_*-| zgbQu+aHlHc39?I-Uq40ZW1uN!$pUWhvI1xiZN`iT+@e*}@_9%0HnSjH-zKA$>uQ=R zRm1DNdRyl#sURaWxE6i-;E0KLu*Rru-^JAjok5pLAieL*svajt6xlB`t-h9-+~q90 zfp~jbHJYv`7lD2A#BoB%G0IBFdim^#>OEd(B=g{XwAT6UpGvYcO9hNp3-4ojk?&G#S+*C zL~@C>&AMe0_e?|alFl{>P7dNRXe-+zuQpq_H;sXCk4t)t9I4-;2GN4nQ&jb4xkhJo;r^F<# zJ1Y-f4ar^)Z3qcRK3}x!Vz~F^`8jwY$?Sgl4{Nn4xt)W%b$CrCJa&!8spc-lhHRYFxIaCZtXZW#{HvSn*-@i`n+x{-8~0N99&ub7?9#wJ7XoL zcoZ>U+FUo9Zz+cJ1!6z&`0Mdj%aT1ryH)&@63S~ED(o*Ex}bN0>a-&oDTqnQVd9{# z#*=GA;4D1LDHN|W6D2L<wL-`dybXoDd9*jGtDEcJ#5q|q77UZJ_AAweTR?F6?HzA8hh2; zm$3c-j{LwqsjAAWiAn=WdhQbELQr=u5F1%E6*c~H)srFyosyj;aV_%J-P=@lLaOx)jQDP}EuH*f*b~(A z%Gm!j=|+{r72IB3bXmM@Ftb{a`G_KL*(LShYK~ZXECeLM@`EMRg148EDNgDM@U~A` z82$-_bTS@&n<(R5@A)3d=2~Q2N6F7UL1luV@}S_#1}a4PBex8Y*}p+rR8pq&xk)b{ zZb}DU@?G~{?P8ckc|djL)$5t7IOi>~ERVq!qlZq%ZR2}S@9-2UXgD~Itlyv&+?~~%bf~#fS$e^)KF*6MXe>V`D%jh&je?bz<1A@AJ-~ z@KcV)rQPi;%wRfxIb;kT+jVOlDQk6Cc~RDSRJ>5i4_5w-oS3w)fOZ6_N2Xl}+QyOh zysFWM0r__nIj-it4~DU7NpTQ(t=NGCfBU&Rqf&!lO+~W&G<&+Hx0b&RXG$N;r_NeQc`szqW&(UTA$He!sQ=j z8bWxNNEn9Rhq5B5J?9r!?Drkni#=LHs=j-B^okC*UE{M$J7;J%Mv)UghhxlJ#cPsVrg$m`3{ zn`SEBwwBQv#aPXV&Tqpm+#(^5?+37>-wYZNvAg zjiG~;m)DoDOEKz_nhLMxgPe!OL+o5UO!iM4`#-yl1{MF|jdKZ=!UrDxZkO+c|pV&Uh`T$rV6KB0~%w1hnl>Sy=Gvf7oInz z3--RVs}&+XeAmJzUnj}>c%RP-bN~s7<)P4H-3>l`@4zn

@F*Eyla3FNGkD>-QC0 z8*VerCdm!!H`IO3DV`b|^nds)`+Aq*z9uTX+m*%dsnR{Vc9VLcG0rhcpqFdjGU|{A z3ov=C5xx$?ev=jh5R3*e_~T%47cUK9J!dKW%*KhG^n*($<2)}YT}{^0&=LJZ%>kv1 zo%T;BUo+k*!2AOE1QskF z@4z+DwLB*s#mdOgT<%5Kh*x3O`%Bw&?8N}vYugIXT3|%W`5+|3%$@3{%jy^+lwQoO zDwt}+)MT0jPrca_^uS^F!t&+4w_V=jpa5*|Ug``uR}yZKdTsM6_26vUOHzDXPY0!T zvQc#?#};mW+|3|lm3YEB2~@1P8?~vtZqK?^<>riuGTeYHI4GAFcs!d4FPjt$ey-Y2 zbtq^HVN?O@y&H@p<^{vIcee1lL}xqBLSx;jvp*KYn##_`1vF0w2-OK~;0wiqww|4I zN7yLr^Dc+zxtQ`CUB~R$^*y0?F^zL=%r&b`!c`dj0?4JYPRW{H(4a!T-+E*Tr29sv zT^h+FY4l{Q#!~90fvH?mF2n$y5LrX=u-_ zM9b`W%^X9t`gHec&G`M2z?x%#?s3>XEBT>ph&$iv3em-9ji-E~*E# z;2Exq@8}$;8(PWyv zQ0#2Wpm4j@St}<5e;=sGD54KSW?24qI2<;e#H)3uGfkj0Tkr1iW@SmbD>oT>=7Z@> z-FVH^&P{+LVS-M+0^6zscJCqwdt4(C& zM0S6iPg75Vu;?=q3O&Ph)Nc&1D~%d*OuNFILo(Qv7p~fCcnRIQdxW>+88Nd%Op-$b z-Ak0Irz@yVrZy?0IOQe%2ky9!O(UK1JGpmCDtrxl6$y4557g;Jv*KSgAwz{eg1fE7 zzM!U>aj`O5m~@(u5GllJjBAUyQF2~;gb|KpVv3)K%S&7&M_^dyk877T4wVM2X7o=f z$Il?eSpHs^m9Bb>{{RYQ@-;{l3+QJQIe8rt0F3zQ1x&P@kE+`hlj{Y82$LK@0e>wN zTV))YoGWoK*?Z;Ij|hd_QF54CM({}mKE>L7j}|Zf@n`SGM@~(%fjCPZo|j#gnG{ms zX2jq2&mS9_SW5JZW@uY;Qxxr344oT;8wGT3;}KfrM`gp2=G9Za^xMeyW(!lErkiDL zWXAM@a6cl=F6Cf1a)v&dCNLDjl~T0rDxuY8kgF8s{McVF&yj<~_qF3E)gKDYBzUrG znWk}|jgl_*`ENmJZQxA2ofB+#Csrjm13L=>--dz?2$v?}#Y{pOV`aWEH3|9!7Vr{xKR8Mv$AqNs4eA1`Osc}WEd0PGqffa76^41GX z$UBsUcJ5I70~9oz;l3*UzMNC`0kx$KE?t_q?C=zKlkU+9IXyW-aIdwmFz!gtb_v=j zDf*1nSOS3Jk - -]> - - - - - - - - - -;;Default extension for filenames -(define %html-ext% ".html") -;;What font would you like for the body? -(define %body-font-family% - "Arial") - -(element emphasis -(if (equal? (normalize "bold") (attribute-string (normalize "role"))) - ($bold-seq$) - ($italic-seq$))) - -(element tgroup - (let* ((wrapper (parent (current-node))) - (frameattr (attribute-string (normalize "frame") wrapper)) - (pgwide (attribute-string (normalize "pgwide") wrapper)) - (footnotes (select-elements (descendants (current-node)) - (normalize "footnote"))) - (border (if (equal? frameattr (normalize "none")) - '(("BORDER" "0")) - '(("BORDER" "1")))) - (bgcolor '(("BGCOLOR" "#E0E0E0"))) - (width (if (equal? pgwide "1") - (list (list "WIDTH" ($table-width$))) - '())) - (head (select-elements (children (current-node)) (normalize "thead"))) - (body (select-elements (children (current-node)) (normalize "tbody"))) - (feet (select-elements (children (current-node)) (normalize "tfoot")))) - (make element gi: "TABLE" - attributes: (append - border - width - bgcolor - '(("CELLSPACING" "0")) - '(("CELLPADDING" "4")) - (if %cals-table-class% - (list (list "CLASS" %cals-table-class%)) - '())) - (process-node-list head) - (process-node-list body) - (process-node-list feet) - (make-table-endnotes)))) - - -;;Should verbatim items be 'shaded' with a table? -(define %shade-verbatim% - #t) - -;;Define shade-verbatim attributes -(define ($shade-verbatim-attr$) - (list - (list "BORDER" "0") - (list "BGCOLOR" "#E0E0E0") - (list "WIDTH" ($table-width$)))) - -;;Index -(define (generate-index) - ("1")) - -;;======================== -;;Title Pages for Books -;;======================= - -(define (book-titlepage-recto-elements) - (list (normalize "title") - (normalize "subtitle") - (normalize "authorgroup") - (normalize "author") - (normalize "date") - (normalize "releaseinfo") - (normalize "orgname") - (normalize "graphic") - (normalize "copyright") - (normalize "legalnotice"))) - - - - - - - - - -;;Index -(define ($insert.xref.page.number$) - ("yes")) - -;;Index -(define ($generate-index$) - ("1")) - -;;Tex Backend off -(define tex-backend - #f) - -;;What elements should have a LOT? -(define ($generate-book-lot-list$) - (list (normalize "example") - (normalize "table") - (normalize "figure") - (normalize "equation"))) - -;;======================== -;;Title Pages for Books -;;======================= - -(define (book-titlepage-recto-elements) - (list (normalize "title") - (normalize "subtitle") - (normalize "authorgroup") - (normalize "author") - (normalize "date") - (normalize "orgname") - (normalize "graphic") - (normalize "copyright") - (normalize "legalnotice") - (normalize "releaseinfo"))) - -(define %show-ulinks% - ;; Display URLs after ULinks? - #t) - -(define %indent-screen-lines% - ;; Indent lines in a 'Screen'? - " ") - - - - - - - - diff --git a/doc/UsersGuide/clm_ug.xml b/doc/UsersGuide/clm_ug.xml deleted file mode 100644 index 68aa69b1d6..0000000000 --- a/doc/UsersGuide/clm_ug.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - build-namelist"> - configure"> - NCAR"> - CCSM"> - CCSM4.0"> - CESM"> - CESM1.0"> - CESM1.0.1"> - CESM1.0.2"> - CESM1.0.3"> - - PTCLM"> - PTCLM1"> - PTCLM1.110504"> - CLM"> - CLMCN"> - CLMSP"> - CLMU"> - CLM3.0"> - CLM3.5"> - CLM4"> - CLM4.0.00"> - - - - - - - - DATM"> - models/lnd/clm/doc/KnownBugs"> - NetCDF"> - FORTRAN"> - FORTRAN-90"> - MPI"> - PIO"> - OpenMP"> - NCL"> - Perl"> - XML"> - xmlchange"> - 2"> - - - - env_run.xml"> - env_build.xml"> - env_conf.xml"> - user_nl_clm"> - - - PTS_MODE"> - CSMDATA"> - CLM_FORCE_COLDSTART"> - CLM_CONFIG_OPTS"> - CLM_BLDNML_OPTS"> - CLM_NML_USE_CASE"> - CLM_NAMELIST_OPTS"> - CLM_PT1_NAME"> - CLM_QIAN"> - CPLHIST3HrWx"> - CLM_USRDAT_NAME"> - CLM_CO2_TYPE"> - DIN_LOC_ROOT"> - - - CLM_QIAN"> - - - - %ISOamsa; - ]]> - - - - %ISOgrk1; - ]]> - -]> - - - - -&cesm; Research Tools: &clmrel; User's Guide Documentation - - - CESM - CLM - community earth system model - climate - climate model - earth system model - land surface model - hydrology - biogeochemistry - urban model - documentation - - - - - - Erik - Kluzek - - NCAR - - - - - - - -The user's guide to &clmrel; which is the active land surface model component of &cesmrel;. -The purpose of this guide is to instruct both the novice and experienced user, as well as -&clm; developers in the use of &clm4; for land-surface climate modeling. - - - -$URL$ - -&build_date; - - - - - -Dedicated to the Land Model Working Group, winners of the 2008 &ccsm; Distinguished Achievement Award. -May you continue to collaborate together well, and continue to drive -the science of land surface modeling forward with your diligent and persistent efforts. - - - - -&preface; -&custom; -&tools; -&adding_files; -&special_cases; -&single_point; -&ptclmdoc; -&trouble; -&testing; -&appendix; - - diff --git a/doc/UsersGuide/co2_streams.txt b/doc/UsersGuide/co2_streams.txt deleted file mode 100644 index 4d38c6d06e..0000000000 --- a/doc/UsersGuide/co2_streams.txt +++ /dev/null @@ -1,50 +0,0 @@ - - - This is a streams file to pass historical CO2 from datm8 to the other - surface models. It reads in a historical dataset derived from data used - by CAM. The getco2_historical.ncl script in components/clm/tools/ncl_scripts - was used to convert the CAM file to a streams compatible format (adding domain - information and making CO2 have latitude/longitude even if only for a single - point. - - - - Input stream description file for historical CO2 reconstruction data - - 04 March 2010: Converted to form that can be used by datm8 by Erik Kluzek - 18 December 2009: Prepared by B. Eaton using data provided by - Jean-Francois Lamarque. All variables except f11 are directly from - PRE2005_MIDYR_CONC.DAT. Data from 1765 to 2007 with 2006/2007 just - a repeat of 2005. - - - CLMNCEP - - - - time time - lonc lon - latc lat - area area - mask mask - - - /fis/cgd/cseg/csm/inputdata/atm/datm7/CO2 - - - fco2_datm_1765-2007_c100614.nc - - - - - CO2 co2diag - - - /fis/cgd/cseg/csm/inputdata/atm/datm7/CO2 - - - fco2_datm_1765-2007_c100614.nc - - - - diff --git a/doc/UsersGuide/custom.xml b/doc/UsersGuide/custom.xml deleted file mode 100644 index d6a60a28f7..0000000000 --- a/doc/UsersGuide/custom.xml +++ /dev/null @@ -1,1615 +0,0 @@ - - - - - - - component set - compset - "I" compsets - "B" compsets - "E" compsets - "F" compsets - &CLMCONFIG; - &CLMNAMELIST; - &CLMFORCECOLD; - &CLMUSECASE; - &CLM1PT; - &CLMUSRDAT; - &CLMCO2; - - -How to customize the configuration for a case with &clm; - - -The -&cesm; User's Guide gives you the details on how to setup, &configure;, build, and run -a case. That is the document to give you the details on using the &cesm; scripts. The purpose -of this document is to give you the details when using &cesm; with &clm; on how to customize -and use advanced features in &clm;. You should be familiar with the &cesm; User's Guide and -how to setup cases with &cesmrel; before referring to this document. - - -In this chapter we deal with three different ways of customizing a case: Choosing a compset, -Customizing Configuration options, and customizing the &clm; Namelist. There are many different -compsets that use &clm; and many are setup to enable special features of &clm; from the start. So -the first thing you want to be familiar with are the different options in the compsets. The -next section shows the different options for customizing the configuration options for -&clm;. -Here we introduce the &clm; &configure; and &buildnml; scripts and how using the options in -&envconf; you can customize the configuration and the initial -namelist. The final section tells you about the &clm; namelist and how you can customize the -namelist once you have run "&configure; -case" and have an initial namelist in -BuildConf/clm.buildnml.csh. You can also -use &envconf; options to change your namelist as well, before "&configure; -case" is -run. - - - -Choosing a compset using &clm; - - -When setting up a new case one of the first choices to make is which "component -set" (or compset) to use. The -compset refers to which component models are used as well as specific settings for them. We label the different -types of compsets with a different letter of the alphabet from "A" (for all data model) to "X" (for all dead model). -The compsets of interest when working with &clm; are the "I" compsets (which contain -&clm; with a data atmosphere model -and a stub ocean, and stub sea-ice models), "E" and "F" compsets (which contain &clm; -with the active atmosphere model (CAM), -prescribed sea-ice model, and a data ocean model), and "B" compsets which have all active components. Below we -go into details on the "I" compsets which emphasize &clm; as the only active model, and just mention the two other categories. - - -When working with &clm; you usually want to start with a relevant "I" compset before moving to the more -complex cases that involve other active model components. The "I" compsets can exercise -&clm; in a way that -is similar to the coupled modes, but with much lower computational cost and faster turnaround times. - - -Compsets coupled to data atmosphere and stub ocean/sea-ice ("I" compsets) -&compsets_list; - - - - Compsets coupled to active atmosphere with data ocean - - CAM compsets are compsets that start with "E" or "F" in the name. They are - described more fully in the scripts documentation or the CAM documentation. "E" compsets have -a slab ocean model while "F" compsets have a data ocean model. - - - - -Fully coupled compsets with fully active ocean, sea-ice, and atmosphere - - Fully coupled compsets are compsets that start with "B" in the name. They are - described more fully in the scripts documentation. - - - - -Conclusion to choosing a compset - -We've introduced the basic type of compsets that use &clm; and given some further details -for the "standalone &clm;" (or "I" compsets). The - -config_compsets.xml lists all of the compsets and gives a full description -of each of them. In the next section we look into customizing the &configure; time options -for compsets using &clm;. - - - - - - - -Customizing the &clm; configuration - -The "Creating a Case" section of the -&cesm1; Scripts -User's-Guide -gives instructions on creating a case. What is of interest here is how to customize your -use of &clm; -for the case that you created. In this section we discuss how to customize your case before the first -step -- the "&configure; -case" step is done. In the next section we will discuss how to customize your -&clm; namelist after "&configure; -case" has already been done. - - -For &clm; when "&configure; -case" is called there are two steps that take place: - - -The &clm; "&configure;" script is called to setup the build-time -configuration for &clm; (more information on &configure; is given in -). -The &clm; "&buildnml;" script is called to generate the initial -run-time namelist for &clm; (more information on &buildnml; is given below in -. - - -When customizing your case at the &configure; step you are able to modify the process by effecting either one -or both of these steps. The &clm; "&configure;" and "&buildnml;" scripts are both available in the "models/lnd/clm/bld" -directory in the distribution. Both of these scripts have a "-help" option that is useful to examine to see what -types of options you can give either of them. - - -There are five different types of customization for the configuration that we will -discuss: &cesm1; &clm; configuration items, Configure time User Namelist, -other noteworthy &cesm; configuration items, the &clm; &configure; script options, and -the &clm; &buildnml; script options. - - -Information on all of the script, configuration, build and run items is found under -scripts/ccsm_utils/Case.template -in the -config_definition.xml - file. - - - -&clm; Script configuration items - -Below we list each of the &cesm; configuration items that are specific to &clm;. All -of these are available in your: &envconf; file. - - - - &CLMCONFIG; - &CLMBLDNML; - &CLMNAMELIST; - &CLMFORCECOLD; - &CLMUSECASE; - &CLM1PT; - &CLMUSRDAT; - &CLMCO2; - -For the precedence of the different options to &buildnml; see the section on -precedence below. - - -The first item &CLMCONFIG; has to do with customizing the &clm; configuration options for your case, the rest -all have to do with generating the initial namelist. - - - -&CLMCONFIG; - - -The option &CLMCONFIG; is all about passing command line arguments to the &clm; &configure; script. It is important -to note that some compsets, may already put a value into the &CLMCONFIG; variable. You can still add more -options to your &CLMCONFIG; but make sure you add to what is already there rather than replacing it. Hence, -we recommend using the "-append" option to the xmlchange script. In - -below we will go into more details on options that can be customized in the &clm; "&configure;" script. It's -also important to note that the &clm; template may already invoke certain &clm; &configure; options and as such those -command line options are NOT going to be available to change at this step (nor would you want to change them). -The options to &configure; are given with the "-help" option which is given in -. - - - - - -&CLMUSECASE; - - -&CLMUSECASE; is used to set a particular set of conditions that set multiple namelist items, all centering around -a particular usage of the model. -To list the valid options do the following: - - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -use_case list - - -The output of the above command is: - - -&usecases_list; - - - -See the section for the precedence of this -option relative to the others. - - - - - - -&CLMBLDNML; - - -The option &CLMBLDNML; is for passing options to the &clm; "&buildnml;" script. As with the "&configure;" -script the &clm; template may already invoke certain options and as such those options will NOT be available to be -set here. The best way to see what options can be sent to the "&buildnml;" script is to do - - -> cd models/lnd/clm/bld -> ./&buildnml; -help - - -Here is the output from the above. - - -./&buildnml_help; - - -The &clm; template already sets the resolution and mask as well as the &configure; file, -the start-type, the co2_ppmv, rtm_tstep, and rtm_res, and defines an input -namelist and namelist input file, and it normally sets either "-ignore_ic_year" or -"-ignore_ic_date". Also many -of the options are designed solely for &clm; stand-alone testing and hence should NOT -be used (any of the options starting -with a "datm_" or "drv_" prefix. Hence there are then only five different options that could be set: - - - --lnd_res --sim_year --rcp --clm_demand --verbose - - - -"-lnd_res" is used to run &clm; in fine-mesh mode at a higher resolution than the atmospheric model. This can -be useful to get higher resolution from the land model, but saving computer time -by running the more expensive atmospheric model at a lower resolution. -To get a list of valid resolutions to run at do the following: - - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -lnd_res list - - - -The fine-mesh mode is considered experimental, and you may run into problems when you use -it. Another option is to use the CESM level "tri-grid" capability to run the land model -on a different grid than the atmospheric model. Read the CESM User's-Guide to learn how -to do this. - - - - - -See the section for the precedence of this -option relative to the others. - - - - -"-clm_demand" asks the &buildnml; step to require that the list of variables -entered be set. Typically, this is used to require that optional filenames be used and ensure -they are set before continuing. For example, you may want to require that -flanduse_timeseries be set to get dynamically changing vegetation types. To do this -you would do the following. - -> ./xmlchange -file env_conf.xml -id &CLMBLDNML; -val "-clm_demand flanduse_timeseries" - -To see a list of valid variables that you could set do this: - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -clm_demand list - - - - -Using a 20th-Century transient compset or the 20thC_transient use-case -using &CLMUSECASE; would set this as well, but would also use -dynamic nitrogen and aerosol deposition files, so using -clm_demand would be a way -to get just dynamic vegetation types and NOT the other files as well. - - - -"-sim_year" is used to set the simulation year you want the data-sets to simulate conditions for in the input -datasets. The simulation "year" can also be a range of years in order to do simulations -with changes in the dataset values as the simulation progresses. To list the valid -options do the following: - - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -sim_year list - - -"-rcp" is used to set the representative concentration pathway for the future scenarios -you want the data-sets to simulate conditions for, in the input -datasets. To list the valid options do the following: - - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -rcp list - - - - - -&CLMNAMELIST; - - -The option &CLMNAMELIST; is for passing namelist items into the "clm_inparm" namelist. -Any items that are set in &CLMNAMELIST; will be set in your namelist after "&configure; --case" is done. - - - -For character namelist items you need to use "&apos;" as quotes for strings so that the -scripts don't get confused with other quotes they use. - - - -Example, you want to set hist_dov2xy to .false. -so that you get vector output to your history files. To do so edit -&envconf; and add a setting for hist_dov2xy. -So do the following: - -> ./xmlchange -file env_conf.xml -id &CLMNAMELIST; -val hist_dov2xy=.false. - - - -Example, you want to set hist_fincl1 to add the variable 'HK' -to your history files. To do so edit -&envconf; and add a setting for hist_fincl1. -So do the following: - -> ./xmlchange -file env_conf.xml -id &CLMNAMELIST; -val "hist_fincl1=&apos;HK&apos;" - -For a list of the history fields available see -&clm; History Fields. - - - -See the section for the precedence of this -option relative to the others. - - - - - - -&CLMCO2; - - -&CLMCO2; sets the type of input &CO2; for either "constant", "diagnostic" or prognostic". -If "constant" the value from CCSM_CO2_PPMV will be used. If "diagnostic" -or "prognostic" the values MUST be sent from the atmosphere model. For more information on how -to send &CO2; from the data atmosphere model see . - - - - - -&CLMFORCECOLD; - - -&CLMFORCECOLD; when set to on, requires that -your simulation do a cold start from arbitrary initial conditions. If this is NOT set, it -will use an initial condition file if it can find an appropriate one, and otherwise do a cold -start. &CLMFORCECOLD; is a good way to ensure that you are doing a cold -start if that is what you want to do. - - - - - -&CLM1PT; - - -&CLM1PT; is used ONLY for a pt1_pt1 -resolution simulation to set the name of the single-point files to use. -To see a list of the valid resolutions do this: - -> cd models/lnd/clm/doc -> ../bld/&buildnml; -res list - - - -The output of the above command is: - - -&res_list; - - -the valid resolutions that can be used with &CLM1PT; are the ones that -have city or nation names such as: 5x5_amazon, 1x1_vancouverCAN 1x1_mexicocityMEX, or -1x1_brazil. The "1x1_" prefix means the file is for a single-point, while "5x5_" prefix means -it's for a region of five points in latitude by five points in longitude. Both regional -and single point datasets can be used for &CLM1PT;. If you create your own datasets -you can also use &CLM1PT; along with &CLMUSRDAT; (documented below), setting &CLM1PT; to -the value in &CLMUSRDAT; so that your datasets are used rather than the standard ones.o - - - - - -&CLMUSRDAT; - - -&CLMUSRDAT; provides a way to enter your own datasets into the initial -namelist setup at "&configure; -case". The files you create must be named with -specific naming conventions outlined in: . -To see what the expected names of the files are, use the -queryDefaultNamelist.pl to see -what the names will need to be. For example if your &CLMUSRDAT; will -be "1x1_boulderCO", with a "navy" land-mask, constant simulation year range, for 1850, -the following will list what your filenames should be: - -> cd models/lnd/clm/bld -> queryDefaultNamelist.pl -usrname "1x1_boulderCO" -options \ -mask=navy,sim_year=1850,sim_year_range="constant" -csmdata $CSMDATA - -An example of using &CLMUSRDAT; for a simulation is given in -. - - - -See the section for the precedence of this -option relative to the others. - - - - - - - - - -Configure time User Namelist - -&CLMNAMELIST; as described above allows you to set any -extra namelist items you would like to appear in your namelist after first &configure;d. -However, it only allows you a single line to enter namelist items, and strings must -be quoted with &apos; which is a bit awkward. If you have a long list of namelist -items you want to set (such as a long list of history fields) a convenient way to do it -is to create a &usernlclm; that contains just the list of namelist -variables you want to add to your initial namelist. The &usernlclm; -will only be used when &configure; is run, so if you change it after &configure; -- it won't -change anything. The file needs to be in valid FORTRAN namelist format, and the &configure; -step will abort if there are syntax errors. It merely needs to be named correctly -&usernlclm; and placed in your case directory (where your other -env_*.xml files are). The namelist name actually doesn't have to be -valid, but all the variable names must be. Here's an example &usernlclm; -namelist that sets a bunch of history file related items, to create output history files -monthly, daily, every six and 1 hours. - -Example &usernlclm; namelist file - -&clmexp - hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', - 'FSR','FSA','FGEV','FSH','FGR','TSOI', - 'ERRSOI','BUILDHEAT','SABV','SABG', - 'FSDSVD','FSDSND','FSDSVI','FSDSNI', - 'FSRVD','FSRND','FSRVI','FSRNI', - 'TSA','FCTR','FCEV','QBOT','RH2M','H2OSOI', - 'H2OSNO','SOILLIQ','SOILICE', - 'TSA_U', 'TSA_R', - 'TREFMNAV_U', 'TREFMNAV_R', - 'TREFMXAV_U', 'TREFMXAV_R', - 'TG_U', 'TG_R', - 'RH2M_U', 'RH2M_R', - 'QRUNOFF_U', 'QRUNOFF_R', - 'SoilAlpha_U', - 'Qanth', 'SWup', 'LWup', 'URBAN_AC', 'URBAN_HEAT' - hist_fincl3 = 'TG:I', 'FSA:I', 'SWup:I', 'URBAN_AC:I', 'URBAN_HEAT:I', - 'TG_U:I', 'TG_R:I', - hist_fincl4 = 'TG', 'FSA', 'SWup', 'URBAN_AC', 'URBAN_HEAT' - hist_mfilt = 1, 30, 28, 24 - hist_nhtfrq = 0, -24, -6, -1 -/ - - - - -See the section for the precedence of this -option relative to the others. - - - - -In the above example we use an invalid namelist name &clmexp -- but it works anyway -because the &clm; &buildnml; knows the namelist that specific variable names belong to, and -it puts them there. - - -Obviously, all of this would be difficult to put in the &CLMNAMELIST; -variable, especially having to put &apos; around all the character strings. For -more information on the namelist variables being set here and what they mean, see -the section on &clm; namelists below, as well as the namelist definition that gives -details on each variable. - - - - -Precedence of Options - -Note: The precedence for setting the values of namelist variables with the -different env_conf options is (highest to lowest): - -Namelist values set by specific command-line options, like, -d, -sim_year -(i.e. &CLMBLDNML; env_conf variable) -Values set on the command-line using the -namelist option, -(i.e. &CLMNAMELIST; env_conf variable) -Values read from the file specified by -infile, -(i.e. &usernlclm; file) -Datasets from the -clm_usr_name option, -(i.e. &CLMUSRDAT; env_conf variable) -Values set from a use-case scenario, e.g., -use_case -(i.e. &CLMUSECASE;env_conf variable) -Values from the namelist defaults file. - -Thus a setting in &CLMBLDNML; will override a setting for the same thing given in -a use case with &CLMUSECASE;. Likewise, a setting in &CLMNAMELIST; will override a -setting in &usernlclm;. - - - - -Setting Your Initial Conditions File - -Especially with &clmcn; starting from initial conditions is very important. Even -with &clmsp; it takes many simulation years to get the model fully spunup. There -are a couple different ways to provide an initial condition file. - - - - - - - - -Your initial condition file MUST agree with the surface dataset you are using -to run the simulation. If the two files do NOT agree you will get a -run-time about a mis-match in PFT weights, or in the number of PFT's or -columns. To get around this you'll need to use -to interpolate your initial condition dataset. - - - - - -Doing a hybrid simulation to provide initial conditions - -The first option is to setup a hybrid simulation and give a -RUN_REFCASE and RUN_REFDATE to specify the -reference case simulation name to use. -When you setup most cases, at the standard resolutions of "f09" or "f19" it -will already do this for you. For example, if you run an "I2000CN" compset -at "f09_g16" resolution the following settings will already be done for you. - -./xmlchange -file env_conf.xml -id RUN_TYPE -val hybrid -./xmlchange -file env_conf.xml -id RUN_REFCASE -val I2000CN_f09_g16_c100503 -./xmlchange -file env_conf.xml -id RUN_REFDATE -val 0001-01-01 -./xmlchange -file env_conf.xml -id GET_REFCASE -val TRUE - -Setting the GET_REFCASE option to TRUE means it -will copy the files from the: -$DIN_LOC_ROOT/ccsm4_init/I2000CN_f09_g16_c100503/0001-01-01 -directory. Note, that the RUN_REFCASE and -RUN_REFDATE variables are expanded to get the directory name -above. If you do NOT set GET_REFCASE to TRUE then -you will need to have placed the file in your run directory yourself. In either -case, the file is expected to be named: -$RUN_REFCASE.clm2.r.$RUN_REFDATE-00000.nc with the variables -expanded of course. - - - - -Doing a branch simulation to provide initial conditions - -The setup for running a branch simulation is essentially the same as for a hybrid. -With the exception of setting RUN_TYPE to branch -rather than hybrid. A branch simulation runs the case essentially -as restarting from it's place before to exactly reproduce it. While a hybrid simulation -allows you to change namelist items, and use a different code base that may have -fewer fields on it than a full restart file. The GET_REFCASE works -similarily for a branch case as for a hybrid. - - - - -Providing a finidat file in your &usernlclm; file - -Setting up a branch or hybrid simulation requires the initial condition file -to follow a standard naming convention, and a standard input directory if you -use the GET_REFCASE option. If you want to name your file willy -nilly and place it anywhere, you can set it in your &usernlclm; file as in this -example. - -&clm_inparm - finidat = '/glade/home/$USER/myinitdata/clmi_I1850CN_f09_g16_0182-01-01.c120329.nc' -/ - -Note, if you provide an initial condition file -- you can NOT set &CLMFORCECOLD; to -TRUE. - - - - -Adding a finidat file to the XML database - -Like other datasets, if you want to use a given initial condition file to -be used for all (or most of) your cases you'll want to put it in the XML -database so it will be used by default. The initial condition files, are -resolution dependent, and dependent on the number of PFT's and other variables -such as GLC_NEC or if irrigation is on or off. -See for more information on this. - - - - - -Other noteworthy configuration items - -For running "I" cases there are several other noteworthy configuration items that -you may want to work with. Most of these involve settings for the &datm;, but one -CCSM_CO2_PPMV applies to all models. If you are running an B, E, -or F case that doesn't use the &datm; obviously the DATM_* settings will not be used. -All of the settings below are in your &envconf; file - - CCSM_CO2_PPMV - CCSM_VOC - DATM_MODE - DATM_PRESAERO - DATM_CLMNCEP_YR_ALIGN - DATM_CLMNCEP_YR_START - DATM_CLMNCEP_YR_END - DATM_CPL_CASE - DATM_CPL_YR_ALIGN - DATM_CPL_YR_START - DATM_CPL_YR_END - - - - - -CCSM_CO2_PPMV - -CCSM_CO2_PPMV sets the mixing ratio of &CO2; in -parts per million by volume for ALL &cesm; components to use. Note that most compsets -already set this value to something reasonable. Also note that some compsets may -tell the atmosphere model to override this value with either historic or ramped -values. If the CCSM_BGC variable is set to something other than "none" -the atmosphere model will determine &CO2;, and &clm; will listen -and use what the atmosphere sends it. On the &clm; side the namelist item -co2_type tells &clm; to use the value sent from the atmosphere rather than -a value set on it's own namelist. - - - - -CCSM_VOC - -CCSM_VOC enables passing of the Volatile Organic Compounds (VOC) from -&clm; to the atmospheric model. This of course is only important if the atmosphere -model is a fully active model that can use these fields in it's chemistry calculations. - - - - -DATM_MODE - -DATM_MODE sets the mode that the &datm; model should run in this determines -how data is handled as well as what the source of the data will be. Many of the modes -are setup specifically to be used for ocean and/or sea-ice modeling. The modes -that are designed for use by &clm; are: - -&CLMQIAN; -CLM1PT -&CPLHIST; - - - -&CLMQIAN; is for the standard mode of using global atmospheric data -that was developed by Qian et. al. for &clm; using NCEP data from 1948 to 2004. -See for more information on -the &datm; settings for &CLMQIAN; mode. -CLM1PT is for the special cases where we have single-point tower -data for particular sites. Right now we only have data for three urban locations: -MexicoCity Mexico, Vancouver Canada, and the urban-c alpha site. -See for more information on -the &datm; settings for CLM1PT mode. -&CPLHIST; is for running with atmospheric forcing from a previous &cesm; simulation. -See for more information on -the &datm; settings for &CPLHIST; mode. - - -There is a problem with running simulations for the CLM1PT mode -that are greater than one data cycle, where the atm forcing will be held constant. -This will result in useless -results as all atmosphere forcing fields will be held constant at the last value. -See bug 1377 in the &KnownBugs; file on how to fix this problem. - - - - - - - -DATM_PRESAERO - -DATM_PRESAERO sets the prescribed aerosol mode for the data atmosphere -model. The list of valid options include: - -clim_1850 = constant year 1850 conditions -clim_2000 = constant year 2000 conditions -trans_1850-2000 = transient 1850 to year 2000 conditions -rcp2.6 = transient conditions for the rcp=2.6 -W/m2 future -scenario -rcp4.5 = transient conditions for the rcp=4.5 -W/m2 future -scenario -rcp6.0 = transient conditions for the rcp=6.0 -W/m2 future -scenario -rcp8.5 = transient conditions for the rcp=8.5 -W/m2 future -scenario -pt1_pt1 = read in single-point or regional datasets - - - - - -DATM_CLMNCEP_YR_START - -DATM_CLMNCEP_YR_START sets the beginning year to cycle the atmospheric -data over for the &CLMQIAN; mode. - - - - -DATM_CLMNCEP_YR_END - -DATM_CLMNCEP_YR_END sets the ending year to cycle the atmospheric -data over for the &CLMQIAN; mode. - - - - -DATM_CLMNCEP_YR_ALIGN - -DATM_CLMNCEP_YR_START and DATM_CLMNCEP_YR_END determine -the range of years to cycle the atmospheric data over, and DATM_CLMNCEP_YR_ALIGN -determines which year in that range of years the simulation will start with. - - - - -DATM_CPL_CASE - -DATM_CPL_CASE sets the casename to use for the &CPLHIST; mode. - - - - -DATM_CPL_YR_START - -DATM_CPL_YR_START sets the beginning year to cycle the atmospheric -data over for the &CPLHIST; mode. - - - - -DATM_CPL_YR_END - -DATM_CPL_YR_END sets the ending year to cycle the atmospheric -data over for the &CPLHIST; mode. - - - - -DATM_CPL_YR_ALIGN - -DATM_CPL_YR_START and DATM_CPL_YR_END determine -the range of years to cycle the atmospheric data over, and DATM_CPL_YR_ALIGN -determines which year in that range of years the simulation will start with. - - - - - - - - -Downloading DATM Forcing Data - -In Chapter One of the -&cesm; User's Guide -there is a section on "Downloading input data". The normal process of setting up -cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve -data from the &cesm; subversion inputdata repository. However, the DATM forcing data -is unique -- because it is large compared to the rest of the input data (56 Gbytes). Most of the -data is stored in the directory set by the &envrun; variable -DIN_LOC_ROOT_CSMDATA. The &CLMQIAN; forcing data is in a (possibly) -separate directory using the &envrun; variable DIN_LOC_ROOT_CLMQIAN. -In most cases this directory will be in the directory: -atm/datm7/atm_forcing.datm7.Qian.T62.c080727 under -DIN_LOC_ROOT_CSMDATA. On bluefire there is a separate path for -the &CLMQIAN; forcing data. We have the full set of data available on a few of -the machines we use: bluefire, jaguarpf, and edinburgh. As of October, 18th, 2011 -we've uploaded the entire set of forcing data into the input data repository so -now it can be treated like other input datasets and the check_input_data script -can retreive it for you. Previously only two years of data was available. -You can also download the data from the -Earth System Grid for other machines. See the -Model Forcing Data -link under the -&clm; Documentation Page - - - - -Customizing via the template files - -The final thing that the user may wish to do before &configure; is run is to edit -the template files which determine the configuration and initial namelist. The -variables in &envconf; typically mean you will NOT have -to edit the template. But, there are rare instances where it is useful to do so. - gives the details on how to do this. -The template files are copied to your case directory and are available under -Tools/Templates. -The list of template files you might wish to edit are: - - clm.cpl7.template - datm.cpl7.template - cpl.template - - - - - - -More information on the &clm; &configure; script - -The &configure; script defines the details of a clm configuration and summarizes it into a -config_cache.xml file. The config_cache.xml -will be placed in your case directory under Buildconf/clmconf. -The config_definition.xml -in models/lnd/clm/bld/config_files -gives a definition of each &clm; configuration item, it is viewable in a web-browser. -Many of these items are things that you would NOT change, but looking through the -list gives you the valid options, and a good description of each. Below we repeat -the config_definition.xml files contents: - - - - - -Help on &clm; &configure; - -Coupling this with looking at the options to &configure; with -"-help" as below will enable you to understand how to set the different options. - -> cd models/lnd/clm/bld -> &configure; -help - - - -The output to the above command is as follows: - - -&config_help; - - -We've given details on how to use the options in &envconf; to -interact with the &clm; "&configure;" and "&buildnml;" scripts, as well as giving a good -understanding of how these scripts work and the options to them. In the next section we -give further details on the &clm; namelist. You could customize the namelist for these -options after "&configure; -case" is run. - - - - - - - - - - Customizing the &clm; namelist - -Once a case is &configure;d, we can then customize the case further, by editing the -run-time namelist for &clm;. First let's list the definition of each namelist -item and their valid values, and then we'll list the default values for them. -Next for some of the most used or tricky namelist items we'll give examples of their -use, and give you example namelists that highlight these features. - - - - -Definition of Namelist items and their default values - -Here we point to you where you can find the definition of each namelist item and -separately the default values for them. The default values may change depending on -the resolution, land-mask, simulation-year and other attributes. Both of these -files are viewable in your web browser. Below we provide the link for them, and -then expand each in turn. - - - -Definition of each Namelist Item - - -Default values of each -&clm; Namelist Item - - - -One set of the namelist items allows you to add fields to the output history files: -hist_fincl1, hist_fincl2, -hist_fincl3, hist_fincl4, -hist_fincl5, and hist_fincl6. The link -&clm; History Fields -documents all of the history fields available and gives the long-name and units -for each. - - - - - -&hisfldtbl; - - - - - - - -Examples of using different namelist features - -Below we will give examples of user namelists that activate different commonly used -namelist features. We will discuss the namelist features in different examples and then -show a user namelist that includes an example of the use of these features. First we -will show the default namelist that doesn't activate any user options. - - - -The default namelist - -Here we give the default namelist as it would be created for a I1850CN compset at 0.9x1.25 -resolution with a gx1v6 land-mask. To edit the namelist you would edit the -BuildConf/clm.buildnml.csh under your case (or before &configure; -include a user namelist with just the items you want to change). For simplicity we will -just show the namelist and NOT the entire file. In the sections below, for simplicity - we will just show the user namelist (&usernlclm;) that will add (or modify existing) -namelist items to the namelist. Again, just adding the &usernlclm; file to your case -directory, before "&configure; -case" is invoked will cause the given namelist items to -appear in your &clm; namelist. - -Default &clm; Namelist - -&clm_inparm - co2_ppmv = 284.7 - co2_type = 'constant' - create_crop_landunit = .false. - dtime = 1800 - fatmgrid = '$DIN_LOC_ROOT/lnd/clm2/griddata/griddata_0.9x1.25_070212.nc' - fatmlndfrc = -'$DIN_LOC_ROOT/lnd/clm2/griddata/fracdata_0.9x1.25_gx1v6_c090317.nc' - finidat = 'I1850CN_f09_g16_c100503.clm2.r.0001-01-01-00000.nc' - fpftcon = '$DIN_LOC_ROOT/lnd/clm2/pftdata/pft-physiology.c110425.nc' - frivinp_rtm = '$DIN_LOC_ROOT/lnd/clm2/rtmdata/rdirc_0.5x0.5_simyr2000_slpmxvl_c120717.nc' - fsnowaging = -'$DIN_LOC_ROOT/lnd/clm2/snicardata/snicar_drdt_bst_fit_60_c070416.nc' - fsnowoptics = -'$DIN_LOC_ROOT/lnd/clm2/snicardata/snicar_optics_5bnd_c090915.nc' - fsurdat = -'$DIN_LOC_ROOT/lnd/clm2/surfdata/surfdata_0.9x1.25_simyr1850_c091006.nc' - ice_runoff = .true. - outnc_large_files = .true. - rtm_nsteps = 6 - urban_hac = 'ON_WASTEHEAT' - urban_traffic = .false. -/ -&ndepdyn_nml - stream_fldfilename_ndep = -'$DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_hist_simyr1849-2006_1.9x2.5_c100428.nc' - stream_year_first_ndep = 1850 - stream_year_last_ndep = 1850 -/ - - -Note that the namelist introduces some of the history namelist options that will be -talked about in further detail below (hist_mfilt and -hist_nhtfrq). - - - - -Adding/removing fields on your primary history file - -The primary history files are output monthly, and contain an extensive list of -fieldnames, but the list of fieldnames can be added to using hist_fincl1 -or removed from by adding fieldnames to hist_fexcl1. -A sample user namelist &usernlclm; adding few new fields -(cosine of solar zenith angle, and solar declination) and excluding a few -standard fields is (ground temperature, vegetation temperature, soil temperature and soil water).: - -Example &usernlclm; namelist adding and removing fields on primary history file - -&clm_inparm - hist_fincl1 = 'COSZEN', 'DECL' - hist_fexcl1 = 'TG', 'TV', 'TSOI', 'H2OSOI' -/ - - - - - - -Adding auxiliary history files and changing output -frequency - -The hist_fincl2 through hist_fincl6 set of -namelist variables add given history fieldnames to auxiliary history file "streams", and -hist_fexcl2 through hist_fexcl6 set of -namelist variables remove given history fieldnames from history file auxiliary "streams". -A history "stream" is a set of history files that are produced at a given frequency. -By default there is only one stream of monthly data files. To add more streams you -add history fieldnames to hist_fincl2 through -hist_fincl6. The output frequency and the way averaging is done -can be different for each history file stream. By default the primary history files -are monthly and any others are daily. You can have up to six active history streams, but you need -to activate them in order. So if you activate stream "6" by setting -hist_fincl6, but if any of hist_fincl2 through -hist_fincl5 are unset, only the history streams up to the first blank one -will be activated. - - -The frequency of the history file streams is given by the namelist variable -hist_nhtfrq which is an array of rank six for each history stream. -The values of the array hist_nhtfrq must be integers, where the -following values have the given meaning: - -Positive value means the output frequency is the number of -model steps between output. - -Negative value means the output frequency is the absolute -value in hours given (i.e -1 would mean an hour and -24 would mean a full day). Daily -(-24) is the default value for all auxiliary files. - -Zero means the output frequency is monthly. This is the -default for the primary history files. - - - - -The number of samples on each history file stream is given by the namelist variable -hist_mfilt which is an array of rank six for each history stream. -The values of the array hist_mfilt must be positive integers. By -default the primary history file stream has one time sample on it (i.e. output is -to separate monthly files), and all other streams have thirty time samples on them. - - -A sample user namelist &usernlclm; turning on four extra file -streams for output: daily, six-hourly, hourly, and every time-step, -leaving the primary history files as monthly, and changing the number -of samples on the streams to: yearly (12), thirty, weekly (28), daily (24), and daily -(48) is: - -Example &usernlclm; namelist adding auxiliary history files and changing output frequency - -&clm_inparm - hist_fincl2 = 'TG', 'TV' - hist_fincl3 = 'TG', 'TV' - hist_fincl4 = 'TG', 'TV' - hist_fincl5 = 'TG', 'TV' - hist_nhtfrq = 0, -24, -6, -1, 1 - hist_mfilt = 12, 30, 28, 24, 48 -/ - - - - - - -Removing all history fields - -Sometimes for various reasons you want to remove all the history fields either -because you want to do testing without any output, or you only want a very small -custom list of output fields rather than the default extensive list of fields. -By default only the primary history files are active, so technically using -hist_fexcl1 explained in the first example, you could list -ALL of the history fields that are output in -hist_fexcl1 and then you wouldn't get any output. However, as -the list is very extensive this would be a cumbersome thing to do. So to facilitate -this hist_empty_htapes allows you to turn off all default output. -You can still use hist_fincl1 to turn your own list of fields -on, but you then start from a clean slate. -A sample user namelist &usernlclm; turning off all history -fields and then activating just a few selected fields (ground and vegetation temperatures -and absorbed solar radiation) is: - -Example &usernlclm; namelist removing all history fields - -&clm_inparm - hist_empty_htapes = .true. - hist_fincl1 = 'TG', 'TV', 'FSA' -/ - - -Note, you could also build adding the "-noio" option to &CLMCONFIG;. But, this would -build the model without history output and you wouldn't be able to add that in later. - - - - -Various ways to change history output averaging flags - -There are two ways to change the averaging of output history fields. The first is using -hist_avgflag_pertape which gives a default value for each history -stream, the second is when you add fields using hist_fincl*, you add -an averaging flag to the end of the field name after a colon (for example 'TSOI:X', would -output the maximum of TSOI). -The types of averaging that can be done are: - -A Average, over the output interval. -I Instantaneous, output the value at the output interval. -X Maximum, over the output interval. -M Minimum, over the output interval. - - -The default averaging depends on the specific fields, but for most fields is an average. -A sample user namelist &usernlclm; making the monthly output -fields all averages (except TSOI for the first two streams and FIRE for the 5th stream), -and adding auxiliary file streams for instantaneous (6-hourly), -maximum (daily), minimum (daily), and average (daily). For some of the fields we -diverge from the per-tape value given and customize to some different type of -optimization. - -Example &usernlclm; namelist with various ways to average history fields - -&clm_inparm - hist_empty_htapes = .true. - hist_fincl1 = 'TSOI:X', 'TG', 'TV', 'FIRE', 'FSR', 'FSH', - 'EFLX_LH_TOT', 'WT' - hist_fincl2 = 'TSOI:X', 'TG', 'TV', 'FIRE', 'FSR', 'FSH', - 'EFLX_LH_TOT', 'WT' - hist_fincl3 = 'TSOI', 'TG:I', 'TV', 'FIRE', 'FSR', 'FSH', - 'EFLX_LH_TOT', 'WT' - hist_fincl4 = 'TSOI', 'TG', 'TV:I', 'FIRE', 'FSR', 'FSH', - 'EFLX_LH_TOT', 'WT' - hist_fincl5 = 'TSOI', 'TG', 'TV', 'FIRE:I', 'FSR', 'FSH', - 'EFLX_LH_TOT', 'WT' - hist_avgflag_pertape = 'A', 'I', 'X', 'M', 'A' - hist_nhtfrq = 0, -6, -24, -24, -24 -/ - - - - - -In the example we put the same list of fields on each of the tapes: soil-temperature, -ground temperature, vegetation temperature, emitted longwave radiation, reflected -solar radiation, sensible heat, total latent-heat, and total water storage. We also -modify the soil-temperature for the primary and secondary auxiliary tapes by outputting -them for a maximum instead of the prescribed per-tape of average and instantaneous -respectively. For the tertiary auxiliary tape we output ground temperature instantaneous -instead of as a maximum, and for the fourth auxiliary tape we output vegetation -temperature instantaneous instead of as a minimum. Finally, for the fifth auxiliary -tapes we output FIRE instantaneously instead of as an average. - - - - -We also use hist_empty_htapes as in the previous example, -so we can list ONLY the fields that we want on the primary history tapes. - - - - - -Outputting history files as a vector in order to analyze -the plant function types within gridcells - -By default the output to history files are the grid-cell average of all land-units, and -vegetation types within that grid-cell, and output is on the -full 2D latitude/longitude grid with ocean masked out. Sometimes it's important to -understand how different land-units or vegetation types are acting within a grid-cell. -The way to do this is to output history files as a 1D-vector of all land-units and vegetation -types. In order to display this, you'll need to do extensive post-processing to make sense -of the output. Often you may only be interested in a few points, so once you figure out the -1D indices for the grid-cells of interest, you can easily view that data. 1D vector output -can also be useful for single point datasets, since it's then obvious that all data is for the -same grid cell. - - -To do this you use hist_dov2xy which is an array of rank six for -each history stream. Set it to -.false. if you want one of the history streams to be a 1D vector. -You can also use hist_type1d_pertape if you want to average over all the: -Plant-Function-Types, columns, land-units, or grid-cells. -A sample user namelist &usernlclm; leaving the primary monthly -files as 2D, and then doing grid-cell (GRID), column (COLS), -and no averaging over auxiliary tapes output daily for a single field -(ground temperature) is: - -Example &usernlclm; namelist outputting some files in 1D Vector format - -&clm_inparm - hist_fincl2 = 'TG' - hist_fincl3 = 'TG' - hist_fincl4 = 'TG' - hist_fincl5 = 'TG' - hist_fincl6 = 'TG' - hist_dov2xy = .true., .false., .false., .false. - hist_type2d_pertape = ' ', 'GRID', 'COLS', ' ' - hist_nhtfrq = 0, -24, -24, -24 -/ - - - - -LAND and COLS are also options to the pertape averaging, but currently there is a bug -with them and they fail to work. - - - - - -Technically the default for hist_nhtfrq is for primary files -output monthly and the other auxiliary tapes for daily, so we don't actually have -to include hist_nhtfrq, we could use the default for it. Here -we specify it for clarity. - - - - -Visualizing global 1D vector files will take effort. You'll probably want -to do some post-processing and possibly just extract out single points of interest -to see what is going on. Since, the output is a 1D vector, of only land-points -traditional plots won't be helpful. The number of points per grid-cell will also -vary for anything, but grid-cell averaging. You'll need to use the output fields -pfts1d_ixy, and pfts1d_jxy, to get the mapping -of the fields to the global 2D array. pfts1d_itype_veg gives you -the PFT number for each PFT. Most likely you'll want to do this analysis in a -data processing tool (such as NCL, Matlab, Mathmatica, IDL, etcetera that is able -to read and process &netcdf; data files). - - - - - -Outputting multi-layer snow history fields - -A number of history fields provide information about individual snow layers: -SNO_ABS, SNO_T, SNO_GS, -SNO_Z, SNO_LIQH2O, -SNO_ICE, SNO_TK, and -SNO_BW; there is also an auxiliary field to aid -interpretation: SNO_EXISTENCE (described below). These fields -are inactive by default, but can be enabled like other history fields. If the -maximum number of snow layers is 5 (for example), then the layers of these -fields are arranged on the history file so that layer 1 is at the top of the -snow pack, and layer 5 only exists if the snow is deep enough to support all -layers. - - -Because snow layers can come into and out of existence, these fields can be -challenging to interpret. It is easiest to analyze these fields if you do output -every time step, and do not average to the grid cell (i.e., dov2xy = -.false.). Otherwise, a few principles should be kept in mind when -working with these fields: - -Temporal averages are taken only over times when a given snow layer exists -Grid cell averages are taken only over columns in which a given snow layer exists -SNO_EXISTENCE gives the fraction of the averaging -period in which a given snow layer existed. For grid cell averages, this gives -the weighted spatial fraction of the columns in which a snow layer existed for -this averaging period. This is most useful for subsetting grid cells for -analysis. For example, grid cells that have SNO_EXISTENCE = 1 -for all snow layers can be analyzed most easily. - - - -Here is a simple example illustrating this averaging; this considers a given -snow layer, L: - - -Assume a grid cell with 2 columns, with averaging done over 4 time steps. Column -#1 has subgrid weight 0.2, and no snow in layer L in any time -step. Column #2 has subgrid weight 0.8, and has snow in layer -L in time steps 3 and 4; the snow field of interest has -values 1.0 and 2.0 in these two time steps, for this layer. - - -SNO_EXISTENCE is then 0.8*(2/4) = 0.4. The snow field's value -would be 1.5 (note that times and columns with no snow in this layer are simply -ignored). - - -Finally, note that the SNOABS field is not computed for urban -columns, so it will have a missing value if snow only exists over urban columns -for a given snow layer. - - - - -Conclusion to namelist examples - -We've given various examples of namelists that feature the use of different namelist options -to customize a case for particular uses. Most the examples revolve around how to customize the -output history fields. This should give you a good basis for setting up your own &clm; namelist. - - - - - - - - - -Customizing the &datm; Namelist and Streams files - -When running "I" compsets with &clm; you use the &datm; model to give atmospheric -forcing data to &clm;. There are four ways to customize &datm;: - - -&datm; Main Namelist (datm_in) - - -&datm; Stream Namelist (datm_atm_in) - - -&datm; stream files - - -&datm; template file -(Tools/Templates.datm.cpl7.template) - - -The -Data Model Documentation gives the details of all the options for the data -models and for &datm; specifically. It goes into detail on all namelist items both for -&datm; -and for &datm; streams. It shows examples of stream files and talks about their use. In - we talk about editing the CLM and &datm; -template files. So here we won't talk about the &datm; template file, and we won't list -ALL of the &datm; namelist options, nor go into great details about stream files. But, -we will talk about a few of the different options that are relevant for running with -&clm;. All of the options for changing the namelists or stream files is done by editing -the Buildconf/datm.buildnml.csh file. - - -Because, they aren't useful for work with &clm; we will NOT discuss any of the options -for the main &datm; namelist. Use the &datm; Users Guide at the link above to find -details of that. For the streams namelist we will discuss three items: - - -mapalgo - - -taxmode - - -tintalgo - - -And for the streams file itself we will discuss: - - offset - -Again everything else (and including the above items) are discussed in the Data Model -User's Guide. Of the above the last three: offset, taxmode and tintalgo are all closely -related and have to do with the time interpolation of the &datm; data. - - - - -mapalgo - -mapalgo sets the spatial interpolation method to go from the -&datm; input data to the output &datm; model grid. The default is -bilinear. For CLM1PT we set it to nn to just -select the nearest neighbor. This saves time and we also had problems running the -interpolation for single-point mode. - - - - -taxmode - -taxmode is the time axis mode. For &clm; we usually have it -set to cycle which means that once the end of the data is reached -it will start over at the beginning. The extend modes is used -have it use the last time-step of the forcing data once it reaches the end of forcing -data (or use the first time-step before it reaches where the forcing data starts). -See the warning below about the extend mode. - - -THE extend OPTION NEEDS TO BE USED WITH CAUTION! -It is only invoked by default for the CLM1PT mode and is only intended for the -supported urban datasets to extend the data for a single time-step. If you have the -model run extensively through periods in this mode you will effectively -be repeating that last time-step over that entire period. This means the -output of your simulation will be worthless. See bug 1377 in the &KnownBugs; file for -more information on this issue. - - - - - - -offset (in the stream file) - -offset is the time offset in seconds to give to each stream -of data. Normally it is NOT used because the time-stamps for data is set correctly -for each stream of data. Note, the offset may NEED to be -adjusted depending on the taxmode described above, or it may -need to be adjusted to account for data that is time-stamped at the END of an -interval rather than the middle or beginning of interval. The -offset can is set in the stream file rather than on the -stream namelist. For data with a taxmode method of -coszen the time-stamp needs to be for the beginning of the interval, -while for other data it should be the midpoint. The offset can be -used to adjust the time-stamps to get the data to line up correctly. - - - - -tintalgo - -tintalgo is the time interpolation algorithm. For &clm; we usually -use one of three modes: coszen, nearest, or -linear. We use coszen for solar data, -nearest for precipitation data, and linear -for everything else. If your data is half-hourly or hourly, nearest -will work fine for everything. The coszen scaling is useful for -longer periods (three hours or more) to try to get the solar to match the cosine of -the solar zenith angle over that longer period of time. If you use -linear for longer intervals, the solar will cut out at night-time -anyway, and the straight line will be a poor approximation of the cosine of the -solar zenith angle of actual solar data. nearest likewise would -be bad for longer periods where it would be much higher than the actual values. - - -For coszen the time-stamps of the data should correspond to the -beginning of the interval the data is measured for. Either make sure the time-stamps -on the datafiles is set this way, or use the offset described above -to set it. - - - - -For nearest and linear the time-stamps of the -data should correspond to the middle of the interval the data is measured for. Either -make sure the time-stamps on the datafiles is set this way, or use the -offset described above to set it. - - - - - - -In the sections below we go over each of the relevant DATM_MODE -options and what the above &datm; settings are for each. This gives you examples -of actual usage for the settings. We also describe in what ways you might want -to customize them for your own case. - - - -&CLMQIAN; mode and it's &datm; settings - -In &CLMQIAN; mode the Qian dataset is used which has 6-hourly -solar and precipitation data, and 3-hourly for everything else. -The dataset is divided into those three data streams: solar, precipitation, -and everything else (temperature, pressure, humidity and wind). The time-stamps -of the data were also adjusted so that they are the beginning of the interval -for solar, and the middle for the other two. Because, of this the -offset is set to zero, and the tintalgo -is: coszen, nearest, and -linear for the solar, precipitation and other data -respectively. taxmode is set to cycle -and mapalgo is set to bilinear so that -the data is spatially interpolated from the input T62 grid to the grid the atmosphere -model is being run at. - - -Normally you wouldn't customize the &CLMQIAN; settings, but you might replicate -it's use for your own global data that had similar temporal characteristics. - - - - -CLM1PT mode and it's &datm; settings - -In CLM1PT mode the model is assumed to have half-hourly or hourly data -for a single-point. For the supported datasets that is exactly what it has. -But, if you add your own data you may need to make adjustments accordingly. -Using the &CLMUSRDAT; option you can easily extend this mode for your own -datasets that may be regional or even global and could be at different temporal -frequencies. If you do so you'll need to make adjustments to your &datm; settings. -The dataset has all data in a single stream file. The time-stamps -of the data were also adjusted so that they are at the middle of the interval. -Because, of this the offset is set to zero, and the -tintalgo is set to nearest. -taxmode is set to extend -and mapalgo is set to nn so that -simply the nearest point is used. - - -If you are using your own data for this mode and it's not at least hourly -you'll want to adjust the &datm; settings for it. If the data is three or -six hourly, you'll need to divide it up into separate streams like in -&CLMQIAN; mode which will require fairly extensive changes to the &datm; -namelist and streams files. For an example of doing this see -. - - - - -&CPLHIST; mode and it's &datm; settings - -In &CPLHIST; mode the model is assumed to have 3-hourly for a global grid from -a previous &cesm; simulation. Like &CLMQIAN; mode the data is divided into -three streams: one for precipitation, one for solar, and one for everything else. -The time-stamps for Coupler history files for &cesm; is at the end of the interval, -so the offset needs to be set in order to adjust the time-stamps to what it needs -to be for the tintalgo settings. For precipitation -taxmode is set to nearest so the -offset is set to -5400 seconds so that -the ending time-step is adjusted by an hour and half to the middle of the interval. -For solar taxmode is set to coszen so the -offset is set to -10800 seconds so that -the ending time-step is adjust by three hours to the beginning of the interval. -For everything else taxmode is set to -linear so the offset is set to --5400 seconds so that the ending time-step is adjusted by an -hour and half to the middle of the interval. - - -Normally you wouldn't modify the &datm; settings for this mode. However, if you -had data at a different frequency than 3-hours you would need to modify the -offset and possibly the taxmode. The other -two things that you might modify would be the path to the data (which you can -change in the &datm; template see ) or -the domain file for the resolution (which is currently hardwired to f09). For -data at a different input resolution you would need to change the domain file -in the streams file to use a domain file to the resolution that the data comes in -on. - - - - - - - -Conclusion to customizing chapter - -We've given extensive details on customizing cases with &clm;, by choosing compsets, by changing -&configure; options and interacting with the &clm; "&configure;" and "&buildnml;" scripts, -we've given details on all of the &clm; namelist items, and finally given some -instruction in customizing the &datm; namelist and streams files. In the next chapter we talk -about further ways to customize cases with &clm; by creating your own datasets using the tools -provided in &clm;. - - - - diff --git a/doc/UsersGuide/get_Icaselist.pl b/doc/UsersGuide/get_Icaselist.pl deleted file mode 100755 index 6aefc26159..0000000000 --- a/doc/UsersGuide/get_Icaselist.pl +++ /dev/null @@ -1,136 +0,0 @@ -#!/usr/bin/env perl -#----------------------------------------------------------------------------------------------- -# -# get_Icaselist.pl -# -# This utility gets a list of the I cases from the CCSM compset database. -# -#----------------------------------------------------------------------------------------------- - -use strict; -use Cwd; -use English; -use Getopt::Long; -use IO::File; -use IO::Handle; -#----------------------------------------------------------------------------------------------- - -sub usage { - die <autoflush(); - -#----------------------------------------------------------------------------------------------- -my $cwd = getcwd(); # current working directory -my $cfgdir; # absolute pathname of directory that contains this script -$cfgdir = $cwd; - -#----------------------------------------------------------------------------------------------- -# Parse command-line options. -my %opts = ( - ); -GetOptions( - "h|help" => \$opts{'help'}, -) or usage(); - -# Give usage message. -usage() if $opts{'help'}; - -# Check for unparsed argumentss -if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); -} - -# Check for manditory case input if not just listing valid values - -my %cfg = (); # build configuration - -#----------------------------------------------------------------------------------------------- - -# Check for the configuration definition file. -my $config_def_file = "config_definition.xml"; -my $case_def_dir = "$cfgdir/../../../../../scripts/ccsm_utils/Case.template"; -(-f "$case_def_dir/$config_def_file") or die <<"EOF"; -** Cannot find configuration definition file \"$config_def_file\" in directory - \"$case_def_dir\" ** -EOF - -# Compset definition file. -my $compset_file = 'config_compsets.xml'; -(-f "$case_def_dir/$compset_file") or die <<"EOF"; -** Cannot find compset parameters file \"$compset_file\" in directory - \"$case_def_dir\" ** -EOF - -my $xml_dir = "$cfgdir/../../../../../scripts/ccsm_utils/Tools/perl5lib"; -# The XML::Lite module is required to parse the XML configuration files. -(-f "$xml_dir/XML/Lite.pm") or die <<"EOF"; -** Cannot find perl module \"XML/Lite.pm\" in directory - \"$xml_dir\" ** -EOF - - -#----------------------------------------------------------------------------------------------- -my @dirs = ( $cfgdir, $xml_dir, $case_def_dir ); -unshift @INC, @dirs; -require XML::Lite; -require ConfigCase; - -#----------------------------------------------------------------------------------------------- -my $cfg_ref = ConfigCase->new("$case_def_dir/$config_def_file"); -print_compsets( "$case_def_dir/$compset_file" ); - -#----------------------------------------------------------------------------------------------- -# FINNISHED #################################################################################### -#----------------------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- - -sub print_compsets -{ - # Print all currently supported valid compsets - - my ($compset_file) = @_; - my $xml = XML::Lite->new( $compset_file ); - my $root = $xml->root_element(); - - # Check for valid root node - my $name = $root->get_name(); - $name eq "config_compset" or die - "file $compset_file is not a compset parameters file\n"; - - # Read the compset parameters from $compset_file. - my @e = $xml->elements_by_name( "compset" ); - my %a = (); - my %data; - while ( my $e = shift @e ) { - %a = $e->get_attributes(); - my $sname = $a{'SHORTNAME'}; - if ($a{GRID_MATCH} && exists($data{$sname}) && defined($data{$sname}{'DESC'} && defined($a{'DESC'}) ) ) { - if ( $data{$sname}{'DESC'} =~ /^INVALID:/ ) { - $data{$sname}{'DESC'} = $a{'DESC'}; - } - } elsif ( $a{'SHORTNAME'} =~ /^I/ ) { - $data{$sname}{'NAME'} = $a{'NAME'}; - $data{$sname}{'DESC'} = $a{'DESC'}; - } - } - print "\n"; - foreach my $sname ( sort(keys(%data)) ) { - print "$data{$sname}{'NAME'}" . - "($sname)\n"; - print "$data{$sname}{'DESC'}\n"; - } - print "\n"; -} - diff --git a/doc/UsersGuide/limitLineLen.pl b/doc/UsersGuide/limitLineLen.pl deleted file mode 100755 index 25f1216d06..0000000000 --- a/doc/UsersGuide/limitLineLen.pl +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env perl -# -# Limit the line length for output designed to go into the document. -# -use strict; -use Cwd; -use English; -use IO::File; -use Getopt::Long; -use IO::Handle; -#----------------------------------------------------------------------------------------------- - -# Get the directory name and filename of this script. If the command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $nm = "$ProgName::"; # name to use if script dies -my $scrdir; -if ($ProgDir) { - $scrdir = $ProgDir; -} else { - $scrdir = getcwd() -} -my $limitLen = 99; - -sub usage { - my $msg = shift; - - print "ERROR:: $msg\n"; - die < -OPTIONS - -l = Limit line length to this value (default $limitLen) -EOF -} - -sub LengthofwhiteSpaceNearLength { - my $line = shift; - my $leng = shift; - - my $l = $leng; - while( substr( $line, $l, 1 ) !~ /\s|:|,|\// ) { - # First search for white-space before desired length -- and then after - if ( $l <= $leng ) { - $l--; - } else { - $l++; - } - # Once reach beginning of line, go to the desired length+1 and increment - if ( $l < 0 ) { $l = $leng+1; } - # Once reach the very end of the line die as couldn't break it - if ( $l >= length($line) ) { - die "ERROR : went through entire line and did NOT find a place to break it\n"; - } - } - return( $l ); -} - -my %opts = ( limitLen => $limitLen ); - -GetOptions( - "l=s" => \$opts{'limitLen'}, -) or usage(); - -if ( $#ARGV != 0 ) { - &usage( "Wrong number of command line arguments" ); -} - -$limitLen = $opts{'limitLen'}; - -my $inputFile = $ARGV[0]; - -if ( ! -f $inputFile ) { - &usage( "Input file does NOT exist : $inputFile" ); -} - -my $fh = IO::File->new($inputFile, '<') or die "** $nm - can't open input file: $inputFile\n"; - -while (my $line = <$fh>) { - - while( length($line) > $limitLen ) { - print STDERR "Line length over $limitLen\n"; - my $lenlim = &LengthofwhiteSpaceNearLength( $line, $limitLen ); - if ( ($lenlim == length($line)) || $lenlim < 0 ) { - print "Can NOT truncate long line: $line\n"; - die "ERROR : Having trouble breaking a long line\n"; - } - my $substring = substr( $line, 0, $lenlim+1 ); - print "$substring \\ \n"; - my $newline = " " . substr( $line, $lenlim+1, length($line) ); - $line = $newline; - } - print $line; - -} -$fh->close; - - diff --git a/doc/UsersGuide/modelnl/Makefile b/doc/UsersGuide/modelnl/Makefile deleted file mode 100644 index 595a1b3a3e..0000000000 --- a/doc/UsersGuide/modelnl/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# -# Makefile to create HTML documentation of namelists -# -SCRNLDIR := ../../../../../../scripts/doc/modelnl -VPATH := . $(SCRNLDIR) ../../../../../drv/bld/namelist_files ../../../../../glc/cism/bld/namelist_files \ - ../../../../../atm/datm/bld/namelist_files ../../../../../../scripts/ccsm_utils/Case.template \ - ../../../../../../scripts/ccsm_utils/Machines ../../../../../rof/rtm/bld/namelist_files \ - ../../../bld/namelist_files ../.. -SOURCES := namelist_definition_drv.xml namelist_definition_cism.xml namelist_definition.xml \ - namelist_definition_rtm.xm namelist_definition_datm.xml config_definition.xml \ - config_grid.xml config_machines.xml config_compsets.xml ChangeSum -TAGFILE := clmtag.txt - -CWD := $(shell pwd ) -ALLOUT := $(CWD)/clm_nl_drv.html $(CWD)/clm_nl_cism.html $(CWD)/clm_nl_clm.html $(CWD)/clm_nl_rtm.html \ - $(CWD)/clm_nl_datm.html $(CWD)/clm_env_case.html $(CWD)/clm_env_build.html $(CWD)/clm_env_pesetup.html \ - $(CWD)/clm_env_run.html $(CWD)/clm_grid.html $(CWD)/clm_machines.html $(CWD)/clm_compsets.html \ - $(TAGFILE) $(CWD)/index.html - -all: $(ALLOUT) - -debug: - @echo "SOURCES = $(SOURCES)" - @echo "VPATH = $(VPATH)" - @echo "ALLOUT = $(ALLOUT)" - @echo "SCRNLDIR = $(SCRNLDIR)" - @echo "CWD = $(CWD)" - @echo "TAGFILE = $(TAGFILE)" - -.SUFFIXES: -.SUFFIXES: .xml .html .txt - -RM := /bin/rm - -CTAGNAME = $(shell cat $(TAGFILE) ) - - -$(TAGFILE): ChangeSum - head -3 $< | tail -1 | awk '{print $$1}' > $@ - -$(CWD)/index.html: $(TAGFILE) index.cpp - sed 's/CLMTAGNAME/$(CTAGNAME)/' index.cpp > $@ - -$(CWD)/clm_nl_drv.html: namelist_definition_drv.xml - cd $(SCRNLDIR) ; ./nldef2html_drv > $@ - -$(CWD)/clm_nl_cism.html: namelist_definition_cism.xml - cd $(SCRNLDIR) ; ./nldef2html_cism > $@ - -$(CWD)/clm_nl_clm.html: namelist_definition.xml - cd $(SCRNLDIR) ; ./nldef2html_clm > $@ - -$(CWD)/clm_nl_rtm.html: namelist_definition_rtm.xml - cd $(SCRNLDIR) ; ./nldef2html_rtm > $@ - -$(CWD)/clm_nl_datm.html: namelist_definition_datm.xml - cd $(SCRNLDIR) ; ./nldef2html_datm > $@ - -$(CWD)/clm_env_case.html: config_definition.xml - cd $(SCRNLDIR) ; ./xmldef2html_env_case > $@ - -$(CWD)/clm_env_build.html: config_definition.xml - cd $(SCRNLDIR) ; ./xmldef2html_env_build > $@ - -$(CWD)/clm_env_pesetup.html: config_definition.xml - cd $(SCRNLDIR) ; ./xmldef2html_env_pesetup > $@ - -$(CWD)/clm_env_run.html: config_definition.xml - cd $(SCRNLDIR) ; ./xmldef2html_env_run > $@ - -$(CWD)/clm_grid.html: config_grid.xml - cd $(SCRNLDIR) ; ./xmldef2html_grid > $@ - -$(CWD)/clm_machines.html: config_machines.xml - cd $(SCRNLDIR) ; ./xmldef2html_machines > $@ - -$(CWD)/clm_compsets.html: config_compsets.xml - cd $(SCRNLDIR) ; ./xmldef2html_compsets > $@ - -clean: - $(RM) -f $(ALLOUT) - -realclean: clean - $(RM) -f $(TAGFILE) - diff --git a/doc/UsersGuide/modelnl/index.cpp b/doc/UsersGuide/modelnl/index.cpp deleted file mode 100644 index c55aa64159..0000000000 --- a/doc/UsersGuide/modelnl/index.cpp +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -CLM Namelist Definitions (CLMTAGNAME) - - - - - - -


- - -

CLM Tag: CLMTAGNAME

- -

Component Namelist Definitions

-
- -

create_newcase files (supported machines, grids, compsets)

- - -

$CASEROOT xml files

- - - - - - diff --git a/doc/UsersGuide/modelnl/showinfo.js b/doc/UsersGuide/modelnl/showinfo.js deleted file mode 100644 index fd8a608472..0000000000 --- a/doc/UsersGuide/modelnl/showinfo.js +++ /dev/null @@ -1,193 +0,0 @@ - function applyFilter(filter_text) { - - // applying a filter hides all standard names not matching filter_text - // if filter_text contains no spaces, it is treated as a regexp - // otherwise, all substrings must occur somewhere - - var is_match = false; - var search_type = 'regexp'; - var search_help_text = false; - var num_matches = 0; - var is_boolean_and = true; - - search_help_text = (document.getElementById('search_help_text').checked); - is_boolean_and = (document.getElementById('logical_operator_and').checked); - - if (filter_text.indexOf(' ') == -1) { - search_type = 'regexp'; - var re = new RegExp(filter_text, 'i') - } - else { - search_type = 'string'; - var string_parts = filter_text.split(' '); - } - - allTRs = document.getElementsByTagName('tr'); - - for (var i = 0; i < allTRs.length; i++) { - curTR = allTRs[i]; - - if (curTR.id != '') { - - if (search_type == 'regexp') { - - is_match = curTR.id.substring(0, curTR.id.length - 3).match(re); - - if (search_help_text) { - - var helpText = document.getElementById(curTR.id.substring(0,curTR.id.length - 3) + '_help').innerHTML; - is_match = is_match || helpText.match(re); - } - } - else { - - if (is_boolean_and) { - var is_name_match = true; - for (var j = 0; j < string_parts.length && is_name_match; j++) { - - if (!curTR.id.match(new RegExp(string_parts[j], 'i'))) { - is_name_match = false; - } - } - } - else { - - var is_name_match = false; - for (var j = 0; j < string_parts.length && !is_name_match; j++) { - - if (curTR.id.substring(0, curTR.id.length - 3).match(new RegExp(string_parts[j], 'i'))) { - is_name_match = true; - } - } - } - - is_match = is_name_match; - - if (search_help_text) { - var helpText = document.getElementById(curTR.id.substring(0,curTR.id.length - 3) + '_help').innerHTML; - - if (is_boolean_and) { - var is_help_match = true; - - for (var j = 0; j < string_parts.length && is_help_match; j++) { - - if (!helpText.match(new RegExp(string_parts[j], 'i'))) { - is_help_match = false; - } - } - } - else { - - var is_help_match = false; - - for (var j = 0; j < string_parts.length && !is_help_match; j++) { - - if (helpText.match(new RegExp(string_parts[j], 'i'))) { - is_help_match = true; - } - } - } - - is_match = is_match || is_help_match; - - } - } - - if (!is_match) { - curTR.style.display = 'none'; - } - else { - num_matches++; - curTR.style.display = ''; - if (search_help_text) { - showHelp(curTR.id.substring(0,curTR.id.length - 3)); - } - else { - hideHelp(curTR.id.substring(0,curTR.id.length - 3)); - } - } - } - } - - var filter_matches = document.getElementById('filter_matches'); - var filter_matches_num = document.getElementById('filter_matches_num'); - var filter_matches_query = document.getElementById('filter_matches_query'); - - if (filter_text != '') { - filter_matches.style.visibility = 'visible'; - filter_matches_num.innerHTML = num_matches; - filter_matches_query.innerHTML = filter_text; - } - else { - filter_matches.style.visibility = 'hidden'; - } - - } // end function applyFilter() - - function clearFilter() { - - allTRs = document.getElementsByTagName('tr'); - - for (var i = 0; i < allTRs.length; i++) { - curTR = allTRs[i]; - if (curTR.id != '') { - curTR.style.display = ''; - hideHelp(curTR.id.substring(0,curTR.id.length - 3)); - - } - } - - var filter_matches = document.getElementById('filter_matches'); - filter_matches.style.visibility = 'hidden'; - - document.getElementById('filter_text').value = ''; - } - - function toggleHelp(standard_name) { - - // check for the existence of the help "tr" object for this standard_name - - var helpDiv = document.getElementById(standard_name + '_help'); - - if (helpDiv) { - - if (helpDiv.style.display != 'none') { - - helpDiv.style.display = 'none'; - - curArrow = document.getElementById(standard_name + '_arrow'); - curArrow.src = "./images/arrow_right.gif"; - } - else { - helpDiv.style.display = ''; - - curArrow = document.getElementById(standard_name + '_arrow'); - curArrow.src = "./images/arrow_down.gif"; - } - } - } - - - function showHelp(standard_name) { - - var helpDiv = document.getElementById(standard_name + '_help'); - - if (helpDiv) { - - helpDiv.style.display = ''; - curArrow = document.getElementById(standard_name + '_arrow'); - curArrow.src = "./images/arrow_down.gif"; - } - } - - function hideHelp(standard_name) { - - var helpDiv = document.getElementById(standard_name + '_help'); - - if (helpDiv) { - helpDiv.style.display = 'none'; - curArrow = document.getElementById(standard_name + '_arrow'); - curArrow.src = "./images/arrow_right.gif"; - } - } - diff --git a/doc/UsersGuide/modelnl/xmldef2html_compsets b/doc/UsersGuide/modelnl/xmldef2html_compsets deleted file mode 100755 index 2659beed17..0000000000 --- a/doc/UsersGuide/modelnl/xmldef2html_compsets +++ /dev/null @@ -1,162 +0,0 @@ -#!/usr/bin/env perl - -use strict; - -if ( $#ARGV != 0 ) { - die "Wrong number of input arguments -- should just enter one filename\n"; -} -my $infilename = $ARGV[0]; -if ( ! -f $infilename ) { - die "Input file: $infilename does NOT exist\n"; -} - -my @dirs = ('../../../../../../scripts/ccsm_utils/Tools/per5lib', '../../../../../../scripts//ccsm_utils/Tools/perl5lib/Build'); -unshift @INC, @dirs; -require XML::Lite; -use lib "../../../../../../scripts/ccsm_utils/Tools/perl5lib"; - -my $image_dir = "./images"; - -print <<"END_of_Start"; - - - - - - - CESM Component Models Namelist Definitions - - - - - - -

Search or Browse supported component sets

-

-This page contains the complete list of config_grid.xml variables available. They are grouped -by categories designed to aid browsing. Clicking on the name of a variable will display descriptive -information. If search terms are entered in the text box below, the list will be condensed to contain -only matched variables. -

- -
- - - - - - -
- - - -
- - - (separate search terms with spaces) -
- -
-
- - - -END_of_Start - -my $xml = XML::Lite->new( $infilename ); -my $root = $xml->root_element(); - -# Check for valid root node -my $name = $root->get_name(); -$name eq "config_compset" or die - "file $infilename is not a compset definition file\n"; - -# Print table -print_start_table("config_compsets.xml variables"); -my @e = $xml->elements_by_name( "compset" ); -my %a = (); -while ( my $e = shift @e ) { - %a = $e->get_attributes(); - - if ($a{'NAME'} =~ /I_/ ) { - my $var = $a{'NAME'}; - my $doc = "Description: $a{DESC} \n"; - my $grp = "$a{SHORTNAME}"; - print_row($var, $doc, $grp); - } -} -print_end_table(); - -# Finish -print <<"END_of_html"; - - -END_of_html - -#-------------------------------------------------------------------------------------------- - -sub print_start_table { - my $hdr = shift; - -print <<"START_table"; -

$hdr

- - - -START_table -} - -#-------------------------------------------------------------------------------------------- - -sub print_row { - - my $name = shift; - my $doc = shift; - my $grp = shift; - -print <<"END_of_row"; - - - - -END_of_row -} - -#-------------------------------------------------------------------------------------------- - -sub print_end_table { - -print <<"END_table"; -
Compset NameShort Name
- - - $name - - - $grp
-END_table -} - -#-------------------------------------------------------------------------------------------- - diff --git a/doc/UsersGuide/pergro.jpg b/doc/UsersGuide/pergro.jpg deleted file mode 100644 index a0cb81e046e802b41c5bfde3073bfb5e1903ccf3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35642 zcmc$_cUY6bx-S}<3P_PEARq!lsDkufg#@L9CJ9C9Eg-!kB1Jlc03sm8gd)8qp)0*h z@4ZSFq}R*Z_nv#!T6^Df_WA2ho+tUfB;U+C&%ABk-*0XvZWaKP;1{4506aWAfcotV za5D{11`y!?qy6KZ;IGzLlLUnKZXcv1B__T7_W!Wm`~W<-hc}M5On~yhO%CoC+us-ZNo(FC+@EF4x=0hnj_S{nm9MwR>XXP=Sr0SRufDwx0PyP- ztkWFa0VU5qk9H8mPMOdADcmv$r-ui$Rh=_`pfi62e24#WOq+2E1CVAK$aZvwF`aJ) zT@N*df&hr@?1i(^9RNB|yGkM+GnRz9BGLR=x&cv`)CMp+zxO4$02@$?^_I^`x9s_> z!DN&wmIqjCv=Rn2_{+LU#*`o=NcTik5J(C@WqW^?hs=3(Puul$!Hub&-^#xKP}C%? zouxsl?}}~@uF2`J-BHGg^mzItQV9eU^kn?r!Lr(CgS+!QLzEfUx8mt-Xek`t(&eab zMIM6gBVX_uFbF$pAR%~*evd~Oe{bSE@|rfA2TW5H${V04r*)A}G0J@a0z$eFewEV&|BO@ydSbHa8z_Sn#!~?Fo(@PEJg%D%2P$s>ZJ+Kk{{gv^)^YOGi7>`Q%=jNNqm4c zZ(g6Nt%iEU)2+>*QKMx)P%iE1I$7$r5xPJ1ffiTU2?G`WBQPC=jxs0s>#QF@JWJp( zU-V=IwSFbDJeOToZx{Ll*W|2np+D(ht^7n~ExUHeAV|$~7TRG>qW7SD;iKUfJn$vj z4yqKNl@%Dm963}rr@`R-c>R=Xp;>T6rt?7{?^3|8=+n>euASlhhN?v^|uk^Xw}u;I*fGKC}Hp>}zzy0x-nqoJUneMjg@iTk$%BEr{^DCYvvwHrnaW~_=CP4`fr{Np=zn9Xc{Z;bgC1xmI3ZY z68!2;Ntch87*E>g+UYgE0dOvW!rz%Y>ft(5PW{{%fh2_7D4Fiy>VqQhgD;uqzK4H5 znn=74bxZ#cZfWHSdzE`Buv7FDlCED>^||r7p|wqkb(2w1NsmeEjpA#40}7)3wz`L% z<@d_=GQ(FZdZ)W*x}2Oek~iR(*i`|=03d(G6qsrOgs1Rv5;jqm&da*oYfa7?St%6t zsvK4RAk~nVnx+Q?;H;`)b1+j0!q=S!-FloX$qvfJA};%BdW9 zFN}JY#tV7RFa5)MLZe*3f{oNJfb>604{e1EUZY9PaQ|T=HkmvadIQ2i2b3 zvv2;)QU3UA2Dv=4>vH)mEQHaN+4kdM0<&E@9G}n}wpAcQ_;(8Jpmj9)1$LV`poTZb zf*p?>+;L|64jhTTbz;-hrSux8y5eq)SJ&ShQiR6MAk4PJPGQ3a~eORuClx2jT+z7O5yM$Pfg;35 zQw?j92eHf-o)oHblacbR-g*13x8M9n8pdpA+lV$^^(2o+n(8e&(;HbEHZ#coal~U# ziZCue()SxqW965!m;ct|wjxIpYiQP7G5l_H`y&6k5kJ2`F{(ho&k322mXqejSDehx z8|olPrReO0~Xbtr`l^5DbHZ}?4 ze$5Hfx#wZwz%yykKl)8UZ=8Ged+hWMdM&7xDUcdRHUqD)2tH38YB9{>nDorc z0&;FshA+t$G`I+}!wB^&?E$#~tTkec3>cNO%T5r4wYv)Rwf544$-)?WI;THjCmtODCI z=g`y_zbX1oZU6}a@>e>0H-HZ%ZVTHK$b(YN*X~Rd;@~#6-s%^`CYUzbE|*DCqSmUd zt06j6D2o48VQIjJGTxlMF?C7KulkW|1rbrAO?Jan4udRPO`G-I155IANd(1l*+r&! z9TV7x7B9^oTG|a33xW8Ac-DDbEN#j2jZ+>$b(Wj)HijWJ{bpT#8e>0sLMk zi(K)O4YQV};xT!LTMBAW=5c9b9fOYORrBtmsZUDH@@+Tze6XKz&ipu8Cc-XVU))S~ zHSi_r%IPa%Tp2TjCMh}CIQ~3s-cU9q6#f`BF3B48r{Adj8&iMw%u|^5h3kE9tX(_= z%LFwDu4EYNJ})NLCgC9BpcE4~OK*xSdwD@_LD*Z=Z?Yq#%=z)Dd#Hw0dsvze)y1Wf z8NvHp^1EW7oeB{Ca|)U^oYtr&Tg1DgT+XoJPO+%b9$-f?`o5ylQjW02Od<_=F%C`H zj2uufdt*2e0ZB-tkyPn3cJ+YbHRaXjIB8vE^IxG^Bx7*DsXUe20&y0L_Wf% zcb4kw1QXKd_pz2HT*}t-@4y1WUm{$iyOFuD)CX8XA3H^tfPl5}tem?azZ1L%BT%6n z!S^QEf2+Q?`#(t|48wl;S6K=@%Cx|BWH1y!-tv#p(I7ix&nE&Z)Q;k}G})B5Q4fww zJ>0bJx!nNnFTO6mc-VbLHRxE|{L9VxQ{+Vmf8&{Gm)*qpEDz`g;F2W;O#)tS21wrk z{0vz4^{@3m_6L~$sZOM-nRN+N>(~{4-Fp&63wBW)-S!?*;A+1P3#x&jSj_10BR?kLyMr$h^>wc3CIGbkl%JhQFSsQH1JvFJ*$Mt&B*llB^t)2T})$MpL8dz4m1!~0Pe zu07rN{dvPpC)ICn0JLVSx`DtWwx7wpTd7ZHB!zoh=pE-oItBRK@Yp`Y8l?(wb;L7U zjW{1?>)qA*SE1|2wG18+(M<}xWYH^=<;;Bq<4>XSE8;-rDFpO~;+dgU%i|1Y7~I;6 z#hKQ*UbD@h72lpEG>^siY{EHP0gCKk4qJr3f!5!G!@aAW*YDd5&$Man^~AZ3{F=um z>7H);$HnzJd5q$)M6?p6;gL`eu)714&Cbzr+kYP1ALt>MaRX>5q&WS41K`0gHl=e; zj-apco~D1eRjU}q;{G|}wLm5FQGJ*(Bruy-&#PH$rmAW3-zM*Hw}AY<#Ymt>ylhvp zCCqwJ0wr;v5qUflkb1IOJ0W!dNxh$Vk*>9qB^CIutE~6WORh%*O(JXl$EvS0TQ4TM z%E>$9_|Mdh-3wYnvZ)>^gNHuIKetnAY#O`z$}4#`a_)6~TqM6#c$rU9&BK)D+py>$ zCUw-pu;L%M_)d90{?n#zB#F{IoSYW~xGXNPKfeJOUel)k+mQ8wX8aHKT!gT@LWAxZ zbSl3GY08*=rAe(QB#>8N?SlJ6tmPi8nA{t{Kj~NQ_zeK^=-~|@|C0W(O(I_prn%V_ z=gJXIyMwtH-sZKd@K`7inqxl^E1gtuzv9vTCus}*>H0q;kN$_`=}~{Z`qerXv3Ist zV7|fWTCJ*NBB)wV@-ApP6C-F0qJOK2W^dHX|-E0X$Ll?U;yOZx&*0(sxOt>h23w>N5#U4oBhWDnFtoh8gst2P` zV{Fl$;DgK;J5GNMMyqR(H^LOID?YxIxm9<#+RneNc%Z?px~Ir&g{@7W3HM&mrO&St?v!2B`R)QFt7Bgn)D<$PQ$^6%>YZ*$1T{JOPKE`dg<^?{sRUoMTerUH^?K@hiI zx5t4H@jZ0@eW%W6_TOz34SxU6M*HTE^KCDFt;H$E-xBsOJjOI+S5?93>UMr|BE<>I zX1WT-g)QEVP@&(SGW~HK9~mZfvf0MRsFKv<&mX=m(>hAtD$Zu#MSnOcXj<3Zn7^1R zy8%R&9u(XF#Q)wpuQgn8_`^0yszJBfzF+S$!y{Wliu+SVtL+EICxJRQfOogf>wi~x zP^$3@!R?ARIvI4^8Bv3X`T;X#&BfIf}_siIs=IA?m~Np~l8&i)!i*Puku# zFFURp`Pmv-9fJ|V(x2{5$D?K9E=meCDRLqV`V0;<0?t?Ar;cuHuaa$WN&b-RT=h-4 zg5NoJGg-Wj3$SQUtB$3Jgk5Ttu2BDt$2pyB0>euf( zu`|W5FU7AJ#&Vv8Exqzi;*+XaLMR#zR$&j%nr)Vc)OP>=LYRC5zTi!jt#6b*Kq5|a zwiE}~3xkoUp%wQOeut{NX*r_h&+h zm56l}X+*KH!R1;aT(Hy^5ESCx)e^2$+}KIs2izvTvTn_Or~mqBY%qEX-lrDDOorKl zi^{4Gx=IfuFHPW;{g$h-C#!?Ta^)EP5*!W?^e~wW#dH9$|N(~j@A*P`r{0NS3 z^lqz-Z|Zy_I*nU*k8Ndi+xN5EyV{0?f3@R&yL8NbT80<2NezHu8;uzV#Yxd$MT>O2 z7G5&r$T?@SkM7j`Zq&$nH0IK_w1`$I8aAB~qP_V=&1zeul+A9`P^ua32{hyj>>pEn z`+-CRX41bO-*zf3JE7r%NmCX?Wx6@|V0u(pN9Pgb$9BFQy1rJ)jAVOou{yEMK}dJ6>~&s_6Q z@`Ln3+f#SS=|nu0nwj_rJKk4>AxZQ!e++r?d5t!|5eiJ`er?<%!pot4Fq!#)$H$QJ zU>H?N37_Q@U{m#b98~R1U~}Ysh{P^W%vK$c^`Vx>=-|IAJnRbHH)68zFAB*D+OJ0O zWn*RO22iB^9j!R?>H@_ENXaB zxf<3^8JzkXWi8C1&Zvdg)@pd1G@Qd*`VMe!x%UqC4)s8InXjxT| zI;V-O?w;4{glNhxY8j$S-j$7Y5@E z`s$<1TA(eeWAAT#uEF`aOAR@uK6!QfP9Qm8;kMBYKu+#KtvR+n@1E}oQrwnU`Q;Cc zR8qh97F^^J@#DNV`S~0Ge@}LO(RCKR)$Ld(U?67p1#bjQpMaABcGba(I5+XC2Sq7e zm31@e0zE3P-Yps=jKj3<|4BJls5IVV7&8+)VpzRof*^l5IaEMl_IfJ~6Ne`NZe0_w z`o(WN*fIUaIDM4=)t&X^b5p*PpDBzEmdqet z;B_j@8aPf?Rwu&nj7@C07rg@51bdC^s<(Ii@fvQ+B( z7hXot-l6{jLby}c`6x7O-aFDpjGy zfpG3uOh{1Xnj}iBjl0%9~fG$L! z-H>eqUoL_D%jqGZ-{X0svR$ks$uYHHMK7$07yr@u)k*2RuBk@7LcMR^LXUvFOWf0C zayqpD99wwsNR;p*XGpOEksX#(lKy*yx{l@Vujr>I3d%z7b;bP0M}(G&JmCp5E@}K- zgKomXUo+gJgrAdI%O#CZtJNOpm!bJ>r8bf9o(wyZ#d^vEe^X=C%IPL$tSsCSLzOIx zHPI;H%i`(@wN>0}xNO>++fy*F(2#9EgP$^)8oGC6o=`PKW3aT&w$8RA$)?U~dk4-P z!930z=FbOkIhK;*#ME;Z;(cFSjYBXgmOx3_UV1tvur^JOm=YCoI|CrX`=Dpy$$p`K z?+>>?Rh!eA>Ek`g&Po`=2@Tp0UiYW}Xnc@+)1RU=^4wR*$m_!soD9|YtET6-Xjb%S^XtO#rucXK#s60IU3X7g^6#Ztvrma1*+{kUpf%!9lskwJ z5u6;@WHtn3k<0rn^JOyXQKe<9#0i}9=y}Ioggxmm!bv0A4)&uTQ6`zsoJ=aITB)fP zt>I2bQBPs9Qh6!GVg}l+mcJ1SP|fi9(S(T|hOxKtE0T?`3nbQf-@Wwy!>AR2ta{`_ zBsHYFXa~Vo?i5-QeuNrQxLAdgFHFDs-koGrnO=^Is97;IbE%<^a5YGo12dl`FDc$5 z)&Wo|%v%Y3ml>YOSwpPk0JWdVp}IvPyw0SA0Fu4i#CvHw3}gOTzb5&VzD!^j@Jy z1O6J3(UBxe;84@Wzmj0Ouh9K!{`yA4_7zJT+E*i(RgW0I?;9ZJ&PHh%ss^=JDU|F4 zY%boN6=?5~)ihbDg6p86vv0+IpaGP$lZxP}h;4NM=VP*9tqQN)9s%9NwSMbns{Qm} z6|Ukk$HF8>WT%oe_+|KKAGsw{zjdIx=4Fy6S6fNa^W4L9St-|a3nuqbRUW&p-QBA_ zpF(|&(4YMcPIXW1*7{Prx_RWjZhD#A#;S1x2L|Vd``5lZ5i`H2u%?=#BF1pL&*QjH zLrOG33yNoY3OeI&6tuzNy~qS))3U^|KBI^XqKAB~RWjQ6p_8s+Yc*$RIHSkoE1FOg zWnim;W|G^EO*6K`$agr?m*(;nT)Zn4eJP7XtmL~z^ydcT}NkRj}`Jd}DVmh}w%u3cO} zY3EKf(CA@gf^S~*;T(53xoES>-ORo}$!RIf`~?%623n4It#_$Vv>X{hRRz)nZ(<@# zM&!p_dyI*JKi%x7bdtDV=iOVZKe1Jbg!vXoS_@gqd(-Ocyw zX45a&qh7l#Mi}j1_-k;(+nXqyq*PqPiFrZJChCS(jt*+p6^B_O+jqkyG9za**<-xt zncA6a{mdBRBfX=qaxO4*w)V*+O~CPT5fv-+z9H1Ez1lC4^Y>Wm0^B# zI{3)BTI+-=@QFu_8+7AD3lsiDT2AI<|AOpQ120y#g!}X8kgl-xH}Sqiwqqkc%+@!q znqvrzM@I=XNz9`I*s|GDFf90QfYl|BTA3TqV`@PwyO6#-(`Q>^E-t3bAEThq7?)!c z-)wJ@zW2c2pMNd6_(v zLb=pX?e{pjc?ADt;Hv%+TX4hAz?9;L-wg5gF@-V_@(-Tfn?{_cdwYQ+$iD7=7|CRP zwVNxew!QP{Z!U6bIbCko%UE)JD z`6wYuqUYHx)*`_S@hL_Ev5!Deb`t<)kE$MjEcx~wqpDLh)(YL(|3-t>66=O}%=$pX z5umG09{GJy@x@rtMvDp#YoE}*Gi+4)i!Z}_^u~59#3V*@zd|Sq2DJ9}4N5d}-gJG@ z-IQEd?pG?4J0FjEMt zKEBV=r{IzNjW2HgT#L~m`Blu9c^LOyDn;NNHisPhy;LuJRM~BI=@T5f`kc}JuRo{I zybt0pT*}qYMju#)N+|9B#z#5^*L8o5 zpluc|uC|^7{YJjnS*{Zu;m6Y{#3h+;cZ%0FJ2GW2uYVdr|JQ(S?D|BW*z~pVNwgc; zxvq1Mj`=WEpEW3U2&t~_35L*6iin{-<(vBaWgiCuuR{_~r+-PiT$c7W@^`c-w#lAp zxbEsPaAxHc?@h~!pEru?v8Yz$Ud4VU{o&{nbTZJ?;w-@SpdWkwsyI*W?eSUQdS@}| z&`X`WVJY{FmY^#BJ0Dy7=KzrVO2pDuN~vT2!0XtM-EAp{J*Y)@ZRO+w&m2o zbi53U&k6DflWn-B)`?J0MPQnMqma%NVu zO$g&uAK`B;woSl8kqICOGMZhXK=8gko|pQ|+UE}DrSV7O&+D*`6;sfYH4PV%*Kj6c zRvtV^1P6eMm?H>J^x+Y4SH+j|i5&y!pirr$@%CCIn!Fh0nAh<}w+w~LKxWo3Y7^Rj z%{r@OSuv$)6-tNFB5nZki4_`7Vn?}a=-`g?=9XRlDj@H$vnmAt=SKMiEkK<9n+IQj zMgGc=`Kx9U^6?~2=O)tFd8UdU<>4d7QmcIAd$)uU=o=OrM*^x_XF=fHIq1B z!yRxG((Xsw#0s^xwdd9mx0`Etg59xoeB^Dm@f!+SqxY0z>j}Ub)MwYrywhDJ&s<() z@HaRs-($Y2km8m+*)1+qVQIK`71rP*Gl^lsHAhEaw^lc$mZ#In{dskgDJvUe;;BMV z6(VvCdRk-H5}uZnk8h5*?k9gy89{6I@Mj!*fH}@CepB9-fG5BAXBTBo!5!TrncPoH zo*T^KhIHT@4O_1ED_;Vc=_rg+SZE77bnNmi0_HkvfFPiNfJ3-p&v)yw;a6ot40d?j za5kX&Ip9uE=`7IXiGDM8UF3g3$jQeR-T>O<2M|q!K5HfNNvF=u5VjIq~p2nUx|D^4!z?n{3r?@8EIiY3>G&UNf*;}FzHhCw0 zAIDMO>z;gd5+BUCi{^H>8_hX0o^?G$Behm+ocazNxp8jkaiobVbVZ=c*P2#A;cWhP z?pZHf+NX^mQ1V0F=p>r_@3k+2+AL$O_+ftLlsgb7mZd-qWXeOEyo|4X+4l3p%B7d~ z@C_5)(Kc#Y4<~6iP3JTQ?$~O6)IY-VE+rbEm$9c3q(1iJ+;CkgZBw3EuctcmakJI* z{pu$iFP_y!Z{%BnWo3UkEyU+gXQ2sE&i!FWrtj5-OA@_bzHA5~jXDdn+%Ef67@g^3 z#NS!^vKS0gE|-6T%*o8=h#8>!uk`qTR8AWOdLw&wR6P#a#t~?-V0S(0lGgWi7S|rp zc@KFLOHUTx>vnL`!V~2zSJfrVi;o3ca%WH`R@Fqf1QEpFeoD&lM;v#)FeCD4G!IcI ze0}W>Z|78>#_$ z@L%<;WNO(3bx=?3I9QD(V*~`nvKSBUnpq{G_}?U8Nx3J_5=|uEw!)9?NNPJhrjr&| z+yhs+k3AGJkXZqY&b~vG`2G|HfAwSqA65U_JO3>DbXFCEh+K4vOEKK7i;*3z*&ld2 zIk4}f_qXrGE8KLlsoKdxT@g>(TZAijiHE{_|Pd?-H`&-Zf`PeIJ?edKx`X zER?`zuMGA&_&Pbj4BMLK(4icEsRSIbvVs|k zsR-qCiv8gq0RcA#1$!yz?PG<*;n_z18paOc9`IYdQSO)4=GT5UlKF9qVk>*a;Jzc~ z`0un+f8*Z@!Goc?!tAG3?e|A3lE@dEToB`u*x(7?ybJIEG-tM5lYg zExgD0w?xdEk)!$Dxx(lM`IW$oVv44(FS{1nd{097`&BX%`i`AQ>&w}yG*r9D<8w3N z_RxSVWC#(5SbXr89r}6e=K`SkO-4IZ60SOf6G&j0cnr{EqHV?1rE&dQV_HW~i+6}1 zHQP(+(=6GAkC@v%hgbOgqWM8!k(3}P1ask`4bi@H@xw4GS+NCIyt#3jYTRkM?J+Y{ z)$7RyZDi9HcqHqo#%HG+Y^@++tG(MnVW>y5x(7BM3uq zq4-H;89)xlG3%g~)ro_OUi-zEsM+QL0ls8=tNOLt;d5Xy}YtwH27jgbS{No=Jr~TqFBPcQtac}a^HAugJXWsO9(ka?Y!o!$zfg*fpy!-$1Zl@WcNRasD&OIe)w`EbV=mb`Rz(abV3Vj8liLmNDV+qvUDKv=J2FpfpE+ zmXU*{>pY5IJwQ*MN1R3_@eXk+XVE+{Oz2~TV|{tzG>OinDRpIb<$_bttoPib*AItY zM?}t-uU(x`{4~vbY8>zHKeuElCzV-tBIEFz*RIGw+@)cbKj*f1^2h{X1Vxya=(^rh zKj*D`FPJ&`Z#x)*WibxF5b*^KMHm%SR{+J0LUL2SX#eylFl)DFsKxOpyj`Nm>1k_u zJw0E9ZFC(x>RJ6fO3eiqBR=*duSJ6dw#Px3-6r;XZ+K>I4DvMsCwKXp%IZa=Wql8? z3r2C!Ly;q7PYos~7rte@(Q-;Jc0kW)Q6GWu{az2wOomM~N~Ce-5*SPrAf}98dS_t_ za?`-U_%k}t^CVtX69qa=j^)L+bT^Bi^nn@v365`HnDpCse@){br`Zl4t?)hZ=%Aq_ zN8D5YLj*rU|Ji-++H!g@8#^a#X-WM={#l(XxcT~ViEbfbJYX9?SPw9u{WyTv{h!FW zaqBWEw@R98Y_@cXXYgXR;8P`s&GR&$weC0!x?(hA9u8I~L;>G&S(Kk=%AFoatLoQuwKi_sd8}$(oxAm-6dD(_ct)QkYrYMXgjJe)py&e_pt>Ki| zlb8_d(ChrPioLQ^_0@g5ilfSr-`qi-jZd8Yu`kW{aAcNaS{p8SA(+`xbMjs@kSpHk zxg;N{TW}38IH$(>cTLIO&-(H&Fhh?{_%E4Gx;q1Z(E|7-U*|oxo!grN8>{>HTs^wi ze;Copzwdl#p!j5g#Kc;#DrmSuqk$?I?fgm%m2|t!%ODvE=UXmbxy!8vZR4c>$j?H}nE&v_ zK3_j2pLX?z@Rcann(8|87eLHw^8&Jzx|@EFrE;oJYT+Jj`fjjiZ;RRDj*@9(nPPFh zbdYXi_u!>NnF196NyLFWU{a3A{fafGLy-&E&@cY5kzX<2MbHCw63D|l`>N!n@3_v- zI1T2f5r0;9_@S%aUh5$l@Kg4AFr=0}_J7SfSG_Ww<(N3tp37E?d7|3%ti?)XBxS5e zfS-ZCT9Ma<42R-~$AiF(2rN0(epcz(j5dE!yN`BmdS_L&Ch-=AIZob2aUCR2R||)5 zYUqC4M51{(p#bWopo@k2q`tH7*~ZZ2`$S^mR_F*f_VwrKKFQ7DIF#^CMyU%3#KBRF zr>0yHn9~HsGBpri+6gGsSUvx8GQ+Y9x}yS0+h4$3yb>(kmKE{;{bkDbU(zp%kTK>& z5*2HX@6shzRctFU$s>w*3V{RuRJCgV zf;?1n&?nH~2sW^61eZ--Ny4fIMkC^mVGGD7oXKj3dWR1cQmF88A>RMN;rTe#{&@a1 z=i>Bg%7gy>3ye^*#b;@Zbl9`LSlzz@h6b#TwQTWoc^9iZ9u%A^e1f$j6y|`f62WE* zmoW<%VP;4EmX*D&hG zuuARjnX0mVAG&sfrLk6lbLOb~1sD(jA11Z`Jx80wps?F1Ut%kgPmd?^u|~TQT4^Dl zdaGtq49=@ITS`I^i)>1lh*)Qpv_@bXzVh?-EfBYxt$G?liVSoTg@H zYxOE{>Kb!7@NgqA%iEXYv1r>trFY+omZoYk-vtF7;ZcRDiYWNrF*WBa{Hn4%f)Lw~ zjF^GKFu}kSNqd_DJ4wHX^^2yggeETyn-q zJe79IdX|t8=h^F3>^{w;09JRGvnd=?#^Tq1?SzUWFxA|=1)hv>E-GDXe4lb}ccrr1 z>S}7xoy3`6s(ChGra`7ZilwT6MepBV1#@Vb$30BX^-I`qD;zaa)ZC& zBkv*w>wjB)yiGxm^22pXSQ##obq23~UUO~rVzC+(-L=GWy7O8&*jYN8q(KKfstS}< zK3MSC+wabgTEfXH`UXUetwcR)G{G8J@rSOfgK)k!Xp&<%Bej(i72T&Bz#-?GQ%Jlg zq%?oq|E$y+XyL}xk!@u5In`NB@dU+LYAdsZ)T<8hG&Ctt*(x8q&aD_7v2~X?{4BJD z-fb7EH3a!MG>L6hz{g#~zk8%lb>Z5zoHnX^a#5#?2L*x$i_*@22bo(k?!FPBEtR@T zI!E*Py!bCb<$pb~hB7T!O?ywH{PjsE(!%;wW3JWR%VVxaw(L;JQ|wzYUK7VHeq%G* zHe+!qoVFjfQV#EZ*JUm3EIgEPd;qhrC91Cy3HB)I=fB4^g-oabLWJn zIqlV2WWvMS>f1lqjfMXn`?vxmgqs!Fx|v4|ppR$I(1?`*wNKUe8RrLR3P4ybvXImqAs)sZt*l}Ah8k4TZ{%v}z7 z7dEwvnH~|D;eQTIVbE|X+X8PRa>r17&c~sgAo+U6qcL>r=~uQ8mz}gnKdf>zrCKz6 zCpK9$@^vXB@)8H_{-7w_K=MZl2Z7a?fror+vwrpF^bRj>1MVlyXj~sdA(R2{Jx_Ne z6&jyX@5P6|#is>FaiIcU@~^lLZvdV2+#rYx%Hl-;3iw8B#=UAL1ii8~L!xd5A@Kwp zi0f}^Q>JT0)byXFF8T;cy513#dkRP`45enq$aE|}&j5e6c5gl(-=TQ{X;K*Ls9zf2 zr3uM0DfkaM_V5`*KZk|Kv|$ai4Ha({laurJWO2Y|uoo_TvpK%<_bz4~qE5(IRM?jO zCeFRp`ud>H$>irpiVGG6AeCJb4JqV}J1UY4!dje>*v6Lr2(QlBc{@ z0z_L>7_G>JJfl=sdlxk--x{j3>O z>$xRsqOqGN4qb(-zB8e0uY(sb16IG?(^TlaUxZb=h8OTnb9ZyioUT9kGEDWk{>Ou! z?UaGv_lpI@C`r_HJX-Nq&eZ>Seb2s7D+w`!^C5LzxCZP>X>gJJ_qYb$}+i08i+3@LIccNKW$%6I|W{}hhA>{y_6 zHB}V>PB;U{<}?&B0sY;89k8AK__XijPI(G;{2&i)vVO{wyupdT<;@&_2QwPwnm))d%Two&#tmhA7e(T(ok)ZDAiZx{{s7Q9 zz?Q5oiWBHTLts-|MGMSz&NrukoAW_W31R>u4>Qv%20mXZ&P zUj<)^e-kV_zl`JL8P6=K{`ZYrpUWqk=~YFIEz2$|_}vHRo!ba$iaGJxHZmI^GG${K`+J>t73VS>tEl^$x4S5f7dKxEN(nGBKm-#bLiYK9-I z`a5&By7)CJ20yn-k0>wt)drr#ZJ4}lU*YE*qd`oi=}PH3#8%}W`gLs4t@nd#Ea;-5 z=QStOQ>n7l0@gnptB5U)Oo5RhDV|gy4uTZ|1?PI+7|YLb^so7he9gsu?LwO*KiTud zF^p%xa-~(SU=B0KL+>}U4ECUTbgSbpx9)`|&J}f6^&&4ZGa(J0mZF?v2wF6^=jH^L zN=)LnVuSJjd4d>Eq|R+j-nRB-wd{uj<8U^)6%SeJyETn1p(H>ac&jj^irEp!5iFt> z+2#wuReLW<(py_-#Lmo&i^hjpb-*Yv^ohnJRLdH8uZo;ic>o{FUbMk43*JN_mU5^0 zqxILW*|1V82`@kSFNyBb!%u|EpP zLO$-XVdzLi0^792b7YP+3!iV8kHgd23@&4Y&5a)jZwUKyO=!d5TP~iV_=>VHZLZ@2 z{Z0+89nb_JdmhCrtaX3uk)*(QN7YBQ;~X}y7w&Jb~k|V zxR^+?MxyeMbkig+HDt|w?+Qq*IXoIKJ}`)utMXR`=`HnFQN`aLiFOQ$_{bw?Q#mL|Aw_W9eA27-~V z+z8!wo>Dzgw?fwdK%ZQ{hrbayeRxUhR;7x}zplT3qShs7Ycf6pd(*)if>+y=wg z6tcycjkIq8gF=G{@sq@85P0X5_bxstKycrr-XqGSJ?)-$Jndio*#&%N86(qC&DI`l zOz=kV)#VQ=JPyY#53E6EYw8_+#r(da=c2m z74~Gd8ss`3H}h1u7o?86Sdj)MXTaCBFbwbb?G)7Xa9L7ANd=bRRTsC{tzTM4oi@LQ zEv>|#!2PF>e`;b63$PL(Y{x1&d4m5}Om17}yvJB7;xt-%8dW{}ieONA779t?=Rg$! z6b<7AMoLH;jNpScQ!86I^pYB1LqEo6Kmb$??E2IuMUB#rzN#2h>lrSoJ=!mJXtNSD{f1*4c1<;Jbmh+|c*h|i@_9EDF`cgiMg&5{ z?ma30nz-xPGfvs$UD4&F+UV)v316A^G8Ka`V=F)KRY5J9Rxc{qm|E6YiZN#p+ z5*3SH3M5o&NPQdK=7Glv+?1_89^@{G|87?K<e-ekLiZp{;p(cB~x)O_483)Dw4;PXyWbW2?|7G6N6aI=`P0)A_aR)EwnepoA(yV8 z`wN8q)ACb{U+7R%N}kE_&N6I1vRuz^G_-%xYKcyezJR|2`}5Wj3D3QQlT}22nLrnq z;W(&lNyr~?;U!s+@7JAPj5&L};c3s+XPVug?vdwm&b>Y=)9dcq6#r0i!tKdK|73D5 zRZfZhMeM+9f!b<9H2W%nWjs&X{|sRNa4hO)x`L}|VQ~18=|l5TCtMT2)Y*uCNeb0g zttgP32LJpUsxg!SHU3SLH3b>!#vY)y{(8@k=JM0h*Bg$&o1SNqp=l?D9ifjTyl6fC zBs`&1E=Q{WDV9j6tjZ*`uG|${b65v9rMNV4!=6o$FaO#3^<7gg>ibIlNUEkSrOhe&=3f&L4tIn4Z#`-t_?IA zT!I953r=v?#v#F-;L=ENhu}_bzjyC*&VKhjweR=+Tvbn1cdh4{bIm#C7-OL&h(`TE zn@IFY%K}iEr!vP>g83}3c$$Ul1@70OdC~fTbgV3HfiWu}SXUWl)YJ0b&(LT6I3a}B z^5JLxgI4z3eUE#wD0ZXe9?Nd?$$p(^FedJQlOcdu)AqbNtsutVd}w-L#tP{#?A+iio|X)t$J`8N-75<*s#Fj7iK+$YZ> zBWATfu#+{IE0Ft^Jke~Ttk^LQM2b4@aTJ2z!B??n8Y+p~r^V!pgXF_ztM}|y$e+=K zebEKCEjJ+^49|omo*sIi^PN?oGnRxh>HOk7kO@xR9O91b)`Q9@JA!2T8MYs-r~mx7 zK~0c*PJ3Z*=hZH|n{`ZrUcAN{NDh{~&wyU=h`!-6GaOxFY1D4_!${*OJ?w68nvzWz zB2{TW_>5eMu9pW1(e=921xehS;}Bv?qd7&#I#)G_LI{|`*oj?jLA;~K{ZgIE5i`p_ zU}Nf}Rc5Jqm>cJzb@vwAY^F`X93;`i<91sfCW^=b@!f1}Y`H&Z(ImThtTvF)yxHRT zwAA?KDiEYqg|J{v{ygG-IDlCyJ2-pC&mWL{PzQW$71!&ZnAbt`t@Zg5WDz$c@ z=XzJ3Jl3{CmC~5t3Sz0cQR~HsxBMMiZd9Qjd@UKX33w+@0>CdI?rW02oE) zeQbEVKbUmw7=0SBq796D+3~w1w5rcm)SMriKkShy_(|2qI#ls$k$5KFlAHwKb^@dYJ)g? z4OyyvW3fJaa4O;QJ#W(y2Sq<@ok+|qo#Aorz8eL#wbohkR6-<`a~iBcah_u6RQkL0 zb3byf9z_SdAb&BH$X54%95-&t;m008Az{RtRFMI zFm55;`bdjYHipFR*TpYZ_QHHVz2sW0#N-{XoV3_=Apv@CUv_J0-W$=+6B|>Htp8Tv zmVZ3k;^S}|p$zLg#&Tf@3!h$VBAErUH+)enrJ2oNi4}*F=xyCa?uEng!JIVlUuIHN z()?`PloIcYIMD+Hh@<6L<{W!7WAm4Ss+ixj(ea_>gH>|#1uw?R$1yCSgL4#gV8@R% z1(|v3d*`og8h>xQKAgIz8Vr&RpY9yNDq?&lj@Kv77Gw6vEx;E~yQyA+ zAZ4NdnX~sduNHO3sZ`c&eI~8oEViQ|52KnniU_-FI|y=)1u6EY<&bd*A2^ zU&cuX`vW@^J==JDX!Ju$Goo{_W z#40H~6Y0)N90bT(G$a_P9V{d4ts} zWtA0JPoqO6i< z;iYtexiq|6yx|gPGPNEXNNwD%j~^6Z{oYQDxw_;9Y9Bh-WFqnLhrv5CjfHu z-u%V+k~p6RL+xGKeTV11O{7?0Cr0n<)=odaQo6yf|s{SM^jia$f2q$c7x#Rw4$mp@_9z!Hfl*I>SMuXshNsa*%l1^Q5mg>=_qbtLSD^#&2c1}+Hl zI_VcJX1&#GmS<>dk2Srx9Bgrn8c-mglm5`J*4A&vw+>)k`l4b(-L$;?A-MIVM~d{A zdo=P`Ny=HBKfWUu_&A7EV#cJR*iZiE^P2H6453Ry(3|e?K8eDQaEp=yFv%@^ae8mO z?xpPO#IHRNdUg*MF{mBN9{nw|=(%P25HGKNMrMLAa$LL0)4ltq=$)@@Vv^R$F>IS) zv9{-=Jx=A!J(p^aqu}y`isU3dZkEK0Po^!ydbQS zjX=3`s99ATGexUxQuZ7SV`};j+7a!J)cwuOe(AZD!&T>V2dC!Y>Uki)rD}S_@lRrH zc)Ptt87(!6lXYP2(^h%G!7~I*VyRfTHam9o?NATwf=9=m$kBrw8^z&UduuWn7*FpH7Gv`=Ga*sSWPlzKwdKw&rBU~3;J+;yfX1a-*8k<^;3}x z#HK#I6*qbskhze9XM8l*&Y1e`VnHfw1{hC=YvnmtWLl3Ni+zpX5)o65oIMenx;FP-2 z%$RM$+|WZIcX+~WJJ~NmDK5IS%{}UcA*{&T3dVEde5qpQUc|hv9H!m-v?hg#Q9dsY zwTmR_U)1#Yu$8F+?F}b<9V4~<~ zzIP*!t8;$aY~fY%Z?%)O+vpcgkqGaXl)-5g0zrh-vy&fmvWBJkOor6TZ_DNEG0Wa% zD=@NLx*uSkWA0y9DJx$*kX3;ij9Q|elGRIv7HlfZpyXvi6w0OoXMy~4@*uV9yuxjQ zGVjKxp#rDLZaWRS^~Qm*+HeIUcI1bQog1h-(_kF1AXkt|cHV8&O4w3DM_I8nih(fa zxShb<^`*m-Xvj#tCpes|)E`#fYf=@@v~3Jz@7ryT+vue*trJ;OW{p1l%n~d8=4f#W|w@^0)ekP|V)A8pykc5aL%qtbl zh~00h*PJhgTA5e%lgr|k{-A+a+&EDdtZHB)#wjw{Vfac4$jH9oJf*HFS+e$L>hPfv??QLlje8Nw^gczjf3zlbbGRAMMThHU%-ra|8tY4h6BSE@M)4c1OuMpI z#HGLeoAph8N|1u}>mq}(x(7w#sK9}^oBC9v;QJCslq@(Im2Gx2rZvQ`@AC{E2!H%R zyTvmtQf*s_aEbqehN6x&n`Jh2b|&p6-6Ur;YN7PLI?8|0oPPa5yNlpWh!QPhzO)?s zgI50s?ONMP?U1cU{vls%zrB}psLPt&Ao3!y{lM9I*r(HS`EF<5REavQ0ZEQ=vmIKO z;Pbr{6D1d$){nmpH&{(ueo*vD@R7JQxg9V_eVDX#lTizVHyzY_zaJ(KEorIM&Jq+a zrhp!K{>Wtn{5&|gW?kOB=H)yOOlj}d68RVQEWQ?C{&1Vo~w9B)S)A?DO z3&>BCfJA4X`c?2!Jj6OLoq)^nLX26ssd^4B(^j{CNkLus;6$o=Qs3s~K$USD^KcLSR)sj_lw=sQ$zcuE;+%PzTza?m9`oZLA= z3dTC0v`RVK#Of6&|;7da!UMAf8fJ^;Ib-p3e~y8*svKQWHhzn**2Ne03~Cn=m{jCxE( zbxadGo(DX1<$l7rpSmpWUr*E)i95VD!BhH>%2WLw0;@au9S8t*{ro>fg#LOg_+}*V z)yDVOveQ=_Rcx$Xo!uIqlKP8uD#m_876K=lsmjt4id9rbwp>*BBqJ5mL zsVl%bKrNlMp*b@GZ52`p0VzilV+oyLWpRl}eHRf~Y{OS67q2fqLU(O{Wjs5X`gT}g z-ak5<>YOAp7oFrx+%8WKHR_o!pZ2f_cJI$y&J8S*(ak3_HD%t;D9y(D`3KEq@82@5 z;%U3Gh1Ff>aE5GNaAQUY7acZ?Zx`CF92vxLM? z2GkO8y_u=J$btKU%@a=o@ut$+EZ!yYAMBKtArc*MvoxzITTainV1U@XuCr}CeinWa z8!g@^G%w|^v;P=z{-ZN`rXg?aLx*^vp`mM_Epa zF+!Onbo*bB(4Zu~+ziA?`T$fN*);I(u`CpY+h?LzQMPtpP%yUH>SxFgmMIUVFZxjR zX*SqXZ~#CouxBDt#t+3r(a}$Wd`Sj%!MjF~s=1{&c#pyRUi$Q8WZ8Ax%X+;lkJ9F; zMO8>Wm8C6Ok%meGMR zM~23*iz;ZYZIS6cml+eNiOv#?>Q~~HrOt|!emw1srdt~?J1+Gg7%0Uti zFq>`Z8*o^al6YK@?4^kMPO@3v!QZoKN*C$1gwD=%%u(av%fM~hOd*b8J-{o`K^7NE zx5J{Y7AkP{fu$zm=I881bpG@T7L}apcz8?f&RCrf{`k4>GHda5{`H**sZY(Dfq3rx zWs>8&TX%SK50ZT=>FWE^LGmDZcm9XfQ)~Vb=QeiVyA*p#Tz@GTe;oh^BrlJ#Iks1$ zRbpP~{j$+`Iy`&i9b!Jqz?@?aZ3$EsDa`d09Cgr-S1LddnQLc)vW*eZSl;Cr?7OIQ zFyJ)S#3jZ8xdn5Tx|Xfc!X}H@t8XRh7!&7Jb$X@B?p-(Jx=u7POs`*3X~8+P&aqR3 zZM=V<%m@zJIEfTSW>+pYffW)wDp=^gBUj!_^t#_#?Z=0EWhw_C)(1+$EbBFW`cF{F z0NLl{(N6}l&X~+SY8{_1D?T_bzoRJE-kt7$@p!1_nVD!JgN@bUR3hF4eM@aOV*eV_ z+VLa!n4pjm8#0b70hWJEulHrTQFe-|r#FEfBLa|GGo!1O&DZjXt=Yt)MPy!GPg3`t z72C6H33;{QBI`?{3L8w85BgKRB2qmX$;mxjo$OfH@YFE5Koi(+Q@+>$p*prcFTfwP z9`?_tG^qn6tXtH`Ls!}A+xHoK^zLnZK}U{jQc+i>iK;8lQn2^quQ05rB7Ly|v@Dw0^kKUwtGaIKPcbSKmbqR;F@Ml%Gv}3K zJ-?o-+cdSz9eJ$G;MP->Z2X!i+|{m@nw6O5?dAX)WEhBR&N*}gK#`jNxm3+d8}=O0 z>bp9{`*D(gJj2~Q)DXv<>fuNlq+Jh+C5jh3@z)r5B(7&$?EG@8O zk0bF^4Ie3u6nM%l4F%~bAE0Nz!hZ#~iL;V<_P z(()Z&jyCA|Rhf^Jh{Ori#n!0jW~vpl`(h0}OyA&Y8PPZN66oRDa~O1J`f{jn#mCM! zzJvN!KH*(ke4b;YVU5L!mBS3VZ@%I9)Ycn?JWg{=e4DCHVG}rFig<-!YpEwB7TODh z6YJurOA8R?NU9Ug6vAG&k<*;%{z}?+x&LULQX^o|-f%nqdTssX6!2AbI&U*}1CV4%CQ46+fzqE`SZ1ksk zpI5?0G=aZ(^d($2a>z{Aapk`E)w|F+HLvl6OMB1OphB{zIVDOI1f0D_8=APHIR}P; zp-_XGmf6hT*a3qt7@F$I09I-b6N<1(cYb`K*sSVGv^n5so)#qY63n|2R{c>YBfe`6 zI19`xJd`=51wzNYs&dM%(EL4L4S)Y}ow)ZzbYyPVVlbF1SDadkthE)^GX5Q+kwAbW zkNI5IAI~wIV7stuWdVL&?%1Y_V2=QsYHXGzUj5bxkq0|qz*8-FmYX_q`Klq+?eJ=) zR2Bn6xGnzHEBLf<@1Y41r!jSXjjgTYu~v8ig{7zphU(8CR4>bj4N_YHC=EnTz8k;V z-07RnFzgpt<{cS}?+l61sem)EP7X1XJ4hD|HGDq!1aT&*=3ghWzTVAwy>%=tz>@O% zRW6E7CMoR@y~l{^*jy!4Xj$xxKSucdn#q~?gBB?E;SXBs?bC|W_DifogYS}2+e!?z0){urntJVh31;P1P^pfwud$X>sllp z%8`;UvM-LcbpnqGUe4O_T?zU(GIKPwRvT#0G@|+ zhq`AdXzxGvP`*_v%PV^P&PCZ}5%E=&gRdpsgfK_C#W_a#MdmQpBVTh*EqYp?{)xbQmK-GzevFXGVYtH zyNX0*^&Z=tqX&W#<^<=LV^2%%0GvZbnq8%5nXcIr)K6R3jetJ6JK9-k0zo{vhCp@MnAc`yPwRASx}CWE;4cJwu5FwsnEAn&e5aLWt{FNHmR25^v8(=8cUTv8snq z=TqpL3FZwN^)pqB(J1kz#;_Zauc*>F$w9LM+$h(0QZ9qr>P{!8kdsxL^-0!LX!Xle zgEwWf2Wx#TJaPB(f6(k0?n&hhBXwg|3X6TH#vV}4h|C(&A*7fZAAf{Tei};!vsaI! ztIQMe#OKj}M;UIDT;#DS8{xv5jpFkN{zkz54+}|AP+g{I5}ZxfkhPbBNka;L_0kU3 z)F3bZdFWEKt5$M!`_`{w&v`jwYAO36`^3pGrJc}ZuyUzF{&Tc${KvU$R^8ra?fe48 z+DtZj#OOX+W}SKHWm)m!1$O|VA5`9|+(U1BUOcUA<0#N~6}X3PlC=OubTnXtjD6l% zlm-OuZGTwv(Yt3G^9kJTJfV+{U0g%JL@Gz7^kNn zM)>Kh9dg+ngUeQH;>V;wB4`5GBRT#Jk6CX4N7*;K>b&UGtzfh!^k9zD;7F0Epg4YU zKlEUp4Ta%t{ellCF5fdImTG;^v>x7CG!r@V_#Azx@erLOG*z~_5Lpx(nnX(swlrbM z#*LxnudNN8wQn>S=MQL((Vg$*E{$*m`@e7l)b-(sHr#&+9sYqO@%wTlL~PIx3j4B% zqxS>(2Q61KGcE!*{gU$g%3xz*jU70#k>!dzAI1%hVXRelB7NpI9*UzU@0478|I(E9 z_CS2xxbGrW1Dv+m;uWcTjPz*hE-S%Fd*`-Fjb+(iA>!5kntS0gr`IcJ5m_}chdCWR zjM(Ti7zf)_2^3OVk~&|ko)^_H-kR_r%c`JBydfM|2fCyuna;15PGVzMiN-VNv$5qy zPJ-U=nISup_N||E9&w+NyHV`~E|E!VrkgDTZokwQqrYUVOdMbRnA@-#-*CKyd$9l^ znbGeO&ohX6t6QW|Vv9vPdvMV#+HvmExIAb4dt*4=?n`AZV;!H4p(d@yiZcV*VV;HE z2J5Akcy13ec|kK` z>Zr3!LSbHV``xmt~Ay$Xfe@AKYpvbW7{NBIDIisr3dDQwN0GFgJC3?@sUfb z{632Mm1X)lj)I9~(}gY?n&Dk-&}=~<=dhb)!@|c=6*UvYy31nFcd3w>;OGwjqun!lW|9C0)(L%{L@`E1_!3yghT4jZLf6cG(Mol(q?@ds*aXr5aC{&o}NJvK@

vM359>@vt8j)}t0wqdGq z4zNe3lB_eRGWf0IK7fDW1=54(u~@B5MX1q+XH>`u_!@TctW=cy1rDa_ixsM?fODV4 zOEPFd6FS7bAsy2{qrl{dCyVjMso#^ z_UGzPcQAbSj19Q!HBlg21>;Ifl9`d2yy-bfT4l%!Y^!-6Cc5tM`AIn#fqb1nPJ9F- zoi(J7T3xAs<{sOaV=WEn3LQb59BMCVGBhQ;$rDg@jiW3w6NXjGbB!iOC!UuV$&J4+ z5vX4{bb0$~B5dvQ@_wD|*HNr`7Yy$}FSfI{@)keS@vp%UJK)Wy#MOm9E;^CYJ)R>{ zia_{Up@}Ods_6q^!x$MD&XjthRL?4CKASMDk-rz)yDhj6Qv`s{rvEPhnD~>X*bL~( z2NvHaQqFVY_rXHNQ%oCu`=AZ)mr;PAB}+HFNdP_rfR)By>E`pVnb;-|j||~*;RJ&( ze-Ttr@LMTc@27U1eT|Tr!SIYK;8=R%H4Mku5HYTv6HiORvQ5QE8+V5G_3lB@ICJjS z4%I!_-IdTp8#V;?bUM^804oi<6Yw?-Vv#^T1Qdb=8Lv)f$R&~xds445Syw+~e3SW* z>kO1l?mhL{mIvxL-g7UOIUEt5rVPJ*4p7Rwb6-V<()Gc714#K+G*{omM@L*p{gAQ* z4ZyY9i!0u@l=Ta2tj@*FZJ4rLrOF65_Nlu=0T1OE%C8`We@5VwBk@jUeI`2-h zoS)f^@#m6F^YrvM)(;mW0mu@c$38*i;k!m1A#`g8^)sU#Jared_$}YEYcU@fQT>p4 zp6BiALCstCjGG%ff3LOtcOA=L^CyYd<%?li1)xL^0hF!s47SP>8GlK$STHqx(v40d z*e4Z!JRnZLO4kgm!GO_d=GsQec6HywbXBB) zkYt!xEEiENWrb;J;w=1%w|ur$!JY#gp*+OCP+%BiRxj)b>(6{KRUg>e?qVEsS@8vi zcyL(L8=L84s@?LUw-*^|=jtQ6s}=5d*;>&B9&c1m*h;}0h83lqv#aQUEl9$jyHa`B zzoB?V(kWhXH=LsU-QKfE?Jc^6T%!{|h+bO{B(64Fzca*ENQzFOqzLcHWUlCJY}WkG z#|2pJbJgvtFFgw=8|uU++}1?QR?wl$u)fIsy<#Ms`2xTyPt!2dISu%l@yuCc@N*^8 zvwD244W2c;vS4uluvHh7DLE%EKlZo_hyjJD^AUUwu55OtJe6)C8uM&g`Z(LrN%5K5 zYg#LgL&~B-&tHAbmw{zZs^cB1nnS}Gx~Vk1rhM1+sgiEQZD9ge3T{@KBfKlfTlr*B zMY2yaDv&z#C-a85iLY9J{1=Vw-xwDE z1uDv=@j_}2dx-!emNPKqQ-G`=o6tB&}c;ntg?S<3N}q(Im3m!2C1xooQNx5)T}euNsaD2 zM%LUh(X^*8ETBXf!{WHVmkR`eeT_FX@MXKr<^Ds#nVm(Q{dcwh%isJDWv{$oV6e$a zCZ4RB@ff883bX|on9!D0+c-X$1m?-l-tW*~ez2{xxeT|@Pz*z7vb1opf;lMkfz6DM z^$b_%Q(3{`KwJu`FnNkG9N_}T$(_0AIxXA8Ya{8F@l!{;BIPPTp{1Sq5h7UqWZ_T2AO=VC+v@=m=)He*fO zd?a+EO{((XbS?Ld7zOefAf+#QfS;zmv*?oCqDaDbTw|4FA~W?Vo==rsd$+6IrsZ{| z{md=t?VYB}gINuIw6JE@gK|J(8Bwdm;D?+Qrs?L}n1yB(H-m^WWgc}yjQ!>F{$K&F zsZl5Nabh%V>@uZ;ZRN=!>%~OIipeEqXNCRHHRmRSjV1G%D=1@^Kxc%6Er{F&6m{v)aRI!%DnGaz7U#o%^#{#p*(daHdFbc!L&h`hp*zRHM0|yo)8Tf; zJM_tB8+GMiCodbGhW?MerUbgA^^u(XpDne za`9qUlEe6Ti(J|Xu|6ftyCGCB4WX3jcySyRaDWZA+Bq8j9MnErzr5O9f68+=D`0&e z=JkM5<-dKWa1Vs*-3Bz08jvg>T_8KEMue+6LRc}GztO3xIW^zvMW2qcwHvTr-}t-d zTGD=HF7~q*QGKrSf$FUf@ONeqH+q=F@_>iA(uxqH@bvi>bPD!~nE<}^YJuaWr`W)q z<&2DW1cyRud{Jb>1PHG9tu~kx5??ff9~3lc4LbKcn2UVDIg4Ko+a$AEp$WXooCr^x zhu#x3%ru@_uU}FeoE@g4{63CrH?R?YNsZQeolOW>A)Ni}p&}UjAJ%EnAFI4%mq>7q zW45j)Sy&QdIOf>UT-fVVK*9FGgsyIQ3CxCUbUI=nrCRGV^#4_KbMpGY%3-}(*i|4j z1L?iH8XT(+67lS&*nb+crE|hUpa;;&*X-9iq>4BCdPZ!n%B%2T3#t>Ew=@FQ+6dLtJ3?3o9n`aXlf95 z_jnfGF|*S8DS}G-}IK-}T$R<55olumbM&0-rno$}CfNkZ+{KwQCQX z%~{;M4WYqfa{CgQ>FnWGFA_y9bbVikN_G1)S2@NrED_y_n|7(JQh2S0*#-E@j{5-> z@`sORad!F3w!Qurc^9h0{y)!GB;@Dz9gOw^M$MLbV+3Xb##a7;c{uU-VA$iVJODsm zb9cWGrC{{38b-P8;SU>!(zU|AEEK^uuRz}_*Otbq>`g943L$6ZzUk=Y1<<9a@xQDn z=3Y%iFfr&-%P`G)b$e6ZC1z?d8;F~w!Nq*cVOKXee-SZ<`U;Rz*Y87t`L50wuXs*@ zk7!Ii0ugtab2GgMrDcDkvi-GS8?_I)3c!BzEQRoaF`?#2)<71D5;oBpOsOpWxP8tx zWMF8f@f+*F2da7l z_+^HgW9Arq1}DwgYF8L&1(}p*Wr($UUC!5OKPp3}EUs1h{14i=t~{yDoEv8+L3iF_ zx!SklU%|OgT4%)QxTzv*iMMm}M2Vh9XOynu15>+Qn(K0uOxb9Sb{vyj7Lsi$wY|ZI zBEP9;Ddg3B(Y*aIcIBDeEYEzb5lo#Sq63X4BfLGFnen7)fXQwJvrK8f*X-sD+1Yfn z@QnF+L$J_(v%|w#M>fPsE_R&Uickwy^Ogox#F0q5(CU-Yh>@$_1Fo#9z&iwyfE# z&!E@g`DHiI+KnzuwYB5dP8<{!q=LVwjH4{yWRITsCVDgOX5PN+Ht4#fSqEGt75nTP zkode<@QE(2W5EjS6+Y*M4Y1FCn`I_rRon@&t6p`m4whyTuU}xhm-P_ab6dDGY^#19^(v@(MzjZNHCw8wUyLS~QP$YjN;jXPSNJlaqAG#%11o$7D+ z;#lEZj9m?5uUqLLli4K+p3DBATn#cSUa+csY5gV1nsM>OV!JLTYt4Zk4un4V3RQavMm$J&`)ttc&l(N)P+ z#@bz=`t*cSd=dp{fMiiL=%(Z%YS#1X{ZFF5KV%&(NIyCBAkzl#{PdD6-!yd4s^gr&8oa;64EbhVC7BO8kN|v_0fd9960Q?QMOqQXzaMC4A1GGON=EykaKf z?i`i-NVos>7bz}hSpv;-xiK}9C~--)w}0E5R7IWvQ3MohftgYCih|j^_jd2{oiz8| z(c}`jp(|~}$Fz^9&swScgB+~=v^m9sAf7)kB$UuS?;rj9S7lo}(Fbgq*Oj0>SDBp^ zrWRi|XhK)}*B>i$@L_OI@#~uw6L3UdBT;CZv#m$ylk;}YOQ{(64u+^+QC+AuAY}Yr zNg`x@?RfL`>_bkkqh7ANZ1gIyk-qh=7U^jAC>Iv`P_#Ln`D!=D)``vBLx+bT{ZaXU zjFTY2^qa5!2CcHe{_xMBs)ZSA&&D`io_ZprEeW%V@?Zf(WP6{6B;{YX_k$uH&zLr> zHmjk0cb9k0KrwUP6X*UXVOkXMTs*>fMj_G+uY07*D(G%TWl7QgFqg-_`b7hpO+dQM zOb#;I{aYh4XCbBIQx$N~kRY42|4{gmJPz9K)0tsS(g2}AzEz@HcH$yd3QU^9*X>0h z2xi_b8F^(JZ z8+$+ZYPt^jIkaa5?)pH7$`m1SPf9QwvT{7WWd!wcH-&acrmT154HO!^G! z@?@)40}k2SxP{@S46H=5l1B(q*V?Q?-yC#h6^)cZ0qF;cZo^q%^;(ZRpM2y}eEqF6 z5PI}{OUN%v*_5B$QW;qt)JMVdgnGjMoT0gt#{f>vYc^kid_fr!qYOWLJL{@up-!9! z#-2kfqD@Daoi1|v|G5tM)8VCulDJihce~zeC@gXN5R}4aykq)hh>j5q?nj={JeVaUb9*bA>n=v)?9F=5LDG|44j~$OC@vhEQ4SpPSdIZL3tQ=XQD*5E zILDn`xN&`h4XF3X(=QZxRN5z}#v!3M7TE`9g-Ax{1&vGW6W9SXcQecN2l~YceC}O;uL7Yn@pkcU&&=G7A8xoO& zB+)~{B--5w)0|l$&mkGR*bqo7JAOvzsfcVeeAdkcHx9~;%kVo-rU7dDTH4jUFi(O_ zf;PSgg;}WNMmtH6q!fxjdLLo2MWCVqCN|TmW@bU?y1$7|oN!FAj9g!SB<-qtk*2*H ztG>fr#W1z{&x#e#oM(MRY%Tt~;F7s{73=PC)T74npA&JEul5sFl+Cd)iHPun5O35xtX|iDkjaY72y7>>MmW9@$@w;?+fj%yLWiJ}|B^ zJ&FtioaNz2U2`h?`^mb7x-yV3Dq^$7;W+D@TlTHTJefDnfkrH|Ios5%Us$*Ci??lX7u$b^G>t#F=O>8-f zK3C}Wy!`%ZUA3eHExNL=q8U5+<6yQLslH>61>ElZUq8JWwuw|Xdzh3w#rFCg98yx**{X1yEsU_Bezeh>&Cjc!4DTd- znZDMoH?2iupFWgrrQQh z&bS$|G7H-(#FH!b=)?zzx(muwxC*e{#TX8OVw{1Nx|x$?DXx!-uL`kvmD=$SHCXgXs9So z7(@KzKLZiPWJN!{(7;Gr*LLxWhK~xaO{cEa%k4^=*~FClFCnxHYkQM5vVP%8NypRH z=HBk1EWPB=s}dYY@je@E@eWlZKg4zs&D}|Q=Dz8_)=A4NuzWiO0l4X_ITW~{}x65FWN~AgHd~S*|=khMC|lA@@B2WgC{7B zG)Va)G3xSK3pzO+jrcM)c^pt|0)zjfGP@`NX6&`nAQ^K~#gqGZ`P!Z;LGM1>$OZEU z8p(bj6DAA+z+3obci7xE z&Xp#={bB_Cb$!Ud|9kDjV^$LWDPdKkx6bBY9JUS|t7qN}I*l>S#}79!8LgrRr09*$ zr(1pm7z$x*V&7;CT5mCo)|sC$9QUY^9`%MwGHXM=oR|)=eObtVpqO>GurI>L^qZyr z9-%_xdFlJR^pe?{@53NtFZZM8$UNQSlF2aR(-q=UtP@<;N0Ye?d3-sdJqf3LxkRp4 z={udl8^^$kKzgI)pfys)s@Ef_P6ftb#E@yno|;yC;L{iuA@voHdS@V*mG!V}oW99K z7Irci@$&i0g9e^j8#`%&hTEBO-=7VGf%fIBnK1@71|hnf*G{zxZTg3&njD_ze6c|) z^&ieGbEzW`(eZS`Kj#>ZYX4agO*>M*tNL|{D&#hbtQ}cf_>BX!V5}e$U;(APqlx7! zODSV>lTXuq7@g_IN}?GHSqAG16)x6O)eMD%wu#oEtMby8VsmaeGUK@k+~dI}u?e)q zF*WUPJxRI&t2=kx53jpgWOgTpb?HEEGf7;^Y|W7^HF^S>^r-je%=DTR@&bIN3Oqx zdDn=pwrKQbPIRt0e%d`+t==_D9%1O;*VPSKf&+`4C}5fJ_>0M zdVeR@{q|J@2gc78C&_23GnUZDK!j*r-aBH32o?+|Kh5z4u!pRZERqg;`!~7s4z79# zhkVRysS!YLrrVZ!0TtXDbvtB{bga)uG@Ji21;u#(xr>jCGMg=NzRd);RpCoA0nhqD zx4L>!H{WR8jGjt;8pLz|#ktVbr&BSU?zjAhk>$6ES~1@60!}VQ!RR@T&<6a*NYS;kxP?mN)%te`ki=d;Zm>p4+%`(7Yrh;2idd zmJvYGIR1Zu2mVj~@x6(ynma~5eF!4& zAu3czgV;U!`x_JAGJObrSQ6&jw{__acf*$t#_Q-vtbM3dmX4so#G@gJ-o$6{Nqp6t zqGT!75$=8JftfD`Hc>??5 zUbBHYQP-MGK0mqmyf!-D(z0y09?6^D%dbn5THU4C??~Yd^te-1-IPth(V@n5M&KGY zoKOI8VK7F(el(?2h)~%dH11!nr}{MY_Gb?gja4|Wau|2QJED%{t=RgUgZcmfIeE)U zkW&tki;H}PIm7RbiCDu`cExq;_@~EgY1ZR3QRv*^jr-^n&Xy1?IjTg^i!2ZCT@0n> zw@JrQh5DRTI)e1Cn`YkzRj6{h3?loI6Ix%9MRz5VLP)3#iR*$#3K5B3?p@INNrqz`$%;x@Yl^*&7!MQ7``4%onpw zk>Fs5=c62?TfghX)&;^lBN2;g2Y{r3f$<7bUdQfbMI=Oruv&Wxc*p297@zJY1MbM6bUS( zBC8VM-V2CS1I-62YfzYNQO|g_@^3d zi|{p@p{Z{W81PBX#^0+uSZzga^wfo)>6~I>Z>F@z^LoT&x-Yhzv?La31P!h4V~d}u z&%J;kP}VL^o)(|VraO1W_r4e>J>w+UdN#6X*f^BVJ56o02-x0DqU&9jcGV4+l4G30 z%+1sD{x&jfLw@wsSUaCE(hzZ*-b<-Z!G||U(FnaSFhQDh$xDHhyXd+~NhcB037_Y1 zwPu&L@f@d^>CALLblK0Z#W89#Nx0RmCiV}6ri@6tK>Mv%)sf|V!KCpQv}J~(1E6LG z;&e?4zoFzFsDFKE*G5V1OWShUA*x~K`Q?b$7^N*WEFMY;Z%&nO^$4l3BqS&O{n2rq zZribE9hStKe+i!7T*l;I0{O{bVsp1P5^iKGmIWI<`7W(8FlVWlSL;ihF>sg%1Q}6k z#?8?nnv)!rjFXr~*22Cl{2(IITmBdby5iHhN?^p<%XfkZW zXcg$#<$$}-^ZB7|DAP!^t9Lsoj8pbHK7bBnDbH*rT*}zG+=gi6<}waj0AFD~PhepUgq_WO=~-*JeB5H - - -$Id$ - -Acknowledgments - -I want to acknowledge all of the people that helped review or edit the model -documentation: David Lawrence, Samuel Levis, Keith Oleson, and Sean Swenson. -Thank you for your help in catching errors, and making the document more -understandable and readable. Our readers thank you as well, as now it is much -easier for them to digest. Any mistakes, or errors are all mine. If you run -across one of those errors, please let us know, by following -. -I also want to thank Sheri -Mickelson, for her work in doing perturbation analysis on bluefire and intrepid, -which was used in our initial versions of this User's Guide. We also want to -thank the original authors of &ptclm;: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, -Wilfred M. Post, and R. Quinn Thomas for providing a nice addition to the &cesm; -effort. We also want to thank the folks at University of Michigan Biological Stations -(US-UMB) who allowed us to use their Fluxnet station data and import it into our -inputdata repository, especially Gil Bohrer the PI on record for this site -(see for permission information on using this -data). - - - - -Introduction - - -The Community Land Model (&clmrel;) is the latest in a series of -global land models developed by the &cesm; Land Model Working Group -(LMWG) and maintained at the National Center for -Atmospheric Research (&ncar;). This guide is intended to instruct both -the novice and experienced user on running &clm;. This guide pertains to the -latest version &clmrel; available for download from the public release -subversion repository as a part of &cesmrel;. Documentation may be different if you are using an -older version, you should either update to the latest version, or use the -documentation inside your own source tree. There is information in the -ChangeLog file and in the -regarding the changes from previous versions of &cesm;. - - - -The novice user should read - in detail before beginning work, while the -expert user should read and - chapters, and then use the more detailed -chapters as reference. Before novice users go onto more technical problems covered -in , , , or they -should know the material covered in and be able -to replicate some of the examples given there. - - -All users should read the - -and sections to understand the document conventions -and the various ways of getting help on using &clm4;. Users should also read -the section to see if their planned use of the -model is something that has been scientifically validated and well tested. Users -that are NOT using &ncar; machines or our list of well tested machines should also -read the section to make sure they have -all the required UNIX utilities on the system they want to do their work. - - - - - -Introduction to the &clm4; User's Guide -What is in here anyway? - - -Here in the introduction we first give a simple guide to understand the document -conventions in . The next section -describes the differences between &clmrel; and &clm40; (for each &cesm; release version -up to &cesmrel;) as well as between -&clm40; and &clm35;, both from a scientific -as well as a software engineering point of view. It also talks about differences in the -configuration, namelist, and history fields. The next section -is for users that are already experts in using &clm; and gives a quickstart guide to the -bare details on how to use &clm4;. The next tells -you about what has been extensively tested and scientifically validated (and maybe more -importantly) what has NOT. lists the UNIX utilities -required to use &clm4; and is important if you are running on non-&ncar; machines, generic -local machines, or machines NOT as well tested by us at &ncar;. Next we -have to detail some of the best practices for using -&clm4; for science. The last introductory section is which lists -different resources for getting help with &cesm1; and &clm4;. - - - - goes into detail on how to setup and run simulations with -&clm4; and especially how to customize cases. Details of &configure; -modes and &buildnml; options as well as namelist options are given in this chapter. - - - - gives instructions on the &clm4; tools for creating input datasets -for use by &clm;, for the expert user. There's an overview of what each tool does, and some general notes on how to build -the FORTRAN tools. Then each tool is described in detail along with different ways in -which the tool might be used. -A final section -on how to customize datasets for observational sites for very savvy expert users is given as the last section of this chapter. - - - -As a followup to the tools chapter, tells how to add files to the -XML database for &buildnml; to use. This is important if you want to use the XML database to automatically select -user-created input files that you have created when you setup new cases with &clm;. - - - -In , again for the expert user, we give details on how to do some particularly -difficult special cases. For example, we give the protocol for spinning up both the &clmcn; model and &clm; with dynamic -vegetation active (CNDV). We give instructions to do a spinup case -from a previous case with Coupler history output for atmospheric forcing. We also give -instructions on running the prognostic crop model and its irrigation option. We also review -how to validate a port to a new machine using the Perturbation error -growth technique. Lastly we tell the user how to use the DATM model to send historical &CO2; data to &clm;. - - - - outlines how to do single-point or -regional simulations using &clm4;. -This is useful to either compare &clm; simulations with point observational stations, -such as tower sites (which might include your own atmospheric forcing), or -to do quick simulations with &clm; for example to test a new parameterization. There are -several different ways given on how to perform -single-point simulations which range from simple &PTSMODE; to more complex where you create all your own datasets, tying into - and also to add the -files into the &buildnml; XML database. After this chapter - chapter outlines how to use the &ptclm; python script to -help you run single-point simulations. - - - -Finally, gives some guidance on trouble-shooting -problems when using &clm4;. It doesn't cover all possible problems with &clm;, but gives -you some guidelines for things that can be done for some common problems. - - - -In the appendices we talk about some issues that are useful for advanced users and -developers of &clm;. -In we give some basic background to the &clm; -developer on how to edit the models/lnd/clm/bld/clm.cpl7.template. -This is a very difficult exercise and we don't recommend it for any, but the most -advanced users of &clm; who are also experts in UNIX and UNIX scripting. - - -In we go over how to run the script -runinit_ibm.csh" that will interpolate standard resolution -initial condition dataset to several other resolutions at once. It also runs &clm; -to create template files as well as doing the interpolation using -interpinic. In general this is only something that a developer -would want to do. Most users will only want to interpolate for a few specific -resolutions. - - -In we go over the automated testing scripts for -validating that the &clm; is working correctly. The test scripts run many different -configurations and options with &clm; making sure that they work, as well as doing -automated testing to verify restarts are working correctly, and testing at many -different resolutions. In general this is an activity important only for a developer -of &clm;, but could also be used by users who are doing extensive code modifications -and want to ensure that the model continues to work correctly. - - -Finally in we give instructions on how to build -the documentation associated with &clm; (i.e. how to build this document). This -document is included in every &clm; distribution and can be built so that you can -view a local copy rather than having to go to the &cesm; website. This also could -be useful for developers who need to update the documentation due to changes they -have made. - - - - - - - - - -Important Notes and Best Practices for Usage of &clm4; - - - -When running with CN, it is critical to begin with initial conditions -hat are provided with the release or to spin the model up following the CN spinup -procedure before conducting scientific runs (see . -Simulations without a proper spinup will effectively be starting from an unvegetated -world. See for information on how to -provide initial conditions for your simulation. - - -Initial condition files are provided for fully coupled BCN and offline -ICN cases for 1850 and 2000 at 1deg, 2deg, and T31 resolutions. There's also an -initial condition file for ICN with the prognostic crop model for 2000 at 2deg -resolution, and one with &clmsp; for 2000 at 2deg resolution. We also have initial -conditions for offline CNDV for 1850. And there are interpolated datasets for 4x5 and -10x15 resolution for 1850. The 1850 initial condition -files are in 'reasonable' equilibrium. The 2000 initial condition files represent -the model state for the year 2000, and have been taken from transient simulations. -Therefore, by design the year 2000 initial condition files do not represent an -equilibrium state. Note also that spinning the 2000 initial conditions out to -equilibrium will not reflect the best estimate of the real carbon/nitrogen state -for the year 2000. - - -Users can generate initial condition files at different resolutions by -using the &clm; tool interpinic to interpolate from one of the -provided resolutions to the resolution of interest. Interpolated initial condition -files may no longer be in 'reasonable' equilibrium. - - -Aerosol deposition is a required field to &clm4; sent from the -atmosphere model. Simulations without aerosol deposition will exhibit unreasonably -high snow albedos. The model sends aerosol deposition from the atmospheric model (either -CAM or &datm;). When running with prescribed aerosol the atmosphere -model will interpolate the aerosols from 2-degree resolution to the resolution the -atmosphere model is running at. - - - - - - - - - - - - - $EDITOR - - - -How to Use This Document -Conventions used in the document for code and commands - - -This section provides the details in using &clm; with the &cesm; modeling -system. Links to descriptions and definitions have been provided in the code below. -We use the same conventions used in the &cesm; documentation as outlined below. - - - -Throughout the document this style is used to indicate shell -commands and options, fragments of code, namelist variables, etc. -Where examples from an interactive shell session are presented, lines -starting with > indicate the shell prompt. A backslash "\" at the end -of a line means the line continues onto the next one (as it does in -standard UNIX shell). Note that $EDITOR" is used to refer to the -text editor of your choice. $EDITOR is a standard UNIX environment -variable and should be set on most UNIX systems. Comment lines are -signaled with a "#" sign, which is the standard UNIX comment sign as well. -$CSMDATA is used to denote the path to the inputdata directory for -your &cesm; data. - -> This is a shell prompt with commands \ -that continues to the following line. -> $EDITOR filename # means you are using a text editor to edit "filename" -# This is a comment line - - - - - - - - - - - &clmcn; - &clmsp; - - -What is new with &clmrel; since previous public releases? - -In this section we list the updates that have occurred to &clm4; since previous -public releases. In the first sections we describe changes in &clmrel; since the &ccsm4; release, -and in the last one we describe changes from &clm35; to &clm40; release. Note, that -the changes in the last section do NOT include the more recent changes given in the -first section, but only list the changes from &clm35; to the &clm40; release that -was part of the &ccsm4; public release. We will describe both the -changes in the science in the model as the software engineering changes. Software -engineering changes includes the configure and namelist changes, as well as the new -history fields. - - -What is new with &clmrel; since the December 8th, 2010 &cesm102; release? - - - -What is new with &clmrel; Science since &clmcesm102;? - -A prognostic crop model option was added in (based on Agro-IBIS) from work by -Samuel Levis. The crop model adds in four new vegetation types for: soybean, -winter and spring temperate cereals, and corn on their own separate columns. Winter -cereal was added as a PFT type, but doesn't exist in the input datasets, only -spring cereal is used. Winter cereal also has NOT been scientifically validated -or tested. The model manages these by modeling both planting and harvesting. See for an example of running with it. - - -An irrigation model was added from work by Samuel Levis and Bill Sacks. This -model takes water from runoff and adds it to the crop pfts for areas equipped -for irrigation. See for an example of running with it. -Please note that the irrigation model only works with the crop model active. - - - - -What is new with &clmrel; Software since &clmcesm102;? - -Since &clmcesm102; all Input/Output uses &pio; (Parallel Input/Output package). -Restart history files are now &netcdf;. Input and output files can be read/written -in parallel using PIO. We removed a list of old CPP defines and removed the -old misc/preproc.h files. Also a new tool for working with single-point sites was -added into the &cesm; scripts the Python tool &ptclm;. We have a complete chapter on it's use. - - -New configuration options: - --crop --noio - - - -Configuration options removed: - --dust --progsslt - - - -New build-namelist options: - --co2_ppmv --rtm_res --rtm_tstep - - - -New precedence for build-namelist options is... - -Values set on the command-line using the -namelist option -(&CLMNAMELIST;). -Values read from the file specified by -infile (&usernlclm; file). -Datasets from the -clm_usr_name option (&CLMUSRDAT;). -Values set from a use-case scenario, e.g., -use_case (&CLMUSECASE;). -Values from the namelist defaults file. - - - -Namelist options renamed: - -carbon_only => suplnitro (can be set to NONE or ALL) - - - -namelist options removed: - -carbon_only => suplnitro -scaled_harvest -hist_crtinic -hist_pioflag -ncd_lowmem2d -ncd_pio_def -ncd_pio_UseRearranger -ncd_pio_UseBoxRearr -ncd_pio_SerialCDF -ncd_pio_IODOF_rootonly -ncd_pio_DebugLevel -ncd_pio_num_iotasks - - - -New history fields: - -A5TMIN 5-day running mean of min 2-m temperature -(K) -A10TMIN 10-day running mean of min 2-m temperature -(K) -GDD0 Growing degree days base 0C from planting -(ddays) -GDD8 Growing degree days base 8C from planting -(ddays) -GDD10 Growing degree days base 10C from planting -(ddays) -GDD020 Twenty year average of growing degree days base 0C from planting -(ddays) -GDD820 Twenty year average of growing degree days base 8C from planting -(ddays) -GDD1020 Twenty year average of growing degree days base 10C from planting -(ddays) -GDDPLANT Accumulated growing degree days past planting date for crop -(ddays) -GDDHARV Growing degree days (gdd) needed to harvest -(ddays) -GDDTSOI Growing degree-days from planting (top two soil layers) -(ddays) -QIRRIG water added through irrigation -(mm/s) - - - -SNOWLIQ and SNOWICE changed from average to instantaneous output. - - - - -What was new with &clm4014; (in &cesm102;) since the September 17th, 2010 &cesm101; release? - -Since, &clm4010; in the &cesm101; release there were several developments made -to &clmrel;. Several new namelist items were added -a few new history fields. There were also some updates for -running the model with single-point mode. - - -Configuration options that were renamed: - -prog_seasalt => progsslt - - - -Namelist items removed: - -prog_seasalt => progsslt - - - -What was new with &clm4014; Science since &clm4010;? - -A long simulation at the course resolution of T31 (typically used for Paleo-climate -studies) was done and an spun-up initial condition file was provided for this -resolution (also by default the namelist variable ice_runoff was -turned off for T31). Also a new surface dataset and transient land-cover dataset was -provided for half-degree resolution. - - - -What was new with &clm4014; Software since &clm4010;? - -New configuration options - -sitespf_pt - - - -sitespf_pt is used for single-point/regional mode and is set to the site-name -that will be used (see the config_definition.xml for the -list of valid options). - - -Configuration options that were renamed: - -prog_seasalt => progsslt - - - -Namelist items removed: - -faerdep -fndepdat -fndepdyn -use_ndepstream - - - -Nitrogen deposition datasets are now only entered through the -ndepdyn_nml namelist (removing fndepdat, fndepdyn, and -use_ndepstream). Aerosol deposition is now a required input from -the atmosphere model, hence faerdep is removed. - - -New history fields: - -U10 10-m wind (m/s) -U10_DUST 10-m wind for dust model (m/s) -VA atmospheric wind speed plus convective velocity (m/s) -VOLR RTM storage: LIQ (m3) -VOLR_ICE RTM storage: ICE (m3) - - - - - - -What was new with &clm4010; (in &cesm101;) since the April 1st, 2010 &ccsm4; release? - -From, &clm40; in the &ccsm4; release to &clm4010; there were several developments made -to &clm;. A glacier multiple elevation class option was added that allows the -use of &clm4; with a glacier land ice model the Community Ice Sheet Model (CISM). -A bug-fix for the snow hydrology was added. Several new namelist items were added -a few new history fields. Also the capability of reading aerosol and nitrogen -deposition from stream files at one resolution and regridded on the fly rather than -with datasets at the model resolution was added in. This was important for higher -resolutions so that large datasets do not have to be created before running the model, -nor are datasets for every resolution required. - - -What was new with &clm4010; Science since &ccsm4;? - -In general, snow layers should not be thinner than - -dzmin = wice/rhoice + wliq/rholiq - -If dz < dzmin, then the value of "void" computed in subroutine -SnowCompaction is negative, which is unphysical. This doesn't cause -problems with the compaction itself, but results in unrealistic values -of vol_ice, vol_liq, and eff_porosity in subroutine SnowWater. We can -have vol_ice = 1 and vol_liq = 0 even when liquid is present, which cuts -off the runoff (qout) from the lowest snow layer. Liquid water then -accumulates in the snow column without draining, which leads to further -problems and eventually a code crash. - - -The solution to this problem was to adjust layer thickness dz for any water+ice content -changes in excess of previous layer thickness, e.g., - -dz(c,j) = max(dz(c,j),h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice) - -at appropriate steps in the snow hydrology subroutines. - - - -Snow hydrology bug fix. -Add multiple elevation class option for glaciers so can interact with -the land ice sheet model. - - - - -What was new with &clm4010; Software since &ccsm4;? - -New configuration options - -glc_nec - - - -glc_nec can be 1,3,5, or 10 and MUST match the number on the input surface dataset -the elevation classes themselves are read from the surface dataset - - -New namelist items: - -carbon_only -create_glacier_mec_landunit -glc_dyntopo -ice_runoff -ndepmapalgo -scaled_harvest - - - -carbon_only = If true, and CLMCN carbon-nitrogen model is on, Nitrogen is unlimited - rather than prognosed and vegetation will be over-productive (replaces the supplemental Nitrogen #ifdef) - - - create_glacier_mec_landunit (= T when these landunits are created; F by default) - - - glc_dyntopo (= T if &clm; topography changes dynamically; currently F) - (NOT fully implemented yet) - - -ice_runoff = If true, river runoff will be split up into liquid and ice streams, - otherwise ice runoff will be zero and all runoff directed to liquid stream - - - ndepmapalgo = Mapping method from Nitrogen deposition input file to the model - resolution (can be bilinear,nn,nnoni,nnonj,spval,copy, bilinear by default) - - -scaled_harvest = If true, harvesting will be scaled according to coefficients - determined by Johann Feddema, 2009 - - -New history fields: - -aais_area Antarctic ice area (km^2) -aais_mask Antarctic mask (unitless) -gris_area Greenland ice area (km^2) -gris_mask Greenland mask (unitless) -QICE ice growth/melt (mm/s) -QICEYR ice growth/melt (mm/s) -QTOPSOIL water input to surface (mm/s) -VOLR RTM storage: LIQ (m3) -VOLR_ICE RTM storage: ICE (m3) - - - - - - - -What was new with &clm40; since &clm35;? - - -From &clm35; to &clm40; there were advances in both the science and the software infrastructure. -There were also new configure and namelist options as well as new history fields. In this -section we will describe each of these changes in turn. - - - -What was new with &clm40; Science? - -The following aspects are changes to the science in &clm40; since &clm35;. - - -Biogeophysics and Hydrology - -Changes to &clm40; beyond &clm35; (Oleson et al., 2008a; Stockli et al., 2008) include -updates throughout the model. The hydrology scheme has been modified with a revised -numerical solution of the Richards equation (Zeng and Decker, 2009; Decker and Zeng, -2009); a revised soil evaporation parameterization that removes the soil resistance term -introduced in &clm35; and replaces it with a so-called &Bgr; formulation, as well as accounts for the role of litter and within- -canopy stability (Sakaguchi and Zeng, 2009). -&clm4; also includes a representation of the thermal and hydraulic properties of organic -soil that operates in conjunction with the mineral soil properties (Lawrence and Slater, -2008). The ground column has been extended to ~50-m depth by adding five additional -hydrologically inactive ground layers (making a total of 15 ground layers, 10 soil -layers and 5 bedrock layers; Lawrence et al., 2008). An urban landunit and associated -urban canyon model (&clmu;) has been added which permits the study of urban climate -and urban heat island effects (Oleson et al., 2008b). - - - - -Snow Model - -The snow model is significantly modified via incorporation of SNICAR (SNow and Ice Aerosol Radiation) which represents the effect of aerosol deposition (e.g. black and organic carbon and dust) on albedo, introduces a grain-size dependent snow aging parameterization, and permits vertically resolved snowpack heating (Flanner and Zender, 2005; Flanner and Zender, 2006; Flanner et al., 2007). The new snow model also includes a new density-dependent snow cover fraction parameterization (Niu and Yang, 2007), a revised snow burial fraction over short vegetation (Wang and Zeng, 2009) and corrections to snow compaction (Lawrence and Slater, 2009). - - - - -Surface Datasets - -The PFT distribution is as in Lawrence and -Chase (2007) except that a new cropping dataset is used (Ramankutty et al., 2008) and -a grass PFT restriction has been put in place to reduce a high grass PFT bias in -forested regions by replacing the herbaceous fraction with low trees rather than grass. -Grass and crop PFT optical properties have been adjusted according to values presented -in Asner et al. (1998), resulting in significantly reduced albedo biases. Soil colors -have been re-derived according to the new PFT distribution. - - - - -Biogeochemistry - -The model is extended with a carbon-nitrogen biogeochemical model (Thornton et al., 2007; -Thornton et al., 2009; Randerson et al., 2009) which is referred to as &clmcn;. CN is -based on the terrestrial biogeochemistry Biome-BGC model with prognostic carbon and -nitrogen cycle (Thornton et al., 2002; Thornton and Rosenbloom, 2005). &clmcn; is -prognostic with respect to carbon and nitrogen state variables in the vegetation, litter, -and soil organic matter. Vegetation phenology and canopy heights are also prognostic. A -detailed description of the biogeochemical component can be found in Thornton et al. -(2007). Note that &clm40; can be run with either prescribed satellite phenology -(&clmsp;) or with prognostic phenology provided by the carbon- nitrogen cycle model -(&clmcn;). Additionally, a transient land cover and land use change, including wood harvest, -capability has been introduced that enables the evaluation of the impact of historic and -future land cover and land use change on energy, water, and momentum fluxes as well as -carbon and nitrogen fluxes. The dynamic global vegetation model in &clm3; has been -revised such that the carbon dynamics (e.g. productivity, decomposition, phenology, -allocation, etc.) are controlled by CN and only the dynamic vegetation biogeography -(competition) aspect of the &clm3; DGVM is retained. -The biogenic volatile organic compounds model (BVOC) that was available in &clm3; has -been replaced with the MEGAN BVOC model (Heald et al. 2008). - - - - -Miscellaneous Changes - -Several other minor changes have been incorporated including a change to the atmospheric reference height so that it is the height above zo+d for all surface types. The convergence of -canopy roughness length zo and displacement height d to bare soil values as the -above-ground biomass, or the sum of leaf and stem area indices, goes to zero is ensured -(Zeng and Wang, 2007). Several corrections have been made to the way the offline forcing -data is interpreted. The main change is a vastly improved and smooth diurnal cycle of -incoming solar radiation that conserves the total incoming solar radiation from the -forcing dataset. Additionally, in offline mode rather than partitioning incoming solar -radiation into a constant 70%/30% direct vs diffuse split, it is partitioned according to -empirical equations that are a function of total solar radiation. Finally, to improve -global energy conservation in fully coupled simulations, runoff is split into separate -liquid and ice water streams that are passed separately to the ocean. Input to the ice -water comes from excess snowfall in snow-capped regions. - - - - -Summary of Science Changes - -Taken together, these augmentations to &clm35; in &clm40; result in improved soil moisture dynamics -that lead to higher soil moisture variability and drier soils. Excessively wet and -unvarying soil moisture was recognized as a deficiency in &clm35; (Oleson et al. 2008a, -Decker and Zeng, 2009). The revised model also simulates, on average, higher snow cover, -cooler soil temperatures in organic-rich soils, greater global river discharge, lower -albedos over forests and grasslands, and higher transition-season albedos in snow covered -regions, all of which are improvements compared to &clm35;. - - - - - -What is new with &clm40; Software Infrastructure? - -The following aspects are changes to the software infrastructure in &clm40; since &clm35;. - - - - Update to cpl7 and scripts. - Remove offline and cpl6 modes. - Remove support for CASA model. - Update to datm8 atmospheric data model. - Add gx3v7 land mask for T31 and fv-4x5 horizontal resolutions. - Add gx1v6 land mask for f05, f09, and f19 horizontal resolutions. - Add tx1v1 land mask and 1.9x2.5_tx1v1 horizontal resolution. - Add in 2.5x3.33 horizontal resolution. - Add in T62 horizontal resolution so can run at same resolution as input &datm; -data. - Allow first history tape to be 1D. - Add ability to use own version of input datasets with &CLMUSRDAT; -variable. - Add a script to extract out regional datasets. - New &buildnml; system with XML file describing all namelist -items. - Add glacier_mec use-case and stub glacier model. - Make default of maxpatch_pft=numpft+1 instead of 4. - Only output static 3D fields on first h0 history file to save space. - Add new fields for VOC (Volatile Organic Compounds) on surface datasets, - needed for the new MEGAN VOC model. - Add multiple elevation class option for glaciers in mksurfdata tool (NOT used -in &clm; yet). - Add ascale field to land model in support of model running on it's own -grid. - - - - - -What are The New Configuration Options in &clm40;? - -Describe any changes made to build system: - - - -Change directory structure to match &ccsm;. -Add BGP target. -Add choice between ESMF and MCT frameworks. -Start removing #ifdef and directives that supported Cray-X1 Phoenix as now -decommissioned. -Make default of maxpatch_pft=numpft+1 instead of 4 for all -configurations. -By default turn on CLAMP when either CN or CASA is enabled -New SNICAR_FRC, CARBON_AERO, and C13 CPP ifdef tokens. - - - - -New options added to &configure;: -More information on options to &clm; &configure; are given in . - - - - -OptionDescription --comp_intf <name>Component interface to use (ESMF or MCT) (default -MCT) --nofireTurn off wildfires for bgc setting of CN (default includes -fire for CN) --pio <name>Switch enables building with Parallel I/O library. [on -| off] (default is on) --snicar_frc <name>Turn on SNICAR radiative forcing calculation. [on | -off] (default is off) - -More information on options to &clm; &configure; are given in . - - - - -What are The New Namelist Options in &clm40;? - -&buildnml; now checks the validity of your namelist you generate by looking at data in -the namelist_definition.xml file. In order to add new namelist items you need to -change the code and also edit this file (e.g. a namelist option required for your -research project that is not currently an option in &clm40;). To view information -on the namelist view the -file: models/lnd/clm/bld/namelist_files/namelist_definition.xml -in a browser and you'll see the names, type, description and valid_values for all -namelist variables. - - -Changes to &buildnml;: - -Allow simulation year entered to include ranges of years (i.e. 1850-2000) -Remove cam_hist_case option. -Make sure options ONLY used for stand-alone testing have a "drv_" or "datm_" - prefix in them and list these options all together and last when asking for - help from &buildnml;. - - - - New option to &buildnml;: - - -clm_usr_name "name" Dataset resolution/descriptor for personal datasets. - Default: not used - Example: 1x1pt_boulderCO_c090722 to describe location, - number of pts, and date files created - - - - New list options to &buildnml; - - cd models/lnd/clm/bld - ./&buildnml; -res list # List valid resolutions - ./&buildnml; -mask list # List valid land-masks - ./&buildnml; -sim_year list # List valid simulation years and simulation year ranges - ./&buildnml; -clm_demand list # List namelist variables including those you could - # demand to be set. - ./&buildnml; -use_case list # List valid use-cases - - - - -New use-cases for &buildnml;: - - 1850_control = Conditions to simulate 1850 land-use - 2000_control = Conditions to simulate 2000 land-use -20thC_transient = Simulate transient land-use, aerosol and Nitrogen deposition - from 1850 to 2005 - - - - - New namelist items: - - urban_hac = OFF, ON or ON_WASTEHEAT (default OFF) Flag for urban Heating - and Air-Conditioning - OFF = Building internal temperature is un-regulated. - ON = Building internal temperature is bounded to reasonable range. - ON_WASTEHEAT = Building internal temperature is bounded and resultant waste - heat is given off. - urban_traffic = .true. or .false. Flag to include additional multiplicative - factor of urban traffic to sensible heat flux. - (default .false.) - fsnowoptics = filename file for snow/aerosol optical properties (required) - fsnowaging = filename file for snow aging parameters (required) - -More information on the &buildnml; options are given in -. -and in -&CLMBLDNML;. - - -More information on the &buildnml; options are given in in . - - - - -What are The New History Fields? - -New history variables: (note watt vs. W in units, 26 vs. 76) - - - - -NameLong-nameUnitsActive/Inactive -BCDEPtotal BC deposition (dry+wet) from -atmospherekg/m^2/s -BIOGENCObiogenic CO -fluxuGC/M2/H -C13_PRODUCT_CLOSSC13 total carbon loss from wood product -poolsgC13/m^2/s -DSTDEPtotal dust deposition (dry+wet) from -atmospherekg/m^2/s -EFLX_DYNBALdynamic land cover change conversion energy -fluxW/m^2 -FGR12heat flux between soil layers 1 and -2watt/m^2 -FSATfractional area with water table at -surfaceunitless -FSH_NODYNLNDUSEsensible heat flux not including correction for land use change - watt/m^2 -GC_HEAT1initial gridcell total heat -contentJ/m^2 -GC_HEAT2post land cover change total heat -contentJ/m^2inactive -GC_ICE1initial gridcell total ice -contentmm/s -GC_ICE2post land cover change total ice -contentmm/sinactive -GC_LIQ1initial gridcell total liq -contentmm -GC_LIQ2initial gridcell total liq content -mminactive -H2OSNO_TOPmass of snow in top snow -layerkg - HEAT_FROM_ACsensible heat flux put into canyon due to heat -removed from air conditioningwatt/m^2 -HKhydraulic -conductivitymm/sinactive -ISOPRENEisoprene fluxuGC/M2/H -LAND_USE_FLUXtotal C emitted from land cover conversion and -wood product poolsgC/m^2/s -LAND_UPTAKENEE minus LAND_USE_FLUX, negative for -updategC/m^2/s -LWupupwelling longwave -radiationwatt/m^2inactive -MONOTERPmonoterpene -fluxuGC/M2/H -NBPnet biome production, includes fire, landuse, and harvest -flux, positive for sinkgC/m^2/s -OCDEPtotal OC deposition (dry+wet) from -atmospherekg/m^2/s -OVOCother VOC fluxuGC/M2/H -ORVOCother reactive VOC -fluxuGC/M2/H -PBOTatmospheric pressurePa -PCO2atmospheric partial pressure of -&CO2;Pa -PRODUCT_CLOSStotal carbon loss from wood product -poolsgC/m^2/s -PRODUCT_NLOSStotal N loss from wood product -poolsgN/m^2/s -Qairatmospheric specific -humiditykg/kginactive -Qanthanthropogenic heat -fluxwatt/m^2inactive -Qtaumomentum fluxkg/m/s^2 -QFLX_LIQ_DYNBALliq dynamic land cover change conversion -runoff fluxmm/s -QFLX_ICE_DYNBALice dynamic land cover change conversion -runoff fluxmm/s -QRUNOFF_NODYNLNDUSEtotal liquid runoff not including correction for land use change (does not include QSNWCPICE) -mm/s -QSNWCPICEexcess snowfall due to snow -cappingmm/s -QSNWCPICE_NODYNLNDUSEexcess snowfall due to snow capping not including correction for land use change -mm/s -QSNWCPLIQexcess rainfall due to snow -cappingmm/sinactive -SMPsoil matric -potentialmminactive -SNOAERFRC2Lsurface forcing of all aerosols in snow, averaged only when snow is present (land) -watt/m^2 -SNOAERFRCLsurface forcing of all aerosols in snow -(land)watt/m^2 -SNOBCFRCLsurface forcing of BC in snow -(land)watt/m^2 -SNOBCMCLmass of BC in snow -columnkg/m2 -SNOBCMSLmass of BC in top snow -layerkg/m2 -SNOdTdzLtop snow layer temperature gradient -(land)K/m -SNODSTFRC2Lsurface forcing of dust in snow, averaged only when snow is present (land) -watt/m^2 -SNODSTFRCLsurface forcing of dust in snow -(land)watt/m^2 -SNODSTMCLmass of dust in snow -columnkg/m2 -SNODSTMSLmass of dust in top snow -layerkg/m2 -SNOFSRNDdirect nir reflected solar radiation from -snowwatt/m^2inactive -SNOFSRNIdiffuse nir reflected solar radiation from -snowwatt/m^2inactive -SNOFSRVDdirect vis reflected solar radiation from -snowwatt/m^2inactive -SNOFSRVIdiffuse vis reflected solar radiation from -snowwatt/m^2inactive -SNOFSDSNDdirect nir incident solar radiation on -snowwatt/m^2inactive -SNOFSDSNIdiffuse nir incident solar radiation on -snowwatt/m^2inactive -SNOFSDSVDdirect vis incident solar radiation on -snowwatt/m^2inactive -SNOFSDSVIdiffuse vis incident solar radiation on -snowwatt/m^2inactive -SNOLIQFLtop snow layer liquid water fraction -(land)fractioninactive -SNOOCMCLmass of OC in snow -columnkg/m2 -SNOOCMSLmass of OC in top snow -layerKg/m2 -SNOOCFRC2Lsurface forcing of OC in snow, averaged only when snow is present (land) -watt/m^2 -SNOOCFRCLsurface forcing of OC in snow -(land)watt/m^2 -SNORDSLtop snow layer effective grain -radiusm^-6inactive -SNOTTOPLsnow temperature (top -layer)K/minactive -SWupupwelling shortwave -radiationwatt/m^2inactive -TSOI_10CMsoil temperature in top 10cm of -soilK -URBAN_ACurban air conditioning -fluxwatt/m^2 -URBAN_HEATurban heating -fluxwatt/m^2 -VOCFLXTtotal VOC flux into -atmosphereuGC/M2/H -Windatmospheric wind velocity -magnitudem/sinactive -WOOD_HARVESTCwood harvest (to product -pools)gC/m^2/s -WOOD_HARVESTwood harvest (to product -pools)gN/m^2/s - - - - - History field name changes: - - -OldNew -ANNSUM_PLANT_NDEMAND= -ANNSUM_POTENTIAL_GPP -ANNSUM_RETRANSN= ANNMAX_RETRANSN -C13_DWT_PROD10C_LOSS= C13_PROD10C_LOSS -C13_DWT_PROD100C_LOSS= C13_PROD100C_LOSS -C13_DWT_PROD10N_LOSS= C13_PROD10N_LOSS -C13_DWT_PROD100C_LOSS= C13_PROD100C_LOSS -DWT_PROD100N_LOSS= PROD10N_LOSS -DWT_PROD100N_LOSS= PROD100N_LOSS -DWT_PROD100C_LOSS= PROD10C_LOSS -DWT_PROD100C_LOSS= PROD100C_LOSS -HCSOISNO= HC -TEMPSUM_PLANT_NDEMAND= -TEMPSUM_POTENTIAL_GPP -TEMPSUM_RETRANSN= TEMPMAX_RETRANSN - - - -History field names deleted include: SNOWAGE, TSNOW, FMICR, FCO2, DMI, QFLX_SNOWCAP - - - -Add new urban oriented _U, and _R (Urban and Rural) for the following history variables: -EFLX_LH_TOT, FGR, FIRA, FSH, FSM, Q2M, QRUNOFF, RH2M, SoilAlpha, TG, TREFMNAV, -TREFMXAV, and TSA (missing _R for SoilAlpha as the regular SoilAlpha is only defined -for rural areas anyway) - - - -We are missing the Rural soil-alpha variable: SoilAlpha_R on purpose. -SoilAlpha_U is only defined over pervious road, and missing everywhere else. -SoilAlpha is defined only for rural areas. - - - - - - - - - - - -Quickstart to using &clm4; - -Before working with &clm4; read the QuickStart Guide in the -&cesmrel; -Scripts User's Guide. Once you are familiar with how to setup cases for -any type of simulation with &cesm; you will want to direct your attention to the specifics -of using &clm;. - - -For some of the details of setting up cases for &clm4; read the README and text files available -from the "models/lnd/clm/doc" directory (see the "&clm; Web pages" section for a link to the list -of these files). Here are the important ones that you should be familiar with. - -README file describing the directory structure. -Quickstart.userdatasets file describing how to -use your own datasets in the model (also see ). -&KnownBugs; file describing known -problems in &clm4; (that we expect to eventually fix). -KnownLimitations file -describing known limitations in &clm4; and workarounds that we do NOT expect to -fix. - - -The IMPORTANT_NOTES file is given in the next chapter on what -is functional/validated in &clm4;? - -The ChangeLog/ChangeSum files are largely explained in the previous chapter on "What is new with -&clm4;?" - -Note other directories have README files that explain different components and tools used -when running &clm; and are useful in -understanding how those parts of the model work and should be consulted when using tools in those directories. -For more details on configuring and customizing a case with &clm; see . - -The Quickstart.GUIDE (which can be found in -models/lnd/clm/doc) is repeated here. - -&quickstart_guide; - - - - -What is scientifically validated and functional in &clm4;? - -In this section we go over what has been extensively tested and scientifically validated -with &clm4;, and maybe more importantly what has NOT been tested and may NOT be -scientifically validated. You can use all features of &clm;, but need to realize that -some things haven't been tested extensively or validated scientifically. When you use -these features you may run into trouble doing so, and will need to do your own work to -make sure the science is reasonable. - - - -Standard Configuration and Namelist Options that are Validated - -The standard version of the model is &clmcn; at 1-degree horizontal resolution (0.9x1.25). This version has been scientifically -validated with long simulations for: fully coupled simulations ("B" cases), coupled to -atmosphere model CAM ("F" cases), and stand-alone &clm; -cases ("I" cases). We've also done both long simulations for 1850 conditions, and transient 20th century simulations from 1850 to 2005 (with -transient land-use, Nitrogen and Aerosol deposition). There have also been transient -future scenario simulations done for fully coupled cases for different "representative -concentration pathway" (RCP) scenarios (RCP2.6, RCP4.5, RCP6.0, and RCP8.5). -To a lesser extent there have also -been simulations done at T31 and 2-degree horizontal -resolution (1.9x2.5), and with &clmsp; for these resolutions. As such we have provided -appropriate 1-degree, 2-degree, and T31 initial condition -datasets for these configurations. The irrigation and prognostic crop models were both -validated at 2-degree resolution. The irrigation model for &clmsp; for present day -conditions for an "I" compset, and the prognostic crop model for present day conditions -for a case coupled to the active land model, but using a data ocean model (an "F" -compset). Other resolutions, configurations, and namelist options are less well tested or scientifically validated. -The further you get away from the standard configurations and resolutions, the more likely you are to run into trouble, and/or need to -scientifically validate your work. - - -In the sections below we go through configuration and/or namelist options or modes that the user should be especially wary of using. You -are of course free to use these options, and you may find that they work functionally. Although in some cases you will find issues even -with functionality of using them. If so you will need to test, debug and find solutions for these issues on your own. But in every case -you will need to go through more extensive work to validate these options from a scientific standpoint. - - - - -Configure Modes NOT scientifically validated, documented, supported or, in some -cases, even advised to be used: - - - - - C13(-c13) -The C13 mode for bgc=cn is NOT scientifically validated or documented and is NOT -recommended for use. - - - - - - CASA(-bgc casa) -The bgc=casa mode is NOT scientifically validated or documented and is NOT -recommended for use. - - - - - - SNICAR_FRC(-snicar_frc) - This mode is tested and functional, but is NOT constantly scientifically validated, and should be - considered experimental. - - - - - - - -Namelist options that should NOT be exercised: - -Build-Namelist options that should NOT be exercised: - - --irrig with -bgc cn -We have only run the irrigation model with &clmsp; (i.e. without the CN model). We -recommend that if you want to run the irrigation model with CN, that you do a spinup. -But, more than that you may need to make adjustments to -irrig_factor in -models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90. See the -notes on this in the description of the irrigation model in the - -Technical Descriptions of the Interactive Crop Management and Interactive -Irrigation Models. - - --irrig with -crop on -Irrigation doesn't work with the prognostic crop model. Irrigation is only applied to -generic crop currently, which negates it's practical usage. We also have a known -problem when both are on (see bug 1326 in the &KnownBugs; file). -If you try to run in this mode, the &clm; &buildnml; will return with an error. - - --lnd_res: Fine-mesh mode, functional, but experimental - --rcp: Representative Concentration Pathway (RCP) -for future scenarios, functional for limited resolutions, but experimental - --datm_*: All options that start with "datm_" they are -only used for &clm; stand-alone testing. - --drv_*: All options that start with "drv_" they are -only used for &clm; stand-alone testing. - - - - - - -Namelist items that should NOT be exercised: - - -casa namelist options: lnpp, lalloc, q10, spunup, and fcpool - - CASA has NOT been scientifically validated in &clm4;. - - - - suplnitro='ALL' - The suplnitro namelist option to the CN Biogeochemistry model supplies -unlimited nitrogen and therefore vegetation is over-productive in this mode. - - - -urban_traffic: Not currently functional - - - - - - - - - -What are the UNIX utilities required to use &clm;? - -Running the &clm; requires a suite of UNIX utilities and programs and you should -make sure you have all of these available before trying to go forward with using -it. If you are missing one of these you should contact the systems administrator -for the machine you wish to run on and make sure they are installed. - -&FORTRAN90; compiler -"C" compiler -GNU make -UNIX csh and tcsh shells -UNIX sh shell -UNIX bash shell -UNIX awk -UNIX sed -&netcdf; library -MPI Library -"C" pre-processor -&perl; -Autoconf -m4 macro processor -Parallel &netcdf; (optional) -&ncl; (for some of the offline tools for creating/modifying &clm; input -datasets see for more information on &ncl;) -Python (optional, needed for &ptclm;) -xsltproc, docbook and docbook utilities (optional, needed to build the Users-Guide) -protex and latex2html (optional, needed to build the Code-Reference Guide) - - - - - - - - - &cesm; Online Bulletin Board - &cesmrel; Scripts User's Guide - - -Other resources to get help from - - -In addition to this users-guide there are several other resources that are available -to help you use &clm4;. The first one is the &cesm; User's-Guide, which documents the entire -process of creating cases with &cesm;. The next is the &cesm; bulletin board which is -a web-site for exchanging information between users of &cesm;. There are also &clm; -web-pages specific for &clm;, and finally there is an email address to report bugs that -you find in &cesm1;. - - - -The &cesm; User's-Guide - -&clmrel; is always run from within the standard &cesmrel; build and run scripts. Therefore, the -user of &clm4; -should familiarize themselves with the &cesmrel; scripts and understand how to work with them. -User's-Guide documentation on the &cesmrel; scripts are available from the following web-page. The purpose -of this &clmrel; User's Guide is to give the &clm4; user more complete details on how to work -with &clm; and the set of tools that support &clm;, as well as to give examples that are unique to the use -of &clm;. However, the &cesmrel; Scripts User's-Guide remains the primary source to get detailed -information on how to build and run the &cesm; system. - -&cesm1; Scripts -User's-Guide - - - - - -The &cesm; Bulletin Board - -There is a rich and diverse set of people that use the &cesm;, and often it is useful to be in contact with -others to get help in solving problems or trying something new. To facilitate this we have an online -Bulletin Board for questions on the &cesm;. There are also different sections in the Bulletin Board for -the different component models or for different topics. - -&cesm; Online Bulletin Board - - - - - -The &clm; web pages - -The main &clm; web page contains information on the &clm;, it's history, developers, as well as -downloads for previous model versions. There are also documentation text files in the -models/lnd/clm/doc directory that give some quick information on using &clm;. - -&clm; web page -&clm; Documentation Text Files - -Also note that several of the XML database files can be viewed in a web browser to get -a nice table of namelist options, namelist defaults, or compsets. Simply view them -as a local file and bring up one of the following files: - -models/lnd/clm/bld/namelist_files/namelist_definition.xml --- definition of &clm; namelist items. -models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- default values for &clm; namelist items. -scripts/ccsm_utils/Case.template/config_definition.xml --- definition of all env_*.xml items. -scripts/ccsm_utils/Case.template/config_compsets.xml --- definition of all the compsets. -models/lnd/clm/bld/namelist_files/history_fields.xml --- definition of &clm; history fields. - - - - - -Reporting bugs in &clm4; - -If you have any problems, additional questions, bug reports, or any other feedback, please send an email to -cesmhelp@cgd.ucar.edu. If you find bad, wrong, or misleading information - in this users guide send an email to erik@ucar.edu. The current list of -known issues for &clmrel; is in the &KnownBugs; file, and the list of issues for -&cesmrel; is at... - -&cesmwebmodelrel;/tags/cesm1_0_3/#PROBLEMS -. - - - - - - - - diff --git a/doc/UsersGuide/ptclm.xml b/doc/UsersGuide/ptclm.xml deleted file mode 100644 index 6c0ef2aec8..0000000000 --- a/doc/UsersGuide/ptclm.xml +++ /dev/null @@ -1,992 +0,0 @@ - - -How to run &ptclm; - -&ptclm; (pronounced point clime) is a Python script to help you set up PoinT CLM -simulations. It runs the &clm; tools for you to get datasets set up, and copies them -to a location you can use them according to the &CLMUSRDAT; naming convention. Then -it runs create_newcase for you and modifies the env settings and -namelist appropriately. &ptclm; has a simple ASCII text file for storing basic -information for your sites. We also have complete lists for AmeriFlux and Fluxnet-Canada -sites, although we only have the meteorology data for one site. For other sites you -will need to obtain the meteorology data and translate it to a format that the &cesm; -datm model can use. But, even without meteorology data &ptclm; is useful to setup -datasets to run with standard &CLMQIAN; data. - - - -The original authors of &ptclm; are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, -Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory -(ORNL) and R. Quinn Thomas at Cornell University. It was then modified -fairly extensively by Erik Kluzek at &ncar;. We want to thank all of these individuals -for this contribution to the &cesm; effort. We also want to thank the folks at -University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet -station data and import it into our inputdata repository, especially Gil Bohrer the -PI on record for this site. - - - -Introduction to PTCLM - -To get help on &ptclm; use the "--help" option as follows. - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -> ./PTCLM.py --help - - - -The output to the above command is as follows: - - - -&ptclm_help; - - - - -Here we give a simple example of using &ptclm; for a straightforward case of running -at the US-UMB Fluxnet site on bluefire where we already have the meteorology data on -the machine. Note, see for permission information -to use this data. - -Example of running &ptclm; for US-UMB on bluefire - -setenv CSMDATA /fis/cgd/cseg/csm/inputdata -setenv MYCSMDATA $HOME/inputdata -setenv SITE US-UMB -setenv MYMACH bluefire -setenv MYCASE testPTCLM - -# First link the standard input files to a location you have write access -cd scripts -./link_dirtree $CSMDATA $MYCSMDATA - -# Next build all of the clm tools you will need -cd ../models/lnd/clm/tools/mksurfdata -gmake -gmake clean -cd ../mkdatadomain -gmake -gmake clean -cd ../mkgriddata -gmake -gmake clean -# next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) -cd ../../../../../scripts/ccsm_utils/Tools/lnd/clm/PTCLM -./PTCLM.py -m $MYMACH --case=$MYCASE --site=$SITE --csmdata=$MYCSMDATA \ - --aerdepgrid --ndepgrid -# NOTE: we use --aerdepgrid --ndepgrid so that you use the global -# aerosol and Nitrogen deposition files rather than site-specific ones. -cd ../../../../../$MYCASE -# Finally configure, build, and run the case as normal - - - - - - -Guide to the options of &ptclm; - -There are three types of options to &ptclm;: required, configure/run-time, and -dataset generation options. The three required options are the three settings that -MUST be specified for &ptclm; to work at all. The other settings have default -values that will default to something useful. The configure/run-time options control -how the simulation will be setup and run. The dataset generation options control -the generation of datasets needed when &ptclm; is run. Most options use a double -dash "--" "longname" such as "--list", but the most common options also have a short-name -with a single dash (such as -m instead of --machine). - - -The required options to &ptclm; are: inputdata directory (-d), machine (-m) and -site-name (-s). Inputdata directory is the directory where you have the &cesm; -inputdata files, you need to have write access to this directory, so if you are -running on a machine that you do NOT have write access to the standard inputdata -location (such as &ncar; bluefire or ORNL jaguar) you need -to link the standard files to a location you do have control over. We recommend -using the scripts/link_dirtree tool to do that. "machine" is -the scripts name for the machine/compiler you will be using for your case. And -finally site-name is the name of the site that you want to run for. Site-name -can either be a valid &CLM1PT; supported dataset name or a Fluxnet site name -from the list of sites you are running on (see the --sitegroupname for more information -about the site lists). - - -After &ptclm; is run a case directory where you can then configure, build and run -your &cesm; case as normal. It also creates a README.PTCLM -in that directory that documents the commandline options to &ptclm; that were used -to create it. - - -After "help" the "list" option is one of the most useful options for getting -help on using &ptclm;. This option gives you information about some of the other -options to &ptclm;. To get a list of the machine, sites, and compsets that can be -used for &ptclm; use the "--list" option as follows. - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -> ./PTCLM.py --list - - - -The output to the above command is as follows: - - - -&ptclm_list; - - - - -Overview on using &ptclm; - -Steps in running &ptclm; - -Setup Inputdata directory with write access (use -<command>link_dirtree</command> script) - -You need to setup an inputdata directory where you have write access to it. -Normally, for &ncar; machines the data is on an inputdata where the user -does NOT have write access to it. A way that you can get around this is -to use the link_dirtree script to create softlinks from -the normal location to a location you have write access to. So for example -on bluefire: - -> setenv CSMDATA /fs/cgd/csm/inputdata -> setenv MYCSMDATA $HOME/inputdata -> mkdir $MYCSMDATA -> cd scripts -> ./link_dirtree $CSMDATA $MYCSMDATA - -See for more information on this. - - - -Build the &clm; tools - -Next you need to make sure all the &clm; &FORTRAN; tools are built. - -> cd models/lnd/clm/tools/mkgriddata -> gmake -> gmake clean -> cd ../mkdatadomain -> gmake -> gmake clean -> cd ../mksurfdata -> gmake -> gmake clean - - - - -Run &ptclm; - -Next you actually run &ptclm; which does the different things listed below: - - - -&ptclm; names your case based on your input - -&ptclm; names you case based on the input you give to it. - -[Prefix_]SiteCode_Compset[_QIAN][_spinuptype] -Where: - Prefix is from the caseidprefix option (or blank if not used). - SiteCode is the site name you entered with the -s option. - Compset is the compset name you entered with the -c option. - _QIAN is part of the name only if the useQIAN is used. - _spinuptype is part of the name if one of: ad_spinup, exit_spinup, or - final_spinup is used, and the exact spinup name chosen is used. - -For example, the casename for the following will be: - -> cd scripts -> ./PTCLM.py -m bluefire -s US-UMB -d $MYCSMDATA -c I_2000_CN --ad_spinup --useQIAN - -"US-UMB_I_2000_CN_QIAN_ad_spinup". - - - -&ptclm; creates datasets for you - -It will populate $MYCSMDATA with new datasets it creates using the -&clm; tools. - - - -If a transient compset and &ptclm; finds a <filename>_dynpftdata.txt</filename> -file - -If you are running a transient compset (such as the "I_1850-2000_CN" compset) -AND you there is a file in the PTCLM_sitedata directory under -the &ptclm; directory called $SITE_dynpftdata.txt it will use -this file for the land-use changes. Otherwise it will leave land-use constant, unless -you use the pftgrid option so it uses the global dataset for landuse changes. -See for more information on this. There -is a sample transient dataset called US-Ha1_dynpftdata.txt. -Transient compsets, are compsets that create transient land-use change and -forcing conditions such as: -'I_1850-2000', 'I_1850-2000_CN', 'I_RCP8.5_CN', 'I_RCP6.0_CN', 'I_RCP4.5_CN', -or 'I_RCP2.6_CN'. - - - -&ptclm; creates a <filename>pft-physiology</filename> for you - -&ptclm; will create a local copy of the pft-physiology -specific for your site that you could then customize with changes specific -for that site. - - - -&ptclm; creates a <filename>README.PTCLM</filename> for you - -&ptclm; will create a simple text file with the command line for it in a file -called README.PTCLM in the case directory it creates for you. - - - - - - -Customize, configure, build and run case as normal - -You then customize your case as you would normally. See the chapter for more information on doing this. - - - - - - - -Details on the options of &ptclm; - -Next we discuss the configure and run-time options, dividing them up into -configure, spinup, and run-time options. - - -Configure options include: - --c MYCOMPSET, --compset=MYCOMPSET ---caseidprefix=MYCASEID ---cesm_root=BASE_CESM ---namelist=NAMELIST ---rmold ---scratchroot=SCRATCHROOT ---sitegroupname=SITEGROUP ---QIAN_tower_yrs ---useQIAN - - - - - ---compset - -The "-c" option is the most commonly used option after the required options, as it -specifies the &cesm; scripts component set to use with &ptclm;. The default compset -is the "ICN" compset with CN on for present day conditions. - - - - - ---caseidprefix - -This option gives a prefix to include in the casename when the case is created, in -case you want to customize your casenames a bit. By default, casenames are figured -out based on the other options. The argument to this option can either be a name to -prefix casenames with and/or a pathname to include. Hence, if you want cases to -appear in a specific directory you can give the pathname to that directory with this -option. - - - - - ---cesm_root - -This option is for running &ptclm; with a different root directory to &cesm; than the -version &ptclm; exists in. Normally you do NOT need to use this option. - - - - - ---namelist - -This option adds any items given into the &clm; &usernlclm; namelist. This allows you to -add customizations to the namelist before the clm.buildnml.csh file -is created for the case. - - - - - ---rmold - -This option will remove an old case directory of the same name if one exists. Otherwise, -if an old case directory already exists and you try to run &ptclm; it will return with -an error. - - - - - ---scratchroot - -This option is ONLY valid when using one of the generic machines (the -m option). -This passed onto create_newcase and gives the location where cases -will be built and run. - - - - - ---sitegroupname - -In the &ptclm; directory there is a subdirectory "PTCLM_sitedata" that contains -files with the site, PFT and soil data information for groups of sites. These site groups -are all separate ASCII files with the same prefix followed by a "_*data.txt" name. -See for more information on these files. -By default we have provided three different valid group names: - -EXAMPLE -AmeriFlux -Fluxnet-Canada - -The EXAMPLE is the group used by default and ONLY includes the US-UMB site as that -is the only site we have data provided for. The other two site groups include the -site information for all of both the AmeriFlux and Fluxnet-Canada sites. You can use -the "sitegroupname" option to use one of the other lists, or you can create your own -lists using the EXAMPLE file as an example. Your list of sites could be real world -locations or could be theoretical "virtual" sites given to exercise &clm; on -differing biomes for example. Note, see with -permission information to use the US-UMB data. - - - - - ---useQIAN - -This option says to use the standard &clm; global Qian T62 atmospheric forcing rather -than any tower site forcing data available. Otherwise, &ptclm; will try to find tower -forcing data for the specific site entered. - - - - - ---QIAN_tower_yrs - -This option is used with the "useQIAN" option to set the years to cycle over for -the Qian data. In this case Qian atmospheric forcing will be used, but the -simulation will run over the same years that tower site is available for this site. - - - - - - -Spinup options include: - ---coldstart ---ad_spinup ---exit_spinup ---final_spinup ---finidat=FINIDAT - - - - -The spinup options enable the different CN spinup modes, but also set the run -length. The coldstart option says to startup with OUT an initial condition file, while -the finidat option explicitly gives the initial condition file to use. Obviously, -the different spinup options can NOT be used together, nor can the coldstart and -finidat options be either. - - ---coldstart - -This option ensures that a cold-start will be done with arbitrary initial conditions. - - - - - ---ad_spinup - -This option enables the accelerated decomposition mode when a CN compset is used. It -also sets the run-length as given in the example for running exit spinup in -. - - - - - ---exit_spinup - -This option enables the exit spinup mode when a CN compset is used. It also sets the -run-length to a year just as given in the example for running exit spinup in -. - - - - - ---final_spinup - -This option sets the run length as given in the example for a final spinup in -. This option can be used for any compset. - - -There is a bug in the final_spinup mode for setting the run length. Because of the -bug, final_spinup mode only runs for a very short time, you'll need to edit -the run length by hand to be 50 years. See bug 1367 in the &KnownBugs; file. - - - - - - - ---finidat - -This option sets the initial condition file to startup the simulation from. - - - - - - - - - -Run-time options include: - ---debug ---run_n=MYRUN_N ---run_units=MYRUN_UNITS ---stdurbpt - - - - - - - ---debug - -This option tells &ptclm; to echo what it would do if it were run, but NOT actually -run anything. So it will show you the dataset creation commands it would use. -It does however, run create_newcase, but then it only displays -the xmlchange commands and changes that it would do. Also note -that if you give the "--rmold" option it won't delete the case directory beforehand. -Primarily this is intended for debugging the operation of &ptclm;. - - - - - ---run_n - -This option along with run_units is used to set the length for the simulation. "run_n" -is the number of units to use. -The default run length depends on the site, compset, -and configuration and for example if a "spinup" option is selected. - - - - - ---run_units - -This option is the units of time to use for the length of the simulation. It is used -along with "run_n" to set the length of the simulation. -The default run length depends on the site, compset, -and configuration and for example if a "spinup" option is selected. - - - - - ---stdurbpt - -This option turns on the "stdurbpt_pd" use-case for &CLMUSECASE;. This option -can NOT be used for compsets that set the use-case to something besides present-day. - - - - - - - - -Lastly we discuss the dataset generation options. The dataset generation options are: - ---aerdepgrid ---ndepgrid ---pftgrid ---soilgrid ---nopointdata ---owritesrfaer - - - - -The options that with a "grid" suffix all mean to create datasets using the global -gridded information rather than using the site specific point data. By default the -site specific point data is used. The "nopointdata" and "owritesrfaer" options have to -do with file creation. - - -Because supported single-point datasets already have the data created for them, you -MUST use the "nopointdata" and "ndepgrid" options when you are using a supported -single-point site. You must use "ndepgrid" even for a compset without CN. You also -can NOT use the options: "soilgrid", "pftgrid", "aerdepgrid", or "owritesrfaer". - - - - - ---aerdepgrid - -This option says to use the aerosol deposition files from the global dataset rather -than creating an interpolated version. - - -This option must NOT be used when you you are using a site that -is a supported single point dataset. - - - - - ---ndepgrid - -This option says to use the Nitrogen deposition files from the global dataset rather -than creating an interpolated version. This is only needed for compsets with CN. - - - -This option is required when you you are using a site that -is a supported single point dataset. This is true even when you are NOT using a -compset with CN. - - - - - - ---pftgrid - -This option says to use the PFT values provided on the global dataset rather than -using the specific site based values from the -PTCLM_sitedata/*_pftdata.txt file when creating the surface dataset. - - -This option must NOT be used when you you are using a site that -is a supported single point dataset. - - - - - ---soilgrid - -This option says to use the soil values provided on the global dataset rather than -using the specific site based values from the -PTCLM_sitedata/*_soildata.txt file when creating the surface dataset. - - -This option must NOT be used when you you are using a site that -is a supported single point dataset. - - - - - ---nopointdata - -This option says to NOT create any input datasets -- assume this step has already been -done. If datasets weren't already created, your case will fail when you try to run it. -In general the first time you run &ptclm; for a new site you want it to generate new -datasets, but the next time and future times you want to use this option so that it -doesn't waste a lot of time rebuilding datasets over again. - - - -This option is required when you you are using a site that -is a supported single point dataset. - - - - - - ---owritesrfaer - -This option says to overwrite any surface and/or aerosol deposition datasets that -were already created. Otherwise, the creation of these files will be skipped if a file -is already found (but it WILL create files if they don't exist). - - -This option must NOT be used when you you are using a site that -is a supported single point dataset. - - - - - - - - -Note on the aerosol and Nitrogen deposition files. When the "aerdepgrid" and "ndepgrid" -options are NOT used -- aerosol and Nitrogen deposition files will be created by -interpolating from the global datasets. However, after these interpolated files -are created you could customize them for your site with data that you provide. You -could then write protect the files and use the "nopointdata" option so that &ptclm; -doesn't try to overwrite them in the future. - - - - - - -Examples using &ptclm; - -Now let's give a few more complex examples using some of the options we have -discussed above. - - -In this first example, we'll demonstrate using a supported single point dataset, -which then requires using the "nopointdata" and "ndepgrid" options. We'll also -demonstrate the compset option, "stdurbpt" and "caseidprefix" options. - -Example of running &ptclm; for the Mexicocity supported single point -dataset - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -> ./PTCLM.py -m bluefire -s 1x1_mexicocityMEX -d $CSMDATA --nopointdata --ndepgrid \ ---stdurbpt -c I --caseidprefix `pwd`/myPTCLMcases/site -> cd myPTCLMcases/site_1x1_mexicocityMEX_I -> ./configure -case -# Now build and run normally -> ./site_1x1_mexicocityMEX_I.bluefire.build -# Here we show running interactively -> ./site_1x1_mexicocityMEX_I.bluefire.run - - - - - -Now, let's demonstrate using a different group list, doing a spinup, running with Qian -global forcing data, but using tower years to set the years to run over. This uses -the options: sitegroupname, ad_spinup, useQIAN, and QIANtower_years. - -Example of running &ptclm; for a spinup simulation with Qian data for tower years. - - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -> ./PTCLM.py -m bluefire -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux \ ---ad_spinup --useQIAN --QIAN_tower_yrs -> cd ../../../../../US-Ha1_ICN_QIAN_ad_spinup -> ./configure -case -# Now build and run normally -> ./US-Ha1_ICN_QIAN_ad_spinup.bluefire.build -# Here we show running interactively -> ./US-Ha1_ICN_QIAN_ad_spinup.bluefire.run - - - - - -Finally, let's demonstrate using a generic machine (which then requires the scratchroot -option), using the global grid for PFT and soil types, and setting the run length -to two months. - -Example of running &ptclm; on a generic machine with global PFT and soil types -dataset - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -# Note, see the with permission information -# to use the US-UMB data. -> ./PTCLM.py -m generic_darwin_intel -s US-UMB -d $CSMDATA --pftgrid --soilgrid \ ---scratchroot $HOME --run_n 2 --run_units nmonths -> cd ../../../../../US-UMB_ICN -> ./configure -case -# Now build -> ./US-UMB_ICN.generic_darwin_intel.build -# To get the files from the svn server... -# First list the files from the streams text file -> ../ccsm_utils/Tools/listfilesin_streams \ --t $HOME/US-UMB_ICN/run/clm1PT.1x1pt_US-UMB.stream.txt -l \ -> Buildconf/datm.input_data_list -# And now run the script to export data to your machine -> ../ccsm_utils/Tools/check_input_data -export -# Here we show running interactively -> ./US-UMB_ICN.generic_darwin_intel.run - - - - -Because of Bug 1364, when running this case as above we get a floating point -error after reaching time-step 124 for the example exactly as above. Other -machines or compilers probably won't have this problem. See the &KnownBugs; file -for more information on this problem. - - - - -As documented in Bug 1368, spinning up the US-UMB site for a I2000CN compset gives -zero Gross Primary Production (GPP). If the user wishes to use this site for &clmcn;, -they'll need to address this issue. -See the &KnownBugs; file for more information on this problem. - - - - - - -Adding data for use by &ptclm; - -&ptclm; Group Site Lists - -The "sitegroupname" option to &ptclm; looks for groups of sites in the -files in the PTCLM_sitedata directory under the &ptclm; directory. -You can add new names available for this option including your own lists of sites, by -adding more files in this directory. There are three files for each "sitegroupname": -$SITEGROUP_sitedata.txt, -$SITEGROUP_soildata.txt -and $SITEGROUP_pftdata.txt (where $SITEGROUP is the name that would -be entered as "sitegroupname" to &ptclm;). Each file needs to have the same list of sites, -but gives different information: site data, PFT data, and soil data respectively. -Although the site codes need to be the same between the three files, the files do NOT -have to be in the same order. Each file has a one-line header that lists the contents -of each column which are separated by commas. The first column for each of the files -is the "site_code" which must be consistent between the three files. The site code -can be any unique character string, but in general we use the AmeriFlux site code. - - -Site data file: $SITEGROUP_sitedata.txt): The header for -this file is: - -site_code,name,state,lon,lat,elev,startyear,endyear,alignyear - -The columns: name, state, and elevation are informational only. Name is a longer -descriptive name of the site, and state is the state for U.S. sites or country -for non U.S. sites. The columns: lon and lat are the longitude and latitude of -the location in decimal degrees. The last three columns are the start and ending -year for the data and the align year for an 1850 case for the data. The align year -is currently unused. - - -Soil data file: $SITEGROUP_soildata.txt): The header for this -file is: - -site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% - -The first three fields after "site_code" are currently unused. The only two that -are used are the percent sand and clay columns to set the soil texture. - - -PFT data file: $SITEGROUP_pftdata.txt): The header for this -file is: - -site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 - -This file gives the vegetation coverage for the different vegetation types for the site. -The file only supports up to five PFT's at the same time. The columns with "pft_f" are -the fractions for each PFT, and the columns with "pft_c" is the integer index of the -given PFT. Look at the pft-physiology file to see what the PFT index for each PFT type -is. - - - - -Dynamic Land-Use Change Files for use by &ptclm; - -There is a mechanism for giving site-specific land-use change in &ptclm;. Adding -site specific files to the PTCLM_sitedata directory under -&ptclm; allows you to specify the change in vegetation and change in harvesting -(for the CN model) for that site. Files are named: -$SITE_dynpftdata.txt. There is a sample file for the US-Ha1 -site called: US-Ha1_dynpftdata.txt. The file has a one-line -header with the information that the file has, and then one-line for each year -with a transition. The header line is as follows: - -trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze - -This file only requires a line for each year where a transition or harvest happens. As -in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the -PFT index, and only up to five vegetation types are allowed to co-exist. The last -eight columns have to do with harvesting and grazing. The last two columns are whether -to hold harvesting and/or grazing constant until the next transition year and will -just be either 1 or 0. This file will be converted by the -PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl script in the &ptclm; -directory to a format that mksurfdata can read that has an entry -for each year for the range of years valid for the compset in question. - - - - -Converting AmeriFlux Data for use by &ptclm; - -AmeriFlux data comes in comma separated format and is available from: - -http://public.ornl.gov/ameriflux/dataproducts.shtml. Before you -download the data you need to agree to the usage terms. - - -Here is a copy of the usage terms from the web-site on June/13/2011. - - -"The AmeriFlux data provided on this site are freely available and were furnished by -individual AmeriFlux scientists who encourage their use. Please kindly inform the -appropriate AmeriFlux scientist(s) of how you are using the data and of any publication -plans. Please acknowledge the data source as a citation or in the acknowledgments if the -data are not yet published. If the AmeriFlux Principal Investigators (PIs) feel that they -should be acknowledged or offered participation as authors, they will let you know and we -assume that an agreement on such matters will be reached before publishing and/or use of -the data for publication. If your work directly competes with the PI's analysis they may -ask that they have the opportunity to submit a manuscript before you submit one that uses -unpublished data. In addition, when publishing, please acknowledge the agency that -supported the research. Lastly, we kindly request that those publishing papers using -AmeriFlux data provide preprints to the PIs providing the data and to the data archive at -the Carbon Dioxide Information Analysis Center (CDIAC)." - - -The above agreement applies to the "US-UMB" dataset imported into our repository as -well, and Gil Bohrer is the PI on record for that dataset. - - -The &cesm; can NOT handle missing data, so we recommend using the "Level 4" Gap filled -datasets. -The fields will also need to be renamed. The "WS" column becomes "WIND", "PREC" becomes -"PRECmms", "RH" stays as "RH", "TA" becomes "TBOT", "Rg" becomes "FSDS", "Rgl" becomes -"FLDS", "PRESS" becomes "PSRF". "ZBOT" can just be set to the constant of "30" (m). -The units of Temperature need to be converted from "Celsius" to "Kelvin" (use the -value in SHR_CONST_TKFRZ in the file -models/csm_share/shr/shr_const.F90 of 273.15. -The units of Pressure also need to be converted from "kPa" to "Pa". LATIXY, and -LONGXY should also be set to the latitude and longitude of the site. - - - -&ptclm; transient example over a shorter time period - - -Example of running &ptclm; for transient land-use 1991-2006 for US-Ha1 on bluefire - -This is an example of using &ptclm; for Harvard Forest (AmeriFlux site code US-Ha1). In -order to do this we would've needed to have converted the AmeriFlux data into &netcdf; -format as show in the section above. Also note -that this site has a site-specific dynamic land-use change file for it -PTCLM_sitedata/US-Ha1_dynpftdata.txt in the &ptclm; directory -and this file will be used for land-use change and harvesting rather than the -global dataset. - - -> cd scripts/ccsm_utils/Tools/lnd/clm/PTCLM -# We are going to use forcing data over 1991 to 2006, but we need to start with -# a transient compset to do so, so we use the 20th Century transient: 1850-2000 -# Note: When creating the flanduse_timeseries dataset for this site it will use the -# PTCLM_sitedata/US-Ha1_dynpftdata.txt -# file for land-use change and harvesting -> ./PTCLM.py -m bluefire -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux \ --c I_1850-2000_CN -> mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 -> cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 -# Copy data in &netcdf; format to this directory, filenames should be YYYY-MM.nc -# The fieldnames on the file should be: -# FLDS,FSDS,LATIXY, LONGXY, PRECTmms,PSRF,RH,TBOT,WIND,ZBOT -# With units -# W/m2,W/m2,degrees_N,degrees_E,mm/s, Pa, %, K, m/s, m -# The time coordinate units should be: days since YYYY-MM-DD 00:00:00 -> cd ../../../../../US-Ha1_I_1850-2000_CN -# We need to turn cold-start on, so it doesn't expect an initial condition file -# preferably, you would generate your own initial condition file and then use -# the --finidat option to &ptclm; to enter it -> ./xmlchange -file env_conf.xml -id CLM_FORCE_COLDSTART -val on -# Now we need to set the start date to 1991, and have it cycle forcing data -# over 1991 to 2006 -> ./xmlchange -file env_conf.xml -id RUN_STARTDATE -val 1991-01-01 -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_ALIGN -val 1991 -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_END -val 2006 -> ./xmlchange -file env_conf.xml -id CLM_NAMELIST_OPTS -val \ -# Similarly for Nitrogen deposition data we cycle over: 1991 to 2006 -"model_year_align_ndep=1991,stream_year_first_ndep=1991,stream_year_last_ndep=2006" -# Now configure the case, and we'll edit the datm namelist for prescribed aerosols -> ./configure -case -# We also need to change the datm to run with aerosols over the 1991-2006 period -cat << EOF > patch.diff -*** datm.buildnml.csh.orig 2011-06-14 09:28:20.000000000 -0600 ---- datm.buildnml.csh 2011-06-14 09:28:57.000000000 -0600 -*************** -*** 32,38 **** - dataMode = 'CLMNCEP' - domainFile = '$DOMAINFILE' - streams = 'clm1PT.1x1pt_US-Ha1.stream.txt 1991 1991 2006 ', -! 'presaero.stream.txt 1849 1849 2006' - vectors = 'null','null' - mapmask = 'nomask','nomask' - mapalgo = 'nn','nn' ---- 32,38 ---- - dataMode = 'CLMNCEP' - domainFile = '$DOMAINFILE' - streams = 'clm1PT.1x1pt_US-Ha1.stream.txt 1991 1991 2006 ', -! 'presaero.stream.txt 1991 1991 2006' - vectors = 'null','null' - mapmask = 'nomask','nomask' - mapalgo = 'nn','nn' -EOF -# Apply the above patch to the datm build namelist file -> patch Buildconf/datm.buildnml.csh patch.diff - - - - - - -Because of bug 1361, this won't work out of the box. You'll need to add the change -to PTCLM.py given in the KnownBugs file on this issue. - - - - - - - - -A bit about the structure of &ptclm;, what it does, and how it works - -A large part of &ptclm; just sets up the different options and does error checking -on the options given. &ptclm; then uses the options provided to use -create_newcase to create a new case. It then queries both the -case directory and/or the XML database (using -queryDefaultNamelist.pl in models/lnd/clm/bld -and does other settings for the case. It then runs the different &clm; tools in turn to -create the necessary datasets and points to them in the case with the &CLMUSRDAT; option. -It runs mkgriddata, mksurfdata.pl, and -mkdatadomain as well as the aerdepregrid.ncl and -ndepregrid.ncl &ncl; scripts. mkgriddata and -mkdatadomain have template namelist files in the -scripts/ccsm_utils/Tools/lnd/clm/PTCLM/usr_files directory. -When running mksurfdata.pl if it finds a -$SITE_dynpftdata.txt in the -scripts/ccsm_utils/Tools/lnd/clm/PTCLM/PTCLM_sitedata directory -it will use that file for transient landuse changes (there's a sample file for -"US-Ha1" called US-Ha1_dynpftdata.txt). -It modifies the different env*.xml using -xmlchange and creates an initial &usernlclm; filename. After -&ptclm; is run you can then make changes to the case by hand, and configure, build -and run as normal. - - -There is a simple test script to test &ptclm;. See -for more information on using it. - - - - - diff --git a/doc/UsersGuide/single_point.xml b/doc/UsersGuide/single_point.xml deleted file mode 100644 index b07f76ecb6..0000000000 --- a/doc/UsersGuide/single_point.xml +++ /dev/null @@ -1,930 +0,0 @@ - - - -How to run Single-Point/Regional cases - -The &clm; also allows you to set up and run cases with a single-point or a local region as well -as global resolutions. This is often useful for running quick cases for testing, evaluating -specific vegetation types, or land-units, or running with observed data for a specific site. -There are four different ways to do this: &PTSMODE;, -&CLM1PT;, &CLMUSRDAT;, and with &ptclm;. - -&PTSMODE; -- to run for a single point -using global datasets. -&CLM1PT; -- to run for a supported single-point -or regional dataset. -&CLMUSRDAT; -- to run using your own datasets (single-point -or regional). -&ptclm; -- to easily setup simulations to run for -tower sites.. - - - - -&PTSMODE; and &ptclm; only work for a single point, while the other two options can -also work for regional datasets as well. - - - -Which Single Point Option Should I choose? - -In general is the quick and dirty method -that gets you started without having to create datasets -- but has limitations. It's -good for an initial attempt at seeing results for a point of interest, but since you -can NOT restart with it, it's usage is limited. It is the quickest method as you can -create a case for it directly from create_newcase. Although you -can't restart, running a single point is very fast, and you can run for long -simulation times even without restarts. If you need restarts a good solution is to use -getregional_datasets.pl and &CLMUSRDAT; -which can get you running almost as quickly as well as -&PTSMODE;. Like -&PTSMODE; - only runs for points that exist within -a global dataset. - - -Running &CLM1PT; is a great solution, if one of the supported -single-point/regional datasets, is your region of interest (see -). All the datasets are -created for you, and you can easily select one and run, pretty much, out of the box -with it. The problem is that there is a very limited set of supported datasets. You -can also use this method for your own datasets, but you have to create the datasets, -and add them to the XML database and to the &datm;. This is worthwhile if you want to -repeat many multiple cases for a given point or region. - - -Next, &CLMUSRDAT; is the best way to setup cases quickly -where you have to create your own datasets (see -). With this method you don't have to -change &datm; or add files to the XML database -- but you have to follow a strict -naming convention for files. However, once the files are named and in the proper -location, you can easily setup new cases that use these datasets. This is good -for treating all the required datasets as a "group" and for a particular -model version. For advanced &clm; developers who need to track dataset changes with -different model versions you would be best off adding these datasets as supported -datasets with the &CLM1PT; method. - - -Lastly &ptclm; is a great way to easily create datasets, -setup simulations and run simulations for tower sites. It takes advantage of both -&CLM1PT; and &CLMUSRDAT; internally. A big advantage to it, is that it's one-stop -shopping, it runs tools to create datasets, and runs create_newcase -and sets the appropriate env variables for you. So you only have to learn how to run -one tool, rather than work with many different ones. &ptclm; is described in the next -chapter . - - -Finally, if you also have meteorology data that you want to force your &clm; simulations -with you'll need to setup cases as described in . -You'll need to create &clm; datasets either according to &CLM1PT; -or &CLMUSRDAT;, but you'll also need to modify &datm; to use -your forcing data. And you'll need to change your forcing data to be in a format that -&datm; can use. In the &ptclm; chapter the -section tells you how to use AmeriFlux data for atmospheric forcing. - - - - -Running &PTSMODE; configurations - -&PTSMODE; enables you to run the model using global datasets, but just picking a -single point from those datasets and operating on it. It can be a very quick way to do fast -simulations and get a quick turnaround. - - -To setup a &PTSMODE; simulation you use the "-pts_lat" and "-pts_lon" -arguments to create_newcase to give the latitude and longitude of the point you want to -simulate for (the code will pick the point on the global grid nearest to the point you -give. Here's an example to setup a simulation for the nearest point at 2-degree resolution -to Boulder Colorado. - -> cd scripts -> ./create_newcase -case testPTS_MODE -res f19_g16 -compset I -mach bluefire \ --pts_lat 40.0 -pts_lon -105 -> cd testPTS_MODE -# We make sure the model will start up cold rather than using initial conditions -> ./xmlchange -file env_conf.xml -id &CLMFORCECOLD; -val on -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup - -Then configure, build and run as normal. We make sure initial conditions are NOT used -since &PTSMODE; currently CAN NOT run with initial conditions. - - - -By default it sets up to run with -USE_MPISERIAL (in the env_build.xml file) turned on, -which allows you to run the model interactively. On some machines this mode is NOT -supported and you may need to change it to FALSE before you are able to build. - - - - -&PTSMODE; currently does NOT restart nor -is it able to startup from global initial condition files. See bugs "1017 and 1025" -in the KnownLimitations file. - - - - -You can change the point you are simulating for at run-time by changing the values of -PTS_LAT and PTS_LON in the env_run.xml file. - - - - -Note, that when running with &PTSMODE; the number of processors -is automatically set to one. When running a single grid point you can only use a single -processor. You might also want to set the "env_conf" variable: USE_MPISERIAL to -TRUE so that you can also run interactively without having to use -&mpi; to start up your job. - - - - -Warning about Running with a Single-Processor on a Batch Machine - -This problem always comes up when running for a single point, because you can only use -a single-processor, but may come up in other instances when you are running with -one processor. This applies to all the different ways of running in single-point mode. - - - -A warning for submitting single-point simulations to the batch que when only using -one processor. On many machines this will mean using up at least an entire node, and -being charged for all the CPU's on that node even if you aren't using them. For example, -on the &ncar; machine bluefire, there are 32 processors for each node -and the batch scripts are setup to have exclusive use of that node (and hence be charged -for all 32 processors). There are similar issues on other machines, below we show you -what to do when running on bluefire. - - -To change this on bluefire -- change the following: - -#BSUB -q regular -#BSUB -N -#BSUB -x - -to... - -#BSUB -q share -#BSUB -N - -so remove the "#BSUB -x" which gives you the entire node exclusively, and change to the -share que. One other machines you may have to do something similar, but the particulars -depend on the given machine, hence you will need to consult with the system -administrators for the given machine you are running on. - - - - -Another similar problem on many machines is that some batch ques have a minimum number -of nodes or processors that can be used. On these machine you may have to change the -queue (in some way similar to the above for bluefire) and possibly the time-limits of -the job, to get it to run in the batch que. - - - -Another way to get around this problem is to run the job interactively using -USE_MPISERIAL so that you don't submit the job to the batch que. -For single point mode you also may want to consider using a smaller workstation or -cluster, rather than a super-computer, because you can't take advantage of the -multi-processing power of the super-computer anyway. - - - - -Running Supported Single-point/Regional Datasets - -In addition to &PTSMODE; the &clm; supports running using single-point or -regional datasets that are customized to a particular region. In the section below we -tell the user how to create their own dataset, but we also support a small number of -single-point and regional datasets that are ready to setup and run in the CESM modeling -system. - - -To get the list of supported dataset resolutions see the method given in the -section on use of &CLM1PT;, which results in the following: - -&res_list; - -The resolution names that have an underscore in them ("_") are all single-point or -regional resolutions. -To run with the supported single-point and regional datasets, you setup a simulation for the -"pt1_pt1" resolution and give the short-name for the file to use in the -env_conf.xml file. - - -To run for the Brazil test site -do the following: - -Example of running &clm; over a single-point test site in Brazil -with the default Qian atmosphere data forcing. - - -> cd scripts -> ./create_newcase -case testSPDATASET -res pt1_pt1 -compset I \ --mach bluefire -> cd testSPDATASET -# Configure to run for the test site -> set SITE=1x1_brazil -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-sitespf_pt $SITE" -> ./xmlchange -file env_conf.xml -id &CLM1PT; -val $SITE - - - - -Then configure, build and run normally. - - -Then to run for the urban Mexico City Mexico test site that also has atmosphere -forcing data, but to run it with the Qian forcing data, but over the period for -which it's own forcing data is provided do the following: - -Example of running &clm; over the single-point of Mexicocity Mexico -with the default Qian atmosphere data forcing. - - -> cd scripts -> ./create_newcase -case testSPDATASET -res pt1_pt1 -compset I \ --mach bluefire -> cd testSPDATASET -# Set a variable to the site you want to use (as it's used several times below) -> set SITE=1x1_mexicocityMEX -# Configure to run for the urban test site -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-sitespf_pt $SITE" -> ./xmlchange -file env_conf.xml -id &CLM1PT; -val $SITE -# Set &datm; prescribed aerosols to single-point dataset -# Will then use the dataset with just the point for this $SITE -> ./xmlchange -file env_conf.xml -id DATM_PRESAERO -val pt1_pt1 -# -# Set some of the settings that are particular to this site, by values contained -# in the XML database. For some sites, or for new sites this information won't be -# stored. And the queryDefaultNamelist.pl command will abort. -# -# Set &datm; start and end range (optional just to run over the same years that -# atmospheric forcing data is available for this site) -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_START -val \ -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist default_settings -silent -var datm_cycle_beg_year -justvalue` -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_END -val \ -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist default_settings -silent -var datm_cycle_end_year -justvalue` - - - - -Then configure, build and run normally. - - - -Just like &PTSMODE; above, By default it sets up to run with -USE_MPISERIAL (in the env_build.xml file) turned on, -which allows you to run the model interactively. On some machines this mode is NOT -supported and you may need to change it to FALSE before you are able to build. - - - - -See for a warning about running single-point jobs -on batch machines. - - - - -Note, that when running a pt1_pt1 resolution the number of processors -is automatically set to one. When running a single grid point you can only use a single -processor. You might also want to set the "env_conf" variable: USE_MPISERIAL to -TRUE so that you can also run interactively without having to use -mpi to start up your job. - - - -Running Supported Single-point Datasets that have their own Atmospheric Forcing - -Of the supported single-point datasets we have three that also have atmospheric forcing data -that go with them: Mexico City (Mexico), Vancouver, (Canada, British Columbia), and -urbanc_alpha (test data for an Urban inter-comparison project). Mexico city and Vancouver -also have "#ifdef" in the source code for them to work with modified urban data -parameters that are particular to these locations. They can be turned on by using -the &CLMCONFIG; &envconf; variable to set the "-sitespf_pt" option in the &clm; -&configure;. To turn on the atmospheric forcing for these datasets, you set the -&envconf; DATM_MODE variable to "CLM1PT", and then the atmospheric -forcing datasets will be used for the point picked. - - -When running with datasets that have their own atmospheric forcing you need to be careful -to run over the period that data is available. If you have at least one year of forcing -it will cycle over the available data over and over again no matter how long of a simulation -you run. However, if you have less than a years worth of data (or if the start date doesn't -start at the beginning of the year, or the end date doesn't end at the end of the year) then -you won't be able to run over anything but the data extent. In this case you will need to -carefully set the RUN_STARTDATE, START_TOD and -STOP_N/STOP_OPTION variables for your case to run over the entire time extent -of your data. For the supported data points, these values are in the XML database -and you can use the queryDefaultNamelist.pl script to query the values -and set them for your case (they are set for the three urban test cases: Mexicocity, Vancouver, and -urbanc_alpha). - - -In the example below we will show how to do this for the Vancouver, Canada point. - - -Example of running &clm; over the single-point of Vancouver Canada with -supplied atmospheric forcing data for Vancouver. - - -> cd scripts -# Create a case at the single-point resolutions -> ./create_newcase -case testSPDATASETnAtmForcing -res pt1_pt1 -compset I \ --mach bluefire -> cd testSPDATASETnAtmForcing -# Set a variable to the site you want to use (as it's used several times below) -> set SITE=1x1_vancouverCAN -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-sitespf_pt $SITE" -# Now set the CLM single-point variable to the site name -> ./xmlchange -file env_conf.xml -id &CLM1PT; -val $SITE -# Set the aerosols to use the single-point dataset for 2000 conditions -# You could also use the default global dataset, but running would be a bit slower -> ./xmlchange -file env_conf.xml -id DATM_MODE -val CLM1PT -# Set the coupling frequency to once an hour -> ./xmlchange -file env_conf.xml -id ATM_NCPL -val 24 -# Set the standard namelist options for an urban test site -> ./xmlchange -file env_conf.xml -id CLM_NML_USE_CASE -val stdurbpt -# Set many of the settings that are particular to this site, by values contained -# in the XML database. For some sites, or for new sites this information won't be -# stored. And the queryDefaultNamelist.pl command will abort. -# -# Set the start date -> setenv RUN_STARTDATE \ -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist default_settings -silent -var run_startdate -justvalue` -> setenv STARTDATE `echo $RUN_STARTDATE | sed s/-//g` -> @ START_YEAR = $STARTDATE / 10000 -> ./xmlchange -file env_conf.xml -id RUN_STARTDATE -val $RUN_STARTDATE -# Set the run length and start time of day -> ./xmlchange -file env_run.xml -id STOP_OPTION \ --val `../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist seq_timemgr_inparm -silent -var stop_option -justvalue` -> setenv STOP_N \ -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist seq_timemgr_inparm -silent -var stop_n -justvalue` -> ./xmlchange -file env_run.xml -id STOP_N -val $STOP_N -> ./xmlchange -file env_run.xml -id START_TOD \ --val `../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist seq_timemgr_inparm -silent -var start_tod -justvalue` -# Set &datm; start and end range... -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_START -val -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist default_settings -silent -var datm_cycle_beg_year -justvalue` -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_END -val -`../../models/lnd/clm/bld/queryDefaultNamelist.pl -res $SITE \ --namelist default_settings -silent -var datm_cycle_end_year -justvalue` -# Set the User namelist to set the output frequencies of the history files -# Setting the stdurbpt use-case option create three history file streams -# The frequencies and number of time-samples needs to be set -> cat << EOF > &usernlclm; -&clm_inparm - hist_mfilt = $STOP_N,$STOP_N,$STOP_N - hist_nhtfrq = -1,-1,-1 -/ -EOF -# Set align year to start year as defined above -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_ALIGN -val $START_YEAR -# Set &datm; prescribed aerosols to single-point dataset -# Will then use the dataset with just the point for this site -> ./xmlchange -file env_conf.xml -id DATM_PRESAERO -val pt1_pt1 -> ./configure -case - - - - -If you don't set the start-year and run-length carefully as shown above the -model will abort with a "dtlimit error" in the atmosphere model (see bug 1110 in -the KnownLimitations file for documentation on this). Since, the forcing data for -this site (and the MexicoCity site) is less than a year, the model won't be able to -run for a full year. The 1x1_urbanc_alpha site has data for more -than a full year, but neither year is complete hence, it has the same problem (see the -problem for this site above). - - - - -Just like &PTSMODE; above, By default it sets up to run with -USE_MPISERIAL (in the env_build.xml file) turned on, -which allows you to run the model interactively. On some machines this mode is NOT -supported and you may need to change it to FALSE before you are able to build. - - - - -See for a warning about running single-point jobs -on batch machines. - - - - -Note, that when running a pt1_pt1 resolution the number of processors -is automatically set to one. When running a single grid point you can only use a single -processor. You might also want to set the "env_conf" variable: USE_MPISERIAL to -TRUE so that you can also run interactively without having to use -mpi to start up your job. - - - - - - -Creating your own single-point/regional surface datasets - -The file: -Quickstart.userdatasets in the -models/lnd/clm/doc directory gives guidelines on how to create and run -with your own single-point or regional datasets. Below we reprint the above guide. - -&quickstart_userdata; - - - - -Using getregional_datasets.pl to get a complete suite of single-point/regional -surface datasets from global ones - -Use the regional extraction script to get regional datasets from the global ones -The getregional_datasets.pl script to extract out regional datasets of interest. -Note, the script works on all files other than the "finidat" file as it's a 1D vector file. -The script will extract out a block of gridpoints from all the input global datasets, -and create the full suite of input datasets to run over that block. The input datasets -will be named according to the input "id" you give them and the id can then be used -as input to &CLMUSRDAT; to create a case that uses it. See -the section on &clm; Script Configuration Items for -more information on setting &CLMUSRDAT; (in ). The list of files extracted by -their name used in the namelists are: -fatmgrid, fatmlndfrc, -fsurdat, flanduse_timeseries, -stream_fldfilename_ndep, and the &datm; files -domainfile, and faerdep. -For more information on these files see the Table on required files. - - -The alternatives to using this script are to use &PTSMODE;, -discussed earlier, to use &ptclm; discussed in the next chapter, or creating the files -individually using the different file creation tools (given in the -Tools Chapter). Creating -all the files individually takes quite a bit of effort and time. &PTSMODE; -has some limitations as discussed earlier, but also as it uses global files, is -a bit slower when running simulations than using files that just have the set -of points you want to run over. Another advantage is that once you've created the -files using this script you can customize them if you have data on this specific -location that you can replace with what's already in these files. - - -The script requires the use of both "Perl" and "NCL". See the NCL Script section in the Tools Chapter -on getting and using NCL and NCL scripts. The main script to use is a &perl; script -which will then in turn call the NCL script that actually creates the output files. -The ncl script gets it's settings from environment variables set by the perl script. -To get help with the script use "-help" as follows: - -> cd models/lnd/clm/tools/ncl_scripts -> ./getregional_datasets.pl -help - -The output of the above is: - -&getreg_datasets; - - - -The required options are: -id, --ne, and -se, for the output identifier -name to use in the filenames, latitude and longitude of the Northeast corner, and -latitude and longitude of the SouthEast corner (in degrees). Options that specify -which files will be used are: -mask, -res, --rcp, -sim_year, and -sim_yr_rng -for the land-mask to use, global resolution name, representative concentration pathway -for future scenarios, simulation year, and simulation year range. The location of the -input and output files will be determined by the option -mycsmdata -(can also be set by using the environment variable $CSMDATA). If -you are running on a machine like at &ncar; where you do NOT have write permission -to the CESM inputdata files, you should use the scripts/link_dirtree -script to create soft-links of the original files to a location that you can write -to. This way you can use both your new files you created as well as the original -files and use them from the same location. - - -The remaining options to the script are -debug, -and -verbose. -debug is used to show what -would happen if the script was run, without creating the actual files. --verbose adds extra log output while creating the files so you -can more easily see what the script is doing. - - -For example, Run the extraction for data from 52-73 North latitude, 190-220 longitude -that creates 13x12 gridcell region from the f19 (1.9x2.5) global resolution over Alaska. - -Example of running <command>getregional_datasets.pl</command> to get -datasets for a specific region over Alaska - -> cd scripts -# First make sure you have a inputdata location that you can write to -# You only need to do this step once, so you won't need to do this in the future -> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data -> ./link_dirtree $CSMDATA $MYCSMDATA -> cd ../models/lnd/clm/tools/ncl_scripts -> ./getregional_datasets.pl -sw 52,190 -ne 73,220 -id 13x12pt_f19_alaskaUSA -mycsmdata $MYCSMDATA - - -Repeat this process if you need files for multiple sim_year, resolutions, land-masks, -and sim_year_range values. - - - -See for a warning about running single-point jobs -on batch machines. - - - - -See for notes about managing your data -when using link_dirtree. - - - -Now to run a simulation with the datasets created above, you create a single-point -case, and set &CLMUSRDAT; to the identifier used above. Note that in the example below -we set the number of processors to use to one (-pecount 1). For a single point, you -should only use a single processor, but for a regional grid, such as the example below -you could use up to the number of grid points (12x13=156 processors. - - -Example of using &CLMUSRDAT; to run a simulation using user datasets for a -specific region over Alaska - -> cd scripts -# Create the case and set it to only use one processor -> ./create_newcase -case my_userdataset_test -res pt1_pt1 -compset I1850 \ --mach bluefire -> cd my_userdataset_test/ -> ./xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA -> ./xmlchange -file env_conf.xml -id &CLMUSRDAT; -val 13x12pt_f19_alaskaUSA -> ./xmlchange -file env_conf.xml -id &CLMBLDNML; -val '-mask gx1v6' -> ./xmlchange -file env_conf.xml -id &CLM1PT; -val 13x12pt_f19_alaskaUSA -> ./configure -case - - - - - - - -Running with your own atmosphere forcing - -Here we want to run with our own customized datasets for &clm; as well as -running with our own supplied atmosphere forcing datasets. Thus we effectively -combine the information from with -. First we need to follow -the procedures in to come up with &clm; -datasets that are customized for our point or region in question. This includes -running link_dirtree to create a directory location where you -can add your own files to it. Next, set -DATM_MODE to "CLM1PT" and &CLM1PT; and &CLMUSRDAT; to the -id of the data you created. To see a list of what the filenames need to be -see the section on setting &CLMUSRDAT;. - - -Next we need to setup the atmosphere forcing data in &netcdf; format that can be -read by &datm;. There is a list of eight variables that are expected to be on the input -files with the names and units on the following table (in the table TDEW and SHUM -are optional fields that can be used in place of RH). In the table we also list -which of the fields are required and if not required what the code will do to -replace them. If the names of the fields are different or the list is changed -from the standard list of eight fields: FLDS, FSDS, PRECTmms, -PSRF, RH, TBOT, WIND, and ZBOT, the resulting streams file will need to be modified -to take this into account (see an example streams file for this in below). - -Atmosphere Forcing Fields - - - - Short-name - Description - Units - Required? - If NOT required how replaced - - - - - FLDSincident longwave -(FLDS)W/m2No -calculates based on Temperature, Pressure and Humidity - - - FSDSincident solar -(FSDS)W/m2Yes- - - - FSDSdifincident solar (FSDS) -diffuseW/m2Nobased on FSDS - - - FSDSdirincident solar (FSDS) -directW/m2Nobased on FSDS - - - PRECTmmsprecipitation -(PRECTmms)mm/sYes- - - - PSRFpressure at the lowest atm level -(PSRF)PaNoassumes standard-pressure - - - RHrelative humidity at the lowest atm level -(RH)%Nocan be replaced with SHUM or TDEW - - - SHUMspecific humidity at the lowest atm level -kg/kgOptional in place of RHcan be replaced with RH or TDEW - - - TBOTtemperature at the lowest atm level -(TBOT)K (or can be C)Yes- - - - TDEWdew point temperature -K (or can be C)Optional in place of RHcan be replaced with RH or SHUM - - - WINDwind at the lowest atm level -(WIND)m/sYes- - - - ZBOTobservational heightmNo -assumes 30 meters - - - -
-All of the variables should be dimensioned: time, lat, lon, with time being the unlimited -dimension. The coordinate variable "time" is also required with CF-compliant units in -days, hours, minutes, or seconds. It can also have a calendar attribute that can -be "noleap" or "gregorian". Normally the files will be placed in the: -$MYCSMDATA/atm/datm7/CLM1PT_data/$MYUSRDAT directory with separate files per -month called YYYY-MM.nc where YYYY-MM corresponds to the four -digit year and two digit month with a dash in-between. You also need a domain file that -gives the coordinate information for the data that should be placed in: -$MYCSMDATA/atm/datm7/domain.lnd.$MYUSRDAT_USGS.nc. - -Example of setting up a case with your own atmosphere forcing - -> cd scripts -# First make sure you have a inputdata location that you can write to -# You only need to do this step once, so you won't need to do this in the future -> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data -> ./link_dirtree $CSMDATA $MYCSMDATA -# Next create and move all your datasets into $MYCSMDATA with id $MYUSRDAT -# See above for naming conventions - -# Now create a single-point case -> ./create_newcase -case my_atmforc_test -res pt1_pt1 -compset I1850 \ --mach bluefire -> cd my_atmforc_test -# Set the data root to your inputdata directory, and set &CLM1PT; and &CLMUSRDAT; -# to the user id you created for your datasets above -> ./xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA -> ./xmlchange -file env_conf.xml -id &CLM1PT; -val $MYUSRDAT -> ./xmlchange -file env_conf.xml -id &CLMUSRDAT; -val $MYUSRDAT -# Set the land-mask to USGS, so both clm and &datm; can find files -> ./xmlchange -file env_conf.xml -id &CLMBLDNML; -val '-mask USGS' -# Then set DATM_MODE to single-point mode so &datm; will use your forcing datasets -# Put your forcing datasets into $MYCSMDATA/atm/datm7/CLM1PT_data/$MYUSRDAT -> ./xmlchange -file env_conf.xml -id DATM_MODE -val CLM1PT -> ./configure -case -# If the list of fields, or filenames, filepaths, or fieldnames are different -# you'll need to edit the &datm; namelist streams file to make it consistent -> $EDITOR Buildconf/datm.buildnml.csh - - -
- - -See for a warning about running single-point jobs -on batch machines. - - - - -See for notes about managing your data -when using link_dirtree. - - - - -Now, we'll show an example of what the &datm; streams file might look like for a case -with your own forcing data with 3-hourly forcing. In this example, we'll leave off the -fields: ZBOT, and FLDS so they'll be calculated as given in the - table above. We'll also include: -FSDSdif and FSDSdir which aren't required, and we'll use TDEW in place of RH. In this -example the datafiles are in &netcdf; format and contain the fields: TA, Tdew, WS, -PREC, Rg, Rgdir, Rgdif, and PRESS which are translated into the &datm; internal names -in this streams file. There is also a domain file that has the position information -for this location. The normal assumption for CLM1PT mode in the &datm; is that data is -hourly or half-hourly and as such is often enough that using the data on the nearest -time-stamp is reasonable and as such the data is in a single streams file (see - for more information on -the default settings for &datm; and how to change them. If the data is less often three to six hours -- see -below, where you will need to modify the time-interpolation method as well as the -time stamp offsets. In the example below we also have to divide the single -stream file into three files to manage the time-stamps and time interpolation -algorithm for the different types of data differently. - -Example of &datm; streams files with your own forcing for 3-hourly data - -Precipitation streams file -(clm1PT.1x1pt_lapazMEX.precip.stream.txt file) . - - -<streamstemplate> -<stream> - <dataSource> - CLMNCEP - </dataSource> - <domainInfo> - <variableNames> - time time - xc lon - yc lat - area area - mask mask - </variableNames> - <filePath> - $DIN_LOC_ROOT/atm/datm7/domain.clm - </filePath> - <fileNames> - domain.lnd.1x1pt_lapazMEX_navy.nc - </fileNames> - </domainInfo> - <fieldInfo> - <variableNames> - PRECTmms PREC - </variableNames> - <offset> - -5400 - </offset> - <filePath> - $DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX - </filePath> - <fileNames> - 2004-01.nc - 2004-02.nc - 2004-03.nc -. -. -. - 2009-12.nc - </fileNames> - </fieldInfo> -</stream> -</streamstemplate> - - -Solar streams file (clm1PT.1x1pt_lapazMEX.solar.stream.txt file). - - -<streamstemplate> -<stream> - <dataSource> - CLMNCEP - </dataSource> - <domainInfo> - <variableNames> - time time - xc lon - yc lat - area area - mask mask - </variableNames> - <filePath> - $DIN_LOC_ROOT/atm/datm7/domain.clm - </filePath> - <fileNames> - domain.lnd.1x1pt_lapazMEX_navy.nc - </fileNames> - </domainInfo> - <fieldInfo> - <variableNames> - FSDS Rg - FSDSdir Rgdir - FSDSdif Rgdif - </variableNames> - <offset> - -10800 - </offset> - <filePath> - $DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX - </filePath> - <fileNames> - 2004-01.nc - 2004-02.nc - 2004-03.nc -. -. -. - 2009-12.nc - </fileNames> - </fieldInfo> -</stream> -</streamstemplate> - - -Other fields streams file. -(clm1PT.1x1pt_lapazMEX.other.stream.txt file) . - - -<streamstemplate> -<stream> - <dataSource> - CLMNCEP - </dataSource> - <domainInfo> - <variableNames> - time time - xc lon - yc lat - area area - mask mask - </variableNames> - <filePath> - $DIN_LOC_ROOT/atm/datm7/domain.clm - </filePath> - <fileNames> - domain.lnd.1x1pt_lapazMEX_navy.nc - </fileNames> - </domainInfo> - <fieldInfo> - <variableNames> - TBOT TA - TDEW Tdew - WIND WS - PSRF PRESS - </variableNames> - <offset> - -5400 - </offset> - <filePath> - $DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX - </filePath> - <fileNames> - 2004-01.nc - 2004-02.nc - 2004-03.nc -. -. -. - 2009-12.nc - </fileNames> - </fieldInfo> -</stream> -</streamstemplate> - - -Example streams namelist for the above streams files: - - - &shr_strdata_nml - dataMode = 'CLMNCEP' - domainFile = '$DOMAINFILE' - streams = 'clm1PT.1x1pt_lapazMEX.solar.stream.txt 1 2004 2009 ', - 'clm1PT.1x1pt_lapazMEX.precip.stream.txt 1 2004 2009 ', - 'clm1PT.1x1pt_lapazMEX.other.stream.txt 1 2004 2009 ', - 'presaero.stream.txt 1 2000 2000' - vectors = 'null','null','null','null' - mapmask = 'nomask','nomask','nomask','nomask' - mapalgo = 'nn','nn','nn','nn' - tintalgo = 'coszen','nearest','linear','linear' - taxmode = 'cycle','cycle','cycle','cycle' - / - - - - - -The example above shows the resolved namelist and streams file after &configure; -has been run. In order to save this configuration for future use, you would need -to edit the &datm; template adding new DATM_MODE see - for more information on how to do this. - - - - -We've outlined and given a few examples of using your own atmosphere -forcing. In the next chapter we go into the details of using &ptclm;. - - -
- -
- diff --git a/doc/UsersGuide/special_cases.xml b/doc/UsersGuide/special_cases.xml deleted file mode 100644 index ac5c7fef3b..0000000000 --- a/doc/UsersGuide/special_cases.xml +++ /dev/null @@ -1,916 +0,0 @@ - - -How to run some special cases - -In this chapter we describe how to run some special cases that take more than one step -to do. The straightforward cases have compsets and/or build-namelist use-cases setup for -them or require simple editing of a single-case. All of the cases here require you -to do at least two simulations with different configurations, or require more complex -editing of the case (changing the streams files). - - -The nine cases we will describe are: - - - -Running with the prognostic crop model on - - - - -Running with the irrigation model on - - - - -Spinning up the Satellite Phenology Model (&clmsp; spinup) - - - - -Spinning up the biogeochemistry Carbon-Nitrogen Model (CN spinup) - - - - -Spinning up the Carbon-Nitrogen Dynamic Global Vegetation Model (CNDV spinup) - - - - -Running with MOAR data as atmospheric forcing to spinup the model - - - - -Running with your own previous simulation as atmospheric forcing to spinup the model - - - - -Doing perturbation error growth tests - - - - -Running stand-alone &clm; with transient historical &CO2; -concentration - - - - - - -The cases in this chapter are more sophisticated and require more technical knowledge -and skill than cases in previous chapters. The user should be very familiar with doing -simple cases before moving onto the cases described here. - - - -Running with the prognostic crop model on - - -In &clmcesm103; a prognostic crop model was added to &clm4;. The prognostic crop -model is setup to work with CN for present day conditions and we have surface -and initial condition datasets at f19 resolution. In order to use the initial condition -file, we need to set the RUN_TYPE to startup rather -than hybrid since the compset for f19 sets up to use an initial -condition file without crop active. To activate the crop model we simply add "-crop on" -to &CLMCONFIG;. - -Example Crop Simulation - -> cd scripts -> ./create_newcase -case CROP -res f19_g16 -compset ICN -mach bluefire -> cd CROP -# Append "-crop on" to &CLMCONFIG; in env_conf.xml (you could also use an editor) -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-crop on" -append -# Change to startup type so uses spunup initial conditions file for crop if it exists -# By default the model will do a hybrid startup with an initial condition file -# incompatible with the crop surface dataset. -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup -> ./configure -case -# Now build and run normally -> ./CROP.bluefire.build -> ./CROP.bluefire.submit - - - - - - -Running with the irrigation model on - - -In &clmcesm103; an irrigation model for generic crop was added to &clm4;. Currently, -irrigation and crop can NOT be used together see bug number 1326 in the -&KnownBugs; file. -The irrigation model is tuned to work only with &clmsp; see the caution below for -for more information on this. To turn on -irrigation we simply add "-irrig on" to &CLMBLDNML;. Just as in the crop example we -also change RUN_TYPE to startup so that we don't use -an initial condition file that is incompatible with irrigation. - -Example Irrigation Simulation - -> cd scripts -# Note here we do a &clmsp; simulation as that is what has been validated -> ./create_newcase -case IRRIG -res f19_g16 -compset I -mach bluefire -> cd IRRIG -# Append "-irrig on" to &CLMBLDNML; in env_conf.xml (you could also use an editor) -> ./xmlchange -file env_conf.xml -id &CLMBLDNML; -val "-irrig" -append -# Change to startup type so uses spunup initial conditions file for irrigation if it exists -# By default the model will do a hybrid startup with an initial condition file -# incompatible with the irrigation surface dataset. -> xmlchange -file env_conf.xml -id RUN_TYPE -val startup -> ./configure -case -# Now build and run normally -> ./IRRIG.bluefire.build -> ./IRRIG.bluefire.submit - - - - -We have only run the irrigation model with &clmsp; (i.e. without the CN model). We -recommend that if you want to run the irrigation model with CN, that you do a spinup -as outlined in the examples below. But, more than that you may need to make -the adjustments we discuss in . - - - - - - -Spinning up the Satellite Phenology Model (&clmsp; spinup) - - -To spin-up the &clmsp; model you merely need to run &clmsp; for 50 simulation -years starting from arbitrary initial conditions. You then use the final -restart file for initial conditions in other simulations. -Because, this is a straight forward operation we will NOT give -the details on how to do that here, but leave it as an exercise for the reader. -See the as an example of doing this -as the last step for &clmcn;. - - - - -Spinning up the biogeochemistry Carbon-Nitrogen Model (CN spinup) - -To get the &clmcn; model to a steady state, you first run it from arbitrary initial conditions -using the "accelerated decomposition spinup" (-ad_spinup in configure) mode for 600 simulation years. After -this you branch from this mode in the "exit spinup" (-exit_spinup in configure), run -for a simulation year, and then save a restart from that and use it as initial conditions -for further spinup of CN (at least 50 simulation years). - - -Spinup of &clmcn; - -AD_SPINUP - -For the first step of running 600 years in "-ad_spinup" mode, you will setup -a case, and then edit the values in env_conf.xml and -env_run.xml so that the right configuration is turned on and -the simulation is setup to run for the required length of simulation time. -So do the following: - -Example AD_SPINUP Simulation - -> cd scripts -> ./create_newcase -case CN_spinup -res f19_g16 -compset ICN -mach bluefire -> cd CN_spinup -# Append "-ad_spinup on" to &CLMCONFIG; in env_conf.xml -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-ad_spinup on" -append -# The following sets &CLMFORCECOLD; to "on" in env_conf.xml (you could also use an editor) -> ./xmlchange -file env_conf.xml -id &CLMFORCECOLD; -val on -# Make the output history files only annual, by adding the following to the &usernlclm; namelist -> echo '&clm_inparm hist_nhtfrq = -8760 /' > &usernlclm; -# Now configure -> ./configure -case -> ./xmlchange -file env_run.xml -id STOP_DATE -val 6010101 -# Now build -> ./CN_spinup.bluefire.build -# The following sets RESUBMIT to 30 times in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id RESUBMIT -val 30 -# The following sets STOP_OPTION to "nyears" in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears -# The following sets STOP_N to 20 years in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_N -val 20 -# The following sets STOP_DATE to Jan/1 of year 601 in env_run.xml (you could also use an editor) -# Now run normally -> ./CN_spinup.bluefire.submit - - -Afterwards save the last restart file from this simulation to use in the next step. - - - - -EXIT_SPINIP - - -Example EXIT_SPINUP Simulation - -> cd scripts -> ./create_newcase -case CN_exitspinup -res f19_g16 -compset ICN -mach bluefire -> cd CN_exitspinup -# Append "-exit_spinup on" to &CLMCONFIG; in env_conf.xml -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-exit_spinup on" -append -# Change run type to branch and branch from the last year of the last simulation -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val branch -> ./xmlchange -file env_conf.xml -id RUN_REFCASE -val CN_spinup -> ./xmlchange -file env_conf.xml -id RUN_REFDATE -val 0601-01-01 -> ./xmlchange -file env_conf.xml -id GET_REFCASE -val FALSE -> ./configure -case -# Go ahead and build, so that the run directory is created -> ./CN_exitspinup.bluefire.build -# Now, Copy the last restart files from the earlier case into your run directory -> cp /ptmp/$LOGIN/archive/CN_spinup/rest/CN_spinup.*.r*.0601-01-01-00000* /ptmp/$LOGIN/CN_exitspinup -# And copy the rpointer files for datm and drv from the earlier case -> cp /ptmp/$LOGIN/archive/CN_spinup/rest/rpointer.atm /ptmp/$LOGIN/CN_exitspinup -> cp /ptmp/$LOGIN/archive/CN_spinup/rest/rpointer.drv /ptmp/$LOGIN/CN_exitspinup -# The following sets STOP_OPTION to "nyears" in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears -> ./xmlchange -file env_run.xml -id STOP_N -val 1 -# Now run normally -> ./CN_exitspinup.bluefire.submit - - - - - - -Final spinup - -Next save the last restart file from this step and use it as the "finidat" file to -use for one more spinup for at least 50 years in normal mode. -So do the following: - -Example Final CN Spinup Simulation - -> cd scripts -> ./create_newcase -case CN_finalspinup -res f19_g16 -compset ICN -mach bluefire -> cd CN_finalspinup -# The following sets &CLMFORCECOLD; to "on" in env_conf.xml (you could also use an editor) -> ./xmlchange -file env_conf.xml -id &CLMFORCECOLD; -val on -# Now, Copy the last &clm; restart file from the earlier case into your run directory -> cp /ptmp/$LOGIN/archive/CN_exitspinup/rest/CN_exitspinup.clm*.r*.0602-01-01-00000.nc \ -/ptmp/$LOGIN/CN_finalspinup -# And copy the rpointer files for datm and drv from the earlier case -> cp /ptmp/$LOGIN/archive/CN_exitspinup/rest/rpointer.atm /ptmp/$LOGIN/CN_finalspinup -> cp /ptmp/$LOGIN/archive/CN_exitspinup/rest/rpointer.drv /ptmp/$LOGIN/CN_finalspinup -# Set the finidat file to the last restart file saved in previous step -> echo '&clm_inparm finidat = "CN_exitspinup.clm2.r.0602-01-01-00000.nc" /' > &usernlclm; -# Now configure -> ./configure -case -> $EDITOR Buildconf/clm.buildnml.csh -> Now build -> .CN_finalspinup.bluefire.build -# The following sets RESUBMIT to 5 times in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id RESUBMIT -val 5 -# The following sets STOP_OPTION to "nyears" in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears -# The following sets STOP_N to 10 years in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_N -val 10 -> Now run as normal -> .CN_finalspinup.bluefire.submit - - - - -To assess if the model is spunup plot trends of CN variables of interest. If you see -a trend, you may need to run the simulation longer. -Finally save the restart file from the end of this simulation to use as an "finidat" file for future -simulations. - - - - - - -Spinning up the Carbon-Nitrogen Dynamic Global Vegetation Model (CNDV spinup) - -To spinup the &clm; CNDV model -- you first follow the procedures above to spinup the CN model. -Then you take the CN initial state file you created for the spinup with just CN, and -run CNDV for 200 more years. -We've provided such spunup files for two resolutions (f09 and f19) and two time-periods -(1850 and 2000), so in this example we will use the files provided to start from. -We've also provided a spinup file at f19 resolution for CNDV, hence the following is -NOT required when running at f19. -If you were to start from your own &clmcn; spunup files -- the procedure would require -some modification. -There are no compsets using CNDV, so in -env_conf.xml change CLM_CONFIG_OPTS to --bgc cndv. - -Example CNDV Spinup Simulation - -> cd scripts -> ./create_newcase -case CNDV_spinup -res f09_g16 -compset ICN -mach bluefire -> cd CNDV_spinup -# Set run type to startup and do a cold start -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup -# The following sets CLM_CONFIG_OPTS to "-bgc cndv" in env_conf.xml (you could also use an editor) -> ./xmlchange -file env_conf.xml -id CLM_CONFIG_OPTS -val "-bgc cndv" -# Make the default primary history file annual and add an annual 1D vector auxiliary file -# By putting the following in a &usernlclm; file. -> cat << EOF > &usernlclm; -&clm_inparm - hist_nhtfrq = -8760, -8760 - hist_mfilt = 1, 1 - hist_fincl2 = 'TLAI', 'TSAI', 'HTOP', 'HBOT', 'NPP' - hist_dov2xy = .true., .false. -/ -> ./configure -case -# NOTE: If you were using your own CN spinup files you would edit the namelist to use it -# $EDITOR Buildconf/clm.buildnml.csh -# -# Now build and run as normal -> ./CNDV_spinup.bluefire.build -# The following sets RESUBMIT to 10 times in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id RESUBMIT -val 10 -# The following sets STOP_OPTION to "nyears" in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears -# The following sets STOP_N to 20 years in env_run.xml (you could also use an editor) -> ./xmlchange -file env_run.xml -id STOP_N -val 20 -# Make sure you turn archiving on, so you save your files to long term archival -> ./xmlchange -file env_run.xml -id DOUT_L_MS -val TRUE -> ./CNDV_spinup.bluefire.submit - - - - - -There is a build bug with &clmcesm103; see bug 1370 in the &KnownBugs; on -how to address this. - - - - - -In a data analysis tool you should examine the auxiliary file and examine the -pfts1d_wtgcell to see where and what types of vegetation have -been established. See the caution in for more -information on visualizing and analyzing 1D vector fields. - - - -CNDV also writes out two vector fields to "hv" auxiliary files, on an annual basis by -default. - - - - -We've provided a spinup file for CNDV at f19 resolution, you could also use -interpinic to interpolate this file to other resolutions. - - - - - -Running with MOAR data as atmospheric forcing to spinup the model - -Because it takes so long to spinup the CN model (as we just saw previously), if you -are doing fully coupled simulations with active atmosphere and ocean, you will want -to do the spinup portion of this "offline". So instead of doing expensive fully -coupled simulations for the spinup duration, you run &clm; in a very cheap "I" -compset using atmospheric forcing from a shorter fully coupled simulation -(or a simulation run previously by someone else). - - -In this example we will use the I1850SPINUPCN compset to setup -&clm; to run with atmospheric forcing from a previous fully coupled simulation with -data that is already stored on disk on bluefire. There are several simulations that -have high frequency data for which we can do this. You can also do this on a machine -other than bluefire, but would need to download the data from the Earth System Grid and -change the datapath similar to . -This compset is designed for constant -1850 conditions, but unfortunately (because of bug 1354 see the &KnownBugs; file) by -default it points to a transient simulation instead of an 1850 simulation. Here we -point to an 1850 simulation and setup the forcing years to run over. - -Example Simulation with MOAR Data on bluefire - -> cd scripts -> ./create_newcase -case MOARforce1850 -res f19_g16 -compset I1850SPINUPCN -mach bluefire -> cd MOARforce1850 -# The following sets the casename to point to for atm forcing (you could also use an editor) -> ./xmlchange -file env_conf.xml -id DATM_CPL_CASE -val b40.1850.track1.1deg.006a -# The following sets the align year and years to run over for atm forcing -# (you could also use an editor) -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_ALIGN -val 1 -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_START -val 960 -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_END -val 1030 -> ./configure -case -# Now build and run as normal -> ./MOARforce1850.bluefire.build -> ./MOARforce1850.bluefire.submit - - - - -Because of bug 1339 (see the &KnownBugs; file on this) -you can't run with 83 or more years of forcing. If you do need to run with more years of -forcing, you'll need to address the issue as outlined in the &KnownBugs; file. - - - - - - -Running with your own previous simulation as atmospheric forcing to spinup the model - -Another way that you might want to spinup the model is to run your own simulation -for a relatively short period (either a B, E, or F compset) and then use it as forcing -for your "I" case later. By only running 20 to 50 years for the fully coupled case, -you'll save a substantial amount of computer time rather than running the entire spinup -period with a fully coupled model. - - -The first thing we need to do is to run a fully coupled case and save the atmospheric -coupling fields on a three hourly basis. In this example, we will run on bluefire -and archive the data to a local disk that we can then use in the next simulation. - -Example Fully Coupled Simulation to Create Data to Force Next Example Simulation - -> cd scripts -> ./create_newcase -case myBCN1850 -res f09_g16 -compset B1850CN -mach bluefire -> cd myBCN1850 -> ./configure -case -# Set histaux_a2x3hr to .true. in cpl.buildnml.csh so output from the atmosphere model -# will be saved 3 hourly -$EDITOR BuildConf/cpl.buildnml.csh -# Now build -> ./myBCN1850.bluefire.build -# The following sets the archival disk space (you could also use an editor) -> ./xmlchange -file env_run.xml -id DOUT_S_ROOT -val '/glade/home/$USER/$CASE' -# Make sure files are archived to disk, but NOT to long term storage -# (you could also use an editor) -> ./xmlchange -file env_run.xml -id DOUT_S -val TRUE -> ./xmlchange -file env_run.xml -id DOUT_L_MS -val FALSE -# Set the run length to run a total of 20 years (you could also use an editor) -> ./xmlchange -file env_run.xml -id RESUBMIT -val 9 -> ./xmlchange -file env_run.xml -id STOP_OPTION -val nyears -> ./xmlchange -file env_run.xml -id STOP_N -val 2 -# Now run as normal -> ./myBCN1850.bluefire.submit - - - - -Now we run an I compset forced with the data from the previous simulation using -the &CPLHIST; option to DATM_MODE. See - for more information on the -&datm; settings for &CPLHIST; mode. - -Example Simulation Forced with Data from the Previous Simulation - -> cd scripts -> ./create_newcase -case frcwmyBCN1850 -res f09_g16 -compset I1850SPINUPCN -mach bluefire -> cd frcWmyBCN1850 -# The following sets the casename to point to for atm forcing (you could also use an editor) -> ./xmlchange -file env_conf.xml -id DATM_CPL_CASE -val "myBCN1850" -# The following sets the align year and years to run over for atm forcing -# (you could also use an editor) -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_ALIGN -val "1" -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_START -val "1" -> ./xmlchange -file env_conf.xml -id DATM_CPL_YR_END -val "20" -# Set the datapath in the template to the archival path from the case above -> sed -E 's#set datapath = ".+"#set datapath = "/glade/home/$USER/%c/cpl/hist"#' \ - Tools/Templates/datm.cpl7.template > new.datm.cpl7.template -> mv -f new.datm.cpl7.template Tools/Templates/datm.cpl7.template -> chmod +x Tools/Templates/datm.cpl7.template -> ./configure -case -# Now build and run as normal -> ./frcwmyBCN1850.bluefire.build -> ./frcwmyBCN1850.bluefire.submit - - - - -In order to accomplish this we needed to edit the &datm; template file. See - for more information on doing this. -If your input case was at a resolution besides f09 you would have to edit -the &datm; template file even further to use a domain file at the input resolution. - - - - - - -Doing perturbation error growth tests - -Doing perturbation error growth tests is a way to validate a port of -the model to a new machine or to verify that changes are only roundoff. -The steps are the same in either case, but in the discussion below I will -assume you are doing a port validation to a new machine (but in parentheses -I will put a reminder that it could also be for code-mods). -The basic idea is to run a case on the trusted machine (trusted code) and -another with initial conditions perturbed by roundoff and compare the results of -the two. The difference between these two simulations (the error) will grow over time -and describe a curve that we compare with the error growth on the new machine (code -changes). The error growth on the new machine is the difference between the non-perturbed -state on the trusted machine and the non-perturbed state on the new machine (code -changes). If the new machine (code changes) are well-behaved -the plot of this error growth compared to the error growth curve on the trusted machine -should be similar. If the -changes are NOT well-behaved the changes from the new machine (code changes) will be -larger than the perturbation changes. In summary the simulations and steps that need to be performed are: - - -Run a simulation with the trusted code on the trusted machine. -(optionally you can use a dataset from inputdata repository). - - - -Run a simulation with the trusted code on the trusted machine with initial conditions -perturbed by roundoff (using a namelist item to do so). -(this is optional is you are using inputdata repository datasets) - - - -Run a simulation with the new code on the non-trusted machine (code changes). - - -Do a plot of the RMS difference of history variables between simulation 1 and simulation 2. - - -Do a plot of the RMS difference of history variables between simulation 1 and simulation 3. - - -Compare the two plots in steps 4 and 5. - - -If the plots compare well the new machine (code changes) is running as well as the trusted machine. - - -If the plots do NOTcompare well the new machine is -NOTrunning as well as the trusted machine. Typically the -recommendation here is to lower the optimization level on the new machine and try -again (or in the case of code changes, modify or simplify the code changes to get -something that should be closer). - -The history variables we have used to do this is either 'TSOI', and/or 'TSA'. 'TSOI' are -the 3D snow and soil temperatures for vegetated land-units. If there is a change in -soil physics it should show up in this field (and it should show up even for something -that is at a pretty deep soil depth). However, as 'TSOI' is only for vegetated -land-units, changes in lake or urban land-units -- will NOT show up. 'TSA' by contrast is -the 2m surface temperature across all land-units, so changes in urban or lake land-units -will show up. However, changes in deep soil physics will only show up as it propagates -to the surface. So one field may show something that the other doesn't. In the examples, -we use 'TSOI', but 'TSA' can be used as well. And in most cases you should check both. - - - -Now we will give a detailed description of the procedure with examples and the -exact steps to perform. - - -Using Perturbation Error Growth Analysis to Verify a Port to a New Machine - -Running non-perturbed on trusted machine - -The first step is to run a non-perturbed case on the trusted machine. You need to run -all of the steps with the same compset and same resolution. For these examples we will -use 2-degree resolution with the ICN compset for 2000 conditions. You need to run for -three days with a cold-start. - - - -As we describe below, This is optional if you will be using datasets from the -inputdata repository to take place of this step. - - - - -Example non-perturbed error growth simulation - -> cd scripts -> ./create_newcase -case trustedMachinePergro0 -compset ICN -res f19_g16 \ --mach bluefire -> cd trustedMachinePergro0 -# Set the non-perturbed PERGRO use-case -> ./xmlchange -file env_conf.xml -id CLM_NML_USE_CASE -val pergro0_pd -# Set coldstart on so arbitrary initial conditions will be used -> ./xmlchange -file env_conf.xml -id CLM_FORCE_COLDSTART -val on -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup -# Set PERGRO on in the configure -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-pergro on" -append -# Now configure and build -> ./configure -case -> ./trustedMachinePergro0.bluefire.build -# Set it to run for three days and turn archiving off -> ./xmlchange -file env_run.xml -id STOP_N -val 3 -> ./xmlchange -file env_run.xml -id DOUT_S -val FALSE -# Run the case and then you will save the history file output for later use -> ./trustedMachinePergro0.bluefire.submit - - - - - -If you aren't able to do this step, as you don't have access to a trusted machine, you -can use datasets that are available from the svn inputdata repository to take place of -running it yourself. The disadvantage is that this is only done for certain model -versions and for exactly the configuration/namelist given here. You won't be able to -test it for your own custom code or configurations. - - - - -Running perturbed on the trusted machine - -The next step is to run a perturbed case on the trusted machine. - -Example perturbed error growth simulation - -> cd scripts -> ./create_newcase -case trustedMachinePergroRnd -compset ICN -res f19_g16 \ --mach bluefire -> cd trustedMachinePergroRnd -# Set the perturbed PERGRO use-case -> ./xmlchange -file env_conf.xml -id CLM_NML_USE_CASE -val pergro_pd -# Set coldstart on so arbitrary initial conditions will be used -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup -> ./xmlchange -file env_conf.xml -id CLM_FORCE_COLDSTART -val on -# Set PERGRO on in the configure -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-pergro on" -append -# Now configure and build -> ./configure -case -> ./trustedMachinePergroRnd.bluefire.build -# Set it to run for three days and turn archiving off -> ./xmlchange -file env_run.xml -id STOP_N -val 3 -> ./xmlchange -file env_run.xml -id DOUT_S -val FALSE -# Run the case and then you will save the history file output for later use -> ./trustedMachinePergroRnd.bluefire.submit - - - - - -If you aren't able to do this step, as you don't have access to a trusted machine, you -can use datasets that are available from the svn inputdata repository to take place of -running it yourself. The disadvantage is that this is only done for certain model -versions and for exactly the configuration/namelist given here. You won't be able to -test it for your own custom code or configurations. - - - - -Running non-perturbed on the new machine - -The next step is to run a non-perturbed case on the new machine. Here -we will demonstrate using the machine intrepid. For the previous two steps -you have the option of using datasets provided in the subversion inputdata -repository to take their place -- however this step is required. - -> cd scripts -> ./create_newcase -case newMachinePergro0 -compset ICN -res f19_g16 \ --mach intrepid -> cd newMachinePergro0 -# Set the non-perturbed PERGRO use-case -> ./xmlchange -file env_conf.xml -id CLM_NML_USE_CASE -val pergro0_pd -> ./xmlchange -file env_conf.xml -id CLM_FORCE_COLDSTART -val on -> ./xmlchange -file env_conf.xml -id RUN_TYPE -val startup -# Set PERGRO on in the configure -> ./xmlchange -file env_conf.xml -id &CLMCONFIG; -val "-pergro on" -append -# Now configure and build -> ./configure -case -> ./newMachinePergro0.intrepid.build -# Set it to run for three days and turn archiving off -> ./xmlchange -file env_run.xml -id STOP_N -val 3 -> ./xmlchange -file env_run.xml -id DOUT_S -val FALSE -# Run the case and then you will save the history file output for later use -> ./newMachinePergro0.intrepid.submit - - - - - -Plotting the differences - -You can use the cprnc program to compute root mean square differences -between the relevant history files. See for more information -on it and how to build it. On many platforms you will need to set some environment -variables in order to complete the build (see for -more information on building the tools). - -# Build the cprnc program -> cd models/lnd/clm/tools/cprnc -> gmake -# Now go to your case directory and run cprnc on the trusted-machine with and without -# perturbation -> cd ../../../../../scripts/trustedMachinePergro0 -> ../../models/lnd/clm/tools/cprnc/cprnc trustedMachinePergro0.clm2.h0.001-01-01.00000.nc \ -../trustedMachinePergroRnd/trustedMachinePergroRnd.clm2.h0.001-01-01.00000.nc > trustedPergro.log -# Copy the history file from the new machine to here -# -# And now run cprnc on the trusted-machine and the new machine both without perturbation -> ../../models/lnd/clm/tools/cprnc/cprnc trustedMachinePergro0.clm2.h0.001-01-01.00000.nc \ -../newMachinePergro0/newMachinePergro0.clm2.h0.001-01-01.00000.nc > newPergro.log -# Now extract out the RMS differences of TSOI for both -# You may want to extract out the RMS differences for TSA as well -# Changes in urban or lake land-units won't be detected with TSOI -> grep "RMS TSOI" trustedPergro.log | awk '{print $3}' > RMStrusted.dat -> grep "RMS TSOI" newPergro.log | awk '{print $3}' > RMSnewmachine.dat -# And plot the two curves up to your screen -> env TYPE=x11 RMSDAT=RMSnewmachine.dat RMSDAT2=RMStrusted.dat ncl \ -../../models/lnd/clm/tools/ncl_scripts/pergroPlot.ncl - -Here is a sample plot for several trusted machines: bluefire, intrepid, jaguar, -and edinburgh (with both the lahey and intel compilers). -The green line is the error growth for bluefire, the red is the error growth -for intrepid, the dashed navy is for jaguar, the dashed maroon is for the intel -compiler on edinburgh, and the thick dashed goldenrod line is for edinburgh with the -lahey compiler. Note, the data for this plot is in -models/lnd/clm/tools/ncl_scripts the files are named: -according to the legend. Note, that the lines tend to cluster together and follow -quite closely to the bluefire line which is our main trusted machine. -

-Sample Good Perturbation Error Growth Curves (within roundoff) - - - -
- - - -When you do NOT have access to a trusted machine you can use the trusted file from -bluefire that is available on the inputdata repository. - -# Build the cprnc program -> cd models/lnd/clm/tools/cprnc -> gmake -# Get the unperturbed file from the subversion repository -> cd ../../../../../scripts/newMachinePergro0 -> set dir = "lnd/clm2/pergrodata" -> set file = bluefirePergro0.ICN.0001-01-01_1.9x2.5_gx1v6_simyr2000_clm4-cesm1_0_3.c110617.nc -> echo "trustedfile = DIN_LOC_ROOT/$dir/$file" > clm.input_data_list -> ../ccsm_utils/Tools/check_input_data -datalistdir . -export -inputdata $DIN_LOC_ROOT -# And now run cprnc on the bluefire file and the new machine both without perturbation -> ../../models/lnd/clm/tools/cprnc/cprnc $file \ -../newMachinePergro0/newMachinePergro0.clm2.h0.001-01-01.00000.nc > newPergro.log -# Now extract out the RMS difference -# You may want to extract out the RMS differences for TSA as well -# Changes in urban or lake land-units won't be detected with TSOI -> grep "RMS TSOI" newPergro.log | awk '{print $3}' > RMSnewmachine.dat -# And plot the new curve versus the trusted curve up to your screen -> env TYPE=x11 RMSDAT=RMSnewmachine.dat \ -RMSDAT2=../../models/lnd/clm/tools/ncl_scripts/RMSbluefire.dat \ -../../models/lnd/clm/tools/ncl_scripts/pergroPlot.ncl - - - -In the figure below we now show example of curves for changes that are larger than -roundoff. Once again the green curve is the trusted error growth from bluefire. The -other curves are for changes that may be fairly small, but are larger than roundoff. The -goldenrod curve is for using the 1850, and the navy is for using the 1999 Nitrogen -deposition files rather than for year 2000. The red is for using the 1850 aerosol -dataset rather than 2000, and the maroon is for adding the snow combination bug in. The -differences in changes that are greater than roundoff is that the curves climb very -steeply to the 10-6 value and then level off, while the -curve for bluefire climbs much more slowly and gradually. The curves also don't mimic -each other in any way, like the trusted machine plots do. -
-Sample Bad Perturbation Error Growth Curves (changes greater than roundoff) - - - -
- -
- - - - - -Running stand-alone &clm; with transient historical &CO2; -concentration - -In this case you want to run a simulation with stand-alone &clm; responding -to changes in &CO2; for a historical period. -For this example, we will start with the "I_1850-2000_CN" compset that -has transient: land-use, Nitrogen and Aerosol deposition already. You could -also use another compset if you didn't want these other features to be transient. -In order to get &CO2; to be transient we need to edit the -&datm; template so that we add an extra streams file to describe how -&CO2; varies over the historical period. You also need -a &netcdf; datafile that datm can read that gives the variation. You could -supply your own file, but we have a standard file that is used by CAM for this -and our example will make use of this file. - - - -Most everything here has to do with changing datm rather than &clm; -to allow this to happen. As such the user that wishes to do this should -first become more familiar with datm and read the -&cesm; Data -Model User's Guide especially as it pertains to the datm. Note, also -that in this example we show how to edit the datm "buildnml" file for your -case, but you could do something similar by editing the datm template. - - - - -This section documents the process for doing something that is non-standard. -There may be errors with the documentation and process, and you may have to do -some work before all of this works for you. If that is the case, we recommend -that you do further research into understanding the process and the files, as -well as understanding the datm and how it works. You may have to read documentation -found in the code for datm as well as "csm_share". - - - -The datm has "streams" files that have rough XML-like syntax and specify the -location and file to get data from, as well as information on the variable names -and the data locations of the grid points. The datm expects specific variable names -and the datm "maps" the expected variable names from the file to the names expected -by datm. The file we are working with here is a file with a single-point, that covers -the entire globe (so the vertices go from -90 to 90 degrees in latitude and 0 to 360 -degrees in longitude). Since it's a single point it's a little easier to work with -than datasets that may be at a given horizontal resolution. The datm also expects -that variables will be in certain units, and only expects a limited number of -variables so arbitrary fields can NOT be exchanged this way. However, the process -would be similar for datasets that do contain more than one point. - - -The three things that are needed: a domain file, a data file, and a streams text file. -The domain file is a CF-compliant &netcdf; file that has information -on the grid points (latitudes and longitudes for cell-centers and vertices, mask -, fraction, and areas). The datafile is a CF-compliant &netcdf; file with the data that -will be mapped. The streams text file is the XML-like file that tells datm how to find -the files and how to map the variables datm knows about to the variable names on the -&netcdf; files. Note, that in our case the domain file and the data file are the same -file. In other cases, the domain file may be separate from the data file. - - -First we are going to create a case, and we will edit -the Buildconf/datm.buildnml.csh so that we add a -&CO2; data stream in. There is a streams text file -available in models/lnd/clm/doc/UsersGuide/co2_streams.txt, -that includes file with a &CO2; time-series from 1765 to 2007. - -Example Transient Simulation with Historical &CO2; - -> cd scripts -> ./create_newcase -case DATM_CO2_TSERIES -res f19_g16 -compset I_1850-2000_CN \ --mach bluefire -> cd DATM_CO2_TSERIES -# Set CCSM_BGC to CO2A so that CO2 will be passed from atmosphere to land -> ./xmlchange -file env_conf.xml -id CCSM_BGC -val CO2A -# Set CLM_CO2_TYPE to diagnostic so that the land will use the value sent from the atmosphere -> ./xmlchange -file env_conf.xml -id CLM_CO2_TYPE -val diagnostic -> ./configure -case -> cd Buildconf -# Copy the sample streams file over -> cp ../../../models/lnd/clm/doc/UsersGuide/co2_streams.txt . - - -The first thing we will do is to edit the datm buildnml script to add -a CO2 file stream in. To do this we will apply a patch with the differences -needed. The patch file addco2_datm.buildnml.diff is -in models/lnd/clm/doc/UsersGuide and looks like this... - -&co2streams_diff; - -So to apply the patch you do this... - -> cd scripts/DATM_CO2_TSERIES/Buildconf -> patch < ../../../models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - -Once, you've done that you can build and run your case normally. - - - -The patch assumes you are using a I_1850-2000_CN compset out of the box, with -DATM_PRESAERO equal to trans_1850-2000. So it assumes standard -Qian atmosphere forcing, and transient prescribed aerosols from streams files. If your case changes -anything here the patch will fail, and you will need to put the changes in by hand. - - - - - -If the patch fails, you will have to add the changes to the -datm.buildnml.csh found in the above -patch file by hand. Basically, it adds an extra streams file for &CO2; to the end of the streams variable, -and other arrays associated with streams (adding mapalgo as a new array with bilinear for everything, but -the &CO2; file which should be "nn" for nearest neighbor). - - - - - -The streams file above is hard-coded for the path of the file on &ncar; computers. To use it on an outside -machine you'll need to edit the filepath in the streams file to point to the location where you have the file. - - - - -After going through these steps, you will have a case where you have datm reading -in an extra streams text file that points to a data file with &CO2; -data on it that will send that data to the &clm;. - - - - diff --git a/doc/UsersGuide/stylesheethtml2docbook.xsl b/doc/UsersGuide/stylesheethtml2docbook.xsl deleted file mode 100644 index 13c30ff71d..0000000000 --- a/doc/UsersGuide/stylesheethtml2docbook.xsl +++ /dev/null @@ -1,579 +0,0 @@ - - - - - -wb -file:///epicuser/AISolutions/graphics/AIWorkbench/ - - - - - - - - - - <xsl:value-of select=".//html:h1[1] - |.//html:h2[1] - |.//html:h3[1]"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - inlinemediaobject - - mediaobject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Matched -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No template for - - - - - - No template for - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
- - - - - - - _ - - - - - - - - - - - - - - _ - - - - - - - - - - - - - - - - - - - - - - - - - <xsl:value-of select=".//html:caption"/> - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Attempting to count columns on a non-table element - - - Row parameter is not a valid row - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- diff --git a/doc/UsersGuide/tools.xml b/doc/UsersGuide/tools.xml deleted file mode 100644 index f5fd8beac4..0000000000 --- a/doc/UsersGuide/tools.xml +++ /dev/null @@ -1,1396 +0,0 @@ - - -Using the &clm; tools to create your own input datasets - -There are several tools provided with &clm; that allow you to create your own input -datasets at resolutions you choose, or to interpolate initial conditions to a different -resolution, or used to compare &clm; history files between different cases. The tools are -all available in the models/lnd/clm/tools directory. Most of the tools -are &FORTRAN; stand-alone programs in their own directory, but there is also a suite of -&ncl; -scripts in the ncl_scripts directory. Some of the &ncl; scripts are -very specialized and not meant for general use, and we won't document them here. They -still contain documentation in the script itself and the README file in the tools -directory. But, the list of generally important scripts and programs are: - - - cprnc to compare &netcdf; files with a time axis. - - - interpinic to interpolate initial condition files. - - - mkgriddata to create grid datasets. - - - mkdatadomain to create domain files from grid datasets -used by &datm; or docn. - - - mksurfdata to create surface datasets from grid datasets. - - - ncl_scripts/getregional_datasets.pl script to extract a -region or a single-point from global input datasets. See the single-point chapter -for more information on this. - - - ncl_scripts/npdepregrid.ncl interpolate the Nitrogen -deposition datasets to a new resolution. - - - ncl_scripts/aerdepregrid.ncl interpolate the Aerosol -deposition datasets to a new resolution. - - - - - -In the sections to come we will go into detailed description of how to use each of -these tools in turn. First, however we will discuss the common environment variables -and options that are used by all of the &FORTRAN; tools. Second, we go over the outline -of the entire file creation process for all input files needed by &clm; for a new -resolution, then we turn to each tool. In the last section we will -discuss how to customize files for particular observational sites. - - - -Common environment variables and options used in building the &FORTRAN; -tools - -The &FORTRAN; tools all have similar makefiles, and similar options for building. -All of the Makefiles use GNU Make extensions and thus require that you use GNU make -to use them. They also auto detect the type of platform you are on, using "uname -s" -and set the compiler, compiler flags and such accordingly. There are also environment -variables that can be set to set things that must be customized. All the tools use -&netcdf; and hence require the path to the &netcdf; libraries and include files. -On some platforms (such as Linux) multiple compilers can be used, and hence there -are env variables that can be set to change the &FORTRAN; and/or "C" compilers used. -The tools other than cprnc also allow finer control, by also -allowing the user to add compiler flags they choose, for both &FORTRAN; and "C", as -well as picking the compiler, linker and and add linker options. Finally the tools -other than cprnc allow you to turn -optimization on (which is off by default but on for the mksurfdata and -interpinic -programs) with the OPT flag so that the -tool will run faster. To get even faster performance, the interpinic, -mksurfdata, and -mkgriddata programs allow you to also use the SMP to -turn on multiple shared memory processors. -When SMP=TRUE you set the number of threads used by the program with -the OMP_NUM_THREADS environment variable. - - -Options used by all: cprnc, interpinic, -mkdatadomain, mkgriddata, and -mksurfdata - -LIB_NETCDF -- sets the location of the &netcdf; library. -INC_NETCDF -- sets the location of the &netcdf; include files. -USER_FC -- sets the name of the &FORTRAN; compiler. - -Options used by: interpinic, mkdatadomain, -mkgriddata, and mksurfdata - -MOD_NETCDF -- sets the location of the &netcdf; &FORTRAN; module. -USER_LINKER -- sets the name of the linker to use. -USER_CPPDEFS -- adds any CPP defines to use. -USER_CFLAGS -- add any "C" compiler flags to use. -USER_FFLAGS -- add any &FORTRAN; compiler flags to use. -USER_LDFLAGS -- add any linker flags to use. -USER_CC -- sets the name of the "C" compiler to use. -OPT -- set to TRUE to compile the code optimized (TRUE or FALSE) - -Options used by: interpinic, mkgriddata, and mksurfdata: - -SMP -- set to TRUE to turn on shared memory parallelism (i.e. -&omp;) (TRUE or FALSE) -Filepath -- list of directories to build source code from. -Srcfiles -- list of source code filenames to build executable from. - -Options used only by cprnc: - -EXEDIR -- sets the location where the executable will be built. -VPATH -- colon delimited path list to find the source files. - -More details on each environment variable. - - -LIB_NETCDF - -This variable sets the path to the &netcdf; library file -(libnetcdf.a). If not -set it defaults to /usr/local/lib. In order to use the tools -you need to build the &netcdf; library and be able to link to it. In order to build -the model with a particular compiler you may have to compile the &netcdf; library with -the same compiler (or at least a compatible one). - - - - - -INC_NETCDF - -This variable sets the path to the &netcdf; include directory (in order to find -the include file netcdf.inc). -if not set it defaults to /usr/local/include. - - - - - -MOD_NETCDF - -This variable sets the path to the &netcdf; module directory (in order to find -the &netcdf; &FORTRAN90; module file when &netcdf; is used with a &FORTRAN90; -use statement. When not set it defaults to the -LIB_NETCDF value. - - - - - -USER_FC - -This variable sets the command name to the &FORTRAN90; compiler to use when -compiling the tool. The default compiler to use depends on the platform. And -for example, on the AIX platform this variable is NOT used - - - - - -USER_LINKER - -This variable sets the command name to the linker to use when linking the object -files from the compiler together to build the executable. By default this is set to -the value of the &FORTRAN90; compiler used to compile the source code. - - - - - -USER_CPPDEFS - -This variable adds additional optional values to define for the C preprocessor. -Normally, there is no reason to do this as there are very few CPP tokens in the CLM -tools. However, if you modify the tools there may be a reason to define new CPP -tokens. - - - - - -USER_CC - -This variable sets the command name to the "C" compiler to use when -compiling the tool. The default compiler to use depends on the platform. And -for example, on the AIX platform this variable is NOT used - - - - - -USER_CFLAGS - -This variable adds additional compiler options for the "C" compiler to use -when compiling the tool. By default the compiler options are picked according -to the platform and compiler that will be used. - - - - - -USER_FFLAGS - -This variable adds additional compiler options for the &FORTRAN90; compiler to use -when compiling the tool. By default the compiler options are picked according -to the platform and compiler that will be used. - - - - - -USER_LDFLAGS - -This variable adds additional options to the linker that will be used when linking -the object files into the executable. By default the linker options are picked according -to the platform and compiler that is used. - - - - - -SMP - -This variable flags if shared memory parallelism (using i&omp;) should be used when -compiling the tool. It can be set to either TRUE or -FALSE, by default it is set to FALSE, so -shared memory parallelism is NOT used. When set to TRUE you can -set the number of threads by using the OMP_NUM_THREADS environment -variable. Normally, the most you would set this to would be to the number of on-node -CPU processors. Turning this on should make the tool run much faster. - - - -Note, that depending on the compiler answers may be different when SMP -is activated. - - - - - - -OPT - -This variable flags if compiler optimization should be used when -compiling the tool. It can be set to either TRUE or -FALSE, by default it is set to FALSE for -mkdatadomain and TRUE for -mksurfdata and interpinic. -Turning this on should make the tool run much faster. - - - -Note, you should expect that answers will be different when OPT -is activated. - - - - - - -Filepath - -All of the tools are stand-alone and don't need any outside code to operate. The -Filepath is the list of directories needed to compile -and hence is always simply "." the current directory. Several tools use -copies of code outside their directory that is in the &cesm; -distribution (either csm_share code or &clm; source code). - - - - - -Srcfiles - -The Srcfiles lists the filenames of the source code to use -when building the tool. - - - - - -EXEDIR - -The cprnc tool uses this variable to set the location of where the executable -will be built. The default is the current directory. - - - - - -VPATH - -The cprnc tool uses this variable to set the colon delimited pathnames of where -the source code exists. The default is the current directory. - - - - - - - - - -There are several files that are copies of the original files from either -models/lnd/clm/src/main, -models/csm_share/shr, or copies from other tool -directories. By having copies the tools can all be made stand-alone, but -any changes to the originals will have to be put into the tool directories -as well. - - - -The README.filecopies (which can be found in -models/lnd/clm/tools) is repeated here. - -&filecopies; - - - - - -General information on running the &FORTRAN; tools - -The tools run either one of two ways, with a namelist to provide options, or -with command line arguments (and NOT both). interpinic and -cprnc run with command line arguments, and the other tools -run with namelists. - - -Running &FORTRAN; tools with namelists - -mkgridata, mksurfdata and -mkdatadomain run with namelists that are read from -standard input. Hence, you create a namelist and then run them by -redirecting the namelist file into standard input as follows: - -./program < namelist - -For programs with namelists there is at least one sample namelist with the -name "program".namelist (i.e. mksurfdata.namelist -for the mksurfdata program). There may also be other sample -namelists that end in a different name besides "namelist". Namelists that you create -should be similar to the example namelist. The namelist values are also documented -along with the other namelists in the: - -models/lnd/clm/bld/namelist_files/namelist_definition.xml -file and default values in the: - -models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml -file. - - - -Running &FORTRAN; tools with command line options - -interpinic and cprnc run with command line -arguments. The detailed sections below will give you more information on the command -line arguments specific to each tool. Also running the tool without any arguments -will give you a general synopsis on how to run the tool. For example to get help -on running interpinic do the following. - -cd models/lnd/clm/tools/interpinic -gmake -./interpinic - - - - -Running &FORTRAN; tools built with SMP=TRUE - -When you enable SMP=TRUE on your build of one of the tools that -make use of it, you are using &omp; for shared memory parallelism (SMP). In -SMP loops are run in parallel with different threads run on different processors -all of which access the same memory (called on-node). Thus you can only usefully -run up to the number of processors that are available on a single-node of the machine -you are running on. For example, on the &ncar; machine bluefire there are 32 processors -per node, but the SMT hardware on the machine allows you to submit twice as many -threads or 64 threads. So to run the mksurfdata on bluefire -optimized, with 64 threads you would do the following: - -cd models/lnd/clm/tools/mksurfdata -gmake OPT=TRUE SMP=TRUE -setenv OMP_NUM_THREADS 64 -./mksurfdata < mksurfdata.namelist - - - - - - -The File Creation Process - - -When just creating a replacement file for an existing one, the relevant tool should -be used directly to create the file. When you are creating a set of files for a new -resolution there are some dependencies between the tools that you need to keep in mind -when creating them. The main dependency is that the mkgriddata MUST -be done first as the grid dataset is then input into the other tools. Also look at -. - - - -Creating a complete set of files for input to &clm; - -Create grid and fraction datasets - -First use mkgriddata to create grid and fraction datasets. -See for more information on this. - - - - -Create domain dataset (if NOT already done) - -Next use mkdatadomain to create a domain file for use by -&datm; from the grid and fraction datasets just created. This is required, unless -a domain file already created was input into mkgriddata on -the previous step. -See for more information on this. - - - - -Create surface datasets - -Next use mksurfdata to create a surface dataset, using the grid -dataset as input. -See for more information on this. - - - - -Interpolate aerosol deposition datasets (optional) - -By default the atmosphere model will interpolate -these datasets on the fly, so you don't normally need to do this step. -A reason you might want to do this is to make the read and interpolation faster, -by reducing the amount of data read in and removing the need for the interpolation. -So, if you do, you can use aerdepregrid.ncl to regrid aerosol -deposition datasets to your new resolution using the grid dataset as input. -See for more information on this. - - - - -Interpolate Nitrogen deposition datasets (optional, but only needed if running &clmcn;) - -By default Nitrogen deposition is read in from stream -files at 2-degree resolution and interpolated to the resolution you are running at, -so you don't need to do this step. As with aerosol deposition datasets a reason -you might want to do this is to make the read and interpolation faster, -by reducing the amount of data read in and removing the need for the interpolation. -So, if you do you can use ndepregrid.ncl -to regrid Nitrogen deposition datasets to your new resolution using the grid dataset -as input. -See for more information on this. - - - - -Create some sort of initial condition dataset - - -You then need to do one of the following three options to have an initial dataset -to start from. - - - - - -Use spinup-procedures to create initial condition datasets - -The first option is to do the spinup procedures from arbitrary initial conditions -to get good initial datasets. This is the most robust method to use. -See , , or - for more information on this. - - - - -Use <command>interpinic</command> to interpolate existing initial -condition datasets - -The next option is to interpolate from spunup datasets at a different resolution, using -interpinic. -See for more information on this. - - - - -Start up from arbitrary initial conditions - -The last alternative is to run from arbitrary initial conditions without using any -spun-up datasets. This is inappropriate when using &clmcn; (bgc=cn or cndv) as it -takes a long time to spinup Carbon pools. - - -This is NOT recommended as many fields in &clm; take a long time to equilibrate. - - - - - - - - - - -Enter the new datasets into the &buildnml; XML database - -The last optional thing to do is to enter the new datasets into the &buildnml; -XML database. See for more information on -doing this. This is optional because the user may enter these files into their -namelists manually. The advantage of entering them into the database is so that -they automatically come up when you create new cases. - - - - - - - - -Using the <command>cprnc</command> tool to compare two history files - -cprnc is a tool shared by both CAM and &clm; to compare two -&netcdf; history files. -It differences every field that has a time-axis that is also shared on both files, -and reports a summary of the difference. The summary includes the three largest -differences, as well as the root mean square (RMS) difference. It also gives some -summary information on the field as well. You have to enter at least one file, and up to -two files. With one file it gives you summary information on the file, and with two it -gives you information on the differences between the two. At the end it will give you a -summary of the fields compared and how many fields were different and how many were -identical. - - -Options: - --m = do NOT align time-stamps before comparing --v = verbose output --ipr --jpr --kpr - -See the cprnc -README file for more details which is -repeated here: - -&cprnc_readme; - - - -To compare files with OUT a time axis you can use the cprnc.ncl -&ncl; script in models/lnd/clm/tools/ncl_scripts. It won't give -you the details on the differences but will report if the files are identical or -different. - - - - - - -Using <command>interpinic</command> to interpolate initial conditions to different -resolutions - -"interpinic" is used to interpolate initial conditions from one resolution to another. -In order to do the interpolation you must first run &clm; to create a restart file to -use as the "template" to interpolate into. Running from arbitrary initial conditions -(i.e. finidat = ' ') for a single time-step is sufficient to do this. Make sure the -model produces a restart file. You also need to make sure that you setup the same -configuration that you want to run the model with, when you create the template file. - - -Command line options to interpinic: - --i = Input filename to interpolate from --o = Output interpolated file, and starting template file - - - -There is a sample template file in the models/lnd/clm/tools/interpinic -directory and can be used to run interpolate to. -However, this file was created with an older version of &clm; and hence -we actually recommend that you would do a short run with &clm; to create a template file -to use. - - - - -Example of running &clm; to create a template file for -<command>interpinic</command> to interpolate to - -> cd scripts -> ./create_newcase -case cr_f10_TmpltI1850CN -res f10_f10 -compset I1850CN \ --mach bluefire -> cd cr_f10_TmpltI1850CN -# Set starting date to end of year -> ./xmlchange -file env_conf.xml -id RUN_STARTDATE -val 1948-12-31 -# Set year align to starting year -> ./xmlchange -file env_conf.xml -id DATM_CLMNCEP_YR_ALIGN -val 1948 -# Set to run a cold start -> ./xmlchange -file env_conf.xml -id CLM_FORCE_COLDSTART -val on -# Set to run only a single day, so a restart file will be created on Jan/1/1949 -> ./xmlchange -file env_run.xml -id STOP_N -val 1 -# Then configure, build and run as normal -> ./configure -case -> ./cr_f10_TmpltI1850CN.bluefire.build -> ./cr_f10_TmpltI1850CN.bluefire.submit -# And copy the resulting restart file to your interpinic directory -> cd ../models/lnd/clm/tools/interpinic -> cp /ptmp/$LOGIN/cr_f10_TmpltI1850CN/run/cr_f10_TmpltI1850CN.clm2.r.1949-01-01-00000.nc . - - - - -In the next example we build interpinic optimized with shared -memory on for 64 threads so that it runs as fast as possible, to interpolate one of -the standard 1-degree datasets to the above 10x15 template file that we created. - - -Example of building and running <command>interpinic</command> to -interpolate a 1-degree <filename>finidat</filename> dataset to 10x15 - -> cd models/lnd/clm/tools/interpinic -> gmake OPT=TRUE SMP=TRUE -> env OMP_NUM_THREADS=64 ./interpinic -o cr_f10_TmpltI1850CN.clm2.r.1949-01-01-00000.nc / --i /fs/cgd/csm/inputdata/ccsm4_init/b40.1850.track1.1deg.006/0863-01-01/b40.1850.track1.1deg.006.clm2.r.0863-01-01-00000.nc - - - - -Running interpinic at high resolution can take a long time, so we -recommend that you always build it optimized and with shared memory processing on, to -cut down the run time as much as possible. - - - - -interpinic does NOT work for CNDV (bgc=cndv). - - - - - - -In we give a simpler way to run -interpinic for several standard resolutions at once, with a script -to loop over several resolutions. This is useful for &clm; developers who need to -create many finidat files at once. - - - - - -Using <command>mkgriddata</command> to create grid datasets - -mkgriddata is used to create grid, fraction, and topography -datasets to run &clm; at a new resolution. It is typically the first step in creating -datasets needed to run &clm; at a new resolution (followed by -mksurfdata, and -then the interpolation programs, aerdepregrid.ncl, and -ndepregrid.ncl when running with CN). - - - -mkgriddata namelist - -mkgriddata is controlled by a namelist. There are ten different -namelist items, and you need to use enough of them so that files will be output. -The different types of input datasets contain different input data types, that -correspond to the three different types of output files: grid, fraction, and topography. -Output files for each of these will only be output if there is input data that -correspond to these. If you only have input data for grid locations -- you will only -get an output grid file. If you have both grid and fraction data you will get grid and -fraction data files. If you also have topography data you will also get topo files. - - -Namelist options to mkgriddata include: - -mksrf_fnavyoro -- Navy orography file to use for land fraction -and surface heights. -mksrf_frawtopo -- Raw topography file with just surface -heights. -mksrf_fcamfile -- CAM initial conditions file with -land-fractions and topography -mksrf_fclmgrid -- &clm; grid file -mksrf_fccsmdom -- &cesm; domain file -mksrf_fcamtopo -- CAM topography file -mksrf_lsmlon -- number of longitude for regional grid -mksrf_lsmlatnumber of latitudes for regional grid -mksrf_edgen -- Northern edge for regional grid -mksrf_edgee -- Southern edge for regional grid -mksrf_edges -- Eastern edge for regional grid -mksrf_edgew -- Western edge for regional grid - - - -You need to enter one of the following four options: - - mksrf_fnavyoro - high resolution topo dataset (topo data) - mksrf_lsmlon - number of longitudes - mksrf_lsmlat - number of latitudes - mksrf_edgen - northern edge of grid (degrees) - mksrf_edgee - eastern edge of grid (degrees) - mksrf_edges - southern edge of grid (degrees) - mksrf_edgew - western edge of grid (degrees) - -or - - mksrf_fcamfile - CAM topo file (grid and possibly fraction data) - -or - - mksrf_fccsmdom - &cesm; domain file (both grid, and fraction data) - -or - - mksrf_fclmgrid - &clm; grid or surface dataset file (grid data) - -Note, you can provide more than one of the needed datasets, and the output -data will be determined by the datasets according to an order of precedence. -The order of precedence for data is as follows: - -mksrf_fcamfile -mksrf_fclmgrid -mksrf_fnavyoro -mksrf_fccsmdom - -Grid data then will be established by the file with the highest precedence. -&cesm; domain files sometimes have latitudes and longitudes that are "off" from -the standard by a small amount. By establishing an order of precedence you can ensure -that grid locations exactly match a given standard file, even if the values in the domain -file are off from that. - - - -There are three different major modes for using "mkgriddata" to create grid files -for &clm;: - -mksrf_fnavyoro -- Navy orography file to use for land fraction -and surface heights. -mksrf_frawtopo -- Raw topography file with just surface -heights. -mksrf_fcamfile -- CAM initial conditions file with -land-fractions and topography -mksrf_fclmgrid -- &clm; grid file -mksrf_fccsmdom -- &cesm; domain file -mksrf_fcamtopo -- CAM topography file -mksrf_lsmlon -- number of longitude for regional grid -mksrf_lsmlat -- number of latitudes for regional grid -mksrf_edgen -- Northern edge for regional grid -mksrf_edgee -- Southern edge for regional grid -mksrf_edges -- Eastern edge for regional grid -mksrf_edgew -- Western edge for regional grid - - - -You need to enter one of the following four options: - - mksrf_fnavyoro - high resolution topo dataset (topo data) - mksrf_lsmlon - number of longitudes - mksrf_lsmlat - number of latitudes - mksrf_edgen - northern edge of grid (degrees) - mksrf_edgee - eastern edge of grid (degrees) - mksrf_edges - southern edge of grid (degrees) - mksrf_edgew - western edge of grid (degrees) - -or - - mksrf_fcamfile - CAM topo file (grid and possibly fraction data) - -or - - mksrf_fccsmdom - &cesm; domain file (both grid, and fraction data) - -or - - mksrf_fclmgrid - &clm; grid or surface dataset file (grid data) - -Note, you can provide more than one of the needed datasets, and the output -data will be determined by the datasets according to an order of precedence. -The order of precedence for data is as follows: - -mksrf_fcamfile -mksrf_fclmgrid -mksrf_fnavyoro -mksrf_fccsmdom - -Grid data then will be established by the file with the highest precedence. -&cesm; domain files sometimes have latitudes and longitudes that are "off" from -the standard by a small amount. By establishing an order of precedence you can ensure -that grid locations exactly match a given standard file, even if the values in the domain -file are off from that. - - - -There are three different major modes for using mkgriddata to -create grid files for &clm;: - -Convert &cesm; domain files to &clm; grid files -Create single point or regional area grid files -Convert CAM files to &clm; grid files - - - - - -Convert &cesm; domain files to &clm; grid files - -&cesm; domain files such as used for &datm;, include all the information -needed to create &clm; grid and fraction files. - -Example <command>mkgriddata</command> namelist to convert &cesm; 4x5 domain files to &clm; grid files - -&clmexp - mksrf_fccsmdom= -'/fs/cgd/csm/inputdata/lnd/dlnd7/domain.lnd.4x5_gx3v5.060404.nc' - mksrf_fclmgrid= -'/fs/cgd/csm/inputdata/lnd/clm2/griddata/griddata_4x5_060404.nc' -/ - - - - -Notice that in the above example, a &clm; grid file is included as well, even though -it's not required. The reason for this is to ensure that the latitude and longitudes -on the output files exactly match a standard grid file. - - - - - - -Create single point or regional area grid files - -The process to create single-point or regional area &clm; grid files is the same. -You enter the number of latitudes and longitudes you want on your output file and -the extent of the grid: North, East, South and West. You also tell -mkgriddata that -you are entering a "regional" grid and you also enter the standard Navy orography -dataset (or your own orography file if desired). For a single point you simply -enter "1" for the number of latitudes and longitudes, but you still enter the -grid extent (of the single grid cell). Here is a sample regional namelist to create -a 5x5 regional grid over the Amazon: - -Example <command>mkgriddata</command> namelist to create regional grid over Amazon - -&clmexp - mksrf_fnavyoro= -"/fs/cgd/csm/inputdata/lnd/clm2/rawdata/mksrf_navyoro_20min.c010129.nc" - mksrf_lsmlon = 5 - mksrf_lsmlat = 5 - mksrf_edgee = 303.75 - mksrf_edgew = 286.25 - mksrf_edges = -15. - mksrf_edgen = -4. -/ - - - - - -Currently you can NOT have regional grids that straddle both -sides of the Greenwich (longitude = zero) line. - - - - -You should enter longitudes with values from 0 to 360 East. - - - - - -Convert <acronym>CAM</acronym> files to &clm; grid files (deprecated) - -Older CAM initial files included all the information needed to create &clm; -grid files. Newer CAM files no longer include land fraction data. Hence you -can use CAM files to give you the grid coordinates, but you need other data -to give you the land-mask and topography. Since, CAM files no longer -contain the needed information, this option is now deprecated. In most cases you should -use one of the other two options. - - - - - - - -Using <command>mkdatadomain</command> to create domain datasets for &datm; or docn from &clm; grid datasets - -"mkdatadomain" is used to convert &clm; grid and fraction datasets into domain datasets -that can be used by either the "datm" or "docn" models. Most often &clm; users will want -to convert the grid datasets they just created using mkgriddata into -domain datasets to be used by &datm; for an "I" case. mkdatadomain is -controlled by a namelist, and has a very straight forward operation with only four -namelist items all of which are required. You specify which output mode you want "datm" -or "docn", and then set the input &clm; grid and frac datasets, and the output domain file. - - -Example <command>mkdatadomain</command> namelist to create a domain file from -&clm; frac and grid data files - -&domain_nl - dtype = "datm" - f_fracdata = -'/fs/cgd/csm/inputdata/lnd/clm2/griddata/fracdata_4x5_USGS_070110.nc' - f_griddata = -'/fs/cgd/csm/inputdata/lnd/clm2/griddata/griddata_4x5_060404.nc' - f_domain = -'domain.lnd.fv4x5_USGS.090117.nc' -/ - - - - - -Using mksurfdata to create surface datasets from grid datasets - -mksurfdata is used to create surface-datasets from grid datasets and raw datafiles -at half-degree resolution to produce files that describe the surface characteristics -needed by &clm; (fraction of grid cell covered by different land-unit types, and fraction -for different vegetation types, as well as things like soil color, and soil texture, -etc.). To run mksurfdata you can either use the -mksurfdata.pl script which will create namelists for you using the &buildnml; -XML database, or you can run it by hand using a namelist that you provide (possibly -modeled after an example provided in the -models/lnd/clm/tools/mksurfdata directory). The namelist for -mksurfdata is sufficiently complex that we recommend using the -mksurfdata.pl tool to build them. In the next section -we describe how to use the mksurfdata.pl script and the following -section gives more details on running mksurfdata by hand and the -various namelist input variables to it. - - -Running <command>mksurfdata.pl</command> - -The script mksurfdata.pl can be used to run the -mksurfdata program for several configurations, resolutions, -simulation-years and simulation year ranges. It will create the needed namelists for -you and move the files -over to your inputdata directory location (and create a list of the files created, and -for developers this file is also a script to import the files into the svn inputdata -repository). It will also use the &buildnml; XML database -to determine the correct input files to use, and for transient cases it will create -the appropriate mksrf_fdynuse file with the list of files for each -year needed for this case. And in the case of urban single-point -datasets (where surface datasets are actually input into mksurfdata) -it will do the additional processing required so that the output dataset -can be used once again by mksurfdata. Because, it figures out -namelist and input files for you, it is recommended that you use this script for creation -of standard surface datasets. If you need to create surface datasets for customized -cases, you might need to run mksurfdata on it's own. But you -could use mksurfdata.pl with the "-debug" option to give you -a namelist to start from. -For help on mksurfdata.pl you can use the "-help" option as below: - -> cd models/lnd/clm/tools/mksurfdata -> mksurdata.pl -help - -The output of the above command is: - -&mksurfdatapl; - - - -To run the script with optimized mksurfdata for a 4x5 degree grid -for 1850 conditions, on bluefire you would do the following: - -Example of running <command>mksurfdata.pl</command> to create a 4x5 resolution -<filename>fsurdat</filename> for a 1850 simulation year - -> cd models/lnd/clm/tools/mksurfdata -> gmake -> mksurfdata.pl -y 1850 -r 4x5 - - - - - - -Running <command>mksurfdata</command> by Hand - -In the above section we show how to run mksurfdata through -the mksurfdata.pl using input datasets that are in the &buildnml; -XML database. When you are running with input datasets that are NOT available in -the XML database you either need to add them as outlined in -, or you need to run mksurfdata -by hand, as we will outline here. - - - -Preparing your <command>mksurfdata</command> namelist - -When running mksurfdata by hand you will need to prepare your -own input namelist. There are sample namelists that are setup for running on the -&ncar; machine bluefire. You will need to change the filepaths to -run on a different machine. The list of sample namelists include - -mksurfdata.namelist -- standard sample namelist. -mksurfdata.regional -- sample namelist to -build for a regional grid dataset (5x5_amazon) -mksurfdata.singlept -- sample namelist to -build for a single point grid dataset (1x1_brazil) - -Note, that one of the inputs mksrf_fdynuse is a filename that -includes the filepaths to other files. The filepaths in this file will have to -be changed as well. You also need to make sure that the line lengths remain the same -as the read is a formatted read, so the placement of the year in the file, must remain -the same, even with the new filenames. One advantage of the mksurfdata.pl -script is that it will create the mksrf_fdynuse file for you. - - -We list the namelist items below. Most of the namelist items are filepaths to give to -the input half degree resolution datasets that you will use to scale from to the -resolution of your grid dataset. -You must first specify the input grid dataset for the resolution to output for: - -mksrf_fgrid Grid dataset - -Then you must specify settings for input high resolution datafiles - -mksrf_ffrac land fraction and land mask dataset -mksrf_fglacier Glacier dataset -mksrf_fglacierregion Glacier region ID dataset -mksrf_flai Leaf Area Index dataset -mksrf_flanwat Land water dataset -mksrf_forganic Organic soil carbon dataset -mksrf_fmax Max fractional saturated area dataset -mksrf_fsoicol Soil color dataset -mksrf_fsoitex Soil texture dataset -mksrf_ftopo Topography dataset (this is used to limit -the extent of urban regions and is used for glacier multiple elevation classes) - -mksrf_furban Urban dataset -mksrf_fvegtyp PFT vegetation type dataset -mksrf_fvocef Volatile Organic Compound Emission Factor -dataset -mksrf_fgdp GDP dataset -mksrf_fpeat Peatland dataset -mksrf_fabm Agricultural fire peak month dataset -mksrf_ftopostats Topography statistics dataset -mksrf_fvic VIC parameters dataset -mksrf_fch4 Inversion-derived CH4 parameters dataset - -You specify the ASCII text file with the land-use files. - -mksrf_fdynuse "dynamic land use" for transient -land-use/land-cover changes. This is an ASCII text file that lists the filepaths -to files for each year and then the year it represents (note: you MUST change the -filepaths inside the file when running on a machine NOT at &ncar;). -We always use this file, even for creating datasets of a fixed year. Also note -that when using the "pft_" settings this file will be an XML-like file with settings -for PFT's rather than filepaths (see below). - - - -And optionally you can specify settings for: - -all_urban If entire area is urban (typically used for -single-point urban datasets, that you want to be exclusively urban) -no_inlandwet If TRUE, set wetland to 0% over land -(renormalizing other landcover types as needed); wetland will only be used for ocean -points. (Only applies to CLM4.5 version of mksurfdata_map, for which the default is -TRUE.) -mksrf_firrig Irrigation dataset, if you want -activate the irrigation model over generic cropland -(experimental mode, normally NOT used) -mksrf_gridnm Name of output grid resolution (if not -set the files will be named according to the number of longitudes by latitudes) -mksrf_gridtype Type of grid (default is 'global') -nglcec number of glacier multiple elevation classes. -Can be 0, 1, 3, 5, or 10. When using the resulting dataset with &clm; you can then run -with glc_nec of either 0 or this value. - (experimental normally use the default of 0, when running with the land-ice -model in practice only 10 has been used) -numpft number of Plant Function Types (PFT) -in the input vegetation mksrf_fvegtyp dataset. You change -this to 20, if you want to create a dataset with prognostic crop activated. The -vegetation dataset also needs to have prognostic crop types on it as well. - (experimental normally not changed from the default of 16) -outnc_large_files If output should be in &netcdf; large file -format -outnc_double If output should be in double -precision (normally we turn this on) -pft_frc array of fractions to override PFT -data with for all gridpoints (experimental mode, normally NOT used). -pft_idx array of PFT indices to override PFT -data with for all gridpoints (experimental mode, normally NOT used). -soil_clay percent clay soil to override -all gridpoints with (experimental mode, normally NOT used). -soil_color Soil color to override -all gridpoints with (experimental mode, normally NOT used). -soil_fmax Soil maximum fraction to override -all gridpoints with (experimental mode, normally NOT used). -soil_sand percent sandy soil to -override all gridpoints with (experimental mode, normally NOT used). - - - -After creating your namelist, -when running on a non &ncar; machine you will need to get the files -from the inputdata repository. -In order to retrieve the files needed for mksurfdata you can do the following on your -namelist to get the files from the inputdata repository, using the -check_input_data script which also allows you to export data to -your local disk. - -Getting the raw datasets for <command>mksurfdata</command> to your local -machine using the <command>check_input_data</command> script - -> cd models/lnd/clm/tools/mksurfdata -# First remove any quotes and copy into a filename that can be read by the -# check_input_data script -> sed "s/'//g" namelist > clm.input_data_list -# Run the script with -export and give the location of your inputdata with $CSMDATA -> ../../../../../scripts/ccsm_utils/Tools/check_input_data -datalistdir . \ --inputdata $CSMDATA -check -export -# You must then do the same with the flanduse_timeseries file referred to in the namelist -# in this case we add a file = to the beginning of each line -> awk '{print "file = "$1}' landuse_timeseries_hist_simyr2000-2000.txt > clm.input_data_list -# Run the script with -export and give the location of your inputdata with $CSMDATA -> ../../../../../scripts/ccsm_utils/Tools/check_input_data -datalistdir . \ --inputdata $CSMDATA -check -export - - - - -Experimental options to <command>mksurfdata</command> - -The options: pft_frc, pft_idx, soil_clay, soil_color, soil_fmax, and soil_sand are also -new and considered experimental. They provide a way to override the PFT and soil -values for all grid points to the given values that you set. This is useful for -running with single-point tower sites where the soil type and vegetation is known. -Note that when you use pft_frc, all other landunits will be zeroed out, and the -sum of your pft_frc array MUST equal 100.0. Also note that when using the "pft_" -options the mksrf_fdynuse file instead of having filepath's -will be an XML-like file with PFT settings. Unlike the file of file-paths, you will -have to create this file by hand, mksurfdata.pl will NOT be able -to create it for you (other than the first year which will be set to the values -entered on the command line). Note, that when &ptclm; is run, it CAN create these -files for you from a simpler format (see ). -Instead of a filepath you have a list of XML elements that give information on the PFT's -and harvesting for example: - -<pft_f>100</pft_f><pft_i>1</pft_i><harv>0,0,0,0,0</harv><graz>0</graz> - -So the <pft_f> tags give the PFT fractions and the <pft_i> tags give the -index for that fraction. Harvest is an array of five elements, and grazing is a single -value. Like the usual file each list of XML elements goes with a year, and there is -limit on the number of characters that can be used. - - - - - -Standard Practices when using <command>mksurfdata</command> - -In this section we give the recommendations for how to use mksurfdata -to give similar results to the files that we created when using it. - - -If you look at the standard surface datasets that we have created and provided for use, -there are three practices that we have consistently done in each (you also see these in -the sample namelists and in the mksurfdata.pl script). The first is -that we always output data in double precision (hence outnc_double -is set to .true.). The next is that we always use the procedure -for creating transient datasets (using mksrf_fdynuse) even when -creating datasets for a fixed simulation year. This is to ensure that the fixed year -datasets will be consistent with the transient datasets. When this is done a -"landuse_timeseries" dataset will be created -- but will NOT be used in &clm;. If you look -at the sample namelist mksurfdata.namelist you note that it -sets mksrf_fdynuse to the file -landuse_timeseries_hist_simyr2000.txt, where the single file entered is -the same PFT file used in the rest of the namelist (as mksrf_fvegtyp). -The last practice that we always do is to always set mksrf_ftopo, -even if glacier elevation classes are NOT active. This is -important in limiting urban areas based on topographic height, and hence is important -to use all the time. The glacier multiple elevation classes will be used as well if -you are running a compset with the active glacier model. - - -There are two other important practices for creating urban single point datasets. The -first is that you often will want to set all_urban to -.true. so that the dataset will have 100% of the gridcell output -as urban rather than some mix of: urban, vegetation types, and other landunits. The -next practice is that most of our specialized urban datasets have custom values for -the urban parameters, hence we do NOT want to use the global urban dataset to get -urban parameters -- we use a previous version of the surface dataset for the urban -parameters. However, in order to do this, we need to append onto the previous surface -dataset the grid and land mask/land fraction information from the grid and fraction -datasets. This is done in mksurfdata.pl using the NCO -program ncks. An example of doing this for the Mexico City, Mexico -urban surface dataset is as follows: - -> ncks -A $CSMDATA/lnd/clm2/griddata/griddata_1x1pt_mexicocityMEX_c090715.nc \ -$CSMDATA/lnd/clm2/surfdata/surfdata_1x1_mexicocityMEX_simyr2000_c100407.nc -> ncks -A $CSMDATA/lnd/clm2/griddata/fracdata_1x1pt_mexicocityMEX_navy_c090715.nc \ -$CSMDATA/lnd/clm2/surfdata/surfdata_1x1_mexicocityMEX_simyr2000_c100407.nc - -Note, if you look at the current single point urban surface datasets you will note -that the above has already been done. - - -The final issue is how to build mksurfdata. When NOT optimized -mksurfdata is very slow, and can take many hours to days to -even run for medium resolutions such as one or two degree. So usually you will want -to run it optimized. Possibly you also want to use shared memory parallelism using -&omp; with the SMP option. The problem with running optimized is that -answers will be different when running optimized versus non-optimized for most -compilers. So if you want answers to be the same as a previous surface dataset, you -will need to run it on the same platform and optimization level. Likewise, running -with or without &omp; may also change answers (for most compilers it will NOT, however -it does for the IBM compiler). However, answers should be the same regardless of the -number of threads used when &omp; is enabled. Note, that the output surface datasets -will have attributes that describe whether the file was written out optimized or not, -with threading or not and the number of threads used, to enable the user to more -easily try to match datasets created previously. For more information on the different -compiler options for the &clm4; tools see . - - - - - - - -Using &ncl; scripts <command>ndepregrid.ncl</command> and -<command>aerdepregrid.ncl</command> to interpolate aerosol deposition datasets - -Unlike the other tools, these are &ncar; Command Language (&ncl;) scripts -and you will need to get a copy of &ncl; in order to use them. You also won't have to -build an executable in order to use them, hence no Makefile is provided. &ncl; is provided -for free download as either binaries or source code from: -http://www.ncl.ucar.edu/. The &ncl; -web-site also contains documentation on &ncl; and it's use. - - -By default at this point neither of these scripts HAS to be used, -as the model is now constructed to read aerosol and Nitrogen deposition from 2-degree -datasets and interpolate to the model resolution on the fly. The main reason you might -want to do this now, is for better performance for single-point simulations. - - -Both the ndepregrid.ncl and aerdepregrid.ncl -scripts have similar interfaces and you customize the output resolution and -characteristics based on the settings of environment variables that you set (if you -don't set any of the variables, the script has defaults that it will use). -The list of environment variables that can be set are: - -RES -- output resolution name -RCP -- representative concentration pathway for future scenarios -(example 2.6, 4.5, 6, or 8.5) -SIM_YR -- simulation year (example 1850 or 2000) -SIM_YR_RNG -- simulation year range (example 1850-2000 or -1850-2100) -GRDFIL -- full pathname of grid file to use -(in place of getting the default grid file based on the RES value) -CSMDATA -- &cesm; inputdata directory -CLM_ROOT -- root directory for &clm; (models/lnd/clm directory) - - - - -You MUST provide either RES or both -GRDFIL AND RES. If you -just give RES the default namelist database in -models/lnd/clm/bld will be used to find the default grid -file based on the resolution name RES. If you provide -GRDFIL the input pathname of the gridfile provided will be used, -and the output filename will include RES as part of it's name -to designate it as an output file at that resolution. - - - -Both scripts assume that you will be interpolating from a native resolution of 1.9x2.5 -and using the default files found in the namelist database to interpolate from. If you -want to interpolate from another resolution or use other files, you would need to edit -the scripts to do so. Both scripts also use a bilinear interpolation to do the -regridding. The environment variables: RCP, SIM_YR, -and SIM_YR_RNG will be used to query the namelist database to -determine which native dataset to interpolate from. If you don't provide valid -values for these variables, it won't be able to find a dataset to interpolate from. -You can use the build-namelist script to query what the valid values for these can -be. Likewise, when you use RES to determine the grid file to interpolate -to, it needs to be a valid value from the namelist database. - - -The scripts can be used to interpolate from (and create output) constant or -transient datasets. -Constant datasets specify the SIM_YR and set SIM_YR_RNG -to constant (which is also the default). Transient datasets need -to specify both SIM_YR and SIM_YR_RNG, where -SIM_YR is set to the first year in the interval (typically 1850). - - -The default for CSMDATA works for &ncar; computers, but will need to -be set to the top level directory location of your &cesm; input data on other computers. -If you set this as a default for your shell when you login (for example with your -$HOME/.cshrc if you use csh) you won't have to set it each time -you run the script. CLM_ROOT will default to the proper location -when you run it in the models/lnd/clm/tools/ncl_script -directory. It is only useful if you want to run the script out of a different -directory. - - -Using <command>ndepregrid.ncl</command> to interpolate Nitrogen deposition datasets - -ndepregrid.ncl interpolates the Nitrogen deposition datasets from one resolution -to another. - - - -Interpolating Nitrogen deposition files is no longer needed, because the model can -read Nitrogen deposition files at one resolution and interpolate to the resolution the -model is running at on the fly. Interpolating to another -resolution is only useful for very course resolutions, if you want to save some computing -resources in reading larger datasets. For example, this may be useful in obtaining -single-point datasets. - - - -For example, to interpolate to an output resolution of 0.9x1.25, for a constant -simulation-year of 1850, you would do the following: - -> env RES=0.9x1.25 SIM_YR=1850 ncl ndepregrid.ncl - - - - - -Using <command>aerdepregrid.ncl</command> to interpolate Aerosol deposition datasets - -aerdepregrid.ncl interpolates the Aerosol deposition datasets from one resolution. -It can be used to interpolate either constant datasets (for example: -aerosoldep_monthly_2000_0.9x1.25_c090828.nc) or transient datasets (for example: -aerosoldep_monthly_1849-2006_0.9x1.25_c090830.nc). - - - -Interpolating aerosol deposition files is no longer needed, because the &datm; model can -read aerosol deposition files at one resolution and interpolate to the resolution the -model is running at on the fly. Interpolating to another -resolution is only useful for very course resolutions, if you want to save some computing -resources in reading larger datasets. For example, this may be useful in obtaining -single-point datasets. - - - -For example, to interpolate to an output resolution of 4x5, for a transient -simulation-year range of 1850 to 2100 and the rcp of 8.5, you would do the following: - -> env RES=4x5 SIM_YR=1850 SIM_YR_RNG=1850-2100 RCP=8.5 ncl ndepregrid.ncl - - - - - - -How to Customize Datasets for particular Observational Sites - -There are two ways to customize datasets for a particular observational site. The first -is to customize the input to the tools that create the dataset, and the second is to -over-write the default data after you've created a given dataset. Depending on the tool -it might be easier to do it one way or the other. In we list the files that are most likely to be -customized and the way they might be customized. Of those files, the ones you are most -likely to customize are: fatmlndfrc, fsurdat, faerdep (for &datm;), and -stream_fldfilename_ndep. Note mksurfdata as documented previously -has options to overwrite the vegetation and soil types. For more information on this also see - and &ptclm; uses these methods to -customize datasets see . - - -Another aspect of customizing your input datasets is customizing the input atmospheric -forcing datasets. See the for more -information on this. Also the chapter on &ptclm; in -has information on using the AmeriFlux tower site data as atmospheric forcing. - - - - -Conclusion of tools description - -We've given a description of how to use the different tools with &clm; to create -customized datasets. In the next chapter we will talk about how to make these -files available for build-namelist so that you can easily create simulations -that include them. In the chapter on single-point and regional datasets we also -give an alternative way to enter new datasets without having to edit files. - - - - - diff --git a/doc/UsersGuide/trouble_shooting.xml b/doc/UsersGuide/trouble_shooting.xml deleted file mode 100644 index 418cfabaae..0000000000 --- a/doc/UsersGuide/trouble_shooting.xml +++ /dev/null @@ -1,545 +0,0 @@ - - -Trouble Shooting Problems - -In this chapter we give some guidance on what to do when you encounter some of the -most common problems. We can't cover all the problems that a user could potentially -have, but we will try to help you recognize some of the most common situations. -And we'll give you some suggestions on how to approach the problem to come up with -a solution. - - -In general you will run into one of three type of problems: - -configure-time -build-time -run-time - -You may also run into problems with create_newcase itself, or -with the archiving scripts -- for those problems you should consult the -&cesmrel; Scripts User's Guide. - - - -Trouble with Configuration - -The first type of problem happens when you invoke the configure -case -command. This indicates there is something wrong with your template files, or input -datasets, or the details of what you are trying to configure the model to do. -There's also a trouble-shooting chapter in the &cesmrel; -Scripts User's Guide. Many of the problems with configuration can be resolved -with the guidelines given there. Here we will restrict ourselves to problems from the -&clm; or &datm; templates or input files. - -Example of configure problem with missing datasets - -> ./create_newcase -case T31rcp6 -res T31_g37 -compset IRCP60CN \ --mach bluefire -> ./configure -case - -The following is what is displayed to the screen. - -Generating resolved namelist, prestage, and build scripts -configure done. -adding use_case 1850-2100_rcp6_transient defaults for var clm_demand with val flanduse_timeseries -adding use_case 1850-2100_rcp6_transient defaults for var clm_start_type with val startup -adding use_case 1850-2100_rcp6_transient defaults for var model_year_align_ndep with val -1850 -adding use_case 1850-2100_rcp6_transient defaults for var rcp with val 6 -adding use_case 1850-2100_rcp6_transient defaults for var sim_year with val 1850 -adding use_case 1850-2100_rcp6_transient defaults for var sim_year_range with val -1850-2100 -adding use_case 1850-2100_rcp6_transient defaults for var stream_year_first_ndep with val -1850 -adding use_case 1850-2100_rcp6_transient defaults for var stream_year_last_ndep with val -2100 -adding use_case 1850-2100_rcp6_transient defaults for var use_case_desc with val Simulate -transient land-use, aerosol and Nitrogen deposition changes with historical data from -1850 to 2005 and then with the RCP6 scenario from AIM - -build-namelist - No default value found for flanduse_timeseries. - Are defaults provided for this resolution and land mask? -ERROR: generate_resolved.csh error for lnd template -configure error: configure generated error in attempting to created resolved scripts - - -The important thing to note here is the line: - -ERROR: generate_resolved.csh error for lnd template - -which tells us that the problem is in the land template. It may also indicate problems -in one of the other templates (atm, ccsm, cpl, glc, ice, or ocn), in which case you -should consult the appropriate model user's guide, and examine the given template file -in Tools/Templates. For more information on working with template -files see . - - -In the example above, it's obvious that the problem is coming from the &clm; &buildnml;, -in other situations it might not be so obvious where the problem is occurring. In such -cases it might be useful to add a "set echo" command to the top of the template file so -that each command in the template will be echoed to the screen and you can see what -is happening and where the error is occurring. - -set echo - - - -In the example, the error is that the &clm; XML database does NOT have a -flanduse_timeseries for the given resolution, rcp scenario and ocean mask. -That means you will need to create the file and then supply the file into your case. See - for more information on creating files, and see - for more information on adding files to the -XML database. Alternatively, you can provide the file to your case by creating -a user namelist as shown in . - - - -The two most common problems from your &clm; template will be errors from the &clm; -&configure; or &buildnml;. For more information on these scripts see: - and -the section on &CLMBLDNML;. - - - - - -Trouble with Building - -Here's an example of running the build for a case and having it fail in the land model -build. As you can see it lists which model component is being built and the build log -for that component. - - CCSM BUILDEXE SCRIPT STARTING - - Build Libraries: mct pio csm_share -Sat Jun 19 21:21:19 MDT 2010 /ptmp/erik/test_build/mct/mct.bldlog.100619-212107 -Sat Jun 19 21:22:18 MDT 2010 /ptmp/erik/test_build/pio/pio.bldlog.100619-212107 -Sat Jun 19 21:23:18 MDT 2010 -/ptmp/erik/test_build/csm_share/csm_share.bldlog.100619-212107 -Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/cpl.bldlog.100619-212107 -Sat Jun 19 21:24:00 MDT 2010 /ptmp/erik/test_build/run/atm.bldlog.100619-212107 -Sat Jun 19 21:24:06 MDT 2010 /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 -ERROR: clm.buildexe.csh failed, see /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 -ERROR: cat /ptmp/erik/test_build/run/lnd.bldlog.100619-212107 - -You can then examine the build log that failed and see what went wrong. Most compilers -will give the full filepath and line number for the file that filed to compile. - - - - -Trouble with Running - -Tracking down problems while the model is running is much more difficult to do -than configure or build problems. In this section we will give some suggestions -on how to find run time problems. Below we show the log file results of a job -that aborted while running. - - CCSM PRESTAGE SCRIPT HAS FINISHED SUCCESSFULLY -Sun Jun 20 18:24:06 MDT 2010 -- CSM EXECUTION BEGINS HERE -Sun Jun 20 18:24:35 MDT 2010 -- CSM EXECUTION HAS FINISHED -Model did not complete - see /ptmp/erik/test_run/run/cpl.log.100620-182358 - -In the next section we will talk about using the different log files to track -down problems, and find out where the problem is coming from. In the section -after that we give some general advice on debugging problems and some suggestions -on ideas that may be helpful to track the problem down. Some of the examples -below are from the &KnownBugs; file. - - -Tracking Problems by Querying Log Files - -The first thing to do when tracking down problems is to query the different log -files to see if you can discover where the problem occurs, and any error messages about -it. It's important to figure out if the problem comes in at initialization or in the -run phase of the model, and in which model component the problem happens. There -are different log files for the different major components, and they all end -with the date and time in YYMMDD-HHMMSS format (2-digit: year, month, day, hour -minute and second). When the model runs to completion the log files will be copied -to the logs directory in the script directory, but when the -model fails they will remain in the run directory. Here's an example list of -log files from an "I" case where the model dies in the land model initialization. -For "I" cases the sea-ice and ocean components are just stubs and don't create -log files (and unless running with the active land-ice model "glc" log files won't -be created either). - -atm.log.100620-182358 -ccsm.log.100620-182358 -cpl.log.100620-182358 -lnd.log.100620-182358 - - - - -The coupler log file - -The first log file to check is the coupler log file so that you can see where -the model dies and which model component it fails in. When the model dies at -initialization the last model component listed is the component that failed. - - -Example of a case that fails in the &clm; land model initialization. - -(seq_timemgr_clockPrint) Prev Time = 00001201 00000 -(seq_timemgr_clockPrint) Next Time = 99991201 00000 -(seq_timemgr_clockPrint) Intervl yms = 9999 0 0 - -(seq_mct_drv) : Initialize each component: atm, lnd, ocn, and ice -(seq_mct_drv) : Initialize atm component -(seq_mct_drv) : Initialize lnd component - - - - - -The ccsm log file - -The ccsm log files are to some extent the "garbage collection" of log output. The -&clm; sends it's output from it's master processor, but sends other output and possibly -errors to the ccsm log file. Because, of this, often error messages are somewhere in the -ccsm log file. However, since there is so much other output it may be difficult to find. -For example, here is some output from an older version of &cesm; (&cesm102;) where the -RTM river routing file (before it was converted to &netcdf;) was not provided and -the error on the open statement for the file was embedded near the end of the ccsm log -file. - -NODE# NAME -( 0) be1105en.ucar.edu -"/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line -239: 1525-155 The file name provided in the OPEN statement for unit 1 has zero length or -contains all blanks. The program will recover by ignoring the OPEN statement. -"/gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/lnd/clm/src/riverroute/RtmMod.F90", line -241: 1525-001 The READ statement on the file fort.1 cannot be completed because the end -of the file was reached. The program will stop. - -Running: ./ccsm.exe -Please wait... - -Memory usage for ./ccsm.exe (task # 0) is: 51696 KB. Exit status: 1. Signal: 0 - -Although the example is from an earlier version of the model it still serves to -illustrate finding problems from the ccsm log file. - - -When working with the ccsm log file, for a run-time problem, you will need to be able -to separate it's output into three categories: pre-crash, crash, and post-crash. The -pre-crash section is everything that is normal output for good operation of the model. -The crash section is the section where the model dies and reports on the actual problem. -the post-crash section is the cleanup and finalization after the model dies. The most -important part of this of course is the crash section. The tricky part is distinguishing -it from the other sections. Also because the ccsm log file most likely has duplicated -output from multiple processors it is even more difficult to distinguish the different -sections and to some extent the sections may be intertwined, as different processors -reach the different sections at different times. Because, of this reducing the number of -processors for your simulation may help you sort out the output in the file (see -). Also much of the output from the ccsm log file are -system level information having to do with &mpi; multiprocessing. Usually you can ignore -this information, but it makes it more difficult to trudge through. - - -Sometimes the ccsm log file is the ONLY file available, because the model terminates -early in initialization. In this case understanding the output in the ccsm log file -becomes even more important. This also indicates the model did NOT advance far enough -to reach the initialization of the individual model components. This may mean that the -initialization of the multiprocessing for &mpi; and/or &omp; failed, or that the -reading of the driver namelist file "drv_in" failed. - - -Here we show those three sections for a ccsm log file where a two task job failed on -reading the namelist file. For a typical job with many tasks similar sections of this -will be repeated not just twice but for each task and hence make it harder to read. - - -Pre-crash section of the ccsm log file - -ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. -ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. -ATTENTION: 0031-378 MP_EUIDEVICE setting ignored when LoadLeveler is not being used. -ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. - 0:INFO: 0031-724 Executing program: </usr/local/lsf/7.0/aix5-64/bin/lsnrt_run> - 1:INFO: 0031-724 Executing program: </usr/local/lsf/7.0/aix5-64/bin/lsnrt_run> - 0:/contrib/bin/ccsm_launch: process 401894 bound to logical CPU 0 on host be0310en.ucar.edu ... - 1:/contrib/bin/ccsm_launch: process 439264 bound to logical CPU 1 on host be0310en.ucar.edu ... - 0:INFO: 0031-619 64bit(us, Packet striping on) ppe_rmas MPCI_MSG: MPI/MPCI library was compiled on Wed Aug 5 13:36:06 2009 - 0: - 1:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 - 1:. - 1:LAPI is using lightweight lock. - 0:LAPI version #14.26 2008/11/23 11:02:30 1.296 src/rsct/lapi/lapi.c, lapi, rsct_rpt53, rpt53s004a 09/04/29 64bit(us) library compiled on Wed Apr 29 15:30:42 2009 - 0:. - 0:LAPI is using lightweight lock. - 0:Use health ping for failover/recovery - 1:Use health ping for failover/recovery - 0:Initial communication over instance 2. - 1:Initial communication over instance 0. - 1:IB RDMA initialization completed successfully - 1:The MPI shared memory protocol is used for the job - 0:IB RDMA initialization completed successfully - 0:LAPI job ID for this job is: 1684890719 - 0:The MPI shared memory protocol is used for the job - 0:(seq_comm_setcomm) initialize ID ( 7 GLOBAL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 2 ATM ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 1 LND ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 4 ICE ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 5 GLC ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 3 OCN ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_setcomm) initialize ID ( 6 CPL ) pelist = 0 1 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 8 CPLATM ) join IDs = 6 2 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 9 CPLLND ) join IDs = 6 1 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 10 CPLICE ) join IDs = 6 4 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 11 CPLOCN ) join IDs = 6 3 ( npes = 2) ( nthreads = 1) - 0:(seq_comm_joincomm) initialize ID ( 12 CPLGLC ) join IDs = 6 5 ( npes = 2) ( nthreads = 1) - 0: - 0: (seq_comm_printcomms) ID layout : global pes vs local pe for each ID - 0: gpe LND ATM OCN ICE GLC CPL GLOBAL CPLATM CPLLND CPLICE CPLOCN CPLGLC nthrds - 0: --- ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ - 0: 0 : 0 0 0 0 0 0 0 0 0 0 0 0 1 - 1: 1 : 1 1 1 1 1 1 1 1 1 1 1 1 1 - 1: - 0: (t_initf) Read in prof_inparm namelist from: drv_in - 1: (seq_io_init) cpl_io_stride, iotasks or root out of bounds - resetting to defaults 4 0 1 - 0: piolib_mod.f90 1353 1 2 1 2 - 1: piolib_mod.f90 1353 1 2 1 2 - 0: pio_support::pio_die:: myrank= 0 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride - 1: pio_support::pio_die:: myrank= 1 : ERROR: piolib_mod.f90: 1354 : not enough procs for the stride - - - -Crash section of the ccsm log file - - 0: - 0: Traceback: - 1: - 1: Traceback: - 0: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in - 1: Offset 0x00000c4c in procedure __pio_support_NMOD_piodie, near line 88 in file pio_support.F90.in - 0: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 - 1: Offset 0x00000fd0 in procedure __piolib_mod_NMOD_init, near line 1354 in file piolib_mod.F90 - 1: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 - 0: Offset 0x00000398 in procedure __seq_io_mod_NMOD_seq_io_init, near line 247 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/shr/seq_io_mod.F90 - 0: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 - 0: --- End of call chain --- - 1: Offset 0x0001aa88 in procedure ccsm_driver, near line 465 in file /gpfs/proj2/fis/cgd/home/erik/clm_trunk/models/drv/driver/ccsm_driver.F90 - 1: --- End of call chain --- - - - -Post-crash section of the ccsm log file - - 1:Communication statistics of task 1 is associated with task key: 1684890719_1 - 0:Communication statistics of task 0 is associated with task key: 1684890719_0 - 0: - 0:Running: ./ccsm.exe - 0:Please wait... - 0: - 0:Memory usage for ./ccsm.exe (task # 0) is: 198892 KB. Exit status: 134. Signal: 0 - 1: - 1:Running: ./ccsm.exe - 1:Please wait... - 1: - 1:Memory usage for ./ccsm.exe (task # 0) is: 198572 KB. Exit status: 134. Signal: 0 -INFO: 0031-656 I/O file STDOUT closed by task 0 -INFO: 0031-656 I/O file STDERR closed by task 0 -ERROR: 0031-250 task 0: IOT/Abort trap -INFO: 0031-656 I/O file STDOUT closed by task 1 -INFO: 0031-656 I/O file STDERR closed by task 1 -ERROR: 0031-250 task 1: IOT/Abort trap -INFO: 0031-639 Exit status from pm_respond = 0 -ATTENTION: 0031-386 MP_INSTANCES setting ignored when LoadLeveler is not being used. -Job /usr/local/lsf/7.0/aix5-64/bin/poejob /contrib/bin/ccsm_launch /contrib/bin/job_memusage.exe ./ccsm.exe - -TID HOST_NAME COMMAND_LINE STATUS TERMINATION_TIME -===== ========== ================ ======================= =================== -00000 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 -00001 be0310en /contrib/bin/ccs Exit (134) 08/31/2010 12:32:57 - - - - - -The &clm; log file - -Of course when you are working with and making changes to &clm;, most of your focus -will be on the &clm; log file and the errors it shows. As already pointed out -if you don't see errors in the lnd.log.* file you should look -in the ccsm.log.* to see if any errors showed up there. - - -Here's an example of the lnd.log.* file when running -&PTSMODE; with initial conditions (this is bug 1025 in the &KnownBugs; file). - - Successfully initialized variables for accumulation - - reading restart file I2000CN_f09_g16_c100503.clm2.r.0001-01-01-00000.nc - Reading restart dataset - ERROR - setlatlon.F:Cant get variable dim for lat or lsmlat - ENDRUN: called without a message string - - - - - -The &datm; log file - -When working with "I cases" the second most common problems after &clm; problems are -problems with the data atmosphere model. So examining the atm.log.* -is important. - - -Here's an example of a problem that occurs when the wrong prescribed aerosol file -is given to a pt1_pt1 simulation. - -(datm_comp_init) atm mode = CLMNCEP -(shr_strdata_init) calling shr_dmodel_mapSet for fill -(shr_strdata_init) calling shr_dmodel_mapSet for remap - ('shr_map_getWts') ERROR: yd outside bounds 19.5000000000000000 -(shr_sys_abort) ERROR: ('shr_map_getWts') ERROR yd outside 90 degree bounds -(shr_sys_abort) WARNING: calling shr_mpi_abort() and stopping - - - - - -The batch log files - -The names of the batch log files will depend on the batch system of the machine -that is being used. They will normally be in the script directory. Usually, they -don't contain important information, but they are a last resort place to look for -error messages. On the &ncar; IBM system "bluefire" the batch files are called -with names that start with "poe" and then either "stderr" or "stdout", with the -job number at the end. - - - - - - -General Advice on Debugging Run time Problems - -Here are some suggestions on how to track down a problem while running. In general -if the problem still occurs for a simpler case, it will be easier to track down. - -Run in DEBUG mode -Run with a smaller set of processors -Run in serial mode with a single processor -Run at a lower resolution -Run a simpler case -Run with a debugger - - - - -Run in DEBUG mode - -The first thing to try is to run in DEBUG mode so that float point trapping will be -triggered as well as array bounds checking and other things the compiler can turn -on to help you find problems. To do this edit the &envbuild; file and set DEBUG - to TRUE as follows: - -> ./xmlchange -file env_build.xml -id DEBUG -val TRUE - - - - - -Run with a smaller set of processors - -Another way to simplify the system is to run with a smaller set of processors. You -will need to clean the configure and edit the env_mach_pes.xml. -For example, to run with four processors: - -> ./configure -cleanall -> ./xmlchange -file env_mach_pes.xml -id NTASKS_ATM -val 4 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_LND -val 4 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_ICE -val 4 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_OCN -val 4 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_CPL -val 4 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_GLC -val 4 -> ./configure -case - -Another recommended simplification is to run without threading, so set the -NTHRDS for each component to "1" if it isn't already. Sometimes, -multiprocessing problems require a certain number of processors before they occur -so you may not be able to debug the problem without enough processors. But, it's always -good to reduce it to as low a number as possible to make it simpler. For threading -problems you may have to have threading enabled to find the problem, but you can run -with 1, 2, or 3 threads to see what happens. - - - - -Run in serial mode with a single processor - -Simplifying to one processor removes all multi-processing problems and makes -the case as simple as possible. If you can enable USE_MPI_SERIAL -you will also be able to run interactively rather than having to submit to a job -queue, which sometimes makes it easier to run and debug. If you can use -USE_MPI_SERIAL you can also use threading, but still run interactively -in order to use more processors to make it faster if needed. - -> ./configure -cleanall -# Set tasks and threads for each component to 1 -# You could also set threads to something > 1 for speed, but still -# run interactively if threading isn't an issue. -> ./xmlchange -file env_mach_pes.xml -id NTASKS_ATM -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_ATM -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_LND -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_LND -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_ICE -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_ICE -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_OCN -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_OCN -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_CPL -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_CPL -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTASKS_GLC -val 1 -> ./xmlchange -file env_mach_pes.xml -id NTHRDS_GLC -val 1 -# If mpi-serial capability is available on the machine you are using -# set USE_MPI_SERIAL to true so that you can run interactively -> ./xmlchange -file env_conf.xml -id USE_MPI_SERIAL -val TRUE -> ./configure -case -# Then build your case -# And finally run, by running the *.run script interactively -# (If you were able to set USE_MPI_SERIAL to true) - - - - - -Run at a lower resolution - -If you can create a new case running at a lower resolution and replicate the problem -it may be easier to solve. This of course requires creating a whole new case, and trying -out different lower resolutions. - - - - -Run a simpler case - -Along the same lines, you might try running a simpler case, trying another compset -with a simpler setup and see if you can replicate the problem and then debug from that -simpler case. Again, of course you will need to create new cases to do this. - - - - -Run with a debugger - -Another suggestion is to run the model with a debugger such as: dbx, -gdb, or totalview. Often to run with a debugger -you will need to reduce the number of processors as outlined above. Some debuggers such -as dbx will only work with one processor, while more advanced -debuggers such as totalview can work with both &mpi; tasks and OMP -threads. Even simple debuggers though can be used to query core files, to see where -the code was at when it died (for example using the where in -dbx for a core file can be very helpful. For help in running -with a debugger you will need to contact your system administrators for the machine -you are running on. - - - - - - - - diff --git a/doc/clm3_0_ChangeLog b/doc/clm3_0_ChangeLog deleted file mode 100644 index 60b925b8f4..0000000000 --- a/doc/clm3_0_ChangeLog +++ /dev/null @@ -1,13104 +0,0 @@ -=============================================================== -Tag name: clm3_8_00 -Originator(s): erik (erik) -Date: Tue May 4 22:39:18 MDT 2010 -One-line Summary: Get future scenarios working, finalize documentation, bring in MEGAN VOC and CNDV, simplify, mksurfdata optimization, fix bugs: snow enthalpy, BMOZ, pergro, use pft weights from fsurdat NOT finidat - -Purpose of changes: - -Get all of the future scenarios working (other than rcp=6.0) and get all of the datasets -for these scenarios (pftdyn, fndepdyn, and aerdep files, for rcp=2.6,4.5, and 8.5). -Finalize the User's Guide for now, with reviews from: Sam, Keith, Dave, and Sean, as -well as more work on tools chapter, and adding testing chapter in appendix. We brought -in the MEGAN version of the Volatile Organic Compounds (VOC) module which also reads -in VOC emission factors from the surface dataset, and hence all fsurdat files needed -to be replaced. Along with this the mksurfdata tool was changed in order to handle VOC's -and effort was made to optimize it, add shared memory paralelism, and do memory -optimization. We also removed the old Dynamic Global Vegetation Model (DGVM) and replaced -it with the Carbon Nitrogen Dynamic Vegetation model (CNDV). Make some simplifications -in the configure system to always use the CCSM version of build files, remove some -unused options, put standalone test options last in configure. Improve documenation in -XML files for configure and build-namelist options. - -Fix many different bugs. Enthalpy in snow combination was sometimes NOT conserved and now -is. There was a problem running DryDeposition for the BMOZ compset that is now fixed. -There were multiple issues running PERGRO testing that is now fixed. Previously, if -both the finidat file and the fsurdat file had PFT weights on them, the values from -the finidat file was used, now it will use the values from the fsurdat file. There are -also several cases where if the weights are different it will abort with an error, or -at least send a message to the log file about the differences. - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Type of tag: doc - -Describe any changes made to build system: - Switch cndv for dgvm, Have configure disallow bad cases - Change configure to NOT allow supln with spinup cases - Do NOT allow exit_spinup and ad_spinup at the same time. - Only allow voc to be set for seq_ccsm NOT ext_ccsm_seq - Remove carbon_aero and pio from configure (always build with pio) - emove unused configure options: clm_exe, -clm_exedir, and -clm_bld. - Move standalone testing options to the end of help. Use CCSM version - of mkSrcfiles/mkDepends, separate config vars into categories, work - on documentation with comments from Keith/Sam. - -Describe any changes made to the namelist: - Add 2000-2100 simulation year range as allowed option - - Two new history fields: - - TSOI_10CM = soil temperature in top 10cm of soil (K) - SOILWATER_10CM = soil liquid water + ice in top 10cm of soil (kg/m2) - - Check for some files based on rcp (fpftdyn, ndepdyn, and aerdep) - - Add in ability to add a user namelist in your case directory to input - namelist items at configure time. Simply add a file called "user_nl_clm" - as a valid namelist and the items in that namelist will show up in the initial - BuildConf/clm.buildnml.csh file. - -List any changes to the defaults for the boundary datasets: - get urbanc_alpha grid and frac files in - get in new single-point datasets - new qtr-degree, T62 and T85 fsurdat - new f10, f05, f09, 1850 fsurdat - new rcp=8.5, f19 pftdyn, - new rcp=4.5 f09, f19, f10 pftdyn - new rcp=2.6 f09, f19, f10 pftdyn - new rcp=8.5/4.5/2.6 f19 aerdep 1850-2100 datasets - new rcp=8.5/4.5 f19 fndepdyn 1850-2100 datasets - new rcp=2.6/4.5 f10, f45, f25, f09 aerdep/ndepdyn datasets - new rcp=2.6/4.5,8.5 f19 decadal averages for ndepdat - (Note: harvest was updated in PFTDYN files and raw PFT input files for 2006). - New 10x15 and 4x5 finidat files so that transient cases will work at those resolutions - New finidat files for 1-deg and 2-deg (from fully coupled simulations) - New datasets for I cases that are set in scripts - Duplicate cn datasets for cndv - New pft-physiology files with extra fields for CNDV - Remove 360x720 files, gx3v5, gx1v5 files - Remove 1x1.25, 2x2.5, and 2.5x3.33 grid resolutions - Remove gx1v3, gx1v4, gx1v5 land masks, add drydep defaults. - add mksrf_fvegtyp@1000-1004 - -Describe any substantial timing or memory changes: None - -Code reviewed by: - snow changes came from dlawren and also reviewed by oleson - PFT weight change also reviewed by: dlawren, slevis, oleson - CNDV came from slevis - VOC changes came from Francis Vitt and Jean-Francois Lamarque - history changes came from Keith Oleson, reviewed by Dave Lawrenece - OpenMP bug fix came from Mariana-Vertenstein, reviewed by Pat Worley - -List any svn externals directories updated (csm_share, mct, etc.): all - scripts to scripts4_100406a - drv to drvseq3_1_23 - datm to datm8_100406 - csm_share to share3_100407 - pio to pio1_0_18 - timing to timing_091021 - -Summary of testing: - - bluefire: All PASS except... -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -029 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -043 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -044 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -045 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -046 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -048 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 12 - bluefire interactive testing: All PASS except... -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 5 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CCSM testing: All PASS except -FAIL PST.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_15 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_10 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_10 -BFAIL PST.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -BFAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm3_7_10 - jaguar: All PASS except.. -005 smB51 TSM.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 144 arb_ic ..............FAIL! rc= 10 -006 erB51 TER.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -007 brB51 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -026 smLI2 TSM.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -027 erLI2 TER.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -028 brLI2 TBR.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -030 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 -031 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 5 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/ifort interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -014 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_FAIL! rc= 5 -015 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arbFAIL! rc= 5 -016 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 4 -018 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -019 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -020 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 - edinburgh/ifort: All PASS except... -002 erA92 TER.sh _sc_dm clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic ................FAIL! rc= 7 -003 brA92 TBR.sh _sc_dm clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic .............FAIL! rc= 6 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 5 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -011 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_00 - -Changes answers relative to baseline: Yes! - snow change has a small effect on climate (see below) - Bringing in MEGAN VOC changes answers for VOC fluxes in a diagnostic way - Changing to use weights from fsurdat file rather than finidat file, changes - answers for cases with finidat startup files, if the weights are different. - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: same climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - ccsm4_0_beta35 - bluefire - -compset B_1850_TRACK1_CN -res f19_g16 - - MSS location of control simulations used to validate new climate: - -/DLAWREN/csm/b40.1850.track1.2deg.003.snow - - URL for LMWG diagnostics output used to validate new climate: - -http://www.cgd.ucar.edu/ccr/paleo/b40.snow/b40.1850.track1.2deg.003.snow-b40.1850.track1.2deg.003.control/ -http://www.cgd.ucar.edu/ccr/dlawren/research/clm4.0_dev/b40.1850.track1.2deg.003.snowa-b40.1850.track1.2deg.003.controla/setsIndex.html - -=============================================================== -=============================================================== -Tag name: clm3_7_15 -Originator(s): erik (erik) -Date: Tue Apr 27 10:13:57 MDT 2010 -One-line Summary: Finish User's Guide, surfdata files for urban-1pt, fix mksurfdata ifort bugs, work with testing - -Purpose of changes: - -Fix all urban single-point datasets (mexicocity, urbanc_alpha), fix get_regional script -to work. Add more documentation on mksurfdata to users-guide, add pergro procedure -examples, more to testing section. Remove "moving the sun" warning. Fix -ndeplintInterp.ncl and getregional_datasets.ncl scripts. - -Bugs fixed (include bugzilla ID): - 1125 (T85, qtr-degree and urban pt surface datasets) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1150 (Bug in indices in getregional_datasets.ncl script) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Type of tag: std-test - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: New fsurdat files for urban-1p datasets - 1x1_vancouverCAN, 1x1_mexicocityMEX, 1x1_urbanc_alpha, 1x1_asphaltjungleNJ - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): datm - - datm to datm8_100406 - -List all files eliminated: - ->>>>>>>>>>> Remove test lists no longer used - D models/lnd/clm/test/system/tests_pretag_bangkok - D models/lnd/clm/test/system/tests_pretag_calgary - D models/lnd/clm/test/system/tests_posttag_lightning_nompi - -List all files added and what they do: - ->>>>>>>>>>> Add plot of pergro testing - A models/lnd/clm/doc/UsersGuide/pergro.jpg ->>>>>>>>>>> Add in plotting for pergro testing - A models/lnd/clm/tools/ncl_scripts/RMSbluefire.dat - A models/lnd/clm/tools/ncl_scripts/RMSintrepid.dat - A models/lnd/clm/tools/ncl_scripts/pergroPlot.ncl - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> Remove tests no longer used, work on documentation - M models/lnd/clm/test/system/test_driver.sh ---- Remove calgary, work on doc - M models/lnd/clm/test/system/gen_test_table.sh - Remove note for calgary - M models/lnd/clm/test/system/README ------------ Clarify documentation - M models/lnd/clm/test/system/CLM_runcmnd.sh ---- Remove calgary ->>>>>>>>>>> Fix ifort compiler problems, point to $CSMDATA locations of 1850 ->>>>>>>>>>> and 2000 PFT datasets - M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig ---- Change path - M models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr2000.txt - Change path - M models/lnd/clm/tools/mksurfdata/mksurfdata.regional ------- Change path - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn --------- Change path - M models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850.txt - Change path - M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept ------- Change path - M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist ------- Change path - M models/lnd/clm/tools/mksurfdata/README -------------------- Update documentation - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -------------- outnc_double to - .true., fix implicit none statements, add documentation - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl ------------- Add ability to set - inputdata directory - M models/lnd/clm/tools/mksurfdata/creategridMod.F90 --------- Change where to loops ->>>>>>>>>>> Fix bug in time axis and getregional indices - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl - Fix time axis and check it - M models/lnd/clm/tools/ncl_scripts/README ------------- Add note about pergroPlot - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl ->>>>>>>>>>> Fix CLM_USRDAT_NAME and add urban 1pt datasets - M models/lnd/clm/bld/clm.cpl7.template ------------------------ Set resolution for CLM_USRDAT_NAME - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New urban pt1 - datasets: 1x1_vancouverCAN, 1x1_mexicocityMEX, 1x1_urbanc_alpha, 1x1_asphaltjungleNJ ->>>>>>>>>>> Remove SNICAR message about moving the sun - M models/lnd/clm/src/biogeophys/SNICARMod.F90 ->>>>>>>>>>> Finish off current User's Guide ->>>>>>>>>>> Bring rel03->rel04 updates in, run ispell on everything ->>>>>>>>>>> Work on mksurfdata and testing sections, give instructions for pergro ->>>>>>>>>>> Add help from mksurfdata.pl and test_driver.sh scripts - M models/lnd/clm/doc/KnownBugs -- Add note that mkgriddata can not straddle Greenwich - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/config_cache.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - M models/lnd/clm/doc/UsersGuide/special_cases.xml - -Summary of testing: - - bluefire: All PASS except... -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -029 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -043 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -044 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -045 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -046 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -048 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 12 - bluefire interactive testing: All PASS except... -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 5 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CCSM testing: All PASS except -FAIL PST.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_15 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_10 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_10 -BFAIL PST.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -BFAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm3_7_10 - jaguar: All PASS except.. -005 smB51 TSM.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 144 arb_ic ..............FAIL! rc= 10 -006 erB51 TER.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -007 brB51 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -026 smLI2 TSM.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -027 erLI2 TER.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -028 brLI2 TBR.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -030 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 -031 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 5 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/ifort interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -014 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_FAIL! rc= 5 -015 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arbFAIL! rc= 5 -016 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 4 -018 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -019 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -020 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 - edinburgh/ifort: All PASS except... -002 erA92 TER.sh _sc_dm clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic ................FAIL! rc= 7 -003 brA92 TBR.sh _sc_dm clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic .............FAIL! rc= 6 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 5 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -011 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_14 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_7_14 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu Apr 8 16:15:35 MDT 2010 -One-line Summary: Fix rcp=2.6/4.5 1-degree fndepdyn filenames - -Purpose of changes: - -Fix the names of the rcp=2.6/4.5 1-degree fndepdyn filenames (had a 100208 file creation -date but should be 100407). - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Fix fndepdyn filenames - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Fix fndepdyn filenames - -Summary of testing: None - -=============================================================== -=============================================================== -Tag name: clm3_7_13 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu Apr 8 10:53:06 MDT 2010 -One-line Summary: Add in missing rcp=2.6/6 use-cases, and fix syntax errors in the namelist_defaults file - -Purpose of changes: - -Add in missing use cases for rcp=4.5 and rcp=6 transient future scenarios. Fix syntax errors in the namelist_defaults_clm -file. - -Bugs fixed (include bugzilla ID): Above two problems - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Nonae - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - -A models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml -A models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Fix syntax errors - -Summary of testing: None, other than script creation testing - -=============================================================== -=============================================================== -Tag name: clm3_7_12 -Originator(s): erik (erik) -Date: Thu Apr 8 00:30:30 MDT 2010 -One-line Summary: rcp=2.6/4.5 datasets for fndepdyn and aerdepdat, fix some minor issues, new 1pt urban surfdata files - -Purpose of changes: - -Add in urban single-point surfdata files. Add in regridded ndepdyn/aerdep files: f09, -f45, f10, f25. Fix name of f05, 1850 fsurdat file, add in new urban single point -datasets, add back urbanc_alpha grid/frac files. Put rcp in filenames for aerdep/ndep -regrid scripts. chomp frac filename in mksurfdata.pl, for urban single-point files. Make -OPT=TRUE default for mksurfdata. Lengthen allowed gridname for mksurfdata. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - aerdep/ndepdyn for rcp=2.6/4.5 f10, f45, f25, f09 - fix name of f05 fsurdata file for 1850 - get urbanc_alpha grid and frac files in - get in new urban single-point datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - csm_share to share3_100407 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/tools/mksurfdata/Makefile ------ make OPT=TRUE the default -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -- lengthen gridname to 32 -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - make sure to chomp fracdata file - -M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl - Add rcp to filename -M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --- Add rcp to filename - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New datasets - aerdep/ndepdyn for rcp=2.6/4.5 f10, f45, f25, f09 - fix name of f05 fsurdata file for 1850 - get urbanc_alpha grid and frac files in - get in new urban single-point datasets - -Summary of testing: - - bluefire interactive testing: All PASS except up to 014 smJ74 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -010 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 - -=============================================================== -=============================================================== -Tag name: clm3_7_11 -Originator(s): erik (erik) -Date: Wed Apr 7 11:59:22 MDT 2010 -One-line Summary: qtr-degree and T85 surfdata, rcp=2.6/4.5 datasets, doc updates - -Purpose of changes: - -Documentation updates, for users guide and namelist and configure xml files (rel04 to -rel05 update). Fix missing deallocate (bug 1133), and line length for NEE. Changes in -mksurfdata so that will run for qtr-degree. New rcp datasets for 4.5 and 2.6, aerdep -(only f19)/ndepdyn/pftdyn datasets. Fix CN spinup test, fix test name for bluefire tests. -Add in qtr-degree and T85 surfdata files. - -Bugs fixed (include bugzilla ID): - 1141 (CN spinup test) - 1137 (qtr-deg fsurdat) - 1136 (line length for NEE in histFlds) - 1135 (miss smG45 test) - 1133 (missing deallocate) - 1125 (T85, qtr-degree and urban pt surface datasets) - (partial T85 and qtr-degree) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - new qtr-degree and T85 fsurdat - new rcp=8.5, f19 pftdyn, rcp=4.5 f09, f19, f10 pftdyn - new rcp=2.6 f09, f19, f10 pftdyn - new rcp=4.5/2.6 f19 aerdep 1850-2100 datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv - scripts to scripts4_100406a - drv to drvseq3_1_23 - -List all files eliminated: - - D models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850.txt -- Rename with _hist_ - D models/lnd/clm/tools/mksurfdata/pftdyn_simyr2000.txt -- Rename with _hist_ - -List all files added and what they do: - - A models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr2000.txt - Renamed from above - A models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850.txt - Renamed from above - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>> Turn supln off for spinup modes - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do - M models/lnd/clm/test/system/tests_pretag_bluefire --------------- Change name of missing test smG45->smG55 - ->>>>>>>>>>>>> Change names of pftdyn text files to include _hist_ ->>>>>>>>>>>>> Memory updates so uses less memory (allocate just before needed ->>>>>>>>>>>>> deallocate after done). This is from the ccsm4_0_rel05 update ->>>>>>>>>>>>> Mariana started the changes and Erik added some more. - M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist - M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig - M models/lnd/clm/tools/mksurfdata/mksurfdata.regional - M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept - M models/lnd/clm/tools/mksurfdata/README - M models/lnd/clm/tools/mksurfdata/mkurbanparMod.F90 ----- Memory updates - - M models/lnd/clm/bld/clm.cpl7.template - Use $CASETOOLS for Makefile - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - - new qtr-degree and T85 fsurdat - new rcp=8.5, f19 pftdyn, rcp=4.5 f09, f19, f10 pftdyn - new rcp=2.6 f09, f19, f10 pftdyn - new rcp=4.5/2.6 f19 aerdep 1850-2100 datasets - ->>>>>>>>>>>>> Documentation udpates updating from rel04 to ccsm4_0_rel05 - M models/lnd/clm/bld/configure -------------------------- change CVS to SVN - M models/lnd/clm/bld/config_files/config_definition.xsl - Correct name - M models/lnd/clm/bld/config_files/config_definition.xml - Add category for maxpft - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Work with categories - and improve descriptions, remove rpntpath - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl - Seperate out - stand-alone testing categories, improve documentation, work - on categories. - ->>>>>>>>>>>>> Documentation udpates updating from rel04 to ccsm4_0_rel05 ->>>>>>>>>>>>> Updates from Sam, Keith, and Sean, more doc on tools and appendix - M models/lnd/clm/doc/UsersGuide/co2_streams.txt - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_stylesheet.dsl - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - M models/lnd/clm/doc/UsersGuide/special_cases.xml - M models/lnd/clm/doc/KnownBugs --------------------------- Add notes on: - bugzilla bugs: 669, 1024, 1124, 1125, 1127 - - M models/lnd/clm/src/main/accFldsMod.F90 -- Deallocate outside #ifdef - M models/lnd/clm/src/main/histFldsMod.F90 - Shorten long line for NEE - -Summary of testing: - - bluefire: All PASS up to 024, blHN1 test except... -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - bluefire interactive testing: All PASS except (up to 26 brAK8 test) -006 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -007 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -008 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 -018 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - jaguar interactive testing: All PASS up to smAK4 test except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -008 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............SKIPPED* -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -008 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_10 - -Changes answers relative to baseline: no (b4b) - -=============================================================== -=============================================================== -Tag name: clm3_7_10 -Originator(s): erik (erik) -Date: Mon Mar 22 23:54:48 MDT 2010 -One-line Summary: Fix drydep so that BMOZ case will work - -Purpose of changes: - -Update externals, fix drydep bug (so that BMOZ case will run bug 1132). Add 10x15 and 4x5 -finidat files, so that bluefire.clm.auxtest PET and PST cases will work. Fix -documentation on transient CO2. - -Bugs fixed (include bugzilla ID): - 1132 (clm failure for BMOZ compset) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New 10x15 and 4x5 finidat files so that transient cases will work at those resolutions - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, pio - Update to ccsm4_0_beta47 versions - scripts to scripts4_100322b - drv to drvseq3_1_20 - datm to datm8_100225 - pio to pio1_0_18 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/doc/UsersGuide/Makefile ---------- Fix conversion to xml -M models/lnd/clm/doc/UsersGuide/special_cases.xml - Fix transient CO2 doc -M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - Fix CO2 file - -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl --- Fix historical rcp value -M models/lnd/clm/tools/interpinic/runinit_ibm.csh - Fix so will run - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Add 10x15, 4x5 - finidat files - -M models/lnd/clm/src/main/clm_comp.F90 ------- check drydep_method -M models/lnd/clm/src/main/clmtypeInitMod.F90 - check drydep_method -M models/lnd/clm/src/main/clm_atmlnd.F90 ----- check drydep_method, don't pass - drydep stuff unless drydep_method is DD_XLND - -Summary of testing: - - bluefire/CCSM testing: All PASS except... -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_10 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_07 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_09 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_7_09 -Originator(s): erik (erik) -Date: Sun Mar 21 21:08:54 MDT 2010 -One-line Summary: Fix snow enthalpy bug, cndv datasets, various fixes - -Purpose of changes: - -Fix snow enthalpy bug from Dave Lawrence. Add rcp to mksurfdata.pl. Add new 2006 datasets -for pftdyn files for mksurfdata. Fix history bug. New rcp 8.5 1-degree pftdyn dataset. -Duplicate all cn datasets for cndv. pergro use cases output in double precision. Some -work on documentation. - -Bugs fixed (include bugzilla ID): - 1128 (cndv needs the same input files as cn) - 1130 (History problem on restarts) - 1131 (pergro use cases need double output files) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1125 (T85, qtr-degree and urban pt surface datasets) - 1132 (clm failure for BMOZ compset) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - - New 1-degree rcp=8.5 pftdyn dataset with harvest for 2006 - Duplicate cn datasets for cndv - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - snow changes come from dlawren and also reviewed by oleson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>> Add AIM rcp datasets -A models/lnd/clm/tools/mksurfdata/pftdyn_rcp6.0_simyr1850-2100.txt - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> New 2006 file -M models/lnd/clm/tools/mksurfdata/pftdyn_rcp2.6_simyr1850-2100.txt - New 2006 file -M models/lnd/clm/tools/mksurfdata/pftdyn_rcp4.5_simyr1850-2100.txt - New 2006 file -M models/lnd/clm/tools/mksurfdata/pftdyn_rcp8.5_simyr1850-2100.txt - New 2006 file -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - Add rcp as argument -M models/lnd/clm/tools/mksurfdata/README -------- Document mksurfdata.pl and rcp files - -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl - Get rid of old masks - -M models/lnd/clm/tools/interpinic/runinit_ibm.csh - Get rid of old masks/grids, and sim_year -M models/lnd/clm/tools/interpinic/README ---------- Update documentation - -M models/lnd/clm/tools/mkgriddata/mkgriddata.ccsm_dom - Add clm grid file -M models/lnd/clm/tools/mkgriddata/README ------------- More documentation - -M models/lnd/clm/bld/namelist_files/use_cases/pergro.xml ------ Output history in double -M models/lnd/clm/bld/namelist_files/use_cases/pergro0.xml ----- Output history in double -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Duplicate cn files for cndv - New 1-degree rcp=8.5 pftdyn file - -M models/lnd/clm/src/main/histFileMod.F90 - Make sure 3D fields defined before output - -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - conserve enthalpy on snow combination - -M models/lnd/clm/doc/IMPORTANT_NOTES ----- Add notes about fine-mesh -M models/lnd/clm/doc/UsersGuide/Makefile - Remove file for realclean - -Summary of testing: - - bluefire: -003 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic .............FAIL! rc= 11 -004 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v7 -6 arb_ic ...................FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 7 -010 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 arb_ic ......FAIL! rc= 11 -011 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 arb_ic ............FAIL! rc= 7 -015 brF92 TBR.sh 17p_vodsrsc_dm clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 cold .......FAIL! rc= 11 -016 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 cold .............FAIL! rc= 7 -019 brEH1 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 13 -020 blEH1 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 7 -023 brHN1 TBR.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -5+-5 cFAIL! rc= 13 -024 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 7 -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - bluefire interactive testing: -003 brA74 TBR.sh _nrsc_ds clm_std^nl_urb_br 20030101:NONE:1800 1x1_brazil navy -5+-5 arb_ic .....FAIL! rc= 13 -006 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -007 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -008 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 -016 brJ74 TBR.sh 4p_nrcasasc_ds clm_std^nl_urb_br 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_icFAIL! rc= 11 -018 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -031 brF93 TBR.sh 17p_vodsrsc_do clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 cold .......FAIL! rc= 11 -032 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 cold .............FAIL! rc= 7 -035 brL83 TBR.sh _nrsc_do clm_std^nl_urb_br 20020115:NONE:3600 5x5_amazon navy -10+-10 arb_ic ...FAIL! rc= 13 -040 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:NONE:1800 1x1_brazil navy -670 arb_ic ............FAIL! rc= 7 -045 bl754 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 7 -047 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 7 -049 bl754 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 2 - jaguar interactive testing: -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/ifort: interactive testing: -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -009 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -010 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -011 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -013 smOC4 TSM.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 10 -014 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_FAIL! rc= 5 -015 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arbFAIL! rc= 5 -017 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -018 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -019 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 - edinburgh/ifort -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_08 - -Changes answers relative to baseline: YES - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: same climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - ccsm4_0_beta35 - bluefire - -compset B_1850_TRACK1_CN -res f19_g16 - - MSS location of control simulations used to validate new climate: - -/DLAWREN/csm/b40.1850.track1.2deg.003.snow - - URL for LMWG diagnostics output used to validate new climate: - -http://www.cgd.ucar.edu/ccr/paleo/b40.snow/b40.1850.track1.2deg.003.snow-b40.1850.track1.2deg.003.control/ -http://www.cgd.ucar.edu/ccr/dlawren/research/clm4.0_dev/b40.1850.track1.2deg.003.snowa-b40.1850.track1.2deg.003.controla/setsIndex.html - -=============================================================== -=============================================================== -Tag name: clm3_7_08 -Originator(s): Mariana Vertenstein (mvertens) -Date: Fri Mar 12 13:26:09 MST 2010 -One-line Summary: Removal of check for weights if dynamic land use is used - -Purpose of changes: -This one line change enabled the vast majority of the CCSM tests to pass. - -Verified that ERI 20th century tests in CCSM test suite for ccsm4_0_beta46 now passed with this changed - -This was reviewed by Dave Lawrence and Sam Levis - -Everything from clm3_7_07 applies except for the following: - -M biogeophys/BiogeophysRestMod.F90 - - if ( nsrest == 1 .or. (nsrest == 3 .and. fpftdyn /= ' ') )then - - ! Do NOT do any testing for restart or a pftdyn branch case - + if ( nsrest == 1 .or. fpftdyn /= ' ' )then - + ! Do NOT do any testing for restart or a pftdyn case - also added in a #if CNDV - -M biogeochem/CNDVEstablishmentMod.F90 -M main/clmtypeInitMod.F90 - - fix for case when leaf area index is pathologically large - the original fix for this was not longer working - and the above changes address this - -M bld/build-namelist -M bld/namelist_files/namelist_defaults_clm.xml - - fixed issues related to getting fndepdat for -bgc cndv - -=============================================================== -Tag name: clm3_7_07 -Originator(s): erik (erik) -Date: Wed Mar 10 23:35:37 MST 2010 -One-line Summary: New finidat datasets for 1-deg, 2-deg, and abort if weights from finidat/fsurdat files are too different, and use fsurdat files as truth - -Purpose of changes: - -Use surfdata weights and stop if finidat file weights are too different. Use ccsm4init -datasets for finidat files for 1-deg and 2-deg. In I compsets, setup for special I case -finidat files. Update scripts. Drydep changes from Francis. Change cell_method to -cell_methods. Allow clm_start_type to be overridden if on use_case. Only set orb_iyearad -for standalone clm testing. Allow vars on use_cases to not be set for some configs. Make -sure all BGC modes are set for variables on use_cases. Set cold-start for pergro cases. -Update documentation. - -Bugs fixed (include bugzilla ID): - 1098 (use weights from surdat file rather than finidat file) - 1121 (history variable attribute cell_methods misnamed) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1132 (clm failure for BMOZ compset) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - - New finidat files for 1-deg and 2-deg (from fully coupled simulations) - New datasets for I cases that are set in scripts - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, dlawren, slevis, oleson - -List any svn externals directories updated (csm_share, mct, etc.): scripts - - scripts to scripts4_100310c - - This version of scripts sets up special finidat files that will be used - for all I cases (other cases use the fully coupled datasets that are stored - in the namelist_defaults_clm.xml database). - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New finidat files -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 ------------ Changes from Francis -M models/lnd/clm/src/main/ncdio.F90 --------------------------- Change cell_method to cell_methods -M models/lnd/clm/src/main/clm_initializeMod.F90 --------------- Remove second call to pftdyn_interp -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --------- Compare weights only - if NOT restart and NOT branch with pftdyn. If weights are too different - abort, if close enough write a warning and continue using the surfdata - weights - ->>>>>>>>>>>>>>>> Some work on documentation -M models/lnd/clm/doc/KnownBugs -M models/lnd/clm/doc/UsersGuide/preface.xml -M models/lnd/clm/doc/IMPORTANT_NOTES -M models/lnd/clm/doc/Quickstart.GUIDE - ->>>>>>>>>>>>>>>> Allow clm_start_type to be overridden if on use_case ->>>>>>>>>>>>>>>> Allow vars in use_cases to not be set for some configs -M models/lnd/clm/bld/build-namelist - ->>>>>>>>>>>>>>>> Change start_type to clm_start_type for all use-cases ->>>>>>>>>>>>>>>> Only set orb_iyearad for standalone clm testing -M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/pergro.xml --------- Set start to cold -M models/lnd/clm/bld/namelist_files/use_cases/pergro0.xml -------- Set start to cold -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - -Summary of testing: - - bluefire: All PASS except... -024 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 7 -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - bluefire interactive testing: All PASS except... -006 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -007 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -008 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 -018 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CCSM testing: All PASS except... -FAIL ERS.f19_g16.I1850.bluefire.compare_hist.clm3_7_06 -FAIL ERS.f19_g16.I1850.bluefire.compare.clm3_7_06 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_7_06 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_07 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_06 -SFAIL PST.f10_f10.I8520CN.bluefire.GC.201955 -SFAIL PET_PT.f10_f10.I8520CN.bluefire.GC.201955 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm3_7_06 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm3_7_06 - jaguar interactive testing: All PASS up to... -005 smAK4 TSM.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold - -CLM tag used for the baseline comparison tests if applicable: clm3_7_06 - -Changes answers relative to baseline: Different initial condition datasets, - also now using weights from surfdata files rather than finidat files - -=============================================================== -=============================================================== -Tag name: clm3_7_06 -Originator(s): erik (erik) -Date: Wed Mar 10 16:35:57 MST 2010 -One-line Summary: Bring cndv branch to trunk - -Purpose of changes: - -Bring CNDV branch to trunk cndv16_clm3_7_05 (erik/slevis). Fix bug 978 for Sam (nl -option for branch). Put CROP part of CNDV branch on it's own branch. Add a couple more -history fields (LAND_USE_FLUX, and LAND_UPTAKE). Add HTOP to default output. SNICAR_FRC -fix, test SNICAR_FRC. Fix VOC by making sure fsun240 is between 0 and 1. Fix CO2 PPMV for -I cases. Add in script to create CO2 streams file that can be used by datm8. Update VOC -documentation. Get in updates from ccsm4_0_rel branch. Remove 360x720 grid, files with -gx3v5/gx1v5 masks. Fix bug 1120, by initializing displavegc+ for CN, Change start_type to -clm_start_type, don't allow both fndepdat and fndepdyn. Don't allow spinup modes with -supln, and don't allow both ad_spinup and exit_spinup. Move testing from gx3v5 to gx3v7 -mask - -Bugs fixed (include bugzilla ID): - 1104 (Restart problem with pftdyn mode) - 1118 (Restarts with SNICAR_FRC fail) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1121 (history variable attribute cell_methods misnamed) - 1132 (clm failure for BMOZ compset) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Switch cndv for dgvm, Have configure disallow -bad cases - Change configure to NOT allow supln with spinup cases - Do NOT allow exit_spinup and ad_spinup at the same time. - Only allow voc to be set for seq_ccsm NOT ext_ccsm_seq - -Describe any changes made to the namelist: Add override_nsrest namelist option - -List any changes to the defaults for the boundary datasets: - New pft-physiology files with extra fields for CNDV - Add new f05 1850 surfdata file - Remove 360x720 files, gx3v5, gx1v5 files - -Describe any substantial timing or memory changes: None - -Code reviewed by: slevis, self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, csm_share, mct, and pio - - scripts to scripts4_100306 - drv to drvseq3_1_19 - csm_share to share3_100228 - mct to MCT2_7_0_100228 - pio to pio1_0_15 - -List all files eliminated: Remove DGVM files - - D models/lnd/clm/src/biogeochem/DGVMLightMod.F90 - D models/lnd/clm/src/biogeochem/DGVMReproductionMod.F90 - D models/lnd/clm/src/biogeochem/DGVMAllocationMod.F90 - D models/lnd/clm/src/biogeochem/DGVMEcosystemDynMod.F90 - D models/lnd/clm/src/biogeochem/DGVMKillMod.F90 - D models/lnd/clm/src/biogeochem/DGVMEstablishmentMod.F90 - D models/lnd/clm/src/biogeochem/DGVMRestMod.F90 - D models/lnd/clm/src/biogeochem/DGVMMod.F90 - D models/lnd/clm/src/biogeochem/DGVMMortalityMod.F90 - D models/lnd/clm/src/biogeochem/DGVMTurnoverMod.F90 - D models/lnd/clm/src/biogeochem/DGVMFireMod.F90 - -List all files added and what they do: - ->>>>>>>>>>>>> Add CNDV files - A models/lnd/clm/src/biogeochem/CNDVEstablishmentMod.F90 - A models/lnd/clm/src/biogeochem/CNDVLightMod.F90 - A models/lnd/clm/src/biogeochem/CNDVMod.F90 - A models/lnd/clm/src/biogeochem/CNDVEcosystemDynIniMod.F90 ->>>>>>>>>>>>> Add script to convert CAM historical greenhouse gas file to CO2 history ->>>>>>>>>>>>> file that can be used in datm streams - A models/lnd/clm/tools/ncl_scripts/getco2_historical.ncl ->>>>>>>>>>>>> Add SNICAR_FRC and CNDV config files to test - A models/lnd/clm/test/system/config_files/_scsnf_dh - A models/lnd/clm/test/system/config_files/_scsnf_dm - A models/lnd/clm/test/system/config_files/_scsnf_do - A models/lnd/clm/test/system/config_files/17p_cndvsc_dh - A models/lnd/clm/test/system/config_files/17p_cndvsc_dm - A models/lnd/clm/test/system/config_files/17p_cndvsc_do - A models/lnd/clm/test/system/config_files/17p_cndvsc_h - ->>>>>>>>>>>>> Add files to describe how to add streams for CO2 - A models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - A models/lnd/clm/doc/UsersGuide/co2_streams.txt - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>> Document new getco2 script, use correct namelist in getregional script - M models/lnd/clm/tools/ncl_scripts/README - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - ->>>>>>>>>>>>>>> Add K configure tests for CNDV, B configure tests for SNICAR_FRC, ->>>>>>>>>>>>>>> and create_croplunit tests Change maxpft 17 tests to numpft+1 - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do - M models/lnd/clm/test/system/config_files/17p_cnnsc_h - M models/lnd/clm/test/system/config_files/17p_cnnsc_m - M models/lnd/clm/test/system/config_files/17p_cnnsc_o - M models/lnd/clm/test/system/config_files/17p_cnsc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_do - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_do - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do - M models/lnd/clm/test/system/config_files/17p_cnnsc_dh - M models/lnd/clm/test/system/config_files/17p_cnnsc_dm - M models/lnd/clm/test/system/config_files/17p_cnnsc_do - M models/lnd/clm/test/system/config_files/17p_cnnsc_ds - - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/tests_posttag_kraken - M models/lnd/clm/test/system/tests_posttag_breeze - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_pretag_bangkok - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/tests_pretag_calgary - - M models/lnd/clm/test/system/input_tests_master - Add B and K tests - M models/lnd/clm/test/system/test_driver.sh ----- Update for bluefire changes - to scripts - M models/lnd/clm/test/system/mknamelist --------- Change start_type to - clm_start_type add in nrevsnfile - M models/lnd/clm/test/system/README.testnames --- Change K configure -tests to mean CNDV - ->>>>>>>>>>>>> - M models/lnd/clm/bld/configure ---- Swap out cndv for dgvm. -bgc cndv turns on - both CN AND CNDV cpp tokens. - voc part of standalone_test arguments - supln and spinup options can't be on at the same -time - exit_spinup and ad_spinup can't be on at the -same time - M models/lnd/clm/bld/queryDefaultXML.pm ---------------- Swap cndv for DGVM - M models/lnd/clm/bld/config_files/config_definition.xml - Swap cndv for dgvm - voc in standalone_test, maxpft lists valid numbers -category - M models/lnd/clm/bld/build-namelist ----- Change start_type to clm_start_type - Don't allow both fndepdyn and fndepdat to e set - Work with nrevsn, so not always given - M models/lnd/clm/bld/clm.cpl7.template -- Rename start_type to clm_start_type, and - let default be "default" - M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl ------ Update mask list - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Add override_nsrest, - mkghg_bndtvghg, rename start_type to clm_startype - - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Add -clm_start_type - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ---- Remove domain -files - with gx3v5 and gx1v5 masks - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- new pft-physiology files for CNDV - Use same fndepdat datasets for cndv - Remove 360x720 files, - files with gx3v5 and gx1v5 masks - New 1850 f05 fsurdat file - Add mkghg_bndtvghg dataset to point to CAM - historical greenhouse dataset - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ----- Remove -start_type - - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/UsersGuide/special_cases.xml - ->>>>>>>>>>>>> Add in landuseflux/landuptake, always use hardwire_sla for VOC ->>>>>>>>>>>>> Set displavegc for CN not just CNDV, new fields for SNICAR_FRC restarts - M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 --------- Calculate landuseflux/landuptake - M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 ------- Calculate pftmayexist for CNDV - Remove concurrent directives - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ------- Always use hardwire_sla - Remove DGVM CPP ifdefs, fix for transient problem from Dave - loop over soil filter rather than non-lake - M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 -------- Set displavegc etc. for CN as well as CNDV - Add some CNDV fields - M models/lnd/clm/src/main/clmtypeInitMod.F90 ------------- Remove agdd0/agdd5,fnpsn10, - initialize landuseflux/landuptake - M models/lnd/clm/src/main/CNiniSpecial.F90 --------------- initialize landuseflux/landuptake - M models/lnd/clm/src/main/clmtype.F90 -------------------- Swap DGVM vars for CNDV - add pftmayexist, landuseflux/landuptake - M models/lnd/clm/src/main/histFldsMod.F90 ---------------- Add LAND_USE_FLUX, LAND_UPTAKE, make HTOP active - Swap DGVM fields for CNDV - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 ---- Add fields needed for SNICAR_FRC - - M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 --- Remove uneeded use statement - M models/lnd/clm/src/biogeochem/CNGapMortalityMod.F90 ---- CNDV changes - M models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 - Remove junk - M models/lnd/clm/src/biogeochem/CNGRespMod.F90 ----------- Remove junk - M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 --- Remove junk - M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 ---- - M models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 --- - M models/lnd/clm/src/biogeochem/CNFireMod.F90 ------------ CNDV section - M models/lnd/clm/src/biogeochem/CNMRespMod.F90 ----------- Remove junk - M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 Remove junk - M models/lnd/clm/src/biogeochem/CNDecompMod.F90 ---------- Pass lbp, ubp to CNAllocate - M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 --- Formatting changes - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 --- Swap CNDV for DGVM - M models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 --- Remove junk - M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 - Remove junk - M models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 - Remove junk - M models/lnd/clm/src/biogeochem/CNrestMod.F90 ------------ Add CNDV section - M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 ---- Add CNDV section - M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 --- Remove junk - M models/lnd/clm/src/biogeochem/C13SummaryMod.F90 -------- Remove junk - M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 ------- Remove junk - M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 ------ Pass pft loop indices in, - formatting changes remove junk - M models/lnd/clm/src/biogeochem/CNC13FluxMod.F90 --------- Remove junk - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 ------- Swap CNDV for DGVM - M models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 ---- Pass lbp, ubp to CNDecompAlloc - M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - Use dwood from pft-physiology file - Add CNDV section - - M models/lnd/clm/src/main/clm_varpar.F90 --------- Change some of the names around - M models/lnd/clm/src/main/CNiniTimeVar.F90 ------- CNDV section for litter fall - M models/lnd/clm/src/main/clm_comp.F90 ----------- Swap CNDV for DGVM - M models/lnd/clm/src/main/clm_initializeMod.F90 -- Swap CNDV for DGVM - M models/lnd/clm/src/main/accFldsMod.F90 --------- Swap CNDV for DGVM - M models/lnd/clm/src/main/subgridMod.F90 --------- Handle create_croplandunit correctly - M models/lnd/clm/src/main/pftdynMod.F90 ---------- Add CNDV subroutine: pftwt_init - For CNDV make pftwt_interp public -and - M models/lnd/clm/src/main/iniTimeConst.F90 ------- Change dgvm vars init - M models/lnd/clm/src/main/restFileMod.F90 -------- Remove DGVM - M models/lnd/clm/src/main/controlMod.F90 --------- Add override_nsrest, swap CNDV for DGVM - M models/lnd/clm/src/main/initSurfAlbMod.F90 ----- Swap CNDV for DGVM - M models/lnd/clm/src/main/filterMod.F90 ---------- Swap CNDV for DGVM remove concurrent directives - M models/lnd/clm/src/main/clm_driver.F90 --------- Swap CNDV for DGVM - M models/lnd/clm/src/main/clm_varctl.F90 --------- Swap CNDV for DGVM, fix check for create_croplandunit - M models/lnd/clm/src/main/ndepFileMod.F90 -------- Remove junk - M models/lnd/clm/src/main/initGridCellsMod.F90 --- Fix create_croplandunit - M models/lnd/clm/src/main/pftvarcon.F90 ---------- New CNDV parameters, formatting changes, - Always read all parameters to make read easier to understand - M models/lnd/clm/src/main/surfrdMod.F90 ---------- Swap CNDV for DGVMA, fix create_croplandunit, change some names - - M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ----- Remove junk - M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 - Remove junk add comments - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 --- Remove junk - M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 - Change comments remove DGVM - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 ---- Change formatting add comments - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ------- Remove DGVM - M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 - Remove junk - M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ----- Remove DGVM add in CNDV - -Summary of testing: - - bluefire: -FAIL! rc= 7 -025 smK51 TSM.sh 17p_cndvsc_dh clm_std 19981231:NONE:1800 10x15 USGS 48 arb_ic ..................PASS -026 erK51 TER.sh 17p_cndvsc_dh clm_std 19981231:NONE:1800 10x15 USGS 10+38 arb_ic ...............PASS -027 brK51 TBR.sh 17p_cndvsc_dh clm_std 19981231:NONE:1800 10x15 USGS 24+24 arb_ic ...............PASS -028 blK51 TBL.sh 17p_cndvsc_dh clm_std 19981231:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 5 -029 smHN1 TSM.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colPASS -030 erHN1 TER.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -3+-7 cFAIL! rc= 13 -031 brHN1 TBR.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -5+-5 cFAIL! rc= 11 -032 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 7 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - bluefire interactive testing: All PASS except... -006 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -007 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -008 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 -018 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -032 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 cold .............FAIL! rc= 5 -036 blL83 TBL.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 7 -040 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:NONE:1800 1x1_brazil navy -670 arb_ic ............FAIL! rc= 5 - bluefire/CCSM testing: All PASS except.. (compare tests fail because CO2 level was changed for 2000 compsets) -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm3_7_05 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm3_7_05 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm3_7_05 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm3_7_05 -BFAIL ERS_D.f45_g37.I.bluefire.compare.clm3_7_05 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_7_05 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_06 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_05 -BFAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_05 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm3_7_05 -BFAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm3_7_05 -BFAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm3_7_05 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_05 - -Changes answers relative to baseline: I2000 cases are different because of new CCSM_CO2_PPMV - -=============================================================== -=============================================================== -Tag name: clm3_7_05 -Originator(s): erik (erik) -Date: Wed Feb 24 00:33:08 MST 2010 -One-line Summary: Bring VOC branch source code to trunk - -Purpose of changes: - -Move VOC branch over to trunk (vocemis-drydep19_clm3_7_04), this includes source code -changes for VOC and drydep. Ensure answers for f09, f19, f10 are identical to clm3_7_02 -(other than VOC fields). Split users guide into separate files by chapter. Remove dublin. -Add rcp option to getregional dataset script. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1104 (Restart problem with pftdyn mode) - 1118 (Restarts with SNICAR_FRC fail) - 1121 (history variable attribute cell_methods misnamed) - 1132 (clm failure for BMOZ compset) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Fix date of 1x1_tropicAtl surfdata - New T62 fsurdat file with VOC - Fix syntax error in default_datm file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts and drv - - scripts to scripts4_100222 (uses new bluefire compiler with bug-fix for - reproducibility bug) - drv to drvseq3_1_17 - -List all files eliminated: - ->>>>>>>>>>>>> Rename to edinburgh - D models/lnd/clm/test/system/tests_pretag_dublin - D models/lnd/clm/test/system/tests_pretag_dublin_nompi - ->>>>>>>>>>>>> Split into separate files - D models/lnd/clm/doc/UsersGuide/index.xml - -List all files added and what they do: - - A models/lnd/clm/test/system/tests_pretag_edinburgh ------- Rename dublin files - A models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - Rename dublin files - ->>>>>>>>>>>>> Split Users Guide into separate files by chapter - A models/lnd/clm/doc/UsersGuide/tools.xml - A models/lnd/clm/doc/UsersGuide/preface.xml - A models/lnd/clm/doc/UsersGuide/clm_ug.xml - A models/lnd/clm/doc/UsersGuide/adding_files.xml - A models/lnd/clm/doc/UsersGuide/config_cache.xml - A models/lnd/clm/doc/UsersGuide/custom.xml - A models/lnd/clm/doc/UsersGuide/get_Icaselist.pl --- Script to list I cases - A models/lnd/clm/doc/UsersGuide/single_point.xml - A models/lnd/clm/doc/UsersGuide/special_cases.xml - ->>>>>>>>>>>>> Add module to handle dry-deposition velocity - A models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>> Remove dublin - M models/lnd/clm/test/system/test_driver.sh - M models/lnd/clm/test/system/input_tests_master - Decrease mexicoCity run length to 157 - M models/lnd/clm/test/system/CLM_runcmnd.sh - ->>>>>>>>>>>>> Fix bug in dynamic PFT file generation example, let intel allow lines of ->>>>>>>>>>>>> any length - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn - Use 1850 veg file to start from - M models/lnd/clm/tools/mksurfdata/Makefile ---------- Remove intel -132 so can be any -length - M models/lnd/clm/tools/mkgriddata/Makefile ---------- Remove intel -132 so can be any - length, add SMP option - M models/lnd/clm/tools/mkdatadomain/Makefile -------- Remove intel -132 so can be any -length - - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -- Add absolute_path and - ability to use rcp - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - Add rcp - correct namelist for domainfile - ->>>>>>>>>>>>> - M models/lnd/clm/bld/clm.cpl7.template ---- Turn rtm off for PTS_MODE, remove lnd_in -and Filepath files from clmconf - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Fix syntax error in -2.5x3.33 domain file - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- Fix date of -surfdata_1x1_tropicAtl file - ->>>>>>>>>>>>> Split into separate files by Chapter - M models/lnd/clm/doc/UsersGuide/Makefile - ->>>>>>>>>>>>> Source code changes to use MEGAN VOC and dry-deposition - - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 -- Add readAnnualVegetation - subroutine for dry-deposition, use some F90 NetCDF, - get mlai difference between months for dry-deposition - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ------ New MEGAN VOC module - remove concurrent directives - M models/lnd/clm/src/main/clm_varpar.F90 ---------------- Change comment on nvoc - M models/lnd/clm/src/main/clm_comp.F90 ------------------ Interp monthly veg for - drydep on clm_init2 - M models/lnd/clm/src/main/clm_initializeMod.F90 --------- add readAnnualVegetation - M models/lnd/clm/src/main/accFldsMod.F90 ---------------- 24hr and 10day accumulators for - t_veg, fsd, fsi, fsun, laip, remove concurrent directives - M models/lnd/clm/src/main/clmtypeInitMod.F90 ------------ Add new VOC and drydep variables - M models/lnd/clm/src/main/iniTimeConst.F90 -------------- Read in VOC emission - factors, remove concurrent directives - M models/lnd/clm/src/main/clm_atmlnd.F90 ---------------- Add VOC and drydep fluxes - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 ------ Pass VOC and drydep fluxes - M models/lnd/clm/src/main/clm_driver.F90 ---------------- Always call VOC emission - and call depvel_compute - M models/lnd/clm/src/main/clmtype.F90 ------------------- Add some VOC and drydep - variables, move sandfrac/clayfrac for all not just CASA - add accumulation variables - M models/lnd/clm/src/main/histFldsMod.F90 --------------- Bunch of new inactive - variables for VOC fluxes - M models/lnd/clm/src/main/inicFileMod.F90 --------------- Li Xu: correct ncd_iolocal and snow_fraction - M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 - Deal with drydep velocity - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --- Add mlaidiff to restart - file, if fsun set to NaN on restart set it to spval - M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ----- Keep track of boundary - layer resistance - -Summary of testing: - - Baseline tests are identical other than VOC flux fields.. -> grep RMS -> /ptmp/erik/test-driver.612049/TBL.4p_vodsrsc_dh.clm_std^nl_urb.20021231:NONE:3600.1.9x2.5^0.9x1.25.gx1v6.48.arb_ic/cprnc.clmrun.clm2.h0.2002-12-31-00000.nc.out -> | grep -v 0.0000E+00 - RMS BIOGENCO 1.0058E-01 - RMS ISOPRENE 2.9500E+02 - RMS MONOTERP 2.9129E+00 - RMS ORVOC 3.3526E-01 - RMS OVOC 3.3526E-01 - RMS VOCFLXT 2.9641E+02 - - bluefire: -004 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 7 -011 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 7 -016 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 -020 blEH1 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 7 -024 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 7 -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -029 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -033 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 7 -041 blH52 TBL.sh 17p_cnnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold .........FAIL! rc= 7 -043 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 8 -044 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -045 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -046 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -050 blJ61 TBL.sh 4p_casasc_dh clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 7 - bluefire interactive testing: -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 7 -006 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -007 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -008 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -011 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -012 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 -017 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic FAIL! rc= 7 -018 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -023 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............FAIL! rc= 7 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -028 blL78 TBL.sh _nrsc_s clm_std^nl_urb 20021231:NONE:1800 1x1_brazil navy -10 arb_ic ...........FAIL! rc= 7 -032 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 -036 blL83 TBL.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 7 -041 bl744 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 7 -043 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 7 -045 bl754 TBLtools.sh mksurfdata tools__s globalirrig ...........................................FAIL! rc= 6 - bluefire/CCSM testing: -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLB.f45_f45.I.bluefire -PASS SMS_ROA.f45_f45.I.bluefire -RUN ERS_D.f45_g37.I.bluefire.GC.092123 -PASS PST.f45_g37.I1850.bluefire.cpl -PASS PST.f45_g37.I1850.bluefire.atm -PASS PST.f45_g37.I1850.bluefire.lnd -PASS PST.f45_g37.I1850.bluefire.ice -PASS PST.f45_g37.I1850.bluefire.ocn -PASS PST.f45_g37.I1850.bluefire.glc -PASS PET_PT.f45_g37.I1850.bluefire -PASS ERS.f19_g16.I1850.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -PEND ERH_D.f10_f10.I1850CN.bluefire.GC.092123 -PASS PST.f10_f10.I8520CN.bluefire.cpl -PASS PST.f10_f10.I8520CN.bluefire.atm -PASS PST.f10_f10.I8520CN.bluefire.lnd -PASS PST.f10_f10.I8520CN.bluefire.ice -PASS PST.f10_f10.I8520CN.bluefire.ocn -PASS PST.f10_f10.I8520CN.bluefire.glc - jaguar/CCSM testing: -PASS ERS_D.f09_g16.I1850.jaguar -PASS PST.f10_f10.I8520CN.jaguar.cpl -PASS PST.f10_f10.I8520CN.jaguar.atm -PASS PST.f10_f10.I8520CN.jaguar.lnd -PASS PST.f10_f10.I8520CN.jaguar.ice -PASS PST.f10_f10.I8520CN.jaguar.ocn -PASS PST.f10_f10.I8520CN.jaguar.glc -PASS PET_PT.f10_f10.I8520CN.jaguar - jaguar interactive testing: -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 7 -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -008 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............FAIL! rc= 7 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -013 smJ74 TSM.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic FAIL! rc= 8 -014 erJ74 TER.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic FAIL! rc= 5 -015 brJ74 TBR.sh 4p_nrcasasc_ds clm_std^nl_urb_br 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_icFAIL! rc= 5 -016 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic FAIL! rc= 4 - edinburgh/ifort interactive testing: -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -009 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -010 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ....FAIL! rc= 5 -011 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic .FAIL! rc= 5 -012 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -013 smOC4 TSM.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 10 -014 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_FAIL! rc= 5 -015 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arbFAIL! rc= 5 -016 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 4 -017 smNB4 TSM.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 10 -018 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -019 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -020 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 - edinburgh/ifort: -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -016 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 7 - breeze,gale,hail,gust/ifort interactive testing: -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 7 -008 smCA4 TSM.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 10 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 4 -010 smCA8 TSM.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 10 -011 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 4 -015 blL54 TBL.sh _sc_ds clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 7 -019 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 48 cold .......FAIL! rc= 7 -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_04 - -Changes answers relative to baseline: No bit-for-bit (except voc flux fields) - -=============================================================== -=============================================================== -Tag name: clm3_7_04 -Originator(s): erik (erik) -Date: Wed Feb 17 23:22:23 MST 2010 -One-line Summary: Bring VOC branch (vocemis-drydep18_clm3_7_03) tools, testing, and build to trunk (everything other than VOC code changes) - -Purpose of changes: - -Move VOC branch (vocemis-drydep18_clm3_7_03) to trunk for support functionality, tools, -testing, everything but the code changes. This includes optimization of mksurfdata, -adding new tests, adding drydep to build, listen to cpl flag if aerosols are sent, update -documentation about configure variables, remove pio and carbon_aero config options -(always build with pio), remove local Macro's files for Darwin (yong_g95, and -breeze_intel), and remove gx1v3, gx1v4 masks, and 1x1.25 and 2x2.5 grids. All NCL regrid -scripts to be able to use GRDFIL env variable to set location of a grid file just -created. turn rtm off if PTS_MODE is TRUE. mksurfdata optimization includes: create -subroutines for landuse normalization, add OpenMP parallelism, optimize memory so -deallocate when done, and put OMP threads, veg filenames and optimization level on -mksurfdata files. Move shr_drydepInputMod.F90 to drv/shr/seq_drydepMod.F90 (from -csm_share to drv). Update externals. Work on documentation using output logs from scripts -and moving documentation into separate chapters. - -Bugs fixed (include bugzilla ID): - 926 (pftdyn code needs to be shared in mksurfdata) - 1105 (Turn RTM mode off for PTS_MODE) - 1110 (dt limit error, for mexicocity) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1104 (Restart problem with pftdyn mode) - 1121 (history variable attribute cell_methods misnamed) - 1118 (Restarts with SNICAR_FRC fail) - 1133 (missing deallocate) - 1135 (miss smG45 test) - 1136 (line length for NEE in histFlds) - 1137 (qtr-deg fsurdat) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1141 (CN spinup test) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - Remove carbon_aero and pio from configure (always build with pio) - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Remove 1x1.25, 2x2.5, and 2.5x3.33 grid resolutions - Remove gx1v3, gx1v4, gx1v5 land masks, add drydep defaults. - Update 2.65x3.33@2000, 1x1_tropicAtl@2000, f09@1850 and 1x1_tropicAtl@1000-1004 pftdyn - add mksrf_fvegtyp@1000-1004 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share, drv, datm, and timing - - csm_share to share3_100215 - scripts to scripts4_100216 - drv to drvseq3_1_16 - datm to datm8_100215 - timing to timing_091021 - -List all files eliminated: - ->>>>>>>>>>>> Remove local Macros files, and remove maxpft=4 vodsrcsc tests - D models/lnd/clm/bld/config_files/Macros.yong_g95 - D models/lnd/clm/bld/config_files/Macros.breeze_intel - D models/lnd/clm/test/system/config_files/4p_vodsrsc_m - D models/lnd/clm/test/system/config_files/4p_vodsrsc_h - - D models/lnd/clm/doc/UsersGuide/index.xml -- Rename to clm_ug.xml - Divide most of the content into separate chapters. - -List all files added and what they do: - - A models/lnd/clm/test/system/config_files/_scnv_dh ---- No-VOC debug-hybrid mode - A models/lnd/clm/test/system/config_files/_scnv_do ---- No-VOC debug-pure SMP hybrid mode - A models/lnd/clm/test/system/config_files/17p_scnv_dh - 17pft no-VOC debug-hybrid mode - A models/lnd/clm/test/system/config_files/17p_scnv_do - 17pft no-VOC debug-pure SMP mode - A models/lnd/clm/test/system/nl_files/clm_drydep ------ Turn on drydep in namelist - A models/lnd/clm/tools/mksurfdata/mkvocef.F90 --------- VOC emissions - A models/lnd/clm/bld/namelist_files/namelist_defaults_drydep.xml - Drydep namelist defaults - A models/lnd/clm/doc/UsersGuide/tools.xml --------- Tools chapter - A models/lnd/clm/doc/UsersGuide/preface.xml ------- Preface and introduction chapter - A models/lnd/clm/doc/UsersGuide/clm_ug.xml -------- Change name of index.xml - Move most of the contents into separate chapters - A models/lnd/clm/doc/UsersGuide/adding_files.xml -- Adding files chapter - A models/lnd/clm/doc/UsersGuide/config_cache.xml -- Sample config cache file so can - run build-namelist for documentation - A models/lnd/clm/doc/UsersGuide/custom.xml -------- Customizing chapter - A models/lnd/clm/doc/UsersGuide/get_Icaselist.pl -- Script to get list of I cases - A models/lnd/clm/doc/UsersGuide/single_point.xml -- Single point chapter - A models/lnd/clm/doc/UsersGuide/special_cases.xml - Special cases chapter - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/config_files/README - Add nv no-VOC config case - M models/lnd/clm/test/system/README.testnames ---- Add drydep testnames - M models/lnd/clm/test/system/test_driver.sh ------ Use generic_linux_intel mach for breeze - also changes to get jaguar to work - M models/lnd/clm/test/system/input_tests_master -- Add drydep and no-VOC tests, cut - back Mexicocity test to 158 steps - - M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 -------- Add mksrf_gridnm and mksrf_fvocef - M models/lnd/clm/tools/mksurfdata/ncdio.F90 ----------- Write out error codes on a problem. - M models/lnd/clm/tools/mksurfdata/mksurfdata.regional - Add voc file. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn --- Add voc file, use 1850 veg file. - M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept - Add voc file. - M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist - Add voc file. - M models/lnd/clm/tools/mksurfdata/mkharvestMod.F90 ---- Move file definition for harvest to init sub - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 ------- Write out OpenMP threads - and OPT TRUE or FALSE, VOC fields, and veg filenames - M models/lnd/clm/tools/mksurfdata/mkorganic.F90 ------- Remove test and use 3D areaave - M models/lnd/clm/tools/mksurfdata/Makefile ------------ Add in SMP option to turn on OpenMP - M models/lnd/clm/tools/mksurfdata/mkurbanparMod.F90 --- Remove single level fields - and use 4D areaave - M models/lnd/clm/tools/mksurfdata/areaMod.F90 --------- Add 3D and 4D areaave interfaces - and add OpenMP directives - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -------- Create subroutines shared - by dynpft loop and surfdata: change_landuse and normalizencheck_landuse. - Allocate memory as late as possible and deallocate as soon as possible. - Add: mksrf_gridnm and mksrf_fvocef to namelist - Add mkvocef and add to output file - M models/lnd/clm/tools/mksurfdata/Srcfiles ------------ Add mkvocef.F90 - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl ------- Allow command line arguments - to pick resolutions and simulation-years. Read in namelist database information - for checking and using defaults. Add in mksrf_fvocef, and use mksrf_gridnm to - give output file same name as the input grid resolution name. - M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 -------- Remove testing, add 3D areaave - - M models/lnd/clm/tools/ncl_scripts/README ----------- Remove script no longer available. - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl - Allow env var GRDFIL to give - grid file to use - M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --- Allow env var GRDFIL to give - grid file to use - - M models/lnd/clm/tools/mkgriddata/README -- Fix typo - - M models/lnd/clm/bld/configure --------------------------------- Remove carbon_aero - and pio (always build with pio), and make voc default on - M models/lnd/clm/bld/queryDefaultNamelist.pl ------------------- Add drydep file. - M models/lnd/clm/bld/config_files/config_sys_defaults.xml ------ Change mach - defaults, remove darwin make linux edinburgh_pgi - M models/lnd/clm/bld/config_files/config_definition.xml -------- Remove carbon_aero - and pio, make default for mode ext_ccsm_seq, make voc on, - work on documentation - M models/lnd/clm/bld/build-namelist ---------------------------- Add drydep, remove - carbon_aero and pio - M models/lnd/clm/bld/clm.cpl7.template ------------------------- Turn rtm off for PTS_MODE - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Add mksrf_fvegtyp, - remove 1x1.25, 2x2.5, and 2.5x3.33 grid resolutions - remove gx1v3, gx1v4, gx1v5 land masks, add drydep_method, and drydep_list - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Remove 1x1.25, - 2x2.5, and gx1v3, gx1v4, gx1v5 domain files - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- Remove 1x1.25, - and gx1v3, gx1v4, gx1v5 files - update 2.65x3.33@2000, 1x1_tropicAtl@2000, f09@1850 - and 1x1_tropicAtl@1000-1004 pftdyn - add mksrf_fvegtyp@1000-1004 - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml -- Remove gx1v4, gx1v5 start dates - - M models/lnd/clm/doc/UsersGuide/Makefile --- Get makefile to use scripts to make - log info to put into document, and separate out document - into chapters - - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 --- Use atm_aero in infodata - to determine: caerdep_filled, and dustdep_filled - some changes to get ready for VOC and drydep branch to come to trunk - -Summary of testing: - - bluefire: All PASS up to 019 brEH1 - bluefire interactive testing: All PASS except... -004 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 -arb_ic FAIL! rc= 5 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CCSM testing: -PASS SMS_RLB.f45_f45.I.bluefire -PASS ERH_D.f10_f10.I1850CN.bluefire - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/ifort: All PASS except... -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_03 - -Changes answers relative to baseline: 1x1_tropicAtl changes due to new surfdata file - -=============================================================== -=============================================================== -Tag name: clm3_7_03 -Originator(s): erik (erik) -Date: Wed Feb 10 11:29:56 MST 2010 -One-line Summary: Add in more future scenario datasets, new history fields from Keith - -Purpose of changes: - -Add in pftdyn dataset for 1-degree rcp-8.5. Add in interpolated aerdep/ndepdyn scenario -files for f10, f09. Add in code change from Keith O. for average of top soil layers. Add -in rcp for ndep and aerdep regrid scripts. Allow 2000-2100 sim_year_range for 1-degree -resolution, and have a aerdep dataset for 1-degree for 2000-2100 (copy other 1850-2100 -datasets). There is also a 1-degree 1850-2100 aerosol dataset, but the file is large (~9GB). - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1104 (Restart problem with pftdyn mode) - 1118 (Restarts with SNICAR_FRC fail) - 1121 (history variable attribute cell_methods misnamed) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Add 2000-2100 simulation year range as allowed option - - Two new history fields: - - TSOI_10CM = soil temperature in top 10cm of soil (K) - SOILWATER_10CM = soil liquid water + ice in top 10cm of soil (kg/m2) - -List any changes to the defaults for the boundary datasets: New datasets for rcp=8.5 - f09, rcp=8.5 pftdyn for 1850-200 (use same file for 2000-2100) - faerdep, for 1850-2100 rcp=8.5, f10, f45, f25, f09 (and 2000-2100) and f19 for 2000-2100 - fndepdyn, for 1850-2000 rcp=8.5 f09 (use same file for 2000-2100), f25, f45, f10 - fndepdyn for 1850-2100 rcp=2.6 for native f19 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, history changes from Keith Oleson, reviewed by Dave Lawrenece - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: use-case for 2000-2100 for high resolution (1 degree and up) - ->>>>>>>>>> Add a use-case for a future scenario that only includes 2000-2100 ->>>>>>>>>> this is for 1-degree and higher resolution where we can't include the ->>>>>>>>>> historical period and have resonable sized files. - A models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>> Get regridding scripts working for rcp's - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl - Allow rcp to be set, more printing - M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --- Allow rcp to be set, allow more sim_year_ranges - ->>>>>>>>>> New rcp=8.5 datasets, and 2000-2100 support for 1-degree - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New rcp=8.5 datasets - f09, rcp=8.5 pftdyn for 1850-200 (use same file for 2000-2100) - faerdep, for 1850-2100 rcp=8.5, f10, f45, f25, f09 (and 2000-2100) and f19 for 2000-2100 - fndepdyn, for 1850-2000 rcp=8.5 f09 (use same file for 2000-2100), f25, f45, f10 - fndepdyn for 1850-2100 rcp=2.6 for native f19 - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Allow 2000-2100 sim-year range - - M models/lnd/clm/doc/UsersGuide/index.xml --- Update documentation with namelist examples - ->>>>>>>>>> Code changes from Keith Oleson to add 10cm soil temperature and soil water history variables. - M models/lnd/clm/src/main/clmtypeInitMod.F90 ------ Add h2osoi_liqice_10cm and t_soi_10cm - M models/lnd/clm/src/main/clmtype.F90 ------------- Add h2osoi_liqice_10cm and t_soi_10cm - M models/lnd/clm/src/main/histFldsMod.F90 --------- Add TSOI_10CM and SOILWATER_10CM, - on by default and output as average by default. - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 - Calculate 10cm soil averages for non-urban points - -Summary of testing: - - bluefire: All PASS except... -022 erHN1 TER.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -3+-7 cFAIL! rc= 7 -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -029 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - bluefire interactive testing: All PASS except... -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -034 erL83 TER.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -5+-5 arb_ic ........FAIL! rc= 6 -035 brL83 TBR.sh _nrsc_do clm_std^nl_urb_br 20020115:NONE:3600 5x5_amazon navy -10+-10 arb_ic ...FAIL! rc= 3 -036 blL83 TBL.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 3 - bluefire/CCSM testing: -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLA.f45_f45.I.bluefire.compare_hist.clm3_7_02 -PASS SMS_RLA.f45_f45.I.bluefire.compare.clm3_7_02 -PEND SMS_RLB.f45_f45.I.bluefire.GC.140232 -PEND SMS_ROA.f45_f45.I.bluefire.GC.140232 -PASS ERS_D.f45_g37.I.bluefire -PASS ERS_D.f45_g37.I.bluefire.compare_hist.clm3_7_02 -PASS ERS_D.f45_g37.I.bluefire.compare.clm3_7_02 -PEND PET.f45_g37.I1850.bluefire.GC.140232 -PEND ERS.f19_g16.I1850.bluefire.GC.140232 -RUN ERB.f09_g16.I_1948-2004.bluefire.GC.140232 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_02 -PASS ERH_D.f10_f10.I1850CN.bluefire -PASS ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_02 -PEND PET.f10_f10.I8520CN.bluefire.GC.140232 -FAIL ERS_D.f19_g16.I8521CNR85.bluefire -BFAIL ERS_D.f19_g16.I8521CNR85.bluefire.compare.clm3_7_02 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/lf95: All PASS up to smL58 (test 29) except... -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_02 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_7_02 -Originator(s): erik (erik) -Date: Sat Feb 6 00:43:49 MST 2010 -One-line Summary: Start adding in new rcp=8.5 datasets, remove some junk, change some env_conf variables, add user_nl_clm - -Purpose of changes: - -New pftdyn, ndep and aerdep files for rcp=8.5 future scenario 2005+ . Need to have the -ability to handle four future scenarios: minicam (rcp4.5), aim (rcp 6), image (rcp2.6), -and message (rcp8.5). Add in ndepdat datasets for rcp2.6 for future decades. Add in -ndepdyn, pftdyn, aerdep datasets for rcp8.5, and ndepdyn for rcp4.5 (f19) and pftdyn for -f10 as well. Some changes to scripts, remove CLM_DEMAND, add CLM_NML_USE_CASE, -CLM_CO2_TYPE and user namelist. Add user_nl to clm.cpl7.template, remove CLM_DEMAND add -CLM_CO2_TYPE and CLM_NML_USE_CASE (in favor of use_case's,). Make sure driver/scripts -updated with this change. Update documentation Users-Guide with comments from Keith and -Sam. Remove clm copy of mkSrcfiles/mkDepends. Remove run-ibm. Remove following options -from configure and config_definition: clm_exe, clm_exedir, and clm_bld. Remove -CASE/CCSM/CAM tests from test_driver.sh. Add some tests for new rcp=8.5. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1104 (Restart problem with pftdyn mode) - 1118 (Restarts with SNICAR_FRC fail) - 1121 (history variable attribute cell_methods misnamed) - 1143 (Problems with mksurfdata and ifort) - 1144 (Bug in ndeplintInterp.ncl in calculation of time axis) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Some changes to configure - Remove unused configure options: clm_exe, -clm_exedir, and -clm_bld. - Move standalone testing options to the end of help. Use CCSM version - of mkSrcfiles/mkDepends, separate config vars into categories, work - on documentation with comments from Keith/Sam. - -Describe any changes made to the namelist: Check for some files based on rcp - - Add in ability to add a user namelist in your case directory to input - namelist items at configure time. Simply add a file called "user_nl_clm" - as a valid namelist and the items in that namelist will show up in the initial - BuildConf/clm.buildnml.csh file. - -List any changes to the defaults for the boundary datasets: - fsurdat: f10, 1850 - fpftdyn: f10, 1850-2000, 1850-2100 (rcp=8.5) - fpftdyn: f19, 1850-2100 (rcp=8.5) - faerdep: f19, 1850-2100 (rcp=8.5) - fndepdat: f19, decadal averages (rcp=2.6) - fndepdyn: f19, 1850-2100 (rcp=8.5 and rcp=4.5) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, pio - - scripts to scripts4_100204 - drv to drvseq3_1_15 - pio to pio1_0_8 - -List all files eliminated: - ->>>>>>>>>>>>>>> Remove CCSM, scam, cam, and run-ibm script testing from test-system ->>>>>>>>>>>>>>> Use .clm.auxtest lists in CCSM scripts for CCSM testing - D models/lnd/clm/test/system/TSM_ccsmseq.sh - D models/lnd/clm/test/system/TSMext_ccsmseq_cam.sh - D models/lnd/clm/test/system/TCT_ccsmseq.sh - D models/lnd/clm/test/system/TCSruncase.sh - D models/lnd/clm/test/system/TSMruncase.sh - D models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh - D models/lnd/clm/test/system/TSCext_ccsmseq_scam.sh - D models/lnd/clm/test/system/tests_posttag_lightning - D models/lnd/clm/test/system/config_files/scam_ds - D models/lnd/clm/test/system/config_files/ext_ccsm_seq_10x15_dh - D models/lnd/clm/test/system/config_files/ext_ccsm_seq_4x5_dh - D models/lnd/clm/test/system/config_files/ext_ccsm_seq_1.9x2.5_dh - D models/lnd/clm/test/system/config_files/ext_ccsm_seq_64x128_s - D models/lnd/clm/test/system/config_files/ext_ccsm_seq_0.9x1.25_dh - D models/lnd/clm/bld/run-ibm.csh - D models/lnd/clm/bld/create_newcase ->>>>>>>>>>>>>>> Remove mkSrcfiles/mkDepends duplicated from ccsm scripts - D models/lnd/clm/bld/mkSrcfiles - D models/lnd/clm/bld/mkDepends - -List all files added and what they do: - ->>>>>>>>>>>>> no-RTM mode configurations for hybrid and mpi-only testing - A models/lnd/clm/test/system/config_files/_nrsc_dh - A models/lnd/clm/test/system/config_files/_nrsc_dm ->>>>>>>>>>>>> Add transient_rcp8.5 use-case option - A models/lnd/clm/test/system/nl_files/clm_transient_rcp8.5 - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/README.testnames --- Update test names - M models/lnd/clm/test/system/test_driver.sh ----- Remove CLM_SEQCCSMROOT - M models/lnd/clm/test/system/input_tests_master - Remove CCSM/cam tests, add rcp8.5 test - M models/lnd/clm/test/system/README ------------- Remove doc on CLM_SEQCCSMROOT ->>>>>>>>>>>>> Remove CCSM, cam, scam, and run-ibm tests from test lists - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/tests_posttag_kraken - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_pretag_bangkok - M models/lnd/clm/test/system/tests_posttag_intrepid - M models/lnd/clm/test/system/tests_pretag_dublin - M models/lnd/clm/test/system/tests_pretag_dublin_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/tests_pretag_calgary - ->>>>>>>>>>>>> New location for mkDepends, correct documentation - M models/lnd/clm/tools/mkgriddata/README ----- Correct mention of download - M models/lnd/clm/tools/mksurfdata/Makefile --- Change location of mkDepends - M models/lnd/clm/tools/interpinic/Makefile --- Change location of mkDepends - M models/lnd/clm/tools/mkgriddata/Makefile --- Change location of mkDepends - M models/lnd/clm/tools/mkdatadomain/Makefile - Change location of mkDepends - ->>>>>>>>>>>>> Remove unused configure options: clm_exe, -clm_exedir, and -clm_bld ->>>>>>>>>>>>> Move standalone testing options to the end of help ->>>>>>>>>>>>> Use CCSM version of mkSrcfiles/mkDepends, separate config vars into ->>>>>>>>>>>>> categories, work on documentation - M models/lnd/clm/bld/configure -------------------------- Move clm standalone testing - options to the end of the help, remove: -clm_exe, - -clm_exedir, and -clm_bld options - M models/lnd/clm/bld/config_files/Makefile.in ----------- Use CCSM version of mkSrcfiles/mkDepends - M models/lnd/clm/bld/config_files/config_definition.xsl - Separate variables into categories. - M models/lnd/clm/bld/config_files/config_definition.xml - Add categories, add - description changes from Keith/Sam, remove clm_exe, clm_exedir, and clm_bld - - M models/lnd/clm/bld/listDefaultNamelist.pl -- Also loop over rcp values - - M models/lnd/clm/bld/build-namelist ----- have rcp value impact filenames retrieved - M models/lnd/clm/bld/clm.cpl7.template -- Add CLM_NML_USE_CASE and CLM_CO2_TYPE, - remove CLM_DEMAND add user_nl_clm namelist, remove -clm_bld. - M models/lnd/clm/bld/README ------------- Update documentation after removing the - clm stand-alone build/run scripts. - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------- Remove defaults - as in namelist_defaults files, apply suggestions from Keith/Sam - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Change rcp default to -999.9 - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl ------- Put description above valid values - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- New datasets: - fsurdat: f10, 1850 - fpftdyn: f10, 1850-2000, 1850-2100 (rcp=8.5) - fpftdyn: f19, 1850-2100 (rcp=8.5) - faerdep: f19, 1850-2100 (rcp=8.5) - fndepdat: f19, decadal averages (rcp=2.6) - fndepdyn: f19, 1850-2100 (rcp=8.5 and rcp=4.5) ->>>>>>>>>>>>> Update documentation, add in documentation on changes added in here - M models/lnd/clm/doc/UsersGuide/index.xml -- Spellcheck, more work on doc, update - for changes that came in on this tag. - M models/lnd/clm/doc/index.shtml ----------- Correct test table. - -Summary of testing: - - bluefire: All PASS except... -009 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -........FAIL! rc= 10 -010 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 -arb_ic ......FAIL! rc= 5 -011 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 -arb_ic ......FAIL! rc= 5 -012 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -........FAIL! rc= 4 -013 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -.........FAIL! rc= 10 -017 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic -.........FAIL! rc= 7 - bluefire interactive testing: All PASS - bluefire/CCSM testing: All PASS, except.. -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_02 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_01 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_01 -FAIL PET.f10_f10.I8520CN.bluefire.compare.clm3_7_01 -FAIL ERS_D.f19_g16.I8521CNR85.bluefire -BFAIL ERS_D.f19_g16.I8521CNR85.bluefire.generate.clm3_7_02 -BFAIL ERS_D.f19_g16.I8521CNR85.bluefire.compare.clm3_7_01 - Special testing: -PASS ERS.f19_g16.I8521CNR85.bluefire - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_01 - -Changes answers relative to baseline: f10 because of new surface dataset - Other resolutions will be bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_7_01 -Originator(s): erik (Erik Kluzek) -Date: Fri Jan 29 12:58:12 MST 2010 -One-line Summary: OpenMP fix for pftdyn, start adding in rcp's, update ndeplintInterp.ncl script - -Purpose of changes: - -Changes to ndeplintInterp script to add the ability to generate ndepdyn datasets for future scenarios -2005+. Add rcp as input to build-namelist and add use-cases with different rcp's. Small bug-fixes to -mksurfdata. Add lists for 1850-2100 for the rcp's. Update drv and scripts to latest. Update documentation. -Fix from Mariana on OpenMP problem in pftdyn. Remove lightning from tests, start adding in -edinburgh. - -Bugs fixed (include bugzilla ID): - 1102 (OpenMP problem with pftdyn mode) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1104 (Restart problem with pftdyn mode) - 1118 (Restarts with SNICAR_FRC fail) - 1121 (history variable attribute cell_methods misnamed) - 1153 (Problem with ndeplintInterp for historical case) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, code-changes came from Mariana-Vertenstein, reviewed by Pat Worley - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, and datm - - scripts to scripts4_100125 - drv to drvseq3_1_13 - datm to datm8_100122 - -List all files eliminated: - - D models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850-2005.txt --> rename to pftdyn_hist_simyr1850-2005.txt - -List all files added and what they do: - ->>>>>>>>>>>>>>> List of surface datasets to create pftdyn files - A models/lnd/clm/tools/mksurfdata/pftdyn_rcp2.6_simyr1850-2100.txt - A models/lnd/clm/tools/mksurfdata/pftdyn_rcp4.5_simyr1850-2100.txt - A models/lnd/clm/tools/mksurfdata/pftdyn_rcp8.5_simyr1850-2100.txt ->>>>>>>>>>>>>>> Add use-cases for future scenarios - A models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - A models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - - A models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850-2005.txt --> renamed - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Add edinburgh, remove lightning - M models/lnd/clm/test/system/test_driver.sh --------- Remove lightning, add edinburgh - M models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh -- Delete csm_share/dshr directory no longer exists - M models/lnd/clm/test/system/CLM_runcmnd.sh --------- Remove lightning, add edinburgh - - M models/lnd/clm/tools/mksurfdata/mkharvestMod.F90 -- Fix small compiler bug for jaguar - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn - Point to new name for historical pftdyn file - ->>>>>>>>>>>>>> Handle future scenarios for dynamic Nitrogen-Deposition file creation - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl -- Add ability to handle future scenario data, and also leave - previous historical data the same as before, or - ->>>>>>>>>>>>>> Start adding ability to handle future scenarios for different RCP's - M models/lnd/clm/bld/build-namelist ------------------------------- Add rcp, - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------- Add rcp, new sim_year, sim_year_range values, allow blank - for hist_type1d_pertape - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Add default for rcp as -999. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- Add new Nitrogen deposition decadal datasets for RCP4.5/RCP8.5 - - M models/lnd/clm/doc/UsersGuide/index.xml -- Add more in, add notes on namelist, tools, and special cases - ->>>>>>>>>>>> Changes from Mariana V. to fix bug 1102, OpenMP bug with pftdyn cases - M models/lnd/clm/src/main/clm_initializeMod.F90 - Don't pass decomp bounds down - M models/lnd/clm/src/main/pftdynMod.F90 --------- Get decomp bounds here - M models/lnd/clm/src/main/clm_driver.F90 -------- Call pftdyn_interp on own OMP loop - -Summary of testing: - - bluefire: -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -049 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -050 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 4 -051 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 -052 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - bluefire interactive testing: -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7022 -brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -050 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - bluefire special testing: - Run I8520 from Dec/1/1850 @f09_g16 for 14 months with 64 tasks and 4 threads and make sure identical - to same with 128 tasks and 1 thread (require openMP build) comparing clm history files. clm3_7_00 4-thread case for this fails. But, answers are identical with clm3_7_00 for 128 tasks and 1 thread. - jaguar: -020 blJ62 TBL.sh 4p_casasc_dm clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 5 -026 erP65 TSM_ccsmseq.sh ERS f19_g15 I ..........................................................FAIL! rc= 4 -027 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - jaguar interactive testing: -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - jaguar/special testing: - Run I8520 from Dec/1/1850 @f09_g16 for 5 months with 416 tasks and 4 threads and make sure identical - to same with 1 thread (require openMP build) comparing clm history files. clm3_7_00 4-thread case for this fails. - jaguar/CCSM testing: -PASS ERS_D.f09_g16.I1850.jaguar -PASS PET.f10_f10.I8520CN.jaguar.cpl -PASS PET.f10_f10.I8520CN.jaguar.atm -PASS PET.f10_f10.I8520CN.jaguar.lnd -PASS PET.f10_f10.I8520CN.jaguar.ice -PASS PET.f10_f10.I8520CN.jaguar.ocn -PASS PET.f10_f10.I8520CN.jaguar.glc - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - dublin/ifort interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -030 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - edinburgh/pgi interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -030 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_00 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_7_00 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Jan 22 22:48:09 MST 2010 -One-line Summary: Update to datm8, redirect aquifer overflow to drainage, add gx3v7 - masks, script to extract regional datasets, add harvesting for CN, - modify shrubs, include urban model, ice stream for snowcapping, - new build-namelist system, scale solar by solar zenith angle in - datm, deep soil with bedrock at bottom, organic matter in soils, - SNICAR for snow radiation, sparce dense aero, snow cover changes - -Software engineering changes: - - Update to cpl7 and scripts. - Remove offline and cpl6 modes. - Remove support for CASA model. - Update to datm8 atmospheric data model. - Add gx3v7 land mask for T31 and fv-4x5 horizontal resolutions. - Add gx1v6 land mask for f05, f09, and f19 horigonzl resolutions. - Add tx1v1 land mask and 1.9x2.5_tx1v1 horizontal resolution. - Add in 2.5x3.33 horizontal resolution. - Add in T62 horizontal resolution so can run at same resolution as input datm data. - Allow first history tape to be 1D. - Add ability to use own version of input datasets with CLM_USRDAT_NAME variable. - Add a script to extract out regional datasets. - New build-namelist system with XML file describing all namelist items. - Add glacier_mec use-case and stub glacier model. - Add ncl script to time-interpolate between 1850 and 2000 for fndepdat dataset, for fndepdyn version. - Make default of maxpatch_pft=numpft+1 instead of 4. - Only output static 3D fields on first h0 history file to save space. - Add new fields for VOC (Volatile Organic Compounds) on some surface datasets, that will be - needed for the new MEGAN VOC model (NOT incorporated yet). - Add irrigation area to mksurfdata tool (NOT used in CLM yet). - Add multiple elevation class option for glaciers in mksurfdata tool (NOT used in CLM yet). - Add ascale field to land model in support of model running on it's own grid. - -Science changes: - - Change to freezing temperature constant - Forcing height at atm plus z0+d on each tile - Effective porosity divide by zero fix - Sparse/dense canopy aerodynamic parameters - Ground/snow emissivity smooth transition - Thermal and hydraulic properties of organic soil - Init h2osoi=0.3 - Snow compaction fix - Snow T profile during layer splitting fix - Snow burial fraction - Snow cover fraction - SNICAR (snow aging, black carbon and dust deposition, vertical distribution of solar energy) - Remove SNOWAGE, no longer used - Deep soil (15 layers, ~50m), 5 new layers are hydrologically inactive bed rock - Ground evap (beta), stability, and litter resistance - Organic/mineral soil hydraulic conductivity percolation theory - Richards equation modifications - Normalization of frozen fraction of soil formulation - One-step solution for soil moisture and qcharge - Changes to rsub_max for drainage and decay factor for surface runoff - Fixed diurnal cycle of solar radiation in offline forcing data - Back to CLM3 lakes and wetlands datasets, but 1% rather than 5% threshold (same for glacier) - Changes to pft physiology file from CN - New grass optical properties - New surface dataset assuming no herbaceous understory - Direct versus diffuse radiation offline - New VOC model (MEGAN) - Snow-capped runoff goes to new ice stream and routed to ocean as ice - Dust model always on, LAI threshold parameter change from 0.1 to 0.3 - Daylength control on vcmax - SAI and get_rad_dtime fix - Always run with MAXPATCH_PFT=npfts + 1 instead of 4 - Transient land cover/use mode - datasets, energy and water balance - RTM sub-cycling - Twostream bug fix - Update soil colors - 2m relative humidity - Fix for aquifer leak (SoilHydrologyMod, BalanceCheckMod) - New nitrogen deposition file (units and sum of NOx, NHy) - -Quickstart to new cpl7 scripts... - - cd scripts - ./create_newcase -help # get help on how to run create_newcase - ./create_newcase -case testI -mach bluefire -res f19_g16 -compset I # create new "I" case for bluefire at 1.9x2.5_gx1v6 res - # "I" case is clm active, datm7, and inactive ice/ocn - cd testI - ./xmlchange -help # Get help on editor for XML files - ./xmlchange env_conf.xml env_mach_pes # Edit configure files if needed - configure -case # create scripts - ./xmlchange env_build.xml # Edit build files if needed - testI.build # build model and create namelists - ./xmlchange env_run.xml # Edit run files if needed - bsub < testI.run # submit script - # (NOTE: edit env_run.xml to set RESUBMIT to number of times to automatically resubmit) -Quickstart to use of regional extraction scripts and PERSONAL datasets: - - # Run the script to create an area to put your files (assume CSMDATA set to standard inputdata) - cd scripts - setenv MYCSMDATA $HOME/myinputdata - link_dirtree $CSMDATA $MYCSMDATA - - # Run the extraction for data from 52-73 North latitude, 190-220 longitude - # that creates 13x12 gridcell region from the f19 (1.9x2.5) global resolution over - # Alaska - cd ../models/lnd/clm/tools/ncl_scripts - setenv MYID 13x12pt_f19_alaskaUSA - getregional_datasets.pl -sw 52,190 -ne 73,220 -id $MYID -mycsmdata $MYCSMDATA - - # Now create a case that uses these datasets - cd ../../../../../scripts - create_newcase -case testregional -compset I -mach bluefire -res pt1_pt1 -skip_rundb - cd testregional - $EDITOR env_conf.xml # change CLM_BLDNML_OPTS to include "-clm_usr_name $MYID" (expand $MYID) - $EDITOR env_mach_pes.xml # Change tasks/threads as appropriate (defaults to serial) - xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA - - # Do other changes to xml files as appropriate - # configure as normal, then edit the datm namelist - - configure -case - - # Then build and run the case as normal - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - 1121 (history variable attribute cell_methods misnamed) - 1118 (Restarts with SNICAR_FRC fail) - -Describe any changes made to build system: - - Change directory structure to match CCSM. - Add BGP target. - Add choice between ESMF and MCT frameworks. - Start removing #ifdef and directives that supported Cray-X1 Phoenix as now decommisioned. - Make default of maxpatch_pft=numpft+1 instead of 4 for all configurations. - By default turn on CLAMP when either CN or CASA is enabled - New SNICAR_FRC, CARBON_AERO, and C13 CPP ifdef tokens. - - New options added to configure: - - -comp_intf Component interface to use (ESMF or MCT) (default MCT) - -nofire Turn off wildfires for bgc setting of CN (default includes fire for CN) - -pio Switch enables building with Parallel I/O library. [on | off] (default is on) - -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] (default is off) - -Describe any changes made to the namelist: - - NOTE: build-namelist now checks the validity of your namelist you generate by looking at data in the namelist_definition.xml - file. In order to add new namelist items you need to change the code and also edit this file. To view information - on the namelist view the file: - models/lnd/clm/bld/namelist_files/namelist_definition.xml - in your browser and you'll see the names, type, description and valid_values for all namelist variables. - - Changes to build-namelist: - Transient sim_year ranges (i.e. 1850-2000) - Remove cam_hist_case option. - Make sure options ONLY used for stand-alone testing have a "drv_" or "datm_" prefix in them and list these - options all together and last when asking for help from build-namelist. - New options to build-namelist: - -clm_usr_name "name" Dataset resolution/descriptor for personal datasets. Default: not used - Example: 1x1pt_boulderCO_c090722 to describe location, - number of pts, and date files created - New list options to build-namelist: - build-namelist -res list # List valid resolutions - build-namelist -mask list # List valid land-masks - build-namelist -sim_year list # List valid simulation years and simulation year ranges - build-namelist -clm_demand list # List namelist variables including those you could demand to be included. - build-namelist -use_case list # List valid use-cases - - New use-cases for: - - 1850_control = Conditions to simulate 1850 land-use - 2000_control = Conditions to simulate 2000 land-use -20thC_transient = Simulate transient land-use, and aerosol deposition changes from 1850 to 2005 - glacier_mec = Placeholder for running IG cases with the ice sheet model glimmer - - New namelist items: - - urban_hac = OFF, ON or ON_WASTEHEAT (default OFF) Flag for urban Heating and Air-Conditioning - OFF = Building internal temperature is un-regulated. - ON = Building internal temperature is bounded to reasonable range. - ON_WASTEHEAT = Building internal temperature is bounded and resultant waste - heat is given off. - urban_traffic = .true. or .false. (default .false.) Flag to include additional multiplicative factor of urban traffic - to sensible heat flux. - fsnowoptions = filename file for snow/aerosol optical properties (required) - fsnowaging = filename file for snow aging parameters (required) - faerdep = filename file of aerosol deposition (required) - - New history variables: (note watt vs. W in units, 26 vs. 76) - BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s - C13_PRODUCT_CLOSS C13 total carbon loss from wood product pools gC13/m^2/s - DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s - EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 - FGR12 heat flux between soil layers 1 and 2 watt/m^2 - FSAT fractional area with water table at surface unitless - FSH_NODYNLNDUSE sensible heat flux not including correction for land use change - watt/m^2 - GC_HEAT1 initial gridcell total heat content J/m^2 - GC_HEAT2 post land cover change total heat content J/m^2 inactive - GC_ICE1 initial gridcell total ice content mm/s - GC_ICE2 post land cover change total ice content mm/s inactive - GC_LIQ1 initial gridcell total liq content mm - GC_LIQ2 initial gridcell total liq content mm inactive <<<< name?? - H2OSNO_TOP mass of snow in top snow layer kg - HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning - watt/m^2 - HK hydraulic conductivity mm/s inactive - LWup upwelling longwave radiation watt/m^2 inactive - NBP net biome production, includes fire, landuse, and harvest flux, positive for sink - gC/m^2/s - OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s - PBOT atmospheric pressure Pa - PCO2 atmospheric partial pressure of CO2 Pa - PRODUCT_CLOSS total carbon loss from wood product pools gC/m^2/s - PRODUCT_NLOSS total N loss from wood product pools gN/m^2/s - Qair atmospheric specific humidity kg/kg inactive - Qanth anthropogenic heat flux watt/m^2 inactive - Qtau momentum flux kg/m/s^2 - QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s - QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s - QRUNOFF_NODYNLNDUSE total liquid runoff not including correction for land use change (does not include QSNWCPICE) - mm/s - QSNWCPICE excess snowfall due to snow capping mm/s - QSNWCPICE_NODYNLNDUSE excess snowfall due to snow capping not including correction for land use change - mm/s - QSNWCPLIQ excess rainfall due to snow capping mm/s inactive - SMP soil matric potential mm inactive - SNOAERFRC2L surface forcing of all aerosols in snow, averaged only when snow is present (land) - watt/m^2 - SNOAERFRCL surface forcing of all aerosols in snow (land) watt/m^2 - SNOBCFRCL surface forcing of BC in snow (land) watt/m^2 - SNOBCMCL mass of BC in snow column kg/m2 - SNOBCMSL mass of BC in top snow layer kg/m2 - SNOdTdzL top snow layer temperature gradient (land) K/m - SNODSTFRC2L surface forcing of dust in snow, averaged only when snow is present (land) - watt/m^2 - SNODSTFRCL surface forcing of dust in snow (land) watt/m^2 - SNODSTMCL mass of dust in snow column kg/m2 - SNODSTMSL mass of dust in top snow layer kg/m2 - SNOFSRND direct nir reflected solar radiation from snow watt/m^2 inactive - SNOFSRNI diffuse nir reflected solar radiation from snow watt/m^2 inactive - SNOFSRVD direct vis reflected solar radiation from snow watt/m^2 inactive - SNOFSRVI diffuse vis reflected solar radiation from snow watt/m^2 inactive - SNOFSDSND direct nir incident solar radiation on snow watt/m^2 inactive - SNOFSDSNI diffuse nir incident solar radiation on snow watt/m^2 inactive - SNOFSDSVD direct vis incident solar radiation on snow watt/m^2 inactive - SNOFSDSVI diffuse vis incident solar radiation on snow watt/m^2 inactive - SNOLIQFL top snow layer liquid water fraction (land) fraction inactive - SNOOCMCL mass of OC in snow column kg/m2 - SNOOCMSL mass of OC in top snow layer Kg/m2 - SNOOCFRC2L surface forcing of OC in snow, averaged only when snow is present (land) - SNOOCFRCL surface forcing of OC in snow (land) watt/m^2 - watt/m^2 - SNORDSL top snow layer effective grain radius m^-6 inactive - SNOTTOPL snow temperature (top layer) K/m inactive <<< units? - SWup upwelling shortwave radiation watt/m^2 inactive - URBAN_AC urban air conditioning flux watt/m^2 - URBAN_HEAT urban heating flux watt/m^2 - Wind atmospheric wind velocity magnitude m/s inactive - WOOD_HARVESTC wood harvest (to product pools) gC/m^2/s - WOOD_HARVESTN wood harvest (to product pools) gN/m^2/s - - History field name changes: - - ANNSUM_PLANT_NDEMAND => ANNSUM_POTENTIAL_GPP - ANNSUM_RETRANSN => ANNMAX_RETRANSN - C13_DWT_PROD10C_LOSS => C13_PROD10C_LOSS - C13_DWT_PROD100C_LOSS => C13_PROD100C_LOSS - C13_DWT_PROD10N_LOSS => C13_PROD10N_LOSS - C13_DWT_PROD100C_LOSS => C13_PROD100C_LOSS - DWT_PROD100N_LOSS => PROD10N_LOSS - DWT_PROD100N_LOSS => PROD100N_LOSS - DWT_PROD100C_LOSS => PROD10C_LOSS - DWT_PROD100C_LOSS => PROD100C_LOSS - HCSOISNO => HC - TEMPSUM_PLANT_NDEMAND => TEMPSUM_POTENTIAL_GPP - TEMPSUM_RETRANSN => TEMPMAX_RETRANSN - - History field names deleted: - SNOWAGE, TSNOW, FMICR, FCO2, DMI, QFLX_SNOWCAP - - Add new urban oriented _U, and _R (Urban and Rural) for: - EFLX_LH_TOT, FGR, FIRA, FSH, FSM, Q2M, QRUNOFF, RH2M, SoilAlpha, TG, TREFMNAV, TREFMXAV, and TSA - (missing _R for SoilAlpha) - -Describe timing and memory performance: - -Versions of any externally defined libraries: - - scripts scripts4_100108b - drv vocemis-drydep12_drvseq3_1_11 - datm datm8_091218 - socn stubs1_2_02/socn - sice stubs1_2_02/sice - sglc stubs1_2_02/sglc - csm_share vocemis-drydep13_share3_091217 - esmf_wrf_timemgr esmf_wrf_timemgr_090402 - timing timing_090929 - mct MCT2_7_0_100106 - pio pio60_prod - cprnc cprnc_081022 - -Summary of testing: - bluefire: All PASS up to...017 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............PASS - bluefire interactive testing: All PASS up to.. -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: -PASS ERH.f09_g16.B20TRCN.bluefire -BFAIL ERH.f09_g16.B20TRCN.bluefire.compare.ccsm4_0_beta38 --- compset names changed -- but cpl.log files compare exactly -! -> ../Tools/check_exactrestart.pl cpl.log.100109-171753 $FISHOME/ccsm4_0_beta38/scripts/ERH.f09_g16.B20TRTR1CN.bluefire.G -.172652/logs/cpl.log.100108-181015 -log files match! -PASS -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLB.f45_f45.I.bluefire -PASS SMS_ROA.f45_f45.I.bluefire -PASS ERS_D.f45_g37.I.bluefire -PASS ERS_D.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS_D.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS PET.f45_g37.I1850.bluefire.cpl -PASS PET.f45_g37.I1850.bluefire.atm -PASS PET.f45_g37.I1850.bluefire.lnd -PASS PET.f45_g37.I1850.bluefire.ice -PASS PET.f45_g37.I1850.bluefire.ocn -PASS PET.f45_g37.I1850.bluefire.glc -PASS PET.f45_g37.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire -PASS ERS.f19_g16.I1850.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERB.f09_g16.I_1948-2004.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_6_58+datm8 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire <<<<<<<<<<<<<<<<<<<<<<<<< Failed before bug 1063 -PASS ERH_D.f10_f10.I1850CN.bluefire -PASS PET.f10_f10.I8520CN.bluefire.cpl -PASS PET.f10_f10.I8520CN.bluefire.atm -PASS PET.f10_f10.I8520CN.bluefire.lnd -PASS PET.f10_f10.I8520CN.bluefire.ice -PASS PET.f10_f10.I8520CN.bluefire.ocn -PASS PET.f10_f10.I8520CN.bluefire.glc - jaguar interactive testing: All PASS up to... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - dublin/lf95 interactive testing: None PASS because of bug 1092 - dublin/lf95: None PASS because of bug 1092 - dublin/INTEL interactive testing: ALL PASS except (and didn't compare to baseline) -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -028 smM94 TSMncl_tools.sh ndepregrid ............................................................FAIL! rc= 6 -030 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - dublin/INTEL: All PASS up to 021 smJ92 TSM.sh (and didn't compare to baseline) -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - -=============================================================== -=============================================================== -Tag name: clm3_6_64 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Jan 22 22:19:24 MST 2010 -One-line Summary: Update documentation and README/Quickstart files, set NetCDF large-file format on by default in template, update pio, update some fsurdat files to vocemis-drydep versions, add 2.5x3.33_gx3v7 frac file, make gx3v7 default for 4x5 res - -Purpose of changes: - -Setup makefiles for docbook UsersGuide to output both pdf and html formats. Work on documentation of new _esmf driver files. Work on documentation. Make sure documentation of clm xml variables is good. Add note about CASA NOT being supported. Work on README/Quickstart files, and move the files from the top level to clm doc directory, but leave a file at top level pointing to these files. Make large file support default, remove LND_CDF64. Add in VOC surfdata files from voc branch: T42, T31, T21, T5, 4x5, 10x15-pftdyn. Add in new 2x5x3.33_gx3v7 frac file. Make default mask for 4x5 gx3v7. - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Turn NetCDF large-file support on by default - -List any changes to the defaults for the boundary datasets: - - New fsurdat files for: T42, T31, T21, T5, 4x5 - New fpftdyn file for 10x15 for 1850-2000, new frac file for 2.5x3.33_gx3v7 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): pio - - pio updated to google version: http://parallelio.googlecode.com/svn/trunk_tags/pio1_0_7/pio - -List all files eliminated: - - D Quickstart.userdatasets --- Move to models/lnd/clm/doc - D Quickstart.GUIDE ---------- Move to models/lnd/clm/doc - D README.DGVM --------------- Move to models/lnd/clm/doc - D KnownBugs ----------------- Move to models/lnd/clm/doc - D models/lnd/clm/doc/docs.html ----------------- Remove in favor of DocBook documentation - D models/lnd/clm/doc/UsersGuide/clm_head.shtml - Remove in favor of DocBook documentation - D models/lnd/clm/doc/UsersGuide/tree.html ------ Remove in favor of DocBook documentation - D models/lnd/clm/doc/UsersGuide/clm_foot.shtml - Remove in favor of DocBook documentation - D models/lnd/clm/doc/UsersGuide/index.shtml ---- Remove in favor of DocBook documentation - -List all files added and what they do: - - A models/lnd/clm/doc/Quickstart.userdatasets - Move from top level - A models/lnd/clm/doc/IMPORTANT_NOTES --------- Add important notes about what's scientifically valided/expected to work - A models/lnd/clm/doc/Quickstart.GUIDE -------- Move from top level - A models/lnd/clm/doc/KnownBugs --------------- Move from top level - A models/lnd/clm/doc/UsersGuide/Makefile ----- Makefile to build Users-Guide - A models/lnd/clm/doc/index.shtml ------------- Add HTML guide to documentation - A models/lnd/clm/doc/CodeReference/Filepath -- Filepath to source-code to build Code Reference Guide - A models/lnd/clm/doc/CodeReference/Makefile -- Makefile to build Code Reference Guide using Protex - - A models/lnd/clm/test/system/Makefile -------- Makefile to build HTML test table - - A models/lnd/clm/test/system/config_files/_nrsc_do --- Add smp only option for no-RTM seq-ccsm default mode - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/clm.cpl7.template -------------------------- Set large_file_format to true by default - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- Add in vocemis-drydep branch fsurdat files for: T42, T31, T21, T5, - and 4x5 resolution (as well as 10x15 1850-2005 pftdyn file) - Add in 2.5x3.33_gx3v7 frac file, and make gx3v7 mask the default - for 4x5 resolution. - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml -- 2.5x3.33_gx3v7 domain file ->>>>>>>>>>>>> Update documentation and README text files - M models/lnd/clm/test/system/README - M models/lnd/clm/tools/mksurfdata/README - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ------------------ Make namelist documentation a little more clea - M models/lnd/clm/tools/ncl_scripts/convertUrbanOffline2Seq.ncl -- Document datm as datm8 - M models/lnd/clm/tools/ncl_scripts/README - M models/lnd/clm/tools/interpinic/README - M models/lnd/clm/tools/mkdatadomain/README - M models/lnd/clm/tools/README - M models/lnd/clm/bld/README - M models/lnd/clm/doc/UsersGuide/index.xml ---- Update docbook UsersGuide - M models/lnd/clm/doc/README - M README - - M models/lnd/clm/test/system/tests_pretag_bluefire ----------- Remove LD1 (2.65x3.33 res) tests - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - Remove LD1 tests - M models/lnd/clm/test/system/input_tests_master -------------- Remove LD1 tests - -Summary of testing: - - bluefire: All PASS except... -004 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 7 << 4x5 fsurdat -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 7 << 4x5 fsurdat -012 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 7 << 4x5 fsurdat -017 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 << 4x5 fsurdat -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -030 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 7 << 10x15 fpftdyn different -042 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 6 -043 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 5 - bluefire interactive testing: All PASS except... -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -032 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 << 4x5 fsurdat -040 blL83 TBL.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 5 << no _nrsc_do in previous -041 bl744 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 7 << script error -043 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 7 << script error -045 bl754 TBLtools.sh mksurfdata tools__s globalirrig ...........................................FAIL! rc= 3 << script error -050 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 3 - bluefire/CCSM testing: All PASS except... -BFAIL SMS_RLA.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<<<<<<<<<< 4x5 surfdata file different than previous version -BFAIL SMS_RLB.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<<<<<<<<<< 4x5 surfdata file different -BFAIL SMS_ROA.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<<<<<<<<<< 4x5 surfdata file different -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 <<<<<<<< 4x5 surfdata file different -FAIL ERS_D.f45_g37.I.bluefire.compare.clm3_6_58+datm8 <<<<<<<<<<<<< 4x5 surfdata file different -FAIL PET.f45_g37.I1850.bluefire.compare.clm3_6_58+datm8 <<<<<<<<<<< 4x5 surfdata file different -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire <<<<<<<<<<<<<<<<<<<<<<<<<<< Previous failure -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_6_64 <<<<<<<< Previous failure -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_6_58+datm8 <<< Previous failure -BFAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_6_58+datm8 <<<<<<< 10x15 pftdyn file different -BFAIL PET.f10_f10.I8520CN.bluefire.compare.clm3_6_58+datm8 <<<<<<<<< 10x15 pftdyn file different - -CLM tag used for the baseline comparison tests if applicable: clm3_6_63 - -Changes answers relative to baseline: Only for the following resolutions because of new fsurdat files: T42, T31, T5, 4x5 - and for dynamic PFT at 10x15 resolution because of a new pftdyn file - -=============================================================== -=============================================================== -Tag name: clm3_6_63 -Originator(s): erik (erik) -Date: Sat Jan 9 20:37:53 MST 2010 -One-line Summary: Get answers to be identical with ccsm4_0_beta38 for 1 and 2 degree transient cases - -Purpose of changes: - -Get answers to be identical to ccsm4_0_beta38 for both 1 and 2 degree transient cases. Update scripts to -very latest. Tweak test_suite for CN so that can run with finidat file, and can run interactive on dublin -by turning CCSM_BLD to off. - -Bugs fixed (include bugzilla ID): - 1098 (Use finidat weights instead of weights from fpftdyn file) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts - -List all files eliminated: None - -List all files added and what they do: - ->>>>>> Add configuration files for CN with default of numpft+1 maxpft -A models/lnd/clm/test/system/config_files/_cnnsc_h -A models/lnd/clm/test/system/config_files/_cnnsc_m -A models/lnd/clm/test/system/config_files/_cnnsc_o -A models/lnd/clm/test/system/config_files/_cnnsc_dh -A models/lnd/clm/test/system/config_files/_cnnsc_dm -A models/lnd/clm/test/system/config_files/_cnnsc_do -A models/lnd/clm/test/system/config_files/_cnnsc_ds - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>> Tweak test suite so can test for a CN transient case with a startup file, needed to find bug -M models/lnd/clm/test/system/test_driver.sh ------------ Turn CCSM_BLD to off for interactive use -M models/lnd/clm/test/system/input_tests_master -------- Tweak CN tests so can use finidat file ->>>>>>>>>>>>>>> Get answers to be identical with ccsm4_0_beta38 -M models/lnd/clm/src/main/clm_initializeMod.F90 -------- add extra call to pftdyn_interp after restart -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 -- Read weights directly into clm_type rather than - a temporary array. - -Summary of testing: - - bluefire: All PASS up to... -017 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............PASS - bluefire interactive testing: All PASS up to.. -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: -PASS ERH.f09_g16.B20TRCN.bluefire -BFAIL ERH.f09_g16.B20TRCN.bluefire.compare.ccsm4_0_beta38 --- compset names changed -- but cpl.log files compare exactly! -> ../Tools/check_exactrestart.pl cpl.log.100109-171753 $FISHOME/ccsm4_0_beta38/scripts/ERH.f09_g16.B20TRTR1CN.bluefire.G.172652/logs/cpl.log.100108-181015 -log files match! -PASS -PASS SMS_RLA.f45_f45.I.bluefire -BFAIL SMS_RLA.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<< f45_f45 NOT allowed in baseline -PASS SMS_RLB.f45_f45.I.bluefire -BFAIL SMS_RLB.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<< f45_f45 NOT allowed in baseline -PASS SMS_ROA.f45_f45.I.bluefire -BFAIL SMS_ROA.f45_f45.I.bluefire.compare.clm3_6_58+datm8 <<< f45_f45 NOT allowed in baseline -PASS ERS_D.f45_g37.I.bluefire -PASS ERS_D.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS_D.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS PET.f45_g37.I1850.bluefire.cpl -PASS PET.f45_g37.I1850.bluefire.atm -PASS PET.f45_g37.I1850.bluefire.lnd -PASS PET.f45_g37.I1850.bluefire.ice -PASS PET.f45_g37.I1850.bluefire.ocn -PASS PET.f45_g37.I1850.bluefire.glc -PASS PET.f45_g37.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire -PASS ERS.f19_g16.I1850.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERB.f09_g16.I_1948-2004.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_6_58+datm8 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire <<<<<<<<<<<<<<<<<<<<<<<<< Failed before bug 1063 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_6_58+datm8 -PASS ERH_D.f10_f10.I1850CN.bluefire -BFAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_6_58+datm8 <<< f10_f10 NOT allowed in baseline -PASS PET.f10_f10.I8520CN.bluefire.cpl -PASS PET.f10_f10.I8520CN.bluefire.atm -PASS PET.f10_f10.I8520CN.bluefire.lnd -PASS PET.f10_f10.I8520CN.bluefire.ice -PASS PET.f10_f10.I8520CN.bluefire.ocn -PASS PET.f10_f10.I8520CN.bluefire.glc -BFAIL PET.f10_f10.I8520CN.bluefire.compare.clm3_6_58+datm8 <<< f10_f10 NOT allowed in baseline - jaguar interactive testing: All PASS up to... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - dublin/lf95 interactive testing: None PASS because of bug 1092 - dublin/lf95: None PASS because of bug 1092 - dublin/INTEL interactive testing: ALL PASS except (and didn't compare to baseline) -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -028 smM94 TSMncl_tools.sh ndepregrid ............................................................FAIL! rc= 6 -030 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - dublin/INTEL: All PASS up to 021 smJ92 TSM.sh (and didn't compare to baseline) -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_58+datm8 - -Changes answers relative to baseline: No bit-for-bit -- really now! - -=============================================================== -=============================================================== -Tag name: clm3_6_62 -Originator(s): erik (erik) -Date: Fri Jan 8 04:50:59 MST 2010 -One-line Summary: Fix startup of PFT transient cases so properly use data from pftdyn file rather than finidat file - -Purpose of changes: - -Attempt to fix bug 1098 so that properly use the PFT weights interpolated from the fpftdyn file rather than using the -weights from the input finidat file. - -Bugs fixed (include bugzilla ID): Attempt to fix -- but only a partial fix, answers were still different - 1098 (Use finidat weights instead of weights from fpftdyn file) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts and mct - - scripts to scripts4_100107b - mct to MCT2_7_0_100106 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --- Fix bug with fpftdyn weights - M models/lnd/clm/test/system/test_driver.sh ------------- Fix name of ifort Macros file - -Summary of testing: - - bluefire: All PASS except, up to 045 erLD1 -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - bluefire interactive testing: All PASS up to.. -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: All PASS except CN spinup as below -PASS ERS.f09_g16.I8520CN.bluefire -PASS ERS.f09_g16.I8520CN.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS.f09_g16.I8520CN.bluefire.compare.clm3_6_58+datm8 -PASS SMS_RLA.f45_g37.I.bluefire -PASS SMS_RLA.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS SMS_RLA.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS SMS_RLB.f45_g37.I.bluefire -PASS SMS_RLB.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS SMS_RLB.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS SMS_ROA.f45_g37.I.bluefire -PASS SMS_ROA.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS SMS_ROA.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS ERS_D.f45_g37.I.bluefire -PASS ERS_D.f45_g37.I.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS_D.f45_g37.I.bluefire.compare.clm3_6_58+datm8 -PASS PET.f45_g37.I1850.bluefire.cpl -PASS PET.f45_g37.I1850.bluefire.atm -PASS PET.f45_g37.I1850.bluefire.lnd -PASS PET.f45_g37.I1850.bluefire.ice -PASS PET.f45_g37.I1850.bluefire.ocn -PASS PET.f45_g37.I1850.bluefire.glc -PASS PET.f45_g37.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire -PASS ERS.f19_g16.I1850.bluefire.compare_hist.clm3_6_58+datm8 -PASS ERS.f19_g16.I1850.bluefire.compare.clm3_6_58+datm8 -PASS ERB.f09_g16.I_1948-2004.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_6_58+datm8 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_6_58+datm8 -PASS ERH_D.f09_g16.I1850CN.bluefire -PASS ERH_D.f09_g16.I1850CN.bluefire.compare.clm3_6_58+datm8 -PASS PET.f19_g16.I8520CN.bluefire.cpl -PASS PET.f19_g16.I8520CN.bluefire.atm - jaguar: All PASS up to 021 smJ05 - jaguar interactive testing: All FAIL except... -001 smA74 TSM.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........PASS -002 erA74 TER.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -5+-5 arb_ic ........PASS -003 brA74 TBR.sh _nrsc_ds clm_std^nl_urb_br 20030101:NONE:1800 1x1_brazil navy -5+-5 arb_ic .....PASS -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........PASS -005 smAK4 TSM.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............PASS -008 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............PASS - dublin/lf95: None pass because of bug 1092 - dublin/pgi: All PASS except... -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -030 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 4 - dublin/ifort interactive: All PASS up to... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_58+datm8 (ccsm4_0_beta38) - -Changes answers relative to baseline: Identical without fpftdyn files - with and without finidat files. But, can be - different to roundoff or more for transient cases. - -=============================================================== -=============================================================== -Tag name: clm3_6_61 -Originator(s): erik (erik) -Date: Thu Jan 7 00:55:20 MST 2010 -One-line Summary: Comment out endrun on finidat and fsurdat weights being incomptable, and go back to using finidat weights - -Purpose of changes: - -Most of our finidat files have weights incompatible with our new fsurdat files. Hence, we went back to allowing -the weights to be different and to using the finidat weights so that answers would be the same as before. -Also hardwire the logfile for datm and clm so that can run testsuite on jaguar. Also add in cppdef required -for breeze. - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1098 (Use finidat weights instead of weights from fpftdyn file) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts - scripts to scripts4_100107 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/test_driver.sh -------------------- Add -cppdefs '-DFORTRANUNDERSCORE' for breeze. - M models/lnd/clm/bld/build-namelist ---------------------------- For standalone testing hardwire clm and - datm output log files - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Add comment remove logfile - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 ---------- Put implicit none in right place, comment - out abort if weights too different, and use finidat weights instead of fsurdat weights. Hence - this version is identical to clm3_6_58, other than the use of datm8 (which is roundoff different). - -Summary of testing: - - bluefire: -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 4 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 4 -053 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - bluefire/CCSM testing: -PEND SMS_RLA.f45_f45.I.bluefire.200614 -PEND SMS_RLB.f45_f45.I.bluefire.200614 -PASS SMS_ROA.f45_f45.I.bluefire -PASS ERS_D.f45_g37.I.bluefire -PASS PET.f45_g37.I1850.bluefire.cpl -PASS PET.f45_g37.I1850.bluefire.atm -PASS PET.f45_g37.I1850.bluefire.lnd -PASS PET.f45_g37.I1850.bluefire.ice -PASS PET.f45_g37.I1850.bluefire.ocn -PASS PET.f45_g37.I1850.bluefire.glc -PASS ERS.f19_g16.I1850.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -PASS ERH_D.f10_f10.I1850CN.bluefire -PASS PET.f10_f10.I8520CN.bluefire.cpl -PASS PET.f10_f10.I8520CN.bluefire.atm -PASS PET.f10_f10.I8520CN.bluefire.lnd -PASS PET.f10_f10.I8520CN.bluefire.ice -PASS PET.f10_f10.I8520CN.bluefire.ocn -PASS PET.f10_f10.I8520CN.bluefire.glc - jaguar interactive testing: -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 5 -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -008 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............FAIL! rc= 5 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -013 smJ74 TSM.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic FAIL! rc= 8 -014 erJ74 TER.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic FAIL! rc= 5 -015 brJ74 TBR.sh 4p_nrcasasc_ds clm_std^nl_urb_br 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_icFAIL! rc= 5 -016 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic FAIL! rc= 4 - dublin/lf95: All Fail due to bug 1092 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_58 (but with datm8 rather than datm7) - -Changes answers relative to baseline: No bit-for-bit except for transient cases which are different - -=============================================================== -=============================================================== -Tag name: clm3_6_60 -Originator(s): erik (erik) -Date: Tue Jan 5 23:59:43 MST 2010 -One-line Summary: Fix clm template - -Purpose of changes: - -Fix the broken clm template. Update externals for very latest scripts tag. - -Bugs fixed (include bugzilla ID): Fix clm template which was broken - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): Update scripts - - scripts to scripts4_100105b - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/test_driver.sh -- update bl to ccsm4_0_beta38 -M models/lnd/clm/bld/clm.cpl7.template ------- fix so can work - -Summary of testing: - - bluefire/CCSM testing: -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLB.f45_f45.I.bluefire -PASS SMS_ROA.f45_f45.I.bluefire -FAIL ERS.f19_g16.I_1850.bluefire -FAIL ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948-2004.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -PASS ERH_D.f10_f10.I_1850_CN.bluefire -PASS PET.f10_f10.I8520CN.bluefire.cpl -PASS PET.f10_f10.I8520CN.bluefire.atm -PASS PET.f10_f10.I8520CN.bluefire.lnd - -CLM tag used for the baseline comparison tests if applicable: clm3_6_59 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_6_59 -Originator(s): erik (erik) -Date: Tue Jan 5 17:44:48 MST 2010 -One-line Summary: Update to datm8, fix so wts used are from fsurdat file NOT finidat file - -Purpose of changes: - -Changes needed for beta34 ESMF upgrade. Use new datm8 model which is more flexible and -has new options as well as parallel IO. Add in 4x5_gx3v7 frac file. Remove use for -ESMF_mod. Abort if finidat weights are significantly different from surfdata file -weights. Change name of driver and initializeMod to have a clm_ prefix. Convert UG -outline from html to DocBook. Make changes to code documentation for high level -subroutines. Remove documentation of namelist items in controlMod and have it point -to the documentation in the xml namelist file. Fix "called from" in code documentation -and remove a lot of the concurrent directives. New files from Tony for esmf interface. -Alpha release testing will start with this version. - -Bugs fixed (include bugzilla ID): - 1084 (don't use only for ESMF_Mod) - 1087 (let weights come from fsurdat file NOT finidat) - 1088 (change name of driver module) - 1093 (namelist tweaks) -- partial - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - Let CCSM build determine FORTRAN mangle definitions - Directory structure changes slightly with new ESMF interfaces and new datm8 - -Describe any changes made to the namelist: - Make default for hist_crtinic NONE so clm.i files are NOT made by default. - Change names of options to build-namelist that only are for clm stand-alone testing. - Add a drv_ or datm_ prefix, and separate how these options are displayed in the help - Also add an option to several commands for "list" so that you can list the variables - for clm_demand, for resolution, and for use-cases. - Also update build-namelist to work with the new datm8 - -List any changes to the defaults for the boundary datasets: Add in 4x5_gx3v7 dataset - -Describe any substantial timing or memory changes: datm8 is approx. 30% faster - datm8 also allows you to enable parallel I/O - -Code reviewed by: self, oleson, slevis, dlawren review of weights change - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm, csm_share, drv, pio - -+scripts to scripts4_100103b -+drv to vocemis-drydep12_drvseq3_1_11 -+datm to datm8_091218 -+csm_share to vocemis-drydep13_share3_091217 -+pio to pio60_prod - -List all files eliminated: - - D models/lnd/clm/test/system/config_files/_mexsc_ds --- Rename with nr in name - D models/lnd/clm/test/system/config_files/_vansc_ds --- Rename with nr in name - D models/lnd/clm/src/main/driver.F90 ------------------ Rename with clm_ prefix - D models/lnd/clm/src/main/initializeMod.F90 ----------- Rename with clm_ prefix - D models/lnd/clm/src/biogeophys/DriverInitMod.F90 ----- Rename to clm_driverInitMod - -List all files added and what they do: - - A models/lnd/clm/doc/UsersGuide/index.xml ---------------- Users Guide Outline in docbook format ->>>>>>>>>>> Version with "nr" so that RTM is turned off for non-global tests - A models/lnd/clm/test/system/config_files/_nrsc_s - A models/lnd/clm/test/system/config_files/17p_nrsc_ds - A models/lnd/clm/test/system/config_files/4p_nrcasasc_ds - A models/lnd/clm/test/system/config_files/_nrsc_ds - A models/lnd/clm/test/system/config_files/_nrmexsc_ds - A models/lnd/clm/test/system/config_files/_nrvansc_ds - A models/lnd/clm/test/system/config_files/17p_nrcnnsc_ds ->>>>>>>>>>> New files from Tony for ESMF interfaces - A models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - A models/lnd/clm/src/main/cpl_esmf/lnd_comp_mct.F90 - - A models/lnd/clm/src/main/clm_initializeMod.F90 ---------- Rename with clm_ prefix - Also change so that dyn pft is always called before reading in the restart - file. - A models/lnd/clm/src/main/clm_driver.F90 ----------------- Rename with clm_ prefix - A models/lnd/clm/src/biogeophys/clm_driverInitMod.F90 ---- Rename from driverInitMod - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/config_files/README -- Note about nr means no-RTM - M models/lnd/clm/test/system/test_driver.sh ------- Some tweaks for dublin/intrepid - M models/lnd/clm/test/system/mknamelist ----------- Changes for datm namelists, and - change for new options names for - build-namelist - M models/lnd/clm/test/system/nl_files/clm_per ----- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_std ----- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_ndepdyn - Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_pftdyn -- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_per0 ---- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_spin ---- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/nl_files/clm_urb1pt -- Change case and source to - drv_case and datm_source - M models/lnd/clm/test/system/input_tests_master --- Use nr in test names - M models/lnd/clm/test/system/CLM_runcmnd.sh ------- Change name for laptop - M models/lnd/clm/test/system/TSM.sh --------------- Change datm restart files - - M models/lnd/clm/bld/clm.cpl7.template ------------ Change template to not put RTM - time-step in when rtm is off - M models/lnd/clm/bld/configure -------------------- Change to new datm dir structure - M models/lnd/clm/bld/listDefaultNamelist.pl ------- Change name of datm namelist - M models/lnd/clm/bld/build-namelist --------------- New list options, update for - new datm8 namelist. - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Document pio options - new datm8 namelist items, CASA nameist items, and fget_archdev - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- New 4x5_gx3v7 frac file - set default of hist_crtinic to NONE - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - New datm8 defaults - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl ---- Add section for - CASA nl items, and a commented out section for the pio items - - M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 ---- Fix called from, rm concurrnt directives - M models/lnd/clm/src/biogeochem/CASAPhenologyMod.F90 ------ Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNGapMortalityMod.F90 ----- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 -- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/DGVMEcosystemDynMod.F90 --- Fix called from - M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 ----- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CASAMod.F90 --------------- Doc routine as private, fix called from, rm con dirct. - M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 - Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 ---------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 -- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/DGVMMod.F90 --------------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 -- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 ----- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/C13SummaryMod.F90 --------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 -------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNC13FluxMod.F90 ---------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 --------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 -- Fix called from, rm con dirt. - - M models/lnd/clm/src/main/clm_comp.F90 ------------- Add clm_ prefix to calls - M models/lnd/clm/src/main/pftdynMod.F90 ------------ Fix called from, rm con dirt. - M models/lnd/clm/src/main/histFileMod.F90 ---------- Add more documentation, rm con direct. - M models/lnd/clm/src/main/clm_atmlnd.F90 ----------- Change documentation of units for nee - M models/lnd/clm/src/main/restFileMod.F90 ---------- Change called from documentation - M models/lnd/clm/src/main/controlMod.F90 ----------- Remove namelist items documentation - point to xml files for documenation - Work with code documentation - Get rid of notes about aerdep - files going away - M models/lnd/clm/src/main/clm_time_manager.F90 ----- Fix called from doc - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - Add documentation - M models/lnd/clm/src/main/domainMod.F90 ------------ Clarify which driver in doc - M models/lnd/clm/src/main/clmtype.F90 -------------- Work on code documentation - M models/lnd/clm/src/main/histFldsMod.F90 ---------- Work on code documentation and formatting - - M models/lnd/clm/src/riverroute/RtmMod.F90 - Fix called from - - M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ------ Remove KO and fix called from in code doc, rm con dirct. - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 ---- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 ----- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 -------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 - Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------------- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 ----- Fix called from, rm con dirt. - M models/lnd/clm/src/biogeophys/SNICARMod.F90 ------------ Fix called from. - - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 - Check that weights when read - in agree reasonably closely with fsurdat weights - -Summary of testing: - - bluefire: -004 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 7 -012 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 7 -017 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 -021 blEH1 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 7 -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -028 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -3+-7 arb_ic .......FAIL! rc= 13 -029 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -5+-5 arb_ic .......FAIL! rc= 11 -030 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 7 -034 blC61 TBL.sh _sc_dh clm_std^nl_urb 20021001:NONE:1800 1.9x2.5 gx1v6 48 cold .................FAIL! rc= 7 -038 blH52 TBL.sh 17p_cnnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold .........FAIL! rc= 7 -043 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 7 -049 blJ61 TBL.sh 4p_casasc_dh clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 7 -050 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v6 48 arb_ic .....FAIL! rc= 10 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 4 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 3 -053 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 3 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 3 - bluefire interactive testing: -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 5 -009 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 5 -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -017 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic FAIL! rc= 5 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -023 blAK4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............FAIL! rc= 7 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -028 blL78 TBL.sh _nrsc_s clm_std^nl_urb 20021231:NONE:1800 1x1_brazil navy -10 arb_ic ...........FAIL! rc= 5 -032 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 7 -033 smL83 TSM.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 4 -034 erL83 TER.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -5+-5 arb_ic ........FAIL! rc= 5 -035 brL83 TBR.sh _nrsc_do clm_std^nl_urb_br 20020115:NONE:3600 5x5_amazon navy -10+-10 arb_ic ...FAIL! rc= 5 -036 blL83 TBL.sh _nrsc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ..........FAIL! rc= 4 -041 bl744 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 7 -043 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 7 -045 bl754 TBLtools.sh mksurfdata tools__s globalirrig ...........................................FAIL! rc= 6 -050 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - dublin/lf95: No testing as all tests fail due to bug 1092 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_58 - -Changes answers relative to baseline: datm8 causes answers to be roundoff different - Change to use of fsurdat instead of finidat weights means answers may change - for non-coldstart cases. - -=============================================================== -=============================================================== -Tag name: clm3_6_58 -Originator(s): erik (erik) -Date: Tue Dec 8 12:56:47 MST 2009 -One-line Summary: Fix rpointer, correct units for export of nee, start adding testing for intrepid - -Purpose of changes: - Only update the rpointer file when restart files are written NOT when clm.i initial - files are written. This was causing problems to restart the model when it was - aborting before it completed it's period to run for. - Correct the units for the export of NEE from kg C to kg CO2 (kgCO2/m2/s) - Remove some concurent directives in the code and the unicosmp target_os in - configure as we no longer have Phoenix. - Add bgp target_os to configure, only set Fortran mangling if NOT using the - CCSM build in configure. - Add CN atm spinup data source as option to configure and to test_driver.sh. - Update version of external to test with to ccsm4_0_beta35 - Add ability to test on intrepid to test_driver.sh. - -Bugs fixed (include bugzilla ID): - 1079 (rpointer file updated with clm.i files) - 1082 (Add bgp, don't do Fortran mangling for CCSM build) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - -Known bugs (include bugzilla ID): 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1070 (pftdyn datasets bad for f19, 2.5x3.33) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Have configure write out unresolved filepaths - when called from cpl7.template - -Describe any changes made to the namelist: drv namelist updated - -List any changes to the defaults for the boundary datasets: - Add 2.5x3.33 resolution - Remove 2x2.5 res files - New f09, f19 finidat files - New f09, f19, f10, 1x1_tropicAtl fsurdat/fpftdyn files (only f19 change answers) - New f05, 5x5_amazon, 1x1_brazil 2000 fsurdat file (b4b) - New f03, f09, f19, f03, f10 ndepdyn files (changes 1851-1924, 1996-2004) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): to ccsm4_0_beta33 versions - - scripts to scripts4_091027b - drv to vocemis-drydep12_drvseq3_0_37 - datm7 to datm7_090928 - socn/sice/sglc to stubs1_2_02 - csm_share to share3_091013 - timing to timing_090929 - mct to MCT2_6_0_090926 - pio to pio57_prod - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M Quickstart.userdatasets --- Update notes about setting user-defined datasets ->>>>>>>>>>>>>>> Update jaguar, kraken, and bluefire env vars to latest scripts ->>>>>>>>>>>>>>> Remove blAK8 test as ocean-only and no clm files to compare - M models/lnd/clm/test/system/README.testnames ---------------- Add 2.5x3.33 test resolution - M models/lnd/clm/test/system/tests_driver.sh ----------------- Update env vars - to whats in scripts4_091015 for jaguar, kraken and bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi ----- Rm blAK8 - M models/lnd/clm/test/system/input_tests_master -------------- Rm blAK8, add 1x1_tropicAtl@1850,1850-2000, and 2.5x3.33 tests - M models/lnd/clm/test/system/tests_posttag_nompi_regression -- Rm blAK8 - ->>>>>>>>>>>>>>> Allow configure to write out unresolved Filepath, make TopCCSMBld ->>>>>>>>>>>>>>> Makefile closer to CPL7 version - M models/lnd/clm/bld/configure -------------------------- Add clm_root option - add ability to set comp_intf to cpl_$COMP, allow ability to check for - directories existance resolving env vars that are set. Create a subroutine - is_valid_directory to check for directories instead of "-d". - M models/lnd/clm/bld/config_files/config_definition.xml - Allow cpl_$COMP rm lapacklibdir - M models/lnd/clm/bld/clm.cpl7.template -- Set COMP based on COMP_INTERFACE, - add clm_root to configure, don't resolve CODEROOT and CASEROOT on output - M models/lnd/clm/bld/config_files/TopCCSMBldMakefile.in - Changes to make closer to scripts4_091015 version. ->>>>>>>>>>>>>>> Change drv namelist names, - M models/lnd/clm/bld/build-namelist ----- Change drv namelist names: cpl_io_numtasks/cpl_io_typename ->>>>>>>>>>>>>>> Change drv namelist names, add 2.5x3.33 resolution ->>>>>>>>>>>>>>> Remove 2x2.5 res files ->>>>>>>>>>>>>>> New f09, f19 finidat files ->>>>>>>>>>>>>>> New f09, f19, f10, 1x1_tropicAtl fsurdat/fpftdyn files (only f19 change answers) ->>>>>>>>>>>>>>> New f05, 5x5_amazon, 1x1_brazil 2000 fsurdat file (b4b) ->>>>>>>>>>>>>>> New f03, f09, f19, f03, f10 ndepdyn files (changes 1851-1924, 1996-2004) - M models/lnd/clm/bld/namelist_files/namelist_definition.xml -----Change drv namelist - names: cpl_io_numtasks/cpl_io_typename, add 2.5x3.33 resolution - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml -- Add 2.5x3.33 res domainfile - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- New f19, f09 finidat files - new f09, f19, f10 fsurdat/fpftdyn files - new 2.5x3.33: fatmgrid, flndtopo, fatmtopo, fatmlndfrc, faerdep, fndepdat files - new f05, 5x5_amazon, 1x1_brazil 2000 fsurdat files - new f03, f09, f19, f03, f10 ndepdyn files - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml --- Change drv namelist - names: cpl_io_numtasks/cpl_io_typename - - M models/lnd/clm/src/main/histFldsMod.F90 -- GC_HEAT2, GC_LIQ2, GC_ICE2 NOT on by default ->>>>>>>>>>>>>>> Remove dips in 20th Century transient Nitrogen deposition ->>>>>>>>>>>>>>> for 1855 and 2000. - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl --- Remove 1855-1915 and 2000 - from list of input files. The 1850 dataset had too high of CO2 and hence - to high Nitrogen deposition, which gives a unrealistic dip near the - beginning. - ->>>>>>>>>>>>>>> Documentation changes of ProTex comments to fit the ProTex standard -M tools/mksurfdata/mkglcmec.F90 -M tools/mksurfdata/mkfmax.F90 -M tools/mksurfdata/ncdio.F90 -M tools/mksurfdata/mklaiMod.F90 -M tools/mksurfdata/mkglacier.F90 -M tools/mksurfdata/mkharvestMod.F90 -M tools/mksurfdata/creategridMod.F90 -M tools/mksurfdata/mkorganic.F90 -M tools/mksurfdata/mklanwat.F90 -M tools/mksurfdata/mksoicol.F90 -M tools/mksurfdata/mkrank.F90 -M tools/mksurfdata/mkelev.F90 -M tools/mksurfdata/mkurban.F90 -M tools/mksurfdata/mkurbanparMod.F90 -M tools/mksurfdata/mksoitex.F90 -M tools/mksurfdata/mkirrig.F90 -M tools/mksurfdata/domainMod.F90 -M tools/mksurfdata/areaMod.F90 -M tools/mksurfdata/mksrfdat.F90 -M tools/mksurfdata/mkpftMod.F90 -M tools/mkgriddata/mkgriddata.F90 -M tools/mkgriddata/creategridMod.F90 -M tools/mkdatadomain/create_domain.F90 -M src/biogeochem/DGVMLightMod.F90 -M src/biogeochem/DGVMReproductionMod.F90 -M src/biogeochem/DGVMAllocationMod.F90 -M src/biogeochem/DGVMEcosystemDynMod.F90 -M src/biogeochem/CASAMod.F90 -M src/biogeochem/DGVMKillMod.F90 -M src/biogeochem/DUSTMod.F90 -M src/biogeochem/DGVMEstablishmentMod.F90 -M src/biogeochem/STATICEcosysDynMod.F90 -M src/biogeochem/DGVMRestMod.F90 -M src/biogeochem/DGVMMod.F90 -M src/biogeochem/CNrestMod.F90 -M src/biogeochem/VOCEmissionMod.F90 -M src/biogeochem/DGVMMortalityMod.F90 -M src/biogeochem/DGVMTurnoverMod.F90 -M src/biogeochem/DGVMFireMod.F90 -M src/biogeochem/CNEcosystemDynMod.F90 -M src/main/inicFileMod.F90 -M src/main/organicFileMod.F90 -M src/main/spmdGathScatMod.F90 -M src/main/clm_varpar.F90 -M src/main/CNiniTimeVar.F90 -M src/main/dynlandMod.F90 -M src/main/accumulMod.F90 -M src/main/clm_comp.F90 -M src/main/driver.F90 -M src/main/decompInitMod.F90 -M src/main/ncdio.F90 -M src/main/getdatetime.F90 -M src/main/subgridRestMod.F90 -M src/main/accFldsMod.F90 -M src/main/subgridMod.F90 -M src/main/fileutils.F90 -M src/main/aerdepMod.F90 -M src/main/initializeMod.F90 -M src/main/pftdynMod.F90 -M src/main/iniTimeConst.F90 -M src/main/histFileMod.F90 -M src/main/pft2colMod.F90 -M src/main/clm_atmlnd.F90 -M src/main/restFileMod.F90 -M src/main/controlMod.F90 -M src/main/initSurfAlbMod.F90 -M src/main/clm_time_manager.F90 -M src/main/cpl_mct/lnd_comp_mct.F90 -M src/main/ndepFileMod.F90 -M src/main/subgridAveMod.F90 -M src/main/initGridCellsMod.F90 -M src/main/CASAiniTimeVarMod.F90 -M src/main/CNiniSpecial.F90 -M src/main/pftvarcon.F90 -M src/main/snowdp2lev.F90 -M src/main/spmdMod.F90 -M src/main/surfrdMod.F90 -M src/main/domainMod.F90 -M src/main/decompMod.F90 -M src/main/areaMod.F90 -M src/main/iobinary.F90 -M src/main/do_close_dispose.F90 -M src/main/mkarbinitMod.F90 -M src/riverroute/RtmMod.F90 -M src/riverroute/RunoffMod.F90 -M src/biogeophys/BalanceCheckMod.F90 -M src/biogeophys/SurfaceRadiationMod.F90 -M src/biogeophys/SoilTemperatureMod.F90 -M src/biogeophys/SnowHydrologyMod.F90 -M src/biogeophys/UrbanInputMod.F90 -M src/biogeophys/Biogeophysics1Mod.F90 -M src/biogeophys/Biogeophysics2Mod.F90 -M src/biogeophys/FracWetMod.F90 -M src/biogeophys/UrbanInitMod.F90 -M src/biogeophys/FrictionVelocityMod.F90 -M src/biogeophys/TridiagonalMod.F90 -M src/biogeophys/SurfaceAlbedoMod.F90 -M src/biogeophys/Hydrology1Mod.F90 -M src/biogeophys/Hydrology2Mod.F90 -M src/biogeophys/BiogeophysicsLakeMod.F90 -M src/biogeophys/BiogeophysRestMod.F90 -M src/biogeophys/SoilHydrologyMod.F90 -M src/biogeophys/UrbanMod.F90 -M src/biogeophys/QSatMod.F90 -M src/biogeophys/HydrologyLakeMod.F90 -M src/biogeophys/SNICARMod.F90 -M src/biogeophys/DriverInitMod.F90 -M src/biogeophys/BareGroundFluxesMod.F90 -M src/biogeophys/CanopyFluxesMod.F90 - -Summary of testing: - - bluefire: -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 -arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 -arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic -.........FAIL! rc= 10 -031 smC61 TSM.sh _sc_dh clm_std^nl_urb 20021001:NONE:1800 1.9x2.5 gx1v6 -6 cold -.................FAIL! rc= 10 -032 erC61 TER.sh _sc_dh clm_std^nl_urb 20021001:NONE:1800 1.9x2.5 gx1v6 10+38 cold -..............FAIL! rc= 5 -033 brC61 TBR.sh _sc_dh clm_std^nl_urb_br 20021001:NONE:1800 1.9x2.5 gx1v6 -3+-3 cold -...........FAIL! rc= 5 -034 blC61 TBL.sh _sc_dh clm_std^nl_urb 20021001:NONE:1800 1.9x2.5 gx1v6 48 cold -.................FAIL! rc= 4 -035 smH52 TSM.sh 17p_cnnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 96 cold -.........FAIL! rc= 8 -036 erH52 TER.sh 17p_cnnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 -cold ......FAIL! rc= 5 -037 brH52 TBR.sh 17p_cnnsc_dm clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@2000 72+72 -cold ...FAIL! rc= 5 -038 blH52 TBL.sh 17p_cnnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold -.........FAIL! rc= 4 -039 smI59 TSMcnspinup.sh 17p_cnadspinupsc_dm 17p_cnexitspinupsc_dm 17p_cnsc_dm clm_std -20020115:NONEFAIL! rc= 5 -040 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic -........................FAIL! rc= 10 -041 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic -......................FAIL! rc= 5 - bluefire interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic........FAIL! rc= 10 - bluefire/CCSM testing: -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLB.f45_f45.I.bluefire -PASS SMS_ROA.f45_f45.I.bluefire -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -FAIL ERS.f19_g16.I_1850-2000.bluefire <-- script fails, but cpl log same -PASS ERB.f09_g16.I_1948_2004.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire <-- recv lnd Sl_t different -PASS ERH_D.f10_f10.I_1850_CN.bluefire -PASS PET.f10_f10.ICN8520.bluefire.cpl -PASS PET.f10_f10.ICN8520.bluefire.atm -PASS PET.f10_f10.ICN8520.bluefire.lnd -PASS PET.f10_f10.ICN8520.bluefire.ice -PASS PET.f10_f10.ICN8520.bluefire.ocn -PASS PET.f10_f10.ICN8520.bluefire.glc - jaguar: All PASS - jaguar interactive testing: All PASS except -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -013 smJ74 TSM.sh 4p_casasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic .FAIL! rc= 8 -014 erJ74 TER.sh 4p_casasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic FAIL! rc= 5 -015 brJ74 TBR.sh 4p_casasc_ds clm_std^nl_urb_br 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic FAIL! rc= 5 - dublin/lf95 interactive testing: -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -026 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -027 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -030 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - dublin/lf95: -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -030 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 8 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to.. -019 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 48 cold ......FAIL! rc= 7 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_53 - -Changes answers relative to baseline: Only f19 due to new fsurdat file (off by roundoff) - and startup for f09 and f19 with CN change due - to new finidat files. 20th Century simulations - with CN change because the ndep data set is different - from 1851-1924, and 2001-2004. - -=============================================================== -=============================================================== -Tag name: clm3_6_53 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Tue Sep 22 16:15:39 MDT 2009 -One-line Summary: Fix so that T31_gx3v7 file is actually included - -Purpose of changes: - -Add new optics file from Mark Flanner. Fix so T31_gx3v7 file included. Change testing -for 48x96 to gx3v7. Update datm so that pt1_pt1 res works. Fix clm template so -that RTM is turned off for pt1_pt1 resolution. - -Bugs fixed (include bugzilla ID): - 1042 (Bug with domain directory name in datm for pt1_pt1 resolution) - 789 -- change so that RTM is off should make single-point mode faster - -Known bugs (include bugzilla ID): 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: In template turn off RTM if grid=pt1 - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Add in T31_gx3v7 frac file, update snicar optics file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): datm7 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M Quickstart.userdatasets -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/bld/clm.cpl7.template -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - -Summary of testing: Limited - - bluefire: - bluefire interactive testing: - bluefire/CCSM testing: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_53 - -Changes answers relative to baseline: None -- bit for bit - -=============================================================== -=============================================================== -Tag name: clm3_6_52 -Originator(s): erik (erik) -Date: Thu Sep 17 11:07:19 MDT 2009 -One-line Summary: Add T31_gx3v7 support, remove forganic, read from fsurdat, add script to extract regional datasets, work with CN output, add more urban/rural fields - -Purpose of changes: - - Add T31_gx3v7 files needed. Read organic fields from fsurdat file, remove forganic file. - Add in script to extract regional datasets. Change CN output fields list, add NBP (Net - Biome Production field). New Urban/Rural fields from Keith. Update bluefire compiler - to XLF12 (causes some restart issues listed below). - - This tag includes new scripts to extract regional datasets from the global datasets - in order to run for a specific region of interest. The scripts are available in the - models/lnd/clm/tools/ncl_scripts directory, the main script is the - getregional_datasets.pl perl script and it has a command line interface and help with - the "-help" option. There's also a README file in the directory containing the scripts, - and more information in the Quickstart.userdatasets file at the top level. - - Quickstart to use of regional extraction scripts: - - # Run the script to create an area to put your files (assume CSMDATA set to standard inputdata) - cd scripts - setenv MYCSMDATA $HOME/myinputdata - link_dirtree $CSMDATA $MYCSMDATA - - # Run the extraction for data from 52-73 North latitude, 190-220 longitude - # that creates 13x12 gridcell region from the f19 (1.9x2.5) global resolution over - # Alaska - cd ../models/lnd/clm/tools/ncl_scripts - setenv MYID 13x12pt_f19_alaskaUSA - getregional_datasets.pl -sw 52,190 -ne 73,220 -id $MYID -mycsmdata $MYCSMDATA - - # Now create a case that uses these datasets - cd ../../../../../scripts - create_newcase -case testregional -compset I -mach bluefire -res pt1_pt1 -skip_rundb - cd testregional - $EDITOR env_conf.xml # change CLM_BLDNML_OPTS to include "-clm_usr_name $MYID" (expand $MYID) - $EDITOR env_mach_pes.xml # Change tasks/threads as appropriate (defaults to serial) - xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA - $EDITOR Tool/Templates/datm.cpl7.template.csh # Add the following line before the check on DOMAINFILE (expand $MYID) - -if ( $DOMAINFILE == "unset" ) set DOMAINFILE = "domain.lnd.$MYID.nc" - - # Do other changes to xml files as appropriate - # configure as normal, then edit the datm namelist - - configure -case - - # Then build and run the case as normal - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1042 (Bug with domain directory name in datm for pt1_pt1 resolution) - 1063 (Problem in restarts for CCSM spinup data) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Filepath, bluefire compiler to XLF12 - - Filepath for stub-components changes - In scripts and in test_driver.sh update compiler for bluefire to XLF12 - (this causes the restart issue for certain cases below). - -Describe any changes made to the namelist: Remove forganic (read organic from fsurdat file) - -List any changes to the defaults for the boundary datasets: Add 48x96_gx3v7 fracdata - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, oleson(urban/rural), slevis (CN fields, new NBP field) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm7, stub-comps, csm_share - - scripts to scripts4_090916 - drv to vocemis-drydep12_drvseq3_0_29 - datm7 to datm7_090915 - socn/sice/sglc to stubs1_2_01 - csm_share to share3_090902 - -List all files eliminated: Remove noOrganicSoilDataset use case - - Remove the use case that removed the requirement for the forganic dataset. - - D models/lnd/clm/bld/namelist_files/use_cases/noOrganicSoilDataset.xml - -List all files added and what they do: - - Add stylesheet for namelist defaults files. - - A models/lnd/clm/bld/namelist_files/namelist_defaults.xsl - - Scripts to extract regions of interest from global grids and put them into the place - expected by build-namelist with the clm_usr_name option. - - A models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl --- Main script to extract regional datasets. - This one has a command line interface. - A models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl -- Support script to do the actual work. - This one works based on settings of a bunch of environment variables. - -List all existing files that have been modified, and describe the changes: - - M Quickstart.userdatasets - Add notes about using getregional_datasets.pl - M Quickstart.GUIDE -------- Fix typo - - M models/lnd/clm/test/system/test_driver.sh ---- Update seqccsm version to beta26 - Also update bluefire to XLF12. - - M models/lnd/clm/tools/ncl_scripts/README ----- Add note about new getregional_datasets scripts - ->>>>>>>>>>>>>>> Get configure working with new scripts/stub-components - M models/lnd/clm/bld/configure ------- Change Filepath for stub components, remove - write_filepath_ccsm use ccsmbld version - ->>>>>>>>>>>>>>> Remove forganic, add T31_gx3v7, have query NOT return user filenames ->>>>>>>>>>>>>>> for transient files when sim_year_range=constant. ->>>>>>>>>>>>>>> Add style sheets for namelist_defaults files. - M models/lnd/clm/bld/queryDefaultXML.pm -- Skip filenames set to "null" - M models/lnd/clm/bld/build-namelist ------ Remove forganic - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------------ Remove forganic, - add gx3v7 - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml ------ Remove forganic, - add stylesheet. - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml --------- Add T31_gx3v7 - domainfile, add stylesheet. - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ---------- Add stylesheet. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ---------- Make - gx3v7 default for T31, remove reference to forganic, add stylesheet. - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml ---- Set transient - files to null for sim_year_range=constant, add stylesheet. - ->>>>>>>>>>>>>>> Add NBP, change which CN fields active/inactive, add new Urban/Rural ->>>>>>>>>>>>>>> fields, remove forganic read organic soil from fsurdat - M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 --------- Add nbp, update doc for nee, nep, - work with formatting - M models/lnd/clm/src/biogeochem/C13SummaryMod.F90 -------- Add nbp, update doc for nee, nep, - work with formatting - M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 -------- Set nbp and work with formatting - M models/lnd/clm/src/main/organicFileMod.F90 ------------- Remove forganic use fsurdat - M models/lnd/clm/src/main/clmtypeInitMod.F90 ------------- New urban/rural fields and nbp, - work with formatting - M models/lnd/clm/src/main/controlMod.F90 ----------------- Remove forganic - M models/lnd/clm/src/main/clm_varctl.F90 ----------------- Remove forganic - M models/lnd/clm/src/main/clmtype.F90 -------------------- Add urban/rural (oleson) and nbp, - and update doc on nep, nee - M models/lnd/clm/src/main/histFldsMod.F90 ---------------- Add urban/rural fields (oleson), - Change which CN fields on/off, add NBP - M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 -- Add urban/rural (oleson) - M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 --- Add urban/rural (oleson) - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 ---- Add urban/rural (oleson) - M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 ---- Add urban/rural (oleson) - M models/lnd/clm/src/biogeophys/UrbanInitMod.F90 --------- Add urban/rural (oleson) - M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------------- Add urban/rural (oleson) - -Summary of testing: - - bluefire: All PASS except... -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - bluefire interactive testing: All PASS up to... -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: All PASS except for branch tests that fail due to XLF12 -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -FAIL ERB.f09_g16.I_1948_2004.bluefire <<<< FAIL's due to compiler upgrade to XLF12 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire <<<< FAIL's due to compiler upgrade to XLF12 ->>>>>>>>>>>>> NOTE This same problem exists in clm3_6_51 if you update the compiler to ->>>>>>>>>>>>> XLF12. -PASS ERH_D.f10_f10.I_1850_CN.bluefire -PASS PET.f10_f10.ICN8520.bluefire.cpl -PASS PET.f10_f10.ICN8520.bluefire.atm -PASS PET.f10_f10.ICN8520.bluefire.lnd -PASS PET.f10_f10.ICN8520.bluefire.ice -PASS PET.f10_f10.ICN8520.bluefire.ocn -PASS PET.f10_f10.ICN8520.bluefire.glc - jaguar: All PASS - jaguar interactive testing: All PASS up to... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - dublin/lf95 interactive testing: All PASS up to... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 - dublin/lf95: All PASS except (up to...) -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... - change path for cprnc on jaguar -M models/lnd/clm/test/system/input_tests_master -------------- single-column tests are cold-starts -M models/lnd/clm/test/system/tests_pretag_dublin_nompi ------- Add single-column tests -M models/lnd/clm/test/system/tests_posttag_nompi_regression -- Add single-column tests -M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl ---------- Remove assumption about order of dimensions -M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl ------------ Remove assumption about order of dimensions -M models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl -------- Remove assumption about order of dimensions -M models/lnd/clm/bld/config_files/Makefile.in ---------------- For ifort only add -132 to FIXEDFLAGS -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml Go back to old fndepdyn files from clm3_6_47 -M models/lnd/clm/src/main/clm_time_manager.F90 --------------- Label sub as "clm::" and change data to - intent(inout) to comply with ESMF3 - (From Dani Bundy-Coleman) - -Summary of testing: - - bluefire: All PASS except -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - bluefire interactive testing: All PASS except -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 arb_ic ........FAIL! rc= 5 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 arb_ic ........FAIL! rc= 5 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 arb_ic ....FAIL! rc= 6 -027 blAK8 TBL.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -10 arb_ic ......FAIL! rc= 6 -051 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - bluefire/CCSM testing: All PASS -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -PASS ERB.f09_g16.I1850SPINUPCN.bluefire -PASS ERH_D.f10_f10.I_1850_CN.bluefire -PASS PET.f10_f10.ICN8520.bluefire.cpl -PASS PET.f10_f10.ICN8520.bluefire.atm -PASS PET.f10_f10.ICN8520.bluefire.lnd -PASS PET.f10_f10.ICN8520.bluefire.ice -PASS PET.f10_f10.ICN8520.bluefire.ocn -PASS PET.f10_f10.ICN8520.bluefire.glc - jaguar interactive testing: All PASS up to... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - lightning/ifort interactive testing: All PASS - dublin/lf95 interactive testing: All PASS up to... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_48 - -Changes answers relative to baseline: No (bit-for-bit) - -=============================================================== -=============================================================== -Tag name: clm3_6_48 -Originator(s): erik (erik) -Date: Wed Aug 12 19:22:59 MDT 2009 -One-line Summary: New aerosol/nitrogen deposition datasets, mksurfdata work, scm work, clm_usr_name option to build-namelist - -Purpose of changes: - -Add in 0.47x0.63, 0.9x1.25 finidat file for CN and 1850, and 0.47x0.63 surface dataset. -Add in datasets at f09, f10, f05, f02 for aerosol (excepting f02 and f05) and nitrogen -deposition from J-F. Work with mksurfdata so that 0.23x0.31 dataset will work (Forrest). -Update csm_share, and get scam working. Add scam tests in. Add clm_usr_name option for -personal datasets to build-namelist. Add a noOrganicSoilDataset use-case so it won't add -in forganic file. Work on using ccsm build files for stand-alone testing. Get testing -going on dublin. - -Bugs fixed (include bugzilla ID): - 813 (use CCSM build files in testing -- partial) - 1010 (error in mksurfdata for qtr degree) - 1014 (shr_scam checkSurface can NOT run an I case) - 1023 (SCM mode check for lnd_present) - -Known bugs (include bugzilla ID): 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1007 (interpinic error with Linux/lahey) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1029 (ifort compilation error in pio) - 1031 (Can't run SMS_D.f09_g16.ICN8520) - 1032 (Problem running SCM mode on Lahey) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Get ccsm_bld option working - -Describe any changes made to the namelist: Add -clm_usr_name option for user-datasets, - add noOrganicSoilDataset use case (leaves forganic file off) - - Add the clm_usr_name option to build-namelist, document how this is done in the - Quickstart.userdataset README file. In short... - - if -clm_usr_name is set to ${MYDATAID} then do the following... - - surfdata: copy files into: - $MYCSMDATA/lnd/clm2/surfdata/surfdata_${MYDATAID}_simyr${SIM_YEAR}.nc - fatmgrid: copy files into: - $MYCSMDATA/lnd/clm2/griddata/griddata_${MYDATAID}.nc - fatmlndfrc: copy files into: - $MYCSMDATA/lnd/clm2/griddata/fracdata_${MYDATAID}_${MASK}.nc - faerdep: copy files into: - $MYCSMDATA/lnd/clm2/snicardata/aerosoldep_monthly_${SIM_YEAR}_${MYDATAID}.nc - - Then set CLM_BLDNML_OPTS="-clm_usr_name $MYDATAID" in your env_conf.xml. You - may have to set DIN_LOC_ROOT_CSMDATA in env_run.xml to $MYCSMDATA is this isn't - the standard location as well (use scripts/link_dirtree $CSMDATA $MYCSMDATA to - link standard datasets to your location. - -List any changes to the defaults for the boundary datasets: New datasets - New aerosol and nitrogen deposition datasets from Jean-Francois Lamarque - New interpolated finidat: for 0.9x1.25, and 0.47x0.63 - New fsurdat: for 0.47x0.63 - New faerdep, 1849-2006: for 0.9x1.25 strung together by David Bailey - New faerdep, 1849-2006: for 1.9x2.5, 10x15 (interpolated) - New fndepdat, decadal avgs: for 1.9x2.5 (raw data from J-F) - New fndepdyn, 1850-2006: for 1.9x.25 strung together - New fndepdyn, 1849-2006: for 0.9x1.25, 0.47x0.63, 10x15 (interpolated) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share, datm7 - - scripts to scripts4_090806 - csm_share to share3_090811 - datm7 to datm7_090812 - -List all files eliminated: None - -List all files added and what they do: - - A Quickstart.userdatasets ---------------------------- Documentation on using own datasets - A models/lnd/clm/test/system/nl_files/nl_ptsmode_ocn - Test SCM mode - A models/lnd/clm/test/system/nl_files/nl_ptsmode ----- Test SCM mode over ocean - A models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml --- Template for - user defined input datasets - A models/lnd/clm/bld/namelist_files/use_cases/noOrganicSoilDataset.xml- Use case to - turn off organic soil dataset - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>> Add scm tests, new variable to turn on use of CCSM build ->>>>>>>>>>>>>>>> Turn off -test in nl_files, already in mknamelist ->>>>>>>>>>>>>>>> Update dublin build/run to what used by cam. - M models/lnd/clm/test/system/TCB.sh --------------- Test for CLM_CCSMBLD - M models/lnd/clm/test/system/README.testnames ----- Add K and L single point mode cases - M models/lnd/clm/test/system/test_driver.sh ------- Update dublin, add INTEL for dublin - reconcile jaguar module with CCSM build - also set PNETCDF dirs. - M models/lnd/clm/test/system/nl_files/clm_per ----- Remove -test - M models/lnd/clm/test/system/nl_files/clm_std ----- Remove -test - M models/lnd/clm/test/system/nl_files/clm_ndepdyn - Remove -test - M models/lnd/clm/test/system/nl_files/clm_pftdyn -- Remove -test - M models/lnd/clm/test/system/nl_files/clm_per0 ---- Remove -test - M models/lnd/clm/test/system/nl_files/clm_urb1pt -- Remove -test - M models/lnd/clm/test/system/input_tests_master --- Add single point tests AK4/AK8,AL4 - M models/lnd/clm/test/system/README --------------- Add note about CLM_CCSMBLD env var - M models/lnd/clm/test/system/CLM_runcmnd.sh ------- Update dublin ->>>>>>>>>>>>>>>> Changes from Forrest Hoffman so that 0.23x0.31 case will work ->>>>>>>>>>>>>>>> I had started this work, but didn't complete it. Forrest checked ->>>>>>>>>>>>>>>> the following changes in. ->>>> 1. Changed the FFLAGS for debug mode on AIX ->>>> 2. Added calls to areaave(), gridmap_clean(), and areaini() in mksoicol.F90 and mksoitex.F90 ->>>> 3. Changed "stop" to "call abort()" in mksrfdat.F90 ->>>> 4. Added roundoff error fixes for gridcells containing only special landunits not ->>>> totalling 100% twice in mksrfdat.F90 ->>>> 5. Added error checking for after landunit adjustment to detect gridcells whose ->>>> components do not total 100% twice in mksrfdat.F90 - M models/lnd/clm/tools/mksurfdata/mksoicol.F90 ---- Add regrid for mask - M models/lnd/clm/tools/mksurfdata/Makefile -------- On IBM optimized remove -C, non-opt remove -O0 - M models/lnd/clm/tools/mksurfdata/mksoitex.F90 ---- Regrid mask - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ---- Roundoff error fix and test ->>>>>>>>>>>>>>>> Handle sim_year_range for datasets, loosen the tolerance for area sum ->>>>>>>>>>>>>>>> Allow time variable to be one ndep files. - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl - Handle sim_year_range - M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --- Handle sim_year_range, loosen - tolerance, and allow time variable ->>>>>>>>>>>>>>>> Get ccsm_bld option working, change ifort a bit, add clm_usr_name ->>>>>>>>>>>>>>>> option and noOrganicSoilDataset use case to build-namelist ->>>>>>>>>>>>>>>> New datasets - Fix hybrid bug for dynpft case, update externals. Require get_clump_bounds to be called - in threaded regions and get_proc_bounds to be called in non-threaded regions. Remove uneeded get_proc_bounds - calls, and pass down begg stuff as needed. Make loop in initSurfAlb Open-MP. Begin adding - testing for dublin, and add lightning_pgi testing. Add new pftdyn test datasets for 1x1_tropicAtl. - Update testing to beta20, default for lightning is ifort, add lighting_pgi testing. Change hist varnames - of 3D_Time_constants_vars* to Time_constant_3Dvars*. Remove use of LSMLAT/LSMLON cpp tokens, by default - set lsmlat/lsmlon to 1. - -Bugs fixed (include bugzilla ID): 1011 (PGI build problem in driver) - 1016 (Problem with PTS_MODE build) - 1019 (hybrid/OpenMP reproducibility bug for pftdyn mode) - -Known bugs (include bugzilla ID): 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1007 (interpinic error with Linux/lahey) - 1010 (error in mksurfdata for qtr degree) - 1014 (shr_scam checkSurface can NOT run an I case) - 1023 (SCM mode check for lnd_present) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - 1102 (OpenMP problem with pftdyn mode) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: pftdyn test datasets for 1x1_tropicAtl - -Describe any substantial timing or memory changes: None - -Code reviewed by: self,mvertens - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm7, csm_share - -scripts to scripts4_090801 ---------------- Begin adding PTS_MODE settings, update clm testlists -drv to vocemis-drydep12_drvseq3_0_27 -- Add PTS_MODE settings to template -datm7 to datm7_090729 ------------------- Add single_column support -csm_share to share3_090729 ------------------ Add dshr support for scmlat/scmlon in domain - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/test/system/tests_pretag_dublin ------- Add test list for dublin - A models/lnd/clm/test/system/tests_pretag_dublin_nompi - Add interactive test list for dublin - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/test_driver.sh ------- Seq testing to beta20, begin adding dublin, default - for lightning is ifort, add lightning_pgi, - M models/lnd/clm/test/system/input_tests_master -- Add openMP 4x5 test - M models/lnd/clm/test/system/CLM_runcmnd.sh ------ Add dublin remove bangkok - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Update pftdyn surfdata for 1000-1004 - tests for 1x1_tropicAtl - - M models/lnd/clm/src/biogeochem/CNWoodProductsMod.F90 - Remove call to get_proc_bounds -- NOT needed - M models/lnd/clm/src/main/clm_varpar.F90 -------------- By default set lsmlat/lsmlon to 1 - M models/lnd/clm/src/main/dynlandMod.F90 -------------- Remove get_proc_bounds pass begg stuff in - M models/lnd/clm/src/main/driver.F90 ------------------ Pass begg stuff down to pft_interp - M models/lnd/clm/src/main/initializeMod.F90 ----------- Pass begg stuff down to pft_interp - M models/lnd/clm/src/main/pftdynMod.F90 --------------- Pass begg stuff down, remove get_proc_bounds calls - M models/lnd/clm/src/main/histFileMod.F90 ------------- Change var names of 3D_Time_constants_vars* to - Time_constant_3Dvars* - M models/lnd/clm/src/main/initSurfAlbMod.F90 ---------- Make loop OpenMP parallel - M models/lnd/clm/src/main/decompMod.F90 --------------- Make sure get_clumpbounds is called from threaded - regions and get_proc_bounds is NOT. - -Summary of testing: - - bluefire: All PASS except -002 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 7 -003 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 6 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v5 72+72 cold ...............FAIL! rc= 7 -010 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 10+38 arb_ic .........FAIL! rc= 7 -011 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v5 72+72 arb_ic ......FAIL! rc= 6 -019 erEH1 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 7 -020 brEH1 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 6 -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -041 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 7 -042 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 6 -048 brJ61 TBR.sh 4p_casasc_dh clm_std^nl_urb_br 20021230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 6 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - bluefire interactive testing: All PASS! - bluefire/CCSM testing: All PASS! -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -PASS ERB.f09_g16.I1850SPINUPCN.bluefire -PASS ERH_D.f10_f10.I_1850_CN.bluefire -PASS PET.f10_f10.ICN8520.bluefire.cpl -PASS PET.f10_f10.ICN8520.bluefire.atm -PASS PET.f10_f10.ICN8520.bluefire.lnd -PASS PET.f10_f10.ICN8520.bluefire.ice -PASS PET.f10_f10.ICN8520.bluefire.ocn -PASS PET.f10_f10.ICN8520.bluefire.glc - jaguar: All PASS! - lightning/ifort interactive testing: All PASS! - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_46 - -Changes answers relative to baseline: No bit-for-bit (except dynpft which was irreproducible before) - -=============================================================== -=============================================================== -Tag name: clm3_6_46 -Originator(s): erik (erik) -Date: Wed Jul 22 15:50:43 MDT 2009 -One-line Summary: Get more tests to work/document them, add use cases for 1850_control, - 2000_control, and 20thC_transient, straighten out single-point grids, Listen to - LND_CDF64 env variable from template, remove CLM_ARB_IC. - -Purpose of changes: - -Work with build-namelist to make 20th-Century a use-case so that ndepdyn files will be -included if found, but can still work without them (20thC_transient, 2000_control, and -1850_control use cases). Fix more bugs and tests, report on testing status for each -machine. Add files needed for 1.9x2.5_tx1v1 grid and new 10x15 surface dataset. Reconcile -grids for single-point datasets so consistent (lon within 0-360 rather than -180-180). -Get new single-point datasets for aerosol and nitrogen-deposition. Work with -pftdyntest2raw.ncl so will work. Work with mksurfdata.pl script so will append needed -grid data on urban point datasets. Add in CLM1PT mode for datm7 and use datm7 streams -template for testing. Listen to LND_CDF64 env variable from template, remove CLM_ARB_IC. - -Bugs fixed (include bugzilla ID): 1002 (remove CLM_ARB_IC) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1007 (interpinic error with Linux/lahey) - 1019 (hybrid/OpenMP reproducibility bug for pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - - Add CLM1PT option to DATM_MODE in env_conf.xml - -Describe any changes made to the namelist: - - New use-cases for: - 2000_control - 1850_control - 20thC_transient - -List any changes to the defaults for the boundary datasets: - 1.9x2.5_tx1v1 datasets, new single-point/regional datasets, new 10x15 surface dataset - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm7, pio - -scripts to scripts4_090720 -datm7 to datm7_090721 -pio to pio51_prod - -List all files eliminated: - -D models/lnd/clm/bld/namelist_files/streams.txt.readme ------- Use datm7 version -D models/lnd/clm/bld/namelist_files/datm.streams.template.xml- Use datm7 version -D models/lnd/clm/test/system/nl_files/clm_organic ------------ organic files included anyway - -List all files added and what they do: - ->>>>>>>>>>>> Add new use cases -A models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml ---- 2000 control -A models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml - 20th Century transient -A models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml ---- 1850 control -A models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml ---- 2000 control - ->>>>>>>>>>>> Add regression tests list for without MPI -A models/lnd/clm/test/system/tests_posttag_nompi_regression ------- no mpi tests - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>>>> Get more tests working, or at least closer to working ->>>>>>>>>>>>>>>>>> ->>>>>>>>>>>>>>>>>> models/lnd/clm/test/system directory changes -M TCB.sh -------------------------------- Put -mach arg here -M tests_pretag_bluefire ----------------- Change some hybrid tests to MPI -M config_files/ext_ccsm_seq_10x15_dh ---- Set cice decomp / remove silent mode -M config_files/ext_ccsm_seq_4x5_dh ------ Set cice decomp / remove silent mode -M config_files/ext_ccsm_seq_1.9x2.5_dh -- Set cice decomp / remove silent mode -M config_files/ext_ccsm_seq_64x128_s ---- Set cice decomp / remove silent mode -M config_files/ext_ccsm_seq_0.9x1.25_dh - Set cice decomp / remove silent mode -M test_driver.sh ------------------------ Set threads/tasks, move -mach to TCB, - set DIN_LOC_ROOT, change needed for latest jaguar build -M tests_posttag_hybrid_regression ------- Remove bad tests, move pure-mpi, serial/open-mp out -M tests_posttag_purempi_regression ------ Remove bad tests, move pure-mpi, serial/open-mp out -M nl_files/nl_urb ----------------------- Remove urban fields already included -M nl_files/nl_urb_br -------------------- Remove urban fields already included -M input_tests_master -------------------- Changes so tests will work -M TCBext_ccsmseq_cam.sh ----------------- Add main/cpl_mct to clm list of dirs - ->>>>>>>>>>>>>>>>>> Update filenames, append grid/frac files to urban single-pt in script -M models/lnd/clm/tools/mksurfdata/mksurfdata.regional ---- New griddata, fix filepath -M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept ---- New griddata, fix filepath -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl ---------- Fix, append grid/frac data - to urban single-point datasets - ->>>>>>>>>>>>>>>>>> Get the pftdyntest2raw script working (will update datasets later) -M models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl - Fix so will work, add grazing on -M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl ----- Add sim_yr to out filenames - ->>>>>>>>>>>>>>>>>> Validate grid -M models/lnd/clm/tools/mkgriddata/creategridMod.F90 - Check for valid grid values - -M models/lnd/clm/srm/main/pftdynMod.F90 - Shorten some long lines - ->>>>>>>>>>>>>>>>>> Change to build: add use-cases, remove CLM_ARB_IC, listen to LND_CDF64 ->>>>>>>>>>>>>>>>>> Add new 1.9x2.5_tx1v1 frac dataset, new datasets for single-point, ->>>>>>>>>>>>>>>>>> new 10x15 datasets, separate out sim_yr and sim_year_range ->>>>>>>>>>>>>>>>>> ->>>>>>>>>>>>>>>>>> models/lnd/clm/bld directory changes -M listDefaultNamelist.pl ----------------------- Add csmdata arg -M build-namelist ------------------------------- Add -list_use_cases option - load uses cases before other defaults, add $ccsm_tools var, - separate sim_yr and sim_year_range, put case_desc for use-cases -M clm.cpl7.template ---------------------------- Remove CLM_ARB_IC, use LND_CDF64 -M namelist_files/checkdatmfiles.ncl ------------ Add tx1v1 mask -M namelist_files/namelist_definition.xml ------- Add tx1v1 mask, make sim_year integer - add sim_year_range, use_case_desc, and clm_demand -M namelist_files/namelist_defaults_overall.xml - default sim_year_range is constant - and default clm_demand is null -M namelist_files/namelist_defaults_datm.xml ---- Use datm7 streams template, - and update domain files -M namelist_files/use_cases/pergro.xml ---------- Add use_case_desc -M namelist_files/use_cases/pergro0.xml --------- Add use_case_desc -M namelist_files/namelist_defaults_clm.xml ----- Move co2_ppmv defaults to use_cases - new surf/frac/aer/ndep/grid data: 5x5_amazon, 1x1_brazil, 1x1_urbanc_alpha, - 1x1_mexicocityMEX, 1x1_vancouverCAN - new frac data: 1.9x2.5_tx1v1 - new aerdep/ndep data: 1x1_camdenNJ, 1x1_tropicAtl, 1x1_asphaltjungleNJ - new surfdata/pftdyn: 10x15 - (new finidat file for f09 CN, 1850 -- commented out -- so answers same as last tag) - -Summary of testing: - - bluefire: All PASS except -019 erEH1 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 7 -020 brEH1 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 6 -022 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -023 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -024 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -026 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -027 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 8 -028 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -3+-7 arb_ic .......FAIL! rc= 5 -029 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -5+-5 arb_ic .......FAIL! rc= 5 -030 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 4 -033 brC61 TBR.sh _sc_dh clm_std^nl_urb_br 20021001:NONE:1800 1.9x2.5 gx1v6 -3+-3 cold ...........FAIL! rc= 6 -041 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 7 -042 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 6 -051 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 4 -052 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -054 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - bluefire interactive testing: All PASS except -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............FAIL! rc= 7 -009 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 7 -013 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 7 -017 blJ74 TBL.sh 4p_casasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic ..FAIL! rc= 7 -019 blCA8 TBL.sh _sc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 7 -021 blL78 TBL.sh _sc_s clm_std^nl_urb 20021231:NONE:1800 1x1_brazil navy -10 arb_ic .............FAIL! rc= 7 -027 erL83 TER.sh _sc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -5+-5 arb_ic ..........FAIL! rc= 7 -028 brL83 TBR.sh _sc_do clm_std^nl_urb_br 20020115:NONE:3600 5x5_amazon navy -10+-10 arb_ic .....FAIL! rc= 6 -029 blL83 TBL.sh _sc_do clm_std^nl_urb 20020115:NONE:3600 5x5_amazon navy -10 arb_ic ............FAIL! rc= 5 -034 bl744 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 4 -036 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 4 -043 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - bluefire/CCSM testing: All PASS -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -PASS ERB.f09_g16.I1850SPINUPCN.bluefire -PASS ERH_D.f10_f10.I_1850_CN.bluefire - lightning/ifort: All PASS except -- up to test 18 -002 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 7 -003 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 6 -005 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -006 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -007 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -008 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -009 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -011 erJ42 TER.sh 4p_casasc_dm clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 10+38 cold ...........FAIL! rc= 7 -012 brJ42 TBR.sh 4p_casasc_dm clm_std^nl_urb_br 20021230:NONE:1800 10x15 USGS 72+72 cold ........FAIL! rc= 6 -015 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 7 -016 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 6 - lightning/ifort interactive testing: up to test 004 -004 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 7 - calgary/lf95: All PASS except... -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............FAIL! rc= 7 -015 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 7 -019 blOC4 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 7 -023 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 7 -024 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -025 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -026 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -028 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -049 blL74 TBL.sh _sc_s clm_std^nl_urb 20020101:NONE:1800 1x1_brazil navy -10 arb_ic .............FAIL! rc= 7 -052 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -053 smM94 TSMncl_tools.sh ndepregrid ............................................................FAIL! rc= 6 -055 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 8 -056 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze,gale,hail,gust/ifort: All PASS except... -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............FAIL! rc= 7 -009 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 7 -011 blCA8 TBL.sh _sc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 7 -019 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 48 cold .......FAIL! rc= 7 -020 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_45 - -Changes answers relative to baseline: Bit-for-bit EXCEPT for (as datasets change) - 5x5_amazon, 1x1_brazil, 1x1_urbanc_alpha, 1x1_mexicocityMEX, 1x1_vancouverCAN - 1x1_camdenNJ, 1x1_tropicAtl, 1x1_asphaltjungleNJ, 10x15 - -=============================================================== -=============================================================== -Tag name: clm3_6_45 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Jul 10 14:00:27 MDT 2009 -One-line Summary: Remove inconsistent finidat file in clm3_6_44 - -Purpose of changes: A few simple bug fixes from clm3_6_44, with minimul testing - - Remove finidat inconsistent with the surface datasets for f19_g16, bgc=cn, sim_yr=1850 - Fix typo in test list, and fix thread settings for bluefire tests - Remove -ftz from CFLAGS for ifort for mkdatadomain - Change csh run scripts so: use CCSM env_machopts settings, set defaults, fix so can run serial - Update datm7 so that CPLHIST3HrWxHfHrSol mode has iradsw=-1 so mimics running with CAM - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1019 (hybrid/OpenMP reproducibility bug for pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Remove inconsistent - finidat file for 0.9x1.25, gx1v6, BGC=cn, sim_yr=1850 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): datm7 - - datm7 to datm7_090709 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/test_driver.sh ------------------- Fix threads settings for bluefire -M models/lnd/clm/test/system/input_tests_master --------------- Fix typo -M models/lnd/clm/tools/interpinic/runinit_ibm.csh ------------- Use CCSM env_machopts settings -M models/lnd/clm/tools/mkdatadomain/Makefile ------------------ Remove -ftz from CFLAGS for ifort -M models/lnd/clm/bld/run-ibm.csh ------------------------------ Use CCSM env_machopts settings, set defaults, - fix so can run serial -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Remove 0.9x1.25, BGC=cn, sim_year=1850, mask=gx1v6 - finidat file as was inconsistent with new surface dataset - -Summary of testing: Limited - -CLM tag used for the baseline comparison tests if applicable: clm3_6_44 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_6_44 -Originator(s): erik (erik) -Date: Thu Jul 9 11:47:40 MDT 2009 -One-line Summary: Fix C13 bug, update scripts, drv, datm. Add domain files for idmap -atm-ocn grids for datm. Remove SEQ_MCT, add new ESMF env vars to template. Work with -ndeplintInterp, fix SCAM - -Purpose of changes: - -Fix C13 nflds bug, update scripts, drv, datm. Add domain files for idmap atm-ocn grids -for datm. Remove SEQ_MCT, add new ESMF env vars to template. Work with ndeplintInterp to -enable using J-F's new Nitrogen deposition files for transient 20th Century simulations. -SCAM fixes from John Truesdale. Add indices for PFT types. - -Bugs fixed (include bugzilla ID): 981 (ccsm domain files for atm=ocn grid) - 987 (remove SEQ_MCT) - 991 (C13 nfields cause model to blowup on jaguar) - 997 (interpolated finidat files cause fully coupled cases to fail) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1019 (hybrid/OpenMP reproducibility bug for pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Remove SEQ_MCT - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New surface datasets for 0.9x1.25 and 1.9x2.5, and new finidat for 1850 for 0.9x1.25 - 10x15 2000 10x15 dataset set to the 1850 version so that testing will work. - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, oleson (pftvarcon changes) - SCAM changes from John Truesdale - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm7, - csm_share and pio - - scripts to scripts4_090707b - drv to vocemis-drydep11_drvseq3_0_23 - datm7 to datm7_090708 - csm_share to share3_090706b - pio to pio50_prod - -List all files eliminated: - - D models/lnd/clm/test/system/tests_pretag_bangkok -- Rename to calgary - -List all files added and what they do: - - A models/lnd/clm/test/system/tests_pretag_calgary ----------- Rename from bangkok - A models/lnd/clm/test/system/tests_pretag_bluefire_nompi ---- serial/open-MP tests - A models/lnd/clm/test/system/tests_pretag_jaguar_nompi ------ serial/open-MP tests - A models/lnd/clm/test/system/tests_posttag_lightning_nompi -- serial/open-MP tests - -List all existing files that have been modified, and describe the changes: - - M Quickstart.GUIDE --- fix minor error in name of directory as scripts changed. - - >>>>>>>>>>>> Separate out non-mpi tests for bluefire, jaguar, and lightning - Test list is different if run interactive or submitted to batch que. - Serial, open-mp only tests are run interactive, MPI and hybrid tests - are run when submitted to the batch que. This prevents waste of resources - for serial and open-mp only tests. - Remove bangkok, replace with calgary only. Default threads depends - on if interative or not. - M models/lnd/clm/test/system/test_driver.sh ----------- - M models/lnd/clm/test/system/tests_pretag_bluefire ---- - M models/lnd/clm/test/system/tests_pretag_jaguar ------ - M models/lnd/clm/test/system/tests_posttag_lightning -- - M models/lnd/clm/test/system/README ------------------- Add note about CLM_SOFF - - >>>>>>>>>>>> - M models/lnd/clm/tools/mksurfdata/Makefile ------------------- For ifort remove -ftz option to CFLAGS - M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig ----- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/mksurfdata.regional -------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn ---------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept -------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist -------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850-2005.txt -- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/pftdyn_simyr2000.txt ------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850.txt ------- New input PFT datasets from Peter L. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl -------------- New input PFT datasets from Peter L. - - >>>>>>>>>>>> Work on linear interpolation of Nitrogen deposition so that add in mid-decades - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl ------- Check if interpolation should be cyclic - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl ----- Also loop over mid decades as well - M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --------- Check if interpolation should be cyclic - - >>>>>>>>>>>> Fix from Sam so that don't have negative ice flow - M models/lnd/clm/tools/interpinic/interpinic.F90 --- Change from Sam so that fully coupled cases don't trap negative ice flow - M models/lnd/clm/tools/interpinic/Srcfiles --------- Don't repeat filenames so can build with lahey - - >>>>>>>>>>>> Change so that document that files should have longs between 0 and 360 rather than -180 to 180 - M models/lnd/clm/tools/mkgriddata/mkgriddata.regional --- Use longs 0-360 - M models/lnd/clm/tools/mkgriddata/mkgriddata.singlept --- Use longs 0-360 - M models/lnd/clm/tools/mkgriddata/Makefile -------------- For ifort remove -ftz option to CFLAGS - M models/lnd/clm/tools/mkgriddata/README ---------------- Make note that regional/single-pt grid files should have longs: 0 <= longs <= 360 - - >>>>>>>>>>>> Remove SEQ_MCT and handle COMP_INTERFACE from ccsm cpl7 scripts, new surface datasets - M models/lnd/clm/bld/configure ----------- Remove SEQ_MCT, handle cpl_esmf - M models/lnd/clm/bld/clm.cpl7.template --- Handle $COMP_INTERFACE - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Allow mid-decadal - sim_years so can process ndepdyn files - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- New 0.9 finidat, - 0.9x1.25, and 1.9x2.5 surfdata, fndepdat files for mid-decadal sim_years. - - >>>>>>>>>>>> Add indices for PFTs. Fixes for SCAM. Break up long lines > 132chars - M models/lnd/clm/src/biogeochem/CASAMod.F90 -------------- noveg, nc3_nonarctic_grass - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 --- noveg, ncorn, nbrdlf_dcd_brl_shrub - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ------- Add PFT indices - M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - Add PFT indices - M models/lnd/clm/src/main/organicFileMod.F90 ------------- SCAM fix (from jet) - M models/lnd/clm/src/main/ncdio.F90 ---------------------- Break up long lines - M models/lnd/clm/src/main/pftdynMod.F90 ------------------ Break up long lines, add - noveg, nbrdlf_evr_shrub - M models/lnd/clm/src/main/clm_atmlnd.F90 ----------------- C13 bug fix for number of fields - (found by Jon Wolfe) - M models/lnd/clm/src/main/pftvarcon.F90 ------------------ Add PFT indices, make sure - pftnames from pftcon file is - as expected. - M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 -------- SCAM fix (from jet) - -Summary of testing: - - bluefire: All FAIL except... -008 smB91 TSMruncase.sh .........................................................................PASS -053 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................PASS - bluefire/CCSM testing: All PASS -PASS ERS_D.f45_g35.I_2000.bluefire -PASS PET.f45_g35.I_1850.bluefire.cpl -PASS PET.f45_g35.I_1850.bluefire.atm -PASS PET.f45_g35.I_1850.bluefire.lnd -PASS PET.f45_g35.I_1850.bluefire.ice -PASS PET.f45_g35.I_1850.bluefire.ocn -PASS PET.f45_g35.I_1850.bluefire.glc -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -PASS ERB.f09_g16.I1850SPINUPCN.bluefire.001802 -PASS ERH_D.f10_f10.I_1850_CN.bluefire - -CLM tag used for the baseline comparison tests if applicable: clm3_6_43 - -Changes answers relative to baseline: No -- bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_6_43 -Originator(s): erik (erik) -Date: Wed Jun 10 11:41:57 MDT 2009 -One-line Summary: Fix pftdyn bug, enable 1D primary hist files, fix time-const3D output, fix template bug, enable cpl_esmf/cpl_mct - -Purpose of changes: - -Add src/main/cpl_esmf,src/main/cpl_mct directories, change configure to build either way, -add -comp_intf option. Remove SEQ_ #ifdef's, simplify some of the logic associated with -the old options (cpl6 and program_off). Brian K -- fix nans, enable openMP again. Allow -first history tape to be 1D (Sean Swenson). Fix template co2_ppmv error. Remove SPMD -#ifdef from RTM. Fix driver pftdyn bug. Fix bug on writing out 3D time-constant fields. - -Bugs fixed (include bugzilla ID): - 929 (bug in co2ppmv value in template) - 969 (allow primary tapes to be 1D) - 974 (bug in pftdyn mode) - 977 (bug writing out 3D time-const data) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 991 (C13 nfields cause model to blowup on jaguar) - 1019 (hybrid/OpenMP reproducibility bug for pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Add choice between ESMF/MCT compilation - NOTE: ESMF option does NOT work as files do NOT exist yet! - Add -comp_intf option to configure - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, swensosc (1D and history changes), - kauff (reenable OpenMP, some vars spval instead of nan) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, pio - - scripts to scripts4_090605b - drv to vocemis-drydep08_drvseq3_0_18 - pio back to pio45_prod (to eliminate compilation problem with pathscale) - -List all files eliminated: - -D models/lnd/clm/src/main/lnd_comp_mct.F90 --- Move to cpl_mct - -List all files added and what they do: - -A models/lnd/clm/src/main/cpl_mct ---- Directory for MCT interface -A models/lnd/clm/src/main/cpl_esmf --- Directory for ESMF interface -A models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - Moved from main directory - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Add -comp_intf option, fix template bug, closing input namelist -M models/lnd/clm/bld/configure ----------- Add -comp_intf option -M models/lnd/clm/bld/config_files/config_definition.xml -- Add comp_interface -M models/lnd/clm/bld/clm.cpl7.template --- Close input namelist with ending "/" - ->>>>>>>>>>>>>> Remove SEQ_ CPP #if's, require some arguments - (needed to be optional for cpl6/offline), allow primary hist files 1D - Fix so that 3D time-constant data does get written out. -M models/lnd/clm/src/main/clm_comp.F90 --------- Make rstwr, nlend, rdate required -M models/lnd/clm/src/main/driver.F90 ----------- Remove doalb if's, PFTDYNWBAL CPP - (for pftdyn bug). Require rstwr, - nlend, and rdate -M models/lnd/clm/src/main/clmtypeInitMod.F90 --- Some vars init to spval (kauff) - certain cell & pft level variables are initialized to spval - instead of nan so eliminate the appearance of nans on restart files. - (not all cell & pfts were used and given non-nan values) -M models/lnd/clm/src/main/histFileMod.F90 ------ Write out 3D time-constant vars, - fix so can write primary 1D files - (Sean Swenson) -M models/lnd/clm/src/main/restFileMod.F90 ------ nlend required -M models/lnd/clm/src/main/controlMod.F90 ------- Remove SEQ_ CPP #if's, allow 1D primary - ability to run threaded is re-enabled (kauff) -M models/lnd/clm/src/main/do_close_dispose.F90 - Require rstwr, nlend -M models/lnd/clm/src/riverroute/RtmMod.F90 ----- Remove SPMD #ifdef - ->>>>>>>>>>>>>> Move testing to calgary from bangkok -M models/lnd/clm/test/system/test_driver.sh ---- Add LD_LIBRARY_PATH for calgary/lf95 - -Summary of testing: - - bluefire: All PASS except (up to test 35) -007 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 7 -008 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 6 -009 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 5 -012 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 5 -013 smH74 TSM.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test@1000-1004 -1100 cold FAIL! rc= 8 -014 blH74 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test@1000-1004 -100 cold FAIL! rc= 4 -019 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 5 -028 blF93 TBL.sh 17p_vodsrsc_do clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 5 -034 erEH1 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 7 - - bluefire/CCSM testing: -PASS ERS.f45_g35.I_2000.bluefire -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -SFAIL ERH.f10_f10.I_1850_CN.bluefire.235943 <<< f10_f10 doesn't work for datm7 right now - -TBL hybrid/openMP tests fail since previous version had OpenMP disabled. - - breeze/gale/hail/gust/ifort: All PASS up to test 12 (10x15, smL51 test) - -CLM tag used for the baseline comparison tests if applicable: clm3_6_43 - -Changes answers relative to baseline: Only pftdyn mode - -=============================================================== -=============================================================== -Tag name: clm3_6_42 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Tue Jun 2 11:58:25 MDT 2009 -One-line Summary: Bring CN Harvest branch (cnhrv02_clm3_6_41) to trunk - -Purpose of changes: - - Add in Peter Thornton's code to read in harvesting variables on surface datasets - and apply harvesting to carbon and nitrogen pools. - Add in surface datasets from clm3_6_40 that have harvesting fields on them for - 0.9x1.25, 1.9x2.5, and 10x15 (as well as aerdep, ndepdat, and ndepdyn datasets). - Remove urban test list as urban on by default, and remove top level doc directory. - Add C13 CPP token for C13 extension of CN add -c13 option to configure. - Add C13/10x15@1850-2000 testing. - Let sum of percent types match to 100 within small value rather than an exact match. - Increase wasteheat limit from 40 to 100 W/m2. - Change default masks to USGS for 4x5,T31,T42, and T85 resolutions so same as cice - Update drv to latest version (drvseq3_0_17 -- on voc branch). - Update ccsm comparision version used in test suite. - -Bugs fixed (include bugzilla ID): - 977 (bug writing out 3D time-const data) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 971 (abort on lahey with MPI) - 972 (abort on intel with MPI) - 974 (bug in pftdyn mode) - 977 (bug writing out 3D time-const data) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - Add C13 #ifdef for CN - Add -c13 option to configure - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Make USGS mask default for 4x5,T31,T42, and T85 - surface datasets with harvesting for: 0.9x1.25, 1.9x2.5, 10x15 (1850,2000) - pftdyn datasets with harvesting for: 0.9x1.25, 10x15 (1850-2005) - faerdep datasets for: 0.9x1.25, 10x15 (1850, 2000, 1850-2000) - fndepdat datasets for: 0.9x1.25, 10x15 (1850,2000) - fndepdyn datasets for: 0.9x1.25, 1.9x2.5, 10x15 (1850-2000) - -Describe any substantial timing or memory changes: Minor for CN - -Code reviewed by: thornton, erik - -List any svn externals directories updated (csm_share, mct, etc.): - Remove top level doc directory as out of date and won't be updated. Howto is in - the scripts directory - -List all files eliminated: - -D models/lnd/clm/test/system/tests_posttag_urban - Urban on by default so doesn't - need it's own tests ->>>>>>>>>>>>>>>>>> Remove as can NOT easily recreate source from them and code - has changed since the creation of the scripts. Would take work - to get the two in sync and be able to use these scripts as source. -D models/lnd/clm/src/main/gen_ncdio_global_subs.csh -D models/lnd/clm/src/main/gen_ncdio_local_subs.csh -D models/lnd/clm/src/main/gen_spmdgs_subs.csh - -List all files added and what they do: - ->>>>>>>>>>>>>>>>>> Add new configurations to test C13 config -A + models/lnd/clm/test/system/config_files/17p_cnc13sc_dh -A + models/lnd/clm/test/system/config_files/17p_cnc13sc_dm -A + models/lnd/clm/test/system/config_files/17p_cnc13sc_do ->>>>>>>>>>>>>>>>>> New module to handle wood harvesting -A + models/lnd/clm/src/biogeochem/CNWoodProductsMod.F90 Calculate loss fluxes from wood - products pools, and update - product pool state variables - -List all existing files that have been modified, and describe the changes: - -M Quickstart.GUIDE --- Update documentation -M README ------------- Update documentation ->>>>>>>>>>>>>>>>>> Add C13 and 10x15@1850-2000 tests -M models/lnd/clm/test/system/tests_pretag_bluefire --- Add 10x15@1850-2000 tests -M models/lnd/clm/test/system/config_files/README ----- Add note on new C13 config -M models/lnd/clm/test/system/tests_posttag_breeze ---- Add openmp C13 test -M models/lnd/clm/test/system/README.testnames -------- Add R configuration for C13 config -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -- Add C45 and R51 tests -M models/lnd/clm/test/system/tests_posttag_purempi_regression - Add C45 and R52 tests -M models/lnd/clm/test/system/input_tests_master ------ Add C45 (10x15@1850-2000, pure-mpi) and - R51-R53 (C13) tests -M models/lnd/clm/test/system/test_driver.sh ---------- Update ccsm4 comparision version - to beta17 ->>>>>>>>>>>>>>>>>> Add C13 configuration option, and new datasets -M models/lnd/clm/bld/configure -------------------------------- Add -c13 option -M models/lnd/clm/bld/config_files/config_definition.xml ------- Add c13 entry -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - - Change default masks for 4x5,T31,T42,T85 to USGS so agree with cice defaults - surface datasets with harvesting for: 0.9x1.25, 1.9x2.5, 10x15 (1850,2000) - pftdyn datasets with harvesting for: 0.9x1.25, 10x15 (1850-2005) - faerdep datasets for: 0.9x1.25, 10x15 (1850, 2000, 1850-2000) - fndepdat datasets for: 0.9x1.25, 10x15 (1850,2000) - fndepdyn datasets for: 0.9x1.25, 1.9x2.5, 10x15 (1850-2000) ->>>>>>>>>>>>>>>>>> C13/DGVM #ifdefs, add harvest vars and calculations -M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 ---- Add CStateUpdate2h method for - harvest mortality fluxes -M models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 -- Add C13 cpp and add C13StateUpdate2h - method for harvesting -M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 ---- Remove 10n and 100n variables -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 ----- Add in harvesting terms -M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 - Add C13 #ifdef's -M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 ---------- Add harvesting fields -M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 ---- Remove 10c, 100c variables, - formatting changes -M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 -- Add C13 #ifdef, remove 10c, 100c vars -M models/lnd/clm/src/biogeochem/CNrestMod.F90 ------------- Add C13 #ifdef -M models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 -- Add C13 #ifdef -M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 ---- Add NStateUpdate2h Nitrogen - harvesting method -M models/lnd/clm/src/biogeochem/C13SummaryMod.F90 --------- Add C13 #ifdef -M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 ------- Add C13 #ifdef and harvesting variables -M models/lnd/clm/src/biogeochem/CNC13FluxMod.F90 ---------- Add C13 #ifdef and C13Flux2h harvest - method, and CNC13HarvestPftToColumn - private method -M models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 ----- Add harvesting method calls - filters by lbc,ubc - Add C13 #ifdef, add CNHarvest call if - fpftdyn file is set. -M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 --------- Add C13 #ifdef, remove 10c, 100c loss - vars, add harvest vars -M models/lnd/clm/src/main/clm_varcon.F90 ------------------ Add C13 #ifdef - Increase wasteheat limit to 100 W/m2 -M models/lnd/clm/src/main/CNiniTimeVar.F90 ---------------- Add C13 #ifdef - begc, endc to methods -M models/lnd/clm/src/main/accFldsMod.F90 ------------------ Put frmf and other vars (t10, t_mo, - ... agdd) in DGVM #ifdef -M models/lnd/clm/src/main/clmtypeInitMod.F90 -------------- Add C13 and DGVM #ifdef and new - harvesting vars -M models/lnd/clm/src/main/pftdynMod.F90 ------------------- Add CNHarvest and CNHarvestPftToColumn - as public methods, - add pftdyn_getharvest private methods, - check that land fractions sum to 100 - within 1e-15 rather than exactly 100, - change pftdyn_get_data to pftdyn_getdata - Add C13 #ifdef, remove 10c, 100c loss - calculation -M models/lnd/clm/src/main/iniTimeConst.F90 ---------------- Add DGVM #ifdef -M models/lnd/clm/src/main/clm_atmlnd.F90 ------------------ Add C13 #ifdef -M models/lnd/clm/src/main/lnd_comp_mct.F90 ---------------- Add C13 #ifdef -M models/lnd/clm/src/main/CNiniSpecial.F90 ---------------- Add C13 #ifdef -M models/lnd/clm/src/main/clmtype.F90 --------------------- Add DGVM, C13 #ifdef, - harvest vars -M models/lnd/clm/src/main/histFldsMod.F90 ----------------- Add C13 #ifdef, correct SEEDN, - Add: WOOD_HARVESTC, PRODUCT_CLOSS, C13_PRODUCT_CLOSS, WOOD_HARVESTN, PRODUCT_NLOSS - Change long_name: DWT_PROD10C_GAIN, DWT_PROD100C_GAIN, DWT_CLOSS, DWT_NLOSS -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 --- Add C13 #ifdef -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ------- Add C13 #ifdef - -Summary of testing: - - bluefire: hybrid and open-mp tests FAIL, pftdyn 1000 tests fail, most TBL tests FAIL as answers change -001 smA74 TSM.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............PASS -002 erA74 TER.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -5+-5 arb_ic ..........PASS -003 brA74 TBR.sh _sc_ds clm_std^nl_urb_br 20030101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .......PASS -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............PASS -005 smL74 TSM.sh _sc_s clm_std^nl_urb 20020101:NONE:1800 1x1_brazil navy -10 arb_ic .............PASS -015 smB91 TSMruncase.sh .........................................................................PASS -021 smF92 TSM.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 96 cold .............PASS -022 erF92 TER.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 10+38 cold ..........PASS -023 brF92 TBR.sh 17p_vodsrsc_dm clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v5 72+72 cold .......PASS -029 smCA4 TSM.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........PASS -030 erCA4 TER.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ......PASS -031 brCA4 TBR.sh _sc_ds clm_std^nl_urb_br 20021001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic ...PASS -032 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........PASS -046 smCA8 TSM.sh _sc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...PASS -047 blCA8 TBL.sh _sc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...PASS -048 smNB4 TSM.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic PASS -049 erNB4 TER.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 59+100 arb_icPASS -050 brNB4 TBR.sh _mexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arb_PASS -051 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic PASS -065 smL78 TSM.sh _sc_s clm_std^nl_urb 20021231:NONE:1800 1x1_brazil navy -366 arb_ic ............PASS -066 blL78 TBL.sh _sc_s clm_std^nl_urb 20021231:NONE:1800 1x1_brazil navy -10 arb_ic .............PASS -PASS ERS.f45_g35.I_2000.bluefire -PASS ERS.f19_g16.I_1850.bluefire -PASS ERS.f19_g16.I_1850-2000.bluefire -PASS ERB.f09_g16.I_1948_2004.bluefire -SFAIL ERH.f10_f10.I_1850_CN.bluefire.014926 <<< f10_f10 doesn't work for datm7 right now -PASS ERP.f19_g16.I_CN_1850-2000.bluefire - bangkok/lf95: Up to test 6 as follows -001 smA74 TSM.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............PASS -002 erA74 TER.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -5+-5 arb_ic ..........PASS -003 brA74 TBR.sh _sc_ds clm_std^nl_urb_br 20030101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .......PASS -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 20030101:NONE:3600 1x1_brazil navy -10 arb_ic ............PASS -005 smA92 TSM.sh _sc_dm clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -006 erA92 TER.sh _sc_dm clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 - breeze/gale/hail/gust/ifort: -001 smA74 TSM.sh _sc_ds clm_std^nl_urb 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ............PASS -002 erA74 TER.sh _sc_ds clm_std^nl_urb 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic ..........PASS -003 brA74 TBR.sh _sc_ds clm_std^nl_urb_br 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .......PASS -004 blA74 TBL.sh _sc_ds clm_std^nl_urb 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ............SKIPPED* -005 smD94 TSM.sh _persc_ds clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................PASS -006 erD94 TER.sh _persc_ds clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 72+72 cold ...............PASS -007 blD94 TBL.sh _persc_ds clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................SKIPPED* -008 smCA4 TSM.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........PASS -009 blCA4 TBL.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........SKIPPED* -010 smCA8 TSM.sh _sc_ds clm_std^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...PASS -011 blCA8 TBL.sh _sc_ds clm_std^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...SKIPPED* -012 smL54 TSM.sh _sc_ds clm_std^nl_urb 19980115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_41 - -Changes answers relative to baseline: Yes, urban wasteheat limit increased to 100 W/m2 - and CN changes due to harvesting - -=============================================================== -Tag name: clm3_6_41 -Originator(s): kauff,erik -Date: Fri May 29 14:15:38 MDT 2009 -One-line Summary: shrub mods, abort if nthreads > 1 (temporary, wrt bugz #965) - -Purpose of changes: fix shrub height, disable threading (due to inexact restart) - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): - - update externals for scripts and pio. - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - - - abort if num threads > 1 - main/controlMod.F90 - - - Change CNVegStructUpdateMod.F90 according to Keith Oleson for shrubs. - * First change tsai_min to be multiplied by 0.5 instead of 0.65, and - * second to lower the tapering for shrubs (types 9 and 11) to 10 with 200 for other woody plants. - - main/aerdepMod.F90 ./aerdepMod.F90 - main/clmtype.F90 ./clmtype.F90 - main/clmtypeInitMod.F90 ./clmtypeInitMod.F90 - main/decompInitMod.F90 ./decompInitMod.F90 - main/driver.F90 ./driver.F90 - main/filterMod.F90 ./filterMod.F90 - main/histFileMod.F90 ./histFileMod.F90 - main/histFldsMod.F90 ./histFldsMod.F90 - main/initializeMod.F90 ./initializeMod.F90 - main/pftdynMod.F90 ./pftdynMod.F90 - main/subgridRestMod.F90 - - biogeochem/CNAnnualUpdateMod.F90 ./CNAnnualUpdateMod.F90 - biogeochem/CNBalanceCheckMod.F90 ./CNBalanceCheckMod.F90 - biogeochem/CNEcosystemDynMod.F90 ./CNEcosystemDynMod.F90 - biogeochem/CNVegStructUpdateMod.F90 ./CNVegStructUpdateMod.F90 - - biogeophys//BalanceCheckMod.F90 ./BalanceCheckMod.F90 - biogeophys//SurfaceAlbedoMod.F90 ./SurfaceAlbedoMod.F90 - biogeophys//UrbanInputMod.F90 - -Summary of testing: - - bluefire: - PASS ERS.f45_g35.I_2000.bluefire - PASS ERS.f19_g16.I_1850.bluefire - PASS ERS.f19_g16.I_1850-2000.bluefire - PASS ERB.f09_g16.I_1948_2004.bluefire - SFAIL ERH.f10_f10.I_1850_CN.bluefire.b16+pretag - * code exact restarts when threaded but using only 1 thread - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: - -Changes answers relative to baseline: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -Tag name: clm3_6_40 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu May 28 15:17:11 MDT 2009 -One-line Summary: Fix openMP bug, add fndepdyn ncl script, fix interpinic for urban, add mkharvest to mksurfdata, new spinups, turn CLAMP on for CASA or CN - -Purpose of changes: - -Fix hybrid/open-MP mode bug, and testing for hybrid/open-MP. Add ncl script to -time-interpolate between 1850 and 2000 for fndepdat dataset, for fndepdyn version. Fix -interpinic for urban and cndv (jet/oleson/slevis). Update aerdepregrid.ncl and -ndepregrid.ncl scripts. Add mkharvest fields to mksurfdata. Remove furbinp and just use -fsurdat (leave forganic, so can remove to turn off). Begin to add an option to build -with ccsm makefiles, for test-suite. Remove archiving, branching and resub from last run -script in models/lnd/clm/bld. New spin-up files for 1850 and 2000 for 1.9x2.5 and 1850 -for CN. Make sure CLAMP is turned on for either CASA or CN. Change testing years to -2002-2003 so same as for ccsm tests. - -Bugs fixed (include bugzilla ID): 954 (hybrid problem) - 959 (test suite NOT testing hybrid) - 965 (hybrid problem for high-proc count) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 966 (Hybrid restart problem on bluefire) - 967 (PIO bounds problem on jaguar) - 974 (bug in pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Start adding option to build with ccsm Makefiles - - By default turn on CLAMP when either CN or CASA is enabled - -Describe any changes made to the namelist: Remove furbinp (use fsurdat) - -List any changes to the defaults for the boundary datasets: New spinup files - - clmi.IQmp17_1950-01-01_1.9x2.5_gx1v6_simyr1850_c090509.nc - clmi.IQmp17_2000-01-01_1.9x2.5_gx1v6_simyr2000_c090509.nc - clmi.BCN_0093-01-01_1.9x2.5_gx1v6_simyr1850_c090527.nc - -Describe any substantial timing or memory changes: Faster because of a fix to a I/O - write bug in datm7 - -Code reviewed by: self, forrest, mvertens, oleson, jet (relevant portions from them) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm7, csm_share - - scripts to scripts4_090527 - datm7 to datm7_090518 - csm_share to share3_090512 - -List all files eliminated: - -D models/lnd/clm/bld/build-streams -- Remove phasing out old run scripts, another - version exists in scripts/ccsm_utils/Tools/build_streams - -List all files added and what they do: - ->>>>>>>>>>>>>>>>>>>> Add harvest fields to surface datasets -A models/lnd/clm/tools/mksurfdata/mkharvestMod.F90 ------------- New module to handle harvest fields - ->>>>>>>>>>>>>>>>>>>> New files for ccsm_bld option -A models/lnd/clm/bld/config_files/Macros.yong_g95 -------------- Macro's file for my Darwin Mac-OSX laptop -A models/lnd/clm/bld/config_files/Macros.breeze_intel ---------- Macro's file for intel on breeze. -A models/lnd/clm/bld/config_files/TopCCSMBldMakefile.in -------- Top level makefile for a ccsm_bld - ->>>>>>>>>>>>>>>>>>>> New scripts to regrid all aerosol/nitrogen deposition resolutions and create - transient Nitrogen-Deposition -A models/lnd/clm/tools/ncl_scripts/runDepositionRegrid.pl ------ Run regrid for many resolutions for - aerosol and nitrogen deposition -A models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl ---------- Linearly interpolate nitrogen-deposition - between 1850 and 2000 to get - transient nitrogen deposition. - ->>>>>>>>>>>>>>>>>>>> New serial and open-MP tests -A models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do -A models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do -A models/lnd/clm/test/system/config_files/17p_vodsrsc_ds - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>>>>>> Fix hybrid bug (959), some tweaks, change dates to 2002/2003 to correspond with - data checked in -M models/lnd/clm/test/system/tests-driver.sh -------------------- Add -mach option to configure, - able to set CLM_THREADS as input -M models/lnd/clm/test/system/tests_pretag_bluefire -------------- Move f19_g16 test closer to - beginning of list -M models/lnd/clm/test/system/config_files/17p_cnsc_dh ----------- Turn supln off -M models/lnd/clm/test/system/config_files/17p_cnsc_dm ----------- Turn supln off -M models/lnd/clm/test/system/config_files/17p_cnsc_do ----------- Turn supln off -M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh --- Turn supln on -M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm --- Turn supln on -M models/lnd/clm/test/system/mknamelist ------------------------- Set number of threads by input CLM_THREADS -M models/lnd/clm/test/system/input_tests_master ----------------- Change all start dates to 2002/2003 to - correspond with data checked in -M models/lnd/clm/test/system/README ----------------------------- Document that can set CLM_THREADS -M models/lnd/clm/test/system/TSM.sh ----------------------------- Set number of threads by input - CLM_THREADS / handle cold start - ->>>>>>>>>>>>>>>>>>>> Add harvest fields -M models/lnd/clm/tools/mksurfdata/ncdio.F90 --------------------- Add nf_get_att_text -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 ----------------- Write out harvest fields -M models/lnd/clm/tools/mksurfdata/mkvarpar.F90 ------------------ Formatting change -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ------------------ Call mkharvest_init, mkharvest, - and add harvest fields to file -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850.txt ---------- Point to new landuse files -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850-2005.txt ----- Point to new landuse files -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr2000.txt ---------- Point to new landuse files -M models/lnd/clm/tools/mksurfdata/Srcfiles ---------------------- Add mkharvestMod.F90 file to list - ->>>>>>>>>>>>>>>>>>>> Fix interpinic for urban -M models/lnd/clm/tools/interpinic/interpinic.F90 ---- Changes from Keith Oleson/John Truesdale to - handle urban -M models/lnd/clm/tools/interpinic/runinit_ibm.csh --- Tweak sim_years, maxpft, and start times - ->>>>>>>>>>>>>>>>>>>> Fix regrid scripts for new sim_yr -M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl --- Add sim_yr, document better, add time coord. - variable -M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl ----- Add sim_yr, figure out file-type from it, - document better, transient files use - lowercase lat, lon instead of LAT, LON. - ->>>>>>>>>>>>>>>>>>>> Fix hybrid bug (959), deprecate old scripts -M models/lnd/clm/bld/configure ----------------- By default turn on CLAMP when either CN or CASA is enabled, - start adding ccsm_bld option, and -mach option. -M models/lnd/clm/bld/mkSrcfiles ---------------- Get it to match scripts version of same thing -M models/lnd/clm/bld/mkDepends ----------------- Get it to match scripts version of same thing, - remove Darwin kludge for assert.h (as has been renamed) -M models/lnd/clm/bld/queryDefaultXML.pm -------- Handle return characters in values -M models/lnd/clm/bld/config_files/Makefile.in -- Get rid of SGI, Nec-SX6, ES, Cray-X1 build options, - tweak Linux build -M models/lnd/clm/bld/listDefaultNamelist.pl ---- Add option to do all resolutions, correct prints -M models/lnd/clm/bld/build-namelist ------------ Add drv_in namelist "ccsm_pes" setting threads to - OMP_NUM_THREADS value, remove furbinp file -M models/lnd/clm/bld/create_newcase ------------ Document that this script is deprecated -M models/lnd/clm/bld/run-ibm.csh --------------- Remove archiving, change defaults, - add notes that script is deprecated -M models/lnd/clm/bld/README -------------------- Remove files taken out -M models/lnd/clm/bld/config_files/config_sys_defaults.xml ----- Add default mach settings -M models/lnd/clm/bld/config_files/config_definition.xml ------- Add mach and ccsm_bld settings -M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Remove furbinp, add task thread layouts - for ccsm_pe namelist -M models/lnd/clm/bld/namelist_files/datm.streams.template.xml - Make same as datm7 version - (except using %p instead of DIN_LOC_ROOT) -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New finidat spinup files for 1.9x2.5, - 1850, 2000 and 1850-CN - ->>>>>>>>>>>>>>>>>>>> Changes from Forrest Hoffman to fix hybrid issues on jaguar (bug 954 and more) -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 -- Add lbc,ubc -M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 -- Add lbc, ubc, lbp, ubp -M models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 -- Explicitly dimension filters to "ubp-lbp+1" - rather than ":" - ->>>>>>>>>>>>>>>>>>>> Fix hybrid issues (bug 954), add #ifdefs to clmtype so can use CLAMP with CASA, - remove CSD and USE_OMP junk -M models/lnd/clm/src/main/driver.F90 ------------------- Remove CSD directives and USE_OMP. - Add more variables to private for OMP loops - (forrest) (bug 954) - Pass array bounds to dynland_hwcontent - (mvertens) (bug 954). - Pass array bounds needed by Forrest's - biogeochem changes above. -M models/lnd/clm/src/main/decompInitMod.F90 ------------ Make a line shorter (with continue lines) -M models/lnd/clm/src/main/subgridRestMod.F90 ----------- Make a line shorter (with continue lines) -M models/lnd/clm/src/main/aerdepMod.F90 ---------------- Remove generic save statement, add save for - each data instantiation -M models/lnd/clm/src/main/clmtypeInitMod.F90 ----------- Add #ifdefs from casafire branch to limit - clmtype size -M models/lnd/clm/src/main/initializeMod.F90 ------------ Remove USE_OMP and CSD directives -M models/lnd/clm/src/main/pftdynMod.F90 ---------------- #ifdef pftdyn_cnbal -M models/lnd/clm/src/main/histFileMod.F90 -------------- Remove CSD directives -M models/lnd/clm/src/main/controlMod.F90 --------------- Remove furbinp, remove UNICOSMP and SSP complexity -M models/lnd/clm/src/main/filterMod.F90 ---------------- Remove CSD directives -M models/lnd/clm/src/main/clmtype.F90 ------------------ Add #ifdefs from casafire branch to limit - clmtype size -M models/lnd/clm/src/main/histFldsMod.F90 -------------- Remove KO comments - ->>>>>>>>>>>>>>>>>>>> Fix hybrid issues (bug 954 and 965), use fsurdat instead of furbinp file for urban input -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ---- Pass in array bounds (mvertens) (bug 954) -M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 ------ Use fsurdat instead of separate furbinp file -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 --- Remove num_solar logic that caused an early exit - (bug 965) - -Summary of testing: - - bluefire: All PASS except -007 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 7 -008 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 6 -011 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v5 72+72 cold ...............FAIL! rc= 7 -013 smH74 TSM.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test@1000-1004 -1100 cold FAIL! rc= 8 -014 blH74 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test@1000-1004 -100 cold FAIL! rc= 4 -017 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 10+38 arb_ic .........FAIL! rc= 7 -018 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v5 72+72 arb_ic ......FAIL! rc= 6 -022 erF92 TER.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 10+38 cold ..........FAIL! rc= 7 -023 brF92 TBR.sh 17p_vodsrsc_dm clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v5 72+72 cold .......FAIL! rc= 6 -009 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -013 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -021 erC61 TER.sh _sc_dh clm_std^nl_urb 20021001:NONE:1800 1.9x2.5 gx1v6 10+38 cold ..............FAIL! rc= 7 -022 brC61 TBR.sh _sc_dh clm_std^nl_urb_br 20021001:NONE:1800 1.9x2.5 gx1v6 -3+-3 cold ...........FAIL! rc= 6 -025 erH51 TER.sh 17p_cnnsc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 cold ......FAIL! rc= 7 -027 blH51 TBL.sh 17p_cnnsc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold .........FAIL! rc= 5 -029 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -030 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -031 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -032 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -036 erLD1 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:1800 2.65x3.33 USGS -5+-5 arb_ic ...........FAIL! rc= 7 -007 brJ61 TBR.sh 4p_casasc_dh clm_std^nl_urb_br 20021230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 6 - jaguar: All PASS except -005 smA91 TSM.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 <<< bug 967 -006 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -007 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -009 smE92 TSM.sh 4p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 96 arb_ic ............FAIL! rc= 10 <<< bug 967 -010 erE92 TER.sh 4p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v5 10+38 arb_ic .........FAIL! rc= 5 -011 brE92 TBR.sh 4p_vodsrsc_dm clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v5 72+72 arb_ic ......FAIL! rc= 5 -013 smEH2 TSM.sh 4p_vodsrsc_dm clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 10 <<< bug 967 -014 erEH2 TER.sh 4p_vodsrsc_dm clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 5 -015 brEH2 TBR.sh 4p_vodsrsc_dm clm_std^nl_urb_br 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 5 -017 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -018 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -019 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -021 smH92 TSM.sh 17p_cnnsc_dm clm_ndepdyn 20020101:NONE:1800 4x5 gx3v5@2000 96 cold .............FAIL! rc= 8 -022 erH92 TER.sh 17p_cnnsc_dm clm_ndepdyn 20020101:NONE:1800 4x5 gx3v5@2000 10+38 cold ..........FAIL! rc= 5 -023 brH92 TBR.sh 17p_cnnsc_dm clm_ndepdyn 20020101:NONE:1800 4x5 gx3v5@2000 72+72 cold ..........FAIL! rc= 5 -025 smJ62 TSM.sh 4p_casasc_dm clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 <<< bug 967 -026 erJ62 TER.sh 4p_casasc_dm clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -027 brJ62 TBR.sh 4p_casasc_dm clm_std^nl_urb_br 20021230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -034 smLI2 TSM.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -035 erLI2 TER.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -036 brLI2 TBR.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 - lightning/pathscale: All PASS except -009 smA91 TSM.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -010 erA91 TER.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -011 brA91 TBR.sh _sc_dh clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -012 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 4 -017 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -018 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -019 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -020 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -021 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -023 erJ42 TER.sh 4p_casasc_dm clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 10+38 cold ...........FAIL! rc= 7 -024 brJ42 TBR.sh 4p_casasc_dm clm_std^nl_urb_br 20021230:NONE:1800 10x15 USGS 72+72 cold ........FAIL! rc= 6 -026 smL51 TSM.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -027 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -028 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -029 blL51 TBL.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 4 -032 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 6 -035 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -036 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -037 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 5 - bangkok/lf95: -024 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -025 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -026 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -051 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -052 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -055 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 4 -056 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze/gale/hail/gust/ifort: All PASS up to the pftdyn test -016 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_39 - -Changes answers relative to baseline: No bit-for-bit (unless compare cases using the new vs old spin-up files) - -=============================================================== -=============================================================== -Tag name: clm3_6_39 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu May 7 14:18:08 MDT 2009 -One-line Summary: Bug fix for script version and maxpatchpft back to numpft+1 - -Purpose of changes: Bug fixes for two issues, script version to set CLM_DEMAND="null" instead of none - And reset default maxpatch_pft=numpft+1 instead of 4 which crept in on clm3_6_38 - -Bugs fixed (include bugzilla ID): 943 (CLM_DEMAND="null") - 946 (default maxpatchpft) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 974 (bug in pftdyn mode) - 977 (bug writing out 3D time-const data) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Change default for maxpatch_pft back to numpft+1 - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts - - scripts to scripts4_090506 (default CLM_DEMAND is null rather than none) - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/config_files/config_definition.xml ----- maxpft=numpft+1 -M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Allow sim_year=1000 for test datasets -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml Add co2_ppmv for test_yr=1000 -M models/lnd/clm/src/main/driver.F90 ------------------------ Don't write out message about dynamic pft every time-step -M models/lnd/clm/src/main/lnd_comp_mct.F90 ------------------ Set iulog for non-masterproc processors -M models/lnd/clm/test/system/input_tests_master ------------- Put year-range for pftdyn 10x15 tests - -Summary of testing: Limited - -CLM tag used for the baseline comparison tests if applicable: clm3_6_38 - -Changes answers relative to baseline: Default number of PFT's is numpft+1 instead of 4. - -=============================================================== -=============================================================== -Tag name: clm3_6_38 -Originator(s): erik (erik) -Date: Wed May 6 00:20:37 MDT 2009 -One-line Summary: New fsurdat for other resolutions, bug-fixes, deep wetlands to bedrock, new spinups for 1.9x2.5 1850, 2000 - -Purpose of changes: - -New surfdata for all resolutions, and new pftdyn test datasets (1x1 and 10x15). Make sure -furbinp/forganic/fsurdata consistent. New 1850 and 2000 spin-up for 1.9x2.5. Add in field -to restart files needed for urban interpinic. Change deep wetlands to bedrock. Remove -some output for urban and aerdep. fcov changes from Sean. Bring in history change from -Dave (so only output static 3D fields on first h0 file). Bug fix for RTM bug from Keith -O. - -Bugs fixed (include bugzilla ID): 941 (RTM output 6X too low) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 943 (CLM_DEMAND="null") - 946 (default maxpatchpft) - 974 (bug in pftdyn mode) - 977 (bug writing out 3D time-const data) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: - -Describe any changes made to the namelist: Remove step2init, add irad from datm - factorfn now null instead of unused. - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: None - -Code reviewed by: swensosc, oleson, dlawren - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share, -drv, datm7, mct, pio - - scripts to scripts4_090505c - drv to vocemis-drydep08_drvseq3_0_16 - datm7 to datm7_090505b - csm_share to share3_090429 - pio to pio40_prod - -List all files eliminated: Remove old run scripts, pt-urban input data - -D models/lnd/clm/test/system/nl_files/clm_urb -- remove since urban is default -D models/lnd/clm/tools/ncl_scripts/addgrid2spointurban.ncl -- only needed to create - urban pt surface datasets -D models/lnd/clm/tools/ncl_scripts/clmi_increasesoillayer.ncl - only needed to go - from 10 layer to 15 layer finidat files. -D models/lnd/clm/bld/urban_input -D models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.nc -D models/lnd/clm/bld/urban_input/metropolis_fluxes.nc -D models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.nc -D models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.nc -D models/lnd/clm/bld/urban_input/surfdata_1x1_tropicAtl_urb3den_simyr2000_c090320.nc -D models/lnd/clm/bld/urban_input/surfdata_1x1_brazil_urb3den_simyr2000_c090320.nc -D models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.nc -D models/lnd/clm/bld/urban_input/surfdata_1x1_brazil_urb3den_simyr1850_c090317.nc -D models/lnd/clm/bld/run-pc.csh -D models/lnd/clm/bld/run-lightning.csh - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>> configure defaults for everything on, update for new datm7 - new sim_year for pftdyn test datasets. New fsurdat for all - resolutions, furbinp and forganic=fsurdat. -M models/lnd/clm/bld/configure -------------------------------- document defaults -correctly -M models/lnd/clm/bld/config_files/config_definition.xml ------- defaults for: - dust: on, maxpft:numpft+1, progsslt:on, rtm:on -M models/lnd/clm/bld/listDefaultNamelist.pl ------------------- all -res all option -M models/lnd/clm/bld/clm.cpl7.template ------------------------ use defaults for - dust, progsslt, and rtm. Don't demand furbinp, or forganic -M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Remove step2init, -change defaults for factorfn, and sim_year (for test ranges 1000-1002, and 1000-1004) -M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml Factorfn=null, rm step2init -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New 1.9x2.5 finidat, - new fsurdat for all resolutions, -M models/lnd/clm/bld/build-namelist --------------------------- furbinp,forganic now -longer clm_demand - furbinp = fsurdat, forganic = fsurdat, fsurdat no longer need - furbinp and fpftdyn, finidat doesn't need furbinp, remove step2init ->>>>>>>>>>>>>>>> -M models/lnd/clm/src/main/aerdepMod.F90 ---------------- log output only to masterproc -M models/lnd/clm/src/main/iniTimeConst.F90 ------------- remove urban log output -M models/lnd/clm/src/main/subgridRestMod.F90 ----------- add cols1d_ityp -M models/lnd/clm/src/main/clmtypeInitMod.F90 ----------- add fsat -M models/lnd/clm/src/main/iniTimeConst.F90 ------------- make deep wetlands bedrock -M models/lnd/clm/src/main/histFileMod.F90 -------------- only write out static fields - to h0 tapes on nstep=0 -M models/lnd/clm/src/main/clmtype.F90 ------------------ add fcov and fsat -M models/lnd/clm/src/main/histFldsMod.F90 -------------- add fsat to history files -M models/lnd/clm/src/main/mkarbinitMod.F90 ------------- make wetlands bedrock -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - make wetlands bedrock -M models/lnd/clm/src/biogeophys/UrbanInitMod.F90 ------- add fcov/fsat -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ------ add fcov/fsat -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 --- add fcov/fsat -M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 --- add fcov/fsat -M models/lnd/clm/src/riverroute/RtmMod.F90 ------------- Fix RTM bug so accumulate - during RTM intervals ->>>>>>>>>>>>>>>> Remove run-pc/run-lighning tests, remove CLMNCEP, update to beta15 - lightning no parallel gmake, no clm_demand for furbinp, change clm_urb - to clm_std, add sim_year for pftdyn tests, add serial vodsrsc tests -M models/lnd/clm/test/system/tests_pretag_bangkok -M models/lnd/clm/test/system/tests_posttag_lightning -M models/lnd/clm/test/system/test_driver.sh --------- update to beta15, lightning gmake no parallel -M models/lnd/clm/test/system/mknamelist ------------- remove CLMNCEP option -M models/lnd/clm/test/system/TCSruncase.sh ---------- remove lightning, pc option -M models/lnd/clm/test/system/nl_files/clm_per ------- no clm_demand on furbinp -M models/lnd/clm/test/system/nl_files/clm_per0 ------ no clm_demand on furbinp -M models/lnd/clm/test/system/nl_files/clm_urb1pt ---- no clm_demand on furbinp -M models/lnd/clm/test/system/input_tests_master ----- change clm_urb to clm_std - add sim_year for pftdyn tests, add serial vodsrsc - tests ->>>>>>>>>>>>>>>> Change urban pt datasets from 1850 to 2000 sim_year. -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - -Summary of testing: limited testing on breeze, lightning, and bangkok - - bluefire: All PASS except TBL up to test 27 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_37 - -Changes answers relative to baseline: Yes, RTM 6X higher, surface datasets different - deep wetlands now bedrock - -=============================================================== -=============================================================== -Tag name: clm3_6_37 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Mon Apr 27 23:27:26 MDT 2009 -One-line Summary: Update faerdep dataset for 1.9x2.5 to point to version cice is using for 1850 and 2000 - -Purpose of changes: Point to same version of faerdep datasets used by cice for 1.9x2.5 1850/2000 - This was needed for the ccsm4_0_beta15 tag. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 941 (RTM output 6X too low) - 974 (bug in pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New faerdep datasets for 1.9x2.5 used by cice (only difference is time coord) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts - scripts to scripts4_090427b - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - -Summary of testing: None, other than build-namelist for 1.9x2.5 sim_year=1850/2000 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_36 - -Changes answers relative to baseline: Should be identical - -=============================================================== -=============================================================== -Tag name: clm3_6_36 -Originator(s): erik (erik) -Date: Mon Apr 27 14:10:13 MDT 2009 -One-line Summary: Handle transient aersol, make maxpatchpft=numpft+1 default, new datasets for 1.9x2.5 and 0.9x1.25, change doalb - -Purpose of changes: - -Changes so can do aerosol transient time-series (1850-2000) (kauff). New surfdata -datasets for 1.9x2.5 and 0.9x1.25 (1850 and 2000). New 1850-2000 pftdyn dataset for -1.9x2.5. New aerosol and ndep for 1.9x2.5 (1850 and 2000). Change to doalb from Mariana. -Make maxpatchpft=numpft+1 the default and remove all finidat files - -Bugs fixed (include bugzilla ID): 936 (create_test bug) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 935 (RTM warning NOT an error) - 937 (undef value on bangkok for maxpatchpft=numpft+1 case) - 941 (RTM output 6X too low) - 974 (bug in pftdyn mode) - 1068 (Problems interpolated deposition datasets to high res) - 1069 (Nitrogen Deposition datasets have wrong units) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: maxpatchpft default is now numpft+1 - -Describe any changes made to the namelist: build-namelist now allows 1850-2000 for sim_year for transient datasets - aerdep now chooses a transient dataset for this case as well - -List any changes to the defaults for the boundary datasets: - New aerosol deposition and nitrogen deposition datasets for 1.9x2.5 and transient - New pftdyn dataset for 1.9x2.5 for 1850-2000 - New surfdata for 1.9x2.5 and 0.9x1.25 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, kauff (aer transient), mvertens (doalb changes) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm7, and pio - scripts to scripts4_090424 - drv to vocemis-drydep08_drvseq3_0_14 - datm7 to datm7_090406 - pio to pio38_prod - -List all files eliminated: None - -List all files added and what they do: Add file for generic settings NOT used by a specific model component - -A models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>>>>>>>>>> Add cice decomp info, use xml input file for PE change -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_10x15_dh -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_4x5_dh -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_1.9x2.5_dh -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_64x128_s -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_0.9x1.25_dh -M models/lnd/clm/test/system/TCT_ccsmseq.sh --- use xml file format for PE change ->>>>>>>>>>>>>>>>>>>>>>>> Base LANDMASK on SUM(PCT_PFT) rather than LANDFRAC_PFT -M models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl ->>>>>>>>>>>>>>>>>>>>>>>> Add 1850-2000 simyr option -M models/lnd/clm/bld/config_files/config_definition.xml ------ maxpatchpft default -is numpft+1 -M models/lnd/clm/bld/namelist_files/namelist_definition.xml -- Add 1850-2000 to valid sim_year values -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Remove finidat files, - remove data in namelist_defaults_overall, - new fsurdat,forganic,furbinp for 1.9x2.5 and 0.9x1.25 - 1850-2000 PFT dataset for 1.9x2.5 - new aerdep and ndep datasets for 1.9x2.5 and 0.9x1.25, - and transient 1850-2000 aerdep datasets -M models/lnd/clm/bld/build-namelist ----------- Be careful if datasets are picked -based on full sim_year (which could be 1850-2000) or the first year (1850 finidat, -fsurdat files) -M models/lnd/clm/bld/listDefaultNamelist.pl --- Use list of defaults files -M models/lnd/clm/bld/queryDefaultNamelist.pl -- Use list of defaults files, remove scpto option -M models/lnd/clm/bld/queryDefaultXML.pm ------- Use list of defaults files ->>>>>>>>>>>>>>>>>>>>>>>> doalb changes from Mariana Vertenstein (branches/new_doalb) ->>>>>>>>>>>>>>>>>>>>>>>> remove caldayp1 use next_swcday sent from atm -M models/lnd/clm/src/biogeochem/DGVMMod.F90 ---------- remove caldayp1, send nextsw_cday -M models/lnd/clm/src/main/clm_comp.F90 --------------- don't calcualte caldayp1, calc declinp1 based on nextsw_cday -M models/lnd/clm/src/main/driver.F90 ----------------- Pass nextsw_cday instead of caldayp1 -M models/lnd/clm/src/main/initSurfAlbMod.F90 --------- Don't pass calday and declin -M models/lnd/clm/src/main/lnd_comp_mct.F90 ----------- Remove never_doAlb logic, pass nextsw_cday down -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 - cosz based on nextsw_cday NOT caldayp1 -M models/lnd/clm/src/biogeophys/UrbanMod.F90 --------- Do NOT pass calday, declin ->>>>>>>>>>>>>>>>>>>>>>>> aerdep changes from Brian Kauffman (cbgcdev05_clm3_6_35) -M models/lnd/clm/src/main/aerdepMod.F90 -- Time-interpolation done each time-step (rather than just each day) method slightly different. - Also allows transient file where uses first year - until reaches middle years, then after last year continues to use last year. - -Summary of testing: - - bluefire: All PASS except TBL and... up to test 62 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -038 smCA4 TSM.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 10 -039 erCA4 TER.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ......FAIL! rc= 5 -040 brCA4 TBR.sh _sc_ds clm_urb^nl_urb_br 19981001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic ...FAIL! rc= 5 -042 smCA8 TSM.sh _sc_ds clm_urb^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 10 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_35 - -Changes answers relative to baseline: Yes -- default for maxpatchpft is numpft+1 - rather than 4 - And aersol time-interpolation is different - method is different and also does interpolation - for every time-step NOT held constant each day. - -=============================================================== -=============================================================== -Tag name: clm3_6_35 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Mon Apr 20 15:19:17 MDT 2009 -One-line Summary: Fix major logic bug in mksurfdata - -Purpose of changes: Fix major logic bug in mksurfdata (bug 934) which requires us to recreate any surface datasets - created with clm3_6_32. The bug zero'd out LAI for some PFT's and biased the LAI values - (LAI, SAI, veg-bot, veg-top). - - This is a note from dlawren - "I have taken a look at the new surface files and they look correct to me. LAI - is defined everywhere. I did a quick test using this surface dataset with a - spunup file from Keith's prior 1850 simulation and it worked fine (no errors). - I also confirmed that indeed the gridbox mean LAI is different by up to about - +-0.5. In most places the difference is below +-0.1." - - -Bugs fixed (include bugzilla ID): 934 (pftdyn logic bug) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 941 (RTM output 6X too low) - 974 (bug in pftdyn mode) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Self (but new 1.9x2.5 surface dataset checked by dlawren and lawrence) - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - -A models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl --- Create raw pftdyn test datasets, so can create new ones. - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/tools/mksurfdata/mklaiMod.F90 ---------------- Fix pftdyn logic error. -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ---------------- Move soil-text calc higher up, allow more space for filenames -M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig ------ Make output in double precision -M models/lnd/clm/tools/mksurfdata/mksurfdata.regional --------- Make output in double precision -M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn ----------- Make output in double precision -M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept --------- Make output in double precision -M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist --------- Make output in double precision -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl --------------- Get T62, 2x2.5 and qtr deg res's, only do 2000 for urban single-point -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850-2005.txt --- Allow larger size for filenames -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr2000.txt -------- Allow larger size for filenames -M models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850.txt -------- Allow larger size for filenames - -MM models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl ----------- Add svn keywords -MM models/lnd/clm/tools/ncl_scripts/clmi_increasesoillayer.ncl - Add svn keywords -M models/lnd/clm/tools/ncl_scripts/README --------------------- Update doc on files - -Summary of testing: No testing except for mksurfdata on bluefire - -001 sm774 TSMtools.sh mksurfdata tools__ds singlept .............................................PASS -002 sm754 TSMtools.sh mksurfdata tools__s globalirrig ...........................................PASS -003 sm756 TSMtools.sh mksurfdata tools__s pftdyn ................................................PASS - -CLM tag used for the baseline comparison tests if applicable: clm3_6_34 - -Changes answers relative to baseline: no bit-for-bit (other than mksurfdata) - -=============================================================== -=============================================================== -Tag name: clm3_6_34 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Sun Apr 19 09:34:43 MDT 2009 -One-line Summary: Fix bangkok urban bug - -Purpose of changes: Fix urban bug found from bangkok testing (#927) and eliminate potential water balance error - -Bugs fixed (include bugzilla ID): 927 - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 934 (pftdyn logic bug) - 941 (RTM output 6X too low) - 974 (bug in pftdyn mode) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: myself, Erik Kluzek, Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 .... Change loop over all columns to filter_nourbanc -M models/lnd/clm/src/biogeophys/UrbanMod.F90 .... Change some net_solar fields from intent(out) to intent(inout). - add soilalpha_u restriction on soil evaporation/transpiration selection for pervious road (this second - change is bit for bit for all bluefire/bangkok testing, but will prevent small water balance errors in - special situations (e.g., perpetual January simulations) - -Summary of testing: - - bluefire: All PASS except: -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -060 blLI1 TBL.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -069 smJ61 TSM.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -070 erJ61 TER.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -071 brJ61 TBR.sh 4p_casasc_dh clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -072 blJ61 TBL.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 4 -082 bl744 TBLtools.sh mksurfdata tools__s namelist ..............................................FAIL! rc= 7 -084 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 6 -086 bl754 TBLtools.sh mksurfdata tools__s globalirrig ...........................................FAIL! rc= 6 -088 bl756 TBLtools.sh mksurfdata tools__s pftdyn ................................................FAIL! rc= 7 -093 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -094 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -095 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 4 -096 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 -097 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: All PASS except: -008 blA92 TBL.sh _sc_dm clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 5 -011 blD91 TBL.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 5 -033 blH52 TBL.sh 17p_cnnsc_dm clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 48 cold .........FAIL! rc= 5 -034 smJ92 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 96 cold ...............FAIL! rc= 10 -035 erJ92 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 10+38 cold ............FAIL! rc= 5 -036 brJ92 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 4x5 gx3v5 72+72 cold .........FAIL! rc= 5 -037 blJ92 TBL.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 48 cold ...............FAIL! rc= 4 -041 blL51 TBL.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 5 -048 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -049 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -052 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 8 -053 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_33 - -Changes answers relative to baseline: No, bit for bit - -=============================================================== -=============================================================== -Tag name: clm3_6_33 -Originator(s): erik (erik) -Date: Thu Apr 16 14:45:23 MDT 2009 -One-line Summary: Bring in dynpft changes from cbgc branch - -Purpose of changes: New method for dealing with dynamic land-use changes - - morph routine casa() in casa_ecosystemDyn(), so casa is more similar to CN & DGVM, - and prepares casa code for adding additional carbon flux functionality. - Larger plan is to duplicate these and other mods from casafire branch on this branch. - Add new method for conserving heat & water wrt dynamic land use. - Conserves heat & water for any change in the land-unit, column, or pft arrangment. - when pftdyn is activated, "normalize" sum of new pft weights in a column - to be the same as the sum of the old pft weights - otherwise BalanceCheck will generate water/heat balance errors. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 927 (problem with urban on bangkok/lahey) - 934 (pftdyn logic bug) - 941 (RTM output 6X too low) - 974 (bug in pftdyn mode) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: - B. Kauffman, D. Lawrence, G. Bonan, K. Oleson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - - D biogeochem/CASASummary.F90 ................ code relocated inside CASAMod.F90 - -List all files added and what they do: - - A main/dynlandMod.F90 ............... new routine is here - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>> models/lnd/clm/src - M biogeochem/CASAMod.F90 .......... Add in CASASummary.F90, add casa_recosystemDyn subroutine - M main/pftdynMod.F90 .............. when pftdyn is active, "normalize" pft weights in a column - M biogeophys/BalanceCheckMod.F90 .. improved imbalance write statement - M main/driver.F90 ................. CASAsummary, CASAPhenology now called in - casa_ecocsystemDyn() - M main/initSurfAlbMod.F90 ......... casa() renamed casa_ecocsystemDyn() - M main/driver.F90 ......... call new routine here - M main/clmtype.F90 ......... define new fields - M main/clmtypeInitMod.F90 ......... init new fields - M main/histFldsMod.F90 ......... put new fields on hist file - M main/clm_atmlnd.F90 ......... heat imbalance is applied here - (to latent heat flux) - M riverroute/RtmMod.F90 ......... water imbalance is applied here (to runoff) - -Summary of testing: - - bluefire: All PASS except pftdyn TBL tests and ... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -069 smJ61 TSM.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -070 erJ61 TER.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -071 brJ61 TBR.sh 4p_casasc_dh clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -093 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -094 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -095 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 4 -096 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 -097 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - jaguar: All PASS except -005 smA91 TSM.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -006 erA91 TER.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -007 brA91 TBR.sh _sc_dh clm_urb^nl_urb_br 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -009 smE92 TSM.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 96 arb_ic ............FAIL! rc= 10 -010 erE92 TER.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 10+38 arb_ic .........FAIL! rc= 5 -011 brE92 TBR.sh 4p_vodsrsc_dm clm_urb^nl_urb_br 19981230:NONE:1800 4x5 gx3v5 72+72 arb_ic ......FAIL! rc= 5 -013 smEH2 TSM.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 10 -014 erEH2 TER.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 5 -015 brEH2 TBR.sh 4p_vodsrsc_dm clm_urb^nl_urb_br 19981231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 5 -021 smH92 TSM.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 96 cold .............FAIL! rc= 10 -022 erH92 TER.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 10+38 cold ..........FAIL! rc= 5 -023 brH92 TBR.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 72+72 cold ..........FAIL! rc= 5 -025 smJ62 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -026 erJ62 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -027 brJ62 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -034 smLI2 TSM.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -035 erLI2 TER.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -036 brLI2 TBR.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -038 erP65 TSM_ccsmseq.sh ERS f19_g15 I ..........................................................FAIL! rc= 4 -039 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - lightning/pathscale: All PASS except pftdyn TBL tests and ... -011 erA91 TER.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 7 -012 brA91 TBR.sh _sc_dh clm_urb^nl_urb_br 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -018 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -019 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -020 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -022 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -023 smJ42 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 10x15 USGS 96 cold ..............FAIL! rc= 10 -024 erJ42 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 10x15 USGS 10+38 cold ...........FAIL! rc= 5 -025 brJ42 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 10x15 USGS 72+72 cold ........FAIL! rc= 5 -027 smL51 TSM.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -028 erL51 TER.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -029 brL51 TBR.sh _sc_dh clm_urb^nl_urb_br 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -036 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -037 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -038 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 - bangkok/lf95: All PASS except pftdyn TBL tests and ... -005 smA92 TSM.sh _sc_dm clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -006 erA92 TER.sh _sc_dm clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -007 brA92 TBR.sh _sc_dm clm_urb^nl_urb_br 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -009 smD91 TSM.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 10 -010 erD91 TER.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 72+72 cold ...............FAIL! rc= 5 -030 smH52 TSM.sh 17p_cnnsc_dm clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 96 cold .........FAIL! rc= 10 -031 erH52 TER.sh 17p_cnnsc_dm clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 10+38 cold ......FAIL! rc= 5 -032 brH52 TBR.sh 17p_cnnsc_dm clm_urb^nl_urb_br 19980115:NONE:1800 10x15 USGS@2000 72+72 cold ...FAIL! rc= 5 -034 smJ92 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 96 cold ...............FAIL! rc= 10 -035 erJ92 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 10+38 cold ............FAIL! rc= 5 -036 brJ92 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 4x5 gx3v5 72+72 cold .........FAIL! rc= 5 -038 smL51 TSM.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -039 erL51 TER.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -040 brL51 TBR.sh _sc_dh clm_urb^nl_urb_br 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -048 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -049 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -052 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 8 -053 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze/gale/hail/gust/ifort: All PASS - -CLM tag used for the baseline comparison tests if applicable: clm3_6_33 - -Changes answers relative to baseline: Only for pftdyn mode - -=============================================================== -================================================================================ -Tag name: clm3_6_32 -Originator(s): dlawren, erik, jet -Date: Fri Apr 10 14:38:52 MDT 2009 -One-line Summary: Add irrigation area to mksrfdata, fix high-res and pftdyn problems - -Purpose of changes: Add irrigation area to mksrfdat tool, for irrigated area copy PFT=15 LAI and heights - into PFT=16, PFT=15 is unirrigated crop, PFT=16 is irrigated crop - fix pftdyn mode for mksurfdata (erik), bug fixes to mksurfdata from John Truesdale - script changes to make gx1v6 default. - -Bugs fixed (include bugzilla ID): 919 (pftdyn mode in mksurfdata) - 821 (problems running mksurfdata at high-res) - 357 (codes replicated in tools) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 920 (glacier_mec problems in mksurfdata) - 926 (pftdyn code needs to be shared in mksurfdata) - 927 (problem with urban on bangkok/lahey) - 934 (pftdyn logic bug) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Building with PIO is on by default - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: gx1v6 for and 0.47 res - fix 5x5_amazon surface dataset. - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, jet, dlawren - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm7, -csm_share, esmf_wrf_timemgr - - scripts to scripts4_090406 - drv to vocemis-drydep08_drvseq3_0_13 - datm7 to datm7_090403 - csm_share to share3_090407 - timemgr to esmf_wrf_timemgr_090402 - -List all files eliminated: Remove text urban input files, globalurban mksurf namelist -- -as urban is default. - -D models/lnd/clm/bld/urban_input/metropolis_fluxes.txt -D models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.txt -D models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.txt -D models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.txt -D models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.txt -D models/lnd/clm/tools/mksurfdata/mksurfdata.globalurban - -List all files added and what they do: - -A models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850-2005.txt . List of dynamic PFT files from 1850 to 2005 -A models/lnd/clm/tools/mksurfdata/pftdyn_simyr1850.txt ...... Dynamic PFT file for 1850 -A models/lnd/clm/tools/mksurfdata/pftdyn_simyr2000.txt ...... Dynamic PFT file for 2000 -A models/lnd/clm/tools/mksurfdata/mkirrig.F90 ............... calculates irrigated area from irrigated area on input dataset -A models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig .... namelist file pointing to irrigated area source file -A models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml datm namelist info -A models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml drv namelist info - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>> Add firrig option, fix bugs, fix pftdyn mode -M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 .............. Add mksrf_firrig -M models/lnd/clm/tools/mksurfdata/mklaiMod.F90 .............. Copy LAI in PFT=15 into PFT=16 if mksrf_irrig /= '' - use standard averaging for pftdyn -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 ............. Add mksrf_firrig -M models/lnd/clm/tools/mksurfdata/README -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 .............. Add pct_irr to surface dataset if mksrf_irrig /= '' -M models/lnd/clm/tools/mksurfdata/Srcfiles -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 .............. Adjust PCT_PFT for non-irrigated (PFT=15) and irrigted (PFT=16) crops -M models/lnd/clm/tools/mksurfdata/mkglcmec.F90 .............. Check for divide by zero (JT) -M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 .............. Initialize files to blank -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 ............. Only output data needed for pftdyn files -M models/lnd/clm/tools/mksurfdata/mkorganic.F90 ............. Allocate bug-fix (JT) -M models/lnd/clm/tools/mksurfdata/mkurban.F90 ............... bug-fix (JT) -M models/lnd/clm/tools/mksurfdata/areaMod.F90 ............... bug-fix (JT) -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 .............. add mkirrig, changes for pftdyn -M models/lnd/clm/tools/mksurfdata/Srcfiles .................. add mkirrig.F90 -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 .............. if firrig => irrig/non-irrig crops ->>>>>>>>>>>>>>> Always create files using the transient input raw datasets -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl -M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist -M models/lnd/clm/tools/mksurfdata/mksurfdata.regional -M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept -M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist ->>>>>>>>>>>>>>> Add needed fields (mask, LANDMASK) to urban datasets -M models/lnd/clm/tools/ncl_scripts/addgrid2spointurban.ncl ->>>>>>>>>>>>>>> Turn pio on, work with defaults -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/config_files/config_definition.xml -M models/lnd/clm/bld/run-ibm.csh -M models/lnd/clm/bld/clm.cpl7.template -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ->>>>>>>>>>>>>>> Add mask,PCT_URBAN and LANDMASK to urban point input files -M models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.nc ..... Add mask -M models/lnd/clm/bld/urban_input/metropolis_fluxes.nc ....... Add mask -M models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.nc ..... Add mask -M models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.nc .... Add mask -M models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.nc .... Changes from Keith, add mask ->>>>>>>>>>>>>>> -M models/lnd/clm/test/system/tests_pretag_bluefire - add pftdyn test -M models/lnd/clm/test/system/test_driver.sh -------- use beta14 -M models/lnd/clm/test/system/input_tests_master ---- fix TBR tests, -M models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh - remove eshr -M models/lnd/clm/test/system/TSM.sh ---------------- fix -M models/lnd/clm/test/system/tests_pretag_bangkok -- put some serial tests first -M models/lnd/clm/test/system/CLM_runcmnd.sh -------- remove bluesky ->>>>>>>>>>>>>>> Always use T_REF2M NOT t_ref2m -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 - -Summary of testing: - - bluefire: All PASS except -004 blA74 TBL.sh _sc_ds clm_urb^nl_urb 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ............FAIL! rc= 5 -009 blA91 TBL.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 5 -012 blD91 TBL.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 7 -014 blH74 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 cold ........FAIL! rc= 5 -019 blE91 TBL.sh 4p_vodsrsc_dh clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 48 arb_ic ............FAIL! rc= 5 -024 blF92 TBL.sh 17p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 5 -028 blF93 TBL.sh 17p_vodsrsc_do clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 48 cold .............FAIL! rc= 5 -032 blEH1 TBL.sh 4p_vodsrsc_dh clm_urb^nl_urb 19981231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 5 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -041 blCA4 TBL.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 7 -043 blCA8 TBL.sh _sc_ds clm_urb^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 7 -047 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 7 -051 blC61 TBL.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v6 48 cold .................FAIL! rc= 7 -055 blH51 TBL.sh 17p_cnnsc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 48 cold .........FAIL! rc= 5 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -060 blLI1 TBL.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -062 blL78 TBL.sh _sc_s clm_urb^nl_urb 19971231:NONE:1800 1x1_brazil navy -10 arb_ic .............FAIL! rc= 5 -065 smL83 TSM.sh _sc_do clm_urb^nl_urb 19980115:NONE:3600 5x5_amazon navy -10 arb_ic ............FAIL! rc= 10 -066 erL83 TER.sh _sc_do clm_urb^nl_urb 19980115:NONE:3600 5x5_amazon navy -5+-5 arb_ic ..........FAIL! rc= 5 -067 brL83 TBR.sh _sc_do clm_urb^nl_urb_br 19980115:NONE:3600 5x5_amazon navy -10+-10 arb_ic .....FAIL! rc= 5 -068 blL83 TBL.sh _sc_do clm_urb^nl_urb 19980115:NONE:3600 5x5_amazon navy -10 arb_ic ............FAIL! rc= 4 -069 smJ61 TSM.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -070 erJ61 TER.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -071 brJ61 TBR.sh 4p_casasc_dh clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -072 blJ61 TBL.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 4 -073 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v6 48 arb_ic .....FAIL! rc= 10 -077 blJ74 TBL.sh 4p_casasc_ds clm_urb^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic ..FAIL! rc= 5 -084 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 6 -086 bl754 TBLtools.sh mksurfdata tools__s globalirrig ...........................................FAIL! rc= 6 -088 bl756 TBLtools.sh mksurfdata tools__s pftdyn ................................................FAIL! rc= 7 -093 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -094 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -095 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 4 -096 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 4 -097 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 4 - jaguar: ALL FAIL except -029 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v6 48 arb_ic .....PASS - breeze/pathscale: All PASS - bangkok/lahey: All PASS except -005 smA92 TSM.sh _sc_dm clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -006 erA92 TER.sh _sc_dm clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -007 brA92 TBR.sh _sc_dm clm_urb^nl_urb_br 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -009 smD91 TSM.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 144 cold .................FAIL! rc= 10 -010 erD91 TER.sh _persc_dh clm_per^nl_urb 19981231:NONE:1200 4x5 gx3v5 72+72 cold ...............FAIL! rc= 5 -014 erCA4 TER.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ......FAIL! rc= 7 -030 smH52 TSM.sh 17p_cnnsc_dm clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 96 cold .........FAIL! rc= 10 -031 erH52 TER.sh 17p_cnnsc_dm clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS@2000 10+38 cold ......FAIL! rc= 5 -032 brH52 TBR.sh 17p_cnnsc_dm clm_urb^nl_urb_br 19980115:NONE:1800 10x15 USGS@2000 72+72 cold ...FAIL! rc= 5 -034 smJ92 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 96 cold ...............FAIL! rc= 10 -035 erJ92 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 10+38 cold ............FAIL! rc= 5 -036 brJ92 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 4x5 gx3v5 72+72 cold .........FAIL! rc= 5 -038 smL51 TSM.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -039 erL51 TER.sh _sc_dh clm_urb^nl_urb 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -040 brL51 TBR.sh _sc_dh clm_urb^nl_urb_br 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -052 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 8 -053 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_30 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_6_31 -Originator(s): erik (erik) -Date: Wed Apr 1 00:58:15 MDT 2009 -One-line Summary: New surface datasets for 1850,2000, support for 0.9x1.25_gx1v6, urban always on. New pft-physiology file. Update scripts so remove some CLM_ env_conf vars. Fix CN for urban/pftdyn. - -Purpose of changes: - -New surface datasets for 1850,2000. sim_year can be 1850 or 2000 -(1870 no longer supported), support for 0.9x1.25_gx1v6. Demand furbinp (urban always on), -wasteheat='ON_WASTEHEAT' by default. Change cpl7 template so can either do a cold start -or require a finidat file (cold or startup). New pft-physiology file for CN used by -everything. Update scripts so remove some CLM_ env_conf vars: CLM_BGC, CLM_DYNNDEP, -CLM_DYNPFT, CLM_CO2_TYPE, remove CLMNCEP from scripts/datm (keeping CLM_QIAN mode). -Change final CN loop to go over soil filter -- so CN,CASA,DGVM can work with urban. -Remove traffic_flux array as it's subscript was out of bounds on breeze. lnd_comp_mct -changed so that check for spval allows for rounding of spval. - -Bugs fixed (include bugzilla ID): 904 (I cases start in 2003 rather than 1948) - 897 (string comparision in scripts) - 357 (remove duplicated files in tools) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 919 (problems in mksurfdata for pftdyn mode) - 920 (glacier_mec problems in mksurfdata) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Add -pio option to configure - Will set the BUILDPIO CPP token as well as adding pio source to Filepath. - -Describe any changes made to the namelist: Add pio_inparm namelist when -pio - was set in configure - -List any changes to the defaults for the boundary datasets: - New 1850 and 2000 surface datasets with urban enabled for most resolutions - Also new 1850 and 2000 finidat files for 1.9x2.5 resolution (other finidat files removed) - -Describe any substantial timing or memory changes: None - -Code reviewed by: Peter Thornton, Keith Oleson, Forrest Hoffman - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm, csm_share, mct, pio - - scripts4_090325 - datm7_090325 - vocemis-drydep11_share3_090112 - CT2_6_0_090308 - pio28_prod - -List all files eliminated: - ->>>>>>>>>>>>>> Remove DGVM namelist tests. -D models/lnd/clm/test/system/config_files/10p_dgvmsc_h -D models/lnd/clm/test/system/config_files/10p_dgvmsc_m -D models/lnd/clm/test/system/config_files/10p_dgvmsc_o -D models/lnd/clm/test/system/config_files/10p_dgvmsc_s -D models/lnd/clm/test/system/config_files/10p_dgvmsc_dh -D models/lnd/clm/test/system/config_files/10p_dgvmsc_dm -D models/lnd/clm/test/system/config_files/10p_dgvmsc_do - ->>>>>>>>>>>>>> Remove script that creates ASCII global data for urban. -D models/lnd/clm/tools/ncl_scripts/generate_ascii_avg_urbanparam_file_p7.ncl - ->>>>>>>>>>>>>> Remove modules replicated in mkgriddata by mksurfdata modules ->>>>>>>>>>>>>> use the versions in mksurfdata. -D models/lnd/clm/tools/mkgriddata/ncdio.F90 -D models/lnd/clm/tools/mkgriddata/domainMod.F90 -D models/lnd/clm/tools/mkgriddata/areaMod.F90 - -List all files added and what they do: - ->>>>>>>>>>>>>> Add point datasets that now have urban information in them. -A models/lnd/clm/bld/urban_input/surfdata_1x1_tropicAtl_urb3den_simyr2000_c090320.nc -A models/lnd/clm/bld/urban_input/surfdata_1x1_brazil_urb3den_simyr2000_c090320.nc -A models/lnd/clm/bld/urban_input/surfdata_1x1_brazil_urb3den_simyr1850_c090317.nc - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Make most tests with urban, remove dgvm tests -M models/lnd/clm/test/system/tests_pretag_bluefire -M models/lnd/clm/test/system/config_files/README -M models/lnd/clm/test/system/tests_pretag_jaguar -M models/lnd/clm/test/system/tests_pretag_bangkok -M models/lnd/clm/test/system/test_driver.sh -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -M models/lnd/clm/test/system/tests_posttag_purempi_regression -M models/lnd/clm/test/system/nl_files/clm_per -M models/lnd/clm/test/system/nl_files/clm_per0 -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/test/system/tests_posttag_lightning - ->>>>>>>>>>>>>> Add all_urban mode for single-point mode -M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 -M models/lnd/clm/tools/mksurfdata/ncdio.F90 -M models/lnd/clm/tools/mksurfdata/mkglacier.F90 -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 -M models/lnd/clm/tools/mksurfdata/mklanwat.F90 -M models/lnd/clm/tools/mksurfdata/mkurban.F90 -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -M models/lnd/clm/tools/mksurfdata/mksurfdata.pl -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 - ->>>>>>>>>>>>>> Add pio option to configure, and if set add pio_inparm namelist ->>>>>>>>>>>>>> Datasets to 1850/2000 and most with urban. -M models/lnd/clm/bld/configure ------------- Add pio option -M models/lnd/clm/bld/config_files/config_definition.xml - Add pio to config_cache.xml -M models/lnd/clm/bld/clm.cpl7.template ----- require furbinp, remove CLM_ env vars -M models/lnd/clm/bld/build-namelist -------- make sure sim_year sent in, change - some names etc. -M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Add pio_inparm -M models/lnd/clm/bld/namelist_files/datm.streams.template.xml -- Remove CLM_NCEP -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- urban datasets - for most resolutions, datasets for 1850 and 2000, remove most finidat - ->>>>>>>>>>>>>> Add data from grid files as well as LANDMASK and PCT_URBAN. -M models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.nc -M models/lnd/clm/bld/urban_input/metropolis_fluxes.nc -M models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.nc -M models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.nc -M models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.nc - ->>>>>>>>>>>>>> Changes from Forrest H./Peter T. to fix some CN problems (single-point, pftdyn) -M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/main/driver.F90 -M models/lnd/clm/src/main/pftdynMod.F90 -M models/lnd/clm/src/main/lnd_comp_mct.F90 --------- Change from Mark Flanner - to fix roundoff issues for aerosols. -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------- Remove traffic_flux as subscript - bounds was being exceeded on breeze. - -Summary of testing: - - bluefire: All PASS except TBL and... -023 brF92 TBR.sh 17p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 72+72 cold ..........FAIL! rc= 13 -027 brF93 TBR.sh 17p_vodsrsc_do clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 72+72 cold ..........FAIL! rc= 13 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -065 smL83 TSM.sh _sc_do clm_urb^nl_urb 19980115:NONE:3600 5x5_amazon navy -10 arb_ic ............FAIL! rc= 10 -066 erL83 TER.sh _sc_do clm_urb^nl_urb 19980115:NONE:3600 5x5_amazon navy -5+-5 arb_ic ..........FAIL! rc= 5 -067 brL83 TBR.sh _sc_do clm_urb^nl_urb_br 19980115:NONE:3600 5x5_amazon navy -10+-10 arb_ic .....FAIL! rc= 5 -069 smJ61 TSM.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -070 erJ61 TER.sh 4p_casasc_dh clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -071 brJ61 TBR.sh 4p_casasc_dh clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -076 brJ74 TBR.sh 4p_casasc_ds clm_urb^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic .FAIL! rc= 13 - jaguar: All PASS except TBL and... -005 smA91 TSM.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ...................FAIL! rc= 10 -006 erA91 TER.sh _sc_dh clm_urb^nl_urb 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic ................FAIL! rc= 5 -007 brA91 TBR.sh _sc_dh clm_urb^nl_urb_br 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .............FAIL! rc= 5 -009 smE92 TSM.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 96 arb_ic ............FAIL! rc= 10 -010 erE92 TER.sh 4p_vodsrsc_dm clm_urb^nl_urb 19981230:NONE:1800 4x5 gx3v5 10+38 arb_ic .........FAIL! rc= 5 -011 brE92 TBR.sh 4p_vodsrsc_dm clm_urb^nl_urb_br 19981230:NONE:1800 4x5 gx3v5 72+72 arb_ic ......FAIL! rc= 5 -017 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -018 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 10+38 arb_ic ................FAIL! rc= 5 -019 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -025 smJ62 TSM.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 10 -026 erJ62 TER.sh 4p_casasc_dm clm_urb^nl_urb 19981230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 5 -027 brJ62 TBR.sh 4p_casasc_dm clm_urb^nl_urb_br 19981230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 5 -029 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v5 48 startup ....FAIL! rc= 10 -030 smJ74 TSM.sh 4p_casasc_ds clm_urb^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic .FAIL! rc= 10 -031 erJ74 TER.sh 4p_casasc_ds clm_urb^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic FAIL! rc= 5 -032 brJ74 TBR.sh 4p_casasc_ds clm_urb^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic .FAIL! rc= 5 -034 smLI2 TSM.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -035 erLI2 TER.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -036 brLI2 TBR.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -039 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 7 - bangkok/lf95: All PASS except TBL - breeze/gale/hail/gust/ifort: All PASS - -TBL tests are different since most tests are now with urban. - -Most of the fails are due to missing files. - -CLM tag used for the baseline comparison tests if applicable: clm3_6_30 - -Changes answers relative to baseline: Yes for CN -- new pft-physiology file - -=============================================================== -=============================================================== -Tag name: clm3_6_30 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Thu Mar 19 20:44:33 MDT 2009 -One-line Summary: Fix urban roof/wall layers - -Purpose of changes: Fix urban roof/wall layers - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Me - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/main/iniTimeConst.F90 ---- divide roof/wall thickness by nlevurb instead of nlevsoi - -Summary of testing: - - bluefire: All urban testing passed except TBL - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_29 - -Changes answers relative to baseline: Urban only - -=============================================================== -=============================================================== -Tag name: clm3_6_29 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Thu Mar 19 07:16:05 MDT 2009 -One-line Summary: CN SAI, CN testing fix, rad step size fix - -Purpose of changes: Add SAI decay for CN mode. - Fix CN for tests SmI58, smH51, erH51, brH51 - Add new get_rad_step_size function used by SAI decay function. This is the "simple fix" - and yields correct radiation time step size for all time steps except one for the I and F - cases. The "complete fix" involves changes to other component models and will be available soon. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: K. Oleson, G. Bonan, F. Hoffman, M. Vertenstein, J. Truesdale - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/biogeochem/CNrestMod.F90 --- add seven CN fields deleted previously for restart -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 ---- add SAI decay function (calls get_rad_step_size) -M models/lnd/clm/src/main/clm_time_manager.F90 ---- changes to fix get_rad_step_size function -M models/lnd/clm/src/main/lnd_comp_mct.F90 ---- changes to fix get_rad_step_size function - -Summary of testing: - - bluefire: All PASS except: -013 smH74 TSM.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -1100 cold .......FAIL! rc= 10 -014 blH74 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 cold ........FAIL! rc= 4 -020 smE95 TSM.sh 4p_vodsrsc_h clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ....................FAIL! rc= 10 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -055 blH51 TBL.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@2000 48 cold ................FAIL! rc= 7 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -060 blLI1 TBL.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -096 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -097 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -098 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -099 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 6 -100 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - -smH74 and blH74 failures are being investigated. -blH51 fails because it fails in clm3_6_28 (fixed in this commit). -Other failures are known. - - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_28 - -Changes answers relative to baseline: CN mode only due to SAI decay factor - -=============================================================== -=============================================================== -Tag name: clm3_6_28 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Tue Mar 17 07:03:12 MDT 2009 -One-line Summary: Fix permission denied error when reading surface dataset - -Purpose of changes: Change nf_open statement in UrbanInputMod.F90 - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Erik K. - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 ---- don't use getavu for nf_open - -Summary of testing: - - bluefire: All PASS except for: -013 smH74 TSM.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -1100 cold .......FAIL! rc= 10 -014 blH74 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 cold ........FAIL! rc= 4 -020 smE95 TSM.sh 4p_vodsrsc_h clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ....................FAIL! rc= 10 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -051 blC61 TBL.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 48 cold .................FAIL! rc= 5 -053 erH51 TER.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@2000 10+38 cold .............FAIL! rc= 7 -054 brH51 TBR.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@2000 72+72 cold .............FAIL! rc= 6 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -060 blLI1 TBL.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -096 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -097 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -098 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -099 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 6 -100 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - -sm74, blH74, smI58 are known failures related to CN and are being investigated. -blC61 fails because clm3_6_27 fails (fixed in this tag). -Other failures are known. - - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_27 - -Changes answers relative to baseline: bfb - -=============================================================== -=============================================================== -Tag name: clm3_6_27 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Mon Mar 16 10:52:05 MDT 2009 -One-line Summary: Urban model changes and FGR12 fix - -Purpose of changes: Fix large urban saturation excess runoff. - Limit urban dew formation. - Change FGR12 diagnostic. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: Not tested - -Code reviewed by: K. Oleson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 ---- change eflx_fgr12 diagnostic -M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 ---- limit urban dew formation and calculate - pervious road qred over nlevsoi, not nlevurb -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 ---- prevent large saturation excess due to - ponded ice - -Summary of testing: - - bluefire: All PASS tests_pretag_bluefire except TBL and : -013 smH74 TSM.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -1100 cold .......FAIL! rc= 10 -020 smE95 TSM.sh 4p_vodsrsc_h clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ....................FAIL! rc= 10 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -048 smC61 TSM.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 -6 cold .................FAIL! rc= 10 -049 erC61 TER.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 10+38 cold ..............FAIL! rc= 5 -050 brC61 TBR.sh _sc_dh clm_urb^nl_urb_br 19981001:NONE:1800 1.9x2.5 gx1v5 -3+-3 cold ...........FAIL! rc= 5 -053 erH51 TER.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@2000 10+38 cold .............FAIL! rc= 7 -054 brH51 TBR.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@2000 72+72 cold .............FAIL! rc= 6 -056 smI58 TSMcnspinup.sh 17p_cnadspinupsc_dh 17p_cnexitspinupsc_dh 17p_cnsc_dh clm_std 19980115:NONEFAIL! rc=5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -096 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -097 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -098 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -099 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 6 -100 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - -smH74 and smI58 are CN-related tests that did not fail in clm3_6_25, but fail in clm3_6_26 and in this tag and -thus should be investigated further. -smC61, erC61, brC61 fail because of permission denied when reading surface dataset. This appears to be a test -suite problem only. - - jaguar: - kraken: - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: clm3_6_26 - -Changes answers relative to baseline: Urban answers change because of runoff fix. - Standard mode answers only change in FGR12 diagnostic. - -=============================================================== -=============================================================== -Tag name: clm3_6_26 -Originator(s): Peter Thornton -Date: 3/14/09 -One-line Summary: CN time step and restart file changes - -Purpose of changes: shorten CN restart file. Requires moving CLM to physical model timestep. - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: nonee - -Describe any substantial timing or memory changes: CLM restart file reduced in size by ~factor of 3. - -Code reviewed by: Forrest Hoffman - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNFireMod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNMRespMod.F90 - change q10 -M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 - remove reference to retransn -M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNDecompMod.F90 - change q10 -M models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNrestMod.F90 - eliminate many CN variables -M models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 - change time step, and cleanup some variable names -M models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 - change time step -M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 - cleanup variable names -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - change time step -M models/lnd/clm/src/main/CNiniTimeVar.F90 - cleanup variable names -M models/lnd/clm/src/main/driver.F90 - change time step -M models/lnd/clm/src/main/clmtypeInitMod.F90 - cleanup variable names -M models/lnd/clm/src/main/pftdynMod.F90 - change time step -M models/lnd/clm/src/main/clm_time_manager.F90 - change time step -M models/lnd/clm/src/main/clmtype.F90 - cleanup variable names -M models/lnd/clm/src/main/histFldsMod.F90 - cleanup variable names - -Summary of testing: - - bluefire: - jaguar: - Ran the CLM test suite, with the following results: -smA74 TSM.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................PASS -erA74 TER.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................PASS -brA74 TBR.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................PASS -blA74 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................SKIPPED* -smA91 TSM.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ..........................PASS -erA91 TER.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 7 (passes with 512 tasks) -brA91 TBR.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 6 (passes with 512 tasks) -blA91 TBL.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ..........................SKIPPED* -smE92 TSM.sh 4p_vodsrsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 96 arb_ic ...................PASS -erE92 TER.sh 4p_vodsrsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 10+38 arb_ic ................PASS -brE92 TBR.sh 4p_vodsrsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 72+72 arb_ic ................PASS -blE92 TBL.sh 4p_vodsrsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 48 arb_ic ...................SKIPPED* -smEH2 TSM.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 1.9x2.5^0.9x1.25 USGS 48 arb_ic .......PASS -erEH2 TER.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 1.9x2.5^0.9x1.25 USGS 10+38 arb_ic ....PASS -brEH2 TBR.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 1.9x2.5^0.9x1.25 USGS 24+24 arb_ic ....PASS -blEH2 TBL.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 1.9x2.5^0.9x1.25 USGS 48 arb_ic .......SKIPPED* -smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 10+38 arb_ic ................FAIL! rc= 5 -brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................SKIPPED* -smH92 TSM.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 96 cold .............PASS -erH92 TER.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 10+38 cold ..........PASS -brH92 TBR.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 72+72 cold ..........PASS -blH92 TBL.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@2000 48 cold .............SKIPPED* -smJ62 TSM.sh 4p_casasc_dm clm_std 19981230:NONE:1800 1.9x2.5 gx1v5 96 startup ...............PASS -erJ62 TER.sh 4p_casasc_dm clm_std 19981230:NONE:1800 1.9x2.5 gx1v5 10+38 startup ............PASS -brJ62 TBR.sh 4p_casasc_dm clm_std 19981230:NONE:1800 1.9x2.5 gx1v5 72+72 startup ............PASS -blJ62 TBL.sh 4p_casasc_dm clm_std 19981230:NONE:1800 1.9x2.5 gx1v5 48 startup ...............SKIPPED* -smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v5 48 startup ....FAIL! rc= 10 -smJ74 TSM.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic ........PASS -erJ74 TER.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic ......PASS -brJ74 TBR.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic ........PASS -blJ74 TBL.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic .........SKIPPED* -smK92 TSM.sh 10p_dgvmsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 96 arb_ic ...................PASS -erK92 TER.sh 10p_dgvmsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 10+38 arb_ic ................PASS -brK92 TBR.sh 10p_dgvmsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 72+72 arb_ic ................PASS -blK92 TBL.sh 10p_dgvmsc_dm clm_std 19981230:NONE:1800 4x5 gx3v5 48 arb_ic ...................SKIPPED* -smLI2 TSM.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -erLI2 TER.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -brLI2 TBR.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -blLI2 TBL.sh _sc_dm clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................SKIPPED* -erP65 TSM_ccsmseq.sh ERS f19_g15 I ..........................................................PASS -erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................PASS kraken: - -Note: the tests that FAIL here are the same that FAIL on jaguar with clm3_6_25. - - lightning/pathscale: - bangkok/lf95: - breeze/gale/hail/gust/ifort: - -CLM tag used for the baseline comparison tests if applicable: - -Changes answers relative to baseline: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - q10 changes are climate changing. Time step changes are larger than roundoff, similar climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm3_6_25 -Originator(s): dlawren (Lawrence David 1384 CGD), erik (Kluzek Erik), tcraig (Craig Tony) -Date: Fri Mar 13 15:11:01 MDT 2009 -One-line Summary: Daylength control on Vcmax, 1%Lake,wetland,glacier in mksrfdat, remove ELEVATION in surface data file - -Purpose of changes: Include changes from Peter Thornton to include daylength control -on vcmax in photosynthesis scheme; Set minimum lake, wetland, and glacier area to 1% -to be more consistent with urban and to represent more lakes and wetlands; remove -temporary unused ELEVATION field from surface dataset - -Bugs fixed (include bugzilla ID): 877 (CN restart problem) - 911 (high PE count problem) - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: New global urban datasets 10x15 and 1.9x2.5 resolutions - -Describe any substantial timing or memory changes: None - -Code reviewed by: David Lawrence (code), Erik Kluzek (testing and build), Tony Craig (DecompInitMod.F90) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, mct, datm - - scripts to scripts4_090310 - datm7 to datm7_090229 - mct to MCT2_6_0_090308 - -List all files eliminated: None - -List all files added and what they do: - -A models/lnd/clm/test/system/config_files/tools__s ..... Optimized serial mode for tools - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/tools/mksurfdata/mkglcmec.F90 ..... correct bug in error check -M models/lnd/clm/tools/mksurfdata/mkglacier.F90 .... reduce min glacier frac from 5 to 1% -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 .... remove ELEVATION field -M models/lnd/clm/tools/mksurfdata/mklanwat.F90 ..... reduce min lake,wetland frac from 5 to 1% -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ..... remove ELEVATION field -M models/lnd/clm/tools/mksurfdata/README ........... add documentation about being slow unless use OPT=TRUE in gmake -M models/lnd/clm/src/main/decompInitMod.F90 ........ Changes from Tony Craig to fix for high PE counts -M models/lnd/clm/src/main/clm_comp.F90 ............. daylength control on vcmax changes -M models/lnd/clm/src/main/driver.F90 ............... daylength control on vcmax changes -M models/lnd/clm/src/main/clmtypeInitMod.F90 ....... daylength control on vcmax changes -M models/lnd/clm/src/main/iniTimeConst.F90 ......... daylength control on vcmax changes -M models/lnd/clm/src/main/clmtype.F90 .............. daylength control on vcmax changes -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 daylength control on vcmax changes - -M models/lnd/clm/test/system/test_driver.sh ........ update to beta10, fix some issues on jaguar -M models/lnd/clm/test/system/input_tests_master .... do most mksurfdata testing optimized - change CN tests to cold-starts, change 1890 to 1870 - -M models/lnd/clm/bld/build-namelist ................ pass sim_year and maxpft in when determining default for finidat -M models/lnd/clm/bld/clm.cpl7.template ............. add in ignore logic like cam -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml . update input files - -Summary of testing: - - bluefire: All PASS except TBL and... -020 smE95 TSM.sh 4p_vodsrsc_h clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ....................FAIL! rc= 10 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -052 smH51 TSM.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@1890 96 cold ................FAIL! rc= 8 -053 erH51 TER.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@1890 10+38 cold .............FAIL! rc= 5 -054 brH51 TBR.sh 17p_cnnsc_dh clm_std 19980115:NONE:1800 10x15 USGS@1890 72+72 cold .............FAIL! rc= 5 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -096 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -097 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -098 erP61 TSM_ccsmseq.sh ERS f19_g15 I4804 ......................................................FAIL! rc= 6 -099 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 6 -100 erP68 TSM_ccsmseq.sh ERS f19_g15 ICASA ......................................................FAIL! rc= 6 - jaguar: Limited testing... - lightning/pathscale: All PASS except TBL and... -002 smCA4 TSM.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 10 -003 erCA4 TER.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ......FAIL! rc= 5 -004 brCA4 TBR.sh _sc_ds clm_urb^nl_urb_br 19981001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic ...FAIL! rc= 5 -006 smOC4 TSM.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 10 -007 erOC4 TER.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_icFAIL! rc= 5 -008 brOC4 TBR.sh _vansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arb_iFAIL! rc= 5 -011 erA91 TER.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 7 -012 brA91 TBR.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 6 -019 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 7 -020 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 6 -024 erJ42 TER.sh 4p_casasc_dm clm_std 19981230:NONE:1800 10x15 USGS 10+38 startup ...............FAIL! rc= 7 -025 brJ42 TBR.sh 4p_casasc_dm clm_std 19981230:NONE:1800 10x15 USGS 72+72 startup ...............FAIL! rc= 6 -027 smK51 TSM.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -028 erK51 TER.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -029 brK51 TBR.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 72+72 arb_ic ...............FAIL! rc= 5 -032 erL51 TER.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ......................FAIL! rc= 7 -033 brL51 TBR.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ......................FAIL! rc= 6 -040 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -041 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -042 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804 ....................................................FAIL! rc= 5 - breeze/gale/hail/gust/ifort: All PASS except TBL - -CLM tag used for the baseline comparison tests if applicable: clm3_6_24 - -Changes answers relative to baseline: Yes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: similar climate - - Dave Lawrence ran a short simulation to show that answers do NOT change significantly - -=============================================================== -=============================================================== -Tag name: clm3_6_24 -Originator(s): oleson (Oleson Keith 1332 CGD) -Date: Mon Mar 9 21:01:47 MDT 2009 -One-line Summary: Fix urban testing and some history field changes - -Purpose of changes: Convert urban ascii files to netcdf to get urban testing to work. - Add rh_ref2m calculation for urban and change urban/rural humidity from specific to relative in - history files. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 672 (3.5.4-3.5.14 diffs) - 698 (cprnc bug gives false difference) - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 821 (mksurfdata for qtr deg) - 851 (abort when files non-exist on jaguar) - 877 (CN restart problem) - 883 (aerosol deposition not from atm) - 903 (problems in driver with open-MP on PGI) - 990 (illegal instruction) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - 1087 (let weights come from fsurdat file NOT finidat) - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: None - -Describe any changes made to the namelist: In namelist_defaults_clm.xml: - Change *.txt urban files to *.nc - Change aerosoldep_monthly_1990s_mean_1x1_urbanc_alpha_c090119.nc to - aerosoldep_monthly_1990s_mean_1x1_urbanc_alpha_c090114.nc - Change path for surfdata_0096x0144_090223_v2.nc from - lnd/clm2/surfdata/ to lnd/clm2/urbdata - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: Not tested - -Code reviewed by: K. Oleson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: A models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.nc - A models/lnd/clm/bld/urban_input/metropolis_fluxes.nc - A models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.nc - A models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.nc - A models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.nc - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/test/system/nl_files/nl_urb ---- Remove TSNOW from hist_fincl1, remove Q2M, Q2M_R, Q2M_U and - add RH2M, RH2M_R, RH2M_U to hist_fincl2 -M models/lnd/clm/test/system/nl_files/nl_urb_br --- Remove TSNOW from hist_fincl1 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ---- Change *.txt urban files to *.nc - Change aerosoldep_monthly_1990s_mean_1x1_urbanc_alpha_c090119.nc to - aerosoldep_monthly_1990s_mean_1x1_urbanc_alpha_c090114.nc - Change path for surfdata_0096x0144_090223_v2.nc from - lnd/clm2/surfdata/ to lnd/clm2/urbdata -M models/lnd/clm/src/main/clmtypeInitMod.F90 ---- delete q_ref2m_r, q_ref2m_u, and add rh_ref2m_r, rh_ref2m_u -M models/lnd/clm/src/main/clmtype.F90 ---- delete q_ref2m_r, q_ref2m_u, and add rh_ref2m_r, rh_ref2m_u -M models/lnd/clm/src/main/histFldsMod.F90 ---- delete Q2M_U, Q2M_R, and add RH2M_U, RH2M_R -M models/lnd/clm/src/biogeophys/UrbanInitMod.F90 ---- delete q_ref2m_u and add rh_ref2m_u -M models/lnd/clm/src/biogeophys/UrbanMod.F90 ---- delete q_ref2m_u and add calculation for rh_ref2m_u -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 ---- delete q_ref2m_r and add rh_ref2m_r -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ---- delete q_ref2m_r and add rh_ref2m_r - -Summary of testing: - - bluefire: All PASS except: -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -037 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -041 blCA4 TBL.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -043 blCA8 TBL.sh _sc_ds clm_urb^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -047 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -051 blC61 TBL.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 48 cold .................FAIL! rc= 5 -052 smH51 TSM.sh 17p_cnnsc_dh clm_std std 19980115:NONE:1800 10x15 USGS@1890 96 arb_ic ..........FAIL! rc= 1 -053 erH51 TER.sh 17p_cnnsc_dh clm_std std 19980115:NONE:1800 10x15 USGS@1890 10+38 arb_ic .......FAIL! rc= 1 -054 brH51 TBR.sh 17p_cnnsc_dh clm_std std 19980115:NONE:1800 10x15 USGS@1890 72+72 arb_ic .......FAIL! rc= 1 -055 blH51 TBL.sh 17p_cnnsc_dh clm_std std 19980115:NONE:1800 10x15 USGS@1890 48 arb_ic ..........FAIL! rc= 1 -057 smLI1 TSM.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -058 erLI1 TER.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -059 brLI1 TBR.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -060 blLI1 TBL.sh _sc_dh clm_std 19980101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -090 sm9J2 TSMext_ccsmseq_cam.sh ext_ccsm_seq_0.9x1.25_dh ext_ccsm_seq_cam 48 ....................FAIL! rc= 8 -091 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -092 erP61 TSM_ccsmseq.sh ERS f19_g1 701 (svn keyword) - 698 (cprnc bug gives false difference) - 717 (archiving bug -- only archive 1000 files at a time) - 1077 (Slow leak of land aquifer to Ocean runoff) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - - Known bugs that will NOT be resolved: 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Hydrology changes (Guo-Yue Niu water table below soil column, fff=7, -Qing micropore eqs (hksat and sucsat) and Qing microporosity --Simulation clm3_5niu5). - -Snow cover fraction (Niu and Yang); snow burial fraction for short vegetation -(Wang and Zeng); thermal and hydraulic organic soil (Lawrence); -snow compaction fix (Lawrence); snow T profile during layer splitting -fix (Lawrence); new FGR12 diagnostic. - -Ground emissivity now weighted combination (using fsno) of snow and soil -emissivity, sparse dense aerodynamic parameters from X. Zeng parameterization, -Liu (2004) saturated hydraulic conductivity and matric potential, -change saturation excess mechanism to only go to next to lowest layer, change -forcing height to min. of 40m. - -Lower volumetric soil water content to remove drainage spikes from some points -with high sand content. Change volumetric soil water content from 0.4 to 0.3. - -Incorporate hydrologically inactive deep soil (15 layers, 11-15 -hyrdologically inactive) and add mksoilcarb capability. -Change deep soil (layers 11-15) to dry rock type rather than wet sand -to reduce spinup time and for greater realism. - -Improved representation of snow-radiation interaction, including snow aging, -darkening from black carbon and dust, and vertically-resolved solar heating. - -Remove code pertaining to 40m minimum forcing height. Forcing height is now -whatever the atmospheric model provides plus z0+d of each pft. For offline -simulations this will be 30m+z0+d. - -saturation excess back to CLM3.5 parameterization. Sakaguchi litter resistance -Remove Qing Liu soil micropore functions and return to CLM3.5 formulations, -change decay factor for drainage to 2.5. remove Niu water table below soil -column formulation, frozen fraction of soil expression normalized per Zeng, -rsubmax=9.9 for drainage calculation, decay factor=0.5 for surface runoff -calculation, Zeng/Decker Richards equation mods, modified one-step solution -for soil moisture and qcharge for compatibility with Zeng/Decker Richards -mods per Swenson. - -Change input datm7 forcing so that Precip is over 6 hour interval, -times are corrected for Temp, Pres, Humid, and Wind data and linear -interpolation is used, and solar data is scaled by the cos(sol-zen angle). - -Set litter LAI = 0.5 and incorporate Swenson organic/mineral soil hk -percolation theory - -CASA changes from Forrest Hoffman: - - These changes add SOILPSI to the CASA' - configuration, correct units on C-LAMP carbon pool type fluxes, and reclassify - microbial pools as soil type pools. I believe this includes all modifications - between bgcmip04_clm3_expa_60 and bgcmip08_clm3_expa_72. - -Summary of CN and Btran changes from Sam Levis: - -- CanopyFluxes modification in the calculation of btran so that it equals 0 in soil layers with temperature <=-2 C. -- CN mods recommended by Peter Thornton and the BGCWG during the bgc development phase of the last few months. - -Grassland AND CROP optical properties changes from Keith Oleson: - -New pft physiology file was created: - -pft-physiology.c081002 - -Description of changes to physiology file: - -New leaf and stem optical properties (VIS and NIR reflectance and transmittance) -were derived for grasslands and crops (pfts 12-16) from full optical range -spectra of measured optical properties (Asner et al. (RSE 1998). - -New properties are: - - Leaf Stem - VIS NIR VIS NIR -Reflectance 0.11 0.35 0.31 0.53 -Transmittance 0.05 0.34 0.12 0.25 - - -Describe any changes made to build system: - - Add SNICAR_FRC and CARBON_AERO ifdef tokens - - DEFINE option SNICAR_FRC: enables second radiative transfer calculation of pure snow for radiative forcing estimation - - in configure use options -carbon_aero and -snicar_frc - -Describe any changes made to the namelist: Add fsnowoptics, fsnowaging, faerdep - -Added namelist variables fsnowoptics, fsnowaging, and faerdep, which point to files containing, respectively, snow/aerosol optical properties, snow aging parameters, and global aerosol deposition file. THESE FILES ARE REQUIRED. - -List any changes to the defaults for the boundary datasets: - - finidat files developed, all new fsurdat files, new pft-physiology, - files for T62, new organic files, new files for SNICAR (fsnowoptics, - fsnowaging, faerdep), fix some inconsistencies with fraction files, - get topo files setup correctly, get all files for 4x5 and 2x2.5 resolution - -Describe any substantial timing or memory changes: Yes - 20% slower because of SNICAR and slower because of deep soil - -Code reviewed by: Keith Oleson, Mark Flanner, Dave Lawrence, - Peter Thornton, Sam Levis, Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): scripts, - drv, datm7, socn, sice, sglc, csm_share, timing, pio, cprnc - -+scripts scripts4_090112 -+models/drv/seq_mct drvseq3_0_04 -+models/atm/datm7 datm7_090107 -+models/ocn/socn stubs1_1_01/socn -+models/ice/sice stubs1_1_01/sice -+models/glc/sglc stubs1_1_01/sglc -+models/csm_share share3_090112 -+models/utils/timing timing_081028 -+models/utils/pio pio28_prod/pio -+models/lnd/clm/tools/cprnc cprnc_081022 - -List all files eliminated: - -D models/lnd/clm/test/system/tests_pretag_bluevista - remove -D models/lnd/clm/bld/scpDefaultNamelist.pl ---------- replace with listDefaultNamelist.pl -D models/lnd/clm/bld/run-frost.csh ------------------ remove as can use cpl7 -D models/lnd/clm/tools/interpinic/clmi_1999-01-02_10x15_c070330.nc -- new file - -List all files added and what they do: - -A + models/lnd/clm/test/system/nl_files/clm_organic ------------ test organic -A + models/lnd/clm/tools/mksurfdata/mkorganic.F90 -------------- add organic to surfdat -A + models/lnd/clm/tools/mksurfdata/mksurfdata.pl -------------- create all fsurdat files -A + models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl ---------- interpolate aerosol deposition -A + models/lnd/clm/tools/ncl_scripts/clmi_increasesoillayer.ncl interpolate old clmi files to 15 soil levels -A + models/lnd/clm/tools/interpinic/clmi.IQ.1953-01-01_10x15_USGS_simyr2000_c081202.nc - ---------------- new 15 layer file to test interpolation -A + models/lnd/clm/tools/interpinic/runinit_ibm.csh ------------ create all finidat files -A + models/lnd/clm/bld/listDefaultNamelist.pl ------------------ list inputdata files needed -A + models/lnd/clm/src/main/organicFileMod.F90 ----------------- organic soil -A + models/lnd/clm/src/main/aerdepMod.F90 ---------------------- read in aerosol deposition -A + models/lnd/clm/src/biogeophys/SNICARMod.F90 ---------------- SNICAR model -A + Quickstart.GUIDE ------------------------------------------- Quickstart to cpl7 scripts - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>>>>>>>>>>>> Add compile_only option, fix smp/spmd, change most ->>>>>>>>>>>>>>>>>>>>>>>>> tests to 4x5 resolution, update ccsm version, ->>>>>>>>>>>>>>>>>>>>>>>>> remove bluevista, change to clm_qian inputdata ->>>>>>>>>>>>>>>>>>>>>>>>> add cold start type - -M models/lnd/clm/test/system/TCB.sh -M models/lnd/clm/test/system/config_files/4p_vodsrsc_dm -M models/lnd/clm/test/system/config_files/4p_vodsrsc_do -M models/lnd/clm/test/system/config_files/scam_ds ----- fix defaults for scam -M models/lnd/clm/test/system/config_files/17p_cnnsc_o -M models/lnd/clm/test/system/config_files/4p_casasc_dm -M models/lnd/clm/test/system/config_files/10p_dgvmsc_o -M models/lnd/clm/test/system/config_files/4p_casasc_do -M models/lnd/clm/test/system/config_files/4p_casasc_o -M models/lnd/clm/test/system/config_files/17p_vodsrsc_o -M models/lnd/clm/test/system/config_files/17p_cnnsc_dm -M models/lnd/clm/test/system/config_files/17p_cnnsc_do -M models/lnd/clm/test/system/config_files/10p_dgvmsc_dm -M models/lnd/clm/test/system/config_files/10p_dgvmsc_do -M models/lnd/clm/test/system/config_files/17p_vodsrsc_dm -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_64x128_s -M models/lnd/clm/test/system/config_files/17p_vodsrsc_do -M models/lnd/clm/test/system/config_files/4p_vodsrsc_o -M models/lnd/clm/test/system/TSMncl_tools.sh -M models/lnd/clm/test/system/CLM_compare.sh -M models/lnd/clm/test/system/TBL.sh -M models/lnd/clm/test/system/TSM_ccsmseq.sh -M models/lnd/clm/test/system/TSMext_ccsmseq_cam.sh -M models/lnd/clm/test/system/tests_pretag_jaguar -M models/lnd/clm/test/system/tests_posttag_kraken -M models/lnd/clm/test/system/tests_pretag_bluefire -M models/lnd/clm/test/system/README.testnames -M models/lnd/clm/test/system/tests_posttag_breeze -M models/lnd/clm/test/system/tests_pretag_bangkok -M models/lnd/clm/test/system/TBR.sh -M models/lnd/clm/test/system/TCBtools.sh -M models/lnd/clm/test/system/TER.sh -M models/lnd/clm/test/system/test_driver.sh -M models/lnd/clm/test/system/tests_posttag_purempi_regression -M models/lnd/clm/test/system/mknamelist -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -M models/lnd/clm/test/system/TCT_ccsmseq.sh -M models/lnd/clm/test/system/TCSruncase.sh -M models/lnd/clm/test/system/TSMpergro.sh -M models/lnd/clm/test/system/nl_files/clm_per -M models/lnd/clm/test/system/nl_files/clm_urb -M models/lnd/clm/test/system/nl_files/clm_std -M models/lnd/clm/test/system/nl_files/clm_ndepdyn -M models/lnd/clm/test/system/nl_files/clm_pftdyn -M models/lnd/clm/test/system/nl_files/clm_per0 -M models/lnd/clm/test/system/TSMcnspinup.sh -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/test/system/TSMtools.sh -M models/lnd/clm/test/system/TSMruncase.sh -M models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh -M models/lnd/clm/test/system/TSCext_ccsmseq_scam.sh -M models/lnd/clm/test/system/tests_posttag_lightning -M models/lnd/clm/test/system/CLM_runcmnd.sh -M models/lnd/clm/test/system/TBLtools.sh -M models/lnd/clm/test/system/TSM.sh - ->>>>>>>>>>>>>>>>>>>>>>>>> Add organic add option to output as double precision ->>>>>>>>>>>>>>>>>>>>>>>>> be more careful with averging add error checking -M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 -M models/lnd/clm/tools/mksurfdata/mksurfdata.globalurban -M models/lnd/clm/tools/mksurfdata/mksurfdata.regional -M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 -M models/lnd/clm/tools/mksurfdata/Makefile ----------- -Kieee for pgi -M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -M models/lnd/clm/tools/mksurfdata/Srcfiles -M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist - ->>>>>>>>>>>>>>>>>>>>>>>>> 15 levels for urban -MM models/lnd/clm/tools/ncl_scripts/generate_ascii_avg_urbanparam_file_p7.ncl -M models/lnd/clm/tools/ncl_scripts/README - ->>>>>>>>>>>>>>>>>>>>>>>>> Change for 15 levels and new variables/dims on dataset -M models/lnd/clm/tools/interpinic/interpinic.F90 -M models/lnd/clm/tools/interpinic/interpinic.runoptions -M models/lnd/clm/tools/interpinic/Srcfiles -M models/lnd/clm/tools/interpinic/Filepath -M models/lnd/clm/tools/interpinic/Makefile - ->>>>>>>>>>>>>>>>>>>>>>>>> 10x15 resolution, start to resolve domain checking bug -M models/lnd/clm/tools/mkgriddata/mkgriddata.namelist -M models/lnd/clm/tools/mkgriddata/mkgriddata.F90 -M models/lnd/clm/tools/mkgriddata/domainMod.F90 -M models/lnd/clm/tools/mkgriddata/creategridMod.F90 -M models/lnd/clm/tools/mkgriddata/Makefile - ->>>>>>>>>>>>>>>>>>>>>>>>> Get grid data from grid files rather than frac files -M models/lnd/clm/tools/mkdatadomain/mkdatadomain.namelist -M models/lnd/clm/tools/mkdatadomain/addglobal.F90 -M models/lnd/clm/tools/mkdatadomain/create_domain.F90 -M models/lnd/clm/tools/mkdatadomain/Makefile - ->>>>>>>>>>>>>>>>>>>>>>>>> minor changes to build, new datasets for build-namelist -M models/lnd/clm/bld/configure --- add -snicar_frc and -carbon_aero, add sglc, remove timing for cpl7 -M models/lnd/clm/bld/queryDefaultNamelist.pl --- minor change -M models/lnd/clm/bld/config_files/Makefile.in -- add HAVE_GETTIMEOFDAY for new timing, more consistent with cpl7 build -M models/lnd/clm/bld/config_files/config_definition.xml -- add snicar_frc and carbon_aero -M models/lnd/clm/bld/clm.cpl7.template -- simplify update for new scripts -M models/lnd/clm/bld/README ------------- update info. -M models/lnd/clm/bld/namelist_files/namelist_definition.xml ----- add new namelist items remove irad -M models/lnd/clm/bld/namelist_files/datm.streams.template.xml --- new Qian datasets -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- new defaults -M models/lnd/clm/bld/build-namelist - ->>>>>>>>>>>>>>>>>>>>>>>>> change default resolution to 4x5 remove irad -M models/lnd/clm/bld/run-pc.csh -M models/lnd/clm/bld/run-ibm.csh -M models/lnd/clm/bld/run-lightning.csh - ->>>>>>>>>>>>>>>>>>>>>>>>> New 15 layer urban single point datasets -M models/lnd/clm/bld/urban_input/metropolis_fluxes.txt -M models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.txt -M models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.txt -M models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.txt - ->>>>>>>>>>>>>>>>>>>>>>>>> Code changes documented above -M models/lnd/clm/src/biogeochem/CASASummaryMod.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/biogeochem/DGVMEcosystemDynMod.F90 -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 -M models/lnd/clm/src/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/biogeochem/CASAMod.F90 -M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 -M models/lnd/clm/src/biogeochem/DGVMMod.F90 -M models/lnd/clm/src/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 -M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 -M models/lnd/clm/src/biogeochem/C13SummaryMod.F90 -M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/biogeochem/CNC13FluxMod.F90 -M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 -M models/lnd/clm/src/main/inicFileMod.F90 -M models/lnd/clm/src/main/clm_varcon.F90 -M models/lnd/clm/src/main/clm_varpar.F90 -M models/lnd/clm/src/main/CNiniTimeVar.F90 -M models/lnd/clm/src/main/clm_comp.F90 -M models/lnd/clm/src/main/driver.F90 -M models/lnd/clm/src/main/ncdio.F90 -M models/lnd/clm/src/main/fileutils.F90 -M models/lnd/clm/src/main/clmtypeInitMod.F90 -M models/lnd/clm/src/main/pftdynMod.F90 -M models/lnd/clm/src/main/iniTimeConst.F90 -M models/lnd/clm/src/main/histFileMod.F90 -M models/lnd/clm/src/main/clm_atmlnd.F90 -M models/lnd/clm/src/main/restFileMod.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/main/initSurfAlbMod.F90 -M models/lnd/clm/src/main/clm_time_manager.F90 -M models/lnd/clm/src/main/filterMod.F90 -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/lnd_comp_mct.F90 -M models/lnd/clm/src/main/CASAiniTimeVarMod.F90 -M models/lnd/clm/src/main/areaMod.F90 -M models/lnd/clm/src/main/clmtype.F90 -M models/lnd/clm/src/main/histFldsMod.F90 -M models/lnd/clm/src/main/mkarbinitMod.F90 -M models/lnd/clm/src/riverroute/RtmMod.F90 -M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/biogeophys/DriverInitMod.F90 -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 - ->>>>>>>>>>>>>>>>>>>>>>>>> update documentation -M README -------------- update information -M KnownBugs ----------- add info on new known bugs - -Summary of testing: - - bluefire: All PASS except TBL and ... - -031 smF96 TSM.sh 17p_vodsrsc_m clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ...................FAIL! rc= 10 -036 smF96 TSM.sh 17p_vodsrsc_m clm_std 19981231:NONE:1800 4x5 gx3v5 48 arb_ic ...................FAIL! rc= 2 -013 blCA4 TBL.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -015 blCA8 TBL.sh _sc_ds clm_urb^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -019 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -020 smC61 TSM.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 -6 arb_ic ...............FAIL! rc= 10 -021 erC61 TER.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 10+38 arb_ic ............FAIL! rc= 5 -022 brC61 TBR.sh _sc_dh clm_urb^nl_urb_br 19981001:NONE:1800 1.9x2.5 gx1v5 -3+-3 arb_ic .........FAIL! rc= 5 -023 blC61 TBL.sh _sc_dh clm_urb^nl_urb 19981001:NONE:1800 1.9x2.5 gx1v5 48 arb_ic ...............FAIL! rc= 4 -024 smH91 TSM.sh 17p_cnnsc_dh clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 96 startup ..........FAIL! rc= 10 -025 erH91 TER.sh 17p_cnnsc_dh clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 10+38 startup .......FAIL! rc= 5 -026 brH91 TBR.sh 17p_cnnsc_dh clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 72+72 startup .......FAIL! rc= 5 -027 blH91 TBL.sh 17p_cnnsc_dh clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 48 startup ..........FAIL! rc= 4 -029 erH52 TER.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 10+38 arb_ic ...........FAIL! rc= 13 -030 brH52 TBR.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 72+72 arb_ic ...........FAIL! rc= 11 -031 blH52 TBL.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 48 arb_ic ..............FAIL! rc= 7 - - lightning/pathscale: all PASS except TBL and ... - -009 blCA4 TBL.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -013 blCA8 TBL.sh _sc_ds clm_urb^nl_urb 19971230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -017 blOC4 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 5 -019 erA91 TER.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 7 -020 brA91 TBR.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -3+-3 arb_ic .......................FAIL! rc= 6 -021 blA91 TBL.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -6 arb_ic ..........................FAIL! rc= 5 -027 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 7 -028 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 6 -029 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 5 -031 smH52 TSM.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 96 arb_ic ..............FAIL! rc= 10 -032 erH52 TER.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 10+38 arb_ic ...........FAIL! rc= 5 -033 brH52 TBR.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 72+72 arb_ic ...........FAIL! rc= 5 -034 blH52 TBL.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 48 arb_ic ..............FAIL! rc= 4 -036 erK51 TER.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 7 -037 brK51 TBR.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 72+72 arb_ic ...............FAIL! rc= 6 -001 smL51 TSM.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 96 arb_ic .........................FAIL! rc= 10 -002 erL51 TER.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ......................FAIL! rc= 5 -003 brL51 TBR.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ......................FAIL! rc= 5 -004 blL51 TBL.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 48 arb_ic .........................FAIL! rc= 4 -005 sm674 TSMtools.sh mkgriddata tools__ds singlept .............................................FAIL! rc= 6 -006 sm774 TSMtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 6 -007 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 4 -010 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -011 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -012 erP91 TSM_ccsmseq.sh ERS f45_g35 ICN4804Q ...................................................FAIL! rc= 4 - - jaguar: ALL PASS except TBL and .... - -001 smA74 TSM.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 10 -002 erA74 TER.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................FAIL! rc= 5 -003 brA74 TBR.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................FAIL! rc= 5 -013 smE32 TSM.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 64x128^360x720 USGS 48 arb_ic .........FAIL! rc= 10 -014 erE32 TER.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 64x128^360x720 USGS 10+38 arb_ic ......FAIL! rc= 5 -015 brE32 TBR.sh 4p_vodsrsc_dm clm_std 19981231:NONE:3600 64x128^360x720 USGS 24+24 arb_ic ......FAIL! rc= 5 -017 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -018 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 10+38 arb_ic ................FAIL! rc= 5 -019 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -021 smH92 TSM.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 96 startup ..........FAIL! rc= 10 -022 erH92 TER.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 10+38 startup .......FAIL! rc= 5 -023 brH92 TBR.sh 17p_cnnsc_dm clm_ndepdyn 19980101:NONE:1800 4x5 gx3v5@1890 72+72 startup .......FAIL! rc= 5 -029 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v5 48 startup ....FAIL! rc= 10 -030 smJ74 TSM.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -1100 arb_ic ........FAIL! rc= 10 -031 erJ74 TER.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -10+-10 arb_ic ......FAIL! rc= 5 -032 brJ74 TBR.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic ........FAIL! rc= 5 -038 smL62 TSM.sh _sc_m clm_std 19980101:NONE:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 10 -039 erL62 TER.sh _sc_m clm_std 19980101:NONE:1800 1.9x2.5 gx1v5 -5+-5 startup ...................FAIL! rc= 5 -040 brL62 TBR.sh _sc_m clm_std 19980101:NONE:1800 1.9x2.5 gx1v5 -10+-10 startup .................FAIL! rc= 5 - - breeze/gale/hail/gust/ifort: All PASS except TBL and... - - bangkok: All PASS except TBL and.. - -005 smA74 TSM.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 10 -006 erA74 TER.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................FAIL! rc= 5 -007 brA74 TBR.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -5+-5 arb_ic .................FAIL! rc= 5 -009 smD91 TSM.sh _persc_dh clm_per 19981231:NONE:1200 4x5 gx3v5 144 startup .....................FAIL! rc= 10 -010 erD91 TER.sh _persc_dh clm_per 19981231:NONE:1200 4x5 gx3v5 72+72 startup ...................FAIL! rc= 5 -013 smCA4 TSM.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 10 -014 erCA4 TER.sh _sc_ds clm_urb^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -45+-45 arb_ic ......FAIL! rc= 5 -015 brCA4 TBR.sh _sc_ds clm_urb^nl_urb_br 19981001:NONE:3600 1x1_camdenNJ navy -10+-10 arb_ic ...FAIL! rc= 5 -017 smOC4 TSM.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 10 -018 erOC4 TER.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_icFAIL! rc= 5 -019 brOC4 TBR.sh _vansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arb_iFAIL! rc= 5 -021 smNB4 TSM.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 10 -022 erNB4 TER.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 59+100 arb_icFAIL! rc= 5 -023 brNB4 TBR.sh _mexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arb_FAIL! rc= 5 -025 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -026 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -027 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -029 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -030 smH52 TSM.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 96 arb_ic ..............FAIL! rc= 10 -031 erH52 TER.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 10+38 arb_ic ...........FAIL! rc= 5 -032 brH52 TBR.sh 17p_cnnsc_dm clm_std 19980115:NONE:1800 10x15 USGS@1890 72+72 arb_ic ...........FAIL! rc= 5 -038 smK51 TSM.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -039 erK51 TER.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -040 brK51 TBR.sh 10p_dgvmsc_dh clm_std 19981230:NONE:1800 10x15 USGS 72+72 arb_ic ...............FAIL! rc= 5 -042 smL51 TSM.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 96 arb_ic .........................FAIL! rc= 10 -043 erL51 TER.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 10+38 arb_ic ......................FAIL! rc= 5 -044 brL51 TBR.sh _sc_dh clm_std 19980115:NONE:1800 10x15 USGS 72+72 arb_ic ......................FAIL! rc= 5 -046 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 19980115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 -047 smL74 TSM.sh _sc_s clm_std 19980101:NONE:1800 1x1_brazil navy -10 arb_ic ....................FAIL! rc= 10 -048 erL74 TER.sh _sc_s clm_std 19980101:NONE:1800 1x1_brazil navy -5+-5 arb_ic ..................FAIL! rc= 5 -049 brL74 TBR.sh _sc_s clm_std 19980101:NONE:1800 1x1_brazil navy -10+-10 arb_ic ................FAIL! rc= 5 -051 sm654 TSMtools.sh mkgriddata tools__ds namelist .............................................FAIL! rc= 6 -052 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -053 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -057 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 -Changes answers relative to baseline: Yes! Changes climate - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change (new climate) - - configuration (CPP ifdefs): All - - build-namelist command (or complete namelist): - - MSS location of control simulations used to validate new climate: - - Grass optical properties: /OLESON/csm/clm36sci16_clm3_6_11shklit0_5sfc_goa - - ccsm4_0_beta05: /CCSM/csm/b40.018 - - URL for LMWG diagnostics output used to validate new climate: - -ccsm4_0_beta05 (with clm36sci27_clm3_6_14) - -http://www.cgd.ucar.edu/cdp/mai/ccsmweb/b40.018-b40.017/setsIndex.html - -http://www.cgd.ucar.edu/tss/clm/diagnostics/clm4.0_dev/clm36sci16_clm3_6_11shklit0_5sfc_goa-clm36sci16_clm3_6_11shklit0_5sfca/setsIndex.html - -=============================================================== -=============================================================== -Tag name: clm3_6_14 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Oct 10 11:32:57 MDT 2008 -One-line Summary: Fix some global urban issues, fix pftdyn, really get compile-only option working in testing - -Purpose of changes: Fix column and pft averaging for urban (crtical for coupling to cam) (from Keith) - Fix Qanth (was wasteheat previously) (from Keith) - Fix so that pftdyn works (fix from Sam) - Really get the compile-only option working in test-suite - (so that doesn't re-compile, but does re-run, when sent again) - -Bugs fixed (include bugzilla ID): 826 (pftdyn) - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), 830 (missing C-LAMP mods) - 680 (t0 precip diff for seq-ccsm), 789 (pt sims slower than offline) - 698 (cprnc bug gives false difference), 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 833 (bug with cam in ccsm4_0_alpha37), 722 (threading slow) - 832 (problem with cice bn in ccsm4_0_alpha37) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - -Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, oleson, slevis (Sam provided pftdyn fix, and Keith provided urban fixes) - -List any svn externals directories updated (csm_share, mct, etc.): scripts and drv - - scripts to scripts4_081009 - drv to drvseq2_0_33 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> Change so that pftdyn will work, do urban averaging, and fix Qanth - M models/lnd/clm/src/main/clm_atmlnd.F90 -------------- Make averaging take into account urban (critical for global urban modeling) - M models/lnd/clm/src/main/histFldsMod.F90 ------------- Add urban scaling, fix Qanth - M models/lnd/clm/src/main/filterMod.F90 --------------- Change urban filter to include pftwgt>0 - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 -- Change filter_vegsol to include pftwgt>0 ->>>>>>>>>>> Fix so that compile-only option leaves compiled program there, doesn't recompile, but does rerun - M models/lnd/clm/test/system/TCB.sh - M models/lnd/clm/test/system/TSMncl_tools.sh - M models/lnd/clm/test/system/TBL.sh - M models/lnd/clm/test/system/TSM_ccsmseq.sh - M models/lnd/clm/test/system/TSMext_ccsmseq_cam.sh - M models/lnd/clm/test/system/TBR.sh - M models/lnd/clm/test/system/TCBtools.sh - M models/lnd/clm/test/system/test_driver.sh - M models/lnd/clm/test/system/TER.sh - M models/lnd/clm/test/system/TCT_ccsmseq.sh - M models/lnd/clm/test/system/TSMpergro.sh - M models/lnd/clm/test/system/TSMcnspinup.sh - M models/lnd/clm/test/system/TSMtools.sh - M models/lnd/clm/test/system/TSMruncase.sh - M models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh - M models/lnd/clm/test/system/CLM_runcmnd.sh - M models/lnd/clm/test/system/TSM.sh - -Summary of testing: - - bluefire: All PASS except -071 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - jaguar: All PASS - bangkok/lf95: All PASS except -028 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 5 -054 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 6 -055 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze/gale/hail/gust/ifort: All PASS - -pftdyn TBL test fails, because pftdyn did not work in previous tag. -cam and scam tests fail because of bugs 832 and 833 in ccsm4_0_alpha37 - -CLM tag used for the baseline comparison tests if applicable: clm3_6_13 - -Changes answers relative to baseline: No -- bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_6_13 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Wed Oct 1 13:33:36 MDT 2008 -One-line Summary: Update to new version of cpl7 scripts and build, update externals for versions needed for clm36sci branch, add new CASA tests - -Purpose of changes: Update to new version of cpl7 scripts and build. - Update externals for versions needed on clm36sci branch. - Add new CASA tests. - Add $CLM_ACCOUNT as option to test_driver.sh - Add single point capability to cpl7 scripts. - Add CLM_DEMAND, CLM_BLD_NL_OPTIONS as options to cpl7 scripts. - Some code changes from Keith Oleson to fix a CASA startup problem. - -Code changes from Keith Oleson - -1. Volumetric soil water check in BiogeophysRestMod changed so that it accounts for ponded ice/water -that may be present in surface layer. If volumetric soil water is above saturation, h2osoi_liq -and h2osoi_ice are reduced according to their proportion of total water/ice. Both h2osoi_liq -and h2osoi_ice are limited to be no lower than watmin (currently 0.01_r8 mm). All this done for -soil points only. - -2. In SoilHydrologyMod, variable su changed to: - - su = max(0._r8,(s1-fcov(c)) / max(0.01_r8,1._r8-fcov(c)) - -to account for the fact that fcov could be one and hence divide by zero could have occurred. -Also, the factor "1._r8" multiplying fcov in the numerator was removed. - -3. watmin made a global parameter available from clm_varcon - -Bugs fixed (include bugzilla ID): 805 (too much output in build-streams), 801 (G95 in csm_Share), - 786 (dshr_map bug), 834 (CASA startup bug), - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), - 680 (t0 precip diff for seq-ccsm), - 698 (cprnc bug gives false difference), 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 826 (pftdyn), 833 (bug with cam in ccsm4_0_alpha37) - 832 (problem with cice bn in ccsm4_0_alpha37) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - -Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: Update to new ccsm4_0_alpha37 scripts - - New options in cpl7 scripts: CLM_DEMAND, CLM_BLD_NL_OPTIONS - - CLM_DEMAND: List of output variables to require be set in namelist - For example, set to "furbinp" to use urban grid. - CLM_BLD_NL_OPTIONS: List of options to pass to clm build-namelist. - - New grid in cpl7 scripts: pt1_pt1 (also set CLM_PT1_NAME) for single point sims - - Add ability to set "none" in clm build-namelist -clm_dmand option. - -Quickstart to new cpl7 scripts... - - New cpl7 namelists now do two things for you. - - Add a ton of error checking at each step -- so it won't let you do something you aren't allowed to - - Only show you the variables that you could actually set in your case. - - To accomplish this we use XML files rather than cshell env files. But, the - operation sequence is similar with options only changed slightly. - - cd scripts - ./create_newcase -help # get help on how to run create_newcase - ./create_newcase -case testI -mach bluefire -res f19_g15 -compset I # create new "I" case for bluefire at 1.9x2.5_gx1v5 res - # "I" case is clm active, datm7, and inactive ice/ocn - cd testI - ./xmlchange -help # Get help on editor for XML files - ./xmlchange env_conf.xml env_mach_pes # Edit configure files if needed - configure -case # create scripts - ./xmlchange env_build.xml # Edit build files if needed - testI.build # build model and create namelists - ./xmlchange env_run.xml # Edit run files if needed - bsub < testI.run # submit script - # (NOTE: edit env_run.xml to set RESUBMIT to number of times to automatically resubmit) - - Note that the -skip_rundb option to create_newcase no longer needs the argument of "NONE". - Syntax of create_tests changed to only one form. - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik, oleson and dlawren (source code changes) - -List any svn externals directories updated (csm_share, mct, etc.): drv, csm_share, datm7, and scripts - - csm_share, datm7 and scripts include changes required for the clm36sci branch. - - scripts to scripts4_080930 - drv to drvseq2_0_32 - datm7 to datm7_080926 - csm_share to share3_080929 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>> Add $CLM_ACCOUNT env var, change tests around, update to ccsm4_0_alpha37 - add some more CASA tests. -M models/lnd/clm/test/system/README -M models/lnd/clm/test/system/tests_pretag_bluefire -M models/lnd/clm/test/system/tests_pretag_jaguar -M models/lnd/clm/test/system/tests_posttag_kraken -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -M models/lnd/clm/test/system/tests_posttag_purempi_regression -M models/lnd/clm/test/system/test_driver.sh ------------------ Add $CLM_ACCOUNT env var - update to ccsm4_0_alpha37 -M models/lnd/clm/test/system/input_tests_master -------------- Add CASA 1.9x2.5 tests -M models/lnd/clm/test/system/TSMext_ccsmseq_cam.sh ----------- Separate call to cice bn -M models/lnd/clm/test/system/TCT_ccsmseq.sh -M models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh ----------- Need to set threads/tasks -M models/lnd/clm/test/system/TSM.sh -------------------------- Remove old namelist name - ->>>>>>>>>>>>>> Update for new scripts -M models/lnd/clm/bld/clm.cpl7.template ----------------------- Straighten out clm_demand - Add new env vars. Remove prestaging. -M models/lnd/clm/bld/namelist_files/namelist_definition.xml -- Update to alpha37 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml- Add file for clm36sci branch -M models/lnd/clm/bld/build-namelist -------------------------- Allow clm_demand to include none. - ->>>>>>>>>>>>>> These are Keith's changes to fix bug 834. They do make it possible for - answers to change, but in most cases they don't. It allows code to - startup correctly for situations it might fail in, and sets a mininum - value in SoilHydrologyMod to guard against divide by zero. This would - change answers when amount of ice -- fcov > 0.99 -- which would be rare. -M models/lnd/clm/src/main/clm_varcon.F90 -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 - -Summary of testing: - - bluefire: All PASS except -042 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -043 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -044 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -045 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -P -046 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -079 blL61 TBL.sh _sc_h clm_std 19980101:NONE:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 7 -083 blL62 TBL.sh _sc_m clm_std 19980101:NONE:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 7 -107 brJ74 TBR.sh 4p_casasc_ds clm_std 10001230:NONE:3600 1x1_tropicAtl test -3+-3 arb_ic ........FAIL! rc= 11 -127 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - kraken: All PASS except all TER and TBR tests fail, because of a script problem and ends early - lightning/pathscale: All PASS except -022 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -023 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -024 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -025 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -026 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -050 erP11 TSM_ccsmseq.sh ERS T31_g35 ICN4804 ....................................................FAIL! rc= 5 - bangkok/lf95: All PASS except -025 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -026 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -027 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -028 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 4 -029 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 -054 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 .......................FAIL! rc= 6 -055 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - breeze/gale/hail/gust/ifort: All PASS - -pftdyn tests fail because of previous problem (bug 826). ext_ccsmseq_ tests fail -because of problem with ccsm4_0_alpha37 (bug 833). - -CLM tag used for the baseline comparison tests if applicable: clm3_6_12 - -Changes answers relative to baseline: Only for some cases, see tests 079 and 083 on -bluefire above - -=============================================================== -=============================================================== -Tag name: clm3_6_12 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Sun Sep 21 10:04:22 MDT 2008 -One-line Summary: Fix restarts for urban, add capability to do global urban experiments, add new forcing height changes, remove cpl6 - -Purpose of changes: Fix restarts for urban model as well as adding capability to do global urban experiments. - It also adds the new forcing height changes into the trunk. - And we remove all the cpl6 #ifdef's, source codes, and associated scripts and script options. - Also fix some memory leaks found in MCT. - Add testing for kraken. - Fix branch tests so they change the start_ymd. - Add some more tests for CASA. - Set minimum urban percentage to use from 5% to 1%. - Completely remove COUP_CAM #ifdef as NOT needed anymore. - -Bugs fixed (include bugzilla ID): Fix urban model restarts, remove cpl6 (755), MCT memory leak (825) - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), - 680 (t0 precip diff for seq-ccsm), - 698 (cprnc bug gives false difference), 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 805 (too much output in build-streams), 826 (pftdyn) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - -Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: Add nofire option to configure, remove cpl6 option - -Describe any changes made to the namelist: Add new urban oriented output history variables: - - _U, and _R (Urban and Rural) for: - QRUNOFF, TREFMXAV, TREFMNAV, TSA, SoilAlpha, TG, Q2M, TREFAV - URBAN_AC, and URBAN_HEAT, Qanth, SWup, LWup, QTau, HWR, Wind, Qair - and ZBOT_PFT for forcing height - - Change build-namelist so that to use a dataset with urban points on it you - need to use "-clm_demand furbinp". This way it will not only select the appropriate - furbinp dataset -- but it will select the correct surface dataset that includes - urban data on it. Such as for 10x15 and 1.9x2.5 surface datasets where there is - now an urban version as well as the standard version. - - -List any changes to the defaults for the boundary datasets: Add urbanc point dataset, - and 1.9x2.5 and 10x15 urban datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self (some changes by Keith Oleson) - -List any svn externals directories updated (csm_share, mct, etc.): drv, datm7, mct - - drv to drvseq3_0_26 - datm7 to datm7_080907 - mct to MCT2_5_1_080522 - -List all files eliminated: Remove cpl6 files - -R models/lnd/clm/test/system/TCText_ccsmcon.sh -R models/lnd/clm/test/system/TSMext_ccsmcon.sh -R models/lnd/clm/bld/clm.cpl6.template -R models/lnd/clm/src/main/program_csm.F90 -R models/lnd/clm/src/main/clm_csmMod.F90 - -List all files added and what they do: - -A models/lnd/clm/test/system/config_files/4p_casasc_ds ----- Add serial test for CASA -A models/lnd/clm/test/system/nl_files/clm_urb -------------- For standard urban tests. -A models/lnd/clm/test/system/nl_files/nl_urb_br ------------ Urban namelist for branch tests. -A models/lnd/clm/test/system/tests_posttag_kraken ---------- Add tests for kraken -A models/lnd/clm/tools/ncl_scripts/generate_ascii_avg_fv1_9x2_5_urbanparam_file_p7.ncl -- script to create furbinp dataset -A models/lnd/clm/tools/mksurfdata/mksurfdata.globalurban --- Example namelist to make a global urban surface dataset -A models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.txt --- Add urban intercomparison test case - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>> Remove cpl6 option, add nofire, make urban point datasets consistent with global Feddema datasets -M models/lnd/clm/bld/configure -------------------------------- Remove cpl6 option, add nofire option -M models/lnd/clm/bld/queryDefaultNamelist.pl ------------------ Add -filenameonly option -M models/lnd/clm/bld/urban_input/metropolis_fluxes.txt -M models/lnd/clm/bld/urban_input/urbanc_alpha_fluxes.txt -M models/lnd/clm/bld/urban_input/asphaltjungle_fluxes.txt -M models/lnd/clm/bld/urban_input/mexicocityMEX_fluxes.txt -M models/lnd/clm/bld/urban_input/vancouverCAN_fluxes.txt -M models/lnd/clm/bld/config_files/config_definition.xml -M models/lnd/clm/bld/namelist_files/namelist_definition.xml -M models/lnd/clm/bld/namelist_files/datm.streams.template.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -M models/lnd/clm/bld/build-namelist --------------------------- Have urban surface datasets dependent on furbinp - -M models/lnd/clm/test/system/README.testnames -M models/lnd/clm/test/system/tests_posttag_urban -M models/lnd/clm/test/system/tests_pretag_jaguar -M models/lnd/clm/test/system/tests_pretag_bluefire -M models/lnd/clm/test/system/tests_posttag_purempi_regression -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -M models/lnd/clm/test/system/tests_pretag_bluevista -M models/lnd/clm/test/system/tests_posttag_lightning -M models/lnd/clm/test/system/nl_files/clm_urb1pt -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/test/system/README -M models/lnd/clm/test/system/CLM_runcmnd.sh -M models/lnd/clm/test/system/TBR.sh ---------------------- Change so start_ymd of branch runs is initial-length after original start-date -M models/lnd/clm/test/system/test_driver.sh -------------- Reduce from premium to regular, add kraken -M models/lnd/clm/test/system/mknamelist ------------------ Set hist_* values for second file -M models/lnd/clm/test/system/nl_files/nl_crcrop ---------- Set hist_dens for second file -M models/lnd/clm/test/system/nl_files/nl_urb ------------- Set hist_dens for second file, add more fields to list -M models/lnd/clm/test/system/nl_files/nl_std ------------- Set hist_dens for second file -M models/lnd/clm/test/system/nl_files/nl_lfiles ---------- Set hist_dens for second file -M models/lnd/clm/test/system/input_tests_master ---------- Change TBR tests, add more CASA tests - -M models/lnd/clm/tools/mksurfdata/mkurban.F90 ------------ Change threshold to ignore urban from 5% to 1% - -M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 -- For DUST fix forcing height appropriately -M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------------- Don't set pointers if no urban points - ->>>>>>>>>>>>>>>> Remove COUP_CSM #ifdefs - -M models/lnd/clm/src/main/driver.F90 --------- Also make sure urban calls have urban points -M models/lnd/clm/src/main/accFldsMod.F90 -M models/lnd/clm/src/main/clmtypeInitMod.F90 -M models/lnd/clm/src/main/initializeMod.F90 -M models/lnd/clm/src/main/iniTimeConst.F90 -M models/lnd/clm/src/main/histFileMod.F90 -M models/lnd/clm/src/main/restFileMod.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/main/initSurfAlbMod.F90 -M models/lnd/clm/src/main/clm_time_manager.F90 -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/subgridAveMod.F90 -M models/lnd/clm/src/main/initGridCellsMod.F90 -M models/lnd/clm/src/main/spmdMod.F90 -M models/lnd/clm/src/main/surfrdMod.F90 ------------- Also remove COUP_CAM #ifdef -M models/lnd/clm/src/main/do_close_dispose.F90 -M models/lnd/clm/src/main/clmtype.F90 --------------- Also forcing height changes -M models/lnd/clm/src/main/histFldsMod.F90 -M models/lnd/clm/src/main/mkarbinitMod.F90 -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 ------ Also forcing height changes -M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 ------ Also forcing height changes -M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --------- Fix restarts for urban -M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 - -Summary of testing: - - bluefire: All PASS except TBL and -042 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -043 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -044 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -046 smG45 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 - jaguar: All PASS except TBL and -019 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 - kraken: All PASS except TBL and TER and TBR (this may be a setup problem) and -017 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 - lightning/pathscale: All PASS except TBL and - bangkok/lf95: All PASS except TBL and -025 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ..................FAIL! rc= 10 -026 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -027 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ................FAIL! rc= 5 -029 smG46 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ...................FAIL! rc= 10 - kraken: All PASS except TBL and -017 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 144 arb_ic ........... -.......FAIL! rc= 10 -018 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 10+38 arb_ic ......... -.......FAIL! rc= 13 -019 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS 72+72 arb_ic ......... -.......FAIL! rc= 5 - breeze/gale/hail/gust/ifort: All PASS - - pftdyn tests fail on all platforms -- due to a previous problem that was not -detected because of a bug in the test. - TER and TBR tests fail on kraken -- this may be a setup problem. Possibily a problem -with newcprnc? I'm not sure but since it passes elsewhere, I don't think it's a problem -in the code. - -CLM tag used for the baseline comparison tests if applicable: clm3_6_11 - -Changes answers relative to baseline: Forcing height changes cause answers to change - -=============================================================== -=============================================================== -Tag name: clm3_6_11 -Originator(s): dlawren (Lawrence David 1384 CGD) -Date: Tue Aug 26 21:53:22 MDT 2008 -One-line Summary: Ice stream for snow capped regions - -Purpose of changes: Split liquid and ice runoff streams in snow capped situations - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), - 680 (t0 precip diff for seq-ccsm), - 698 (cprnc bug gives false difference), 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 805 (too much output in build-streams) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - -Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Update version of pft-physiology file used - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik - -List any svn externals directories updated (csm_share, mct, etc.): scripts and csm_share - - scripts to scripts4_080731 - csm_share to share3_080801 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- Use the same pft-phisiology file for every option -M models/lnd/clm/src/main/clmtypeInitMod.F90 -M models/lnd/clm/src/main/pft2colMod.F90 -M models/lnd/clm/src/main/clmtype.F90 -M models/lnd/clm/src/main/histFldsMod.F90 -M models/lnd/clm/src/main/models/lnd/clm/src/main/clm_time_manager.F90 -- Hack for fake Gregorian calendar -M models/lnd/clm/src/riverroute/RtmMod.F90 --------------- two runoff sreams, liq and ice (qflx_snwcp_ice) -M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 ---- dew snwcp -M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 -------- snow and rain split for snwcp -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 ----- liq snwcp -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -------- qrgwl minus snwcp_ice -M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 ----- lake snwcp -M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 - initialize snwcp fields to zero for lakes -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ------ revised balance check - >>>>>>>>>> Get scam test working -M models/lnd/clm/test/system/TSMext_ccsmseq_cam.sh -M models/lnd/clm/test/system/nl_files/scam -M models/lnd/clm/test/system/TSCext_ccsmseq_scam.sh -M models/lnd/clm/test/system/config_files/scam_ds -M models/lnd/clm/test/system/config_files/ext_ccsm_seq_64x128_s -M models/lnd/clm/test/system/nl_files/scam -M models/lnd/clm/test/system/nl_files/scam_prep - -Summary of testing: - - bluefire: All PASS except TBL tests - lightning/pathscale: All PASS except TBL tests - bangkok/lf95: All PASS except TBL tests - breeze/gale/hail/gust/ifort: All PASS - - Didn't test on jaguar -- since it was down. - -CLM tag used for the baseline comparison tests if applicable: clm3_6_10 - -Changes answers relative to baseline: Yes -- pft-physiology file, RTM changes - -=============================================================== -=============================================================== -Tag name: clm3_6_10 -Originator(s): tcraig -Date: Fri Aug 15 09:05:50 MDT 2008 -One-line Summary: extend rtm tracer, ascale for tri-grids, AIX O3 to O2 - -Purpose of changes: extend rtm to handle multiple tracers. added - second tracer to rtm associated with frozen water. first tracer - is now liquid water. both are passed to cpl7 now via the roff and - ioff fields. - - add ascale field to land model in support of model running on it's - own grid. ascale is a field provided by the coupler to the land model - via the driver "domain" datatype. it is needed to correct fluxes - in the land model for conservation. it is being applied to the - land to rtm fluxes and will need to be fully validated in a ccsm4 - tri-grid configuration which is still under development. - - change AIX optimization from -O3 to -O2 at request of LMWG. not - needed for these changes in particular. see bug #812. - -Bugs fixed (include bugzilla ID): 812 - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), - 680 (t0 precip diff for seq-ccsm), - 698 (cprnc bug gives false difference), 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 805 (too much output in build-streams) - 1079 (rpointer file updated with clm.i files) - 1083 (Units of NEE exported should be kg CO2 NOT kg C) - http://bugs.cgd.ucar.edu/ - -Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: - change AIX -O3 to -O2 at request of LMWG, incorporated - into tag for convenience. - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: - added extra rtm tracer, should have no noticable impact on timing - or memory. - -Code reviewed by: tcraig - -List any svn externals directories updated (csm_share, mct, etc.): - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M bld/config_files/Makefile.in -M src/main/clmtypeInitMod.F90 -M src/main/pft2colMod.F90 -M src/main/clm_atmlnd.F90 -M src/main/clm_csmMod.F90 -M src/main/lnd_comp_mct.F90 -M src/main/domainMod.F90 -M src/main/clmtype.F90 -M src/main/histFldsMod.F90 -M src/riverroute/RtmMod.F90 -M src/riverroute/RunoffMod.F90 -M src/biogeophys/Biogeophysics2Mod.F90 -M src/biogeophys/Hydrology1Mod.F90 -M src/biogeophys/SoilHydrologyMod.F90 - -- change AIX -O3 to -O2 -- add ascale implementation. add asca field to domain datatype, set - for atm and lnd domains. default is 1.0. received from coupler - in first run call. reset in lnd only if atm and lnd domain are same. -- split qflx_snowcap term into qflx_snowcap_rain and qflx_snowcap_snow. - snowcap_rain term is same implementation as old snowcap term. - snowcap_snow is set to zero now. potential future mods are noted - and commented out, search for tcx_snowcap_new in src code. -- implement multiple tracers extensibility in rtm. add frozen - runoff tracer in addition to liquid runoff tracer. -- set roff and ioff runoff terms in lnd_comp_mct to send back to coupler -- update rtm restart file, support backward compatability by setting - runoff tracers to zero if the new fields are not on the restart file. -- update history file for new rtm tracers. requires individual fields - to be copied from tracer arrays to single field arrays for history - interface. - -Summary of testing: - - bluefire: all PASS except - 073 blL61 TBL.sh _sc_h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup - 077 blL62 TBL.sh _sc_m clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup - 085 blL74 TBL.sh _sc_s clm_std 19980101:6-HOURLY:1800 1x1_brazil navy -10 arb_ic - 087 blL78 TBL.sh _sc_s clm_std 19971231:NONE:1800 1x1_brazil navy -10 arb_ic - the above 4 bl cases FAIL due to -O3 to -O2 optimzation change - 113 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 - sm984 fails due to inconsistent driver in test - jaguar: all PASS except - 038 erP65 TSM_ccsmseq.sh ERS f19_g13 I - 039 erP15 TSM_ccsmseq.sh ERS T31_g35 ICN - 040 erP66 TSM_ccsmseq.sh ERH f19_g13 I - 041 erP16 TSM_ccsmseq.sh ERH T31_g35 ICN - 042 erP67 TSM_ccsmseq.sh ERB f19_g13 I - 043 erP17 TSM_ccsmseq.sh ERB T31_g35 ICN - erP* tests fail due to script error - bangkok/lf95: all PASS except - 046 sm952 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dh ext_ccsm_seq_cam 48 - 047 sm984 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 - sm952 and sm984 fail due to inconsistent driver in test - breeze/gale/hail/gust/ifort: all PASS - - bluefire cam pretag: all PASS except previously documented failures - bluefire ccsm4 pretag: all PASS except previously documented failures - compare with alpha33 FAILS since rtm not bit-for-bit in some tests. - -CLM tag used for the baseline comparison tests if applicable: clm3_6_09 - -Changes answers relative to baseline: - change of AIX -O3 to -O2 changes some results by what ap.........FAIL! rc= 7 -061 smK17 TSM.sh 10p_dgvmsc_h clm_std 19981231:NONE:1800 48x96 gx3v5 -213 arb_ic ................FAIL! rc= 10 -065 blK71 TBL.sh 10p_dgvmsc_s clm_std 19971231:NONE:1800 1x1_brazil navy -670 arb_ic ............FAIL! rc= 5 -088 smL83 TSM.sh _sc_dh clm_std 19980115:DAILY:3600 5x5_amazon navy -10 arb_ic ..................FAIL! rc= 10 -089 erL83 TER.sh _sc_dh clm_std 19980115:DAILY:3600 5x5_amazon navy -5+-5 arb_ic ................FAIL! rc= 5 -090 brL83 TBR.sh _sc_dh clm_std 19980115:DAILY:3600 5x5_amazon navy -10+-10 arb_ic ..............FAIL! rc= 6 -091 blL83 TBL.sh _sc_dh clm_std 19980115:DAILY:3600 5x5_amazon navy -10 arb_ic ..................FAIL! rc= 4 -095 bl711 TBLtools.sh mksurfdata tools__ds namelist .............................................FAIL! rc= 7 -097 bl771 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 7 - lightning/pathscale: ------->>>>>>> Bug 694 -011 er111 TER.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 -012 br111 TBR.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 24+24 arb_ic ..............FAIL! rc= 11 -025 smE13 TSM.sh 4p_vodsrsc_do clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 10 -026 erE13 TER.sh 4p_vodsrsc_do clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ............FAIL! rc= 5 -027 brE13 TBR.sh 4p_vodsrsc_do clm_std 19981231:YEARLY:1800 48x96 gx3v5 24+24 arb_ic ............FAIL! rc= 5 -029 smE16 TSM.sh 4p_vodsrsc_o clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ................FAIL! rc= 10 - lightning/ifort: -004 blA91 TBL.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 5 -008 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 5 ------->>>>>>> Bug 694 -010 sm111 TSM.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 10 -011 er111 TER.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 5 -012 br111 TBR.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 24+24 arb_ic ..............FAIL! rc= 5 -013 bl111 TBL.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 4 -014 sm114 TSM.sh 4p_vodsr_h clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 10 -016 erE11 TER.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ............FAIL! rc= 13 -017 brE11 TBR.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 24+24 arb_ic ............FAIL! rc= 11 -018 blE11 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 5 - tempest: -009 smB11 TSMruncase.sh .........................................................................FAIL! rc= 4 ------->>>>>>> Bug 694 -011 er111 TER.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 -012 br111 TBR.sh 4p_vodsr_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 24+24 arb_ic ..............FAIL! rc= 11 -036 erE31 TER.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 10+38 arb_ic ....FAIL! rc= 7 -037 brE31 TBR.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 24+24 arb_ic ....FAIL! rc= 6 -045 smH01 TSM.sh 17p_cnnsc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v5@2000 48 startup FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_5_19 - -Changes answers relative to baseline: Bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_5_19 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu Mar 6 14:52:17 MST 2008 -One-line Summary: Change directory structure to mimic CCSM, fix so no NaNS on BGC interpinic output, new half degree CN clmi dataset - -Purpose of changes: move cdir1_clm3_5_18 to trunk. Get directory structure to look like CCSM. - - models ------------------------------ Model source code for each component - models/lnd - models/lnd/clm ---------------------- CLM source code, build-scripts, tools, and testing - models/lnd/clm/test/system ---------- CLM test scripts - models/lnd/clm/tools ---------------- CLM tools - models/lnd/clm/tools/mksurfdata - models/lnd/clm/tools/ncl_scripts - models/lnd/clm/tools/interpinic - models/lnd/clm/tools/mkgriddata - models/lnd/clm/tools/mkdatadomain - models/lnd/clm/tools/cprnc - models/lnd/clm/bld ------------------ CLM build scripts - models/lnd/clm/bld/run-ibm.csh ------ sample CLM run script for the IBM - models/lnd/clm/bld/urban_input - models/lnd/clm/bld/usr.src - models/lnd/clm/bld/perl5lib - models/lnd/clm/doc ------------------ CLM documentation - models/lnd/clm/doc/UsersGuide - models/lnd/clm/doc/CodeReference - models/lnd/clm/doc/Dev - models/lnd/clm/src ------------------ CLM specific source code directories - models/lnd/clm/src/biogeochem - models/lnd/clm/src/main - models/lnd/clm/src/riverroute - models/lnd/clm/src/biogeophys - models/ocn/socn --------------------- stub ocean model - models/ice - models/ice/sice --------------------- stub sea-ice model - models/atm - models/atm/datm7 -------------------- data atmosphere model - models/atm/datm7/bld - models/utils ------------------------ Utiltiies - models/utils/esmf_wrf_timemgr ------- ESMF WRF time-manager API - models/utils/timing ----------------- timing utiltities - models/utils/mct -------------------- Model Coupling Toolkit - models/utils/pio -------------------- Parallel I/O - models/drv -------------------------- Sequential CCSM source code - models/drv/seq_mct - models/drv/seq_mct/driver - models/csm_share -------------------- CCSM share code (shared between CCSM component models) - scripts ----------------------------- CCSM build, run and testing scripts - scripts/README ---------------------- ReadMe file on CCSM scripts - doc --------------------------------- CCSM documentation (currently out of date) - - Changes so that interpinic doesn't output NaNS on AIX compiler for CN configuration. - - QUICKSTART: using the new CPL7 scripts: - - cd scripts - ./create_newcase # get help on how to run create_newcase - ./create_newcase -case testI -mach blueice -res f19_g15 -compset I # create new "I" case for blueice at 1.9x2.5_gx1v5 res - # "I" case is clm active, datm7, and inactive ice/ocn - cd testI - configure -mach blueice # create scripts - testI.build # build model and create namelists - bsub < testI.run # submit script - # (NOTE: edit env_run to set RESUBMIT to number of times to automatically resubmit) - -Bugs fixed (include bugzilla ID): 681 (archiving/resub), 696 (save datm7 files) , 707 (xlf90 bug with CAM) - -Known bugs (include bugzilla ID): 251 (TwoStream), 672 (3.5.4-3.5.14 diffs), 680 (t0 precip diff for seq-ccsm), - 694 (restarts for offline) , 697 (version etc.), 698 (cprnc bug), 701 (svn keyword), - 708, (xlf bug on bluevista) - http://bugs.cgd.ucar.edu/ - - New bugs found: 708 -- bug with new xlf90 compiler on bluevista for CASA - 710 -- Some variables are NaNS on clm.i output from CN configuration - - Known bugs that will NOT be resolved: 512 (mksurf on PGI), 546(interpinic for DGVM), - 652 (threads different answers with older PGI versions) - -Describe any changes made to build system: Changed to work with new directory structure - (also works with any wildcard in clm "models/lnd/clm*" directory name) - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Update half degree CN clmi file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): drv (also add in CCSM doc and scripts directories as externals) - doc_060127, seqmct45_scripts_080108, drvseq2_0_10 - -List all files eliminated: Files moved around extensively - -List all files added and what they do: Files moved around extensively - -List all existing files that have been modified, and describe the changes: Files moved around extensively - - models/lnd/clm/bld/DefaultCLM_INPARM_Namelist.xml --- change CN half degree clmi file - models/lnd/clm/bld/clm.cpl6.template ---------------- change assumed paths (use wildcard for models/lnd/clm*) - models/lnd/clm/bld/clm.cpl7.template ---------------- change assumed paths (use wildcard for models/lnd/clm*) - models/lnd/clm/bld/configure ------------------------ get to work in new directory structure - models/lnd/clm/bld/run-ibm.csh ---------------------- fix archiving, and resubmit - models/lnd/clm/bld/run-lightning.csh ---------------- fix archiving, and resubmit - models/lnd/clm/bld/run-pc.csh ----------------------- fix archiving, and resubmit - models/lnd/clm/src/main/clm_time_manager.F90 -------- make save statements explicit - models/lnd/clm/tools/*/Makefile --------------------- change so CLM_ROOT is top of directory structure with - models/lnd/clm* assumed below - models/lnd/clm/tools/interpinic/interpinic.F90 ------ get numrad dimsize, on AIX check for NaNS and convert to spval, - if weights == 0 set values to spval - models/lnd/clm/test/system/test_driver.sh ----------- new directory structure, update to ccsm3_9_beta03 and ccsm4_0_alpha25 - models/lnd/clm/test/system/TBL.sh ------------------- new directory structure - models/lnd/clm/test/system/TBLtools.sh -------------- new directory structure - models/lnd/clm/test/system/TSMncl_tools.sh ---------- new directory structure - models/lnd/clm/test/system/TBR.sh ------------------- new directory structure - models/lnd/clm/test/system/TER.sh ------------------- new directory structure - models/lnd/clm/test/system/TSM.sh ------------------- new directory structure - models/lnd/clm/test/system/TSMpergro.sh ------------- new directory structure - models/lnd/clm/test/system/TSMtools.sh -------------- new directory structure - models/lnd/clm/test/system/TSMcnspinup.sh ----------- new directory structure - models/lnd/clm/test/system/TCBext_ccsmseq_cam.sh ---- new directory structure - models/lnd/clm/test/system/TCBtools.sh -------------- new directory structure - models/lnd/clm/test/system/TCText_ccsmcon.sh -------- new directory structure, add blueice - -Summary of testing: - - bluevista: All PASS except -052 smJ11 TSM.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 4 -053 erJ11 TER.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 10+38 arb_ic ...............FAIL! rc= 5 -054 brJ11 TBR.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 24+24 arb_ic ...............FAIL! rc= 5 -102 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - CAM tests: All PASS except: -060 sm711 TSM.sh h5x8adm adia 9s ..................................FAIL! rc= 6 - blueice: - CPL7 test_scripts: ERS.f19_g15.I.blueice, ERB.f19_g15.I.blueice, ERS.f45_g35.I.blueice -FAIL ERB.f19_g15.I.blueice - CPL6 test_scripts: PASS ERT_OS.f19_g15.I.blueice PASS ERH_OS.T31_g35.ICN.blueice - jaguarcnl: All PASS - lightning: All PASS except -019 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 - bangkok/lf95: All PASS except -18 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 -052 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - tempest: All PASS - -CLM tag used for the baseline comparison tests if applicable: ccsm4_alpha25 with clm3_5_18 in place of default clm - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_5_18 -Originator(s): erik (Erik Kluzek) -Date: Thu Feb 21 22:57:39 MST 2008 -One-line Summary: Update to latest seq-ccsm4.alpha tag - -Purpose of changes: Get clm trunk to work with latest ccsm4.alpha24 tag - -Bugs fixed (include bugzilla ID): 678 (get clm to work with latest cpl7) - -Known bugs (include bugzilla ID): 251, 512, 546, 652, 672, 675, 676, 680, - 681, 694, 696, 697, 698, 701, 702, 707, 708 - http://bugs.cgd.ucar.edu/ - - New bugs: 697-- username,version,hostname NOT in seq-driver namelists - 707-- bug on new xlf90 compiler on bluevista for running with CAM - 708-- bug on new xlf90 compiler on bluevista for running with CASA - -Describe any changes made to build system: minor change in configure script - name of mode ext_cam changed to ext_ccsm_seq in configure script - -Describe any changes made to the namelist: Sequential driver namelists change - -ccsm_inparm namelist changes to seq_infodata_inparm - (remove restart_override, username, version, hostname) -timemgr_inparm namelist changes to seq_timemgr_inparm - (remove restart_overrideTMG, stop_final_ymd [use stop_ymd instead] ) - -List any changes to the defaults for the boundary datasets: - Add 2.65x3.33 datasets, newer 1x1_brazil domain file - -Describe any substantial timing or memory changes: None - -Code reviewed by: mvertens (original version on seq branch) - -List any svn externals directories updated (csm_share, mct, etc.): - -drv, datm7, sice, socn, csm_share_, and mct - -src/drv drvseq2_0_07 -src/datm7 drva_datm7_070824_tags/drva07_datm7_071129 -src/sice stubs1_0_7 -src/socn stubs1_0_7 -src/csm_share drva_share3_070903_tags/loga25_share3_071107 -src/utils/mct seqa_MCT2 _3_0_070524_tags/seqa07_MCT2_4_2_071026 - -List all files eliminated: None - -List all files added and what they do: - -A + bld/ExtSeqCCSMDrvInNamelistsDescriptions.xml -- for moving drv_in namelist items -A + bld/clm.cpl7.template ------------------------- for running with cpl7 - -List all existing files that have been modified, and describe the changes: - -------------- Get external CAM tests working, and with changes to seq-ccsm -M test/system/TSMext_ccsmseq_cam.sh -M test/system/test_driver.sh -M test/system/tests_posttag_hybrid_regression -M test/system/tests_posttag_purempi_regression -M test/system/nl_files/scam -M test/system/nl_files/scam_prep -M test/system/nl_files/ext_ccsm_seq_cam -M test/system/TSM.sh - -------------- Now need clm_varpar.F90 in tools -M tools/mksurfdata/Srcfiles -M tools/mkgriddata/Srcfiles - -------------- Add ext_ccsm_seq, add 2.65x3.33 datasets, change for new seq-ccsm namelists - switch 1x1_brazil domain file -M bld/configure -M bld/DefaultCLM_INPARM_Namelist.xml -M bld/run-ibm.csh -M bld/clm_inparm.pm -M bld/DefaultTIMEMGR_INPARM_Namelist.xml -M bld/sample.seqccsm.namelists -M bld/run-pc.csh -M bld/timemgr_inparm.pm -M bld/DefaultCCSM_INPARM_Namelist.xml -M bld/drv_in.pm -M bld/run-lightning.csh -M bld/mkSrcfiles -M bld/SeqCCSM_namelist.pm -M bld/ccsm_inparm.pm -M bld/SeqCCSMDrvInNamelistsDescriptions.xml -M bld/DefaultDATM_DSHR_NML_Namelist.xml - -------------- Don't allow seq_ccsm datatypes to go below lnd_comp_mct, fix scam -M src/main/clm_comp.F90 ------------- Remove SyncClock, CCSMInit -M src/main/driver.F90 --------------- Remove SyncClock, CCSMInit -M src/main/decompInitMod.F90 -------- Use endrun rather than shr_sys_abort -M src/main/ncdio.F90 ---------------- fixes for scam -M src/main/atmdrvMod.F90 ------------ remove unneeded printing -M src/main/clmtypeInitMod.F90 ------- explicit use only's -M src/main/initializeMod.F90 -------- remove CCSMInit and EClock -M src/main/controlMod.F90 ----------- move initialization to timemgr/clm_varctl - set methods -M src/main/clm_time_manager.F90 ----- Make namelist input private, add set method -M src/main/clm_varctl.F90 ----------- Add set and initialization methods -M src/main/clm_varorb.F90 ----------- Remove values not needed -M src/main/lnd_comp_mct.F90 --------- Update to new structures/logic - On time-step 0 also advance to time-step 1 -M src/main/program_off.F90 ---------- Move orbital info/dtime to this level -M src/main/spmdMod.F90 -------------- Change print format -M src/biogeophys/UrbanInputMod.F90 -- Initialize filename - -Summary of testing: - - bluevista: -004 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 5 -008 blA91 TBL.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 5 -011 blD91 TBL.sh _persc_ds clm_per 19981231:YEARLY:1200 4x5 gx3v5 144 arb_ic ....................FAIL! rc= 5 -014 blG71 TBL.sh 17p_sc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic .........FAIL! rc= 5 -016 blH71 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic ......FAIL! rc= 5 -021 blE11 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 5 -026 blF27 TBL.sh 17p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ..............FAIL! rc= 5 -031 blE31 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 48 arb_ic -.......FAIL! rc= 5 -034 blCA1 TBL.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -036 blNB1 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -040 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:MONTHLY:1800 10x15 USGS 48 arb_ic ................FAIL! rc= 5 -046 blH11 TBL.sh 17p_cnnsc_dh clm_std 19980101:MONTHLY:1800 48x96 gx3v5@1890 48 arb_ic ..........FAIL! rc= 5 -050 blH52 TBL.sh 17p_cnnsc_dm clm_std 19980115:MONTHLY:1800 10x15 USGS@1890 48 arb_ic ...........FAIL! rc= 5 -052 smJ11 TSM.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 4 <<<< bug 708 -053 erJ11 TER.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 10+38 arb_ic ...............FAIL! rc= 5 <<<< bug 708 -054 brJ11 TBR.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 24+24 arb_ic ...............FAIL! rc= 5 <<<< bug 708 -055 blJ11 TBL.sh 4p_casasc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 4 -059 blK11 TBL.sh 10p_dgvmsc_dh clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 5 -064 blK71 TBL.sh 10p_dgvmsc_s clm_std 19971231:NONE:1800 1x1_brazil navy -670 arb_ic ............FAIL! rc= 5 -068 blL53 TBL.sh _sc_dh clm_std^nl_crcrop 19980115:MONTHLY:1800 10x15 USGS 24 arb_ic ............FAIL! rc= 5 -072 blL63 TBL.sh _sc_h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup ..................FAIL! rc= 5 -076 bl563 TBL.sh _h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 5 -080 blL52 TBL.sh _sc_ds clm_std 19980115:MONTHLY:1800 10x15 USGS 24 arb_ic ......................FAIL! rc= 5 -084 blL73 TBL.sh _sc_s clm_std 19980101:6_HOURLY:1800 1x1_brazil navy -10 arb_ic ................FAIL! rc= 5 -089 blL83 TBL.sh _sc_dh clm_std 19980115:DAILY:3600 5x5_amazon navy -10 arb_ic ..................FAIL! rc= 5 -101 sm921 TSMext_ccsmseq_cam.sh ext_ccsm_seq_4x5_dh ext_ccsm_seq_cam 48 .........................FAIL! rc= 4 <<<<< bug 707 -102 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 <<<<<< bug 707 - CAM tests all PASS except -060 sm711 TSM.sh h5x8adm adia 9s ..................................FAIL! rc= 6 -062 sc001 TSC.sh e64bfbiop scm_prep scm64bfbiop scm_b4b_o1 7s .....FAIL! rc= 5 - -First was a Build-namelist error, next was core-dump. - - tempest: -004 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 5 -007 blD91 TBL.sh _persc_ds clm_per 19981231:YEARLY:1200 4x5 gx3v5 144 arb_ic ....................FAIL! rc= 5 -010 blE11 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 5 -014 blA92 TBL.sh _sc_dm clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 5 -016 blG71 TBL.sh 17p_sc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic .........FAIL! rc= 5 -018 blH71 TBL.sh 17p_cnnsc_ds clm_pftdyn 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic ......FAIL! rc= 5 - lightning/pathscale: -004 blA91 TBL.sh _sc_dh clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 5 -008 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 5 -011 blCA1 TBL.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -013 blCA2 TBL.sh _sc_ds clm_std^nl_urb 19971231:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -015 blNB1 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -017 blOC1 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 5 -019 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 <<<< bug 694 -026 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:MONTHLY:1800 10x15 USGS 48 arb_ic ................FAIL! rc= 5 -031 blH52 TBL.sh 17p_cnnsc_dm clm_std 19980115:MONTHLY:1800 10x15 USGS@1890 48 arb_ic ...........FAIL! rc= 5 -035 blK51 TBL.sh 10p_dgvmsc_dm clm_std 19981231:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 5 -039 blL51 TBL.sh _sc_dh clm_std 19980115:MONTHLY:1800 10x15 USGS 48 arb_ic ......................FAIL! rc= 5 -043 blL53 TBL.sh _sc_dh clm_std^nl_crcrop 19980115:MONTHLY:1800 10x15 USGS 24 arb_ic ............FAIL! rc= 5 -047 blL73 TBL.sh _sc_s clm_std 19980101:6_HOURLY:1800 1x1_brazil navy -10 arb_ic ................FAIL! rc= 5 - jaguarcnl: -008 blA92 TBL.sh _sc_dm clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 7 -012 blE12 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 7 -016 blE32 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 48 arb_ic .......FAIL! rc= 7 -020 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:MONTHLY:1800 10x15 USGS 48 arb_ic ................FAIL! rc= 7 -024 blH12 TBL.sh 17p_cnnsc_dm clm_std 19980101:MONTHLY:1800 48x96 gx3v5@1890 48 arb_ic ..........FAIL! rc= 7 -028 blJ12 TBL.sh 4p_casasc_dm clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 7 - bangkok/lf95: -004 blA92 TBL.sh _sc_dm clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 7 -008 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 7 -011 blD91 TBL.sh _persc_ds clm_per 19981231:YEARLY:1200 4x5 gx3v5 144 arb_ic ....................FAIL! rc= 7 -014 blCA2 TBL.sh _sc_ds clm_std^nl_urb 19971231:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 7 -016 blOC1 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 7 -018 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 <<<<<< 694 -025 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:MONTHLY:1800 10x15 USGS 48 arb_ic ................FAIL! rc= 7 -030 blH52 TBL.sh 17p_cnnsc_dm clm_std 19980115:MONTHLY:1800 10x15 USGS@1890 48 arb_ic ...........FAIL! rc= 7 -034 blJ12 TBL.sh 4p_casasc_dm clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 7 -038 blK51 TBL.sh 10p_dgvmsc_dm clm_std 19981231:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 7 -042 blL51 TBL.sh _sc_dh clm_std 19980115:MONTHLY:1800 10x15 USGS 48 arb_ic ......................FAIL! rc= 7 -047 blL73 TBL.sh _sc_s clm_std 19980101:6_HOURLY:1800 1x1_brazil navy -10 arb_ic ................FAIL! rc= 7 -052 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - -TBL _sc tests fail because of addition of area-corrected fluxes and addition of running - time-step 1 when time-step 0 is done on initialization. -er111/112 tests fail due to previous bug 694 -sm921/982 test fail on bluevista due to new bug 707 on (compiler bug on bluevista) - -CLM tag used for the baseline comparison tests if applicable: clm3_5_17 - -Changes answers relative to baseline: Yes -- greater than roundoff - - Summarize any changes to answers, i.e., - - what code configurations: Any mode with sequential-CCSM - - what platforms/compilers: ALL - - nature of change: larger than roundoff - -Fluxes in driver are corrected by ratio's of area's from different components. -Also at time-step 0 you also run time-step 1 -- rather than just time-step 0. - -=============================================================== -=============================================================== -Tag name: clm3_5_17 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Wed Feb 6 10:10:17 MST 2008 -One-line Summary: Merge Tony Craig's FMI branch fmi12_clm3_5_16 to the clm trunk - -Purpose of changes: Reducing the debug level in some initialization routines, fixing a few diagnostics, - updating timers, improve the write_diagnostic performance, update of rtm init to improve scaling and performance. - -Bugs fixed (include bugzilla ID): 597 - -Known bugs (include bugzilla ID): 251, 512, 546, 652, 672, 675, 676, 680, 681, 694, 696, 698, 701, 702 - http://bugs.cgd.ucar.edu/ - - New bugs found: datm7 restart files NOT being archived (696), cprnc found to have problems (698), - version autoinsertion in tools (701), test_driver times out on jaguar (702) - -Describe any changes made to build system: Add BUILDPIO CPP variable - -Describe any changes made to the namelist: Add new namelist variables dealing with PIO (see below) - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik,tcraig - -List any svn externals directories updated (csm_share, mct, etc.): pio to pio11_prod - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M doc/UpDateChangeLog.pl ----------------- Tweak update of date to work correctly for both files -M bld/run-frost.csh ---------------------- Tony gets working, add PIO build as commented out, turn querys off, put files - in explicitly, tests new ncd_ options -M src/biogeochem/STATICEcosysDynMod.F90 -- Add timers -M src/main/clm_comp.F90 ------------------ Add timers -M src/main/driver.F90 -------------------- Add timers, add barrier for diagnostics write, change send/recv into reduce (leave option for old code) -M src/main/decompInitMod.F90 ------------- Reduce debug level for initialization -M src/main/initializeMod.F90 ------------- Add timers -M src/main/histFileMod.F90 --------------- PIO option -M src/main/ncdio.F90 --------------------- Work for PIO, new options -M src/main/gen_ncdio_global_subs.csh ----- Work for PIO, new options -M src/main/gen_ncdio_local_subs.csh ------ Work for PIO, new options -M src/main/controlMod.F90 ---------------- Add new namelist items - -History experimental options (mostly for PIO which isn't fully implemented yet) - - o hist_pioflag = logical true if want to turn on hist with pio [.FALSE., .TRUE.] - o ncd_lowmem2d = logical true if want to turn on low memory 2d writes in clm hist [.TRUE., .FALSE.] - o ncd_pio_def = logical true if want default pio use setting [.FALSE., .TRUE.] - o ncd_pio_UseRearranger = logical true if want to use MCT as Rearranger [.TRUE., .FALSE.] - o ncd_pio_UseBoxRearr = logical true if want to use box as Rearranger [.FALSE., .TRUE.] - o ncd_pio_SerialCDF = logical true if want to write with pio serial netcdf mode [.FALSE., .TRUE.] - o ncd_pio_IODOF_rootonly = logical true if want to write history in pio from root only [.FALSE., .TRUE.] - o ncd_pio_DebugLevel = integer pio debug level ( default 2) - o ncd_pio_num_iotasks = integer number of iotasks to use for PIO (default all PEs) - -M src/main/clm_varctl.F90 ----------------- New ncd and PIO history options -M src/main/program_off.F90 ---------------- Add mpi barrier -M src/main/areaMod.F90 -------------------- Improve performance/robustness -M src/main/clm_mct_mod.F90 ---------------- Use pelocs -M src/riverroute/RtmMod.F90 --------------- Add timers, update of rtm init to improve scaling and performance -M test/system/test_driver.sh -------------- Fix for new account names on jaguar/phoenix - -Summary of testing: - - bluevista: All PASS except -021 blE11 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 7 -026 blF27 TBL.sh 17p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ..............FAIL! rc= 7 -031 blE31 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 48 arb_ic .......FAIL! rc= 7 -101 sm921 TSMext_ccsmseq_cam.sh ext_ccsm_seq_4x5_dh ext_ccsm_seq_cam 48 .........................FAIL! rc= 4 -102 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - jaguarcnl: All PASS except -012 blE12 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 7 -016 blE32 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 48 arb_ic .......FAIL! rc= 7 - bangkok/lf95: All PASS except -018 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 -020 bl112 TBL.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 7 -051 sm951 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dm ext_ccsm_seq_cam 48 .......................FAIL! rc= 4 -052 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - lightning/pathscale: All PASS except -019 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 -021 bl112 TBL.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 7 - tempest: All PASS except -010 blE11 TBL.sh 4p_vodsrsc_dh clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 7 - -er112, bl112, sm921, sm951, sm982 tests failed previously -other bl tests fail because of the changes in RTM - -CLM tag used for the baseline comparison tests if applicable: clm3_5_16 - -Changes answers relative to baseline: Only RTM - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: RTM - - what platforms/compilers: All - - nature of change: Roundoff change - - If bitwise differences were observed, how did you show they were no worse - than roundoff? Only fields with RTM show differences and only to roundoff level - - RMS DVOLRDT_ 8.8031E-22 - RMS DVOLRDT_ 3.4573E-23 - RMS QCHANR 3.6282E-16 - RMS QCHOCNR 5.4893E-17 - -The above is on bluevista after running for a day (other fields show RMS difference of zero) - -=============================================================== -=============================================================== -Tag name: clm3_5_16 -Originator(s): erik (Erik Kluzek) -Date: Mon Jan 28 15:00:53 MST 2008 -One-line Summary: Get point version of Urban code onto trunk (urban code can not restart) - -Purpose of changes: Move urban branch onto trunk. Fix bug so hv files are saved. Add - high resolution datasets from Art Mirin. - - Urban code was started by Gordon Bonan, and taken up by Mariana Vertenstein and Keith Oleson. - This represents work that has been ongoing for several years. Revision dates go back to - before 2003. - - Some papers on the work are available from: - - Oleson et.-al. Journal of Applied Meteorology and Climatology, in-Press as of Jan/2008 - - http://www.cgd.ucar.edu/tss/staff/oleson/publications/JAMC1597_rev_jul27_2007.pdf - http://www.cgd.ucar.edu/tss/staff/oleson/publications/JAMC1598_rev_jul27_2007.pdf - -Bugs fixed (include bugzilla ID): 644 (save hv files) - -Known bugs (include bugzilla ID): 251, 512, 546, 652, 672, 675, 676, 680, 681, 694 - http://bugs.cgd.ucar.edu/ - - New bug found from clm3_5_15 (694) -- restarts are NOT bit-for-bit on lightning and bangkok/lf95 for offline - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Added furbinp -- for urban datasets - -List any changes to the defaults for the boundary datasets: Added more urban datasets. - Add 0.23x0.31 datasets from Art Mirin. - -Describe any substantial timing or memory changes: Approx 1% slower, memory should be very close - -Code reviewed by: oleson - -List any svn externals directories updated (csm_share, mct, etc.): bld/archiving - bld/archiving to scripts_080108 - -List all files eliminated: None - -List all files added and what they do: - ------- Urban point input datasets (ASCII) -A bld/urban_input/asphaltjungle_fluxes.txt -A bld/urban_input/metropolis_fluxes.txt -A bld/urban_input/mexicocityMEX_fluxes.txt -A bld/urban_input/vancouverCAN_fluxes.txt ------ Main urban source codes -A src/biogeophys/UrbanInitMod.F90 -A src/biogeophys/UrbanInputMod.F90 -A src/biogeophys/UrbanMod.F90 ------ Add testing for urban code -A test/system/tests_posttag_urban ------ List of urban point tests -A test/system/nl_files/clm_urb1pt ------ Namelist options for CLM1PT datasets -A test/system/nl_files/nl_urb ---------- Urban namelist -A test/system/config_files/_mexsc_ds --- Mexicocity, MEX -A test/system/config_files/_vansc_ds --- Vancouver, CAN ------ Add tool to convert Urban point datasets to sequential-CCSM mode for datm7 -A tools/ncl_scripts/convertUrbanOffline2Seq.ncl - -List all existing files that have been modified, and describe the changes: - --------- Add in urban datasets to build-namelist -M bld/configure ---------------------------- Move subroutine definition to before first reference -M bld/datm_dshr_in.pm -M bld/clm_inparm.pm -M bld/datm.streams.template.xml ------------ Add in CLM1PT datasets for Urban -M bld/DefaultTIMEMGR_INPARM_Namelist.xml -M bld/DefaultSettings.xml -M bld/DefaultDATM_DSHR_NML_Namelist.xml -M bld/DefaultCLM_INPARM_Namelist.xml -M bld/timemgr_inparm.pm -M bld/run-pc.pm ---------------------------- Remove extra line, set mode in configure, add note about step=coupling step -M bld/run-ibm.pm --------------------------- Add note about step=coupling step -M bld/run-lightning.pm --------------------- Add note about step=coupling step --------- source code changes to add in urban code --------- mostly adding urban and non-urban filters -M src/biogeochem/DGVMMod.F90 --------------- Add urban filters -M src/main/atmdrvMod.F90 ------------------- Add RH and rainf, zero out solar if coszen<0, Urban pt CPPs -M src/main/clm_varcon.F90 ------------------ Add PI, RGAS, SECSPDAY, urban PFT types, urban ponding depth -M src/main/clm_varpar.F90 ------------------ Add maxpatch_urb for 5 PFT's -M src/main/clm_atmlnd.F90 ------------------ Fill RH and rainf -M src/main/clmtype.F90 --------------------- Add urban state data -M src/main/clmtypeInitMod.F90 -------------- Initialize urban state data -M src/main/controlMod.F90 ------------------ Add furbinp namelist item for urban input data -M src/main/driver.F90 ---------------------- Pass urban filters, call urban modules -M src/main/filterMod.F90 ------------------- Add urban filters -M src/main/histFileMod.F90 ----------------- Add scale types needed for urban which needs to calculate area-averages based on urban input -M src/main/histFldsMod.F90 ----------------- Add new output fields: - - BUILDHEAT heat flux from urban building interior to walls and roof W/m^2 active - LWdown atmospheric longwave radiation W/m^2 - PSurf surface pressure Pa - Qh sensible heat W/m^2 - Qle total evaporation W/m^2 - Qstor storage heat flux (includes snowmelt) W/m^2 - RH atmospheric relative humidity % - Rainf atmospheric rain mm/s - Rnet net radiation W/m^2 - SWdown atmospheric incident solar radiation W/m^2 - TBUILD internal urban building temperature K active - TRAFFICFLUX sensible heat flux from urban traffic W/m^2 active - Tair atmospheric air temperature K - WASTEHEAT sensible heat flux from heating/cooling sources of urban waste heat W/m^2 active - -(Fields not mentioned above as active are set to inactive unless asked for. They are "ALMA" variables needed for - an urban model intercomparision project.) - -M src/main/iniTimeConst.F90 ---------------- Initialize urban data -M src/main/initGridCellsMod.F90 ------------ Add initialization of urban landunits -M src/main/initSurfAlbMod.F90 -------------- Call urban albedo calc -M src/main/initializeMod.F90 --------------- Urban initialization -M src/main/lnd_comp_mct.F90 ---------------- Add saturation vapor calc to compute RH -M src/main/mkarbinitMod.F90 ---------------- Initialize urban state -M src/main/pftvarcon.F90 ------------------- Fix typo -M src/main/program_off.F90 ----------------- Pass declination angle from orbit to atmdrv (so solar can be nullified for coszen<0) -M src/main/subgridAveMod.F90 --------------- Setup grid info for urban -M src/main/subgridMod.F90 ------------------ Set urban landunit -M src/main/surfrdMod.F90 ------------------- Initialize urban weights -- remove old code that aborted if urban fraction>0 -M src/biogeophys/BalanceCheckMod.F90 ------- Incoming rain does NOT include sun or shade wall, some checks only non-urban -M src/biogeophys/Biogeophysics1Mod.F90 ----- Take into account type of urban column -M src/biogeophys/Biogeophysics2Mod.F90 ----- Take into account type of urban column -M src/biogeophys/FrictionVelocityMod.F90 --- Change index and filters -M src/biogeophys/Hydrology1Mod.F90 --------- Take into account no water flow through urban buildings and impervious road -M src/biogeophys/Hydrology2Mod.F90 --------- Send urban filters down, and no water flow in certain urban column types -M src/biogeophys/SnowHydrologyMod.F90 ------ Urban similar to bare-soil landunit -M src/biogeophys/SoilHydrologyMod.F90 ------ Determine ponding limits for urban roof and impervious road, no runoff for sun/shade wall -M src/biogeophys/SoilTemperatureMod.F90 ---- Take into account that urban columns interact -M src/biogeophys/SurfaceAlbedoMod.F90 ------ Filter urban columns appropriately -M src/biogeophys/SurfaceRadiationMod.F90 --- Filter urban columns out ----------- Make MPI and OpenMP settings explicit in configuration files -M test/system/config_files/17p_vodsr_dm -M test/system/config_files/17p_vodsr_do -M test/system/config_files/4p_casa_m -M test/system/config_files/4p_casa_o -M test/system/config_files/17p_vodsr_m -M test/system/config_files/17p_vodsr_o -M test/system/config_files/4p_vodsr_dm -M test/system/config_files/17p_cnn_m -M test/system/config_files/4p_vodsr_do -M test/system/config_files/17p_cnn_o -M test/system/config_files/17p_cnn_dm -M test/system/config_files/17p_cnn_do -M test/system/config_files/10p_dgvm_m -M test/system/config_files/4p_casa_dm -M test/system/config_files/10p_dgvm_o -M test/system/config_files/4p_casa_do -M test/system/config_files/10p_dgvm_dm -M test/system/config_files/README -M test/system/config_files/10p_dgvm_do -M test/system/config_files/4p_vodsr_m -M test/system/config_files/4p_vodsr_o ----------- Add urban tests to testing system -M test/system/input_tests_master -M test/system/README.testnames -M test/system/mknamelist -M test/system/test_driver.sh -M test/system/tests_posttag_bangkok -M test/system/tests_posttag_blueice -M test/system/tests_posttag_lightning -M test/system/tests_posttag_hybrid_regression -M test/system/tests_posttag_purempi_regression -M test/system/tests_pretag_bangkok -M test/system/tests_pretag_bluevista ----------- Put options on separate lines, explicitly set source -M test/system/nl_files/clm_pftdyn -M test/system/nl_files/clm_per -M test/system/nl_files/clm_per0 -M test/system/nl_files/clm_std ----------- Add note about need of other directories to build -M tools/ncl_scripts/README ---------------------- Also add note about new script -M tools/mksurfdata/README -M tools/ncl_scripts/README -M tools/interpinic/README -M tools/mkgriddata/README -M tools/mkdatadomain/README - - -Summary of testing: - - bluevista: All PASS except -034 blCA1 TBL.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -036 blNB1 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -076 bl563 TBL.sh _h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 7 -101 sm921 TSMext_ccsmseq_cam.sh ext_ccsm_seq_4x5_dh ext_ccsm_seq_cam 48 .........................FAIL! rc= 4 -102 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - tempest: ALL PASS - jaguarcnl: All PASS except TBL tests which fail because of a problem with the previous version on jaguar. -004 blA71 TBL.sh _sc_ds clm_std 19990101:NONE:3600 1x1_brazil navy -10 arb_ic ...................FAIL! rc= 4 -008 blA92 TBL.sh _sc_dm clm_std 19990101:NONE:3600 4x5 gx3v5 -10 arb_ic .........................FAIL! rc= 5 -012 blE12 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic ...............FAIL! rc= 5 -016 blE32 TBL.sh 4p_vodsrsc_dm clm_std 19981231:YEARLY:1800 64x128^360x720 USGS 48 arb_ic .......FAIL! rc= 5 -020 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:MONTHLY:1800 10x15 USGS 48 arb_ic ................FAIL! rc= 5 -024 blH12 TBL.sh 17p_cnnsc_dm clm_std 19980101:MONTHLY:1800 48x96 gx3v5@1890 48 arb_ic ..........FAIL! rc= 5 -028 blJ12 TBL.sh 4p_casasc_dm clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic ..................FAIL! rc= 5 -032 blK12 TBL.sh 10p_dgvmsc_dm clm_std 19981231:NONE:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 5 - bangkok/lf95: All PASS except -014 blCA2 TBL.sh _sc_ds clm_std^nl_urb 19971231:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -016 blOC1 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 5 -018 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 <<<< -020 bl112 TBL.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 7 -051 sm951 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dm ext_ccsm_seq_cam 48 .......................FAIL! rc= 4 -052 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - - lightning/pathf90: All PASS except -011 blCA1 TBL.sh _sc_ds clm_std^nl_urb 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ..........FAIL! rc= 5 -013 blCA2 TBL.sh _sc_ds clm_std^nl_urb 19971231:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic ...FAIL! rc= 5 -015 blNB1 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 159 arb_ic FAIL! rc= 5 -017 blOC1 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 5 -019 er112 TER.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 10+38 arb_ic ..............FAIL! rc= 13 <<<< -021 bl112 TBL.sh 4p_vodsr_dm clm_std 19981231:YEARLY:1800 48x96 gx3v5 48 arb_ic .................FAIL! rc= 7 - - -Urban TBL point tests do NOT pass because previous model version didn't have urban enabled. -cam standalone tests require the ccsm4_alpha series version of clm. -<<<<< Tests are the 694 bug found in clm3_5_15. - - -CLM tag used for the baseline comparison tests if applicable: clm3_5_15 - -Changes answers relative to baseline: None bit-for-bit - (except albedo's will be different when running in offline mode see below) - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: All mode=offline - - what platforms/compilers: All - - nature of change: Solar now set to zero when coszen<0, which influences - some non-common instances near twilight when the dataset shows solar>0 - but coszen<0. It doesn't change the model results -- because everything is - reflected anyway, but it will change how albedo is averaged over those periods. - -=============================================================== -=============================================================== -Tag name: clm3_5_15 -Originator(s): erik (Erik Kluzek) -Date: Fri Dec 21 20:33:01 MST 2007 -One-line Summary: Fix interpinic for half degree grid, add in large-file support, allow configure to work with ccsm directory structure - -Purpose of changes: - -Change configure so it will work with the ccsm4_alpha directory structure (especially for -the test suite). Add in large-file support for main code as well as tools (mksurfdata). -Add in tests for create_croplandunit and large-file support. Get interpinic to work for -half degree, and optimize and verify it's use of Open-MP. Add tool to interpolate -Nitrogen deposition files (ndepregrid.ncl). Update run scripts with suggestions from Sam -(and fix a couple of minor bugs). - -interpinic problem: Previous version may have incorrectly found nearest points for PFT data. - Data would have been valid -- but possibly NOT from the nearest point. - There was also a potential Open-MP problem where answers could change depending on the - number of threads used. The new version corrects both of these problems. The new version - should be used to interpolate critical datasets. - -Bugs fixed (include bugzilla ID): 656 (interpinic), 660 (large-file), 674 (diff -q in run script), 679 (testing task/thread change) - -Known bugs (include bugzilla ID): 251, 512, 546, 652, 664, 672, 675, 676 - http://bugs.cgd.ucar.edu/ - -Describe any changes made to build system: Remove mpi include/lib for jaguarcnl - (as already included with the ftn command) - - Make ccsm_seq -- the default way to run. - -Describe any changes made to the namelist: Add outnc_large_files option - - outnc_large_files --- TRUE => use NetCDF 64-bit large file format for output files - (history and restart files) - - The NetCDF 64-bit large file format became available in NetCDF3.6.0 and allows larger dimensions as well as allowing - output files > 2 GBytes. For more info. on Large File Support (LFS) for NetCDF see... - - http://www.unidata.ucar.edu/software/netcdf/docs/faq.html#lfs - - Since, file offsets are stored with 64-bit words rather than 32-bit words -- file sizes may change slightly with LFS. - -List any changes to the defaults for the boundary datasets: - - Added in new clmi files: - -+lnd/clm2/initdata/clmi.BCN.1980-01-01-00000.071207.nc -+lnd/clm2/initdata/clmi.F_0000-01-01_1.9x2.5_gx1v5_c071203.nc -+lnd/clm2/initdata/clmi.F_0000-09-01_1.9x2.5_gx1v5_c071203.nc - - Added in ndep files at half degree - -+lnd/clm2/ndepdata/ndep_clm_2100_0.47x0.63_c071213.nc -+lnd/clm2/ndepdata/ndep_clm_2000_0.47x0.63_c071213.nc -+lnd/clm2/ndepdata/ndep_clm_1890_0.47x0.63_c071213.nc -+lnd/clm2/ndepdata/fndep_clm_1890-2100_0.47x0.63_c071213.nc - - Add documentation and delete extra variables from T42 base ndep datasets - -+lnd/clm2/ndepdata/ndep_clm_2100_64x128_c071221.nc -+lnd/clm2/ndepdata/ndep_clm_2000_64x128_c071221.nc -+lnd/clm2/ndepdata/ndep_clm_1890_64x128_c071221.nc - - Added in urban testing dataset - -+lnd/clm2/surfdata/surfdata_1x1pt_camdenNJ_navy_070824.nc -+lnd/clm2/griddata/griddata_1x1pt_camdenNJ_navy_070824.nc -+lnd/clm2/griddata/fracdata_1x1pt_camdenNJ_navy_070824.nc - - -Describe any substantial timing or memory changes: None - -Code reviewed by: slevis (interpinic, run-ibm.csh), - thornton (ndepregrid.ncl, outnc_large_files option) - -List any svn externals directories updated (csm_share, mct, etc.): - perl5lib to perl5lib_071204 which includes new Decomp module. - -List all files eliminated: None - -List all files added and what they do: - -Add files for testing different tool configurations and ncl scripts, and for testing of -create_crop_landunit, large_file support, and an urbin test. Also change offline configuration -files so they have offline explicitly set as the mode. - -A + test/system/config_files/tools__ds -A + test/system/config_files/tools__o -A + test/system/TSMncl_tools.sh -A + test/system/nl_files/nl_crcrop -A + test/system/nl_files/nl_std -A + test/system/nl_files/nl_lfiles - -Add ncl script to regrid Nitrogen deposition files - -A + tools/ncl_scripts -A + tools/ncl_scripts/README -A + tools/ncl_scripts/ndepregrid.ncl -A + tools/mkgriddata/mkgriddata.ccsm_dom ------ add sample script for using CCSM domain files - -List all existing files that have been modified, and describe the changes: - - - Testing system updates... - -M test/system/config_files/* <-- offline configure files -- explicitly set offline mode -M test/system/config_files/README -M test/system/tests_posttag_spot1 -M test/system/tests_pretag_jaguar -M test/system/README.testnames -M test/system/tests_pretag_bangkok -M test/system/TCBtools.sh -M test/system/test_driver.sh -M test/system/mknamelist -M test/system/tests_posttag_hybrid_regression -M test/system/tests_posttag_purempi_regression -M test/system/tests_pretag_tempest -M test/system/tests_pretag_bluevista -M test/system/tests_posttag_blueice -M test/system/input_tests_master -M test/system/README -M test/system/TSMtools.sh -M test/system/TCBext_ccsmseq_cam.sh -M test/system/tests_posttag_lightning -M test/system/TBLtools.sh -M test/system/TSM.sh - - Update tools makefile and change svn keyword strings - -M tools/mksurfdata/mkvarctl.F90 -M tools/mksurfdata/README -M tools/mksurfdata/mkfileMod.F90 -M tools/mksurfdata/mksrfdat.F90 -M tools/mksurfdata/Makefile -M tools/interpinic/interpinic.F90 -M tools/interpinic/Srcfiles -M tools/interpinic/Makefile -M tools/mkgriddata/creategridMod.F90 -M tools/mkgriddata/Makefile -M tools/mkdatadomain/Makefile -M tools/README - -M bld/configure ---------------------- changes to work with ccsm4.alpha directory structure, and jaguarcnl -M bld/DefaultCLM_INPARM_Namelist.xml - Add new datasets -M bld/Makefile.in -------------------- changes needed for jaguarcnl and Darwin -M bld/scpDefaultNamelist.pl ---------- extend to work with ndep files - Make changes to run scripts -- move section of things to change to top - Remove stuff not used. Add more documentation. Add suggestions from Sam Levis. -M bld/run-ibm.csh -------------------- remove -q option to diff -M bld/run-lightning.csh -------------- add bit about comparing rpointer files to see if advancing from run-ibm.csh -M bld/run-pc.csh --------------------- add bit about comparing rpointer files to see if advancing from run-ibm.csh - - Add large-file support - -M src/biogeochem/CASAMod.F90 -M src/biogeochem/DGVMMod.F90 -M src/main/ncdio.F90 -M src/main/restFileMod.F90 -M src/main/controlMod.F90 -M src/main/clm_varctl.F90 - -Summary of testing: - - tempest: All PASS - bluevista: All PASS, except -033 smEA1 TSM.sh _sc_ds clm_std 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic .................FAIL! rc= 10 --> Urban not active yet -034 blEA1 TBL.sh _sc_ds clm_std 19981001:NONE:3600 1x1_camdenNJ navy -90 arb_ic .................FAIL! rc= 4 ---> Urban not active yet -066 blL53 TBL.sh _sc_dh clm_std^nl_crcrop 19980115:MONTHLY:1800 10x15 USGS 24 arb_ic ............FAIL! rc= 5 ---> New test -070 blL63 TBL.sh _sc_h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup ..................FAIL! rc= 7 ---> New clmi file -074 bl563 TBL.sh _h clm_std 19980101:MONTHLY:1800 1.9x2.5 gx1v5 -10 startup .....................FAIL! rc= 7 ---> New clmi file -092 bl711 TBLtools.sh mksurfdata tools__ds namelist .............................................FAIL! rc= 4 ---> Test changed -094 bl771 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 4 ---> Test changed -099 sm921 TSMext_ccsmseq_cam.sh ext_ccsm_seq_4x5_dh ext_ccsm_seq_cam 48 .........................FAIL! rc= 4 -100 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - jaguarcnl: ALL PASS, except TBL tests because previous code didn't run on jaguar with recent changes - lightning: ALL PASS, except -035 blL53 TBL.sh _sc_dh clm_std^nl_crcrop 19980115:MONTHLY:1800 10x15 USGS 24 arb_ic ............FAIL! rc= 5 ---> New test -042 bl771 TBLtools.sh mksurfdata tools__ds singlept .............................................FAIL! rc= 5 ---> New test - bangkok/lf95: All PASS, except -047 sm951 TSMext_ccsmseq_cam.sh ext_ccsm_seq_10x15_dm ext_ccsm_seq_cam 48 .......................FAIL! rc= 4 -048 sm982 TSCext_ccsmseq_scam.sh ext_ccsm_seq_64x128_s scam_prep scam_ds scam 3 .................FAIL! rc= 4 - - CAM tests fail because of incomptabilities of csm_share code. - -CLM tag used for the baseline comparison tests if applicable: clm3_5_14 - -Changes answers relative to baseline: None -- bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_5_14 -Originator(s): erik (Erik Kluzek) -Date: Thu Nov 29 12:18:47 MST 2007 -One-line Summary: Use build-streams, and archiving, multiple bug-fixes - -Purpose of changes: Move bstrms5_clm3_5_13 to trunk - -Remove long-term archiving from clm code. Use Mat's long-term and short-term archiving -scripts like cam. Short term script runs at the end of your run script -- then the -long-term archiving script is submitted to the batch que at the end. Update to newer -version of csm_share that doesn't have any mss_ options. Tune usage of build-namelist. -Make streams file on the fly. Remove references to get_env and $HEADUrl$. Fix interpinic -for CASA and RTM (from Sam). Change testing from being done in offline mode to -seq_ccsm mode. Make default in run scripts to run seq_ccsm mode. Add option to run scripts -to resubmit itself until reaches a given model date. - -Add in HCSOI and HCSOISNO from Dave Lawrence. Add PERGRO test to test suite. Simple PERGRO -fix from Jerry Olson. Use branch of driver code for seq-ccsm and removing archiving. Add -in lnd_comp_mct changes from ccsm4.alpha series. - -Bugs fixed (include bugzilla ID): 449 (create_crop), 548 (rm getenv), 579 (cam config), -Changes answers relative to baseline: None - - To verify bit-for-bit ran standard offline test case (bl111) on: tempest, bluevista, bangkok - (pass on bangkok, and bluevista -- but failed on tempest) - -=============================================================== -=============================================================== -Tag name: clm3_5_13 -Originator(s): erik (Erik Kluzek) -Date: Fri Nov 16 10:17:38 MST 2007 -One-line Summary: Update xml file with file needed for ccsm3_5_beta18 - -Describe any changes made to build system: Add models/utils/perl5lib to path for perl tools - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: New 0.47x0.63 fraction - dataset compatible with CCSM datasets - -Describe any substantial timing or memory changes: None - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all subroutines eliminated: None - -List all subroutines added and what they do: - -A bld/scpDefaultNamelist.pl -- Script to help copy files in xml database. - -List all existing files that have been modified, and describe the changes: - -M bld/configure --- add models/util to path -M bld/DefaultCLM_INPARM_Namelist.xml -- add new file -M bld/queryDefaultNamelist.pl --- add models/util to path -M bld/build-namelist --- add models/util to path - -Summary of testing: None - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm3_5_12 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Thu Nov 8 13:49:25 MST 2007 -One-line Summary: Tag with new files needed for ccsm3_5_beta17 - -Purpose of changes: Add new files needed for new resolutions being adding in ccsm3_5_beta17 - -Bugs fixed (include bugzilla ID): None - -Describe any changes made to build system: Small changes to configure from bstrms branch - -Describe any changes made to the namelist: Add new files to Default*.xml files - -List any changes to the defaults for the boundary datasets: New resolutions added - -Describe any substantial timing or memory changes: None - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all existing files that have been modified, and describe the changes: - -Move files over from the bstrms3_clm3_5_11 branch with the new resolutions needed. - -M bld/configure -M bld/DefaultCLM_INPARM_Namelist.xml -M bld/DefaultDATM_NML_Namelist.xml -M bld/DefaultSettings.xml -M bld/DefaultTIMEMGR_INPARM_Namelist.xml -M bld/DefaultPROF_INPARM_Namelist.xml -M bld/queryDefaultNamelist.pl -M bld/DefaultCCSM_INPARM_Namelist.xml -M bld/build-namelist -M bld/DefaultDATM_DSHR_NML_Namelist.xml - -Summary of testing: None - -Changes answers relative to baseline: None - -=============================================================== -=============================================================== -Tag name: clm3_5_11 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Sep 28 12:03:30 MDT 2007 -Date:One-line Summary: Update datasets in the DefaultCLM file for 0.23x0.31, 0.47x0.63, 0.9x1.25 and add fndepdyn file for 1.9x2.5 - -Purpose of changes: Needed for CCSM 20th Century simulation needed for ccsm3_5_beta13 - -Bugs fixed (include bugzilla ID): 585, 589, 593, 611 - - Add T42_gx1v5, 0.9x1.25_gx1v5 support. - also look in scripts/ccsm_utils/Tools for perl5lib. - abort if set -cycle_begyr or cycle_nyrs on namelist rather than on build-namelist command-line. - -Known bugs (include bugzilla ID): 251, 449, 512, 546, 608, 618, 622, 624 - - New nasty bugs found: - -618 You can't add new fields using: hist_fincl*. -622 CLM blindly continues even if needed fields are missing from surface dataset. - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Just add more files to XML database - -List any changes to the defaults for the boundary datasets: Add new files for: - 0.23x0.31, 0.47x0.63, 0.9x1.25, (64x128 with mask=gx1v5) and add fndepdyn file for 1.9x2.5 - -Describe any substantial timing or memory changes: None - -Code reviewed by: None - -List any svn externals directories updated (csm_share, mct, etc.): csm_share updated to trunk_tags/share3_070927 - - This is the version needed in ccsm3_5_beta13 tag (previous version causes problems building on tempest) - -List all subroutines eliminated: None - -List all subroutines added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M bld/DefaultCLM_INPARM_Namelist.xml ---- Add new datasets. -M bld/clm_inparm.pm --------------------- Abort if try to define cycle_nyr and cycle_begyr on namelist - rather than with command line options. -M bld/queryDefaultNamelist.pl ----------- Add ability to use perl5lib from under ccsm_utils/scripts/Tools. -M bld/build-namelist -------------------- Add ability to use perl5lib from under ccsm_utils/scripts/Tools. - - ------------------------- Remove test blZ11 (can't do the comparision), and update cam tag comparing to. -M test/system/tests_pretag_bangkok -M test/system/test_driver.sh -M test/system/tests_posttag_purempi_regression -M test/system/tests_posttag_hybrid_regression -M test/system/tests_pretag_bluevista -M test/system/tests_posttag_lightning - -Summary of testing: None - -Changes answers relative to baseline: No clm source code changed - -=============================================================== -=============================================================== -Tag name: clm3_5_10 -Originator(s): jet -Date: Tue Sep 18 12:00:23 MDT 2007 -Date:One-line Summary: Fixed scam bugs when reading initial land dataset - and moved scam_setlatlon functionality to shr_scam_mod in - csm_shr repos. Merged in Mariana's changes to add new boundary - dataset file to help scam determine land/ocn/ice fractions. - -Purpose of changes: Fix scam bugs and refactor code to allow scam to easily - determine land/ocean/ice fractions. - -Bugs fixed (include bugzilla ID): 612, 480 - -Known bugs (include bugzilla ID): 251, 449, 512, 546, 608, 618, 622 - -Describe any changes made to build system: Change configure to include new focndomain file. - -Describe any changes made to the namelist: focndomain file added to ocn_in - -List any changes to the defaults for the boundary datasets: Mariana created - a new focndomain boundary dataset (at the standard resolutions) which - describe the grid fraction of land/ocn/ice - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mariana - -List any svn externals directories updated (csm_share, mct, etc.): - - clm3_5_10 - branches/scm_drvseq1_0_43 - branches/csm_share3_070824_scm - -List all subroutines eliminated: scam_setlatlonidx.F90 - -List all subroutines added and what they do: moved scm functionality - from scam_setlatlonidx.F90 into a csm_share module that can - now be used by all surface models. - -List all existing files that have been modified, and describe the changes: -M test/system/test_driver.sh - use latest cam in testing -M test/system/nl_files/scam - fixed scam bug -M test/system/nl_files/scam_prep - fixed scam bug -M test/system/nl_files/ext_ccsm_seq_cam - use latest cam in testing -M SVN_EXTERNAL_DIRECTORIES - point to needed external dirs -M src/biogeochem/STATICEcosysDynMod.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/ncdio.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/initializeMod.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/iniTimeConst.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/restFileMod.F90 - use new shr code instead of scam_setlatlonidx.F90 -D src/main/scam_setlatlonidx.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/clm_varctl.F90 - use new shr code instead of scam_setlatlonidx.F90 -M src/main/surfrdMod.F90 - use new shr code instead of scam_setlatlonidx.F90 -Summary of testing: - - bluevista: Everything but ccsm tests pass ( due to requirment on external - directories) - - bangkok/lf95: all passed except ccsm - expected due to requirment on external - directories - tempest all passed except 034 br531 (failed previous to this commit) - - CLM tag used for the baseline comparison tests if applicable: clm3_5_09 - -Changes answers relative to baseline: None - -=============================================================== -=============================================================== -Tag name: clm3_5_09 -Originator(s): erik (Kluzek Erik 1326 CGD) -Date: Fri Aug 31 13:58:46 MDT 2007 -Date:One-line Summary: Change configure to NOT have csm_share code for ccsm_con option, and add in 1x1.25 file, and update datm7 and csm_share - -Purpose of changes: Fix for ccsm3_5_beta12 tag - -Bugs fixed (include bugzilla ID): 581, 583 - -Known bugs (include bugzilla ID): 251, 449, 512, 546, 608,found with a suggested fix by Inez Fung - -Bugs fixed (include bugzilla ID): 389 (partial), 442, 443, 445, 450 - -Describe any changes made to build system: Fix build for jaguar and phoenix - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: nanr, slevis, dlawren, oleson, and bonan reviewed the mklai changes - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all subroutines eliminated: None - -List all subroutines added and what they do: Documentation files - -A + doc/README.DGVM -A + doc/KnownBugs - -List all existing files that have been modified, and describe the changes: - ----------------------> Improve testing -M test/system/nl_files/t31_cnall -M test/system/nl_files/singlept_dgvm_long -M test/system/nl_files/1.9x2.5 -M test/system/nl_files/t31_dgvm -M test/system/nl_files/singlept -M test/system/nl_files/10x15_cnall -M test/system/nl_files/10x15_dgvm -M test/system/nl_files/t31_casa -M test/system/nl_files/regional -M test/system/nl_files/10x15_pftdyn -M test/system/nl_files/t31_dgvm_long -M test/system/nl_files/t42half -M test/system/nl_files/t31 -M test/system/nl_files/10x15 -M test/system/tests_posttag_robin -M test/system/input_tests_master -M test/system/tests_pretag_jaguar -M test/system/tests_posttag_phoenix -M test/system/test_driver.sh -M test/system/TSCscam.sh - ----------------------> Change calculation of LAI,SAI,Canopy-top/bottom so weighted by %-PFT -M tools/mksurfdata/mkfmax.F90 -M tools/mksurfdata/mklaiMod.F90 -M tools/mksurfdata/mkglacier.F90 -M tools/mksurfdata/mkurban.F90 -M tools/mksurfdata/mksoitex.F90 -M tools/mksurfdata/areaMod.F90 -M tools/mksurfdata/mksrfdat.F90 -M tools/mksurfdata/Srcfiles -M tools/mksurfdata/mksoicol.F90 -M tools/mksurfdata/mkpftMod.F90 - ----------------------> Use new default files at T42, add and correct documentation -M bld/run-pc.csh -M bld/run-lightning.csh -M bld/Makefile.in -M bld/run-ibm.csh -M bld/config_clm_defaults.xml -M bld/system_defaults.xml -M bld/run-frost.csh - ----------------------> Remove uneeded shr_sys_flush, put #ifndef UNICOSMP around shr_sys_flush(6), correct MCT vector calls - needed for phoenix/robin build. - -M src/biogeochem/CNCStateUpdate2Mod.F90 -M src/biogeochem/CNGapMortalityMod.F90 -M src/biogeochem/CNC13StateUpdate2Mod.F90 -M src/biogeochem/CNFireMod.F90 -M src/biogeochem/CASAMod.F90 -------------------> Fix CASA by uncommenting lines according to Inez Fung -M src/biogeochem/CNPrecisionControlMod.F90 -M src/biogeochem/DUSTMod.F90 -------------------> Changes from Natalie M. and Francis Vitt for CAM/CLM3.5 Aerosols -M src/biogeochem/CNPhenologyMod.F90 -M src/biogeochem/CNCStateUpdate1Mod.F90 -M src/biogeochem/CNDecompMod.F90 -M src/biogeochem/CNCStateUpdate3Mod.F90 -M src/biogeochem/CNC13StateUpdate1Mod.F90 -M src/biogeochem/CNC13StateUpdate3Mod.F90 -M src/biogeochem/CNAllocationMod.F90 -M src/biogeochem/CNC13FluxMod.F90 -M src/biogeochem/CNEcosystemDynMod.F90 -M src/biogeochem/CNVegStructUpdateMod.F90 -M src/main/inicFileMod.F90 -M src/main/abortutils.F90 -M src/main/driver.F90 -M src/main/ncdio.F90 -M src/main/atmdrvMod.F90 -----------------------> Changes from Keith O. to fix TKFRZ change -M src/main/initializeMod.F90 -M src/main/clmtypeInitMod.F90 -M src/main/histFileMod.F90 -M src/main/clm_csmMod.F90 -M src/main/controlMod.F90 ----------------------> Fix #ifdef's so extra namelist items only on for COUP_CSM or OFFLINE -M src/main/initSurfAlbMod.F90 -M src/main/clm_time_manager.F90 -M src/main/initGridCellsMod.F90 -M src/main/program_off.F90 -M src/main/surfrdMod.F90 -M src/main/decompMod.F90 -M src/main/areaMod.F90 -M src/main/clm_mct_mod.F90 -M src/riverroute/RtmMod.F90 -M src/biogeophys/SurfaceRadiationMod.F90 -M src/biogeophys/SurfaceAlbedoMod.F90 -M src/biogeophys/Hydrology2Mod.F90 -M src/biogeophys/CanopyFluxesMod.F90 - -Summary of testing: - - bluevista: All PASS except -004 bl111 TBL.sh 4p_vodsr_dh t31 48 ...............................FAIL! rc= -009 bl127 TBL.sh 17p_vodsr_dh t31 48 ..............................FAIL! rc= -014 bl131 TBL.sh 4p_vodsr_dh t42half 48 ...........................FAIL! rc= -019 bl141 TBL.sh 17p__dh 10x15_pftdyn 48 ..........................FAIL! rc= -024 bl211 TBL.sh 17p_cnn_dh t31_cnall 48 ..........................FAIL! rc= -028 bl311 TBL.sh 4p_casa_dh t31_casa 48 ...........................FAIL! rc= -032 bl411 TBL.sh 10p_dgvm_dh t31_dgvm 48 ..........................FAIL! rc= -037 bl471 TBL.sh 10p_dgvm_s singlept_dgvm_long -730 ...............FAIL! rc= -041 bl563 TBL.sh _h 1.9x2.5 -10 ...................................FAIL! rc= -045 bl552 TBL.sh _ds 10x15 24 .....................................FAIL! rc= -049 bl573 TBL.sh _s singlept -10 ..................................FAIL! rc= -053 bl583 TBL.sh _dh regional -10 .................................FAIL! rc= -057 bl711 TBLtools.sh mksurfdata namelist .........................FAIL! rc= -059 bl771 TBLtools.sh mksurfdata singlept .........................FAIL! rc= -062 sm061 TSMconccsm.sh ERS f19_g13 ...............................FAIL! rc= 7 - lightning: All PASS except -004 bl112 TBL.sh 4p_vodsr_dm t31 48 ...............................FAIL! rc= -009 bl142 TBL.sh 17p__dm 10x15_pftdyn 48 ..........................FAIL! rc= -014 bl252 TBL.sh 17p_cnn_dm 10x15_cnall 48 ........................FAIL! rc= -018 bl451 TBL.sh 10p_dgvm_dm 10x15_dgvm 48 ........................FAIL! rc= -019 sm551 TSM.sh _dh 10x15 48 .....................................FAIL! rc= 8 -020 er551 TER.sh _dh 10x15 10+38 ..................................FAIL! rc= 5 -021 br551 TBR.sh _dh 10x15 24+24 ..................................FAIL! rc= 5 -022 bl551 TBL.sh _dh 10x15 48 .....................................FAIL! rc= -026 bl573 TBL.sh _s singlept -10 ..................................FAIL! rc= -029 bl771 TBLtools.sh mksurfdata singlept .........................FAIL! rc= - bangkok/lf95: -004 bl112 TBL.sh 4p_vodsr_dm t31 48 ...............................FAIL! rc= -009 bl142 TBL.sh 17p__dm 10x15_pftdyn 48 ..........................FAIL! rc= -014 bl252 TBL.sh 17p_cnn_dm 10x15_cnall 48 ........................FAIL! rc= -018 bl312 TBL.sh 4p_casa_dm t31_casa 48 ...........................FAIL! rc= -022 bl451 TBL.sh 10p_dgvm_dm 10x15_dgvm 48 ........................FAIL! rc= -026 bl551 TBL.sh _dh 10x15 48 .....................................FAIL! rc= -030 bl573 TBL.sh _s singlept -10 ..................................FAIL! rc= -033 sm982 TSCscam.sh seqccsm_64x128_s scam_prep scam_ds scam 7 ....FAIL! rc= 4 - robin: All compile tests pass - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_98 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: new LAI, TKFRZ change is roundoff different, Dust and CASA changes are significant - -=============================================================== -=============================================================== -Tag name: clm3_expa_98 -Originator(s): erik (KLUZEK ERIK 1326 CGD) -Date: Wed Apr 18 09:51:53 MDT 2007 -One-line Summary: Move externals to top, make SOM4 the default, rename setidx file, use new datafiles, - remove NUMLONS read, tweak testing, remove shell_cmd, remove read of old surfdata file - -Purpose of changes: Some simple cleanup preparing for CLM3.5 release - -Bugs fixed (include bugzilla ID): 440, 441 - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Use new datasets - -List any changes to the defaults for the boundary datasets: Use new NCEP forcing datasets, - and new Nitrogen deposition datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - Directories are the same -- but SVN externals themselves moved to top level - -List all subroutines eliminated: - -D test/system/tests_pretag_blueice > Rename to posttag filename -D bld/empty -----------------------> Rename to usr.src -D src/main/setlatlonidx.F90 -------> Rename to scam_setlatlonidx.F90 filename -D src/main/system_cmd.c -D src/main/cfort.h -D src/SVN_EXTERNAL_DIRECTORIES ----> Move to top layer - -List all subroutines added and what they do: - - -------------------> Files renamed from above -A + test/system/tests_posttag_blueice -A + bld/usr.src -A + SVN_EXTERNAL_DIRECTORIES -A + src/main/scam_setlatlonidx.F90 - - -------------------> New files -A test/system/config_files/10p_dgvm_s -------> New DGVM test -A + test/system/tests_posttag_blueice ---------> Rename -A test/system/tests_posttag_robin -----------> Add tests for robin/phoenix -A test/system/tests_posttag_phoenix -A test/system/nl_files/singlept_dgvm_long ---> Add new singlept DGVM test - -------------------> Add new documentation README files -A tools/README -A bld/README -A Copyright ----> CCSM Copyright file -A README - -List all existing files that have been modified, and describe the changes: - - -------------------> Tweak testing -- use new datasets, increase diversity of testing -M test/system/tests_pretag_bluevista -M test/system/nl_files/t31_cnall -M test/system/nl_files/1.9x2.5 -M test/system/nl_files/t31_dgvm -M test/system/nl_files/singlept -M test/system/nl_files/10x15_cnall -M test/system/nl_files/10x15_dgvm -M test/system/nl_files/t31_casa -M test/system/nl_files/regional -M test/system/nl_files/10x15_pftdyn -M test/system/nl_files/t31_dgvm_long -M test/system/nl_files/t42half -M test/system/nl_files/t31 -M test/system/nl_files/10x15 -M test/system/input_tests_master -M test/system/test_driver.sh - ---------------------> Remove system_cmd.c from list of source files needed to compile -M tools/mksurfdata/Srcfiles -M tools/interpinic/interpinic.F90 <--- fix interpinic compile on bluevista -M tools/mkgriddata/Srcfiles - ---------------------> Use new datasets, make sure works -M bld/run-pc.csh -M bld/configure ---- Remove SOM4 CPP declaration -M bld/run-lightning.csh -M bld/run-ibm.csh -M bld/run-frost.csh - ---------------------> Make SOM4 the default remove other option, remove read of NUMLON - ---------------------> Remove read of old surfdata sets, remove shell_cmd -M src/biogeochem/CNDecompMod.F90 -M src/biogeochem/STATICEcosysDynMod.F90 -M src/main/ncdio.F90 -M src/main/fileutils.F90 -----> Remove shell_cmd as unused now. -M src/main/iniTimeConst.F90 -M src/main/clm_varsur.F90 -M src/main/surfrdMod.F90 - -Summary of testing: - - bluevista: All PASS, except -062 sm061 TSMconccsm.sh ERS f19_g13 ...............................FAIL! rc= 7 - bangkok/lf95: All PASS - tempest: All PASS, except -033 sm982 TSCscam.sh seqccsm_64x128_s scam_prep scam_ds scam 7 ....FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_97 - -=============================================================== -=============================================================== -Tag name: clm3_expa_97 -Originator(s): erik (KLUZEK ERIK 1326 CGD) -Date: Wed Apr 11 12:18:32 MDT 2007 -One-line Summary: Remove SPMD, update to clm proc tag, update timing, improve testing - -Purpose of changes: - Remove SPMD #ifdefs -- use mpi-serial code - Remove COUP_CAM #ifdefs for SEQ_MCT || SEQ_ESMF - Remove LOCAL_DEBUG CPP #ifdefs - Update to prof05_clm3_expa_92 tag (timing changes, SCAM fixes) - Update timing library to latest - Fix bugs - Improve test suite - Change scripts so will rebuild each time (only configure first time if config file DNE) - Change tool Makefile to be consistent and have USER_ overload options. - Add script to update ChangeLog - -Bugs fixed (include bugzilla ID): 337, 361, 389(partial), 407, 408, 417, 428 - 337 -- SPMD - 361 -- IRIX - 389 -- Testing - 407 -- Single gridcell - 408 -- mksurfdata,mkgriddata compiling - 417 -- write last file to mss correctly - 428 -- pdt-dyn mode now restarts correctly - -Describe any changes made to build system: Remove HIDE_MPI, remove - stuff left over from CAM Makefile, put FORTRAN name definition in configure - remove LOCAL_DEBUG CPP #ifdefs - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: mvertens, oleson, thornton (all just briefly) - -List any svn externals directories updated (csm_share, mct, etc.): - Update csm_share to share3_070321 - Update timing to timing_070328 - -List all subroutines eliminated: - -D bld/run-sgi.csh --------------------> Remove SGI run script -D test/system/tests_pretag_bluesky ---> Remove since bluesky is gone -D tools/mksurfdata/mksrfdat.namelist -> Change name to mksurfdata.namelist - - -------> Rename interpinic files to *.F90 - -D tools/interpinic/fmain.f90 -D tools/interpinic/wrap_nf.f90 -D tools/interpinic/shr_kind_mod.f90 -D tools/interpinic/interpinic.f90 -D tools/interpinic/addglobal.f90 - - --------> Remove file no longer needed by SCAM or for SPMD mode -D src/main/getnetcdfdata.F90 -D src/main/mpiinc.F90 - - -List all subroutines added and what they do: - -------- Add concurrent and sequential CCSM tests, add more resolutions, improve tools tests -A test/system/TSMconccsm.sh ----------- Concurrent CCSM test ---------------------> New configurations to test -A test/system/config_files/scam_ds -A test/system/config_files/_h -A test/system/config_files/_dh -A test/system/config_files/_m -A test/system/config_files/_o -A test/system/config_files/_dm -A test/system/config_files/_do -A test/system/config_files/_s -A test/system/config_files/_ds -A test/system/config_files/seqccsm_4x5_dh -A test/system/config_files/seqccsm_64x128_s -A test/system/config_files/seqccsm_10x15_dm -A test/system/config_files/17p__m -A test/system/config_files/17p__o -A test/system/config_files/17p__dh -A test/system/config_files/17p__dm -A test/system/config_files/17p__do -A test/system/config_files/17p__h -A test/system/TSMseqccsm.sh ------------- Sequential CCSM test ---------------------> New namelists and resolutions to test -A test/system/nl_files/scam -A test/system/nl_files/1.9x2.5 -A test/system/nl_files/singlept -A test/system/nl_files/10x15_cnall -A test/system/nl_files/10x15_dgvm -A test/system/nl_files/seqccsm -A test/system/nl_files/regional -A test/system/nl_files/scam_prep -A test/system/nl_files/10x15 -A test/system/README -A test/system/TCBseqccsm.sh --------> Sequential CCSM configure/build -A test/system/TSCscam.sh -----------> Sequential CCSM SCAM mode configure/build -A test/system/TCTconccsm.sh --------> CCSM create-test -A test/system/TBLtools.sh ----------> Compare tools to baseline version - ------------ add singlept and regional tests -A tools/mksurfdata/mksurfdata.singlept -A tools/mksurfdata/mksurfdata.regional -A + tools/mksurfdata/mksurfdata.namelist - ------------ Get improved code from Sam Levis (change names to *.F90) - -A tools/interpinic/interpinic.runoptions -A + tools/interpinic/fmain.F90 -A tools/interpinic/clmi_1999-01-02_10x15_c070330.nc <---- Test file -A + tools/interpinic/wrap_nf.F90 -A tools/interpinic/Filepath -A + tools/interpinic/interpinic.F90 -A + tools/interpinic/addglobal.F90 -A tools/interpinic/Srcfiles ------------ add singlept and regional tests -A tools/mkgriddata/mkgriddata.singlept -A tools/mkgriddata/mkgriddata.regional - ------------ Help to update ChangeLog -A doc/UpDateChangeLog.pl - ------------ New code needed for SCAM mode -A + src/main/setlatlonidx.F90 - - -List all existing files that have been modified, and describe the changes: - ------------ Improve test system (tweak tests, add new tests to various machines) -M test/system/tests_pretag_bluevista -M test/system/nl_files/t31_cnall -M test/system/nl_files/t31_dgvm -M test/system/nl_files/t31_casa -M test/system/nl_files/10x15_pftdyn -M test/system/nl_files/t31_dgvm_long -M test/system/nl_files/t42half -M test/system/nl_files/t31 -M test/system/CLM_runcmnd.sh ------- Use mpirun instead of mpiexec on bangkok/calgary -M test/system/tests_pretag_blueice -M test/system/input_tests_master -M test/system/tests_pretag_jaguar -M test/system/TSMtools.sh -M test/system/tests_pretag_bangkok -M test/system/TCBtools.sh -M test/system/test_driver.sh -M test/system/tests_pretag_tempest -M test/system/tests_posttag_lightning - ------------ Get tools to build -M tools/mksurfdata/mklaiMod.F90 -M tools/mksurfdata/mkfileMod.F90 -M tools/mksurfdata/creategridMod.F90 -M tools/mksurfdata/Srcfiles -M tools/mksurfdata/Makefile ------ Make makefile consistent and add USER_ options -M tools/interpinic/Makefile ------ Make makefile consistent and add USER_ options -M tools/mkgriddata/mkgriddata.F90 -M tools/mkgriddata/creategridMod.F90 -M tools/mkgriddata/Srcfiles -M tools/mkgriddata/Makefile ------ Make makefile consistent and add USER_ options - ------------ Improvements to run scripts and build system - Change scripts so will rebuild each time (only configure first time if config file DNE), remove left over - features from CAM Makefile. -M bld/run-pc.csh -M bld/configure -M bld/run-lightning.csh -M bld/Makefile.in -M bld/run-ibm.csh -M bld/run-frost.csh - ------------ Source code changes, removing SPMD #ifdef, LOCAL_DEBUG, get SCAM mode working with new CAM, change - to work with new timing library, fix code bugs above. Remove COUP_CAM #ifdefs for SEQ_MCT || SEQ_ESMF -M src/biogeochem/CASAMod.F90 -M src/biogeochem/CNPhenologyMod.F90 -M src/biogeochem/STATICEcosysDynMod.F90 -M src/biogeochem/DGVMMod.F90 -M src/biogeochem/CNAllocationMod.F90 -M src/biogeochem/CNVegStructUpdateMod.F90 -M src/main/spmdGathScatMod.F90 -M src/main/abortutils.F90 -M src/main/clm_comp.F90 -M src/main/driver.F90 -M src/main/ncdio.F90 -M src/main/atmdrvMod.F90 -M src/main/fileutils.F90 -M src/main/pftdynMod.F90 -M src/main/iniTimeConst.F90 -M src/main/histFileMod.F90 -M src/main/program_csm.F90 -M src/main/restFileMod.F90 -M src/main/clm_csmMod.F90 -M src/main/controlMod.F90 -M src/main/ndepFileMod.F90 -M src/main/initGridCellsMod.F90 -M src/main/lnd_comp_mct.F90 -M src/main/program_off.F90 -M src/main/pftvarcon.F90 -M src/main/spmdMod.F90 -M src/main/surfrdMod.F90 -M src/main/decompMod.F90 -M src/main/areaMod.F90 -M src/main/iobinary.F90 -M src/main/do_close_dispose.F90 -M src/riverroute/RtmMod.F90 -M src/biogeophys/Hydrology2Mod.F90 -M src/biogeophys/BiogeophysRestMod.F90 - -Summary of testing: - - tempest: ALL PASS - bluevista: -019 bl141 TBL.sh 17p_vodsr_dh 10x15_pftdyn 48 .....................FAIL! rc= 7 -022 er211 TER.sh 17p_cnn_dh t31_cnall 10+38 .......................FAIL! rc= 6 -059 sm061 TSMconccsm.sh ERS f19_g13 ...............................FAIL! rc= 5 - bangkok/lf95: -033 sm982 TSCscam.sh seqccsm_64x128_s scam_prep scam_ds scam 7 ....FAIL! rc= 4 - -TBL test fails because of restart trouble with pftdyn. -Concurrent CCSM test fails because of a problem with ccsm3_5_beta01 for datm7. -bangkok scam test fails as is says that scm_crm_mode is not initialized in -CAM code. - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_96 - (had to add in new tests, and set SOM4) - -Changes Answers: No - -=============================================================== - -=============================================================== -Tag name: clm3_expa_96 -Originator(s): tcraig -Date: Mon Mar 12 16:41:58 MDT 2007 -One-line Summary: fixed finemesh, pftdyn modes, add new tests - -Purpose of changes: restore finemesh and pftdyn modes, improve - test coverage - -Bugs fixed (include bugzilla ID): 389 (partial) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: reduced memory use in pftdyn - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - - M test/system/tests_pretag_bluevista - A + test/system/nl_files/10x15_pftdyn - A + test/system/nl_files/t31_dgvm_long - A + test/system/nl_files/t42half - M test/system/input_tests_master - M test/system/tests_pretag_blueice - M test/system/tests_pretag_jaguar - M test/system/tests_pretag_bangkok - M test/system/test_driver.sh - M test/system/tests_posttag_lightning - M src/main/subgridMod.F90 - M src/main/initializeMod.F90 - M src/main/pftdynMod.F90 - M src/main/clm_varsur.F90 - M src/main/ndepFileMod.F90 - M src/main/subgridAveMod.F90 - M src/main/initGridCellsMod.F90 - M src/main/lnd_comp_mct.F90 - M src/main/program_off.F90 - M src/main/surfrdMod.F90 - M src/main/domainMod.F90 - M src/main/decompMod.F90 - M src/main/areaMod.F90 - -- rename lvegxy,lwtxy to vegxy, wtxy -- implement general setgatm, get finemesh working again -- refactor pftdynMod for low memory implementation, validate pfydyn mode -- modify ndep and pftdyn from x = x1*wt1 + x2*wt2 to x = x2 + wt1*(x1-x2) - as suggested by k.lindsay, improves roundoff performance -- clean up some old code -- add new tests configurations (10x15_pftdyn, t31_dgvm_long, t42half), -- update pretag lists, add new tests - -Summary of testing: - - bluevista: - all clm tests pass except bl for new cases including new tests - all cam tests pass except bl (due to clm changes in expa_94/95) - ccsm passes ERS.f45_g35.B.bluevista16 (answers change due to expa_94/95) - bangkok/lf95: - all clm tests pass including new tests in list - all cam tests pass except bl (due to clm changes in expa_94/95) - tempest: - all cam tests pass except bl (due to clm changes in expa_94/95) - lightning: - ccsm passes ERS.f45_g35.B2.lightning (answers change due to expa_94/95) - -CLM tag used for the baseline comparison tests if applicable: - clm3_expa_95, cam3_4_03, ccsm3_1_beta45 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - answers are bfb with clm3_expa_95 in clm. cam and ccsm could not - be tested for bfb due to lagging clm version in latest cam and ccsm tags - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -Tag name: clm3_expa_95 -Originator(s): nanr, Keith Oleson, Peter Thornton -Date: Thu Mar 8 17:06:06 MST 2007 -One-line Summary: Adding N limitation for CLM standalone w/o CN. - -Purpose of changes: Improve estimation of photosynthesis in CLM when it -is run without CN active. These changes impose a N limitation as a fcn of -PFT [0-1]. - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: testing suites: fpftcon = pft-physiology.c070207 - -List any changes to the defaults for the boundary datasets: - fptfcon = pft-physiology.c070207 - pft-physiology.c070207.readme - -Describe any substantial timing or memory changes: none expected - -Code reviewed by: Keith Oleson, Peter Thornton, Dave Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - -bv1103en.ucar.edu-/fis/cgd/tss/nanr/clm/clm3_trunk % !svn -svn status | grep 'M ' -M test/system/nl_files/t31_cnall ! change pft-physiology.c070207 -M test/system/nl_files/t31_dgvm ! change pft-physiology.c070207 -M test/system/nl_files/t31 ! change pft-physiology.c070207 -M test/system/nl_files/t31_casa ! change pft-physiology.c070207 -M bld/run-pc.csh ! change pft-physiology.c070207 -M bld/run-sgi.csh ! change pft-physiology.c070207 -M bld/run-lightning.csh ! change pft-physiology.c070207 -M bld/run-ibm.csh ! change pft-physiology.c070207 -M bld/run-frost.csh ! change pft-physiology.c070207 -M src/main/clmtypeInitMod.F90 ! initialize new N limitation factor (fnitr) -M src/main/iniTimeConst.F90 ! initialize new N limitation factor (fnitr) -M src/main/pftvarcon.F90 ! read in new var (fnitr) -M src/main/clmtype.F90 ! initialize new N limitation factor (fnitr) -M src/biogeophys/CanopyFluxesMod.F90 ! apply new N limitation factor (fnitr) - -Summary of testing: - - bluevista: - 001 sm111 TSM.sh 4p_vodsr_dh t31 48 ...............................PASS - 002 er111 TER.sh 4p_vodsr_dh t31 10+38 ............................PASS - 003 br111 TBR.sh 4p_vodsr_dh t31 24+24 ............................PASS - 004 bl111 TBL.sh 4p_vodsr_dh t31 48 ...............................SKIPPED* - 005 sm114 TSM.sh 4p_vodsr_h t31 48 ................................PASS - 006 sm121 TSM.sh 17p_vodsr_dh t31 48 ..............................PASS - 007 er121 TER.sh 17p_vodsr_dh t31 10+38 ...........................PASS - 008 br121 TBR.sh 17p_vodsr_dh t31 24+24 ...........................PASS - 009 bl121 TBL.sh 17p_vodsr_dh t31 48 ..............................SKIPPED* - 010 sm124 TSM.sh 17p_vodsr_h t31 48 ...............................PASS - 011 sm211 TSM.sh 17p_cnn_dh t31_cnall 48 ..........................PASS - 012 er211 TER.sh 17p_cnn_dh t31_cnall 10+38 .......................PASS - 013 br211 TBR.sh 17p_cnn_dh t31_cnall 24+24 .......................PASS - 014 bl211 TBL.sh 17p_cnn_dh t31_cnall 48 ..........................SKIPPED* - 015 sm311 TSM.sh 4p_casa_dh t31_casa 48 ...........................PASS - 016 er311 TER.sh 4p_casa_dh t31_casa 10+38 ........................PASS - 017 br311 TBR.sh 4p_casa_dh t31_casa 24+24 ........................PASS - 018 bl311 TBL.sh 4p_casa_dh t31_casa 48 ...........................SKIPPED* - 019 sm411 TSM.sh 10p_dgvm_dh t31_dgvm 48 ..........................PASS - 020 er411 TER.sh 10p_dgvm_dh t31_dgvm 10+38 .......................PASS - 021 br411 TBR.sh 10p_dgvm_dh t31_dgvm 24+24 .......................PASS - 022 bl411 TBL.sh 10p_dgvm_dh t31_dgvm 48 ..........................SKIPPED* - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: CN inactive - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - /OLESON/csm/hydp2_off_communn_hk39 - - URL for LMWG diagnostics output used to validate new climate: - -http://www.cgd.ucar.edu/tss/clm/diagnostics/lmwg_hydro/hydp2_off_communn_hk39aa-hydp2_off_communn_hk38aa/setsIndex.html - - - -=============================================================== -=============================================================== -Tag name: clm3_expa_94 -Originator(s): nanr, Keith Oleson, Peter Thornton -Date: Thu Mar 8 14:22:36 MST 2007 -One-line Summary: BTRAN modification - -Purpose of changes: Change BTRAN calculation to improve prognostic - LAI estimation in high latitudes. - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Keith Oleson, Peter Thornton, Dave Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): nanr - -List all subroutines eliminated: nanr - -List all subroutines added and what they do: nanr - -List all existing files that have been modified, and describe the changes: -M src/biogeophys/CanopyFluxesMod.F90 - -Changing calculation of rootr to allow non-zero rootr (and btran) in partially frozen layers. - -Summary of testing: - - bluevista: - - 001 sm111 TSM.sh 4p_vodsr_dh t31 48 ...............................PASS - 002 er111 TER.sh 4p_vodsr_dh t31 10+38 ............................PASS - 003 br111 TBR.sh 4p_vodsr_dh t31 24+24 ............................PASS - 004 bl111 TBL.sh 4p_vodsr_dh t31 48 ...............................SKIPPED* - 005 sm114 TSM.sh 4p_vodsr_h t31 48 ................................PASS - 006 sm121 TSM.sh 17p_vodsr_dh t31 48 ..............................PASS - 007 er121 TER.sh 17p_vodsr_dh t31 10+38 ...........................PASS - 008 br121 TBR.sh 17p_vodsr_dh t31 24+24 ...........................PASS - 009 bl121 TBL.sh 17p_vodsr_dh t31 48 ..............................SKIPPED* - 010 sm124 TSM.sh 17p_vodsr_h t31 48 ...............................PASS - 011 sm211 TSM.sh 17p_cnn_dh t31_cnall 48 ..........................PASS - 012 er211 TER.sh 17p_cnn_dh t31_cnall 10+38 .......................PASS - 013 br211 TBR.sh 17p_cnn_dh t31_cnall 24+24 .......................PASS - 014 bl211 TBL.sh 17p_cnn_dh t31_cnall 48 ..........................SKIPPED* - 015 sm311 TSM.sh 4p_casa_dh t31_casa 48 ...........................PASS - 016 er311 TER.sh 4p_casa_dh t31_casa 10+38 ........................PASS - 017 br311 TBR.sh 4p_casa_dh t31_casa 24+24 ........................PASS - 018 bl311 TBL.sh 4p_casa_dh t31_casa 48 ...........................SKIPPED* - 019 sm411 TSM.sh 10p_dgvm_dh t31_dgvm 48 ..........................PASS - 020 er411 TER.sh 10p_dgvm_dh t31_dgvm 10+38 .......................PASS - 021 br411 TBR.sh 10p_dgvm_dh t31_dgvm 24+24 .......................PASS - 022 bl411 TBL.sh 10p_dgvm_dh t31_dgvm 48 ..........................SKIPPED* - - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: none - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - -larger than roundoff. Climate changes unknown. - -Improves prognostic LAI estimation in high latitudes. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): clm3_expa_89 - - platform/compilers: bluevista - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - /OLESON/csm/hydp2_off_communn_hk38 - - URL for LMWG diagnostics output used to validate new climate: - -http://www.cgd.ucar.edu/tss/clm/diagnostics/lmwg_hydro/hydp2_off_communn_hk38aa-hydp2_off_communn_expa89aa/setsIndex.html - - -=============================================================== - -=============================================================== -Tag name: clm3_expa_93 ! NOTE: Tag incremented to correct mistaken tag number in documentation. (nanr) -Originator(s): tcraig -Date: Tue Feb 27 16:53:41 MST 2007 -One-line Summary: merge fmf branch to trunk (low memory mods) - -Purpose of changes: reduce memory and improve memory scaling - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: began adding support - for frost in Makefile and added a run-frost.csh (not yet - fully validated) - -Describe any changes made to the namelist: added new optional namelist - input, nsegspc (number of segments per clump for new decomp. default - is 20, 1 will produce poor loadbalance, infinity yields too many - segments per pe but good load balance. performance asymptotes for - several configurations at about 5-10 segments/pe, use 20 as default.) - -List any changes to the defaults for the boundary datasets: NONE - -Describe any substantial timing or memory changes: significant reduction - in memory use and improved memory scaling. - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): update - to mct external, MCT2_3_0_070206 - -List all subroutines eliminated: - -List all subroutines added and what they do: - -List all existing files that have been modified, and describe the changes: - -- implement new 1d decomp based on ngsegspc rather than balancing pfts, - ngsegspc is the number of segments per clump. the 1d gridcells will - be divided into clumps and segments per clump so there will be - a total number of segments, clumps*nsegspc, each of about equal number - of gridcells, that will be distributed round-robin to pes. pfts are - derived later and will hopefully end up being nearly as well load - balanced as the previous method without having to precompute pfts - and requiring much less memory. see above for more info on the namelist - input and default. -- reorganize initialization, split decomp_init into three phases, - atm (coarse), lnd (finemesh), and glcp (subgrid). -- add new datatype, latlon to hold some global grid info -- now all domain info is local (although initialization still needs - to be modified) -- remove some dead code -- add new timers (bug #302) -- split gatm out of domain type -- create simple setgatm_UNITY routine, finemesh capability now disabled, - must fix setgatm in future version -- move wtxy, vegxy, and pctspec to clm_varsur, allocate as local arrays - now (begg:endg) and modify surfrd to handle local data only both for - I/O and initialization. -- implement gather/scatter routines in spmdGathScatMod that use gsmaps. -- update MCT and share -- port to frost -- get rid of some of the global decomps use in code, still more to do -- memory cleanup in STATICEcosysDynMod -- implement new ncdio methods for reading to local gridcell data using gsmaps -- clean up atmdrv, use newer low mem datatypes, reduce memory -- clean up rtm, use newer low mem datatypes, reduce memory -- remove history "lat/lon" fields - -M test/system/test_driver.sh -M tools/mkgriddata/mkgriddata.F90 -M bld/configure -M bld/Makefile.in -A + bld/run-frost.csh -M src/biogeochem/CASAMod.F90 -M src/biogeochem/STATICEcosysDynMod.F90 -M src/biogeochem/DGVMMod.F90 -M src/main/spmdGathScatMod.F90 -M src/main/abortutils.F90 -M src/main/clm_comp.F90 -M src/main/driver.F90 -M src/main/ncdio.F90 -M src/main/atmdrvMod.F90 -M src/main/subgridMod.F90 -M src/main/initializeMod.F90 -M src/main/pftdynMod.F90 -M src/main/iniTimeConst.F90 -M src/main/histFileMod.F90 -M src/main/program_csm.F90 -M src/main/clm_atmlnd.F90 -M src/main/clm_varsur.F90 -M src/main/clm_csmMod.F90 -M src/main/restFileMod.F90 -M src/main/controlMod.F90 -M src/main/clm_varctl.F90 -M src/main/ndepFileMod.F90 -M src/main/initGridCellsMod.F90 -M src/main/lnd_comp_mct.F90 -M src/main/program_off.F90 -M src/main/surfrdMod.F90 -M src/main/domainMod.F90 -M src/main/decompMod.F90 -M src/main/areaMod.F90 -M src/main/clm_mct_mod.F90 -M src/SVN_EXTERNAL_DIRECTORIES -M src/riverroute/RtmMod.F90 - -Summary of testing: - - bluevista: all pass except - 004 bl111 TBL.sh 4p_vodsr_dh t31 48 ...............................FAIL! rc= 7 - 009 bl121 TBL.sh 17p_vodsr_dh t31 48 ..............................FAIL! rc= 7 - bangkok/lf95: all pass except - 004 bl112 TBL.sh 4p_vodsr_dm t31 48 ...............................FAIL! rc= 7 - 009 bl122 TBL.sh 17p_vodsr_dm t31 48 ..............................FAIL! rc= 7 - Due to roundoff change in rtm, only rtm fields affected, otherwise bfb - - Also tested version in CCSM vs ccsm3_1_beta45 - ERS.f45_g35.B.bluevista16 - ERS.f45_g35.B2.lightning - Both PASS and bfb versus beta45 except for rtm roundoff difference and - associated error growth through ocean coupling - - Also tested mods merged to clm3_expa_91 with cam3_4_00, all - CAM tests pass on bangkok, bluevista, and tempest including scam. - Tested on bangkok with cam3_4_01 and updated to clm3_expa_92, all - CAM tests pass on bangkok. bluevista and tempest not tested - due to time constraints and earlier adequate testing with - clm3_expa_91 and cam3_4_00. - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_89 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: anything with RTM on - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff change in RTM due to roundoff change in cell area calculation - - If bitwise differences were observed, how did you show they were no worse - than roundoff? tested in multiple systems, review growth of diffs in - stand-alone clm, only rtm fields affected, diffs remain roundoff for - 48 timesteps, no coupling to other fields or error growth in system. - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - - -=============================================================== -Tag name: clm3_expa_92 -Originator(s): erik,mvertens,mvr -Date: Mon Feb 26 15:59:16 MST 2007 -One-line Summary: When running with Sequential CCSM -- use date for albedo calculation - -Purpose of changes: To work with cam3_4_01 - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: erik,mvr,mvertens - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M src/main/clm_comp.F90 -M src/main/lnd_comp_mct.F90 - -Have sequential CCSM give CLM the date of the next radiation calculation so that -it can calculate albedo's for that specific time-step. This is needed to work with -cam3_4_01. - -Summary of testing: - - bluevista: Pass - bangkok/lf95: Pass - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_91 - -=============================================================== -=============================================================== -Tag name: clm3_expa_91 -Originator(s): erik -Date: Wed Feb 21 13:19:51 MST 2007 -One-line Summary: Fix SCAM mode, add more machines for test_driver, have tools use csm_share, - make clmtype private (except for data exporting), fix several bugs - -Purpose of changes: Fix SCAM mode so can make a new CAM tag. - -Bugs fixed (include bugzilla ID): 252, 310, 370, 377, 385 (partial -- 302, 357, 389) - -Describe any changes made to build system: Remove -DNO_R16 from Makefile - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: MSS writes are now synchronous instead of - asynchronous - -Code reviewed by: slevis - -List any externals updated: Update to csm_share3_070220 - -List all subroutines eliminated: - -Remove makdep -- as MkDepends replaces it -Remove cprlndnc -- as newcprnc replaces it - -D tools/makdep -D tools/makdep/main.c -D tools/makdep/Makefile -D tools/makdep/README -D tools/cprlndnc -D tools/cprlndnc/cprtps.F -D tools/cprlndnc/lenchr.F -D tools/cprlndnc/precision.F -D tools/cprlndnc/printstats.F -D tools/cprlndnc/wrap_nf.F -D tools/cprlndnc/stats.F -D tools/cprlndnc/ismax.F -D tools/cprlndnc/initstats.F -D tools/cprlndnc/nldat.F -D tools/cprlndnc/cpr.F -D tools/cprlndnc/prhddiff.F -D tools/cprlndnc/header.F -D tools/cprlndnc/Makefile -D doc/BranchLog -D doc/ChangeSum - -Delete files that tools use that are copied from main src directories (so we don't have -to maintain separate copies of code) - -D Deleting tools/mkgriddata/fileutils.F90 -D Deleting tools/mkgriddata/nanMod.F90 -D Deleting tools/mkgriddata/shr_const_mod.F90 -D Deleting tools/mkgriddata/shr_kind_mod.F90 -D Deleting tools/mkgriddata/shr_sys_mod.F90 -D Deleting tools/mksurfdata/fileutils.F90 -D Deleting tools/mksurfdata/nanMod.F90 -D Deleting tools/mksurfdata/shr_const_mod.F90 -D Deleting tools/mksurfdata/shr_kind_mod.F90 -D Deleting tools/mksurfdata/shr_sys_mod.F90 -D Deleting tools/mksurfdata/shr_timer_mod.F90 - -List all subroutines added and what they do: - -A test/system/TSMtools.sh -- for testing of the tools (not tested yet) -A test/system/TCBtools.sh -- for build testing of the tools (not tested yet) -A test/system/tests_pretag_blueice -- for running on blueice (does work) -A test/system/tests_pretag_jaguar -- for running on jaguar (doesn't work yet) -A test/system/tests_posttag_lightning -- for running on lightning (doesn't work yet) - -Files added so that tools build uses copies of files in main directories rather than separate copies - -A tools/mkgriddata/Filepath -A tools/mkgriddata/Srcfiles -A tools/mkgriddata/misc.h -A tools/mkgriddata/preproc.h -A tools/mksurfdata/Filepath -A tools/mksurfdata/Srcfiles -A tools/mksurfdata/misc.h -A tools/mksurfdata/preproc.h - -List all existing files that have been modified, and describe the changes: - -Add check for soil energy balance: - -M src/biogeophys/BalanceCheckMod.F90 - -Bigint bug fix (don't copy over static fields with bigint values when copying a domain) - -M src/main/domainMod.F90 - -SCAM fixes (read datasets differently for SCAM) - -M src/main/surfrdMod.F90 -M src/main/ndepFileMod.F90 -M src/main/iniTimeConst.F90 - -Change so that tools use main copies of code rather than own particular copy: - -M tools/mkgriddata/Makefile -M tools/mkgriddata/mkgriddata.namelist -M tools/mksurfdata/Makefile -M tools/mksurfdata/domainMod.F90 - -Make MSS write's synchronous instead of asynchronous: Required for LSF queing systems - -M src/main/fileutils.F90 - -Landmask bug fix: (landmask now output globally with no missing or fill values) - -M src/main/histFileMod.F90 -M src/main/initializeMod.F90 -M src/main/ncdio.F90 - -Timers - -M src/main/program_csm.F90 -M src/main/driver.F90 - -Make clmtype private -- so only exports it's data not data it uses. - -M src/biogeochem/CNGapMortalityMod.F90 -M src/biogeochem/VOCEmissionMod.F90 -M src/biogeochem/CNrestMod.F90 -M src/biogeochem/CNC13FluxMod.F90 -M src/biogeochem/CNSetValueMod.F90 -M src/main/atmdrvMod.F90 -M src/main/clmtypeInitMod.F90 -M src/main/pftdynMod.F90 -M src/main/restFileMod.F90 -M src/main/clmtype.F90 -M src/biogeophys/SnowHydrologyMod.F90 -M src/biogeophys/SurfaceAlbedoMod.F90 -M src/biogeophys/BiogeophysRestMod.F90 -M src/biogeophys/DriverInitMod.F90 - -Miscellaneous: - -M bld/Makefile.in --- Remove NO_R16 CPP token, some changes to start work on jaguar -M test/system/test_driver.sh -- add more machines -M test/system/CLM_runcmnd.sh -- add more machines - -Summary of testing: - - bluevista: All PASS -- except TBL tests because of csm_share shr_const_mod TKFRZ change - bangkok/lf95: All PASS -- except TBL tests because of csm_share shr_const_mod TKFRZ change - blueice: All PASS -- except TBL tests because of csm_share shr_const_mod TKFRZ change - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_90 - - Summarize any changes to answers: larger than roundoff (all config/all machines) - - (No simulations were performed as CCSM scientists deemed the change to be - insignificant) - -=============================================================== -=============================================================== -Tag name: clm3_expa_90 -Originator(s): nanr -Date: Tue Feb 6 13:17:55 MST 2007 -One-line Summary: Changed creategridMod.F90 to read variables from 10min USGS file. - -Purpose of changes: -Added htopo and landfract to retrieve landfrac and topography for processing USGS-gtopo30_10min_c050419.nc - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: nanr - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M creategridMod.F90 - - Added lines to creategridMod.F90 to read variables from USGS-gtopo30-10min_c050419.nc - - ier = nf_inq_varid (ncid, 'landfract', varid) - if (ier == NF_NOERR) then - if (landfracset) write(6,*) trim(subname),' WARNING, overwriting frac' - landfracset = .true. - write(6,*) trim(subname),' read landfract' - call check_ret(nf_inq_varid (ncid, 'landfract', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, domain%frac), subname) - endif - - ier = nf_inq_varid (ncid, 'htopo', varid) - if (ier == NF_NOERR) then - if (toposet) write(6,*) trim(subname),' WARNING, overwriting topo' - toposet = .true. - write(6,*) trim(subname),' read htopo' - call check_ret(nf_inq_varid (ncid, 'htopo', varid), subname) - call check_ret(nf_get_var_double (ncid, varid, domain%topo), subname) - endif - - -Summary of testing: none. Affects tools/mkgriddata only. - - bluesky: - tempest: - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm3_expa_89 -Originator(s): erik,oleson -Date: Feb/02/2007 -One-line Summary: - -Purpose of changes: Use new water table rise calculation in SoilHydrology - -Bugs fixed (include bugzilla ID): 345, 353 - -Describe any changes made to build system: None (although added Darwin to mksrfdat build Makefile) - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Keith Oleson - -List all subroutines eliminated: None - -Remove bld/offline directory tree - -List all subroutines added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M bld/Makefile.in ---- Add -DFORTRANUNDERSCORE so can compile mpi-serial on IRIX - -Change run scripts so that spmd and smp settings work for both on AND off - -M bld/run-pc.csh ----------------------- Also add LD_LIBRARY_PATH setting -M bld/run-sgi.csh -M bld/run-lightning.csh - -M src/main/spmdMod.F90 ------------------ Remove #ifdef around #include so will - run serial (this is a partial fix to bug 337. The longer term fix is to remove all - #ifdef SPMD as we can use the mpi-serial code to make the serial and SPMD code the same. - -M src/biogeophys/SoilHydrologyMod.F90 --- New drainage formulation from Keith Oleson - -Summary of testing: - - bluesky: -- All but comparision to previous version - tempest: -- All but comparison to previous version and the following restart tests - (These tests fail on previous versions as well -- documented as bug 361) -002 er111 TER.sh 4p_vodsr_dh t31 10+38 ............................FAIL! rc= 11 -003 br111 TBR.sh 4p_vodsr_dh t31 24+24 ............................FAIL! rc= 11 -005 sm116 TSM.sh 4p_vodsr_o t31 48 ................................FAIL! rc= 4 -007 er121 TER.sh 17p_vodsr_dh t31 10+38 ...........................FAIL! rc= 11 -008 br121 TBR.sh 17p_vodsr_dh t31 24+24 ...........................FAIL! rc= 11 -012 er211 TER.sh 17p_cnn_dh t31_cnall 10+38 .......................FAIL! rc= 11 -013 br211 TBR.sh 17p_cnn_dh t31_cnall 24+24 .......................FAIL! rc= 11 -016 er311 TER.sh 4p_casa_dh t31_casa 10+38 ........................FAIL! rc= 11 -017 br311 TBR.sh 4p_casa_dh t31_casa 24+24 ........................FAIL! rc= 11 -020 er411 TER.sh 10p_dgvm_dh t31_dgvm 10+38 .......................FAIL! rc= 11 -021 br411 TBR.sh 10p_dgvm_dh t31_dgvm 24+24 .......................FAIL! rc= 11 - (We are going to remove tempest as a standard test for CLM) - - bangkok/lf95: -- All but comparision to previous version - -CLM tag used for the baseline comparison tests if applicable: none - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (similar climate) - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: Cray-XT3/jaguar - - configuration (CPP ifdefs): default - - build-namelist command (or complete namelist): - - MSS location of output: /CCSM/csm/b31.020ws/lnd/hist - - URL for LMWG diagnostics output used to validate new climate: Not yet prepared - -=============================================================== -=============================================================== -Tag name: clm3_expa_88 -Originator(s): nanr -Date: Thu Jan 11 12:31:51 MST 2007 -One-line Summary: Minor formatting change in tools. - Correctons to ChangLog - - -Purpose of changes: -1. Update formatted write in tools/ mkgriddata.F90 and tools/mksrfdat.F90 - to accomodate 4 digit lat/lons. -2. Add note to ChangeLog to explain commit by nanr (10/27) that was not tagged. -3. correct Changelog for tag clm3_expa_80. The changes listed below never happened. - surfFileMod.F90 was actually removed from the trunk in a previous tag (clm3_expa_66) - and renamed surfrdMod.F90. So this modification probably reflects the status of the branch - Keith Oleson was working on. - M src/main/surfFileMod.F90 - - Removed statements contained within CN ifdef (OK'd by P. Thornton) that: - - ! the following test prevents the assignment of temperate deciduous - ! vegetation types in the tropics - ! 1. broadleaf deciduous temperate tree -> broadleaf deciduous tropical tree - ! 2. broadleaf deciduous temperate shrub -> broadleaf deciduous tropical tree - ! this reassignment from shrub to tree is necessary because there is currently no - ! tropical deciduous broadleaf shrub type defined. - - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: nanr - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M tools/mksurfdata/mksrfdat.F90 -M tools/mkgriddata/mkgriddata.F90 - - Changed formatting strings to accomodate 4 char lat/lons. - OLD: write (resol,'(i3.3,"x",i3.3)') lsmlat,lsmlon - NEW: write (resol,'(i4.4,"x",i4.4)') lsmlat,lsmlon - -Summary of testing: none. Changes only to tools and ChangeLog - - bluesky: - tempest: - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: none - -IF tag changes answers relative to baseline comparison the -following should be filled in: none - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: NA - - URL for LMWG diagnostics output used to validate new climate: NA - -=============================================================== -=============================================================== -Tag name: clm3_expa_87 -Originator(s): tcraig, jet -Date: Wed Dec 27 05:03:01 GMT 2006 -One-line Summary: merge fme branch, merge refactor_scam branch - -Purpose of changes: bug fixes, reduce memory usage, improve memory scaling, - add mct package, update scam - -Bugs fixed (include bugzilla ID): - #133 adomain,ldomain compare - #290 time bounds problem in history file - #291 fix rtm history bug on bangkok - #301 modify decomp info in i/o - #321 merge refactor_scam branch - -Describe any changes made to build system: none - - consisting of src, dst, S (COL, ROW, S). update the internal clm - atm/lnd mappings to use new datatype. lnd/rtm and driver/atm - mapping still using gridmap_type. this will be updated in future - versions. -- convert domain from 2d global to 1d global arrays. add glo - decomp which is global 1d indexing like ij to 1d or gsn - uncompressed. -- convert wtxy, vegxy, pctspec from 2d to 1d arrays. migrate many other arrays - from 2d global (i,j) to 1d global. this is for nesting and to eventually - cut down on number of index mappings in decomp_type -- reorganize order of initialization calls to start thinking about nesting -- add gatm array to domain datatype -- clean up dead code. -- rename initSubgridMod to subgridMod -- move map_indexes to subgridMod, rename get_subgrid_indexees -- rearrange a few subroutines to improve filename hierarchy and use logic -- delete get_sn routines, no longer needed -- update indexing in clm_atmlnd, remove hardwire indexes -- rewrite i/o as needed for 1d global arrays, not 2d -- delete gatherWeightsDGVM from DGVMMod.F90, no longer needed -- rename surfFileMod to surfrdMod.F90 -- reduce size of subgrid_type and redefine gcelldc and gcellsn - - -Summary of testing: - - bluesky: clm test passes, cam pretag passes except ccsm - tempest: cam pretag passes - bangkok/lf95: cam pretag passes except bl153, bl353, bl553 due to code - changes and resulting binary produced by compiler optimizations. - also scam fails. - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_65, cam3_3_16 - - Summarize any changes to answers: NONE bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_expa_65 -Originator(s): Erik Kluzek -Date: Mon Jul 10 13:52:20 MDT 2006 -One-line Summary: Use share clocks and inputinfo object at driver level - -Purpose of changes: Use new version of esmf_wrf and csm_share as next step - in sequential CCSM development. - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: Add ability to use Darwin, add eshr to -Filepath - -Describe any changes made to the namelist: Instead of directing namelist from stdin - explicitly open namelist filename. Change namelist name from clmexp to clm_inparm. - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Mariana Vertenstein, Tony Craig, Forrest Hoffman - -Externals changed: csm_share to share3_060710 - esmf_wrf_timemgr to esmf_wrf_timemgr_060616 - -List all subroutines eliminated: None - -List all subroutines added and what they do: control_setNL (controlMod.F90) sets the - namelist filename. - -List all existing files that have been modified, and describe the changes: - -tools/newcprnc/Makefile -bld/offline/tests/CLM_namelist.pm -bld/offline/tests/CLM_lab.pm -bld/offline/tests/CLM.pm -bld/offline/tests/model_specs.csh -bld/offline/tests/configure.csh -bld/offline/tests/config_machine_specs.csh -bld/offline/tests/CLM_run.pm -bld/offline/tests/test_batch.csh -bld/offline/tests/Makefile -bld/offline/jobscript.csh - - Add eshr to Filepath, add Darwin as a valid platform, don't redirect unit 5 for -namelist. Set MODEL_DATDIR explicitly. Use lnd.stdin as default namelist name. -Add "-g" to Makefile. Change clm namelist from clmexp to clm_inparm. Get test_batch.csh -to work both on bangkok for Linux/Lahey and tempest for SGI. Write out Rootdir file -when configuring build directory. - -src/main/time_manager.F90 -- Use dayOfYear_r8 for calc_calday. -src/main/clm_comp.F90 ------ Pass CCSMInit in. -src/main/fileutils.F90 ----- Small changes to how using shr_file_mod. -src/main/initializeMod.F90 - Pass clock in. -src/main/program_csm.F90 --- Change where ESMF_Initialize is done. -src/main/controlMod.F90 ---- Add method to set namelist name, pass clock in and use it. -src/main/clm_varctl.F90 ---- Get rid of cam_ variables. -src/main/lnd_comp_mct.F90 -- Pass in clock and CCSMInit object. - -Summary of testing: - - bluesky: test-batch.csh -- PASS and CAM and CAM CCSM tests pass. - tempest: test-batch.csh -- PASS and CAM tests pass. - bangkok/lf95: test-batch.csh -- PASS and CAM tests pass. - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_64 - - Summarize any changes to answers: NONE bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm3_expa_64 -Originator(s): Dani Bundy Coleman -Date: Thu Jun 29 14:44:07 MDT 2006 -One-line Summary: dust modifications from Natalie Mahowald - -Purpose of changes: update dust code - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Mariana Vertenstein - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M src/biogeochem/DUSTMod.F90 - OLD dmt_vma = 2.524e-6_r8 ! [m] Mass median diameter analytic She84 p.75 Table1 - NEW dmt_vma = 3.500e-6_r8 ! [m] Mass median diameter analytic - -M src/main/clm_atmlnd.F90 - add land-to-atmosphere communication of fv,ram1 & dust fluxes - (only active if defined DUST or PROGSEASALT ) -M src/main/lnd_comp_mct.F90 - add land-to-atmosphere communication of fv,ram1 & dust fluxes - (only active if defined DUST or PROGSEASALT ) - -Summary of testing: - - bluesky: tested with cam, bfb when DUST and PROGSEASALT not defined - tempest: - bangkok/lf95: tested with cam, bfb when DUST and PROGSEASALT not defined - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_63 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm3_expa_63 -Originator(s): Mariana Vertenstein -Date: Fri May 12 16:08:03 MDT 2006 -One-line Summary: introduced mct domains in COUP_CAM mode - -Purpose of changes: To introduce generalized mct domains -in COUP_CAM mode for the purposes of generating a sequential -ccsm - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Tony Craig - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: - lnd_comp_mct.f90 - removed lnd_CheckGrid_mct routine and replaced it with lnd_domain_mct - each processor sends it local domain information stored in an MCT - GeneralGrid data structure back to the top level application driver. - A global gather is done for the GeneralGrid and domain comparison is - performed on the master processor. - -Summary of testing: - - bluesky: only cam test suite was run successfully - tempest: only cam test suite was run successfully - bangkok/lf95: only cam test suite was run successfully - -CLM tag used for the baseline comparison tests if applicable: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm3_expa_62 -Originator(s): erik, tcraig -Date: Wed May 10 00:06:39 MDT 2006 -One-line Summary: merge shrgetput08_clm3_expa_61, fix finemesh bugs - -Purpose of changes: changes required for sequential ccsm. validate - finemesh is running properly. - -Bugs fixed (include bugzilla ID): - a couple finemesh bugs, not documented. - -Describe any changes made to build system: modified makefile slightly - to set HIDE_MPI when SPMD is FALSE, remove HIDE_SHR_MSG - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: erik, tcraig - -List all subroutines eliminated: none - -List all subroutines added and what they do: none - -List all existing files that have been modified, and describe the changes: -Makefile: - - remove HIDE_SHR_MSG, not needed anymore - - add HIDE_MPI if SPMD is FALSE -SVN_EXTERNALS: - - change csm_share version from share3_051205 to share3_060428 - - change emsf_wrf_timemgr version from esmf_wrf_timemgr_051212 to esmf_wrf_timemgr_060501 -fileutils.F90: - - uses shr_file_mod.F90 routines - - use shr_file_mod syntax for archive_dir (using mss: prefix) -initializeMod.F90: - - add pnamer_bin get -program_csm.F90: - - add ESMF_Initialize call -clm_atmlnd.F90: - - fix bug in call to grid_maparray for finemesh mapping, only affects finemesh runs. -controlMod.F90: - - use shr_file_mod syntax for archive_dir (using mss: prefix) -lnd_comp_mct.F90: - - change call to get_proc_bounds to get_proc_bounds_atm (bug for finemesh runs). -program_off.F90: - - add calls to ESMF_Initialize and ESMF_Finalize - - -Summary of testing: - bluesky: cam full suite bfb - clm full suite not bfb (TS is bfb for 2 days, history file not bfb - after ~1.5 days probably due to new esmf time manager, likely roundoff) - tempest: cam full suite bfb, ccsm build test - bangkok/lf95: cam full suite bfb - bluevista : ccsm TER.01a.1.9x2.5_gx1v3.B.bluevista bfb - cam finemesh T42half.clim0 test, bfb for 42 timesteps vs cam3_2_49 - lightning : ccsm TER.01a.4x5_gx3v5.B.bluevista bfb - -CLM tag used for the baseline comparison tests if applicable: - clm3_expa_61, cam3_3_4, ccsm3_1_beta27 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: clm standalone only - - what platforms/compilers: only bluesky tested - - nature of change (roundoff; larger than roundoff/same climate; new climate): - assume roundoff. it's bfb for at least a day. in cam and ccsm mode they - are bfb. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? guess - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - -=============================================================== -Tag name: clm3_expa_61 -Originator(s): T Craig -Date: Thu Apr 27 01:10:40 MDT 2006 -One-line Summary: merge cammct05_clm3_expa_58 onto main trunk, - modify surface dataset input - -Purpose of changes: merge branch - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: myself, developed my MV - -List all subroutines eliminated: - clm_camMod.F90 - interface to cam - MCT_atmlnd_cpl.F90 - mct migrated to sequential driver - MCT_lnd_comp.F90 - mct migrated to sequential driver - -List all subroutines added and what they do: - lnd_comp_mct.F90 - interface to sequential driver using mct coupling - -List all existing files that have been modified, and describe the changes: - clm_comp.F90 - separate init method into init1, init2 - initializeMod.F90 - separate initialize into initialize1 and 2 - program_csm.F90 - add call to clm_init0 - clm_atmlnd.F90 - PWorley's changes to improve phoenix performance, - packed arrays in clm_mapa2l and clm_mapl2a interpolation. - program_off.F90 - add call to clm_init0 - areaMod.F90 - PWorley's changes to improve phoenix performance, - interpolate packed arrays in gridmap_maparray - Hydrology2Mod.F90 - remove use of iam - - mksurfdata, several files changed to convert - mksrf_fgrid_global/regional to mksrf_fgrid and mksrf_gridtype - -Summary of testing: - - bluesky: clm full suite bfb, cam full suite bfb - bluevista: ccsm bfb TER.01a.T31_gx3v5.B.bluevista, TER.01a.4x5_gx3v5.B.bluevista - tempest: cam full suite bfb - bangkok/lf95: cam full suite bfb - - mksrf tested on bluevista, 7 cases, bfb - -CLM tag used for the baseline comparison tests if applicable: - clm3_expa_60, cam3_3_2, ccsm3_1_beta25 - -changes are bit-for-bit - -=============================================================== - - -=============================================================== -Tag name: clm3_expa_60 -Originator(s): Forrest Hoffman -Date: Fri Apr 14 11:03:34 EDT 2006 -One-line Summary: Rearranged physiology fields, changed CO2 constants, fixed Bug #43 - -Purpose of changes: Make radiation-related physiology fields standard, prepare code for C-LAMP experiments, and make test-model run on Cray X1E (phoenix) - -Bugs fixed (include bugzilla ID): Bug #43 - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Myself - -List all subroutines eliminated: None - -List all subroutines added and what they do: None - -List all existing files that have been modified, and describe the changes: - -nfwrappers.f90: -Changed intent for ncid from intent(in) to intent(out) since it must be -returned to the calling routines. This fixed Bug #43 which was discovered -on the Cray X1E (phoenix). - -ChangeLog: -Added this log entry. - -clm_varcon.F90: -Changed co2_ppmv_const to 283.1878_r8 for both CASA' and CN in preparation -for Experiment 1 of the C-LAMP. - -histFldsMod.F90 -Moved LAISUN, LAISHA, TLAI, TSAI, SLASUN, and SLASHA out of the CN-only -section of the code so that they appear on the regular CLM output files -since the two-leaf radiation code is now standard. In addition, TLAI and -TSAI were removed from the DGVM-only section of the code since these -output fields are now standard. - -Summary of testing: - - cheetah: -Ran test-model for T31, T31cn, T31cnall, T31casa, and T31dgvm with -baseline clm3_expa_59. T31 and T31dgvm passed all tests. The others -passed tests 01-05, but not the 06_control test because of the change -in co2_ppmv_const. - - phoenix: -Ran test-model for T31, T31cn, T31cnall, T31casa, and T31dgvm with -baseline clm3_expa_59. T31 and T31dgvm passed all tests. The others -passed tests 01-05, but not the 06_control test because of the change -in co2_ppmv_const. - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_59 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: co2_ppmv_const modification changes answers - - what platforms/compilers: IBM (cheetah) and Cray X1E (phoenix) - - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff because of changes in carbon pools - - If bitwise differences were observed, how did you show they were no worse - than roundoff? cprnc - - * There is no validated climate in these model configurations. * - -=============================================================== -=============================================================== -Tag name: clm3_expa_59 -Originator(s): Tony Craig -Date: Wed Apr 5 18:03:23 MDT 2006 -One-line Summary: add fatmlndfrc capability - -Purpose of changes: Support new datasets, other minor improvements, - update mkgrid and mksurf tools for new dataset generation. - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: jobscript.csh modified for - new surface datasets, change baseline resolution to T31. - -Describe any changes made to the namelist: added optional fatmlndfrc - namelist input for landfrac file on atm grid. - -List any changes to the defaults for the boundary datasets: all new - grid, frac, and surf datasets generated, located in - /fs/cgd/csm/inputdata/lnd/clm2/[griddata,surfdata] - -Describe any substantial timing or memory changes: None - -Code reviewed by: myself - -List all subroutines eliminated: None - -List all subroutines added and what they do: None - -List all existing files that have been modified, and describe the changes: - -tools/mksurfdata/mkrfdat.F90 - change default output filenames -tools/mksurfdata/mklaiMod.F90 - removed masking since there is no mask anymore -tools/mksurfdata/mkfileMod.F90 - removed read of LANDMASK and LANDFRAC -tools/mksurfdata/creategridMod.F90 - removed write of LANDMASK and LANDFRAC -tools/mksurfdata/Makefile - fix clean bug -tools/mkgriddata/mkgriddata.F90 - add generation of ffracdat file - force area calculation for ccsm domain files due to noise in scrip areas - change default output filenames -tools/mkgriddata/mkvarctl.F90 - add support for area recomputation -tools/mkgriddata/mkfileMod.F90 - removed, merged into creategridMod.F90 -tools/mkgriddata/areaMod.F90 - add flush(6) -tools/mkgriddata/creategridMod.F90 - add mkfile subroutine - fix bug in setting of corner points - handle wrap-around points better with corner points - add ability to adjust units of area (not automatic) - add checks for area - add ability write eigher grid or frac file in write_domain -bld/offline/tests/test_batch.csh - change default version from 53 to 58 - turn on dgvm testing by default -bld/offline/jobscript.csh - change to share queue on bluesky - run mixed mpi/openmp by default, 2x2 - change default resolution to T31 (was T42) - update to use new surface datasets - change default, turn on DUST, RTM, VOC, turn off CN, SUPLN, SUNSHA, STOMATA2 - add unlimit unlimited for AIX - fix redirection to compile_log.clm output file -src/main/initializeMod.F90 - add fatmlndfrc stuff - add computation of ldomain%frac and ldomain%mask -src/main/controlMod.F90 - add fatmlndfrc stuff -src/main/clm_varctl.F90 - add fatmlndfrc stuff -src/main/driver.F90 - remove redundant definition of caldayp1 -src/main/clmtypeInitMod.F90 - remove landfrac variable for clm3 gridcell_type -src/main/histFileMod.F90 - add indxupsc, jndxupsc indices for upscaling -src/main/program_csm.F90 - move shr_msg_stdio to after MPI_INIT, change - call so it only redirects log file for masterproc. this will clean - up the log file significantly but may lead to error messages ending - up in stdout. -src/main/surfFileMod.F90 - add fatmlndfrc stuff -src/main/initGridCellsMod.F90 - remove landfrac variable for clm3 gridcell_type -src/main/domainMod.F90 - reorder domain data slightly (nothing changed) -src/main/areaMod.F90 - change default of i_ovr and j_ovr from bigint to -1, - allows for cleaner writing of indxupsc and jndxupsc in history file. - change gridmap_setmapsFM to use _a and _l notation instead of _i and _o -src/main/clmtype.F90 - remove landfrac from clm3 gridcell_type - - -Summary of testing: - - Baseline versions, clm3_expa_58, cam3_2_56, ccsm3_1_beta24 - - bluesky: clm full suite passes, cam full suite passes - tempest: cam full suite passes - bangkok/lf95: cam full suite passes - bluevista: ccsm TER.01a B passes for several resolutions, new datasets - in scripts - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_58 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Code changes are bfb, but answers may change when using new surface datasets - - Summarize any changes to answers, i.e., - - what code configurations: CCSM answers will change with new datasets as - default datasets are changing. clm default test is bfb at T31 with new datasets, - cam will be bfb as current default datasets are not being updated. - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - - -=============================================================== -Tag name: clm3_expa_58 -Originator(s): Forrest Hoffman -Date: Thu Mar 9 17:04:27 EST 2006 -One-line Summary: Updates for the Cray X1E and a forcing height error check. - -Purpose of changes: Improvements on the Cray X1E and avoiding arithmetic exceptions when the forcing height is below the canopy height. - -Bugs fixed (include bugzilla ID): Bug #36 - -Describe any changes made to build system: jobscript.csh modified for Cray X1E - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: myself and (for forcing height check code) Mariana Vertenstein - -List all subroutines eliminated: None - -List all subroutines added and what they do: None - -List all existing files that have been modified, and describe the changes: - - jobscript.csh - Modified for Cray X1E and cross-compiler - inicFileMod.F90 - Added compiler directives for vectorization - driver.F90 - Commented out CSDs to avoid model hangs caused by write - statements in science routines within the associated loops - controlMod.F90 - Changed default clump_pproc to 1 for the Cray (since CSDs - are not used in driver.F90 - histFldsMod.F90 - Changed type2d='levlak' for the TLAKE field - CanopyFluxesMod.F90 - Inserted code to check if the forcing height - is below the canopy height for any pft. Model will now abort when this - occurs instead of taking the log() of a negative number. See Bug #36 - -Summary of testing: - - bluesky: test-model ran as follows -01_debug_run_SPMD: T31 ran -02_debug_run_nonSPMD: T31 ran -03_start: T31 ran -04_restart: T31 ran -05_norestart_compare_to_restart: T31 ran -06_control: T31 ran -01_debug_run_SPMD: T31cn ran -02_debug_run_nonSPMD: T31cn ran -03_start: T31cn ran -04_restart: T31cn ran -05_norestart_compare_to_restart: T31cn ran -06_control: T31cn ran -01_debug_run_SPMD: T31cnall ran -02_debug_run_nonSPMD: T31cnall ran -03_start: T31cnall ran -04_restart: T31cnall ran -05_norestart_compare_to_restart: T31cnall ran -06_control: T31cnall ran -01_debug_run_SPMD: T31casa ran -02_debug_run_nonSPMD: T31casa ran -03_start: T31casa ran -04_restart: T31casa ran -05_norestart_compare_to_restart: T31casa ran -06_control: T31casa ran - cheetah: -01_debug_run_SPMD: T31cnall ran -02_debug_run_nonSPMD: T31cnall ran -03_start: T31cnall ran -04_restart: T31cnall ran -05_norestart_compare_to_restart: T31cnall ran -06_control: T31cnall ran -01_debug_run_SPMD: T31 ran -02_debug_run_nonSPMD: T31 ran -03_start: T31 ran -04_restart: T31 ran -05_norestart_compare_to_restart: T31 ran -06_control: T31 ran -01_debug_run_SPMD: T31cn ran -02_debug_run_nonSPMD: T31cn ran -03_start: T31cn ran -04_restart: T31cn ran -05_norestart_compare_to_restart: T31cn ran -06_control: T31cn ran -01_debug_run_SPMD: T31casa ran -02_debug_run_nonSPMD: T31casa ran -03_start: T31casa ran -04_restart: T31casa ran -05_norestart_compare_to_restart: T31casa ran -06_control: T31casa ran - tempest: - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_57 - -=============================================================== -Tag name: clm3_expa_57 -Originator(s): Peter Thornton -Date: 31 Jan 2006 -One-line Summary: Mods to allow switching between 3 and 4 soil - organic matter pools - -Purpose of changes: New science. - -Bugs fixed (include bugzilla ID): bugs in pftdynMod.F90 and ndepfileMod.F90 - -Describe any changes made to build system: - -Describe any changes made to the namelist: Added SOM4 as new CPP directive - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: none - -Code reviewed by: myself - -List all subroutines eliminated: - -List all subroutines added and what they do: - -List all existing files that have been modified, and describe the changes: -main/clmtype.F90: added soil4c (and 13C equiv.), soil4n states and associated - flux variables. Also added long name commenting for many previously defined - variables. -main/clmtypeInitMod.F90: added initialization for new variables -main/CNiniTimeVar.F90: initialize new state variables. -main/histFldsMod.F90: added new variables, and also added long names for - many previously defined variables. -main/pftdynMod.F90: bug fix in mpi_bcast, change MPI_REAL8 to MPI_INTEGER. -main/ndepFileMod.F90: bug fix for mpi_bcast, change MPI_REAL8 to MPI_INTEGER. -biogeochem/CNSetValueMod.F90: add code for new state and flux variables. -biogeochem/CNDecompMod.F90: add code to allow either 3 or 4 SOM pools. Default - behavior is 3 pools, 4-pool behavior triggered by SOM4 CPP directive. -biogeochem/CNCStateUpdate1Mod.F90: handling for new variables. -biogeochem/CNNStateUpdate1Mod.F90: handling for new variables. -biogeochem/CNSummaryMod.F90: handling for new variables. -biogeochem/CNBalanceCheckMod.F90: handling for new variables -biogeochem/CNPrecisionControlMod.F90: handling for new variables -biogeochem/CNC13FluxMod.F90: handling for isotope version of new variables -biogeochem/C13StateUpdate1Mod.F90: handling for new variables -biogeochem/C13SummaryMod.F90: handling for new variables -biogeochem/CNrestMod.F90: handling for new variables, and modify EXIT_SPINUP - controls - -Summary of testing: - - bluesky: - tempest: - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: in 3-pool mode -(SOM4 not set), results are bfb with clm3_expa_55. in 4-pool mode, changes -answers, as expected. - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: -bfb under 3-pools is demonstrated at: -http:/www.cgd.ucar.edu/tss/clm/diagnostics/clm3cn/c13/ccsm3_bgc31_I_5a-ccsm3_bgc31_I_2b/setsIndex.html - -=============================================================== -Tag name: clm3_expa_56 -Originator(s): Tony Craig -Date: 31 Jan 2006 -One-line Summary: Final changes for finemesh implementation. - -Purpose of changes: Integrate final changes for finemesh implementation. These -changes are 100% backward compatable and bfb, but also support use of a finemesh grid. finemesh implementation has been test in clm and cam. - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: Update Makefile so Depends are regenerated if any code is changed. - -Describe any changes made to the namelist: Added one new optional namelist, fatmgrid. This is a dataset for the coarse grid in clm. The format is the same as the surface dataset but only needs to include grid variables. - -List any changes to the defaults for the boundary datasets: Generated some new datasets with filled wetland and higher resolution. Not required and not yet added to default suite of datasets. - -Describe any substantial timing or memory changes: - -Code reviewed by: - -List all subroutines eliminated: - -List all subroutines added and what they do: - -List all existing files that have been modified, and describe the changes: - -tools/mksurfdata: - mksrfdat.F90,areaMod.F90,creategridMod.F90 -bld/offline/Makefile -doc/ChangeLog - src/main: -clm_comp.F90,driver.F90,clm_camMod.F90,atmdrvMod.F90,clmtypeInitMod.F90,initializeMod.F90,histFileMod.F90,program_csm.F90,clm_atmlnd.F90,clm_csmMod.F90,surfFileMod.F90,controlMod.F90,clm_varctl.F90,initGridCellsMod.F90,MCT_lnd_comp.F90,program_off.F90,domainMod.F90,decompMod.F90,areaMod.F90,clmtype.F90 -src/biogeophys/SurfaceAlbedoMod.F90 - -Code changes: -add pftm to domain datatype and history file -modify program_off and program_cs to use clm_init[1,2], clm_run[1,2] -modify coupling to handle coarse <-> finemesh for standlaone, cam, and - ccsm. -modify Makefile so depends file is reset whenever there is a code change -add normalized area to history files -add lat_a, lon_a, latdeg_a, londeg_a to clm3 datatype for atm lats/lons. - required in SurfaceAlbedo computation where the the zenith angle has - to be based on the atm (coarse) grid, not the fine clm grid. -merge with clm3_expa_53_brnchT_cam01 tag - -Summary of testing: - - bluesky: clm full suite bfb, cam full suite bfb, ccsm bfb - tempest: cam full suite bfb - bangkok/lf95: cam full suite bfb - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_55 - -IF tag changes answers relative to baseline comparison the -following should be filled in: bfb - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? bfb - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -Tag name: clm3_expa_55 -Originator(s): Peter Thornton -Date: 24 Jan 2006 -One-line Summary: Fixes for 13C isotope code, migration from cvs - -Purpose of changes: - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: myself - -List all subroutines eliminated: - -List all subroutines added and what they do: - -List all existing files that have been modified, and describe the changes: -Files modified: -1. CNFireMod.F90 -Added initialization of variable mep. - -2. CNrestMod.F90 -Added EXIT_SPINUP controls on column-level 13C pools - -3. C13SummaryMod.F90 -Added current and excess maintenance respiration terms to summary MR variable. - -4. CNC13FluxMod.F90 -Added new routines to calculate 13C fluxes. Litter to column, non-mortality fluxes -at the column level, pft-level gap mortality fluxes, pft and column level fire mortality fluxes, - -5. CNEcosystemDynMod.F90 -Added calls for C13Flux2, C13Flux3, C13StateUpdate2, and C13StateUpdate3. - -6. clm_varcon.F90 -Added parameters to define a fixed pre_industrial del13C (set to -6 permil) - -Summary of testing: - - bluesky: - tempest: - bangkok/lf95: - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_40 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - -Changes answers for CN only, and then only for the isotope prognostics. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: -http://www.cgd.ucar.edu/tss/clm/diagnostics/clm3cn/c13/ccsm3_bgc31_I_2a-ccsm3_bgc26_I_1d/setsIndex.html -=============================================================== -Tag name: clm3_expa_54 -Originator(s): Tony Craig -Date: 17 Jan 2006 -One-line Summary: Update infrastructure in support of finemesh, migration from cvs - -Purpose of changes: bfb infrastructure changes committed, partial step towards finemesh implementation - -Bugs fixed (include bugzilla ID): None - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: Some memory added for extra coarse grid, atmosphere domain, as well as changes to interpolation datatypes and code. Redundant memory deleted from some datasets. - -Code reviewed by: Mariana Vertenstein - -List all subroutines eliminated: - -List all subroutines added and what they do: - -List all existing files that have been modified, and describe the changes: - -src/main: -initGridIndexMod.F90,lnd2atmMod.F90,CNiniTimeVar.F90,abortutils.F90,clm_comp.F90,driver.F90,clm_camMod.F90,atmdrvMod.F90,subgridRestMod.F90,accFldsMod.F90,clmtypeInitMod.F90,initializeMod.F90,pftdynMod.F90,iniTimeConst.F90,histFileMod.F90,program_csm.F90,clm_atmlnd.F90,clm_varsur.F90,clm_csmMod.F90,restFileMod.F90,surfFileMod.F90,controlMod.F90,initSurfAlbMod.F90,initSubgridMod.F90,clm_varctl.F90,ndepFileMod.F90,initGridCellsMod.F90,MCT_lnd_comp.F90,program_off.F90,domainMod.F90,decompMod.F90,areaMod.F90,clmtype.F90,histFldsMod.F90 - -src/riverroute: -RtmMod.F90 - -src/biogeochem: -CASAMod.F90,DUSTMod.F90,CNPhenologyMod.F90,STATICEcosysDynMod.F90,DGVMMod.F90,CNrestMod.F90,VOCEmissionMod.F90,CNNDynamicsMod.F90,CNVegStructUpdateMod.F90 - -src/biogeophys: -BalanceCheckMod.F90,SurfaceRadiationMod.F90,SoilTemperatureMod.F90,Biogeophysics1Mod.F90,Biogeophysics2Mod.F90,FrictionVelocityMod.F90,Hydrology1Mod.F90,Hydrology2Mod.F90,BiogeophysicsLakeMod.F90,HydrologyLakeMod.F90,BareGroundFluxesMod.F90,CanopyFluxesMod.F90 - -bld/offline/tests: -CLM_lab.pm,test_batch.csh - -tools/mksurfdata: -mkdynpftMod.F90,mkgridMod.F90,shr_timer_mod.F90,mklaiMod.F90,mkglacier.F90,mkurban.F90,fileutils.F90,mksoitex.F90,mkfileMod.F90,domainMod.F90,areaMod.F90,creategridMod.F90,mkvarsur.F90,mksrfdat.F90,nanMod.F90,mklanwat.F90,mksoicol.F90,Makefile,mkpftMod.F90 - -tools/mkgriddata: -mkvarctl.F90,fileutils.F90,mkgriddata.F90,mkfileMod.F90,domainMod.F90,areaMod.F90,creategridMod.F90,mkvarsur.F90,nanMod.F90,Makefile - -Code changes: -Merge atm2lnd_state_type, atm2lnd_flux_type. Same for lnd2atm state/flux. - Related changes in clm3 and elsewhere in code. -Add domainMod.F90 and domain_type. Migrate grid data into domain type. - Instantiate adomain(atm/coarse), ldomain(lnd/finemesh), rdomain(rtm), - ddomain(atmdrv external data) in model. -Add lats, latn, lonw, lone 2d arrays and associated code changes. -Cleanup areaMod.F90; merging subroutines, removing redundant code, eliminate - *_point routines. -Remove numlon -Add decomp_type for gcelldc and gcellsn. Remove redundant data in other - arrays related to addressing physical space and logical space. -Clean up interface in set_landunit subroutines. Remove redundant code. -Clean up procs and clumps datatypes, removing redundant data. -Migrate clm3 topology data to pointers from copies -Add gridmap_type for interpolation and associated code and routines to - support the type. -Add clm_atmlnd.F90 file for upscale/downscale code. Add clm_mapa2l - and clm_mapl2a to carry out mapping associated with upscale/downscale. -Add gridmap_setmapsFM for generation of weights for downscale/upscale - routines. -forc_ndep should not be in atm2lnd_type. -Reuse code as much as possible throughout. -Update mksurfdata, mkgriddata. Speed code up, bfb, new fields added, - new input options for files. Fill with wetland, add PFTDATA_MASK - field for real/fake land. -Update code to clm3_expa_53 -Rename latixy and longxy to latc and lonc. -Remove fullgrid attribute. - -Summary of testing: - - bluesky: full clm test, full cam test - tempest: full cam test - bangkok/lf95: full cam test - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_53 - -IF tag changes answers relative to baseline comparison the -following should be filled in: bfb - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? bfb - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - -Tag name: clm3_expa_53 -Originator(s): Mariana Vertenstein -Date: Fri Dec.16 2005 -One-line Summary: Put in MCT communication for cam-clm coupling - -Purpose of changes: removed lp_coupling communication and put in -MCT communication interfaces - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the input datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Mariana Vertenstein, Rob Jacob - -List all subroutines eliminated: none - -List all subroutines added and what they do: - main/MCT_atmlnd_cpl.F90 - clm/cam MCT coupling interface - will be moved out of clm code in - near future - main/MCT_lnd_comp.F90 - clm MCT wrapper layer - main/clm_comp.F90 - module containing wrapper routines that separate clm into chunks of - code that contain no communication (e.g. clm_run1, clm_run2 has no - communicaiton). This is needed to satisfy requirement for implementing - multiple coupling interfaces (e.g. concurrent/MCT, sequential/MCT, - sequential/ESMF) within ccsm. - main/clm_varorb.F90 - module for orbital parameters - (this will be added to program_off.F90 and program_csm.F90) - -List all existing files that have been modified, and describe the changes: - clm_camMod.F90 - all coupling still exists here - -Summary of testing: - - bluesky: - test-model.pl -res T31 - test-model.pl -res T31cn - test-model.pl -res T31cnall - test-model.pl -res T31casa - test-model.pl -res T31dgvm - - tempest: No testing - - bangkok/lf95: No testing - -CLM tag used for the baseline comparison tests if applicable: clm3_expa_48 - results were bfb with clm3_expa48 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - - MSS location of control simulations used to validate new climate: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - -Tag name: clm3_expa_52 -Originator(s): Mariana Vertenstein -Date: Tues Dec.12 2005 -One-line Summary: Put in scam fix needed in CAM mode - -Purpose of changes: clean up svn clm structure - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: -None - -Describe any changes made to the namelist: -None - -List any changes to the defaults for the input datasets: -None - -Describe any substantial timing or memory changes: -None - -Code reviewed by: -Mariana Vertenstein - -List all subroutines eliminated: -None - -List all subroutines added and what they do: -None - -List all existing files that have been modified, and describe the changes: -clm_camMod.F90 (this change was put into cam3_2_41) - -Summary of testing: -No testing done - -CLM tag used for the baseline comparison tests if applicable: -NA - -IF tag changes answers relative to baseline comparison the -following should be filled in: - -Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - -If bitwise differences were observed, how did you show they were no worse -than roundoff? - -If this tag changes climate describe the run(s) done to evaluate the new -climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - -MSS location of control simulations used to validate new climate: - -URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - -Tag name: clm3_expa_51 -Originator(s): mvr -Date: Tues Dec.12 2005 -One-line Summary: removed src/utils dir - -Purpose of changes: should've been done with external setup in prev tag - -Bugs fixed (include bugzilla ID): none - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the input datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: mvr, mvertens - -List all subroutines eliminated: -D src/utils - -List all subroutines added and what they do: -none - -List all existing files that have been modified, and describe the changes: -none - -Summary of testing: - -bluesky: none -tempest: none -bangkok/lf95: none - -CLM tag used for the baseline comparison tests if applicable: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - -Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - -If bitwise differences were observed, how did you show they were no worse -than roundoff? b4b - -If this tag changes climate describe the run(s) done to evaluate the new -climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - -MSS location of control simulations used to validate new climate: - -URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -Tag name: clm3_expa_50 -Originator(s): Mariana Vertenstein -Date: Tues Dec.12 2005 -One-line Summary: Updated external definitions for utils - -Purpose of changes: clean up svn clm structure - -Bugs fixed (include bugzilla ID): - -Describe any changes made to build system: -None - -Describe any changes made to the namelist: -None - -List any changes to the defaults for the input datasets: -None - -Describe any substantial timing or memory changes: -None - -Code reviewed by: -NA - -List all subroutines eliminated: -None - -List all subroutines added and what they do: -None - -List all existing files that have been modified, and describe the changes: -None - -Summary of testing: -No testing done - -CLM tag used for the baseline comparison tests if applicable: -NA - -IF tag changes answers relative to baseline comparison the -following should be filled in: - -Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - -If bitwise differences were observed, how did you show they were no worse -than roundoff? - -If this tag changes climate describe the run(s) done to evaluate the new -climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - configuration (CPP ifdefs): - - build-namelist command (or complete namelist): - - MSS location of output: - -MSS location of control simulations used to validate new climate: - -URL for LMWG diagnostics output used to validate new climate: - -=============================================================== - -Tag name: clm3_expa_49 -Originator(s): Mariana Vertenstein -Date: Mon Dec 12 2005 -One-line Summary: Updated clm with changes put into cam3_2_38 - -Purpose of changes: -Cray-X1E OpenMP/CSD compatibility modifications. - -Bugs fixed (include bugzilla ID): -None - -Describe any changes made to build system: -None - -Tested that restarts are bit-for-bit: yes -Tested that different domain decompositions match bit-for-bit: yes -Code reviewed by: myself -Changes answers: no (bit-for-bit) -Changes made: - -This is the start of the clm_exp experimental development -branch. This version is the same as clm3_deva_10 which was checked -into clm_dev by Mariana Vertenstein on April 27th, 2004. -=============================================================== -=============================================================== -=============================================================== diff --git a/doc/clm4_0_ChangeLog b/doc/clm4_0_ChangeLog deleted file mode 100644 index 24ab7a6911..0000000000 --- a/doc/clm4_0_ChangeLog +++ /dev/null @@ -1,16442 +0,0 @@ -=============================================================== -Tag name: clm4_0_81 -Originator(s): bandre (Benjamin Andre) -Date: Mon Apr 29 12:12:42 MDT 2013 -One-line Summary: Charlie Koven's variable consolidation, cryoturbation and BSW CPP changes - -Purpose of changes: - 1) variable consolidation -- these are all things like adding up - the leafc_to_litr1c, stemc_tolitr1c, frootc_to_litr1c, etc. into a - single set of fluxes, e.g. phenology_c_to_litr_met_c. this - introduces roundoff-level differences in every calculation of C - and N from plants to litter, so it will propagate quickly to - everywhere in the CN and CN4Me code. - - 2) cryoturbation - the changes to the active layer profiles. This - should have a real but minor effect everywhere where there is - permafrost, because it will change the mixing rates of all soil - material into and out of the permafrost. However, this is so slow - that it should only really matter during spinup. - - 3) BSW bugfix - Remove the STNDRD_BSW_FOR_SOILPSI_CALC CPP - token. This had already been set in the CN4Me code, but will cause - real changes to both the drought phenology and frozen temperature - sensitivity of the CN code. - - -Requirements for tag: - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - remove the CPP flag for STNDRD_BSW_FOR_SOILPSI_CALC - -Describe any changes made to the namelist: - remove: shape_fluxprof, max_altmultiplier_cryoturb, max_altdepth_cryoturbation - add: max_altdepth_cryoturbation, max_depth_cryoturb - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: variable consolidation should decrease runtime - -Code reviewed by: Charlie Koven - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - - remove configure option for BSW - M models/lnd/clm/bld/configure - M models/lnd/clm/bld/config_files/config_definition.xml - - remove of BSW ifdef - M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 - M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 - M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 - M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 - - - add/remove nl options for cryoturbation - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - - - cryoturbation - M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 - M models/lnd/clm/src/clm4_5/main/controlMod.F90 - - - variable consolidation - M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 - M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 - M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 - M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 - M models/lnd/clm/src/clm4_5/main/clmtype.F90 - M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes, two unexpected fails on comparison, should pass next time. - - CESM test lists: - - yellowstone/aux_clm intel yes - New expected failures: - all compare_hist tests with CLM45CN test should fail, but be ok next time (answer changes) - ERS_D.f10_f10.ICLM45CN4Me.nldir_ch4_set2_ciso - CFAIL - test needs to be updated to remove shape_fluxprof from namelist - ERS_D.f10_f10.ICLM45CN4Me.nldir_ch4_set3_pftroot - CFAIL - test needs to be updated to remove shape_fluxprof from namelist - PET_D_P1x30.ne30_g16.ICN - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - SMS_RLA.f45_f45.I - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - SMS_RLA.f45_f45.ICLM45 - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - SMS_ROA.f45_f45.I - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - SMS_ROA.f45_f45.ICLM45 - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - - yellowstone/aux_clm pgi yes - New expected failures: - all compare_hist tests with CLM45CN test should fail, but be ok next time (answer changes) - SMS_RLB.f45_f45.I - FAIL- runtime mpi abort from pio. fixed in pio-1.6.8? - SMS_RLB.f45_f45.ICLM45 - FAIL - runtime mpi abort from pio. fixed in pio-1.6.8? - - frankfurt/aux_clm_int intel no - frankfurt/aux_clm intel no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_80 - -Changes answers relative to baseline: yes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: CLM45, all CN and CN4Me compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - variable consolidation - roundoff - cryoturbation - larger than roundoff/same climate - BSW - climate changing - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database): - - This will change climate only in CN (not CN4Me mode), because of - the changed BSW (removal of incorrect second BSW formulation) - leading to slight differences in phenology. This has been fixed - in CN4Me for some time, and has not been observed to detrimentally - effect the climate in that configuration. - - I (Charlie Koven) ran trunk tag 80 and the branch synced to tag 80 for - 30 years at f19 resolution in I1850CLM45CN4Me compset, with AD spinup - turned on. I did not find sytematic differences in GPP or NEE. The - difference is that there was somewhat less passive pool carbon - mixed to the ~3m soil layer, and somewhat more accumulatin gin the - ~2m layer; this is consistent with the changes to the - crypoturbation code, which sets a fixed depth of cryoturbation - throughout the permafrost region, instead of making it - proportional to active layer thickness. - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_80 -Originator(s): erik (Erik Kluzek) -Date: Fri Apr 26 02:28:39 MDT 2013 -One-line Summary: Bring Fang Li. Fire model into CLM4.5 science, update ALL CLM4.5 surface datasets, - provide a working initial condition file for CLM45BGC@f19_g16-1850 - -Purpose of changes: Bring the F. Li and S. Levis Fire model for CLMCN and CLMBGC based on -Li et al. (2012a,b; 2013). New data streams are added to bring in lightning frequency -(NASA-LIS climatology of 1995-2011 interpolated to T62) and human population density at half-degree -(currently from 1850 to 2010, no rcp data is available yet). Annual 1850–2010 population -density that is obtained by temporal linear interpolation of the data from HYDEv3.1 -(prior to 1990) and GPWv3 (since 1990) at 0.5 degree resolution. GDP (Gross Domestic Product), -peat fraction, and maximum month for agricultural fires are also included on the -surface datasets. Fang Li tuned the fire model based on a branch version -(newfire05_clm45sci15_clm4_0_58) at f19_g16 resolution with CLMBGC for transient 1850-2000 -with Qian atmosphere forcing. New fire fields are read in from the pft-physiology file. - -ALL CLM4.5 surface datasets and pftdyn datasets were updated. ALL standard datasets -now have glc_nec=10 data on them and CAN be used for IG simulations with CISM for -10 glacier elevation classes. The standard way of running is still -with glc_nec=0. Surface datasets include data used by previous parameterizations added in CLM4.5: - - ZWT0, F0, and P3 for the CLM4Me methane model - (PH can be read in on the surface dataset, but is NOT included on the current datasets) - LAKEDEPTH for the Subin variable depth lake model - (ETALAKE and LAKEFETCH can be read in, but are NOT included on the current datasets) - SLOPE, STD_ELEV for the Swenson dynamic wetlands parameterization - binfl, Ds, Dsmax, Ws for the optional VIC hydrology scheme (only read in when VIC active) - gdp, peatf, and abm for the new fire model above - (always read in although it wouldn't HAVE to be for CLMSP) - -Also provide one working initial condition file for CLM45BGC at 1.9x2.5_gx1v6 resolution for 1850. This -will work for CLM45BGC (-vsoil_centbgc on) as long as the vertical carbon profiles are active. No other -initial condition files are provided at this time. This was from year 51 of a CLMBGC spinup simulation -by Fang Li with Qian forcing for 1850 (case qian_1850). - -Bug fix, from Sam Levis so that non-irrigated prognostic crop for CLM4.5 works correctly. Previously -irrigated and non-irrigated crop for CLM4_5 gave the same results (with irrigation active even when -you told it NOT to be). - -Also transient simulations are now allowed to be done with a cold start -- YOU SHOULD NEVER DO THIS FOR SCIENCE! -It does help facilitate testing however. - -Requirements for tag: - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1670 (irrigated crop and non-irrigated crop for CLM45 give same answers) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: New light_streams and popd_streams namelists for CLM - By default the light_stremas namelist runs over the NASA_LIS climatology data (3-hourly). - The population density namelist runs over the applicable years for the use_case given for the compset. - This can be customized with: - stream_year_first_popdens, stream_year_last_popdens, model_year_align_popdens - (and the filename and map-algorithm can be changed as well) - -List any changes to the defaults for the boundary datasets: All surfdata, finidat, and pftdyn - datasets for clm4_5 were updated - -Code reviewed by: self, slevis, fangli - -List any svn externals directories updated (csm_share, mct, etc.): pio - pio to pio_1_6_7 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/listDefaultNamelist.pl -- Get working for clm4_5. - M models/lnd/clm/bld/build-namelist ---------- check vsoilc_centbgc for finidat files, new light_streams and - popd_streams namelists for clm4_5 - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- all new fsurdat, fpftdyn datasets, settings - for new popd_streams and light_streams namelists - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add new light_streams and popd_streams namelists - ->>>>>>>>>>>> Set first and last pop-dens year, and do "arb_ic" rather than "startup" ->>>>>>>>>>>> type for all transient cases (allow transient cases to do a cold-start) ->>>>>>>>>>>> ALTHOUGH YOU SHOULD NEVER DO A COLD START FOR A TRANSIENT CASE! - M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - ->>>>>>>>>>>> Some small changes to documentation about irrigation. - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - - M models/lnd/clm/src/util_share/ndepStreamMod.F90 -- make default private, namelist data private, and clm_domain_mct public - - M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 --- add number of individuals - M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -- handle more impacts of fire - M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 ----------- Fire module -- almost entirely replaced. Two new public - methods added: -+ public :: CNFireInit ! Initialization of CNFire -+ public :: CNFireInterp ! Interpolate fire data - M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -------- Handle more impacts of fire - M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -- Handle more impacts of fire - M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 ----------- burndate, lfc, wf, btran2, col_ctrunc, totsomc added to restart - old fire fields removed, _vr fields required if expected., - M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 --- Add CNFireInit, and update CNFireArea call. - M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 ------- Set fire variables. - M models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 farea_burned impacts SAI for stubble after harvest - M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -------------- Initialize new fire variables - M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 --------- Update CNEcosystemDynInit call - M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 ---------------- Add prec10 and prec60 (10 and 60 day total precipitation) - M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 ------------ Initialize new fire variables. - M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 ----------------- Update lf_conv_cflux, make PFT weight check same as for surfrdMod.F90 - M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -------------- Read in new fire data, abort if data needed NOT found on the - surface dataset. - M models/lnd/clm/src/clm4_5/main/findHistFields.pl ------------- Also read in CNFireMod for history fields. - M models/lnd/clm/src/clm4_5/main/clm_driver.F90 ---------------- Add CNFireInterp call. - M models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -------------- Initialize lf_conv_cflux to zero. - M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 ----------------- Read in new fire parameters - (no longer need "resist" on the pft-physiology file) - M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 ----------------- Fix tolerances to match mksurdata_map - bug fix for non-irrigated crop. - M models/lnd/clm/src/clm4_5/main/clmtype.F90 ------------------- New fire fields - M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -------------- Initialize some new fire fields: tsoi17, fsat - M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 --------------- New fire history fields - M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 ----- Save btran2, smp_node_lf for fire - M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 ------- Save wf2, tsoi17, h2osoi_liqice_10cm - - M models/lnd/clm/src/clm4_0/main/surfrdMod.F90 ----------------- Fix tolerances to match mksurdata_map - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/aux_clm intel yes - yellowstone/aux_clm pgi yes - frankfurt/aux_clm_int intel yes - frankfurt/aux_clm intel yes - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_79 - -Changes answers relative to baseline: YES! - - Summarize any changes to answers: - - what code configurations: All with CLM45 - - what platforms/compilers: All - - nature of change: new climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - /glade/p/cesm/lmwg/cases/cesm1/C20new -- on yellowstone - /glade/scratch/erik/archive/clm4079_NewFire10f19_CRU_20TR_CN4Me - /glade/scratch/erik/archive/clm4077_I1850CLM45CN4Me - /glade/scratch/erik/archive/clm4077_NewFire10f19_QIAN_20TR_CN4Me - hsi:/home/fangli/qian20 - -=============================================================== -=============================================================== -Tag name: clm4_0_79 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Wed Apr 24 20:27:01 MDT 2013 -One-line Summary: pftdyn, pft-phys*.nc and datm8 update - -Purpose of changes: From Erik:: - update Don't re-weight pftdyn if weights are essentially identical (Both CLM40 AND CLM45). - - Turn wasteheat to "ON" in CLM45. (namelist change) (done) - - Change from Sam Levis for CROP to pft-physiology file so that CROP parameter is in Kelvin rather than Celsius (both CLM40 and CLM45). - - Change datm so that LWDN is NOT read from files for CRUNCEP (datm8_130424). - -Requirements for tag: fix bug 1621 - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): fixed 1621 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: turn waste heat on in clm4_5 - -List any changes to the defaults for the boundary datasets: change pft-phys files for 4_0 and 4_5 - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, Erik, Dave Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): - -< models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_130424 ---- -> models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_130325 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M SVN_EXTERNAL_DIRECTORIES - update to datm8_130424 - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml - - $CSMDATA/lnd/clm2/pftdata/pft-physiology.clm40.c130424.nc -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - change ON_WASTEHEAT to ON - - use $CSMDATA/lnd/clm2/pftdata/pft-physiology.c130424.nc - -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_0/main/pftdynMod.F90 - - change wtpfttot2 check - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - syntax clean up - caught by Ben Andre - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK. many expected failures due to new pft-physiology files. Should pass next time. - - CESM test lists: - Many nlcomp failures: - clm4_5: - NEW: fpftcon = '/fs/cgd/csm/inputdata/lnd/clm2/pftdata/pft-physiology.c130424.nc' - BASELINE: fpftcon = '/fs/cgd/csm/inputdata/lnd/clm2/pftdata/pft-physiology.c121025.nc' - NEW: urban_hac = 'ON' - BASELINE: urban_hac = 'ON_WASTEHEAT' - clm4_0: - NEW: fpftcon = '/fs/cgd/csm/inputdata/lnd/clm2/pftdata/pft-physiology.clm40.c130424.nc' - BASELINE: fpftcon = '/fs/cgd/csm/inputdata/lnd/clm2/pftdata/pft-physiology.c110425.nc' - - component_gen_comp: all PASS or BFAIL1 - summarize_cprnc_diffs: differences in CLM files - - yellowstone/CESM: - intel: OK. Expected failures for compare_hist (should pass next time) - FAIL ERS_D.f19_g16.IGRCP26CN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL ERS_D.f19_g16.IRCP85CN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL ERS_E.f19_g16.I1850CRUCLM45CN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL NCK.f10_f10.ICRUCLM45.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL PET_PT.f10_f10.I20TRCN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - FAIL SMS.f19_g16.IRCP45CN.yellowstone_intel.GC.222079.compare_hist.clm4_0_78 - pgi : OK. Expected failures for compare_hist (should pass next time) - FAIL ERS_D.hcru_hcru.I_2000_CRUFRC_CLM45_CN.yellowstone_pgi.GC.111079.compare_hist.clm4_0_78 - FAIL ERS_D.hcru_hcru.I_2000_CRUFRC_CN.yellowstone_pgi.GC.111079.compare_hist.clm4_0_78 - FAIL PET_PT.f10_f10.I20TRCN.yellowstone_pgi.GC.111079.compare_hist.clm4_0_78 - - frankfurt/CESM: - intel: OK. Expected failures for compare_hist (should pass next time) - FAIL SMS.f10_f10.IRCP26CN.frankfurt_intel.GC.pft79.compare_hist.clm4_0_78 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_78 - -Changes answers relative to baseline: yes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): same climate - -in coupler history files: l2x_Sl_*, l2x_Fall, x2l_Slrr* and some r2x_* fields change - -in clm history files: for these tests only differences seen in IGRCP60CN - -=============================================================== -=============================================================== -Tag name: clm4_0_78 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Tue Apr 23 19:25:18 MDT 2013 -One-line Summary: MEGAN fixes - -Purpose of changes: - - - Bug fixes in MEGAN VOC emission fluxes and dry deposition velocities - - Remove the land fraction weighting from MEGAN history fields - - Added XPAN capability to dry deposition parametrization - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, starting branch from Erik. - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - - maximum string length of megan_specifier increased to 1024 characters - - M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 - M models/lnd/clm/src/clm4_0/biogeochem/VOCEmissionMod.F90 - - land fraction weighting has been removed from the MEGAN diagnostics - - added initialization of the vocflx_meg array to zero to prevent - erroneous values from contributing to the MEGAN emissions - - M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 - M models/lnd/clm/src/clm4_0/biogeochem/DryDepVelocity.F90 - - corrected surface pressure - - added XPAN specification - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK - - yellowstone/CESM: - -intel: OK - -component_gen_comp fails on a number of tests, but it is all expected. summarize_cprnc_diffs verifies that all fails in the - CLM history files is consistent. - -compare_hist failures are expected due to new dry deposition values going through coupler. - -pgi : OK - -compare_hist failures are expected - - frankfurt/CESM: - -intel: OK. - -compare_hist failures are expected - -CLM tag used for the baseline comparison tests if applicable: clm4_0_77 - -Changes answers relative to baseline: Yes. Changes in l2x_Sl_dd{001-035},l2x_Sl_dd{040,041,043} in coupler hist file. - Possible changes in *_voc fields in coupler hist files for certain configurations. Changes in 10 MEG_* fields and VOCFLXT in CLM history files. - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): same climate. changes in CLM fields range from 1.e-9 - (VOCFLXT) to 1.e-17 (MEG_thujene_a) - -=============================================================== -=============================================================== -Tag name: clm4_0_77 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Tue Apr 23 11:38:45 MDT 2013 -One-line Summary: fix carbon balance bug in transient runs with VERTSOI, and fix Soil Hydrology bug - -Purpose of changes: - -Fix two bugs: - -(1) In transient CLM45 runs with VERTSOI, a carbon balance error - occurred due to two routines being called with updated filters - when they should have been called with filters set at their values - from the previous time step. This bug has existed since clm4_0_62. - -(2) A potential for an array out-of-bounds error (which could show up - as garbage results if array bounds checking was off) which showed - up in rare circumstances (e.g., a single grid cell in Greenland in - a 1-year test run) - -Requirements for tag: Fix bugs 1663, 1664 - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - - 1663 (array bounds error in SoilHydrologyMod) - 1664 (carbon balance errors) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Fix for bug 1664 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -========= Fix for bug 1663 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: no - - CESM test lists: - - yellowstone/CESM: yes - - All PASS or xFAIL; all component_gen_comp comparisons pass or BFAIL1 - - yellowstone/CESM/allIcompsets: no - - frankfurt/CESM: yes - - All PASS or xFAIL - - test_system testing: - - yellowstone batch: no - frankfurt interactive: no - yellowstone interactive: no - lynx batch: no - lynx interactive: no - frankfurt batch: no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_76 - -Changes answers relative to baseline: YES, potentially (though none -observed in standard testing) - - Answer changes are possible in any CLM45 case due to the SoilHydrology - bug fix (1663). This changes answers only in rare situations where the - water table comes near the surface (e.g., in a 1-year test run, this only - happened in one grid cell in Greenland) - - In addition, the following answer changes are expected due to the fix for - bug 1664: - - (1) CLM45 transient with VERTSOI (i.e., BGC). Implementing this change in - clm4_0_62 (the first tag that exhibited bug 1664), clm4_0_62-withFix - was identical to clm4_0_61 for this configuration. But clm4_0_77 will - differ from clm4_0_76 for this configuration. - - (2) Answers are changed for CLM45 CNDV with VERTSOI (i.e., BGCDV). It - appears that this configuration was buggy before this tag (e.g., - restarts weren't exact), so this tag changes answers in a way that - seems to fix this configuration. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? NOT DONE - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_76 -Originator(s): muszala (Stefan Muszala) -Date: Mon Apr 22 13:36:26 MDT 2013 -One-line Summary: spinup changes from Charlie Koven (part 1) - -Purpose of changes: - -Remove SPINUP CPP tokens, in favor of a run-time namelist item that can be set to -change the spinup mode on the fly. The state is stored on the restart file, and -if the user changes the mode on the namelist -- the model will automatically do -the "ENTER-SPINUP" or "EXIT-SPINUP" step as needed on the first time-step. The -spinup options were thus removed from the CLM configure for CLM45 and moved to -the build-namelist as option "-spinup" with values either "on" or "off". - - -Add new history fields: TOTLITC_1m, TOTSOMC_1m, TOTLITN_1m, and TOTSOMN_1m. -Remove the namelist item: reset_permafrost_c_n_pools. Removed default history -output for decomposing C pool changes due to vertical transport, and for vertical - profiles for N Deposition and fixation. - - -Answer Changes for C13: C13 and C13 Carbon isotopes are handled a bit differently - when they are NOT on the restart file. For C13 prior timestep's downregulation -is used in calculating ci used for photosynthetic discrimination. This changes - answers when use_c13 is turned on. - -Requirements for tag: N/A - -Test level of tag: std-tag - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Change the way spin up is handled - -Describe any changes made to the namelist: spinup now controlled in build-namelist - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Dave L. checked spinup test comparing old and new method. Erik, Charlie Koven - -List any svn externals directories updated (csm_share, mct, etc.): - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130416a -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130419a - -List all files eliminated: N/A - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/config_files/config_definition.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK. - some new failures that should be gone when compared to the next tag. This is due to the new namelist variable - - < spinup_state = 0 - - 418/444 < FAIL> - 423/444 < FAIL> - 428/444 < FAIL> - 433/444 < FAIL> - 438/444 < FAIL> - 443/444 < FAIL> - - CESM test lists: - - yellowstone/CESM: SPM - tracking tputcomp failures - cesm intel: OK - FAIL ERS.f09_g16.ICLM45VIC.nldir_vic_vrtlay.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_D.f10_f10.I.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_D.f10_f10.ICLM45.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_D.f10_f10.ICLM45CN4Me.nldir_ch4_set2_ciso.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_D.f10_f10.ICLM45CN4Me.nldir_ch4_set3_pftroot.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_D.f10_f10.ICLM45CN4MeNoVS.nldir_rootlit.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_E.f19_g16.I1850.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.222075.tputcomp.clm4_0_74 - cesm pgi : OK - FAIL SMS.1x1_numaIA.ICNCROP.yellowstone_pgi.GC.111075.tputcomp.clm4_0_74 - - frankfurt/CESM: - cesm intel: OK - FAIL ERS.f45_g37.I1850CN.frankfurt_intel.GC.00075.tputcomp.clm4_0_74 - FAIL SMS.f10_f10.IRCP26CN.frankfurt_intel.GC.00075.tputcomp.clm4_0_74 - FAIL SMS_D.1x1_mexicocityMEX.I.frankfurt_intel.GC.00075.tputcomp.clm4_0_74 - - -CLM tag used for the baseline comparison tests if applicable: clm4_0_75 - -Changes answers relative to baseline: some changes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - -Answer Changes for C13: C13 and C13 Carbon isotopes are handled a bit differently - when they are NOT on the restart file. For C13 prior timestep's downregulation -is used in calculating ci used for photosynthetic discrimination. This changes - answers when use_c13 is turned on. - -=============================================================== -=============================================================== -Tag name: clm4_0_75 -Originator(s): muszala (Stefan Muszala) -Date: Fri Apr 19 16:13:42 MDT 2013 -One-line Summary: run propset - -Purpose of changes: run propset so externals are updated - -Requirements for tag:N/A - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system:N/A - -Describe any changes made to the namelist:N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes:N/A - -Machines testing ran on: no testing run -=============================================================== -=============================================================== -Tag name: clm4_0_74 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Wed Apr 17 15:58:50 MDT 2013 -One-line Summary: snow_depth changes, major scripts overhaul, small fix for tools - -Purpose of changes: bring in snow_depth changes (bfb except for one field in clm hist files, SNOWDP) - update external to alpha06e and bring in scripts refactoring by mvertens. Bug fix for mksurfdata_map - by sacks. Some minor code cleanup by muszala. - -Requirements for tag: N/A - -Test level of tag: doc, std-test + tools - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): Bug in pio1_6_6 which kills mpi-serial runs, jedwards is working on fix. - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens, swensoc - -List any svn externals directories updated (csm_share, mct, etc.): - -< scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130416a -> scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/newcompsets2_tags/newcompsets2_02_scripts4_130405a -< scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130412 -> scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130403 -< models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_2_29 -> models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_2_26 -< models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_6_6/pio -> models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_6_5/pio -< tools/cprnc https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_130411 -< tools/mapping https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130403 -> mapping https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130308 -< models/lnd/clm/tools/clm4_5/gen_domain https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130403/gen_domain_files -> models/lnd/clm/tools/clm4_5/gen_domain https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130308/gen_domain_files - -List all files eliminated: models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES (moved cprnc to common location). - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -SVN_EXTERNAL_DIRECTORIES - ---small fix from sacks. -models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkglcmecMod.F90 -models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkglcmecMod.F90 - ---update xFail list since we now run test_system tests out of cesm and scripts ---test_system now uses create_test -models/lnd/clm/test/system/test_system -models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - ---minor clean up -models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -models/lnd/clm/src/util_share/organicFileMod.F90 -models/lnd/clm/src/util_share/decompInitMod.F90 - ---snow depth changes -models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -models/lnd/clm/src/clm4_5/main/clm_driver.F90 -models/lnd/clm/src/clm4_5/main/inicPerpMod.F90 -models/lnd/clm/src/clm4_5/main/clmtype.F90 -models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK. - - CESM test lists: (this now includes tests from test_system batch from yellowstone). - -yellowstone:: - CESM intel: OK - CESM pgi: OK -frankfurt: - CESM intel: OK. just ran generate. run these instead of test_system interactive tests from now on. - -Tool testing: OK. This was to double check my merge since the branch I started with was in clm4_0_68. - -CLM tag used for the baseline comparison tests if applicable: clm4_0_73 - -Changes answers relative to baseline: Only change is in the clm history field, SNOWDP. Everything else is bfb. - - -=============================================================== -=============================================================== -Tag name: clm4_0_73 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Mon Apr 15 09:48:03 MDT 2013 -One-line Summary: update mksurfdata_map for CLM4.5, and other misc. updates, mainly to tools - -Purpose of changes: - -Main purpose is to add a bunch of new fields to the CLM4.5 mksurfdata_map: -- SLOPE, STD_ELEV -- LAKEDEPTH -- peatf, abm, gdp (for fire) -- binfl, Ws, Dsmax, Ds (for VIC) -- F0, P3, ZWT0 (for methane) - -Also, other miscellaneous changes: - -- some refactoring of mksurfdata_map, and get more routines under unit test - -- for CLM4.5 mksurfdata_map, always use hires datasets, except for pft - -- add support for 36 glc_mec elevation classes (though there are currently - no surface datasets for this option) - -- add support for 1-d domain files in mksurfdata_map - -- add createXMLEntries.pl for creating xml entries for new mapping files - -- change default behavior of new_woodharv for clm4.0 (default is true now), - and only support new_woodharv=true for clm4.5 - -- allow global & regional map generation in a single submission of - mkmapdata/regridbatch.sh - -- handle clm4_0 vs clm4_5 distinction in mkmapdata.sh - -- handle large file support more robustly in mkmapdata.sh - -- refactored mkscripgrid.ncl to use built-in ESMF utility - -- remove 0.47x0.63 support for CLM4.5, since we don't have a good scrip - grid file for that resolution - -- in some files in bld/namelist_files, fix some resolutions listed as - 360x720 to be 360x720cru - -- a few other minor changes, as noted below - - -Requirements for tag: Requirements: tools tests, and build-namelist -test (to catch any accidental changes to CLM's namelist), fix bug: -1641. Also ran standard tests to cover all bases. - -Test level of tag: standard + tools - -Bugs fixed (include bugzilla ID): - - 1641 (RCP6 and RCP8.5 used old bad wood harvest for 2006 and 2007) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None to CLM namelist, but many -changes to mksurfdata_map namelist. - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - -========= Move to new inputs directory -D models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_lookup_2d_netcdf.nc - -List all files added and what they do: - -========= Create xml entries and commands to move files to inputdata for - a bunch of mapping files -A models/lnd/clm/tools/clm4_5/mkmapdata/createXMLEntries.pl - -========= Guide for how to add new fields to mksurfdata_map -A models/lnd/clm/tools/clm4_5/mksurfdata_map/README.developers - -========= Pull out shared mksurfdata_map code into new, shared modules -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkdiagnosticsMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkchecksMod.F90 - -========= Regrid new fields for mksurfdata_map -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mktopostatsMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkgdpMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkagfirepkmonthMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpeatMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkVICparamsMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkCH4inversionMod.F90 - -========= Get more of mksurfdata_map code under unit tests -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkchecksMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkgridmapMod.F90 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkdomainMod.F90 - -========= Add inputs for new mksurfdata_map unit tests -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_domain_read_dims__lsmlon.nc -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_domain_read_dims__lon.nc -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_domain_read_dims__lon_and_num_pixels.nc -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_domain_read_dims__lon_and_ni.nc -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_domain_read_dims__num_pixels.nc - -========= Move to inputs directory -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/test_lookup_2d_netcdf.nc - - -List all existing files that have been modified, and describe the changes: - -========= Add new mksurfdata_map variables and mapping files -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvarctl.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 - - also add no_inlandwet option - - also handle the case where special landunits sum to a - tiny bit more than 100% and thus give negative pct_pft -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mklanwatMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 - - also add some other global attributes -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Srcfiles -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - - also add merge_gis and inlandwet options, remove ngwh - option, remove hires option (instead use hirespft) -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata_map.namelist -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - also add support for 36 glc_mec columns, and remove 0.47x0.63 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - - also remove 0.47x0.63, remove coarse-res lake, change logic for - determining glacier dataset, remove ngwh=off rcp6 and rcp8.5 datasets - - also add xml file support for more scrip grid file info -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - - also add support for 36 glc_mec columns, no_inlandwet option, - remove a duplicate section, remove 0.47x0.63 - - also add xml file support for more scrip grid file info -M models/lnd/clm/bld/namelist_files/checkmapfiles.ncl -M models/lnd/clm/doc/UsersGuide/tools.xml - -========= Add nodata argument to gridmap_areaave -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkgridmapMod.F90 - - also add gridmap_areastddev and gridmap_check routines -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mklaiMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksoilMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkharvestMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparCommonMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvocefMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 - -========= Add support for 36 glc_mec elevation classes -M models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkglcmecMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkglcmecMod.F90 -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0_tools.xml - - also fix ngwh default for rcp6 for 2006 and 2007 - - also add xml file support for more scrip grid file info -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml - - also add xml file support for more scrip grid file info -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - -========= Change default behavior of new_woodharv for clm4.0 -M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl - -========= Add new test routines -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Srcfiles - -========= Change location of input files for unit testing -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkncdio.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkindexmapMod.F90 - -========= Add support for 1-d domain files; allow larger diffs in - domain_checksame -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkdomainMod.F90 - -========= Allow global & regional map generation in a single submission -M models/lnd/clm/tools/clm4_5/mkmapdata/regridbatch.sh - -========= Fix yellowstone ESMF path, add new grids, remove bluefire, - no longer make atm-ocn and RTM mapping files, handle large - file support and other grid-specific flags in a more robust - way, add option to differentiate between clm4_0 vs 4_5 -M models/lnd/clm/tools/clm4_5/mkmapdata/mkmapdata.sh - -========= Refactored to use built-in ESMF utility -M models/lnd/clm/tools/clm4_5/mkmapgrids/mkscripgrid.ncl - -========= Remove 0.47x0.63 for CLM4.5, since we don't have a good scrip grid - file for that resolution -M models/lnd/clm/tools/clm4_5/mkmapgrids/mkmapgrids.csh - -========= Renumber build-namelist unit tests due to removing a - resolution. Also cleaned up expectedFails list, mostly removing - tests that now pass, changing failure types, and adding - ERB.ne30_g16.I_1948-2004, which failed in clm4_0_72, too -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -========= Fix some paths in tools test scripts -M models/lnd/clm/test/tools/TBLCFGtools.sh -M models/lnd/clm/test/tools/TBLscript_tools.sh -M models/lnd/clm/test/tools/test_driver.sh -M models/lnd/clm/test/tools/TBLtools.sh -M models/lnd/clm/test/tools/TOPtools.sh - - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - All PASS or xFAIL - - CESM test lists: - - yellowstone/CESM: yes - All PASS or xFAIL except: - - ***** Not listed in xFAIL list, but failed in clm4_0_72, so I'm - adding it to the xFAIL list - FAIL ERB.ne30_g16.I_1948-2004.yellowstone_intel - - yellowstone/CESM/allIcompsets: no - - test_system testing: - - yellowstone batch: yes - All PASS or xFAIL except: - - ***** No baselines - BFAIL ERS_D.f10_f10.I_2000_CLM45_CN4MeNoVSoil.yellowstone_intel_rootlit.GC.142502.compare_hist.clm4_0_72 - - From component_gen_comp, all PASS or BFAIL1 except: - - ****** No baselines - BFAIL2 ERS_D.f10_f10.I_2000_CLM45_CN4MeNoVSoil.yellowstone_intel_rootlit.compare_hist.clm4_0_72.clm2.h0 (baseline history file does not exist) - BFAIL2 ERS_D.f10_f10.I_2000_CLM45_CN4MeNoVSoil.yellowstone_intel_rootlit.compare_hist.clm4_0_72.clm2.h1 (baseline history file does not exist) - - - frankfurt interactive: yes - All PASS or xFAIL (including component_gen_comp) - - - yellowstone interactive: no - lynx batch: no - lynx interactive: no - frankfurt batch: no - - test_driver.sh tools testing: - - frankfurt interactive: no - Couldn't get tools to build on frankfurt, from either my branch or - the clm4_0_72 trunk tag - - yellowstone interactive: yes - All PASS except: - - ********* These seem to be expected failures, based on the fact that they fail in clm4_0_72. Note that the - ********* gen_domain tests themselves pass, but the baseline comparisons fail, even if I compare clm4_0_72 - ********* against itself - 006 ble14 TBLCFGtools.sh clm4_5 gen_domain CFGtools__ds T31.runoptions ..........................rc=4 FAIL - 008 ble@4 TBLCFGtools.sh clm4_5 gen_domain CFGtools__ds ne30.runoptions .........................rc=4 FAIL - 027 smiS4 TSMscript_tools.sh clm4_5 ncl_scripts getregional_datasets.pl getregional .............rc=6 FAIL - 028 bliS4 TBLscript_tools.sh clm4_5 ncl_scripts getregional_datasets.pl getregional .............rc=4 FAIL - - ********* Expected baseline failures due to changes in default behavior of CLM4_5 mksurfdata_map - ********* (see notes on answer changes, below, for what changed; I have rerun these tests with some - ********* changes on my branch and in the trunk tag to confirm that baseline comparisons pass when I - ********* revert the differences noted there) - 012 blg54 TBLtools.sh clm4_5 mksurfdata_map tools__s namelist ...................................rc=7 FAIL - 020 bli24 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds rc=7 FAIL - 022 bli53 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__o ....rc=7 FAIL - 024 bli54 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ds ...rc=7 FAIL - 026 bli57 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__do ...rc=7 FAIL - 030 bli74 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools_ rc=7 FAIL - 032 bliT4 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools_ rc=7 FAIL - - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_72 - -Changes answers relative to baseline: NO. However, changes behavior of -these offline tools: - -mksurfdata_map for clm4.5: changes the following defaults: -- use hires raw datasets (where available) for everything except pctpft -- zeroes out inland wetland areas -- changes default glacier dataset for glc_mec surface datasets -- uses correct ngwh dataset for rcp6.0 2006 & 2007 - -mksurfdata_map for clm4.0: changes the following defaults: -- uses correct ngwh dataset for rcp6.0 2006 & 2007 - -mkmapdata.sh: -- no longer generates ocean-atmosphere and RTM mapping files - -mkscripgrid.ncl: -- roundoff-level changes in coordinates -- grid_dims is fixed (now correctly nx by ny, rather than ntot by ntot) - -=============================================================== -=============================================================== -Tag name: clm4_0_72 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Thu Apr 11 15:13:40 MDT 2013 -One-line Summary: maoyi bug fix for vic hydro - -Purpose of changes: Bring in changes from Maoyi that fix a few bugs in the VIC hydrology code. Make a small change in - scripts that fixes NoVS runs. - -Requirements for tag: N/A - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): 1648 - -Known bugs (include bugzilla ID): 1658 - ERB problem with clm4_0. - 1659 - RTM restart problem when under a day boundary - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: changed NoVSBGC to NoVS in scripts branch_tag - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): changed scripts branch tag to - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/newcompsets2_tags/newcompsets2_01_scripts4_130405a -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/newcompsets2_tags/newcompsets2_02_scripts4_130405a - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -from Maoyi Huang: - -The variable cps%ws in my original codes overlaps with another variable in the SLAKE option. So I renamed it to cps$Wsvic. -wtsub in SoilHydrologyMod.F90 when VICHYDRO was on was not initialized. To avoid any potential conflicts, I renamed it to wtsub_vic and initialized it to 0._r8. -cleaned up the codes a little bit by taking out all variables that were not used. - -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Machines testing ran on: (Tests in priority order) - -- updated xFail list and slightly modified test_system yellowstone.batch to reflect ERS_D and ERS_Ln48_D changes. -- tracking tputcomp and memcomp changes in advance of refactoring modifications. - - build-namelist unit tester: All OK. All Failures in clm4_0_71 now pass. - - CESM test lists: - - cesm intel: PID: 163148: OK. a number of tputcomp failures: - FAIL ERS_D.f10_f10.I.yellowstone_intel.GC.163148.tputcomp.clm4_0_71 - FAIL ERS_Lm3.1x1_vancouverCAN.I1PT.yellowstone_intel.GC.163148.tputcomp.clm4_0_71 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.163148.tputcomp.clm4_0_71 - FAIL SMS_RLA.f45_f45.ICLM45.yellowstone_intel.GC.163148.tputcomp.clm4_0_71 - FAIL SMS.1x1_mexicocityMEX.I1PTCLM45.yellowstone_intel.GC.163148.tputcomp.clm4_0_71 - - cesm pgi: PID: 163101 OK. one memcomp failure - FAIL ERS.f19_g16.ICNCROP.yellowstone_pgi.GC.163101 - - test_system testing: - - yellowstone batch: OK. Fixed a problem with NoVS, found bug in - FAIL ERS.f19_g16.I_1850_CLM45_CN4Me.yellowstone_intel_user_nl_dirs.GC.162650.tputcomp.clm4_0_71 - FAIL ERS_D.f10_f10.I_2000_CLM45_CN4Me.yellowstone_intel_ch4_set2_ciso.GC.162650.memcomp.clm4_0_71 - FAIL ERS_D.f10_f10.I_2000_CLM45_CN4Me.yellowstone_intel_ch4_set2_ciso.GC.162650.tputcomp.clm4_0_71 - FAIL ERS_D.f10_f10.I_2000_CLM45_CN4Me.yellowstone_intel_ch4_set3_pftroot.GC.162650.tputcomp.clm4_0_71 - - frankfurt interactive: OK. generate and tputcomp sub-tests failed. - FAIL SMS_D_Mmpi-serial.1x1_vancouverCAN.I1PTCLM45.frankfurt_intel_user_nl_dirs.GC.165025.generate.clm4_0_72 - FAIL SMS_D_Mmpi-serial.1x1_vancouverCAN.I1PTCLM45.frankfurt_intel_user_nl_dirs.GC.165025.tputcomp.clm4_0_71 - FAIL ERS_Mmpi-serial.1x1_mexicocityMEX.I1PTCLM45.frankfurt_intel_user_nl_dirs.GC.165025.generate.clm4_0_72 - FAIL ERS_Mmpi-serial.1x1_mexicocityMEX.I1PTCLM45.frankfurt_intel_user_nl_dirs.GC.165025.tputcomp.clm4_0_71 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_72 - -Changes answers relative to baseline: only for VIC. Original implementation broken. Consider this tag the new baseline against which to test for VIC. - -IF tag changes answers relative to baseline comparison the -following should be filled in: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_71 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Wed Apr 10 08:43:00 MDT 2013 -One-line Summary: compsets refactoring by mvertens - -Purpose of changes: Bring in externals that refactor the compset handling. Update CLM to - work with the new compsets. Compsets are now extensible and easier to - modify and work with. - -Requirements for tag: N/A - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: modify CLM to work with new compset refactor - -Describe any changes made to the namelist: modify CLM to work with new compset refactor - -List any changes to the defaults for the boundary datasets: N/A Levy's new files will come in later. - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: mvertens, erik - -List any svn externals directories updated (csm_share, mct, etc.): - -https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/newcompsets2_tags/newcompsets2_01_scripts4_130405a -https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130403 -https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_2_26 -https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_130325 -https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_02/socn -https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_02/sice -https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_02/sglc -https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_02/swav -https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_130405 -http://parallelio.googlecode.com/svn/trunk_tags/pio1_6_5/pio -https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130308 -https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130308/gen_domain_files - -List all files eliminated: - -D models/lnd/clm/test/system/tests_posttag_lynx_nompi -D models/lnd/clm/test/system/mirage.interactive -D models/lnd/clm/test/system/TCBCFGtools.sh -D models/lnd/clm/test/system/tests_pretag_bluefire_nompi -D models/lnd/clm/test/system/config_files -D models/lnd/clm/test/system/config_files/gen_domain -D models/lnd/clm/test/system/config_files/tools__do -D models/lnd/clm/test/system/config_files/tools__s -D models/lnd/clm/test/system/config_files/CFGtools__ds -D models/lnd/clm/test/system/config_files/tools__ds -D models/lnd/clm/test/system/config_files/README -D models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -D models/lnd/clm/test/system/config_files/tools__o -D models/lnd/clm/test/system/get_cprnc_diffs.sh -D models/lnd/clm/test/system/TSMncl_tools.sh -D models/lnd/clm/test/system/CLM_compare.sh -D models/lnd/clm/test/system/TBLCFGtools.sh -D models/lnd/clm/test/system/README.testnames -D models/lnd/clm/test/system/tests_posttag_yong -D models/lnd/clm/test/system/TCBtools.sh -D models/lnd/clm/test/system/test_driver.sh -D models/lnd/clm/test/system/lynx.interactive -D models/lnd/clm/test/system/tests_pretag_yellowstone_nompi -D models/lnd/clm/test/system/bluefire.batch -D models/lnd/clm/test/system/Makefile -D models/lnd/clm/test/system/TSMscript_tools.sh -D models/lnd/clm/test/system/tests_posttag_mirage -D models/lnd/clm/test/system/tests_posttag_frankfurt_nompi -D models/lnd/clm/test/system/gen_test_table.sh -D models/lnd/clm/test/system/TOPtools.sh -D models/lnd/clm/test/system/input_tests_master -D models/lnd/clm/test/system/TSMtools.sh -D models/lnd/clm/test/system/TBLscript_tools.sh -D models/lnd/clm/test/system/tests_posttag_nompi_regression -D models/lnd/clm/test/system/TBLtools.sh -D models/lnd/clm/test/system/show_var_diffs.sh -D models/lnd/clm/test/system/TSMCFGtools.sh - -List all files added and what they do: - -A + models/lnd/clm/test/tools -A + models/lnd/clm/test/tools/TSMscript_tools.sh -A + models/lnd/clm/test/tools/TCBCFGtools.sh -A + models/lnd/clm/test/tools/tests_posttag_frankfurt_nompi -A + models/lnd/clm/test/tools/config_files -A + models/lnd/clm/test/tools/config_files/gen_domain -A + models/lnd/clm/test/tools/config_files/tools__do -A + models/lnd/clm/test/tools/config_files/tools__s -A + models/lnd/clm/test/tools/config_files/CFGtools__ds -A + models/lnd/clm/test/tools/config_files/tools__ds -A + models/lnd/clm/test/tools/config_files/README -A + models/lnd/clm/test/tools/config_files/tools__o -A + models/lnd/clm/test/tools/get_cprnc_diffs.sh -A + models/lnd/clm/test/tools/gen_test_table.sh -A + models/lnd/clm/test/tools/TSMncl_tools.sh -A + models/lnd/clm/test/tools/CLM_compare.sh -A + models/lnd/clm/test/tools/nl_files -A + models/lnd/clm/test/tools/nl_files/nl_ch4_set2_ciso -A + models/lnd/clm/test/tools/nl_files/nl_ch4_set3_pftroot -A + models/lnd/clm/test/tools/nl_files/gen_domain.ne30.runoptions -A + models/lnd/clm/test/tools/nl_files/mksrfdt_1x1_brazil_1850 -A + models/lnd/clm/test/tools/nl_files/nl_rootlit -A + models/lnd/clm/test/tools/nl_files/gen_domain.T31.runoptions -A + models/lnd/clm/test/tools/nl_files/mksrfdt_10x15_1850 -A + models/lnd/clm/test/tools/nl_files/nl_ciso -A + models/lnd/clm/test/tools/nl_files/nl_anoxia_wtsat -A + models/lnd/clm/test/tools/nl_files/clm4_0_mksrfdt_1x1_numaIA_mp20irrcr_2000 -A + models/lnd/clm/test/tools/nl_files/mksrfdt_T31_crpglc_2000 -A + models/lnd/clm/test/tools/nl_files/clm4_0_mksrfdt_10x15_irr_1850 -A + models/lnd/clm/test/tools/nl_files/getregional -A + models/lnd/clm/test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 -A + models/lnd/clm/test/tools/nl_files/mksrfdt_1x1_brazil_1850-2000 -A + models/lnd/clm/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 -A + models/lnd/clm/test/tools/nl_files/mkmapdata_ne30np4 -A + models/lnd/clm/test/tools/nl_files/nl_vrtlay -A + models/lnd/clm/test/tools/nl_files/nl_oldhyd -A + models/lnd/clm/test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 -A + models/lnd/clm/test/tools/nl_files/mkmapdata_if10 -A + models/lnd/clm/test/tools/TBLCFGtools.sh -A + models/lnd/clm/test/tools/input_tests_master -A + models/lnd/clm/test/tools/TOPtools.sh -A + models/lnd/clm/test/tools/README -A + models/lnd/clm/test/tools/TSMtools.sh -A + models/lnd/clm/test/tools/README.testnames -A + models/lnd/clm/test/tools/TBLscript_tools.sh -A + models/lnd/clm/test/tools/tests_posttag_yong -A + models/lnd/clm/test/tools/TCBtools.sh -A + models/lnd/clm/test/tools/test_driver.sh -A + models/lnd/clm/test/tools/tests_posttag_nompi_regression -A + models/lnd/clm/test/tools/tests_pretag_yellowstone_nompi -A + models/lnd/clm/test/tools/TBLtools.sh -A + models/lnd/clm/test/tools/show_var_diffs.sh -A + models/lnd/clm/test/tools/TSMCFGtools.sh -A + models/lnd/clm/test/tools/Makefile -A + models/lnd/clm/test/system/yellowstone.namelist - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/test_system -M models/lnd/clm/test/system/yellowstone.interactive -M models/lnd/clm/test/system/frankfurt.interactive -M models/lnd/clm/test/system/README -M models/lnd/clm/test/system/yellowstone.batch -M models/lnd/clm/bld/user_nl_clm -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/clm.buildnml.csh -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -MM models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -MM models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -MM models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 -M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: - -These should pass next time around: --these two are due to megan now being on by default: - 030/449 < FAIL> - 037/449 < FAIL> --these four should pass next time...no baselines in clm4_0_70 - 108/449 < FAIL> - 109/449 < FAIL> - 443/449 < FAIL> - 444/449 < FAIL> - - CESM test lists: - - yellowstone/CESM: -intel: other than our expected fail list, current failures should pass during the next round of testing -pgi : see intel - -note for intel and pgi: nlcomp fails should not be considered truth or otherwise. There is a bug compare_namelist. -lots of BFAILS when comparing to clm4_0_70 and some differences in coupler hist. vars. -These are expected due to a new CISM and DATM. - - test_system testing: - - yellowstone batch: OK. See explanation for yellowstone/CESM tests above. - frankfurt interactive: OK. After modifying the frankfurt compset for 1PT. - -CLM tag used for the baseline comparison tests if applicable: clm4_0_70 - -Changes answers relative to baseline: yes, due to CISM, but not due to any science changes in CLM itself. There will be -changes in some coupler history files. - -=============================================================== -=============================================================== -Tag name: clm4_0_70 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Mon Apr 1 15:58:23 MDT 2013 -One-line Summary: bring in vic hydrology - -Purpose of changes: Merge in VIC hydrology. This is an isolated option that stands on it's -own and does not effect existing code. Added tests with and without vrtlay = .true.. - -Requirements for tag: Add vic tests for CLM45 and CLM45-vrtlay, normal testing protocol - -Test level of tag: standard + I_compsets + yellowstone_rtm batch - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID):VIC crashes when run in debug mode-1648 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Add namelist option for vichydro - -Describe any changes made to the namelist: Add namelist option for vichydro - -List any changes to the defaults for the boundary datasets: Using temporary surface data sets. New datasets - will come in at a later tag. The temporary data sets do not effect normal CLM runs. - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Erik,Maoyi Huang - -List any svn externals directories updated (csm_share, mct, etc.):N/A - -List all files eliminated:N/A - -List all files added and what they do: - -- For new VIC tests: -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_f09/user_nl_clm -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_f09 -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_f19/user_nl_clm -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_f19 -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_vrtlay/user_nl_clm -A models/lnd/clm/test/system/user_nl_dirs/vic/vic_vrtlay -A models/lnd/clm/test/system/user_nl_dirs/vic -- For VIC implementation: -A models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -A models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 - -List all existing files that have been modified, and describe the changes: - -- For VIC namelist fucntionality -M models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/config_files/config_definition.xml -- For new VIC tests -M models/lnd/clm/test/system/yellowstone.batch -- VIC implementation -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK - - CESM test lists: - - yellowstone/CESM: - cesm intel: OK. some tputcomp FAILs, but main tests pass - cesm pgi: OK. one tputcomp FAIL, main tests pass - yellowstone/CESM/allIcompsets: OK. - - test_system testing: - yellowstone rtm batch: OK. - yellowstone batch: OK. - - new VIC tests: - ERS.f09_g16.I_2000_CLM45_VIC -user_nl_dir ../models/lnd/clm/test/system/user_nl_dirs/vic/vic_f09 - SMS.f19_g16.I_2000_CLM45_VIC -user_nl_dir ../models/lnd/clm/test/system/user_nl_dirs/vic/vic_f19 - ERS.f09_g16.I_2000_CLM45_VIC -user_nl_dir ../models/lnd/clm/test/system/user_nl_dirs/vic/vic_vrtlay - ERS_D.f09_g16.I_2000_CLM45_VIC -user_nl_dir ../models/lnd/clm/test/system/user_nl_dirs/vic/vic_vrtlay - this last one expected to Fail. - - frankfurt interactive: OK. - -CLM tag used for the baseline comparison tests if applicable: clm4_0_69 - -Changes answers relative to baseline: No. The VIC hydro option, if turned on - does change answers, but the use of this code is isolated from the rest of CLM. - -=============================================================== -=============================================================== -Tag name: clm4_0_69 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Tue Mar 26 16:24:54 MDT 2013 -One-line Summary: remove hydro reorder, volr and esmf mods - -Purpose of changes: fix volrlnd init. from SPVAL to 0.0 so TWS in CLM looks correct. - modify esmf interfaces for volr. remove hydrology reordering due to nasty bug in - restart. - -Requirements for tag: fix bug 1644 - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): 1644 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist:N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Dave L. and Jinyn Tang. Minor review by Erik and Bill. - -List any svn externals directories updated (csm_share, mct, etc.): update RTM to 1_0_22 - -List all files eliminated: N/A - -List all files added and what they do:N/A - -List all existing files that have been modified, and describe the changes: -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 -M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - - only run CESM tests: - -=== CESM Yellowstone PGI tests: OK. All BFAILS occur in cmopare_hist which is expected due to the removal of the hydro. reordering. -Status with expected failures removed: -./cs.status.114300.yellowstone | grep -v PET_PT.f19_g16.I1850 | grep -v SMS.1x1_numaIA.ICN_CROP | grep -v PET_PT.f10_f10.I20TRCN | grep -v PET_PT.f19_g16.ICLM451850 | grep -v SMS.T31_g37.IG4804CLM45 | grep -v SMS.1x1_numaIA.ICLM45CNCROP | grep -v PET_PT.f10_f10.I20TRCLM45CN | grep -v PASS -Possible test result outcomes: -... -BFAIL SMS_RLB.f45_f45.I.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERS_D.hcru_hcru.I_2000_CRUFRC_CN.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERS.f19_g16.ICNCROP.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERI.f19_g16.IG1850.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL SMS.T31_g37.IG4804.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL SMS.1x1_numaIA.ICNCROP.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL SMS_RLB.f45_f45.ICLM45.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERS_D.hcru_hcru.I_2000_CRUFRC_CLM45_CN.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERS.f19_g16.ICLM45CNCROP.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 -BFAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.114300.compare_hist.clm4_0_68 - -=== CESM Yellowstone INTEL tests: OK. All BFAILS occur in cmopare_hist which is expected due to the removal of the hydro. reordering. -Status with expected failures removed: ->>./cs.status.114247.yellowstone | grep -v ERH_D.f19_g16.I1850CLM45CN | grep -v ERB.ne30_g16.I_1948-2004_CLM45 | grep -v ERS_E.f19_g16.I1850CRUCLM45CN | grep -v CME.f10_f10.ICN | grep -v ERS_D.f10_f10.ICLM45 | grep -v PET_PT.f19_g16.I1850CN | grep -v ERB.ne30_g16.I_1948-2004 | grep -v PET_PT.f10_f10.I20TRCN | grep -v PET_PT.f19_g16.I1850CLM45CN | grep -v ERS_E.f19_g16.ICLM451850 | grep -v ERS_D.f19_g16.IGRCP26CLM45CN | grep -v ERS_Lm3.f19_g16.IGRCP60CLM45CN | grep -v PET_PT.f10_f10.I20TRCLM45CN | grep -v SMS.f19_g16.IRCP45CLM45CN | grep -v ERS_D.f19_g16.IRCP85CLM45CN | grep -v PASS | grep -v COMMENT -... -FAIL ERS_D.f10_f10.I.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_D.f10_f10.I.yellowstone_intel.GC.114247.tputcomp.clm4_0_68 -FAIL NCK.f10_f10.I.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_E.f19_g16.I1850.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERH_D.f19_g16.I1850CN.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_D.f19_g16.IGRCP26CN.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.114247.tputcomp.clm4_0_68 -FAIL SMS.f19_g16.IRCP45CN.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_D.f19_g16.IRCP85CN.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 -FAIL ERS_D.f19_g16.IRCP85CN.yellowstone_intel.GC.114247.memcomp.clm4_0_68 -FAIL SMS_ROA.f45_f45.ICLM45.yellowstone_intel.GC.114247.tputcomp.clm4_0_68 -FAIL NCK.f10_f10.ICRUCLM45.yellowstone_intel.GC.114247.compare_hist.clm4_0_68 - -=== test_system yellowstone.rtm.batch: OK. All compare_hist failures are expected due changes in photosynthesis - -CLM tag used for the baseline comparison tests if applicable: For Cesm intel and pgi tests- clme_0_68 - for rtm tests, against clm4_0_66. - for science validation, clm4_0_66 - -Changes answers relative to baseline: yes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - obvious changes in GPP,FPSN and FCTR. Other fields changed as well. - ran the following and had Dave L. and Jinyun Tang look at output. - f19_g16_I_1850_CLM45_CN_yellowstone_intel_photo_clm4_0_66/ - f19_g16_I_1850_CLM45_CN_yellowstone_intel_photo_clm4_0_68/ - f19_g16_I_1850_CLM45_CN_yellowstone_intel_photo_clm4_0_69/ - f19_g16_ICLM45_yellowstone_intel_photo_clm4_0_66/ - f19_g16_ICLM45_yellowstone_intel_photo_clm4_0_68/ - f19_g16_ICLM45_yellowstone_intel_photo_clm4_0_69/ - -=============================================================== -=============================================================== -Tag name: clm4_0_68 -Originator(s): erik (Erik Kluzek) -Date: Sat Mar 16 16:03:14 MDT 2013 -One-line Summary: Fix mksurfdata_map for ne120np. Error out if SUM(weights)/=100. Photosynthesis change for CLM45. - -Purpose of changes: - -Bring in ne120fix branch to trunk. This fixes some issues in mksurfdata_map for generation -of ne120np surface data file. Put error back in CLM if weights don't sum to 100. Add in -Keith Oleson's photosynthesis change. This changes canopy top: triose phosphate utilization rate at 25C to -be dependent on vcmax25top ( maximum rate of carboxylation) rather than jmax25top (maximum electron -transport rate). Update getco2_historical.ncl script to be able to handle rcp files as well. - -Update scripts so that I1PT settings for urban single-point files will be used, and IRCP -will properly do a hybrid startup. And seperate out intel/pgi test lists. - -Update datasets for ne120np4 and ne240np4 (CLM40), with updated mksurfdata_map. - -Requirements for tag: - Tools test, yellowstone batch, fix bug 1632/1643 - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): 1632 (ne120np4 mksurfdata problem) - 1643 (Fix RES_COMPSET_MATCH for I1PT, IRCP*) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New surfdata and pftdyn files for ne120np4 (CLM40) - New surfdata files for ne240np4 (CLM40) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, sacks (mksrfdata changes) - -List any svn externals directories updated (csm_share, mct, etc.): scripts - scripts updated to scripts4_130315c - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/yellowstone.batch --- Fix some compset names - - M models/lnd/clm/tools/clm4_5/ncl_scripts/getco2_historical.ncl - Handle rcp CO2 files - M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 -- Clean out small PFT values - M models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mksurfdat.F90 -- Clean out small PFT values - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml ------- Update ne120/ne240 surfdata/pftdyn datasets - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ------- Delete ALL finidat files as none compatible - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Add rcp CO2 datasets: rcp2.6/4.5/6/8.5 - - M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 - Add back abort if surfdata weights don't sum to 100% - M models/lnd/clm/src/clm4_0/main/surfrdMod.F90 - Add back abort if surfdata weights don't sum to 100% - M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 - change in photosynthesis - -Changes in expected fails for testing: - - build-namelist unit-test: Following fail because of new datasets will pass next tag - 203 ne120 - 208 ne240 - 306 ne120 20th Century - 428 48x96 for CLM45 (remove finidat) - failType="FAIL">answers change on restart - - - Changes to expected fail: - - - - -+ answers change on restart -+ answers change on restart -+ answers change on restart -+ answers change on restart -+ answers change on restart -+ answers change on restart -+ answers change on restart -+ answers change on restart - - - - - +Restart difference - +Restart difference - +Restart difference - +Restart difference - +Restart difference - -Machines testing ran on: (Tests in priority order) - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/CESM: yes - yellowstone/CESM/allIcompsets: yes - - test_system testing: - - yellowstone batch: yes - frankfurt interactive: yes - - test_driver.sh tools testing: - - yellowstone interactive: yes - frankfurt interactive: yes - -CLM tag used for the baseline comparison tests if applicable: clm4_0_68 - -Changes answers relative to baseline: Yes! - - - what code configurations: - All CLM45 change because of change in photosynthisis - I1PT compsets change because of scripts bug - IRCP compsets now startup with new initial conditions - - what platforms/compilers: All - - nature of change: similar climate - -=============================================================== -=============================================================== -Tag name: clm4_0_67 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Tue Mar 12 11:14:59 MDT 2013 -One-line Summary: Jinyun photosynthesis and hydrology reorder - -Purpose of changes: Bring in mods that reorder hydrology code and modes that - address photosynthesis CN code. This tag is F90 code only. - -Requirements for tag: N/A - -Test level of tag: std-test + ICompset tests + yellowstone interactive - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist:N/A - -List any changes to the defaults for the boundary datasets:N/A - -Describe any substantial timing or memory changes:N/A - -Code reviewed by: Dave L, S. Swenson, self - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated:N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -Major changes in CNEcosystemDynMod, SoilHydrologyMod and Hydrology2Mod. Also did some deadCode removal (unused pointer -assignments, unused modules and local variables. - - M biogeochem/CNEcosystemDynMod.F90 - effects CN. Split out CNEcosystemDynA and CNEcosystemDynB - - M main/CNiniTimeVar.F90 - removed some commented out code - M main/clmtypeInitMod.F90 - removed commented out init_gridcell_pstate_type - M main/pftdynMod.F90 - M main/initSurfAlbMod.F90 - effects CN. For photosynthesis. - M main/clm_driver.F90 - M main/CNiniSpecial.F90 - M ain/clmtype.F90 - M main/histFldsMod.F90 - - M biogeophys/Hydrology2Mod.F90 - split out 2A and 2B subroutines - M biogeophys/SoilHydrologyMod.F90 - split out new WaterTable routine from existing Drainage routine - M biogeophys/BareGroundFluxesMod.F90 - M biogeophys/CanopyFluxesMod.F90 - For photosynthesis. - - -Machines testing ran on: (Tests in priority order) - -Dave Lawrence looked at 1 year runs to make sure behavior looked OK before and after mods. -S. Swenson looked at short simulations to make sure reordering worked correctly in the hydrology code. -Expect changes in the following fields (depending on compset and test type) - -roff Flrl_rofliq -roff Flrl_rofliq -lnd Flrl_rofliq -lnd Flrl_rofliq -roff Forr_roff -roff Forr_roff -roff Flrl_rofliq -roff Flrl_rofliq -lnd Fall_lat -lnd Fall_lat -lnd Fall_sen -lnd Fall_sen -lnd Fall_evap -lnd Fall_evap -lnd Flrl_rofliq -lnd Flrl_rofliq -roff Forr_roff -roff Forr_roff -roff Flrl_rofliq -roff Flrl_rofliq -lnd Sl_fv -lnd Sl_f - -l2x_Sl_avsdr -l2x_Sl_anidr -l2x_Sl_avsdf -l2x_Sl_anidf -l2x_Sl_tref -l2x_Sl_qref -l2x_Sl_t -l2x_Sl_fv -l2x_Sl_ram1 -l2x_Sl_snowh -l2x_Sl_u10 -l2x_Fall_swnet -l2x_Fall_taux -l2x_Fall_tauy -l2x_Fall_lat -l2x_Fall_sen -l2x_Fall_lwup -l2x_Fall_evap -l2x_Fall_flxdst1 -l2x_Fall_flxdst2 -l2x_Fall_flxdst3 -l2x_Fall_flxdst4 -l2x_Flrl_rofliq -x2l_Slrr_volr -r2x_Slrr_volr -r2x_Forr_roff -r2x_Forr_ioff -x2r_Flrl_rofliq - - build-namelist unit tester: yes - OK - - CESM test lists: - - yellowstone/CESM: yes - OK. Fails are due to new code. These should pass next tag. - - FAIL ERS.f19_g16.I_1850_CLM45_CN4Me.yellowstone_intel_user_nl_dirGC.113407 - oAIL ERS_D.fol_g16.I_1850_CLM45_CNCENTNoMe.yellowstone_intel_user_nl_dirs.GC.113407 - FAIL ERS.f19_g16.I_2000_CLM45_CN4Me_CROP.yellowstone_intel_user_nl_dirs.GC.113407 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.GC.113407 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.GC.113407.compare_hist.clm4_0_66 - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel_user_nl_dirs.GC.113407.compare_hist.clm4_0_66 - FAIL ERS_Ld211_D_P224x1.f10_f10.ICLM45CNCROP.yellowstone_intel_crop.GC.113407 - FAIL ERS_Ld211_P384x1.f19_g16.ICLM45CNDVCROP.yellowstone_intel_crop.GC.113407 - FAIL ERS_Ld211.f10_f10.I_2000_CLM45_VOC_CN.yellowstone_intel_voc.GC.113407 - FAIL ERS_Ln48_D.f10_f10.I_2000_CLM45_CN.yellowstone_intel_ciso.GC.113407.compare_hist.clm4_0_66 - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel_glcMEC.GC.113407 - - yellowstone/CESM/allIcompsets: yes - OK - - test_system testing: - - yellowstone batch: yes - OK. Fails are due to new code. These should pass next tag. - - FAIL ERS.f19_g16.I_1850_CLM45_CN4Me.yellowstone_intel_user_nl_dirs.GC.113407 - FAIL ERS_D.f19_g16.I_1850_CLM45_CNCENTNoMe.yellowstone_intel_user_nl_dirs.GC.113407 - FAIL ERS.f19_g16.I_2000_CLM45_CN4Me_CROP.yellowstone_intel_user_nl_dirs.GC.113407 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.GC.113407 - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel_user_nl_dirs.GC.113407.compare_hist.clm4_0_66 - FAIL ERS_Ld211_D_P224x1.f10_f10.ICLM45CNCROP.yellowstone_intel_crop.GC.113407 - FAIL ERS_Ld211_P384x1.f19_g16.ICLM45CNDVCROP.yellowstone_intel_crop.GC.113407 - FAIL ERS_Ld211.f10_f10.I_2000_CLM45_VOC_CN.yellowstone_intel_voc.GC.113407 - FAIL ERS_Ln48_D.f10_f10.I_2000_CLM45_CN.yellowstone_intel_ciso.GC.113407.compare_hist.clm4_0_66 - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel_glcMEC.GC.113407 - - frankfurt interactive: yes - OK - yellowstone interactive: yes - reasonably OK. Added a few tests to xFail list that need new - surface data sets. - The following fail due to new code and should pass next round: - - FAIL ERS_D_Mmpi-serial.CLM_USRDAT.ICLM45USUMB.yellowstone_intel_user_nl_dirs.GC.075359.compare_hist.clm4_0_66b - FAIL ERS_D_P1x1_Mmpi-serial.f19_g16.I20TR_CLM45VSCN.yellowstone_intel_voc.GC.075359 - FAIL ERS_D_P1x1_Mmpi-serial.f19_g16.I20TR_CLM45VSCN.yellowstone_intel_voc.GC.075359.compare_hist.clm4_0_66b - FAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000_CLM45.yellowstone_intel_monthly.GC.075359.compare_hist.clm4_0_66b - FAIL ERS_Ld211_Mmpi-serial.1x1_brazil.I_2000_CLM45_CN.yellowstone_intel_monthly.GC.075359.compare_hist.clm4_0_66b - FAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000_CLM45_CNDV.yellowstone_intel_monthly.GC.075359.compare_hist.clm4_0_66b - -CLM tag used for the baseline comparison tests if applicable: clm4_0_66 - -Changes answers relative to baseline: Photosynthesis mods and reordering will change answers - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): hydrology reordering will introducce very small changes due to the process of moving around, but not changing code. - photosysthesis mods are major changes that effect science - - -=============================================================== -=============================================================== -Tag name: clm4_0_66 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Thu Mar 7 11:54:05 MST 2013 -One-line Summary: turn off subgrid topography snow parameterization for glc_mec landunits - -Purpose of changes: - -Change from Sean Swenson to turn off subgrid topography snow -parameterization over glc_mec landunits: ice_mec columns already account -for subgrid topographic variability through their use of multiple elevation -classes; thus, to avoid double-accounting for topographic variability in -these columns, we ignore topo_std and use a value of n_melt that assumes -little topographic variability within the column. - -Requirements for tag: yellowstone cesm tests, make sure GLC test goes - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: no - - CESM test lists: - - yellowstone/CESM: yes - All PASS or xFail (ignoring tput failures); only baseline failure is, - the following, which is an expected failure: - FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.C.113330.compare_hist.clm4_0_65 - - yellowstone/CESM/allIcompsets: no - - test_system testing: - - yellowstone batch: no - frankfurt interactive: no - yellowstone interactive: no - lynx batch: no - lynx interactive: no - frankfurt batch: no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_65 - -Changes answers relative to baseline: Yes, just for CLM4.5 with glc_mec - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 with glc_mec - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_65 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Thu Mar 7 09:53:31 MST 2013 -One-line Summary: back out Machines external to get more tests to pass, especially IG - -Purpose of changes: - -Some tests - particularly IG - became broken in clm4_0_64. This tag rolls -back the Machines external so that GLC compiles properly. - -Requirements for tag: - -Test level of tag: only yellowstone CESM tests - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130304b -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130301 - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -Difference in expected fails: this brings the xfail list back to what it -was in clm4_0_63, with the exception of some SBN IcompsetTests that were -added to xFail in clm4_0_64: -@@ -154,12 +154,6 @@ - scripts issue component not threaded - missing finidat file - missing finidat file -- -- No rule to make target `glc_constants.o/glade/scratch/muszala/ERI.f19_g16.IG1850.yellowstone_pgi.GC.161430/bld/glc/lib/libglimmercismfortran.a', needed by `glc_constants.mod' -- No rule to make target `glc_constants.o/glade/scratch/muszala/ERI.f19_g16.IG1850.yellowstone_pgi.GC.161430/bld/glc/lib/libglimmercismfortran.a', needed by `glc_constants.mod' -- -- ERROR: lnd_prognostic but num_inst_lnd not num_inst_max -- ERROR: lnd_prognostic but num_inst_lnd not num_inst_max - - - scripts issue with ocean not threaded -@@ -170,10 +164,6 @@ - checkWeights error, probably due to old-format urban on surface dataset - Bad compset name: ICNCROP - scripts issue with ocean not threaded -- -- No rule to make target `glc_constants.o/glade/scratch/muszala/ERI.f19_g16.IG1850.yellowstone_pgi.GC.161430/bld/glc/lib/libglimmercismfortran.a', needed by `glc_constants.mod' -- No rule to make target `glc_constants.o/glade/scratch/muszala/ERI.f19_g16.IG1850.yellowstone_pgi.GC.161430/bld/glc/lib/libglimmercismfortran.a', needed by `glc_constants.mod' -- No rule to make target `glc_constants.o/glade/scratch/muszala/ERI.f19_g16.IG1850.yellowstone_pgi.GC.161430/bld/glc/lib/libglimmercismfortran.a', needed by `glc_constants.mod' - - - - - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: no - - CESM test lists: - - yellowstone/CESM: yes - All PASS or xFail (ignoring tput failures) - (note that baselines didn't exist in clm4_0_64 for some tests, - particularly IG) - - yellowstone/CESM/allIcompsets: no - - test_system testing: - - yellowstone batch: no - frankfurt interactive: no - yellowstone interactive: no - lynx batch: no - lynx interactive: no - frankfurt batch: no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_64 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_0_64 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Wed Mar 6 12:41:26 MST 2013 -One-line Summary: update externals. fixes 40/45 intial condition problem - -Purpose of changes: Main purpose is to bring in scripts4_130227b so that - CLM45 compsets do not use CLM40 initial conditions. Put in - PTCLM fix. Secondary purpose is to update other externals. - NOTE: This tag only changes externals. No clm - code, scripts or xml files were touched. - -Requirements for tag: N/A - -Test level of tag: critical (only yellowstone, Icompset and aux 40/45 aux tests) - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Changes in processor count for certain resolutions. - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: the 40/45 fix in scripts4_130227b will fix initial condition problems. - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: muszala, Erik - -List any svn externals directories updated (csm_share, mct, etc.): - - cprnc_120828 -> cprnc_130301 - scripts4_130207 -> scripts4_130304 - Machines_130214 -> Machines_130304b - rtm1_0_19 -> rtm1_0_20 - share3_130220 -> share3_130226 - esmf_wrf_timemgr_120427 -> esmf_wrf_timemgr_130213 - timing_120731 -> timing_130214 - mapping_121113b -> mapping_130222 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: N/A - - M models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES - M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - yellowstone/CESM: yes - looks decent, but not great. There are no new test failures and new tests that do fail are - most likely due to new testlists that weren't tested in a clm tag. - A few nl comp failures since number of pes changed (expected). - Many comparisons failed due to baselines not existing. - 5 IG compsets fail due to a linking error. - 2 NCK.F10_f10 tests die with "ERROR: lnd_prognostic but num_inst_lnd not num_inst_max" - - yellowstone/CESM/allIcompsets: yes - looks OK. Transient runs added to xFail list as well as SBN.1x1_smallvilleIA.ICLM45CNCROP - and SBN.f09_g16.IGCLM45IS2 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_63 - -Changes answers relative to baseline: Yes. PE counts change plus the initial condition fixes will change answers compared - to existing baselines - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - The 40/45 fix should bring this back to being correct (ie. the state before clm4_0_60). - -=============================================================== -=============================================================== -Tag name: clm4_0_63 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Mon Mar 4 13:50:15 MST 2013 -One-line Summary: bug 1635 fix - 4_0 CN bug - -Purpose of changes: Put back some removed code. This allows CN to run with 4_0 - beyond one year - -Requirements for tag: - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): 1635 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Dave Lawrence, Sam Levis - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_0/biogeochem/CNAnnualUpdateMod.F90 ---- models/lnd/clm/src/clm4_0/biogeochem/CNAnnualUpdateMod.F90 (revision 44311) -+++ models/lnd/clm/src/clm4_0/biogeochem/CNAnnualUpdateMod.F90 (working copy) -@@ -183,6 +183,12 @@ - call p2c(num_soilc, filter_soilc, annavg_t2m, cannavg_t2m) - end if - - + ! column loop - + do fc = 1,num_soilc - + c = filter_soilc(fc) - + if (annsum_counter(c) >= get_days_per_year() * secspday) annsum_counter(c) = 0._r8 - + end do - + - end subroutine CNAnnualUpdate - !----------------------------------------------------------------------- - - -Machines testing ran on: (Tests in priority order) - yellowstone/CESM: yes only 40 list - OK. Matches xFail list - yellowstone/CESM/allIcompsets: yes - OK. Matches xFail list - - Also had D. Lawrence look at one 45 run and a 40 run from this tag compared to one from - clm4_0_58 (the tag just before this bug was introduced). All three runs were 2 years long. - -CLM tag used for the baseline comparison tests if applicable: clm4_0_62 - -Changes answers relative to baseline: No - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm4_0_62 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Sun Feb 24 15:27:09 MST 2013 -One-line Summary: add active flags, change subgrid weighting convention, other misc fixes - -Purpose of changes: - -Main set of changes involves adding 'active' flags at the pft, column & landunit -levels, saying whether computations should be run over a given point. This -change involved many changes throughout the code, changing conditionals like 'if -(pwtgcell(p) > 0)' to 'if (pactive(p))'. The purpose of this change was -two-fold: (1) make these conditionals less error-prone and more robust to future -changes in the code: currently, the 'active' condition is: weight > 0 OR type = -glc_mec -- but sometimes people forgot to include the latter condition, and it -could get worse moving forwards; (2) make it easy to change the 'active' -condition in the future -- this now just has to be done in one place, in -reweightMod. - -In changing these conditionals to use the new 'active' flags, I also added or -removed conditionals in a few places -- see notes below on the individual file -modifications. - -Also, changed subgrid weighting convention, so that the sum of weights always -adds to 1 at all levels. Previously, there was no fixed convention for the -weights of, e.g., pfts on a 0-weight column. Now, even on a 0-weight column, the -sum of pft weights on the column will still add to 1. - -Also a number of other miscellaneous fixes: -- bug-fix in handling of unstructured grids in determining new vs old urban format -- add some new surface datasets with new urban format -- other misc. fixes noted below - -Requirements for tag: - Testing: build-namelist unit tests, yellowstone cesm, yellowstone - test_system batch, frankfurt test_system interactive; include - component_gen_comp for test_system tests - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: A few new surface datasets (see below) - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik - -List any svn externals directories updated (csm_share, mct, etc.): -Main purpose is to update cism (along with necessary scripts & machines -updates), but also updated other externals to their cesm1_2_beta02 versions: -- scripts -- machines -- cism -- mct -- pio -- csm_share (includes scam update from Erik) - -List all files eliminated: - -List all files added and what they do: - -======= Handles modifications and error-checks related to changing subgrid weights -======= (note that direct calls to setFilters should no longer be made -- -======= instead, call reweightWrapup in this new module). This adds a routine that confirms -======= that all subgrid weights add to 1 (from Zack Subin). -A models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -List all existing files that have been modified, and describe the changes: - -======= add 'active' flags; replace use of things like 'if (pwtgcell(p) > 0)' -======= with 'if (pactive(p))' -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 ---------- also removed unnecessary conditional -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 ------------ also added a pactive check -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/main/dynlandMod.F90 --------------- also added a new conditional -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 ------------ also added a new conditional in p2c_2d_filter - (similar to existing conditional in p2c_1d_filter) -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 --- also remove ^M line endings accidentally added in clm4_0_61 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 - -======= replace calls to setFilters with calls to reweightWrapup; in driver, -======= moved these calls based on an analysis of where they are needed -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -======= change subgrid weighting convention; remove duplicated code in setting -======= up urban landunits. Note that, in a few places (marked by "TODO WJS") I -======= assumed an arbitrary weighting for, e.g., pft weights in a 0-weight -======= landunit. This can be changed in the future once we change how weights -======= are defined on the surface dataset (using weights on the landunit rather -======= than on the grid cell). -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -======= declare some parameters as 'parameter' (needed in order to use them in -======= select case statements) -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 - -======= make check for new vs old format more robust; in particular, fix -======= handling of unstructured grids (before, these were deemed to be -======= old-format urban files by accident) -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 - -======= use nlevurb=5 even for more_vertlayers (based on suggestion from Keith -======= and Erik) -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 - -======= use new surface datasets for glcmec 1.9x2.5 1850&2000, and f10 1850, in -======= order to have valid urban data for some tests to pass -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -======= use cism rather than sglc for test_system tests, because sglc means no -======= sno fields are sent to the coupler, which leads to ERS test failures and -======= generally weaker tests -M models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml - -======= add cism1 distinction in compset name -M models/lnd/clm/test/system/yellowstone.interactive -M models/lnd/clm/test/system/bluefire.interactive -M models/lnd/clm/test/system/lynx.batch - -======= add call to component_gen_comp -M models/lnd/clm/test/system/test_system - -======= Removed some now-passing tests, including some that were passing earlier -======= but still remained in this file -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -xFAIL differences: -Index: models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -=================================================================== ---- models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (revision 44092) -+++ models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (working copy) -@@ -113,8 +113,7 @@ - - - -- -- -+ - - - -@@ -137,7 +136,6 @@ - - scripts issue with ocean not threaded - Restart difference -- Soil balance error on restart - scripts issue with ocean not threaded - - scripts issue with ocean not threaded -@@ -149,20 +147,12 @@ - missing finidat file - - -- problem building with mpi-serial with pgi compiler -- missing LAPACK symbol dgbsv - scripts issue with ocean not threaded -- Need LAPACK for PGI (dgbsv) -- Need LAPACK for PGI (dgbsv) - Bad compset name: ICNCROP - scripts issue with ocean not threaded - -- problem building with mpi-serial with pgi compiler -- missing LAPACK symbol dgbsv -- missing LAPACK symbol dgbsv - scripts issue with ocean not threaded -- Need LAPACK for PGI (dgbsv) -- Need LAPACK for PGI (dgbsv) -+ checkWeights error, probably due to old-format urban on surface dataset - Bad compset name: ICNCROP - scripts issue with ocean not threaded - - - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - -NOTE: Ignoring throughput fails - - - build-namelist unit tester: yes - All PASS or xFAIL - - CESM test lists: - - Note: the following change was made after running the CESM test list (just - reran the one affected case: ERI.f19_g16.IG1850CLM45.yellowstone_pgi): - In bld/namelist_files/namelist_defaults_clm4_5.xml: - -lnd/clm2/surfdata_map/surfdata_1.9x2.5_simyr1850_glcmec10_c120927.nc - +lnd/clm2/surfdata_map/surfdata_1.9x2.5_simyr1850_glcmec10_c130221.nc - - yellowstone/CESM: yes - All PASS or xFAIL except: - - ***** Expected failure due to urban bug-fix for unstructured grids - FAIL ERB.ne30_g16.I_1948-2004_CLM45.yellowstone_intel.GC.051632.compare_hist.clm4_0_61 - - ***** memcomp failures probably due to using cism2 code - FAIL ERS_D.f19_g16.IGRCP26CN.yellowstone_intel.GC.051626.memcomp.clm4_0_61 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.051626.memcomp.clm4_0_61 - - ***** memcomp failures with unknown cause - FAIL ERS_D.f19_g16.IRCP85CN.yellowstone_intel.GC.051626.memcomp.clm4_0_61 - COMMENT pesmaxmem_incr = 28.2 - - yellowstone/CESM/allIcompsets: no - - test_system testing: - - yellowstone batch: yes, including component_gen_comp - All PASS or xFAIL except: - - ***** Expected failure due to new surface dataset - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.GC.051756.compare_hist.clm4_0_61_test_system - - ***** Expected failure due to urban bug-fix for unstructured grids - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel_user_nl_dirs.GC.051756.compare_hist.clm4_0_61_test_system - - ***** memcomp failures with unknown cause - FAIL ERS_Ld211.f10_f10.I_2000_CLM45_VOC_CN.yellowstone_intel_voc.GC.051756.memcomp.clm4_0_61_test_system - FAIL ERS_Ln48_D_P64x16.ne30_g16.ICN.yellowstone_intel_user_nl_dirs.GC.051756.memcomp.clm4_0_61_test_system - - - ----- COMPONENT_GEN_COMP RESULTS --- - All comparisons PASS except: - - ****** Expected failures due to new surface dataset and fix in urban for - ****** ne30 These failures all go away when I compare against one-offs - ****** from clm4_0_61 with fixes in surface datasets and the urban ne30 - ****** bug. However, there is then a diff in the h1 file for the GLCMEC - ****** test: diffs just in cols1d_wtlunit & pfts1d_wtlunit, and this is - ****** just over glc_mec columns -- this is expected due to changes in - ****** subgrid weighting convention - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel_glcMEC.compare_hist.clm4_0_61.clm2.h0 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.compare_hist.clm4_0_61.clm2.h0 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.yellowstone_intel_monthly.compare_hist.clm4_0_61.clm2.h1 - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel_user_nl_dirs.compare_hist.clm4_0_61.clm2.h0 - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel_user_nl_dirs.compare_hist.clm4_0_61.clm2.h1 - - ****** Differences just over crop landunits: RMS diffs in pft weights on - ****** col and landunit, and col weights on landunit; and FILLDIFFs in 12 - ****** column-level variables (now _FillValue in 0-weight places). These - ****** differences aren't surprising given the changes in subgrid weight - ****** convention and the fact that inactive points are now given spval in - ****** 1-d output - FAIL ERS.f19_g16.I_2000_CLM45_CN4Me_CROP.yellowstone_intel_user_nl_dirs.compare_hist.clm4_0_61.clm2.h1 - - - frankfurt interactive: yes, including component_gen_comp - All PASS or xFAIL - - yellowstone interactive: no - lynx batch: no - lynx interactive: no - frankfurt batch: no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_61 - -Changes answers relative to baseline: yes, in limited cases - see below - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 with the following: - - unstructured grids, due to urban bug fix - - glcmec @ 1.9x2.5, due to new surface datasets with new urban - - 1850 @ f10, due to new surface dataset - - what platforms/compilers: ALL - - nature of change: larger than roundoff/same climate OR new climate (not - investigated carefully) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: NOT DONE - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_61 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Wed Feb 20 15:53:38 MST 2013 -One-line Summary: rtm, drv and clm mods: tws, Volr, r01 rdric file and SoilHydroMod - -Purpose of changes: Bring Volr from RTM to CLM. - New ne120 files. - New SoidHydrologyMod file for 45 (not bit-for-bit) - Bring tws in. - Sacks test list change and test_system change. - Add yellowstone to xFail options. - Added RTM test list for test_system tests (yellowstone.rtm.batch) - DEPRECATE WT in 4_5 code. WT and the variable wt are left in since they are used in other - portions of the code, but they are marked as deprecated since we now have TWS. - -Requirements for tag: - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: muszala, swenseon, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): - drv: update from drvseq4_2_20 to drvseq4_2_22 - rtm: update from rtm1_0_18 to rtm1_0_19 - csm_share: update from share3_130213 to share3_130131 - -List all files eliminated: -D https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOn -D https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmR01 - -List all files added and what they do: - Added RTM rtm test_system tests -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnFloodOnEffvelOff/user_nl_rtm -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnFloodOnEffvelOff -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnFloodOnEffvelOn/user_nl_rtm -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnFloodOnEffvelOn -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnIceOff/user_nl_rtm -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnIceOff -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnIceOn/user_nl_rtm -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOnIceOn -A https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/yellowstone.rtm.batch - -List all existing files that have been modified, and describe the changes: -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/test_system -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/yellowstone.interactive -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOff/user_nl_rtm -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/README -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/test/system/yellowstone.batch -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/bld/unit_testers/xFail/expectedFail.pm -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/doc/ChangeLog -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/doc/ChangeSum -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 -MM https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -MM https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/main/clmtype.F90 -MM https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/models/lnd/clm/src/clm4_0/main/clm_atmlnd.F90 -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/SVN_EXTERNAL_DIRECTORIES -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/ChangeLog -M https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_60/ChangeSum - - -Machines testing ran on: (Tests in priority order) - NOTE: Lots of throughput, NLComp and memcomp fails. Also ran rtm test_system tests - - build-namelist unit tester: OK (yellowstone) - added two tests that were missing from xFail list - - CESM test lists: - - yellowstone/CESM: - -> 4_0 testing: OK. Removed tests in xFail file and ignoring NLComp tests. Remaining Fails (tputcomp and memcomp) will be ignored since test tolerences are too narrow. - - -> 4_5 testing: OK. There will be B4B differences due to a new SoilHydrologyMod which are listed below - - FAILs due to new SoilHydroMod and r2x_Slrr_volr in coupler - - FAIL SMS_RLA.f45_f45.ICLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL ERS_D.f10_f10.ICLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL NCK.f10_f10.ICLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL ERB.ne30_g16.I_1948-2004_CLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL ERH_D.f19_g16.I1850CLM45CN.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL SMS.1x1_mexicocityMEX.I1PTCLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - FAIL ERS_Lm3.1x1_vancouverCAN.I1PTCLM45.yellowstone_intel.GC.161028.compare_hist.clm4_0_60 - - yellowstone/CESM/allIcompsets: OK - - test_system testing: - - yellowstone batch: - OK. FAILs due to new SoilHydroMod and r2x_Slrr_volr in coupler - - FAIL ERS.f19_g16.I_1850_CLM45_CN4Me.user_nl_dirs.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_D.f19_g16.I_1850_CLM45_CNCENTNoMe.user_nl_dirs.GC.114029.compare_hist.clm4_0_60 - FAIL ERS.f19_g16.I_2000_CLM45_CN4Me_CROP.user_nl_dirs.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ld211.f10_f10.ICLM45CNADSPIN.monthly.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ln48_D_P64x1.ne30_g16.ICLM45CN.user_nl_dirs.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ld211_D_P224x1.f10_f10.ICLM45CNCROP.crop.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ld211_P384x1.f19_g16.ICLM45CNDVCROP.crop.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ld211.f10_f10.I_2000_CLM45_VOC_CN.voc.GC.114029.compare_hist.clm4_0_60 - FAIL ERS_Ln48_D.f10_f10.I_2000_CLM45_CN.ciso.GC.114029.compare_hist.clm4_0_60 - - frankfurt interactive: - OK. FAILs due to new SoilHydroMod and r2x_Slrr_volr in coupler - - FAIL SMS_D_Mmpi-serial.1x1_vancouverCAN.ICLM451PT.frankfurt_intel_user_nl_dirs.GC.104908.compare_hist.clm4_0_60 - FAIL ERS_Mmpi-serial.1x1_mexicocityMEX.ICLM451PT.frankfurt_intel_user_nl_dirs.GC.104908.compare_hist.clm4_0_60 - - yellowstone interactive: - OK. FAILs due to new SoilHydroMod and r2x_Slrr_volr in coupler - - FAIL ERS_D_Mmpi-serial.CLM_USRDAT.ICLM45alaskaCN.yellowstone_intel_user_nl_dirs.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_D_Mmpi-serial.CLM_USRDAT.ICLM45USUMB.yellowstone_intel_user_nl_dirs.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_D_P1x1_Mmpi-serial.f19_g16.I20TR_CLM45VSCN.yellowstone_intel_voc.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_D_P1x1_Mmpi-serial.5x5_amazon.I_2000_CLM45.yellowstone_intel_user_nl_dirs.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_Ln48_D_P1x1_Mmpi-serial.f45_g37.ICLM45VOC.yellowstone_intel_voc.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000_CLM45.yellowstone_intel_monthly.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_Ld211_Mmpi-serial.1x1_brazil.I_2000_CLM45_CN.yellowstone_intel_monthly.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000_CLM45_CNDV.yellowstone_intel_monthly.GC.114053.compare_hist.clm4_0_60 - FAIL ERS_Ld211_Mmpi-serial.1x1_brazil.IVSCN.yellowstone_intel_voc.GC.114053.compare_hist.clm4_0_60 - - frankfurt batch: - OK. FAILs due to new SoilHydroMod and r2x_Slrr_volr in coupler - - FAIL ERS_D_P16x1.f19_g16.I_1850_CLM45_CN4Me.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL ERI_P16x1.f19_g16.I_1850_CLM45_CNCENTNoMe.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL ERS_Ld211_P16x1.f10_f10.ICLM45CNADSPIN.frankfurt_intel_monthly.GC.104516.compare_hist.clm4_0_60 - FAIL ERS_P16x1.f19_g16.I_1850_CLM45_CN4Me_LessSPIN.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL SMS_D_P16x1.f19_g16.I_1850_CLM45_CN4Me_EXLessSPIN.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL SMS_D_P16x1.f10_f10.I_2000_CLM45_CN4Me.frankfurt_intel_vrtlay.GC.104516.compare_hist.clm4_0_60 - FAIL ERS_D_P16x1.f19_g16.I_2000_CLM45_CN.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL ERI_P16x1.f19_g16.I_2000_CLM45_CN.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - FAIL SMS_D_P16x1.f19_g16.ICLM45CNEXSPIN.frankfurt_intel_user_nl_dirs.GC.104516.compare_hist.clm4_0_60 - -CLM tag used for the baseline comparison tests if applicable: CLM4_0_60 - -Changes answers relative to baseline: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: 4_5 code - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - 1) SoilHydrologyMod.F90 mods from Swenson effect soil moisture which are effecting certain l2x coupler fields - 2) bringing VOLR from RTM through the coupler adds one more field to coupler history files. - -=============================================================== -=============================================================== -Tag name: clm4_0_60 -Originator(s): erik (Erik Kluzek) -Date: Mon Feb 11 03:55:56 MST 2013 -One-line Summary: Bring CLM4.5 code from clm45sci branch to trunk as an option set at configure time - -Purpose of changes: - -Bring in CLM4.5 branch as additional directories. Change directory structure, so there are shared files -and utilities for both CLM4.0 and CLM4.5 and files that are different for each. Update compsets in -scripts in order to work in this paradigm. Move clm45sci15_clm4_0_58 code to trunk under clm4_5 phys. - -clm4.5 includes the following: - -* Bring LBNL-merge branch on with: vertical soil, Methane, CENTURY, split nitrification, new-lake model. -* Modifications to GPP, on gppdev branch, multilayer canopy and then single-layer version that reproduces it. -* Crop model updates. Irrigation included with crop model as an option. Fix CNDV-CROP. -* Urban model updates, multi-density, urban depth seperate from soil depth, wasteheat to zero -* Bring in permafrostsims09 branch with Sean Swensons's flooding changes. -* Update pft-physiology file, change some CN defaults, change min flow slightly in RTM -* Set ponding to zero, acclimation mods from Keith Oleson, a hydrology change from Sean Swenson. - -Requirements for tag: clm40/clm45 code/tools work/tested, answers same, complete move from bluefire to yellowstone - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1621 (normalization issue in mksurfdata_map and clm -- partial) - 1604 (The -co2_type flag in the CLM namelist is not set correct.) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - - Compsets to run CLM4.5 added. - -I_2000_CLM45 (ICLM45) -I_2000_1PTFRC_CLM45 (I1PTCLM45) -I_2000_GLC_CLM45_CISM1 (IGCLM45) -I_2000_GLC_CLM45_CISM2P (IGCLM45IS2) -I_2000_CLM45_CN (ICLM45CN) -I_2000_CLM45_CN_CROP (ICLM45CNCROP) -I_2000_CLM45_CN_4Me (ICLM45CN4Me) -I_2000_CRUFRC_CLM45 (ICRUCLM45) -I_2000_CRUFRC_CLM45_CN (ICRUCLM45CN) -I_2000_CRUFRC_CLM45_CN_4Me (ICRUCLM45CN4Me) -I_2000_CLM45_CN_GLC_CISM1 (IGCLM45CN) -I_1850_CLM45 (I1850CLM45) -I_1850_CLM45_CN_4Me (I1850CLM45CN4Me) -I_1850_CRUFRC_CLM45 (I1850CRUCLM45) -I_1850_CRUFRC_CLM45_CN (I1850CRUCLM45CN) -I_1850_CRUFRC_CLM45_CN_4Me (I1850CRUCLM45CN4Me) -I_1850_CLM45_GLC_CISM1 (IG1850CLM45) -I_1850_CLM45_CN (I1850CLM45CN) -I_1850-2000_CLM45 (I20TRCLM45) -I_1850-2000_CLM45_CN (I20TRCLM45CN) -I_1850-2000_CRUFRCCLM45 (I20TRCRUCLM45) -I_1850-2000_CRUFRC_CLM45_CN (I20TRCRUCLM45CN) -I_1850-2000_CRUFRC_CLM45_CN_4Me (I20TRCRU4MeCLM45) -I_1850-2000_CLM45_GLC_CISM1 (IG20TRCLM45) -I_1850-2000_CLM45_CN_GLC_CISM1 (IG20TRCLM45CN) -I_1948-2004_CLM45 (I4804CLM45) -I_1948-2004_CLM45_GLC_CISM1 (IG4804CLM45) -I_1948-2004_CLM45_CN_GLC_CISM1 (IG4804CLM45CN) -I_RCP8.5_CLM45_CN_GLC_CISM1 (IGRCP85CLM45CN) -I_RCP6.0_CLM45_CN (IRCP60CLM45CN) -I_RCP6.0_CLM45_CN_GLC_CISM1 (IGRCP60CLM45CN) -I_RCP4.5_CLM45_CN (IRCP45CLM45CN) -I_RCP4.5_CLM45_CN_GLC_CISM1 (IGRCP45CNCLM45) -I_RCP2.6_CLM45_CN (IRCP26CLM45CN) -I_RCP2.6_CLM45_CN_GLC_CISM1 (IGRCP26CLM45CN) -I_RCP8.5_CLM45_CN (IRCP85CLM45CN) -I_1850_SPINUP_3HrWx_CLM45_CN_4Me - - CLM configure changes: - - Add physics option to determine if CLM4.0 or CLM4.5 physics is used: -+ -phys Value of clm4_0 or clm4_5 (default is clm4_0) - - Options removed - - -pergro - -c13 - - Options added for CLM4.5 physics: - -+ -clm4me Turn Methane model: [on | off] -+ Requires bgc=cn/cndv (Carbon Nitrogen model) -+ (ONLY valid for CLM4.5!) -+ -exlaklayers Turn on extra lake layers (25 layers instead of 10) [on | off] -+ (ONLY valid for CLM4.5!) -+ -vsoilc_centbgc Turn on vertical soil Carbon profile, CENTURY model decomposition, -+ split Nitrification/de-Nitrification into two mineral -+ pools for NO3 and NH4 (requires clm4me Methane model), and -+ eliminate inconsistent duplicate soil hydraulic -+ parameters used in soil biogeochem. -+ (requires either CN or CNDV) -+ (ONLY valid for CLM4.5!) -+ [on,off or colen delimited list of no options] (default off) -+ no-vert Turn vertical soil Carbon profile off -+ no-cent Turn CENTURY off -+ no-nitrif Turn the Nitrification/denitrification off -+ no-stnd-bsw Turn the standard BSW for soil psi off -+ [no-vert,no-cent,no-nitrif,no-stnd-bsw, -+ no-vert:no-cent,no-nitrif:no-stnd-bsw, -+ no-vert:no-cent:no-stnd-bsw] - - New spinup options added for CLM4.5 physics (but are now deprecated and NOT recommended for use) - -+ Enter-AD Turn on Accelerated Decomposition from (6) -+ existing initial conditions (optional) (deprecated) -+ (ONLY valid for CLM4.5!) -+ AD2Lesser Jump from full AD to lesser AD spinup (optional) (4) -+ (deprecated) (ONLY valid for CLM4.5!) -+ LesserAD Lesser Accelerated Decomposition mode (3) -+ (deprecated) (ONLY valid for CLM4.5!) -+ LesserAD-exit Jump from lesser AD to normal mode (1) -+ (deprecated) (ONLY valid for CLM4.5!) -+ Two sequences are valid: 6-5-4-3-1-0 or 6-5-2-0 (where 6 and 4 are optional) -+ The recommended sequence is 5-2-0 - - - -Describe any changes made to the namelist: - Extensive list of new namelist options for CLM4.5 physics - -List any changes to the defaults for the boundary datasets: - Extensive list of new datasets for CLM4.5 - Add 360x720 grid (hcru_hcru) for CLM4.0 physics - -Describe any substantial timing or memory changes: CLM4.0 -- identical to clm4_0_59 - CLM4.5 -- identical to clm45sci15_clm4_0_58 - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): to cesm1_2_alpha02a versions - - scripts to scripts4_130204 - Machines to Machines_130204 - drv to drvseq4_2_18 - datm to datm8_130130 - rtm to rtm1_0_18 - cism to 45merge_02_cism1_121114 - csm_share to share3_130131 - pio to pio1_6_1 - mapping/gen_domain to mapping_121113b - -List all files eliminated: - -============== Eliminate PERGRO option, remove duplicated tools from clm4_0, change names to include clm4_0 -D models/lnd/clm/test/system/nl_files/mksrfdt_1x1_numaIA_mp20irrcr_2000 -D models/lnd/clm/test/system/nl_files/mksrfdt_10x15_irr_1850 -D models/lnd/clm/tools/mkmapdata/* ---------> remove -D models/lnd/clm/tools/mkprocdata_map/* ----> remove -D models/lnd/clm/tools/ncl_scripts/* -------> remove -D models/lnd/clm/tools/interpinic/* --------> move to under clm4_0 -D models/lnd/clm/tools/mkmapgrids/* --------> remove -D models/lnd/clm/tools/mksurfdata_map/* ----> move to under clm4_0 -D models/lnd/clm/bld/namelist_files/namelist_definition.xml ---> use clm4_5 version -D models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -> move to name with clm4_0 -D models/lnd/clm/bld/namelist_files/use_cases/pergro_pd.xml ---> Remove PERGRO option -D models/lnd/clm/bld/namelist_files/use_cases/pergro0_pd.xml --> Remove PERGRO option -D models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml -> move to name with clm4_0 - -List all files added and what they do: - -============== testing for clm4_5 and change name of some tests to include clm4_0 -A + models/lnd/clm/test/system/config_files/gen_domain -A + models/lnd/clm/test/system/tests_posttag_frankfurt_nompi -A + models/lnd/clm/test/system/user_nl_dirs/anoxia_wtsat -A + models/lnd/clm/test/system/user_nl_dirs/anoxia_wtsat/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/vrtlay -A + models/lnd/clm/test/system/user_nl_dirs/vrtlay/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/oldhyd -A + models/lnd/clm/test/system/user_nl_dirs/oldhyd/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/ch4_set2_ciso -A + models/lnd/clm/test/system/user_nl_dirs/ch4_set2_ciso/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/ch4_set3_pftroot -A + models/lnd/clm/test/system/user_nl_dirs/ch4_set3_pftroot/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/rootlit -A + models/lnd/clm/test/system/user_nl_dirs/rootlit/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/ciso -A + models/lnd/clm/test/system/user_nl_dirs/ciso/user_nl_clm -A + models/lnd/clm/test/system/nl_files/nl_ch4_set2_ciso -A + models/lnd/clm/test/system/nl_files/nl_ch4_set3_pftroot -A + models/lnd/clm/test/system/nl_files/mksrfdt_10x15_1850 -A + models/lnd/clm/test/system/nl_files/nl_rootlit -A + models/lnd/clm/test/system/nl_files/nl_ciso -A + models/lnd/clm/test/system/nl_files/nl_anoxia_wtsat -A + models/lnd/clm/test/system/nl_files/clm4_0_mksrfdt_1x1_numaIA_mp20irrcr_2000 -A + models/lnd/clm/test/system/nl_files/clm4_0_mksrfdt_10x15_irr_1850 -A + models/lnd/clm/test/system/nl_files/mksrfdt_1x1_numaIA_mp24_2000 -A + models/lnd/clm/test/system/nl_files/nl_vrtlay -A + models/lnd/clm/test/system/nl_files/nl_oldhyd -============== clm4_5 version of tools (from clm45sci15_clm4_0_58) -A + models/lnd/clm/tools/clm4_5 -A + models/lnd/clm/tools/clm4_5/mkmapdata -A + models/lnd/clm/tools/clm4_5/mkmapdata/mvNimport.sh -A + models/lnd/clm/tools/clm4_5/mkmapdata/rmdups.ncl -A + models/lnd/clm/tools/clm4_5/mkmapdata/regridbatch.sh -A + models/lnd/clm/tools/clm4_5/mkmapdata/mkmapdata.sh -A + models/lnd/clm/tools/clm4_5/mkmapdata/mkunitymap.ncl -A + models/lnd/clm/tools/clm4_5/mkmapdata/mknoocnmap.pl -A + models/lnd/clm/tools/clm4_5/mkmapdata/README -A + models/lnd/clm/tools/clm4_5/mkprocdata_map -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c121107.nc -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/mkprocdata_map_functions.bash -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/mkprocdata_map.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/gridmapMod.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/constMod.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/Makefile.common -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/fmain.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/shr_file_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/nanMod.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/Mkdepends -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/Srcfiles -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/Filepath -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/Makefile -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/fileutils.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/mkprocdata_map_in -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/mkprocdata_map_all -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/clm -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/mkprocdata_map_wrap -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c121107.nc -A + models/lnd/clm/tools/clm4_5/mkprocdata_map/README -A + models/lnd/clm/tools/clm4_5/ncl_scripts -A + models/lnd/clm/tools/clm4_5/ncl_scripts/cprnc.pl -A + models/lnd/clm/tools/clm4_5/ncl_scripts/getco2_historical.ncl -A + models/lnd/clm/tools/clm4_5/ncl_scripts/cprnc.ncl -A + models/lnd/clm/tools/clm4_5/ncl_scripts/getregional_datasets.pl -A + models/lnd/clm/tools/clm4_5/ncl_scripts/getregional_datasets.ncl -A + models/lnd/clm/tools/clm4_5/ncl_scripts/README -A + models/lnd/clm/tools/clm4_5/interpinic -A + models/lnd/clm/tools/clm4_5/interpinic/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c121113.nc -A + models/lnd/clm/tools/clm4_5/interpinic/interpinic.runoptions -A + models/lnd/clm/tools/clm4_5/interpinic/src -A + models/lnd/clm/tools/clm4_5/interpinic/src/interpinic.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_infnan_mod.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/Makefile.common -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_isnan.c -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_sys_mod.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/fmain.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_log_mod.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/Mkdepends -A + models/lnd/clm/tools/clm4_5/interpinic/src/Srcfiles -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_isnan.h -A + models/lnd/clm/tools/clm4_5/interpinic/src/Filepath -A + models/lnd/clm/tools/clm4_5/interpinic/src/Makefile -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/src/shr_const_mod.F90 -A + models/lnd/clm/tools/clm4_5/interpinic/README -A + models/lnd/clm/tools/clm4_5/mkmapgrids -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/Makefile.common -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/domainMod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/shr_sys_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/shr_file_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/nanMod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/shr_log_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/Mkdepends -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/Srcfiles -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/mkmapgrids.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/Filepath -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/Makefile -A + models/lnd/clm/tools/clm4_5/mkmapgrids/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_5/mkmapgrids/mkmapgrids.namelist -A + models/lnd/clm/tools/clm4_5/mkmapgrids/mkscripgrid.ncl -A + models/lnd/clm/tools/clm4_5/mkmapgrids/mkmapgrids.csh -A + models/lnd/clm/tools/clm4_5/mkmapgrids/README -A + models/lnd/clm/tools/clm4_5/mksurfdata_map -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvarctl.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkncdio.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/clm_varpar.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkutilsMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_file_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_timer_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_log_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkindexmapMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mklaiMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksoilMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/fileutils.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_const_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkharvestMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparCommonMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Makefile -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_string_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkglcmecMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvarpar.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/clm_varctl.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_sys_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvocefMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkdomainMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Filepath -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Makefile.common -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkgridmapMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/nanMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Srcfiles -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Mkdepends -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mklanwatMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_lookup_2d_netcdf.nc -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkncdio.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkutilsMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkindexmapMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Srcfiles -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Filepath -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Makefile -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/README -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkurbanparMod.F90 -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata_map.namelist -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/README -A + models/lnd/clm/tools/clm4_5/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt -============== clm4_0 version of tools -A + models/lnd/clm/tools/clm4_0 -A + models/lnd/clm/tools/clm4_0/interpinic -A + models/lnd/clm/tools/clm4_0/interpinic/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc -A + models/lnd/clm/tools/clm4_0/interpinic/interpinic.runoptions -A + models/lnd/clm/tools/clm4_0/interpinic/src -A + models/lnd/clm/tools/clm4_0/interpinic/src/interpinic.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/src/Makefile.common -A + models/lnd/clm/tools/clm4_0/interpinic/src/shr_sys_mod.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/src/fmain.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/src/shr_log_mod.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/src/Mkdepends -A + models/lnd/clm/tools/clm4_0/interpinic/src/Srcfiles -A + models/lnd/clm/tools/clm4_0/interpinic/src/Filepath -A + models/lnd/clm/tools/clm4_0/interpinic/src/Makefile -A + models/lnd/clm/tools/clm4_0/interpinic/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/src/shr_const_mod.F90 -A + models/lnd/clm/tools/clm4_0/interpinic/README -A + models/lnd/clm/tools/clm4_0/mksurfdata_map -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkvarctl.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkncdio.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/clm_varpar.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkutilsMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_file_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_timer_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_log_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkindexmapMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mklaiMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mksoilMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/fileutils.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_const_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkurbanparDomMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkharvestMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkfileMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkurbanparCommonMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Makefile -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_string_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkglcmecMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkvarpar.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/clm_varctl.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_sys_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkvocefMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkdomainMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Filepath -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mksurfdat.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkurbanparAvgMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/shr_kind_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Makefile.common -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkgridmapMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/nanMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Mkdepends -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Srcfiles -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mklanwatMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkpftMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_lookup_2d_netcdf.nc -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mkncdio.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mkutilsMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mkindexmapMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/Srcfiles -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/Filepath -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/Makefile -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/README -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/unit_testers/test_mkurbanparDomMod.F90 -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata_map.namelist -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/README -A + models/lnd/clm/tools/clm4_0/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt -A + models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0_tools.xml -A + models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -A + models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -A + models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -A + models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -A + models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -============== clm4_5 version of source (from clm45sci15_clm4_0_58) -A + models/lnd/clm/src/clm4_5 -A + models/lnd/clm/src/clm4_5/biogeochem -A + models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNGRespMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/initch4Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/MEGANFactorsMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/ch4RestMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNWoodProductsMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDVLightMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDVEcosystemDynIniMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -A + models/lnd/clm/src/clm4_5/main -A + models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -A + models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -A + models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -A + models/lnd/clm/src/clm4_5/main/dynlandMod.F90 -A + models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -A + models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -A + models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -A + models/lnd/clm/src/clm4_5/main/subgridMod.F90 -A + models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -A + models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -A + models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -A + models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -A + models/lnd/clm/src/clm4_5/main/histFileMod.F90 -A + models/lnd/clm/src/clm4_5/main/pft2colMod.F90 -A + models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -A + models/lnd/clm/src/clm4_5/main/findHistFields.pl -A + models/lnd/clm/src/clm4_5/main/restFileMod.F90 -A + models/lnd/clm/src/clm4_5/main/controlMod.F90 -A + models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -A + models/lnd/clm/src/clm4_5/main/filterMod.F90 -A + models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -A + models/lnd/clm/src/clm4_5/main/clm_driver.F90 -A + models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -A + models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -A + models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -A + models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -A + models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -A + models/lnd/clm/src/clm4_5/main/inicPerpMod.F90 -A + models/lnd/clm/src/clm4_5/main/clmtype.F90 -A + models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -A + models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys -A + models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/QSatMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/FracWetMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SLakeRestMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SLakeCon.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/BandDiagonalMod.F90 -A + models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/tests_posttag_lynx_nompi -M models/lnd/clm/test/system/TCBCFGtools.sh -M models/lnd/clm/test/system/frankfurt.batch -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -M models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -M models/lnd/clm/test/system/TSMncl_tools.sh -M models/lnd/clm/test/system/TBLCFGtools.sh -M models/lnd/clm/test/system/README.testnames -M models/lnd/clm/test/system/tests_posttag_yong -M models/lnd/clm/test/system/yellowstone.interactive -M models/lnd/clm/test/system/TCBtools.sh -M models/lnd/clm/test/system/test_driver.sh -M models/lnd/clm/test/system/shortlist.interactive -M models/lnd/clm/test/system/tests_pretag_yellowstone_nompi -M models/lnd/clm/test/system/bluefire.batch -M models/lnd/clm/test/system/frankfurt.interactive -M models/lnd/clm/test/system/TSMscript_tools.sh -M models/lnd/clm/test/system/tests_posttag_mirage -M models/lnd/clm/test/system/gen_test_table.sh -M models/lnd/clm/test/system/nl_files/gen_domain.ne30.runoptions -M models/lnd/clm/test/system/nl_files/gen_domain.T31.runoptions -M models/lnd/clm/test/system/TOPtools.sh -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/test/system/TSMtools.sh -M models/lnd/clm/test/system/TBLscript_tools.sh -M models/lnd/clm/test/system/yellowstone.batch -M models/lnd/clm/test/system/tests_posttag_nompi_regression -M models/lnd/clm/test/system/lynx.batch -M models/lnd/clm/test/system/TBLtools.sh -M models/lnd/clm/test/system/shortlist.batch -M models/lnd/clm/test/system/TSMCFGtools.sh - -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/queryDefaultNamelist.pl -M models/lnd/clm/bld/config_files/config_definition.xml -M models/lnd/clm/bld/listDefaultNamelist.pl -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/clm.buildnml.csh -M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl - -MM models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -MM models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - -Difference in expected Fails: - - - -- -- -- -- -- -- missing datasets for us20 -- ne16 missing finidat file for 1850 -- ne60 missing finidat file for 1850 -- 1x1_tropicAtl missing finidat file for 1850 -- -- -- - - - -@@ -25,10 +13,17 @@ - - - -+ - -+ missing datasets for us20 -+ ne16 missing finidat file for 1850 -+ ne16 missing finidat file for 1850 -+ ne60 missing finidat file for 1850 -+ ne60 missing finidat file for 1850 -+ 1x1_tropicAtl missing finidat file for 1850 -+ 1x1_tropicAtl missing finidat file for 1850 - - -- missing datasets for wus12 - missing datasets for us20 - ne16 missing finidat file for 1850 - ne60 missing finidat file for 1850 -@@ -38,17 +33,6 @@ - - - -- -- -- -- cprnc showing diffs are not b4b -- problem configuring -- problem configuring -- clm stand-alone can no longer work -- clm stand-alone can no longer work -- -- -- - - - -@@ -62,24 +46,6 @@ - - - -- -- -- -- Ignore. Will be moved to CESM tests. -- Ignore. Will be moved to CESM tests. -- Ignore. Will be moved to CESM tests. -- Ignore. Will be moved to CESM tests. -- Failing for long time. endrun initiated from CNBalanceCheckMod.F90. -- Failing for long time. __cnbalancecheckmod_NMOD_cbalancecheck. -- Failing for long time. Fail because erU61 fails. -- Failing for long time. Fail because erU61 fails. -- Have been failing for a long time . -- Have been failing for a long time. -- Have been failing for a long time. -- Have been failing for a long time. -- -- -- - - - -@@ -93,91 +59,108 @@ - - - -- -- -- Initial simulation fails -- Initial simulation fails -- History files are different -- Initial simulation fails -- Initial simulation fails -- History files are different on restart (known problem - restarting mid-day with _GLC: bug 1557) -- Initial simulation fails -- build error? -- -- - - -- ???? - - - - - - -- ???? - - - - -- Initial simulation fails -- Initial simulation fails case name too - long -- History files are different on restart (known - problem restarting mid-day with _GLC: bug 1557) -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - - - -- -- -- T62 not working -- Dies early with a floating point trap -- -- Baseline comp. test will always fail -- build error? -- -- - - - History files are different on restart (known problem -restarting mid-day with _GLC: bug 1557) - - -+ -+ -+ -+ - - - History files are different on restart (known problem restarting -mid-day with _GLC: bug 1557) -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - -- -+ - - -- -- -+ -+ -+ - missing datasets - missing datasets -- missing datasets -- -- -+ missing datasets -+ missing 0.1 mapping dataset (for RTM at R01) -+ -+ -+ -+ -+ -+ - -+ -+ scripts issue with ocean not threaded -+ Restart difference -+ Soil balance error on restart -+ scripts issue with ocean not threaded -+ -+ scripts issue with ocean not threaded -+ bad compset name -+ surfdata and pftdyn file mismatched -+ Soil balance error on restart -+ scripts issue component not threaded -+ missing finidat file -+ missing finidat file -+ - -- ???? -- ???? -+ problem building with mpi-serial with pgi compiler -+ missing LAPACK symbol dgbsv -+ scripts issue with ocean not threaded -+ Need LAPACK for PGI (dgbsv) -+ Need LAPACK for PGI (dgbsv) -+ Bad compset name: ICNCROP -+ scripts issue with ocean not threaded -+ -+ problem building with mpi-serial with pgi compiler -+ missing LAPACK symbol dgbsv -+ missing LAPACK symbol dgbsv -+ scripts issue with ocean not threaded -+ Need LAPACK for PGI (dgbsv) -+ Need LAPACK for PGI (dgbsv) -+ Bad compset name: ICNCROP -+ scripts issue with ocean not threaded - - - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/CESM: yes - yellowstone/CESM/allIcompsets: yes - - test_system testing: - - yellowstone batch: yes - frankfurt interactive: yes - yellowstone interactive: yes - frankfurt batch: yes - - test_driver.sh tools testing: - - yellowstone interactive: yes - frankfurt interactive: yes - - yellowstone/PTCLM: no (PTCLM still doesn't quite work) - -CLM tag used for the baseline comparison tests if applicable: clm4_0 to clm4_0_59 clm4_5 to clm45sci15_clm4_0_58 - -Changes answers relative to baseline: Yes, for some resolutions for clm4_0 -- because of new default initial condition files in compsets - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - For clm4_0... - New initial conditions for: f09/f19-I_2000, f09/f19-I_1850, f09/f19-I_1850-2000 - f09/f19-I_1948-2004, f09/f19-I_1850_SPINUP_3HrWx - f09/f19-I_RCP - -=============================================================== -=============================================================== -Tag name: clm4_0_59 -Originator(s): mvertens (Mariana Vertenstein) / erik -Date: Thu Dec 20 09:24:16 MST 2012 -One-line Summary: restructure clmtype and all pointer references, new directory structure - -Purpose of changes: - Reststucture trunk directory tree to prepare for incorporation of clm4_5 - Move all cpp-ifdefs to clm_varctl and introduce new logical variables in their place - Restructure clmtype to remove nesting - and also redo all the pointer references - All together the code can then move to having no cpp-ifdefs - -Test level of tag: - std-test - -Bugs fixed (include bugzilla ID): - None - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 147 (mkgriddata can't straddle over Greenwich) - 025 (SCM mode can NOT use a global finidat file) - 017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - 1598 (non-repeatable results when running with CNDV and/or CROP) - - Threading seems to work for all cases where CROP and/or CNDV - is not on - -Describe any changes made to build system: - New directory structure - -Describe any changes made to the namelist: - variables use_c13 and use_c14 added to namelist_definition.xml file - -List any changes to the defaults for the boundary datasets: - No - -Describe any substantial timing or memory changes: - Currently more memory for compsets without CN, etc - less memory - when CN, CNDV, etc are activated. This will be fixed in clm4_0_59. - -Code reviewed by: - self (proposed changes reviewed by Erik, Bill and Stefan) - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - src/biogeochem -> src/clm4_0/biogeochem - src/biogeophys -> src/clm4_0/biogeophys - src/main -> src/clm4_0/main - - -List all files added and what they do: - None - -List all existing files that have been modified, and describe the changes: - - All files in src/clm4_0 have been modified relative to their - original versions to remove the cpp-ifdefs and to adjust pointer - references to new names - - M src/cpl_share/clm_cpl_indices.F90 - M src/cpl_mct/lnd_comp_mct.F90 - M src/cpl_esmf/lnd_comp_esmf.F90 - - M bld/configure - M bld/namelist_files/namelist_definition.xml - M test/system/yellowstone.interactive - M test/system/yellowstone.batch - - Add in 360x720_cruncep datasets (from Erik). - - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl --- correct number of tests - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - -Machines testing ran on: - - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/CESM: yes - yellowstone/CESM/allIcompsets: no - - PTCLM - yellowstone: no - - test_system testing: - - yellowstone batch: yes - yellowstone interactive: no - frankfurt batch: no - frankfurt interactive: yes - - test_driver.sh tools testing: - - yellowstone interactive: no - frankfurt interactive: no - -Difference in expected fails from testing: - -+ Numbers change for build-namelist unit tests - - -- ???? - - - - -- ???? -- ???? -- ???? - -- -- ???? -- - - -CLM tag used for the baseline comparison tests if applicable: - clm4_0_58 - -Changes answers relative to baseline: - no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_58 -Originator(s): erik (Erik Kluzek) -Date: Fri Dec 14 05:13:33 MST 2012 -One-line Summary: Uncomment us20 and wus12 datasets, more testing to: bluefire, yellowstone, frankfurt - -Purpose of changes: - -Uncomment WRF grids in namelist xml files. Fix mkprocdata bug on lynx. - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1601 (mkprocdata seg faults on lynx) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: No - -Describe any changes made to the namelist: No - -List any changes to the defaults for the boundary datasets: Yes - uncomment out wus12 and us20 WRF datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, csm_share - - scripts to: scripts4_121207b - Machines to: Machines_121207 - csm_share to: share3_121204a - -List all files eliminated: None - -List all files added and what they do: Add frankfurt test lists - ->>>>>>>>>>>>>>>> Tests for frankfurt - A models/lnd/clm/test/system/frankfurt.interactive - A models/lnd/clm/test/system/frankfurt.batch - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/test_system - M models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml - - M models/lnd/clm/test/system/bluefire.batch - M models/lnd/clm/test/system/yellowstone.batch - M models/lnd/clm/test/system/nl_files/mkprocdata_ne30_to_f19_I2000 - ->>>>>>>>>>>>>>>> Fix mkprocdata and allow it to run from a different exe directory for testing - M models/lnd/clm/tools/mkprocdata_map/src/mkprocdata_map.F90 - M models/lnd/clm/tools/mkprocdata_map/src/gridmapMod.F90 - M models/lnd/clm/tools/mkprocdata_map/src/fmain.F90 - M models/lnd/clm/tools/mkprocdata_map/src/shr_file_mod.F90 - M models/lnd/clm/tools/mkprocdata_map/src/fileutils.F90 - M models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_all - M models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_wrap - ->>>>>>>>>>>>>>>> Fix bug in unit-tester - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - ->>>>>>>>>>>>>>>> Uncomment WRF files - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - -Machines testing ran on: - - build-namelist unit tester: yes - - CESM test lists: - - bluefire/CESM: yes - bluefire/CESM/allIcompsets: yes - lynx/CESM: no - - bluefire/PTCLM: no - - test_system testing: - - bluefire batch: yes - bluefire interactive: yes - yellowstone batch: yes - yellowstone interactive: yes - frankfurt batch: yes - frankfurt interactive: yes - - test_driver.sh tools testing: - - bluefire interactive: yes - lynx interactive: yes - yellowstone interactive: yes - frankfurt interactive: yes - -Difference in expected fails from testing: - -Index: expectedClmTestFails.xml -=================================================================== ---- expectedClmTestFails.xml (revision 42691) -+++ expectedClmTestFails.xml (working copy) -@@ -5,12 +5,12 @@ - - - -- - - -- ne16 missing finidat file for 1850 -- ne60 missing finidat file for 1850 -- 1x1_tropicAtl missing finidat file for 1850 -+ missing datasets for us20 -+ ne16 missing finidat file for 1850 -+ ne60 missing finidat file for 1850 -+ 1x1_tropicAtl missing finidat file for 1850 - - - -@@ -24,6 +24,17 @@ - - - -+ -+ -+ -+ -+ missing datasets for wus12 -+ missing datasets for us20 -+ ne16 missing finidat file for 1850 -+ ne60 missing finidat file for 1850 -+ 1x1_tropicAtl missing finidat file for 1850 -+ -+ - - - -@@ -101,6 +112,19 @@ - - - -+ -+ -+ ???? -+ ???? -+ -+ -+ -+ -+ Initial simulation fails -+ Initial simulation fails case name too -long -+ History files are different on restart (known -problem restarting mid-day with _GLC: bug 1557) -+ -+ - - - -@@ -118,6 +142,11 @@ - History files are different on restart (known problem -restarting mid-day with _GLC: bug 1557) - - -+ -+ -+ History files are different on restart (known problem restarting -mid-day with _GLC: bug 1557) -+ -+ - - - -@@ -128,6 +157,18 @@ - missing datasets - - -+ -+ -+ ???? -+ ???? -+ ???? -+ ???? -+ ???? -+ -+ -+ ???? -+ -+ - - - - -CLM tag used for the baseline comparison tests if applicable: clm4_0_58 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -=============================================================== -Tag name: clm4_0_57 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Fri Nov 30 14:20:13 MST 2012 -One-line Summary: update trunk with release mods, some rtm fixes - -Purpose of changes: - -CLM: Merge the changes Erik made in the release branch tags to trunk. -RTM: Add effective velocity as a namelist variable. - Change rdirc file. - Add RTM tests to test_system batch CLM tests. - Clean up logic in RtmFloodInit so R01 works without SLOPE and MAX_VOLR. - Change rdirc file to rdirc_0.5x0.5_simyr2000_slpmxvl_c120717.nc which is - correct and contains FLOOD and MAX_VOLR. This fixes an error in choice - of rdirc file from clm4_0_55 / rtm1_0_10 - -Requirements for tag: - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: Changed RTM rdirc file. - -Describe any substantial timing or memory changes: None Known - -Code reviewed by: Erik, Tony, Mariana (in progress) - -List any svn externals directories updated (csm_share, mct, etc.): - - rtm1_0_13 - - scripts4_121127 - - Machines_121126 - - drvseq4_2_13 - - datm8_121123 - - cism1_121114 - -List all files eliminated: - - - Deleted during release tag cleanup -D models/lnd/clm/test/system/TCB.sh -D models/lnd/clm/test/system/tests_pretag_bluefire -D models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh -D models/lnd/clm/test/system/config_files/17p_cndvsc_m -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_m -D models/lnd/clm/test/system/config_files/17p_cndvsc_o -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_o -D models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm -D models/lnd/clm/test/system/config_files/_persc_dh -D models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do -D models/lnd/clm/test/system/config_files/17p_cndvsc_s -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_s -D models/lnd/clm/test/system/config_files/_persc_dm -D models/lnd/clm/test/system/config_files/_persc_do -D models/lnd/clm/test/system/config_files/_scnv_ds -D models/lnd/clm/test/system/config_files/_persc_ds -D models/lnd/clm/test/system/config_files/17p_sc_dh -D models/lnd/clm/test/system/config_files/17p_sc_dm -D models/lnd/clm/test/system/config_files/17p_sc_do -D models/lnd/clm/test/system/config_files/_sc_dh -D models/lnd/clm/test/system/config_files/17p_sc_ds -D models/lnd/clm/test/system/config_files/_sc_dm -D models/lnd/clm/test/system/config_files/21p_cncrpsc_h -D models/lnd/clm/test/system/config_files/17p_cnsc_h -D models/lnd/clm/test/system/config_files/_sc_do -D models/lnd/clm/test/system/config_files/21p_cncrpsc_dh -D models/lnd/clm/test/system/config_files/17p_cnsc_dh -D models/lnd/clm/test/system/config_files/21p_cncrpsc_m -D models/lnd/clm/test/system/config_files/17p_cnsc_m -D models/lnd/clm/test/system/config_files/_sc_ds -D models/lnd/clm/test/system/config_files/21p_cncrpsc_o -D models/lnd/clm/test/system/config_files/17p_cnsc_o -D models/lnd/clm/test/system/config_files/17p_cnsc_dm -D models/lnd/clm/test/system/config_files/21p_cncrpsc_dm -D models/lnd/clm/test/system/config_files/17p_cnsc_do -D models/lnd/clm/test/system/config_files/17p_cnc13sc_dh -D models/lnd/clm/test/system/config_files/21p_cncrpsc_do -D models/lnd/clm/test/system/config_files/21p_cncrpsc_s -D models/lnd/clm/test/system/config_files/17p_sc_h -D models/lnd/clm/test/system/config_files/17p_cnsc_ds -D models/lnd/clm/test/system/config_files/21p_cncrpsc_ds -D models/lnd/clm/test/system/config_files/17p_cnc13sc_dm -D models/lnd/clm/test/system/config_files/_mexsc_ds -D models/lnd/clm/test/system/config_files/17p_cnc13sc_do -D models/lnd/clm/test/system/config_files/17p_sc_m -D models/lnd/clm/test/system/config_files/17p_sc_o -D models/lnd/clm/test/system/config_files/_sc_h -D models/lnd/clm/test/system/config_files/17p_cnnfsc_dh -D models/lnd/clm/test/system/config_files/_sc_m -D models/lnd/clm/test/system/config_files/17p_cnnfsc_dm -D models/lnd/clm/test/system/config_files/_sc_o -D models/lnd/clm/test/system/config_files/17p_cndvsc_dh -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dh -D models/lnd/clm/test/system/config_files/17p_cnnfsc_do -D models/lnd/clm/test/system/config_files/_sc_s -D models/lnd/clm/test/system/config_files/17p_cndvsc_dm -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dm -D models/lnd/clm/test/system/config_files/17p_cndvsc_do -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_do -D models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_ds -D models/lnd/clm/test/system/config_files/_vansc_ds -D models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm -D models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do -D models/lnd/clm/test/system/config_files/_nil3sc_dh -D models/lnd/clm/test/system/config_files/_nil3sc_dm -D models/lnd/clm/test/system/config_files/_scsnf_dh -D models/lnd/clm/test/system/config_files/_scsnf_dm -D models/lnd/clm/test/system/config_files/_scsnf_do -D models/lnd/clm/test/system/config_files/21p_cndvcrpsc_h -D models/lnd/clm/test/system/config_files/17p_cndvsc_h -D models/lnd/clm/test/system/TBL.sh -D models/lnd/clm/test/system/tests_pretag_edinburgh -D models/lnd/clm/test/system/tests_pretag_edinburgh_nompi -D models/lnd/clm/test/system/TBR.sh -D models/lnd/clm/test/system/TER.sh -D models/lnd/clm/test/system/mknamelist -D models/lnd/clm/test/system/tests_posttag_hybrid_regression -D models/lnd/clm/test/system/tests_posttag_purempi_regression -D models/lnd/clm/test/system/TRP.sh -D models/lnd/clm/test/system/tests_pretag_jaguarpf -D models/lnd/clm/test/system/TSMrst_tools.sh -D models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi -D models/lnd/clm/test/system/nl_files/nl_per -D models/lnd/clm/test/system/nl_files/nl_voc -D models/lnd/clm/test/system/nl_files/clm_std -D models/lnd/clm/test/system/nl_files/multi_inst -D models/lnd/clm/test/system/nl_files/multi_inst/multi_inst -D models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_1 -D models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_2 -D models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_3 -D models/lnd/clm/test/system/nl_files/clm_nortm -D models/lnd/clm/test/system/nl_files/clm_transient_rcp2.6 -D models/lnd/clm/test/system/nl_files/clm_ndepdyn -D models/lnd/clm/test/system/nl_files/clm_transient_rcp4.5 -D models/lnd/clm/test/system/nl_files/clm_pftdyn -D models/lnd/clm/test/system/nl_files/clm_transient_rcp8.5 -D models/lnd/clm/test/system/nl_files/clm_per0 -D models/lnd/clm/test/system/nl_files/nl_ptsmode_ocn -D models/lnd/clm/test/system/nl_files/nl_urb_br -D models/lnd/clm/test/system/nl_files/clm_spin -D models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp6 -D models/lnd/clm/test/system/nl_files/clm_urb1pt -D models/lnd/clm/test/system/nl_files/nl_urb -D models/lnd/clm/test/system/nl_files/nl_crcrop -D models/lnd/clm/test/system/nl_files/clm_per -D models/lnd/clm/test/system/nl_files/clm_drydep -D models/lnd/clm/test/system/nl_files/nl_std -D models/lnd/clm/test/system/nl_files/clm_glcmec -D models/lnd/clm/test/system/nl_files/clm_transient_rcp6 -D models/lnd/clm/test/system/nl_files/nl_crop -D models/lnd/clm/test/system/nl_files/clm_usrdat -D models/lnd/clm/test/system/nl_files/nl_cn_conly -D models/lnd/clm/test/system/nl_files/clm_stdIgnYr -D models/lnd/clm/test/system/nl_files/clm_transient_20thC -D models/lnd/clm/test/system/nl_files/nl_ptsmode -D models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp2.6 -D models/lnd/clm/test/system/nl_files/clm_irrig -D models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp4.5 -D models/lnd/clm/test/system/nl_files/nl_lfiles -D models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp8.5 -D models/lnd/clm/test/system/TSMpergro.sh -D models/lnd/clm/test/system/TSMcnspinup.sh -D models/lnd/clm/test/system/TBLrst_tools.sh -D models/lnd/clm/test/system/CLM_runcmnd.sh -D models/lnd/clm/test/system/TSM.sh -D models/lnd/clm/test/system/tests_posttag_lynx -D models/lnd/clm/tools/mkprocdata_map/camhomme -D models/lnd/clm/tools/mkprocdata_map/camhomme/src -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/mkprocdata_map.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/gridmapMod.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/Depends -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/domainMod.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/shr_file_mod.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/nanMod.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/Srcfiles -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/Filepath -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/Makefile -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/fileutils.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/src/shr_kind_mod.F90 -D models/lnd/clm/tools/mkprocdata_map/camhomme/mkprocdata_map_in -D models/lnd/clm/tools/mkprocdata_map/clm/src -D models/lnd/clm/tools/mkprocdata_map/clm/src/mkprocdata_map.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/gridmapMod.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/constMod.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/fmain.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/shr_file_mod.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/nanMod.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/Mkdepends -D models/lnd/clm/tools/mkprocdata_map/clm/src/Srcfiles -D models/lnd/clm/tools/mkprocdata_map/clm/src/Filepath -D models/lnd/clm/tools/mkprocdata_map/clm/src/Makefile -D models/lnd/clm/tools/mkprocdata_map/clm/src/fileutils.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/src/shr_kind_mod.F90 -D models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_in -D models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_all -D models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_wrap -D models/lnd/clm/tools/mkprocdata_map/clm/README -D models/lnd/clm/tools/ncl_scripts/RMSbluefire.dat -D models/lnd/clm/tools/ncl_scripts/RMSlahey.dat -D models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl -D models/lnd/clm/tools/ncl_scripts/RMSjaguar.dat -D models/lnd/clm/tools/ncl_scripts/RMSintel.dat -D models/lnd/clm/tools/ncl_scripts/RMSintrepid.dat -D models/lnd/clm/tools/ncl_scripts/pergroPlot.ncl -D models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl -D models/lnd/clm/tools/ncl_scripts/runDepositionRegrid.pl -D models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl -D models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl -D models/lnd/clm/bld/config_files/config_sys_defaults.xml -D models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl -D models/lnd/clm/bld/namelist_files/datm-build-namelist -D models/lnd/clm/bld/namelist_files/checklatsfiles.ncl -D models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml -D models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml - -List all files added and what they do: - - - Added for RTM testing -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOn/user_nl_rtm -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOn -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmR01/user_nl_rtm -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmR01 -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOff/user_nl_rtm -A models/lnd/clm/test/system/user_nl_dirs/rtm/rtmOff -A models/lnd/clm/test/system/user_nl_dirs/rtm - - Added from release tags -A models/lnd/clm/test/system/yellowstone.interactive -A models/lnd/clm/test/system/tests_pretag_yellowstone_nompi -A models/lnd/clm/test/system/nl_files/mkprocdata_ne30_to_f19_I2000 -A models/lnd/clm/test/system/yellowstone.batch -A models/lnd/clm/tools/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c121107.nc -A models/lnd/clm/tools/mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc -A models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_functions.bash -A models/lnd/clm/tools/mkprocdata_map/src/mkprocdata_map.F90 -A models/lnd/clm/tools/mkprocdata_map/src/gridmapMod.F90 -A models/lnd/clm/tools/mkprocdata_map/src/constMod.F90 -A models/lnd/clm/tools/mkprocdata_map/src/Makefile.common -A models/lnd/clm/tools/mkprocdata_map/src/fmain.F90 -A models/lnd/clm/tools/mkprocdata_map/src/shr_file_mod.F90 -A models/lnd/clm/tools/mkprocdata_map/src/nanMod.F90 -A models/lnd/clm/tools/mkprocdata_map/src/Mkdepends -A models/lnd/clm/tools/mkprocdata_map/src/Srcfiles -A models/lnd/clm/tools/mkprocdata_map/src/Filepath -A models/lnd/clm/tools/mkprocdata_map/src/Makefile -A models/lnd/clm/tools/mkprocdata_map/src/fileutils.F90 -A models/lnd/clm/tools/mkprocdata_map/src/shr_kind_mod.F90 -A models/lnd/clm/tools/mkprocdata_map/src -A models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_in -A models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_all -A models/lnd/clm/tools/mkprocdata_map/mkprocdata_map_wrap -A models/lnd/clm/tools/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c121107.nc -A models/lnd/clm/tools/mkprocdata_map/README -A models/lnd/clm/bld/config_query -A models/lnd/clm/doc/UsersGuide/modelnl/xmldef2html_compsets -A models/lnd/clm/doc/UsersGuide/modelnl/showinfo.js -A models/lnd/clm/doc/UsersGuide/modelnl/index.cpp -A models/lnd/clm/doc/UsersGuide/modelnl/Makefile -A models/lnd/clm/doc/UsersGuide/modelnl - -List all existing files that have been modified, and describe the changes: - - - put back qflx_snomelt for consistency with older models. clm4_0_55 mods to the snow - balance check otherwise only effect the diagnostic fields errh2osno, snow_source and snow_sinks -M models/lnd/clm/src/main/histFldsMod.F90 - - modified for RTM testing -M config_files/config_CLMtestCompsets.xml -M bluefire.batch - - modified during release tag modification -M models/lnd/clm/test/system/tests_posttag_lynx_nompi -M models/lnd/clm/test/system/mirage.interactive -M models/lnd/clm/test/system/test_system -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -M models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -M models/lnd/clm/test/system/config_files/README -M models/lnd/clm/test/system/README.testnames -M models/lnd/clm/test/system/tests_posttag_yong -M models/lnd/clm/test/system/TCBtools.sh -M models/lnd/clm/test/system/test_driver.sh -M models/lnd/clm/test/system/lynx.interactive -M models/lnd/clm/test/system/shortlist.interactive -M models/lnd/clm/test/system/TSMscript_tools.sh -M models/lnd/clm/test/system/tests_posttag_mirage -M models/lnd/clm/test/system/gen_test_table.sh -M models/lnd/clm/test/system/input_tests_master -M models/lnd/clm/test/system/README -M models/lnd/clm/test/system/tests_posttag_nompi_regression -M models/lnd/clm/test/system/bluefire.interactive -M models/lnd/clm/tools/mkmapdata/mkmapdata.sh -M models/lnd/clm/tools/ncl_scripts -M models/lnd/clm/tools/ncl_scripts/README -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl -M models/lnd/clm/tools/interpinic -M models/lnd/clm/tools/mksurfdata_map/src -M models/lnd/clm/tools/mksurfdata_map/src/mkncdio.F90 -M models/lnd/clm/tools/mksurfdata_map/src/mkutilsMod.F90 -M models/lnd/clm/tools/mksurfdata_map/src/mkdomainMod.F90 -M models/lnd/clm/tools/mksurfdata_map/src/mksurfdat.F90 -M models/lnd/clm/tools/mksurfdata_map/src/mkgridmapMod.F90 -M models/lnd/clm/tools/mksurfdata_map/mksurfdata_map.namelist -M models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl -M models/lnd/clm/tools/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt -M models/lnd/clm/bld -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/queryDefaultNamelist.pl -M models/lnd/clm/bld/user_nl_clm -M models/lnd/clm/bld/config_files/config_definition.xsl -M models/lnd/clm/bld/config_files/config_definition.xml -M models/lnd/clm/bld/listDefaultNamelist.pl -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/clm.cpl7.template -M models/lnd/clm/bld/clm.buildnml.csh -M models/lnd/clm/bld/README -M models/lnd/clm/bld/namelist_files/namelist_definition.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl -M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml -M models/lnd/clm/doc/UsersGuide/clm_ug.xml -M models/lnd/clm/doc/UsersGuide/appendix.xml -M models/lnd/clm/doc/UsersGuide/ptclm.xml -M models/lnd/clm/doc/Quickstart.userdatasets -M models/lnd/clm/doc/IMPORTANT_NOTES -M models/lnd/clm/doc/Quickstart.GUIDE -M models/lnd/clm/doc/ChangeLog -M models/lnd/clm/doc/CodeReference/Filepath -M models/lnd/clm/doc/KnownLimitations -M models/lnd/clm/doc/ChangeSum -M models/lnd/clm/doc/KnownBugs -M models/lnd/clm/doc/README -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 -M ChangeLog -M ChangeSum -M READM - -Machines testing ran on: (in progress) - - build-namelist unit tester: yes - - - OK. All FAILs (~78 of them) should pass during the next round. - - CESM test lists: - - bluefire/CESM: yes - - -Fail due to throuput comparison problems: - - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.GC.164220.tputcomp.clm4_0_56 - FAIL ERS_Lm3.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.164220.tputcomp.clm4_0_56 - - -Fail due to new and correct rdirc file. diffs in r2x_Forr_roff & r2x_Forr_ioff - These should pass next time around: - - FAIL ERS_D.f45_g37.I.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL NCK.T31_g37.I.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL PET_PT.f45_g37.I1850.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERI.T31_g37.IG1850.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL SMS.T31_g37.IG4804.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL SMS.1x1_mexicocityMEX.I1PT.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERS_Lm3.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.GC.164220.compare_hist.clm4_0_56 - - bluefire/CESM/allIcompsets: yes - - Error in SBN script handling in generate of namelist files so all compare tests are BFAILs. - - lynx/CESM: no - - bluefire/PTCLM: no - - test_system testing: - - bluefire batch: yes - - 4 xFAIL. The rest that fail now, but should pass the next time around. - - - Fail due to new and correct rdirc file. diffs in r2x_Forr_roff & r2x_Forr_ioff - These should pass next time around: - - FAIL ERS_Ld211.f10_f10.ICNADSPIN.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - FAIL ERS_Ln48_D_P64x16.ne30_g16.ICN.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - FAIL PET_D_P1x64.ne30_g16.ICN.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - FAIL ERS_Ld211.f10_f10.I_2000_VOC_CN.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - - - Fail due to throughput comparison - - FAIL ERS_Ld211.f10_f10.ICNADSPIN.bluefire_ibm.GC.164759.tputcomp.clm4_0_56 - FAIL ERS_Ld211_P192x2.f19_g16.I_2000_CNDV_CROP.bluefire_ibm.GC.164759.tputcomp.clm4_0_56 - - - Will pass next time, these tests just introduced - - BFAIL ERS.f19_g16.I_2000_CN_rtmR01.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - BFAIL ERS.f19_g16.I_2000_CN_rtmOff.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - BFAIL ERS.f19_g16.I_2000_CN_rtmOn.bluefire_ibm.GC.164759.compare_hist.clm4_0_56 - - bluefire interactive: yes - - - xFAIL or new tests that will pass next time (missing baselines): - - BFAIL ERS_D_Mmpi-serial.CLM_USRDAT.IalaskaCN.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_D_Mmpi-serial.CLM_USRDAT.I_2000_1PTFRC_US-UMB.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_P1x64_Mmpi-serial.f45_g37.I_1850_SPINUP_3HrWx_CN.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ld211_Mmpi-serial.1x1_camdenNJ.I_2000_VOC.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_D_P1x25_Mmpi-serial.5x5_amazon.I_2000.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_D_Mmpi-serial.1x1_asphaltjungleNJ.I_2000_VOC.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ld211_Mmpi-serial.1x1_brazil.I_2000_CN.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ln48_D_P1x64_Mmpi-serial.f19_g16.I_2000_GLCMECPD.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ly3_Mmpi-serial.1x1_brazil.I_2000_CNDV.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - BFAIL ERS_Ld211_Mmpi-serial.1x1_brazil.I_2000_VOC_SNCRFRC_CN.bluefire_ibm.GC.164744.compare_hist.clm4_0_56 - - lynx/pgi batch: yes - - - xFAIL or will pass next time (new rdirc file effecting r2x_Forr_roff & r2x_Forr_ioff) - - FAIL ERS_Ln48_D.f45_g37.I_2000_VOC.lynx_pgi.GC.170117.compare_hist.clm4_0_56 - FAIL ERS_Ln48_D.f10_f10.I_2000_CN.lynx_pgi.GC.170117.compare_hist.clm4_0_56 - - lynx/pgi interactive: yes - - - OK except for new test that will pass next time (missing baselines): - - BFAIL SMS_RLA_Mmpi-serial.f45_f45.I.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL SMS_Mmpi-serial.CLM_USRDAT.I_2000_1PTFRC_US-UMB.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL ERS_Ld211_Mmpi-serial.1x1_brazil.I_2000.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL ERS_Ln48_D_P1x12_Mmpi-serial.f10_f10.ICNCROP.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL ERS_Ld211_Mmpi-serial.1x1_camdenNJ.I_2000_VOC.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL SMS_D_Mmpi-serial.1x1_vancouverCAN.I1PT.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - BFAIL ERS_Mmpi-serial.1x1_mexicocityMEX.I1PT.lynx_pgi.GC.170039.compare_hist.clm4_0_56 - - lyn/intel mirage testlist: yes - - - OK except for new tests will pass next time (missing baselines): - - BFAIL ERS_Mmpi-serial.1x1_brazil.I_2000.lynx_intel.GC.095009.compare_hist.clm4_0_56 - BFAIL ERI_D_Mmpi-serial.1x1_camdenNJ.I_2000_VOC.lynx_intel.GC.095009.compare_hist.clm4_0_56 - BFAIL ERS_D_Mmpi-serial.1x1_asphaltjungleNJ.I_2000_VOC.lynx_intel.GC.095009.compare_hist.clm4_0_56 - BFAIL ERS_Ln48_D_P1x12_Mmpi-serial.f10_f10.I_2000_CN.lynx_intel.GC.095009.compare_hist.clm4_0_56 - - test_driver.sh tools testing: - - bluefire interactive: yes - - test 001 fails due to a bug in mkprocdata_map_wrap - test 002 fails due to 001 - test 008 will pass next time - - lynx interactive: no - -CLM tag used for the baseline comparison tests if applicable: - -Changes answers relative to baseline: - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: modification to default value for effvel in RtmMod.F90 - changes the values of r2x_Forr_roff & r2x_Forr_ioff. This causes cprnc to fail. - This should pass in the next round and matches the value found in CLM4.5. - - - real(r8),parameter :: effvel(nt_rtm) = 0.7_r8 ! downstream velocity (m/s) - + real(r8),parameter :: effvel(nt_rtm) = 1.0_r8 ! downstream velocity (m/s) - - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - with flooding on and new rdirc file, climate may be different. - with flooding off we have b4b - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm4_0_56 -Originator(s): sacks (Sacks Bill 303-497-1762 CGD) -Date: Tue Nov 27 14:12:42 MST 2012 -One-line Summary: fix s2x tsrf, add s2x diagnostics - -Purpose of changes: - -The s2x tsrf field was not being time-averaged; this is fixed now. - -Also, add history fields giving per-column diagnostics of the fields sent -from CLM to GLC. - -Requirements for tag: - fix bug 1590 - test on bluefire (CESM, int, bat), lynx/pgi (int,bat), mirage-test for lynx_intel - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): 1590 (surface temperature sent from CLM to GLC not averaged properly) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>> Do time-averaging of tsrf field; remove calls to create_clm_s2x -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - ->>>>>>> Call to create_clm_s2x now done here instead of lnd_comp_mct / ->>>>>>> lnd_comp_esmf, so that clm_s2x can be used for hist file writes ->>>>>>> (this is needed so that the fields are updated before the history ->>>>>>> updates happen in the driver) -M models/lnd/clm/src/main/clm_initializeMod.F90 -M models/lnd/clm/src/main/clm_driver.F90 - ->>>>>>> Clean up interface to create_clm_s2x -M models/lnd/clm/src/main/clm_glclnd.F90 - ->>>>>>> Add capability to output fields sent from CLM to GLC -M models/lnd/clm/src/main/histFileMod.F90 -M models/lnd/clm/src/main/histFldsMod.F90 - ->>>>>>> Remove non-existent PMT test -M models/lnd/clm/test/system/lynx.batch - ->>>>>>> Add ERS_Ln48_P96x2.f19_g16.I_2000_VOC_SNCRFRC_CN_GLCMECPD to xFail ->>>>>>> list; add comment -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -Machines testing ran on: - - build-namelist unit tester: no - - CESM test lists: - - bluefire/CESM: yes - All PASS except: - FAIL ERI.T31_g37.IG1850.bluefire_ibm.GC.101712.compare_hist.clm4_0_55 - FAIL SMS.T31_g37.IG4804.bluefire_ibm.GC.101712.compare_hist.clm4_0_55 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.GC.101712.compare_hist.clm4_0_55 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.bluefire_ibm.GC.101712.compare_hist.clm4_0_55 - - These are expected failures: diffs in topo and tsrf fields - sent to coupler, and topo diffs are small (RMS ~ 1e-13) - - bluefire/CESM/allIcompsets: no - lynx/CESM: no - - bluefire/PTCLM: no - - test_system testing: - - bluefire batch: yes - All PASS or xFAIL except: - FAIL ERS_Ld211_P192x2.f19_g16.I_2000_CNDV_CROP.bluefire_ibm.GC.101753.compare_hist.clm4_0_55 - - I believe this is an old problem, not due to the changes here: see bug 1598 - - bluefire interactive: yes - All PASS or xFAIL - - lynx/pgi batch: yes - All PASS or xFAIL - - lynx/pgi interactive: yes - All PASS - - lyn/intel mirage testlist: yes - All PASS - - test_driver.sh tools testing: - - bluefire interactive: no - lynx interactive: no - -CLM tag used for the baseline comparison tests if applicable: clm4_0_55 - -Difference in expected fails from testing: - - Note: the additional expected fail is NOT a new failure, it is just newly - documented - - --- models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (.../trunk_tags/clm4_0_55) (revision 42229) - +++ models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (.../branches/fix_glc_tsrf) (revision 42229) - @@ -90,7 +90,7 @@ - - - Initial simulation fails - - History files are different on restart - + History files are different on restart (known problem restarting mid-day with _GLC: bug 1557) - Initial simulation fails - build error? - - @@ -113,6 +113,9 @@ - - - - + - + History files are different on restart (known problem restarting mid-day with _GLC: bug 1557) - + - - - - -Changes answers relative to baseline: YES: changes tsrf and topo fields -sent to GLC (everything else bfb) - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: glc_mec - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - new climate for tsrf; roundoff-level for topo field sent to GLC. Note that these - fields are limited to GLC, and don't feed back to the atmosphere at all. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? For topo: examined differences in cprnc output - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: None done - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_0_55 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Thu Nov 15 10:17:23 MST 2012 -One-line Summary: bring in flooding capability - -Purpose of changes: - - Test driver mods from Tony that allows flooding from rof to lnd. Also - brought in code from the rtmflood branch to handle the new flooding values. - Fthresh calculed by reading SLOPE and MAX_VOLR from the rdirc file. Merged - in qflx_snow_melt from Swensons perfmafrost sims branch to fix snow - balance problems in BalanceCheckMod.F90. - -Requirements for tag: - - Test flooding code in CLM by varying fthresh. Test coupler mods by - plotting coupler fields. Look at differences in overall energy balance - with and without flooding. - -Test level of tag: doc, critical, standard, std-test, reg-test - - Critical. Bluefire CESM/CLM tests and namelist tests only - -Bugs fixed (include bugzilla ID): - - N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - - N/A - -Describe any changes made to the namelist: - - N/A - -List any changes to the defaults for the boundary datasets: - - N/A - -Describe any substantial timing or memory changes: - - N/A - -Code reviewed by: - - Tony Craig, Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): - - Updated all of the following (in relation to clm4_0_54) - scripts4_121105 - Machines_121106 - drvseq4_2_11 - rtm1_0_10 - cism1_121012 - share3_121025 - pio1_5_7 - mapping_121106 - -List all files eliminated: - - N/A - -List all files added and what they do: - - N/A - -List all existing files that have been modified, and describe the changes: - - -the following all for bringing in qflx_snow_melt for new - -balance check calculation with flooding - M models/lnd/clm/src/main/clmtypeInitMod.F90 - M models/lnd/clm/src/main/histFldsMod.F90 - M models/lnd/clm/src/main/mkarbinitMod.F90 - M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 - M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 - M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 - - - mods to bring in flooding from rtmflood - M main/clm_driver.F90 - M main/cmlmtype.F90 - M main/clmtypeInitMod.F90 - M main/histFldsMod.F90 - M main/mkarbinitMod.F90 - M main/clm_varcon.F90 - - - fixes for some test problems - M build-namelist_test.pl - M clm/bld/configure - -Machines testing ran on: - - build-namelist unit tester: yes - - 6 xFails - all OK. - - CESM test lists: - - bluefire/CESM: yes - - Fail due to new coupler fields: - - new field r2x_Forr_roff - - NCK.T31_g37.I.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERS_E.T31_g37.I1850.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERI.T31_g37.IG1850.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERH_D.T31_g37.I1850CN.bluefire_ibm.GC.165350.compare_hist.clm4_0_54 - SMS.T31_g37.IG4804.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.GC.165350.compare_hist.clm4_0_54 - - new fields r2x_Forr_roff & r2x_Forr_ioff - - ERS_D.f45_g37.I.bluefire_ibm.GC.165350.compare_hist.clm4_0_54 - PET_PT.f45_g37.I1850.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERB.ne30_g16.I_1948-2004.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERS_Lm3.f19_g16.IGRCP60CN.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - PET_PT.f10_f10.I20TRCN.bluefire_ibm.GC.165350.compare_hist.clm4_0_54 - SMS.f10_f10.IRCP45CN.bluefire_ibm.C.092829.compare_hist.clm4_0_54 - ERS_D.f19_g16.IRCP85CN.bluefire_ibm.GC.165350.compare_hist.clm4_0_54 - - Fail due to throughput differences: - - FAIL ERS_D.f45_g37.I.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERI.T31_g37.IG1850.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL SMS.T31_g37.IG4804.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERS_Lm3.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERS_Lm3.f19_g16.IGRCP60CN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.GC.165350.tputcomp.clm4_0_54 - - bluefire/CESM/allIcompsets: no - lynx/CESM: no - - bluefire/PTCLM: no - - test_system testing: - - bluefire batch: no - bluefire interactive: no - lynx/pgi batch: no - lynx/pgi interactive: no - lyn/intel mirage testlist: no - - test_driver.sh tools testing: - - bluefire interactive: no - lynx interactive: no - -CLM tag used for the baseline comparison tests if applicable: - - us20/wus12 tests were removed so removed from expected fail - ne16/ne60/1x1_tropicAtl 20thC transient tests fails -- need finidat files - New bug: ERS_Ln48_D_P1x64.f19_g16.I_2000_GLCMECPD (bugzilla 1557) - New testname: ERS_Ln48_D_P1x64.f45_g37.I_2000_VOC (was ERS48s_...) - New fail: ERS_Ld211.1x1_camdenNJ.I_2000_VOC, ERS_Ld211_D_P112x2.f10_f10.ICNCROP - Some ERS_L tests now pass that failed previously - I1PT tests pass now - Most SBN tests pass now - Intel single point tests pass now -@@ -5,14 +5,11 @@ - - - -- us20 not fully implmented -- us20 not fully implmented -- wus12 not fully implmented -- wus12 not fully implmented - - -- us20 not fully implemented -- wus12 not fully implemented -+ ne16 missing finidat file for 1850 -+ ne60 missing finidat file for 1850 -+ 1x1_tropicAtl missing finidat file for 1850 - - - -@@ -89,19 +86,17 @@ - CESM script issue - Restart length different - Restart length different -- Initial simulation fails -+ Initial simulation fails -+ History files are different on restart - Initial simulation fails - build error? - - - - -- datm namelist problem for single-point forcing -- datm namelist problem for single-point forcing -+ ???? - - -- CESM script issue -- CESM script issue - - - -@@ -110,10 +105,8 @@ - - - T62 not working -- ignore_ic_date is incompatable with crop! -- CESM script problem didn't see both files -- CESM script problem didn't see both files -- build error? -+ Dies early with a floating point trap -+ build error? - - - -@@ -123,22 +116,9 @@ - - - -- datm namelist issue -- datm namelist issue -- datm namelist issue - 277/277 < PASS> - Successully ran all testing for build-namelist - - Cleanup files created - rm: lnd_in.default: A file or directory in the path name does not exist. - rm: temp_file.txt: A file or directory in the path name does not exist. - # Looks like you failed 4 tests of 277. - -%%cesm/clm tests - - mostly OK - - generate : ./cs.status.164019.bluefire - - nohup create_test_suite -input_list bluefire.clm.auxtest -compare clm4_0_50 -baselineroot /glade/proj2/cgd/tss/clm_cesm_baselines -generate clm4_0_51 -testroot /glade/scratch/muszala/tests > & ! bf_out_`date +"%m%d%y"`.lg & - ID: 203212 - - ## Reason: throughput measure off - FAIL SMS_RLA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_50 - FAIL ERS_D.f45_g37.I.bluefire_ibm.tputcomp.clm4_0_50 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.tputcomp.clm4_0_50 - FAIL SMS.T31_g37.IG4804.bluefire_ibm.tputcomp.clm4_0_50 - ## baseline diretory already existed, error copying over nc files - FAIL SMS_RLA.f45_f45.I.bluefire_ibm.generate.clm4_0_51 - FAIL SMS_RLB.f45_f45.I.bluefire_ibm.generate.clm4_0_51 - FAIL SMS_ROA.f45_f45.I.bluefire_ibm.generate.clm4_0_51 - FAIL ERS_D.f45_g37.I.bluefire_ibm.generate.clm4_0_51 - FAIL NCK.T31_g37.I.bluefire_ibm.generate.clm4_0_51 - FAIL PST.f45_g37.I1850CN.bluefire_ibm.generate.clm4_0_51 - FAIL PET_PT.f45_g37.I1850.bluefire_ibm.generate.clm4_0_51 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.generate.clm4_0_51 - FAIL ERI.T31_g37.IG1850.bluefire_ibm.generate.clm4_0_51 - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.generate.clm4_0_51 - FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.generate.clm4_0_51 - FAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.generate.clm4_0_51 - FAIL SMS.T31_g37.IG4804.bluefire_ibm.generate.clm4_0_51 - FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.generate.clm4_0_51 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.generate.clm4_0_51 - ## fails due to cprnc time check. new runs are 11 ts. in 50 these were 10, I expect these to pass next time around - FAIL ERS_D.f45_g37.I.bluefire_ibm.compare_hist.clm4_0_50 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.compare_hist.clm4_0_50 - FAIL ERI.T31_g37.IG1850.bluefire_ibm.compare_hist.clm4_0_50 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.compare_hist.clm4_0_50 - FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.compare_hist.clm4_0_50 - ## No Lm3 directories created during clm4_0_50 generate...new case, should pass next time around - SFAIL ERS_Lm3.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.203212 - ERROR: datm.buildnml.csh failed - BFAIL ERS_Lm3.f19_g16.IGRCP60CN.bluefire_ibm.compare_hist.clm4_0_50 - No dir to compare to in tag 50 - ## problems in generate due to scripts for single point - SFAIL SMS.1x1_mexicocityMEX.I1PT.bluefire_ibm.GC.203212 - ERROR: datm.buildnml.csh failed also failed during generate - BFAIL SMS.1x1_numaIA.ICN.bluefire_ibm.compare_hist.clm4_0_50 - No dir to compare to in tag 50 - failed during generate - - ## these were failing but passed when rerun - keep an eye on these - BFAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.compare_hist.clm4_0_50 - BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.compare_hist.clm4_0_50 - BFAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_50 - - went to generated ref case - ./setup -clean - ./setup - then build and rerun - - went to generate case - ./setup -clean - ./setup - clean-build, then build then reurn - - did the same in the CG case for ref and normal case - - After hand running - ./cs.status.203212.bluefire | grep ERB.f09_g16.I1850SPINUPCN - PASS ERB.f09_g16.I1850SPINUPCN.bluefire_ibm - PASS ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.memleak - PASS ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.generate.clm4_0_51 - FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.compare_hist.clm4_0_50 - see cprnc ts error above - PASS ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.memcomp.clm4_0_50 - PASS ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.tputcomp.clm4_0_50 - - This test was rerun with a new testlist - ./cs.status.203212.bluefire | grep ERB.ne30_g16.I_1948-2004 - PASS ERB.ne30_g16.I_1948-2004.bluefire_ibm - PASS ERB.ne30_g16.I_1948-2004.bluefire_ibm.memleak - PASS ERB.ne30_g16.I_1948-2004.bluefire_ibm.generate.clm4_0_51 - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.compare_hist.clm4_0_50 - see cprnc ts error above - PASS ERB.ne30_g16.I_1948-2004.bluefire_ibm.memcomp.clm4_0_50 - FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.tputcomp.clm4_0_50 - throughput tol. error - - ./cs.status.141307.bluefire - PASS ERH_D.T31_g37.I1850CN.bluefire_ibm - PASS ERH_D.T31_g37.I1850CN.bluefire_ibm.memleak - PASS ERH_D.T31_g37.I1850CN.bluefire_ibm.generate.clm4_0_51 - FAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_50 - see cprnc ts error above - PASS ERH_D.T31_g37.I1850CN.bluefire_ibm.memcomp.clm4_0_50 - PASS ERH_D.T31_g37.I1850CN.bluefire_ibm.tputcomp.clm4_0_50 - -%%cesm/clm rof tests - nohup create_test_suite -input_list bluefire.clmRof.auxtest -compare clm4_0_50 -baselineroot /glade/proj2/cgd/tss/clm_cesm_baselines -generate clm4_0_51 -testroot /glade/scratch/muszala/tests > & ! bf_out_`date +"%m%d%y"`.lg & - - These don't exist anymore, but will be replaced once Tony works out default grid resolutions for r01 and r05 - - ID: 091144 - - BFAIL SMR.f19_g16.I_2000_CN.bluefire_ibm.compare_hist.clm4_0_50 - nothing to compare to in clm4_0_50 - BFAIL SMR.f09_g16.I_2000_CN.bluefire_ibm.compare_hist.clm4_0_50 - nothing to compare to in clm4_0_50 - FAIL SMR.f05_g16.I_2000_CN.bluefire_ibm - larger scipt errors in rof - kills the following two tests outright - BFAIL SMR.f05_g16.I_2000_CN.bluefire_ibm.generate.clm4_0_51 - BFAIL SMR.f05_g16.I_2000_CN.bluefire_ibm.compare_hist.clm4_0_50 - FAIL SMR.ne120_g16.I_2000_CN.bluefire_ibm.generate.clm4_0_51 - can't copy in, clm4_0_51 baseline already exists - BFAIL SMR.ne120_g16.I_2000_CN.bluefire_ibm.compare_hist.clm4_0_50 - nothing to compare to in clm4_0_50 - RUN SMR.ne240_g16.I_2000_CN.bluefire_ibm.GC.091144 - - -%%%%%% testing reporting end - -CLM tag used for the baseline comparison tests if applicable: - - clm4_0_50 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_50 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Fri Sep 21 15:13:52 MDT 2012 -One-line Summary: testing of clm and new rof component - -Purpose of changes: - -Run tests on clm for new ROF component. CLM mods by tcraig to support ROF. - -Requirements for tag: - -Test level of tag: doc, critical, standard, std-test, reg-test - -std-test - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): - -List all files eliminated: - - Not needed since ROF is now a CLM external - D models/lnd/clm/src/main/clm_mct_mod.F90 - D models/lnd/clm/src/riverroute - D models/lnd/clm/src/riverroute/RtmMod.F90 - D models/lnd/clm/src/riverroute/RunoffMod.F90 - -List all files added and what they do: - - Fix for some of Erik's new tests - A models/lnd/clm/test/system/user_nl_dirs/monthly - A models/lnd/clm/test/system/user_nl_dirs/monthly/user_nl_clm - A models/lnd/clm/test/system/user_nl_dirs/monthly/user_nl_cpl - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/tests_pretag_jaguarpf - M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi - M models/lnd/clm/tools/ncl_scripts - M models/lnd/clm/tools/interpinic - M models/lnd/clm/tools/mksurfdata_map/src - M models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl - M models/lnd/clm/bld - M models/lnd/clm/bld/configure - M models/lnd/clm/bld/user_nl_clm - M models/lnd/clm/bld/listDefaultNamelist.pl - M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - M models/lnd/clm/bld/build-namelist - M models/lnd/clm/bld/clm.buildnml.csh - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl - M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - M models/lnd/clm/src/biogeochem/CNDVMod.F90 - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 - M models/lnd/clm/src/main/spmdGathScatMod.F90 - M models/lnd/clm/src/main/clm_varpar.F90 - M models/lnd/clm/src/main/decompInitMod.F90 - M models/lnd/clm/src/main/clm_initializeMod.F90 - M models/lnd/clm/src/main/clmtypeInitMod.F90 - M models/lnd/clm/src/main/histFileMod.F90 - M models/lnd/clm/src/main/clm_atmlnd.F90 - M models/lnd/clm/src/main/findHistFields.pl - M models/lnd/clm/src/main/restFileMod.F90 - M models/lnd/clm/src/main/controlMod.F90 - M models/lnd/clm/src/main/clm_varctl.F90 - M models/lnd/clm/src/main/clm_driver.F90 - M models/lnd/clm/src/main/ncdio_pio.F90 - M models/lnd/clm/src/main/domainMod.F90 - M models/lnd/clm/src/main/decompMod.F90 - M models/lnd/clm/src/main/clmtype.F90 - M models/lnd/clm/src/main/histFldsMod.F90 - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - M models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 - M SVN_EXTERNAL_DIRECTORIES - M ChangeLog - M ChangeSum - M scripts/ccsm_utils/Case.template/config_definition.xml - - -Machines testing ran on: - -%%%%%%%% Test reporting START %%%%%%%% - - Test system is currently in flux so I will simply list all tests that have - failed and the 8 tests that we need to keep an eye on. I've included bluefire - and lynx and pointers to where tests live. - -* tests that will pass in next tag due to new features -** denotes an expected fail. -*** any tputcomp tests that fail I'm inclined to ignore also. These change from test to test. -? or cd a test that will need fixing - -BLUEFIRE: - -OK ############ run build-namelist tests ->>cd models/lnd/clm/bld/unit_testers ->>./build-namelist_test.pl -compare /glade/scratch/muszala/svn/clm4_0_49/models/lnd/clm/bld/unit_testers -generate -test -csmdata /glade/proj3/cseg/inputdata >&! out_unit_`date +"%m%d%y"`.lg - - OK...failed tests will pass in next tag - -OK ############# run new I case tests -[be1105en /glade/scratch/muszala/svn/clm_trunk/scripts ]$ -create_test_suite -mach bluefire_ibm -input_list allIcompsetsRes.clm.auxtest -nobatch on -nobuild on -compare clm4_0_49 -baselineroot /glade/proj2/cgd/tss/clm_cesm_baselines -generate clm4_0_50 -testroot /glade/scratch/muszala/tests > & ! bf_out_allI_`date +"%m%d%y"`.lg - - 165507 - /glade/scratch/muszala/tests - >>./cs.status.165507.bluefire | grep FAIL -... -** SFAIL SBN.1x1_mexicocityMEX.I1PT.bluefire_ibm.GC.165507 -** SFAIL SBN.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.165507 -** SFAIL SBN.1x1_urbanc_alpha.I1PT.bluefire_ibm.GC.165507 -** TFAIL SBN.1x1_asphalt_jungle.ICNTEST.bluefire_ibm.GC.165507 -** TFAIL SBN.T42_g16.I1850.bluefire_ibm.GC.165507 -** TFAIL SBN.T31_g16.I1850.bluefire_ibm.GC.165507 -** SFAIL SBN.f05_g16.I20TR.bluefire_ibm.GC.165507 -** SFAIL SBN.1x1_tropicAtl.I20TR.bluefire_ibm.GC.165507 -** SFAIL SBN.ne30_g16.I20TR.bluefire_ibm.GC.165507 -** SFAIL SBN.ne120_g16.I20TRCN.bluefire_ibm.GC.165507 -** SFAIL SBN.f05_g16.IRCP26CN.bluefire_ibm.GC.165507 -** SFAIL SBN.f05_g16.IRCP45CN.bluefire_ibm.GC.165507 -** SFAIL SBN.f05_g16.IRCP60CN.bluefire_ibm.GC.165507 -** SFAIL SBN.f05_g16.IRCP85CN.bluefire_ibm.GC.165507 - - -OK ############ run clm interactive tools tests -[be1105en /glade/scratch/muszala/svn/clm_trunk/models/lnd/clm/test/system ]$ ->>nohup env CLM_SOFF=FALSE ./test_driver.sh -i >&! bluefire_i_`date +"%m%d%y"`.lg & - - OK: looking at /glade/scratch/muszala/svn/clm_trunk/models/lnd/clm/test/system/td.951030.status.xFail - rerun - clmTests/test-driver.533240 - /glade/scratch/muszala/svn/clm_trunk/models/lnd/clm/test/system/td.533240.status.xFail - -############# run old cesm/clm tests out of scripts - - -[be1105en /glade/scratch/muszala/svn/clm_trunk/scripts ]$ ->>create_test_suite -input_list bluefire.clm.auxtest -compare clm4_0_49 \ --baselineroot /glade/proj2/cgd/tss/clm_cesm_baselines \ --generate clm4_0_50 \ --testroot /glade/scratch/muszala/tests >&! bf_out_`date +"%m%d%y"`.lg & - - 143258 ->>cs.status.143258.bluefire | grep -v PASS -... - -*** FAIL SMS.T31_g37.IG4804.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERI.T31_g37.IG1850.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERS_E.T31_g37.I1850.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERS_D.f45_g37.I.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL SMS_RLA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL SMS_RLB.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_49 -*** FAIL ERS_D.f45_g37.I.bluefire_ibm.compare_hist.clm4_0_49 - -* FAIL NCK.T31_g37.I.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL PST.f45_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL PET_PT.f45_g37.I1850.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL ERS_E.T31_g37.I1850.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL ERI.T31_g37.IG1850.bluefire_ibm.compare_hist.clm4_0_49 -? FAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm - - Failing in Generate: - "/glade/scratch/muszala/svn/clm4_0_49/models/drv/shr/seq_infodata_mod.F90", line 620: 1525-006 The STATUS= specifier in the OPEN - statement for - unit 98 cannot be set to OLD because the file rpointer.drv does not exist. The program will stop. - - BFAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.generate.clm4_0_50 - BFAIL ERB.ne30_g16.I_1948-2004.bluefire_ibm.compare_hist.clm4_0_49 -? FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm - - Failing in Generate: - 0:"/glade/scratch/muszala/svn/clm4_0_49/models/drv/shr/seq_infodata_mod.F90", line 620: 1525-006 The STATUS= specifier in the OPEN - statemen t for unit 98 cannot be set to OLD because the file rpointer.drv does not exist. The program will stop. - - BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.generate.clm4_0_50 - BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.compare_hist.clm4_0_49 -? FAIL ERH_D.T31_g37.I1850CN.bluefire_ibm - - Failing in Generate: - "/glade/scratch/muszala/svn/clm4_0_49/models/drv/shr/seq_infodata_mod.F90", line 620: 1525-006 The STATUS= specifier in the OPEN - statement for - unit 98 cannot be set to OLD because the file rpointer.drv does not exist. The program will stop. - - BFAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.generate.clm4_0_50 - BFAIL ERH_D.T31_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_49 - -* FAIL SMS.T31_g37.IG4804.bluefire_ibm.compare_hist.clm4_0_49 -** SFAIL SMS.1x1_mexicocityMEX.I1PT.bluefire_ibm.GC.143258 - should be xFAIL : ERROR(build-namelist::new): Required input variable yearfirst was not found -** SFAIL ERP.1x1_vancouverCAN.I1PT.bluefire_ibm.GC.143258 - should be xFAIL : ERROR(build-namelist::new): Required input variable yearfirst was not found -* FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL ERP.f19_g16.IGRCP60CN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL PST.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.compare_hist.clm4_0_49 -* FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.compare_hist.clm4_0_49 - - - - -############# run new test_system tests - -## interactive ->> test_system -i -c clm4_0_49 -g clm4_0_50 >&! bluefire_tsi_`date +"%m%d%y"`.lg & - - 161038 ->>cs.status.161038.bluefire | grep -v PASS -... -SFAIL ERS_D.CLM_USRDAT.IalaskaCN.bluefire_ibm.GC.161038 -* FAIL ERS_P1x64.f45_g37.I_1850_SPINUP_3HrWx_CN.bluefire_ibm.compare_hist.clm4_0_49 - new fields in cpl history files -* FAIL ERS_P1x64.f45_g37.I_1850_SPINUP_3HrWx_CN.bluefire_ibm.memcomp.clm4_0_49 - max memory values differ -*** FAIL ERS_P1x64.f45_g37.I_1850_SPINUP_3HrWx_CN.bluefire_ibm.tputcomp.clm4_0_49 -** FAIL ERS_D_P1x64.f19_g16.I_1850-2000_VOC_SNCRFRC_CN.bluefire_ibm -** BFAIL ERS_D_P1x64.f19_g16.I_1850-2000_VOC_SNCRFRC_CN.bluefire_ibm.generate.clm4_0_50 -** BFAIL ERS_D_P1x64.f19_g16.I_1850-2000_VOC_SNCRFRC_CN.bluefire_ibm.compare_hist.clm4_0_49 -cd RUN ERS_D_P1x25.5x5_amazon.I_2000.bluefire_ibm.GC.161038 -** RUN ERS_D.1x1_asphaltjungleNJ.I_2000_VOC.bluefire_ibm.GC.161038 -** RUN ERS48s_D_P1x64.f45_g37.I_2000_VOC.bluefire_ibm.GC.161038 -* FAIL ERS48s_D_P1x64.f19_g16.I_2000_GLCMECPD.bluefire_ibm.compare_hist.clm4_0_49 - new fields in cpl history files -*** FAIL ERS48s_D_P1x64.f19_g16.I_2000_GLCMECPD.bluefire_ibm.tputcomp.clm4_0_49 -** FAIL PET_D_P1x64.f45_g37.I_2000_VOC.bluefire_ibm - - - -## batch ->>test_system -c clm4_0_49 -g clm4_0_50 > & ! bluefire_ts_`date +"%m%d%y"`.lg & - - 143420 -- cs.status.143420.bluefire -cs.status.143420.bluefire | grep -v PASS -... -* FAIL ERS211d.f10_f10.ICNADSPIN.bluefire_ibm.compare_hist.clm4_0_49 - new fields in cpl history files -*** FAIL ERS211d.f10_f10.ICNADSPIN.bluefire_ibm.tputcomp.clm4_0_49 -** CFAIL ERS48s_D.f09_g16.ICNEXSPIN.bluefire_ibm.GC.143420 - this is xFAIL for interactive, should also be listed here -* FAIL ERS48s_D_P64x16.ne30_g16.ICN.bluefire_ibm.compare_hist.clm4_0_49 - new fields in cpl history files -*** FAIL ERS48s_D_P64x16.ne30_g16.ICN.bluefire_ibm.tputcomp.clm4_0_49 -* FAIL PET_D_P1x64.ne30_g16.ICN.bluefire_ibm.compare_hist.clm4_0_49 - new fields in cpl history files -? RUN ERS211d_D_P112x2.f10_f10.ICNCROP.bluefire_ibm.GC.143420 - run failed -** FAIL ERS211d.f10_f10.I_2000_VOC_CN.bluefire_ibm.compare_hist.clm4_0_49 -*** FAIL ERS211d.f10_f10.I_2000_VOC_CN.bluefire_ibm.tputcomp.clm4_0_49 -** RUN ERS211d_P192x2.f19_g16.I_2000_CNDV_CROP.bluefire_ibm.GC.143420 -** SFAIL ERS_D_P96x32.T62_g37.I_2000.bluefire_ibm.GC.143420 - - - -############# - -LYNX: - -############# run new test_system tests - -## interactive ->> test_system -i -c clm4_0_49_lynx_pgi -g clm4_0_50_lynx_pgi >&! lynx_i_`date +"%m%d%y"`.lg & - - 144558 - -cs.status.144558.lynx | grep -v PASS -... -*** FAIL ERS211d.1x1_brazil.I_2000.lynx_pgi.tputcomp.clm4_0_49_lynx_pgi -* FAIL ERS48s_D_P1x12.f10_f10.ICNCROP.lynx_pgi.compare_hist.clm4_0_49_lynx_pgi - new fields in cpl history files -** SFAIL SMS_D.1x1_vancouverCAN.I1PT.lynx_pgi.GC.144558 -** SFAIL ERS.1x1_mexicocityMEX.I1PT.lynx_pgi.GC.144558 - - -## batch ->> test_system -c clm4_0_49_lynx_pgi -g clm4_0_50_lynx_pgi >&! lynx_`date +"%m%d%y"`.lg & - - 160925 -./cs.status.160925.lynx | grep -v PASS -... -? BFAIL PMT_D.f45_g37.I_2000.lynx_pgi.compare_hist.clm4_0_49_lynx_pgi - - problem in generate case not copying over file - PASS - Initial Test log is /glade/scratch/muszala/PMT_D.f45_g37.I_2000.lynx_pgi.G.114232/run/cpl.log.120920-152048 - /var/spool/torque/mom_priv/jobs/102008.nid00003.SC: Storing new baseline in /glade/proj2/cgd/tss/clm_cesm_baselines/clm4_0_49_ly - nx_pgi/PMT_D.f45_g37.I_2000.lynx_pgi - ERROR in /var/spool/torque/mom_priv/jobs/102008.nid00003.SC: could not copy /glade/scratch/muszala/archive/PMT_D.f45_g37.I_2000. - lynx_pgi.G.114232/cpl/hist/ to /glade/proj2/cgd/tss/clm_cesm_baselines/clm4_0_49_lynx_pgi/PMT_D.f45_g37.I_2000.lynx_pgi/cpl.hi.nc - -? RUN ERS48s_D.f45_g37.I_2000_VOC.lynx_pgi.GC.160925 - run didn't finish? -? RUN ERS48s_D.f10_f10.I_2000_CN.lynx_pgi.GC.160925 - PBS: job killed: walltime 9021 exceeded limit 9000 -? RUN ERS48s_P96x2.f19_g16.I_2000_VOC_SNCRFRC_CN_GLCMECPD.lynx_pgi.GC.160925 - PBS: job killed: walltime 9041 exceeded limit 9000 - -## interactive, with mirage test list and intel compiler ->>test_system -i -p intel -l mirage.interactive -o "-mach lynx" -c clm4_0_49_lynx_intel -g clm4_0_50_lynx_intel > & ! lynx_mi_intel_`date +"%m%d%y"`.lg & - - 143620 cs.status.143620.lynx ->>cs.status.143620.lynx | grep -v PASS -... -** FAIL ERS.1x1_brazil.I_2000.lynx_intel -** BFAIL ERS.1x1_brazil.I_2000.lynx_intel.generate.clm4_0_50_lynx_intel -** BFAIL ERS.1x1_brazil.I_2000.lynx_intel.compare_hist.clm4_0_49_lynx_intel -? FAIL ERI_D.1x1_camdenNJ.I_2000_VOC.lynx_intel - forrtl: error (73): floating divide by zero - rtmmod_mp_rtmini_ 303 RtmMod.F90 -** RUN ERS_D.1x1_asphaltjungleNJ.I_2000_VOC.lynx_intel.GC.143620 - forrtl: error (73): floating divide by zero - rtmmod_mp_rtmini_ 303 RtmMod.F90 -* FAIL ERS48s_D_P1x12.f10_f10.I_2000_CN.lynx_intel.compare_hist.clm4_0_49_lynx_intel - new fields in cpl history files -*** FAIL ERS48s_D_P1x12.f10_f10.I_2000_CN.lynx_intel.tputcomp.clm4_0_49_lynx_intel - -%%%%%%%% Test reporting END %%%%%%%% - - - build-namelist unit tester: - - CESM test lists: - - bluefire/CESM - lynx/CESM - - bluefire/PTCLM - - test_system testing: - - bluefire batch: - bluefire interactive: - lynx/pgi batch: - lynx/pgi interactive: - mirage,storm/ifort interactive: - -CLM tag used for the baseline comparison tests if applicable: - - clm4_0_49 - -Changes answers relative to baseline: Yes, runoff is different (similar climate) - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: all with RTM - - what platforms/compilers: all - - nature of change (similar climate) I compsets only have runoff change - - MSS location of control simulations used to validate new climate: - - https://wiki.ucar.edu/display/ccsm/CCSM4+-+Track5+experiments - - /CCSM/csm/b.e11.B1850CN.f19_g16.004 - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm4_0_49 -Originator(s): erik (Kluzek Erik 303-497-1326 CGD) -Date: Sun Sep 16 01:05:04 MDT 2012 -One-line Summary: Move clm testing to use CESM test framework - -Purpose of changes: - -Move testing for CLM from CLM stand-alone test_driver.sh to one based on -the CESM testing framework. Create CLM specific tests-lists, user_nl_dir, -and compset files to handle most CLM testing. - -Requirements for tag: - - Move major testing from test_driver.sh to one based on CESM framework. Try - to get most of it to work. - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - Update to cesm1_1_beta18b - - scripts updated to: scripts4_120915 - scripts updated to: Machines_120915 - mapping updated to: mapping_120816 - stubs updated to: stubs1_3_05 - drv updated to: drvseq1_4_26 - -List all files eliminated: None - -List all files added and what they do: - -A + models/lnd/clm/test/system/test_system ---- New main testing script for CLM. - wrapper script to CESM scripts/create_test_suite with behavior - similar to test_driver.sh - - -b directory [or --baseline] baseline directory - -c version [or --compare] version to compare to - (generate must already have been run to create these) - -d debug usage -- display tests that will run -- but - do NOT actually execute them - -g version [or --generate] name of this version to generate version as - -h [or --help] displays help - -i interactive usage - -l list [or --list] input test list to use instead of default - (path relative to this directory) - -o options [or --options] options to pass to create_test_suite - -p compiler [or --compiler] compiler to use instead of default - -s [or --shortlist] use the short test list - - Typical use: - - cd models/lnd/clm/test/system - test_system -i -c clm4_0_48 -g clm4_0_49 - test_system -c clm4_0_48 -g clm4_0_49 - - ->>>>>>>>>>>>> Test lists -A + models/lnd/clm/test/system/mirage.interactive -A + models/lnd/clm/test/system/lynx.interactive -A + models/lnd/clm/test/system/shortlist.interactive -A + models/lnd/clm/test/system/bluefire.batch -A + models/lnd/clm/test/system/bluefire.interactive -A + models/lnd/clm/test/system/lynx.batch -A + models/lnd/clm/test/system/shortlist.batch - ->>>>>>>>>>>>> compset file and user_nl_* files for testing -A + models/lnd/clm/test/system/config_files/config_CLMtestCompsets.xml -A + models/lnd/clm/test/system/user_nl_dirs -A + models/lnd/clm/test/system/user_nl_dirs/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/crop -A + models/lnd/clm/test/system/user_nl_dirs/crop/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/cn_conly -A + models/lnd/clm/test/system/user_nl_dirs/cn_conly/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/voc -A + models/lnd/clm/test/system/user_nl_dirs/voc/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/voc/user_nl_cpl -A + models/lnd/clm/test/system/user_nl_dirs/glcMEC -A + models/lnd/clm/test/system/user_nl_dirs/glcMEC/user_nl_clm -A + models/lnd/clm/test/system/user_nl_dirs/glcMEC/user_nl_cpl - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/tests_posttag_lynx_nompi -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -M models/lnd/clm/bld/listDefaultNamelist.pl -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - New failed - tests from new test framework -M models/lnd/clm/bld/clm.buildnml.csh - Copy drv_flds_in if clm creates it - and if it doesn't already exist. -M UpDateChangeLog.pl -- Add some support for xFail. Not fully working. - -Machines testing ran on: - - build-namelist unit tester: yes - - test_system testing: - - bluefire batch: yes - bluefire interactive: yes - bluefire/CESM: yes - lynx/pgi batch: yes - lynx/pgi interactive: yes - -CLM tag used for the baseline comparison tests if applicable: clm4_0_48 - -Difference in expected fails from testing: - -Index: expectedClmTestFails.xml -=================================================================== ---- expectedClmTestFails.xml (.../trunk_tags/clm4_0_48/models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml) (revision 40288) -+++ expectedClmTestFails.xml (.../trunk/models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml) (revision 40288) -@@ -34,6 +34,10 @@ - - - cprnc showing diffs are not b4b -+ problem configuring -+ problem configuring -+ clm stand-alone can no longer work -+ clm stand-alone can no longer work - - - -@@ -71,14 +75,70 @@ - - - -+ -+ CESM script issue -+ CESM script issue -+ - - - - - -+ -+ -+ -+ CESM script issue -+ Restart length different -+ Restart length different -+ Initial simulation fails -+ Initial simulation fails -+ -+ -+ -+ -+ datm namelist problem for single-point forcing -+ datm namelist problem for single-point forcing -+ -+ -+ -+ -+ -+ -+ -+ T62 not working -+ ignore_ic_date is incompatable with crop! -+ CESM script problem didn't see both files -+ CESM script problem didn't see both files -+ -+ -+ -+ -+ -+ - - - -+ datm namelist issue -+ datm namelist issue -+ datm namelist issue -+ datm namelist issue -+ missing wus12 datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ missing datasets -+ -+ -+ -+ -+ -+ - - - - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_48 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Tue Sep 11 09:14:40 MDT 2012 -One-line Summary: bug fixes, xFail to tests and normalize test output for CLM - -Purpose of changes: Bug Fixes. Add xFail capability to CLM batch, -interactive and namelist tests. Make test output the same for CLM -tests. - -Requirements for tag: Test on bluefire (CESM, int, bat), lynx/pgi (int,bat) -Fix bugs: 1436,1500,1521,1537 - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - - 1436,1500,1521,1537 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - - 1545 - on lynx clm-batch doesn't call our new xFAIL module. - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: xFail module Bill, Erik. Rest of code Erik. - -List any svn externals directories updated (csm_share, mct, etc.): - -List all files eliminated: - -List a files added and what they do: - -A models/lnd/clm/bld/unit_testers/xFail -A models/lnd/clm/bld/unit_testers/xFail/expectedFail.pm -A models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -A models/lnd/clm/bld/unit_testers/xFail/wrapClmTests.pl - - - xFAIL module that implements expected fail reporting. wrapClmTests.pl is used -as a wrapper and called by test_driver.sh. The XML file holds test cases. -Documentation is in POD in expectedFail.pm - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/system/TBL.sh - - fix so that mct and pio are built out of the baseline directory -M models/lnd/clm/bld/configure - - fix path to mct/.../mpi-serial -M models/lnd/clm/src/main/getdatetime.F90 - - fix to broadcast correct time stamp -M models/lnd/clm/test/system/test_driver.sh -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - - both of these files modified to support xFAIL functionality -M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - - remove wrf mapping entry that isn't in inputdata. fix entries per bug - 1521 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - - remove wrf mapping entry that isn't in inputdata. fix entry per bug 1521 - -Summary of testing: - -Note that tests that used to fail are now being reported as xFAIL. The file -to look at is models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml. - -There are no tests that used to FAIL that now PASS. - - build-namelist unit testing: all pass - bluefire: all pass - bluefire interactive testing: all pass - bluefire/CESM testing: a few throughput failures - - FAIL SMS_RLA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_47 - COMMENT tput_decr = 2.945 tput_percent_decr = 21.3 - - FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.tputcomp.clm4_0_47 - COMMENT tput_decr = 65.6 tput_percent_decr = 41.9 - - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.tputcomp.clm4_0_47 - COMMENT tput_decr = 1.8039999 tput_percent_decr = 2.07 - - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.tputcomp.clm4_0_47 - COMMENT tput_decr = 2.325 tput_percent_decr = 9.80 - - FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.tputcomp.clm4_0_47 - COMMENT tput_decr = 7.0280000 tput_percent_decr = 3.69 - - bluefire/PTCLM testing: N/A - lynx/pgi testing: all pass - lynx/pgi interactive testing: all pass - lynx/CESM testing: - mirage,storm/ifort interactive testing: all pass - -CLM tag used for the baseline comparison tests if applicable: clm4_0_47 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_47 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Thu Aug 23 11:09:27 MDT 2012 -One-line Summary: bug fixes - -Purpose of changes: - - Fix some bugs and tag early since CAM needs fix of bug 1538 asap. - -Requirements for tag: - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - - 1534,1533,1507,1444,1538 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/configure --- Passes FLAGS down to cesm_lib build and for pio (only for CLM testing) - -M models/lnd/clm/tools/mkmapdata/regridbatch.sh -M models/lnd/clm/tools/mkmapdata/mkmapdata.sh --- Fixes as per bug 1507. Logic clean up for interactive and using mpi - -M models/lnd/clm/bld/build-namelist --- Fix as per bug 1538 - -M models/lnd/clm/src/main/controlMod.F90 --- Fix as per bug 1444. remove call to "mpi_bcast (glc_topomax," and logic - controlling it. - -M models/lnd/clm/src/main/ncdio_pio.F90 --- Fix as per bug 1533 and 1534 - -M SVN_EXTERNAL_DIRECTORIES --- Mistake from last tag. Replaced two repos with correct trunk-tag urls. - - -Summary of testing: - - build-namelist unit testing: - All PASS except: - fails involve us20 and wus12 - not ok 141 - lnd_in file the same as expected for CN - 94x192 - fixed. Should pass in next tag. - not ok 214 - lnd_in file exists - us20 - no tests in place - not ok 219 - lnd_in file exists - wus12 - no tests in place - not ok 221 - compare file lnd_in DNE for CN and -res+wus12 - wus12 - no tests in place - not ok 222 - compare file temp_file.txt DNE for CN and -res+wus12 - wus12 - no tests in place - bluefire: - - 016-019 will be removed and put in CESM/CLM tests - 016 smW51 TSM.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -5 cold .................FAIL! rc= 10 - 017 erW51 TER.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -3+-2 cold ..............FAIL! rc= 5 - 018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 5 - 019 blW51 TBL.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -5 cold .................FAIL! rc= 4 - - 036-039 Failed in the past, see prior versions - 036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 - 037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 - 038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 - 039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 - - 049-052 Failed in the past, see prior versions - 049 smCI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 - 050 erCI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 - 051 brCI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 - 052 blCI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - - bluefire interactive testing: - All PASS execpt: - 004 blC74 TBL.sh _sc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -10 arb_ic ..................FAIL! rc= 5 - 008 blC97 TBL.sh _sc_do clm_spin^nl_urb 20030101:1800 4x5 gx3v7@1850 -6 arb_ic ..................FAIL! rc= 5 - 012 blHS3 TBL.sh 17p_cnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .....FAIL! rc= 5 - 016 blCA4 TBL.sh _sc_ds clm_drydep^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ............FAIL! rc= 5 - 020 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 158 arb_ic ....FAIL! rc= 5 - 024 blCA8 TBL.sh _sc_ds clm_drydep^nl_urb 20021230:3600 1x1_asphaltjungleNJ navy -90 arb_ic .....FAIL! rc= 5 - 026 blCK4 TBL.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -10 cold ...............FAIL! rc= 5 - 028 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -10 cold ...........FAIL! rc= 5 - 030 blC78 TBL.sh _sc_s clm_std^nl_urb 20021231:1800 1x1_brazil navy -10 arb_ic ..................FAIL! rc= 5 - 034 blF93 TBL.sh 17p_sc_do clm_drydep^nl_voc 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 5 - 038 blC83 TBL.sh _sc_do clm_std^nl_urb 20020115:3600 5x5_amazon navy -10 arb_ic .................FAIL! rc= 5 - 042 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:1800 1x1_brazil navy -670 arb_ic .................FAIL! rc= 5 - 046 blC63 TBL.sh _sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ........................FAIL! rc= 5 - 050 blHQ4 TBL.sh 17p_cnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold ............FAIL! rc= 5 - 054 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 5 - 067 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 5 - Reason: changed configure, but configure in previous tag not updated. - These will pass when a new tag is compared to clm4_0_47 - bluefire/CESM testing: - All PASS except: - FAIL SMS_RLB.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_46 - FAIL SMS_ROA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_46 - FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.tputcomp.clm4_0_46 - Reason: the throughput tolerance is likely still not large enough. - bluefire/PTCLM testing: N/A - lynx/pgi testing: - lynx/pgi interactive testing: - 004 blC74 TBL.sh _sc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -10 arb_ic ..................FAIL! rc= 5 - 008 blTZ3 TBL.sh 21p_cncrpsc_do clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 5 - 010 blCL4 TBL.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 5 - 014 blCA4 TBL.sh _sc_ds clm_drydep^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ............FAIL! rc= 5 - Reason: changed configure, but configure in previous tag not updated. - These will pass when a new tag is compared to clm4_0_47 - lynx/CESM testing: - N/A - mirage,storm/ifort interactive testing: - All PASS except: - 70 004 blC74 TBL.sh _sc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -10 arb_ic ..................FAIL! rc= 5 - 71 007 blD94 TBL.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 5 - 72 011 blCA4 TBL.sh _sc_ds clm_drydep^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ............FAIL! rc= 5 - 73 015 blCA8 TBL.sh _sc_ds clm_drydep^nl_urb 20021230:3600 1x1_asphaltjungleNJ navy -90 arb_ic .....FAIL! rc= 5 - 74 019 blL54 TBL.sh _sc_ds clm_std^nl_urb 20020115:1800 10x15 USGS 48 arb_ic .......................FAIL! rc= 5 - 75 023 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 48 cold ............FAIL! rc= 5 - Reason: changed configure, but configure in previous tag not updated. - These will pass when a new tag is compared to clm4_0_47 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_46 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_46 -Originator(s): muszala (Muszala Stefan 303-497-1320 CGD) -Date: Wed Aug 8 11:53:44 MDT 2012 -One-line Summary: R01 support and update externals - -Purpose of changes: - - Add support for r01 rtm. Add mapping files for ne120 and ne240. Update all svn - externals to what is in cesm_alpha16e and modify and update our test system as - necessary. - -Requirements for tag: test on bluefire (CESM, int, bat, build-namelist), lynx/pgi (int,bat), mirage. - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID):N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system:N/A - -Describe any changes made to the namelist:N/A - -List any changes to the defaults for the boundary datasets:N/A - -Describe any substantial timing or memory changes:N/A - -Code reviewed by: self, Erik - -List any svn externals directories updated (csm_share, mct, etc.): - Created the following tags: - https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_120808 - https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_1_23 - https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_120807 - -List all files eliminated:N/A - -List all files added and what they do:N/A - -List all existing files that have been modified, and describe the changes: - -== modifications to update externals == - M models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES - M SVN_EXTERNAL_DIRECTORIES - -== modifications to get cesm/clm, interactive tests to pass == - - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - -- added more output for easier test reading - M models/lnd/clm/test/system/TCB.sh - -- fix some indentation - M models/lnd/clm/test/system/TCBtools.sh - -- add support for gen_domain configure on bluefire - M models/lnd/clm/test/system/test_driver.sh - -- move tests to clmTest directory on /glade/scratch - M models/lnd/clm/test/system/CLM_runcmnd.sh - -- just indent diffs - M models/lnd/clm/tools/mksurfdata_map/src/mkfileMod.F90 - -- handle all files as large files (from ne240 runs) - M models/lnd/clm/bld/configure - -- add dependency for pio piovdf.o: pio_kinds.o - -- remove -lgptl from cesm Makefile - -== added r01 maps to namelist_defaults_clm.xml == - - M clm.buildnml.csh - M namelist_files/namelist_defaults_overall.xml - -- modified namelist_defaults_overall.xml to take wus12 and us20 with rmt off - -- also added ne240 and default gx1v6 ocean mask - -- modes to bld/clm.buildnml.csh so that rtm is off for wus12 - -- added path and script name to xml generated by createMapEntry.pl - -- checked wus12_wus12 run. Configures and runs. Error message to look for is: - - "Do not run the River Transport Model (RTM)" which is correct since wus12_wus12 is - a regional grid - -== modify scripts and drv to get new r01 to gx1v6 mapping files == - M scripts/ccsm_utils/Case.template/config_grid.xml - M scripts/ccsm_utils/Case.template/config_definition.xml - M models/drv/bld/namelist_files/namelist_defaults_drv.xml - -- namelist_defaults_drv.xml - added rof_grid for r01 and gx1v6 - -== modify xml so that 1/10 degree runs work == - M models/lnd/clm/tools/mkmapdata/mkmapdata.sh - M models/lnd/clm/tools/mkmapgrids/mkmapgrids.namelist - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - M models/lnd/clm/src/riverroute/RtmMod.F90 - -Summary of testing: - - build-namelist unit testing: - All PASS except: - fails involve us20 and wus12 - not ok 141 - lnd_in file the same as expected for CN - 94x192 - fixed. Should pass in next tag. - not ok 214 - lnd_in file exists - us20 - no tests in place - not ok 219 - lnd_in file exists - wus12 - no tests in place - not ok 221 - compare file lnd_in DNE for CN and -res+wus12 - wus12 - no tests in place - not ok 222 - compare file temp_file.txt DNE for CN and -res+wus12 - wus12 - no tests in place - bluefire: - All PASS except: - 018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 - modified to -3+-3 -- still FAIL - 036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 - 037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 - 038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 - 039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 - 036-039 needs major work - - and why they fail... - - 018 - cprnc differences in comparison - 036 - endrun initiated from CNBalanceCheckMod.F90 - 037 - __cnbalancecheckmod_NMOD_cbalancecheck - 038, 039 - fail since 037 didn't run - - bluefire interactive testing: - All PASS except: - bl514 - will fail because tag 45 has a broken gen_domain build - bl954 - no ne240 in tag 45 - bl9C4 - 8 bit difference in file size due to using large file write in mkfileMod.F90 - These should pass in next tag - bluefire/CESM testing: - All PASS except: - FAIL SMS_RLA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_45 - FAIL SMS_RLB.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_45 - FAIL SMS_ROA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_45 - FAIL ERS_D.f45_g37.I.bluefire_ibm.tputcomp.clm4_0_45 - FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.tputcomp.clm4_0_45 - FAIL ERS_E.T31_g37.I1850.bluefire_ibm.tputcomp.clm4_0_45 - FAIL ERI.T31_g37.IG1850.bluefire_ibm.tputcomp.clm4_0_45 - FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.tputcomp.clm4_0_45 - FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.tputcomp.clm4_0_45 - FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.tputcomp.clm4_0_45 - - There is tolerance check built into the tests that may be too tight. Jay will look at this in the future. - Throughputs are reported and a sampling looks reasonable: - - CHECK SMS_RLA.f45_f45.I.bluefire_ibm.perf npes=1 tput=16.026 memh=259.677 memr=-0.001 tag=clm4_0_45 baseline - CHECK SMS_RLA.f45_f45.I.bluefire_ibm.perf npes=1 tput=9.392 memh=259.856 memr=-0.001 tag= - - CHECK SMS.f10_f10.IRCP45CN.bluefire_ibm.perf npes=16 tput=200.866 memh=265.074 memr=-0.001 tag=clm4_0_45 baseline - CHECK SMS.f10_f10.IRCP45CN.bluefire_ibm.perf npes=16 tput=187.881 memh=267.630 memr=-0.001 tag= - - CHECK ERS_D.f19_g16.IRCP85CN.bluefire_ibm.perf npes=64 tput=29.741 memh=292.035 memr=-0.001 tag=clm4_0_45 baseline - CHECK ERS_D.f19_g16.IRCP85CN.bluefire_ibm.perf npes=64 tput=28.368 memh=294.879 memr=-0.001 tag= - - bluefire/PTCLM testing: - lynx/pgi testing: - lynx/pgi interactive testing:All PASS - lynx/CESM testing:All PASS - mirage,storm/ifort interactive testing:All PASS - -CLM tag used for the baseline comparison tests if applicable: CLM4_0_45 - -Changes answers relative to baseline:No - -=============================================================== -=============================================================== -Tag name: clm4_0_45 -Originator(s): sacks (Sacks Bill 303-497-1762 CGD) -Date: Fri Jul 20 11:41:14 MDT 2012 -One-line Summary: fix virtual columns; new urban mksurfdata_map - -Purpose of changes: - -GLC-related: Fix places where glc virtual columns were not being treated -correctly (major bug!). Change albice default to 0.6,0.4 for glc_mec -cases, based on suggestion from Bill Lipscomb. Fix dust calculation for -glc_mec. - -Other CLM changes: Add an instance of istcrop. Fix landunit-level output -for dov2xy=false. - -Tools changes: Update mksurfdata_map to handle new urban raw data format -(use dominant density class, together with lookup tables; currently used -for mksurfdata_map with hires). Minor fixes to mksurfdata_map. Add unit -tests to mksurfdata_map. Change tools build to support addition of unit -tests. Minor fixes to mkscripgrid.ncl, mkunitymap.ncl and mknoocnmap.pl. - -Namelist-related: Refer to correct scrip grid files for f09, f19; and -a few fixed mapping files for those resolutions, including clm->rtm mapping -files for those resolutions (changes answers for RTM). (The old scrip grid -files had a displaced pole, which is not what we want for CLM. Note that I -did NOT replace the f05 scrip grid file, because the only alternative I can -find has bad values in the corner arrays -- see bug 1518.) - -SPM--Mostly changes to get more tests to pass. Added 1x1_* mapping files to -inputdata. Created script that auto-generates XML for new mapping files for -easier inclusion into existing XML files. Modify build-namelist_test.pl to -pass CSMDATA to build-namelist. Tests were failing if a user didn't have -CSMDATA env set. Touched CFGtools__ds to get a CLM interactive test to pass. -Added openMP and debug openMP tests for bluefire interactive tests for 10x15. ---SPM - -Requirements for tag: test on bluefire (CESM, int, bat), lynx/pgi (int,bat), mirage. -Fix bug 1492 - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1492 (missing istcrop) - 1515 (nedd mapping files for - single-point)-SPM - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - - Makefiles reorganized for tools (mksurfdata_map, interpinic, mkmapgrids) - -Describe any changes made to the namelist: - - albice changed to 0.6,0.4 for glc_mec cases - -List any changes to the defaults for the boundary datasets: - - Use corrected mapping files for CLM->RTM for f09,f19, and for some - mapping files used to create surface datasets. Use correct scrip grids - for f09,f19. Add new urban raw data file for hires mksurfdata_map, and - associated scrip grid file & mapping files. - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - -List all files eliminated: - ->>>>>>> Split into mkurbanparCommonMod, mkurbanparAvgMod and mkurbanparDomMod -D models/lnd/clm/tools/mksurfdata_map/src/mkurbanparMod.F90 - ->>>>>>> Modify build system to make it easier to add unit testers -D models/lnd/clm/tools/mksurfdata_map/src/Macros.custom -D models/lnd/clm/tools/interpinic/src/Macros.custom -D models/lnd/clm/tools/mkmapgrids/src/Macros.custom - - -List all files added and what they do: - ->>>>>>> SPM-- Dump XML of mappings for a specified resolution -A namelist_files/createMapEntry.pl ->>>>>>> --SPM - - ->>>>>>> Pull out routines from mkurbanparMod that are common to different ->>>>>>> ways of creating urban parameter data -A models/lnd/clm/tools/mksurfdata_map/src/mkurbanparCommonMod.F90 - ->>>>>>> Modules to handle old (area-average) and new (dominant-type) urban ->>>>>>> input files -A models/lnd/clm/tools/mksurfdata_map/src/mkurbanparAvgMod.F90 - mostly from mkurbanparMod -A models/lnd/clm/tools/mksurfdata_map/src/mkurbanparDomMod.F90 - new code, to handle new format - ->>>>>>> New modules with general-purpose utilities for mksurfdata_map -A models/lnd/clm/tools/mksurfdata_map/src/mkutilsMod.F90 -A models/lnd/clm/tools/mksurfdata_map/src/mkindexmapMod.F90 - ->>>>>>> New unit testers for mksurfdata_map -A models/lnd/clm/tools/mksurfdata_map/unit_testers -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_lookup_2d_netcdf.nc -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_mkutilsMod.F90 -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_mkindexmapMod.F90 -A models/lnd/clm/tools/mksurfdata_map/unit_testers/Srcfiles -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_mod.F90 -A models/lnd/clm/tools/mksurfdata_map/unit_testers/Filepath -A models/lnd/clm/tools/mksurfdata_map/unit_testers/Makefile -A models/lnd/clm/tools/mksurfdata_map/unit_testers/README -A models/lnd/clm/tools/mksurfdata_map/unit_testers/test_mkurbanparDomMod.F90 - ->>>>>>> Modify build system to make it easier to add unit testers -A models/lnd/clm/tools/mksurfdata_map/src/Makefile.common -A models/lnd/clm/tools/mkmapgrids/src/Makefile.common -A models/lnd/clm/tools/interpinic/src/Makefile.common - - -List all existing files that have been modified, and describe the changes: - ->>>>>>> SPM-- ->>>>>>> Pass csmdata down to build-namelist and add logic so CSMDATA is set ->>>>>>> even if user does not -M unit_testers/build-namelist_test.pl ->>>>>>> Add support for 1x1_* single point mapping files -M namelist_files/namelist_defaults_clm.xml -M namelist_files/namelist_defaults_clm_tools.xml ->>>>>>> Add support for a few openMP 10x15 tests, modify test list ->>>>>>> and remove some old single point tests -M test/system/tests_pretag_bluefire_nompi -M test/system/input_tests_master -M test/system/tests_posttag_nompi_regression - ->>>>>>> --SPM - ->>>>>>> Fix glc virtual column bugs: change checks of (wt > 0) ->>>>>>> to (wt > 0 .or. ityplun(l)==istice_mec) -M models/lnd/clm/src/main/histFileMod.F90 ---------- also fix landunit-level fields - with dov2xy=.false. -M models/lnd/clm/src/main/subgridAveMod.F90 -M models/lnd/clm/src/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - also change - 'if (itypelun==istice)' to 'if (itypelun==istice .or. itypelun==istice_mec)' - in setting parameters -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 - ->>>>>>> Add istcrop (fix bug 1492) -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - ->>>>>>> Remove unnecessary 'use' -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 - ->>>>>>> Change albice to 0.6,0.4 for glc_mec cases; add mapping files for ->>>>>>> 3x3min_LandScan2004; use corrected mapping files for 5x5min_ISRIC-WISE_to_0.9x1.25, ->>>>>>> 3x3min_MODIS_to_0.9x1.25 and 5x5min_nomask_to_1.9x2.5, as well as for CLM->RTM ->>>>>>> for f09 and f19 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - ->>>>>>> Point to correct files for f09,f19 scrip grids; add new urban raw data file ->>>>>>> for hires mksurfdata_map -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - ->>>>>>> Add support for new 3x3min_LandScan2004 grid -M models/lnd/clm/tools/mkmapdata/mkmapdata.sh -M models/lnd/clm/bld/namelist_files/checkmapfiles.ncl -M models/lnd/clm/bld/namelist_files/namelist_definition.xml - ->>>>>>> Changes to mksurfdata_map to support new input urban format -M models/lnd/clm/tools/mksurfdata_map/src/Srcfiles ------ add new source files -M models/lnd/clm/tools/mksurfdata_map/src/mksurfdat.F90 - use new urban interfaces; - also, substantially increase tolerance for roundoff error fix in - normalizencheck_landuse (the latter change is unrelated to the new urban - format; this change makes it so more points have 100% special rather than - nearly-100% special, which was required to avoid CLM termination due to - rounding errors in some cases) -M models/lnd/clm/tools/mksurfdata_map/src/mkfileMod.F90 - add URBAN_DENSITY_CLASS - and URBAN_REGION_ID fields -M models/lnd/clm/tools/mksurfdata_map/src/mkncdio.F90 --- public declarations of - routines that are now needed - ->>>>>>> Other, incidental changes to mksurfdata_map -M models/lnd/clm/tools/mksurfdata_map/src/mkpftMod.F90 ---- fix zero_out -M models/lnd/clm/tools/mksurfdata_map/src/mkglcmecMod.F90 - correct rounding errors - in topoglcmec_o; change a warning to a fatal error -M models/lnd/clm/tools/mksurfdata_map/src/mkdomainMod.F90 - add tolerance in - checking for lat/lon equality - ->>>>>>> Add src_grid_dims & dst_grid_dims -M models/lnd/clm/tools/mkmapdata/mkunitymap.ncl - ->>>>>>> Fix direction of ocn->atm mapping file -M models/lnd/clm/tools/mkmapdata/mknoocnmap.pl -M models/lnd/clm/tools/README ------------------ also fix typos - ->>>>>>> Fix ordering of corners -M models/lnd/clm/tools/mkmapgrids/mkscripgrid.ncl - ->>>>>>> Modify build system to make it easier to add unit testers -M models/lnd/clm/tools/mksurfdata_map/src/Makefile -M models/lnd/clm/tools/interpinic/src/Makefile -M models/lnd/clm/tools/mkmapgrids/src/Makefile -M models/lnd/clm/test/system/TCBtools.sh ----------- copy correct file - ->>>>>>> Document copy of test_mod -M models/lnd/clm/tools/README.filecopies - - -Summary of testing: - ---SPM. New tests run after update to clm4_0_44 and after tests modifications. - -==== bluefire build-namelist tests: ==== - - * expected fail due to new mapping file - < fmapinp_rtm = '/glade/proj3/CESM/cseg/inputdata//lnd/clm2/mappingdata/maps/1.9x2.5/map_1.9x2.5_nomask_to_0.5x0.5_nomask_aave_da_c120522.nc' - --- - > fmapinp_rtm = '/glade/proj3/CESM/cseg/inputdata//lnd/clm2/mappingdata/maps/1.9x2.5/map_1.9x2.5_nomask_to_0.5x0.5_nomask_aave_da_c120221.nc' - - * not ok 6 - lnd_in file the same as expected for standard - not ok 23 - lnd_in file the same as expected for standard - -This is expected. Bill states this mod in ChangeLog - - < albice = 0.60,0.40 - --- - > albice = 0.50,0.50 - - * not ok 29 - lnd_in file the same as expected for standard - * not ok 36 - lnd_in file the same as expected for standard - * not ok 43 - lnd_in file the same as expected for standard - * not ok 49 - lnd_in file the same as expected for standard - * not ok 54 - lnd_in file the same as expected for standard - * not ok 59 - lnd_in file the same as expected for standard - * not ok 64 - lnd_in file the same as expected for standard - * not ok 69 - lnd_in file the same as expected for standard - * not ok 74 - lnd_in file the same as expected for standard - * not ok 80 - lnd_in file the same as expected for standard - * not ok 85 - lnd_in file the same as expected for standard - * not ok 91 - lnd_in file the same as expected for standard - * not ok 156 - lnd_in file the same as expected for CN - * not ok 161 - lnd_in file the same as expected for CN - - 221 and 222 are for new WRF tests, ignoring for now since tests not complete - not ok 221 - compare file lnd_in DNE for CN and -res+wus12 - # in NMLTest/CompFiles.pm at line 103. - WARNING(NMLTest::CompFiles::comparefiles):: File /glade/scratch/muszala/svn/clm4_0_44/models/lnd/clm/bld/unit_testers/temp_file.txt.CN.-res+wus12 - does NOT exist! - - not ok 222 - compare file temp_file.txt DNE for CN and -res+wus12 - -WARNING(NMLTest::CompFiles::comparefiles):: File /glade/scratch/muszala/svn/clm4_0_44/models/lnd/clm/bld/unit_testers/temp_file.txt.CN.-res+wus12 - 2349 does NOT exist! - - # Failed test 'compare file temp_file.txt DNE for CN and -res+wus12 - # ' - # in NMLTest/CompFiles.pm at line 103. - - * not ok 276 - lnd_in file the same as expected for crop - -==== bluefire interactive ==== - now pass due to new mapping files (ignore numbering, use test descriptor) -001 sm514 TSMCFGtools.sh gen_domain CFGtools__ds T31.runoptions .................................PASS -002 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds PASS -003 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dPASS -004 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds PASS - - new tests and test descriptors for 10x15 openMP tests -001 sm953 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__o .......PASS -002 bl953 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__o .......SKIPPED* -003 sm954 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......PASS -004 bl954 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......SKIPPED* -005 sm957 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__do ......PASS -006 bl957 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__do ......SKIPPED* -007 sm959 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................PASS -008 bl959 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................SKIPPED* - ---SPM - -NOTE: UNLESS OTHERWISE NOTED, THE BELOW TESTS WERE RUN FROM TAG -virtual_column_fix_03_clm4_0_43. This means that they were run before -reverting the scrip grid file & rtm mapping file for f05. However, that -shouldn't change any test results, since as far as I can tell, nothing in -the CLM test suite tests f05 resolution. THESE TESTS SHOULD BE RERUN ON THE -FINAL VERSION OF THE TAG BEFORE MERGING IT TO THE TRUNK. - - bluefire build-namelist unit testing (run with -test): ALL PASS EXCEPT: -not ok 42 - rtm tstep inconsistent - bluefire mksurfdata_map unit testing: ALL PASS - bluefire: All PASS except: -015 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:1800 1.9x2.5 gx1v6@1850-2100 -10 cold FAIL! rc= 7 -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 -039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 -043 blCn1 TBL.sh _sc_dh clm_transient_glcMEC_rcp8.5 20331231:1800 1.9x2.5 gx1v6@1850-2100 48 arb_ic FAIL! rc= 7 -049 smCI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -050 erCI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -051 brCI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -052 blCI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except: -028 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -046 blC63 TBL.sh _sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ........................FAIL! rc= 7 -054 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 7 -061 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -062 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -069 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 5 -076 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -077 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -078 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -079 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -080 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -081 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except: -BFAIL PST.f45_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL PET_PT.f45_g37.I1850.bluefire_ibm.compare_hist.clm4_0_43 -FAIL ERI.T31_g37.IG1850.bluefire_ibm.compare_hist.clm4_0_43 -FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.compare_hist.clm4_0_43 -FAIL ERP.f19_g16.IGRCP60CN.bluefire_ibm.compare_hist.clm4_0_43 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL PST.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_43 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.compare_hist.clm4_0_43 - bluefire/PTCLM testing: NOT DONE! - lynx/pgi testing: All PASS - lynx/pgi interactive testing: All PASS except: -023 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 -024 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -025 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - lynx/CESM testing: All PASS except: -CFAIL ERI.f10_f10.IRCP60CN.lynx_pathscale.C.123047 -BFAIL PST.f19_g16.I.lynx_pgi.compare_hist.clm4_0_43 -FAIL ERS.f19_g16.IRCP26CN.lynx_gnu.compare_hist.clm4_0_43 -FAIL ERS.f19_g16.IG1850.lynx_pgi.compare_hist.clm4_0_43 - mirage,storm/ifort interactive testing: All PASS - - Additional testing: Additional CESM B compset tests to test new RTM - mapping files. Ran these from cesm1_1_alpha13e; for most tests, switched - clm to virtual_column_fix_03_clm4_0_43; for the lynx f05 test, switched - clm to virtual_column_fix_04_clm4_0_43. Note that the baseline - comparisons are expected to fail, except for the f05 test. -PASS ERI.f19_g16.BRCP45WCN.bluefire_ibm -FAIL ERI.f19_g16.BRCP45WCN.bluefire_ibm.compare_hist.cesm1_1_alpha13e -PASS ERS.f19_g16.B2000CNCHM.bluefire_ibm -FAIL ERS.f19_g16.B2000CNCHM.bluefire_ibm.compare_hist.cesm1_1_alpha13e -PASS SMS_D.f19_g16.B20TRC5.bluefire_ibm -FAIL SMS_D.f19_g16.B20TRC5.bluefire_ibm.compare_hist.cesm1_1_alpha13e -PASS ERS.f09_g16.B1850BPRP.bluefire_ibm -FAIL ERS.f09_g16.B1850BPRP.bluefire_ibm.compare_hist.cesm1_1_alpha13e -PASS SMS_D.f19_g16.B20TRC5.lynx_pgi -FAIL SMS_D.f19_g16.B20TRC5.lynx_pgi.compare_hist.cesm1_1_alpha13e -PASS SMS.f05_g16.B.lynx_pgi -PASS SMS.f05_g16.B.lynx_pgi.compare_hist.cesm1_1_alpha13e - - -CLM tag used for the baseline comparison tests if applicable: clm4_0_43; -for my additional CESM tests, compared against cesm1_1_alpha13e - -Changes answers relative to baseline: YES, for GLC configurations and all -f09 & f19 configurations with RTM - - Baseline failures that are not because of GLC or RTM mapping file changes - are: - ->>> also failed in clm4_0_43; fails with "build-namelist ERROR:: bad input to drv_runlength option" -028 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 ->>> I think the problem here is that the baseline test is trying to build interpinic from the current directory, ->>> rather than from BL_ROOT. This is a problem because of changes in the tools' build. -069 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 5 - - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: - all GLC configurations (albice change & virtual column bug fix) - - all f09 & f19 configurations with RTM (due to change in RTM mapping file) - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - For GLC: climate-changing - - For f09/f19 due to RTM mapping file change: Larger than roundoff, but - expected to have same climate. The new scrip grid files have - roundoff-level differences globally, plus differ substantially at the - poles because the old (incorrect) files had poles displaced from - -90/90. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - platform/compilers: - - compset (and additional configure options): - - build-namelist options (or complete namelist): - - MSS location of output: - - EVALUATION OF NEW CLIMATE NOT PERFORMED - -=============================================================== -=============================================================== -Tag name: clm4_0_44 -Originator(s): erik (Erik Kluzek) -Date: Mon Jul 9 11:14:11 MDT 2012 -One-line Summary: Add wrf resolutions, update externals to cesm1_1_beta15, all components use build-namelist now - -Purpose of changes: - -set nsegspc=1 for all ne grids. Update to latest externals and new datm. Latest externals -have ALL components using a build-namelist, and user_nl.$COMP files are created for you. -Env files changed most fields in env_conf moved to env_run and secondly env_build. -env_mach_pes moved to env_configure. env_conf removed. Add ne4, ne16, ne60 datasets. Add -in ne16, ne30, ne120 20th Century datasets. Change of templates to have -clm.buildnml.csh and clm.buildexe.csh copied to Buildconf. Have -chk_res option to -build-namelist to check for resolution/mask, -note option to include (or not) note on the -bottom of the namelist. Expand build-namelist unit test. - -Requirements for tag: - Requirements: test on bluefire (CESM, int, bat) - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1513 (mksurfdata.pl doesn't work with -crop flag) - 1514 (inconsistancy in char variable fexcl) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (PTS_MODE can NOT use a global finidat file) - 1017 (PTS_MODE can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1474 (Missing eulerian domain files) - 1479 (fails on jaguarpf) - 1485 (Performance issue with esmf_wrf_timemgr) - 1488 (Problem reading restarts@ne30_g16 for some layouts) - 1517 (Performance of datm in clm4_0_44 is even worse) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Yes! - env*.xml files changed as follows: - - env_conf.xml ------> removed! - Most variables moved to env_run.xml. Some variables moved to env_build.xml - env_mach_pes.xml --> Renamed to env_configure.xml - - Buildconf directory ---> think of it as readonly! -Describe any changes made to the namelist: Yes! - - user_nl_* files for ALL components created for you. Put, your changes to namelists - files here. - - New options to clm build-namelist: - (all but -chk_res and -note are already exercised when running CESM) - -chk_res ------- Check resolution and land mask first. - -clm_startfile - Input file to use to startup for branch or startup cases. - -co2_type ------ CO2 type - -inst_string --- Instance string to use for clm_startfile for multi-instance cases. - -l_ncpl -------- Number of coupling time-steps to take per day. - -lnd_frac ------ Land fraction file to use (domain file) - -note ---------- Write out note about build-namelist usage to end of file. - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: Yes! - Most of the throughput tests fail, and single-point performance looks horrible. - Although this may be a sporatic problem due to file systems. See bug 1517. - -Code reviewed by: self, mvertens, tcraig - -List any svn externals directories updated (csm_share, mct, etc.): - Update to cesm1_1_beta15 external versions (other than timing) - scripts to scripts4_120604 - Machines to Machines_120529 - drv to drvseq4_1_15 - datm to datm8_120528 - csm_share to share3_120509 - mct to MCT2_8_0_120503 - pio to pio_1_4_5 - stubs to cism1_120529 - esmf_wrf_timemgr to esmf_wrf_timemgr_120427 - mapping to mapping_120525 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>> Add tools testers for directories that use CESM configure - A models/lnd/clm/test/system/TCBCFGtools.sh - A models/lnd/clm/test/system/TSMCFGtools.sh - A models/lnd/clm/test/system/TBLCFGtools.sh - - A models/lnd/clm/bld/unit_testers/NMLTest/CompFiles.pm - New test module - - A models/lnd/clm/test/system/nl_files/mksrfdt_T31_crpglc_2000 - mksurfdata crop test - ->>>>>>>>>>>> Split out buildexe/buildnml from template so that editing templates ->>>>>>>>>>>> isn't a nightmare - A models/lnd/clm/bld/clm.buildexe.csh - A models/lnd/clm/bld/clm.buildnml.csh - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Change tests a bit add a global crop test, get working on mirage - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/CLM_runcmnd.sh --- Allow hostname==vpn* for yong - M models/lnd/clm/test/system/test_driver.sh ---- Add TOOLSLIBS TOOLS_CONF_STRING - if hostname=vpn* use setup for yong - M models/lnd/clm/test/system/input_tests_master Fix test blCK8, add global - crop test case for mksurfdata, add cfg-tool tests - M models/lnd/clm/test/system/TSM.sh ------------ Add cpl.log file - M models/lnd/clm/test/system/TCBtools.sh ------- Set SLIBS needed on generic machines - - M models/lnd/clm/tools/mkmapdata/mkmapdata.sh ------- Use different version of ESMF - for regional, don't do RTM maps for regional - M models/lnd/clm/tools/interpinic/src/Makefile ------ Use NETCDF4 link - M models/lnd/clm/tools/mkmapgrids/src/Makefile ------ Use NETCDF4 link - M models/lnd/clm/tools/mksurfdata_map/src/Makefile -- Use NETCDF4 link - M models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl - Send crop setting for - determining LAI file - ->>>>>>>>>>>> Add CESM options to build-namelist, add handling of SLIBS for generic ->>>>>>>>>>>> machines. Add new grids: wrf, ne4, ne16, ne60. Set nsegspv=1 for hi-res/ne ->>>>>>>>>>>> grids. Use drv/datm namelist definition/defaults files. Extend ->>>>>>>>>>>> build-namelist unit tester test ALL resolutions/use-cases. - M models/lnd/clm/bld/configure ---- Add ability to handle slibs - M models/lnd/clm/bld/user_nl_clm -- Format change - M models/lnd/clm/bld/config_files/config_definition.xml - slibs, wrf grids - M models/lnd/clm/bld/build-namelist ---------- Add a bunch of options needed for CESM - (all but -chk_res and -note are already exercised when running CESM) - -chk_res ------- Check resolution and land mask first. - -clm_startfile - Input file to use to startup for branch or startup cases. - -co2_type ------ CO2 type - -inst_string --- Instance string to use for clm_startfile for multi-instance cases. - -l_ncpl -------- Number of coupling time-steps to take per day. - -lnd_frac ------ Land fraction file to use (domain file) - -note ---------- Write out note about build-namelist usage to end of file. - namelist definition/defaults files also come from drv/bld and datm/bld, get working - with latest externals - M models/lnd/clm/bld/clm.cpl7.template ------- Use new - clm.buildnml.csh/clm.buildexe.csh scripts which save us from the "\" nightmare - M models/lnd/clm/bld/queryDefaultNamelist.pl - namelist_defaults/definition files - are now split out in datm/drv directories - M models/lnd/clm/bld/queryDefaultXML.pm ------ definition files are an array now - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - Test a ton more - things. Add -compare, -test, -generate options. Test all use_cases and all - resolutions - M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl ------ Add some more resolutions - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Get rid of drv/datm - namelist items - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl - Get rid of drv/datm - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Add chk_res, note - and default masks for WRF grids - M models/lnd/clm/bld/namelist_files/datm-build-namelist ----- Use datm namelist - defaults/definition files. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Set do_rtm for - regional grids to .false. Add wrf grids: us20, wus12. Add ne4, ne16, ne60 - files. Add 20th transient PFT for: ne16, ne30, ne60, ne120. Set nsegspc to 1 - for hi-res and ne grids. - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Domain files - for 512x1024, ne4, ne16, ne60, ne240, and us20, wus12. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Set crop - for LAI and vegtyp files - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml - Remove settings - already in drv/bld file - ->>>>>>>>>>>> Remove write(6 for write to iulog, remove unneeded writes ->>>>>>>>>>>> use shr_pio over seq_pio. Allow -180-180 form. - M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - remove write - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 - write to iulog - M models/lnd/clm/src/biogeochem/CNrestMod.F90 ------ use endrun not write(6 - M models/lnd/clm/src/main/ndepStreamMod.F90 -------- use shr_pio_getiotype - M models/lnd/clm/src/main/pftdynMod.F90 ------------ use endrun not write(6 - M models/lnd/clm/src/main/histFileMod.F90 ---------- use shr_pio_getiotype - dimension hist_excl* as max_namlen+2 - M models/lnd/clm/src/main/ncdio_pio.F90 ------------ use - shr_pio_getiotype/shr_pio_getiosys - M models/lnd/clm/src/main/surfrdMod.F90 ------------ remove write(6 statements - put write in "if ( masterproc )", if longitudes off by more than 300 - see if -180-180 form works - -Summary of testing: - - build-namelist unit testing: All PASS except... - us20 - bluefire: All PASS except... -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 -039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 -049 smCI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -050 erCI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -051 brCI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -052 blCI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -058 bl514 TBLCFGtools.sh gen_domain CFGtools__ds T31.runoptions .................................FAIL! rc= 4 -060 bl754 TBLtools.sh mksurfdata_map tools__s namelist ..........................................FAIL! rc= 5 -061 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -062 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -071 bl924 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds .....FAIL! rc= 5 -073 bl953 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................FAIL! rc= 7 -075 bl954 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......FAIL! rc= 5 -078 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -079 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -080 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -081 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -082 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -083 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except.. -FAIL ERI.T31_g37.IG1850.bluefire_ibm.tputcomp.clm4_0_43 -FAIL SMS_RLA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_43 -FAIL SMS_RLB.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_43 -FAIL SMS_ROA.f45_f45.I.bluefire_ibm.tputcomp.clm4_0_43 -FAIL ERS_D.f45_g37.I.bluefire_ibm.tputcomp.clm4_0_43 -FAIL SMS.1x1_numaIA.ICN.bluefire_ibm.tputcomp.clm4_0_43 -FAIL ERS_E.T31_g37.I1850.bluefire_ibm.tputcomp.clm4_0_43 -FAIL ERS_D.f19_g16.IGRCP26CN.bluefire_ibm.tputcomp.clm4_0_43 -FAIL SMS.f10_f10.IRCP45CN.bluefire_ibm.tputcomp.clm4_0_43 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire_ibm.tputcomp.clm4_0_43 -BFAIL PST.f45_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL PET_PT.f45_g37.I1850.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL ERI.T31_g37.IG1850.bluefire_ibm.generate.clm4_0_44 -BFAIL PST.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_43 -BFAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_43 - lynx/pgi testing: All PASS - lynx/pgi interactive testing: All PASS except... -024 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 -025 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -026 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - mirage,storm/ifort interactive testing: All PASS - -CLM tag used for the baseline comparison tests if applicable: clm4_0_43 - -Changes answers relative to baseline: No, bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_43 -Originator(s): sacks (Bill Sacks); erik (Erik Kluzek) -Date: Fri Apr 6 11:36:21 MDT 2012 -One-line Summary: Add diagnostic fields, modify some existing history fields - -Purpose of changes: - -Add new diagnostic fields to track snow and ice fluxes. Modify some soil-related fields to -only be averaged over vegetated landunits (from Dave Lawrence). Fix some diagnostic fields -that were incorrect, especially over lakes and urban areas. Change QICE to spval rather -than 0 over non-ice_mec landunits. Rename QMELT to QSNOMELT. Delete redundant QICEYR. Add -snow balance check from Keith Oleson. Add flexible handling of l2g_scale_type in -subgridAveMod, replacing 'urbanh' c2l_scale_type and adding new functionality. Modify -create_clm_s2x to only reference qflx_glcice in the run loop, not in initialization, -because it is now NaN in initialization. Update scripts and esmf_wrf_timemgr. Changes in -clm.cpl7.template from Tony. Add in unit_testers for build-namelist. Update to nsegspc -branch. New qtr-degree RTM file, updates to mkmapdata.sh so requires -r if -f set, -build-namelist changes to ensure rtm and glc options consistent, and updates of -documentation to the latest cesm1_0_4 release tag. Sets nsegspc in the namelist and for -ne30_g16 sets it to 5. Enhancements to baseline tests. - -Requirements for tag: test on bluefire (CESM, int, bat), lynx/pgi (int,bat), mirage. -Fix perf bug 1485, Fix ne30 issue 1488, Fix history dimension issue 1489 - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): - 1485 (Performance issue with esmf_wrf_timemgr) - 1488 (partial -- now works with nsegspc=5) - 1489 (history dimension issue) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (PTS_MODE can NOT use a global finidat file) - 1017 (PTS_MODE can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1474 (Missing eulerian domain files) - 1479 (fails on jaguarpf) - 1485 (Performance issue with esmf_wrf_timemgr) - 1488 (Problem reading restarts@ne30_g16 for some layouts) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - - Modified clm.cpl7.template to no longer copy lnd_in to the case directory - -Describe any changes made to the namelist: - - For glacierMEC, use QICE rather than QICEYR for annual history files - Set nsegspc to 5 for ne30np4 and the default of 20 otherwise - -List any changes to the defaults for the boundary datasets: - - Fix qtr-degree RTM mapping file name - -Describe any substantial timing or memory changes: - - Fixes bug 1485 (performance issue with esmf_wrf_timemgr) - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, - esmf_wrf_timemgr, cprnc - - scripts to scripts4_120329d - Machines to Machines_120406 - esmf_wrf_timemgr to esmf_wrf_timemgr_120327 - cprnc to cprnc_120405 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>> Enhancements to baseline tests, and post-processor for test results -A models/lnd/clm/test/system/get_cprnc_diffs.sh - Script used by TBL.sh and - TBLrst_tools.sh -A models/lnd/clm/test/system/show_var_diffs.sh -- Post-processor for baseline test - results - ->>>>>>> Add build-namelist unit_tester -A models/lnd/clm/bld/unit_testers -A models/lnd/clm/bld/unit_testers/build-namelist_test.pl - -List all existing files that have been modified, and describe the changes: - ->>>>>>> Use CSMDATA rather than HOME -M models/lnd/clm/test/system/nl_files/getregional - ->>>>>>> Require -res to be set if -f option used -M models/lnd/clm/tools/mkmapdata/mkmapdata.sh - ->>>>>>> Fix qtr-degree RTM map, set nsegspc, work on usability -M models/lnd/clm/bld/user_nl_clm ---- Add notes about setting some things - with build-namelist options -M models/lnd/clm/bld/build-namelist - Set nsegspc, make sure glc_grid, glc_smb - do_rtm, and maxpatch_glcmec aren't set inconsistently between user_nl_clm - and build-namelist options -M models/lnd/clm/bld/README --------- Add notes about new unit_testers -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- qtr-degree RTM - mapping file, and set nsegspc - ->>>>>>> Bring in documentation updates from cesm1_0_4_n05_clm4_0_32, notes on setting ->>>>>>> finidat, adding history fields list -M models/lnd/clm/doc/UsersGuide/special_cases.xml -M models/lnd/clm/doc/UsersGuide/preface.xml -M models/lnd/clm/doc/UsersGuide/clm_ug.xml -M models/lnd/clm/doc/UsersGuide/custom.xml -M models/lnd/clm/doc/UsersGuide/Makefile - ->>>>>>> Remove duplicate line -M models/lnd/clm/test/system/tests_pretag_bluefire - ->>>>>>> Use get_cprnc_diffs.sh; truly print diffs from last file with a failed comparison ->>>>>>> rather than just printing diffs if last comparison failed -M models/lnd/clm/test/system/TBL.sh -M models/lnd/clm/test/system/TBLrst_tools.sh - ->>>>>>> Use QICE rather than QICEYR for annual history files -M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml - ->>>>>>> no longer copy lnd_in to the case directory -M models/lnd/clm/bld/clm.cpl7.template - ->>>>>>> Add new variables for tracking snow and ice fluxes -M models/lnd/clm/src/main/clmtype.F90 -M models/lnd/clm/src/main/clmtypeInitMod.F90 ----------- Also changed init of btran - and fpsn to spval -M models/lnd/clm/src/main/histFldsMod.F90 -------------- Add some fields, add - c2l_scale_type or l2g_scale_type for others; rename QMELT to QSNOMELT; delete - QICEYR -M models/lnd/clm/src/main/histFileMod.F90 -------------- Time-constant fields just - averaged over certain land units; add handling of set_noglcmec for pft-level - variables. Also, use lon & lat rather than lonatm & latatm -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ------ Compute qflx_glcice_frz -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - Compute qflx_glcice_melt - and qflx_snofrz_col -M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 --- To get proper grid cell - averages, turn some locals into globals, and add calculation of additional - fields - ->>>>>>> Change QICE to spval rather than 0 over non-ice_mec landunits -M models/lnd/clm/src/biogeophys/clm_driverInitMod.F90 - ->>>>>>> Add snow balance check, fix water balance check for glc_dyntopo -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - Add calculation of - qflx_sl_top_soil, needed for snow balance check -M models/lnd/clm/src/main/pft2colMod.F90 ------------- Column-level averages of some - variables needed for snow balance check; also fixed average of qflx_evap_tot - for lakes - ->>>>>>> Only reference qflx_glcice in the run loop, not in initialization -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 - pass init argument -M models/lnd/clm/src/main/clm_glclnd.F90 ------ in init, qice remains 0 - ->>>>>>> Flexible handling of l2g_scale_type -M models/lnd/clm/src/main/clm_varcon.F90 ---- max_lunit parameter -M models/lnd/clm/src/main/subgridAveMod.F90 - new subroutines for concise handling - of l2g_scale_type; add checks for l2g_scale_type==spval; remove urbanh - c2l_scale_type - - - -Summary of testing: - - bluefire: All PASS except: -004 blC91 TBL.sh _sc_dh clm_std^nl_urb 20030101:3600 4x5 gx3v7 -6 arb_ic ........................FAIL! rc= 7 -008 blTZ1 TBL.sh 21p_cncrpsc_dh clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 7 -011 blD91 TBL.sh _persc_dh clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -015 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:1800 1.9x2.5 gx1v6@1850-2100 -10 cold FAIL! rc= 7 -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -019 blW51 TBL.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -5 cold .................FAIL! rc= 7 -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 7 -027 blHo1 TBL.sh 17p_cnsc_dh clm_drydep 20000101:1800 10x15 USGS@2000 -10 cold ..................FAIL! rc= 7 -031 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 7 -035 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 7 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 -039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 -043 blCn1 TBL.sh _sc_dh clm_transient_glcMEC_rcp8.5 20331231:1800 1.9x2.5 gx1v6@1850-2100 48 arb_ic FAIL! rc= 7 -044 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 2 -045 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 2 -046 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 2 -047 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 2 -051 blH#2 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 ne30np4 gx1v6@2000 48 startup .........FAIL! rc= 7 -053 smCI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -054 erCI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -055 brCI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -056 blCI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except: -008 blC97 TBL.sh _sc_do clm_spin^nl_urb 20030101:1800 4x5 gx3v7@1850 -6 arb_ic ..................FAIL! rc= 7 -012 blHS3 TBL.sh 17p_cnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .....FAIL! rc= 7 -028 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -034 blF93 TBL.sh 17p_sc_do clm_drydep^nl_voc 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 7 -038 blC83 TBL.sh _sc_do clm_std^nl_urb 20020115:3600 5x5_amazon navy -10 arb_ic .................FAIL! rc= 7 -046 blC63 TBL.sh _sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ........................FAIL! rc= 7 -054 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 7 -061 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -062 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -069 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 7 -075 bl9S4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................FAIL! rc= 5 -076 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -077 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -078 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -079 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -080 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -081 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except: -BFAIL PST.f45_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_42 -BFAIL PET_PT.f45_g37.I1850.bluefire_ibm.compare_hist.clm4_0_42 -BFAIL PST.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_42 -BFAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_42 - bluefire/PTCLM testing: Not done - lynx/pgi testing: All PASS except: -004 blC92 TBL.sh _sc_dm clm_std^nl_urb 20030101:3600 4x5 gx3v7 -6 arb_ic ........................FAIL! rc= 7 -007 blD92 TBL.sh _persc_dm clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -011 blF92 TBL.sh 17p_sc_dm clm_drydep^nl_voc 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 7 -015 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 7 -019 blL52 TBL.sh _sc_dm clm_std^nl_urb 20020115:1800 10x15 USGS 48 arb_ic .......................FAIL! rc= 7 - lynx/pgi interactive testing: All PASS except: -008 blTZ3 TBL.sh 21p_cncrpsc_do clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 7 -023 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 -024 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -025 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - lynx/CESM testing: All PASS except: -FAIL ERS_D.T31_g37.I1850.lynx_pgi.compare_hist.clm4_0_42 -FAIL ERS_D.T31_g37.I1850.lynx_pgi.compare_hist.clm4_0_42 -CFAIL ERI.f10_f10.IRCP60CN.lynx_pathscale.C.124327 -BFAIL PST.f19_g16.I.lynx_pgi.compare_hist.clm4_0_42 - mirage,storm/ifort interactive testing: All PASS except: -007 blD94 TBL.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -019 blL54 TBL.sh _sc_ds clm_std^nl_urb 20020115:1800 10x15 USGS 48 arb_ic .......................FAIL! rc= 7 -023 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 48 cold ............FAIL! rc= 7 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_42 - -Changes answers relative to baseline: Just changes some diagnostic fields - - Changes the following default history fields: TSOI, HCSOI, ZWT, WA, WT, H2OSOI, - SOILLIQ, SOILICE, SOILWATER_10CM, QICE, QSNWCPICE_NODYNLNDUSE, QSNWCPLIQ - - Renames QMELT to QSNOMELT - - Also changes some fields not output by default - - Also changes cpl avghist files due to changes in qflx_glcice in initialization, but - this doesn't affect the simulation - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change: diagnostic fields only - -=============================================================== -=============================================================== -Tag name: clm4_0_42 -Originator(s): erik (Erik Kluzek) -Date: Tue Mar 27 21:14:59 MDT 2012 -One-line Summary: Bring in Francis Vitt's MEGAN changes. - -Purpose of changes: - -Bring Francis Vitt's MEGAN branch to the trunk. Replace the five VOC -compounds with the MEGAN model that allows up to 150 compounds to be -generated and passed to the driver. The mechanism allows the fields to -be choosen by a driver namelist which CLM responds to. - -Requirements for tag: test on bluefire (CESM, int, bat), lynx/pgi (int,bat), mirage - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1459 (PTSMODE fails) - 1480 (Darwin_intel build) - 1482 (Problems running 1x1 resolutions for CLM) - 1484 (re-configure removes the user_nl_clm) - 1486 (bad irrigation maps) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (PTS_MODE can NOT use a global finidat file) - 1017 (PTS_MODE can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1474 (Missing eulerian domain files) - 1479 (fails on jaguarpf) - 1485 (Performance issue with esmf_wrf_timemgr) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - - Add new -megan option to CLM build-namelist to add a megan namelist to - the drv_flds_in file. - Rename -drv_drydep option to -drydep. - - New namelist items for MEGAN: megan_factors_file, megan_specifier, and - megan_mapped_emisfctrs go into the megan_emis_nl namelist in drv_flds_in - - History fields removed: BIOGENCO, ISOPRENE (replaced by MEG_isoprene), - MONOTERP, ORVOC, ORVOC, OVOC - - Units of VOCFLXT changed from uGC/M2/H to moles/m2/sec - - New history fields: - -+ GAMMAC = gamma C for VOC calc (0-1) -+ MEG_2met_2s = MEGAN flux (kg/m2/sec) -+ MEG_2met_nonatriene = MEGAN flux (kg/m2/sec) -+ MEG_2met_s = MEGAN flux (kg/m2/sec) -+ MEG_2met_styrene = MEGAN flux (kg/m2/sec) -+ MEG_3met_3DCTT = MEGAN flux (kg/m2/sec) -+ MEG_Ehsalate = MEGAN flux (kg/m2/sec) -+ MEG_MBO_2m3e2ol = MEGAN flux (kg/m2/sec) -+ MEG_MBO_3m2e1ol = MEGAN flux (kg/m2/sec) -+ MEG_MBO_3m3e1ol = MEGAN flux (kg/m2/sec) -+ MEG_Napthalene = MEGAN flux (kg/m2/sec) -+ MEG_PPPP_2s = MEGAN flux (kg/m2/sec) -+ MEG_acetaldehyde = MEGAN flux (kg/m2/sec) -+ MEG_acetic_acid = MEGAN flux (kg/m2/sec) -+ MEG_acetone = MEGAN flux (kg/m2/sec) -+ MEG_acoradiene = MEGAN flux (kg/m2/sec) -+ MEG_ammonia = MEGAN flux (kg/m2/sec) -+ MEG_anisole = MEGAN flux (kg/m2/sec) -+ MEG_aromadendrene = MEGAN flux (kg/m2/sec) -+ MEG_benzaldehyde = MEGAN flux (kg/m2/sec) -+ MEG_benzyl-acetate = MEGAN flux (kg/m2/sec) -+ MEG_benzyl-alcohol = MEGAN flux (kg/m2/sec) -+ MEG_bergamotene_a = MEGAN flux (kg/m2/sec) -+ MEG_bergamotene_b = MEGAN flux (kg/m2/sec) -+ MEG_bisabolene_a = MEGAN flux (kg/m2/sec) -+ MEG_bisabolene_b = MEGAN flux (kg/m2/sec) -+ MEG_bornene = MEGAN flux (kg/m2/sec) -+ MEG_borneol = MEGAN flux (kg/m2/sec) -+ MEG_bornyl_ACT = MEGAN flux (kg/m2/sec) -+ MEG_bourbonene_b = MEGAN flux (kg/m2/sec) -+ MEG_butanone_2 = MEGAN flux (kg/m2/sec) -+ MEG_butene = MEGAN flux (kg/m2/sec) -+ MEG_cadinene_d = MEGAN flux (kg/m2/sec) -+ MEG_cadinene_g = MEGAN flux (kg/m2/sec) -+ MEG_camphene = MEGAN flux (kg/m2/sec) -+ MEG_camphor = MEGAN flux (kg/m2/sec) -+ MEG_carbon_2s = MEGAN flux (kg/m2/sec) -+ MEG_carbon_monoxide = MEGAN flux (kg/m2/sec) -+ MEG_carbonyl_s = MEGAN flux (kg/m2/sec) -+ MEG_carene_3 = MEGAN flux (kg/m2/sec) -+ MEG_caryophyllene_b = MEGAN flux (kg/m2/sec) -+ MEG_cedrene_a = MEGAN flux (kg/m2/sec) -+ MEG_cedrol = MEGAN flux (kg/m2/sec) -+ MEG_cineole_1_8 = MEGAN flux (kg/m2/sec) -+ MEG_copaene_a = MEGAN flux (kg/m2/sec) -+ MEG_cubebene_a = MEGAN flux (kg/m2/sec) -+ MEG_cubebene_b = MEGAN flux (kg/m2/sec) -+ MEG_cymene_o = MEGAN flux (kg/m2/sec) -+ MEG_cymene_p = MEGAN flux (kg/m2/sec) -+ MEG_decanal = MEGAN flux (kg/m2/sec) -+ MEG_diallyl_2s = MEGAN flux (kg/m2/sec) -+ MEG_dodecene_1 = MEGAN flux (kg/m2/sec) -+ MEG_elemene_b = MEGAN flux (kg/m2/sec) -+ MEG_estragole = MEGAN flux (kg/m2/sec) -+ MEG_ethane = MEGAN flux (kg/m2/sec) -+ MEG_ethanol = MEGAN flux (kg/m2/sec) -+ MEG_ethene = MEGAN flux (kg/m2/sec) -+ MEG_farnescene_a = MEGAN flux (kg/m2/sec) -+ MEG_farnescene_b = MEGAN flux (kg/m2/sec) -+ MEG_fenchene_a = MEGAN flux (kg/m2/sec) -+ MEG_fenchone = MEGAN flux (kg/m2/sec) -+ MEG_formaldehyde = MEGAN flux (kg/m2/sec) -+ MEG_formic_acid = MEGAN flux (kg/m2/sec) -+ MEG_geranyl_acetone = MEGAN flux (kg/m2/sec) -+ MEG_germacrene_B = MEGAN flux (kg/m2/sec) -+ MEG_germacrene_D = MEGAN flux (kg/m2/sec) -+ MEG_gurjunene_b = MEGAN flux (kg/m2/sec) -+ MEG_heptanal = MEGAN flux (kg/m2/sec) -+ MEG_heptane = MEGAN flux (kg/m2/sec) -+ MEG_heptanone = MEGAN flux (kg/m2/sec) -+ MEG_hexanal = MEGAN flux (kg/m2/sec) -+ MEG_hexane = MEGAN flux (kg/m2/sec) -+ MEG_hexanol_1 = MEGAN flux (kg/m2/sec) -+ MEG_hexenal_c3 = MEGAN flux (kg/m2/sec) -+ MEG_hexenal_t2 = MEGAN flux (kg/m2/sec) -+ MEG_hexenol_c3 = MEGAN flux (kg/m2/sec) -+ MEG_hexenyl_ACT_c3 = MEGAN flux (kg/m2/sec) -+ MEG_homosalate = MEGAN flux (kg/m2/sec) -+ MEG_humulene_a = MEGAN flux (kg/m2/sec) -+ MEG_humulene_g = MEGAN flux (kg/m2/sec) -+ MEG_hydrogen_cyanide = MEGAN flux (kg/m2/sec) -+ MEG_hydrogen_s = MEGAN flux (kg/m2/sec) -+ MEG_indole = MEGAN flux (kg/m2/sec) -+ MEG_ionone_b = MEGAN flux (kg/m2/sec) -+ MEG_ipsenol = MEGAN flux (kg/m2/sec) -+ MEG_isolongifolene = MEGAN flux (kg/m2/sec) -+ MEG_isoprene = MEGAN flux (kg/m2/sec) -+ MEG_jasmone = MEGAN flux (kg/m2/sec) -+ MEG_limonene = MEGAN flux (kg/m2/sec) -+ MEG_linalool = MEGAN flux (kg/m2/sec) -+ MEG_linalool_OXD_c = MEGAN flux (kg/m2/sec) -+ MEG_linalool_OXD_t = MEGAN flux (kg/m2/sec) -+ MEG_longifolene = MEGAN flux (kg/m2/sec) -+ MEG_longipinene = MEGAN flux (kg/m2/sec) -+ MEG_met_benzoate = MEGAN flux (kg/m2/sec) -+ MEG_met_bromide = MEGAN flux (kg/m2/sec) -+ MEG_met_chloride = MEGAN flux (kg/m2/sec) -+ MEG_met_heptenone = MEGAN flux (kg/m2/sec) -+ MEG_met_iodide = MEGAN flux (kg/m2/sec) -+ MEG_met_jasmonate = MEGAN flux (kg/m2/sec) -+ MEG_met_mercaptan = MEGAN flux (kg/m2/sec) -+ MEG_met_propenyl_2s = MEGAN flux (kg/m2/sec) -+ MEG_met_salicylate = MEGAN flux (kg/m2/sec) -+ MEG_meta-cymenene = MEGAN flux (kg/m2/sec) -+ MEG_methane = MEGAN flux (kg/m2/sec) -+ MEG_methanol = MEGAN flux (kg/m2/sec) -+ MEG_muurolene_a = MEGAN flux (kg/m2/sec) -+ MEG_muurolene_g = MEGAN flux (kg/m2/sec) -+ MEG_myrcene = MEGAN flux (kg/m2/sec) -+ MEG_myrtenal = MEGAN flux (kg/m2/sec) -+ MEG_nerolidol_c = MEGAN flux (kg/m2/sec) -+ MEG_nerolidol_t = MEGAN flux (kg/m2/sec) -+ MEG_neryl_acetone = MEGAN flux (kg/m2/sec) -+ MEG_nitric_OXD = MEGAN flux (kg/m2/sec) -+ MEG_nitrous_OXD = MEGAN flux (kg/m2/sec) -+ MEG_nonanal = MEGAN flux (kg/m2/sec) -+ MEG_nonenal = MEGAN flux (kg/m2/sec) -+ MEG_ocimene_al = MEGAN flux (kg/m2/sec) -+ MEG_ocimene_c_b = MEGAN flux (kg/m2/sec) -+ MEG_ocimene_t_b = MEGAN flux (kg/m2/sec) -+ MEG_octanal = MEGAN flux (kg/m2/sec) -+ MEG_octanol = MEGAN flux (kg/m2/sec) -+ MEG_octenol_1e3ol = MEGAN flux (kg/m2/sec) -+ MEG_oxopentanal = MEGAN flux (kg/m2/sec) -+ MEG_pentanal = MEGAN flux (kg/m2/sec) -+ MEG_pentane = MEGAN flux (kg/m2/sec) -+ MEG_phellandrene_a = MEGAN flux (kg/m2/sec) -+ MEG_phellandrene_b = MEGAN flux (kg/m2/sec) -+ MEG_phenyl_CCO = MEGAN flux (kg/m2/sec) -+ MEG_pinene_a = MEGAN flux (kg/m2/sec) -+ MEG_pinene_b = MEGAN flux (kg/m2/sec) -+ MEG_piperitone = MEGAN flux (kg/m2/sec) -+ MEG_propane = MEGAN flux (kg/m2/sec) -+ MEG_propene = MEGAN flux (kg/m2/sec) -+ MEG_pyruvic_acid = MEGAN flux (kg/m2/sec) -+ MEG_sabinene = MEGAN flux (kg/m2/sec) -+ MEG_selinene_b = MEGAN flux (kg/m2/sec) -+ MEG_selinene_d = MEGAN flux (kg/m2/sec) -+ MEG_terpinene_a = MEGAN flux (kg/m2/sec) -+ MEG_terpinene_g = MEGAN flux (kg/m2/sec) -+ MEG_terpineol_4 = MEGAN flux (kg/m2/sec) -+ MEG_terpineol_a = MEGAN flux (kg/m2/sec) -+ MEG_terpinolene = MEGAN flux (kg/m2/sec) -+ MEG_terpinyl_ACT_a = MEGAN flux (kg/m2/sec) -+ MEG_tetradecene_1 = MEGAN flux (kg/m2/sec) -+ MEG_thujene_a = MEGAN flux (kg/m2/sec) -+ MEG_thujone_a = MEGAN flux (kg/m2/sec) -+ MEG_thujone_b = MEGAN flux (kg/m2/sec) -+ MEG_toluene = MEGAN flux (kg/m2/sec) -+ MEG_tricyclene = MEGAN flux (kg/m2/sec) -+ MEG_verbenene = MEGAN flux (kg/m2/sec) - -List any changes to the defaults for the boundary datasets: - Correct fpftdyn historical f05 dataset, and add rcp datasets - Fix irrig map for f19 and f10 - -Describe any substantial timing or memory changes: None - Although bug 1485 is NOT fixed! (4X performance hit due to updated esmf_wrf_timemgr!) - -Code reviewed by: self,fvitt - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, - drv, pio, cprnc, and cism - - scripts to scripts4_120323 - Machines to Machines_120323a - drv to drvseq4_1_04 - pio to pio_1_4_2 - cprnc to cprnc_120322 - cism to cism1_120322 - -List all files eliminated: None - -List all files added and what they do: - -A models/lnd/clm/bld/namelist_files/history_fields.xsl - Style sheet to view history_fields XML file -A + models/lnd/clm/src/biogeochem/MEGANFactorsMod.F90 ---- MEGAN factors file - -List all existing files that have been modified, and describe the changes: - ->>>>>>>> Remove PTS-MODE restart tests -M models/lnd/clm/test/system/tests_posttag_lynx_nompi -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi -M models/lnd/clm/test/system/tests_posttag_yong -MM models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi -M models/lnd/clm/test/system/tests_posttag_nompi_regression -M models/lnd/clm/test/system/test_driver.sh ----- Correct machine name for lynx -M models/lnd/clm/test/system/nl_files/nl_voc ---- Add megan namelist -M models/lnd/clm/test/system/nl_files/clm_drydep Add -megan option rename drydep -to drydep -M models/lnd/clm/test/system/input_tests_master - Tests with VOC must use - clm_drydep, make CA8 tests use drydep - -M models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES - update cprnc - -M models/lnd/clm/bld/configure --------- Change top level model from cesm to driver -M models/lnd/clm/bld/build-namelist ---- Add -megan option/namelist, rename - -drv_drydep to drydep, add checking for megan namelist items -M models/lnd/clm/bld/clm.cpl7.template - Fix multi-instance issues, and - don't overwrite user_nl_clm file if it already exists - -M models/lnd/clm/bld/namelist_files/namelist_definition.xml ----- Update driver - namelist items, add megan namelist, more fields to drydep_list, list - megan compounds -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml --- Add commented - out finidat file for f05, update f05 fpftdyn and add fpftdyn for f05 rcp's - update irrig 10x15 mapping file -M models/lnd/clm/bld/namelist_files/namelist_defaults_drydep.xml - Add defaults - for megan namelist - -M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - Change VOC fields to megan - fields -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 ------ Change VOC fields to megan - fields -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 ---- Change VOC fiels to megan -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 - Use Megan_factors_mod, - add VOCEmission_init, megan namelist determines the fields that will be - output rather than the 5 VOC fields -MM models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - More fields that can be - "mapped": 'SOAM', 'SOAI', 'SOAT', 'SOAB', 'SOAX' -M models/lnd/clm/src/main/clm_varpar.F90 ----------- Remove nvoc -M models/lnd/clm/src/main/clm_initializeMod.F90 ---- Add call to VOCEmission_init -M models/lnd/clm/src/main/clmtypeInitMod.F90 ------- Remove averaged voc fields -M models/lnd/clm/src/main/clm_atmlnd.F90 ----------- Remove voc add megan fields -M models/lnd/clm/src/main/findHistFields.pl -------- Add ability to handle new - megan fields -M models/lnd/clm/src/main/clm_driver.F90 ----------- Initialize cisun/cisha - to -999. each time-step for VOCEmission -M models/lnd/clm/src/main/ncdio_pio.F90 ------------ Changes from John Truesdale - so that PTS_MODE will work -M models/lnd/clm/src/main/clmtype.F90 -------------- VOC fields have extra - dimension remove averaged field -M models/lnd/clm/src/main/histFldsMod.F90 ---------- Remove specific VOC fields - add MEG_ fields - -Summary of testing: - - bluefire: All PASS except... -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 7 -027 blHo1 TBL.sh 17p_cnsc_dh clm_drydep 20000101:1800 10x15 USGS@2000 -10 cold ..................FAIL! rc= 7 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 -039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 -044 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 2 -045 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 2 -046 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 2 -047 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 2 - bluefire interactive testing: All PASS except -028 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -034 blF93 TBL.sh 17p_sc_do clm_drydep^nl_voc 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 7 -050 blHQ4 TBL.sh 17p_cnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold ............FAIL! rc= 7 -061 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -062 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -073 bl954 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......FAIL! rc= 6 -076 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -077 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -078 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -079 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -080 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -081 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except.. -BFAIL PST.f45_g37.I1850CN.bluefire_ibm.compare_hist.clm4_0_41 -BFAIL PET_PT.f45_g37.I1850.bluefire_ibm.compare_hist.clm4_0_41 -BFAIL SMS.1x1_numaIA.ICN.bluefire_ibm.compare_hist.clm4_0_41 -BFAIL ERP.1x1_mexicocityMEX.I.bluefire_ibm.compare_hist.clm4_0_41 -BFAIL PST.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_41 -BFAIL PET_PT.f10_f10.I20TRCN.bluefire_ibm.compare_hist.clm4_0_41 - bluefire/PTCLM testing: All FAIL - lynx interactive testing: ALL PASS up to... -023 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 - lynx/CESM testing: All PASS except.. -FAIL ERS_D.T31_g37.I1850.lynx_pgi.generate.clm4_0_42 -CFAIL ERI.f10_f10.IRCP60CN.lynx_pathscale.GC.121827 -BFAIL PST.f19_g16.I.lynx_pgi.compare_hist.clm4_0_41 -BFAIL ERS.1x1_vancouverCAN.I.lynx_pgi.compare_hist.clm4_0_41 - mirage,storm/ifort interactive testing: All PASS! - yong/darwin/ifort interactive testing: All PASS up to... -005 smCL4 TSM.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_41 - -Changes answers relative to baseline: bit-for-bit (except cases with MEGAN or VOC) - -=============================================================== -=============================================================== -Tag name: clm4_0_41 -Originator(s): erik (Erik Kluzek) -Date: Tue Mar 13 23:43:45 MDT 2012 -One-line Summary: Bring rmfmesh/rtmmap branches to trunk - -Purpose of changes: - -Get working with latest scripts and have clm template call build-namelist directly. Move -rmfmesh/rtmmap branch to trunk. Remove CASA completely. Start using RTM mapping files. -Allow bigger tolerance for mksurfdata_map frac up to 1.e-5 so can work for f4x5. New -half-degree mapping files. Remove code to calculate RTM mapping. Remove ability to set -maxpatch_pft to something different than numpft in CLM configure. Remove --ad_spinup/-exit_spinup options in configure make generic -spinup option with a few -allowed values (similar to the clm45sci version of configure). New 1850 fsurdat dataset -for ne240np4. Update externals to the latest, get test_driver working. - -Requirements for tag: test on bluefire (CESM,int,bat), lynx/pgi (CESM), mirage, -template calls build-namelist. Fix 1477, 1476, 1468, 1467 - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1477 (Bad f05 datasets) - 1476 (Problem with stand-alone build on bluefire) - 1468 (Bad f09, f19 SCRIP Grid files) - 1467 (Remove runinit_ibm.csh script) - 1449 (Remove fine-mesh) - 1448 (Remove CASA) - 1432 (Several resolutions fail for new mksurfdata_map) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1459 (PTSMODE fails) - 1474 (Missing eulerian domain files) - 1479 (fails on jaguarpf) - 1480 (Darwin_intel build) - 1482 (Problems running 1x1 resolutions for CLM) - 1485 (Performance issue with esmf_wrf_timemgr) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - Remove CASA option, don't allow maxpft to be set. - CESM scripts/Machines updated. - -Describe any changes made to the namelist: - - BuildConf/clm.buildnml.csh now becomes a script that simply calls the clm - build-namelist script to build your namelist. This means you effectively treat it - as a READ-only script that you don't put changes into! Instead you use - the "user_nl_clm" file to put your custom changes to the namelist into. - The use of user_nl_clm is documented in the CLM User's Guide at... - - http://www.cesm.ucar.edu/models/cesm1.0/clm/models/lnd/clm/doc/UsersGuide/x1423.html#config_time_nml - - Use preview_namelists to see full namelists that will be created. - -List any changes to the defaults for the boundary datasets: Activate RTM mapping files - New 1840 ne240 fsurdat file, replace all f05 mapping files, replace all f05 mapping - files, and f05, f09, and f19 SCRIP grid files - -Describe any substantial timing or memory changes: Yes! - Much less global memory needed now! Only one temporary global integer array - used. - - 4X performance hit due to updated esmf_wrf_timemgr! (see bug 1485) - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, - drv, csm_share, esmf_wrf_timemgr, datm - - scripts to datm8_120219 - Machines to Machines_120309 - drv to drvseq4_1_02 - csm_share to share3_120308 - esmf_wrf_timemgr to esmf_wrf_timemgr_120218 - datm to datm8_120219 - -List all files eliminated: - ->>>>>>> Eliminate stand-alone intrepid/kraken testing files, CASA, fine-mesh, ->>>>>>> and RTM mapping calc. Elimanate interpinic run script, too hard to support. -D models/lnd/clm/test/system/tests_posttag_intrepid -D models/lnd/clm/test/system/tests_posttag_intrepid_nompi -D models/lnd/clm/test/system/tests_posttag_kraken -D models/lnd/clm/tools/interpinic/runinit_ibm.csh -D models/lnd/clm/src/biogeochem/CASAPhenologyMod.F90 -D models/lnd/clm/src/biogeochem/CASAMod.F90 -D models/lnd/clm/src/main/CASAiniTimeVarMod.F90 -D models/lnd/clm/src/main/downscaleMod.F90 -D models/lnd/clm/src/riverroute/RtmMapMod.F90 - -List all files added and what they do: Add config defaults files for supported - single point datasets, add empty user_nl_clm file - -A + models/lnd/clm/bld/user_nl_clm -A + models/lnd/clm/bld/config_files/config_defaults_1x1_smallvilleIA.xml -A + models/lnd/clm/bld/config_files/config_defaults_1x1_mexicocityMEX.xml -A + models/lnd/clm/bld/config_files/config_defaults_1x1_numaIA.xml -A + models/lnd/clm/bld/config_files/config_defaults_1x1_vancouverCAN.xml - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>> Changes to config_file for changes to configure ->>>>>>>>>>>>> eliminate use of maxpft, ad_spinup and exit_spinup use spinup option -M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh -M models/lnd/clm/test/system/config_files/17p_cndvsc_m -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_m -M models/lnd/clm/test/system/config_files/17p_cndvsc_o -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_o -M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm -M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_s -M models/lnd/clm/test/system/config_files/17p_cndvsc_s -M models/lnd/clm/test/system/config_files/17p_sc_dh -M models/lnd/clm/test/system/config_files/17p_sc_dm -M models/lnd/clm/test/system/config_files/17p_sc_do -M models/lnd/clm/test/system/config_files/17p_sc_ds -M models/lnd/clm/test/system/config_files/17p_cnsc_h -M models/lnd/clm/test/system/config_files/21p_cncrpsc_h -M models/lnd/clm/test/system/config_files/17p_cnsc_dh -M models/lnd/clm/test/system/config_files/21p_cncrpsc_dh -M models/lnd/clm/test/system/config_files/21p_cncrpsc_m -M models/lnd/clm/test/system/config_files/17p_cnsc_m -M models/lnd/clm/test/system/config_files/17p_cnsc_o -M models/lnd/clm/test/system/config_files/21p_cncrpsc_o -M models/lnd/clm/test/system/config_files/17p_cnsc_dm -M models/lnd/clm/test/system/config_files/21p_cncrpsc_dm -M models/lnd/clm/test/system/config_files/17p_cnsc_do -M models/lnd/clm/test/system/config_files/17p_cnc13sc_dh -M models/lnd/clm/test/system/config_files/21p_cncrpsc_do -M models/lnd/clm/test/system/config_files/21p_cncrpsc_s -M models/lnd/clm/test/system/config_files/17p_sc_h -M models/lnd/clm/test/system/config_files/21p_cncrpsc_ds -M models/lnd/clm/test/system/config_files/17p_cnsc_ds -M models/lnd/clm/test/system/config_files/17p_cnc13sc_dm -M models/lnd/clm/test/system/config_files/17p_cnc13sc_do -M models/lnd/clm/test/system/config_files/17p_sc_m -M models/lnd/clm/test/system/config_files/17p_sc_o -M models/lnd/clm/test/system/config_files/17p_cnnfsc_dh -M models/lnd/clm/test/system/config_files/17p_cnnfsc_dm -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dh -M models/lnd/clm/test/system/config_files/17p_cndvsc_dh -M models/lnd/clm/test/system/config_files/17p_cnnfsc_do -M models/lnd/clm/test/system/config_files/17p_cndvsc_dm -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dm -M models/lnd/clm/test/system/config_files/17p_cndvsc_do -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_do -M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_ds -M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm -M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do -M models/lnd/clm/test/system/config_files/README -M models/lnd/clm/test/system/config_files/21p_cndvcrpsc_h -M models/lnd/clm/test/system/config_files/17p_cndvsc_h - ->>>>>>>>>>>>> Get working with latest scripts, eliminate intrepid. -M models/lnd/clm/test/system/TCB.sh --------- Send -comp to configure -M models/lnd/clm/test/system/test_driver.sh - Eliminate intrepid, get working - with latest CESM scripts/Machines, update env settings to Machines -M models/lnd/clm/test/system/CLM_runcmnd.sh - Eliminate intrepid -M models/lnd/clm/test/system/tests_pretag_bluefire - Correct test name - ->>>>>>>>>>>>> Eliminate CASA -M models/lnd/clm/tools/interpinic/src/interpinic.F90 -M models/lnd/clm/tools/mksurfdata_map/src/clm_varctl.F90 - ->>>>>>>>>>>>> Eliminate CASA, and maxpft. Read site specific config_defaults ->>>>>>>>>>>>> Change spinup option, get working with latest scripts. -M models/lnd/clm/bld/configure --------- Use clm45sci API (use -spinup in - place of ad_spinup/exit_spinup), read site specific config_defaults - file when sitespf_pt option is used. Eliminate CASA, and maxpft option. - Get configure working with latest CESM scripts. Add mct/pio subdirectory - for SMP=on/off so will build on bluefire. Add -comp option required - for new CESM scripts (for stand-alone test). -M models/lnd/clm/bld/build-namelist ---- Remove faerdep, use spinup from - configure rather than ad/exit_spinup, remove substition of CSMDATA - in filenames. -M models/lnd/clm/bld/clm.cpl7.template - Use sitespf_pt for regional case - when CLM_USRDAT NOT used and don't use clm_root in configure. -M models/lnd/clm/bld/config_files/config_sys_defaults.xml - Add comp settings - and change mach settings to NOT include compiler. Remove: dec_osf, - es, irix, solaris, super-ux, unicosmp as no longer tested on -M models/lnd/clm/bld/config_files/config_definition.xml --- Remove CASA option - mxpft can only be 17 or 21. Add comp, remove ad_spinup/exit_spinup - for spinup option. Change description of sitespf_pt option. - ->>>>>>>>>>>>> Eliminate CASA, move ad/exit_spinup to spinup, add 1850 ne240 fsurdat ->>>>>>>>>>>>> Activate all RTM maps, replace all f05 maps. -M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Rm fget_archdev - only allow R05 for rtm_res -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - ad_spinup - to spinup -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - add 1840 ne240 fsurdat, remove null setting of findat for maxpft=4 - activate RTM maps, replace all 0.47x0.63 mapping files -M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Use - standard shared SCRIP-grid files for: f05, f09, f19 resolutions -M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ------- Change - ad/exit_spinup to spinup -M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Remove - fatmgrid, flndtopo, fatmtopo, and fatmlndfrc files -M models/lnd/clm/doc/IMPORTANT_NOTES - Remove CASA, fine-mesh, and fget_archdev - ->>>>>>>>>>>>> Eliminate CASA, fine-mesh and atm data, change llatlon for ldomain ->>>>>>>>>>>>> Require RTM map files to be read. Require fatmlndfrc files to be ->>>>>>>>>>>>> in CESM domain file format. Require maxpft=numpft+1. Fix a pnetcdf issue. -M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 - Remove CASA use ldomain - in place of llatlon -M models/lnd/clm/src/biogeochem/CNDVMod.F90 ------ ldomain replaces llatlon -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 --- Get rid of fine-mesh - downscaling, use ldomain in place of llatlon remove atm, lnd versions - of everything (adomain, adecomp, get_proc_bounds_atm, begg_a/l, atm_sx for example. -M models/lnd/clm/src/main/organicFileMod.F90 ---- llatlon becomes ldomain -M models/lnd/clm/src/main/decompInitMod.F90 ----- Remove decompInit_atm, acid - remove atm grid stuff for: decompInit_lnd and decompInit_glcp -M models/lnd/clm/src/main/clm_initializeMod.F90 - Remove downscaling and atm/lnd - grid stuff as well as CASA. -M models/lnd/clm/src/main/clm_glclnd.F90 -------- Remove clm_maps2x and clm_mapx2s - and atm_s2x and atm_x2s -M models/lnd/clm/src/main/clmtypeInitMod.F90 ---- Remove CASA stuff -M models/lnd/clm/src/main/ndepStreamMod.F90 ----- Replace llatlon with ldomain -M models/lnd/clm/src/main/histFileMod.F90 ------- Remove atm grid stuff such - as gratm, namea grids, remove CASA -M models/lnd/clm/src/main/clm_atmlnd.F90 -------- Remove downscaling/upscaling - init_adiag_type, clm_downscale_a2l and data: atm_a2l, atm_l2a, adiag_arain -M models/lnd/clm/src/main/restFileMod.F90 ------- Remove CASA -M models/lnd/clm/src/main/controlMod.F90 -------- Remove fatmgrid, CASA, fatmtopo - add write about flndtopo (still needed for glc_nec) -M models/lnd/clm/src/main/initSurfAlbMod.F90 ---- Remove CASA -M models/lnd/clm/src/main/clm_varctl.F90 -------- Remove downscale and CASA -M models/lnd/clm/src/main/clm_driver.F90 -------- Remove CASA -M models/lnd/clm/src/main/initGridCellsMod.F90 -- Remove setting of _a domain - info, gindex_a, longdeg_a, latdeg_a, lon_a, lat_a -M models/lnd/clm/src/main/ncdio_pio.F90 --------- Remove use of gratm, set - data=' ' needed for pnetcdf -M models/lnd/clm/src/main/surfrdMod.F90 --------- Remove surfrd_get_latlon, - surfrd_get_frac, surfrd_wtxy_veg_rank, surfrd_mkrank, add - surfrd_get_globmask in place of surfrd_get_latlon, get rid of - ability to read in CLM frac datasets and only read in CESM domain file - format. Abort if allocate_all_vegpfts is NOT true. -M models/lnd/clm/src/main/domainMod.F90 --------- Remove latlon_type, - nara, and ntop add isgrid2d, adomain, alatlon, llatlon, gatm, amask, pftm - methods: domain_setptrs, latlon_init, latlon_check, latlon_clean, - latlon_setsame -M models/lnd/clm/src/main/decompMod.F90 --------- Remove get_proc_global_atm, - get_proc_bounds_atm, and atmosphere decomposition data -M models/lnd/clm/src/main/clmtype.F90 ----------- Remove CASA, gratm -M models/lnd/clm/src/main/histFldsMod.F90 ------- Remove use of atm_a2l, -- adiag_arain, adiag_asnow, adiag_aflux, adiag_lflux, downscale - remove CASA and downscale if's -M models/lnd/clm/src/main/mkarbinitMod.F90 ------ Remove CASA -M models/lnd/clm/src/riverroute/RtmMod.F90 ------ Remove some global RTM - data. Replace call's to endrun to shr_sys_abort as intial - step of the move to having RTM on it's own component. - Add rtm_celledge. -M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 ---- llatlon to ldomain -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 - formatting change -M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ---- Remove CASA -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 ------ Remove downscaling - -Summary of testing: - - bluefire: TBL tests fail because of use of RTM mapping files and NetCDF issue and -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 -044 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 2 -045 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 2 -046 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 2 - bluefire interactive testing: All PASS except, TBL tests fail because of NetCDF build issue and -026 erCK4 TER.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -027 brCK4 TBR.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 -031 brCK8 TBR.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 6 - bluefire/CESM testing: All PASS except - (and ALL compare tests fail couldn't find base result) -FAIL SMS.1x1_numaIA.ICN.bluefire_ibm -FAIL ERP.1x1_mexicocityMEX.I.bluefire_ibm - bluefire/PTCLM testing: All FAIL - lynx/pgi testing: ALL FAIL - lynx/pgi interactive testing: ALL FAIL - lynx CESM testing: ALL PASS except... (don't compare as no baselines for clm4_0_40) -CFAIL ERI.f10_f10.IRCP60CN.lynx_pathscale.162157 -FAIL PST.f19_g16.I.lynx_pgi -RUN ERS.1x1_vancouverCAN.I.lynx_pgi.162157 - mirage,storm/ifort interactive testing: All PASS! - jaguarpf CESM testing: All FAIL -RUN ERS_D.f09_g16.I1850.titan_pgi.182111 -FAIL ERI.f10_f10.IRCP60CN.titan_pgi -FAIL PST.f09_g16.I.titan_pgi -FAIL PET_PT.f10_f10.I20TRCN.titan_pgi -FAIL ERP.f19_g16.I4804CN.titan_pgi -RUN ERS.1x1_mexicocityMEX.I.titan_pgi.182111 -FAIL ERI_D.ne30_g16.I1850CN.titan_pgi -TFAIL ERH.ne120_g16.I2000CN.titan_pgi.182111 -RUN ERS.f09_g16.IRCP26CN.titan_pgi.182111 -FAIL SMS.f10_f10.IRCP45CN.titan_pgi -RUN ERS.f19_g16.IRCP60CN.titan_pgi.182111 -FAIL SMS_D.f10_f10.IRCP85CN.titan_pgi -RUN ERS.f09_g16.IG1850.titan_pgi.182111 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_40 - -Changes answers relative to baseline: Yes (using RTM mapping files now) - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: RTM mapping for f05 - - what platforms/compilers: - - nature of change larger than roundoff/same climate - -=============================================================== -=============================================================== -Tag name: clm4_0_40 -Originator(s): erik (Erik Kluzek) -Date: Thu Feb 16 14:19:28 MST 2012 -One-line Summary: Back out update to new T31 surface datasets - -Purpose of changes: - -Back out the new T31 surface datasets so will have initial conditions to use -for T31. Bring in the new surface datasets with initial conditions in the next tag. - -Requirements for tag: Run on bluefire - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1459 (PTSMODE fails) - 1468 (Bad f09, f19 SCRIP Grid files) - 1476 (Problem with stand-alone build on bluefire) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Bring back old T31 datasets - Comment out the new T31 surface datasets and put back the old T31 datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/src/main/findHistFields.pl -- Add script to figure out list of - history field names, long_names, and units - Create's a XML file as well as giving you a neatly formatted sorted list. - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Move T31 files - back to previous version and comment out the new files. - -Summary of testing: - - bluefire: All PASS except... -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 - bluefire interactive testing: All PASS except... -026 erCK4 TER.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -027 brCK4 TBR.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 -031 brCK8 TBR.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 6 -065 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -080 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -082 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -084 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= - bluefire/CESM testing: All PASS except... -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_39 - -Changes answers relative to baseline: T31 - - Answers are identical to clm4_0_38, if fatmgrid=fsurdat in controlMod.F90 - except for ntop for some grids and TREFMXAV and TREFMNAV for others. - -=============================================================== -=============================================================== -Tag name: clm4_0_39 -Originator(s): erik (Erik Kluzek) -Date: Wed Feb 1 11:40:11 MST 2012 -One-line Summary: Bring newgrid branch to trunk - -Purpose of changes: - -Move newgrid branch from Mariana to trunk. Add ne4np4, ne16np4, ne240np4 surface -datasets. Replace all T31 surface datasets. Start removing CASA and fine-mesh testing -and support. Bring in Tony's updates to ESMF5.2.0. - -Requirements for tag: - -run on lynx-pgi/bluefire/mirage-intel, fix bugs: 1446, 1444, 1442, 1404, 1430, 1425, 1420 - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1458 (Problem using fsurdat for fatmgrid as no verticies) - 1444 (attempt to read unallocated variable) - 1442 (Make clm-template same as CAM template) - 1430 (Remove DIN_LOC_ROOT_CLMQIAN -- add ...CLM_FORC) - 1425 (Double quotes causes Namelist.pm to hang) - 1420 (Bad history output for TREFMNAV, TREFMXAV) - 1404 (Inconsistent domain and fatmlndfrc files) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1454 (lack of 1D history files in CLM testing) - 1455 (bad time-stamp in CLM testing) - 1457 (bug in soil color in mksurfdata_map) - 1459 (PTSMODE fails) - 1468 (Bad f09, f19 SCRIP Grid files) - 1476 (Problem with stand-alone build on bluefire) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - Move rtm, voc, and glc_nec from configure-time to run-time namelist options - - Remove the -rtm -glc_nec and -voc options from "configure" - (NO longer available to CLM_CONFIG_OPTS) - - -Describe any changes made to the namelist: - - Add "-glc_nec, -glc_smb, -rtm options to build-namelist - (now available to CLM_BLDNML_OPTS) - - Remove fine-mesh option to build-namelist "-lnd_res" - (NO longer available to CLM_BLDNML_OPTS) - - Add following to clm_inparm namelist: - - do_rtm => If TRUE, turn on rtm river routing - maxpatch_glcmec => Number of multiple elevation classes over glacier points. - Normally this is ONLY used when running CESM with the active glacier model. - - Add following to the driver namelist to pass extra fields - - flds_voc - flds_co2a - flds_co2a - flds_co2c - flds_co2_dmsa - cplflds_custom - glc_nec - -List any changes to the defaults for the boundary datasets: - Replace T31 surface datasets, remove T31 finidat datasets - Add T31 fpftdyn datasets for all cases - Add ne240np4 datasets, ne4np4, ne16np4 surface datasets - - remove ALL fatmtopo datasets and all but T31, f09, f19 for glc_nec flndtopo - - Remove fatmlndfrc datasets -- use datm domainfiles in their place - -Describe any substantial timing or memory changes: None - -Code reviewed by: self,mvertens,tcraig (ESMF update) - -List any svn externals directories updated (csm_share, mct, etc.): almost all - scripts to scripts4_120123 - Machines to Machines_120123 - drv to drvseq4_1_01 - datm to datm8_120123 - socn/sice/sglc to stubs1_3_01 - cism to cism1_120123 - csm_share to share3_120123 - esmf_wrf_tmgr to esmf_wrf_timemgr_120123 - gen_domain to gen_domain_120117 - -List all files eliminated: - ->>>>>>>>>>>>>> Get rid of mkgriddata as no longer needed ->>>>>>>>>>>>>> Use gen_domain or models/lnd/clm/tools/mkmapdata/mknoocnmap.pl - D mkgriddata/mkgriddata.namelist - D mkgriddata/mkgriddata.regional - D mkgriddata/src/mkvarpar.F90 - D mkgriddata/src/mkvarctl.F90 - D mkgriddata/src/clm_varpar.F90 - D mkgriddata/src/clm_varctl.F90 - D mkgriddata/src/shr_sys_mod.F90 - D mkgriddata/src/shr_file_mod.F90 - D mkgriddata/src/ncdio.F90 - D mkgriddata/src/shr_log_mod.F90 - D mkgriddata/src/Filepath - D mkgriddata/src/Macros.custom - D mkgriddata/src/shr_kind_mod.F90 - D mkgriddata/src/shr_const_mod.F90 - D mkgriddata/src/mkgriddata.F90 - D mkgriddata/src/domainMod.F90 - D mkgriddata/src/areaMod.F90 - D mkgriddata/src/creategridMod.F90 - D mkgriddata/src/nanMod.F90 - D mkgriddata/src/Srcfiles - D mkgriddata/src/Mkdepends - D mkgriddata/src/Makefile - D mkgriddata/src - D mkgriddata/mkgriddata.singlept - D mkgriddata/mkgriddata.cesm_dom - D mkgriddata/README - D mkgriddata - ->>>>>>>>>>>>>> Remove config files for CASA or that turn off RTM, or ->>>>>>>>>>>>>> turn on VOC or glc_mec - D models/lnd/clm/test/system/config_files/_nrsc_dh - D models/lnd/clm/test/system/config_files/4p_casasc_dh - D models/lnd/clm/test/system/config_files/4p_casasc_dm - D models/lnd/clm/test/system/config_files/4p_casasc_do - D models/lnd/clm/test/system/config_files/4p_casasc_ds - D models/lnd/clm/test/system/config_files/4p_casasc_h - D models/lnd/clm/test/system/config_files/4p_casasc_m - D models/lnd/clm/test/system/config_files/4p_casasc_o - D models/lnd/clm/test/system/config_files/17p_nrsc_ds - D models/lnd/clm/test/system/config_files/_nrsc_dm - D models/lnd/clm/test/system/config_files/_nrsc_do - D models/lnd/clm/test/system/config_files/4p_nrcasasc_ds - D models/lnd/clm/test/system/config_files/17p_vorsc_h - D models/lnd/clm/test/system/config_files/_nrsc_ds - D models/lnd/clm/test/system/config_files/17p_vorsc_m - D models/lnd/clm/test/system/config_files/17p_nrcnsc_do - D models/lnd/clm/test/system/config_files/17p_vorsc_o - D models/lnd/clm/test/system/config_files/17p_nrcnsc_ds - D models/lnd/clm/test/system/config_files/_nrmexsc_ds - D models/lnd/clm/test/system/config_files/_mec10sc_dh - D models/lnd/clm/test/system/config_files/_nrcnsc_do - D models/lnd/clm/test/system/config_files/_mec10sc_dm - D models/lnd/clm/test/system/config_files/_nrcnsc_ds - D models/lnd/clm/test/system/config_files/_mec10sc_do - D models/lnd/clm/test/system/config_files/_mec10sc_ds - D models/lnd/clm/test/system/config_files/_nrsc_s - D models/lnd/clm/test/system/config_files/_nrvansc_ds - D models/lnd/clm/test/system/config_files/_nrnil3sc_dh - D models/lnd/clm/test/system/config_files/_nrnil3sc_dm - D models/lnd/clm/test/system/config_files/17p_vorsc_dh - D models/lnd/clm/test/system/config_files/21p_nrcncrpsc_s - D models/lnd/clm/test/system/config_files/21p_nrcncrpsc_ds - D models/lnd/clm/test/system/config_files/17p_vorsc_dm - D models/lnd/clm/test/system/config_files/17p_vorsc_do - D models/lnd/clm/test/system/config_files/17p_vorsc_ds - D models/lnd/clm/test/system/config_files/_mec10sc_h - D models/lnd/clm/test/system/config_files/_mec10sc_m - D models/lnd/clm/test/system/config_files/_mec10sc_o - ->>>>>>>>>>>>>> Remove mkdatadomain always use gen_domain - D models/lnd/clm/tools/mkdatadomain - D models/lnd/clm/tools/mkdatadomain/mkdatadomain.namelist - D models/lnd/clm/tools/mkdatadomain/src - D models/lnd/clm/tools/mkdatadomain/src/addglobal.F90 - D models/lnd/clm/tools/mkdatadomain/src/create_domain.F90 - D models/lnd/clm/tools/mkdatadomain/src/Mkdepends - D models/lnd/clm/tools/mkdatadomain/src/Srcfiles - D models/lnd/clm/tools/mkdatadomain/src/Filepath - D models/lnd/clm/tools/mkdatadomain/src/Macros.custom - D models/lnd/clm/tools/mkdatadomain/src/Makefile - D models/lnd/clm/tools/mkdatadomain/src/shr_kind_mod.F90 - D models/lnd/clm/tools/mkdatadomain/src/shr_const_mod.F90 - D models/lnd/clm/tools/mkdatadomain/README ->>>>>>>>>>>>>> fine-mesh no longer supported don't worry about topo files anymore - D models/lnd/clm/bld/namelist_files/checktopofiles.ncl - -List all files added and what they do: - ->>>>>>>>>>>>>> Rename without RTM off option - A + models/lnd/clm/test/system/config_files/17p_cnsc_ds - A + models/lnd/clm/test/system/config_files/_mexsc_ds - A + models/lnd/clm/test/system/config_files/_vansc_ds - ->>>>>>>>>>>>>> namelist to turn on VOC and RTM off, and gen_domain options - A + models/lnd/clm/test/system/nl_files/nl_voc - A + models/lnd/clm/test/system/nl_files/clm_nortm - A + models/lnd/clm/test/system/nl_files/gen_domain.ne30.runoptions - A + models/lnd/clm/test/system/nl_files/gen_domain.T31.runoptions - ->>>>>>>>>>>>>> Add scripts to create SCRIP grid/map files for region/single-point domains - A + models/lnd/clm/tools/mkmapdata/mkunitymap.ncl - A + models/lnd/clm/tools/mkmapdata/mknoocnmap.pl - A + models/lnd/clm/tools/mkmapgrids/mkscripgrid.ncl - - mknoocnmap.pl [options] Gets map and grid files for a single land-only point. - REQUIRED OPTIONS - -centerpoint [or -p] Center latitude,longitude of the grid to create. - -name [-or -n] Name to use to describe point - - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Remove rtm off from config files and update README file - M models/lnd/clm/test/system/config_files/_nil3sc_dh - M models/lnd/clm/test/system/config_files/_nil3sc_dm - M models/lnd/clm/test/system/config_files/README - ->>>>>>>>>>>>>> Change tests - M models/lnd/clm/test/system/README.testnames --- Update test names - 6, A, J, Q, S, V, X, and Z configurations are now unused - resolutions: 3, F, G and H are now unused - M models/lnd/clm/test/system/mknamelist --------- Remove fine-mesh option - M models/lnd/clm/test/system/test_driver.sh ----- Update paths for - edinburgh/jaguar - M models/lnd/clm/test/system/input_tests_master - Remove nr,vo,mec in configure - files for tests and move to namelist, remove compile-only test names - M models/lnd/clm/test/system/TSMtools.sh -------- Allow run files to - be in test directory - ->>>>>>>>>>>>>> Change testnames - 6, A, J, Q, S, V, X, and Z configurations are now unused - resolutions: 3, F, G and H are now unused - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_kraken - MM models/lnd/clm/test/system/tests_pretag_jaguarpf - MM models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi - M models/lnd/clm/test/system/tests_posttag_mirage - M models/lnd/clm/test/system/tests_posttag_intrepid - M models/lnd/clm/test/system/tests_posttag_intrepid_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/tests_posttag_lynx - ->>>>>>>>>>>>>> Fix run-time options - M models/lnd/clm/test/system/nl_files/clm_usrdat ----- Add rtm off - M models/lnd/clm/test/system/nl_files/mkmapdata_if10 - Remove -i option - ->>>>>>>>>>>>>> Add option to create datasets NOT entered into XML database - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - Use domainfile - rather than fatmgrid file, which changes variable names as well - M models/lnd/clm/tools/README.testing --------------- Note that run files - can be in tool directory or test directory - M models/lnd/clm/tools/README ----------------------- Update information on - process - MM models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl - Add usrspc option - M models/lnd/clm/tools/mkmapdata/regridbatch.sh ----- Use -b instead of -i - M models/lnd/clm/tools/mkmapdata/mkmapdata.sh ------- Replace -i option with - -b for batch, add option to read input SCRIP grid file (-f) and (-t) - option for regional or global type, update usage - M models/lnd/clm/tools/mksurfdata_map/README -------- Update usage info - M models/lnd/clm/tools/mkmapdata/README ------------- Update usage info - - New options for unsupported resolutions to mksurfdata.pl - -+ For unsupported, user-specified resolutions: -+ $ProgName -res usrspec -usr_gname -usr_gdate [OPTIONS] -+ -usr_gname "user_gname" User resolution name to find grid file with -+ (only used if -res is set to 'usrspec') -+ -usr_gdate "user_gdate" User map date to find mapping files with -+ (only used if -res is set to 'usrspec') -+ NOTE: all mapping files are assumed to be in mkmapdata -+ - and the user needs to have invoked mkmapdata in -+ that directory first -+ - ->>>>>>>>>>>>>> Move rtm, glc_nec, voc from configure to build-namelist - M models/lnd/clm/bld/configure -------------- Remove -rtm, -glc_nec, -voc options - M models/lnd/clm/bld/listDefaultNamelist.pl - Get datm namelist files as well - M models/lnd/clm/bld/build-namelist --------- Add: glc_nec, glc_smb, rtm options - Remove: lnd_res fine-mesh option - M models/lnd/clm/bld/clm.cpl7.template ------ Move rtm, glc_nec settings from - configure to build-namelist, set fatmlndfrc from domain file set in scripts - add processing for LND_GRID=reg, set glc_smb, loop over namelists for DART, - M models/lnd/clm/bld/README - M models/lnd/clm/bld/config_files/config_definition.xml - Remove rtm, glc_nec, voc - ->>>>>>>>>>>>>> Add new namelist items, remove CASA, fine-mesh, update T31 ->>>>>>>>>>>>>> add ne4np4, ne16np4, ne240np4 datasets - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------ - Add: rtm, maxpatch_glcmec, do_rtm, new cpl files, navy lmask - remove: fatmtopo, CASA namelist items, - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - rtm/glc_nec - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl ------- rm CASA - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- - Add: do_rtm, new T31 fsurdat/fpftdyn files, new ne4np4, ne16np4, - fsurdat and ne240np4 fsurdat/fatmlndfrc, missing map files (f19,T31) - Remove: T31 finidat, remove fatmtopo, and most flndtopo - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ---- Change - paths of domainfiles to share/domains - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml Add 10min - navy grid file - ->>>>>>>>>>>>>> Add glc_nec - M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml - - ->>>>>>>>>>>>>> Remove RTM, GLC_NEC, ESMF5.2.0 updates, don't require extents on fsurdat - M models/lnd/clm/src/main/clm_varpar.F90 -- Change for glc_nec - M models/lnd/clm/src/main/accumulMod.F90 -- Initialize val to zero if period=1 - M models/lnd/clm/src/main/clm_initializeMod.F90 - Change order of calls, rm RTM - M models/lnd/clm/src/main/clm_glclnd.F90 -- Use maxpatch_glcmec NOT glc_nec - M models/lnd/clm/src/main/subgridMod.F90 -- Use maxpatch_glcmec NOT glc_nec - M models/lnd/clm/src/main/histFileMod.F90 - Remove RTM add do_rtm - make sure ninst suffix is in restart history filename - M models/lnd/clm/src/main/restFileMod.F90 - Remove RTM add do_rtm - M models/lnd/clm/src/main/controlMod.F90 -- Remove RTM add do_rtm, - maxpatch_glcmec, glc_grid, use fatmlndfrc for fatmgrid if empty - broadcast glc_topomax if create_glacier_mec_landunit - M models/lnd/clm/src/main/clm_time_manager.F90 - Changes from Tony to update - to ESMF5.2.0 - M models/lnd/clm/src/main/clm_varctl.F90 ---- Remove RTM, use do_rtm, and remove - GLC_NEC use arrays for glc_nec variables - M models/lnd/clm/src/main/clm_driver.F90 ---- Remove RTM use do_rtm - M models/lnd/clm/src/main/initGridCellsMod.F90 - Write more info on error - M models/lnd/clm/src/main/pftvarcon.F90 ----- Remove unused MPI vars - M models/lnd/clm/src/main/surfrdMod.F90 ----- Don't require LATS/N,LONE/W on - files set to nan if not used, use maxpatch_glcmec NOT glc_nec - M models/lnd/clm/src/main/domainMod.F90 ----- Don't write LATS/N,LONE/W if - first lonw is nan - M models/lnd/clm/src/main/decompMod.F90 ----- Remove RTM use do_rtm - M models/lnd/clm/src/main/histFldsMod.F90 --- Remove RTM use do_rtm - M models/lnd/clm/src/riverroute/RtmMod.F90 -- Remove RTM use run_rtm NOT do_rtm - M models/lnd/clm/src/riverroute/RunoffMod.F90 Remove RTM - ->>>>>>>>>>>>>> ESMF5.2.0 updates, remove RTM, GLC_NEC - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - ESMF5.2.0 updates, remove RTM - use do_rtm, remove GLC_NEC use arrays of glc_nec - M models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 -- ESMF5.2.0 updates - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 --- ESMF4.2.0 updates - M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - Updated for new coupler fields spec - Remove RTM, GLC_NEC CPP tokens, make glc_nec variables arrays - some updates to ESMF5.2.0 - -Summary of testing: - - bluefire: All PASS except... -004 blC91 TBL.sh _sc_dh clm_std^nl_urb 20030101:3600 4x5 gx3v7 -6 arb_ic ........................FAIL! rc= 7 -008 blTZ1 TBL.sh 21p_cncrpsc_dh clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 7 -011 blD91 TBL.sh _persc_dh clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -015 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:1800 1.9x2.5 gx1v6@1850-2100 -10 cold FAIL! rc= 7 -018 brW51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -019 blW51 TBL.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -5 cold .................FAIL! rc= 7 -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 (bluefire compiler error) -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 (bluefire compiler error) -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 (bluefire compiler error) -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 (bluefire compiler error) -027 blHo1 TBL.sh 17p_cnsc_dh clm_drydep 20000101:1800 10x15 USGS@2000 -10 cold ..................FAIL! rc= 7 (bluefire compiler error) -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 (bluefire compiler error) -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 (bluefire compiler error) -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 (bluefire compiler error) -031 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 (bluefire compiler error) -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 (bluefire compiler error) -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 (bluefire compiler error) -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 (bluefire compiler error) -035 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 4 (bluefire compiler error) -036 smU61 TSM.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -6 cold ......FAIL! rc= 10 (bluefire compiler error) -037 erU61 TER.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 10+38 cold ...FAIL! rc= 5 (bluefire compiler error) -038 brU61 TBR.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 -3+-3 cold ...FAIL! rc= 5 (bluefire compiler error) -039 blU61 TBL.sh 21p_cndvcrpsc_dh clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6 48 cold ......FAIL! rc= 4 (bluefire compiler error) - bluefire interactive testing: -008 blC97 TBL.sh _sc_do clm_spin^nl_urb 20030101:1800 4x5 gx3v7@1850 -6 arb_ic ..................FAIL! rc= 7 -012 blHS3 TBL.sh 17p_cnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .....FAIL! rc= 7 -016 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ...............FAIL! rc= 7 -020 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 158 arb_ic ....FAIL! rc= 5 -024 blJ74 TBL.sh 4p_casasc_ds clm_std^nl_urb 10001230:3600 1x1_tropicAtl test -100 arb_ic .......FAIL! rc= 7 -028 blCA8 TBL.sh _sc_ds clm_std^nl_urb 20021230:3600 1x1_asphaltjungleNJ navy -90 arb_ic ........FAIL! rc= 7 -029 smCK4 TSM.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -10 cold ...............FAIL! rc= 10 -030 erCK4 TER.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 5 -031 brCK4 TBR.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 5 -032 blCK4 TBL.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -10 cold ...............FAIL! rc= 4 -033 smCK8 TSM.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -10 cold ...........FAIL! rc= 10 -034 erCK8 TER.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 5 -035 brCK8 TBR.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 5 -036 blCK8 TBL.sh _sc_ds clm_nortm^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -042 blF93 TBL.sh 17p_sc_do clm_std^nl_voc 20021230:1800 4x5 gx3v7 48 cold .......................FAIL! rc= 5 -046 blC83 TBL.sh _sc_do clm_std^nl_urb 20020115:3600 5x5_amazon navy -10 arb_ic .................FAIL! rc= 7 -054 blC63 TBL.sh _sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ........................FAIL! rc= 5 -058 blHQ4 TBL.sh 17p_cnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold ............FAIL! rc= 5 -062 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 7 -066 bl514 TBLtools.sh gen_domain tools__ds T31.runoptions .......................................FAIL! rc= 5 -075 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -076 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -083 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 7 -085 bl953 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................FAIL! rc= 7 -090 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -091 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -092 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -093 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -094 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -095 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except, compare_hist -FAIL SMS_RLA.f45_f45.I.bluefire - bug 1459 -FAIL SMS_RLB.f45_f45.I.bluefire - bug 1459 -FAIL SMS_ROA.f45_f45.I.bluefire - bug 1459 - bluefire/PTCLM testing: All FAIL - lynx/pgi: All PASS except... -004 blC92 TBL.sh _sc_dm clm_std^nl_urb 20030101:3600 4x5 gx3v7 -6 arb_ic ........................FAIL! rc= 7 -007 blD92 TBL.sh _persc_dm clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -011 blF92 TBL.sh 17p_sc_dm clm_std^nl_voc 20021230:1800 4x5 gx3v7 48 cold .......................FAIL! rc= 5 -015 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 7 -019 blJ92 TBL.sh 4p_casasc_dm clm_std^nl_urb 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 7 -023 blL52 TBL.sh _sc_dm clm_std^nl_urb 20020115:1800 10x15 USGS 48 arb_ic .......................FAIL! rc= 7 - lynx/pgi interactive testing: All PASS except.. -008 blTZ3 TBL.sh 21p_cncrpsc_do clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 7 -009 smCL4 TSM.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 10 -010 erCL4 TER.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 5 -011 brCL4 TBR.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 5 -012 blCL4 TBL.sh _sc_ds clm_nortm^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 4 -016 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ...............FAIL! rc= 7 -020 blOC4 TBL.sh _vansc_ds clm_urb1pt^nl_urb 19920812:3600 1x1_vancouverCAN navy 331 arb_ic .....FAIL! rc= 5 -024 blNB4 TBL.sh _mexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 158 arb_ic ....FAIL! rc= 5 -025 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 -026 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -027 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - mirage,storm/ifort interactive testing: -007 blD94 TBL.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 7 -011 blCA4 TBL.sh _sc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic ...............FAIL! rc= 7 -015 blCA8 TBL.sh _sc_ds clm_std^nl_urb 20021230:3600 1x1_asphaltjungleNJ navy -90 arb_ic ........FAIL! rc= 7 -019 blL54 TBL.sh _sc_ds clm_std^nl_urb 20020115:1800 10x15 USGS 48 arb_ic .......................FAIL! rc= 7 -023 blR53 TBL.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 48 cold ............FAIL! rc= 7 - jaguarpf: Currently NOT available: - edinburgh: Currently not supported - -CLM tag used for the baseline comparison tests if applicable: clm4_0_38 - -=============================================================== -=============================================================== -Tag name: clm4_0_38 -Originator(s): erik (Erik Kluzek) -Date: Mon Jan 23 13:56:45 MST 2012 -One-line Summary: Fix some minor issues with tools, add high resolution option and -datasets to mksurfdata, remove crap from clmtype so C13 will work on bluefire, convert -nans to FillValue for some cases, fix datasets, update doc - -Purpose of changes: - -Update externals to new version of scripts/Machines. Fix some bugs. Add in maps for: -ne4np4, ne16np4, ne60np4, and ne240np4 resolutions. Begin adding _FillValue/missing_value -to restart files. Start adding in new high-resolution datasets for mksurfdata. Add an -option to mksurfdata.pl to run at hi-res let default be standard half-degree datasets. -Add in 3x3min PFT dataset for 2000, and 5x5min organic. Add in maps for 3x3min and -5x5min_ISRIC_WISE to output grids. Separate out wetland and lake datasets, add in 3x3min -lake dataset. Get mksurfdata to work with T31, fix maps. Have both mksurfdata_map and clm -check files for consistencies. Add initial version of a script to check that maps in the -XML database are correct. Make sure keywords are set in tools, and OPT correctly added to -meta-data. Update gen_domain. Correct some typo's in filenames. Remove some unused data -in clmtype.F90. Update documentation to cesm1_0_4. - -Requirements for tag: - Testing on bluefire-only, Fix bugs: 1432 (part X), 1424X, 1423X, 1401 (part)X, 1309, - mksurfdata works at regular and hi-res and for f09, and at regular for: 128x256, - 512x1024, ne4np4, ne16np4, ne30np4, ne60np4, and ne240np4 resolutions, T31 and T31 - mksurfdata rcp's work - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): - 1432 (Several resolutions fail for new mksurfdata_map) - 1424 (variables written out as gdir) - 1423 (Problem building clmtype on bluefire) - 1398 (clm and mksurfdata_map needs to check map files -- partial) - -Known bugs (include bugzilla ID): - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1404 (Inconsistent domain and fatmlndfrc files) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1468 (Bad f09, f19 SCRIP Grid files) - 1476 (Problem with stand-alone build on bluefire) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Correct and add new mapping datasets and datasets for mksurfdata_map - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): most - - scripts to scripts4_111108 - Machines to Machines_111101 - drv to drvseq4_0_08 - cism to cism1_111004 - csm_share to share3_111027 - timing to timing_111101 - MCT to MCT2_7_0-111101 - pio to pio1_3_12 - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/test/system/config_files/_scnv_ds - Add serial option - A models/lnd/clm/bld/namelist_files/checkmapfiles.ncl - check that map files - are consistent - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/input_tests_master - Add serial irrig test - - M models/lnd/clm/test/system/test_driver.sh ----- Fix issues on bluefire, - update some paths on edinburgh - ->>>>>>>>>>>>>> Update documentation - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/special_cases.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/KnownBugs - ->>>>>>>>>>>>>> Get svn keywords set on tools, and make sure OPT is set - M models/lnd/clm/tools/mkmapdata/mvNimport.sh -------- Fix syntax error - M models/lnd/clm/tools/mkmapdata/mkmapdata.sh -------- Add in 3x3 grid and ISRIC-WISE - mask, add option to build ocean-land mask, and large-file format option, - M models/lnd/clm/tools/interpinic/src/interpinic.F90 - Fix svn keywords - M models/lnd/clm/tools/interpinic/src/Makefile ------- Set OPT CPP if OPT=TRUE - M models/lnd/clm/tools/mkgriddata/src/Makefile ------- Set OPT CPP if OPT=TRUE - M models/lnd/clm/tools/mkdatadomain/src/Makefile ----- Set OPT CPP if OPT=TRUE - M models/lnd/clm/tools/mkmapgrids/src/mkmapgrids.F90 - Add more meta-data - M models/lnd/clm/tools/mkmapgrids/src/Makefile-------- Set OPT CPP if OPT=TRUE - ->>>>>>>>>>>>>> Add call to domain_checksame to check if domains are the same, ->>>>>>>>>>>>>> split lake and wetland processing, add write statment for each file ->>>>>>>>>>>>>> opened, add -hires and -allownofile options to mksurfdata.pl - M models/lnd/clm/tools/mksurfdata_map/src/mkglcmecMod.F90 ---- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/src/mkvarctl.F90 ------- Split lake/wetland - M models/lnd/clm/tools/mksurfdata_map/src/mkvocefMod.F90 ----- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/src/mklaiMod.F90 ------- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/src/mksoilMod.F90 ------ Use domain_checksame - increase kmap_max_min from 50 to 90 (so T31 can be run) - M models/lnd/clm/tools/mksurfdata_map/src/mkdomainMod.F90 ---- Add domain_checksame, - make domain_init private, add metadata if frac/mask set, eliminate - lats/n,lone/w, use call abort in place of stop, - M models/lnd/clm/tools/mksurfdata_map/src/mksurfdat.F90 ------ Split lake/wetland - remove documentation on specific datasets, increase allowed sum of special - landunits from 120 to 250 - M models/lnd/clm/tools/mksurfdata_map/src/mkurbanparMod.F90 -- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/src/mkharvestMod.F90 --- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/src/mkfileMod.F90 ------ Fix meta-data, - remove lats/n,lone/w - M models/lnd/clm/tools/mksurfdata_map/src/mkgridmapMod.F90 --- Add headers, more - checking, add gridmap_setptrs method private gridmap_checkifset method, - - M models/lnd/clm/tools/mksurfdata_map/src/mklanwatMod.F90 ---- Split mklanwat - into mklakwat/mkwetlnd subroutines, use domain_checksame, - M models/lnd/clm/tools/mksurfdata_map/src/Makefile ----------- Set OPT CPP if OPT=TRUE - M models/lnd/clm/tools/mksurfdata_map/src/mkpftMod.F90 ------- Use domain_checksame - M models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl ---------- Add -hires and - -allownofile options, split lake and wetland - - -allownofile Allow the script to run even if one of the input files - does NOT exist. - -hires If you want to use high-resolution input datasets rather than the default - lower resolution datasets (low resolution is typically at half-degree) - - M models/lnd/clm/tools/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt Use $CSMDATA - directory path rather than /cgd/tss path - M models/lnd/clm/tools/mksurfdata_map/mksurfdata_map.namelist Split lake and wetland - ->>>>>>>>>>>>>> Minor changes - M models/lnd/clm/bld/build-namelist --------- Move groups earlier, start adding - code to handle lnd_inst_counter - M models/lnd/clm/bld/listDefaultNamelist.pl - Get rcp list sooner - ->>>>>>>>>>>>>> Fix some filename typos, add new mapping files, add hi-res ->>>>>>>>>>>>>> datasets - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------ Add - ne4np4, ne16np4, ne60np4, ne240np4 mapping files - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Correct - some typo's in filenames (ne4np4 scripgrid, ngwh mksurfdata pftdyn file - for rcp 6 for year 2006 - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Add mksrf_filename, - correct mksrf_* filenames to mksrf_f*, add ISRIC-WISE lmask - M models/lnd/clm/bld/namelist_files/datm-build-namelist ------- Only require - datm_data_dir for CPLHIST3HrWx - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Add ISRIC-WISE, - 3x3min_MODIS mapping datasets, correct some map dataset names, - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl ----- Add more data - to output table - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml Correct and - add new scrip grid files, add hires option for some data, add - mksrf_filename for types of files, add in all mksurfdata raw - datasets, add new hires datasets, correct mksrf_fvegtyp filenames, - ->>>>>>>>>>>>>> Remove initialization of unused data types (allows C13 on bluefire) ->>>>>>>>>>>>>> Add option to convert nan to fillvalue on output files ->>>>>>>>>>>>>> (and vica-versa on input) - M models/lnd/clm/src/main/clmtypeInitMod.F90 - Remove initialization of unused - data types - M models/lnd/clm/src/main/clm_atmlnd.F90 ----- Remove unused pdf variable - M models/lnd/clm/src/main/initSurfAlbMod.F90 - Remove unused CNZeroFluxes - M models/lnd/clm/src/main/ncdio_pio.F90 ------ Add cnvrtnan2fill option - to convert from spval to nan on read and from nan to spval on write - M models/lnd/clm/src/main/clmtype.F90 -------- Remove unused variables - M models/lnd/clm/src/main/histFldsMod.F90 ---- Add some documentation, change - longname of QSOIL, correct: CISUN, CISHA, ALPHAPSNSUN, ALPHAPSNSHA - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 - - -Summary of testing: - - bluefire testing: -018 brX51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 -031 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 -035 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 4 - bluefire interactive testing: All PASS except... -031 erAK4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -032 brAK4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 -036 brAK8 TBR.sh _nrsc_ds clm_std^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 6 -037 blAK8 TBL.sh _nrsc_ds clm_std^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -067 bl5@4 TBLtools.sh gen_domain tools__ds namelist .............................................FAIL! rc= 7 -003 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -004 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -008 bl954 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......FAIL! rc= 6 -011 sm974 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -012 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 4 -013 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -014 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 4 -015 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 -016 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 4 - bluefire/CESM testing: All PASS except... (compare tests fail because clm4_0_37 file did not exist) - -CLM tag used for the baseline comparison tests if applicable: clm4_0_37 - -=============================================================== -=============================================================== -Tag name: clm4_0_37 -Originator(s): erik (Erik Kluzek) -Date: Mon Sep 26 10:35:24 MDT 2011 -One-line Summary: Fix unstructured grids history files - -Purpose of changes: - -Comment out code for writing out fine-mesh lat/lon for unstructured grids. This caused -the code to blow up when running for HOMME grids such as ne30np4. - -Bugs fixed (include bugzilla ID): - 1415 (History files can't be written out for HOMME grids) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1398 (clm and mksurfdata_map needs to check map files for consistency) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1404 (Inconsistent domain and fatmlndfrc files) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1423 (Problem building clmtype on bluefire) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/src/main/histFileMod.F90 - Comment out code for fine-mesh - lat/lon for unstructured grids - -Summary of testing: None! - -CLM tag used for the baseline comparison tests if applicable: clm4_0_36 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_36 -Originator(s): erik (Erik Kluzek) -Date: Thu Sep 22 11:05:59 MDT 2011 -One-line Summary: Comment out RTM mapping files for f09 and f19 - -Purpose of changes: - -Comment out the RTM mapping files for f09/f19 so answers are the same as clm4_0_34 and as the f19 mapping -files cause the fully coupled model to blow up in POP. Add "mv" option to mksurfdata.pl and make -nomv the -default so it doesn't try to copy files by default. Increase length of filename strings for mksurfdata pftdyn -files. Add some metadata for some restart file variables. Add "new good wood harvest" datasets -and option (-new_woodharv) to mksurfdata.pl from Peter Lawrence so can make surface -datasets with either set of files. New good wood harvest applies to rcp6 and rcp8.5. -Also add in some new mapping files for: 512x1024,128x256,64x128,32x64,8x16,0.23x0.31,5x5_amazon. -Add SCRIP grid files for: ne4np4,ne16np4, ne60np4, ne240np4. Add 3x3min resolution -and 3x3min SCRIP grid file which will be used for high resolution surface dataset -creation in the future. Use new surface datasets with old fatmgrid values for f09_g16 -for 1850 and 2000 so that answers can be identical to clm4_0_34 without requiring the -fatmgrid file. - -Bugs fixed (include bugzilla ID): - 1414 (Answers change @ f09 resolution w/o fatmgrid file) - 1413 (re is in incorrect units in mksurfdata_map) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1398 (clm and mksurfdata_map needs to check map files for consistency) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1404 (Inconsistent domain and fatmlndfrc files) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1415 (History files can't be written out for HOMME grids) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Comment out RTM mapping files for f09/f19 - Also new mapping files for: 512x1024,128x256,64x128,32x64,8x16,0.23x0.31,5x5_amazon. - Add SCRIP grid files for: ne4np4,ne16np4, ne60np4, ne240np4. - Add 3x3min SCRIP grid file. - New surface datasets with old fatmgrid grid coordinate values for f09/1850/2000 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/tools/mksurfdata_map/src/mksurfdat.F90 -------------- Increase pftdyn file length to 135 - M models/lnd/clm/tools/mksurfdata_map/src/mkfileMod.F90 -------------- Increase nchar dim to 256 - M models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl ------------------ Add "mv" option with "nomv" the default - M models/lnd/clm/tools/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt - Increse length of strings for files - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Add 3x3min, - ne4np4,ne16np4, ne60np4, ne240np4 as valid resolutions - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Comment out f09/f19 RTM mapping files - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Add new - good wood harvest pftdyn input files from Peter Lawrence for mksurfdata_map - for rcp6 and rcp8.5 - - M models/lnd/clm/src/biogeochem/CNrestMod.F90 --------- Add some FillValue to some fields for restart files - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 - Add some FillValue to some fields for restart files - -Summary of testing: - - bluefire interactive testing: Following PASS -001 sm754 TSMtools.sh mksurfdata_map tools__s namelist ..........................................PASS -003 sm953 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................PASS -005 sm954 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......PASS -007 sm9S4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................PASS -008 bl9S4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................PASS - bluefire/CESM testing: All PASS except (compare to clm4_0_34) -CFAIL ERS_E.T31_g37.I1850.bluefire.GC.125250 (ESMF doesn't work with NetCDF4) -BFAIL ERB.ne30_g16.I_1948-2004.bluefire.compare.clm4_0_34 (ne30 wasn't in clm4_0_34) (answers are identical to clm4_0_35) -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_34 (I1850SPINUPCN wasn't in clm4_0_34 or before) -FAIL NCK.f10_f10.I.bluefire -- scripts needs to cleannamelist after changing NINST_LND - bluefire extra CESM testing: Following PASS -PASS ERS.f09_g16.ICN.bluefire -PASS ERS.f09_g16.ICN.bluefire.generate.clm4_0_36 -PASS ERS.f09_g16.ICN.bluefire.compare_hist.clm4_0_33 -PASS ERS.f09_g16.ICN.bluefire.compare.clm4_0_33 -PASS ERS.f09_g16.I1850CN.bluefire -PASS ERS.f09_g16.I1850CN.bluefire.generate.clm4_0_36 -PASS ERS.f09_g16.I1850CN.bluefire.compare_hist.clm4_0_33 -PASS ERS.f09_g16.I1850CN.bluefire.compare.clm4_0_33 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_35 - -Changes answers relative to baseline: f09/f19 now same as clm4_0_34 - -=============================================================== -=============================================================== -Tag name: clm4_0_35 -Originator(s): erik (Erik Kluzek), mvertens -Date: Tue Sep 13 22:15:17 MDT 2011 -One-line Summary: Bring in Mariana's non2D grid branch to trunk, enabling HOMME grids: ne30np4/ne120np4 - -Purpose of changes: - -Move Mariana's new non-2D branch to trunk. Extensive changes to mksurfdata, allows 1D-vector surface -datasets. Mariana change mksurfdata to add unstructured grid format using SCRIP weights. Won't work -with PTCLM and mksurfdata won't be able to create single-pt/regional surface datasets. Fix reverse -coordinates on VOC/irrig mksurfdata input file. Update scripts and datm with HOMME grids. Add in -half-degree pftdyn historical dataset. Partial fix to PTSMODE restart problem. Fix the US-UMB data for PTCLM. - -NOTE: File creation process is changed substantially! mksurfdata now requires mapping files to be created first - in order to run the new mksurfdata_map. This means you need to do the following: - - 1.) run mkgriddata - 2.) run mkmapgrid (add files to XML database) (requires 1) - 3.) run mkmapdata (add files to XML database) (requires 2) - 4.) run mksurfdata_map (requires 3) - 5.) run gen_domain (requires 3 needed for datm) - - See the models/lnd/clm/tools/README file for more help on the process. - -WARNING: YOU CAN'T CREATE SINGLE-POINT DATASETS WITH THIS VERSION! You can create frac/grid files with this - version and then use an older verison of clm to use mksurfdata to create surface datasets. The mapping - for single-point datasets using ESMF does NOT work -- although it does work if you have at least 4 points - so you can create regional datasets. - - THIS MEANS PTCLM DOES NOT WORK FOR CREATING NEW DATASETS! It will work for datasets already created however. - -CAUTION: Mapping files to allow mksurfdata to work are only provided for: f09, f19, f10, T31, f45, f25, ne30 and ne120 - -Bugs fixed (include bugzilla ID): - 1392 (US-UMB site has some incorrect data) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1393 (error when running Gregorian calendar) - 1397 (c2l_scale_type not specified for many history fields) - 1398 (clm and mksurfdata_map needs to check map files for consistency) - 1401 (Restart files do NOT have _FillValue/missing_value attributes on fields) - 1404 (Inconsistent domain and fatmlndfrc files) - 1405 (Problem with irrigation on clm4_0_34 with intel compiler) - 1407 (Build problem on jaguar for test_driver.sh with -c option) - 1409 (ne120 is having restart trouble on jaguar with NetCDF3) - 1410 (Problem running PST.f09_g16.I.jaguarpf) - 1411 (ERI_D.ne30_g16.I1850CN.jaguarpf.G.235924 fails on jaguarpf) - 1413 (re is in incorrect units in mksurfdata_map) - 1414 (Answers change @ f09 resolution w/o fatmgrid file) - 1415 (History files can't be written out for HOMME grids) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Can now read in domain files in place of fatmlndfrac - fatmgrid no longer required (use fsurdat to get grid) - fmapinp_rtm new namelist item to give mapping for RTM - -List any changes to the defaults for the boundary datasets: - - Add: ne30np4/ne120np4 datasets, add 1850-2000 0.47x0.63 fpftdyn file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mvertens, sacks - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share, datm - - scripts to scripts4_110906 - csm_share to share3_110906 - datm to datm8_110908 - -List all files eliminated: - ->>>>>>>>>>>> Rename mksurfdata to mksurfdata_map - D models/lnd/clm/tools/mksurfdata/* - ->>>>>>>>>>>> Move source code to src subdirectory - D models/lnd/clm/tools/mkdatadomain/Mkdepends/Srcfiles/Filepath/Makefile/*.F90 - D models/lnd/clm/tools/mkgriddata/Mkdepends/Srcfiles/Filepath/Makefile/*.F90 - D models/lnd/clm/tools/interpinic/Mkdepends/Srcfiles/Filepath/Makefile/*.F90 - -List all files added and what they do: - ->>>>>>>>>>>> Rename mksurfdata to mksurfdata_map, create src sub-directory - A models/lnd/clm/tools/mksurfdata_map - A models/lnd/clm/tools/mksurfdata_map/mksurfdata.pl - A models/lnd/clm/tools/mksurfdata_map/mksurfdata_map.namelist - A models/lnd/clm/tools/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt - A models/lnd/clm/tools/mksurfdata_map/README - A models/lnd/clm/tools/mksurfdata_map/src - A models/lnd/clm/tools/mksurfdata_map/src/clm_varctl.F90 - A models/lnd/clm/tools/mksurfdata_map/src/clm_varpar.F90 - A models/lnd/clm/tools/mksurfdata_map/src/Filepath - A models/lnd/clm/tools/mksurfdata_map/src/fileutils.F90 - A models/lnd/clm/tools/mksurfdata_map/src/Macros.custom - A models/lnd/clm/tools/mksurfdata_map/src/Makefile - A models/lnd/clm/tools/mksurfdata_map/src/Mkdepends - A models/lnd/clm/tools/mksurfdata_map/src/mkdomainMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkfileMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkglcmecMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkgridmapMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkharvestMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mklaiMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mklanwatMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkncdio.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkpftMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mksoilMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mksurfdat.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkurbanparMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkvarctl.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkvarpar.F90 - A models/lnd/clm/tools/mksurfdata_map/src/mkvocefMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/nanMod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_const_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_file_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_kind_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_log_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_string_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_sys_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/shr_timer_mod.F90 - A models/lnd/clm/tools/mksurfdata_map/src/Srcfiles - ->>>>>>>>>>>> Scripts to use ESMF to create SCRIP mapping files from SCRIP grid files - A models/lnd/clm/tools/mkmapdata - A models/lnd/clm/tools/mkmapdata/mkmapdata.sh - A models/lnd/clm/tools/mkmapdata/mvNimport.sh - A models/lnd/clm/tools/mkmapdata/README - A models/lnd/clm/tools/mkmapdata/regridbatch.sh - A models/lnd/clm/tools/mkmapdata/rmdups.ncl ----- NCL script to remove duplicates - ->>>>>>>>>>>> Program to create SCRIP grid files from CLM grid/frac files - A models/lnd/clm/tools/mkmapgrids - A models/lnd/clm/tools/mkmapgrids/mkmapgrids.csh - A models/lnd/clm/tools/mkmapgrids/mkmapgrids.namelist - A models/lnd/clm/tools/mkmapgrids/README - A models/lnd/clm/tools/mkmapgrids/src - A models/lnd/clm/tools/mkmapgrids/src/domainMod.F90 - A models/lnd/clm/tools/mkmapgrids/src/Filepath - A models/lnd/clm/tools/mkmapgrids/src/Macros.custom - A models/lnd/clm/tools/mkmapgrids/src/Makefile - A models/lnd/clm/tools/mkmapgrids/src/Mkdepends - A models/lnd/clm/tools/mkmapgrids/src/mkmapgrids.F90 - A models/lnd/clm/tools/mkmapgrids/src/nanMod.F90 - A models/lnd/clm/tools/mkmapgrids/src/shr_file_mod.F90 - A models/lnd/clm/tools/mkmapgrids/src/shr_kind_mod.F90 - A models/lnd/clm/tools/mkmapgrids/src/shr_log_mod.F90 - A models/lnd/clm/tools/mkmapgrids/src/shr_sys_mod.F90 - A models/lnd/clm/tools/mkmapgrids/src/Srcfiles - ->>>>>>>>>>>> Programs to postprocess 1D vector unstructured grids - A models/lnd/clm/tools/mkprocdata_map - A models/lnd/clm/tools/mkprocdata_map/camhomme - A models/lnd/clm/tools/mkprocdata_map/camhomme/mkprocdata_map_in - A models/lnd/clm/tools/mkprocdata_map/camhomme/src - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/Depends - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/domainMod.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/Filepath - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/fileutils.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/gridmapMod.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/Makefile - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/mkprocdata_map.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/nanMod.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/shr_file_mod.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/shr_kind_mod.F90 - A models/lnd/clm/tools/mkprocdata_map/camhomme/src/Srcfiles - A models/lnd/clm/tools/mkprocdata_map/clm - A models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_all - A models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_in - A models/lnd/clm/tools/mkprocdata_map/clm/mkprocdata_map_wrap - A models/lnd/clm/tools/mkprocdata_map/clm/README - A models/lnd/clm/tools/mkprocdata_map/clm/src - A models/lnd/clm/tools/mkprocdata_map/clm/src/constMod.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/Filepath - A models/lnd/clm/tools/mkprocdata_map/clm/src/fileutils.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/fmain.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/gridmapMod.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/Makefile - A models/lnd/clm/tools/mkprocdata_map/clm/src/Mkdepends - A models/lnd/clm/tools/mkprocdata_map/clm/src/mkprocdata_map.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/nanMod.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/shr_file_mod.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/shr_kind_mod.F90 - A models/lnd/clm/tools/mkprocdata_map/clm/src/Srcfiles - ->>>>>>>>>>>> Make macros files to customize how tools operate (allows all tools to have an identical Makefile) - A models/lnd/clm/tools/interpinic/src/Macros.custom - A models/lnd/clm/tools/mkgridata/src/Macros.custom - A models/lnd/clm/tools/mkdomaindata/src/Macros.custom - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Add tests for new grids/tools - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_pretag_jaguarpf - M models/lnd/clm/test/system/tests_posttag_mirage - M models/lnd/clm/test/system/tests_posttag_intrepid - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/README.testnames --------------- 4/5=mkmapgrids/gen_domain config - I=CN spinup, @=ne120np4, #=ne30np4, *=ne16np4 run options - ->>>>>>>>>>>> Change build/run for tools, update netcdf on bluefire, update modules on jaguar, add new tests - M models/lnd/clm/test/system/TCB.sh ------------- Remove setting of MACFILE not needed - M models/lnd/clm/test/system/TCBtools.sh -------- Add src directory, Mkdepends, Macros.custom - M models/lnd/clm/test/system/TBLscript_tools.sh - Set CLM_ROOT - M models/lnd/clm/test/system/TBLtools.sh -------- Set CLM_ROOT - M models/lnd/clm/test/system/TBL.sh ------------- Allow compile-only mode to work - M models/lnd/clm/test/system/TSM.sh ------------- Handle multi-instance rpointer files - M models/lnd/clm/test/system/test_driver.sh -- Get netcdf4.1.3 working on bluefire, get mirage build working, - use glade paths, add ESMFBIN_PATH, update jaguar modules - M models/lnd/clm/test/system/input_tests_master - Fill out HM tests, add H#, H@, blJ07, 454, 5@4, 9#2, 953 - tests, mksurfdata=>mksurfdata_map - M models/lnd/clm/test/system/nl_files/clm_spin -- Change case to agree with 1850 MOAR case in CESM scripts - M models/lnd/clm/test/system/nl_files/mksrfdt_10x15_irr_1850 ------------ Remove -nomv option - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_vancouverCAN_2000 ----- Remove -nomv option - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_numaIA_mp20irrcr_2000 - Remove -nomv option - ->>>>>>>>>>>> Run interpinic and checkin the result - M models/lnd/clm/tools/interpinic/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc - ->>>>>>>>>>>> Update to glade path, add notes on src subdirectory - M models/lnd/clm/tools/interpinic/README ------------------ Add notes about src subdirectory - M models/lnd/clm/tools/mkgriddata/mkgriddata.namelist ----- Use glade path - M models/lnd/clm/tools/mkgriddata/mkgriddata.regional ----- Use glade path - M models/lnd/clm/tools/mkgriddata/mkgriddata.singlept ----- Use glade path - M models/lnd/clm/tools/mkgriddata/mkgriddata.cesm_dom ----- Use glade path - M models/lnd/clm/tools/mkgriddata/README ------------------ Update with added src sub-directory - M models/lnd/clm/tools/mkdatadomain/mkdatadomain.namelist - Use glade path - M models/lnd/clm/tools/mkdatadomain/README ---------------- Add notes about src subdirectory - ->>>>>>>>>>>> Update tools README information - M models/lnd/clm/tools/README.testing ------ Note about src subdirectory required - M models/lnd/clm/tools/README -------------- Updated with notes on new process - M models/lnd/clm/tools/README.filecopies --- Notes on list of file copies has changed - ->>>>>>>>>>>> Changes to tools source codes moved to src subdirectories, Makefile was standardized ->>>>>>>>>>>> update shr_sys_mod.F90 file to latest csm_share - M models/lnd/clm/tools/interpinic/src/interpinic.F90 --- Add metadata on OPT and OMP - M models/lnd/clm/tools/interpinic/src/Makefile --------- Standardize - M models/lnd/clm/tools/interpinic/src/shr_sys_mod.F90 -- Update - M models/lnd/clm/tools/mkdatadomain/src/Makefile ------- Standardize - M models/lnd/clm/tools/mkdatadomain/src/Filepath ------- Only use local directory - M models/lnd/clm/tools/mkgriddata/src/Makefile --------- Standardize - M models/lnd/clm/tools/mkgriddata/src/shr_sys_mod.F90 -- Update - M models/lnd/clm/tools/mkgriddata/src/clm_varctl.F90 --- Update - ->>>>>>>>>>>> Add RTM mapping file, change some namelist file required logic - M models/lnd/clm/bld/listDefaultNamelist.pl - Also get RTM mapping file, and use $CSMDATA if set - M models/lnd/clm/bld/build-namelist --------- If can't find a frac file use the datm domain file, only - get fatmgrid file for fine-mesh, if RTM on get mapping file, if fine-mesh on and fatmgrid not found - use fsurdat file - M models/lnd/clm/bld/clm.cpl7.template ------ Clarify documentation for CLM_RTM_RES - ->>>>>>>>>>>> Add new files needed for ne30np4/ne120np4 and processing of them - M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl --------- Add test for more resolutions - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Add: fmapinp_rtm, scripgriddata, mksrf_fglctopo, - map, lmask, hgrid - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- Add: ne30np4/ne120np4 datasets, add - 1850-2000 0.47x0.63 fpftdyn file, remove some of the single-point fatmlndgrd files, add mapping files, - add lmask/hgrid for different map types - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Add ne30np4/ne120np4 domain files - ->>>>>>>>>>>> Use llatlon structure in place of lsmlat/lsmlon, required files a bit different, use fsurdat if ->>>>>>>>>>>> fatmgrid is not given, add RTM mapping file, if fatmlndfrc NOT set set mask/frac to 1. - M models/lnd/clm/src/biogeochem/CASAMod.F90 ------------ Use llatlon%ni/nj in place of lsmlon/lat - don't allow 1D grids for CASA - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 - Use llatlon structure in place of lsmlon/lat - M models/lnd/clm/src/biogeochem/CNDVMod.F90 ------------ Use llatlon structure in place of lsmlon/lat - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 ---------- asca => ascale - M models/lnd/clm/src/main/organicFileMod.F90 ----------- Use llatlon structure in place of lsmlon/lat - M models/lnd/clm/src/main/clm_varpar.F90 --------------- Remove lsmlon/lsmlat parameters - M models/lnd/clm/src/main/clm_timemanager.F90 ---------- Add some meta-data to restart file, check restart values - M models/lnd/clm/src/main/clm_initializeMod.F90 -------- Remove cellarea, surfrd gets area - M models/lnd/clm/src/main/fileutils.F90 ---------------- Make iflag required argument - M models/lnd/clm/src/main/ndepStreamMod.F90 ------------ Use llatlon structure in place of lsmlon/lat - M models/lnd/clm/src/main/iniTimeConst.F90 ------------- Remove start/count lsmlon/lsmlat - M models/lnd/clm/src/main/histFileMod.F90 -------------- Add namea grid, replace lsmlon/lat with llatlon - handle unstructured grids - M models/lnd/clm/src/main/controlMod.F90 --------------- If fatmgrid NOT set, use fsurdat, add fmapinp_rtm - if fatmlndfrc NOT set, set mask/frac to 1. - M models/lnd/clm/src/main/clm_varctl.F90 --------------- Add fmapinp_rtm - M models/lnd/clm/src/main/ncdio_pio.F90 ---------------- Add ncd_inqfdims, io_type public, clmlevel set - earlier, remove switchdim from ncd_io_int_var2, handle switchdim in ncd_io_real_var2 read for - singlept - M models/lnd/clm/src/main/surfrdMod.F90 ---------------- Remove surfrd, add surfrd_get_data hande 1D grids - M models/lnd/clm/src/main/domainMod.F90 ---------------- asca=>ascale - M models/lnd/clm/src/main/decompMod.F90 ---------------- Add namea remove get_clmlevel_dsize - M models/lnd/clm/src/main/clmtype.F90 ------------------ Increase len=8 to len=16 - M models/lnd/clm/src/riverroute/RtmMod.F90 ------------- Add L2R_Decomp, remove lsmlat/lon for llatlon - remove river meta-data - M models/lnd/clm/src/riverroute/RtmMapMod.F90 ---------- Pass in fracout - M models/lnd/clm/src/biogeophys/UrbanInputMod.F90 ------ Use llatlon in place of lsmlat/lon - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 -------- asca=>ascale - -Summary of testing: - - bluefire: All PASS except... -015 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:1800 1.9x2.5 gx1v6@1850-2100 -10 cold FAIL! rc= 7 -018 brX51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 -031 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 -035 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 4 - bluefire interactive testing: All PASS except... -009 blC97 TBL.sh _sc_do clm_spin^nl_urb 20030101:1800 4x5 gx3v7@1850 -6 arb_ic ..................FAIL! rc= 5 -031 erAK4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -032 brAK4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 -036 brAK8 TBR.sh _nrsc_ds clm_std^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 6 -037 blAK8 TBL.sh _nrsc_ds clm_std^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 4 -051 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:1800 1x1_brazil navy -670 arb_ic .................FAIL! rc= 5 -004 blS63 TBL.sh _mec10sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ...................FAIL! rc= 7 -005 smQQ4 TSM.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold .............FAIL! rc= 4 -006 erQQ4 TER.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -3+-7 cold ............FAIL! rc= 5 -007 brQQ4 TBR.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -5+-5 cold ............FAIL! rc= 5 -008 blQQ4 TBL.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold .............FAIL! rc= 4 -012 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 7 -014 bl454 TBLtools.sh mkmapgrids tools__ds namelist .............................................FAIL! rc= 5 -016 bl5@4 TBLtools.sh gen_domain tools__ds namelist .............................................FAIL! rc= 5 -024 bl754 TBLtools.sh mksurfdata_map tools__s namelist ..........................................FAIL! rc= 5 -025 sm774 TSMtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 5 -026 bl774 TBLtools.sh mksurfdata_map tools__ds singlept .........................................FAIL! rc= 4 -033 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 5 -037 bl953 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 ..............................FAIL! rc= 5 -039 bl954 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ......FAIL! rc= 6 -043 bl974 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds FAIL! rc= 6 -045 bl9T4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -047 bl9C4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - bluefire/CESM testing: All PASS except... -FAIL ERS_D.f19_g16.IGRCP26CN.bluefire.compare_hist.clm4_0_34 -FAIL ERS_D.f19_g16.IGRCP26CN.bluefire.compare.clm4_0_34 -FAIL ERP.f19_g16.IGRCP60CN.bluefire.compare_hist.clm4_0_34 -FAIL ERP.f19_g16.IGRCP60CN.bluefire.compare.clm4_0_34 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_34 -BFAIL ERB.ne30_g16.I_1948-2004.bluefire.compare.clm4_0_34 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_34 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_34 - bluefire/PTCLM testing: All PASS - lynx/pgi testing: All FAIL (build issues) - lynx/pgi interactive testing: All PASS except... -010 erAL4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 7 -011 brAL4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 6 - lynx/CESM extra testing: ... -PASS ERS.ne30_g16.I1850CN.lynx_gnu -PASS ERS.ne30_g16.I1850CN.lynx_intel -PASS ERS.ne30_g16.I1850CN.lynx_pathscale - jaguarpf: All FAIL (system build issue) - jaguarpf interactive testing: All PASS up to... -14 PTCLM.16750_US-UMB_ICN_exit_spinup.PTCLM PASS - jaguarpf/CESM testing: All PASS except... -FAIL PST.f09_g16.I.jaguarpf -FAIL ERI_D.ne30_g16.I1850CN.jaguarpf -TFAIL ERH.ne120_g16.I2000CN.jaguarpf.G.235924 - jaguarpf/CESM additional testing: ... -FAIL ERH.ne120_g16.ICN.jaguarpf -PASS SMS.ne120_g16.I.jaguarpf -FAIL ERS.ne120_g16.I.jaguarpf - edinburgh/lf95 interactive testing: All PASS except... -006 erAL4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 7 -007 brAL4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 6 -008 blAL4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 5 -025 sm978 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds .....FAIL! rc= 6 -026 sm9T4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__dFAIL! rc= 6 -027 sm9C4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds FAIL! rc= 6 - edinburgh/CESM testing: ... -PASS ERS.ne30_g16.I1850CN.edinburgh_pgi -PASS ERS.ne30_g16.I1850CN.edinburgh_lahey - edinburgh/PTCLM testing: All PASS up to... -14 PTCLM.30770_US-UMB_ICN_exit_spinup.PTCLM PASS - mirage,storm/ifort interactive testing: All PASS - -CLM tag used for the baseline comparison tests if applicable: clm4_0_34 - -Changes answers relative to baseline: - - f09_gx1v6, f19_gx1v6 are similar climate but different because of new RTM mapping files - -=============================================================== -=============================================================== -Tag name: clm4_0_34 -Originator(s): erik (Erik Kluzek) -Date: Thu Aug 18 13:14:01 MDT 2011 -One-line Summary: Bring tcens branch to trunk, fix a few issues - -Purpose of changes: - -Remove -pftlc to mksurfdata.pl. Correct units of H2OSNOTOP, HC, and HCSOI history fields. -Remove fget_archdev. Fix single point restarts from Brenden Rogers (although now there -is a PIO issue). Fix pio error when clm is running at same grid as RTM from Mariana. -Move Tony's "tcens" DART ensemble branch to trunk. Add save statement to ncdio. Have -chkdatmfiles.ncl check both grid and frac files. -Update pio/MCT/scripts/datm/PTCLM/csm_share. - -Bugs fixed (include bugzilla ID): - 1383 (Remove no-VOC and MAXPFT=4 tests) - 1381 (Can't change monthly average files to NOT be one per month) - 1372 (pio problem writing out RTM hist fields at RTM res) - 1361 (Problem with transient compsets for PTCLM) - 1358 (incorrect units for a few history fields) - 1025 (SCM mode can NOT use a global finidat file) (partial) - 1017 (SCM mode can NOT restart) (partial) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1360 (Can't do a ncdump on US-UMB data) - 1392 (US-UMB site has some incorrect data) - 1393 (error when running Gregorian calendar) - 1396 (pio problem reading 2D data with 1st dim=1) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: - Add -ninst_lnd for multiple ensembles of CLM for data assimulation to configure. - Build pio and mct as seperate libraries (add -mct_dir/pio_dir to configure). - - Set multiple instances with NINST_LND env variable in env_mach_pes.xml - (make sure NTASKS_LND is >= NINST_LND) - -Describe any changes made to the namelist: - Remove fget_archdev option (don't try to get input files from archival device). - - Set multiple instances of namelists by creating a "user_nl_clm" directory - - Inside of the directory place - - user_nl_clm ---- namelist changes to make for ALL instances - user_nl_clm_1 -- namelist changes for first instance - user_nl_clm_2 -- namelist changes for first instance - user_nl_clm_3 -- namelist changes for third instance -. -. -. - - build-namelist will create a namelist for each instance of the model being run. - -List any changes to the defaults for the boundary datasets: domain files updated - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - scripts to scripts4_110812 - drv to drvseq4_0_04 - datm to datm8_110811 - csm_share to share3_110803 - mct to MCT2_7_0_110804a - pio to pio1_3_9 - -List all files eliminated: - ->>>>>>>>>> Delete some 4p and non-VOC tests to reduce testing - D models/lnd/clm/test/system/config_files/4p_vorsc_dm - D models/lnd/clm/test/system/config_files/17p_scnv_dm - D models/lnd/clm/test/system/config_files/4p_vorsc_do - D models/lnd/clm/test/system/config_files/17p_scnv_do - D models/lnd/clm/test/system/config_files/_scnv_dh - D models/lnd/clm/test/system/config_files/4p_vorsc_ds - D models/lnd/clm/test/system/config_files/17p_scnv_ds - D models/lnd/clm/test/system/config_files/_scnv_dm - D models/lnd/clm/test/system/config_files/_scnv_do - D models/lnd/clm/test/system/config_files/17p_scnv_m - D models/lnd/clm/test/system/config_files/17p_scnv_o - D models/lnd/clm/test/system/config_files/17p_scnv_s - D models/lnd/clm/test/system/config_files/4p_vorsc_h - D models/lnd/clm/test/system/config_files/4p_vorsc_o - D models/lnd/clm/test/system/config_files/17p_nrscnv_ds - D models/lnd/clm/test/system/config_files/4p_vonrsc_ds - D models/lnd/clm/test/system/config_files/4p_vorsc_dh - D models/lnd/clm/test/system/config_files/17p_scnv_dh - -List all files added and what they do: - ->>>>>>>>>> Add tests for multi-instance - A models/lnd/clm/test/system/config_files/_nrnil3sc_dh - A models/lnd/clm/test/system/config_files/_nrnil3sc_dm - A models/lnd/clm/test/system/config_files/_nil3sc_dh - A models/lnd/clm/test/system/config_files/_nil3sc_dm - A models/lnd/clm/test/system/nl_files/multi_inst/multi_inst - A models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_1 - A models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_2 - A models/lnd/clm/test/system/nl_files/multi_inst/multi_inst_3 - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>> Remove old tests add new multi-instance tests in - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_kraken - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_pretag_jaguarpf - M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi - M models/lnd/clm/test/system/tests_posttag_mirage - M models/lnd/clm/test/system/tests_posttag_intrepid_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/tests_posttag_lynx - ->>>>>>>>>> Handle clm* for multi-instance files, remove PFTDATA - M models/lnd/clm/test/system/TCB.sh -- Set pio/mct_dir in configure, send MACFILE - to make, and create clm exec temp for debug mode - M models/lnd/clm/test/system/TBL.sh --- compare clm* for multi-instance history - M models/lnd/clm/test/system/TBR.sh --- compare clm* for multi-instance history - M models/lnd/clm/test/system/TER.sh --- compare clm* for multi-instance history - M models/lnd/clm/test/system/TSMrst_tools.sh - compare clm* for multi-instance history - M models/lnd/clm/test/system/TSMpergro.sh - compare clm* for multi-instance history - M models/lnd/clm/test/system/TSMscript_tools.sh -- Remove PFTDATA setting - M models/lnd/clm/test/system/TSM.sh - compare clm* for multi-instance, cat lnd_in_000? files - M models/lnd/clm/test/system/input_tests_master -- add new multi_inst tests remove old - M models/lnd/clm/test/system/mknamelist - add quotes - M models/lnd/clm/test/system/README - Remove storm - M models/lnd/clm/test/system/README.testnames -- Add nil tests remove some 4p no-voc - M models/lnd/clm/test/system/TBLrst_tools.sh - compare clm* for multi-instance history - M models/lnd/clm/test/system/CLM_runcmnd.sh - remove storm - M models/lnd/clm/test/system/test_driver.sh -- use glade paths, add mct/pio_dir - add gres setting on jaguarpf, remove PFTDATA, remove storm, update cprnc on lynx - M models/lnd/clm/test/system/config_files/README - add nil3 config - change x resolution from T31 to f19 (no datasets at T31 for glc) - ->>>>>>>>>> Remove PFTDATA - M models/lnd/clm/test/system/nl_files/mksrfdt_10x15_irr_1850 --------- Remove PFTDATA - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850-2000 --- Remove PFTDATA - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_vancouverCAN_2000 -- Remove PFTDATA - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850 -------- Remove PFTDATA - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_numaIA_mp20irrcr_2000 -- Remove PFTDATA - ->>>>>>>>>> Remove PFTDATA and -p option, add -nobreak to cprnc.pl, print out more info - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - Remove PFTDATA - M models/lnd/clm/tools/ncl_scripts/cprnc.pl ----- Add -nobreak - M models/lnd/clm/tools/ncl_scripts/cprnc.ncl ----- Add BREAKONDIFF, print avg/max diffs - ->>>>>>>>>> Add NINST_LND and build with new MCT/PIO where need mct_pio_dir ->>>>>>>>>> Handle user_nl_clm directory for multi-instance - M models/lnd/clm/bld/configure - Add ninst_lnd/mct_dir/pio_dir options - change to work with new MCT/PIO - M models/lnd/clm/bld/config_files/config_definition.xml - add mct_dir/pio_dir/ninst_lnd/ninst_atm - M models/lnd/clm/bld/build-namelist - Add ability to write out multiple ensemble - namelist files, handle multiple infiles, and infile directories for multiple - ensembles - M models/lnd/clm/bld/clm.cpl7.template - handle NINST_LND add user_nl_clm directory - for multiple ensembles - ->>>>>>>>>> Compare grid/frac files, update domain files for datm, handle multiple infiles - M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl - compare grid/frac files - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - Add glc_pio stuff - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - New f45, f10, f09, - f19, T31 domain files - M models/lnd/clm/bld/namelist_files/datm-build-namelist - Be able to handle multiple - infiles - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml - Add glc_pio settings - ->>>>>>>>>> Handle multi-instance SPMD and files, remove fget_archdev, fix problem ->>>>>>>>>> of running on RTM grid (mvertens), handle scam restart files (still fails ->>>>>>>>>> because of PIO problem) - M models/lnd/clm/src/biogeochem/CNDVMod.F90 - Add inst_suffix to hv files - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 - Handle multiple instances and - multiple instances lnd_in and lnd_modelio.nml namelist files - M models/lnd/clm/src/main/fileutils.F90 -- Remove set_filename and putfil, simplify - getfil to NOT do archival retreival - M models/lnd/clm/src/main/ndepStreamMod.F90 - Handle multi-instances - M models/lnd/clm/src/main/histFileMod.F90 --- Pass mfilt to set_hist_filename, don't - require mfilt to be one if nhtfrq=0, only use monthly form of filenames if - nhtfrq=0 AND mfilt=1 - M models/lnd/clm/src/main/restFileMod.F90 - Handle multi-instance files - M models/lnd/clm/src/main/controlMod.F90 -- Remove fget_archdev - M models/lnd/clm/src/main/clm_varctl.F90 -- Remove fget_archdev, add inst_* vars - M models/lnd/clm/src/main/ncdio_pio.F90 --- Fix problem of running on RTM grid, handle - multi-instance files, pass vardesc to scam_field_offsets, handle landunit - in scam_field_offsets, start/count set for all dims, check that dimension - sizes and names are equal in order to share iodesc - M models/lnd/clm/src/main/spmdMod.F90 ---- spmd_init has LNDID passed in - M models/lnd/clm/src/main/histFldsMod.F90 - Fix units/long_names - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - Handle multi-instances and - multiple instances lnd_in and lnd_modelio.nml namelist files - M models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 -- Get LNDID - -Summary of testing: - - bluefire: All PASS except TBL tests and... ->>>>>>> rpointer.lnd_* files empty -017 erX51 TER.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -3+-2 cold ..............FAIL! rc= 7 -018 brX51 TBR.sh _nil3sc_dh clm_std^multi_inst 20020401:3600 10x15 USGS -2+-3 cold ..............FAIL! rc= 11 ->>>>>>> Build fails -020 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 4 -021 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -3+-7 cold ................FAIL! rc= 5 -022 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -5+-5 cold ................FAIL! rc= 5 ->>>>>>> Build fails -028 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 4 -029 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -3+-7 arb_ic ............FAIL! rc= 5 -030 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -5+-5 arb_ic ............FAIL! rc= 5 ->>>>>>> Build fails -032 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 96 cold ...............FAIL! rc= 4 -033 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 5 -034 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 5 - bluefire interactive testing: All PASS except... (pio bug 1396) -031 erAK4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -032 brAK4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 -036 brAK8 TBR.sh _nrsc_ds clm_std^nl_ptsmode_ocn 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .........FAIL! rc= 6 - bluefire/CESM testing: All PASS except... -FAIL ERS_RLA.f45_f45.I.bluefire -- pio bug 1396 ->>>>>>> Compare fails because of new domain files/new pftdyn -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_33 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_33 -BFAIL ERS_RLA.f45_f45.I.bluefire.generate.clm4_0_34 -BFAIL ERS_RLA.f45_f45.I.bluefire.compare.clm4_0_33 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_33 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_33 -FAIL SMS_ROA.f45_f45.I.bluefire.compare_hist.clm4_0_33 -FAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_33 -FAIL ERS_D.f19_g16.IGRCP26CN.bluefire.compare_hist.clm4_0_33 -- only glc map area? -FAIL ERP.f19_g16.IGRCP60CN.bluefire.compare_hist.clm4_0_33 ---- only glc map area? -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_33 -FAIL PST.f10_f10.I20TRCN.bluefire.compare.clm4_0_33 -FAIL PET_PT.f10_f10.I20TRCN.bluefire.compare.clm4_0_33 -FAIL SMS.f10_f10.IRCP45CN.bluefire.compare_hist.clm4_0_33 -FAIL SMS.f10_f10.IRCP45CN.bluefire.compare.clm4_0_33 - bluefire/PTCLM testing: All PASS - jaguarpf interactive testing: All PASS except... -014 erAK4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 7 -015 brAK4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -5+-5 cold .............FAIL! rc= 6 - edinburgh/lf95 interactive testing: All PASS, except TBL and... (pio bug 1396) -006 erAL4 TER.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 5 -007 brAL4 TBR.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -5+-5 cold ................FAIL! rc= 5 - mirage,storm/ifort interactive testing: All fail -- problem with pio build - yong/ifort interactive testing: All fail -- problem with pio build - -CLM tag used for the baseline comparison tests if applicable: clm4_0_33 - -Changes answers relative to baseline: No bit-for-bit, except: - - f10_f10, f45_f45, f09_f09, f19_f19, T31_T31, with new domain files - -=============================================================== -=============================================================== -Tag name: clm4_0_33 -Originator(s): erik (Erik Kluzek) -Date: Mon Jul 25 14:34:18 MDT 2011 -One-line Summary: Move changes on release branch over to trunk - -Purpose of changes: - -Move changes from release branch over to trunk. Update README files and documentation. -Add new tools testing. Use if masterproc and iulog for output. Move pft mksurfdata into -inputdata. rh files are t-1. All clm tools namelist items in XML database. Fix tools -Makefiles. Survey testlists, move tests around. Remove clm* from path, add quotes in test -scripts, remove CLM_CESMBLD. Remove getfil in mksurfdata, make fdynuse optional. Add --nomv to getregional. Cleanup help and improve documentation in scripts and XML database. -Update datm8/scripts/drv/cism/csm_share. Update pergro data. Changes answers because of -drv update to cesm1_0_beta22 version (answers are identical to cesm1_0_beta22). - -Bugs fixed (include bugzilla ID): - 1301 (Add doc on OpenMP fortran tools) - 1329 (Add new tool tests) - 1338 (Move raw pftdata into inputdata in XML database) - 1341 (Error running with crop for a single-point) - 1346 (save history namelist to the rh0 files NOT rh1) - 1351 (Add all CLM tools namelist items to XML) - 1351 (Problem with interpinic on non bluefire machines) - 1353 (Huge "ccsm.log" file) - 1367 (final_spinup stop time isn't right) -data) -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1309 (Problem with building T31 rcp pftdyn files) - 1325 (GDDHARV on hist causes model to die in debug) - 1339 (Increase streams file limit from 1000 to 2000) - 1358 (incorrect units for a few history fields) - 1360 (Can't do a ncdump on US-UMB data) - 1361 (Problem with transient compsets for PTCLM) - 1372 (pio problem writing out RTM hist fields at RTM res) - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1355 (tlai is zero for first two time-steps in CLMSP) - 1326 (Crop and irrigation sims give balance check error) - 1310 (Restart files different over different tasks) - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts/drv/shr/cism/datm - scripts to scripts4_110711 - drv to drvseq3_1_54 - datm to datm8_110624 - csm_share to share3_110717 - cism to cism1_110418 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>> Add new tests for tools - A models/lnd/clm/test/system/TOPtools.sh ------- Ensure different number of threads - give the same answers for tools - A models/lnd/clm/test/system/TBLscript_tools.sh Comparison test for script tools - A models/lnd/clm/test/system/TBLrst_tools.sh --- Comparison test for rst_tools - A models/lnd/clm/test/system/config_files/tools__do ---- Add OpenMP debug config - A models/lnd/clm/test/system/config_files/17p_nrscnv_ds Add non-RTM debug serial CN - ->>>>>>>>>>> Make copies of existing files to inside of ->>>>>>>>>>> individual tools so that tools can be standalone - A models/lnd/clm/tools/mksurfdata/clm_varpar.F90 - A models/lnd/clm/tools/mksurfdata/shr_file_mod.F90 - A models/lnd/clm/tools/mksurfdata/shr_timer_mod.F90 - A models/lnd/clm/tools/mksurfdata/shr_log_mod.F90 - A models/lnd/clm/tools/mksurfdata/fileutils.F90 - A models/lnd/clm/tools/mksurfdata/shr_const_mod.F90 - A models/lnd/clm/tools/mksurfdata/shr_string_mod.F90 - A models/lnd/clm/tools/mksurfdata/clm_varctl.F90 - A models/lnd/clm/tools/mksurfdata/shr_sys_mod.F90 - A models/lnd/clm/tools/mksurfdata/shr_kind_mod.F90 - A models/lnd/clm/tools/mksurfdata/nanMod.F90 - A models/lnd/clm/tools/mksurfdata/Mkdepends - A models/lnd/clm/tools/mksurfdata/clm_varpar.F90 - A models/lnd/clm/tools/mkgriddata/mkvarpar.F90 - A models/lnd/clm/tools/mkgriddata/clm_varctl.F90 - A models/lnd/clm/tools/mkgriddata/clm_varpar.F90 - A models/lnd/clm/tools/mkgriddata/shr_sys_mod.F90 - A models/lnd/clm/tools/mkgriddata/shr_log_mod.F90 - A models/lnd/clm/tools/mkgriddata/ncdio.F90 - A models/lnd/clm/tools/mkgriddata/shr_kind_mod.F90 - A models/lnd/clm/tools/mkgriddata/shr_const_mod.F90 - A models/lnd/clm/tools/mkgriddata/domainMod.F90 - A models/lnd/clm/tools/mkgriddata/areaMod.F90 - A models/lnd/clm/tools/mkgriddata/nanMod.F90 - A models/lnd/clm/tools/mkgriddata/Mkdepends - A models/lnd/clm/tools/mkdatadomain/Mkdepends - A models/lnd/clm/tools/mkdatadomain/shr_kind_mod.F90 - A models/lnd/clm/tools/mkdatadomain/shr_const_mod.F90 - ->>>>>>>>>>> Add new README files to talk about testing and file copies - A models/lnd/clm/tools/README.testing - A models/lnd/clm/tools/README.filecopies - ->>>>>>>>>>> Add a new chapter for PTCLM - A models/lnd/clm/doc/UsersGuide/ptclm.xml - -List all existing files that have been modified, and describe the changes: - - ->>>>>>>>>>> Remove CLM_CESMBLD, remove clm* in pathname, add quotes in tests ->>>>>>>>>>> fix some spelling and unused vars, add new scripts tests -M models/lnd/clm/test/system/TCB.sh -------------- Remove CLM_CESMBLD -M models/lnd/clm/test/system/TSMncl_tools.sh ----- Remove clm* in pathname -M models/lnd/clm/test/system/TBL.sh -------------- Remove clm* in pathname -M models/lnd/clm/test/system/README.testnames ---- Update for new tests -M models/lnd/clm/test/system/TBR.sh -------------- Remove unused cfgdir -M models/lnd/clm/test/system/TCBtools.sh --------- Remove clm* in pathname, fix spelling -M models/lnd/clm/test/system/TER.sh -------------- Remove unused cfgdir -M models/lnd/clm/test/system/test_driver.sh ------ Remove CLM_CESMBLD, change temp on lynx -M models/lnd/clm/test/system/TSMrst_tools.sh ----- Remove unused cfgdir, add quotes - in comparison -M models/lnd/clm/test/system/nl_files/getregional - Add -nomv option in -M models/lnd/clm/test/system/nl_files/mksrfdt_10x15_irr_1850 - Put -exedir last -M models/lnd/clm/test/system/input_tests_master --- Add TBLtools, TOPtools, - TBLrst_tools, TBLscript_tools tests in -M models/lnd/clm/test/system/TSMtools.sh ---------- Add CLM_RERUN (needed for - TOPtools which runs the same test over for different threads) - Remove clm* from path add quotes to some if tests -M models/lnd/clm/test/system/TBLtools.sh ---------- Remove clm* from path - ->>>>>>>>>>> Move tests around a bit -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - Add TOP test -M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi -M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>> Make fdynuse file optional and remove use of getfil -M models/lnd/clm/tools/mksurfdata/mklaiMod.F90 ---- Remove fdynuse file, - remove use of getfil, all averaging is the same (no *_pft options) -M models/lnd/clm/tools/mksurfdata/mksoilMod.F90 --- Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkharvestMod.F90 Remove use of getfil -M models/lnd/clm/tools/mksurfdata/creategridMod.F90 Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkglcmecMod.F90 - Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkvocefMod.F90 -- Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkglacierMod.F90 Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkurbanparMod.F90 Remove use of getfil -M models/lnd/clm/tools/mksurfdata/areaMod.F90 ----- Remove _pft methods -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ---- Make mksrf_fdynuse optional - remove use of getfil -M models/lnd/clm/tools/mksurfdata/mklanwatMod.F90 - Remove use of getfil -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 ---- Remove use of getfil -M models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850-2005.txt -- new paths - ->>>>>>>>>>> Updated RMS differences, and add -nomv option to getregional_datasets -M models/lnd/clm/tools/ncl_scripts/RMSbluefire.dat ---------- Updated RMS differences -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -- Add -nomv option -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - Add NOMV env var - ->>>>>>>>>>> Fix bug 1351 -M models/lnd/clm/tools/interpinic/interpinic.F90 -------- Make sure: htop_var, - fpcgrid_var, present_var, itypveg_var are set -M models/lnd/clm/tools/interpinic/interpinic.runoptions - Update the input file to use - ->>>>>>>>>>> Work on formatting, remove use of getfils -M models/lnd/clm/tools/mkgriddata/mkgriddata.F90 - Work on formatting a bit, - removed use of fileutils -M models/lnd/clm/tools/mkgriddata/areaMod.F90 ---- Remove use of getfil -M models/lnd/clm/tools/mkdatadomain/create_domain.F90 - Work on output write - ->>>>>>>>>>> Update documentation in README files -M models/lnd/clm/test/system/config_files/README -M models/lnd/clm/bld/namelist_files/use_cases/README -M models/lnd/clm/test/system/README -M models/lnd/clm/tools/mkgriddata/README -M models/lnd/clm/tools/mkdatadomain/README -M models/lnd/clm/tools/interpinic/README -M models/lnd/clm/tools/README.testing -M models/lnd/clm/tools/README -M models/lnd/clm/bld/README - ->>>>>>>>>>> Sync up tools Makefile, make Filepath standalone (only includes .) ->>>>>>>>>>> Work on formatting, set OPT default, add TOOLROOT default ->>>>>>>>>>> compare to null instead of strip -M models/lnd/clm/tools/mksurfdata/Makefile -M models/lnd/clm/tools/mksurfdata/Filepath -M models/lnd/clm/tools/mksurfdata/Srcfiles - Remove spmdMod,fileutils, - abortutils/shr_cal_mod, ESMF, mpi, shr_mpi_mod -M models/lnd/clm/tools/interpinic/Makefile -M models/lnd/clm/tools/mkgriddata/Filepath -M models/lnd/clm/tools/mkgriddata/Srcfiles - Remove fileutils,spmdMod, - abortutils,shr_timer_mod,shr_mpi_mod,shr_file_mod,MPI -M models/lnd/clm/tools/mkgriddata/Makefile -M models/lnd/clm/tools/mkdatadomain/Filepath -M models/lnd/clm/tools/mkdatadomain/Makefile - ->>>>>>>>>>> Cleanup help and documentation -M models/lnd/clm/bld/configure --------------- Cleanup help, remove cesm_bld -M models/lnd/clm/bld/queryDefaultNamelist.pl - Cleanup help -M models/lnd/clm/bld/listDefaultNamelist.pl -- Add more description, documentation - set maxpft for crop -M models/lnd/clm/bld/build-namelist ---------- Cleanup help, add papi_inparm - remove some list options for non-CLM vars -M models/lnd/clm/bld/clm.cpl7.template ------- Remove clm* in path - remove warning about CAM and CLM dtime, remove comment about *.h files - ->>>>>>>>>>> Make sure all 1x1 files are in supported single-point res -M models/lnd/clm/bld/config_files/config_definition.xsl - Add CLM in descriptions -M models/lnd/clm/bld/config_files/config_definition.xml - Add - 1x1_numaIA,1x1_smallvilleIA to supported single-point resolutions - cleanup spelling and a few descriptions - ->>>>>>>>>>> Work on documentation descriptions, document all tools namelist items -M models/lnd/clm/bld/namelist_files/checklatsfiles.ncl --------- Add doc, continue - if file NOT found rather than abort -M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl --------- Add doc, continue - if file NOT found rather than abort -M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Work on descriptions, - add in all mksurfdata/mkdatadomain/mkgriddata namelist vars, add in - new driver namelist vars (so documented in table in UG), - add HCN,CH3CN to drydep -M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Add datasource - small formatting change -M namelist_files/namelist_defaults_drv.xml --------------------- Fix final_spinup - (bug 1367) -M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl ------ Add attributes - to output for: crop, irrig, ad_spinup, and source -M models/lnd/clm/bld/namelist_files/namelist_definition.xsl ---- Work to improve - output formatting of table -M models/lnd/clm/bld/namelist_files/datm-build-namelist -------- Cleanup help / source -M models/lnd/clm/bld/namelist_files/checktopofiles.ncl --------- Change res list, - add documentation, continue rather than abort if file not found -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml Update paths - to landuse for mksurfdata as all in repo now, add default values for - other mksurfdata namelist items - ->>>>>>>>>>> Update documentation for latest release -M models/lnd/clm/doc/UsersGuide/trouble_shooting.xml -M models/lnd/clm/doc/UsersGuide/single_point.xml -M models/lnd/clm/doc/UsersGuide/special_cases.xml -M models/lnd/clm/doc/UsersGuide/tools.xml -M models/lnd/clm/doc/UsersGuide/limitLineLen.pl -M models/lnd/clm/doc/UsersGuide/preface.xml -M models/lnd/clm/doc/UsersGuide/clm_ug.xml -M models/lnd/clm/doc/UsersGuide/adding_files.xml -M models/lnd/clm/doc/UsersGuide/appendix.xml -M models/lnd/clm/doc/UsersGuide/custom.xml -M models/lnd/clm/doc/UsersGuide/Makefile - ->>>>>>>>>>> Update documentation for latest release -M models/lnd/clm/doc/Quickstart.userdatasets -M models/lnd/clm/doc/IMPORTANT_NOTES -M models/lnd/clm/doc/Quickstart.GUIDE -M models/lnd/clm/doc/CodeReference/Filepath -M models/lnd/clm/doc/KnownLimitations -M models/lnd/clm/doc/KnownBugs -M models/lnd/clm/doc/README -M README - ->>>>>>>>>>> Add if masterproc, work on documentation, use iulog NOT unit 6 -M models/lnd/clm/src/biogeochem/CropRestMod.F90 ---------- Add if masterproc -M models/lnd/clm/src/biogeochem/CASAMod.F90 -------------- Cleanup endrun statement -M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 --- Use iulog NOT unit 6 -M models/lnd/clm/src/biogeochem/CNDVMod.F90 -------------- Use iulog NOT unit 6 -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ------- Use iulog NOT unit 6 -M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 ------ Ensure arepr is initialized - (bug 1341) -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - Comment out debug write -M models/lnd/clm/src/biogeochem/CNDVEstablishmentMod.F90 - Use iulog NOT unit 6 - ->>>>>>>>>>> Add if masterproc, work on documentation, rh files are t-1 -M models/lnd/clm/src/main/fileutils.F90 --- Add if masterproc -M models/lnd/clm/src/main/pftdynMod.F90 --- Add if masterproc (fix bug 1353) -M models/lnd/clm/src/main/histFileMod.F90 - Add if masterproc, rh files are t-1 - (bug 1346) -M models/lnd/clm/src/main/clmtype.F90 ----- Work on documentation - - -Summary of testing: - - bluefire: All PASS except... (up to 43) -004 blC91 TBL.sh _sc_dh clm_std^nl_urb 20030101:3600 4x5 gx3v7 -6 arb_ic ........................FAIL! rc= 5 -008 blTZ1 TBL.sh 21p_cncrpsc_dh clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 5 -011 blD91 TBL.sh _persc_dh clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 5 -015 blEH1 TBL.sh 4p_vorsc_dh clm_std^nl_urb 20021231:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic ......FAIL! rc= 5 -019 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:1800 1.9x2.5 gx1v6@1850-2100 -10 cold FAIL! rc= 5 -023 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:1800 10x15 USGS@2000 -90 cold ..................FAIL! rc= 5 -027 blHo1 TBL.sh 17p_cnsc_dh clm_drydep 20000101:1800 10x15 USGS@2000 -10 cold ..................FAIL! rc= 5 -028 smG41 TSM.sh 17p_scnv_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ...........FAIL! rc= 10 -029 erG41 TER.sh 17p_scnv_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic .........FAIL! rc= 5 -030 brG41 TBR.sh 17p_scnv_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic .........FAIL! rc= 5 -031 blG41 TBL.sh 17p_scnv_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ...........FAIL! rc= 4 -035 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 5 -039 blG61 TBL.sh _scnv_dh clm_std^nl_urb 20020101:1800 1.9x2.5 gx1v6 48 startup .................FAIL! rc= 5 -043 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 48 cold ...............FAIL! rc= 5 - bluefire interactive testing: All PASS except TBL tests - bluefire/CESM testing: All PASS except compare tests to clm4_0_32 - bluefire/CESM extra testing (show that answers are identical with cesm1_0_beta22): -PASS ERI.T31_g37.IGCN.bluefire -PASS ERI.T31_g37.IGCN.bluefire.compare.cesm1_0_alpha22a -PASS ERS.T31_g37.ITEST.bluefire -PASS ERS.T31_g37.ITEST.bluefire.compare_hist.cesm1_0_alpha22a -PASS ERS.T31_g37.ITEST.bluefire.compare.cesm1_0_alpha22a -PASS ERS.f19_g16.IGCN.bluefire -PASS ERS.f19_g16.IGCN.bluefire.compare_hist.cesm1_0_alpha22a -PASS ERS.f19_g16.IGCN.bluefire.compare.cesm1_0_alpha22a -PASS ERS.f45_g37.I4804.bluefire -PASS ERS.f45_g37.I4804.bluefire.compare_hist.cesm1_0_alpha22a -PASS ERS.f45_g37.I4804.bluefire.compare.cesm1_0_alpha22a -PASS SMS_RLA.f45_f45.I.bluefire -PASS SMS_RLA.f45_f45.I.bluefire.compare_hist.cesm1_0_alpha22a -PASS SMS_RLA.f45_f45.I.bluefire.compare.cesm1_0_alpha22a -PASS SMS_RLB.f45_f45.ITEST.bluefire -PASS SMS_RLB.f45_f45.ITEST.bluefire.compare_hist.cesm1_0_alpha22a -PASS SMS_RLB.f45_f45.ITEST.bluefire.compare.cesm1_0_alpha22a - jaguarpf interactive testing: All PASS except... -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:1800 1x1_brazil navy -10 arb_ic ...............FAIL! rc= 5 -008 blTZ3 TBL.sh 21p_cncrpsc_do clm_stdIgnYr^nl_crop 20020401:3600 10x15 USGS -10 cold ..........FAIL! rc= 5 -012 blVU4 TBL.sh 21p_cncrpsc_ds clm_stdIgnYr^nl_crop 20020101:3600 1x1_smallvilleIA test -1100 cold FAIL! rc= 5 -014 blAK4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -10 cold ...............FAIL! rc= 5 -015 smG43 TSM.sh 17p_scnv_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ...........FAIL! rc= 10 -016 erG43 TER.sh 17p_scnv_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic .........FAIL! rc= 5 -017 brG43 TBR.sh 17p_scnv_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic .........FAIL! rc= 5 -018 blG43 TBL.sh 17p_scnv_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ...........FAIL! rc= 4 -022 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:1800 1x1_brazil navy -670 arb_ic .................FAIL! rc= 5 -026 blSn3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp8.5 20331231:1800 1.9x2.5 gx1v6@1850-2100 48 arFAIL! rc= 5 -030 blQQ4 TBL.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -150 cold .............FAIL! rc= 5 -034 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 5 -038 blS63 TBL.sh _mec10sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ...................FAIL! rc= 5 -040 bl8Z3 TBLrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6FAIL! rc= 5 -042 bl954 TBLscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_10x15_irr_1850^tools__ds ..........FAIL! rc= 6 -046 bl9T4 TBLscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_1x1_numaIA_mp20irrcr_2000^tools__ds FAIL! rc= 6 -050 bl9C4 TBLscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_1x1_vancouverCAN_2000^tools__ds ...FAIL! rc= 6 - edinburgh/lf95 interactive testing: All PASS except... -006 blAL4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 7 -014 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:3600 1x1_vancouverCAN navy 331 arb_ic ...FAIL! rc= 7 - edinburgh/lf95 testing: All PASS except TBL tests - lynx/intel testing: All PASS except TBL tests - -CLM tag used for the baseline comparison tests if applicable: clm4_0_32 - -Changes answers relative to baseline: Yes (Driver change) - - But, answers are identical to cesm1_0_beta22 where the driver change - was already in effect. - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: larger than roundoff/same climate - -=============================================================== -=============================================================== -Tag name: clm4_0_32 -Originator(s): erik (Erik Kluzek) -Date: Thu May 19 15:18:49 MDT 2011 -One-line Summary: Make I1850SPINUPCN compset use MOAR data, various bug fixes, work on test lists - -Purpose of changes: - -Update datm and scripts so can run I1850SPINUPCN compset with MOAR data. Fix CN units. -Fix some documentation for crop. Add attribute that notes that flux variables are NOT -multiplied by landfrac. Change align year for I4804 and I4804CN compsets, add append/warn -option to xmlchange. Some clarifications to clm namelist. build-namelist can run list -options without a config_cache file. Add comment/title to output files. Remove the -2.65x3.33 grid, no longer supported. Work on test lists a bit. - -Bugs fixed (include bugzilla ID): - 1337 (have ISPINUPCN compset use MOAR data) - 1336 (evaluate CLM testing for release) - 1327 (correct documentation of CN variable units) - 1158 (make 4804 compsets consistent with 1850 etc.) - 1151 (remove co2_ppmv when co2_type is NOT constant) - 1140 (build-namelist -list options die with config file) - 1108 (have append/warn mode for xmlchange) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1325 (GDDHARV on hist causes model to die in debug) - 1367 (final_spinup stop time isn't right) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: - - I1850SPINUP compset changed to use MOAR data - - DATM_CPL_* variables added to env_conf.xml to set casename, years run over - I4804 compsets ALIGN year changed to agree with doc. and I1850 compsets - - New options to xmlchange -- allow you to append (-a) to the end of something already - there and another option (-w) warn you and abort if already set. - -Describe any changes made to the namelist: Add options to build-namelist - - Add -co2_ppmv and -rtm_tstep options to set co2_ppmv when co2_type is constant - and set rtm time-step when RTM is on. - - This way co2_ppmv and rtm_nsteps do NOT show up in the namelist if they aren't needed. - -List any changes to the defaults for the boundary datasets: Remove 2.65x3.33 datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, slevis (units change), sacks (crop doc) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share, datm - scripts to scripts4_110517 - csm_share to share3_110516 - datm to datm8_110517b - -List all files eliminated: - ->>>>>>>>>>>>> Remove as no longer needed to get lists for documentation - D models/lnd/clm/doc/UsersGuide/config_cache.xml - -List all files added and what they do: - ->>>>>>>>>>>>> Add new test configurations - A models/lnd/clm/test/system/config_files/_scnv_dm - A models/lnd/clm/test/system/config_files/17p_scnv_dm - A models/lnd/clm/test/system/config_files/17p_scnv_ds - A models/lnd/clm/test/system/config_files/17p_nrcnsc_do - A models/lnd/clm/test/system/config_files/17p_nrcnsc_ds - A models/lnd/clm/test/system/config_files/17p_scnv_m - A models/lnd/clm/test/system/config_files/17p_scnv_o - A models/lnd/clm/test/system/config_files/17p_scnv_s - A models/lnd/clm/test/system/config_files/17p_cnnfsc_dh -- turn on NOFIRE - A models/lnd/clm/test/system/config_files/17p_cnnfsc_dm -- turn on NOFIRE - A models/lnd/clm/test/system/config_files/17p_cnnfsc_do -- turn on NOFIRE - A models/lnd/clm/test/system/config_files/21p_nrcncrpsc_s - A models/lnd/clm/test/system/config_files/21p_nrcncrpsc_ds - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/config_files/README - ->>>>>>>>>>>>> Change tests a bit to make them more consistent with naming convention ->>>>>>>>>>>>> make sure tests are covered, and have no-RTM tests for single-point - M models/lnd/clm/test/system/README.testnames - M models/lnd/clm/test/system/nl_files/clm_spin --- Use MOAR data on bluefire - M models/lnd/clm/test/system/input_tests_master - ->>>>>>>>>>>>> Change test lists - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_posttag_kraken - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_pretag_jaguarpf - M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi - M models/lnd/clm/test/system/tests_posttag_mirage - M models/lnd/clm/test/system/tests_posttag_intrepid - M models/lnd/clm/test/system/tests_posttag_intrepid_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/tests_posttag_lynx - ->>>>>>>>>>>>> Add -co2_ppmv, and -rtm_tstep options to build-namelist ->>>>>>>>>>>>> Don't require config file for build-namelist list options ->>>>>>>>>>>>> Remove 2.65x3.33 files, add capability to handle MOAR data - M models/lnd/clm/bld/build-namelist - M models/lnd/clm/bld/clm.cpl7.template - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - M models/lnd/clm/bld/namelist_files/datm-build-namelist - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - ->>>>>>>>>>>>> Correct documentation of units from kg to g - M models/lnd/clm/src/biogeochem/CNMRespMod.F90 - M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 -- Also documentation changes - from Bill Sacks - M models/lnd/clm/src/biogeochem/CNDecompMod.F90 - M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 - M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - ->>>>>>>>>>>>> Add title and comment attributes to output files - M models/lnd/clm/src/main/histFileMod.F90 - M models/lnd/clm/src/main/restFileMod.F90 - -Summary of testing: - - bluefire interactive testing: All PASS up to... -006 smC97 TSM.sh _sc_do clm_spin^nl_urb 20030101:1800 4x5 gx3v7@1850 -6 arb_ic ..................FAIL! rc= 10 - bluefire/CESM testing: All PASS except... -BFAIL PST.f45_g37.I1850CN.bluefire.compare.clm4_0_31 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_31 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_31 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_31 -Originator(s): erik (Erik Kluzek) -Date: Fri May 13 17:11:38 MDT 2011 -One-line Summary: Fix answers for transient_CN, fix interpinic - -Purpose of changes: - -Fix interpinic test with finidat files. Fix CNPrecisionControl so answers with transient -CN are same as clm4_0_26 without crop. - -Bugs fixed (include bugzilla ID): - 1335 (transient_CN sometimes different than clm4_0_26) - 1299 (interpinic does NOT work going from non glc_mec) - 1318 (interpinic has trouble with new restart files) - 1319 (interpinic doesn't interpolate *_PERIOD) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1325 (GDDHARV on hist causes model to die in debug) - 1367 (final_spinup stop time isn't right) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>>>> Add transient 20th Century namelist config - A models/lnd/clm/test/system/nl_files/clm_transient_20thC - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Add f19 transient-CN tests that start in 1979 (which showed bug 1335) - M models/lnd/clm/test/system/input_tests_master - Add f19 transient CN tests - Also make glc_nec interpinic test run for f09@1850 - M models/lnd/clm/test/system/README.testnames --- Add run-4 for f19 transient CN - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi ------ Add f19 transient_CN -test - M models/lnd/clm/test/system/tests_posttag_purempi_regression - Add f19 transient_CN -test - M models/lnd/clm/test/system/tests_posttag_hybrid_regression -- Add f19 transient_CN -test - M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi ------ Add f19 transient_CN -test - M models/lnd/clm/test/system/tests_posttag_nompi_regression --- Add f19 transient_CN -test - ->>>>>>>>>>>>>> Put changes from clm4_0_27 back in except those that cause runs to fail - M models/lnd/clm/tools/interpinic/interpinic.F90 - M models/lnd/clm/tools/interpinic/Srcfiles ------ Add shr_const_mod.F90 back in - ->>>>>>>>>>>>>> - M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 - Add if ( crop_prog ) to - a crop change that needed it - M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 ---- Remove pft_ctrunc not used - M models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 -- Remove pft_ctrunc not used - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 -------- Set wesveg for crop_prog - -Summary of testing: - - bluefire extra interactive testing: -001 bl853 TBLtools.sh interpinic tools__o runoptions ............................................PASS -001 sm893 TSMrst_tools.sh _sc_do interpinic clm_std^nl_urb 20000101:1800 1.9x2.5 gx1v6 4x5 gx3v7 -1 PASS -001 sm857 TSMrst_tools.sh 17p_cnsc_o interpinic clm_std^nl_urb 18500101:1800 1.9x2.5 gx1v6@1850 10x1PASS -002 sm8Z3 TSMrst_tools.sh 21p_cncrpsc_do interpinic clm_stdIgnYr^nl_crop 20000101:1800 1.9x2.5 gx1v6PASS -003 sm813 TSMrst_tools.sh 17p_cndvsc_do interpinic clm_std^nl_urb 18500101:1800 1.9x2.5 gx1v6@1850 4PASS ->>>>> This test compares to clm4_0_30 and rightly shows that answers change -001 blH43 TBL.sh 17p_cnsc_do clm_transient_20thC 19790101:1800 1.9x2.5 gx1v6@1850-2000 -10 startup FAIL! rc= 7 - bluefire/CESM testing: All PASS except... (why did these comparisons PASS in clm4_0_27) -BFAIL ERP.f19_g16.IGRCP60CN.bluefire.compare.clm4_0_30 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_30 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_30 - bluefire/CESM testing compared to cesm1_0_beta19: -PASS SMS_D.f09_g16.BRCP45CN.bluefire -PASS SMS_D.f09_g16.BRCP45CN.bluefire.compare_hist.cesm1_0_beta19 -PASS SMS_D.f09_g16.BRCP45CN.bluefire.compare.cesm1_0_beta19 -PASS ERS.f09_f09.FAMIPCN.bluefire -PASS ERS.f09_f09.FAMIPCN.bluefire.compare_hist.cesm1_0_beta19 -PASS ERS.f09_f09.FAMIPCN.bluefire.compare.cesm1_0_beta19 -PASS ERS.f19_f19.FAMIPC5.bluefire -PASS ERS.f19_f19.FAMIPC5.bluefire.compare_hist.cesm1_0_beta19 -PASS ERS.f19_f19.FAMIPC5.bluefire.compare.cesm1_0_beta19 -PASS ERS.f19_f19.FAMIPCN.bluefire -PASS ERS.f19_f19.FAMIPCN.bluefire.compare_hist.cesm1_0_beta19 -PASS ERS.f19_f19.FAMIPCN.bluefire.compare.cesm1_0_beta19 -PASS ERS.f09_g16.BRCP45CN.lynx_pgi -PASS ERS.f09_g16.BRCP45CN.lynx_pgi.compare_hist.cesm1_0_beta19 -PASS ERS.f09_g16.BRCP45CN.lynx_pgi.compare.cesm1_0_beta19 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_30 - -Changes answers relative to baseline: Some transient_CN tests are different - because of bug 1335 introduced in clm4_0_27 - - With these changes answers are the same as clm4_0_26 - -=============================================================== -=============================================================== -Tag name: clm4_0_30 -Originator(s): erik (Erik Kluzek) -Date: Wed May 11 14:32:19 MDT 2011 -One-line Summary: New finidat/fsurdat files for T31 - -Purpose of changes: - -Externals update, fix some PTCLM problems. New finidat/fsurdat files for T31, make sure -works. - -Bugs fixed (include bugzilla ID): - 1279 (Latest version of PTCLM requires python2.5) - 1248 (PTCLM can only go to 2005) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1299 (interpinic does NOT work going from non glc_mec) - 1318 (interpinic has trouble with new restart files) - 1319 (interpinic doesn't interpolate *_PERIOD) - 1325 (GDDHARV on hist causes model to die in debug) - 1335 (transient_CN sometimes different than clm4_0_26) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New finidat files for T31 - New fsurdat file for T31@2000 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, mct, pio - - scripts to scripts4_110511 - mct to MCT2_7_0_110504a - pio to pio1_3_0 - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/test/system/config_files/17p_cnsc_h - A models/lnd/clm/test/system/config_files/17p_cnsc_o - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/README.testnames --- Add R f19 rcp4.5 resol - M models/lnd/clm/test/system/input_tests_master - Make some tests startup, add - some rcp tests, change some tests from T31 to f19 - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Add new finidat - files for T31@1850/2000, add new surdata file for T31@2000, remove empty - half-degree pftdyn file - -Summary of testing: - - bluefire: All PASS except... -024 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -025 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -026 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -027 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -049 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -050 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -051 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -052 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 -054 erJ61 TER.sh 4p_casasc_dh clm_std^nl_urb 20021230:1800 1.9x2.5 gx1v6 10+38 cold .............FAIL! rc= 5 -055 brJ61 TBR.sh 4p_casasc_dh clm_std^nl_urb_br 20021230:1800 1.9x2.5 gx1v6 72+72 cold ..........FAIL! rc= 5 -056 blJ61 TBL.sh 4p_casasc_dh clm_std^nl_urb 20021230:1800 1.9x2.5 gx1v6 48 cold ................FAIL! rc= 4 - bluefire interactive testing: All PASS - bluefire extra interactive testing: -001 smE13 TSM.sh 17p_vorsc_do clm_std^nl_urb 20021230:1800 48x96 gx3v7 96 startup ...............PASS -001 smH13 TSM.sh 17p_cnsc_do clm_ndepdyn^nl_cn_conly 20020101:1800 48x96 gx3v7@1850-2000 96 startup PASS - bluefire/CESM testing: All PASS except... -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_29 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_29 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_29 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_29 -FAIL SMS_ROA.f45_f45.I.bluefire.compare_hist.clm4_0_29 -FAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_29 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_29 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_29 -BFAIL ERS_E.T31_g37.I1850.bluefire.compare.clm4_0_29 -BFAIL ERI.T31_g37.IG1850.bluefire.compare.clm4_0_29 -BFAIL ERS_D.f19_g16.IGRCP26CN.bluefire.compare.clm4_0_29 - - bluefire/CESM rcps extra testing: All PASS... -PASS SMS.f09_g16.IRCP26CN.bluefire -PASS SMS.f09_g16.IRCP45CN.bluefire -PASS SMS.f09_g16.IRCP60CN.bluefire -PASS SMS.f09_g16.IRCP85CN.bluefire -PASS SMS.f09_g16.IGRCP26CN.bluefire -PASS SMS.f09_g16.IGRCP45CN.bluefire -PASS SMS.f09_g16.IGRCP60CN.bluefire -PASS SMS.f09_g16.IGRCP85CN.bluefire -PASS SMS.f19_g16.IRCP26CN.bluefire -PASS SMS.f19_g16.IRCP45CN.bluefire -PASS SMS.f19_g16.IRCP60CN.bluefire -PASS SMS.f19_g16.IGRCP45CN.bluefire -PASS SMS.f19_g16.IGRCP85CN.bluefire - - bluefire/PTCLM testing: All PASS - -CLM tag used for the baseline comparison tests if applicable: clm4_0_29 - -Changes answers relative to baseline: no bit-for-bit (except T31 with new files) - -=============================================================== -=============================================================== -Tag name: clm4_0_29 -Originator(s): erik (Erik Kluzek) -Date: Thu May 5 14:19:04 MDT 2011 -One-line Summary: Backout interpinic changes to one that works - -Purpose of changes: - -Backout interpinic to Mariana's non2dgrid version. Won't work for new -files (have to remove fields to get it to work). Adds back in bugs 1318 and 1319. -Add more comparison tests for tools and add cprnc.pl/ncl scripts to compare files that -don't have a time-axis. - -Bugs fixed (include bugzilla ID): - 1328 (interpinic gives bad results that can NOT be used!) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1299 (interpinic does NOT work going from non glc_mec) - 1318 (interpinic has trouble with new restart files) - 1319 (interpinic doesn't interpolate *_PERIOD) - 1325 (GDDHARV on hist causes model to die in debug) - 1335 (transient_CN sometimes different than clm4_0_26) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>>>> Add scripts to compare two NetCDF files and report if different ->>>>>>>>>>>>>> This mimic's the cprnc program, but also works on files without ->>>>>>>>>>>>>> a time coordinate. For big files it's considerably slower as well. - A models/lnd/clm/tools/ncl_scripts/cprnc.pl - A models/lnd/clm/tools/ncl_scripts/cprnc.ncl - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Add tool comparison tests, use cprnc.pl for tool comparison - M models/lnd/clm/test/system/input_tests_master - Add TBLtools test for: - mkgriddata, mksurfdata, mkdatadomain, and interpinic, remove pftdyn - mksurfdata test - M models/lnd/clm/test/system/CLM_compare.sh ----- Remove unused variable - M models/lnd/clm/test/system/TSMtools.sh -------- Copy .txt files over if exist - M models/lnd/clm/test/system/TBLtools.sh -------- Use cprnc.pl in place of cprnc binary - ->>>>>>>>>>>>>> Add tool comparison tests - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>>>>> Add notes on cprnc tools - M models/lnd/clm/tools/ncl_scripts/README - ->>>>>>>>>>>>>> Move back to Mariana's version of interpinic in non2dgrid08_clm4_0_26 ->>>>>>>>>>>>>> This means it won't work for new files, but will work for older files ->>>>>>>>>>>>>> and gives the same answers as the non2dgrid version. - M models/lnd/clm/tools/interpinic/interpinic.F90 - M models/lnd/clm/tools/interpinic/Srcfiles - - -Summary of testing: - - bluefire interactive testing: These PASS - -002 bl853 TBLtools.sh interpinic tools__o runoptions ............................................PASS (same as non2dgrid08_clm4_0_26) -001 bl754 TBLtools.sh mksurfdata tools__s namelist ..............................................PASS -002 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................PASS -001 bl654 TBLtools.sh mkgriddata tools__ds namelist .............................................PASS -001 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................PASS -002 blZ94 TBLtools.sh mkdatadomain tools__ds namelist ...........................................PASS - - yong/ifort interactive testing: These PASS - -001 bl853 TBLtools.sh interpinic tools__o runoptions ............................................PASS (same as non2dgrid08_clm4_0_26) - -CLM tag used for the baseline comparison tests if applicable: clm4_0_28 - -Changes answers relative to baseline: no bit-for-bit (except interpinic) - -=============================================================== -=============================================================== -Tag name: clm4_0_28 -Originator(s): erik (Erik Kluzek) -Date: Tue May 3 09:14:24 MDT 2011 -One-line Summary: Remove DUST/PROGSSLT in land coupler layer, update driver and scripts - -Purpose of changes: - -Update drv to branch version, fix ram1/fv issue (remove DUST/PROGSSLT #ifdef's in -lnd_comp_*). Answers will then be identical to clm4_0_26 (except air density sent to -cpl). Don't allow both -irrig and -crop to be on at same time in scripts. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1299 (interpinic does NOT work going from non glc_mec) - 1325 (GDDHARV on hist causes model to die in debug) - 1328 (interpinic gives bad results that can NOT be used!) - 1335 (transient_CN sometimes different than clm4_0_26) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): drv, scripts - scripts to scripts4_110428a - drv to branch version: t3148b_tags/t3148b02_drvseq3_1_48 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/build-namelist - Don't allow crop and irrig on at same time - - M models/lnd/clm/tools/interpinic/interpinic.F90 -------- Move input read up - M models/lnd/clm/tools/interpinic/interpinic.runoptions - Use latest input file - - M models/lnd/clm/test/system/tests_pretag_bluefire -- Remove some tests - M models/lnd/clm/test/system/README.testnames ------- Don't mix crop and irrig - M models/lnd/clm/test/system/input_tests_master ----- Change irrig+crop tests to - just crop - - ->>>>>>>>>> Remove DUST, PROGSSLT and VOC #ifdef's - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - -Summary of testing: - - bluefire: All PASS except... -024 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -025 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -026 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -027 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -049 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -050 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -051 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -052 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -058 sm8Z3 TSMrst_tools.sh 21p_cncrpsc_do interpinic clm_irrig^nl_crop 20000101:1800 1.9x2.5 gx1v6 10FAIL! rc= 4 - bluefire/CESM testing: All PASS except... (compare to clm4_0_26 with updated datm) -SFAIL ERS_D.T31_g37.IGRCP26CN.bluefire.GC.160557 -SFAIL ERP.T31_g37.IGRCP60CN.bluefire.GC.160557 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_26_datmdens -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_26_datmdens - -CLM tag used for the baseline comparison tests if applicable: clm4_0_27 - -Changes answers relative to baseline: No bit-for-bit - Although coupler log file will show changes in fv and ram1 to clm4_0_27, but - will be identical to clm4_0_26 (although then dens in atm changes) - -=============================================================== -=============================================================== -Tag name: clm4_0_27 -Originator(s): erik (Erik Kluzek) -Date: Mon May 2 09:37:57 MDT 2011 -One-line Summary: Move crop branch over to trunk - -Purpose of changes: - -Move crop branch to trunk. Add crop and noio options to configure. maxpft option to -configure can now only be a number (removing numpft+1 option to it). Add datasets for -crop. Add T31 historical and rcp2.6 transient dynpft datasets. Remove some of the CPP -tokens (DUST, PROGSSLT, etc.) Bring Marian Vertensteins version of interpinic over to the -trunk as well. This version is faster and is able to run for higher resolution cases. -Remove scaled_harvest and carbon_only namelist options and add suplnitro option -(supplemental Nitrogen which can be: NONE, PROG_CROP_ONLY, or ALL). Add number parameters -for the different nsrest settings, and have only one copy of is_restart in -clm_time_manager. Update to ESMF interface from Tony. - -Bugs fixed (include bugzilla ID): - 1323 (Remove some unused items) - 1319 (interpinic doesn't interpolate *_PERIOD) - 1318 (interpinic has trouble with new restart files) - 1303 (remove complexity of no-urban in interpinic) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 901 (remove some CPP tokens) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1299 (interpinic does NOT work going from non glc_mec) - 1325 (GDDHARV on hist causes model to die in debug) - 1328 (interpinic gives bad results that can NOT be used!) - 1335 (transient_CN sometimes different than clm4_0_26) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: Yes - - Add -crop and -noio options to configure, remove -dust and -progsslt options - Remove "numpft+1" option to -maxpft. maxpft can go up to 17 without crop and - needs to be 21 for crop. - - -crop adds the CROP #ifdef. Removes the DUST, PROGSSLT, CLAMP CPP tokens. - Also remove: DISTURB, COUP_WRF, NO_DAYLEN_VCMAX, TCX_REMOVE_SEE_NOTES_ABOVE, and - L2R_Decomp, and some testing/debug CPP defines - -Describe any changes made to the namelist: Yes - - Remove Carbon_only and scaled_harvest options - Add suplnitro option which can be set to: NONE, PROG_CROP_ONLY, or ALL - - Add new history output variables: - - A5TMIN 5-day running mean of min 2-m temperature (K) - A10TMIN 10-day running mean of min 2-m temperature (K) - GDD0 Growing degree days base 0C from planting (ddays) - GDD8 Growing degree days base 8C from planting (ddays) - GDD10 Growing degree days base 10C from planting (ddays) - GDD020 Twenty year average of growing degree days base 0C from planting (ddays) - GDD820 Twenty year average of growing degree days base 8C from planting (ddays) - GDD1020 Twenty year average of growing degree days base 10C from planting (ddays) - GDDPLANT Accumulated growing degree days past planting date for crop (ddays) - GDDHARV Growing degree days (gdd) needed to harvest (ddays) - GDDTSOI Growing degree-days from planting (top two soil layers) (ddays) - -List any changes to the defaults for the boundary datasets: - New point mode for crop: 1x1_numaIA and 1x1_smallvilleIA - pftcon: pft-physiology.c110425.nc - surface datasets for crop mode for: f19, f10, 1x1_numaIA, and 1x1_smallvilleIA - (also crop datasets with crop AND irrigation on) - finidat file for crop for f19 - New T31 pftdyn file for historical and rcp2.6 - Raw veg and lai datasets for mksurfdata for crop - -Describe any substantial timing or memory changes: Crop adds some additional variables - and if checks that may make small differences in run-time and/or memory - -Code reviewed by: self, slevis - -List any svn externals directories updated (csm_share, mct, etc.): Almost all - - scripts to scripts4_110421 - share to share3_110411 - drv to drvseq3_1_53 - datm to datm8_110419 - stubs to stubs1_2_04 - -List all files eliminated: - ->>>>>>>>>>>>>>> Remove test configs that explicitly have dust - D models/lnd/clm/test/system/config_files/4p_vodsrsc_dh - D models/lnd/clm/test/system/config_files/4p_vodsrsc_dm - D models/lnd/clm/test/system/config_files/4p_vodsrsc_do - D models/lnd/clm/test/system/config_files/4p_vodsrsc_ds - D models/lnd/clm/test/system/config_files/17p_vodsrsc_h - D models/lnd/clm/test/system/config_files/17p_vodsrsc_m - D models/lnd/clm/test/system/config_files/17p_vodsrsc_o - D models/lnd/clm/test/system/config_files/17p_vodsrsc_dh - D models/lnd/clm/test/system/config_files/4p_vodsnrsc_ds - D models/lnd/clm/test/system/config_files/17p_vodsrsc_dm - D models/lnd/clm/test/system/config_files/17p_vodsrsc_do - D models/lnd/clm/test/system/config_files/4p_vodsrsc_h - D models/lnd/clm/test/system/config_files/17p_vodsrsc_ds - D models/lnd/clm/test/system/config_files/4p_vodsrsc_o - ->>>>>>>>>>>>>>> Remove test for scaled_harvest namelist item - D models/lnd/clm/test/system/nl_files/nl_noicertm_sclharv - ->>>>>>>>>>>>>>> Remove sample namelists and always use mksurfdata.pl script - D models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig - D models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn - ->>>>>>>>>>>>>>> Remove these two from changes that mvertens applied - D models/lnd/clm/tools/interpinic/addglobal.F90 - D models/lnd/clm/tools/interpinic/wrap_nf.F90 - ->>>>>>>>>>>>>>> Update sample IC file - D models/lnd/clm/tools/interpinic/clmi.IQ.1953-01-01_10x15_USGS_simyr2000_c081202.nc - -List all files added and what they do: - ->>>>>>>>>>>>>>> Add crop test configs - A models/lnd/clm/test/system/config_files/21p_cncrpsc_do - A models/lnd/clm/test/system/config_files/21p_cncrpsc_s - A models/lnd/clm/test/system/config_files/21p_cncrpsc_ds - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dh - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_dm - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_do - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_ds - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_h - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_m - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_o - A models/lnd/clm/test/system/config_files/21p_cndvcrpsc_s - A models/lnd/clm/test/system/config_files/21p_cncrpsc_h - A models/lnd/clm/test/system/config_files/21p_cncrpsc_dh - A models/lnd/clm/test/system/config_files/21p_cncrpsc_m - A models/lnd/clm/test/system/config_files/21p_cncrpsc_o - A models/lnd/clm/test/system/config_files/21p_cncrpsc_dm ->>>>>>>>>>>>>>> Add test configs without dust - A models/lnd/clm/test/system/config_files/4p_vorsc_dm - A models/lnd/clm/test/system/config_files/4p_vorsc_do - A models/lnd/clm/test/system/config_files/4p_vorsc_ds - A models/lnd/clm/test/system/config_files/17p_vorsc_h - A models/lnd/clm/test/system/config_files/17p_vorsc_m - A models/lnd/clm/test/system/config_files/17p_vorsc_o - A models/lnd/clm/test/system/config_files/4p_vorsc_h - A models/lnd/clm/test/system/config_files/4p_vorsc_o - A models/lnd/clm/test/system/config_files/17p_vorsc_dm - A models/lnd/clm/test/system/config_files/17p_vorsc_dh - A models/lnd/clm/test/system/config_files/17p_vorsc_do - A models/lnd/clm/test/system/config_files/17p_vorsc_ds - A models/lnd/clm/test/system/config_files/4p_vorsc_dh - ->>>>>>>>>>>>>>> Add crop restart variables - A models/lnd/clm/src/biogeochem/CropRestMod.F90 - ->>>>>>>>>>>>>>> Add namelist for crop, and mksurfdata to create crop single point - A models/lnd/clm/test/system/nl_files/nl_crop - A models/lnd/clm/test/system/nl_files/nl_cn_conly - A models/lnd/clm/test/system/nl_files/clm_stdIgnYr - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_numaIA_mp20irrcr_2000 - - A models/lnd/clm/test/system/TSMrst_tools.sh - Add test to use finidat files - run interpinic on it and then make sure you can startup from the result - ->>>>>>>>>>>>>>> Explicitly add csm_share files into interpinic build - A models/lnd/clm/tools/interpinic/Mkdepends - A models/lnd/clm/tools/interpinic/shr_sys_mod.F90 - A models/lnd/clm/tools/interpinic/shr_log_mod.F90 - A models/lnd/clm/tools/interpinic/shr_kind_mod.F90 - A models/lnd/clm/tools/interpinic/shr_const_mod.F90 - ->>>>>>>>>>>>>>> Add the latest 10x15 initial conditions file to test on - A models/lnd/clm/tools/interpinic/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c100322.nc - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>> Set maxpft to number - M models/lnd/clm/test/system/config_files/README - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cndvsc_m - M models/lnd/clm/test/system/config_files/17p_cndvsc_o - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do - M models/lnd/clm/test/system/config_files/17p_cndvsc_s - M models/lnd/clm/test/system/config_files/_nrmexsc_ds - M models/lnd/clm/test/system/config_files/17p_cnsc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_m - M models/lnd/clm/test/system/config_files/17p_cnsc_dm - M models/lnd/clm/test/system/config_files/_nrvansc_ds - M models/lnd/clm/test/system/config_files/17p_cnsc_do - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dh - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_do - M models/lnd/clm/test/system/config_files/17p_cndvsc_dh - M models/lnd/clm/test/system/config_files/17p_cndvsc_dm - M models/lnd/clm/test/system/config_files/17p_cndvsc_do - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do - M models/lnd/clm/test/system/config_files/4p_vonrsc_ds - M models/lnd/clm/test/system/config_files/17p_cndvsc_h - ->>>>>>>>>>>>>>> Remove some tests add new crop tests - M models/lnd/clm/test/system/README.testnames ---------------- - M models/lnd/clm/test/system/tests_posttag_lynx_nompi -------- - M models/lnd/clm/test/system/tests_pretag_bluefire ----------- - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi ----- - M models/lnd/clm/test/system/tests_pretag_edinburgh ---------- - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi ---- - M models/lnd/clm/test/system/tests_posttag_yong -------------- - M models/lnd/clm/test/system/tests_pretag_jaguarpf ----------- - M models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi ----- - M models/lnd/clm/test/system/tests_posttag_mirage ------------ - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - - M models/lnd/clm/test/system/tests_posttag_nompi_regression -- - - M models/lnd/clm/test/system/TCBtools.sh ------- Add TOOL_ROOT - M models/lnd/clm/test/system/test_driver.sh ---- Use path to glade, update path - M models/lnd/clm/test/system/mknamelist -------- Add ability to set finidat file on - startup - M models/lnd/clm/test/system/input_tests_master Change out vodsrsc for vorsc, - add crop tests, add interpinic restart tests - M models/lnd/clm/test/system/tests_posttag_lynx Add sm9T4 test - M models/lnd/clm/test/system/CLM_runcmnd.sh ---- Remove -d - - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850 Change from 1850-2000 - to just 1850 - M models/lnd/clm/test/system/nl_files/clm_irrig -------------- Use ignore_ic_year - instead of ignore_ic_date - ->>>>>>>>>>>>>>> Add ability to add crop in, add -crop to mksurfdata.pl which sets the ->>>>>>>>>>>>>>> numpft=20 namelist item - M models/lnd/clm/tools/mksurfdata/mkvarpar.F90 - Add numstdpft - M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 - Add numpft - M models/lnd/clm/tools/mksurfdata/ncdio.F90 ---- Add nf_get_att_double/nf_get_var_text - M models/lnd/clm/tools/mksurfdata/mklaiMod.F90 - Use numpft - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 Add mksrf_flai/mksrf_firrig to file - M models/lnd/clm/tools/mksurfdata/areaMod.F90 -- Put numpft in mkvarctl - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 - Add numpft to namelist - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl Handle crop and irrig and change - names accordingly - M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 - Add numpft and add to namelist - if numpft = 20 add crop in - ->>>>>>>>>>>>>>> Bring in interpinic version from Mariana Vertenstein ->>>>>>>>>>>>>>> Make faster and use less memory, update NetCDF interface, make ->>>>>>>>>>>>>>> standalone so not dependant on other directories - M models/lnd/clm/tools/interpinic/interpinic.F90 - Make faster by saving indices, - use less memory, update to F90 NetCDF interface, make standalone - M models/lnd/clm/tools/interpinic/fmain.F90 ------ Add -a option to NOT override missing - M models/lnd/clm/tools/interpinic/Srcfiles ------- Remove mpi files - M models/lnd/clm/tools/interpinic/Filepath ------- Make standalone - M models/lnd/clm/tools/interpinic/Makefile ------- Use local MkDepends, compare - to null, change interface for testing a bit - M models/lnd/clm/tools/interpinic/README --------- Add note about SMP, update clmi file - M models/lnd/clm/tools/interpinic/interpinic.runoptions Use new file - ->>>>>>>>>>>>>>> Add numpft - M models/lnd/clm/tools/mkgriddata/mkvarctl.F90 - ->>>>>>>>>>>>>>> Add crop/noio remove dust and progsslt and CLAMP setting - M models/lnd/clm/bld/configure ------------- Add -crop/-noio remove -dust/-progsslt - turn RTM off for sitespf_pt, error check crop, maxpft, remove CLAMP setting - M models/lnd/clm/bld/listDefaultNamelist.pl Add loop for crop - M models/lnd/clm/bld/build-namelist -------- Sense crop=on/off, add suplnitro remove - Carbon_only - M models/lnd/clm/bld/clm.cpl7.template ----- Change order of $CLM_CONFIG_OPTS - so will be done last and override other settings - M models/lnd/clm/bld/config_files/config_definition.xml Add crop/noio, remove dust/progsslt - have maxpft only allow numbers up to 21 - ->>>>>>>>>>>>>>> New files for crop, remove old namelist items add new, add crop datasets - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --------- Remove - Carbon_only add suplnitro, remove scaled_harvest, correct spellings - 1x1_numaIA,1x1_smallvilleIA resolutions - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml --- Add - 1x1_numaIA,1x1_smallvilleIA - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ------ Add - 1x1_numaIA,1x1_smallvilleIA - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------- Add - settings for suplnitro, new fpftcon, finidat for crop f19, add crop parameters - files for crop for f19,f10,1x1_numaIA,1x1_smallvilleIA, fix T31 files - turn create_crop_landunit on for crop - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Add - mksrf_flai/mksrf_fvegtyp for crop add crop=on/off for those files - ->>>>>>>>>>>>>>> Use nsrest parameters, use secspday/days_per_year, handle prognostic crop ->>>>>>>>>>>>>>> Remove CLAMP/is_restart/DUST/DISTURB/CLAMP ->>>>>>>>>>>>>>> if soil also check if crop, use vegetation indices, add initialization ->>>>>>>>>>>>>>> subroutines, pass crop filters down, suplementatal Nitrogen can be for ->>>>>>>>>>>>>>> nothing, just for crop, or for all. - M models/lnd/clm/src/biogeochem/CASAPhenologyMod.F90 ----- Use nsrest parameters, secspday - M models/lnd/clm/src/biogeochem/CNGapMortalityMod.F90 ---- Use secspday - M models/lnd/clm/src/biogeochem/CNGRespMod.F90 ----------- Handle crop - M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 --- Handle crop - M models/lnd/clm/src/biogeochem/CNFireMod.F90 ------------ Use secspday/days_per_year - M models/lnd/clm/src/biogeochem/CNMRespMod.F90 ----------- If crop add livestem - M models/lnd/clm/src/biogeochem/CASAMod.F90 -------------- Remove CLAMP is_restart - if soil or crop, nsrest parameters, use veg indices - M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 Handle crop - M models/lnd/clm/src/biogeochem/CNSummaryMod.F90 --------- Remove CLAMP, add crop - M models/lnd/clm/src/biogeochem/DUSTMod.F90 -------------- Remove DUST, if soil or crop - M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 ------- Add init and crop-Phenology - M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 --- Add prog crop - M models/lnd/clm/src/biogeochem/CNDecompMod.F90 ---------- Pass crop filter down - use secspday - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ------- Remove extra use - M models/lnd/clm/src/biogeochem/CNrestMod.F90 ------------ Remove is_restart - M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 ---- Add CROP #ifdef to CNDV - M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 ------- Use dayspyr and secspday - M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 ------ Add init subroutine - section for prognostic crop, supplemental Nitrogen can be on for nothing, - crop only, or everything - M models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 ---- Add init subroutine, - add crop filters - M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 -------- Set crop vars remove CLAMP - M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 - Add if section for crop - M models/lnd/clm/src/biogeochem/CNDVEstablishmentMod.F90 - Remove DISTURB - ->>>>>>>>>>>>>>> Use nsrest parameters, update ESMF interface - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 --- Use nsrest parameters - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - Update interface from Tony Craig - Use nsrest parameters, use phase as a keyword. - M models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 -- Update interface from Tony Craig - compare success to ESMF_SUCCESS rather than 0. - ->>>>>>>>>>>>>>> Add istcrop and if statements for istsoil also test for istcrop ->>>>>>>>>>>>>>> Remove CLAMP/DUST/PROGSSLT/debug ifdef/vcmx25/dw_fcel/dw_flig ->>>>>>>>>>>>>>> /scaled_harv/ bad hist indices. Set if prog_crop in surfrdMod ->>>>>>>>>>>>>>> Use secspday and days_per_year, more vars on pft-physiology file ->>>>>>>>>>>>>>> Add parameters for nsrest settings, new hist vars, error check CROP - M models/lnd/clm/src/main/clm_varcon.F90 -------- Add istcrop - M models/lnd/clm/src/main/clm_varpar.F90 -------- Add numveg and mxpft - M models/lnd/clm/src/main/CNiniTimeVar.F90 ------ Remove CLAMP, if soil or crop - also set some crop vars - M models/lnd/clm/src/main/dynlandMod.F90 -------- If soil or crop - M models/lnd/clm/src/main/accumulMod.F90 -------- Remove is_restart, add missing to _PERIOD - M models/lnd/clm/src/main/clm_initializeMod.F90 - Remove CLAMP/DUST, use nsrest parameters - add call to CNEcosystemDynInit - M models/lnd/clm/src/main/subgridRestMod.F90 ---- Remove incorrect grid indices (bug 1310) - M models/lnd/clm/src/main/accFldsMod.F90 -------- Add GDD0/8/10/PLANT/HARV/TSOI/TDM5/10 - M models/lnd/clm/src/main/clmtypeInitMod.F90 ---- Remove CLAMP - CROP & C13 is not valid, add crop vars, remove vcmx25/dw_fcel/dw_flig - M models/lnd/clm/src/main/ndepStreamMod.F90 ----- Use secspday in place of 86400 - M models/lnd/clm/src/main/pftdynMod.F90 --------- Use days_per_year in place of 365 - move pconv/pprod10/pprod100 to pft-physiology file, if soil or crop - use nsrest parameters, remove scaled_harvest - M models/lnd/clm/src/main/iniTimeConst.F90 ------ Add graincn, remove: vcmx25/dw_fcel/dw_flig - M models/lnd/clm/src/main/histFileMod.F90 ------- Use secspday in place of 86400 - fix Conventions, use nsrest parameters, comment out indices (bug 1310) - M models/lnd/clm/src/main/clm_atmlnd.F90 -------- Remove DUST/PROGSSLT/1==1 - M models/lnd/clm/src/main/restFileMod.F90 ------- Use nsrest parameters, add CropRest - fix Conventions - M models/lnd/clm/src/main/controlMod.F90 -------- Remove scaled_harvest/Carbon_only - use nsrest parameters, add suplnitro - M models/lnd/clm/src/main/initSurfAlbMod.F90 ---- if soil or crop, send crop filters - to CNEcosystemDyn - M models/lnd/clm/src/main/clm_time_manager.F90 -- Remove COUP_WRF, add get_driver_start_ymd - M models/lnd/clm/src/main/filterMod.F90 --------- Add filter for prognostic-crop - if soil or crop - M models/lnd/clm/src/main/clm_varctl.F90 -------- Add parameters for nsrest valid - values: nsrStartup, nsrContinue, nsrBranch, remove scaled_harvest - make sure crop allocates all PFT's - M models/lnd/clm/src/main/clm_driver.F90 -------- Remove DUST send crop filters - to CNEcosystemDyn - M models/lnd/clm/src/main/initGridCellsMod.F90 -- If crop send istcrop to set_landunit_crop_noncompete - M models/lnd/clm/src/main/CASAiniTimeVarMod.F90 - Remove CLAMP - M models/lnd/clm/src/main/pftvarcon.F90 --------- Add crop vars, corn, - temperate sping/winter cereal, and soybean, remove vcmx25/dw_flig/dw_fcel - add new variables for crop add npcropmin, npcropmax and error checking - M models/lnd/clm/src/main/ncdio_pio.F90 --------- Add logical field support - M models/lnd/clm/src/main/spmdMod.F90 ----------- Add MPI_LOR - M models/lnd/clm/src/main/surfrdMod.F90 --------- Add crop_prog as public module data - Remove TCX_REMOVE_SEE_NOTES_ABOVE, error checking if prognostic crops avail - and CROP not defined and vice versa - M models/lnd/clm/src/main/clmtype.F90 ----------- New variables for CROP, remove CLAMP - Remove dw_fcel, dw_flig, vcmx25 - M models/lnd/clm/src/main/histFldsMod.F90 ------- Remove CLAMP and DUST, T10 output - for CNDV or CROP, add A5TMIN, A10TMIN, GDD0, GDD8, GDD10, GDD020, GDD820, - GDD1020, GDDPLANT, GDDTSOI and GDDHARV for crop (as inactive) - - M models/lnd/clm/src/main/mkarbinitMod.F90 ------ If soil or crop - - M models/lnd/clm/src/riverroute/RtmMod.F90 - Remove L2R_Decomp #ifdef, and #if (1 == - Remove is_restart and use clm_time_manager version. -0) - ->>>>>>>>>>>>>>> Change if statements on "if soil" to "if soil or crop" ->>>>>>>>>>>>>>> Remove DUST, NO_DAYLEN_VCMAX #ifdefs, is_restart, vcmx25, avcmx, ->>>>>>>>>>>>>>> and SNICAR stats. vcmx calc is different for crop and btran for soybean - M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 - If soil or crop - M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 -- If soil or crop - M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 ---- If soil or crop - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 --- If soil or crop - M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 --- If soil or crop - M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 - Remove DUST #ifdef - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 ---- If soil or crop - M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 ------- If soil, urb, wet or crop - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ------- If soil or crop - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --- Remove is_restart use - clm_time_manger version, use nsrest parameters - M models/lnd/clm/src/biogeophys/SNICARMod.F90 ----------- Remove commented out SNICAR stats - M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 - If soil or crop - M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ----- Remove NO_DAYLEN_VCMAX, - and vcmx25,avcmx, vcmx calc different for crop and btran for soybean. - -Summary of testing: - - bluefire: All PASS except... -008 blAZ1 TBL.sh 21p_cncrpsc_dh clm_irrig^nl_crop 20020401:3600 10x15 USGS -10 cold .............FAIL! rc= 5 -015 blE91 TBL.sh 4p_vorsc_dh clm_std^nl_urb 20021230:1800 4x5 gx3v7 48 arb_ic ...................FAIL! rc= 5 -020 blF92 TBL.sh 17p_vorsc_dm clm_std^nl_urb 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 5 -024 blEH1 TBL.sh 4p_vorsc_dh clm_std^nl_urb 20021231:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic ......FAIL! rc= 5 -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -041 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:3600 10x15 USGS@1850-2000 -10 arb_ic ..............FAIL! rc= 7 -059 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -060 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -061 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -062 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -032 blF93 TBL.sh 17p_vorsc_do clm_std^nl_urb 20021230:1800 4x5 gx3v7 48 cold ....................FAIL! rc= 5 -056 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 6 -057 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 6 -058 sm8Z3 TSMrst_tools.sh 21p_cncrpsc_do interpinic clm_irrig^nl_crop 20000101:1800 1.9x2.5 gx1v6 10FAIL! rc= 4 - bluefire/CESM testing: All PASS except... (dens, fv and ram1 change) -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_26 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_26 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_26 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_26 -FAIL SMS_ROA.f45_f45.I.bluefire.compare_hist.clm4_0_26 -FAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_26 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_26 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_26 -FAIL PST.f45_g37.I1850.bluefire.compare.clm4_0_26 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_26 -FAIL ERS_E.f19_g16.I1850.bluefire.compare_hist.clm4_0_26 -FAIL ERS_E.f19_g16.I1850.bluefire.compare.clm4_0_26 -FAIL ERI.f19_g16.IG1850.bluefire.compare.clm4_0_26 -SFAIL ERS_D.T31_g37.IGRCP26CN.bluefire.GC.231059 -SFAIL ERP.T31_g37.IGRCP60CN.bluefire.GC.231059 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_26 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_26 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_26 -FAIL PST.f10_f10.I20TRCN.bluefire.compare.clm4_0_26 -FAIL PET_PT.f10_f10.I20TRCN.bluefire.compare.clm4_0_26 -FAIL SMS.f10_f10.IRCP45CN.bluefire.compare_hist.clm4_0_26 -FAIL SMS.f10_f10.IRCP45CN.bluefire.compare.clm4_0_26 - bluefire/PTCLM testing: All PASS up to.. -US-Ha1_ICN_ad_spinup.PTCLM PASS - jaguarpf interactive testing: All PASS up to... -008 blAZ3 TBL.sh 21p_cncrpsc_do clm_irrig^nl_crop 20020401:3600 10x15 USGS -10 cold .............FAIL! rc= 5 -011 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -012 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -013 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -014 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -035 sm8Z3 TSMrst_tools.sh 21p_cncrpsc_do interpinic clm_irrig^nl_crop 20000101:1800 1.9x2.5 gx1v6 10FAIL! rc= 4 - edinburgh/lf95 interactive testing: All PASS except... -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:1800 1x1_brazil navy -10 arb_ic ...............FAIL! rc= 7 -010 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic .............FAIL! rc= 7 -014 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:3600 1x1_vancouverCAN navy 331 arb_ic ...FAIL! rc= 7 -018 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 158 arb_ic ..FAIL! rc= 7 -026 blL74 TBL.sh _nrsc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -10 arb_ic ................FAIL! rc= 7 - mirage,storm/ifort interactive testing: All PASS except... -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 10+38 arb_ic ...........FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_26 - -Changes answers relative to baseline: no bit-for-bit - with the exception that the new crop mode is NOT in previous tags - -=============================================================== -=============================================================== -Tag name: clm4_0_26 -Originator(s): erik (Erik Kluzek) -Date: Wed Mar 23 11:43:00 MDT 2011 -One-line Summary: Update externals, driver update changes answers, drydep changes from fvitt, fix bugs - -Purpose of changes: - -Update externals to latest pre-cesm1_0_beta17 version. driver to beyond cesm1_0_beta16 -version -- so answers change. Always update ndep_interp in clm_driver -- so restarts are -exact. Bring in Francis Vitt drydep changes. Remove bad T31 pftdyn datasets add in -a new T31 rcp2.6 T31 dataset. Fix interpinic _var bug. Remove HIRES from bld. Change -tools Makefile's so that you can set env variables. Change test_driver to use newer -version of cprnc. - -Bugs fixed (include bugzilla ID): - 1284 (Crop restart test fails) - 1304 (bug in interpinic *_var) - 1308 (tools Make doesn't allow setting env vars) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: more fields added for drydep namelist - -List any changes to the defaults for the boundary datasets: - Remove bad T31 pftdyn datasets - -Describe any substantial timing or memory changes: none - -Code reviewed by: self, drydep changes from fvitt and JFL - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, cprnc - - scripts to scripts4_110314 - drv to drvseq3_1_51 - cprnc to cprnc_110310 - -List all files eliminated: None - -List all files added and what they do: - - A README_EXTERNALS -- Describes how to work with externals (similar to cam file) - -List all existing files that have been modified, and describe the changes: - - M README - Update with new - - M models/lnd/clm/test/system/CLM_compare.sh - Update for latest cprnc which - doesn't have a "completed successfully line at the end" - M models/lnd/clm/test/system/test_driver.sh - Use newer cprnc on bluefire - ->>>>>>>>>>> Change tools build so that you can set env variables for SMP/USER_FC/CC - M models/lnd/clm/tools/mksurfdata/Makefile -------- Compare to ,null rather than strip - M models/lnd/clm/tools/interpinic/Makefile -------- Compare to ,null rather than strip - M models/lnd/clm/tools/mkgriddata/Makefile -------- Compare to ,null rather than strip - M models/lnd/clm/tools/mkdatadomain/Makefile ------ Compare to ,null rather than strip - - M models/lnd/clm/tools/interpinic/interpinic.F90 -- Make sure htop_var/fpcgrid_var - are initialized to false each time comes into routine (bug 1304) - - M models/lnd/clm/bld/configure -- Remove HIRES setting for stand-alone testing - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - New rcp2.6 T31 - pftdyn dataset remove rcp4.5,6,8.5 T31 pftdyn files as they only go to 2035 - - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - Pick wesveg and index_season - differently for special landunits, add max for rc, assume no surface - resistance for SO2 over water, use has_rain logical (from fvitt) - M models/lnd/clm/src/main/clm_driver.F90 ----------- Always call ndep_interp - even if (stream_year_first_ndep /= stream_year_last_ndep) as can change - answers if not - -Summary of testing: - - bluefire: All PASS except TBL tests and... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -063 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -064 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -065 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 - bluefire interactive testing: All PASS except TBL tests - bluefire/CESM testing: All PASS (even the comparision tests) - bluefire/PTCLM testing: All PASS up to... -US-Ha1_ICN_ad_spinup.PTCLM PASS - edinburgh/lf95 interactive testing: All PASS except... -021 brVx3 TBR.sh _mec10sc_do clm_transient_glcMEC_rcp4.5^nl_urb_br 20331231:1800 48x96 gx3v7@1850-21FAIL! rc= 10 - mirage,storm/ifort interactive testing: All PASS except TBL tests and... -016 smVx3 TSM.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 10 -017 erVx3 TER.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -4+-6 aFAIL! rc= 5 -018 brVx3 TBR.sh _mec10sc_do clm_transient_glcMEC_rcp4.5^nl_urb_br 20331231:1800 48x96 gx3v7@1850-21FAIL! rc= 5 -024 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -025 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 10+38 arb_ic ...........FAIL! rc= 5 -026 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 - yong/ifort interactive testing: All PASS except... -011 smD94 TSM.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_25 - -Changes answers relative to baseline: Yes! Greater than roundoff - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change:(larger than roundoff/same climate - - driver mapping changes, drydep code has changes, ndep_interp is always called - which changes answers on some platforms/compilers (such as intel compiler). - -=============================================================== -=============================================================== -Tag name: clm4_0_25 -Originator(s): erik (Erik Kluzek) -Date: Tue Mar 22 10:13:08 MDT 2011 -One-line Summary: Always output restart-history files add more meta-data to them, - fix urbanc_alpha and 2.5x3.33 datasets, Changes from Keith O on SNOWLIQ/SNOWICE - -Purpose of changes: - -Move history namelist information to restart history files and always output them. Add -attributes and meta-data to the restart history files. Fix urbanc_alpha test site surface -dataset. Fix datm namelist for urban cases. Use new crop pft-physiology file. Update -scripts and csm_share. Changes from Keith O on SNOWLIQ/SNOWICE so goes to zero rather -than missing value. Update 2.5x3.33 datasets. Fix dvolrdt units documentation, call -mksoifmaxInit. - -Bugs fixed (include bugzilla ID): - 1247 (Some changes to ncd_pio in clm) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - New pft-physiology file with fields for prognostic crop - New surface dataset for urbanc_alpha - New grid/topo/frac/domain files for 2.5x3.33 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, snowliq/snowice changes by oleson - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm, cism, csm_share - - scripts to scripts4_110204 - datm to datm8_110210 - cism to cism1_110220 - csm_share to share3_110201 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/input_tests_master - Change start dates of urban tests - ->>>>>>>>>>>> Move mksoil*Init subroutines private to mksoilMod, and call a mksoilInit ->>>>>>>>>>>> routine from mksrfdata, making sure mksoifmaxInit is called. - M models/lnd/clm/tools/mksurfdata/mksoilMod.F90 - Add mksoilInit to call - mksoitexInit/mksoicolInit and mksoifmaxInit (mksoifmaxInit was missing) - fix mksoifmaxInit, and make mksoitex/col/fmaxInit routines private - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 -- Call mksoilInit, - remove mksoicol/texInit - ->>>>>>>>>>>> Add notes about setting path to NetCDF, and other gmake options - M models/lnd/clm/tools/mksurfdata/README - M models/lnd/clm/tools/interpinic/README - M models/lnd/clm/tools/mkgriddata/README - M models/lnd/clm/tools/mkdatadomain/README - - M models/lnd/clm/bld/queryDefaultNamelist.pl - Remove white-space from input options - M models/lnd/clm/bld/listDefaultNamelist.pl -- Also list datm_internal files - M models/lnd/clm/bld/build-namelist ---------- Add drv_final_spinup from PTCLM - document precidence of the different env_conf.xml - ->>>>>>>>>>>> Fix 2.5x3.33 and urbanc_alpha files, change some settings for CLM1PT ->>>>>>>>>>>> or pt1_pt1 resolution, remove ndepsrc. - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --------- Add - taxmode and dtlimit, add 2.5x3.33 resolution - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml --- Add - sim_year="2000" sim_year_range="constant" for pft1_pt1 datm_presaero files - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ------ Add - 1x1_numaIA and 1x1_smallvilleIA domain/preseaero files, update 2.5x3.33 domain - make mapalgo nn for CLM1PT, set taxmode and tintalgo appropriately - if CLM1PT is set. Add transient presaero file for 1x1_tropicAtl. - M models/lnd/clm/bld/namelist_files/use_cases/stdurbpt_pd.xml ------- Set - dtime to 1800 for 1x1_urbanc_alpha - M models/lnd/clm/bld/namelist_files/datm-build-namelist ------------- Set - tintalgo, mapalgo by datm_source, and set taxmode as well. Remove - option for datm_presaero="none". Set mapalgo=nn for datm_presaero=pt1_pt1. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------- Update - urbanc_alpha surface dataset, 2.5x3.33 grid/topo/frac datasets - Remove ndepsrc="stream" in ndepmapalgo settings as doesn't exist anymore. - Use latest pft-physiology file from CROP branch (has extra data needed - for prognostic crop) - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ------- Set - atm_cpl_dt=1800 for urbanc_alpha, set stop_option/stop_n for - urban sites carefully (add 1 time-step to stop_n, double for urbanc_alpha). - Use "test" mask for urbanc_alpha - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Remove - ndepsrc="stream" - ->>>>>>>>>>>> Add meta-data to restart hist files, put history restart data on ->>>>>>>>>>>> restart hist files and off master restart files (so initial condition ->>>>>>>>>>>> files aren't cluttered with information only needed for continue runs). ->>>>>>>>>>>> Some changes to SNOWLIQ/SNOWICE, document dvolrdt units. - M models/lnd/clm/src/main/histFileMod.F90 - Use htape_create for restart_hist - files, modify hist_restart_ncd so that namelist vars on one restart - history files and they are always output, add more metadata to - restart hist files, remove some temp arrays. Restart history files - now always needed for continue runs, but not for other run types, - and restart history information does not clutter the master restart - files. The only history variables on master restart files are the - history and restart filenames. Comments on the files make this clear. - M models/lnd/clm/src/main/restFileMod.F90 - Change hist_restart_ncd calls - M models/lnd/clm/src/main/ncdio_pio.F90 --- Add ncd_io_log_var0_nf interface - add options for attributes: comment, flag_values, flag_meanings, and - nvalid_range for variables., fix an issue in ncd_io_int_var0_nf - M models/lnd/clm/src/main/histFldsMod.F90 - Change default for SNOWLIQ/SNOWICE - to "Average" rather than "Instant" (from oleson). - M models/lnd/clm/src/riverroute/RtmMod.F90 ---- Document dvolrdt conversion - M models/lnd/clm/src/riverroute/RunoffMod.F90 - Document dvolrdt units - correctly. - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 - Initialize snowice/snowliq - to zero over lake filter (from oleson). - -Summary of testing: - - bluefire: All PASS except TBL tests and... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -063 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -064 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -065 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 - bluefire interactive testing: All PASS except all TBL tests fail - bluefire/CESM testing: All PASS except... -FAIL SMS_RLA.f45_f45.I.bluefire.generate.clm4_0_25 -FAIL SMS_RLB.f45_f45.I.bluefire.generate.clm4_0_25 -FAIL SMS_ROA.f45_f45.I.bluefire.generate.clm4_0_25 -FAIL ERS_D.f45_g37.I.bluefire.generate.clm4_0_25 -BFAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_23 -FAIL PST.f45_g37.I1850.bluefire.generate.clm4_0_25 -FAIL PET_PT.f45_g37.I1850.bluefire.generate.clm4_0_25 -FAIL ERS_E.f19_g16.I1850.bluefire.generate.clm4_0_25 -FAIL ERI.f19_g16.IG1850.bluefire.generate.clm4_0_25 -FAIL ERS_D.T31_g37.IGRCP26CN.bluefire.generate.clm4_0_25 -FAIL ERP.T31_g37.IGRCP60CN.bluefire.generate.clm4_0_25 -BFAIL ERP.T31_g37.IGRCP60CN.bluefire.compare.clm4_0_23 -FAIL ERB.f09_g16.I_1948-2004.bluefire.generate.clm4_0_25 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_25 -FAIL ERH_D.f10_f10.I1850CN.bluefire.generate.clm4_0_25 -BFAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_23 -FAIL PST.f10_f10.I20TRCN.bluefire.generate.clm4_0_25 -FAIL PET_PT.f10_f10.I20TRCN.bluefire.generate.clm4_0_25 -FAIL SMS.f10_f10.IRCP45CN.bluefire.generate.clm4_0_25 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.generate.clm4_0_25 -BFAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_23 - jaguarpf interactive testing: -002 erA74 TER.sh _nrsc_ds clm_std^nl_urb 20030101:1800 1x1_brazil navy -5+-5 arb_ic .............FAIL! rc= 13 -003 brA74 TBR.sh _nrsc_ds clm_std^nl_urb_br 20030101:1800 1x1_brazil navy -5+-5 arb_ic ..........FAIL! rc= 11 -006 erAZ3 TER.sh _sc_do clm_irrig 20020401:3600 10x15 USGS -3+-7 cold ...........................FAIL! rc= 13 -007 brAZ3 TBR.sh _sc_do clm_irrig 20020401:3600 10x15 USGS -5+-5 cold ...........................FAIL! rc= 11 -011 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -012 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -013 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -016 erJ74 TER.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:3600 1x1_tropicAtl test -10+-10 arb_ic ..FAIL! rc= 13 -017 brJ74 TBR.sh 4p_nrcasasc_ds clm_std^nl_urb_br 10001230:3600 1x1_tropicAtl test -3+-3 arb_ic .FAIL! rc= 11 -020 erK74 TER.sh 17p_cndvsc_s clm_std 19971231:1800 1x1_brazil navy -334+-336 arb_ic ............FAIL! rc= 13 -021 brK74 TBR.sh 17p_cndvsc_s clm_std 19971231:1800 1x1_brazil navy -334+-336 arb_ic ............FAIL! rc= 11 -024 erVx3 TER.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -4+-6 aFAIL! rc= 13 -025 brVx3 TBR.sh _mec10sc_do clm_transient_glcMEC_rcp4.5^nl_urb_br 20331231:1800 48x96 gx3v7@1850-21FAIL! rc= 11 -028 erHQ4 TER.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -3+-7 cold ............FAIL! rc= 13 -029 brHQ4 TBR.sh _nrcnsc_ds clm_drydep 20000214:1800 1x1_brazil navy@2000 -5+-5 cold ............FAIL! rc= 11 -032 erV63 TER.sh _mec10sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 10+38 arb_ic ................FAIL! rc= 13 - jaguarpf/CESM testing: All PASS including comparision tests except... -FAIL PST.f10_f10.I20TRCN.jaguarpf - edinburgh/lf95 interactive testing: -002 erA74 TER.sh _nrsc_ds clm_std^nl_urb 20030101:1800 1x1_brazil navy -5+-5 arb_ic .............FAIL! rc= 13 -003 brA74 TBR.sh _nrsc_ds clm_std^nl_urb_br 20030101:1800 1x1_brazil navy -5+-5 arb_ic ..........FAIL! rc= 11 -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:1800 1x1_brazil navy -10 arb_ic ...............FAIL! rc= 7 -006 blAL4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 7 -008 erCA4 TER.sh _nrsc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -45+-45 arb_ic .........FAIL! rc= 13 -009 brCA4 TBR.sh _nrsc_ds clm_std^nl_urb_br 20021001:3600 1x1_camdenNJ navy -10+-10 arb_ic ......FAIL! rc= 11 -010 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:3600 1x1_camdenNJ navy -90 arb_ic .............FAIL! rc= 7 -012 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:3600 1x1_vancouverCAN navy 115+115 arb_ic FAIL! rc= 13 -013 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:3600 1x1_vancouverCAN navy 72+72 arb_ic FAIL! rc= 11 -014 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:3600 1x1_vancouverCAN navy 331 arb_ic ...FAIL! rc= 5 -016 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 58+100 arb_ic FAIL! rc= 13 -017 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:3600 1x1_mexicocityMEX navy 72+72 arb_ic FAIL! rc= 11 -018 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:3600 1x1_mexicocityMEX navy 158 arb_ic ..FAIL! rc= 5 -020 erVx3 TER.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -4+-6 aFAIL! rc= 13 -021 brVx3 TBR.sh _mec10sc_do clm_transient_glcMEC_rcp4.5^nl_urb_br 20331231:1800 48x96 gx3v7@1850-21FAIL! rc= 11 -022 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 7 -024 erL74 TER.sh _nrsc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -5+-5 arb_ic ..............FAIL! rc= 13 -025 brL74 TBR.sh _nrsc_s clm_std^nl_urb_br 20020101:1800 1x1_brazil navy -10+-10 arb_ic .........FAIL! rc= 11 -026 blL74 TBL.sh _nrsc_s clm_std^nl_urb 20020101:1800 1x1_brazil navy -10 arb_ic ................FAIL! rc= 7 - edinburgh/CESM testing: All PASS including comparision tests - yong/intel testing: -011 smD94 TSM.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 2 -012 erD94 TER.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 72+72 cold ....................FAIL! rc= 5 -019 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -020 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 -022 smV24 TSM.sh _mec10sc_ds clm_glcmec 19980115:1800 48x96 gx3v7 96 arb_ic .....................FAIL! rc= 10 -023 erV24 TER.sh _mec10sc_ds clm_glcmec 19980115:1800 48x96 gx3v7 10+38 arb_ic ..................FAIL! rc= 5 -024 brV24 TBR.sh _mec10sc_ds clm_glcmec^nl_urb_br 19980115:1800 48x96 gx3v7 72+72 arb_ic ........FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_24 - -Changes answers relative to baseline: answers bit-for-bit, but SNOWLIQ/SNOWICE on history - files change. - -=============================================================== -=============================================================== -Tag name: clm4_0_24 -Originator(s): erik (Erik Kluzek) -Date: Wed Feb 9 13:20:39 MST 2011 -One-line Summary: Fix mksurfdata and add ability to override soil_fmax - -Purpose of changes: - -Fix mksurfdata for urban. Add soil_fmx to mksurfdata. Add attributes to suface datasets -that tell you the special namelist settings (such as all_urban, soil_, pft_). Add -irrig -as option to mksurfdata.pl. Update datm with new datasets for urbanc_alpha. Add new frac -dataset for urbanc_alpha. Update documentation to cesm1_0_rel_09_clm4_0_14 tag. Change -test_driver from jaguar to jaguarpf. Fix bug in build-namelist creating namelist -with clm_usr_name option. - -Bugs fixed (include bugzilla ID): - 1281 (bug in mksurfdata for urban_only case) - 1280 (improve modularity of mksurfdata) [partial] - 1276 (urbanc_alpha site does not work) [partial] - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1283 (CLM with glacier-MEC fails running on intel) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Update frac and domain file for urbanc_alpha site - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts, drv and csm_share to cesm1_0_beta15 versions - - scripts to scripts4_110204 - drv to drvseq3_1_48 - csm_share to share3_110201 - datm to datm8_110204 - -List all files eliminated: - - D models/lnd/clm/tools/mksurfdata/mkfmaxMod.F90 --- Put inside of mksoilMod.F90 - - D models/lnd/clm/test/system/tests_pretag_jaguar ------- rename to jaguarpf - D models/lnd/clm/test/system/tests_pretag_jaguar_nompi - rename to jaguarpf - ->>>>>>>>>>>> Remove files that were no longer used ->>>>>>>>>>>> (they are already in mksoilMod or mkpftMod) - D models/lnd/clm/tools/mksurfdata/mkorganic.F90 - D models/lnd/clm/tools/mksurfdata/mkrank.F90 - D models/lnd/clm/tools/mksurfdata/mkirrig.F90 - D models/lnd/clm/tools/mksurfdata/mksoicolMod.F90 - -List all files added and what they do: - ->>>>>>>>>>>> Add an irrigation and urban test for mksurfdata - A models/lnd/clm/test/system/nl_files/mksrfdt_10x15_irr_1850 - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_vancouverCAN_2000 - - A models/lnd/clm/test/system/tests_pretag_jaguarpf ------- rename from jaguar - A models/lnd/clm/test/system/tests_pretag_jaguarpf_nompi - rename from jaguar - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Add all_urban and irrigation mksurfdata tests ->>>>>>>>>>>> Update jaguar to jaguarpf - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/input_tests_master - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/TCBtools.sh ---- Remove copy of *.h files - M models/lnd/clm/test/system/test_driver.sh - change jaguar to jaguarpf, update - modules to agree with scripts - M models/lnd/clm/test/system/CLM_runcmnd.sh - change jaguar to jaguarpf - ->>>>>>>>>>>> Add soil_fmax option and soil_fmx, soil_col and irrig option to ->>>>>>>>>>>> mksurfdata.pl. Add attributes to file for override cases. ->>>>>>>>>>>> Put mkfmax inside of mksoilMod, add mksoilAtt and mkpftAtt methods. - M models/lnd/clm/tools/mksurfdata/Srcfiles -------- Remove unused files - M models/lnd/clm/tools/mksurfdata/mksoilMod.F90 --- Move mkfmax inside here - add mksoifmaxInit, mkfmax, and mksoilAtt interfaces, add soil_fmax as - an override setting - M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 ---- Fix bug in if statement - (needed to also ask if .not. zerod_out). Create mkpftAtt interface, move - settings from mkfileMod.F90 to there. - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 --- Move soil and pft specific - declarations to either mksoilAtt or mkpftAt interfaces - if all_urban is set add all_urban=TRUE attribute to file - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ---- Add soil_fmax to namelist - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl --- Add ability to set soil_col, - soil_fmax and irrig on command line - bring irrigation, setting of numpft and query of lai file from crop branch - ->>>>>>>>>>>> Update urbanc_alpha domain/frac files - M models/lnd/clm/bld/namelist_files/namelist_definition.xml -------- Add mksrf_flai - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -- Set - urbanc_alpha default mask to test - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ----- urbanc_alpha - domain file - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------ urbanc_alpha - frac file - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml Add in - mksrf_flai file - ->>>>>>>>>>>> Update to cesm1_0_rel_09_clm4_0_14 documentation (includes info on new bugs) - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/KnownBugs - -Summary of testing: - - bluefire interactive testing: -009 blHS3 TBL.sh _nrcnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic ......FAIL! rc= 5 - jaguarpf interactive testing: -011 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -012 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -013 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -014 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -026 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 5 -034 blV63 TBL.sh _mec10sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ...................FAIL! rc= 7 - edinburgh/lf95 interactive testing: -022 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 5 - mirage/intel interactive testing: All PASS except... -017 erVx3 TER.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -4+-6 aFAIL! rc= 5 -018 brVx3 TBR.sh _mec10sc_do clm_transient_glcMEC_rcp4.5^nl_urb_br 20331231:1800 48x96 gx3v7@1850-21FAIL! rc= 5 -019 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 4 -021 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 10+38 cold .........FAIL! rc= 13 -022 brR53 TBR.sh 17p_cnc13sc_do clm_std^nl_urb_br 20020115:1800 10x15 USGS@1850 72+72 cold ......FAIL! rc= 11 -024 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -025 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 10+38 arb_ic ...........FAIL! rc= 5 -026 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -027 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -029 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -030 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 - yong/intel interactive testing: -011 smD94 TSM.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 10 -012 erD94 TER.sh _persc_ds clm_per^nl_per 20021231:1200 4x5 gx3v7 72+72 cold ....................FAIL! rc= 5 -019 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -020 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 -022 smV24 TSM.sh _mec10sc_ds clm_glcmec 19980115:1800 48x96 gx3v7 96 arb_ic .....................FAIL! rc= 10 -023 erV24 TER.sh _mec10sc_ds clm_glcmec 19980115:1800 48x96 gx3v7 10+38 arb_ic ..................FAIL! rc= 5 -024 brV24 TBR.sh _mec10sc_ds clm_glcmec^nl_urb_br 19980115:1800 48x96 gx3v7 72+72 arb_ic ........FAIL! rc= 5 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_23 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_23 -Originator(s): erik (Erik Kluzek) -Date: Thu Feb 3 13:42:17 MST 2011 -One-line Summary: Add in new glacier-MEC use-cases - -Purpose of changes: - -Add in new datasets and use-cases for glc_mec to support glc_nec=10 for 1850, 2000, -1850-2000, and 1850-2100 for all 4 rcp's. Standardize naming convention for use-cases. -Use scripts branch that has new compsets in it that access the new use-cases. Make sure -ncdpio is used for all I/O. Work with PTCLM a bit, and PTCLM testing. Change precedence -for build-namelist so that use-case is lower after user_nl_clm. - -Bugs fixed (include bugzilla ID): - 1273 (fix pts_mode problem on jaguar) - 1256 (fix PTCLM testcases.csh on jaguar to use netcdf/3) - 1254 (PTCLM add .nc and date to pft-physiology file copy) - 1250 (add scratchroot in PTCLM for generic machines) - 1247 (some changes in ncdio_pio) [partial] - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1168 (Change precedence so user_nl_clm used over use-case) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1276 (urbanc_alpha site does not work) - 1279 (Latest version of PTCLM requires python2.5) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Change order of precedence so that - use_case is AFTER -namelist -infile and clm_usr_name options. - Thus values in your user_nl_clm file will be used instead of what's in - the use_case. - - New precedence is... - 1. values set on the command-line using the -namelist option, - 2. values read from the file specified by -infile, - 3. datasets from the -clm_usr_name option, - 4. values set from a use-case scenario, e.g., -use_case - 5. values from the namelist defaults file. -List any changes to the defaults for the boundary datasets: - New datasets for glc_nec="10" - surfdata for 1850@(f09,f19,T31) - pftdyn for 1850-2000@(f09,f19,T31) - pftdyn for 1850-2100@(f09,f19,T31) rcp (2.6,4.5,6,8.5) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm, cism - - scripts to glccsbr01_scripts4_110111 - datm to datm8_110124 - cism to cism1_110125 - -List all files eliminated: - - Rename use-cases to versions with an _pd ending or 2000_*_control form - - models/lnd/clm/bld/namelist_files/use_cases/... - D .../use_cases/stdurbpt.xml ----- rename to stdurbpt_pd - D .../use_cases/glacier_mec.xml -- rename to 2000_glacierMEC_control - D .../use_cases/pergro.xml ------- rename to pergro_pd - D .../use_cases/pergro0.xml ------ rename to pergro0_pd - -List all files added and what they do: - ->>>>>>>>>>>>>> Add tests for all new glacier-MEC use-cases - A models/lnd/clm/test/system/nl_files/clm_glcmec - A models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp2.6 - A models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp4.5 - A models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp8.5 - A models/lnd/clm/test/system/nl_files/clm_transient_glcMEC_rcp6 - - A models/lnd/clm/test/system/nl_files/nl_per - PERGRO testing namelist - ->>>>>>>>>>>>>> - models/lnd/clm/bld/namelist_files/use_cases/... - A .../use_cases/pergro_pd.xml -------------- Renamed from pergro - A .../use_cases/2000_glacierMEC_control.xml Copy of glacier_mec_pd - A .../use_cases/stdurbpt_pd.xml ------------ Renamed from stdurbpt - A .../use_cases/pergro0_pd.xml ------------- Renamed from pergro0 - A .../use_cases/README --------------------- Add README file to describe - naming convention for use_cases - ->>>>>>>>>>>>>> Add new glacier_MEC use_cases - models/lnd/clm/bld/namelist_files/use_cases/... - A .../use_cases/1850_glacierMEC_control.xml - A .../use_cases/20thC_glacierMEC_transient.xml - A .../use_cases/1850-2100_rcp6_glacierMEC_transient.xml - A .../use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - A .../use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - A .../use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - A .../use_cases/glacierMEC_pd.xml --- renamed from glacier_mec - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Add some new glacierMEC use-case tests - M models/lnd/clm/test/system/README.testnames ------------- Add n,w,x,y glcMEC resolutions - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_kraken - M models/lnd/clm/test/system/tests_posttag_yong - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_posttag_mirage - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_posttag_intrepid_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>>>>> Get glcmec branch testing to work and pergro testing working with ->>>>>>>>>>>>>> build-namelist precedence change - M models/lnd/clm/test/system/TBR.sh ------------- Match history files - NOT restart-history files - M models/lnd/clm/test/system/nl_files/clm_per0 -- Change use-case name - M models/lnd/clm/test/system/nl_files/nl_urb_br - Add hist_fincl2 to remove - any secondardy history files from use-case - M models/lnd/clm/test/system/nl_files/clm_per --- Change use-case name - M models/lnd/clm/test/system/input_tests_master - Add new tests - M models/lnd/clm/test/system/TSM.sh ------------- Make restart file touched - with .nc extension, remove bit about deleting clm.i files - ->>>>>>>>>>>>>> Use mksrf_glacier files from XML database, add glc_nec to mksurfdata.pl, ->>>>>>>>>>>>>> allow glc_nec=0, and don't write out glcmec fields if glc_nec=0. - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 --- Don't define glc_nec - fields if nglcec == 0. - M models/lnd/clm/tools/mksurfdata/mkglcmecMod.F90 - Set nglcec=0 by default, - add ability to handle nglcec=0 - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ---- Don't write out or call - glc-mec stuff if nglcec == 0. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl --- Add ability to set glc_nec - get mksrf_glacier file from XML database - ->>>>>>>>>>>>>> Add in new glc_nec=10 datasets, change precedence order in ->>>>>>>>>>>>>> build-namelist so use_case is AFTER -namelist/-infile/-clm_usr_name. ->>>>>>>>>>>>>> Add mksrf_glacier files to XML database - M models/lnd/clm/bld/listDefaultNamelist.pl - Make faster and add settings - for glc_nec and glc_grid, also add loop over sim_year_range - M models/lnd/clm/bld/build-namelist --------- Change precedence order so - that use-cases are after namelist and infile (thus user_nl_clm files - are used in place of the use-case. Check that the use-cases follow - a strict naming convention (ensures will work with PTCLM.py). - This is the new order of precedence -+ 1. values set on the command-line using the -namelist option, -+ 2. values read from the file specified by -infile, -+ 3. datasets from the -clm_usr_name option, -+ 4. values set from a use-case scenario, e.g., -use_case -+ 5. values from the namelist defaults file. - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --------- Add - mksrf_glacier file for mksurfdata.pl to XML database - M models/lnd/clm/bld/namelist_files/datm-build-namelist ------------- Change - order of precedence so that use_case is after infile and namelist - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------- New glc datasets - surfdata for 1850@(f09,f19,T31) - pftdyn for 1850-2000@(f09,f19,T31) - pftdyn for 1850-2100@(f09,f19,T31) rcp (2.6,4.5,6,8.5) - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Add - mksrf_glacier datasets for glc_nec=0 (previous version), glc_nec=3,5,10 - use older glacier dataset that Bill Lipscomb says has better glacier - representation over greenland ->>>>>>>>>>>>>> Remove direct calls to pio -- use ncdio_pio module for all NetCDF ->>>>>>>>>>>>>> read/write/define/query. Write out at initialization if there is no ->>>>>>>>>>>>>> land and won't be running CLM. - M models/lnd/clm/src/main/clm_initializeMod.F90 - Set subname and write out - if no land exists and clm will NOT be run - M models/lnd/clm/src/main/iniTimeConst.F90 ------ Use ncd_io to read in mxsoil_color - (remove direct calls to pio) - M models/lnd/clm/src/main/histFileMod.F90 ------- Use ncd_io to read/write - everything (remove direct calls to pio). Add max_nFields function. - M models/lnd/clm/src/main/restFileMod.F90 ------- Change use of PIO_GLOBAL - to NCD_GLOBAL - M models/lnd/clm/src/main/ncdio_pio.F90 --------- Remove making pio interfaces - public, add new interfaces to ncd_io global, add dimexist as optional - argument to ncd_inqdid, and name as optional argument to ncd_inqdlen - change ncd_io interfaces that could NOT need to call scam_field_offsets - so that they don't. Initialize data_offset and pfts to bigint NOT nan. - New interfaces: -+ module procedure ncd_io_char_var1_nf -+ module procedure ncd_io_char_var3_nf -+ module procedure ncd_io_char_varn_strt_nf - M models/lnd/clm/src/main/surfrdMod.F90 --------- Use ncd_inqdid and ncd_inqvid - instead of pio interfaces directly. - -Summary of testing: - - bluefire: All PASS except... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -057 blV61 TBL.sh _mec10sc_dh clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ...................FAIL! rc= 7 -061 blVn1 TBL.sh _mec10sc_dh clm_transient_glcMEC_rcp8.5 20331231:1800 1.9x2.5 gx1v6@1850-2100 48 arFAIL! rc= 5 -063 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -064 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -065 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -066 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - -glcmec TBL tests fail since they didn't exist in previous version - - bluefire interactive testing: -006 smHS3 TSM.sh _nrcnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic ......FAIL! rc= 8 -007 erHS3 TER.sh _nrcnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -3+-3 arb_ic ...FAIL! rc= 5 -008 brHS3 TBR.sh _nrcnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -3+-3 arb_ic ...FAIL! rc= 5 -009 blHS3 TBL.sh _nrcnsc_do clm_usrdat 20030101:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic ......FAIL! rc= 4 -044 blV63 TBL.sh _mec10sc_do clm_glcmec 19980115:1800 1.9x2.5 gx1v6 48 arb_ic ...................FAIL! rc= 7 -060 sm974 TSMscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds ....FAIL! rc= 6 - bluefire/CESM testing: All PASS except... (new compare tests fail since didn't exist before) -BFAIL ERI.f19_g16.IG1850.bluefire.compare.clm4_0_22 -BFAIL ERS_D.T31_g37.IGRCP26CN.bluefire.compare.clm4_0_22 -BFAIL PST.f10_f10.I20TRCN.bluefire.compare.clm4_0_22 -BFAIL PET_PT.f10_f10.I20TRCN.bluefire.compare.clm4_0_22 -BFAIL SMS.f10_f10.IRCP45CN.bluefire.compare.clm4_0_22 - -PEND ERS_D.f45_g37.I.bluefire.GC.003008 -PEND ERP.T31_g37.IGRCP60CN.bluefire.GC.003008 -PEND ERH_D.f10_f10.I1850CN.bluefire.GC.003008 -PEND ERS_D.f19_g16.IRCP85CN.bluefire.GC.003008 - - bluefire/CESM Extra testing: -PASS ERI.f19_g16.IG1850.bluefire -PASS ERI.f19_g16.IG1850CN.bluefire -PASS ERS.T31_g37.IGRCP45CN.bluefire -PASS ERS.T31_g37.IGRCP85CN.bluefire - -PASS ERS_D.T31_g37.IG.bluefire -PASS ERS_D.f19_g16.IGCN.bluefire - - bluefire/CESM Extra testing for coupled with CAM and CAM/POP: -PASS ERI.f19_g16.BGCN.bluefire -PASS SMS_D.f19_g16.BG1850CN.bluefire -PASS ERP.f09_g16.BG20TRCN.bluefire -PASS ERS.T31_g37.BGRCP26CN.bluefire -RUN ERS_D.T31_g37.BGRCP45CN.bluefire.111336 --- takes too long -PASS ERS.T31_g37.BGRCP60CN.bluefire -RUN ERS_D.T31_g37.BGRCP85CN.bluefire.111336 --- takes too long -FAIL SMS.f19_f19.EGCN.bluefire ----------------- seg-fault -FAIL SMS.T31_T31.EG1850CN.bluefire ------------- seg-fault -PASS ERI.f09_f09.FGCN.bluefire -PASS SMS.f19_f19.FG1850CN.bluefire -PASS SMS.T31_T31.FG20TRCN.bluefire -FAIL SMS.T31_g37.TG.bluefire - - bluefire/PTCLM testing: -PTCLM.631306_1x1_mexicocityMEX_ICN.PTCLM PASS -PTCLM.631306_1x1_mexicocityMEX_I.PTCLM PASS -PTCLM.631306_1x1_mexicocityMEX_I_QIAN.PTCLM PASS -PTCLM.631306_US-Ha1_I_1850.PTCLM PASS -PTCLM.631306_US-Ha1_I20TR.PTCLM PASS -PTCLM.631306_US-Ha1_I20TRCN.PTCLM PASS -PTCLM.631306_US-Ha1_ICN.PTCLM PASS -PTCLM.631306_US-Ha1_I1850CN.PTCLM PASS -PTCLM.631306_US-Ha1_IRCP85CN.PTCLM PASS -PTCLM.631306_US-Ha1_I.PTCLM PASS -PTCLM.631306_US-Ha1_I_QIAN.PTCLM PASS -PTCLM.631306_US-Ha1_I.PTCLM PASS -PTCLM.631306_US-UMB_I.PTCLM PASS -PTCLM.631306_US-UMB_I_QIAN.PTCLM PASS -PTCLM.631306_US-UMB_I.PTCLM PASS -US-Ha1_ICN_ad_spinup.PTCLM PASS - jaguar interactive testing: All PASS except... -011 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -012 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -013 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -014 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -026 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 5 - jaguar/PTCLM testing: -PTCLM.4224_1x1_mexicocityMEX_ICN.PTCLM PASS -PTCLM.4224_1x1_mexicocityMEX_I.PTCLM PASS -PTCLM.4224_1x1_mexicocityMEX_I_QIAN.PTCLM PASS -PTCLM.4224_US-Ha1_I_1850.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I20TR.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I20TRCN.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_ICN.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I1850CN.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_IRCP85CN.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I_QIAN.PTCLM FAIL 0 -PTCLM.4224_US-Ha1_I.PTCLM FAIL 0 -PTCLM.4224_US-UMB_I.PTCLM FAIL 0 -PTCLM.4224_US-UMB_I_QIAN.PTCLM FAIL 0 -PTCLM.4224_US-UMB_I.PTCLM FAIL 0 -US-Ha1_ICN_ad_spinup.PTCLM PASS - edinburgh/lf95 interactive testing: All PASS up to... -022 blVx3 TBL.sh _mec10sc_do clm_transient_glcMEC_rcp4.5 20331231:1800 48x96 gx3v7@1850-2100 -10 arbFAIL! rc= 5 - edinburgh/PTCLM testing: Fails because Python is too OLD (2.4 when needs 2.5) - yong/intel/PTCLM testing: Following PASS... -PTCLM.4900_1x1_mexicocityMEX_ICN.PTCLM PASS -PTCLM.4900_1x1_mexicocityMEX_I.PTCLM PASS -PTCLM.4900_1x1_mexicocityMEX_I_QIAN.PTCLM PASS -PTCLM.4900_US-Ha1_I_1850.PTCLM PASS -PTCLM.4900_US-Ha1_I20TR.PTCLM PASS -PTCLM.4900_US-Ha1_I20TRCN.PTCLM PASS -PTCLM.4900_US-Ha1_ICN.PTCLM PASS - -CLM tag used for the baseline comparison tests if applicable: clm4_0_22 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_22 -Originator(s): erik (Erik Kluzek) -Date: Thu Jan 20 13:17:56 MST 2011 -One-line Summary: Move coupler field indicies to clm, move cpl_* directories up a level, add the cpl_share directory - -Purpose of changes: - -Move cpl_* directories up a level, add cpl_shr directory. Update driver, move coupler -field indicies to clm, and allow fields to be passed in driver with just names added to -namelist. Make is_restart() public in clm_time_manager.F90. Fix PTS_MODE. Don't pass -Sl_landfrac to driver in run-phase. - -Bugs fixed (include bugzilla ID): - 1271 (Problem in PTS_MODE with clm) - 1270 (Make is_restart public in clm_time_manager.F90) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1273 (fix pts_mode problem on jaguar) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1110 (dtlimit error in datm8 with partial year forcing) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: Change Filepath - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mvertens (most code changes originate from mvertens) - I made some tweaks after the review and added protex header documentation to the - new clm_cpl_indices file. - -List any svn externals directories updated (csm_share, mct, etc.): datm, cism - datm to datm8_110118 - cism to cism1_100913 - -List all files eliminated: - ->>>>>>>>> Move to directories up a level - D models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - D models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - D models/lnd/clm/src/main/cpl_esmf/lnd_comp_mct.F90 - -List all files added and what they do: - ->>>>>>>>> Use this local version of indices rather than seq_indices_mod.F90 - A models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - ->>>>>>>>> Move to directories up a level, use local version of indices rather ->>>>>>>>> than seq_* version and remove sending landfrac at run phase. - A models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 - A models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 - A models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/doc/README -- Update directory info. - ->>>>>>>>> Change pts_mode test so that RTM is not turned on. - M models/lnd/clm/test/system/input_tests_master - ->>>>>>>>> Change Filepath - M models/lnd/clm/bld/configure - ->>>>>>>>> Make is_restart() method public - M models/lnd/clm/src/main/clm_time_manager.F90 - ->>>>>>>>> Fix PTS_MODE. - M models/lnd/clm/src/main/pftvarcon.F90 ------- Pass posNOTonfile=.true. down - to ncd_io methods so won't check for lat/lon - M models/lnd/clm/src/main/ncdio_pio.F90 ------- Add posNOTonfile option to global - reads so that if set, won't try to find nearest lat/lon to PTS_MODE point - (for files that are global data NOT spatial). - M models/lnd/clm/src/biogeophys/SNICARMod.F90 - Pass posNOTonfile=.true. down - to ncd_io methods so won't check for lat/lon - -Summary of testing: - - bluefire: All PASS except... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -059 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -060 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -061 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -062 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except... ->>>>>>>> Test was changed to remove RTM -025 blAK4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 1.9x2.5 gx1v6 -10 cold ...............FAIL! rc= 5 - bluefire/CESM testing: All PASS except... -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_20 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_20 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_20 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_20 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_20 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_20 -FAIL PST.f45_g37.I1850.bluefire.compare.clm4_0_20 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_20 -FAIL ERS_E.f19_g16.I1850.bluefire.compare.clm4_0_20 -FAIL ERS_E.f19_g16.I1850.bluefire.compare_hist.clm4_0_20 -FAIL ERI.f19_g16.IG.bluefire.compare.clm4_0_20 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_20 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_20 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_20 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm4_0_20 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_20 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_20 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_20 ->>>>>>>> Compare tests fail because Sl_landfrac is missing on new case ->>>>>>>> Everything else is identical - bluefire/PTCLM testing: All PASS - edinburgh/lf95 interactive testing: All PASS except... -006 blAL4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 5 - yong/intel interactive testing: -006 blAL4 TBL.sh _nrsc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ..................FAIL! rc= 5 -011 smD94 TSM.sh _persc_ds clm_per^nl_urb 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 10 -012 erD94 TER.sh _persc_ds clm_per^nl_urb 20021231:1200 4x5 gx3v7 72+72 cold ....................FAIL! rc= 5 -013 blD94 TBL.sh _persc_ds clm_per^nl_urb 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 4 -019 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -020 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_21 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_21 -Originator(s): jedwards (Jim Edwards) -Date: Wed Jan 12 14:50:45 MST 2011 -One-line Summary: Remove includes, finish PIO transition - -Purpose of changes: - -Code cleanup - -Remove misc.h/preproc.h, update SNICARMod to use ncdio_pio calls rather than NetCDF -directly. - -Bugs fixed (include bugzilla ID): - 394 (misc.h and preproc.h NOT used at all anymore) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1271 (Problem in PTS_MODE with clm) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1110 (dtlimit error when a full year isn't available) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: Removed generation of files misc.h and preproc.h - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, Erik K - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: misc.h, preproc.h - -D models/lnd/clm/tools/mksurfdata/misc.h -D models/lnd/clm/tools/mksurfdata/preproc.h -D models/lnd/clm/tools/mkdatadomain/preproc.h -D models/lnd/clm/tools/mkdatadomain/misc.h - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - models/lnd/clm/tools/mkgriddata/README - models/lnd/clm/tools/mksurfdata/README - models/lnd/clm/tools/mkdatadomain/README - models/lnd/clm/tools/README - models/lnd/clm/bld/configure - models/lnd/clm/bld/clm.cpl7.template - models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 - models/lnd/clm/src/biogeochem/CASAPhenologyMod.F90 - models/lnd/clm/src/biogeochem/CNGapMortalityMod.F90 - models/lnd/clm/src/biogeochem/CNC13StateUpdate2Mod.F90 - models/lnd/clm/src/biogeochem/CNGRespMod.F90 - models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 - models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 - models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 - models/lnd/clm/src/biogeochem/CNFireMod.F90 - models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 - models/lnd/clm/src/biogeochem/CNSummaryMod.F90 - models/lnd/clm/src/biogeochem/CNDVLightMod.F90 - models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 - models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 - models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 - models/lnd/clm/src/biogeochem/CNC13StateUpdate1Mod.F90 - models/lnd/clm/src/biogeochem/CNC13StateUpdate3Mod.F90 - models/lnd/clm/src/biogeochem/CNDVEcosystemDynIniMod.F90 - models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 - models/lnd/clm/src/biogeochem/C13SummaryMod.F90 - models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 - models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 - models/lnd/clm/src/biogeochem/CNAllocationMod.F90 - models/lnd/clm/src/biogeochem/CNC13FluxMod.F90 - models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 - models/lnd/clm/src/biogeochem/CNSetValueMod.F90 - models/lnd/clm/src/biogeochem/CNDVEstablishmentMod.F90 - models/lnd/clm/src/main/organicFileMod.F90 - models/lnd/clm/src/main/dynlandMod.F90 - models/lnd/clm/src/main/accFldsMod.F90 - models/lnd/clm/src/main/fileutils.F90 - models/lnd/clm/src/main/pftdynMod.F90 - models/lnd/clm/src/main/pft2colMod.F90 - models/lnd/clm/src/main/restFileMod.F90 - models/lnd/clm/src/main/clm_varsur.F90 - models/lnd/clm/src/main/controlMod.F90 - models/lnd/clm/src/main/initSurfAlbMod.F90 - models/lnd/clm/src/main/filterMod.F90 - models/lnd/clm/src/main/clm_varorb.F90 - models/lnd/clm/src/main/initGridCellsMod.F90 - models/lnd/clm/src/main/pftvarcon.F90 - models/lnd/clm/src/main/spmdMod.F90 - models/lnd/clm/src/main/domainMod.F90 - models/lnd/clm/src/riverroute/RunoffMod.F90 - models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 - models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 - models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 - models/lnd/clm/src/biogeophys/QSatMod.F90 - models/lnd/clm/src/biogeophys/clm_driverInitMod.F90 - models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 - - models/lnd/clm/src/biogeophys/SNICARMod.F90 - models/lnd/clm/src/main/ncdio_pio.F90 - - Removed reference to preproc.h and misc.h in all files. Converted snicarmod to use pio - and added support for a 3d non-decomposed real variable in ncdio. - -Summary of testing: - - bluefire: All PASS except... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -059 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -060 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -061 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -062 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -NOTE: pts_mode tests failed... (bug 1271) - bluefire/CESM testing: All PASS - - jaguarpf: All pass except ... -007 brB91 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:1800 4x5 gx3v7 72+72 arb_ic ..................FAIL! rc= 10 -022 erH92 TER.sh 17p_cnsc_dm clm_ndepdyn^nl_cn_conly 20020101:1800 4x5 gx3v7@1850-2000 10+38 cold FAIL! rc= 13 -023 brH92 TBR.sh 17p_cnsc_dm clm_ndepdyn^nl_cn_conly 20020101:1800 4x5 gx3v7@1850-2000 72+72 cold FAIL! rc= 11 -038 smLI2 TSM.sh _sc_dm clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -039 erLI2 TER.sh _sc_dm clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -040 brLI2 TBR.sh _sc_dm clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -041 blLI2 TBL.sh _sc_dm clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 -042 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 96 arb_ic ....................FAIL! rc= 10 -043 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 72+72 arb_ic .................FAIL! rc= 5 -044 brL58 TBR.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 72+72 arb_ic .................FAIL! rc= 5 -045 blL58 TBL.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 48 arb_ic ....................FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_19 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -Tag name: clm4_0_20 -Originator(s): erik (Erik Kluzek) -Date: Tue Jan 11 11:18:30 MST 2011 -One-line Summary: Update for ESMF metadata, update doc. from release branch, - bug fixes (doc of qflx_evap_tot, threading CNDV, aer/ndepregrid) - -Purpose of changes: - -Update externals, fix in datm speeds up single-point simulations, update for esmf -metadata capability. Update documentation from Release branch (cesm1_0_rel07_clm4_0_14). -Fix documentation of qflx_evap_tot. Fix ndepregrid/aerdepregrid scripts. Fix threading -problem with CNDV. - -Bugs fixed (include bugzilla ID): - 1266 (Threading problem with CNDV) - 1265 (Fix ndep/aerdepregrid.ncl) - 1264 (Incorrect doc of qflx_evap_tot in the code) - 1258 (runinit_ibm.csh needs to be updated) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1281 (bug in mksurfdata for urban_only case) - 1282 (Trouble running to last CLM1PT atm time-step) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1110 (dtlimit error when a full year isn't available) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: - Small section of clm_driver was moved to a OMP loop. This should - improve threading performance slightly. - -Code reviewed by: self, doc of qflx_evap_tot by Keith Oleson - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, - stubs, datm, csm_share, timing - - scripts to scripts4_110108 - drv to drvseq3_1_47 - sice to stubs1_2_03 - socn to stubs1_2_03 - sglc to stubs1_2_03 - datm to datm8_110106 - csm_share to share3_101231 - timing to timing_101215 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>> Fix deposition regrid scripts so they will work (from crop04) - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl - Fix XML queries so will - work, using the datm_internal namelist now - M models/lnd/clm/tools/ncl_scripts/ndepregrid.ncl --- Fix XML queries so will - work, using stream_fldfilename_ndep in the ndepdyn_nml namelist. - ->>>>>>>>> Fix so will work (from rel07) - M models/lnd/clm/tools/interpinic/runinit_ibm.csh - Fix config options so will work - M models/lnd/clm/bld/config_files/config_definition.xsl ---- Remove extra empty rows - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl Fix missing ">" - ->>>>>>>>> Update documentation (from rel07) - M models/lnd/clm/doc/UsersGuide/single_point.xml - Change how supported single-point - cases are handled and add documentation on setting start/stop times - M models/lnd/clm/doc/UsersGuide/tools.xml -------- Add new options to mksurfdata.pl - add notes about bugs, add notes that aer/ndepregid is optional - M models/lnd/clm/doc/UsersGuide/preface.xml ------ Update what_is_new section - M models/lnd/clm/doc/UsersGuide/clm_ug.xml ------- Add more versions in quicklist - M models/lnd/clm/doc/UsersGuide/appendix.xml ----- Add note about runinit_ibm.csh - problem - M models/lnd/clm/doc/UsersGuide/custom.xml ------- Remove DATM_PRESAERO=none option, - remove hist_crtinic, and use_ndepstream namelist settings - ->>>>>>>>> Update documentation (from rel07) - M models/lnd/clm/doc/KnownLimitations - Add doc on dtlimit error - M models/lnd/clm/doc/KnownBugs -------- Add bug 1168, remove bug 498 - M models/lnd/clm/doc/README ----------- Rework what's new - M models/lnd/clm/doc/index.shtml ------ Add link to KnownLimitations - M README ------------------------------ Rework what's new - ->>>>>>>>> Fix threading problem with CNDV, by adding an OMP loop in a section ->>>>>>>>> in clm_driver that didn't have one, pass down beg/end c|g|p indices ->>>>>>>>> as needed - M models/lnd/clm/src/biogeochem/CNSetValueMod.F90 - Pass in begc/endc, begp/endp - M models/lnd/clm/src/main/clm_initializeMod.F90 --- Add OMP loop over setFilters - M models/lnd/clm/src/main/pftdynMod.F90 ----------- Pass down beg/end indices as needed - pftdyn_wbal_init, pftdyn_cnbal, pftwt_interp, - M models/lnd/clm/src/main/filterMod.F90 ----------- Pass clump index down to setFilters - remove OMP from inside - M models/lnd/clm/src/main/clm_driver.F90 ---------- Add OMP loop around section that - wasn't inside an OMP loop - ->>>>>>>>> Fix the documentation of the qflx_evap_tot field - M models/lnd/clm/src/main/clmtype.F90 -------------------- Fix qflx_evap_tot doc - M models/lnd/clm/src/main/clm_atmlnd.F90 ----------------- Fix qflx_evap_tot doc - M models/lnd/clm/src/main/histFldsMod.F90 ---------------- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ------ Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 ---- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/Biogeophysics2Mod.F90 ---- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 -------- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 - Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------------- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/HydrologyLakeMod.F90 ----- Fix qflx_evap_tot doc - M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 -- Fix qflx_evap_tot doc - ->>>>>>>>> Add component meta-data for ESMF - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - Add meta-data description - of CLM - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_mct.F90 -- Add more arguments to - lnd_register method - -Summary of testing: - - bluefire: All PASS except... -033 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -034 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -035 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -036 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 4 -037 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -059 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -060 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -061 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -062 blLI1 TBL.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 4 - bluefire interactive testing: All PASS - bluefire/CESM testing: All PASS - bluefire/PTCLM testing: All PASS - jaguar interactive testing: All PASS except (up to 017 brJ74)... -011 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic -.............FAIL! rc= 10 -012 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic -...........FAIL! rc= 5 -013 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 - up to.... - -017 brJ74 TBR.sh 4p_nrcasasc_ds clm_std^nl_urb_br 10001230:3600 1x1_tropicAtl test -3+-3 arb_ic .PASS - edinburgh/lf95 interactive testing: All PASS except... -005 smAL4 TSM.sh _sc_ds clm_std^nl_ptsmode 20030101:1800 10x15 USGS -10 cold ....................FAIL! rc= 10 - edinburgh/PTCLM testing: All PASS up to ... -myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 - mirage,storm/ifort interactive testing: All PASS except... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 10+38 cold .........FAIL! rc= 13 -018 brR53 TBR.sh 17p_cnc13sc_do clm_std^nl_urb_br 20020115:1800 10x15 USGS@1850 72+72 cold ......FAIL! rc= 11 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 10+38 arb_ic ...........FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -025 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -026 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_19 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_19 -Originator(s): erik (Erik Kluzek) -Date: Wed Dec 8 22:20:30 MST 2010 -One-line Summary: Bring irrigation branch to the trunk - -Purpose of changes: - -Add option for simple code to redirect some riverflow to irrigate generic crops. -Irrigation is turned on at 6AM, runs for 4 hours and keeps soil moisture to 0.7. -Change corn and wheat indices to c3crop and irrigated generic c3 crop. -Add QIRRIG as a history file output. Change pft-physiology and RTM flow files from -ASCII to NetCDF. Single pft-physiology file can handle all cases (has extra FCUR value -for CNDV), also has for new fields for crops that will come in later: corn, spring-wheat, -winter-wheat and soybean. Add findat and fsurdat files for irrigation (f09, f19, f10, finidat -only for f19). Split RTM run method into three and move subroutines around to where makes -more sense. Fix a mksurfdata PFT override bug. Synchronize the Makefiles for the tools -and add build for Darwin intel and PGI and remove Darwin XLF. Remove concurrent -directives and UNICOSMP, CPP_VECTOR, NEC_SX CPP #ifdefs. Remove some #include -misc.h/preproc.h statements. Switch pio_close for ncd_close calls. Replace some constants -with parameters. Remove clm_comp layer and call clm_initialize and clm_driver directly. -Change mk*.F90 subroutines in mksurfdata into modules, so that argument checking will -happen at compile-time. - -Bugs fixed (include bugzilla ID): - 964 (Remove UNICOS #ifdef logic in clm) - 1238 (PST test fails) - 1249 (problem in mksurfdata for PFT override mode) - 1253 (mkglacier in mksurfdata has arguments in wrong order) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1248 (PTCLM can only go to 2005) - 1251 (PTCLM testcases aborts in I_QIAN case) - 1258 (runinit_ibm.csh needs to be updated) - 1264 (Incorrect doc of qflx_evap_tot in the code) - 1265 (Fix ndep/aerdepregrid.ncl) - 1266 (Threading problem with CNDV) - 1298 (Can NOT turn RTM off in CLM_CONFIG_OPTS) - 1299 (interpinic does NOT work going from non glc_mec) - 1304 (bug in interpinic *_var) - 1306 (mksoifmaxInit is NOT called) - 1305 (dvolrdt is documented with the wrong units) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: std-test - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Add -irrig and -rtm_res options to build-namelist - -+ -irrig Seek surface datasets with irrigation turned on. -+ -rtm_res "resolution" Specify river transport model resolution. - (Still only have half-degree files in the XML database) - - Add new history field: - - QIRRIG water added through irrigation (mm/s) - -List any changes to the defaults for the boundary datasets: NetCDF pft-phys/RTM files - NetCDF PT-physiology file: pft-physiology.c101006.nc - finidat and surfdata files for irrigation (for 1.9x2.5@2000) - surfdata files for irrigation (for f09 and f10) - NetCDF River-direction file: clmi.IQirrcr_2000-01-01_1.9x2.5_gx1v6_c101115.nc - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, slevis, dlawren, wsacks, mvertens, swensosc - slevis/wsacks -- irrigation changes - dlawren -------- convert pft-physiology file to NetCDF - mvertens ------- high level restructuring - swensosc ------- convert RTM flow file to NetCDF - -List any svn externals directories updated (csm_share, mct, etc.): scripts and csm_share - - scripts to scripts4_101206 - csm_share to csm_share3_101122 - -List all files eliminated: - -D models/lnd/clm/src/main/inicFileMod.F90 --------- Move to inicPerpMod -D models/lnd/clm/src/main/clm_comp.F90 ------------ Move to clm_initialize and - clm_driver -D models/lnd/clm/src/main/scam_setlatlonidx.F90 --- Use shr_scam version -D models/lnd/clm/src/main/snowdp2lev.F90 ---------- Move to mkarbinitMod -D models/lnd/clm/src/main/areaMod.F90 ------------- Split out into relavent modules: - celledge -> RtmMapMod - map_setmapsAr -> RmtMapMod - cellarea -> clm_initialize - map_setgatm -> downscaleMod -D models/lnd/clm/test/system/tests_posttag_spot1 -- rename to yong - -D models/lnd/clm/tools/mksurfdata/mkfmax.F90 ---- rename to mkfmaxMod.F90 -D models/lnd/clm/tools/mksurfdata/mkvocef.F90 --- rename to mkvocefMod.F90 -D models/lnd/clm/tools/mksurfdata/mkglacier.F90 - put in mkglcmecMod.F90 -D models/lnd/clm/tools/mksurfdata/mklanwat.F90 -- rename to mklanwatMod.F90 -D models/lnd/clm/tools/mksurfdata/mkelev.F90 ---- put in mkurbanparMod.F90 -D models/lnd/clm/tools/mksurfdata/mkurban.F90 --- put in mkurbanparMod.F90 -D models/lnd/clm/tools/mksurfdata/mksoitexMod.F90 rename to mksoilMod.F90 - -List all files added and what they do: - -A + models/lnd/clm/test/system/nl_files/clm_irrig -- New irrigation test - ->>>>>>>>>>> Some high level restructuring/renames -A + models/lnd/clm/src/main/inicPerpMod.F90 -------- From inicFileMod -A + models/lnd/clm/src/riverroute/RtmMapMod.F90 ---- From areaMod.F90 -A models/lnd/clm/test/system/tests_posttag_yong -- rename add more tests - ->>>>>>>>>>> Rename mksurfdata subroutines into modules -A models/lnd/clm/tools/mksurfdata/mkfmaxMod.F90 -A models/lnd/clm/tools/mksurfdata/mksoilMod.F90 -A models/lnd/clm/tools/mksurfdata/mkvocefMod.F90 -A models/lnd/clm/tools/mksurfdata/mklanwatMod.F90 - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> Add irrigation "AZ" tests at 10x15 with irrigation on -M models/lnd/clm/test/system/tests_posttag_lynx_nompi -M models/lnd/clm/test/system/tests_pretag_bluefire -M models/lnd/clm/test/system/tests_pretag_edinburgh -M models/lnd/clm/test/system/tests_pretag_jaguar_nompi -M models/lnd/clm/test/system/tests_posttag_hybrid_regression -M models/lnd/clm/test/system/tests_posttag_purempi_regression -M models/lnd/clm/test/system/tests_posttag_intrepid_nompi -M models/lnd/clm/test/system/tests_posttag_nompi_regression -M models/lnd/clm/test/system/tests_pretag_bluefire_nompi -- Remove repeated test - -M models/lnd/clm/test/system/README.testnames --- Add Z res (10x15 with irrig) -M models/lnd/clm/test/system/test_driver.sh ----- Changes for lynx and yong - ->>>>>>>>>>> Fix bug 1249 for PFT overrides, correct irrigation sample namelist ->>>>>>>>>>> Change subroutines into modules for mk*.F90 files (allows compiler to check args) ->>>>>>>>>>> Fix bug 1253 putting mksoitex call after mkglacier -M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig - Correct name of irrigation dataset -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 nullify pctpft_i -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 Set nlat_i/nlon_i to 1 if PFT override -M models/lnd/clm/tools/mksurfdata/mkglcmecMod.F90 -- Add mkglacier subroutine -M models/lnd/clm/tools/mksurfdata/mkurbanparMod.F90 Add mkurban and mkelev subroutines -M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ----- Change subroutines into modules - nullify pctpft_i, put mksoitex call after mkglacier -M models/lnd/clm/tools/mksurfdata/Srcfiles --------- Change names of files -M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 ----- Add mkirrig subroutine - - ->>>>>>>>>>> Sync up the tools Makefiles and add darwin intel and pgi build (remove darwin xlf) -M models/lnd/clm/tools/mksurfdata/Makefile ---- Sync up makefiles, add darwin build -M models/lnd/clm/tools/interpinic/Makefile ---- Sync up makefiles, add darwin build -M models/lnd/clm/tools/mkgriddata/Makefile ---- Sync up makefiles, add darwin build -M models/lnd/clm/tools/mkdatadomain/Makefile -- Sync up makefiles, add darwin build - ->>>>>>>>>>> Add -irrig and -rtm_res options, update files to new NetCDF versions, ->>>>>>>>>>> add in findat/fsurdat files for irrigation (f19,f10, f09) -M models/lnd/clm/bld/build-namelist ----- Add -irrig, -rtm_res options - set do_budgets, and budget_inst in drv_namelist, finidat/fsurdat depend on irrig - set create_crop_landunit by irrig -M models/lnd/clm/bld/clm.cpl7.template -- Set CLM_RTM_RES to half-degree and pass - to build-namelist -M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------ add irrig and rtm_res -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml default for irrig and rtm_res -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ---- New NetCDF - pft-physiology file (for all configs), finidat and fsurdat files check - irrig, f19, f10, and f09 surfdata files for irrigation (and f19 finidat) - defaults for create_croplandunit, new NetCDF RTM direction file -M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ---- Set do_budgets - to .true. and budget_inst to 1. - ->>>>>>>>>>> Remove concurrent directives and misc.h/preproc.h #includes ->>>>>>>>>>> Remove scam_setlatlonidx and use shr_scam_. ->>>>>>>>>>> Switch ncorn for nc3crop and nwheat for nirrig change pio_close for ncd_close -M models/lnd/clm/src/biogeochem/CNMRespMod.F90 -------- Remove concurrent directives - remove misc.h/preproc.h #includes -M models/lnd/clm/src/biogeochem/CASAMod.F90 ----------- Change pio_closefile to - ncd_pioclosefile -M models/lnd/clm/src/biogeochem/CNWoodProductsMod.F90 - Remove directives -M models/lnd/clm/src/biogeochem/DUSTMod.F90 ----------- Remove directives -M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 ncorn->nc3crop, - use shr_scam_getCloseLatLon in place of scam_setlatlonidx, - Remove directives, switch pio_close with ncd_pio_closefile -M models/lnd/clm/src/biogeochem/CNDecompMod.F90 ------- Remove directives and #includes -M models/lnd/clm/src/biogeochem/CNDVMod.F90 ----------- Switch pio_plosefile with ncd_close -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ---- ncorn->nc2crop -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 ---- ncorn->nc3crop, nwheat->nirrig - and remove #includes -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 ncorn->nc3crop, nwheat->nirrig - and remove #includes - ->>>>>>>>>>> Remove concurrent directives and misc.h/preproc.h #includes ->>>>>>>>>>> Remove scam_setlatlonidx and use shr_scam_. ->>>>>>>>>>> Switch ncorn for nc3crop and nwheat for nirrig change pio_close for ncd_close -M models/lnd/clm/src/main/clm_varcon.F90 ------- Add degpsec, isecspday, - and remove #includes -M models/lnd/clm/src/main/clm_varpar.F90 ------- Remove #includes, add ivis/inir - indices, and make rtmlat/rtmlon variables not parameters -M models/lnd/clm/src/main/CNiniTimeVar.F90 ----- Remove directives, and #includes, - add qflx_irrig -M models/lnd/clm/src/main/abortutils.F90 ------- Remove directives, and #includes - and NEC_SX, and UNICOSMP CPP defines -M models/lnd/clm/src/main/accumulMod.F90 ------- Remove directives -M models/lnd/clm/src/main/decompInitMod.F90 ---- Remove UNICOSMP CPP defines -M models/lnd/clm/src/main/clm_initializeMod.F90 Move cellarea from areaMod to here - work with downscale a bit, add stuff from clm_comp init to here -M models/lnd/clm/src/main/clmtypeInitMod.F90 --- Add irrig_rate and n_irrig_steps_left -M models/lnd/clm/src/main/iniTimeConst.F90 ----- Switch pio_close with ncd_close, - add single-column read for PCT_CLAY, switch 86400 for secspday -M models/lnd/clm/src/main/histFileMod.F90 ------ Remove UNICOSMP, switch pio_close - with ncd_close -M models/lnd/clm/src/main/restFileMod.F90 ------ Switch pio_close with ncd_close -There's also a new driver namelist setting that will update the orbit each year -(setting orb_mode and orb_iyear_align). - -Bugs fixed (include bugzilla ID): - 1225 (abort if both trigrid and finemesh on) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 935 (RTM warning NOT an error) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on mirage...) - 1165 (Restart trouble for scaled harvest test on mirage) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1238 (PST test fails) - 1239 (ESMF build fails) - 1240 (lynx_pgi build fails) - 1249 (problem in mksurfdata for PFT override mode) - 1258 (runinit_ibm.csh needs to be updated) - 1264 (Incorrect doc of qflx_evap_tot in the code) - 1265 (Fix ndep/aerdepregrid.ncl) - 1266 (Threading problem with CNDV) - 1318 (interpinic has trouble with new restart files) - 1372 (pio problem writing out CLM history files for CRU - 1381 (Can't change monthly average files to NOT be one per month) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: Add in darwin_intel build - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: Add in T341 datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, - csm_share, pio, mct, cprnc - - scripts to mpiserial07_scripts4_101117 - drv to drv3_1_45 - datm to datm8_101105 - csm_share to share3_101118 - pio to pio1_2_6 - mct to MCT2_7_0_100228-mpiserial101109_tag02 - cprnc to cprnc_101119 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/tests_pretag_jaguar - remove non-existant tests - ->>>>>>>>>> Remove clmi frequency setting, add darwin build/run - M models/lnd/clm/test/system/input_tests_master - M models/lnd/clm/test/system/TBR.sh - M models/lnd/clm/test/system/test_driver.sh - Add darwin builds - M models/lnd/clm/test/system/mknamelist - ->>>>>>>>>> Change orb_iyear for orb_iyear_ad - M models/lnd/clm/test/system/nl_files/nl_urb - M models/lnd/clm/test/system/nl_files/nl_noicertm_sclharv - M models/lnd/clm/test/system/nl_files/clm_ndepdyn -- remove ndepsrc stream setting - Can now replace usage of this file with clm_std - M models/lnd/clm/test/system/nl_files/nl_cn_conly - M models/lnd/clm/test/system/nl_files/nl_urb_br - ->>>>>>>>>> Get build working with darwin_intel - M models/lnd/clm/bld/configure ------ get it working with darwin_intel - M models/lnd/clm/bld/clm.cpl7.template - Use $GMAKE, set to gmake if not set - ->>>>>>>>>> Remove non-existant resolution: 2.5x3.33 - M models/lnd/clm/bld/namelist_files/checklatsfiles.ncl - M models/lnd/clm/bld/namelist_files/checkdatmfiles.ncl - ->>>>>>>>>> Add orb_mode, set orbit based on it, also add orb_iyear_align ->>>>>>>>>> Add run_barriers, pio_inparm namelist, add T341 resolution (512x1024) - M models/lnd/clm/bld/build-namelist - Set orbit based on orb_mode, set pio namelist - for stand-alone testing, - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ---- Remove pio namelist - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - M models/lnd/clm/bld/namelist_files/datm-build-namelist - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- Add T341: griddata, - fracdata, surfdata, topodata (fracdata for USGS and tx0.1 masks)` - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml - ->>>>>>>>>> Switch orb_iyear for orb_iyear_ad - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - ->>>>>>>>>> Switch ncd_x for pio_x/nf_x ->>>>>>>>>> Fix a couple memory leaks that Jim Edwards found ->>>>>>>>>> Make ncd_pio private, add documentation add attributes for restart history ->>>>>>>>>> files, add 2D character read (needed for NetCDF pft-physiology file read on ->>>>>>>>>> irrigation branch) - M models/lnd/clm/src/biogeochem/CASAMod.F90 ------------ Replcae pio_x - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 - use masterproc at top of module - M models/lnd/clm/src/biogeochem/CNDVMod.F90 ------------ Replace pio_x - M models/lnd/clm/src/biogeochem/CNrestMod.F90 ---------- Replace pio_x - M models/lnd/clm/src/main/inicFileMod.F90 -------------- Add use MPI_LOGICAL - M models/lnd/clm/src/main/accumulMod.F90 --------------- Replace pio_x - M models/lnd/clm/src/main/clm_initializeMod.F90 -------- Remove samegrids use downscale, - don't pass namelist to ncd_pio initialization - M models/lnd/clm/src/main/subgridRestMod.F90 ----------- Add use endrun, switch ncd_x for nf_x - M models/lnd/clm/src/main/ndepStreamMod.F90 ------------ PIO initialization uses - driver settings, pass get_calendar to initialization - M models/lnd/clm/src/main/histFileMod.F90 -------------- Add attributes to history restart files - M models/lnd/clm/src/main/restFileMod.F90 -------------- Replace pio_x - M models/lnd/clm/src/main/clm_time_manager.F90 --------- Replace nf_x with ncd_x add - get_calendar - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 ----- Abort if trigrid and downscale - Update orbit params in run-phase - M models/lnd/clm/src/main/clm_varctl.F90 --------------- Remove samegrids - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 --- Abort if trigrid and downscale - Update orbit params in run-phase - M models/lnd/clm/src/main/ncdio_pio.F90 ---------------- Update documentation, make private - add ncd_pio_closefile wrapper, make some pio interfaces public from here, - add ncd_io_char_var2_nf for NetCDF pft-physiology file, remove pio namelist - remove a second allocation that Jim Edwards found - M models/lnd/clm/src/main/surfrdMod.F90 ---------------- Fix memory leak from Jim Edwards - M models/lnd/clm/src/riverroute/RtmMod.F90 ------------- Switch nf_x with ncd_x - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 -- Add use for spval and iulog, - change nf_x for ncd_x - -Summary of testing: - -All TBL tests fail... (although you can use clm4_0_16 with updated externals and show b4b) - - bluefire: All PASS except... -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -055 smLI1 TSM.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -056 erLI1 TER.sh _sc_dh clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -057 brLI1 TBR.sh _sc_dh clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 - bluefire interactive testing: All PASS - bluefire/CESM testing: -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_16 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_16 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_16 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_16 -FAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_16 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_16 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_16 -FAIL PST.f45_g37.I1850.bluefire <<<<< Didn't create scripts problem, bug 1238 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_16 -FAIL ERS_E.f19_g16.I1850.bluefire <<<< Scripts build issue, bug 1239 -BFAIL ERS_E.f19_g16.I1850.bluefire.generate.clm4_0_17 -FAIL ERS_E.f19_g16.I1850.bluefire.compare_hist.clm4_0_16 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_16 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_16 -FAIL PST.f10_f10.I8520CN.bluefire <<<<< Didn't create scripts problem, bug 1238 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_16 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_16 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_16 - bluefire/PTCLM testing: All PASS - jaguar: All PASS except... -007 brB91 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:1800 4x5 gx3v7 72+72 arb_ic ..................FAIL! rc= 13 -022 erH92 TER.sh 17p_cnsc_dm clm_ndepdyn^nl_cn_conly 20020101:1800 4x5 gx3v7@1850-2000 10+38 cold FAIL! rc= 13 -023 brH92 TBR.sh 17p_cnsc_dm clm_ndepdyn^nl_cn_conly 20020101:1800 4x5 gx3v7@1850-2000 72+72 cold FAIL! rc= 11 -038 smLI2 TSM.sh _sc_dm clm_std 20020101:1800 94x192 T62 -10 arb_ic .............................FAIL! rc= 10 -039 erLI2 TER.sh _sc_dm clm_std 20020101:1800 94x192 T62 -5+-5 arb_ic ...........................FAIL! rc= 5 -040 brLI2 TBR.sh _sc_dm clm_std 20020101:1800 94x192 T62 -10+-10 arb_ic .........................FAIL! rc= 5 -042 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 96 arb_ic ....................FAIL! rc= 10 -043 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 72+72 arb_ic .................FAIL! rc= 5 -044 brL58 TBR.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 72+72 arb_ic .................FAIL! rc= 5 - jaguar interactive testing: All PASS except... -007 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -008 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -009 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -027 sm974 TSMscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds ....FAIL! rc= 6 - edinburgh/lf95 interactive testing: All PASS - edinburgh/lf95 testing: All PASS except... -005 smD91 TSM.sh _persc_dh clm_per^nl_urb 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 10 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:1200 4x5 gx3v7 72+72 cold ....................FAIL! rc= 5 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -012 smG56 TSM.sh 17p_sc_m clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic ..............FAIL! rc= 10 -013 smE91 TSM.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:1800 4x5 gx3v7 96 arb_ic .................FAIL! rc= 10 -014 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:1800 4x5 gx3v7 10+38 arb_ic ..............FAIL! rc= 5 -015 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:1800 4x5 gx3v7 72+72 arb_ic ...........FAIL! rc= 5 -018 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:1800 10x15 USGS@2000 10+38 cold ............FAIL! rc= 13 -019 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:1800 10x15 USGS@2000 72+72 cold .........FAIL! rc= 11 -025 smL51 TSM.sh _sc_dh clm_std^nl_urb 20020115:1800 10x15 USGS 96 arb_ic .......................FAIL! rc= 10 -026 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:1800 10x15 USGS 10+38 arb_ic ....................FAIL! rc= 5 -027 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:1800 10x15 USGS 72+72 arb_ic .................FAIL! rc= 5 -029 smH41 TSM.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 96 cold ..FAIL! rc= 10 -030 erH41 TER.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 5 -031 brH41 TBR.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 5 -033 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:1800 10x15 USGS 96 arb_ic ....................FAIL! rc= 10 - edinburgh/PTCLM testing: All PASS up to... -myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 - mirage,storm/ifort interactive testing: All PASS except... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:1800 10x15 USGS@1850 10+38 cold .........FAIL! rc= 13 -018 brR53 TBR.sh 17p_cnc13sc_do clm_std^nl_urb_br 20020115:1800 10x15 USGS@1850 72+72 cold ......FAIL! rc= 11 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 144 arb_ic .............FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 10+38 arb_ic ...........FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:1800 10x15 USGS@1000-1002 72+72 arb_ic ...........FAIL! rc= 5 -025 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 10+38 cold FAIL! rc= 13 -026 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:1800 10x15 USGS@2000 72+72 cold FAIL! rc= 11 - lynx/pgi testing: All FAIL scripts build issue <<<< bug 1240 - yong/darwin_intel testing: All PASS up to ... -005 smD94 TSM.sh _persc_ds clm_per^nl_urb 20021231:1200 4x5 gx3v7 144 cold ......................FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_16 - - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: All with datm - - what platforms/compilers: All - - nature of change: roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - PERGRO test on bluefire - -=============================================================== -=============================================================== -Tag name: clm4_0_16 -Originator(s): erik/mvertens (Kluzek Erik 1326 CGD) (Vertenstein Mariana 1349 CGD) -Date: Wed Oct 27 13:33:21 MDT 2010 -One-line Summary: Fix downscaling roundoff difference for same-grids by copying scale factor when needed - -Purpose of changes: - -Fix bug 1230, that caused problems with runoff to the ocean when running fully coupled. The global integrals of runoff fields -was the same in the coupler -- but the values where roundoff different. This caused problems both in testing for bit-for-bit with -the previous version and with restarts. The problem was that in the downscaling changes made in clm4_0_15 the areal scaling factor -asca needed to be copied from adomain into ldomain is no downscaling is taking place. - -Bugs fixed (include bugzilla ID): -=============================================================== -Tag name: clm4_0_14 -Originator(s): erik (Erik Kluzek) -Date: Tue Oct 19 13:12:36 MDT 2010 -One-line Summary: Fix finidat file for T31 sim_year=2000 cases - -Purpose of changes: - -Remove the 1850 T31 finidat file for sim_year=2000 and use the previous sim_year=2000 -files (created using interpinic). Update scripts and datm. - -Bugs fixed (include bugzilla ID): Correct finidat file for T31 sim_year=2000 - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1249 (problem in mksurfdata for PFT override mode) - 1258 (runinit_ibm.csh needs to be updated) - 1264 (Incorrect doc of qflx_evap_tot in the code) - 1265 (Fix ndep/aerdepregrid.ncl) - 1266 (Threading problem with CNDV) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Go back to T31,sim_year=2000 -finidat file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts and datm - - scripts to mpiserial05_scripts4_101018 - datm to datm8_101008 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml -- Return to old - finidat file for T31 sim_year=2000 -M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - change - fearedep to datm_file_aero - -Summary of testing: - - bluefire/CESM testing: -PASS SMS_D.T31_g37.I1850CN.bluefire -PASS SMS_D.T31_g37.ICN.bluefire - -CLM tag used for the baseline comparison tests if applicable: clm4_0_13 - -Changes answers relative to baseline: T31 2000 cases - -=============================================================== -=============================================================== -Tag name: clm4_0_13 -Originator(s): erik (Erik Kluzek) -Date: Sat Oct 16 09:14:08 MDT 2010 -One-line Summary: Bring in PTCLM branch, add in T31 finidat file and turn off ice_runoff for T31 - -Purpose of changes: - -Bring in PTCLM work. Update externals for scripts, datm, drv. Get mksurfdata to have options to override soil/PFT with user input values. Fix some issues with getregional_datasets.pl. Remove old stand-alone CLM Makefile (always use CESM Macro's files and Makefile). More removal of ndepsrc in build-namelist. Turn off ice_runoff for T31. Add in T31 finidat file. - -Bugs fixed (include bugzilla ID): - 1189 (Create ability to change soil color/texture in mksurfdata) - 1188 (Add ability to handle control transient land-cover change) - 1206 (Problem looping over a single year of CPLHIST forcing) - 1211 (Small memory leak in CLM4 initialization) - 1223 (ESMF problem) -Known bugs (include bugzilla ID): - 701 (svn keyword) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) - 1249 (problem in mksurfdata for PFT override mode) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart - 452 (Problem with support of soil-colors != 8 or 20) - -Type of tag: standard - -Describe any changes made to build system: - - Remove custom options to stand-alone build/test, require using cesm make files - -Describe any changes made to the namelist: None, although many new options to mksurfdata namelist - -List any changes to the defaults for the boundary datasets: New T31 finidat files - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, csm_share - - drv to drvseq3_1_37 - datm to datm8_100921 - csm_share to share3_101001 - scripts to PTCLM03_scripts4_101005 - -List all files eliminated: - - R models/lnd/clm/test/system/tests_posttag_breeze >>> rename to mirage ->>>>>>>>>>> Rename to module - R models/lnd/clm/tools/mksurfdata/mkglcmec.F90 - R models/lnd/clm/tools/mksurfdata/mksoicol.F90 - R models/lnd/clm/tools/mksurfdata/mksoitex.F90 - - R models/lnd/clm/bld/config_files/Makefile.in --- Remove always use CESM make - -List all files added and what they do: - ->>>>>>>>>>> Renames - A models/lnd/clm/test/system/tests_posttag_mirage - A models/lnd/clm/tools/mksurfdata/mkglcmecMod.F90 - A models/lnd/clm/tools/mksurfdata/mksoitexMod.F90 - A models/lnd/clm/tools/mksurfdata/mksoicolMod.F90 - ->>>>>>>>>>> Namelist settings for standard urban single-point - A models/lnd/clm/bld/namelist_files/use_cases/stdurbpt.xml - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> Remove PTS_MODE restart/branch tests - M models/lnd/clm/test/system/tests_posttag_lynx_nompi - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_posttag_spot1 --------- remove hybrid test - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_posttag_intrepid_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>> Change breeze+ for mirage changes for new build that requires CESM build files - M models/lnd/clm/test/system/TCB.sh -------------------- Set nc_path - M models/lnd/clm/test/system/config_files/_nrmexsc_ds -- Use -sitespf_pt - M models/lnd/clm/test/system/config_files/_nrvansc_ds -- Use -sitespf_pt - M models/lnd/clm/test/system/test_driver.sh ------------ Swap out mirage/storm for breeze+, add GEN machine options, remove CLM_CESMBLD - M models/lnd/clm/test/system/mknamelist ---------------- Use config_file variable - M models/lnd/clm/test/system/TSMscript_tools.sh -------- Add exedir - M models/lnd/clm/test/system/CLM_runcmnd.sh ------------ Add more options for yong, change breeze+ to mirage/storm - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850 ------ Add exedir - M models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850-2000 - Add exedir - ->>>>>>>>>>> Add new options to override dataset setttings with your own values for: soil color/texture, and PFT - M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 ----- Make private - M models/lnd/clm/tools/mksurfdata/mkglacier.F90 ---- Add option to zero out glacier - M models/lnd/clm/tools/mksurfdata/mkharvestMod.F90 - Add mkharvest_parse_oride to override harvesting - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 ---- Move nglcec here - M models/lnd/clm/tools/mksurfdata/mklanwat.F90 ----- Add option to zero out lake - M models/lnd/clm/tools/mksurfdata/mkurban.F90 ------ Add option to zero out urban - M models/lnd/clm/tools/mksurfdata/mkvarsur.F90 ----- Make private - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 ----- Add new namelist options: soil_color, soil_sand, soil_clay, pft_idx, pft_frc - M models/lnd/clm/tools/mksurfdata/mkpftMod.F90 ----- Add init and override methods: mkpftInit, mkpft, and mkpft_parse_oride - M models/lnd/clm/tools/mksurfdata/Filepath --------- Add esmf_wrf_timemgr to directory list - M models/lnd/clm/tools/mksurfdata/Srcfiles --------- Change names, add shr_cal_mod, shr_string_mod, and ESMF files - - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl ---- Add new options to override your own values, and error check the input: -+ -dynpft "filename" Dynamic PFT/harvesting file to use -+ (rather than create it on the fly) -+ (must be consistent with first year) -+ -exedir "directory" Directory where mksurfdata program is -+ (by default assume it's in the current directory) -+OPTIONS to override the mapping of the input gridded data with hardcoded input -+ -+ -pft_frc "list of fractions" Comma delimited list of percentages for veg types -+ -pft_idx "list of veg index" Comma delimited veg index for each fraction -+ -soil_cly "% of clay" % of soil that is clay -+ -soil_snd "% of sand" % of soil that is sand - ->>>>>>>>>>> Start fixing some issues with getregional scripts -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - ->>>>>>>>>>> Add USER_FCTYP - M models/lnd/clm/tools/mksurfdata/Makefile - M models/lnd/clm/tools/interpinic/Makefile - M models/lnd/clm/tools/mkgriddata/Makefile - M models/lnd/clm/tools/mkdatadomain/Makefile - ->>>>>>>>>>> Remove stand-alone user options and require cesm_bld, add ice_runoff run_stopdate, and new finidat files for T31, more ndepmapalgo defaults ->>>>>>>>>>> Change stop_n values for urban single-point so will run to completion - M models/lnd/clm/bld/configure --------------- Remove options: test, cc, cflags, fc, fflags, fopt, gmake, ldflags, linker, mpi/nc_inc/_lib - add nc_path and mpi_path options, require cesm_bld, and remove logic for doing - clm-stand-alone build - M models/lnd/clm/bld/queryDefaultNamelist.pl - Check for valid values, add list options, - M models/lnd/clm/bld/queryDefaultXML.pm ------ Change a comment - M models/lnd/clm/bld/build-namelist ---------- Add setting of ice_runoff - M models/lnd/clm/bld/config_files/config_sys_defaults.xml --- Set more default machine names - M models/lnd/clm/bld/config_files/config_definition.xml ----- Remove compiler options above and add nc_path/mpi_path - - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Add run_stopdate and work on comments - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Add ice_runoff defaults, new finidat files for T31, add more ndepmapalgo defaults - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml - Change stop_n for urban single-point, add stop_date - - M models/lnd/clm/doc/UsersGuide/preface.xml - Change comment - ->>>>>>>>>>> Fix two code bugs (1211 and 1223) - M models/lnd/clm/src/main/iniTimeConst.F90 ------------ make sure to deallocate memory - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 -- add use statement needed for endrun - -Summary of testing: - - bluefire testing: All PASS except.. (up to 054 smI59) -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 - bluefire interactive testing: All PASS except.. -061 sm9S4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................FAIL! rc= 6 - bluefire/CESM testing: All PASS except -BFAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_11 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_11 - jaguar interactive testing: All PASS except... -005 smAK4 TSM.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -10 cold ............FAIL! rc= 10 -007 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -008 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -009 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/lf95 interactive testing: All PASS - mirage/storm.intel interactive testing: ALL PASS up to... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 10+38 cold ....FAIL! rc= 13 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_12 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_12 -Originator(s): erik (Erik Kluzek) -Date: Fri Sep 10 13:07:03 MDT 2010 -One-line Summary: Add U10 to history, cesm1_0_rel06 updates, PTCLM02 updates (except - mksurfdata), remove ndepdat/dyn/faerdep - -Purpose of changes: - -Update to latest cesm1 release branch. Change SPMD from spmd to use_mpiserial in -configure. Remove old aerdep and ndepdat/dyn files from code and scripts. Change ccsm in -scripts to cesm. Add in new U10 field to history files, change old name to U10_DUST. Some -updates from PTCLM branch for XML database. Also perturb initial conditions read in from -initial file by pertlim. With with PERGRO CPP #ifdef a bit. Start adding in testing on -lynx. - -Bugs fixed (include bugzilla ID): - 1199 (Add trusted machine history file for PERGRO analysis) - 1196 (Add urban option to configure, delete GRANDVIEW ifdefs) - 1191 (UG documentation for single-point needs to change que to shared-que) - 1167 (Add note about reducing PE's for single-point mode) - 1115 (Make config_definition names the same as configure options) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1206 (Problem looping over a single year of CPLHIST forcing) - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1147 (mkgriddata can't straddle over Greenwich) - -Type of tag: std-test - -Describe any changes made to build system: - Names of configure modes changed: seq_ccsm to clm_stndln, and ext_ccsm_seq to ext_cesm - Add sitespf_pt option which will set either MEXICOCITY or VANCOUVER cpp ifdefs - Names of some configure options changed to make consistent with config_definition file. - -Describe any changes made to the namelist: Remove use_ndepstream/fndepdat/fndepdyn/faerdep - -List any changes to the defaults for the boundary datasets: - - New 10x15 rcp6 transient 1850-2100 pftdyn dataset - Add navy oro file to clm_tools XML file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, U10 code from Keith Oleson - -List any svn externals directories updated (csm_share, mct, etc.): scripts and datm - scripts to scripts4_100901a - datm to datm8_100830 - -List all files eliminated: - - D models/lnd/clm/src/main/aerdepMod.F90 - D models/lnd/clm/src/main/ndepFileMod.F90 - D models/lnd/clm/tools/ncl_scripts/convertUrbanOffline2Seq.ncl - D models/lnd/clm/tools/ncl_scripts/getndepdatFrom20thCentury.ncl - D models/lnd/clm/tools/mkgriddata/mkgriddata.ccsm_dom -- Rename to .cesm_dom - D models/lnd/clm/doc/UsersGuide/fixvan_datm.buildnml.diff - -List all files added and what they do: - ->>>>>>>>>> Transient test files for rcp2.6 and rcp4.5, start adding lynx testing - A models/lnd/clm/test/system/nl_files/clm_transient_rcp2.6 - A models/lnd/clm/test/system/nl_files/clm_transient_rcp4.5 - A models/lnd/clm/test/system/tests_posttag_lynx - A models/lnd/clm/test/system/tests_posttag_lynx_nompi - ->>>>>>>>>> Sample perturbation growth data for jaguar, intel and lahey - A models/lnd/clm/tools/ncl_scripts/RMSjaguar.dat - A models/lnd/clm/tools/ncl_scripts/RMSintel.dat - A models/lnd/clm/tools/ncl_scripts/RMSlahey.dat - - A models/lnd/clm/tools/mkgriddata/mkgriddata.cesm_dom - rename from .ccsm_dom - ->>>>>>>>>> Plot of sample bad perturbation error growth - A models/lnd/clm/doc/UsersGuide/badpergro.jpg - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>> Change ccsm_seq=>clm_stndln, spmd=>nouse_mpiserial - M models/lnd/clm/test/system/config_files/_nrsc_dh - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_nrsc_ds - M models/lnd/clm/test/system/config_files/17p_scnv_do - M models/lnd/clm/test/system/config_files/17p_cndvsc_m - M models/lnd/clm/test/system/config_files/_scnv_dh - M models/lnd/clm/test/system/config_files/_nrsc_dm - M models/lnd/clm/test/system/config_files/17p_cndvsc_o - M models/lnd/clm/test/system/config_files/4p_nrcasasc_ds - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_dm - M models/lnd/clm/test/system/config_files/_nrsc_do - M models/lnd/clm/test/system/config_files/_persc_dh - M models/lnd/clm/test/system/config_files/17p_cnexitspinupsc_do - M models/lnd/clm/test/system/config_files/17p_cndvsc_s - M models/lnd/clm/test/system/config_files/_nrsc_ds - M models/lnd/clm/test/system/config_files/_scnv_do - M models/lnd/clm/test/system/config_files/_persc_dm - M models/lnd/clm/test/system/config_files/_persc_do - M models/lnd/clm/test/system/config_files/4p_vodsrsc_dh - M models/lnd/clm/test/system/config_files/_persc_ds - M models/lnd/clm/test/system/config_files/_nrmexsc_ds - M models/lnd/clm/test/system/config_files/_mec10sc_dh - M models/lnd/clm/test/system/config_files/4p_vodsrsc_dm - M models/lnd/clm/test/system/config_files/_nrcnsc_do - M models/lnd/clm/test/system/config_files/17p_sc_dh - M models/lnd/clm/test/system/config_files/4p_vodsrsc_do - M models/lnd/clm/test/system/config_files/_mec10sc_dm - M models/lnd/clm/test/system/config_files/_nrcnsc_ds - M models/lnd/clm/test/system/config_files/4p_casasc_dh - M models/lnd/clm/test/system/config_files/4p_vodsrsc_ds - M models/lnd/clm/test/system/config_files/17p_sc_dm - M models/lnd/clm/test/system/config_files/_mec10sc_do - M models/lnd/clm/test/system/config_files/17p_sc_do - M models/lnd/clm/test/system/config_files/_sc_dh - M models/lnd/clm/test/system/config_files/_mec10sc_ds - M models/lnd/clm/test/system/config_files/4p_casasc_dm - M models/lnd/clm/test/system/config_files/4p_casasc_do - M models/lnd/clm/test/system/config_files/17p_sc_ds - M models/lnd/clm/test/system/config_files/_sc_dm - M models/lnd/clm/test/system/config_files/4p_casasc_ds - M models/lnd/clm/test/system/config_files/_nrsc_s - M models/lnd/clm/test/system/config_files/_sc_do - M models/lnd/clm/test/system/config_files/17p_cnsc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_m - M models/lnd/clm/test/system/config_files/_sc_ds - M models/lnd/clm/test/system/config_files/17p_cnsc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_do - M models/lnd/clm/test/system/config_files/_nrvansc_ds - M models/lnd/clm/test/system/config_files/17p_sc_h - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_do - M models/lnd/clm/test/system/config_files/4p_casasc_h - M models/lnd/clm/test/system/config_files/17p_sc_m - M models/lnd/clm/test/system/config_files/17p_sc_o - M models/lnd/clm/test/system/config_files/_sc_h - M models/lnd/clm/test/system/config_files/4p_casasc_m - M models/lnd/clm/test/system/config_files/4p_casasc_o - M models/lnd/clm/test/system/config_files/_sc_m - M models/lnd/clm/test/system/config_files/17p_vodsrsc_h - M models/lnd/clm/test/system/config_files/17p_cndvsc_dh - M models/lnd/clm/test/system/config_files/_sc_o - M models/lnd/clm/test/system/config_files/17p_vodsrsc_m - M models/lnd/clm/test/system/config_files/_sc_s - M models/lnd/clm/test/system/config_files/17p_cndvsc_dm - M models/lnd/clm/test/system/config_files/17p_vodsrsc_o - M models/lnd/clm/test/system/config_files/17p_cndvsc_do - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dh - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_dm - M models/lnd/clm/test/system/config_files/17p_cnadspinupsc_do - M models/lnd/clm/test/system/config_files/17p_vodsrsc_dh - M models/lnd/clm/test/system/config_files/_scsnf_dh - M models/lnd/clm/test/system/config_files/4p_vodsnrsc_ds - M models/lnd/clm/test/system/config_files/17p_vodsrsc_dm - M models/lnd/clm/test/system/config_files/_scsnf_dm - M models/lnd/clm/test/system/config_files/17p_vodsrsc_do - M models/lnd/clm/test/system/config_files/4p_vodsrsc_h - M models/lnd/clm/test/system/config_files/_scsnf_do - M models/lnd/clm/test/system/config_files/17p_vodsrsc_ds - M models/lnd/clm/test/system/config_files/_mec10sc_h - M models/lnd/clm/test/system/config_files/4p_vodsrsc_o - M models/lnd/clm/test/system/config_files/_mec10sc_m - M models/lnd/clm/test/system/config_files/_mec10sc_o - M models/lnd/clm/test/system/config_files/17p_scnv_dh - M models/lnd/clm/test/system/config_files/17p_cndvsc_h - M models/lnd/clm/test/system/config_files/README --- seq-ccsm=>standalone clm - ->>>>>>>>>> Change comments of CCSM to CESM, start adding in test support of lynx, convert ->>>>>>>>>> SPMD to NOUSE_MPISERIAL, change mode name of seq_ccsm to clm_stndln, add tests ->>>>>>>>>> for more rcp's. - M models/lnd/clm/test/system/TCB.sh ------------- CCSM_MACH=>CESM_MACH, ccsm_bld=>cesm_bld - M models/lnd/clm/test/system/README.testnames --- Change ccsm=>cesm, seq_ccsm=>clm_stndln - M models/lnd/clm/test/system/test_driver.sh ----- Change CLM_CCSMBLD=>CLM_CESMBLD, - Start adding lynx. - M models/lnd/clm/test/system/input_tests_master - Add HX and HY tests, ccsm=>cesm - M models/lnd/clm/test/system/README ------------- CLM_CCSMBLD=>CLM_CESMBLD - M models/lnd/clm/test/system/CLM_runcmnd.sh ----- NOSPMD=>NOUSE_MPISERIAL - ->>>>>>>>>> Change comments from ccsm to cesm, change namelist to get faerdep file from, ->>>>>>>>>> work on pergro plot so can plot more graphs. - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl --- ccsm=>cesm, - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl -- ccsm=>cesm, - get aerdep file from clmexp clm_tool namelist - M models/lnd/clm/tools/ncl_scripts/RMSintrepid.dat ---- New data - M models/lnd/clm/tools/ncl_scripts/RMSbluefire.dat ---- New data - M models/lnd/clm/tools/ncl_scripts/aerdepregrid.ncl --- Get from clmexp namelist - M models/lnd/clm/tools/ncl_scripts/pergroPlot.ncl ----- Add ability to plot up to - five files, make sure lines are different, add success line to end. - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl - Do some operations with - out meta-data to save time and remove warnings - M models/lnd/clm/tools/ncl_scripts/README --------- Change ccsm=>cesm and improve - M models/lnd/clm/tools/interpinic/runinit_ibm.csh - Change ccsm=>cesm - M models/lnd/clm/tools/mkgriddata/mkvarctl.F90 ---- Correct documentation, ccsm=>cesm - M models/lnd/clm/tools/mkgriddata/mkgriddata.F90 -- ccsm=>cesm - M models/lnd/clm/tools/mkgriddata/README ---------- ccsm=>cesm - M models/lnd/clm/tools/mkdatadomain/addglobal.F90 - ccsm=>cesm - ->>>>>>>>>> Changes comments of ccsm to cesm, add sitespf_pt config option, remove ->>>>>>>>>> -ndepsrc, add ndepmapalgo, switch prog_seasalt for progsslt, spmd for ->>>>>>>>>> nouse_mpiserial, change names of modes - M models/lnd/clm/bld/configure ---------------- ccsm=>cesm, +sitespf_pt, - prog_seasalt=>progsslt, spmd=>nouse_mpiserial, modes changed to - ext_cesm, and clm_stndln, remove setting of SPMD cppdef - M models/lnd/clm/bld/queryDefaultNamelist.pl -- ccsm=>cesm - M models/lnd/clm/bld/queryDefaultXML.pm ------- Remove ability to use cam config - file, spmd=>nouse_mpiserial - M models/lnd/clm/bld/build-namelist ----------- ccsm=>cesm, remove -ndepsrc, - add rcp to some settings, ccsm_seq=>clm_stndln, set start_ymd from - runstart_date, add settings of ndepmapalgo, remove fndepdat/dyn/faerdep - M models/lnd/clm/bld/clm.cpl7.template -------- Remove -spmd, mode now ext_cesm, - ccsm=>cesm - M models/lnd/clm/bld/README ------------------- CCSM=>CESM - M models/lnd/clm/bld/config_files/Makefile.in - SPMD=>NOUSE_MPISERIAL, ccsm=>cesm - M models/lnd/clm/bld/config_files/config_definition.xsl --- Titles to caption, - put valid_values under description - M models/lnd/clm/bld/config_files/config_sys_defaults.xml - spmd=>nouse_mpiserial - M models/lnd/clm/bld/config_files/config_definition.xml --- +sitespf_pt, - comp_interface=>comp_intf, ccsm=>cesm, spmd=>nouse_mpiserial, mode - valid values are: ext_cesm, clm_stndln - ->>>>>>>>>> Remove ndepsrc/usr_ndepstream/fndepdat/fndepdyn/faerdep add mksrf_navyoor ->>>>>>>>>> Change comments from ccsm to cesm, exchange run_startdate for start_ymd, add ->>>>>>>>>> ndepmapalo, add stop_option/stop_n settings for spinup modes - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --------- Remove - ndepsrc/use_ndepstream/fndepdat/dyn/faerdep, ccsm=>cesm, add mksrf_navyoro, - run_startdate, faerdep and fndepdat for aerdepregrid/ndepregrid tools, - add 0.33x0.33 resolution for navyoro file - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml --- Remove - ndepsrc add defaults when sitespf_pt is set - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ------ rcp6 datm_presaero - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl ----------- Add sitespf_pt - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl --------- Headers to captions - M models/lnd/clm/bld/namelist_files/datm-build-namelist ------------- ccsm=>cesm - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ------- ccsm=>cesm, - remove use_ndepstream, faerdep, fndepdat, fndepdyn - add ndepmapalgo - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - Add navy oro - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ------- Add - stop_option/stop_n for spinup modes, change start_ymd for run_startdate - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Add ndepmapalgo - ->>>>>>>>>> Change config mode names (from ccsm_seq to clm_stndln), remove ndepsrc, ->>>>>>>>>> remove start_ymd, clm_demand just sets fpftdyn (fndepdat/dyn removed) - M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml ---- mode - changes to clm_stndln - M models/lnd/clm/bld/namelist_files/use_cases/glacier_mec.xml ----- mode - changes to clm_stndln - M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml ---- mode - changes to clm_stndln - M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml - mode - changes to clm_stndln, remove start_ymd, clm_demand just sets fpftdyn - remove ndepsrc - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - mode - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - mode - changes to clm_stndln, remove start_ymd, clm_demand just sets fpftdyn - remove ndepsrc - M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - mode - changes to clm_stndln, clm_demand just sets fpftdyn remove ndepsrc - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml --- mode - changes to clm_stndln, remove start_ymd, clm_demand just sets fpftdyn - remove ndepsrc - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - mode - changes to clm_stndln, remove start_ymd, clm_demand just sets fpftdyn - remove ndepsrc - M models/lnd/clm/bld/namelist_files/use_cases/pergro.xml -- Also output TSA - M models/lnd/clm/bld/namelist_files/use_cases/pergro0.xml - Also output TSA - ->>>>>>>>>> Change so any scripts calls start with "./", ccsm=>cesm, remove ndepsrc ->>>>>>>>>> Use macro for PTS_MODE, use .submit rather than .run scripts. ->>>>>>>>>> Add bit about managing your data with link_dirtree, add more notes and ->>>>>>>>>> examples for PERGRO testing, add more notes about using batch for single-pt ->>>>>>>>>> mode - M models/lnd/clm/doc/UsersGuide/trouble_shooting.xml -- Add more about ccsm log file - M models/lnd/clm/doc/UsersGuide/config_cache.xml ------ Update from configure - M models/lnd/clm/doc/UsersGuide/single_point.xml ------ Add section on which mode - Add warning about single-point on batch machines, remove warning about - error that was fixed, remove notes about setting ndepsrc - M models/lnd/clm/doc/UsersGuide/special_cases.xml ----- Use .submit, add notes - about using provided history files from bluefire for PERGRO testing, and - add bit about TSA as well as TSOI, add more machines and examples of - bad pergro for PERGRO examples. - M models/lnd/clm/doc/UsersGuide/tools.xml ------------- Remove ndepsrc stuff - M models/lnd/clm/doc/UsersGuide/preface.xml ----------- Talk about very latest updates. - remove bit about PERGRO not validated - M models/lnd/clm/doc/UsersGuide/clm_ug.xml ------------ Update version, remove bug fix - M models/lnd/clm/doc/UsersGuide/appendix.xml ---------- - M models/lnd/clm/doc/UsersGuide/adding_files.xml ------ Add bit about managing your - data when you use link_dirtree, update table, remove ndepsrc - M models/lnd/clm/doc/UsersGuide/custom.xml ------------ Remove bit about rcp experimental - comment out tables that cause docbook to fail with a seg fault. - M models/lnd/clm/doc/UsersGuide/pergro.jpg ------------ New data - M models/lnd/clm/doc/UsersGuide/Makefile -------------- Remove vandif bug fix - M models/lnd/clm/doc/Quickstart.userdatasets ---------- Shorten lines remove faerdep - correct procedure - M models/lnd/clm/doc/Quickstart.GUIDE ----------------- Use .submit script - M models/lnd/clm/doc/UsersGuide/stylesheethtml2docbook.xsl - Change tables from - informal to formal, using captions for titles, add template for bold. - ->>>>>>>>>> Changes comments for CCSM to CESM, remove misc.h and preproc.h #includes ->>>>>>>>>> Remove use_ndepstream/fndepdat/fndepdyn/faerdep/set_*dep_from_file ->>>>>>>>>> Add u10_clm and va, add ability to perturb IC from startup finidat file - M models/lnd/clm/src/biogeochem/DUSTMod.F90 ----- CCSM=>CESM, remove misc/preproc.h - M models/lnd/clm/src/main/clm_comp.F90 ---------- CCSM=>CESM - M models/lnd/clm/src/main/clm_initializeMod.F90 - Remove use_ndepstream logic - hardwire it to on - M models/lnd/clm/src/main/clm_glclnd.F90 -------- CCSM=>CESM - M models/lnd/clm/src/main/clmtypeInitMod.F90 ---- Add u10 and va - M models/lnd/clm/src/main/clm_atmlnd.F90 -------- Rm set_caerdep_from_file/dustdep - M models/lnd/clm/src/main/controlMod.F90 -------- Rm fndepdat, fndepdyn, - use_ndepstream, faerdep, ccsm=>cesm - M models/lnd/clm/src/main/clm_time_manager.F90 -- ccsm=>cesm, remove misc/preproc.h - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 --- lnd_chkAerDep_mct just - aborts if aerosols NOT sent from atm. - M models/lnd/clm/src/main/clm_driver.F90 ------------- Rm aerdep and old ndep interpoaltion - M models/lnd/clm/src/main/clm_varctl.F90 ------------- Rm set_caerdep_from_file/dustdep, - faerdep, fndepdat, fndepdyn, use_ndepstream - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - lnd_chkAerDep_mct just - aborts if aerosols NOT sent from atm. - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_mct.F90 -- ccsm=>cesm - M models/lnd/clm/src/main/surfrdMod.F90 ---------- ccsm=>cesm, remove misc/preproc.h - M models/lnd/clm/src/main/domainMod.F90 ---------- Rm misc/preproc.h, ccsm=>cesm - M models/lnd/clm/src/main/clmtype.F90 ------------ Add u10_clm, and va - M models/lnd/clm/src/main/histFldsMod.F90 -------- Add U10, and VA, and mv old U10 to U10_DUST - M models/lnd/clm/src/main/mkarbinitMod.F90 ------- Make into module, remove - misc/preproc.h, add seperate subroutine to perturb initial conditions - M models/lnd/clm/src/biogeophys/UrbanInitMod.F90 - Remove misc/preproc.h, - remove GRANDVIEW #ifdefs - M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 - Add u10/va, - remove misc/preproc.h and concurrent loops - M models/lnd/clm/src/biogeophys/BiogeophysicsLakeMod.F90 Add some PERGRO #ifdef - remove misc/preproc.h - M models/lnd/clm/src/biogeophys/BiogeophysRestMod.F90 --- Add perturbIC call - remove misc/preproc.h and concurrent loops - M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 ---- Remove misc/preproc.h, - KO comments and concurrent loops - M models/lnd/clm/src/biogeophys/UrbanMod.F90 ------------ Remove misc/preproc.h, - and GRANDVIEW #ifdefs - - M README - Start with ./, and correct .build script name, and use .submit in exp - -Summary of testing: - - bluefire interactive testing: All PASS except... -025 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - jaguar: All PASS except... -007 brB91 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 72+72 arb_ic .............FAIL! rc= 13 - jaguar interactive testing: -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - edinburgh/lf95 interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 - edinburgh/lf95: All PASS except... -005 smD91 TSM.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 10 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 5 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 smG56 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -013 smE91 TSM.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 96 arb_ic ............FAIL! rc= 10 -014 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 10+38 arb_ic .........FAIL! rc= 5 -015 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 arb_ic ......FAIL! rc= 5 -018 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 cold .......FAIL! rc= 13 -019 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@2000 72+72 cold ....FAIL! rc= 11 -025 smL51 TSM.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -026 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -027 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -029 smH41 TSM.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 96 cold FAIL! rc= 10 -030 erH41 TER.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 5 -031 brH41 TBR.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 5 -033 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 10+38 cold ....FAIL! rc= 13 -018 brR53 TBR.sh 17p_cnc13sc_do clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@1850 72+72 cold .FAIL! rc= 11 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -025 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 13 -026 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 11 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_11 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_11 -Originator(s): erik (Erik Kluzek) -Date: Fri Aug 27 14:14:37 MDT 2010 -One-line Summary: New files for rcp6, fix MPI bug, update externals - -Purpose of changes: - -Add in new pftdyn and stream_ndep files for rcp=6.0. Fix MPI bug where send array was the same as receive array. -Fix problem with datm template on gust, and syntax errors for pt1_pt1 mode. Add start_tod to drv/scripts. - -Bugs fixed (include bugzilla ID): - 1197 (MPI problem sending and receiving data in same array) - 1207 (Problem with datm template on gust) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1206 (Problem looping over a single year of CPLHIST forcing) - http://bugs.cgd.ucar.edu/ - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Add ndepmapalgo - Move datasets just for clm tools to clm_tools namelist_defaults XML file - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, -csm_share - scripts to scripts4_100730 - drv to drvseq3_1_33 - datm to datm8_100728 - csm_share to share3_100802 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>> Add configure test file for serial - A models/lnd/clm/test/system/config_files/4p_vodsnrsc_ds - ->>>>>>>>>>>> Add some files to test mksurfdata.pl script - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850 - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850-2000 - ->>>>>>>>>>>> Put all files for clm-tools in seperate file - A models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - ->>>>>>>>>>>> Add new chapter on trouble shooting, add a script to limit ->>>>>>>>>>>> the line lengths, add style sheet to convert HTML XSL table ->>>>>>>>>>>> to docbook. Add file to fix vancouver problem. - A models/lnd/clm/doc/UsersGuide/trouble_shooting.xml - A models/lnd/clm/doc/UsersGuide/limitLineLen.pl - A models/lnd/clm/doc/UsersGuide/addxhtmlhead.pl - A models/lnd/clm/doc/UsersGuide/stylesheethtml2docbook.xsl - A models/lnd/clm/doc/UsersGuide/fixvan_datm.buildnml.diff - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Change some of the tests around - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>>> Work with testing a bit, add mksurfdata.pl and drydep tests - M models/lnd/clm/test/system/README.testnames ---- Add "V" drydep test - M models/lnd/clm/test/system/test_driver.sh ------ Add pftdata, change -multi-processing a bit - M models/lnd/clm/test/system/TSMscript_tools.sh -- Fix some glitches - M models/lnd/clm/test/system/gen_test_table.sh --- Convert to xhtml - M models/lnd/clm/test/system/nl_files/clm_usrdat - Remove non-streams mode for ndep -and aerdep - M models/lnd/clm/test/system/input_tests_master -- Add mksurfdata.pl and drydep tests - make scsnf 4x5 rather than 10x15 - ->>>>>>>>>>>> Add -nomv, usrname, and pftdyn options, add ability to run in ->>>>>>>>>>>> a different directory, check for vegtyp files before running. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - ->>>>>>>>>>>> Handle rcp's correctly, and handle datm streams for presaero files ->>>>>>>>>>>> and ndep streams files - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -- default rcp=hist, set - RCP to ncl script - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - add ability to handle - usrname files, and handle ndep and aerdep streams files correctly - ->>>>>>>>>>>> Move tools files into clm_tools default file, add ndepmapalgo ->>>>>>>>>>>> Work on the formatting of the files, do better with clm_usrdat_name - M models/lnd/clm/bld/queryDefaultNamelist.pl - Add clm_tools default file. - Don't limit list to -var, as now done in .pm file below. - M models/lnd/clm/bld/queryDefaultXML.pm ------ If -var set, don't process variables - that don't match - M models/lnd/clm/bld/config_files/config_definition.xsl - Change to lowercase - for xhtml standard, remove glacier list - M models/lnd/clm/bld/config_files/config_definition.xml - Put glc_nec in physics list - M models/lnd/clm/bld/build-namelist --------------------- Fix minor doc issues - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Add ndepmapalgo, - change formatting for GPTL options - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl ----- Improve formatting, - put note in table if All: res, masks, yrs, or sim_yr_rng - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl --- Improve formatting - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Remove mksrf_fvegtyp - files and fndepdat files for single-years only used for processing -tools - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Add in handling - of rcp's, and stream_fldfilename_ndep, remove fndepdat/dyn - ->>>>>>>>>>>> Update to documentation from update to cesm1_0_rel_05 - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/get_Icaselist.pl - M models/lnd/clm/doc/UsersGuide/special_cases.xml - M models/lnd/clm/doc/UsersGuide/co2_streams.txt - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/Quickstart.userdatasets - M models/lnd/clm/doc/KnownBugs - M models/lnd/clm/doc/README - M models/lnd/clm/src/main/ndepStreamMod.F90 - M models/lnd/clm/src/main/surfrdMod.F90 - ->>>>>>>>>>>> Update to documentation from update to cesm1_0_rel_05 - M Copyright - M README - -Summary of testing: - - bluefire: All PASS except... -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -038 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 10 -039 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -3+-7 arb_ic .......FAIL! rc= 5 -040 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -5+-5 arb_ic .......FAIL! rc= 5 -041 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 4 - bluefire interactive testing: All PASS except... -006 smHS3 TSM.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .FAIL! rc= 8 -007 erHS3 TER.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -3+-3 arb_ic FAIL! rc= 5 -008 brHS3 TBR.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -3+-3 arb_ic FAIL! rc= 5 -009 blHS3 TBL.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .FAIL! rc= 4 -025 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -026 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -030 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -065 sm9S4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................FAIL! rc= 6 -066 sm974 TSMscript_tools.sh mksurfdata mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds ....FAIL! rc= 6 - bluefire/CESM testing: -FAIL SMS_RLA.f45_f45.I.bluefire -BFAIL SMS_RLA.f45_f45.I.bluefire.generate.clm4_0_11 -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_10 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_10 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_10 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_10 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_10 -FAIL ERI.f19_g16.IG.bluefire.compare.clm4_0_10 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_10 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_11 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_10 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm4_0_10 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_10 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_10 -Originator(s): erik (Erik Kluzek) -Date: Wed Aug 4 14:37:59 MDT 2010 -One-line Summary: Update doc to cesm_rel05, bug-fixes, fix issues for single-point, mksurfdata/getregional scripts - -Purpose of changes: - -Use nn instead of copy for CO2 patch file. Update documentation to latest cesm version -05. Update externals. Some changes to build-namelist for generic single-point -simulations. Move tools XML files to clm_tools namelist_default file. Add 4x5 drydep -test, work with testing a bit. Add tests for getregional.pl and mksurfdata.pl scripts. -Add: usrname, nomv and pftdata options to mksurfdata.pl. Get RCP's working in getregional -script. Update getregional to handle ndep and aerdep streams, also get it to run in a -different directory. XML query wont test variables that don't match when -var option is -specified. Convert test table to xhtml. Move glc_nec to physics. Add option for -ndepmapalgo. Get faerdep and fndep streams files working right in -namelist_defaults_usrdat.xml file. - -Bugs fixed (include bugzilla ID): - 1166 (get_regional script needs to be updated) - 1190 (add ndepmapalgo to ndep streams) - 1192 (Y1K problem for mksurfdata.pl) - 1193 (bug in reading GLCMASK) - 1207 (Problem with datm template on gust) - -Update of datm also fixes several issues with datm for single pt simulations: 1173, 1175, 1176, 1181 - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1197 (MPI problem sending and receiving data in same array) - 1206 (Problem looping over a single year of forcing) - http://bugs.cgd.ucar.edu/ - -Type of tag: standard - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Add ndepmapalgo - Move datasets just for clm tools to clm_tools namelist_defaults XML file - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, csm_share - scripts to scripts4_100730 - drv to drvseq3_1_33 - datm to datm8_100728 - csm_share to share3_100802 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>> Add configure test file for serial - A models/lnd/clm/test/system/config_files/4p_vodsnrsc_ds - ->>>>>>>>>>>> Add some files to test mksurfdata.pl script - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850 - A models/lnd/clm/test/system/nl_files/mksrfdt_1x1_brazil_1850-2000 - ->>>>>>>>>>>> Put all files for clm-tools in seperate file - A models/lnd/clm/bld/namelist_files/namelist_defaults_clm_tools.xml - ->>>>>>>>>>>> Add new chapter on trouble shooting, add a script to limit ->>>>>>>>>>>> the line lengths, add style sheet to convert HTML XSL table ->>>>>>>>>>>> to docbook. Add file to fix vancouver problem. - A models/lnd/clm/doc/UsersGuide/trouble_shooting.xml - A models/lnd/clm/doc/UsersGuide/limitLineLen.pl - A models/lnd/clm/doc/UsersGuide/addxhtmlhead.pl - A models/lnd/clm/doc/UsersGuide/stylesheethtml2docbook.xsl - A models/lnd/clm/doc/UsersGuide/fixvan_datm.buildnml.diff - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Change some of the tests around - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>>> Work with testing a bit, add mksurfdata.pl and drydep tests - M models/lnd/clm/test/system/README.testnames ---- Add "V" drydep test - M models/lnd/clm/test/system/test_driver.sh ------ Add pftdata, change multi-processing a bit - M models/lnd/clm/test/system/TSMscript_tools.sh -- Fix some glitches - M models/lnd/clm/test/system/gen_test_table.sh --- Convert to xhtml - M models/lnd/clm/test/system/nl_files/clm_usrdat - Remove non-streams mode for ndep and aerdep - M models/lnd/clm/test/system/input_tests_master -- Add mksurfdata.pl and drydep tests - make scsnf 4x5 rather than 10x15 - ->>>>>>>>>>>> Add -nomv, usrname, and pftdyn options, add ability to run in ->>>>>>>>>>>> a different directory, check for vegtyp files before running. - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl - ->>>>>>>>>>>> Handle rcp's correctly, and handle datm streams for presaero files ->>>>>>>>>>>> and ndep streams files - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -- default rcp=hist, set - RCP to ncl script - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - add ability to handle - usrname files, and handle ndep and aerdep streams files correctly - ->>>>>>>>>>>> Move tools files into clm_tools default file, add ndepmapalgo ->>>>>>>>>>>> Work on the formatting of the files, do better with clm_usrdat_name - M models/lnd/clm/bld/queryDefaultNamelist.pl - Add clm_tools default file. - Don't limit list to -var, as now done in .pm file below. - M models/lnd/clm/bld/queryDefaultXML.pm ------ If -var set, don't process variables - that don't match - M models/lnd/clm/bld/config_files/config_definition.xsl - Change to lowercase - for xhtml standard, remove glacier list - M models/lnd/clm/bld/config_files/config_definition.xml - Put glc_nec in physics list - M models/lnd/clm/bld/build-namelist --------------------- Fix minor doc issues - M models/lnd/clm/bld/namelist_files/namelist_definition.xml --- Add ndepmapalgo, - change formatting for GPTL options - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl ----- Improve formatting, - put note in table if All: res, masks, yrs, or sim_yr_rng - M models/lnd/clm/bld/namelist_files/namelist_definition.xsl --- Improve formatting - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Remove mksrf_fvegtyp - files and fndepdat files for single-years only used for processing tools - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Add in handling - of rcp's, and stream_fldfilename_ndep, remove fndepdat/dyn - ->>>>>>>>>>>> Update to documentation from update to cesm1_0_rel_05 - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/get_Icaselist.pl - M models/lnd/clm/doc/UsersGuide/special_cases.xml - M models/lnd/clm/doc/UsersGuide/co2_streams.txt - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/Quickstart.userdatasets - M models/lnd/clm/doc/KnownBugs - M models/lnd/clm/doc/README - M models/lnd/clm/src/main/ndepStreamMod.F90 - M models/lnd/clm/src/main/surfrdMod.F90 - ->>>>>>>>>>>> Update to documentation from update to cesm1_0_rel_05 - M Copyright - M README - -Summary of testing: - - bluefire: All PASS except... -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -055 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -056 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -057 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -058 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -009 blHS3 TBL.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .FAIL! rc= 4 -025 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -026 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -030 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CESM testing: All PASS except... -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_10 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_09 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -012 blG43 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - edinburgh/lf95 interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 - edinburgh/lf95: All PASS except... -005 smD91 TSM.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 10 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 5 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 4 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG56 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -013 smE91 TSM.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 96 arb_ic ............FAIL! rc= 10 -014 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 10+38 arb_ic .........FAIL! rc= 5 -015 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 arb_ic ......FAIL! rc= 5 -016 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 arb_ic ............FAIL! rc= 4 -018 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 cold .......FAIL! rc= 13 -019 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@2000 72+72 cold ....FAIL! rc= 11 -025 smL51 TSM.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -026 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -027 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -028 blL51 TBL.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 4 -029 smH41 TSM.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 96 cold FAIL! rc= 10 -030 erH41 TER.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 5 -031 brH41 TBR.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 5 -032 blH41 TBL.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 48 cold FAIL! rc= 4 -033 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_09 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_09 -Originator(s): erik (erik) -Date: Mon Jun 14 00:02:12 MDT 2010 -One-line Summary: Fix some small issues, update documentation, and externals - -Purpose of changes: - -Work on documentation for CESM1.0 release, with glcec changes, and namelist changes. Run -testing and fix bugs. Move documentation changes from release branch to trunk. Fix -getregional script for transient. Remove "At point 2" from lnd log files. Update -csm_share, and scripts version so can now run testing with lahey compiler. Get CO2 patch -file working. - -Bugs fixed (include bugzilla ID): - 1092 (Problems running on dublin with datm8 with debug) - 1159 (date in fco2 file is not used) - 1160 (Fix mksurfdata.pl script to work with 1000-1004) - 1167 (doc. about running single point reduce pes) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1166 (get_regional script needs to be updated) - 1192 (Y1K problem for mksurfdata.pl) - 1193 (bug in reading GLCMASK) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: std-test - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, -cism, csm_share - scripts to scripts4_100612 - drv to drvseq3_1_31 - datm to datm8_100612 - cism to cism1_100608 - csm_share to share3_100607 - -List all files eliminated: None - -List all files added and what they do: None - ->>>>>>>>>>>> Add testing configure file - A models/lnd/clm/test/system/config_files/_nrcnsc_do - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Add CLM_USRDAT_NAME and getregional.pl tests - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/tests_pretag_edinburgh_nompi - M models/lnd/clm/test/system/tests_posttag_nompi_regression - M models/lnd/clm/test/system/README.testnames - M models/lnd/clm/test/system/TSMscript_tools.sh - M models/lnd/clm/test/system/nl_files/clm_usrdat - M models/lnd/clm/test/system/nl_files/getregional - M models/lnd/clm/test/system/input_tests_master - M models/lnd/clm/test/system/README - ->>>>>>>>>>>> - M models/lnd/clm/tools/ncl_scripts/getco2_historical.ncl ---- Add comment that - date variable is NOT used - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.pl -- Add path to scripts - so can run from a different directory - M models/lnd/clm/tools/ncl_scripts/getregional_datasets.ncl - Fix warnings and - allow some files to not be converted if not needed - M models/lnd/clm/tools/ncl_scripts/pftdyntest2raw.ncl ------- Re-order longitudes - so from -180-180 rather than 0-360 - ->>>>>>>>>>>> - M models/lnd/clm/bld/queryDefaultXML.pm ----- Get working for usrdat better - M models/lnd/clm/bld/listDefaultNamelist.pl - Get working for usrdat files - M models/lnd/clm/bld/build-namelist --------- Allow lnd_res to be usrdat name - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - Set year first/last - for datm_presaero for clim_2000 - M models/lnd/clm/bld/namelist_files/datm-build-namelist -------- Don't allow - prognostic for datm_presaero - ->>>>>>>>>>>> Update documentation, add cprnc README to document - M models/lnd/clm/doc/UsersGuide/tools.xml - M models/lnd/clm/doc/UsersGuide/preface.xml - M models/lnd/clm/doc/UsersGuide/clm_ug.xml - M models/lnd/clm/doc/UsersGuide/adding_files.xml - M models/lnd/clm/doc/UsersGuide/appendix.xml - M models/lnd/clm/doc/UsersGuide/custom.xml - M models/lnd/clm/doc/UsersGuide/single_point.xml - M models/lnd/clm/doc/UsersGuide/Makefile - M models/lnd/clm/doc/UsersGuide/special_cases.xml - M models/lnd/clm/doc/UsersGuide/addco2_datm.buildnml.diff - Update patch to - work with the latest datm with DATM_PRESAERO - ->>>>>>>>>>>> Remove "at point 2" and fix esmf duplication from fix by Mariana - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - ->>>>>>>>>>>> Update README files and use CESM in place of CCSM - M models/lnd/clm/doc/Quickstart.userdatasets - M models/lnd/clm/doc/IMPORTANT_NOTES - M models/lnd/clm/doc/KnownBugs - M models/lnd/clm/doc/README - M models/lnd/clm/doc/index.shtml - M Copyright - M README - -Summary of testing: - - bluefire: All PASS except... -016 blF92 TBL.sh 17p_vodsrsc_dm clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 cold .............FAIL! rc= 5 -017 smEH1 TSM.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 10 -018 erEH1 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 10+38 arb_icFAIL! rc= 5 -019 brEH1 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 24+24 arbFAIL! rc= 5 -020 blEH1 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 4 -021 smHN1 TSM.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 8 -022 erHN1 TER.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -3+-7 cFAIL! rc= 3 -023 brHN1 TBR.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -5+-5 cFAIL! rc= 3 -024 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 3 -025 smHO2 TSM.sh 17p_cnsc_dm clm_drydep 20000704:NONE:1800 10x15 USGS@2000 -90 cold .............FAIL! rc= 3 -026 erHO2 TER.sh 17p_cnsc_dm clm_drydep 20000704:NONE:1800 10x15 USGS@2000 -3+-7 cold ...........FAIL! rc= 3 -027 brHO2 TBR.sh 17p_cnsc_dm clm_drydep 20000704:NONE:1800 10x15 USGS@2000 -5+-5 cold ...........FAIL! rc= 3 -028 blHO2 TBL.sh 17p_cnsc_dm clm_drydep 20000704:NONE:1800 10x15 USGS@2000 -90 cold .............FAIL! rc= 3 -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 3 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 3 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 3 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 3 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 3 -034 smH41 TSM.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 96 cold FAIL! rc= 3 -035 erH41 TER.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 3 -036 brH41 TBR.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 3 -037 blH41 TBL.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 48 cold FAIL! rc= 3 -038 smC45 TSM.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 3 -039 erC45 TER.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -3+-7 arb_ic .......FAIL! rc= 3 -040 brC45 TBR.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -5+-5 arb_ic .......FAIL! rc= 3 -041 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........FAIL! rc= 3 -042 smC61 TSM.sh _scnv_dh clm_std^nl_urb 20020101:NONE:1800 1.9x2.5 gx1v6 -6 startup ............FAIL! rc= 3 -043 erC61 TER.sh _scnv_dh clm_std^nl_urb 20020101:NONE:1800 1.9x2.5 gx1v6 10+38 startup .........FAIL! rc= 3 -044 brC61 TBR.sh _scnv_dh clm_std^nl_urb_br 20020101:NONE:1800 1.9x2.5 gx1v6 -3+-3 startup ......FAIL! rc= 3 -045 blC61 TBL.sh _scnv_dh clm_std^nl_urb 20020101:NONE:1800 1.9x2.5 gx1v6 48 startup ............FAIL! rc= 3 -046 smH52 TSM.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 96 cold ..........FAIL! rc= 3 -047 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 cold .......FAIL! rc= 3 -048 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@2000 72+72 cold ....FAIL! rc= 3 -049 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold ..........FAIL! rc= 3 -050 smV61 TSM.sh _mec10sc_dh clm_glcmec 19980115:NONE:1800 1.9x2.5 gx1v6 96 arb_ic ..............FAIL! rc= 3 -051 erV61 TER.sh _mec10sc_dh clm_glcmec 19980115:NONE:1800 1.9x2.5 gx1v6 10+38 arb_ic ...........FAIL! rc= 3 -052 brV61 TBR.sh _mec10sc_dh clm_std 19980115:NONE:1800 1.9x2.5 gx1v6 72+72 arb_ic ..............FAIL! rc= 3 -053 blV61 TBL.sh _mec10sc_dh clm_glcmec 19980115:NONE:1800 1.9x2.5 gx1v6 48 arb_ic ..............FAIL! rc= 3 -054 smI59 TSMcnspinup.sh 17p_cnadspinupsc_dm 17p_cnexitspinupsc_dm 17p_cnsc_dm clm_std 20020115:NONEFAIL! rc= 3 -055 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 3 -056 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 3 -057 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 3 -058 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 3 -059 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 3 -060 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 3 -061 brL58 TBR.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 3 -062 blL58 TBL.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 48 arb_ic ...............FAIL! rc= 3 -063 smJ61 TSM.sh 4p_casasc_dh clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 96 cold ...........FAIL! rc= 3 -064 erJ61 TER.sh 4p_casasc_dh clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 10+38 cold ........FAIL! rc= 3 -065 brJ61 TBR.sh 4p_casasc_dh clm_std^nl_urb_br 20021230:NONE:1800 1.9x2.5 gx1v6 72+72 cold .....FAIL! rc= 3 -066 blJ61 TBL.sh 4p_casasc_dh clm_std^nl_urb 20021230:NONE:1800 1.9x2.5 gx1v6 48 cold ...........FAIL! rc= 3 -067 smJ05 TSM.sh 4p_casasc_h clm_std^nl_lfiles 19800101:NONE:1800 0.47x0.63 gx1v6 48 arb_ic .....FAIL! rc= 3 - bluefire interactive testing: All PASS except... -009 blHS3 TBL.sh _nrcnsc_do clm_usrdat 20030101:NONE:1800 13x12pt_f19_alaskaUSA gx1v6 -6 arb_ic .FAIL! rc= 5 -021 blJ74 TBL.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test -100 arb_ic FAIL! rc= 5 -025 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -026 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -030 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -062 sm854 TSMtools.sh interpinic tools__ds runoptions ...........................................FAIL! rc= 3 -063 sm853 TSMtools.sh interpinic tools__o runoptions ............................................FAIL! rc= 3 -064 smZ94 TSMtools.sh mkdatadomain tools__ds namelist ...........................................FAIL! rc= 3 -065 sm9S4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional ....................FAIL! rc= 3 - bluefire/CESM testing: All PASS except... -BFAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_08 -BFAIL ERI.f19_g16.IG.bluefire.compare.clm4_0_08 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_09 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_08 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -025 smV23 TSM.sh _mec10sc_do clm_glcmec 19980115:NONE:1800 48x96 gx3v7 96 arb_ic ................FAIL! rc= 8 -026 erV23 TER.sh _mec10sc_do clm_glcmec 19980115:NONE:1800 48x96 gx3v7 10+38 arb_ic .............FAIL! rc= 5 -027 brV23 TBR.sh _mec10sc_do clm_std 19980115:NONE:1800 48x96 gx3v7 72+72 arb_ic ................FAIL! rc= 5 - jaguar/CESM testing: All PASS - edinburgh/lf95 interactive testing: All PASS except... -004 blA74 TBL.sh _nrsc_ds clm_std^nl_urb 20030101:NONE:1800 1x1_brazil navy -10 arb_ic ..........FAIL! rc= 5 -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -008 blAL4 TBL.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -10 cold ...............FAIL! rc= 5 -012 blCA4 TBL.sh _nrsc_ds clm_std^nl_urb 20021001:NONE:3600 1x1_camdenNJ navy -90 arb_ic ........FAIL! rc= 5 - edinburgh/lf95: All PASS except... -005 smD91 TSM.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 10 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 5 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 4 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -012 smG56 TSM.sh 17p_sc_m clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -013 smE91 TSM.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 96 arb_ic ............FAIL! rc= 10 -014 erE91 TER.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 10+38 arb_ic .........FAIL! rc= 5 -015 brE91 TBR.sh 4p_vodsrsc_dh clm_std^nl_urb_br 20021230:NONE:1800 4x5 gx3v7 72+72 arb_ic ......FAIL! rc= 5 -016 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 arb_ic ............FAIL! rc= 4 -018 erH52 TER.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 10+38 cold .......FAIL! rc= 13 -019 brH52 TBR.sh 17p_cnsc_dm clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@2000 72+72 cold ....FAIL! rc= 11 -025 smL51 TSM.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 96 arb_ic ..................FAIL! rc= 10 -026 erL51 TER.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 10+38 arb_ic ...............FAIL! rc= 5 -027 brL51 TBR.sh _sc_dh clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -028 blL51 TBL.sh _sc_dh clm_std^nl_urb 20020115:NONE:1800 10x15 USGS 48 arb_ic ..................FAIL! rc= 4 -029 smH41 TSM.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 96 cold FAIL! rc= 10 -030 erH41 TER.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 5 -031 brH41 TBR.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 5 -032 blH41 TBL.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 48 cold FAIL! rc= 4 -033 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_08 - -Changes answers relative to baseline: bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_08 -Originator(s): erik (erik) -Date: Fri Jun 4 01:25:39 MDT 2010 -One-line Summary: Snow hydrology bug fix from Keith and Dave - -Purpose of changes: - -SnowHydrology bug fix from Keith Oleson. For test-suite, make default to send aerosol -data through datm. Update version of cism, scripts and datm. Remove some of the old aerdep -stuff from the XML database as we now are using presaero from datm (leave 1-deg and -2-deg). - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1166 (get_regional script needs to be updated) - 1192 (Y1K problem for mksurfdata.pl) - 1193 (bug in reading GLCMASK) - 1197 (MPI problem sending and receiving data in same array) - 1206 (Problem looping over a single year of forcing) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: none - -Describe any changes made to the namelist: Move datm_presaero to overall defaults - -List any changes to the defaults for the boundary datasets: - Remove all faerdep files except f09 and f19 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - code changes come from Keith Oleson and Dave Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): scripts, cism and drv - scripts to scripts4_100603a - drv to drvseq3_1_29 - cism to cism1_100603 - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/test/system/config_files/17p_cnsc_m - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/system/nl_files/clm_ndepdyn - Switch demand for ndepdyn for - ndepsrc stream - - M models/lnd/clm/bld/build-namelist ----- Get datm_presaero if not null - do NOT set faerdep - M models/lnd/clm/bld/clm.cpl7.template -- Set datm_presaero by DATM_PRESAERO - if datm or to prognostic if not (so aerosol dep require from atm) - - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Set - datm_presaero by resolution, sim_year, sim_year_range and rcp - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ---- Remove datm_presaero - M models/lnd/clm/bld/namelist_files/datm-build-namelist ----------- Set - datm_presaero by resolution, sim_year, sim_year_range and rcp - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- Remove - all faerdep files except for f09 and 19 - - M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 - Snow hydrology fix - -Summary of testing: - - bluefire interactive testing: All PASS up to... -014 smJ74 TSM.sh 4p_nrcasasc_ds clm_std^nl_urb 10001230:NONE:3600 1x1_tropicAtl test --1100 arb_ic FAIL! rc= 10 - bluefire/CCSM testing: All PASS except.. -FAIL SMS_RLB.f45_f45.I.bluefire -BFAIL SMS_RLB.f45_f45.I.bluefire.generate.clm4_0_08 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_06 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_06 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_06 -FAIL PST.f45_g37.I1850.bluefire.compare.clm4_0_06 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_06 -FAIL ERS_E.f19_g16.I1850.bluefire.compare_hist.clm4_0_06 -FAIL ERS_E.f19_g16.I1850.bluefire.compare.clm4_0_06 -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_06 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_08 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_06 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_06 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm4_0_06 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_06 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_06 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_06 - Extra testing: -PASS ERI.f19_g16.IG.bluefire -Make sure answers agree with /OLESON/csm/ccsm4_0_beta52_ndepaer other than VOC fields -Test that F case will configure.. -create_newcase -compset F -case testF -res f19_g16 -mach bluefire -skip_rundb - -CLM tag used for the baseline comparison tests if applicable: clm4_0_07 - -Changes answers relative to baseline: YES - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change: larger than roundoff/same climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - - - platform/compilers: IBM - - compset (and additional configure options): I1850CN - - build-namelist options (or complete namelist): -ndepsrc stream - - MSS location of control simulations used to validate new climate: - - /OLESON/csm/ccsm4_0_beta52_ndepaer - /OLESON/csm/ccsm4_0_beta52_ndepaertrans - - The above is identical to this tag (other than the two VOC fields that changed) - -=============================================================== -=============================================================== -Tag name: clm4_0_07 -Originator(s): erik (erik) -Date: Thu Jun 3 21:22:46 MDT 2010 -One-line Summary: Some cleanup/fix bugs, add RTM var, add albice to namelist, allow last-millenium in mksurfdata, allow setting of datm_presaero in clm test-suite - -Purpose of changes: - -Fix mksurfdata.pl, to correctly create 1000-1004 test datasets. Fix drydep for OpenMP. -Update 1x1_tropicAtl_1000-1004 test fsurdat file. Move glc_grid from configure to -build-namelist. Add in alb_ice to namelist. Start adding in the capability to handle -mksurfdata from 0850-1850AD, put all mksrf_fvegtyp files in XML database (remove some of -the sample pftdyn text files). New RTM field on history output from Sean (VOLR and -VOLR_ICE, only VOLR output by default). Allow use of aerosol data from datm for I cases -in the clm test suite. Split out datm-build-namelist from clm build-namelist (put in -bld/namelist_files). - -Bugs fixed (include bugzilla ID): - 1162 (OpenMP bug with dry-deposition code in clm) - 883 (aerosol deposition not from atm) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1163 (finidat file has a bunch of NaN's in it) - 1164 (Restart trouble for CN13 on gust...) - 1165 (Restart trouble for scaled harvest test on gust) - 1166 (get_regional script needs to be updated) - 1192 (Y1K problem for mksurfdata.pl) - 1193 (bug in reading GLCMASK) - 1197 (MPI problem sending and receiving data in same array) - 1206 (Problem looping over a single year of forcing) - http://bugs.cgd.ucar.edu/ - -Type of tag: standard - -Describe any changes made to build system: Move glc_grid to build-namelist - remove esmf_libdir, fix ccsm_bld so will build threaded properly - -Describe any changes made to the namelist: Add albice to namelist - Add new history fields VOLR and VOLR_ICE - - VOLR RTM storage: LIQ (m3) - VOLR_ICE RTM storage: ICE (m3) - -List any changes to the defaults for the boundary datasets: - New datasets for 1x1_tropicAtl 1000 tests - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, VOLR changes come from Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, pio - scripts to scripts4_100601 - drv to drvseq3_1_28 - pio to pio1_1_1 - -List all files eliminated: - ->>>>>>>>>>>>>>> Remove mksurdata pftdyn text files, let XML database create them - D models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr2000.txt - D models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850.txt - D models/lnd/clm/tools/mksurfdata/pftdyn_rcp6.0_simyr1850-2100.txt - D models/lnd/clm/tools/mksurfdata/pftdyn_rcp2.6_simyr1850-2100.txt - D models/lnd/clm/tools/mksurfdata/pftdyn_rcp4.5_simyr1850-2100.txt - D models/lnd/clm/tools/mksurfdata/pftdyn_rcp8.5_simyr1850-2100.txt - -List all files added and what they do: - ->>>>>>>>>>>>>>> Split out datm part of build-namelist into it's own script - A models/lnd/clm/bld/namelist_files/datm-build-namelist - - A models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr2000-2000.txt -- Same as - old file with 2000.txt name rather than 2000-2000.txt name. - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>>> Move glc_grid to build-namelist, remove kraken - M models/lnd/clm/test/system/config_files/_mec10sc_dh - M models/lnd/clm/test/system/config_files/_mec10sc_dm - M models/lnd/clm/test/system/config_files/_mec10sc_do - M models/lnd/clm/test/system/config_files/_mec10sc_ds - M models/lnd/clm/test/system/config_files/_mec10sc_h - M models/lnd/clm/test/system/config_files/_mec10sc_m - M models/lnd/clm/test/system/config_files/_mec10sc_o - M models/lnd/clm/test/system/test_driver.sh --------- Remove kraken, update dataroot - for bluefire, and tempworkspacefor intrepid - M models/lnd/clm/test/system/CLM_runcmnd.sh --------- Remove kraken - M models/lnd/clm/test/system/nl_files/clm_drydep ---- Change drydep to drv_drydep - ->>>>>>>>>>>>>>> Use XML database for pftdyn files, have mksrfdata.pl write out pftdyn files - M models/lnd/clm/tools/mksurfdata/mksurfdata.globalirrig - change pftdyn file name - M models/lnd/clm/tools/mksurfdata/mksurfdata.regional ---- change pftdyn file name - M models/lnd/clm/tools/mksurfdata/mksurfdata.pftdyn ------ start at 1850 - M models/lnd/clm/tools/mksurfdata/mksurfdata.singlept ---- change pftdyn file name - M models/lnd/clm/tools/mksurfdata/mksurfdata.namelist ---- change pftdyn file name - M models/lnd/clm/tools/mksurfdata/mksurfdata.pl ---------- Get mksrf_vegtyp filenames - from XML database for all files, and write out pftdyn files with them - also get working for 1000-1004 test cases (specifically for 1x12_tropicAtl - test case) - M models/lnd/clm/tools/mksurfdata/pftdyn_hist_simyr1850-2005.txt - Use CSMDATA versions - of 1850 and 2000 files - ->>>>>>>>>>>>>>> Move glc_grid to namelist, fix ccsm_bld=on, add datm_presaero ->>>>>>>>>>>>>>> Only do COLD start for startup type - M models/lnd/clm/bld/configure --------------- Remove glc_grid and esmf_libdir - add in control of CCSM_VOC, set compile_threaded for ccsm_bld on, - M models/lnd/clm/bld/queryDefaultNamelist.pl - Remove double reading of namelist_defaults_overall.xml - M models/lnd/clm/bld/queryDefaultXML.pm ------ Add csmdata to beginning of file, only - if it's a relative pathname (to handle instances of /cgd/tss for mksrf_vegtyp files) - M models/lnd/clm/bld/config_files/config_definition.xml - Remove glc_grid/esmf_libdir - M models/lnd/clm/bld/listDefaultNamelist.pl --- Move glc_grid to namelist vars - M models/lnd/clm/bld/build-namelist ----------- Add in glc_grid, and datm_presaero - change -drydep to -drv_drydep option, set glc_nthreads, outnc_large_files - and albice if glc_nec>0, move datm settings to own datm-build-namelist. - M models/lnd/clm/bld/clm.cpl7.template -------- Move glc_grid to build-namelist, - remove outnc_large_files setting (now in build-namelist), only do - COLD start for startup type (NOT for hybrid or branch). - ->>>>>>>>>>>>>>> Add albice/glc_grid/datm_presaero/outnc_large_files ->>>>>>>>>>>>>>> New datasets for 1x1_tropicAtl 1000 tests ->>>>>>>>>>>>>>> Add in all mksrf_fvegtyp files and include last-millenium - M models/lnd/clm/bld/namelist_files/namelist_definition.xml ------ Add in albice, - and glc_* settings for drv (glc_nthreads, glc_ntasks etc.), add presaero - datam_presaero, datm_file_aero, datm_year_first_aero, datm_year_last_aero, - datm_year_align_aero, and glc_grid. Add 0.5x0.5 resolution (for mksurfdata) - and some premillenial years (850,1100,1350,1600) and sim-year ranges - (850-1100,1100-1350,1350-1600,1600-1850) - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Set default - masks here, and add in glc_grid default - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml ---- Add in some - new domain files that are in datm template, and add in datm_presaero - settings needed: datm_file_aero, datm_aero_streams, datm_year_first_aero -  datm_year_last_aero, and datm_year_align_aero - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl --------- Show - datm_presaero setting if set. - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- Add - outnc_large_files, albice, and move mask to overall, update - 1x1_tropicAtl files for 1000, 1000-1004, add in all mksrf_fvegtyp - files for all scenarios and last-millenium. Add in diri and diro. - M models/lnd/clm/bld/namelist_files/namelist_defaults_drv.xml ----- Get URL - svn keyword set properly. - ->>>>>>>>>>>>>>> Put datm/drv settings on bottom (only for mode=ccsm_seq) ->>>>>>>>>>>>>>> set datm_presaero and data_cycle_beg/end years - M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml -- default - datm_presaero is clim_2000 - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - default - datm_presaero is rcp8.5, beg/end year 1972-2004 - M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - default - datm_presaero is rcp8.5, beg/end year 1972-2004 - M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml ------------ default - datm_presaero is trans_1850-2000, beg/end year 1948-1972, co2=386.9 - M models/lnd/clm/bld/namelist_files/use_cases/glacier_mec.xml ---------------- default - datm_presaero is clim_2000 - M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml --------------- default - datm_presaero is clim_1850, beg/end year 1948/1972 - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - default - datm_presaero is rcp2.6, beg/end year 1972-2004 - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml --- default - datm_presaero is rcp6.0, beg/end year 1972-2004 - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - default - datm_presaero is rcp4.5, beg/end year 1972-2004 - ->>>>>>>>>>>>>>> Add in albice to namelist, add VOLR and VOLR_ICE to history files ->>>>>>>>>>>>>>> always call interpMonthlyVeg for drydep - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - Remove interpMonthlyVeg - call as coming from a threaded region - M models/lnd/clm/src/main/clm_comp.F90 ------------- Call interpMonthlyVeg - for drydep even if CN is on - M models/lnd/clm/src/main/controlMod.F90 ----------- Add albice - M models/lnd/clm/src/main/clm_varcon.F90 ----------- Remove albice - M models/lnd/clm/src/main/clm_driver.F90 ----------- Always call interpMonthlyVeg - if drydep is on (even when NOT doalb) - M models/lnd/clm/src/main/histFldsMod.F90 ---------- Add VOLR and VOLR_ICE - (VOLR_ICE is an optional field) - M models/lnd/clm/src/riverroute/RtmMod.F90 --------- Handle volr under runoff - type, rather than as local variable - M models/lnd/clm/src/riverroute/RunoffMod.F90 ------ Add volr, volrlnd, volr_nt1/2 - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 Add albice as public var - that can be set in controlMod on namelist - -Summary of testing: - - bluefire: All PASS except (up to test 061 nl_crcrop) -061 brL58 TBR.sh _sc_dh clm_std^nl_crcrop -004 blA91 TBL.sh _sc_dh clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v7 -6 arb_ic ...................FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 7 -011 blE91 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021230:NONE:1800 4x5 gx3v7 48 arb_ic ............FAIL! rc= 7 -020 blEH1 TBL.sh 4p_vodsrsc_dh clm_std^nl_urb 20021231:NONE:3600 1.9x2.5^0.9x1.25 gx1v6 48 arb_ic FAIL! rc= 7 -024 blHN1 TBL.sh 17p_cnsc_dh clm_transient_rcp8.5 20051220:NONE:1800 1.9x2.5 gx1v6@1850-2100 -10 colFAIL! rc= 7 -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -037 blH41 TBL.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 48 cold FAIL! rc= 7 -045 blC61 TBL.sh _scnv_dh clm_std^nl_urb 20020101:NONE:1800 1.9x2.5 gx1v6 48 startup ............FAIL! rc= 7 - bluefire interactive testing: All PASS up to... -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: All PASS except.. -FAIL ERI.f19_g16.IG.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_06 - - - bluefire/extra CCSM testing: -Make sure answers agree with /OLESON/csm/ccsm4_0_beta52_ndepaer other than VOC fields - (when snowhydrology changes are put in) - - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 10+38 cold ....FAIL! rc= 13 -018 brR53 TBR.sh 17p_cnc13sc_do clm_std^nl_urb_br 20020115:NONE:1800 10x15 USGS@1850 72+72 cold .FAIL! rc= 11 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -025 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coFAIL! rc= 13 -026 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coFAIL! rc= 11 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_06 - -Changes answers relative to baseline: no bit-for-bit (except omp active stand-alone tests) - The standalone tests with OpenMP on are different because the previous tag - wasn't building with OpenMP - -=============================================================== -=============================================================== -Tag name: clm4_0_06 -Originator(s): erik (erik) -Date: Wed May 26 10:35:26 MDT 2010 -One-line Summary: Update gglc to cism - -Purpose of changes: - -Changes from jwolfe to lnd_comp* subroutines to exchange cism fields. Requires an update -to the driver for the index of the fieldnames passed. Change paths of gglc glc_grid files -from gglc to cism. Make stream the default for all resolutions for ndepsrc. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1162 (OpenMP bug with dry-deposition code in clm) - 1163 (finidat file has a bunch of NaN's in it) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: - Change name of ice model from gglc to cism - Change list of fields exchanged with cism - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - Change pathnames for gglc fglcmask datasets to cism - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, jwolfe, lipscomb - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, cism - scripts to scripts4_100525 - drv to drvseq3_1_26 - cism to cism1_100525b - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - Change default - of ndepsrc for f19 and f09 to stream - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ----- Change pathnames - for fglcmask files to pathame with cism instead of gglc - - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 ---------------- Pass a different - set of fields for sno (needed for update to cism) - - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 -------------- Pass a different - set of fields for sno (needed for update to cism) - -Summary of testing: - - bluefire/CCSM testing: -FAIL ERI.f19_g16.IG.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_06 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_05 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_05 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_05 - bluefire/CCSM extra testing: -PASS SMS.f19_g16.IG.bluefire -PASS ERS.f19_g16.IG.bluefire - -CLM tag used for the baseline comparison tests if applicable: clm4_0_05 - -Changes answers relative to baseline: Only when glc is active - Or for f19 and f09 with CN as now ndepsrc streams is the default for all resolutions - (previously ndepsrc data was the default for f19 and f09) - -=============================================================== -=============================================================== -Tag name: clm4_0_05 -Originator(s): erik (erik) -Date: Tue May 25 15:13:30 MDT 2010 -One-line Summary: Move Nitrogen deposition stream branch to trunk - -Purpose of changes: - -Move branch that treats ndepdyn files as streams to trunk. Change csm_share to have a -simpler normalization for coszen scaling (from dlawren/kauff in datm/csm_share). Fix -fragile code in clm_atmlnd, from Mariana. Update to datm8 that can set streams for -aerosols. Fix template so that CLM_BLDNML_OPTS is active. Update scripts and get in -other new finidat files, change clm test list, include _E test and IG f19 test. - -Bugs fixed (include bugzilla ID): - 1161 (New history fields added that should NOT be) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1162 (OpenMP bug with dry-deposition code in clm) - 1163 (finidat file has a bunch of NaN's in it) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Add -ndepsrc option to build-namelist - -List any changes to the defaults for the boundary datasets: - Add new datasets for Nitrogen deposition streams files (same as fndepdyn files) - Remove fndepdat/fndepdyn files for resolutions other than f09 and f19 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): scripts, drv, datm, csm_share - scripts to scripts4_100524b - drv to drvseq3_1_23 - datm to datm8_100420 - csm_share to share3_100423 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>>>> Handle Nitrogen deposition streams -A models/lnd/clm/src/main/ndepStreamMod.F90 - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>> Add some CN drydep tests for hybrid/open-MP -M models/lnd/clm/test/system/tests_pretag_jaguar -M models/lnd/clm/test/system/input_tests_master - ->>>>>>>>>>>> Add ability to handle ndep streams namelists ->>>>>>>>>>>> Add ability to set CLM_BLDNML_OPTS -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/clm.cpl7.template -M models/lnd/clm/bld/namelist_files/namelist_definition.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml ->>>>>>>>>>>> Set ndepstreams variables if ndepsrc=stream, otherwise set fndep files -M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - ->>>>>>>>>>>> Handle new ndep streams namelist and namelist variables ->>>>>>>>>>>> Remove misc.h and preproc.h #includes -M models/lnd/clm/src/main/clm_comp.F90 ---------- Renumber starting at 1 not 0 -M models/lnd/clm/src/main/clm_initializeMod.F90 - Handle initialization both - for ndep streams and old ndep handling -M models/lnd/clm/src/main/aerdepMod.F90 --------- Check if allocated before allocate -M models/lnd/clm/src/main/iniTimeConst.F90 ------ Move setting of ndep out of here -M models/lnd/clm/src/main/clm_atmlnd.F90 -------- Remove fragile code -M models/lnd/clm/src/main/controlMod.F90 -------- Handle use_ndepstream -M models/lnd/clm/src/main/clm_varctl.F90 -------- Add use_ndepstream -M models/lnd/clm/src/main/clm_driver.F90 -------- Add ndep_interp if use_ndepstream - and first and last years are different -M models/lnd/clm/src/main/ndepFileMod.F90 ------- Make fndepdat optional input so - can do this way (old way) or ndep streams (new way). -M models/lnd/clm/src/main/clm_glclnd.F90 -------- Change order of vars from Bill Lipscomb - -M models/lnd/clm/src/main/areaMod.F90 - Add interfaces for MCT datatypes - -M models/lnd/clm/src/main/clmtypeInitMod.F90 - Remove unfilled history vars -M models/lnd/clm/src/main/clmtype.F90 -------- Remove unfilled history vars -M models/lnd/clm/src/main/histFldsMod.F90 ---- Remove unfilled history vars, add QTOPSOIL - as an optional history variable. -M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - Handle fragile code mapping with MCT -M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 --- Handle fragile code mapping with MCT - -Summary of testing: - - bluefire: All PASS except... -029 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -030 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -031 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -032 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -033 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -037 blH41 TBL.sh 17p_cnsc_dh clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 48 cold FAIL! rc= 7 -049 blH52 TBL.sh 17p_cnsc_dm clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@2000 48 cold ..........FAIL! rc= 7 -055 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -056 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -057 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -058 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 - bluefire interactive testing: All PASS except... -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 -040 blK74 TBL.sh 17p_cndvsc_s clm_std 19971231:NONE:1800 1x1_brazil navy -670 arb_ic ............FAIL! rc= 7 -048 blHQ4 TBL.sh _nrcnsc_ds clm_drydep 20000214:NONE:1800 1x1_brazil navy@2000 -150 cold ........FAIL! rc= 7 - bluefire/CCSM testing: All PASS except... -FAIL SMS_RLA.f45_f45.I.bluefire.compare_hist.clm4_0_04 -FAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_04 -FAIL SMS_RLB.f45_f45.I.bluefire.compare_hist.clm4_0_04 -FAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_04 -FAIL SMS_ROA.f45_f45.I.bluefire.compare_hist.clm4_0_04 -FAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_04 -FAIL ERS_D.f45_g37.I.bluefire.compare_hist.clm4_0_04 -FAIL ERS_D.f45_g37.I.bluefire.compare.clm4_0_04 -FAIL PST.f45_g37.I1850.bluefire.compare.clm4_0_04 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_04 -BFAIL ERS_E.f19_g16.I1850.bluefire.compare.clm4_0_04 -FAIL ERI.f19_g16.IG.bluefire -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_04 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_05 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_04 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm4_0_04 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm4_0_04 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm4_0_04 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm4_0_04 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_04 - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -017 erR53 TER.sh 17p_cnc13sc_do clm_std^nl_urb 20020115:NONE:1800 10x15 USGS@1850 10+38 cold ....FAIL! rc= 13 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_04 - -Changes answers relative to baseline: Yes! - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change: same climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - - source tag (all code used must be in the repository): - ndepaer01_clm3_7_15 + SnowHydrology changes - - platform/compilers: IBM - - compset (and additional configure options): I1850CN - - build-namelist options (or complete namelist): -ndepsrc stream - - MSS location of control simulations used to validate new climate: - - /OLESON/csm/ccsm4_0_beta52_ndepaer - /OLESON/csm/ccsm4_0_beta52_ndepaertrans - -=============================================================== -=============================================================== -Tag name: clm4_0_04 -Originator(s): erik (erik) -Date: Thu May 20 10:57:54 MDT 2010 -One-line Summary: New namelist items: ice_runoff, scaled_harvest, carbon_only, new - RTM hist vars, new finidat files, update esmf interface, turn off aerosol read quicker - -Purpose of changes: - -Redo all fndepdyn datasets for f19. Add namelist option to turn off ice-flow and send it -to liquid runoff: ice_runoff (by default .true.). Add new coefficients for harvest from -Johann, and add ability to trigger it on and off for backwards compatibility -(scaled_harvest, by default .false.). Change SUPLN from CPP token to carbon_only namelist -item. Add in new RTM variable to history files from Sean. Add in T31 1850/2000 CN/non-CN -and 2-deg 2000 CNDV finidat files. Turn off reading of aerosol/dust at initialization -rather than run time, so files aren't even opened if CAM is passing data to clm. Update -lnd_comp_esmf to same as mct interface. - -New history fields are incorrect. This is bug 1161. Since, time-lines are critical -and testing was completed, these changes will go in, but will be removed next week. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1161 (New history fields added that should NOT be) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: Remove SUPLN #ifdef change to namelist option - -Describe any changes made to the namelist: Add namelist items - - ice_runoff = If true, river runoff will be split up into liquid and ice streams, - otherwise ice runoff will be zero and all runoff directed to liquid stream - scaled_harvest = If true, harvesting will be scaled according to coeffecients - determined by Johann Feddema, 2009 - carbon_only = If true, and CLMCN carbon-nitrogen model is on, Nitrogen will be - prescribed rather than prognosed - -List any changes to the defaults for the boundary datasets: - New fndepdyn files with correct time coordinate - New finidat files for T31 1850/2000 and f19 2000 for CNDV - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - ->>>>>>>>>>>>>> Remove SUPLN build tests - D models/lnd/clm/test/system/config_files/17p_cnnsc_h - D models/lnd/clm/test/system/config_files/17p_cnnsc_m - D models/lnd/clm/test/system/config_files/17p_cnnsc_o - D models/lnd/clm/test/system/config_files/_cnnsc_h - D models/lnd/clm/test/system/config_files/_cnnsc_m - D models/lnd/clm/test/system/config_files/_cnnsc_o - D models/lnd/clm/test/system/config_files/17p_nrcnnsc_ds - D models/lnd/clm/test/system/config_files/17p_cnnsc_dh - D models/lnd/clm/test/system/config_files/17p_cnnsc_dm - D models/lnd/clm/test/system/config_files/17p_cnnsc_do - D models/lnd/clm/test/system/config_files/_cnnsc_dh - D models/lnd/clm/test/system/config_files/17p_cnnsc_ds - D models/lnd/clm/test/system/config_files/_cnnsc_dm - D models/lnd/clm/test/system/config_files/_cnnsc_do - D models/lnd/clm/test/system/config_files/_cnnsc_ds - ->>>>>>>>>>>>>> Remove namelist files no longer used - D models/lnd/clm/test/system/nl_files/scam - D models/lnd/clm/test/system/nl_files/ext_ccsm_seq_cam - D models/lnd/clm/test/system/nl_files/nl_glcsmb - D models/lnd/clm/test/system/nl_files/scam_prep - -List all files added and what they do: - ->>>>>>>>>>>>>> Add ice_runoff=.false., scaled_harvest=.true., and carbon_only tests - A models/lnd/clm/test/system/nl_files/nl_noicertm_sclharv - A models/lnd/clm/test/system/nl_files/nl_cn_conly - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>>>>> Switch SUPLN tests for carbon_only ->>>>>>>>>>>>>> Add ice_runoff=.false., scaled_harvest=.true tests - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/config_files/README - M models/lnd/clm/test/system/tests_pretag_edinburgh - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/tests_posttag_breeze - M models/lnd/clm/test/system/README.testnames - M models/lnd/clm/test/system/tests_pretag_jaguar_nompi - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/input_tests_master - M models/lnd/clm/test/system/tests_posttag_nompi_regression - ->>>>>>>>>>>>>> Remove setting of supln to off - M models/lnd/clm/test/system/config_files/17p_cnsc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dh - M models/lnd/clm/test/system/config_files/17p_cnsc_do - M models/lnd/clm/test/system/config_files/17p_cnc13sc_dm - M models/lnd/clm/test/system/config_files/17p_cnc13sc_do - ->>>>>>>>>>>>>> Remove SUPLN from configure - M models/lnd/clm/bld/configure - M models/lnd/clm/bld/config_files/config_definition.xml - ->>>>>>>>>>>>>> Add carbon_only, scaled_harvest and ice_runoff options ->>>>>>>>>>>>>> T31 1850/2000 finidat files, f19 CNDV 2000 finidat file ->>>>>>>>>>>>>> Add error checking, change fndepdyn files for ones with ->>>>>>>>>>>>>> corrected time axis. - M models/lnd/clm/bld/build-namelist - M models/lnd/clm/bld/namelist_files/namelist_definition.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - ->>>>>>>>>>>>>> Remove SUPLN #ifdef for carbon_only namelist - M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 - Correct comment - M models/lnd/clm/src/biogeochem/CNAllocationMod.F90 ---- Switch SUPLN for carbon_only - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 ----- Remove ltype as duplicated - ->>>>>>>>>>>>>> Add carbon_only, scaled_harvest, and ice_runoff options ->>>>>>>>>>>>>> Add new RTM history variables - M models/lnd/clm/src/main/clmtypeInitMod.F90 ----------- Add res_sno, topo_ndx, - topo_slope, var_track, var_track2, frost_table, zwt_perched, - qflx_top_soil, qflx_snow_out, qflx_drain_perched - M models/lnd/clm/src/main/pftdynMod.F90 ---------------- Add CN ifdef's for harvest - add if for scaled_harvest or not - M models/lnd/clm/src/main/iniTimeConst.F90 ------------- Add CN ifdef's for ndep - M models/lnd/clm/src/main/histFileMod.F90 -------------- Add RTM ifdef's for frivinp_rtm - M models/lnd/clm/src/main/controlMod.F90 --------------- Put options in appropriate - RTM and CN #ifdef blocks. Add ice_runoff, scaled_harvest and carbon_only to namelist - M models/lnd/clm/src/main/clm_varctl.F90 --------------- Add CN/RTM #ifdefs, add - scaled_harvest and ice_runoff - M models/lnd/clm/src/main/clm_driver.F90 --------------- Add CN #ifdef for ndepdyn - M models/lnd/clm/src/main/ndepFileMod.F90 -------------- Add CN #ifdef - M models/lnd/clm/src/main/clmtype.F90 ------------------ Add res_sno, topo_ndx, - topo_slope, var_track, var_track2, frost_table, zwt_perched, - qflx_top_soil, qflx_snow_out, qflx_drain_perched - M models/lnd/clm/src/main/histFldsMod.F90 -------------- Add - FROST_TABLE, ZWT_PERCH, QDRAI_PERCH, QTOPSOIL - - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 ----- Move lnd_chkAerDep_mct to init - add ice_runoff option to output rtm streams - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 --- Move lnd_chkAerDep_mct to - add ice_runoff option to output rtm streams. And sync up with lnd_comp_mct -init - - -Summary of testing: - - bluefire interactive extra checking: -001 smH43 TSM.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 96 cold PASS -002 erH43 TER.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 10+38 coPASS -003 brH43 TBR.sh 17p_cnsc_do clm_std^nl_noicertm_sclharv 20021230:NONE:1800 10x15 USGS@2000 72+72 coPASS -005 smH93 TSM.sh 17p_cnsc_do clm_ndepdyn^nl_cn_conly 20020101:NONE:1800 4x5 gx3v7@1850-2000 96 cold PASS -006 erH93 TER.sh 17p_cnsc_do clm_ndepdyn^nl_cn_conly 20020101:NONE:1800 4x5 gx3v7@1850-2000 10+38 coPASS -007 brH93 TBR.sh 17p_cnsc_do clm_ndepdyn^nl_cn_conly 20020101:NONE:1800 4x5 gx3v7@1850-2000 72+72 coPASS - bluefire/CCSM testing: All PASS except... -FAIL ERI.T31_g37.IG.bluefire -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_04 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_03 - jaguar/CCSM testing: All FAIL -FAIL ERS_D.f09_g16.I1850.jaguar -FAIL PST.f10_f10.I8520CN.jaguar -FAIL PET_PT.f10_f10.I8520CN.jaguar - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm4_0_03 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_03 -Originator(s): erik (erik) -Date: Mon May 17 14:06:50 MDT 2010 -One-line Summary: Changes from Francis for VOC and drydep - -Purpose of changes: - -Changes from Francis Vitt and Jean-Francois Lamarque for VOC and drydep. Add a scaling -factor for VOC isoprene. Get annual LAI and differences from CLMSP even when CLMCN is -on when sending drydep to atm, as need LAI monthly differences to estimate season index. -Get these changes to work with CN on and off and also get it to work with DEBUG mode -on. Use clm veg indicies in pftvarcon and abort drydep if don't find a wesley veg type -index. Fix ndeplintInterp.ncl script for rcp=-999.9 historical (bug 1153). Add in quarter -degree gx1v6 fraction dataset. - -Bugs fixed (include bugzilla ID): - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1158 (I_1850-2000_CN (I4804CN) inconsistent with I_1850-2000 (I4804) compset) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: qtr-degree, gx1v6 frac/domain datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, dlawren, fvitt - -List any svn externals directories updated (csm_share, mct, etc.): scripts - - scripts to scripts4_100513 - -List all files eliminated: None - -List all files added and what they do: - - A models/lnd/clm/test/system/config_files/_nrcnsc_ds --- cn test without rtm or supln - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>>> Add in qtr-degree fraction and domain file datasets ->>>>>>>>>>> Make gx1v6 default mask for qtr-degree - M models/lnd/clm/bld/namelist_files/namelist_defaults_datm.xml - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - ->>>>>>>>>>> Separate out CN+SUPLN tests as H and CN only as P - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/README.testnames - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/nl_files/clm_drydep ---- correct build-nml options - M models/lnd/clm/test/system/input_tests_master ----- Remove 360x720 tests, add - drydep tests with CN and without, have start dates for drydep - tests span the year - ->>>>>>>>>>> A few small fixes to tools - M models/lnd/clm/tools/mksurfdata/mkvocef.F90 --------- Remove diagnostics as nonsensical - (also was incorrect, see bug 1157) - M models/lnd/clm/tools/ncl_scripts/ndeplintInterp.ncl - Fix so can work with historical case - ->>>>>>>>>>> Allow some CLMSP subroutines to be called even with CLMCN so that LAI can help set ->>>>>>>>>>> the season index when dry-deposition is active (and only when dry-dep is active) - M models/lnd/clm/src/biogeochem/STATICEcosysDynMod.F90 - Change #ifdefs so that - some can be called from drydep even when CN is on. Don't allow - EcosystemDyn to be called if CN on though. - M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 ----- Add a scaling factor - for isoprene - M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 ----- Make winter season on - anytime you have snow. Use pftvarcon indices to set wesveg type from - clmveg type. Add landuse type and set to desert winter if not veg type. - (so won't abort on DEBUG mode) - M models/lnd/clm/src/main/clm_initializeMod.F90 -------- Also call - EcosystemDynini and readAnnualVegetation even if CN is on when drydep is on. - -Summary of testing: - - bluefire: Ran 100 days of 1850CN, compared to Francis's mods and the two results were identical - bluefire interactive testing: -001 smCO3 TSM.sh _sc_do clm_drydep^nl_urb 20021001:NONE:3600 10x15 USGS -10 cold ................PASS -002 erCO3 TER.sh _sc_do clm_drydep^nl_urb 20021001:NONE:3600 10x15 USGS -3+-7 cold ..............PASS -003 brCO3 TBR.sh _sc_do clm_drydep^nl_urb_br 20021001:NONE:3600 10x15 USGS -5+-5 cold ...........PASS -004 blCO3 TBL.sh _sc_do clm_drydep^nl_urb 20021001:NONE:3600 10x15 USGS -30 cold ................PASS -005 smCP3 TSM.sh _sc_do clm_drydep^nl_urb 20020317:NONE:1800 1.9x2.5 gx1v6 -15 startup ..........PASS -006 erCP3 TER.sh _sc_do clm_drydep^nl_urb 20020317:NONE:1800 1.9x2.5 gx1v6 -3+-7 startup ........PASS -007 brCP3 TBR.sh _sc_do clm_drydep^nl_urb_br 20020317:NONE:1800 1.9x2.5 gx1v6 -5+-5 startup .....PASS -008 blCP3 TBL.sh _sc_do clm_drydep^nl_urb 20020317:NONE:1800 1.9x2.5 gx1v6 -15 startup ..........PASS -001 sm654 TSMtools.sh mkgriddata tools__ds namelist .............................................PASS -002 sm674 TSMtools.sh mkgriddata tools__ds singlept .............................................PASS -003 sm774 TSMtools.sh mksurfdata tools__ds singlept .............................................PASS -004 bl774 TBLtools.sh mksurfdata tools__ds singlept .............................................SKIPPED* -005 sm853 TSMtools.sh interpinic tools__o runoptions ............................................PASS - bluefire/CCSM testing: All PASS except... -BFAIL SMS_RLA.f45_f45.I.bluefire.compare.clm4_0_0+upext -BFAIL SMS_RLB.f45_f45.I.bluefire.compare.clm4_0_0+upext -BFAIL SMS_ROA.f45_f45.I.bluefire.compare.clm4_0_0+upext -FAIL ERI.T31_g37.IG.bluefire -BFAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm4_0_0+upext -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_03 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm4_0_0+upext - -CLM tag used for the baseline comparison tests if applicable: clm4_0_02 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_02 -Originator(s): erik (erik) -Date: Thu May 13 00:47:40 MDT 2010 -One-line Summary: Make sure dtime is initialized, so that answers are consistently the same as clm4_0_00 - -Purpose of changes: - -Make sure dtime is initialized before it is used in lnd_run_mct/lnd_run_esmf so -that results are consistent. This bug has been around since clm3_6_36 where doalb -logic was changed. However, until clm4_0_01 results seemed to have been consistent, -but with clm4_0_01 results were inconsistent, and usually incorrect for nstep=1 (in -calculating calday1 and hence doalb). - -Bugs fixed (include bugzilla ID): - 1156 (Reproducability problem with clm4_0_01) - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: critical - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>> Add a reproducability test - A models/lnd/clm/test/system/TRP.sh - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>> Add reproducability test - M models/lnd/clm/test/system/input_tests_master - ->>>>>>>>> Set glcmec by GLC_NEC_ $ifdefs - M models/lnd/clm/src/main/clm_varpar.F90 - ->>>>>>>>> Make sno fields NOT optional, and set dtime before use in _run - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 - -Summary of testing: - - bluefire interactive testing: -001 blC45 TBL.sh 17p_sc_m clm_pftdyn 18501230:NONE:3600 10x15 USGS@1850-2000 -10 arb_ic .........PASS - bluefire/CCSM testing: -PASS PST.f45_g37.I1850.bluefire.compare.clm4_0_0+upext -PASS PET_PT.f45_g37.I1850.bluefire.compare.clm4_0_0+upext -PASS ERS.f19_g16.I1850.bluefire.compare_hist.clm4_0_0+upext -PASS ERS.f19_g16.I1850.bluefire.compare.clm4_0_0+upext -PASS PST.f10_f10.I8520CN.bluefire.compare.clm4_0_0+upext -PASS PET_PT.f10_f10.I8520CN.bluefire.compare.clm4_0_0+upext - -CLM tag used for the baseline comparison tests if applicable: clm4_0_00 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_01 -Originator(s): erik (erik) -Date: Tue May 11 14:39:25 MDT 2010 -One-line Summary: Move glacier multiple elevation class branch to the trunk so that we can work with the active glacier model - -Purpose of changes: - -Add ability to handle glacier multiple elevation classes (glc_mec) in clm, so that we -can interact with the active glacier component (glc). Adds glacier elevation classes -to the surface datasets and requires they be read in when glacier multiple elevation -classes are active. New namelist options for glc_mec include glc_smb and glc_dyntopo. -At build-time the number of glc_mec classes is set (can be 0, 1, 3, 5, or 10). The -model also interacts with the mask of valid glacier points that the active glacier -model determined (input with the fglcmask file), and set by glc_grid (which can be -gland5,gland10, or gland20 for 5-20km resolution over Greenland). glc_grid is set at -build time, but should be moved to the build-namelist. - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1156 (Reproducability problem with clm4_0_01) - 1157 (Problem with VOC interpolation in mksurfdata) - 1197 (MPI problem sending and receiving data in same array) - http://bugs.cgd.ucar.edu/ - -Type of tag: standard - -Describe any changes made to build system: Add glc_nec and glc_grid options to configure - glc_nec can be 1,3,5, or 10 and MUST match the number on the input surface dataset - the elevation classes themselves are read from the surface dataset - glc_grid can be gland5, gland10, gland20 for greenland 5, 10, or 20km resolution - it is merely passed on to build-namelist to pick the glcmask file - -Describe any changes made to the namelist: - -- create_glacier_mec_landunit (= T when these landunits are created; F by default) -- glc_smb (= T if passing surface mass balance to GLC; else pass PDD info; T by default) -- glc_dyntopo (= T if CLM topography changes dynamically; currently F) - (NOT fully implemented yet) - - New history fields: - QICE ice growth/melt (mm/s) - QICEYR ice growth/melt (mm/s) - gris_mask Greenland mask (unitless) - gris_area Greenland ice area (km^2) - aais_mask Antarctic mask (unitless) - aais_area Antarctic ice area (km^2) - -Changes to build-namelist: - - finidat file and possibly the fsurdat files include glc_nec values - Currently only support glc_nec=0 or glc_nec=10 - -List any changes to the defaults for the boundary datasets: Update datm domain file for T31 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, jwolfe, lipscomb, dlawren - -List any svn externals directories updated (csm_share, mct, etc.): scripts, csm_share - Also add in active glacier model - scripts to scripts4_100510a - csm_share to share3_100423 - gglc to glc4_100507 - -List all files eliminated: None - -List all files added and what they do: - ->>>>>>>>>> Add mec tests - A models/lnd/clm/test/system/config_files/_mec10sc_dh - A models/lnd/clm/test/system/config_files/_mec10sc_dm - A models/lnd/clm/test/system/config_files/_mec10sc_do - A models/lnd/clm/test/system/config_files/_mec10sc_ds - A models/lnd/clm/test/system/config_files/_mec10sc_h - A models/lnd/clm/test/system/config_files/_mec10sc_m - A models/lnd/clm/test/system/config_files/_mec10sc_o - A models/lnd/clm/test/system/nl_files/clm_glcmec - A models/lnd/clm/test/system/nl_files/nl_glcsmb - ->>>>>>>>>> Handle passing of data from clm to the active glacier model - A models/lnd/clm/src/main/clm_glclnd.F90 -- handle passing data to glc model - -List all existing files that have been modified, and describe the changes: - ->>>>>>>>>> Add mec tests - M models/lnd/clm/test/system/tests_pretag_jaguar - M models/lnd/clm/test/system/input_tests_master - M models/lnd/clm/test/system/tests_posttag_purempi_regression - M models/lnd/clm/test/system/tests_posttag_hybrid_regression - M models/lnd/clm/test/system/tests_pretag_bluefire - M models/lnd/clm/test/system/tests_pretag_bluefire_nompi - M models/lnd/clm/test/system/config_files/README - M models/lnd/clm/test/system/README.testnames - ->>>>>>>>>>>> Add GLC_MEC to mksurfdata, add ability to set glc_nec on namelist - M models/lnd/clm/tools/mksurfdata/mkglcmec.F90 - M models/lnd/clm/tools/mksurfdata/mkvarctl.F90 - M models/lnd/clm/tools/mksurfdata/mkfileMod.F90 - M models/lnd/clm/tools/mksurfdata/Makefile ------ Add gfortran remove xlf90 for Darwin - M models/lnd/clm/tools/mksurfdata/mkvarpar.F90 - M models/lnd/clm/tools/mksurfdata/README - M models/lnd/clm/tools/mksurfdata/mksrfdat.F90 - ->>>>>>>>>>>> Add some more checking for glc settings - M models/lnd/clm/bld/listDefaultNamelist.pl - Try to make faster, add loop over - glc_nec and glc_grid - M models/lnd/clm/bld/build-namelist --------- Get default glc_smb when - create_glacier_mec_landunits is on - M models/lnd/clm/bld/clm.cpl7.template ------ Add glc_ settings - M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm.xml - Add glc_nec to - finidat files, add glc_nec="10" fsurdat files for T31, 1-deg, 2-deg - M models/lnd/clm/bld/configure - M models/lnd/clm/bld/config_files/Makefile.in - Add gfortran to Darwin and remove -xlf90 - M models/lnd/clm/bld/config_files/config_definition.xsl - Add glacier types - M models/lnd/clm/bld/config_files/config_definition.xml - ->>>>>>>>>>>> Read in glacier elevation classes from surfdata file as GLC_MEC ->>>>>>>>>>>> require it when create_glacier_mec_landunits is .true. and use it ->>>>>>>>>>>> to set value of glc_topomax. Add checking for glc options. ->>>>>>>>>>>> Also remove concurrent directives - M models/lnd/clm/src/main/clm_varcon.F90 -------- Add h2osno_max, lapse_glcmec - and istice_mec, change albice when GLC_NEC>0 - M models/lnd/clm/src/main/clm_varpar.F90 -------- Add npatch_glacier_mec - M models/lnd/clm/src/main/dynlandMod.F90 -------- Add checking for istice_mec - M models/lnd/clm/src/main/decompInitMod.F90 ----- Pass glcmask in - M models/lnd/clm/src/main/clm_initializeMod.F90 - Handle create_glacier_mec_landunit - M models/lnd/clm/src/main/ncdio.F90 ------------- Add 2D module procedures to ncd_iolocal interface - M models/lnd/clm/src/main/subgridMod.F90 -------- Handle create_glacier_mec_landunit if true - M models/lnd/clm/src/main/clmtypeInitMod.F90 ---- Add glcmecpoi and greenland and antarctic mask/area - add forc_pbot, forc_rho, glc_topo, forc_t, forc_th to ces, forc_q to cws, eflx_bot to cef - add qflx_glcice, glc_rofi, glc_rofl - M models/lnd/clm/src/main/pftdynMod.F90 --------- Change comments - M models/lnd/clm/src/main/iniTimeConst.F90 ------ Handle istice_mec - M models/lnd/clm/src/main/clm_atmlnd.F90 -------- Fix comment - M models/lnd/clm/src/main/clm_varsur.F90 -------- Add topoxy - M models/lnd/clm/src/main/controlMod.F90 -------- Add create_glacier_mec_landunit, glc_dyntopo, glc_smb, fglcmask to namelist - M models/lnd/clm/src/main/cpl_mct/lnd_comp_mct.F90 - Add sno_export/import - M models/lnd/clm/src/main/cpl_esmf/lnd_comp_esmf.F90 Add sno_export/import - M models/lnd/clm/src/main/filterMod.F90 --------- Add istice_mec - M models/lnd/clm/src/main/clm_varctl.F90 -------- Add fglcmask, create_glacier_mec_landunit, - glc_dyntopo, glc_smb, glc_nec, and glc_topomax add some error checking for them - M models/lnd/clm/src/main/initGridCellsMod.F90 -- Make ice sheet masks and deal with glcmask - M models/lnd/clm/src/main/surfrdMod.F90 --------- Read GLCMASK, GLC_MEC, PCT_GLC_MEC and TOPO_GLC_MEC when create_glacier_mec_landunit - M models/lnd/clm/src/main/domainMod.F90 --------- Add glcmask - M models/lnd/clm/src/main/clmtype.F90 ----------- Add forc_pbot, forc_rho, glc_frac, glc_topo add - forc_t, forc_q, eflx_bot, qflx_glcice, glc_rofi, glc_rofl, glcmecpoi, gris and assis mask/area - M models/lnd/clm/src/main/histFldsMod.F90 ------- Add new fields when create_glacier_mec_landunit - M models/lnd/clm/src/main/histFileMod.F90 ------- Add glacier_mec to notes, set_noglcmec to hist_addfld1d - M models/lnd/clm/src/main/mkarbinitMod.F90 ------ Set mask sno to h2osno_max, use istice_mec - M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ----- Assess if istice_mec and add qflx_glcice for glc_dyntopo -P - M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 - Assess if istice_mec - M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 -- Assess if istice_mec and add eflx_bot - M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 ---- Assess if istice_mec - M models/lnd/clm/src/biogeophys/Biogeophysics1Mod.F90 --- Move forc_pbot/forc_q/forc_t/forc_th from g to c, assess istice_mec - M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 ---- Assess if isice_mec - M models/lnd/clm/src/biogeophys/Hydrology1Mod.F90 ------- Assess if isice_mec move force_t from g to c - M models/lnd/clm/src/biogeophys/Hydrology2Mod.F90 ------- Assess if istice_mec and add qflx_glcice - M models/lnd/clm/src/biogeophys/clm_driverInitMod.F90 --- Downscale forc_t, forc_th, forc_q, forc_pbot from gridcell to columns - based on surface eleveation for glc_mec landunits - M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 - Change forcing from g to c - -Summary of testing: - - bluefire interactive testing: All PASS up to.. -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 - bluefire/CCSM testing: -FAIL PST.f45_g37.I1850.bluefire.compare.clm3_7_15 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm3_7_15 -FAIL ERS.f19_g16.I1850.bluefire.compare_hist.clm3_7_15 -FAIL ERS.f19_g16.I1850.bluefire.compare.clm3_7_15 -FAIL ERI.T31_g37.IG.bluefire -FAIL ERB.f09_g16.I_1948-2004.bluefire.compare.clm3_7_15 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm4_0_01 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_15 -FAIL PST.f10_f10.I8520CN.bluefire.compare.clm3_7_15 -FAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm3_7_15 - -PASS SMS_D.f19_g16.IG.bluefire -PASS ERS.f19_g16.IG.bluefire -FAIL SMS.T31_g37.IG.bluefire -FAIL SMS.f09_g16.IG.bluefire - - breeze,gale,hail,gust/ifort interactive testing: All PASS up to... -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 - -CLM tag used for the baseline comparison tests if applicable: clm3_7_15 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_0_00 -Originator(s): erik (erik) -Date: Tue May 4 23:02:18 MDT 2010 -One-line Summary: Update to datm8, redirect aquifer overflow to drainage, add - gx3v7 masks, script to extract regional datasets, add harvesting for CN, - modify shrubs, include urban model, ice stream for snowcapping, new - build-namelist system, scale solar by solar zenith angle in datm, deep - soil with bedrock at bottom, organic matter in soils, SNICAR for snow - radiation, sparce dense aero, snow cover changes - -Type of tag: doc - -Software engineering changes: - - Update to cpl7 and scripts. - Remove offline and cpl6 modes. - Remove support for CASA model. - Update to datm8 atmospheric data model. - Add gx3v7 land mask for T31 and fv-4x5 horizontal resolutions. - Add gx1v6 land mask for f05, f09, and f19 horizontal resolutions. - Add tx1v1 land mask and 1.9x2.5_tx1v1 horizontal resolution. - Add in 2.5x3.33 horizontal resolution. - Add in T62 horizontal resolution so can run at same resolution as input datm data. - Allow first history tape to be 1D. - Add ability to use own version of input datasets with CLM_USRDAT_NAME variable. - Add a script to extract out regional datasets. - New build-namelist system with XML file describing all namelist items. - Add glacier_mec use-case and stub glacier model. - Add ncl script to time-interpolate between 1850 and 2000 for fndepdat dataset, for fndepdyn version. - Make default of maxpatch_pft=numpft+1 instead of 4. - Only output static 3D fields on first h0 history file to save space. - Add new fields for VOC (Volatile Organic Compounds) on some surface datasets - Add irrigation area to mksurfdata tool (NOT used in CLM yet). - Add multiple elevation class option for glaciers in mksurfdata tool (NOT used in CLM yet). - Add ascale field to land model in support of model running on it's own grid. - -Science changes: - - Change to freezing temperature constant - Forcing height at atm plus z0+d on each tile - Effective porosity divide by zero fix - Sparse/dense canopy aerodynamic parameters - Ground/snow emissivity smooth transition - Thermal and hydraulic properties of organic soil - Init h2osoi=0.3 - Snow compaction fix - Snow T profile during layer splitting fix - Snow burial fraction - Snow cover fraction - SNICAR (snow aging, black carbon and dust deposition, vertical distribution of solar energy) - Remove SNOWAGE, no longer used - Deep soil (15 layers, ~50m), 5 new layers are hydrologically inactive bed rock - Ground evap (beta), stability, and litter resistance - Organic/mineral soil hydraulic conductivity percolation theory - Richards equation modifications - Normalization of frozen fraction of soil formulation - One-step solution for soil moisture and qcharge - Changes to rsub_max for drainage and decay factor for surface runoff - Fixed diurnal cycle of solar radiation in offline forcing data - Back to CLM3 lakes and wetlands datasets, but 1% rather than 5% threshold (same for glacier) - Changes to pft physiology file from CN - New grass optical properties - New surface dataset assuming no herbaceous understory - Direct versus diffuse radiation offline - New VOC model (MEGAN) - Snow-capped runoff goes to new ice stream and routed to ocean as ice - Dust model always on, LAI threshold parameter change from 0.1 to 0.3 - Daylength control on vcmax - SAI and get_rad_dtime fix - Always run with MAXPATCH_PFT=npfts + 1 instead of 4 - Transient land cover/use mode - datasets, energy and water balance - RTM sub-cycling - Twostream bug fix - Update soil colors - 2m relative humidity - Fix for aquifer leak (SoilHydrologyMod, BalanceCheckMod) - New nitrogen deposition file (units and sum of NOx, NHy) - -Quickstart to new cpl7 scripts... - - cd scripts - ./create_newcase -help # get help on how to run create_newcase - ./create_newcase -case testI -mach bluefire -res f19_g16 -compset I # create new "I" case for bluefire at 1.9x2.5_gx1v6 res - # "I" case is clm active, datm7, and inactive ice/ocn - cd testI - ./xmlchange -help # Get help on editor for XML files - ./xmlchange env_conf.xml env_mach_pes # Edit configure files if needed - configure -case # create scripts - ./xmlchange env_build.xml # Edit build files if needed - testI.build # build model and create namelists - ./xmlchange env_run.xml # Edit run files if needed - bsub < testI.run # submit script - # (NOTE: edit env_run.xml to set RESUBMIT to number of times to automatically resubmit) -Quickstart to use of regional extraction scripts and PERSONAL datasets: - - # Run the script to create an area to put your files (assume CSMDATA set to standard inputdata) - cd scripts - setenv MYCSMDATA $HOME/myinputdata - link_dirtree $CSMDATA $MYCSMDATA - - # Run the extraction for data from 52-73 North latitude, 190-220 longitude - # that creates 13x12 gridcell region from the f19 (1.9x2.5) global resolution over - # Alaska - cd ../models/lnd/clm/tools/ncl_scripts - setenv MYID 13x12pt_f19_alaskaUSA - getregional_datasets.pl -sw 52,190 -ne 73,220 -id $MYID -mycsmdata $MYCSMDATA - - # Now create a case that uses these datasets - cd ../../../../../scripts - create_newcase -case testregional -compset I -mach bluefire -res pt1_pt1 - cd testregional - $EDITOR env_conf.xml # change CLM_BLDNML_OPTS to include "-clm_usr_name $MYID" (expand $MYID) - $EDITOR env_mach_pes.xml # Change tasks/threads as appropriate (defaults to serial) - xmlchange -file env_run.xml -id DIN_LOC_ROOT_CSMDATA -val $MYCSMDATA - - # Do other changes to xml files as appropriate - # configure as normal, then edit the datm namelist - - configure -case - - # Then build and run the case as normal - -Known bugs (include bugzilla ID): - 701 (svn keyword) - 717 (archiving bug -- only archive 1000 files at a time) - 722 (threading slow) - 789 (1pt sims 2.5X slow) - 794 (hist avg strange) - 883 (aerosol deposition not from atm) - 896 (T62 mode does not work) - 920 (glacier_mec problems in mksurfdata) - 935 (RTM warning NOT an error) - 990 (CN transient blowup) - 994 (finidat files on jaguar for pftdyn fail) - 1017 (SCM mode can NOT restart) - 1025 (SCM mode can NOT use a global finidat file) - 1063 (Problem in restarts for CCSM spinup data) - 1092 (Problems running in debug mode on dublin with datm8) - 1124 (Reported energy for pftdyn grid-cell not right) - 1139 (LAND and PFTS 1D vector averaging doesn't work) - 1147 (mkgriddata can't straddle over Greenwich) - 1153 (Problem with ndeplintInterp for historical case) - 1157 (Problem with VOC interpolation in mksurfdata) - 1197 (MPI problem sending and receiving data in same array) -Describe any changes made to build system: - - Change directory structure to match CCSM. - Add BGP target. - Add choice between ESMF and MCT frameworks. - Start removing #ifdef and directives that supported Cray-X1 Phoenix as now decommissioned. - Make default of maxpatch_pft=numpft+1 instead of 4 for all configurations. - By default turn on CLAMP when either CN or CASA is enabled - New SNICAR_FRC, CARBON_AERO, and C13 CPP ifdef tokens. - - New options added to configure: - - -comp_intf Component interface to use (ESMF or MCT) (default MCT) - -nofire Turn off wildfires for bgc setting of CN (default includes fire for CN) - -pio Switch enables building with Parallel I/O library. [on | off] (default is on) - -snicar_frc Turn on SNICAR radiative forcing calculation. [on | off] (default is off) - -Describe any changes made to the namelist: - - NOTE: build-namelist now checks the validity of your namelist you generate by looking at data in the namelist_definition.xml - file. In order to add new namelist items you need to change the code and also edit this file. To view information - on the namelist view the file: - models/lnd/clm/bld/namelist_files/namelist_definition.xml - in your browser and you'll see the names, type, description and valid_values for all namelist variables. - - Changes to build-namelist: - Transient sim_year ranges (i.e. 1850-2000) - Remove cam_hist_case option. - Make sure options ONLY used for stand-alone testing have a "drv_" or "datm_" prefix in them and list these - options all together and last when asking for help from build-namelist. - New options to build-namelist: - -clm_usr_name "name" Dataset resolution/descriptor for personal datasets. Default: not used - Example: 1x1pt_boulderCO_c090722 to describe location, - number of pts, and date files created - New list options to build-namelist: - build-namelist -res list # List valid resolutions - build-namelist -mask list # List valid land-masks - build-namelist -sim_year list # List valid simulation years and simulation year ranges - build-namelist -clm_demand list # List namelist variables including those you could demand to be included. - build-namelist -use_case list # List valid use-cases - build-namelist -rcp list # List valid representative concentration pathways - # for future scenarios - - List of use-cases for build-namelist: - -1850-2100_rcp4.5_transient = Simulate transient land-use, and aerosol deposition changes -with historical data from 1850 to 2005 and then with the RCP4.5 scenario from MINICAM - -1850-2100_rcp8.5_transient = Simulate transient land-use, and aerosol deposition changes -with historical data from 1850 to 2005 and then with the RCP8.5 scenario from MESSAGE - - 1850_control = Conditions to simulate 1850 land-use -2000-2100_rcp8.5_transient = Simulate transient land-use, and aerosol deposition changes -with historical data from 2000 to 2005 and then with the RCP8.5 scenario from MESSAGE - - 2000_control = Conditions to simulate 2000 land-use -20thC_transient = Simulate transient land-use, and aerosol deposition changes from 1850 -to 2005 - pergro = Perturbation error growth test with initial conditions perturbed by -roundoff level - pergro0 = Perturbation error growth test with unperturbed initial conditions - - - New namelist items: - - urban_hac = OFF, ON or ON_WASTEHEAT (default OFF) Flag for urban Heating and Air-Conditioning - OFF = Building internal temperature is un-regulated. - ON = Building internal temperature is bounded to reasonable range. - ON_WASTEHEAT = Building internal temperature is bounded and resultant waste - heat is given off. - urban_traffic = .true. or .false. (default .false.) Flag to include additional multiplicative factor of urban traffic - to sensible heat flux. - fsnowoptions = filename file for snow/aerosol optical properties (required) - fsnowaging = filename file for snow aging parameters (required) - faerdep = filename file of aerosol deposition (required) - - New history variables: (note watt vs. W in units, 26 vs. 76) - BCDEP total BC deposition (dry+wet) from atmosphere kg/m^2/s - BIOGENCO biogenic CO flux uGC/M2/H - C13_PRODUCT_CLOSS C13 total carbon loss from wood product pools gC13/m^2/s - DSTDEP total dust deposition (dry+wet) from atmosphere kg/m^2/s - EFLX_DYNBAL dynamic land cover change conversion energy flux W/m^2 - FGR12 heat flux between soil layers 1 and 2 watt/m^2 - FSAT fractional area with water table at surface unitless - FSH_NODYNLNDUSE sensible heat flux not including correction for land use change - watt/m^2 - GC_HEAT1 initial gridcell total heat content J/m^2 - GC_HEAT2 post land cover change total heat content J/m^2 inactive - GC_ICE1 initial gridcell total ice content mm/s - GC_ICE2 post land cover change total ice content mm/s inactive - GC_LIQ1 initial gridcell total liq content mm - GC_LIQ2 initial gridcell total liq content mm inactive <<<< name?? - H2OSNO_TOP mass of snow in top snow layer kg - HEAT_FROM_AC sensible heat flux put into canyon due to heat removed from air conditioning - watt/m^2 - HK hydraulic conductivity mm/s inactive - ISOPRENE isoprene flux uGC/M2/H - LAND_USE_FLUX total C emitted from land cover conversion and wood produc t pools gC/m^2/s - LAND_UPTAKE NEE minus LAND_USE_FLUX, negative for update gC/m^2/s - LWup upwelling longwave radiation watt/m^2 inactive - MONOTERP monoterpene flux uGC/M2/H - NBP net biome production, includes fire, landuse, and harvest flux, positive for sink - gC/m^2/s - OCDEP total OC deposition (dry+wet) from atmosphere kg/m^2/s - OVOC other VOC flux uGC/M2/H - ORVOC other reactive VOC flux uGC/M2/H - PBOT atmospheric pressure Pa - PCO2 atmospheric partial pressure of CO2 Pa - PRODUCT_CLOSS total carbon loss from wood product pools gC/m^2/s - PRODUCT_NLOSS total N loss from wood product pools gN/m^2/s - Qair atmospheric specific humidity kg/kg inactive - Qanth anthropogenic heat flux watt/m^2 inactive - Qtau momentum flux kg/m/s^2 - QFLX_LIQ_DYNBAL liq dynamic land cover change conversion runoff flux mm/s - QFLX_ICE_DYNBAL ice dynamic land cover change conversion runoff flux mm/s - QRUNOFF_NODYNLNDUSE total liquid runoff not including correction for land use change (does not include QSNWCPICE) - mm/s - QSNWCPICE excess snowfall due to snow capping mm/s - QSNWCPICE_NODYNLNDUSE excess snowfall due to snow capping not including correction for land use change - mm/s - QSNWCPLIQ excess rainfall due to snow capping mm/s inactive - SMP soil matric potential mm inactive - SNOAERFRC2L surface forcing of all aerosols in snow, averaged only when snow is present (land) - watt/m^2 - SNOAERFRCL surface forcing of all aerosols in snow (land) watt/m^2 - SNOBCFRCL surface forcing of BC in snow (land) watt/m^2 - SNOBCMCL mass of BC in snow column kg/m2 - SNOBCMSL mass of BC in top snow layer kg/m2 - SNOdTdzL top snow layer temperature gradient (land) K/m - SNODSTFRC2L surface forcing of dust in snow, averaged only when snow is present (land) - watt/m^2 - SNODSTFRCL surface forcing of dust in snow (land) watt/m^2 - SNODSTMCL mass of dust in snow column kg/m2 - SNODSTMSL mass of dust in top snow layer kg/m2 - SNOFSRND direct nir reflected solar radiation from snow watt/m^2 inactive - SNOFSRNI diffuse nir reflected solar radiation from snow watt/m^2 inactive - SNOFSRVD direct vis reflected solar radiation from snow watt/m^2 inactive - SNOFSRVI diffuse vis reflected solar radiation from snow watt/m^2 inactive - SNOFSDSND direct nir incident solar radiation on snow watt/m^2 inactive - SNOFSDSNI diffuse nir incident solar radiation on snow watt/m^2 inactive - SNOFSDSVD direct vis incident solar radiation on snow watt/m^2 inactive - SNOFSDSVI diffuse vis incident solar radiation on snow watt/m^2 inactive - SNOLIQFL top snow layer liquid water fraction (land) fraction inactive - SNOOCMCL mass of OC in snow column kg/m2 - SNOOCMSL mass of OC in top snow layer Kg/m2 - SNOOCFRC2L surface forcing of OC in snow, averaged only when snow is present (land) - SNOOCFRCL surface forcing of OC in snow (land) watt/m^2 - watt/m^2 - SNORDSL top snow layer effective grain radius m^-6 inactive - SNOTTOPL snow temperature (top layer) K/m inactive <<< units? - SOILWATER_10CM soil liquid water + ice in top 10cm of soil kg/m2 - SWup upwelling shortwave radiation watt/m^2 inactive - TSOI_10CM soil temperature in top 10cm of soil K - URBAN_AC urban air conditioning flux watt/m^2 - URBAN_HEAT urban heating flux watt/m^2 - VOCFLXT total VOC flux into atmosphere uGC/M2/H - Wind atmospheric wind velocity magnitude m/s inactive - WOOD_HARVESTC wood harvest (to product pools) gC/m^2/s - WOOD_HARVESTN wood harvest (to product pools) gN/m^2/s - - History field name changes: - - ANNSUM_PLANT_NDEMAND => ANNSUM_POTENTIAL_GPP - ANNSUM_RETRANSN => ANNMAX_RETRANSN - C13_DWT_PROD10C_LOSS => C13_PROD10C_LOSS - C13_DWT_PROD100C_LOSS => C13_PROD100C_LOSS - C13_DWT_PROD10N_LOSS => C13_PROD10N_LOSS - C13_DWT_PROD100C_LOSS => C13_PROD100C_LOSS - DWT_PROD100N_LOSS => PROD10N_LOSS - DWT_PROD100N_LOSS => PROD100N_LOSS - DWT_PROD100C_LOSS => PROD10C_LOSS - DWT_PROD100C_LOSS => PROD100C_LOSS - HCSOISNO => HC - TEMPSUM_PLANT_NDEMAND => TEMPSUM_POTENTIAL_GPP - TEMPSUM_RETRANSN => TEMPMAX_RETRANSN - - History field names deleted: - SNOWAGE, TSNOW, FMICR, FCO2, DMI, QFLX_SNOWCAP - - Add new urban oriented _U, and _R (Urban and Rural) for: - EFLX_LH_TOT, FGR, FIRA, FSH, FSM, Q2M, QRUNOFF, RH2M, SoilAlpha, TG, TREFMNAV, TREFMXAV, and TSA - (missing _R for SoilAlpha) - -Describe timing and memory performance: - -Versions of any externally defined libraries: - - scripts scripts4_100108b - drv vocemis-drydep12_drvseq3_1_11 - datm datm8_091218 - socn stubs1_2_02/socn - sice stubs1_2_02/sice - sglc stubs1_2_02/sglc - csm_share vocemis-drydep13_share3_091217 - esmf_wrf_timemgr esmf_wrf_timemgr_090402 - timing timing_090929 - mct MCT2_7_0_100106 - pio pio60_prod - cprnc cprnc_081022 - -Summary of testing: - - bluefire: All PASS except... -025 smG41 TSM.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -026 erG41 TER.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -027 brG41 TBR.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -028 blG41 TBL.sh 17p_sc_dh clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 -029 smG55 TSM.sh 17p_sc_h clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic .........FAIL! rc= 10 -043 smLI1 TSM.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -044 erLI1 TER.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -045 brLI1 TBR.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -046 blLI1 TBL.sh _sc_dh clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 4 -048 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 12 - bluefire interactive testing: All PASS except... -013 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 5 -019 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -021 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -022 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -026 brAK8 TBR.sh _sc_ds clm_std^nl_ptsmode_ocn 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ......FAIL! rc= 6 - bluefire/CCSM testing: All PASS except -FAIL PST.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL PET_PT.f45_g37.I1850.bluefire.compare.clm3_7_10 -FAIL ERB.f09_g16.I1850SPINUPCN.bluefire -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.generate.clm3_7_15 -BFAIL ERB.f09_g16.I1850SPINUPCN.bluefire.compare.clm3_7_10 -FAIL ERH_D.f10_f10.I1850CN.bluefire.compare.clm3_7_10 -BFAIL PST.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -BFAIL PET_PT.f10_f10.I8520CN.bluefire.compare.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare_hist.clm3_7_10 -FAIL ERS_D.f19_g16.IRCP85CN.bluefire.compare.clm3_7_10 - jaguar: All PASS except.. -005 smB51 TSM.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 144 arb_ic ..............FAIL! rc= 10 -006 erB51 TER.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -007 brB51 TBR.sh _scsnf_dh clm_std^nl_urb 20021230:NONE:1800 10x15 USGS 72+72 arb_ic ............FAIL! rc= 5 -026 smLI2 TSM.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10 arb_ic ........................FAIL! rc= 10 -027 erLI2 TER.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -5+-5 arb_ic ......................FAIL! rc= 5 -028 brLI2 TBR.sh _sc_dm clm_std 20020101:NONE:1800 94x192 T62 -10+-10 arb_ic ....................FAIL! rc= 5 -030 smL58 TSM.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 96 arb_ic ...............FAIL! rc= 10 -031 erL58 TER.sh _sc_dh clm_std^nl_crcrop 20020115:NONE:1800 10x15 USGS 12+84 arb_ic ............FAIL! rc= 5 - jaguar interactive testing: All PASS except... -006 erAK4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 7 -007 brAK4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 1.9x2.5 gx1v6 -5+-5 cold ..........FAIL! rc= 6 -009 smG43 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -010 erG43 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 brG43 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 - edinburgh/ifort interactive testing: All PASS except... -006 erAL4 TER.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 7 -007 brAL4 TBR.sh _sc_ds clm_std^nl_ptsmode 20030101:NONE:1800 10x15 USGS -5+-5 cold .............FAIL! rc= 6 -014 erOC4 TER.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 115+115 arb_FAIL! rc= 5 -015 brOC4 TBR.sh _nrvansc_ds clm_urb1pt^nl_urb_br 19920812:NONE:3600 1x1_vancouverCAN navy 72+72 arbFAIL! rc= 5 -016 blOC4 TBL.sh _nrvansc_ds clm_urb1pt^nl_urb 19920812:NONE:3600 1x1_vancouverCAN navy 330 arb_ic FAIL! rc= 4 -018 erNB4 TER.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 57+100 arb_FAIL! rc= 5 -019 brNB4 TBR.sh _nrmexsc_ds clm_urb1pt^nl_urb_br 19931201:NONE:3600 1x1_mexicocityMEX navy 72+72 arFAIL! rc= 5 -020 blNB4 TBL.sh _nrmexsc_ds clm_urb1pt^nl_urb 19931201:NONE:3600 1x1_mexicocityMEX navy 157 arb_ic FAIL! rc= 4 - edinburgh/ifort: All PASS except... -002 erA92 TER.sh _sc_dm clm_std^nl_urb 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic ................FAIL! rc= 7 -003 brA92 TBR.sh _sc_dm clm_std^nl_urb_br 20030101:NONE:3600 4x5 gx3v7 -3+-3 arb_ic .............FAIL! rc= 6 -006 erD91 TER.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 72+72 cold ...............FAIL! rc= 7 -007 blD91 TBL.sh _persc_dh clm_per^nl_urb 20021231:NONE:1200 4x5 gx3v7 144 cold .................FAIL! rc= 5 -008 smG42 TSM.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -009 erG42 TER.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -010 brG42 TBR.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -011 blG42 TBL.sh 17p_sc_dm clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - breeze,gale,hail,gust/ifort interactive testing: All PASS except... -011 blCA8 TBL.sh _nrsc_ds clm_std^nl_urb 20021230:NONE:3600 1x1_asphaltjungleNJ navy -90 arb_ic .FAIL! rc= 5 -020 smG53 TSM.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 10 -021 erG53 TER.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 10+38 arb_ic ......FAIL! rc= 5 -022 brG53 TBR.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 72+72 arb_ic ......FAIL! rc= 5 -023 blG53 TBL.sh 17p_sc_do clm_pftdyn 10001230:NONE:1800 10x15 USGS@1000-1002 144 arb_ic ........FAIL! rc= 4 - -CLM tag used for the baseline comparison tests if applicable: clm3_5_00 - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers: - - what code configurations: All - - what platforms/compilers: All - - nature of change: new climate for clm4 - - If this tag changes climate describe the run(s) done to evaluate the new - climate in enough detail that it(they) could be reproduced, i.e., - ccsm4_0_beta35 - bluefire - -compset B_1850_TRACK1_CN -res f19_g16 - - MSS location of control simulations used to validate new climate: - -/DLAWREN/csm/b40.1850.track1.2deg.003.snow - - URL for LMWG diagnostics output used to validate new climate: - -http://www.cgd.ucar.edu/ccr/paleo/b40.snow/b40.1850.track1.2deg.003.snow-b40.1850.track1.2deg.003.control/ - -=============================================================== diff --git a/doc/clm4_5_ChangeLog b/doc/clm4_5_ChangeLog deleted file mode 100644 index cdd1dc80d7..0000000000 --- a/doc/clm4_5_ChangeLog +++ /dev/null @@ -1,41442 +0,0 @@ -=============================================================== -Tag name: clm4_5_18_r275 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Mon Feb 5 15:02:53 MST 2018 -One-line Summary: Update initial condition files, update fates, new CMIP6 pop-dens, more lnd_tuning_mod options, updated ndep for fully coupled - -Purpose of changes ------------------- - -Update the initial condition files for clm4_0, clm4_5, clm5_0 at f09_g16 for both CRUNCEpv7 -forcing and GSWP3v1 forcing. Update FATES with science change to science-1.4.1_api-3.0.0. -New CMIP6 population density file that has years beyond 1850 (the old one just had 1850, so -was incorrect for historical or present-day). clm4_0 compsets now use CRUNCEPv7 forcing rather than -the CRUNCEPv4 forcing. LND_TUNING_MODE is now used for initial conditions -for different forcing. For fully coupled 1850 cases the ndep file is updated to a preliminary CMIP6 -version. Fix the tools testing and build-namelist testing to work in the git checkout. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #: - #247 -- Clm40 1850 and HIST compsets are incorrect - #246 -- New CMIP6 population density file is incorrect as it's constant in time - #171 -- CLM is getting the mask from the clm namelist_defaults rather than from top level scripts - -Known bugs introduced in this tag (include github issue ID): - #253 -- Bad new IC file for clm4_0 - #254 -- Failing test ERS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_gnu.clm-default (sporadic glitch?) - #255 -- PTCLMmkdata doesn't work in the CLM git checkout - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - LND_TUNING_MODE is set by default according to the compset the case is created with. - If you change the CLM physics or DATM forcing, you'll want to update the LND_TUNING_MODE. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - LND_TUNING_MODE options changed to: - clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_0_cam6.0,clm5_0_CRUv7,clm5_0_GSWP3v1 - - Several new compset aliases added: - - CLM50: I1850Clm50Sp, I1850Clm50SpCru, I1850Clm50BgcCropCru - CLM45: I1850Clm45BgcCruGs, I1850Clm45BgcGs - CLM40 I1850Clm40CnGswGs (fixed I2000Clm40SpCruGs, I1850Clm40SpCruGs, and IHistClm40SpCruGs) - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): New IC files for f09_g16 - CMIP6 ndep file for fully coupled, pop-density beyond 1850 - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Setting of ndep_taxmode/ndep_varlist should be simplified in CLMBuildNamelist.pm - Change name of setup_logic_lnd_tuning to setup_cmdl_lnd_tuning in CLMBuildNamelist.pm - -Changes to tests or testing: Change a few tests and add a few - Add I1850Clm50SpCru, I1850Clm50BgcCropCru, I1850Clm40CnGswGs and I1850Clm50Sp tests at f09_g16 - Change I1850Clm40SpCruGs f09_f09_mg16 to f09_g16 - Change I2000Clm50BgcCruGs f09_g17 test to I1850Clm50BgcCruGs f09_g16 - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (134 comparison tests are different than clm4_5_18_r275) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - FAIL - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_18_r275 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers: - - what code configurations: clm4_0 for f09_g16 - clm4_0 updated to CRUv7 Forcing - all clm4_5 and clm5_0 configurations, FATES-update - - what platforms/compilers: All - - nature of change: initialization, BGC for HIST/2000 compsets - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): FATES - fates to fates_s1.4.1_a3.0.0_rev3 - -Pull Requests that document changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #252 -- New IC files - #251 -- README update - #248 -- Documentation of SMB in namelist_definition - #228 -- Get tools and testing working - - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r274 -Originator(s): sacks (Bill Sacks) -Date: Tue Jan 30 05:55:53 MST 2018 -One-line Summary: Fix auto-detection of CIME_MODEL in a standalone checkout - -Purpose of changes ------------------- - -The auto-detection of whether CIME_MODEL is acme or cesm is broken in -standalone checkouts of clm4_5_18_r273. (This auto-detection relied on -whether there was an SVN_EXTERNAL_DIRECTORIES file present at the top -level.) - -This tag points to a new cime version that fixes this issue. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #238 - clm4_5_18_r273 requires setting CIME_MODEL - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - - Note: I ran the cheyenne tests with CIME_MODEL=cesm defined in my - environment, and the hobart tests without this setting. - -CLM tag used for the baseline comparisons: clm4_5_18_r273 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - -- cime: clm4518/n03/cime5.4.0-alpha.03 -> clm4518/n04/cime5.4.0-alpha.03 - Fix to auto-detect that CIME_MODEL=cesm based on presence of - manage_externals rather than SVN_EXTERNAL_DIRECTORIES - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Fix the documentation of some expected fails -M cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r273 -Originator(s): sacks (Bill Sacks) -Date: Fri Jan 26 15:26:06 MST 2018 -One-line Summary: Support a standalone checkout from git - -Purpose of changes ------------------- - -This PR allows a standalone git-based checkout to work. Starting with -this tag, we'll be using git rather than svn for CLM/CTSM development. - -The biggest changes here are pulling in manage_externals, which serves -the role of svn externals. After cloning the repository, you can get all -of the necessary externals by running: - -./manage_externals/checkout_externals - -See the file README_EXTERNALS.rst at the top level of the repository for -more details on using this tool. - -Other than that, this PR mostly involves changes to allow you to run -from the new directory structure of a standalone checkout: Now all of -the CLM/CTSM directories appear at the top level of the checkout, rather -than nested under components/clm. - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include github issue ID): - -- https://github.com/ESCOMP/ctsm/issues/220 For new standalone - organization, need to generalize paths for tools and testing - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -- The svn trunk is now frozen. All future development will occur in the - master branch of https://github.com/ESCOMP/ctsm - -- A standalone git checkout will have all CLM directories (src, bld, - etc.) at the top level, rather than under components/clm. - -- To get all externals after cloning the git repository, run - ./manage_externals/checkout_externals - - See the file README_EXTERNALS.rst at the top level of the repository - for more details on using this tool. - -- More details on working with the git repository will be coming soon - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -- build-namelist unit tests currently do not run (#220) - -- tools tests, and the tools builds themselves, are expected not to work (#220) - -Changes to tests or testing: none - -Code reviewed by: Ben Andre, Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - FAIL (#220) - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - NOT RUN; EXPECTED TO FAIL (#220) - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - NOT RUN; MAY FAIL DUE TO #220 - - regular tests (aux_clm): - - cheyenne_intel ---- pass - cheyenne_gnu ------ pass - hobart_nag -------- pass - hobart_pgi -------- pass - hobart_intel ------ pass - -CLM tag used for the baseline comparisons: clm4_5_18_r272 -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - -- cime: clm4518/n02/cime5.4.0-alpha.03 -> clm4518/n03/cime5.4.0-alpha.03 - Has some changes needed for new standalone directory structure to work - (these changes are now on cime master, though see #225 before updating - to cime master) - -- cism: cism2_1_40 -> cism2_1_46 - Points to cism in git - cism2_1_41, 42, 43 and 44 contained very minor changes - cism2_1_45 and 46 are the git migration - -List all files eliminated: - -========= Handle externals via manage_externals rather than svn externals -D README_EXTERNALS -D SVN_EXTERNAL_DIRECTORIES -D SVN_EXTERNAL_DIRECTORIES.standalone - -List all files added and what they do: - -========= Added this directory and everything below it. Pulled in via - git subtree from - https://github.com/NCAR/manage_externals/. This is the new - tool for pulling in and updating externals (replacing svn - externals). -A manage_externals/ - -========= Handle externals via manage_externals rather than svn externals -A Externals.cfg -A Externals_CLM.cfg -A README_EXTERNALS.rst - -========= Handle new directory structure of standalone checkouts -A .config_files.xml - -========= Add some .gitignore files -A src/dyn_subgrid/.gitignore -A src/unit_test_shr/.gitignore -A src/unit_test_stubs/main/.gitignore -A src/unit_test_stubs/utils/.gitignore -A src/utils/.gitignore -A cime_config/.gitignore - -List all existing files that have been modified, and describe the changes: - -========= Handle new directory structure of standalone checkouts -M bld/CLMBuildNamelist.pm -M bld/configure -M cime_config/buildcpp -M cime_config/buildlib -M cime_config/buildnml -M src/CMakeLists.txt - -========= Documentation updates for move to git -M .CLMTrunkChecklist -M .gitignore -M LICENSE -M README.rst -M src/README.unit_testing - -========= Separately document expected fails for aux_clm vs fates test - lists -M cime_config/testdefs/ExpectedTestFails.xml - -========= ChangeLog now only stored in doc directory, not in top-level - directory -R095 .ChangeLog_template doc/.ChangeLog_template -R070 UpDateChangeLog.pl doc/UpdateChangelog.pl - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r272 -Originator(s): erik (Erik Kluzek) -Date: Thu Jan 25 01:17:01 MST 2018 -One-line Summary: Bring in latest FATES release version to CLM trunk: fates_s1.4.1_a3.0.0_rev2 - -Purpose of changes ------------------- - -Bring in the latest version of FATES from NGEET/fates-release and the associated interface -changes in CLM from NGEET/fates-clm. The new version is 1.4.1 for science and version 3.0 of -the API updated from 1.3.0 for science and 1.0.0 for the API. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CCTSM Issue #): #219 - #219 -- Options listed incorrectly in testlist_clm.xml - -Known bugs introduced in this tag (include github issue ID): (or found) - #216 -- PE layout for hcru_hcru needs to be increased so that it can run - #213 -- CPLHIST case is matching the wrong CLM_NML_USE_CASE - #212 -- Can't use a non-fates restart file to interpolate to a simulation with fates - #211 -- Can't handle interpolating from a fates restart file because of the cohort dimension - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): Simple FATES initial-condition - files were added for present day at f45 and 1x1_brazil. FATES IC can't be interpolated from - so you either have to have an exact match or do a cold start. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): New FATES namelist items: - use_fates_planthydro, use_fates_ed_st3, use_fates_ed_prescribed_phys, - use_fates_inventory_init, fates_inventory_ctrl_filename,use_fates_logging - -Changes made to namelist defaults (e.g., changed parameter values): when FATES on, non-fates finidat - files won't be matched - -Changes to the datasets (e.g., parameter, surface or initial files): New fates param file - and finidat files for f45 and 1x1_brazil - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: ed test list removed and updated fates list added in - with new version=2.0 format, fates test list now sets machine/compiler rather than - using generic "fates" for both. - -Code reviewed by: self, rgknox, ckoven - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (33 fates namelist tests are different) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_18_r271 - - -Answer changes --------------- - -Changes answers relative to baseline: Only simulations with fates on - - Summarize any changes to answers, i.e., - - what code configurations: Only "-bgc fates" - - what platforms/compilers: All - - nature of change: new climate, fates science updated from 1.3.0 to 1.4.1 - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): rtm, mosart, fates - rtm to rtm1_0_65 - mosart to mosart1_0_30 - fates to fates_s1.4.1_a3.0.0_rev2 - -List all files eliminated: - - fates test directory changed to one capitolized to be similar to new tests added - D components/clm/cime_config/testdefs/testmods_dirs/clm/fates/user_nl_clm - D components/clm/cime_config/testdefs/testmods_dirs/clm/fates/shell_commands - -List all files added and what they do: - - New tests for exercising more Fates options, all are based on the Fates test-mod - and add a few changes on top of it - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm ------- Short list of hist_fincl1 - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesShortList/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesST3/user_nl_clm ------------- use_fates_ed_st3=T - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesST3/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/user_nl_clm --------- Long list of FATES variables - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesAllVars/shell_commands ----- Cold-start - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesLogging/user_nl_clm -------- use_fates_logging=T - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesLogging/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm -------- Longer list of hist_fincl1 - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/shell_commands ----- Cold-start - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/user_nl_clm ---------- use_fates_ed_prescribed_phys=T - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesPPhys/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm -------------- Moved from fates directory, longer - hist_fincl1 list - A components/clm/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands ----------- Moved from fates directory, no longer - a cold-start - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/user_nl_clm -------- use_fates_spitfire=F - A components/clm/cime_config/testdefs/testmods_dirs/clm/FatesNoFire/include_user_mods - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/CLMBuildNamelist.pm - Handle new FATES namelist items, send - use_fates down for setting of finidat, if use_fates_inventory_init=T, make - sure fates_inventory_ctrl_filename is set - - M components/clm/bld/unit_testers/build-namelist_test.pl - Change ED to FATES, test new FATES features - - M components/clm/bld/namelist_files/namelist_defaults_overall.xml -- clm_start_type is arb_ic when use_fates=T - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Update fates var descriptsion, and add - new namelist items: use_fates_logging, use_fates_planthydro, use_fates_ed_st3, use_fates_ed_prescribed_phys, - use_fates_inventory_init, fates_inventory_ctrl_filename, remove use of ED for FATES - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Update fates_paramfile, use_init_interp=T - only if use_fates=F, add use_fates=F to init_interp_attributes, add use_fates setting for finidat files, - and add new f45 and 1x1_brazil FATES finidat files, by default new use_fates_* options are False. - - M components/clm/cime_config/config_compsets.xml ------------- Add a stub-GLC FATES compset: I2000Clm50FatesCruGs - M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- Many new expected fails for #221 and NGEET/fates#315 - M components/clm/cime_config/testdefs/testlist_clm.xml ------- Remove "ed" test-category, new "fates" test category - Move to after rather than nested inside (issue #219). - - M components/clm/src/utils/clmfates_paraminterfaceMod.F90 - Add write about dimension shape on abort - M components/clm/src/utils/clmfates_interfaceMod.F90 ------ New interface control variables, add call to - FatesReportParameters, use_fates_plant_hydro=>use_fates_planthydro, fix restart_map, zero_site=>init_site_vars - use numpft_ed - - M components/clm/src/main/decompInitMod.F90 --------- Set gi rather than ci for cohorts - M components/clm/src/main/subgridMod.F90 ------------ Add call subgrid_get_info_cohort, change subgrid_get_info_natveg call - M components/clm/src/main/histFileMod.F90 ----------- Change some of the parameter names, EDTypesMod interfaces get moved - to FatesInterfaceMod, nlevsclass_ed=>nlevsclass, maxpft=>numpft_ed, - M components/clm/src/main/controlMod.F90 ------------ Add new fates flags to namelist and broadcast/print them - M components/clm/src/main/clm_varctl.F90 ------------ New FATES flags, change ED=>FATES and some formatting - M components/clm/src/main/initGridCellsMod.F90 ------ ncohorts=>npatches - M components/clm/src/main/initVerticalMod.F90 ------- Remove call to ed_hist_scpfmaps - M components/clm/src/main/readParamsMod.F90 --------- Remove call to FatesReadParameters - M components/clm/src/biogeophys/CanopyFluxesMod.F90 - Add blank line - M components/clm/src/biogeophys/OzoneMod.F90 -------- Comment out setting of o3* variables to spval - - M components/clm/src/CMakeLists.txt -- Add fates/main to unit-test directories - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r271 -Originator(s): erik (Erik Kluzek) -Date: Sat Jan 20 20:27:00 MST 2018 -One-line Summary: Update testlist to v2 and remove yellowstone - -Purpose of changes ------------------- - -Redo the testlist in version 2 format and remove yellowstone from it. Also update mosart and rtm with updated -test lists. The new testlist format also allows wallclock times to be set (and they are) so that they can run -in the queue faster. Change some files that referenced bugzilla ID's to github issue #'s. Update tools testing -for gen_domain to use version under cime/tools rather than the copy under clm. - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include github issue ID): - #216 -- PE layout for hcru_hcru - #213 -- CPLHIST case is matching the wrong CLM_NML_USE_CASE - #212 -- Can't use a non-fates restart file to interpolate to a simulation with fates - #211 -- Can't handle interpolating from a fates restart file because of the cohort dimension - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - MEMLEAK, TPUTCOMP and MEMCOMP tests now seem to be robust and can be trusted. - -Changes to tests or testing: Test list completely redone - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- PASS - hobart_intel ------ PASS - -CLM tag used for the baseline comparisons: clm4_5_18_r270 - - -Answer changes --------------- - -Changes answers relative to baseline: no bit-for-bit, no source code changed - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, mosart, rtm - cime to clm4518/n02/cime5.4.0-alpha.03 which allows CLM grids in testlist - mosart to mosart1_0_29 with redone test list in v2 format - rtm to rtm1_0_64 with redone test list in v2 format - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M parse_cime.cs.status -- MEMLEAK, MEMCOMP, and TPUTCOMP don't need to be ignored anymore - - M .ChangeLog_template -- Remove bugzilla in place for github issue ids - - Update to test gen_domain under cime/tools rather than the copy under components/clm/tools/gen_domain - The copy won't be able to be done in the new github world. - M components/clm/test/tools/TBLCFGtools.sh ----- Set name of test directory by basename (so relative path can be passed in) - M components/clm/test/tools/input_tests_master - gen_domain path is relative to tools directory but under cime now - M components/clm/test/tools/test_driver.sh ----- Remove yellowstone set "--mpilib mpi-serial" for TOOLS CFG string - M components/clm/test/tools/TSMCFGtools.sh ----- Set name of test directory by basename - M components/clm/test/tools/TCBCFGtools.sh ----- Set name of test directory by basename - - M components/clm/bld/unit_testers/build-namelist_test.pl - Fix number of tests - - M components/clm/cime_config/testdefs/testlist_clm.xml ------- Completely redo in version 2 format - M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- Update to github issues rather than bugzilla - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r270 -Originator(s): sacks (Bill Sacks) -Date: Wed Dec 20 12:04:25 MST 2017 -One-line Summary: Always use multiple elevation classes for glacier, even with stub glc - -Purpose of changes ------------------- - -Up until now, we have been using the glacier_mec (multiple elevation -class) scheme when running with CISM, but the old non-elevation class -scheme when running with a stub glacier model (SGLC). This is -problematic because it means that simply switching from CISM to SGLC -fundamentally changes CLM's glacier physics. (Note: with the current -configuration, the multiple elevation class scheme is enabled over -Greenland and Antarctica but not elsewhere.) - -There are a few use cases where this is important: - -- Single-point and regional runs over glacier regions: In this case, you - cannot use CISM. Members of the LIWG want to do runs like this so they - can do single-point testing with the multiple elevation class scheme. - -- Currently, CISM does not support a Gregorian calendar (i.e., with leap - years). So cases with a Gregorian calendar need to use SGLC. This - includes data assimilation and CAM specified dynamics runs. We want - the physics of these runs to match the standard CLM physics as closely - as is feasible. - -- There may be other cases where a user doesn't want to include CISM - because of the extra complexity this involves, such as when setting up - a new grid (which would require additional mapping files for - CISM). Again, we want the physics of these runs to match the standard - CLM physics as closely as is feasible. - -Note that runs with SGLC will still differ somewhat from runs with CISM, -even when CISM is running in the typical NOEVOLVE mode. This is because -there will be differences in % glacier and topographic heights over -Greenland: in a run with CISM, this information comes from CISM at the -start of the run so that CLM and CISM agree in this respect; in a run -with SGLC this information comes from CLM's surface dataset. - -However: Running with SGLC now gives the same answers as running with -CISM with GLC_TWO_WAY_COUPLING set to FALSE. (These both differ from the -standard configuration that uses CISM with GLC_TWO_WAY_COUPLING TRUE -just over Greenland.) - -Mostly-unrelated change: Remove tropicAtl grid - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): -- https://github.com/ESCOMP/ctsm/issues/158 now causes test failures for - ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.yellowstone_pgi.clm-monthly, - since we're now using a new and buggy surface dataset for that case. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- If you use an finidat file from an old run that used SGLC, you'll need - to run init_interp and will need to set - init_interp_fill_missing_with_natveg = .true. in user_nl_clm. Note - that this will initialize glacier_mec landunits with information from - vegetated landunits, which is not a very good initialization, so - you'll want to spin up for a while to spin up the new glacier_mec - landunits. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): no - -Changes made to namelist defaults (e.g., changed parameter values): no - -Changes to the datasets (e.g., parameter, surface or initial files): -- New surface datasets for single-point and regional runs: These now - have the data necessary to run with the multiple elevation class - glacier scheme. None of our out-of-the-box single-point or regional - datasets have any glacier cover, so this doesn't lead to substantive - changes. Note, though, that the smallville datasets hadn't been - updated in a while, so there are bigger changes to the smallville - datasets. The new smallville datasets are buggy (due to - https://github.com/ESCOMP/ctsm/issues/158), but the old ones wouldn't - have worked with the new code due to missing glacier_mec - information. Note that I have NOT changed the landuse.timeseries - files, because those don't change in any substantive way with the - setting of -glc_nec in mksurfdata_map. - -- Runs with SGLC now point to different finidat files by default: they - now point to finidat files that were generated with glacier_mec, which - may differ substantially from the files that were generated without - glacier_mec (since I think these came from completely different - spinups). - -Substantial timing or memory changes: Expect some performance -degradation in SGLC runs, since now we're using multiple elevation -classes over Greenland and Antarctica, though I haven't investigated it -carefully. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Delete tropicAtl_subset tests: these tests -didn't provide much value, and the code they cover is also covered by -unit tests - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - prove test_build_namelist fails as on trunk - - main build-namelist tests pass, clm4_5 and clm5_0 lnd_in files - differ from trunk as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - ok - - Tests pass other than these known issues: - - smfg4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools - See https://github.com/ESCOMP/ctsm/issues/188 - - blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools - blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools - See https://github.com/ESCOMP/ctsm/issues/187 - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - ok - - 1 failure, as on the trunk - - compare tests: 40 PASS, 1 Fail; on the trunk, all 41 Failed. I'm - not sure why my branch improves things in this respect. - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi --- ok - yellowstone_gnu --- ok - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - Tests pass. Baseline comparisons fail for compsets with SGLC (both - global tests and single-point and regional tests). This is expected - and is described in detail below. - -CLM tag used for the baseline comparisons: clm4_5_18_r269 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All compsets with SGLC (as opposed to CISM) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Potentially new climate, though not investigated carefully - - Answers change in runs with SGLC due to the use of different - out-of-the-box finidat files: they now point to finidat files that - were generated with glacier_mec, which may differ substantially - from the files that were generated without glacier_mec (since I - think these came from completely different spinups). - - For global runs, even without finidat differences, answers change - over Greenland and Antarctica, since we're now using the - multiple-elevation-class scheme there. Answers are the same - outside of Greenland and Antarctica, where we still use a single - glacier elevation class. (Based on spot-checking FSH in a 3-year - cold start run.) - - (For single-point and regional runs, differences are mainly just - due to changes in finidat. One exception may be smallville tests, - since the smallville surface datasets have changed more - extensively; I did not investigate the smallville answer changes - carefully.) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime: cime5.4.0-alpha.03 -> billsacks/always_glcmec_n01 - The changes here are: - - always use GLC_NEC=10, except for CLM40 - - delete references to tropicAtl - -List all files eliminated: - -========= These glacierMEC use cases weren't accomplishing anything: - compared with the similar non-glacierMEC use cases, they just - set the glc_nec namelist variable, but this variable didn't - even exist! So I have switched cases to use the corresponding - non-glacierMEC use cases -D components/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml -D components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -D components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -D components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -D components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml -D components/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -D components/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - -========= This use case appeared to be unused -D components/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml - -========= These tropicAtl_subset tests were hard to maintain and didn't - provide much value: the code they covered is also covered via - unit tests -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/shell_commands -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/shell_commands -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/shell_commands -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/shell_commands -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset - - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Always use -glc_nec 10, delete tropicAtl, and other minor fixes -M components/clm/tools/mksurfdata_map/Makefile.data - -========= Require glc_nec >= 1 when making surface datasets -M components/clm/tools/mksurfdata_map/src/mkfileMod.F90 -M components/clm/tools/mksurfdata_map/src/mkglcmecMod.F90 -M components/clm/tools/mksurfdata_map/src/mksurfdat.F90 -M components/clm/tools/mksurfdata_map/mksurfdata.pl - -========= Require glc_nec >= 1 for clm45/clm50 -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/unit_testers/build-namelist_test.pl -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/cime_config/buildnml - -========= Remove istice; always use glacier_mec type -M components/clm/src/biogeochem/DryDepVelocity.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/LandunitType.F90 -M components/clm/src/main/TopoMod.F90 -M components/clm/src/main/filterMod.F90 -M components/clm/src/main/lnd2glcMod.F90 -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/subgridAveMod.F90 -M components/clm/src/main/initGridCellsMod.F90 -M components/clm/src/main/initVerticalMod.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/surfrdMod.F90 -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/landunit_varcon.F90 -M components/clm/src/main/subgridWeightsMod.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/subgridMod.F90 -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/histFileMod.F90 -M components/clm/src/main/restFileMod.F90 -M components/clm/src/biogeophys/WaterStateType.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/TemperatureType.F90 -M components/clm/src/biogeophys/SurfaceAlbedoMod.F90 -M components/clm/src/biogeophys/PhotosynthesisMod.F90 -M components/clm/src/biogeophys/CanopyTemperatureMod.F90 -M components/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 -M components/clm/src/biogeophys/SurfaceResistanceMod.F90 -M components/clm/src/biogeophys/TotalWaterAndHeatMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 -M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/dyn_subgrid/dynInitColumnsMod.F90 -M components/clm/src/dyn_subgrid/dynLandunitAreaMod.F90 -M components/clm/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf -M components/clm/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/cpl/clm_cpl_indices.F90 -M components/clm/src/cpl/lnd_import_export.F90 -M components/clm/src/cpl/lnd_comp_mct.F90 - -========= In addition to supporting the main changes of this tag, also - do a fairly major refactor: set fields internally rather than - letting lnd_import set the fields -M components/clm/src/main/glc2lndMod.F90 - -========= Fixes to unit tests for changes in glc2lnd -M components/clm/src/main/test/topo_test/test_topo.pf - -========= Remove tropicAtl tests and references to tropicAtl grid (see - above for more notes on this) -M components/clm/cime_config/testdefs/testlist_clm.xml -M components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M components/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -M components/clm/bld/namelist_files/namelist_defaults_overall.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M components/clm/bld/namelist_files/checkmapfiles.ncl -M components/clm/doc/UsersGuide/adding_files.xml - -========= No longer use glacierMEC-specific use cases (see above for - more notes on this) -M components/clm/cime_config/config_component.xml - -========= Fix creation date of files pointed to by tests -M components/clm/test/tools/nl_files/PTCLM_USUMB_clm4_5 -M components/clm/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 -M components/clm/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 - -========= No longer need init_interp_fill_missing_with_natveg (I think - this could have been removed a while ago) -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm - -========= New expected failure: - ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.yellowstone_pgi.clm-monthly -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r269 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sat Dec 16 19:49:41 MST 2017 -One-line Summary: Move externals to version in github - -Purpose of changes ------------------- - -Move the CLM externals to the version in github for MOSART, RTM and -PTCLM. For PTCLM this meant updating to a version that didn't take -advantage of subversion keywords. I also updated to a version that -can properly compare to the files it keeps even with differences -of user, machine, path, or date. - - -Bugs fixed or introduced None ------------------------- - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self,andre - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_18_r268 - - -Answer changes --------------- - -Changes answers relative to baseline: no bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): rtm, mosart, PTCLM - - mosart1_0_28 to github version - rtm1_0_63 to github version - PTCLM to PTCLM2_171216c and github version - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: None - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r268 -Originator(s): erik (Erik Kluzek) -Date: Mon Dec 11 16:47:24 MST 2017 -One-line Summary: Fix calculation of stomatal resistence used in dry-deposition, increase threshold of totvegc for soil decomposition to 0.1 - -Purpose of changes ------------------- - -Changes from Louisa Emmons to fix the calculation of stomatal resistence in the dry-deposition code so it's the inverse -of the previous calculation (and the arbitrary multiplicitive factor to reduce it was removed). Add new optional history -fields for dry-deposition. - -Increase the threshold of total vegetation carbon for when decomposition pools are reset from 1.e-8 to 0.1. This change comes from -Dave Lawrence and Keith Oleson. The code was also modified to use better names for this rather than ccrit and ncrit which came in -clm4_5_17_r264. Add some new checking for these settings at initialization. Add some changes to the default CMIP6 output from -Keith Oleson. - -Add in f05 fsurdat and one landuse.timeseries datasets. Add check in SSP test that makes sure the compset used includes MOSART as -expected. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2545, 2546 - 2526 -- Fix calculation of stomatal resistance for dry deposition - 2545 -- SSP test assumes that MOSART is being used, and dies inexplicably if not - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Add new optional history fields when drydeposition is on: DRYDEPV_*, RS_DRYDEP_O3 - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files) Add f05 fsurdat and one landuse.timeseries file: - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - RS_DRYDEP_O3 history field is hardcoded for Ozone. In most cases the same value would apply to other species, but it is - hardcoded to give values for Ozone. - -Changes to tests or testing: Add ciso SSP test - -Code reviewed by: self,tilmes,emmons,fvitt - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_18_r267 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, but only for drydep and/or exit_spinup - - Summarize any changes to answers, i.e., - - what code configurations: with drydep on, or in exit_spinup mode for either clm4_5 or clm5_0 - - what platforms/compilers: All - - nature of change: modest - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: Add new ciso_rtmColdSSP testmod -- includes ciso and rtmColdSSP testmods - - A /clm/cime_config/testdefs/testmods_dirs/clm/ciso_rtmColdSSP/include_user_mods - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/unit_testers/build-namelist_test.pl -- Increase test numbers as now testing f05 datasets - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ---- Add f05 fsurdat files and one landuse.timeseries file - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- Add f05 to list of supported resolutions - - M components/clm/cime_config/testdefs/testlist_clm.xml --------------- Add SSP ciso test - M components/clm/cime_config/usermods_dirs/cmip6_output/user_nl_clm -- Added FCTR, FCEV, FGEV, FIRE, FSR, and HTOP; - and removed QVEGT; all from the h1 file (fincl2) (from Keith Oleson) - M /clm/cime_config/SystemTests/ssp.py ---------------------- Update comments, add expect that compset uses mosart - - M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 --- Change ncrit to totvegcthresh and SetNCrit to SetTotVgCThresh - add abort if totvegcthresh is unset, and check that it's greater than zero - M components/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 - Set totvegcthresh to 0.1 and pass down via setTotVgCThresh methods - M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 ----- Change ccrit to totvegcthresh and SetNCrit to SetTotVgCThresh - add abort if totvegcthresh is unset, and check that it's greater than zero - M components/clm/src/biogeochem/DryDepVelocity.F90 ------------------------ Modifications from Louisa Emmons, Corrected the equation - calculating stomatal resistance from rssun and rssha, add new array rs_drydep_patch, add new history - output possibilities: DRYDEPV_*, RS_DRYDEP_O3, use spval instead of hardcoded magic number 1.e36 - -=============================================================== -=============================================================== -Tag name: clm4_5_18_r267 -Originator(s): sacks (Bill Sacks) -Date: Thu Dec 7 19:26:48 MST 2017 -One-line Summary: Fixes to accumulator fields - -Purpose of changes ------------------- - -(1) Only accumulate accumulators over active (typically, - non-zero-weight) patches/columns. This changes answers for transient - runs. Previously, accumulator fields were being accumulated even - when a patch/column was inactive. In many cases this was relatively - harmless, but in some cases it was accumulating garbage like - spval. Then, once the point became active, it could take a while for - the garbage accumulated values to be worked out. - - This changes answers for transient runs. I have examined all - accumulator fields used in a typical BgcCrop run (this does NOT - include fields that are only used for CNDV or FATES). Most changes - only last for the first month or so that a point is active, but - there are larger changes for: - - - PREC10 and PREC60: The changes in these are probably the most - extreme. In the old code, these started as spval (rather than a - blank slate) over newly-active patches. PREC10 is garbage for the - first few years after a point becomes active. I didn't look at - PREC60, but its logic is the same as PREC10, so I would expect it - to be garbage for about the first 20 years after a point becomes - active. PREC10 is used in the fire code and for stress deciduous - phenology. PREC60 is used in the fire code. - - - AnnET: In the old code, this started as 0 (rather than a blank - slate) over newly-active points. This affects answers for the - first year or two. This is used in N fixation code. - - - FSUN24 and FSUN240: In the old code, these started out as spval; - it takes a few years for the FSUN240 accumulator to come back down - to reasonable values (even though it's a 10-day accumulator, its - "exponential running average" behavior means that it takes much - longer for memory of a huge value like spval to disappear). These - are just used in VOCEmissionsMod. - - I have not investigated how much these changes in accumulators - affect the science of the model. The biggest effects will probably - be in the fire code in transient runs, but I haven't looked at how - big of an effect these errors in PREC60 have. - - There are also potentially very large changes in CNDV, due to change - in behavior of some patch-level accumulators which are needed for - PFT establishment (and thus should be available over inactive - patches, but no longer are valid for inactive patches). However, - these fields were already buggy (see bug 2537). - -(2) For startup/hybrid runs with non-blank finidat (including runs with - use_init_interp): Continue accumulating continuously from where - things were in the finidat file. Previously, many of the - accumulators were being reset in startup/hybrid runs. This appeared - to be an accident of the implementation details, whose fix was easy - as a side-effect of the fix for (1). This shouldn't have a huge - effect: most accumulators are order 10 days, with the longest being - 365 days, so differences should work themselves out within the first - year or so. But this could be important if you expect a spinup run - to transition continuously into a transient run (for example). - - This changes answers for any startup or hybrid case with non-blank - finidat, where the restart file is from this tag or later. It does - NOT change answers for old restart files. (These old files are - missing the new _NSTEPS fields associated with each accumulator - field, and so nsteps values are set to 0 in a startup/hybrid run, - similarly to the old behavior.) - -Also, a somewhat-unrelated change: Abort if a field is missing from the -restart file in a branch run (just as we do for a continue run); tell -the user to do a startup or hybrid run in this case. My reason for -folding this change into this tag was so that I don't need to worry -about backwards compatibility of branch runs with old restart files. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2526: Some CLM accumulated fields (via accumulMod) are incorrect with dynamic landunits - -Known bugs introduced in this tag (include bugzilla ID): -- The following pre-existing bugs may be somewhat worse now: - - 2537: Climate accumulator fields incorrect for CNDV - - 2539: CNDV logic for agdd20 and tmomin20 needs to be revised to - account for when a given patch/column becomes active - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -- Can no longer do a branch run if some fields are missing from the - restart file, either due to code changes or configuration changes (need - to do hybrid or startup). - -- Cannot do a branch from restart files generated with prior tags, - because the _NSTEPS restart fields associated with accumulation fields - are missing. - -- Startup or hybrid runs using restart files that were generated from - prior tags will not take advantage of fix (2) above. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi --- ok - yellowstone_gnu --- ok - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answer changes as expected (see below) - -CLM tag used for the baseline comparisons: clm4_5_17_r266 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - Cases with transient vegetation (Hist, Dv) - - Startup / hybrid cases using restart files generated from this - code base. In the test suite, this just shows up as answer - changes in ERI and SSP tests, since other tests use old initial - conditions files. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff. Not yet investigated as to whether this is - the same or different climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Cover accumulMod with unit tests -A components/clm/src/main/test/accumul_test/test_accumul.pf -A components/clm/src/main/test/accumul_test/CMakeLists.txt -A components/clm/src/main/test/accumul_test - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/main/accumulMod.F90 -M components/clm/src/biogeophys/TemperatureType.F90 - -========= Change PREC365 to col-level: with these changes, when it was - at patch-level, it would be invalid over not-yet-active - patches - yet it's needed there for the sake of PFT - establishment in CNDV. Also initialize pbot to spval now that - bug 2526 is resolved. -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/biogeochem/CNDVEstablishmentMod.F90 - -========= Need 'active' flag in gridcell_type (always true), so that - gridcell_type has the same interface as other subgrid types in - this respect -M components/clm/src/main/GridcellType.F90 - -========= Abort if a field is missing from the restart file in a branch - run (see above for details) -M components/clm/src/utils/restUtilMod.F90.in - -========= Cover accumulMod with unit tests -M components/clm/src/main/test/CMakeLists.txt - -========= Changes needed so that code under test can call get_proc_bounds -M components/clm/src/unit_test_shr/unittestSubgridMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_17_r266 -Originator(s): sacks (Bill Sacks) -Date: Mon Nov 27 19:43:39 MST 2017 -One-line Summary: Avoid negative snow densities - -Purpose of changes ------------------- - -For very low temperatures, fresh snow densities were negative. This was -only happening at extremely low temperatures (below -100 deg C), but -caused snow balance errors when it occurred. - -In exploring the LoTmpDnsSlater2017 parameterization in -NewSnowBulkDensity, I came away with the following thoughts: - - It seems like there should be a limit on the temperature-dependent - bifall value. I extracted this function into python and played with - it for a few minutes: - - else if (new_snow_density == LoTmpDnsSlater2017) then - ! Andrew Slater: A temp of about -15C gives the nicest - ! "blower" powder, but as you get colder the flake size decreases so - ! density goes up. e.g. the smaller snow crystals from the Arctic and Antarctic - ! winters - bifall(c) = -(50._r8/15._r8 + 0.0333_r8*15_r8)*(forc_t(c)-tfrz) - 0.0333_r8*(forc_t(c)-tfrz)**2 - end if - - It looks like the intention is to have snow densities that increase - with decreasing temperature (below -15 C), but the effect of this - parabolic function is to have densities start coming back down as - temperature decreases too low (below about -58 C). My sense is that - we should do one of the following in the above block of code: - - (1) Limit bifall(c) to be no less than 50... my read of this code is - that temperature-dependent bifall is never meant to go below 50. - - (2) For this cold-temperature-based bifall, use an "effective" forc_t - that is never colder than about -58 C – or the point at which this - function begins to decrease with further-decreasing temperatures. (We - could determine the exact temperature at which this function turns - over... -58 C is just an approximation.) I'm not positive that this - is what's intended, but my read of the comment suggests that - densities were never intended to start decreasing with - further-cooling temperatures. - -See comments and figures in -http://bugs.cgd.ucar.edu/show_bug.cgi?id=2536 for more details. - -Leo van Kampenhout and Jan Lenaerts support limitation option 2, which -is my preference as well. Thus, this tag implements that limitation. - -This change changes answers for (downscaled) atmospheric forcing -temperatures below -57.55 deg C. These very low temperatures are rare, -but they do sometimes occur, both in coupled runs and in offline runs. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2536: Snow balance error - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Leo van Kampenhout - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi --- ok - yellowstone_gnu --- ok - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answers change as expected - -CLM tag used for the baseline comparisons: clm4_5_17_r265 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff/same climate - - Many (but not all) tests show answer changes. Answers should only - change for (downscaled) forcing temperatures below -57.55 deg C. I - spot-checked one test with answer changes - (SMS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-default). I - checked H2OSNO and FSH in this test, in the last day's h0 file; - these fields differ (relative to the baseline) in only one - gridcell. TBOT was about -55 deg C in the daily average of the - last day, so it seems reasonable that this forcing temperature was - below -57.55 deg C at some point in the 3-day simulation. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf - -=============================================================== -=============================================================== -Tag name: clm4_5_17_r265 -Originator(s): erik (Erik Kluzek) -Date: Sat Nov 18 12:40:20 MST 2017 -One-line Summary: Update the clm50 parameter file for better behavior with prognostic crop, and fix a bug in clm50 urban model - -Purpose of changes ------------------- - -Update a few parameters to tweak prognostic crop harvest yields, adjusting FUN costs, and changing C4 crops and -wheat by Keith Oleson, Dave Lawrence, and Danica Lombardozzi. Danica had this to say: - Overall, the wheat parameters work well (give us correct Fertilized - Unfertilized behavior - and reasonable crop yields), but the C4 crop parameters are less satisfying. The 2A parameter - changes still have trouble with the fertilized - unfertilized behavior in some regions and - lower yields, but seems to be the best combined set of behaviors since there seems to be - a direct tradeoff between the fertilized behavior and crop yields - -Also a fix to urban initialization of rootfr for pervious road. It had used a magic number to assuming nlevsoi -was 10. Now we divide by the actual nlevsoi. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2434 - 2434 -- urban assumed to have 10 soil layers - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): clm50 params file - -Changes to the datasets (e.g., parameter, surface or initial files): clm50 parameter file - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self,oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_17_r264 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, for CLM50 - - Summarize any changes to answers, i.e., - - what code configurations: all clm50 (except non-urban and non-crop) - - what platforms/compilers: all - - nature of change: crop behavior changes, urban working better - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- new params file -M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 ----- Divide by nlevsoi - rather than assume nlevsoi is 10 with a magic number. - -=============================================================== -=============================================================== -Tag name: clm4_5_17_r264 -Originator(s): erik (Erik Kluzek) -Date: Thu Nov 16 13:35:59 MST 2017 -One-line Summary: Changes from Dave Lawrenece on resetting soil carbon for spinup - -Purpose of changes ------------------- - -Changes from Dave Lawrence so that total vegetation carbon (totvegc) is used for resetting soil carbon -stocks during the AD spinup exit (to determine if you should reset both carbon and nitrogen). Also read -in totvegc for C13, and C14. These are then passed down into soilbiogechemistry nitrogenstate and carbonstate -restart to determine if the decomposition pools should be reset. The resetting is only done over non-crop -vegetation (ignoring both prognostic and generic crop types) and is only done on the exit_spinup phase -going out of accellerated decomposition mode. - -Fix a couple small issues that in principle could change answers, but we didn't see answer changes in testing. -There was an error in how rootfr was initialized if it wasn't on the restart file. Made sure the crop patch -level restart variables are read after the enter_spinup code. - -Bugs fixed or introduced ------------------------- - 2406 -- Crop patch-level restart variables read after enter_spinup code - 2426 -- Error in rootfr for SoilStateType restart - 2447 -- dayl_factor not just exactly zero, but small - -Bugs fixed (include bugzilla ID): - -Known bugs introduced in this tag (include bugzilla ID): Following found - 2534 -- rootfr_road_perv calculation now incorrect for CLM50 - 2533 -- c13/c14 isotope time-series is awkward for 1850 control (convert to streams file) - 2531 -- FATES doesn't call SoilBiogeochemCompetitionInit - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - SetNCrit in SoilBiogeochemNitrogenStateType.F90, should be SetCCrit, because totvegc is - used rather than totvegn. - SoilBiogeochemPrecisionControlInit was added as a new method that could be extended to - set ncrit and ccrit from namelist, or to set them from the settings for CNPrecisionControl - that are read in by namelist - -Changes to tests or testing: None - -Code reviewed by: self,dlawren - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular (without testing on cheyenne when tag was made) - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- Ran on yellowstone OK - cheyenne_gnu ------ Ran on yellowstone OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_17_r263 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, but only for spinup! - - Summarize any changes to answers, i.e., - - what code configurations: Only during spinup (at exit_spinup stage) - - what platforms/compilers: All - - nature of change: minor for spinup - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - M components/clm/src/biogeochem/CNVegCarbonStateType.F90 --- Add totvegc_col (and cor c13/c14) to restart - M components/clm/src/biogeochem/CNVegetationFacade.F90 ----- Add get_totvegc_col to get the column level totvegc - M components/clm/src/main/clm_initializeMod.F90 ------------ Remove use of CNDriverInit, not needed - M components/clm/src/main/clm_instMod.F90 ------------------ Add call to SoilBiogeochemCompetitionInit - do vegetation restart before soil bgc restart, pass totvegc down to soilbiogeochem_carbonstate restart (and nitrogenstate) - M components/clm/src/biogeophys/PhotosynthesisMod.F90 ------ Fix bug 2447 checking for small dayl_factor and not just exactly zero - M components/clm/src/biogeophys/SoilStateType.F90 ---------- Fix bug 2446 initialize rootfr only if rootfr not read in - M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 ---- Add SetNCrit to set new module variable ncrit - pass totvegc_col into restart, if it is lower than ncrit (and not crop) reset decomposition pools to zero - M components/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 -- Add SoilBiogeochemPrecisionControlInit, to set - ncrit and ccrit now module variables and pass them down to carbonstate and nitrogenstate - M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 ------ Add SetCCrit to set new module variable ccrit - pass totvegc_col into restart, if it is lower than ccrit (and not crop) reset decomposition pools to zero - save restart_file_spinup_state and read it in with C12 - -=============================================================== -=============================================================== -Tag name: clm4_5_17_r263 -Originator(s): erik (Erik Kluzek) -Date: Wed Nov 8 15:36:41 MST 2017 -One-line Summary: Drydep vel. for SO2 doubled, influence of organic mater in soil calmed, max daylength not hardwired to present day - -Purpose of changes ------------------- - -Keep the hydraulic conductivity for organic soil higher than it is for mineral soil. This was found to be an issue and fixed by -Sean Swenson, Dave Lawrence, and Keith Oleson. Double dry deposition velocity for SO2 (Jean-Francois Lamaruque) for both clm4_5 -and clm5_0. Fix bug for value of NACTIVE at first time-step. Partial fix so that max daylengh isn't hardwired to present day at least -at initialization (see caveat below). Move the sample files for the mkprocdata_map tool (for mapping between unstructured grids -and regular lat lon grids) out of CLM and into $CSMDATA. Update the c13/c14 timeseries files to the 2.0 version as per Keith Lindsay. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2530 -- organic soil influence varies wildly - 2304 -- NACTIVE at first time step - 1843 -- Max daylength now uses orbital parameters at initialization rather than hardwired to present day (partial) - -Known bugs introduced in this tag: - 2529 -- SSP case that runs on cheyenne fails on hobart - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): c13/c14 time-series files - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Max daylength will still be wrong in cases where variable_years is used, where the orbit - changes after initializaiton. It'll start out correct and begin to diverge each year. - Since, this feature is untested it's not worth going through the additional changes to - correct it during the run. - - At the time the tag was made, cheyenne was down, so there are six tests that weren't confirmed to pass: - ERS_D_Ld3.f19_f19_mg16.IHistClm40SpCruGs.cheyenne_intel.clm-40default - ERS_Ly5_P60x1.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - SMS_D_Ld5.f10_f10_musgs.I2000Clm50Fates.cheyenne_intel.clm-fates - SMS_D_Ly2.1x1_numaIA.IHistClm50BgcCropGs.cheyenne_intel.clm-ciso_bombspike1963 - SMS_Ld1.f19_f19_mg16.IHistClm40SpCruGs.cheyenne_intel.clm-40default - SMS_Ld1.f19_g17.I2000Clm50Vic.cheyenne_intel.clm-default - -Changes to tests or testing: tools testing modified to point to files in CSMDATA - -Code reviewed by: self,lamar,oleson,sacks,dlawren - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_16_r262 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: changes answers with bug fixes in a significant way - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: oleson/csm/clm50_r243_1deg_GSWP3V2_cropopt_nsc_hksat_hist - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - - Remove sample files, move to CSMDATA, remove sample namelist - D components/clm/tools/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc - D components/clm/tools/mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc - D components/clm/tools/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc - D components/clm/tools/mkprocdata_map/mkprocdata_map_in - -List all files added and what they do: - - A components/clm/tools/mkprocdata_map/README.filedescriptions -- Describe the files in this directory - -List all existing files that have been modified, and describe the changes: - - M components/clm/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 - Point to files in CSMDATA rather than mkprocdata_map dir. - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- Point to new v2.0 of the c13/c14 timeseries files - - M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 -- Fix bug 2530 for organic mater influence in soil - M components/clm/src/biogeochem/DryDepVelocity.F90 ------------- Double SO2 dry deposition rate - M components/clm/src/biogeochem/CNFUNMod.F90 ------------------- Bug, 2304 for NACTIVE on history for first time-step - M components/clm/src/biogeochem/ch4Mod.F90 --------------------- Bug, 2528, floating overflow for methane (doesn't change answers) - M components/clm/src/main/clm_initializeMod.F90 ---------------- Bug, 1843, max daylength no longer hardwired to present day at initialization - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r262 -Originator(s): sacks (Bill Sacks) -Date: Fri Oct 27 10:17:54 MDT 2017 -One-line Summary: Rename atm2lnd history fields for downscaled fields, properly turn on vic for clm45, and other minor fixes - -Purpose of changes ------------------- - -(1) Rename atm2lnd history fields for downscaled fields. The downscaled - version is now the default. Non-downscaled history fields are now - noted explicitly with a "_FROM_ATM" suffix. A detailed list of - changes is given below. - -(2) Properly turn on VIC for CLM45 compsets (fixes bug 2465) - -(3) Use correct PE layouts for CISM1 - -(4) Remove CWDC_HR diagnostic field, which was always 0 (fixes bug 2502) - -(5) Turn on U10_DUST diagnostic field by default (fixes bug 2246) - -(6) Fix documentation of some variables - -Detailed list of changes related to (1): - - Rain and snow: - - Old: - - RAIN: "atmospheric rain" - NOT downscaled - - Rainf: "atmospheric rain" - NOT downscaled - - SNOW: "atmospheric snow" - NOT downscaled - - RAIN_REPARTITIONED: "atmospheric rain, after rain/snow repartitioning based on temperature" - DOWNSCALED - - SNOW_REPARTITIONED: "atmospheric snow, after rain/snow repartitioning based on temperature" - DOWNSCALED - - New: - - RAIN: "atmospheric rain, after rain/snow repartitioning based on temperature" - DOWNSCALED - - Rainf: "atmospheric rain, after rain/snow repartitioning based on temperature" - DOWNSCALED - - SNOW: "atmospheric snow, after rain/snow repartitioning based on temperature" - DOWNSCALED - - RAIN_FROM_ATM: "atmospheric rain received from atmosphere (pre-repartitioning)" - NOT downscaled - - SNOW_FROM_ATM: "atmospheric snow received from atmosphere (pre-repartitioning)" - NOT downscaled - - Air temperature: - - Old: - - TBOT: "atmospheric air temperature" - NOT downscaled - - Tair: "atmospheric air temperature" - NOT downscaled - - Tair_downscaled: "atmospheric air temperature downscaled to columns" - DOWNSCALED - - New: - - TBOT: "atmospheric air temperature (downscaled to columns in glacier regions)" - DOWNSCALED - - Tair: "atmospheric air temperature (downscaled to columns in glacier regions)" - DOWNSCALED - - Tair_from_atm: "atmospheric air temperature received from atmosphere (pre-downscaling)" - NOT downscaled - - Atmospheric pressure: - - Old: - - PBOT: "atmospheric pressure" - NOT downscaled - - Psurf: "surface pressure" - NOT downscaled - - New: - - PBOT: "atmospheric pressure at surface (downscaled to columns in glacier regions)" - DOWNSCALED - - Psurf: "atmospheric pressure at surface (downscaled to columns in glacier regions)" - DOWNSCALED - - Atmospheric longwave radiation: - - Old: - - FLDS: "atmospheric longwave radiation" - NOT downscaled - - LWdown: "atmospheric longwave radiation" - NOT downscaled - - New: - - FLDS: "atmospheric longwave radiation (downscaled to columns in glacier regions)" - DOWNSCALED - - LWdown: "atmospheric longwave radiation (downscaled to columns in glacier regions)" - DOWNSCALED - - Potential temperature: - - Old: - - THBOT: "atmospheric air potential temperature" - NOT downscaled - - New - - THBOT: "atmospheric air potential temperature (downscaled to columns in glacier regions)" - DOWNSCALED - - Specific humidity: - - Old: - - QBOT: "atmospheric specific humidity" - NOT downscaled - - Qair: "atmospheric specific humidity" - NOT downscaled - - New: - - QBOT: "atmospheric specific humidity (downscaled to columns in glacier regions)" - DOWNSCALED - - Qair: "atmospheric specific humidity (downscaled to columns in glacier regions)" - DOWNSCALED - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2192: wrong units in comment for variables qflx_ev_snow, qflx_ev_soil, - qflx_ev_h2osfc -- 2246: Turn on U10_DUST history field variable by default -- 2363: inline documentation is wrong in SoilTemperatureMod.F90 -- 2401: Need to put in an "override" for PE layouts for CISM1 -- 2465: ICLM45VIC compset doesn't actually turn VIC on -- 2502: CWDC_HR is identically zero -- 2503: Wrong units for FAREA_BURNED - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changed meaning of some atm2lnd history fields: see above - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self; Sean Swenson did a conceptual review of the -changes in atm2lnd diagnostic fields - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi --- ok - yellowstone_gnu --- ok - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answers change for some atm2lnd diagnostic - fields as noted below - -CLM tag used for the baseline comparisons: clm4_5_16_r261 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - For most configurations: Changes diagnostic fields only (see - below for list) - - Changes CLM45 compsets with VIC: actually turns on VIC (there - are no CLM45 tests with VIC in the test suite) - - Changes the following fields: FLDS, PBOT, QBOT, RAIN, SNOW, TBOT, - THBOT: These now give downscaled versions of these fields. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Rename atm2lnd history fields for downscaled fields -M components/clm/src/main/atm2lndType.F90 - -========= Properly turn on VIC for CLM45 compsets -M components/clm/cime_config/config_component.xml - -========= Use correct PE layouts for cism1 -M components/clm/cime_config/config_pes.xml - -========= Remove CWDC_HR diagnostic field -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 - -========= Turn on U10_DUST by default -M components/clm/src/biogeophys/FrictionVelocityMod.F90 - -========= Fix various documentation -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/src/biogeophys/BareGroundFluxesMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/SoilFluxesMod.F90 -M components/clm/src/biogeophys/CanopyFluxesMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeochem/CNVegStateType.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r261 -Originator(s): sacks (Bill Sacks) -Date: Wed Oct 25 07:37:24 MDT 2017 -One-line Summary: Add option to reset snow over glacier columns - -Purpose of changes ------------------- - -We have had an option to reset snow over non-glacier columns, using the -reset_snow namelist variable. This is useful when transitioning from a -spinup with one set of atmospheric forcings to a run with substantially -different atmospheric forcings. We originally did not provide an option -to reset snow over glacier columns, because we couldn't find a -satisfactory way to determine which glacier columns should and should -not be reset. However, members of the LIWG have found that it's hard to -analyze some test runs without this option. - -This tag, therefore, provides an option to reset snow over glacier -columns, using a new namelist flag reset_snow_glc. You can optionally -provide an elevation threshold for this resetting: By setting -reset_snow_glc_ela to some elevation (in meters), only glacier columns -below this elevation get their snow packs reset. Note that you run the -risk of baking in answers with this (how much of the resulting spatial -patterns are due to your choice of where to reset snow?), but this can -still be useful in some cases. In general, this is meant for testing, -and not for "real" scientific production runs. - -Original changes were from Leo van Kampenhout, with some refactoring by -Bill Sacks. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): -- 2525: test_build_namelist.pl fails in clm4_5_16_r260 - (this bug existed prior to this tag, but was first discovered here) - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variables: - - reset_snow_glc: logical; if set to .true., resets the snow pack over - glacier columns - - reset_snow_glc_ela: elevation threshold for resetting snow pack over - glacier columns - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- reseedresetsnow testmod turns on snow resetting over glacier points, - and so changes answers. It uses the reset_snow_glc_ela threshold that - Leo has been using. - -Code reviewed by: self, Leo van Kampenhout - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok (run on yellowstone) - Tests in build-namelist_test.pl pass but change answers as expected - due to new namelist options. - - NOTE: prove test_build_namelist.pl fails (see bug 2525) - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi --- ok - yellowstone_gnu --- ok - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, NLCOMP failures as expected. Also, expected - baseline failure: - ERS_D.f19_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-reseedresetsnow - - However, there were also baseline failures in these tests, due to - problems with r260: - - (1) - - SMS_Ld5.f19_g17.IHistClm50Bgc.cheyenne_intel.clm-decStart - SMS_Ld5.f19_g17.IHistClm50Bgc.yellowstone_pgi.clm-decStart - SMS_Ld5.f19_g17.IHistClm50Bgc.yellowstone_intel.clm-decStart - - These are due to problems with the baseline, in terms of which cism - history files are present. Baseline comparisons failed in the same - way when using out-of-the-box r260. The current code seems correct - in this respect, so this is just a problem with the baseline - directories. - - (2) - - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - - Differences in C14 history fields. Baseline comparisons failed in - the same way when using out-of-the-box r260. I can't tell if the - baselines are correct or the trunk code is correct. I have asked - Erik to look into this. - -CLM tag used for the baseline comparisons: clm4_5_16_r260 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Only tests with reseedresetsnow testmod - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - new climate for tests with this testmod - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Unit tests of new changes -M components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf - -========= Pass down new arguments -M components/clm/src/main/clm_driver.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 - -========= New namelist variables -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Changes to reseedresetsnow testmod to turn on the new option -M components/clm/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r260 -Originator(s): erik (Erik Kluzek) -Date: Tue Oct 24 15:59:41 MDT 2017 -One-line Summary: Update paramater file for CLM50 as well as fates, fix a few issues - -Purpose of changes ------------------- - -Update the parameter file for CLM5.0, changing: ekc_active,ekn_active,kn_nonmyc,psi50, and stem_leaf. Dave Lawrence, -Keith Oleson, Will Wieder, and Rosie Fischer were involved in changing these parameters to increase survivability of -BDT Tropical and NDT Boreal and to slightly decrease the over-productivity of BDS boreal. - -The version of FATES used was updated to one with the same API, but updated science (science_1.3.0 api_1.0.0). - -There were a couple issues fixed as well. PTCLM was updated to fix a few issues and also allow us to test running -with an updated PTCLM user-mods-directory. So the US-UMB testing was updated to point to a freshly created directory. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2524 -- Run with decStart tests - 2523 -- Run with cnonly - 2522 -- PTCLMmkdata doesn't handle crop on or off well in latest CLM45/CLM50 - 2521 -- Add warning for when PTCLMmkdata sets MPILIB to mpi-serial by default - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - -crop option becomes a toggle for CLM_BLDNML_OPTS (so -no-crop is valid as well) - Same setup for mksurfdata.pl was introduced as well (and for PTCLMmkdata) - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New parameter file for CLM5.0 - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: USUMB tests updated, tests for PTCLM updated - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (118 compare tests fail) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK (one expected fail) - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_16_r259 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for CLM50 and/or with fates - - Summarize any changes to answers, i.e., - - what code configurations: all configurations with CLM50 or CLM45 with Fates - - what platforms/compilers: All - - nature of change: Improvements in survivability of certain trees - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): PTCLM - - PTCLM to PTCLM2_171024b - -List all files eliminated: None - -List all files added and what they do: Missing file from previous tag - - A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart/user_nl_cism - -List all existing files that have been modified, and describe the changes: - - M components/clm/test/tools/TSMscript_tools.sh --------------------- Update PTCLM version of mapping data being pointed to - M components/clm/test/tools/nl_files/mksrfdt_10x15_1850 ------------ Change -no_crop option to -no-crop - M components/clm/test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 - Change -no_crop option to -no-crop - M components/clm/tools/mksurfdata_map/mksurfdata.pl ---------------- Change -no_crop option to -no-crop toggle - M components/clm/bld/CLMBuildNamelist.pm --------------------------- Change -crop option to a toggle (so -no-crop is valid) - Fix bug 2523 by setting bgc_spinup - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Update parameter file for CLM50 - M components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm ---- Point to c171024 version of PTCLM data - M components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands - Point to c171024 version of PTCLM data - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r259 -Originator(s): erik (Erik Kluzek) -Date: Tue Oct 17 10:39:36 MDT 2017 -One-line Summary: Update to latest cime from cesm2_0_beta07 and config_components version 3 - -Purpose of changes ------------------- - -Update CLM to use version 3 for config_components.xml which has additional error checking of compset names. Also -update it for mosart, cism and rtm. And cime is updated to the version used in cesm2_0_beta07. There are a few -new features brought in with the latest cime that are described below. CLM now requires one and only one modifier -for what type it is in the compset name (i.e. only one "%" as in CLM45%BGC or CLM50%SP). Will now abort when -CLM build-namelist encounters a warning (after printing information on all warnings). To ignore the warnings -and continue add the new "-ignore_warnings" to CLM_BLDNML_OPTS. "-irrig" is now an option to CLM_BLDNML_OPTS -only for clm4_0, set "irrigate" namelist item in your user_nl_clm file for clm4_5 or clm5_0. By default build-namelist -sets irrigate to true for transient or present-day configurations if crop is on and clm5_0 (unless DV on). Get PTCLMmkdata fully -converted over to cheyenne, and create a new set of files for testing it's ability to create cases. Checking for -.true. or .false. in CLM build-namelist is now more robust and allows for "F" or "T" as newer FORTRAN versions do. - - -Fix several bugs as described below. PTCLM and CLM tools were both verified to work and pass testing. -The PE layout for f10 on hobart was changed to a single-node so that it would compare exactly to previous versions. -Fix a bug for NCK tests in RTM and MOSART. Get mksurfdata_map working correctly for f05. Error message when -you set finidat=' ' is more clear on what to do. You can also now do a cold-start for a hybrid case prints a warning), -but not allowed on a branch case. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2519 -- Trouble setting use_aereoxid_prog=.false./ - 2515 -- Setting finidat=' ' gives cryptic error message - 2510 -- Mapping files from the 1km grid can only be created on geyser - 2509 -- Bad mapping files for f05 resolution - 2504 -- hybrid/branch cases don't allow CLM_FORCE_COLDSTART to be on - 2494 -- MOSART test NLCOMP fails due to duplicate mosart_inparam in user_nl_mosart - 2477 -- Multiinstance mosart with REFCASE does not initialize - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - This includes an update to cime, so some behavior is a little different than before (see section below) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - CLM now allows one and only one modifier for the type of configuration in the compset name - (i.e. CLM50%BGC or CLM45%SP (only one "%" modifier is allowed) ). "-irrig" is now only allowed as an option - to CLM_BLDNML_OPTS for clm4_0, for clm4_5/clm5_0 the handling of irrigate is handled inside CLM build-namelist. - Remove some no longer needed forcing definitions for compsets (the year range at the beginning of the compset name). - Now abort on build-namelist warnings (but adding "-ignore_warnings" option to CLM_BLDNML_OPTS allow it to run without it). - Remove compset forcings that aren't being used: 5505, C2R6, C2R8, C2R4, C1, GEOS (start of long compset names) - -Changes to CIME user interface: -- Eleminate --user-compset. Clean up caseroot directory upon failed creation. -- Check coupler fields for nan. -- New xml variable, readmode, -- xmlquery --group has been changed go xmlquery --get-group -- New case.qstatus tool. -- Autodeletion of broken case dirs. -- Add --mail-user and --mail-type to case.submit. -- Remove --user-compset from create_newcase, allow compset longname in testname argument to create_test. -- New argument to create_clone (--user-mods-dir to also point to user-mods directory that will be used) - -Changes made to namelist defaults (e.g., changed parameter values): - Correct SCRIP grid file for f05 and add mapping files for them - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: - clm-decStarts cism history is a bit different (shown as changing answers) - Allow longname in tests -- Add --pesfile option to create_test. -- New --timeout flag for wait_for_tests -- CLM now needs to define its own LII and SSP tests (they already were put in place, now it's actually using them) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - (216 compare tests fail comparing to clm4_5_16_r258 tag) - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_16_r258 - - -Answer changes --------------- - -Changes answers relative to baseline: No (bit for bit) - - clm/decStart tests were changed though - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, cism, rtm, mosart - cime to cime5.4.0-alpha.03 - cism to cism2_1_40 - rtm to rtm1_0_63 - mosart to mosart1_0_28 - -List all files eliminated: Remove -irrig option for clm4_5/clm5_0 tests - - D components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/shell_commands - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/shell_commands - D components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands - -List all files added and what they do: - - A components/clm/bld/namelist_files/LogMessages.pm - Log message, warning, exit and abort handling for perl - -List all existing files that have been modified, and describe the changes: - - Update to new PTCLM directory for testing PTCLM cases - M components/clm/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 -- Change map_gdate - M components/clm/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 - Change map_gdate - M components/clm/test/tools/nl_files/PTCLM_USUMB_clm4_5 --------- Change map_gdate - M components/clm/test/tools/TSMscript_tools.sh -- Change user_mods directory used for PTCLM case - - M components/clm/tools/mkmapdata/regridbatch.sh -- Get working on cheyenne - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Working f05 SCRIP grid file - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml ----- Remove irrig - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ------- Change irrig to irrigate - add mapping files for f05 - - Set irrigate for use-cases, .true. for use_crop=T, use_cndv=F and not 1850 - M components/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M components/clm/bld/namelist_files/use_cases/stdurbpt_pd.xml - M components/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - M components/clm/bld/namelist_files/use_cases/20thC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml - M components/clm/bld/namelist_files/use_cases/2000_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - - M components/clm/bld/CLMBuildNamelist.pm -- moving warnings, logging, exit, and fatal_error to LogMessages - Add -ignore_warnings, -irrig is now only for clm4_0, pass $opts to add_default, not just {test}, - use value_is_true for all logical evalutions (extend it to all T or F), warnings will all be - written out, and abort at the end (unless -ignore_warnings is used) - don't die if clm_usr_name is set and didn't find user datasets, add final_exit on completion - M components/clm/bld/unit_testers/build-namelist_test.pl - Add tests for -ignore_warnings option - handle -irrig for clm4_5 - - M components/clm/cime_config/config_compsets.xml -- Add I2000Clm50BgcCruGs compset - M components/clm/cime_config/config_pes.xml ------- Set PE count for f10 on hobart to single node - M components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm --------------- turn irrigate on - M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm - turn irrigate on - M components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm ------- turn irrigate on - M components/clm/cime_config/testdefs/testlist_clm.xml - 1x1_camdenNJ test with stub-GLC: I2000Clm50BgcCruGs - M components/clm/cime_config/config_component.xml --- Update to config_component version 3. CLM must have 1 and exactly - one modifier, move setting of -irrig for 2000 and transient compsets to inside of CLM build-namelist - remove some no longer needed forcing definitions for compsets - M components/clm/cime_config/buildnml - Print warning if branch and coldstart, allow colstart with hybrid - Add warning if doing a coldstart - - M components/clm/src/CMakeLists.txt - Add additional subdirectory for unit testing (from Bill Sacks) - - M components/clm/src/main/controlMod.F90 - Allow use_crop=F and irrigate - - M parse_cime.cs.status - Seperate out differences when baselines don't exist - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r258 -Originator(s): erik (Erik Kluzek) -Date: Fri Oct 6 22:25:29 MDT 2017 -One-line Summary: Revert change to fire, set n_melt_glcmec=10, update mosart to version that doesn't accumulate water in short rivers - -Purpose of changes ------------------- - -Revert the changes to fire that came in clm4_5_16_r257. Add some notes that clarify that the code as is, is correct. -Set n_melt_glcmec=10.0 for clm5.0 (This should have happened in the fresh snow grain size change in clm4_5_16_r256). -Update mosart to a version that doesn't accumulate water in short rivers. This is done by explicitly making sure river length -isn't smaller than a minimum value. - -Bugs fixed or introduced ------------------------- - - 2516 -- Mistaken bug for fire mortality calculations for some - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): - Changed n_melt_glcmec to 10.0d00 for clm5_0 (same as clm4_5, but double precision) - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): Some of the - fire mortality code is confusing, we added some notes to clarify that's it's correct - -Changes to tests or testing: None - -Code reviewed by: self, dlawren, oleson, swenson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (231 compare tests fail) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_16_r257 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 and/or with mosart - - what platforms/compilers: all - - nature of change: small - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): mosart - mosart to rlen_min_n01_mosart1_0_26 (will bring trunk version of mosart in an upcoming tag) - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - set -M components/clm/src/biogeochem/CNFireBaseMod.F90 --- Revert fire changes (bug 2516) add comments - use fm_droot as it's used to represent fraction of transport from livestem/livecroot to litter - or to represent the fraction of plant-tissue mortality for deadstem/deadcroot -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 - Revert fire changes - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r257 -Originator(s): erik (Erik Kluzek) -Date: Fri Sep 29 10:17:36 MDT 2017 -One-line Summary: Fix two bugs found by Hui Tang, one for Carbon isotopes and one in the fire model - -Purpose of changes ------------------- - -This is a fix for two bugs found by Hui Tang. One is for Carbon isotopes where a fix that came in for -clm4_5_11_r188, used leafc for too many of the isotope flux calculation calls. This changes it so the -correct terms are used for the particular flux. - -The other fix is in the fire model where fire emissions were using the wrong fire related -mortality term for dead stem and should have been using a different type. Now it matches the -flux type, as well as the term used in combustion completness for the particular fire emission. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2517 -- Bug in CNFireFluxes for some fire fluxes - 2516 -- Leafc wrongly used in too many CIsoFluxCalc calls. - -Known bugs introduced in this tag (include bugzilla ID): (new one found) - 2518 -- --- warnings from CLM build-namelist don't get sent out of preview_namelist - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self,oleson,dlawren,Hui Tang - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm4_5_16_r256 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 with CN and fire on, and also for carbon isotopes - - what platforms/compilers: all - - nature of change: very small impact - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: /oleson/clm50_r255_fireiso_1deg_GSWP3V1_1850 - - URL for LMWG diagnostics output used to validate new climate: -http://webext.cgd.ucar.edu/I1850/clm50_r255_fireiso_1deg_GSWP3V1_1850/lnd/clm50_r255_fireiso_1deg_GSWP3V1_1850_21_50-clm50_r255_coniso_1deg_GSWP3V1_1850_21_50/setsIndex.html - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeochem/CNFireBaseMod.F90 --- Some fire emissions were using - fire related mortality for dead stem and should have been using a different type - it should match the one used in the combustion completeness factor and the main - type - M components/clm/src/biogeochem/CNFireLi2014Mod.F90 - Same change as above - - M components/clm/src/biogeochem/CNCIsoFluxMod.F90 -- In the fix for bug 2116 that came - in with clm4_5_11_r188, leafc was used in too many CNCIsoFluxCalc calls this corrects - it to use the correct term - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r256 -Originator(s): erik (Erik Kluzek) -Date: Wed Sep 20 15:42:17 MDT 2017 -One-line Summary: Fresh snow grain radius is temperature dependent - -Purpose of changes ------------------- - -Changes from Leo VanKampenhout to have fresh snow grain size a function of air temperature for CLM50. -Behavior is the same as before for CLM45 with fresh snow grain size a fixed parameter. For CLM50 -it's that same value (54.526) less than -30C and linear with T up to 204.526 at 0C, and 204.526 for -temperatures greater than 0C. - - -Bugs fixed or introduced ------------------------- - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Added namelist item: fresh_snw_rds_max - -Changes made to namelist defaults (e.g., changed parameter values): - fresh_snw_rds_max is snw_rds_min for clm4_5 - fresh_snw_rds_max is 204.526 for clm5_0 - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self,L.vanKampenhout@uu.nl - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (343 compare tests fail since namelists change) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu - OK - cheyenne_intel - OK - cheyenne_gnu - OK - hobart_nag - OK - hobart_pgi - PASS - hobart_intel - PASS - -CLM tag used for the baseline comparisons: clm4_5_16_r255 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, for clm5_0 - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm5_0 - - what platforms/compilers: All - - nature of change: more snow melt at expense of ice melt - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: oleson clm50_r251_SNOWGRAIN_2000 - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/B1850/b.e20.B1850.f09_g17.pi_control.all.196/lnd/b.e20.B1850.f09_g17.pi_control.all.196.8_27-b.e20.B1850.f09_g17.pi_control.all.195.8_27/set1/set1.html - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeophys/SnowSnicarMod.F90 -- Pass atm2lnd_inst in, make sure snw_rds isn't less than the min parameter - create a function for setting FreshSnowRadius, dependent on atm2lnd_inst (for air temperature), the function sets to min - parameter if fresh_snw_rds_max is same as min (clm45), or to min at less than -30C linear between fresh_snw_rds_max and min parameter - up to 0C, and then at fresh_snw_rds_max value for clm50. - M components/clm/src/biogeophys/AerosolMod.F90 ----- Add InitReadNML and fresh_snw_rds_max - M components/clm/src/main/clm_driver.F90 ----------- Pass atm2lnd_inst down to SnowAgeGrain - M components/clm/src/main/clm_instMod.F90 ---------- Pass NLFilename to aerosol_inst%Init - - M components/clm/bld/CLMBuildNamelist.pm - Set fresh_snw_rds_max, and add aerosol namelist - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Set fresh_snw_rds_max for clm45 and clm50 - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Define fresh_snw_rds_max - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r255 -Originator(s): erik (Erik Kluzek) -Date: Mon Sep 18 21:21:29 MDT 2017 -One-line Summary: Changes to crop and enabling Carbon isotopes for crop and some miscellaneous small changes - -Purpose of changes ------------------- - -Changes for crop on as well as enabling carbon isotopes when crop is on. Fix some small answer changing issues. -Also bring in new timeseries datasets for C14 as well as now C13. The C14 dataset has hardwired latitude sectors -it uses (so previous file can NOT be used). Properly handle and update C13/C14 variables when crop is on. -Handle CIsoFluxCalc calls for a list of crop specific fields. Add cropseedc_deficit, to storvegc as well as totveg. -Send livestemc to litter for prognostic crop. Ignore downreg for carbon isotopes in Fractionation subroutine. -For dynamic roots, use rooting values on parameter dataset which is set to values from PFT=1. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2508 -- Incorrect landuse.timeseries datasets for f09 and hcru for rcp=8.5 in r254 - 2489 -- Set c/nnegcrit for clm45/clm50 (10X higher for clm45 than clm50) - 2412 -- Initialize rootfr to PFT==1 value for dynamic roots -- update params files - 2396 -- make subtraction the default behavior for clm4_5. - 2316 -- update carbon isotopes same as C12: CNVegCarbonStateType.F90 - 2211 -- Fix time used for Ciso time series - -Known bugs introduced in this tag (include bugzilla ID): - 2511 -- Overflow with Carbon isotopes - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - Change to restarts when c-isotopes on - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - New namelist items: use_c13_timeseries, atm_c13_filename - New history vars: C13_GRAINC, C13_CROPSEEDC_DEFICIT, C14_GRAINC, C14_CROPSEEDC_DEFICIT - -Changes made to namelist defaults (e.g., changed parameter values): - Set cnegcrit/nnegcrit for CLM45/CLM50 - -Changes to the datasets (e.g., parameter, surface or initial files): - New C13 and C14 timeseries files - New params files, but only answer changing part is for dynamic roots - (setup bare-soil on file to match what's used for PFT=1) - Bring in correct datasets for rcp8.5 for f09 and hcru - 1x1_numaIA 1850 and 1850-2000 transient files - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - The C13/C14 timeseries should be implemented with streams for greater flexibility, robustness, and code - reuse. The new C14 timeseries file is hardcoded for three specific latitude sectors, and thus can't use - the previous file, nor a file of a different configuration. Downreg is passed down from get_downreg_patch - in clm_driver, to CanopyFluxes to Fractionation, but no longer used (it should be removed). - - Note the following from Dave: While debugging crop isotope code, found that cpool_patch and frootc_patch - could occasionally be very small but nonzero numbers after crop harvest, which persists - through to next planting and for reasons that could not 100% isolate, caused C12/C13 ratios to occasionally - go out of bounds. Zeroing out these small pools and putting them into the flux to the atmosphere solved many - of the crop isotope problems - -Changes to tests or testing: Added some tests, two of the new tests fail due to bug 2511 - -Code reviewed by: self, koven, dlawren, dll, oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS (234 comparison tests fail) - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu - OK - cheyenne_intel - OK - cheyenne_gnu - OK - hobart_nag - OK - hobart_pgi - OK - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_16_r254 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: Crop, Carbon-isotopes - - - what platforms/compilers: All - - nature of change: - small change to crop with missing updates, crop with carbon-isotopes are now enabled - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: - -D components/clm/src/biogeochem/C14BompbSpikeMod.F90 --- Change name to more general - -List all files added and what they do: - -A components/clm/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 -- Handle time series - for both C13 and C14 - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeochem/CNPhenologyMod.F90 -------- Remove subtract_cropseed always do when crop on, pass c13/c14 - instances down to CNPhenology and CropPhenology. After setting C12-leafc_xfer/totvegc set the c13/c14 - leafc_xfer/totvegc as well -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 ---- Change location of xsmrpool update. Dave added this note: - While debugging crop isotope code, found that cpool_patch and frootc_patch - could occasionally be very small but nonzero numbers after crop harvest, which persists - through to next planting and for reasons that could not 100% - isolate, caused C12/C13 ratios to occasionally go out of - bounds. Zeroing out these small pools and putting them into the flux to the - atmosphere solved many of the crop isotope problems -M components/clm/src/biogeochem/CNCIsoFluxMod.F90 --------- Add CIsoFluxCalc calls for: soilc_change, cpool_to_resp, - grainc_xfer_to_|grainc|food|seed, crop_seedc_to_leaf, grain_|curmr|xsmr, cpool_|grain|grain_storage|_gr, cpool_to_|grainc|grainc_storage, - transfer_grain_gr, grainc_storage_to_xfer, livestemc_to_litter, and if use_grainproduct for ciso-grainc_to_cropprodc/grain_mr - pass iso totvegc_path for hrv_xsmrpool_to_atm CIsoFluxCalc, section adding livestemc to litter for crop - add additional check for ciso_state(i) /= 0 for divide by check in CIsoFluxCalc -M components/clm/src/biogeochem/CNPrecisionControlMod.F90 - Handle c13/c14 TruncateCandNStates for grainc/storage/xfer, - cropseedc_deficit_patch and xsmrpool -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -- Add: C13_GRAINC, C13_CROPSEEDC_DEFICIT, C14_GRAINC, C14_CROPSEEDC_DEFICIT - restartvar calls explicit for c12, c13, c14: grainc, grainc_storage, grainc_xfer (with c13 and c14 for ciso) - add cropseedc_deficit, to storvegc as well as totvegc, fix bug 2316 make cisotopes the same as C12 -M components/clm/src/biogeochem/CNDriverMod.F90 ----------- Pass more c13/c14 instances down to CNPhenology calls -M components/clm/src/main/controlMod.F90 ------------------ Add namelist items: use_c13_timeseries, atm_c13_filename - remove abort when crop and use_c13/use_c14 is on -M components/clm/src/main/clm_initializeMod.F90 ----------- Add call to C13_init_TimeSeries -M components/clm/src/biogeophys/PhotosynthesisMod.F90 ----- Handle C13 timeseries (call C13TimeSeries), put C14 bombspike data in - hard-wired latitude sectors, ignore downreg for carbon isotopes in Fractionation subroutine -M components/clm/src/biogeophys/RootBiophysMod.F90 -------- Use parameters for roots from params file for bare-soil rather than - an explicit if statement for it - -M components/clm/bld/CLMBuildNamelist.pm ------------------- Add cnegcrit/nnegcrit, allow crop and C-isotopes to be - on at the same time, add c13 time-series -M components/clm/bld/unit_testers/build-namelist_test.pl --- Change testing for time-series - -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ----- New datasets for atm_c14_filename, and - atm_c13_filename, new paramdata files, set cnegcrit/nnegcrit, flanduse_timeseries for f09 and hcru @ rcp=8.5 -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml --- Add: use_c13_timeseries, atm_c13_filename - update similar documenation on c14 bombspike -M components/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -- Same as changes above - -M components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm - Set use_c13_timeseries=T -M components/clm/cime_config/testdefs/testlist_clm.xml - Change two ciso transient tests to include crop, add transient - crop ciso test - -M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- Add expected fails for new ciso overflow bug 2511 - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r254 -Originator(s): erik (Erik Kluzek) -Date: Fri Sep 1 00:09:25 MDT 2017 -One-line Summary: Update surface datasets, and point to new CMIP6 population density dataset - -Purpose of changes ------------------- - -Update all surface datasets to new versions that have updated soil albedo, and use latest PFTCFT files. Also -get mksurdata_map fully working on cheyenne for batch mode. Point to latest CMIP6 population density dataset -for historical case, this is with HYDE3.2 data. New fsurdat files for 16pft are with irrigation on. If ask for -irrig=F and 16pft won't be able to find any files. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2479 --- Irrigation is occurring in non-prognostic-crop runs - -Known bugs introduced in this tag (include bugzilla ID): (found ...) - 2506 --- ntree used before it's set in pftconMod.F90 2017-08-25 - 2505 --- Set stream_year_first_urbantv/last for CLM4.5 just for consistency 2017-08-25 - 2504 --- hybrid/branch cases don't allow CLM_FORCE_COLDSTART to be on 2017-08-18 - 2503 --- Wrong units for FAREA_BURNED 2017-08-16 - 2502 --- CWDC_HR is identically zero 2017-08-16 - 2500 --- ne30 case fails on hobart_nag due to floating overflow - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -irrig .true. is needed without -crop - fsurdat files without crop are all just with irrigation on. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): Datasets - -Changes to the datasets (e.g., parameter, surface or initial files): new fsurdat, landuse.timeseries, popdens - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu - OK - cheyenne_intel - OK - cheyenne_gnu - OK - hobart_nag - OK - hobart_pgi - OK - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_16_r253 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - similar climate CLM4.5/CLM5.0 surface datasets change with latest soil albedo and small changes form raw PFTCFT files. - also an updated population-density dataset used for historical - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/tools/mksurfdata_map/mksurfdata.pl -- Add rundir option, if 16pfts add Irrig to filename - M components/clm/tools/mksurfdata_map/Makefile.data -- Get working on cheyenne or yellowstone - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ------- Default resolution and sim_year, - set irrig to .true. when crop off, update fsurdat, flanduse_timeseries, stream_fldfilename_popdens - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Update soil-color and PFTCFT files - - M components/clm/bld/CLMBuildNamelist.pm --- check irrig for fsurdat files, fsurdat with 16pft is with irrig=T - make sure set only set irrigate when use_crop on - M components/clm/bld/unit_testers/build-namelist_test.pl -- More tests w clm5_0, irrigate=T set without crop - M components/clm/bld/unit_testers/NMLTest/CompFiles.pm ---- Add more documentation - - M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm - Update finidat with - updated fsurdat file - - M components/clm/src/biogeophys/PhotosynthesisMod.F90 -- FPSN_W? variables are default off, and instant averaged - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r253 -Originator(s): erik (Erik Kluzek) -Date: Fri Aug 4 20:23:25 MDT 2017 -One-line Summary: Check on reasonable import/export from CLM, check ndep units from input file - -Purpose of changes ------------------- - -Do some reasonable physical checks on the import/export state to/from CLM. Checking for NaN's and -that solar should be greater or equal to zero, LW down, specific humidity greater than zero. -Check the units on the input nitrogen deposition file and if per year divide by seconds per year, -leave alone if per seconds, and die if units aren't recognized. Increase the tolerence for warnings -for Nitrogen, Carbon, and soil energy balance. Add missing MPI broadcasts for two ndep namelist variables. -Fix an LII test that was failing. Change the PE layout for f4x5 grids for yellowstone and cheyenne. -Add -die_on_duplicate option to parse_cime.cs.status and have summary option add notes about expected fails. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): [If none, remove this line] - 2498 -- missing MPI bcast - 2499 -- Update finidat file so LII case will work - 2484 -- Check for units of ndep only divide by seconds in a year if units are per year - -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] - NGEET/fates-clm/#16 -- FATES changes answers at a level of at least roundoff when the PE layout changes - NGEET/fates-clm/#15 -- CLM-FATES can't restart when PE layout is change - ESMCI/cime/#1793 ----- Run time error for mpi-serial case on cheyenne_intel when created with aux_clm create_testd - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - units for ndep input files can either be g(N)/m2/yr or g(N)/m2/s, will now abort for anything else - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Added test with CMIP6 ndep file - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu - OK - cheyenne_intel - OK - cheyenne_gnu - OK - hobart_nag - OK - hobart_pgi - OK - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_16_r253 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit (although FATES tests change because of the PE layout change) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: Add test mods for case with CMIP6 ndep forcing that has different units/variable name - -A + components/clm/cime_config/testdefs/testmods_dirs/clm/clm50CMIP6frc - -List all existing files that have been modified, and describe the changes: - -M components/clm/cime_config/config_pes.xml ------------- Update f45 PE layout for yellowstone/cheyenne -M components/clm/cime_config/testdefs/testlist_clm.xml -- Add clm50CMIP6frc test -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm - Update finidat file so - LII test will pass - -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 - Lower amount of warnings written out for C and N by order of mag. -M components/clm/src/biogeochem/CropType.F90 ---------- Add if-masterproc to write statement -M components/clm/src/biogeophys/BalanceCheckMod.F90 --- Lower amount of warnings written out for soil energy balance -M components/clm/src/cpl/lnd_import_export.F90 -------- Add checking for physically bad import or export data - ensuring no NaN's are exchanged, solar >= 0, LW-dn > 0, q > 0 -M components/clm/src/main/ncdio_pio.F90.in ------------ Remove write to log file from all tasks -M components/clm/src/main/ndepStreamMod.F90 ----------- Do mpi_bast for ndep_varlist/ndep_taxmode, check units - of input ndep variable and divide by seconds in a year if g(N)/m2/yr, but leave alone for g(N)/m2/s otherwise die - -M parse_cime.cs.status - Add -die_on_duplicate option, and have summarize option make notes about expected fails - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r252 -Originator(s): erik (Erik Kluzek) -Date: Mon Jul 24 16:57:42 MDT 2017 -One-line Summary: Update parameter file for some crop albedo issues, and fix a bug in urban albedo for nightime - -Purpose of changes ------------------- - -Bring in a new CLM50 parameter file that updates a few fields for prognostic crop with affect on crop albedo -(rholnir,taulnir,taulvis,xl). Bring in changes to fix urban albedo for nighttime from Keith Oleson. Rather than set -albedo's for the urban canyon all to 1.0, set them to the viewfactors, as that will result in combined albedo of -one, whereas the previous way ended up with albedo's greater than one. - -Here's a description from Keith about the change in urban albedo. " For diffuse radiation, which is -independent of solar zenith angle, the road albedos appear to be exactly equal to the road-sky view -factor. And the wall albedos are equal to the wall-sky view factor. So the albedos are the albedo -of the surface (1.0) times the appropriate view factor. This makes sense. All incident radiation -entering the canyon should be reflected to the sky and the contribution of each surface is according -to the view factor of each surface to the sky as determined by the height to width ratio. The view -factors of the two walls and the road to the sky sums to 1.0. So setting the diffuse albedos to -these values when the sun is below the horizon results in a scaled diffuse albedo of 1.0. For direct -radiation, it's more complicated because the solar zenith angle is involved when running the -radiation model. However, it seems reasonable to assume the same albedos for direct as for diffuse." - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2492 -- Urban scalings can lead to albedo values greater than 1 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files):New params file for CLM50 - Updates rholnir,taulnir,taulvis,xl for prognostic crop fields - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self,oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne ---- PASS (60 clm50 tests are different as expected) - - unit-tests (components/clm/src): - - cheyenne ---- PASS - - regular tests (aux_clm): (31 Clm45 tests are different than baseline in cpl hist files for: - l2x_Sl_avsdr ("dr" and "df" and "av" and "an") as expected) - - yellowstone_intel - OK - yellowstone_pgi --- OK - yellowstone_gnu --- OK - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - Tests: ERS_Ld5_Mmpi-serial.1x1_vancouverCAN.I1PtClm45SpGs.cheyenne_intel.clm-default, - ERS_Ld5_Mmpi-serial.1x1_vancouverCAN.I1PtClm45SpGs.yellowstone_intel.clm-default - show: FSR, FSRND, and FSRVD different - -CLM tag used for the baseline comparisons: clm4_5_16_r251 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for CLM50, and for CLM45 when coupled to CAM - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 (CLM45 when coupled to CAM and albedos passed to coupler for any case) - - what platforms/compilers: all - - nature of change: similar climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - oleson/b.e20.B1850.f09_g17.pi_control.all.186.alb - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/B1850/b.e20.B1850.f09_g17.pi_control.all.186.alb/lnd/b.e20.B1850.f09_g17.pi_control.all.186.alb.17_36-b.e20.B1850.f09_g17.pi_control.all.186.17_36/setsIndex.html - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - Updated params file for CLM50 - M components/clm/src/biogeophys/UrbanAlbedoMod.F90 --------------- Fix bug 2492. Set albedo's of - urban surfaces to view factors, by default and for solar zenith angles below horizon. - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r251 -Originator(s): erik (Erik Kluzek) -Date: Fri Jul 14 01:38:38 MDT 2017 -One-line Summary: Update mksurfdata_map for soil depth/color, add new mapping files - -Purpose of changes ------------------- - -Bring in new soil color (from Peter Lawrence) dataset for mksurfdata_map. Also bring -in a new soil depth dataset that uses a mask for when soil depth > 0. Bring in a version -of PTCLM that's working with this cime. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): - New mapping files for soil depth for mksurfdata_map - New soil color data for mksurfdata_map - New soil depth dataset on the map defined by when soil depth > 0 - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK - -CLM tag used for the baseline comparisons: none - - -Answer changes --------------- - -Changes answers relative to baseline: No, bit-for-bit (CLM code wasn't changed) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): PTCLM - - PTCLM to PTCLM2_170706 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/tools/mkmapdata/regridbatch.sh -- go back to using 8 processors - M components/clm/tools/mkmapdata/mkmapdata.sh ---- add mapping for 5x5min_ORNL-Soil, - change check for $MPIEXEC, so ignores arguments - M components/clm/tools/mksurfdata_map/mksurfdata.pl -- Remove extra "_" in "__CMIP6_" - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- New - 5x5min-ORNL-Soil mapping files - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - SCRIP - grid file for 5x5min-ORNL-Soil, change soildepth mask to ORNL-Soil - update soil color and soil depth datasets - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add - ORNL-Soil mask - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r250 -Originator(s): erik (Erik Kluzek) -Date: Thu Jul 13 13:54:13 MDT 2017 -One-line Summary: Update finundation dataset, new fsurdat files with updated soil color - and soil depth, update mosart areas, fix cheyenne_gnu - -Purpose of changes ------------------- - -Update all fsurdat datasets with updated soil color and soil depth. Soil color as modified by Peter Lawrence. -Soil depth was modified to use a mask for soil depth>0 which makes the minimum soil depth 3cm (model still has -a minimum of 40cm). Also updated area's for the mosart routing file (the previous areas were off by up to about 1%). -the update to the area's will influence fluxes. Also fix a problem so that cheyenne_gnu will work (remove pure -attribute from two functions). - -Also bring in the updated finundation inversion from Sean Swenson. This will change the methane output -significantly for CLM50BGC cases. The previous inversion file was incorrect and shouldn't be used! The new file is also -at a higher resolution 1-degree rather than 2-degree. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2493 (gnu6.3.0 compiler doesn't like "pure" functions that use outside modules, especially public ones) - -Known bugs introduced in this tag (include bugzilla ID): - 2491 (Error in Banddiagonal in latest CESM simulation) (found in Cecile's coupled simulation) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): Just datasets see below - -Changes to the datasets (e.g., parameter, surface or initial files): Update all fsurdat and the - stream_fldfilename_ch4finundated file - - fsurdat files have soil color and soil depth updated. The finundated file is now at f09 resolution - rather than f19, and the previous file was incorrect. - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu - OK - cheyenne_intel - OK - cheyenne_gnu - OK - hobart_nag - OK - hobart_pgi - OK - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_16_r249 - - -Answer changes --------------- - -Changes answers relative to baseline: - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 or with MOSART - - what platforms/compilers: all - - nature of change: similar climate, methane outputs are substantially changed - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): mosart - mosart update to mosart1_0_26 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeophys/SnowHydrologyMod.F90 -- Remove pure attribute from OverburdenCompactionVionnet2012 - M components/clm/src/biogeophys/IrrigationMod.F90 ----- Remove purse attribute from PointNeedsCheckForIrrig - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- Update all fsurdat files and stream_fldfilename_ch4finundated - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r249 -Originator(s): sacks (Bill Sacks) -Date: Thu Jul 6 14:32:40 MDT 2017 -One-line Summary: All new compsets, reworked test lists, and related fixes - -Purpose of changes ------------------- - -The changes here were a joint effort between Dave Lawrence, Ben Andre, Erik -Kluzek, Mariana Vertenstein and Bill Sacks - -(1) All new compset aliases, with the following changes: - - (a) Most compset aliases are now for CLM5, with fewer CLM45 compsets and - even fewer CLM40 compsets. - - (b) Compset aliases now use capitalization of only the first letter of each - piece, to avoid the alphabet soup problem. For example, - IHistClm50BgcCrop - - (c) Some other tweaks have been made to compset aliases, such as always - listing the time period and Sp (satellite phenology) explicitly - - (d) Compsets use GSWP3 forcing unless the alias specifies otherwise - - (e) Compsets use CISM2%NOEVOLVE - and so use glc_mec in CLM - unless the - alias has Gs (for GLC - stub) - - (f) An evolving ice sheet (CISM2%EVOLVE) is now denoted by having a final - 'G' in the compset alias - -(2) Completely reworked test lists: - - (a) Use new aliases - - (b) Changed most tests to CLM5 - - (c) Merged the aux_clm45 and aux_clm40 test categories into aux_clm - - (d) Removed the 'null' test category, which was used for SBN tests - - (e) Some minor additional tweaks to the aux_clm test list to ensure - appropriate coverage and remove some redundant tests - - (f) For a few testmods directories, removed some settings that had nothing - to do with those testmods (use_dynroot, use_hydrstress) - -(3) Fixed VIC: - - (a) Previously, VIC compsets were not actually turning VIC on; now they are - - (b) Fixed namelist defaults for VIC with CLM50 - -(4) Updated RTM and MOSART externals: changed their test lists and fixed a - MOSART bug - -(5) Updated CISM external; this changes answers for CISM when ice evolution is - turned off, due to changing the lnd -> glc mapping in this case - -(6) Point to a CIME branch that fixes some bugs - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2473: Change order of tests run with the LII test -- 2474: CLM50 CN compsets seem to be set up wrong -- 2480: vichydro option doesn't work with CLM50 as it needs bedrock off and - lower_boundary_condition=3 (with aquifer layer) - -CIME Issues fixed (include issue #): I think some issues are fixed here, but I'm -not sure which ones - -Known bugs introduced in this tag (include bugzilla ID): -- 2485: CLM's 'ed' testlist still has old-style compsets -- 2486: Failure in camdenNJ test in prebeta test list -- 2488: Floating overflow in SoilBiogeochemNitrifDenitrifMod.F90 - (newly-discovered, but presumably existed in previous tags) -- 2489: Clm45BgcCrop case dies due to negative leafn - (newly-discovered, but presumably existed in previous tags) - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- All new compset aliases - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- All new compset aliases - -Changes made to namelist defaults (e.g., changed parameter values): -- Changed some defaults when running with VIC - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- All new aliases means baseline comparisons all BFAIL - -Changes to tests or testing: -- Massive overhaul - see notes elsewhere in this ChangeLog entry - -Code reviewed by: This was a joint effort by Dave Lawrence, Ben Andre, Erik -Kluzek, Mariana Vertenstein and Bill Sacks. Various pieces were reviewed by -different people in this list. - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - - pass except for 'compare file.*DNE', presumably due to new tests added - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu - ok - cheyenne_intel - ok - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - - Most tests pass; baseline comparisons BFAIL. Bugs opened (and Expected Fails - list updated) for remaining failures. - - Ran most testing on r85975; just ran relevant tests on latest revision with - changed compset (changed IHistClm50BgcGs to IHistClm50BgcQianGs) - -CLM tag used for the baseline comparisons: N/A - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All tests BFAIL due to new compset - aliases. Because of this, I'm not completely sure of the answer changes, but I - think they are: - - Tests with CISM2%NOEVOLVE change answers in fields on the glc grid due - to new CISM external - - CLM50 tests with Vic change answers because now they're actually using VIC - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - New climate for tests that change answers - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime -- rtm -- mosart -- cism - -List all files eliminated: - -========= No longer need these testmods -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC -D components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC -D components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/shell_commands -D components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/user_nl_datm -D components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5 -D components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12 - -List all files added and what they do: - -========= Replaces af_bias_v5 -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v7/user_nl_datm -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v7 - -List all existing files that have been modified, and describe the changes: - -========= Reworked set of compsets and aliases -M components/clm/cime_config/config_compsets.xml - -========= Reworked test list as described above -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Stop setting glc_snow_persistence_max_days in glcMEC testmods. It made - sense to set this for testing when most of our tests used CLM45, - because the default snow persistence was 20 years. But for CLM50 the - default snow persistence is 0, so it no longer makes sense to set this - value specially for testing. -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm - -========= Apply CN and VIC for CLM50 -M components/clm/cime_config/config_component.xml - -========= Use compatible settings for VIC -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/unit_testers/build-namelist_test.pl - -========= Fix for new glacier region -M components/clm/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm - -========= Make SSP work with mosart instead of rtm -M components/clm/cime_config/SystemTests/ssp.py - -========= Change order of LII test to support re-creating initial conditions - files (rather than requiring a separate SMS_Ln1 test) -M components/clm/cime_config/SystemTests/lii.py -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README - -========= New, compatible initial conditions -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm - -========= No longer set use_dynroot = .true., use_hydrstress = .false. -M components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm - -========= No longer set use_hydrstress = .false. -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - -========= Update ExpectedTestFails list for new tests; new failures are: - SMS_Ld5_D_P24x1.f10_f10_musgs.IHistClm50Bgc.hobart_nag.clm-decStart - ERP_D_P24x1.f10_f10_musgs.IHistClm50Bgc.hobart_nag.clm-decStart - ERP_D.f10_f10_musgs.IHistClm50Bgc.yellowstone_gnu.clm-decStart - ERS_Ly5_P72x1.f10_f10_musgs.IHistClm45BgcCrop.cheyenne_intel.clm-cropMonthOutput -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -========= Update documentation of system testing -M .ChangeLog_template - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r248 -Originator(s): sacks (Bill Sacks) -Date: Wed Jun 28 15:50:13 MDT 2017 -One-line Summary: Melt most ice runoff - -Purpose of changes ------------------- - -Up until now, excess snow in CLM (accumulated beyond the snow capping limit) has -been sent to the ocean as an ice runoff flux. However, this caused problems in -some regions, in that it cooled an already-cold ocean, leading to excessive sea -ice growth. Keith Lindsay, Marika Holland and others suggested changing CLM so -that it sends this flux as liquid rather than ice runoff - having the atmosphere -melt the ice rather than having the ocean do so. These changes are implemented -here. - -This has now been tested in many fully-coupled simulations, and it indeed solves -the problem of excessive sea ice growth, without having any noticeable -detrimental effects on other aspects of the simulation. - -Specifically, this affects ice runoff from (a) glacier_mec columns outside of -Greenland and Antarctica, and (b) all other column types (vegetated, etc.). We -still send ice runoff from Greenland and Antarctica to simulate the ice calving -flux that occurs in those regions. In addition, we still send an ice runoff flux -generated from dynamic landunit adjustments. - -This new behavior is used by default in CLM50, but not in CLM45. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: melt_non_icesheet_ice_runoff -- New namelist variable: glacier_region_ice_runoff_behavior - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - - tests pass, namelists change as expected - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - ok - hobart_nag --- ok - hobart_pgi --- ok - hobart_intel - ok - - ok means tests pass, answers change as expected - - Ran most testing on melt_ice_runoff_n05_clm4_5_16_r247; ran hobart on latest - (which included a commit to split long lines) - -CLM tag used for the baseline comparisons: clm4_5_16_r247 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 cases - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - new climate - - This changes runoff terms (liquid and ice) and the sensible heat flux sent - to the atmosphere. In addition, there are limited changes in some - methane-related terms; this is presumably due to the dependence of - finundated on TWS, and the fact that TWS changes due to the changes in - these runoff terms. - - There are also diffs in x2r_Flrl_irrig for this test (and the similar - yellowstone test): - ERS_D_Ld10.T31_g37_gl4.IGHISTCLM50.cheyenne_intel.clm-glcMEC_decrease. It - makes sense that there would be x2r irrig diffs due to diffs in volr, but - I was surprised that this test had any irrigation. It turns out this is - due to bug #2479. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: b.e20.B1850.f09_g17.pi_control.all.149 - - URL for LMWG diagnostics output used to validate new climate: ??? - - Note that the climate tests were done on an earlier, kludgey - implementation. I have verified that the latest implementation is bit-for-bit - with that earlier implementation via a 5-year run of compset - 1850_DATM%GSWP3_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV at - resolution f09_g16, producing annual-average cpl history files. (For the - original, used - https://svn-ccsm-models.cgd.ucar.edu/clm2/branch_tags/melt_ice_runoff_orig_tags/melt_ice_runoff_orig_n01_clm4_5_16_r246.) - There were differences in a few CLM diagnostic fields, as expected (because I - have tweaked some diagnostic fields in the latest version), but the cpl - avghist files were bit-for-bit. - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes as described above -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/main/lnd2atmType.F90 - -========= Changed long name in some runoff terms: removed statements that they - do not include QSNWCPICE, because now they *do* include the *melted* - portion of QSNWCPICE -M components/clm/src/biogeophys/WaterfluxType.F90 - -========= New glacier region-specific behavior -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/main/test/glcBehavior_test/test_glcBehavior.pf -M components/clm/src/main/clm_driver.F90 - -========= New namelist flags controlling the behavior -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/src/main/clm_instMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r247 -Originator(s): sacks (Bill Sacks) -Date: Mon Jun 26 19:52:20 MDT 2017 -One-line Summary: New GLACIER_REGION field with CISM domain split in two - -Purpose of changes ------------------- - -In an upcoming tag, we'll need a separate GLACIER_REGION for the purpose of -determining where ice runoff should be melted: we do not want this melt to -happen over Greenland itself, but we do want it to happen in peripheral parts of -the CISM domain (and in particular, we want it to happen over the Canadian -archipelago, which is within the CISM domain, and thus was within the -"Greenland" GLACIER_REGION). (We still need a GLACIER_REGION that encompasses -areas outside Greenland itself in case ice extent grows a bit beyond the current -boundaries. So we truly need two separate GLACIER_REGIONs for (a) Greenland -itself, and (b) peripheral areas of the CISM domain.) This tag updates the -surface datasets and related fields to have this extra GLACIER_REGION. - -In addition to updating the GLACIER_REGION raw data file, this also introduces a -new regridding method that is applied to GLACIER_REGION: this takes the maximum -value from any source point (NOT the dominant value). This is important for the -new GLACIER_REGION, where we want a destination (CLM) cell to be considered in -region 2 (Greenland itself) if ANY overlapping source points are in region -2. This means that the ordering of regions in the GLACIER_REGION raw data file -is important: preference will be given to higher-numbered regions. - -Note that I just changed surface datasets that had time stamp 170428 or -later. This excluded some older single point datasets, for which the new glacier -region doesn't matter anyway: -- surfdata_0.125x0.125_simyr2000_c150114.nc -- surfdata_0.125x0.125_mp24_simyr2000_c150114.nc -- surfdata_1x1_smallvilleIA_78pfts_simyr2000_c160127.nc -- surfdata_1x1_smallvilleIA_78pfts_simyr1850_c160127.nc -- surfdata_1x1_tropicAtl_16pfts_simyr1850_c160127.nc (used in tropicAtl_subset testmod) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- There are some additional subtleties now for setting up a run with different - glacier domains (e.g., a paleoclimate run) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- New surface datasets - just differ in GLACIER_REGION - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- There are some additional subtleties now for setting up a run with different - glacier domains (e.g., a paleoclimate run) - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - ok - - PASSed except expected failures: - - baseline comparisons failed for mksurfdata_map tests - - PTCLM tests failed as expected - - Also ran mksurfdata_map unit tests: - - new-style (cmake / pfunit-based): pass - - old-style: same failures as on trunk - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - cheyenne_intel - pass - hobart_nag --- pass - hobart_pgi --- pass - hobart_intel - pass - -Ran tests on glacier_region_canada_n03_clm4_5_16_r246 -- After that, modified the default mksurfdata_map namelist used for testing: - pointed to updated file - - - -CLM tag used for the baseline comparisons: clm4_5_16_r246 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - -List all files added and what they do: - -========= Get mkindexmapMod under some pfunit-based unit tests - required - stubbing out a bunch of netcdf stuff -A components/clm/tools/mksurfdata_map/src/unit_test_stubs -A components/clm/tools/mksurfdata_map/src/unit_test_stubs/mkncdio.F90 -A components/clm/tools/mksurfdata_map/src/test/mkindexmap_test -A components/clm/tools/mksurfdata_map/src/test/mkindexmap_test/test_mkindexmap.pf -A components/clm/tools/mksurfdata_map/src/test/mkindexmap_test/CMakeLists.txt - -========= Add get_max_indices and associated unit tests -A components/clm/tools/mksurfdata_map/src/test/mkgridmap_test -A components/clm/tools/mksurfdata_map/src/test/mkgridmap_test/CMakeLists.txt -A components/clm/tools/mksurfdata_map/src/test/mkgridmap_test/test_mkgridmap.pf - -List all existing files that have been modified, and describe the changes: - -========= New raw dataset for glacier region -M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -M components/clm/tools/mksurfdata_map/mksurfdata_map.namelist - -========= Get mksurfdata_map pfunit-based unit tests passing with new cime -M components/clm/tools/mksurfdata_map/src/README.unit_testing -M components/clm/tools/mksurfdata_map/src/CMakeLists.txt - -========= Add get_max_indices and associated unit tests; use get_max_indices to - regrid glacier region -M components/clm/tools/mksurfdata_map/src/mkgridmapMod.F90 -M components/clm/tools/mksurfdata_map/src/mkindexmapMod.F90 -M components/clm/tools/mksurfdata_map/src/mkglacierregionMod.F90 -M components/clm/tools/mksurfdata_map/src/test/CMakeLists.txt - -========= Allow building mkindexmapMod for unit tests - required stubbing out a - bunch of netcdf stuff -M components/clm/tools/mksurfdata_map/src/mkncdio.F90 - -========= Point to new surface datasets -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Extended namelist array for new region -M components/clm/cime_config/SystemTests/lvg.py - -========= Removed duplicate makefile rules -M components/clm/tools/mksurfdata_map/Makefile.data - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r246 -Originator(s): sacks (Bill Sacks) -Date: Wed Jun 14 12:40:31 MDT 2017 -One-line Summary: Update to latest cime - -Purpose of changes ------------------- - -Main change is to update to the latest version of cime. - -One of the changes in this cime version is that component-specific system tests -(e.g., LII, SSP) can now be defined in the component rather than in cime. So -this tag defines LII and SSP in CLM. In addition, this adds an LVG test (Land -Virtual Glaciers), which verifies that adding virtual glacier columns doesn't -change answers. - -Another significant change in this cime version is that the lnd -> glc -downscaling (i.e., remapping) method has been changed to be bilinear with a -later conservation correction, rather than area-conservative. This leads to -smooth fields on the CISM grid. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New drv_in namelist variable 'glc_renormalize_smb' - controls whether to apply - global corrections to the downscaled lnd -> glc smb for conservation - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Moves LII and SSP test definitions into CLM -- Adds new test type, LVG -- Adds an LVG test - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - cheyenne_intel - ok - hobart_nag --- pass - hobart_pgi --- ok - hobart_intel - pass - - ok means tests pass, some answers change as noted below - -CLM tag used for the baseline comparisons: clm4_5_16_r245 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: see below - - what platforms/compilers: see below - - nature of change (roundoff; larger than roundoff/same climate; new climate): see below - - (1) Changes answers for cases with CISM, due to new downscaling - method. These changes show up only for long tests with CISM, and are - potentially climate-changing: - - FAIL SMS_Lm37.T31_g37_gl4.IG1850CLM50.cheyenne_intel.clm-glcMEC_long BASELINE clm4_5_16_r245 - FAIL SMS_Lm37.T31_g37_gl4.IG1850CLM50.yellowstone_intel.clm-glcMEC_long BASELINE clm4_5_16_r245 - - (2) Changes answers for hobart-pgi tests, due to new version of the pgi - compiler on hobart. Magnitude of the change not investigated. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime: cime5.3.0-alpha.21 -> cime5.3.0-alpha.27 - -List all files eliminated: none - -List all files added and what they do: - -========= CLM-specific system tests are now defined here rather than in - cime. Also, added an LVG test type: Land Virtual Glacier. -A components/clm/cime_config/config_tests.xml -A components/clm/cime_config/SystemTests -A components/clm/cime_config/SystemTests/lii.py -A components/clm/cime_config/SystemTests/ssp.py -A components/clm/cime_config/SystemTests/lvg.py - -List all existing files that have been modified, and describe the changes: - -========= Ran through -cleanxml, and added an LVG test -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r245 -Originator(s): sacks (Bill Sacks) -Date: Wed Jun 14 12:13:54 MDT 2017 -One-line Summary: Only adjust glc_mec topographic heights if glc_do_dynglacier is true - -Purpose of changes ------------------- - -Two changes in this tag: - -(1) Only adjust glc_mec topographic heights if glc_do_dynglacier is true (this - namelist variable is controlled by the GLC_TWO_WAY_COUPLING xml - variable). Previously, CLM updated its glacier topographic heights even if - this variable was false (so we were not updating areas from CISM). Bill - Lipscomb and Jeremy Fyke agreed a while ago that we should change this. None - of us could remember why we initially set it up to always update topographic - heights, but we felt that it's more intuitive to avoid updating topographic - heights if we're not updating glacier areas. - - Note that setting GLC_TWO_WAY_COUPLING=FALSE is *not* a common thing to do, - so this change does not affect most cases. (The typical way of doing one-way - coupling with CISM is to use CISM2%NOEVOLVE, which turns off ice evolution - but keeps GLC_TWO_WAY_COUPLING=TRUE in order to update CLM's glacier areas - and topographic heights at initialization.) - -(2) Adds some user mods and testmods (currently unexercised) for cmip6 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: New test mods directories, currently not exercised (I'll add tests soon) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - ok - hobart_nag --- ok - hobart_pgi --- ok - hobart_intel - ok - - ok means tests pass, a few expected baseline comparison failures - -CLM tag used for the baseline comparisons: clm4_5_16_r244 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Cases with GLC_TWO_WAY_COUPLING=FALSE - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - new climate - - This affects tests with glcMEC_changeFlags and glcMEC_spunup_1way testmods - - Also, NLCOMP failures for a few tests, I think explainable by the process Erik - used to update some testmods to get LII tests passing: - FAIL SMS_D_Ln1.f09_g17.ICLM45BGC.yellowstone_gnu.clm-defaultf09IC NLCOMP - FAIL ERP.f19_g17_gl4.IG1850CLM45.cheyenne_intel.clm-glcMEC_spunup_1way NLCOMP - FAIL SMS_D_Ln1.f19_g17_gl4.IG1850CLM45.cheyenne_intel.clm-glcMEC_spunup_1way NLCOMP - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - -========= Renamed -D components/clm/cime_config/usermods_dirs/clm/clm5_OutputCrop/user_nl_clm -D components/clm/cime_config/usermods_dirs/clm/clm5_OutputCrop/shell_commands -D components/clm/cime_config/usermods_dirs/clm/clm5_OutputCrop -D components/clm/cime_config/usermods_dirs/clm - -List all files added and what they do: - -========= Top-level cmip6 usermods directory, which will include other usermods - directories needed for the cmip6 runs -A components/clm/cime_config/usermods_dirs/cmip6/include_user_mods -A components/clm/cime_config/usermods_dirs/cmip6 - -========= Renamed from clm5_OutputCrop; also added some glacier output fields - needed for cmip6 runs -A components/clm/cime_config/usermods_dirs/cmip6_output/user_nl_clm -A components/clm/cime_config/usermods_dirs/cmip6_output/shell_commands -A components/clm/cime_config/usermods_dirs/cmip6_output/README -A components/clm/cime_config/usermods_dirs/cmip6_output - -========= Turns on virtual glacier columns over Antarctica. This is desired by - the LIWG for cmip6 runs, so that we can have the Antarctica output - that would be needed to later run an ice sheet model over - Antarctica. However, it comes with a 10% performance cost. -A components/clm/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm -A components/clm/cime_config/usermods_dirs/cmip6_glaciers - -========= Test mod that allows testing the cmip6 usermods (currently not - exercised with any tests) -A components/clm/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/cmip6 - -========= Test mod that allows running the new LVG (virtual glaciers) test - (currently unexercised) -A components/clm/cime_config/testdefs/testmods_dirs/clm/no_vector_output/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/no_vector_output/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/no_vector_output/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/no_vector_output - -List all existing files that have been modified, and describe the changes: - -========= Only adjust topographic heights if glc_do_dynglacier is true -M components/clm/src/main/TopoMod.F90 -M components/clm/src/main/test/topo_test/test_topo.pf -M components/clm/src/main/glc2lndMod.F90 - -========= Add _musgs to f10_f10 grid -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r244 -Originator(s): erik (Erik Kluzek) -Date: Fri Jun 9 14:26:07 MDT 2017 -One-line Summary: Update cime and cism externals, changes answers for IG compsets, test g17 grids, fix a few issues, update mksurfdata_map - -Purpose of changes ------------------- - -Update the cime version which includes some important updates. Remove lt_archive, new script query_config -to query compsets and grids etcetera. Force user to always use case.submit rather than allow them to submit -to batch queue on their own. Some updates to handling of namelist items in user_nl_clm. All grids now contain -a mask variable. Also fixes a couple glitches from the previous version, see bugs fixed below. - -Update cism which changes answers (for cases running with CISM) as 4km grid was changed. - -Fix some small issues with CLM. Fix interpolation issue with GSSUN and GSSHA, use shr_mpi needed for unit-testing, and -fix an issue with a use of MCT routines for clm40. - -Several updates to mksurfdata_map, fixing problems, starting to get it working on cheyenne, and upgrading to latest -CMIP6 PFT datasets from Peter Lawrence. - --Update cime and cism. --Unit tests moved to cime/scripts/fortran_unit_testing/. --Include Jim Edward's configcompsetupdate changes here. --Convert mosart half-degree file from NetCDF-4 to NetCDF-3. --Change grids in test lists so that mask is added to grids that need it (i.e. f45_f45 becomes f45_f45_mg37). --Add note about supported compset IGM1850GSWCLM50BGCCROP for f09_g17, f19_g17. --Use grids back to g16 as g17 domain files aren't there. --Get LII tests working. --Rerun the list of tests that failed, see if works again because of a system issue. --use old g16 mask for CLM40 tests. --Add CMIP5/CMIP6 names to surfdata file creation. --Bring in mksrfunreplu branch. --New rawdata PFT datasets from Peter. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): [If none, remove this line] - 2468 GSSUN/GSSHA interp issue - 2440 change to orderedPoints for clm40 as well - 2425 mksurfdata_map changes from Sean didn't get incorporated - 2419 Irrigated areas are low in mksurfdata_map - 2399 Problem with urban points with latest mksurfdata_map -CIME Issues fixed (include issue #): [If none, remove this line] - #1215 -- (in this version of cime) TestStatus sometimes needs to have write permission added - #1155 -- manage_case doesn't work (renamed to query_config) - #848 -- ./xmlquery --list-all doesn't work (refactored) - -Known bugs introduced in this tag (include bugzilla ID): - 2471 PTCLM doesn't work - 2470 CLM is getting the mask from the clm namelist_defaults rather than from top level scripts - 2469 Cleanup restartvar_{DIMS}d_{TYPE} to ONLY be valid for a 1d interface - 2467 Case on non-year boundary dies with error about ignoring ic_date for a crop case, even though for a branch or hybrid case - 2465 ICLM45VIC compset doesn't actually turn VIC on - 2464 allowlakeprod are outputing standard variables instead of the "lake" specific versions... - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - cime update brought in quite a few changes -- Add skip-preview-namelist to case.submit and case_run. - - Renamed manage_case to query_config. - - manage_case -> query_config - --compset -> --compsets - --machine -> --machines - added 'all' option for --compsets - added 'current' and to --machines - - Remove all references to lt_archive which will not be supported in - CESM2.0. - - Add Support for '+=' in Namelists. - - Add --component Option to preview_namelist. - - Add Support of true and false in Namelist. - - Force user to always go through case.submit. - - Adds support for namelist entries of the form foo(3) = 'a' - - esmf_logging (and therefore drv_in) are now optional - - New run time XML variable: ESMF_LOGFILE_KIND - - New --answer flag to create_newcase - -Update so that all relevent grids contain a mask variable. - - Add preview_run to case.run - -Changes made to namelist defaults (e.g., changed parameter values): Added mapping files for 0.25x0.25_MODIS - -Changes to the datasets (e.g., parameter, surface or initial files): Just to datasets to create surface datasets - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - - Use ESMF7 on yellowstone and cheyenne. - - Big cs.status upgrade. - - Add --input-dir argument to create_test - -Changes to tests or testing: - Change most gx1v6 masks to gx1v7 - Keep clm40 tests at gx1v6 - -Code reviewed by: self, jedwards (config), mvertens, sacks (unit-tests) - -Did you follow the steps in .CLMTrunkChecklist: Yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - FAIL - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - cheyenne_intel - OK - hobart_nag --- OK - hobart_pgi --- PASS - hobart_intel - PASS - -CLM tag used for the baseline comparisons: clm4_5_16_r243 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for IG compsets with active glacier model - - Summarize any changes to answers, i.e., - - what code configurations: Any with CISM2 - - what platforms/compilers: All - - nature of change: minor -Changes answers for cases with CISM2 at 4km (the default resolution for CISM2 cases) -- Even changes answers for standard one-way coupled cases (CISM2%NOEVOLVE) -- Fields on the CISM grid will have DIMSIZEDIFF -- Fields sent to CLM have roundoff-level differences -- time variable changes for all cases with CISM - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, cism, mosart - cime to cime5.3.0-alpha.21 - cism to cism2_1_33 - mosart to mosart1_0_24 - -List all files eliminated: - - D components/clm/tools/SVN_EXTERNAL_DIRECTORIES - -List all files added and what they do: - - M components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/README --- Add description of this testmods - and how to update the finidat file for it - A components/clm/test/tools/tests_pretag_cheyenne_nompi ---- Add test list for cheyenne - -List all existing files that have been modified, and describe the changes: - - M components/clm/test/tools/TCBCFGtools.sh - Source $INITMODULES - M components/clm/test/tools/test_driver.sh - Add cheyenne, set INITMODULES - M components/clm/test/tools/TSMCFGtools.sh - Handle CSMDATA - M components/clm/test/tools/nl_files/gen_domain.ne30.runoptions - Use CSMDATA for path to mapping file - M components/clm/test/tools/nl_files/gen_domain.T31.runoptions -- Use CSMDATA for path to mapping file - - M components/clm/tools/mkmapdata/regridbatch.sh ---------------- Set PBS for cheyenne, increase regrid_num_proc to 36 - M components/clm/tools/mkmapdata/mkmapdata.sh ------------------ Increase REGRID_PROC to 36, show defaults in --help, - change so -b means run with mpi, also create 0.25x0.25_MODIS maps, add cheyenne, rm hopper - M components/clm/tools/mksurfdata_map/Makefile.data ------------ Add global-present-T42 - M components/clm/tools/mksurfdata_map/src/mkharvestMod.F90 ----- Change harvest_fieldnames and string_undef - M components/clm/tools/mksurfdata_map/src/mkgridmapMod.F90 ----- Add gridmap_areaave_scs interface which - multiplys weight by ratio of source over destination weight (set to zero if destination weight is zero) - M components/clm/tools/mksurfdata_map/src/mkpftMod.F90 --------- Use gridmap_areaave_scs interface rather than default - one, passing down source weight of pctnatveg_i and desitination weight of pctnatveg_o (both mulitipled by 0.01) - if zeroing out also set pctnatveg_o, pctcrop_o, pct_nat_pft_o, pct_cft_o to zero, and first entry of pct_nat_pft_o - and pct_cft_o to 100 - M components/clm/tools/mksurfdata_map/mksurfdata_map.namelist -- Update with new files - M components/clm/tools/mksurfdata_map/mksurfdata.pl ------------ Add cmip_series to output filenames, use vegtyp to get harvest files, - - M components/clm/tools/mksurfdata_map/landuse_timeseries_hist_78pfts_simyr1850-2015.txt - Update with new datafiles. Note, each - year is repeated once to point to same data (to be used for harvesting). This allows harvest files to be seperate. - - M components/clm/bld/unit_testers/build-namelist_test.pl --------------- Don't test 0.25x0.25 grid - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Add 0.25x0.25 MODIS mapping file, harvest, PFT, LAI, and soil-color - are 0.25x0.25_MODIS, harvest files are: mksrf_fvegtyp, Update: LAI, soil-color, and PFT files, remove harvest files - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml ----- Add 0.25x0.25 to hgrid and res, add 2015 to sim_year, and - 1980-2015 to sim_year_range, - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ------- Add 0.x25x0.25_MODIS mapping files - - M components/clm/cime_config/config_compsets.xml ------- Changes from Jim Edwards to update to version 2.0 which will do xmllint checking - on the file, add for f09, f19 IGM1850GSWCLM50BGCCROP compsets - - M components/clm/cime_config/testdefs/testlist_clm.xml - Add SMS _Ln1 tests to correspond to each LII test (to make updating finidat files - for LII tests easier, update grids to include mask when needed, and update most g16 mask tests to g17 (except clm40 tests which - need to remain at g16) - M components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/user_nl_clm ------- Update finidat file, set use_init_interp to True - and add notes on how to update it - M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm - Update finidat file, set use_init_interp to True - and add notes on how to update it - M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README ------ Add notes on how to update the finidat file - - M components/clm/SVN_EXTERNAL_DIRECTORIES - Point to PTCLM here - - M components/clm/src_clm40/main/GetGlobalValuesMod.F90 - Change mct_gsmap_OP to mct_gsmap_orderedPoints (bug 2440) - M components/clm/src_clm40/main/ncdio_pio.F90.in ------- Change mct_gsmap_OP to mct_gsmap_orderedPoints (bug 2440) - M components/clm/src/biogeochem/CNSharedParamsMod.F90 -- Use shr_mpi_bcast rather than straight MPI (important for new unit tests) - M components/clm/src/README.unit_testing --------------- Updated notes on how to do it from Bill Sacks - M components/clm/src/biogeophys/PhotosynthesisMod.F90 -- Set switchdim=T for GSSUN/GSSHA (bug 2468) - M components/clm/src/CMakeLists.txt -------------------- Add include(CIME_initial_setup) - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r243 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue May 23 16:27:42 MDT 2017 -One-line Summary: History output cleanup from Dave Lawrence - -Purpose of changes ------------------- - -* Reduce default history output by setting numerous variables to - default=inactive, limiting some 3d vars to active soil layers only. - -* Update default history output for CLM5. - -* Added diagnostic new output for DWT_WOOD_PRODUCTC_GAIN_PATCH, - GS_MOL, lake_icefracsurf_col, h2osoi_liq_tot_col, h2osoi_ice_tot_col - -* Remove double accounting for CNSoy fixation when FUN is on. - -* Bug fixes to allow landunit-level and column-level averaging and - vector output using the hist_type1d_pertape namelist option (LAND - for land-unit, COL for column-level). Note that if a user asks for - a variable at a subgrid level that is not available at that subgrid - level, the model will crash ungracefully. An example would be - asking for TOT_WOODPRODC at the land-unit level when this variable - is only available at the grid cell level, or asking for H2OSOI at - the pft-level when H2OSOI is a column-level variable. Code may be - added in a future tag that will inform the user of the error. - -* Add usermods dir for recommended clm5 crop default output. To use - the usermod when creating a new case: - - ./create_newcase --compset HIST_DATM%GSWP3_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2_SWAV \ - --user-mods-dir clm/clm5_OutputCrop \ - ... machine, compiler, grid, case name, etc... - - -Bugs fixed or introduced ------------------------- - -None, but see note below in testing about c14 bombspike test. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - The default history output has been reduced. You may need to - explicitly request fields of interest from the namelist. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Dave Lawrence, Ben Andre - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - all tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - ok, see note below - hobart_nag - ok - hobart_pgi - ok - hobart_intel - ok - -CLM tag used for the baseline comparisons: clm4_5_16_r242, no - yellowstone intel baselines were generated for clm4_5_16_r242 - - Baselines comparisons for clm45/clm5 tests show: - 1. changes in fields sizes (expected, restrict vertical fields to nlevsoi) - - 2. different fields on current and baseline files (expected, new default active/inactive) - - 3. no RMS differences, except the following tests: - - These tests failed baseline comparisons with RMS differences in - testing due to the soy nitrogen double accounting fix. - - ERP_P60x2_Lm36.f10_f10.ICRUCLM50BGCCROP.cheyenne_intel.clm-clm50cropIrrigMonth_interp - ERS_Ly3.f10_f10.I1850CRUCLM50BGCCROP.cheyenne_intel.clm-clm50KSinkMOut - ERS_Ly5_P60x1.f10_f10.IHISTCLM50BGCCROP.cheyenne_intel.clm-cropMonthOutput - - ERP_P60x2_Lm36.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-clm50cropIrrigMonth_interp - ERS_Ly3.f10_f10.I1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KSinkMOut - ERS_Ly5_P60x1.f10_f10.IHISTCLM50BGCCROP.yellowstone_intel.clm-cropMonthOutput - - The ciso-c14 bombspike1963 test failed baseline test with RMS - differences in C14_* fields on cheyenne_intel. This did not have - differences when tested against r273 and yellowstone_intel. This - seems to be intermintent, there was at least one test run with - r242 cheyenne_intel where this passed without RMS differences. - - SMS_D_Ly2.1x1_brazil.IHISTCLM50BGC.cheyenne_intel.clm-ciso_bombspike1963 - - - -Answer changes --------------- - -Changes answers relative to baseline: some clm5 compsets - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - - what code configurations: removal of double accounting for soy - nitrogen fixation from clm5 crop runs with fun active. See tests - above. - - - what platforms/compilers: all - - - nature of change (roundoff; larger than roundoff/same climate; - new climate): unknown, presumed larger than roundoff same - climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? n/a - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: n/a - - URL for LMWG diagnostics output used to validate new climate: n/a - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -New usermods with default output for clm5 crop runs - A clm/cime_config/usermods_dirs/clm/clm5_OutputCrop - A clm/cime_config/usermods_dirs/clm/clm5_OutputCrop/user_nl_clm - A clm/cime_config/usermods_dirs/clm/clm5_OutputCrop/shell_commands - -List all existing files that have been modified, and describe the changes: - - M clm/cime_config/config_component.xml - update component description from Erik Kluzek - -Set history fields active/inactive: - M clm/src/biogeochem/CNVegCarbonStateType.F90 - M clm/src/biogeochem/CNVegNitrogenStateType.F90 - M clm/src/biogeochem/CNVegNitrogenFluxType.F90 - M clm/src/biogeochem/CropType.F90 - M clm/src/biogeophys/EnergyFluxType.F90 - don't output btran unless hydrstress active - M clm/src/biogeophys/TemperatureType.F90 - MM clm/src/biogeophys/HumanIndexMod.F90 - M clm/src/biogeophys/SoilHydrologyType.F90 - M clm/src/biogeophys/SolarAbsorbedType.F90 - M clm/src/biogeophys/CanopyStateType.F90 - M clm/src/biogeophys/SurfaceRadiationMod.F90 - M clm/src/biogeophys/WaterfluxType.F90 - variable renaming - M clm/src/biogeophys/SoilStateType.F90 - -New diag output, set default active/inactive fields: - M clm/src/biogeochem/CNVegCarbonFluxType.F90 - M clm/src/biogeochem/CNProductsMod.F90 - M clm/src/biogeophys/PhotosynthesisMod.F90 - M clm/src/biogeophys/LakeStateType.F90 - M clm/src/biogeophys/LakeTemperatureMod.F90 - M clm/src/biogeophys/HydrologyNoDrainageMod.F90 - vertically summed water state calc - M clm/src/biogeophys/WaterStateType.F90 - - -Default active/inactive history fields, restrict output to nlevsoi: - M clm/src/biogeochem/ch4Mod.F90 - M clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 - M clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 - M clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 - M clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 - M clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 - - -FUN Soy Nitrogen Fixation double accounting: - M clm/src/biogeochem/CNDriverMod.F90 - -Subgrid mapping: - M clm/src/main/histFileMod.F90 - M clm/src/main/subgridAveMod.F90 - - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r242 -Originator(s): erik (Erik Kluzek) -Date: Sun May 21 21:16:34 MDT 2017 -One-line Summary: Use finundated streams for CLM50, and use ndep if it comes from cpl - -Purpose of changes ------------------- - -For methane, read in inversion for TWS to Prigent Satellite dataset from a streams file for CLM50. For -CLM45 still read in ZWT inversion parameters from the surface dataset. You can read it from the streams -file if you provide it to the namelist. Answers change for CLM50BGC compsets because of this change to -methane. The change does affect results outside of methane after enough time. - -Add option to use nitrogen deposition sent from the coupler rather than from datasets (from mvertens). - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - bug 2462 -- TWS restart - bug 2457 -- remove FIND_HIST - bug 2454 -- species masterlist confusion - bug 2443 -- ndep - bug 2456 -- rm extra settings - bug 2463 -- T42 SP dataset - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): New namelist item - for finundated streams stream_fldfilename_ch4finundated. It can be used for both TWS_inversion - which is now the CLM50 default, or the ZWT_inversion (CLM45 default), but by default CLM45 - is reading ZWT inversion parameters from the surface dataset - -Changes made to namelist defaults (e.g., changed parameter values): ZWT_inversion for CLM45 and TWS_inversion for CLM50 - for inundated fraction - -Changes to the datasets (e.g., parameter, surface or initial files): Add 2000 T42 fsurdata file - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: Add two new tests - Add test for hourly radiation with lightning resolution at half-degree - And test with reseeding and reset of snow - -Code reviewed by: self,mvertens - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (94 compare tests FAIL) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - Didn't run - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - cheyenne_intel - OK - hobart_nag --- PASS - hobart_pgi --- PASS - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_16_r241 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, CLM50 - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 (with finundated streams for TWS_inversion) - - what platforms/compilers: All - - nature of change: similar climate, but methane changes (which does feedback into system) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: None - -List all files added and what they do: Add new tests - - A components/clm/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/shell_commands - A components/clm/cime_config/testdefs/testmods_dirs/clm/rad_hrly_light_res_half/user_nl_datm - A components/clm/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/user_nl_clm - A components/clm/cime_config/testdefs/testmods_dirs/clm/reseedresetsnow/include_user_mods - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/CLMBuildNamelist.pm -------------------- Remove fin_use_fsat, set finundation_method - and get finundated streams file if TWS_inversion, add ch4finundated namelist group - M components/clm/bld/unit_testers/build-namelist_test.pl ---- Add test for change to finundated if not methane - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Remove extra settings of use_init_interp, - add T42 present day fsurdat file, remove fin_use_fsat, set finundation_method to TWS_inversion for CLM50 - and ZWT_inversion for CLM45, set finundation_res=1.9x2.5 and set stream_fldfilename_ch4finundated file for it - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add: stream_fldfilename_ch4finundated, finundation_res - remove fin_use_fsat, correct finundation_method documentation - - M components/clm/cime_config/config_compsets.xml ------- Add IGMCRUCLM50SP, IGMCRUCLM50BGCROP compsets - M components/clm/cime_config/testdefs/testlist_clm.xml - Change prealpha/prebeta yellowstone_intel/gnu tests to cheyenne - add new tests for reseedresetsnow and rad_hrly_light_res_half - - M components/clm/src/main/clm_instMod.F90 -------- Pass NLFilename down to ch4 Init - M components/clm/src/main/clm_varctl.F90 --------- Add ndep_from_cpl variable - M components/clm/src/main/clm_driver.F90 --------- If ndep_from_cpl is true don't do ndep_interp - M components/clm/src/main/clm_initializeMod.F90 -- If ndep_from_cpl is true don't do ndep_init and ndep_interp - M components/clm/src/main/histFileMod.F90 -------- Add error check if field name is too long - M components/clm/src/biogeophys/WaterStateType.F90 - Add TWS to restart file - - M components/clm/src/cpl/clm_cpl_indices.F90 --- Set ndep_from_cpl based on existance of Faxa_nhx and Faxa_noy - M components/clm/src/cpl/lnd_import_export.F90 - Set forc_ndep_grc if ndep_from_cpl is set, convert units - - M components/clm/src/biogeochem/SpeciesNonIsotopeType.F90 --- Add trim's to strings to make sure blanks aren't added - M components/clm/src/biogeochem/ch4Mod.F90 ------------------ Pass NLFilename to Init, add ch4findstream data and Init to it - Remove fws_a/b/hist, remove fin_use_fsat use finundation_mtd Call ch4findstream%CalcFinundated is finundated streams are being - used (stream_fldfilename_ch4finundated is set), or if finundation_mtd_h2osfc, - M components/clm/src/biogeochem/ch4FInundatedStreamType.F90 - Add UseStreams method, get streams working properly and - M components/clm/src/biogeochem/SpeciesIsotopeType.F90 ------ Add trim for strings to make sure blanks don't happen - M components/clm/src/biogeochem/ch4varcon.F90 --------------- Remove fin_use_fsat - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r241 -Originator(s): sacks (Bill Sacks) -Date: Tue May 16 20:43:43 MDT 2017 -One-line Summary: Fix ch4 subtle dependence on processor count - -Purpose of changes ------------------- - -When we moved to using interpolated initial conditions in most cases, long tests -that change processor counts (ERP, PEM) began to fail (bug 2458). I tracked this -problem down to annsum_npp, annsum_counter, and specifically bug 1597. - -I found that, in both the original finidat and finidat_interp_dest, we have: - -- For coltype = 1, counter can be 0, 3600 or 5400 - -- For coltype = 200-something (crop), counter is always 5400 - -- For other coltypes, counter = 0 (but these shouldn't matter) - -My best guess is that there is some interaction between (1) the history of an -initial conditions file, and (2) dynamic landunits, which causes annsum_counter -to differ by column. Specifically, with (1): I think that problems arise when an -initial conditions file has (at some point in its history) arisen from a run -that didn't run for a complete year; e.g., this can happen in the course of -making an interp'ed initial conditions file - for which we typically run for one -or a few time steps. This can lead to a misalignment of the resetting of -annsum_counter relative to when dynamic landunits kick in, and thus the counter -can differ for different columns. - -This tag fixes the problem by making each column dependent on its own count, -rather than using the count from the first column on that MPI task. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 1597: awkward conditionals to determine end of year in CN AnnualUpdate -- 2458: ERP clm5 restart failure in clm4_5_16_r237 - -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] -- https://github.com/NCAR/CLM/issues/7 : CN annsum_counter can trigger mid-year, - and at different times for different columns - - Decision in talking with Erik and Keith was that we would not try to resolve - this right now - it seems that it can cause a bit of confusion, but no - scientific problems as far as we can tell. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Erik; conceptually reviewed by Keith - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - pending; I'll check them post-tag and open an issue if any fail - hobart_nag --- ok - hobart_pgi --- not run - hobart_intel - ok - - ok means tests pass, some baselines fail as expected - -CLM tag used for the baseline comparisons: clm4_5_16_r240 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Many configurations, when run for at least a year - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; expected to be same climate, but not investigated carefully. - - Answer changes can appear whenever we have an initial conditions file - where different columns have different values of the annsum_counter - restart field. This is the case for present-day restart files, as well as - at least one year-1850 restart file - (clmi.I1850CRUCLM45BGC.0241-01-01.1.9x2.5_g1v6_simyr1850_c170308.nc). - - The impact of this problem is expected to be small, at least if the - differences in annsum_counter values are small (which they are for the two - initial conditions files I have checked, and I expect this is the case for - others, too): In this case, the impact is that some annually-accumulated - fields reach their end-of-year mark a few time steps too early or late. - - However, I have not investigated the impact of this bug fix carefully. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeochem/CNAnnualUpdateMod.F90 - -========= New function to create a sub-filter based on an existing filter and a - column-level logical array -M components/clm/src/main/filterColMod.F90 -M components/clm/src/main/test/filter_test/test_filter_col.pf - -========= Remove no-longer-failing tests -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r240 -Originator(s): sacks (Bill Sacks) -Date: Mon May 15 14:48:22 MDT 2017 -One-line Summary: Make glc_dyn_runoff_routing real-valued - -Purpose of changes ------------------- - -The glc_dyn_runoff_routing variable tracks which CLM grid cells overlap -fully-coupled glc (CISM) grid cells, and which do not: In those that do not, CLM -needs to send the snow capping flux directly to runoff. Previously, this value -was a logical. However, we (Bill Lipscomb and Bill Sacks) realized that this -really needs to be real-valued - having a value between 0 and 1 where a CLM cell -partially overlaps the CISM domain. This is needed for complete conservation -when we are running with a fully-coupled (two-way-coupled) glc component. - -This changes answers for cases with two-way-coupled CISM, but does NOT change -answers for the typical one-way-coupled (%NOEVOLVE) case. - -Main changes are from Bill Lipscomb. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- There is some duplicate logic between CLM and the coupler in determining the - fraction of the CLM grid cell that overlaps with the active glc - domain. Ideally, we'd move all of the relevant logic into the coupler and - avoid needing it in CLM. See the TODO note in glc2lndMod.F90 - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - ok - hobart_nag --- ok - hobart_pgi --- not run - hobart_intel - ok - - ok means tests pass, baselines fail as expected - -CLM tag used for the baseline comparisons: clm4_5_16_r239 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: cases with CISM two-way coupled (i.e., without %NOEVOLVE) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff, but only changes answers around the margin of - Greenland, so expected to be same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/main/test/topo_test/test_topo.pf -M components/clm/src/main/glc2lndMod.F90 -M components/clm/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 - -========= Add a test to the xfail list which fails sporadically due to bug 2461 -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r239 -Originator(s): sacks (Bill Sacks) -Date: Sat May 13 20:35:52 MDT 2017 -One-line Summary: Avoid division by zero in snow WindDriftCompaction - -Purpose of changes ------------------- - -Tweak the equations in WindDriftCompaction to avoid division by 0, to fix bug -2460. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2460: Floating point trap in FWAMIP compset - -Known bugs introduced in this tag (include bugzilla ID): -- 2461: Multi-instance tests failing sporadically - This has actually been an issue for the last few tags, likely related to bug - 2289 - default finidat_interp_dest file name should have instance number - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Dave Lawrence - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - cheyenne_intel - ok - Did not do baseline comparisons for cheyenne tests - hobart_nag --- ok - hobart_pgi --- not run - hobart_intel - ok - - ok means tests pass, baseline comparisons fail for clm50 tests as expected - -CLM tag used for the baseline comparisons: clm4_5_16_r238 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - via analysis of the change: the new equation is algebraically identical to - the old; essentially we now have X*Y/Z rather than X/(Z/Y) - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main change, as described above -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Note sporadic multi-instance failure; remove a test from the xfail - list that is now passing -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r238 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Sat May 13 11:45:15 MDT 2017 -One-line Summary: ED is now an external library 'fates' - -Purpose of changes ------------------- - -The ongoing evolution of the 'ED' library is being done by -NGEE-Tropics as 'FATES'. This change removes the 'ED' directory and -replace it with link an external release of fates. - -The primary changes are to finish creation of an interface layer to -separate fates from CLM. There are also numerous science improvements -in the linked fates library. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2459 - patch from Erik Kluzek - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -Changes made to namelist defaults (e.g., changed parameter values): - - * ED has been completely rebranded as fates. This includes: - * New/renamed compsets - ICLM45ED is now ICLM45FATES, ICLM50FATES. - * Renamed name list variables: - * use_ed --> use_fates - * use_ed_spitfire --> use_fates_spitfire - - * New namelist variable: fates_paramfile, this can point to either - the clm parameter file, or a standalone fates parameter file - depending on user preference. All fates dimensions and variables - are namespaced by 'fates_'. - - * Fates can not restart and interpolate from a CLM-{SP,CN,BGC} - initial conditions file. It must be run in cold start or restart - from a CLM-fates restart file. - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - - * Add tests to aux_clm45 using the fates compsets and renamed the ed - test mods to fates and fatesFire. - - * Added the cheyenne_intel test list to aux_clm45 - - * all namelist tests are expected to fail because of use_ed -> use_fates rename. - -Code reviewed by: - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - all tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - cheyenne_intel - [ experimental, see xfails list ] pass w/ xfails - hobart_nag - pass w/ xfails - hobart_pgi - not run per CLM-CMT discussion, see bugz 2447, 2455 - hobart_intel - pass - -CLM tag used for the baseline comparisons: clm4_5_16_r237 - - -Answer changes --------------- - -Changes answers relative to baseline: answer changing for ED/fates - compsets, but bit for bit for all other clm45 and clm50 compsets - - Verified not answer changing for CLM50 compsets via test suite, and - 20 year simulation by Dave Lawrence and Keith Olseson. - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ED/fates compsets only - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): unknown - - If bitwise differences were observed, how did you show they were no worse - than roundoff? n/a - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: n/a - - URL for LMWG diagnostics output used to validate new climate: n/a - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): - -A components/clm/SVN_EXTERNAL_DIRECTORIES - new SVN_EXTERNALS file for fates -A components/clm/src/fates - -List all files eliminated: - -D components/clm/src/ED - removed and replaced by fates external - -List all files reamed: - -rename testmod edTest --> fates - default now with fire off -A testmods_dirs/clm/fates -A testmods_dirs/clm/fates/user_nl_clm -A testmods_dirs/clm/fates/shell_commands -D testmods_dirs/clm/edTest -D testmods_dirs/clm/edTest/user_nl_clm -D testmods_dirs/clm/edTest/shell_commands - -rename testmod edNoFire --> fatesFire -A testmods_dirs/clm/fatesFire -A testmods_dirs/clm/fatesFire/user_nl_clm -A testmods_dirs/clm/fatesFire/include_user_mods -A testmods_dirs/clm/fatesFire/shell_commands -D testmods_dirs/clm/edNoFire -D testmods_dirs/clm/edNoFire/user_nl_clm -D testmods_dirs/clm/edNoFire/include_user_mods -D testmods_dirs/clm/edNoFire/shell_commands - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M .ChangeLog_template - include cheyenne_intel -M parse_cime.cs.status - patch from Erik Kluzek bugz 2459 - -Point build to new src/fates directory instead of src/ED -M clm/cime_config/buildlib -M clm/bld/configure - -Update namelist with new fates paramfile, rename use_ed to use_fates -in namelist logic, rename functions to be fates instead of ed. Update tests. -M clm/bld/CLMBuildNamelist.pm -M clm/bld/unit_testers/build-namelist_test.pl -M clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M clm/bld/test_build_namelist/t/test_do_transient_pfts.pm -A clm/bld/test_build_namelist/t/test_fates_mode.pm -D clm/bld/test_build_namelist/t/test_ed_mode.pm -M clm/bld/test_build_namelist/t/test_do_harvest.pm -M clm/bld/test_build_namelist/t/test_do_transient_crops.pm -M clm/bld/namelist_files/namelist_definition_clm4_5.xml -M clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -Update test for fates, cheyenne_intel -M clm/cime_config/testdefs/ExpectedTestFails.xml -M clm/cime_config/testdefs/testlist_clm.xml - -Stub fates parameter interface for unit tests: -M components/clm/src/CMakeLists.txt -A + components/clm/src/unit_test_stubs/utils/clmfates_paraminterfaceMod_stub.F90 -M components/clm/src/unit_test_stubs/utils/CMakeLists.txt - -Rename ED compset FATES -M clm/cime_config/config_compsets.xml -M clm/cime_config/config_component.xml - -Fates interface -A clm/src/utils/clmfates_paraminterfaceMod.F90 -M clm/src/utils/clmfates_interfaceMod.F90 - -Rename use_ed to use_fates and other rebranding -M clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M clm/src/biogeochem/CNMRespMod.F90 -M clm/src/biogeochem/CNVegetationFacade.F90 -M clm/src/biogeochem/CNDriverMod.F90 -M clm/src/main/clm_varpar.F90 -M clm/src/main/subgridRestMod.F90 -M clm/src/main/atm2lndType.F90 -M clm/src/main/restFileMod.F90 -M clm/src/main/initSubgridMod.F90 -M clm/src/main/initVerticalMod.F90 -M clm/src/main/surfrdMod.F90 -M clm/src/biogeophys/PhotosynthesisMod.F90 -M clm/src/biogeophys/HydrologyDrainageMod.F90 -M clm/src/biogeophys/SurfaceAlbedoMod.F90 -M clm/src/biogeophys/SurfaceRadiationMod.F90 -M clm/src/biogeophys/SoilMoistStressMod.F90 -M clm/src/biogeophys/CanopyStateType.F90 -M clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M clm/src/dyn_subgrid/dynEDMod.F90 -M clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 -M clm/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 -M clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 - - -Update logic for fates compatibility and to use clm_fates interface -M clm/src/biogeochem/EDBGCDynMod.F90 -M clm/src/main/subgridWeightsMod.F90 -M clm/src/main/decompInitMod.F90 -M clm/src/main/clm_initializeMod.F90 -M clm/src/main/subgridMod.F90 -M clm/src/main/histFileMod.F90 -M clm/src/main/controlMod.F90 -M clm/src/main/clm_varctl.F90 -M clm/src/main/clm_driver.F90 -M clm/src/main/pftconMod.F90 -M clm/src/main/initGridCellsMod.F90 -M clm/src/main/decompMod.F90 -M clm/src/main/clm_instMod.F90 -M clm/src/main/readParamsMod.F90 -M clm/src/biogeophys/CanopyTemperatureMod.F90 -M clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M clm/src/biogeophys/BalanceCheckMod.F90 -M clm/src/biogeophys/WaterStateType.F90 -M clm/src/biogeophys/TotalWaterAndHeatMod.F90 -M clm/src/biogeophys/CanopyFluxesMod.F90 -M clm/src/biogeophys/SoilStateInitTimeConstMod.F90 -M clm/src/biogeophys/RootBiophysMod.F90 -M clm/src/biogeophys/OzoneMod.F90 - -M clm/src/main/paramUtilMod.F90 - new generic routines used by fates interface -M clm/src/main/PatchType.F90 - new patch array to distinguish between fates patch and clm pft - -A clm/src/biogeophys/SoilWaterPlantSinkMod.F90 - from SoilWaterMovement -M clm/src/biogeophys/SoilWaterMovementMod.F90 - moved to SoilWaterPlantSink -M clm/src/biogeophys/WaterfluxType.F90 - new variable for fates -M clm/src/biogeophys/SoilStateType.F90 - remove tsink - -=============================================================== -=============================================================== -Tag name: clm4_5_16_r237 -Originator(s): erik (Erik Kluzek) -Date: Tue May 9 15:05:51 MDT 2017 -One-line Summary: Latest parameter file and some changes for CLM50, CLM45-transient changes answers also - -Purpose of changes ------------------- - -Adjustments to CLM50 climate from Keith Oleson, Peter Lawrence, Fang Li, Rosie Fisher, Danica Lombardozzi, Will Weider, -Yaqiong Lu, Ben Sanderson, and David Lawrence. Some tweaks to the code and to parameters and the parameter file for CLM50. -Use Medlyn 2011 stomotal conductance rather than Ball-Berry. Modify photosynthesis and leaf maintence respiration for crop. -Limit irrigation if river flow is on and the storage drops below a threshold. Modify a long list of parameter values including -41 items on the parameter file. Only harvest up to 98% to allow for regrowth and divide by several terms rather than just deadstem. -Add slash harvesting fields (debris left from harvesting). Add in a hack to read in FWS_TWS_A/B if they are on the surface -dataset and use them to calculate finundation based on TWS rather than exponential function based on ZWT. For fires change an -if statement from checking if atmosphere is non-freezing to a specific soil layer. If crops have hit peak LAI set leaf allocation -to a small value. Make sure some retranslocation terms are positive. Let lnc in Photosynthesis max out at 10. Only vary baset -for crops for spring wheat and sugarcane (irrigated and non) rather than all crops. - -Coupled crop cases will change since we now use the radiation time-step for fertilization rather than the model time-step. -CLM45 cases remain the same with the exception for transient cases which change answers due to the change in how -harvest is handled. Fix a few minor bugs that came in with clm4_5_15_r236 with specific datasets and finidat file handling in scripts -(bugs 2448-2451). - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - - 2452 --- Change to divisor for harvest and also allow for regrowth - 2451 --- Bad comment marker in cropf10IC testmods - 2450 --- Make sure finidat is reset after setting to coldstart - 2449 --- Add no fail to init_interp_attributes and use_init_interp, needed for DV cases where interpolated IC files aren't there - 2448 --- Misnamed dataset in CLM xml database - -Known bugs introduced in this tag (include bugzilla ID): - 2457 --- Remove FINUN_HIST from history - 2456 --- Remove extra settings of use_init_interp - 2455 --- PGI specific error at initialization - 2454 --- masterlist_addfld getting confused with names for species... - 2453 --- Memory error with restart variable vcmx25t - 2447 --- Floating overflow for CLM50CROP case on hobart_nag in Photosynthesis - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): New slash harvest fields - SLASH_HARVESTC, DWT_SLASH_CFLUX, C13_DWT_SLASH_CFLUX, C14_DWT_SLASH_CFLUX - -Changes made to namelist defaults (e.g., changed parameter values): Many adjustments for CLM50 - modifyphoto_and_lmr_forcrop TRUE for CLM50 - stomatalcond_method Medlyn2011 for CLM50 with PHS - limit_irrigation_if_rof_enabled TRUE for CLM50 - Following values modified for CLM50 cases - modify baseflow_scalar, rh_low, bt_min, bt_max, cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha - non_boreal_peatfire_c, cropfire_a1, lfuel, cmb_cmplt_fact, irrig_threshold_fraction, - n_melt_glcmec, br_root, initial_Cstocks_depth - -Changes to the datasets (e.g., parameter, surface or initial files): CLM50 parameter file clm5_params.c170413.nc - Update CLM50 paramsfile, fsurdat-f09-2000-crop, flanduse_timeseries-f45-hist/f10-hist - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): finundation changes are messy - -Changes to tests or testing: Fixed testmods for one tests - -Code reviewed by: self,dlawren,lawrence,oleson,rosiefisher,wweider,lifang - -Did you follow the steps in .CLMTrunkChecklist: Yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS (93 comparison tests fail to clm4_5_15_r236) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - PASS - yellowstone_pgi - PASS - yellowstone_gnu (clm45 only) - PASS - hobart_nag --- OK - hobart_pgi --- OK - hobart_intel - PASS - -CLM tag used for the baseline comparisons: clm4_5_15_r236 - - -Answer changes --------------- - -Changes answers relative to baseline: All CLM50 and CLM45-transient - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 compsets and any transient cases with CLM45 - Also coupled crop cases - - what platforms/compilers: All - - nature of change: - Adjusted climate for CLM50 and changes to harvesting for CLM45 - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - modifyphoto_and_lmr_forcrop TRUE for CLM50 - stomatalcond_method Medlyn2011 for CLM50 with PHS - limit_irrigation_if_rof_enabled TRUE for CLM50 - Following values modified for CLM50 cases - modify baseflow_scalar, rh_low, bt_min, bt_max, cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha - non_boreal_peatfire_c, cropfire_a1, lfuel, cmb_cmplt_fact, irrig_threshold_fraction, - n_melt_glcmec, br_root, initial_Cstocks_depth - Update CLM50 paramsfile, fsurdat-f09-2000-crop, flanduse_timeseries-f45-hist/f10-hist - M components/clm/bld/CLMBuildNamelist.pm ------------------------- Make sure local finidat defined for cold start - allow nofail for use_init_interp and init_interp_attributes - - M components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC/user_nl_clm - Use \! for comment - - M components/clm/src/biogeochem/CNPhenologyMod.F90 ----------- Use radiation time-step rather than dt for Fertilization - M components/clm/src/biogeochem/CNFireBaseMod.F90 ------------ Change ufuel default - M components/clm/src/biogeochem/dynHarvestMod.F90 ------------ Only harvest up to 98% and divide by sum of several - terms rather than just deadstem (Peter Lawrence) - M components/clm/src/biogeochem/ch4FInundatedStreamType.F90 -- Modify endrun call - M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 ----- Slash flux to litter and CWD - M components/clm/src/biogeochem/CNFireLi2016Mod.F90 ---------- Change if statement from check on forcing temp non-freezing - to tsoi17 non-freezing (From Fang Li) - M components/clm/src/biogeochem/ch4Mod.F90 ------------------- Add ability to read in FWS_TWS_A/B terms from surface - dataset and use for calculation of finundated based on TWS rather than use exponential inversion on ZWT - M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 ------ Add slash harvest flux fields (Peter Lawrence) - M components/clm/src/biogeochem/CropType.F90 ----------------- Only do baset_map_latvary for spring wheat and sugarcane - both irrigated and non. - M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 - If crops have hit peaklai, then set leaf allocation to small value - make sure leafn_to_retransn, frootn_to_retransn and livestemn_to_retransn is positive - M components/clm/src/biogeophys/PhotosynthesisMod.F90 -------- Let lnc max out at 10 - -=============================================================== -=============================================================== -Tag name: clm4_5_15_r236 -Originator(s): erik (Erik Kluzek) -Date: Mon May 1 01:42:23 MDT 2017 -One-line Summary: New surface datasets, and landuse.timeseries files, as well as interpolating initial conditions for almost all cases - -Purpose of changes ------------------- - -New fsurdat and landuse.timeseries datasets for almost all resolutions. -New initial conditions datasets pointed to as much as possible for all resolutions (have ability to turn off to COLDSTART for some tests). -Normally model will now die, if it can't find initial conditions to interpolate from. -Reasonable f09 and f19 PE layout for cheyenne. Fix another issue on Cheyenne. Add new pgi/intel tests for hobart. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2445 -- ED not working with new datasets - 2444 -- dimensional change in URBAN_AC/URBAN_HEAT for interpolation of restart files - 2441 -- fire emissions on cheyenne - 2291 -- fire emissions with gnu compiler sometimes NaN, sometimes change answers for trivial changes - 2239 -- need new initial conditions files with extra metadata on them - -Known bugs introduced in this tag (include bugzilla ID): - 2447 -- Floating overflow for CLM50CROP case on hobart_nag in Photosynthesis - #1215 -- (in this version of cime) TestStatus sometimes needs to have write permission added - #? -- manage_case doesn't work - #? -- ./xmlquery --list-all doesn't work - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - All initial conditions have to be interpolated now, but there are ones that can be interpolated from for standard cases - NOTE NOW IF YOU WANT TO DO A COLD START USING ARBITRARY INITIAL CONDITIONS SET CLM_FORCE_COLDSTART=on - Also the model will normally fail if it can't find initial conditions close enough to interpolate from - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): A close finidat file will almost always be set - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): New fsurdat/finidat/landuse.timeseris - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: New pgi/intel tests for hobart - - Expected fails removed: bug 2239, 2291, and added SMS_Ld5_D_P24x1.f10_f10.IHISTCLM50BGC.hobart_nag.clm-monthl for bug 2447 - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - PASS - yellowstone_pgi - PASS - yellowstone_gnu (clm45 only) - PASS - hobart_nag --- OK - hobart_pgi --- OK - hobart_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_15_r235 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Almost all CLM45 and CLM50 configurations because of new datasets - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): similar climate - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: - ------- No longer need vrtlay_interp testmods, nor user_nl_clm for some -D components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropColdStart/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/user_nl_clm -------- Reduce size of files -D components/clm/tools/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c121107.nc -D components/clm/tools/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c121107.nc - -List all files added and what they do: - ------------- New test-mods with specific initial conditions -A components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/defaultf09IC -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropf10IC -A components/clm/tools/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc -A components/clm/tools/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc - -A components/clm/cime_config/testdefs/testmods_dirs/clm/allActive/shell_commands - CLM_FORCE_COLDSTART=on -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropColdStart/shell_commands - CLM_FORCE_COLDSTART=on -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/shell_commands - CLM_FORCE_COLDSTART=on - ------------- New unit test for surfrdUtilsMod subroutines -A components/clm/src/main/test/surfrdUtils_test/test_surfrdUtils.pf -A components/clm/src/main/test/surfrdUtils_test/CMakeLists.txt - -List all existing files that have been modified, and describe the changes: - -M components/clm/bld/CLMBuildNamelist.pm ---------------------------- Add better handling of finding finidat files - either with an exact match or interpolated from -M components/clm/bld/unit_testers/build-namelist_test.pl ------------ Add new failure tests, fix ed-test -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- Add init_interp_how_close and init_interp_sim_years -M components/clm/bld/namelist_files/namelist_defaults_overall.xml --- Start type is startup (requires finidat) for CLM45/CLM50 - unless use_cndv is on -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ---- init_interp_how_close=75 and init_interp_sim_years=1850,2000 - new 2-deg IC files IGM1850GSWCLM50BGCCROP, I1850CRUCLM45BGC, IGM2000GSWP3CLM50BGCCROPIRR, ICRUCLM45SP - redone 2-deg ICLM45BGCCROP - create_crop_landunit on unless ED is on - updated: fsurdat, flanduse.timeseries for all but 1x1_smallville_IA and 0.125x0.125 - -M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- ICLM45VIC.yellowstone now PASS - SMS_Lm25.f19_g16.ICLM45BGCCROP.yellowstone_gnu now PASS, new fail SMS_Ld5_D_P24x1.f10_f10.IHISTCLM50BGC.hobart_nag.clm-monthly - -M components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm - remove finidat and init_interp_fill_missing_with_natveg -M components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/user_nl_clm - set fsurdat, create_crop_landunit -M components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm ------ create_crop_landunit = .false. -M components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/edTest/user_nl_clm ------ remove finidat='' -M components/clm/cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm - new finidat -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/user_nl_clm - remove finidat -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/README -M components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands - CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm - remove finidat, - init_interp_fill_missing_with_natveg -M components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands- CLM_FORCE_COLDSTART=on -M components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm - new finidat -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - remove finidat -M components/clm/cime_config/testdefs/testlist_clm.xml -- new pgi/intel hobart tests, vrtlay_interp->vrtlay, - use defaultf09IC cropf10IC for two LII tests -M components/clm/cime_config/user_nl_clm ----------- Fix documentation of irrigate, add note to use CLM_FORCE_COLDSTART - rather than finidat=' ' -M components/clm/cime_config/config_component.xml - HIST and 2000 compsets for BGCCROP turn irrigation on -M components/clm/cime_config/config_pes.xml -- Add f09 and f19 PE layouts for cheyenne - -M components/clm/src/biogeochem/FireEmisFactorsMod.F90 - Copy crop factors from generic crop CFT's - -M components/clm/src/main/test/CMakeLists.txt ---------- Add new unit test -M components/clm/src/main/surfrdUtilsMod.F90 ----------- Add renormalize and convert_cft_to_pft functions - lighten tolerence for sums to equal 1 from 1.e-14 to 1.e-13 -M components/clm/src/main/surfrdMod.F90 ---------------- Add surfrd_pftformat, surfrd_cftformat to read in old/new formats - for CFT or PFT, also handle conversion of new CFT format to PFT format for ED -M components/clm/src/biogeophys/EnergyFluxType.F90 ----- For CLM50 urban add _L to URBAN_AC/HEAT to restart files, - so CLM45 won't be confused with CLM50 - -=============================================================== -=============================================================== -Tag name: clm4_5_15_r235 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 27 07:47:50 MDT 2017 -One-line Summary: Zero dynbal fluxes if namelist variable is set - -Purpose of changes ------------------- - -Some fully-active system tests were dying due to too-large sensible heat fluxes -(thousands or 10s of thousands of W m-2) generated from the dynbal -adjustments. These large fluxes arose because these tests trigger daily dynamics -of CISM (via the test_coupling namelist option), rather than the typical annual -coupling. The annual dribblers see these mid-year adjustments and apply them all -in a single time step, rather than spreading them throughout the year. - -The changes in this tag allow you to set a namelist variable -(for_testing_zero_dynbal_fluxes) to force the dynbal fluxes to zero. Typically, -this namelist variable should only be used for testing: setting it to -.true. breaks water and energy conservation. We will set this to true in the -fully-active tests that use daily CISM dynamics. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- new namelist variable, for_testing_zero_dynbal_fluxes; should only be used for - testing - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_15_r234 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Changes as described above -M components/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_15_r234 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Apr 14 08:34:22 MDT 2017 -One-line Summary: Update rtm and mosart externals - -Purpose of changes ------------------- - -Update externals to rtm1_0_61 and mosart1_0_23. - -Includes change to python build-namelist (rtm, mosart), histfile -bugfix (rtm, mosart), and science bugfix / changes (mosart). - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2434 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - python build namelist for rtm will no longer automatically point rtm - to a clm restart file. rtm should be configured to generate and read - it's own restart files. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) : none - - ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -rtm was not outputing a restart file for the ref run in SSP tests, but -was attempting to read one during the second run because of -build-namelist changes in rtm1_0_60. All SSP tests in aux_clm45 and -prebeta were changed to use a new test mod, rtmColdSSP, that forces -rtm to do a cold start when coming out of spinup. - -Old RCP/clm40 tests that were not compatible with new rtm -build-namelist behavior were removed. - -Code reviewed by: self, discussion with Erik Kluzek. - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - n/a, not run - - unit-tests (components/clm/src): - - yellowstone - n/a, not run - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - All tests passed bit for bit except: - - * expected failures - - * Tests with mosart passed functionality, answer changing as expected. - - * SSP tests passed functionality, but don't have baselines - because of test-mod change. Manually ran cprc to compare with - clm4_5_15_r233, files were reported as identical. - - e.g. cprnc clm4_5_15_r233/SSP_D_Ld10.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default/clm2.h0.0001-01-06-00000.nc clm4_5_15_r234-prelim/SSP_D_Ld10.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-rtmColdSSP/clm2.h0.0001-01-06-00000.nc - - -CLM tag used for the baseline comparisons: clm4_5_15_r233 - - -Answer changes --------------- - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all runs with mosart - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): unknown, assumed same climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - mosart1_0_23 was reviewed by Sean Swenson and Dave Lawrence in - a long coupled run and approved. - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): - -rtm1_0_61, mosart1_0_23 - -List all files eliminated: none - -List all files added and what they do: - -New test mod so rtm will do a cold start during SSP tests. - -A clm/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP -A clm/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/include_user_mods -A clm/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm - -List all existing files that have been modified, and describe the changes: - -Remove old RCP/clm40 tests that were not compatible with new rtm -behavior. Update SSP tests in aux_clm45 and prebeta to use new -rtmColdSSP testmod. - -M clm/cime_config/testdefs/testlist_clm.xml - - -=============================================================== -=============================================================== -Tag name: clm4_5_15_r233 -Originator(s): erik (Erik Kluzek) -Date: Tue Apr 11 23:30:45 MDT 2017 -One-line Summary: Pull out some constants and options to namelist - -Purpose of changes ------------------- - -Pull out a list of constants and options to namelist control. Decrease a few error tolderances. -Add in reseed_dead_plants namelist option, so can reseed dead plants for BGC on a restart. -Reenable LND_TUNING_MODE, although currently set the same for all options. Add some new -compsets in. Fix a few bugs, including Jim Edward's fix for vector output. -Start adding in the stream option for finundated. Add option to turn Medlyn photosynthesis on. -Replace & with & in namelist_definition_clm4_5.xml - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2440 Remove use of mct_gsmap_op and replace with mct_gsMap_orderedPoints - 2430 Problem with units on new landuse.timeseries datasets - 2184 vector (1d) history output crashes for some fields - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): Added new parameters to namelist - New namelists: cnvegcarbonstate and cn_general - New namelist items: - modifyphoto_and_lmr_forcrop, stomatalcond_method, lfuel, ufuel, cmb_complt_fact, - initial_Cstocks_depth, ndep_taxmode, ndep_varlist, init_interp_attributes, reseed_dead_plants, - initial_vegC, finundation_method - New output history variables: Remove RSCANOPY unless use_ed add: VCMX25T, JMX25T, TPU25T - New compsets I1850GSWCLM50BGCCROP, IM1850GSWCLM50BGCCROP, IGM1850GSWCLM50BGCCROP, IGMHISTGSWCLM50BGCCROP - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): params files - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (183 test fail comparison to previous namelists) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_15_r232 - - -Answer changes --------------- - -Changes answers relative to baseline: None bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: - --------- Start adding ability to read finundated streams data (currently disabled) - A components/clm/src/biogeochem/ch4FInundatedStreamType.F90 - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/CLMBuildNamelist.pm --- Add setup_logic_cnvegcarbonstate, - new namelists: cnvegcarbonstate and cn_general, refactor how finidat files - were being found to a better more general methodology that allows a second - go to find finidat file to interpolate from (currently disabled) - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ---- New settings: - modifyphoto_and_lmr_forcrop, stomatalcond_method, use_init_interp, init_interp_attributes - initial_Cstocks_depth, initial_vegC, and new params file with medlynslope/intercept - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- New namelist items: - modifyphoto_and_lmr_forcrop, stomatalcond_method, lfuel, ufuel, cmb_complt_fact, - initial_Cstocks_depth, ndep_taxmode, ndep_varlist, init_interp_attributes, reseed_dead_plants, - initial_vegC, finundation_method - M components/clm/bld/unit_testers/build-namelist_test.pl -- Test that use_init_interp=.true. with - finidat blank is fails - - M components/clm/cime_config/config_component.xml - Set LND_TUNING_MODE by compset - M components/clm/cime_config/config_compsets.xml -- Add: I1850GSWCLM50BGCCROP, IM1850GSWCLM50BGCCROP, - IGM1850GSWCLM50BGCCROP, IGMHISTGSWCLM50BGCCROP compsets - - M components/clm/src/biogeochem/CNBalanceCheckMod.F90 --- Decrease carbon error tolerance from 1xe-8 to 1xe-7 - and nitrogen error tolerance from 1xe-4 to 1xe-3 - M components/clm/src/biogeochem/CNFireBaseMod.F90 ---------- Add lfuel, ufuel, cmb_cmplt_fact to namelist - M components/clm/src/biogeochem/CNVegCarbonStateType.F90 --- Add InitReadNML and read in initial_vegC in - new cnvegcarbonstate namelist, handle reseeding with reseed_patch filter - M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 - Handle reseeding with reseed_patch filter for - restart read - M components/clm/src/biogeochem/CNVegStateType.F90 --------- Handle reseeding with reseed_patch filter for - M components/clm/src/biogeochem/CNVegetationFacade.F90 ----- Add namelist read CNReadNML for cn_general - and reseed_dead_plants option, pass it and/or reseed filter down as appropriate - M components/clm/src/biogeochem/CropType.F90 ------ Check validity of baset_mapping, set latbaset_patch to nan - if not used, switch logic of how activated - M components/clm/src/biogeochem/ch4varcon.F90 ----- Make default private, explicitly make items public as needed - add finundation_mtd and valid settings, read finundation_method in namelist and check it - M components/clm/src/biogeochem/dynHarvestMod.F90 - Validate units of harvest fields abort if not right - - M components/clm/src/biogeophys/CanopyStateType.F90 --- Only send RSCANOPY to history if use_ed is on - M components/clm/src/biogeophys/PhotosynthesisMod.F90 - Add: stomatalcond_mtd, modifyphoto_and_lmr_forcrop namelist - items, add extra history output: VCMX25T, JMX25T, TPU25T - - M components/clm/src/main/GetGlobalValuesMod.F90 - Replace mct_gsMap_orderedPoints for mct_gsMap_OP - M components/clm/src/main/histFileMod.F90 -------- Fix for bug 2184 from Jim Edwards - M components/clm/src/main/init_hydrology.F90 ----- Call init_root_moist_stress - M components/clm/src/main/ncdio_pio.F90.in ------- Replace mct_gsMap_orderedPoints for mct_gsMap_OP - M components/clm/src/main/ndepStreamMod.F90 ------ Add: ndep_taxmode, ndep_varlist to namelist - M components/clm/src/main/pftconMod.F90 ---------- Add: medlynslope/intercept to data/alloc/read/clean - - M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 ------ Use decomp_cascade_con%initial_stock_soildepth - in place of hardcoded 0.3 - M components/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 ------- Increase error tolerence allowed - for endrun for too much NH4 uptake predicted by FUN - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 -- Add initial_Cstocks_depth to namelist - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 - Add initial_stock_soildepth set to 0.3 - - M components/clm/src/unit_test_stubs/csm_share/mct_mod_stub.F90 - Replace mct_gsMap_OP with mct_gsMap_orderedPoints - - M components/clm/src/utils/quadraticMod.F90 - Allow for situations where a sqrt of a slightly negative number - would crash the code. - -=============================================================== -=============================================================== -Tag name: clm4_5_15_r232 -Originator(s): erik (Erik Kluzek) -Date: Wed Apr 5 23:04:37 MDT 2017 -One-line Summary: Some small changes that affect both clm4_5 and clm5_0 answers (can be considered bug fixes to clm4_5) - -Purpose of changes ------------------- - -A set of some small changes that affect answers for both CLM45 and CLM50. A fix to a rare problem where soil albedo -could go negative from Keith Oleson and Sean Swenson, by making sure a calculated value could not go below a small value. -A change from Will Weider to lower leaf maintence respiration (LMR) for low LAI. Always calculate btran2 even for low -temperatures and/or low liquid water this lowers fires in boreal forests. For crop at peak LAI set hui to max of hui and -huigrain. Change the handling of GDDPLANT accumulator field from Keith Oleson. Get rid of the use_voc logic that just -prevented MEGAN from activating for crop, since now MEGAN handles the crop case (since clm4_5_13_r204). - -Bugs fixed or introduced ------------------------- - 2437 -- lower leaf maintence respiration for low LAI - 2436 -- some adjustments to crop - 2435 -- always calculate btran to lower fires in boreal forests - 2431 -- Rare condition under which soil albedo goes negative - 2368 -- Remove use_voc as MEGAN can now work with crop - -Bugs fixed (include bugzilla ID): - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self, oleson, dll, dlawren, wweider, fangli - -Did you follow the steps in .CLMTrunkChecklist: Yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_14_r231 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeophys/SurfaceAlbedoMod.F90 --- Fix bug 2431 where soil albedo can got negative - make sure a calculated value doesn't go too small - M components/clm/src/biogeophys/PhotosynthesisMod.F90 -- Add check for divide by zero fo lnc, reduce - lmr for low LAI - M components/clm/src/biogeophys/SoilMoistStressMod.F90 - Always calculate btran2 even for low temperature - and/or low liquid water this lowers fires in boreal forests - M components/clm/src/biogeochem/CNPhenologyMod.F90 ----- For crop at peak lai set hui to max of hui and huigrain - M components/clm/src/biogeochem/CropType.F90 ----------- Change handling of GDDPLANT - ------------ Remove use_voc logic - M components/clm/src/cpl/clm_cpl_indices.F90 ----------- Remove use_voc - M components/clm/src/main/clm_instMod.F90 -------------- Remove use_voc - M components/clm/src/main/controlMod.F90 --------------- Remove use_voc - M components/clm/src/main/clm_varctl.F90 --------------- Remove use_voc - M components/clm/src/main/clm_driver.F90 --------------- Remove use_voc - M components/clm/src/main/lnd2atmMod.F90 --------------- Remove use_voc - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r231 -Originator(s): sacks (Bill Sacks) -Date: Sun Apr 2 19:36:02 MDT 2017 -One-line Summary: Add option to reset snow pack over non-glacier columns - -Purpose of changes ------------------- - -When going from a CLM spinup under one set of atmospheric forcings to a -different set of atmospheric forcings, there is the possibility that columns -that reached large snow depths in the spinup should really have only seasonal -snow cover under the new atmosphere. This is a particular concern for the LIWG -in some areas of Greenland that have only seasonal snow cover: there is a -concern that the offline spinup can bake in too-high snow cover in some -regions. This can especially be a problem because of feedbacks: starting out -with a too-high snow cover can cool the overlying atmosphere, leading to -persistence of the snow pack. This is also a problem because, once the snow pack -becomes very deep, it seems that its refreezing can make it less likely that the -snow pack will ever melt. - -To deal with these issues, this tag introduces a new namelist item, -reset_snow. This is typically .false. If you set it to .true., then all snow in -non-glacier columns is reset to 35 mm SWE over the first few time steps of the -run. - -This resetting is accomplished via the snow capping mechanism. This -implementation was chosen because it is challenging to reset the snow pack -directly, since there are so many snow-related variables that must be kept in -sync. The snow capping mechanism already handles this properly, so it's easiest -to reuse this mechanism. However, unlike standard snow capping, the flux of snow -lost through this resetting is sent into a new flux that simply disappears into -nothingness - rather than being sent to glc and/or rof. Thus, note that - by -design! - the flux from this snow resetting breaks conservation: We do not want -this lost snow to affect ocean circulation, since this is essentially just a -mechanism for adjusting an initial conditions file. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Specifying reset_snow = .true. will lead to a loss of conservation for the - first few time steps of the run - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: reset_snow - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Leo van Kampenhout reviewed an initial prototype - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - tests pass; namelists differ from baseline, as expected - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, NLCOMP failures as expected - -CLM tag used for the baseline comparisons: clm4_5_14_r230 - - -Answer changes --------------- - -Changes answers relative to baseline: no - bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - -List all files added and what they do: - -========= Unit test of new logic -A components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf - -List all existing files that have been modified, and describe the changes: - -========= Changes as described above -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r230 -Originator(s): sacks (Bill Sacks) -Date: Fri Mar 31 16:25:49 MDT 2017 -One-line Summary: Fix dynamic landunits water and energy conservation - -Purpose of changes ------------------- - -Fixes water and energy conservation with dynamic landunits. This conservation -works by summing the water and energy contents of each grid cell before and -after the dynamic landunits transitions, then dealing with the difference -through runoff and sensible heat fluxes. However, the code for counting the -water and energy contents was wrong - slightly wrong for water, and -substantially wrong for energy. The energy counts were 6 orders of magnitude too -small, and also were missing some terms. - -This tag fixes these counts, and reconciles the dynamic landunits water and -energy accounting with the accounting done for the balance checks. It also -refactors some of the code used in the balance checks to facilitate code sharing -between various places. - -Also: adds wa_col (water in the unconfined aquifer) to the list of fields copied -to newly-initializing columns, to avoid spurious dynlu adjustment fluxes due to -changes in wa_col. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] -- https://github.com/NCAR/CLM/issues/2 - Count energy of water in lakes in total - gridcell heat content -- https://github.com/NCAR/CLM/issues/3 - Perform gridcell-level water balance - checks bracketing the entire run loop - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- Some renamed history variables: see below - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: not investigated, but no major changes expected - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Dave Lawrence and Keith Oleson reviewed the new code -conceptually for scientifc correctness; Ryan Knox reviewed a slightly older -version of the new code for counting water and energy contents - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, answers change as expected - -CLM tag used for the baseline comparisons: clm4_5_14_r229 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - (1) Roundoff-level changes for all cases - - (2) Large changes in diagnostics of total gridcell water and total gridcell - heat, due to various fixes - - (3) Dynamic landunit water adjustments change substantially for glacier - transitions, and somewhat for transient crops - - (4) Dynamic landunit heat adjustments change substantially for all runs with - dynamic landunits (transient glacier, transient crop): change by about - 6 orders of magnitude - - (5) Changes in transient crop cases due to copying wa_col to - newly-initiating columns (though answer changes may be minor for clm5 - cases?) - - (6) Possibly other changes that I'm forgetting? - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Moved code that sums water and energy contents to here, to facilitate - code sharing; added unit tests for *some* of it -A components/clm/src/biogeophys/TotalWaterAndHeatMod.F90 -A components/clm/src/biogeophys/test/TotalWaterAndHeat_test/test_total_water_and_heat.pf -A components/clm/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt -A components/clm/src/biogeophys/test/TotalWaterAndHeat_test - -List all existing files that have been modified, and describe the changes: - -========= Major rework: Use new shared routines for calculating heat and water - contents; adjust dynlu adjustment heat flux based on heat content of - dynlu adjustment runoff flux -M components/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 - -========= Copy wa_col (water in the unconfined aquifer), to avoid large adjustments -M components/clm/src/dyn_subgrid/dynInitColumnsMod.F90 -M components/clm/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf - -========= Use new routines for water content -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 - -========= New constant for baseline wa_col (water in the unconfined aquifer), - replacing hard-coded constants -M components/clm/src/main/clm_varcon.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 - -========= For performance: introduce col%hydrologically_active, used in place of - is_hydrologically_active function call -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/filterMod.F90 -M components/clm/src/main/initSubgridMod.F90 -M components/clm/src/main/glcBehaviorMod.F90 - -========= Changes to diagnostic fields: Remove incorrect HCSOI, HC; rename - GC_HEAT1 and GC_HEAT2 to HEAT_CONTENT1 and HEAT_CONTENT2; add - HEAT_CONTENT1_VEG; add LIQUID_WATER_TEMP1 -M components/clm/src/biogeophys/TemperatureType.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/LakeTemperatureMod.F90 - -========= Changes to diagnostic fields: Rename GC_LIQ1/2 to LIQUID_CONTENT1/2, - and similar for ICE; also remove some now-unused fields -M components/clm/src/biogeophys/WaterStateType.F90 - -========= Minor changes to some calls -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/main/clm_driver.F90 - -========= New stub routines -M components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90.in - -========= New unit tests -M components/clm/src/biogeophys/CMakeLists.txt -M components/clm/src/biogeophys/test/CMakeLists.txt - -========= Add some comments -M components/clm/src/main/subgridAveMod.F90 -M components/clm/src/main/column_varcon.F90 - -========= Remove unneeded use statements and associates -M components/clm/src/biogeophys/UrbanParamsType.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/main/initVerticalMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r229 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 10 11:32:20 MST 2017 -One-line Summary: Update cime and make some changes to drv_flds_in namelist, fix some minor bugs - -Purpose of changes ------------------- - -Update cime to a version with an updated top level directory structure. It also fixes a problem -with a CLM test. - -The new cime version has a new directory structure, and updates the XML schema for namelist files -from verison 1 to version 2. Currently the perl namelist code can NOT read version 2. Hence, a local -copy of the version 1 files for the drv_flds_in fields was added to CLM. Also the use of the datm -namelist files for some tools was dropped -- I think that's OK though. - -Fix two minor bugs. - -The new cime has a few improvements. It now adjusts the PIO namelist when the PE layout changes. -There's a new option to case.setup "--no-adjust-pio" to not do that. --mpilib option was added -to create_test. You can remove your bld directory area without having to rerun case.setup. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2433 -- format error in HumanIndexMod.F90 - 2432 -- intent mixing in dynVarMod.F90 -CIME Issues fixed (include issue #): - 1074 -- ERP_D_Ld5.hcru_hcru.ICRUCLM45BGC.yellowstone_pgi fails with PIO error - -Known bugs introduced in this tag (include bugzilla ID): (recently found, but predate this tag) - 1217 -- Driver allows a contradiction in drv_flds_in between CAM and CLM - 1220 -- missing mpi-serial mpirun case on hobart - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - case.setup has a new option --no-adjust-pio - - The user now can rm -rf their build area and rebuild without having - to re-run case.setup. - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - - CIME now normally adjusts PIO layout if you change the PE layout. - - Also puts a copy of namelist definition and defaults for drv_flds_in in CLM. - This copy needs to be doubly maintained with the versions in the driver and in CAM. - The advantage of having a copy is because each copy is using a different version of - the xml schema, and potentially the driver might have additional fields that interact - with other components besides CLM. Currently the only drv_flds_in fields are all shared - between only CAM and CLM. But, the fact that there are duplicated copies does mean - changes in any one of those components will need to go into the other two. - - Also removes the datm namelist files read in tools such as queryDefaultNamelist.pl. - I think this is OK, as this connection may no longer be needed. It does make the - listDefaultNamelist.pl less useful, but I think that's OK as well. - -Changes to tests or testing: - - add --mpilib option to create_test - -Code reviewed by: self,mvertens - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular, tools - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_14_r226 - - -Answer changes No bit-for-bit --------------- - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, cime_config - Update cime to cime5.3.0-alpha.02 - Add new cime_config at cime_config0.0.1.alpha.03 - -List all files eliminated: None - -List all files added and what they do: These are version 1 of the files, the ones in the driver - are now version 2. - -A components/clm/bld/namelist_files/namelist_definition_drv.xml ------- Copy from driver -A components/clm/bld/namelist_files/namelist_definition_drv_flds.xml -- Copy from driver -A components/clm/bld/namelist_files/namelist_defaults_drv.xml --------- Copy from driver - -List all existing files that have been modified, and describe the changes: - ------------- Point to new local copy of drv_flds namelist files, and bunch of whitespace changes ------------- Remove pointing to datm namelist files as they are now version 2, and the perl code ------------- currently can't read them -M components/clm/bld/queryDefaultNamelist.pl ------ Point to local location of namelist drv files - and remove pointing to datm namelist files -M components/clm/bld/CLMBuildNamelist.pm ---------- Point to local location of namelist drv files -M components/clm/bld/listDefaultNamelist.pl ------- Point to local location of namelist drv files - and remove pointing to datm namelist files - -M components/clm/cime_config/testdefs/ExpectedTestFails.xml Remove hcr_hcru test that is now passing - ------------- Get unit tests working with the new cime directory structure -M components/clm/src/CMakeLists.txt ----------------------------- New cime directory structure -M components/clm/src/unit_test_stubs/csm_share/seq_comm_mct.F90 - Just change comment as to where - the "real" file exists - ------------- Fix a couple of bugs -M components/clm/src/biogeophys/HumanIndexMod.F90 --- Fix bug 2433 format error -M components/clm/src/dyn_subgrid/dynVarMod.F90.in --- Fix bug 2432 intent issue - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r228 -Originator(s): erik (Erik Kluzek) -Date: Tue Mar 7 14:17:07 MST 2017 -One-line Summary: Bring in changes that were accidentally dropped as part of the clm4_5_14_r226 tag - -Purpose of changes ------------------- - -Bring in changes that were included for the testing of clm4_5_14_r226, but accidentally dropped -when moved to the trunk tag. Only a limited amount of testing was done, since the testing was -done in the clm4_5_14_r226 tag. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: short, since full testing was done in clm4_5_14_r226 - -CLM tag used for the baseline comparisons: clm4_5_14_r227 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ----------- Remove --phys option to PTCLM testing -M components/clm/test/tools/nl_files/PTCLM_USUMB_clm4_5 -M components/clm/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 -M components/clm/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 - -M components/clm/cime_config/config_component.xml ------------ Remove unnneeded "" -M components/clm/cime_config/testdefs/ExpectedTestFails.xml -- Add note about hcru_hcru failing test -M components/clm/cime_config/testdefs/testlist_clm.xml ------- Add a test with MOSART on hobart_nag -M components/clm/src/biogeophys/SnowSnicarMod.F90 ------------ Fix bug 2479 workaround for Intel 16/17 compiler -M components/clm/src/main/initGridCellsMod.F90 --------------- Fix bug 2417 for create_crop_landunit - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r227 -Originator(s): sacks (Bill Sacks) -Date: Mon Mar 6 09:42:41 MST 2017 -One-line Summary: Improve performance of dynamic landunits code - -Purpose of changes ------------------- - -Main change is to improve the performance of the column state updates portion of -the dynamic landunits code. In optimized, global runs, this piece of the code -(dyn_cnbal_col) was taking 3 - 5% of total CLM runtime. Its cost was greater in -global debug runs (~ 10 - 15%), and even greater in single-point debug runs (30 -- 40%). - -Here I have introduced a variable that tracks whether there are any changes in -area in this time step for each clump; if not, then it avoids doing most of the -work in dyn_cnbal_col. - -This tag also fixes the fortran unit tests with the new cime version: the -necessary changes were accidentally dropped from the last tag. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: 3-4% performance improvement for global, -optimized runs; greater performance improvement for debug and single-point runs - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_14_r226 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as noted above. Primary changes are in - dynColumnStateUpdater, but other modules needed to be changed in order - to pass the clump index down. Eventually, we should be able to get rid - of this clump index tracking, instead having a separate object for - each clump - but that is waiting on a major refactor of how we handle - threading in CLM. -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -M components/clm/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/ch4Mod.F90 - -========= Fix unit tests -M components/clm/src/CMakeLists.txt -M components/clm/src/README.unit_testing - -========= Note expected failure that started failing in r226 -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r226 -Originator(s): erik (Erik Kluzek) -Date: Thu Mar 2 15:12:50 MST 2017 -One-line Summary: Update cime, mosart and cism to a version that is cesm2_0_beta05 or part of beta06 - -Purpose of changes ------------------- - -Update cime version and cism to version that similar to that in cesm2_0_beta05, but with many fixes in cime for -clm. Also update mosart to fix a bug on hobart. The update of cism does change answers as it makes CISM2 the -default with the new 4km greenland grid. - -There are some user improvements in the latest cime version. Long term archiving issues are fixed. A file -called CASEROOT is added to your case's $RUNDIR so that you can easily see where your source code is. A few -options were added to create_newcase and create_clone (see details below). - -NOTE: You will need to use the "--run-unsupported" to create_newcase for compsets/grids that aren't tested or supported!!! - -Fix a few other existing bugs. Fix createcrop_landunit to work with the new CLM surface datasets. Bring in a -workaround for a compiler bug with intel 17 and 18. Bring in a version of PTCLM that works with the latest cime. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2417 -- fix createcrop_landunit for new datasets with 16 PFTs - 2418 -- fix grid match for config_compsets.xml (cime issue 1079 still there) - 2424 -- Update mosart to 1_0_20 to fix the nag bug - 2479 -- workaround for intel compiler bug - 2357 -- PTCLM broken in cime5 - -CIME Issues fixed (include issue #): archiving, unit-tests, grid issues, gnu compiler, - cime issues fixed: 1075, 1053, 1051, 1073, 1072, 1089 - -Known bugs introduced in this tag (include bugzilla ID): - 1074 -- hcru_hcru grid no longer works gives PIO error - 1079 -- mask for grid matching - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Add support for cheyenne - CASEROOT file added to $RUNDIR to show path to source - Add "--run-unsupported" option to create_newcase - Add "--cime-output-root" option to create_clone - Fix long term achiving issues - -Changes made to namelist defaults (e.g., changed parameter values): drv namelist changes - PIO namelists have different defaults - some grids are null and maps are idmap when they aren't needed - clm40 removed from all active compsets - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: Seems to run faster (~20%)! (we don't understand why) - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Refactoring in cime for unit-testing, add schema files for cime xml files - buildnml faster - config_grids and xmlquery was refactored - -Changes to tests or testing: Add test with mosart on hobart - -Code reviewed by: self, sacks - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_14_r225 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes. Compsets with CISM - - Summarize any changes to answers, i.e., - - what code configurations: All with CISM - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - compsets are updated to default to CISM2 and the new 4km greenland grid - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, cism, mosart, PTCLM - - cime to cime5.2.0-alpha25 - mosart to mosart1_0_20 - cism to cism2_1_29 - PTCLM to PTCLM2_170302 - -List all files eliminated: - - D components/clm/tools/shared - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/cime_config/config_compsets.xml - Workaround in 2418 for cime issue 1079 - M components/clm/test/tools/TSMscript_tools.sh --- Fix arguments sent to TCB scrip - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r225 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 19 14:42:13 MST 2017 -One-line Summary: Fix GDD accumulation in new crop columns - -Purpose of changes ------------------- - -For newly-initiating crop columns in the middle of a run, the 20-year-average -GDD variables (gdd*20) were not being initialized correctly. They were starting -as spval, and then taking essentially forever to come down to some reasonable -value. This caused major problems for both dynamic landunits and when running -init_interp from one crop run to another, where the new run had some new crop -types - such as going from a run without irrigation to a run with irrigation. - -This tag fixes these problems. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- If you do a CROP run, setting use_init_interp to .true., and pointing to a - previous initial conditions file generated with a crop run (thus having - restyear > 0 on the restart file), then GDD accumulation will get reset. This - means that the first year of your run won't have any crop growth. After this - initial "burn-in" period, it will run fine. This is only an issue when using - initial conditions generated prior to this tag, and is only an issue when - using init_interp. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: New initial conditions file for tests that use -clm50cropIrrigMonth_interp or irrig_spunup testmods - see details below. - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, some expected baseline failures: - - Baseline comparisons fail because GDD accumulation is now fixed for - transient crops: - ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHISTCLM50BGCCROP.yellowstone_gnu.clm-cropMonthOutput - ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHISTCLM50BGCCROP.yellowstone_gnu.clm-cropMonthOutput - SMS_D_Ly6_Mmpi-serial.1x1_smallvilleIA.IHISTCLM45BGCCROP.yellowstone_pgi.clm-cropMonthOutput - - These tests point to a previously-spun-up crop file, and use init_interp. I - have adjusted this file to add the new patch-level nyrs_crop_active - variable, which I set to 30 for all active crop PFTs (in agreement with the - old restyear). However, this initial conditions file does not have any - non-irrigated crop PFTs! So crop behavior was wrong in the baseline run, - because non-irrigated crops started with spval gdd*20 values. - SMS_D_P24x1_Ld5.f10_f10.ICRUCLM50BGCCROP.hobart_nag.clm-irrig_spunup - ERP_D_P15x2_Ld5.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-irrig_spunup - ERP_P60x2_Lm36.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-clm50cropIrrigMonth_interp - -CLM tag used for the baseline comparisons: clm4_5_14_r224 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - Transient crop cases - - Any crop case for which initial conditions are init_interp'ed from a - previous crop case: nyrs_crop_active is reset to 0 in this case - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Potentially new climate for transient crop cases - - If bitwise differences were observed, how did you show they were no worse - than roundoff? n/a - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: n/a - - URL for LMWG diagnostics output used to validate new climate: n/a - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as noted above -M components/clm/src/main/clm_driver.F90 -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CropType.F90 - -========= Point to new version of initial conditions file - same as old, but - hacked to have nyrs_crop_active patch-level variable: set to 30 for - active crop PFTs, 0 elsewhere. This hack is needed since we run - init_interp for these tests: this allows crops to grow initially. -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r224 -Originator(s): sacks (Bill Sacks) -Date: Fri Feb 10 06:27:53 MST 2017 -One-line Summary: Tweaks for glaciers and snow - -Purpose of changes ------------------- - -A number of answer-changing tweaks for glaciers and snow, mainly with the intent -of improving glacial melt over Greenland in CESM2. - -(1) New longwave downscaling parameterization, based on Van Tricht et al. (2016, - TC) Figure 6, doi:10.5194/tc-10-2379-2016. This uses a simple linear lapse - rate for LW radiation, which seems better supported by observations than the - old approach based on blackbody radiation relationships. Two new namelist - parameters control this behavior: lapse_rate_longwave and - longwave_downscaling_limit. This changes answers for all cases with multiple - elevation classes - i.e., all cases with CISM (IG, etc.), just over the - regions with downscaling (Greenland and Antarctica). This change is from Leo - van Kampenhout. - -(2) Modified the parameterization of snow cover fraction during melt to improve - glacial melt over Greenland in CESM2: - - (a) New value for n_melt (parameter controlling snow cover fraction as snow - melts) over glc_mec columns for CLM5. The previous value of 10 resulted - in near-100% snow cover fraction over glaciers. The new value of 1 - allows snow cover fractions more similar to other landcover - types. n_melt_glcmec is a new namelist parameter. This changes answers - for all CLM5 cases with glc_mec (i.e., with CISM), just over glc_mec - landunits. - - (b) For all landcover types, maintain snow cover fraction at 100% when - h2osno exceeds 2m SWE in CLM5. This is important in conjunction with - (a), in order to avoid snow cover fraction dropping significantly below - 100% when very deep (e.g., 10m) snow packs begin to melt. This is - controlled by a new namelist parameter, int_snow_max, which can be set - to a very large value to retrieve the old behavior. This changes answers - for all CLM5 cases; in principle, it changes answersfor all landunits, - but in practice, this should only matter where we have a very deep snow - pack - typically, just in regions where the snow persists for more than - a year. - - These two changes were proposed in a discussion with Leo van Kampenhout, - Bill Lipscomb, Dave Lawrence and Sean Swenson. - -(3) Set the ddz3 term controlling snow compaction for glaciers and wetlands in - the same way as for soil and crop landunits. This should have been included - in clm4_5_14_r222 (which brought in consistency in the treatment of snow - cover fraction in glacier & wetland landunits), but was overlooked in that - tag. This changes answers for all cases, just over glacier, glacier_mec and - wetland columns. This change was reviewed by Sean Swenson and Leo van - Kampenhout. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variables: - - lapse_rate: the temperature lapse rate for downscaling over ice sheets - (default kept the same as before, though there may be roundoff-level - differences due to the precision of the namelist parameter) - - lapse_rate_longwave: the longwave radiation lapse rate for downscaling over - ice sheets - - longwave_downscaling_limit: the relative limit capping longwave radiation - downscaling - - n_melt_glcmec: the value of n_melt (parameter controlling snow cover fraction - as snow melts) over glc_mec columns - - int_snow_max: limit applied to integrated snowfall when determining changes in - snow-covered fraction during melt -- INT_SNOW diagnostic now inactive by default - -Changes made to namelist defaults (e.g., changed parameter values): Some of the -new namelist variables have defaults different from the previous hard-coded -values, but no changes to existing namelist defaults. - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Removed a bunch of no-longer-used test lists: -aux_clm_ys_intel, aux_clm_ys_pgi, aux_science, aux_scripts, aux_testsystem, -csltiming, aux_rasm - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - - tests pass, differences as expected - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, but differences from baselines and namelist differences - as expected - -CLM tag used for the baseline comparisons: clm4_5_14_r223 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff. Expect at least small regional climate differences - - specifically over Greenland and Antarctica. - - Answer changes are from: - - (1) New longwave downscaling parameterization. This changes answers for all - cases with multiple elevation classes - i.e., all cases with CISM (IG, - etc.), just over the regions with downscaling (Greenland and - Antarctica). - - (2) New value for n_melt over glc_mec columns for CLM5. This changes answers - for all CLM5 cases with glc_mec (i.e., with CISM), just over glc_mec - landunits. - - (3) Modified parameterization of snow cover fraction during melt to maintain - snow cover fraction at 100% when h2osno exceeds 2m SWE in CLM5. This - changes answers for all CLM5 cases; in principle, it changes answersfor - all landunits, but in practice, this should only matter where we have a - very deep snow pack - typically, just in regions where the snow persists - for more than a year. - - (4) Set the ddz3 term controlling snow compaction for glaciers and wetlands - in the same way as for soil and crop landunits. This changes answers for - all cases, just over glacier, glacier_mec and wetland columns. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= New longwave radiation downscaling; make lapse rate a namelist - parameter; refactor unit tests a bit -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/main/test/atm2lnd_test/test_downscale_forcings.pf -M components/clm/src/main/test/atm2lnd_test/test_partition_precip.pf - -========= Apply int_snow_max; treat ddz3 consistently for glaciers and wetlands -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 - -========= New int_snow_max and n_melt_glcmec namelist variables -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/clm_varcon.F90 -M components/clm/src/main/initVerticalMod.F90 - -========= Add some inactive history fields that just apply over glaciers -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/WaterStateType.F90 - -========= New setup_landunit_ncols utility method -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 - -========= New namelist parameters, as documented above -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Remove unneeded use statements -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_instMod.F90 - -========= Remove no-longer-used testlists: aux_clm_ys_intel, aux_clm_ys_pgi, - aux_science, aux_scripts, aux_testsystem, csltiming, aux_rasm. Main - motivation is that lists starting with 'aux_*' now have special - meaning, indicating what compset/grid combinations we test regularly. -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r223 -Originator(s): sacks (Bill Sacks) -Date: Fri Feb 3 10:07:24 MST 2017 -One-line Summary: Handle patch-level C&N variables correctly with dynamic landunits - -Purpose of changes ------------------- - -The infrastructure for handling conservation of patch-level C&N variables when -subgrid weights changed was only considering changes in patch weights on the -COLUMN. For dynamic landunits - where whole columns and landunits can change in -area - this needs to consider changes in patch weights on the GRIDCELL. This tag -makes this change. - -In addition, this makes the fire code work correctly with changing column / -landunit areas: Similarly to the other C&N variables, the variable that triggers -landcover-related fires was previously only considering changes in patch weights -on the column. - -Also, treat patch-level crop-specific variables (grain pools and -cropseed[c/n]_deficit) in DynamicPatchAdjustments routines. C/N in the grain -pool is sent to the crop product pool via a new flux -(dwt_crop_productc_gain_patch / dwt_crop_productn_gain_patch). - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2106: CNFireMod code should be re-evaluated in the presence of dynamic - landunits -- Addresses point 14 in 1679: problems with new CNFireMod - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- Removed history variables: DWT_CLOSS / DWT_CLOSS_DRIBBLED (and similarly for - N). These can be seen with DWT_CONV_CFLUX / DWT_CONV_CFLUX_DRIBBLED - (previously dwt_closs was simply set equal to dwt_conv_cflux). - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changes ciso_bombspike1963 to use monthly output, because this testmod is used - in a long-running test - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, changes answers for some tests as noted below - -CLM tag used for the baseline comparisons: clm4_5_14_r222 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with transient landcover (HIST, RCP, - DV, IG) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - For transient crop and transient glacier: larger than roundoff, may change - climate slightly - - Without crop: expected to be only roundoff-level changes (I confirmed - this in various ways fo some of the changes; for other changes, I did - not do a careful confirmation that changes were truly just - roundoff-level) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= For some tests that have daily changes in glacier area, bypass the error-checks - that ensure that we only have changes in landcover on the year boundary. -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_clm - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf -M components/clm/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M components/clm/src/dyn_subgrid/dynPriorWeightsMod.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - - also, treat initialization of cropseedc_deficit consistently with - grain pools (only initialize if use_crop is .true.) -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 - - also, treat initialization of cropseedc_deficit consistently with - grain pools (only initialize if use_crop is .true.) -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNProductsMod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNFireBaseMod.F90 - -========= Unrelated change: Since we now only initialize cropseedc_deficit when - use_crop is true, make sure we only adjust it over prognostic crop - patches -M components/clm/src/biogeochem/CNC14DecayMod.F90 - -========= Unrelated change: use YEAR_POSITION_START_OF_TIMESTEP for consistency - with other dyn file stuff. This doesn't make any difference for - harvest, now that it's applied once per year at the beginning of the - year, but it seems like we might as well be consistent. -M components/clm/src/biogeochem/dynHarvestMod.F90 - -========= Add create_vegetated_landunit_n_patches to aid unit testing -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 - -========= For some tests that have daily changes in glacier area, bypass the error-checks - that ensure that we only have changes in landcover on the year boundary. -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm -M components/clm/src/biogeochem/CNVegStateType.F90 - -========= Change output to monthly to speed up this long-running test -M components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r222 -Originator(s): sacks (Bill Sacks) -Date: Fri Jan 27 06:14:19 MST 2017 -One-line Summary: Fix energy budget bug with fractional snow on glacier and wetland columns - -Purpose of changes ------------------- - -Leo van Kampenhout discovered a bug in the surface energy budget when there is -fractional snow cover on glacier and wetland columns: frac_sno_eff was being -treated inconsistently for these landcover types. - -Note that the old code did not conserve energy due to this bug! - -The fix slightly increases melt rates over Greenland, and has other minor -effects on the simulation, but not a huge effect. - -More detailed notes on the problem, from Leo, are below. However, note that we -ended up fixing the problem differently from what he suggested - based on Sean -Swenson's suggestion: We fix this by treating glaciers and wetlands the same as -soil with respect to frac_sno_eff. (Note that we still treat lakes differently -[these are handled by different code] and urban differently.) - -Here are the more detailed notes from Leo: - -Background: - -- CLM columns are allowed to have fractional snow cover. - -- The first application of fractional snow cover is to the albedo - calculation. This is done for every landcover type in the same fashion. This - fractional snow cover is referred to as 'frac_sno'. - -- The second type of fractional snow cover is 'frac_sno_eff', which adjusts - surface fluxes other than shortwave radiation, such as sensible and latent - heat. The frac_sno_eff has only been implemented for soil and crop landcover - types. - -- For all other landcovers, such as glaciers, frac_sno_eff =1.0 - -- As such, glaciers can have frac_sno < frac_sno_eff whereas those are otherwise - identical - -Problem: - -- Frac_sno is used to compute absorbed radiation in the soil (sabg_soil) and - snow (sabg_snow). When frac_sno < 1.0, this will lead to a positive value of - sabg_soil at the expense of sabg_snow - -- In other radiation code, notably SoilTemperatureMod.F90, the other definition - of fractional snow cover is used (frac_sno_eff) - -- For glaciers (frac_sno_eff), this means that no radiation is allowed to enter - the soil. To my current understanding, this energy is totally lost: - - eflx_gnet_soil = sabg_soil(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) - lwrad_emit_soil(c) & - - (eflx_sh_soil(p)+qflx_ev_soil(p)*htvp(c)) - - real(r8) , intent(out) :: hs_soil( bounds%begc: ) ! heat flux on soil [W/m2] - - ! separate surface fluxes for soil/snow - hs_soil(c) = hs_soil(c) + eflx_gnet_soil * patch%wtcol(p) - - ! this is the snow/soil interface layer - rt(c,j) = t_soisno(c,j) + fact(c,j) & - *((1._r8-frac_sno_eff(c))*(hs_soil(c) - dhsdT(c)*t_soisno(c,j)) & - + cnfac*(fn(c,j) - frac_sno_eff(c) * fn(c,j-1))) - -BalanceCheckMod: - -- The missing energy should have been detected by BalanceCheckMod, specifically - the check on surface energy balance: - - ! Surface energy balance - ! Changed to using (eflx_lwrad_net) here instead of (forc_lwrad - eflx_lwrad_out) because - ! there are longwave interactions between urban columns (and therefore patches). - ! For surfaces other than urban, (eflx_lwrad_net) equals (forc_lwrad - eflx_lwrad_out), - ! and a separate check is done above for these terms. - - if (.not. lun%urbpoi(l)) then - errseb(p) = sabv(p) + sabg_chk(p) + forc_lwrad(c) - eflx_lwrad_out(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) - -- Here, the total absorbed solar radiation is FSA has been been replaced by - sabg_chk. This hides the problem, because sabg_chk itself is also flawed: - - ! save sabg for balancecheck, in case frac_sno is set to zero later - sabg_chk(p) = frac_sno_eff(c) * sabg_snow(p) + (1._r8 - frac_sno_eff(c) ) * sabg_soil(p) - -- With frac_sno_eff = 1.0, this simplifies to sabg_snow. So, sabg_soil is not - accounted for in the surface energy balance check. - -Workaround: - -1. Let all solar soil radiation be absorbed by snow: - -SurfaceRadiationMod: - - if (frac_sno(c) < frac_sno_eff(c)) then - ! LvK: workaround, absorb all soil radiation in snow - sabg_snow(p) = fsa(p) - sabg_soil(p) = 0.0_r8 - end if - -2. Recommended: let the surface energy balance use FSA : - - errseb(p) = sabv(p) + fsa(p) + forc_lwrad(c) - eflx_lwrad_out(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) - -Long-term solution: - -- Thought needs to be given on how SW radiation should be treated on partially - covered glacier columns - - -- Allowing radiation to penetrate the soil, yet keeping frac_sno_eff = 1, is a - possibility. This will heat the snowpack from below. - - -- Alternatively, we could look at implementing glacier fractional snow cover for - surface fluxes also. Needs discussion about the physical basis & how to - evaluate this. - - - -Again, note that the final implementation differs from Leo's suggestion - I'm -just giving Leo's original notes for completeness. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson, Leo van Kampenhout, myself - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, but baseline comparisons fail as expected - -CLM tag used for the baseline comparisons: clm4_5_14_r221 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45/CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; expected to be similar climate (effects are - relatively small) - although there are non-negligible effects on glacier - surface mass balance (SMB). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r221 -Originator(s): sacks (Bill Sacks) -Date: Tue Jan 24 05:12:14 MST 2017 -One-line Summary: Change rain-snow partitioning and ice albedo for glacier columns - -Purpose of changes ------------------- - -Main change is to change the rain-snow partitioning ramp for glacier columns, -when using clm5 physics: Rather than assuming all snow below 0 C and all rain -above 2 C, for glacier columns we now assume all snow below -2 C and all rain -above 0 C. The main motivation for this change is to increase the -otherwise-too-low glacier melt we have been seeing in recent CESM2 test -runs. The physical justification is: The old partitioning makes sense when you -have a positive atmospheric lapse rate - so slightly-above-freezing temperatures -at the surface are associated with below-freezing temperatures at the cloud -level. However, for glaciers, it is relatively common to have a temperature -inversion. Thus, we would expect a different relationship between near-surface -temperatures and phase of precipitation. This new relationship was proposed and -agreed upon by LIWG leadership, particularly Bill Lipscomb, Jan Lenaerts and Leo -van Kampenhout. - -To implement this change, I have reimplemented the (simple) rain-snow -partitioning code inline, rather than using the csm_share code. In addition, I -have introduced four new namelist parameters controlling its behavior: -- precip_repartition_glc_all_snow_t -- precip_repartition_glc_all_rain_t -- precip_repartition_nonglc_all_snow_t -- precip_repartition_nonglc_all_rain_t - -Also changes ice albedo (albice) for glacier columns from 0.6/0.4 (vis/nir) to -0.5/0.3, when using clm5 physics. This is based on suggestions by Jan Lenaerts, -and agreed upon by the LIWG leadership. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -Four new namelist parameters: -- precip_repartition_glc_all_snow_t -- precip_repartition_glc_all_rain_t -- precip_repartition_nonglc_all_snow_t -- precip_repartition_nonglc_all_rain_t - -Changes made to namelist defaults (e.g., changed parameter values): -- Changed defaults for albice with CLM50 - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- Duplicated code for rain-snow partitioning: in CLM and csm_share (the - csm_share version is used by datm). However, this is just a couple of lines of - code, and it's possible that the CLM version will change in the future, so I - felt that duplication was not a bad thing here. - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok (pass, but differences from baseline for clm45/clm50 as expected) - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, some baseline comparisons fail as noted below - -CLM tag used for the baseline comparisons: clm4_5_14_r220 - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 cases - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; expected to be new climate regionally, but may not - change global climate significantly. I have confirmed via one test that - differences are only over glacier columns. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -MM components/clm/bld/CLMBuildNamelist.pm -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/main/clm_instMod.F90 -MM components/clm/src/main/controlMod.F90 -M components/clm/src/main/test/atm2lnd_test/test_downscale_forcings.pf -M components/clm/src/main/test/atm2lnd_test/test_partition_precip.pf -M components/clm/src/main/clm_varctl.F90 - -========= Fix unit tests for new interface for initializing atm2lnd -M components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r220 -Originator(s): sacks (Bill Sacks) -Date: Sun Jan 22 14:05:50 MST 2017 -One-line Summary: Fix crop seeding - -Purpose of changes ------------------- - -The implementation of crop seeding made a few months ago didn't handle the -transfers back into the "seed deficit" (cropseedc) pool quite right. In -addition, that implementation didn't treat nitrogen. This tag fixes these -problems. In addition, it separates the seed (deficit) pools into crop seed -deficit and dwt seed deficit, and moves the latter to gridcell level (which is -needed for some upcoming work). - -In the new implementation, when crops are seeded, this is tracked via -cropseedc_deficit_patch and cropseedn_deficit_patch. At the end of the growing -season, these deficits are repaid out of grain c/n, if there is enough available -grain c/n (if there is not enough available, the deficits accumulate until they -can eventually be repaid). Thus, this repayment decreases the fluxes of C & N to -the crop product pools. This new implementation was co-developed with Danica -Lombardozzi. - -In addition, this tag does some other minor cleanup, as noted below. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Seed pools won't restart properly from old initial conditions files. However, - since these seed pools were previously just used as a diagnostic, this won't - affect the evolution of anything except for the seed pools and related summary - variables. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- Removed a few unused diagnostic history variables - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: nothing substantial - -Code reviewed by: Conceptual implementation co-developed with Danica -Lombardozzi (although she has not reviewed the final code) - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; baseline failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_14_r219 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Many CLM45/CLM50, but significant changes only - for CROP - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff / same climate - - Details: - - There are differences from baseline in: - - - Crop product pools and related fluxes, including summary fluxes - (LAND_USE_FLUX, NBP) - - - FCO2 - - - PFT_CTRUNC - changed due to fix in treatment of crop seed (previously, - substantial grain was being truncated) - - - SEEDC / SEEDN - - - STORVEGC / STORVEGN in crop tests - - - Various other summary C/N state variables - - - LITFALL for CLM50 with CROP - - - Other than TOTCOLC / TOTCOLN, greater-than-roundoff diffs just in CROP - tests and tests that have non-blank finidat (latter just in SEEDC & SEEDN, - because we don't read in the current value of SEEDC/SEEDN). Summary - variables have diffs in some CLM45 crop tests as well as CLM50, because of - diffs in which summary variables include seed c/n. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes to crop seed deficit tracking, and moving dwt seed pools - to gridcell level -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M components/clm/src/biogeochem/CNNStateUpdate1Mod.F90 -M components/clm/src/biogeochem/CNC14DecayMod.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 - - Also remove grainc_to_food from LITFALL diagnostic when sending - grain to crop product pool -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - -========= Refactor some loops to support upcoming changes, and remove - no-longer-needed code due to removed variabes -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 - -========= Change arguments used in calling changed routines -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 - -========= Remove unused lf_conv_cflux_col variable and LF_CONV_CFLUX diagnostic field -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 -M components/clm/src/main/clm_driver.F90 - -========= Just add some comments -M components/clm/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 - -========= Change a field that is output, because I have removed the old field -M components/clm/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r219 -Originator(s): erik (Erik Kluzek) -Date: Sat Jan 21 23:36:23 MST 2017 -One-line Summary: Answer changes for CLM50 for several issues that lead to dead crops - -Purpose of changes ------------------- - -Fix several problems that led to dead crops. latbaset was set in InitAllocate -and then reset to spval in InitHist. Set lnca to interp rather than skip for -interpolation on startup. Remove rootfr from restart unless use_dynroots is on. -Fix FERTNITRO and add BTRAN2 to history. Turn LUNA on by default for all CLM50 -cases including SP. Change from Fang Li to remove fb from the calculation of -baf_crop. Fix LUNA in SP mode by setting PARi10 to a small value rather than -zero. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): [If none, remove this line] - bug 2407 -- latbaset is set in InitAllocate and then reset to spval in InitHist - bug 2409 -- set lnca to interp rather than skip on restart - bug 2408 -- remove rootfr from restart unless use_dynroots is on - bug 2402 -- FERTNITRO - bug 2403 -- BTRAN2 - bug 2413 -- luna in SP mode -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] - bug 2414 LATBASET is always output to history even if not used and even though it's a constant - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self, oleson, dlawren - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_14_r218 - -Answer changes --------------- - -Changes answers relative to baseline: YES! CLM50 with crop - CLM45 BGCCROP cases show an answer change just because fill value change of LATBASET even though it's unused - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 with CROP - - what platforms/compilers: All - - nature of change: new climate with crops growing - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- LUNA on by - default for ALL CLM50 cases included SP mode - - M components/clm/src/biogeochem/CNFireLi2016Mod.F90 --- Remove fb from calculation of baf_crop - M components/clm/src/biogeochem/CropType.F90 ---------- Move initialization of latbaset_patch - to InitCold, fix FERTNITRO on history file - M components/clm/src/biogeophys/EnergyFluxType.F90 ---- Save BTRAN2 to history files - M components/clm/src/biogeophys/LunaMod.F90 ----------- Set PARi10 to 0.01 rather than zero if - LAI is zero - M components/clm/src/biogeophys/PhotosynthesisMod.F90 - Set lnca_patch to interp rather than skip - M components/clm/src/biogeophys/SoilStateType.F90 ----- Only save rootfr if use_dynroots on. - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r218 -Originator(s): sacks (Bill Sacks) -Date: Fri Jan 13 19:46:27 MST 2017 -One-line Summary: For newly initiating columns: do not copy snow state - -Purpose of changes ------------------- - -Keith Oleson found that, in some circumstances, the model was dying with a snow -balance error in newly initiating crop columns. We tracked this down to an -incomplete copying of the snow state from the 'template' column to the newly -initiating crop column. Our two options for solving this problem were (1) copy -the snow state more completely; or (2) do not try to copy any part of the snow -state - leaving the snow in cold start conditions for the newly initiating -column. (1) is challenging because there are so many snow variables, so we have -chosen to go with (2) for now. Thus, when a column initiates (for now, this just -applies to crop columns), we (Dave Lawrence, Keith Oleson and Bill Sacks) have -decided that we should copy only the belowground temperature and water state. - -Also, some minor, unrelated changes: - -(1) Fix broken unit tests - -(2) Abort run if try to run use_ed with transient crops - -(3) Add two single-point exact restart tests for transient crop, because we did -not have good coverage of exact restart tests for transient crop before this - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Added two tests: -ERS_Ly3_Mmpi-serial.1x1_smallvilleIA.IHISTCLM50BGCCROP.yellowstone_gnu.clm-cropMonthOutput # restart is right before the transition from 100% nat veg to 100% crop -ERS_Ly6_Mmpi-serial.1x1_smallvilleIA.IHISTCLM50BGCCROP.yellowstone_gnu.clm-cropMonthOutput # restart is right before increasing natural veg to > 0 while also shifting PCT_CFT - -Code reviewed by: Main change reviewed by Keith Oleson and myself - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - On my Mac - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - - In principle, answers could change for runs with transient crops, but I did - not observe any answer changes in the test suite. - -CLM tag used for the baseline comparisons: clm4_5_14_r217 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, in principle - but not in the test suite - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with transient crops - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Assumed to be larger than roundoff, but only slightly, and only rare - answer changes - - I did not observe any answer changes in the test suite. But in principle, - this could change answers for any transient crop run, as evidenced by the - change in behavior seen in Keith Oleson's transient crop run with and - without this fix. It just seems like the conditions in which this matters - only occur rarely. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main change: only copy belowground state to new columns -M components/clm/src/dyn_subgrid/dynInitColumnsMod.F90 -M components/clm/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf - -========= Abort run if try to run use_ed with transient crops -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 - -========= Fix a comment -M components/clm/src/dyn_subgrid/dynVarMod.F90.in - -========= Fix unit tests, apparently broken in r215 -M components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90.in - -========= Add two tests (see above) -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r217 -Originator(s): sacks (Bill Sacks) -Date: Fri Jan 13 05:36:28 MST 2017 -One-line Summary: Bug fix for snow radiation absorption - -Purpose of changes ------------------- - -Bug fix from Leo van Kampenhout regarding snow radiation absorption: Remove -multipliers of (1.-albsnd(c,ib)) or (1.-albsni(c,ib)) in the calculation of -flx_absdv, flx_absiv, flx_absdn, flx_absin. - -This stops this conditional in SurfaceRadiationMod from being triggered every -time step: - - if (abs(sabg_snl_sum-sabg_snow(p)) > 0.00001_r8) then - -The triggering of this conditional led to an unintended constant partitioning of -radiation through the snowpack: 75% of radiation was absorbed in the top layer, -25% in the bottom layer. - -In the old code, Leo found that sabg_snow(p) is over three times as big as -sabg_snl_sum , so these are certainly not roundoff problems. - -With the fix, the conditional is no longer triggered at every time -step. Possible explanation: the factors flx_absd_snw and flx_absi_snw are -already accounted for albedo, because they are "absorbed flux per unit incident -flux at top of snowpack" according to SnowSnicarMod.F90. - -Sean Swenson tested this, and says: I agree with leo; in fact the sum of the -flx_ terms should be the total absorption, or 1-albedo. When I remove the -albedo modification leo suggested, I see most of the cases where the if-block is -triggered go away. Those that remain are much smaller (the abs() in the if -block is ~1.e--4). I don't know if this is a precision issue, or an indication -of a remaining bug. Or it could be those cases for which the if-block was meant -to correct originally. - -Sean later added: a couple more pieces of information: 1) the if-statement is -still needed. If it is removed, a balance check error will abort the model. 2) -in SurfaceAlbedoMod, I tested the equality of sum_over_layers(flx_absdn) and -(1.0 - albsnd). For direct beam, they were equal, but occassionally for ib=2 -(near infrared), they were slightly different. These were the same points that -were then triggered by the if block in SurfaceRadiation. This may point to -something within the snicar_rt subroutine, but I don't plan on following this -issue further. - -Mark Flanner added: I will note that there is an energy conservation check in -the snicarRT code which should ensure that the sum of absorption in all snow -layers never differs substantially (>0.00001) from what is expected from albedo -and transmittance. If it does, the model aborts. This is true, however, only -at the snow column level, so I suspect the issue you identified ultimately -relates either to (1) fractional snow cover and merging of sub-grid energy -fluxes to the gridcell level and/or (2) a change in the number of snow layers in -between the calculations of snow albedo and absorbed energy flux. I think (2) -is what necessitated the patch in the first place. I could be wrong. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, baseline comparisons fail as expected - -CLM tag used for the baseline comparisons: clm4_5_14_r216 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45/CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Based on Sean Swenson's analysis: larger than roundoff; same or only - slightly changed climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Change described above -M components/clm/src/biogeophys/SurfaceAlbedoMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r216 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Thu Jan 12 16:12:45 MST 2017 -One-line Summary: Fix previous broken tag - -Purpose of changes ------------------- - -Three files were missing from the merge to transcrop_n08_clm4_5_14_r214 on the trunk. I don't -know why they were missing, but they were. I have on very rare occasions seen subversion fail -with this problem, and it maybe due to a rare bug in subversion. Manytimes I double check to -make sure this doesn't happen, but I didn't this time. - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): 2400 - 2400 --- Problem with mksurfdata_map for smallville landuse.timeseries (found in clm4_5_14_r215 after it's creation) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users None - -Changes to CLM's user interface: None - -Changes made to namelist defaults: None - -Changes to the datasets: None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: None - -Changes to tests or testing: None - -Code reviewed by: self - -CLM testing: short - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: None - - unit-tests (components/clm/src): None - - tools-tests (components/clm/test/tools): None - - PTCLM testing (components/clm/tools/shared/PTCLM/test): None - - regular tests: clm_short_50 - - yellowstone_intel - PASS - -CLM tag used for the baseline comparisons: none - - -Answer changes None --------------- - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>> Bring in files that were modified on the branch transcrop_n08_clm4_5_14_r214, but for some reason were dropped on ->>>>>> the merge to the trunk - - M components/clm/src/dyn_subgrid/dyncropFileMod.F90 - M components/clm/src/main/clm_initializeMod.F90 - M parse_cime.cs.status - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r215 -Originator(s): erik (Erik Kluzek) -Date: Thu Jan 12 10:29:52 MST 2017 -One-line Summary: Update mksurfdata_map to work with new updated datasets from Peter, and use hand-edited - surfdata/landuse.timeseries datasets for f09/f19 - -Purpose of changes ------------------- - -Use new rawdatasets from Peter Lawrence that have crop landunit changing in size as well as specific crop -and natural vegetation types. Modify mksurfdata_map to use new fields for fertilizer for each crop type. -Add in harvest fields to both surface dataset as well as landuse.timeseries dataset. Also add in two -new fields: UNREPRESENTED_PFT_LULCC, UNREPRESENTED_CFT_LULCC for the impact of landuse changes for -natural and crop vegetation types. Currently these two fields are zeroed out. But, they will be added in -with a new update to the datasets. - -Implement crop fertilizer for each crop type into CLM. The fertilizer is also moved from one crop -type to another by the mapping system between the different crop types (to handle unrepresented crop -types by mapping them to one that is represented). The new datasets also have harvest fields in units by -mass rather than area. This requires new surface and landuse.timeseries datasets. We have hand-edited -versions from Peter Lawrence for f09 and f19. The older datasets for other resolutions still work, but -they don't have the new fertilizer field so anthropogenic fertilizer is zeroed out. - -NOTE: Capability to create rcp scenarios for landuse.timeseries was removed from mksurfdata_map. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2386 -- buildnamelist unit tester can't compare to itself - 2389 -- make nitrogen balance threshold higher - 2382 -- soil depth dataset into subversion - 2369 -- Remove hacks to change PFT's in tropics in mksurfdata_map - 2097 -- mksurfdata_map changes - -Known bugs introduced in this tag (include bugzilla ID): - - 2399 -- Problem with urban points with latest mksurfdata_map - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: - - mksurfdata.pl "-crop" option changed to "-no_crop" so the default is to create datasets with crop on it. - Also default for -glc_nec is now 10 so default is to create datasets with glacier - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - New optional history field: - - FERTNITRO', 'gN/m2/yr', 'Nitrogen fertilizer for each crop - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): New f09/f19 surfdata/landuse.timeseries - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: - -Changes to tests or testing: Removed clm4_0 tools tests - -Code reviewed by: self, lawrence - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - OK - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_14_r214 - - -Answer changes --------------- - -Changes answers relative to baseline: f09 and f19 CLM45/CLM50 cases change answers because of new datasets - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 for f09 and f19 - - what platforms/compilers: all - - nature of change: adjusted surface datasets - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: Remove clm4_0 tools, rename clm4_5/shared directories under CLM tools - - D components/clm/tools/clm4_0/* - D components/clm/tools/clm4_5/mksurfdata_map/* - D components/clm/tools/clm4_5/refactorTools/* - D components/clm/tools/shared/mkmapdata/* - D components/clm/tools/shared/mkmapgrids/* - D components/clm/tools/shared/mkprocdata_map/* - D components/clm/tools/shared/ncl_scripts/* - - D components/clm/tools/clm4_5/mksurfdata_map/landuse_timeseries_hist_16pfts_simyr1850-2005.txt - -List all files added and what they do: Renamed from clm4_5 or shared subdirectories, unit tests for mkharvest - - A components/clm/tools/mksurfdata_map/* - A components/clm/tools/refactorTools/* - A components/clm/tools/mkmapdata/* - A components/clm/tools/mkmapgrids/* - A components/clm/tools/mkprocdata_map/* - A components/clm/tools/ncl_scripts/* - - A components/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkharvest.F90 - A components/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/harvestfieldsold.nc - A components/clm/tools/clm4_5/mksurfdata_map/unit_testers/inputs/harvestfields.nc - A components/clm/tools/clm4_5/mksurfdata_map/landuse_timeseries_hist_78pfts_simyr1850-2015.txt - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeochem/CNBalanceCheckMod.F90 - Increase threshold for Nitrogen balance check - M components/clm/src/biogeochem/CropType.F90 ---------- Add fertnitro to fert array - M components/clm/src/biogeochem/CNPhenologyMod.F90 ---- Add fertnitro_patch and InitCold for it - Add FERTNITRO as optional output to history files (default inactive) - M components/clm/src/biogeochem/dynHarvestMod.F90 ----- Read in harvest units, divide by deadstem if - new units of gC/m2/yr, otherwise take directly - M components/clm/src/main/surfrdMod.F90 --------------- Read in CONST_FERTNITRO_CFT if on file, - otherwise zero it out, pass fert_cft to collapse_crop_types - M components/clm/src/main/clm_varsur.F90 -------------- Add fert_cft as temporary read in from dataset - M components/clm/src/main/clm_driver.F90 -------------- Pass crop_inst to dynSubgrid_driver - M components/clm/src/main/surfrdUtilsMod.F90 ---------- Handle fert_cft in collapse_crop_types - if crops are being merged also move the fertilizer - M components/clm/src/main/clm_initializeMod.F90 ------- Allocate/dealloc fert_cft, pass crop_inst to dynsubgrid_init - M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 ------ Pass crop_inst in and down to dyncrop_interp - M components/clm/src/dyn_subgrid/dynVarMod.F90.in ------------- Add allow_nodata and data_on_file flags - and get_att method, if allow_nodata is true, read_variable will NOT abort, but zero out the - variable - M components/clm/src/dyn_subgrid/dynVarTimeUninterpMod.F90.in - Pass allow_nodata as optional argument down - M components/clm/src/dyn_subgrid/dyncropFileMod.F90 ----------- Add fertcft dyn_var_time_uninterp_type - initialize it, pass crop_inst to dyncrop_interp, get current data from fertcft%get_current_data - and pass to collapse_crop_types - - M components/clm/bld/listDefaultNamelist.pl -------------- Remove phys option maxpft is now 78 - M components/clm/bld/unit_testers/build-namelist_test.pl - Fix bug 2386 for comparing to itself for - user_nl_clm_real_parameters files - M components/clm/bld/unit_testers/NMLTest/CompFiles.pm - - Fix bug 2386 for comparing to itself, - change double quotes in filenames to a "+" like other special characters - M components/clm/bld/README ------------------------------ Remove note on clm4_0_tools file - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - Updated (hand-edited) surface and - historical landuse.timeseries datasets for f09 and f19 - M components/clm/bld/namelist_files/namelist_defaults_clm4_0_tools.xml - Remove contents - (keep file around as queryDefaultNamelist.pl assumes it's existance) - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Add "hrv" hgrid/lmask - option for 0.9x1.25/GDRC, add "hrv" mksrf_filename called mksrf_fhrvtyp use - lnd/clm2/rawdata/mksf_soilthk_5x5min_ORNL_SOILS_simyr1900-2015_c150701.nc file in place - of file pointing to Sean Swenson's personal disk space, remove: mksrf_fvegtyp for test - years, crop=off, and all rcp's as well as before 1850, but add historical through 2015 - Add harvest datasets at f09 resolution - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add mksrf_fhrvtyp - - M components/clm/cime_config/config_compsets.xml -- Add IGMHISTCRUCLM50BGCCROP compset - - M components/clm/tools/mksurfdata_map/Makefile.data ------------- Change default list of files created - so crop is output for all resolutions - M components/clm/tools/mksurfdata_map/src/mkharvestMod.F90 ------ Add harvestDataType and it's methods: - init, get1DFieldPtr, get2DFieldPtr, getFieldsIdx, getFieldsDim, isField1D, isField2D, num1DFields - num2DFields, and clean. Increase by three harvest fields, have two names for them (one for - surfdace dataset, and one for landuse.timeseries datasets), mkharvest subroutine sends - harvestDataType as it's output - M components/clm/tools/mksurfdata_map/src/mkncdio.F90 ----------- Add varexists option to check_ret, - make nf_enotatt and nf_strerror public - M components/clm/tools/mksurfdata_map/src/mkfileMod.F90 --------- Send harvdata to mkfile use - it's methods to define and output the harvest data - M components/clm/tools/mksurfdata_map/src/mkpftMod.F90 ---------- Always put CFT's on seperate land-unit - new variables for: natural-veg-percent, crop-percent, fraction for each CFT and PFT - handles oldformat and newformat (oldformat only used when PFT's are specified in namelist) - remove missing_crops logic as crop is now required - M components/clm/tools/mksurfdata_map/src/mkvarctl.F90 ---------- Add mksrf_fhrvtyp - M components/clm/tools/mksurfdata_map/src/mkpctPftTypeMod.F90 --- Add new constructor - constructor_pong to initialize a new pct_pft_type object with all PFT's on the gridcell - M components/clm/tools/mksurfdata_map/src/mksurfdat.F90 --------- Update mkharvestMod calls - and add harvestDataType, add read of harvest dataset names, handle harvest 1D and 2D - data. Remove hack to set pfts 7 and 10 to 6 in the tropics because of bad LAI's (2369) - - M components/clm/tools/mksurfdata_map/unit_testers/Srcfiles ---------------- Add new test files - M components/clm/tools/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 - add mkharvest tests and - test_get_nonexisting_var for test_mkncdio - M components/clm/tools/mksurfdata_map/unit_testers/test_mkncdio.F90 -------- Add test_get_nonexisting_var - - M components/clm/tools/mksurfdata_map/mksurfdata_map.namelist - Updated files, crop and glc_nec=10 is - on, does historical range of: 1850-2005 - M components/clm/tools/mksurfdata_map/mksurfdata.pl ----------- -crop=>-no_crop glc_nec default to 10, - default is to create datasets with crop, rawdatasets always have crop=on for them, harvest resolution different, - remove -rcp option (no longer available), year range 1850-2000 actually does 1850-2015 now. - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r214 -Originator(s): sacks (Bill Sacks) -Date: Tue Jan 3 12:55:28 MST 2017 -One-line Summary: Update column states based on dwt terms between dyn_cnbal_patch and dyn_cnbal_col, and minor fixes - -Purpose of changes ------------------- - -Main change is to move the update of column states based on dwt terms (which -come from shrinking patches) to earlier in the time step - specifically, between -dyn_cnbal_patch and dyn_cnbal_col. This includes updating the seed pools and -decomp_[c/n]pools_vr_col. - -This change is important when there are changing column areas: In order to -conserve C & N, we need to transfer the mass from the dwt terms to the -column-level pools before executing the code to conserve the column-level state -variables. For example, if the natural vegetated column shrinks (with a -corresponding shrinkage of each patch on the column), and is replaced by crop: -Then the dwt terms from the shrinking patches (assuming this was handled -correctly - fix coming in an upcoming tag...) add some C & N to the below-ground -pools. But some of this C & N needs to end up in the growing crop column. Since -the column-level conservation operates on state variables (not fluxes), this -only works properly if the mass from the dwt fluxes is added to the states -before dyn_cnbal_col. - -In addition, this tag fixes a number of minor problems: - -(1) Separates the crop uses of seed(c/n)_to_leaf from the dwt uses. This is - needed for the main change to work correctly. - -(2) Allows longer history field names in hist_fincl and hist_fexcl - -(3) Fixes SNOINTABS diagnostic field (bug 2321) - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2321: SNOINTABS diagnostic field incorrect for columns with more than one patch - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changes meaning of DWT_SEEDC_TO_LEAF andDWT_SEEDN_TO_LEAF: No longer includes - crop seed terms - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: Minor tweak to crop testmod: Add a history field -that uses SUM, in order to test the SUM history field infrastructure - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, baseline failures as expected, as noted below - -CLM tag used for the baseline comparisons: clm4_5_14_r213 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 in these configurations: - - All transient cases (HIST, RCP, DV): changes due to the main changes in - this tag - - All CROP cases: changes answers in DWT_SEEDC_TO_LEAF and - DWT_SEEDN_TO_LEAF diagnostic fields - - Many cases: differences in SNOINTABS diagnostic field. From one test - (LII_D_Ld3.f19_g16_gl5.IG1850CLM45.yellowstone_intel.clm-glcMEC_spunup_1way), - there are diffs of up to 0.06. No diffs over Antarctica or most of - Greenland (though there are some diffs on the southern tip of - Greenland). Lots of other diffs in the northern hemisphere mid-high - latitudes. This is as expected: expect diffs in vegetated areas, but not - in glacier. - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; not investigated as to whether this is new climate, - but expected not to be - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Move update of column states based on dwt terms to earlier in the time step -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M components/clm/src/biogeochem/CNNStateUpdate1Mod.F90 -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Separate the crop uses of seed(c/n)_to_leaf from the dwt uses -M components/clm/src/biogeochem/CNPhenologyMod.F90 - -========= Change sub_surf_abs_SW to a patch-level variable, rather than - column-level (fixes bug 2321) -M components/clm/src/biogeophys/SurfaceRadiationMod.F90 -M components/clm/src/biogeophys/SolarAbsorbedType.F90 - -========= Allow longer history field names in hist_fincl and hist_fexcl -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -========= Add a history field that uses SUM, in order to test the SUM history - field infrastructure -M components/clm/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r213 -Originator(s): sacks (Bill Sacks) -Date: Fri Dec 30 08:48:44 MST 2016 -One-line Summary: Convert buildnml to python - -Purpose of changes ------------------- - -Changes from Mariana Vertenstein - -Main purpose is to convert buildnml to python; also some minor tweaks to other -related files, which seem to be moving towards the removal of CLM4. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - pass - - I did NOT compare against baseline, because this is currently broken (bug 2386) - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_13_r211 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -A components/clm/cime_config/buildcpp - -List all existing files that have been modified, and describe the changes: - -M components/clm/cime_config/buildlib -M components/clm/cime_config/buildnml -M components/clm/cime_config/config_component.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_14_r212 -Originator(s): sacks (Bill Sacks) -Date: Thu Dec 22 16:06:09 MST 2016 -One-line Summary: Bump science version number due to changes in clm4_5_13_r211 - -Purpose of changes ------------------- - -Bump science version number only. This is the same code base as -clm4_5_13_r211. No additional testing was done. - -clm4_5_13_r211 has a significant change in behavior for transient cases, for -CLM45 as well as CLM50 cases. Thus, we are incrementing the science version -number. - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r211 -Originator(s): sacks (Bill Sacks) -Date: Thu Dec 22 13:46:52 MST 2016 -One-line Summary: Apply transient land cover and harvest all at once in first time step of year - -Purpose of changes ------------------- - -Scientists have found it problematic to have land cover change and harvest -interpolated throughout the year: By having just a bit of deforestation done in -each time step, the forest can regrow, so that you never see the full, -appropriate impacts of land cover change. - -This tag changes the behavior of both land cover change (transient PFTs) and -harvest so that they are applied all at once in the first time step of a given -year. - -This new behavior is consistent with the pre-existing timing of transient crops -and transient glaciers: Now all land cover changes happen all at once on the -first time step of the year. - -For the fire code, we pass a dribbled version of the land cover change - i.e., a -version that smooths the area changes over the year, similarly to what was done -before. This is important because the fire code involves interactions between -the current time step's change in area and the current time step's climate. So, -if the fire code only saw area changes on Jan 1, it could only generated -deforestation fires on Jan 1 (I think). Note there is some inconsistency now, -since the above-ground C/N biomass is all adjusted at once on Jan 1, so the fire -code operates on the already-adjusted biomass. This could be problematic in -principle if there were relatively large changes in area in a given year, but -Fang Li believes this won't cause major problems in practice, since (1) area -changes are typically small, (2) the carbon fluxes from fire are just -diagnostic, and (3) the bigger impact of deforestation fires is as a trigger for -other fires. - -In addition, for fluxes passed to the atmosphere from land cover change and -harvest, we dribble these fluxes over the year, avoiding pulsed fluxes on -Jan. 1. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- Partially addresses 2106: CNFireMod code should be re-evaluated in the presence of dynamic landunits - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Moved some transient tests (HIST/RCP) from CLM45 to CLM50 - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; some baseline comparisons fail as noted below - - NOTE: Most testing done on - dynpft_and_harvest_jan1_n07_clm4_5_13_r210. dynpft_and_harvest_jan1_n08_clm4_5_13_r210 - fixed an error check for CNDV cases. I reran the CNDV tests on the n08 tag, - along with the following additional tests: - - SMS_Ld5_D_P24x1.f10_f10.IHISTCLM50BGC.hobart_nag.clm-monthly - ERP_D_P24x1.f10_f10.IHISTCLM50BGC.hobart_nag.clm-decStart - ERP_D_Ld5.f19_g16.IRCP85CLM45BGC.yellowstone_pgi.clm-drydepnomegan - -CLM tag used for the baseline comparisons: clm4_5_13_r210 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All transient cases (HIST/RCP) with CLM45/CLM50; also DV cases - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - For transient cases: Larger than roundoff; unsure whether this is climate changing - - For DV cases, just roundoff-level changes in FCO2, LAND_USE_FLUX, NBP - I - think from the dribbling of fluxes that are generated on the first time - step of each year. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Do land cover change (transient PFTs) and harvest all at once in the - first time step of the year, rather than gradually throughout the - year; dribble the fluxes to the atmosphere, and dribble the weight - changes to the fire code. -M components/clm/src/dyn_subgrid/dynpftFileMod.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/biogeochem/dynHarvestMod.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNVegStateType.F90 - -========= Just add some documentation for history fields -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 - -========= Just remove unneeded use statements -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Introduce ability for dribblers to work at any subgrid level, and some - other feature additions -M components/clm/src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf -M components/clm/src/utils/AnnualFluxDribbler.F90 -M components/clm/src/main/decompMod.F90 -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 - -========= Move some transient tests to CLM50 -M components/clm/cime_config/config_compsets.xml -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Unrelated change: add a bit of documentation -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r210 -Originator(s): sacks (Bill Sacks) -Date: Sat Dec 17 05:43:34 MST 2016 -One-line Summary: Update cime to cesm2_0_beta04 version - -Purpose of changes ------------------- - -Update cime to version used in cesm2_0_beta04 - -Main motivation is to get the fix for the problem where manual modifications to -user_nl files in a test case get overwritten. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - pass - ran build-namelist tests without compare or generate - all passed - ran prove test_build_namelist.pl - pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - - (NLCOMP changes for IG tests; this was expected) - -CLM tag used for the baseline comparisons: clm4_5_13_r209 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime: cime5.2.0-alpha.7 -> cime5.2.0-alpha.9 - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Update cime from cime5.2.0-alpha.7 to cime5.2.0-alpha.9 -M SVN_EXTERNAL_DIRECTORIES - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r209 -Originator(s): sacks (Bill Sacks) -Date: Sun Dec 11 06:09:22 MST 2016 -One-line Summary: Change definition of NBP; bring back some r205 changes that were lost in r207 - -Purpose of changes ------------------- - -Changes definition of NBP to match the definition used by CMIP: Now NBP includes -all terms that contribute to the net carbon exchange between land and -atmosphere. - -Also, moves both NBP and NEE diagnostics to the gridcell level, rather than the -column level - so you can no longer see column-by-column values for these -diagnostics. The move of NBP to gridcell-level is needed because it now includes -some gridcell-level quantities; the move of NEE to gridcell-level is needed to -support some upcoming changes. - -Removes NET_CARBON_EXCHANGE diagnostic output because this is now redundant with -NBP. - -Also, brings back some r205 changes that were lost in r207 - most notably, the -fix for the MEGAN crash due to negative intracellular co2. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2371: Change definition of NBP - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- Changes definition of NBP diagnostic output; also, NBP is now defined at the gridcell level -- Removes NET_CARBON_EXCHANGE diagnostic output -- NEE diagnostic output is now defined at the gridcell level - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self; but change in definition of NBP was reviewed conceptually by Dave Lawrence - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; baseline comparison failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_13_r208 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 change answers as noted below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Most changes are roundoff-level changes in diagnostics and in FCO2 sent to - atmosphere; larger than roundoff-level changes in the diagnostic field - NBP; potentially larger-than-roundoff level changes in MEG_isoprene - - Roundoff-level diffs in FCO2 (sent to atmosphere), NEE, C13_NEE, C14_NEE - - NBP diagnostic field: roundoff-level change for many cases; larger than - roundoff for transient, crop, or year-2000 using initial conditions from a - transient case (due to non-zero product pools) - - Small diffs in MEG_isoprene in - SMS_Lm1.f09_g16_gl4.IG1850CRUCLM50BGC.yellowstone_intel.clm-clm50KitchenSink, - due to bringing back the fix for Megan. (In principle, this could show up - in other cases as well.) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Change definition of NBP, and other changes to carbon flux diagnostics - as noted above -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 - -========= Bring back fix for Megan crash (prevent negative intracellular CO2) - that was added in r205 and accidentally dropped in r207; also, change - 1. to 1._r8 -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - -========= Bring back SNO_TK_ICE diagnostic field that was added in r205 and - accidentally dropped in r207 -M components/clm/src/biogeophys/SoilStateType.F90 - - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r208 -Originator(s): sacks (Bill Sacks) -Date: Sat Dec 10 15:00:21 MST 2016 -One-line Summary: Rework irrigation; remove glc_smb logical - -Purpose of changes ------------------- - -Main change is a complete rework of the irrigation algorithm. This reworks the -trigger and target for irrigation to be based on soil physical properties, -removing the dependence on btran and smpso (which were problematic in -conjunction with PHS). With the current out-of-the-box parameter values, -irrigation is substantially lower than before. - -In addition, this reworks the river volume-based limitation. One change to the -volr-based limitation is that we now apply the limit to the deficit computed in -calcIrrigationNeeded - rather than applying the limit in applyIrrigation. The -point of this is to avoid problems that arise due to evolving VOLR - e.g., if we -had calculated irrigation demand such that VOLR was just barely big enough, then -we apply irrigation for some time steps, then we get an updated VOLR which is -lower due to these irrigation withdrawals - the old implementation would impose -an unnecessary limit on the irrigation to be applied for the rest of this -day. It's hard to see a clean way around this problem, given that VOLR is -updated in some but not all CLM time steps. So we're going to impose the limit -on irrigation deficit, rather than on the time step-by-time-step flux. The -downside here is that it's somewhat more likely that irrigation would try to -draw volr negative, if volr has been evolving for other reasons. - -Also, this tag pulls out the parameters controlling irrigation to namelist. - -Also reworks the limit_irrigation namelist parameter, changing it to -limit_irrigation_if_rof_enabled. This was a problem before, in that we needed to -remember to set it to false whenever we ran without an active ROF model (e.g., -during spinup); now runtime logic handles that automatically. (We considered -trying to have limit_irrigation set properly by build-namelist, but that turns -out to be tricky because there are a number of ways in which you can end up with -an inactive ROF model.) - -Also removes the glc_smb logical: this has been unused for quite a while (we -have always assumed it's true). - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variables for irrigation -- limit_irrigation changed to limit_irrigation_if_rof_enabled -- Remove glc_smb namelist variable, both for clm4_0 and clm4_5/clm5_0 -- Renamed ICE_MASK history variable to ICE_MODEL_FRACTION - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: minor tweaks to tests involving irrigation, as -described below - -Code reviewed by: Irrigation changes reviewed by Sean Swenson - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - - Many failures due to bug 2386; other than that, expected differences from - baseline - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - ok - - ok means pass or xfail; expected baseline failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_13_r207 - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All cases with irrigation - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated closely, but potentially new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): - -List all files eliminated: - -========= Merge irrigation unit tests into a single module -D components/clm/src/biogeophys/test/Irrigation_test/test_irrigation_singlepatch.pf -D components/clm/src/biogeophys/test/Irrigation_test/test_irrigation_deficit.pf -D components/clm/src/biogeophys/test/Irrigation_test/test_irrigation_multipatch.pf -D components/clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 - -========= No longer needed because we turn on irrigation river limitation in - some other irrigation tests -D components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw - -List all files added and what they do: - -========= Merge irrigation unit tests into a single module, and add some tests -A components/clm/src/biogeophys/test/Irrigation_test/test_irrigation.pf - -List all existing files that have been modified, and describe the changes: - -========= Rework irrigation: both the core algorithm and the volr limitation -M components/clm/src/biogeophys/IrrigationMod.F90 -M components/clm/src/main/clm_driver.F90 - -========= Determine if rof_enabled is true, needed now that we have changed - limit_irrigation to limit_irrigation_if_rof_enabled -M components/clm/src/cpl/lnd_comp_mct.F90 - -========= Add new irrigation namelist variables, in their own group; also remove - glc_smb namelist item -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/src/main/clm_instMod.F90 - -========= Remove glc_smb logical: we have been assuming it's true for quite a - while -M components/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml -M components/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml -M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -M components/clm/bld/namelist_files/use_cases/glacierMEC_pd.xml -M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml -M components/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M components/clm/bld/namelist_files/namelist_defaults_overall.xml -M components/clm/cime_config/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm -M components/clm/bld/unit_testers/build-namelist_test.pl -M components/clm/cime_config/buildnml -M components/clm/doc/UsersGuide/preface.xml -M components/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M components/clm/src_clm40/main/clm_glclnd.F90 -M components/clm/src_clm40/main/controlMod.F90 -M components/clm/src_clm40/main/clm_varctl.F90 - -========= Remove glc_smb and move limit_irrigation logic into IrrigationMod -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/controlMod.F90 - -========= Rework some of the column filter creators to have a clearer interface -M components/clm/src/main/filterColMod.F90 -M components/clm/src/main/test/filter_test/test_filter_col.pf -M components/clm/src/main/TopoMod.F90 -M components/clm/src/main/test/atm2lnd_test/test_downscale_forcings.pf - -========= Put some extra metadata on the restart file: whether we have - create_crop_landunit and irrigate, since these are helpful for - understanding when init_interp is needed -M components/clm/src/main/restFileMod.F90 - -========= Rename ICE_MASK to ICE_MODEL_FRACTION, based on suggestion from Marcus - Lofverstrom -M components/clm/src/main/glc2lndMod.F90 - -========= Merge irrigation unit tests into a single module -M components/clm/src/biogeophys/test/Irrigation_test/CMakeLists.txt - -========= Fix for cime update -M components/clm/bld/test_build_namelist/test_build_namelist.pl - -========= Stop turning off limit_irrigation, since it's working now; also - include QIRRIG_DEMAND in output -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm - -========= Rename limit_irrigation to limit_irrigation_if_rof_enabled -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - -========= Include QIRRIG_DEMAND in output -M components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm - -========= Remove limit_river_withdraw test - now we test that option via other - irrigation tests -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Add a stub routine -M components/clm/src/unit_test_stubs/utils/restUtilMod_stub.F90.in - -========= Add a couple of tests to the xfail list - bug 2388 -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r207 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Dec 8 10:34:56 MST 2016 -One-line Summary: PHS - Calculate separate root water uptake resistances for soil and root pathways - -Purpose of changes ------------------- - -PHS changes from Sean Swenson. Root water uptake resistances -calculated separately for soil and root pathways. These resistances -are added in series to give a soil to root resistance that replaces -the ad hoc expression used in the original code. History variables -added for soil and root resistances, as well as a variable 'QPHSNEG' -obtained by summing negative transpiration terms in each soil layer. - - -Bugs fixed or introduced ------------------------ - -none - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown - -Notes of particular relevance for developers: (including Code reviews and testing) none - ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Sean Swenson, David Lawrence, Keith Oleson - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means - all functionality tests passed. All baseline comparisons passed except: - - all clm5 compsets : expected, tag is answer changing for clm5 - - - SMS_D_Ld5.f10_f10.ICLM45ED.hobart_nag.clm-edTest : - baseline failed with RMS difference in a single field: - RMS NBP 3.3589E-12 NORMALIZED 4.4201E-05 - SMS_D_Ld5.f10_f10.ICLM45ED.yellowstone_{gnu|intel|pgi} tests - are all bit for bit with the baseline. Just documenting the - discrepancy and ignoring. - -CLM tag used for the baseline comparisons: clm4_5_13_r206 - - -Answer changes --------------- - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm5 compsets with PHS on - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): unknown, assumed larger than roundoff same climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? n/a - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -clm/src/biogeochem/CNVegetationFacade.F90 - new routines to calculate froot and croot carbon. -clm/src/main/histFileMod.F90 - add nlevsoi as 2d output option -clm/src/main/clm_driver.F90 - add calls froot and croot carbon calculations -clm/src/main/pftconMod.F90 - new root desnity and root radius variables -clm/src/biogeophys/WaterfluxType.F90 - new qflx_phs_neg_col variable -clm/src/biogeophys/WaterStateType.F90 - remove smp_l_col variable -clm/src/biogeophys/PhotosynthesisMod.F90 - calculate root-soil interface conductance -clm/src/biogeophys/SoilStateType.F90 - new variables k_soil_root_patch, soil_conductance_patch, root_conductance_patch -clm/src/biogeophys/CanopyFluxesMod.F90 - pass froot and croot carbon through to photosynthesis. -clm/src/biogeophys/SoilWaterMovementMod.F90 - calculate qflx_phs_neg_col - - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r206 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue Nov 29 10:46:24 MST 2016 -One-line Summary: Bugfix for Luna causing arctic to die - -Purpose of changes ------------------- - -Bugfix from Keith Oleson to prevent Luna from causing the arctic to -die. - -Bug 2366 prevented a divide by zero in Luna, but it sets Jmax/Vcmax to -zero. This causes plants in the arctic to never start growing and -hence never get any leaf nitrogen. The fix tested by Keith Oleson is -to set them to the default values that Luna uses when it can't -converge. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2379 - -Bugs introduced: re-opening 2291. An old problem with fire emissions -fields and gnu has resurfaced. This is a two line science change -in clm5-bgc-luna that is unlikely to caused this regression. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none expected - -Notes of particular relevance for developers: (including Code reviews and testing): none - ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: K. Oleson, Erik Kluzek - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - unit tests - fail, can't import perl module: - 'Streams/TemplateGeneric.pm'. Not related to current changes, must - have come in a previous tag. - - unit-tests (components/clm/src): - - yellowstone - all tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - no related changes, not run. - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - no related changes, not run. - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40 : ok, 45 : ok - yellowstone_pgi - 40 : ok, 45 : ok - yellowstone_gnu (clm45 only) - ok, see note below. - hobart_nag - ok - - ok means - all test functionality passes - - baselines pass except for clm5 bgc (answer changing) - - expected failures ignored - - tput, memleak, memcomp, nlcomp ignored. - - - bug 2291 has resurfaced? Also appears to have been an - issue in clm4_5_13_r205. - - FAIL SMS_Lm25.f19_g16.ICLM45BGCCROP.yellowstone_gnu.clm-cropMonthOutput BASELINE - - $ grep -e RMS TestStatus.log - RMS l2x_Fall_fire001 1.9723E-17 NORMALIZED 8.4685E-06 - RMS l2x_Fall_fire002 2.7612E-17 NORMALIZED 1.2077E-06 - RMS l2x_Fall_fire003 1.9723E-17 NORMALIZED 5.5636E-06 - -CLM tag used for the baseline comparisons: clm4_5_13_r205 - - -Answer changes --------------- - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm5-bgc with luna on. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; - new climate): Unknown, larger than roundoff to prevent die-off - of the arctic. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: unknown, Keith Oleson ran a longer simulation and - verbally confirmend he was happy with the results. - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -clm/src/biogeophys/LunaMod.F90 - bugfix for 2379 set vcmx25 and jmx25 to non-zero values. - -clm/cime_config/testdefs/ExpectedTestFails.xml - add xfail issue 2291 - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r205 -Originator(s): sacks (Bill Sacks) -Date: Wed Nov 16 10:38:15 MST 2016 -One-line Summary: Add diagnostics for snow and glacier; fix crash in Megan - -Purpose of changes ------------------- - -Most changes are to add new diagnostics fields related to the snow pack, and -diagnostic fields that are averaged just over istice/istice_mec landunits -(fields ending with _ICE). These changes are from from Leo van Kampenhout -(l.vankampenhout@uu.nl). - -In addition: - -(1) Fix to prevent negative (or very small positive) values of intracellular - leaf CO2. This just affects Megan emissions, and only has a small - effect. This change is needed to prevent a crash in Megan due to negative - values of these variables. This fix is from Keith Oleson. - -(2) Ensure that we don't try to do any downscaling over urban points; this is - not currently allowed (see bug 2377). This change is needed in case there is - an overlap between active urban points and the CISM domain: without this - change, urban points in the CISM domain would be inside the downscaling - filter, which would then cause an abort in check_downscale_consistency. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - ok means tests pass; some answer changes as noted below - -CLM tag used for the baseline comparisons: clm4_5_13_r204 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: some clm45/clm50; answer changes show up rarely - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - seem to be roundoff or only slightly greater - - Changes are due to the fix for Megan, in PhotosynthesisMod. Answer changes - only appeared for three tests in the test suite: - - SMS_Lm1.f09_g16_gl4.IG1850CRUCLM50BGC.yellowstone_intel.clm-clm50KitchenSink - ERP_P15x2_Lm13.f10_f10.IHISTCLM50BGC.yellowstone_intel.clm-monthly - - Small diffs in MEG_isoprene - - SMS_Lm25.f19_g16.ICLM45BGCCROP.yellowstone_gnu.clm-cropMonthOutput - - NaN values in a few fields in old; non-NaN in new: - - RMS l2x_Fall_fire001 NaN NORMALIZED 0.0000E+00 - RMS l2x_Fall_fire002 NaN NORMALIZED 0.0000E+00 - RMS l2x_Fall_fire003 NaN NORMALIZED 0.0000E+00 - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Do not downscale over urban points -M components/clm/src/main/glc2lndMod.F90 -M components/clm/src/main/atm2lndMod.F90 - -========= Fix Megan crash: prevent negative intracellular CO2 -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - -========= New snow / glacier diagnostic fields -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/biogeophys/SoilStateType.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/SolarAbsorbedType.F90 -M components/clm/src/biogeophys/WaterStateType.F90 -M components/clm/src/biogeophys/LakeTemperatureMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/FrictionVelocityMod.F90 -M components/clm/src/biogeophys/TemperatureType.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_13_r204 -Originator(s): erik (Erik Kluzek) -Date: Tue Nov 15 13:55:16 MST 2016 -One-line Summary: A few answer changing bug fixes - -Purpose of changes ------------------- - -This brings in some simple answer changing bug fixes. And some non-answer changing bug fixes for mksurfdata.pl and -the build-namelist unit tester. - -In order to calculate infiltration the fraction of ground covered in surface water is used, before it is updated -to account for snow. Also mulitply k_wet by a factor of 1x10^-4 both of these will makes a difference in surface runoff. -This change is essentially a bug in the original formulation and so we've applied to both CLM45 and CLM50 answers. -Since this is hydrology it will affect answers in all CLM45/CLM%0 cases whether SP, CN or BGC modes. - -For MEGAN we were using a new updated dataset that had the addition of all 78 PFT's including the new crop ones. -Unfortunately it also had bare-soil, and this moved the indexing off by one. So we have a new dataset that removes -the bare-soil and hence works correctly now. - -A simple addition of setting lake energy flux (eflx_grnd_lake) for the case when there isn't one layer os snow. - -For CLM45 we found that the use of the Zheng rooting profile for Carbon resulted in 1850 spinup simulations that couldn't -spinup the tropics. Using the Jackson-1996 profile alleviates this problem. - -There were also some simple problems in using the queryNamelistDefaults.pl tool with the new cime tag brought in -with clm4_5_12_r202. Fixing this allows mksurfdata.pl and build-namelist-unit_tester to work. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2378 Zheng profile for carbon results in tropics that doesn't spin up - 2376 mksurfdata tests fail in clm4_5_12_r202 with new cime version - 2375 84 tests are removed from build-namelist unit_tester - 2374 Use fraction of ground covered in surface water used in infiltration before it's updated to account for snow - 2370 Megan was giving incorrect answers - 1717 Lake hydrology issue - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): carbon rooting is now Jackson-1996 - rooting_profile_method_carbon for CLM$5 was Zheng method, now changed to Jackson-1996 - -Changes to the datasets (e.g., parameter, surface or initial files): New megan dataset without bare-soil - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self, swensosc, fvitt - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS (176 compare tests fail because of bug - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_12_r203 - - -Answer changes --------------- - -Changes answers relative to baseline: YES! Both CLM45 and CLM50 - - Summarize any changes to answers, i.e., - - what code configurations: CLM45BGC/CLM50 - - what platforms/compilers: all - - nature of change: - surface runoff for CLM45/CLM50 changes when snow exists, small change for short simulations - MEGAN answers are corrected, important for isoprene - Change in fill mask for lake energy flux - CLM45BGC changes in an important way - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeophys/CanopyHydrologyMod.F90 --- Save frac_h2osfc_nosnow - M components/clm/src/biogeophys/SoilHydrologyMod.F90 ----- Use frac_h2osfc_nosnow to determine frac_infclust (bug 2374) - Also change k_wet by a factor of e-4 - M components/clm/src/biogeophys/LakeHydrologyMod.F90 ----- Save off eflx_grnd_lake as an "else" in one more conditional - when snl is not 1 layer (bug 1717) - M components/clm/src/biogeophys/WaterStateType.F90 ------- Write out FH2OSFC_NOSNOW to history - M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -- Add commented out change in NBP definition - M components/clm/src/biogeochem/MEGANFactorsMod.F90 ------ Check of n_pft's on MEGAN file changes by 1 - - M components/clm/bld/listDefaultNamelist.pl -------------- Can't use version 2 format datm namelist_definition for datm or drv - but use the version 1 drv file. - M components/clm/bld/queryDefaultNamelist.pl ------------- Can't use version 2 format datm namelist_definition for datm or drv - but use the version 1 drv file. - M components/clm/bld/unit_testers/build-namelist_test.pl - Make sure glc_present is added to tests for glc command line options - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - rooting_profile_method_carbon==1 for clm45 - M components/clm/bld/namelist_files/namelist_defaults_drydep.xml - New 78 pft file for megan that doesn't have bare soil - (bug 2370) - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r203 -Originator(s): sacks (Bill Sacks) -Date: Thu Nov 10 12:14:13 MST 2016 -One-line Summary: Bug fixes for snow-on-lake - -Purpose of changes ------------------- - -Fix a few bugs with the calculation of melt fluxes arising from -snow-on-lake. These appear to mainly just affect diagnostic terms, although in -theory it looks like this fixes a possible balance check error in rare -conditions. - -Changes are from Leo van Kampenhout (l.vankampenhout@uu.nl) - -Specific changes are: - -(1) qflx_sl_top_soil is no longer updated in LakeHydrology. Terms that used to - go into that variable now go into qflx_snow_drain. - -(2) For the case where we have snow above an unfrozen lake: Changed calculation - of qflx_snomelt and eflx_snomelt: - -Old: - qflx_snomelt(c) = qflx_snomelt(c) + h2osno(c)/dtime - eflx_snomelt(c) = eflx_snomelt(c) + h2osno(c)*hfus/dtime - -New: - qflx_snomelt(c) = qflx_snomelt(c) + sumsnowice(c)/dtime - eflx_snomelt(c) = eflx_snomelt(c) + sumsnowice(c)*hfus/dtime - -So note that this now just considers sumsnowice rather than the full h2osno - -i.e., it doesn't remelt the liquid in the snow pack. - -(3) For the case where we have snow above an unfrozen lake: The update of - qflx_snow_drain is changed; and again, note that qflx_sl_top_soil is gone. - -Old: - ! update drainage from snow pack for this case - qflx_snow_drain(c) = qflx_snow_drain(c) + qflx_snomelt(c) - qflx_sl_top_soil(c) = qflx_sl_top_soil(c) + h2osno(c) - -New: - ! update incidental drainage from snow pack for this case - qflx_snow_drain(c) = qflx_snow_drain(c) + h2osno(c)/dtime - -The old version had three apparent problems: - -(a) This drainage term contributed to both qflx_snow_drain and qflx_sl_top_soil, - which later get added together (in BalanceCheck); as noted in (1), the uses - of qflx_sl_top_soil and qflx_snow_drain have been merged into just - qflx_snow_drain in this routine. - -(b) The qflx_sl_top_soil addition adds h2osno, without dividing by dtime - -(c) The qflx_snow_drain addition adds the full qflx_snomelt, which may include - other terms that were set prior to this code. - -Note that, in the new version, we want to drain the *whole* snow pack in this -case - liquid as well as solid. - -(4) qflx_top_soil is changed: - -Old: - qflx_top_soil(c) = qflx_prec_grnd_rain(p) + qflx_snomelt(c) - -New: - qflx_top_soil(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) - -What the soil receives should equal what leaves the snow, i.e. the drainage term. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: Bill Sacks, Sean Swenson - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - ok means tests pass; baseline comparison failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_12_r202 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Potentially any clm45/clm50 case - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Appears to only change diagnostic fields - - Answer changes only show up in a few cases, presumably because this case - in the code is relatively uncommon. Specifically, these tests have answer - changes: - - FAIL LII_D_Ld3.f09_g16.ICLM45BGC.yellowstone_gnu.clm-default BASELINE - FAIL ERI_D_Ld9.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay BASELINE - FAIL ERP_Ld5.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default BASELINE - FAIL ERP_P180x2_D_Ld5.f19_g16.I1850CLM45.yellowstone_intel.clm-default BASELINE - FAIL ERS_D_Ld3.f09_g16_gl4.IG1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KitchenSink BASELINE - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/LakeHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r202 -Originator(s): sacks (Bill Sacks) -Date: Wed Nov 9 12:02:41 MST 2016 -One-line Summary: Update to cime version used in cesm2_0_beta03 - -Purpose of changes ------------------- - -Update to cime version used in cesm2_0_beta03, which fixes some bugs and has -some new features. - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): -- Unexpected answer change with Build namelist2 PR (#640) (https://github.com/ESMCI/cime/issues/766) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- preview_namelists is now first run by case.build - no longer by case.setup - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- ERI and ERP tests now pass on hobart (previously these were failing silently) - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - pass - hobart_nag - ok - - ok means tests pass; answer changes in these two tests: - - FAIL ERP_Ld5.f19_g16.ICNCROP.yellowstone_pgi.clm-40default BASELINE - - testing-specific change, due to the fact that we now build this ERP test - non-threaded - - FAIL SMS_D_Ld1_Mmpi-serial.1x1_mexicocityMEX.I.hobart_nag BASELINE - - unknown reason for diff: see https://github.com/ESMCI/cime/issues/766 - - -CLM tag used for the baseline comparisons: clm4_5_12_r201 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - but only in the two tests noted above - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: just the two tests noted above - - what platforms/compilers: just the two tests noted above - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated closely - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime: clm4_5_12_r198_cime5.2.0-alpha.1-9-gd321e4b -> cime5.2.0-alpha.7 - -List all files eliminated: - -========= Just rename xmlchange_cmnds to shell_commands, because xmlchange_cmnds - is being deprecated -D components/clm/cime_config/testdefs/testmods_dirs/clm/pts/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/decStart/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/40pts/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsROA/xmlchange_cmnds -D components/clm/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/xmlchange_cmnds - -List all files added and what they do: - -========= Just rename xmlchange_cmnds to shell_commands, because xmlchange_cmnds - is being deprecated -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsROA/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/pts/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLA/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLB/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/40pts/shell_commands - -List all existing files that have been modified, and describe the changes: none - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r201 -Originator(s): sacks (Bill Sacks) -Date: Wed Nov 9 09:18:54 MST 2016 -One-line Summary: Rework initialization of transient weights - important with use_init_interp - -Purpose of changes ------------------- - -Two main purposes: - -(1) When using use_init_interp in a case with CISM, avoid doing dyn landcover - adjustments in the first time step after initialization. This is important - in order to avoid fictitious adjustments simply due to the fact that we - don't have updated glacier areas until the run loop (as in the cold start - case). - -(2) Update prescribed transient weights (for PFTs and crops) in initialization, - rather than weighting for the run loop. This undoes part of - clm4_5_1_r101. This can be important if you're running use_init_interp, so - that the appropriate points are active on the output dataset. - -More details on (1): This was achieved by initializing glacier areas at the -start of the run loop for cold start or interpolated start. - -Rationale: - -In the first time step of a run that used cold start or init_interp, glacier -areas will start at whatever is specified on the surface dataset, because -coupling fields from GLC aren't received until the run loop. Thus, CLM will see -a potentially large, fictitious glacier area change in the first time step after -cold start or init_interp. We don't want this fictitious area change to result -in any state or flux adjustments. Thus, we apply this area change at the start -of the driver loop, so that in dynSubgrid_driver, it will look like there is no -glacier area change in the first time step. - -This needs to happen very early in the run loop, before any balance checks are -initialized, because - by design - this doesn't conserve mass at the grid cell -level. (The whole point of this new code block in the driver is that we adjust -areas without doing the typical state or flux adjustments that need to accompany -those area changes for conservation.) - -This accomplishes approximately the same effect that we would get if we were -able to update glacier areas in initialization. The one difference - and minor, -theoretical problem - that could arise from this start-of-run-loop update is: If -the first time step of the CESM run loop looked like: (1) GLC runs and updates -glacier area (i.e., glacier area changes in the first time step compared with -what was set in initialization); (2) coupler passes new glacier area to CLM; (3) -CLM runs. Then the code here would mean that the true change in glacier area -between initialization and the first time step would be ignored as far as state -and flux adjustments are concerned. But this is unlikely to be an issue in -practice: Currently GLC doesn't update this frequently, and even if it did, the -change in glacier area in a single time step would typically be very small. - -If we are ever able to change the CESM initialization sequence so that GLC -fields are passed to CLM in initialization, then this new code block in the -driver can be removed. - - -Also: Remove handling of first step since cold start in dynSubgrid_driver. This -is no longer needed now that (a) we update prescribed transient weights in -initialization, and (b) we have special-purpose code for glacier in the main -driver run loop. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; a few answer changes as noted below - -CLM tag used for the baseline comparisons: clm4_5_12_r200 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with CISM, with use_init_interp = .true. - ALSO: Possible answer changes in other transient configurations - see note below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated carefully; could have climate changing impacts in a coupled run - - Baseline comparisons failed for the following three tests, as expected: - FAIL ERS_D_Ld3.f09_g16_gl4.IG1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KitchenSink COMPARE_baseline - FAIL ERS_D_Ld12.T31_g37_gl4.IG1850CRUCLM50BGC.yellowstone_intel.clm-glcMEC_spunup_inc_dec_bgc COMPARE_baseline - FAIL SMS_Lm1.f09_g16_gl4.IG1850CRUCLM50BGC.yellowstone_intel.clm-clm50KitchenSink COMPARE_baseline - - In addition, it's possible that answer changes would appear in a coupled, - transient run with cold start or init_interp, due to changes in the fields - sent in initialization (or the first time step???) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Set prescribed transient weights in initialization. Get rid of special - handling of the first step since cold start; this is no longer needed - now that we (1) handle the glacier case specially in the driver, and - (2) initialize prescribed transient weights in initialization -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Handle glacier area specially in the first time step since cold start - or interpolated start -M components/clm/src/main/clm_driver.F90 - -========= Get rid of special handling of the first step since cold start; this - is no longer needed now that we (1) handle the glacier case specially - in the driver, and (2) initialize prescribed transient weights in - initialization -M components/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 - -========= Add a flag to determine if we're doing an interpolated start -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/clm_initializeMod.F90 - -========= Just add some comments -M components/clm/src/main/subgridWeightsMod.F90 -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/init_interp/initInterpMindist.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r200 -Originator(s): erik (Erik Kluzek) -Date: Tue Nov 8 00:56:00 MST 2016 -One-line Summary: Latest parameter updates from simulations, ignore surface soil layer for plant hydraulic stress for greater variability in surface soil moisture - -Purpose of changes ------------------- - -Ignore surface soil layer for plant hydraulic stress which allows for greater variability in surface soil -moisture. Output some additional diagnostic fields to the history files. Rename fertnitro to manunitro, -both in code and in params files. Add options to vary baset by latitude for tropical crops and subtract -crop seed carbon. Don't call precision control for frootc for CLM50. - -For CLM50 we bring in the latest set of parameter updates to the parameter file as well as namelist items. -Many of these were manually tuned, and many were tuned with the automatic calibration process of Rosie Fisher -and Ben Sanderson. - -Fix several bugs, a couple possible divide by zero errors, only run freelivingfixation when FUN on. Limit -array operation by number of layers. Add option to put list of namelist parameters to an output file. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - bug 2349 Run freelivingfixation only if FUN is on - bug 2362 Possible divide by zero for fert when fertilizer off - bug 2364 maxval check goes over whole range of array when should just go to nlayers - bug 2366 fix divide by zero in Luna - bug 2367 Add a list of real parameters as part of what CLM build-namelist does (partial) - -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] - bug 2368 Remove old "use_voc" logic that was put in as a hack to turn off megan when prognostic crop was on - (This existed before, but we just spotted it as a problem) - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - New namelist items: baset_mapping, baset_latvary_slope, baset_latvary_intercept, - initial_seed_at_planting - new clm namelists: cnphenology, crop - New history fields: LNC, BTRANMN, CPHASE, LATBASET, CROPSEEDC all default active - -Changes made to namelist defaults (e.g., changed parameter values): - New parameter calibrations - For CLM50: - baseflow_scalar=0.0090932, zetamaxstable=0.5, pot_hmn_ign_counts_alpha=0.0079611 - Jmaxb1=0.093563, initial_seed_at_planting=3.0, decomp_depth_efolding=10.0 - baset_mapping=varytropicsbylat, baset_latvary_intercept=12, baset_latvary_slope=0.4 - br_root=1.1678d-06, initial_Cstocks=3*200.0 - For CLM45 old defaults used: - -Changes to the datasets (e.g., parameter, surface or initial files): - New parameter dataset with latest calibration changing following fields: - mergetoclmpft modified to remove generic crops and merge to more existing crops - mxmat,arooti,lfemerg,min_planting_temp,bfact,fleafi,manunitro manually calibrated by Yaqiong Lu for crop - soilpsi_off,soilpsi_on manually calibrated - FUN_fracfixers,fun_cn_flex_a,fun_cn_flex_b,fsr_pft,grperc,dsladlai,ekn_active,froot_leaf,kmax,leaf_long,leafcn,mbbopt,psi50,slatop,stem_leaf - modified by automatic calibration scripts - maxpsi_hr hand calibrated by Charlie Koven - i_vcad,s_vcad hand calibrated for crop - FUN_fracfixers,dsladlai,ekn_active,froot_leaf,kmax,krmax,leaf_long,leafcn,mbbopt,psi50,slatop hand calibrated - akn_active,croot_stem,ekc_active,kc_nonmyc,kn_nonmyc modified slightly - leafcn,slato from TRY database - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - crop phase should be changed into integer with parameter indices for the different types - as well as outputting flag_meanings and flag_values attributes. Remove LATBASET from history - as constant. - - There is some complication for clm4_5 to preserve answers for latbarybaset - and subtract_cropseed for fert that should be removed. Will change answers - but shouldn't matter. - -Changes to tests or testing: None - -Code reviewed by: self, oleson, dll, yaqiong - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS (254 comparison tests are different because of namelist changes) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_12_r199 - - -Answer changes --------------- - -Changes answers relative to baseline: YES! for CLM50 (identical for CLM45) - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 - - what platforms/compilers: ALL - - nature of change: calibrated climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - clm5n04r193phs_2deg_calibrateparams_v3_crop_fert10perc_medshrb_1850ADspin - b.e20.B1850.f09_g16.pi_control.all.123 - (neither of these are identical to this tag for different reasons) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M parse_cime.cs.status -- Update to work with newer cime being used now - - M components/clm/bld/unit_testers/build-namelist_test.pl ----------- Add tests for - user_nl_clm_real_parameters and baset_mapping and Jmaxb1 - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - New namelist - items: baset_mapping, baset_latvary_slope, baset_latvary_intercept, - initial_seed_at_planting - M components/clm/bld/namelist_files/namelist_defaults_clm4_0.xml --- Ran xmllint - on it. - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Use latest - calibrated parameters for clm5_0: - baseflow_scalar=0.0090932, zetamaxstable=0.5, pot_hmn_ign_counts_alpha=0.0079611 - Jmaxb1=0.093563, initial_seed_at_planting=3.0, decomp_depth_efolding=10.0 - baset_mapping=varytropicsbylat, baset_latvary_intercept=12, baset_latvary_slope=0.4 - br_root=1.1678d-06, initial_Cstocks=3*200.0 - - New paramfiles with fertnitro renamed to manunitro, clm50 version with updated - parameters - M components/clm/bld/CLMBuildNamelist.pm --- Add output_reals command line option, - new namelist subroutines: setup_logic_crop, setup_logic_friction_vel, setup_logic_century_soilbgcdecompcascade, - new general subroutine: error_if_set to abort on error if a list of - namelist items is set - new namelists: cnphenology, crop - M components/clm/src/biogeochem/CNPhenologyMod.F90 ------- Add CNPhenologyReadNML, and namelist - items: initial_seed_at_planting, and subtract_cropseed, rename fertnitro to manunitro, and add - cropseedc, and cphase, if fertilizer off don't add in manunitro, subtract cropseed - if subtract_cropseed is set. - M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - Add cropseed and CROPSEEDC to history - and restart files - M components/clm/src/biogeochem/CNDriverMod.F90 -- Only call CNFreeLivingFixation if use_fun - M components/clm/src/biogeochem/CropType.F90 ----- Add ReadNML, baset_mapping/latvary_intercept/latvary_slope - cphase_patch, add CPHASE and LATBASET to history files, cphase to restart - M components/clm/src/biogeochem/CNPrecisionControlMod.F90 -- Set prec_control_for_froot to opposite of use_nguardrail - so turned on for clm5_0 and off for clm4_5 (currently needed to get c4 crops to grow) - M components/clm/src/main/clm_initializeMod.F90 --- call energyflux_inst%initAccVars - M components/clm/src/main/controlMod.F90 ---------- call CNPhenologyReadNML - M components/clm/src/main/clm_driver.F90 ---------- call energyflux_inst%UpdateAccVars - M components/clm/src/main/pftconMod.F90 ----------- change fertnitro to manunitro - M components/clm/src/main/clm_instMod.F90 --------- call call crop_inst%ReadNML and energyflux_inst%InitAccBuffer - M components/clm/src/biogeophys/BalanceCheckMod.F90 ------ Set indexg when found - M components/clm/src/biogeophys/SoilWaterMovementMod.F90 - Remove local krmax, and use param_inst version, set - rai to zero, limit array operation to :nlayers as nlayers change - M components/clm/src/biogeophys/EnergyFluxType.F90 ------- Add btran_min, and btran_min_inst, and interfaces: InitAccBuffer, - InitAccVars, UpdateAccVars, add BTRANMN to history, BTRAN_MIN, BTRAN_MIN_INST to restart - M components/clm/src/biogeophys/FrictionVelocityMod.F90 -- Initialize zetamaxstable - M components/clm/src/biogeophys/LunaMod.F90 -------------- Initialize Jmaxb1 = 0.1_r8, check lnc>0 as well as tlai, - otherwise set: jmax25_z/vcmx25_z==0 - M components/clm/src/biogeophys/PhotosynthesisMod.F90 ---- Add LNC to history and lnca to restart, rai(j=1)==0 for PHS - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - initial_Cstocks(:)==200 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r199 -Originator(s): sacks (Bill Sacks) -Date: Sat Oct 29 14:20:11 MDT 2016 -One-line Summary: Use CISM2 by default - -Purpose of changes ------------------- - -For compsets that use CISM (IG compsets), use CISM2 by default. - -Also update CISM external to a version with an updated input file for CISM2 at 4 -km resolution. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Meaning of IG compset aliases changes - now means CISM2 rather than CISM1 -- This results in slightly changed glacier cover over Greenland -- If you have a restart file from an old IG case (CLM45/CLM50) and plug it into - an IG case with the same compset alias in this tag, there will be an initial - shock to the system as CLM responds to the new glacier area. Thus, this change - should be made in an offline run, and run for a year or more before plugging - the new restart file into a coupled run. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- All IG tests will BFAIL because they use a new resolution - -Changes to tests or testing: -- Removed the ICLM45GLCMEC compset that had been used for testing; replaced its - test with IGCLM45BGC -- Added an ERP IG test, replacing the old PEM IG test - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; IG tests BFAIL because of new CISM resolution - -CLM tag used for the baseline comparisons: clm4_5_12_r198 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Out-of-the-box IG compsets change answers due to - the new definition of these compsets (CISM2 rather than CISM1) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated closely; expected to be larger than roundoff/same climate - for most applications - - Also note that, for the sake of testing, IG tests will BFAIL - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): - -cism: cism2_1_21 -> cism2_1_24 - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/cime_config/config_compsets.xml -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r198 -Originator(s): Sean Swenson, Bill Sacks -Date: Thu Oct 20 20:39:56 MDT 2016 -One-line Summary: Rework mapping of irrigation from CLM to ROF - -Purpose of changes ------------------- - -The combination of the CLM changes and the changes to externals (RTM, MOSART, -CIME) change the way irrigation is mapped from CLM to ROF: Rather than being -mapped like other fluxes, it is mapped with normalization by VOLR. This means -that, if there are multiple ROF cells underlying a single CLM cell, then -irrigation with be withdrawn from each in an amount proportional to the VOLR in -each. So, for example, if a CLM cell overlaps two ROF cells, one with VOLR = 100 -and one with VOLR = 200, then twice as much water will be withdrawn from the -second as from the first. - -The main motivation for this change is to decrease the frequency at which -irrigation exceeds available river volume in a given ROF cell. This will -especially be improved once the volr-limited irrigation is working (this will be -fixed in an upcoming tag). - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- If this CLM tag is plugged in to a CESM tag, note that it depends on - rtm1_0_59, mosart1_0_19, and the cime changes from - https://github.com/ESMCI/cime/pull/681 - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Added some irrigation tests -- Removed some tests from the xfail list which are now passing - -Code reviewed by: Bill Sacks - Note that most changes are originally from Sean Swenson; Bill Sacks reviewed - and tested the changes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; some baseline comparison failures as noted below; - also, many IG tests (i.e., with CISM) showed baseline comparison failures, - but this is simply because, with the new CISM external, CISM now does not - produce a history file in short tests, whereas it did before. - -CLM tag used for the baseline comparisons: clm4_5_12_r197 -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 with irrigation, and all tests with MOSART - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated carefully, but expected to be larger than roundoff/same - climate - - Irrigation changes are due to the new mapping - - MOSART changes are just in x2l_Flrr_volr, r2x_Flrr_vol,r TWS & VOLR - due to - a fixed calculation of VOLR in the MOSART external - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): -- cime: 5.1.1 -> clm4_5_12_r198_cime5.2.0-alpha.1-9-gd321e4b - This is a cime branch tag, based off of baseline version d321e4b (this - baseline version is 9 commits past cime5.2.0-alpha.1). The changes on this - branch are expected to be available by cime5.2.0-alpha.5 -- cism: 2_1_18 -> 2_1_21 (unrelated to the other changes in this tag) -- rtm: 1_0_58 -> 1_0_59 -- mosart: 1_0_18 -> 1_0_19 - -List all files eliminated: - -========= Renamed to include irrigation -D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp - -List all files added and what they do: - -========= Added more tests with irrigation turned on -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_spunup -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropIrrigMonth_interp - -List all existing files that have been modified, and describe the changes: - -========= Main changes for routing irrigation as a separate field -M components/clm/src/main/lnd2atmType.F90 -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/cpl/clm_cpl_indices.F90 -M components/clm/src/cpl/lnd_import_export.F90 - -========= Use volrmch rather than volr for limiting irrigation -M components/clm/src/main/clm_driver.F90 - -========= Add 'target' attributes to some variables that need them -M components/clm/src/init_interp/initInterpMultilevelContainer.F90 - -========= Add a deallocation statement -M components/clm/src/main/atm2lndType.F90 - -========= Rename a variable -M components/clm/src/biogeophys/IrrigationMod.F90 - -========= Add a new diagnostic field -M components/clm/src/biogeophys/WaterfluxType.F90 - -========= Added two debug tests with irrigation; changed the long clm50 crop - test to include irrigation -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Two ERI tests now pass due to fixes in CIME and CISM -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r197 -Originator(s): erik (Erik Kluzek) -Date: Fri Oct 14 03:17:41 MDT 2016 -One-line Summary: Some cleanup for plant hydraulic stress and adding more namelist parameters - -Purpose of changes ------------------- - -Some cleanup and documentation of Plant Hydraulic Stress (PHS) from Keith Oleson and Daniel Kennedy. -Setup some common indices as paraameters for PHS rather than hard-coded magic numbers. -Add several new namelist parameters and -light_res option to use high resolution lightnng dataset. - -Work with bombspike option and add a test for it. Remove ESMF interfaces. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2361 Setting of glc_nec in a clm aux test - 2359 build-namelist_test.pl has 20 fails in clm4_5_12_r195 - 2351 1x1_tropicAtl case issues - 2350 problems with bombspike case - 2339 don't write crootfr and rootfr - 2333 build-namelist_test.pl should label the mode in a more useful way - 2332 fire_emis test is unable to add fire emission-specific history fields - 2325 limit scope of mct vars in decompInitMod and lnd_comp_mod - 2293 better handling of bombspike case - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - new namelist items: initial_Cstocks, freelivfix_slope_wET, freelivfix_intercept, zetamaxstable, Jmaxb1 - new build-namelist option (CLM_NAMELIST_OPTS): light_res - - Change DJK history field to TSINK - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): - Option for a half-degree lightning dataset rather than just the default T62 dataset - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - SoilWaterMovementMod.F90 duplicates the soil and root indices that are in PhotosynthesisMod - -Changes to tests or testing: Add bombspike test - -Code reviewed by: self, oleson, djk - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS (310 comparisons fail, because of namelist changes) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_12_r196 - - -Answer changes --------------- - -Changes answers relative to baseline: no bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: Remove ESMF interfaces no longer supported - - D components/clm/src/cpl/lnd_comp_esmf.F90 - D components/clm/src_clm40/main/lnd_comp_esmf.F90 - -List all files added and what they do: - --------------- Add new test for c14 bombspike - A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/user_nl_clm - A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/include_user_mods - A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_bombspike1963/shell_commands - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/CLMBuildNamelist.pm --------------------------- Add -light_res option, clarify help, set cnfireson - when lightning/pop defns needed - M components/clm/bld/unit_testers/build-namelist_test.pl ----------- set mode to options to configure, add new tests for - the new namelist options - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- set spinup_state, use_dynroot, paramfile for use_ed/clm50 - correct year range for flanduse_timeseries 1x1_tropicAtl, set light_res defaults, add half-degree lightning file, - - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add new namelist items: initial_Cstocks, freelivfix_slope_wET, - freelivfix_intercept, zetamaxstable, Jmaxb1, and light_res option - ---------------- Remove unneeded ndepsrc="stream", add cnfireson for pop-dens and lightning - M components/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/2000_control.xml - M components/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M components/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/user_nl_clm - turn hydrstess off - - M components/clm/src/utils/spmdGathScatMod.F90 ------- Add only clause to use statements (bug 2325) - M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -- Add need_lightning_and_popdens, remove note on compiler bug - M components/clm/src/biogeochem/CNNDynamicsMod.F90 --- Add CNNDynamicsReadNML for freelivfix_intercept, freelivfix_slope_wET - M components/clm/src/biogeochem/CNFireMethodMod.F90 -- Add need_lightning_and_popdens - M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -- Set need_lightning_and_popdens=.true. - M components/clm/src/biogeochem/CNFireNoFireMod.F90 -- Set need_lightning_and_popdens=.false. - M components/clm/src/biogeochem/CNFireBaseMod.F90 ---- Add need_lightning_and_popdens, only do them if true - M components/clm/src/main/clm_varpar.F90 ------------- Make i_met_lit, i_cel_lit, i_lig_lit parameters, set i_cwd appropriately - M components/clm/src/main/decompInitMod.F90 ---------- Add only clause to use statements (bug 2325) - M components/clm/src/main/ndepStreamMod.F90 ---------- Add only clause to use statements (bug 2325) - M components/clm/src/main/GetGlobalValuesMod.F90 ----- Add only clause to use statements (bug 2325) - M components/clm/src/main/controlMod.F90 ------------- Add calls to: LunaReadNML, FrictionVelReadNML, and - CNNDynamicsReadNML, DecompCascadeBGCreadNML - M components/clm/src/main/clm_instMod.F90 ------------ Shorten statement - M components/clm/src/main/ncdio_pio.F90.in ----------- Have pio bcast error, so terminate here rather than deep in pio - M components/clm/src/biogeophys/SoilWaterMovementMod.F90 - Change djk to tsink, work on documentation - set soil=1,root=4 as parameters - M components/clm/src/biogeophys/EnergyFluxType.F90 ------- Always allocate bsun_patch/bsha regardless of phs on/off - M components/clm/src/biogeophys/FrictionVelocityMod.F90 -- Add FrictionVelReadNML for zetamaxstable - M components/clm/src/biogeophys/UrbanFluxesMod.F90 ------- Use zetamaxstable from frictionvel_parms_inst - M components/clm/src/biogeophys/LunaMod.F90 -------------- Add LunaReadNML for Jmaxb1 - M components/clm/src/biogeophys/PhotosynthesisMod.F90 ---- Set sun,sha,xyl,root,veg,soil parameters and use them, always allocate - regardless of phs, ensure nvegwcs==4, remove commented out lines, add back call to bombspike, - remove some unused arrays, work on comments, - M components/clm/src/biogeophys/LakeFluxesMod.F90 -------- Use zetamaxstable from frictionvel_parms_inst - M components/clm/src/biogeophys/SoilStateType.F90 -------- Change DJK to TSINK, always alloc tsink, don't output CROOTFR/ROOTFR - M components/clm/src/biogeophys/BareGroundFluxesMod.F90 -- Use zetamaxstable from frictionvel_parms_inst - M components/clm/src/biogeophys/CanopyFluxesMod.F90 ------ Use zetamaxstable from frictionvel_parms_inst, work on comments for PHS - M components/clm/src/biogeophys/CanopyStateType.F90 ------ Always allocate vegwp_patch don't worry about PHS - M components/clm/src/biogeophys/test/HumanStress_test/test_humanstress.pf - Speed up test - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - Add DecompCascadeBGCreadNML for initial_Cstocks, - make som pools indices parameters - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r196 -Originator(s): erik (Erik Kluzek) -Date: Tue Sep 27 02:46:29 MDT 2016 -One-line Summary: Bring new cime5 to clm trunk - -Purpose of changes ------------------- - - Update from cime4 version to cime5.1.1. This has some changes to the user interface - on setting up cases. create_newcase largely works the same, but other scripts have - subtle to more extensive changes to them. cime5 has scripts all done in object oriented Python. - - create_newcase changes some options to use double "--" signs. Standard options - can be done with either one or two. - --user-compset If set, then the --compset argument is treated as a - user specified compset.This assumes that all of the - compset settings in thecompset along name have been - defined for all of its componentsIf the compset name - is found as a supported compset, then it will be - treated as such. - --pesfile PESFILE Only used and required for --user-compset - argument.Full pathname of the pes specification - fileThis argument is required if --user-compset is - True - --user-grid If set, then the -grid argument is treated as a user - specified grid.As such, the additional argument - --gridfile must also be specifiedand all of the grid - settings in the --res argument name (which must be a - grid longnamehave been defined in the grid file - pointed to by --gridfile - --gridfile GRIDFILE Full pathname of config grid file to useThis should be - a copy of cime_config/config_grids.xmlwith the new - user grid changes added to itThis argument is required - if --user-grid is True - - create_newcase adds the following new options ( - --ninst NINST Specify number of component instancesSet the number of - component instances in the case. - --srcroot SRCROOT Alternative path for source root directory. By default - this is set to cimeroot/../ - --walltime WALLTIME Set the wallclock limit for this case. Can use env var - CIME_GLOBAL_WALLTIME to set this. - -q QUEUE, --queue QUEUE - Force batch system to use a certain queue - - New files created in your case: - - Several files are softlinked into the case directory (such as case.setup, case.run, etc.) - software_environment.txt -- your environment variables - PESetupHist --- Directory for processor history changes - - case.clean_build is removed, and you use the --clean option to case.build - - xmlchange adds several options such as -subgroup - xmlquery operation is a bit different. list capability is done via --list-all option. - - Format of *.xml files in your case is a bit different than before - - PIO versions were updated and PIO now catches some errors that it let go before. - - userdefinedmachine is upgraded so that you create a ~/.cime directory and put config_machines.xml - for your machine (as well as config_compilers.xml, config_batch.xml, and config_build.xml - if needed) - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2354 New streams file for urban is in NetCDF4 classic format and new cime5 - gnu/pnetcdf/pio1 combination can't read it - -Known bugs introduced in this tag (include bugzilla ID): - 2359 build-namelist_test.pl has 20 fails in clm4_5_12_r195 - 2358 test_driver.sh has problems with running gen_domain with clm4_5_12_r19620 fails in - 2357 PTCLMmkdata broken in clm4_5_12_r196 due to changes in cime5 - 2356 Test hangs on hobart - 2353 areas wrong on mosart input file - - cime5 issues: - 589 Add back ability of ascii test lists to have comments... - 580 ERI test with REFCASE prestages file into wrong run directory - 506 make 1 processor cases by default mpi-serial (won't fix) - 294 Need an "all" option to --xml-* options - 293 cs.status looses some of the functionality that was in cimeteststatus - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - No longer need to provide machine name in create_newcase - New options to create_newcase: --queue, --walltime, --ninst - Some less used options were removed. - - Single processor cases, no longer by default use mpi-serial. You have - to manually change MPILIB! - - manage_* scripts command line options changed use --help option to query usage. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): - Urban streams file changed from NetCDF4 format to NetCDF3 so new pio1 and pnetcdf could read it - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - - interface to create_test is changed. Standard operation is like this... - - ./create_test --xml-category aux_clm45 --compare clm4_5_12_r195 --generate clm4_5_12_r196 \ - --xml-machine yellowstone--xml-compiler intel - - Currently in this version cime5.1.1 you can't leave off --xml-compiler as it will run - everything with the default compiler - -Code reviewed by: self, sacks, mvertens - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK 20 tests fail, and 104 namelists are different - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - OK (bug 2358) - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - FAIL (bug 2357) - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_12_r195 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime, rtm, mosart, cism - cime to cime5.1.1 - rtm to rtm1_0_58 - mosart to mosart1_0_18 - cism to cism2_1_18 --- Removes ESMF tests - - add output history frequency "time_period_freq" to history files - -List all files eliminated: Move to name with clm50 in it - -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/README - -List all files added and what they do: - -A parse_cime.cs.status ---- Script to parse cs.status output like cime4 cimeteststatus - usage: ../../parse_cime.cs.status cs.status.* - - Scripts to take a baseline directory in cime4 format to cime5 format -A components/clm/tools/clm4_5/refactorTools/esmciport/convertbaselines4esmci -A components/clm/tools/clm4_5/refactorTools/esmciport/linkhistorytofileswdate.ncl -A components/clm/tools/clm4_5/refactorTools/esmciport - - Have clm50 in the name, and add new CLM50 crop finidat file -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50cropMonth_interp - -List all existing files that have been modified, and describe the changes: - - Initial changes to get gen_domain build/run working with cime5 -M components/clm/test/tools/test_driver.sh -- update module settings, -M components/clm/test/tools/TCBCFGtools.sh -- update how configure works, and run - .env_mach_specific.sh, don't need to softlink Macros.make - -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- Update urban streams - files so in NetCDF3 format rather than NetCDF4 so cime5/pio can read it - -M components/clm/cime_config/config_compsets.xml - whitespace changes, add CAM55 - -M components/clm/cime_config/testdefs/testmods_dirs/clm/default/shell_commands ---- no - mult-instance extra copies, don't set PIO rearranger type -M components/clm/cime_config/testdefs/testmods_dirs/clm/40pts/xmlchange_cmnds ----- don't - set TOTALPES, but set ESP -M components/clm/cime_config/testdefs/testmods_dirs/clm/pts/xmlchange_cmnds ------- don't - set TOTALPES, but set ESP -M components/clm/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands -- no - mult-instance extra copies -M components/clm/cime_config/testdefs/testlist_clm.xml - Make all single processor - tests with _Mmpi-serial, change cropMonth_interp to clm50cropMonth_interp - change some PEM tests to ERP -M components/clm/cime_config/buildlib ------------------ Changed to python -M components/clm/cime_config/config_component.xml ------ Additive option changed to cime5 - Remove BARRIER_N/OPTION/ATM_PIO_TYPENAME/LND_PIO_REARRANGER moved to cime5 - format changed slightly - -M components/clm/src/biogeochem/MEGANFactorsMod.F90 -- MEGAN comp_names is 40 rather - than 32, to match size on megan emissions file - -M components/clm/src/main/histFileMod.F90 --- Add time_period_freq -MM components/clm/src/main/clm_varcon.F90 ---- Add isecsphr, and isecspmin - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r195 -Originator(s): sacks (Bill Sacks) -Date: Sun Sep 18 07:23:25 MDT 2016 -One-line Summary: Remove dependence on column weights in fire code - -Purpose of changes ------------------- - -When calculating the fractions of BET and BDT, calculate these as fractions of -the column rather than as fractions of the grid cell. This is needed for -consistency with all other code in CLM, where the behavior of a column shouldn't -depend on that column's weight on the grid cell. The earlier code was -problematic in this way: If you did two runs - one with default areas, and one -where the natural veg landunit area was larger or smaller - then the evolution -of the natural veg landunit could change; this is not supposed to happen in CLM. - -This can change answers for the fire code, but should generally only change -answers by a small amount, unless there are tropical grid cells where the -natural vegetation fraction is substantially less than 1. - -Fang Li is okay with this change. She points out that the original formulation -was based on the fact that literataure typically cites 60% of (BET+BDT) on the -grid cell as a cutoff for being classified as tropical closed forest for the -sake of fire determinations, so the earlier code was consistent with that -definition. She also points out that this change could lead to a slightly -greater prevalence of deforestation fires and (after tuning) a consequently -smaller prevalence of non-deforestation fires - which can be undesirable. But -overall she is okay with this change given its likely small impact. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): partial fix of item #14 in bugz 1679 - Still need to address dtrotr_col, but the fix there is different, and is tied - in with other changes for dynamic landunits. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass; some baseline comparisons fail - -CLM tag used for the baseline comparisons: clm4_5_12_r194 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CN/BGC with CLM45/CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Greater than roundoff for at least some tests; from some spot-checks, - seems to be same climate. - - I have spot-checked a few tests that have greater than roundoff-level - diffs (ERP_D_Ld5.f19_g16.IRCP85CLM45BGC.yellowstone_pgi.clm-drydepnomegan - and ERI_D_Ld9.f09_g16.ICLM45BGC.yellowstone_intel.clm-default). These - tests have diffs in just a few grid cells in the tropics. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeochem/CNFireBaseMod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNVegStateType.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r194 -Originator(s): sacks (Bill Sacks) -Date: Thu Sep 1 10:17:56 MDT 2016 -One-line Summary: Dribble annual dyn landunit adjustment fluxes; initialize water state for new crop columns - -Purpose of changes ------------------- - -Two main changes in this tag: - -(1) Add infrastructure for dribbling fluxes that are generated once per year (on - the first time step of the year), so that an equal flux is produced - throughout the year. Apply this infrastructure to the correction fluxes that - are generated to conserve water and energy with dynamic columns / landunits. - -(2) When a new column comes into existence (currently, this means a new crop - column), copy h2osoi_liq, h2osoi_ice and h2osoi_vol from the "template" - column (typically a natural veg column on that gridcell), in addition to the - pre-existing copy of t_soisno. - -Also, a minor change that touched many files: Replace inline uses of __FILE__ -with a constant ('sourcefile') defined in each source file where this is -used. This is needed because lines with __FILE__ were sometimes exceeding pgi's -line limit (since pgi enforces the line limit after expanding macros). (See bugz -2049.) - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2049 - __FILE__ expands to be too long sometimes - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): -- New uses of __FILE__ on outstanding branches should be replaced with - sourcefile. Note that I have only added 'sourcefile' in files that currently - needed it; other files may need to have this added. - -Changes to tests or testing: -- Added this test in order to test mid-year restarts with dynamic landunits - (needed to test restartability of annual flux dribbling): - ERS_D_Ld7.1x1_smallvilleIA.IHISTCLM45BGCCROP.yellowstone_intel.clm-decStart1851_noinitial - - Note that the "noinitial" aspect of this can be removed once ignore_ic_date is - made compatible with crop. - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass or xfail; expected baseline failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_12_r193 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 transient (HIST, RCP, DV or IG) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated carefully, but expected to be new climate for - configurations that have transient column areas (IG or transient crop, - which involve large transitions at the starat of the year), but only - marginally different (approx. roundoff-level) for transient natural PFTs - (which involve gradual transitions throughout the year). - - I have verified that the answer changes due to the new annual flux - dribbler infrastructure are reduced to 0 (i.e., bit-for-bit) if the flux - on the first time step of the year is treated as before - i.e., other than - the dribbling that is applied to this start-of-year flux, this - infrastructure is bit-for-bit with the earlier code in dynConsBiogeophys. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= New infrastructure for dribbling fluxes that are generated on the - first time step of the year - spreading these fluxes throughout the - year -A components/clm/src/utils/AnnualFluxDribbler.F90 -A components/clm/src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf -A components/clm/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt -A components/clm/src/utils/test/annual_flux_dribbler_test - -========= Test mods for new test: tests mid-year restarts with dynamic landunits -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial - -List all existing files that have been modified, and describe the changes: - -========= Use new infrastructure for dribbling fluxes in order to dribble fluxes - generated to conserve water and energy with changing column areas -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 - -========= New time manager routines needed for dribbling infrastructure -M components/clm/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf -M components/clm/src/utils/clm_time_manager.F90 -M components/clm/src/unit_test_shr/unittestTimeManagerMod.F90 - -========= When a new column comes into existence, also copy some soil water - variables from the template column -M components/clm/src/dyn_subgrid/dynInitColumnsMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf - -========= Add tests of new dribbling infrastructure -M components/clm/src/utils/CMakeLists.txt -M components/clm/src/utils/test/CMakeLists.txt - -========= New test: tests mid-year restarts with dynamic landunits -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Replace inline uses of __FILE__ with a constant ('sourcefile') -M components/clm/src/utils/quadraticMod.F90 -M components/clm/src/utils/clmfates_interfaceMod.F90 -M components/clm/src/utils/restUtilMod.F90.in -M components/clm/src/utils/SimpleMathMod.F90 -M components/clm/src/biogeochem/NutrientCompetitionMethodMod.F90 -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNDVType.F90 -M components/clm/src/biogeochem/VOCEmissionMod.F90 -M components/clm/src/biogeochem/CNFireFactoryMod.F90 -M components/clm/src/biogeochem/CNVegComputeSeedMod.F90 -M components/clm/src/biogeochem/C14BompbSpikeMod.F90 -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 -M components/clm/src/biogeochem/DryDepVelocity.F90 -M components/clm/src/biogeochem/CNDVDriverMod.F90 -M components/clm/src/biogeochem/MEGANFactorsMod.F90 -M components/clm/src/biogeochem/SpeciesNonIsotopeType.F90 -M components/clm/src/biogeochem/SatellitePhenologyMod.F90 -M components/clm/src/biogeochem/NutrientCompetitionFactoryMod.F90 -M components/clm/src/biogeochem/CNDVEstablishmentMod.F90 -M components/clm/src/biogeochem/DUSTMod.F90 -M components/clm/src/biogeochem/CNProductsMod.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNVegStateType.F90 -M components/clm/src/biogeochem/CNMRespMod.F90 -M components/clm/src/biogeochem/CNFUNMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/ch4Mod.F90 -M components/clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 -M components/clm/src/biogeochem/CNGapMortalityMod.F90 -M components/clm/src/biogeochem/SpeciesIsotopeType.F90 -M components/clm/src/biogeochem/CNFireBaseMod.F90 -M components/clm/src/biogeochem/CropType.F90 -M components/clm/src/biogeochem/CNCIsoFluxMod.F90 -M components/clm/src/biogeochem/CNPrecisionControlMod.F90 -M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 -M components/clm/src/biogeochem/dynHarvestMod.F90 -M components/clm/src/biogeochem/ch4varcon.F90 -M components/clm/src/biogeochem/CNSharedParamsMod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/init_interp/initInterpBounds.F90 -M components/clm/src/init_interp/initInterpMultilevelCopy.F90 -M components/clm/src/init_interp/initInterp1dData.F90 -M components/clm/src/init_interp/initInterpMultilevelSplit.F90 -M components/clm/src/init_interp/initInterp.F90 -M components/clm/src/init_interp/initInterp2dvar.F90.in -M components/clm/src/init_interp/initInterpMultilevelInterp.F90 -M components/clm/src/init_interp/initInterpMultilevelContainer.F90 -M components/clm/src/init_interp/initInterpMindist.F90 -M components/clm/src/init_interp/initInterpMultilevelSnow.F90 -M components/clm/src/main/subgridAveMod.F90 -M components/clm/src/main/initGridCellsMod.F90 -M components/clm/src/main/initVerticalMod.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/main/surfrdMod.F90 -M components/clm/src/main/ncdio_pio.F90.in -M components/clm/src/main/reweightMod.F90 -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/main/subgridWeightsMod.F90 -M components/clm/src/main/decompInitMod.F90 -M components/clm/src/main/subgridRestMod.F90 -M components/clm/src/main/subgridMod.F90 -M components/clm/src/main/ndepStreamMod.F90 -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/main/column_varcon.F90 -M components/clm/src/main/histFileMod.F90 -M components/clm/src/main/restFileMod.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/GetGlobalValuesMod.F90 -M components/clm/src/main/initSubgridMod.F90 -M components/clm/src/main/filterColMod.F90 -M components/clm/src/main/glc2lndMod.F90 -M components/clm/src/main/filterMod.F90 -M components/clm/src/main/lnd2glcMod.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/surfrdUtilsMod.F90 -M components/clm/src/main/pftconMod.F90 -M components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 -M components/clm/src/ED/biogeochem/EDSharedParamsMod.F90 -M components/clm/src/ED/main/EDCLMLinkMod.F90 -M components/clm/src/ED/main/EDRestVectorMod.F90 -M components/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 -M components/clm/src/biogeophys/OzoneOffMod.F90 -M components/clm/src/biogeophys/SnowSnicarMod.F90 -M components/clm/src/biogeophys/SoilMoistStressMod.F90 -M components/clm/src/biogeophys/OzoneMod.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/FrictionVelocityMod.F90 -M components/clm/src/biogeophys/UrbanFluxesMod.F90 -M components/clm/src/biogeophys/LunaMod.F90 -M components/clm/src/biogeophys/SurfaceAlbedoMod.F90 -M components/clm/src/biogeophys/TemperatureType.F90 -M components/clm/src/biogeophys/HumanIndexMod.F90 -M components/clm/src/biogeophys/SurfaceAlbedoType.F90 -M components/clm/src/biogeophys/PhotosynthesisMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 -M components/clm/src/biogeophys/SoilHydrologyType.F90 -M components/clm/src/biogeophys/CanopyFluxesMod.F90 -M components/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 -M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 -M components/clm/src/biogeophys/SurfaceRadiationMod.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/WaterStateType.F90 -M components/clm/src/biogeophys/UrbBuildTempOleson2015Mod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/LakeTemperatureMod.F90 -M components/clm/src/biogeophys/CanopyStateType.F90 -M components/clm/src/biogeophys/TridiagonalMod.F90 -M components/clm/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 -M components/clm/src/biogeophys/UrbanTimeVarType.F90 -M components/clm/src/biogeophys/UrbanRadiationMod.F90 -M components/clm/src/biogeophys/BandDiagonalMod.F90 -M components/clm/src/biogeophys/AerosolMod.F90 -M components/clm/src/biogeophys/IrrigationMod.F90 -M components/clm/src/biogeophys/SurfaceResistanceMod.F90 -M components/clm/src/biogeophys/UrbanParamsType.F90 -M components/clm/src/biogeophys/UrbanAlbedoMod.F90 -M components/clm/src/biogeophys/RootBiophysMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/SoilWaterMovementMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 -M components/clm/src/dyn_subgrid/dynTimeInfoMod.F90 -M components/clm/src/dyn_subgrid/dynFileMod.F90 -M components/clm/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 -M components/clm/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 -M components/clm/src/dyn_subgrid/dynColumnTemplateMod.F90 -M components/clm/src/dyn_subgrid/dynpftFileMod.F90 -M components/clm/src/dyn_subgrid/dynVarMod.F90.in -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M components/clm/src/dyn_subgrid/dyncropFileMod.F90 -M components/clm/src/dyn_subgrid/dynLandunitAreaMod.F90 -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r193 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue Aug 30 21:08:39 MDT 2016 -One-line Summary: Bugfix in BalanceCheckMod: revert tolerance change and removal of endrun call introduced in r192 - -Purpose of changes ------------------- - -Revert the tolerance change and removal of an endrun call in BalanceCheckMod -that were introduced in r192. - -Bugs fixed or introduced ------------------------- - -see above. - -Notes of particular relevance for users ---------------------------------------- - -none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - n/a, not run - - unit-tests (components/clm/src): - - yellowstone - n/a, not run - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - -CLM tag used for the baseline comparisons: clm4_5_12_r192 - - -Answer changes --------------- - -Changes answers relative to baseline: - - Test suite bit for bit with r191 and r192. Long runs may change from - r192 if the tolerance or endrun condition are encountered, but - should agree with r191. - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - components/clm/src/biogeophys/BalanceCheckMod.F90 - revert tolerance - change and reinstate endrun call. - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r192 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Sat Aug 27 21:32:54 MDT 2016 -One-line Summary: ED bugfixes and initial refactoring for a standalone library - -Purpose of changes ------------------- - -NGEE-T development work on ED. Numerous science and software -improvements including: - -* carbon linkages between ed and subsurface soil biogeochemistry -* improvements to patch fusion -* litter flux outputs -* phenology is self contained -* sites now align to clm columns -* ed is now a bgc mode -* check for incompatible physics -* better error checking of compatible name list options -* fixed memory corruption during restarts -* bit for bit restart for single point and global simulations works -* numerous threading related issues fixed -* numerous improvements to history and diagnostics - -Start renaming some routines and modules to use the new name "FATES". - -Initial development work to isolate ED from CLM and create a -standalone library, including: - -* start defining an API for external drivers to interact with fates. -* start moving interaction between clm and fates into interface routines -* start work on thread safe fates objects -* data structures to clearly identify and isolate input and output -boundary conditions for some fates routines. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): - -BalanceCheckMod.F90 was changed to loosen tolerances, not call endrun -if error in energy balance. This change isn't changing answers in -tests and wasn't caught until late in merging. It should probably be -reverted. - -ED is not thread safe, and is not expected to work or restart with -multiple threads. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CLM's user interface (e.g., new/renamed XML or namelist -variables): ed is now a bgc mode. - -Changes made to namelist defaults (e.g., changed parameter values): - -Changes to the datasets (e.g., parameter, surface or initial files): -updated ed parameters file. - -Substantial timing or memory changes: unknown - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Code reviewed by: Ryan Knox, Charlie Koven, Rosie Fisher - -CLM testing: - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ED tests have been added to the clm test suite on yellowstone and - hobart. These will BFAIL because they do not have baselines in - r191. - - CLM tag used for the baseline comparisons: clm4_5_12_r191 - - ed test suite - baseline 9c008bf - yellowstone gnu, intel, pgi - pass - -Answer changes --------------- - -Changes answers relative to baseline: bit for bit for clm40, clm45 and -clm50. Changes answers for ED compsets, but these were not supported -or expected to work in the trunk. - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - - components/clm/src/ED/biogeochem/EDPhenologyType.F90 - - List all files added and what they do: - - new mods test for ed - components/clm/cime_config/testdefs/testmods_dirs/clm/edNoFire - components/clm/cime_config/testdefs/testmods_dirs/clm/edNoFire/user_nl_clm - components/clm/cime_config/testdefs/testmods_dirs/clm/edNoFire/include_user_mods - components/clm/cime_config/testdefs/testmods_dirs/clm/edNoFire/shell_commands - - new unit tests for ED build namelist options - components/clm/bld/test_build_namelist/t/test_ed_mode.pm - - new clm-ed interface: - components/clm/src/utils/clmfates_interfaceMod.F90 - - components/clm/src/ED/main/FatesInterfaceMod.F90 - components/clm/src/ED/main/FatesGlobals.F90 - - call subsurface biogeochemistry driven by ED - components/clm/src/biogeochem/EDBGCDynMod.F90 - - List all existing files that have been modified, and describe the changes: - - =============================================================== - - ED as a bgc mode, better testing of namelist options related to ed - and checks for compatibility. - - components/clm/cime_config/config_component.xml - components/clm/bld/CLMBuildNamelist.pm - components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - components/clm/bld/unit_testers/build-namelist_test.pl - components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml - components/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml - components/clm/bld/test_build_namelist/t/test_vichydro.pm - components/clm/bld/test_build_namelist/t/template_test_XXX.pm - - Update ED test mods and add ED tests to clm test suite - components/clm/cime_config/testdefs/testmods_dirs/clm/edTest/user_nl_clm - components/clm/cime_config/testdefs/testlist_clm.xml - - clm-ed interaction - components/clm/src/main/clm_varpar.F90 - ed compatibility with century decomp - components/clm/src/main/subgridWeightsMod.F90 - ed bugfix with pft diags - components/clm/src/main/decompInitMod.F90 - cohorts aligned with columns - components/clm/src/main/clm_initializeMod.F90 - use ed interfaces, ed as bgc mode - components/clm/src/main/subgridMod.F90 - ed subgrid info updated - components/clm/src/main/ColumnType.F90 - whitespace - components/clm/src/main/histFileMod.F90 - ed specific output - components/clm/src/main/clm_driver.F90 - call ed interfaces - components/clm/src/main/initGridCellsMod.F90 - ed cohorts align with columns - components/clm/src/main/initVerticalMod.F90 - ed levels - components/clm/src/main/surfrdMod.F90 - bug work around, ed related? - components/clm/src/main/clm_instMod.F90 - use ed interfaces, ed as bgc mode - components/clm/src/main/readParamsMod.F90 - ed as bgc mode - components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 - add ed to literfall - components/clm/src/biogeochem/CNVegetationFacade.F90 - ed requires veg data structures for subsurface bgc - components/clm/src/biogeochem/CNDriverMod.F90 - remove canopy state - components/clm/src/biogeophys/BalanceCheckMod.F90 - loosen tolerances, don't endrun if error. - components/clm/src/biogeophys/TemperatureType.F90 - remove ed_gdd0 - components/clm/src/biogeophys/LunaMod.F90 - remove ed variables - components/clm/src/biogeophys/PhotosynthesisMod.F90 - remove ed variables - components/clm/src/biogeophys/CanopyFluxesMod.F90 - interface to get ed canopy fluxes - components/clm/src/biogeophys/SurfaceRadiationMod.F90 - remove ed code - components/clm/src/biogeophys/CanopyStateType.F90 - remove gccanopy_patch - components/clm/src/biogeophys/SurfaceAlbedoMod.F90 - call ED routine through interface - components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 - ed needs hydrology parameters - components/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 - fates c litr fluxes - components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 - don't do some liter pools if ed on. - - ed as bgc mode, work with subsurface bgc - components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - components/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 - components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 - components/clm/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 - components/clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 - components/clm/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 - - ed refactoring for interfaces, science and software big fixes - components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 - components/clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90 - components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 - components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 - components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 - components/clm/src/ED/main/EDCLMLinkMod.F90 - components/clm/src/ED/main/EDVecCohortType.F90 - components/clm/src/ED/main/EDRestVectorMod.F90 - components/clm/src/ED/main/EDPftvarcon.F90 - components/clm/src/ED/main/EDInitMod.F90 - components/clm/src/ED/main/EDParamsMod.F90 - components/clm/src/ED/main/EDMainMod.F90 - components/clm/src/ED/main/EDTypesMod.F90 - components/clm/src/ED/main/CMakeLists.txt - components/clm/src/ED/fire/SFMainMod.F90 - components/clm/src/ED/biogeophys/EDAccumulateFluxesMod.F90 - components/clm/src/ED/biogeophys/EDSurfaceAlbedoMod.F90 - components/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 - components/clm/src/ED/biogeophys/EDBtranMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r191 -Originator(s): sacks (Bill Sacks) -Date: Sun Aug 21 06:18:04 MDT 2016 -One-line Summary: New parameterizations for snow overburden compaction and wind drift compaction - -Purpose of changes ------------------- - - Introduces new parameterizations for snow overburden compaction and wind - drift compaction. By default, CLM45 uses the old snow overburden compaction - formula and no wind drift compaction, whereas CLM5 uses the new - parameterizations. - - Also changes the CLM50 default for the snow compaction parameter - upplim_destruct_metamorph - - Scientific changes are from Leo van Kampenhout (l.vankampenhout@uu.nl) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - New namelist option: snow_overburden_compaction_method - -Changes made to namelist defaults (e.g., changed parameter values): - - Changed clm5_0 default for upplim_destruct_metamorph - - upplim_destruct_metamorph appears in namelist for clm4_5 as well as clm5_0 - - upplim_destruct_metamorph default changed for clm5_0 (175 rather than 150) - - overburden_compress_tfactor appears in namelist for clm4_5; does not appear - when using the new Vionnet2012 snow overburden compaction method (so does - not appear by default with clm5_0); no longer has a different default value - for clm5_0 (since it doesn't appear by default in clm5_0) - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - The new parameterizations are more complex, so have a moderate (~ 20%) impact - on SnowCompaction timing, but this is a very small part of the overall CLM - run time. The timing impacts of extracting routines to compute some of - the snow compaction terms were minimal (only increased the SnowCompaction - time by a few percent). - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self; Dave Lawrence also reviewed Leo's initial implementation - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok - - tests pass; differences from baseline for CLM45 and CLM50 as expected - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass (or xfail); differences from baseline for CLM50 as expected - -CLM tag used for the baseline comparisons: clm4_5_12_r190 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Larger than roundoff; I haven't investigated this closely, but suspect - these changes result in new climate, at least regionally - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: - -========= Remove unit tests for a function that has been removed -D components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_windCompactionFactor.pf - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= (a) Add namelist option controlling which snow overburden compaction - method to use; (b) make upplim_destruct_metamorph appear in the - namelist for clm4_5 as well as clm5_0; (c) change default value for - upplim_destruct_metamorph; (d) remove clm5_0 default for - overburden_compress_tfactor (because it is not used by default in - clm5_0), and make sure this namelist item appears with clm4_5 but - doesn't appear when using the new Vionnet2012 snow overburden - compaction method -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Unrelated change: Remove spaces from timer names for easier automated - processing of timing output (requested by Sean Santos) -M components/clm/src/main/clm_driver.F90 - -========= Unrelated changes: Add more informative error messages -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/restFileMod.F90 - -========= Remove unit tests for a function that has been removed -M components/clm/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt - -=============================================================== -=============================================================== -Tag name: clm4_5_12_r190 -Originator(s): sacks (Bill Sacks) -Date: Sat Aug 20 05:53:49 MDT 2016 -One-line Summary: Fix snow capping bug - -Purpose of changes ------------------- - - When snow capping was triggered, the bottom snow layer was decreased in mass, - but dz remained unchanged, leading to problematic changes in density. This - tag fixes that problem, so that dz is decreased appropriately. - - These changes are from Leo van Kampenhout (l.vankampenhout@uu.nl) - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2343 (new snow capping scheme does not conserve density) - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - Changed - ERP_P15x2_Lm36.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-cropMonth_interp - to - ERP_P30x2_Lm36.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-cropMonth_interp - so that it could reliably finish within 2 hours. - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - ok means tests pass, some baseline comparisons fail as expected - -CLM tag used for the baseline comparisons: clm4_5_11_r189 - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: potentially all clm45 / clm50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Larger than roundoff. I have not investigated the size of the change, - suspect it is the same climate with respect to land-atmosphere fluxes, but - potentially different climate with respect to snow pack properties and SMB - sent to CISM. (This changes the density of the bottom layer of deep snow - packs.) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? n/a - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: n/a - - URL for LMWG diagnostics output used to validate new climate: n/a - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Change a test, as noted above -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_11_r189 -Originator(s): erik (Erik Kluzek) -Date: Thu Aug 18 14:52:36 MDT 2016 -One-line Summary: Bring in time varying streams for urban data (currently triggers AC use) - -Purpose of changes ------------------- - -Instead of reading in maximum building temperature from surface dataset, read it in from -a time-varying urban streams file. This allows the urban Air Conditioning use to change -in time as well as spatially. Other spatially and temporally changing parameters can be added -(or moved from the surface dataset) to this stream file as well in the future. The new streams -file has the same kind of controls as other streams file for years to run over, filename, and -mapping algorithm. The time interpolation is assumed to be linear, and it uses taxmode=extend -so it will use the first value before the first year and the last value after the last year. -The current dataset is at one degree resolution (f09_g16). Because of this CLM45 compsets -will change answers to some extent (because interpolation methods for streams are slightly -different) -- but answers will be very similar. CLM50 compsets will change because there is -variation in the max building temperature both spatially and temporally. - -Also fix a problem with the humanstress module for GSWP3 forcing because of temperatures that -are too high for the WetBulb method to converge. WetBulb previously only allowed two iterations -and now it allows more (10,000). If the method fails to converge it will exit with a warning. -This was worked on by Jonathan Buzan with Keith Oleson. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2348 PTCLMmkdata not able to run for clm5_0 - 2305 Nan for wet bulb temperature - -Known bugs introduced in this tag (include bugzilla ID): - 2346 Unnecessary arguments to WetBulb subroutine (WONTFIX) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: No longer reads t_building_max from surface dataset - reads it in from the urban time-varying streams - -Changes to CLM's user interface: New namelist variables - Add: stream_year_first_urbantv, stream_year_last_urbantv - model_year_align_urbantv, stream_fldfilename_urbantv, urbantvmapalgo - -Changes made to namelist defaults: None - -Changes to the datasets: new urban time-varying streams datasets - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: None - -Changes to tests or testing: None - -Code reviewed by: self, oleson - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (all tests PASS and 64 compare tests are different because of namelist changes) - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_11_r188 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 (to a minor degree) and clm5_0 with urban - - what platforms/compilers: All - - nature of change: same climate - - CLM45 answers with urban areas may change to a minor degree because of the use of - the urban time varying stream file to get the max indoor building temperature rather - than reading from the surface dataset. Shorter tests are fairly close and some may be - identical (all CLM45 single point cases are identical). Tests of a month or longer likely - diverge. - - Five of the 22 CLM45 and CLM45BGC tests with f10_f10 on hobart are different, others are the same. - Half of the 46 CLM45 CLM45 tests with f10_f10 on yellowstone are the same. - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): PTCLM - update PTCLM to PTCLM2_160818 - -List all files eliminated: None - -List all files added and what they do: Object to handle time-varying urban data - - A components/clm/src/biogeophys/UrbanTimeVarType.F90 -- Read max building temperature from urban time-varying stream - for three urban classes (Tall Building Disctrict-TBD, High Density-HD, and Medium Density-MD) add TBUILD_MAX as - possible output to history - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/main/clm_instMod.F90 -- Setup urbantv_type and initialize it - M components/clm/src/main/clm_driver.F90 --- Interpolate urban-time-varying data and pass it down - - M components/clm/src/biogeophys/HumanIndexMod.F90 ------------- Remove duplicated wbt_ref2m_u_patch, - output urban stull wet bulb temp, new convergence routine for Wet-Bulb (increase max iterations - from 2 to 10000) - M components/clm/src/biogeophys/SoilTemperatureMod.F90 -------- Pass urbantv down, get t_building_max from it - M components/clm/src/biogeophys/UrbBuildTempOleson2015Mod.F90 - Pass urbantv down, get t_building_max from it - M components/clm/src/biogeophys/UrbanParamsType.F90 ----------- Remove t_building_max and no longer read - T_BUILDING_MAX from surface dataset - M components/clm/src/biogeophys/test/HumanStress_test/test_humanstress.pf -- Test new WetBulb subroutine - - Add in stream_year_ first/last/align for urbantv for clm5_0 - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/2000_control.xml - M components/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M components/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - M components/clm/bld/namelist_files/use_cases/20thC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M components/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add: stream_year_first_urbantv, stream_year_last_urbantv - model_year_align_urbantv, stream_fldfilename_urbantv, urbantvmapalgo - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Defaults for above list. - clm4_5 has first, last and align set to 2000 whereas clm5_0 sets it appropriatly by sim_year and sim_year_range - there is also a CLM45 urbantv streams file that approximates the previous method of reading from the surface dataset - the urbantv streams files are at 0.9x1.25 resolution - - M components/clm/bld/CLMBuildNamelist.pm - Add setup_logic_urbantv_streams, call it and add urbantv_streams namelist - - Remove T_BUILDING_MAX from clm45/clm50 surface datasets - M components/clm/test/tools/test_driver.sh --- Make CLM_SOFF default FALSE - M components/clm/test/tools/README ----------- Show example usage on yellowstone and update note about CLM_SOFF - M components/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 ----- Don't write T_BUILDING_MAX - M components/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparMod.F90 - Remove T_BUILDING_MAX as urban parameter - M components/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl --------- Remove T_BUILDING_MAX from copy for urban single point datasets - -=============================================================== -=============================================================== -Tag name: clm4_5_11_r188 -Originator(s): erik (Erik Kluzek) -Date: Fri Aug 5 13:53:01 MDT 2016 -One-line Summary: A set of small answer changing issues for both clm45 and clm50 - -Purpose of changes ------------------- - -Changes to CLM45 and CLM50: - -Some adjustments to methane output (for both CLM45BGC) and CLM50BGC from Xiyan Xu. This calculates -finundated from before snow, and rather than multiplying m_tiller by LAI it multiples by a constant four. - -Update Li2014 FireFluxes subroutine for spinupstate=2 capability (so can be shared). Changes to -roundoff, while also allowing spinupstate==2 and fixing bug 2243 to deal with deadstem for CLM45 -from Charlie Koven. - -Carbon and Nitrogen state missing accounting of of live to dead from fire in StateUpdate3. - -Nitrogen uptake code error from Xiaojuan Yang and Charlie Koven. This is dependent on use_nitrif_denitrif=T -so will only affect CLM45BGC/CLM50BGC, but not SP or CN alone simualtions. This is for the 2nd pass at -Nitrogen uptake. - -Issue with carbon Isotopes. Brett Raczka and Henrique Duarte at Univ. Utah have identified a bug in the -CLM4.5 C isotope code, in which isotope ratios are not stabilizing when fire turns on. Turning off the -fire code produces reasonable isotope ratios. We've identified that the problem is that the variables -for the fire fluxes associated with the new fire code were never copied over into CNCIsoFluxMod.F90. Fix -from Charlie Koven, and Brett verified it worked in his version. Also update the C14 half-life value. Used -to be the Libbey value, now use the updated one. - -Changes to CLM50 only: - -Remove discontiniues in new CLM50 snow density. Also if wind is zero (< 0.1m/s), wind_dependent_snowdensity -is increase is also zero. Some changes to fire injection height for fire-emissions from Simone Tilmes, and a unit-conversion -error fix from Fang Li. - -Summary: - -ciso errors bug 2116 (isotopes both clm45/clm5) -Bug 2224 N uptake code clm45/clm50BGC -Transfer of live to dead bug 2264 clm45/clm5) -2326 for shade part clm5 -snow density discontinuities (2328) clm5 -Methane change on mechanges branch clm45/clm5 2338 -2340 Fire emission change from Simone clm5 -Units conversion error in CNfire-emissions bug 2342 clm5 - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - -2116 C isotope (13C and 14C) errors in fire code -2141 Precision of constants in SoilTemperature.F90 is not double -2224 plant N uptake second pass error -2243 Deadstem not taken into account in fire-fluxes for clm4_5 (koven) (FOR CLM45 SIDE) -2264 Fire is missing accounting of C/N for transfer of live to dead -2326 Bad multiplication of btran for soybean or nbrdlf_dcd_tmp_shrub with CNDV in CanopyFluxes -2328 Discontinuities in new CLM50 snow density formulation -2338 Use the pre-snow values to calculate finundated, and use constant for m_tiller rather than elai -2340 Adjustments to fire-emission from Simone Tilmes -2342 Units conversion error in CNfire-emissions - -Known bugs introduced in this tag (include bugzilla ID): - -2332 fire_emiss tests don't work (cime issue) - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: None - -Changes to CLM's user interface: None - -Changes made to namelist defaults: None - -Changes to the datasets: None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: None - -Changes to tests or testing: None - -Code reviewed by: self,fangli,slater,stilmes,koven - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_10_r187 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! for clm4_5 and clm5_0 - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 BGC and CN compsets and Carbon isotopes - clm5_0 all (BGC, CN, SP) - any fire-emission - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): cime - Add changes to cime branch tag to be able to run on hobart - - cime to clm4_5_11_r188_cime4.5.14 - -List all files eliminated: None - -List all files added and what they do: Add unit tests for new snow bulk density - - M components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/biogeochem/CNNStateUpdate3Mod.F90 - Subtract live to dead from fire Nitrogen for - live/dead and stem/root (both CLM45CN/BGC and CLM50CN/BGC) - M components/clm/src/biogeochem/CNC14DecayMod.F90 ------ Adjust C14 half-life from Libby 5568 to 5730 a - more recent value used (this affects both clm45 and clm50 when use_c14 is on) - M components/clm/src/biogeochem/ch4Mod.F90 ------------- Calculate finundated from before snowfall, and don't multiply - m_tiller by LAI, but by 4.0. - M components/clm/src/biogeochem/CNCStateUpdate3Mod.F90 - Subtract live to dead from fire Nitrogen for - live/dead and stem/root (both CLM45CN/BGC and CLM50CN/BGC) - M components/clm/src/biogeochem/CNCIsoFluxMod.F90 ------ Missing isotope flux calculations (changes for CLM45/50 with c13/c14) - M components/clm/src/biogeochem/CNFireEmissionsMod.F90 - Changes from Simone Tilmes adjusting the fire - injection heights for different PFTS and also use indices rather than hard-coded magic integers - M components/clm/src/biogeochem/CNFireLi2014Mod.F90 ---- Use same version of FireFluxes as in Li2016, - so can use spinup_state==2 and apply a previous bug-fix (). Outside of that answers are roundoff - different. And this allows the base version of the subroutine to be used for both Li2014 and Li2016 - to reduce code duplication. - - M components/clm/src/biogeophys/CanopyFluxesMod.F90 ---- Remove 2nd adjustment to btran for soybean - and nbrdlf_dcd_tmp_shrub for CNDV (both clm45crop/cndv and clm50crop/cndv) - M components/clm/src/biogeophys/SnowHydrologyMod.F90 --- Make new snow bulk density continuous (only CLM50) - add unit-test function: SnowHydrologySetControlForTesting. Apply new wind dependent density increase - only for wind > 0.1m/sec (so no density increase at zero wind) - - M components/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 --- Bug 2224 - - M components/clm/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt - add tests for snow density - -=============================================================== -=============================================================== -Tag name: clm4_5_10_r187 -Originator(s): erik (Erik Kluzek) -Date: Tue Jul 26 21:45:51 MDT 2016 -One-line Summary: Some CLM45/50 changes: seperate carbon and water root profile, turn off undercanopystability, - really turn PHS on, LUNA predict sunlit fraction N fractionation - -Purpose of changes ------------------- - - Seperate the carbon and water fine root profiles and have namelist control over them. This removes the duplicated - code in soilbiogeochem that replicated the Jackson-1996 profile. Also remove several soilbiogeochem specific namelist - control items over the root profile. - - CLM50 changes: - Change water fine root profile to Jackson-1996 with rootprof_beta adjusted for water (dlawren) - Turn off under canopy stability term that decreases csoilc by Sakaguchi&Zeng, 2008 (swensosc) - When fun on -- add cpool_to_leafc to leafc_to_litter and cpool_to_frootc to frootc_to_litter (rfisher) - Really turn Plant Hydrallic Stress on (erik) - Have LUNA predict the scaling of Vcmax/Jmax/tpu-25 for canopy sunlight/shaded average in Photosynthesis (rfisher) - - CLM45 changes: Water fine root profile was used rather than carbon profile (used in soilbiogeochem) in CNMResp and in ch4Mod - The profile used was zeng_2001, it's now Jackson_1996. You can duplicate the old answers if you use zeng-2001 for CNMResp - and ch4Mod, but Jackson-1996 for soilbiogeochem. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2337, 2334, 2331, 2311 - 2337 Methane and maintenance respiration using water root profile rather than carbon root profile - 2334 Plant hydraulic stress not turned on by default in clm4_5_9_r184 - 2331 many build-namelist tests fail when comparing a tag against itself - 2311 Move mbbopt to params file - -Known bugs introduced in this tag (include bugzilla ID): 2339 - 2339 croofr and rootfr profiles are time constant but default output to history - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): Namelist items added and removed - Add: rooting_profile_method_water, rooting_profile_method_carbon, rooting_profile_varindex_water, - rooting_profile_varindex_carbon, and use_undercanopy_stability - Remove: pftspecific_rootingprofile, exponential_rooting_profile, and rootprof_exp - -Changes made to namelist defaults (e.g., changed parameter values): - set: rooting_profile_method_carbon = Jackson1996 (both clm50 and clm45) - rooting_profile_method_water = Zeng_2001 (clm45), Jackson1996 (clm50) - use_undercanopy_stability = .true. (clm45), .false. (clm50) - -Changes to the datasets (e.g., parameter, surface or initial files): - New params files (with 2D rootprof_beta) - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: tests with dynroots need to explicitly turn PHS off - -Code reviewed by: self, dlawren, rfisher - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (83 compare tests FAIL, because of namelist changes) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_9_r186 - - -Answer changes --------------- - -Changes answers relative to baseline: CLM45BGC and all CLM50 - - Summarize any changes to answers, i.e., - - what code configurations: CLM45BGC and all CLM50 compsets - - what platforms/compilers: All - - nature of change: CLM45 - CLM50 - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: rfisher respmods_n31_clm4_5_9_r185_00 - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/unit_testers/NMLTest/CompFiles.pm --- Fix bug comparison to same version (2331) - - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- Remove: rooting_profile_method - Add: rooting_profile_method_water, rooting_profile_method_carbon, rooting_profile_varindex_water, - rooting_profile_varindex_carbon, and use_undercanopy_stability - Remove: pftspecific_rootingprofile, exponential_rooting_profile, and rootprof_exp - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- new param files, - set: rooting_profile_method_carbon, rooting_profile_method_water, and use_undercanopy_stability - M components/clm/bld/namelist_files/namelist_defaults_drydep.xml -- Update to use 79 PFT megan factors file - - M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm --- add use_hydrstress = .false. - M components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm - add use_hydrstress = .false. - - M components/clm/bld/CLMBuildNamelist.pm --- Pass use_ed to use_hydrstress default (2334), add setup_logic_canopyfluxes - namelist, change rooting_profile_method to rooting_profile_method_water/carbon, canopyfluxes_inparm namelist group. - - M components/clm/src/biogeochem/CNMRespMod.F90 ------ Use carbon fine root profile (crootfr_patch) rather than water profile (2337) - M components/clm/src/biogeochem/CNFUNMod.F90 -------- Use carbon fine root profile (crootfr_patch) rather than water profile - M components/clm/src/biogeochem/CNDriverMod.F90 ----- Use carbon fine root profile (crootfr_patch) rather than water profile - M components/clm/src/biogeochem/ch4Mod.F90 ---------- Use carbon fine root profile (crootfr_patch) rather than water profile (2337) - M components/clm/src/biogeochem/CNPhenologyMod.F90 -- When fun on -- add cpool_to_leafc to leafc_to_litter and - cpool_to_frootc to frootc_to_litter from Rosie Fisher - M components/clm/src/biogeochem/VOCEmissionMod.F90 -- Have factors handle new PFT size - M components/clm/src/biogeochem/MEGANFactorsMod.F90 - Read mxpft PFT's from emissions file, check that number PFT's is as expected - M components/clm/src/main/controlMod.F90 ------------ Remove exponential_rooting_profile, rootprof_exp, surfprof_exp, pftspecific_rootingprofile - Add CanopyFluxesReadNML call - M components/clm/src/main/pftconMod.F90 ------------- rootprof_beta is 2D with nvariants as 2nd dimension - M components/clm/src/main/clm_varpar.F90 ------------ Add nvariants=2 for variants of PFT constants - M components/clm/src/biogeophys/LunaMod.F90 --------- Make LUNA predict sunlit fraction N fractionation, scale in PhotosynthesisMod - M components/clm/src/biogeophys/PhotosynthesisMod.F90 --------- Implement scaling of Vcmax/Jmax/tpu/25 from sunlit average to shaded canopy - average value (both PHS and non-PHS versions), read mbbopt from params file in PHS section (2311) - M components/clm/src/biogeophys/SoilStateType.F90 ------------- Add crootfr_patch for carbon and initialize. rootfr_patch is for water - write out crootfr and rootfr to history (this should be cleaned up to be only for first history file as it's an unchanging - constant profile) - M components/clm/src/biogeophys/CanopyFluxesMod.F90 ----------- Add CanopyFluxesReadNML with canopyfluxes_inparm namelist - and set use_undercanopy_stability in it, decrease csoilc as in in Sakaguchi&Zeng, 2008 if on - M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - Initialize crootfr - M components/clm/src/biogeophys/RootBiophysMod.F90 ------------ Add water and carbon versions of rooting_profile_method - and add water and carbon rooting_profile_varindx for variant index of rootprof_beta to use from params file, make - m_to_cm and beta double precision, pass 'water' or 'carbon' to init_vegrootfr, varindx for carbon is 2 and 1 for water. - default rooting method is zen_2001 for water and jackson_1996 for carbon. - M components/clm/src/biogeophys/SurfaceRadiationMod.F90 ------- Remove unused single precision reals - M components/clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 - Use crootfr_patch to set cinput_rootfr, remove - version of jackson_1996 carbon root profile that was in here. Also remove: exponential_rooting_profile, pftspecific_rootingprofile, - and rootprof_exp - -=============================================================== -=============================================================== -Tag name: clm4_5_9_r186 -Originator(s): sacks (Bill Sacks) -Date: Wed Jul 13 07:17:04 MDT 2016 -One-line Summary: Initialize biogeochem balance checks AFTER column area updates - -Purpose of changes ------------------- - -Reworking the conservation of patch-level CN variables with dynamic landunits -will make the column-level CN balance checks very tricky to determine, as they -were written before - where the starting point for the comparison was determined -before all of the area adjustments (i.e., the dyn subgrid stuff). This becomes -much more straightforward if the initialization of the balance checks is done -after the dyn subgrid stuff is complete. This tag makes that change. - -In order to accomplish that, we need to re-compute the CN state summaries after -the dyn subgrid stuff is complete - near the beginning of the time step. We -still need the summary routine at the end of the time step for the sake of -diagnostics (e.g., history output). So now we call the summary routines twice -for states. We do NOT need to call the flux summary routines at the beginning of -the time step - and doing so doesn't really make sense (how do you summarize -fluxes that haven't yet been computed) - so I have split the top-level summary -routine into a SummarizeStates and SummarizeFluxes. - -I also reworked the ch4 balance check similarly, in order to be consistent with -the CN balance checks. - -Longer-term, we'll add another set of balance checks that operate on -gridcell-level quantities, which WILL cover the dyn subgrid stuff. So the -overall sequence will look like: - - Initialize gridcell-level balance checks - Dyn subgrid stuff (adjust patch, column, landunit areas, and do associated - state updates) - Initialize column-level balance checks - Science routines - Check column-level balance - Check gridcell-level balance - - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - -ok means tests pass, some answers change as noted below - -CLM tag used for the baseline comparisons: clm4_5_9_r185 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 runs with BGC that involve changes - in subgrid areas (including HIST, RCP, DV and IG cases) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated closely; expected to be larger than roundoff / same climate - - Answer changes come from the fact that some code (e.g., the fire code) - uses the summarized state variables. Previously, this code was using the - state summaries from the previous time step. With this change, the code is - now using the updated state summaries. These updated state summaries can - differ from the ones computed at the end of the last time step if subgrid - areas have changed. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Move initialization of CN and ch4 balance checks to AFTER dyn subgrid -M components/clm/src/main/clm_driver.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 - -========= Split the CNDriverSummary into separate SummarizeStates and - SummarizeFluxes: Only SummarizeStates needs to be done near the start - of the time step. Also move calls to PrecisionControl to a higher - level, since these aren't needed in the initial call to - SummarizeStates. -M components/clm/src/biogeochem/CNDriverMod.F90 - -========= Change which terms (from transient landcover) are included in the - balance checks, due to new placement in the driver sequence -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 - -========= Rework timing of ch4 balance check initialization, too, for - consistency -M components/clm/src/biogeochem/ch4Mod.F90 - -========= Remove some variables from Restart, now that we call the Summary - routines early in the time step. Also no longer update summary - diagnostic variables in DynamicPatchAdjustments -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - -========= No longer need to do p2c of totvegc in fire code: this is done in the - initial call to the summary routines -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 -M components/clm/src/biogeochem/CNFireNoFireMod.F90 - -========= Replace __FILE__ with filename parameter to avoid too-long lines with pgi -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 - -========= Remove - SMS_Lm25.f19_g16.ICLM45BGCCROP.yellowstone_gnu.clm-cropMonthOutput: - baseline comparisons have been passing for me recently -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_9_r185 -Originator(s): sacks (Bill Sacks) -Date: Thu Jul 7 13:54:09 MDT 2016 -One-line Summary: Revert glacial melt behavior to the old treatment for mountain glaciers - -Purpose of changes ------------------- - -The primary change in this tag is reverting glacial melt behavior to the old -scheme (i.e., the scheme used in standard glacier landunits) for mountain -glaciers: The old scheme involves glacial melt remaining in place until it -refreezes (thus, not generating any runoff), whereas the new scheme involves -glacial melt running off and being replaced by ice from below (generating -positive liquid runoff and negative ice runoff). - -The main motivation for this change is that mountain glaciers were generating -substantial negative ice runoff in coupled cases when using the new scheme. This -is presumably because CAM's topographic height is significantly lower than the -real-world topographic height in mountainous regions, so mountain glaciers were -seeing too-warm temperatures. The LIWG, in consultation with members of the -LMWG, decided to revert mountain glaciers to their old behavior to avoid -detrimentally impacting a coupled simulation. Because the LIWG is not currently -concerned with the SMB of mountain glaciers - and because mountain glacier SMB -cannot be realistically simulated yet anyway - this reversion was not considered -a problem from their perspective. - -To accomplish this, this tag introduces a new namelist variable, -glacier_region_melt_behavior. Like glacier_region_behavior, this keys off of the -GLACIER_REGION field on the surface dataset. Thus, different melt behavior can -be used for each glacier region. By default, Greenland and Antarctica use the -new (glc_mec) behavior ('replaced_by_ice'), whereas other regions use the old -behavior ('remains_in_place'). - -For glacier columns that use the 'remains_in_place' melt behavior, we do NOT -compute surface mass balance (SMB). This is because the negative component of -SMB is non-sensical in those columns. To make this clear, the QICE, QICE_FRZ and -QICE_MELT diagnostic fields are filled with missing values in the -'remains_in_place' region. (However, the qice fields sent to the coupler, along -with QICE_FORC, are 0 in that region - giving the values that are actually sent -to the coupler.) - -Note that this means that different glacier regions now have different -physics. And, in order to compute SMB, you would need to change the melt -behavior, thus significantly changing the behavior of mountain glaciers. - -This tag also refactors the code that computes glacier surface mass balance so -that this is centralized in one module: GlacierSurfaceMassBalanceMod.F90. - -Other behavior changes in this tag are: - -(1) The subgrid snow parameterization (subgrid topographic variability) now - differentiates between 'single_at_atm_topo' istice_mec columns and other - istice_mec columns. Previously, istice_mec columns were treated differently - from others because they already have some representation of subgrid - variability. However, 'single_at_atm_topo' columns should be treated more - like other columns, because they do not allow for this elevation class - variability; this has been fixed here. - -(2) Vegetated SMB is computed for all grid cells where we compute glacier - SMB. Previously vegetated SMB was only generated in the 'virtual' glacier - region, but that added complexity to the code logic without having a good - reason (as far as I can tell). This change just affects the lnd -> glc - fields for elevation class 0 (changing where these are valid, rather than - being set to 0): it does not affect the evolution of CLM. - -(3) Adds some error checking for the glacier_region_behavior namelist item as - well as for the new glacier_region_melt_behavior namelist item. - -Between the primary change in this tag and the change in (1), it is now possible -to make the evolution of glacier_mec landunits exactly match the evolution of -standard glacier landunits - by using a glacier_region_behavior of -'single_at_atm_topo' and a glacier_region_melt_behavior of 'remains_in_place'. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Surface mass balance (SMB) is no longer computed for mountain glaciers. In - order to compute SMB, you would need to change the - glacier_region_melt_behavior, which will change behavior significantly for - mountain glaciers. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable, glacier_region_melt_behavior - as described above. This - variable and glacier_region_behavior both appear in the default namelist for - all clm45/clm50 cases, but only affect the operation of CLM if running with - glc_mec (i.e., a case with CISM). - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: none - -Changes to tests or testing: none - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - ok (tests pass, expected differences from baseline; but see - bug 2331) - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, some answer changes as noted below - -In addition, ran 100-year runs to confirm that glc_mec (istice_mec) landunits -can now be made to operate exactly the same as standard glacier (istice) with -the appropriate namelist settings: - - IG run: 1850_DATM%QIA_CLM50%BGC_SICE_SOCN_RTM_CISM1_SWAV - I run: 1850_DATM%QIA_CLM50%BGC_SICE_SOCN_RTM_SGLC_SWAV - - For the IG run, put the following in user_nl_clm: - - glacier_region_behavior = 'single_at_atm_topo','single_at_atm_topo','single_at_atm_topo' - glacier_region_melt_behavior = 'remains_in_place','remains_in_place','remains_in_place' - - and with the following sourceMods to allow running an IG compset with - single_at_atm_topo & remains_in_place behavior over Greenland (because we - currently cannot run with SGLC with glc_mec): - - --- ../../../components/clm/src/cpl/lnd_import_export.F90 2016-07-01 06:11:13.117799391 -0600 - +++ SourceMods/src.clm/lnd_import_export.F90 2016-07-04 09:58:37.130458468 -0600 - @@ -228,8 +228,8 @@ - glc2lnd_inst%topo_grc(g,num) = x2l(index_x2l_Sg_topo(num),i) - glc2lnd_inst%hflx_grc(g,num) = x2l(index_x2l_Flgg_hflx(num),i) - end do - - glc2lnd_inst%icemask_grc(g) = x2l(index_x2l_Sg_icemask,i) - - glc2lnd_inst%icemask_coupled_fluxes_grc(g) = x2l(index_x2l_Sg_icemask_coupled_fluxes,i) - + glc2lnd_inst%icemask_grc(g) = 0._r8 - + glc2lnd_inst%icemask_coupled_fluxes_grc(g) = 0._r8 - end if - - end do - - Both run at T31_g37 for 100 years; compared last CLM and RTM history files; - these were bit-for-bit except for expected differences in PCT_LANDUNIT - - Also ran similar sets of runs, but with all temperatures increased by 10 deg - (along with setting initial glacier h2osno to 0) or decreased by 10 deg (along - with setting initial glacier h2osno to 10000) to try to make sure we're - exercising both glacier increases and decreases (though I didn't confirm that - we're definitely exercising increases and decreases in those). Ran those hot & - cold runs with both CLM50 and CLM45. - -CLM tag used for the baseline comparisons: clm4_5_9_r184 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with glc_mec (i.e., compsets with CISM) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - expected to be new climate, at least regionally - but not investigated closely - - Answers change over glaciers outside of Greenland and Antarctica (i.e., - mountain glaciers). In addition, fields sent to coupler are now present - for elevation class 0 (bare ground) over Antarctica. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Consolidate code that computes glacier surface mass balance. This code - was primarily taken from SoilTemperatureMod and HydrologyDrainageMod, - with some other code also removed from BalanceCheckMod and - clm_driver. Relevant fluxes have also been moved here (from - WaterfluxType) -A components/clm/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Add new glacier_region_melt_behavior namelist item; always add - glacier_region_behavior and glacier_region_melt_behavior to namelist, - so error checks pass (these currently aren't needed in cases without - CISM, but will always be needed soon, once glc_mec becomes the only - glacier option - so it seemed reasonable to go ahead and always add - them to the namelist) -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -========= Add differentiation on glacier_region_melt_behavior, add an - 'allow_multiple_columns_grc' flag that can be used elsewhere, improve - error checking, and some other tweaks -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/main/test/glcBehavior_test/test_glcBehavior.pf - -========= Move code out, into new GlacierSurfaceMassBalanceMod -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 - -========= Call new routines, move initialization to 0 out of clm_drv_init into - new GlacierSurfaceMassBalanceMod -M components/clm/src/main/clm_driver.F90 - -========= Change do_smb filter: (1) only includes points where - melt_replaced_by_ice is true; (2) includes vegetated points for the - same grid cells as glacier points, rather than using the - has_virtual_columns mask -M components/clm/src/main/filterMod.F90 - -========= For glc_mec columns: Subgrid topographic variability depends on - whether a gridcell allows multiple elevation classes -M components/clm/src/main/initVerticalMod.F90 - -========= Add new glacier_smb_inst, and pass it where needed -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/lnd2glcMod.F90 - -========= Do some additional error checking -M components/clm/src/main/glc2lndMod.F90 - -========= Build new code for unit tests -M components/clm/src/biogeophys/CMakeLists.txt - -========= Unrelated change: do necessary teardown -M components/clm/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf - -========= Just remove unneeded use statements -M components/clm/src/biogeochem/DUSTMod.F90 -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/histFileMod.F90 - -========= Remove a bunch of tests that no longer fail (due to changes in r184 or - earlier) or have been removed from the test list; also change bug - associated with one test -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_9_r184 -Originator(s): erik (Erik Kluzek) -Date: Wed Jul 6 14:55:45 MDT 2016 -One-line Summary: CLM50 changes: Atkin form of lmr changed, new parameters and files, turn PHS on by default, new - cold snow density, reseed at exit AD spinup, fix fire bug, fix npool and cpool errors - -Purpose of changes ------------------- - -The CLM50 Atkin method of leaf maintenence respiration was changed by Dr. Rosie Fisher according to communication with Atkin. -New parameter file for CLM50 with new parameters. Plant Hydraulic Stress is now on by default for CLM50. New formulation -for snow density below -15C from Dr. Andrew Slater and Dr. David Lawrence. If plants are dead at the exit AD spinup stage, reseed. -Fix a fire bug which allowed negative nitrogen pools. Fix some npool and cpool errors. - -Work on CNFUNMod, correct indentation, and headers and comments. Remove unused arrays. Initialize arrays in filter loops. Do -some changes to increase performance. Make logic for CNPrecisionControl into three subroutines, when especially negative abort. - - -- Changes from Rosie Fisher to remove leaf_acc term, and implement changes to the Atkin form of lmr25top based on personal communication -with Atkin. - -- new params file - -- Read in PHS parameters from PFT params file. - -- CNPrecisionControl modularization - -- new method for snow density and a change to how wind_dependent_snow_density is done for clm5.0. upplim_destruct_metamorph and - -- overburden_compress_tfactor for clm5 - -- Put mbbopt on params file and use it - -- removed deciduous retranslocation adjustment to plant_ndemand to fix cpool error - -- Checkin Keith's changes to reseed Carbon for forests if in spinup mode and returning to regular mode, this should help in making it so - -- that you can always use spunup initial conditions rather than always having to do a cold start - -- Some FUN optimization. - -- Set barriers, ATM_PIO_TYPENAME - -- removed deciduous retranslocation adjustment to plant_ndemand to fix cpool error - -- If leafn small set leaf-CN and storage_leaf-CN to missing value in NutrientCompetitionFlexibleCNMod - -- add in free N flux direct to npool - -- Move update of grainn_to_food side by side to grainc_to_food with the same equation, from Rosie and Keith (bug 2327) - -- fire (bug 2314) - -- soybean CNDV shrub (bug 2326) - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2255, 2314, 2326, 2327 - - 2327 Change location of where grainn_to_food is updated for CROP - 2326 Bad multiplication of btran for soybean or nbrdlf_dcd_tmp_shrub with CNDV in CanopyFluxes (partial see below) - 2314 Negative carbon pools due to issue in fire model - 2255 bug in soil resistance, likely causes crop soil resistance to remain unset - -Known bugs introduced in this tag (include bugzilla ID): 2326, 2328, 2330 - 2330 Issue with frootc/frootn for C4 crops - 2328 Discontinuities in new CLM50 snow density formulation - The issue that created the need for bug 2326 was removed for both CLM45 and CLM50 in this tag - (The same code was left in the CLM40 version) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - New namelist items: ncrit, ccrit, nnegcrit, cnegcrit, - baseflow_scalar, denitrif_respiration_coefficient/exponent (and nitrconc), lotmp_snowdensity_method, - upplim_destruct_metamorph, overburden_compress_Tfactor, min_wind_snowcompact, remove leaf_acc - -Changes made to namelist defaults: Set new namelist items, update CLM50 params file - -Changes to the datasets: CLM50 params file with updated parameters - -Substantial timing or memory changes: CLM50BGC is a good bit faster - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: Now reading some mxpft dimensioned arrays in local readParams - SnowHydrologyMod parameters should go into a params_type - -Changes to tests or testing: None - -Code reviewed by: self,oleson,rfisher,dlawren,aslater@cu.edu,lifang - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (78 compare tests FAIL because of namelist changes) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_9_r183 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes for CLM50 and CLM45CROP - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 or CLM45CROP - - what platforms/compilers: All - - nature of change: - CLM50 ------ Modified climate - CLM45CROP -- soybean results and grainn_to_food (all CFTS) will be different - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: rfisher: respmods_n30_clm4_5_8_r182_4x5_bareground_AD_1 (has some other SourceMods too) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: - - D components/clm/bld/namelist_files/namelist_definition_drv_flds.xml - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/main/clm_initializeMod.F90 ------------ Always call readParameters - M components/clm/src/main/controlMod.F90 ------------------- Add calls to: soilHydReadNML, nitrifReadNML, CNPrecisionControlReadNML - M components/clm/src/main/clm_driver.F90 ------------------- Work with timing calls - M components/clm/src/main/pftconMod.F90 -------------------- Read in mbbopt - M components/clm/src/main/readParamsMod.F90 ---------------- Add some comments, pass in photosyns_inst and call it's readParams - M components/clm/src/biogeophys/SoilWaterMovementMod.F90 --- Use Photosyns_inst->params_inst%psi_soil_ref in place of -50000 - M components/clm/src/biogeophys/SoilHydrologyMod.F90 ------- Add soilHydReadNML, read in baseflow_scalar - M components/clm/src/biogeophys/SnowHydrologyMod.F90 ------- New namelist items: lotmp_snowdensity_method, - upplim_destruct_metamorph, overburden_compress_Tfactor, min_wind_snowcompact, new_snowdensity method has - lower density for < -15C, change to wind_dependent_snow_density - M components/clm/src/biogeophys/PhotosynthesisMod.F90 ------ New parameters for Plant Hydralic Stress: krmax, kmax, - psi50, psi_soil_ref, lmr_intercept_atkin, remove leaf_acc. Add: allocParams, readParams methods - remove mbbopt and move into pftcon. Atkin method of leaf respiration modified per communication with Atkin. - M components/clm/src/biogeophys/SurfaceResistanceMod.F90 --- Properly use land-unit rather than column (bug 2255) - M components/clm/src/biogeophys/CanopyFluxesMod.F90 -------- Remove multiplication of btran for soybean or nbrdlf_dcd_tmp_shrub - for CNDV, inside the ITERATION loop (bug 2326). This means the reason that brought this code is no longer addressed. - M components/clm/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 --- Add nitrifReadNML, read in: - denitrif_respiration_coefficient, denitrif_respiration_exponent, denitrif_nitrateconc_coefficient, - denitrif_nitrateconc_exponent. Remove k_nitr_max - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - Remove hardwired minpsi - M components/clm/src/biogeochem/CNFireBaseMod.F90 --------- Multiply several terms by (1-cc_other) (bug 2314) - M components/clm/src/biogeochem/CNPrecisionControlMod.F90 - Add CNPrecisionControlReadNML, cnegcrit, nnegcrit - do actual truncation inside new subroutines: TruncateCandNStates, TruncateCState, TruncateNState - Die if C or N is very negative < cnegcrit or < nnegcrit (currently set to very large negative numbers -60 and -6) - M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 Set actual_storage_leafcn to missing value if - leafn_storage is zero. actual_leafcn to missing if leafn is < n_min, remove modification of plant_ndemand if FUN off - M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - Reseed if plants are dead and going from Accel. Decomp. to regular mode - M components/clm/src/biogeochem/CNNStateUpdate1Mod.F90 --- Add handling of npool and retransn - M components/clm/src/biogeochem/CNFUNMod.F90 ------------- Add more comments, correct indentation, speed up, and remove - extra garbage, use filters to zero out arrays - add free_Nretrans and fraction of N retranslocation which is automatic/free - M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 Add free_retransn_to_npool_patch, write out to history, write - LEAFN_TO_LITTER to history by default - M components/clm/src/biogeochem/CNDriverMod.F90 ----------- Pass bounds to CNPrecisionControl - M components/clm/src/biogeochem/CNPhenologyMod.F90 -------- grainn_to_food modified to be similar to Carbon version (bug 2327) - for FUN leafn_to_retransn is paid_retransn_to_npool plus free_retransn_to_npool - - M components/clm/bld/unit_testers/build-namelist_test.pl ----------- Add in new tests for new parameters - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - New namelist items: ncrit, ccrit, nnegcrit, cnegcrit, - baseflow_scalar, denitrif_respiration_coefficient/exponent (and nitrconc), lotmp_snowdensity_method, - upplim_destruct_metamorph, overburden_compress_Tfactor, min_wind_snowcompact, remove leaf_acc - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Add CPOOL to history for clm_accelerated_spinup - remove leaf_acc, set: lotmp_snowdensity_method, upplim_destruct_metamorph, overburden_compress_tfactor, new - params file for CLM50, set ncrit, turn use_hydrstress=T for CLM50 - M components/clm/bld/CLMBuildNamelist.pm --------------------------- Add setup_logic_cnprec, call setup_logic_nitrif_params, - setup_logic_hydrology_params, add in cnprecision_inparm namelist - - M components/clm/cime_config/buildnml ------------ Don't need to copy user_nl_clm to Buildconf use CASEROOT version - be sure to set $tuning options for build-namelist - M components/clm/cime_config/config_component.xml Add BARRIER_N/OPTION, ATM_PIO_TYPENAME settings - -=============================================================== -=============================================================== -Tag name: clm4_5_9_r183 -Originator(s): erik (Erik Kluzek) -Date: Sat Jul 2 18:23:09 MDT 2016 -One-line Summary: Decomposition is not water limited after reaching a field capacity parameter (maxpsi_hr) rather - than only at soil saturation - -Purpose of changes ------------------- - -Replaces the hard-coded assumption present in prior versions of the model that soil respiration was -water-limited whenever it fell below saturation. Now it's no longer water-limited from maxpsi_hr up -to saturation. - -This was due to a wrong interpretation/implementation of the following paper. - -Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: a comparison of models. Ecology, 68(5):1190-1200 - -Also see notes in.. - -http://bb.cgd.ucar.edu/cesm12z-clm45-important-bad-interpretation-maximum-rate-constant-soil-water-content - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2324 Bad interpretation of maximum rate constant for soil water content in SoilbiogeochemDecompCascade - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: None - -Changes to CLM's user interface: None - -Changes made to namelist defaults: new params files - -Changes to the datasets: parameter files - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - maxpsi_hr is a scalar constant but read in on the parameter file (should change to namelist) - -Changes to tests or testing: Removed RTM ESMF test - -Code reviewed by: self, ckoven, dlawren - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (70 comparision tests fail, because of the new params files) - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_8_r182 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes, for CLM4_5/CLM5_0 for BGC and CN cases - - Summarize any changes to answers: - - what code configurations: clm4_5 and clm5_0 with BGC or CN - - what platforms/compilers: all - - nature of change: should be similar climate - - Charlie Koven did some work with sensitivity analysis to find a good value for maxpsi_hr - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): rtm - - rtm to rtm1_0_57 -- remove ESMF test - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- new params file with maxpsi_hr on them - - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - Use maxpsi_hr from params file - rather than max soil saturation - M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 -- Use maxpsi_hr from params file - rather than max soil saturation - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r182 -Originator(s): erik (Erik Kluzek) -Date: Fri Jun 24 23:33:36 MDT 2016 -One-line Summary: Bring in option for plant hydraulic stress for clm50 - -Purpose of changes ------------------- - -Add in option for plant hydraulic stress (PHS). Does Leaf stomatal resistance and leaf photosynthesis -simultaneous solution of sunlit/shaded per Pierre Gentine/Daniel Kennedy PHS method. Vegetation -water potential is calculated for four conductance segments: sun, shade, xylem, and root. - -The main impact in the code is in CanopyFluxes where either the PHS or non-PHS version of Photosynthesis is -called and the sun and shade segments are solved simultaneously. Then it impacts soil water movement -for transpiration. - -PHS is turned on by adding use_hydrstress=.true. in your user_nl_clm file for your case. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): 2323 (duplication in Photosynthesis) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: use_dynroots and use_hydrstress can NOT both be on at the same time! - -Changes to CLM's user interface: None - -Changes made to namelist defaults: Add use_hydrstress=.false. - -Changes to the datasets: None - -Substantial timing or memory changes: Maybe 4% slower with PHS, memory only increases by 0.1MB - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers: PhotosynthesisMod is duplicated for PHS and non-PHS - PhotosynthesisMod more than doubles in size from 2k to 4.5k. Most of it - is duplicated. Thus changes to one part of the code, have to be duplicated - in the other part, causing double maintence. Also the effects of 6 namelist - control items are duplicated meaning those items have to be tested in both - branches to ensure they are working correctly. (bug 2323) - -Changes to tests or testing: Add use_hydrstress=T to KitchenSink tests - add clm50dynroots test directory - -Code reviewed by: self,oleson,Daniel Kennedy - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (78 compare tests fail compared to r181 - because of addition of use_hydrstress=.false.) - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - No - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - No - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_8_r181 - - -Answer changes --------------- - -Changes answers relative to baseline: No (only changes answers if use_hydrstress=.true.) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, mosart, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: - -::::::::::: Add specific tests for dynamic roots - A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm - A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods - -List all existing files that have been modified, and describe the changes: - -::::::::::: Add in use_hydrstress namelist item, add in vegetation water columns mainly handled in Photosynthesis and -::::::::::: then impacts soil water transpiration in soil water movement. - M components/clm/src/main/controlMod.F90 ------------ Read in use_hydrstress, check it - M components/clm/src/main/clm_varctl.F90 ------------ Add use_hydrstress - M components/clm/src/main/clm_driver.F90 ------------ Pass canopystate to HydrologyDrainage - M components/clm/src/main/histFileMod.F90 ----------- Add ability to handle nvegwcs dimension - M components/clm/src/main/restFileMod.F90 ----------- Write out nvegwcs dimension if use_hydrstress - M components/clm/src/main/clm_varpar.F90 ------------ Set nvegwcs number of vegetation water conductance segments to 4 - M components/clm/src/biogeophys/PhotosynthesisMod.F90 ------ Add PHS versions of subroutines - M components/clm/src/biogeophys/SoilStateType.F90 ---------- Add djk column soil transpiration sink by layer, add - SMP and HK to restart file. Set SMP to -1000 for cold start. - M components/clm/src/biogeophys/CanopyFluxesMod.F90 -------- Call PHS or regular version of Photosynthesis - don't limit or adjust qflx_trans_veg by btran0 for PHS - M components/clm/src/biogeophys/SoilWaterMovementMod.F90 --- Add Compute_VertTranSink_PHS, pass canopystate, energyfluxstate - down to soilwater zengdecker and moisture_form, for PHS rootr_col is zeroed only for pervious road. - Compute_VertTranSink_PHS apply transpiration as a sink condition that is vertically distributed over the soil column. - M components/clm/src/biogeophys/SoilMoistStressMod.F90 ----- btran only set if NOT PHS - M components/clm/src/biogeophys/EnergyFluxType.F90 --------- Add bsun/bsha canopy transpiration wetness factor for PHS - M components/clm/src/biogeophys/CanopyStateType.F90 -------- Add vegwp_patch for PHS, add to restart and history - (vegetation water matric potential for sun/sha canopy,xyl,root segments) - M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 - Pass in canopystate and pass canopystate, energystate - to SoilWater - -::::::::::: Handle use_hydrstress in namelist - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Define use_hydrstress - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Set default use_hydrstress to .false. - M components/clm/bld/CLMBuildNamelist.pm --------------------------- Add setup_logic_hydrstress, use_hydrstress - and use_dynroots cannot both be on at the same time. - M components/clm/bld/unit_testers/build-namelist_test.pl ----------- Add checks that can't use PHS with ED or dynroot - -::::::::::: Add dynroot tests and turn on use_hydrstress for KitchenSink tests - M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - Add use_hydrstress=T, remove use_dynroots=T - M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm --- Add init_interp_fill_missing_with_natveg=T - so test will pass as SMP is now required. - M components/clm/cime_config/testdefs/testlist_clm.xml - Add 3 clm50dynroots testing, remove ESMF tests - - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r181 -Originator(s): erik (Erik Kluzek) -Date: Fri Jun 17 16:39:22 MDT 2016 -One-line Summary: Update cime version which fixes several issues and changes answers - -Purpose of changes ------------------- - - Update for CIME: This includes several key important changes and bug-fixes - - Now there is a CLMGSWP3 option for DATM_MODE - - When running with datm driver has a barrier each day (so MP_EAGER_LIMIT is no longer needed) - - PIO1 is now the default (PIO2 still exists as an option, but now both exist and you can choose which one) - - Driver now merges CLM's drv_flds_in file with CAM's and aborts on a conflict - - The drv_flds_in namelists are defined in the driver where the source exists - - The drv_flds_in file is recreated just like other namelist files (no longer have to delete earlier one) - - Changes answers because of shr_orb (see below) - - Changes to tools to include Caspian Sea as a CLM Lake on surface datasets - - Add LND_TUNING_MODE as an env_run.xml variable. The default setting is determined by which major physics - version is being used (clm4_0, clm4_5, or clm5_0). We intend to use this in order to tune parameters - for clm5_0 offline with GSWP3 forcing versus clm5_0 with CAM5.5. - - CLM_ACCELERATED_SPINUP="on" now cuts back I/O and is much faster (only outputs a few fields yearly). It - also applies for both with and without CN. If CN is on, it will by default turn Accellerated Decomposition - on. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2308 prebeta clm40 compsets are using the wrong testmods directories - 2307 MOSART assumes no-leap calendar - 2303 user_compset gives different settings than expected for options defined in config_compsets.xml - 2280 Need to set barriers for I compsets with PE layouts where datm runs concurrently to CLM - 2256 Problems with early versions of PIO2 in CLM - 2252 Changing megan_specifier for I cases doesn't actually change the megan_specifier in the resolved namelist - 1674 RTM assumes no-leap calendar - -CIME Issues fixed (include issue #): - #315 Add CLMGSWP3 - #324 Merge drv_flds_in in driver from different components - #56 SSP test treats ref1 case as the main case - -Known bugs introduced in this tag (include bugzilla ID): cime issue #453 (ESMF tests fail) - cime issue #455 (have to delete Macros file if switch to mpi-serial) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: CLM_ACCELERATED_SPINUP mean is different (see below) - -Changes to CLM's user interface: Add LND_TUNING_MODE, CLM_ACCELERATED_SPINUP changed. - - LND_TUNING_MODE added in with defaults for each CLM physics option (clm4_0, clm4_5, and clm5_0) - clm4_0 wasn't tuned for a specific forcing, clm4_5 was tuned for CRUNCEP forcing, clm5_0 is - currently tuned for running with CAM5.5. We eventually expect to have tunings for clm5_0 - for running offline and also with CAM5.5. - - Also CLM_ACCELERATED_SPINUP is now changed and available whether CN is on or not. For a SP - (Satelite Phenology) case this mode reduces output in order to speed up the simulation. - For a CN case it does that as well as turning on spinup_state to an accelerated decomposition - mode. If you don't want CN to be in accelerated decomposition set spinup_state=0 in your user_nl_clm - (for final spinup after AD mode). - -Changes made to namelist defaults: nsegspc is now 35 instead of 20 - -Changes to the datasets: None - -Changes for tools: - Files for surface dataset creation now set Caspian sea as a Lake - new maps for mksurfdata with Caspian Sea - -Substantial timing or memory changes: The change in nsegspc should improve performance slightly - Running with CLM_ACCELERATED_SPINUP="on" will make a good 20% improvement in performance - from less history output and turning megan off - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - OK (All PASS, but 121 tests are different that r180, because nsegspc changes, new namelists, and spinup_state) - - unit-tests (components/clm/src): - - yellowstone - PASS - - tools-tests (components/clm/test/tools): - - yellowstone - OK (Some mksurfdata compare tests fail because of Caspian as lake) - PTCLM compare tests for clm4_5 fail because of new mapping files being used) - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK (all but one PASS and 44 compare tests are different as expected) - U-UMB ------- Testing this resolution works - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_8_r180 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: all including clm4_0 and clm4_5/clm5_0 - - what platforms/compilers: all - - nature of change: same climate - - The cime update includes a change to shr_orb that changes answers - for all simulations. There is also a change in vertical_gradient - calculations for glacier model that changes answers when CISM - is active (IG compsets). - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): cime, rtm, mosart - - cime to clm4_5_8_r180_cime4.5.14 (This includes option for DATM=CLMGSWP3) - rtm to rtm1_0_56 - mosart to mosart1_0_16 - -List all files eliminated: Remove NCL script to compare files (can now use -m option to FORTRAN cprnc program) - - D components/clm/tools/shared/ncl_scripts/cprnc.pl --- use FORTRAN cprnc - D components/clm/tools/shared/ncl_scripts/cprnc.ncl -- use FORTRAN cprnc - D components/clm/bld/namelist_files/namelist_definition_drv_flds.xml --- Now in driver - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -::::::::::::::::::: Replace setting of CPRNC_EXE with CPRNC_OPT="-m" - M components/clm/test/tools/CLM_compare.sh ----- Add use of CPRNC_OPT - M components/clm/test/tools/test_driver.sh ----- Export CPRNC_EXE and set default CPRNC_OPT to blank - M components/clm/test/tools/TBLCFGtools.sh ----- Replace CRPNC_EXE with CPRNC_OPT="-m" - M components/clm/test/tools/TOPtools.sh -------- Replace CRPNC_EXE with CPRNC_OPT="-m" - M components/clm/test/tools/TBLscript_tools.sh - Replace CRPNC_EXE with CPRNC_OPT="-m" - M components/clm/test/tools/TBLtools.sh -------- Replace CRPNC_EXE with CPRNC_OPT="-m" - M components/clm/test/tools/TSMscript_tools.sh - Use $CSMDATA/lnd/clm2/PTCLMmydatafiles.c160208 directory - rather than older directory - M components/clm/test/tools/nl_files/PTCLM_USUMB_clm4_5 -------- Update map date to 160208 - M components/clm/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 -- Update map date to 160208 - M components/clm/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 - Update map date to 160208 - - M components/clm/tools/shared/ncl_scripts/README - Remove mention of cprnc.pl/cprnc.ncl - - M components/clm/tools/shared/mkmapdata/mkmapdata.sh -------- Create map for 3x3min_MODIS-wCsp instead of 3x3min_MODIS - M components/clm/tools/clm4_5/mksurfdata_map/Makefile.data -- By default also create f45 1850 and transient datasets - - M components/clm/bld/unit_testers/build-namelist_test.pl --------------- Add a ton more testing - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ------- Add lnd_tuning_mod, clm_accelerated_spinup, - megan, atm_c14_filename use_c14. Set spinup_state by clm_accelerated_spinup, set hist settings by - clm_accelerated_spinup cutting back history output drastically. Set pot_hmn_ign_counts_alpha by - lnd_tuning_mode. Set nsegspc=35. Change maps from 3x3min_MODIS to 3x3min_MODIS_wCsp to add Caspian Sea to - lake mask - M components/clm/bld/namelist_files/namelist_definition_clm4_0.xml ----- Add lnd_tuning_mod, clm_accelerated_spinup, megan. - M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Add SCRIP grid file for 0.125x0.125 resolution. - add SCRIP grid for 3x3min_MODIS-wCsp, lake mask is now MODIS-wCsp, update mksrf_flakwat to include Caspian Sea - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml ----- Add some commented out namelist variables that - will be added later. Correct or clarify some definitions. Add lnd_tuning_mode, clm_accelerated_spinup and megan. - Remove MEGAN, drydep, and fire-emission namelist items as in drv namelist_definition now. - M components/clm/bld/namelist_files/namelist_defaults_clm4_0.xml ------- Set lnd_tuning_mod, clm_accelerated_spinup, and megan. - Also use history options to cut back history output drastically for clm_accelerated_spinup="on". - M components/clm/bld/CLMBuildNamelist.pm ----- Add clm_accelerated_spinup, lnd_tuning_mode, remove bgc_spinup. Read - in driver namelist-definition for drv_flds_in. Add nitrif_inparm, and soilhydrology_inparm although empty. Always - write out (and overwrite) the drv_flds_in namelist even if empty. Driver now reads clm's version and merges it with - CAM's version and terminates on a contradiction. - - M components/clm/cime_config/testdefs/testlist_clm.xml - Work on test lists. - M components/clm/cime_config/user_nl_clm --------------- Remove note about drv_flds_in file only be written out if certain - build-namelist options are on as no longer true. - M components/clm/cime_config/buildnml ------------------ Turn megan off if NOT datm. Send LND_TUNING_MODE to build-namelist. - Remove setting of bgc_spinup based on CLM_ACCELERATED_SPINUP (build-namelist itself figures this out). Leave drv_flds_in - in clmconf directory and let the driver merge it's contents with CAM and create a version in RUNDIR. Copy - CASEROOT/Buildconf/clmconf/user_nl_clm${inst_string} to clmconf (doesn't really need to be done). - M components/clm/cime_config/config_component.xml ------ Add LND_TUNING_MODE (clm4_0_default,clm5_0_cam5.5,clm5_0_GSW3P,clm4_5_CRUNCEP) - Right now default for CLM5.0 is clm5_0_cam5.5 for all cases. For clm4_0 or clm4_5 the one given default is used. - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r180 -Originator(s): sacks (Bill Sacks) -Date: Mon Jun 6 06:13:57 MDT 2016 -One-line Summary: Refactor dyn_cnbal_patch - -Purpose of changes ------------------- - -There was a lot of duplicated code, as well as almost-but-not-quite-duplicated -code in dyn_cnbal_patch (the code used for updating patch-level BGC variables -when patch weights change). This tag consolidates this duplicated code into some -new shared infrastructure, similar to what is done for column-level variables. - -In addition, do not zero states when patch weights go to zero. (I expected this -to change answers for 1-d history files, but it didn't.) - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2317: incorrect handling of isotopes with transient PFTs starting in clm4_5_1_r097 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: small timing increase: about 10% increase -in dyn_cnbal_patch, amounting to a 0.3% increase in total CLM runtime (for both -transient and non-transient runs). - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - -NOTE: testing done on -refactor_seed_calculation_n01_maintain_state_zero_weight_n01_dynlu_conserve_cn3_n03_clm4_5_8_r179; -very minor changes since then tested with -SMS_Ld5_D_P24x1.f10_f10.IRCP45CLM45BGC.hobart_nag.clm-decStart - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass, expected baseline failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_8_r179 - CLM40 compared with clm4_5_8_r178 (baselines missing for r179) - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 / CLM50 transient and CNDV runs - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Roundoff-level changes - - Greater than roundoff-level for transient runs with isotopes, due to fixing - bug 2317 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Created a branch (dynlu_conserve_cn3_oneoff) that was as similar as possible - to the trunk, with just those changes needed to get bit-for-bit behavior with - my new code (e.g., reordering some calculations). Confirmed that my new code - is bit-for-bit with that. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= New, shared infrastructure for updating patch-level variables -A components/clm/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 -A components/clm/src/dyn_subgrid/test/dynPatchStateUpdater_test/CMakeLists.txt -A components/clm/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf -A components/clm/src/dyn_subgrid/test/dynPatchStateUpdater_test - -========= Extract code common to carbon and nitrogen, for computing seed amounts -A components/clm/src/biogeochem/CNVegComputeSeedMod.F90 -A components/clm/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt -A components/clm/src/biogeochem/test/CNVegComputeSeed_test/test_ComputeSeedAmounts.pf -A components/clm/src/biogeochem/test/CNVegComputeSeed_test - -========= Define constants for identifying whether we're operating on c12, c13, - c14 or n (used in CNVegComputeSeedMod) -A components/clm/src/biogeochem/CNSpeciesMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Remove a bunch of code - moved to new infrastructure -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 - -========= Make calls to new patch state updater for each necessary variable -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 - -========= Set up patch state updater -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Other minor changes needed to use the new infrastructure -M components/clm/src/biogeochem/CNVegetationFacade.F90 - -========= Add some unit tests, and some related unit testing infrastructure -M components/clm/src/biogeochem/test/CMakeLists.txt -M components/clm/src/main/pftconMod.F90 -M components/clm/src/biogeochem/CMakeLists.txt -M components/clm/src/dyn_subgrid/CMakeLists.txt -M components/clm/src/dyn_subgrid/test/CMakeLists.txt -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 - -========= Remove a bit of unused code -M components/clm/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 - -========= Remove a test that has been passing for a while, and one that no longer exists -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r179 -Originator(s): sacks (Bill Sacks) -Date: Fri May 27 10:39:15 MDT 2016 -One-line Summary: Update column-level BGC state variables with dynamic landunits - -Purpose of changes ------------------- - -Update column-level BGC state variables as column areas change due to dynamic -landunits. This does NOT yet update column-level biogeophysical variables, NOR -does it handle patch-level variables appropriately. - -Note that some variables that used to only exist on vegetated landunits (soil & -crop landunits) now exist on all landunits. When columns in special landunits -expand, they take on the carbon, nitrogen and methane state variables from the -columns they expanded into. These C / N / CH4 quantities essentially get trapped -underneath the glacier (or lake / urban / whatever), staying fixed until that -column eventually shrinks. If that special column shrinks and is replaced by a -vegetated column, then the vegetated column takes on the state that had been -trapped under the glacier (or whatever). In this way, we avoid destroying or -creating mass when special landunits grow and shrink. This change explains why -summary variables that used to be computed for just soil & crop columns are now -computed for all columns. - -Note: In some testing (particularly in the 6-year Smallville test case), I found -that there was a huge decrease (order of magnitude or more) in methane -concentrations in the unsaturated portion of the growing column after column -area adjustments. As far as I can tell, the state variable is being updated -correctly due to the changing column areas, but then within the timestep evolves -rapidly to a different value. From talking with Dave Lawrence, we assume this is -due to the adjustment of carbon content in the column, since the carbon state -can have a big effect on methane fluxes. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): -- 2283: dynamic landunits: handle methane with changing lake area [enhancement] - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - When using use_init_interp in cases with CISM (IG/JG/FG/BG) compsets, there - is a large adjustment in Greenland glacier area in the first timestep of the - run, even if glacier evolution is off. (This is because, in initialization, - glacier area comes from CLM's surface dataset; then glacier area is updated - to match CISM in the first timestep, even if glacier evolution is off.) This - results in big adjustments in column-level carbon, nitrogen and methane - content in the first timestep, because it looks to CLM like some glacier - columns have grown significantly (trapping C / N / CH4), while others have - shrunk significantly, causing a significant decrease in area-average C / N / - CH4 in the growing vegetated columns. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests all pass or xfail; expected baseline comparison failures as - noted below - -CLM tag used for the baseline comparisons: clm4_5_8_r178 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with CN/BGC, either with CISM (IG) - or transient crops (historical / RCP compsets with CROP) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; potentially new climate - - The evolution of C / N / CH4 state variables is now completely different with - transient glacier or crop areas, causing significant answer changes. - - These transient crop tests change answers: - ERS_Ly5_P60x1.f10_f10.IHISTCLM45BGCCROP.yellowstone_intel.clm-cropMonthOutput - SMS_D_Ly6.1x1_smallvilleIA.IHISTCLM45BGCCROP.yellowstone_pgi.clm-cropMonthOutput - - For glacier, typically changes will only be seen if ice evolution is turned - on, but changes will be seen even with ice evolution off - or ice evolution on - in a test too short to actually see any ice evolution - if use_init_interp - is used, as noted in the "caveats" section above. This affects these tests: - ERS_D_Ld3.f09_g16_gl5.IG1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KitchenSink - SMS_Lm1.f09_g16_gl5.IG1850CRUCLM50BGC.yellowstone_intel.clm-clm50KitchenSink - - In addition, there are FILLDIFFs in a few methane variables. The new code - seems correct, in that the fill pattern (over special landunits) is the same - for all vertical levels: the old code had different fill patterns in lower - soil layers. This affects these variables: CONC_O2_SAT, CONC_O2_UNSAT, - CONC_CH4_SAT, CONC_CH4_UNSAT, LAYER_SAT_LAG. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): - cism2_1_10 -> cism2_1_17: Update to latest CISM trunk tag (main purpose is to - bring in new capabilities for overriding glacier areas for testing purposes) - -List all files eliminated: none - -List all files added and what they do: - -========= Add a test that has both increases and decreases in glacier together - with BGC -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_cism -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_inc_dec_bgc - -List all existing files that have been modified, and describe the changes: - -========= Add capabilities to the column state updater: fractional areas (needed - for methane) and keeping track of the adjustments made to each variable -M components/clm/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 -M components/clm/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf - -========= Update BGC column-level state variables when column areas change -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/main/clm_driver.F90 - -========= Update ch4 column-level state variables when column areas change. Also - did a bunch of refactoring that was either needed or nice to have to - support these changes, especially related to (1) determining whether - it's the first timestep where ch4 is included; (2) how variables that - keep track of states in the previous timestep are set (this needed to - be reworked to simplify what we need to adjust in the column - conservation); (3) initializing conserved state variables to 0 (rather - than spval) over special landunits (this required putting in place - backwards compatibility with old restart files in subroutine Restart); - (4) where start-of-timestep balance check initialization is done -M components/clm/src/biogeochem/ch4Mod.F90 - -========= Add new routine to support restart file backwards compatibility: - set_missing_vals_to_constant -M components/clm/src/utils/restUtilMod.F90.in - -========= Add a new history averaging option: SUM. Also refactored some handling - of avgflag to remove duplication, and allowed l2g_scale_type in more - contexts -M components/clm/src/main/histFileMod.F90 - - -========= Add a new l2g_scale_type: veg_plus_lake (needed for some methane - variables) -M components/clm/src/main/subgridAveMod.F90 - -========= Add a new fiter: allc - all (active) columns -M components/clm/src/main/filterMod.F90 - -========= Add col_filter_from_lunflags, change col_filter_from_ltype to - col_filter_from_ltypes (allowing multiple landunit types) -M components/clm/src/main/filterColMod.F90 -M components/clm/src/main/test/filter_test/test_filter_col.pf -M components/clm/src/main/test/topo_test/test_topo.pf - -========= Updates for modified interface in new CISM -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism - -========= Add a test that has both increases and decreases in glacier together - with BGC; remove a long test for which we have sufficient coverage - with a similar, shorter test -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r178 -Originator(s): sacks (Bill Sacks) -Date: Sun Apr 17 19:28:55 MDT 2016 -One-line Summary: Remove some consistency checks, and merge crop_prog with use_crop in code - -Purpose of changes ------------------- - -(1) Remove some consistency checks that were doing more harm than good: - - (a) Make init_interp_fill_missing_with_natveg unnecessary for natural veg - and crop output points. This is mainly to support the common use case of - interpolating from non-crop to crop, without requiring the user to set - this flag. - - (b) Remove check_finidat_fsurdat_consistency - now never do this check. This - consistency check was causing more problems than it solved, both for - users and developers (e.g., requiring us to change initial conditions - files whenever we made new versions of the surface dataset). - -(2) Remove crop_prog logical variable from the code. This was identical to - use_crop, and so it was confusing to have these two separate variables. Uses - of crop_prog have been replaced by uses of use_crop. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- No longer need to set init_interp_fill_missing_with_natveg when interpolating -from non-crop to crop - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - pass (ran bld/unit_testers tests) - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_8_r177 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Make init_interp_fill_missing_with_natveg unnecessary for natural veg - and crop output points -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Make init_interp_fill_missing_with_natveg unnecessary for natural veg - and crop output points -M components/clm/src/init_interp/initInterpMindist.F90 -M components/clm/src/init_interp/test/initInterpMindist_test/test_init_interp_mindist.pf -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Remove check_finidat_fsurdat_consistency - now never do this check -M components/clm/src/main/restFileMod.F90 -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -========= Remove crop_prog - use use_crop in its place -M components/clm/src/ED/main/EDCLMLinkMod.F90 -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/biogeophys/TemperatureType.F90 -M components/clm/src/biogeophys/WaterStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M components/clm/src/unit_test_stubs/main/histFileMod_stub.F90 -M components/clm/src/biogeochem/CNFUNMod.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/CNPrecisionControlMod.F90 -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CropType.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/biogeochem/CNNStateUpdate1Mod.F90 -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 -M components/clm/src/biogeochem/CNVegStateType.F90 -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/initGridCellsMod.F90 -M components/clm/src/main/histFileMod.F90 -M components/clm/src/main/clm_varpar.F90 -M components/clm/src/main/pftconMod.F90 -M components/clm/src/main/surfrdMod.F90 -M components/clm/src/main/clm_instMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r177 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 14 14:00:25 MDT 2016 -One-line Summary: Move CN product pools to gridcell level - -Purpose of changes ------------------- - -Move CN product pools from column-level to gridcell-level. This is needed for C -& N conservation with dynamic landunits, because there was no obvious way to -handle column-level product pools. - -This also required moving some of the related fluxes to the gridcell-level. - -Also added capability for init_interp to handle gridcell-level fields. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- If you run an old restart file through init_interp, product pools will be - zeroed out. This is an issue for restart files that come from a transient run - or from a clm5 crop run. Solution: run your old file through the new code for - at least one time step without init_interp, then you can init_interp that - file. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- clmi.I2000CLM45CRUBGC.2000-01-01.0.9x1.25_gx1v6_simyr2000_c160127.nc replaced - by clmi.I2000CLM45CRUBGC.2000-01-01.0.9x1.25_gx1v6_simyr2000_c160413.nc. This - is basically the same, but run for one extra time step using compset ICLM45BGC - with this branch. - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass or xfail, some baseline comparisons fail, as noted below - -CLM tag used for the baseline comparisons: clm4_5_8_r176 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all CLM45/CLM5 with CN/BGC - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - All CLM45/CLM5 CN/BGC cases have roundoff-level changes in product pools and - related fluxes. In addition: - - (1) Bigger answer changes for CN/BGC cases using the f09 year-2000 initial - conditions file: this file has been run through the new code for one - additional time step. Differences were larger than I expected for this - seemingly-minor change; I did not spend time tracking down the cause for - those differences. - - (2) Cases doing interpolation (init_interp) from some other out-of-the-box - initial conditions files have normalized RMS differences greater than - roundoff. This is because some other initial conditions files (including - some 1850 files) have non-zero product pools, which are zeroed out by - init_interp: see the caveat for users above. However, in an absolute sense, - RMS differences are small, because the product pools on these files are very - small. - - (3) Greater than roundoff-level changes in product pools and related fluxes - in transient crop cases. This shows up in the test - ERS_Ly5_P60x1.f10_f10.IHISTCLM45BGCCROP.yellowstone_intel.clm-cropMonthOutput. This - is expected: in the old code, the product pools grew or shrank as the - columns they were on grew or shrank. This was essentially the motivation for - this tag. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Based on RMS errors in baseline comparisons - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Move product pools from column to gridcell-level, as described above -M components/clm/src/biogeochem/CNProductsMod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/lnd2atmMod.F90 - -========= Allow suffix on restart field name -M components/clm/src/biogeochem/SpeciesBaseType.F90 -M components/clm/src/biogeochem/SpeciesIsotopeType.F90 -M components/clm/src/biogeochem/SpeciesNonIsotopeType.F90 -M components/clm/src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf -M components/clm/src/biogeochem/test/Species_test/test_SpeciesIsotope.pf - -========= Add a routine to assist with backwards compatibility: - set_grc_field_from_col_field: Set a gridcell-level field from a - column-level field on the restart file -M components/clm/src/utils/restUtilMod.F90.in - -========= Add capability for init_interp to handle gridcell-level fields. This - is needed for the new gridcell-level product pools. -M components/clm/src/init_interp/test/initInterpMindist_test/test_init_interp_mindist.pf -M components/clm/src/init_interp/initInterp.F90 -M components/clm/src/init_interp/initInterpMindist.F90 -M components/clm/src/init_interp/initInterpBounds.F90 - -========= Point to new year-2000 initial conditions file. This is basically the - same as the old one, but has been run for one timestep using the new - code, in order to have gridcell-level product pools. This is needed - for LII testing. -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Replace a year-1850 LII test with a year-2000 LII test to exercise the - gridcell-level init_interp code (need non-zero product pools to test - that code fully) -M components/clm/cime_config/testdefs/testlist_clm.xml - - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r176 -Originator(s): sacks (Bill Sacks) -Date: Wed Apr 13 09:32:56 MDT 2016 -One-line Summary: Calculate active flags and filters earlier in initialization - -Purpose of changes ------------------- - -Main purpose is to compute the active flags and filters (via reweight_wrapup) -earlier in initialization. These are now computed initially before the restart -file is read, and tehn updated as soon as possible in the midst of the restart -file read. This is useful in case any of the clm_instMod restart routines want -to use the active flags or filters, directly or indirectly (e.g., via a call to -subgridAveMod) - e.g., for the sake of backwards compatibility. This is -something that's needed in an upcoming tag. - -Also: change some CN product history fields, so that they are more consistent - -so totals just give totals for wood: - -- Renamed TOTPROD to TOT_WOODPROD - -- Removed PRODUCT_CLOSS and similar fields, added TOT_WOODPRODC_LOSS and similar - fields: now just include losses from wood product pools - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- renamed CN product history fields: see above - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass or xfail, plus expected failures in CLM5 ERP tests with - threading, just in the NPP_BURNEDOFF field, due to bug 2292 (leading to - differences both in the baseline comparison and in the comparison of the - restart to the baseline) - -CLM tag used for the baseline comparisons: clm4_5_8_r175 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Compute active flags and filters earlier in initialization -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/restFileMod.F90 - -========= Change CN product history fields (see above for details) -M components/clm/src/biogeochem/CNProductsMod.F90 - -========= Unrelated change: fix argument intent -M components/clm/src/biogeochem/CNPhenologyMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r175 -Originator(s): sacks (Bill Sacks) -Date: Sat Apr 9 15:48:47 MDT 2016 -One-line Summary: For glc_mec, change downscaling and where SMB is computed - -Purpose of changes ------------------- - -Two main purposes: - -(1) Change some aspects of the downscaling of atmospheric fields that is done - when running with glc_mec. These change answers for glc_mec cases (i.e., - cases with CISM): - - (a) Change the downscaling equations for forc_th (potential temperature) and - forc_rho (atmospheric density): Previously, these gave different answers - from the gridcell value even if the column's topographic height exactly - matched the atmosphere's topographic height. The new equations are based on - deltas, ensuring that the downscaled values match the atmospheric forcings - if topographic heights match. - - Now all downscaled fields should match the atmosphere forcings if the - topographic heights match, *except* rain and snow (potentially large - differences, by design), and longwave radiation (roundoff-level differences - can be introduced by the normalization). - - (b) Perform downscaling over all column types inside the - icemask. Previously, downscaling was done only for istice_mec and istsoil - columns (because those were the only ones that computed SMB). I realized - that this could result in some undesirable inconsistencies between the - different columns in a gridcell, which could be especially problematic if a - glacier advanced over (e.g.) a lake column. In practice, this seems to - affect a few lake points inside Greenland. - - (c) Do *not* perform downscaling over glacier columns with the - single_at_atm_topo behavior. This is for consistency with other column types - whose topographic height (implicitly) matches the atmosphere's. In practice, - this shouldn't effect the simulation much, if at all (due to the change in - (a)). - - (d) Extracted a function to compute forc_rho, and pulled out some magic - numbers from this calculation - -(2) When running with glc_mec, compute SMB for all vegetated columns in the - 'virtual' glacier region, rather than just in the icemask. This affects the - CLM fields sent to the coupler for elevation class 0, but otherwise has no - direct effect on CLM evolution. - - This is important if you want coupler forcings that can drive a later TG - run: Typically you will want these forcings in the same place where you - wanted virtual columns (for the same reason: so that forcings are available - in every elevation class, including elevation class 0). - -In order to accomplish these changes, I have separated the logic for where to -compute SMB from the logic for where to do downscaling. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: Bill Lipscomb reviewed the new equations for forc_th and -forc_rho. Other changes have not been reviewed. - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass or xfail, except for expected baseline comparison - failures, as noted below. - - Also: There were failures in CLM5 ERP tests with threading, just in the - NPP_BURNEDOFF field, due to bug 2292, which was introduced in the previous - tag. I confirmed that the same tests failed in a fresh checkout of r174. - -CLM tag used for the baseline comparisons: clm4_5_8_r174 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, for CLM45/CLM5 with CISM (IG compsets) - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM5 with CISM (IG compsets) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated closely, but expected to be larger than roundoff/same - climate - - Differences are due to: - - (1) New downscaling equations for forc_th and forc_rho. I have confirmed - that these differences are relatively small in one test run (one-day - average differences < 0.31 deg for forc_th and < 1e-10 for forc_rho). - - (2) Downscaling now done over all column types within the icemask - (including lakes) - - (3) Small change in constants used in calculation of forc_rho downscaling, - to be consistent with shr_const_mod - - (4) Now compute SMB for all vegetated columns in the 'virtual' glacier - region, rather than just columns in the icemask. This affects fields sent - from CLM to the coupler in elevation class 0. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Changed to a .in file processed by genf90 -D components/clm/src/unit_test_shr/unittestArrayMod.F90 - -List all files added and what they do: - -========= New module to handle coordination of updating topographic heights, as - well as determining which columns need downscaling -A components/clm/src/main/TopoMod.F90 - -========= New unit tests -A components/clm/src/main/test/atm2lnd_test/test_downscale_forcings.pf -A components/clm/src/main/test/topo_test/test_topo.pf -A components/clm/src/main/test/topo_test/CMakeLists.txt -A components/clm/src/main/test/topo_test - -========= Changed to a .in file processed by genf90 -A components/clm/src/unit_test_shr/unittestArrayMod.F90.in - -========= Routines that assist unit tests working with glc_mec landunits -A components/clm/src/unit_test_shr/unittestGlcMec.F90 - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above. Some of these changes have to do - with the creation of TopoMod: topo_type, and the move of glc_topo into - there - now called topo_col -M components/clm/src/main/restFileMod.F90 -M components/clm/src/main/clm_varcon.F90 -M components/clm/src/main/filterMod.F90 -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/main/subgridRestMod.F90 -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/reweightMod.F90 -M components/clm/src/main/glc2lndMod.F90 -M components/clm/src/main/lnd2glcMod.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= New routines for creating filters - some for production code, some for - unit tests -M components/clm/src/main/filterColMod.F90 - -========= Add some unit tests and some unit test helper functionality -M components/clm/src/main/CMakeLists.txt -M components/clm/src/main/test/filter_test/test_filter_col.pf -M components/clm/src/main/test/glcBehavior_test/test_glcBehavior.pf -M components/clm/src/main/test/CMakeLists.txt -M components/clm/src/main/test/atm2lnd_test/CMakeLists.txt -M components/clm/src/unit_test_shr/unittestFilterBuilderMod.F90 -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 -M components/clm/src/unit_test_shr/unittestSubgridMod.F90 -M components/clm/src/unit_test_shr/CMakeLists.txt -M components/clm/src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf - -========= Add a bit of documentation -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r174 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 25 01:57:24 MDT 2016 -One-line Summary: Bring Rosie's respiration and FUN changes to the trunk - -Purpose of changes ------------------- - -Changes to respiration from Rosie Fisher. Leaf respiration option (CLM50 default is Atkin 2015) -as well as option for light inhibition. Also reworking of FUN so it calculates both fixers -and non fixers and then figures out the impact of both based on a fixed percentage of plants -that fix by PFT. Add burned-off carbon to FUN (Carbon that can not be used for N uptake). -Add new term to directly account for Ben Houlton's temperature response function. - -New defaults for CLM5.0. Add some new history fields including -LEAFCN and LEAFCN_STORAGE CN ratios. - -Default for snow depth is now lowered to 10m from 20m. If you startup from an initial condition -file with 20m of snow, a big flow of ice-runoff will flow out of the system (takes a few days -to clear it all out). In general you should NOT allow this for fully coupled simulations with -an active ocean model. For other simulations, you should be aware of this sudden ice runoff that -will happen. - -Remove some unused unworking or unrefined options for flexible-CN. - -Check for small C or N values in CNPrecisionControl after -each StateUpdate section rather than just after summary. -This is turned on for CLM50 with use_nguardrail (will turn this -on for CLM45 as well, and remove later). - -Improve some of the documentation of namelist items. Also work on some of the dependencies: -use_flexiblcCN requires CN, carbon_resp_opt=1 only if CN on and FUN off. -use_luna on only if CN and nitrif_denitrif on. -lnc_opt depends on if CN on or off. -FUN on depends on both CN and nitrig_dentrif - -FUN is very expensive in this version and causes model to be significantly slower. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - - 2302 Some missing nh4 arrays set to zero. - 2298 Init method NOT called for NutrientCompetetionFlexibleCN - 2296 Missing meta-data for new data added to params file - 2273 Log output without a "if masterproc " around it... - 2268 Irrigation unit tests broken because of irrigation limiter - 2253 Nitrogen Deposition accidentally turned off when FUN on - 2249 Low LAI over Amazon - -Known bugs introduced in this tag (include bugzilla ID): - - 2295 ch4 conservation error in ne30 1850 case - 2269 log(0) possibility - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: - This changes the default for snow capping from 20m to 10m. If you use an initial condition - file with 20m of snow it will cut the snow depth to 10m, and send 10m of snow as ice runoff. - This sudden influx of ice runoff could be problematic for fully coupled simulations to an - ocean model. - -Changes to CLM's user interface: - New namelist items: leafresp_method, light_inhibit, leaf_acc, rootstem_acc, use_nguardrail - Remove namelist : carbon_excess_opt, carbon_storage_excess_opt, dynamic_plant_alloc_opt - Remove vcmax_opt options 1 and 2 - - new namelist group: photosyns_inparm - - carbon_resp_opt should be 0 when use_fun=.true. - - New history fields: Vcmx25Z, Jcmx25Z, LEAFCN, LEAFCN_STORAGE - COST_NFIX, COST_NACTIVE, COST_NRETRANS, NUPTAKE_NPP_FRACTION - - add IGM1850CRUCLM50BGCCROP and IGM1850CRUCLM50BGC compsets - -Changes made to namelist defaults: - - New defaults: CLM50: leaf_acc, light_inhibit, use_bedrock, use_nguardrail all on - leaf_resp=2 - h2osno_max=10m - use_flexibleCN (if CN on) - carbon_resp_opt=1 (only if use_cn ON and FUN off) - use_luna (only if use_cn and use_nitrif_denitrif on) - lnc_opt depends on CN - FUN on depends on CN and nitrif_denitrif - Change leaf_mr_vcm phys default value - -Changes to the datasets: - New params file for clm5_0 with metadata on new fields. Remove some uneeded - parameters. - -Substantial timing or memory changes: Approximately 20% slower with FUN on - - -Code reviews and testing ------------------------- - -Code reviewed by: self,rfisher - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - PASS - -CLM tag used for the baseline comparisons: clm4_5_8_r173 - - -Answer changes Yes! for CLM50, clm45 and clm40 bit-for-bit --------------- - -Changes answers relative to baseline: - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 - - what platforms/compilers: All - - nature of change: new climate - - - casename: /home/oleson/respn14r172_1850spin - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: - A components/clm/doc/clm3_0_ChangeLog -- split out CLM3.0 section - A components/clm/doc/clm4_0_ChangeLog -- split out CLM4.0 section - -List all existing files that have been modified, and describe the changes: -M components/clm/cime_config/config_component.xml - formatting change, removing extra spaces -M components/clm/cime_config/config_compsets.xml - add IGM1850CRUCLM50BGCCROP and IGM1850CRUCLM50BGC compsets -M components/clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 - Changes from Ben Andre to fix irrigation unit test issue bug 2268 -M components/clm/src/biogeophys/test/Irrigation_test/test_irrigation_singlepatch.pf - Add new test irrigation_for_limiting_volr -M components/clm/src/biogeophys/SoilWaterMovementMod.F90 - Remove warning for h2osoi_liq negative. Limit dLow, diag, dUpp, and rhs - arrays by nlayers. -M components/clm/src/biogeophys/IrrigationMod.F90 - Make sure a constant is double (_r8) -M components/clm/src/biogeophys/UrbanParamsType.F90 - Add if_masterproc -MM components/clm/src/biogeophys/SnowHydrologyMod.F90 - Add min_snow_to_keep, fix bug 2270 -M components/clm/src/biogeophys/LunaMod.F90 - Work on warnings and error conditions. -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - Make Vcmx25Z, Jcmx25Z default inactive on history. Add ReadNML method - add leafresp_method, light_inhibit, leaf_acc, rootstem_acc to namelist. - Remove vcmax_opt=1/2 change to if,else if, else. -M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - Add if_masterproc -M components/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 - Add timer around FUN. Add some new terms when FUN on. Use local version - of use_fun (so optimizer can know it won't change). Write to iulog rather - than *. -M components/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 - Comment out warning -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 - Remove unneeded use_fun dependence -M components/clm/src/biogeochem/CNGapMortalityMod.F90 - Remove: carbon_excess_opt, carbon_storage_excess_opt -M components/clm/src/biogeochem/CNGRespMod.F90 - Remove: carbon_excess_opt and carbon_storage_excess_opt calcs -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 - Lower carbon balance warning from e-10 to e-9, use iulog rather than * -M components/clm/src/biogeochem/CNMRespMod.F90 - Add rootstem_acc option which Rosie says "will increase R and decrease - productivity in boreal forests, A LOT. :)" -M components/clm/src/biogeochem/CNFUNMod.F90 - Extensive changes from Rosie. Some formatting changes. Add burnedoff_carbon. - and timer around main FUN calculations. Fix bug 2302 (missing setting of some nh4 - arrays to zero). Base if fixer on c3psn. Add bit about unmet_demand. Loop - over both fixers and non-fixers, params file has percentage of each for each PFT type. - Set some things to spval for night. Add new term to directly account for Ben - Houlton's temperature response function -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 - Add if masterproc around writes -M components/clm/src/biogeochem/NutrientCompetitionFactoryMod.F90 - Pass in bounds and add call to init method -M components/clm/src/biogeochem/CNPrecisionControlMod.F90 - Make ccrit and ncrit parameters and add n_min (for calculation of CN ratio) -M components/clm/src/biogeochem/NutrientCompetitionMethodMod.F90 - Add init method to abstract class and add readParams as completed method -M components/clm/src/biogeochem/CNPhenologyMod.F90 - Add some use_fun changes, add logical for additional_onset_condition -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 - Remove cpool imbalance warning -M components/clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 - Add init method, move readParams to base class. Check if aleaf is nan - in calc_plant_nutrient_competition. Set frootn/livestemn "to_retransn" to zero for fun -M components/clm/src/biogeochem/CNNDynamicsMod.F90 - Remove setting of ndep_to_sminn(c) to zero for FUN, do set nfix_to_sminn to zero -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 - Add new history fields: COST_NFIX, COST_NACTIVE, COST_NRETRANS, NUPTAKE_NPP_FRACTION - all default on. -M components/clm/src/biogeochem/CNDriverMod.F90 - Add some more timers. Call CNPrecisionControl after each set of updates - (if use_nguardrail is on). Move CNPhenology/CNFUNInit call to before - nutrient_demand, so that croplive didn't change half way through crop N cycle -M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 - Add actual_storage_leafcn and actual_leafcn CN ratios and output to history - and always calculate them. Remove readParams, and add init method. Remove - unused dynamic_plant_alloc. Remove "if(use_fun)" and just rely on carbon_resp_opt - to be 0 when FUN on. Use n_min as parameter for minimun N used for CN ratio. -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 - Add NPP_BURNEDOFF to history file, change ordering -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - Add if(masterproc) around write statements -M components/clm/src/main/clm_varpar.F90 - Add if_masterproc -MM components/clm/src/main/clm_initializeMod.F90 - Pass bounds_proc to create_nutrient_competition_method -M components/clm/src/main/findHistFields.pl - Get working again with all F90 files. -MM components/clm/src/main/controlMod.F90 - Remove carbon_excess_opt, carbon_storage_excess_opt, dynamic_plant_alloc_opt - namelist variables. Add use_nguardrail (to preserve answers for clm45 will - remove later). -M components/clm/src/main/clm_driver.F90 - Add some timers. -M components/clm/src/main/clm_varctl.F90 - Remove carbon_excess_opt, carbon_storage_excess_opt, dynamic_plant_alloc_opt - Add use_nguardrail. -M components/clm/src/main/pftconMod.F90 - Add some more FUN parameters and remove some uneeded ones. -M components/clm/src/main/clm_instMod.F90 - Add call to photsyns ReadNML -M components/clm/src/main/ncdio_pio.F90.in - Add some if_masterproc -M components/clm/bld/unit_testers/build-namelist_test.pl - Add some new tests for new variables -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add rootstem_acc, leaf_acc, light_inhibit, leafresp_method - use_nguardrail. Improve documentation for some flex-CN options -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - New defaults: CLM50: leaf_acc=T, light_inhibit=T,leaf_resp=2, use_bedrock=T - h2osno_max=10m, use_flexibleCN (if use_cn=T) - carbon_resp_opt=1 (only if use_cn ON and FUN off) - use_luna (only is use_cn and use_nitrif_denitrif on) - lnc_opt depends on use_cn, use_fun depends on - use_cn=T AND use_nitrif_dentrif=T - Change leaf_mr_vcm phys default value - use_nguardrail=T -M components/clm/bld/CLMBuildNamelist.pm - New photsyns_inparm namelist. carbon_resp_opt should NOT be 1 when FUN on. - lnc_opt only matters when luna on or vcmax_opt=3/4. leafresp_method MUST be 0 - if CN off. - - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r173 -Originator(s): sacks (Bill Sacks) -Date: Thu Mar 17 20:24:45 MDT 2016 -One-line Summary: Major refactor of CN Products - -Purpose of changes ------------------- - -Variables and code related to CN product pools and fluxes were scattered among -12 modules. In addition, CNWoodProducts was difficult to understand and modify, -because the same basic logic was repeated four times: once for carbon, once for -c13, once for c14 and once for nitrogen. - -This tag does a major overhaul of CNWoodProducts - now renamed to CNProducts, -since it includes grain as well as wood products. This is now an object-oriented -class. The major benefits of this overhaul are: - -- Only 2 modules now contain any information about the number of product pools - and their lifetimes: CNProducts and pftconMod. Previously, 12 modules had some - information about the fact that there were 10 & 100-year product pools. This - makes it easier to change the number or lifetimes of product pools in the - future. Code outside CNProducts (and pftconMod) knows that there is some flux - to wood and crop product pools in general, but doesn't need to know anything - about how this is partitioned into the 10 and 100-year product pools - or even - the fact that there are 10 and 100-year product pools. - -- Because this product pool information is now self-contained, with a clear - interface, CNProductsMod could be used by ED, if this were desired. - -- Changes to CNProductsMod no longer need to be replicated four times for the - four different species. Instead, there are four instances of cn_products_type - declared at a higher level. - -This tag also introduces a "species" class (with subclasses for isotope and -non-isotope species), which can be used to remove duplication in the setting of -history and restart variables in classes for which we have one instance for each -species. This is currently used in the new CNProductsMod; eventually it can also -be used in CNVegCarbonStateType, CNVegCarbonFluxType, and the similar -SoilBiogeochem Types (at which point this should probably be moved out of the -biogeochem directory into somewhere like 'utils'). - -This tag also introduces a utility method for setting one restart field (not -found on the restart file) from another (which was present). This is used in a -few places in CNProductsMod, and should be used in other places as well (e.g., -see bug 2282). - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2297 (code looks wrong for initializing carbon isotopes from a restart file - without isotope information) - -Known bugs introduced in this tag (include bugzilla ID): -- 2256 (Problems with early versions of PIO2 in CLM) -- shows up in more - (hobart) tests now, for unclear reasons - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - ok (pass except irrigation expected failure) - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means tests pass or xfail, some baseline comparisons failed as noted - below - - Two new expected failures appear to be PIO2 issues: - RUN ERP_Ly5.1x1_numaIA.ICRUCLM50BGCCROP.hobart_nag.clm-monthly - RUN ERP_Ld5_P24x1.f10_f10.I1850CLM45BGC.hobart_nag.clm-default - - -CLM tag used for the baseline comparisons: clm4_5_8_r172 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 / CLM50 - anything other than 1850 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - This is complicated; ready? Let's work backwards: - - Branch tag product_pools_gridcell2_n03_clm4_5_8_r172 (which is becoming - this trunk tag) was bit-for-bit with branch tag - product_pool_total_fluxes_n01_clm4_5_8_r172 (from branch - product_pool_total_fluxes), except for roundoff-level changes in c13 / c14 - product pools / fluxes for transient cases with ciso. (Those changes - remained roundoff-level throughout the simulation, so their roundoff-level - nature was obvious from the cprnc output.) - - Determining that the changes in product_pool_total_fluxes_n01_clm4_5_8_r172 - were no greater than roundoff-level was tricky, because these differences - propagated over time. To do this, I created another branch: - product_total_roundoff, with branch tag - product_total_roundoff_n01_product_pool_total_fluxes_n01_clm4_5_8_r172. This - was essentially the same as product_pool_total_fluxes_n01_clm4_5_8_r172, - except that hrv_deadstemc_to_prod10c and hrv_deadstemc_to_prod100c (and - same for nitrogen) were computed twice: once the old way and once the new - way. The updates of deadstemc/n in CStateUpdate2h and NStateUpdate2h (which - were the uses that caused differenes to propagate to greater than - roundoff-level) were also done twice: once using the "old" hrv_deadstem - values, and once with the "new" values. The "old" version was used in the - rest of the code, but the two versions were compared for every point in - every time step to ensure that they were never more than roundoff-level - different. I ran the full test suite on - product_total_roundoff_n01_product_pool_total_fluxes_n01_clm4_5_8_r172 and - ensured that it differed by no more than roundoff-level from trunk tag - clm4_5_8_r172. - - To summarize: I ensured that the only differences greater than - roundoff-level in the test suite were attributable to differences in the - order of operations when computing the hrv_deadstem*_to_prod* variables, - and I also ensured that the new and old calculations of the - hrv_deadstem*_to_prod* variables never differed by more than roundoff. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Renamed to CNProductsMod.F90 -D components/clm/src/biogeochem/CNWoodProductsMod.F90 - -List all files added and what they do: - -========= Main change - this used to be CNWoodProductsMod.F90, but has been - completely rewritten, as described above -A components/clm/src/biogeochem/CNProductsMod.F90 - -========= Utility classes to hold metadata for classes that can have one - instance for each species (carbon, nitrogen, c13, c14) - removing - duplication in the calls to hist_addfld and restartvar -A components/clm/src/biogeochem/SpeciesNonIsotopeType.F90 -A components/clm/src/biogeochem/SpeciesBaseType.F90 -A components/clm/src/biogeochem/SpeciesIsotopeType.F90 -A components/clm/src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf -A components/clm/src/biogeochem/test/Species_test/CMakeLists.txt -A components/clm/src/biogeochem/test/Species_test/test_SpeciesIsotope.pf -A components/clm/src/biogeochem/test/Species_test -A components/clm/src/biogeochem/test/CMakeLists.txt -A components/clm/src/biogeochem/test - -========= Add a short ciso transient test (eventually can remove the long ciso - transient test and just keep this one) -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_decStart/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_decStart - -List all existing files that have been modified, and describe the changes: - -========= Main changes in this tag: remove information about the different - product pools that are scattered throughout the code, and add some - objects of cn_products_type -M components/clm/src/biogeochem/CNCIsoFluxMod.F90 -M components/clm/src/biogeochem/dynHarvestMod.F90 -M components/clm/src/biogeochem/CNCStateUpdate2Mod.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/biogeochem/dynConsBiogeochemMod.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNNStateUpdate2Mod.F90 -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 - -========= Add utility method for setting an absent restart field from one that - was present on the initial conditions file -M components/clm/src/utils/restUtilMod.F90.in - -========= Move duplicate code into clm_varcon, and fix bug 2297 -M components/clm/src/main/clm_varcon.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 - -========= Add a short ciso transient test (eventually can remove the long ciso - transient test and just keep this one) -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Add unit tests of new Species classes -M components/clm/src/CMakeLists.txt -M components/clm/src/biogeochem/CMakeLists.txt - -========= Two new expected failures on hobart; appear to be PIO2-related -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r172 -Originator(s): sacks (Bill Sacks) -Date: Tue Mar 8 13:10:19 MST 2016 -One-line Summary: Exclude land use and product pools / fluxes from CN summary diagnostics - -Purpose of changes ------------------- - -Changed TOTCOLC, TOTECOSYSC, TOTCOLN and TOTECOSYSN (and same for C isotopes) to -no longer include product pools. Also changed NBP and NEE to no longer include -land use or product fluxes (dwt_closs and product_closs). - -Removed LAND_UPTAKE diagnostic, because NEE now gives this quantity. Added -NET_CARBON_EXCHANGE, which gives the sum of NEE and the land use flux - i.e., -what NEE used to be. - -Also, changed TOTPRODN to be consistent with TOTPRODC: no longer includes crop -product pool. - -The main motivation for this change is the upcoming move of product pools to the -grid cell level. However, this also addresses inconsistencies between CLM's -definition of NEE, etc., and what would be more typically considered in the -literature. - -These changes to the meaning of these diagnostics were all proposed and/or -approved by Peter Lawrence. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changes meaning of a number of diagnostics, as noted above - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - ok - - All pass except expected failure in irrigation - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - All pass or xfail; baseline failures as noted below - -CLM tag used for the baseline comparisons: clm4_5_8_r171, but with mods to -produce FCO2 history field (in order to ensure that this tag hasn't changed the -co2 flux sent to the atmosphere). - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: many CLM45 / CLM50 - see below for details - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff for prognostic fields, larger than roundoff for some diagnostic fields - - Significant changes in the diagnostic fields noted under "purpose of - changes", above, for transient, CNDV and crop runs, and for year-2000 runs - that used initial conditions from a transient run (so presumably had - non-zero product pools). Changes in these diagnostic fields (if any) are - roundoff-level for non-crop, non-CNDV, non-crop 1850 runs. - - Roundoff-level changes in CO2 flux sent to atmosphere and new FCO2 - diagnostic field for some runs. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes as described above. Some files just changed because some - uses of nee have been changed to net_carbon_exchange. -M components/clm/src/cpl/lnd_import_export.F90 -M components/clm/src/biogeochem/CNVegetationFacade.F90 -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/lnd2atmMod.F90 - -========= Since total column C / N no longer includes the product pools, the CN - balance checks needed to be changed so that outputs from the system - include fluxes into the product pools, but NOT fluxes out of the - product pools (the product pools are outside of the system as far as - the balance checks are concerned) -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 - -========= Fluxes into the product pools now need to be saved for the sake of the - balance checks -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNWoodProductsMod.F90 -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 - -========= Output FCO2 (co2 flux to atmosphere), since otherwise this isn't - covered by any of our tests - since our tests don't turn on this - coupling field -M components/clm/src/main/lnd2atmType.F90 -M components/clm/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm - -========= Add expected baseline failure (bug 2291) -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r171 -Originator(s): erik (Erik Kluzek) -Date: Wed Mar 2 23:53:40 MST 2016 -One-line Summary: Backout COMP_RUN_BARRIERS setting, and remove all ED tests from testlist (as they all fail) - -Purpose of changes ------------------- - -Backout the setting of COMP_RUN_BARRIERS. It has a nasty side effect of disabling the -automatic setting of CONTINUE_RUN=TRUE when RESUBMIT>1. See bug 2280. Now production -simulations with I compsets will fail because datm is allowed to get ahead of CLM. - -Also remove all of the ED tests from the testlists as they currently all fail. - -Known bugs introduced in this tag (include bugzilla ID): bug 2280 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: short - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - regular tests: - - yellowstone_intel - clm_short_45 -- PASS - -CLM tag used for the baseline comparisons: clm4_5_8_r170 - - -Answer changes --------------- - -Changes answers relative to baseline: No, bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/cime_config/config_component.xml ------- Remove setting of COMP_RUN_BARRIERS - M components/clm/cime_config/testdefs/testlist_clm.xml -- remove all ED tests - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r170 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 28 20:33:37 MST 2016 -One-line Summary: Add a wrapper for CN Vegetation - -Purpose of changes ------------------- - -This tag introduces a wrapper (or "facade" in software design terms) for the CN -vegetation types and modules. - -My main motivations were: - -(1) Insulating the rest of the code from changes in the CNVeg -implementation. For example, I'm about to introduce a class to hold variables -related to the product pools. With the old implementation, I would have to touch -a number of modules outside of the biogeochem directory in order to do this; now -I won't. - -(2) Simplifying interfaces to subroutines – reducing the number of arguments. - -(3) Starting to put in place a structure that could be leveraged to support CN -and ED (and SP) side-by-side, polymorphically, so that we don't need 'if use_cn' -/ 'if use_ed' conditionals scattered throughout the code or direct "use" -statements of types in CN / ED / etc. - -The changes here are a big first step towards these goals, although this isn't -yet complete. There are some notes in comments in CNVegetationFacade.F90 listing -some things that should still be done. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2276: Need ne30_g16 surface dataset with crop for CLM45/CLM50 -- 2291: fire emissions NaN with gnu compiler - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: a bit of review by Erik Kluzek and Ben Andre - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - ok - - ok means: all tests pass except expected irrigation failure - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - There was one unexpected baseline failure: - SMS_Lm25.f19_g16.ICLM45BGCCROP.yellowstone_gnu.clm-cropMonthOutput - - Upon investigation, it appeared that this was a problem in the previous tag - (and possibly earlier): fire emissions differed between the trunk and this - branch, and were often NaN in the trunk version (but no longer NaN on this - branch). This seems most likely to be a compiler-related problem, since it - seems to just appear with gnu. See bug 2291. - -CLM tag used for the baseline comparisons: clm4_5_8_r169 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - (However, see above notes about the baseline failure due to bug 2291.) - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Moved some modules from dyn_subgrid into biogeochem (no changes to contents) -D components/clm/src/dyn_subgrid/dynCNDVMod.F90 -D components/clm/src/dyn_subgrid/dynHarvestMod.F90 -D components/clm/src/dyn_subgrid/dynConsBiogeochemMod.F90 - -List all files added and what they do: - -========= New module, providing a wrapper / facade for the CNVeg stuff; - this is the crux of the change -A components/clm/src/biogeochem/CNVegetationFacade.F90 - -========= Moved some modules from dyn_subgrid into biogeochem (no changes to contents) -A components/clm/src/biogeochem/dynCNDVMod.F90 -A components/clm/src/biogeochem/dynHarvestMod.F90 -A components/clm/src/biogeochem/dynConsBiogeochemMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Moved stuff out of these places into the new CNVeg, and simplified - some interfaces -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Rather than passing CNVeg derived types, instead directly pass the - small number of arrays that are needed from CNVeg (removes dependence - on the CNVeg types, which is needed if we ever want to make CNVeg - polymorphic; also makes the connection between CNVeg and other parts - of the model more explicit) -M components/clm/src/biogeophys/CanopyFluxesMod.F90 -M components/clm/src/biogeophys/PhotosynthesisMod.F90 -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/biogeochem/ch4Mod.F90 - -========= Added a bit of time manager functionality, and some unit tests -M components/clm/src/utils/clm_time_manager.F90 -M components/clm/src/unit_test_shr/unittestTimeManagerMod.F90 -M components/clm/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf - -========= Moved some crop-specific variables out of CNVegStateType into CropType - (but there are still more that need to be moved) -M components/clm/src/biogeochem/CNVegStateType.F90 -M components/clm/src/biogeochem/CropType.F90 -M components/clm/src/biogeochem/CNPhenologyMod.F90 -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M components/clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 -M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 -M components/clm/src/biogeochem/NutrientCompetitionMethodMod.F90 -M components/clm/src/biogeochem/CNNDynamicsMod.F90 -M components/clm/src/biogeochem/CNVegStructUpdateMod.F90 -M components/clm/src/biogeochem/CNRootDynMod.F90 -M components/clm/src/biogeochem/CNDriverMod.F90 - -========= Unrelated change: fix xml entries for ne30 and ne120 surface datasets - (bug 2276) -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Restore expected failure that seems to have been deleted accidentally -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r169 -Originator(s): erik (Erik Kluzek) -Date: Tue Feb 23 14:35:02 MST 2016 -One-line Summary: Add fire several fire constants to namelist, add some new clm45/50 surface datasets - -Purpose of changes ------------------- - - Add a bunch of constants to the namelist for the CN Li fire parameterization. - They are added in the new lifire_inparm namelist. - - Work on user interface a bit. - * New lifire_inparm namelist (see above) - * Add CLM_ACCELERATED_SPINNUP env_run variable - * Turn COMP_RUN_BARRIERS for f09 and f19 resolutions - * New compsets: ICLM50BGCDVCROP, IHISTCLM50BGC - * Model dies if CLM namelist isn't found - * Models dies if use_bedrock=.true. and zbedrock NOT on surface dataset - * Remove use_nofire move to fire_method as "nofire" option - - Add some new clm45/50 surface datasets for crop at 1850 for f45, ne30, and ne120 - Add back in the USUMB PTCLMmkdata dataset directory for testing. - - Work on testing a bit. Remove CLM50 testmods directories just there because of - missing CLM50 compsets. Add set of complete clm40 testmod directories. Add nofire - test, update USUMB test. Remove use_dynroot from all but Kitchen sink tests. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): [If none, remove this line] - 2285 Problem creating ne120 surface dataset - 2280 (partial) need to set barriers for concurrent PE layouts with I compsets - 2279 Need new USUMB PTCLMmkdata directory - 2276 New ne30, ne120, f45 surface datasets for CLM45/50 1850 CROP - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - Introduce new env_run variable: CLM_ACCELERATED_SPINUP (It can be "on" or "off") - When "on" it sets the simulation up in such a way for it to run in an accelerated - fashion - - (currently all it does is turn "-bgc_spinup on" if - - NOTE: Turns on COMP_RUN_BARRIERS by default for f09 and f19 resolutions as they - are usually run concurrent (f09 is by default). - - Add new CLM namelist: lifire_inparm - - Add new compsets: ICLM50BGCDVCROP, IHISTCLM50BGC - - NOTE: Model will now die if you set use_bedrock=.true., and your surface dataset - doesn't have zbedrock on it. - - WARNING: Now if a CLM namelist is NOT found -- the model will abort with an error. - -Changes made to namelist defaults (e.g., changed parameter values): Many new namelist items - - New CN fire namelist items: rh_low, rh_hgh, bt_min, bt_max, cli_scale, - boreal_peatfire_c, pot_hmn_ign_counts_alpha, non_boreal_peatfire_c, - cropfire_a1, and occur_hi_gdp_tree - They are set by default according to either fire_method=li2014qianfrc or li2016crufrc - - use_nofire removed and "nofire" added as an option to fire_method - -Changes to the datasets (e.g., parameter, surface or initial files): A few new surface datasets - New 1850 clm45/50 surface datasets for: f45, ne30, ne120 - Alos new PTCLMmkdata USUMB directory - -Substantial timing or memory changes: None known - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: regular - - build-namelist tests: - - yellowstone - OK (36 comparison tests fail because of new namelist) - - unit-tests (components/clm/src): - - yellowstone - OK - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - Two comparision tests (ro clm4_5_8_r168) fail, because use_dynroot no longer on. - -CLM tag used for the baseline comparisons: clm4_5_8_r168 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: - - Eliminate testmods directories just needed for CLM50 compsets - Now that compsets are added they are unneeded. - - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCCROPmonthly/include_user_mods - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCCROPmonthly/shell_commands - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCDVCROPmonthly/include_user_mods - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCDVCROPmonthly/shell_commands - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCmonthly/include_user_mods - D components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCmonthly/shell_commands - -List all files added and what they do: - -A + components/clm/src/biogeochem/CNFireNoFireMod.F90 -- No fire option - - New testmods for nofire, clm40 tests, and USUMB PTCLMmkdata directory -A + components/clm/cime_config/testdefs/testmods_dirs/clm/nofire -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40crop -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40pts -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLA -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsRLB -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40ptsROA -A + components/clm/cime_config/testdefs/testmods_dirs/clm/40reduceOutput -A + components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/shell_commands - -List all existing files that have been modified, and describe the changes: - - M components/clm/bld/CLMBuildNamelist.pm --- Add new fire constants and lifire_inparm - namelist. Allow spinup state to be 1 or 2, and document better - M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- When - -bgc_spinup on, spinup_state=1 for clm45 and 2 for clm50. Add new - fire constants set to values for either lifire2014qianfrc or lifire2016crufrc - new f45, ne30, ne120 datasets (bug 2276) - M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- Add - nofire option to fire_method, remove use_nofire, and add new fire - constants - M components/clm/cime_config/buildnml --- Add CLM_ACCELERATED_SPINUP - set "-bgc_spinup on" if CLM_ACCELERATED_SPINUP="on" - - M components/clm/cime_config/config_component.xml -- Set COMP_RUN_BARRIERS (bug 2280) - to TRUE for f09 and f19 resolutions. Define CLM_ACCELERATED_SPINUP. - M components/clm/cime_config/config_compsets.xml -- Add ICLM50BGCDVCROP - and IHISTCLM50BGC compsets - - M components/clm/cime_config/testdefs/testlist_clm.xml --- move all clm40 - tests to have 40 testmods directories, add f45 nofire test, remove clm50 - testmods just use new CLM50 compsets - M components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm -- update (bug 2279) - M components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/xmlchange_cmnds -- update - M components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm -- remove use_dynroot - M components/clm/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods -- point to default NOT 40default - M components/clm/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm -- remove use_dynroot - M components/clm/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods -- point to default not 40default - M components/clm/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands -- remove -no-fire_emis - - M components/clm/src/biogeochem/CNFireBaseMod.F90 ----- add cnfire_const object - and CNFireReadNML method, put li2016 version of FireFluxes in place (can be - shared by li2014 and li2016). - M components/clm/src/biogeochem/CNFireFactoryMod.F90 -- Abort if namelist not - found, and add nofire case for fire_method. - M components/clm/src/biogeochem/CNFireLi2014Mod.F90 --- Use constants from cnfire_const - object in CNFireBaseMod, remove use_nofire option - M components/clm/src/biogeochem/CNFireLi2016Mod.F90 --- Use constants from cnfire_const - object in CNFireBaseMod, remove use_nofire option, remove CNFireFluxes - M components/clm/src/biogeochem/CNFireMethodMod.F90 --- Add CNFireReadNML_interface - M components/clm/src/biogeochem/CNMRespMod.F90 -------- abort if can't find namelist - M components/clm/src/biogeochem/CNSharedParamsMod.F90 ----- abort if can't find namelist - M components/clm/src/biogeochem/SatellitePhenologyMod.F90 - abort if can't find -namelist - M components/clm/src/biogeochem/VOCEmissionMod.F90 - M components/clm/src/biogeochem/ch4varcon.F90 ---------- abort if can't find namelist - M components/clm/src/biogeophys/CanopyHydrologyMod.F90 - abort if can't find namelist - M components/clm/src/biogeophys/CanopyStateType.F90 ---- abort if can't find namelist - M components/clm/src/biogeophys/HumanIndexMod.F90 ------ abort if can't find namelist - M components/clm/src/biogeophys/RootBiophysMod.F90 ----- abort if can't find namelist - M components/clm/src/biogeophys/SnowHydrologyMod.F90 --- abort if can't find namelist - M components/clm/src/biogeophys/SoilHydrologyType.F90 -- abort if can't find namelist - M components/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - abort if can't find namelist - M components/clm/src/biogeophys/SoilWaterMovementMod.F90 - abort if can't find namelist - M components/clm/src/biogeophys/SurfaceResistanceMod.F90 - abort if can't find namelist - M components/clm/src/biogeophys/UrbanParamsType.F90 ------ abort if can't find namelist - M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 abort if can't find namelist - M components/clm/src/dyn_subgrid/dynpftFileMod.F90 ------- abort if can't find namelist - M components/clm/src/init_interp/initInterp.F90 ---------- abort if can't find namelist - M components/clm/src/main/clm_initializeMod.F90 ---------- Pass NL_Filename to create_cnfire_method - M components/clm/src/main/clm_varcon.F90 ----------------- Add secsphr - M components/clm/src/main/clm_varctl.F90 ----------------- Remove use_nofire - M components/clm/src/main/controlMod.F90 ----------------- Remove use_nofire, abort - if can't find namelists - M components/clm/src/main/glcBehaviorMod.F90 ------------- abort if can't find namelist - M components/clm/src/main/initVerticalMod.F90 ------------ abort if can't find namelist and abort if use_bedrock and zbedrock NOT on surface dataset - M components/clm/src/main/ndepStreamMod.F90 -------------- abort if can't find namelist - - M components/clm/src/main/restFileMod.F90 ---------------- abort if can't find namelist - - M components/clm/tools/clm4_5/mksurfdata_map/Makefile.data -- by default create crop - 1850 f45, ne30, ne120 datasets - M components/clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 - Lower tolerance to - relerr = 0.0001 (bug 2285) - -=============================================================== -=============================================================== -Tag name: clm4_5_8_r168 -Originator(s): Keith Oleson; brought to trunk by Bill Sacks -Date: Sat Feb 20 20:55:19 MST 2016 -One-line Summary: Fix zero methane production - -Purpose of changes ------------------- - -Methane production has been zero ever since the hydrology reordering in -clm4_5_13 (in June, 2013). The order of subroutine calls appears to be a -problem: -1. CNDriverNoLeaching is called in clm_driver, which calls SetValues, which - zeros out the carbon fluxes (e.g., somhr and lithr) -2. ch4 is called which uses the zero-ed out fluxes -3. Summary is called which sums up the soil layer som and litter heterotrophic - respiration terms which should be used by ch4, but are not. - -This tag puts the call to ch4 back where it was in clm4_5_12 and earlier. - -Keith Oleson found and fixed this bug; Bill Sacks brought it to the trunk. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2225: CH4PROD=0 -- 2287: Methane production is zero - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- Changes answers far more than you might immediately suspect; this was deemed - to be reasonable at the 02/18/2016 TSS meeting - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: Keith Oleson, Bill Sacks - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - 'ok' means: tests pass or xfail, some baseline comparisons fail as noted below - -CLM tag used for the baseline comparisons: clm4_5_7_r167 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 & CLM50 with BGC turned on - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - New climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: clm5_respn05r162_2degGSWP3_1850spin_allN_v01_ch4A_785_799 - - URL for LMWG diagnostics output used to validate new climate: - http://www.cgd.ucar.edu/tss/clm/diagnostics/clm5_dev/clm5_respn05r162_2degGSWP3_1850spin_allN_v01_ch4A_785_799-clm5_respn05r162_2degGSWP3_1850spin_allN_v01_785_799/setsIndex.html - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Move ch4 call to where it was in clm4_5_12 and earlier -M components/clm/src/main/clm_driver.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r167 -Originator(s): sacks (Bill Sacks) -Date: Sat Feb 20 06:24:52 MST 2016 -One-line Summary: Fix carbon isotopes in transient runs - -Purpose of changes ------------------- - -In CNWoodProducts, code that was supposed to operate on c13 / c14 variables was -actually operating on the standard c12 variable. This led to incorrect results -and carbon balance errors if running with carbon isotopes in transient runs. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2207: bug in carbon isotopes in CNWoodProducts - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - not run - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_7_r166 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - In principle, changes answers for transient runs with carbon isotopes - enabled, but since those runs were previously crashing (due to carbon balance - errors), I am listing this as no answer changes. - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Add a long, transient test with carbon isotopes -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_monthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_monthly - -List all existing files that have been modified, and describe the changes: - -========= Main change -M components/clm/src/biogeochem/CNWoodProductsMod.F90 - -========= Add a long, transient test with carbon isotopes -M components/clm/cime_config/testdefs/testlist_clm.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r166 -Originator(s): sacks (Bill Sacks) -Date: Tue Feb 2 04:58:45 MST 2016 -One-line Summary: Infrastructure for carbon and nitrogen conservation with dynamic landunits - -Purpose of changes ------------------- - -Puts in place the infrastructure that will be used for carbon and nitrogen -conservation, and possibly other column-level conservation, with dynamic -landunits. - -This does NOT yet implement any of teh actual carbon and nitrogen conservation - -that will be done in an upcoming tag via uses of this new infrastructure. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: High-level (design) review by Erik Kluzek and Ben Andre - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_7_r165 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): - -List all files eliminated: - -List all files added and what they do: - -========= Main new code: class for adjusting column-level state variables due to - transient column areas -A components/clm/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 -A components/clm/src/dyn_subgrid/test/dynColumnStateUpdater_test/CMakeLists.txt -A components/clm/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf -A components/clm/src/dyn_subgrid/test/dynColumnStateUpdater_test - -========= Find a template column to use for the state variables on some other - column of interest. Used by both dynColumnStateUpdater and - dynInitColumns. -A components/clm/src/dyn_subgrid/dynColumnTemplateMod.F90 -A components/clm/src/dyn_subgrid/test/dynColumnTemplate_test/test_column_template.pf -A components/clm/src/dyn_subgrid/test/dynColumnTemplate_test/CMakeLists.txt -A components/clm/src/dyn_subgrid/test/dynColumnTemplate_test - -========= Add test of get_ltype_special -A components/clm/src/unit_test_shr/test/unittestSubgrid_test/test_unittestSubgrid.pf -A components/clm/src/unit_test_shr/test/unittestSubgrid_test/CMakeLists.txt -A components/clm/src/unit_test_shr/test/unittestSubgrid_test - -List all existing files that have been modified, and describe the changes: - -========= Initialize a column state updater object, and set the old and new - weights in each time step -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Extract initial_template_col and some related code into a new class - (dynColumnTemplateMod) -M components/clm/src/dyn_subgrid/dynInitColumnsMod.F90 - -========= New function: landunit_is_special -M components/clm/src/main/landunit_varcon.F90 -M components/clm/src/main/initSubgridMod.F90 - -========= Just add a comment -M components/clm/src/dyn_subgrid/dynPriorWeightsMod.F90 - -========= Add get_ltype_special function -M components/clm/src/unit_test_shr/unittestSubgridMod.F90 - -========= Move test of extracted code to new directory -M components/clm/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf - -========= Add files for unit test build -M components/clm/src/dyn_subgrid/CMakeLists.txt -M components/clm/src/unit_test_shr/test/CMakeLists.txt -M components/clm/src/dyn_subgrid/test/CMakeLists.txt - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r165 -Originator(s): sacks (Bill Sacks) -Date: Fri Jan 29 05:28:46 MST 2016 -One-line Summary: Remove fglcmask, recreate all surface datasets - -Purpose of changes ------------------- - -Remove fglcmask input file. This specified the area where we need virtual -glacier elevation classes for coupling to CISM. There were two main problems -with this: - -- There was a separate file for each CLM resolution at which we can couple to - CISM - currently this is just f09, f19, T31. There was no easy way to generate - these files for all CLM resolutions - which is something that is needed in - order to turn GLC on by default in all CESM runs. - -- This did not provide the flexibility needed to treat three regions - differently: Greenland (virtual columns), Antarctica (multiple elevation - classes, but no virtual columns), and mountain glaciers (single elevation - class). - -This tag removes the fglcmask file, replacing it with an integer-valued -GLACIER_REGION field on the surface dataset, together with a -glacier_region_behavior namelist option. - -I have generated all new surface datasets. In addition to adding the -GLACIER_REGION field, these: -- add zbedrock (most out-of-the-box surface datasets did not yet have this - field) -- remove unused TOPO field - -There are also new initial conditions files, simply for the sake of updating the -surface_dataset metadata. - -Also changed mksurfdata_map's Makefile.data and perl script (including adding a --no_surfdata flag) so that the necessary out-of-the-box surface datasets are all -created correctly (with correct names). Also did some other cleanup of -mksurfdata.pl. - -Also removed kludgey Greenland and Antarctica areas from history file, which -weren't being used. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - - - New surface datasets have zbedrock, in contrast to many old datasets. This - means that runs with use_bedrock = .true. will actually use bedrock now, - changing answers - - - For any run with glc_mec (compsets with CISM): will need to run initial - conditions through init_interp - - - For any initial conditions file of your own that was generated from an - earlier CLM tag (i.e., not an out-of-the-box initial conditions file): will - need to set check_finidat_fsurdat_consistency to .false., because surface - datasets have changed - - - 1/8 deg surface dataset hasn't been updated, so won't work with this tag - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - - New namelist variable: glacier_region_behavior - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): - - - all new surface datasets; these are the same as before, but have: - - GLACIER_REGION added - - TOPO removed - - zbedrock added (wasn't yet on most default surface datasets) - - - new initial conditions files: just updated surface_dataset metadata to - point to new surface datasets - -Substantial timing or memory changes: NONE - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - pass - 010 blg54 failed due to problems / differences in the baseline; when I - fixed those, it passed - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - ok means: all tests pass or xfail. Baseline comparisons fail for IG tests - and ERS_D_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_intel.clm-deepsoil_bedrock, - as noted below. - -CLM tag used for the baseline comparisons: clm4_5_7_r164 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - configurations with glc_mec (compsets with CISM) - - configurations with use_bedrock = .true. for which zbedrock wasn't - previously on the surface dataset - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; not investigated closely - - - The answer changes in glc_mec runs are due to small changes in the set of - grid cells in the single_at_atm_topo zone. I confirmed that, if I use a - kludged-in GLACIER_REGION field that exactly matches the old fglcmask, then - answers are bit-for-bit. - - The answer changes in use_bedrock configurations are presumably due to - zbedrock being on the surface datasets now. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): No updates -to top-level externals; updated PTCLM to allow build on pronghorn (same as -yellowstone / caldera) - -List all files eliminated: - -========= Mostly-unrelated change: remove unused fields from history file (these - specified Greenland and Antarctica areas in a kludgey way) -D components/clm/src/main/glcDiagnosticsMod.F90 - -========= Renamed to be consistent with new naming convention -D components/clm/tools/clm4_5/mksurfdata_map/landuse_timeseries_hist_simyr1850-2005.txt - -List all files added and what they do: - -========= Add GLACIER_REGION field to surface dataset -A components/clm/tools/clm4_5/mksurfdata_map/src/mkglacierregionMod.F90 - -========= Renamed to be consistent with new naming convention -A components/clm/tools/clm4_5/mksurfdata_map/landuse_timeseries_hist_16pfts_simyr1850-2005.txt - - -List all existing files that have been modified, and describe the changes: - -========= Remove glcmask. Instead make glcBehavior based on GLACIER_REGION on - the surface dataset -M components/clm/src/utils/domainMod.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/test/glcBehavior_test/test_glcBehavior.pf -M components/clm/src/main/glc2lndMod.F90 -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/surfrdMod.F90 -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/glcBehaviorMod.F90 -M components/clm/src/main/clm_initializeMod.F90 - -========= Add GLACIER_REGION to surface datasets. Point to all new surface - datasets. Also new initial conditions files - identical to old ones - except for surface_dataset metadata. Also, remove fglcmask namelist - option and add glacier_region_behavior namelist option. -M components/clm/tools/clm4_5/mksurfdata_map/mksurfdata_map.namelist -M components/clm/tools/clm4_5/mksurfdata_map/README -M components/clm/tools/clm4_5/mksurfdata_map/README.developers -M components/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 -M components/clm/tools/clm4_5/mksurfdata_map/src/README.unit_testing -M components/clm/tools/clm4_5/mksurfdata_map/src/Srcfiles -M components/clm/tools/clm4_5/mksurfdata_map/src/mkvarctl.F90 -M components/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 -M components/clm/tools/clm4_5/mksurfdata_map/unit_testers/Srcfiles -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/namelist_files/checkmapfiles.ncl -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm -M components/clm/doc/UsersGuide/tools.xml -M components/clm/doc/UsersGuide/adding_files.xml - -========= Make new routine for printing diagnostics of index fields -M components/clm/tools/clm4_5/mksurfdata_map/src/mkdiagnosticsMod.F90 -M components/clm/tools/clm4_5/mksurfdata_map/src/mkagfirepkmonthMod.F90 -M components/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparMod.F90 - -========= Fix makefile-based creation of surface datasets so that 'make all' - gives correctly-named datasets for all needed out-of-the-box surface - datasets -M components/clm/tools/clm4_5/mksurfdata_map/Makefile.data -M components/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - -========= Point to new PTCLM: allow testing on pronghorn (same as yellowstone) -M components/clm/tools/SVN_EXTERNAL_DIRECTORIES - -========= Add tests to xfail list. These all failed in clm4_5_7_r164 except for these new failures: - + RUN ERS_Ly3.f10_f10.I1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KSinkMOut - + RUN SMS_D_Lm1_Mmpi-serial.CLM_USRDAT.I1PTCLM45.yellowstone_pgi.clm-USUMB -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r164 -Originator(s): erik (Erik Kluzek) -Date: Tue Jan 12 00:51:25 MST 2016 -One-line Summary: Update CIME and MOSART - -Purpose of changes ------------------- - -Update CLM to a robust version of CIME and PIO2 (used in the cesm1_5_beta04 tag). -Also fix an issue in MOSART that changes answers (qgwl_volume must be multiplied -by area). - -Note, that this version of CIME removes the archive.locked directory. - -Change the rearranger that PIO uses from being hardcoded to using the one -picked with the env_run.xml variable LND_PIO_REARRANGER (both clm40 and clm45). -By default, as before the rearranger for clm40 is the new SUBSET option, and -for clm45/clm50 it's the old BOX method, eventually we expect both to use -the SUBSET method by default. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - 2265 Workaround for pio_syncfile issue - 2257 Unit tests fail - 2256 Issues with early versions of PIO2 - -Bugs found recently: - 2264 Fire is missing accounting of C/N for transfer of live to dead - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - This version of CIME now creates cimeteststatus instead of cs.status when create_test used - (use the summary option to cimeteststatus "-s"!) - Remove the archive.locked functionality and the creation of the associated hardlinks - Removed the option DOUT_S_SAVE_DATES_RESTART_FILE_SET - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): pio rearranger - set the rearranger for PIO to use by the env_run variable LND_PIO_REARRANGER - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: PIO2 should have better performance - and it allows two options for the rearranger to use (BOX and SUBSET). - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: regular - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - OK (all PASS except irrigation test with known issue) - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - OK (only one expected FAIL) - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -OK means tests pass except those in the ExpectedFail list file - -CLM tag used for the baseline comparisons: clm4_5_7_r163 - -Answer changes --------------- - -Changes answers relative to baseline: only if MOSART used - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: with mosart - - what platforms/compilers: all - - nature of change: fixes bug where area wasn't multiplied in - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): cime, mosart - cime to cime4.3.9 - mosart to mosart1_0_15 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M components/clm/src/README.unit_testing -- Add note about how to delete previous build - - M components/clm/src/init_interp/initInterp.F90 -- workaround for bug in PIO where you can't - do two writes in a row. - M components/clm/src/main/ncdio_pio.F90.in -- Take out specifier for rearranger - so will use the setting from LND_PIO_REARRANGER (was hardcoded to BOX) - - M components/clm/src_clm40/main/ncdio_pio.F90.in - so will use the setting from LND_PIO_REARRANGER (was hardcoded to SUBSET) - - M components/clm/cime_config/config_component.xml -------- Set LND_PIO_REARRANGER - to BOX for clm45/clm50 and to SUBSET for clm40 - M components/clm/cime_config/testdefs/testlist_clm.xml --- change goldbach tests for - prealpha/prebeta to hobart - M components/clm/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands - M components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/shell_commands - M components/clm/cime_config/testdefs/testmods_dirs/clm/default/shell_commands - M components/clm/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands - - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r163 -Originator(s): sacks (Bill Sacks) -Date: Wed Dec 23 20:31:22 MST 2015 -One-line Summary: Improve crop performance by allocating less memory - -Purpose of changes ------------------- - -Performance of crop runs was being significantly impacted by the fact that we -allocate memory for any crop column that might ever need to come into existence -with dynamic landunits. Most CLM code should not run over 0-weight points, so -this likely reflects problems in memory/cache efficiency. - -This tag changes that behavior, so that for non-transient runs, we only allocate -memory for the crops that actually exist in that run (i.e., have non-zero -area). For transient crop runs, the behavior is currently the same as before. - -Note that this means you need to run init_interp when transitioning from a -non-transient crop run to a transient crop run, or vice versa. - -For an f09 run without i/o (20-day run with compset -1850_DATM%QIA_CLM50%BGC-CROP_SICE_SOCN_RTM_SGLC_SWAV), this resulted in: - -- number of columns reduced from 674,634 to 277,728 - -- number of patches reduced from 968,284 to 571,378 - -- throughput increased from 3.821 seconds/mday to 2.404 seconds/mday - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - -- need to run old crop initial conditions through init_interp (already done for - out-of-the-box finidat files) - -- from now on, need to run init_interp when transitioning from a non-transient - crop run to a transient crop run, or vice versa - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): new finidat -files for crop: same as old, but run through init_interp - -Substantial timing or memory changes: substantial improvement in both timing and -memory for crop cases - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - irrigation test fails, as in r162 - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - NOTE: On yellowstone, I tested with a cime version that had a one-off from - cime4.3.1: changes to cprnc. This was done so that cprnc would indicate - which tests had differences in dimension sizes in the h1 history files. - - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - 'ok' means tests pass, baseline comparisons fail for some diagnostic fields - for crop cases, as described below - - Also, this test failed the baseline comparison due to a problem in the - baseline: - ERS_D_Ld5.f10_f10.IMCRUCLM50BGC.yellowstone_intel.clm-default - - Some r162 baselines were missing on hobart; I reran these tests and verified - that baseline comparisons passed. - -CLM tag used for the baseline comparisons: clm4_5_7_r162 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 with crop - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Changes in diagnostic fields only - - Changes are in: - - (1) PCT_CFT in grid cells that have 0% crop - - (2) dimension sizes differ for history files with dov2xy = .false. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/main/initGridCellsMod.F90 -M components/clm/src/main/subgridMod.F90 - -========= Initialize dynSubgridControl earlier in initialization. This is needed - because it now needs to be initialized before we set up the subgrid - stuff / bounds. -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 -M components/clm/src/main/clm_initializeMod.F90 - -========= Add more informative message if it looks like use_init_interp is needed -M components/clm/src/main/restFileMod.F90 -M components/clm/src/main/ncdio_pio.F90.in - -========= Point to new finidat files for crop, which have been run through init_interp -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/user_nl_clm - -========= Minor tweak: remove explicit reference to init_interp, to make it - easier to search the ChangeLog for true references to init_interp -M .ChangeLog_template - -=============================================================== -=============================================================== -Tag name: clm4_5_7_r162 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Dec 18 15:59:23 MST 2015 -One-line Summary: negative runoff updates. - -Purpose of changes ------------------- - -Remove direct to ocean runoff from coupler fields. Negative runoff is -now handled by mosart. Only limit irrigation if volume is below the -threshold instead of lake evaporation and irrigation. - - -Bugs fixed or introduced ------------------------- - -unknown - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): Not well tested after some last minute changes. Not recommended for use. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - limit_lake_evap_and_irrig phys changed to limit_irrigation - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown - - -Code reviews and testing ------------------------- - -Code reviewed by: swenson - -CLM testing: minimal - - build-namelist tests - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - irrigation test fails - - tools-tests (components/clm/test/tools): - - yellowstone - n/a not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - clm50 kitchen sink looks ok - yellowstone_pgi - not run prior to tag - yellowstone_gnu (clm45 only) - not run prior to tag - hobart_nag - not run prior to tag - - prior testing of branch indicated that it was bit for bit with the - exception of coupler and histroy fields related to runoff: - - TWS - VOLR - VOLRMCH - l2x_Flrl_rofgwl - l2x_Flrl_rofdto - x2l_Flrr_volr - x2l_Flrr_volrmch - r2x_Forr_rofl - r2x_Flrr_volr - r2x_Flrr_volrmch - x2r_Flrl_rofgwl - x2r_Flrl_rofdto - - several last minute changes were made and testing was not rerun - before making the tag. No significant problems are expected, but... - -CLM tag used for the baseline comparisons: clm4_5_6_r161 - - -Answer changes --------------- - -Changes answers relative to baseline: yes, only in clm and coupler runoff fields listed above. - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? none - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): rtm1_0_55, mosart1_0_12 - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - change name of limit_irrigation namelist item - clm/bld/CLMBuildNamelist.pm - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 - - change negative runoff - clm/src/main/lnd2atmType.F90 - clm/src/main/controlMod.F90 - clm/src/main/clm_varctl.F90 - clm/src/main/lnd2atmMod.F90 - clm/src/biogeophys/WaterfluxType.F90 - clm/src/biogeophys/LakeFluxesMod.F90 - clm/src/biogeophys/HydrologyDrainageMod.F90 - clm/src/biogeophys/BandDiagonalMod.F90 - clm/src/biogeophys/IrrigationMod.F90 - clm/src/cpl/clm_cpl_indices.F90 - clm/src/cpl/lnd_import_export.F90 - - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r161 -Originator(s): sacks (Bill Sacks) -Date: Thu Dec 17 14:04:29 MST 2015 -One-line Summary: Collapse mountain glaciers to a single elevation class - -Purpose of changes ------------------- - -Mountain glaciers (i.e., glaciers outside of Greenland and Antarctica) have been -problematic when running with glc_mec, because of the adjustments made to the -atmospheric forcings (downscaling to columns). Mountain glaciers generally sit -above the atmospheric forcing height, so this downscaling leads to discrepancies -between the atmospheric forcings and what CLM sees, on the gridcell mean. This -same problem can exist over ice sheets, but it can be more pronounced in -mountain regions because of the steep topography. Furthermore, because no -downscaling is done over the vegetated portion of the grid cell: Even if CLM's -mean grid cell elevation agreed exactly with the atmosphere's topographic -height, there would still be a discrepancy after downscaling, because the -glaciers would see a cooler climate, whereas the rest of the grid cell would see -exactly the climate sent by the atmosphere. - -Mountain glaciers are not currently a focus of the Land Ice Working Group -(LIWG), and surface mass balance is known to have significant problems in -mountain glacier regions. Therefore, because of the above atm-lnd discrepancy, -the LIWG (especially Bill Lipscomb and Jeremy Fyke) decided it would be best to -have only a single glacier elevation class in mountain glacier regions (outside -of Greenland and Antarctica), whose elevation exactly matches the atmosphere's -topographic height. Note that this match of the atmopshere's topographic height -is the same as what is done (implicitly) in all other landunits - resulting in -no adjustment to the atmospheric forcings. - -This tag implements the collapse of mountain glaciers to a single elevation -class, whose topographic height matches the atmosphere's topographic height. It -allows for the possibility that the atmosphere's topographic height could change -in time - in which case the glacier's topographic height (and potentially its -elevation class index) will change in time to follow the atmosphere. - -In addition, this tag puts in place infrastructure to make it easier to define -different glacier regions that receive different treatments (whether virtual -columns are enabled, and whether glacier should be collapsed to a single -elevation class). The "frontend" user interface for this will be added in an -upcoming tag. - -Currently, the definition of the "mountain glacier" region is done so that it -includes everything except the region defined by fglcmask and the region south -of 60 deg S (assumed to be Antarctica). Soon the setting of this region will be -made more robust and more easily user-definable. - -Finally, this tag adds infrastructure to aid in creating and using local -column-level filters. Eventually, this could be extended to cover all of CLM's -filters. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): -- For runs with glc_mec (IG, FG, BG), need to run initial conditions through - init_interp, because there are now slightly fewer glc_mec columns. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- just changed finidat for glcMEC_spunup_1way testmod - -Substantial timing or memory changes: -- small decrease in memory for glc_mec runs, due to a decrease in the number of - columns - - -Code reviews and testing ------------------------- - -Code reviewed by: self; review by others will come later - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - 'ok' means: tests pass except for baseline comparison failures for IG tests, - as noted below - -CLM tag used for the baseline comparisons: clm4_5_6_r160 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM50 with glc_mec (IG, FG, BG) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated closely, but expected to give new climate, at least regionally - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - Verified that changes came just from collapsing mountain glaciers to a single - elevation class, by running the affected tests with this change in - glcBehaviorMod: - -- logical, parameter :: collapse_mountain_glaciers = .true. -+ logical, parameter :: collapse_mountain_glaciers = .false. - - -- these tests were bit-for-bit with the trunk, as expected. - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Main addition in this tag. This module determines a number of aspects - of the behavior of glacier_mec classes in each grid cell. -A components/clm/src/main/glcBehaviorMod.F90 - -========= Unit tests of glcBehaviorMod -A components/clm/src/main/test/glcBehavior_test/CMakeLists.txt -A components/clm/src/main/test/glcBehavior_test/test_glcBehavior.pf -A components/clm/src/main/test/glcBehavior_test - -========= Supports creation and use of local column-level filters. Eventually we - may want to consider moving all filters to using infrastructure like - this. -A components/clm/src/main/filterColMod.F90 - -========= Unit tests of filterColMod -A components/clm/src/main/test/filter_test/CMakeLists.txt -A components/clm/src/main/test/filter_test/test_filter_col.pf -A components/clm/src/main/test/filter_test - -========= Stub of module in driver_cpl/shr (needed by glc_elevclass_mod.F90) -A components/clm/src/unit_test_stubs/csm_share/seq_comm_mct.F90 - -========= Minor changes needed to support unit tests - -List all existing files that have been modified, and describe the changes: - -========= Delegate glc_mec-related logic to glcBehaviorMod: this logic is now - complex, and tied in with various aspects of glcBehaviorMod; also, - delegating the logic to glcBehaviorMod allows us to reduce duplication - between initGridCellsMod and subgridMod. Also split the monster - routine in subgridMod (which had a bunch of optional arguments) into - small routines with well-defined interfaces. -M components/clm/src/main/subgridMod.F90 -M components/clm/src/main/initGridCellsMod.F90 - - also, put setting of ice_mec landunits in a separate routine, thus - cleaning up set_landunit_wet_ice_lake; and remove no-longer-used - setdata argument - - -========= Use glc_behavior instead of glcmask -M components/clm/src/main/glc2lndMod.F90 - - also call glc_behavior%update_collapsed_columns -M components/clm/src/main/subgridWeightsMod.F90 - -========= Track whether a column's type is dynamic -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/initSubgridMod.F90 - -========= Update glc classes upon restart; also separate read and write routines - (which now have different required arguments) -M components/clm/src/main/subgridRestMod.F90 - -========= Declare and initialize glc_behavior, and pass it where needed -M components/clm/src/main/clm_instMod.F90 -M components/clm/src/main/clm_initializeMod.F90 - -========= Pass newly-needed arguments -M components/clm/src/main/clm_driver.F90 -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M components/clm/src/main/decompInitMod.F90 -M components/clm/src/main/restFileMod.F90 -M components/clm/src/main/reweightMod.F90 - -========= Make sure glcmask is always initialized to 0 -M components/clm/src/main/surfrdMod.F90 - -========= Add new history field -M components/clm/src/main/atm2lndType.F90 - -========= For unit tests: add glc_elevclass_mod.F90 from driver_cpl/shr -M components/clm/src/CMakeLists.txt - -========= Minor changes needed to support unit tests -M components/clm/src/unit_test_stubs/csm_share/CMakeLists.txt -M components/clm/src/unit_test_shr/unittestArrayMod.F90 -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 -M components/clm/src/main/CMakeLists.txt -M components/clm/src/main/test/CMakeLists.txt - -========= Remove some costly CLM4 tests -M components/clm/cime_config/testdefs/testlist_clm.xml -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -========= Point to new initial conditions file, init_interp'ed from the old one -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r160 -Originator(s): sacks (Bill Sacks) -Date: Fri Dec 11 10:51:21 MST 2015 -One-line Summary: For glc_mec, get gridcell topographic height from atm - -Purpose of changes ------------------- - -Runs with glc_mec require knowledge of the atmosphere's topographic height. Up -until now, this was specified via the flndtopo file for the three resolutions -that glc_mec can run at: f09, f19, T31. However, this has three problems: - -(1) It made it hard to extend glc_mec to run at other CLM resolutions - -(2) If CAM's topographic height changes (as it did recently), CLM would need to - have its flndtopo files updated to agree. - -(3) It assumes that datm's forcing heights match CAM's. - -In this tag, flndtopo has been removed, and CLM now gets the atmosphere's -topographic height from the atmosphere, via the coupler. References to flndtopo -/ ldomain%topo have been replaced with atm2lnd_inst%forc_topo_grc. - -For now, datm is set up to provide a topographic height that matches the old f09 -file - so offline (I compset) runs at f09 will be the same as before. But this -will soon change. - -Also removed fatmtopo, which was in the code in a few places but was no longer -being used. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- removed flndtopo file for CLM45/CLM5 - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): -- removed flndtopo file for CLM45/CLM5 - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - pass (both sets of tests) - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - 'ok' means pass except baseline comparison failures for IG tests, as noted - below - - Note that most hobart_nag tests are now in the expected fail list. The only - passing tests on hobart_nag are: - - SMS_D_Ld1_P24x1.f10_f10.ICRUCLM45.hobart_nag.clm-af_bias_v5 - SMS_Ld1_Mmpi-serial.f45_f45.ICLM45.hobart_nag.clm-ptsRLA - SMS_D_Ld1_Mmpi-serial.1x1_vancouverCAN.I1PTCLM50.hobart_nag.clm-default - SMS_Ld1.f45_f45.ICLM45.hobart_nag.clm-ptsRLA - SMS_D_Ld1_Mmpi-serial.1x1_vancouverCAN.I1PTCLM45.hobart_nag.clm-default - SMS_D_Ld1_P24x1.f10_f10.ICLM45BGC.hobart_nag.clm-oldhyd - ERS_D_Ld5_Mmpi-serial.1x1_mexicocityMEX.I1PTCLM45.hobart_nag.clm-default - SMS_D_Ld1_Mmpi-serial.f45_f45.ICLM45.hobart_nag.clm-ptsRLA - ERP_Ly5.1x1_numaIA.ICLM45BGCCROP.hobart_nag.clm-monthly - SMS_Ld1.1x1_mexicocityMEX.I1PT.hobart_nag.clm-40default - SMS_Ld5_P24x1.f10_f10.IRCP26CN.hobart_nag.clm-reduceOutput - SMS_D_Ld1.1x1_mexicocityMEX.I.hobart_nag - -CLM tag used for the baseline comparisons: clm4_5_6_r159 - compared - ERS_Ly3.f10_f10.I1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KSinkMOut - against baselines in directory clm4_5_r159 - - -Answer changes --------------- - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45/CLM5 with glc_mec (IG, FG, BG) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Potentially new climate. Magnitude of change depends on how different - atm's topography is from the flndtopo file that had been used before. - - For now, offline (IG) runs at f09 are the same as before, but all other - offline runs change. Runs coupled to CAM may be the same (or close to the - same), if CAM is using its old topography files, but will change for the - new CAM topography. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M components/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/doc/UsersGuide/preface.xml -M components/clm/doc/UsersGuide/adding_files.xml -M components/clm/doc/UsersGuide/single_point.xml -M components/clm/src/cpl/clm_cpl_indices.F90 -M components/clm/src/cpl/lnd_import_export.F90 -M components/clm/src/utils/domainMod.F90 -M components/clm/src/main/clm_initializeMod.F90 -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/surfrdMod.F90 - -========= Remove topo field that is defined but never set -M components/clm/src/main/histFileMod.F90 - -========= Add test to expected fail list; it seemed to pass for Erik, but fails - for me even out of a fresh checkout of clm4_5_6_r159: - ERP_Ly5.1x1_numaIA.ICRUCLM50BGCCROP.hobart_nag.clm-clm50BGCCROPmonthly -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r159 -Originator(s): erik (Erik Kluzek) -Date: Thu Dec 10 15:46:47 MST 2015 -One-line Summary: Update CIME version - -Purpose of changes ------------------- - -Update to very latest version of CIME, which we had held off doing -for two months. The main user change is that CIME no longer names -scripts with your CASENAME. - -This CIME version also updated PIO1 to PIO2 (pio2_0_27). These -early versions of PIO2 do have issues with potential hangs. See -bug 2256 below. As such we do not recommend use of this tag. Or -if you do and run into problems, do the workaround in the bug -report to move the PIO version to pio1_9_23. The behavior is that -after the simulation finishes it times out when writing history and -restart files. mpi-serial (single point) cases seem to work fine. - -Also fix two minor bugs. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): - - 2251 Bad NH max planting date of 6/31 - 2250 History filenames get truncated to 128 characters - -Bugs Introduced (include bugzilla ID): - - 2257 Unit tests fail in clm4_5_6_r159 - 2256 Problems with early versions of PIO2 in CLM - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users: CASE SCRIPTS NO LONGER NAMED $CASE.build, $CASE.run, $CASE.submit - - After ./create_newcase is run you have the scripts named: - ./case.build - ./case.run - ./case.submit - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New params file - -Substantial timing or memory changes: None - - -Code reviews and testing ------------------------- - -Code reviewed by: self, fvitt - -CLM testing: regular - - build-namelist tests: - - yellowstone - PASS - - (several comparision tests to clm4_5_6_r158 FAIL because of the new params - file) - - unit-tests (components/clm/src): - - yellowstone - FAIL - - tools-tests (components/clm/test/tools): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - - OK means failures are in the ExpectedFails list - -CLM tag used for the baseline comparisons: clm4_5_6_r158 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes (but just for two diagnostic cpl fields) - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change: diagnostic change - -atm topo field -For drydep TERPOOH (dd034) is different because of an update by Francis Vitt - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): cime to cime4.3.1 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - Increase max filename length from 128 to 199. -M components/clm/src/main/ncdio_pio.F90.in -- increase tmp_string to 199 -M components/clm/src/main/histFileMod.F90 --- max length filename - and max_chars to 199 and dimension locfnhr by max_length_filename - -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- new params file - change 631 max planting date for NH to 701 - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r158 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Dec 4 16:10:11 MST 2015 -One-line Summary: misc clm 5.0 bugfixes - -Purpose of changes ------------------- - -Misc. bugfixes for CLM 5.0 - - * LUNA bugfix to endrun if simulation goes out of range. - - * Restore ability to run SP simulations on nag. - - * String length bugfix from Jim Edwards. - - * New long clm50 kitchen sink test. - - * endrun if history filenames exceed maximum allowed length. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2209, 2213 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): - - CLM will now endrun if the generated history filename exceeds the - maximum allowed length. This will result in run time failures for - people running the test suite with the default or longer test ids. - - CLM 5.0 with LUNA will now endrun if nitrogen computations go - outside a valid range. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown, none expected - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40 - pass; 45 - ok - yellowstone_pgi - 40 - pass; 45 - pass - yellowstone_gnu (clm45 only) - 45 - pass - hobart_nag - ok - -CLM tag used for the baseline comparisons: clm4_5_6_r157 - - Notes: 'ok' means: - - * Fixing bug 2213 restores tests an hobart_nag. These tests BFAIL - because they don't have baselines. - - * r157 yellowstone baseline does not include clm history files for - two tests because of filename length issues: - - ERS_D_Ld3.f09_g16_gl5.IG1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KitchenSink - ERP_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-clm50BGCDVCROPmonthly - - * New test does not have baseline: - - ERS_Ly3.f10_f10.I1850CRUCLM50BGCCROP.yellowstone_intel.clm-clm50KSinkMOut - - -Answer changes --------------- - -Changes answers relative to baseline: bit for bit - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - new clm50 kitchen sink test with monthly output - clm/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut/include_user_mods - clm/cime_config/testdefs/testmods_dirs/clm/clm50KSinkMOut - -List all existing files that have been modified, and describe the changes: - - new clm50 compset w/o glc and test for longer kitchen sink test - clm/cime_config/config_compsets.xml - clm/cime_config/testdefs/testlist_clm.xml - - string length bugfix from Jim Edwards - clm/src/biogeochem/FireEmisFactorsMod.F90 - - runtime error if constructed history filename exceeds max length - clm/src/main/histFileMod.F90 - - bug 2209 - clm/src/biogeophys/LunaMod.F90 - runtime error if LUNA nitrogen computations become unrealistic - - bug 2213 - clm/src/biogeophys/PhotosynthesisMod.F90 - remove association of CN variable that may not be allocated for SP runs. - clm/src/biogeophys/CanopyFluxesMod.F90 - remove association of CN variable that may not be allocated for SP runs. - clm/cime_config/testdefs/ExpectedTestFails.xml - remove nag tests from xfails. - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r157 -Originator(s): sacks (Bill Sacks) -Date: Fri Nov 27 05:52:17 MST 2015 -One-line Summary: Reduce memory use for init_interp - -Purpose of changes ------------------- - -For high-resolution source files (e.g., f09 or higher), the new multilevel -interpolation was using unacceptable amounts of memory, since it was reading all -source points at all levels into memory at once - both for the actual data to -interpolate, and for the metadata used in the multilevel interpolators. - -This tag reworks how 2-d interpolation is done so that only one level from the -source is needed in memory at a time, thus greatly reducing memory use in some -cases. - -In making this change, I extracted routines to do 1-d interpolation. In doing -so, I made some minor changes to their behavior for consistency. The main change -was to remove special handling of inactive points: Inactive points used to have -their values set to spval, and I have now removed that logic, keeping inactive -points at their values before interpolation. This results in some NaNs appearing -in finidat_interp_dest (if values were NaN before interpolation); before spval -was put in all inactive points. - -Also, some unrelated changes: - -- Remove a duplicate and unused entry in config_component.xml (found by Jim - Edwards) - -- Remove redundant settings in CNZero (found by Dave Lawrence) - -- Fix cray compilation problems (found by Jim Edwards) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: -- Big memory decrease in some cases when using init_interp - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - -CLM tag used for the baseline comparisons: clm4_5_6_r156 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Extract interpolation routines so they can be called from a few - places. Note that I have changed the behavior slightly, in ways that - affect the produced restart file, but not a CLM run done with this - restart file. In particular, inactive points are no longer set to - spval. -A components/clm/src/init_interp/initInterp1dData.F90 - - -List all existing files that have been modified, and describe the changes: - -========= Rework multi-level interpolation in order to reduce memory use -M components/clm/src/init_interp/initInterp2dvar.F90.in -M components/clm/src/init_interp/initInterpMultilevelInterp.F90 -M components/clm/src/init_interp/initInterpMultilevelContainer.F90 -M components/clm/src/init_interp/initInterpMultilevelSnow.F90 -M components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf -M components/clm/src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf -M components/clm/src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 -M components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf -M components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf -M components/clm/src/init_interp/initInterpMultilevelBase.F90 -M components/clm/src/init_interp/initInterpMultilevelCopy.F90 -M components/clm/src/init_interp/initInterpMultilevelSplit.F90 -M components/clm/src/init_interp/initInterp.F90 - -========= Unrelated change: remove an entry that duplicates an entry in the - driver's config_component, and is unused here -M components/clm/cime_config/config_component.xml - -========= Unrelated change: remove redundant settings in CNZero -M components/clm/src/biogeochem/CNDriverMod.F90 - -========= Unrelated change: add helpful tip to output message -M components/clm/src/init_interp/initInterpMindist.F90 - -========= Unrelated change: add a comment -M components/clm/src/main/clm_varcon.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r156 -Originator(s): sacks (Bill Sacks) -Date: Tue Nov 24 10:19:07 MST 2015 -One-line Summary: Fix QSNWCPICE and glacial inception - -Purpose of changes ------------------- - -Previously, qflx_snwcp_ice_col (output to history file as QSNWCPICE) had served -two purposes: (1) the snow capping flux, which is used to specify surface mass -balance to GLC; and (2) the ice runoff flux, sent to ROF. However, these two -uses are not identical, which resulted in a number of problems. - -This tag separates these uses, so that qflx_snwcp_ice_col truly gives the snow -capping flux, and the ice runoff flux is derived separately (via two new -variables: qflx_ice_runoff_snwcp_col and qflx_ice_runoff_xs_col). - -This changes serves the following purposes: - -(1) QSNWCPICE becomes a useful history field, actually giving the amount of snow capping - -(2) Fixes snow balance check: bug 2238 - -(3) Fixes a problem where xs1 could initiate glacial inception, by contributing to qflx_glcice_frz - -(4) simplifies some logic in BalanceCheckMod - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): -- 2238: Possible bug involving qflx_snwcp_ice in BalanceCheckMod.F90 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - QSNWCPICE_TO_COUPLER history field renamed to QRUNOFF_ICE_TO_COUPLER - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: Leo van Kampenhout - -CLM testing: - - NOTE: most testing done on r75327 (prior to the workaround for the intel - compiler bug); after that, just ran: - ERP_Lm40.1x1_numaIA.ICRUCLM50BGCCROP.yellowstone_gnu.clm-clm50BGCCROPmonthly - (previously-failing test) - ERI_D_Ld9_P24x1.f10_f10.ICRUCLM50BGC.hobart_nag.clm-reduceOutput - (to run one nag test with the change) - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - 'ok' means tests pass, baseline comparisons fail as noted below - - Also BFAILs for: - BFAIL SMS_Ld5_D_P24x1.f10_f10.IHISTCLM45BGC.hobart_nag.clm-clm50BGCmonthly.GC.1123-1949.45.n.nlcomp - BFAIL ERP_Ly5.1x1_numaIA.ICRUCLM50BGCCROP.hobart_nag.clm-clm50BGCCROPmonthly.GC.1123-1949.45.n.nlcomp - - And for the newly-passing: - ERP_Lm40.1x1_numaIA.ICRUCLM50BGCCROP.yellowstone_gnu.clm-clm50BGCCROPmonthly - -CLM tag used for the baseline comparisons: clm4_5_6_r155 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: diagnostic changes for all CLM45/CLM50; - significant changes for IG compsets with CLM45/CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Changes for IG compsets are potentially climate changing - - Changes in non-IG compsets are in the following three fields: - - QSNWCPICE - - ERRH2OSNO - - SNOW_SINKS (roundoff-level) - - Bigger changes in IG compsets are due to no longer including the xs1 term in - qice (SMB) sent to GLC. Of the tests in the test suite, this was just - observed for SMS_Lm37.T31_g37_gl5.IG1850CLM45.yellowstone_intel.clm-glcMEC_long. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/main/lnd2atmType.F90 -M components/clm/src/main/lnd2atmMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 - - also add dtime multiplier for some log message output - -========= Unrelated change: workaround for intel compiler bug -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 - -========= Unrelated change: edit ChangeLog entry for clm4_5_6_r153 -M ChangeLog -M components/clm/doc/ChangeLog - - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r155 -Originator(s): erik (Erik Kluzek) -Date: etl xim 23 1:11:04 carra MST 2015 -One-line Summary: Bring FUN (Fixation and Uptake of Nitrogen) code option to trunk from Mingjie, - as well as latitude varying spinup from Charlie, and a fix for crop with dynamic - roots from Beth - -Purpose of changes ------------------- - -FUN Model (Fixation and Uptake of Nitrogen): Mingjie Shi, Josh Fisher, - and implmentation changes from Rosie Fisher - - FUN is the Fixation and Uptake of Nitrogen, and is designed to extract N from numerous - sources (fixation, active uptake, retranslocation) in proportion to the inverse of the - cost of uptake in term of C spent per unit N acquired. - - The FUN model developed by Fisher et al. 2010 and end Brzostek et al. 2014. Coded by Mingjie Shi 2015. - Coding logic and structure altered by Rosie Fisher. October 2015. - Critically, this removes the 'FUN-resistors' idea of Brzostek et al. 2014 - and replaces it with uptake that is proportional to the N/C exchange rate. - and adjusts the logic so that FUN does not depends upon the CLM4.0 'FPG' downregulation idea - and instead it takes C spent on N uptake away from growth. - The critical output so fthis code are sminn_to_plant_fun and npp_Nuptake, which are the N - available to the plant for growth, and the C spent on obtaining it. - - When FUN is on and flex-CN is on, do NOT do the burn off of excess Carbon. - - Add in Kyla's rainfall trigger for stress decidious when FUN is on. - - Call FUN in the middle of SoilBiogeochemCompetition. Split CNPhenology into - two sections for FUN. Get N available from N in NutrientCompetetion. Add - annual average ET needed for CNFreeLivingFixation which is used in place - of CNNFixation when FUN on. - -Dynamic Roots bug fix: Beth Drewniak - - Initialize huigrain to zero (rather than nan). And add a check for huigrain non zero - to prevent a divide by zero. - -BGC Spinup Changes: Charlie Koven - - Add a latitude dependent factor for accellerated decomposition spinup that is - about 1 at the equator goes to 26 at 60 degree's latitude (south and north) - and then about 50 at the poles. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2237 - 2237 (dynamic root code divides by 0) - -Known bugs introduced in this tag (include bugzilla ID): 2249 - 2249 Simulations have low LAI in the amazon with FUN and Luna on - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): - LAI is low in Amazon (see bug 2249) - FUN requires use_nitrif_denitrif to be on. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): new CLM namelist variables - Add br_root (maintenence respiration for roots) - And leaf_mr_vcm (Scalar of leaf respiration to vcmax) - And use_fun logical to turn the FUN model on - -Changes made to namelist defaults (e.g., changed parameter values): - For CLM50 set leaf_mr_vcm to 0.032 (from Atkin 2015) - For CLM50 with FUN on br_root=2.525e-06 - -Changes to the datasets (e.g., parameter, surface or initial files): - New params files with FUN parameters on them - -Substantial timing or memory changes: Slower with FUN - Will notices that simulations with FUN are slower - (there are optimization issues that I saw that could be worked on) - -Code reviews and testing ------------------------- - -Code reviewed by: self, rfisher, koven, drewniak - -CLM testing: - - build-namelist tests: - - yellowstone - PASS - - unit-tests (components/clm/src): - - yellowstone - PASS - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -OK, means tests PASS or only expected fails do not. -SSP comparision tests FAIL for CLM50, since spinup changes - - -CLM tag used for the baseline comparisons: clm4_5_6_r154 - - -Answer changes --------------- - -Changes answers relative to baseline: No - - Except when spinup on, or when FUN turned on. - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: - -=========== Remove flexibleCN test directory and add one for flexCN and FUN -D components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN -D components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN/include_user_mods - -List all files added and what they do: - -=========== Add new tests -=========== NOTE: clm50* tests can be used with CLM45 compsets to create new CLM50 configurations -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCDVCROPmonthly/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCDVCROPmonthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCDVCROPmonthly -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexCN_FUN -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN -A components/clm/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/noFUN_flexCN -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCCROPmonthly/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCCROPmonthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCCROPmonthly -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCmonthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCmonthly/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/clm50BGCmonthly - -=========== Add unit test for AC spinup -A components/clm/src/soilbiogeochem/CMakeLists.txt -A components/clm/src/soilbiogeochem/test/CMakeLists.txt -A components/clm/src/soilbiogeochem/test/ACSpinup_test/test_acspinup.pf -A components/clm/src/soilbiogeochem/test/ACSpinup_test/CMakeLists.txt -A components/clm/src/soilbiogeochem/test/ACSpinup_test -A components/clm/src/soilbiogeochem/test - -=========== New FUN module -A components/clm/src/biogeochem/CNFUNMod.F90 - -List all existing files that have been modified, and describe the changes: - -M components/clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - Remove - fsurdat, new finidat file, turn: luna, flex-CN, dynroots, and FUN on, - for interpolation fill missing with bare ground, limit_lake_evap to false - set leaf_mr_vcm to 0.015 -M components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm - turn dynroots on - -M components/clm/bld/namelist_files/namelist_definition.xsl ------- Update to work again -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -- New params file with FUN parameters - c151024 and ED.c151023, turn dynroots off for bgc, add phys version to finidat, set use_fun - br_root, leaf_mr_vcm -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml Add br_root, leaf_mr_vcm, use_fun -M components/clm/bld/CLMBuildNamelist.pm -------------------------- Handle cnmresp_inparm, - clm_canopy_inparm, send phys for finidat -M components/clm/bld/unit_testers/build-namelist_test.pl ---------- Add tests for fun w/o CN, - or w/o nitrif_denitrif, or flexCN w/o CN - -M components/clm/cime_config/config_compsets.xml - Change IGCRUCLM50BGCCROP to IG1850CRUCLM50BGCCROP - add IG1850CRUCLM50BGC - -M components/clm/cime_config/testdefs/testlist_clm.xml ---- Add new tests (noFUN_flexCN, flexCN_FUN, - ciso_flexCN_FUN, clm50KitchenSink w/o crop, clm50BGCDVCROPmonthly, transient clm50BGC, - and new CROP-off clm50KitchenSink test add luna test on hobart, ICRUCLM50BGCCROP tests - use clm50BGCCROPmonthly test-mods (with dynroots on, so change answers) -M components/clm/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm - Turn flexCN on -M components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm - Turn dynroot on - (so these tests change answers) - -M components/clm/src/ED/fire/SFMainMod.F90 - Comment from Rosie - -M components/clm/src/biogeophys/WaterfluxType.F90 --- Add running annual mean of ET when FUN is on -M components/clm/src/biogeophys/BalanceCheckMod.F90 - Increase tolerance for snow balance check (see bug 2238) -M components/clm/src/biogeophys/LunaMod.F90 --------- Make 0.015 constant a parameter - (later should use parameter in CanopyStateMod) -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - Use leaf_mr_vcm constant from canopystate_ins - Remove (.not.use_cn) for recalculation of lmr25 when luna on, for natural C3 veg (see bug 2249) -M components/clm/src/biogeophys/CanopyStateType.F90 - Make parameter for leaf_mr_vcm, add ReadNML sub - -M components/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 ---- Call FUN module -M components/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 When FUN on, do not - do precision control of low values for no3 and nh4 -M components/clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 -- Increase transport by - same factor as spinup acceleration by latitude -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 ----- Add soilc_change_col -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 ---- Take into account latitude - varying spinup acceleration for exit and enter spinup states -M components/clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 ---------- Add function for increase - of spinup acceleration by latitude -M components/clm/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 --- For FUN N deposition and fixation put into NH4 - use FUN version of sminn_to_plant_fun - -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 --- Add several FUN nitrogen fixation - terms: ffix_to_sminn_col, ffix_to_sminn_col, sminn_to_plant_fun_no3_vr_col, - sminn_to_plant_fun_nh4_vr_col, sminn_to_plant_fun_vr_col -M components/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 Changes from Charlie to make - spinup acceleration higher as latitude increases. -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 -- decomp_npools_vr depends - on spinup state and depends on latitude. - -M components/clm/src/CMakeLists.txt - Add soilbiogeochem directory for unit tests - -M components/clm/src/biogeochem/CNBalanceCheckMod.F90 --------- Add cbalance warning, for FUN - add in free living fixation, decrease n-balance error from e-8 to e-6, add nbalance warn -M components/clm/src/biogeochem/CNVegStateType.F90 ------------ Init huigrain to zero, add leafcn_offset - and plantCN for FUN -M components/clm/src/biogeochem/CNMRespMod.F90 ---------------- Add CNMRespReadNML, br_root -M components/clm/src/biogeochem/CNVegNitrogenStateType.F90 ---- Add leafn_storage_xfer_acc and - storage_ndemand for FUN, change two conditionals on spinup_state/restart_spinup_state - to include 0 AND 1 -MM components/clm/src/biogeochem/CNRootDynMod.F90 -------------- Only update root_depth if huigrain>0 -M components/clm/src/biogeochem/CNPhenologyMod.F90 ------------ Add phase to CNPhenology (divides - into two parts, needed for FUN), add Kyla's rainfall trigger (ONLY when FUN on) - other changes when FUN on -M components/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -------- Add carbon spent on uptake respiration -M components/clm/src/biogeochem/CNSharedParamsMod.F90 --------- Add use_fun -M components/clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 If FUN on get N available from FUN - turn off some sections when fun on -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 ----------- Changes for spinup from Charlie -M components/clm/src/biogeochem/CNNDynamicsMod.F90 ------------ Add CNFreeLivingFixation subroutine - set ndep_to_sminn to zero for FUN -M components/clm/src/biogeochem/CNVegNitrogenFluxType.F90 ----- Add N demand and aquired arrays for FUN -M components/clm/src/biogeochem/CNDriverMod.F90 --------------- If FUN on call CNFreeLivingFixation - rather than CNNFixation. If FUN on split CNPhenology into two segments -M components/clm/src/biogeochem/CNC14DecayMod.F90 ------------- Speed up radioactive decay by lat factor -M components/clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 Changes for FUN. Burning off option - not used for FUN, for FUN, growth respiration is not part of the allometry calculation -M components/clm/src/biogeochem/CNVegCarbonFluxType.F90 ------- Carbon flux fields for FUN -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 ------ Add leafc_storage_xfer_acc and - storage_cdemand for FUN, change some spinup state if statements from Charlie - -MM components/clm/src/main/clm_initializeMod.F90 - Call clm_instReadNML and waterflux_inst%initAccVar -MM components/clm/src/main/clm_varcon.F90 -------- Add fun_period and small_value for FUN -M components/clm/src/main/pftconMod.F90 --------- Add FUN pft-varying parameters -M components/clm/src/main/clm_instMod.F90 ------- Add clm_instReadNML for namelists, calls - canopystate_inst%ReadNML, add waterflux_inst%InitAccBuffer -M components/clm/src/main/readParamsMod.F90 ----- Add readCNFUNParams -MM components/clm/src/main/controlMod.F90 -------- Set use_fun and call CNMRespReadNML -M components/clm/src/main/clm_driver.F90 -------- Call waterflux_inst%UpdateAccVars - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r154 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Wed Nov 18 16:35:53 MST 2015 -One-line Summary: one year grain product pool - -Purpose of changes ------------------- - - Introduce logic to have the harvested grain products decay over the - course of one year. This is distinct from previous versions, in - which the grain products decayed immediately. Including the one-year - decay time changes soil carbon and nitrogen pools, and is on by - default in the CLM5 crop model. (Danica Lombardozzi, Dave Lawrence) - - Add temporary test for all the clm50 functionality being used in the - preliminary cesm2 coupled run: - - ERS_D_Ld3.f09_g16_gl5.IGCRUCLM50BGCCROP.yellowstone_intel.clm-clm50KitchenSink - - Note: Because of the brittle situation with the surface - datasets/initial conditions files being inconsistent, we had to use - the f09 grid for this test. The run length was kept short to keep - the wall clock time ~30 min. This is too short exercise some new - clm50 functionality, e.g. one year grain product pool. - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - - New namelist variables: use_fertilizer, use_grainproduct - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown, none expected - - -Code reviews and testing ------------------------- - -Code reviewed by: Lombardozzi, Sacks - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 4.0 pass; 4.5 ok - yellowstone_pgi - 4.0 pass; 4.5 ok - yellowstone_gnu (clm45 only) - 4.5 ok - hobart_nag - 4.5 ok - - 'ok' means: all tests passed functionality and baseline - comparisons. only nlcomp failures. new test did not have a - baseline. - - Note: Grain product pool is active by default for clm50 with crops, - and will change answers. None of the tests are affected because they - do not run long enough to trigger the new code. - -CLM tag used for the baseline comparisons: clm4_5_6_r153 - - -Answer changes --------------- - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm50-crop - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - expected to be larger than roundoff, same climate. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - test mods for new test - clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/clm50KitchenSink/include_user_mods - -List all existing files that have been modified, and describe the changes: - - one year grain product pool - clm/src/biogeochem/CNPhenologyMod.F90 - fertilizer switch - clm/src/biogeochem/CNVegNitrogenFluxType.F90 - clm/src/biogeochem/CNDriverMod.F90 - clm/src/biogeochem/CNVegCarbonFluxType.F90 - clm/src/biogeochem/CNVegCarbonStateType.F90 - clm/src/biogeochem/CNVegNitrogenStateType.F90 - clm/src/biogeochem/CNWoodProductsMod.F90 - - new namelist/control variables for fertilizer and grain product pool - clm/src/main/clm_varctl.F90 - clm/src/main/controlMod.F90 - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - clm/bld/CLMBuildNamelist.pm - - new test - clm/cime_config/config_compsets.xml - clm/cime_config/testdefs/testlist_clm.xml - - -=============================================================== -=============================================================== -Tag name: clm4_5_6_r153 -Originator(s): Sean Swenson, Bill Sacks -Date: Tue Nov 17 06:01:47 MST 2015 -One-line Summary: Fix snow cover fraction bug - -Purpose of changes ------------------- - -The fix for infinite snow growth made in clm4_5_3_r144 turned out to have a bug -of its own: It made snow cover fraction rarely reach ~ 1, instead maxing out -around 0.8 or 0.9. - -This tag fixes the snow cover fraction bug while still (it appears) preventing -infinite snow growth. - -This results in a potentially large change in model behavior, so the version -number is bumped from clm4_5_5 to clm4_5_6. However, this is mainly due to -backing out some of the (buggy) changes that were put in place in -clm4_5_3_r144. That is, if the changes in this new tag were made on top of -clm4_5_3_r143, the differences would likely be relatively small. - -Changes made by Sean Swenson, brought to trunk by Bill Sacks. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: Bill Sacks - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - 'ok' means: tests pass, but answers change for CLM45 / CLM50 cases - -CLM tag used for the baseline comparisons: clm4_5_5_r152 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45 / CLM50 cases - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - New climate - - Main changes are due to backing out some of the (buggy) changes that were - put in place in clm4_5_3_r144. That is, if the changes in this new tag - were made on top of clm4_5_3_r143, the differences would likely be - relatively small. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes. The change to CanopyHydrologyMod backs out a change that - was made in r144. The change to SnowHydrologyMod is new. -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Unrelated change: get rid of a write statement that was resulting in - lots of messages to the log file -M components/clm/src/biogeophys/SoilHydrologyMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_5_r152 -Originator(s): sacks (Bill Sacks) -Date: Tue Nov 17 05:22:58 MST 2015 -One-line Summary: Fix glc_mec energy conservation bug - -Purpose of changes ------------------- - -Fix an energy conservation bug that appears when running glc_mec (i.e., in runs -with CISM). Energy loss due to ice melt was essentially being double-counted: -First, all snow capping was being sent as ice runoff, and thus melted by the -ocean; in addition, glacier ice melt removed energy from CLM. This removal of -energy due to both accumulation (snow capping) and melt amounts to -double-counting. - -This is fixed by: For each unit of ice melt, remove one unit of ice runoff -(possibly resulting in negative ice runoff), adding one unit of liquid -runoff. You can think of this as: each unit of ice melt indicates one unit of -snow capping that should not have made it to the ocean, but instead melted en -route. - -Note that we currently adjust qflx_snwcp_ice in order to achieve this ice runoff -adjustment. This affects the QSNWCPICE history field. (In an upcoming tag, I -plan to return qflx_snwcp_ice to its original values (i.e., truly indicating -snow capping), by introducing a new field that explicitly gives ice runoff.) - -This tag also fixes a minor bug in the calculation of negative runoff for -glc_mec columns with glc_dyn_runoff_routing=T. In addition, it reorders some -code in HydrologyDrainageMod in order to remove some complexity. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - pass - - 'ok' means: pass except for baseline failures in IG tests (IG compsets plus - ICLM45GLCMEC) - - Also, unexpected baseline failures in the following tests; however, these - same baseline failures were observed when comparing a fresh checkout of r151 - against the r150 baselines (this new branch is bit-for-bit with a fresh - checkout of r151 for these tests): - - NCK_Ld5.f10_f10.I.yellowstone_pgi.clm-40default - RMS x2l_Flrr_volr 8.8324E-18 NORMALIZED 2.2700E-15 - RMS x2l_Flrr_volrmch 8.8324E-18 NORMALIZED 2.2700E-15 - - SMS_D_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_pgi.clm-default - SMS_Ld5.f19_g16.IRCP45CLM45BGC.yellowstone_pgi.clm-decStart - FILLDIFF topo - - NCK_Ld1.f10_f10.ICRUCLM45.yellowstone_intel.clm-default - RMS VOLR 8.9604E-05 NORMALIZED 1.2335E-14 - RMS VOLRMCH 8.9604E-05 NORMALIZED 1.2335E-14 - RMS x2l_Flrr_volr 2.8268E-17 NORMALIZED 6.8542E-15 - RMS x2l_Flrr_volrmch 2.8268E-17 NORMALIZED 6.8542E-15 - -CLM tag used for the baseline comparisons: clm4_5_4_r151 (baseline directory -named clm4_5_4_r150) - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All IG compsets (compsets with CISM / glc_mec) - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Likely new climate - - For each unit of glacier melt, there is an extra unit of liquid runoff, - and one unit less of ice runoff. - - This results in changes in the following CLM history fields: ERRH2O, - ERRH2OSNO, QRGWL, QRUNOFF, QRUNOFF_TO_COUPLER, QSNWCPICE, - QSNWCPICE_TO_COUPLER, TWS, VOLR, VOLRMCH - - And the following changes in l2x cpl hist fields: l2x_Flrl_rofdto, - l2x_Flrl_rofgwl, l2x_Flrl_rofi - - There are also changes in the consequent x2r, r2x and x2l cpl hist fields. - - I did one test run to confirm that the differences in (l2x_Flrl_rofdto + - l2x_Flrl_rofgwl) exactly balanced the differences in l2x_Flrl_rofi. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 - -========= Unrelated change: just change a comment -M components/clm/src/main/clm_instMod.F90 - -=============================================================== -=============================================================== -Tag name: clm4_5_4_r151 -Originator(s): erik (Erik Kluzek) -Date: Fri Nov 13 15:50:58 MST 2015 -One-line Summary: Fix broken r150 tag, with bgc_spinup issue in it - -Purpose of changes ------------------- - -Backout changes to -bgc_spinup in CLM build-namelist should NOT -have been committed. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2245 - 2245 setup doesn't work, because of issue iwth -bgc_spinup - -Notes of particular relevance for users None ---------------------------------------- - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: None! (but this is the same as what was actually tested for clm4_5_4_r150) - -CLM tag used for the baseline comparisons: clm4_5_4_r150 - - -Answer changes --------------- - -Changes answers relative to baseline: No - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - ->>>>>>> Remove non-working on-accell option to -bgc_spinup to namelist -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_4_r150 -Originator(s): erik (Erik Kluzek) -Date: Fri Nov 13 13:42:39 MST 2015 -One-line Summary: Some needed answer changing fixes for: fire, disallow negative photosynthis, - and reduce LAI of DBT in evergreen state - -Purpose of changes ------------------- - -Add in changes to fire fluxes for deadstem (both clm4_5 and clm5_0). Don't allow -photosynthis to be less than zero. Reduce the Leaf Area Index (LAI) of Deciduous -Broadleaf Tree (DBT) when in an evergreen state (warm enough that all of the leaves never -all fall off) by taking into account leaf longevity and only allowing the amount of -leaf or fine root Carbon storage transfered to be more than the amount of remaining leaf -or fine root Carbon (would be zero unless in an evergreen state). Previously, DBT in -evergreen state would have unrealistically high LAI, that would then cause them to take up -too much water and then kill the trees. So they had an unrealistic cycle for trees that are -supposed to be in an evergreen state. - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2242, 2243, and 2244 - 2244 Change to reduce leaf area of DBT in evergreen state (rfisher) - 2243 Deadstem not taken into account in fire-fluxes for clm4_5 (koven) - 2242 Disallow negative photosynthis (olesen and bonan) - -Known bugs introduced in this tag (include bugzilla ID): 2245 - 2245 setup doesn't work, because of issue iwth -bgc_spinup - -Notes of particular relevance for users None ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - - -Code reviews and testing ------------------------- - -Code reviewed by: self, koven, rfisher, oleson - -CLM testing: - - build-namelist tests: - - yellowstone - yes - - unit-tests (components/clm/src): - - yellowstone - yes - - tools-tests (components/clm/test/tools): - - yellowstone - no - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - no - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - yes - yellowstone_pgi - yes - yellowstone_gnu (clm45 only) - yes - hobart_nag - yes - -CLM tag used for the baseline comparisons: clm4_5_3_r149 - - -Answer changes --------------- - -Changes answers relative to baseline: - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: similar climate - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeochem/CNFireLi2014Mod.F90 --- Deal with deadstem for fire fluxes -M components/clm/src/biogeochem/CNFireLi2016Mod.F90 --- Deal with deadstem for fire fluxes -M components/clm/src/biogeochem/CNPhenologyMod.F90 ---- In CNStressDecidPhenology take into - account leaf longevity in lgsf, lower leaf and froot Carbon storage to transfer, by - the leaf and froot Carbon -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - Make ag max of zero or calculated value - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r149 -Originator(s): sacks (Bill Sacks) -Date: Sun Nov 8 12:41:59 MST 2015 -One-line Summary: Change cold start initialization of snow pack - -Purpose of changes ------------------- - -Change cold start initialization of snow pack to lead to fewer instances where -cold start conditions negatively impact the simulation for long periods. Main -change is to make initial snow pack over glacier and high-latitude vegetation -much smaller. - -Also make istice consistent with istice_mec. - -New method developed in conjunction with Jan Lenaerts, Leo van Kampenhout, and -Dave Lawrence. - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone - NOT RUN - - unit-tests (components/clm/src): - - yellowstone - OK - - tools-tests (components/clm/test/tools): - - yellowstone - NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - OK - yellowstone_pgi - OK - yellowstone_gnu (clm45 only) - OK - hobart_nag - OK - -CLM tag used for the baseline comparisons: clm4_5_3_r148 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45/CLM5 cold start runs - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; not investigated carefully - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/main/clm_instMod.F90 - -========= Add a comment in changelog entry for clm4_5_3_r148 -M ChangeLog -M components/clm/doc/ChangeLog - -========= Minor tweak to template -M .ChangeLog_template - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r148 -Originator(s): sacks (Bill Sacks) -Date: Sat Nov 7 06:41:25 MST 2015 -One-line Summary: For CLM5, increase max snow depth to 20 m - -Purpose of changes ------------------- - -Change CLM5 snow defaults: - -- h2osno_max = 20m rather than 1m - -- nlevsno = 12 rather than 5 - -- glc_snow_persistence_max_days = 0 rather than 7300 (this is just used for - modeling glacial inception when coupled to CISM) - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): - - For CLM5 cases, need to run initial conditions through init_interp, because - of the change in nlevsno. See caveats under clm4_5_3_r146 before doing so. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): - -- h2osno_max = 20m rather than 1m - -- nlevsno = 12 rather than 5 - -- glc_snow_persistence_max_days = 0 rather than 7300 (this is just used for - modeling glacial inception when coupled to CISM) - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: - - This change will lead to some memory increase, and some increase in timing, - due to having more snow layers. I have not investigated this closely. The - tputcomp tests all passed, but these are not very meaningful - in part - because there likely weren't any grid cells with substantially more than 5 - layers in these test runs. - - -Code reviews and testing ------------------------- - -Code reviewed by: self - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: NOT RUN - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r147 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM5 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff, likely new climate in some regions - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: - - Some runs documented here: - https://docs.google.com/document/d/1Y5kCwa0GUnQ0hy7vNwvtFOKaC3ikysfLXdcNVqRygok/edit - - URL for LMWG diagnostics output used to validate new climate: - - http://www.staff.science.uu.nl/~kampe004/lnd_diag/tr_eraimod_5_cap-tr_eraimod_12_cap/setsIndex.html - - note that this uses 10m snow pack rather than 20m - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Change namelist defaults, as listed above -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Add documentation -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r147 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Nov 5 21:51:53 MST 2015 -One-line Summary: swenson bedrock and coupler runoff bugfixes - -Purpose of changes ------------------- - - Science bugfixs from Sean Swenson for bedrock and coupler runoff fields. - - The bugfix for bedrock corrects an issue where running with debug - flags and bedrock on would generate floating point errors or - unreproducible behavior when run with a surface data set that - contained bedrock data. - - coupler runoff fields bugfix: splitting of runoff for mosart did - not contain all surface and subsurface fields. surface runoff is - the sum of qflx_over, qflx_h2osfc_surf, and qflx_irrig. subsurface - runoff is the sum of qflx_drain and qflx_perched_drain - - Add cropColdStart test mods directory missing from r145. - - -Bugs fixed or introduced ------------------------- - -Bugs fixed (include bugzilla ID): 2241 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through -init_interp): - use_bedrock is still not true by default because we do - not have a fully consistent set of surface data sets and initial - conditions for testing. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: unknown, none expected - - -Code reviews and testing ------------------------- - -Code reviewed by: Swenson, Andre - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40 pass; 45 ok - yellowstone_pgi - 40 pass; 45 ok - yellowstone_gnu (clm45 only) - 45 ok - hobart_nag - ok - - 'ok' means - all clm45/50 compsets have only the 'baseline compare' - answer changing failures. Fields described below. - - test BFAIL ERP_D_P15x2_Ld3.f10_f10.ICRUCLM50BGCCROP.yellowstone_intel.clm-cropColdStart because baseline is not in r146. - -CLM tag used for the baseline comparisons: clm4_5_3_r146 - - -Answer changes --------------- - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm45/clm50 - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff - - All clm45 and clm50 compsets will have answer changes in the clm - and coupler history files because of changes to the runoff passed - from clm to the coupler. Only the following fields have changed: - - clm: TWS, VOLRMCH, VOLR - - cpl: l2x_Flrl_rofgwl, x2r_Flrl_rofsub, x2r_Flrl_rofsur, - r2x_Flrr_volrmch, r2x_Flrr_volr, r2x_Forr_rofl, x2l_Flrr_volrmch, - x2l_Flrr_volr, l2x_Flrl_rofsub, l2x_Flrl_rofsur, x2r_Flrl_rofgwl - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - Add missing cropColdStart test mods - clm/cime_config/testdefs/testmods_dirs/clm/cropColdStart/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/cropColdStart/include_user_mods - clm/cime_config/testdefs/testmods_dirs/clm/cropColdStart - -List all existing files that have been modified, and describe the changes: - - Bedrock bug fix, initialize and size arrays correctly. - clm/src/biogeophys/SoilWaterMovementMod.F90 - - Remove expected failure from missing test mods: - clm/cime_config/testdefs/ExpectedTestFails.xml - - Coupler runoff bugfix: - clm/src/cpl/lnd_import_export.F90 - clm/src/main/lnd2atmType.F90 - clm/src/main/clm_driver.F90 - clm/src/main/lnd2atmMod.F90 - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r146 -Originator(s): sacks (Bill Sacks) -Date: Wed Nov 4 06:48:41 MST 2015 -One-line Summary: Implement vertical interpolation in init_interp - -Purpose of changes ------------------- - -The major requirements this addresses are: - -(1) Handle changes in the vertical discretization of the soil column, - including changing the number of layers and/or changing the depth of layers. - -(2) Handle changes in which soil layers are considered bedrock vs. "standard" - soil: Information from bedrock layers should not be transmitted to soil - layers, and vice versa. - -(3) Handle changing number of snow layers - -There was previously-existing code to handle (1). However, while it was mostly -right, it was hard-coded to just handle the interpolation from "standard" -vertical levels to "more_vertlevels". And there were a number of special cases -that it mis-handled (such as urban points, which have a different vertical -discretization; also, spvals were not handled correctly). It was also going to -be hard to fit requirements #2 and #3 into the old code. So I removed the old -code and replaced it with a new, object-oriented design. - -Because the number of files involved in init_interp has now grown significantly, -I have moved this code to a new directory (src/init_interp). - -As part of the handling of vertical interpolation, I needed to fix a few -inconsistencies in the use of spval in some multi-level fields (see below for -details). - -Finally, to aid with testing of this new code, and because it is useful in -general, Sean Swenson added nbedrock to the first history file of a run. - - -Bugs fixed or introduced ------------------------- - -Known bugs introduced in this tag (include bugzilla ID): [If none, remove this line] -- 2239: need new initial conditions files with extra metadata on them - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to run initial conditions through init_interp): - -- If you want to use init_interp on an initial conditions file generated prior - to this tag, you will need to first get some new metadata onto your initial - conditions file: COL_Z, LEVGRND_CLASS, COL_Z_p and LEVGRND_CLASS_p. You have - two options for how to do this: - - (1) Run the model for a short time using this tag, with a configuration that - matches the source file, using the source file as finidat (with - use_init_interp = .false.), in order to produce a new restart file with - the necessary metadata. Then use that new file as the finidat file for - init_interp. - - (2) If that is not possible, then an alternative is to run the model for a - short time using this tag, with cold start initial conditions (finidat = " "). - Then use a tool like ncks to copy the misssing fields onto the original source - finidat file. Then use that patched file as the finidat file for - init_interp. CAUTION: A bug in the netcdf library means that adding fields - using ncks can result in data corruption of existing fields. I have - observed this in the plant_nalloc field, which fortunately does not seem - to be needed at all on the restart file. However, if you use this method, - you should compare the old and new files to ensure that nothing other than - plant_nalloc has been changed. - - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): - Some new initial conditions files: same as old, but with metadata needed for - running them through init_interp - -Substantial timing or memory changes: none - - -Code reviews and testing ------------------------- - -Code reviewed by: self; CLM-CMT plans to do a more detailed review later - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: ok - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r145 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 / CLM50 runs that use init_interp to - interpolate to a different resolution - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; not investigated closely - - Changes arise from the fact that multi-level points are now interpolated - rather than copied from the input to the output. This changes results for - urban points, where the vertical level structure of walls and rooves varies - from gridcell to gridcell. - - There are also FILLDIFFs in SOILLIQ and SOILICE in vector (dov2xy = .false.) - history files, due to a bug fix in the treatment of spval for these - variables. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Moved to new directory for init_interp code -D components/clm/src/main/initInterpMindist.F90 -D components/clm/src/main/initInterp.F90 -D components/clm/src/main/test/initInterpMindist_test/CMakeLists.txt -D components/clm/src/main/test/initInterpMindist_test/test_init_interp_mindist.pf -D components/clm/src/main/test/initInterpMindist_test - -List all files added and what they do: - -========= Added new directory for init_interp code, populated with files that - used to be in main -A components/clm/src/init_interp -A components/clm/src/init_interp/initInterpMindist.F90 -A components/clm/src/init_interp/CMakeLists.txt -A components/clm/src/init_interp/test/initInterpMindist_test/CMakeLists.txt -A components/clm/src/init_interp/test/initInterpMindist_test/test_init_interp_mindist.pf -A components/clm/src/init_interp/test/initInterpMindist_test -A components/clm/src/init_interp/test - -========= Main changes needed for vertical interpolation -A components/clm/src/init_interp/initInterpMultilevelBase.F90 -A components/clm/src/init_interp/initInterpMultilevelCopy.F90 -A components/clm/src/init_interp/initInterpMultilevelInterp.F90 -A components/clm/src/init_interp/initInterpMultilevelSnow.F90 -A components/clm/src/init_interp/initInterpMultilevelSplit.F90 -A components/clm/src/init_interp/initInterpMultilevelContainer.F90 -A components/clm/src/init_interp/initInterp.F90 -A components/clm/src/init_interp/initInterp2dvar.F90.in -A components/clm/src/init_interp/initInterpBounds.F90 - -========= Wrappers to transpose and pack that handle allocation for you (needed - for pgi) -A components/clm/src/utils/array_utils.F90.in - -========= Put unit tests around the parts of the vertical interpolation that - have significant logic -A components/clm/src/init_interp/test/CMakeLists.txt -A components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf -A components/clm/src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf -A components/clm/src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 -A components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf -A components/clm/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf -A components/clm/src/init_interp/test/initInterpMultilevel_test/CMakeLists.txt -A components/clm/src/init_interp/test/initInterpMultilevel_test - -========= Allow vrtlay tests to use init_interp -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay_interp - -========= Add a CLM5 crop test that uses init_interp (init_interp is needed for - CLM5 cases with non-cold-start initial conditions) -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonth_interp - -List all existing files that have been modified, and describe the changes: - -========= Added new directory for init_interp code -M components/clm/bld/configure -M components/clm/src/CMakeLists.txt -M components/clm/src/main/test/CMakeLists.txt - -========= Added new metadata to restart file that is needed for the vertical interpolation -M components/clm/src/main/initVerticalMod.F90 -M components/clm/src/main/subgridRestMod.F90 -M components/clm/src/main/ColumnType.F90 -M components/clm/src/main/column_varcon.F90 -M components/clm/src/main/filterMod.F90 -M components/clm/src/utils/restUtilMod.F90.in - -========= New routines used to add metadata to restart file and to read - variables in init_interp -M components/clm/src/main/ncdio_pio.F90.in - -========= Remove unnecessary use of spval (the vertical interpolation was not - handling this use of spval correctly, because it is inconsistent with - other uses of spval in the code; it turns out this use of spval wasn't - necessary to begin with) -M components/clm/src/biogeochem/ch4Mod.F90 -M components/clm/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 - -========= Fix bug: calculations were being done on spval, leading to values of - 1e75 on the restart file (this was causing problems with the new - vertical interpolation) -M components/clm/src/biogeophys/WaterStateType.F90 - -========= Added new necessary metadata to any initial conditions file that is - used for init_interp testing. I have NOT taken the time to do this for - other out-of-the-box initial conditions, figuring that they'll be - replaced soon anyway. (Any file generated with the new tag will have - the necassary metadata on it.) -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm - -========= Tangentially-related change: add nbedrock to first history file - (changes from Sean Swenson) -M components/clm/src/main/GridcellType.F90 -M components/clm/src/main/histFileMod.F90 - -========= Totally unrelated change: add a comment -M components/clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 - -========= Added another system test of init_interp, and modify snowlayer tests - and some vrtlay tests to use init_interp -M components/clm/cime_config/testdefs/testlist_clm.xml -M components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm -M components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12/user_nl_clm - -========= Put unit tests around the parts of the vertical interpolation that - have significant logic -M components/clm/src/utils/CMakeLists.txt -M components/clm/src/main/CMakeLists.txt - -========= Remove old failing vrtlay tests from xfail list, add new vrtlay_interp - tests to xfail list (fail due to bug 2239); add two new CLM5 crop - tests to xfail list (bugs 2240 and 2241) -M components/clm/cime_config/testdefs/ExpectedTestFails.xml - -========= New ChangeLog template, with sections removed / added / rearranged -M .ChangeLog_template - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r145 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue Nov 3 14:25:30 MST 2015 -One-line Summary: update clm50 defaults, enable clm50 crop compsets - -Purpose of changes: - - CLM 5.0 defaults update from David Lawrence and Erik Kluzek. - - - New namelist defaults for clm50: - - use_bedrock = false - - lower_boundray_condition = 2 - - limit_lake_evap_irrig = true - - use_dynroot = false - - - Remove QICE from default history output in use cases. - - - Some history output variables are now inactive by default: - CONC_CH4_SAT, CONC_CH4_UNSAT, FPI, N tendency due to vertical - transport, vertically resolved N. - - - Some history output is now active by default: O2 decomp depth - unsat, SMINN. - - - Update cime configuration to allow creation of CLM 5.0 crop compsets. - - - Update clm4.0 for pio2 from Jim Edwards. - - Test list update from Ben Andre - - Add tests: short CLM 5.0 crop test, renamed aux_clm_short test suite to - clm_short_45, create clm_short_50 test suite. - - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): cime issue #238 (https://github.com/CESM-Development/cime/issues/238) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - Update namelist defaults for clm50 compsets - - use_bedrock = false - - lower_boundray_condition = 2 - - limit_lake_evap_irrig = true - - use_dynroot = false - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Erik Kluzek, Ben Andre - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - clm/bld/CLMBuildNamelist.pm - add_default() call for use_bedrock - - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - new clm50 defaults - - remove QICE from output - clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - clm/bld/namelist_files/use_cases/glacierMEC_pd.xml - - clm/cime_config/testdefs/testlist_clm.xml - new clm50 crop test, clm_short testlist update - - clm/cime_config/config_compsets.xml - clm50 crop compset - clm/cime_config/config_component.xml - clm50 crop compset - - clm/src_clm40/main/ncdio_pio.F90.in - pio2 update - - change default histroy status for variables listed above. - clm/src/biogeochem/ch4Mod.F90 - clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 - clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 - clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40, pass; 45, ok - yellowstone_pgi - 40, pass; 45, ok - yellowstone_gnu (clm45 only) - 45, ok - hobart_nag - not finished prior to tag. no problems expected based on prior branch testing. - - 'ok' means: clm45 tests passed, including baseline comparisons. clm50 - test functionality passed, baseline comparisons failed as expected - because of changes to namelist defaults. nlcomp will fail for clm50 tests. - -CLM tag used for the baseline comparisons: clm4_5_3_r144 - -Changes answers relative to baseline: some - - Summarize any changes to answers, i.e., - - what code configurations: all clm50 compsets - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r144 -Originator(s): Sean Swenson, Keith Oleson, Bill Sacks -Date: Tue Oct 27 09:47:58 MDT 2015 -One-line Summary: Better fix for bug that leads to infinite growth in snow depth - -Purpose of changes: - - Back out fix for infinite snow growth that was put in in clm4_5_3_r141. Put - in place new fix from Sean Swenson and Keith Oleson that fixes the problem - more fundamentally, rather than putting in place a band-aid fix that had its - own problems. - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Sean Swenson, Keith Oleson, Bill Sacks, Leo van Kampenhout - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: ok - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r143 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL CLM45 & CLM50 - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but likely to be larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r143 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Oct 22 23:39:50 MDT 2015 -One-line Summary: flexibleCN and luna bugfixes. - -Purpose of changes: - - flexibleCN and LUNA bugfix changes from Bardan Ghimire, Rosie Fisher - and Chonggang Xu. - - Changes to FlexCN to burn off excess C. Corrected the cpool problem - not going to 0 by changing the order of processes. - - Turn off LUNA for crops and put a boundary cut-off on lnc for very - high lnc fed to LUNA - - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): none - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: new namelist carbon_resp_opt - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: unknown, none expected - -Code reviewed by: Bardan Ghimire, Chonggang Xu, Rosie Fischer, Dave Lawrence - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - new namelist option carbon_resp_opt - clm/bld/CLMBuildNamelist.pm - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - update defaults for carbon_storage_excess_opt - clm/src/main/controlMod.F90 - clm/src/main/clm_varctl.F90 - - flexibleCN - clm/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 - change order of processes - clm/src/biogeochem/CNVegCarbonFluxType.F90 - carbon_resp_opt - clm/src/biogeochem/CNCStateUpdate1Mod.F90 - carbon_resp_opt - clm/src/biogeochem/NutrientCompetitionMethodMod.F90 - update interface - clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 - update interface - clm/src/biogeochem/CNDriverMod.F90 - update interface - - LUNA - clm/src/biogeophys/LunaMod.F90 - leaf nitrogen cutoff - clm/src/biogeophys/PhotosynthesisMod.F90 - turnoff luna for crops - - whitespace / remove dead code - clm/src/biogeochem/CNPhenologyMod.F90 - - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pfunit tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass, flexibleCN not expected to be bit for bit with baseline - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - not finished at time of tag, expected to be ok based on prior branch testing. - -CLM tag used for the baseline comparisons: clm4_5_3_r142 - -Changes answers relative to baseline: some - - Summarize any changes to answers, i.e., - - what code configurations: clm50 with flexibleCN and clm50 with LUNA and crop on - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - larger than roundoff - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r142 -Originator(s): sacks (Bill Sacks) -Date: Mon Oct 19 19:57:35 MDT 2015 -One-line Summary: Fix bug in initialization of 12-layer snow pack - -Purpose of changes: - - Expand the dzmax arrays to have 12 elements, with the last element being - 'huge'. This fixes a bug in the initialization of the snow pack when you try - to initialize it to need all 12 layers. And, more generally, this helps avoid - special-case code that would otherwise be needed to handle the edge case at - the bottom layer. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Leo van Kampenhout - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: ok - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r141 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r141 -Originator(s): Keith Oleson, Bill Sacks -Date: Mon Oct 19 14:15:06 MDT 2015 -One-line Summary: Fix bug that leads to infinite growth in snow depth - -Purpose of changes: - - Restore 'qflx_snow_grnd_col(c) > 0.0_r8' condition in check for whether snow - pack should be initialized. This was removed in clm4_5_1_r121, because Leo found - that, in some rare cases, with this condition in place, the snow pack wasn't - being initialized when it should have been. However, we have more recently found - that, without this condition, there are some rare cases when snow depth can grow - infinitely - and Keith Oleson traced this bug to the removal of this condition. - - We haven't managed to trace the entire logic here, but for now we feel it's - safest to restore this condition. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Keith Oleson, Bill Sacks - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: NOT RUN - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r140 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL CLM45 & CLM50 - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but likely to be larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r140 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Oct 15 23:45:49 MDT 2015 -One-line Summary: mosart, direct to ocean runoff - -Purpose of changes: - Coordinated changes to clm, mosart and rtm to handle direct to - ocean runoff. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): 2233 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: unknown, none expected - -Code reviewed by: Sean Swenson - -List any svn externals directories updated (cime, rtm, cism, etc.): cime, rtm, mosart - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - SVN_EXTERNAL_DIRECTORIES - update externals - clm/cime_config/config_compsets.xml - new compset IMCRUCLM50BGC for testing mosart - clm/cime_config/testdefs/ExpectedTestFails.xml - known issue in cime causes test failure - clm/cime_config/testdefs/testlist_clm.xml - add IM compset test for mosart - - add coupler fields for direct ocean runoff - clm/src_clm40/main/clm_cpl_indices.F90 - clm/src_clm40/main/lnd_import_export.F90 - clm/src/biogeophys/WaterfluxType.F90 - clm/src/biogeophys/HydrologyDrainageMod.F90 - clm/src/cpl/clm_cpl_indices.F90 - clm/src/cpl/lnd_import_export.F90 - clm/src/main/lnd2atmMod.F90 - clm/src/main/lnd2atmType.F90 - - -CLM testing: regular - - - build-namelist tests: - - yellowstone - n/a, not run - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - generate tests not finished at time of tag, but expected to be ok based on earlier testing. - - Notes: - - - ok means that all functionality tests pass. bit for bit - comparison with baselines only show differences in the following - runoff fields when rtm or mosart is running: - clm - TWS, VOLR, VOLRMCH - coupler - l2x_Flrl_rofgwl, x2l_Flrr_volr, x2l_Flrr_volrmch, r2x_Forr_rofl, r2x_Flrr_volr, r2x_Flrr_volrmch, x2r_Flrl_rofgwl - - - bfail for new mosart test - - - new expected failure for ERI_N2_Ld9.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default because of cime issue. - -CLM tag used for the baseline comparisons: clm4_5_3_r139 - -Changes answers relative to baseline: some - - Summarize any changes to answers, i.e., - - what code configurations: all with rtm or mosart - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r139 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue Oct 13 10:17:43 MDT 2015 -One-line Summary: dynamic roots from Beth Drewniak - -Purpose of changes: - - Introduce dynamic roots from Beth Drewniak. Allows roots to grow - dynamically, optimizing for water and nutrient uptake. Crop roots - start from zero each season. Generally leads to higher root - densities near the surface, but also deeper maximum root depth. - Overall, water stress is reduced. If use_bedrock = true, roots are - confined exist in soil layers only. Root litter is input into the - soil according to the dynamic root distribution. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): none - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: new variable use_dynroot - -List any changes to the defaults for the boundary datasets: - updated pft parameter file to c151012, includes merge of dynamic - roots and flexCN params. - - NOTE: ED parameter file was not update. - -Describe any substantial timing or memory changes: unknown, none expected - -Code reviewed by: Dave Lawrence - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - clm/src/biogeochem/CNRootDynMod.F90 - implement dynamic roots - -List all existing files that have been modified, and describe the changes: - - new namelist variable use_dynroots and defaults - clm/bld/CLMBuildNamelist.pm - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - clm/src/biogeochem/CNDriverMod.F90 - call dynamic roots - clm/src/main/controlMod.F90 - read use_dynroot namelist var - clm/src/main/clm_varctl.F90 - add use_dynroot switch - clm/src/main/pftconMod.F90 - new dynamic root variable - clm/src/biogeophys/SoilStateType.F90 - add root_depth_patch variable - - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pfunit tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a, not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a, not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - a couple of manual tests compiled and ran. full suite not finished at time of tag. - - NOTE: ok = amelist changes expected for clm45/50. New defaults - namelist for clm50 turns on dynamic roots, expect all clm50 - compsets to be answer changing. - -CLM tag used for the baseline comparisons: clm4_5_3_r138 - -Changes answers relative to baseline: some - - Summarize any changes to answers, i.e., - - what code configurations: clm50 with use_dynroot = true (default) - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r138 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Sun Oct 11 13:23:12 MDT 2015 -One-line Summary: new accelerated spinup and soil vertical structure - -Purpose of changes: Two sets of changes are included in this tag: - - Accelerated spinup - - New accelerated spinup mode introduced from Dan Ricciuto. - Acceleration factors are calculated directly from the base - decomposition rates for each pool and CWD is added to the pools that - are accelerated. Wood mortality is also accelerated by a factor of 10 - through increasing rates of gap mortality and fire. - - There are now three accelerated spinup modes - - Spinup_state = 0 ; no accelerated spinup - Spinup_state = 1 ; standard accelerated spinup - Spinup_state = 2 ; accelerated accelerated spinup - - Set through env_run.xml (-bgc_spinup on) and via namelist. - - In tests, new spinup method accelerates spinup by ~ a factor of 2 for - a case starting from pre-spunup conditions but shifting to another - forcing dataset. - - Vertical soil structure - - The vertical soil structure has been cleaned up and a new vertical - soil structure has been added. The namelist options more_vertlayers - and deep_soilcolumn have been removed and replaced with the more - general soil_layerstruct. Four options for soil_layerstruct are - included. - - 10SL_3.5m - original soil structure from CLM4.5 and prior versions - 20SL_8.5m - proposed new soil structure for CLM5 - 23SL_3.5m - replaces more_vertlayers - 49SL_10m - replace deep_soilcolumn - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): 2232 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: remove more_vertlayers, -deep_soilcolumn are removed, add soil_layerstruct. new default soil -for clm50 compsets - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: improved spinup, none expected for regular runs. - -Code reviewed by: dlawren - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - remove deep_soilcolumn and more_vertlayers namelist, add soil_layerstruct, update spinup_state: - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - clm/bld/CLMBuildNamelist.pm - - switch tests to use new namelist variable: - clm/cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/user_nl_clm - clm/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm - - add failing tests - clm/cime_config/testdefs/ExpectedTestFails.xml - - switch soil layer structure from old to new namelist variable - clm/src/main/clm_varpar.F90 - switch to new namelist variables for soil vertiacal structure - clm/src/main/controlMod.F90 - update namelist variables - clm/src/main/clm_varctl.F90 - add soil_layerstruct - clm/src/main/initVerticalMod.F90 - switch to new namelist variables for soil vertiacal structure - clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 - switch to soil_layerstruct - clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - switch to soil_layerstruct - clm/src/biogeophys/IrrigationMod.F90 - clm/src/biogeophys/SoilHydrologyMod.F90 - remove comment - - new spinup mode: - clm/src/biogeochem/CNGapMortalityMod.F90 - clm/src/biogeochem/CNVegStructUpdateMod.F90 - clm/src/biogeochem/CNVegCarbonStateType.F90 - clm/src/biogeochem/CNFireLi2016Mod.F90 - clm/src/biogeochem/CNVegStateType.F90 - clm/src/biogeochem/CNVegNitrogenStateType.F90 - clm/src/biogeochem/CNC14DecayMod.F90 - - clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 - clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 - clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 - clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 - clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 - clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 - clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - n/a - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - ok - yellowstone_pgi - ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - - all clm50 compsets fail bit for bit with baseline because of new - default soil_layer structure. - - spinup tests fail because of new spinup code. - - two new expected fails for clm45 compsets, see bugzilla 2232 - -CLM tag used for the baseline comparisons: clm4_5_3_r137 - -Changes answers relative to baseline: some - - Summarize any changes to answers, i.e., - - what code configurations: clm50, spinup - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate - - clm50 compsets use a new soil layer structure. - - new accelerated spinup - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r137 -Originator(s): erik (Erik Kluzek) -Date: Fri Oct 9 12:07:35 MDT 2015 -One-line Summary: Bring in changes for fire-emissions as well tuning changes to the fire model to be used with clm5_0 - -Purpose of changes: - Move fire_clm4_5_2_r128_tags/fire06_clm4_5_3_r136 branch originated from Francis Vitt and Fang Li - to trunk. This does two things: sends fire-emissions from land to coupler (then to ATM), and has - an updated (retuned) version of CNFire from Fang Li. The retuned version is tuned for running with - CAM, but there are fire parameter changes that allow it to be tuned with CRU forcing. - - CLM can test fire-emissions with the -fire_emis option to CLM_BLDNML_OPTS. Coupled configurations - with CAM-CHEM will turn on fire-emissions when fire_emis_nl namelist added to drv_flds_in coupler - namelist file. - -Requirements for tag: fire-emissions added and tested, clm4_5 identical, clm5_0 uses newly tuned fire-model - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - Bug 2231 – Issue with PTCLM with changes in cime4.0.1 - Bug 2229 – clm scripts not compatible with cime > cime2.x.y - Bug 2220 – Bug in fire model with ED for RH24 and WIND24 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Add ability to use and generate fire-emission namelist: fire_emis_nl - Add cnfire_inparm namelist for clm4_5 with fire_method to either li2014qianfrc (clm4_5 default), - or li2016crufrc (clm5_0 default) - Add -fire_emis option to CLM build-namelist - Add shr_fire_emis_factors_file file to use when fire-emissions are sent to coupler - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, fang-li, fvitt - -List any svn externals directories updated (cime, rtm, cism, etc.): - - PTCLM to PTCLM2_151009 - -List all files eliminated: - -D components/clm/src/biogeochem/CNFireMod.F90 --- clm4_5 fire model was split into - polymorphic versions that include clm4_5 and clm5_0 default versions - -List all files added and what they do: - -A components/clm/bld/namelist_files/namelist_defaults_fire_emis.xml -- fire emissions - defaults to use when -fire_emis CLM_BLDNML_OPTS option is used - -------- Add some clm4_0 specific testmods -A components/clm/cime_config/testdefs/testmods_dirs/clm/fire_emis/user_nl_clm ------- Set fire-emission - history fields, include fire_emis_elevated=.true. -A components/clm/cime_config/testdefs/testmods_dirs/clm/fire_emis/include_user_mods - use default -A components/clm/cime_config/testdefs/testmods_dirs/clm/fire_emis -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN/include_user_mods ---- use default -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/shell_commands - turn -fire_emis -A components/clm/cime_config/testdefs/testmods_dirs/clm/40default/user_nl_clm ---- Same as default -A components/clm/cime_config/testdefs/testmods_dirs/clm/40default/shell_commands - Same as default, but no -fire_emis -A components/clm/cime_config/testdefs/testmods_dirs/clm/40default -A components/clm/cime_config/testdefs/testmods_dirs/clm/reduceOutput/shell_commands - -no-fire_emis - -------- Fire model polymorphic options -------- CNFireFactory chooses which version, CNFireMethod is abstract class, CNFireBase is base class -------- CNFireLi2014 extends the base class for clm4_5 default version CNFireLi2016 extends base class -------- for clm5_0 default version -A components/clm/src/biogeochem/CNFireFactoryMod.F90 --- Factory and namelist to figure out which - version to implement. -A components/clm/src/biogeochem/CNFireMethodMod.F90 ---- Abstract class to define all interfaces -A components/clm/src/biogeochem/CNFireBaseMod.F90 ------ Base class, does initialization and - handles lightning and pop-dens datasets -A components/clm/src/biogeochem/CNFireLi2014Mod.F90 ---- Implements CNFireArea and CNFireFluxes - for the clm4_5 default version -A components/clm/src/biogeochem/CNFireLi2016Mod.F90 ---- Implements CNFireArea and CNFireFluxes - for the clm5_0 default version, tuned with CAM5 (parameter changes for version tuned to CRUNCEP) - -------- Fire emission factors -A components/clm/src/biogeochem/FireEmisFactorsMod.F90 -- Fire emission factors from new NetCDF dataset -A components/clm/src/biogeochem/CNFireEmissionsMod.F90 -- Gathers carbon emissions from fire sources - to be sent to CAM-Chem via the coupler - -List all existing files that have been modified, and describe the changes: - -------- Get working with cime4.0.1 -M components/clm/test/tools/TCBCFGtools.sh --- change location of configure and soft link Macros.make -M components/clm/test/tools/TCBtools.sh ------ change location of configure and soft link Macros.make - -------- Update sample namelist (used for tools tests) -M components/clm/tools/clm4_5/mksurfdata_map/mksurfdata_map.namelist - -------- -M components/clm/bld/unit_testers/build-namelist_test.pl ----------- Add fire_emis tests -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Add default fire_method options -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add cnfire_inparm, and fire_emis_nl - namelist groups. Adding: fire_method, fire_emis_elevated, fire_emis_factors_file, and fire_emis_specifier -M components/clm/bld/CLMBuildNamelist.pm --------------------------- Add cnfire_inparm namelist and - handle fire_emis option simialr to megan and drydep options. - Add: fire_emis_elevated, fire_emis_factors_file, and fire_emis_specifier - -------- -M components/clm/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods - use 40defaults -M components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN/user_nl_clm - use defaults, so just set use_flexibleCN -M components/clm/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods -- use 40defaults -M components/clm/cime_config/testdefs/testmods_dirs/clm/default/shell_commands - Add -fire_emis -M components/clm/cime_config/testdefs/testlist_clm.xml ------- Change clm4_0 tests to use 40default - and add fire_emis test -M components/clm/cime_config/user_nl_clm ---- Add mention of -fire_emis option - -------- -M components/clm/src/dyn_subgrid/dynSubgridControlMod.F90 - NFileName to NLFilename, and read_namelist -M components/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -- Pass NLFilename down to dynSubgrid_init -M components/clm/src/cpl/clm_cpl_indices.F90 -------------- Add fire-fluxes, and top of fire emissions -M components/clm/src/cpl/lnd_import_export.F90 ------------ Set fire-fluxes and top of fire emission -M components/clm/src/biogeochem/VOCEmissionMod.F90 -------- Add an additional coefficient multiply - (currently just set to 1.0) -M components/clm/src/biogeochem/CNDriverMod.F90 ----------- Pass NLFilename and cnfire_method - down to CNDriverInit and cnfire_method to CNDriverNoLeaching, and use for CNFireArea and - CNFireFluxes calls -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 -- Correct fire variable descriptions - (fuelc_col, fuelc_crop_col) -MM components/clm/src/main/clm_initializeMod.F90 ----------- Add create_cnfire_method, pass NLFilename - down to CNDriverInit, ndep_init, and dynSubgrid_init -M components/clm/src/main/lnd2atmMod.F90 ------------------ Add use shr_fire_emis_mod to handle - fire emissions to send from land to ATM -M components/clm/src/main/ndepStreamMod.F90 --------------- NLFilename passed down rather than using - controlMod -M components/clm/src/main/lnd2atmType.F90 ----------------- Add wild-fire emissions flux and vertical - distribution -M components/clm/src/main/atm2lndType.F90 ----------------- Add RH30, PREC10, and PREC60 - ( 30 day relative humidity, 10 and 60 day precipitation) Fix bug 2220 for ED -M components/clm/src/main/clm_instMod.F90 ----------------- Add cnfire and fireemis objects - call initialize for fireemis -MM components/clm/src/main/controlMod.F90 ------------------ Call CNFireReadNML -M components/clm/src/main/clm_driver.F90 ------------------ Replace cnfire_method object - for calls to CNFire module, add call to CNFireEmisUpdate - -CLM testing: regular - - build-namelist tests: - - yellowstone yes - - unit-tests (components/clm/src): - - yellowstone yes - - tools-tests (components/clm/test/tools): - - yellowstone yes - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone yes - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - hobart_nag yes - -CLM tag used for the baseline comparisons: clm4_5_3_r137 - -Changes answers relative to baseline: Yes, for clm5_0 - - Summarize any changes to answers, i.e., - - what code configurations: clm5_0 - - what platforms/compilers: All - - nature of change (fire tuned differently): - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r136 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Oct 8 10:15:33 MDT 2015 -One-line Summary: coupler field prep for mosart and externals update - -Purpose of changes: - - Changes from T. Craig, M. Vertenstein and S. Swenson to enable - separation of runoff fields passed from CLM to RTM - - Update externals. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2223 - -Known bugs (include bugzilla ID): 2229 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: unknown, none expected - -Code reviewed by: mvertens, swenson - -List any svn externals directories updated (cime, rtm, cism, etc.): cime, cism, rtm - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - Split river fluxes sent to the coupler into surface, frozen, subsurface and gwl (glacier/wetland/lake). - - clm/src_clm40/main/lnd_import_export.F90 - clm/src_clm40/main/clm_cpl_indices.F90 - clm/src_clm40/main/clm_atmlnd.F90 - clm/src/main/lnd2atmMod.F90 - clm/src/main/atm2lndType.F90 - clm/src/main/lnd2atmType.F90 - clm/src/cpl/lnd_import_export.F90 - clm/src/cpl/clm_cpl_indices.F90 - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pfunit tests pass - - tools-tests (components/clm/test/tools): - - yellowstone - mksurfdata_map unit tests pass - tools system tests not cime compatible - bug 2229 - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - NOTE: the filenames for some tests exceeded the allowed length and comparison against the original r136 baselines may show bfail for: - - ERP_D_P15x2_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_intel.clm-limit_river_withdraw - ERP_P15x2_Lm36.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrig_o3_reduceOutput - - yellowstone_intel - 40 ok, 45 ok - yellowstone_pgi - 40 ok, 45 ok - yellowstone_gnu (clm45 only) - ok - hobart_nag - ok - -CLM tag used for the baseline comparisons: clm4_5_3_r135 - -Changes answers relative to baseline: yes - - Summarize any changes to answers, i.e., - - what code configurations: - * cism update is answer changing for all IG compsets. see cism for details - * splitting river fluxes to the coupler is answer changing for all clm45/50 compsets. - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): much larger than roundoff, assumed new climate. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: no runs were performed - - URL for LMWG diagnostics output used to validate new climate: - no diagnostics created. -=============================================================== -=============================================================== -Tag name: clm4_5_3_r135 -Originator(s): sacks (Bill Sacks) -Date: Tue Oct 6 05:59:45 MDT 2015 -One-line Summary: Substantial reduction in memory allocation for prognostic crops - -Purpose of changes: - - With the introduction of "global" crops (78 pfts), memory use was increased - substantially. The memory use itself was not a problem, but this led to a - significant model slow-down, presumably due to a decrease in cache use - efficiency. Much of this increase in memory use was unnecessary: CLM only - knows about a minority of the new crop functional types (CFTs) - other CFTs - are merged into those known CFTs. Yet space was being set aside in the patch - and column-level arrays even for the CFTs that are never used. - - In this tag, I have reduced prognostic crop memory use by only allocating - space in patch and column-level arrays for the crops CLM knows about. - - This leads to a speedup of prognostic crop cases by about 1.5x. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: - - New initial conditions files for crops, needed because of the change in - number of patches and columns. These were generated by running the old - initial conditions through initInterp. - -Describe any substantial timing or memory changes: Speedup of prognostic crop -cases by about 1.5x. - -Code reviewed by: Erik Kluzek, Ben Andre, Mariana Vertenstein - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as described above -M components/clm/src/main/subgridMod.F90 -M components/clm/src/main/pftconMod.F90 -M components/clm/src/main/initGridCellsMod.F90 -M components/clm/src/main/clm_varpar.F90 - -========= Replace old conditional with use of new is_pft_known_to_model, which - is a more general/robust way to accomplish the conditional -M components/clm/src/biogeochem/CNPhenologyMod.F90 - -========= New initial conditions files for crop -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Remove unneeded 'use' statements -M components/clm/src/main/restFileMod.F90 -M components/clm/src/main/surfrdMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: NOT RUN - - unit-tests (components/clm/src): - - yellowstone: ok - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r134 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r134 -Originator(s): sacks (Bill Sacks) -Date: Sun Oct 4 07:25:05 MDT 2015 -One-line Summary: Fixes for transient and preindustrial crop cases - -Purpose of changes: - - (1) Important bug fix for transient crop: Collapse crop types in the - transient run. Previously, when the transient portion started, (a) the - collapse of the 78 pfts to the "known" crops was not happening, and (b) - the collapse of irrigated pfts in a non-irrigation run was not - happening. These two problems are fixed now. - - (2) Restore lost transient crop test cases - - (3) Add 1850 crop raw dataset (created using - https://github.com/billsacks/clm_misc-make_crop_1850_dataset) - - (4) Add out-of-the-box surface datasets for 1850 crop, and out-of-the-box - landuse timeseries datasets for transient crop - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 2010 (create year-1850 surface datasets for crop) -- 2149 (tweak smallville transient test case) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: new out-of-the-box defaults (see below) - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Remove testmods directories that are no longer needed because - transient crop cases now pick up a surface dataset and landuse - timeseries file out-of-the-box -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10 - -========= Remove testmods directory that is no longer used (should have been removed in clm4_5_2_r127) -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/README -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/user_nl_clm -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/include_user_mods -D components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09 - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Collapse crop types in a transient run -M components/clm/src/main/surfrdUtilsMod.F90 -M components/clm/src/main/surfrdMod.F90 -M components/clm/src/dyn_subgrid/dyncropFileMod.F90 - -========= Relax tolerance for check of PCT_NAT_PFT between landuse timeseries - file and surface dataset. Transient crop runs exceeded the previous - strict tolerance. I'm not sure why they need this relaxed tolerance, - but given the manipulations that were needed both to create the - year-1850 crop raw dataset and to create the crop landuse timeseries - file, I'm willing to accept that this is needed. I have made this - tolerance about 2 orders of magnitude looser than the differences I - observed, to try to prevent the check from being wrongly triggered in - the future. The tolerance of 1e-6 still seems sufficient to catch any - real problems. -M components/clm/src/dyn_subgrid/dynpftFileMod.F90 - -========= Add rules to make some 1850 crop surface datasets -M components/clm/tools/clm4_5/mksurfdata_map/Makefile.data - -========= Add raw dataset for 1850 crop -M components/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - -========= Add some surface datasets for 1850 crop, and landuse timeseries files - for crop -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Just add a comment -M components/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - -========= Restore transient crop tests that were lost shortly after they were - added (when the test list was migrated out of scripts into CLM) -M components/clm/cime_config/testdefs/testlist_clm.xml - -========= Unrelated change: add a note at Ben's request -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/README -M components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/README - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - unit-tests (components/clm/src): - - yellowstone: ok - - tools-tests (components/clm/test/tools): - - yellowstone: NOT RUN - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone: NOT RUN - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r132 - -Changes answers relative to baseline: YES - just for transient crop cases - - Summarize any changes to answers, i.e., - - what code configurations: transient crop cases - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - not investigated, likely to be new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - - Note that there were no transient crop tests in the test suite prior to this - tag, so the answer changes do not affect any existing tests. - - Note the following unexpected BFAILs: - - BFAIL ERP_D_P15x2_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_intel.clm-limit_river_withdraw.clm2.h0.nc : baseline compare clm2.h0 (baseline: compare .base file with clm4_5_3_r132 file) (baseline history file does not exist) - BFAIL ERP_D_P15x2_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_intel.clm-limit_river_withdraw.clm2.h1.nc : baseline compare clm2.h1 (baseline: compare .base file with clm4_5_3_r132 file) (baseline history file does not exist) - - BFAIL ERP_P15x2_Lm36.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrig_o3_reduceOutput.clm2.h1.nc : baseline compare clm2.h1 (baseline: compare .base file with clm4_5_3_r132 file) (baseline history file does not exist) - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r133 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Oct 2 16:24:53 MDT 2015 -One-line Summary: Bugfix for mksurfdata_map - add file missed by clm4_5_2_r125. - -Purpose of changes: - - Bugfix for mksurfdata_map. Add new file needed for soil depth. File should have been included in clm4_5_2_r125. - -Requirements for tag: tools - -Test level of tag: mksurfdata_map unit tests - -Bugs fixed (include bugzilla ID): not in bugzilla - -Known bugs (include bugzilla ID): systems tests for clm tools not cime3 compatible. - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - clm/tools/clm4_5/mksurfdata_map/src/mksoildepthMod.F90 - include soil depth data - -List all existing files that have been modified, and describe the changes: none - -CLM testing: tools - - build-namelist tests: not run - - unit-tests (components/clm/src): not run - - tools-tests (components/clm/test/tools): - - yellowstone - clm4_5/mksurfdata_map/unit_testers - all tests passed - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone not run - - regular tests (aux_clm40, aux_clm45): not run. no changes to main clm code. - -CLM tag used for the baseline comparisons: none. - -Changes answers relative to baseline: no - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r132 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Oct 2 10:29:57 MDT 2015 -One-line Summary: Modify soil BGC diffusion and cryoturbation code to allow for spatially variable soil thickness. - -Purpose of changes: - - Changes from Dave Lawrence to modify soil BGC diffusion and - cryoturbation code to allow for spatially variable soil thickness - (e.g. if use_bedrock = true); fixed dzsoi_decomp for new vertical - grids - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): 2213, 2219 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: unknown none expected - -Code reviewed by: Dave Lawrence - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - clm/src/main/initVerticalMod.F90 - use zmin_bedrock param, fix dzsoi_decomp - clm/src/main/clm_varcon.F90 - make zmin_bedrock a constant parameter - clm/src/main/clm_varpar.F90 - write subsurface discretization levels to land log - clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 - spatially variable soil thickness - clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 - spatially variable soil thickness - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40, pass; 45, ok (see below) - yellowstone_pgi - 40, pass; 45, pass - yellowstone_gnu (clm45 only) - pass - hobart_nag - pass - - Only test not bit for bit with baseline is: - ERS_D_Ld3.f10_f10.ICRUCLM50BGC.yellowstone_intel.clm-deepsoil_bedrock - -CLM tag used for the baseline comparisons: clm4_5_3_r131 - -Changes answers relative to baseline: some - - Tag changes answers for clm50 bgc compsets where use_bedrock = - true. No change to default version of model, doesn't change - results for use_bedrock = true when in SP mode. - - Summarize any changes to answers, i.e., - - what code configurations: clm50 bgc with use_bedrock = true - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate - - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: - none - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r131 -Originator(s): mvertens, sacks -Date: Wed Sep 30 05:13:45 MDT 2015 -One-line Summary: Bring in cime3 - -Purpose of changes: - - Bring in cime3 (de-CESMization of CIME), which requires the addition of a - cime_config directory and a bit of other rework. - - Also, port the pnetcdf problem with dov2xy=false from clm45 to clm4 code base - (workaround for bug 1730 - and 2214 and 2222). This was needed because now - pnetcdf is on by default in most runs. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 2214: CLM4 test fails in PIO while trying to write h1 file -- 2222: CLM4 cases die when writing 1-d history files with pnetcdf - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: rework for cime3 - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): -cime2.0.18-p1.1 -> cime3.0.7 -cism2_1_02 -> cism2_1_05 -rtm1_0_52 -> rtm1_0_53 - - -List all files eliminated: - -========= Moved into cime_config -D components/clm/cimetest/testlist_clm.xml -D components/clm/cimetest/ExpectedTestFails.xml -D components/clm/cimetest/testmods_dirs/clm/glcMEC_long/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/glcMEC_long/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC_long/README -D components/clm/cimetest/testmods_dirs/clm/glcMEC_long -D components/clm/cimetest/testmods_dirs/clm/decStart/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/decStart/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/decStart -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetMid/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetMid/README -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetMid/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetMid -D components/clm/cimetest/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/irrigOn_reduceOutput/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/irrigOn_reduceOutput -D components/clm/cimetest/testmods_dirs/clm/default/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/default/shell_commands -D components/clm/cimetest/testmods_dirs/clm/default -D components/clm/cimetest/testmods_dirs/clm/crop_trans_sville/README -D components/clm/cimetest/testmods_dirs/clm/crop_trans_sville/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/crop_trans_sville/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/crop_trans_sville -D components/clm/cimetest/testmods_dirs/clm/edTest/shell_commands -D components/clm/cimetest/testmods_dirs/clm/edTest/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/edTest -D components/clm/cimetest/testmods_dirs/clm/reduceOutput/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/reduceOutput -D components/clm/cimetest/testmods_dirs/clm/cropMonthOutput/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/cropMonthOutput/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/cropMonthOutput -D components/clm/cimetest/testmods_dirs/clm/monthly/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/monthly/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/monthly/user_nl_cpl -D components/clm/cimetest/testmods_dirs/clm/monthly -D components/clm/cimetest/testmods_dirs/clm/glcMEC/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/glcMEC/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC/user_nl_cpl -D components/clm/cimetest/testmods_dirs/clm/glcMEC -D components/clm/cimetest/testmods_dirs/clm/ciso/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/ciso/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/ciso -D components/clm/cimetest/testmods_dirs/clm/luna/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/luna/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/luna -D components/clm/cimetest/testmods_dirs/clm/monthly_noinitial/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/monthly_noinitial/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/monthly_noinitial -D components/clm/cimetest/testmods_dirs/clm/interp_from_f09/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/interp_from_f09/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/interp_from_f09/README -D components/clm/cimetest/testmods_dirs/clm/interp_from_f09 -D components/clm/cimetest/testmods_dirs/clm/glcMEC_increase/user_nl_cism -D components/clm/cimetest/testmods_dirs/clm/glcMEC_increase/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC_increase/README -D components/clm/cimetest/testmods_dirs/clm/glcMEC_increase -D components/clm/cimetest/testmods_dirs/clm/crop/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/crop/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/crop -D components/clm/cimetest/testmods_dirs/clm/allActive/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/allActive -D components/clm/cimetest/testmods_dirs/clm/cn_conly/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/cn_conly/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/cn_conly -D components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands -D components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/README -D components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way -D components/clm/cimetest/testmods_dirs/clm/snowlayers_12/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/snowlayers_12/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/snowlayers_12 -D components/clm/cimetest/testmods_dirs/clm/ptsROA/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/ptsROA/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/ptsROA -D components/clm/cimetest/testmods_dirs/clm/NoVSNoNI/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/NoVSNoNI/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/NoVSNoNI -D components/clm/cimetest/testmods_dirs/clm/SNICARFRC/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/SNICARFRC/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/SNICARFRC -D components/clm/cimetest/testmods_dirs/clm/flexibleCN/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/flexibleCN -D components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags/README -D components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/README -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop -D components/clm/cimetest/testmods_dirs/clm/crop_trans_f10/README -D components/clm/cimetest/testmods_dirs/clm/crop_trans_f10/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/crop_trans_f10/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/crop_trans_f10 -D components/clm/cimetest/testmods_dirs/clm/o3/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/o3/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/o3 -D components/clm/cimetest/testmods_dirs/clm/vrtlay/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/vrtlay/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/vrtlay -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetEarly/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetEarly/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetEarly/README -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetEarly -D components/clm/cimetest/testmods_dirs/clm/oldhyd/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/oldhyd -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/README -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop -D components/clm/cimetest/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/irrig_o3_reduceOutput/README -D components/clm/cimetest/testmods_dirs/clm/irrig_o3_reduceOutput -D components/clm/cimetest/testmods_dirs/clm/glcMEC_decrease/user_nl_cism -D components/clm/cimetest/testmods_dirs/clm/glcMEC_decrease/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/glcMEC_decrease/README -D components/clm/cimetest/testmods_dirs/clm/glcMEC_decrease -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subset/README -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subset/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subset -D components/clm/cimetest/testmods_dirs/clm/USUMB/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/USUMB/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/USUMB -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetLate/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetLate/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetLate/README -D components/clm/cimetest/testmods_dirs/clm/tropicAtl_subsetLate -D components/clm/cimetest/testmods_dirs/clm/drydepnomegan/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/drydepnomegan/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/drydepnomegan -D components/clm/cimetest/testmods_dirs/clm/rootlit/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/rootlit/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/rootlit -D components/clm/cimetest/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/deepsoil_bedrock/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/deepsoil_bedrock -D components/clm/cimetest/testmods_dirs/clm/af_bias_v5/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/af_bias_v5/user_nl_datm -D components/clm/cimetest/testmods_dirs/clm/af_bias_v5/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/af_bias_v5 -D components/clm/cimetest/testmods_dirs/clm/limit_river_withdraw/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/limit_river_withdraw/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/limit_river_withdraw -D components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly -D components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/README -D components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/user_nl_clm -D components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/interp_f19_crop -D components/clm/cimetest/testmods_dirs/clm/ptsRLA/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/ptsRLA/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/ptsRLA -D components/clm/cimetest/testmods_dirs/clm/pts/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/pts/README -D components/clm/cimetest/testmods_dirs/clm/pts/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/pts -D components/clm/cimetest/testmods_dirs/clm/ptsRLB/xmlchange_cmnds -D components/clm/cimetest/testmods_dirs/clm/ptsRLB/include_user_mods -D components/clm/cimetest/testmods_dirs/clm/ptsRLB -D components/clm/cimetest/testmods_dirs/clm -D components/clm/cimetest/testmods_dirs -D components/clm/cimetest -D components/clm/bld/clm.buildlib -D components/clm/bld/user_nl_clm -D components/clm/bld/clm.buildnml - -========= This is no longer needed - it is generated automatically by the build script -D components/clm/src_clm40/main/ncdio_pio.F90 - - -List all files added and what they do: - -========= New stuff needed for cime3 -A components/clm/cime_config -A components/clm/cime_config/config_component.xml -A components/clm/cime_config/config_pes.xml -A components/clm/cime_config/config_compsets.xml - -========= Moved from elsewhere (new organization needed for cime3) -A components/clm/cime_config/testdefs/ExpectedTestFails.xml -A components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/USUMB -A components/clm/cime_config/testdefs/testmods_dirs/clm/rootlit/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/rootlit/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/rootlit -A components/clm/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/drydepnomegan/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/drydepnomegan -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetLate -A components/clm/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/deepsoil_bedrock -A components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/limit_river_withdraw -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5/user_nl_datm -A components/clm/cime_config/testdefs/testmods_dirs/clm/af_bias_v5 -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_3_monthly -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_crop -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLA -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsRLB -A components/clm/cime_config/testdefs/testmods_dirs/clm/pts/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/pts/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/pts -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/decStart -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_long/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_long -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetMid -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrigOn_reduceOutput -A components/clm/cime_config/testdefs/testmods_dirs/clm/default/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/default/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/default -A components/clm/cime_config/testdefs/testmods_dirs/clm/reduceOutput/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/reduceOutput -A components/clm/cime_config/testdefs/testmods_dirs/clm/edTest/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/edTest/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/edTest -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_sville -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC/user_nl_cpl -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly/user_nl_cpl -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ciso -A components/clm/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/luna/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/luna -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/monthly_noinitial -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_from_f09 -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/user_nl_cism -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_increase -A components/clm/cime_config/testdefs/testmods_dirs/clm/cn_conly/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/cn_conly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/cn_conly -A components/clm/cime_config/testdefs/testmods_dirs/clm/allActive/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/allActive -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_spunup_1way -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/snowlayers_12 -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/ptsROA -A components/clm/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/NoVSNoNI -A components/clm/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/SNICARFRC -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/flexibleCN -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_changeFlags -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/crop_trans_f10 -A components/clm/cime_config/testdefs/testmods_dirs/clm/o3/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/o3/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/o3 -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/vrtlay -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/xmlchange_cmnds -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subsetEarly -A components/clm/cime_config/testdefs/testmods_dirs/clm/oldhyd/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/oldhyd -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/interp_f19_noncrop2crop -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/user_nl_cism -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/glcMEC_decrease -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput/include_user_mods -A components/clm/cime_config/testdefs/testmods_dirs/clm/irrig_o3_reduceOutput -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/README -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset/user_nl_clm -A components/clm/cime_config/testdefs/testmods_dirs/clm/tropicAtl_subset -A components/clm/cime_config/testdefs/testmods_dirs/clm -A components/clm/cime_config/testdefs/testmods_dirs -A components/clm/cime_config/testdefs/testlist_clm.xml -A components/clm/cime_config/testdefs -A components/clm/cime_config/user_nl_clm -A components/clm/cime_config/buildlib -A components/clm/cime_config/buildnml - - -List all existing files that have been modified, and describe the changes: - -========= Minor changes for cime3 -M components/clm/bld/CLMBuildNamelist.pm - -========= Port bug 1730 workaround to clm40, fixing bugs 2214 & 2222 -M components/clm/src_clm40/main/histFileMod.F90 -M components/clm/src_clm40/main/ncdio_pio.F90.in - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - (ran unit_testers and test_build_namelist tests) - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_3_r130 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - There are large differences in the anomaly forcing, due to a bug fix that has - been incorporated in the cime3 changes. This changes answers for this test: - - SMS_Ld1.f09_g16.ICRUCLM45.yellowstone_intel.clm-af_bias_v5 - - In addition, there are roundoff-level changes in x2l_Flrr_volr, VOLR and TWS - in these tests: - ERS_E_Ld9.f45_g37.I.yellowstone_intel.clm-default - ERI_D_Ld9.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay - - Also, this BFAILed: - BFAIL ERP_P15x2_Lm36.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrig_o3_reduceOutput.clm2.h1.nc : baseline compare clm2.h1 (baseline: compare .base file with clm4_5_3_r130 file) (baseline history file does not exist) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r130 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Mon Sep 28 11:16:54 MDT 2015 -One-line Summary: add namelist option to reduce lake evaporation and irrigation when river water storage falls below a threshold value, and add an additional constraint on stress deciduous leaf onset. - -Purpose of changes: - - To maintain river storage above a minimum threshold. To add a - second condition that must be fulfilled prior to leaf onset - occurring for stress deciduous pfts. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): 2213, 2219 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - new namelist flags: - limit_lake_evap_and_irrig - constrain_stress_deciduous_onset - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: unknown, none expected - -Code reviewed by: Sean Swenson, Dave Lawrence, Bill Sacks (irrigation) - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - - clm/cimetest/testmods_dirs/clm/limit_river_withdraw - testmods for new flag - -List all existing files that have been modified, and describe the changes: - - clm/src/biogeochem/CNDriverMod.F90 - add atm2lnd_inst to function call for phenology - clm/src/biogeochem/CNPhenologyMod.F90 - add atm2lnd_inst, new check for stress deciduous - clm/src/biogeochem/CNSharedParamsMod.F90 - new stress deciduous namelist variable - - clm/src/main/init_hydrology.F90 - note - clm/src/main/controlMod.F90 - add limit_lake_evap_and_irrig namelist variable - clm/src/main/clm_driver.F90 - add volr_grc to ApplyIrrigation function call - clm/src/main/clm_varctl.F90 - add limit_lake_evap_and_irrig namelist variable - - clm/src/biogeophys/IrrigationMod.F90 - check for limit irrigation - clm/src/biogeophys/LakeFluxesMod.F90 - check for limit lake evap - clm/src/biogeophys/test/Irrigation_test/test_irrigation_singlepatch.pf - new unit test - clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 - new unit test - - clm/src/unit_test_stubs/utils/spmdMod_stub.F90 - add stub mpi type - - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - new namelist variables - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/CLMBuildNamelist.pm - - clm/cimetest/testlist_clm.xml - new tests - - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - pass - yellowstone_pgi - pass - yellowstone_gnu (clm45 only) pass - hobart_nag - run, ok - -CLM tag used for the baseline comparisons: clm4_5_2_r128/clm4_5_3_r129 - - Note: new test for limit_river_withdraw got dropped from the - testlist during a merge/manage_testlist update. This wasn't noticed - until after baselines were generated. This test was added to the - baselines manually. - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm50 compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - When active, these changes will be climate changing. Lake - evaporation and irrigation limitation will change the surface energy - balance by reducing latent heat and increasing sensible heat when - river storage is below a threshold value. Constraining leaf onset - with a secondary constraint will modify vegetation dynamics, - e.g. LAI will differ in magnitude and seasonality, which will change - the surface energy balance by altering evapotranspiration. - - Note: all of the aux_clm tests for clm50 compsets triggered were - bit for bit with the baseline. The stress deciduous flag is on by - default for clm50, and changes should have been observed. Sean - Swenson verified that the flag is active in 30 day runs, so it is - assumed that the shorter three and nine day runs were not enough - to trigger the new code. A new 30 day test was added. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: none - - URL for LMWG diagnostics output used to validate new climate: none - - -=============================================================== -=============================================================== -Tag name: clm4_5_3_r129 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri Sep 25 15:30:39 MDT 2015 -One-line Summary: bump tag revision number because clm4_5_2_r128 was climate changing. - -Purpose of changes: - - Bump tag revision number only. This is the same code base as - clm4_5_2_r128. No additional testing was done. - - Further review of the answer changes in clm4_5_2_r128 indicated - that they were a climate changing bugfix, and the patch level - version number should have been bumped. - - S. Swenson and D. Lawrence performed a code review of the changes - and decided the original calculation of heat capacity for soil - layers > nlevsoi (i.e. bedrock layers) was incorrect due to the - heat capacity being scaled by (1-watsat). This scaling, which - takes into account the presence of soil voids (the porosity), is - not appropriate for the bedrock layers, which are assumed to be - rock rather than soil. The new code simply applies the bedrock - value for heat capacity without the scaling, which leads to an - increase in heat content for bedrock layers. The code change - therefore results in non-b4b changes to the simulation. - - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r128 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Sep 24 10:34:39 MDT 2015 -One-line Summary: science bugfixes for root fraction and bedrock thermal properties. not bit for bit with baseline. - -Purpose of changes: - - 1) To explicitly set rooting fraction to zero in baresoil patches. - - 2) To place definition of bedrock heat capacity in a location - consistent with other bedrock parameters (e.g. thermal conductivity). - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): 2213, 2219 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none expected - -Code reviewed by: Sean Swenson, Dave Lawrence - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M clm/src/biogeophys/SoilTemperatureMod.F90 - move heat capacity from SoilTemperature -M clm/src/biogeophys/LakeTemperatureMod.F90 - include heat capacity of bedrock -M clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - move heat capacity to SoilTemperature -M clm/src/main/clm_varcon.F90 - move vol heat copacity from SoilStateInitTimeConstMod - -M clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 - set root fraction to zero - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - not run - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40 ok, 45 expected not bfb with baseline - yellowstone_pgi - 40 ok, 45 expected not bfb with baseline - yellowstone_gnu (clm45 only) - 40 ok, 45 expected not bfb with baseline - hobart_nag - 45 compiles, bug 2213 - -CLM tag used for the baseline comparisons: clm4_5_2_r127 - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm45 and clm50 compsets - - what platforms/compilers: all/all - - nature of change (roundoff; larger than roundoff/same climate; new climate): roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - Monthly history files were compared from a short CLM Swenson case run. - No further testing was performed - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: No runs were performed - - URL for LMWG diagnostics output used to validate new climate: - No diagnostics were generated - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r127 -Originator(s): sacks (Bill Sacks) -Date: Fri Sep 18 10:53:12 MDT 2015 -One-line Summary: Fix interpolation of initial conditions for glc_mec and crop <-> non-crop - -Purpose of changes: - - Fixes the following bugs in initInterp: (1) interpolation of one glc_mec case - to another glc_mec case (due to bug 2126); (2) interpolation of a non-crop - case to a crop case (problems with generic crop type); (3) interpolation of a - crop case to a non-crop case (problems with generic crop type). - - Note: If you want to use initInterp with an old glc_mec initial conditions - file (generated before this tag), you will need to either: (1) run the same - case with this tag or later, without use_init_interp, for at least one time - step to generate a new (fixed) initial conditions file; or (2) overwrite the - pfts1d_topoglc variable on your original initial conditions file so that it - has the correct size. (1) is easier if it is feasible for you to do so. - - Some related changes to initInterp: - - - Changed the "user interface" for interpolating initial conditions: There is - no longer a finidat_interp_source namelist option; instead, you set finidat - to point to the initial conditions file to interpolate, and set the - use_init_interp namelist option to .true. - - - Changed the default behavior so that it does NOT fill missing points (e.g., - landunits that are in the new case but not on the input file) with the bare - ground patch / vegetated landunit. Instead, it dies with an error message - if it can't find a reasonable template column. If you want to it to use the - nearest bare ground / vegetated point in this case, then rerun with - init_interp_fill_missing_with_natveg set to .true. - - - Added system and unit tests of initInterp. System tests include both - interpolation of a file onto an identical configuration, and ensuring they - are bit-for-bit (LII test), and tests that involve interpolation from one - resolution or configuration to another. For the latter, I have done some - very quick checks, but have NOT carefully checked the current operation to - ensure it is correct. - - Some (mostly) unrelated changes: - - (1) Write more metadata on column type to 1-d (vector) history files - - (2) Updated cime; this included, among other things: - - fix RESUBMIT bug - - no longer set FORCE_COLDSTART for glc_mec runs - - addition of LII test - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 1447 (interpinic needs to be extended to work for glc_mec) -- 1703 (need better testing of interpinic) -- 1725 (interpinic doesn't work right for crop) -- 2126 (Error in writing pfts1d_topoglc to restart file) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: -- Removed finidat_interp_source namelist option -- Added use_init_interp and init_interp_fill_missing_with_natveg namelist option - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): - - cime: cime2.0.17 -> cime2.0.18-p1.1 (see summary above) - -List all files eliminated: none - -List all files added and what they do: - -========= Separate testable parts of initInterp into their own module; fix - initInterp bugs as noted above -A components/clm/src/main/initInterpMindist.F90 - -========= Add system tests that exercise initInterp -A components/clm/cimetest/testmods_dirs/clm/interp_from_f09/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/interp_from_f09/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/interp_from_f09/README -A components/clm/cimetest/testmods_dirs/clm/interp_from_f09 -A components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/shell_commands -A components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/README -A components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/glcMEC_spunup_1way -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop/README -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop/README -A components/clm/cimetest/testmods_dirs/clm/interp_f19_noncrop2crop -A components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/README -A components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/interp_f19_crop/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/interp_f19_crop - -========= Add unit tests that exercise initInterp: set_mindist -A components/clm/src/main/test/initInterpMindist_test/CMakeLists.txt -A components/clm/src/main/test/initInterpMindist_test/test_init_interp_mindist.pf -A components/clm/src/main/test/initInterpMindist_test - -List all existing files that have been modified, and describe the changes: - -========= Fix incorrect dimension for pfts1d_topoglc -M components/clm/src/main/subgridRestMod.F90 - -========= Remove finidat_interp_source namelist option; add use_init_interp and - init_interp_fill_missing_with_natveg options -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/clm_varctl.F90 - -========= Refactor to split into two modules; parse new namelist option; change - line endings from DOS to UNIX (changes all lines!) -M components/clm/src/main/initInterp.F90 - -========= Write column type metadata to 1-d (vector) history files -M components/clm/src/main/column_varcon.F90 -M components/clm/src/main/histFileMod.F90 -M components/clm/src/main/restFileMod.F90 - -========= Add optional msg argument to check_dim -M components/clm/src/main/ncdio_pio.F90.in - -========= Add system tests that exercise initInterp -M components/clm/cimetest/testlist_clm.xml - -========= Add unit tests that exercise initInterp: set_mindist -M components/clm/src/main/CMakeLists.txt -M components/clm/src/main/test/CMakeLists.txt -M components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90.in - - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - This test fails; it looks like it started failing in r125: - 131/547 < FAIL> - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - - Note: There was one BFAIL: - BFAIL ERP_P15x2_Lm36.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrig_o3_reduceOutput.clm2.h1.nc : baseline compare clm2.h1 (baseline: compare .base file with clm4_5_2_r126 file) (baseline history file does not exist) - - -CLM tag used for the baseline comparisons: clm4_5_2_r126 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r126 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Thu Sep 17 14:53:49 MDT 2015 -One-line Summary: New decomp_depth_efolding value for clm5.0, set as a namelist parameter instead of netcdf params file. - -Purpose of changes: - Set decomp_depth_efolding as a namelist parameter instead of netcdf params file. New default value for CLM 5.0. - - Improved error message from build namelist when turning on irrigation. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2190 - -Known bugs (include bugzilla ID): 2213 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: add namelist group bgc_shared and namelist parameter decomp_depth_efolding. New default value for clm 5.0. - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - new defaults for decomp_depth_efolding - clm/bld/namelist_files/namelist_definition_clm4_5.xml - put decomp_depth_efolding in new namelist group - clm/bld/CLMBuildNamelist.pm - logic for new namelist variable, improve error message - clm/src/unit_test_stubs/utils/spmdMod_stub.F90 - add mpi_real8 so unit tests will compile - clm/src/biogeochem/CNSharedParamsMod.F90 - add new method to set parameters from namelist. - clm/src/main/readParamsMod.F90 - pass namelist filename into CNSharedParamsMod::CNParamsReadShared - - -CLM testing: regular - - build-namelist tests: - - yellowstone - unit tests pass - - unit-tests (components/clm/src): - - yellowstone - passed - - tools-tests (components/clm/test/tools): - - yellowstone - n/a - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel : 40 - ok; 45 - ok; 50 - ok, clm50 bgc answer changing - yellowstone_pgi : 40 - ok; 45 - ok; 50 - ok, clm50 bgc answer changing - yellowstone_gnu (clm45 only) : 45 - ok; 50 - ok, clm50 bgc answer changing - hobart_nag : 45 - ok; 50 - ok, clm50 bgc answer changing - -CLM tag used for the baseline comparisons: clm4_5_2_r125 - -Changes answers relative to baseline: yes - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm50 bgc compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): climate changing for clm 5.0 - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - Parameter change based on experiments described in - - Koven, C.D., D.M. Lawrence, and W.J. Riley, 2015: - Permafrost-carbon feedback: Sensitivity to deep soil - decomposability and nitrogen cycle. PNAS, - DOI:10.1073/pnas.1415123112. - - Lawrence, D.M., C.D. Koven, S.C. Swenson, W.J. Riley, and - A.G. Slater, 2015: Permafrost thaw and resulting soil moisture - changes regulate projected high-latitude CO2 and CH4 - emission. ERL, 10, doi:10.1088/1748-9326/10/9/094011. - - URL for LMWG diagnostics output used to validate new climate: - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r125 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue Sep 15 22:08:09 MDT 2015 -One-line Summary: clm 5.0 hydrology - -Purpose of changes: clm 5.0 hydrology - - Dry surface layer soil evaporative resistance from Sean Swenson - Richards equation with adaptive time stepping from Martyn Clark - Zero-flux lower boundary for soil moisture - Deep soil column (10 meters) - Variable depth to bedrock from Sean Swenson - Canopy interception and maximum leaf wetted fraction change - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): unknown - -Known bugs (include bugzilla ID): 2213 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - Added new namelist variables for clm 5.0 hydrology. See namelist - definition file for details. use_bedrock, deep_soilcolumn, - soilwater_movement_method, upeer_boundary_condition, - lower_boundary_condition, soil_resis_method, - rooting_profile_method, interception_fraction, - maximum_leaf_wetted_fraction. - -List any changes to the defaults for the boundary datasets: unknown - -Describe any substantial timing or memory changes: unknown - -Code reviewed by: Sean Swenson - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: unknown - -List all files added and what they do: - - clm/cimetest/testmods_dirs/clm/deepsoil_bedrock - new test for clm50 hydrology options. - - clm/src/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90 - adds placeholder for vanGenuchten soil water retention curve - - -List all existing files that have been modified, and describe the changes: unknown - - clm/cimetest/testlist_clm.xml - new test - - clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 - clm/tools/clm4_5/mksurfdata_map/src/Srcfiles - clm/tools/clm4_5/mksurfdata_map/src/mkvarctl.F90 - clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 - clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - new namelist options - clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - clm/bld/namelist_files/namelist_definition_clm4_5.xml - clm/bld/CLMBuildNamelist.pm - - clm/src/cpl/lnd_import_export.F90 - - clm/src/biogeochem/CNVegStateType.F90 - - clm/src/main/clm_varpar.F90 - clm/src/main/ColumnType.F90 - clm/src/main/init_hydrology.F90 - clm/src/main/controlMod.F90 - clm/src/main/clm_varctl.F90 - clm/src/main/pftconMod.F90 - clm/src/main/initVerticalMod.F90 - clm/src/main/clm_instMod.F90 - - clm/src/biogeophys/WaterStateType.F90 - clm/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 - clm/src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 - clm/src/biogeophys/SoilWaterRetentionCurveMod.F90 - clm/src/biogeophys/IrrigationMod.F90 - clm/src/biogeophys/SurfaceResistanceMod.F90 - clm/src/biogeophys/HydrologyDrainageMod.F90 - clm/src/biogeophys/RootBiophysMod.F90 - clm/src/biogeophys/BalanceCheckMod.F90 - clm/src/biogeophys/SoilWaterMovementMod.F90 - clm/src/biogeophys/SoilMoistStressMod.F90 - clm/src/biogeophys/CanopyHydrologyMod.F90 - clm/src/biogeophys/CanopyTemperatureMod.F90 - clm/src/biogeophys/SoilHydrologyMod.F90 - clm/src/biogeophys/HydrologyNoDrainageMod.F90 - clm/src/biogeophys/SoilStateType.F90 - clm/src/biogeophys/SoilHydrologyType.F90 - clm/src/biogeophys/BareGroundFluxesMod.F90 - clm/src/biogeophys/CanopyFluxesMod.F90 - clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - - clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 - clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 - -CLM testing: - - build-namelist tests: - - yellowstone - CLMBuildNamelist unit tests pass - - unit-tests (components/clm/src): - - yellowstone - pass - - tools-tests (components/clm/test/tools): - - yellowstone - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone - n/a - - regular tests (aux_clm40, aux_clm45): - - NOTE: for all aux_clm45 machine/compiler combinations - clm50 compsets not bit for bit with baseline (new hydrology model is used). - - yellowstone_intel : aux_clm40 - pass; aux_clm45 - clm 45 compsets pass, clm50 compsets not bit for bit - yellowstone_pgi : aux_clm40 - pass; aux_clm45 - clm 45 compsets pass, clm50 compsets not bit for bit - yellowstone_gnu (clm45 only) : aux_clm45 - clm 45 compsets ok, clm50 compsets not bit for bit - hobart_nag : aux_clm45 - clm 45 compsets ok, clm50 compsets not bit for bit. bug 2213 still applies for clm45 compsets. - -CLM tag used for the baseline comparisons: clm4_5_2_r124 - -Changes answers relative to baseline: - clm40 and clm45 compsets are bit for bit. clm50 compsets are answer changing. - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm50 compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff, unknown climate. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: unknown - - URL for LMWG diagnostics output used to validate new climate: - unknown - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r124 -Originator(s): sacks (Bill Sacks) -Date: Sun Sep 13 06:33:20 MDT 2015 -One-line Summary: Wind-dependent snow density - -Purpose of changes: - - Add an option to make snow density dependent on wind speed. There are two - components to this: (1) adding a wind-related factor to the fresh snow - density, and (2) adding a wind-related factor for the compaction of the - existing snow pack (applying just to the top layer). This allows for more - realistic (higher) fresh snow densities in windy conditions. - - Other than myself, contributors to these changes are: Jan Lenaerts, Leo van - Kampenhout and Drew Slater. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: new option: 'wind_dependent_snow_density' - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Renamed -D components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology.pf - -List all files added and what they do: - -========= Tests of some of the new code -A components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_windCompactionFactor.pf - -========= Renamed -A components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_initSnowLayers.pf - -List all existing files that have been modified, and describe the changes: - -========= Add wind-dependent snow density parameterizations and control flag -M components/clm/src/main/controlMod.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Add tests for some of the new code -M components/clm/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_2_r123 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all CLM50 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; magnitude not investigated in detail - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r123 -Originator(s): sacks (Bill Sacks) -Date: Thu Sep 10 10:25:55 MDT 2015 -One-line Summary: Fix some problems with pgi and nag compilers - -Purpose of changes: - - (1) Fix some problems with the nag compiler: fix bug 2208, but open new bug - 2213 - - (2) Work around some problems that appear with pgi 15.7 (appear to be - compiler bugs), which Sean Santos tracked down: The key problem is that - PGI is exporting some names that should have been aliased. So for - instance: - - use foo_mod, only: foo_bar => bar - - In this case, if you have a "use" without an "only" of foo_mod, you get - both foo_bar and bar imported into the namespace. - - Note: I have not been able to test these changes with pgi 15.7, because - there is a PIO build problem with pgi 15.7 - - (3) No longer kill the run if we're using ozone with pgi: The pgi compiler - bug that showed up with the ozone code has been fixed as of pgi 15.1, - which is now our default. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 2208: nag reports a problem with associate statement to un-allocated LUNA - memory in photosynthesisMod (but see new bug 2213) - 2094: ozone code doesn't work with the PGI compiler - -Known bugs (include bugzilla ID): - 2213: CLM45 / CLM50 runs without BGC die with NAG compiler, due to associate - to unallocated memory - - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Fix for pgi 15.7. CLM40 changes from Sean Santos; I ported these - changes to CLM45 -M components/clm/src_clm40/main/lnd_comp_mct.F90 -M components/clm/src_clm40/main/spmdGathScatMod.F90 -M components/clm/src/cpl/lnd_comp_mct.F90 -M components/clm/src/utils/spmdGathScatMod.F90 - -========= Fix for nag from Ben Andre -M components/clm/src/biogeophys/PhotosynthesisMod.F90 - -========= No longer abort if running with pgi -M components/clm/src/biogeophys/OzoneMod.F90 - -========= Remove ozone pgi test, because it runs out of wallclock time (but I - believe it would now pass: a shorter version now passes) -M components/clm/cimetest/testlist_clm.xml - -========= Update xFails: Add hobart_nag xFails, remove no-longer-relevant or - no-longer-failing tests (many have been passing for a while now) -M components/clm/cimetest/ExpectedTestFails.xml - - -CLM testing: - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: ok - However, all runs without BGC still die: see bug 2213 and - ExpectedTestFails list - -CLM tag used for the baseline comparisons: clm4_5_2_r122 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r122 -Originator(s): sacks (Bill Sacks) -Date: Wed Sep 9 05:57:15 MDT 2015 -One-line Summary: Update to latest cime - -Purpose of changes: - - Update cime to the version likely to be in cesm1_4_beta07 - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: none - -List any svn externals directories updated (cime, rtm, cism, etc.): - - cime2.0.7 -> cime2.0.17 - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Change instructions: no longer need dot in your path -M components/clm/src/README.unit_testing - -========= Remove CME and NCK expected failures: these pass now, presumably due - to fixes in cime (although since the failures were intermittent, it's - hard to say definitively that the problem is fixed) -M components/clm/cimetest/ExpectedTestFails.xml - -- CFAIL CME_Ld5.f10_f10.ICN.yellowstone_intel -- CFAIL CME_Ly4.f10_f10.I1850CLM45BGC.yellowstone_intel.clm-monthly -- FAIL NCK_Ld1.f10_f10.ICRUCLM45.yellowstone_intel.clm-default -- RUN NCK_Ld1.f10_f10.ICRUCLM45.yellowstone_intel.clm-default - -CLM testing: - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: clm40 ok, CLM45 NOT RUN - Note that there is still a problem with clm45 nag - -CLM tag used for the baseline comparisons: clm4_5_2_r121 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_2_r121 -Originator(s): sacks (Bill Sacks) -Date: Fri Sep 4 10:55:54 MDT 2015 -One-line Summary: Rework snow capping - -Purpose of changes: - - Main change is a complete rework of snow capping. Previously, when the snow - pack was in a "capped" state (i.e., h2osno >= h2osno_max), new snow and rain - were prevented from falling on the snow pack: it was as if someone put a roof - over the snow. (However, there were workarounds in place that caused the - aerosol concentration and snow grain size in the top snow layer to continue - to evolve as if new snow was still falling.) This was problematic in terms of - the long-term evolution of the snow pack, since in effect the new, less dense - snow was being removed due to capping. So, at least in some regions, the snow - pack became much more dense than it should be. - - The new snow capping scheme allows snow and rain to fall on the top as they - would in the uncapped state. But if h2osno exceeds h2osno_max, then mass is - removed from the *bottom* snow layer. This removes the need for the old - workarounds, and is more physically realistic: This represents the process of - converting snow to glacial ice, which in reality occurs at the bottom (most - dense) portion of the snow pack. - - - Also, a mostly-unrelated change: rearrange the multi-layer snow history - fields, so that index 1 is always the top of the snow pack. - - - These changes are from Leo van Kampenhout (l.vankampenhout@uu.nl) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Rework handling of snow capping. This is now done pretty much entirely - in SnowHydrologyMod, in a completely different way than before. -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/LakeFluxesMod.F90 -M components/clm/src/biogeophys/SoilFluxesMod.F90 -M components/clm/src/biogeophys/WaterStateType.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/main/clm_driver.F90 - -========= Remove some old workarounds that were put in place to get reasonable - answers with the old snow capping method -M components/clm/src/biogeophys/AerosolMod.F90 -M components/clm/src/biogeophys/SnowSnicarMod.F90 - -========= Rearrange multi-layer snow history fields -M components/clm/src/main/histFileMod.F90 -M components/clm/doc/UsersGuide/custom.xml - -========= Trivial changes (removing associate lines, changing comments, etc.) -M components/clm/src/biogeophys/HydrologyDrainageMod.F90 -M components/clm/src/biogeophys/SoilHydrologyMod.F90 -M components/clm/src/biogeophys/CanopyTemperatureMod.F90 -M components/clm/src/biogeophys/UrbanFluxesMod.F90 -M components/clm/src/biogeochem/ch4Mod.F90 - - -CLM testing: - - unit-tests (components/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - hobart_nag: NOT RUN - hobart_nag tests still all fail, as they did in clm4_5_1_r120 - -CLM tag used for the baseline comparisons: clm4_5_1_r120 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All clm4.5 and clm5.0 configurations - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Definitely larger than roundoff. Whether this is the same or new climate - has not been investigated carefully. However, at least in some regions - with persistent snow cover, this change has a significant effect on the - evolution of the snow pack, as described above. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r120 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Sat Aug 29 22:58:57 MDT 2015 -One-line Summary: CLM 5 nitrogen models Flexible CN and LUNA - -Purpose of changes: - CLM 5 nitrogen models Flexible CN (Bardan Ghimire, LBNL) - and LUNA (Chonggang Xu, LANL). The LUNA model predicts - photosynthetic capacities as measured by Vc, max25 and Jmax25 - under different environmental conditions (see Ali et al 2015). - -Requirements for tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - 2208 - https://github.com/CESM-Development/cime/issues - 115, 116 - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - addition of use_luna and use_flexibleCN. use_flexibleCN adds - additional namelist options in the clm_nitrogen group. See xml - definitions file for details. - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self, Bardan Ghimire, Chonggang Xu - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 - flexibleCN. - cimetest/testmods_dirs/clm/flexibleCN - flexible cn regression test - src/biogeophys/LunaMod.F90 - luna model - cimetest/testmods_dirs/clm/luna - luna regression case - -List all existing files that have been modified, and describe the changes: - - new namelist controls for flexibleCN and luna, clm_nitrogen namelist group: - bld/namelist_files/namelist_definition_clm4_5.xml - bld/namelist_files/namelist_defaults_clm4_5.xml - bld/CLMBuildNamelist.pm - src/main/clm_varctl.F90 - src/main/controlMod.F90 - - flexibleCN - src/biogeochem/CNVegCarbonStateType.F90 - Michaelis-Menten Nitrogen uptake - src/biogeochem/CNVegNitrogenStateType.F90 - Michaelis-Menten Nitrogen uptake - - src/biogeochem/CNGRespMod.F90 - excess carbon storage - src/biogeochem/CNGapMortalityMod.F90 - excess carbon storage - - src/biogeochem/NutrientCompetitionFactoryMod.F90 - add flexible cn option - src/biogeochem/NutrientCompetitionMethodMod.F90 - modify interface to accomidate flexiblecn - src/biogeochem/CNPhenologyMod.F90 - floating cn evergreen phenology - src/biogeochem/CNDriverMod.F90 - update function call args - src/main/pftconMod.F90 - flexible cn pft variables - - src/main/histFileMod.F90 - nlev canopy - src/main/clm_driver.F90 - update function call args - src/main/clm_instMod.F90 - update function call args - src/biogeophys/WaterfluxType.F90 - additional water flux vars - src/biogeophys/SoilWaterMovementMod.F90 - soil water work around - - LUNA - src/main/clm_varcon.F90 - new constant for luna - src/biogeophys/PhotosynthesisMod.F90 - luna use of vcmax25 and jmax25 - src/biogeophys/CanopyFluxesMod.F90 - luna calculation of vcmax25 and jmax25 - src/main/atm2lndType.F90 - state data needed for luna - src/biogeophys/FrictionVelocityMod.F90 - luna variables - src/biogeophys/WaterStateType.F90 - luna variables - src/biogeophys/TemperatureType.F90 - luna variables - src/biogeophys/SolarAbsorbedType.F90 - luna variables - src/biogeophys/QSatMod.F90 - saturated vapor pressure density - src/biogeophys/SoilHydrologyType.F90 - luna var - src/biogeophys/CanopyStateType.F90 - update vcmax and jmax for luna - - cimetest/ExpectedTestFails.xml - update for cime bugs 115 and 116 - cimetest/testlist_clm.xml - update test list for aux_clm_short, new luna and flexibleCN tests - - -CLM testing: regular, build-namelist - - build-namelist tests: - - yellowstone - unit tests : pass, other pass - - unit-tests (components/clm/src): - - yellowstone - ok - - tools-tests (components/clm/test/tools): n/a - - PTCLM testing (components/clm/tools/shared/PTCLM/test): n/a - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel - 40 ok, 45 ok - yellowstone_pgi - 40 ok, 45 ok - yellowstone_gnu (clm45 only) ok - hobart_nag - not run, tests hang, see bug 2208 - - Testing notes: - - * new namelist group clm_nitrogen causes all nlcomp tests to fail - * introduces new tests for flexibleCN and luna that do not - have baselines in clm4_5_1_r119. - * two new expected fails believed to be related to cime issues - 115 and 116. - * removes the existing aux_clm_short tests and replaces them with - a new set of SMS, ERS and ERP tests that are replicated for - yellowstone gnu, intel and pgi. - -CLM tag used for the baseline comparisons: clm4_5_1_r119 - -Changes answers relative to baseline: none - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r119 -Originator(s): erik (Erik Kluzek) -Date: Wed Aug 26 22:29:10 MDT 2015 -One-line Summary: Bring hobart/nag bug fixes to trunk, and fix a few bugs - -Purpose of changes: - -Bring hobart/nag bug fixes to trunk. Fix ncl6.3.0 bug for getregional script. -Fix use_c13 bug. Update RTM to handle regional direction files. Make sure _r8 -constants in ED have a decimal point, so the NAG compiler will treat them as -double-precision rather than as integer*2. - -Move testing from goldbach to hobart. For hobart_nag make all of the tests -on just one node (24 processors). - -Requirements for tag: compile run with hobart/nag (fix bugs 2205 and 2199) - move testing from goldbach to hobart - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 2206 (PTCLM stopped working with pft number in surface dataset filenames for mksurfdata.pl) - 2205 (Problems with some constants in ED for NAG compiler) - 2199 (crayftn compiler issue with continuation in middle of string) - 2180 (ncl6.3.0 bug for getregional script) - 2174 (use_c13 bug, unformatted write caused model to die) - 2156 (Update RTM to handle regional direction files) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, klindsay - -List any svn externals directories updated (cime, rtm, cism, etc.): PTCLM, cime and rtm - cime to cime2.0.07 - rtm to rtm1_0_52 - PTCLM to PTCLM2_150826 - -List all files eliminated: Move goldbach to hobart - -D components/clm/test/tools/tests_posttag_goldbach_nompi - -List all files added and what they do: Move goldbach to hobart - -A components/clm/test/tools/tests_posttag_hobart_nompi - -List all existing files that have been modified, and describe the changes: - ------------- Move goldbach to hobart, remove PGI option for hobart -M components/clm/test/tools/test_driver.sh - -M components/clm/bld/unit_testers/build-namelist_test.pl -- Fix ED tests so megan off - -M components/clm/cimetest/testlist_clm.xml --- Move goldbach tests to hobart - Make 2-node hobart_nag tests on a single node - -M components/clm/tools/shared/mkmapgrids/mkscripgrid.ncl -- Fix so will - work with ncl6.3.0, bug 2180 - -M components/clm/src/README.unit_testing --- add some notes about unit-testing - ------------- Bug 2205, some _r8 constants in ED don't have a decimal point ------------- and the NAG compiler then treats them as integer*2. -M components/clm/src/ED/main/EDCLMLinkMod.F90 -M components/clm/src/ED/main/EDRestVectorMod.F90 -M components/clm/src/ED/main/EDInitMod.F90 -M components/clm/src/ED/fire/SFMainMod.F90 -M components/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 -M components/clm/src/ED/biogeophys/EDBtranMod.F90 -M components/clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90 -M components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 -M components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 -M components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 - ------------- Bug 2199, write to iulog was unformatted, which caused the model ------------- to die after it had already done formatted writes. -M components/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -M components/clm/src/biogeochem/CNVegCarbonStateType.F90 - -CLM testing: - - build-namelist tests: - - yellowstone yes - - unit-tests (components/clm/src): - - yellowstone yes - - tools testing (components/clm/test/tools): - - yellowstone yes - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, aux_clm_short): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu (clm45 only) yes - hobart_nag yes - hobart_pgi yes - hobart_intel yes - -CLM tag used for the baseline comparisons: clm4_5_1_r118 - -Changes answers relative to baseline: no - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r118 -Originator(s): sacks (Bill Sacks) -Date: Wed Aug 5 16:22:33 MDT 2015 -One-line Summary: Minor rework of glc coupling fields - -Purpose of changes: - - This makes CLM compatible with recent CIME changes. - - (1) Use renamed coupler field, in both clm40 and clm45 - - (2) In clm45 code, rework clm_cpl_indices to use glc_elevclass_mod (simpler - and more robust than the earlier code) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): - - cime1.1.11 -> cime2.0.0 - cism2_0_09 -> cism2_1_02 - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Main changes -M components/clm/src/cpl/clm_cpl_indices.F90 -M components/clm/src/cpl/lnd_import_export.F90 -M components/clm/src_clm40/main/clm_cpl_indices.F90 -M components/clm/src_clm40/main/lnd_import_export.F90 - -========= Document new unit testing method needed for yellowstone, due to cime update -M components/clm/src/README.unit_testing - -========= Rework test mods due to a fundamental change in how the forced - decrease / increase in glc area works -M components/clm/cimetest/testmods_dirs/clm/glcMEC_decrease/user_nl_cism -M components/clm/cimetest/testmods_dirs/clm/glcMEC_increase/user_nl_cism - -========= New failures, which seem to be attributable to the cime update, - unrelated to my changes. However, the NCK and CME test failures seem - dependent on the order in which tests are run, so these problems are - hard to reproduce. Running them as single tests leads to PASSes. -M components/clm/cimetest/ExpectedTestFails.xml -+ CFAIL CME_Ld5.f10_f10.ICN.yellowstone_intel -+ FAIL NCK_Ld1.f10_f10.ICRUCLM45.yellowstone_intel.clm-default -+ RUN ERS_D_Mmpi-serial_Ld5.1x1_brazil.ICLM45ED.yellowstone_gnu.clm-edTest - - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - but see caveat below! - -As noted above, there are three new test failures. The ERS_D ICLM45ED failure -seems to be a legitimate bug in CLM. The other two (CFAIL -CME_Ld5.f10_f10.ICN.yellowstone_intel and FAIL -NCK_Ld1.f10_f10.ICRUCLM45.yellowstone_intel.clm-default) seem to be intermittent -failures, likely due to a bug in the test system or elsewhere in cime. These -sometimes pass and sometimes fail. They always seem to pass when run as single -tests, but sometimes fail when run as part of a test suite. It's not clear if -the new cime is to blame directly, or if these are arising now simply because -tests are being run in a different order. - -golbach-nag does not run out-of-the-box with this tag. However, it should run -out-of-the-box if you merge in the next commit in cime master -(4b52ec73086a4290323dddfde6087a6d6d12ab96). I did my changes with that commit -merged in, but this hadn't come to master in time for me to include it in this -CLM tag. - -CLM tag used for the baseline comparisons: clm4_5_1_r117 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Configurations with CISM (IG), both CLM4 and CLM45 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Likely larger than roundoff/same climate (but not investigated closely) - - These changes are due to a complete rework of the coupling between CISM - and CLM, manifested as major changes in the CIME and CISM externals. (The - changes in CLM are not directly responsible for the answer changes.) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r117 -Originator(s): sacks (Bill Sacks) -Date: Tue Jul 28 06:01:04 MDT 2015 -One-line Summary: Repartition rain vs. snow from atmosphere - -Purpose of changes: - - Add an option to repartition rain vs. snow from atmosphere based on - near-surface temperature. This repartitioning uses a ramp-based partitioning - that is also used in datm: we ignore the rain vs. snow partitioning sent from - the atmosphere, and generate our own rain vs. snow partitioning. A sensible - heat flux is generated to conserve energy with this repartitioning. - - The motivation for this is two-fold: - - (1) There are biases in CAM which cause rain to be generated in cold - conditions. This is particularly a problem for glacier surface mass - balance in Greenland. Andrew Gettelman has suggested putting in place - this workaround in CLM until CAM can find a robust fix. - - (2) With the downscaling to glacier elevation classes, it is useful to have - a different rain/snow partitioning in each elevation class. - - This repartitioning is on by default in CLM5, off by default in CLM4.5. - - If / when the CAM bias is fixed, we could potentially change this code so - that it just does the repartitioning over the do_smb filter, similarly to the - other downscaling in atm2lndMod. (Rather than doing this correction - everywhere - which we do now in order to correct the rain vs. snow - partitioning bias in CAM.) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - Removed glcmec_downscale_rain_snow_convert option, added - repartition_rian_snow option - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Sean Swenson reviewed the calculation of the sensible heat -flux correction - -List any svn externals directories updated (cime, rtm, cism, etc.): - - cime1.1.10 -> cime1.1.11 - This creates a new shared routine for partitioning rain vs. snow, now shared - between datm and CLM. - -List all files eliminated: - -List all files added and what they do: - -========= Add unit tests for repartitioning of rain vs snow, and supporting - utility code -A components/clm/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf -A components/clm/src/main/test/atm2lnd_test/CMakeLists.txt -A components/clm/src/main/test/atm2lnd_test/test_partition_precip.pf -A components/clm/src/main/test/atm2lnd_test -A components/clm/src/unit_test_shr/unittestArrayMod.F90 -A components/clm/src/unit_test_shr/test/unittestArray_test/CMakeLists.txt -A components/clm/src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf -A components/clm/src/unit_test_shr/test/unittestArray_test - -List all existing files that have been modified, and describe the changes: - -========= Repartition rain vs snow from atmosphere, and add a sensible heat flux - correction for energy conservation -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/src/main/clm_driver.F90 -M components/clm/src/main/clm_varctl.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/src/main/atm2lndType.F90 -M components/clm/src/main/lnd2atmType.F90 -M components/clm/src/main/atm2lndMod.F90 -M components/clm/src/main/lnd2atmMod.F90 - -========= Remove glcmec_rain_snow_threshold -M components/clm/src/main/clm_varcon.F90 - -========= Remove glcmec_downscale_rain_snow_convert option, add - repartition_rain_snow option -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Add an IG CLM5 test -M components/clm/cimetest/testlist_clm.xml - -========= Remove glcmec_downscale_rain_snow_convert setting (which no longer exists) -M components/clm/cimetest/testmods_dirs/clm/glcMEC_changeFlags/user_nl_clm - -========= Add unit tests for repartitioning of rain vs snow, and supporting - utility code -M components/clm/src/main/CMakeLists.txt -M components/clm/src/main/test/CMakeLists.txt -M components/clm/src/biogeophys/CMakeLists.txt -M components/clm/src/unit_test_shr/test/CMakeLists.txt -M components/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 -M components/clm/src/unit_test_shr/CMakeLists.txt - -CLM testing: - - build-namelist tests: - - yellowstone: ok (changes namelists, as expected) - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r116 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM5 cases - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Likely new climate, but not investigated closely - - Answer changes are due to new rain vs. snow partitioning, which is on by - default in CLM5. - - Also changes answers for - ERP_D_Ld5.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC_changeFlags - (expected, since it no longer downscales precip). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r116 -Originator(s): sacks (Bill Sacks) -Date: Wed Jul 22 06:39:28 EDT 2015 -One-line Summary: Rename some history fields - -Purpose of changes: - - (1) Make QSNOMELT point to qflx_snomelt, as it does in CLM4.0, rather than - qflx_snow_drain (previously qflx_snow_melt) - - (2) Turn on QSNOFRZ by default (parallels QSNOMELT) - - (3) For the 3 history fields that have FOO and FOO_NODYNLNDUSE versions: - Rename FOO to FOO_TO_COUPLER and FOO_NODYNLNDUSE to FOO. This is at Sean - Swenson's suggestion: He points out that the version without the dyn landuse - adjustment (and, soon, the sensible heat adjustment from rain/snow - conversion) is the one most people will be interested in, so should be the - one without the suffix. - - (4) Tweak test lists: - - (a) Move prealpha & prebeta goldbach tests to hobart - - (b) Move an aux_clm45 pgi test to intel: With recent versions of cime - (starting with cime1.1.0), threading tests with pgi take a very long time. So - this test took 3 hours with pgi, vs 20 min with intel. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 2178 (QSNOMELT incorrect in clm4.5) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= See summary above -M components/clm/src/main/lnd2atmType.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/EnergyFluxType.F90 -M components/clm/cimetest/testlist_clm.xml - - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: NOT RUN - mac: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r115 - -Changes answers relative to baseline: YES - - Just changes a few diagnostic fields, for CLM4.5 and CLM5: - - - QSNOMELT: changed to qflx_snomelt rather than qflx_snow_drain - - - QRUNOFF: differs for cases with transient landcover - - - FSH: differs for cases with CISM - - - QSNWCPICE: differs for cases with CISM - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r115 -Originator(s): sacks (Bill Sacks) -Date: Wed Jul 15 05:26:37 MDT 2015 -One-line Summary: Remove redundant code, rename a variable - -Purpose of changes: - - (1) Remove some redundant code in SnowHydrologyMod, related to 'void'. This - was supposed to be removed a long time ago. (Apparently the issue this was - trying to fix was fixed in a different, more robust way.) - - (2) Remove redundant, unused copy of accumulMod in utils/ (newer copy is in - main/) - - (3) Rename qflx_snow_melt to qflx_snow_drain, to avoid confusion with the - existing qflx_snomelt. - - (4) Clarify documentation of snowdp_col - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: - -========= Redundant and unused (copy in main/ is used) -D components/clm/src/utils/accumulMod.F90 - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Rename qflx_snow_melt to qflx_snow_drain -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 -M components/clm/src/biogeophys/LakeHydrologyMod.F90 -M components/clm/src/biogeophys/BalanceCheckMod.F90 -M components/clm/src/biogeophys/WaterfluxType.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - - also remove redundant lines of code related to 'void' (see above) -M components/clm/src/biogeophys/LakeTemperatureMod.F90 - -========= Clarify documentation for snowdp_col -M components/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M components/clm/src/biogeophys/WaterStateType.F90 - -========= Remove SMS_Lm25.f10_f10.ICLM45BGCCROP.goldbach_nag.clm-reduceOutput - (runs out of wall-clock time, and we have sufficient test coverage of - that configuration) -M components/clm/cimetest/testlist_clm.xml - - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r114 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r114 -Originator(s): sacks (Bill Sacks) -Date: Fri Jul 10 19:34:57 MDT 2015 -One-line Summary: Update cime external, remove genf90-generated files - -Purpose of changes: - - Main purpose is to update the cime external to the version in cesm1_4_beta05. - - This also required updating the unit test build to use genf90 during the - build rather than relying on already-generated files. - - Making this change led to some genf90'd files being regenerated in-source - during the unit test build, which would lead these files to be updated every - time we make a tag. To avoid this annoyance, I have removed the genf90'd - files from the repository: These are not needed any more in either the unit - test or system builds, and it simplifies things to remove them. - - Then I added an svn:ignore property to ignore files generated by genf90 - during the unit test build. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): - - cime1.0.7 -> cime1.1.10 - - Among other things, this brings in Jay's big batch system refactor - -List all files eliminated: - -========= Remove genf90-generated files, and some scripts that were used to - create them (these are now created as part of the unit test or system build) -D components/clm/src/dyn_subgrid/dynVarMod.F90 -D components/clm/src/dyn_subgrid/dynVarTimeInterpMod.F90 -D components/clm/src/dyn_subgrid/dynVarTimeUninterpMod.F90 -D components/clm/src/dyn_subgrid/do_genf90 -D components/clm/src/unit_test_stubs/utils/do_genf90 -D components/clm/src/unit_test_stubs/utils/restUtilMod_stub.F90 -D components/clm/src/unit_test_stubs/main/ncdio_var.F90 -D components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90 -D components/clm/src/unit_test_stubs/main/do_genf90 -D components/clm/src/utils/restUtilMod.F90 -D components/clm/src/main/ncdio_pio.F90 - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Generate files with genf90 rather than using pre-generated files -M components/clm/src/CMakeLists.txt - -========= Document new, simpler method for building and running the unit tests - (thanks largely to new default options in run_tests.py) -M components/clm/src/README.unit_testing - -========= Add svn:ignore property to ignore files generated by genf90 during the - unit test build - M components/clm/src/dyn_subgrid - M components/clm/src/unit_test_stubs/utils - M components/clm/src/unit_test_stubs/main - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r112 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: intel - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff, according to cime documentation - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A: Trusting Sean Santos's cime documentation. - - These changes were likely due to this change in cime: - - commit 0d7eab6bd112565ba9eb6eb82b74127ae5a5f390 - Author: Sean Patrick Santos - Date: Fri May 15 12:35:31 2015 -0600 - - Use our native gamma/erf implementations on Intel - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r113 -Originator(s): sacks (Bill Sacks) -Date: Thu Jul 9 10:01:13 MDT 2015 -One-line Summary: Support backwards compatibility of restart variable names - -Purpose of changes: - - Previously, if a restart variable was renamed, backwards compatibility was - implemented in an ad-hoc manner. A key point is taht none of these ad-hoc - solutions allowed backwards compatibility when running - initInterp. (initInterp would just skip any variable if it could not find an - exact match on the input [template] file.) - - This tag provides a standard mechanism for putting in place backwards - compatibility when renaming a restart variable. This backwards compatibility - carries over to initInterp, by communicating the necessary metadata through a - new attribute on the restart file: 'varnames_on_old_files'. - - In order to use this new mechanism, give a colon-delimited list of variable - names in the varname argument to restartvar. For example, if a restart - variable FOO has been renamed to BAR, then specify varname='BAR:FOO'. Note - that this list is searched in order, and the first item should be the current - restart variable name. - - Also, applied this new mechanism to the recently-added LIQCAN - variable. Previously, backwards compatibility of this variable was handled in - an ad-hoc manner, which did not work when running initInterp. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Erik - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Add module for higher-level netcdf utilities. Currently contains - routine for finding a variable on a netcdf file from a list of - possible variables. Also add unit tests for this routine. -A components/clm/src/main/ncdio_utils.F90 -A components/clm/src/main/test/ncdio_utils_test/test_ncdio_utils.pf -A components/clm/src/main/test/ncdio_utils_test/CMakeLists.txt -A components/clm/src/main/test/ncdio_utils_test - -List all existing files that have been modified, and describe the changes: - -========= Allow multiple possible names in reading restart files and in reading - the 'input' file in initInterp -M components/clm/src/utils/restUtilMod.F90.in -M components/clm/src/utils/restUtilMod.F90 -M components/clm/src/main/initInterp.F90 - -========= Apply new mechanism to recently-added LIQCAN restart field. Also - remove redundant setting of snocan_patch to 0 if it isn't found on the - restart file - not needed since initCold is always called. -M components/clm/src/biogeophys/WaterStateType.F90 - -========= Changes to support unit testing of ncdio_utils -M components/clm/src/main/CMakeLists.txt -M components/clm/src/main/test/CMakeLists.txt -M components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90.in -M components/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90 - -========= Fix path to genf90 for new cime organization -M components/clm/src/unit_test_stubs/main/do_genf90 -M components/clm/src/unit_test_stubs/main/ncdio_var.F90 - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r112 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r112 -Originator(s): oleson (Keith Oleson,UCAR/TSS,303-497-1332) -Date: Wed Jul 1 10:14:11 MDT 2015 -One-line Summary: Justin Perket snow on vegetation - -Purpose of changes: Incorporate Justin Perket's snow on vegetation changes - -Requirements for tag: - -Test level of tag: regular, build-namelist, unit_tests - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: Add snowveg_flag item - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Keith Oleson, Justin Perket, Erik Kluzek - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: -M components/clm/src/README.unit_testing Add note that instructions are for bash shell -M components/clm/src/biogeophys/CanopyFluxesMod.F90 snow/liq on vegetation -M components/clm/src/biogeophys/WaterStateType.F90 history/restart handling for snow/liq on vegetation -M components/clm/src/biogeophys/BalanceCheckMod.F90 line spaces only -M components/clm/src/biogeophys/WaterfluxType.F90 history handling for snow on vegetation -M components/clm/src/biogeophys/CanopyHydrologyMod.F90 snow/liq on vegetation and snowveg_flag handling -M components/clm/src/biogeophys/SurfaceAlbedoMod.F90 snow on vegetation optical properties -M components/clm/src/main/controlMod.F90 line spaces only -M components/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml snowveg_flag handling -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml snowveg_flag handling -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml snowveg_flag handling -M components/clm/bld/CLMBuildNamelist.pm snowveg_flag handling - -CLM testing: - - build-namelist tests: - - yellowstone: ok - All CLM45 and CLM50 tests have namelist differences; this is expected due - to addition of new namelist item - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r111 - -Changes answers relative to baseline: Yes, for CLM50 - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM50 - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - New climate. See Justin Perket (perketj@umich.edu) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? NA - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: NA - - URL for LMWG diagnostics output used to validate new climate: NA - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r111 -Originator(s): sacks (Bill Sacks) -Date: Fri Jun 12 20:19:25 MDT 2015 -One-line Summary: Remove temporary hack to get bfb results in InitSnowLayers - -Purpose of changes: - - In order to get bit-for-bit results in clm4_5_1_r110 (relative to r109), we - put in place a temporary hack in InitSnowLayers that set dz based on the old - equations rather than the new, more general ones - thus avoiding - roundoff-level changes. This looked like: - - if (abs(dz(c,0)-3.59_r8) < eps) then ! TODO remove - col%dz(c, 0) = snow_depth(c)-col%dz(c,-4)-col%dz(c,-3)-col%dz(c,-2)-col%dz(c,-1) - if (abs(dz(c,0)-3.59_r8) > eps) & - call endrun(msg=errmsg(__FILE__, __LINE__)) - endif - - This tag removes that temporary hack. - - In this way, we have separated the answer-changing from non-answer-changing - parts of the r110 refactor. Note that the above code confirms that the - differences are no larger than roundoff (eps was 1e-9 in the above case, but - some tests showed that it could have been much smaller - e.g., ~ 1e-15). - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r110 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 / CLM5 cold start - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - See above code sample, which confirms that the changes were no greater - than roundoff-level. - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r110 -Originator(s): sacks (Bill Sacks) -Date: Fri Jun 12 15:30:11 MDT 2015 -One-line Summary: Add flexibility to have more snow layers - -Purpose of changes: - - Generalize snow code so that it no longer assumes 5 snow layers. Instead, - make the number of snow layers (and the maximum SWE in the snow pack) a - runtime parameter, allowing 3 - 12 snow layers. - - Most changes were made by Leo van Kampenhout (l.vankampenhout@uu.nl). - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 2182 (possible threading issue with optimized pgi builds) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - new namelist parameters: nlevsno, h2osno_max - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: - -========= Add tests with different number of snow layers -A components/clm/cimetest/testmods_dirs/clm/snowlayers_12/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/snowlayers_12/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/snowlayers_12 -A components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly/user_nl_clm -A components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly/include_user_mods -A components/clm/cimetest/testmods_dirs/clm/snowlayers_3_monthly - -========= Add unit tests for snow pack initialization (note: these were added - mainly to facilitate debugging InitSnowLayers; since this routine is - only used in cold-start, these are not critical unit tests, and can be - removed if the maintenance cost proves too high) -A components/clm/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt -A components/clm/src/biogeophys/test/SnowHydrology_test/README -A components/clm/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology.pf -A components/clm/src/biogeophys/test/SnowHydrology_test - -List all existing files that have been modified, and describe the changes: - -========= Major rework to remove assumption of 5 snow layers - instead allow - runtime-setable number of snow layers, between 3 and 12. - Also, clean up white space throughout file, and add mode/indentation - emacs line. -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Minor changes to remove assumption of 5 snow layers -M components/clm/src/biogeophys/SurfaceRadiationMod.F90 -M components/clm/src/biogeophys/SoilTemperatureMod.F90 - - also: remove unused variables, fix array argument declarations to - conform to conventions -M components/clm/src/main/initVerticalMod.F90 - - also: clean up some white space - -========= Add namelist variables to control number of snow layers and maximum SWE -M components/clm/src/main/clm_varcon.F90 -M components/clm/src/main/clm_varpar.F90 -M components/clm/src/main/controlMod.F90 -M components/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M components/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M components/clm/bld/CLMBuildNamelist.pm - -========= Minor changes needed for unit testing of SnowHydrologyMod -M components/clm/src/biogeophys/CMakeLists.txt -M components/clm/src/biogeophys/test/CMakeLists.txt -M components/clm/src/biogeophys/SnowSnicarMod.F90 -M components/clm/src/biogeophys/SnowHydrologyMod.F90 -M components/clm/src/biogeophys/AerosolMod.F90 -M components/clm/src/main/CMakeLists.txt -M components/clm/src/unit_test_stubs/main/histFileMod_stub.F90 - -========= Add tests with different number of snow layers -M components/clm/cimetest/testlist_clm.xml - -========= Unrelated change: remove unused variables in associate statements -M components/clm/src/biogeophys/SoilFluxesMod.F90 - -========= Remove a test that now passes (hooray for weird compiler bugs!) -M components/clm/cimetest/ExpectedTestFails.xml - -CLM testing: - - build-namelist tests: - - yellowstone: ok - All CLM45 and CLM50 tests have namelist differences; this is expected due - to addition of 2 new namelist items. - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r109 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r109 -Originator(s): sacks (Bill Sacks) -Date: Sat Jun 6 06:12:02 MDT 2015 -One-line Summary: Fix bug in DivideSnowLayers - -Purpose of changes: - - Fix bug in DivideSnowLayers. Leo van Kampenhout (l.vankampenhout@uu.nl) - discovered the bug and determined how to fix it. He found this bug in the - course of refactoring this routine to introduce loops; without this bug fix, - answers differed with his new logic that removes duplication. - - Specifically: Logic using many IF-statements is employed to see whether or - not a layer may be subdivided, depending on the layer thickness. Currently, - the test for subdividing the BOTTOM layer are only reachable when the layer - above it was also too thick. As it turns out, this is faulty as a situation - can arise where the bottom layers grows even though the layer above it was - not divided, i.e. dumped mass to it. The current understanding is that this - happens through meltwater percolation (liquid h2o is translated to thickness - as well). - - Note that the indentation has not been appropriately corrected, this is because this - fix is only temporary (less cluttered logic will be implemented next). - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2183 (incorrect logic for sub-dividing bottom -snow layer in DivideSnowLayers) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Mark Flanner - -List any svn externals directories updated (cime, rtm, cism, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Bug fix, described above -M components/clm/src/biogeophys/SnowHydrologyMod.F90 - -========= Remove failures from here, now that we're using the file in cimetest -M components/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -========= Change a failure type from FAIL to RUN (presumably due to new test - reporting) -M components/clm/cimetest/ExpectedTestFails.xml - -CLM testing: - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r108 - -Changes answers relative to baseline: YES - - Summarize any changes to answers, i.e., - - what code configurations: All clm4.5 and clm5 - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Larger than roundoff. While not investigated carefully, Leo showed that - the impacts are relatively small, so this is believed NOT to be - climate-changing. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r108 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Fri May 29 15:14:26 MDT 2015 -One-line Summary: Crop changes from Sam Levis - -Purpose of changes: Crop model changes from Sam Levis. Increases the number of -crops to 64, with 78 total pfts. Requires new parameters file, surface dataset, -and land use timeseries files. - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2146, 2155 - -Known bugs (include bugzilla ID): 2180, 2182 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: n/a - -Describe any changes made to the namelist: n/a - -List any changes to the defaults for the boundary datasets: - Regenerate surface data sets and land use timeseries to increase the number of - pfts and crops with data from Levis. New raw datasets: - rawdata/pftlanduse.3minx3min.simyr2000.c110913/mksrf_78pft_landuse_rc2000_c130927.nc - rawdata/pftlandusedyn.0.5x0.5.simyr1850-2005.c090630/mksrf_78pft_landuse_rc2000_c150130.nc - -Describe any substantial timing or memory changes: - Increased memory usage for all crop runs. Exact consequences requires further study. - -Code reviewed by: andre, levis - -List any svn externals directories updated (cime, rtm, cism, etc.): n/a - -List all files eliminated: n/a - -List all files added and what they do: - components/clm/cimetest/ExpectedTestFails.xml - new expected fails file for upcoming cime xfail integration - components/clm/tools/clm4_5/mksurfdata_map/Makefile.data - automate generating all surface data sets - -List all existing files that have been modified, and describe the changes: - clm/bld/CLMBuildNamelist.pm - increase max pft, add info to error message, fix quoted empty string processing (bug 2146) - clm/bld/namelist_files/namelist_defaults_clm4_5.xml - point to new datasets - clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - update rawdata sets - clm/bld/namelist_files/namelist_definition_clm4_5.xml - update sim year range to avoid special cases for testing - clm/bld/test_build_namelist/t/test_do_harvest.pm - update test (bug 2146) - clm/bld/test_build_namelist/t/test_do_transient_crops.pm - update test (bug 2146) - clm/bld/test_build_namelist/t/test_do_transient_pfts.pm - update test (bug 2146) - - clm/cimetest/testmods_dirs/clm/crop_trans_f10/user_nl_clm - point to new datafiles - clm/cimetest/testmods_dirs/clm/crop_trans_sville/user_nl_clm - point to new datafiles - - clm/src/biogeophys/WaterStateType.F90 - workaround for pgi compiler bug - - clm/src/biogeochem/CNNDynamicsMod.F90 - new crop model - clm/src/biogeochem/CNPhenologyMod.F90 - clm/src/biogeochem/CNVegStructUpdateMod.F90 - clm/src/biogeochem/CropType.F90 - clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 - clm/src/biogeochem/VOCEmissionMod.F90 - clm/src/biogeophys/CanopyFluxesMod.F90 - clm/src/biogeophys/PhotosynthesisMod.F90 - clm/src/main/PatchType.F90 - clm/src/main/clm_varpar.F90 - clm/src/main/pftconMod.F90 - clm/src/main/subgridRestMod.F90 - clm/src/main/surfrdMod.F90 - - clm/tools/clm4_5/mksurfdata_map/README - clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - move file writes into functions. write to __dataset_name__.namelist - clm/tools/clm4_5/mksurfdata_map/src/mklaiMod.F90 - update for new crops - clm/tools/clm4_5/mksurfdata_map/src/mkpftConstantsMod.F90 - clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 - update for new crops, fix bug 2155. - - clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 - work around for an issue causing abort during urban dataset generation - clm/tools/clm4_5/mksurfdata_map/src/mkurbanparMod.F90 - - -CLM testing: regular - - build-namelist tests: - - yellowstone unit tests - ok - - unit-tests (components/clm/src): - - yellowstone_intel - ok - - regular tests (aux_clm40, aux_clm45): - - - yellowstone aux clm40 intel - ok - - yellowstone aux clm40 pgi - ok - - yellowstone aux clm45 intel - ok - - all namelist fail - new datasets and parameters - - crop - new crop model - baseline failures expected - - ed - new parameters file - baseline failures expected, ok'd by rfisher - - ERP_D_Ld5.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC_changeFlags - baseline compare fails, roundoff level, unknown cause, ok'd by sacks - - ERP_E_Ld5.f19_g16.I1850CRUCLM45CN.yellowstone_intel.clm-default - baseline compare fails, only occurs with esmf - ok'd by mvertens - - yellowstone aux clm45 gnu - ok - - all namelist fail - new datasets and parameters - - crop - new crop model - baseline failures expected - - yellowstone aux clm45 pgi - - - all namelist fail - new datasets and parameters - - crop - new crop model - baseline failures expected - - ed - new parameters file - baseline failures expected, ok'd by rfisher - - ERI_D_Ld9.f19_g16.I1850CLM45CN.yellowstone_pgi - roundoff in cpl baseline - - ERI_D_Ld9.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-drydepnomegan - roundoff in baseline - - ERP_P15x2_Lm13.f10_f10.IHISTCLM45BGC.yellowstone_pgi.clm-monthly - new xfail, #2182, dies at runtime in optimized, threaded pgi builds only. - - yellowstone mksurfdata_map unit_testers - ok - - yellowstone tools tests - ok, known issues with PTCLMmkdata (bug 2180) - -CLM tag used for the baseline comparisons: clm4_5_1_r106 (bit for bit with clm4_5_1_r107) - -Changes answers relative to baseline: yes - - Summarize any changes to answers, i.e., - - what code configurations: crop, ed - - what platforms/compilers: all - - nature of change : answer changes updated crop model. approved by levis. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - simulations with all pfts everywhere were run with merged code. Levis compared current runs with his archived runs. - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r107 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Tue May 19 10:05:49 MDT 2015 -One-line Summary: Update externals to use github version of cime1.0.7. - -Purpose of changes: Switch the cime external from using svn to github. Update cime to cime1.0.7. - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (cime, rtm, cism, etc.): cime 1.0.7 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: N/A - -CLM testing: regular - - build-namelist tests: - unit-tests: ok - system-tests: not run - - unit-tests (models/lnd/clm/src): - yellowstone: ok - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel 40 - ok; 45 - ok - yellowstone_pgi 40 - ok; 45 - ok - yellowstone_gnu (clm45 only) 45 - ok - -CLM tag used for the baseline comparisons: clm4_5_1_r106 - -Changes answers relative to baseline: none - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r106 -Originator(s): erik/fvitt -Date: Thu May 14 13:22:51 MDT 2015 -One-line Summary: Fix CO2 forcing for MEGAN - -Purpose of changes: - -Bring in changes from Francis Vitt, and Louisa Emmons to correct CO2 forcing -for MEGAN and dry-deposition. Previously, the fixed value of CO2 was being used -rather than using the CO2 forcing sent in from the atmosphere model. - -Also fix some issues with clm4_0 code where some urban diagnostic fields have -a different fill-value pattern on restart from startup. Fill-value is now only -set over non-land, and areas without urban, are set to zero. - -+M models/lnd/clm/src_clm40/biogeochem/VOCEmissionMod.F90 -+ - use time-dependent atmospheric CO2 concentrations rather than -+ the CCSM_CO2_PPMV constant value -+ -+M models/lnd/clm/src_clm40/biogeochem/DryDepVelocity.F90 -+ - science updates and bug fixes provided by Maria Val Martin -+ -+M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 -+ - use time-dependent atmospheric CO2 concentrations rather than -+ the CCSM_CO2_PPMV constant value -+ - use 10-day average of LAI rather than 1-day average -+ -+M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 -+ - science updates and bug fixes provided by Maria Val Martin -+ -+M models/lnd/clm/src/biogeophys/CanopyStateType.F90 -+ - get 10-day average of LAI rather than 1-day average - -Requirements for tag: Fix 2177 and some 2165 clm40 tests - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 2177 (MEGAN improperly uses constant CO2 rather than time varying) - 2176 (ED doesn't work with MEGAN -- partial just turn MEGAN off when ED on) - 2165 (some clm40 tests have history files differ on restart in urban fillvalue) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Turn MEGAN off when ED on - Have build-namelist make sure MEGAN is off when ED is on - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self,fvitt,simone,emmons - -List any svn externals directories updated (cime, rtm, cism, etc.): cime, cism - cime up to cime0_3_21 (bring in optional orbital calculation) - cism up to cism2_0_09 (just bring the branch to the trunk) - -List all files eliminated: None - -List all files added and what they do: Turn MEGAN off for ED tests - -A components/clm/cimetest/testmods_dirs/clm/edTest/shell_commands - -List all existing files that have been modified, and describe the changes: - - M components/clm/src_clm40/biogeophys/UrbanInitMod.F90 -- Initialize to - zero over land - M components/clm/src_clm40/main/clm_initializeMod.F90 --- Call urbanInit - before reading restart files - M components/clm/src_clm40/main/accFldsMod.F90 ---------- Change running mean - from 1 day to 10 days - M components/clm/src_clm40/main/clmtypeInitMod.F90 ------ Initilize to spval - - M components/clm/src_clm40/biogeochem/VOCEmissionMod.F90 -+ - use time-dependent atmospheric CO2 concentrations rather than -+ the CCSM_CO2_PPMV constant value -+ - use 10-day average of LAI rather than 1-day average - M components/clm/src_clm40/biogeochem/DryDepVelocity.F90 -+ - science updates and bug fixes provided by Maria Val Martin - - M components/clm/src/biogeochem/VOCEmissionMod.F90 -+ - use time-dependent atmospheric CO2 concentrations rather than -+ the CCSM_CO2_PPMV constant value -+ - use 10-day average of LAI rather than 1-day average - M components/clm/src/biogeochem/DryDepVelocity.F90 -+ - science updates and bug fixes provided by Maria Val Martin - M components/clm/src/biogeophys/CanopyStateType.F90 -+ - get 10-day average of LAI rather than 1-day average - - M README_cime --- Update documentation - - M components/clm/bld/CLMBuildNamelist.pm -- Check that MEGAN off when ED on - M components/clm/bld/unit_testers/build-namelist_test.pl - Add check for - MEGAN off when ED on - M components/clm/bld/clm.buildnml --- only copy drv_flds_in over if it - was actually created. - - M components/clm/tools/README ---- Have documentation point to gen_domain - under cime/tools/mapping - -CLM testing: regular - - build-namelist tests: - - yellowstone yes - - unit-tests (models/lnd/clm/src): - - yellowstone yes - - regular tests (aux_clm40, aux_clm45): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - -CLM tag used for the baseline comparisons: clm4_5_1_r105 - -Changes answers relative to baseline: Yes -- MEGAN diagnostic fields only! - as well as dry-deposition because of science update - - Summarize any changes to answers, i.e., - - what code configurations: All with MEGAN on - - what platforms/compilers: All - - nature of change: Diagnostic fields change - - VOC emissions change - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r105 -Originator(s): erik (Erik) -Date: Thu Apr 16 13:23:19 MDT 2015 -One-line Summary: Move test lists to beneath active components, change build scripts from cshell - to perl, move to new cime directory structure - -Purpose of changes: - - * Move CESM test lists from under scripts to under active components. - Now clm and rtm have their own CESM test lists under their "cimetest" directory. - * Change build scripts from cshell to perl - cshell is buggy with arbitrary problems with line lengths and number of arguments - cshell doesn't allow long scripts to be broken up into subroutine -- perl does -:::::::::: Get unit-testing working with directory structure change - M src/CMakeLists.txt - M src/README.unit_testing - -:::::::::: Get tools testing working with directory structure change - M test/tools/TBLtools.sh - M test/tools/TSMCFGtools.sh - M test/tools/TSMscript_tools.sh - M test/tools/TCBCFGtools.sh - M test/tools/TCBscripttools.sh - M test/tools/TSMncl_tools.sh - M test/tools/TBLCFGtools.sh - M test/tools/TSMtools.sh - M test/tools/TBLscript_tools.sh - M test/tools/TCBtools.sh - M test/tools/test_driver.sh - -:::::::::: Get tools working with directory structure change - M tools/clm4_0/mksurfdata_map/mksurfdata.pl - M tools/clm4_5/mksurfdata_map/mksurfdata.pl - M tools/shared/ncl_scripts/getco2_historical.ncl - -:::::::::: Updates to build - M bld/CLMBuildNamelist.pm - M bld/configure - M bld/queryDefaultNamelist.pl - M bld/listDefaultNamelist.pl - M bld/unit_testers/xFail/wrapClmTests.pl - M bld/unit_testers/xFail/expectedFail.pm - M bld/test_build_namelist/test_build_namelist.pl - M bld/namelist_files/checkmapfiles.ncl - M bld/namelist_files/namelist_definition.xsl - -:::::::::: Updates to documentation with new directory structure - M doc/README - M doc/UsersGuide/co2_streams.txt - M doc/Quickstart.userdatasets - M doc/Quickstart.GUIDE - M doc/KnownLimitations - M tools/README - M tools/README.filecopies - M tools/clm4_0/interpinic/README - M tools/clm4_0/mksurfdata_map/README - M tools/clm4_5/refactorTools/associate/README - M tools/clm4_5/refactorTools/clmType/README - M tools/clm4_5/mksurfdata_map/README - M tools/shared/mkmapgrids/README - M tools/shared/mkmapdata/README - M tools/shared/mkprocdata_map/README - M tools/shared/ncl_scripts/README - M tools/README.testing - M bld/README - -CLM testing: - - build-namelist tests: - - yellowstone yes - - unit-tests (models/lnd/clm/src): - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, and aux_clm_short): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - -CLM tag used for the baseline comparisons: clm4_5_1_r104 - -Changes answers relative to baseline: - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r104 -Originator(s): erik (Erik) -Date: Tue Jan 27 11:22:48 MST 2015 -One-line Summary: Update externals to latest cesm beta tag + bring in shared build for clm4_5/clm5_0 for testing - -Purpose of changes: - -* Update externals to cesm1_3_beta15+ shared clm4_5/clm5_0 library build for testing. -* Fix BG1850CN @ f09 by changing fglcmask (Bill Sacks) -* Update more prealpha/prebeta tests to test with clm4_5 -* Create datasets for clm4_5 at ne16 and ne120 resolution - (for ne120 create rcp8.5 and rcp4.5 transient datasets) - M models/lnd/clm/src/cpl/lnd_comp_mct.F90 ----------- Add only for lnd_import_export use statement - ------------- Change so sample subsetting uses the high resolution datasets - M models/lnd/clm/tools/shared/ncl_scripts/README.getregional - M models/lnd/clm/tools/shared/ncl_scripts/sample_inlist - M models/lnd/clm/tools/shared/ncl_scripts/sample_outlist - -CLM testing: - - build-namelist tests: - - yellowstone yes - - unit-tests (models/lnd/clm/src): - - yellowstone yes - - tools testing: - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu (clm45 only) yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - -CLM tag used for the baseline comparisons: clm4_5_1_r103 - -Changes answers relative to baseline: YES! - - Summarize any changes to answers, i.e., - - what code configurations: all - - what platforms/compilers: time-change all, roundoff-intel - - nature of change: roundoff - - Small change in driver changes time-stamps on history files by roundoff (drvseq5_1_05). - Normal cprnc comparison then does NOT compare fields and calls files different. Changes - in the intel build (on yellowstone) change answers to roundoff for intel on yellowstone - (Machines update between Machines_141125 and Machines_150106a causes answers to change) - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r103 -Originator(s): sacks (Bill Sacks) -Date: Thu Jan 1 06:15:57 MST 2015 -One-line Summary: enable transient crops - -Purpose of changes: - -(1) Allow transient crops! Note that carbon and nitrogen conservation still is - not done, but this at least allows crop areas to evolve in time. - -(2) Add control flags for which pieces of the transient dynamics should be done: - transient natural PFTs, transient crops, and/or harvest. - -(3) Reworked both source code and unit tests to be able to use the true CLM time - manager in unit tests rather than a stub version. Also added functionality - to time_info_type to be able to take the date from the end of the current - time step or the beginning of the time step. This flexibility was needed - because: (a) for crops, with an annual update, I wanted the update time to - be consistent with the glacier update time: the first time step after - crossing the year boundary (so take time from the start of the time step); - (b) for transient PFTs and harvest, for consistency with what was being done - before, we need to take the time from the end of the time step. - -(4) Make CNBalanceCheck more modular and object-oriented. Also, bypass the - balance check for newly-active columns, which is needed to avoid balance - check errors with transient crops. - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: New control flags that control which -aspects of transient subgrid dynamics (and harvest) are turned on/off. This lets -you turn on/off transient natural PFTs, transient crops, and/or harvest -independently. - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: some pieces reviewed by Erik - - scripts: append_nl_value_n03_scripts4_141201 -> append_nl_value_n07_scripts4_141201 - esmf_wrf_timemgr: esmf_wrf_timemgr_141028 -> esmf_wrf_timemgr_141217 - -List all files eliminated: - -========= No longer use stub time manager - use true time manager instead -D models/lnd/clm/src/unit_test_stubs/utils/clm_time_manager_stub.F90 - -List all files added and what they do: - -========= Add transient crops -A models/lnd/clm/src/dyn_subgrid/dyncropFileMod.F90 - -========= Reads and stores namelist items controlling transient dynamics. This - allows turning off select pieces of the transient subgrid behavior. -A models/lnd/clm/src/dyn_subgrid/dynSubgridControlMod.F90 - -========= Add unit test utilities that wrap the clm time manager -A models/lnd/clm/src/unit_test_shr/unittestTimeManagerMod.F90 - -========= Start adding unit tests for the clm time manager -A models/lnd/clm/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf -A models/lnd/clm/src/utils/test/clm_time_manager_test/CMakeLists.txt -A models/lnd/clm/src/utils/test/clm_time_manager_test -A models/lnd/clm/src/utils/test/CMakeLists.txt -A models/lnd/clm/src/utils/test - -========= Test logic for new control flags -A models/lnd/clm/bld/test_build_namelist/t/test_do_transient_pfts.pm -A models/lnd/clm/bld/test_build_namelist/t/test_do_harvest.pm -A models/lnd/clm/bld/test_build_namelist/t/test_do_transient_crops.pm - -List all existing files that have been modified, and describe the changes: - -========= Reworked both source code and unit tests to be able to use the true - CLM time manager in unit tests rather than a stub version. Also added - functionality to time_info_type to be able to take the date from the - end of the current time step or the beginning of the time step. Note - that some unit test builds now need to link against the - esmf_wrf_timemgr library, if they use the time manager either directly - or indirectly. -M models/lnd/clm/src/utils/clm_time_manager.F90 -M models/lnd/clm/src/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynVarTimeInterpMod.F90.in -M models/lnd/clm/src/dyn_subgrid/dynVarTimeInterpMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynFileMod.F90 -M models/lnd/clm/src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 -M models/lnd/clm/src/unit_test_stubs/utils/CMakeLists.txt -M models/lnd/clm/src/CMakeLists.txt -M models/lnd/clm/src/unit_test_shr/CMakeLists.txt -M models/lnd/clm/src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf -M models/lnd/clm/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt -M models/lnd/clm/src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 -M models/lnd/clm/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf -M models/lnd/clm/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf -M models/lnd/clm/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt -M models/lnd/clm/src/biogeophys/test/Daylength_test/CMakeLists.txt -M models/lnd/clm/src/biogeophys/test/Irrigation_test/CMakeLists.txt -M models/lnd/clm/src/utils/CMakeLists.txt - -========= Changes related to new control flags, as well as the rework of the - time_info%set_current_year interface -M models/lnd/clm/src/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynHarvestMod.F90 - -========= Changes related to new control flags and addition of transient crops -M models/lnd/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Moved flanduse_timeseries and other control flags into dynSubgridControlMod -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/main/restFileMod.F90 -M models/lnd/clm/src/main/subgridRestMod.F90 -M models/lnd/clm/src/main/clm_varpar.F90 -M models/lnd/clm/src/biogeochem/CNDriverMod.F90 -M models/lnd/clm/src/biogeochem/CNFireMod.F90 - -========= Make CNBalanceCheck more modular and object-oriented -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 - - also, bypass balance checks for newly-active columns (needed to - avoid balance check errors for newly-active crop columns) -M models/lnd/clm/src/biogeochem/CNVegNitrogenStateType.F90 -M models/lnd/clm/src/biogeochem/CNVegCarbonStateType.F90 -M models/lnd/clm/src/main/clm_instMod.F90 -M models/lnd/clm/src/main/clm_driver.F90 - - also make alt_calc operate over inactive as well as active points - -========= Added new control flags -M models/lnd/clm/bld/CLMBuildNamelist.pm -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -========= Make test files (more) consistent with actual files. This may not have - been necessary. -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml - -========= Minor changes (e.g., changes to comments and other small changes) -M models/lnd/clm/src/unit_test_stubs/utils/spmdMod_stub.F90 -M models/lnd/clm/src/dyn_subgrid/do_genf90 -M models/lnd/clm/src/dyn_subgrid/dynVarTimeUninterpMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynVarMod.F90 -M models/lnd/clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 -M models/lnd/clm/src/biogeophys/ActiveLayerMod.F90 - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - Note that there are differences from baseline due to new control flags - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r102 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r102 -Originator(s): sacks (Bill Sacks) -Date: Sat Dec 27 06:52:20 MST 2014 -One-line Summary: make new input datasets to support transient crops - -Purpose of changes: - -While the main purpose of this tag was to make new input datasets to support -transient crops, it also includes a number of reworks of mksurfdata_map, which -were either central or tangential to this overall goal. Specifically: - -(1) Update mksurfdata_map to be able to generate datasets with transient - crops. Currently the logic uses the non-prognostic-crop raw data for the - transient time series: It takes the area of the generic crop from that - timeseries to specify the transient PCT_CROP area, and sets the PCT_CFT - areas based on the year-2000 areas. - -(2) Rewrite mksurfdata_map code that normalizes pct_pft to account for special - landunits. The code to handle urban was very confusing, and I hope this new - code is at least astep towards being less confusing. Note that this - introduces roundoff-level differences. - -(3) Introduce new mksurfdata_map utility routines: ncd_def_spatial_var and - ncd_put_time_slice. These encapsulate behavior that used to be duplicated in - the code. - -(4) Add mksurfdata_map unit tests using the new pfunit-based unit testing - framework. However, I have NOT done a full migration of the mksurfdata_map - unit tests. Thus, there are still some tests that use the old unit testing - framework that I put in place (which leveraged the test stuff that Erik set - up for csm_share a while ago). These tests can be migrated to pfunit - incrementally: as someone touches code that is under test using the old - framework, they could move the relevant tests into the new pfunit-based - framework. - -(5) Create new input datasets, based on the above changes: - - - new flanduse_timeseries files created because I have changed the - information on these files - - - new surface datasets created because I introduced roundoff-level changes - in the surface datasets, and so regenerated all surface datasets now in - order to save someone a headache later. - - - new initial conditions files created so that out-of-the-box initial - conditions will be compatible with the surface datasets, according to - various consistency checks. - - See the following files in inputdata for documentation of how the new - datasets were created: - - lnd/clm2/surfdata_map/README_c141219 - lnd/clm2/initdata_map/README_c141226 - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: -- new surface datasets -- new flanduse_timeseries files -- new initial conditions files - -List any changes to the defaults for the boundary datasets: -- new surface datasets -- new flanduse_timeseries files -- new initial conditions files - -Describe any substantial timing or memory changes: none - -Code reviewed by: Most changes sent to Erik for review, although I can't -remember how much he actually reviewed. - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: append_nl_value_n02_scripts4_141201 -> append_nl_value_n03_scripts4_141201 - - point tropicAtl_subset tests to new file - -List all files eliminated: - -========= Move tests elsewhere -D models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkpftMod.F90 - - -List all files added and what they do: - -========= New object-oriented class for storing and operating on pct_pft - data. Encapsulating a bunch of behavior in here allowed me to simplify - other code. Before this, I was keeping track of two separate - representations of pct_pft: First it was stored as % of grid cell, - then it was later converted into % of landunit together with the - landunit's % of grid cell. This was starting to get hard to manage, - because certain operations could only be done on the first - representation, and other operations could only be done on the second - representation – and at some point in the processing pipeline, the - conversion happened and the first representation was no longer - usable. Now there is a single representation, and the class allows any - desired operation to be performed on that single representation. This - adds some complexity within the class, but removes complexity from the - rest of the code, particularly mksurfdat.F90. -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpctPftTypeMod.F90 - -========= This new module contains routines that operate on both instances of - pct_pft_type (pctnatpft and pctcft) at once. Thus, this contains - higher-level logic than was appropriate for mkpctPftTypeMod. Yet, I - wanted these routines in a separate module from mkpftMod as an aid to - testing, since mkpftMod has a bunch of dependencies. -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftUtilsMod.F90 - -========= Moved constants from other places into here, partly to centralize - them, and partly to remove problems with circular dependencies -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftConstantsMod.F90 - -========= Add automated test of making a transient crop surface dataset -A models/lnd/clm/test/tools/nl_files/mksrfdt_10x15_crp_1850-2000 - -========= Add input file for creating a transient smallville dataset for testing - transient crops -A models/lnd/clm/tools/clm4_5/mksurfdata_map/single_point_dynpft_files/README.landuse_timeseries_smallvilleIA_hist_simyr1850-1855 -A models/lnd/clm/tools/clm4_5/mksurfdata_map/single_point_dynpft_files/landuse_timeseries_smallvilleIA_hist_simyr1850-1855.txt -A models/lnd/clm/tools/clm4_5/mksurfdata_map/single_point_dynpft_files/README -A models/lnd/clm/tools/clm4_5/mksurfdata_map/single_point_dynpft_files - -========= Add pfunit-based unit tests for mksurfdata_map -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/CMakeLists.txt -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpftUtils_test/test_adjust_total_veg_area.pf -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpftUtils_test/CMakeLists.txt -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpftUtils_test/test_convert_from_p2g.pf -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpftUtils_test -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpctPftType_test/CMakeLists.txt -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpctPftType_test/test_mkpctPftType.pf -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/mkpctPftType_test -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test/CMakeLists.txt -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/test -A models/lnd/clm/tools/clm4_5/mksurfdata_map/src/README.unit_testing - - -List all existing files that have been modified, and describe the changes: - -========= Changes that take advantage of some of the other refactoring described - here, plus add logic to allow input dataset to not contain crops even - when generating a transient dataset for crops; also add PCT_CROP and - PCT_CFT on the landuse_timeseries output file -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 - -========= Changes that take advantage of some of the other refactoring described - here, especially making use of the new pct_pft_type methods. Plus: (a) - save pctcft from the initial input file so it can be used when - generating landuse_timeseries, (b) remove unwanted landunit percents - from the landuse_timeseries file, (c) add transient PCT_CROP and - PCT_CFT, (d) complete rewrite of the code that normalizes pct_pft to - account for special landunits: the code to handle urban was very - confusing, and I hope this new code is at least a step towards being - less confusing [this change introduces roundoff-level differences], - (e) remove some error-checking code that is now embedded in the - pct_pft_type routines -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 - -========= Updated for new files -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Srcfiles - -========= Added two new routines: ncd_def_spatial_var and - ncd_put_time_slice. These encapsulate behavior that used to be - duplicated in the code. Also, moved convert_latlon from mkutilsMod to - here, since it is really related to netcdf stuff. -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkncdio.F90 - -========= Simplify this module significantly by using the new - ncd_def_spatial_var. Also change what fields are present on the - transient landuse file: remove some no-longer-desired fields (% of - special landunits, etc.). -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 - -========= Use new ncd_def_spatial_var -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksoilMod.F90 - -========= Delete routines that have been moved to a more appropriate place -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkutilsMod.F90 - -========= Remove tests from old test framework for code that I have deleted or - migrated to my new modules; and fix some minor errors that appeared - when runnng the old unit tests with gfortran. -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkchecksMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkutilsMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkgridmapMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Srcfiles -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkdomainMod.F90 - -========= Trivial changes (change 'use' statements to reflect migrated code, add - comments, etc.) -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mklaiMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkdomainMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkurbanparMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkgridmapMod.F90 - -========= Add logic needed for creating transient crop datasets. The main - differences are (a) for crop, we create a year-2000 surface dataset - together with the transient dataset (rather than a year-1850 surface - dataset), and (b) we always use the non-crop transient raw data, even - when creating a transient crop dataset. -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - -========= New fsurdat, flanduse_timeseries and finidat files -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Add automated test of making a transient crop surface dataset -M models/lnd/clm/test/tools/input_tests_master -M models/lnd/clm/test/tools/tests_pretag_yellowstone_nompi - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - tools tests: - - yellowstone: ok - - Note that there were diffs in baseline comparisons for mksurfdata_map tests - (and the PTCLM test, which uses mksurfdata_map). See below for details - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r101 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: most clm4_5 runs - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Note that there were no source code changes in this tag, so the only - differences come from differences in datasets (fsurdat, - flanduse_timeseries, finidat). - - I confirmed that differences in fsurdat and flanduse_timeseries are - generally roundoff-level. There are greater than roundoff-level diffs in - PCT_NAT_PFT at a small number of points, but all of these points have - PCT_NATVEG = 0 (this is due to a fix in how PCT_NAT_PFT is determined for - points with 0% vegetated landunit, and > 0% urban); this would only affect - dynamic landunit runs. Other than that, max normalized RMS diffs are 2e-8, - and most are considerbly smaller. - - finidat files were created as one-offs to ensure that the only differences - are in the subgrid weights, arising from these surface dataset differences. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r101 -Originator(s): sacks (Bill Sacks) -Date: Tue Dec 9 06:27:39 MST 2014 -One-line Summary: rework cold start initialization for transient runs - -Purpose of changes: - - (1) Do not adjust subgrid weights (or set harvest variables) in cold start - initialization. Instead, wait to do this until the first run step. The - motivation for this is (a) this is consistent with what is done for - glacier (for which prognostic weights aren't available until the run - phase), and (b) it simplifies what needs to be done in initialization, - particularly for transient crops (which are coming soon). - - (2) Do not run the biogeophys & biogeochem dyn subgrid conservation code in - the first step of a cold start run. This affects the current operation of - glacier, and is important in conjunction with (1): this avoids doing a - large adjustment of physics or BGC caused by a fictitious change in area - in the first time step after cold start. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: mvertens reviewed conceptual changes to clm_time_manager and - DaylengthMod; other changes only reviewed by self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Main changes, as documented above -M models/lnd/clm/src/main/clm_initializeMod.F90 -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynConsBiogeochemMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 - -========= Unrelated change: Fix a possible threading bug in DaylengthMod - (although this would rarely cause problems: I think this would only - cause a problem if you started / restarted exactly on the solstice) -M models/lnd/clm/src/utils/clm_time_manager.F90 -M models/lnd/clm/src/biogeophys/DaylengthMod.F90 - - - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r100 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 cold start runs with glacier and/or - transient PFTs - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Changes answers only in initialization. This shows up as changes in the - fields set to the coupler in initialization, and/or changes in the initial - history file. In offline runs (I compsets), this change does not affect - the simulation beyond initialization, but it is expected to change the - evolution of the system in coupled runs. However, again note that this - only affects cold start runs wth glacier and/or transient PFTs, which - would not be typical for production runs. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r100 -Originator(s): sacks (Bill Sacks); most changes from Jim Edwards -Date: Wed Dec 3 06:21:13 MST 2014 -One-line Summary: update pio calls to pio2 API - -Purpose of changes: - - Update pio calls to the pio2 API, so that the transition to pio2 will be - seamless. Most changes were from Jim Edwards. There are also some other minor - changes that are unrelated to this main change, as noted below. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: sacks - -List any svn externals directories updated (csm_share, mct, etc.): - - pio: pio1_8_13 -> pio1_9_5 - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Main changes needed for pio2 API -M models/lnd/clm/src_clm40/main/ncdio_pio.F90 -M models/lnd/clm/src_clm40/main/ncdio_pio.F90.in -M models/lnd/clm/src/main/ncdio_pio.F90 -M models/lnd/clm/src/main/ncdio_pio.F90.in - -========= Change 2-d array to 1-d. Jim says he thinks this was also needed for - pio2 support. -M models/lnd/clm/src_clm40/main/histFileMod.F90 -M models/lnd/clm/src/main/histFileMod.F90 - -========= Unrelated change: change len to len_trim. Jim says this was needed to - fix a problem on some machine. -M models/lnd/clm/src_clm40/biogeochem/MEGANFactorsMod.F90 -M models/lnd/clm/src/biogeochem/MEGANFactorsMod.F90 - - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r099 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r099 -Originator(s): sacks (Bill Sacks) -Date: Tue Dec 2 15:05:09 MST 2014 -One-line Summary: add ozone stress code from Danica Lombardozzi - -Purpose of changes: - -(1) Implement ozone stress. The scientific implementation was done by Danica - Lombardozzi. The software reimplementation was done by Bill Sacks. - -(2) Fix some misc. bugs, including a restart bug that was introduced in r097. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 2091: some restarts not bit-for-bit starting in clm4_5_1_r097 -- 2029: Memory leak in GetGlobalValuesMod - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ -- 2094: ozone code doesn't work with the PGI compiler - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: new namelist option, use_ozone - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: ozone changes reviewed by Danica Lombardozzi (she reviewed -both the code and the changes seen due to ozone in a short simulation) - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: append_nl_value_n02_scripts4_141129 -> append_nl_value_n02_scripts4_141201 - -List all files eliminated: - -List all files added and what they do: - -========= Implement ozone stress. Uses polymorphism to handle ozone-on vs. ozone-off. -A models/lnd/clm/src/biogeophys/OzoneFactoryMod.F90 -A models/lnd/clm/src/biogeophys/OzoneOffMod.F90 -A models/lnd/clm/src/biogeophys/OzoneBaseMod.F90 -A models/lnd/clm/src/biogeophys/OzoneMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Calculate and apply ozone stress -M models/lnd/clm/src/biogeophys/PhotosynthesisMod.F90 -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/main/clm_instMod.F90 - - also fix restart bug (bug 2091) -M models/lnd/clm/src/main/clm_driver.F90 - -========= Add namelist flag to turn ozone on -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/controlMod.F90 - -========= Fix memory leak (bug 2029) -M models/lnd/clm/src/main/GetGlobalValuesMod.F90 -M models/lnd/clm/src_clm40/main/GetGlobalValuesMod.F90 -M models/lnd/clm/src/ED/main/EDRestVectorMod.F90 - -========= Workarounds for compiler bugs -M models/lnd/clm/src/biogeochem/CNDVType.F90 -M models/lnd/clm/src/biogeochem/CNDriverMod.F90 - -========= Improve documentation comments for compiler bug workarounds -M models/lnd/clm/src/biogeophys/IrrigationMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynpftFileMod.F90 - -========= Add allocation of Points, matching behavior of true routine -M models/lnd/clm/src/unit_test_stubs/csm_share/mct_mod_stub.F90 - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - Remove these two entries that now pass: - restarts not bit-for-bit - error on hist comparison - - Add this new failure: - compiler bug in PGI's handling of polymorphism - - -CLM testing: - - Note: testing was done on ozone_polymorphism_n09_clm4_5_1_r098, which was - before I put in place the abort if you're trying to run ozone with pgi. After - that, I ran two tests with pgi (one with ozone and one without), and one test - with intel (with ozone) in order to make sure that the abort check was put in - properly. After all testing was complete, I reverted accidental whitespace - changes in clm_initializeMod.F90 and restFileMod.F90 - I did not run any - additional testing after reverting those whitespace changes. - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - - Also, ran these two additional tests, with comparisons to baselines - these - are tests that I have replaced with new tests: - - ERS_Ly5.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrigOn_reduceOutput - PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_pgi.clm-irrigOn_reduceOutput - - -CLM tag used for the baseline comparisons: clm4_5_1_r098 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r098 -Originator(s): sacks (Bill Sacks) -Date: Sat Nov 29 06:18:59 MST 2014 -One-line Summary: update externals to cesm1_3_beta14 or beyond - -Purpose of changes: - - Update most externals to cesm1_3_beta14 or beyond. The one exception is mct, - for which I had trouble accessing the tag at the location used in beta14, so - I am sticking with the previous mct tag. - - Some notable changes: - - (1) update in intel compiler on yellowstone to intel15 - - (2) robust fix for number of datm streams, using Sean Santos's dynamic vector - - (3) testmods reworked to use recursive testmods - - (4) unit_testing, CMake & Machines updated so that unit tests now work on - yellowstone - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/refactor_koven_tags/refactor_koven_n02_scripts4_141023 -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/append_nl_value_tags/append_nl_value_n02_scripts4_141129 --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_141017a -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_141125 --scripts/ccsm_utils/CMake https://github.com/quantheory/CMake_Fortran_utils/tags/CMake_Fortran_utils_140715 -+scripts/ccsm_utils/CMake https://github.com/quantheory/CMake_Fortran_utils/tags/CMake_Fortran_utils_141122 --models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_17 -+models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_18 --models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_141022 -+models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_141121 --models/utils/esmf_wrf_timemgr https://svn-ccsm-models.cgd.ucar.edu/esmf_wrf_timemgr/trunk_tags/esmf_wrf_timemgr_140529 -+models/utils/esmf_wrf_timemgr https://svn-ccsm-models.cgd.ucar.edu/esmf_wrf_timemgr/trunk_tags/esmf_wrf_timemgr_141028 --models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_8_12/pio -+models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_8_13/pio --tools/load_balancing_tool https://svn-ccsm-models.cgd.ucar.edu/tools/load_balancing_tool/trunk_tags/load_balancing_tool_140818/ -+tools/load_balancing_tool https://svn-ccsm-models.cgd.ucar.edu/tools/load_balancing_tool/trunk_tags/load_balancing_tool_141008 --tools/pyReshaper https://subversion.ucar.edu/asap/pyReshaper/tags/v0.9.1/ -+tools/pyReshaper https://proxy.subversion.ucar.edu/pubasap/pyReshaper/tags/v0.9.1 --tools/unit_testing https://svn-ccsm-models.cgd.ucar.edu/unit_testing/trunk_tags/unit_testing_0_08 -+tools/unit_testing https://svn-ccsm-models.cgd.ucar.edu/unit_testing/trunk_tags/unit_testing_0_12 - - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Workaround for pgi internal compiler error -M models/lnd/clm/src/main/clm_driver.F90 - -========= Rework README, mainly to remove the need for using '--clean' -M models/lnd/clm/src/README.unit_testing - -========= Move an xfail from goldbach to yellowstone; add xfail for ERS_Ly5 test - (bug 2091) -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -========= Update what machine-comiler combos we test -M .ChangeLog_template - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone: ok - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu (clm45 only): ok - goldbach_nag: ok - - Other than xFails, note that the following failed: - - *** presumably this failed in the previous tag, so baselines didn't exist - BFAIL SMS_D.1x1_mexicocityMEX.I.goldbach_nag.compare_hist.clm4_5_1_r097 - - *** ozone tests that won't work until an upcoming tag that brings ozone in - SFAIL ERS_D.f10_f10.I1850CLM45.goldbach_nag.clm-o3.GC.1128-0838.45.n - SFAIL PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_pgi.clm-irrig_o3_reduceOutput.GC.1128-0838.45.p - SFAIL ERS_Ly5.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrig_o3_reduceOutput.GC.1128-0838.45.i - - Also, note that the following test failed: - - FAIL ERH_D.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-drydepnomegan - - This appears to be a scripts problem. Since Mariana wants to do away with - ERH tests anyway, I just replaced this with: - - PASS ERI_D.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-drydepnomegan - - - Also ran the following two tests, which have been replaced with - (currently-failing) o3 tests: - - ERS_Ly5.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrigOn_reduceOutput - PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_pgi.clm-irrigOn_reduceOutput - - The PET test passed, but the ERS test failed (see bug 2091) - -CLM tag used for the baseline comparisons: clm4_5_1_r097 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: ALL - - what platforms/compilers: yellowstone-intel - - nature of change (roundoff; larger than roundoff/same climate; new climate): - NOT INVESTIGATED - - These diffs are presumably due to the yellowstone-intel compiler upgrade - to v15. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r097 -Originator(s): mvertens mvertens (Mariana Vertenstein,UCAR/CSEG,303-497-1349) -Date: Mon Nov 24 11:06:30 MST 2014 -One-line Summary: major refactorization to introduce new soilbiogeochem data - types and routines that are independent of either ED or CN datatypes - -Purpose of changes: Major refactorization to introduce new soilbiogeochem - data types and permit ED and CN vegetation to be independent of each other - AND both work with either the same soilbiogeochem or in the future - potentially different soilbiogeochem modules - -Requirements for tag: None - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: bld/configure modified to - accomodate new directory structure - introduction of soilbiogeochem/ - directory - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: Since use_cn and use_ed - are now mutually exclusive, CN memory is not longer allocated when ED is run - and the memory reduction (for f19_g16) seems to be about 50%. - -Code reviewed by: mvertens, muszala, sacks - -List any svn externals directories updated (csm_share, mct, etc.): scripts branch is used - https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/refactor_koven_tags/refactor_koven_n01_scripts4_141023 - -List all files eliminated, added and modified: (see below) -List all files added and what they do: (see below) -List all existing files that have been modified, and describe the changes: (see below) - -These are all grouped together here - since splitting the items up simply did -not make sense in this case - ---------------------------------------------------- -New module where all instances are now declared (moved from clm_initializeMod) -- all calls to instance restarts are here as well - so restFileMod - is greatly simplified ---------------------------------------------------- -A models/lnd/clm/src/main/clm_instMod.F90 - ---------------------------------------------------- -New soilbiogeochem/ directory introduced (new modules and data types) ---------------------------------------------------- -A models/lnd/clm/src/soilbiogeochem - ---------------------------------------------------- -CN state and flux types split into: -SoilBiogeoChem[Carbon|Nitrogen][State|Flux]Type and SoilBiogoechemStateType -CNVeg[Carbon|Nitrogen][State|Flux]Type and CNVegStateType ---------------------------------------------------- -D models/lnd/clm/src/biogeochem/CNStateType.F90 -D models/lnd/clm/src/biogeochem/CNCarbonFluxType.F90 -D models/lnd/clm/src/biogeochem/CNCarbonStateType.F90 -D models/lnd/clm/src/biogeochem/CNNitrogenFluxType.F90 -D models/lnd/clm/src/biogeochem/CNNitrogenStateType.F90 -A models/lnd/clm/src/biogeochem/CNVegStateType.F90 -A models/lnd/clm/src/biogeochem/CNVegCarbonFluxType.F90 -A models/lnd/clm/src/biogeochem/CNVegCarbonStateType.F90 -A models/lnd/clm/src/biogeochem/CNVegNitrogenStateType.F90 -A models/lnd/clm/src/biogeochem/CNVegNitrogenFluxType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemStateType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 - ---------------------------------------------------- -New modules in soilbiogeochem/ directory that are independent of CNVeg or ED types ---------------------------------------------------- -D models/lnd/clm/src/biogeochem/CNDecompCascadeConType.F90 -D models/lnd/clm/src/biogeochem/CNNitrifDenitrifMod.F90 -D models/lnd/clm/src/biogeochem/CNVerticalProfileMod.F90 -D models/lnd/clm/src/biogeochem/CNDecompMod.F90 -D models/lnd/clm/src/biogeochem/CNAllocationMod.F90 -D models/lnd/clm/src/biogeochem/CNDecompCascadeBGCMod.F90 -D models/lnd/clm/src/biogeochem/CNDecompCascadeCNMod.F90 -D models/lnd/clm/src/biogeochem/CNSoilLittVertTranspMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 -A models/lnd/clm/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 - ---------------------------------------------------- -Moved CNEcosystemDynMod to CNDRiverMod ---------------------------------------------------- -D models/lnd/clm/src/biogeochem/CNEcosystemDynMod.F90 -A models/lnd/clm/src/biogeochem/CNDriverMod.F90 - ---------------------------------------------------- -Changes to modules in biogeochem/ directory to now use new datatypes (see above) ---------------------------------------------------- -A models/lnd/clm/src/biogeochem/C14BompbSpikeMod.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/biogeochem/CNGRespMod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate3Mod.F90 -M models/lnd/clm/src/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/biogeochem/CNDVDriverMod.F90 -M models/lnd/clm/src/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/biogeochem/MEGANFactorsMod.F90 -M models/lnd/clm/src/biogeochem/SatellitePhenologyMod.F90 -M models/lnd/clm/src/biogeochem/CNWoodProductsMod.F90 -M models/lnd/clm/src/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/biogeochem/CNDVLightMod.F90 -M models/lnd/clm/src/biogeochem/NutrientCompetitionMethodMod.F90 -M models/lnd/clm/src/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/biogeochem/CNSharedParamsMod.F90 -M models/lnd/clm/src/biogeochem/CNDVType.F90 -M models/lnd/clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/biogeochem/CNNStateUpdate2Mod.F90 -M models/lnd/clm/src/biogeochem/CropType.F90 -M models/lnd/clm/src/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/biogeochem/CNVegStructUpdateMod.F90 -M models/lnd/clm/src/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/biogeochem/CNC14DecayMod.F90 - ---------------------------------------------------- -Moved frictionvel_type to FrictionVelocityMod ---------------------------------------------------- -D models/lnd/clm/src/biogeophys/FrictionVelocityType.F90 - ---------------------------------------------------- -Moved aerosol_type to AerosolMod ---------------------------------------------------- -D models/lnd/clm/src/biogeophys/AerosolType.F90 - ---------------------------------------------------- -Moved photosyns_type to PhotosynthesisMod ---------------------------------------------------- -D models/lnd/clm/src/biogeophys/PhotosynthesisType.F90 - ---------------------------------------------------- -Moved soilstate cold start initialization to a new module ---------------------------------------------------- -A models/lnd/clm/src/biogeophys/SoilStateInitTimeConstMod.F90 - ---------------------------------------------------- -Moved soilhydrology time constant initialization to a new module ---------------------------------------------------- -A models/lnd/clm/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 - ---------------------------------------------------- -ED Refactorization1 -(1) EDPhenologyMod changed to EDPhenologyType -(2) EDBioType moved as a module type (ed_clm_type) in EDCLMLINKMod.F90 -(3) EDVecPatchType no longer needed (for now is_veg, is_bareground and wt_ed are in PatchType.F90) ---------------------------------------------------- -D models/lnd/clm/src/ED/main/EDBioType.F90 -M models/lnd/clm/src/ED/main/EDCLMLinkMod.F90 -D models/lnd/clm/src/ED/main/EDVecPatchType.F90 -D models/lnd/clm/src/ED/biogeophys/EDPhenologyMod.F90 -A models/lnd/clm/src/ED/biogeochem/EDPhenologyType.F90 -A models/lnd/clm/src/ED/biogeochem/EDSharedParamsMod.F90 - ---------------------------------------------------- -ED Refactorization2 -(1) Modified EDTypesMod.F90 - Removed gridcell_edstate_type (array of pointers) and instance - gridcelledstate - now have the following ED types and instance - defined in clm_instMod.F90 and passed down in clm_initialize and clm_driver (top level) - type(ed_site_type), allocatable, target :: ed_allsites_inst(:) - type(ed_phenology_type) :: ed_phenology_inst - type(ed_clm_type) :: ed_clm_inst - so now have ed_allsites_inst which is an array of sites (at this point allocated at the - gridcell level - but that could easily be modified to be at some other level like the - column level -(2) In EDTypesMod.F90 added method map_clmpatch_to_edpatch that - maps a CLM vector patch to an ED linked-list patch - there is still - a one to one correspondence between an ED patch and a CLM vector patch. The - call looks like the following - currentPatch => map_clmpatch_to_edpatch(ed_allsites_inst(g), p) - -(3) In EDTypesMod.F90 added a ED Patch type-bound method set_root_fraction that computes - the root fraction for an ED patch -(4) In EDTypes.F90 eliminated the following components of userdata - type (site) , pointer :: firstsite_pnt => null() ! pointer to the first site in the system - type (cohort), pointer :: storesmallcohort => null() ! storage of the smallest cohort for insertion routine - type (cohort), pointer :: storebigcohort => null() ! storage of the largest cohort for insertion routine - These are no longer needed since the above pointers are now local variables - in EDCohortDynamics and EDPatchDynamics ---------------------------------------------------- -M models/lnd/clm/src/ED/main/EDVecCohortType.F90 -M models/lnd/clm/src/ED/main/EDRestVectorMod.F90 -M models/lnd/clm/src/ED/main/EDInitMod.F90 -M models/lnd/clm/src/ED/main/EDMainMod.F90 -M models/lnd/clm/src/ED/main/EDTypesMod.F90 -M models/lnd/clm/src/ED/fire/SFMainMod.F90 -M models/lnd/clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90 -M models/lnd/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 -M models/lnd/clm/src/ED/biogeochem/EDPhysiologyMod.F90 -M models/lnd/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 -M models/lnd/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 -M models/lnd/clm/src/ED/biogeophys/EDAccumulateFluxesMod.F90 -M models/lnd/clm/src/ED/biogeophys/EDSurfaceAlbedoMod.F90 -M models/lnd/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 -M models/lnd/clm/src/ED/biogeophys/EDBtranMod.F90 - ---------------------------------------------------- -The following changes are implemented below (and in the above routines) -(1) _vars% changed to _inst% -(2) pft% changed to patch% -(3) merged ecophyscon and pftvarcon into single derived type pftcon (in pftconMod) - "use EcophysConType, only : ecophyscon" changed to "use pftconMod, only : pftcon" -(4) module save statements removed in majority of routines ---------------------------------------------------- -D models/lnd/clm/src/main/EcophysConType.F90 -D models/lnd/clm/src/main/pftvarcon.F90 -A models/lnd/clm/src/main/pftconMod.F90 -M models/lnd/clm/src/main/initInterp.F90 -M models/lnd/clm/src/main/clm_varpar.F90 -M models/lnd/clm/src/main/landunit_varcon.F90 -M models/lnd/clm/src/main/accumulMod.F90 -M models/lnd/clm/src/main/subgridWeightsMod.F90 -M models/lnd/clm/src/main/decompInitMod.F90 -M models/lnd/clm/src/main/clm_initializeMod.F90 -M models/lnd/clm/src/main/subgridRestMod.F90 -M models/lnd/clm/src/main/ColumnType.F90 -M models/lnd/clm/src/main/subgridMod.F90 -M models/lnd/clm/src/main/PatchType.F90 -M models/lnd/clm/src/main/ndepStreamMod.F90 -M models/lnd/clm/src/main/lnd2atmType.F90 -M models/lnd/clm/src/main/atm2lndType.F90 -M models/lnd/clm/src/main/histFileMod.F90 -M models/lnd/clm/src/main/restFileMod.F90 -M models/lnd/clm/src/main/clm_varsur.F90 -M models/lnd/clm/src/main/LandunitType.F90 -M models/lnd/clm/src/main/GetGlobalValuesMod.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/main/initSubgridMod.F90 -M models/lnd/clm/src/main/filterMod.F90 -M models/lnd/clm/src/main/lnd2glcMod.F90 -M models/lnd/clm/src/main/clm_driver.F90 -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/subgridAveMod.F90 -M models/lnd/clm/src/main/initGridCellsMod.F90 -M models/lnd/clm/src/main/atm2lndMod.F90 -M models/lnd/clm/src/main/lnd2atmMod.F90 -M models/lnd/clm/src/main/ncdio_pio.F90 -M models/lnd/clm/src/main/surfrdMod.F90 -M models/lnd/clm/src/main/decompMod.F90 -M models/lnd/clm/src/main/reweightMod.F90 -M models/lnd/clm/src/main/readParamsMod.F90 -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/WaterfluxType.F90 -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/biogeophys/SnowSnicarMod.F90 -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/LakeTemperatureMod.F90 -M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/biogeophys/SoilFluxesMod.F90 -M models/lnd/clm/src/biogeophys/TemperatureType.F90 -M models/lnd/clm/src/biogeophys/HumanIndexMod.F90 -M models/lnd/clm/src/biogeophys/PhotosynthesisMod.F90 -M models/lnd/clm/src/biogeophys/LakeFluxesMod.F90 -M models/lnd/clm/src/biogeophys/AerosolMod.F90 -M models/lnd/clm/src/biogeophys/ActiveLayerMod.F90 -M models/lnd/clm/src/biogeophys/SurfaceResistanceMod.F90 -M models/lnd/clm/src/biogeophys/SoilStateType.F90 -M models/lnd/clm/src/biogeophys/SoilHydrologyType.F90 -M models/lnd/clm/src/biogeophys/HydrologyDrainageMod.F90 -M models/lnd/clm/src/biogeophys/UrbanAlbedoMod.F90 -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/biogeophys/RootBiophysMod.F90 -M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/biogeophys/SoilWaterMovementMod.F90 -M models/lnd/clm/src/biogeophys/SoilMoistStressMod.F90 -M models/lnd/clm/src/biogeophys/UrbBuildTempOleson2015Mod.F90 -M models/lnd/clm/src/biogeophys/CanopyHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/EnergyFluxType.F90 -M models/lnd/clm/src/biogeophys/CanopyStateType.F90 -M models/lnd/clm/src/biogeophys/UrbanFluxesMod.F90 -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/biogeophys/UrbanRadiationMod.F90 -M models/lnd/clm/src/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/IrrigationMod.F90 -M models/lnd/clm/src/biogeophys/CanopyTemperatureMod.F90 -M models/lnd/clm/src/biogeophys/HydrologyNoDrainageMod.F90 -M models/lnd/clm/src/biogeophys/LakeHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/UrbanParamsType.F90 -M models/lnd/clm/src/dyn_subgrid/dynLandunitAreaMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynFileMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynConsBiogeochemMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynPriorWeightsMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynVarMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynEDMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynVarTimeInterpMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynCNDVMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynVarMod.F90.in -M models/lnd/clm/src/dyn_subgrid/dynVarTimeInterpMod.F90.in -M models/lnd/clm/src/dyn_subgrid/dynInitColumnsMod.F90 -M models/lnd/clm/src/cpl/lnd_comp_esmf.F90 -M models/lnd/clm/src/cpl/lnd_import_export.F90 -M models/lnd/clm/src/cpl/lnd_comp_mct.F90 -M models/lnd/clm/src/utils/accumulMod.F90 -M models/lnd/clm/src/utils/domainMod.F90 - ---------------------------------------------------- -Changes for Unit testing ---------------------------------------------------- -R models/lnd/clm/src/ED/main/CMakeLists.txt -M models/lnd/clm/src/unit_test_shr/unittestSubgridMod.F90 -M models/lnd/clm/src/CMakeLists.txt - ---------------------------------------------------- -Configuration changes for new soilbiogeochem/ ---------------------------------------------------- -M models/lnd/clm/bld/configure - -CLM testing: - - unit-tests (models/lnd/clm/src): - - yellowstone - okay - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - okay - yellowstone_pgi - okay - yellowstone_gnu - okay - goldbach_nag - okay - - goldbach_intel (moved these to yellowstone_intel for future tests) - -CLM tag used for the baseline comparisons: clm4_5_1_r096 - -Changes answers relative to baseline: NO (bit-for-bit) - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r096 -Originator(s): erik (Erik) -Date: Wed Nov 19 02:11:09 MST 2014 -One-line Summary: Several answer changing bug-fixes: snow grain size, lake hydrology, default settings, organic soil - -Purpose of changes: - -Bring in several bug-fixes most of which change answers. - -Snow grain size bug that Mark Flanner discovered under snow layer combination. -Lake hydrology fix from Zack Subin that would rarely cause the code to abort. Snow depth fix from -Sean Swenson. Use Priglent inversion as recommended by Charlie Koven. Correct population density for 2000 conditions -from 1850 to peroperly be 2000. Modify all Carbon on spinup from Dave Lawrenece. Add option to square or not square -the organic fraction (default is to square for clm4_5 and to NOT for clm5_0). Bug with pervious road that Keith -Oleson found. Simplify an if for urban to consistently use a double precision constant. Point to the new CLMNCEP_V5 -dataset. - -For clm4_0 rcp6 and rcp8.5 pftdyn datasets are updated for after 2005. - -Some fixes that don't change answers. Get the Prigilent inversion and usephfact options working again. -Fix a bug in interp_source option that Sean Swenson found. Split out test datasets for getregional script since -the datasets all have to be at the same resolution as the domain file. Also read filelist rather than use env -variables. - -Requirements for tag: Fix the bugs below - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1934 -- snow grain size (both clm4_0 and clm4_5). Just fix on clm4_5 side. - 1717 -- lake hydrology fix (clm4_5 only) - 1941 -- snowdp fix from Sean (both clm4_0 and clm4_5) (fix in clm4_5_1_r087) - 1759 -- ngwh for clm4_0 datasets (apply cesm1_2_x_n10_clm4_5_10) - 1772 -- use Priglent inversion - 1838 -- pop dens is 1850 for 2000 compsets - 1774 -- modify all Carbon on spinup - 1765 -- remove duplicate setting of bd and tkdry - 1764 -- Bug with pervious road - 2066 -- getregional_datasets.pl bug for long lists of files - 2067 -- get Prigilent inversion and usephfact options working. - 2081 -- point to new CLMNCEP_V5 version - 2061 -- make constant consistently double precision rather than have an if around it - 2089 -- bug in interp_source that Sean Swenson found - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Add organic_frac_squared=.false. logical as a clm5_0 default feature - The old behavior organic_frac_squared=.true. is on as before for clm4_5. - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, dlawren, swensosc, mflanner, subin - -List any svn externals directories updated (csm_share, mct, etc.): datm - update datm to datm8_141113 update CRUNCEP_V5 dataset version used - -List all files eliminated: None - -List all files added and what they do: - -=========== Split out getregional lists (all files in list MUST be at same res as domain file) -A models/lnd/clm/test/tools/nl_files/getregional_05popd -A models/lnd/clm/test/tools/nl_files/getregional_T62 -A models/lnd/clm/test/tools/nl_files/getregional_ndep -A models/lnd/clm/tools/shared/ncl_scripts/sample_inlist_0.5popd -A models/lnd/clm/tools/shared/ncl_scripts/sample_inlist_ndep -A models/lnd/clm/tools/shared/ncl_scripts/sample_outlist_0.5popd -A models/lnd/clm/tools/shared/ncl_scripts/sample_outlist_ndep -A models/lnd/clm/tools/shared/ncl_scripts/sample_inlist_T62 -A models/lnd/clm/tools/shared/ncl_scripts/sample_outlist_T62 - -List all existing files that have been modified, and describe the changes: - -=========== Change getregional tests -M models/lnd/clm/test/tools/input_tests_master -M models/lnd/clm/test/tools/tests_posttag_nompi_regression - -=========== Bring in -M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.pl -M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.ncl -M models/lnd/clm/tools/shared/ncl_scripts/sample_inlist -M models/lnd/clm/tools/shared/ncl_scripts/sample_outlist - -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl ------------ correct number of tests -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml ---- Update rcp6 and rcp8.5 pftdyn datasets -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ---- Add organic_frac_squared, - set fin_use_fsat=.false. by default -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -- Add organic_frac_squared -M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml ------ Correct year for popd from 1850 to 2000 -M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - Correct year for popd from 1850 to 2000 - -M models/lnd/clm/bld/CLMBuildNamelist.pm - Add organic_frac_squared and change setup_logic_more_vertlayers to - setup_logic_soilstate - -M models/lnd/clm/src/utils/CMakeLists.txt - Add namelist util to source list - -M models/lnd/clm/src/biogeochem/ch4Mod.F90 ------------- Pass fsurdat to initCold -M models/lnd/clm/src/biogeochem/CNCarbonStateType.F90 -- Use nlevdecomp_full in place of nlevdecomp -M models/lnd/clm/src/main/initInterp.F90 --------------- Change use of rbufsli to rbufslo -M models/lnd/clm/src/main/clm_initializeMod.F90 -------- Pass nlfilename into soilstate_vars init -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ---- Add col%itype(c) == icol_road_perv to an if condition -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - Use 1.0_r8 constant always, rather than integer 1 - for clm4_5 -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 --- Use Mass-weighted combination of radius for combo -M models/lnd/clm/src/biogeophys/SoilStateType.F90 ------ Add organic_frac_squared logical and namelist read - for it. Add two if's that determine if organic_frac - should be squared or not. -M models/lnd/clm/src/biogeophys/LakeHydrologyMod.F90 --- Break apart if-condition for snl==-1 - -CLM testing: regular - - build-namelist tests: - - yellowstone yes - - unit-tests (models/lnd/clm/src): - - yellowstone yes (although still fails) - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - - short tests (aux_clm_short) (generally these are NOT used when making a tag): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - - tools testing: (when tools modified or scripts updated (for PTCLM)) - - yellowstone interactive yes - PTCLM (models/lnd/clm/tools/shared/PTCLM/test) yellowstone yes - -CLM tag used for the baseline comparisons: - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change (similar climate, except new clm5_0 feature) - - clm4_0 for rcp6 and rcp8.5 changes answers by using the new good wood harvest - datasets for after 2005. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - /home/erik/noorg_clm451r092_I1850CRUCLM45BGC -- clm4_5 default version - /home/erik/clm451r092_I1850CRUCLM45BGC -------- clm4_5 with organic_frac_squared=.false. - (clm5_0 default version) - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r095 -Originator(s): andre (Benjamin Andre,UCAR/CSEG,303-497-1391) -Date: Mon Nov 10 17:54:18 MST 2014 -One-line Summary: refactoring N comp by Jinyun Tang (LBL) and transpiration sink isolation by Gautam Bisht (LBL) - -Purpose of changes: Bring in two refactorings: - Jinyun Tang (LBL) - isolation of the routines to do soil nutrient - competition dynamics into a module, and allow for different - implementations through runtime polymorphism. - - Gautam Bisht (LBL) - new function to make transpiration sink - distribution independent of subsurface flow physics - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2039 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: andre, cmt - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -Nutrient Competition - List all files added and what they do: - A clm/src/biogeochem/NutrientCompetitionFactoryMod.F90 - factory module to select soil nutrient competition method - A clm/src/biogeochem/NutrientCompetitionMethodMod.F90 - abstract base class for soil nutrient competition dynamics - A clm/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 - existing clm45 implementation of soil nutrient competition dynamics - - List all existing files that have been modified, and describe the changes: - M clm/src/biogeochem/CNDecompMod.F90 - add nutrient competition method to function parameters - M clm/src/biogeochem/CropType.F90 - rename UpdateAccVars() to work around pgi compiler error, remove dependency on temperature_type - M clm/src/biogeochem/CNAllocationMod.F90 - move code into clm45 default nutrient competition module - M clm/src/biogeochem/CNEcosystemDynMod.F90 - add nutrient competition method to function parameters - MM clm/src/main/clm_initializeMod.F90 - add nutrient competition method to function parameters - M clm/src/main/clm_driver.F90 - add nutrient competition method to function parameters, call to renamed CropUpdateAccVars - M clm/src/main/readParamsMod.F90 - add nutrient competition method to function parameters - -Transpiration Sink: - List all existing files that have been modified, and describe the changes: -M clm/src/biogeophys/SoilWaterMovementMod.F90 - move transpiration sink into separate function so it is independent of physics. - - -CLM testing: - - build-namelist tests: n/a - - unit-tests (models/lnd/clm/src): no - - yellowstone - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 4.0 ok; 4.5 ok - yellowstone_pgi - 4.0 ok; 4.5 ok - yellowstone_gnu - n/a; 4.5 ok - goldbach_nag - 4.0 ok; 4.5 ok - goldbach_intel - 4.0 ok; 4.5 ok - - short tests (aux_clm_short) - no - - tools testing: (when tools modified or scripts updated (for PTCLM)) - n/a - -CLM tag used for the baseline comparisons: clm4_5_1_r094 - -Changes answers relative to baseline: no - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r094 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Nov 7 13:43:38 MST 2014 -One-line Summary: misc. glacier-related updates - -Purpose of changes: - -(1) Add dlnd, satm and srof externals, so that TG compsets (CISM-only, forced by - dlnd) can be run from a CLM tag. This will facilitate CISM development and - testing. - -(2) Remove CLM's dependence on the CISM grid. Previously, CLM used the CISM grid - to determine which fglcmask file to use. But the differences between the - fglcmask files were inconsequential (all of them included the full area of - Greenland, which is what was important). I have created a new set of - fglcmask files that are independent of the CISM grid, and point CLM to these - new files. This will make it easier to add new CISM grids in the future, - because no changes will be needed in CLM for this purpose. However, note - that the use of these new files means that the number of virtual landunits & - columns changes for glcmec runs. - -(3) In subgridAveMod, fix c2l routines: change pft%wtlunit to col%wtlunit (bugz - 2077) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 2077 (c2l references pft instead of col) -- 2085 (listDefaultNamelist is broken) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: change fglcmask - -List any changes to the defaults for the boundary datasets: change fglcmask - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - -========= Added new externals for the sake of running TG compsets (CISM-only) - from a CLM tag -+models/lnd/dlnd https://svn-ccsm-models.cgd.ucar.edu/dlnd7/trunk_tags/dlnd8_131201 -+models/atm/satm https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/satm -+models/rof/srof https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/srof - -========= Other externals updates --tools/unit_testing https://svn-ccsm-models.cgd.ucar.edu/unit_testing/trunk_tags/unit_testing_0_07 -+tools/unit_testing https://svn-ccsm-models.cgd.ucar.edu/unit_testing/trunk_tags/unit_testing_0_08 - - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -========= Remove dependence on CISM grid -M models/lnd/clm/bld/listDefaultNamelist.pl - - also fix bug 2085 -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M models/lnd/clm/bld/clm.buildnml.csh -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults.xsl -M models/lnd/clm/bld/user_nl_clm -M models/lnd/clm/bld/CLMBuildNamelist.pm -M models/lnd/clm/doc/UsersGuide/custom.xml -M models/lnd/clm/src_clm40/main/controlMod.F90 -M models/lnd/clm/src_clm40/main/clm_varctl.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/main/clm_varctl.F90 - -========= Change pft%wtlunit to col%wtlunit in c2l routines (which currently - aren't called from anywhere in the code) (bugz 2077) -M models/lnd/clm/src/main/subgridAveMod.F90 - -========= fix numbers of build-namelist unit test failures, due to removal of a test -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - expected failure in 23, due to change in fglcmask - - unit-tests (models/lnd/clm/src): - - yellowstone: still broken, due to internal compiler error - roo2 (mac laptop): ok - - See notes in clm4_5_1_r090. Point (2) has been fixed, but point (1) remains. - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu: ok - goldbach_nag: ok - goldbach_intel: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r093 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: IG compsets - both CLM40 and CLM45 - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - only changes diagnostic cpl hist fields - no change in the simulation - - The changes arise from the new glcmask files, which exclude a few points - from the glcmask that used to be included. These points are all outside - of Greenland, so they are not important for coupling to CISM. However, - it means that a few virtual columns have been removed. This, in turn, - changes the values of some l2x topo, tsrf and qice fields sent to the - coupler. But this does NOT feed back on the simulation in any way. - - Some tests also exhibit diffs in the CLM diagnostic fields PCT_GLC_MEC - and QICE_FORC. Again, these are due to changes in where we have virtual - columns, and do not affect the simulation. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r093 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Nov 7 13:17:47 MST 2014 -One-line Summary: change cold-start snow initialization, update cism external - -Purpose of changes: - -(1) Change cold-start snow initialization logic. The original logic did -different snow initialization depending on whether we are inside or outside the -glcmask. That's a problem in that answers change depending on the glcmask. The -new logic instead uses a latitude threshold for determining where to initialize -a non-zero snow pack. Note that this will change answers for all cold-start -cases, including non-glcmec cases. - -(2) Update CISM to version 2. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self; Dave Lawrence agreed with the change to snow initialization - -List any svn externals directories updated (csm_share, mct, etc.): --models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_140916 -+models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism2_0_02 - - -List all files eliminated: - -List all files added and what they do: - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/main/clm_initializeMod.F90 - -CLM testing: - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu: ok - goldbach_nag: ok - goldbach_intel: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r092 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - (1) any CLM4.5 case with cold start initialization, due to change in snow - initialization - - (2) any case that includes CISM, due to answer changes in the CISM external - - I carefully checked the yellowstone-intel clm4.5 tests to ensure that: - (a) FAILed compare_hist all had finidat = ' ' - (b) PASSed compare_hist either had non-blank finidat OR were single-point - - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated, but expected to be larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r092 -Originator(s): muszala (Stefan Muszala) -Date: Tue Nov 4 06:10:16 MST 2014 -One-line Summary: bug fixes from santos that address valgrind problems. update rtm external - -Purpose of changes: Addresses issues found with Valgrind by Santos. Update RTM. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: santos, self - -List any svn externals directories updated (csm_share, mct, etc.): --models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_39 -+models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_40 - -List all files eliminated: N/A - -List all files added and what they do: - -A + models/lnd/clm/src/main/dtypes.h - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml --- update failures - -M SVN_EXTERNAL_DIRECTORIES --- rtm update to 40 - -M models/lnd/clm/src_clm40/main/ncdio_pio.F90 -M models/lnd/clm/src_clm40/main/ncdio_pio.F90.in -M models/lnd/clm/src/main/ncdio_pio.F90 -M models/lnd/clm/src/main/ncdio_pio.F90.in --- example changes: -- status = pio_inq_vardimid(ncid, vardesc , dids) -+ status = pio_inq_vardimid(ncid, vardesc , dids(1:ndims)) - -M models/lnd/clm/src_clm40/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/biogeophys/FrictionVelocityMod.F90 --- change 1.0_8 to 1.0_r8 - -CLM testing: - - build-namelist tests: N/A - - unit-tests (models/lnd/clm/src): N/A - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel 40- OK 45- OK - yellowstone_pgi 40- OK 45- OK - yellowstone_gnu 40- N/A 45- OK - goldbach_nag 40- OK 45- OK - goldbach_intel 40- OK 45- OK - - tools testing: (when tools modified or scripts updated (for PTCLM)) N/A - -CLM tag used for the baseline comparisons: clm4_5_1_r091 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r091 -Originator(s): muszala (Stefan Muszala) -Date: Mon Oct 27 09:48:56 MDT 2014 -One-line Summary: update externals. fix bug so CLM runs with Intel 14x. - -Purpose of changes: Update externals. Fix bug in VOCEmissionMod.F90 that prevented -CLM from running with Intel 14x on yellowstone. Bring in workaround for bug 1730 from -Sacks. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - see CLM test fail list - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, clm developers, particularly Bill Sacks. - -List any svn externals directories updated (csm_share, mct, etc.): --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_141009 -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_141023 --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_141001 -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_141017a --models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_141003 -+models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_141022 --models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_140416 -+models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_140925 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - --- reflect changes in new testlists -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml --- Sacks' workaround for bug 1730 -M models/lnd/clm/src/main/histFileMod.F90 -M models/lnd/clm/src/main/ncdio_pio.F90 -M models/lnd/clm/src/main/ncdio_pio.F90.in --- remove duplicate assignment of 0_r8 to meg_out(imeg)%flux_out -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 --- update externals -M SVN_EXTERNAL_DIRECTORIES - -CLM testing: - - Please view the CLM expected fail list for new test failures. They are matched - to bugzilla bug ids. - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 40 - OK 45 - OK - yellowstone_pgi - 40 - OK 45 - OK - yellowstone_gnu - 40 - N/A 45 - OK - goldbach_nag - 40 - OK 45 - OK - goldbach_intel - 40 - OK 45 - OK - -CLM tag used for the baseline comparisons: clm4_5_1_r090 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r090 -Originator(s): sacks (Bill Sacks) -Date: Thu Oct 16 06:39:52 MDT 2014 -One-line Summary: modularize irrigation; do some unit test rework - -Purpose of changes: - -(1) Pull irrigation code out of CanopyFluxes and CanopyHydrology, into its - own module - -(2) Pull out the locally-created filters from CanopyFluxes and BareGroundFluxes - into filterMod, in order to support pulling irrigation out of - CanopyFluxes. This will also be needed to support pulling other hydrology - stuff out of CanopyFluxes. - -(3) Add unit tests for irrigation - -(4) Rework some irrigation infrastruture, and add some more unit test utility - routines - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2063 (HumanIndexMod fails to compile with gfortran) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: muszala - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - -========= Renamed to unit_test_stubs -D models/lnd/clm/src/unit_test_mocks/util_share/ncdio_var.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/restUtilMod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/GetGlobalValuesMod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/ncdio_var.F90.in -D models/lnd/clm/src/unit_test_mocks/util_share/restUtilMod_mock.F90.in -D models/lnd/clm/src/unit_test_mocks/util_share/clm_time_manager_mock.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/spmdMod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/util_share/do_genf90 -D models/lnd/clm/src/unit_test_mocks/util_share/CMakeLists.txt -D models/lnd/clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90.in -D models/lnd/clm/src/unit_test_mocks/util_share -D models/lnd/clm/src/unit_test_mocks/csm_share/shr_mpi_mod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/csm_share/mct_mod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/csm_share/CMakeLists.txt -D models/lnd/clm/src/unit_test_mocks/csm_share -D models/lnd/clm/src/unit_test_mocks/main/CMakeLists.txt -D models/lnd/clm/src/unit_test_mocks/main/histFileMod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/main -D models/lnd/clm/src/unit_test_mocks/dyn_subgrid/dynFileMod_mock.F90 -D models/lnd/clm/src/unit_test_mocks/dyn_subgrid/CMakeLists.txt -D models/lnd/clm/src/unit_test_mocks/dyn_subgrid -D models/lnd/clm/src/unit_test_mocks/CMakeLists.txt -D models/lnd/clm/src/unit_test_mocks - -========= Remove unnecessary files -D models/lnd/clm/src/ED/CMakeLists.txt -D models/lnd/clm/src/ED/biogeophys/CMakeLists.txt - -List all files added and what they do: - -========= Pull out irrigation code into its own module -A models/lnd/clm/src/biogeophys/IrrigationMod.F90 - -========= Add some unit test utility code (and some tests for the utility code) -A models/lnd/clm/src/unit_test_shr/unittestFilterBuilderMod.F90 -A models/lnd/clm/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 -A models/lnd/clm/src/unit_test_shr/test/unittestFilterBuilder_test/test_filterBuilder.pf -A models/lnd/clm/src/unit_test_shr/test/unittestFilterBuilder_test/CMakeLists.txt -A models/lnd/clm/src/unit_test_shr/test/unittestFilterBuilder_test -A models/lnd/clm/src/unit_test_shr/test/CMakeLists.txt -A models/lnd/clm/src/unit_test_shr/test - -========= Renamed from unit_test_mocks to unit_test_stubs; also renamed - individual files from mock to stub (or 'fake' for ncdio_pio, because - it does more than a stub); also, moved some stubs to match the current - organization of the main source tree -A models/lnd/clm/src/unit_test_stubs/utils/restUtilMod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/utils/do_genf90 -A models/lnd/clm/src/unit_test_stubs/utils/restUtilMod_stub.F90.in -A models/lnd/clm/src/unit_test_stubs/utils/CMakeLists.txt -A models/lnd/clm/src/unit_test_stubs/utils/clm_time_manager_stub.F90 -A models/lnd/clm/src/unit_test_stubs/utils/spmdMod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/utils -A models/lnd/clm/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/csm_share/mct_mod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/csm_share/CMakeLists.txt -A models/lnd/clm/src/unit_test_stubs/csm_share -A models/lnd/clm/src/unit_test_stubs/main/histFileMod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/main/ncdio_var.F90 -A models/lnd/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90 -A models/lnd/clm/src/unit_test_stubs/main/ncdio_var.F90.in -A models/lnd/clm/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/main/do_genf90 -A models/lnd/clm/src/unit_test_stubs/main/ncdio_pio_fake.F90.in -A models/lnd/clm/src/unit_test_stubs/main/CMakeLists.txt -A models/lnd/clm/src/unit_test_stubs/main -A models/lnd/clm/src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 -A models/lnd/clm/src/unit_test_stubs/dyn_subgrid/CMakeLists.txt -A models/lnd/clm/src/unit_test_stubs/dyn_subgrid -A models/lnd/clm/src/unit_test_stubs/CMakeLists.txt -A models/lnd/clm/src/unit_test_stubs - -========= Add dependencies (direct & indirect) of IrrigationMod -A models/lnd/clm/src/biogeochem/CMakeLists.txt - -========= Add unit tests for irrigation (see README file for some design notes) -A models/lnd/clm/src/biogeophys/test/Irrigation_test/test_irrigation_deficit.pf -A models/lnd/clm/src/biogeophys/test/Irrigation_test/test_irrigation_multipatch.pf -A models/lnd/clm/src/biogeophys/test/Irrigation_test/IrrigationWrapperMod.F90 -A models/lnd/clm/src/biogeophys/test/Irrigation_test/test_irrigation_singlepatch.pf -A models/lnd/clm/src/biogeophys/test/Irrigation_test/CMakeLists.txt -A models/lnd/clm/src/biogeophys/test/Irrigation_test/README -A models/lnd/clm/src/biogeophys/test/Irrigation_test - -List all existing files that have been modified, and describe the changes: - -========= Pull irrigation out of CanopyFluxes into its own routine, and also - pull out the filters that used to be created locally in CanopyFluxes - and BareGroundFluxes -M models/lnd/clm/src/main/clm_driver.F90 - -========= Pull out filters that used to be created locally in CanopyFluxes and - BareGroundFluxes, so that they can be reused in irrigation and - elsewhere -M models/lnd/clm/src/main/filterMod.F90 - -========= Add calls to irrigation init & restart routines -MM models/lnd/clm/src/main/clm_initializeMod.F90 -M models/lnd/clm/src/main/restFileMod.F90 - -========= Irrigation computations are now done in the irrigation module; also, - the relevant filter is now created outside CanopyFluxes -MM models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 - -========= Irrigation computations are now done in the irrigation module -M models/lnd/clm/src/biogeophys/CanopyHydrologyMod.F90 -M models/lnd/clm/src/biogeophys/LakeHydrologyMod.F90 - -========= Irrigation variables are now defined in the irrigation module -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/WaterfluxType.F90 -M models/lnd/clm/src/biogeophys/HydrologyDrainageMod.F90 - -========= Filter is now created outside BareGroundFluxes; also, moved some bare - ground initialization from CanopyFluxes (needed because the filters - are no longer created locally, so CanopyFluxes does not know what - points it would need to set for bare ground) -MM models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 - -========= Remove some dependencies to aid unit testing (this includes combining - two branches of a conditional (allowlakeprod) that were doing the same - thing -M models/lnd/clm/src/biogeophys/SoilStateType.F90 - - -========= Add dependencies (direct & indirect) of IrrigationMod for unit testing -M models/lnd/clm/src/utils/CMakeLists.txt -M models/lnd/clm/src/main/CMakeLists.txt -M models/lnd/clm/src/ED/main/CMakeLists.txt -M models/lnd/clm/src/CMakeLists.txt -M models/lnd/clm/src/biogeophys/CMakeLists.txt -M models/lnd/clm/src/biogeophys/test/CMakeLists.txt - -========= Add new unit test utilities -M models/lnd/clm/src/unit_test_shr/CMakeLists.txt - -========= Make newly-added subgrid units active by default -M models/lnd/clm/src/unit_test_shr/unittestSubgridMod.F90 - -========= Unrelated fix for gfortran -MM models/lnd/clm/src/biogeophys/HumanIndexMod.F90 - -========= Change whitespace -M models/lnd/clm/src/dyn_subgrid/CMakeLists.txt - - -CLM testing: - - build-namelist tests: - - yellowstone: not run - - unit-tests (models/lnd/clm/src): - - yellowstone: fail due to two issues: - - (1) The unit tests currently won't build on yellowstone due to an ICE that - will probably be fixed when we remove dependencies of SoilStateType. - - (2) In addition, even once that's fixed, the yellowstone unit tests either - need (a) a bump in the unit testing external (unit_testing_0_08) and - Machines external (Machines_141007) (I didn't do that for my tag because - it pulls in a bump in the intel compiler version to 14 rather than 13.1), - or (b) the following diffs: - - Index: tools/unit_testing/python/machine_setup.py - =================================================================== - --- tools/unit_testing/python/machine_setup.py (revision 64421) - +++ tools/unit_testing/python/machine_setup.py (working copy) - @@ -52,7 +52,7 @@ - mod.load("ncarenv/1.0") - mod.load("ncarbinlibs/1.0") - if compiler == "intel": - - mod.load("intel/13.1.2") - + mod.load("intel/14.0.2") - elif compiler == "pgi": - mod.load("pgi/13.9") - mod.load("ncarcompilers/1.0") - Index: scripts/ccsm_utils/Machines/config_compilers.xml - =================================================================== - --- scripts/ccsm_utils/Machines/config_compilers.xml (revision 64421) - +++ scripts/ccsm_utils/Machines/config_compilers.xml (working copy) - @@ -547,7 +547,7 @@ - -xHost - -xHost - $(TRILINOS_PATH) - - /glade/u/home/santos/pFUnit/pFUnit_Intel - + /glade/u/home/sacks/pFUnit/pFUnit3.0.1_Intel14.0.2_Serial - - - - - - - However, I have run the unit tests on my mac, with gfortran, and they all - pass - - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu: NOT RUN - goldbach_nag: ok - goldbach_intel: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r089 - -Changes answers relative to baseline: YES (but only because of bug 1998) - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: irrigation - - what platforms/compilers: all - - nature of change: larger than roundoff, not investigated closely - - The changes are entirely due to the btran bug (bug 1998): The old flow was: - - compute btran - - calculate irrigation (depends on btran) - - hack btran for soybeans - - whereas the new flow is: - - call CanopyFluxes: computes btran and hacks btran for soybeans - - calculate irrigation (depends on btran) - - I have confirmed that answers are bit-for-bit for both irrigation tests (for - both cpl and clm hist files), when I introduce the following diffs in both - the trunk and the branch: - - Index: src/biogeophys/CanopyFluxesMod.F90 - =================================================================== - --- src/biogeophys/CanopyFluxesMod.F90 (revision 64406) - +++ src/biogeophys/CanopyFluxesMod.F90 (working copy) - @@ -842,9 +842,6 @@ - btran(p) = min(1._r8, btran(p) * 3.33_r8) - end if - end if - - if (pft%itype(p) == nsoybean .or. pft%itype(p) == nsoybeanirrig) then - - btran(p) = min(1._r8, btran(p) * 1.25_r8) - - end if - end do - - if ( use_ed ) then - @@ -894,9 +891,6 @@ - btran(p) = min(1._r8, btran(p) * 3.33_r8) - end if - end if - - if (pft%itype(p) == nsoybean .or. pft%itype(p) == nsoybeanirrig) then - - btran(p) = min(1._r8, btran(p) * 1.25_r8) - - end if - end do - - call Photosynthesis (bounds, fn, filterp, & - - - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r089 -Originator(s): erik (Erik) -Date: Mon Oct 13 13:46:43 MDT 2014 -One-line Summary: Bring new urban building temperature to trunk as a clm5.0 feature - as well as human-stress index calculations - -Purpose of changes: - -New prognostic internal building air temperature methodology for CLM5.0. Retain the older simpler method -for CLM4.5. The namelist toggle to switch between them is: building_temp_method. By default for clm4_5 physics -the older method is used and for clm5_0 the newer one is used. Also add in a package of human-stress index -calculations. Again this is by default on for clm5_0 and off for clm4_5. - -The new building air temperature methodology, solves the system of equations for internal: air, roof, floor, -and wall (shade and sunlit) Temperatures. It uses the LAPACK subroutine DGESV to solve the system. It also -figures out the energy flux needed to either cool the building air temperature to a maximum allowed temperature -or to heat it to the minimum allowed temperature. - -Add in the new load balancing tool and the PyReshaper tool (changes multi-variable -monthly history files into single-variable time-series files). - -Remove the now unneeded clm4_5 interpinic as well as the mkmapgrids FORTRAN program. - -Requirements for tag: Bring in new clm5_0 building temperature as option, Fix scripts bugs, bug 2053/2032 - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 2053 Problems with dry-deposition for fully coupled cases with CLM4.5 in cesm1_3_beta13 - 2032 rtm.buildnml.csh kills cesm_setup if GET_REFCASE is FALSE - 1685 Drydeposition potentially using "rs" variable before it's defined (over water) - (was fixed but came back) - Fix bugs: 2024, 2035, 2037 in scripts SBN and namelistcompare issues - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: new namelists and namelist items - add: clmu_inparm and clm_humanindex_inparm namelists - move: urban_hac and urban_traffic to clmu_inparm - add: calc_human_stress_indices to clm_humanindex_inparm - building_temp_method to clmu_inparm - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: - clm5_0 memory use is greater than clm4_5 due to human_stress_indices calculations - and output on history (I've seen it make up to a 20% difference) - -Code reviewed by: self, oleson, sacks, mvertens, andre - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, rtm, cism, csm_share - Update to cesm1_3_alpha13c externals. - Also add in load_balancing_tool and pyReshaper - - scripts to scripts4_141009 - Machines to Machines_141001 - rtm to rtm1_0_39 - cism to cism1_140916 - csm_share to share3_141003 - load_balancing_tool to load_balancing_tool_140818 - pyReshaper to v0.9.1 - -List all files eliminated: - ---------- Remove clm4_5 interpinic, online interpinic supersedes it -D models/lnd/clm/tools/clm4_5/interpinic -D models/lnd/clm/tools/clm4_5/interpinic/* -D models/lnd/clm/tools/clm4_5/interpinic/src/* - ---------- Remove mkmapgrids program -D models/lnd/clm/tools/shared/mkmapgrids/src -D models/lnd/clm/tools/shared/mkmapgrids/src/* -D models/lnd/clm/tools/shared/mkmapgrids/mkmapgrids.namelist -D models/lnd/clm/tools/shared/mkmapgrids/mkmapgrids.csh - ---------- shr_sys_mod was mocked only because of it's use of shr_mpi_mod ---------- mock shr_mpi_mod instead and standard shr_sys_mod can be used -D models/lnd/clm/src/unit_test_mocks/csm_share/shr_sys_mod_mock.F90 - -List all files added and what they do: - -A models/lnd/clm/src/biogeophys/HumanIndexMod.F90 -- New module to - calculate a bunch of human stress index values. - -A models/lnd/clm/src/biogeophys/UrbBuildTempOleson2015Mod.F90 --- New module - for calculating the prognostic internal building air temperature. - ---------- New simple unit tester for humanstress indices module -A models/lnd/clm/src/biogeophys/test/HumanStress_test/test_humanstress.pf -A models/lnd/clm/src/biogeophys/test/HumanStress_test/CMakeLists.txt -A models/lnd/clm/src/biogeophys/test/HumanStress_test - -A models/lnd/clm/src/unit_test_mocks/csm_share/shr_mpi_mod_mock.F90 -- shell - for most shr_mpi_ calls that do nothing (so assumes MPI is NOT being done) - shr_mpi_abort does a stop - -List all existing files that have been modified, and describe the changes: - ---------- remove the mkgriddata and clm4_5 interpinic tools from testing -M models/lnd/clm/test/tools/input_tests_master -M models/lnd/clm/test/tools/tests_posttag_yong -M models/lnd/clm/test/tools/tests_posttag_nompi_regression -M models/lnd/clm/test/tools/tests_pretag_yellowstone_nompi - ---------- remove documentation of mkgriddata and clm4_5 interpinic tools ---------- but add documentation on ncl script -M models/lnd/clm/tools/shared/mkmapgrids/README -M models/lnd/clm/tools/README - ---------- Add new namelists: clmu_inparm and clm_humanindex_inparm -M models/lnd/clm/bld/configure ---- use same configuration for clm4_5 AND clm5_0 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Set - calc_human_stress_indices, and building_temp_method by clm4_5/clm5_0 -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Move - urban_hac and urban_traffic to new clmu_inparm namelist and - add building_temp_method and add calc_human_stress_indices to - clm_humanindex_inparm namelist -M models/lnd/clm/bld/CLMBuildNamelist.pm -------- Handle new namelists: - clmu_inparm and clm_humanindex_inparm - ---------- Get unit tests working again, and add a simple humanindex test -M models/lnd/clm/src/utils/CMakeLists.txt -M models/lnd/clm/src/ED/main/CMakeLists.txt -M models/lnd/clm/src/ED/biogeophys/CMakeLists.txt -M models/lnd/clm/src/README.unit_testing -M models/lnd/clm/src/biogeophys/CMakeLists.txt -M models/lnd/clm/src/biogeophys/test/CMakeLists.txt -M models/lnd/clm/src/unit_test_mocks/util_share/spmdMod_mock.F90 - set mpicom -M models/lnd/clm/src/unit_test_mocks/csm_share/CMakeLists.txt -M models/lnd/clm/src/CMakeLists.txt - ---------- Fix so can work with drydeposition namelist and without megan namelist -M models/lnd/clm/src/biogeochem/VOCEmissionMod.F90 - Don't initialize if - megan namelist is turned off (bug 2053) -M models/lnd/clm/src/biogeochem/DryDepVelocity.F90 - Make sure rs is set - before used (bug 1685) - ---------- Handle new building temperature options, add new constants -MM models/lnd/clm/src/main/clm_varcon.F90 -------- Bunch of new constants - for urban-building (should be moved to modules that use them). - Also pass is_simple_buildtemp into init method -MM models/lnd/clm/src/main/clm_initializeMod.F90 - Pass building temp type - down to relevent init methods add initialization for humanindex_vars, - initialize drydepvel_vars (bug 2053) -M models/lnd/clm/src/main/restFileMod.F90 ------- Pass building temp type - logicals down to energyflux_vars and temperature_vars restart methods -M models/lnd/clm/src/main/LandunitType.F90 ------ Add documentation, correct - error in documentation -MM models/lnd/clm/src/main/controlMod.F90 -------- Move urban namelist items to - UrbanReadNML, add HumanIndexReadNML -M models/lnd/clm/src/main/clm_driver.F90 -------- Pass humanindex_vars down as needed - ---------- Change for new shr_cal_mod names -M models/lnd/clm/src/ED/biogeophys/EDPhenologyMod.F90 - Use full name of month - "january" instead of "jan" - ---------- Add new building temperature module and add capability to do old clm4_5 ---------- method as well as new method, also do human_stress_indices calculations -MM models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 --- Add BuildingHAC for - simple building temp method (should move to it's own module) add if - statements for building_temp_method type, call BuildingTemperature - when prognostic method used -M models/lnd/clm/src/biogeophys/SoilFluxesMod.F90 -------- Change name of - eflx_building_heat to eflx_building_heat_errsoi -M models/lnd/clm/src/biogeophys/TemperatureType.F90 ------ Add building - temperature variables (should move to urbBuildTemp module), pass building_temp - method logical down for initialization, add documentation headers - hist, cold, and restart init depends on building temp method logical -M models/lnd/clm/src/biogeophys/LakeFluxesMod.F90 -------- calc_human_stress_indices - (should move to method in humanIndexMod) -MM models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 -- calc_human_stress_indices - (should move to method in humanIndexMod) -MM models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 ------ calc_human_stress_indices - (should move to method in humanIndexMod) -M models/lnd/clm/src/biogeophys/EnergyFluxType.F90 ---- change name of eflx_building_heat_col - to eflx_building_heat_errsoi_col, add some new building temperature flux terms - add documentation, alloc, hist, restart and cold initialization depends on - building temperature method type (should move to urban building module) -M models/lnd/clm/src/biogeophys/UrbanFluxesMod.F90 ---- Add private functions: - wasteheat, simple_wasteheatfromac, calc_simple_internal_building_temp - (should move to building_temp modules). - calc_human_stress_indices (should move to method in humanIndexMod) -M models/lnd/clm/src/biogeophys/UrbanParamsType.F90 --- Add methods: UrbanReadNML, - IsSimpleBuildTemp, IsProgBuildTemp, add clmu_inparm namelist, and move urban_* items - there and add building_temp_method to it. - -CLM testing: - - build-namelist tests: - - yellowstone yes - - unit-tests (models/lnd/clm/src): - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - - short tests (aux_clm_short): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - - tools testing: - - yellowstone interactive yes - PTCLM (models/lnd/clm/tools/shared/PTCLM/test) yellowstone yes - -CLM tag used for the baseline comparisons: clm4_5_1_r088 - -Changes answers relative to baseline: No for CLM40 and CLM45 - But, answers DO change for CLM50 - (except scripts tag update changes history files for IG and irrigation compsets/tests) - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r088 -Originator(s): muszala (Stefan Muszala) -Date: Wed Oct 1 09:24:43 MDT 2014 -One-line Summary: Pull out ED deps. in TemperatureTypeMod, can now compile with pgi 14.7 - -Purpose of changes: Pull out the dependency on EDBioType in TemperatureType.F90. The ED -variables related to phenology now reside in EDPhenologyMod.F90. This refactor also had -the effect of getting past a PGI 14.7 ICE which looks like it was due to the use of EDbio_vars -in TemperatureType.F90. When I pulled out lines 1227 and 1226 of biogeophys/TemperatureType.F90 -(in clm4_5_1_r087) and passed the two EDbio_vars variables through the argument list the ICE -went away. - -This tag breaks ED restart tests. We went ahead with the tag because we had to fix a more -general problem with the CESM and CAM builds and PGI 14.7. the ED v0.1.0 branch does not -have these modifications and may be used as an alternative. A new clm tag will shortly -follow that addresses any remaining problems. - -Requirements for tag: None - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - -Temporary addition of a cal parameter type in a branch tag. Will be merged into csm_share trunk shortly. - --models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_140723 -+models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/branch_tags/share_ece_tags/share_ece_01_140723 - -List all files eliminated: N/A - -List all files added and what they do: - -! new home for ED phenology variables and type-bound procedures that -! allow for accumulation of buffers -A + models/lnd/clm/src/ED/biogeophys/EDPhenologyMod.F90 -! put some CMakeLists.txt in place for ED unittests -A + models/lnd/clm/src/ED/main/CMakeLists.txt -A + models/lnd/clm/src/ED/biogeophys/CMakeLists.txt -A + models/lnd/clm/src/ED/CMakeLists.txt - -List all existing files that have been modified, and describe the changes: - -! pull out deps. on EDBioType -M models/lnd/clm/src/biogeophys/TemperatureType.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/main/clm_initializeMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/main/restFileMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/main/clm_driver.F90 - -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/biogeochem/EDPhysiologyMod.F90 -! pull out ED_GDD_patch and phen_cd_status_patch -M models/lnd/clm/src/ED/main/EDBioType.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/biogeochem/EDPhysiologyMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/main/EDMainMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/main/EDCLMLinkMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/main/EDRestVectorMod.F90 -! add code for new class instance, EDphenology_inst -M models/lnd/clm/src/ED/main/EDInitMod.F90 - -! for ED unit tests -M models/lnd/clm/src/CMakeLists.txt - -! update CNED failures -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - -ERS CNED tests are failing in this tag. It is expected. expectedClmTestFails.xml is updated to reflect this. - - build-namelist tests: N/A - - yellowstone - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel 40-OK, 45-OK - yellowstone_pgi 40-OK, 45-OK - goldbach_nag 40-OK, 45-OK - goldbach_intel 40-OK, 45-OK - -CLM tag used for the baseline comparisons: clm4_5_1_r087 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r087 -Originator(s): erik (Erik) -Date: Tue Sep 30 12:07:10 MDT 2014 -One-line Summary: Fix two balance check errors, and turn abort for balance check back on to appropriate levels - -Purpose of changes: - -Fix two balance check errors that were causing problems for simulations. Also some of the balance check aborts -were turned off in clm4_5_1_r082, so turn them back on again. Tighten water balance error from 1.e-4 to 1.e-5. -Tighten LW, surface-flux and solar radiation balance errors from 1.e-3 to 1.e-5 and add warning for 1.e-7. -Turn surface-flux balance and soil balance check errors abort back on. Soil balance tightened to 1.e-4 (from 1.e-3) -with warnings shown at 1.e-6. - -Also bring in an update to PTCLM, and allow tools tester to be submitted to geyser or caldera. Just as an aside -as something that was already done. - -Requirements for tag: Fix bugs: 2026 and 1941 - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 2026 Soil balance error - 1941 snowdp balance error - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, swensosc - -List any svn externals directories updated (csm_share, mct, etc.): Update PTCLMmkdata version - - Update PTCLM to PTCLM2_140816 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/test/tools/test_driver.sh ------ Allow to run in caldera and geyser as well - -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 ---- Add aborts back as well as warnings - and tighten some error conditions and warnings. -M models/lnd/clm/src/biogeophys/SoilTemperatureMod.F90 - Remove calculation and use of the - heat capacity of frozen h2osfc layer but use the heat capacity of the liquid layer - as balance check doesn't know about the frozen, and the discrepency causes balance - check errors. -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 --- snow includes dew. - -CLM testing: - - build-namelist tests: - - yellowstone YES - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel YES - yellowstone_pgi YES - yellowstone_gnu (optional) YES - goldbach_nag YES - goldbach_intel YES - -CLM tag used for the baseline comparisons: clm4_5_1_r086 - -Changes answers relative to baseline: YES! - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 - - what platforms/compilers: ALL - - nature of change: same climate (some shorter simulations are still exact) - -Simulations that Keith ran to test the snowdp change are: - -/glade/p/work/oleson/urb2dev_n00_clm4_5_52/scripts/urb2dev_n03_clm4_5_64_V2DomLam_I20TRCRUCLM45 - -/glade/p/work/oleson/urb2dev_n00_clm4_5_52/scripts/urb2dev_n03_clm4_5_64_V2DomLam_IRCP85CRUCLM45 - - URL for LMWG diagnostics output used to validate new climate: - - For soil balance error... - -http://www.cgd.ucar.edu/staff/swensosc/public/diagnostics/ColdtestTRENDYspinupf091850CRU-ColdtestTRENDYspinupf091850CRU_control/setsIndex.html - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r086 -Originator(s): muszala (Stefan Muszala) -Date: Thu Sep 25 09:04:08 MDT 2014 -One-line Summary: critical ED modifications from r fisher, fix bug 2043 - -Purpose of changes: add modifications to ED, particularly for cold deciduous. add - fix for bug 2043. Consider these ED baselines as fixed (ie. - unless you are modifying ED science, these should now be BFB). - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 2043 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, r fisher - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/main/lnd2atmMod.F90 --- change intent of waterstate_vars to inout (fixes bug 2043) - -M models/lnd/clm/src/main/clm_driver.F90 --- add EDbio_vars to edmodel actual argument list - -M models/lnd/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 --- change leaves_off_switch and laimemory handling - -M models/lnd/clm/src/ED/biogeochem/EDPhysiologyMod.F90 --- rework cold deciduous and threshold code. add fragmentation_scaler routine - -M models/lnd/clm/src/ED/main/EDMainMod.F90 --- change argument lists to include EDbio_vars for ecosystem_dynamics and phenology - -M models/lnd/clm/src/ED/biogeophys/EDSurfaceAlbedoMod.F90 --- overhaul ED norman radiation code - -M models/lnd/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 --- tweak calculation of jmax25top and tpu25top - -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 --- clean up two comments - -CLM testing: - - ED compsets change values. - - For bug 2043. Confirmed that a gnu compile on yellowstone gets passed the intent problem. - - build-namelist tests: N/A - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 40 OK - 45 OK - yellowstone_pgi - 40 OK - 45 OK - goldbach_nag - 40 OK - 45 OK - goldbach_intel - 40 OK - 45 OK - -CLM tag used for the baseline comparisons: clm4_5_1_r085 - -Changes answers relative to baseline: Only for ED compsets - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r085 -Originator(s): sacks (Bill Sacks) -Date: Fri Sep 19 10:22:30 MDT 2014 -One-line Summary: replace conditionals with polymorphism for soil water retention curve - -Purpose of changes: - -The main motivation for this tag was the need to introduce a -soil_suction_inverse routine, which will be used for irrigation. It is important -that soil_suction_inverse remains consistent with soil_suction for every soil -water retention curve method. In talking with Ben Andre and Erik, we felt the -best way to ensure this consistency was to have a separate, small module for -each soil retention curve method. We felt the best way to implement this was via -polymorphism. Polymorphism is arguably overkill in this simple case, but we -thought it would be good to convert it to polymorphism partly as an example that -we and others can follow in more complex cases where it will provide greater -benefit. - -To add a new soil retention curve method: - - (1) Create a module similar to - SoilWaterRetentionCurveClappHornberg1978Mod.F90 - - (2) Modify the select case statement in SoilWaterRetentionCurveFactoryMod.F90 - so that it is able to create an instance of your new type - -Note that this refactor also combines the soil_suction and soil_hk -parameterization options into a single option. Dave Lawrence and Rosie Fisher -felt that was preferable, and Jinyun Tang was okay with this. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: andre, muszala, Jinyun Tang - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - -========= Replaced with the 3 new files noted below -D models/lnd/clm/src/biogeophys/SoiWatRetCurveParMod.F90 - -List all files added and what they do: - -========= Replacement for SoiWatRetCurveParMod, implemented using - polymorphism. Note that I have also added a soil_suction_inverse - routine, which is not yet used or tested. I'll be using (and testing) - this in an upcoming tag, where I refactor the irrigation code to use this. -A models/lnd/clm/src/biogeophys/SoilWaterRetentionCurveMod.F90 -A models/lnd/clm/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 -A models/lnd/clm/src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Minor changes to accommodate the refactored code -M models/lnd/clm/src/main/clm_initializeMod.F90 -M models/lnd/clm/src/main/init_hydrology.F90 -M models/lnd/clm/src/main/clm_driver.F90 -M models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/biogeophys/SoilWaterMovementMod.F90 -M models/lnd/clm/src/biogeophys/SoilMoistStressMod.F90 -M models/lnd/clm/src/biogeophys/HydrologyNoDrainageMod.F90 - - -CLM testing: - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu: NOT RUN - goldbach_nag: ok - goldbach_intel: ok - -CLM tag used for the baseline comparisons: clm4_5_1_r084 - -Changes answers relative to baseline: NO - bfb - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r084 -Originator(s): sacks (Bill Sacks) -Date: Thu Sep 18 14:39:44 MDT 2014 -One-line Summary: make glc_dyn_runoff_routing spatially-varying, based on input from glc - -Purpose of changes: - -Dave Lawrence, Bill Lipscomb and Jeremy Fyke have pointed out that -glc_dyn_runoff_routing needs to be spatially-varying: Even when we're coupling -to CISM, we should continue to use the old scheme in regions that don't have an -active icesheet model underneath (which currently includes Antarctica and all of -the world's smaller glaciers - i.e., everything except Greenland). Furthermore, -we have introduced a new ability into CISM to run in diagnostic mode, without -sending calving/runoff fluxes to the coupler. In this case, too, CLM should -revert to using the old scheme (glc_dyn_runoff_routing = .false.). - -To accomplish both of these things, I have introduced a new coupling field, -through which GLC tells CLM which areas have an icesheet that is "active" in the -sense of sending fluxes to the coupler. In this CLM tag, CLM sets a -spatially-varying version of glc_dyn_runoff_routing based on this new coupler -field - replacing the old, namelist-settable version of this flag. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: - - - removed glc_dyn_runoff_routing - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - drv: drvseq5_0_15 -> drvseq5_0_17 - - fix for some multi-instance runs - - add icemask_coupled_fluxes field - - cism: cism1_140602 -> cism1_140914 - - Add zero_gcm_fluxes option; send icemask_coupled_fluxes field to coupler - - scripts: scripts4_140916b -> scripts4_140916c - - Rename CLM_UPDATE_GLC_AREAS to GLC_TWO_WAY_COUPLING - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Rename CLM_UPDATE_GLC_AREAS xml variable to GLC_TWO_WAY_COUPLING. - Remove glc_dyn_runoff_routing namelist variable (this is now a - spatially-varying field, tied more tightly to CISM). -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/CLMBuildNamelist.pm -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/user_nl_clm -M models/lnd/clm/bld/env_run.xml - -========= Receive icemask_coupled_fluxes from CISM -M models/lnd/clm/src/cpl/lnd_import_export.F90 -M models/lnd/clm/src/cpl/clm_cpl_indices.F90 - -========= Set spatially-varying glc_dyn_runoff_routing field based on - icemask_coupled_fluxes, and use this in place of the old scalar - glc_dyn_runoff_routing flag -M models/lnd/clm/src/main/glc2lndMod.F90 -M models/lnd/clm/src/main/clm_driver.F90 -M models/lnd/clm/src/main/clm_varctl.F90 -M models/lnd/clm/src/main/controlMod.F90 -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/biogeophys/HydrologyDrainageMod.F90 -M models/lnd/clm/src/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Add write statement to workaround a pgi compiler problem -M models/lnd/clm/src/main/restFileMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: ok (baseline comparisons fail for clm45 & clm50, as expected) - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - yellowstone_gnu: NOT RUN - goldbach_nag: ok - goldbach_intel: ok - - Note: Most testing was run on glc_runoff_routing_n06_clm4_5_1_r083. After - that tag, I added the following write statement in restFileMod, as a - workaround for a PGI compiler bug: - - write(iulog,*) 'about to call aerosol_vars%restart: ', ubound(waterstate_vars%h2osoi_ice_col) - - After that addition, I just reran a subset of tests: 6 yellowstone-intel - tests, 10 yellowstone-pgi tests (including the 2 that had failed due to the - compiler bug), and 5 goldbach-nag tests. - -NOTE: Unit test build is currently failing due to a change in r082. Stefan is -working on a fix. - -CLM tag used for the baseline comparisons: clm4_5_1_r083 - -Changes answers relative to baseline: YES - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 with CISM (i.e., IG) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - (1) Large changes in runoff from glaciers in IG compsets, due to setting - glc_dyn_runoff_routing to .false. outside of Greenland. - - (2) Roundoff-level changes in icemask for some resolutions and compilers, - due to changes in the cism external. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? For icemask changes: examined cprnc RMS errors. For other - changes, diffs are greater than roundoff. - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r083 -Originator(s): muszala (Stefan Muszala) -Date: Wed Sep 17 09:21:31 MDT 2014 -One-line Summary: only update scripts and run new baselines. this due to an error in yellowstone pgi test naming (clm_aux45 changed to aux_clm45) - -Purpose of changes: Update scripts due to an error in a previous scripts tag in which I named pgi tests as clm_aux45 instead -of aux_clm45. These were for tests moved from goldbach to yellowstone. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts4_140910 -> scripts4_140916b - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: N/A - -- update test list failures -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - WJS: note: Stef told me that he actually ran all the yellowstone tests, and - all were okay - - yellowstone_intel - 40 OK - yellowstone_pgi - - goldbach_nag - 40 OK, 45 OK - goldbach_intel - 40 OK, 45 OK - -Note 1: Due to the fact that in older baselines component_gen_comp was failing due to a scripts error (now fixed) -some older baselines don't have the clm history files. As one example: - - BFAIL ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.compare_hist.clm4_5_1_r082 - - rerun. compare against clm4_5_1_r081, then it passes. - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.memleak - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.compare_hist.clm4_5_1_r082_oldPgi - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.memcomp.clm4_5_1_r082_oldPgi - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.tputcomp.clm4_5_1_r082_oldPgi - PASS ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput.C.140917-082253.nlcomp - - For these tests, I made sure that clm2 history files were in the clm4_5_1_r083 baseline dirs. They - should pass going forward. - - ERI_D.f10_f10.ICRUCLM50BGC.goldbach_intel.clm-reduceOutput - PEM.f10_f10.ICLM45BGCCROP.goldbach_intel.clm-crop - SSP.f19_g16.I1850CLM45BGC.yellowstone_pgi.clm-default - -Note 2: For these N2 tests, there was a scripts problem with st_archiver in the previous tag. These should pass next time. - BFAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.compare_hist.clm4_5_1_r082 - BFAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.compare_hist.clm4_5_1_r082 - BFAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.clm2.h0.compare_hist.clm4_5_1_r082 - BFAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.clm2.h1.compare_hist.clm4_5_1_r082 - -CLM tag used for the baseline comparisons: clm4_5_1_r082 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r082 -Originator(s): muszala (Stefan Muszala) -Date: Thu Sep 11 14:07:58 MDT 2014 -One-line Summary: Merge in a number of ED changes to address science bugs and infrastructure (particularly restarts) - -Purpose of changes: Merge in ED changes. Most of these have to do with science changes from rfisher. There -is also a refactor and added functionality for ED restarts. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): Bug 2041, 2042 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, rfisher - -List any svn externals directories updated (csm_share, mct, etc.): - scripts4_140814a -> scripts4_140910 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml --- add failing N2 tests (due to scripts, see below). - -M models/lnd/clm/bld/build-namelist --- documentation at top of file should reference CLMBuildNamelist.pm - -M models/lnd/clm/src/main/clm_driver.F90 --- add call to SurfaceAlbedo for use_ed logical branch, add EDBioVars as --- argument to temperature_vars%UpdateAccVars and add canopystate_vars as --- argument to BalanceCheck (for ED) -M models/lnd/clm/src/main/decompMod.F90 --- added openMP output...remove mods after getting ED working with openMP - -M models/lnd/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 --- change handling of CWD_AG and CWD_BG -M models/lnd/clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90 --- added tree_sai function -M models/lnd/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 --- signifcant reworking of entire module -M models/lnd/clm/src/ED/biogeochem/EDPhysiologyMod.F90 --- minor code clean up -M models/lnd/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 --- change an error check to: if (( areatot - area ) > 0._r8 ) then - -M models/lnd/clm/src/ED/main/EDBioType.F90 --- add infrastrucutre (define, allocate, etc...) -M models/lnd/clm/src/ED/main/EDMainMod.F90 --- major update for updating canopy biomass pools -M models/lnd/clm/src/ED/main/EDCLMLinkMod.F90 --- modify calls for history file output and error checking -M models/lnd/clm/src/ED/main/EDRestVectorMod.F90 --- add resp_clm as restart variable and use SHR_ASSERT instead of call assert. major refactor --- of createPatchCohortStructure to handle arbitrary number of cohorts and patches -M models/lnd/clm/src/ED/main/EDInitMod.F90 --- add logical to deal with different values of assignemnt dc%laimemory -M models/lnd/clm/src/ED/main/EDTypesMod.F90 --- add cohort_type and change paramters: numCohortsPerPatch, cohorts_per_gcell and fire_threshold - -M models/lnd/clm/src/ED/fire/SFMainMod.F90 --- clean up write statemnts and a bug fix: change tau_b(dg_sf) -> tau_b(c) - -M models/lnd/clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 --- change tpu25top(FT) = 0.06_r8 * jmax25top(FT) to tpu25top(FT) = 0.167_r8 * jmax25top(FT), some cleanup - -M models/lnd/clm/src/biogeophys/SnowHydrologyMod.F90 --- clean up a use statement -M models/lnd/clm/src/biogeophys/BareGroundFluxesMod.F90 --- remove whitespaces after a statement -M models/lnd/clm/src/biogeophys/SurfaceAlbedoMod.F90 --- add a use_ed block to prevent some unassigned pointer errors -M models/lnd/clm/src/biogeophys/BalanceCheckMod.F90 --- add canopystate_vars as argument for elai and esai for more verbose error --- reporting added by rfisher -M models/lnd/clm/src/biogeophys/TemperatureType.F90 --- add arg. for UpdateAccVars for new calculations, split out use_ed and use_crop -M models/lnd/clm/src/biogeophys/SurfaceRadiationMod.F90 --- add associate statement to tlai for error reporting - -M UpDateChangeLog.pl --- fix tiny typo - -M SVN_EXTERNAL_DIRECTORIES --- for scripts update - -CLM testing: - - build-namelist tests: - - yellowstone - N/A, no namelist changes made in this tag - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 45 OK , 40 OK - - Changes due to update of scripts from scripts4_140814a -> scripts4_140910 (this change came with scripts4_140828) - FAIL namelist compare: user_nl_clm differs - These should pass next time. - - NEW: flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/surfdata.pftdyn_1x1_tropicAtl_TEST_simyr1939-1943_c140108.nc' - BASELINE: flanduse_timeseries = '/glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/surfdata.pftdyn_1x1_tropicAtl_TEST_simyr1939-1943_c140108.nc' - - FAIL SMS_Ly3.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetLate.GC.newPgi_45_intel.nlcomp - FAIL SMS_Ly5.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetMid.GC.newPgi_45_intel.nlcomp - FAIL SMS_Ly8.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetEarly.GC.newPgi_45_intel.nlcomp - - These fail due to a bug in scripts4_140905c. Alice is aware of this and will provide a fix for a future CLM tag (but 2041): - FAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel - FAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default - - Failure that looks like a hardware problem and that Erik is looking into (bug 2042): - RUN ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.GC.newPgi_45_intel - - yellowstone_pgi - 45 OK , 40 OK - - New PGI tests brought over from goldbach. These are expected as there are no baselines for this on yellowstone - - BFAIL ERI_D.f10_f10.ICLM45BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI_D.f10_f10.ICRUCLM50BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI_D.f19_g16.ICLM45BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI_D.f19_g16.ICLM45.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI_D.f19_g16.ICRUCLM50BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI.f10_f10.ICLM45BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI.f10_f10.ICRUCLM50BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI.f19_g16.ICLM45BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERI.f19_g16.ICRUCLM50BGC.yellowstone_pgi.clm-reduceOutput.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.I20TRCLM45BGC.yellowstone_pgi.clm-decStart.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.I20TRCLM45BGC.yellowstone_pgi.clm-decStart.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.I20TRCLM45BGC.yellowstone_pgi.clm-decStart.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_pgi.clm-ciso.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_pgi.clm-ciso.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_pgi.clm-ciso.compare_hist.clm4_5_1_r081 - BFAIL ERS.f10_f10.I1850CLM45BGC.yellowstone_pgi.clm-default.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL ERS.f10_f10.I1850CLM45BGC.yellowstone_pgi.clm-default.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL ERS.f10_f10.I1850CLM45BGC.yellowstone_pgi.clm-default.compare_hist.clm4_5_1_r081 - BFAIL ERS_Lm3.1x1_smallvilleIA.ICLM45BGCCROP.yellowstone_pgi.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL ERS_Lm3.1x1_smallvilleIA.ICLM45BGCCROP.yellowstone_pgi.compare_hist.clm4_5_1_r081 - BFAIL SMS_D.1x1_vancouverCAN.ICLM45.yellowstone_pgi.clm-default.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL SMS_D.1x1_vancouverCAN.ICLM45.yellowstone_pgi.clm-default.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL SMS_D.1x1_vancouverCAN.ICLM45.yellowstone_pgi.clm-default.compare_hist.clm4_5_1_r081 - BFAIL SMS.f45_f45.ICLM45.yellowstone_pgi.clm-ptsRLB.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL SMS.f45_f45.ICLM45.yellowstone_pgi.clm-ptsRLB.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL SMS.f45_f45.ICLM45.yellowstone_pgi.clm-ptsRLB.compare_hist.clm4_5_1_r081 - BFAIL SMS.f45_f45.ICLM45.yellowstone_pgi.clm-ptsROA.compare_hist.clm4_5_1_r081 - BFAIL SMS_Ld5.f19_g16.IRCP45CLM45BGC.yellowstone_pgi.clm-decStart.clm2.h0.compare_hist.clm4_5_1_r081 - BFAIL SMS_Ld5.f19_g16.IRCP45CLM45BGC.yellowstone_pgi.clm-decStart.clm2.h1.compare_hist.clm4_5_1_r081 - BFAIL SMS_Ld5.f19_g16.IRCP45CLM45BGC.yellowstone_pgi.clm-decStart.compare_hist.clm4_5_1_r081 - - goldbach_nag - 45 OK , 40 OK - - Baseline missing from previous tag: - ERI_D.f19_g16.ICLM45BGC.goldbach_nag.clm-reduceOutput- - file /fs/cgd/csm/ccsm_baselines/clm4_5_1_r081/ERI_D.f19_g16.ICLM45BGC.goldbach_nag.clm-reduceOutput/cpl.hi.nc does not exis - SMS.f09_g16.ICRUCLM45.goldbach_nag.clm-af_bias_v5 - file /fs/cgd/csm/ccsm_baselines/clm4_5_1_r081/SMS.f09_g16.ICRUCLM45.goldbach_nag.clm-af_bias_v5/cpl.hi.nc does not exist - SMS_Ly1.f19_g16.ICLM45BGCCROP.goldbach_nag.clm-reduceOutput - file /fs/cgd/csm/ccsm_baselines/clm4_5_1_r081/SMS_Ly1.f19_g16.ICLM45BGCCROP.goldbach_nag.clm-reduceOutput/cpl.hi.nc does no - SMS_Ly1.f19_g16.ICLM45BGCCROP.goldbach_nag.clm-reduceOutput - file /fs/cgd/csm/ccsm_baselines/clm4_5_1_r081/SMS_Ly1.f19_g16.ICLM45BGCCROP.goldbach_nag.clm-reduceOutput/cpl.hi.nc does no t exist - - goldbach_intel - 45 OK , 40 OK - - goldbach_pgi (These have been moved to yellowstone due to PGI 14.1 throwing and ICE on goldbach) - -CLM tag used for the baseline comparisons: clm4_5_1_r081 - -Changes answers relative to baseline: Only for ED compsets - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r081 -Originator(s): mvertens (Mariana Vertenstein) -Date: Sun Aug 24 19:39:50 MDT 2014 -One-line Summary: major infrastructure changes and directory reorganization under src - -Purpose of changes: - - Overview of previous code design - ========================================== - - data structures arranged by subgrid type (pps, cps, lps, grc) - - all functional categorization lumped in that one subgrid type which led to - - centralization rather than modularization of all data - - definition and instantiation in ONE big module (clmtype.F90) - - allocation and initialization in ONE big module (clmtypeInitMod.F90) - - history variables all in ONE big module (histFldsMod.F90) - - restart variables in effectively TWO big modules (biogeophysicsRestMod.F90 and CNRestMod.F90) - - time constant initialization in ONE complex module (initTimeConst.F90) - - time varying cold start initialization in ONE module (initColdMod.F90) - - accumulation variables in ONE module (accumulMod.F90) - - Overview of new code design - ========================================== - data structures arranged by scientific functional categories - (e.g. temperature_type, waterstate_type, energyflux_type, etc) - - a given data structure now contains ALL subgrid levels are in the data structure - - and variables in the data structure are now appended with a unique suffix to - indicate their subgrid levels (new suffixes: _patch, _col, _lun, _grc) - - this does NOT effect the science code base, ONLY the associate statements - - there are separate module for each data type definition - (e.g. TemperatureType.F90, WaterstateType.F90, EnergyFluxType.F90, etc) - - each data type has associated methods for - - Allocation: - variables now initialized as NaNs upon allocation - - Cold Start Initialization: - cold start initialization of variables is now ALWAYS done - and overwritten if finidat is read in as spun up dataset (also now - have on line interpolation of initial conditions as part of this refactor as well) - - History initialization of variables - All history fields now initialized as spval - - Restart initialization of variables - - Accumulation Initialization - initialization and accumulation update of variables - - Instantiation of datatypes is now separate from their declaration - (for now in clm_initialize.F90 - will be moved in the future) - - Centralized routines that no longer exist: - ========================================== - Data types : clmtype.F90, clmtypeInitMod.F90 - Initialization : initTimeConst.F90, initCold.F90 - History : histFldsMod.F90 - Accumulation : accumulMod.F90 - Restart : biogeophysRestMod.F90, CNRestMod.F90 - Biogeochemistry: CNSetValue.F90 - - New Type modules that now replace clmtype.F90 - ========================================== - main/atm2lndType.F90 - main/lnd2atmType.F90 - main/ColumnType.F90 - main/EcophysConType.F90 - main/GridcellType.F90 - main/LandunitType.F90 - main/PatchType.F90 - - biogeochem/CNCarbonFluxType.F90 - biogeochem/CNCarbonStateType.F90 - biogeochem/CNDecompCascadeConType.F90 - biogeochem/CNDVType.F90 - biogeochem/CNNitrogenFluxType.F90 - biogeochem/CNNitrogenStateType.F90 - biogeochem/CNStateType.F90 - biogeochem/CropType.F90 - - biogeophys/AerosolType.F90 - biogeophys/CanopyStateType.F90 - biogeophys/EnergyFluxType.F90 - biogeophys/FrictionVelocityType.F90 - biogeophys/LakeStateType.F90 - biogeophys/PhotosynthesisType.F90 - biogeophys/SoilHydrologyType.F90 - biogeophys/SoilStateType.F90 - biogeophys/SolarAbsorbedType.F90 - biogeophys/SurfaceAlbedoType.F90 - biogeophys/TemperatureType.F90 - biogeophys/UrbanParamsType.F90 - biogeophys/WaterfluxType.F90 - biogeophys/WaterStateType.F90 - - ED/main/EDBioType.F90 - ED/main/EDEcophysConType.F90 - ED/main/EDVecCohortType.F90 - ED/main/EDVecPatchType.F90 - - - Instantiation of Types - -2) Public Types: - - - the following are public types that can BE PASSED AS ARGUMENTS - - the type instances FOR NOW are clm_initialized and then used by the driver - - this will be generalized in the future - - type(ch4_type) :: ch4_vars - type(carbonstate_type) :: carbonstate_vars - type(carbonstate_type) :: c13_carbonstate_vars - type(carbonstate_type) :: c14_carbonstate_vars - type(carbonflux_type) :: carbonflux_vars - type(carbonflux_type) :: c13_carbonflux_vars - type(carbonflux_type) :: c14_carbonflux_vars - type(nitrogenstate_type) :: nitrogenstate_vars - type(nitrogenflux_type) :: nitrogenflux_vars - type(dgvs_type) :: dgvs_vars - type(crop_type) :: crop_vars - type(cnstate_type) :: cnstate_vars - type(dust_type) :: dust_vars - type(vocemis_type) :: vocemis_vars - type(drydepvel_type) :: drydepvel_vars - type(aerosol_type) :: aerosol_vars - type(canopystate_type) :: canopystate_vars - type(energyflux_type) :: energyflux_vars - type(frictionvel_type) :: frictionvel_vars - type(lakestate_type) :: lakestate_vars - type(photosyns_type) :: photosyns_vars - type(soilstate_type) :: soilstate_vars - type(soilhydrology_type) :: soilhydrology_vars - type(solarabs_type) :: solarabs_vars - type(surfalb_type) :: surfalb_vars - type(surfrad_type) :: surfrad_vars - type(temperature_type) :: temperature_vars - type(urbanparams_type) :: urbanparams_vars - type(waterflux_type) :: waterflux_vars - type(waterstate_type) :: waterstate_vars - type(atm2lnd_type) :: atm2lnd_vars - type(glc2lnd_type) :: glc2lnd_vars - type(lnd2atm_type) :: lnd2atm_vars - type(lnd2glc_type) :: lnd2glc_vars - type(glc_diagnostics_type) :: glc_diagnostics_vars - type(EDbio_type) :: EDbio_vars - - - private Types (now som modules have their own PRIVATE types) - - DUSTMod.F90 : type(dust_type) - VOCEmissionMod.F90: type(vocemis_type) - ch4Mod.F90 : type(ch4_type) - - API Changes: - ========================================== - Original APIs: - clmtype was in effect a global common block and all routines had use statements into it - difficult to track any intent or flow through system - difficult to set up functional unit testing (.e.g. CanopyFluxesMod.F90, etc) - - Refactorized APIs: - all new datatype instances are passed as arguments - science code is effectively the same since only the associate statements have been modified - - New Directory Structure under clm/ - ========================================== - bld/ - doc/ - src/biogeochem/ - src/biogeophys/ - src/cpl/ - src/dyn_subgrid/ - src/ED/ - src/ED/biogeochem - src/ED/biogeophys - src/ED/fire - src/ED/main - src/main/ - src/unit_test_mocks/ - src/unit_test_shr/ - src/utils/ - src_clm4_0/ - test/ - tools/ - - Advantages of refactorization: - ========================================== - - Lets compiler enforce intent attributes - - Makes functional unit testing easier since module drivers can be - constructed with relevant mock data more easily - - Makes more sense scientifically since now easier to extend code logic as - to where you want to introduce new variables - - Easier to maintain code since code flow is easier to follow and to modify - - Easy to move variables around from one data type to another since now - know everything that is logically connected to that variable that - needs to be moved Offers new modularity for trading in and out new - formulations of targeted functionality - -Requirements for tag: N.A. - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N.A. - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - directory restructuring has been reflected in changes to configure in setting up the Filepath - -Describe any changes made to the namelist: - clm_hydrology1_inparm changed to clm_canopyhydrology_inparm - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: myself, Bill Sacks - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - -D clm/src/clm4_5 -D clm/src/clm4_5/biogeochem -D clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -D clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -D clm/src/clm4_5/biogeochem/CNRestMod.F90 -D clm/src/clm4_5/biogeochem/CropRestMod.F90 -D clm/src/clm4_5/biogeochem/CNGRespMod.F90 -D clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -D clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -D clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -D clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -D clm/src/clm4_5/biogeochem/CNFireMod.F90 -D clm/src/clm4_5/biogeochem/CNMRespMod.F90 -D clm/src/clm4_5/biogeochem/MEGANFactorsMod.F90 -D clm/src/clm4_5/biogeochem/SatellitePhenologyMod.F90 -D clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -D clm/src/clm4_5/biogeochem/ch4RestMod.F90 -D clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -D clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -D clm/src/clm4_5/biogeochem/CNWoodProductsMod.F90 -D clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -D clm/src/clm4_5/biogeochem/ch4Mod.F90 -D clm/src/clm4_5/biogeochem/DUSTMod.F90 -D clm/src/clm4_5/biogeochem/CNDVLightMod.F90 -D clm/src/clm4_5/biogeochem/CNInitMod.F90 -D clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -D clm/src/clm4_5/biogeochem/ch4varcon.F90 -D clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -D clm/src/clm4_5/biogeochem/CNDecompMod.F90 -D clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -D clm/src/clm4_5/biogeochem/CNDVMod.F90 -D clm/src/clm4_5/biogeochem/ED -D clm/src/clm4_5/biogeochem/ED/EDCanopyStructureMod.F90 -D clm/src/clm4_5/biogeochem/ED/EDSetValuesMod.F90 -D clm/src/clm4_5/biogeochem/ED/EDGrowthFunctionsMod.F90 -D clm/src/clm4_5/biogeochem/ED/EDPhysiologyMod.F90 -D clm/src/clm4_5/biogeochem/ED/EDCohortDynamicsMod.F90 -D clm/src/clm4_5/biogeochem/ED/EDPatchDynamicsMod.F90 -D clm/src/clm4_5/biogeochem/CNSharedParamsMod.F90 -D clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -D clm/src/clm4_5/biogeochem/ch4InitMod.F90 -D clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -D clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 -D clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -D clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -D clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -D clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -D clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -D clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -D clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -D clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 -D clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -D clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -D clm/src/clm4_5/biogeochem/CNDVInitMod.F90 -D clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 - -D clm/src/clm4_5/main -D clm/src/clm4_5/main/clm_varcon.F90 -D clm/src/clm4_5/main/initInterp.F90 -D clm/src/clm4_5/main/clm_varpar.F90 -D clm/src/clm4_5/main/landunit_varcon.F90 -D clm/src/clm4_5/main/initTimeConstMod.F90 -D clm/src/clm4_5/main/subgridWeightsMod.F90 -D clm/src/clm4_5/main/decompInitMod.F90 -D clm/src/clm4_5/main/clm_initializeMod.F90 -D clm/src/clm4_5/main/subgridRestMod.F90 -D clm/src/clm4_5/main/clm_glclnd.F90 -D clm/src/clm4_5/main/paramUtilMod.F90 -D clm/src/clm4_5/main/accFldsMod.F90 -D clm/src/clm4_5/main/subgridMod.F90 -D clm/src/clm4_5/main/clmtypeInitMod.F90 -D clm/src/clm4_5/main/ndepStreamMod.F90 -D clm/src/clm4_5/main/init_hydrology.F90 -D clm/src/clm4_5/main/initColdMod.F90 -D clm/src/clm4_5/main/column_varcon.F90 -D clm/src/clm4_5/main/histFileMod.F90 -D clm/src/clm4_5/main/pft2colMod.F90 -D clm/src/clm4_5/main/clm_atmlnd.F90 -D clm/src/clm4_5/main/findHistFields.pl -D clm/src/clm4_5/main/clm_varsur.F90 -D clm/src/clm4_5/main/restFileMod.F90 -D clm/src/clm4_5/main/CMakeLists.txt -D clm/src/clm4_5/main/controlMod.F90 -D clm/src/clm4_5/main/spitfireSF -D clm/src/clm4_5/main/spitfireSF/SFParamsMod.F90 -D clm/src/clm4_5/main/spitfireSF/SFMainMod.F90 -D clm/src/clm4_5/main/test -D clm/src/clm4_5/main/test/subgridWeights_test -D clm/src/clm4_5/main/test/subgridWeights_test/test_subgridWeights.pf -D clm/src/clm4_5/main/test/subgridWeights_test/CMakeLists.txt -D clm/src/clm4_5/main/test/clm_glclnd_test -D clm/src/clm4_5/main/test/clm_glclnd_test/test_clm_glclnd.pf -D clm/src/clm4_5/main/test/clm_glclnd_test/CMakeLists.txt -D clm/src/clm4_5/main/test/CMakeLists.txt -D clm/src/clm4_5/main/initSubgridMod.F90 -D clm/src/clm4_5/main/filterMod.F90 -D clm/src/clm4_5/main/clm_varctl.F90 -D clm/src/clm4_5/main/clm_driver.F90 -D clm/src/clm4_5/main/surfrdUtilsMod.F90 -D clm/src/clm4_5/main/ED -D clm/src/clm4_5/main/ED/EDInitTimeConst.F90 -D clm/src/clm4_5/main/ED/EDCLMLinkMod.F90 -D clm/src/clm4_5/main/ED/EDClmType.F90 -D clm/src/clm4_5/main/ED/EDRestVectorMod.F90 -D clm/src/clm4_5/main/ED/EDHistFldsMod.F90 -D clm/src/clm4_5/main/ED/EDClmTypeInitMod.F90 -D clm/src/clm4_5/main/ED/EDPftvarcon.F90 -D clm/src/clm4_5/main/ED/EDParamsMod.F90 -D clm/src/clm4_5/main/ED/EDInitMod.F90 -D clm/src/clm4_5/main/ED/EDTypesMod.F90 -D clm/src/clm4_5/main/ED/EDMainMod.F90 -D clm/src/clm4_5/main/subgridAveMod.F90 -D clm/src/clm4_5/main/initGridCellsMod.F90 -D clm/src/clm4_5/main/initSoilParVICMod.F90 -D clm/src/clm4_5/main/pftvarcon.F90 -D clm/src/clm4_5/main/surfrdMod.F90 -D clm/src/clm4_5/main/decompMod.F90 -D clm/src/clm4_5/main/FuncPedotransferMod.F90 -D clm/src/clm4_5/main/clmtype.F90 -D clm/src/clm4_5/main/reweightMod.F90 -D clm/src/clm4_5/main/readParamsMod.F90 -D clm/src/clm4_5/main/histFldsMod.F90 - -D clm/src/clm4_5/biogeophys -D clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -D clm/src/clm4_5/biogeophys/SLakeInitMod.F90 -D clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -D clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -D clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -D clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -D clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -D clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -D clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -D clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -D clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -D clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -D clm/src/clm4_5/biogeophys/UrbanMod.F90 -D clm/src/clm4_5/biogeophys/QSatMod.F90 -D clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -D clm/src/clm4_5/biogeophys/SurfaceResistanceMod.F90 -D clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -D clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -D clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -D clm/src/clm4_5/biogeophys/SNICARMod.F90 -D clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -D clm/src/clm4_5/biogeophys/CMakeLists.txt -D clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -D clm/src/clm4_5/biogeophys/RootBiophysMod.F90 -D clm/src/clm4_5/biogeophys/test -D clm/src/clm4_5/biogeophys/test/CMakeLists.txt -D clm/src/clm4_5/biogeophys/test/Daylength_test -D clm/src/clm4_5/biogeophys/test/Daylength_test/test_daylength.pf -D clm/src/clm4_5/biogeophys/test/Daylength_test/CMakeLists.txt -D clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -D clm/src/clm4_5/biogeophys/SoilWaterMovementMod.F90 -D clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -D clm/src/clm4_5/biogeophys/SoilMoistStressMod.F90 -D clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -D clm/src/clm4_5/biogeophys/SoiWatRetCurveParMod.F90 -D clm/src/clm4_5/biogeophys/ED -D clm/src/clm4_5/biogeophys/ED/EDAccumulateFluxesMod.F90 -D clm/src/clm4_5/biogeophys/ED/EDSurfaceAlbedoMod.F90 -D clm/src/clm4_5/biogeophys/ED/EDPhotosynthesisMod.F90 -D clm/src/clm4_5/biogeophys/ED/EDBtranMod.F90 -D clm/src/clm4_5/biogeophys/FracWetMod.F90 -D clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -D clm/src/clm4_5/biogeophys/SLakeRestMod.F90 -D clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -D clm/src/clm4_5/biogeophys/SLakeCon.F90 -D clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -D clm/src/clm4_5/biogeophys/BandDiagonalMod.F90 -D clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -D clm/src/clm4_5/biogeophys/DaylengthMod.F90 - -D clm/src/clm4_5/dyn_subgrid -D clm/src/clm4_5/dyn_subgrid/test -D clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test -D clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -D clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf -D clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt -D clm/src/clm4_5/dyn_subgrid/test/dynVar_test -D clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 -D clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf -D clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf -D clm/src/clm4_5/dyn_subgrid/test/dynVar_test/CMakeLists.txt -D clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test -D clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf -D clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt -D clm/src/clm4_5/dyn_subgrid/test/CMakeLists.txt -D clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test -D clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf -D clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt -D clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynConsBiogeochemMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynPriorWeightsMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynVarMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynEDMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynCNDVMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynConsBiogeophysMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90 -D clm/src/clm4_5/dyn_subgrid/dynVarMod.F90.in -D clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90.in -D clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90.in -D clm/src/clm4_5/dyn_subgrid/do_genf90 -D clm/src/clm4_5/dyn_subgrid/dynInitColumnsMod.F90 -D clm/src/clm4_5/dyn_subgrid/CMakeLists.txt - -D clm/src/util_share -D clm/src/util_share/organicFileMod.F90 -D clm/src/util_share/spmdGathScatMod.F90 -D clm/src/util_share/clm_time_manager.F90 -D clm/src/util_share/clm_nlUtilsMod.F90 -D clm/src/util_share/clm_varorb.F90 -D clm/src/util_share/abortutils.F90 -D clm/src/util_share/accumulMod.F90 -D clm/src/util_share/getdatetime.F90 -D clm/src/util_share/fileutils.F90 -D clm/src/util_share/dtypes.h -D clm/src/util_share/ncdio_pio.F90 -D clm/src/util_share/SimpleMathMod.F90 -D clm/src/util_share/spmdMod.F90 -D clm/src/util_share/domainMod.F90 -D clm/src/util_share/ncdio_pio.F90.in -D clm/src/util_share/restUtilMod.F90 -D clm/src/util_share/quadraticMod.F90 -D clm/src/util_share/restUtilMod.F90.in -D clm/src/util_share/CMakeLists.txt -D clm/src/util_share/GetGlobalValuesMod.F90 - -D clm/src/clm4_0 -D clm/src/clm4_0/biogeochem -D clm/src/clm4_0/biogeochem/CNCStateUpdate2Mod.F90 -D clm/src/clm4_0/biogeochem/CNC13StateUpdate2Mod.F90 -D clm/src/clm4_0/biogeochem/CNGapMortalityMod.F90 -D clm/src/clm4_0/biogeochem/CropRestMod.F90 -D clm/src/clm4_0/biogeochem/CNGRespMod.F90 -D clm/src/clm4_0/biogeochem/CNNStateUpdate1Mod.F90 -D clm/src/clm4_0/biogeochem/CNBalanceCheckMod.F90 -D clm/src/clm4_0/biogeochem/CNNStateUpdate3Mod.F90 -D clm/src/clm4_0/biogeochem/CNFireMod.F90 -D clm/src/clm4_0/biogeochem/CNMRespMod.F90 -D clm/src/clm4_0/biogeochem/MEGANFactorsMod.F90 -D clm/src/clm4_0/biogeochem/CNPrecisionControlMod.F90 -D clm/src/clm4_0/biogeochem/CNWoodProductsMod.F90 -D clm/src/clm4_0/biogeochem/CNSummaryMod.F90 -D clm/src/clm4_0/biogeochem/DUSTMod.F90 -D clm/src/clm4_0/biogeochem/CNDVLightMod.F90 -D clm/src/clm4_0/biogeochem/CNPhenologyMod.F90 -D clm/src/clm4_0/biogeochem/CNCStateUpdate1Mod.F90 -D clm/src/clm4_0/biogeochem/CNDecompMod.F90 -D clm/src/clm4_0/biogeochem/STATICEcosysDynMod.F90 -D clm/src/clm4_0/biogeochem/CNCStateUpdate3Mod.F90 -D clm/src/clm4_0/biogeochem/CNDVMod.F90 -D clm/src/clm4_0/biogeochem/CNC13StateUpdate1Mod.F90 -D clm/src/clm4_0/biogeochem/CNrestMod.F90 -D clm/src/clm4_0/biogeochem/CNC13StateUpdate3Mod.F90 -D clm/src/clm4_0/biogeochem/VOCEmissionMod.F90 -D clm/src/clm4_0/biogeochem/CNDVEcosystemDynIniMod.F90 -D clm/src/clm4_0/biogeochem/CNAnnualUpdateMod.F90 -D clm/src/clm4_0/biogeochem/CNNStateUpdate2Mod.F90 -D clm/src/clm4_0/biogeochem/C13SummaryMod.F90 -D clm/src/clm4_0/biogeochem/DryDepVelocity.F90 -D clm/src/clm4_0/biogeochem/CNC13FluxMod.F90 -D clm/src/clm4_0/biogeochem/CNAllocationMod.F90 -D clm/src/clm4_0/biogeochem/CNNDynamicsMod.F90 -D clm/src/clm4_0/biogeochem/CNEcosystemDynMod.F90 -D clm/src/clm4_0/biogeochem/CNSetValueMod.F90 -D clm/src/clm4_0/biogeochem/CNVegStructUpdateMod.F90 -D clm/src/clm4_0/biogeochem/CNDVEstablishmentMod.F90 - -D clm/src/clm4_0/main -D clm/src/clm4_0/main/clm_varcon.F90 -D clm/src/clm4_0/main/clm_varpar.F90 -D clm/src/clm4_0/main/CNiniTimeVar.F90 -D clm/src/clm4_0/main/dynlandMod.F90 -D clm/src/clm4_0/main/decompInitMod.F90 -D clm/src/clm4_0/main/clm_initializeMod.F90 -D clm/src/clm4_0/main/subgridRestMod.F90 -D clm/src/clm4_0/main/clm_glclnd.F90 -D clm/src/clm4_0/main/accFldsMod.F90 -D clm/src/clm4_0/main/subgridMod.F90 -D clm/src/clm4_0/main/clmtypeInitMod.F90 -D clm/src/clm4_0/main/ndepStreamMod.F90 -D clm/src/clm4_0/main/pftdynMod.F90 -D clm/src/clm4_0/main/iniTimeConst.F90 -D clm/src/clm4_0/main/histFileMod.F90 -D clm/src/clm4_0/main/pft2colMod.F90 -D clm/src/clm4_0/main/clm_atmlnd.F90 -D clm/src/clm4_0/main/findHistFields.pl -D clm/src/clm4_0/main/restFileMod.F90 -D clm/src/clm4_0/main/clm_varsur.F90 -D clm/src/clm4_0/main/controlMod.F90 -D clm/src/clm4_0/main/initSurfAlbMod.F90 -D clm/src/clm4_0/main/filterMod.F90 -D clm/src/clm4_0/main/clm_driver.F90 -D clm/src/clm4_0/main/clm_varctl.F90 -D clm/src/clm4_0/main/subgridAveMod.F90 -D clm/src/clm4_0/main/initGridCellsMod.F90 -D clm/src/clm4_0/main/CNiniSpecial.F90 -D clm/src/clm4_0/main/pftvarcon.F90 -D clm/src/clm4_0/main/surfrdMod.F90 -D clm/src/clm4_0/main/decompMod.F90 -D clm/src/clm4_0/main/clmtype.F90 -D clm/src/clm4_0/main/histFldsMod.F90 -D clm/src/clm4_0/main/mkarbinitMod.F90 -D clm/src/clm4_0/biogeophys -D clm/src/clm4_0/biogeophys/BalanceCheckMod.F90 -D clm/src/clm4_0/biogeophys/SurfaceRadiationMod.F90 -D clm/src/clm4_0/biogeophys/SoilTemperatureMod.F90 -D clm/src/clm4_0/biogeophys/SnowHydrologyMod.F90 -D clm/src/clm4_0/biogeophys/UrbanInputMod.F90 -D clm/src/clm4_0/biogeophys/Biogeophysics1Mod.F90 -D clm/src/clm4_0/biogeophys/Biogeophysics2Mod.F90 -D clm/src/clm4_0/biogeophys/FracWetMod.F90 -D clm/src/clm4_0/biogeophys/UrbanInitMod.F90 -D clm/src/clm4_0/biogeophys/FrictionVelocityMod.F90 -D clm/src/clm4_0/biogeophys/TridiagonalMod.F90 -D clm/src/clm4_0/biogeophys/SurfaceAlbedoMod.F90 -D clm/src/clm4_0/biogeophys/Hydrology1Mod.F90 -D clm/src/clm4_0/biogeophys/Hydrology2Mod.F90 -D clm/src/clm4_0/biogeophys/BiogeophysicsLakeMod.F90 -D clm/src/clm4_0/biogeophys/BiogeophysRestMod.F90 -D clm/src/clm4_0/biogeophys/UrbanMod.F90 -D clm/src/clm4_0/biogeophys/SoilHydrologyMod.F90 -D clm/src/clm4_0/biogeophys/QSatMod.F90 -D clm/src/clm4_0/biogeophys/clm_driverInitMod.F90 -D clm/src/clm4_0/biogeophys/HydrologyLakeMod.F90 -D clm/src/clm4_0/biogeophys/BareGroundFluxesMod.F90 -D clm/src/clm4_0/biogeophys/SNICARMod.F90 -D clm/src/clm4_0/biogeophys/CanopyFluxesMod.F90 - -List all files added and what they do: - -A clm/src_clm40 -A clm/src_clm40/biogeochem -A clm/src_clm40/biogeochem/CNCStateUpdate2Mod.F90 -A clm/src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 -A clm/src_clm40/biogeochem/CNGRespMod.F90 -A clm/src_clm40/biogeochem/CNBalanceCheckMod.F90 -A clm/src_clm40/biogeochem/CNNStateUpdate3Mod.F90 -A clm/src_clm40/biogeochem/CNSummaryMod.F90 -A clm/src_clm40/biogeochem/CNPhenologyMod.F90 -A clm/src_clm40/biogeochem/STATICEcosysDynMod.F90 -A clm/src_clm40/biogeochem/CNCStateUpdate1Mod.F90 -A clm/src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 -A clm/src_clm40/biogeochem/CNrestMod.F90 -A clm/src_clm40/biogeochem/VOCEmissionMod.F90 -A clm/src_clm40/biogeochem/CNAnnualUpdateMod.F90 -A clm/src_clm40/biogeochem/CNNStateUpdate2Mod.F90 -A clm/src_clm40/biogeochem/C13SummaryMod.F90 -A clm/src_clm40/biogeochem/CNAllocationMod.F90 -A clm/src_clm40/biogeochem/DryDepVelocity.F90 -A clm/src_clm40/biogeochem/CNNDynamicsMod.F90 -A clm/src_clm40/biogeochem/CNSetValueMod.F90 -A clm/src_clm40/biogeochem/CNGapMortalityMod.F90 -A clm/src_clm40/biogeochem/CropRestMod.F90 -A clm/src_clm40/biogeochem/CNNStateUpdate1Mod.F90 -A clm/src_clm40/biogeochem/CNFireMod.F90 -A clm/src_clm40/biogeochem/CNMRespMod.F90 -A clm/src_clm40/biogeochem/MEGANFactorsMod.F90 -A clm/src_clm40/biogeochem/CNWoodProductsMod.F90 -A clm/src_clm40/biogeochem/CNPrecisionControlMod.F90 -A clm/src_clm40/biogeochem/DUSTMod.F90 -A clm/src_clm40/biogeochem/CNDVLightMod.F90 -A clm/src_clm40/biogeochem/CNDecompMod.F90 -A clm/src_clm40/biogeochem/CNDVMod.F90 -A clm/src_clm40/biogeochem/CNCStateUpdate3Mod.F90 -A clm/src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 -A clm/src_clm40/biogeochem/CNDVEcosystemDynIniMod.F90 -A clm/src_clm40/biogeochem/CNC13FluxMod.F90 -A clm/src_clm40/biogeochem/CNEcosystemDynMod.F90 -A clm/src_clm40/biogeochem/CNVegStructUpdateMod.F90 -A clm/src_clm40/biogeochem/CNDVEstablishmentMod.F90 - -A clm/src_clm40/main -A clm/src_clm40/main/spmdGathScatMod.F90 -A clm/src_clm40/main/organicFileMod.F90 -A clm/src_clm40/main/clm_varcon.F90 -A clm/src_clm40/main/clm_varpar.F90 -A clm/src_clm40/main/CNiniTimeVar.F90 -A clm/src_clm40/main/abortutils.F90 -A clm/src_clm40/main/accumulMod.F90 -A clm/src_clm40/main/decompInitMod.F90 -A clm/src_clm40/main/clm_glclnd.F90 -A clm/src_clm40/main/accFldsMod.F90 -A clm/src_clm40/main/subgridMod.F90 -A clm/src_clm40/main/pftdynMod.F90 -A clm/src_clm40/main/pft2colMod.F90 -A clm/src_clm40/main/clm_atmlnd.F90 -A clm/src_clm40/main/quadraticMod.F90 -A clm/src_clm40/main/GetGlobalValuesMod.F90 -A clm/src_clm40/main/clm_time_manager.F90 -A clm/src_clm40/main/filterMod.F90 -A clm/src_clm40/main/clm_varctl.F90 -A clm/src_clm40/main/subgridAveMod.F90 -A clm/src_clm40/main/dtypes.h -A clm/src_clm40/main/CNiniSpecial.F90 -A clm/src_clm40/main/surfrdMod.F90 -A clm/src_clm40/main/domainMod.F90 -A clm/src_clm40/main/lnd_import_export.F90 -A clm/src_clm40/main/restUtilMod.F90 -A clm/src_clm40/main/clmtype.F90 -A clm/src_clm40/main/mkarbinitMod.F90 -A clm/src_clm40/main/restUtilMod.F90.in -A clm/src_clm40/main/dynlandMod.F90 -A clm/src_clm40/main/getdatetime.F90 -A clm/src_clm40/main/clm_initializeMod.F90 -A clm/src_clm40/main/subgridRestMod.F90 -A clm/src_clm40/main/fileutils.F90 -A clm/src_clm40/main/clmtypeInitMod.F90 -A clm/src_clm40/main/ndepStreamMod.F90 -A clm/src_clm40/main/SimpleMathMod.F90 -A clm/src_clm40/main/iniTimeConst.F90 -A clm/src_clm40/main/lnd_comp_esmf.F90 -A clm/src_clm40/main/histFileMod.F90 -A clm/src_clm40/main/clm_cpl_indices.F90 -A clm/src_clm40/main/findHistFields.pl -A clm/src_clm40/main/restFileMod.F90 -A clm/src_clm40/main/clm_varsur.F90 -A clm/src_clm40/main/controlMod.F90 -A clm/src_clm40/main/CMakeLists.txt -A clm/src_clm40/main/initSurfAlbMod.F90 -A clm/src_clm40/main/clm_nlUtilsMod.F90 -A clm/src_clm40/main/clm_driver.F90 -A clm/src_clm40/main/clm_varorb.F90 -A clm/src_clm40/main/initGridCellsMod.F90 -A clm/src_clm40/main/lnd_comp_mct.F90 -A clm/src_clm40/main/pftvarcon.F90 -A clm/src_clm40/main/ncdio_pio.F90 -A clm/src_clm40/main/spmdMod.F90 -A clm/src_clm40/main/decompMod.F90 -A clm/src_clm40/main/ncdio_pio.F90.in -A clm/src_clm40/main/histFldsMod.F90 - -A clm/src_clm40/biogeophys -A clm/src_clm40/biogeophys/BalanceCheckMod.F90 -A clm/src_clm40/biogeophys/SoilTemperatureMod.F90 -A clm/src_clm40/biogeophys/UrbanInputMod.F90 -A clm/src_clm40/biogeophys/SnowHydrologyMod.F90 -A clm/src_clm40/biogeophys/Biogeophysics1Mod.F90 -A clm/src_clm40/biogeophys/FrictionVelocityMod.F90 -A clm/src_clm40/biogeophys/TridiagonalMod.F90 -A clm/src_clm40/biogeophys/Hydrology1Mod.F90 -A clm/src_clm40/biogeophys/BiogeophysRestMod.F90 -A clm/src_clm40/biogeophys/UrbanMod.F90 -A clm/src_clm40/biogeophys/QSatMod.F90 -A clm/src_clm40/biogeophys/clm_driverInitMod.F90 -A clm/src_clm40/biogeophys/HydrologyLakeMod.F90 -A clm/src_clm40/biogeophys/BareGroundFluxesMod.F90 -A clm/src_clm40/biogeophys/SNICARMod.F90 -A clm/src_clm40/biogeophys/CanopyFluxesMod.F90 -A clm/src_clm40/biogeophys/SurfaceRadiationMod.F90 -A clm/src_clm40/biogeophys/Biogeophysics2Mod.F90 -A clm/src_clm40/biogeophys/UrbanInitMod.F90 -A clm/src_clm40/biogeophys/FracWetMod.F90 -A clm/src_clm40/biogeophys/SurfaceAlbedoMod.F90 -A clm/src_clm40/biogeophys/Hydrology2Mod.F90 -A clm/src_clm40/biogeophys/BiogeophysicsLakeMod.F90 -A clm/src_clm40/biogeophys/SoilHydrologyMod.F90 - -A clm/src/main -A clm/src/main/organicFileMod.F90 -A clm/src/main/clm_varcon.F90 -A clm/src/main/initInterp.F90 -A clm/src/main/landunit_varcon.F90 -A clm/src/main/clm_varpar.F90 -A clm/src/main/abortutils.F90 -A clm/src/main/accumulMod.F90 -A clm/src/main/subgridWeightsMod.F90 -A clm/src/main/decompInitMod.F90 -A clm/src/main/subgridMod.F90 -A clm/src/main/atm2lndType.F90 -A clm/src/main/lnd2atmType.F90 -A clm/src/main/column_varcon.F90 -A clm/src/main/EcophysConType.F90 -A clm/src/main/GetGlobalValuesMod.F90 -A clm/src/main/initSubgridMod.F90 -A clm/src/main/lnd2glcMod.F90 -A clm/src/main/glc2lndMod.F90 -A clm/src/main/filterMod.F90 -A clm/src/main/surfrdUtilsMod.F90 -A clm/src/main/clm_varctl.F90 -A clm/src/main/subgridAveMod.F90 -A clm/src/main/initVerticalMod.F90 -A clm/src/main/glcDiagnosticsMod.F90 -A clm/src/main/lnd2atmMod.F90 -A clm/src/main/atm2lndMod.F90 -A clm/src/main/surfrdMod.F90 -A clm/src/main/FuncPedotransferMod.F90 -A clm/src/main/readParamsMod.F90 -A clm/src/main/clm_initializeMod.F90 -A clm/src/main/subgridRestMod.F90 -A clm/src/main/paramUtilMod.F90 -A clm/src/main/ColumnType.F90 -A clm/src/main/PatchType.F90 -A clm/src/main/ndepStreamMod.F90 -A clm/src/main/init_hydrology.F90 -A clm/src/main/histFileMod.F90 -A clm/src/main/findHistFields.pl -A clm/src/main/restFileMod.F90 -A clm/src/main/clm_varsur.F90 -A clm/src/main/controlMod.F90 -A clm/src/main/LandunitType.F90 -A clm/src/main/CMakeLists.txt -A clm/src/main/test -A clm/src/main/test/subgridWeights_test -A clm/src/main/test/subgridWeights_test/test_subgridWeights.pf -A clm/src/main/test/subgridWeights_test/CMakeLists.txt -A clm/src/main/test/clm_glclnd_test -A clm/src/main/test/clm_glclnd_test/test_clm_glclnd.pf -A clm/src/main/test/clm_glclnd_test/CMakeLists.txt -A clm/src/main/test/CMakeLists.txt -A clm/src/main/clm_driver.F90 -A clm/src/main/GridcellType.F90 -A clm/src/main/initGridCellsMod.F90 -A clm/src/main/pftvarcon.F90 -A clm/src/main/ncdio_pio.F90 -A clm/src/main/decompMod.F90 -A clm/src/main/ncdio_pio.F90.in -A clm/src/main/reweightMod.F90 - -A clm/src/ED -A clm/src/ED/biogeochem -A clm/src/ED/biogeochem/EDCanopyStructureMod.F90 -A clm/src/ED/biogeochem/EDGrowthFunctionsMod.F90 -A clm/src/ED/biogeochem/EDPhysiologyMod.F90 -A clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 -A clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 -A clm/src/ED/main -A clm/src/ED/main/EDBioType.F90 -A clm/src/ED/main/EDEcophysConType.F90 -A clm/src/ED/main/EDParamsMod.F90 -A clm/src/ED/main/EDMainMod.F90 -A clm/src/ED/main/EDCLMLinkMod.F90 -A clm/src/ED/main/EDVecCohortType.F90 -A clm/src/ED/main/EDVecPatchType.F90 -A clm/src/ED/main/EDRestVectorMod.F90 -A clm/src/ED/main/EDPftvarcon.F90 -A clm/src/ED/main/EDInitMod.F90 -A clm/src/ED/main/EDTypesMod.F90 -A clm/src/ED/fire -A clm/src/ED/fire/SFParamsMod.F90 -A clm/src/ED/fire/SFMainMod.F90 -A clm/src/ED/biogeophys -A clm/src/ED/biogeophys/EDAccumulateFluxesMod.F90 -A clm/src/ED/biogeophys/EDSurfaceAlbedoMod.F90 -A clm/src/ED/biogeophys/EDPhotosynthesisMod.F90 -A clm/src/ED/biogeophys/EDBtranMod.F90 -A clm/src/Notes -M clm/src/unit_test_shr/unittestSubgridMod.F90 - -A clm/src/utils -A clm/src/utils/spmdGathScatMod.F90 -A clm/src/utils/clm_time_manager.F90 -A clm/src/utils/clm_nlUtilsMod.F90 -A clm/src/utils/clm_varorb.F90 -A clm/src/utils/accumulMod.F90 -A clm/src/utils/getdatetime.F90 -A clm/src/utils/fileutils.F90 -A clm/src/utils/dtypes.h -A clm/src/utils/spmdMod.F90 -A clm/src/utils/SimpleMathMod.F90 -A clm/src/utils/domainMod.F90 -A clm/src/utils/restUtilMod.F90 -A clm/src/utils/quadraticMod.F90 -A clm/src/utils/CMakeLists.txt -A clm/src/utils/restUtilMod.F90.in - -A clm/src/biogeochem -A clm/src/biogeochem/CNCStateUpdate2Mod.F90 -A clm/src/biogeochem/CNDecompCascadeConType.F90 -A clm/src/biogeochem/CNNitrifDenitrifMod.F90 -A clm/src/biogeochem/CNGRespMod.F90 -A clm/src/biogeochem/CNBalanceCheckMod.F90 -A clm/src/biogeochem/CNNStateUpdate3Mod.F90 -A clm/src/biogeochem/CNDVDriverMod.F90 -A clm/src/biogeochem/SatellitePhenologyMod.F90 -A clm/src/biogeochem/CNPhenologyMod.F90 -A clm/src/biogeochem/CNCarbonFluxType.F90 -A clm/src/biogeochem/CNCarbonStateType.F90 -A clm/src/biogeochem/CNCStateUpdate1Mod.F90 -A clm/src/biogeochem/VOCEmissionMod.F90 -A clm/src/biogeochem/CNAnnualUpdateMod.F90 -A clm/src/biogeochem/CNNStateUpdate2Mod.F90 -A clm/src/biogeochem/CropType.F90 -A clm/src/biogeochem/CNAllocationMod.F90 -A clm/src/biogeochem/CNNDynamicsMod.F90 -A clm/src/biogeochem/DryDepVelocity.F90 -A clm/src/biogeochem/CNDecompCascadeBGCMod.F90 -A clm/src/biogeochem/CNSoilLittVertTranspMod.F90 -A clm/src/biogeochem/CNDecompCascadeCNMod.F90 -A clm/src/biogeochem/CNC14DecayMod.F90 -A clm/src/biogeochem/CNGapMortalityMod.F90 -A clm/src/biogeochem/CNNStateUpdate1Mod.F90 -A clm/src/biogeochem/CNFireMod.F90 -A clm/src/biogeochem/CNNitrogenFluxType.F90 -A clm/src/biogeochem/CNMRespMod.F90 -A clm/src/biogeochem/MEGANFactorsMod.F90 -A clm/src/biogeochem/CNVerticalProfileMod.F90 -A clm/src/biogeochem/CNCIsoFluxMod.F90 -A clm/src/biogeochem/CNWoodProductsMod.F90 -A clm/src/biogeochem/CNPrecisionControlMod.F90 -A clm/src/biogeochem/ch4Mod.F90 -A clm/src/biogeochem/DUSTMod.F90 -A clm/src/biogeochem/CNDVLightMod.F90 -A clm/src/biogeochem/ch4varcon.F90 -A clm/src/biogeochem/CNDecompMod.F90 -A clm/src/biogeochem/CNCStateUpdate3Mod.F90 -A clm/src/biogeochem/CNSharedParamsMod.F90 -A clm/src/biogeochem/CNDVType.F90 -A clm/src/biogeochem/CNStateType.F90 -A clm/src/biogeochem/CNEcosystemDynMod.F90 -A clm/src/biogeochem/CNNitrogenStateType.F90 -A clm/src/biogeochem/CNVegStructUpdateMod.F90 -A clm/src/biogeochem/CNDVEstablishmentMod.F90 - -A clm/src/biogeophys -A clm/src/biogeophys/SnowSnicarMod.F90 -A clm/src/biogeophys/SnowHydrologyMod.F90 -A clm/src/biogeophys/TridiagonalMod.F90 -A clm/src/biogeophys/FrictionVelocityType.F90 -A clm/src/biogeophys/LakeFluxesMod.F90 -A clm/src/biogeophys/PhotosynthesisMod.F90 -A clm/src/biogeophys/AerosolType.F90 -A clm/src/biogeophys/ActiveLayerMod.F90 -A clm/src/biogeophys/QSatMod.F90 -A clm/src/biogeophys/SoilHydrologyType.F90 -A clm/src/biogeophys/HydrologyDrainageMod.F90 -A clm/src/biogeophys/LakeStateType.F90 -A clm/src/biogeophys/BareGroundFluxesMod.F90 -A clm/src/biogeophys/SolarAbsorbedType.F90 -A clm/src/biogeophys/CanopyHydrologyMod.F90 -A clm/src/biogeophys/UrbanFluxesMod.F90 -A clm/src/biogeophys/SurfaceAlbedoMod.F90 -A clm/src/biogeophys/UrbanRadiationMod.F90 -A clm/src/biogeophys/PhotosynthesisType.F90 -A clm/src/biogeophys/CanopyTemperatureMod.F90 -A clm/src/biogeophys/HydrologyNoDrainageMod.F90 -A clm/src/biogeophys/DaylengthMod.F90 -A clm/src/biogeophys/WaterfluxType.F90 -A clm/src/biogeophys/BalanceCheckMod.F90 -A clm/src/biogeophys/SoilTemperatureMod.F90 -A clm/src/biogeophys/WaterStateType.F90 -A clm/src/biogeophys/LakeTemperatureMod.F90 -A clm/src/biogeophys/FrictionVelocityMod.F90 -A clm/src/biogeophys/SoilFluxesMod.F90 -A clm/src/biogeophys/TemperatureType.F90 -A clm/src/biogeophys/SurfaceAlbedoType.F90 -A clm/src/biogeophys/AerosolMod.F90 -A clm/src/biogeophys/SoilStateType.F90 -A clm/src/biogeophys/SurfaceResistanceMod.F90 -A clm/src/biogeophys/UrbanAlbedoMod.F90 -A clm/src/biogeophys/CanopyFluxesMod.F90 -A clm/src/biogeophys/CMakeLists.txt -A clm/src/biogeophys/RootBiophysMod.F90 -A clm/src/biogeophys/test -A clm/src/biogeophys/test/CMakeLists.txt -A clm/src/biogeophys/test/Daylength_test -A clm/src/biogeophys/test/Daylength_test/test_daylength.pf -A clm/src/biogeophys/test/Daylength_test/CMakeLists.txt -A clm/src/biogeophys/SurfaceRadiationMod.F90 -A clm/src/biogeophys/SoilWaterMovementMod.F90 -A clm/src/biogeophys/SoilMoistStressMod.F90 -A clm/src/biogeophys/SoiWatRetCurveParMod.F90 -A clm/src/biogeophys/EnergyFluxType.F90 -A clm/src/biogeophys/CanopyStateType.F90 -A clm/src/biogeophys/BandDiagonalMod.F90 -A clm/src/biogeophys/SoilHydrologyMod.F90 -A clm/src/biogeophys/LakeCon.F90 -A clm/src/biogeophys/LakeHydrologyMod.F90 -A clm/src/biogeophys/UrbanParamsType.F90 -A clm/src/dyn_subgrid -A clm/src/dyn_subgrid/dynLandunitAreaMod.F90 -A clm/src/dyn_subgrid/dynTimeInfoMod.F90 -A clm/src/dyn_subgrid/dynSubgridDriverMod.F90 -A clm/src/dyn_subgrid/dynFileMod.F90 -A clm/src/dyn_subgrid/dynConsBiogeochemMod.F90 -A clm/src/dyn_subgrid/dynEDMod.F90 -A clm/src/dyn_subgrid/dynVarMod.F90 -A clm/src/dyn_subgrid/dynVarTimeUninterpMod.F90 -A clm/src/dyn_subgrid/dynVarMod.F90.in -A clm/src/dyn_subgrid/dynVarTimeInterpMod.F90.in -A clm/src/dyn_subgrid/dynVarTimeUninterpMod.F90.in -A clm/src/dyn_subgrid/do_genf90 -A clm/src/dyn_subgrid/CMakeLists.txt -A clm/src/dyn_subgrid/test -A clm/src/dyn_subgrid/test/dynLandunitArea_test -A clm/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -A clm/src/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt -A clm/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf -A clm/src/dyn_subgrid/test/dynVar_test -A clm/src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 -A clm/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf -A clm/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf -A clm/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt -A clm/src/dyn_subgrid/test/dynTimeInfo_test -A clm/src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf -A clm/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt -A clm/src/dyn_subgrid/test/CMakeLists.txt -A clm/src/dyn_subgrid/test/dynInitColumns_test -A clm/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf -A clm/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt -A clm/src/dyn_subgrid/dynHarvestMod.F90 -A clm/src/dyn_subgrid/dynPriorWeightsMod.F90 -A clm/src/dyn_subgrid/dynpftFileMod.F90 -A clm/src/dyn_subgrid/dynVarTimeInterpMod.F90 -A clm/src/dyn_subgrid/dynCNDVMod.F90 -A clm/src/dyn_subgrid/dynConsBiogeophysMod.F90 -A clm/src/dyn_subgrid/dynInitColumnsMod.F90 -A clm/src/unit_test_mocks/util_share/restUtilMod_mock.F90 -A clm/src/unit_test_mocks/util_share/restUtilMod_mock.F90.in - -List all existing files that have been modified, and describe the changes: - ALL files have been modified - see the general description for an - overview of what was done - the following files have not had their directories - changed - so the summary is below - -M clm/bld/configure - - needed to account for change in filepath - -M clm/bld/CLMBuildNamelist.pm -M clm/bld/namelist_files/namelist_definition_clm4_5.xml - - see namelist changes mentioned above - -M clm/src/unit_test_mocks/util_share/clm_time_manager_mock.F90 -M clm/src/unit_test_mocks/util_share/ncdio_var.F90 -M clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90 -M clm/src/unit_test_mocks/util_share/do_genf90 -M clm/src/unit_test_mocks/util_share/CMakeLists.txt -M clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90.in -M clm/src/unit_test_mocks/main/histFileMod_mock.F90 -M clm/src/CMakeLists.txt - - unit test changes needed to account for introduction of new data types and - directory structure - -M clm/src/cpl/lnd_comp_esmf.F90 -M clm/src/cpl/lnd_import_export.F90 -M clm/src/cpl/lnd_comp_mct.F90 - - coupling interface changes needed to account for introduction of new data types - -CLM testing: - - build-namelist tests: - - yellowstone yes - goldbach yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - - NOTE for goldbach_nag - four ED compare_hist tests fail with small bit for bit differences. - In fact - looking more closely, these tests are also run for pgi and intel on goldbach - and - values for LITTER_IN and LITTER_OUT are 0. for those compilers but non-zero for nag. - With the refactoring code - those fields are again 0. for intel and pgi - but totally different - and non-zero for nag. Apparently, this is known problem that will get resolved in when new ED changes - are brount in - - ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest - ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest - SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest - SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest - - - short tests (aux_clm_short) (generally these are NOT used when making a tag): N/A - - tools testing: N/A - -CLM tag used for the baseline comparisons: clm4_5_1_r080 - -Changes answers relative to baseline: No - BFB - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r080 -Originator(s): erik (Erik) -Date: Sat Aug 16 15:01:35 MDT 2014 -One-line Summary: Update externals to CESM trunk versions, allow eighth degree as a valid resolution - -Purpose of changes: - -Update all the externals to the very latest CESM trunk versions (based off of current -cesm1_3_alpha13a). - -Requirements for tag: Get working with trunk externals - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 2012 Problem with mksurfdata_map for eighth degree grid... - Scripts issues as follows: - 2024 nlcompareonly option to create_test not working correctly for reporting - 2019 ERH tests don't save the base env_run.xml, so have trouble when resubmitted... - 2018 Failed tests in cesm1_3_beta11 needed for CLM - 2005 Remove untested named compsets and grids - 1999 T85_g16 has inconsistent land domain and surface datasets - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - Archiving updated in support of time series generation - Running test suite now builds some shared libraries built only once - -Describe any changes made to the namelist: - Resolve env and xml vars used in user_nl_* - - Default for drv_in profile_timer changed from 4 to 1 - Some PE layours change: f10_f10 change from 15x1 to 30x1 - -List any changes to the defaults for the boundary datasets: Add 0.125x0.125 mapping files - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): Update to cesm1_3_alpha13a externals - - scripts to scripts4_140814a - scripts/doc to doc_140519 - Machines to Machines_140811 - CMake to CMake_Fortran_utils_140715 - drv to drvseq5_0_15 - cism to cism1_140602 - timing to timing_140416 - pio to pio1_8_12 - cprnc to cprnc_140625 - mapping to mapping_140702b (note: gen_domain changes answers) - unit_testing to unit_testing_0_07 - - PTCLM to PTCLM2_140816 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkgridmapMod.F90 -- decrease tolerance - M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.ncl - Loop over variables - and then cat the files together at the end. This makes the process possible for - high resolution and speeds up lower resolution sub-setting as well. - M models/lnd/clm/tools/clm4_0/mksurfdata_map/src/mkgridmapMod.F90 -- decrease tolerance - M models/lnd/clm/tools/shared/mkmapdata/README --------------------- Fix/update documentation - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl ----------- Correct test count - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Add 0.125x0.125 - mapping files - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Add 0.125x0.125 - as a valid resolution - M models/lnd/clm/bld/namelist_files/createMapEntry.pl --- Correct path, get working again - -CLM testing: - - build-namelist tests: - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - yellowstone_gnu yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - - short tests (aux_clm_short) (generally these are NOT used when making a tag): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - - tools testing: - - yellowstone interactive yes - -CLM tag used for the baseline comparisons: clm4_5_1_r079 - -Changes answers relative to baseline: Yes! (PE layouts that change) - - Summarize any changes to answers, i.e., - - what code configurations: non single-point configurations, where PE layout - changes (f10_f10) - - what platforms/compilers: all - - nature of change (roundoff) - x2l_Flrr_volr changes to roundoff - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r079 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Thu Jul 31 17:09:57 MDT 2014 -One-line Summary: G. Bisht (LBL) soil temperature refactor; machines update for goldbach-intel - -Purpose of changes: Refactor soil temperature module to break the construction of the linear system LHS matrix and RHS vector into small physics based routines. Update machines external to fix compiling with goldbach-intel. - -Requirements for tag: regular - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: gbisht, self, muszala - -List any svn externals directories updated (csm_share, mct, etc.): Machines - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 - break creation of linear system into small physics based routines. - - -CLM testing: regular - - build-namelist tests: N/A - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 4.0 ok, 4.5 ok - yellowstone_pgi - 4.0 ok, 4.5 ok - goldbach_nag - 4.0 ok, 4.5 ok (see note below) - goldbach_intel - 4.0 ok, 4.5 ok - goldbach_pgi - 4.0 ok, 4.5 ok - - NOTE for goldbach_nag - four ED compare_hist tests fail with small non bit for bit differences. This is the same issue described in clm4_5_1_r078 tag notes. - - ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest - ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest - SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest - SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest - - tools testing: N/A - -CLM tag used for the baseline comparisons: clm4_5_1_r078 - -Changes answers relative to baseline: No, bit for bit - - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r078 -Originator(s): muszala (Stefan Muszala) -Date: Wed Jul 23 20:42:00 MDT 2014 -One-line Summary: Add lai stream capability and the ability to run with V5 cruncep data. Code written by swenson, -modified and tested by muszala. - -Purpose of changes: Add lai stream capability with use_lai_streams namelist variable. Also add a datm_mode option -s.t. we can use cruncep V5 data if a user wants. Move anomaly focing code out of CLM and into DATM. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: add setup_logic_lai_streams which controls use_lai_streams namelist variable - -List any changes to the defaults for the boundary datasets: added option to use V5 cruncep data sets. V4 is default. - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: kluzek, swenson, self - -List any svn externals directories updated (csm_share, mct, etc.): - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/addclm50_tags/addclm50_n06_ED_scripts_015_140305_rev -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/addclm50_tags/addclm50_n09_ED_scripts_015_140305_rev - --models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_140312 -+models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_140723 - --models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_140418 -+models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_140723 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -! add setup_logic_lai_streams function -M models/lnd/clm/bld/CLMBuildNamelist.pm -! add entries for: stream_year_first_lai, stream_year_last_lai, model_year_align_lai, stream_fldfilename_lai, lai_mapalgo -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -! add default values for items added in namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -! add use_lai_streams code. lai_init, lai_interp -M models/lnd/clm/src/clm4_5/biogeochem/SatellitePhenologyMod.F90 -! some comment clean up. add use_lai_streams logical -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -! add use_lai_streams namelist handling and mpi_bcast call -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -! remove snomaly forcing streams since they are now in the datm -M models/lnd/clm/src/cpl/clm_cpl_indices.F90 -! remove anomaly forcing code since it is now in datm -M models/lnd/clm/src/cpl/lnd_import_export.F90 - -CLM testing: - - build-namelist tests: - - yellowstone - failed 20 tests of 537. This is expected due to the addition of the use_lai_streams namelist variable. - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - -- nlcomp tests for 45 will fail -- - - yellowstone_intel - 40 OK - 45 OK - yellowstone_pgi - 40 OK - 45 OK - - goldbach_nag - 40 OK - 45 OK - goldbach_intel - 40 OK - 45 OK - goldbach_pgi - 40 OK - 45 OK - -Both NAG tests on goldbach for ED compsets failed BFB. All other compilers and machines pass. Error probably related to a non-BFB error that I (spm) see with varying numbers of -time-steps on an ERS test and am currently trying to fix. - -FAIL ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest.GC.again_45_nag.compare_hist.clm4_5_1_r077_redo -FAIL ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_nag.clm-edTest.GC.again_45_nag.clm2.h0.compare_hist.clm4_5_1_r077_redo -FAIL SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest.GC.again_45_nag.compare_hist.clm4_5_1_r077_redo -FAIL SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest.GC.again_45_nag.clm2.h0.compare_hist.clm4_5_1_r077_redo -CLM tag used for the baseline comparisons: clm4_5_1_r077 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r077 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Thu Jul 10 21:55:11 MDT 2014 -One-line Summary: Refactor from Jinyun Tang (LBL) to make hydrology more modular and eventually allow runtime selection of different physics implementations. - -Purpose of changes: Refactor a number of routines in clm45 hydrology to move duplicate code into reusable routines, make the code more modular for eventual unit testing and run time selection of different physics. - -Requirements for tag: bit for bit, regular testing - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self, clm-cmt - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: - - models/lnd/clm/src/util_share/SimpleMathMod.F90 - reuseable array functions - models/lnd/clm/src/clm4_5/main/init_hydrology.F90 - initialize different hydrology submodules. - models/lnd/clm/src/clm4_5/main/FuncPedotransferMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/SurfaceResistanceMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/RootBiophysMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/SoilWaterMovementMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/SoilMoistStressMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/SoiWatRetCurveParMod.F90 - modularize - - -List all existing files that have been modified, and describe the changes: - - models/lnd/clm/bld/query-xFail - check python version and provide an error message of it is too old. - models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 - remove unused min/max variables that conflict with intrinsics with gfortran. - - - models/lnd/clm/src/clm4_5/main/initTimeConstMod.F90 - modularize - models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - allocate new variable, fix bounds on porosity - models/lnd/clm/src/clm4_5/main/controlMod.F90 - initialize new hydrology modules - models/lnd/clm/src/clm4_5/main/clmtype.F90 - add new variable - models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 - modularize - models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - modularize - -CLM testing: regular - - build-namelist tests: - - yellowstone - n/a - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - OK clm40, OK clm45 - yellowstone_pgi - OK clm40, OK clm45 - goldbach_nag - OK clm40, OK clm45 - goldbach_intel - OK clm40, OK clm45 - goldbach_pgi - OK clm40, OK clm45 - - short tests (aux_clm_short) (generally these are NOT used when making a tag): - - yellowstone_intel - n/a - yellowstone_pgi - n/a - goldbach_nag - n/a - - tools testing: - - yellowstone interactive - n/a - goldbach interactive - n/a - -CLM tag used for the baseline comparisons: clm4_5_1_r076 - -Changes answers relative to baseline: No, bit for bit - - Note: SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTest is not bit for bit. This is the same test Stef had problems with in clm4_5_75. He has looked at it and given the ok make the tag as is. - -=============================================================== -=============================================================== -Tag name: clm4_5_1_r076 -Originator(s): erik (Erik) -Date: Mon Jul 7 14:24:07 MDT 2014 -Orig Date: Wed Jun 25 13:49:49 MDT 2014 (Date of what was tagged as clm4_6_0, before we changed naming convention) -One-line Summary: Answer changes for fire code from Fang Li - -Purpose of changes: - -Several changes to CN Fire model. Some fixes for non-transient, as well as limiting of fire for high tropical -forest coverage. Change some units from per time-step to per second. Change Lightning input dataset from just -cloud to ground to total lightning. Some fire parameters were also changed and re-tuned for Qian forcing. -Some more documentation on fire fields was added. - -When -ed_mode is sent to CLM build-namelist, a particular ED params dataset is used over the default. Make -a simple change that allows ED to run when CN is off. Add a 1850 and transient 20thC and rcp=8.5 datasets -for 1x1_brazil. - -Requirements for tag: Fix bugs 1805 and 1719, lower fire amount in amazon - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1996 -- change cloud to ground lightning dataset to total lightning - 1995 -- change units from per time-step to per second - 1805 -- fire fix for non-transient - 1719 -- remove double counting of baf in fire area - 1992 -- allow ED to run when use_cn=.false. - 1988 -- Add ED params dataset. - 1991 -- transient datasets for 1x1_brazil - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: - specific rparams file for ED - add 1850 and 20thC, rcp8.5 datasets for 1x1_brazil - use lightning file that is total lightning not just cloud-to-ground - -Describe any substantial timing or memory changes: - The test SMS.f19_g16.IRCP45CN.yellowstone_pgi showed a memory increase - -Code reviewed by: self, lifang - -List any svn externals directories updated (csm_share, mct, etc.): scripts - scripts to addclm50_n06_ED_scripts_015_140305_rev - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl --------- Add some ED tests - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - Different - params file for ED, and add 1850 and 20thC, rcp8.5 datasets for 1x1_brazil - and use lightning file that is total lightning not just cloud-to-ground - M models/lnd/clm/bld/CLMBuildNamelist.pm ------------------------- Pass use_ed - when getting paramfile - M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 ------------- Revisions from - Fang Li (2014), change parameters, add documentation, tropical forests will - only burn if > 60% coverage, change some fields units to per second rather than - per time-step, - M models/lnd/clm/src/clm4_5/biogeochem/CNInitMod.F90 ------------- change units - for nfire, and farea_burned - M models/lnd/clm/src/clm4_5/main/clmtype.F90 --------------------- Change units - for nfire, lfc, lfc2, baf_crop, baf_peatf, fbac, fbac1, farea_burned - M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 ----------------- Change units for: - LFC2, NFIRE, FAREA_BURNED, BAF_CROP, BAF_PEATF - M models/lnd/clm/src/clm4_5/biogeophys/ED/EDPhotosynthesisMod.F90 Allow to work - when use_cn is .false., use c3psn+1 in finding index for dr array. - -CLM testing: - - build-namelist tests: yes - - NOTE: 191 of the 537 compare tests fail, compared to clm4_5_75, because of changes in the namelist. - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - -CLM tag used for the baseline comparisons: clm4_5_75 - -Changes answers relative to baseline: - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CN and BGC with CLM4.5 physics - CLM4.0 for all modes, and CLM4.5 with SP or ED should be identical - - what platforms/compilers: All - - nature of change: new climate - - Fang Li, ran simulations with Qian forcing on yellowstone and tuned fire parameters to that forcing. - However, her simulations had a minor bug in the conversion of total lightning to just cloud-to-ground - (latitude in degree's was used for a cosine, rather than latitude in radians -- see bug 1996). - -=============================================================== -=============================================================== -Tag name: clm4_5_75 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Fri May 30 11:18:35 MDT 2014 -One-line Summary: update externals to rtm1_0_38 and esmf_wrf_timemgr_140529 - -Purpose of changes: update externals to rtm1_0_38 and esmf_wrf_timemgr_140529. These modifications -are based on valgrind errors that orginated in src/riverroute. Tested in clm4_5_72 to make sure -everything was still BFB (at least w.r.t. CLM testing). Retested (results below) against clm4_5_73. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID):N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - --models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_37 -+models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_38 - --models/utils/esmf_wrf_timemgr https://svn-ccsm-models.cgd.ucar.edu/esmf_wrf_timemgr/trunk_tags/esmf_wrf_timemgr_130213 -+models/utils/esmf_wrf_timemgr https://svn-ccsm-models.cgd.ucar.edu/esmf_wrf_timemgr/trunk_tags/esmf_wrf_timemgr_140529 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: N/A - -CLM testing: - -in addition to other clm tests I updated the rtm and esmf externals in cesm1_3_alpha09c and -ran two B cases. - -Note: There is one ED test (SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_nag.clm-edTestGb) that failed for me in my -testing but passed for Bill with the same checkout. We will keep an eye on this, but it's not super-critical at the moment. -Differences are very small in cpl. voc fields (largest RMS difference is 1e-13). - ->>more TestStatus -PASS ERS_PT.T31_g37.B1850CN.yellowstone_gnu -PASS ERS_PT.T31_g37.B1850CN.yellowstone_gnu.memleak - ->>more TestStatus -PASS ERS.ne30_g16.B1850C5CN.yellowstone_intel -PASS ERS.ne30_g16.B1850C5CN.yellowstone_intel.memleak - - build-namelist tests: N/A - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel - 40 OK - 45 OK - component gen comp - OK - yellowstone_pgi - 40 OK - 45 OK - component gen comp - OK - - goldbach_nag - 40 OK - 45 OK - goldbach_intel - 40 OK - 45 OK - goldbach_pgi - 40 OK - 45 OK - -CLM tag used for the baseline comparisons: clm4_5_73 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_74 -Originator(s): sacks (sacks) -Date: Wed May 28 16:05:36 MDT 2014 -One-line Summary: misc. bfb changes - see detailed summary below - -Purpose of changes: - - (1) Rename fpftdyn to flanduse_timeseries, and make related changes to names - throughout the code. This rename is in preparation for an upcoming tag - where this file will take on more general uses (e.g., transient crop - areas). - - (2) Decrease thresholds for water, snow and energy balance checks (these were - too permissive) - - (3) Move stuff out of clm_varcon into landunit_varcon (for constants specific - to CLM's landunits) and column_varcon (for constants specific to CLM's - columns) - analogous to the existing pftvarcon - - (4) Move some routines out of initGridCellsMod into a new initSubgridMod - - (5) Make time_info a public member of dyn_file_type, which allows removing a - bunch of delegation methods. And rename some things in time_info_type for - clarity. - - (6) Rework metadata for the description of landunit, column and pft types - on the history and restart files, to centralize these descriptions to the - appropriate place in the code. - - (7) Add general-purpose functionality for setting up subgrid structure for - unit tests - - (8) Move unit tests into source tree, rather than being in - test/unit_testers. Now the top-level script is in models/lnd/clm/src. - - (9) Fix baseline comparisons for PTCLM tests - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 1928 (create landunit_varcon.F90 and column_varcon.F90 from parts of clm_varcon.F90) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: fpftdyn renamed to flanduse_timeseries - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: addclm50_n03_ED_scripts_015_140305_rev -> addclm50_n04_ED_scripts_015_140305_rev - - Rename CLM's fpftdyn to flanduse_timeseries in tests; update perl5lib - - tools/unit_testing: unit_testing_0_04 -> unit_testing_0_05 - - the major change here is allowing rebuilds with intel without needing to - specify --clean - - models/lnd/clm/tools/PTCLM: PTCLM2_140423 -> PTCLM2_140521 - - rename fpftdyn -> flanduse_timeseries, and other related renames - -List all files eliminated: - -========= Renamed -D models/lnd/clm/tools/clm4_5/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt -D models/lnd/clm/tools/clm4_0/mksurfdata_map/pftdyn_hist_simyr1850-2005.txt - -========= Move unit tests into source tree -D models/lnd/clm/test/unit_testers/clm4_5/biogeophys/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test/test_daylength.pf -D models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test -D models/lnd/clm/test/unit_testers/clm4_5/biogeophys -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/test_update_landunit_weights.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarShared.F90 -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarTimeInterp.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarTimeUninterp.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/test_dynTimeInfo.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test/test_init_columns.pf -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test -D models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/GetGlobalValuesMod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90.in -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/clm_time_manager_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_pio_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/spmdMod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/do_genf90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_pio_mock.F90.in -D models/lnd/clm/test/unit_testers/clm4_5/mock/util_share -D models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/shr_sys_mod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/mct_mod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share -D models/lnd/clm/test/unit_testers/clm4_5/mock/main/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/mock/main/histFileMod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/main -D models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/dynFileMod_mock.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid -D models/lnd/clm/test/unit_testers/clm4_5/mock/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/mock -D models/lnd/clm/test/unit_testers/clm4_5/CMakeLists.txt -D models/lnd/clm/test/unit_testers/clm4_5/README -D models/lnd/clm/test/unit_testers/clm4_5 -D models/lnd/clm/test/unit_testers - - -List all files added and what they do: - -========= Renamed -A models/lnd/clm/tools/clm4_5/mksurfdata_map/landuse_timeseries_hist_simyr1850-2005.txt -A models/lnd/clm/tools/clm4_0/mksurfdata_map/landuse_timeseries_hist_simyr1850-2005.txt - -========= Move stuff out of clm_varcon into landunit_varcon (for constants - specific to CLM's landunits) and column_varcon (for constants specific - to CLM's columns) - analogous to the existing pftvarcon. -A models/lnd/clm/src/clm4_5/main/landunit_varcon.F90 -A models/lnd/clm/src/clm4_5/main/column_varcon.F90 - - -========= Move some routines out of initGridCellsMod - these are lower-level - routines that can also be used by unit test code. So initGridCellsMod - contains higher-level stuff that is specific to how the subgrid - structure is set up in a production run; and initSubgridMod contains - lower-level stuff that doesn't know or care how things are actually - set up, conceptually. -A models/lnd/clm/src/clm4_5/main/initSubgridMod.F90 - -========= Add general-purpose functionality for setting up subgrid structure for unit tests -A models/lnd/clm/src/unit_test_shr/unittestSubgridMod.F90 -A models/lnd/clm/src/unit_test_shr/CMakeLists.txt -A models/lnd/clm/src/unit_test_shr - - -========= Move unit tests into source tree; also modify some unit tests to take - advantage of the new unittestSubgridMod; also add tests of - subgridWeightsMod and clm_glclnd -A models/lnd/clm/src/clm4_5/main/test/subgridWeights_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/main/test/subgridWeights_test/test_subgridWeights.pf -A models/lnd/clm/src/clm4_5/main/test/subgridWeights_test -A models/lnd/clm/src/clm4_5/main/test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/main/test/clm_glclnd_test/test_clm_glclnd.pf -A models/lnd/clm/src/clm4_5/main/test/clm_glclnd_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/main/test/clm_glclnd_test -A models/lnd/clm/src/clm4_5/main/test -A models/lnd/clm/src/clm4_5/biogeophys/test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/biogeophys/test/Daylength_test/test_daylength.pf -A models/lnd/clm/src/clm4_5/biogeophys/test/Daylength_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/biogeophys/test/Daylength_test -A models/lnd/clm/src/clm4_5/biogeophys/test -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynLandunitArea_test -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynVar_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynVar_test -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynTimeInfo_test -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid/test/dynInitColumns_test -A models/lnd/clm/src/clm4_5/dyn_subgrid/test -A models/lnd/clm/src/README.unit_testing -A models/lnd/clm/src/unit_test_mocks/util_share/ncdio_var.F90 -A models/lnd/clm/src/unit_test_mocks/util_share/GetGlobalValuesMod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/util_share/ncdio_var.F90.in -A models/lnd/clm/src/unit_test_mocks/util_share/clm_time_manager_mock.F90 - - also add a routine to this mock, needed because of refactor of - dyn_file_type / dyn_time_inof -A models/lnd/clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90 -A models/lnd/clm/src/unit_test_mocks/util_share/spmdMod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/util_share/do_genf90 -A models/lnd/clm/src/unit_test_mocks/util_share/CMakeLists.txt -A models/lnd/clm/src/unit_test_mocks/util_share/ncdio_pio_mock.F90.in -A models/lnd/clm/src/unit_test_mocks/util_share -A models/lnd/clm/src/unit_test_mocks/csm_share/shr_sys_mod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/csm_share/mct_mod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/csm_share/CMakeLists.txt -A models/lnd/clm/src/unit_test_mocks/csm_share -A models/lnd/clm/src/unit_test_mocks/main/CMakeLists.txt -A models/lnd/clm/src/unit_test_mocks/main/histFileMod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/main -A models/lnd/clm/src/unit_test_mocks/dyn_subgrid/dynFileMod_mock.F90 -A models/lnd/clm/src/unit_test_mocks/dyn_subgrid/CMakeLists.txt -A models/lnd/clm/src/unit_test_mocks/dyn_subgrid -A models/lnd/clm/src/unit_test_mocks/CMakeLists.txt -A models/lnd/clm/src/unit_test_mocks -A models/lnd/clm/src/CMakeLists.txt - -List all existing files that have been modified, and describe the changes: - -========= Renamed fpftdyn -> flanduse_timeseries, and other related changes to - variable names - (NOTE: Some source files are listed both here and elsewhere in the - ChangeLog entry) -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata_map.namelist -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl -M models/lnd/clm/tools/clm4_5/mksurfdata_map/README -M models/lnd/clm/tools/shared/ncl_scripts/sample_inlist -M models/lnd/clm/tools/shared/ncl_scripts/sample_outlist -M models/lnd/clm/tools/clm4_0/mksurfdata_map/src/clm_varctl.F90 -M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata_map.namelist -M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl -M models/lnd/clm/tools/clm4_0/mksurfdata_map/README -M models/lnd/clm/bld/CLMBuildNamelist.pm -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_defaults_clm4_5_test.xml -M models/lnd/clm/bld/test_build_namelist/t/input/namelist_definition_clm4_5_test.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml -M models/lnd/clm/doc/UsersGuide/trouble_shooting.xml -M models/lnd/clm/doc/UsersGuide/single_point.xml -M models/lnd/clm/doc/UsersGuide/tools.xml -M models/lnd/clm/doc/UsersGuide/adding_files.xml -M models/lnd/clm/doc/UsersGuide/custom.xml -M models/lnd/clm/doc/UsersGuide/ptclm.xml -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/surfrdUtilsMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_0/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_0/main/controlMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_0/main/clm_driver.F90 -M models/lnd/clm/src/clm4_0/biogeophys/BiogeophysRestMod.F90 - -========= Updated PTCLM external to rename fpftdyn -> flanduse_timeseries -M models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES - -========= Decrease threshold for water & snow balance checks by 3 orders of - magnitude; decrease threshold for energy balance checks by 2 orders of - magnitude -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 - -========= Separate clm_varcon into clm_varcon, column_varcon and landunit_varcon -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/CMakeLists.txt - -========= Move some routines out of initGridCellsMod, into a new initSubgridMod - (see detailed notes above) -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -========= Make time_info a public member of dyn_file_type. This allows us to - remove all methods from dyn_file_type (which were just delegating - responsibility to time_info_type). Also rename some methods and - variables in time_info_type. -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90.in - - also change intent(in) to intent(inout), fixing a gfortran problem -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90.in -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90.in -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90 - -========= Rework metadata for the description of landunit, column and pft types - on the history and restart files. Point is to centralize the - definition of these different types as much as possible (rather than, - e.g., having restFileMod know about the translation between landunit - indices and names). For the history file, I am removing the metadata - from the PCT_LANDUNIT long name, instead putting it in global - metadata, as is done for the restart file. -M models/lnd/clm/src/clm4_5/main/subgridWeightsMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 - -========= Change 'use' statements based on my split of clm_varcon into - clm_varcon, landunit_varcon and column_varcon -M models/lnd/clm/src/clm4_5/biogeochem/CNWoodProductsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4InitMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/main/initTimeConstMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/initColdMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/ED/EDCLMLinkMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeochemMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynEDMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynCNDVMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeophysMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynInitColumnsMod.F90 - -========= Fix baseline comparisons for PTCLM tests -M models/lnd/clm/test/tools/TSMscript_tools.sh -M models/lnd/clm/test/tools/TBLscript_tools.sh - -========= Just changes in whitespace -M models/lnd/clm/src/clm4_5/dyn_subgrid/CMakeLists.txt -M models/lnd/clm/src/clm4_5/biogeophys/CMakeLists.txt - - -CLM testing: - - Most testing done on dynlu_crops_n01_addclm50bld_n06_clm4_5_72; PTCLM and - tools testing done on dynlu_crops_n03_addclm50bld_n06_clm4_5_72 - - Note that the branch was up-to-date with addclm50bld_n06_clm4_5_72; this is - identical to clm4_5_73 except for a fix to the build-namelist tests (see below) - - build-namelist tests: - - yellowstone: ok - compared against addclm50bld_n06_clm4_5_72 (essentially clm4_5_73) - expected diffs for transient cases - - The following tests also failed when comparing the baseline against - itself (NOTE: this is apparently fixed in clm4_5_73): - - 466/497 < FAIL> - 467/497 < FAIL> - 496/497 < FAIL> - 497/497 < FAIL> - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel: ok - yellowstone_pgi: ok - goldbach_nag: ok - goldbach_intel: ok - goldbach_pgi: ok - - Most comparisons were done against clm4_5_72. - - These comparisons failed due to a problem with component_gen_comp and the - SSP test; manual comparisons show these to be identical to Erik's tests (for - clm4_5_73): - - FAIL SSP.f19_g16.I1850CLM45BGC.yellowstone_pgi.clm-default.GC.0520-2021.45.p.clm2.h0.compare_hist.clm4_5_72 - FAIL SSP.f19_g16.I1850CLM45BGC.yellowstone_pgi.clm-default.GC.0520-2021.45.p.clm2.h1.compare_hist.clm4_5_72 - - For new tests added in Erik's upcoming tag (clm4_5_73), I did manual - comparisons against Erik's baselines (cpl & clm hist for the yellowstone - tests, just cpl for goldbach tests) - all PASS. - - Note that CLM hist files were NOT compared for any goldbach tests, because - there were no CLM hist file baselines for clm4_5_72. - - tools testing: - - yellowstone interactive: ok - - Compared against addclm50bld_n06_clm4_5_72 (essentially clm4_5_73) - - Failures in the following baseline comparisons, due to changed name of output - file (surfdata.pftdyn -> landuse.timeseries). Manual comparisons showed the - output files to be identical in all cases: - - 010 bl754 TBLtools.sh clm4_0 mksurfdata_map tools__s namelist ...................................\c - rc=7 FAIL - 012 blg54 TBLtools.sh clm4_5 mksurfdata_map tools__s namelist ...................................\c - rc=7 FAIL - 018 bl974 TBLscript_tools.sh clm4_0 mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools_\c - rc=7 FAIL - 030 bli74 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools_\c - rc=7 FAIL - 040 blfg4 TBLscript_tools.sh shared PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools ......\c - rc=7 FAIL - - Other than that, all tests & baseline comparisons passed - -CLM tag used for the baseline comparisons: clm4_5_72, except where noted above - -Changes answers relative to baseline: NO - bfb - -=============================================================== -=============================================================== -Tag name: clm4_5_73 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed May 28 15:33:10 MDT 2014 -One-line Summary: Add the stub ability for clm5_0 physics to CLM build system - -Purpose of changes: - -Add phys=clm5_0 as an option to the build. Currently, nothing is different in the code, this just -adds the capability to do clm5_0 as a seperate configuration. The one thing that is different between -clm4_5 and clm5_0 is the setting of urban_hac. - -Fix several issues needed for CAM: problem in DryDeposition (reoccurance of bug 1883, that was fixed and then -unfixed in clm4_5_48), fix for internal compiler errors. CAM has been using the branch version of this -since: cam5_3_29. - -Work on updates for PTCLM. Add some new sites for Rosie and Jinyun. Correct the call to mkmapdata.sh. -Have CLM1PT forcing directory to use DIN_LOC_ROOT_CLMFORC so you can point it to a location seperate -from DIN_LOC_ROOT. Add a new support script to PTCLM to submit a list of sites to batch: PTCLMsublist. -Also allow release_tags in version find. Get buildtools to work on edison/hopper. - -Get tools to work on hopper and edison, and update mapping to use ESMF6.3.0. - -Fix various bugs: internal compiler error on janus, trigger an error if user_datm.streams.txt file is - readonly (rather than hang). Use DIN_LOC_ROOT_CLMFORC for CLM1PT. - -Requirements for tag: Fix bug 1883 and 1985 for Cheryl and CAM, fix PTCLM, add clm5_0, tools on hopper/edison - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 1985 Internal compiler error on yellowstone with CLM in CAM standalone build - 1965 Internal compiler error on janus with CLM on janus - 1938 Upgrade mkmapdata to ESMF6.3.0 - 1937 Using a read-only user_datm.streams.txt file causes cesm_setup to hang - 1936 CLM1PT forcing directory needs to use DIN_LOC_ROOT_CLMFORC - 1935 Changes needed to get tools to build on hopper... - 1933 Correct call to mkmapdata.sh in PTCLM - 1925 Add more sites to PTCLM - 1904 check for LSF_PJL_TYPE in regridbatch.sh doesn't work correctly - 1883 uninitialized variable in DryDepVelocity.F90 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Add clm5_0 as a new supported physics type - -Describe any changes made to the namelist: Set urban_hac according to physics - clm5_0=ON_WASTEHEAT, and clm4_5=ON - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self (clm_phys perl object reviewed by team: bandre, muszala, sacks) - -List any svn externals directories updated (csm_share, mct, etc.): scripts, datm - scripts to addclm50_n03_ED_scripts_015_140305_rev - datm to datm8_140312 - csm_share to share3_140418 Use trunk version rather than branch - tools/mapping to mapping_131217a - PTCLM to PTCLM2_140423 - -List all files eliminated: - - D models/lnd/clm/bld/unit_testers/env_run.xml -- This file is now built dynamically when the tester is run. - -List all files added and what they do: - - A models/lnd/clm/bld/query-xFail --- Add a script from Ben Andre to read and report on expected fails. - A models/lnd/clm/bld/env_run.xml --- envxml_dir option is now required, so this provides a env_*.xml - file that can be read by default, when build-namelist is called outside of CESM for testing. - A models/lnd/clm/bld/config_files/clm_phys_vers.pm - Enter physics version as a string i.e.: clm4_0 - and then have the ability to interpret it as different types so you can do logical operations - on physics versions - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/tools/shared/mkmapdata/regridbatch.sh ------- Add ability to run on hopper - M models/lnd/clm/tools/shared/mkmapdata/mkmapdata.sh --------- Add ability to run on hopper/edison - remove jaguarpf, and upgrade to ESMF6.3.0 - M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.ncl - New version of NCL requires - load before "begin" statement - - M models/lnd/clm/bld/configure ------------- Allow phys=clm5_0 and add in new clm_phys_vers object - M models/lnd/clm/bld/README ---------------- Update info on files - M models/lnd/clm/bld/CLMBuildNamelist.pm --- Put list of required options at top of help, and make envxml_dir - a required option. Add in use of clm_phys_vers object. Make sure use_ed_spitfire is only on if use_ed is - on. If CLM_UPDATE_GLC_AREAS=TRUE and phys=clm4_0 trigger an error - M models/lnd/clm/bld/config_files/config_definition_clm4_5.xml - Add all three physics version options - M models/lnd/clm/bld/config_files/config_definition_clm4_0.xml - Add info. about clm4_5/clm5_0 options - - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - Add use of clm_phys_vers, and create env_run.xml - on the fly. Also add new tests for glacier update areas, and ED: usespitfireButNOTED, useEDclm40, useEDContradict2 - useEDContradict, clm40andUpdateGlc, clm40andUpdateGlc, UpdateGlcContradict, UpdateGlcNoGLCMe, and tests - for clm5_0 - - M models/lnd/clm/bld/test_build_namelist/t/test_vichydro.pm ----- Needs to use clm_phys_vers object - M models/lnd/clm/bld/test_build_namelist/test_build_namelist.pl - Needs to use clm_phys_vers object - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - urban_hac depends on clm4_5/clm5_0 - --------------- Add phys=clm5_0 for all use-cases that test on phys - M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml - M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - -------------- Fix bugs 1883 (rs over lake) and 1983 (CAM internal compiler error) and 1965 -------------- (janus internal compiler error) - M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 ----- Set rs over lake - M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 ---------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 ------ Add use only for ncd_pio - M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -- Add use only for ncd_pio - M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 ----- Add use only for clmtype and dynVarTimeUninterpMod - fixes internal compiler error on janus (1965) - M models/lnd/clm/src/clm4_0/biogeochem/DryDepVelocity.F90 ----- Set rs over lake - M models/lnd/clm/src/clm4_0/main/clm_initializeMod.F90 -------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/main/subgridRestMod.F90 ----------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/main/pftdynMod.F90 ---------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/main/iniTimeConst.F90 ------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/main/restFileMod.F90 -------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/main/surfrdMod.F90 ---------------- Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/biogeophys/UrbanInputMod.F90 ------ Add use only for ncd_pio - M models/lnd/clm/src/clm4_0/biogeophys/BiogeophysRestMod.F90 -- Add use only for ncd_pio - -CLM testing: - - a) regular - b) build_namelist - c) tools - - build-namelist tests: - - yellowstone yes - - regular tests (aux_clm40, aux_clm45, with '-model_gen_comp clm2'): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - goldbach_intel yes - goldbach_pgi yes - - tools testing: - - yellowstone interactive yes - -CLM tag used for the baseline comparisons: clm4_5_72 - -Changes answers relative to baseline: No (bit-for-bit) - -=============================================================== -=============================================================== -Tag name: clm4_5_72 -Originator(s): muszala (Stefan Muszala) -Date: Mon May 5 17:47:52 MDT 2014 -One-line Summary: Introduce code for Ecosystem Demography (CLM(ED)) Model - -Purpose of changes: Introduce code for Ecosystem Demography (CLM(ED)) Model - first functional tag. - -A large chunk of this code was written and re-written by Rosie Fisher. - -"Introduce code for Ecosystem Demography (CLM(ED)) Model. Adds capability to allow plant functional -types to compete for light, to represent recovery from disturbance, and to allow disturbances -(i.e. fire) to only afflict some fraction of the canopy, and to represent vegetation at the scale -of cohorts of trees. Note that this is a large change and includes: - -1. Significant alterations to canopy albedo and surface radiation calculations -2. New photosynthesis scheme, based on existing science but to allow for more complex canopy structure -3. Introduction of a new allocation and growth scheme, (no consistent with that in CLM(CN) -4. Removal, for now, of Nitrogen limitation capabilities -5. Introduction of the SPITFIRE fire model, which interacts with ED via it's representation of - size-structured mortality and removal of litter pools. -6. Introduction of a simple seed bank model to allow persistence of vegetation through fire events. -7. For ED compsets there exists a cohort dimension on the restart files. - -Cold starts and restarts work for the following. The 1x1_brazil is the most heavily tested case both from -science and SE standpoint: - -1x1_brazil.ICLM45CNED.yellowstone_[intel | pgi] -5x5_amazon.ICLM45CNED.yellowstone_[intel | pgi] -1x1_brazil.ICLM45CNED.goldbach_[nag | intel | pgi ] -5x5_amazon.ICLM45CNED.goldbach_[nag | intel | pgi ] - -Cold starts work for: - -f10_f10.ICLM45CNED.yellowstone_[intel | pgi]. -f19_g16.ICLM45CNED.yellowstone_[intel | pgi] - -Code Origins: - -The ED code in CLM is originally based on code by Moorcroft (www.oeb.harvard.edu/faculty/moorcroft/code_and_data/index.html) -and has been heavily modified in regards to both scientific implementation and assumptions. Fom a software engineering -perspective, ED was rewritten from C into F2003 and the structure of the code has been significantly altered to fit into -the CESM/CLM framework. - -The SPITFIRE code is based on (http://www.biogeosciences.net/7/1991/2010/bg-7-1991-2010.pdf) and has been significantly -altered and extended to fit into the CESM/CLM framework. - -Other points: - 1. removed many unused variables and module uses as reported by nag - 2. changing text wrapping on comments so they end at 139 characters - 3. changed many text based logical operators (.ne., .lt., .ge.) with their math. equivlanet (/=, > , <=) - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: ED functionality brought in. Does not change existing -configurations. For ED, there are now a CNED and BGCED compset. Use CNED until BGC issues are worked -out. - -Describe any changes made to the namelist: ED functionality brought in. Does not change existing -configurations. For ED compsets, there are two new namelist variables. They are: - -use_ed = .true. -use_ed_spit_fire = .true. - -use_ed_spit_fire is set to true by default if use_ed is on. Unless you are running our ED tests, you will -have to change your user_nl_clm to something like: - -paramfile ='/glade/p/cesmdata/cseg/inputdata/lnd/clm2/edParams/CLMPARAMS_ED_011514.nc' -finidat = '' -hist_mfilt = 365 -hist_nhtfrq = -24 - -hist_empty_htapes = .true. - -hist_fincl1='NPP','GPP','BTRAN','TOTVEGC','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', -'STORVEGC','FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', -'LITTERC','fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', -'PFTleafbiomass','FIRE_ROS','WIND','TFC_ROS','DISPVEGC','AREA_TREES','AREA_PLANT' - -If on goldbach, use: - -paramfile ='/fs/cgd/csm/inputdata/lnd/clm2/edParams/CLMPARAMS_ED_011514.nc' - -List any changes to the defaults for the boundary datasets: N/A. - -Describe any substantial timing or memory changes: - -Code reviewed by: Stefan Muszala and Rosie Fisher. Detailed code review by Bill Sacks, Mariana Vertenstein, -Ben Andre, and Erik Kluzek. Discussion of code review included Dave Lawrence, Forrest Hoffmann -and Ryan Knox. - -List any svn externals directories updated (csm_share, mct, etc.): - -Changed externals to a branch_tag that supports ED compsets. We are using branch_tags because trunk -scripts does not work with all of the current CLM tests: - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/add_dynlu_tests_tags/add_dynlu_tests_n03_scripts4_140305 -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/ED_scripts_tags/ED_scripts_015_140305_rev - -List all files eliminated: N/A - -List all files added and what they do: - -### SPITFIRE code -# new SPITEFIRE directory -A + models/lnd/clm/src/clm4_5/main/spitfireSF -# main SPITFIRE code -A + models/lnd/clm/src/clm4_5/main/spitfireSF/SFParamsMod.F90 -# handle SPITFIRE parameters -A + models/lnd/clm/src/clm4_5/main/spitfireSF/SFMainMod.F90 - -# pull out, move to a shared location, place in own module -A + models/lnd/clm/src/util_share/quadraticMod.F90 - -### new source and directories for ED -## ED code required for biogeophysics -# ED directory in biogeophys -A + models/lnd/clm/src/clm4_5/biogeophys/ED -# Calculates daily carbon flux drivers from hourly calculations. -A + models/lnd/clm/src/clm4_5/biogeophys/ED/EDAccumulateFluxesMod.F90 -# Calculates absorbed, reflected and transmitted radiation in diffuse and direct streams for -# each of the canopy layer x PFT x leaf layer three-dimensional matrix. Uses iterative Norman -# radiation transfer scheme. -A + models/lnd/clm/src/clm4_5/biogeophys/ED/EDSurfaceAlbedoMod.F90 -# Main photosynthesis model. Calculates leaf level fluxes on a canopy layer x PFT x leaf layer -# three-dimensional matrix. Sums to canopy to produce overall canopy conductance. Unpacks leaf- -# level fluxes into cohort level fluxes. Uses same scientific assumptions as CLM4.5. -A + models/lnd/clm/src/clm4_5/biogeophys/ED/EDPhotosynthesisMod.F90 -# Generates PFT specific BTRAN vector for each ED patch. Includes option for SPA-like calculations. -A + models/lnd/clm/src/clm4_5/biogeophys/ED/EDBtranMod.F90 - -## ED code required for biogeochemistry -# ED directory in biogeochem -A + models/lnd/clm/src/clm4_5/biogeochem/ED -# Determines which cohorts are in the upper and lower canopy layers. Sets leaf area index inputs to biogeophysics calculations. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDCanopyStructureMod.F90 -# Initializes some ED-specific variables to zero at startup. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDSetValuesMod.F90 -# Contains allometric relationships between vegetation properties (height, dbh, LAI, dead biomass, live biomass, crown area) biogeochem/ED/EDPatchDynamicsMod.F90 : Creates patches, fuses similar patches, controls disturbance and generation of area. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDGrowthFunctionsMod.F90 -# Creates, fuses, terminates, sorts, counts and copies cohort structures. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDCohortDynamicsMod.F90 -# Contains all calculations of derivatives of biomass, litter and seed pools. Also includes phenology model, seed and litter production and decay models, and canopy optimization model. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDPhysiologyMod.F90 -# Creates, fuses, terminates, sorts, counts and copies patch structures. -A + models/lnd/clm/src/clm4_5/biogeochem/ED/EDPatchDynamicsMod.F90 - -## ED core functionality and types that interact with CLM (generally not science) -# ED directory in main -A + models/lnd/clm/src/clm4_5/main/ED -# Transmits required information for CLM (tlai, htop, tile weights). Updates ED-specific history field variables. -A + models/lnd/clm/src/clm4_5/main/ED/EDCLMLinkMod.F90 -# Initializes ED PFT parameter structure. -A + models/lnd/clm/src/clm4_5/main/ED/EDInitTimeConst.F90 -# Contains ED-specific variables for CLM -A + models/lnd/clm/src/clm4_5/main/ED/EDClmType.F90 -# Adds history field variables specific to ED to history file. -A + models/lnd/clm/src/clm4_5/main/ED/EDHistFldsMod.F90 -# Prints out and reads in ED state vector to/from history files. -A + models/lnd/clm/src/clm4_5/main/ED/EDRestVectorMod.F90 -# Initializes ED-specific variables for CLM -A + models/lnd/clm/src/clm4_5/main/ED/EDClmTypeInitMod.F90 -# Allocates ED PFT specific variables. -A + models/lnd/clm/src/clm4_5/main/ED/EDPftvarcon.F90 -# Initializes ED site, patch and cohort structures, either to restarting or bare ground values. -A + models/lnd/clm/src/clm4_5/main/ED/EDInitMod.F90 -# Allocates and initializes ED parameters (that are not PFT specific). -A + models/lnd/clm/src/clm4_5/main/ED/EDParamsMod.F90 -# Main ED model routine. Calls all other daily ED dynamics, integrates variables, checks carbon balance. -A + models/lnd/clm/src/clm4_5/main/ED/EDMainMod.F90 -# Contains ED type structures (cohort, site, patch) and static values. -A + models/lnd/clm/src/clm4_5/main/ED/EDTypesMod.F90 - -# utility routine to help in reading parameter files -A + models/lnd/clm/src/clm4_5/main/paramUtilMod.F90 -# transfers weights calculated internally by ED into wtcol. -A + models/lnd/clm/src/clm4_5/dyn_subgrid/dynEDMod.F90 - -List all existing files that have been modified, and describe the changes: - -### build modifications -# add ED source directories for build -M models/lnd/clm/bld/configure -# build namelist additions for ED -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -# setup_cmdl_ed_mode addition. sets namelist vars -M models/lnd/clm/bld/CLMBuildNamelist.pm - -### util_share modifications -# add function is_beg_curr_day() -M models/lnd/clm/src/util_share/clm_time_manager.F90 -# modify get_proc_bounds to include beg, end cohort -M models/lnd/clm/src/util_share/accumulMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/util_share/ncdio_pio.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/util_share/ncdio_pio.F90.in - -### 4_5 Modifications -# change text based logical with math style (.gt. to >, .ne. to /=) -# modify get_proc_bounds to include beg, end cohort -M models/lnd/clm/src/clm4_5/biogeochem/CNRestMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNInitMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -# move some variables from stack to heap. -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -# change spacing, text wrapping -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 - -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/main/initInterp.F90 -# change spacing, text wrapping -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -# add call to call EDInitTimeConst -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/main/initTimeConstMod.F90 -# add decomposition for cohort dimension -M models/lnd/clm/src/clm4_5/main/decompInitMod.F90 -# add call for ed_init -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -# add code for cohort dimension -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/main/initColdMod.F90 -# change get_proc_global to support cohort dimension -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -# add use_ed logical to support cohort dimension -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -# broadcast ed namelist variables -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -# use_ed logical to call edmodel -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -# change spacing, text wrapping -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -# clean up unsued variables from nag compiler warnings -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -# add routine set_cohort_decomp -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -# change spacing, text wrapping -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -# add support for cohort dimension -M models/lnd/clm/src/clm4_5/main/decompMod.F90 -# change spacing, text wrapping -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -# add call to read ED and SPITFIRE params -R + models/lnd/clm/src/clm4_5/main/readParamsMod.F90 -# add routine set_cohort_decomp -# add use_ed logical(s) -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 - -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/SLakeInitMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -# change get_proc_global to support cohort dimension -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -# change get_proc_global to support cohort dimension -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -# change get_proc_global to support cohort dimension -M models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -# change get_proc_global to support cohort dimension -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -# change spacing, text wrapping -# add use_ed logical(s) -# calculate ed root fractionation -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -# add use_ed logical(s) for forc_solai and parsun -# use_ed reporting -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -# add use_ed logical(s) for norman_radiation -# change spacing -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -# remove unused variable -M models/lnd/clm/src/clm4_5/biogeophys/SLakeCon.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -# change text based logical with math style (.gt. to >, .ne. to /=) -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -# add use_ed logical(s) for call dyn_ED -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 - -### 4_0 Modifications -# add optional cohort argument for new ED dimension to get_proc_global and -# get_proc_bounds_old for 40 backward compatibility -M models/lnd/clm/src/clm4_0/main/decompMod.F90 - -CLM testing: - ---SNICARFRC - moved ERI_D.T31_g37.ICLM45.goldbach_nag.clm-SNICARFRC to goldbach and nag. This is a BFAIL. - ---Testing for new ED compsets. All compare hist portions were BFAIL's since this is the first time -the tests are being put in place. - ---ED and yellowstone [ intel | pgi ] - PASS ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.yellowstone_[intel | pgi].clm-edTest - PASS SMS.f10_f10.ICLM45CNED.yellowstone_[intel | pgi].clm-edTest - PASS SMS.f19_g16.ICLM45CNED.yellowstone_[intel | pgi].clm-edTest - PASS SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.yellowstone_[intel | pgi].clm-edTest - ---ED and goldbach [nag | intel | pgi ] - PASS ERS_D_Mmpi-serial.1x1_brazil.ICLM45CNED.goldbach_[nag | intel | pgi ].clm-edTestGb - PASS SMS_D_Mmpi-serial.5x5_amazon.ICLM45CNED.goldbach_[nag | intel | pgi ].clm-edTestGb - ---CLM history file comparison: - -yellowstone [intel | pgi] - OK - -I ran without the -model_gen_comp option, but ran component_gen_comp and summarize_cprnc_diffs -by hand for both yellowstone_intel and yellowstone_pgi. These are both OK - ---Regular tests (aux_clm testlist) - - yellowstone_intel - OK - yellowstone_pgi - OK - goldbach_nag - OK - goldbach_intel - OK - goldbach_pgi - OK - -CLM tag used for the baseline comparisons: clm4_5_71 - -Changes answers relative to baseline: No. Existing compsets do not change. -If you run with an *ED* compset, then results will differ, but that is expected. - -=============================================================== -=============================================================== -Tag name: clm4_5_71 -Originator(s): Bill Sacks & Jeremy Fyke -Date: Fri May 2 13:00:10 MDT 2014 -One-line Summary: 2-way feedbacks for glacier, veg columns compute glacier SMB, and related changes - -Purpose of changes: - - (1) Bring in two-way feedbacks for glacier when coupled to CISM, via dynamic - landunits, so that CLM's glacier area remains consistent with CISM's - glacier area. Also update CLM's glacier topography to be consistent with - CISM. - - (2) Add an elevation class "0", which provides surface mass balance over the - vegetated portion of the grid cell. This is used to achieve glacial - inception in CISM. Along with this change, also (a) set the topographic - height of non-glacier areas based on bare land topography from CISM, and - (b) change the downscaling of atmospheric fields so that they are also - downscaled over vegetated columns within CISM's ice mask, to achieve - greater consistency between what's happening in the glacier and vegetated - portions of CISM's domain. (Note that, because longwave radiation is - normalized, downscaling it over the vegetated column also changes answers - over glacier columns.) These changes were primarily from Jeremy Fyke. - - (3) Rework some consistency checks to play nicely with dynamic landunits. - - (4) Rework unit test build to use libraries for the clm source and csm_share source - - (5) Misc. other changes, as noted below. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 1969 (incorrect values for QSNWCPICE_NODYNLNDUSE) - - 1929 (dynFileMod breaks with gfortran 4.8) - - 1832 (logic for weights error check differs between clm4.0 and clm4.5) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - -Describe any changes made to the namelist: - -List any changes to the defaults for the boundary datasets: - -Describe any substantial timing or memory changes: - -Code reviewed by: - -List any svn externals directories updated (csm_share, mct, etc.): - -========= Add tests --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_140305 -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/branch_tags/add_dynlu_tests_tags/add_dynlu_tests_n03_scripts4_140305 - -========= Pull in Machines_140318, needed for goldbach --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/branch_tags/arfs_tags/arfs_01_mach140218 -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/branch_tags/arfs_tags/arfs_02_mach140218 - -========= Changes needed for elevation class 0, etc. --models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_07 -+models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_10 --models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_140416 -+models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_140501 - - -List all files eliminated: - -========= Point to real decompMod rather than mock -D models/lnd/clm/test/unit_testers/clm4_5/mock/main/decompMod_boundsTypeDecl.F90 - -List all files added and what they do: - -========= Most of reweightMod.F90 moved here; also includes the following changes: - (1) renames some subroutines - (2) adds some diagnostic fields that are written to the history file - (3) adds some utility routines such as get_landunit_weight -A models/lnd/clm/src/clm4_5/main/subgridWeightsMod.F90 - -========= Add code to initialize newly-active columns -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynInitColumnsMod.F90 - -========= New unit tests -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test/test_init_columns.pf -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynInitColumns_test - -========= Need new mocks and new real files now that we use the real decompMod, and also because of endrun calls -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/GetGlobalValuesMod_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/mct_mod_mock.F90 -A models/lnd/clm/src/util_share/CMakeLists.txt - -========= Need stub histFileMod now that many modules include calls to hist_addfld -A models/lnd/clm/test/unit_testers/clm4_5/mock/main/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock/main/histFileMod_mock.F90 - -List all existing files that have been modified, and describe the changes: - -========= Update glacier cover and topographic heights based on values from CISM; rework - code to accommodate icemask and elevation class 0 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/cpl/clm_cpl_indices.F90 -M models/lnd/clm/src/cpl/lnd_import_export.F90 - -========= Change to be consistent with clm4_5 version, adding elevation class 0 and - x2s%icemask (neither of which are used in the clm4_0 version) -M models/lnd/clm/src/clm4_0/main/clm_glclnd.F90 - -========= Add glc_do_dynglacier namelist option, which triggers off of - CLM_UPDATE_GLC_AREAS; rename glc_dyntopo to glc_dyn_runoff_routing and make it - also trigger off of CLM_UPDATE_GLC_AREAS; add glc_snow_persistence_max_days; add - dynpft_consistency_checks and finidat_consistency_checks groups -M models/lnd/clm/bld/user_nl_clm -M models/lnd/clm/bld/CLMBuildNamelist.pm -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -M models/lnd/clm/bld/unit_testers/env_run.xml -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 - - also use parameter for file name length, so that other modules can - ensure consistency of char length - -========= Add functions to convert between col%itype and icemec class; also add - landunit_names vector -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 - -========= Add functions add_landunit, add_column, add_patch (cleans up this code, and will - assist with setting up unit tests) and use new functions from clm_varcon -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -========= Use new functions from initGridCellsMod -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 - -========= Remove old consistency checks for restart file, add new ones (these changes are - needed so that consistency checks work right with dynamic landunits, and we're - adding some new consistency checks that weren't in place before) -M models/lnd/clm/src/util_share/clm_time_manager.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90.in -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 - - also read all subgrid weights and glc topo on restart - (some of these used to be read in BiogeophysRestMod; - we need all of them with dynamic landunits) - - also remove redundant mcdate, mcsec - - also add icemask restart variable -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 - - also remove redundant PFT_WTGCELL, PFT_WTLUNIT, PFT_WTCOL - (equivalent variables are already output by subgridRestMod) - - also add snow_persistence - -========= Remove old consistency checks for pftdyn file, add new ones - (these changes are needed so that consistency checks work right with dynamic landunits) -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - - also call init_subgrid_weights_mod, put call to update_clm_s2x in - loop over clumps, and move deallocation of topo_glc_mec to later -M models/lnd/clm/src/clm4_5/main/clm_varsur.F90 -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 - -========= Add new dimensions for multi-level fields - for subgrid weight diagnostics; add - a dimension to accommodate fields dimensioned by glc_nec+1 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 - -========= Call new routines (update_clm_x2s, set_subgrid_diagnostic_fields, initialize_new_columns) -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Make various code operate over veg as well as icemec columns -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - - also put call to update_clm_s2x in a loop over clumps -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 - - also compute snow_persistence, and rework some code for clarity - -========= Add initialization of icemask & snow_persistence; change - initialization of glc_topo and h2osno -M models/lnd/clm/src/clm4_5/main/initColdMod.F90 - -========= Add l2g_scale_type = natveg -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 - -========= Fix QSNWCPICE_NODYNLNDUSE, add l2g_scale_type for QICE & related fields, add - SNOW_PERSISTENCE and ICE_MASK, change _FORC fields to include elevation class 0 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 - -========= Get rid of associate statement that caused problems with some compilers -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 - -========= Track old col%active values, needed for initializing new columns -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynPriorWeightsMod.F90 - -========= Moved most functionality to subgridWeightsMod.F90 (now just a small - wrapper to some of the stuff in subgridWeightsMod, whose main purpose - is to avoid a dependency of subgridWeightsMod on filterMod) -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Changes for unit tests: - (1) Update unit tests to use libraries for the clm source and csm_share source - (2) New unit test - (3) Make unit tests work with latest CLM trunk - (4) Point to real decompMod rather than mock -M models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90 -M models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90.in -M models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/spmdMod_mock.F90 -M models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/shr_sys_mod_mock.F90 -M models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/main/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/CMakeLists.txt -M models/lnd/clm/src/clm4_5/main/CMakeLists.txt -M models/lnd/clm/src/clm4_5/dyn_subgrid/CMakeLists.txt - -========= Add icemask & snow_persistence; remove unused glc_frac, glc_rofi & glc_rofl -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - -========= Minor changes to 'use' statements for the sake of breaking dependencies for unit tests -M models/lnd/clm/src/util_share/GetGlobalValuesMod.F90 -M models/lnd/clm/src/clm4_5/main/decompMod.F90 - -========= Changes to comments only -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/util_share/domainMod.F90 - -========= Remove no-longer-failing test, change failType of a test (it was RUN - rather than FAIL at least as far back as clm4_5_69) -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - regular tests - - NOTE: Most tests were done on bare_land_smb_n15_clm4_5_70, which did NOT - include r59820 (add a comma in histFileMod to fix a syntax error caught by - nag). After r59820, reran all goldbach_nag tests, plus one goldbach_pgi and - one goldbach_intel. - - yellowstone_intel: ok - yellowstone_pgi: ok - goldbach_nag: ok - goldbach_intel: ok - goldbach_pgi: ok - - component_gen_comp on yellowstone_intel & yellowstone_pgi: ok - -CLM tag used for the baseline comparisons: clm4_5_69 (clm4_5_68 for a few tests - with missing baselines in clm4_5_69) - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All IG compsets (i.e., GLC compsets) - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - New Climate - - Changes are: - - (1) All IG compsets (clm4.0 & clm4.5) change due to new CISM external - - (2) In addition, IG compsets with CLM4.5 change further due to: - (a) 2-way feedbacks (CLM updated to match CISM) - (b) downscaling done over vegetated landunits within the icemask - - (3) Also, the QSNWCPICE_NODYNLNDUSE history diagnostic field changes for - ALL CLM4.5 runs, due to fixing bug 1969. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_70 -Originator(s): muszala (Stefan Muszala) -Date: Fri Apr 18 08:24:44 MDT 2014 -One-line Summary: bring in SHR_ASSERT macros - -Purpose of changes: bring in SHR_ASSERT macros for Santos. - -Add: #include "shr_assert.h" to source files -Remove: use shr_assert_mod , only : shr_assert - -then replace "call shr_assert" with SHR_ASSERT_ALL when asserting more than one dim - -- call shr_assert((ubound(carr) == (/bounds%endc/)), errMsg(__FILE__, __LINE__)) -+ SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp/)), errMsg(__FILE__, __LINE__)) - -and use SHR_ASSERT when asserting one dimen - -- call shr_assert(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(__FILE__, __LINE__)) -+ SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(__FILE__, __LINE__)) - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Self, Santos, Sacks - -List any svn externals directories updated (csm_share, mct, etc.): - --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_140218 -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/branch_tags/arfs_tags/arfs_01_mach140218 - --scripts/ccsm_utils/CMake https://github.com/quantheory/CMake_Fortran_utils/tags/CMake_Fortran_utils_140109 -+scripts/ccsm_utils/CMake https://github.com/quantheory/CMake_Fortran_utils/tags/CMake_Fortran_utils_140403 - --models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_34 -+models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_37 - --models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_140303 -+models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_140416 - --models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_131231 -+models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/branch_tags/shr_assert_macro_tags/shr_assert_macro_n04_share3_140115 - --models/utils/mct https://github.com/quantheory/MCT/tags/compiler_fixes_n03_MCT_2.8.3 -+models/utils/mct https://github.com/quantheory/MCT/tags/compiler_fixes_n04_MCT_2.8.3 - --models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_8_9/pio -+models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_8_11/pio - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/DaylengthMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BandDiagonalMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90.in -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90.in -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90.in -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynPriorWeightsMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeophysMod.F90 - -M SVN_EXTERNAL_DIRECTORIES - -CLM testing: - -Tested with two sets of externals because: - -The old scripts do not allow any PGI tests to run while the new scripts have various issues -with ERI tests and selected PGI tests plus nag debug runs (fixed in a more recent machines tag). - -By running with two sets of externals, I am confident that the source mods for SHR_ASSERT are -working correctly. When CLM gets updates in scripts and machines, these will be updated in -later tags. - -I) Those included in this tag -II) Those that are a part of cesm1_3_alpha09b (only tested clm45). - - build-namelist tests: N/A - - regular tests: for (I) above: - - yellowstone_intel - OK - component_comp_gen - OK - goldbach_nag - OK - goldbach_intel - OK - - regular tests: for (II) above: - -1) Yellowstone + Intel : all ERI tests are completing ref1 and ref2 but die a silent death in the base case. Erik looks like you changed Testlists, so the two VIC tests might be expected. - ->>./cs.status.70Intel.yellowstone | grep -v CLM50 | grep -v PASS | grep -v tputcomp | grep -v ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay | grep -v ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay | grep -v ERS_Ld211_D_P112x1.f10_f10.ICNCROP -RUN ERI.f09_g16.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI.f10_f10.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI.f19_g16.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_D.T31_g37.ICLM45.yellowstone_intel.clm-SNICARFRC.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_D.f09_g16.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_D.f10_f10.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_D.f19_g16.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -RUN ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.GC.70Intel --- ref1 and ref2 run, then no output in non-ref run -FAIL ERS_D.f10_f10.ICLM45VIC.yellowstone_intel.clm-vrtlay.GC.70Intel.compare_hist.clm4_5_69 - 69 Comparing hist file with baseline hist file, /glade/scratch/muszala/ERS_D.f10_f10.ICLM45VIC.yellowstone_intel.clm-vrtlay.GC.70Intel/run/ERS_D.f10_f10.ICLM45VIC.yellowstone_intel.clm-vrtlay.GC.70Intel.cpl.hi.0001-01-12-00000 .nc /glade/p/cesmdata/cseg/ccsm_baselines/clm4_5_69/ERS_D.f10_f10.ICLM45VIC.yellowstone_intel.clm-vrtlay/cpl.hi.nc - 70 ncdump1 done - 71 ncdump2 done - 72 comparing split files x[a-z][a-z] - 73 xaa - 74 6979,6981c6979,6981 < 0.983149585541109, 0.972017300931466, 0.972017300784614, < 0.972017300929172, 0.964088275988772, 0.971373805810303, < 0.977583443108289, 0.983149585551217, 0.983149585568791, --- - 75 FAIL - 76 hist file comparison is FAIL -FAIL SMS.f19_g16.ICLM45VIC.yellowstone_intel.clm-default.GC.70Intel.compare_hist.clm4_5_69 - 60 /glade/u/spooldir/1397689222.575650.shell: Storing new baseline in /glade/p/cesmdata/cseg/ccsm_baselines/clm4_5_70/SMS.f19_g16.ICLM45VIC.yellowstone_intel.clm-default - 61 Comparing hist file with baseline hist file, /glade/scratch/muszala/SMS.f19_g16.ICLM45VIC.yellowstone_intel.clm-default.GC.70Intel/run/SMS.f19_g16.ICLM45VIC.yellowstone_intel.clm- default.GC.70Intel.cpl.hi.0001-01-06-00000.n c /glade/p/cesmdata/cseg/ccsm_baselines/clm4_5_69/SMS.f19_g16.ICLM45VIC.yellowstone_intel.clm-default/cpl.hi.nc - 62 ncdump1 done - 63 ncdump2 done - 64 comparing split files x[a-z][a-z] - 65 xad - 66 18300c18300 < 0.983410370293909, 0.984052369383093, 0.979227772964994, --- > 0.983410370293909, 0.984052369383093, 0.979228345951215, 18341,18350c18341,18350 - 67 FAIL - 68 hist file comparison is FAIL - -2) Goldbach + NAG seems to have passed OK, _D runs have failed as expected. The reporting is messed up...ie., TestStatus.out look OK, but TestStatus does not. - ->> ./cs.status.70nag.goldbach | grep -v CLM50 | grep -v PASS | grep -v tputcomp | grep -v _D -FAIL ERI.f10_f10.ICLM45BGC.goldbach_nag.clm-reduceOutput.GC.70nag ---look at /scratch/cluster/muszala/tests/ERI.f10_f10.ICLM45BGC.goldbach_nag.clm-reduceOutput.GC.70nag/TestStatus.out and there is no FAIL -FAIL ERI.f19_g16.ICLM45BGC.goldbach_nag.clm-reduceOutput.GC.70nag ---/scratch/cluster/muszala/tests/ERI.f19_g16.ICLM45BGC.goldbach_nag.clm-reduceOutput.GC.70nag and there is no FAIL - -3) Goldbach + Intel - these look all like passes to me: see /scratch/cluster/muszala/tests/*/TestStatus.out - ->> ./cs.status.70intel.goldbach | grep -v CLM50 | grep -v PASS | grep -v tputcomp -FAIL ERI.f10_f10.ICLM45BGC.goldbach_intel.clm-reduceOutput.GC.70intel --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI.f19_g16.ICLM45BGC.goldbach_intel.clm-reduceOutput.GC.70intel --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI_D.T31_g37.I1850CLM45.goldbach_intel.clm-reduceOutput.GC.70intel --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI_D.f10_f10.ICLM45BGC.goldbach_intel.clm-reduceOutput.GC.70intel --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI_D.f19_g16.ICLM45BGC.goldbach_intel.clm-reduceOutput.GC.70intel --- Shows FAIL but PASSes in TestStatus.out - -4) Goldbach + PGI - some are indicating FAIL with TestStatus.out shows PASSes, others are straight out FAILs - -./cs.status.70pgi.goldbach | grep -v CLM50 | grep -v PASS | grep -v tputcomp | grep -v SMS_Ly1.f19_g16.ICLM45BGCCROP.frankfurt_pgi -FAIL ERI.f10_f10.ICLM45BGC.goldbach_pgi.clm-reduceOutput.GC.70pgi --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI.f19_g16.ICLM45BGC.goldbach_pgi.clm-reduceOutput.GC.70pgi --- ref1 fail: - 22 g005.cgd.ucar.edu - daemon did not report back when launched - 23 g006.cgd.ucar.edu - daemon did not report back when launched - 24 g009.cgd.ucar.edu - daemon did not report back when launched - 25 /usr/mpi/pgi/openmpi-1.4.3-qlc/bin/orted: error while loading shared libraries: libpgc.so: cannot open shared object file: No such file or directory -FAIL ERI_D.f10_f10.ICLM45BGC.goldbach_pgi.clm-reduceOutput.GC.70pgi --- Shows FAIL but PASSes in TestStatus.out -FAIL ERI_D.f19_g16.ICLM45.goldbach_pgi.clm-reduceOutput.GC.70pgi --- ref1 fail: - 1 /usr/mpi/pgi/openmpi-1.4.3-qlc/bin/orted: error while loading shared libraries: libpgc.so: cannot open shared object file: No such file or directory - 2 /usr/mpi/pgi/openmpi-1.4.3-qlc/bin/orted: error while loading shared libraries: libpgc.so: cannot open shared object file: No such file or directory - 3 /usr/mpi/pgi/openmpi-1.4.3-qlc/bin/orted: error while loading shared libraries: libpgc.so: cannot open shared object file: No such file or directory - 4 -------------------------------------------------------------------------- - 5 A daemon (pid 29755) died unexpectedly with status 127 while attempting -FAIL ERI_D.f19_g16.ICLM45BGC.goldbach_pgi.clm-reduceOutput.GC.70pgi --- ref1 fail: - 23 g021.cgd.ucar.edu - daemon did not report back when launched - 24 g022.cgd.ucar.edu - daemon did not report back when launched - 25 g023.cgd.ucar.edu - daemon did not report back when launched - 26 /usr/mpi/pgi/openmpi-1.4.3-qlc/bin/orted: error while loading shared libraries: libpgc.so: cannot open shared object file: No such file or directory -FAIL SMS_Ld5.f19_g16.IRCP45CLM45BGC.goldbach_pgi.clm-decStart.GC.70pgi --- ERROR in /var/spool/torque/mom_priv/jobs/19500.goldbach.cgd.ucar.edu.SC: file /fs/cgd/csm/ccsm_baselines/clm4_5_69/SMS_Ld5.f19_g16.IRCP45CLM45BGC.goldbach_pgi.clm-decStart/cpl.hi.nc does not exist - -CLM tag used for the baseline comparisons: clm4_5_69 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_69 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Tue Mar 18 21:12:34 MDT 2014 -One-line Summary: start unit testing build-namelist - -Purpose of changes: start doing unit testing on construction of the clm namelist. -This involved moving the contents of build-namelist into CLMBuildNamelist.pm and -bringing in perl infrastructure to supplement Test::More. Initial test suites are -implented for several name list variables. - -Requirements for tag: N/A - -Test level of tag: regular, build_namelist - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, clm-cmt - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: - - models/lnd/clm/bld: - CLMBuildNamelist.pm - contents of build-namelist - test_build_namelist/perl5lib/* - CPAN modules needed for unit testing - test_build_namelist/t/input/* - mock input files for build-namelist tests - test_build_namelist/t/template_test_XXX.pm - template for new tests - test_build_namelist/t/test_*.pm - unit tests - test_build_namelist/test_build_namelist.pl - unit test driver - test_build_namelist/README - -List all existing files that have been modified, and describe the changes: - - models/lnd/clm/bld: - build-namelist - moved contents into CLMBuildNamelist.pm, now just a driver calling main function. - - -CLM testing: - - build-namelist tests: - - yellowstone - OK new and existing generate tests - goldbach - OK new and existing generate tests - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - goldbach_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: N/A - - short tests (aux_clm_short): - - yellowstone_intel - OK - yellowstone_pgi - OK - - tools testing: N/A - -CLM tag used for the baseline comparisons: clm4_5_68 - -Changes answers relative to baseline: No - - -=============================================================== -=============================================================== -Tag name: clm4_5_68 -Originator(s): erik (Erik) -Date: Fri Mar 7 16:43:23 MST 2014 -One-line Summary: Update scripts to version that turns on transient CO2 streams for - transient compsets, and update CISM (changes answers) - -Purpose of changes: - -Bring in the scripts version that by default had transient CO2 for any transient -compsets. You can still turn it off by setting DATM_CO2_TSERIES=FALSE in env_run.xml. -Also bring in the latest CISM version that has answer changes for any IG compsets. -It fixes fields sent from CISM to the coupler (fixes an exact restart problem). - -Requirements for tag: - update scripts and CISM, transient and IG compsets have different answers - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 979 (adding CO2 streams) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - scripts to scripts4_140305 - cism to cism1_140303 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: None - -CLM testing: - - build-namelist tests: - - yellowstone yes - - regular tests (aux_clm): - - yellowstone_intel yes - yellowstone_pgi yes - goldbach_nag yes - goldbach_pgi yes - goldbach_intel yes - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel yes - yellowstone_pgi yes - - tools testing: None - -CLM tag used for the baseline comparisons: clm4_5_67 - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers: - - what code configurations: transient and IG compsets - - what platforms/compilers: all - - nature of change: larger than roundoff - -=============================================================== -=============================================================== -Tag name: clm4_5_67 -Originator(s): mvertens -Date: Thu Mar 6 16:53:23 MST 2014 -One-line Summary: removed initSurfAlb as part of the initialization - -Purpose of changes: removed the call to initSurfAlb as well as part of - the initialization and also removed the routine from the clm4.5 - code base - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): None - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -M bld/namelist_files/namelist_defaults_clm4_5.xml - - clmi.ICRUCLM45BGCCROPmp24.0241-01-01.10x15_USGS_simyr2000_c140111.nc had not - in fact been created - this effected the PEM test in the goldbach clm45 test suite - - the default namelist has not been backed up to the original - clmi.ICRUCLM45BGCCROPmp24.0241-01-01.10x15_USGS_simyr2000_c131028.nc - for now - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: mvertens - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -M src/clm4_5/biogeochem/ch4InitMod.F90 - - removal of code block that is no longer needed due to removal of initSurfAlb - (this had already been commented out in clm4_5_66) - -M src/clm4_5/main/initInterp.F90 - - minor bug fix the turn off spval by default for nonactive points - -D src/clm4_5/main/initSurfAlbMod.F90 -M src/clm4_5/main/clm_initializeMod.F90 - - removal of call initSurfAlb (main purpose of this tag) - - removal of code to upgrade old initial data files to have new metadata - a new scheme should be put in place with a namelist option to take clm4.5 - restart datasets that have been created prior to the introduction of initInterp - and introduce the new metadata at run time - -M src/clm4_5/main/initColdMod.F90 - - had to introduce setting values for the following variables in order to remove - call to initSurfAlb - cps%albgrd_pur(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgri_pur(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgrd_bc(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgri_bc(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgrd_oc(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgri_oc(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgrd_dst(bounds%begc:bounds%endc,:) = 0.2_r8 - cps%albgri_dst(bounds%begc:bounds%endc,:) = 0.2_r8 - -M src/clm4_5/main/clm_driver.F90 - - just comments - -CLM testing: - - regular tests (aux_clm): OK means only failures were expected - - yellowstone_intel : OK - yellowstone_pgi : OK - goldbach_nag : OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi : OK - -CLM tag used for the baseline comparisons: clm4_5_66 - -Changes answers relative to baseline: some - for all compsets where - finidat is set to blank, then answers will change relative to baseline - - for all compsets wehre finidat is pointing to a dataset, answers will be bfb - compared to baseline - -=============================================================== -=============================================================== -Tag name: clm4_5_66 -Originator(s): mvertens -Date: Mon Mar 3 10:50:24 MST 2014 -One-line Summary: refactoring of initialization and introduction of run-time finidat interpolation - -Purpose of changes: refactoring of initialization and introduction of run-time finidat interpolation - -Completely rewrote clm_initialize to leverage new initialization scheme -In the new scheme, cold start initialization is ALWAYS called and values -are overwritten by either an appropriate finidat file OR by calling -finidat_interp to interplate finidat to the output resolution/mask. - -Requirements for tag: - -Test level of tag: regular, short, tools, build_namelist, doc - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - - 1930 (MEGAN does not work correctly with prognostic crops on) - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - - NONE - -Describe any changes made to the namelist: - - - ALL clm4.5 finidat files have been updated to contain new metadata that will enable the - online interpinic to operate on them. The time stamp on all new files has the date c140111. - The files have been created so that they are bit-for-bit compatible with the code base. - - The following new namelist variables have been added to the namelist_definition_clm4_5.xml file - - finidat_interp_source - if non-blank, then interpinic will be called to interpolate finidat_interp_source and - create output file specified by finidat_interp_dest. - - finidat_interp_dest - if finidat_interp_source is set to non-blank, then interpinic will be called - to interpolate finidat_interp_source and create output file finidat_interp_dest - -List any changes to the defaults for the boundary datasets: - - None - -Describe any substantial timing or memory changes: - - None - -Code reviewed by: - - mvertens, sacks - -List any svn externals directories updated (csm_share, mct, etc.): - - None - -List all files eliminated: - - The following file pairs were renamed and subsequently extensively modfified - Summaries of the modifications are below: - - ------- New module initColdMod.F90 contains calls to initialize the cold start for - ------- the entire model. The cold start values are then overwritten with either - ------- an finidat file or an interpolation file using finidat_interp_source. -D models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -A models/lnd/clm/src/clm4_5/main/initColdMod.F90 - - ------- Renamed file -D models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -A models/lnd/clm/src/clm4_5/biogeochem/SatellitePhenologyMod.F90 - - ------- Renamed file -D models/lnd/clm/src/clm4_5/biogeochem/CNDVEcosystemDynIniMod.F90 -A models/lnd/clm/src/clm4_5/biogeochem/CNDVInitMod.F90 - - ------- Renamed file, removed initch4, merged routines initTimeConst_ch4 and makearbinit_ch4 - --------into new routine initColdCH4.Also removed almost all associate statements - ------- (but kept the intput/output documentation) and used the explicit clmtype definition. -D models/lnd/clm/src/clm4_5/biogeochem/initch4Mod.F90 -A models/lnd/clm/src/clm4_5/biogeochem/ch4InitMod.F90 - - ------- Renamed and combined files - ------- Migrated all CN cold start initialization for both soil and - ------- special landuntis into new routine initColdCN in new module biogeochem/CNInitMod. -D models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -D models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -A models/lnd/clm/src/clm4_5/biogeochem/CNInitMod.F90 - - ------- Renamed file and merged routines makearbinit and snow_depth2Lake - ------- into one new routine initColdSlake. Also removed almost all associate - ------- statements (but kept the intput/output documentation) and used the explict - ------- clmtype definition. -A models/lnd/clm/src/clm4_5/biogeophys/SLakeInitMod.F90 -D models/lnd/clm/src/clm4_5/biogeophys/initSlakeMod.F90 - - ------- Renamed iniTimeConst, removed associate statements but kept - ------- the documentation of input/output and also explictly listed - ------- full clmtype variables -D models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -A models/lnd/clm/src/clm4_5/main/initTimeConstMod.F90 - -List all files added and what they do: - - ------- New run-time interpolation of input finidat to target resolution/mask - ------- using the new namelist variables finidat_interp_source and finidat_interp_dest -A models/lnd/clm/src/clm4_5/main/initInterp.F90 - - ------- Obtain/write global index space value for target point at given clmlevel -A models/lnd/clm/src/util_share/GetGlobalValuesMod.F90 - -List all existing files that have been modified, and describe the changes: - - ------- In all files, unless otherwise noted added call to errMsg(__FILE__,__LINE__) - ------- and in some cases optional arguments of decomp_index and clmlevel also added - - ------- See documentation for namelist changes above -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - ------ Overloaded endrun subroutine to also print out global index infromation by - ------ calling new GetGlobalWrite routine if optional arguments decomp_index and - ------ clm_level are passed in -M models/lnd/clm/src/util_share/abortutils.F90 - - ------- Replaced missing value setting of huge(1) with ispval -M models/lnd/clm/src/util_share/accumulMod.F90 - - ------- Replaced endrun with call to shr_sys_abort -M models/lnd/clm/src/util_share/domainMod.F90 - - ------- Added in missing values and special values for variable metadata - this - ------- is needed needed by initInterp -M models/lnd/clm/src/util_share/restUtilMod.F90 -M models/lnd/clm/src/util_share/restUtilMod.F90.in - - ------- Completely rewrote clm_initialize to leverage new initialization scheme - ------- In the new scheme, cold start initialization is ALWAYS called and values - ------- are overwritten by either an appropriate finidat file OR by calling - ------- finidat_interp to interplate finidat to the output resolution/mask. -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - - ------- Added new metadata and variables - include global indices for parent subgrid - ------- level(s) (i.e. column, landunit and gridcell for pfts) -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 - - ------- Moved view_factor routine and associated variable from a separate routine - ------- in UrbanMod to part of the initTimeConstUrban subroutine in UrbanInitMod -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 - - ------- Removed vf_xx variables from restart file and also - ------- removed do_initsurfalb variable -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 - - ------- In all files, unless otherwise noted added call to errMsg(__FILE__,__LINE__) - ------- and in some cases optional arguments of decomp_index and clmlevel also added -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90.in -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/MEGANFactorsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4RestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSharedParamsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -M models/lnd/clm/src/clm4_5/main/decompInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/ndepStreamMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/surfrdUtilsMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/main/decompMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeochemMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynPriorWeightsMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90.in - -CLM testing: - - regular tests (aux_clm): - - NOTE1: that all namelists compares where finidat was not blank will fail - since - new finidat files are used that have new metadata - BUT - the results are still bfb - - yellowstone_intel - OK - expected failures: - ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay - ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay - - yellowstone_pgi - OK - expected failures: - ERH_D.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-default - ERS.f09_g16.ICLM45VIC.yellowstone_pgi.clm-vrtlay - - goldbach_nag - OK - - goldbach_intel - OK - - goldbach_pgi - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - NOTE1: all .h1 tests fail since there are new meta data fields for - cols1d_active, pfts1d_active - and FILLDIFF is different - - yellowstone_intel OK - yellowstone_pgi OK - -CLM tag used for the baseline comparisons: clm4_5_65 - -Changes answers relative to baseline: No - bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_5_65 -Originator(s): mvertens (Mariana Vertenstein,UCAR/CSEG,303-497-1349) -Date: Tue Feb 25 13:45:38 MST 2014 -One-line Summary: Turn off MEGAN vocs when crops is running - -Purpose of changes: - -MEGAN does not currently work with prognostic crops. It needs a table of pft-specific values, and that this table has only been created for the 16 "standard" (non-crop) pfts. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1930 (MEGAN does not work correctly with prognostic crops on) - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.):s - -scripts4_140214a -> scripts4_140220 -Machines_140214 -> Machines_140218 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -======== - Add a new logical variable - use_voc - that is true by default but - is set to false if prognostic cop is activated -======== - -M src/clm4_5/main/clm_initializeMod.F90 -M src/clm4_5/main/clm_atmlnd.F90 -M src/clm4_5/main/controlMod.F90 -M src/clm4_5/main/clm_varctl.F90 -M src/clm4_5/main/clm_driver.F90 -M src/clm4_5/main/histFldsMod.F90 -M src/clm4_0/main/clm_varctl.F90 -M src/cpl/clm_cpl_indices.F90 - - -CLM testing: - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - expected failures - ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay - ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay - expected non-bfb failures due to VIC/CROP changes - ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default - ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel - SMS_Ly1.f19_g16.ICLM45BGCCROP.yellowstone_intel - - yellowstone_pgi - OK - expected failures - ERH_D.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-default - ERS.f09_g16.ICLM45VIC.yellowstone_pgi.clm-vrtlay - - goldbach_nag - OK - expected non-bfb failures due to VIC/CROP changes - ERS_D.f10_f10.ICLM45BGCCROP.goldbach_nag.clm-allActive - ERS_Lm3.1x1_numaIA.ICLM45BGCCROP.goldbach_nag - - goldbach_intel - OK - expected non-bfb failures due to VIC/CROP changes - ERS_Ly20.1x1_numaIA.ICLM45BGCDVCROP.goldbach_intel.clm-crop - PEM.f10_f10.ICLM45BGCCROP.goldbach_intel.clm-crop - - goldbach_pgi - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - - yellowstone_pgi - OK - -CLM tag used for the baseline comparisons: clm4_5_64 - -Changes answers relative to baseline: No - except for VOC fields when - prognostic crop is on (this is a diagnostic only and does not impact - the answers) - -=============================================================== -=============================================================== -Tag name: clm4_5_64 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Wed Feb 19 09:19:40 MST 2014 -One-line Summary: fix and clean ncdio_pio.F90.in. clean clm_time_manager. update externals. - -Purpose of changes: - -Note 1: This is the last tag that is tested on frankfurt; new tests are on goldbach. - -Note 2: Pts. mode is being deprecated for science use as of this tag. Use PTCLM. Pts. mode - remains in place in our test system. - -Note 3: There is an unresolved problem with higher resolutions when dov2xy is .false. and we are - using pnetcdf. Please see bug 1730. - -ncdio_pio.F90.in - fix initialization problem where count and start are sometimes used without - being set. -clm_time_manager - clean out unused variables -update externals to support ED compsets, move pts. mode tests to testmods. Update Machines and - pio to address bug 1730. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.):s - -scripts4_140209 -> scripts4_140214a -Machines_140213 -> Machines_140214 -pio1_8_8 -> pio1_8_9 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/util_share/clm_time_manager.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90.in - -CLM testing: - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - Expected due to change in pts. mode: - BFAIL SMS.f45_f45.I.yellowstone_intel.clm-ptsRLA.GC.64Intel.compare_hist.clm4_5_63 - BFAIL SMS.f45_f45.I.yellowstone_intel.clm-ptsROA.GC.64Intel.compare_hist.clm4_5_63 - BFAIL SMS_D_Mmpi-serial.f45_f45.ICLM45.yellowstone_intel.clm-ptsRLA.GC.64Intel.compare_hist.clm4_5_63 - BFAIL SMS_Mmpi-serial.f45_f45.ICLM45.yellowstone_intel.clm-ptsRLA.GC.64Intel.compare_hist.clm4_5_63 - Expected due to change in pio_buffer_size_limit - FAIL ERI.f09_g16.ICLM45BGC.yellowstone_intel.GC.64Intel.nlcomp - FAIL ERI_D.f09_g16.ICLM45BGC.yellowstone_intel.GC.64Intel.nlcomp - New Failure for VIC but due to dov2xy problem - ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay - - yellowstone_pgi - OK - Expected due to change in pts. mode: - BFAIL SMS.f45_f45.I.yellowstone_pgi.clm-ptsRLB.GC.64Pgi.compare_hist.clm4_5_63 - BFAIL SMS_D_Mmpi-serial.f45_f45.ICLM45.yellowstone_pgi.clm-ptsRLA.GC.64Pgi.compare_hist.clm4_5_63 - BFAIL SMS_Mmpi-serial.f45_f45.ICLM45.yellowstone_pgi.clm-ptsRLA.GC.64Pgi.compare_hist.clm4_5_63 - Expected due to change in pio_buffer_size_limit - FAIL ERI.f09_g16.I1850CRUCLM45BGC.yellowstone_pgi.GC.64Pgi.nlcomp - FAIL ERI.f09_g16.ICLM45BGC.yellowstone_pgi.GC.64Pgi.nlcomp - FAIL ERI_D.f09_g16.ICLM45BGC.yellowstone_pgi.GC.64Pgi.nlcomp - FAIL ERS_D.hcru_hcru.ICRUCLM45BGC.yellowstone_pgi.GC.64Pgi.nlcomp - FAIL ERS_D.hcru_hcru.ICRUCN.yellowstone_pgi.GC.64Pgi.nlcomp - New Failure for VIC but due to dov2xy problem - ERS.f09_g16.ICLM45VIC.yellowstone_pgi.clm-vrtlay - - frankfurt_nag - OK - Expected due to change in pts. mode: - BFAIL SMS_D_Mmpi-serial.f45_f45.ICLM45.frankfurt_nag.clm-ptsRLA.GC.64Nag.compare_hist.clm4_5_63 - BFAIL SMS_Mmpi-serial.f45_f45.ICLM45.frankfurt_nag.clm-ptsRLA.GC.64Nag.compare_hist.clm4_5_63 - BFAIL SMS_Mmpich.f45_f45.ICLM45.frankfurt_nag.clm-ptsRLA.GC.64Nag.compare_hist.clm4_5_63 - - frankfurt_intel - OK - - frankfurt_pgi - OK - Expected due to change in pts. mode: - BFAIL SMS.f45_f45.ICLM45.frankfurt_pgi.clm-ptsRLB.GC.64Pgi.compare_hist.clm4_5_63 - BFAIL SMS.f45_f45.ICLM45.frankfurt_pgi.clm-ptsROA.GC.64Pgi.compare_hist.clm4_5_63 - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_63 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_63 -Originator(s): sacks (sacks) -Date: Fri Feb 14 07:22:37 MST 2014 -One-line Summary: add some code needed for dynamic landunits; activate 0-weight veg landunit sometimes - -Purpose of changes: - -(1) Add grc%landunit_indices(:,:), so you can find a given l index if you have - the g index (this will be needed in a few places for dynamic landunits) - -(2) Add code to update landunit weights; currently has no effect because - landunit areas don't change yet - -(3) Refactor logic in the is_active_X routines, and add logic to activate a - virtual vegetated landunit under some conditions (needed for coupling with - CISM, and helpful for dynamic landunits). Specifically, we activate a - virtual (0-weight) vegetated landunit for any grid cell that is NOT 100% - istice (i.e., standard glacier) (we exclude grid cells that are 100% istice - to avoid the performance penalty, because these aren't used for coupling - with CISM, and the only way this glacier can retreat is if another landunit, - like crop, increases there, which will rarely happen). - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: - - Performance about 6% worse for clm4.5 IG runs at f09 (i.e., with glcmec), - because of the new virtual vegetated columns. Not investigated for f19 or - T31, but probably a similar performance hit. - - There were also a few memcomp failures - -Code reviewed by: quick review by mvertens - -List any svn externals directories updated (csm_share, mct, etc.): - - Machines: Machines_140207a -> Machines_140213 (to fix pgi on yellowstone) - -List all files eliminated: - -========= Remove "IN_PROGRESS" -D models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90.IN_PROGRESS - -List all files added and what they do: - -========= Add code to update landunit weights; currently has no effect because - landunit areas don't change yet -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90 - -========= Add unit tests for dynLandunitAreaMod -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynLandunitArea_test/test_update_landunit_weights.pf - -List all existing files that have been modified, and describe the changes: - -========= Add grc%landunit_indices(:,:), so you can find a given l index if you - have the g index (this will be needed in a few places for dynamic - landunits) -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 - - just add a comment -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -========= Call new code in dynLandunitAreaMod -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 - -========= Refactor logic in the is_active_X routines, and add logic to activate - a virtual vegetated landunit under some conditions (needed for - coupling with CISM, and helpful for dynamic landunits) -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Add unit tests for dynLandunitAreaMod -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/CMakeLists.txt -M models/lnd/clm/src/clm4_5/dyn_subgrid/CMakeLists.txt -M models/lnd/clm/src/clm4_5/main/CMakeLists.txt - - -CLM testing: - - regular tests (aux_clm): - - NOTE: frankfurt intel & pgi ran on a slightly older version of the branch - (dynlu_weight_updates_glacier_n05_clm4_5_62, which did not include some - final minor refactoring to reweightMod); frankfurt nag & yellowstone - intel/pgi ran on the final version - - yellowstone_intel: ok - yellowstone_pgi: ok - frankfurt_intel: ok - frankfurt_pgi: ok - frankfurt_nag: ok - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: ok - yellowstone_pgi: ok - - A bunch of expected failures in h1 (1-d) hist files, due to the newly-active - points. - - - Also: Did a manual test to show that answers are the same for virtual - vegetated columns as they would be if the column had non-zero weight (to - ensure there are no dependencies on whether a column's weight is non-zero). - -CLM tag used for the baseline comparisons: clm4_5_62 for yellowstone (but -clm4_5_61 for component_gen_comp); clm4_5_61 for frankfurt - -Changes answers relative to baseline: NO - - However, note diffs in 1-d hist files due to newly-active points. - -=============================================================== -=============================================================== -Tag name: clm4_5_62 -Originator(s): erik (Erik) -Date: Mon Feb 10 04:16:07 MST 2014 -One-line Summary: Get PTCLM working robustly, US-UMB test working, add CO2 streams to datm, add more - consistency testing between compsets and user settings - -Purpose of changes: - -US-UMB fix in scripts and datm update. Fix so build-namelist will abort if there is an inconsistency with CLM_BLDNML_OPTS -and user_nl_clm. Add CO2 streams as a built-in option to datm. Turn CO2 streams on with the DATM_CO2_TSERIES env_run.xml -variable. Can be set to: none,20tr,rcp2.6,rcp4.5,rcp6.0,rcp8.5, by default is none. - -Requirements for tag: - - datm -- CO2 update, streams improvements - Fix build-namelist consistency issues - Fix bug 1847 -- end1d in hist for clm4_0 - Add envxml_dir - check that cndv and fpftdyn aren't on the same time - Add PTCLM tests to test_Driver - Add PTCLM test system in - Make PTCLM more robust - -Test level of tag: regular, tools, build_namelist - -Bugs fixed (include bugzilla ID): - 1918 -- sort options in build-namelist - 1917 -- remove WRF resolutions - 1903 -- buildtools fails for PTCLM - 1900 -- Remove BUILDHEAT and Qanth from output for CLM testing - 1896 -- CLM build-namelist should abort if use_cndv AND fpftdyn are set. - 1881 -- Add envxml_casedir option to CLM build-namelist - 1879 -- need error triggered when use_crop and CLM_BLDNL_OPTS are not consistent - 1847 -- 'histfilemod_mp_hist_restart_ncd_$END1D' is being used without being defined - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: frankfurt switched out for goldbach - -Describe any changes made to the namelist: CLM build-namelist changed to ensure user changes don't conflict with - command-line options - -List any changes to the defaults for the boundary datasets: remove WRF datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts to scripts4_140209 - Machines to Machines_140207a - datm to datm8_140114 - pio to pio1_8_8 - cprnc to cprnc_140203 - - PTCLM to PTCLM2_140204 - -List all files eliminated: move frankfurt to goldbach - -D models/lnd/clm/test/tools/tests_posttag_frankfurt_nompi - -List all files added and what they do: goldbach, and add PTCLM tools testing - -A + models/lnd/clm/test/tools/tests_posttag_goldbach_nompi -A models/lnd/clm/test/tools/TCBscripttools.sh ------------ Add script to run buildtools for PTCLM -A models/lnd/clm/test/tools/config_files/PTCLM__s -------- Config for PTCLM -A models/lnd/clm/test/tools/nl_files/PTCLM_USUMB_clm4_0 -A models/lnd/clm/test/tools/nl_files/PTCLM_USUMB_clm4_5 -A models/lnd/clm/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 -A models/lnd/clm/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 -A models/lnd/clm/bld/unit_testers/myuser_nl_clm --- New build-namelist tests -A models/lnd/clm/bld/unit_testers/env_run.xm - - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/build-namelist ----- Sort options, add -envxml_dir option, check that user hasn't contradicted themself - with CLM_BLDNML_OPTS and user_nl_clm, remove options: -noio, -nofire, -snicar_frc, -vsoilc, -exlaklayers, -clm4me - use Cwd::abs_path and remove home-grown absolute_path, add some more docmentation and comments, redo some ordering and names - M models/lnd/clm/bld/clm.buildnml.csh --- add -envxml_dir so will use env_*.xml files to expand env variables - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml --- Add irrig setting, remove WRF files - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Add irrig, bgc_spinup, and bgc_mode - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml -- Remove WRF resolutions: us20, wus12 - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml - Remove WRF resolutions - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Remove WRF resolutions, add bgc_mode - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl ----------- Add a bunch of new tests - M models/lnd/clm/bld/user_nl_clm ----- make note of variables that should be done by command-line build-namelist options - - M models/lnd/clm/src/clm4_0/main/histFileMod.F90 --- Fix bug 1847 - ------------- Add PTCLM testing - M models/lnd/clm/test/tools/README.testnames - M models/lnd/clm/test/tools/test_driver.sh ------ Remove bluefire, lynx, mirage, jaguarpf -- switch frankfurt for goldbach - M models/lnd/clm/test/tools/TBLscript_tools.sh - M models/lnd/clm/test/tools/TSMscript_tools.sh - M models/lnd/clm/test/tools/input_tests_master - M models/lnd/clm/test/tools/tests_posttag_nompi_regression - M models/lnd/clm/test/tools/tests_posttag_yong - M models/lnd/clm/test/tools/tests_pretag_yellowstone_nompi - ------------- Don't die if debug and files were not created. - M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl - M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - -CLM testing: regular, build-namelist, tools - - build-namelist tests: - - yellowstone - - regular tests (aux_clm): - - yellowstone_intel - yellowstone_pgi - goldbach_nag - edison_intel - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - yellowstone_pgi - - tools testing: - - yellowstone interactive - goldbach interactive - -CLM tag used for the baseline comparisons: clm4_5_61 - -Changes answers relative to baseline: None, bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_5_61 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Tue Feb 4 09:45:43 MST 2014 -One-line Summary: add 3-d snow history fields; continue harvest past end of pftdyn timeseries - -Purpose of changes: - - There are two separate sets of changes in this tag; both apply just to CLM4.5: - - (1) Addition of 3-d snow history fields: These history fields (inactive by - default) provide diagnostics for each layer of the snow pack. This - involved adding some additional history file infrastructure to handle - the variable number of snow pack layers. See the new section in the - user's guide (custom.xml) for a description of how these new history - fields work, and how to interpret them. - - (2) Change the harvest logic for transient runs that extend past the end of - the pftdyn dataset: Until now, harvest was set to 0 when you passed the - end of the pftdyn dataset. With this tag, this behavior is changed, so - that for all years past the end of the pftdyn dataset, harvest rates - remain fixed at the last year's value. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: - - Memory use increases slightly, as observed by memcomp failures for a few - tests. This is presumably due to new fields in clmtype. - -Code reviewed by: Erik reviewed changes for the 3-d snow history fields. - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Add 3-d snow history fields -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/doc/UsersGuide/custom.xml - -========= Add a new snow diagnostic, sub_surf_abs_SW -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 - -========= Continue harvest past end of pftdyn time series -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/test_dynTimeInfo.pf - - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: ok - yellowstone_pgi: ok - frankfurt_intel: ok - frankfurt_pgi: ok - frankfurt_nag: ok - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: ok - yellowstone_pgi: ok - - Only failures are these expected failures (see notes on answer changes - below): - - FAIL SMS_Ly3.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetLate.compare_hist.clm4_5_60.clm2.h0 - FAIL SMS_Ly5.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetMid.compare_hist.clm4_5_60.clm2.h0 - FAIL SMS_Ly8.1x1_tropicAtl.I20TRCLM45BGC.yellowstone_intel.clm-tropicAtl_subsetEarly.compare_hist.clm4_5_60.clm2.h0 - -CLM tag used for the baseline comparisons: clm4_5_60 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 transient runs that continue past the end of the pftdyn dataset - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - New climate: Harvest rates are now continued past the end of the pftdyn - dataset (staying fixed at their value from the last year), for the - remainder of the simulation. This leads to potentially large answer - changes for transient runs that continue past the end of the pftdyn - dataset. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_60 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Thu Jan 30 18:27:03 MST 2014 -One-line Summary: refactor build-namelist - -Purpose of changes: : break build-namelist into small unit-testable functions - instead of a single massive script. Use output functions to standardize - screen output for errors, warnings and messages so that results can be - automatically searched by scripts. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, Erik - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/build-namelist - major refactor described above - M models/lnd/clm/bld/namelist_files/namelist_defaults_overall.xml - fix incorrect comments - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl - minor updates to check new output style - -CLM testing: - - build-namelist tests: - - yellowstone - pass compare and generate with only xfails - frankfurt - not tested, CLM-CMT believes tests may be broken. - - regular tests (aux_clm): - - yellowstone_intel - ok - yellowstone_pgi - ok - frankfurt_intel - ok - frankfurt_pgi - ok - frankfurt_nag - ok - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - ok - yellowstone_pgi - ok - - short tests (aux_clm_short): - - yellowstone_intel - ok - - tools testing: N/A - -CLM tag used for the baseline comparisons: clm4_5_59 - -Changes answers relative to baseline: none, bit for bit - - -=============================================================== -=============================================================== -Tag name: clm4_5_59 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Wed Jan 22 15:04:12 MST 2014 -One-line Summary: use new get_curr_yearfrac function in clm_time_manager - -Purpose of changes: - - Use the new get_curr_yearfrac function in clm_time_manager in place of - dyn_time_weights. The reason is that, as Erik pointed out, dyn_time_weights - was out of place in dynUtilsMod, and really this functionality belongs in the - clm_time_manager module. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - -========= Made obsolete by get_curr_yearfrac in clm_time_manager -D models/lnd/clm/src/clm4_5/dyn_subgrid/dynUtilsMod.F90 -D models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/dynUtilsMod_mock.F90 - -List all files added and what they do: - -========= Mock out get_curr_yearfrac: return a fixed fraction -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/clm_time_manager_mock.F90 - -List all existing files that have been modified, and describe the changes: - -========= Fix get_curr_yearfrac to be real rather than integer -M models/lnd/clm/src/util_share/clm_time_manager.F90 - -========= Use get_curr_yearfrac instead of dyn_time_weights -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynCNDVMod.F90 -M models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90.in - -========= Update unit tests to pull in clm_time_manager (mock) rather than dynUtilsMod (mock) -M models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/CMakeLists.txt -M models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/CMakeLists.txt - - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: ok - yellowstone_pgi: ok - frankfurt_intel: ok - frankfurt_pgi: ok - frankfurt_nag: ok - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: ok - yellowstone_pgi: ok - -CLM tag used for the baseline comparisons: clm4_5_58 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45, either transient or with DV - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - roundoff - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Ran testing on an intermediate tag, where I computed the time weights in - both the old and new ways. I confirmed that the difference in time weights - (which is the only change in this tag) is always less than 1e-13. Actually, - this difference is always less than 2e-16, double-precision roundoff. - - Also examined cpl hist diffs for a few select tests. Diffs are generally - ~ 1e-6 after 5 days. - -=============================================================== -=============================================================== -Tag name: clm4_5_58 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Wed Jan 22 14:11:30 MST 2014 -One-line Summary: major refactor of transient pft code, in prep for dynamic landunits - -Purpose of changes: - -Major refactor of transient pft code, in prep for dynamic landunits. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1899 (harvest rates remain non-zero even after the end of the pftdyn dataset) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Erik; design reviewed by CLM-CMT - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: scripts4_140102 -> scripts4_140114 - Machines: Machines_131206b -> Machines_140107 - csm_share: share3_131226 -> share3_131231 - pio: pio1_8_3 -> pio1_8_6 - - CMake: New external added - -List all files eliminated: - -========= renamed to dynConsBiogeophysMod.F90 -D models/lnd/clm/src/clm4_5/main/dynlandMod.F90 - -========= renamed to dynpftFileMod.F90; much of the stuff in here moved to other - files in the dyn_subgrid directory -D models/lnd/clm/src/clm4_5/main/pftdynMod.F90 - -========= renamed -D models/lnd/clm/test/unit - -List all files added and what they do: - -========= Rename test/unit to test/unit_testers, and add unit tests for some of - the stuff in dyn_subgrid. This also involved adding some mocks - - particularly of ncdio_pio. -A models/lnd/clm/test/unit_testers/clm4_5/biogeophys/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test/test_daylength.pf -A models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/biogeophys/Daylength_test -A models/lnd/clm/test/unit_testers/clm4_5/biogeophys -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarShared.F90 -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarTimeInterp.pf -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/test_dynVarTimeUninterp.pf -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynVar_test -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/test_dynTimeInfo.pf -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/dynTimeInfo_test -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/dyn_subgrid -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_var.F90.in -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_pio_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/spmdMod_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/do_genf90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share/ncdio_pio_mock.F90.in -A models/lnd/clm/test/unit_testers/clm4_5/mock/util_share -A models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/shr_sys_mod_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock/csm_share -A models/lnd/clm/test/unit_testers/clm4_5/mock/main/decompMod_boundsTypeDecl.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/main/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock/main -A models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/dynFileMod_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/dynUtilsMod_mock.F90 -A models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock/dyn_subgrid -A models/lnd/clm/test/unit_testers/clm4_5/mock/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/mock -A models/lnd/clm/test/unit_testers/clm4_5/CMakeLists.txt -A models/lnd/clm/test/unit_testers/clm4_5/README -A models/lnd/clm/test/unit_testers/clm4_5 -A models/lnd/clm/test/unit_testers - -========= Make a new directory to hold all of the stuff related to dynamic - subgrid weights. Currently this means transient PFTs, but soon it will - also mean dynamic landunits. This includes stuff that used to be in - pftdynMod and dynlandMod, as well as a bit from clm_driver. I have - added a new driver for the dyn_subgrid stuff (dynSubgridDriverMod), - and pulled out much of the shared, lower-level functionality into new - modules (dynTimeInfoMod, dynFileMod, dynVarMod, dynVarTimeInterpMod, - dynVarTimeUninterpMod, dynUtilsMod [which will soon go away]). In - addition, I have separated the many routines in pftdynMod into - separate modules, each with a single, better-defined function. -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynTimeInfoMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynSubgridDriverMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynHarvestMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynFileMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeochemMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynPriorWeightsMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynpftFileMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynCNDVMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynConsBiogeophysMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarMod.F90.in -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeInterpMod.F90.in -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynLandunitAreaMod.F90.IN_PROGRESS -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynUtilsMod.F90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/dynVarTimeUninterpMod.F90.in -A models/lnd/clm/src/clm4_5/dyn_subgrid/CMakeLists.txt -A models/lnd/clm/src/clm4_5/dyn_subgrid - -========= script to generate files from their .in files using genf90 -A models/lnd/clm/src/clm4_5/dyn_subgrid/do_genf90 - - -========= move check_sums_equal_1 to a new module, partly to reduce dependencies - of unit tests, and partly because it is cleaner design to have it - outside of surfrdMod -A models/lnd/clm/src/clm4_5/main/surfrdUtilsMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Add dyn_subgrid directory -M models/lnd/clm/bld/configure - -========= Add get_curr_yearfrac function (currently broken, will be fixed in - next tag) -M models/lnd/clm/src/util_share/clm_time_manager.F90 - -========= Change type(file_desc_t) to class(file_desc_t); add 'only' clause to - use statements to allow compilation with pgi -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90.in - -========= Change 'use statement' for reworked dyn_subgrid code -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 - -========= Move surfrd_check_urban and surfrd_check_sums_equal_1 to more - appropriate places -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 - -========= Move some code into dynSubgridDriverMod -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - - also remove incorrect header comment - -========= Add compute_higher_order_weights routine -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Add unit testing support -M models/lnd/clm/src/clm4_5/main/CMakeLists.txt - - -========= Frankfurt-PGI tests now pass! -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - build-namelist tests: - - yellowstone: ok - - regular tests (aux_clm): - - yellowstone_intel: ok - yellowstone_pgi: ok - frankfurt_intel: ok - frankfurt_pgi: ok - frankfurt_nag: ok - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: ok - yellowstone_pgi: ok - -CLM tag used for the baseline comparisons: clm4_5_57 - -Changes answers relative to baseline: YES (very limited; see below) - - Can change answers due to the following: - - (1) Changes answers for harvest when a run starts inside the pftdyn timeseries - but extends beyond it, without an intervening restart (see bug 1899) - - (2) Could theoretically change answers for yellowstone-pgi or hopper-pgi due - to machines updates, but no changes showed up in the yellowstone test suite - -=============================================================== -=============================================================== -Tag name: clm4_5_57 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Tue Jan 7 14:17:04 MST 2014 -One-line Summary: change CNDV water conservation to use the pftdyn method - -Purpose of changes: - - For my dynamic landunit work, I was trying to reconcile what's going on with - prescribed transient PFTs (pftdyn) vs CNDV. The reason is that I'm trying to - set up an overall control flow for dynamic landunits, and you need to be able - to run either of these in conjunction with dynamic landunits. - - In doing this, I noticed that water conservation is handled differently for - pftdyn vs CNDV: - - For pftdyn, water conservation is done as described in section 21.2 of the - CLM4.5 tech note: water contents are summed before and after transition, and - the difference is put in the runoff term - - CNDV appears not to use this before & after difference. Instead, it does a - correction for canopy water in pftdynMod: pftdyn_wbal. - - For dynamic landunits, we're planning to use an approach like what is - currently done for pftdyn. I think it's going to be messy and confusing to - try to maintain the current CNDV approach when it's possible to have CNDV in - conjunction with dynamic landunits. - - Thus, I am changing CNDV to use the pftdyn approach to water conservation, - whether or not you are running with dynamic landunits. This will change - answers for CNDV/BGCDV cases in CLM4.5, though I expect the effects to be - small. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: erik; concept approved by Sam Levis - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Main changes are here; also minor (somewhat related) cleanup: fix some - section heading comments, add a timer (ndep_interp) - pulling out some - stuff that used to be (inappropriately) in the pftdynwts timer section -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -========= Remove a bunch of now-unneeded code, especially from pftdynMod -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 - - -CLM testing: - - NOTE: Most testing was done from tag cndv_water_conservation_n01_clm4_5_55 - - up-to-date with clm4_5_55, NOT clm4_5_56. I then updated to clm4_5_56 and - reran just the three tests that were run for that tag (see its ChangeLog - entry, below), with comparison to clm4_5_56. - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - -CLM tag used for the baseline comparisons: clm4_5_55 for most tests, clm4_5_56 -for three tests (see above note) - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 with DV (CNDV / BGCDV) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated, but expected to be larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_56 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Thu Jan 2 09:06:32 MST 2014 -One-line Summary: update scripts external to fix I20TRCLM45BGC compset - -Purpose of changes: update scripts external to fix I20TRCLM45BGC compset - -Requirements for tag: fix bug 1869 - -Test level of tag: limited (see below) - -Bugs fixed (include bugzilla ID): 1869 (I20TRCLM45BGC compset improperly defined) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: scripts4_131203 -> scripts4_140102 - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: none - -CLM testing: - - ONLY TESTED THE 3 AFFECTED TESTS from the yellowstone & frankfurt aux_clm test suites: - - PASS PET_P15x2_Lm13.f10_f10.I20TRCLM45BGC.yellowstone_pgi.clm-reduceOutput.GC.140102-060037 - PASS ERS_D.f10_f10.I20TRCLM45BGC.frankfurt_pgi.clm-decStart.GC.140102-060448 - PASS ERS_Mmpich.f10_f10.I20TRCLM45BGC.frankfurt_nag.clm-decStart.GC.140102-060608 - -CLM tag used for the baseline comparisons: clm4_5_55 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Only I20TRCLM45BGC compsets - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - New climate for this compset: correctly uses CLM4.5 instead of CLM4.0 code. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_55 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Dec 27 16:21:45 MST 2013 -One-line Summary: add hooks to Sean Santos's unit test framework, and begin to add CLM unit tests - -Purpose of changes: - - (1) add hooks to Sean Santos's unit test framework - - (2) begin to add CLM unit tests - - Note: this tag currently does NOT have the CMake utilities that are needed to - run the unit tests. Instead, the instructions show how to point to a version - of these in my directory. That's because, as of the time I submitted this tag - for testing, the necessary working version of the CMake utilities was not yet - tagged. In the near future, another external could be added to pull in these - CMake utilities in the CLM directory tree. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self, santos - -List any svn externals directories updated (csm_share, mct, etc.): - - tools/unit_testing: added external - models/csm_share: share3_131101 -> share3_131226 (to get changes needed for building unit tests) - -List all files eliminated: None - -List all files added and what they do: - -========= Set up unit test directories & CMakeLists.txt files, and add unit - tests for DaylengthMod. Note that the tests themselves are in - Daylength_test/test_daylength.pf. See the README file for how to run - the tests -A models/lnd/clm/test/unit -A models/lnd/clm/test/unit/clm4_5 -A models/lnd/clm/test/unit/clm4_5/README -A models/lnd/clm/test/unit/clm4_5/CMakeLists.txt -A models/lnd/clm/test/unit/clm4_5/mock -A models/lnd/clm/test/unit/clm4_5/mock/decompMod_boundsTypeDecl.F90 -A models/lnd/clm/test/unit/clm4_5/mock/CMakeLists.txt -A models/lnd/clm/test/unit/clm4_5/Daylength_test -A models/lnd/clm/test/unit/clm4_5/Daylength_test/test_daylength.pf -A models/lnd/clm/test/unit/clm4_5/Daylength_test/CMakeLists.txt - -========= Add CMakeLists.txt files that are needed to build unit tests -A models/lnd/clm/src/clm4_5/main/CMakeLists.txt -A models/lnd/clm/src/clm4_5/biogeophys/CMakeLists.txt - -List all existing files that have been modified, and describe the changes: - -========= Remove unneeded 'use' statement, to prevent pulling in more than is - necessary for the unit test build -M models/lnd/clm/src/clm4_5/main/clmtype.F90 - -========= Externals updated - see above -M SVN_EXTERNAL_DIRECTORIES - - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - Also ran the new unit tests, as per the instructions in - models/lnd/clm/test/unit/clm4_5/README - all PASS - -CLM tag used for the baseline comparisons: clm4_5_54 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_54 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Dec 27 15:55:05 MST 2013 -One-line Summary: update externals to cesm1_3_beta06 - -Purpose of changes: - - Update externals to cesm1_3_beta06 versions. - - However, do NOT update RTM, because the latest version of RTM results in - failures for ERI _N2 tests. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): none - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: not investigated - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - Index: SVN_EXTERNAL_DIRECTORIES - =================================================================== - --- SVN_EXTERNAL_DIRECTORIES (.../trunk_tags/clm4_5_53) (revision 56268) - +++ SVN_EXTERNAL_DIRECTORIES (.../branch_tags/clm_update_externals_cesm1_3_beta06_tags/clm_update_externals_cesm1_3_beta06_n02_clm4_5_53) (revision 56268) - @@ -1,25 +1,25 @@ - # CESM scripts, machines and driver - -scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_131126a - -scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130930b - -models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_02 - +scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_131203 - +scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_131206b - +models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq5_0_07 - - # Model components: Data atmosphere, and stub components as well as land-ice model - -models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_131116 - -models/ocn/socn https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_03/socn - -models/ice/sice https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_03/sice - -models/glc/sglc https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_03/sglc - -models/wav/swav https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_03/swav - -models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_34 - -models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_130924 - +models/atm/datm https://svn-ccsm-models.cgd.ucar.edu/datm7/trunk_tags/datm8_131201 - +models/ocn/socn https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/socn - +models/ice/sice https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/sice - +models/glc/sglc https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/sglc - +models/wav/swav https://svn-ccsm-models.cgd.ucar.edu/stubs/trunk_tags/stubs1_4_04/swav - +models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_34 - +models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_131008 - - # Utilities: csm_share, esmf, timing, MCT, PIO - -models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_130918 - +models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_131101 - models/utils/esmf_wrf_timemgr https://svn-ccsm-models.cgd.ucar.edu/esmf_wrf_timemgr/trunk_tags/esmf_wrf_timemgr_130213 - -models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_130506 - +models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_131108 - models/utils/mct https://github.com/quantheory/MCT/tags/compiler_fixes_n03_MCT_2.8.3 - -models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_7_2/pio - +models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_8_3/pio - - # Mapping tools: - -tools/cprnc https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_130529 - +tools/cprnc https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_131120 - tools/mapping https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130716 - models/lnd/clm/tools/shared/gen_domain https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130716/gen_domain_files - - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= NCK tests no longer fail; change fail type of - ERS_D.f19_g16.IGRCP26CN.frankfurt_pgi from CFAIL to RUN -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: generate only (no baselines from clm4_5_53) - -CLM tag used for the baseline comparisons: clm4_5_53 - -Changes answers relative to baseline: YES, but only for multi-instance - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Multi-instance - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated, but suspected to be new climate - - Note that NCK tests newly pass (they had been failing), so this answer change - for multi-instance tests is expected. - - These answer changes show up in the following tests: - - FAIL CME_N2.f10_f10.I1850CLM45BGC.yellowstone_intel.clm-default.GC.131227-063851.compare_hist.clm4_5_53 - FAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.GC.131227-063851.compare_hist.clm4_5_53 - FAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.GC.131227-063851.compare_hist.clm4_5_53 - - FAIL CME_N2.f10_f10.I1850CLM45BGC.yellowstone_intel.clm-default.compare_hist.clm4_5_53.clm2.h0 - FAIL ERI_N2.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.compare_hist.clm4_5_53.clm2.h0 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_53 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Thu Dec 19 07:59:56 MST 2013 -One-line Summary: refactor restart interfaces - -Purpose of changes: Refactor restart interfaces. Most work done by mvertens. - -1) Add two *.F90.in files that use genf90.pl go generate source. This saves time - in dev. and maintenence. If you modify only the *.F90 file, your changes will - be lost. Instead modify the *F90.in file, then run genf90.pl on that file. - If you have questions, ask a clm developer for help. -2) Restart capability has now been encapsulated in a subroutine call that uses - Fortran 2003 interfaces over type and dimension. For example: - -- if (flag == 'define') then -- call ncd_defvar(ncid=ncid, varname='grainc_storage_to_xfer', xtype=ncd_double, & -- dim1name='pft',long_name='grain C shift storage to transfer',units='gC/m2/s') -- else if (flag == 'read' .or. flag == 'write') then -- call ncd_io(varname='grainc_storage_to_xfer', data=pcf%grainc_storage_to_xfer, & -- dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) -- if (flag=='read' .and. .not. readvar) then -- if (is_restart()) call endrun -- end if -- end if -+ call restartvar(ncid=ncid, flag=flag, varname='grainc_storage_to_xfer', xtype=ncd_double, & -+ dim1name='pft', & -+ long_name='grain C shift storage to transfer', units='gC/m2/s', & -+ interpinic_flag='interp', readvar=readvar, data=pcf%grainc_storage_to_xfer) - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary data sets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: - -! renamed for consistency -D models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 - -List all files added and what they do: - -A models/lnd/clm/src/util_share/dtypes.h -A models/lnd/clm/src/util_share/ncdio_pio.F90.in -A models/lnd/clm/src/util_share/restUtilMod.F90 -A models/lnd/clm/src/util_share/restUtilMod.F90.in -A models/lnd/clm/src/clm4_5/biogeochem/CNRestMod.F90 - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/util_share/clm_time_manager.F90 -M models/lnd/clm/src/util_share/accumulMod.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4RestMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeRestMod.F90 - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - frankfurt_intel - OK - frankfurt_pgi - OK - frankfurt_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_52 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_52 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Tue Nov 26 22:07:32 MST 2013 -One-line Summary: turn on longwave radiation downscaling for glc_mec by default - -Purpose of changes: Turn on longwave radiation downscaling for glc_mec by default - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: set glcmec_downscale_longwave to true -by default - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: updated to scripts4_131126a, to get tweaked test list - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Change glcmec_downscale_longwave to true by default -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 - -========= Remove build-namelist tests that are no longer xFails -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -========= Update scripts to scripts4_131126a, to get tweaked test list -M SVN_EXTERNAL_DIRECTORIES - - -CLM testing: - - build-namelist tests: - - yellowstone: ok - frankfurt - - regular tests (aux_clm): - - yellowstone_intel: ok - yellowstone_pgi: ok - frankfurt_intel: ok - frankfurt_pgi: ok - frankfurt_nag: ok - -Expected baseline failures: -FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.131126-131812.compare_hist.clm4_5_51 -FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.131126-131812.nlcomp - -Two BFAILs due to changed tests; I reran them as their old versions and confirmed that answers changed, as expected: -BFAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC_changeFlags.GC.131126-131807.compare_hist.clm4_5_51 -BFAIL PEM_D.f19_g16.IG1850CLM45.yellowstone_pgi.clm-glcMEC.GC.131126-214346.compare_hist.clm4_5_51 - - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: ok - yellowstone_pgi: ok - -CLM tag used for the baseline comparisons: clm4_5_51 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 with glc_mec (IG compsets) - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff; not investigated whether it is same climate or new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_51 -Originator(s): sacks (sacks) -Date: Tue Nov 26 05:46:29 MST 2013 -One-line Summary: rework downscaling of atm fields for glc_mec - -Purpose of changes: - -A number of changes related to downscaling atm -> clm fields for glc_mec -landunits: - -(1) Add new options to downscale precip (division into rain/snow) and longwave - radiation (developed by Bill Lipscomb). Both are currently off by default. - -(2) Move downscaling code out of clm_driverInit into clm_atmlnd.F90 - this is a - more appropriate module, and is a step towards modularity, because the code - to deal with the atmospheric forcing fields lives in the same module as the - definition of these atmospheric forcing fields. - -(3) Ensure that all code uses the downscaled, column-level fields where - possible. Previously, some code (which did not operate over glc_mec - landunits) used the non-downscaled, gridcell-level version of fields such as - forc_t. This was a problem because (a) it was confusing and error-prone, and - (b) we will soon be bringing in code to do downscaling over other landunits - as well as glc_mec landunits. - -(4) To support (3), and make it harder for someone to accidentally use the - gridcell-level version of a field when they should be using the downscaled, - column-level version: Broke clm_a2l into two pieces - one containing fields - that aren't downscaled, and one containing fields that are downscaled. For - fields that are downscaled, clearly distinguished the non-downscaled - versions so they couldn't be used by accident. - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: For glc_mec runs, added two new -namelist options: glcmec_downscale_rain_snow_convert and -glcmec_downscale_longwave. - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: erik; portions reviewed by Bill Lipscomb, Mariana, Stefan - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Significant changes: includes stuff that used to be in - clm_driverInitMod; added new downscaling code for precip & lwrad; - split atm2lnd type into two types; reworked initialization interfaces; - removed unused field rainf, because it currently isn't used and could - theoretically become inconsistent with the downscaled rain/snow -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 - -========= Removed downscaling code from here -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 - -========= Added call to downscale_forcings -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -========= Changed interface to init_atm2lnd: previously, clm_initialize used - clm_a2l from clm_atmlnd and passed it to init_atm2lnd_type (also in - clm_atmlnd) - there was no reason for this, it was confusing, and to - some extent broke modularity -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - -========= New parameter -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 - -========= Removed some variables -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - -========= New namelist control variables -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -========= Removed unused rainf, added pointer to allow lnd_import_export to - remain identical between clm4_0 and clm4_5 code -M models/lnd/clm/src/clm4_0/main/clm_atmlnd.F90 - -========= Fixed test ids for failing build-namelist tests -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -========= Minor changes in lots of places to (a) use fields from - a2l_downscaled_col instead of clm_a2l, and (b) index those fields by - column rather than by gridcell -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/cpl/lnd_comp_esmf.F90 -M models/lnd/clm/src/cpl/lnd_import_export.F90 -M models/lnd/clm/src/cpl/lnd_comp_mct.F90 - - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - Note the following expected nlcomp failures: - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC.GC.131125-104703.nlcomp - FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.131125-104751.nlcomp - FAIL PEM_D.f19_g16.IG1850CLM45.yellowstone_pgi.GC.131125-104751.nlcomp - - Also, there were BFAILs for the following, implying that the baselines - didn't exist; I'm not too concerned because baseline comparisons passed for - similar tests: - BFAIL SMS_Ly1_Mmpich.f19_g16.ICLM45BGCCROP.frankfurt_nag.clm-reduceOutput.GC.131125-104832.compare_hist.clm4_5_50 - BFAIL ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel.clm-monthly_noinitial.GC.131125-104703.compare_hist.clm4_5_50 - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - As above, baselines were missing for this test: - BFAIL2 ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel.clm-monthly_noinitial.compare_hist.clm4_5_50.clm2.h0 (baseline history file does not exist) - BFAIL2 ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel.clm-monthly_noinitial.compare_hist.clm4_5_50.clm2.h1 (baseline history file does not exist) - - -CLM tag used for the baseline comparisons: clm4_5_50 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_50 -Originator(s): erik (Erik) -Date: Sun Nov 24 18:51:11 MST 2013 -One-line Summary: Bring in a crop of b4b bugfixes, fix getregional script, - start move of PTCLM to PTCLMmkdata tool - -Purpose of changes: - -Bring in a crop of bit-for-bit bug-fixes to the trunk for November. -Fix the getregional_datasets script and initial move of PTCLM to just -be a CLM tool under models/lnd/clm/tools/shared to create single-point -datasets. - -New option to create_newcase "-user_mods_dir" for a directory with -user chagnes such as user_nl_* namelist modification files, xmlchange_cmnds -file with xmlchanges to make, and SourceMods/src.*/* files. - -Requirements for tag: bit-for-bit bug-fixes and work on PTCLM - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1868 (Add user_mods_dir to create_newcase) - 1854 (Remove fndepdat no longer used) - 1842 (Remove unused variables from gridcell type) (Bill) - 1835 (Add write statement to pftdyn so you can see what it is doing) - 1828 (Clarify modulo used in irrigation code) (Bill) - 1770 (Remove sitespf_pt valid_values list for clm4_0) - 1724 (getregional script does NOT work) - 1625 (Problem setting finidat in CLM for RUN_TYPE=hybrid/branch) - 1543 (large-file format does NOT work in latest clm) - 1481 (Provide a more direct way to set a user provided finidat file) - 1437 (problems with link_dirtree -- no longer needed) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: SourceMods directory on create_newcase - - New -user_mods_dir option to create_newcase that will copy SourceMods/src.*/* - files to the new case. Also copies user_nl_* files and xmlchange_cmnds - -Describe any changes made to the namelist: remove outnc_large_files - Remove outnc_large_files -- wasn't functional - (now always use 64-bit format) - Remove fndepdat from namelist_definition/defaults no longer used. - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, sacks (fixes for 1842 and 1828) - -List any svn externals directories updated (csm_share, mct, etc.): scripts - scripts updated to scripts4_131119 - -List all files eliminated: None - -List all files added and what they do: - ------- Add externals for tools so PTCLM shows up in tool directory ------- Add same files and a README file for getregional -A models/lnd/clm/tools/SVN_EXTERNAL_DIRECTORIES -A models/lnd/clm/tools/shared/ncl_scripts/sample_inlist -A models/lnd/clm/tools/shared/ncl_scripts/sample_outlist -A models/lnd/clm/tools/shared/ncl_scripts/README.getregional - -List all existing files that have been modified, and describe the changes: - ------- Get getregional_datasets script working again. Now operates on ------- lists of files. -M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.pl -M models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.ncl -M models/lnd/clm/test/tools/TSMscript_tools.sh --- Copy sample_*list files -M models/lnd/clm/test/tools/nl_files/getregional - change arguments - ------- -M models/lnd/clm/tools/clm4_0/interpinic/src/interpinic.F90 - ------- Remove clm_startfile option and outnc_large_files -M models/lnd/clm/bld/config_files/config_definition_clm4_0.xml -- - Remove valid_values from sitespf_pt so can be anything. -M models/lnd/clm/bld/unit_testers/build-namelist_test.pl -- Remove - clm_startfile option and move some clm4_5 configure options - to build-namelist -M models/lnd/clm/bld/build-namelist --- Remove clm_startfile option - and outnc_large_files -M models/lnd/clm/bld/clm.buildnml.csh - Remove clm_startfile option - set finidat/nrevsn like how is done in CAM - ------- Remove fndepdat and outnc_large_files -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0_tools.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -------- Remove - some gridcell variables not sued -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 ------------- write - on what's going on -M models/lnd/clm/src/clm4_5/main/controlMod.F90 ------------ Remove - outnc_large_files -M models/lnd/clm/src/clm4_5/main/clmtype.F90 --------------- Remove - a bunch of gridcell variables not needed -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 - Add - seconds_since_irrig_start_time temporary to clarify - ------- -M models/lnd/clm/src/clm4_0/main/pftdynMod.F90 --- add some writes statements -M models/lnd/clm/src/clm4_0/main/controlMod.F90 -- remove outnc_large_files - -CLM testing: - - build-namelist tests: - - yellowstone yes - frankfurt no - - NOTE: there were some tests that were passing but in the xFail list - from before clm4_5_49 that I marked as working. - - regular tests (aux_clm): - - yellowstone_intel yes - yellowstone_pgi yes - frankfurt_intel yes - frankfurt_pgi yes - frankfurt_nag yes - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel yes - yellowstone_pgi yes - - tools testing: - - yellowstone interactive yes - -CLM tag used for the baseline comparisons: clm4_5_49 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_5_49 -Originator(s): muszala (Stefan Muszala) -Date: Sat Nov 16 07:51:27 MST 2013 -One-line Summary: Swenson anomaly forcing - Part 1 - -purpose of changes: - add additional data streams to modify existing - data streams for purposes such as bias correction or specifying - future changes relative to baseline data streams, e.g. specifying - future atmospheric forcing anomalies when running CLM with data atmosphere. - Paired with datm8_131115. - - For what to set in user_nl_cpl, user_nl_datm, see testing section. - - This is part 1 of 2. Part 2 will address a general way to handle - streams in the DATM that is triggered off of an AF compset. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: swenson, kluzek, self - -List any svn externals directories updated (csm_share, mct, etc.): update to datm8_131116 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_0/main/clm_atmlnd.F90 -M models/lnd/clm/src/cpl/clm_cpl_indices.F90 -M models/lnd/clm/src/cpl/lnd_import_export.F90 -M SVN_EXTERNAL_DIRECTORIES - -CLM testing: - -Testing for features of this tag: f09_g16, ICRUCLM45 - -anomaly forcing namelists - user_nl_cpl: cplflds_custom = 'Sa_prec_af->a2x', 'Sa_prec_af->x2l','Sa_tbot_af->a2x', - 'Sa_tbot_af->x2l','Sa_pbot_af->a2x', 'Sa_pbot_af->x2l','Sa_shum_af->a2x', - 'Sa_shum_af->x2l','Sa_u_af->a2x', 'Sa_u_af->x2 l','Sa_v_af->a2x', - 'Sa_v_af->x2l','Sa_swdn_af->a2x', 'Sa_swdn_af->x2l','Sa_lwdn_af->a2x', - 'Sa_lwdn_af->x2l' - user_nl_datm: anomaly_forcing = 'Anomaly.Forcing.Precip','Anomaly.Forcing.Temperature', - 'Anomaly.Forcing.Pressure','Anomaly.Forcing.Humidity','Anomaly.Forcing.Uwind', - 'Anomaly.Forcing.Vwind','Anomaly.Forcing.Shortwave','Anomaly.Forcing.Longwave' -bias correction namelists - user_nl_cpl: cplflds_custom = 'Sa_precsf->a2x', 'Sa_precsf->x2l' - user_nl_datm: bias_correct = 'BC.CRUNCEP.GPCP.Precip' - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - frankfurt_intel - OK - frankfurt_pgi - OK - frankfurt_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_48 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_48 -Originator(s): muszala (Stefan Muszala) -Date: Thu Nov 14 08:28:31 MST 2013 -One-line Summary: bug fixes for CLM dry deposition and MEGAN VOC emissions - -Purpose of changes: Bring in bug fixes from fvitt for CLM dry deposition and MEGAN VOC emissions. Any changes - to answers are limited to rare circumstances. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: fvitt, self - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_0/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/DryDepVelocity.F90 - -CLM testing: - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - frankfurt_intel - OK - frankfurt_pgi - OK - frankfurt_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_47 - -Changes answers relative to baseline: Answers change for some of the chemistry configurations, but - these changes will not be see in the CLM standalone tests. - -=============================================================== -=============================================================== -Tag name: clm4_5_47 -Originator(s): muszala (Stefan Muszala) -Date: Tue Nov 12 09:26:20 MST 2013 -One-line Summary: fix Bug 1858 - AGDD now reset annually - -Purpose of changes: Fix bug 1858. AGDD is now reset annually. Replace -99999_r8 with a - parameter in accumulMod.F90 which is used in accFldsMod.F90 - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1858 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: slevis, sacks, muszala - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/util_share/accumulMod.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 - -CLM testing: - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - frankfurt_intel - OK - frankfurt_pgi - OK - frankfurt_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_46 - -Changes answers relative to baseline: Generally, No. There may be changes - in DV compsets over very long simulation times and at very high resolutions. - -=============================================================== -=============================================================== -Tag name: clm4_5_46 -Originator(s): sacks (sacks) -Date: Fri Nov 8 17:26:02 MST 2013 -One-line Summary: remove zeroing out of slope for special landunits - -Purpose of changes: - - Previously, there was code to zero out slope for grid cells with 100% special - landunits. However, there were a number of problems with this: - - (1) With dynamic landunits, this is problematic, because a grid cell could - start as 100% special landunits, then later become < 100% special landunits - (e.g., due to retreating glaciers) - - (2) Moreover, why should the slope of a special landunit depend on whether - the grid cell has 100% special landunits. This seems to be saying that, e.g., - the slope of a glacier landunit depends on whether the grid cell is entirely - glacier or part glacier and part natural veg. - - (3) And I guess moreover, why is the slope zeroed out for special landunits - in the first place? - - - From talking with Erik, we decided thish code was probably a relic from a - time when the surface dataset had some bad values (e.g., over Greenland / - Antarctica). This is no longer the case, so this code is no longer needed. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: erik - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - Following are the baseline failures, which are expected (see below): - -FAIL SMS_D.1x1_mexicocityMEX.ICLM45.frankfurt_intel.clm-default.GC.131107-223431.compare_hist.clm4_5_45 -FAIL SMS_D.1x1_vancouverCAN.ICLM45.frankfurt_pgi.clm-default.GC.131107-223435.compare_hist.clm4_5_45 -FAIL ERS_Mmpi-serial.1x1_mexicocityMEX.I1PTCLM45.frankfurt_nag.clm-default.GC.131107-223439.compare_hist.clm4_5_45 -FAIL SMS_D_Mmpi-serial.1x1_vancouverCAN.I1PTCLM45.frankfurt_nag.clm-default.GC.131107-223439.compare_hist.clm4_5_45 -FAIL ERI.f09_g16.ICLM45BGC.yellowstone_intel.GC.131107-223256.compare_hist.clm4_5_45 -FAIL ERI_D.f09_g16.ICLM45BGC.yellowstone_intel.GC.131107-223256.compare_hist.clm4_5_45 -FAIL ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.GC.131107-223256.compare_hist.clm4_5_45 -FAIL ERS_Lm3.1x1_vancouverCAN.I1PTCLM45.yellowstone_intel.clm-default.GC.131107-223256.compare_hist.clm4_5_45 -FAIL SMS.1x1_mexicocityMEX.I1PTCLM45.yellowstone_intel.clm-default.GC.131107-223256.compare_hist.clm4_5_45 -FAIL ERI.f09_g16.I1850CRUCLM45BGC.yellowstone_pgi.GC.131107-223301.compare_hist.clm4_5_45 -FAIL ERI.f09_g16.ICLM45BGC.yellowstone_pgi.GC.131107-223301.compare_hist.clm4_5_45 -FAIL ERI_D.f09_g16.ICLM45BGC.yellowstone_pgi.GC.131107-223301.compare_hist.clm4_5_45 - - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - Following are the baseline failures, which are expected: - -FAIL ERS_Lm3.1x1_vancouverCAN.I1PTCLM45.yellowstone_intel.clm-default.compare_hist.clm4_5_45.clm2.h0 -FAIL ERS_Lm3.1x1_vancouverCAN.I1PTCLM45.yellowstone_intel.clm-default.compare_hist.clm4_5_45.clm2.h1 -FAIL SMS.1x1_mexicocityMEX.I1PTCLM45.yellowstone_intel.clm-default.compare_hist.clm4_5_45.clm2.h0 -FAIL SMS.1x1_mexicocityMEX.I1PTCLM45.yellowstone_intel.clm-default.compare_hist.clm4_5_45.clm2.h1 - - -CLM tag used for the baseline comparisons: clm4_5_45 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Any configuration that includes a grid cell that - has 100% special landunits, including at least some urban - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated carefully, but expected to be larger than roundoff/same - climate - since this only affects a very small number of grid cells, and - (I believe) only the urban pervious road in those grid cells - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_45 -Originator(s): sacks (sacks) -Date: Fri Nov 8 16:10:22 MST 2013 -One-line Summary: refactor daylength calculation, and other minor changes - -Purpose of changes: - - (1) Compute daylength in a single place, and compute necessary variables at - initialization rather than having them on the restart file - - (2) Compute daylength-related variables at initialization rather than having - them on the restart file, both to clean things up and to fix some daylength - bugs at initialization (these bugs were fixed in a kludgey way in clm4_5_44, - and now are fixed robustly) - - (3) Fix daylength calculation at the poles (previously blew up due to - roundoff errors) (doesn't change behavior currently, but could change - behavior / answers if there were a vegetated landunit at the pole) - - (4) Fix sminn on restart, so that crop restarts can be bfb (bug 1846) - - (5) Add all_active namelist variable that makes even 0-weight points active, - for testing purposes - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - - 1846 (crop restarts aren't exact due to sminn field) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: add all_active namelist variable - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: (1) & (2) reviewed by erik, (3) by self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: update from scripts4_131030 -> scripts4_131107a - -List all files eliminated: none - -List all files added and what they do: - -========= Compute daylength in a single place -A models/lnd/clm/src/clm4_5/biogeophys/DaylengthMod.F90 - -List all existing files that have been modified, and describe the changes: - -========= Refactor daylength calculation to just compute daylength in a single, - central place, and compute necessary variables at initialization - rather than having them on the restart file -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 - - also fix sminn on restart (bug 1846) -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 - -========= Add all_active namelist variable that makes even 0-weight points - active, for testing purposes -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - - -========= Add & remove tests from xFail list -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -*** No longer tested (replaced by CME_Ly4) -- Runs out of time. CME_Ly4.f10_f10.I1850CLM45BGC.yellowstone_intel.clm-monthly passes - -*** Now passes -- restarts not exact due to bug 1846: crop restarts are not exact due to sminn field - -+ Diffs in cpl log files in rofl, rofi and volr -+ Diffs in cpl log files in rofl, rofi and volr - - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - Note that we get the following failures in compare_hist: - - FAIL PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.GC.131107-214732.compare_hist.clm4_5_44 - FAIL PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrigOn_reduceOutput.GC.131107-214732.compare_hist.clm4_5_44 - - However, I think that's expected due to the oddities in the clm4_5_44 tag - with openmp - see notes in the ChangeLog for clm4_5_44 for details. Note - that this one is identical to clm4_5_43, suggesting that clm4_5_45 undoes - the problem introduced in clm4_5_44: - - PASS PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.compare_hist.clm4_5_43.cpl.hi - - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - In particular, note that the clm hist comparison passes for the two above - tests that had unexpected cpl diffs: - - PASS PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.compare_hist.clm4_5_44.clm2.h0 - PASS PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_intel.clm-irrigOn_reduceOutput.compare_hist.clm4_5_44.clm2.h0 - - -CLM tag used for the baseline comparisons: clm4_5_44 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_44 -Originator(s): sacks (sacks) -Date: Fri Nov 8 08:19:56 MST 2013 -One-line Summary: temporary hack to daylength initialization to provide baselines for the next tag - -Purpose of changes: - - The next tag (clm4_5_45) involves a major refactor to the daylength - calculation. That refactor is bfb in most respects, but gives differences in - the first time step in a few situations. - - This tag (clm4_5_44) does the minimal changes needed to get the same results - as clm4_5_45, in order to have more confidence when testing clm4_5_45. - - Note that the changes here are a kludge that will be reverted in clm4_5_45. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 1850 (incorrect daylength in first timestep of some runs) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - There were a number of expected compare_hist failures, as described below. - - There was one unexpected compare_hist failure: - FAIL PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.GC.145424.compare_hist.clm4_5_43 - - Diffs are just in voc cpl fields. CLM hist files are identical at the end of - the run. An SMS version of this test passes. Interestingly, the kludgey code - that I have added for clm4_5_44 isn't even executed in this test... so the - only diffs should be in variable declarations and 'use' statements. And - clm4_5_45 (which I will tag soon) gives identical cpl hist files to - clm4_5_43. So there may just be a compiler fluke in the compilation of this - tag with openmp enabled. Because clm4_5_45 will give identical results to - clm4_5_43, I'm not worrying about this. - - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - A number of expected compare_hist failures, as described below. - -CLM tag used for the baseline comparisons: clm4_5_43 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 with BGC (and probably CN), involving - either (a) initial conditions interpolated from a different resolution, or - (b) a change in start date relative to the ref date of an initial file - (which shows up in ERI tests) - see bug 1850 - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but almost certainly larger than - roundoff/same climate, since this code mod just changes things in the - first timestep. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_43 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Wed Nov 6 09:21:25 MST 2013 -One-line Summary: allocate memory for most landunits in every grid cell (needed for dynamic landunits) - -Purpose of changes: - - Main change is to allocate memory for most landunits in every grid cell, to - support dynamic landunits. Note that we ALWAYS do this extra memory - allocation, so that the user isn't required to do interpinic between a - non-dynamic run and a dynamic landunit run. (If we eventually change the - restart file format / processing so that you can add / remove 0-weight points - at will, then we could potentially add some logic to only do this extra - allocation if we're using dynamic landunits.) - - Supporting changes are (1) determining which grid cells have enough parameter - data to support urban landunits, (2) new initial conditions files, (3) in - mksurfdata_map, don't set soil parameters to 0 under glacier, and set urban - parameters even if urban cover is 0% - - Other changes are: - - (1) only do snow balance check over active columns - - (2) fix interpinic bug (bug 1839) - - (3) newer files for testing interpinic - - - NOTE: All CLM4.5 initial conditions will need to be interpinic'ed to be - usable in this tag (this has been done for all out-of-the-box initial - conditions) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - - 1839 (interpinic uses wrong column when there are 0-weight columns in the - input file) - - - 1840 (snow balance check is executed over inactive columns) - - - 1825 (surface datasets need urban parameters even when pcturb is 0 - everywhere): partial fix - still waiting on new USUMB dataset - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: new initial conditions for CLM4.5 - -List any changes to the defaults for the boundary datasets: new initial -conditions for CLM4.5 - -Describe any substantial timing or memory changes: - - Significant memory increases for all CLM4.5 configurations - memory is now - allocated for all natural veg landunits, all crop landunits (if using - create_crop_landunit), and most urban landunits. - - Also, significant performance decrease (~ 10%) associated with the above - change, which I believe is mainly due to decreased cache friendliness. - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: - -========= Change files used for testing interpinic, in order to use files that - are up-to-date with the current version of CLM, for a more accurate test -D models/lnd/clm/tools/clm4_5/interpinic/clmi.I2000CLM45BGC.2000-01-01.10x15_simyr2000_c130607.nc - -List all files added and what they do: - -========= Change files used for testing interpinic, in order to use files that - are up-to-date with the current version of CLM, for a more accurate test -A models/lnd/clm/tools/clm4_5/interpinic/clmi.I2000CLM45BGC.2000-01-01.10x15_simyr2000_c131104.nc - -List all existing files that have been modified, and describe the changes: - -========= Determine which grid cells should have urban landunits -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varsur.F90 -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 - -========= Create a natural veg landunit and crop landunit in all grid cells; - create an urban landunit in all grid cells for which we have - determined that urban is "valid" -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 - -========= Change a comment -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 - -========= Only do snow balance check over active columns (fixes bug 1840) -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 - -========= Use new initial conditions files that are consistent with the expanded - 1-d memory structures -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Don't set soil parameters to 0 under glacier; set urban parameters - even if urban cover is 0% -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksoilMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 - -========= Fix interpinic bug (bug 1839) -M models/lnd/clm/tools/clm4_5/interpinic/src/interpinic.F90 - -========= Change files used for testing interpinic, in order to use files that - are up-to-date with the current version of CLM, for a more accurate test -M models/lnd/clm/tools/clm4_5/interpinic/interpinic.runoptions - - -========= Add two tests to the xFail list -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -+ Runs out of time. CME_Ly4.f10_f10.I1850CLM45BGC.yellowstone_intel.clm-monthly passes -+ Needs new surface dataset - - -CLM testing: - -NOTE: main tests were done with -dynlu_allocate_memory_n11_fix_cndv_time_averages_n01_clm4_5_41; tools tests with -dynlu_allocate_memory_n12_clm4_5_42; build-namelist tests with a slightly older -tag - - build-namelist tests: - - yellowstone: OK. However, the "correct" comparisons are spurious, because I - think the build-namelist test is broken - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - tools testing: - - yellowstone interactive: OK - - *** Expected failures - 027 smiS4 TSMscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............\c - rc=6 FAIL - 028 bliS4 TBLscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............\c - rc=4 FAIL - - - *** Expected baseline failure (uses new input & output file, and there is a non-bfb change in interpinic) - 016 blh54 TBLtools.sh clm4_5 interpinic tools__ds runoptions ....................................\c - rc=7 FAIL - - *** Expected diffs in PCT_SAND, PCT_CLAY, SOIL_COLOR - 012 blg54 TBLtools.sh clm4_5 mksurfdata_map tools__s namelist ...................................\c - rc=7 FAIL - 020 bli24 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds \c - rc=7 FAIL - 022 bli53 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__o ....\c - rc=7 FAIL - 024 bli54 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ds ...\c - rc=7 FAIL - 026 bli57 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__do ...\c - rc=7 FAIL - - *** Expected diffs in urban fields - 030 bli74 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools_\c - rc=7 FAIL - 032 bliT4 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools_\c - rc=7 FAIL - - -CLM tag used for the baseline comparisons: clm4_5_42 - -Changes answers relative to baseline: NO - but see note below: - - NOTE: This tag has the potential to change answers for cases using initial - conditions that were interpinic'ed using the out-of-the-box interpinic, - because of bugs in interpinic. This applies to CLM4.5 cases @ ne30 and hcru - resolutions, as well as CLM4.5 cases using DV @ f09. However, no diffs showed - up in the test suite, so it's possible that this isn't a problem. - -=============================================================== -=============================================================== -Tag name: clm4_5_42 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Mon Nov 4 09:45:36 MST 2013 -One-line Summary: fix bug 1857 for CLM4.5 - CNDV running temperature means are incorrect - -Purpose of changes: - - Fix bug 1857 for CLM4.5 (not yet fixed for CLM4.0!). From the bugzilla entry: - - In this code in CNDVMod: - - do p = bounds%begp, bounds%endp - g = pft%gridcell(p) - if (kyr == 2) then ! slevis: add ".and. start_type==arb_ic" here? - tmomin20(g) = t_mo_min(p) ! NO, b/c want to be able to start dgvm - agdd20(g) = agdd(p) ! w/ clmi file from non-dgvm simulation - end if - tmomin20(g) = (19._r8 * tmomin20(g) + t_mo_min(p)) / 20._r8 - agdd20(g) = (19._r8 * agdd20(g) + agdd(p) ) / 20._r8 - end do - - Notice that this is a loop over p, but it's updating gridcell-level variables. - This means that the running temperature means aren't at all what they purport - to be. e.g., in a grid cell with the 17 natural PFTs and nothing else, the grid - cell-level values will get the 17 pft values averaged in each year, rather than - getting a single pft value per year. This means that these temperature - variables are closer to a single year's value than to a running mean. - - The fix here should be simple: just change tmomin20 & agdd20 to pft-level - variables. - - - WARNING: USE CAUTION WHEN USING THIS TAG WITH AN OLDER RESTART FILE FROM A - CLM4.5 DV CASE (this is not a problem for any out-of-the-box initial - conditions files, but could apply if you have your own initial file from a DV - run): In this case, the two DV-related variables AGDD20 and TMOMIN20 will be - reset to their arbitrary initial conditions. - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1857 - partial fix (still open for clm4.5) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEcosystemDynIniMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 - -========= Remove SSP compare_hist BFAIL from xFAIL list (Ben fixed this in the last tag) -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - All baseline comparisons pass except the following expected failure: - FAIL PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.GC.104252.compare_hist.clm4_5_41 - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - All baseline comparisons pass except the following expected failure: - FAIL PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel.clm-reduceOutput.compare_hist.clm4_5_41.clm2.h0 - -CLM tag used for the baseline comparisons: clm4_5_41 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM4.5 with DV - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Definitely larger than roundoff, but not investigated as to whether it's - same climate or new climate. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_41 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Wed Oct 30 17:33:16 MDT 2013 -One-line Summary: update scripts to convert clm4_5 CPP flags to namelist variables. - -Purpose of changes: Convert clm4_5 CPP flags in controlMod.F90 - into namelist variables, update scripts infrastructure - to generate cases with namelist variables for bgc - (CN, CNDV, methane, vsoilc_centbgc), crop, extra lake layers, - vic, nofire, noio, sitespf_pt, snicarfrc, maxpatch_pft. - -Requirements for tag: - -Test level of tag: regular, tools, build_namelist - -Bugs fixed (include bugzilla ID): 1728 (scripts4_20131030 tag). 1770 (clm4_5 portion). - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: removed clm4_5 CPP flags: - NOFIRE, LCH4, NITRIF, VERTSOILC, EXTRALAKELAYERS, VICHYDRO, CENTURY, CN, - CNDV, CROP, SNICAR, VANCOUVER, NOIO, MEXICOCITY - -Describe any changes made to the namelist: added namelist variables: - - use_nofire, use_lch4, use_nitrif_denitrif, use_vertsoilc, use_extralakelayers, - use_vichydro, use_century_decomp, use_cn, use_cndv, use_crop, use_snicar_frc, - use_vancouver, use_mexicocity, use_noio - - All new namelist variables are logicals. - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Erik Kluzek, Bill Sacks - -List any svn externals directories updated (csm_share, mct, etc.): scripts4_131030 - -List all files eliminated: -D models/lnd/clm/bld/config_files/config_definition.xml - split into clm4_X variants - -List all files added and what they do: -A models/lnd/clm/bld/config_files/config_definition_clm4_5.xml -A models/lnd/clm/bld/config_files/config_definition_clm4_0.xml - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - set crop=off by default to pick up correct defaults. -M models/lnd/clm/bld/configure - completely remove clm4_5 only cpp flags, add physics dependent logic to clm4_0 flags. -M models/lnd/clm/bld/queryDefaultNamelist.pl - point to physics specific config_definitions.xml file -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - replace xml special characters with alternatives so file can be parsed. Add new build-namelist failures. - -M models/lnd/clm/bld/build-namelist - add logic for all new clm4_5 namelist variables, commandline options, switch defaults to use_N. - -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - add new namelist variables - -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 - add CNNDynamicsInit() and logic to set nfix_timeconst from use_nitrif_denitrif namelist instead of CPP. -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 - convert ifdef'd parameters to variables -M models/lnd/clm/src/clm4_5/main/controlMod.F90 - final conversion of CPP flags to namelist variables - - Switch the following files to use new namelist variables for attributes: -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/2000_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/20thC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850_glacierMEC_control.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp2.6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp6_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp4.5_glacierMEC_transient.xml -M models/lnd/clm/bld/namelist_files/use_cases/1850-2100_rcp8.5_glacierMEC_transient.xml - - -CLM testing: - - build-namelist tests: - - yellowstone - most tests will fail, tests need to be updated in future tag - frankfurt - - regular tests (aux_clm): - - nlcomp tests fail for all clm4_5 because of the new namelist variables. - - SSP tests should now be BFAIL, pass on next tag - - All hist comp are bit for bit. - - yellowstone_intel ok - yellowstone_pgi ok - frankfurt_intel ok - frankfurt_pgi ok - frankfurt_nag ok - - tools testing: - - yellowstone interactive - smiS4 (getregional) also fails in clm4_5_40 - frankfurt interactive - N/A - -CLM tag used for the baseline comparisons: clm4_5_40 - -Changes answers relative to baseline: None. - -=============================================================== -=============================================================== -Tag name: clm4_5_40 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Thu Oct 24 07:54:46 MDT 2013 -One-line Summary: fix Bug 1752 - urban conductances depend on weights in an undesirable way - -Purpose of changes: - -Three parts to this tag. Description from Oleson: - -1) - fix Bug 1752 - modified UrbanMod.F90 to calculate -2) - add 2 new diagnostic history fields (FIRE_U, FIRE_R) - the conductances correctly. I created new variables to more clearly - distinguish between scaled and unscaled conductances. -3) - fix small bug in which the history field output of some of the - anthropogenic heat flux variables are not bfb on restart when finidat is blank. - I found this when verifying bfb for the original bug fix. The cause of this - is initialization which sets non-urban to special value, instead of zero, which - is what is desired. On restart, this initialization is not done and the history - file set_nourb=0 has precedent. A related issue is that eflx_building_heat is - not zero for pervious/impervious road when nlevurb /= nlevgrnd. - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1752 - - long test with irrigate=.true. (because irrigation likely never took effect - in the old test). - -Requirements for tag: - -Test level of tag: regular & build_namelist - -Bugs fixed (include bugzilla ID): - - 1827 / 1830: testmods don't work right for multi-instance tests (fix via - scripts update) - - 1829: PCT_SAND, PCT_CLAY and SOIL_COLOR are incorrect for some grid cells - (fix via new surface datasets) - - 1831: turning on irrigation leads to death in initialization (fix via a new - initial conditions file) - - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: see changes in boundary datasets - -List any changes to the defaults for the boundary datasets: - - - new surface datasets for all resolutions for CLM4.5: same as before except - for PCT_SAND, PCT_CLAY and SOIL_COLOR: these are no longer zeroed out under - points that are believed to be 100% glacier ("believed to be" because this - previously zeroed out some points that ended up having some other special - landunits, such as lake) - - - new initial conditions file for CLM4.5, irrigate=.true., f10 - -Describe any substantial timing or memory changes: none - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts: scripts4_131001 -> scripts4_131003 - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= new logic for irrigation for finidat -M models/lnd/clm/bld/build-namelist - -========= new surface datasets; distinguish finidat based on value of 'irriagte' -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -CLM testing: - - build-namelist tests: - - caldera: OK - The following failures were expected due to new surface datasets: - 413/439 < FAIL> - 418/439 < FAIL> - 423/439 < FAIL> - 428/439 < FAIL> - 433/439 < FAIL> - 438/439 < FAIL> - - - regular tests (aux_clm): - - edison_intel (aux_clm_ys_intel & aux_clm_ys_pgi lists): OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - edison_intel: aux_clm_ys_intel list: OK - edison_intel: aux_clm_ys_pgi list: OK - -CLM tag used for the baseline comparisons: clm4_5_35 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45 - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Not investigated carefully, but probably larger than roundoff/same climate. - - Answer changes are due to new surface datasets. This is due to fixing - bug 1829 (PCT_SAND, PCT_CLAY and SOIL_COLOR are incorrect for some grid - cells); it looks like this just affects answers over a small number of - lake points (e.g., 9 lake points in an f19 run). - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_35 -Originator(s): sacks (Bill Sacks) -Date: Tue Oct 1 09:47:45 PDT 2013 -One-line Summary: get CLM running on edison - -Purpose of changes: - - Update scripts and Machines externals to get the CLM test suite running on - edison; this will be our replacement for yellowstone while yellowstone is - down. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: N/A - -List any svn externals directories updated (csm_share, mct, etc.): - --scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130929 --scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130927 -+scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_131001 -+scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130930b - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Remove PEM test that should pass now; add xFails for edison -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - -CLM testing: - - NOTE: Testing was done on tag port_to_edison_02_clm4_5_34. Since then, scripts - has been updated from scripts4_130930a to scripts4_131001. However, the only - difference is the removal of some duplicated tests from the test list. - - regular tests (aux_clm): - - edison_intel (aux_clm_ys_intel & aux_clm_ys_pgi lists): OK - All pass except: - - See "ERH_D.f19_g16.I1850CLM45CN.yellowstone_pgi.clm-default - Can't find user datasets - Seg fault while writing h1 file - See ERS_Ld211_D_P112x1.f10_f10.ICNCROP in yellowstone intel list - - #1 and #4 have been failing on yellowstone, #2 and #3 are new failures on edison - - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - NOTE: only generate done here, because no baselines existed - - edison_intel: aux_clm_ys_intel list: OK - edison_intel: aux_clm_ys_pgi list: OK - -CLM tag used for the baseline comparisons: clm4_5_34 - - NOTE: Baseline comparisons only done for frankfurt tests; no baseline - comparisons done with component_gen_comp, because no baselines existed on - edison. - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_34 -Originator(s): erik (Erik Kluzek) -Date: Mon Sep 30 01:30:25 MDT 2013 -One-line Summary: Get PTCLM working, fix a few small bugs - -Purpose of changes: - -Get PTCLM fully working. Allow PTCLM to work with ALL I compsets including clm4_0 compsets. -Add a new option to PTCLM from Keith Oleson --cycle_forcing to set it up to cycle over the forcing. -Another option is to build datasets in the "-mydatafiles" directory (by default under PTCLM -directory). The datasets now have creation time-stamps in them as well. Rename QIAN_tower_yrs -to -use_tower_yrs and remove QIANforcing (now chosen by compset). -scripts now has four different I1PT compsets two new ones for CLM40CN and CLM45BGC. datm -CLM_USRDAT domain file for CLM1PT forcing points to the ATM_DOMAIN_FILE/PATH. Add some new -datasets to the siteDIR from Keith Oleson. Update documenation, remove unused template dir. -Add a script to rename creation dates for map files, so you don't have to regenerate them -each day. - -Fix a few small bugs. Allow clm4_5 to have suplnitro and bgc_spinup to only give a warning -rather than die. Fix a corrupted rawdata PFT file. Fix mkscripgrid.ncl for regional SCRIP -grid creation. Remove some leftover fine-mesh variables that aren't needed anymore. Remove -reference to scaled_harvest in CLM build-namelist which was removed a long time ago. - -Remove a mapping file that didn't seem to be needed for clm4_0 mkmapdata (a default -didn't exist for it either). Add -usr_mapdir option to clm4_0 mksurfdata.pl which is needed -for PTCLM for clm4_0 compsets. - -Requirements for tag: Update scripts and get PTCLM working - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1826 (allow clm4_5 and suplnitro to be ALL for bgc_spinup) - 1818 (two new options to PTCLM) - 1762 (Fix corrupted rawdata PFT file) - 1757 (Bug in mkscripgrid.ncl for regional/global SCRIP grid creation) - 1623 (Remove some leftover fine-mesh variables _a arrays) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Allow two options to go without dying - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): scripts, Machines, datm, and csm_share - scripts to scripts4_130929 - Machines to Machines_130927 - datm to datm8_130919 - csm_share to share3_130918 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/tools/shared/mkmapdata/mkmapdata.sh ------- Remove 10x10min_IGBPmergeICESatGIS for clm4_0 - M models/lnd/clm/tools/shared/mkmapgrids/mkscripgrid.ncl --- Fix bug 1757 for regional grid creation - M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl - Add usr_mapdir option - - M models/lnd/clm/bld/build-namelist - Allow missing clm_usrdat files to continue, remove scaled_harvest (long gone) - allow bgc_spinup and suplnitro to coexist with warning - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0_tools.xml - Fix corrupted 856 raw PFT file - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5_tools.xml - Fix corrupted 856 raw PFT file, remove 1000-1004 testyrs - - M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - Remove finemesh _a variables - M models/lnd/clm/src/clm4_5/main/clmtype.F90 -------- Remove finemesh _a variables - M models/lnd/clm/src/clm4_0/main/clmtypeInitMod.F90 - Remove finemesh _a variables - M models/lnd/clm/src/clm4_0/main/clmtype.F90 -------- Remove finemesh _a variables - -CLM testing: regular, build_namelist, tools - - build-namelist tests: - - yellowstone yes - frankfurt yes - - regular tests (aux_clm): - - yellowstone_intel yes - yellowstone_pgi yes - frankfurt_intel yes - frankfurt_pgi yes - frankfurt_nag yes - - tools testing: - - yellowstone interactive yes - -CLM tag used for the baseline comparisons: clm4_5_33 - -Changes answers relative to baseline: no bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_5_33 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Thu Sep 26 10:42:56 MDT 2013 -One-line Summary: clean up from mistakes in previous tag - -Purpose of changes: clean up time-stamps and a mistake in clm4_5_32 - -Requirements for tag: N/A - -Test level of tag: N/A - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: N/A - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: N/A - -CLM testing: N/A - -CLM tag used for the baseline comparisons: N/A - -Changes answers relative to baseline: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_32 -Originator(s): muszala (Stefan Muszala,UCAR/TSS,303-497-1320) -Date: Thu Sep 26 10:07:14 MDT 2013 -One-line Summary: bug fix tag - 1798, 1810 - -Purpose of changes: fix bug 1798 and 1810. - -http://bugs.cgd.ucar.edu/show_bug.cgi?id=1798 -http://bugs.cgd.ucar.edu/show_bug.cgi?id=1810 - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1798 and 1810 - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -- for bug 1798 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -- for bug 1810 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_0/main/controlMod.F90 - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel - OK - yellowstone_pgi - OK - frankfurt_intel - OK - frankfurt_pgi - OK - frankfurt_nag - OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - -CLM tag used for the baseline comparisons: clm4_5_31 - -Changes answers relative to baseline: no - -=============================================================== -=============================================================== -Tag name: clm4_5_31 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Wed Sep 25 10:12:47 MDT 2013 -One-line Summary: fix bug 1820: incomplete conditional in CNSoyfix leads to buggy results and decomposition dependence - -Purpose of changes: - - Fix bug 1820: incomplete conditional in CNSoyfix leads to buggy results and - decomposition dependence. Fix for this is based on analysis of the original - Agro-IBIS code. - -Requirements for tag: fix bug 1820, the following tests should now pass: - PET_P15x2_Lm25.f10_f10.ICLM45BGCDVCROP.yellowstone_intel - PET_P15x2_Ly3.f10_f10.ICLM45BGCCROP.yellowstone_intel - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - 1820: incomplete conditional in CNSoyfix leads to buggy results and decomposition dependence - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: Beth Drewniak, Sam Levis - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 - -========= Remove now-passing PET tests -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - -CLM tag used for the baseline comparisons: clm4_5_30 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 with CROP - - what platforms/compilers: ALL - - nature of change (roundoff; larger than roundoff/same climate; new climate): - larger than roundoff, but not investigated in detail - - Note that no changes were observed in the test suite, but this is due to - a limitation of the test suite (there are very few multi-year crop tests; - the only global multi-year tests are the newly-passing PET tests, which - don't have baselines) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_30 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Tue Sep 24 13:08:01 MDT 2013 -One-line Summary: fix performance bug in decomposition initialization - -Purpose of changes: - -Fix performance bug in decomposition initialization (bug 1771). Code mods from -Tony Craig. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1771 ( Fix for an initialization performance bug) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: - - Improves timing of initialization for high resolution casse - -Code reviewed by: tcraig - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/decompInitMod.F90 -M models/lnd/clm/src/clm4_0/main/decompInitMod.F90 - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - -CLM tag used for the baseline comparisons: clm4_5_29 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_29 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Tue Sep 24 10:55:42 MDT 2013 -One-line Summary: fix threading in CLM4.5, and other misc fixes - -Purpose of changes: - -(Mostly) fix threading in CLM4.5. This consisted of: - -(1) Rework initGridCellsMod to keep all points in a clump contiguous - -(2) Add info in bounds derived type (not necessary, but this allows -for more error checking and simplifies some code) - -(3) Fix which bounds are passed to reweightWrapup in initialization - -(4) Get rid of syntax like foo(:) = 0, instead using explicit bounds - -(5) Rework bounds declarations for subroutine array arguments, both in -caller (explicitly subset argument by bounds) and callee (use -assumed-shape array arguments rather than declaring upper bounds), and -add assertions on array sizes. - -See https://wiki.ucar.edu/display/ccsm/Community+Land+Model+Developers+Guide -("Guidelines for passing array arguments to subroutines") for the new -conventions that are implemented here. - -(6) Fix crop threading bug, related to nyrs (bug 1598), both in clm4.5 and clm4.0 - -However, note that there is still a crop threading bug (bug 1820), which will -need to be fixed in a separate tag. - - -Also, some unrelated changes: - -(1) Fix size of a megan variable, both in clm4.5 and clm4.0. - -(2) Remove some unused variables from Hydrology2Mod / SoilHydrologyMod - -(3) Fix some bugs in histFileMod / histFldsMod - -(4) Reorder a loop in SurfaceAlbedo to get better performance (especially with -expanded memory allocation for dynamic landunits, in an upcoming tag) - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): - - 1598 (crop threading in clm4.0 and clm4.5) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: - - Added f10 initial file for CLM4.5 BGCCROP, for testing purposes - -Describe any substantial timing or memory changes: - - Timing is currently 5-10% worse, due to calls to shr_log_errMsg, within - shr_assert calls. This should return to previous timings in non-debug runs - once shr_assert calls are ifdef'ed out in non-debug runs (this requires a - csm_share update that Sean Santos is working on). - -Code reviewed by: portions reviewed by erik - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts4_130912 -> scripts4_130916 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Significant rework to work with multiple clumps per proc -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -========= Add info in bounds derived type -M models/lnd/clm/src/clm4_5/main/decompMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - - also fix crop threading bug (1598) -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - - also use explicit bounds instead of things like foo(:) - -========= Remove some unused variables -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - - also other bounds-related changes as above - -========= Change 'bounds' to 'bounds_proc', use clump bounds for call to - reweightWrapup, get rid of abort if running with openMP -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - -========= Get rid of syntax like foo(:), instead using explicit bounds -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 - -========= Rework bounds declarations for subroutine array arguments, both in - caller (explicitly subset argument by bounds) and callee (use - assumed-shape array arguments rather than declaring upper bounds), and - add assertions on array sizes -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/main/dynlandMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/main/pft2colMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 - - also remove some now-unneeded temporary arrays - - also use explicit bounds instead of things like foo(:) -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 - - also reorder a loop to get better performance -M models/lnd/clm/src/clm4_5/biogeophys/BandDiagonalMod.F90 - -========= Fix crop threading bug (1598), in both clm4.5 and clm4.0, by reworking - where nyrs is updated -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_driver.F90 - -========= Add comments -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 - -========= Fix size of a megan variable -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - - also initialize rootr, as it was in clm4_5_20 and prior -M models/lnd/clm/src/clm4_0/main/clmtypeInitMod.F90 - -========= Fix some hist file bugs: - - increase max number of characters allowed for hist field names - - when adding a field, make it work to say default='active' -- - previously, explicitly setting default='active' did the same thing - as setting default='inactive' - - change ptr_pft to ptr_col for a few column-level history variables - - remove two duplicate hist_addfld calls -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 - - also add some bounds to array arguments -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 - -========= Add f10 initial file for CLM45 BGCCROP, for testing -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Remove some PET tests from the xFail list; note that some PET tests - still fail due to bug 1820 -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - -CLM tag used for the baseline comparisons: clm4_5_28 - -Changes answers relative to baseline: NO, with the following minor exceptions: - - In general, no answer changes for non-threaded runs (changes answers for - threaded runs due to significant bug fixes!) - - Changes answers for CLM45 BGC CROP at f10 due to new initial conditions - (instead of cold start) - -=============================================================== -=============================================================== -Tag name: clm4_5_28 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Sep 20 21:29:39 MDT 2013 -One-line Summary: fix FracH2oSfc bug - -Purpose of changes: - -Fix bug 1811: FracH2oSfc is called from within a loop over all points. Sean -Swenson realized that the offending block of code is no longer needed, so we -have removed it. - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1811 (FracH2oSfc is called from within a loop -over all points) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: Sean Swenson - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Remove the offending (and no longer needed) block of code -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -========= Remove a now-unused variable -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 - -========= Move xFail test to the right location -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - -CLM testing: - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - yellowstone_pgi: OK - - See notes below on answer changes - - -CLM tag used for the baseline comparisons: clm4_5_27 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45 cases - - what platforms/compilers: All - - nature of change: larger than roundoff/same climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - Sean Swenson performed two 20-year runs with and without the fix. His report - is: - - There are some differences, mainly in runoff, and it looks like at the 1% - level mostly, with a few scattered points showing up on the significance - plots. Other fields like latent heat, soil moisture/temperature, or water - table show even less differences. - - http://www.cgd.ucar.edu/staff/swensosc/public/diagnostics/test_frach2o-test_no_frach2o/setsIndex.html - -=============================================================== -=============================================================== -Tag name: clm4_5_27 -Originator(s): sacks (Bill Sacks,UCAR/CSEG,303-497-1762) -Date: Fri Sep 20 20:43:16 MDT 2013 -One-line Summary: fix crop nyrs bug - -Purpose of changes: Fix bug 1815 (nyrs is incorrect at the start of a crop run, -leading to incorrect GDD values for the first 20 years or so of a crop -simulation) - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): -- 1815 (nyrs is incorrect at the start of a crop run, leading to incorrect GDD -values for the first 20 years or so of a crop simulation) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None (but see changes to boundary -datasets below) - -List any changes to the defaults for the boundary datasets: - - New crop initial conditions for CLM4.5 BGCCROP @ f19 - same as old dataset, - but with restyear changed from 1 to 0 - -Describe any substantial timing or memory changes: None - -Code reviewed by: slevis - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Don't increment nyrs on the first timestep of a startup run, so that - nyrs is correctly 0 rather than 1 for the first year -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNPhenologyMod.F90 - -========= New crop initial conditions for CLM4.5 BGCCROP @ f19 - same as old dataset, - but with restyear changed from 1 to 0 -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= add test that sometimes runs out of time, move test from - yellowstone_intel to yellowstone_pgi -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -CLM testing: - - build-namelist tests: - - yellowstone: OK - - regular tests (aux_clm): - - yellowstone_intel: OK - yellowstone_pgi: OK - frankfurt_intel: OK - frankfurt_pgi: OK - frankfurt_nag: OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: OK - - expected diffs in SMS_Ly1.f19_g16.ICLM45BGCCROP.yellowstone_intel - - baselines messed up for - ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel, so comparison not - done for that test - yellowstone_pgi: NO BASELINES, SO COMPARISONS NOT RUN - -CLM tag used for the baseline comparisons: clm4_5_27 - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All crop cases (clm4.0 or clm4.5) that either - use arbitrary initial conditions or use the clm4.5 out-of-the-box initial - conditions for BGCCROP @ f19 - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new - climate): new climate - - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - Sam Levis examined a 3-year run with arbitrary initial conditions, and - verified that crop LAI is much more realistic in the new simulation - (previously, crop LAI was near-zero for the first few years) - -=============================================================== -=============================================================== -Tag name: clm4_5_26 -Originator(s): muszala (Stefan Muszala) -Date: Thu Sep 19 17:07:11 MDT 2013 -One-line Summary: water balance and SMS_Ly1.f19_g16.ICLM45BGCCROP fix - -Purpose of changes: 1) Fix water balance error in f09_g16 I1850CRUCLM45BGC simulation - 2) Get all machine/compiler combinations of - SMS_Ly1.f19_g16.ICLM45BGCCROP working - - this fix required (1) and a fix to fthresh in RtmFloodInit - - new RTM tag rtm1_0_32 to go along with this - - PGI+frankfurt version of this test only work with 16 MPI processes - -Requirements for tag: N/A - -Test level of tag: regular - -Bugs fixed (include bugzilla ID):1808 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: S. Swenson, D. Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): rtm1_0_32 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Index: models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -=================================================================== ---- models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 (revision 51190) -+++ models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 (working copy) -@@ -1110,15 +1110,8 @@ - do j = 1, nlevsoi - if(h2osoi_liq(c,j)<0._r8)then - qflx_deficit(c) = qflx_deficit(c) - h2osoi_liq(c,j) -- h2osoi_liq(c,j) = 0._r8 - endif - enddo -- !reduce qcharge if necessary -- !ideally, I can set qflx_deficit as a local variable, but it is helpful -- !to diagnose the problem associated with the solver for the richards' equation. -- if(qflx_deficit(c)>0._r8)then -- qcharge(c) = qcharge(c) - qflx_deficit(c)/dtime -- endif - enddo - - end associate -@@ -1892,9 +1885,12 @@ - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) -- xs1(c) = max(max(h2osoi_liq(c,1),0._r8)-max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1))),0._r8) -- h2osoi_liq(c,1) = min(max(0._r8,pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1)), h2osoi_liq(c,1)) - -+ !scs: watmin addition to fix water balance errors -+ xs1(c) = max(max(h2osoi_liq(c,1)-watmin,0._r8)- & -+ max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1)-watmin)),0._r8) -+ h2osoi_liq(c,1) = h2osoi_liq(c,1) - xs1(c) -+ - if (urbpoi(clandunit(c))) then - qflx_rsub_sat(c) = xs1(c) / dtime - else - -CLM testing: - -- general note: for clm45 compsets-both clm and cpl history files change - -- specfic testing for these bug fixes: - -1) Water balance fix-ran a clone of run from Dave Lawrence: - -- create_newcase -compset I1850CRUCLM45BGC -res f09_g16 -mach yellowstone -case /glade/u/home/dlawren/expts/clm4.5/clm45bgc_1deg4519_1850spin_bd - -- this ran for over 25 years with no water balance errors. - -2) SMS_Ly1.f19_g16.ICLM45BGCCROP - -PASS SMS_Ly1.f19_g16.ICLM45BGCCROP.yellowstone_intel.clm-reduceOutput.115612 -PASS SMS_Ly1.f19_g16.ICLM45BGCCROP.yellowstone_pgi.clm-reduceOutput.115522 - -PASS SMS_Ly1.f19_g16.ICLM45BGCCROP.frankfurt_intel.clm-reduceOutput.115217 -PASS SMS_Ly1_Mmpich.f19_g16.ICLM45BGCCROP.frankfurt_nag.clm-reduceOutput.120824 -PASS SMS_Ly1.f19_g16.ICLM45BGCCROP.frankfurt_pgi.clm-reduceOutput.016 -- only with 16 MPI tasks - -3) To make sure the RTM refactor did not create any BFB changes, I ran SMS_D.f19_g16.ICLM45BGCCROP.yellowstone_intel - with rtm1_0_31 and rivrtm/branch_tags/bcf_tags/bcf_02_rtm1_0_31. - - With flood_mode='NULL' - Coupler and land history files were BFB. - - With flood_mode='ACTIVE' - Coupler, rtm and land history files were BFB. - - build-namelist tests: N/A - - regular tests (aux_clm): - - yellowstone_intel - OK - changes in cpl. hist files expected - yellowstone_pgi - OK - changes in cpl. hist files expected - frankfurt_intel - OK - changes in cpl. hist files expected - frankfurt_pgi - OK - changes in cpl. hist files expected - frankfurt_nag - OK - changes in cpl. hist files expected - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel - OK - changes in clm fields expected. - -CLM tag used for the baseline comparisons: clm4_5_25 - -Changes answers relative to baseline: Yes. For CLM45 compsets. All changes are from the SoilHydrology mods -as the RTM refactor and fthresh fix are BFB. - -Coupler history fields that change: - -l2x_Sl_avsdr, l2x_Sl_anidr, l2x_Sl_avsdf, l2x_Sl_anidf, l2x_Sl_tref, l2x_Sl_qref, -l2x_Sl_t, l2x_Sl_fv, l2x_Sl_ram1, l2x_Sl_snowh, l2x_Sl_u10, l2x_Fall_swnet, -l2x_Fall_taux, l2x_Fall_tauy, l2x_Fall_lat, l2x_Fall_sen, l2x_Fall_lwup, -l2x_Fall_evap, l2x_Fall_flxdst1, l2x_Fall_flxdst2, l2x_Fall_flxdst3, l2x_Fall_flxdst4, -l2x_Flrl_rofl, l2x_Fall_voc001, l2x_Fall_voc002, l2x_Fall_voc003, l2x_Fall_voc004, -l2x_Fall_voc005, l2x_Fall_voc006, l2x_Fall_voc007, l2x_Fall_voc008, x2l_Flrr_volr, -r2x_Forr_rofl, r2x_Forr_rofi, r2x_Flrr_volr, x2r_Flrl_rofl - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: CLM45 compsets - - what platforms/compilers: All - -=============================================================== -=============================================================== -Tag name: clm4_5_25 -Originator(s): erik (Erik Kluzek) -Date: Fri Sep 13 13:49:45 MDT 2013 -One-line Summary: Bring in Tony's changes to kick sno all the way up to the coupler layer, makes all - CESM components more similar to each other - -Purpose of changes: - Bring in Tony's cplupa branch (cplupa_n06_clm4_5_24) to trunk. This branch moves sno - fields all the way to the top coupler layer rather than being inside of CLM. This makes all - CESM components more similar to each other. - - There was also some small fixes on the side that allow some more tests to work. - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1789 (fix NoVSNoNI test) - 1788 (fix US-UMB test) - 1779 (fix RTM multi-instance) - 1777 (fix RTM branch cases) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: Add new CPP token to CLM USE_ESMF_METADATA (with no direct machanism to use) - We hate CPP tokens (but had to let this go, only needed by ESMF development folks) - -Describe any changes made to the namelist: drv namelist changes, no changes to CLM namelist - -List any changes to the defaults for the boundary datasets: CLM_USRDAT fsurdat files different directory for clm4_0 than clm4_5 - remove missing ne16np4 fpftdyn file - -Describe any substantial timing or memory changes: - -Code reviewed by: self, tcraig - -List any svn externals directories updated (csm_share, mct, etc.):, scripts, drv, cism, rtm, csm_share, data and stub models - - scripts to scripts4_130912 - drv to drvseq4_3_03 - datm to datm8_130424 - socn/sice/sglc/swav to stubs1_4_02 - rtm to rtm1_0_31 - cism to cism1_130905 - csm_share to share3_130906 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/unit_testers/build-namelist_test.pl ------------ Remove ne16 20thC test - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml ---- Remove missing ne16 fpftdyn file - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Different directory for - clm4_0/clm4_5 surface datasets - - M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 - Field names change - M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 ------ Remove "sno" and "s" fields - M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 ---- Remove rofi/rofl - M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 ---- Remove "sno" and "s" fields, add USE_ESMF_METADATA #ifdef - M models/lnd/clm/src/cpl_esmf/lnd_comp_mct.F90 ----- Remove "sno" and "s" fields, add USE_ESMF_METADATA #ifdef - M models/lnd/clm/src/clm4_0/main/clm_glclnd.F90 ---- Remove rofi/rofl - -CLM testing: regular - - build-namelist tests: - - bluefire yes - frankfurt yes - - regular tests (aux_clm): - - yellowstone_intel yes - yellowstone_pgi yes - frankfurt_intel yes - frankfurt_pgi yes - frankfurt_nag yes - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel partial (not completed before tag made) - yellowstone_pgi partial (not completed before tag made) - -CLM tag used for the baseline comparisons: clm4_5_24 - -Changes answers relative to baseline: None (bit-for-bit) - - Although my "I compset" testing showed no changes, fully coupled changes - do show differences. Coupler namelists also change. - -=============================================================== -=============================================================== -Tag name: clm4_5_24 -Originator(s): sacks (sacks) -Date: Tue Sep 3 21:36:13 MDT 2013 -One-line Summary: update externals to cesm1_3_beta02 or later - -Purpose of changes: - -Update externals to cesm1_3_beta02 or later - - -Requirements for tag: - -Test level of tag: regular - -Bugs fixed (include bugzilla ID): 1722 (Test failure with VIC and more_vertlayers) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: Not investigated - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - - scripts : scripts4_130816 -> scripts4_130830a - Machines : Machines_130529 -> Machines_130830 - drv : drvseq4_2_33 -> drvseq4_2_35 - cism : cism1_130502 -> cism1_130624 - csm_share : share3_130528 -> share3_130723 - timing : timing_130417 -> timing_130506 - mct : compiler_fixes_n01_MCT_2.8.3 -> compiler_fixes_n03_MCT_2.8.3 - mapping : mapping_130509 -> mapping_130716 - gen_domain : mapping_130509/gen_domain_files -> mapping_130716/gen_domain_files - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Remove trailing whitespace -M .ChangeLog_template - - -Index: models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -=================================================================== ---- models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (revision 50759) -+++ models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml (working copy) -@@ -51,17 +51,14 @@ - - - use before define in history. runs with frankfurt_pgi, yellowstone_intel and yellowstone_pgi -- floating point exception. problem with VIC combined with vertical layers - once threading fixed, this should pass - once threading fixed, this should pass -- core dumps in ref1. Problems with vertical layers. Run without clm-vrtlay and clm-default and it runs - starting in clm4_5_07--The cpl.hi.nc file is not being copied on a generate like it should. - Cannot turn clm4me mode on -- without clm4_5 physics! problem in scripts4_130809b - - -- Problem with scripts and testId string length. This passes with a long testId -+ Problem with scripts and testId string length. This passes with a long testId - Restart not BFB. Runs as ERH_D.f19_g16.I1850CLM45CN.yellowstone_pgi -- floating point exception. problem with VIC combined with vertical layers - once threading fixed, this should pass - once threading fixed, this should pass - once threading fixed, this should pass -@@ -78,7 +75,7 @@ - Water balance errors followed by "negative conc. in ch4tran", then tries "-10^-12 < smin_nh4 < 0. resetting to zero.", then it exits at approximately 9 months. This same test passes with yellowstone_intel and frankfurt_intel - - -- CMake 2.8.6 or higher is required. You are running version 2.6.4 -+ Problem with cism build - Fails after reading clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc. This same test passes with yellowstone_intel, yellowstone_pgi, frankfurt_intel and frankfurt_nag - Fails after reading clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc. This same test passes with yellowstone_intel, yellowstone_pgi, frankfurt_intel and frankfurt_nag - Fails after reading clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc. This same test passes with yellowstone_intel - - -CLM testing: - - build-namelist tests: - - yellowstone: YES - All PASS or xFAIL - - regular tests (aux_clm): - - yellowstone_intel: YES - yellowstone_pgi: YES - frankfurt_intel: YES - frankfurt_pgi: YES - frankfurt_nag: YES - - All PASS or xFAIL - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel: YES - All PASS except for the following newly-passing tests (for - which these failures are unsurprising): - - BFAIL2 ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_23.clm2.h0 (baseline history file does not exist) - BFAIL2 ERI_D.ne30_g16.ICLM45BGC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_23.clm2.h1 (baseline history file does not exist) - FAIL ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_23.clm2.h0 - FAIL ERS_D.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_23.clm2.h1 - - yellowstone_pgi: YES - Some answer changes (presumably due to compiler change) - -CLM tag used for the baseline comparisons: clm4_5_23 - Note: renamed baselines for frankfurt nag because test names have changed - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - compsets using cism change answers for g2x gields - - many tests change answers with pgi, both on yellowstone & - frankfurt, presumably due to new compiler - - nature of change not investigated - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_23 -Originator(s): muszala (Stefan Muszala) -Date: Thu Aug 22 09:42:43 MDT 2013 -One-line Summary: refactor to allow CH4 params. to be read from netcdf file and clean up clm4_5_20 - -Purpose of changes: - The second of two tags that brings in parameters that are read from netcdf file (ch4 parameters). Please - see the ChangeLog entry for clm4_5_20. - - - Bring in ch4 parameters - - Combine fconsts file and fpftcon file. New file name is paramfile (clm_params.c130821.nc) - - Refactor so that types, subroutine names and type instances have the names params in them (instead of consts) - - Remove many ch4 namelist vars. since they are now read from the param file - - Add new namelist called use_aereoxid_prog to control old aereoxid namelist - - A bulk of this work was completed by Rajendra Paudel. - -Requirements for tag: N/A - -Test level of tag: regular and build_namelist - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: remove many optional ch4 namelists. - add new namelist valled use_aereoxid_prog. - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, dlawren, Rajendra Paudel - -List any svn externals directories updated (csm_share, mct, etc.): scripts4_130730 -> scripts4_130816 - -List all files eliminated: - -- these were renamed -models/lnd/clm/src/clm4_5/biogeochem/CNSharedConstsMod.F90 -models/lnd/clm/src/clm4_5/main/readConstantsMod.F90 - -List all files added and what they do: - -- renamed -models/lnd/clm/src/clm4_5/biogeochem/CNSharedParamsMod.F90 -models/lnd/clm/src/clm4_5/main/readParamsMod.F90 - -List all existing files that have been modified, and describe the changes: - -- refactor to remove old namelist vars. for ch4 and add new functionality -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -- put in ch4 parameters and refactor const->params names -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -M models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 - -CLM testing: - - build-namelist tests: - - yellowstone: OK. Some changes to phys45 and phys45-crop. Should be OK in next tag. - - regular tests (aux_clm): A few nlcomp differences that will go away in the next tag. - Other than a few expected failures due to new scripts entries, all OK. - - yellowstone_intel OK - yellowstone_pgi OK - frankfurt_intel OK - frankfurt_pgi OK - frankfurt_nag OK - - history file comparison with component_gen_comp and summarize_cprnc_diffs: - - yellowstone_intel OK - yellowstone_pgi OK - -CLM tag used for the baseline comparisons: clm4_5_22 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_22 -Originator(s): muszala (Stefan Muszala) -Date: Tue Jul 30 15:22:51 MDT 2013 -One-line Summary: aux_clm testlist reorganization - -Purpose of changes: - - Reorganize all aux_clm tests and fix new failing tests. As part of - this, bring in a change from Maoyi for VIC w/vertical layers. - A few bug fixes to get new tests working. - Why did we do this? - - 1) better balance between frankfurt, yellowstone and various compilers - 2) faster turn around time for development - 3) make sure current science functionality is properly tested - 4) removed outdated / irrelevant tests - - Other points: - - 1) Introduce regular and short test list. Testing now can consist of: - - a) regular (must be run before handing off a tag to SEs and must be run - before committing a tag) - b) build_namelist (if namelists and/or build_system changed)) - c) tools (only if tools are modified and no CLM source is modified) - d) short (for use during development and in rare cases where only a small - change with known behavior is added ... eg. a minor bug fix) - e) doc (no source testing required) - - 2) PET tests will fail until threading is fixed in CLM - -Requirements for tag: N/A - -Test level of tag: regular. ran tests with old testlists to double check any new mods. - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: add no-vert:no-nitrif option to configure - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self. Extensive discussion regaring list content with Lawrence, - Sacks, Kluzek and Andre. - -List any svn externals directories updated (csm_share, mct, etc.): new scripts - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -- add no-vert:no-nitrif option -M models/lnd/clm/bld/configure -M models/lnd/clm/bld/config_files/config_definition.xml -- Update expected failures -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -- Maoyi VIC+vertical layers fix -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -- Update change log template -M .ChangeLog_template -- Change intent out to inout for ciso_flux -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -- Remove crop_prog check to get rid of unassociated pointer with NAG -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -- Fix bounds type error (should be intent=in) -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 - -Machines testing ran on: (Tests in priority order) - - Note: - - 1) All PET tests will fail until openMP is fixed. - 2) All IG compsets fail with the NAG compiler due to non-compliant f77 code. - 3) If one combination fails, it's backed up with a another combination that passes. - There are one or two exceptions to this. - - I) aux_clm tests with old testlists: - - yellowstone/aux_clm intel - OK - yellowstone/aux_clm pgi - OK - frankfurt/aux_clm intel - OK - frankfurt/aux_clm pgi - OK - frankfurt/aux_clm nag - OK - - CESM history file comparison: - - yellowstone/aux_clm intel - OK - - II) aux_clm tests with new testlists: - - yellowstone/aux_clm intel - OK - yellowstone/aux_clm pgi - OK - frankfurt/aux_clm intel - OK - frankfurt/aux_clm pgi - OK - frankfurt/aux_clm nag - OK - - III) aux_clm_short tests with new testlists: - - yellowstone/aux_clm intel - OK - yellowstone/aux_clm pgi - OK - frankfurt/aux_clm intel - OK - frankfurt/aux_clm pgi - OK - frankfurt/aux_clm nag - OK - - CESM history file comparison: Not run since no baseline comparisons. - -CLM tag used for the baseline comparison tests if applicable: CLM4_5_21 with old testlist. Only ran generate with new testlists. - -Changes answers relative to baseline: Only for VIC with vertical layers. - -=============================================================== -=============================================================== -Tag name: clm4_5_21 -Originator(s): muszala (Stefan Muszala) -Date: Wed Jul 24 14:23:19 MDT 2013 -One-line Summary: ifdef and bounds refactor - -Purpose of changes: -- Almost all implementation by Mvertens -- Refactor ifdef use so that a majority are now in controlMod.F90. This is the -first step to removing them competely. -- Introduction of bounds_type and clump_type -- Refactor interfaces to support bounds_type and clump_type -- Bug fix from Sacks - -Also: Changed layout of landunit, column and pft-level arrays: Previously, all -points for a given grid cell were grouped together. Now, all points for a given -landunit type are grouped together. This improves performance of loops over -filters, because it leads to more memory locality – this will be especially true -when we add more 0-weight points to arrays for the purpose of dynamic -landunits. For example, if a processor has 2 grid cells and there are 3 landunit -types: - -Old layout in memory: (G1L1, G1L2, G1L3, G2L1, G2L2, G2L3) -New layout in memory: (G1L1, G2L1, G1L2, G2L2, G1L3, G2L3) - - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: mvertens, sacks, self - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: - -D models/lnd/clm/src/util_share/decompInitMod.F90 -D models/lnd/clm/src/util_share/ndepStreamMod.F90 -D models/lnd/clm/src/util_share/decompMod.F90 -D models/lnd/clm/src/clm4_5/main/initParametersMod.F90 - -List all files added and what they do: - -A + models/lnd/clm/src/clm4_5/main/decompInitMod.F90 -A + models/lnd/clm/src/clm4_5/main/ndepStreamMod.F90 -A + models/lnd/clm/src/clm4_5/main/decompMod.F90 -A + models/lnd/clm/src/clm4_0/main/decompInitMod.F90 -A + models/lnd/clm/src/clm4_0/main/ndepStreamMod.F90 -A + models/lnd/clm/src/clm4_0/main/decompMod.F90 - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/doc/ChangeLog -M models/lnd/clm/doc/ChangeSum -M models/lnd/clm/src/cpl_share/clm_cpl_indices.F90 -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/initch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/MEGANFactorsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4RestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNWoodProductsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVLightMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEcosystemDynIniMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSharedConstsMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 -M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -M models/lnd/clm/src/clm4_5/main/dynlandMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/pft2colMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/clm_varsur.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -M models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/main/readConstantsMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 -M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/QSatMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FracWetMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BandDiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 -M models/lnd/clm/src/clm4_0/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_0/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_0/main/controlMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_varctl.F90 -M models/lnd/clm/src/clm4_0/main/clm_driver.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: Not run - - CESM test lists: - - yellowstone/aux_clm intel BFB - yellowstone/aux_clm pgi BFB - frankfurt/aux_clm intel BFB - frankfurt/aux_clm pgi BFB - frankfurt/aux_clm nag BFB - - CESM history file comparison: - - yellowstone/aux_clm intel BFB - -CLM tag used for the baseline comparison tests if applicable: clm4_5_20 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_20 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Sat Jul 20 10:54:43 MDT 2013 -One-line Summary: refactor to allow CN and BGC params. to be read from netcdf file - -Purpose of changes: - -The first of two tags that allows all parameters to be read from a netcdf file to -provide sensitivity analysis capability, to increase modularity of code and to -remove "magic numbers" from code. This tag introduces a new namelist variable -"fconsts" which points to a netcdf file of CN and BGC parameters. In a future -tag, this netcdf file will be combined with CH4 parameters and PFT parameters. - -Values are read in readConstantsMod.F90. Each module that requires -a parameter provides a read subroutine. That read subroutine is called -from readConstantsMod.F90 and places parameters into a private type -for that module. For example, CNDecompMod.F90 provides readCNDecompConsts which -is called from readConstantsMod and populates the type instance CNConstShareInst. -CHConstShareInst is then used in CNDecompMod as: - -+ sminn_to_denit_decomp_cascade_vr(c,j,k) = -CNDecompConstInst%dnp * pmnf_decomp_cascade(c,j,k - -which replaces: - -- dnp = 0.01_r8 -... -- sminn_to_denit_decomp_cascade_vr(c,j,k) = -dnp * pmnf_decomp_cascade(c,j,k) - -A bulk of this work was completed by Rajendra Paudel. - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: new namelist variable called fconsts. - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, D. Lawrence, R. Paudel. (for design: discussion w/ mvertens, sacks, kluzek) - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: - -Renamed -D models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 -D models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 - -List all files added and what they do: - -Rename of Deleted files -A + models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeBGCMod.F90 -A + models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeCNMod.F90 - -Module to read parameters shared by multiple modules -A + models/lnd/clm/src/clm4_5/biogeochem/CNSharedConstsMod.F90 - -Module that reads shared an private parameters -A + models/lnd/clm/src/clm4_5/main/readConstantsMod.F90 - -List all existing files that have been modified, and describe the changes: - -Add fconsts namelist variable -M models/lnd/clm/bld/build-namelist -M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -Add in functionality to read parameters off of netcdf file -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK. These FAILs should pass next round: - - 418/444 < FAIL> - 423/444 < FAIL> - 428/444 < FAIL> - 433/444 < FAIL> - 438/444 < FAIL> - 443/444 < FAIL> - - CESM test lists: - -CLM45 compsets have failures for nlcomp due to the introduction of fconsts namelist variable. -For example: - -FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.test20Pgi.nlcomp -FAIL ERH_D.f19_g16.I1850CLM45CN.yellowstone_intel.GC.test20Intel.nlcomp - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - - CLM history file comparison: - - yellowstone/aux_clm intel OK - -CLM tag used for the baseline comparison tests if applicable: clm4_5_19 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_19 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Wed Jul 17 14:29:32 MDT 2013 -One-line Summary: fix setting of bd in iniTimeConst - -Purpose of changes: - -In iniTimeConst, bd (bulk density) was being set incorrectly, so that, -for a given processor, the same value was being put in all (c,j) -locations. In addition to being incorrect, this meant that results -differed depending on processor count. This tag fixes this problem. - -This only affects CLM4.5 BGC runs, because the bd array is only used -in CNNitrifDenitrifMod.F90. (However, as a side note: This array -SHOULD be used in DUSTMod and initSLakeMod, which currently recompute -bd.) - - -Requirements for tag: - -Test level of tag: - -Bugs fixed (include bugzilla ID): - 1736 (bd set incorrectly in iniTimeConst, leads to results that depend on processor count) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: mvertens - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 - - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: NO - - CESM test lists: - - yellowstone/aux_clm intel yes *** - All PASS or xFAIL - yellowstone/aux_clm pgi yes - All PASS - frankfurt/aux_clm intel yes ** - All PASS - frankfurt/aux_clm pgi yes - All PASS - frankfurt/aux_clm nag yes - All PASS - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes ** - All PASS or BFAIL1 except CLM45BGC comparisons - - test_driver.sh tools testing: - - yellowstone interactive: no - frankfurt interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_18 - -Changes answers relative to baseline: YES - -IF tag changes answers relative to baseline comparison the -following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All CLM45BGC - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Larger than roundoff; still to be determined if this gives new - climate (Dave Lawrence will run a simulation to determine this) - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: (Not yet done) - - URL for LMWG diagnostics output used to validate new climate: (Not - yet done) - -=============================================================== -=============================================================== -Tag name: clm4_5_18 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Tue Jul 9 10:07:08 MDT 2013 -One-line Summary: rework urban indexing - -Purpose of changes: - -Change urban derived type and local variables in UrbanMod subroutines to go -lbl:ubl rather than 1:num_urbanl. There are a few reasons for this: (1) this -works better when the urban filter can change (with dynamic landunits), (2) more -consistency with the rest of the CLM code, (3) no longer have to remember -whether a given variable should be indexed by fl or l. The downside is that it -leads to slightly greater memory use. - -Along with doing this, I also changed a few loops in UrbanMod to be simpler -(which is allowed with the above change). - -Also, no longer run over 0-weight urban columns - we don't have to do this any -more now that I have reworked some loops in UrbanMod. - - -Requirements for tag: - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: - - Increase in memory use by UrbanMod, which should lead to a small overall - memory increase - though this doesn't show up in most memcomp tests, showing - that the increase is pretty small. - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Major changes to indexing: local variables now dimensioned lbl:ubl - rather than 1:num_urbanl. Also, remove canyon_hwr, wtroad_perv, - ht_roof and wtlunit_roof from urban_params, because there are - duplicate variables in clmtype. -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 - -========= No longer make 0-weight urban columns active -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Remove unused wind_hgt_canyon from clmtype -M models/lnd/clm/src/clm4_5/main/clmtype.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 - -========= Minor changes for new UrbanMod interfaces -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - - - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: NO - - CESM test lists: - - yellowstone/aux_clm intel yes *** - All PASS or xFAIL - yellowstone/aux_clm pgi yes ** - All PASS - frankfurt/aux_clm intel yes ** - All PASS - frankfurt/aux_clm pgi yes - All PASS, except the following, which appears to be a system problem: - FAIL ERI_D.f19_g16.ICLM45.frankfurt_pgi.GC.214513 - I will rerun the above test once the system problem is resolved - frankfurt/aux_clm nag yes - All PASS - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes ** - All PASS or BFAIL, except the following expected failures: - - *** Expected failures because of failures in the base tests - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_17.clm2.h0 - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_Ld211_D_P112x1.f10_f10.ICNCROP.yellowstone_intel.clm-crop.compare_hist.clm4_5_17.clm2.h0 (no history file in test case) - - *** Expected differences in cols1d_active and pfts1d_active, as well as - FILLDIFFs, due to making 0-weight urban columns no longer active - FAIL ERI_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-ch4_set2_ciso.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-ch4_set3_pftroot.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.compare_hist.clm4_5_17.clm2.h1 - FAIL ERS_Ld3_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel.clm-default.compare_hist.clm4_5_17.clm2.h1 - FAIL SSP.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default.compare_hist.clm4_5_17.clm2.h1 - - - test_driver.sh tools testing: - - yellowstone interactive: no - frankfurt interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_17 - -Changes answers relative to baseline: NO, except for inconsequential changes in -1-d hist files (cols1d_active, pfts1d_active, and some FILLDIFFS, due to making -0-weight urban columns no longer active) - -=============================================================== -=============================================================== -Tag name: clm4_5_17 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Wed Jul 3 10:54:03 MDT 2013 -One-line Summary: misc cleanup and bug fixes - -Purpose of changes: - -Bit-for-bit cleanup following from tag clm4_5_11. The biggest change is the -removal of maxpatch, npatch_* and some related variables from clm_varpar (these -were maintenance headaches). - - -Requirements for tag: - -Test level of tag: standard + tools - -Bugs fixed (include bugzilla ID): - - 1747 (need 1x1_tropicAtl datasets) - 1754 (mksurfdata_map problem making CH4 parameters for ne240 CLM4.5 surface dataset) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: New 1x1_tropicAtl datasets - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - -========= Remove maxpatch, npatch_* and a few related variables that are no - longer needed (these variables were a maintenance headache) -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 - -========= Rework code to not require the variables that were removed from clm_varpar -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90 - -========= Remove unneeded 'use' statements -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 - -========= Allow roundoff-level errors (needed to make ne240 dataset) -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkCH4inversionMod.F90 - -========= Fix generation of 1x1_tropicAtl datasets -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - -========= New 1x1_tropicAtl datasets -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - - - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: yes - All PASS or xFAIL - - CESM test lists: - - yellowstone/aux_clm intel yes *** - All PASS or xFAIL - yellowstone/aux_clm pgi yes ** - All PASS - frankfurt/aux_clm intel yes ** - All PASS - frankfurt/aux_clm pgi yes - All PASS - frankfurt/aux_clm nag yes - All PASS - - Additional tests (with comparison to clm4_5_16, including - component_gen_comp; for the FARM test, used a sandbox corresponding to - cesm1_3_alpha01a for components other than CLM): - - ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel.clm-monthly_noinitial - SMS.T42_T42.FARM95C4.yellowstone_intel.clm-daily - [the clm-daily nl dir just sets hist_nhtfrq = -24] - - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes ** - All PASS or BFAIL1, except irrelevant failures from this failing test: - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_16.clm2.h0 - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_16.clm2.h1 - - test_driver.sh tools testing: - - yellowstone interactive: yes - All PASS except expected failures: - - 027 smiS4 TSMscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............\c - rc=6 FAIL - 028 bliS4 TBLscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............\c - rc=4 FAIL - - - frankfurt interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_16 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_16 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Tue Jul 2 09:22:41 MDT 2013 -One-line Summary: only run filters over 'active' points - -Purpose of changes: - -In preparation for dynamic landunits, we only want to run most filters over -'active' points. This required changing landunit and column-level filters to -only run over active points. In addition, I changed the nourbanp filter to only -run over active points (in contrast to other pft-level filters, this filter had -previously operated over non-active points, too). - -In addition, this tag includes some related changes, most of which were required -to get the code to run correctly in light of the above changes. Some of these -changes - in particular, the changes to reweightMod, filterMod, and the use of -the new filter_inactive_and_active in some places - effectively undid that -general filter change for select landunits (urban) or subroutine calls. - - -Requirements for tag: - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: none - -Describe any changes made to the namelist: none - -List any changes to the defaults for the boundary datasets: none - -Describe any substantial timing or memory changes: none - -Code reviewed by: changes to filterMod reviewed by erik, mvertens, - stefan, dave lawrence & ben andre; other changes - only by self - -List any svn externals directories updated (csm_share, mct, etc.): none - -List all files eliminated: none - -List all files added and what they do: none - -List all existing files that have been modified, and describe the changes: - -========= Change main filters to just run over active points; add new filters - that include inactive as well as active points; refactor subroutines - to avoid code duplication now that we have two groups of filters -M models/lnd/clm/src/clm4_5/main/filterMod.F90 - -========= Change filter to just run over active points -M models/lnd/clm/src/clm4_5/main/pft2colMod.F90 - -========= Change urban columns & pfts to be active whenever their landunit is - active (to avoid making urban code messier) -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Get rid of wt > 0 checks, which are no longer appropriate in the code - (checks of the active flags should be done instead - and these have - been folded in to the filters) -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 - -========= Make a loop more consistent in its use of a filter; remove undesirable - pactive check (because decomp_vertprofiles now sometimes operates on - inactive as well as active points) -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 - -========= Use filters that include inactive points in call to - decomp_vertprofiles (this is needed because of the unusual placement - of this routine in the driver sequence) -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -========= Use filters that include inactive points in calls to SurfaceAlbedo and - UrbanAlbedo. For SurfaceAlbedo, this is necessary to avoid floating - point exceptions in transient cases; for UrbanAlbedo, this probably - isn't necessary now, but likely will be needed when we have dynamic - landunits, for the same reason that we need it for SurfaceAlbedo. -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 - -========= Remove pactive check in setting up vegsol / novegsol filters - as far - as I can tell, this check is now unnecessary, and it led to the odd - result that novegsol included all inactive points (e.g., even inactive - istsoil points). Also add some comments and remove some obsolete - comments. -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 - -========= Remove pactive checks that are unnecessary now that the nourbanp - definition has changed -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 - -========= Only check errsoi_col on active columns (to prevent NaN-related - problems in crop runs) -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 - -========= Add comments -M models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -M models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 - - - - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - All PASS or xFAIL - - CESM test lists: - - yellowstone/aux_clm intel yes - All PASS or xFail - - Also ran the following, which PASSes (also PASSes cpl & clm - hist comparisons, except for expected failures in .h1 file - comparisons, as below): - ERS_Ly5.f10_f10.I20TRCRUCLM45BGC.yellowstone_intel.clm-monthly_noinitial - - yellowstone/aux_clm pgi yes - All PASS - - frankfurt/aux_clm intel yes - All PASS - frankfurt/aux_clm pgi yes - All PASS - frankfurt/aux_clm nag yes - All PASS - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes - All PASS, except: - *** Irrelevant, because this test fails - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_15.clm2.h0 - FAIL ERS.f09_g16.ICLM45VIC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_15.clm2.h1 - - *** Expected diffs in h1 files: differences in cols1d_active, - pfts1d_active, and related FILLDIFFs in a number of variables - FAIL ERI_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-vrtlay.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-ch4_set2_ciso.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS_D.f10_f10.ICLM45BGC.yellowstone_intel.clm-ch4_set3_pftroot.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS.f19_g16.ICRUCLM45BGCCROP.yellowstone_intel.clm-default.compare_hist.clm4_5_15.clm2.h1 - FAIL ERS_Ld3_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel.clm-default.compare_hist.clm4_5_15.clm2.h1 - FAIL SSP.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default.compare_hist.clm4_5_15.clm2.h1 - - test_driver.sh tools testing: - - yellowstone interactive: no - frankfurt interactive: no - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_15 - -Changes answers relative to baseline: NO, except for changes in fill -patterns & active flags in 1-d hist files, as noted above - -=============================================================== -=============================================================== -Tag name: clm4_5_15 -Originator(s): muszala (Stefan Muszala) -Date: Mon Jul 1 10:44:05 MDT 2013 -One-line Summary: complete associate refactor for pointers in clm4_5 source - -Purpose of changes: Refactor all clm4_5 source so that pointers assignements are - placed in associate blocks at the start of a subroutine. This allows us to - get rid of pointer declarations, makes the code easier to modify, makes the - code more robust and sets us up for future interface refactorings. The refactor is - explained in more detail in models/lnd/clm/tools/clm4_5/refactorTools/README. - -- real(r8), pointer :: fdry(:) ! fraction of foliage that is green and dry [-] (new) -- fdry => pps%fdry -+ associate(& -+ fdry => pps%fdry & ! Output: [real(r8) (:)] fraction of foliage that is green and dry [-] (new) -+ ) - ... -- end subroutine FracWet -+ end associate -+ end subroutine FracWet - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: BGC compsets will see increases - in memory (highwater) use. This can be seen in memcomp portions of testing with - one specific example. Something to keep track of. - - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.clm-default.GC.4515preIntel.memcomp.clm4_5_14 - - highwater goes from 166 MB in clm4_5_14 to 236 MB in clm4_5_15 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.rtm-rtmOff.GC.4515preIntel.memcomp.clm4_5_14 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.rtm-rtmOnFloodOnEffvelOff.GC.4515preIntel.memcomp.clm4_5_14 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.rtm-rtmOnFloodOnEffvelOn.GC.4515preIntel.memcomp.clm4_5_14 - FAIL ERS.f19_g16.I1850CLM45BGC.yellowstone_intel.rtm-rtmOnIceOn.GC.4515preIntel.memcomp.clm4_5_14 - FAIL ERS.f19_g16_r01.I1850CLM45BGC.yellowstone_intel.rtm-rtmOnFloodOnEffvelOff.GC.4515preIntel.memcomp.clm4_5_14 - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: - -A models/lnd/clm/tools/clm4_5/refactorTools/associate/refactor_new.pl -A models/lnd/clm/tools/clm4_5/refactorTools/associate/README - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/initch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 -M models/lnd/clm/src/clm4_5/biogeochem/MEGANFactorsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVLightMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FracWetMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Machines testing ran on: (Tests in priority order) - build-namelist unit tester: OK - - CESM test lists: - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - - CESM history file comparison: - - yellowstone/aux_clm OK - -CLM tag used for the baseline comparison tests if applicable: clm4_5_14 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_14 -Originator(s): muszala (Stefan Muszala) -Date: Thu Jun 20 07:51:54 MDT 2013 -One-line Summary: preparation for associate refactor in clm4_5_15 - -Purpose of changes: - Most work by mvertens. - - prep. work for modifying associate - - refactor subgridAveMod.F90 to accept upper and lower bounds - - remove duplicate pointer uses - - remove inicPerpMod.F90 and is_perpetual use - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: - -D models/lnd/clm/src/clm4_5/main/inicPerpMod.F90 - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/main/pft2colMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK. Fixed generate numbering. - - CESM test lists: - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel OK - -CLM tag used for the baseline comparison tests if applicable: clm4_5_13 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_13 -Originator(s): andre (Benjamin Andre,LAWRENCE BERKELEY NATIONAL LABORATORY,510-486-4617) -Date: Fri Jun 14 15:01:33 MDT 2013 -One-line Summary: hydrology reordering from Jinyun Tang - -Purpose of changes: - reordering the operations of the hydrology. hydrology with and without drainage - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: Jinyun Tang, Dave Lawrence - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 - splits out leaching - M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - add icefrac and qflx_deficit - M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 - update calls to CNEcosystemDyn - M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - update calls to CNEcosystemDyn and Hydrology - M models/lnd/clm/src/clm4_5/main/clmtype.F90 - add icefrac and qflx_deficit - M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 - splits out drainage calculations - M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - calculate water table before subsurface drainage, icefraction, water deficit - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes/no *** - - CESM test lists: - - yellowstone/aux_clm intel yes OK - yellowstone/aux_clm pgi yes OK - frankfurt/aux_clm intel no - frankfurt/aux_clm pgi no - frankfurt/aux_clm nag no - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - test_driver.sh tools testing: N/A - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_12 - -Changes answers relative to baseline: yes - -IF tag changes answers relative to baseline comparison the -following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all clm 4.5 with hydrology - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: ERS_D.f19_g16.ICLM45 - an 11-year base line simulation - was created with the standard trunk version, then a comparison run - was created with the version including hydrology re-ordering. The - comparisons were evaluated by looking at the relative differences - for hydrologic variables as QDRAI, EFLX_LH_TOT, QRUNOFF. Large - relative differences were found for these variables in a few grid - cells, but their absolute magnitudes in those grid cells were - small. Tests were also conducted with VIC hydrology on, the - change in results were similar as that when VIC hydrology was off. - - URL for LMWG diagnostics output used to validate new climate: N/A - -=============================================================== -=============================================================== -Tag name: clm4_5_12 -Originator(s): muszala (Stefan Muszala) -Date: Thu Jun 13 09:41:56 MDT 2013 -One-line Summary: NoVS test, NAG mods and remove TWS from restart file - -Purpose of changes: - - -Fix (from jedwards) for ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit test - Previous tags using ICLM45BGCNoVS are suspect! - -Since I tested this with NAG there are also port mods to CLM that I had to put in. - -Remove TWS from BiogeophysRestMod.F90 per sacks request. OK'd by swenson. - -Update to rtm1_0_29 - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): 1746 - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, NoVs error: Charlie Koven and jedwards - -List any svn externals directories updated (csm_share, mct, etc.): rtm1_0_28 -> rtm1_0_29 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - --NoVS fix and NAG mods -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 --Nag mods -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 --remove TWS from restart -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 --update to rtm1_0_29 -M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: no - - CESM test lists: - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel OK. The only differences are in ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit. - These are expected due to the fix in ch4Mod.F90. - -CLM tag used for the baseline comparison tests if applicable: clm4_5_11 - -Changes answers relative to baseline: Only for ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit. Previous - versions of this compset should be considered suspect. Fields that change (119 in total) for this test are: - - ACTUAL_IMMOB, CH4STRESS_SAT, CH4STRESS_UNSAT, CH4_AERE_DEPTH_SAT, CH4_AERE_DEPTH_UNSAT, CH4_EBUL_DEPTH_SAT, - CH4_OXID_DEPTH_SAT, CH4_OXID_DEPTH_UNSAT, CH4_PROD_DEPTH_SAT, CH4_SURF_AERE_SAT, CH4_SURF_AERE_UNSAT, - CH4_SURF_DIFF_SAT, CH4_SURF_DIFF_UNSAT, CH4_SURF_EBUL_SAT, CH4_TRAN_DEPTH_SAT, CH4_TRAN_DEPTH_UNSAT, - COL_CTRUNC, COL_NTRUNC, CONC_CH4_SAT, CONC_CH4_UNSAT, CONC_O2_SAT, CONC_O2_UNSAT, CWDC, CWDC_LOSS, - CWDC_TO_LITR2C, CWDC_TO_LITR3C, CWDN, CWDN_TO_LITR2N, CWDN_TO_LITR3N, DENIT, ER, FCH4, FCH4TOCO2, - FUELC, F_DENIT, F_N2O_DENIT, F_N2O_NIT, F_NIT, GROSS_NMIN, HR, LAND_UPTAKE, LITHR, LITR1C, LITR1C_TO_SOIL1C, - LITR1N, LITR1N_TO_SOIL1N, LITR1_HR, LITR2C, LITR2C_TO_SOIL1C, LITR2N, LITR2N_TO_SOIL1N, LITR2_HR, LITR3C, - LITR3C_TO_SOIL2C, LITR3N, LITR3N_TO_SOIL2N, LITR3_HR, LITTERC, LITTERC_HR, LITTERC_LOSS, NBP, NEE, NEM, NEP, - NET_NMIN, O2STRESS_SAT, O2_AERE_DEPTH_SAT, O2_DECOMP_DEPTH_SAT, O2_DECOMP_DEPTH_UNSAT, POTENTIAL_IMMOB, - POT_F_DENIT, POT_F_NIT, SMINN_TO_SOIL1N_L1, SMINN_TO_SOIL1N_L2, SMINN_TO_SOIL1N_S2, SMINN_TO_SOIL1N_S3, - SMINN_TO_SOIL2N_L3, SMINN_TO_SOIL2N_S1, SMINN_TO_SOIL3N_S1, SMINN_TO_SOIL3N_S2, SMIN_NH4, SMIN_NO3, - SMIN_NO3_LEACHED, SOIL1C, SOIL1C_TO_SOIL2C, SOIL1C_TO_SOIL3C, SOIL1N, SOIL1N_TO_SOIL2N, SOIL1N_TO_SOIL3N, - SOIL1_HR_S2, SOIL1_HR_S3, SOIL2C, SOIL2C_TO_SOIL1C, SOIL2C_TO_SOIL3C, SOIL2N, SOIL2N_TO_SOIL1N, - SOIL2N_TO_SOIL3N, SOIL2_HR_S1, SOIL2_HR_S3, SOIL3C, SOIL3C_TO_SOIL1C, SOIL3N, SOIL3N_TO_SOIL1N, SOIL3_HR, - SOILC, SOILC_HR, SOILC_LOSS, SOMHR, SR, TOTCOLC, TOTCOLCH4, TOTCOLN, TOTECOSYSC, TOTECOSYSN, TOTLITC, TOTLITN, - TOTSOMC, TOTSOMN - -=============================================================== -=============================================================== -Tag name: clm4_5_11 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Tue Jun 11 20:54:11 MDT 2013 -One-line Summary: Change pct_pft and related surface dataset variables to be % of landunit - -Purpose of changes: - -Main purpose is to change pct_pft and related surface dataset variables to be % -of landunit rather than % of grid cell. This is needed to support transient PFTs -with dynamic landunits. This required substantial changes in both mksurfdata_map -and CLM. This also required generating all new surface datasets. - -A very related change is the separation of PCT_PFT in the surface dataset into -PCT_NAT_PFT and PCT_CFT; in addition to these two variables, there are also new -PCT_NATVEG (% of natural veg landunit on the gridcell) and PCT_CROP (% of crop -landunit on the gridcell) variables. Note that the separation of PCT_PFT into -natural vs crop was only done on the surface dataset -- raw datasets to -mksurfdata_map have not been changed, nor have most of the CLM data structures. - -In addition, this tag includes the following: - -(1) Renumbered landunits to (a) add separate landunit numbers for each urban -landunit, (b) do away with the obsolete shallow lake, and (c) group together -similar landunits - -(2) In any urban landunit, allocate space for ALL urban columns. Previously, -there were some urban landunits with only one of the two road types. This change -simplifies the code and only adds a relatively small number of columns in memory. - -(3) Modified interpinic, partly to have compatibility with (1), partly to fix -urban bug (allowed by (1)), and partly to fix an unrelated bug - -(4) All new initial conditions for CLM4.5, to have compatibility with (1) and (2) - -(5) Check _OPENMP in initialization rather than driver - -(6) Tighten error check in reweightMod: checkWeights. It seems like this error -check can be stricter with the new pct_pft formulation - - -Requirements for tag: Standard test + tools - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1621 (normalization issue in ne120np4 datasets and in CLM) - 1675 (need to relax error tolerance in reweightMod: weightsOkay) -- note - that I have actually TIGHTENED the tolerance, but that seems to be - okay now - 1702- PARTIAL FIX (clm4.5 interpinic doesn't work right for urban) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - - 1747 - need 1x1_tropicAtl surface dataset and pftdyn dataset for clm4_5_11 and later - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: Changes to fsurdat and finidat for -CLM4.5, as described below - -List any changes to the defaults for the boundary datasets: - - For CLM4.5, all surface datasets and initial conditions files have been - recreated. For surface datasets, changes result in only roundoff-level - differences in the pct_* fields. For initial conditions, the new initial - conditions are effectively the same as the old, but bugs in interpinic - prevent them from being exactly the same. - -Describe any substantial timing or memory changes: - - Slight (probably < 1%) increase in memory for all CLM4.5 cases, due to - allocation of ALL urban columns wherever there is an urban landunit - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): NONE - -List all files eliminated: - -========= Remove unneeded modules (iulog moved to fileutils.F90) -D models/lnd/clm/tools/clm4_5/mksurfdata_map/src/clm_varpar.F90 -D models/lnd/clm/tools/clm4_5/mksurfdata_map/src/clm_varctl.F90 - -========= Now differs for clm4_0 and clm4_5, so copied to those two places -D models/lnd/clm/src/util_share/clm_varsur.F90 - -========= Replaced with new file for testing interpinic -D models/lnd/clm/tools/clm4_5/interpinic/clmi.BCN.1949-01-01_10x15_USGS_simyr1850_c121113.nc - - -List all files added and what they do: - -========= New file for testing interpinic -A models/lnd/clm/tools/clm4_5/interpinic/clmi.I2000CLM45BGC.2000-01-01.10x15_simyr2000_c130607.nc - -========= Add tests -A models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkpftMod.F90 - -========= Moved from util_share -A models/lnd/clm/src/clm4_0/main/clm_varsur.F90 - -========= Moved from util_share, and modified extensively to support new surface - dataset format -A models/lnd/clm/src/clm4_5/main/clm_varsur.F90 - -========= Add module to do some initialization that doesn't fit well elsewhere, - and/or can't go elsewhere because of circular dependencies -A models/lnd/clm/src/clm4_5/main/initParametersMod.F90 - - -List all existing files that have been modified, and describe the changes: - -========= Change pct_pft and related variables on surface dataset to be % of - landunit; this requires significant changes for mkpftMod, mkglcmecMod - and the error checks / corrections done in mksurfdat.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkutilsMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/fileutils.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkfileMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkglcmecMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkvarpar.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mksurfdat.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Srcfiles -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/mkpftMod.F90 - -========= Add tests -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mkutilsMod.F90 -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/Srcfiles -M models/lnd/clm/tools/clm4_5/mksurfdata_map/unit_testers/test_mksurfdata_map.F90 - -========= Update crop landunit numbering, fix urban bug for column-level - variables, take code out of a conditional to prevent floating point - exceptions -M models/lnd/clm/tools/clm4_5/interpinic/src/interpinic.F90 - -========= New files for testing interpinic -M models/lnd/clm/tools/clm4_5/interpinic/interpinic.runoptions - -========= Change landunit and column numbering; delete udenstype -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 - -========= Add variables for determining number of natural & crop PFTs -M models/lnd/clm/src/clm4_5/main/clm_varpar.F90 - -========= Major changes to handle pct_pft being specified as % of landunit - rather than % of gridcell -M models/lnd/clm/src/clm4_5/main/surfrdMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 - -========= Initialize new surface variables, check _OPENMP here instead of driver -M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 - -========= Update comments, remove udenstype -M models/lnd/clm/src/clm4_5/main/clmtype.F90 - -========= Change 'use' statements, use ltype instead of udenstype, fix - initialization for 0-weight columns -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 - -========= Add some consistency checks (moved here from clmtypeInitMod), change others -M models/lnd/clm/src/clm4_5/main/clm_varctl.F90 - -========= Change 'use' statements; use urbpoi rather than isturb; remove - references to 'istslak' -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNEcosystemDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInputMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -M models/lnd/clm/src/clm4_5/main/dynlandMod.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - -- also, remove udenstype, and move some consistency checks elsewhere -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/restFileMod.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 - -- also, move _OPENMP check to initialization -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -M models/lnd/clm/src/clm4_5/main/inicPerpMod.F90 -M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 - -========= Tighten tolerance for error check -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 - -========= Use 'crop_prog' rather than the CROP CPP def -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 - -========= New surface datasets and initial conditions -M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - -========= Change environment variable in component_gen_comp command to something universal -M .ChangeLog_template - -========= Restore a failing test (see bug 1658) -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - - - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - - All PASS or xFail except for the following expected baseline failures: - 418/444 < FAIL> - 423/444 < FAIL> - 428/444 < FAIL> - 433/444 < FAIL> - 438/444 < FAIL> - 443/444 < FAIL> - - - CESM test lists: - - yellowstone/aux_clm intel yes - Tests themselves: All PASS or xFail, except - ERB.ne30_g16.I_1948-2004.yellowstone_intel, which I have re-added to the - xFail list (see bugz 1658) - - Comparisons: Some nlcomp and compare_hist failures, as expected - - yellowstone/aux_clm pgi yes - All PASS or xFail except for some nlcomp & compare_hist failures (expected) - - frankfurt/aux_clm intel yes - All PASS or xFail except for some nlcomp & compare_hist failures (expected) - - frankfurt/aux_clm pgi NO - - frankfurt/aux_clm nag yes - All PASS or xFail except for nlcomp failures (expected) - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $CESMDATAROOT/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes - - Some compare_hist failures for CLM4.5 tests, as expected - - test_driver.sh tools testing: - - yellowstone interactive: yes - All PASS except for expected baseline failures: - 012 blg54 TBLtools.sh clm4_5 mksurfdata_map tools__s namelist ...................................rc=7 FAIL - 016 blh54 TBLtools.sh clm4_5 interpinic tools__ds runoptions ....................................rc=7 FAIL - 020 bli24 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds rc=7 FAIL - 022 bli53 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__o ....rc=7 FAIL - 024 bli54 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ds ...rc=7 FAIL - 026 bli57 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__do ...rc=7 FAIL - 032 bliT4 TBLscript_tools.sh clm4_5 mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools_rc=7 FAIL - - and expected failures: - 027 smiS4 TSMscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............rc=6 FAIL - 028 bliS4 TBLscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional .............rc=4 FAIL - - - frankfurt interactive: NO - - yellowstone/PTCLM: NO - -CLM tag used for the baseline comparison tests if applicable: clm4_5_10 - -Changes answers relative to baseline: YES - -IF tag changes answers relative to baseline comparison the -following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: Changes in all CLM4.5 configurations. See below - for details - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Mostly roundoff, but some larger than roundoff -- see below for details. - - Changes are limited to CLM4.5. Where the below notes refer to "all - configurations", this is really limited to CLM4.5 configurations. - - For all configurations, there are roundoff-level changes due to - roundoff-level differences in subgrid weights. These changes can quickly - grow to greater than roundoff (which I believe is due to nonlinear - feedbacks with snow variables), but as described below, I have verified - that the root cause of differences is this roundoff-level change. - - For cases that use initial conditions, where these initial conditions were - previously interpinic'ed, there are greater-than-roundoff level changes - due to various bugs and limitations of interpinic (for example, some - fields, like tsai, are skipped). I took pains to ensure that, for cases - using original (non-interpinic'ed) initial conditions in clm4_5_10 and - prior, the new initial conditions are nearly identical to the old (but not - entirely identical, due to bug 1702 - see comment 2); this applies to most - f09 initial conditions. However, this was not practical for cases that - used interpinic'ed files; this applies to f19, ne30 and hcru initial - conditions, as well as f09 BGCDV initial conditions. So for this latter - set of cases, there can be large differences from clm4_5_10, especially at - the start of the simulation. - - There are also greater than roundoff-level changes for some glc_mec - virtual columns, because we now use information on topo_glc_mec whenever - we can. - - There are also greater than roundoff-level changes in subgrid weights in - virtual (0-weight) glc_mec and crop landunits, now that we no longer use - arbitrary subgrid weights there; I don't think this will affect anything - important, though. - - Some tests that exhibited larger-than-usual changes from baseline, in cpl - hist and/or clm hist files, were the following (ignoring changes that can - be explained by the above notes): - - ERS_Lm3.f19_g16.IGRCP60CLM45CN.yellowstone_intel - ERS_D.f19_g16.ICLM45GLCMEC.yellowstone_intel.clm-glcMEC - ERS_D.f10_f10.ICLM45BGCNoVS.yellowstone_intel.clm-rootlit - ERS_Ld3_D_P64x1.ne30_g16.ICLM45CN.yellowstone_intel.clm-default - - From these results, it seems that large changes may occur more often in - glc_mec runs, even above and beyond the virtual column changes that are - expected, as noted above. - - For the four above tests, I verified that differences were attributable to - the roundoff-level changes in subgrid weights, using the procedure - documented below. - - - If bitwise differences were observed, how did you show they were no worse - than roundoff? - - In order to confirm that answers only differed by roundoff, I ran 7 - additional tests (these tests all had nl_dirs, but that was not central to - these tests, so I'm not listing them here): - - SMS_Lm1.f19_g16.I_1850_CLM45_BGC - SMS_Ly2.T31_g37.IG1850CLM45CN - SMS_Ly5.T31_g37.I20TRCRUCLM45BGC - SMS_Ly5.T31_g37.ICLM45BGCDV - SMS_Ly5.T31_g37.I_2000_CLM45_BGC - SMS_Ly5.f10_f10.ICLM45BGCDVCROP - SMS_Ly5.f10_f10.I_2000_CLM45_BGC_CROP - - Each test was done as follows: - - (1) Created baselines from clm4_5_04 - - (2) Ran tests from a branch (allocate_all_urban_cols), where all I changed - from the baseline was (a) wherever we have an urban landunit, create ALL - urban landunits, and (b) for f19, change finidat files to use a new, - interpinic'ed file based on the original. Confirmed that this was bfb with - (1) except for (a) 1-d history files (now have extra urban columns), and - (b) any CLM4.5 test that uses initial conditions, since interpinic is - currently broken for urban. - - Side-note: I actually confirmed bfb behavior for the full yellowstone - aux_clm test suite, in addition to the above 7 tests - - This extra branch was necessary because I cannot compare 1-d history files - directly between my main branch and the trunk, because of the extra urban - columns present in the new code. - - - (3) Ran these 7 tests from my main branch, off of clm4_5_04, comparing - with (2). For this comparison, I only confirmed that the subgrid weights - were the same within roundoff (up to about 1e-12 differences for the - transient case; smaller for other cases). Note that greater than - roundoff-level changes are seen in many other fields, presumably because - small differences in subgrid pft weights can cause differences in how - variables are averaged from pft to column. This, in turn, can lead to - larger changes due to nonlinearities in the system (e.g., snow). The - following steps were taken to confirm that other differences between my - branch and the trunk were only due to these small differences in subgrid - weights. - - That is, I am confirming that: - (a) the only differences in the branch are subgrid weights - (b) these subgrid weights only differ by roundoff - - - (4) Reran (2), but with extra code to write out subgrid weights (including - writing these weights at every time step for pftdyn) -- from branch - allocate_all_urban_cols_writeWeights - - (5) Reran (3), but with extra code to read the subgrid weights written in - (4). Confirmed that, with this one-off, my branch was bfb with (4). - - -=============================================================== -=============================================================== -Tag name: clm4_5_10 -Originator(s): muszala (Stefan Muszala) -Date: Mon Jun 10 13:10:31 MDT 2013 -One-line Summary: refactor clmtype - -Purpose of changes: Refactor clmtype so that there is only one level of indirection. - - call hist_addfld1d (fname='SNOOCFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of OC in snow (land) ', & -- ptr_pft=clm3%g%l%c%p%pef%sfc_frc_oc, set_urb=spval) -+ ptr_pft=pef%sfc_frc_oc, set_urb=spval) - -There is a README (with more detailed information) and a script to help with future merges in: - - models/lnd/clm/tools/clm4_5/refactorTools/clmType/{README & renameClmType.pl} - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, mvertens - -List any svn externals directories updated (csm_share, mct, etc.): N/A - -List all files eliminated: N/A - -List all files added and what they do: - -- script and README for refactoring clmType -A models/lnd/clm/tools/clm4_5/refactorTools -A models/lnd/clm/tools/clm4_5/refactorTools/associate -A models/lnd/clm/tools/clm4_5/refactorTools/clmType -A models/lnd/clm/tools/clm4_5/refactorTools/clmType/renameClmType.pl -A models/lnd/clm/tools/clm4_5/refactorTools/clmType/README - -List all existing files that have been modified, and describe the changes: - -- major refactor in these to flatten clmtype -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtype.F90 - -- change derived type access to match those of clmtype -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGapMortalityMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNitrifDenitrifMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNGRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/initch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNBalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNMRespMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_BGC.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVerticalProfileMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4RestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNWoodProductsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPrecisionControlMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVLightMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate3Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/VOCEmissionMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEcosystemDynIniMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAnnualUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNStateUpdate2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompCascadeMod_CENTURY.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNNDynamicsMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSetValueMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNVegStructUpdateMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSoilLittVertTranspMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_varcon.F90 -M models/lnd/clm/src/clm4_5/main/CNiniTimeVar.F90 -M models/lnd/clm/src/clm4_5/main/dynlandMod.F90 -M models/lnd/clm/src/clm4_5/main/subgridRestMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/pftdynMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/pft2colMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/initSurfAlbMod.F90 -M models/lnd/clm/src/clm4_5/main/filterMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -M models/lnd/clm/src/clm4_5/main/initGridCellsMod.F90 -M models/lnd/clm/src/clm4_5/main/initSoilParVICMod.F90 -M models/lnd/clm/src/clm4_5/main/CNiniSpecial.F90 -M models/lnd/clm/src/clm4_5/main/inicPerpMod.F90 -M models/lnd/clm/src/clm4_5/main/reweightMod.F90 -M models/lnd/clm/src/clm4_5/main/mkarbinitMod.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SnowHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FrictionVelocityMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/TridiagonalMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeHydrologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BiogeophysRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/ActiveLayerMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/clm_driverInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CLMVICMapMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BareGroundFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/initSLakeMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Biogeophysics2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/FracWetMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/UrbanInitMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SLakeRestMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceAlbedoMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology2Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: no - - CESM test lists: - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - - CESM history file comparison: - - yellowstone/aux_clm intel - -CLM tag used for the baseline comparison tests if applicable: clm4_5_09 - -Changes answers relative to baseline: No. Everything in this refactor should be BFB. - -=============================================================== -=============================================================== -Tag name: clm4_5_09 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Tue Jun 4 15:59:07 MDT 2013 -One-line Summary: volr and vic fix, update mct and rtm - -Purpose of changes: add volr area correction, minor vic fix from maoyi, update mct and - rtm externals - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, swenson - -List any svn externals directories updated (csm_share, mct, etc.): --models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_27 -+models/rof/rtm https://svn-ccsm-models.cgd.ucar.edu/rivrtm/trunk_tags/rtm1_0_28 - --models/utils/mct https://github.com/MCSclimate/MCT/tags/MCT_2.8.3 -+models/utils/mct https://github.com/quantheory/MCT/tags/compiler_fixes_n01_MCT_2.8.3 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -- fix for VIC hydrology -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -- volr area correction -M models/lnd/clm/src/cpl_mct/lnd_comp_mct.F90 -M models/lnd/clm/src/cpl_esmf/lnd_comp_esmf.F90 -- mct and rtm update -M SVN_EXTERNAL_DIRECTORIES -- clean up -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK - - CESM test lists: - - yellowstone/aux_clm intel OK - yellowstone/aux_clm pgi OK - frankfurt/aux_clm intel OK - frankfurt/aux_clm pgi OK - frankfurt/aux_clm nag OK - -CLM tag used for the baseline comparison tests if applicable: clm4_5_08 - -Changes answers relative to baseline: only for VIC compsets. VOLR diagnostic changes. - -=============================================================== -=============================================================== -Tag name: clm4_5_08 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Mon Jun 3 13:29:30 MDT 2013 -One-line Summary: port for NAG compiler - -Purpose of changes: Bring in Sean Santos mods, port clm4_5 and test with the NAG compiler on Frankfurt. - -Requirements for tag: N/A - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): 1721 - Jim Edwards fixed problem in PIO - -Known bugs (include bugzilla ID): 1722 - Error in some VIC tests starting in clm4_5_07 - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, Santos - -List any svn externals directories updated (csm_share, mct, etc.): PIO - update to pio1_7_2 - -List all files eliminated: - -D models/lnd/clm/src/util_share/nanMod.F90 - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/unit_testers/xFail/expectedFail.pm -M models/lnd/clm/src/util_share/clm_time_manager.F90 -M models/lnd/clm/src/util_share/accumulMod.F90 -M models/lnd/clm/src/util_share/ndepStreamMod.F90 -M models/lnd/clm/src/util_share/ncdio_pio.F90 -M models/lnd/clm/src/util_share/spmdMod.F90 -M models/lnd/clm/src/util_share/domainMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCIsoFluxMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNSummaryMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/ch4varcon.F90 -M models/lnd/clm/src/clm4_5/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDecompMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNCStateUpdate1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_5/biogeochem/CNC14DecayMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_5/main/subgridMod.F90 -M models/lnd/clm/src/clm4_5/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_5/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_5/main/histFileMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_5/main/controlMod.F90 -M models/lnd/clm/src/clm4_5/main/clm_driver.F90 -M models/lnd/clm/src/clm4_5/main/pftvarcon.F90 -M models/lnd/clm/src/clm4_5/main/histFldsMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/BalanceCheckMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilTemperatureMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/Hydrology1Mod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SNICARMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/CanopyFluxesMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SurfaceRadiationMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/H2OSfcMod.F90 -M models/lnd/clm/src/clm4_5/biogeophys/SoilHydrologyMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CropRestMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/DUSTMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNPhenologyMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/STATICEcosysDynMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNAllocationMod.F90 -M models/lnd/clm/src/clm4_0/biogeochem/CNDVEstablishmentMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_glclnd.F90 -M models/lnd/clm/src/clm4_0/main/subgridMod.F90 -M models/lnd/clm/src/clm4_0/main/accFldsMod.F90 -M models/lnd/clm/src/clm4_0/main/clmtypeInitMod.F90 -M models/lnd/clm/src/clm4_0/main/pftvarcon.F90 -M models/lnd/clm/src/clm4_0/main/iniTimeConst.F90 -M models/lnd/clm/src/clm4_0/main/histFileMod.F90 -M models/lnd/clm/src/clm4_0/main/clm_atmlnd.F90 -M models/lnd/clm/src/clm4_0/biogeophys/SNICARMod.F90 -M SVN_EXTERNAL_DIRECTORIES - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: - OK. - - yellowstone/aux_clm intel - OK. - yellowstone/aux_clm pgi - OK. - One BFAIL for hcru_hcru which should pass next time around. Bug fixed when upgrading to pio1_7_2. - BFAIL ERS_D.hcru_hcru.I_2000_CRUFRC_CLM45_CN.yellowstone_pgi.GC.08testPgi.compare_hist.clm4_5_07 - frankfurt/aux_clm intel - OK. - frankfurt/aux_clm pgi - OK. - frankfurt/aux_clm nag - OK. No baselines to compare against. - -CLM tag used for the baseline comparison tests if applicable: clm4_5_07 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_07 -Originator(s): erik (Erik Kluzek) -Date: Fri May 31 02:49:45 MDT 2013 -One-line Summary: New spinup files for CLM45 AND RTM, work on PTCLM, turn drydep off by default, update externals - -Purpose of changes: - - Bring in new spinup finidat files (f09_g16@1850 for SP and BGC). interpinic to 2deg, hcru_hcru and ne30. - New spinup finidat files for BGCCROP and BGCDV (f19 and f09 respectively) - New spinup finidat files for 2000 (f09_g16 for SP and BGC) - Update RTM to bring in finidat_rtm files for either 1850 or 2000. - Update scripts, Machines, pio - scripts includes update for CLM40CRU hybrid startup - Turn drydep namelist off by default - Do a lot of work on getting PTCLM working and tools working for single-point. - -Requirements for tag: - New spinup files, fix bugs: 1708, 1700 - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1715 (rmdups.ncl fails for no-overlap case) - 1714 (mkscripgrid.ncl doesn't calculate corners correctly.) - 1708 (Need Initial conditions for RTM) - 1706 (VIC tests fail) - 1700 (Memory leak in MPI layer on yellowstone) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: drydep namelist now OFF by default - -List any changes to the defaults for the boundary datasets: New initial conditions - Native initial conditions for f09 for: - I1850CLM45SP, I1850CLM45BGC, ICLM45SP, ICLM45BGC - Interpinic for: - I1850CLM45 & I1850CLM45BGC: f19, hcru_hcru, ne30 - ICLM45BGCCROP @ f19 - ICLM45BGCDB @ f09 - - ALSO NOTE THAT NOW RTM HAS INITIAL CONDITIONS FOR R05 -- SO RIVERFLOW CHANGES - FOR BOTH CLM45 AND CLM40 - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): many - csm_share, pio, scripts, Machines, RTM, cprnc, mapping - - - scripts to scripts4_130529 (update PTCLM, send simyr to RTM, new IC for CLM40CRUCN) - csm_share to share3_130528 - rtm to rtm1_0_27 (Set startup initial condition files by -simyr flag) - Machines to Machines_130529 (Set hcru_hcru PE-layout, and PE-layout on yellowstone for f09 I cases) - pio to pio1_7_1 - cprnc to cprnc_130425 - mapping to mapping_130509 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/test/tools/TBLCFGtools.sh --- Correctly point to TSMCFGtools rather than TSMtools.sh. - - M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - Add -usr_mapdir option - - M models/lnd/clm/tools/shared/mkmapdata/rmdups.ncl ------ Exit early if n_s==0 - M models/lnd/clm/tools/shared/mkmapdata/mkmapdata.sh ---- Skip if file already exists, give - directory for rmdups.ncl - M models/lnd/clm/tools/shared/mkmapdata/mknoocnmap.pl --- Don't hide NCL output - M models/lnd/clm/tools/shared/mkmapgrids/mkscripgrid.ncl Explicitly calculate corners - - M models/lnd/clm/bld/build-namelist - Set drydep to off by default, check crop setting for finidat files - - M models/lnd/clm/bld/clm.buildnml.csh - Add back logic in about ignoring IC year or date - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml - New initial conditions for: - Native initial conditions for f09 for: - I1850CLM45SP, I1850CLM45BGC, ICLM45SP, ICLM45BGC - Interpinic for: - I1850CLM45SP & I1850CLM45BGC: f19, hcru_hcru, ne30 - ICLM45BGCCROP @ f19 - ICLM45BGCDB @ f09 - M models/lnd/clm/bld/namelist_files/namelist_defaults_usr_files.xml - Use surfdata_map rather than surfdata - for CLM_USRDAT_NAME fsurdat files - - M models/lnd/clm/bld/namelist_files/use_cases/stdurbpt_pd.xml - Remove setting of dtime, adjust hist output - - More work on readme files... - - M README - M models/lnd/clm/doc/IMPORTANT_NOTES - M models/lnd/clm/doc/Quickstart.GUIDE - M models/lnd/clm/doc/Quickstart.userdatasets - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/aux_clm intel yes - yellowstone/aux_clm pgi yes - frankfurt/aux_clm intel yes - frankfurt/aux_clm pgi yes - - CESM history file comparison: - (ccsm_utils/Tools/component_gen_comp -compare $oldtag -generate $newtag -testid $testid -baselineroot $GLDCSEG/ccsm_baselines/ -model clm2) - - yellowstone/aux_clm intel yes - - test_driver.sh tools testing: - - yellowstone interactive: yes - frankfurt interactive: yes - - yellowstone/PTCLM: yes! - -CLM tag used for the baseline comparison tests if applicable: clm4_5_06 - -Changes answers relative to baseline: Yes -- due to new initial condition files - for I1850CLM45SP and I1850CLM45BGC @ f09, f19, hcru, ne30 - ICLM45SP and ICLM45BGC @ f09 - ICLM45BGCCROP @ f19 and ICLM45BGCDB @ f09 - and ICLM40CRUCN @ f09 - - AND new initial conditions for RTM for ALL R05 grids - - And turning drydep namelist off in the driver causes answers to appear to be different - when comparing coupler history files. - -=============================================================== -=============================================================== -Tag name: clm4_5_06 -Originator(s): erik (Erik Kluzek) -Date: Wed May 15 13:52:43 MDT 2013 -One-line Summary: A few small bug fixes, more updates to README files - -Purpose of changes: - More work on README files and documentation. - Fix from Danica/Bill for transient simulations. - Fix from Zack for Lake output variables - Another multi-instance script fix. - Fix tropixAtl pftdyn filename. - Remove models/lnd/clm/bld/config_query as doesn't work with new CESM scripts. - -Requirements for tag: - Requirements: Fix bug: 1697, 1691, 1675, fix tropicAtl fpftdyn file, minimal testing on frankfurt - -Test level of tag: critical - -Bugs fixed (include bugzilla ID): - 1675 (need to relax error tolerance in reweightMod: weightsOkay) - 1691 (Scripts issue for multi-instance for CLM/RTM) - 1697 (ZLAKE and DZLAKE are NOT set) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: Fix 1x1_tropicAtl fpftdyn file - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, sacks (transient fix), dlawren/subin (lake fix), jedwards (multi-instance scripts) - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: testing namelist files for old CLM standalone - - D models/lnd/clm/bld/config_query --- no longer works with new CESM scripts - - D models/lnd/clm/test/tools/nl_files/nl_ch4_set2_ciso - D models/lnd/clm/test/tools/nl_files/nl_ch4_set3_pftroot - D models/lnd/clm/test/tools/nl_files/nl_rootlit - D models/lnd/clm/test/tools/nl_files/nl_ciso - D models/lnd/clm/test/tools/nl_files/nl_anoxia_wtsat - D models/lnd/clm/test/tools/nl_files/nl_vrtlay - D models/lnd/clm/test/tools/nl_files/nl_oldhyd - -List all files added and what they do: - - A models/lnd/clm/tools/clm4_5/interpinic/addmetadata --- Add script to add important meta-data to finidat files. - -List all existing files that have been modified, and describe the changes: - ----------------- Work on README files documentation - M models/lnd/clm/test/tools/config_files/README - M models/lnd/clm/test/tools/README - M models/lnd/clm/test/tools/README.testnames - M models/lnd/clm/tools/README - M models/lnd/clm/doc/IMPORTANT_NOTES - M models/lnd/clm/doc/Quickstart.GUIDE - M models/lnd/clm/doc/README - ----------------- - M models/lnd/clm/bld/config_files/config_definition.xml ------------ Document experimental settings / fix syntax error - M models/lnd/clm/bld/clm.buildnml.csh ------------------------------ Multi-instance fix - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml --- Fix 1x1_tropicAtl fpftdyn filename - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml - Document experimental settings - ----------------- - M models/lnd/clm/src/clm4_5/main/histFileMod.F90 ---- ZLAKE/DZLAKE fix - M models/lnd/clm/src/clm4_5/main/subgridAveMod.F90 -- ZLAKE/DZLAKE fix - M models/lnd/clm/src/clm4_5/main/reweightMod.F90 ---- Increase tolerance to 1.e-7 so transient - simulations can run their full course. - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: yes - - CESM test lists: (limited testing on yellowstone/aux_clm/intel) - - frankfurt/aux_clm pgi yes - frankfurt/aux_clm intel yes - -CLM tag used for the baseline comparison tests if applicable: clm4_5_04 - -Changes answers relative to baseline: no (bit-for-bit) - -=============================================================== -=============================================================== -Tag name: clm4_5_05 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Tue May 14 13:15:12 MDT 2013 -One-line Summary: hcru bug fixes - -Purpose of changes: update pio tag and nfire init. mod - -Requirements for tag: N/A - -Test level of tag: Only run hcru_hcru tests - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self, Fang and Erik for nfire problem - -List any svn externals directories updated (csm_share, mct, etc.): update pio to 1_7_0 - -List all files eliminated: N/A - -List all files added and what they do: N/A - -List all existing files that have been modified, and describe the changes: - --- nfire init. changed from nan to spval to fix problem with hcru_hcru debug + intel runs -M models/lnd/clm/src/clm4_5/main/clmtypeInitMod.F90 - -Machines testing ran on: Only testing hcru_hcru resolutions - -Yellowstone Tests: - - The following were run with DEBUG=TRUE and for 1 day initial + 1 day restart - hcru_hcru_I_2000_CRUFRC_CLM45_CN_yellowstone_gnu_pioFixed/ PASS - hcru_hcru_I_2000_CRUFRC_CLM45_CN_yellowstone_intel_pioFixed/ PASS - hcru_hcru_I_2000_CRUFRC_CLM45_CN_yellowstone_pgi_pioFixed/ PASS - - ERS_D.hcru_hcru.I_2000_CRUFRC_CLM45_CN.yellowstone_intel.125102 PASS - ERS_D.hcru_hcru.I_2000_CRUFRC_CLM45_CN.yellowstone_pgi.125128 PASS - -Frankfurt Tests: - - The following were run with DEBUG=TRUE and for 1 day initial + 1 day restart - hcru_hcru_I_2000_CRUFRC_CLM45_CN_frankfurt_pgi_pioFixed/ PASS - hcru_hcru_I_2000_CRUFRC_CLM45_CN_frankfurt_intel_pioFixed/ FAIL initial run (this is - likely related to other existing MPI problems on Frankfurt). - -CLM tag used for the baseline comparison tests if applicable: N/A - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_04 -Originator(s): erik (Erik Kluzek) -Date: Mon May 13 12:25:14 MDT 2013 -One-line Summary: Fix the previous broken tag - -Purpose of changes: - -Fix the problems in the clm4_5_03 untested tag. - -Requirements for tag: Fix bug 1692, 1693 - -Test level of tag: standard - -Bugs fixed (include bugzilla ID): - 1693 (Misc. issues with clm4_5_03) - 1692 (externals screwed up in clm4_5_03) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): externals updated to those in SVN_EXTERNAL_DIRECTORIES - -List all files eliminated: Remove test/system as replaced by CESM testing - - models/lnd/clm/test/system -- Delete the whole directory tree - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/src/clm4_0/main/clm_initializeMod.F90 -- fixed screwed up code - -Machines testing ran on: (Tests in priority order) - Standard Tag Pretag *** Standard Tag Posttag ** - - build-namelist unit tester: yes - - CESM test lists: - - yellowstone/aux_clm intel yes - yellowstone/aux_clm pgi yes - frankfurt/aux_clm intel yes - frankfurt/aux_clm pgi yes - -CLM tag used for the baseline comparison tests if applicable: clm4_5_01 - -Changes answers relative to baseline: No - -=============================================================== -=============================================================== -Tag name: clm4_5_03 -Originator(s): erik (Erik Kluzek) -Date: Fri May 10 17:29:56 MDT 2013 -One-line Summary: Several bug fixes for release, urban and test single point surface datasets - -Purpose of changes: - - Some work on IMPORTANT_NOTES file. - Fix PTS_MODE restarts from John Truesdale. (implimented, but there are still issues) - Fix history change number of tapes on startup issue. - Bring in urban single pt surface datasets and single pt test: mexicocityMEX, vancouverCAN , urbanc_alpha, 1x1_tropicAtl, 1x1_smallvilleIA - Drydep use before defined problem. - Always bypass first two time-steps for CN/BGC. - Fix gregorian calendar on history files. - Remove two fields on clm45 fpftdata file as per Gordon Bonan. - ncd_pio fix from Jim Edwards/Mariana V. - set nsegspc=20 for HOMME and high resolution grids. - Change documentation on CLM build-namelist -drydep, but keep it default on (will change to off in next tag) - Remove a bunch of datm/drv fields in namelist_definition. - Fix some issues with Crop and DV that Sam found. - Fix a scripts issue with multi-instance. - Update RTM (multi-instance fix, allow null grid). - Update test list so that CLM45/DV/CROP are exercised. - Update scripts/machines tag because of multiple problems. - -Requirements for tag: fix bug 1488, 1673, 1677, 1682, 1653, 1689, 1690, 1687, 1688, 1685, 1691 - -Test level of tag: limited! - -Bugs fixed (include bugzilla ID): - - 1025 (partial -- implement changes from John Truesdale so SCAM can read global IC files) - 1488 (HOMME grids can not use nsegspc=20) - 1653 (Calls to PIO are not properly done) - 1673 (B compset gregorian calendar not reflected in CLM history) - 1677 (Remove bypass_CN_balance_check_on_restart in CLM45) - 1682 (Problem starting up CLM with no history files) - 1685 (use before define issue in DryDeposition) - 1687 (SBN scripts bug) - 1688 (misc. issues with new create_test) - 1689 (CLM45 dgvm does not build) - 1690 (CLM45 CNDV lightning namelist is missing) - 1691 (Scripts issue for multi-instance) - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None - -Describe any changes made to the namelist: - Set nsegspc=20 for HOMME and f05/f02 resolutions - Set stream_fldfilename_lightng for CLM45/CNDV - -List any changes to the defaults for the boundary datasets: New single-point test and urban datasets - New surface datsets for: mexicocityMEX, vancouverCAN, urbanc_alpha, 1x1_tropicAtl, 1x1_smallvilleIA - New fpftdyn for: 1x1_tropicAtl 1850-2005 - New pft-physiology file for CLM45 with three fields removed that were NOT being read in (qe25, mp, and resist) - -Describe any substantial timing or memory changes: None - -Code reviewed by: self, jedwards/mvertens (fix for bug 1653), jet (fix for bug 1025), slevis (fixes for DV) - -List any svn externals directories updated (csm_share, mct, etc.): Machines, scripts, rtm - Machines to Machines_130509 - scripts to scripts4_130510 - rtm to rtm1_0_25 - -List all files eliminated: None - -List all files added and what they do: None - -List all existing files that have been modified, and describe the changes: - - M models/lnd/clm/bld/build-namelist ---- Document drydep as if it's off (will actually become off in next tag) - M models/lnd/clm/bld/clm.buildnml.csh -- Multi-instance bug fix. - - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_0.xml ----- nsegspc for ALL grids is 20 - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_0.xml --- Remove datm/drv namelist crap - M models/lnd/clm/bld/namelist_files/namelist_defaults_clm4_5.xml ----- nsegspc for ALL grids is 20 - New pft-physiology file, new surface/fpftdyn datasets for single point test and urban - Set stream_fldfilename_lightng for CNDV. - M models/lnd/clm/bld/namelist_files/namelist_definition_clm4_5.xml --- Remove datm/drv namelist crap - - M models/lnd/clm/doc/IMPORTANT_NOTES -- updates - - M models/lnd/clm/src/util_share/clm_time_manager.F90 - Set parameters for calendar type. - M models/lnd/clm/src/util_share/ncdio_pio.F90 -------- Fix so that type of data output on read is based - on the variable type of the data rather than the type of data on the input file. (from mvertens/jedwards) - - M models/lnd/clm/src/clm4_5/biogeochem/CNFireMod.F90 ------ Fix so CNDV can build. - M models/lnd/clm/src/clm4_5/biogeochem/CNrestMod.F90 ------ Remove bypass_CN_balance_check_on_restart - M models/lnd/clm/src/clm4_5/biogeochem/DryDepVelocity.F90 - Fix use before define error. - M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 ---- On restart set fieldlist and later compare to make sure - not screwed up. - M models/lnd/clm/src/clm4_5/main/histFileMod.F90 ---------- Make htapes_fieldlist public, check calendar for output files, - check that namelist didn't change number of tapes or fields on restart - M models/lnd/clm/src/clm4_5/main/clm_driver.F90 ----------- Remove bypass_CN_balance_check_on_restart, NEVER do balance check - on first time-step - - M models/lnd/clm/src/clm4_0/biogeochem/DryDepVelocity.F90 - Fix use before define error. - M models/lnd/clm/src/clm4_0/main/histFileMod.F90 ---------- Make htapes_fieldlist public, check calendar for output files, - check that namelist didn't change number of tapes or fields on restart - M models/lnd/clm/src/clm4_5/main/clm_initializeMod.F90 ---- On restart set fieldlist and later compare to make sure - not screwed up. - -Machines testing ran on: Limited! (watch out for this tag!) - - I ran preliminary testing, with versions on the cbugfixclm450 ranch. We will fix other issues with the entire - package as we find them. - -CLM tag used for the baseline comparison tests if applicable: clm4_5_02 - -Changes answers relative to baseline: No bit-for-bit - -=============================================================== -=============================================================== -Tag name: clm4_5_02 -Originator(s): sacks (Bill Sacks,UCAR/CGD,303-497-1762) -Date: Tue May 7 21:04:35 MDT 2013 -One-line Summary: make 'shared' tools directory, and other minor tools fixes - -Purpose of changes: - -- Make separate 'shared' tools directory, move some tools from the clm4_5 - directory into there. - -- Change interpinic so that htop and hbot are skipped - -- Change Makefile.common files in tools to use ifort by default on yellowstone, - so users can just type 'gmake' without needing to do 'gmake USER_FC=ifort'. - For simplicity, this has been implemented by defaulting to ifort for ALL Linux - machines. - -- Fix minor mksurfdata.pl bugs (1669, 1681). - -Requirements for tag: -- fix bug 1669, 1681* -- only tools testing needed - -Test level of tag: tools only - -Bugs fixed (include bugzilla ID): -- 1669: change needed for mksurfdata.pl for smallville (or crop PFT override anyway) -- Changes to get mksurfdata.pl working with urban single point datasets - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: None for CLM; tools builds changed to -use ifort by default on Linux machines - -Describe any changes made to the namelist: None - -List any changes to the defaults for the boundary datasets: None - -Describe any substantial timing or memory changes: None - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): None - -List all files eliminated: - -========= Moved to 'shared' directory -D models/lnd/clm/tools/clm4_5/mkmapdata -D models/lnd/clm/tools/clm4_5/mkprocdata_map -D models/lnd/clm/tools/clm4_5/ncl_scripts -D models/lnd/clm/tools/clm4_5/mkmapgrids - -List all files added and what they do: - -========= Tools moved from clm4_5 directory to shared directory -A models/lnd/clm/tools/shared -A models/lnd/clm/tools/shared/mkmapdata/mvNimport.sh -A models/lnd/clm/tools/shared/mkmapdata/rmdups.ncl -A models/lnd/clm/tools/shared/mkmapdata/regridbatch.sh -A models/lnd/clm/tools/shared/mkmapdata/createXMLEntries.pl -A models/lnd/clm/tools/shared/mkmapdata/mkmapdata.sh -A models/lnd/clm/tools/shared/mkmapdata/mkunitymap.ncl -A models/lnd/clm/tools/shared/mkmapdata/mknoocnmap.pl -A models/lnd/clm/tools/shared/mkmapdata/README -A models/lnd/clm/tools/shared/mkmapdata -A models/lnd/clm/tools/shared/mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c121107.nc -A models/lnd/clm/tools/shared/mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc -A models/lnd/clm/tools/shared/mkprocdata_map/mkprocdata_map_functions.bash -A models/lnd/clm/tools/shared/mkprocdata_map/src/mkprocdata_map.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/gridmapMod.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/constMod.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/Makefile.common -A models/lnd/clm/tools/shared/mkprocdata_map/src/fmain.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/shr_file_mod.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/nanMod.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/Mkdepends -A models/lnd/clm/tools/shared/mkprocdata_map/src/Srcfiles -A models/lnd/clm/tools/shared/mkprocdata_map/src/Filepath -A models/lnd/clm/tools/shared/mkprocdata_map/src/Makefile -A models/lnd/clm/tools/shared/mkprocdata_map/src/fileutils.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src/shr_kind_mod.F90 -A models/lnd/clm/tools/shared/mkprocdata_map/src -A models/lnd/clm/tools/shared/mkprocdata_map/mkprocdata_map_in -A models/lnd/clm/tools/shared/mkprocdata_map/mkprocdata_map_all -A models/lnd/clm/tools/shared/mkprocdata_map/clm -A models/lnd/clm/tools/shared/mkprocdata_map/mkprocdata_map_wrap -A models/lnd/clm/tools/shared/mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c121107.nc -A models/lnd/clm/tools/shared/mkprocdata_map/README -A models/lnd/clm/tools/shared/mkprocdata_map -A models/lnd/clm/tools/shared/ncl_scripts/cprnc.pl -A models/lnd/clm/tools/shared/ncl_scripts/getco2_historical.ncl -A models/lnd/clm/tools/shared/ncl_scripts/cprnc.ncl -A models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.pl -A models/lnd/clm/tools/shared/ncl_scripts/getregional_datasets.ncl -A models/lnd/clm/tools/shared/ncl_scripts/README -A models/lnd/clm/tools/shared/ncl_scripts -A models/lnd/clm/tools/shared/mkmapgrids/src/Makefile.common -A models/lnd/clm/tools/shared/mkmapgrids/src/domainMod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/shr_sys_mod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/shr_file_mod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/nanMod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/shr_log_mod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/Mkdepends -A models/lnd/clm/tools/shared/mkmapgrids/src/Srcfiles -A models/lnd/clm/tools/shared/mkmapgrids/src/mkmapgrids.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src/Filepath -A models/lnd/clm/tools/shared/mkmapgrids/src/Makefile -A models/lnd/clm/tools/shared/mkmapgrids/src/shr_kind_mod.F90 -A models/lnd/clm/tools/shared/mkmapgrids/src -A models/lnd/clm/tools/shared/mkmapgrids/mkmapgrids.namelist -A models/lnd/clm/tools/shared/mkmapgrids/mkscripgrid.ncl -A models/lnd/clm/tools/shared/mkmapgrids/mkmapgrids.csh -A models/lnd/clm/tools/shared/mkmapgrids/README -A models/lnd/clm/tools/shared/mkmapgrids - -========= Add test for mkmapdata using '-p clm4_0' -A models/lnd/clm/test/tools/nl_files/mkmapdata_ne30np4_clm4_0 - -List all existing files that have been modified, and describe the changes: - -========= Point to new 'shared' tools directory where appropriate -M models/lnd/clm/tools/clm4_5/mksurfdata_map/mksurfdata.pl - - also fix mksurfdata.pl for crop PFT override (bug 1669) - - also changes to get mksurfdata.pl working with urban single point datasets (bug 1681) -M models/lnd/clm/tools/clm4_0/mksurfdata_map/mksurfdata.pl - - also fix mksurfdata.pl for crop PFT override (bug 1669) -M models/lnd/clm/test/tools/TBLCFGtools.sh -M models/lnd/clm/test/tools/TOPtools.sh -M models/lnd/clm/test/tools/TBLscript_tools.sh -M models/lnd/clm/test/tools/TBLtools.sh -M models/lnd/clm/test/tools/input_tests_master - - also add test for mkmapdata using '-p clm4_0' -M models/lnd/clm/tools/README -M models/lnd/clm/tools/clm4_5/mksurfdata_map/README.developers - -========= Put gen_domain in 'shared' tools directory -M SVN_EXTERNAL_DIRECTORIES - -========= Use ifort by default on yellowstone (and other Linux machines) -M models/lnd/clm/tools/clm4_5/interpinic/src/Makefile.common -M models/lnd/clm/tools/clm4_5/mksurfdata_map/src/Makefile.common -M models/lnd/clm/tools/clm4_0/interpinic/src/Makefile.common -M models/lnd/clm/tools/clm4_0/mksurfdata_map/src/Makefile.common - -========= Change interpinic so that htop and hbot are skipped -M models/lnd/clm/tools/clm4_5/interpinic/src/interpinic.F90 - - -Machines testing ran on: (Tests in priority order) - build-namelist unit tester: no - - CESM test lists: - - yellowstone/aux_clm intel no - frankfurt/aux_clm_int intel no - yellowstone/aux_clm pgi no - frankfurt/aux_clm intel no - - test_driver.sh tools testing: - - lynx interactive: no - yellowstone interactive: yes - - All PASS except for the following expected failures (note that 006 & 008 - baselines are expected to always fail): - - 006 ble14 TBLCFGtools.sh shared gen_domain CFGtools__ds T31.runoptions .......................... rc=4 FAIL - 008 ble@4 TBLCFGtools.sh shared gen_domain CFGtools__ds ne30.runoptions ......................... rc=4 FAIL - 027 smiS4 TSMscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional ............. rc=6 FAIL - 028 bliS4 TBLscript_tools.sh shared ncl_scripts getregional_datasets.pl getregional ............. rc=4 FAIL - - - yellowstone/PTCLM: no - -CLM tag used for the baseline comparison tests if applicable: clm4_5_01 - -Changes answers relative to baseline: NO - -=============================================================== -=============================================================== -Tag name: clm4_5_01 -Originator(s): muszala (Stefan Muszala,UCAR/CGD,303-497-1320) -Date: Mon May 6 16:52:27 MDT 2013 -One-line Summary: update externals - -Purpose of changes: update externals to alpha08b - -Requirements for tag: N/A - -Test level of tag: std-test - -Bugs fixed (include bugzilla ID): N/A - -Known bugs (include bugzilla ID): N/A - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: N/A - -Describe any changes made to the namelist: N/A - -List any changes to the defaults for the boundary datasets: N/A - -Describe any substantial timing or memory changes: N/A - -Code reviewed by: self - -List any svn externals directories updated (csm_share, mct, etc.): - -< scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130502 -< scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130502 -< models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_2_33 ---- -> scripts https://svn-ccsm-models.cgd.ucar.edu/scripts/trunk_tags/scripts4_130422 -> scripts/ccsm_utils/Machines https://svn-ccsm-models.cgd.ucar.edu/Machines/trunk_tags/Machines_130412 -> models/drv https://svn-ccsm-models.cgd.ucar.edu/drv/seq_mct/trunk_tags/drvseq4_2_29 -13c13 -< models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_130502 ---- -> models/glc/cism https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism1_130405 -16c16 -< models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_130423 ---- -> models/csm_share https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_130226 -18c18 -< models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_130417 ---- -> models/utils/timing https://svn-ccsm-models.cgd.ucar.edu/timing/trunk_tags/timing_130214 -20c20 -< models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_6_9/pio ---- -> models/utils/pio http://parallelio.googlecode.com/svn/trunk_tags/pio1_6_7/pio -23,25c23,25 -< tools/cprnc https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_130425 -< tools/mapping https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130426a -< models/lnd/clm/tools/clm4_5/gen_domain https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130426a/gen_domain_files ---- -> tools/cprnc https://svn-ccsm-models.cgd.ucar.edu/tools/cprnc/trunk_tags/cprnc_130411 -> tools/mapping https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130403 -> models/lnd/clm/tools/clm4_5/gen_domain https://svn-ccsm-models.cgd.ucar.edu/tools/mapping/trunk_tags/mapping_130403/gen_domain_files - -List all files eliminated:N/A - -List all files added and what they do:N/A - -List all existing files that have been modified, and describe the changes: - -M models/lnd/clm/bld/unit_testers/xFail/expectedClmTestFails.xml -- clean up test list - -Machines testing ran on: (Tests in priority order) - - build-namelist unit tester: OK - - CESM test lists: - - yellowstone/aux_clm intel OK (detail of fails that should pass next time) - -BFAIL ERI_D.f10_f10.I20TRCN.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -FAIL ERS.f19_g16_r01.I1850CLM45CN4Me.nldir_rtmOnFloodOnEffvelOff.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- No matching time found in cprnc? should pass next time. -FAIL ERS_D.f19_g16.ICLM45GLCMEC.nldir_glcMEC.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERS_D.f19_g16.ICLM45GLCMEC.nldir_glcMEC.yellowstone_intel.GC.170226.nlcomp - -- changes in cism namelist and cism config -FAIL ERS_D.f19_g16.IGRCP26CLM45CN.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERS_D.f19_g16.IGRCP26CLM45CN.yellowstone_intel.GC.170226.nlcomp - -- changes in cism namelist and cism config -FAIL ERS_D.f19_g16.IGRCP26CN.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERS_D.f19_g16.IGRCP26CN.yellowstone_intel.GC.170226.nlcomp - -- changes in cism namelist and cism config -BFAIL ERS_Ld3_D_P64x1.ne30_g16.ICLM45CN.nldir_default.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL ERS_Ld3_D_P64x16.ne30_g16.ICN.nldir_default.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERS_Lm3.f19_g16.IGRCP60CN.yellowstone_intel.GC.170226.nlcomp - -- changes in cism namelist and cism config -BFAIL PET_D_P1x30.ne30_g16.ICN.nldir_default.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL SMS_RLA.f45_f45.I.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL SMS_RLA.f45_f45.ICLM45.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL SMS_ROA.f45_f45.I.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL SMS_ROA.f45_f45.ICLM45.yellowstone_intel.GC.170226.compare_hist.clm4_0_81 - -- no baseline, should pass next round - - yellowstone/aux_clm pgi OK (detail of fails that should pass next time) - -FAIL ERI.f19_g16.IG1850.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERI.f19_g16.IG1850.yellowstone_pgi.GC.170137.nlcomp - -- changes in cism namelist and cism_config -FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -FAIL ERI.f19_g16.IG1850CLM45.yellowstone_pgi.GC.170137.nlcomp - -- changes in cism namelist and cism config -BFAIL ERI_D.f10_f10.I20TRCN.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 - -- no baseline, should pass next round -FAIL SMS.T31_g37.IG4804.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 -FAIL SMS.T31_g37.IG4804.yellowstone_pgi.GC.170137.nlcomp - -- changes in cism namelist and cism config - -- changes in drv_in (ocn_ntreades=2) -FAIL SMS.T31_g37.IG4804CLM45.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 - -- changes in g2x_Sg_frac01 and g2x_Sg_topo01 -BFAIL SMS_RLB.f45_f45.I.yellowstone_pgi.GC.170137.compare_hist.clm4_0_81 - -- no baseline, should pass next round -BFAIL SMS_RLB.f45_f45.ICLM45.yellowstone_pgi.GC.170137.compare_hist.clm4_0_8 - -- no baseline, should pass next round - - frankfurt/aux_clm intel OK - -CLM tag used for the baseline comparison tests if applicable: clm4_0_81 - -Changes answers relative to baseline: yes - -IF tag changes answers relative to baseline comparison the -following should be filled in: - - Summarize any changes to answers, i.e., - - what code configurations: only changes in g2x_Sg_frac01 and g2x_Sg_topo01 - - what platforms/compilers: all - -=============================================================== -=============================================================== -Tag name: clm4_5_00 -Originator(s): erik (Erik Kluzek) -Date: Thu May 2 00:20:17 MDT 2013 -One-line Summary: Official end to CLM4.5 development for CLM offline - -Purpose of changes: Changes from clm4_0_54 to now... - -Compsets and Scripts Changes: - -Remove ability to set compset file on command line, and use a new expanded compset file definition that -allows user to create many compsets on the fly by defining a long name with the "-user_compset" option -to "create_newcase". "-user_compset" is in the form of... - -TIME_DATM[%phys]_CLM[40|45][%phys]_SICE_SOCN_RTM[%phys]_GLC[%phys]_SWAV[_BGC%phys] - -Where - TIME = Time period (e.g. 2000, 20TR, RCP8...) - GLC = [CISM1, SGLC] - BGC = optional BGC scenario -The OPTIONAL %phys attributes specify submodes of the given system - -So for example - -./create_newcase -user_compset 1850_DATM%CRU_CLM45%BGC_SICE_SOCN_RTM_SGLC_SWAV -case cru1850 -res f19_g16 -mach yellowstone -compiler intel - -will setup a 1850 case at f19 resolution with CRUNCEP forcing with CLM4.5-BGC. - -Changes for both clm4.0 and clm4.5: - -* Bug fixes in MEGAN VOC emission fluxes and dry deposition velocities -* CRUNCEP is now an option for atmospheric forcing -* Change from Sam Levis for CROP to pft-physiology file so that CROP parameter is in Kelvin rather than Celsius. -* Don't re-weight pftdyn if weights are essentially identical. - -CLM4.5 includes the following: - -* Bring in flood capability to RTM. -* Bring LBNL-merge branch on with: vertical soil, Methane, CENTURY, split nitrification, new-lake model. -* Modifications to GPP, on gppdev branch, multilayer canopy and then single-layer version that reproduces it. -* Crop model updates. Irrigation included with crop model as an option. Fix CNDV-CROP. -* Urban model updates, multi-density, urban depth seperate from soil depth, wasteheat to zero. -* Bring in permafrostsims09 branch with Sean Swensons's flooding changes. -* Update pft-physiology file, change some CN defaults, change min flow slightly in RTM. -* Set ponding to zero, acclimation mods from Keith Oleson, a hydrology change from Sean Swenson. -* Add active flags, change subgrid weighting convention. -* Turn off subgrid topography snow parameterization for glc_mec landunits. -* Jinyun photosynthesis change impacting arid regions. -* Keith Oleson's photosynthesis change, changes canopy top: triose phosphate util. rate to be dependent on vcmax. -* VIC hydrology is an option. -* Update mksurfdata_map for CLM4.5 (also add support for glc_nec=36 although we have no datasets for this). -* Snow depth averaged over grid-cell (SNOWDP) on history file changed in favor of SNOW_DEPTH (averaged only over snow covered area). -* Spinup changes from Charlie Koven from build-time to run-time (spinup now option added to CLM_BLDNML_OPTS as "-spinup on|off"). -* Bring the F. Li and S. Levis Fire model for CLMCN and CLMBGC based on Li et al. (2012a,b; 2013). -* BSW calculation changed affecting drought phenology and frozen temperature sensitivity (SP, CN, and BGC as well as DV) - -Test level of tag: doc - -Bugs fixed (include bugzilla ID): - -Known bugs (include bugzilla ID): - http://bugs.cgd.ucar.edu/ - -Known Limitations: - 1147 (mkgriddata can't straddle over Greenwich) - 1025 (SCM mode can NOT use a global finidat file) - 1017 (SCM mode can NOT restart) - 896 (T62 mode does not work) - 701 (svn keyword) - 452 (Problem with support of soil-colors != 8 or 20) - -Describe any changes made to build system: - Changes to CLM configure: - -phys option to specify clm4_0 or clm4_5 - -pergro and -c13 option removed - -spinup option removed for CLM4_0 - New options for clm4_5: -clm4me, -vichydro, -exlaklayers, -vsoilc_centbgc - -Describe any changes made to the namelist: - For CLM4.0: WRF and 360x720cru resolutions added - For CLM4.5: new namelists: popd_streams light_streams clm_hydrology1_inparm clm_soilhydrology_inparm - irrigate is a namelist option rather than using different surface datasets - New namelist items for clm_inparm: - anoxia no_frozen_nitrif_denitrif - atm_c14_filename override_bgc_restart_mismatch_dump - cryoturb_diffusion_k perchroot - decomp_depth_efolding perchroot_altk - deepmixing_depthcrit pftspecific_rootingprofile - deepmixing_mixfact rootprof_exp - exponential_rooting_profile rootprof_exp - froz_q10 som_adv_flux - hist_wrtch4diag som_diffus - lake_melt_icealb spinup_state - max_altdepth_cryoturbation surfprof_exp - max_depth_cryoturb use_c13 - more_vertlayers use_c14 - nfix_timeconst use_c14_bombspike - - -List any changes to the defaults for the boundary datasets: - All CLM4.5 datasets are new. - For CLM4.0, new ne120, ne240, and 360x720cru surface datasets (ne120 ne120 finidat files) - new pft-physiology file - -New history fields: - Dozens of new fields for clm4_5. - Three new fields for clm4_0: -+ FAIL ERP_Ld5.f10_f10_musgs.I2000Clm50Vic.cheyenne_gnu.clm-decStart COMPARE_base_rest - FAIL ERP_D.f10_f10_musgs.IHistClm50Bgc.cheyenne_gnu.clm-decStart COMPARE_base_rest - - Differences are just in some cism fields that I’m not concerned - about: roundoff-level differences in internal_time; big differences - in tempstag, uvel and vvel, but those fields don’t really make sense - in this configuration (and I have removed them in the latest CISM - tag). (Note that I did two runs of each of these tests from my - branch, and for both tests, the two runs had identical cism hist - files, so I don’t think this is a reproducibility problem.) - - -CLM tag used for the baseline comparisons: clm5.0.dev008 - - -Answer changes --------------- - -Changes answers relative to baseline: NO - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #352 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev008 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Apr 27 13:28:41 MDT 2018 -One-line Summary: With FUN subtract out soil nitrification flux of plant uptake of soil NH3 and NO3 - -Purpose of changes ------------------- - -Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #351 -- FATES external to https - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: - -Code reviewed by: wweider, rfischer - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev007 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: All CLM50 BGC with FUN on - - what platforms/compilers: All - - nature of change: climate very nearly the same - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - rfisher case -- clm5_nbug_test_case ----- short f45 resolution - oleson case --- clm5_nbug_test_case ----- AD spinup f45 resolution - oleson case --- clm5_nbug_test_casepAD -- Post AD spinup f45 resolution - - URL for LMWG diagnostics output used to validate new climate: - http://webext.cgd.ucar.edu/I1850/clm5_nbug_test_casepAD/lnd/clm5_nbug_test_casepAD.281_300-clm5_nbug_control_casepAD.281_300/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates changed to https form rather than ssh - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #344 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev007 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Apr 24 14:50:19 MDT 2018 -One-line Summary: Bring in a few answer changing things: FATES, cism updates, IC file fix, testing 1850 compset use 1850 orbit - -Purpose of changes ------------------- - -Important updates in land-ice model (CISM) version used that changes answers. Fix some initial condition problems -with CLM5.0 cases. Update the FATES version to a new updated science version that hence changes answers. -Change the default orbit for testing of 1850 cases to use 1850 orbit rather than 1990. -Make sure to use f45_f45_g37 and not f45_f45 in test lists. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): - #313 -- Issues with initial condition files - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): New IC file for clm5_0_CRUv7 - CLM5.0 finidat files choosen will be different for both GSWP3.1 and CRUNCEPv7 forcing - -Substantial timing or memory changes: No - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - When the cime version is updated the changes that make the 1850 orbit explicit in testing can be removed - -Changes to tests or testing: 1850 tests explicitly set a 1850 orbit, f45_f45 tests changed to include mask (f45_f45_mg37) - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev006 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes - - Summarize any changes to answers: - - what code configurations: All 1850 tests, all FATES, all with CISM, CLM50 initial conditions - - what platforms/compilers: All - - nature of change: Significant - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): fates, cism - FATES to SCI_1.8.1_API_3.0.0 - cism to cism2_1_49 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - #349 -- Update manage externals to manic_v1.1.3 - #348 -- Update FATES science version to 1.8.1, and bring in some answer changes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev006 -Originator(s): sacks (Bill Sacks) -Date: Thu Apr 12 06:16:16 MDT 2018 -One-line Summary: Don't allocate memory for zero-weight natveg patches and urban - -Purpose of changes ------------------- - -We have previously been allocating memory for all urban columns and all -natural veg PFTs, everywhere. In some cases this may still be desired, -but in some cases - and particularly non-transient cases - this is a -waste of memory and performance without any benefit. - -In timing runs of a CONUS test case set up by Mike Barlage, where there -were 2 PFTs per gridcell (bare plus grass), only allocating memory for -the non-zero-weight points (i.e., 2 natural pfts per gridcell and -nothing else) reduced land run time from 56.4 sec to 21.6 sec. - -This tag puts in place a more general solution, avoiding allocating -memory for zero-weight natural PFTs in non-transient runs, and avoiding -allocating memory for zero-weight urban points unless requested with a -namelist flag. - -For non-transient runs, this change improves performance and decreases -memory and restart file size substantially: For short timing runs on -cheyenne_intel at f09_g16 (I haven't looked closely at memory use, but -it probably is about the same reduction as the restart file size): -- I1850Clm50Sp - - 91% of the runtime (i.e., 9.0% reduction in runtime) - - Restart file size is 32% of original (68% reduction) -- I1850Clm50Bgc - - 77% of the runtime (i.e., 23% reduction in runtime) - - Restart file size is 33% of original (67% reduction) -- I1850Clm50BgcCrop - - 80% of the runtime (i.e., 20% reduction in runtime) - - Restart file size is 37% of original (63% reduction) - -(Non-transient cases should also be improved due to the urban change, -but I haven't investigated the improvement there.) - -This tag also fixes some other bugs, as noted below. - -NOTE: This change requires running init_interp on any existing initial -conditions files! In addition, moving forward, init_interp will always -be needed when going from a non-transient to a transient run (this has -already been the case when running with crop; now it will also be the -case when running without crop, too). - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #298: Don't allocate memory for zero-weight PFTs and urban - columns -- Fixes #317: c14 bombspike and c13 timeseries code can use the wrong - year, with irreproducible behavior -- Fixes #320: I1850Clm50Sp compset mistakenly uses SGLC - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): -- You will need to run init_interp on any existing initial conditions - files -- Moving forward, init_interp will always be needed when going from a - non-transient to a transient run (this has already been the case when - running with crop; now it will also be the case when running without - crop, too) - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): -- New namelist variable: run_zero_weight_urban: If TRUE, run all urban - landunits everywhere where we have valid urban data. This has two - effects: (1) goes back to the previous behavior of allocating memory - for urban nearly everywhere; (2) makes all urban columns active, even - if they have zero weight. This can be used to evaluate potential urban - behavior globally. - -Changes made to namelist defaults (e.g., changed parameter values): -- Use init_interp for all out-of-the-box finidat files - -Changes to the datasets (e.g., parameter, surface or initial files): -- Remove initial conditions for Fates for 1x1 Brazil - -Substantial timing or memory changes: -- Substantial decreases in memory use and improvements in timing: see - notes above. - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: -- Changed aux_clm Fates tests to use cold start -- Changed the allActive test to be a transient case so that we allocate and run all PFTs - -Code reviewed by: -- Quick review by Erik Kluzek -- Urban change reviewed by Keith Oleson - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - ok - - Tests pass, namelists differ as expected - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means: tests pass, some baseline failures as expected: - - DIMSIZEDIFF for vector output - - ERI_D_Ld9.f09_g16.I1850Clm50Sp.cheyenne_gnu.clm-default differs - due to fix of #320 - - ERP_D_Ld9.f09_g16.I1850Clm50SpCru.cheyenne_gnu.clm-default differs - because this uses init_interp whereas on master we did not use - init_interp, and this changes answers for this ERP test due to - #330 - - SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - differs due to fix of #317 - - Note: For changed tests (allActive and Fates tests), I ran the new - versions of the tests from clm5.0.dev005 and confirmed that dev006 - is bit-for-bit with dev005 for these changed tests. - -CLM tag used for the baseline comparisons: clm5.0.dev005 - - -Answer changes --------------- - -Changes answers relative to baseline: YES, but only in limited situations - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: see below - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - Changes answers in the following situations: - - Vector output is not directly comparable, because dimension sizes - differ - - I1850Clm50Sp cases change substantially due to fix of #320 - - Cases with carbon isotope bombspike change due to fix of #317 - - In some situations, cases that use init_interp now but did not - before can change answers by roundoff due to #330 - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #311: Avoid allocating memory for zero-weight natveg patches and urban - -=============================================================== -=============================================================== -Tag name: clm5.0.dev005 -Originator(s): sacks (Bill Sacks) -Date: Tue Apr 10 14:15:52 MDT 2018 -One-line Summary: Two fixes for init_interp - -Purpose of changes ------------------- - -Two fixes for init_interp: - -(1) Copy as many snow layers as possible in init_interp - - In most cases, we only need data from the existing snow layers. But in a - few cases - in particular, the flx_abs* variables - we need data even - from non-existing snow layers in order for interpolation to be - bit-for-bit. The change here reworks snow interpolation so that, in - addition to copying the existing snow layers, we also copy as many - non-existing snow layers as will fit in the destination layer structure. - - Fixes #326 - -(2) For glcmec, match col/patch types in some cases - - If glcmec used the same elevation class definitions in input and output, - then match classes as we do for most landunit types, rather than just - using topographic heights. (An exception is output cells with the - single_at_atm_topo behavior, because their types could change once we - enter the run loop.) - - Fixes #325 - -The new behavior is covered by unit tests. This tag also expands some -unit testing infrastructure to facilitate the addition of some of these -unit tests. - -I have confirmed that this test passes: -LII_D_Ld9.f09_g16.I1850Clm50SpCru.hobart_intel.clm-default, when I point -to an initial conditions file that I generated from the dev 002 tag -(because I wasn't sure if the current default initial conditions file -was exactly compatible with the latest master). Before the changes in -this tag, that test was failing. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- #326: init_interp can change answers for absorbed radiation in - non-existent snow layers -- #325: init_interp can change answers over the CISM domain - -Known bugs introduced in this tag (include github issue ID): -- #339: cheyenne_gnu restart test fails exact restart comparison sporadically - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, baselines fail as expected (baseline failures - just for tests that use init_interp) - -CLM tag used for the baseline comparisons: clm5.0.dev004 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: all configurations with use_init_interp = .true. - - what platforms/compilers: all - - nature of change (roundoff; larger than roundoff/same climate; new climate): - Not investigated carefully, but expected to be larger than roundoff / same climate - - Differences arise due to both fixes listed above. - - (1) Copy as many snow layers as possible in init_interp: It - appears that this only changes answers for some radiation - terms in the first time step after initialization when a snow - layer had just melted before the restart file was written. In - this case, the flx_abs* variables are set differently for this - just-disappeared layer. This can affect a lot of grid cells, - but I expect differences from this change to be very small and - not scientifically important. - - (2) For glcmec, match col/patch types in some cases: This seems to - only affect a small number of grid cells in Greenland. So I do - not expect the overall effect on a simulation to be significant. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) -- #328: fixes for init_interp - -=============================================================== -=============================================================== -Tag name: clm5.0.dev004 -Originator(s): erik (Erik Kluzek) -Date: Mon Apr 9 00:20:03 MDT 2018 -One-line Summary: List of important bug fixes - -Purpose of changes ------------------- - -A list of important bug and usability fixes. One of those changes makes it easier for the user to end up with -initial condition files that don't match the start date of their simulation. This is problematic because of the -saved counters for prognostic crop. For sure a mismatched date will end up with bad results for the first season, -but this will also affect subsequent years running averages. So we don't recommend that you do that. - -Jim Edwards also brought in some changes for PIO for 64bit_data, and to fix fill values for integer data. And we updated -manage_externals to the newest version. - - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): [If none, remove this line] -#213 -- usability issue for CPLHIST that Keith found. -#210 -- Recent request to increase number of tapes to 10. -#169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. -#68 --- workaround for gnu compiler bug -#46 --- needed for multi-instance -#66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work -#65 --– need to change a check from "> 0" to "> [small val]" -#240 -- from Jim -#255 -- get PTCLM working -#253 -- bad clm40 IC file - -Known bugs introduced in this tag (include github issue ID): - #329 -- init_interp doesn't work if finidat points to finidat_interp_dest from a different case - #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers - #325 -- init_interp can change answers over the CISM domain - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): - You can bypass the ignore_ic_date error when crop is being used - Matching for initial conditions for crop simulations are allowed to ignore the month/day - When crop is on and the start date doesn't match the date for the initial conditions file, - the counters for the crop model will be incorrect -- and hence the first season will be screwed - up, and the screwed up results will affect the running averages for the future. This was a condition - that we didn't allow you to easily do -- we've made it easier for this to happen now. - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): - Allow ten streams of history tapes rather than just six. - Correct the I1850Clm50BgcSpinup compset - You can bypass the ignore_ic_date error when crop is being used (may affect results) - Matching for initial conditions for crop simulations are allowed to ignore the month/day - The precision control settings for Nitrogen and Carbon are now making it to the namelist - -Changes made to namelist defaults (e.g., changed parameter values): ncrit=1.d-8 (10X looser) - -Changes to the datasets (e.g., parameter, surface or initial files): Correct to a few finidat files (clm4_0_CRUv7) - -Substantial timing or memory changes: Maybe 3% to memory - - There is a 3% increase to memory, but memory high water mark seems to double - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - -Changes to tests or testing: - Added aux_cime_baseline tests - add cplhist test - Add edison to fates testlist - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev003 - - -Answer changes --------------- - -Changes answers relative to baseline: no but, there are some specific potential or small apparant change to answers - in terms of the test suite - 3 fields have a different missing value pattern: landmask, pftmask, nbedrock - roundoff difference in F_N2O_DENIT due to #65 - LVG_Ld5_D.f10_f10.I1850Clm50Bgc.cheyenne_intel.clm-no_vector_output - landmask was different for two cases: - ERP_P36x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - ERP_P72x2_Lm25.f10_f10_musgs.I2000Clm50BgcDvCrop.cheyenne_intel.clm-monthly - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): manic - manage_externals to manicv1.0.2 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #337 Update manage_externals to manicv1.0.2 - #333 Important fixes - #241 Add support for 64bit_data, fix fillvalues - -=============================================================== -=============================================================== -Tag name: clm5.0.dev003 -Originator(s): erik (Erik Kluzek) -Date: Fri Mar 9 00:34:04 MST 2018 -One-line Summary: Bug fixes for energy imbalance associated with surface water and lakes - -Purpose of changes ------------------- - -These are bug fixes for the land energy imbalance over land as determined by coupler diagnostics. -They include bug fixes for surface water phase change and lake/snow interactions developed by -Sean Swenson and Keith Oleson. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): #304 - #304 -- Energy imbalance over land per coupler diagnostics - -Known bugs introduced in this tag (include github issue ID): [If none, remove this line] - #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior - #313 -- Problems with CLM5 initial conditions files - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): - There is some dupliciation in calculations by level that could be consolidated - For example, the calculation of c1. - There is a check for ffrac_sno(c) > 0, that probably should be greater than a small value - -Changes to tests or testing: none - -Code reviewed by: self, sacks, swensosc - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: regular - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -CLM tag used for the baseline comparisons: clm5.0.dev002 - - -Answer changes --------------- - -Changes answers relative to baseline: Yes! - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: clm4_5 and clm5_0 - - what platforms/compilers: all - - nature of change: climate similar - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461 - - username: oleson - - machine: cheyenne - - URL for LMWG diagnostics output used to validate new climate: - -http://webext.cgd.ucar.edu/I1850/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850/lnd/clm50_r272_1deg_GSWP3V1_iso_h2osfclakefix_1850.1443_1461-clm50_r272_1deg_GSWP3V1_iso_1850.1443_1461/setsIndex.html - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #307 -- Bug fixes for energy imbalance associated with surface water and lakes - -=============================================================== -=============================================================== -Tag name: clm5.0.dev002 -Originator(s): sacks (Bill Sacks) -Date: Sun Feb 25 06:53:36 MST 2018 -One-line Summary: Add some land ice diagnostic vars needed for CMIP6 - -Purpose of changes ------------------- - -Add some diagnostic variables needed for analyzing land ice that have -been requested by some of the MIPs in CMIP6 (especially ISMIP). - -Also, fixes c2l_scale_type to fix urban scaling for SNOWICE, SNOWLIQ - -Some changes from Leo van Kampenhout. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -- https://github.com/ESCOMP/ctsm/issues/271 Add some land ice fields for cmip6 - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): none - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): none - -Changes made to namelist defaults (e.g., changed parameter values): none - -Changes to the datasets (e.g., parameter, surface or initial files): none - -Substantial timing or memory changes: none - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): none - -Changes to tests or testing: none - -Code reviewed by: self, Erik Kluzek - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - not run - - unit-tests (components/clm/src): - - cheyenne - pass - - tools-tests (components/clm/test/tools): - - cheyenne - not run - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - not run - - regular tests (aux_clm): - - cheyenne_intel ---- ok - cheyenne_gnu ------ ok - hobart_nag -------- ok - hobart_pgi -------- ok - hobart_intel ------ ok - - ok means tests pass, answer changes as expected, as noted below - -CLM tag used for the baseline comparisons: clm5.0.dev001 - - -Answer changes --------------- - -Changes answers relative to baseline: YES - just in SNOWICE, SNOWLIQ - - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - - Summarize any changes to answers, i.e., - - what code configurations: All - - what platforms/compilers: All - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - just changes the diagnostic fields SNOWICE, SNOWLIQ, due to - fixed c2l_scale_type for these fields - - - The test - ERP_P72x2_Ly3.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-irrig_o3_reduceOutput - also showed small answer changes just in the cpl field - l2x_Sl_tsrf00, for a single grid cell in Antarctica - (221.485144932008 vs. 221.485144910486). However, I reran it 10 - times, and it was bit-for-bit (other than SNOWICE and SNOWLIQ) in - all 10 of those re-runs. So I'm chalking this up to a machine - fluke. (The restart file from the problematic run showed diffs in - a bunch of fields; from spot-checking one - SNOW_DEPTH - diffs - were just in one point. But since this is a reduceOutput run, - diffs didn't show up in CLM history files. I confirmed that there - were no diffs in finidat_interp_dest or in namelists.) I - regenerated baselines for this test using one of the cases without - this machine fluke. - - If bitwise differences were observed, how did you show they were no worse - than roundoff? N/A - - If this tag changes climate describe the run(s) done to evaluate the new - climate (put details of the simulations in the experiment database) - - casename: N/A - - URL for LMWG diagnostics output used to validate new climate: N/A - - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#303 - Snow integrated temperature -#306 - Add some land ice diagnostic variables needed for cmip6 - -=============================================================== -=============================================================== -Tag name: clm5.0.dev001 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Feb 14 14:14:34 MST 2018 -One-line Summary: Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - -Purpose of changes ------------------- - -Fix problem with default LND_TUNING_MODE for cases coupled to CAM. Update some of the README -files. And also bring in a PTCLM version that will work in the new CTSM git checkout directory -structure. - -Bugs fixed or introduced ------------------------- - -Issues fixed (include CTSM Issue #): -#255 PTCLMmkdata doesn't work in the CLM git checkout - -Known bugs found in this tag (include github issue ID): - -#262 hirespft option for mksurfdata.pl doesn't work - - -Notes of particular relevance for users ---------------------------------------- - -Caveats for users (e.g., need to interpolate initial conditions): None - -Changes to CLM's user interface (e.g., new/renamed XML or namelist variables): None - -Changes made to namelist defaults (e.g., changed parameter values): None - -Changes to the datasets (e.g., parameter, surface or initial files): None - -Substantial timing or memory changes: None - -Notes of particular relevance for developers: (including Code reviews and testing) ---------------------------------------------- - -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None - -Changes to tests or testing: None - -Code reviewed by: self - -Did you follow the steps in .CLMTrunkChecklist: yes - -CLM testing: doc - -PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - PASS - - Extra Tests: - -ERS_Ld5.f19_g17.E1850L45TEST.cheyenne_intel.cice-default -SMS_Ld1.f09_f09_mg17.FW1850.cheyenne_intel.cam-reduced_hist1d -SMS_Ld7.f09_g17.B1850.cheyenne_intel.allactive-defaultio - -CLM tag used for the baseline comparisons: clm5.0.dev000 - - -Answer changes --------------- - -Changes answers relative to baseline: No bit-for-bit - -Detailed list of changes ------------------------- - -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): PTCLM - PTCLM to PTCLM2_180214 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - -#297 -- README files -#296 -- Make LND_TUNING_MODE correct and consistent when coupled with CAM -#295 -- Bring in a working PTCLMmkdata version -#261 -- Reorder links - -=============================================================== -=============================================================== -Tag name: clm5.0.dev000 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Feb 05 2018 -One-line Summary: Initial version of CLM5.0 - -This is the initial science version of CLM5.0. - -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop -modeling. -The updates to CLM science are documented here: - -https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 - -This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary -versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, -and future scenarios. - -Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution -(fv 0.9x1.25 with g1xv6 ocean mask). - -=============================================================== diff --git a/doc/design/oo_design.rst b/doc/design/oo_design.rst deleted file mode 100644 index 6d2a355867..0000000000 --- a/doc/design/oo_design.rst +++ /dev/null @@ -1,17 +0,0 @@ -.. sectnum:: - -.. contents:: - -============================================================= - Use of Init method rather than constructor for most classes -============================================================= - -Most of the object-oriented classes in CTSM (and particularly the science-focused classes) -are initialized with a method named ``Init``, rather than the more standard -object-oriented pattern of using a constructor. This is largely for historical reasons: -Object initialization was done this way when object orientation was first introduced to -CESM (possibly because of compiler bugs that prevented the general use of constructors for -this purpose?). As more object orientation was added, we continued to use an ``Init`` -method for this purpose to remain consistent with existing code. - -At this point, we could probably refactor this to use constructors. diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog deleted file mode 100644 index be078c167a..0000000000 --- a/doc/release-clm5.0.ChangeLog +++ /dev/null @@ -1,767 +0,0 @@ -=============================================================== -Tag name: release-clm5.0.08 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Fri Sep 28 14:17:52 MDT 2018 -One-line Summary: Updated CMIP6 ndep file for historical transient Bgc cases, 1850_control same as before - -Purpose of this version: ------------------------- - -Update the ndep file for transient cases for CLM50 to the CMIP6 version that has identical -data for 1849-1850 to the previous CMIP6 1850_control (with different mid-month times however), and -new 3-member ensemble average/5-year smoothing from the WACCM case: b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.00[123]. -The new data is monthly rather than yearly, which means there will be a seasonal cycle to nitrogen deposition -for transient cases now. The midmonth times/dates are different for the multi-year file from -the previous file, so answers change when using it for 1850_control cases even though the data is exactly the same. -Because, of that we are still pointing to the previous 1850 CMIP6 ndep file. - -CLM4.5 is still using the previous CMIP5 ndep dataset. - -CTSM Master Tag This Corresponds To: ctsm1.0.dev008 (minus ctsm1.0.dev005 and ctsm1.0.dev001) - -Summary of changes: -------------------- - -Science changes since: New cmip6 ndep file for transient cases - -Software changes since: None - -Changes to User Interface since: None - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): PASS (limited testing) - PASS SMS_D.f09_g16.I1850Clm50BgcSpinup.cheyenne_intel.clm-cplhist - PASS SMS_D_Ld3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-default - PASS SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - PASS SMS_D_Ly2.1x1_numaIA.IHistClm50BgcCropGs.cheyenne_intel.clm-ciso_bombspike1963 - PASS SMS_Ld5.f10_f10_musgs.I1850Clm45BgcCrop.cheyenne_intel.clm-crop - PASS SMS_Ld5.f19_g17.IHistClm50Bgc.cheyenne_intel.clm-decStart - PASS SMS_Ld5_D.f09_g16.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6 - PASS SMS_Lm1.f09_g17_gl4.I1850Clm50Bgc.cheyenne_intel.clm-clm50KitchenSink - PASS SMS_Lm1.f19_g17_gl4.I1850Clm50Bgc.cheyenne_intel.clm-clm50dynroots - PASS SMS_Lm1_D.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-snowlayers_3_monthly - PASS ERP_P36x2_D_Ld5.f10_f10_musgs.IHistClm45BgcCruGs.cheyenne_intel.clm-decStart - - Tests that are different from baseline (as expected) - DIFF SMS_D_Ly2.1x1_brazil.IHistClm50BgcQianGs.cheyenne_intel.clm-ciso_bombspike1963 - DIFF SMS_D_Ly2.1x1_numaIA.IHistClm50BgcCropGs.cheyenne_intel.clm-ciso_bombspike1963 - DIFF SMS_Ld5.f19_g17.IHistClm50Bgc.cheyenne_intel.clm-decStart - DIFF SMS_Lm1_D.f10_f10_musgs.I2000Clm50BgcCrop.cheyenne_intel.clm-snowlayers_3_monthly - - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: release-clm5.0.07 - -Changes answers relative to baseline: Yes! for CLM4.5/CLM5.0 CN or Bgc transient cases - - Summarize any changes to answers, i.e., - - what code configurations: IHist Clm45Bgc* and Clm50Bgc (Bgc or Cn) - - what platforms/compilers: All - - nature of change: Changes in climate for Nitrogen - New nitrogen deposition and change from yearly to monthly - -Detailed list of changes: ------------------------- - -Externals being used: Update cime - - cism: release-cesm2.0.04 - rtm: release-cesm2.0.00 - mosart: release-cesm2.0.00 - cime: cime_cesm2_0_rel_05 - FATES: fates_s1.8.1_a3.0.0 - PTCLM: PTCLM2_180611 - -CTSM Tag versions pulled over from master development branch: None - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #522 -- Point to the new ndep historical file for all cases, also update cime - -=============================================================== -=============================================================== -Tag name: release-clm5.0.07 -Originator(s): erik (Erik Kluzek) -Date: Wed Aug 8 14:02:04 MDT 2018 -One-line Summary: Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 - -Purpose of this version: ------------------------- - -This is a duplicate of the previous tag, since the previous tag ended up being off of the release-clm5.0 branch. -All the details of the tag are the same as the previous one. - -=============================================================== -=============================================================== -Tag name: release-clm5.0.06 -Originator(s): erik (Erik Kluzek) -Date: Tue Aug 7 14:49:04 MDT 2018 -One-line Summary: Bring in some simple fixes from ctsm1.0.dev006 and avoid glacier adjustment at startup from ctsm1.0.dev007 - -Purpose of this version: ------------------------- - -Bring in a list of simple fixes that came to CTSM master. Also change so glacier initialization is *ALWAYS* done -at startup (time step zero) even if it isn't cold or interpolated initial conditions. Also synchronize some of the -files in the doc directory with the files in ctsm/master. - - -CTSM Master Tag This Corresponds To: ctsm1.0.dev007 (minus ctsm1.0.dev005 and ctsm1.0.dev001) - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): -- Fixes #340 (Avoid generating dynamic landunit adjustment fluxes for - glacier changes in the first timestep) -- Fixes #24 (ncd_io_1d_log_glob is broken) -- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90 -- Fixes #245 (Put all .gitignore entries in top-level file) -- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR - is used) -- Fixes #283 (Add more helpful message about need to do init_interp with - wrong number of vertical layers) -- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a - TG compset) -- Fixes #412 (Fix documentation of init_interp_method) -- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN) -- Fixes #465 (Remove backwards compatibility check for snw_rds) - -Science changes since: release-clm5.0.05 (always do glacier initialization at startup even if NOT cold or interpolated startup) - -Software changes since: release-clm5.0.05 - remove ncd_io_1d_log_glob, remove a backwards compatability check for snw_rds on restart file - -Changes to User Interface since: release-clm5.0.05 - Add another field to cmip6_outputA, Remove SOYFIXN history field when FUN is on - Add error for missing mxsoil_color, better error message for wrong # of vertical soil layers, - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: release-clm5.0.05 - -Changes answers relative to baseline: possibly at startup - - Summarize any changes to answers, i.e., - - what code configurations: startup with Glacier model and NOT a cold or interpolated start - - what platforms/compilers: All - - nature of change: nearly identical - - Only tests that showed differences in answers were: - - ERI_N2_Ld9.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-default - SMS_Lm13.f19_g17.I2000Clm50BgcCrop.cheyenne_intel.clm-cropMonthOutput - -Detailed list of changes: ------------------------- - -Externals being used: - - cism: release-cesm2.0.04 - rtm: release-cesm2.0.00 - mosart: release-cesm2.0.00 - cime: cime5.6.10 - FATES: fates_s1.8.1_a3.0.0 - PTCLM: PTCLM2_180611 - -CTSM Tag versions pulled over from master development branch: ctsm1.0.dev006, ctsm1.0.dev007 - - ctsm1.0.dev007 sacks 08/05/2018 Avoid glacier dynamic landunit adjustments in first time step - ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #473 -- Always do glacier startup even if not cold or interpoalted start (ctsm1.0.dev007) - #468 -- Minor bug fixes (ctsm1.0.dev006) - -=============================================================== -=============================================================== -Tag name: release-clm5.0.05 -Originator(s): erik (Erik Kluzek) -Date: Sun Aug 5 23:31:45 MDT 2018 -One-line Summary: Update 1850 ndep file, and last year for transient streams - -Purpose of this version: ------------------------- - -Update to latest Nitrogen Deposition file from simulations with WACCM for 1850. -Also fix an issue with the last year for historical transient cases. - - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): $461 - #461 -- increase year last for streams - -Science changes since: release-clm5.0.04 - New ndep file, and updated last year for transient streams - -Software changes since: None - -Changes to User Interface since: None - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - hobart --- PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - hobart --- OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - regular tests (fates): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - regular tests (clm_short): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: release-clm5.0.04 - -Changes answers relative to baseline: Yes - - Summarize any changes to answers, i.e., - - what code configurations: for 1850 Bgc cases and after 2005 for transient cases - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes: ------------------------- - -Externals being used: - - cism: release-cesm2.0.04 - rtm: release-cesm2.0.00 - mosart: release-cesm2.0.00 - cime: cime5.6.10 - FATES: fates_s1.8.1_a3.0.0 - PTCLM: PTCLM2_180611 - -Pull Requests that document the changes (include PR ids): -(https://github.com/ESCOMP/ctsm/pull) - - #471 -- update ndep and last year of streams - -=============================================================== -=============================================================== -Tag name: release-clm5.0.04 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Wed Jul 18 04:04:57 MDT 2018 -One-line Summary: Fix some NFIX variables, update cime/cism for upgraded hobart new glade, new diagnostic fields, update cmip6 output - -Purpose of this version: ------------------------- - -Add some new diagnostic fields. Some needed for CMIP6. Update the CMIP6 user-mods output. -Fix a couple issues. Get full list of history tapes working correctly. Check for valid range -of CO2. New IC file interpolated from the previous one for f19_g17_gl4 for 2000 Clm50BgcCrop - -Update cime and cism so can work on upgraded hobart. Also fix an issue that the Nag6.2 compiler found -in CTSM. Also get working with glade changes that happened on cheyenne, DIN_LOC_ROOT_CLMFORC was -changed to a new directory. - -Nitrogen Fixation flux arrays were being set to missing value over non-vegetated landunits. This sets them to zero everywhere -and averages in the zero's at the gridcell level for history output. It also reads in restarts with missing values and converts -them to zero's. - -There are also some tools updates, getting the tools working on the new upgraded hobart.cgd.ucar.edu. - -And mksurfdata_map is updated to add some *_MAX files on the landuse.timeseries files that will allow us to conserve memory -for transient cases. - - -CTSM Master Tag This Corresponds To: ctsm1.0.dev004 (minus ctsm1.0.dev001) - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): - - #210 -- increase number of history tapes - $427 -- Check for zero CO2 - #429 -- New IC for present day - #441 -- Changes in glade invalidate previous softlinks and data locations - #438 -- Illegal argument aliasing caught by nag6.2 - #433 -- with hobart upgrade CTSM not working - #435 -- intel build for tools - #426 -- Nitrogen Fixation flux variables - #433 -- hobart broken, got it working for tools - -Science changes since: release-clm5.0.03 - - Changes to Nitrogen fixation flux arrays so that they are zero everywhere and the zeros are averaged in for history output. - Answers change because of interpolated initial conditions for 2000 simulation year at f19_g17_gl4 - -Software changes since: release-clm5.0.03 - - Get working on updated hobart. Add some new fields to mksurfdata_map tool. - -Changes to User Interface since: release-clm5.0.03 - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - regular tests (clm_short): - - cheyenne_intel ---- PASS - cheyenne_gnu ------ PASS - hobart_nag -------- PASS - hobart_intel ------ PASS - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: clm5.0.dev013 - -Changes answers relative to baseline: Yes! - - Summarize any changes to answers, i.e., - - what code configurations: Clm50 2000 and NFIX history variables - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes: ------------------------- - -Externals being used: - - cism: release-cesm2.0.04 - rtm: release-cesm2.0.00 - mosart: release-cesm2.0.00 - cime: cime5.6.10 - FATES: fates_s1.8.1_a3.0.0 - PTCLM: PTCLM2_180611 - -CTSM Tag versions pulled over from master development branch: ctsm1.0.dev002, ctsm1.0dev003, ctsm1.0dev004 - -=============================================================== -=============================================================== -Tag name: release-clm5.0.03 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue Jun 12 15:32:53 MDT 2018 -One-line Summary: Second release branch tag for CESM2.0 release, fixing DA and tools and README files, identical to clm5.0.dev013 - -Purpose of this version: ------------------------- - -Update cime and cism to newer versions used in release. These bring in some answer -changes. The cime version updates the orbit for 2000 compsets. The cism version -changes answers for two fields with NO_EVOLVE and more fields for EVOLVE. - -Fixes an important bug needed for use with Data Assimulation. Several changes -to testing. Adding wallclock as needed, changing a few compsets so science -supported compsets are used, added tput_tolerance to some tests known to be -variable. - -Many changes to the clm tools for creating input files. Added the version by -querying "git describe" and adding it as an attribute to NetCDF files. Changes -to get tools working, and tested. Also changed so that tools can be run in either -a CTSM checkout or a CESM checkout. - -Updated README files so they are accurate. - -CTSM Master Tag This Corresponds To: clm5.0.dev013 - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): - #188 -- Global PTCLM tools test fails - #187 -- PTCLM tools tests fail baseline comparisons due to a seg fault - #259 -- Most README files in ctsm are incorrect - #386 -- Shorten some currently very long debug tests - #387 -- Lots of testmods still set orb_iyear and orb_iyear_align - #388 -- Add "git describe" to input files that are created - #389 -- Post data-assimilation processing broken with multi-driver - #393 -- Increase wallclock - #399 -- minor format update needed in namelist_definition_clm4_5.xml - #402 -- Some smaller tests can be slow.. - #411 -- Refactor tools aren't useful anymore - #414 -- PTCLM tests aren't working - #415 -- mkprocdata_map tests aren't working because of bad return statement in script type: bug - other - #418 -- Path needs to be updated for getco2 script type: bug - other - -Science changes since release-clm5.0.01: None - -Software changes since release-clm5.0.01: - Fix an important bug for data assimulation. Work on the CLM tools for creating input files. - Some changes to the CLM testing. - -Changes to User Interface since release-clm5.0.01: None - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - hobart --- PASS - - tools-tests (components/clm/test/tools): - - cheyenne - PASS - hobart --- PASS - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - hobart --- OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - regular tests (prealpha): - - cheyenne_intel - OK - cheyenne_gnu --- OK - hobart_nag ----- OK - - regular tests (prebeta): - - cheyenne_intel - OK - cheyenne_gnu --- OK - hobart_nag ----- OK - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: release-5.0.01 - -Changes answers relative to baseline: Yes - -Changes answers relative to baseline: Yes! Because of changes in cism and cime - - Summarize any changes to answers: - - what code configurations: All 2000 compsets and some cases with cism - - what platforms/compilers: All - - nature of change: similar climate - -Detailed list of changes: ------------------------- - -Externals being used: - cime cime_cesm2_0_rel_03 - cism release-v2.1.01 - rtm release-cesm2.0.00 - mosart release-cesm2.0.00 - fates fates_s1.8.1_a3.0.0 - PTCLM PTCLM2_180611 - - -CTSM Tag versions pulled over from master development branch: clm5.0.dev013 - -=============================================================== -=============================================================== -Tag name: release-clm5.0.01 -Originator(s): erik (Erik Kluzek) -Date: Tue May 22 10:09:15 MDT 2018 -One-line Summary: First release branch tag for CESM2.0 release, identical to clm5.0.dev012 - -Purpose of this version: ------------------------- - -This is the first release branch tag for the CESM2.0 release for CTSM. There are many changes -to software mostly to fix a list of issues. There are some changes to the science that change -answers to fix some small problems, but don't have a large effect on simulations. Externals are -updated to new versions, fixing issues, and in most cases changing answers. The cime version -was updated and brings in some new features. - - -CTSM Master Tag This Corresponds To: clm5.0.dev012 - -Summary of changes: -------------------- - -Issues fixed (include CTSM Issue #): - #379 -- Problems with Hist decStart restart tests due to variable orbital year - #260 -- max daylength doesn't change over time for varying orbital parameters - #363 -- PE Layout - $374 -- Turn BFBFLAG on for testing (so PE layout changes won't appear to change answers) - #382 -- Write statement for VIC - $383 -- mkmapdata intel version` - #68 --- gnu compiler workaround - #364 -- crop f05 datasets - #362 -- svn checkout - #318 -- quadratic bug - #249 -- bypass balance checks for DART - #341 -- add model_doi_url - #346 -- New mode of operation for init_interp: Copy subgrid areas, too - #347 -- endrun message behavior - #345 -- Add a cmip6_evolving_icesheet usermods directory - #351 -- FATES external to https - #310 -- With FUN on soil nitrification flux is not subtracted out of plant uptake of of soil NH4 or NO3 - #313 -- Issues with initial condition files - #298 -- Don't allocate memory for zero-weight PFTs and urban columns - #317 -- c14 bombspike and c13 timeseries code can use the wrong year, with irreproducible behavior - #320 -- I1850Clm50Sp compset mistakenly uses SGLC - #326 -- init_interp can change answers for absorbed radiation in non-existent snow layers - #325 -- init_interp can change answers over the CISM domain - #213 -- usability issue for CPLHIST that Keith found. - #210 -- Recent request to increase number of tapes to 10. - #169 -- usability issue for running hybrid or branch cases with crop that keeps biting Mike Mills. - #68 --- workaround for gnu compiler bug - #46 --- needed for multi-instance - #66 --– need to relax tolerance for negative C/N values in order for CLM45 Crop to work - #65 --– need to change a check from "> 0" to "> [small val]" - #240 -- from Jim - #255 -- get PTCLM working - #253 -- bad clm40 IC file - #304 -- Energy imbalance over land per coupler diagnostics - #271 -- Add some land ice fields for cmip6 - #255 -- PTCLMmkdata doesn't work in the CLM git checkout - -CIME Issues fixed (include issue #): [If none, remove this line] -- ESMCI/cime#2598 (datm doesn't restart properly with variable year orbit) - -Science changes since: clm5.0.000 - - - Max day length is recalculated every time-step so works with a variable orbit - - CISM updates with answer changes - - Update 1850 Nitrogen deposition file used when coupled to cam - - By default orbit for 1850 is for 1850 conditions and for transient is variable by simulation year - - Soil nitrification flux wasn't taken out of plant uptake of either soil NH3 or NO3, with FUN on, and now it is. - - FATES version updated with science changes - - New initial condition files for most configurations - - Bug fixes for energy imbalance associated with surface water and lakes - -Softare changes since: clm5.0.000 - - - Update PE layouts for f45, f09, and f19 - - Turn BFBFLAG on for most testing - - Some fixes to tools for batch submission - - Update cime version - - Update mosart and RTM - - Add f05 crop datasets - - Add pauseResume test and don't do balance checks for two steps after Data Assimulation is done - - Don't allocate memory for zero-weight natveg patches and urban - - Fix some issues with init_interp for glaciers and snow covered areas - - Add some land ice diagnostic vars needed for CMIP6 - - Fix LND_TUNING_MODE for fully coupled case, update some README files/PTCLM - -Changes to User Interface since: clm5.000 - - New namelist item: init_interp_method - - xmlquery will now accept derived attributes. - - New XML variables, PAUSE_ACTIVE_XXX. - - jobid now added to CaseStatus case_submit entry. - - Splits GLC2OCN_RMAPNAME xml variable into - GLC2OCN_LIQ_RMAPNAME and GLC2OCN_ICE_RMAPNAME, and similarly for - GLC2OCN_RMAPTYPE - - New --retry option to create_test. - - Add --clean-depends to case.build, this argument can take a component list and will - clean all components if one is not provided. - -Testing: --------- - - [PASS means all tests PASS and OK means tests PASS other than expected fails.] - - build-namelist tests: - - cheyenne - PASS - - unit-tests (components/clm/src): - - cheyenne - PASS - - tools-tests (components/clm/test/tools): - - cheyenne - OK - - PTCLM testing (components/clm/tools/shared/PTCLM/test): - - cheyenne - OK - - regular tests (aux_clm): - - cheyenne_intel ---- OK - cheyenne_gnu ------ OK - hobart_nag -------- OK - hobart_pgi -------- OK - hobart_intel ------ OK - - regular tests (prealpha): - - cheyenne_intel - OK - cheyenne_gnu --- OK - hobart_nag ----- OK - - regular tests (prebeta): - - cheyenne_intel - OK - cheyenne_gnu --- OK - hobart_nag ----- OK - -Summary of Answer changes: -------------------------- - -Baseline version for comparison: clm5.0.000 - -Changes answers relative to baseline: Yes - - Summarize any changes to answers, i.e., - - what code configurations: - all Clm45 and Clm50 - all 1850, all IHIST cases, all with CISM, all CLM50-BGC with FUN on - all with FATES, all with use_init_interp=T, - all CLM40, CLM45, and cLM%0 because of new initial conditions - - what platforms/compilers: all - - nature of change: similar climate - - URL for LMWG diagnostics output for new climate: - -Detailed list of changes: ------------------------- - -Externals being used: - - cism updated from cism2_1_46 to release-v2.1.00 (answer changes) - rtm updated from rtm1_0_65 to rtm1_0_66 - mosart updated from mosart1_0_30 to mosart1_0_31 - cime updated from cime5.4.0-alpha.03 to a67dceae95567cc7529c4cfed153017f4b65b210 - (answer changes due to new orbit) - fates updated from fates_s1.4.1_a3.0.0_rev3 to fates_s1.8.1_a3.0.0 (answer changes due to science updates) - PTCLM updated from PTCLM2_171216c to PTCLM2_180214 - -CTSM Tag versions pulled over from master development branch: - - clm5.0.dev012 sacks 05/17/2018 Fixes for variable_year orbital mode - clm5.0.dev011 erik 05/16/2018 1850 ndep update, cism update, PE layouts, - turn BFBFLAG for testing - clm5.0.dev010 erik 05/15/2018 Update cime version to version in cesm2.0.beta10, - changes answers for 1850 compsets because of orbit - clm5.0.dev009 sacks 05/10/2018 New init_interp method - clm5.0.dev008 erik 04/27/2018 With FUN subtract out soil nitrification flux of plant - uptake of soil NH3 and NO3 - clm5.0.dev007 erik 04/24/2018 Bring in a few answer changing things: FATES, - cism updates, IC file fix, - testing 1850 compset use 1850 orbit - clm5.0.dev006 sacks 04/12/2018 Don't allocate memory for zero-weight natveg - patches and urban - clm5.0.dev005 sacks 04/10/2018 Two fixes for init_interp - clm5.0.dev004 erik 04/09/2018 List of important bug fixes - clm5.0.dev003 erik 03/09/2018 Bug fixes for energy imbalance associated - with surface water and lakes - clm5.0.dev002 sacks 02/25/2018 Add some land ice diagnostic vars needed for CMIP6 - clm5.0.dev001 erik 02/14/2018 Fix LND_TUNING_MODE for fully coupled case, - update some README files/PTCLM - -=============================================================== -=============================================================== -Tag name: clm5.0.000 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Feb 05 2018 -One-line Summary: Initial version of CLM5.0 - -This is the initial science version of CLM5.0. - -Developments for CLM5.0 build on the progress made in CLM4.5. Most major components of the model have been updated with particularly -notable changes made to soil and plant hydrology, snow density, river modeling, carbon and nitrogen cycling and coupling, and crop -modeling. -The updates to CLM science are documented here: - -https://escomp.github.io/ctsm-docs/doc/build/html/tech_note/Introduction/CLM50_Tech_Note_Introduction.html#clm5-0 - -This version has production versions of CLM5.0 CMIP6 land-use change files for 1850, historical, and 2000. It has preliminary -versions of CMIP6 forcing files for Nitrogen deposition and population density. Further updates are needed for prescribed aerosols, -and future scenarios. - -Spunup initial conditions are provided for several CLM physics and forcing combinations from simulations run at 1-degree resolution -(fv 0.9x1.25 with g1xv6 ocean mask). - -=============================================================== - diff --git a/manage_externals/.github/PULL_REQUEST_TEMPLATE.md b/manage_externals/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b68b1fb5e2..0000000000 --- a/manage_externals/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ -[ 50 character, one line summary ] - -[ Description of the changes in this commit. It should be enough - information for someone not following this development to understand. - Lines should be wrapped at about 72 characters. ] - -User interface changes?: [ No/Yes ] -[ If yes, describe what changed, and steps taken to ensure backward compatibilty ] - -Fixes: [Github issue #s] And brief description of each issue. - -Testing: - test removed: - unit tests: - system tests: - manual testing: - diff --git a/manage_externals/.gitignore b/manage_externals/.gitignore deleted file mode 100644 index 411de5d96e..0000000000 --- a/manage_externals/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -# directories that are checked out by the tool -cime/ -cime_config/ -components/ - -# generated local files -*.log - -# editor files -*~ -*.bak - -# generated python files -*.pyc diff --git a/manage_externals/.travis.yml b/manage_externals/.travis.yml deleted file mode 100644 index b32f81bd28..0000000000 --- a/manage_externals/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -# NOTE(bja, 2017-11) travis-ci dosen't support python language builds -# on mac os. As a work around, we use built-in python on linux, and -# declare osx a 'generic' language, and create our own python env. - -language: python -os: linux -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" -matrix: - include: - - os: osx - language: generic - before_install: - # NOTE(bja, 2017-11) update is slow, 2.7.12 installed by default, good enough! - # - brew update - # - brew outdated python2 || brew upgrade python2 - - pip install virtualenv - - virtualenv env -p python2 - - source env/bin/activate -install: - - pip install -r test/requirements.txt -before_script: - - git --version -script: - - cd test; make test - - cd test; make lint -after_success: - - cd test; make coverage - - cd test; coveralls diff --git a/manage_externals/test/repos/simple-ext.git/refs/heads/master b/manage_externals/test/repos/simple-ext.git/refs/heads/master deleted file mode 100644 index 5c67504966..0000000000 --- a/manage_externals/test/repos/simple-ext.git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -9b75494003deca69527bb64bcaa352e801611dd2 diff --git a/manage_externals/manic/__init__.py b/manic/__init__.py similarity index 100% rename from manage_externals/manic/__init__.py rename to manic/__init__.py diff --git a/manage_externals/manic/checkout.py b/manic/checkout.py similarity index 91% rename from manage_externals/manic/checkout.py rename to manic/checkout.py index c5bbaf5f43..edc5655954 100755 --- a/manage_externals/manic/checkout.py +++ b/manic/checkout.py @@ -227,6 +227,21 @@ def commandline_arguments(args=None): Now, %(prog)s will process Externals.cfg and also process Externals_LIBX.cfg as if it was a sub-external. + * from_submodule (True / False) : used to pull the repo_url, local_path, + and hash properties for this external from the .gitmodules file in + this repository. Note that the section name (the entry in square + brackets) must match the name in the .gitmodules file. + If from_submodule is True, the protocol must be git and no repo_url, + local_path, hash, branch, or tag entries are allowed. + Default: False + + * sparse (string) : used to control a sparse checkout. This optional + entry should point to a filename (path relative to local_path) that + contains instructions on which repository paths to include (or + exclude) from the working tree. + See the "SPARSE CHECKOUT" section of https://git-scm.com/docs/git-read-tree + Default: sparse checkout is disabled + * Lines beginning with '#' or ';' are comments and will be ignored. # Obtaining this tool, reporting issues, etc. @@ -280,6 +295,13 @@ def commandline_arguments(args=None): 'used up to two times, increasing the ' 'verbosity level each time.') + parser.add_argument('--svn-ignore-ancestry', action='store_true', default=False, + help='By default, subversion will abort if a component is ' + 'already checked out and there is no common ancestry with ' + 'the new URL. This flag passes the "--ignore-ancestry" flag ' + 'to the svn switch call. (This is not recommended unless ' + 'you are sure about what you are doing.)') + # # developer options # @@ -348,7 +370,7 @@ def main(args): "No component {} found in {}".format( comp, args.externals)) - source_tree = SourceTree(root_dir, external) + source_tree = SourceTree(root_dir, external, svn_ignore_ancestry=args.svn_ignore_ancestry) printlog('Checking status of externals: ', end='') tree_status = source_tree.status() printlog('') diff --git a/manage_externals/manic/externals_description.py b/manic/externals_description.py similarity index 56% rename from manage_externals/manic/externals_description.py rename to manic/externals_description.py index b32d37cfc6..b0c4f736a7 100644 --- a/manage_externals/manic/externals_description.py +++ b/manic/externals_description.py @@ -22,15 +22,17 @@ import os.path import re -# ConfigParser was renamed in python2 to configparser. In python2, -# ConfigParser returns byte strings, str, instead of unicode. We need -# unicode to be compatible with xml and json parser and python3. +# ConfigParser in python2 was renamed to configparser in python3. +# In python2, ConfigParser returns byte strings, str, instead of unicode. +# We need unicode to be compatible with xml and json parser and python3. try: # python2 from ConfigParser import SafeConfigParser as config_parser from ConfigParser import MissingSectionHeaderError from ConfigParser import NoSectionError, NoOptionError + USE_PYTHON2 = True + def config_string_cleaner(text): """convert strings into unicode """ @@ -41,6 +43,8 @@ def config_string_cleaner(text): from configparser import MissingSectionHeaderError from configparser import NoSectionError, NoOptionError + USE_PYTHON2 = False + def config_string_cleaner(text): """Python3 already uses unicode strings, so just return the string without modification. @@ -49,6 +53,7 @@ def config_string_cleaner(text): return text from .utils import printlog, fatal_error, str_to_bool, expand_local_url +from .utils import execute_subprocess from .global_constants import EMPTY_STR, PPRINTER, VERSION_SEPERATOR # @@ -59,8 +64,8 @@ def config_string_cleaner(text): def read_externals_description_file(root_dir, file_name): - """Given a file name containing a externals description, determine the - format and read it into it's internal representation. + """Read a file containing an externals description and + create its internal representation. """ root_dir = os.path.abspath(root_dir) @@ -70,29 +75,193 @@ def read_externals_description_file(root_dir, file_name): file_path = os.path.join(root_dir, file_name) if not os.path.exists(file_name): - msg = ('ERROR: Model description file, "{0}", does not ' - 'exist at path:\n {1}\nDid you run from the root of ' - 'the source tree?'.format(file_name, file_path)) + if file_name.lower() == "none": + msg = ('INTERNAL ERROR: Attempt to read externals file ' + 'from {0} when not configured'.format(file_path)) + else: + msg = ('ERROR: Model description file, "{0}", does not ' + 'exist at path:\n {1}\nDid you run from the root of ' + 'the source tree?'.format(file_name, file_path)) + fatal_error(msg) + externals_description = None + if file_name == ExternalsDescription.GIT_SUBMODULES_FILENAME: + externals_description = read_gitmodules_file(root_dir, file_name) + else: + try: + config = config_parser() + config.read(file_path) + externals_description = config + except MissingSectionHeaderError: + # not a cfg file + pass + + if externals_description is None: + msg = 'Unknown file format!' + fatal_error(msg) + + return externals_description + +class LstripReader(object): + "LstripReader formats .gitmodules files to be acceptable for configparser" + def __init__(self, filename): + with open(filename, 'r') as infile: + lines = infile.readlines() + self._lines = list() + self._num_lines = len(lines) + self._index = 0 + for line in lines: + self._lines.append(line.lstrip()) + + def readlines(self): + """Return all the lines from this object's file""" + return self._lines + + def readline(self, size=-1): + """Format and return the next line or raise StopIteration""" + try: + line = self.next() + except StopIteration: + line = '' + + if (size > 0) and (len(line) < size): + return line[0:size] + + return line + + def __iter__(self): + """Begin an iteration""" + self._index = 0 + return self + + def next(self): + """Return the next line or raise StopIteration""" + if self._index >= self._num_lines: + raise StopIteration + + self._index = self._index + 1 + return self._lines[self._index - 1] + + def __next__(self): + return self.next() + +def git_submodule_status(repo_dir): + """Run the git submodule status command to obtain submodule hashes. + """ + # This function is here instead of GitRepository to avoid a dependency loop + cwd = os.getcwd() + os.chdir(repo_dir) + cmd = ['git', 'submodule', 'status'] + git_output = execute_subprocess(cmd, output_to_caller=True) + submodules = {} + submods = git_output.split('\n') + for submod in submods: + if submod: + status = submod[0] + items = submod[1:].split(' ') + if len(items) > 2: + tag = items[2] + else: + tag = None + + submodules[items[1]] = {'hash':items[0], 'status':status, 'tag':tag} + + os.chdir(cwd) + return submodules + +def parse_submodules_desc_section(section_items, file_path): + """Find the path and url for this submodule description""" + path = None + url = None + for item in section_items: + name = item[0].strip().lower() + if name == 'path': + path = item[1].strip() + elif name == 'url': + url = item[1].strip() + else: + msg = 'WARNING: Ignoring unknown {} property, in {}' + msg = msg.format(item[0], file_path) # fool pylint + logging.warning(msg) + + return path, url + +def read_gitmodules_file(root_dir, file_name): + # pylint: disable=deprecated-method + # Disabling this check because the method is only used for python2 + """Read a .gitmodules file and convert it to be compatible with an + externals description. + """ + root_dir = os.path.abspath(root_dir) + msg = 'In directory : {0}'.format(root_dir) + logging.info(msg) + printlog('Processing submodules description file : {0}'.format(file_name)) + + file_path = os.path.join(root_dir, file_name) + if not os.path.exists(file_name): + msg = ('ERROR: submodules description file, "{0}", does not ' + 'exist at path:\n {1}'.format(file_name, file_path)) + fatal_error(msg) + + submodules_description = None externals_description = None try: config = config_parser() - config.read(file_path) - externals_description = config + if USE_PYTHON2: + config.readfp(LstripReader(file_path), filename=file_name) + else: + config.read_file(LstripReader(file_path), source=file_name) + + submodules_description = config except MissingSectionHeaderError: # not a cfg file pass - if externals_description is None: + if submodules_description is None: msg = 'Unknown file format!' fatal_error(msg) + else: + # Convert the submodules description to an externals description + externals_description = config_parser() + # We need to grab all the commit hashes for this repo + submods = git_submodule_status(root_dir) + for section in submodules_description.sections(): + if section[0:9] == 'submodule': + sec_name = section[9:].strip(' "') + externals_description.add_section(sec_name) + section_items = submodules_description.items(section) + path, url = parse_submodules_desc_section(section_items, + file_path) + + if path is None: + msg = 'Submodule {} missing path'.format(sec_name) + fatal_error(msg) - return externals_description + if url is None: + msg = 'Submodule {} missing url'.format(sec_name) + fatal_error(msg) + externals_description.set(sec_name, + ExternalsDescription.PATH, path) + externals_description.set(sec_name, + ExternalsDescription.PROTOCOL, 'git') + externals_description.set(sec_name, + ExternalsDescription.REPO_URL, url) + externals_description.set(sec_name, + ExternalsDescription.REQUIRED, 'True') + git_hash = submods[sec_name]['hash'] + externals_description.set(sec_name, + ExternalsDescription.HASH, git_hash) + + # Required items + externals_description.add_section(DESCRIPTION_SECTION) + externals_description.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.0') + + return externals_description def create_externals_description( - model_data, model_format='cfg', components=None): + model_data, model_format='cfg', components=None, parent_repo=None): """Create the a externals description object from the provided data """ externals_description = None @@ -103,7 +272,7 @@ def create_externals_description( major, _, _ = get_cfg_schema_version(model_data) if major == 1: externals_description = ExternalsDescriptionConfigV1( - model_data, components=components) + model_data, components=components, parent_repo=parent_repo) else: msg = ('Externals description file has unsupported schema ' 'version "{0}".'.format(major)) @@ -173,18 +342,21 @@ class ExternalsDescription(dict): # keywords defining the interface into the externals description data EXTERNALS = 'externals' BRANCH = 'branch' - REPO = 'repo' - REQUIRED = 'required' - TAG = 'tag' + SUBMODULE = 'from_submodule' + HASH = 'hash' + NAME = 'name' PATH = 'local_path' PROTOCOL = 'protocol' + REPO = 'repo' REPO_URL = 'repo_url' - HASH = 'hash' - NAME = 'name' + REQUIRED = 'required' + TAG = 'tag' + SPARSE = 'sparse' PROTOCOL_EXTERNALS_ONLY = 'externals_only' PROTOCOL_GIT = 'git' PROTOCOL_SVN = 'svn' + GIT_SUBMODULES_FILENAME = '.gitmodules' KNOWN_PRROTOCOLS = [PROTOCOL_GIT, PROTOCOL_SVN, PROTOCOL_EXTERNALS_ONLY] # v1 xml keywords @@ -197,15 +369,17 @@ class ExternalsDescription(dict): _source_schema = {REQUIRED: True, PATH: 'string', EXTERNALS: 'string', + SUBMODULE : True, REPO: {PROTOCOL: 'string', REPO_URL: 'string', TAG: 'string', BRANCH: 'string', HASH: 'string', - } - } + SPARSE: 'string', + } + } - def __init__(self): + def __init__(self, parent_repo=None): """Convert the xml into a standardized dict that can be used to construct the source objects @@ -218,6 +392,7 @@ def __init__(self): self._input_major = None self._input_minor = None self._input_patch = None + self._parent_repo = parent_repo def _verify_schema_version(self): """Use semantic versioning rules to verify we can process this schema. @@ -265,6 +440,7 @@ def _check_user_input(self): self._validate() def _check_data(self): + # pylint: disable=too-many-branches,too-many-statements """Check user supplied data is valid where possible. """ for ext_name in self.keys(): @@ -282,6 +458,13 @@ def _check_data(self): ext_name)) fatal_error(msg) + if ((self[ext_name][self.REPO][self.PROTOCOL] != self.PROTOCOL_GIT) + and (self.SUBMODULE in self[ext_name])): + msg = ('self.SUBMODULE is only supported with {0} protocol, ' + '"{1}" is defined as an {2} repository') + fatal_error(msg.format(self.PROTOCOL_GIT, ext_name, + self[ext_name][self.REPO][self.PROTOCOL])) + if (self[ext_name][self.REPO][self.PROTOCOL] != self.PROTOCOL_EXTERNALS_ONLY): ref_count = 0 @@ -301,11 +484,23 @@ def _check_data(self): found_refs = '"{0} = {1}", {2}'.format( self.HASH, self[ext_name][self.REPO][self.HASH], found_refs) + if (self.SUBMODULE in self[ext_name] and + self[ext_name][self.SUBMODULE]): + ref_count += 1 + found_refs = '"{0} = {1}", {2}'.format( + self.SUBMODULE, + self[ext_name][self.SUBMODULE], found_refs) if ref_count > 1: - msg = ('Model description is over specified! Only one of ' - '"tag", "branch", or "hash" may be specified for ' - 'repo description of "{0}".'.format(ext_name)) + msg = 'Model description is over specified! ' + if self.SUBMODULE in self[ext_name]: + msg += ('from_submodule is not compatible with ' + '"tag", "branch", or "hash" ') + else: + msg += (' Only one of "tag", "branch", or "hash" ' + 'may be specified ') + + msg += 'for repo description of "{0}".'.format(ext_name) msg = '{0}\nFound: {1}'.format(msg, found_refs) fatal_error(msg) elif ref_count < 1: @@ -314,17 +509,39 @@ def _check_data(self): 'repo description of "{0}"'.format(ext_name)) fatal_error(msg) - if self.REPO_URL not in self[ext_name][self.REPO]: + if (self.REPO_URL not in self[ext_name][self.REPO] and + (self.SUBMODULE not in self[ext_name] or + not self[ext_name][self.SUBMODULE])): msg = ('Model description is under specified! Must have ' '"repo_url" in repo ' 'description for "{0}"'.format(ext_name)) fatal_error(msg) - url = expand_local_url( - self[ext_name][self.REPO][self.REPO_URL], ext_name) - self[ext_name][self.REPO][self.REPO_URL] = url + if (self.SUBMODULE in self[ext_name] and + self[ext_name][self.SUBMODULE]): + if self.REPO_URL in self[ext_name][self.REPO]: + msg = ('Model description is over specified! ' + 'from_submodule keyword is not compatible ' + 'with {0} keyword for'.format(self.REPO_URL)) + msg = '{0} repo description of "{1}"'.format(msg, + ext_name) + fatal_error(msg) + + if self.PATH in self[ext_name]: + msg = ('Model description is over specified! ' + 'from_submodule keyword is not compatible with ' + '{0} keyword for'.format(self.PATH)) + msg = '{0} repo description of "{1}"'.format(msg, + ext_name) + fatal_error(msg) + + if self.REPO_URL in self[ext_name][self.REPO]: + url = expand_local_url( + self[ext_name][self.REPO][self.REPO_URL], ext_name) + self[ext_name][self.REPO][self.REPO_URL] = url def _check_optional(self): + # pylint: disable=too-many-branches """Some fields like externals, repo:tag repo:branch are (conditionally) optional. We don't want the user to be required to enter them in every externals description file, but @@ -332,6 +549,7 @@ def _check_optional(self): default values if appropriate. """ + submod_desc = None # Only load submodules info once for field in self: # truely optional if self.EXTERNALS not in self[field]: @@ -346,6 +564,72 @@ def _check_optional(self): self[field][self.REPO][self.HASH] = EMPTY_STR if self.REPO_URL not in self[field][self.REPO]: self[field][self.REPO][self.REPO_URL] = EMPTY_STR + if self.SPARSE not in self[field][self.REPO]: + self[field][self.REPO][self.SPARSE] = EMPTY_STR + + # from_submodule has a complex relationship with other fields + if self.SUBMODULE in self[field]: + # User wants to use submodule information, is it available? + if self._parent_repo is None: + # No parent == no submodule information + PPRINTER.pprint(self[field]) + msg = 'No parent submodule for "{0}"'.format(field) + fatal_error(msg) + elif self._parent_repo.protocol() != self.PROTOCOL_GIT: + PPRINTER.pprint(self[field]) + msg = 'Parent protocol, "{0}", does not support submodules' + fatal_error(msg.format(self._parent_repo.protocol())) + else: + args = self._repo_config_from_submodule(field, submod_desc) + repo_url, repo_path, ref_hash, submod_desc = args + + if repo_url is None: + msg = ('Cannot checkout "{0}" as a submodule, ' + 'repo not found in {1} file') + fatal_error(msg.format(field, + self.GIT_SUBMODULES_FILENAME)) + # Fill in submodule fields + self[field][self.REPO][self.REPO_URL] = repo_url + self[field][self.REPO][self.HASH] = ref_hash + self[field][self.PATH] = repo_path + + if self[field][self.SUBMODULE]: + # We should get everything from the parent submodule + # configuration. + pass + # No else (from _submodule = False is the default) + else: + # Add the default value (not using submodule information) + self[field][self.SUBMODULE] = False + + def _repo_config_from_submodule(self, field, submod_desc): + """Find the external config information for a repository from + its submodule configuration information. + """ + if submod_desc is None: + repo_path = os.getcwd() # Is this always correct? + submod_file = self._parent_repo.submodules_file(repo_path=repo_path) + if submod_file is None: + msg = ('Cannot checkout "{0}" from submodule information\n' + ' Parent repo, "{1}" does not have submodules') + fatal_error(msg.format(field, self._parent_repo.name())) + + submod_file = read_gitmodules_file(repo_path, submod_file) + submod_desc = create_externals_description(submod_file) + + # Can we find our external? + repo_url = None + repo_path = None + ref_hash = None + for ext_field in submod_desc: + if field == ext_field: + ext = submod_desc[ext_field] + repo_url = ext[self.REPO][self.REPO_URL] + repo_path = ext[self.PATH] + ref_hash = ext[self.REPO][self.HASH] + break + + return repo_url, repo_path, ref_hash, submod_desc def _validate(self): """Validate that the parsed externals description contains all necessary @@ -383,11 +667,12 @@ def validate_data_struct(schema, data): if isinstance(schema, dict) and isinstance(data, dict): # Both are dicts, recursively verify that all fields # in schema are present in the data. - for k in schema: - in_ref = in_ref and (k in data) + for key in schema: + in_ref = in_ref and (key in data) if in_ref: valid = valid and ( - validate_data_struct(schema[k], data[k])) + validate_data_struct(schema[key], data[key])) + is_valid = in_ref and valid else: # non-recursive structure. verify data and schema have @@ -434,9 +719,9 @@ def __init__(self, model_data, components=None): self._input_patch = 0 self._verify_schema_version() if components: - for k in model_data.items(): - if k not in components: - del model_data[k] + for key in model_data.items(): + if key not in components: + del model_data[key] self.update(model_data) self._check_user_input() @@ -448,12 +733,12 @@ class ExternalsDescriptionConfigV1(ExternalsDescription): """ - def __init__(self, model_data, components=None): + def __init__(self, model_data, components=None, parent_repo=None): """Convert the config data into a standardized dict that can be used to construct the source objects """ - ExternalsDescription.__init__(self) + ExternalsDescription.__init__(self, parent_repo=parent_repo) self._schema_major = 1 self._schema_minor = 1 self._schema_patch = 0 diff --git a/manage_externals/manic/externals_status.py b/manic/externals_status.py similarity index 100% rename from manage_externals/manic/externals_status.py rename to manic/externals_status.py diff --git a/manage_externals/manic/global_constants.py b/manic/global_constants.py similarity index 100% rename from manage_externals/manic/global_constants.py rename to manic/global_constants.py diff --git a/manage_externals/manic/repository.py b/manic/repository.py similarity index 78% rename from manage_externals/manic/repository.py rename to manic/repository.py index d01849d37a..ea4230fb7b 100644 --- a/manage_externals/manic/repository.py +++ b/manic/repository.py @@ -21,6 +21,7 @@ def __init__(self, component_name, repo): self._branch = repo[ExternalsDescription.BRANCH] self._hash = repo[ExternalsDescription.HASH] self._url = repo[ExternalsDescription.REPO_URL] + self._sparse = repo[ExternalsDescription.SPARSE] if self._url is EMPTY_STR: fatal_error('repo must have a URL') @@ -40,12 +41,14 @@ def __init__(self, component_name, repo): fatal_error('repo {0} must have exactly one of ' 'tag, branch or hash.'.format(self._name)) - def checkout(self, base_dir_path, repo_dir_name, verbosity): # pylint: disable=unused-argument + def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): # pylint: disable=unused-argument """ If the repo destination directory exists, ensure it is correct (from correct URL, correct branch or tag), and possibly update the source. If the repo destination directory does not exist, checkout the correce branch or tag. + NB: is include as an argument for compatibility with + git functionality (repository_git.py) """ msg = ('DEV_ERROR: checkout method must be implemented in all ' 'repository classes! {0}'.format(self.__class__.__name__)) @@ -59,6 +62,11 @@ def status(self, stat, repo_dir_path): # pylint: disable=unused-argument 'repository classes! {0}'.format(self.__class__.__name__)) fatal_error(msg) + def submodules_file(self, repo_path=None): + # pylint: disable=no-self-use,unused-argument + """Stub for use by non-git VC systems""" + return None + def url(self): """Public access of repo url. """ @@ -78,3 +86,13 @@ def hash(self): """Public access of repo hash. """ return self._hash + + def name(self): + """Public access of repo name. + """ + return self._name + + def protocol(self): + """Public access of repo protocol. + """ + return self._protocol diff --git a/manage_externals/manic/repository_factory.py b/manic/repository_factory.py similarity index 83% rename from manage_externals/manic/repository_factory.py rename to manic/repository_factory.py index c95e7a509b..80a92a9d8a 100644 --- a/manage_externals/manic/repository_factory.py +++ b/manic/repository_factory.py @@ -11,7 +11,7 @@ from .utils import fatal_error -def create_repository(component_name, repo_info): +def create_repository(component_name, repo_info, svn_ignore_ancestry=False): """Determine what type of repository we have, i.e. git or svn, and create the appropriate object. @@ -20,7 +20,7 @@ def create_repository(component_name, repo_info): if protocol == 'git': repo = GitRepository(component_name, repo_info) elif protocol == 'svn': - repo = SvnRepository(component_name, repo_info) + repo = SvnRepository(component_name, repo_info, ignore_ancestry=svn_ignore_ancestry) elif protocol == 'externals_only': repo = None else: diff --git a/manage_externals/manic/repository_git.py b/manic/repository_git.py similarity index 85% rename from manage_externals/manic/repository_git.py rename to manic/repository_git.py index efb775d0bc..f986051001 100644 --- a/manage_externals/manic/repository_git.py +++ b/manic/repository_git.py @@ -12,6 +12,7 @@ from .global_constants import VERBOSITY_VERBOSE from .repository import Repository from .externals_status import ExternalStatus +from .externals_description import ExternalsDescription, git_submodule_status from .utils import expand_local_url, split_remote_url, is_remote_url from .utils import fatal_error, printlog from .utils import execute_subprocess @@ -41,17 +42,19 @@ def __init__(self, component_name, repo): Parse repo (a XML element). """ Repository.__init__(self, component_name, repo) + self._gitmodules = None + self._submods = None # ---------------------------------------------------------------- # # Public API, defined by Repository # # ---------------------------------------------------------------- - def checkout(self, base_dir_path, repo_dir_name, verbosity): + def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): """ If the repo destination directory exists, ensure it is correct (from correct URL, correct branch or tag), and possibly update the source. - If the repo destination directory does not exist, checkout the correce + If the repo destination directory does not exist, checkout the correct branch or tag. """ repo_dir_path = os.path.join(base_dir_path, repo_dir_name) @@ -59,7 +62,15 @@ def checkout(self, base_dir_path, repo_dir_name, verbosity): if (repo_dir_exists and not os.listdir( repo_dir_path)) or not repo_dir_exists: self._clone_repo(base_dir_path, repo_dir_name, verbosity) - self._checkout_ref(repo_dir_path, verbosity) + self._checkout_ref(repo_dir_path, verbosity, recursive) + gmpath = os.path.join(repo_dir_path, + ExternalsDescription.GIT_SUBMODULES_FILENAME) + if os.path.exists(gmpath): + self._gitmodules = gmpath + self._submods = git_submodule_status(repo_dir_path) + else: + self._gitmodules = None + self._submods = None def status(self, stat, repo_dir_path): """ @@ -72,6 +83,16 @@ def status(self, stat, repo_dir_path): if os.path.exists(repo_dir_path): self._status_summary(stat, repo_dir_path) + def submodules_file(self, repo_path=None): + if repo_path is not None: + gmpath = os.path.join(repo_path, + ExternalsDescription.GIT_SUBMODULES_FILENAME) + if os.path.exists(gmpath): + self._gitmodules = gmpath + self._submods = git_submodule_status(repo_path) + + return self._gitmodules + # ---------------------------------------------------------------- # # Internal work functions @@ -282,23 +303,30 @@ def _create_remote_name(self): remote_name = "{0}_{1}".format(base_name, repo_name) return remote_name - def _checkout_ref(self, repo_dir, verbosity): + def _checkout_ref(self, repo_dir, verbosity, submodules): """Checkout the user supplied reference + if is True, recursively initialize and update + the repo's submodules """ # import pdb; pdb.set_trace() cwd = os.getcwd() os.chdir(repo_dir) if self._url.strip() == LOCAL_PATH_INDICATOR: - self._checkout_local_ref(verbosity) + self._checkout_local_ref(verbosity, submodules) else: - self._checkout_external_ref(verbosity) + self._checkout_external_ref(verbosity, submodules) + + if self._sparse: + self._sparse_checkout(repo_dir, verbosity) os.chdir(cwd) - def _checkout_local_ref(self, verbosity): + + def _checkout_local_ref(self, verbosity, submodules): """Checkout the reference considering the local repo only. Do not fetch any additional remotes or specify the remote when checkout out the ref. - + if is True, recursively initialize and update + the repo's submodules """ if self._tag: ref = self._tag @@ -308,10 +336,12 @@ def _checkout_local_ref(self, verbosity): ref = self._hash self._check_for_valid_ref(ref) - self._git_checkout_ref(ref, verbosity) + self._git_checkout_ref(ref, verbosity, submodules) - def _checkout_external_ref(self, verbosity): + def _checkout_external_ref(self, verbosity, submodules): """Checkout the reference from a remote repository + if is True, recursively initialize and update + the repo's submodules """ if self._tag: ref = self._tag @@ -326,14 +356,28 @@ def _checkout_external_ref(self, verbosity): self._git_remote_add(remote_name, self._url) self._git_fetch(remote_name) - # NOTE(bja, 2018-03) we need to send seperate ref and remote + # NOTE(bja, 2018-03) we need to send separate ref and remote # name to check_for_vaild_ref, but the combined name to # checkout_ref! self._check_for_valid_ref(ref, remote_name) if self._branch: ref = '{0}/{1}'.format(remote_name, ref) - self._git_checkout_ref(ref, verbosity) + self._git_checkout_ref(ref, verbosity, submodules) + + def _sparse_checkout(self, repo_dir, verbosity): + """Use git read-tree to thin the working tree.""" + cwd = os.getcwd() + + cmd = ['cp', self._sparse, os.path.join(repo_dir, + '.git/info/sparse-checkout')] + if verbosity >= VERBOSITY_VERBOSE: + printlog(' {0}'.format(' '.join(cmd))) + execute_subprocess(cmd) + os.chdir(repo_dir) + self._git_sparse_checkout(verbosity) + + os.chdir(cwd) def _check_for_valid_ref(self, ref, remote_name=None): """Try some basic sanity checks on the user supplied reference so we @@ -687,6 +731,19 @@ def _git_remote_verbose(): git_output = execute_subprocess(cmd, output_to_caller=True) return git_output + @staticmethod + def has_submodules(repo_dir_path=None): + """Return True iff the repository at (or the current + directory if is None) has a '.gitmodules' file + """ + if repo_dir_path is None: + fname = ExternalsDescription.GIT_SUBMODULES_FILENAME + else: + fname = os.path.join(repo_dir_path, + ExternalsDescription.GIT_SUBMODULES_FILENAME) + + return os.path.exists(fname) + # ---------------------------------------------------------------- # # system call to git for sideffects modifying the working tree @@ -696,28 +753,34 @@ def _git_remote_verbose(): def _git_clone(url, repo_dir_name, verbosity): """Run git clone for the side effect of creating a repository. """ - cmd = ['git', 'clone', '--quiet', url, repo_dir_name] + cmd = ['git', 'clone', '--quiet'] + subcmd = None + + cmd.extend([url, repo_dir_name]) if verbosity >= VERBOSITY_VERBOSE: printlog(' {0}'.format(' '.join(cmd))) execute_subprocess(cmd) + if subcmd is not None: + os.chdir(repo_dir_name) + execute_subprocess(subcmd) @staticmethod def _git_remote_add(name, url): - """Run the git remote command to for the side effect of adding a remote + """Run the git remote command for the side effect of adding a remote """ cmd = ['git', 'remote', 'add', name, url] execute_subprocess(cmd) @staticmethod def _git_fetch(remote_name): - """Run the git fetch command to for the side effect of updating the repo + """Run the git fetch command for the side effect of updating the repo """ cmd = ['git', 'fetch', '--quiet', '--tags', remote_name] execute_subprocess(cmd) @staticmethod - def _git_checkout_ref(ref, verbosity): - """Run the git checkout command to for the side effect of updating the repo + def _git_checkout_ref(ref, verbosity, submodules): + """Run the git checkout command for the side effect of updating the repo Param: ref is a reference to a local or remote object in the form 'origin/my_feature', or 'tag1'. @@ -727,3 +790,30 @@ def _git_checkout_ref(ref, verbosity): if verbosity >= VERBOSITY_VERBOSE: printlog(' {0}'.format(' '.join(cmd))) execute_subprocess(cmd) + if submodules: + GitRepository._git_update_submodules(verbosity) + + @staticmethod + def _git_sparse_checkout(verbosity): + """Configure repo via read-tree.""" + cmd = ['git', 'config', 'core.sparsecheckout', 'true'] + if verbosity >= VERBOSITY_VERBOSE: + printlog(' {0}'.format(' '.join(cmd))) + execute_subprocess(cmd) + cmd = ['git', 'read-tree', '-mu', 'HEAD'] + if verbosity >= VERBOSITY_VERBOSE: + printlog(' {0}'.format(' '.join(cmd))) + execute_subprocess(cmd) + + @staticmethod + def _git_update_submodules(verbosity): + """Run git submodule update for the side effect of updating this + repo's submodules. + """ + # First, verify that we have a .gitmodules file + if os.path.exists(ExternalsDescription.GIT_SUBMODULES_FILENAME): + cmd = ['git', 'submodule', 'update', '--init', '--recursive'] + if verbosity >= VERBOSITY_VERBOSE: + printlog(' {0}'.format(' '.join(cmd))) + + execute_subprocess(cmd) diff --git a/manage_externals/manic/repository_svn.py b/manic/repository_svn.py similarity index 92% rename from manage_externals/manic/repository_svn.py rename to manic/repository_svn.py index bef6f81414..408ed84676 100644 --- a/manage_externals/manic/repository_svn.py +++ b/manic/repository_svn.py @@ -37,11 +37,12 @@ class SvnRepository(Repository): """ RE_URLLINE = re.compile(r'^URL:') - def __init__(self, component_name, repo): + def __init__(self, component_name, repo, ignore_ancestry=False): """ Parse repo (a XML element). """ Repository.__init__(self, component_name, repo) + self._ignore_ancestry = ignore_ancestry if self._branch: self._url = os.path.join(self._url, self._branch) elif self._tag: @@ -55,7 +56,7 @@ def __init__(self, component_name, repo): # Public API, defined by Repository # # ---------------------------------------------------------------- - def checkout(self, base_dir_path, repo_dir_name, verbosity): + def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): # pylint: disable=unused-argument """Checkout or update the working copy If the repo destination directory exists, switch the sandbox to @@ -63,13 +64,15 @@ def checkout(self, base_dir_path, repo_dir_name, verbosity): If the repo destination directory does not exist, checkout the correct branch or tag. + NB: is include as an argument for compatibility with + git functionality (repository_git.py) """ repo_dir_path = os.path.join(base_dir_path, repo_dir_name) if os.path.exists(repo_dir_path): cwd = os.getcwd() os.chdir(repo_dir_path) - self._svn_switch(self._url, verbosity) + self._svn_switch(self._url, self._ignore_ancestry, verbosity) # svn switch can lead to a conflict state, but it gives a # return code of 0. So now we need to make sure that we're # in a clean (non-conflict) state. @@ -137,9 +140,7 @@ def _abort_if_dirty(self, repo_dir_path, message): To recover: Clean up the above directory (resolving conflicts, etc.), then rerun checkout_externals. -""".format(cwd=repo_dir_path, - message=message, - status=status) +""".format(cwd=repo_dir_path, message=message, status=status) fatal_error(errmsg) @@ -219,9 +220,8 @@ def xml_status_is_dirty(svn_output): continue if item == SVN_UNVERSIONED: continue - else: - is_dirty = True - break + is_dirty = True + break return is_dirty # ---------------------------------------------------------------- @@ -270,11 +270,14 @@ def _svn_checkout(url, repo_dir_path, verbosity): execute_subprocess(cmd) @staticmethod - def _svn_switch(url, verbosity): + def _svn_switch(url, ignore_ancestry, verbosity): """ Switch branches for in an svn sandbox """ - cmd = ['svn', 'switch', '--quiet', url] + cmd = ['svn', 'switch', '--quiet'] + if ignore_ancestry: + cmd.append('--ignore-ancestry') + cmd.append(url) if verbosity >= VERBOSITY_VERBOSE: printlog(' {0}'.format(' '.join(cmd))) execute_subprocess(cmd) diff --git a/manage_externals/manic/sourcetree.py b/manic/sourcetree.py similarity index 80% rename from manage_externals/manic/sourcetree.py rename to manic/sourcetree.py index dff91dc1af..b9c9c21082 100644 --- a/manage_externals/manic/sourcetree.py +++ b/manic/sourcetree.py @@ -11,12 +11,12 @@ from .externals_description import read_externals_description_file from .externals_description import create_externals_description from .repository_factory import create_repository +from .repository_git import GitRepository from .externals_status import ExternalStatus from .utils import fatal_error, printlog from .global_constants import EMPTY_STR, LOCAL_PATH_INDICATOR from .global_constants import VERBOSITY_VERBOSE - class _External(object): """ _External represents an external object inside a SourceTree @@ -24,7 +24,7 @@ class _External(object): # pylint: disable=R0902 - def __init__(self, root_dir, name, ext_description): + def __init__(self, root_dir, name, ext_description, svn_ignore_ancestry): """Parse an external description file into a dictionary of externals. Input: @@ -37,12 +37,15 @@ def __init__(self, root_dir, name, ext_description): ext_description : dict - source ExternalsDescription object + svn_ignore_ancestry : bool - use --ignore-externals with svn switch + """ self._name = name self._repo = None self._externals = EMPTY_STR self._externals_sourcetree = None self._stat = ExternalStatus() + self._sparse = None # Parse the sub-elements # _path : local path relative to the containing source tree @@ -59,13 +62,20 @@ def __init__(self, root_dir, name, ext_description): self._required = ext_description[ExternalsDescription.REQUIRED] self._externals = ext_description[ExternalsDescription.EXTERNALS] - if self._externals: - self._create_externals_sourcetree() + # Treat a .gitmodules file as a backup externals config + if not self._externals: + if GitRepository.has_submodules(self._repo_dir_path): + self._externals = ExternalsDescription.GIT_SUBMODULES_FILENAME + repo = create_repository( - name, ext_description[ExternalsDescription.REPO]) + name, ext_description[ExternalsDescription.REPO], + svn_ignore_ancestry=svn_ignore_ancestry) if repo: self._repo = repo + if self._externals and (self._externals.lower() != 'none'): + self._create_externals_sourcetree() + def get_name(self): """ Return the external object's name @@ -122,7 +132,7 @@ def status(self): if self._externals and self._externals_sourcetree: # we expect externals and they exist cwd = os.getcwd() - # SourceTree expecteds to be called from the correct + # SourceTree expects to be called from the correct # root directory. os.chdir(self._repo_dir_path) ext_stats = self._externals_sourcetree.status(self._local_path) @@ -145,7 +155,7 @@ def checkout(self, verbosity, load_all): """ If the repo destination directory exists, ensure it is correct (from correct URL, correct branch or tag), and possibly update the external. - If the repo destination directory does not exist, checkout the correce + If the repo destination directory does not exist, checkout the correct branch or tag. If load_all is True, also load all of the the externals sub-externals. """ @@ -180,13 +190,14 @@ def checkout(self, verbosity, load_all): checkout_verbosity = verbosity - 1 else: checkout_verbosity = verbosity - self._repo.checkout(self._base_dir_path, - self._repo_dir_name, checkout_verbosity) + + self._repo.checkout(self._base_dir_path, self._repo_dir_name, + checkout_verbosity, self.clone_recursive()) def checkout_externals(self, verbosity, load_all): """Checkout the sub-externals for this object """ - if self._externals: + if self.load_externals(): if self._externals_sourcetree: # NOTE(bja, 2018-02): the subtree externals objects # were created during initial status check. Updating @@ -198,6 +209,24 @@ def checkout_externals(self, verbosity, load_all): self._create_externals_sourcetree() self._externals_sourcetree.checkout(verbosity, load_all) + def load_externals(self): + 'Return True iff an externals file should be loaded' + load_ex = False + if os.path.exists(self._repo_dir_path): + if self._externals: + if self._externals.lower() != 'none': + load_ex = os.path.exists(os.path.join(self._repo_dir_path, + self._externals)) + + return load_ex + + def clone_recursive(self): + 'Return True iff any .gitmodules files should be processed' + # Try recursive unless there is an externals entry + recursive = not self._externals + + return recursive + def _create_externals_sourcetree(self): """ """ @@ -210,6 +239,15 @@ def _create_externals_sourcetree(self): cwd = os.getcwd() os.chdir(self._repo_dir_path) + if self._externals.lower() == 'none': + msg = ('Internal: Attempt to create source tree for ' + 'externals = none in {}'.format(self._repo_dir_path)) + fatal_error(msg) + + if not os.path.exists(self._externals): + if GitRepository.has_submodules(): + self._externals = ExternalsDescription.GIT_SUBMODULES_FILENAME + if not os.path.exists(self._externals): # NOTE(bja, 2017-10) this check is redundent with the one # in read_externals_description_file! @@ -221,17 +259,17 @@ def _create_externals_sourcetree(self): externals_root = self._repo_dir_path model_data = read_externals_description_file(externals_root, self._externals) - externals = create_externals_description(model_data) + externals = create_externals_description(model_data, + parent_repo=self._repo) self._externals_sourcetree = SourceTree(externals_root, externals) os.chdir(cwd) - class SourceTree(object): """ SourceTree represents a group of managed externals """ - def __init__(self, root_dir, model): + def __init__(self, root_dir, model, svn_ignore_ancestry=False): """ Build a SourceTree object from a model description """ @@ -239,7 +277,7 @@ def __init__(self, root_dir, model): self._all_components = {} self._required_compnames = [] for comp in model: - src = _External(self._root_dir, comp, model[comp]) + src = _External(self._root_dir, comp, model[comp], svn_ignore_ancestry) self._all_components[comp] = src if model[comp][ExternalsDescription.REQUIRED]: self._required_compnames.append(comp) @@ -261,18 +299,20 @@ def status(self, relative_path_base=LOCAL_PATH_INDICATOR): for comp in load_comps: printlog('{0}, '.format(comp), end='') stat = self._all_components[comp].status() + stat_final = {} for name in stat.keys(): # check if we need to append the relative_path_base to # the path so it will be sorted in the correct order. - if not stat[name].path.startswith(relative_path_base): - stat[name].path = os.path.join(relative_path_base, - stat[name].path) - # store under key = updated path, and delete the - # old key. - comp_stat = stat[name] - del stat[name] - stat[comp_stat.path] = comp_stat - summary.update(stat) + if stat[name].path.startswith(relative_path_base): + # use as is, without any changes to path + stat_final[name] = stat[name] + else: + # append relative_path_base to path and store under key = updated path + modified_path = os.path.join(relative_path_base, + stat[name].path) + stat_final[modified_path] = stat[name] + stat_final[modified_path].path = modified_path + summary.update(stat_final) return summary diff --git a/manage_externals/manic/utils.py b/manic/utils.py similarity index 100% rename from manage_externals/manic/utils.py rename to manic/utils.py diff --git a/parse_cime.cs.status b/parse_cime.cs.status deleted file mode 100755 index 08bb1bfc86..0000000000 --- a/parse_cime.cs.status +++ /dev/null @@ -1,416 +0,0 @@ -#!/usr/bin/env perl -#======================================================================= -# -# Parse a cime5 cs.status file to give summary output -# -# Usage: -# -# ./parse_cime.cs.status -# -# Erik Kluzek -# Sep/19/2016 -# -#======================================================================= -use Cwd; -use strict; -#use diagnostics; -use English; -use Getopt::Long; -use IO::File; - -#----------------------------------------------------------------------------------------------- -# Set the directory that contains this scripts. If the command was issued using a -# relative or absolute path, that path is in $ProgDir. Otherwise assume the -# command was issued from the current working directory. - -sub GetNameNDir { - (my $ProgName = $0) =~ s!(.*)/!!; # name of this script - my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script is in - # the user's PATH - my $cmdline = "@ARGV"; # Command line arguments to script - my $cwd = getcwd(); # current working directory - my $scrdir; # absolute pathname of directory that contains this script - my $nm = "$ProgName::"; # name to use if script dies - if ($ProgDir) { - $scrdir = absolute_path($ProgDir); - } else { - $scrdir = $cwd; - } - return( $ProgName, $scrdir ); -} - - -#----------------------------------------------------------------------------------------------- - -sub usage { - my $ProgName = shift; - die < [options] -REQUIRED OPTIONS - cime5 cs.status. file(s) that will be run and parsed - At least one file needs to be given, but you can also - give a list of space seperated files. -OPTIONS - -die_on_duplicate Die if find a duplicate testname - -summarize [or -s] Summarize results into lists of tests in categories (pend, pass, fail etc.) - -sum_results_perline Summarize results categories of each test into one line - -help [or -h] Print usage to STDOUT. - -verbose [or -v] Make output more verbose. - --summarize and -sum_results_perline can NOT both be asked for as they contrdict each other. -EOF -} - -#----------------------------------------------------------------------------------------------- - - -sub process_cmdline { -# Process command-line options. - my $ProgName = shift; - - my %opts = ( - csstatusfiles_ref => undef, - sumintocats => 0, - sumperline => 0, - dieondup => 0, - help => 0, - verbose => 0, - ); - - GetOptions( - "h|help" => \$opts{'help'}, - "s|summarize" => \$opts{'sumintocats'}, - "die_on_duplicate" => \$opts{'dieondup'}, - "sum_results_perline" => \$opts{'sumperline'}, - "v|verbose" => \$opts{'verbose'}, - ) or usage($ProgName); - - # Give usage message. - usage($ProgName) if $opts{'help'}; - - # If bad input - if ( $opts{'sumintocats'} && $opts{'sumperline'} ) { - print "ERROR: options -summarize and -sum_results_perline contradict each other, choose one or the other or neither\n"; - usage($ProgName); - } - - # Get cs.status filenames - $opts{'csstatusfiles_ref'} = \@ARGV; - - my $files_ref = $opts{'csstatusfiles_ref'}; - - if ( $#$files_ref == -1 ) { - print "ERROR: cs.status filename(s) was (were) NOT input\n"; - usage($ProgName); - } - - foreach my $file ( @$files_ref ) { - if ( ! -x $file ) { - print "ERROR: cs.status filename does NOT exist: $file\n"; - usage($ProgName); - } - } - - return( %opts ); -} - -#------------------------------------------------------------------------------- - -sub absolute_path { -# -# Convert a pathname into an absolute pathname, expanding any . or .. characters. -# Assumes pathnames refer to a local filesystem. -# Assumes the directory separator is "/". -# - my $path = shift; - my $cwd = getcwd(); # current working directory - my $abspath; # resulting absolute pathname - -# Strip off any leading or trailing whitespace. (This pattern won't match if -# there's embedded whitespace. - $path =~ s!^\s*(\S*)\s*$!$1!; - -# Convert relative to absolute path. - - if ($path =~ m!^\.$!) { # path is "." - return $cwd; - } elsif ($path =~ m!^\./!) { # path starts with "./" - $path =~ s!^\.!$cwd!; - } elsif ($path =~ m!^\.\.$!) { # path is ".." - $path = "$cwd/.."; - } elsif ($path =~ m!^\.\./!) { # path starts with "../" - $path = "$cwd/$path"; - } elsif ($path =~ m!^[^/]!) { # path starts with non-slash character - $path = "$cwd/$path"; - } - - my ($dir, @dirs2); - my @dirs = split "/", $path, -1; # The -1 prevents split from stripping trailing nulls - # This enables correct processing of the input "/". - - # Remove any "" that are not leading. - for (my $i=0; $i<=$#dirs; ++$i) { - if ($i == 0 or $dirs[$i] ne "") { - push @dirs2, $dirs[$i]; - } - } - @dirs = (); - - # Remove any "." - foreach $dir (@dirs2) { - unless ($dir eq ".") { - push @dirs, $dir; - } - } - @dirs2 = (); - - # Remove the "subdir/.." parts. - foreach $dir (@dirs) { - if ( $dir !~ /^\.\.$/ ) { - push @dirs2, $dir; - } else { - pop @dirs2; # remove previous dir when current dir is .. - } - } - if ($#dirs2 == 0 and $dirs2[0] eq "") { return "/"; } - $abspath = join '/', @dirs2; - return( $abspath ); -} - -sub run_csstatus { - # run a cs.status file and parse it's output - my ( $csstatusfilename, $verbose, $csstatus_ref, $dieondup ) = @_; - - if ( ! -x $csstatusfilename ) { - die "ERROR: cs.status file does NOT exist or can not execute: $csstatusfilename\n"; - } - my $csdate = undef; - if ( $csstatusfilename =~ /cs.status.([0-9_]+)/ ) { - $csdate = $1; - chomp( $csdate ); - } - if ( $verbose ) { print "Parse file: $csstatusfilename\n"; } - my @lines = `$csstatusfilename`; - while ( my $line = shift(@lines) ) { - if ( $line =~ /([^ ]+) \(Overall: ([^ ,]+)\)/ ) { - my $test = $1; - my $over = $2; - my $fails = ""; my $passes = ""; my $pendings = ""; - my $newline; - my $bfail = 0; - if ( $verbose ) { print "$test\n"; } - do { - $newline = shift(@lines); - if ( $newline =~ /FAIL[ ]+$test ([^ ]+)/ ) { - $fails .= " $1"; - chomp( $fails ); - if ( $1 eq "BASELINE" ) { - if ( $newline =~ /ERROR BFAIL baseline directory/ ) { - $bfail = 1; - } - } - } elsif ( $newline =~ /PASS[ ]+$test ([^ ]+)/ ) { - $passes .= " $1"; - chomp( $passes ); - } elsif ( $newline =~ /PEND[ ]+$test ([^ ]+)/ ) { - $pendings .= " $1"; - chomp( $pendings ); - } elsif ( (! $newline) || ($newline =~ /Overall:/) ) { - } else { - if ( $verbose ) { print "ERROR: parsing line: $newline\n"; } - } - } until ( (! $newline) || ($newline =~ /Overall:/) ); - if ( $newline ) { - unshift( @lines, $newline ); - } - if ( $over eq "NLFAIL" ) { - $over = "PASS"; - } - elsif ( $over eq "NLCOMP" ) { - $over = "PASS"; - } - elsif ( $over eq "DIFF" ) { - if ( $bfail ) { - $over = "FAIL_BDNE"; - } else { - $over = "DIFF"; - } - } - if ( exists($$csstatus_ref{$test}) ) { - if ( $dieondup ) { - die "ERROR: Already had a test that matches this one: $test\n"; - } - next; - } - $$csstatus_ref{$test}{'over'} = $over; - $$csstatus_ref{$test}{'FAIL'} = $fails; - $$csstatus_ref{$test}{'PASS'} = $passes; - $$csstatus_ref{$test}{'PEND'} = $pendings; - if ( ! $newline ) { last; } - } else { - if ( $verbose ) { print( "WARNING: Didn't parse following line:\n$line" ); } - } - } - -} - -sub print_status { - # Print status info for each test - - my %csstatus = @_; - - foreach my $key ( keys(%csstatus) ) { - foreach my $type ( "PASS", "FAIL", "PEND" ) { - if ( $csstatus{$key}{$type} ne "" ) { - foreach my $phase ( split( / /, $csstatus{$key}{$type}) ) { - if ( $phase =~ /[^ ]+/ ) { - printf( "%-10s %-90s %s\n", $type, $key, $phase ); - } - } - } - } - } -} - -sub print_sumperline { - # Print summary info for each test - - my %csstatus = @_; - - foreach my $key ( keys(%csstatus) ) { - printf( "%-10s %-90s Passing: %s\n", $csstatus{$key}{'over'}, $key, $csstatus{$key}{'PASS'} ); - if ( $csstatus{$key}{'FAIL'} ne "" ) { - printf( "%-10s %-90s %s\n", "FAIL", $key, $csstatus{$key}{'FAIL'} ); - } - if ( $csstatus{$key}{'PEND'} ne "" ) { - printf( "%-10s %-90s %s\n", "PEND", $key, $csstatus{$key}{'PEND'} ); - } - } -} - - - -sub print_categories { - # Seperate tests into categories - - my $scrdir = shift(@_); - my %csstatus = @_; - - my $expectedfailfile = "$scrdir/components/clm/cime_config/testdefs/ExpectedTestFails.xml"; - if ( ! -f $expectedfailfile ) { - $expectedfailfile = "$scrdir/cime_config/testdefs/ExpectedTestFails.xml"; - } - my @passes; - my @fails; - my @pendings; - my @compares_diff; - my @compares_diff_nobase; - my @keys = sort( keys(%csstatus) ); - foreach my $key ( @keys ) { - if ( $csstatus{$key}{'over'} eq "PASS" ) { - push( @passes, $key ); - } elsif ( $csstatus{$key}{'over'} eq "DIFF" ) { - push( @passes, $key ); - push( @compares_diff, $key ); - } elsif ( $csstatus{$key}{'over'} eq "FAIL_BDNE" ) { - push( @passes, $key ); - push( @compares_diff_nobase, $key ); - } elsif ( $csstatus{$key}{'over'} eq "FAIL" ) { - push( @fails, $key ); - } elsif ( $csstatus{$key}{'over'} eq "PEND" ) { - push( @pendings, $key ); - } else { - print( "WARNING: unclassified overall status: $key, $csstatus{$key}{'over'}\n" ); - } - } - print( "================================================================================\n" ); - print( "Test summary\n" ); - printf( "%d Total tests\n", $#keys+1 ); - printf( "%d Tests passed\n", $#passes+1 ); - printf( "%d Tests compare different to baseline\n", $#compares_diff+1 ); - printf( "%d Tests are new where there is no baseline\n", $#compares_diff_nobase+1 ); - printf( "%d Tests pending\n", $#pendings+1 ); - printf( "%d Tests failed\n", $#fails+1 ); - print( "================================================================================\n" ); - - if ( $#passes >= 0 ) { - print( "================================================================================\n" ); - print( "These tests passed\n" ); - print( "================================================================================\n" ); - foreach my $key ( @passes ) { - my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "FAILED PREVIOUSLY"; } - print( "$key\t\t\t$expect\n" ); - } - } - if ( $#compares_diff >= 0 ) { - print( "================================================================================\n" ); - print( "These tests compare different to the baseline\n" ); - print( "================================================================================\n" ); - foreach my $key ( @compares_diff ) { - print( "$key\n" ); - } - } - if ( $#compares_diff_nobase >= 0 ) { - print( "================================================================================\n" ); - print( "These tests don't have a baseline to compare to\n" ); - print( "================================================================================\n" ); - foreach my $key ( @compares_diff_nobase ) { - print( "$key\n" ); - } - } - if ( $#pendings >= 0 ) { - print( "================================================================================\n" ); - print( "These tests are pending (some tests may fail in the pending state)\n" ); - print( "================================================================================\n" ); - foreach my $key ( @pendings ) { - my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } - print( "$key\t\t$expect\n" ); - } - } - if ( $#fails >= 0 ) { - print( "================================================================================\n" ); - print( "These tests failed\n" ); - print( "================================================================================\n" ); - foreach my $key ( @fails ) { - my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } - print( "$key\t\t$expect\n" ); - } - } -} - -#----------------------------------------------------------------------------------------------- - -sub main { -# main subroutine - my ($ProgName, $scrdir) = &GetNameNDir( ); - my $pwd = `pwd`; - chomp( $pwd ); - my %opts = &process_cmdline( $ProgName ); - my %csstatus; - my $files_ref = $opts{'csstatusfiles_ref'}; - foreach my $file ( @$files_ref ) { - &run_csstatus( "$pwd/$file", $opts{'verbose'}, \%csstatus, $opts{'dieondup'} ); - } - if ( $opts{'verbose'} ) { - print "Print summary of testing:\n"; - } - if ( $opts{'sumintocats'} ) { - &print_categories( $scrdir, %csstatus ); - } elsif ( $opts{'sumperline'} ) { - &print_sumperline( %csstatus ); - } else { - &print_status( %csstatus ); - } -} - -# Invoke the main subroutine -&main(); - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index be66201047..0000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,108 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -list(APPEND CMAKE_MODULE_PATH ${CIME_CMAKE_MODULE_DIRECTORY}) -include(CIME_initial_setup) - -project(clm45_tests Fortran C) - -include(CIME_utils) - -set(CLM_ROOT "..") - -# This definition is needed to avoid having ESMF depend on mpi -add_definitions(-DHIDE_MPI) - -# Add source directories from other share code (csm_share, etc.). This should be -# done first, so that in case of name collisions, the CLM versions take -# precedence (when there are two files with the same name, the one added later -# wins). -add_subdirectory(${CIMEROOT}/src/share/util csm_share) -add_subdirectory(${CIMEROOT}/src/share/unit_test_stubs/util csm_share_stubs) -add_subdirectory(${CIMEROOT}/src/share/esmf_wrf_timemgr esmf_wrf_timemgr) -add_subdirectory(${CIMEROOT}/src/drivers/mct/shr drv_share) - -# Extract just the files we need from drv_share -set (drv_sources_needed_base - glc_elevclass_mod.F90 - ) -extract_sources("${drv_sources_needed_base}" "${drv_sources}" drv_sources_needed) - -# Add CLM source directories (these add their own test directories) -add_subdirectory(${CLM_ROOT}/src/utils clm_utils) -add_subdirectory(${CLM_ROOT}/src/biogeochem clm_biogeochem) -add_subdirectory(${CLM_ROOT}/src/soilbiogeochem clm_soilbiogeochem) -add_subdirectory(${CLM_ROOT}/src/biogeophys clm_biogeophys) -add_subdirectory(${CLM_ROOT}/src/dyn_subgrid clm_dyn_subgrid) -add_subdirectory(${CLM_ROOT}/src/main clm_main) -add_subdirectory(${CLM_ROOT}/src/init_interp clm_init_interp) -add_subdirectory(${CLM_ROOT}/src/fates/main fates_main) - -# Add general unit test directories (stubbed out files, etc.) -add_subdirectory(unit_test_stubs) -add_subdirectory(unit_test_shr) - -# 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} ${drv_sources_needed}) -declare_generated_dependencies(csm_share "${share_genf90_sources}") -add_library(esmf_wrf_timemgr ${esmf_wrf_timemgr_sources}) -add_library(clm ${clm_sources}) -declare_generated_dependencies(clm "${clm_genf90_sources}") -add_dependencies(esmf_wrf_timemgr csm_share) -add_dependencies(clm csm_share esmf_wrf_timemgr) - -# We need to look for header files here, in order to pick up shr_assert.h -include_directories(${CIMEROOT}/src/share/include) - -# And we need to look for header files here, for some include files needed by -# the esmf_wrf_timemgr code -include_directories(${CIMEROOT}/src/share/esmf_wrf_timemgr) - -# 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 test directories -# Note: it's possible that these could be added by each source directory that -# has tests in it. However, it appears that the order needs to be done -# carefully: for example, include_directories and link_directories needs to be -# done before adding the tests themselves. -add_subdirectory(${CLM_ROOT}/src/unit_test_shr/test clm_unit_test_shr_test) -add_subdirectory(${CLM_ROOT}/src/utils/test clm_utils_test) -add_subdirectory(${CLM_ROOT}/src/biogeophys/test clm_biogeophys_test) -add_subdirectory(${CLM_ROOT}/src/biogeochem/test clm_biogeochem_test) -add_subdirectory(${CLM_ROOT}/src/soilbiogeochem/test clm_soilbiogeochem_test) -add_subdirectory(${CLM_ROOT}/src/dyn_subgrid/test clm_dyn_subgrid_test) -add_subdirectory(${CLM_ROOT}/src/main/test clm_main_test) -add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) diff --git a/src/README.unit_testing b/src/README.unit_testing deleted file mode 100644 index de503ca8d3..0000000000 --- a/src/README.unit_testing +++ /dev/null @@ -1,13 +0,0 @@ -# To run all CTSM unit tests on caldera, run the following command: -# -# The creation of a temporary directory ensures that you are doing a completely -# clean build of the unit tests. (The use of the --clean flag to run_tests.py -# cleans most, but not all of the files created by the unit test build.) For -# rerunning the tests after an incremental change, you can instead use an -# existing build directory. - -# From a standalone CTSM checkout: -../cime/scripts/fortran_unit_testing/run_tests.py --build-dir `mktemp -d --tmpdir=. unit_tests.XXXXXXXX` - -# If you are within a full CESM checkout, you would instead do: -# ../../../cime/scripts/fortran_unit_testing/run_tests.py --build-dir `mktemp -d --tmpdir=. unit_tests.XXXXXXXX` diff --git a/src/biogeochem/CMakeLists.txt b/src/biogeochem/CMakeLists.txt deleted file mode 100644 index 0a7ef162f4..0000000000 --- a/src/biogeochem/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources - CNSharedParamsMod.F90 - CNSpeciesMod.F90 - CNVegComputeSeedMod.F90 - SpeciesBaseType.F90 - SpeciesIsotopeType.F90 - SpeciesNonIsotopeType.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/biogeochem/CNAnnualUpdateMod.F90 b/src/biogeochem/CNAnnualUpdateMod.F90 deleted file mode 100644 index 508b7cf08e..0000000000 --- a/src/biogeochem/CNAnnualUpdateMod.F90 +++ /dev/null @@ -1,113 +0,0 @@ -module CNAnnualUpdateMod - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for updating annual summation variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNvegStateType , only : cnveg_state_type - use PatchType , only : patch - use filterColMod , only : filter_col_type, col_filter_from_filter_and_logical_array - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: CNAnnualUpdate - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNAnnualUpdate(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update annual summation variables - ! - ! !USES: - use clm_time_manager, only: get_step_size, get_days_per_year - use clm_varcon , only: secspday - use SubgridAveMod , only: p2c - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: secspyear - real(r8):: dt ! radiation time step (seconds) - logical :: end_of_year(bounds%begc:bounds%endc) ! whether each column has reached the end of the year, according to its own annsum_counter - type(filter_col_type) :: filter_endofyear_c - !----------------------------------------------------------------------- - - dt = real( get_step_size(), r8 ) - secspyear = get_days_per_year() * secspday - - do fc = 1,num_soilc - c = filter_soilc(fc) - cnveg_state_inst%annsum_counter_col(c) = cnveg_state_inst%annsum_counter_col(c) + dt - if (cnveg_state_inst%annsum_counter_col(c) >= secspyear) then - end_of_year(c) = .true. - cnveg_state_inst%annsum_counter_col(c) = 0._r8 - else - end_of_year(c) = .false. - end if - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - if (end_of_year(c)) then - - ! update annual plant ndemand accumulator - cnveg_state_inst%annsum_potential_gpp_patch(p) = cnveg_state_inst%tempsum_potential_gpp_patch(p) - cnveg_state_inst%tempsum_potential_gpp_patch(p) = 0._r8 - - ! update annual total N retranslocation accumulator - cnveg_state_inst%annmax_retransn_patch(p) = cnveg_state_inst%tempmax_retransn_patch(p) - cnveg_state_inst%tempmax_retransn_patch(p) = 0._r8 - - ! update annual average 2m air temperature accumulator - cnveg_state_inst%annavg_t2m_patch(p) = cnveg_state_inst%tempavg_t2m_patch(p) - cnveg_state_inst%tempavg_t2m_patch(p) = 0._r8 - - ! update annual NPP accumulator, convert to annual total - cnveg_carbonflux_inst%annsum_npp_patch(p) = cnveg_carbonflux_inst%tempsum_npp_patch(p) * dt - cnveg_carbonflux_inst%tempsum_npp_patch(p) = 0._r8 - - ! update annual litfall accumulator, convert to annual total - cnveg_carbonflux_inst%annsum_litfall_patch(p) = cnveg_carbonflux_inst%tempsum_litfall_patch(p) * dt - cnveg_carbonflux_inst%tempsum_litfall_patch(p) = 0._r8 - - end if - end do - - ! Get column-level averages, just for the columns that have reached their personal end-of-year - filter_endofyear_c = col_filter_from_filter_and_logical_array( & - bounds = bounds, & - num_orig = num_soilc, & - filter_orig = filter_soilc, & - logical_col = end_of_year(bounds%begc:bounds%endc)) - - call p2c(bounds, filter_endofyear_c%num, filter_endofyear_c%indices, & - cnveg_carbonflux_inst%annsum_npp_patch(bounds%begp:bounds%endp), & - cnveg_carbonflux_inst%annsum_npp_col(bounds%begc:bounds%endc)) - - call p2c(bounds, filter_endofyear_c%num, filter_endofyear_c%indices, & - cnveg_state_inst%annavg_t2m_patch(bounds%begp:bounds%endp), & - cnveg_state_inst%annavg_t2m_col(bounds%begc:bounds%endc)) - - end subroutine CNAnnualUpdate - -end module CNAnnualUpdateMod diff --git a/src/biogeochem/CNBalanceCheckMod.F90 b/src/biogeochem/CNBalanceCheckMod.F90 deleted file mode 100644 index f2811d290a..0000000000 --- a/src/biogeochem/CNBalanceCheckMod.F90 +++ /dev/null @@ -1,358 +0,0 @@ -module CNBalanceCheckMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for carbon/nitrogen mass balance checking. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_nitrif_denitrif - use clm_time_manager , only : get_step_size - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use SoilBiogeochemNitrogenfluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemCarbonfluxType , only : soilbiogeochem_carbonflux_type - use ColumnType , only : col - use GridcellType , only : grc - use CNSharedParamsMod , only : use_fun - - ! - implicit none - private - ! - ! !PUBLIC TYPES: - type, public :: cn_balance_type - private - real(r8), pointer :: begcb_col(:) ! (gC/m2) carbon mass, beginning of time step - real(r8), pointer :: endcb_col(:) ! (gC/m2) carbon mass, end of time step - real(r8), pointer :: begnb_col(:) ! (gN/m2) nitrogen mass, beginning of time step - real(r8), pointer :: endnb_col(:) ! (gN/m2) nitrogen mass, end of time step - contains - procedure , public :: Init - procedure , public :: BeginCNBalance - procedure , public :: CBalanceCheck - procedure , public :: NBalanceCheck - procedure , private :: InitAllocate - end type cn_balance_type - ! - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - class(cn_balance_type) :: this - type(bounds_type) , intent(in) :: bounds - - call this%InitAllocate(bounds) - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - class(cn_balance_type) :: this - type(bounds_type) , intent(in) :: bounds - - integer :: begc, endc - - begc = bounds%begc; endc= bounds%endc - - allocate(this%begcb_col(begc:endc)) ; this%begcb_col(:) = nan - allocate(this%endcb_col(begc:endc)) ; this%endcb_col(:) = nan - allocate(this%begnb_col(begc:endc)) ; this%begnb_col(:) = nan - allocate(this%endnb_col(begc:endc)) ; this%endnb_col(:) = nan - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine BeginCNBalance(this, bounds, num_soilc, filter_soilc, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Calculate beginning column-level carbon/nitrogen balance, for mass conservation check - ! - ! Should be called after the CN state summaries have been computed for this time step - ! (which should be after the dynamic landunit area updates and the associated filter - ! updates - i.e., using the new version of the filters) - ! - ! !ARGUMENTS: - class(cn_balance_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c - !----------------------------------------------------------------------- - - associate( & - col_begcb => this%begcb_col , & ! Output: [real(r8) (:)] (gC/m2) carbon mass, beginning of time step - col_begnb => this%begnb_col , & ! Output: [real(r8) (:)] (gN/m2) nitrogen mass, beginning of time step - totcolc => cnveg_carbonstate_inst%totc_col , & ! Input: [real(r8) (:)] (gC/m2) total column carbon, incl veg and cpool - totcoln => cnveg_nitrogenstate_inst%totn_col & ! Input: [real(r8) (:)] (gN/m2) total column nitrogen, incl veg - ) - - do fc = 1,num_soilc - c = filter_soilc(fc) - col_begcb(c) = totcolc(c) - col_begnb(c) = totcoln(c) - end do - - end associate - - end subroutine BeginCNBalance - - !----------------------------------------------------------------------- - subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, & - soilbiogeochem_carbonflux_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst) - ! - ! !DESCRIPTION: - ! Perform carbon mass conservation check for column and patch - ! - ! !ARGUMENTS: - class(cn_balance_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,err_index ! indices - integer :: fc ! lake filter indices - logical :: err_found ! error flag - real(r8) :: dt ! radiation time step (seconds) - real(r8) :: col_cinputs - real(r8) :: col_coutputs - real(r8) :: col_errcb(bounds%begc:bounds%endc) - !----------------------------------------------------------------------- - - associate( & - col_begcb => this%begcb_col , & ! Input: [real(r8) (:) ] (gC/m2) carbon mass, beginning of time step - col_endcb => this%endcb_col , & ! Output: [real(r8) (:) ] (gC/m2) carbon mass, end of time step - wood_harvestc => cnveg_carbonflux_inst%wood_harvestc_col , & ! Input: [real(r8) (:) ] (gC/m2/s) wood harvest (to product pools) - grainc_to_cropprodc => cnveg_carbonflux_inst%grainc_to_cropprodc_col , & ! Input: [real(r8) (:) ] (gC/m2/s) grain C to 1-year crop product pool - gpp => cnveg_carbonflux_inst%gpp_col , & ! Input: [real(r8) (:) ] (gC/m2/s) gross primary production - er => cnveg_carbonflux_inst%er_col , & ! Input: [real(r8) (:) ] (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - col_fire_closs => cnveg_carbonflux_inst%fire_closs_col , & ! Input: [real(r8) (:) ] (gC/m2/s) total column-level fire C loss - col_hrv_xsmrpool_to_atm => cnveg_carbonflux_inst%hrv_xsmrpool_to_atm_col , & ! Input: [real(r8) (:) ] (gC/m2/s) excess MR pool harvest mortality - - som_c_leached => soilbiogeochem_carbonflux_inst%som_c_leached_col , & ! Input: [real(r8) (:) ] (gC/m2/s) total SOM C loss from vertical transport - - totcolc => cnveg_carbonstate_inst%totc_col & ! Input: [real(r8) (:) ] (gC/m2) total column carbon, incl veg and cpool - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - err_found = .false. - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate the total column-level carbon storage, for mass conservation check - col_endcb(c) = totcolc(c) - - ! calculate total column-level inputs - col_cinputs = gpp(c) - - ! calculate total column-level outputs - ! er = ar + hr, col_fire_closs includes patch-level fire losses - col_coutputs = er(c) + col_fire_closs(c) + col_hrv_xsmrpool_to_atm(c) - - ! Fluxes to product pools are included in column-level outputs: the product - ! pools are not included in totcolc, so are outside the system with respect to - ! these balance checks. (However, the dwt flux to product pools is NOT included, - ! since col_begcb is initialized after the dynamic area adjustments - i.e., - ! after the dwt term has already been taken out.) - col_coutputs = col_coutputs + & - wood_harvestc(c) + & - grainc_to_cropprodc(c) - - ! subtract leaching flux - col_coutputs = col_coutputs - som_c_leached(c) - - ! calculate the total column-level carbon balance error for this time step - col_errcb(c) = (col_cinputs - col_coutputs)*dt - & - (col_endcb(c) - col_begcb(c)) - - ! check for significant errors - if (abs(col_errcb(c)) > 1e-7_r8) then - err_found = .true. - err_index = c - end if - if (abs(col_errcb(c)) > 1e-8_r8) then - write(iulog,*) 'cbalance warning',c,col_errcb(c),col_endcb(c) - end if - - - - end do ! end of columns loop - - if (err_found) then - c = err_index - write(iulog,*)'column cbalance error = ', col_errcb(c), c - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(col%gridcell(c)),grc%londeg(col%gridcell(c)) - write(iulog,*)'begcb = ',col_begcb(c) - write(iulog,*)'endcb = ',col_endcb(c) - write(iulog,*)'delta store = ',col_endcb(c)-col_begcb(c) - write(iulog,*)'--- Inputs ---' - write(iulog,*)'gpp = ',gpp(c)*dt - write(iulog,*)'--- Outputs ---' - write(iulog,*)'er = ',er(c)*dt - write(iulog,*)'col_fire_closs = ',col_fire_closs(c)*dt - write(iulog,*)'col_hrv_xsmrpool_to_atm = ',col_hrv_xsmrpool_to_atm(c)*dt - write(iulog,*)'wood_harvestc = ',wood_harvestc(c)*dt - write(iulog,*)'grainc_to_cropprodc = ',grainc_to_cropprodc(c)*dt - write(iulog,*)'-1*som_c_leached = ',som_c_leached(c)*dt - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end associate - - end subroutine CBalanceCheck - - !----------------------------------------------------------------------- - subroutine NBalanceCheck(this, bounds, num_soilc, filter_soilc, & - soilbiogeochem_nitrogenflux_inst, cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Perform nitrogen mass conservation check - ! - ! !USES: - use clm_varctl, only : use_crop - ! - ! !ARGUMENTS: - class(cn_balance_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc (:) ! filter for soil columns - type(soilbiogeochem_nitrogenflux_type) , intent(in) :: soilbiogeochem_nitrogenflux_inst - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,err_index,j ! indices - integer :: fc ! lake filter indices - logical :: err_found ! error flag - real(r8):: dt ! radiation time step (seconds) - real(r8):: col_ninputs(bounds%begc:bounds%endc) - real(r8):: col_noutputs(bounds%begc:bounds%endc) - real(r8):: col_errnb(bounds%begc:bounds%endc) - !----------------------------------------------------------------------- - - associate( & - col_begnb => this%begnb_col , & ! Input: [real(r8) (:) ] (gN/m2) nitrogen mass, beginning of time step - col_endnb => this%endnb_col , & ! Output: [real(r8) (:) ] (gN/m2) nitrogen mass, end of time step - ndep_to_sminn => soilbiogeochem_nitrogenflux_inst%ndep_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) atmospheric N deposition to soil mineral N - nfix_to_sminn => soilbiogeochem_nitrogenflux_inst%nfix_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) symbiotic/asymbiotic N fixation to soil mineral N - ffix_to_sminn => soilbiogeochem_nitrogenflux_inst%ffix_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) free living N fixation to soil mineral N - fert_to_sminn => soilbiogeochem_nitrogenflux_inst%fert_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) - soyfixn_to_sminn => soilbiogeochem_nitrogenflux_inst%soyfixn_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) - supplement_to_sminn => soilbiogeochem_nitrogenflux_inst%supplement_to_sminn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) supplemental N supply - denit => soilbiogeochem_nitrogenflux_inst%denit_col , & ! Input: [real(r8) (:) ] (gN/m2/s) total rate of denitrification - sminn_leached => soilbiogeochem_nitrogenflux_inst%sminn_leached_col , & ! Input: [real(r8) (:) ] (gN/m2/s) soil mineral N pool loss to leaching - smin_no3_leached => soilbiogeochem_nitrogenflux_inst%smin_no3_leached_col , & ! Input: [real(r8) (:) ] (gN/m2/s) soil mineral NO3 pool loss to leaching - smin_no3_runoff => soilbiogeochem_nitrogenflux_inst%smin_no3_runoff_col , & ! Input: [real(r8) (:) ] (gN/m2/s) soil mineral NO3 pool loss to runoff - f_n2o_nit => soilbiogeochem_nitrogenflux_inst%f_n2o_nit_col , & ! Input: [real(r8) (:) ] (gN/m2/s) flux of N2o from nitrification - som_n_leached => soilbiogeochem_nitrogenflux_inst%som_n_leached_col , & ! Input: [real(r8) (:) ] (gN/m2/s) total SOM N loss from vertical transport - - col_fire_nloss => cnveg_nitrogenflux_inst%fire_nloss_col , & ! Input: [real(r8) (:) ] (gN/m2/s) total column-level fire N loss - wood_harvestn => cnveg_nitrogenflux_inst%wood_harvestn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) wood harvest (to product pools) - grainn_to_cropprodn => cnveg_nitrogenflux_inst%grainn_to_cropprodn_col , & ! Input: [real(r8) (:) ] (gN/m2/s) grain N to 1-year crop product pool - - totcoln => cnveg_nitrogenstate_inst%totn_col & ! Input: [real(r8) (:) ] (gN/m2) total column nitrogen, incl veg - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - err_found = .false. - do fc = 1,num_soilc - c=filter_soilc(fc) - - ! calculate the total column-level nitrogen storage, for mass conservation check - col_endnb(c) = totcoln(c) - - ! calculate total column-level inputs - col_ninputs(c) = ndep_to_sminn(c) + nfix_to_sminn(c) + supplement_to_sminn(c) - - if(use_fun)then - col_ninputs(c) = col_ninputs(c) + ffix_to_sminn(c) ! for FUN, free living fixation is a seprate flux. RF. - endif - - if (use_crop) then - col_ninputs(c) = col_ninputs(c) + fert_to_sminn(c) + soyfixn_to_sminn(c) - end if - - ! calculate total column-level outputs - col_noutputs(c) = denit(c) + col_fire_nloss(c) - - ! Fluxes to product pools are included in column-level outputs: the product - ! pools are not included in totcoln, so are outside the system with respect to - ! these balance checks. (However, the dwt flux to product pools is NOT included, - ! since col_begnb is initialized after the dynamic area adjustments - i.e., - ! after the dwt term has already been taken out.) - col_noutputs(c) = col_noutputs(c) + & - wood_harvestn(c) + & - grainn_to_cropprodn(c) - - if (.not. use_nitrif_denitrif) then - col_noutputs(c) = col_noutputs(c) + sminn_leached(c) - else - col_noutputs(c) = col_noutputs(c) + f_n2o_nit(c) - - col_noutputs(c) = col_noutputs(c) + smin_no3_leached(c) + smin_no3_runoff(c) - end if - - col_noutputs(c) = col_noutputs(c) - som_n_leached(c) - - ! calculate the total column-level nitrogen balance error for this time step - col_errnb(c) = (col_ninputs(c) - col_noutputs(c))*dt - & - (col_endnb(c) - col_begnb(c)) - - if (abs(col_errnb(c)) > 1e-3_r8) then - err_found = .true. - err_index = c - end if - - if (abs(col_errnb(c)) > 1e-7_r8) then - write(iulog,*) 'nbalance warning',c,col_errnb(c),col_endnb(c) - write(iulog,*)'inputs,ffix,nfix,ndep = ',ffix_to_sminn(c)*dt,nfix_to_sminn(c)*dt,ndep_to_sminn(c)*dt - write(iulog,*)'outputs,lch,roff,dnit = ',smin_no3_leached(c)*dt, smin_no3_runoff(c)*dt,f_n2o_nit(c)*dt - end if - - end do ! end of columns loop - - if (err_found) then - c = err_index - write(iulog,*)'column nbalance error = ',col_errnb(c), c - write(iulog,*)'Latdeg,Londeg = ',grc%latdeg(col%gridcell(c)),grc%londeg(col%gridcell(c)) - write(iulog,*)'begnb = ',col_begnb(c) - write(iulog,*)'endnb = ',col_endnb(c) - write(iulog,*)'delta store = ',col_endnb(c)-col_begnb(c) - write(iulog,*)'input mass = ',col_ninputs(c)*dt - write(iulog,*)'output mass = ',col_noutputs(c)*dt - write(iulog,*)'net flux = ',(col_ninputs(c)-col_noutputs(c))*dt - write(iulog,*)'inputs,ffix,nfix,ndep = ',ffix_to_sminn(c)*dt,nfix_to_sminn(c)*dt,ndep_to_sminn(c)*dt - write(iulog,*)'outputs,ffix,nfix,ndep = ',smin_no3_leached(c)*dt, smin_no3_runoff(c)*dt,f_n2o_nit(c)*dt - - - - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end associate - - end subroutine NBalanceCheck - -end module CNBalanceCheckMod diff --git a/src/biogeochem/CNC14DecayMod.F90 b/src/biogeochem/CNC14DecayMod.F90 deleted file mode 100644 index 4c05995385..0000000000 --- a/src/biogeochem/CNC14DecayMod.F90 +++ /dev/null @@ -1,159 +0,0 @@ -module CNC14DecayMod - - !----------------------------------------------------------------------- - ! Module for 14-carbon flux variable update, non-mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size, get_days_per_year - use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, ndecomp_pools - use clm_varcon , only : secspday - use clm_varctl , only : spinup_state - use decompMod , only : bounds_type - use pftconMod , only : npcropmin - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use PatchType , only : patch - use ColumnType , only : col - use GridcellType , only : grc - use SoilBiogeochemStateType , only : get_spinup_latitude_term - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: C14Decay - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine C14Decay( bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, calculate the radioactive decay of C14 - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(CNVeg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,j,g,l,p,fc,c,i - real(r8) :: dt ! radiation time step (seconds) - real(r8) :: half_life - real(r8) :: decay_const - real(r8) :: days_per_year ! days per year - real(r8) :: spinup_term ! spinup accelerated decomposition factor, used to accelerate transport as well - !----------------------------------------------------------------------- - - associate( & - spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool - - decomp_cpools_vr => c14_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - - cropseedc_deficit => c14_cnveg_carbonstate_inst%cropseedc_deficit_patch , & ! Output: [real(r8) (:) ] - seedc => c14_cnveg_carbonstate_inst%seedc_grc , & ! Output: [real(r8) (:) ] - cpool => c14_cnveg_carbonstate_inst%cpool_patch , & ! Output: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool - xsmrpool => c14_cnveg_carbonstate_inst%xsmrpool_patch , & ! Output: [real(r8) (:) ] (gC/m2) execss maint resp C pool - deadcrootc => c14_cnveg_carbonstate_inst%deadcrootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => c14_cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => c14_cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - deadstemc => c14_cnveg_carbonstate_inst%deadstemc_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C - deadstemc_storage => c14_cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C storage - deadstemc_xfer => c14_cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C transfer - frootc => c14_cnveg_carbonstate_inst%frootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => c14_cnveg_carbonstate_inst%frootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => c14_cnveg_carbonstate_inst%frootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C transfer - gresp_storage => c14_cnveg_carbonstate_inst%gresp_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration storage - gresp_xfer => c14_cnveg_carbonstate_inst%gresp_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration transfer - leafc => c14_cnveg_carbonstate_inst%leafc_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => c14_cnveg_carbonstate_inst%leafc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => c14_cnveg_carbonstate_inst%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer - livecrootc => c14_cnveg_carbonstate_inst%livecrootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => c14_cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => c14_cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer - livestemc => c14_cnveg_carbonstate_inst%livestemc_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C - livestemc_storage => c14_cnveg_carbonstate_inst%livestemc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C storage - livestemc_xfer => c14_cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C transfer - pft_ctrunc => c14_cnveg_carbonstate_inst%ctrunc_patch & ! Output: [real(r8) (:) ] (gC/m2) patch-level sink for C truncation - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - days_per_year = get_days_per_year() - - half_life = 5730._r8 * secspday * days_per_year - decay_const = - log(0.5_r8) / half_life - - do g = bounds%begg, bounds%endg - seedc(g) = seedc(g) * (1._r8 - decay_const * dt) - end do - - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if ( spinup_state >= 1) then - ! speed up radioactive decay by the same factor as decomposition so tat SOM ages prematurely in all respects - spinup_term = spinup_factor(l) - if ( abs(spinup_factor(l) - 1._r8) .gt. .000001_r8 ) then - spinup_term = spinup_term * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - endif - else - spinup_term = 1. - endif - decomp_cpools_vr(c,j,l) = decomp_cpools_vr(c,j,l) * (1._r8 - decay_const * spinup_term * dt) - end do - end do - end do ! end of columns loop - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - cpool(p) = cpool(p) * (1._r8 - decay_const * dt) - xsmrpool(p) = xsmrpool(p) * (1._r8 - decay_const * dt) - deadcrootc(p) = deadcrootc(p) * (1._r8 - decay_const * dt) - deadcrootc_storage(p) = deadcrootc_storage(p) * (1._r8 - decay_const * dt) - deadcrootc_xfer(p) = deadcrootc_xfer(p) * (1._r8 - decay_const * dt) - deadstemc(p) = deadstemc(p) * (1._r8 - decay_const * dt) - deadstemc_storage(p) = deadstemc_storage(p) * (1._r8 - decay_const * dt) - deadstemc_xfer(p) = deadstemc_xfer(p) * (1._r8 - decay_const * dt) - frootc(p) = frootc(p) * (1._r8 - decay_const * dt) - frootc_storage(p) = frootc_storage(p) * (1._r8 - decay_const * dt) - frootc_xfer(p) = frootc_xfer(p) * (1._r8 - decay_const * dt) - gresp_storage(p) = gresp_storage(p) * (1._r8 - decay_const * dt) - gresp_xfer(p) = gresp_xfer(p) * (1._r8 - decay_const * dt) - leafc(p) = leafc(p) * (1._r8 - decay_const * dt) - leafc_storage(p) = leafc_storage(p) * (1._r8 - decay_const * dt) - leafc_xfer(p) = leafc_xfer(p) * (1._r8 - decay_const * dt) - livecrootc(p) = livecrootc(p) * (1._r8 - decay_const * dt) - livecrootc_storage(p) = livecrootc_storage(p) * (1._r8 - decay_const * dt) - livecrootc_xfer(p) = livecrootc_xfer(p) * (1._r8 - decay_const * dt) - livestemc(p) = livestemc(p) * (1._r8 - decay_const * dt) - livestemc_storage(p) = livestemc_storage(p) * (1._r8 - decay_const * dt) - livestemc_xfer(p) = livestemc_xfer(p) * (1._r8 - decay_const * dt) - pft_ctrunc(p) = pft_ctrunc(p) * (1._r8 - decay_const * dt) - - ! NOTE(wjs, 2017-02-02) This isn't a completely robust way to check if this is a - ! prognostic crop patch (at the very least it should also check if <= npcropmax; - ! ideally it should use a prognostic_crop flag that doesn't seem to exist - ! currently). But I'm just being consistent with what's done elsewhere (e.g., in - ! CStateUpdate1). - if (patch%itype(p) >= npcropmin) then ! skip 2 generic crops - cropseedc_deficit(p) = cropseedc_deficit(p) * (1._r8 - decay_const * dt) - end if - end do - - end associate - - end subroutine C14Decay - -end module CNC14DecayMod diff --git a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 deleted file mode 100644 index 5e15c98d3b..0000000000 --- a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 +++ /dev/null @@ -1,319 +0,0 @@ -module CIsoAtmTimeseriesMod - - !----------------------------------------------------------------------- - ! Module for transient atmospheric boundary to the c13 and c14 codes - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager , only : get_curr_date,get_days_per_year, get_curr_yearfrac - use clm_varcon , only : c14ratio, secspday - use shr_const_mod , only : SHR_CONST_PDB ! Ratio of C13/C12 - use clm_varctl , only : iulog - use abortutils , only : endrun - use spmdMod , only : masterproc - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: C14BombSpike ! Time series for C14 data - public:: C14_init_BombSpike ! Initialize C14 data series and read data in - public:: C13Timeseries ! Time series for C13 data - public:: C13_init_Timeseries ! Initialize C13 data series and read data in - - ! !PUBLIC TYPES: - logical , public :: use_c14_bombspike = .false. ! do we use time-varying atmospheric C14? - character(len=256) , public :: atm_c14_filename = ' ' ! file name of C14 input data - logical , public :: use_c13_timeseries = .false. ! do we use time-varying atmospheric C13? - character(len=256) , public :: atm_c13_filename = ' ' ! file name of C13 input data - integer, parameter , public :: nsectors_c14 = 3 ! Number of latitude sectors the C14 data has - - ! - ! !PRIVATE MEMBER FUNCTIONS: - private:: check_units ! Check the units of the data on the input file - - ! !PRIVATE TYPES: - real(r8), allocatable, private :: atm_c14file_time(:) ! time for C14 data - real(r8), allocatable, private :: atm_delta_c14(:,:) ! Delta C14 data - real(r8), allocatable, private :: atm_c13file_time(:) ! time for C13 data - real(r8), allocatable, private :: atm_delta_c13(:) ! Delta C13 data - real(r8), parameter :: time_axis_offset = 1850.0_r8 ! Offset in years of time on file - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine C14BombSpike( rc14_atm ) - ! - ! !DESCRIPTION: - ! for transient simulation, read in an atmospheric timeseries file to impose bomb spike - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(out) :: rc14_atm(nsectors_c14) ! Ratio of C14 to C12 - ! - ! !LOCAL VARIABLES: - integer :: yr, mon, day, tod ! year, month, day, time-of-day - real(r8) :: dateyear ! Date converted to year - real(r8) :: delc14o2_atm(nsectors_c14) ! C14 delta units - integer :: fp, p, nt ! Indices - integer :: ind_below ! Time index below current time - integer :: ntim_atm_ts ! Number of times on file - real(r8) :: twt_1, twt_2 ! weighting fractions for interpolating - integer :: l ! Loop index of sectors - !----------------------------------------------------------------------- - - ! get current date - call get_curr_date(yr, mon, day, tod) - dateyear = real(yr) + get_curr_yearfrac() - - ! find points in atm timeseries to interpolate between - ntim_atm_ts = size(atm_c14file_time) - ind_below = 0 - do nt = 1, ntim_atm_ts - if ((dateyear - time_axis_offset) >= atm_c14file_time(nt) ) then - ind_below = ind_below+1 - endif - end do - - ! loop over lat bands to pass all three to photosynthesis - do l = 1,nsectors_c14 - ! interpolate between nearest two points in atm c14 timeseries - if (ind_below .eq. 0 ) then - delc14o2_atm(l) = atm_delta_c14(l,1) - elseif (ind_below .eq. ntim_atm_ts ) then - delc14o2_atm(l) = atm_delta_c14(l,ntim_atm_ts) - else - twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c14file_time(ind_below)) & - / (atm_c14file_time(ind_below+1)-atm_c14file_time(ind_below)))) - twt_1 = 1._r8 - twt_2 - delc14o2_atm(l) = atm_delta_c14(l,ind_below) * twt_1 + atm_delta_c14(l,ind_below+1) * twt_2 - endif - - ! change delta units to ratio - rc14_atm(l) = (delc14o2_atm(l) * 1.e-3_r8 + 1._r8) * c14ratio - end do - - end subroutine C14BombSpike - - !----------------------------------------------------------------------- - subroutine C14_init_BombSpike() - ! - ! !DESCRIPTION: - ! read netcdf file containing a timeseries of atmospheric delta C14 values; save in module-level array - ! - ! !USES: - use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, file_desc_t, ncd_inqdlen, ncd_io - use fileutils , only : getfil - ! - ! !LOCAL VARIABLES: - implicit none - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: nsec ! number of input data sectors - integer :: t ! time index - logical :: readvar ! if variable read or not - character(len=*), parameter :: vname = 'Delta14co2_in_air' ! Variable name on file - !----------------------------------------------------------------------- - - if ( masterproc ) then - write(iulog, *) 'C14_init_BombSpike: preparing to open file:' - write(iulog, *) trim(locfn) - endif - - call getfil(atm_c14_filename, locfn, 0) - - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call ncd_inqdlen(ncid,dimid,ntim,'time') - call ncd_inqdlen(ncid,dimid,nsec,'sector') - if ( nsec /= nsectors_c14 )then - call endrun(msg="ERROR: number of sectors on file not what's expected"//errMsg(sourcefile, __LINE__)) - end if - - !! allocate arrays based on size of netcdf timeseries - allocate(atm_c14file_time(ntim)) - allocate(atm_delta_c14(nsectors_c14,ntim)) - atm_delta_c14(:,:) = 0.0_r8 - - call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c14file_time, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c14, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) - end if - ! Check units - call check_units( ncid, vname, "Modern" ) - call ncd_pio_closefile(ncid) - - ! check to make sure that time dimension is well behaved - do t = 2, ntim - if ( atm_c14file_time(t) - atm_c14file_time(t-1) <= 0._r8 ) then - write(iulog, *) 'C14_init_BombSpike: error. time axis must be monotonically increasing' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end do - - end subroutine C14_init_BombSpike - - - !----------------------------------------------------------------------- - subroutine C13TimeSeries( rc13_atm ) - ! - ! !DESCRIPTION: - ! for transient pulse simulation, impose a time-varying atm boundary condition - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(out) :: rc13_atm ! Ratio of C13 to C12 - ! - ! !LOCAL VARIABLES: - integer :: yr, mon, day, tod ! year, month, day, time-of-day - real(r8) :: dateyear ! date translated to year - real(r8) :: delc13o2_atm ! Delta C13 - integer :: fp, p, nt ! Indices - integer :: ind_below ! Index of time in file before current time - integer :: ntim_atm_ts ! Number of times on file - real(r8) :: twt_1, twt_2 ! weighting fractions for interpolating - !----------------------------------------------------------------------- - - ! get current date - call get_curr_date(yr, mon, day, tod) - dateyear = real(yr) + get_curr_yearfrac() - - ! find points in atm timeseries to interpolate between - ntim_atm_ts = size(atm_c13file_time) - ind_below = 0 - do nt = 1, ntim_atm_ts - if ((dateyear - time_axis_offset) >= atm_c13file_time(nt) ) then - ind_below = ind_below+1 - endif - end do - - ! interpolate between nearest two points in atm c13 timeseries - ! cdknotes. for now and for simplicity, just use the northern hemisphere values (sector 1) - if (ind_below .eq. 0 ) then - delc13o2_atm = atm_delta_c13(1) - elseif (ind_below .eq. ntim_atm_ts ) then - delc13o2_atm = atm_delta_c13(ntim_atm_ts) - else - twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c13file_time(ind_below)) & - / (atm_c13file_time(ind_below+1)-atm_c13file_time(ind_below)))) - twt_1 = 1._r8 - twt_2 - delc13o2_atm = atm_delta_c13(ind_below) * twt_1 + atm_delta_c13(ind_below+1) * twt_2 - endif - - ! change delta units to ratio, put on patch loop - - rc13_atm = (delc13o2_atm * 1.e-3_r8 + 1._r8) * SHR_CONST_PDB - - end subroutine C13TimeSeries - - !----------------------------------------------------------------------- - subroutine C13_init_TimeSeries() - ! - ! !DESCRIPTION: - ! read netcdf file containing a timeseries of atmospheric delta C13 values; save in module-level array - ! - ! !USES: - use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, file_desc_t, ncd_inqdlen, ncd_io - use fileutils , only : getfil - ! - ! !LOCAL VARIABLES: - implicit none - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: t ! Time index - logical :: readvar ! if variable read or not - character(len=*), parameter :: vname = 'delta13co2_in_air' ! Variable name on file - !----------------------------------------------------------------------- - - if ( masterproc ) then - write(iulog, *) 'C13_init_TimeSeries: preparing to open file:' - write(iulog, *) trim(locfn) - endif - - call getfil(atm_c13_filename, locfn, 0) - - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call ncd_inqdlen(ncid,dimid,ntim,'time') - - !! allocate arrays based on size of netcdf timeseries - allocate(atm_c13file_time(ntim)) - allocate(atm_delta_c13(ntim)) - - call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c13file_time, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c13, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) - end if - - ! Check units - call check_units( ncid, vname, "VPDB" ) - call ncd_pio_closefile(ncid) - - ! check to make sure that time dimension is well behaved - do t = 2, ntim - if ( atm_c13file_time(t) - atm_c13file_time(t-1) <= 0._r8 ) then - write(iulog, *) 'C13_init_TimeSeries: error. time axis must be monotonically increasing' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end do - - end subroutine C13_init_TimeSeries - - !----------------------------------------------------------------------- - subroutine check_units( ncid, vname, relativeto ) - ! - ! !DESCRIPTION: - ! check that time and data units are what's expected or else abort - ! - ! !USES: - use ncdio_pio, only : file_desc_t, ncd_inqvid, ncd_getatt, var_desc_t - ! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*), intent(in) :: vname ! Variable name - character(len=*), intent(in) :: relativeto ! What are data units relative to - ! - ! !LOCAL VARIABLES: - type(var_desc_t) :: vardesc ! variable descriptor - integer :: varid ! variable index - character(len=50) :: units ! Data units - character(len=50) :: t_units_expected ! Time units to expect - - call ncd_inqvid( ncid, 'time', varid, vardesc ) - call ncd_getatt( ncid, varid, "units", units ) - write(t_units_expected,'("years since", I5, "-01-01 0:0:0.0")' ) nint(time_axis_offset) - if ( trim(units) /= t_units_expected )then - call endrun(msg="ERROR: time units on file are NOT what's expected"//errMsg(sourcefile, __LINE__)) - end if - call ncd_inqvid( ncid, vname, varid, vardesc ) - call ncd_getatt( ncid, varid, "units", units ) - if ( trim(units) /= "per mil, relative to "//relativeto )then - call endrun(msg="ERROR: units on file for "//vname//" are NOT what's expected"//errMsg(sourcefile, __LINE__)) - end if - end subroutine check_units - - -end module CIsoAtmTimeseriesMod diff --git a/src/biogeochem/CNCIsoFluxMod.F90 b/src/biogeochem/CNCIsoFluxMod.F90 deleted file mode 100644 index a92ab44e47..0000000000 --- a/src/biogeochem/CNCIsoFluxMod.F90 +++ /dev/null @@ -1,1606 +0,0 @@ -module CNCIsoFluxMod - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for carbon isotopic flux variable update, non-mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, ndecomp_pools - use clm_varpar , only : max_patch_per_col, maxpatch_pft - use abortutils , only : endrun - use pftconMod , only : pftcon - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use ColumnType , only : col - use PatchType , only : patch - use clm_varctl , only : use_crop - use clm_varctl , only : use_grainproduct - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CIsoFlux1 - public :: CIsoFlux2 - public :: CIsoFlux2h - public :: CIsoFlux3 - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: CNCIsoLitterToColumn - private :: CNCIsoGapPftToColumn - private :: CNCIsoHarvestPftToColumn - private :: CIsoFluxCalc - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_soilbiogeochem_carbonflux_inst, iso_soilbiogeochem_carbonstate_inst, & - iso_cnveg_carbonflux_inst, iso_cnveg_carbonstate_inst, & - isotope) - ! - ! !DESCRIPTION: - ! On the radiation time step, set the carbon isotopic flux - ! variables (except for gap-phase mortality and fire fluxes) - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: soilbiogeochem_carbonstate_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: iso_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: iso_soilbiogeochem_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: iso_cnveg_carbonstate_inst - character(len=*) , intent(in) :: isotope ! 'c13' or 'c14' - ! - ! !LOCAL VARIABLES: - integer :: fp,pi,l,fc,cc,j,p - integer :: cdp - !----------------------------------------------------------------------- - - associate( & - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & - soilbiogeochem_cs => soilbiogeochem_carbonstate_inst , & - soilbiogeochem_cf => soilbiogeochem_carbonflux_inst , & - cnveg_cf => cnveg_carbonflux_inst , & - cnveg_cs => cnveg_carbonstate_inst , & - iso_cnveg_cf => iso_cnveg_carbonflux_inst , & - iso_cnveg_cs => iso_cnveg_carbonstate_inst , & - iso_soilbiogeochem_cs => iso_soilbiogeochem_carbonstate_inst , & - iso_soilbiogeochem_cf => iso_soilbiogeochem_carbonflux_inst & - ) - - ! patch-level non-mortality fluxes - - ! Note: if the variables which are arguments to CIsoFluxCalc are ever changed to NOT be - ! pointers, then the CIsoFluxCalc routine will need to be changed to declare the bounds - ! of each argument, these bounds will need to be passed in, and - importantly for - ! threading to work properly - the subroutine calls will need to be changed so that - ! instead of 'call CIsoFluxCalc(foo, ...)' we have 'call CIsoFluxCalc(foo(begp:endp), ...)'. - - call CIsoFluxCalc(& - iso_cnveg_cf%leafc_xfer_to_leafc_patch , cnveg_cf%leafc_xfer_to_leafc_patch, & - iso_cnveg_cs%leafc_xfer_patch , cnveg_cs%leafc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%frootc_xfer_to_frootc_patch , cnveg_cf%frootc_xfer_to_frootc_patch, & - iso_cnveg_cs%frootc_xfer_patch , cnveg_cs%frootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestemc_xfer_to_livestemc_patch , cnveg_cf%livestemc_xfer_to_livestemc_patch, & - iso_cnveg_cs%livestemc_xfer_patch , cnveg_cs%livestemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%deadstemc_xfer_to_deadstemc_patch , cnveg_cf%deadstemc_xfer_to_deadstemc_patch, & - iso_cnveg_cs%deadstemc_xfer_patch , cnveg_cs%deadstemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livecrootc_xfer_to_livecrootc_patch , cnveg_cf%livecrootc_xfer_to_livecrootc_patch, & - iso_cnveg_cs%livecrootc_xfer_patch , cnveg_cs%livecrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%deadcrootc_xfer_to_deadcrootc_patch , cnveg_cf%deadcrootc_xfer_to_deadcrootc_patch, & - iso_cnveg_cs%deadcrootc_xfer_patch , cnveg_cs%deadcrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%leafc_to_litter_patch , cnveg_cf%leafc_to_litter_patch, & - iso_cnveg_cs%leafc_patch , cnveg_cs%leafc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%frootc_to_litter_patch , cnveg_cf%frootc_to_litter_patch, & - iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestemc_to_deadstemc_patch , cnveg_cf%livestemc_to_deadstemc_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livecrootc_to_deadcrootc_patch , cnveg_cf%livecrootc_to_deadcrootc_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%leaf_curmr_patch , cnveg_cf%leaf_curmr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%froot_curmr_patch , cnveg_cf%froot_curmr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestem_curmr_patch , cnveg_cf%livestem_curmr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livecroot_curmr_patch , cnveg_cf%livecroot_curmr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%leaf_xsmr_patch , cnveg_cf%leaf_xsmr_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%froot_xsmr_patch , cnveg_cf%froot_xsmr_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestem_xsmr_patch , cnveg_cf%livestem_xsmr_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livecroot_xsmr_patch , cnveg_cf%livecroot_xsmr_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_xsmrpool_patch , cnveg_cf%cpool_to_xsmrpool_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_leafc_patch , cnveg_cf%cpool_to_leafc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_leafc_storage_patch , cnveg_cf%cpool_to_leafc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_frootc_patch , cnveg_cf%cpool_to_frootc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_frootc_storage_patch , cnveg_cf%cpool_to_frootc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_livestemc_patch , cnveg_cf%cpool_to_livestemc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_livestemc_storage_patch , cnveg_cf%cpool_to_livestemc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_deadstemc_patch , cnveg_cf%cpool_to_deadstemc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_deadstemc_storage_patch , cnveg_cf%cpool_to_deadstemc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_livecrootc_patch , cnveg_cf%cpool_to_livecrootc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_livecrootc_storage_patch , cnveg_cf%cpool_to_livecrootc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_deadcrootc_patch , cnveg_cf%cpool_to_deadcrootc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_deadcrootc_storage_patch , cnveg_cf%cpool_to_deadcrootc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_leaf_gr_patch , cnveg_cf%cpool_leaf_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_froot_gr_patch , cnveg_cf%cpool_froot_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_livestem_gr_patch , cnveg_cf%cpool_livestem_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_deadstem_gr_patch , cnveg_cf%cpool_deadstem_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_livecroot_gr_patch , cnveg_cf%cpool_livecroot_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_deadcroot_gr_patch , cnveg_cf%cpool_deadcroot_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_leaf_storage_gr_patch , cnveg_cf%cpool_leaf_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_froot_storage_gr_patch , cnveg_cf%cpool_froot_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_livestem_storage_gr_patch , cnveg_cf%cpool_livestem_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_deadstem_storage_gr_patch , cnveg_cf%cpool_deadstem_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_livecroot_storage_gr_patch , cnveg_cf%cpool_livecroot_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_deadcroot_storage_gr_patch , cnveg_cf%cpool_deadcroot_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_gresp_storage_patch , cnveg_cf%cpool_to_gresp_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_leaf_gr_patch , cnveg_cf%transfer_leaf_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_froot_gr_patch , cnveg_cf%transfer_froot_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_livestem_gr_patch , cnveg_cf%transfer_livestem_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_deadstem_gr_patch , cnveg_cf%transfer_deadstem_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_livecroot_gr_patch , cnveg_cf%transfer_livecroot_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_deadcroot_gr_patch , cnveg_cf%transfer_deadcroot_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%leafc_storage_to_xfer_patch , cnveg_cf%leafc_storage_to_xfer_patch, & - iso_cnveg_cs%leafc_storage_patch , cnveg_cs%leafc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%frootc_storage_to_xfer_patch , cnveg_cf%frootc_storage_to_xfer_patch, & - iso_cnveg_cs%frootc_storage_patch , cnveg_cs%frootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestemc_storage_to_xfer_patch , cnveg_cf%livestemc_storage_to_xfer_patch, & - iso_cnveg_cs%livestemc_storage_patch , cnveg_cs%livestemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%deadstemc_storage_to_xfer_patch , cnveg_cf%deadstemc_storage_to_xfer_patch, & - iso_cnveg_cs%deadstemc_storage_patch , cnveg_cs%deadstemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livecrootc_storage_to_xfer_patch , cnveg_cf%livecrootc_storage_to_xfer_patch, & - iso_cnveg_cs%livecrootc_storage_patch , cnveg_cs%livecrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%deadcrootc_storage_to_xfer_patch , cnveg_cf%deadcrootc_storage_to_xfer_patch, & - iso_cnveg_cs%deadcrootc_storage_patch , cnveg_cs%deadcrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%gresp_storage_to_xfer_patch , cnveg_cf%gresp_storage_to_xfer_patch, & - iso_cnveg_cs%gresp_storage_patch , cnveg_cs%gresp_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%soilc_change_patch , cnveg_cf%soilc_change_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - ! Note that cpool_to_resp_patch is a diagnostic flux and therefore this Iso flux calculation - ! not strictly required. - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_resp_patch , cnveg_cf%cpool_to_resp_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - if ( use_crop )then - call CIsoFluxCalc(& - iso_cnveg_cf%grainc_xfer_to_grainc_patch , cnveg_cf%grainc_xfer_to_grainc_patch, & - iso_cnveg_cs%grainc_xfer_patch , cnveg_cs%grainc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%grainc_to_food_patch , cnveg_cf%grainc_to_food_patch, & - iso_cnveg_cs%grainc_patch , cnveg_cs%grainc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%grainc_to_seed_patch , cnveg_cf%grainc_to_seed_patch, & - iso_cnveg_cs%grainc_patch , cnveg_cs%grainc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%crop_seedc_to_leaf_patch , cnveg_cf%crop_seedc_to_leaf_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%grain_curmr_patch , cnveg_cf%grain_curmr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%grain_xsmr_patch , cnveg_cf%grain_xsmr_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_grain_gr_patch , cnveg_cf%cpool_grain_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_grainc_patch , cnveg_cf%cpool_to_grainc_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_to_grainc_storage_patch , cnveg_cf%cpool_to_grainc_storage_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%transfer_grain_gr_patch , cnveg_cf%transfer_grain_gr_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%cpool_grain_storage_gr_patch , cnveg_cf%cpool_grain_storage_gr_patch, & - iso_cnveg_cs%cpool_patch , cnveg_cs%cpool_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%grainc_storage_to_xfer_patch , cnveg_cf%grainc_storage_to_xfer_patch, & - iso_cnveg_cs%grainc_storage_patch , cnveg_cs%grainc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%livestemc_to_litter_patch , cnveg_cf%livestemc_to_litter_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - if (use_grainproduct) then - do fp = 1,num_soilp - p = filter_soilp(fp) - iso_cnveg_cf%grainc_to_cropprodc_patch(p) = iso_cnveg_cf%grainc_to_food_patch(p) - iso_cnveg_cf%grain_mr_patch(p) = iso_cnveg_cf%grain_xsmr_patch(p) + iso_cnveg_cf%grain_curmr_patch(p) - end do - endif - end if - - ! call routine to shift patch-level litterfall fluxes to column, for isotopes - ! the non-isotope version of this routine is called in CNPhenologyMod.F90 - ! For later clean-up, it would be possible to generalize this function to operate on a single - ! patch-to-column flux. - - call CNCIsoLitterToColumn(num_soilc, filter_soilc, soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - - ! column-level non-mortality fluxes - - do fc = 1,num_soilc - cc = filter_soilc(fc) - do j = 1, nlevdecomp - do l = 1, ndecomp_cascade_transitions - cdp = cascade_donor_pool(l) - if ( soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp) /= 0._r8) then - iso_soilbiogeochem_cf%decomp_cascade_hr_vr_col(cc,j,l) = & - soilbiogeochem_cf%decomp_cascade_hr_vr_col(cc,j,l) * & - (iso_soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp) & - / soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp)) * 1._r8 - else - iso_soilbiogeochem_cf%decomp_cascade_hr_vr_col(cc,j,l) = 0._r8 - end if - end do - end do - end do - - do fc = 1,num_soilc - cc = filter_soilc(fc) - do j = 1, nlevdecomp - do l = 1, ndecomp_cascade_transitions - cdp = cascade_donor_pool(l) - if ( soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp) /= 0._r8) then - iso_soilbiogeochem_cf%decomp_cascade_ctransfer_vr_col(cc,j,l) = & - soilbiogeochem_cf%decomp_cascade_ctransfer_vr_col(cc,j,l) * & - (iso_soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp) & - / soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,cdp)) * 1._r8 - else - iso_soilbiogeochem_cf%decomp_cascade_ctransfer_vr_col(cc,j,l) = 0._r8 - end if - end do - end do - end do - - end associate - - end subroutine CIsoFlux1 - - !----------------------------------------------------------------------- - subroutine CIsoFlux2(num_soilc, filter_soilc, num_soilp , filter_soilp, & - soilbiogeochem_state_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_cnveg_carbonflux_inst, iso_cnveg_carbonstate_inst, isotope) - ! - ! !DESCRIPTION: - ! On the radiation time step, set the carbon isotopic fluxes for gap mortality - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: iso_cnveg_carbonstate_inst - character(len=*) , intent(in) :: isotope ! 'c13' or 'c14' - - ! - ! !LOCAL VARIABLES: - integer :: fp,pi - !----------------------------------------------------------------------- - - associate( & - cnveg_cf => cnveg_carbonflux_inst , & - cnveg_cs => cnveg_carbonstate_inst , & - iso_cnveg_cf => iso_cnveg_carbonflux_inst , & - iso_cnveg_cs => iso_cnveg_carbonstate_inst & - ) - - ! patch-level gap mortality fluxes - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_to_litter_patch , cnveg_cf%m_leafc_to_litter_patch, & - iso_cnveg_cs%leafc_patch , cnveg_cs%leafc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_storage_to_litter_patch , cnveg_cf%m_leafc_storage_to_litter_patch, & - iso_cnveg_cs%leafc_storage_patch , cnveg_cs%leafc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_xfer_to_litter_patch , cnveg_cf%m_leafc_xfer_to_litter_patch, & - iso_cnveg_cs%leafc_xfer_patch , cnveg_cs%leafc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_to_litter_patch , cnveg_cf%m_frootc_to_litter_patch, & - iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_storage_to_litter_patch , cnveg_cf%m_frootc_storage_to_litter_patch, & - iso_cnveg_cs%frootc_storage_patch , cnveg_cs%frootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_xfer_to_litter_patch , cnveg_cf%m_frootc_xfer_to_litter_patch, & - iso_cnveg_cs%frootc_xfer_patch , cnveg_cs%frootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_to_litter_patch , cnveg_cf%m_livestemc_to_litter_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_storage_to_litter_patch , cnveg_cf%m_livestemc_storage_to_litter_patch, & - iso_cnveg_cs%livestemc_storage_patch , cnveg_cs%livestemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_xfer_to_litter_patch , cnveg_cf%m_livestemc_xfer_to_litter_patch, & - iso_cnveg_cs%livestemc_xfer_patch , cnveg_cs%livestemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_to_litter_patch , cnveg_cf%m_deadstemc_to_litter_patch, & - iso_cnveg_cs%deadstemc_patch , cnveg_cs%deadstemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_storage_to_litter_patch , cnveg_cf%m_deadstemc_storage_to_litter_patch, & - iso_cnveg_cs%deadstemc_storage_patch , cnveg_cs%deadstemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_xfer_to_litter_patch , cnveg_cf%m_deadstemc_xfer_to_litter_patch, & - iso_cnveg_cs%deadstemc_xfer_patch , cnveg_cs%deadstemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_to_litter_patch , cnveg_cf%m_livecrootc_to_litter_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_storage_to_litter_patch , cnveg_cf%m_livecrootc_storage_to_litter_patch, & - iso_cnveg_cs%livecrootc_storage_patch , cnveg_cs%livecrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_xfer_to_litter_patch , cnveg_cf%m_livecrootc_xfer_to_litter_patch, & - iso_cnveg_cs%livecrootc_xfer_patch , cnveg_cs%livecrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_to_litter_patch , cnveg_cf%m_deadcrootc_to_litter_patch, & - iso_cnveg_cs%deadcrootc_patch , cnveg_cs%deadcrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_storage_to_litter_patch , cnveg_cf%m_deadcrootc_storage_to_litter_patch, & - iso_cnveg_cs%deadcrootc_storage_patch , cnveg_cs%deadcrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_xfer_to_litter_patch , cnveg_cf%m_deadcrootc_xfer_to_litter_patch, & - iso_cnveg_cs%deadcrootc_xfer_patch , cnveg_cs%deadcrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_storage_to_litter_patch , cnveg_cf%m_gresp_storage_to_litter_patch, & - iso_cnveg_cs%gresp_storage_patch , cnveg_cs%gresp_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_xfer_to_litter_patch , cnveg_cf%m_gresp_xfer_to_litter_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - ! call routine to shift patch-level gap mortality fluxes to column , for isotopes - ! the non-isotope version of this routine is in CNGapMortalityMod.F90. - - call CNCIsoGapPftToColumn(num_soilc, filter_soilc, soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - - end associate - - end subroutine CIsoFlux2 - - !----------------------------------------------------------------------- - subroutine CIsoFlux2h(num_soilc , filter_soilc, num_soilp , filter_soilp, & - soilbiogeochem_state_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_cnveg_carbonflux_inst, iso_cnveg_carbonstate_inst, isotope) - ! - ! !DESCRIPTION: - ! set the carbon isotopic fluxes for harvest mortality - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: iso_cnveg_carbonstate_inst - character(len=*) , intent(in) :: isotope ! 'c13' or 'c14' - - !----------------------------------------------------------------------- - - associate( & - cnveg_cf => cnveg_carbonflux_inst , & - cnveg_cs => cnveg_carbonstate_inst , & - iso_cnveg_cf => iso_cnveg_carbonflux_inst , & - iso_cnveg_cs => iso_cnveg_carbonstate_inst & - ) - - ! patch-level gap mortality fluxes - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_leafc_to_litter_patch , cnveg_cf%hrv_leafc_to_litter_patch, & - iso_cnveg_cs%leafc_patch , cnveg_cs%leafc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_leafc_storage_to_litter_patch , cnveg_cf%hrv_leafc_storage_to_litter_patch, & - iso_cnveg_cs%leafc_storage_patch , cnveg_cs%leafc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_leafc_xfer_to_litter_patch , cnveg_cf%hrv_leafc_xfer_to_litter_patch, & - iso_cnveg_cs%leafc_xfer_patch , cnveg_cs%leafc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_frootc_to_litter_patch , cnveg_cf%hrv_frootc_to_litter_patch, & - iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_frootc_storage_to_litter_patch , cnveg_cf%hrv_frootc_storage_to_litter_patch, & - iso_cnveg_cs%frootc_storage_patch , cnveg_cs%frootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_frootc_xfer_to_litter_patch , cnveg_cf%hrv_frootc_xfer_to_litter_patch, & - iso_cnveg_cs%frootc_xfer_patch , cnveg_cs%frootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livestemc_to_litter_patch , cnveg_cf%hrv_livestemc_to_litter_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livestemc_storage_to_litter_patch , cnveg_cf%hrv_livestemc_storage_to_litter_patch, & - iso_cnveg_cs%livestemc_storage_patch , cnveg_cs%livestemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livestemc_xfer_to_litter_patch , cnveg_cf%hrv_livestemc_xfer_to_litter_patch, & - iso_cnveg_cs%livestemc_xfer_patch , cnveg_cs%livestemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%wood_harvestc_patch , cnveg_cf%wood_harvestc_patch, & - iso_cnveg_cs%deadstemc_patch , cnveg_cs%deadstemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_deadstemc_storage_to_litter_patch , cnveg_cf%hrv_deadstemc_storage_to_litter_patch, & - iso_cnveg_cs%deadstemc_storage_patch , cnveg_cs%deadstemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_deadstemc_xfer_to_litter_patch , cnveg_cf%hrv_deadstemc_xfer_to_litter_patch, & - iso_cnveg_cs%deadstemc_xfer_patch , cnveg_cs%deadstemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livecrootc_to_litter_patch , cnveg_cf%hrv_livecrootc_to_litter_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livecrootc_storage_to_litter_patch , cnveg_cf%hrv_livecrootc_storage_to_litter_patch, & - iso_cnveg_cs%livecrootc_storage_patch , cnveg_cs%livecrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_livecrootc_xfer_to_litter_patch , cnveg_cf%hrv_livecrootc_xfer_to_litter_patch, & - iso_cnveg_cs%livecrootc_xfer_patch , cnveg_cs%livecrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_deadcrootc_to_litter_patch , cnveg_cf%hrv_deadcrootc_to_litter_patch, & - iso_cnveg_cs%deadcrootc_patch , cnveg_cs%deadcrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_deadcrootc_storage_to_litter_patch , cnveg_cf%hrv_deadcrootc_storage_to_litter_patch, & - iso_cnveg_cs%deadcrootc_storage_patch , cnveg_cs%deadcrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_deadcrootc_xfer_to_litter_patch , cnveg_cf%hrv_deadcrootc_xfer_to_litter_patch, & - iso_cnveg_cs%deadcrootc_xfer_patch , cnveg_cs%deadcrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_gresp_storage_to_litter_patch , cnveg_cf%hrv_gresp_storage_to_litter_patch, & - iso_cnveg_cs%gresp_storage_patch , cnveg_cs%gresp_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_gresp_xfer_to_litter_patch , cnveg_cf%hrv_gresp_xfer_to_litter_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%hrv_xsmrpool_to_atm_patch , cnveg_cf%hrv_xsmrpool_to_atm_patch, & - iso_cnveg_cs%totvegc_patch , cnveg_cs%totvegc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - ! call routine to shift patch-level gap mortality fluxes to column, - ! for isotopes the non-isotope version of this routine is in CNGapMortalityMod.F90. - - call CNCIsoHarvestPftToColumn(num_soilc, filter_soilc, soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - - end associate - - end subroutine CIsoFlux2h - - !----------------------------------------------------------------------- - subroutine CIsoFlux3(num_soilc , filter_soilc, num_soilp , filter_soilp, & - soilbiogeochem_state_inst , soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_cnveg_carbonflux_inst, iso_cnveg_carbonstate_inst, & - iso_soilbiogeochem_carbonstate_inst, isotope) - ! - ! !DESCRIPTION: - ! On the radiation time step, set the carbon isotopic fluxes for fire mortality - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: soilbiogeochem_carbonstate_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(in) :: iso_cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: iso_soilbiogeochem_carbonstate_inst - character(len=*) , intent(in) :: isotope ! 'c13' or 'c14' - ! - ! !LOCAL VARIABLES: - integer :: pi,pp,l,fc,cc,j - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) for this patch (0-1) - croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => soilbiogeochem_state_inst%stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - soilbiogeochem_cs => soilbiogeochem_carbonstate_inst , & - cnveg_cf => cnveg_carbonflux_inst , & - cnveg_cs => cnveg_carbonstate_inst , & - iso_cnveg_cf => iso_cnveg_carbonflux_inst , & - iso_cnveg_cs => iso_cnveg_carbonstate_inst , & - iso_soilbiogeochem_cs => iso_soilbiogeochem_carbonstate_inst , & - lf_flab => pftcon%lf_flab , & ! Input: [real(r8) (:) ] leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: [real(r8) (:) ] leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: [real(r8) (:) ] leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: [real(r8) (:) ] fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: [real(r8) (:) ] fine root litter cellulose fraction - fr_flig => pftcon%fr_flig & ! Input: [real(r8) (:) ] fine root litter lignin fraction - ) - - ! patch-level fire mortality fluxes - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_to_fire_patch , cnveg_cf%m_leafc_to_fire_patch, & - iso_cnveg_cs%leafc_patch , cnveg_cs%leafc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_storage_to_fire_patch , cnveg_cf%m_leafc_storage_to_fire_patch, & - iso_cnveg_cs%leafc_storage_patch , cnveg_cs%leafc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_xfer_to_fire_patch , cnveg_cf%m_leafc_xfer_to_fire_patch, & - iso_cnveg_cs%leafc_xfer_patch , cnveg_cs%leafc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_to_fire_patch , cnveg_cf%m_frootc_to_fire_patch, & - iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_storage_to_fire_patch , cnveg_cf%m_frootc_storage_to_fire_patch, & - iso_cnveg_cs%frootc_storage_patch , cnveg_cs%frootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_xfer_to_fire_patch , cnveg_cf%m_frootc_xfer_to_fire_patch, & - iso_cnveg_cs%frootc_xfer_patch , cnveg_cs%frootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_to_fire_patch , cnveg_cf%m_livestemc_to_fire_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_storage_to_fire_patch , cnveg_cf%m_livestemc_storage_to_fire_patch, & - iso_cnveg_cs%livestemc_storage_patch , cnveg_cs%livestemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_xfer_to_fire_patch , cnveg_cf%m_livestemc_xfer_to_fire_patch, & - iso_cnveg_cs%livestemc_xfer_patch , cnveg_cs%livestemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_to_fire_patch , cnveg_cf%m_deadstemc_to_fire_patch, & - iso_cnveg_cs%deadstemc_patch , cnveg_cs%deadstemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_to_litter_fire_patch , cnveg_cf%m_deadstemc_to_litter_fire_patch, & - iso_cnveg_cs%deadstemc_patch , cnveg_cs%deadstemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_storage_to_fire_patch , cnveg_cf%m_deadstemc_storage_to_fire_patch, & - iso_cnveg_cs%deadstemc_storage_patch , cnveg_cs%deadstemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_xfer_to_fire_patch , cnveg_cf%m_deadstemc_xfer_to_fire_patch, & - iso_cnveg_cs%deadstemc_xfer_patch , cnveg_cs%deadstemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_to_fire_patch , cnveg_cf%m_livecrootc_to_fire_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_storage_to_fire_patch , cnveg_cf%m_livecrootc_storage_to_fire_patch, & - iso_cnveg_cs%livecrootc_storage_patch , cnveg_cs%livecrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_xfer_to_fire_patch , cnveg_cf%m_livecrootc_xfer_to_fire_patch, & - iso_cnveg_cs%livecrootc_xfer_patch , cnveg_cs%livecrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_to_fire_patch , cnveg_cf%m_deadcrootc_to_fire_patch, & - iso_cnveg_cs%deadcrootc_patch , cnveg_cs%deadcrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_to_litter_fire_patch , cnveg_cf%m_deadcrootc_to_litter_fire_patch, & - iso_cnveg_cs%deadcrootc_patch , cnveg_cs%deadcrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_storage_to_fire_patch , cnveg_cf%m_deadcrootc_storage_to_fire_patch, & - iso_cnveg_cs%deadcrootc_storage_patch , cnveg_cs%deadcrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_xfer_to_fire_patch , cnveg_cf%m_deadcrootc_xfer_to_fire_patch, & - iso_cnveg_cs%deadcrootc_xfer_patch , cnveg_cs%deadcrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_storage_to_fire_patch , cnveg_cf%m_gresp_storage_to_fire_patch, & - iso_cnveg_cs%gresp_storage_patch , cnveg_cs%gresp_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_xfer_to_fire_patch , cnveg_cf%m_gresp_xfer_to_fire_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_to_litter_fire_patch , cnveg_cf%m_leafc_to_litter_fire_patch, & - iso_cnveg_cs%leafc_patch , cnveg_cs%leafc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_storage_to_litter_fire_patch, cnveg_cf%m_leafc_storage_to_litter_fire_patch, & - iso_cnveg_cs%leafc_storage_patch , cnveg_cs%leafc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_leafc_xfer_to_litter_fire_patch , cnveg_cf%m_leafc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%leafc_xfer_patch , cnveg_cs%leafc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_to_litter_fire_patch , cnveg_cf%m_livestemc_to_litter_fire_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_storage_to_litter_fire_patch, cnveg_cf%m_livestemc_storage_to_litter_fire_patch, & - iso_cnveg_cs%livestemc_storage_patch , cnveg_cs%livestemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_xfer_to_litter_fire_patch, cnveg_cf%m_livestemc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%livestemc_xfer_patch , cnveg_cs%livestemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livestemc_to_deadstemc_fire_patch, cnveg_cf%m_livestemc_to_deadstemc_fire_patch, & - iso_cnveg_cs%livestemc_patch , cnveg_cs%livestemc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_storage_to_litter_fire_patch, cnveg_cf%m_deadstemc_storage_to_litter_fire_patch, & - iso_cnveg_cs%deadstemc_storage_patch , cnveg_cs%deadstemc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadstemc_xfer_to_litter_fire_patch, cnveg_cf%m_deadstemc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%deadstemc_xfer_patch , cnveg_cs%deadstemc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_to_litter_fire_patch , cnveg_cf%m_frootc_to_litter_fire_patch, & - iso_cnveg_cs%frootc_patch , cnveg_cs%frootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_storage_to_litter_fire_patch, cnveg_cf%m_frootc_storage_to_litter_fire_patch, & - iso_cnveg_cs%frootc_storage_patch , cnveg_cs%frootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_frootc_xfer_to_litter_fire_patch , cnveg_cf%m_frootc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%frootc_xfer_patch , cnveg_cs%frootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_to_litter_fire_patch , cnveg_cf%m_livecrootc_to_litter_fire_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_storage_to_litter_fire_patch, cnveg_cf%m_livecrootc_storage_to_litter_fire_patch, & - iso_cnveg_cs%livecrootc_storage_patch , cnveg_cs%livecrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_xfer_to_litter_fire_patch, cnveg_cf%m_livecrootc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%livecrootc_xfer_patch , cnveg_cs%livecrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_livecrootc_to_deadcrootc_fire_patch, cnveg_cf%m_livecrootc_to_deadcrootc_fire_patch, & - iso_cnveg_cs%livecrootc_patch , cnveg_cs%livecrootc_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_storage_to_litter_fire_patch, cnveg_cf%m_deadcrootc_storage_to_litter_fire_patch, & - iso_cnveg_cs%deadcrootc_storage_patch , cnveg_cs%deadcrootc_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_deadcrootc_xfer_to_litter_fire_patch, cnveg_cf%m_deadcrootc_xfer_to_litter_fire_patch, & - iso_cnveg_cs%deadcrootc_xfer_patch , cnveg_cs%deadcrootc_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_storage_to_litter_fire_patch, cnveg_cf%m_gresp_storage_to_litter_fire_patch, & - iso_cnveg_cs%gresp_storage_patch , cnveg_cs%gresp_storage_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - call CIsoFluxCalc(& - iso_cnveg_cf%m_gresp_xfer_to_litter_fire_patch , cnveg_cf%m_gresp_xfer_to_litter_fire_patch, & - iso_cnveg_cs%gresp_xfer_patch , cnveg_cs%gresp_xfer_patch, & - num_soilp , filter_soilp, 1._r8, 0, isotope) - - - - ! calculate the column-level flux of deadstem and deadcrootc to cwdc as the result of fire mortality. - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - cc = filter_soilc(fc) - if ( pi <= col%npatches(cc) ) then - pp = col%patchi(cc) + pi - 1 - if (patch%active(pp)) then - do j = 1, nlevdecomp - iso_cnveg_cf%fire_mortality_c_to_cwdc_col(cc,j) = & - iso_cnveg_cf%fire_mortality_c_to_cwdc_col(cc,j) + & - (iso_cnveg_cf%m_deadstemc_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_livestemc_to_litter_fire_patch(pp)) * & - patch%wtcol(pp) * stem_prof(pp,j) - iso_cnveg_cf%fire_mortality_c_to_cwdc_col(cc,j) = & - iso_cnveg_cf%fire_mortality_c_to_cwdc_col(cc,j) + & - (iso_cnveg_cf%m_deadcrootc_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_livecrootc_to_litter_fire_patch(pp)) * & - patch%wtcol(pp) * croot_prof(pp,j) - end do - end if - end if - end do - end do - - - do fc = 1,num_soilc - cc = filter_soilc(fc) - do j = 1, nlevdecomp - do l = 1, ndecomp_pools - if ( soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,l) /= 0._r8) then - iso_cnveg_cf%m_decomp_cpools_to_fire_vr_col(cc,j,l) = & - cnveg_cf%m_decomp_cpools_to_fire_vr_col(cc,j,l) * & - (iso_soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,l) / & - soilbiogeochem_cs%decomp_cpools_vr_col(cc,j,l)) * 1._r8 - else - iso_cnveg_cf%m_decomp_cpools_to_fire_vr_col(cc,j,l) = 0._r8 - end if - end do - end do - end do - - - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - cc = filter_soilc(fc) - if ( pi <= col%npatches(cc) ) then - pp = col%patchi(cc) + pi - 1 - if (patch%active(pp)) then - do j = 1, nlevdecomp - iso_cnveg_cf%m_c_to_litr_met_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_met_fire_col(cc,j) + & - ((iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_flab(ivt(pp)) & - +iso_cnveg_cf%m_leafc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_leafc_xfer_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_gresp_storage_to_litter_fire_patch(pp) & - +iso_cnveg_cf%m_gresp_xfer_to_litter_fire_patch(pp))*leaf_prof(pp,j) + & - (iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_flab(ivt(pp)) & - +iso_cnveg_cf%m_frootc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_frootc_xfer_to_litter_fire_patch(pp))*froot_prof(pp,j) & - +(iso_cnveg_cf%m_livestemc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_livestemc_xfer_to_litter_fire_patch(pp) & - +iso_cnveg_cf%m_deadstemc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_deadstemc_xfer_to_litter_fire_patch(pp))* stem_prof(pp,j)& - +(iso_cnveg_cf%m_livecrootc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_livecrootc_xfer_to_litter_fire_patch(pp) & - +iso_cnveg_cf%m_deadcrootc_storage_to_litter_fire_patch(pp) + & - iso_cnveg_cf%m_deadcrootc_xfer_to_litter_fire_patch(pp))* croot_prof(pp,j)) * patch%wtcol(pp) - - iso_cnveg_cf%m_c_to_litr_cel_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_cel_fire_col(cc,j) + & - (iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_fcel(ivt(pp))*leaf_prof(pp,j) + & - iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_fcel(ivt(pp))*froot_prof(pp,j)) * patch%wtcol(pp) - - iso_cnveg_cf%m_c_to_litr_lig_fire_col(cc,j) = iso_cnveg_cf%m_c_to_litr_lig_fire_col(cc,j) + & - (iso_cnveg_cf%m_leafc_to_litter_fire_patch(pp)*lf_flig(ivt(pp))*leaf_prof(pp,j) + & - iso_cnveg_cf%m_frootc_to_litter_fire_patch(pp)*fr_flig(ivt(pp))*froot_prof(pp,j)) * patch%wtcol(pp) - end do - end if - end if - end do - end do - - end associate - - end subroutine CIsoFlux3 - - !----------------------------------------------------------------------- - subroutine CNCIsoLitterToColumn (num_soilc, filter_soilc, & - soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - ! - ! !DESCRIPTION: - ! called at the end of cn_phenology to gather all patch-level litterfall fluxes - ! to the column level and assign them to the three litter pools - ! - ! !USES: -!DML - use pftconMod , only : npcropmin - use clm_varctl , only : use_grainproduct -!DML - - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) for this patch (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction - - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - - leafc_to_litter => iso_cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Input: [real(r8) (:) ] - frootc_to_litter => iso_cnveg_carbonflux_inst%frootc_to_litter_patch , & ! Input: [real(r8) (:) ] -!DML - livestemc_to_litter => iso_cnveg_carbonflux_inst%livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] - grainc_to_food => iso_cnveg_carbonflux_inst%grainc_to_food_patch , & ! Input: [real(r8) (:) ] -!DML - phenology_c_to_litr_met_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s) - phenology_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s) - phenology_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%phenology_c_to_litr_lig_c_col & ! InOut: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s) - ) - - do j = 1, nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - - if ( pi <= col%npatches(c) ) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - ! leaf litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - -!DML - if (ivt(p) >= npcropmin) then ! add livestemc to litter - ! stem litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + livestemc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + livestemc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + livestemc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - if (.not. use_grainproduct) then - ! grain litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + grainc_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + grainc_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + grainc_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - end if - - end if -!DML - end if - end if - - end do - end do - - end do - - end associate - - end subroutine CNCIsoLitterToColumn - - !----------------------------------------------------------------------- - subroutine CNCIsoGapPftToColumn (num_soilc, filter_soilc, & - soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - ! - ! !DESCRIPTION: - ! gather all patch-level gap mortality fluxes - ! to the column level and assign them to the three litter pools (+ cwd pool) - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! soil column filter - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j ! indices - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction - - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => soilbiogeochem_state_inst%stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - - m_leafc_to_litter => iso_cnveg_carbonflux_inst%m_leafc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_to_litter => iso_cnveg_carbonflux_inst%m_frootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_to_litter => iso_cnveg_carbonflux_inst%m_livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_to_litter => iso_cnveg_carbonflux_inst%m_deadstemc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_to_litter => iso_cnveg_carbonflux_inst%m_livecrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_to_litter => iso_cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafc_storage_to_litter => iso_cnveg_carbonflux_inst%m_leafc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_storage_to_litter => iso_cnveg_carbonflux_inst%m_frootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_storage_to_litter => iso_cnveg_carbonflux_inst%m_livestemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_storage_to_litter => iso_cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_storage_to_litter => iso_cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_storage_to_litter => iso_cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_gresp_storage_to_litter => iso_cnveg_carbonflux_inst%m_gresp_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_leafc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_frootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_gresp_xfer_to_litter => iso_cnveg_carbonflux_inst%m_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - - gap_mortality_c_to_litr_met_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s) - gap_mortality_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s) - gap_mortality_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%gap_mortality_c_to_litr_lig_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter lignin pool (gC/m3/s) - gap_mortality_c_to_cwdc => iso_cnveg_carbonflux_inst%gap_mortality_c_to_cwdc_col & ! InOut: [real(r8) (:,:) ] C fluxes associated with gap mortality to CWD pool (gC/m3/s) - ) - - do j = 1, nlevdecomp - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - - ! leaf gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + & - m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + & - m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + & - m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + & - m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood gap mortality carbon fluxes - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - m_livestemc_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - m_deadstemc_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - m_livecrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - m_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - - ! storage gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! transfer gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - end if - end if - - end do - - end do - end do - - end associate - - end subroutine CNCIsoGapPftToColumn - - !----------------------------------------------------------------------- - subroutine CNCIsoHarvestPftToColumn (num_soilc, filter_soilc, & - soilbiogeochem_state_inst, iso_cnveg_carbonflux_inst) - ! - ! !DESCRIPTION: - ! gather all patch-level harvest mortality fluxes - ! to the column level and assign them to the litter, cwd, and wood product pools - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! soil column filter - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: iso_cnveg_carbonflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j ! indices - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction - - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => soilbiogeochem_state_inst%stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - - hrv_leafc_to_litter => iso_cnveg_carbonflux_inst%hrv_leafc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_to_litter => iso_cnveg_carbonflux_inst%hrv_frootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_to_litter => iso_cnveg_carbonflux_inst%hrv_livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] - pwood_harvestc => iso_cnveg_carbonflux_inst%wood_harvestc_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_to_litter => iso_cnveg_carbonflux_inst%hrv_livecrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_to_litter => iso_cnveg_carbonflux_inst%hrv_deadcrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_leafc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_frootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_livestemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_deadstemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_livecrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_deadcrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_gresp_storage_to_litter => iso_cnveg_carbonflux_inst%hrv_gresp_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_leafc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_frootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_livestemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_deadstemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_livecrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_gresp_xfer_to_litter => iso_cnveg_carbonflux_inst%hrv_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - cwood_harvestc => iso_cnveg_carbonflux_inst%wood_harvestc_col , & ! Output: [real(r8) (:) ] - harvest_c_to_litr_met_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter metabolic pool (gC/m3/s) - harvest_c_to_litr_cel_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter cellulose pool (gC/m3/s) - harvest_c_to_litr_lig_c => iso_cnveg_carbonflux_inst%harvest_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to litter lignin pool (gC/m3/s) - harvest_c_to_cwdc => iso_cnveg_carbonflux_inst%harvest_c_to_cwdc_col & ! Output: [real(r8) (:,:) ] C fluxes associated with harvest to CWD pool (gC/m3/s) - ) - - do j = 1, nlevdecomp - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - - ! leaf harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + & - hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + & - hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + & - hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + & - hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood harvest mortality carbon fluxes - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_livestemc_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_livecrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - - ! storage harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! transfer harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - end if - end if - - end do - - end do - end do - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - cwood_harvestc(c) = cwood_harvestc(c) + & - pwood_harvestc(p) * wtcol(p) - end if - end if - end do - end do - - end associate - - end subroutine CNCIsoHarvestPftToColumn - - !----------------------------------------------------------------------- - subroutine CIsoFluxCalc(& - ciso_flux, ctot_flux, & - ciso_state, ctot_state, & - num, filter, frax_c13, diag, isotope) - ! - ! !DESCRIPTION: - ! On the radiation time step, set the carbon isotopic flux - ! variables (except for gap-phase mortality and fire fluxes) - ! - ! !ARGUMENTS: - real(r8) , intent(inout), pointer :: ciso_flux(:) ! isoC flux - real(r8) , intent(in) , pointer :: ctot_flux(:) ! totC flux - real(r8) , intent(in) , pointer :: ciso_state(:) ! isoC state, upstream pool - real(r8) , intent(in) , pointer :: ctot_state(:) ! totC state, upstream pool - real(r8) , intent(in) :: frax_c13 ! fractionation factor (1 = no fractionation) for C13 - integer , intent(in) :: num ! number of filter members - integer , intent(in) :: filter(:) ! filter indices - integer , intent(in) :: diag ! 0=no diagnostics, 1=print diagnostics - character(len=*) , intent(in) :: isotope ! 'c13' or 'c14' - ! - ! ! LOCAL VARIABLES: - integer :: i,f ! indices - real(r8) :: temp - real(r8) :: frax - !----------------------------------------------------------------------- - - ! if C14, double the fractionation - select case (isotope) - case ('c14') - frax = 1._r8 + (1._r8 - frax_c13) * 2._r8 - case ('c13') - frax = frax_c13 - case default - call endrun(msg='CNCIsoFluxMod: iso must be either c13 or c14'//errMsg(sourcefile, __LINE__)) - end select - - ! loop over the supplied filter - do f = 1,num - i = filter(f) - if (ctot_state(i) /= 0._r8 .and. ciso_state(i) /= 0._r8) then - ciso_flux(i) = ctot_flux(i) * (ciso_state(i)/ctot_state(i)) * frax - else - ciso_flux(i) = 0._r8 - end if - - if (diag == 1) then - ! put diagnostic print statements here for isoC flux calculations - end if - end do - - end subroutine CIsoFluxCalc - -end module CNCIsoFluxMod diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 deleted file mode 100644 index ac7cb89162..0000000000 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ /dev/null @@ -1,497 +0,0 @@ -module CNCStateUpdate1Mod - - !----------------------------------------------------------------------- - ! Module for carbon state variable update, non-mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp - use clm_time_manager , only : get_step_size, get_step_size_real - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use pftconMod , only : npcropmin, nc3crop, pftcon - use abortutils , only : endrun - use decompMod , only : bounds_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CropType , only : crop_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use PatchType , only : patch - use clm_varctl , only : use_fates, use_cn, iulog - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CStateUpdateDynPatch - public :: CStateUpdate0 - public :: CStateUpdate1 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! Update carbon states based on fluxes from dyn_cnbal_patch - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_soilc_with_inactive ! number of columns in soil filter - integer, intent(in) :: filter_soilc_with_inactive(:) ! soil column filter that includes inactive points - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c ! column index - integer :: fc ! column filter index - integer :: g ! gridcell index - integer :: j ! level index - real(r8) :: dt ! time step (seconds) - - character(len=*), parameter :: subname = 'CStateUpdateDynPatch' - !----------------------------------------------------------------------- - - associate( & - cf_veg => cnveg_carbonflux_inst , & - cs_veg => cnveg_carbonstate_inst , & - cs_soil => soilbiogeochem_carbonstate_inst & - ) - - dt = get_step_size_real() - - if (.not. use_fates) then - do j = 1,nlevdecomp - do fc = 1, num_soilc_with_inactive - c = filter_soilc_with_inactive(fc) - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + & - cf_veg%dwt_frootc_to_litr_met_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + & - cf_veg%dwt_frootc_to_litr_cel_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + & - cf_veg%dwt_frootc_to_litr_lig_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + & - ( cf_veg%dwt_livecrootc_to_cwdc_col(c,j) + cf_veg%dwt_deadcrootc_to_cwdc_col(c,j) ) * dt - end do - end do - - do g = bounds%begg, bounds%endg - cs_veg%seedc_grc(g) = cs_veg%seedc_grc(g) - cf_veg%dwt_seedc_to_leaf_grc(g) * dt - cs_veg%seedc_grc(g) = cs_veg%seedc_grc(g) - cf_veg%dwt_seedc_to_deadstem_grc(g) * dt - end do - - end if - - ! TODO(wjs, 2017-01-02) Do we need to move some of the FATES fluxes into here (from - ! CStateUpdate1) if use_fates is true? Specifically, some portion or all of the fluxes - ! from these updates in CStateUpdate1: - ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = cf_soil%FATES_c_to_litr_lab_c_col(c,j) * dt - ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = cf_soil%FATES_c_to_litr_cel_c_col(c,j) * dt - ! cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = cf_soil%FATES_c_to_litr_lig_c_col(c,j) * dt - - end associate - - end subroutine CStateUpdateDynPatch - - !----------------------------------------------------------------------- - subroutine CStateUpdate0(num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update cpool carbon state - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - cf_veg => cnveg_carbonflux_inst , & - cs_veg => cnveg_carbonstate_inst & - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - - - ! gross photosynthesis fluxes - do fp = 1,num_soilp - p = filter_soilp(fp) - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) + cf_veg%psnsun_to_cpool_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) + cf_veg%psnshade_to_cpool_patch(p)*dt - end do - - - end associate - - end subroutine CStateUpdate0 - - !----------------------------------------------------------------------- - subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & - crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic carbon state - ! variables (except for gap-phase mortality and fire fluxes) - ! - use clm_varctl, only : carbon_resp_opt - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(crop_type) , intent(in) :: crop_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst ! See note below for xsmrpool_to_atm_patch - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l ! indices - integer :: fp,fc ! filter indices - real(r8) :: dt ! radiation time step (seconds) - real(r8) :: check_cpool - real(r8) :: cpool_delta - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step - - harvdate => crop_inst%harvdate_patch , & ! Input: [integer (:) ] harvest date - - cf_veg => cnveg_carbonflux_inst , & ! Output: - cs_veg => cnveg_carbonstate_inst , & ! Output: - cf_soil => soilbiogeochem_carbonflux_inst & ! Output: - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! Below is the input into the soil biogeochemistry model - - ! plant to litter fluxes - if (.not. use_fates) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! phenology and dynamic land cover fluxes - cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = & - cf_veg%phenology_c_to_litr_met_c_col(c,j) *dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = & - cf_veg%phenology_c_to_litr_cel_c_col(c,j) *dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = & - cf_veg%phenology_c_to_litr_lig_c_col(c,j) *dt - - ! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the - ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every - ! time step, but to be safe, I'm explicitly setting it to zero here. - cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 - end do - end do - else !use_fates - ! here add all fates litterfall and CWD breakdown to litter fluxes - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! TODO(wjs, 2017-01-02) Should some portion or all of the following fluxes - ! be moved to the updates in CStateUpdateDynPatch? - cf_soil%decomp_cpools_sourcesink_col(c,j,i_met_lit) = cf_soil%FATES_c_to_litr_lab_c_col(c,j) * dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_cel_lit) = cf_soil%FATES_c_to_litr_cel_c_col(c,j) * dt - cf_soil%decomp_cpools_sourcesink_col(c,j,i_lig_lit) = cf_soil%FATES_c_to_litr_lig_c_col(c,j) * dt - end do - end do - endif - - ! litter and SOM HR fluxes - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & - - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) *dt - end do - end do - end do - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & - + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)*dt - end do - end do - end if - end do - - if (.not. use_fates) then - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! phenology: transfer growth fluxes - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%leafc_xfer_to_leafc_patch(p)*dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) - cf_veg%leafc_xfer_to_leafc_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%frootc_xfer_to_frootc_patch(p)*dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) - cf_veg%frootc_xfer_to_frootc_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) - cf_veg%deadstemc_xfer_to_deadstemc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) - cf_veg%livecrootc_xfer_to_livecrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) - cf_veg%deadcrootc_xfer_to_deadcrootc_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - cf_veg%livestemc_xfer_to_livestemc_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%grainc_xfer_to_grainc_patch(p)*dt - cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) - cf_veg%grainc_xfer_to_grainc_patch(p)*dt - end if - - ! phenology: litterfall fluxes - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - cf_veg%leafc_to_litter_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - cf_veg%frootc_to_litter_patch(p)*dt - - - - - ! livewood turnover fluxes - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%livestemc_to_deadstemc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) - cf_veg%livecrootc_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%livecrootc_to_deadcrootc_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_litter_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) & - - (cf_veg%grainc_to_food_patch(p) + cf_veg%grainc_to_seed_patch(p))*dt - cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & - - cf_veg%crop_seedc_to_leaf_patch(p) * dt & - + cf_veg%grainc_to_seed_patch(p) * dt - end if - - check_cpool = cs_veg%cpool_patch(p)- cf_veg%psnsun_to_cpool_patch(p)*dt-cf_veg%psnshade_to_cpool_patch(p)*dt - cpool_delta = cs_veg%cpool_patch(p) - - ! maintenance respiration fluxes from cpool - - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%leaf_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%froot_curmr_patch(p)*dt - If (woody(ivt(p)) == 1._r8) then - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livecroot_curmr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%grain_curmr_patch(p)*dt - end if - - - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_resp_patch(p)*dt - - !RF Add in the carbon spent on uptake respiration. - cs_veg%cpool_patch(p)= cs_veg%cpool_patch(p) - cf_veg%soilc_change_patch(p)*dt - - ! maintenance respiration fluxes from xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) + cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%leaf_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%froot_xsmr_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livecroot_xsmr_patch(p)*dt - end if - - ! allocation fluxes - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_leafc_patch(p) = cf_veg%cpool_to_leafc_patch(p) - cf_veg%cpool_to_leafc_resp_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p) = cf_veg%cpool_to_leafc_storage_patch(p) - & - cf_veg%cpool_to_leafc_storage_resp_patch(p) - cf_veg%cpool_to_frootc_patch(p) = cf_veg%cpool_to_frootc_patch(p) - cf_veg%cpool_to_frootc_resp_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p) = cf_veg%cpool_to_frootc_storage_patch(p) & - - cf_veg%cpool_to_frootc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_patch(p)*dt - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%cpool_to_leafc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p)*dt - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) + cf_veg%cpool_to_leafc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_patch(p)*dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%cpool_to_frootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p)*dt - - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) + cf_veg%cpool_to_frootc_storage_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_livecrootc_patch(p) = cf_veg%cpool_to_livecrootc_patch(p) - cf_veg%cpool_to_livecrootc_resp_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p) = cf_veg%cpool_to_livecrootc_storage_patch(p) - & - cf_veg%cpool_to_livecrootc_storage_resp_patch(p) - cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & - cf_veg%cpool_to_livestemc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_patch(p)*dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%cpool_to_deadstemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadstemc_storage_patch(p)*dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) + cf_veg%cpool_to_deadstemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_patch(p)*dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) + cf_veg%cpool_to_livecrootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p)*dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) + cf_veg%cpool_to_livecrootc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_patch(p)*dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%cpool_to_deadcrootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) + cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - if (carbon_resp_opt == 1) then - cf_veg%cpool_to_livestemc_patch(p) = cf_veg%cpool_to_livestemc_patch(p) - cf_veg%cpool_to_livestemc_resp_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p) = cf_veg%cpool_to_livestemc_storage_patch(p) - & - cf_veg%cpool_to_livestemc_storage_resp_patch(p) - end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_patch(p)*dt - cs_veg%grainc_patch(p) = cs_veg%grainc_patch(p) + cf_veg%cpool_to_grainc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_grainc_storage_patch(p)*dt - cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) + cf_veg%cpool_to_grainc_storage_patch(p)*dt - end if - - ! growth respiration fluxes for current growth - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_gr_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadstem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livecroot_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadcroot_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_gr_patch(p)*dt - end if - - ! growth respiration for transfer growth - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_leaf_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_froot_gr_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadstem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livecroot_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_deadcroot_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_livestem_gr_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - cf_veg%transfer_grain_gr_patch(p)*dt - end if - - ! growth respiration at time of storage - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_leaf_storage_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_froot_storage_gr_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_storage_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadstem_storage_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livecroot_storage_gr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_deadcroot_storage_gr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_livestem_storage_gr_patch(p)*dt - - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_grain_storage_gr_patch(p)*dt - - end if - - ! growth respiration stored for release during transfer growth - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_gresp_storage_patch(p)*dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) + cf_veg%cpool_to_gresp_storage_patch(p)*dt - - ! move storage pools into transfer pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) + cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - cf_veg%frootc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) + cf_veg%frootc_storage_to_xfer_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) - cf_veg%deadstemc_storage_to_xfer_patch(p)*dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) + cf_veg%deadstemc_storage_to_xfer_patch(p)*dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p)- cf_veg%livecrootc_storage_to_xfer_patch(p)*dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) + cf_veg%livecrootc_storage_to_xfer_patch(p)*dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p)- cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) + cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - cf_veg%gresp_storage_to_xfer_patch(p)*dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) + cf_veg%gresp_storage_to_xfer_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt - cs_veg%grainc_storage_patch(p) = cs_veg%grainc_storage_patch(p) - cf_veg%grainc_storage_to_xfer_patch(p)*dt - cs_veg%grainc_xfer_patch(p) = cs_veg%grainc_xfer_patch(p) + cf_veg%grainc_storage_to_xfer_patch(p)*dt - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%grain_xsmr_patch(p)*dt - if (harvdate(p) < 999) then ! beginning at harvest, send to atm - ! TODO (mv, 11-02-2014) the following lines are why the cf_veg is - ! an intent(inout) - ! fluxes should not be updated in this module - not sure where - ! this belongs - ! DML (06-20-2017) While debugging crop isotope code, found that cpool_patch and frootc_patch - ! could occasionally be very small but nonzero numbers after crop harvest, which persists - ! through to next planting and for reasons that could not 100% - ! isolate, caused C12/C13 ratios to occasionally go out of - ! bounds. Zeroing out these small pools and putting them into the flux to the - ! atmosphere solved many of the crop isotope problems - - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt - cs_veg%xsmrpool_patch(p) = 0._r8 - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt - cs_veg%cpool_patch(p) = 0._r8 - cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt - cs_veg%frootc_patch(p) = 0._r8 - end if - end if - - - end do ! end of patch loop - end if - - end associate - - end subroutine CStateUpdate1 - -end module CNCStateUpdate1Mod diff --git a/src/biogeochem/CNCStateUpdate2Mod.F90 b/src/biogeochem/CNCStateUpdate2Mod.F90 deleted file mode 100644 index ef1f6f9345..0000000000 --- a/src/biogeochem/CNCStateUpdate2Mod.F90 +++ /dev/null @@ -1,247 +0,0 @@ -module CNCStateUpdate2Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for carbon state variable update, mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevdecomp, i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use CNvegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use SoilBiogeochemCarbonStatetype , only : soilbiogeochem_carbonstate_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: CStateUpdate2 - public:: CStateUpdate2h - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic carbon state - ! variables affected by gap-phase mortality fluxes - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c ,p,j ! indices - integer :: fp,fc ! lake filter indices - real(r8) :: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - cf_veg => cnveg_carbonflux_inst , & - cs_veg => cnveg_carbonstate_inst , & - - cs_soil => soilbiogeochem_carbonstate_inst & - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column level carbon fluxes from gap-phase mortality - do j = 1,nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column gap mortality fluxes - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + cf_veg%gap_mortality_c_to_litr_met_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + cf_veg%gap_mortality_c_to_litr_cel_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%gap_mortality_c_to_litr_lig_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = & - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%gap_mortality_c_to_cwdc_col(c,j) * dt - - end do - end do - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! patch-level carbon fluxes from gap-phase mortality - ! displayed pools - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) & - - cf_veg%m_leafc_to_litter_patch(p) * dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) & - - cf_veg%m_frootc_to_litter_patch(p) * dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) & - - cf_veg%m_livestemc_to_litter_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & - - cf_veg%m_deadstemc_to_litter_patch(p) * dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) & - - cf_veg%m_livecrootc_to_litter_patch(p) * dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) & - - cf_veg%m_deadcrootc_to_litter_patch(p) * dt - - ! storage pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) & - - cf_veg%m_leafc_storage_to_litter_patch(p) * dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) & - - cf_veg%m_frootc_storage_to_litter_patch(p) * dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) & - - cf_veg%m_livestemc_storage_to_litter_patch(p) * dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) & - - cf_veg%m_deadstemc_storage_to_litter_patch(p) * dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) & - - cf_veg%m_livecrootc_storage_to_litter_patch(p) * dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) & - - cf_veg%m_deadcrootc_storage_to_litter_patch(p) * dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & - - cf_veg%m_gresp_storage_to_litter_patch(p) * dt - - ! transfer pools - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) & - - cf_veg%m_leafc_xfer_to_litter_patch(p) * dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) & - - cf_veg%m_frootc_xfer_to_litter_patch(p) * dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) & - - cf_veg%m_livestemc_xfer_to_litter_patch(p) * dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) & - - cf_veg%m_deadstemc_xfer_to_litter_patch(p) * dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) & - - cf_veg%m_livecrootc_xfer_to_litter_patch(p) * dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) & - - cf_veg%m_deadcrootc_xfer_to_litter_patch(p) * dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & - - cf_veg%m_gresp_xfer_to_litter_patch(p) * dt - end do ! end of patch loop - - end associate - - end subroutine CStateUpdate2 - - !----------------------------------------------------------------------- - subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! Update all the prognostic carbon state - ! variables affected by harvest mortality fluxes - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - cf_veg => cnveg_carbonflux_inst , & - cs_veg => cnveg_carbonstate_inst , & - cs_soil => soilbiogeochem_carbonstate_inst & - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column level carbon fluxes from harvest mortality - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column harvest fluxes - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + cf_veg%harvest_c_to_litr_met_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + cf_veg%harvest_c_to_litr_cel_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = & - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + cf_veg%harvest_c_to_litr_lig_c_col(c,j) * dt - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = & - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%harvest_c_to_cwdc_col(c,j) * dt - - ! wood to product pools - states updated in CNProducts - end do - end do - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! patch-level carbon fluxes from harvest mortality - ! displayed pools - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) & - - cf_veg%hrv_leafc_to_litter_patch(p) * dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) & - - cf_veg%hrv_frootc_to_litter_patch(p) * dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) & - - cf_veg%hrv_livestemc_to_litter_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & - - cf_veg%wood_harvestc_patch(p) * dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) & - - cf_veg%hrv_livecrootc_to_litter_patch(p) * dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) & - - cf_veg%hrv_deadcrootc_to_litter_patch(p) * dt - - ! xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) & - - cf_veg%hrv_xsmrpool_to_atm_patch(p) * dt - - ! storage pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) & - - cf_veg%hrv_leafc_storage_to_litter_patch(p) * dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) & - - cf_veg%hrv_frootc_storage_to_litter_patch(p) * dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) & - - cf_veg%hrv_livestemc_storage_to_litter_patch(p) * dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) & - - cf_veg%hrv_deadstemc_storage_to_litter_patch(p) * dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) & - - cf_veg%hrv_livecrootc_storage_to_litter_patch(p) * dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) & - - cf_veg%hrv_deadcrootc_storage_to_litter_patch(p) * dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & - - cf_veg%hrv_gresp_storage_to_litter_patch(p) * dt - - ! transfer pools - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) & - - cf_veg%hrv_leafc_xfer_to_litter_patch(p) * dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) & - - cf_veg%hrv_frootc_xfer_to_litter_patch(p) * dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) & - - cf_veg%hrv_livestemc_xfer_to_litter_patch(p) * dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) & - - cf_veg%hrv_deadstemc_xfer_to_litter_patch(p) * dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) & - - cf_veg%hrv_livecrootc_xfer_to_litter_patch(p) * dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) & - - cf_veg%hrv_deadcrootc_xfer_to_litter_patch(p) * dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & - - cf_veg%hrv_gresp_xfer_to_litter_patch(p) * dt - - end do ! end of patch loop - - end associate - - end subroutine CStateUpdate2h - -end module CNCStateUpdate2Mod diff --git a/src/biogeochem/CNCStateUpdate3Mod.F90 b/src/biogeochem/CNCStateUpdate3Mod.F90 deleted file mode 100644 index 422c56f75e..0000000000 --- a/src/biogeochem/CNCStateUpdate3Mod.F90 +++ /dev/null @@ -1,187 +0,0 @@ -module CNCStateUpdate3Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for carbon state variable update, mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevdecomp, ndecomp_pools, i_cwd, i_met_lit, i_cel_lit, i_lig_lit - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: CStateUpdate3 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic carbon state - ! variables affected by fire fluxes - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l,k ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - cf_veg => cnveg_carbonflux_inst , & ! Input - cs_veg => cnveg_carbonstate_inst, & ! Output - cs_soil => soilbiogeochem_carbonstate_inst & ! Output - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column level carbon fluxes from fire - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! patch-level wood to column-level CWD (uncombusted wood) - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + & - cf_veg%fire_mortality_c_to_cwdc_col(c,j) * dt - - ! patch-level wood to column-level litter (uncombusted wood) - cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_met_lit) + & - cf_veg%m_c_to_litr_met_fire_col(c,j)* dt - cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_cel_lit) + & - cf_veg%m_c_to_litr_cel_fire_col(c,j)* dt - cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) = cs_soil%decomp_cpools_vr_col(c,j,i_lig_lit) + & - cf_veg%m_c_to_litr_lig_fire_col(c,j)* dt - end do - end do - - ! litter and CWD losses to fire - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - cs_soil%decomp_cpools_vr_col(c,j,l) = cs_soil%decomp_cpools_vr_col(c,j,l) - & - cf_veg%m_decomp_cpools_to_fire_vr_col(c,j,l) * dt - end do - end do - end do - - ! patch-level carbon fluxes from fire - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! displayed pools - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - & - cf_veg%m_leafc_to_fire_patch(p) * dt - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - & - cf_veg%m_leafc_to_litter_fire_patch(p) * dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - & - cf_veg%m_frootc_to_fire_patch(p) * dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - & - cf_veg%m_frootc_to_litter_fire_patch(p) * dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - & - cf_veg%m_livestemc_to_fire_patch(p) * dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - & - cf_veg%m_livestemc_to_litter_fire_patch(p) * dt - & - cf_veg%m_livestemc_to_deadstemc_fire_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) - & - cf_veg%m_deadstemc_to_fire_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) - & - cf_veg%m_deadstemc_to_litter_fire_patch(p) * dt + & - cf_veg%m_livestemc_to_deadstemc_fire_patch(p) * dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) - & - cf_veg%m_livecrootc_to_fire_patch(p) * dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) - & - cf_veg%m_livecrootc_to_litter_fire_patch(p) * dt - & - cf_veg%m_livecrootc_to_deadcrootc_fire_patch(p) * dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) - & - cf_veg%m_deadcrootc_to_fire_patch(p) * dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) - & - cf_veg%m_deadcrootc_to_litter_fire_patch(p)* dt + & - cf_veg%m_livecrootc_to_deadcrootc_fire_patch(p) * dt - - ! storage pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - & - cf_veg%m_leafc_storage_to_fire_patch(p) * dt - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - & - cf_veg%m_leafc_storage_to_litter_fire_patch(p) * dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - & - cf_veg%m_frootc_storage_to_fire_patch(p) * dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - & - cf_veg%m_frootc_storage_to_litter_fire_patch(p) * dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - & - cf_veg%m_livestemc_storage_to_fire_patch(p) * dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - & - cf_veg%m_livestemc_storage_to_litter_fire_patch(p) * dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) - & - cf_veg%m_deadstemc_storage_to_fire_patch(p) * dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) - & - cf_veg%m_deadstemc_storage_to_litter_fire_patch(p) * dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) - & - cf_veg%m_livecrootc_storage_to_fire_patch(p) * dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) - & - cf_veg%m_livecrootc_storage_to_litter_fire_patch(p)* dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) - & - cf_veg%m_deadcrootc_storage_to_fire_patch(p) * dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) - & - cf_veg%m_deadcrootc_storage_to_litter_fire_patch(p)* dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - & - cf_veg%m_gresp_storage_to_fire_patch(p) * dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - & - cf_veg%m_gresp_storage_to_litter_fire_patch(p) * dt - - ! transfer pools - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) - & - cf_veg%m_leafc_xfer_to_fire_patch(p) * dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) - & - cf_veg%m_leafc_xfer_to_litter_fire_patch(p) * dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) - & - cf_veg%m_frootc_xfer_to_fire_patch(p) * dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) - & - cf_veg%m_frootc_xfer_to_litter_fire_patch(p) * dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - & - cf_veg%m_livestemc_xfer_to_fire_patch(p) * dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) - & - cf_veg%m_livestemc_xfer_to_litter_fire_patch(p) * dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) - & - cf_veg%m_deadstemc_xfer_to_fire_patch(p) * dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) - & - cf_veg%m_deadstemc_xfer_to_litter_fire_patch(p) * dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) - & - cf_veg%m_livecrootc_xfer_to_fire_patch(p) * dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) - & - cf_veg%m_livecrootc_xfer_to_litter_fire_patch(p)* dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) - & - cf_veg%m_deadcrootc_xfer_to_fire_patch(p) * dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) - & - cf_veg%m_deadcrootc_xfer_to_litter_fire_patch(p)* dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - & - cf_veg%m_gresp_xfer_to_fire_patch(p) * dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) - & - cf_veg%m_gresp_xfer_to_litter_fire_patch(p) * dt - - end do ! end of patch loop - - end associate - - end subroutine CStateUpdate3 - -end module CNCStateUpdate3Mod diff --git a/src/biogeochem/CNDVDriverMod.F90 b/src/biogeochem/CNDVDriverMod.F90 deleted file mode 100644 index c188d34004..0000000000 --- a/src/biogeochem/CNDVDriverMod.F90 +++ /dev/null @@ -1,467 +0,0 @@ -module CNDVDriverMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Note that this module was created simply to contain the subroutine dv - ! which cannot cannot be in CNDVMod due to circular dependencies - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use CNDVType , only : dgvs_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use clm_varcon , only : grlnd - use LandunitType , only : lun - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNDVDriver - public :: CNDVHist - ! - ! !PRIVATE MEMBER FUNCTIONS: - private set_dgvm_filename - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNDVDriver(bounds, & - num_natvegp, filter_natvegp, kyr, & - atm2lnd_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, dgvs_inst) - ! - ! !DESCRIPTION: - ! Drives the annual dynamic vegetation that works with CN - ! - ! !USES: - use CNDVLightMod , only : Light - use CNDVEstablishmentMod , only : Establishment - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(inout) :: num_natvegp ! number of naturally-vegetated patches in filter - integer , intent(inout) :: filter_natvegp(:) ! filter for naturally-vegetated patches - integer , intent(in) :: kyr ! used in routine climate20 below - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! patch index - !----------------------------------------------------------------------- - - associate( & - fpcgrid => dgvs_inst%fpcgrid_patch , & ! Input: [real(r8) (:) ] foliar projective cover on gridcell (fraction) - agdd20 => dgvs_inst%agdd20_patch , & ! Output: [real(r8) (:) ] 20-yr running mean of agdd - tmomin20 => dgvs_inst%tmomin20_patch , & ! Output: [real(r8) (:) ] 20-yr running mean of tmomin - agdd => dgvs_inst%agdd_patch , & ! Input: [real(r8) (:) ] accumulated growing degree days above 5 - - t_mo_min => atm2lnd_inst%t_mo_min_patch , & ! Output: [real(r8) (:) ] annual min of t_mo (Kelvin) - - leafcmax => cnveg_carbonstate_inst%leafcmax_patch & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C - ) - - ! ************************************************************************* - ! S. Levis version of LPJ's routine climate20: 'Returns' tmomin20 & agdd20 - ! for use in routine bioclim, which I have placed in routine Establishment - ! Instead of 20-yr running mean of coldest monthly temperature, - ! use 20-yr running mean of minimum 10-day running mean - ! ************************************************************************* - - do p = bounds%begp, bounds%endp - if (kyr == 2) then ! slevis: add ".and. start_type==arb_ic" here? - tmomin20(p) = t_mo_min(p) ! NO, b/c want to be able to start dgvm - agdd20(p) = agdd(p) ! w/ clmi file from non-dgvm simulation - end if - tmomin20(p) = (19._r8 * tmomin20(p) + t_mo_min(p)) / 20._r8 - agdd20(p) = (19._r8 * agdd20(p) + agdd(p) ) / 20._r8 - end do - - ! Rebuild filter of present natually-vegetated patches after Kill() - - num_natvegp = 0 - do p = bounds%begp,bounds%endp - if (dgvs_inst%present_patch(p)) then - num_natvegp = num_natvegp + 1 - filter_natvegp(num_natvegp) = p - end if - end do - - ! Returns fpcgrid and nind - - call Light(bounds, num_natvegp, filter_natvegp, & - cnveg_carbonstate_inst, dgvs_inst) - - ! Returns updated fpcgrid, nind, crownarea, and present. Due to updated - ! present, we do not use the natveg filter in this subroutine. - - call Establishment(bounds, & - atm2lnd_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, dgvs_inst) - - ! Reset dgvm variables needed in next yr (too few to keep subr. dvreset) - - do p = bounds%begp,bounds%endp - leafcmax(p) = 0._r8 - t_mo_min(p) = 1.0e+36_r8 - end do - - end associate - - end subroutine CNDVDriver - - !----------------------------------------------------------------------- - subroutine CNDVHist(bounds, dgvs_inst) - ! - ! !DESCRIPTION: - ! Write CNDV history file - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_CDAY - use shr_sys_mod , only : shr_sys_getenv - use clm_varpar , only : maxpatch_pft - use clm_varctl , only : caseid, ctitle, finidat, fsurdat, paramfile, iulog - use clm_varcon , only : spval - use clm_time_manager, only : get_ref_date, get_nstep, get_curr_date, get_curr_time - use domainMod , only : ldomain - use fileutils , only : get_filename - use spmdMod , only : masterproc - use ncdio_pio - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(dgvs_type) , intent(in) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - character(len=256) :: dgvm_fn ! dgvm history filename - type(file_desc_t) :: ncid ! netcdf file id - integer :: ncprec ! output precision - integer :: g,p,l ! indices - integer :: ier ! error status - integer :: mdcur, mscur, mcdate ! outputs from get_curr_time - integer :: yr,mon,day,mcsec ! outputs from get_curr_date - integer :: hours,minutes,secs ! hours,minutes,seconds of hh:mm:ss - integer :: nstep ! time step - integer :: nbsec ! seconds components of a date - integer :: dimid ! dimension, variable id - real(r8):: time ! current time - character(len=256) :: str ! temporary string - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len= 10) :: basedate ! base date (yyyymmdd) - character(len= 8) :: basesec ! base seconds - real(r8) , pointer :: rbuf2dg (:,:) ! Input: [real(r8) (:,:)] temporary - !----------------------------------------------------------------------- - - associate(& - fpcgrid => dgvs_inst%fpcgrid_patch , & ! Input: [real(r8) (:)] foliar projective cover on gridcell (fraction) - nind => dgvs_inst%nind_patch & ! Input: [real(r8) (:)] number of individuals (#/m**2) - ) - - allocate(rbuf2dg(bounds%begg:bounds%endg,maxpatch_pft), stat=ier) - if (ier /= 0) call endrun(msg='histCNDV: allocation error for rbuf2dg'//& - errMsg(sourcefile, __LINE__)) - - ! Set output precision - - ncprec = ncd_double - - ! ----------------------------------------------------------------------- - ! Create new netCDF file. File will be in define mode - ! ----------------------------------------------------------------------- - - dgvm_fn = set_dgvm_filename() - call ncd_pio_createfile(ncid, trim(dgvm_fn)) - - ! ----------------------------------------------------------------------- - ! Create global attributes. - ! ----------------------------------------------------------------------- - - str = 'CF1.0' - call ncd_putatt (ncid, ncd_global, 'conventions', trim(str)) - - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(ncid, ncd_global,'history', trim(str)) - - call shr_sys_getenv('LOGNAME', str, ier) - if (ier /= 0) call endrun(msg='error: LOGNAME environment variable not defined'//& - errMsg(sourcefile, __LINE__)) - - call ncd_putatt (ncid, ncd_global, 'logname', trim(str)) - - call shr_sys_getenv('HOST', str, ier) - call ncd_putatt (ncid, ncd_global, 'host', trim(str)) - - str = 'Community Land Model: CLM3' - call ncd_putatt (ncid, ncd_global, 'source', trim(str)) - - str = '$Name$' - call ncd_putatt (ncid, ncd_global, 'version', trim(str)) - - str = '$Id$' - call ncd_putatt (ncid, ncd_global, 'revision_id', trim(str)) - - str = ctitle - call ncd_putatt (ncid, ncd_global, 'case_title', trim(str)) - - str = caseid - call ncd_putatt (ncid, ncd_global, 'case_id', trim(str)) - - str = get_filename(fsurdat) - call ncd_putatt(ncid, ncd_global, 'Surface_dataset', trim(str)) - - str = 'arbitrary initialization' - if (finidat /= ' ') str = get_filename(finidat) - call ncd_putatt(ncid, ncd_global, 'Initial_conditions_dataset', trim(str)) - - str = get_filename(paramfile) - call ncd_putatt(ncid, ncd_global, 'PFT_physiological_constants_dataset', trim(str)) - - ! ----------------------------------------------------------------------- - ! Define dimensions. - ! ----------------------------------------------------------------------- - - if (ldomain%isgrid2d) then - call ncd_defdim (ncid, 'lon' ,ldomain%ni, dimid) - call ncd_defdim (ncid, 'lat' ,ldomain%nj, dimid) - else - call ncd_defdim (ncid, 'gridcell', ldomain%ns, dimid) - end if - call ncd_defdim (ncid, 'pft' , maxpatch_pft , dimid) - call ncd_defdim (ncid, 'time', ncd_unlimited, dimid) - call ncd_defdim (ncid, 'string_length', 80 , dimid) - - ! ----------------------------------------------------------------------- - ! Define variables - ! ----------------------------------------------------------------------- - - ! Define coordinate variables (including time) - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='lon', xtype=ncprec, dim1name='lon', & - long_name='coordinate longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='lat', xtype=ncprec, dim1name='lat', & - long_name='coordinate latitude', units='degrees_north') - end if - - call get_curr_time(mdcur, mscur) - call get_ref_date(yr, mon, day, nbsec) - hours = nbsec / 3600 - minutes = (nbsec - hours*3600) / 60 - secs = (nbsec - hours*3600 - minutes*60) - write(basedate,80) yr,mon,day -80 format(i4.4,'-',i2.2,'-',i2.2) - write(basesec ,90) hours, minutes, secs -90 format(i2.2,':',i2.2,':',i2.2) - str = 'days since ' // basedate // " " // basesec - time = mdcur + mscur/SHR_CONST_CDAY - - call ncd_defvar(ncid=ncid, varname='time', xtype=ncd_double, dim1name='time', & - long_name='time', units=str) - - ! Define surface grid (coordinate variables, latitude, longitude, surface type). - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='longxy', xtype=ncprec, & - dim1name='lon', dim2name='lat', & - long_name='longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='latixy', xtype=ncprec, & - dim1name='lon', dim2name='lat', & - long_name='latitude', units='degrees_north') - - call ncd_defvar(ncid=ncid, varname='landmask', xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='land/ocean mask (0.=ocean and 1.=land)') - else - call ncd_defvar(ncid=ncid, varname='longxy', xtype=ncprec, & - dim1name='gridcell',& - long_name='longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='latixy', xtype=ncprec, & - dim1name='gridcell',& - long_name='latitude', units='degrees_north') - - call ncd_defvar(ncid=ncid, varname='landmask', xtype=ncd_int, & - dim1name='gridcell', & - long_name='land/ocean mask (0.=ocean and 1.=land)') - end if - - ! Define time information - - call ncd_defvar(ncid=ncid, varname='mcdate', xtype=ncd_int, dim1name='time',& - long_name='current date (YYYYMMDD)') - - call ncd_defvar(ncid=ncid, varname='mcsec', xtype=ncd_int, dim1name='time',& - long_name='current seconds of current date', units='s') - - call ncd_defvar(ncid=ncid, varname='mdcur', xtype=ncd_int, dim1name='time',& - long_name='current day (from base day)') - - call ncd_defvar(ncid=ncid, varname='mscur', xtype=ncd_int, dim1name='time',& - long_name='current seconds of current day', units='s') - - call ncd_defvar(ncid=ncid, varname='nstep', xtype=ncd_int, dim1name='time',& - long_name='time step', units='s') - - ! Define time dependent variables - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='FPCGRID', xtype=ncprec, & - dim1name='lon', dim2name='lat', dim3name='pft', dim4name='time', & - long_name='plant functional type cover', units='fraction of vegetated area', & - missing_value=spval, fill_value=spval) - - call ncd_defvar(ncid=ncid, varname='NIND', xtype=ncprec, & - dim1name='lon', dim2name='lat', dim3name='pft', dim4name='time', & - long_name='number of individuals', units='individuals/m2 vegetated land', & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=ncid, varname='FPCGRID', xtype=ncprec, & - dim1name='gridcell', dim2name='pft', dim3name='time', & - long_name='plant functional type cover', units='fraction of vegetated area', & - missing_value=spval, fill_value=spval) - - call ncd_defvar(ncid=ncid, varname='NIND', xtype=ncprec, & - dim1name='gridcell', dim2name='pft', dim3name='time', & - long_name='number of individuals', units='individuals/m2 vegetated land', & - missing_value=spval, fill_value=spval) - end if - - call ncd_enddef(ncid) - - ! ----------------------------------------------------------------------- - ! Write variables - ! ----------------------------------------------------------------------- - - ! Write surface grid (coordinate variables, latitude, longitude, surface type). - - call ncd_io(ncid=ncid, varname='longxy' , data=ldomain%lonc, flag='write', & - dim1name=grlnd) - call ncd_io(ncid=ncid, varname='latixy' , data=ldomain%latc, flag='write', & - dim1name=grlnd) - call ncd_io(ncid=ncid, varname='landmask', data=ldomain%mask, flag='write', & - dim1name=grlnd) - - ! Write current date, current seconds, current day, current nstep - - call get_curr_date(yr, mon, day, mcsec) - mcdate = yr*10000 + mon*100 + day - nstep = get_nstep() - - call ncd_io(ncid=ncid, varname='mcdate', data=mcdate, nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mcsec' , data=mcsec , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mdcur' , data=mdcur , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mscur' , data=mcsec , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='nstep' , data=nstep , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='time' , data=time , nt=1, flag='write') - - ! Write time dependent variables to CNDV history file - - ! The if .not. ifspecial statment below guarantees that the m index will - ! always lie between 1 and maxpatch_pft - - rbuf2dg(bounds%begg : bounds%endg, :) = 0._r8 - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - if (.not. lun%ifspecial(l)) rbuf2dg(g,patch%mxy(p)) = fpcgrid(p)*100._r8 - end do - call ncd_io(ncid=ncid, varname='FPCGRID', dim1name=grlnd, data=rbuf2dg, & - nt=1, flag='write') - - rbuf2dg(bounds%begg : bounds%endg, :) = 0._r8 - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - if (.not. lun%ifspecial(l)) rbuf2dg(g,patch%mxy(p)) = nind(p) - end do - call ncd_io(ncid=ncid, varname='NIND', dim1name=grlnd, data=rbuf2dg, & - nt=1, flag='write') - - ! Deallocate dynamic memory - - deallocate(rbuf2dg) - - !------------------------------------------------------------------ - ! Close and archive netcdf CNDV history file - !------------------------------------------------------------------ - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*)'(histCNDV): Finished writing CNDV history dataset ',& - trim(dgvm_fn), 'at nstep = ',get_nstep() - end if - - end associate - - end subroutine CNDVHist - - !----------------------------------------------------------------------- - character(len=256) function set_dgvm_filename () - ! - ! !DESCRIPTION: - ! Determine initial dataset filenames - ! - ! !USES: - use clm_varctl , only : caseid, inst_suffix - use clm_time_manager , only : get_curr_date - ! - ! !ARGUMENTS: - implicit none - ! - ! !LOCAL VARIABLES: - character(len=256) :: cdate !date char string - integer :: day !day (1 -> 31) - integer :: mon !month (1 -> 12) - integer :: yr !year (0 -> ...) - integer :: sec !seconds into current day - !----------------------------------------------------------------------- - - call get_curr_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec - set_dgvm_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".hv."//trim(cdate)//".nc" - - end function set_dgvm_filename - - !----------------------------------------------------------------------- - subroutine BuildNatVegFilter(bounds, num_natvegp, filter_natvegp, dgvs_inst) - ! - ! !DESCRIPTION: - ! Reconstruct a filter of naturally-vegetated Patches for use in DGVM - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(out) :: num_natvegp ! number of patches in naturally-vegetated filter - integer , intent(out) :: filter_natvegp(:) ! patch filter for naturally-vegetated points - type(dgvs_type) , intent(in) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - integer :: p - !----------------------------------------------------------------------- - - num_natvegp = 0 - do p = bounds%begp,bounds%endp - if (dgvs_inst%present_patch(p)) then - num_natvegp = num_natvegp + 1 - filter_natvegp(num_natvegp) = p - end if - end do - - end subroutine BuildNatVegFilter - -end module CNDVDriverMod diff --git a/src/biogeochem/CNDVEstablishmentMod.F90 b/src/biogeochem/CNDVEstablishmentMod.F90 deleted file mode 100644 index a387417da9..0000000000 --- a/src/biogeochem/CNDVEstablishmentMod.F90 +++ /dev/null @@ -1,451 +0,0 @@ -module CNDVEstablishmentMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates establishment of new patches - ! Called once per year - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use atm2lndType , only : atm2lnd_type - use CNDVType , only : dgvs_type, dgv_ecophyscon - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegcarbonfluxType , only : cnveg_carbonflux_type - use LandunitType , only : lun - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: Establishment - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Establishment(bounds, & - atm2lnd_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, dgvs_inst) - ! - ! !DESCRIPTION: - ! Calculates establishment of new patches - called once per year - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_PI, SHR_CONST_TKFRZ - use shr_log_mod , only : errMsg => shr_log_errMsg - use landunit_varcon , only : istsoil - use clm_varctl , only : iulog - use pftconMod , only : noveg, nc3_arctic_grass - use abortutils , only : endrun - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p,m ! indices - integer :: fn, filterg(bounds%begg-bounds%endg+1) ! local gridcell filter for error check - ! - ! gridcell level variables - integer :: ngrass(bounds%begg:bounds%endg) ! counter - integer :: npft_estab(bounds%begg:bounds%endg) ! counter - real(r8) :: fpc_tree_total(bounds%begg:bounds%endg) ! total fractional cover of trees in vegetated portion of gridcell - real(r8) :: fpc_total(bounds%begg:bounds%endg) ! old-total fractional vegetated portion of gridcell (without bare ground) - real(r8) :: fpc_total_new(bounds%begg:bounds%endg) ! new-total fractional vegetated portion of gridcell (without bare ground) - - ! patch level variables - logical :: survive(bounds%begp:bounds%endp) ! true=>pft survives - logical :: estab(bounds%begp:bounds%endp) ! true=>pft is established - real(r8) :: dstemc(bounds%begp:bounds%endp) ! local copy of deadstemc - - ! local and temporary variables or parameters - real(r8) :: taper ! ratio of height:radius_breast_height (tree allometry) - real(r8) :: estab_rate ! establishment rate - real(r8) :: estab_grid ! establishment rate on grid cell - real(r8) :: fpcgridtemp ! temporary - real(r8) :: stemdiam ! stem diameter - real(r8) :: stocking ! #stems / ha (stocking density) - real(r8) :: lai_ind ! LAI per individual - real(r8) :: lm_ind ! leaf carbon (gC/ind) - real(r8) :: fpc_ind ! individual foliage projective cover - real(r8):: bm_delta - - ! parameters - real(r8), parameter :: ramp_agddtw = 300.0 - - ! minimum individual density for persistence of PATCH (indiv/m2) - real(r8), parameter :: nind_min = 1.0e-10_r8 - - ! minimum precip. for establishment (mm/s) - real(r8), parameter :: prec_min_estab = 100._r8/(365._r8*SHR_CONST_CDAY) - - ! maximum sapling establishment rate (indiv/m2) - real(r8), parameter :: estab_max = 0.24_r8 - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis [m^2/gC] - dsladlai => pftcon%dsladlai , & ! Input: dSLA/dLAI, projected area basis [m^2/gC] - dwood => pftcon%dwood , & ! Input: wood density (gC/m3) - woody => pftcon%woody , & ! Input: woody patch or not - - crownarea_max => dgv_ecophyscon%crownarea_max , & ! Input: [real(r8) (:) ] ecophys const - tree maximum crown area [m2] - twmax => dgv_ecophyscon%twmax , & ! Input: [real(r8) (:) ] ecophys const - upper limit of temperature of the warmest month - reinickerp => dgv_ecophyscon%reinickerp , & ! Input: [real(r8) (:) ] ecophys const - parameter in allometric equation - allom1 => dgv_ecophyscon%allom1 , & ! Input: [real(r8) (:) ] ecophys const - parameter in allometric - tcmax => dgv_ecophyscon%tcmax , & ! Input: [real(r8) (:) ] ecophys const - maximum coldest monthly mean temperature - tcmin => dgv_ecophyscon%tcmin , & ! Input: [real(r8) (:) ] ecophys const - minimum coldest monthly mean temperature - gddmin => dgv_ecophyscon%gddmin , & ! Input: [real(r8) (:) ] ecophys const - minimum growing degree days (at or above 5 C) - - prec365 => atm2lnd_inst%prec365_col , & ! Input: [real(r8) (:) ] 365-day running mean of tot. precipitation - - agddtw => dgvs_inst%agddtw_patch , & ! Input: [real(r8) (:) ] accumulated growing degree days above twmax - agdd20 => dgvs_inst%agdd20_patch , & ! Input: [real(r8) (:) ] 20-yr running mean of agdd - tmomin20 => dgvs_inst%tmomin20_patch , & ! Input: [real(r8) (:) ] 20-yr running mean of tmomin - pftmayexist => dgvs_inst%pftmayexist_patch , & ! Input: [logical (:) ] exclude seasonal decid patches from tropics [1=true, 0=false] - present => dgvs_inst%present_patch , & ! Output: [logical (:) ] true=> PATCH present in patch - nind => dgvs_inst%nind_patch , & ! Output: [real(r8) (:) ] number of individuals (#/m**2) - fpcgrid => dgvs_inst%fpcgrid_patch , & ! Output: [real(r8) (:) ] foliar projective cover on gridcell (fraction) - crownarea => dgvs_inst%crownarea_patch , & ! Output: [real(r8) (:) ] area that each individual tree takes up (m^2) - greffic => dgvs_inst%greffic_patch , & ! Output: [real(r8) (:) ] lpj's growth efficiency - heatstress => dgvs_inst%heatstress_patch , & ! Output: [real(r8) (:) ] - - annsum_npp => cnveg_carbonflux_inst%annsum_npp_patch , & ! Input: [real(r8) (:) ] annual sum NPP (gC/m2/yr) - annsum_litfall => cnveg_carbonflux_inst%annsum_litfall_patch , & ! Input: [real(r8) (:) ] annual sum litfall (gC/m2/yr) - - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - leafcmax => cnveg_carbonstate_inst%leafcmax_patch & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C - ) - - ! ********************************************************************** - ! Slevis version of LPJ's subr. bioclim - ! Limits based on 20-year running averages of coldest-month mean - ! temperature and growing degree days (5 degree base). - ! For SURVIVAL, coldest month temperature and GDD should be - ! at least as high as PFT-specific limits. - ! For REGENERATION, PATCH must be able to survive AND coldest month - ! temperature should be no higher than a PFT-specific limit. - ! ********************************************************************** - - taper = 200._r8 ! make a global constant as with dwood (lpj's wooddens) - - ! Initialize gridcell-level metrics - - do g = bounds%begg,bounds%endg - ngrass(g) = 0 - npft_estab(g) = 0 - fpc_tree_total(g) = 0._r8 - fpc_total(g) = 0._r8 - fpc_total_new(g) = 0._r8 - end do - - do p = bounds%begp,bounds%endp - ! Set the presence of patch for this gridcell - - if (nind(p) == 0._r8) present(p) = .false. - if (.not. present(p)) then - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - survive(p) = .false. - estab(p) = .false. - dstemc(p) = deadstemc(p) - end do - - ! Must go thru all 16 patches and decide which can/cannot establish or survive - ! Determine present, survive, estab. Note: Even if tmomin20>tcmax, crops - ! and 2nd boreal summergreen tree cannot exist (see - ! EcosystemDynini) because this model cannot simulate such patches, yet. - ! Note - agddtw is only defined at the patch level and has now been moved - ! to an if-statement below to determine establishment of boreal trees - - do p = bounds%begp,bounds%endp - if (tmomin20(p) >= tcmin(ivt(p)) + SHR_CONST_TKFRZ ) then - if (tmomin20(p) <= tcmax(ivt(p)) + SHR_CONST_TKFRZ .and. agdd20(p) >= gddmin(ivt(p))) then - estab(p) = .true. - end if - survive(p) = .true. - ! seasonal decid. patches that would have occurred in regions without - ! short winter day lengths (see CNPhenology) - if (.not. pftmayexist(p)) then - survive(p) = .false. - estab(p) = .false. - pftmayexist(p) = .true. - end if - end if - end do - - do p = bounds%begp,bounds%endp - c = patch%column(p) - l = patch%landunit(p) - - ! Case 1 -- patch ceases to exist -kill patches not adapted to current climate - - if (present(p) .and. (.not. survive(p) .or. nind(p)= prec_min_estab .and. estab(p)) then - if (twmax(ivt(p)) > 999._r8 .or. agddtw(p) == 0._r8) then - - present(p) = .true. - nind(p) = 0._r8 - ! lpj starts with fpcgrid=0 and calculates - ! seed fpcgrid from the carbon of saplings; - ! with CN we need the seed fpcgrid up front - ! to scale seed leafc to lm_ind to get fpcgrid; - ! sounds circular; also seed fpcgrid depends on sla, - ! so theoretically need diff value for each pft;slevis - fpcgrid(p) = 0.000844_r8 - if (woody(ivt(p)) < 1._r8) then - fpcgrid(p) = 0.05_r8 - end if - - ! Seed carbon for newly established patches - ! Equiv. to pleaf=1 & pstor=1 set in subr pftwt_cnbal (slevis) - ! ***Dangerous*** to hardwire leafcmax here; find alternative! - ! Consider just assigning nind and fpcgrid for newly - ! established patches instead of entering the circular procedure - ! outlined in the paragraph above - leafcmax(p) = 1._r8 - if (dstemc(p) <= 0._r8) dstemc(p) = 0.1_r8 - - end if ! conditions required for establishment - end if ! conditions required for establishment - end if ! if soil - - ! Case 3 -- some patches continue to exist (no change) and some patches - ! continue to not exist (no change). Do nothing for this case. - - end do - - ! Sapling and grass establishment - ! Calculate total woody FPC, FPC increment and grass cover (= crown area) - ! Calculate total woody FPC and number of woody Patches present and able to establish - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - if (present(p)) then - if (woody(ivt(p)) == 1._r8) then - fpc_tree_total(g) = fpc_tree_total(g) + fpcgrid(p) - if (estab(p)) npft_estab(g) = npft_estab(g) + 1 - else if (woody(ivt(p)) < 1._r8 .and. ivt(p) > noveg) then !grass - ngrass(g) = ngrass(g) + 1 - end if - end if - end do - - ! Above grid-level establishment counters are required for the next steps. - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - - if (present(p) .and. woody(ivt(p)) == 1._r8 .and. estab(p)) then - - ! Calculate establishment rate over available space, per tree PFT - ! Max establishment rate reduced by shading as tree FPC approaches 1 - ! Total establishment rate partitioned equally among regenerating woody Patches - - estab_rate = estab_max * (1._r8-exp(5._r8*(fpc_tree_total(g)-1._r8))) / real(npft_estab(g)) - - ! Calculate grid-level establishment rate per woody PFT - ! Space available for woody PATCH establishment is fraction of grid cell - ! not currently occupied by woody Patches - - estab_grid = estab_rate * (1._r8-fpc_tree_total(g)) - - ! Add new saplings to current population - - nind(p) = nind(p) + estab_grid - - !slevis: lpj's lm_ind was the max leaf mass for the year; - !now lm_ind is the max leaf mass for the year calculated in CNFire - !except when a patch is newly established (nind==0); then lm_ind - !is assigned a leafcmax above - - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) ! nind>0 for sure - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 patch area - ! stemdiam derived here from cn's formula for htop found in - ! CNVegStructUpdate and cn's assumption stemdiam=2*htop/taper - ! this derivation neglects upper htop limit enforced elsewhere - stemdiam = (24._r8 * dstemc(p) / (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) - else - stemdiam = 0._r8 - end if - ! Eqn D (now also in Light; need here for 1st yr when patches haven't established, yet) - crownarea(p) = min(crownarea_max(ivt(p)), allom1(ivt(p))*stemdiam**reinickerp(ivt(p))) - - ! Update LAI and FPC - - if (crownarea(p) > 0._r8) then - if (dsladlai(ivt(p)) > 0._r8) then - ! make lai_ind >= 0.001 to avoid killing plants at this stage - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else ! currently redundant because dsladlai=0 for grasses only - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) ! lpj's formula - end if - else - lai_ind = 0._r8 - end if - - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - - end if ! add new saplings block - if (present(p) .and. woody(ivt(p)) == 1._r8) then - fpc_total_new(g) = fpc_total_new(g) + fpcgrid(p) - end if - end do ! close loop to update fpc_total_new - - ! Adjustments- don't allow trees to exceed 95% of vegetated landunit - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - if (fpc_total_new(g) > 0.95_r8) then - if (woody(ivt(p)) == 1._r8 .and. present(p)) then - nind(p) = nind(p) * 0.95_r8 / fpc_total_new(g) - fpcgrid(p) = fpcgrid(p) * 0.95_r8 / fpc_total_new(g) - end if - fpc_total(g) = 0.95_r8 - - else - fpc_total(g) = fpc_total_new(g) - end if - end do - - ! Section for grasses. Grasses can establish in non-vegetated areas - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - if (present(p) .and. woody(ivt(p)) < 1._r8) then - if (leafcmax(p) <= 0._r8 .or. fpcgrid(p) <= 0._r8 ) then - present(p) = .false. - nind(p) = 0._r8 - else - nind(p) = 1._r8 ! in case these grasses just established - crownarea(p) = 1._r8 - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - if (dsladlai(ivt(p)) > 0._r8) then - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else ! 'if' is currently redundant b/c dsladlai=0 for grasses only - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) - end if - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - fpc_total(g) = fpc_total(g) + fpcgrid(p) - end if - end if - end do ! end of pft-loop - - ! Adjustment of fpc_total > 1 due to grasses (ivt >= nc3_arctic_grass) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - - if (fpc_total(g) > 1._r8) then - if (ivt(p) >= nc3_arctic_grass .and. fpcgrid(p) > 0._r8) then - fpcgridtemp = fpcgrid(p) - fpcgrid(p) = max(0._r8, fpcgrid(p) - (fpc_total(g)-1._r8)) - fpc_total(g) = fpc_total(g) - fpcgridtemp + fpcgrid(p) - end if - end if - - ! Remove tiny fpcgrid amounts - - if (fpcgrid(p) < 1.e-15_r8) then - fpc_total(g) = fpc_total(g) - fpcgrid(p) - fpcgrid(p) = 0._r8 - present(p) = .false. - nind(p) = 0._r8 - end if - - ! Set the fpcgrid for bare ground if there is bare ground in - ! vegetated landunit and patch is bare ground so that everything - ! can add up to one. - - if (fpc_total(g) < 1._r8 .and. ivt(p) == noveg) then - fpcgrid(p) = 1._r8 - fpc_total(g) - fpc_total(g) = fpc_total(g) + fpcgrid(p) - end if - - end do - - ! Annual calculations used hourly in GapMortality - ! Ultimately may wish to place in separate subroutine... - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - - ! Stress mortality from lpj's subr Mortality - - if (woody(ivt(p)) == 1._r8 .and. nind(p) > 0._r8 .and. & - leafcmax(p) > 0._r8 .and. fpcgrid(p) > 0._r8) then - - if (twmax(ivt(p)) < 999._r8) then - heatstress(p) = max(0._r8, min(1._r8, agddtw(p) / ramp_agddtw)) - else - heatstress(p) = 0._r8 - end if - - ! Net individual living biomass increment - ! NB: lpj's turnover not exactly same as cn's litfall: - ! lpj's sap->heartwood turnover not included in litfall (slevis) - - bm_delta = max(0._r8, annsum_npp(p) - annsum_litfall(p)) - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - - ! Growth efficiency (net biomass increment per unit leaf area) - - if (dsladlai(ivt(p)) > 0._r8) then - greffic(p) = bm_delta / (max(0.001_r8, & - ( ( exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) & - - slatop(ivt(p)) ) / dsladlai(ivt(p)) ))) - else ! currently redundant because dsladlai=0 for grasses only - greffic(p) = bm_delta / (lm_ind * slatop(ivt(p))) - end if - else - greffic(p) = 0. - heatstress(p) = 0. - end if - - end do - - ! Check for error in establishment - fn = 0 - do g = bounds%begg,bounds%endg - if (abs(fpc_total(g) - 1._r8) > 1.e-6) then - fn = fn + 1 - filterg(fn) = g - end if - end do - ! Just print out the first error - if (fn > 0) then - g = filterg(1) - write(iulog,*) 'Error in Establishment: fpc_total =',fpc_total(g), ' at gridcell ',g - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end associate - - end subroutine Establishment - -end module CNDVEstablishmentMod diff --git a/src/biogeochem/CNDVLightMod.F90 b/src/biogeochem/CNDVLightMod.F90 deleted file mode 100644 index 3c498742b9..0000000000 --- a/src/biogeochem/CNDVLightMod.F90 +++ /dev/null @@ -1,231 +0,0 @@ -module CNDVLightMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate light competition - ! Update fpc for establishment routine - ! Called once per year - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_PI - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use CNDVType , only : dgv_ecophyscon, dgvs_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: Light - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Light(bounds, num_natvegp, filter_natvegp, & - cnveg_carbonstate_inst, dgvs_inst) - ! - ! !DESCRIPTION: - ! Calculate light competition and update fpc for establishment routine - ! Called once per year - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_natvegp ! number of naturally-vegetated patches in filter - integer , intent(in) :: filter_natvegp(:) ! patch filter for naturally-vegetated points - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: fpc_tree_max = 0.95_r8 !maximum total tree FPC - integer :: p,fp, g ! indices - real(r8) :: fpc_tree_total(bounds%begg:bounds%endg) - real(r8) :: fpc_inc_tree(bounds%begg:bounds%endg) - real(r8) :: fpc_inc(bounds%begp:bounds%endp) ! foliar projective cover increment (fraction) - real(r8) :: fpc_grass_total(bounds%begg:bounds%endg) - real(r8) :: fpc_shrub_total(bounds%begg:bounds%endg) - real(r8) :: fpc_grass_max(bounds%begg:bounds%endg) - real(r8) :: fpc_shrub_max(bounds%begg:bounds%endg) - integer :: numtrees(bounds%begg:bounds%endg) - real(r8) :: excess - real(r8) :: nind_kill - real(r8) :: lai_ind - real(r8) :: fpc_ind - real(r8) :: fpcgrid_old - real(r8) :: lm_ind ! leaf carbon (gC/individual) - real(r8) :: stemdiam ! stem diameter - real(r8) :: stocking ! #stems / ha (stocking density) - real(r8) :: taper ! ratio of height:radius_breast_height (tree allometry) - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - crownarea_max => dgv_ecophyscon%crownarea_max , & ! Input: [real(r8) (:) ] ecophys const - tree maximum crown a - reinickerp => dgv_ecophyscon%reinickerp , & ! Input: [real(r8) (:) ] ecophys const - parameter in allomet - allom1 => dgv_ecophyscon%allom1 , & ! Input: [real(r8) (:) ] ecophys const - parameter in allomet - - dwood => pftcon%dwood , & ! Input: wood density (gC/m3) - slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis (m2/gC) - dsladlai => pftcon%dsladlai , & ! Input: dSLA/dLAI, projected area basis (m2/gC) - woody => pftcon%woody , & ! Input: woody patch or not - tree => pftcon%tree , & ! Input: tree patch or not - - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - - crownarea => dgvs_inst%crownarea_patch , & ! Output: [real(r8) (:) ] area that each individual tree takes up (m^2) - nind => dgvs_inst%nind_patch , & ! Output: [real(r8) (:) ] number of individuals - fpcgrid => dgvs_inst%fpcgrid_patch & ! Output: [real(r8) (:) ] foliar projective cover on gridcell (fraction) - ) - - taper = 200._r8 ! make a global constant; used in Establishment + ? - - ! Initialize gridcell-level metrics - - do g = bounds%begg, bounds%endg - fpc_tree_total(g) = 0._r8 - fpc_inc_tree(g) = 0._r8 - fpc_grass_total(g) = 0._r8 - fpc_shrub_total(g) = 0._r8 - numtrees(g) = 0 - end do - - do fp = 1,num_natvegp - p = filter_natvegp(fp) - g = patch%gridcell(p) - - ! Update LAI and FPC as in the last lines of DGVMAllocation - - if (woody(ivt(p))==1._r8) then - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 patch area - ! stemdiam derived here from cn's formula for htop found in - ! CNVegStructUpdate and cn's assumption stemdiam=2*htop/taper - ! this derivation neglects upper htop limit enforced elsewhere - stemdiam = (24._r8 * deadstemc(p) / (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) - else - stemdiam = 0._r8 - end if - crownarea(p) = min(crownarea_max(ivt(p)), allom1(ivt(p))*stemdiam**reinickerp(ivt(p))) ! Eqn D (from Establishment) - !else ! crownarea is 1 and does not need updating - end if - - if (crownarea(p) > 0._r8 .and. nind(p) > 0._r8) then - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - if (dsladlai(ivt(p)) > 0._r8) then - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) - end if - else - lai_ind = 0._r8 - end if - - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid_old = fpcgrid(p) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - fpc_inc(p) = max(0._r8, fpcgrid(p) - fpcgrid_old) - - if (woody(ivt(p)) == 1._r8) then - if (tree(ivt(p)) == 1) then - numtrees(g) = numtrees(g) + 1 - fpc_tree_total(g) = fpc_tree_total(g) + fpcgrid(p) - fpc_inc_tree(g) = fpc_inc_tree(g) + fpc_inc(p) - else ! if shrubs - fpc_shrub_total(g) = fpc_shrub_total(g) + fpcgrid(p) - end if - else ! if grass - fpc_grass_total(g) = fpc_grass_total(g) + fpcgrid(p) - end if - end do - - do g = bounds%begg, bounds%endg - fpc_grass_max(g) = 1._r8 - min(fpc_tree_total(g), fpc_tree_max) - fpc_shrub_max(g) = max(0._r8, fpc_grass_max(g) - fpc_grass_total(g)) - end do - - ! The gridcell level metrics are now in place; continue... - ! slevis replaced the previous code that updated pfpcgrid - ! with a simpler way of doing so: - ! fpcgrid(p) = fpcgrid(p) - excess - ! Later we may wish to update this subroutine - ! according to Strassmann's recommendations (see relevant pdf) - - do fp = 1,num_natvegp - p = filter_natvegp(fp) - g = patch%gridcell(p) - - ! light competition - - if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==1._r8) then - - if (fpc_tree_total(g) > fpc_tree_max) then - - if (fpc_inc_tree(g) > 0._r8) then - excess = (fpc_tree_total(g) - fpc_tree_max) * & - fpc_inc(p) / fpc_inc_tree(g) - else - excess = (fpc_tree_total(g) - fpc_tree_max) / & - real(numtrees(g)) - end if - - ! Reduce individual density (and thereby gridcell-level biomass) - ! so that total tree FPC reduced to 'fpc_tree_max' - - if (fpcgrid(p) > 0._r8) then - nind_kill = nind(p) * excess / fpcgrid(p) - nind(p) = max(0._r8, nind(p) - nind_kill) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - else - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - - ! Transfer lost biomass to litter - - end if ! if tree cover exceeds max allowed - else if (woody(ivt(p))==0._r8) then ! grass - - if (fpc_grass_total(g) > fpc_grass_max(g)) then - - ! grass competes with itself if total fpc exceeds 1 - - excess = (fpc_grass_total(g) - fpc_grass_max(g)) * fpcgrid(p) / fpc_grass_total(g) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - - end if - - else if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==0._r8) then ! shrub - - if (fpc_shrub_total(g) > fpc_shrub_max(g)) then - - excess = 1._r8 - fpc_shrub_max(g) / fpc_shrub_total(g) - - ! Reduce individual density (and thereby gridcell-level biomass) - ! so that total shrub FPC reduced to fpc_shrub_max(g) - - if (fpcgrid(p) > 0._r8) then - nind_kill = nind(p) * excess / fpcgrid(p) - nind(p) = max(0._r8, nind(p) - nind_kill) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - else - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - - end if - - end if ! end of if-tree - - end do - - end associate - - end subroutine Light - -end module CNDVLightMod diff --git a/src/biogeochem/CNDVType.F90 b/src/biogeochem/CNDVType.F90 deleted file mode 100644 index ca6b2b030f..0000000000 --- a/src/biogeochem/CNDVType.F90 +++ /dev/null @@ -1,519 +0,0 @@ -module CNDVType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing routines to drive the annual dynamic vegetation - ! that works with CN, reset related variables, - ! and initialize/reset time invariant variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varctl , only : use_cndv, iulog - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC DATA TYPES: - ! - ! DGVM-specific ecophysiological constants structure (patch-level) - type, public :: dgv_ecophyscon_type - real(r8), pointer :: crownarea_max(:) ! patch tree maximum crown area [m2] - real(r8), pointer :: tcmin(:) ! patch minimum coldest monthly mean temperature [units?] - real(r8), pointer :: tcmax(:) ! patch maximum coldest monthly mean temperature [units?] - real(r8), pointer :: gddmin(:) ! patch minimum growing degree days (at or above 5 C) - real(r8), pointer :: twmax(:) ! patch upper limit of temperature of the warmest month [units?] - real(r8), pointer :: reinickerp(:) ! patch parameter in allometric equation - real(r8), pointer :: allom1(:) ! patch parameter in allometric - real(r8), pointer :: allom2(:) ! patch parameter in allometric - real(r8), pointer :: allom3(:) ! patch parameter in allometric - end type dgv_ecophyscon_type - type(dgv_ecophyscon_type), public :: dgv_ecophyscon - ! - ! DGVM state variables structure - type, public :: dgvs_type - real(r8), pointer, public :: agdd_patch (:) ! patch accumulated growing degree days above 5 - real(r8), pointer, public :: agddtw_patch (:) ! patch accumulated growing degree days above twmax - real(r8), pointer, public :: agdd20_patch (:) ! patch 20-yr running mean of agdd - real(r8), pointer, public :: tmomin20_patch (:) ! patch 20-yr running mean of tmomin - logical , pointer, public :: present_patch (:) ! patch whether PATCH present in patch - logical , pointer, public :: pftmayexist_patch (:) ! patch if .false. then exclude seasonal decid patches from tropics - real(r8), pointer, public :: nind_patch (:) ! patch number of individuals (#/m**2) - real(r8), pointer, public :: lm_ind_patch (:) ! patch individual leaf mass - real(r8), pointer, public :: lai_ind_patch (:) ! patch LAI per individual - real(r8), pointer, public :: fpcinc_patch (:) ! patch foliar projective cover increment (fraction) - real(r8), pointer, public :: fpcgrid_patch (:) ! patch foliar projective cover on gridcell (fraction) - real(r8), pointer, public :: fpcgridold_patch (:) ! patch last yr's fpcgrid - real(r8), pointer, public :: crownarea_patch (:) ! patch area that each individual tree takes up (m^2) - real(r8), pointer, public :: greffic_patch (:) - real(r8), pointer, public :: heatstress_patch (:) - - contains - - procedure , public :: Init - procedure , public :: Restart - procedure , public :: InitAccBuffer - procedure , public :: InitAccVars - procedure , public :: UpdateAccVars - procedure , private :: InitAllocate - procedure , private :: InitCold - procedure , private :: InitHistory - end type dgvs_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - - ! Note - need allocation so that associate statements can be used - ! at run time for NAG (allocation of variables is needed) - history - ! should only be initialized if use_cndv is true - - call this%InitAllocate (bounds) - - if (use_cndv) then - call this%InitCold (bounds) - call this%InitHistory (bounds) - end if - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : numpft - use pftconMod , only : allom1s, allom2s, allom1, allom2, allom3, reinickerp - use pftconMod , only : ntree, nbrdlf_dcd_brl_shrub - use pftconMod , only : pftcon - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: m - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - allocate(this%agdd_patch (begp:endp)) ; this%agdd_patch (:) = nan - allocate(this%agddtw_patch (begp:endp)) ; this%agddtw_patch (:) = nan - allocate(this%agdd20_patch (begp:endp)) ; this%agdd20_patch (:) = nan - allocate(this%tmomin20_patch (begp:endp)) ; this%tmomin20_patch (:) = nan - allocate(this%present_patch (begp:endp)) ; this%present_patch (:) = .false. - allocate(this%pftmayexist_patch (begp:endp)) ; this%pftmayexist_patch (:) = .true. - allocate(this%nind_patch (begp:endp)) ; this%nind_patch (:) = nan - allocate(this%lm_ind_patch (begp:endp)) ; this%lm_ind_patch (:) = nan - allocate(this%lai_ind_patch (begp:endp)) ; this%lai_ind_patch (:) = nan - allocate(this%fpcinc_patch (begp:endp)) ; this%fpcinc_patch (:) = nan - allocate(this%fpcgrid_patch (begp:endp)) ; this%fpcgrid_patch (:) = nan - allocate(this%fpcgridold_patch (begp:endp)) ; this%fpcgridold_patch (:) = nan - allocate(this%crownarea_patch (begp:endp)) ; this%crownarea_patch (:) = nan - allocate(this%greffic_patch (begp:endp)) ; this%greffic_patch (:) = nan - allocate(this%heatstress_patch (begp:endp)) ; this%heatstress_patch (:) = nan - - allocate(dgv_ecophyscon%crownarea_max (0:numpft)) - allocate(dgv_ecophyscon%tcmin (0:numpft)) - allocate(dgv_ecophyscon%tcmax (0:numpft)) - allocate(dgv_ecophyscon%gddmin (0:numpft)) - allocate(dgv_ecophyscon%twmax (0:numpft)) - allocate(dgv_ecophyscon%reinickerp (0:numpft)) - allocate(dgv_ecophyscon%allom1 (0:numpft)) - allocate(dgv_ecophyscon%allom2 (0:numpft)) - allocate(dgv_ecophyscon%allom3 (0:numpft)) - - do m = 0,numpft - dgv_ecophyscon%crownarea_max(m) = pftcon%pftpar20(m) - dgv_ecophyscon%tcmin(m) = pftcon%pftpar28(m) - dgv_ecophyscon%tcmax(m) = pftcon%pftpar29(m) - dgv_ecophyscon%gddmin(m) = pftcon%pftpar30(m) - dgv_ecophyscon%twmax(m) = pftcon%pftpar31(m) - dgv_ecophyscon%reinickerp(m) = reinickerp - dgv_ecophyscon%allom1(m) = allom1 - dgv_ecophyscon%allom2(m) = allom2 - dgv_ecophyscon%allom3(m) = allom3 - ! modification for shrubs by X.D.Z - if (m > ntree .and. m <= nbrdlf_dcd_brl_shrub ) then - dgv_ecophyscon%allom1(m) = allom1s - dgv_ecophyscon%allom2(m) = allom2s - end if - end do - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p ! patch index - !----------------------------------------------------------------------- - - do p = bounds%begp,bounds%endp - this%present_patch(p) = .false. - this%crownarea_patch(p) = 0._r8 - this%nind_patch(p) = 0._r8 - this%agdd20_patch(p) = 0._r8 - this%tmomin20_patch(p) = SHR_CONST_TKFRZ - 5._r8 !initialize this way for Phenology code - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize history variables - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - call hist_addfld1d (fname='AGDD', units='K', & - avgflag='A', long_name='growing degree-days base 5C', & - ptr_patch=this%agdd_patch) - - end subroutine InitHistory - - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use clm_varcon , only : spval - use spmdMod , only : masterproc - use decompMod , only : get_proc_global - use restUtilMod - use ncdio_pio - use pio - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c,p ! indices - logical :: readvar ! determine if variable is on initial file - logical :: do_io ! whether to do i/o for the given variable - integer :: nump_global ! total number of patches, globally - integer :: dimlen ! dimension length - integer :: ier ! error status - integer :: itemp ! temporary - integer , pointer :: iptemp(:) ! pointer to memory to be allocated - integer :: err_code ! error code - !----------------------------------------------------------------------- - - ! Get expected total number of points, for later error checks - call get_proc_global(np=nump_global) - - call restartvar(ncid=ncid, flag=flag, varname='CROWNAREA', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%crownarea_patch) - - call restartvar(ncid=ncid, flag=flag, varname='nind', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%nind_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fpcgrid', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fpcgrid_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fpcgridold', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fpcgridold_patch) - - ! tmomin20 - do_io = .true. - if (flag == 'read') then - ! On a read, confirm that this variable has the expected size; if not, don't - ! read it (instead leave it at its arbitrary initial value). This is needed to - ! support older initial conditions for which this variable had a different size. - call ncd_inqvdlen(ncid, 'TMOMIN20', 1, dimlen, err_code) - if (dimlen /= nump_global) then - do_io = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='TMOMIN20', xtype=ncd_double, & - dim1name='pft', & - long_name='',units='', & - interpinic_flag='interp', readvar=readvar, data=this%tmomin20_patch) - end if - - ! agdd20 - do_io = .true. - if (flag == 'read') then - ! On a read, confirm that this variable has the expected size; if not, don't - ! read it (instead leave it at its arbitrary initial value). This is needed to - ! support older initial conditions for which this variable had a different size. - call ncd_inqvdlen(ncid, 'AGDD20', 1, dimlen, err_code) - if (dimlen /= nump_global) then - do_io = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='AGDD20', xtype=ncd_double, & - dim1name='pft',& - long_name='',units='', & - interpinic_flag='interp', readvar=readvar, data=this%agdd20_patch) - end if - - ! present - if (flag == 'read' .or. flag == 'write') then - allocate (iptemp(bounds%begp:bounds%endp), stat=ier) - end if - if (flag == 'write') then - do p = bounds%begp,bounds%endp - iptemp(p) = 0 - if (this%present_patch(p)) iptemp(p) = 1 - end do - end if - call restartvar(ncid=ncid, flag=flag, varname='present', xtype=ncd_int, & - dim1name='pft',& - long_name='',units='', & - interpinic_flag='interp', readvar=readvar, data=iptemp) - if (flag=='read' .and. readvar) then - do p = bounds%begp,bounds%endp - this%present_patch(p) = .false. - if (iptemp(p) == 1) this%present_patch(p) = .true. - end do - end if - if (flag == 'read' .or. flag == 'write') then - deallocate (iptemp) - end if - - call restartvar(ncid=ncid, flag=flag, varname='heatstress', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%heatstress_patch) - - call restartvar(ncid=ncid, flag=flag, varname='greffic', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%greffic_patch) - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! Each interval and accumulation type is unique to each field processed. - ! Routine [initAccBuffer] defines the fields to be processed - ! and the type of accumulation. - ! Routine [updateCNDVAccVars] does the actual accumulation for a given field. - ! Fields are accumulated by calls to subroutine [update_accum_field]. - ! To accumulate a field, it must first be defined in subroutine [initAccVars] - ! and then accumulated by calls to [updateCNDVAccVars]. - ! - ! This should only be called if use_cndv is true. - ! - ! !USES - use accumulMod , only : init_accum_field - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - - ! - ! !LOCAL VARIABLES: - integer, parameter :: not_used = huge(1) - - !--------------------------------------------------------------------- - - ! The following are accumulated fields. - ! These types of fields are accumulated until a trigger value resets - ! the accumulation to zero (see subroutine update_accum_field). - ! Hence, [accper] is not valid. - - call init_accum_field (name='AGDDTW', units='K', & - desc='growing degree-days base twmax', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='AGDD', units='K', & - desc='growing degree-days base 5C', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! This should only be called if use_cndv is true. - ! - ! !USES - use accumulMod , only : extract_accum_field - use clm_time_manager , only : get_nstep - ! - ! !ARGUMENTS: - class(dgvs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: nstep - integer :: ier ! error status - real(r8), pointer :: rbufslp(:) ! temporary - - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg=" allocation error for rbufslp"//& - errMsg(sourcefile, __LINE__)) - endif - - nstep = get_nstep() - - call extract_accum_field ('AGDDTW', rbufslp, nstep) - this%agddtw_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('AGDD', rbufslp, nstep) - this%agdd_patch(begp:endp) = rbufslp(begp:endp) - - deallocate(rbufslp) - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine UpdateAccVars(this, bounds, t_a10_patch, t_ref2m_patch) - ! - ! !DESCRIPTION: - ! Update accumulated variables. Should be called every time step. - ! - ! This should only be called if use_cndv is true. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - use clm_time_manager , only : get_step_size, get_nstep, get_curr_date - use pftconMod , only : ndllf_dcd_brl_tree - use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal - ! - ! !ARGUMENTS: - class(dgvs_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! COMPILER_BUG(wjs, 2014-11-30, pgi 14.7) These arrays get resized to 0 when running - ! with threading with pgi 14.7 on yellowstone. My standard workarounds weren't - ! working; the only thing that I can find that works is to change them to pointers -! real(r8) , intent(in) :: t_a10_patch( bounds%begp:) ! 10-day running mean of the 2 m temperature (K) -! real(r8) , intent(in) :: t_ref2m_patch( bounds%begp:) ! 2 m height surface air temperature (K) - real(r8), pointer , intent(in) :: t_a10_patch(:) ! 10-day running mean of the 2 m temperature (K) - real(r8), pointer , intent(in) :: t_ref2m_patch(:) ! 2 m height surface air temperature (K) - ! - ! !LOCAL VARIABLES: - integer :: p ! index - integer :: ier ! error status - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: year ! year (0, ...) for nstep - integer :: month ! month (1, ..., 12) for nstep - integer :: day ! day of month (1, ..., 31) for nstep - integer :: secs ! seconds into current date for nstep - integer :: begp, endp - real(r8), pointer :: rbufslp(:) ! temporary single level - patch level - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(t_a10_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_ref2m_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - - dtime = get_step_size() - nstep = get_nstep() - call get_curr_date (year, month, day, secs) - - ! Allocate needed dynamic memory for single level patch field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - ! Accumulate growing degree days based on 10-day running mean temperature. - ! The trigger to reset the accumulated values to zero is -99999. - - ! Accumulate and extract AGDDTW (gdd base twmax, which is 23 deg C - ! for boreal woody patches) - - do p = begp,endp - rbufslp(p) = max(0._r8, & - (t_a10_patch(p) - SHR_CONST_TKFRZ - dgv_ecophyscon%twmax(ndllf_dcd_brl_tree)) & - * dtime/SHR_CONST_CDAY) - if (month==1 .and. day==1 .and. secs==int(dtime)) rbufslp(p) = accumResetVal - end do - call update_accum_field ('AGDDTW', rbufslp, nstep) - call extract_accum_field ('AGDDTW', this%agddtw_patch, nstep) - - ! Accumulate and extract AGDD - - do p = begp,endp - rbufslp(p) = max(0.0_r8, & - (t_ref2m_patch(p) - (SHR_CONST_TKFRZ + 5.0_r8)) * dtime/SHR_CONST_CDAY) - ! - ! Fix (for bug 1858) from Sam Levis to reset the annual AGDD variable - ! - if (month==1 .and. day==1 .and. secs==int(dtime)) rbufslp(p) = accumResetVal - end do - call update_accum_field ('AGDD', rbufslp, nstep) - call extract_accum_field ('AGDD', this%agdd_patch, nstep) - - deallocate(rbufslp) - - end subroutine UpdateAccVars - -end module CNDVType diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 deleted file mode 100644 index a2823fc557..0000000000 --- a/src/biogeochem/CNDriverMod.F90 +++ /dev/null @@ -1,1057 +0,0 @@ -module CNDriverMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Ecosystem dynamics: phenology, vegetation - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : use_c13, use_c14, use_fates, use_dynroot - use dynSubgridControlMod , only : get_do_harvest - use decompMod , only : bounds_type - use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : use_century_decomp, use_nitrif_denitrif, use_nguardrail - use clm_varctl , only : use_crop - use CNSharedParamsMod , only : use_fun - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNProductsMod , only : cn_products_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use CNDVType , only : dgvs_type - use CanopyStateType , only : canopystate_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use atm2lndType , only : atm2lnd_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use PhotosynthesisMod , only : photosyns_type - use ch4Mod , only : ch4_type - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNDriverInit ! Ecosystem dynamics: initialization - public :: CNDriverNoLeaching ! Ecosystem dynamics: phenology, vegetation, before doing N leaching - public :: CNDriverLeaching ! Ecosystem dynamics: phenology, vegetation, doing N leaching - public :: CNDriverSummarizeStates - public :: CNDriverSummarizeFluxes - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNDriverInit(bounds, NLFilename, cnfire_method) - ! - ! !DESCRIPTION: - ! Initialzation of the CN Ecosystem dynamics. - ! - ! !USES: - use CNSharedParamsMod , only : use_fun - use CNPhenologyMod , only : CNPhenologyInit - use CNFireMethodMod , only : cnfire_method_type - use SoilBiogeochemCompetitionMod, only : SoilBiogeochemCompetitionInit - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! Namelist filename - class(cnfire_method_type) , intent(inout) :: cnfire_method - !----------------------------------------------------------------------- - call SoilBiogeochemCompetitionInit(bounds) - call CNPhenologyInit(bounds) - call cnfire_method%CNFireInit(bounds, NLFilename) - - end subroutine CNDriverInit - - !----------------------------------------------------------------------- - subroutine CNDriverNoLeaching(bounds, & - num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, doalb, & - cnveg_state_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & - c_products_inst, c13_products_inst, c14_products_inst, n_products_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, cnfire_method) - ! - ! !DESCRIPTION: - ! The core CN code is executed here. Calculates fluxes for maintenance - ! respiration, decomposition, allocation, phenology, and growth respiration. - ! These routines happen on the radiation time step so that canopy structure - ! stays synchronized with albedo calculations. - ! - ! !USES: - use clm_varpar , only: nlevgrnd, nlevdecomp_full - use clm_varpar , only: nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use subgridAveMod , only: p2c, p2c_2d - use CropType , only: crop_type - use CNNDynamicsMod , only: CNNDeposition,CNNFixation, CNNFert, CNSoyfix,CNFreeLivingFixation - use CNMRespMod , only: CNMResp - use CNFUNMod , only: CNFUNInit !, CNFUN - use CNPhenologyMod , only: CNPhenology - use CNGRespMod , only: CNGResp - use CNFireMethodMod , only: cnfire_method_type - use CNCIsoFluxMod , only: CIsoFlux1, CIsoFlux2, CIsoFlux2h, CIsoFlux3 - use CNC14DecayMod , only: C14Decay - use CNCStateUpdate1Mod , only: CStateUpdate1,CStateUpdate0 - use CNCStateUpdate2Mod , only: CStateUpdate2, CStateUpdate2h - use CNCStateUpdate3Mod , only: CStateUpdate3 - use CNNStateUpdate1Mod , only: NStateUpdate1 - use CNNStateUpdate2Mod , only: NStateUpdate2, NStateUpdate2h - use CNGapMortalityMod , only: CNGapMortality - use CNSharedParamsMod , only: use_fun - use dynHarvestMod , only: CNHarvest - use SoilBiogeochemDecompCascadeBGCMod , only: decomp_rate_constants_bgc - use SoilBiogeochemDecompCascadeCNMod , only: decomp_rate_constants_cn - use SoilBiogeochemCompetitionMod , only: SoilBiogeochemCompetition - use SoilBiogeochemDecompMod , only: SoilBiogeochemDecomp - use SoilBiogeochemLittVertTranspMod , only: SoilBiogeochemLittVertTransp - use SoilBiogeochemPotentialMod , only: SoilBiogeochemPotential - use SoilBiogeochemVerticalProfileMod , only: SoilBiogeochemVerticalProfile - use SoilBiogeochemNitrifDenitrifMod , only: SoilBiogeochemNitrifDenitrif - use SoilBiogeochemNStateUpdate1Mod , only: SoilBiogeochemNStateUpdate1 - use NutrientCompetitionMethodMod , only: nutrient_competition_method_type - use CNRootDynMod , only: CNRootDyn - use CNPrecisionControlMod , only: CNPrecisionControl - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter - integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches - logical , intent(in) :: doalb ! true = surface albedo calculation time step - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cn_products_type) , intent(inout) :: c_products_inst - type(cn_products_type) , intent(inout) :: c13_products_inst - type(cn_products_type) , intent(inout) :: c14_products_inst - type(cn_products_type) , intent(inout) :: n_products_inst - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(crop_type) , intent(inout) :: crop_inst - type(ch4_type) , intent(in) :: ch4_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - type(photosyns_type) , intent(in) :: photosyns_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(energyflux_type) , intent(in) :: energyflux_inst - class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method - class(cnfire_method_type) , intent(inout) :: cnfire_method - ! - ! !LOCAL VARIABLES: - real(r8):: cn_decomp_pools(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_pools) - real(r8):: p_decomp_cpool_loss(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_cascade_transitions) !potential C loss from one pool to another - real(r8):: pmnf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_cascade_transitions) !potential mineral N flux, from one pool to another - real(r8):: arepr(bounds%begp:bounds%endp) ! reproduction allocation coefficient (only used for use_crop) - real(r8):: aroot(bounds%begp:bounds%endp) ! root allocation coefficient (only used for use_crop) - integer :: begp,endp - integer :: begc,endc - - integer :: dummy_to_make_pgi_happy - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - !real(r8) , intent(in) :: rootfr_patch(bounds%begp:, 1:) - !integer , intent(in) :: altmax_lastyear_indx_col(bounds%begc:) ! frost table depth (m) - - associate( & - crootfr_patch => soilstate_inst%crootfr_patch , & ! fraction of roots for carbon in each soil layer (nlevgrnd) - altmax_lastyear_indx_col => canopystate_inst%altmax_lastyear_indx_col , & ! frost table depth (m) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch , & ! Output: [integer (:) ] frac of vegetation not covered by snow [-] - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow - elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index with burying by snow - htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) - hbot => canopystate_inst%hbot_patch & ! Output: [real(r8) (:) ] canopy bottom (m) - ) - - ! -------------------------------------------------- - ! zero the column-level C and N fluxes - ! -------------------------------------------------- - - call t_startf('CNZero') - - ! COMPILER_BUG(wjs, 2014-11-29, pgi 14.7) Without this, the filter is full of garbage - ! in some situations - dummy_to_make_pgi_happy = ubound(filter_soilc, 1) - call soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - end if - - call cnveg_carbonflux_inst%SetValues( & - num_soilp, filter_soilp, 0._r8, & - num_soilc, filter_soilc, 0._r8) - if ( use_c13 ) then - call c13_cnveg_carbonflux_inst%SetValues( & - num_soilp, filter_soilp, 0._r8, & - num_soilc, filter_soilc, 0._r8) - end if - if ( use_c14 ) then - call c14_cnveg_carbonflux_inst%SetValues( & - num_soilp, filter_soilp, 0._r8, & - num_soilc, filter_soilc, 0._r8) - end if - - call cnveg_nitrogenflux_inst%SetValues( & - num_soilp, filter_soilp, 0._r8, & - num_soilc, filter_soilc, 0._r8) - - call soilbiogeochem_nitrogenflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - - call t_stopf('CNZero') - - ! -------------------------------------------------- - ! Nitrogen Deposition, Fixation and Respiration - ! -------------------------------------------------- - - call t_startf('CNDeposition') - call CNNDeposition(bounds, & - atm2lnd_inst, soilbiogeochem_nitrogenflux_inst) - call t_stopf('CNDeposition') - - if(use_fun)then - call t_startf('CNFLivFixation') - call CNFreeLivingFixation( num_soilc, filter_soilc, & - waterflux_inst, soilbiogeochem_nitrogenflux_inst) - call t_stopf('CNFLivFixation') - else - call t_startf('CNFixation') - call CNNFixation( num_soilc, filter_soilc, & - cnveg_carbonflux_inst, soilbiogeochem_nitrogenflux_inst) - call t_stopf('CNFixation') - end if - - - if (use_crop) then - call CNNFert(bounds, num_soilc,filter_soilc, & - cnveg_nitrogenflux_inst, soilbiogeochem_nitrogenflux_inst) - - if (.not. use_fun) then ! if FUN is active, then soy fixation handled by FUN - call CNSoyfix (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - waterstate_inst, crop_inst, cnveg_state_inst, cnveg_nitrogenflux_inst , & - soilbiogeochem_state_inst, soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - end if - end if - - call t_startf('CNMResp') - call CNMResp(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - canopystate_inst, soilstate_inst, temperature_inst, photosyns_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenstate_inst) - call t_stopf('CNMResp') - - !-------------------------------------------- - ! Soil Biogeochemistry - !-------------------------------------------- - - call t_startf('SoilBiogeochem') - if (use_century_decomp) then - call decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - else - call decomp_rate_constants_cn(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - end if - - ! calculate potential decomp rates and total immobilization demand (previously inlined in CNDecompAlloc) - call SoilBiogeochemPotential (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools=cn_decomp_pools(begc:endc,1:nlevdecomp,1:ndecomp_pools), & - p_decomp_cpool_loss=p_decomp_cpool_loss(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions), & - pmnf_decomp_cascade=pmnf_decomp_cascade(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions)) - - ! calculate vertical profiles for distributing soil and litter C and N (previously subroutine decomp_vertprofiles called from CNDecompAlloc) - call SoilBiogeochemVerticalProfile(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - canopystate_inst, soilstate_inst,soilbiogeochem_state_inst) - - ! calculate nitrification and denitrification rates (previously subroutine nitrif_denitrif called from CNDecompAlloc) - if (use_nitrif_denitrif) then - call SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, & - soilstate_inst, waterstate_inst, temperature_inst, ch4_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - end if - call t_stopf('SoilBiogeochem') - - !-------------------------------------------- - ! Resolve the competition between plants and soil heterotrophs - ! for available soil mineral N resource - !-------------------------------------------- - - call t_startf('CNDecompAlloc') - - ! Jinyun Tang: at this stage, the plant_nutrient_demand only calculates the plant ntirgeon demand. - ! Assume phosphorus dynamics will be included in the future. Also, I consider plant_nutrient_demand - ! as a generic interface to call actual nutrient calculation from different aboveground plantbgc. - ! Right now it is assumed the plant nutrient demand is summarized into columnwise demand, and the - ! nutrient redistribution after uptake is done by the plant bgc accordingly. - ! When nutrient competition is required to be done at cohort level both plant_nutrient_demand and - ! do_nutrient_competition should be modified, but that modification should not significantly change - ! the current interface. - - !RF: moved ths call to before nutrient_demand, so that croplive didn't change half way through crop N cycle. - if ( use_fun ) then - call t_startf('CNPhenology_phase1') - call CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, & - filter_soilp, num_pcropp, filter_pcropp, & - doalb, waterstate_inst, temperature_inst, atm2lnd_inst, & - crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), & - phase=1) - call t_stopf('CNPhenology_phase1') - - call t_startf('CNFUNInit') - call CNFUNInit(bounds,cnveg_state_inst,cnveg_carbonstate_inst,cnveg_nitrogenstate_inst) - call t_stopf('CNFUNInit') - - end if - - call t_startf('calc_plant_nutrient_demand') - call nutrient_competition_method%calc_plant_nutrient_demand ( & - bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot=aroot(begp:endp), arepr=arepr(begp:endp)) - - ! get the column-averaged plant_ndemand (needed for following call to SoilBiogeochemCompetition) - - call p2c(bounds, num_soilc, filter_soilc, & - cnveg_nitrogenflux_inst%plant_ndemand_patch(begp:endp), & - soilbiogeochem_state_inst%plant_ndemand_col(begc:endc)) - call t_stopf('calc_plant_nutrient_demand') - - ! resolve plant/heterotroph competition for mineral N - - - call t_startf('soilbiogeochemcompetition') - call SoilBiogeochemCompetition (bounds, num_soilc, filter_soilc,num_soilp, filter_soilp, waterstate_inst, & - waterflux_inst,temperature_inst,soilstate_inst,cnveg_state_inst, & - cnveg_carbonstate_inst ,& - cnveg_carbonflux_inst,cnveg_nitrogenstate_inst,cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst,& - soilbiogeochem_state_inst,soilbiogeochem_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst,canopystate_inst) - call t_stopf('soilbiogeochemcompetition') - - ! distribute the available N between the competing patches on the basis of - ! relative demand, and allocate C and N to new growth and storage - - call t_startf('calc_plant_nutrient_competition') - call nutrient_competition_method%calc_plant_nutrient_competition ( & - bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot=aroot(begp:endp), & - arepr=arepr(begp:endp), & - fpg_col=soilbiogeochem_state_inst%fpg_col(begc:endc)) - call t_stopf('calc_plant_nutrient_competition') - - call t_stopf('CNDecompAlloc') - - !-------------------------------------------- - ! Calculate litter and soil decomposition rate - !-------------------------------------------- - - ! Calculation of actual immobilization and decomp rates, following - ! resolution of plant/heterotroph competition for mineral N (previously inlined in CNDecompAllocation in CNDecompMod) - - call t_startf('SoilBiogeochemDecomp') - - call SoilBiogeochemDecomp (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools=cn_decomp_pools(begc:endc,1:nlevdecomp,1:ndecomp_pools), & - p_decomp_cpool_loss=p_decomp_cpool_loss(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions), & - pmnf_decomp_cascade=pmnf_decomp_cascade(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions)) - - call t_stopf('SoilBiogeochemDecomp') - - !-------------------------------------------- - ! Phenology - !-------------------------------------------- - - ! CNphenology needs to be called after above calls, since it depends on current - ! time-step fluxes to new growth on the lastlitterfall timestep in deciduous systems - - call t_startf('CNPhenology') - - if ( .not. use_fun ) then - call CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, & - filter_soilp, num_pcropp, filter_pcropp, & - doalb, waterstate_inst, temperature_inst, atm2lnd_inst, & - crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), & - phase=1) - end if - call CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, & - filter_soilp, num_pcropp, filter_pcropp, & - doalb, waterstate_inst, temperature_inst, atm2lnd_inst, & - crop_inst, canopystate_inst, soilstate_inst, dgvs_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp,1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp,1:nlevdecomp_full), & - phase=2) - - call t_stopf('CNPhenology') - - !-------------------------------------------- - ! Growth respiration - !-------------------------------------------- - - call t_startf('CNGResp') - - call CNGResp(num_soilp, filter_soilp,& - cnveg_carbonflux_inst, canopystate_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - - call t_stopf('CNGResp') - - !-------------------------------------------- - ! Dynamic Roots - !-------------------------------------------- - - if( use_dynroot ) then - call t_startf('CNRootDyn') - - call CNRootDyn(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, & - cnveg_state_inst, crop_inst, soilstate_inst, soilbiogeochem_nitrogenstate_inst) - - call t_stopf('CNRootDyn') - end if - - !-------------------------------------------- - ! CNUpdate0 - !-------------------------------------------- - - call t_startf('CNUpdate0') - - call CStateUpdate0(num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst) - - if ( use_c13 ) then - call CStateUpdate0(num_soilp, filter_soilp, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst) - end if - - if ( use_c14 ) then - call CStateUpdate0(num_soilp, filter_soilp, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst) - end if - - call t_stopf('CNUpdate0') - - if ( use_nguardrail ) then - call t_startf('CNPrecisionControl') - call CNPrecisionControl(bounds, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, & - c14_cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - call t_stopf('CNPrecisionControl') - end if - !-------------------------------------------- - ! Update1 - !-------------------------------------------- - - call t_startf('CNUpdate1') - - ! Set the carbon isotopic flux variables (except for gap-phase mortality and fire fluxes) - if ( use_c13 ) then - - call CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - isotope='c13') - end if - if ( use_c14 ) then - call CIsoFlux1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - isotope='c14') - end if - - ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) - call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & - crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) - if ( use_c13 ) then - call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - crop_inst, c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst) - end if - if ( use_c14 ) then - call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - crop_inst, c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst) - end if - - ! Update all prognostic nitrogen state variables (except for gap-phase mortality and fire fluxes) - call NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - - call t_stopf('CNUpdate1') - - if ( use_nguardrail ) then - call t_startf('CNPrecisionControl') - call CNPrecisionControl(bounds, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, & - c14_cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - call t_stopf('CNPrecisionControl') - end if - - call t_startf('SoilBiogeochemStateUpdate1') - call SoilBiogeochemNStateUpdate1(num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - call t_stopf('SoilBiogeochemStateUpdate1') - - - !-------------------------------------------- - ! Calculate vertical mixing of soil and litter pools - !-------------------------------------------- - - call t_startf('SoilBiogeochemLittVertTransp') - - call SoilBiogeochemLittVertTransp(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilbiogeochem_state_inst, & - soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - - call t_stopf('SoilBiogeochemLittVertTransp') - - !-------------------------------------------- - ! Calculate the gap mortality carbon and nitrogen fluxes - !-------------------------------------------- - - call t_startf('CNGapMortality') - - call CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, canopystate_inst, & - !cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp, 1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp, 1:nlevdecomp_full), & - croot_prof_patch=soilbiogeochem_state_inst%croot_prof_patch(begp:endp, 1:nlevdecomp_full), & - stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp, 1:nlevdecomp_full)) - - call t_stopf('CNGapMortality') - - !-------------------------------------------- - ! Update2 (gap mortality) - !-------------------------------------------- - - call t_startf('CNUpdate2') - - ! Set the carbon isotopic fluxes for gap mortality - if ( use_c13 ) then - call CIsoFlux2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_cnveg_carbonflux_inst=c13_cnveg_carbonflux_inst, & - iso_cnveg_carbonstate_inst=c13_cnveg_carbonstate_inst, & - isotope='c13') - end if - if ( use_c14 ) then - call CIsoFlux2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - iso_cnveg_carbonflux_inst=c14_cnveg_carbonflux_inst, & - iso_cnveg_carbonstate_inst=c14_cnveg_carbonstate_inst, & - isotope='c14') - end if - - ! Update all the prognostic carbon state variables affected by gap-phase mortality fluxes - call CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - if ( use_c13 ) then - call CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst) - end if - if ( use_c14 ) then - call CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) - end if - - ! Update all the prognostic nitrogen state variables affected by gap-phase mortality fluxes - call NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) - - !-------------------------------------------- - ! Update2h (harvest) - !-------------------------------------------- - - ! Set harvest mortality routine - if (get_do_harvest()) then - call CNHarvest(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - end if - - if ( use_c13 ) then - call CIsoFlux2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - isotope='c13') - end if - if ( use_c14 ) then - call CIsoFlux2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - isotope='c14') - end if - - call CStateUpdate2h( num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - if ( use_c13 ) then - call CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst) - end if - if ( use_c14 ) then - call CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) - end if - - call NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) - call t_stopf('CNUpdate2') - - if ( use_nguardrail ) then - call t_startf('CNPrecisionControl') - call CNPrecisionControl(bounds, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, & - c14_cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - call t_stopf('CNPrecisionControl') - end if - !-------------------------------------------- - ! Calculate loss fluxes from wood products pools - ! and update product pool state variables - !-------------------------------------------- - - call t_startf('CNWoodProducts') - call c_products_inst%UpdateProducts(bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch = cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(begp:endp), & - wood_harvest_patch = cnveg_carbonflux_inst%wood_harvestc_patch(begp:endp), & - dwt_crop_product_gain_patch = cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(begp:endp), & - grain_to_cropprod_patch = cnveg_carbonflux_inst%grainc_to_cropprodc_patch(begp:endp)) - call t_stopf('CNWoodProducts') - - if (use_c13) then - call c13_products_inst%UpdateProducts(bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch = c13_cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(begp:endp), & - wood_harvest_patch = c13_cnveg_carbonflux_inst%wood_harvestc_patch(begp:endp), & - dwt_crop_product_gain_patch = c13_cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(begp:endp), & - grain_to_cropprod_patch = c13_cnveg_carbonflux_inst%grainc_to_cropprodc_patch(begp:endp)) - end if - - if (use_c14) then - call c14_products_inst%UpdateProducts(bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch = c14_cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(begp:endp), & - wood_harvest_patch = c14_cnveg_carbonflux_inst%wood_harvestc_patch(begp:endp), & - dwt_crop_product_gain_patch = c14_cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(begp:endp), & - grain_to_cropprod_patch = c14_cnveg_carbonflux_inst%grainc_to_cropprodc_patch(begp:endp)) - end if - - call n_products_inst%UpdateProducts(bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch = cnveg_nitrogenflux_inst%dwt_wood_productn_gain_patch(begp:endp), & - wood_harvest_patch = cnveg_nitrogenflux_inst%wood_harvestn_patch(begp:endp), & - dwt_crop_product_gain_patch = cnveg_nitrogenflux_inst%dwt_crop_productn_gain_patch(begp:endp), & - grain_to_cropprod_patch = cnveg_nitrogenflux_inst%grainn_to_cropprodn_patch(begp:endp)) - - !-------------------------------------------- - ! Calculate fire area and fluxes - !-------------------------------------------- - - call t_startf('CNFire') - call cnfire_method%CNFireArea(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, & - totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & - decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & - t_soi17cm_col=temperature_inst%t_soi17cm_col(begc:endc)) - - call cnfire_method%CNFireFluxes(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch=soilbiogeochem_state_inst%leaf_prof_patch(begp:endp, 1:nlevdecomp_full), & - froot_prof_patch=soilbiogeochem_state_inst%froot_prof_patch(begp:endp, 1:nlevdecomp_full), & - croot_prof_patch=soilbiogeochem_state_inst%croot_prof_patch(begp:endp, 1:nlevdecomp_full), & - stem_prof_patch=soilbiogeochem_state_inst%stem_prof_patch(begp:endp, 1:nlevdecomp_full), & - totsomc_col=soilbiogeochem_carbonstate_inst%totsomc_col(begc:endc), & - decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & - decomp_npools_vr_col=soilbiogeochem_nitrogenstate_inst%decomp_npools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & - somc_fire_col=soilbiogeochem_carbonflux_inst%somc_fire_col(begc:endc)) - call t_stopf('CNFire') - - - !-------------------------------------------- - ! Update3 - !-------------------------------------------- - - call t_startf('CNUpdate3') - if ( use_c13 ) then - call CIsoFlux3(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst , soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - isotope='c13') - end if - if ( use_c14 ) then - call CIsoFlux3(num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst , soilbiogeochem_carbonstate_inst, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - isotope='c14') - end if - - call CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) - - if ( use_c13 ) then - call CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst) - end if - - if ( use_c14 ) then - call CStateUpdate3( num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) - - call C14Decay(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) - end if - call t_stopf('CNUpdate3') - - if ( use_nguardrail ) then - call t_startf('CNPrecisionControl') - call CNPrecisionControl(bounds, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, & - c14_cnveg_carbonstate_inst, cnveg_nitrogenstate_inst) - call t_stopf('CNPrecisionControl') - end if - - end associate - - end subroutine CNDriverNoLeaching - - !----------------------------------------------------------------------- - subroutine CNDriverLeaching(bounds, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - waterstate_inst, waterflux_inst, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Update the nitrogen leaching rate as a function of soluble mineral N and total soil water outflow. - ! Also update nitrogen state variables - ! - ! !USES: - use SoilBiogeochemNLeachingMod, only: SoilBiogeochemNLeaching - use CNNStateUpdate3Mod , only: NStateUpdate3 - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - !----------------------------------------------------------------------- - - ! Mineral nitrogen dynamics (deposition, fixation, leaching) - - call t_startf('SoilBiogeochemNLeaching') - call SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & - waterstate_inst, waterflux_inst, soilbiogeochem_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst) - call t_stopf('SoilBiogeochemNLeaching') - - ! Nitrogen state variable update, mortality fluxes. - - call t_startf('NUpdate3') - - call NstateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - - call t_stopf('NUpdate3') - - end subroutine CNDriverLeaching - - !----------------------------------------------------------------------- - subroutine CNDriverSummarizeStates(bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - cnveg_nitrogenstate_inst, & - soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Call to all CN and SoilBiogeochem summary routines, for state variables - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: begc,endc - - character(len=*), parameter :: subname = 'CNDriverSummarizeStates' - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - call t_startf('CNsum') - - ! ---------------------------------------------- - ! soilbiogeochem carbon/nitrogen state summary - ! ---------------------------------------------- - - call soilbiogeochem_carbonstate_inst%summary(bounds, num_allc, filter_allc) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonstate_inst%summary(bounds, num_allc, filter_allc) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonstate_inst%summary(bounds, num_allc, filter_allc) - end if - call soilbiogeochem_nitrogenstate_inst%summary(bounds, num_allc, filter_allc) - - ! ---------------------------------------------- - ! cnveg carbon/nitrogen state summary - ! ---------------------------------------------- - - call cnveg_carbonstate_inst%Summary(bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_cwdc_col=soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), & - soilbiogeochem_totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & - soilbiogeochem_totsomc_col=soilbiogeochem_carbonstate_inst%totsomc_col(begc:endc), & - soilbiogeochem_ctrunc_col=soilbiogeochem_carbonstate_inst%ctrunc_col(begc:endc)) - - if ( use_c13 ) then - call c13_cnveg_carbonstate_inst%Summary(bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_cwdc_col=c13_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), & - soilbiogeochem_totlitc_col=c13_soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & - soilbiogeochem_totsomc_col=c13_soilbiogeochem_carbonstate_inst%totsomc_col(begc:endc), & - soilbiogeochem_ctrunc_col=c13_soilbiogeochem_carbonstate_inst%ctrunc_col(begc:endc)) - end if - - if ( use_c14 ) then - call c14_cnveg_carbonstate_inst%Summary(bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_cwdc_col=c14_soilbiogeochem_carbonstate_inst%cwdc_col(begc:endc), & - soilbiogeochem_totlitc_col=c14_soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & - soilbiogeochem_totsomc_col=c14_soilbiogeochem_carbonstate_inst%totsomc_col(begc:endc), & - soilbiogeochem_ctrunc_col=c14_soilbiogeochem_carbonstate_inst%ctrunc_col(begc:endc)) - end if - - call cnveg_nitrogenstate_inst%Summary(bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_nitrogenstate_inst) - - call t_stopf('CNsum') - - end subroutine CNDriverSummarizeStates - - !----------------------------------------------------------------------- - subroutine CNDriverSummarizeFluxes(bounds, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenflux_inst, & - c_products_inst, c13_products_inst, c14_products_inst, & - soilbiogeochem_carbonflux_inst, & - c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Call to all CN and SoilBiogeochem summary routines, for state variables - ! - ! !USES: - use clm_varpar , only: ndecomp_cascade_transitions - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cn_products_type) , intent(in) :: c_products_inst - type(cn_products_type) , intent(in) :: c13_products_inst - type(cn_products_type) , intent(in) :: c14_products_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: begc,endc - integer :: begg,endg - - character(len=*), parameter :: subname = 'CNDriverSummarizeFluxes' - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg = bounds%endg - - call t_startf('CNsum') - - ! ---------------------------------------------- - ! soilbiogeochem carbon/nitrogen flux summary - ! ---------------------------------------------- - - call soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - end if - call soilbiogeochem_nitrogenflux_inst%Summary(bounds, num_soilc, filter_soilc) - - ! ---------------------------------------------- - ! cnveg carbon/nitrogen flux summary - ! ---------------------------------------------- - - call cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - isotope='bulk', & - soilbiogeochem_hr_col=soilbiogeochem_carbonflux_inst%hr_col(begc:endc), & - soilbiogeochem_lithr_col=soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), & - soilbiogeochem_decomp_cascade_ctransfer_col=& - soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), & - product_closs_grc=c_products_inst%product_loss_grc(begg:endg)) - - if ( use_c13 ) then - call c13_cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - isotope='c13', & - soilbiogeochem_hr_col=c13_soilbiogeochem_carbonflux_inst%hr_col(begc:endc), & - soilbiogeochem_lithr_col=c13_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), & - soilbiogeochem_decomp_cascade_ctransfer_col=& - c13_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), & - product_closs_grc=c13_products_inst%product_loss_grc(begg:endg)) - end if - - if ( use_c14 ) then - call c14_cnveg_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - isotope='c14', & - soilbiogeochem_hr_col=c14_soilbiogeochem_carbonflux_inst%hr_col(begc:endc), & - soilbiogeochem_lithr_col=c14_soilbiogeochem_carbonflux_inst%lithr_col(begc:endc), & - soilbiogeochem_decomp_cascade_ctransfer_col=& - c14_soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions), & - product_closs_grc=c14_products_inst%product_loss_grc(begg:endg)) - end if - - call cnveg_nitrogenflux_inst%Summary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp) - - call t_stopf('CNsum') - - end subroutine CNDriverSummarizeFluxes - -end module CNDriverMod diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 deleted file mode 100644 index f1adee8f6b..0000000000 --- a/src/biogeochem/CNFUNMod.F90 +++ /dev/null @@ -1,1801 +0,0 @@ -module CNFUNMod -!-------------------------------------------------------------------- - !--- -! ! DESCRIPTION -! ! The FUN model developed by Fisher et al. 2010 and -! ! end Brzostek et al. 2014. Coded by Mingjie Shi 2015. -! ! Coding logic and structure altered by Rosie Fisher. October 2015. -! ! Critically, this removes the 'FUN-resistors' idea of Brzostek et - ! al. 2014 -! ! and replaces it with uptake that is proportional to the N/C - ! exchange rate. -! ! and adjusts the logic so that FUN does not depends upon the - ! CLM4.0 'FPG' downregulation idea -! ! and instead it takes C spent on N uptake away from growth. -! ! The critical output so fthis code are sminn_to_plant_fun and - ! npp_Nuptake, which are the N -! ! available to the plant for grwoth, and the C spent on obtaining - ! it. - -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use PatchType , only : patch - use ColumnType , only : col - use pftconMod , only : pftcon, npcropmin - use decompMod , only : bounds_type - use clm_varctl , only : use_nitrif_denitrif,use_flexiblecn - use abortutils , only : endrun - use CNVegstateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use CNVegnitrogenfluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use WaterStateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use TemperatureType , only : temperature_type - use SoilStateType , only : soilstate_type - use CanopyStateType , only : canopystate_type - use perf_mod , only : t_startf, t_stopf - - implicit none - private -! -! !PUBLIC MEMBER FUNCTIONS: - public:: readParams ! Read in parameters needed for FUN - public:: CNFUNInit ! FUN calculation initialization - public:: CNFUN ! Run FUN - - type, private :: params_type - real(r8) :: ndays_on ! number of days to complete leaf onset - real(r8) :: ndays_off ! number of days to complete leaf offset - end type params_type - - ! - type(params_type), private :: params_inst ! params_inst is - ! populated in readParamsMod - ! - ! - ! !PRIVATE DATA MEMBERS: - real(r8) :: dt ! decomp timestep (seconds) - real(r8) :: ndays_on ! number of days to complete onset - real(r8) :: ndays_off ! number of days to complete offset - - integer, private, parameter :: COST_METHOD = 2 !new way of doing the N uptake - ! resistances. see teamwork thread on over-cheap uptake in N - ! resistors. - integer, private, parameter :: nstp = 2 ! Number of - ! calculation part - integer, private, parameter :: ncost6 = 6 ! Number of - ! N transport pathways - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -! -!-------------------------------------------------------------------- - !--- - contains -!-------------------------------------------------------------------- - !--- - subroutine readParams ( ncid ) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNFUNParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading -!-------------------------------------------------------------------- - !--- - - ! read in parameters - - tString='ndays_on' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ndays_on=tempr - - tString='ndays_off' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ndays_off=tempr - - - end subroutine readParams - -!-------------------------------------------------------------------- - !--- - subroutine CNFUNInit (bounds,cnveg_state_inst,cnveg_carbonstate_inst,cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! - ! !USES: - use clm_varcon , only: secspday, fun_period - use clm_time_manager, only: get_step_size,get_nstep,get_curr_date,get_days_per_year - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type), intent(inout) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: dayspyr ! days per year (days) - real(r8) :: timestep_fun ! Timestep length for - ! FUN (s) - real(r8) :: numofyear ! number of days per - ! year - integer :: nstep ! time step number - integer :: nstep_fun ! Number of - ! atmospheric timesteps between calls to FUN - character(len=32) :: subname = 'CNFUNInit' -!-------------------------------------------------------------------- - !--- - -! Set local pointers - associate(ivt => patch%itype , & ! Input: [integer (:) ] p - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - leafcn_offset => cnveg_state_inst%leafcn_offset_patch , & ! Output: - ! [real(r8) (:) ] Leaf C:N used by FUN - leafc_storage_xfer_acc => cnveg_carbonstate_inst%leafc_storage_xfer_acc_patch , & ! Output: [real(r8) (:) - ! ] Accmulated leaf C transfer (gC/m2) - storage_cdemand => cnveg_carbonstate_inst%storage_cdemand_patch , & ! Output: [real(r8) (:) - ! ] C use from the C storage pool - leafn_storage_xfer_acc => cnveg_nitrogenstate_inst%leafn_storage_xfer_acc_patch, & ! Output: [real(r8) (:) - ! ] Accmulated leaf N transfer (gC/m2) - storage_ndemand => cnveg_nitrogenstate_inst%storage_ndemand_patch & ! Output: [real(r8) (:) - ! ] N demand during the offset period - ) - !-------------------------------------------------------------------- - !--- - ! Calculate some timestep-related values. - !-------------------------------------------------------------------- - !--- - ! set time steps - dt = real(get_step_size(), r8) - dayspyr = get_days_per_year() - nstep = get_nstep() - timestep_fun = real(secspday * fun_period) - nstep_fun = int(secspday * dayspyr / dt) - - ndays_on = params_inst%ndays_on - ndays_off = params_inst%ndays_off - - !-------------------------------------------------------------------- - !--- - ! Decide if FUN will be called on this timestep. - !-------------------------------------------------------------------- - !--- - numofyear = nstep/nstep_fun - if (mod(nstep,nstep_fun) == 0) then - leafcn_offset(bounds%begp:bounds%endp) = leafcn(ivt(bounds%begp:bounds%endp)) - storage_cdemand(bounds%begp:bounds%endp) = 0._r8 - storage_ndemand(bounds%begp:bounds%endp) = 0._r8 - leafn_storage_xfer_acc(bounds%begp:bounds%endp) = 0._r8 - leafc_storage_xfer_acc(bounds%begp:bounds%endp) = 0._r8 - end if -!-------------------------------------------------------------------- - !--- - end associate - end subroutine CNFUNInit -!-------------------------------------------------------------------- - !--- - - !-------------------------------------------------------------------- - !--- - ! Start the CNFUN subroutine - !-------------------------------------------------------------------- - !--- - subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp& - &,filter_soilp,waterstate_inst ,& - & waterflux_inst,temperature_inst,soilstate_inst& - &,cnveg_state_inst,cnveg_carbonstate_inst,& - & cnveg_carbonflux_inst,cnveg_nitrogenstate_inst& - &,cnveg_nitrogenflux_inst ,& - & soilbiogeochem_nitrogenflux_inst& - &,soilbiogeochem_carbonflux_inst,canopystate_inst,& - & soilbiogeochem_nitrogenstate_inst) - -! !USES: - use clm_time_manager, only : get_step_size, get_curr_date, get_days_per_year - use clm_varpar , only : nlevdecomp - use clm_varcon , only : secspday, smallValue, fun_period, tfrz, dzsoi_decomp, spval - use clm_varctl , only : use_nitrif_denitrif - use PatchType , only : patch - use subgridAveMod , only : p2c - use pftconMod , only : npcropmin -! -! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(temperature_type) , intent(in) :: temperature_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - ! local pointers to implicit in arrays - ! - !-------------------------------------------------------------------- - ! ------------ - ! Integer parameters - !-------------------------------------------------------------------- - !----------- - integer, parameter :: icostFix = 1 ! Process - ! number for fixing. - integer, parameter :: icostRetrans = 2 ! Process - ! number for retranslocation. - integer, parameter :: icostActiveNO3 = 3 ! Process - ! number for mycorrhizal uptake of NO3. - integer, parameter :: icostActiveNH4 = 4 ! Process - ! number for mycorrhizal uptake of NH4 - integer, parameter :: icostnonmyc_no3 = 5 ! Process - ! number for nonmyc uptake of NO3. - integer, parameter :: icostnonmyc_nh4 = 6 ! Process - ! number for nonmyc uptake of NH4. - real(r8), parameter :: big_cost = 1000000000._r8! An arbitrarily large cost - - ! array index when plant is fixing - integer, parameter :: plants_are_fixing = 1 - integer, parameter :: plants_not_fixing = 2 - - ! array index for ECM step versus AM step - integer, parameter :: ecm_step = 1 - integer, parameter :: am_step = 2 - ! arbitrary large cost (gC/gN). - !-------------------------------------------------------------------- - !----------------------------------------------- - ! Local Real variables. - !-------------------------------------------------------------------- - !----------------------------------------------- - real(r8) :: excess ! excess N taken up by transpiration (gN/m2) - real(r8) :: steppday ! model time steps in each day (-) - real(r8) :: rootc_dens_step ! root C for each PFT in each soil layer(gC/m2) - real(r8) :: retrans_limit1 ! a temporary variable for leafn (gN/m2) - real(r8) :: qflx_tran_veg_layer ! transpiration in each soil layer (mm H2O/S) - real(r8) :: dn ! Increment of N (gN/m2) - real(r8) :: dn_retrans ! Increment of N (gN/m2) - real(r8) :: dnpp ! Increment of NPP (gC/m2) - real(r8) :: dnpp_retrans ! Increment of NPP (gC/m2) - real(r8) :: rootc_dens(bounds%begp:bounds%endp,1:nlevdecomp) ! the root carbon density (gC/m2) - real(r8) :: rootC(bounds%begp:bounds%endp) ! root biomass (gC/m2) - real(r8) :: permyc(bounds%begp:bounds%endp,1:nstp) ! the arrary for the ECM and AM ratio (-) - real(r8) :: kc_active(bounds%begp:bounds%endp,1:nstp) ! the kc_active parameter (gC/m2) - real(r8) :: kn_active(bounds%begp:bounds%endp,1:nstp) ! the kn_active parameter (gC/m2) - real(r8) :: availc_pool(bounds%begp:bounds%endp) ! The avaible C pool for allocation (gC/m2) - real(r8) :: plantN(bounds%begp:bounds%endp) ! Plant N (gN/m2) - real(r8) :: plant_ndemand_pool(bounds%begp:bounds%endp) ! The N demand pool (gN/m2) - real(r8) :: plant_ndemand_pool_step(bounds%begp:bounds%endp,1:nstp) ! the N demand pool (gN/m2) - real(r8) :: leafn_step(bounds%begp:bounds%endp,1:nstp) ! N loss based for deciduous trees (gN/m2) - real(r8) :: leafn_retrans_step(bounds%begp:bounds%endp,1:nstp) ! N loss based for deciduous trees (gN/m2) - real(r8) :: litterfall_n(bounds%begp:bounds%endp) ! N loss based on the leafc to litter (gN/m2) - real(r8) :: litterfall_n_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) - real(r8) :: litterfall_c_step(bounds%begp:bounds%endp,1:nstp) ! N loss based on the leafc to litter (gN/m2) - real(r8) :: tc_soisno(bounds%begc:bounds%endc,1:nlevdecomp) ! Soil temperature (degrees Celsius) - real(r8) :: npp_remaining(bounds%begp:bounds%endp,1:nstp) ! A temporary variable for npp_remaining(gC/m2) - real(r8) :: n_passive_step(bounds%begp:bounds%endp,1:nstp) ! N taken up by transpiration at substep(gN/m2) - real(r8) :: n_passive_acc(bounds%begp:bounds%endp) ! N acquired by passive uptake (gN/m2) - real(r8) :: cost_retran(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of retran (gC/gN) - real(r8) :: cost_fix(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of fixation (gC/gN) - real(r8) :: cost_resis(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of resis (gC/gN) - real(r8) :: cost_res_resis(bounds%begp:bounds%endp,1:nlevdecomp) ! The cost of resis (gN/gC) - real(r8) :: n_fix_acc(bounds%begp:bounds%endp,1:nstp) ! N acquired by fixation (gN/m2) - real(r8) :: n_fix_acc_total(bounds%begp:bounds%endp) ! N acquired by fixation (gN/m2) - real(r8) :: npp_fix_acc(bounds%begp:bounds%endp,1:nstp) ! Amount of NPP used by fixation (gC/m2) - real(r8) :: npp_fix_acc_total(bounds%begp:bounds%endp) ! Amount of NPP used by fixation (gC/m2) - real(r8) :: n_retrans_acc(bounds%begp:bounds%endp,1:nstp) ! N acquired by retranslocation (gN/m2) - real(r8) :: n_retrans_acc_total(bounds%begp:bounds%endp) ! N acquired by retranslocation (gN/m2) - real(r8) :: free_nretrans_acc(bounds%begp:bounds%endp,1:nstp) ! N acquired by retranslocation (gN/m2) - real(r8) :: npp_retrans_acc(bounds%begp:bounds%endp,1:nstp) ! NPP used for the extraction (gC/m2) - real(r8) :: npp_retrans_acc_total(bounds%begp:bounds%endp) ! NPP used for the extraction (gC/m2) - real(r8) :: nt_uptake(bounds%begp:bounds%endp,1:nstp) ! N uptake from retrans, active, and fix(gN/m2) - real(r8) :: npp_uptake(bounds%begp:bounds%endp,1:nstp) ! NPP used by the uptakes (gC/m2) - - !----------NITRIF_DENITRIF-------------! - - real(r8) :: sminn_no3_diff ! A temporary limit for N uptake (gN/m2) - real(r8) :: sminn_nh4_diff ! A temporary limit for N uptake (gN/m2) - real(r8) :: active_no3_limit1 ! A temporary limit for N uptake (gN/m2) - real(r8) :: active_nh4_limit1 ! A temporary limit for N uptake (gN/m2) - real(r8) :: cost_active_no3(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of mycorrhizal (gC/gN) - real(r8) :: cost_active_nh4(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of mycorrhizal (gC/gN) - real(r8) :: cost_nonmyc_no3(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of nonmyc (gC/gN) - real(r8) :: cost_nonmyc_nh4(bounds%begp:bounds%endp,1:nlevdecomp) ! cost of nonmyc (gC/gN) - - real(r8) :: sminn_no3_conc(bounds%begc:bounds%endc,1:nlevdecomp) ! Concentration of no3 in soil water (gN/gH2O) - real(r8) :: sminn_no3_conc_step(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp) ! A temporary variable for soil mineral N (gN/gH2O) - real(r8) :: sminn_no3_layer(bounds%begc:bounds%endc,1:nlevdecomp) ! Available no3 in each soil layer (gN/m2) - real(r8) :: sminn_no3_layer_step(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp)! A temporary variable for soil no3 (gN/m2) - real(r8) :: sminn_no3_uptake(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp) ! A temporary variable for soil mineral N (gN/m2/s) - real(r8) :: sminn_nh4_conc(bounds%begc:bounds%endc,1:nlevdecomp) ! Concentration of nh4 in soil water (gN/gH2O) - real(r8) :: sminn_nh4_conc_step(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp) ! A temporary variable for soil mineral N (gN/gH2O) - real(r8) :: sminn_nh4_layer(bounds%begc:bounds%endc,1:nlevdecomp) ! Available nh4 in each soil layer (gN/m2) - real(r8) :: sminn_nh4_layer_step(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp)! A temporary variable for soil mineral N (gN/m2) - real(r8) :: sminn_nh4_uptake(bounds%begp:bounds%endp,1:nlevdecomp,1:nstp) ! A temporary variable for soil mineral N (gN/m2/s) - - real(r8) :: active_no3_uptake1(bounds%begp:bounds%endp,1:nlevdecomp) ! no3 mycorrhizal uptake (gN/m2) - real(r8) :: active_nh4_uptake1(bounds%begp:bounds%endp,1:nlevdecomp) ! nh4 mycorrhizal uptake (gN/m2) - real(r8) :: nonmyc_no3_uptake1(bounds%begp:bounds%endp,1:nlevdecomp) ! no3 non-mycorrhizal uptake (gN/m2) - real(r8) :: nonmyc_nh4_uptake1(bounds%begp:bounds%endp,1:nlevdecomp) ! nh4 non-mycorrhizal uptake (gN/m2) - real(r8) :: active_no3_uptake2(bounds%begp:bounds%endp,1:nlevdecomp) ! no3 mycorrhizal uptake (gN/m2) - real(r8) :: active_nh4_uptake2(bounds%begp:bounds%endp,1:nlevdecomp) ! nh4 mycorrhizal uptake (gN/m2) - real(r8) :: nonmyc_no3_uptake2(bounds%begp:bounds%endp,1:nlevdecomp) ! no3 non-mycorrhizal uptake (gN/m2) - real(r8) :: nonmyc_nh4_uptake2(bounds%begp:bounds%endp,1:nlevdecomp) ! nh4 non-mycorrhizal uptake (gN/m2) - real(r8) :: n_am_no3_acc(bounds%begp:bounds%endp) ! AM no3 uptake (gN/m2) - real(r8) :: n_am_nh4_acc(bounds%begp:bounds%endp) ! AM nh4 uptake (gN/m2) - real(r8) :: n_ecm_no3_acc(bounds%begp:bounds%endp) ! ECM no3 uptake (gN/m2) - real(r8) :: n_ecm_nh4_acc(bounds%begp:bounds%endp) ! ECM nh4 uptake (gN/m2) - real(r8) :: n_active_no3_acc(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal no3 uptake (gN/m2) - real(r8) :: n_active_nh4_acc(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal nh4 uptake (gN/m2) - real(r8) :: n_nonmyc_no3_acc(bounds%begp:bounds%endp,1:nstp) ! Non-myc no3 uptake (gN/m2) - real(r8) :: n_nonmyc_nh4_acc(bounds%begp:bounds%endp,1:nstp) ! Non-myc nh4 uptake (gN/m2) - real(r8) :: n_active_no3_acc_total(bounds%begp:bounds%endp) ! Mycorrhizal no3 uptake (gN/m2) - real(r8) :: n_active_nh4_acc_total(bounds%begp:bounds%endp) ! Mycorrhizal no3 uptake (gN/m2) - - real(r8) :: n_nonmyc_no3_acc_total(bounds%begp:bounds%endp) ! Non-myc no3 uptake (gN/m2) - real(r8) :: n_nonmyc_nh4_acc_total(bounds%begp:bounds%endp) ! Non-myc no3 uptake (gN/m2) - real(r8) :: npp_active_no3_acc(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal no3 uptake used C (gC/m2) - real(r8) :: npp_active_nh4_acc(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal nh4 uptake used C (gC/m2) - real(r8) :: npp_nonmyc_no3_acc(bounds%begp:bounds%endp,1:nstp) ! Non-myc no3 uptake used C (gC/m2) - real(r8) :: npp_nonmyc_nh4_acc(bounds%begp:bounds%endp,1:nstp) ! Non-myc nh4 uptake used C (gC/m2) - real(r8) :: npp_active_no3_acc_total(bounds%begp:bounds%endp) ! Mycorrhizal no3 uptake used C (gC/m2) - real(r8) :: npp_active_nh4_acc_total(bounds%begp:bounds%endp) ! Mycorrhizal nh4 uptake used C (gC/m2) - real(r8) :: npp_nonmyc_no3_acc_total(bounds%begp:bounds%endp) ! Non-myc no3 uptake used C (gC/m2) - real(r8) :: npp_nonmyc_nh4_acc_total(bounds%begp:bounds%endp) ! Non-myc nh4 uptake used C (gC/m2) - real(r8) :: n_am_no3_retrans(bounds%begp:bounds%endp) ! AM no3 uptake for offset (gN/m2) - real(r8) :: n_am_nh4_retrans(bounds%begp:bounds%endp) ! AM nh4 uptake for offset (gN/m2) - real(r8) :: n_ecm_no3_retrans(bounds%begp:bounds%endp) ! ECM no3 uptake for offset (gN/m2) - real(r8) :: n_ecm_nh4_retrans(bounds%begp:bounds%endp) ! ECM nh4 uptake for offset (gN/m2) - real(r8) :: n_active_no3_retrans(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal no3 for offset (gN/m2) - real(r8) :: n_active_nh4_retrans(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal nh4 for offset (gN/m2) - real(r8) :: n_nonmyc_no3_retrans(bounds%begp:bounds%endp,1:nstp) ! Non-myc no3 for offset (gN/m2) - real(r8) :: n_nonmyc_nh4_retrans(bounds%begp:bounds%endp,1:nstp) ! Non-myc nh4 for offset (gN/m2) - real(r8) :: n_active_no3_retrans_total(bounds%begp:bounds%endp) ! Mycorrhizal no3 for offset (gN/m2) - real(r8) :: n_active_nh4_retrans_total(bounds%begp:bounds%endp) ! Mycorrhizal nh4 for offset (gN/m2) - real(r8) :: n_nonmyc_no3_retrans_total(bounds%begp:bounds%endp) ! Non-myc no3 for offset (gN/m2) - real(r8) :: n_nonmyc_nh4_retrans_total(bounds%begp:bounds%endp) ! Non-myc nh4 for offset (gN/m2) - real(r8) :: n_passive_no3_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer passive no3 uptake (gN/m2) - real(r8) :: n_passive_nh4_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer passive nh4 uptake (gN/m2) - real(r8) :: n_fix_no3_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer fixation no3 uptake (gN/m2) - real(r8) :: n_fix_nh4_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer fixation nh4 uptake (gN/m2) - real(r8) :: n_active_no3_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer mycorrhizal no3 uptake (gN/m2) - real(r8) :: n_nonmyc_no3_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer non-myc no3 uptake (gN/m2) - real(r8) :: n_active_nh4_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer mycorrhizal nh4 uptake (gN/m2) - real(r8) :: n_nonmyc_nh4_vr(bounds%begp:bounds%endp,1:nlevdecomp) ! Layer non-myc nh4 uptake (gN/m2) - real(r8) :: npp_active_no3_retrans(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal no3 uptake used C for offset (gN/m2) - real(r8) :: npp_active_nh4_retrans(bounds%begp:bounds%endp,1:nstp) ! Mycorrhizal nh4 uptake used C for offset (gN/m2) - real(r8) :: npp_nonmyc_no3_retrans(bounds%begp:bounds%endp,1:nstp) ! Non-myc no3 uptake used C for offset (gN/m2) - real(r8) :: npp_nonmyc_nh4_retrans(bounds%begp:bounds%endp,1:nstp) ! Non-myc nh4 uptake used C for offset (gN/m2) - real(r8) :: npp_active_no3_retrans_total(bounds%begp:bounds%endp) ! Mycorrhizal no3 uptake used C for offset (gN/m2) - real(r8) :: npp_active_nh4_retrans_total(bounds%begp:bounds%endp) ! Mycorrhizal nh4 uptake used C for offset (gN/m2) - real(r8) :: npp_nonmyc_no3_retrans_total(bounds%begp:bounds%endp) ! Non-myc no3 uptake used C for offset (gN/m2) - real(r8) :: npp_nonmyc_nh4_retrans_total(bounds%begp:bounds%endp) ! Non-myc nh4 uptake used C for offset (gN/m2) - - - real(r8) :: costNit(1:nlevdecomp,ncost6) ! Cost of N via each process (gC/gN) - - ! Uptake fluxes for COST_METHOD=2 - ! actual npp to each layer for each uptake process - real(r8) :: npp_to_fixation(1:nlevdecomp) - real(r8) :: npp_to_retrans(1:nlevdecomp) - real(r8) :: npp_to_active_nh4(1:nlevdecomp) - real(r8) :: npp_to_nonmyc_nh4(1:nlevdecomp) - real(r8) :: npp_to_active_no3(1:nlevdecomp) - real(r8) :: npp_to_nonmyc_no3 (1:nlevdecomp) - - ! fraction of carbon to each uptake process - real(r8) :: npp_frac_to_fixation(1:nlevdecomp) - real(r8) :: npp_frac_to_retrans(1:nlevdecomp) - real(r8) :: npp_frac_to_active_nh4(1:nlevdecomp) - real(r8) :: npp_frac_to_nonmyc_nh4(1:nlevdecomp) - real(r8) :: npp_frac_to_active_no3(1:nlevdecomp) - real(r8) :: npp_frac_to_nonmyc_no3 (1:nlevdecomp) - - ! hypothetical fluxes on N in each layer - real(r8) :: n_exch_fixation(1:nlevdecomp) ! N aquired from one unit of C for fixation (unitless) - real(r8) :: n_exch_retrans(1:nlevdecomp) ! N aquired from one unit of C for retrans (unitless) - real(r8) :: n_exch_active_nh4(1:nlevdecomp) ! N aquired from one unit of C for act nh4(unitless) - real(r8) :: n_exch_nonmyc_nh4(1:nlevdecomp) ! N aquired from one unit of C for nonmy nh4 (unitless) - real(r8) :: n_exch_active_no3(1:nlevdecomp) ! N aquired from one unit of C for act no3 (unitless) - real(r8) :: n_exch_nonmyc_no3(1:nlevdecomp) ! N aquired from one unit of C for nonmyc no3 (unitless) - - !actual fluxes of N in each layer - real(r8) :: n_from_fixation(1:nlevdecomp) ! N aquired in each layer for fixation (gN m-2 s-1) - real(r8) :: n_from_retrans(1:nlevdecomp) ! N aquired in each layer of C for retrans (gN m-2 s-1) - real(r8) :: n_from_active_nh4(1:nlevdecomp) ! N aquired in each layer of C for act nh4 (gN m-2 s-1) - real(r8) :: n_from_nonmyc_nh4(1:nlevdecomp) ! N aquired in each layer of C for nonmy nh4 (gN m-2 s-1) - real(r8) :: n_from_active_no3(1:nlevdecomp) ! N aquired in each layer of C for act no3 (gN m-2 s-1) - real(r8) :: n_from_nonmyc_no3(1:nlevdecomp) ! N aquired in each layer of C for nonmyc no3 (gN m-2 s-1) - - real(r8) :: free_Nretrans(bounds%begp:bounds%endp) ! the total amount of NO3 and NH4 (gN/m3/s) - - ! Uptake fluxes for COST_METHOD=2 - !actual fluxes of N in each layer - real(r8) :: frac_ideal_C_use ! How much less C do we use for 'buying' N than that - ! needed to get to the ideal ratio? fraction. - - real(r8) :: N_acquired - real(r8) :: C_spent - real(r8) :: leaf_narea ! leaf n per unit leaf - ! area in gN/m2 (averaged across canopy, which is OK for the cost - ! calculation) - - - real(r8) :: sum_n_acquired ! Sum N aquired from one unit of C (unitless) - real(r8) :: burned_off_carbon ! carbon wasted by poor allocation algorithm. If - ! this is too big, we need a better iteration. - real(r8) :: temp_n_flux - real(r8) :: delta_cn ! difference between 'ideal' leaf CN ration and - ! actual leaf C:N ratio. C/N - real(r8) :: excess_carbon ! how much carbon goes into the leaf C - ! pool on account of the flexibleCN modifications. - real(r8) :: excess_carbon_acc ! excess accumulated over layers. - ! WITHOUT GROWTH RESP - real(r8) :: fixerfrac ! what fraction of plants can fix? - real(r8) :: npp_to_spend ! how much carbon do we need to get - ! rid of? - real(r8) :: soil_n_extraction ! calculates total N pullled from - ! soil - real(r8) :: total_N_conductance !inverse of C to of N for whole soil - ! -leaf pathway - real(r8) :: total_N_resistance ! C to of N for whole soil -leaf - ! pathway - real(r8) :: free_RT_frac=0.0_r8 !fraction of N retranslocation which is automatic/free. - ! SHould be made into a PFT parameter. - - real(r8) :: paid_for_n_retrans - real(r8) :: free_n_retrans - real(r8) :: total_c_spent_retrans - real(r8) :: total_c_accounted_retrans - - - !------end of not_use_nitrif_denitrif------! - !-------------------------------------------------------------------- - !------------ - ! Local Integer variables - !-------------------------------------------------------------------- - !------------ - integer :: fn ! number of values - ! in pft filter - integer :: fp ! lake filter pft - ! index - integer :: fc ! lake filter column - ! index - integer :: p, c ! pft index - integer :: g, l ! indices - integer :: j, i, k ! soil/snow level - ! index - integer :: istp ! Loop counters/work - integer :: icost ! a local index - integer :: fixer ! 0 = non-fixer, 1 - ! =fixer - logical :: unmetDemand ! True while there - ! is still demand for N - logical :: local_use_flexibleCN ! local version of use_flexCN - integer :: FIX ! for loop. 1 for - ! fixers, 2 for non fixers. This will become redundant with the - ! 'fixer' parameter if it works. - - !-------------------------------------------------------------------- - !--------------------------------- - associate(ivt => patch%itype , & ! Input: [integer (:) ] p - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - lflitcn => pftcon%lflitcn , & ! Input: leaf litter C:N (gC/gN) - season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal - ! -deciduous leaf habit (0 or 1) - stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress - ! -deciduous leaf habit (0 or 1) - a_fix => pftcon%a_fix , & ! Input: A BNF parameter - b_fix => pftcon%b_fix , & ! Input: A BNF parameter - c_fix => pftcon%c_fix , & ! Input: A BNF parameter - s_fix => pftcon%s_fix , & ! Input: A BNF parameter - akc_active => pftcon%akc_active , & ! Input: A mycorrhizal uptake - ! parameter - akn_active => pftcon%akn_active , & ! Input: A mycorrhizal uptake - ! parameter - ekc_active => pftcon%ekc_active , & ! Input: A mycorrhizal uptake - ! parameter - ekn_active => pftcon%ekn_active , & ! Input: A mycorrhizal upatke - ! parameter - kc_nonmyc => pftcon%kc_nonmyc , & ! Input: A non-mycorrhizal uptake - ! parameter - kn_nonmyc => pftcon%kn_nonmyc , & ! Input: A non-mycorrhizal uptake - ! parameter - perecm => pftcon%perecm , & ! Input: The fraction of ECM - ! -associated PFT - grperc => pftcon%grperc , & ! Input: growth percentage - fun_cn_flex_a => pftcon%fun_cn_flex_a , & ! Parameter a of FUN-flexcn link code (def 5) - fun_cn_flex_b => pftcon%fun_cn_flex_b , & ! Parameter b of FUN-flexcn link code (def 200) - fun_cn_flex_c => pftcon%fun_cn_flex_c , & ! Parameter b of FUN-flexcn link code (def 80) - FUN_fracfixers => pftcon%FUN_fracfixers , & ! Fraction of C that can be used for fixation. - leafcn_offset => cnveg_state_inst%leafcn_offset_patch , & ! Output: - ! [real(r8) (:)] Leaf C:N used by FUN - plantCN => cnveg_state_inst%plantCN_patch , & ! Output: [real(r8) (:)] Plant - ! C:N used by FUN - onset_flag => cnveg_state_inst%onset_flag_patch , & ! Output: [real(r8) (:)] onset - ! flag - offset_flag => cnveg_state_inst%offset_flag_patch , & ! Output: [real(r8) (:)] offset - ! flag - availc => cnveg_carbonflux_inst%availc_patch , & ! Iutput: [real(r8) (:)] C flux - ! available for allocation (gC/m2/s) - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:)] (gC/m2) - ! leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) - ! (:)] (gC/m2) leaf C storage - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) - ! (:)] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) - ! (:)] (gC/m2) fine root C storage - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) - ! (:)] (gC/m2) live stem C - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) - ! (:)] (gC/m2) live coarse root C - leafc_storage_xfer_acc => cnveg_carbonstate_inst%leafc_storage_xfer_acc_patch , & ! uutput: [real(r8) - ! (:)] Accmulated leaf C transfer (gC/m2) - storage_cdemand => cnveg_carbonstate_inst%storage_cdemand_patch , & ! Output: [real(r8) - ! (:)] C use f rom the C storage pool - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one - ! -sided leaf area index - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:)] - ! (gN/m2) leaf N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:)] - ! (gN/m2) fine root N - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:)] - ! (gN/m2) live stem N - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:)] - ! (gN/m2) live coarse root N - leafn_storage_xfer_acc => cnveg_nitrogenstate_inst%leafn_storage_xfer_acc_patch, & ! Output: [real(r8) (:)] - ! Accmulated leaf N transfer (gC/m2) - storage_ndemand => cnveg_nitrogenstate_inst%storage_ndemand_patch , & ! Output: [real(r8) (:)] - ! N demand during the offset period - leafc_to_litter => cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Output: [real(r8) - ! (:) ] leaf C litterfall (gC/m2/s) - leafc_to_litter_fun => cnveg_carbonflux_inst%leafc_to_litter_fun_patch , & ! Output: [real(r8) - ! (:) ] leaf C litterfall used by FUN (gC/m2/s) - prev_leafc_to_litter => cnveg_carbonflux_inst%prev_leafc_to_litter_patch , & ! Output: [real(r8) (:) - ! ] previous timestep leaf C litterfall flux (gC/m2/s) - leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! Output: [real(r8) - ! (:) ] - npp_Nactive => cnveg_carbonflux_inst%npp_Nactive_patch , & ! Output: [real(r8) - ! (:) ] Mycorrhizal N uptake used C (gC/m2/s) - npp_Nnonmyc => cnveg_carbonflux_inst%npp_Nnonmyc_patch , & ! Output: [real(r8) - ! (:) ] Non-mycorrhizal N uptake use C (gC/m2/s) - npp_Nam => cnveg_carbonflux_inst%npp_Nam_patch , & ! Output: [real(r8) - ! (:) ] AM uptake use C (gC/m2/s) - npp_Necm => cnveg_carbonflux_inst%npp_Necm_patch , & ! Output: [real(r8) - ! (:) ] ECM uptake use C (gC/m2/s) - npp_Nactive_no3 => cnveg_carbonflux_inst%npp_Nactive_no3_patch , & ! Output: [real(r8) - ! (:) ] Mycorrhizal N uptake used C (gC/m2/s) - npp_Nnonmyc_no3 => cnveg_carbonflux_inst%npp_Nnonmyc_no3_patch , & ! Output: [real(r8) - ! (:) ] Non-myco uptake use C (gC/m2/s) rrhizal N uptake - ! (gN/m2/s) - npp_Nam_no3 => cnveg_carbonflux_inst%npp_Nam_no3_patch , & ! Output: [real(r8) - ! (:) ] AM uptake use C (gC/m2/s) - npp_Necm_no3 => cnveg_carbonflux_inst%npp_Necm_no3_patch , & ! Output: [real(r8) - ! (:) ] ECM uptake use C (gC/m2/s) - npp_Nactive_nh4 => cnveg_carbonflux_inst%npp_Nactive_nh4_patch , & ! Output: [real(r8) - ! (:) ] Mycorrhizal N uptake used C (gC/m2/s) - npp_Nnonmyc_nh4 => cnveg_carbonflux_inst%npp_Nnonmyc_nh4_patch , & ! Output: [real(r8) - ! (:) ] Non-mycorrhizal N uptake used C (gC/m2/s) - npp_Nam_nh4 => cnveg_carbonflux_inst%npp_Nam_nh4_patch , & ! Output: [real(r8) - ! (:) ] AM uptake used C(gC/m2/s) - npp_Necm_nh4 => cnveg_carbonflux_inst%npp_Necm_nh4_patch , & ! Output: [real(r8) - ! (:) ] ECM uptake used C (gC/m2/s) - npp_Nfix => cnveg_carbonflux_inst%npp_Nfix_patch , & ! Output: [real(r8) - ! (:) ] Symbiotic BNF used C (gC/m2/s) - npp_Nretrans => cnveg_carbonflux_inst%npp_Nretrans_patch , & ! Output: [real(r8) - ! (:) ] Retranslocation N uptake used C (gC/m2/s) - npp_Nuptake => cnveg_carbonflux_inst%npp_Nuptake_patch , & ! Output: [real(r8) - ! (:) ] Total N uptake of FUN used C (gC/m2/s) - npp_growth => cnveg_carbonflux_inst%npp_growth_patch , & ! Output: [real(r8) - ! (:) ] Total N uptake of FUN used C (gC/m2/s) - burnedoff_carbon => cnveg_carbonflux_inst%npp_burnedoff_patch , & ! Output: [real(r8) - ! (:) ] C that cannot be used for N uptake(gC/m2/s) - leafc_change => cnveg_carbonflux_inst%leafc_change_patch , & ! Output: [real(r8) - ! (:) ] Used C from the leaf (gC/m2/s) - leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Iutput: [real(r8) (:) - ! ] N flux required to support initial GPP (gN/m2/s) - plant_ndemand_retrans => cnveg_nitrogenflux_inst%plant_ndemand_retrans_patch , & ! Output: [real(r8) (:) - ! ] N demand generated for FUN (gN/m2/s) - plant_ndemand_season => cnveg_nitrogenflux_inst%plant_ndemand_season_patch , & ! Output: [real(r8) (:) - ! ] N demand for seasonal deciduous forest (gN/m2/s) - plant_ndemand_stress => cnveg_nitrogenflux_inst%plant_ndemand_stress_patch , & ! Output: [real(r8) (:) - ! ] N demand for stress deciduous forest (gN/m2/s) - Nactive => cnveg_nitrogenflux_inst%Nactive_patch , & ! Output: [real(r8) (:) - ! ] Mycorrhizal N uptake (gN/m2/s) - Nnonmyc => cnveg_nitrogenflux_inst%Nnonmyc_patch , & ! Output: [real(r8) (:) - ! ] Non-mycorrhizal N uptake (gN/m2/s) - Nam => cnveg_nitrogenflux_inst%Nam_patch , & ! Output: [real(r8) (:) ] AM - ! uptake (gN/m2/s) - Necm => cnveg_nitrogenflux_inst%Necm_patch , & ! Output: [real(r8) (:) ] ECM - ! uptake (gN/m2/s) - Nactive_no3 => cnveg_nitrogenflux_inst%Nactive_no3_patch , & ! Output: [real(r8) (:) - ! ] Mycorrhizal N uptake (gN/m2/s) - Nnonmyc_no3 => cnveg_nitrogenflux_inst%Nnonmyc_no3_patch , & ! Output: [real(r8) (:) - ! ] Non-mycorrhizal N uptake (gN/m2/s) - Nam_no3 => cnveg_nitrogenflux_inst%Nam_no3_patch , & ! Output: [real(r8) (:) - ! ] AM uptake (gN/m2/s) - Necm_no3 => cnveg_nitrogenflux_inst%Necm_no3_patch , & ! Output: [real(r8) (:) - ! ] ECM uptake (gN/m2/s) - Nactive_nh4 => cnveg_nitrogenflux_inst%Nactive_nh4_patch , & ! Output: [real(r8) (:) - ! ] Mycorrhizal N uptake (gN/m2/s) - Nnonmyc_nh4 => cnveg_nitrogenflux_inst%Nnonmyc_nh4_patch , & ! Output: [real(r8) (:) - ! ] Non-mycorrhizal N uptake (gN/m2/s) - Nam_nh4 => cnveg_nitrogenflux_inst%Nam_nh4_patch , & ! Output: [real(r8) (:) - ! ] AM uptake (gN/m2/s) - Necm_nh4 => cnveg_nitrogenflux_inst%Necm_nh4_patch , & ! Output: [real(r8) (:) - ! ] ECM uptake (gN/m2/s) - Npassive => cnveg_nitrogenflux_inst%Npassive_patch , & ! Output: [real(r8) (:) - ! ] Passive N uptake (gN/m2/s) - Nfix => cnveg_nitrogenflux_inst%Nfix_patch , & ! Output: [real(r8) (:) ] - ! Symbiotic BNF (gN/m2/s) - cost_nfix => cnveg_nitrogenflux_inst%cost_Nfix_patch , & ! Output: [real(r8) (:) - ! ] Cost of fixation gC:gN - cost_nactive => cnveg_nitrogenflux_inst%cost_Nactive_patch , & ! Output: [real(r8) (:) ] - ! Cost of active uptake gC:gN - cost_nretrans => cnveg_nitrogenflux_inst%cost_Nretrans_patch , & ! Output: [real(r8) (:) ] - ! Cost of retranslocation gC:gN - nuptake_npp_fraction_patch => cnveg_nitrogenflux_inst%nuptake_npp_fraction_patch , & ! Output: [real(r8) (:) - ! ] frac of NPP in NUPTAKE - - c_allometry => cnveg_state_inst%c_allometry_patch , & ! Output: [real(r8) (:) ] C - ! allocation index (DIM) - n_allometry => cnveg_state_inst%n_allometry_patch , & ! Output: [real(r8) (:) ] N - ! allocation index (DIM) - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) - ! ] (gN/m2) leaf N store - nfix_to_sminn => soilbiogeochem_nitrogenflux_inst%nfix_to_sminn_col , & ! Output: [real(r8) (:)] - ! symbiotic/asymbiotic N fixation to soil mineral N (gN/m2 - ! /s) - Nretrans => cnveg_nitrogenflux_inst%Nretrans_patch , & ! Output: [real(r8) (:) - ! ] Retranslocation N uptake (gN/m2/s) - Nretrans_season => cnveg_nitrogenflux_inst%Nretrans_season_patch , & ! Output: [real(r8) (:) - ! ] Retranslocation N uptake (gN/m2/s) - Nretrans_stress => cnveg_nitrogenflux_inst%Nretrans_stress_patch , & ! Output: [real(r8) (:) - ! ] Retranslocation N uptake (gN/m2/s) - Nuptake => cnveg_nitrogenflux_inst%Nuptake_patch , & ! Output: [real(r8) (:) - ! ] Total N uptake of FUN (gN/m2/s) - retransn_to_npool => cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Output: [real(r8) - ! (:) ] deployment of retranslocated N (gN/m2/s) - free_retransn_to_npool => cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Output: [real(r8) - ! uptake of free N from leaves (needed to allow RT during the night with no NPP - sminn_to_plant_fun => cnveg_nitrogenflux_inst%sminn_to_plant_fun_patch , & ! Output: - ! [real(r8) (:) ] Total soil N uptake of FUN (gN/m2/s) - sminn_to_plant_fun_vr => cnveg_nitrogenflux_inst%sminn_to_plant_fun_vr_patch , & ! Output: - ! [real(r8) (:) ] Total layer soil N uptake of FUN (gN/m2 - ! /s) - sminn_to_plant_fun_no3_vr => cnveg_nitrogenflux_inst%sminn_to_plant_fun_no3_vr_patch , & ! Output: [real(r8) - ! (:) ] Total layer no3 uptake of FUN (gN/m2/s) - sminn_to_plant_fun_nh4_vr => cnveg_nitrogenflux_inst%sminn_to_plant_fun_nh4_vr_patch , & ! Output: [real(r8) - ! (:) ] Total layer nh4 uptake of FUN (gN/m2/s) - sminn_to_plant_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_vr_col , & ! Output: [real(r8) (: - ! ,:) ] - smin_no3_to_plant_vr => soilbiogeochem_nitrogenflux_inst%smin_no3_to_plant_vr_col , & ! Output: [real(r8) (: - ! ,:) ] - smin_nh4_to_plant_vr => soilbiogeochem_nitrogenflux_inst%smin_nh4_to_plant_vr_col , & ! Output: [real(r8) (: - ! ,:) ] - smin_vr_nh4 => soilbiogeochem_nitrogenstate_inst%smin_nh4_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral - ! NH4 - smin_vr_no3 => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral - ! NO3 - soilc_change => cnveg_carbonflux_inst%soilc_change_patch , & ! Output: [real(r8) - ! (:) ] Used C from the soil (gC/m2/s) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:)] - ! liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:)] - ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - crootfr => soilstate_inst%crootfr_patch & ! Input: [real(r8) (:,:)] - ! fraction of roots for carbon in each soil layer (nlevgrnd) - ) - !-------------------------------------------------------------------- - !----------- - ! Initialize output fluxes, which were also initialized in CNFUNMod. - !-------------------------------------------------------------------- - !----------- - local_use_flexibleCN = use_flexibleCN - steppday = 48._r8 - qflx_tran_veg_layer = 0._r8 - rootc_dens_step = 0._r8 - plant_ndemand_pool = 0._r8 - - call t_startf('CNFUNzeroarrays') - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - availc_pool(p) = 0._r8 - rootC(p) = 0._r8 - litterfall_n(p) = 0._r8 - burnedoff_carbon(p) = 0._r8 - end do - - - do j = 1, nlevdecomp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - c = patch%column(p) - rootc_dens(p,j) = 0._r8 - cost_retran(p,j) = 0._r8 - cost_fix(p,j) = 0._r8 - cost_resis(p,j) = 0._r8 - cost_res_resis(p,j) = 0._r8 - cost_active_no3(p,j) = 0._r8 - cost_active_nh4(p,j) = 0._r8 - cost_nonmyc_no3(p,j) = 0._r8 - cost_nonmyc_nh4(p,j) = 0._r8 - - sminn_no3_conc(c,j) = 0._r8 - sminn_no3_layer(c,j) = 0._r8 - sminn_nh4_conc(c,j) = 0._r8 - sminn_nh4_layer(c,j) = 0._r8 - end do - end do - - do istp = 1, nstp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - npp_remaining(p,istp) = 0._r8 - permyc(p,istp) = 0._r8 - plant_ndemand_pool_step(p,istp) = 0._r8 - nt_uptake(p,istp) = 0._r8 - npp_uptake(p,istp) = 0._r8 - leafn_step(p,istp) = 0._r8 - leafn_retrans_step(p,istp) = 0._r8 - litterfall_n_step(p,istp) = 0._r8 - litterfall_c_step(p,istp) = 0._r8 - end do - do j = 1, nlevdecomp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - sminn_no3_conc_step(p,j,istp) = 0._r8 - sminn_no3_layer_step(p,j,istp) = 0._r8 - sminn_no3_uptake(p,j,istp) = 0._r8 - sminn_nh4_conc_step(p,j,istp) = 0._r8 - sminn_nh4_layer_step(p,j,istp) = 0._r8 - sminn_nh4_uptake(p,j,istp) = 0._r8 - end do - end do - end do - - do icost = 1, ncost6 - do j = 1, nlevdecomp - costNit(j,icost) = big_cost - end do - end do - - ! Time step of FUN - dt = real(get_step_size(), r8) - call t_stopf('CNFUNzeroarrays') - !-------------------------------------------------------------------- - !---------------------------- - ! Calculation starts - !-------------------------------------------------------------------- - call t_startf('CNFUNcalcs1') - !---------------------------- - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - - litterfall_n(p) = (leafc_to_litter_fun(p) / leafcn_offset(p)) * dt - rootC(p) = frootc(p) - - plantN(p) = leafn(p) + frootn(p) + livestemn(p) + livecrootn(p) - if (n_allometry(p).gt.0._r8) then - plantCN(p) = c_allometry(p)/n_allometry(p) !changed RF. - ! above code gives CN ratio too low. - else - plantCN(p) = 0._r8 - end if - end do ! PFT ends - do istp = 1, nstp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - - if (istp.eq.ecm_step) then - permyc(p,istp) = perecm(ivt(p)) - kc_active(p,istp) = ekc_active(ivt(p)) - kn_active(p,istp) = ekn_active(ivt(p)) - else - permyc(p,istp) = 1._r8 - perecm(ivt(p)) - kc_active(p,istp) = akc_active(ivt(p)) - kn_active(p,istp) = akn_active(ivt(p)) - end if - - if(leafc(p)>0.0_r8)then - ! N available in leaf which fell off in this timestep. Same fraction loss as C. - litterfall_c_step(p,istp) = dt * permyc(p,istp) * leafc_to_litter_fun(p) - litterfall_n_step(p,istp) = dt * permyc(p,istp) * leafn(p) * leafc_to_litter_fun(p)/leafc(p) - endif - - if (season_decid(ivt(p)) == 1._r8.or.stress_decid(ivt(p)) == 1._r8) then - if (offset_flag(p) .ne. 1._r8) then - litterfall_n_step(p,istp) = 0.0_r8 - litterfall_c_step(p,istp) = 0.0_r8 - endif - endif - - end do - end do - - do j = 1, nlevdecomp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - c = patch%column(p) - sminn_no3_layer(c,j)= smin_no3_to_plant_vr(c,j) * dzsoi_decomp(j) * dt - sminn_nh4_layer(c,j)= smin_nh4_to_plant_vr(c,j) * dzsoi_decomp(j) * dt - if (h2osoi_liq(c,j) < smallValue) then - sminn_no3_layer(c,j) = 0._r8 - sminn_nh4_layer(c,j) = 0._r8 - end if - sminn_no3_layer(c,j) = max(sminn_no3_layer(c,j),0._r8) - sminn_nh4_layer(c,j) = max(sminn_nh4_layer(c,j),0._r8) - if (h2osoi_liq(c,j) > smallValue) then - sminn_no3_conc(c,j) = sminn_no3_layer(c,j) / (h2osoi_liq(c,j) * 1000._r8) ! (gN/m2)/(gH2O/m2) (coverted from - ! kg2g) - sminn_nh4_conc(c,j) = sminn_nh4_layer(c,j) / (h2osoi_liq(c,j) * 1000._r8) ! (gN/m2)/(gH2O/m2) (coverted from - ! kg2g) - else - sminn_no3_conc(c,j) = 0._r8 - sminn_nh4_conc(c,j) = 0._r8 - end if - end do - end do - - do istp = 1, nstp - do j = 1, nlevdecomp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - c = patch%column(p) - - sminn_no3_layer_step(p,j,istp) = sminn_no3_layer(c,j) * permyc(p,istp) - sminn_nh4_layer_step(p,j,istp) = sminn_nh4_layer(c,j) * permyc(p,istp) - sminn_no3_conc_step(p,j,istp) = sminn_no3_conc(c,j) * permyc(p,istp) - sminn_nh4_conc_step(p,j,istp) = sminn_nh4_conc(c,j) * permyc(p,istp) - end do - end do - end do - call t_stopf('CNFUNcalcs1') - - call t_startf('CNFUNzeroarrays2') - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - n_passive_acc(p) = 0._r8 - n_fix_acc_total(p) = 0._r8 - n_retrans_acc_total(p) = 0._r8 - npp_fix_acc_total(p) = 0._r8 - n_nonmyc_no3_retrans_total(p) = 0._r8 - n_nonmyc_nh4_retrans_total(p) = 0._r8 - npp_retrans_acc_total(p) = 0._r8 - n_am_no3_acc(p) = 0._r8 - n_am_nh4_acc(p) = 0._r8 - n_am_no3_retrans(p) = 0._r8 - n_am_nh4_retrans(p) = 0._r8 - n_ecm_no3_acc(p) = 0._r8 - n_ecm_nh4_acc(p) = 0._r8 - n_ecm_no3_retrans(p) = 0._r8 - n_ecm_nh4_retrans(p) = 0._r8 - n_active_no3_acc_total(p) = 0._r8 - n_active_nh4_acc_total(p) = 0._r8 - n_active_no3_retrans_total(p) = 0._r8 - n_active_nh4_retrans_total(p) = 0._r8 - n_nonmyc_no3_acc_total(p) = 0._r8 - n_nonmyc_nh4_acc_total(p) = 0._r8 - npp_active_no3_acc_total(p) = 0._r8 - npp_active_nh4_acc_total(p) = 0._r8 - npp_active_no3_retrans_total(p) = 0._r8 - npp_active_nh4_retrans_total(p) = 0._r8 - npp_nonmyc_no3_acc_total(p) = 0._r8 - npp_nonmyc_nh4_acc_total(p) = 0._r8 - npp_nonmyc_no3_retrans_total(p) = 0._r8 - npp_nonmyc_nh4_retrans_total(p) = 0._r8 - free_Nretrans(p) = 0._r8 - end do - - do j = 1, nlevdecomp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - n_passive_no3_vr(p,j) = 0._r8 - n_passive_nh4_vr(p,j) = 0._r8 - n_active_no3_vr(p,j) = 0._r8 - n_nonmyc_no3_vr(p,j) = 0._r8 - n_active_nh4_vr(p,j) = 0._r8 - n_nonmyc_nh4_vr(p,j) = 0._r8 - end do - end do - do istp = 1, nstp - do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - n_passive_step(p,istp) = 0._r8 - n_fix_acc(p,istp) = 0._r8 - n_retrans_acc(p,istp) = 0._r8 - npp_fix_acc(p,istp) = 0._r8 - npp_retrans_acc(p,istp) = 0._r8 - n_active_no3_acc(p,istp) = 0._r8 - n_active_nh4_acc(p,istp) = 0._r8 - n_active_no3_retrans(p,istp) = 0._r8 - n_active_nh4_retrans(p,istp) = 0._r8 - n_nonmyc_no3_acc(p,istp) = 0._r8 - n_nonmyc_nh4_acc(p,istp) = 0._r8 - n_nonmyc_no3_retrans(p,istp) = 0._r8 - n_nonmyc_nh4_retrans(p,istp) = 0._r8 - npp_active_no3_acc(p,istp) = 0._r8 - npp_active_nh4_acc(p,istp) = 0._r8 - npp_active_no3_retrans(p,istp) = 0._r8 - npp_active_nh4_retrans(p,istp) = 0._r8 - npp_nonmyc_no3_acc(p,istp) = 0._r8 - npp_nonmyc_nh4_acc(p,istp) = 0._r8 - npp_nonmyc_no3_retrans(p,istp) = 0._r8 - npp_nonmyc_nh4_retrans(p,istp) = 0._r8 - end do - end do - - burned_off_carbon = 0._r8 - call t_stopf('CNFUNzeroarrays2') - - - call t_startf('CNFUNcalcs') -pft:do fp = 1,num_soilp ! PFT Starts - p = filter_soilp(fp) - c = patch%column(p) - excess_carbon_acc = 0.0_r8 - burned_off_carbon = 0.0_r8 - - sminn_to_plant_fun_nh4_vr(p,:) = 0._r8 - sminn_to_plant_fun_no3_vr(p,:) = 0._r8 - - ! I have turned off this r etranslocation functionality for now. To - ! be rolled back in to a new version later on once the rest of - ! th - ! mode is working OK. RF - - if (season_decid(ivt(p)) == 1._r8.or.stress_decid(ivt(p)) == 1._r8) then - if (onset_flag(p) == 1._r8) then - leafc_storage_xfer_acc(p) = leafc_storage_xfer_acc(p) + leafc_storage_to_xfer(p) * dt - leafn_storage_xfer_acc(p) = leafn_storage_xfer_acc(p) + leafn_storage_to_xfer(p) * dt - end if - if (offset_flag(p) == 1._r8) then - storage_cdemand(p) = leafc_storage(p) / (ndays_off * steppday) - storage_ndemand(p) = leafn_storage_xfer_acc(p) / (ndays_off * steppday) - storage_ndemand(p) = max(storage_ndemand(p),0._r8) - else - storage_cdemand(p) = 0._r8 - storage_ndemand(p) = 0._r8 - end if - else - storage_cdemand(p) = 0._r8 - storage_ndemand(p) = 0._r8 - end if ! end for deciduous - - !---------How much carbon is provided, to be used for either growth - ! or Nitrogen uptake?------------------- - availc_pool(p) = availc(p) * dt - - if (availc_pool(p) > 0._r8) then - do j = 1, nlevdecomp - rootc_dens(p,j) = crootfr(p,j) * rootC(p) - end do - end if - - plant_ndemand_pool(p) = plant_ndemand(p) * dt - plant_ndemand_pool(p) = max(plant_ndemand_pool(p),0._r8) - plant_ndemand_retrans(p) = storage_ndemand(p) - - !-------------------------------------------------------------------- - !---------- -stp: do istp = ecm_step, am_step ! TWO STEPS - retrans_limit1 = 0._r8 - dn = 0._r8 - dnpp = 0._r8 - - ! zero out all of the fluxes that get accumulated accross ISTP - sminn_no3_diff = 0._r8 - sminn_nh4_diff = 0._r8 - active_no3_limit1 = 0._r8 - active_nh4_limit1 = 0._r8 - - - n_from_active_no3(:) = 0.0_r8 - n_from_active_nh4(:) = 0.0_r8 - n_from_nonmyc_no3(:) = 0.0_r8 - n_from_nonmyc_nh4(:) = 0.0_r8 - n_from_fixation(:) = 0.0_r8 - n_from_retrans(:) = 0.0_r8 - - n_active_no3_acc(p,istp) = 0.0_r8 - n_active_nh4_acc(p,istp) = 0.0_r8 - n_nonmyc_no3_acc(p,istp) = 0.0_r8 - n_nonmyc_nh4_acc(p,istp) = 0.0_r8 - n_fix_acc(p,istp) = 0.0_r8 - n_retrans_acc(p,istp) = 0.0_r8 - free_nretrans_acc(p,istp) = 0.0_r8 - - npp_active_no3_acc(p,istp) = 0.0_r8 - npp_active_nh4_acc(p,istp) = 0.0_r8 - npp_nonmyc_no3_acc(p,istp) = 0.0_r8 - npp_nonmyc_no3_acc(p,istp) = 0.0_r8 - npp_fix_acc(p,istp) = 0.0_r8 - npp_retrans_acc(p,istp) = 0.0_r8 - - npp_to_active_no3(:) = 0.0_r8 - npp_to_active_nh4(:) = 0.0_r8 - npp_to_nonmyc_no3(:) = 0.0_r8 - npp_to_nonmyc_nh4(:) = 0.0_r8 - npp_to_fixation(:) = 0.0_r8 - npp_to_retrans(:) = 0.0_r8 - - - - unmetDemand = .TRUE. - plant_ndemand_pool_step(p,istp) = plant_ndemand_pool(p) * permyc(p,istp) - npp_remaining(p,istp) = availc_pool(p) * permyc(p,istp) - - - ! if (plant_ndemand_pool_step(p,istp) .gt. 0._r8) then ! - ! plant_ndemand_pool_step > 0.0 - - do j = 1, nlevdecomp - tc_soisno(c,j) = t_soisno(c,j) - tfrz - if(pftcon%c3psn(patch%itype(p)).eq.1)then - fixer=1 - else - fixer=0 - endif - costNit(j,icostFix) = fun_cost_fix(fixer,a_fix(ivt(p)),b_fix(ivt(p))& - ,c_fix(ivt(p)) ,big_cost,crootfr(p,j),s_fix(ivt(p)),tc_soisno(c,j)) - end do - cost_fix(p,1:nlevdecomp) = costNit(:,icostFix) - - - !-------------------------------------------------------------------- - !------------ - ! If passive uptake is insufficient, consider fixation, - ! mycorrhizal - ! non-mycorrhizal, storage, and retranslocation. - !-------------------------------------------------------------------- - !------------ - !-------------------------------------------------------------------- - !------------ - ! Costs of active uptake. - !-------------------------------------------------------------------- - !------------ - !------Mycorrhizal Uptake Cost-----------------! - do j = 1,nlevdecomp - rootc_dens_step = rootc_dens(p,j) * permyc(p,istp) - costNit(j,icostActiveNO3) = fun_cost_active(sminn_no3_layer_step(p,j,istp) & - ,big_cost,kc_active(p,istp),kn_active(p,istp) ,rootc_dens_step,crootfr(p,j),smallValue) - costNit(j,icostActiveNH4) = fun_cost_active(sminn_nh4_layer_step(p,j,istp) & - ,big_cost,kc_active(p,istp),kn_active(p,istp) ,rootc_dens_step,crootfr(p,j),smallValue) - end do - cost_active_no3(p,1:nlevdecomp) = costNit(:,icostActiveNO3) - cost_active_nh4(p,1:nlevdecomp) = costNit(:,icostActiveNH4) - - - !------Non-mycorrhizal Uptake Cost-------------! - do j = 1,nlevdecomp - rootc_dens_step = rootc_dens(p,j) * permyc(p,istp) - costNit(j,icostnonmyc_no3) = fun_cost_nonmyc(sminn_no3_layer_step(p,j,istp) & - ,big_cost,kc_nonmyc(ivt(p)),kn_nonmyc(ivt(p)) ,rootc_dens_step,crootfr(p,j),smallValue) - costNit(j,icostnonmyc_nh4) = fun_cost_nonmyc(sminn_nh4_layer_step(p,j,istp) & - ,big_cost,kc_nonmyc(ivt(p)),kn_nonmyc(ivt(p)) ,rootc_dens_step,crootfr(p,j),smallValue) - end do - cost_nonmyc_no3(p,1:nlevdecomp) = costNit(:,icostnonmyc_no3) - cost_nonmyc_nh4(p,1:nlevdecomp) = costNit(:,icostnonmyc_nh4) - - - ! Remove C required to pair with N from passive uptake - ! from the available pool. - npp_remaining(p,istp) = npp_remaining(p,istp) - n_passive_step(p,istp)*plantCN(p) - -fix_loop: do FIX =plants_are_fixing, plants_not_fixing !loop around percentages of fixers and non - ! fixers, with differnt costs. - if(FIX==plants_are_fixing)then ! How much of the carbon in this PFT can in principle be used for fixation? - ! This is analagous to fixing the % of fixers for a given PFT - may not be realistic in the long run - ! but prevents wholesale switching to fixer dominance during e.g. CO2 fertilization. - fixerfrac = FUN_fracfixers(ivt(p)) - else - fixerfrac = 1.0_r8 - FUN_fracfixers(ivt(p)) - endif - npp_to_spend = npp_remaining(p,istp) * fixerfrac !put parameter here. - - - - n_from_active_no3(1:nlevdecomp) = 0._r8 - n_from_active_nh4(1:nlevdecomp) = 0._r8 - n_from_nonmyc_no3(1:nlevdecomp) = 0._r8 - n_from_nonmyc_nh4(1:nlevdecomp) = 0._r8 - !-------------------------------------------------------------------- - !----------- - ! Calculate Integrated Resistance OF WHOLE SOIL COLUMN - !-------------------------------------------------------------------- - !----------- - - sum_n_acquired = 0.0_r8 - total_N_conductance = 0.0_r8 - do j = 1, nlevdecomp - !----------! - ! Method changed from FUN-resistors method to a method which - ! allocates fluxs based on conductance. rosief - !----------! - - ! Sum the conductances - total_N_conductance = total_N_conductance + 1._r8/ & - cost_active_no3(p,j) + 1._r8/cost_active_nh4(p,j) & - + 1._r8/cost_nonmyc_no3(p,j) & - + 1._r8/cost_nonmyc_nh4(p,j) - if(FIX==plants_are_fixing)then - total_N_conductance = total_N_conductance + 1.0_r8 * 1._r8/cost_fix(p,j) - end if - - end do - - do j = 1, nlevdecomp - ! Calculate npp allocation to pathways proportional to their exchange rate (N/C) - - npp_frac_to_active_nh4(j) = (1._r8/cost_active_nh4(p,j)) / total_N_conductance - npp_frac_to_nonmyc_nh4(j) = (1._r8/cost_nonmyc_nh4(p,j)) / total_N_conductance - npp_frac_to_active_no3(j) = (1._r8/cost_active_no3(p,j)) / total_N_conductance - npp_frac_to_nonmyc_no3(j) = (1._r8/cost_nonmyc_no3(p,j)) / total_N_conductance - if(FIX==plants_are_fixing)then - npp_frac_to_fixation(j) = (1.0_r8 * 1._r8/cost_fix(p,j)) / total_N_conductance - else - npp_frac_to_fixation(j) = 0.0_r8 - end if - - ! Calculate hypothetical N uptake from each source - if(FIX==plants_are_fixing)then - n_exch_fixation(j) = npp_frac_to_fixation(j) / cost_fix(p,j) - else - n_exch_fixation(j) = 0.0_r8 - end if - - n_exch_active_nh4(j) = npp_frac_to_active_nh4(j) / cost_active_nh4(p,j) - n_exch_nonmyc_nh4(j) = npp_frac_to_nonmyc_nh4(j) / cost_nonmyc_nh4(p,j) - n_exch_active_no3(j) = npp_frac_to_active_no3(j) / cost_active_no3(p,j) - n_exch_nonmyc_no3(j) = npp_frac_to_nonmyc_no3(j) / cost_nonmyc_no3(p,j) - - ! Total N aquired from one unit of carbon (N/C) - sum_n_acquired = sum_n_acquired + n_exch_active_nh4(j) +& - n_exch_nonmyc_nh4(j)+ n_exch_active_no3(j) + n_exch_nonmyc_no3(j) - - if(FIX==plants_are_fixing)then - sum_n_acquired= sum_n_acquired + n_exch_fixation(j) - end if - - end do !nlevdecomp - - total_N_resistance = 1.0_r8/sum_n_acquired - - !------------------------------------------------------------------------------- - ! Calculate appropriate degree of retranslocation - !------------------------------------------------------------------------------- - - if(leafc(p).gt.0.0_r8.and.litterfall_n_step(p,istp)* fixerfrac>0.0_r8.and.ivt(p) 0._r8 - end do stp ! NSTEP - - - !------------------------------------------------------------------------------- - ! Turn step level quantities back into fluxes per second. - !------------------------------------------------------------------------------- - - !---------------------------N fluxes--------------------! - Npassive(p) = n_passive_acc(p)/dt - Nfix(p) = n_fix_acc_total(p)/dt - retransn_to_npool(p) = n_retrans_acc_total(p)/dt - free_retransn_to_npool(p) = free_nretrans(p)/dt - ! this is the N that comes off leaves. - Nretrans(p) = retransn_to_npool(p) + free_retransn_to_npool(p) - - - - - !Extract active uptake N from soil pools. - do j = 1, nlevdecomp - !RF change. The N fixed doesn't actually come out of the soil mineral pools, it is 'new'... - sminn_to_plant_fun_no3_vr(p,j) = (n_passive_no3_vr(p,j) + n_active_no3_vr(p,j) & - + n_nonmyc_no3_vr(p,j))/(dzsoi_decomp(j)*dt) - sminn_to_plant_fun_nh4_vr(p,j) = (n_passive_nh4_vr(p,j) + n_active_nh4_vr(p,j) & - + n_nonmyc_nh4_vr(p,j))/(dzsoi_decomp(j)*dt) - - end do - - - - Nactive_no3(p) = n_active_no3_acc_total(p)/dt + n_active_no3_retrans_total(p)/dt - Nactive_nh4(p) = n_active_nh4_acc_total(p)/dt + n_active_nh4_retrans_total(p)/dt - - - - Necm_no3(p) = n_ecm_no3_acc(p)/dt + n_ecm_no3_retrans(p)/dt - Necm_nh4(p) = n_ecm_nh4_acc(p)/dt + n_ecm_nh4_retrans(p)/dt - Necm(p) = Necm_no3(p) + Necm_nh4(p) - Nam_no3(p) = n_am_no3_acc(p)/dt + n_am_no3_retrans(p)/dt - Nam_nh4(p) = n_am_nh4_acc(p)/dt + n_am_nh4_retrans(p)/dt - Nam(p) = Nam_no3(p) + Nam_nh4(p) - Nnonmyc_no3(p) = n_nonmyc_no3_acc_total(p)/dt + n_nonmyc_no3_retrans_total(p)/dt - Nnonmyc_nh4(p) = n_nonmyc_nh4_acc_total(p)/dt + n_nonmyc_nh4_retrans_total(p)/dt - Nnonmyc(p) = Nnonmyc_no3(p) + Nnonmyc_nh4(p) - plant_ndemand_retrans(p) = plant_ndemand_retrans(p)/dt - Nuptake(p) = Nactive_no3(p) + Nactive_nh4(p) + Nnonmyc_no3(p) & - + Nnonmyc_nh4(p) + Nfix(p) + Npassive(p) + & - retransn_to_npool(p)+free_retransn_to_npool(p) - Nactive(p) = Nactive_no3(p) + Nactive_nh4(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p) - - ! free N goes straight to the npool, not throught Nuptake... - sminn_to_plant_fun(p) = Nactive_no3(p) + Nactive_nh4(p) + Nnonmyc_no3(p) + Nnonmyc_nh4(p) + Nfix(p) + Npassive(p) - - - soil_n_extraction = ( sum(n_active_no3_vr(p,1: nlevdecomp))+sum(n_nonmyc_no3_vr(p,1: nlevdecomp))+& - sum(n_active_nh4_vr(p,1: nlevdecomp)) + sum(n_nonmyc_nh4_vr(p,1: nlevdecomp))) - - !---------------------------C fluxes--------------------! - - npp_Nactive_no3(p) = npp_active_no3_acc_total(p)/dt + npp_active_no3_retrans_total(p)/dt - npp_Nactive_nh4(p) = npp_active_nh4_acc_total(p)/dt + npp_active_nh4_retrans_total(p)/dt - - npp_Nnonmyc_no3(p) = npp_nonmyc_no3_acc_total(p)/dt + npp_nonmyc_no3_retrans_total(p)/dt - npp_Nnonmyc_nh4(p) = npp_nonmyc_nh4_acc_total(p)/dt + npp_nonmyc_nh4_retrans_total(p)/dt - npp_Nactive(p) = npp_Nactive_no3(p) + npp_Nactive_nh4(p) + npp_Nnonmyc_no3(p) + npp_Nnonmyc_nh4(p) - npp_Nnonmyc(p) = npp_Nnonmyc_no3(p) + npp_Nnonmyc_nh4(p) - npp_Nfix(p) = npp_fix_acc_total(p)/dt - npp_Nretrans(p) = npp_retrans_acc_total(p)/dt - - !---------------------------Extra Respiration Fluxes--------------------! - soilc_change(p) = (npp_active_no3_acc_total(p) + npp_active_nh4_acc_total(p) & - + npp_nonmyc_no3_acc_total(p) & - + npp_nonmyc_nh4_acc_total(p) + npp_fix_acc_total(p))/dt & - + npp_Nretrans(p) - soilc_change(p) = soilc_change(p) + burned_off_carbon / dt - burnedoff_carbon(p) = burned_off_carbon/dt - npp_Nuptake(p) = soilc_change(p) - ! how much carbon goes to growth of tissues? - npp_growth(p) = (Nuptake(p)- free_retransn_to_npool(p))*plantCN(p)+(excess_carbon_acc/dt) !does not include gresp, since this is calculated from growth - - - - !-----------------------Diagnostic Fluxes------------------------------! - if(availc(p).gt.0.0_r8)then !what happens in the night? - nuptake_npp_fraction_patch(p) = npp_Nuptake(p)/availc(p) - else - nuptake_npp_fraction_patch(p) = spval - endif - if(npp_Nfix(p).gt.0.0_r8)then - cost_nfix(p) = Nfix(p)/npp_Nfix(p) - else - cost_nfix(p) = spval - endif - if(npp_Nactive(p).gt.0.0_r8)then - cost_nactive(p) = Nactive(p)/npp_Nactive(p) - else - cost_nactive(p) = spval - endif - if(npp_Nretrans(p).gt.0.0_r8)then - cost_nretrans(p) = Nretrans(p)/npp_Nretrans(p) - else - cost_nretrans(p) = spval - endif - - - end do pft ! PFT Ends - - call t_stopf('CNFUNcalcs') - - call p2c(bounds, num_soilc, filter_soilc, & - cnveg_carbonflux_inst%soilc_change_patch(bounds%begp:bounds%endp), & - soilbiogeochem_carbonflux_inst%soilc_change_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - cnveg_nitrogenflux_inst%Nfix_patch(bounds%begp:bounds%endp), & - soilbiogeochem_nitrogenflux_inst%nfix_to_sminn_col(bounds%begc:bounds%endc)) - - end associate - end subroutine CNFUN -!========================================================================================= - real(r8) function fun_cost_fix(fixer,a_fix,b_fix,c_fix,big_cost,crootfr,s_fix, tc_soisno) - -! Description: -! Calculate the cost of fixing N by nodules. -! Code Description: -! This code is written to CLM4CN by Mingjie Shi on 06/27/2013 - - implicit none -!-------------------------------------------------------------------------- -! Function result. -!-------------------------------------------------------------------------- -! real(r8) , intent(out) :: cost_of_n !!! cost of fixing N (kgC/kgN) -!-------------------------------------------------------------------------- -! Scalar arguments with intent(in). -!-------------------------------------------------------------------------- - integer, intent(in) :: fixer ! flag indicating if plant is a fixer - ! 1=yes, otherwise no. - real(r8), intent(in) :: a_fix ! As in Houlton et al. (Nature) 2008 - real(r8), intent(in) :: b_fix ! As in Houlton et al. (Nature) 2008 - real(r8), intent(in) :: c_fix ! As in Houlton et al. (Nature) 2008 - real(r8), intent(in) :: big_cost ! an arbitrary large cost (gC/gN) - real(r8), intent(in) :: crootfr ! fraction of roots for carbon that are in this layer - real(r8), intent(in) :: s_fix ! Inverts Houlton et al. 2008 and constrains between 7.5 and 12.5 - real(r8), intent(in) :: tc_soisno ! soil temperature (degrees Celsius) - - if (fixer == 1 .and. crootfr > 1.e-6_r8) then - fun_cost_fix = s_fix * (exp(a_fix + b_fix * tc_soisno * (1._r8 - 0.5_r8 * tc_soisno / c_fix)) - 2._r8) - - - ! New term to directly account for Ben Houlton's temperature response function. - ! Assumes s_fix is -6. (RF, Jan 2015) - ! 1.25 converts from the Houlton temp response function to a 0-1 limitation factor. - ! The cost of N should probably be 6 gC/gN (or 9, including maintenance costs of nodules) - ! for 'optimal' temperatures. This cost should increase in a way that mirrors - ! Houlton et al's observations of temperautre limitations on the mirboial fixation rates. - ! We don't actually simulate the rate of fixation (and assume that N uptake is instantaneous) - ! here, so instead the limitation term is here rolled into the cost function. - - ! Here we invert the 'cost' to give the optimal N:C ratio (1/6 gN/gC) The amount of N - ! you get for a given C goes down as it gets colder, so this can be multiplied by - ! the temperature function to give a temperature-limited N:C of f/6. This number - ! can then be inverted to give a temperature limited C:N, as 1/(f/6). Which is the - ! same as 6/f, given here" - fun_cost_fix = (-1*s_fix) * 1.0_r8 / (1.25_r8* (exp(a_fix + b_fix * tc_soisno * (1._r8 - 0.5_r8 * tc_soisno / c_fix)) )) - else - fun_cost_fix = big_cost - end if ! ends up with the fixer or non-fixer decision - - end function fun_cost_fix -!========================================================================================= - real(r8) function fun_cost_active(sminn_layer,big_cost,kc_active,kn_active,rootc_dens,crootfr,smallValue) - -! Description: -! Calculate the cost of active uptake of N frm the soil. -! Code Description: -! This code is written to CLM4 by Mingjie Shi. - - implicit none -!-------------------------------------------------------------------------- -! Function result. -!-------------------------------------------------------------------------- - real(r8), intent(in) :: sminn_layer ! Amount of N (as NH4 or NO3) in the soil that is available to plants (gN/m2). - real(r8), intent(in) :: big_cost ! An arbitrary large cost (gC/gN). - real(r8), intent(in) :: kc_active ! Constant for cost of active uptake (gC/m2). - real(r8), intent(in) :: kn_active ! Constant for cost of active uptake (gC/m2). - real(r8), intent(in) :: rootc_dens ! Root carbon density in layer (gC/m3). - real(r8), intent(in) :: crootfr ! Fraction of roots that are in this layer. - real(r8), intent(in) :: smallValue ! A small number. - - if (rootc_dens > 1.e-6_r8.and.sminn_layer > smallValue) then - fun_cost_active = kn_active/sminn_layer + kc_active/rootc_dens - else -! There are very few roots in this layer. Set a high cost. - fun_cost_active = big_cost - end if - - end function fun_cost_active -!========================================================================================= - real(r8) function fun_cost_nonmyc(sminn_layer,big_cost,kc_nonmyc,kn_nonmyc,rootc_dens,crootfr,smallValue) - -! Description: -! Calculate the cost of nonmyc uptake of N frm the soil. -! Code Description: -! This code is written to CLM4 by Mingjie Shi. - - implicit none -!-------------------------------------------------------------------------- -! Function result. -!-------------------------------------------------------------------------- - real(r8), intent(in) :: sminn_layer ! Amount of N (as NH4 or NO3) in the soil that is available to plants (gN/m2). - real(r8), intent(in) :: big_cost ! An arbitrary large cost (gC/gN). - real(r8), intent(in) :: kc_nonmyc ! Constant for cost of nonmyc uptake (gC/m2). - real(r8), intent(in) :: kn_nonmyc ! Constant for cost of nonmyc uptake (gC/m2). - real(r8), intent(in) :: rootc_dens ! Root carbon density in layer (gC/m3). - real(r8), intent(in) :: crootfr ! Fraction of roots that are in this layer. - real(r8), intent(in) :: smallValue ! A small number. - - if (rootc_dens > 1.e-6_r8.and.sminn_layer > smallValue) then - fun_cost_nonmyc = kn_nonmyc / sminn_layer + kc_nonmyc / rootc_dens - else -! There are very few roots in this layer. Set a high cost. - fun_cost_nonmyc = big_cost - end if - - end function fun_cost_nonmyc - -!========================================================================== - - subroutine fun_retranslocation(p,dt,npp_to_spend,total_falling_leaf_c, & - total_falling_leaf_n, total_n_resistance, total_c_spent_retrans, & - total_c_accounted_retrans, free_n_retrans, paid_for_n_retrans, & - target_leafcn, grperc, plantCN) -! -! Description: -! This subroutine (should it be a function?) calculates the amount of N absorbed and C spent -! during retranslocation. -! Rosie Fisher. April 2016. -! !USES: - implicit none - -! !ARGUMENTS: - real(r8), intent(IN) :: total_falling_leaf_c ! INPUT gC/m2/timestep - real(r8), intent(IN) :: total_falling_leaf_n ! INPUT gC/m2/timestep - real(r8), intent(IN) :: total_n_resistance ! INPUT gC/gN - real(r8), intent(IN) :: npp_to_spend ! INPUT gN/m2/timestep - real(r8), intent(IN) :: target_leafcn ! INPUT gC/gN - real(r8), intent(IN) :: dt ! INPUT seconds - real(r8), intent(IN) :: grperc ! INPUT growth respiration fraction - real(r8), intent(IN) :: plantCN ! INPUT plant CN ratio - integer, intent(IN) :: p ! INPUT patch index - - real(r8), intent(OUT) :: total_c_spent_retrans ! OUTPUT gC/m2/timestep - real(r8), intent(OUT) :: total_c_accounted_retrans ! OUTPUT gC/m2/timestep - real(r8), intent(OUT) :: paid_for_n_retrans ! OUTPUT gN/m2/timestep - real(r8), intent(OUT) :: free_n_retrans ! OUTPUT gN/m2/timestep - - ! - ! !LOCAL VARIABLES: - real(r8) :: kresorb ! INTERNAL used factor - real(r8) :: falling_leaf_c ! INTERNAL gC/m2/timestep - real(r8) :: falling_leaf_n ! INTERNAL gN/m2/timestep - real(r8) :: falling_leaf_cn ! INTERNAL gC/gN - real(r8) :: cost_retrans_temp ! INTERNAL gC/gN - real(r8) :: leaf_n_ext ! INTERNAL gN/m2/timestep - real(r8) :: c_spent_retrans ! INTERNAL gC/m2/timestep - real(r8) :: c_accounted_retrans ! INTERNAL gC/m2/timestep - real(r8) :: npp_to_spend_temp ! INTERNAL gC/m2/timestep - real(r8) :: max_falling_leaf_cn ! INTERNAL gC/gN - real(r8) :: min_falling_leaf_cn ! INTERNAL gC/gN - real(r8) :: cost_escalation ! INTERNAL cost function parameter - integer :: iter ! INTERNAL - integer :: exitloop ! INTERNAL - ! ------------------------------------------------------------------------------- - - - ! ------------------ Initialize total fluxes. ------------------! - total_c_spent_retrans = 0.0_r8 - total_c_accounted_retrans = 0.0_r8 - c_accounted_retrans = 0.0_r8 - paid_for_n_retrans = 0.0_r8 - npp_to_spend_temp = npp_to_spend - - ! ------------------ Initial C and N pools in falling leaves. ------------------! - falling_leaf_c = total_falling_leaf_c - falling_leaf_n = total_falling_leaf_n - - ! ------------------ PARAMETERS ------------------ - max_falling_leaf_cn = target_leafcn * 3.0_r8 - min_falling_leaf_cn = target_leafcn * 1.5_r8 - cost_escalation = 1.3_r8 - - ! ------------------ Free uptake ------------------ - free_n_retrans = max(falling_leaf_n - (falling_leaf_c/min_falling_leaf_cn),0.0_r8) - falling_leaf_n = falling_leaf_n - free_n_retrans - - ! ------------------ Initial CN ratio and costs ------------------! - falling_leaf_cn = falling_leaf_c/falling_leaf_n - kresorb = (1.0_r8/target_leafcn) - cost_retrans_temp = kresorb / ((1.0_r8/falling_leaf_cn )**1.3_r8) - - ! ------------------ Iteration loops to figure out extraction limit ------------! - iter = 0 - exitloop = 0 - do while(exitloop==0.and.cost_retrans_temp .lt. total_n_resistance.and. & - falling_leaf_n.ge.0.0_r8.and.npp_to_spend.gt.0.0_r8) - ! ------------------ Spend some C on removing N ------------! - ! spend enough C to increase leaf C/N by 1 unit. - c_spent_retrans = cost_retrans_temp * (falling_leaf_n - falling_leaf_c / & - (falling_leaf_cn + 1.0_r8)) - ! don't spend more C than you have - c_spent_retrans = min(npp_to_spend_temp, c_spent_retrans) - ! N extracted, per this amount of C expenditure - leaf_n_ext = c_spent_retrans / cost_retrans_temp - ! Do not empty N pool - leaf_n_ext = min(falling_leaf_n, leaf_n_ext) - !How much C do you need to account for the N that got taken up? - c_accounted_retrans = leaf_n_ext * plantCN * (1.0_r8 + grperc) - - ! ------------------ Update leafCN, recalculate costs ------------! - falling_leaf_n = falling_leaf_n - leaf_n_ext ! remove N from falling leaves pool - if(falling_leaf_n.gt.0.0_r8)then - falling_leaf_cn = falling_leaf_c/falling_leaf_n ! C/N ratio - cost_retrans_temp = kresorb /((1.0_r8/falling_leaf_cn)**1.3_r8) ! cost function. PARAMETER - else - exitloop=1 - endif - - ! ------------------ Accumulate total fluxes ------------! - total_c_spent_retrans = total_c_spent_retrans + c_spent_retrans - total_c_accounted_retrans = total_c_accounted_retrans + c_accounted_retrans - paid_for_n_retrans = paid_for_n_retrans + leaf_n_ext - npp_to_spend_temp = npp_to_spend_temp - c_spent_retrans - c_accounted_retrans - iter = iter+1 - - ! run out of C or N - if(npp_to_spend_temp.le.0.0_r8)then - exitloop=1 - ! if we made a solving error on this (expenditure and n uptake should - ! really be solved simultaneously) - ! then remove the error from the expenditure. This changes the notional cost, - ! but only by a bit and prevents cpool errors. - - total_c_spent_retrans = total_c_spent_retrans + npp_to_spend_temp - endif - ! leaf CN is too high - if(falling_leaf_cn.ge.max_falling_leaf_cn)then - exitloop=1 - endif - ! safety check to prevent hanging code - if(iter.ge.150)then - exitloop=1 - endif - end do - - end subroutine fun_retranslocation - -!========================================================================== - -end module CNFUNMod diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 deleted file mode 100644 index 04c3e232ed..0000000000 --- a/src/biogeochem/CNFireBaseMod.F90 +++ /dev/null @@ -1,1260 +0,0 @@ -module CNFireBaseMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for fire dynamics - ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis - ! based on Li et al. (2012a,b; 2013) - ! revised in Apr, 2014 according Li et al.(2014) - ! Fire-related parameters were calibrated or tuned in Apr, 2013 based on the - ! 20th Century transient simulations at f19_g16 with (newfire05_clm45sci15_clm4_0_58) - ! a CLM4.5 version, Qian et al. (2006) atmospheric forcing, and - ! climatological lightning data. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print - use shr_strdata_mod , only : shr_strdata_advance - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use decompMod , only : gsmap_lnd_gdc2glo - use domainMod , only : ldomain - use pftconMod , only : noveg, pftcon - use abortutils , only : endrun - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use CNDVType , only : dgvs_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - use mct_mod - use CNFireMethodMod , only : cnfire_method_type - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: cnfire_base_type - - integer, private, parameter :: num_fp = 2 ! Number of pools relevent for fire - integer, private, parameter :: lit_fp = 1 ! Pool for liter - integer, private, parameter :: cwd_fp = 2 ! Pool for CWD Course woody debris - type, public :: cnfire_const_type - ! !PRIVATE MEMBER DATA: - real(r8) :: borealat = 40._r8 ! Latitude for boreal peat fires - real(r8) :: lfuel=75._r8 ! lower threshold of fuel mass (gC/m2) for ignition, Li et al.(2014) - real(r8) :: ufuel=650._r8 ! upper threshold of fuel mass(gC/m2) for ignition - real(r8) :: g0=0.05_r8 ! g(W) when W=0 m/s - real(r8) :: rh_low=30.0_r8 ! Relative humidty low (%) - real(r8) :: rh_hgh=80.0_r8 ! Relative humidty high (%) - real(r8) :: bt_min=0.3_r8 ! btran minimum (fraction) - real(r8) :: bt_max=0.7_r8 ! btran maximum (fraction) - real(r8) :: cli_scale=0.035_r8 ! global constant for deforestation fires (/d) - real(r8) :: boreal_peatfire_c = 4.2e-5_r8 ! c parameter for boreal peatland fire in Li et. al. (2013) (/hr) - real(r8) :: pot_hmn_ign_counts_alpha=0.0035_r8 ! Potential human ignition counts (alpha in Li et. al. 2012) (/person/month) - real(r8) :: non_boreal_peatfire_c = 0.001_r8 ! c parameter for non-boreal peatland fire in Li et. al. (2013) (/hr) - real(r8) :: cropfire_a1 = 0.3_r8 ! a1 parameter for cropland fire in (Li et. al., 2014) (/hr) - real(r8) :: occur_hi_gdp_tree = 0.39_r8 ! fire occurance for high GDP areas that are tree dominated (fraction) - - real(r8) :: cmb_cmplt_fact(num_fp) = (/ 0.5_r8, 0.25_r8 /) ! combustion completion factor (unitless) - end type - - ! - type, extends(cnfire_method_type) :: cnfire_base_type - private - ! !PRIVATE MEMBER DATA: - - real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency - real(r8), public, pointer :: forc_hdm(:) ! Human population density - - type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream - type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream - - - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: CNFireInit ! Initialization of CNFire - procedure, public :: CNFireReadNML ! Read in namelist for CNFire - procedure, public :: CNFireInterp ! Interpolate fire data - procedure, public :: CNFireArea ! Calculate fire area - procedure, public :: CNFireFluxes ! Calculate fire fluxes - ! - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: hdm_init ! position datasets for dynamic human population density - procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data - procedure, private :: lnfm_init ! position datasets for Lightning - procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data - end type cnfire_base_type - !----------------------------------------------------------------------- - - type(cnfire_const_type), public, protected :: cnfire_const ! Fire constants shared by Li versons - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine CNFireInit( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize CN Fire module - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens ) then - ! Allocate lightning forcing data - allocate( this%forc_lnfm(bounds%begg:bounds%endg) ) - this%forc_lnfm(bounds%begg:) = nan - ! Allocate pop dens forcing data - allocate( this%forc_hdm(bounds%begg:bounds%endg) ) - this%forc_hdm(bounds%begg:) = nan - - call this%hdm_init(bounds, NLFilename) - call this%hdm_interp(bounds) - call this%lnfm_init(bounds, NLFilename) - call this%lnfm_interp(bounds) - end if - - end subroutine CNFireInit - - !----------------------------------------------------------------------- - subroutine CNFireReadNML( this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CNFire - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNFireReadNML' - character(len=*), parameter :: nmlname = 'lifire_inparm' - !----------------------------------------------------------------------- - real(r8) :: cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha - real(r8) :: non_boreal_peatfire_c, cropfire_a1 - real(r8) :: rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree - real(r8) :: lfuel, ufuel, cmb_cmplt_fact(num_fp) - - namelist /lifire_inparm/ cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha, & - non_boreal_peatfire_c, cropfire_a1, & - rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree, & - lfuel, ufuel, cmb_cmplt_fact - - if ( this%need_lightning_and_popdens ) then - cli_scale = cnfire_const%cli_scale - boreal_peatfire_c = cnfire_const%boreal_peatfire_c - non_boreal_peatfire_c = cnfire_const%non_boreal_peatfire_c - pot_hmn_ign_counts_alpha = cnfire_const%pot_hmn_ign_counts_alpha - cropfire_a1 = cnfire_const%cropfire_a1 - rh_low = cnfire_const%rh_low - rh_hgh = cnfire_const%rh_hgh - lfuel = cnfire_const%lfuel - ufuel = cnfire_const%ufuel - bt_min = cnfire_const%bt_min - bt_max = cnfire_const%bt_max - occur_hi_gdp_tree = cnfire_const%occur_hi_gdp_tree - cmb_cmplt_fact(:) = cnfire_const%cmb_cmplt_fact(:) - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=lifire_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (cli_scale , mpicom) - call shr_mpi_bcast (boreal_peatfire_c , mpicom) - call shr_mpi_bcast (pot_hmn_ign_counts_alpha, mpicom) - call shr_mpi_bcast (non_boreal_peatfire_c , mpicom) - call shr_mpi_bcast (cropfire_a1 , mpicom) - call shr_mpi_bcast (rh_low , mpicom) - call shr_mpi_bcast (rh_hgh , mpicom) - call shr_mpi_bcast (lfuel , mpicom) - call shr_mpi_bcast (ufuel , mpicom) - call shr_mpi_bcast (bt_min , mpicom) - call shr_mpi_bcast (bt_max , mpicom) - call shr_mpi_bcast (occur_hi_gdp_tree , mpicom) - call shr_mpi_bcast (cmb_cmplt_fact , mpicom) - - cnfire_const%cli_scale = cli_scale - cnfire_const%boreal_peatfire_c = boreal_peatfire_c - cnfire_const%non_boreal_peatfire_c = non_boreal_peatfire_c - cnfire_const%pot_hmn_ign_counts_alpha = pot_hmn_ign_counts_alpha - cnfire_const%cropfire_a1 = cropfire_a1 - cnfire_const%rh_low = rh_low - cnfire_const%rh_hgh = rh_hgh - cnfire_const%lfuel = lfuel - cnfire_const%ufuel = ufuel - cnfire_const%bt_min = bt_min - cnfire_const%bt_max = bt_max - cnfire_const%occur_hi_gdp_tree = occur_hi_gdp_tree - cnfire_const%cmb_cmplt_fact(:) = cmb_cmplt_fact(:) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=lifire_inparm) - write(iulog,*) ' ' - end if - end if - - end subroutine CNFireReadNML - - !----------------------------------------------------------------------- - subroutine CNFireInterp(this,bounds) - ! - ! !DESCRIPTION: - ! Interpolate CN Fire datasets - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens ) then - call this%hdm_interp(bounds) - call this%lnfm_interp(bounds) - end if - - end subroutine CNFireInterp - - !----------------------------------------------------------------------- - subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - ! - - call endrun( 'cnfire_base::CNFireArea: this method MUST be implemented!' ) - - end subroutine CNFireArea - - !----------------------------------------------------------------------- - subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch, & - totsomc_col, decomp_cpools_vr_col, decomp_npools_vr_col, somc_fire_col) - ! - ! !DESCRIPTION: - ! Fire effects routine for coupled carbon-nitrogen code (CN). - ! Relies primarily on estimate of fractional area burned, from CNFireArea(). - ! - ! Total fire carbon emissions (g C/m2 land area/yr) - ! =avg(COL_FIRE_CLOSS)*seconds_per_year + avg(SOMC_FIRE)*seconds_per_year + - ! avg(LF_CONV_CFLUX)*seconds_per_year*min(1.0,avg(LFC2)*seconds_per_year)*0.8 - ! where avg means the temporal average in a year - ! seconds_per_year is the number of seconds in a year. - ! - ! !USES: - use clm_time_manager , only: get_step_size,get_days_per_year,get_curr_date - use clm_varpar , only: max_patch_per_col - use clm_varctl , only: use_cndv, spinup_state - use clm_varcon , only: secspday - use pftconMod , only: nc3crop - use dynSubgridControlMod , only: run_has_transient_landcover - use clm_varpar , only: nlevdecomp_full, ndecomp_pools, nlevdecomp - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: totsomc_col(bounds%begc:) ! (gC/m2) total soil organic matter C - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(in) :: decomp_npools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning - ! - ! !LOCAL VARIABLES: - integer :: g,c,p,j,l,pi,kyr, kmo, kda, mcsec ! indices - integer :: fp,fc ! filter indices - real(r8):: f ! rate for fire effects (1/s) - real(r8):: m ! acceleration factor for fuel carbon - real(r8):: dt ! time step variable (s) - real(r8):: dayspyr ! days per year - logical :: transient_landcover ! whether this run has any prescribed transient landcover - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(croot_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(stem_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(totsomc_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_npools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(somc_fire_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - - ! NOTE: VR = Vertically Resolved - ! conv. = conversion - ! frac. = fraction - ! BAF = Burned Area Fraction - ! ann. = annual - ! GC = gridcell - ! dt = timestep - ! C = Carbon - ! N = Nitrogen - ! emis. = emissions - ! decomp. = decomposing - - associate( & - croot_prof => croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - totsomc => totsomc_col , & ! Input: [real(r8) (:) ] (gC/m2) total soil organic matter C - decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - decomp_npools_vr => decomp_npools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - somc_fire => somc_fire_col , & ! Output: [real(r8) (:) ] (gC/m2/s) fire C emissions due to peat burning - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - is_litter => decomp_cascade_con%is_litter , & ! Input: [logical (:) ] TRUE => pool is a litter pool - - woody => pftcon%woody , & ! Input: woody lifeform (1=woody, 0=not woody) - cc_leaf => pftcon%cc_leaf , & ! Input: - cc_lstem => pftcon%cc_lstem , & ! Input: - cc_dstem => pftcon%cc_dstem , & ! Input: - cc_other => pftcon%cc_other , & ! Input: - fm_leaf => pftcon%fm_leaf , & ! Input: - fm_lstem => pftcon%fm_lstem , & ! Input: - fm_other => pftcon%fm_other , & ! Input: - fm_root => pftcon%fm_root , & ! Input: - fm_lroot => pftcon%fm_lroot , & ! Input: - fm_droot => pftcon%fm_droot , & ! Input: - lf_flab => pftcon%lf_flab , & ! Input: - lf_fcel => pftcon%lf_fcel , & ! Input: - lf_flig => pftcon%lf_flig , & ! Input: - fr_flab => pftcon%fr_flab , & ! Input: - fr_fcel => pftcon%fr_fcel , & ! Input: - fr_flig => pftcon%fr_flig , & ! Input: - - cmb_cmplt_fact => cnfire_const%cmb_cmplt_fact , & ! Input: [real(r8) (:) ] Combustion completion factor (unitless) - - nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m2) - - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - farea_burned => cnveg_state_inst%farea_burned_col , & ! Input: [real(r8) (:) ] fractional area burned (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Input: [real(r8) (:) ] burned area out of conv. region due to LU fire - fbac => cnveg_state_inst%fbac_col , & ! Input: [real(r8) (:) ] total burned area out of conversion (/sec) - baf_crop => cnveg_state_inst%baf_crop_col , & ! Input: [real(r8) (:) ] BAF for cropland - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Input: [real(r8) (:) ] BAF for peatlabd - trotr1_col => cnveg_state_inst%trotr1_col , & ! Input: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Input: [real(r8) (:) ] patch weight of BDT on the column (0-1) - dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Input: [real(r8) (:) ] ann. decreased frac. coverage of BET+BDT (0-1) on GC - lfc => cnveg_state_inst%lfc_col , & ! Input: [real(r8) (:) ] conv. area frac. of BET+BDT that haven't burned before - lfc2 => cnveg_state_inst%lfc2_col , & ! Output: [real(r8) (:) ] conv. area frac. of BET+BDT burned this dt (/sec) - - leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C transfer - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage - gresp_xfer => cnveg_carbonstate_inst%gresp_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration transfer - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N transfer - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn => cnveg_nitrogenstate_inst%deadstemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N transfer - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N transfer - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn => cnveg_nitrogenstate_inst%deadcrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - - fire_mortality_c_to_cwdc => cnveg_carbonflux_inst%fire_mortality_c_to_cwdc_col , & ! Input: [real(r8) (:,:) ] C flux fire mortality to CWD (gC/m3/s) - m_leafc_to_fire => cnveg_carbonflux_inst%m_leafc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc - m_leafc_storage_to_fire => cnveg_carbonflux_inst%m_leafc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_storage - m_leafc_xfer_to_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_xfer - m_livestemc_to_fire => cnveg_carbonflux_inst%m_livestemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from livestemc - m_livestemc_storage_to_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_storage - m_livestemc_xfer_to_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_xfer - m_deadstemc_to_fire => cnveg_carbonflux_inst%m_deadstemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_deadstemc_storage_to_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_storage - m_deadstemc_xfer_to_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_frootc_to_fire => cnveg_carbonflux_inst%m_frootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc - m_frootc_storage_to_fire => cnveg_carbonflux_inst%m_frootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_storage - m_frootc_xfer_to_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_xfer - m_livecrootc_to_fire => cnveg_carbonflux_inst%m_livecrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc - m_livecrootc_storage_to_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_storage - m_livecrootc_xfer_to_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_xfer - m_deadcrootc_to_fire => cnveg_carbonflux_inst%m_deadcrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc - m_deadcrootc_storage_to_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_storage - m_deadcrootc_xfer_to_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_xfer - m_gresp_storage_to_fire => cnveg_carbonflux_inst%m_gresp_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_storage - m_gresp_xfer_to_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_xfer - m_leafc_to_litter_fire => cnveg_carbonflux_inst%m_leafc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_storage_to_litter_fire => cnveg_carbonflux_inst%m_leafc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_deadstemc_fire => cnveg_carbonflux_inst%m_livestemc_to_deadstemc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_to_litter_fire => cnveg_carbonflux_inst%m_frootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_frootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_deadcrootc_fire => cnveg_carbonflux_inst%m_livecrootc_to_deadcrootc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_decomp_cpools_to_fire_vr => cnveg_carbonflux_inst%m_decomp_cpools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3/s) VR decomp. C fire loss - m_c_to_litr_met_fire => cnveg_carbonflux_inst%m_c_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ] - m_c_to_litr_cel_fire => cnveg_carbonflux_inst%m_c_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ] - m_c_to_litr_lig_fire => cnveg_carbonflux_inst%m_c_to_litr_lig_fire_col , & ! Output: [real(r8) (:,:) ] - - fire_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%fire_mortality_n_to_cwdn_col , & ! Input: [real(r8) (:,:) ] N flux fire mortality to CWD (gN/m3/s) - m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn - m_leafn_storage_to_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_storage - m_leafn_xfer_to_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_xfer - m_livestemn_to_fire => cnveg_nitrogenflux_inst%m_livestemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn - m_livestemn_storage_to_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_s - m_livestemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_xfer - m_deadstemn_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn - m_deadstemn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_storage - m_deadstemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_xfer - m_frootn_to_fire => cnveg_nitrogenflux_inst%m_frootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn - m_frootn_storage_to_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_storage - m_frootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_xfer - m_livecrootn_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. m_livecrootn_to_fire - m_livecrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_storage - m_livecrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_xfer - m_deadcrootn_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn - m_deadcrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_storage - m_deadcrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_xfer - m_retransn_to_fire => cnveg_nitrogenflux_inst%m_retransn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. retransn - m_leafn_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_deadstemn_fire => cnveg_nitrogenflux_inst%m_livestemn_to_deadstemn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_deadcrootn_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_deadcrootn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_decomp_npools_to_fire_vr => cnveg_nitrogenflux_inst%m_decomp_npools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] VR decomp. N fire loss (gN/m3/s) - m_n_to_litr_met_fire => cnveg_nitrogenflux_inst%m_n_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ] - m_n_to_litr_cel_fire => cnveg_nitrogenflux_inst%m_n_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ] - m_n_to_litr_lig_fire => cnveg_nitrogenflux_inst%m_n_to_litr_lig_fire_col & ! Output: [real(r8) (:,:) ] - ) - - transient_landcover = run_has_transient_landcover() - - ! Get model step size - ! calculate burned area fraction per sec - dt = real( get_step_size(), r8 ) - - dayspyr = get_days_per_year() - ! - ! patch loop - ! - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8)then - ! For non-crop (bare-soil and natural vegetation) - if (transient_landcover) then - f = (fbac(c)-baf_crop(c))/(1.0_r8-cropf_col(c)) - else - f = (farea_burned(c)-baf_crop(c))/(1.0_r8-cropf_col(c)) - end if - else - ! For crops - if(cropf_col(c) > 0._r8)then - f = baf_crop(c) /cropf_col(c) - else - f = 0._r8 - end if - end if - - ! apply this rate to the patch state variables to get flux rates - ! biomass burning - ! carbon fluxes - m = 1._r8 - if (spinup_state == 2) then - m = 10._r8 - end if - - m_leafc_to_fire(p) = leafc(p) * f * cc_leaf(patch%itype(p)) - m_leafc_storage_to_fire(p) = leafc_storage(p) * f * cc_other(patch%itype(p)) - m_leafc_xfer_to_fire(p) = leafc_xfer(p) * f * cc_other(patch%itype(p)) - m_livestemc_to_fire(p) = livestemc(p) * f * cc_lstem(patch%itype(p)) - m_livestemc_storage_to_fire(p) = livestemc_storage(p) * f * cc_other(patch%itype(p)) - m_livestemc_xfer_to_fire(p) = livestemc_xfer(p) * f * cc_other(patch%itype(p)) - m_deadstemc_to_fire(p) = deadstemc(p) * f * cc_dstem(patch%itype(p)) * m - m_deadstemc_storage_to_fire(p) = deadstemc_storage(p) * f * cc_other(patch%itype(p)) - m_deadstemc_xfer_to_fire(p) = deadstemc_xfer(p) * f * cc_other(patch%itype(p)) - m_frootc_to_fire(p) = frootc(p) * f * 0._r8 - m_frootc_storage_to_fire(p) = frootc_storage(p) * f * cc_other(patch%itype(p)) - m_frootc_xfer_to_fire(p) = frootc_xfer(p) * f * cc_other(patch%itype(p)) - m_livecrootc_to_fire(p) = livecrootc(p) * f * 0._r8 - m_livecrootc_storage_to_fire(p) = livecrootc_storage(p) * f * cc_other(patch%itype(p)) - m_livecrootc_xfer_to_fire(p) = livecrootc_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootc_to_fire(p) = deadcrootc(p) * f * 0._r8 - m_deadcrootc_storage_to_fire(p) = deadcrootc_storage(p) * f* cc_other(patch%itype(p)) - m_deadcrootc_xfer_to_fire(p) = deadcrootc_xfer(p) * f * cc_other(patch%itype(p)) - m_gresp_storage_to_fire(p) = gresp_storage(p) * f * cc_other(patch%itype(p)) - m_gresp_xfer_to_fire(p) = gresp_xfer(p) * f * cc_other(patch%itype(p)) - - - ! nitrogen fluxes - m_leafn_to_fire(p) = leafn(p) * f * cc_leaf(patch%itype(p)) - m_leafn_storage_to_fire(p) = leafn_storage(p) * f * cc_other(patch%itype(p)) - m_leafn_xfer_to_fire(p) = leafn_xfer(p) * f * cc_other(patch%itype(p)) - m_livestemn_to_fire(p) = livestemn(p) * f * cc_lstem(patch%itype(p)) - m_livestemn_storage_to_fire(p) = livestemn_storage(p) * f * cc_other(patch%itype(p)) - m_livestemn_xfer_to_fire(p) = livestemn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadstemn_to_fire(p) = deadstemn(p) * f * cc_dstem(patch%itype(p)) * m - m_deadstemn_storage_to_fire(p) = deadstemn_storage(p) * f * cc_other(patch%itype(p)) - m_deadstemn_xfer_to_fire(p) = deadstemn_xfer(p) * f * cc_other(patch%itype(p)) - m_frootn_to_fire(p) = frootn(p) * f * 0._r8 - m_frootn_storage_to_fire(p) = frootn_storage(p) * f * cc_other(patch%itype(p)) - m_frootn_xfer_to_fire(p) = frootn_xfer(p) * f * cc_other(patch%itype(p)) - m_livecrootn_to_fire(p) = livecrootn(p) * f * 0._r8 - m_livecrootn_storage_to_fire(p) = livecrootn_storage(p) * f * cc_other(patch%itype(p)) - m_livecrootn_xfer_to_fire(p) = livecrootn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootn_to_fire(p) = deadcrootn(p) * f * 0._r8 - m_deadcrootn_xfer_to_fire(p) = deadcrootn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootn_storage_to_fire(p) = deadcrootn_storage(p) * f * cc_other(patch%itype(p)) - m_retransn_to_fire(p) = retransn(p) * f * cc_other(patch%itype(p)) - - ! mortality due to fire - ! carbon pools - m_leafc_to_litter_fire(p) = leafc(p) * f * & - (1._r8 - cc_leaf(patch%itype(p))) * & - fm_leaf(patch%itype(p)) - m_leafc_storage_to_litter_fire(p) = leafc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_leafc_xfer_to_litter_fire(p) = leafc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from livestem/livecroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_livestemc_to_litter_fire(p) = livestemc(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_livestemc_storage_to_litter_fire(p) = livestemc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemc_xfer_to_litter_fire(p) = livestemc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent the fraction of plant-tissue mortality for deadstem/deadcroot - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 - m_livestemc_to_deadstemc_fire(p) = livestemc(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from deadstem/deadcroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_deadstemc_to_litter_fire(p) = deadstemc(p) * f * m * & - (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_deadstemc_storage_to_litter_fire(p) = deadstemc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadstemc_xfer_to_litter_fire(p) = deadstemc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootc_to_litter_fire(p) = frootc(p) * f * & - fm_root(patch%itype(p)) - m_frootc_storage_to_litter_fire(p) = frootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootc_xfer_to_litter_fire(p) = frootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from livestem/livecroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_livecrootc_to_litter_fire(p) = livecrootc(p) * f * & - fm_droot(patch%itype(p)) - m_livecrootc_storage_to_litter_fire(p) = livecrootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootc_xfer_to_litter_fire(p) = livecrootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootc_to_deadcrootc_fire(p) = livecrootc(p) * f * & - (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadcrootc_to_litter_fire(p) = deadcrootc(p) * f * m * & - fm_droot(patch%itype(p)) - m_deadcrootc_storage_to_litter_fire(p) = deadcrootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadcrootc_xfer_to_litter_fire(p) = deadcrootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_gresp_storage_to_litter_fire(p) = gresp_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_gresp_xfer_to_litter_fire(p) = gresp_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - - - ! nitrogen pools - m_leafn_to_litter_fire(p) = leafn(p) * f * & - (1._r8 - cc_leaf(patch%itype(p))) * & - fm_leaf(patch%itype(p)) - m_leafn_storage_to_litter_fire(p) = leafn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_leafn_xfer_to_litter_fire(p) = leafn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from livestem/livecroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_livestemn_to_litter_fire(p) = livestemn(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_livestemn_storage_to_litter_fire(p) = livestemn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemn_xfer_to_litter_fire(p) = livestemn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent the fraction of plant-tissue mortality for deadstem/deadcroot - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 - m_livestemn_to_deadstemn_fire(p) = livestemn(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from deadstem/deadcroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_deadstemn_to_litter_fire(p) = deadstemn(p) * f * m * & - (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_deadstemn_storage_to_litter_fire(p) = deadstemn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadstemn_xfer_to_litter_fire(p) = deadstemn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootn_to_litter_fire(p) = frootn(p) * f * & - fm_root(patch%itype(p)) - m_frootn_storage_to_litter_fire(p) = frootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootn_xfer_to_litter_fire(p) = frootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - ! NOTE: It looks incorrect to use fm_droot here, but it's used to represent fraction of transport from livestem/livecroot to litter - ! EBK Oct/06/2017 see bug 2516 http://bugs.cgd.ucar.edu/show_bug.cgi?id=2516 (stem and root live or dead assumed to have the same transport) - m_livecrootn_to_litter_fire(p) = livecrootn(p) * f * & - fm_droot(patch%itype(p)) - m_livecrootn_storage_to_litter_fire(p) = livecrootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootn_xfer_to_litter_fire(p) = livecrootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootn_to_deadcrootn_fire(p) = livecrootn(p) * f * & - (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadcrootn_to_litter_fire(p) = deadcrootn(p) * f * m * & - fm_droot(patch%itype(p)) - m_deadcrootn_storage_to_litter_fire(p) = deadcrootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadcrootn_xfer_to_litter_fire(p) = deadcrootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_retransn_to_litter_fire(p) = retransn(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - - if (use_cndv) then - if ( woody(patch%itype(p)) == 1._r8 )then - if ( livestemc(p)+deadstemc(p) > 0._r8 )then - nind(p) = nind(p)*(1._r8-1._r8*fm_droot(patch%itype(p))*f) - else - nind(p) = 0._r8 - end if - end if - leafcmax(p) = max(leafc(p)-m_leafc_to_fire(p)*dt, leafcmax(p)) - if (patch%itype(p) == noveg) leafcmax(p) = 0._r8 - end if - - end do ! end of patches loop - - ! fire-induced transfer of carbon and nitrogen pools to litter and cwd - - do j = 1,nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if ( patch%active(p) ) then - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & - ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafc_storage_to_litter_fire(p) + & - m_leafc_xfer_to_litter_fire(p) + & - m_gresp_storage_to_litter_fire(p) & - +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & - (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootc_storage_to_litter_fire(p) + & - m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemc_storage_to_litter_fire(p) + & - m_livestemc_xfer_to_litter_fire(p) & - +m_deadstemc_storage_to_litter_fire(p) + & - m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootc_storage_to_litter_fire(p) + & - m_livecrootc_xfer_to_litter_fire(p) & - +m_deadcrootc_storage_to_litter_fire(p) + & - m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - - m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & - ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafn_storage_to_litter_fire(p) + & - m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & - *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootn_storage_to_litter_fire(p) + & - m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemn_storage_to_litter_fire(p) + & - m_livestemn_xfer_to_litter_fire(p) & - +m_deadstemn_storage_to_litter_fire(p) + & - m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootn_storage_to_litter_fire(p) + & - m_livecrootn_xfer_to_litter_fire(p) & - +m_deadcrootn_storage_to_litter_fire(p) + & - m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - end if - end if - end do - end do - end do - ! - ! vertically-resolved decomposing C/N fire loss - ! column loop - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - - f = farea_burned(c) - - do j = 1, nlevdecomp - ! carbon fluxes - do l = 1, ndecomp_pools - if ( is_litter(l) ) then - m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * f * & - cmb_cmplt_fact(lit_fp) - end if - if ( is_cwd(l) ) then - m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * & - (f-baf_crop(c)) * cmb_cmplt_fact(cwd_fp) - end if - end do - - ! nitrogen fluxes - do l = 1, ndecomp_pools - if ( is_litter(l) ) then - m_decomp_npools_to_fire_vr(c,j,l) = decomp_npools_vr(c,j,l) * f * & - cmb_cmplt_fact(lit_fp) - end if - if ( is_cwd(l) ) then - m_decomp_npools_to_fire_vr(c,j,l) = decomp_npools_vr(c,j,l) * & - (f-baf_crop(c)) * cmb_cmplt_fact(cwd_fp) - end if - end do - - end do - end do ! end of column loop - - ! carbon loss due to deforestation fires - - if (transient_landcover) then - call get_curr_date (kyr, kmo, kda, mcsec) - do fc = 1,num_soilc - c = filter_soilc(fc) - lfc2(c)=0._r8 - if( .not. (kmo == 1 .and. kda == 1 .and. mcsec == 0) )then - if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 .and. dtrotr_col(c) > 0._r8 .and. & - lfc(c) > 0._r8 .and. fbac1(c) == 0._r8) then - lfc2(c) = max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - & - baf_peatf(c))/2.0*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt - lfc(c) = lfc(c) - max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - & - baf_peatf(c))*dt/2.0_r8)) - end if - end if - end do - end if - ! - ! Carbon loss due to peat fires - ! - ! somc_fire is not connected to clm45 soil carbon pool, ie does not decrease - ! soil carbon b/c clm45 soil carbon was very low in several peatland grids - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if( grc%latdeg(g) < cnfire_const%borealat)then - somc_fire(c)= totsomc(c)*baf_peatf(c)*6.0_r8/33.9_r8 - else - somc_fire(c)= baf_peatf(c)*2.2e3_r8 - end if - end do - - ! Fang Li has not added aerosol and trace gas emissions due to fire, yet - ! They will be added here in proportion to the carbon emission - ! Emission factors differ for various fire types - - end associate - - end subroutine CNFireFluxes - - !----------------------------------------------------------------------- - subroutine hdm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize data stream information for population density. - ! - ! !USES: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_popdens ! first year in pop. dens. stream to use - integer :: stream_year_last_popdens ! last year in pop. dens. stream to use - integer :: model_year_align_popdens ! align stream_year_first_hdm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_popdens ! population density streams filename - character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density - character(*), parameter :: subName = "('hdmdyn_init')" - character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /popd_streams/ & - stream_year_first_popdens, & - stream_year_last_popdens, & - model_year_align_popdens, & - popdensmapalgo, & - stream_fldFileName_popdens - - ! Default values for namelist - stream_year_first_popdens = 1 ! first year in stream to use - stream_year_last_popdens = 1 ! last year in stream to use - model_year_align_popdens = 1 ! align stream_year_first_popdens with this model year - stream_fldFileName_popdens = ' ' - - ! Read popd_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'popd_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=popd_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading popd_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_popdens, mpicom) - call shr_mpi_bcast(stream_year_last_popdens, mpicom) - call shr_mpi_bcast(model_year_align_popdens, mpicom) - call shr_mpi_bcast(stream_fldFileName_popdens, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'popdens_streams settings:' - write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens - write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens - write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens - write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_hdm,name="clmhdm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_popdens, & - yearLast=stream_year_last_popdens, & - yearAlign=model_year_align_popdens, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_popdens), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_popdens)/) , & - fldListFile='hdm', & - fldListModel='hdm', & - fillalgo='none', & - mapalgo=popdensmapalgo, & - calendar=get_calendar(), & - tintalgo='nearest', & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_hdm,'population density data') - endif - - ! Add history fields - call hist_addfld1d (fname='HDM', units='counts/km^2', & - avgflag='A', long_name='human population density', & - ptr_lnd=this%forc_hdm, default='inactive') - - end subroutine hdm_init - - !----------------------------------------------------------------------- - subroutine hdm_interp( this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for population density. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_hdm, mcdate, sec, mpicom, 'hdmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) - end do - - end subroutine hdm_interp - - !----------------------------------------------------------------------- - subroutine lnfm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! - ! Initialize data stream information for Lightning. - ! - ! !USES: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_lightng ! first year in Lightning stream to use - integer :: stream_year_last_lightng ! last year in Lightning stream to use - integer :: model_year_align_lightng ! align stream_year_first_lnfm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read - character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm - character(*), parameter :: subName = "('lnfmdyn_init')" - character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /light_streams/ & - stream_year_first_lightng, & - stream_year_last_lightng, & - model_year_align_lightng, & - lightngmapalgo, & - stream_fldFileName_lightng - - ! Default values for namelist - stream_year_first_lightng = 1 ! first year in stream to use - stream_year_last_lightng = 1 ! last year in stream to use - model_year_align_lightng = 1 ! align stream_year_first_lnfm with this model year - stream_fldFileName_lightng = ' ' - - ! Read light_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'light_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=light_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading light_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_lightng, mpicom) - call shr_mpi_bcast(stream_year_last_lightng, mpicom) - call shr_mpi_bcast(model_year_align_lightng, mpicom) - call shr_mpi_bcast(stream_fldFileName_lightng, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'light_stream settings:' - write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng - write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng - write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng - write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lightng, & - yearLast=stream_year_last_lightng, & - yearAlign=model_year_align_lightng, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lightng), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_lightng)/),& - fldListFile='lnfm', & - fldListModel='lnfm', & - fillalgo='none', & - mapalgo=lightngmapalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_lnfm,'Lightning data') - endif - - ! Add history fields - call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', & - avgflag='A', long_name='Lightning frequency', & - ptr_lnd=this%forc_lnfm, default='inactive') - - end subroutine lnfm_init - - !----------------------------------------------------------------------- - subroutine lnfm_interp(this, bounds ) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for Lightning. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(cnfire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) - end do - - end subroutine lnfm_interp - -end module CNFireBaseMod diff --git a/src/biogeochem/CNFireEmissionsMod.F90 b/src/biogeochem/CNFireEmissionsMod.F90 deleted file mode 100644 index 7f85ded3a3..0000000000 --- a/src/biogeochem/CNFireEmissionsMod.F90 +++ /dev/null @@ -1,377 +0,0 @@ -module CNFireEmissionsMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Gathers carbon emissions from fire sources to be sent to CAM-Chem via - ! the coupler .... - ! Created by F. Vitt, and revised by F. Li - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use PatchType, only : patch - use decompMod, only : bounds_type - use shr_fire_emis_mod, only : shr_fire_emis_comps_n, shr_fire_emis_comp_t, shr_fire_emis_linkedlist - use shr_fire_emis_mod, only : shr_fire_emis_mechcomps_n, shr_fire_emis_mechcomps - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNFireEmisUpdate - ! - ! !PRIVATE TYPES: - type, private :: emis_t - real(r8), pointer :: emis(:) - end type emis_t - ! - ! !PUBLIC TYPES: - type, public :: fireemis_type - real(r8), pointer, public :: fireflx_patch(:,:) ! carbon flux from fire sources (kg/m2/sec) - real(r8), pointer, public :: ztop_patch(:) ! height of the smoke plume (meters) - type(emis_t), pointer, private :: comp(:) ! fire emissions component (corresponds to emis factors table input file) - type(emis_t), pointer, private :: mech(:) ! cam-chem mechism species emissions - type(emis_t), private :: totfire ! sum of all species emissions - contains - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - end type fireemis_type - !------------------------------------------------------------------------ -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - - use shr_fire_emis_mod, only : shr_fire_emis_factors_file - use FireEmisFactorsMod, only : fire_emis_factors_init, fire_emis_factors_get - use clm_varpar, only : numpft - - implicit none - - ! args - class(fireemis_type) :: this - type(bounds_type), intent(in) :: bounds - - ! local vars - integer :: nmech, nemis - real(r8) :: factors(numpft) - real(r8) :: molec_wght - type(shr_fire_emis_comp_t), pointer :: emis_cmp - - if ( shr_fire_emis_mechcomps_n < 1) return - - call fire_emis_factors_init( shr_fire_emis_factors_file ) - - emis_cmp => shr_fire_emis_linkedlist - do while(associated(emis_cmp)) - allocate(emis_cmp%emis_factors(numpft)) - call fire_emis_factors_get( trim(emis_cmp%name), factors, molec_wght ) - emis_cmp%emis_factors = factors*1.e-3_r8 ! convert g/kg dry fuel to kg/kg - emis_cmp%molec_weight = molec_wght - emis_cmp => emis_cmp%next_emiscomp - enddo - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! Allocate memory for module datatypes - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varcon , only : spval - - ! !ARGUMENTS: - class(fireemis_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: beg, end, i - !--------------------------------------------------------------------- - - beg = bounds%begp - end = bounds%endp - - allocate(this%totfire%emis(beg:end)) - this%totfire%emis(beg:end) = nan - - if (shr_fire_emis_mechcomps_n>0) then - allocate(this%ztop_patch(beg:end)) - this%ztop_patch(beg:end) = spval - - allocate(this%fireflx_patch(beg:end,shr_fire_emis_mechcomps_n)) - this%fireflx_patch(beg:end,:) = spval - - allocate(this%mech(shr_fire_emis_mechcomps_n)) - do i = 1, shr_fire_emis_mechcomps_n - allocate(this%mech(i)%emis(beg:end)) - this%mech(i)%emis(beg:end) = nan - enddo - endif - - if (shr_fire_emis_comps_n>0) then - allocate(this%comp(shr_fire_emis_comps_n)) - do i = 1, shr_fire_emis_comps_n - allocate(this%comp(i)%emis(beg:end)) - this%comp(i)%emis(beg:end) = nan - enddo - endif - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - use clm_varcon , only : spval - use histFileMod , only : hist_addfld1d - - ! !ARGUMENTS: - class(fireemis_type) :: this - type(bounds_type), intent(in) :: bounds - - ! !LOCAL VARIABLES - integer :: begp, endp - integer :: imech, icomp - type(shr_fire_emis_comp_t), pointer :: emis_cmp - - if (shr_fire_emis_mechcomps_n>0) then - - emis_cmp => shr_fire_emis_linkedlist - - ! loop over fire components - emis_cmp_loop: do while(associated(emis_cmp)) - - icomp = emis_cmp%index - - call hist_addfld1d (fname='FireComp_'//trim(emis_cmp%name), units='kg/m2/sec', & - avgflag='A', long_name='fire emissions flux of '//trim(emis_cmp%name), & - ptr_patch=this%comp(icomp)%emis, default='inactive') - - emis_cmp => emis_cmp%next_emiscomp - - enddo emis_cmp_loop - - ! loop over atm chem mechanism species - do imech = 1,shr_fire_emis_mechcomps_n - - call hist_addfld1d (fname='FireMech_'//trim(shr_fire_emis_mechcomps(imech)%name), units='kg/m2/sec', & - avgflag='A', long_name='fire emissions flux of '//trim(shr_fire_emis_mechcomps(imech)%name), & - ptr_patch=this%mech(imech)%emis, default='inactive') - - enddo - - call hist_addfld1d (fname='FireEmis_TOT', units='gC/m2/sec', & - avgflag='A', long_name='Total fire emissions flux ', & - ptr_patch=this%totfire%emis, default='inactive') - - call hist_addfld1d (fname='FireEmis_ZTOP', units='m', & - avgflag='A', long_name='Top of vertical fire emissions distribution ', & - ptr_patch=this%ztop_patch, default='inactive') - endif - - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine CNFireEmisUpdate(bounds, num_soilp, filter_soilp, cnveg_cf_inst, cnveg_cs_inst, fireemis_inst ) - - use CNVegcarbonfluxType, only : cnveg_carbonflux_type - use CNVegCarbonStateType, only : cnveg_carbonstate_type - use clm_varpar, only : ndecomp_pools, nlevdecomp - use clm_varcon, only : dzsoi_decomp - - !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - type(cnveg_carbonflux_type), intent(in) :: cnveg_cf_inst - type(cnveg_carbonstate_type),intent(in) :: cnveg_cs_inst - type(fireemis_type), intent(inout) :: fireemis_inst - - !LOCAL VARIABLES: - real(r8) :: fire_flux - real(r8) :: fire_flux_lf - real(r8) :: fire_flux_lf1 - type(shr_fire_emis_comp_t), pointer :: emis_cmp - real(r8) :: emis_flux(shr_fire_emis_comps_n) - integer :: fp,p,g,c ! indices - real(r8) :: epsilon ! emission factor [ug m-2 h-1] - integer :: i, ii, icomp, imech, n_emis_comps, l, j - - if ( shr_fire_emis_mechcomps_n < 1) return - - associate( & - fire_emis => fireemis_inst%fireflx_patch, & - totfire => fireemis_inst%totfire, & - mech => fireemis_inst%mech, & - comp => fireemis_inst%comp, & - ztop => fireemis_inst%ztop_patch & - ) - - ! initialize to zero ... - fire_emis(bounds%begp:bounds%endp,:) = 0._r8 - totfire%emis(bounds%begp:bounds%endp) = 0._r8 - ztop(bounds%begp:bounds%endp) = 0._r8 - - do i = 1, shr_fire_emis_mechcomps_n - mech(i)%emis(bounds%begp:bounds%endp) = 0._r8 - enddo - - do i = 1, shr_fire_emis_comps_n - comp(i)%emis(bounds%begp:bounds%endp) = 0._r8 - enddo - - ! Begin loop over points - !_______________________________________________________________________________ - do fp = 1,num_soilp - p = filter_soilp(fp) - g = patch%gridcell(p) - c = patch%column(p) - - ! initialize EF - epsilon=0._r8 - emis_flux(:) = 0._r8 - - ! calculate fire emissions for non-bare ground PFTs - if (patch%itype(p) > 0)then - if(cnveg_cs_inst%totvegc_col(c) > 0._r8)then - fire_flux_lf1=0._r8 - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - fire_flux_lf1 = fire_flux_lf1 + & - cnveg_cf_inst%m_decomp_cpools_to_fire_vr_col(c,j,l)*dzsoi_decomp(j) - enddo - end do - fire_flux_lf = fire_flux_lf1*cnveg_cs_inst%totvegc_patch(p)/cnveg_cs_inst%totvegc_col(c) - else - fire_flux_lf=0._r8 - end if - fire_flux = fire_flux_lf & - + cnveg_cf_inst%m_leafc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from leafc - + cnveg_cf_inst%m_leafc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from leafc_storage - + cnveg_cf_inst%m_leafc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from leafc_xfer - + cnveg_cf_inst%m_livestemc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livestemc - + cnveg_cf_inst%m_livestemc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livestemc_storage - + cnveg_cf_inst%m_livestemc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livestemc_xfer - + cnveg_cf_inst%m_deadstemc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadstemc_xfer - + cnveg_cf_inst%m_deadstemc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadstemc_storage - + cnveg_cf_inst%m_deadstemc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadstemc_xfer - + cnveg_cf_inst%m_frootc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from frootc - + cnveg_cf_inst%m_frootc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from frootc_storage - + cnveg_cf_inst%m_frootc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from frootc_xfer - + cnveg_cf_inst%m_livecrootc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livecrootc - + cnveg_cf_inst%m_livecrootc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livecrootc_storage - + cnveg_cf_inst%m_livecrootc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from livecrootc_xfer - + cnveg_cf_inst%m_deadcrootc_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadcrootc - + cnveg_cf_inst%m_deadcrootc_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadcrootc_storage - + cnveg_cf_inst%m_deadcrootc_xfer_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from deadcrootc_xfer - + cnveg_cf_inst%m_gresp_storage_to_fire_patch (p) & ! (gC/m2/s) fire C emissions from gresp_storage - + cnveg_cf_inst%m_gresp_xfer_to_fire_patch (p) ! (gC/m2/s) fire C emissions from gresp_xfer - ! for diagnostics - totfire%emis(p) = fire_flux ! gC/m2/sec - - ! loop over fire components - emis_cmp => shr_fire_emis_linkedlist - emis_cmp_loop: do while(associated(emis_cmp)) - - icomp = emis_cmp%index - epsilon = emis_cmp%emis_factors(patch%itype(p)) - - comp(icomp)%emis(p) = epsilon * fire_flux* 1.e-3_r8/0.5_r8 ! (to convert gC/m2/sec to kg species/m2/sec) - emis_flux(icomp) = emis_cmp%coeff*comp(icomp)%emis(p) - - emis_cmp => emis_cmp%next_emiscomp - - enddo emis_cmp_loop - - ! sum up the emissions compontent fluxes for the fluxes of chem mechanism compounds - do imech = 1,shr_fire_emis_mechcomps_n - n_emis_comps = shr_fire_emis_mechcomps(imech)%n_emis_comps - do icomp = 1,n_emis_comps ! loop over number of emission components that make up the nth mechanism compoud - ii = shr_fire_emis_mechcomps(imech)%emis_comps(icomp)%ptr%index - fire_emis(p,imech) = fire_emis(p,imech) + emis_flux(ii) - mech(imech)%emis(p) = fire_emis(p,imech) - enddo - enddo - - ztop(p) = vert_dist_top( patch%itype(p) ) - - end if ! ivt(1:15 only) - - enddo ! fp - end associate - - end subroutine CNFireEmisUpdate - -! Private methods -!----------------------------------------------------------------------- -!ztop compiled from Val Martin et al ACP 2010, Tosca et al. JGR 2011 and Jian et al., ACP 2013 -!st ztop updated based on Val Martin pers. communication Jan2015 -!----------------------------------------------------------------------- -! not_vegetated 500 m -!PFT1: needleleaf_evergreen_temperate_tree 4000 m -!2: needleleaf_evergreen_boreal_tree 4000 m -!3: needleleaf_deciduous_boreal_tree 3000 m -!4: broadleaf_evergreen_tropical_tree 2500 m -!5: broadleaf_evergreen_temperate_tree 3000 m -!6: broadleaf_deciduous_tropical_tree 2500 m -!7: broadleaf_deciduous_temperate_tree 3000 m -!8: broadleaf_deciduous_boreal_tree 3000 m -!9: broadleaf_evergreen_shrub 2000 m -!10: broadleaf_deciduous_temperate_shrub 2000 m -!11: broadleaf_deciduous_boreal_shrub 2000 m -!12: c3_arctic_grass 1000 m -!13: c3_non-arctic_grass 1000 m -!14: c4_grass 1000 m -!15: c3_crop 1000 m -!(and all new crops: 1000m) - - function vert_dist_top( veg_type ) result(ztop) - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use pftconMod , only : noveg, ndllf_evr_tmp_tree, ndllf_evr_brl_tree - use pftconMod , only : ndllf_dcd_brl_tree, nbrdlf_evr_tmp_tree - use pftconMod , only : nbrdlf_dcd_tmp_tree, nbrdlf_dcd_brl_tree - use pftconMod , only : nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree - use pftconMod , only : nbrdlf_evr_shrub, nbrdlf_dcd_brl_shrub - use pftconMod , only : nc3_arctic_grass, nc3_nonarctic_grass - use pftconMod , only : nc3crop, nc3irrig - use pftconMod , only : npcropmin, npcropmax - implicit none - integer, intent(in) :: veg_type - - real(r8) :: ztop - - ! Bare soil, won't be used - if ( veg_type == noveg ) then - ztop = nan - ! temperate and boreal evergreen needleleaf trees - else if ( veg_type == ndllf_evr_tmp_tree .or. veg_type == ndllf_evr_brl_tree ) then - ztop = 4.e3_r8 ! m - ! temperate and boreal trees - else if ( veg_type == ndllf_dcd_brl_tree .or. veg_type == nbrdlf_evr_tmp_tree .or. & - veg_type == nbrdlf_dcd_tmp_tree .or. veg_type == nbrdlf_dcd_brl_tree ) then - ztop = 3.e3_r8 ! m - ! tropical broadleaf trees (evergreen and decidious) - else if ( veg_type == nbrdlf_evr_trp_tree .or. veg_type == nbrdlf_dcd_trp_tree ) then - ztop = 2.5e3_r8 ! m - ! shrubs - else if ( veg_type >= nbrdlf_evr_shrub .and. veg_type <= nbrdlf_dcd_brl_shrub ) then - ztop = 2.e3_r8 ! m - ! grasses - else if ( veg_type >= nc3_arctic_grass .and. veg_type <= nc3_nonarctic_grass ) then - ztop = 1.e3_r8 ! m - ! generic unmanaged crops - else if ( veg_type == nc3crop .or. veg_type <= nc3irrig ) then - ztop = 1.e3_r8 ! m - ! Prognostic crops - else if ( veg_type >= npcropmin .and. veg_type <= npcropmax ) then - ztop = 1.e3_r8 ! m - else - call endrun('ERROR:: undefined veg_type' ) - end if - - end function vert_dist_top - -end module CNFireEmissionsMod - diff --git a/src/biogeochem/CNFireFactoryMod.F90 b/src/biogeochem/CNFireFactoryMod.F90 deleted file mode 100644 index 71376116b9..0000000000 --- a/src/biogeochem/CNFireFactoryMod.F90 +++ /dev/null @@ -1,125 +0,0 @@ -module CNFireFactoryMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Factory to create an instance of cnfire_method_type. This module figures - ! out the particular type to return. - ! - ! !USES: - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - - implicit none - save - private - ! - ! !PUBLIC ROUTINES: - public :: CNFireReadNML ! read the fire namelist - public :: create_cnfire_method ! create an object of class cnfire_method_type - - ! !PRIVATE DATA MEMBERS: - character(len=80), private :: fire_method = "li2014qianfrc" - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine CNFireReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for cnfire - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNFireReadNML' - character(len=*), parameter :: nmlname = 'cnfire_inparm' - !----------------------------------------------------------------------- - - namelist /cnfire_inparm/ fire_method - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cnfire_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (fire_method, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cnfire_inparm) - write(iulog,*) ' ' - end if - end subroutine CNFireReadNML - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - function create_cnfire_method( NLFilename ) result(cnfire_method) - ! - ! !DESCRIPTION: - ! Create and return an object of cnfire_method_type. The particular type - ! is determined based on a namelist parameter. - ! - ! !USES: - use shr_kind_mod , only : SHR_KIND_CL - use CNFireMethodMod , only : cnfire_method_type - use CNFireNoFireMod , only : cnfire_nofire_type - use CNFireLi2014Mod , only : cnfire_li2014_type - use CNFireLi2016Mod , only : cnfire_li2016_type - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - class(cnfire_method_type), allocatable :: cnfire_method ! function result - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: subname = 'create_cnfire_method' - !----------------------------------------------------------------------- - - select case (trim(fire_method)) - - case ("nofire") - allocate(cnfire_method, source=cnfire_nofire_type()) - case ("li2014qianfrc") - allocate(cnfire_method, source=cnfire_li2014_type()) - case ("li2016crufrc") - allocate(cnfire_method, source=cnfire_li2016_type()) - - case default - write(iulog,*) subname//' ERROR: unknown method: ', fire_method - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end select - call cnfire_method%CNFireReadNML( NLFilename ) - - end function create_cnfire_method - -end module CNFireFactoryMod diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 deleted file mode 100644 index 3e023a68a8..0000000000 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ /dev/null @@ -1,1268 +0,0 @@ -module CNFireLi2014Mod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for fire dynamics - ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis - ! based on Li et al. (2012a,b; 2013) - ! revised in Apr, 2014 according Li et al.(2014) - ! Fire-related parameters were calibrated or tuned in Apr, 2013 based on the - ! 20th Century transient simulations at f19_g16 with (newfire05_clm45sci15_clm4_0_58) - ! a CLM4.5 version, Qian et al. (2006) atmospheric forcing, and - ! climatological lightning data. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_const_mod , only : SHR_CONST_PI,SHR_CONST_TKFRZ - use shr_infnan_mod , only : shr_infnan_isnan - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, spinup_state - use clm_varpar , only : nlevdecomp, ndecomp_pools, nlevdecomp_full - use clm_varcon , only : dzsoi_decomp - use pftconMod , only : noveg, pftcon - use abortutils , only : endrun - use decompMod , only : bounds_type - use subgridAveMod , only : p2c - use atm2lndType , only : atm2lnd_type - use CNDVType , only : dgvs_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - use CNFireMethodMod , only : cnfire_method_type - use CNFireBaseMod , only : cnfire_base_type, cnfire_const - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: cnfire_li2014_type - ! - type, extends(cnfire_base_type) :: cnfire_li2014_type - private - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: CNFireArea ! Calculate fire area - procedure, public :: CNFireFluxes - end type cnfire_li2014_type - - ! - ! !PRIVATE MEMBER DATA: - !----------------------------------------------------------------------- - - interface cnfire_li2014_type - ! initialize a new cnfire_base object - module procedure constructor - end interface cnfire_li2014_type - !----------------------------------------------------------------------- - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !------------------------------------------------------------------------ - type(cnfire_li2014_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type cnfire_base_type. - ! !ARGUMENTS: - constructor%need_lightning_and_popdens = .true. - end function constructor - - !----------------------------------------------------------------------- - subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - use clm_time_manager , only: get_step_size, get_days_per_year, get_curr_date, get_nstep - use clm_varpar , only: max_patch_per_col - use clm_varcon , only: secspday, secsphr - use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree - use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub - use dynSubgridControlMod , only: run_has_transient_landcover - ! - ! !ARGUMENTS: - class(cnfire_li2014_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p,pi,j,fc,fp,kyr, kmo, kda, mcsec ! index variables - real(r8) :: dt ! time step variable (s) - real(r8) :: m ! top-layer soil moisture (proportion) - real(r8) :: dayspyr ! days per year - real(r8) :: cli ! effect of climate on deforestation fires (0-1) - real(r8) :: cri ! thresholds used for cli, (mm/d), see Eq.(7) in Li et al.(2013) - real(r8) :: fb ! availability of fuel for regs A and C - real(r8) :: fhd ! impact of hd on agricultural fire - real(r8) :: fgdp ! impact of gdp on agricultural fire - real(r8) :: fire_m ! combustability of fuel for fire occurrence - real(r8) :: spread_m ! combustability of fuel for fire spread - real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang - integer :: i_cwd ! cwd pool - real(r8) :: lh ! anthro. ignitions (count/km2/hr) - real(r8) :: fs ! hd-dependent fires suppression (0-1) - real(r8) :: ig ! total ignitions (count/km2/hr) - real(r8) :: hdmlf ! human density - real(r8) :: btran_col(bounds%begc:bounds%endc) - logical :: transient_landcover ! whether this run has any prescribed transient landcover - real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) - real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) - real(r8), pointer :: prec60_col(:) - real(r8), pointer :: prec10_col(:) - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(totlitc_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soi17cm_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - - associate( & - totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) - decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m - lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass - ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass - rh_hgh => cnfire_const%rh_hgh , & ! Input: [real(r8) ] (%) High relative humidity - rh_low => cnfire_const%rh_low , & ! Input: [real(r8) ] (%) Low relative humidity - bt_min => cnfire_const%bt_min , & ! Input: [real(r8) ] (0-1) Minimum btran - bt_max => cnfire_const%bt_max , & ! Input: [real(r8) ] (0-1) Maximum btran - cli_scale => cnfire_const%cli_scale , & ! Input: [real(r8) ] (/d) global constant for deforestation fires - cropfire_a1 => cnfire_const%cropfire_a1 , & ! Input: [real(r8) ] (/hr) a1 parameter for cropland fire - non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire - pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts - boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire - - fsr_pft => pftcon%fsr_pft , & ! Input: - fd_pft => pftcon%fd_pft , & ! Input: - - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - wf => waterstate_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m - wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - - forc_rh => atm2lnd_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec60 => atm2lnd_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => atm2lnd_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - - dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data - peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data - abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop - fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire - farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) - nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C - fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level - fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level - lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire - lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire - lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire - lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches - trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) - dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt - lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches - - totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level - fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.C - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.A - ) - - transient_landcover = run_has_transient_landcover() - - !pft to column average - prec10_col =>prec10_col_target - call p2c(bounds, num_soilc, filter_soilc, & - prec10(bounds%begp:bounds%endp), & - prec10_col(bounds%begc:bounds%endc)) - - prec60_col =>prec60_col_target - call p2c(bounds, num_soilc, filter_soilc, & - prec60(bounds%begp:bounds%endp), & - prec60_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - leafc(bounds%begp:bounds%endp), & - leafc_col(bounds%begc:bounds%endc)) - - call get_curr_date (kyr, kmo, kda, mcsec) - dayspyr = get_days_per_year() - ! Get model step size - dt = real( get_step_size(), r8 ) - ! - ! On first time-step, just set area burned to zero and exit - ! - if ( get_nstep() == 0 )then - do fc = 1,num_soilc - c = filter_soilc(fc) - farea_burned(c) = 0._r8 - baf_crop(c) = 0._r8 - baf_peatf(c) = 0._r8 - fbac(c) = 0._r8 - fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 - end do - return - end if - ! - ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil - ! vegetation (lfwt) in vegetated column - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - cropf_col(c) = 0._r8 - lfwt(c) = 0._r8 - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop veg types - if( patch%itype(p) > nc4_grass )then - cropf_col(c) = cropf_col(c) + patch%wtcol(p) - end if - ! For natural vegetation (non-crop and non-bare-soil) - if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then - lfwt(c) = lfwt(c) + patch%wtcol(p) - end if - end if - end do - end do - ! - ! Calculate crop fuel - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - fuelc_crop(c)=0._r8 - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop PFTs, fuel load includes leaf and litter; only - ! column-level litter carbon - ! is available, so we use leaf carbon to estimate the - ! litter carbon for crop PFTs - if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then - fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & - leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & - totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) - end if - end if - end do - end do - ! - ! Calculate noncrop column variables - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - fsr_col(c) = 0._r8 - fd_col(c) = 0._r8 - rootc_col(c) = 0._r8 - lgdp_col(c) = 0._r8 - lgdp1_col(c) = 0._r8 - lpop_col(c) = 0._r8 - btran_col(c) = 0._r8 - wtlf(c) = 0._r8 - trotr1_col(c)= 0._r8 - trotr2_col(c)= 0._r8 - if (transient_landcover) then - dtrotr_col(c)=0._r8 - end if - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - ! For non-crop -- natural vegetation and bare-soil - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then - if( .not. shr_infnan_isnan(btran2(p))) then - if (btran2(p) <= 1._r8 ) then - btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) - wtlf(c) = wtlf(c)+patch%wtcol(p) - end if - end if - - ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen - ! and deciduous tropical trees (used to determine if a column is - ! tropical closed forest) use the current fractions. However, I think - ! they are used in code that applies to land cover change. Note that - ! land cover change is currently generated on the first time step of the - ! year (even though the fire code sees the annually-smoothed dwt). Thus, - ! I think that, for this to be totally consistent, this code should - ! consider the fractional coverage of each PFT prior to the relevant - ! land cover change event. (These fractions could be computed in the - ! code that handles land cover change, so that the fire code remains - ! agnostic to exactly how and when land cover change happens.) - ! - ! For example, if a year started with fractional coverages of - ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then - ! the start-of-year land cover change reduced both of these to 0.2: The - ! current code would consider the column to NOT be tropical closed - ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), - ! whereas in fact the land cover change occurred when the column *was* - ! tropical closed forest. - if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) - end if - if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) - end if - - if (transient_landcover) then - if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then - if(dwt_smoothed(p) < 0._r8)then - ! Land cover change in CLM happens all at once on the first time - ! step of the year. However, the fire code needs deforestation - ! rates throughout the year, in order to combine these - ! deforestation rates with the current season's climate. So we - ! use a smoothed version of dwt. - ! - ! This isn't ideal, because the carbon stocks that the fire code - ! is operating on will have decreased by the full annual amount - ! before the fire code does anything. But the biggest effect of - ! these deforestation fires is as a trigger for other fires, and - ! the C fluxes are merely diagnostic so don't need to be - ! conservative, so this isn't a big issue. - ! - ! (Actually, it would be even better if the fire code had a - ! realistic breakdown of annual deforestation into the - ! different seasons. But having deforestation spread evenly - ! throughout the year is much better than having it all - ! concentrated on January 1.) - dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) - end if - end if - end if - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - - fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) - - if( lfwt(c) /= 0.0_r8 )then - hdmlf=this%forc_hdm(g) - - ! all these constants are in Li et al. BG (2012a,b;2013) - - if( hdmlf > 0.1_r8 )then - ! For NOT bare-soil - if( patch%itype(p) /= noveg )then - ! For shrub and grass (crop already excluded above) - if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass - lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & - /(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/7._r8)))*patch%wtcol(p)/lfwt(c) - lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/lfwt(c) - else ! for trees - if( gdp_lf(c) > 20._r8 )then - lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - end if - if( gdp_lf(c) > 20._r8 )then - lgdp1_col(c) = lgdp1_col(c)+0.62_r8*patch%wtcol(p)/lfwt(c) - else - if( gdp_lf(c) > 8._r8 ) then - lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/lfwt(c) - else - lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/lfwt(c) - end if - end if - lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/125._r8)))*patch%wtcol(p)/lfwt(c) - end if - end if - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/lfwt(c) - lpop_col(c) = lpop_col(c)+patch%wtcol(p)/lfwt(c) - end if - end if - - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) - end if - end if - end do - end do - - ! estimate annual decreased fractional coverage of BET+BDT - ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning - - if (transient_landcover) then - do fc = 1,num_soilc - c = filter_soilc(fc) - if( dtrotr_col(c) > 0._r8 )then - if( kmo == 1 .and. kda == 1 .and. mcsec == 0)then - lfc(c) = 0._r8 - end if - if( kmo == 1 .and. kda == 1 .and. mcsec == dt)then - lfc(c) = dtrotr_col(c)*dayspyr*secspday/dt - end if - else - lfc(c)=0._r8 - end if - end do - end if - ! - ! calculate burned area fraction in cropland - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - baf_crop(c)=0._r8 - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then - burndate(p) = 10000 ! init. value; actual range [0 365] - end if - end do - - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - hdmlf=this%forc_hdm(g) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop - if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. forc_rain(c)+forc_snow(c) == 0._r8 .and. & - burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time - - ! calculate human density impact on ag. fire - fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) - - ! calculate impact of GDP on ag. fire - fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) - - ! calculate burned area - fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) - - ! crop fire only for generic crop types at this time - ! managed crops are treated as grasses if crop model is turned on - baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fb*fhd*fgdp*patch%wtcol(p) - if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then - burndate(p)=kda - end if - end if - end if - end do - end do - ! - ! calculate peatland fire - ! - do fc = 1, num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - if(grc%latdeg(g) < cnfire_const%borealat )then - baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & - 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) - else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & - max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & - (1._r8-fsat(c)) - end if - end do - ! - ! calculate other fires - ! - - ! Set the number of timesteps for e-folding. - ! When the simulation has run fewer than this number of steps, - ! re-scale the e-folding time to get a stable early estimate. - - ! find which pool is the cwd pool - i_cwd = 0 - do l = 1, ndecomp_pools - if ( is_cwd(l) ) then - i_cwd = l - endif - end do - - ! - ! begin column loop to calculate fractional area affected by fire - ! - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - hdmlf=this%forc_hdm(g) - if( cropf_col(c) < 1.0 )then - if (trotr1_col(c)+trotr2_col(c)>0.6_r8) then - farea_burned(c)=min(1.0_r8,baf_crop(c)+baf_peatf(c)) - else - fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) - do j = 1, nlevdecomp - fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) - end do - fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) - fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) - m = max(0._r8,wf(c)) - fire_m = exp(-SHR_CONST_PI *(m/0.69_r8)**2)*(1.0_r8 - max(0._r8, & - min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))))* & - min(1._r8,exp(SHR_CONST_PI*(forc_t(c)-SHR_CONST_TKFRZ)/10._r8)) - lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 - fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) - ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(3._r8*grc%lat(g)))*0.25_r8)*(1._r8-fs)*(1._r8-cropf_col(c)) - nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec - Lb_lf = 1._r8+10.0_r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) - if ( wtlf(c) > 0.0_r8 )then - spread_m = (1.0_r8 - max(0._r8,min(1._r8,(btran_col(c)/wtlf(c)-bt_min)/ & - (bt_max-bt_min))))*(1.0_r8-max(0._r8, & - min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low)))) - else - spread_m = 0.0_r8 - end if - farea_burned(c) = min(1._r8,(cnfire_const%g0*spread_m*fsr_col(c)* & - fd_col(c)/1000._r8)**2*lgdp1_col(c)* & - lpop_col(c)*nfire(c)*SHR_CONST_PI*Lb_lf+ & - baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec - end if - ! - ! if landuse change data is used, calculate deforestation fires and - ! add it in the total of burned area fraction - ! - if (transient_landcover) then - if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 )then - if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & - dtrotr_col(c) <=0._r8 )then - fbac1(c) = 0._r8 - farea_burned(c) = baf_crop(c)+baf_peatf(c) - else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) - cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & - (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & - max(0.0005_r8,min(1._r8,19._r8*dtrotr_col(c)*dayspyr*secspday/dt-0.001_r8))* & - max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) - farea_burned(c) = cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) - ! burned area out of conversion region due to land use fire - fbac1(c) = max(0._r8,cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) - end if - ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) - else - fbac(c) = farea_burned(c) - end if - end if - - else - farea_burned(c) = min(1._r8,baf_crop(c)+baf_peatf(c)) - end if - - end do ! end of column loop - - end associate - - end subroutine CNFireArea - - !----------------------------------------------------------------------- - subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch, & - totsomc_col, decomp_cpools_vr_col, decomp_npools_vr_col, somc_fire_col) - ! - ! !DESCRIPTION: - ! Fire effects routine for coupled carbon-nitrogen code (CN). - ! Relies primarily on estimate of fractional area burned, from CNFireArea(). - ! - ! Total fire carbon emissions (g C/m2 land area/yr) - ! =avg(COL_FIRE_CLOSS)*seconds_per_year + avg(SOMC_FIRE)*seconds_per_year + - ! avg(LF_CONV_CFLUX)*seconds_per_year*min(1.0,avg(LFC2)*seconds_per_year)*0.8 - ! where avg means the temporal average in a year - ! seconds_per_year is the number of seconds in a year. - ! - ! !USES: - use clm_time_manager , only: get_step_size,get_days_per_year,get_curr_date - use clm_varpar , only: max_patch_per_col - use clm_varctl , only: use_cndv - use clm_varcon , only: secspday - use pftconMod , only: nc3crop - use dynSubgridControlMod , only: run_has_transient_landcover - ! - ! !ARGUMENTS: - class(cnfire_li2014_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: totsomc_col(bounds%begc:) ! (gC/m2) total soil organic matter C - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(in) :: decomp_npools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning - ! - ! !LOCAL VARIABLES: - integer :: g,c,p,j,l,pi,kyr, kmo, kda, mcsec ! indices - integer :: fp,fc ! filter indices - real(r8):: f ! rate for fire effects (1/s) - real(r8):: m ! acceleration factor for fuel carbon - real(r8):: dt ! time step variable (s) - real(r8):: dayspyr ! days per year - logical :: transient_landcover ! whether this run has any prescribed transient landcover - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(croot_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(stem_prof_patch) == (/bounds%endp,nlevdecomp_full/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(totsomc_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_npools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(somc_fire_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - - ! NOTE: VR = Vertically Resolved - ! conv. = conversion - ! frac. = fraction - ! BAF = Burned Area Fraction - ! ann. = annual - ! GC = gridcell - ! dt = timestep - ! C = Carbon - ! N = Nitrogen - ! emis. = emissions - ! decomp. = decomposing - - associate( & - croot_prof => croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - totsomc => totsomc_col , & ! Input: [real(r8) (:) ] (gC/m2) total soil organic matter C - decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - decomp_npools_vr => decomp_npools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - somc_fire => somc_fire_col , & ! Output: [real(r8) (:) ] (gC/m2/s) fire C emissions due to peat burning - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - is_litter => decomp_cascade_con%is_litter , & ! Input: [logical (:) ] TRUE => pool is a litter pool - - woody => pftcon%woody , & ! Input: woody lifeform (1=woody, 0=not woody) - cc_leaf => pftcon%cc_leaf , & ! Input: - cc_lstem => pftcon%cc_lstem , & ! Input: - cc_dstem => pftcon%cc_dstem , & ! Input: - cc_other => pftcon%cc_other , & ! Input: - fm_leaf => pftcon%fm_leaf , & ! Input: - fm_lstem => pftcon%fm_lstem , & ! Input: - fm_other => pftcon%fm_other , & ! Input: - fm_root => pftcon%fm_root , & ! Input: - fm_lroot => pftcon%fm_lroot , & ! Input: - fm_droot => pftcon%fm_droot , & ! Input: - lf_flab => pftcon%lf_flab , & ! Input: - lf_fcel => pftcon%lf_fcel , & ! Input: - lf_flig => pftcon%lf_flig , & ! Input: - fr_flab => pftcon%fr_flab , & ! Input: - fr_fcel => pftcon%fr_fcel , & ! Input: - fr_flig => pftcon%fr_flig , & ! Input: - - nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m2) - - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - farea_burned => cnveg_state_inst%farea_burned_col , & ! Input: [real(r8) (:) ] fractional area burned (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Input: [real(r8) (:) ] burned area out of conv. region due to LU fire - fbac => cnveg_state_inst%fbac_col , & ! Input: [real(r8) (:) ] total burned area out of conversion (/sec) - baf_crop => cnveg_state_inst%baf_crop_col , & ! Input: [real(r8) (:) ] BAF for cropland - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Input: [real(r8) (:) ] BAF for peatlabd - trotr1_col => cnveg_state_inst%trotr1_col , & ! Input: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Input: [real(r8) (:) ] patch weight of BDT on the column (0-1) - dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Input: [real(r8) (:) ] ann. decreased frac. coverage of BET+BDT (0-1) on GC - lfc => cnveg_state_inst%lfc_col , & ! Input: [real(r8) (:) ] conv. area frac. of BET+BDT that haven't burned before - lfc2 => cnveg_state_inst%lfc2_col , & ! Output: [real(r8) (:) ] conv. area frac. of BET+BDT burned this dt (/sec) - - leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C transfer - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage - gresp_xfer => cnveg_carbonstate_inst%gresp_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration transfer - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N transfer - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn => cnveg_nitrogenstate_inst%deadstemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N transfer - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N transfer - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn => cnveg_nitrogenstate_inst%deadcrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - - fire_mortality_c_to_cwdc => cnveg_carbonflux_inst%fire_mortality_c_to_cwdc_col , & ! Input: [real(r8) (:,:) ] C flux fire mortality to CWD (gC/m3/s) - m_leafc_to_fire => cnveg_carbonflux_inst%m_leafc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc - m_leafc_storage_to_fire => cnveg_carbonflux_inst%m_leafc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_storage - m_leafc_xfer_to_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_xfer - m_livestemc_to_fire => cnveg_carbonflux_inst%m_livestemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from livestemc - m_livestemc_storage_to_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_storage - m_livestemc_xfer_to_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_xfer - m_deadstemc_to_fire => cnveg_carbonflux_inst%m_deadstemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_deadstemc_storage_to_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_storage - m_deadstemc_xfer_to_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_frootc_to_fire => cnveg_carbonflux_inst%m_frootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc - m_frootc_storage_to_fire => cnveg_carbonflux_inst%m_frootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_storage - m_frootc_xfer_to_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_xfer - m_livecrootc_to_fire => cnveg_carbonflux_inst%m_livecrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc - m_livecrootc_storage_to_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_storage - m_livecrootc_xfer_to_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_xfer - m_deadcrootc_to_fire => cnveg_carbonflux_inst%m_deadcrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc - m_deadcrootc_storage_to_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_storage - m_deadcrootc_xfer_to_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_xfer - m_gresp_storage_to_fire => cnveg_carbonflux_inst%m_gresp_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_storage - m_gresp_xfer_to_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_xfer - m_leafc_to_litter_fire => cnveg_carbonflux_inst%m_leafc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_storage_to_litter_fire => cnveg_carbonflux_inst%m_leafc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_deadstemc_fire => cnveg_carbonflux_inst%m_livestemc_to_deadstemc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_to_litter_fire => cnveg_carbonflux_inst%m_frootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_frootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_deadcrootc_fire => cnveg_carbonflux_inst%m_livecrootc_to_deadcrootc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_decomp_cpools_to_fire_vr => cnveg_carbonflux_inst%m_decomp_cpools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3/s) VR decomp. C fire loss - m_c_to_litr_met_fire => cnveg_carbonflux_inst%m_c_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ] - m_c_to_litr_cel_fire => cnveg_carbonflux_inst%m_c_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ] - m_c_to_litr_lig_fire => cnveg_carbonflux_inst%m_c_to_litr_lig_fire_col , & ! Output: [real(r8) (:,:) ] - - fire_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%fire_mortality_n_to_cwdn_col , & ! Input: [real(r8) (:,:) ] N flux fire mortality to CWD (gN/m3/s) - m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn - m_leafn_storage_to_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_storage - m_leafn_xfer_to_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_xfer - m_livestemn_to_fire => cnveg_nitrogenflux_inst%m_livestemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn - m_livestemn_storage_to_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_s - m_livestemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_xfer - m_deadstemn_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn - m_deadstemn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_storage - m_deadstemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_xfer - m_frootn_to_fire => cnveg_nitrogenflux_inst%m_frootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn - m_frootn_storage_to_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_storage - m_frootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_xfer - m_livecrootn_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. m_livecrootn_to_fire - m_livecrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_storage - m_livecrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_xfer - m_deadcrootn_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn - m_deadcrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_storage - m_deadcrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_xfer - m_retransn_to_fire => cnveg_nitrogenflux_inst%m_retransn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. retransn - m_leafn_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_deadstemn_fire => cnveg_nitrogenflux_inst%m_livestemn_to_deadstemn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_deadcrootn_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_deadcrootn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_decomp_npools_to_fire_vr => cnveg_nitrogenflux_inst%m_decomp_npools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] VR decomp. N fire loss (gN/m3/s) - m_n_to_litr_met_fire => cnveg_nitrogenflux_inst%m_n_to_litr_met_fire_col , & ! Output: [real(r8) (:,:) ] - m_n_to_litr_cel_fire => cnveg_nitrogenflux_inst%m_n_to_litr_cel_fire_col , & ! Output: [real(r8) (:,:) ] - m_n_to_litr_lig_fire => cnveg_nitrogenflux_inst%m_n_to_litr_lig_fire_col & ! Output: [real(r8) (:,:) ] - ) - - transient_landcover = run_has_transient_landcover() - - ! Get model step size - ! calculate burned area fraction per sec - dt = real( get_step_size(), r8 ) - - dayspyr = get_days_per_year() - ! - ! patch loop - ! - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8)then - ! For non-crop (bare-soil and natural vegetation) - if (transient_landcover) then - f = (fbac(c)-baf_crop(c))/(1.0_r8-cropf_col(c)) - else - f = (farea_burned(c)-baf_crop(c))/(1.0_r8-cropf_col(c)) - end if - else - ! For crops - if(cropf_col(c) > 0._r8)then - f = baf_crop(c) /cropf_col(c) - else - f = 0._r8 - end if - end if - - ! apply this rate to the patch state variables to get flux rates - ! biomass burning - ! carbon fluxes - m = 1._r8 - if (spinup_state == 2) then - m = 10._r8 - end if - - m_leafc_to_fire(p) = leafc(p) * f * cc_leaf(patch%itype(p)) - m_leafc_storage_to_fire(p) = leafc_storage(p) * f * cc_other(patch%itype(p)) - m_leafc_xfer_to_fire(p) = leafc_xfer(p) * f * cc_other(patch%itype(p)) - m_livestemc_to_fire(p) = livestemc(p) * f * cc_lstem(patch%itype(p)) - m_livestemc_storage_to_fire(p) = livestemc_storage(p) * f * cc_other(patch%itype(p)) - m_livestemc_xfer_to_fire(p) = livestemc_xfer(p) * f * cc_other(patch%itype(p)) - m_deadstemc_to_fire(p) = deadstemc(p) * f * cc_dstem(patch%itype(p)) * m - m_deadstemc_storage_to_fire(p) = deadstemc_storage(p) * f * cc_other(patch%itype(p)) - m_deadstemc_xfer_to_fire(p) = deadstemc_xfer(p) * f * cc_other(patch%itype(p)) - m_frootc_to_fire(p) = frootc(p) * f * 0._r8 - m_frootc_storage_to_fire(p) = frootc_storage(p) * f * cc_other(patch%itype(p)) - m_frootc_xfer_to_fire(p) = frootc_xfer(p) * f * cc_other(patch%itype(p)) - m_livecrootc_to_fire(p) = livecrootc(p) * f * 0._r8 - m_livecrootc_storage_to_fire(p) = livecrootc_storage(p) * f * cc_other(patch%itype(p)) - m_livecrootc_xfer_to_fire(p) = livecrootc_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootc_to_fire(p) = deadcrootc(p) * f * 0._r8 - m_deadcrootc_storage_to_fire(p) = deadcrootc_storage(p) * f* cc_other(patch%itype(p)) - m_deadcrootc_xfer_to_fire(p) = deadcrootc_xfer(p) * f * cc_other(patch%itype(p)) - m_gresp_storage_to_fire(p) = gresp_storage(p) * f * cc_other(patch%itype(p)) - m_gresp_xfer_to_fire(p) = gresp_xfer(p) * f * cc_other(patch%itype(p)) - - - ! nitrogen fluxes - m_leafn_to_fire(p) = leafn(p) * f * cc_leaf(patch%itype(p)) - m_leafn_storage_to_fire(p) = leafn_storage(p) * f * cc_other(patch%itype(p)) - m_leafn_xfer_to_fire(p) = leafn_xfer(p) * f * cc_other(patch%itype(p)) - m_livestemn_to_fire(p) = livestemn(p) * f * cc_lstem(patch%itype(p)) - m_livestemn_storage_to_fire(p) = livestemn_storage(p) * f * cc_other(patch%itype(p)) - m_livestemn_xfer_to_fire(p) = livestemn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadstemn_to_fire(p) = deadstemn(p) * f * cc_dstem(patch%itype(p)) * m - m_deadstemn_storage_to_fire(p) = deadstemn_storage(p) * f * cc_other(patch%itype(p)) - m_deadstemn_xfer_to_fire(p) = deadstemn_xfer(p) * f * cc_other(patch%itype(p)) - m_frootn_to_fire(p) = frootn(p) * f * 0._r8 - m_frootn_storage_to_fire(p) = frootn_storage(p) * f * cc_other(patch%itype(p)) - m_frootn_xfer_to_fire(p) = frootn_xfer(p) * f * cc_other(patch%itype(p)) - m_livecrootn_to_fire(p) = livecrootn(p) * f * 0._r8 - m_livecrootn_storage_to_fire(p) = livecrootn_storage(p) * f * cc_other(patch%itype(p)) - m_livecrootn_xfer_to_fire(p) = livecrootn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootn_to_fire(p) = deadcrootn(p) * f * 0._r8 - m_deadcrootn_xfer_to_fire(p) = deadcrootn_xfer(p) * f * cc_other(patch%itype(p)) - m_deadcrootn_storage_to_fire(p) = deadcrootn_storage(p) * f * cc_other(patch%itype(p)) - m_retransn_to_fire(p) = retransn(p) * f * cc_other(patch%itype(p)) - - ! mortality due to fire - ! carbon pools - m_leafc_to_litter_fire(p) = leafc(p) * f * & - (1._r8 - cc_leaf(patch%itype(p))) * & - fm_leaf(patch%itype(p)) - m_leafc_storage_to_litter_fire(p) = leafc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_leafc_xfer_to_litter_fire(p) = leafc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemc_to_litter_fire(p) = livestemc(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_livestemc_storage_to_litter_fire(p) = livestemc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemc_xfer_to_litter_fire(p) = livestemc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemc_to_deadstemc_fire(p) = livestemc(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadstemc_to_litter_fire(p) = deadstemc(p) * f * m * & - (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_deadstemc_storage_to_litter_fire(p) = deadstemc_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadstemc_xfer_to_litter_fire(p) = deadstemc_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootc_to_litter_fire(p) = frootc(p) * f * & - fm_root(patch%itype(p)) - m_frootc_storage_to_litter_fire(p) = frootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootc_xfer_to_litter_fire(p) = frootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootc_to_litter_fire(p) = livecrootc(p) * f * & - fm_droot(patch%itype(p)) - m_livecrootc_storage_to_litter_fire(p) = livecrootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootc_xfer_to_litter_fire(p) = livecrootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootc_to_deadcrootc_fire(p) = livecrootc(p) * f * & - (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadcrootc_to_litter_fire(p) = deadcrootc(p) * f * m * & - fm_droot(patch%itype(p)) - m_deadcrootc_storage_to_litter_fire(p) = deadcrootc_storage(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadcrootc_xfer_to_litter_fire(p) = deadcrootc_xfer(p) * f * & - (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_gresp_storage_to_litter_fire(p) = gresp_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_gresp_xfer_to_litter_fire(p) = gresp_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - - - ! nitrogen pools - m_leafn_to_litter_fire(p) = leafn(p) * f * & - (1._r8 - cc_leaf(patch%itype(p))) * & - fm_leaf(patch%itype(p)) - m_leafn_storage_to_litter_fire(p) = leafn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_leafn_xfer_to_litter_fire(p) = leafn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemn_to_litter_fire(p) = livestemn(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_livestemn_storage_to_litter_fire(p) = livestemn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemn_xfer_to_litter_fire(p) = livestemn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livestemn_to_deadstemn_fire(p) = livestemn(p) * f * & - (1._r8 - cc_lstem(patch%itype(p))) * & - (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadstemn_to_litter_fire(p) = deadstemn(p) * f * m * & - (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) - m_deadstemn_storage_to_litter_fire(p) = deadstemn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadstemn_xfer_to_litter_fire(p) = deadstemn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootn_to_litter_fire(p) = frootn(p) * f * & - fm_root(patch%itype(p)) - m_frootn_storage_to_litter_fire(p) = frootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_frootn_xfer_to_litter_fire(p) = frootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootn_to_litter_fire(p) = livecrootn(p) * f * & - fm_droot(patch%itype(p)) - m_livecrootn_storage_to_litter_fire(p) = livecrootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootn_xfer_to_litter_fire(p) = livecrootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_livecrootn_to_deadcrootn_fire(p) = livecrootn(p) * f * & - (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) - m_deadcrootn_to_litter_fire(p) = deadcrootn(p) * f * m * & - fm_droot(patch%itype(p)) - m_deadcrootn_storage_to_litter_fire(p) = deadcrootn_storage(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_deadcrootn_xfer_to_litter_fire(p) = deadcrootn_xfer(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - m_retransn_to_litter_fire(p) = retransn(p) * f * & - (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) - - if (use_cndv) then - if ( woody(patch%itype(p)) == 1._r8 )then - if ( livestemc(p)+deadstemc(p) > 0._r8 )then - nind(p) = nind(p)*(1._r8-1._r8*fm_droot(patch%itype(p))*f) - else - nind(p) = 0._r8 - end if - end if - leafcmax(p) = max(leafc(p)-m_leafc_to_fire(p)*dt, leafcmax(p)) - if (patch%itype(p) == noveg) leafcmax(p) = 0._r8 - end if - - end do ! end of patches loop - - ! fire-induced transfer of carbon and nitrogen pools to litter and cwd - - do j = 1,nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if ( patch%active(p) ) then - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_deadcrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadstemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_deadcrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livestemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & - m_livecrootc_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livestemn_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) - fire_mortality_n_to_cwdn(c,j) = fire_mortality_n_to_cwdn(c,j) + & - m_livecrootn_to_litter_fire(p) * patch%wtcol(p) * croot_prof(p,j) - - - m_c_to_litr_met_fire(c,j)=m_c_to_litr_met_fire(c,j) + & - ((m_leafc_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafc_storage_to_litter_fire(p) + & - m_leafc_xfer_to_litter_fire(p) + & - m_gresp_storage_to_litter_fire(p) & - +m_gresp_xfer_to_litter_fire(p))*leaf_prof(p,j) + & - (m_frootc_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootc_storage_to_litter_fire(p) + & - m_frootc_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemc_storage_to_litter_fire(p) + & - m_livestemc_xfer_to_litter_fire(p) & - +m_deadstemc_storage_to_litter_fire(p) + & - m_deadstemc_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootc_storage_to_litter_fire(p) + & - m_livecrootc_xfer_to_litter_fire(p) & - +m_deadcrootc_storage_to_litter_fire(p) + & - m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_cel_fire(c,j)=m_c_to_litr_cel_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_c_to_litr_lig_fire(c,j)=m_c_to_litr_lig_fire(c,j) + & - (m_leafc_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootc_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - - m_n_to_litr_met_fire(c,j)=m_n_to_litr_met_fire(c,j) + & - ((m_leafn_to_litter_fire(p)*lf_flab(patch%itype(p)) & - +m_leafn_storage_to_litter_fire(p) + & - m_leafn_xfer_to_litter_fire(p)+m_retransn_to_litter_fire(p)) & - *leaf_prof(p,j) +(m_frootn_to_litter_fire(p)*fr_flab(patch%itype(p)) & - +m_frootn_storage_to_litter_fire(p) + & - m_frootn_xfer_to_litter_fire(p))*froot_prof(p,j) & - +(m_livestemn_storage_to_litter_fire(p) + & - m_livestemn_xfer_to_litter_fire(p) & - +m_deadstemn_storage_to_litter_fire(p) + & - m_deadstemn_xfer_to_litter_fire(p))* stem_prof(p,j)& - +(m_livecrootn_storage_to_litter_fire(p) + & - m_livecrootn_xfer_to_litter_fire(p) & - +m_deadcrootn_storage_to_litter_fire(p) + & - m_deadcrootn_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_cel_fire(c,j)=m_n_to_litr_cel_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_fcel(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_fcel(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - m_n_to_litr_lig_fire(c,j)=m_n_to_litr_lig_fire(c,j) + & - (m_leafn_to_litter_fire(p)*lf_flig(patch%itype(p))*leaf_prof(p,j) + & - m_frootn_to_litter_fire(p)*fr_flig(patch%itype(p))*froot_prof(p,j))* patch%wtcol(p) - end if - end if - end do - end do - end do - ! - ! vertically-resolved decomposing C/N fire loss - ! column loop - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - - f = farea_burned(c) - - ! change CC for litter from 0.4_r8 to 0.5_r8 and CC for CWD from 0.2_r8 - ! to 0.25_r8 according to Li et al.(2014) - do j = 1, nlevdecomp - ! carbon fluxes - do l = 1, ndecomp_pools - if ( is_litter(l) ) then - m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * f * 0.5_r8 - end if - if ( is_cwd(l) ) then - m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * & - (f-baf_crop(c)) * 0.25_r8 - end if - end do - - ! nitrogen fluxes - do l = 1, ndecomp_pools - if ( is_litter(l) ) then - m_decomp_npools_to_fire_vr(c,j,l) = decomp_npools_vr(c,j,l) * f * 0.5_r8 - end if - if ( is_cwd(l) ) then - m_decomp_npools_to_fire_vr(c,j,l) = decomp_npools_vr(c,j,l) * & - (f-baf_crop(c)) * 0.25_r8 - end if - end do - - end do - end do ! end of column loop - - ! carbon loss due to deforestation fires - - if (transient_landcover) then - call get_curr_date (kyr, kmo, kda, mcsec) - do fc = 1,num_soilc - c = filter_soilc(fc) - lfc2(c)=0._r8 - if( .not. (kmo == 1 .and. kda == 1 .and. mcsec == 0) )then - if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 .and. dtrotr_col(c) > 0._r8 .and. & - lfc(c) > 0._r8 .and. fbac1(c) == 0._r8) then - lfc2(c) = max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - & - baf_peatf(c))/2.0*dt))/(dtrotr_col(c)*dayspyr*secspday/dt)/dt - lfc(c) = lfc(c) - max(0._r8, min(lfc(c), (farea_burned(c)-baf_crop(c) - & - baf_peatf(c))*dt/2.0_r8)) - end if - end if - end do - end if - ! - ! Carbon loss due to peat fires - ! - ! somc_fire is not connected to clm45 soil carbon pool, ie does not decrease - ! soil carbon b/c clm45 soil carbon was very low in several peatland grids - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if( grc%latdeg(g) < cnfire_const%borealat)then - somc_fire(c)= totsomc(c)*baf_peatf(c)*6.0_r8/33.9_r8 - else - somc_fire(c)= baf_peatf(c)*2.2e3_r8 - end if - end do - - ! Fang Li has not added aerosol and trace gas emissions due to fire, yet - ! They will be added here in proportion to the carbon emission - ! Emission factors differ for various fire types - - end associate - - end subroutine CNFireFluxes - -end module CNFireLi2014Mod diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 deleted file mode 100644 index e108462244..0000000000 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ /dev/null @@ -1,657 +0,0 @@ -module CNFireLi2016Mod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for fire dynamics - ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis - ! based on Li et al. (2012a,b; 2013) - ! revised in Apr, 2014 according to Li et al.(2014) - ! revised in May, 2015, according to Li et al. (2015, in prep.) - ! Fire-related parameters were calibrated or tuned in May, 2015 based on the - ! 20th Century transient simulations at f19_g16 with a CLM4.5 version - ! (clm50fire), CRUNCEPv5, and climatological lightning data. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_const_mod , only : SHR_CONST_PI,SHR_CONST_TKFRZ - use shr_infnan_mod , only : shr_infnan_isnan - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varpar , only : nlevdecomp, ndecomp_pools, nlevdecomp_full - use clm_varcon , only : dzsoi_decomp - use pftconMod , only : noveg, pftcon - use abortutils , only : endrun - use decompMod , only : bounds_type - use subgridAveMod , only : p2c - use atm2lndType , only : atm2lnd_type - use CNDVType , only : dgvs_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - use SoilBiogeochemStateType , only : get_spinup_latitude_term - use CNFireMethodMod , only : cnfire_method_type - use CNFireBaseMod , only : cnfire_base_type, cnfire_const - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: cnfire_li2016_type - ! - type, extends(cnfire_base_type) :: cnfire_li2016_type - private - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: CNFireArea ! Calculate fire area - end type cnfire_li2016_type - - ! - ! !PRIVATE MEMBER DATA: - !----------------------------------------------------------------------- - - interface cnfire_li2016_type - ! initialize a new cnfire_base object - module procedure constructor - end interface cnfire_li2016_type - !----------------------------------------------------------------------- - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !------------------------------------------------------------------------ - type(cnfire_li2016_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type cnfire_base_type. - ! !ARGUMENTS: - - constructor%need_lightning_and_popdens = .true. - end function constructor - - !----------------------------------------------------------------------- - subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - use clm_time_manager , only: get_step_size, get_days_per_year, get_curr_date, get_nstep - use clm_varpar , only: max_patch_per_col - use clm_varcon , only: secspday, secsphr - use clm_varctl , only: spinup_state - use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree - use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub - use dynSubgridControlMod , only : run_has_transient_landcover - ! - ! !ARGUMENTS: - class(cnfire_li2016_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - ! - integer :: g,l,c,p,pi,j,fc,fp,kyr, kmo, kda, mcsec ! index variables - real(r8) :: dt ! time step variable (s) - real(r8) :: dayspyr ! days per year - real(r8) :: cli ! effect of climate on deforestation fires (0-1) - real(r8) :: cri ! thresholds used for cli, (mm/d), see Eq.(7) in Li et al.(2013) - real(r8) :: fb ! availability of fuel for regs A and C - real(r8) :: fhd ! impact of hd on agricultural fire - real(r8) :: fgdp ! impact of gdp on agricultural fire - real(r8) :: fire_m ! combustability of fuel for fire occurrence - real(r8) :: spread_m ! combustability of fuel for fire spread - real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang - integer :: i_cwd ! cwd pool - real(r8) :: lh ! anthro. ignitions (count/km2/hr) - real(r8) :: fs ! hd-dependent fires suppression (0-1) - real(r8) :: ig ! total ignitions (count/km2/hr) - real(r8) :: hdmlf ! human density - real(r8) :: arh, arh30 !combustability of fuel related to RH and RH30 - real(r8) :: afuel !weight for arh and arh30 - real(r8) :: btran_col(bounds%begc:bounds%endc) - logical :: transient_landcover ! whether this run has any prescribed transient landcover - real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) - real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) - real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) - real(r8), pointer :: prec60_col(:) - real(r8), pointer :: prec10_col(:) - real(r8), pointer :: rh30_col(:) - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(totlitc_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soi17cm_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - - associate( & - totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) - decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m - - lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass - ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass - rh_hgh => cnfire_const%rh_hgh , & ! Input: [real(r8) ] (%) High relative humidity - rh_low => cnfire_const%rh_low , & ! Input: [real(r8) ] (%) Low relative humidity - bt_min => cnfire_const%bt_min , & ! Input: [real(r8) ] (0-1) Minimum btran - bt_max => cnfire_const%bt_max , & ! Input: [real(r8) ] (0-1) Maximum btran - cli_scale => cnfire_const%cli_scale , & ! Input: [real(r8) ] (/d) global constant for deforestation fires - cropfire_a1 => cnfire_const%cropfire_a1 , & ! Input: [real(r8) ] (/hr) a1 parameter for cropland fire - non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire - pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts - boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire - - fsr_pft => pftcon%fsr_pft , & ! Input: - fd_pft => pftcon%fd_pft , & ! Input: - - btran2 => energyflux_inst%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - wf2 => waterstate_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool - - forc_rh => atm2lnd_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec60 => atm2lnd_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => atm2lnd_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - rh30 => atm2lnd_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data - peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data - abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop - fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire - farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) - nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C - fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level - fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level - lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire - lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire - lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire - lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches - trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) - dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt - lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches - - totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem root C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level - deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level - fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland - ) - - transient_landcover = run_has_transient_landcover() - - !pft to column average - prec10_col =>prec10_col_target - call p2c(bounds, num_soilc, filter_soilc, & - prec10(bounds%begp:bounds%endp), & - prec10_col(bounds%begc:bounds%endc)) - - prec60_col =>prec60_col_target - call p2c(bounds, num_soilc, filter_soilc, & - prec60(bounds%begp:bounds%endp), & - prec60_col(bounds%begc:bounds%endc)) - - rh30_col =>rh30_col_target - call p2c(bounds, num_soilc, filter_soilc, & - rh30(bounds%begp:bounds%endp), & - rh30_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - leafc(bounds%begp:bounds%endp), & - leafc_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - deadstemc(bounds%begp:bounds%endp), & - deadstemc_col(bounds%begc:bounds%endc)) - - call get_curr_date (kyr, kmo, kda, mcsec) - dayspyr = get_days_per_year() - ! Get model step size - dt = real( get_step_size(), r8 ) - ! - ! On first time-step, just set area burned to zero and exit - ! - if ( get_nstep() == 0 )then - do fc = 1,num_soilc - c = filter_soilc(fc) - farea_burned(c) = 0._r8 - baf_crop(c) = 0._r8 - baf_peatf(c) = 0._r8 - fbac(c) = 0._r8 - fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 - end do - return - end if - ! - ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil - ! vegetation (lfwt) in vegetated column - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - cropf_col(c) = 0._r8 - lfwt(c) = 0._r8 - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop veg types - if( patch%itype(p) > nc4_grass )then - cropf_col(c) = cropf_col(c) + patch%wtcol(p) - end if - ! For natural vegetation (non-crop and non-bare-soil) - if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then - lfwt(c) = lfwt(c) + patch%wtcol(p) - end if - end if - end do - end do - ! - ! Calculate crop fuel - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - fuelc_crop(c)=0._r8 - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop PFTs, fuel load includes leaf and litter; only - ! column-level litter carbon - ! is available, so we use leaf carbon to estimate the - ! litter carbon for crop PFTs - if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then - fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & - leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & - totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) - end if - end if - end do - end do - ! - ! Calculate noncrop column variables - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - fsr_col(c) = 0._r8 - fd_col(c) = 0._r8 - rootc_col(c) = 0._r8 - lgdp_col(c) = 0._r8 - lgdp1_col(c) = 0._r8 - lpop_col(c) = 0._r8 - btran_col(c) = 0._r8 - wtlf(c) = 0._r8 - trotr1_col(c)= 0._r8 - trotr2_col(c)= 0._r8 - if (transient_landcover) then - dtrotr_col(c)=0._r8 - end if - end do - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - ! For non-crop -- natural vegetation and bare-soil - if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then - if( .not. shr_infnan_isnan(btran2(p))) then - if (btran2(p) <= 1._r8 ) then - btran_col(c) = btran_col(c)+btran2(p)*patch%wtcol(p) - wtlf(c) = wtlf(c)+patch%wtcol(p) - end if - end if - - ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen - ! and deciduous tropical trees (used to determine if a column is - ! tropical closed forest) use the current fractions. However, I think - ! they are used in code that applies to land cover change. Note that - ! land cover change is currently generated on the first time step of the - ! year (even though the fire code sees the annually-smoothed dwt). Thus, - ! I think that, for this to be totally consistent, this code should - ! consider the fractional coverage of each PFT prior to the relevant - ! land cover change event. (These fractions could be computed in the - ! code that handles land cover change, so that the fire code remains - ! agnostic to exactly how and when land cover change happens.) - ! - ! For example, if a year started with fractional coverages of - ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then - ! the start-of-year land cover change reduced both of these to 0.2: The - ! current code would consider the column to NOT be tropical closed - ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), - ! whereas in fact the land cover change occurred when the column *was* - ! tropical closed forest. - if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) - end if - if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then - trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) - end if - - if (transient_landcover) then - if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then - if(dwt_smoothed(p) < 0._r8)then - ! Land cover change in CLM happens all at once on the first time - ! step of the year. However, the fire code needs deforestation - ! rates throughout the year, in order to combine these - ! deforestation rates with the current season's climate. So we - ! use a smoothed version of dwt. - ! - ! This isn't ideal, because the carbon stocks that the fire code - ! is operating on will have decreased by the full annual amount - ! before the fire code does anything. But the biggest effect of - ! these deforestation fires is as a trigger for other fires, and - ! the C fluxes are merely diagnostic so don't need to be - ! conservative, so this isn't a big issue. - ! - ! (Actually, it would be even better if the fire code had a - ! realistic breakdown of annual deforestation into the - ! different seasons. But having deforestation spread evenly - ! throughout the year is much better than having it all - ! concentrated on January 1.) - dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) - end if - end if - end if - if (spinup_state == 2) then - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) * 10._r8 + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - else - rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & - frootc_xfer(p) + deadcrootc(p) + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + & - livecrootc(p)+livecrootc_storage(p) + & - livecrootc_xfer(p))*patch%wtcol(p) - endif - - fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) - - hdmlf=this%forc_hdm(g) - - ! all these constants are in Li et al. BG (2012a,b;2013) - - if( hdmlf > 0.1_r8 )then - ! For NOT bare-soil - if( patch%itype(p) /= noveg )then - ! For shrub and grass (crop already excluded above) - if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass - lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & - /(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (gdp_lf(c)/7._r8)))*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else ! for trees - if( gdp_lf(c) > 20._r8 )then - lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else - if( gdp_lf(c) > 8._r8 )then - lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) - end if - end if - lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & - exp(-1._r8*SHR_CONST_PI* & - (hdmlf/125._r8)))*patch%wtcol(p)/(1._r8 -cropf_col(c)) - end if - end if - else - lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) - lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) - end if - - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) - end if - end if - end do - end do - - ! estimate annual decreased fractional coverage of BET+BDT - ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning - - if (transient_landcover) then - do fc = 1,num_soilc - c = filter_soilc(fc) - if( dtrotr_col(c) > 0._r8 )then - if( kmo == 1 .and. kda == 1 .and. mcsec == 0)then - lfc(c) = 0._r8 - end if - if( kmo == 1 .and. kda == 1 .and. mcsec == dt)then - lfc(c) = dtrotr_col(c)*dayspyr*secspday/dt - end if - else - lfc(c)=0._r8 - end if - end do - end if - ! - ! calculate burned area fraction in cropland - ! - do fc = 1,num_soilc - c = filter_soilc(fc) - baf_crop(c)=0._r8 - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then - burndate(p) = 10000 ! init. value; actual range [0 365] - end if - end do - - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - hdmlf=this%forc_hdm(g) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - ! For crop - if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. & - burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time - - ! calculate human density impact on ag. fire - fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) - - ! calculate impact of GDP on ag. fire - fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) - - ! calculate burned area - fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) - - ! crop fire only for generic crop types at this time - ! managed crops are treated as grasses if crop model is turned on - baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) - if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then - burndate(p)=kda - end if - end if - end if - end do - end do - ! - ! calculate peatland fire - ! - do fc = 1, num_soilc - c = filter_soilc(fc) - g= col%gridcell(c) - if(grc%latdeg(g) < cnfire_const%borealat )then - baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & - 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) - else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & - max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & - (1._r8-fsat(c)) - end if - end do - ! - ! calculate other fires - ! - - ! Set the number of timesteps for e-folding. - ! When the simulation has run fewer than this number of steps, - ! re-scale the e-folding time to get a stable early estimate. - - ! find which pool is the cwd pool - i_cwd = 0 - do l = 1, ndecomp_pools - if ( is_cwd(l) ) then - i_cwd = l - endif - end do - - ! - ! begin column loop to calculate fractional area affected by fire - ! - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - hdmlf=this%forc_hdm(g) - if( cropf_col(c) < 1._r8 )then - fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) - if (spinup_state == 2) then - fuelc(c) = fuelc(c) + ((10._r8 - 1._r8)*deadstemc_col(c)) - do j = 1, nlevdecomp - fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) * spinup_factor(i_cwd) & - * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - end do - else - do j = 1, nlevdecomp - fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) - end do - end if - fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) - fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) - if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then - afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) - arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) - arh30=1._r8-max(0.7_r8, min(1._r8,rh30_col(c)/90._r8)) - if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then - fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8)*((1._r8 -max(0._r8,& - min(1._r8,(btran_col(c)/wtlf(c)-bt_min)/(bt_max-bt_min))))**0.5_r8) - else - fire_m = 0._r8 - end if - lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 - fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) - ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(3*min(60._r8,abs(grc%latdeg(g)))))*0.22_r8) & - *(1._r8-fs)*(1._r8-cropf_col(c)) - nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec - Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) - spread_m = fire_m**0.5_r8 - farea_burned(c) = min(1._r8,(cnfire_const%g0*spread_m*fsr_col(c)* & - fd_col(c)/1000._r8)**2*lgdp1_col(c)* & - lpop_col(c)*nfire(c)*SHR_CONST_PI*Lb_lf+ & - baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec - else - farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) - end if - ! - ! if landuse change data is used, calculate deforestation fires and - ! add it in the total of burned area fraction - ! - if (transient_landcover) then - if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 )then - if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & - dtrotr_col(c) <=0._r8 )then - fbac1(c) = 0._r8 - farea_burned(c) = baf_crop(c)+baf_peatf(c) - else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) - cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & - (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & - max(0.0005_r8,min(1._r8,19._r8*dtrotr_col(c)*dayspyr*secspday/dt-0.001_r8))* & - max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) - farea_burned(c) = cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) - ! burned area out of conversion region due to land use fire - fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) - end if - ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) - else - fbac(c) = farea_burned(c) - end if - end if - - else - farea_burned(c) = min(1._r8,baf_crop(c)+baf_peatf(c)) - end if - - end do ! end of column loop - - end associate - - end subroutine CNFireArea - -end module CNFireLi2016Mod diff --git a/src/biogeochem/CNFireMethodMod.F90 b/src/biogeochem/CNFireMethodMod.F90 deleted file mode 100644 index d3c9afe1f8..0000000000 --- a/src/biogeochem/CNFireMethodMod.F90 +++ /dev/null @@ -1,191 +0,0 @@ -module CNFireMethodMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Abstract base class for functions to implement CN and BGC fire model - ! - ! Created by Erik Kluzek, following Bill Sack's implementation of polymorphism - ! !USES: - implicit none - private - ! - ! !PUBLIC TYPES: - public :: cnfire_method_type - - type, abstract :: cnfire_method_type - logical, public :: need_lightning_and_popdens = .true. ! If need lightning and population density - contains - - ! Initialize the fire datasets - procedure(CNFireInit_interface) , public, deferred :: CNFireInit - - ! Read namelist for the fire datasets - procedure(CNFireReadNML_interface), public, deferred :: CNFireReadNML - - ! Interpolate the fire datasets - procedure(CNFireInterp_interface) , public, deferred :: CNFireInterp - - ! Figure out the fire area - procedure(CNFireArea_interface) , public, deferred :: CNFireArea - - ! Figure out the fire fluxes - procedure(CNFireFluxes_interface) , public, deferred :: CNFireFluxes - - end type cnfire_method_type - - abstract interface - - ! Note: The following code is adapted based on what Bill Sacks has done for soil water retention curve - ! polymorphism. Therefore, I also keep some suggestions he gave there. - ! - ! - Make the interfaces contain all possible inputs that are needed by any - ! implementation; each implementation will then ignore the inputs it doesn't need. - ! - ! - For inputs that are needed only by particular implementations - and particularly - ! for inputs that are constant in time - ! pass these into the constructor, and save pointers to these inputs as components - ! of the child type that needs them. Then they aren't needed as inputs to the - ! individual routines, allowing the interfaces for these routines to remain more - ! consistent between different implementations. - ! - !--------------------------------------------------------------------------- - subroutine CNFireInit_interface(this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize CN Fire datasets - ! - ! USES - use decompMod , only : bounds_type - import :: cnfire_method_type - ! !ARGUMENTS: - class(cnfire_method_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - !----------------------------------------------------------------------- - - end subroutine CNFireInit_interface - - subroutine CNFireReadNML_interface(this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read general fire namelist - ! - ! USES - import :: cnfire_method_type - ! !ARGUMENTS: - class(cnfire_method_type) :: this - character(len=*), intent(in) :: NLFilename - !----------------------------------------------------------------------- - - end subroutine CNFireReadNML_interface - - subroutine CNFireInterp_interface(this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate CN Fire datasets - ! - ! USES - use decompMod , only : bounds_type - import :: cnfire_method_type - ! !ARGUMENTS: - class(cnfire_method_type) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - end subroutine CNFireInterp_interface - - !----------------------------------------------------------------------- - subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - import :: cnfire_method_type - ! - ! !ARGUMENTS: - class(cnfire_method_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - !----------------------------------------------------------------------- - end subroutine CNFireArea_interface - - !----------------------------------------------------------------------- - subroutine CNFireFluxes_interface (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch, & - totsomc_col, decomp_cpools_vr_col, decomp_npools_vr_col, somc_fire_col) - ! - ! !DESCRIPTION: - ! Fire effects routine for coupled carbon-nitrogen code (CN). - ! Relies primarily on estimate of fractional area burned, from CNFireArea(). - ! - ! Total fire carbon emissions (g C/m2 land area/yr) - ! =avg(COL_FIRE_CLOSS)*seconds_per_year + avg(SOMC_FIRE)*seconds_per_year + - ! avg(LF_CONV_CFLUX)*seconds_per_year*min(1.0,avg(LFC2)*seconds_per_year)*0.8 - ! where avg means the temporal average in a year - ! seconds_per_year is the number of seconds in a year. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use CNDVType , only : dgvs_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - import :: cnfire_method_type - ! - ! !ARGUMENTS: - class(cnfire_method_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: totsomc_col(bounds%begc:) ! (gC/m2) total soil organic matter C - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(in) :: decomp_npools_vr_col(bounds%begc:,1:,1:) ! (gC/m3) VR decomp. (litter, cwd, soil) - real(r8) , intent(out) :: somc_fire_col(bounds%begc:) ! (gC/m2/s) fire C emissions due to peat burning - !----------------------------------------------------------------------- - end subroutine CNFireFluxes_interface - - !----------------------------------------------------------------------- - - end interface - -end module CNFireMethodMod diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 deleted file mode 100644 index e752bc9a2f..0000000000 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ /dev/null @@ -1,130 +0,0 @@ -module CNFireNoFireMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for fire dynamics with fire explicitly turned off - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use CNFireMethodMod , only : cnfire_method_type - use CNFireBaseMod , only : cnfire_base_type - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: cnfire_nofire_type - ! - type, extends(cnfire_base_type) :: cnfire_nofire_type - private - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: CNFireArea ! Calculate fire area - end type cnfire_nofire_type - - ! - ! !PRIVATE MEMBER DATA: - !----------------------------------------------------------------------- - - interface cnfire_nofire_type - ! initialize a new cnfire_base object - module procedure constructor - end interface cnfire_nofire_type - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - type(cnfire_nofire_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type cnfire_base_type. - ! !ARGUMENTS: - constructor%need_lightning_and_popdens = .false. - end function constructor - - !----------------------------------------------------------------------- - subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - atm2lnd_inst, energyflux_inst, soilhydrology_inst, waterstate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) - ! - ! !DESCRIPTION: - ! Computes column-level burned area - ! - ! !USES: - use subgridAveMod , only : p2c - ! - ! !ARGUMENTS: - class(cnfire_nofire_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - real(r8) , intent(in) :: totlitc_col(bounds%begc:) - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) - real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - integer :: c,fc ! index variables - !----------------------------------------------------------------------- - - associate( & - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire - lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level - farea_burned => cnveg_state_inst%farea_burned_col & ! Output: [real(r8) (:) ] total fractional area burned (/sec) - ) - - !pft to column average - call p2c(bounds, num_soilc, filter_soilc, & - leafc(bounds%begp:bounds%endp), & - leafc_col(bounds%begc:bounds%endc)) - ! - ! begin column loop to calculate fractional area affected by fire - ! - do fc = 1, num_soilc - c = filter_soilc(fc) - - ! zero out the fire area - - farea_burned(c) = 0._r8 - baf_crop(c) = 0._r8 - baf_peatf(c) = 0._r8 - fbac(c) = 0._r8 - fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 - lfc(c) = 0._r8 - ! with NOFIRE, tree carbon is still removed in landuse change regions by the - ! landuse code - end do ! end of column loop - - end associate - - end subroutine CNFireArea - -end module CNFireNoFireMod diff --git a/src/biogeochem/CNGRespMod.F90 b/src/biogeochem/CNGRespMod.F90 deleted file mode 100644 index d95761e61f..0000000000 --- a/src/biogeochem/CNGRespMod.F90 +++ /dev/null @@ -1,214 +0,0 @@ -module CNGRespMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for growth respiration fluxes, - ! for coupled carbon-nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use pftconMod , only : npcropmin, pftcon - use CNVegcarbonfluxType , only : cnveg_carbonflux_type - use PatchType , only : patch - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNGResp - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - ! subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst) - subroutine CNGResp(num_soilp, filter_soilp, cnveg_carbonflux_inst, canopystate_inst, cnveg_carbonstate_inst, & - cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic carbon state - ! variables - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter patch index - real(r8):: respfact_leaf - real(r8):: respfact_froot - real(r8):: respfact_livecroot - real(r8):: respfact_livestem - real(r8):: respfact_leaf_storage - real(r8):: respfact_froot_storage - real(r8):: respfact_livecroot_storage - real(r8):: respfact_livestem_storage - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:)] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - grperc => pftcon%grperc , & ! Input: growth respiration parameter - grpnow => pftcon%grpnow , & ! Input: growth respiration parameter - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:)] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:)] shaded projected leaf area index - - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:)] - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:)] - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:)] - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:)] - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C storage - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N storage - - cpool_to_leafc => cnveg_carbonflux_inst%cpool_to_leafc_patch , & ! Input: [real(r8) (:)] - cpool_to_leafc_storage => cnveg_carbonflux_inst%cpool_to_leafc_storage_patch , & ! Input: [real(r8) (:)] - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Input: [real(r8) (:)] - cpool_to_frootc_storage => cnveg_carbonflux_inst%cpool_to_frootc_storage_patch , & ! Input: [real(r8) (:)] - cpool_to_livestemc => cnveg_carbonflux_inst%cpool_to_livestemc_patch , & ! Input: [real(r8) (:)] - cpool_to_livestemc_storage => cnveg_carbonflux_inst%cpool_to_livestemc_storage_patch , & ! Input: [real(r8) (:)] - cpool_to_deadstemc => cnveg_carbonflux_inst%cpool_to_deadstemc_patch , & ! Input: [real(r8) (:)] - cpool_to_deadstemc_storage => cnveg_carbonflux_inst%cpool_to_deadstemc_storage_patch , & ! Input: [real(r8) (:)] - cpool_to_livecrootc => cnveg_carbonflux_inst%cpool_to_livecrootc_patch , & ! Input: [real(r8) (:)] - cpool_to_livecrootc_storage => cnveg_carbonflux_inst%cpool_to_livecrootc_storage_patch , & ! Input: [real(r8) (:)] - cpool_to_deadcrootc => cnveg_carbonflux_inst%cpool_to_deadcrootc_patch , & ! Input: [real(r8) (:)] allocation to dead coarse root C (gC/m2/s) - cpool_to_deadcrootc_storage => cnveg_carbonflux_inst%cpool_to_deadcrootc_storage_patch , & ! Input: [real(r8) (:)] allocation to dead coarse root C storage (gC/m2/s) - cpool_to_grainc => cnveg_carbonflux_inst%cpool_to_grainc_patch , & ! Input: [real(r8) (:)] allocation to grain C (gC/m2/s) - cpool_to_grainc_storage => cnveg_carbonflux_inst%cpool_to_grainc_storage_patch , & ! Input: [real(r8) (:)] allocation to grain C storage (gC/m2/s) - grainc_xfer_to_grainc => cnveg_carbonflux_inst%grainc_xfer_to_grainc_patch , & ! Input: [real(r8) (:)] grain C growth from storage (gC/m2/s) - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! Input: [real(r8) (:)] leaf C growth from storage (gC/m2/s) - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Input: [real(r8) (:)] fine root C growth from storage (gC/m2/s) - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! Input: [real(r8) (:)] live stem C growth from storage (gC/m2/s) - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! Input: [real(r8) (:)] dead stem C growth from storage (gC/m2/s) - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! Input: [real(r8) (:)] live coarse root C growth from storage (gC/m2/s) - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! Input: [real(r8) (:)] dead coarse root C growth from storage (gC/m2/s) - cpool_grain_gr => cnveg_carbonflux_inst%cpool_grain_gr_patch , & ! Output: [real(r8) (:)] - cpool_grain_storage_gr => cnveg_carbonflux_inst%cpool_grain_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_grain_gr => cnveg_carbonflux_inst%transfer_grain_gr_patch , & ! Output: [real(r8) (:)] - cpool_leaf_gr => cnveg_carbonflux_inst%cpool_leaf_gr_patch , & ! Output: [real(r8) (:)] - cpool_leaf_storage_gr => cnveg_carbonflux_inst%cpool_leaf_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_leaf_gr => cnveg_carbonflux_inst%transfer_leaf_gr_patch , & ! Output: [real(r8) (:)] - cpool_froot_gr => cnveg_carbonflux_inst%cpool_froot_gr_patch , & ! Output: [real(r8) (:)] - cpool_froot_storage_gr => cnveg_carbonflux_inst%cpool_froot_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_froot_gr => cnveg_carbonflux_inst%transfer_froot_gr_patch , & ! Output: [real(r8) (:)] - cpool_livestem_gr => cnveg_carbonflux_inst%cpool_livestem_gr_patch , & ! Output: [real(r8) (:)] - cpool_livestem_storage_gr => cnveg_carbonflux_inst%cpool_livestem_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_livestem_gr => cnveg_carbonflux_inst%transfer_livestem_gr_patch , & ! Output: [real(r8) (:)] - cpool_deadstem_gr => cnveg_carbonflux_inst%cpool_deadstem_gr_patch , & ! Output: [real(r8) (:)] - cpool_deadstem_storage_gr => cnveg_carbonflux_inst%cpool_deadstem_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_deadstem_gr => cnveg_carbonflux_inst%transfer_deadstem_gr_patch , & ! Output: [real(r8) (:)] - cpool_livecroot_gr => cnveg_carbonflux_inst%cpool_livecroot_gr_patch , & ! Output: [real(r8) (:)] - cpool_livecroot_storage_gr => cnveg_carbonflux_inst%cpool_livecroot_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_livecroot_gr => cnveg_carbonflux_inst%transfer_livecroot_gr_patch , & ! Output: [real(r8) (:)] - cpool_deadcroot_gr => cnveg_carbonflux_inst%cpool_deadcroot_gr_patch , & ! Output: [real(r8) (:)] - cpool_deadcroot_storage_gr => cnveg_carbonflux_inst%cpool_deadcroot_storage_gr_patch , & ! Output: [real(r8) (:)] - transfer_deadcroot_gr => cnveg_carbonflux_inst%transfer_deadcroot_gr_patch & ! Output: [real(r8) (:)] - ) - - ! Loop through patches - ! start patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - respfact_leaf = 1.0_r8 - respfact_froot = 1.0_r8 - respfact_livecroot = 1.0_r8 - respfact_livestem = 1.0_r8 - respfact_livecroot = 1.0_r8 - respfact_livestem = 1.0_r8 - respfact_leaf_storage = 1.0_r8 - respfact_froot_storage = 1.0_r8 - respfact_livecroot_storage = 1.0_r8 - respfact_livestem_storage = 1.0_r8 - respfact_livecroot_storage = 1.0_r8 - respfact_livestem_storage = 1.0_r8 - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) * respfact_livestem - - cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * & - respfact_livestem_storage - - transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * & - respfact_livestem_storage - - cpool_grain_gr(p) = cpool_to_grainc(p) * grperc(ivt(p)) - - cpool_grain_storage_gr(p) = cpool_to_grainc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) - - transfer_grain_gr(p) = grainc_xfer_to_grainc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - end if - - ! leaf and fine root growth respiration - cpool_leaf_gr(p) = cpool_to_leafc(p) * grperc(ivt(p)) * respfact_leaf - - cpool_leaf_storage_gr(p) = cpool_to_leafc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * respfact_leaf_storage - - transfer_leaf_gr(p) = leafc_xfer_to_leafc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * respfact_leaf_storage - - cpool_froot_gr(p) = cpool_to_frootc(p) * grperc(ivt(p)) * respfact_froot * respfact_froot - - cpool_froot_storage_gr(p) = cpool_to_frootc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * respfact_froot_storage - - transfer_froot_gr(p) = frootc_xfer_to_frootc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * respfact_froot_storage - - if (woody(ivt(p)) == 1._r8) then - cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) * respfact_livestem - - cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * & -respfact_livestem_storage - - transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * & -respfact_livestem_storage - - cpool_deadstem_gr(p) = cpool_to_deadstemc(p) * grperc(ivt(p)) - - cpool_deadstem_storage_gr(p) = cpool_to_deadstemc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) - - transfer_deadstem_gr(p) = deadstemc_xfer_to_deadstemc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - - cpool_livecroot_gr(p) = cpool_to_livecrootc(p) * grperc(ivt(p)) * respfact_livecroot - - cpool_livecroot_storage_gr(p) = cpool_to_livecrootc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) * & -respfact_livecroot_storage - - transfer_livecroot_gr(p) = livecrootc_xfer_to_livecrootc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) * & -respfact_livecroot_storage - - cpool_deadcroot_gr(p) = cpool_to_deadcrootc(p) * grperc(ivt(p)) - - cpool_deadcroot_storage_gr(p) = cpool_to_deadcrootc_storage(p) * grperc(ivt(p)) * grpnow(ivt(p)) - - transfer_deadcroot_gr(p) = deadcrootc_xfer_to_deadcrootc(p) * grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - end if - - end do - - end associate - - end subroutine CNGResp - -end module CNGRespMod diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 deleted file mode 100644 index 939d4b52eb..0000000000 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ /dev/null @@ -1,493 +0,0 @@ -module CNGapMortalityMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding routines used in gap mortality for coupled carbon - ! nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use pftconMod , only : pftcon - use CNDVType , only : dgvs_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CanopyStateType , only : canopystate_type - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: CNGapMortality - - type, private :: params_type - real(r8):: am ! mortality rate based on annual rate, fractional mortality (1/yr) - real(r8):: k_mort ! coeff. of growth efficiency in mortality equation - end type params_type - ! - type(params_type), private :: params_inst - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: CNGap_PatchToColumn - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! Read in parameters - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNGapMortParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - tString='r_mort' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%am=tempr - - tString='k_mort' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_mort=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine CNGapMortality (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - dgvs_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, canopystate_inst, & - leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch) - ! - ! !DESCRIPTION: - ! Gap-phase mortality routine for coupled carbon-nitrogen code (CN) - ! - ! !USES: - use clm_time_manager , only: get_days_per_year - use clm_varpar , only: nlevdecomp_full - use clm_varcon , only: secspday - use clm_varctl , only: use_cndv, spinup_state - use pftconMod , only: npcropmin - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(canopystate_type) , intent(in) :: canopystate_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) - ! - ! !LOCAL VARIABLES: - integer :: p ! patch index - integer :: fp ! patch filter index - real(r8):: am ! rate for fractional mortality (1/yr) - real(r8):: m ! rate for fractional mortality (1/s) - real(r8):: mort_max ! asymptotic max mortality rate (/yr) - real(r8):: k_mort = 0.3 ! coeff of growth efficiency in mortality equation - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(croot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(stem_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform - - greffic => dgvs_inst%greffic_patch , & ! Input: [real(r8) (:) ] - heatstress => dgvs_inst%heatstress_patch , & ! Input: [real(r8) (:) ] - - leafcn => pftcon%leafcn , & ! Input: [real(r8) (:)] leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: [real(r8) (:)] fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: [real(r8) (:)] live wood (phloem and ray parenchyma) C:N (gC/gN) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - - nind => dgvs_inst%nind_patch & ! Output: [real(r8) (:) ] number of individuals (#/m2) added by F. Li and S. Levis - ) - - ! set the mortality rate based on annual rate - am = params_inst%am - ! set coeff of growth efficiency in mortality equation - k_mort = params_inst%k_mort - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - if (use_cndv) then - ! Stress mortality from lpj's subr Mortality. - - if (woody(ivt(p)) == 1._r8) then - - if (ivt(p) == 8) then - mort_max = 0.03_r8 ! BDT boreal - else - mort_max = 0.01_r8 ! original value for all patches - end if - - ! heatstress and greffic calculated in Establishment once/yr - - ! Mortality rate inversely related to growth efficiency - ! (Prentice et al 1993) - am = mort_max / (1._r8 + k_mort * greffic(p)) - - ! Mortality rate inversely related to growth efficiency - ! (Prentice et al 1993) - am = mort_max / (1._r8 + k_mort * greffic(p)) - - am = min(1._r8, am + heatstress(p)) - else ! lpj didn't set this for grasses; cn does - ! set the mortality rate based on annual rate - am = params_inst%am - end if - - end if - - m = am/(get_days_per_year() * secspday) - - !------------------------------------------------------ - ! patch-level gap mortality carbon fluxes - !------------------------------------------------------ - - ! displayed pools - cnveg_carbonflux_inst%m_leafc_to_litter_patch(p) = cnveg_carbonstate_inst%leafc_patch(p) * m - cnveg_carbonflux_inst%m_frootc_to_litter_patch(p) = cnveg_carbonstate_inst%frootc_patch(p) * m - cnveg_carbonflux_inst%m_livestemc_to_litter_patch(p) = cnveg_carbonstate_inst%livestemc_patch(p) * m - cnveg_carbonflux_inst%m_livecrootc_to_litter_patch(p) = cnveg_carbonstate_inst%livecrootc_patch(p) * m - if (spinup_state == 2 .and. .not. use_cndv) then !accelerate mortality of dead woody pools - cnveg_carbonflux_inst%m_deadstemc_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_patch(p) * m * 10._r8 - cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_patch(p) * m * 10._r8 - else - cnveg_carbonflux_inst%m_deadstemc_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_patch(p) * m - cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_patch(p) * m - end if - - ! storage pools - cnveg_carbonflux_inst%m_leafc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%leafc_storage_patch(p) * m - cnveg_carbonflux_inst%m_frootc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%frootc_storage_patch(p) * m - cnveg_carbonflux_inst%m_livestemc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%livestemc_storage_patch(p) * m - cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_storage_patch(p) * m - cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%livecrootc_storage_patch(p) * m - cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_storage_patch(p) * m - cnveg_carbonflux_inst%m_gresp_storage_to_litter_patch(p) = cnveg_carbonstate_inst%gresp_storage_patch(p) * m - - ! transfer pools - cnveg_carbonflux_inst%m_leafc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%leafc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_frootc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%frootc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%livestemc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%deadstemc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%livecrootc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%deadcrootc_xfer_patch(p) * m - cnveg_carbonflux_inst%m_gresp_xfer_to_litter_patch(p) = cnveg_carbonstate_inst%gresp_xfer_patch(p) * m - - !------------------------------------------------------ - ! patch-level gap mortality nitrogen fluxes - !------------------------------------------------------ - - ! displayed pools - cnveg_nitrogenflux_inst%m_leafn_to_litter_patch(p) = cnveg_nitrogenstate_inst%leafn_patch(p) * m - cnveg_nitrogenflux_inst%m_frootn_to_litter_patch(p) = cnveg_nitrogenstate_inst%frootn_patch(p) * m - cnveg_nitrogenflux_inst%m_livestemn_to_litter_patch(p) = cnveg_nitrogenstate_inst%livestemn_patch(p) * m - cnveg_nitrogenflux_inst%m_livecrootn_to_litter_patch(p) = cnveg_nitrogenstate_inst%livecrootn_patch(p) * m - - if (spinup_state == 2 .and. .not. use_cndv) then !accelerate mortality of dead woody pools - cnveg_nitrogenflux_inst%m_deadstemn_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadstemn_patch(p) * m * 10._r8 - cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadcrootn_patch(p) * m * 10._r8 - else - cnveg_nitrogenflux_inst%m_deadstemn_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadstemn_patch(p) * m - cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadcrootn_patch(p) * m - end if - - if (ivt(p) < npcropmin) then - cnveg_nitrogenflux_inst%m_retransn_to_litter_patch(p) = cnveg_nitrogenstate_inst%retransn_patch(p) * m - end if - - ! storage pools - cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%leafn_storage_patch(p) * m - cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%frootn_storage_patch(p) * m - cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%livestemn_storage_patch(p) * m - cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadstemn_storage_patch(p) * m - cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%livecrootn_storage_patch(p) * m - cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadcrootn_storage_patch(p) * m - - ! transfer pools - cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%leafn_xfer_patch(p) * m - cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%frootn_xfer_patch(p) * m - cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%livestemn_xfer_patch(p) * m - cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadstemn_xfer_patch(p) * m - cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%livecrootn_xfer_patch(p) * m - cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_patch(p) = cnveg_nitrogenstate_inst%deadcrootn_xfer_patch(p) * m - - ! added by F. Li and S. Levis - if (use_cndv) then - if (woody(ivt(p)) == 1._r8)then - if (cnveg_carbonstate_inst%livestemc_patch(p) + cnveg_carbonstate_inst%deadstemc_patch(p)> 0._r8)then - nind(p)=nind(p)*(1._r8-m) - else - nind(p) = 0._r8 - end if - end if - end if - - end do ! end of patch loop - - ! gather all patch-level litterfall fluxes to the column - ! for litter C and N inputs - - call CNGap_PatchToColumn(bounds, num_soilc, filter_soilc, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch(bounds%begp:bounds%endp, 1:nlevdecomp_full), & - froot_prof_patch(bounds%begp:bounds%endp, 1:nlevdecomp_full), & - croot_prof_patch(bounds%begp:bounds%endp, 1:nlevdecomp_full), & - stem_prof_patch(bounds%begp:bounds%endp, 1:nlevdecomp_full)) - - end associate - - end subroutine CNGapMortality - - !----------------------------------------------------------------------- - subroutine CNGap_PatchToColumn (bounds, num_soilc, filter_soilc, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch, froot_prof_patch, croot_prof_patch, stem_prof_patch) - ! - ! !DESCRIPTION: - ! gathers all patch-level gap mortality fluxes to the column level and - ! assigns them to the three litter pools - ! - ! !USES: - use clm_varpar , only : maxpatch_pft, nlevdecomp, nlevdecomp_full - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! soil column filter - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: croot_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: stem_prof_patch(bounds%begp:,1:) - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j ! indices - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(croot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(stem_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - - associate( & - leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - croot_prof => croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] patch weight relative to column (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: [real(r8) (:) ] leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: [real(r8) (:) ] leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: [real(r8) (:) ] leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: [real(r8) (:) ] fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: [real(r8) (:) ] fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: [real(r8) (:) ] fine root litter lignin fraction - - m_leafc_to_litter => cnveg_carbonflux_inst%m_leafc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_to_litter => cnveg_carbonflux_inst%m_frootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_to_litter => cnveg_carbonflux_inst%m_livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_to_litter => cnveg_carbonflux_inst%m_deadstemc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_to_litter => cnveg_carbonflux_inst%m_livecrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_to_litter => cnveg_carbonflux_inst%m_deadcrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafc_storage_to_litter => cnveg_carbonflux_inst%m_leafc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_storage_to_litter => cnveg_carbonflux_inst%m_frootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_storage_to_litter => cnveg_carbonflux_inst%m_livestemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_storage_to_litter => cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_storage_to_litter => cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_storage_to_litter => cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_gresp_storage_to_litter => cnveg_carbonflux_inst%m_gresp_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafc_xfer_to_litter => cnveg_carbonflux_inst%m_leafc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootc_xfer_to_litter => cnveg_carbonflux_inst%m_frootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemc_xfer_to_litter => cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemc_xfer_to_litter => cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootc_xfer_to_litter => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootc_xfer_to_litter => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_gresp_xfer_to_litter => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - gap_mortality_c_to_litr_met_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s) - gap_mortality_c_to_litr_cel_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s) - gap_mortality_c_to_litr_lig_c => cnveg_carbonflux_inst%gap_mortality_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to litter lignin pool (gC/m3/s) - gap_mortality_c_to_cwdc => cnveg_carbonflux_inst%gap_mortality_c_to_cwdc_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with gap mortality to CWD pool (gC/m3/s) - - m_leafn_to_litter => cnveg_nitrogenflux_inst%m_leafn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootn_to_litter => cnveg_nitrogenflux_inst%m_frootn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemn_to_litter => cnveg_nitrogenflux_inst%m_livestemn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemn_to_litter => cnveg_nitrogenflux_inst%m_deadstemn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootn_to_litter => cnveg_nitrogenflux_inst%m_livecrootn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootn_to_litter => cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_retransn_to_litter => cnveg_nitrogenflux_inst%m_retransn_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafn_storage_to_litter => cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootn_storage_to_litter => cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemn_storage_to_litter => cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemn_storage_to_litter => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootn_storage_to_litter => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootn_storage_to_litter => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - m_leafn_xfer_to_litter => cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_frootn_xfer_to_litter => cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livestemn_xfer_to_litter => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadstemn_xfer_to_litter => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_livecrootn_xfer_to_litter => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - m_deadcrootn_xfer_to_litter => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - gap_mortality_n_to_litr_met_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_met_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter metabolic pool (gN/m3/s) - gap_mortality_n_to_litr_cel_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_cel_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter cellulose pool (gN/m3/s) - gap_mortality_n_to_litr_lig_n => cnveg_nitrogenflux_inst%gap_mortality_n_to_litr_lig_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to litter lignin pool (gN/m3/s) - gap_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%gap_mortality_n_to_cwdn_col & ! Output: [real(r8) (:,:) ] N fluxes associated with gap mortality to CWD pool (gN/m3/s) - ) - - do j = 1,nlevdecomp - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - - ! leaf gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + & - m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + & - m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_cel_c(c,j) = gap_mortality_c_to_litr_cel_c(c,j) + & - m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_lig_c(c,j) = gap_mortality_c_to_litr_lig_c(c,j) + & - m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood gap mortality carbon fluxes - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - (m_livestemc_to_litter(p) + m_deadstemc_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_cwdc(c,j) = gap_mortality_c_to_cwdc(c,j) + & - (m_livecrootc_to_litter(p) + m_deadcrootc_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - ! storage gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_leafc_storage_to_litter(p) + m_gresp_storage_to_litter(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_livestemc_storage_to_litter(p) + m_deadstemc_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_livecrootc_storage_to_litter(p) + m_deadcrootc_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - ! transfer gap mortality carbon fluxes - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_leafc_xfer_to_litter(p) + m_gresp_xfer_to_litter(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - m_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_livestemc_xfer_to_litter(p) + m_deadstemc_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_c_to_litr_met_c(c,j) = gap_mortality_c_to_litr_met_c(c,j) + & - (m_livecrootc_xfer_to_litter(p) + m_deadcrootc_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - ! leaf gap mortality nitrogen fluxes - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_n_to_litr_cel_n(c,j) = gap_mortality_n_to_litr_cel_n(c,j) + & - m_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - gap_mortality_n_to_litr_lig_n(c,j) = gap_mortality_n_to_litr_lig_n(c,j) + & - m_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root litter nitrogen fluxes - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_n_to_litr_cel_n(c,j) = gap_mortality_n_to_litr_cel_n(c,j) + & - m_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - gap_mortality_n_to_litr_lig_n(c,j) = gap_mortality_n_to_litr_lig_n(c,j) + & - m_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood gap mortality nitrogen fluxes - gap_mortality_n_to_cwdn(c,j) = gap_mortality_n_to_cwdn(c,j) + & - (m_livestemn_to_litter(p) + m_deadstemn_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_n_to_cwdn(c,j) = gap_mortality_n_to_cwdn(c,j) + & - (m_livecrootn_to_litter(p) + m_deadcrootn_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - ! retranslocated N pool gap mortality fluxes - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! storage gap mortality nitrogen fluxes - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - (m_livestemn_storage_to_litter(p) + m_deadstemn_storage_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - (m_livecrootn_storage_to_litter(p) + m_deadcrootn_storage_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - ! transfer gap mortality nitrogen fluxes - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - m_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - (m_livestemn_xfer_to_litter(p) + m_deadstemn_xfer_to_litter(p)) * wtcol(p) * stem_prof(p,j) - gap_mortality_n_to_litr_met_n(c,j) = gap_mortality_n_to_litr_met_n(c,j) + & - (m_livecrootn_xfer_to_litter(p) + m_deadcrootn_xfer_to_litter(p)) * wtcol(p) * croot_prof(p,j) - - - end if - end if - - end do - end do - end do - - end associate - - end subroutine CNGap_PatchToColumn - -end module CNGapMortalityMod diff --git a/src/biogeochem/CNMRespMod.F90 b/src/biogeochem/CNMRespMod.F90 deleted file mode 100644 index 3a7052d0bb..0000000000 --- a/src/biogeochem/CNMRespMod.F90 +++ /dev/null @@ -1,298 +0,0 @@ -module CNMRespMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding maintenance respiration routines for coupled carbon - ! nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varpar , only : nlevgrnd - use clm_varcon , only : spval - use decompMod , only : bounds_type - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use pftconMod , only : npcropmin, pftcon - use SoilStateType , only : soilstate_type - use CanopyStateType , only : canopystate_type - use TemperatureType , only : temperature_type - use PhotosynthesisMod , only : photosyns_type - use CNVegcarbonfluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use CNSharedParamsMod , only : CNParamsShareInst - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNMRespReadNML ! Read in namelist (CALL FIRST!) - public :: readParams ! Read in parameters from file - public :: CNMResp ! Apply maintenance respiration - - type, private :: params_type - real(r8) :: br = spval ! base rate for maintenance respiration (gC/gN/s) - real(r8) :: br_root = spval ! base rate for maintenance respiration for roots (gC/gN/s) - end type params_type - - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNMRespReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CNMResp (MUST BE CALLED BEFORE readParams!!!) - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNMRespReadNML' - character(len=*), parameter :: nmlname = 'cnmresp_inparm' - real(r8) :: br_root = spval ! base rate for maintenance respiration for roots (gC/gN/s) - !----------------------------------------------------------------------- - - namelist /cnmresp_inparm/ br_root - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cnmresp_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (br_root, mpicom) - - params_inst%br_root = br_root - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cnmresp_inparm) - write(iulog,*) ' ' - end if - - end subroutine CNMRespReadNML - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! Read parameters (call AFTER CNMRespReadNML!) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNMRespParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - tString='br_mr' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%br=tempr - - if ( params_inst%br_root == spval ) then - params_inst%br_root = params_inst%br - end if - - end subroutine readParams - - !----------------------------------------------------------------------- - ! FIX(SPM,032414) this shouldn't even be called with fates on. - ! - subroutine CNMResp(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - canopystate_inst, soilstate_inst, temperature_inst, photosyns_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! - ! !ARGUMENTS: - use clm_varcon , only : tfrz - - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil points in column filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - integer , intent(in) :: num_soilp ! number of soil points in patch filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(photosyns_type) , intent(in) :: photosyns_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j ! indices - integer :: fp ! soil filter patch index - integer :: fc ! soil filter column index - real(r8):: br ! base rate (gC/gN/s) - real(r8):: br_root ! root base rate (gC/gN/s) - real(r8):: q10 ! temperature dependence - - real(r8):: tc ! temperature correction, 2m air temp (unitless) - real(r8):: tcsoi(bounds%begc:bounds%endc,nlevgrnd) ! temperature correction by soil layer (unitless) - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - - crootfr => soilstate_inst%crootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots for carbon in each soil layer (nlevgrnd) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - t_ref2m => temperature_inst%t_ref2m_patch , & ! Input: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) - - t10 => temperature_inst%t_a10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of the 2 m temperature (K) - - lmrsun => photosyns_inst%lmrsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf maintenance respiration rate (umol CO2/m**2/s) - lmrsha => photosyns_inst%lmrsha_patch , & ! Input: [real(r8) (:) ] shaded leaf maintenance respiration rate (umol CO2/m**2/s) - rootstem_acc => photosyns_inst%rootstem_acc , & ! Input: [logical ] root and stem acclimation switch - - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N - grainn => cnveg_nitrogenstate_inst%grainn_patch , & ! Input: [real(r8) (:) ] (kgN/m2) grain N - - leaf_mr => cnveg_carbonflux_inst%leaf_mr_patch , & ! Output: [real(r8) (:) ] - froot_mr => cnveg_carbonflux_inst%froot_mr_patch , & ! Output: [real(r8) (:) ] - livestem_mr => cnveg_carbonflux_inst%livestem_mr_patch , & ! Output: [real(r8) (:) ] - livecroot_mr => cnveg_carbonflux_inst%livecroot_mr_patch , & ! Output: [real(r8) (:) ] - grain_mr => cnveg_carbonflux_inst%grain_mr_patch & ! Output: [real(r8) (:) ] - - ) - - ! base rate for maintenance respiration is from: - ! M. Ryan, 1991. Effects of climate change on plant respiration. - ! Ecological Applications, 1(2), 157-167. - ! Original expression is br = 0.0106 molC/(molN h) - ! Conversion by molecular weights of C and N gives 2.525e-6 gC/(gN s) - ! set constants - br = params_inst%br - br_root = params_inst%br_root - - ! Peter Thornton: 3/13/09 - ! Q10 was originally set to 2.0, an arbitrary choice, but reduced to 1.5 as part of the tuning - ! to improve seasonal cycle of atmospheric CO2 concentration in global - ! simulatoins - Q10 = CNParamsShareInst%Q10 - - ! column loop to calculate temperature factors in each soil layer - do j=1,nlevgrnd - do fc = 1, num_soilc - c = filter_soilc(fc) - - ! calculate temperature corrections for each soil layer, for use in - ! estimating fine root maintenance respiration with depth - tcsoi(c,j) = Q10**((t_soisno(c,j)-SHR_CONST_TKFRZ - 20.0_r8)/10.0_r8) - end do - end do - - ! patch loop for leaves and live wood - do fp = 1, num_soilp - p = filter_soilp(fp) - - ! calculate maintenance respiration fluxes in - ! gC/m2/s for each of the live plant tissues. - ! Leaf and live wood MR - - tc = Q10**((t_ref2m(p)-SHR_CONST_TKFRZ - 20.0_r8)/10.0_r8) - - !RF: acclimation of root and stem respiration fluxes - ! n.b. we do not yet know if this is defensible scientifically (awaiting data analysis) - ! turning this on will increase R and decrease productivity in boreal forests, A LOT. :) - - if(rootstem_acc)then - br = br * 10._r8**(-0.00794_r8*((t10(p)-tfrz)-25._r8)) - br_root = br_root * 10._r8**(-0.00794_r8*((t10(p)-tfrz)-25._r8)) - end if - - if (frac_veg_nosno(p) == 1) then - - leaf_mr(p) = lmrsun(p) * laisun(p) * 12.011e-6_r8 + & - lmrsha(p) * laisha(p) * 12.011e-6_r8 - - else !nosno - - leaf_mr(p) = 0._r8 - - end if - - if (woody(ivt(p)) == 1) then - livestem_mr(p) = livestemn(p)*br*tc - livecroot_mr(p) = livecrootn(p)*br_root*tc - else if (ivt(p) >= npcropmin) then - livestem_mr(p) = livestemn(p)*br*tc - grain_mr(p) = grainn(p)*br*tc - end if - end do - - ! soil and patch loop for fine root - - do j = 1,nlevgrnd - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! Fine root MR - ! crootfr(j) sums to 1.0 over all soil layers, and - ! describes the fraction of root mass for carbon that is in each - ! layer. This is used with the layer temperature correction - ! to estimate the total fine root maintenance respiration as a - ! function of temperature and N content. - if(rootstem_acc)then - br_root = br_root * 10._r8**(-0.00794_r8*((t10(p)-tfrz)-25._r8)) - end if - froot_mr(p) = froot_mr(p) + frootn(p)*br_root*tcsoi(c,j)*crootfr(p,j) - - end do - end do - - end associate - - end subroutine CNMResp - -end module CNMRespMod diff --git a/src/biogeochem/CNNDynamicsMod.F90 b/src/biogeochem/CNNDynamicsMod.F90 deleted file mode 100644 index b8796912a2..0000000000 --- a/src/biogeochem/CNNDynamicsMod.F90 +++ /dev/null @@ -1,441 +0,0 @@ -module CNNDynamicsMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for mineral nitrogen dynamics (deposition, fixation, leaching) - ! for coupled carbon-nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varcon , only : dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, nfix_timeconst - use subgridAveMod , only : p2c - use atm2lndType , only : atm2lnd_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use CropType , only : crop_type - use ColumnType , only : col - use PatchType , only : patch - use perf_mod , only : t_startf, t_stopf - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNNDynamicsReadNML ! Read in namelist for Mineral Nitrogen Dynamics - public :: CNNDeposition ! Update N deposition rate from atm forcing - public :: CNNFixation ! Update N Fixation rate - public :: CNNFert ! Update N fertilizer for crops - public :: CNSoyfix ! N Fixation for soybeans - public :: CNFreeLivingFixation ! N free living fixation - - ! - ! !PRIVATE DATA MEMBERS: - type, private :: params_type - real(r8) :: freelivfix_intercept ! intercept of line of free living fixation with annual ET - real(r8) :: freelivfix_slope_wET ! slope of line of free living fixation with annual ET - end type params_type - type(params_type) :: params_inst - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNNDynamicsReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for Mineral Nitrogen Dynamics - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNNDynamicsReadNML' - character(len=*), parameter :: nmlname = 'mineral_nitrogen_dynamics' - !----------------------------------------------------------------------- - real(r8) :: freelivfix_intercept ! intercept of line of free living fixation with annual ET - real(r8) :: freelivfix_slope_wET ! slope of line of free living fixation with annual ET - namelist /mineral_nitrogen_dynamics/ freelivfix_slope_wET, freelivfix_intercept - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - freelivfix_intercept = 0.0117_r8 - freelivfix_slope_wET = 0.0006_r8 - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=mineral_nitrogen_dynamics, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (freelivfix_intercept, mpicom) - call shr_mpi_bcast (freelivfix_slope_wET, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=mineral_nitrogen_dynamics) - write(iulog,*) ' ' - end if - params_inst%freelivfix_intercept = freelivfix_intercept - params_inst%freelivfix_slope_wET = freelivfix_slope_wET - - end subroutine CNNDynamicsReadNML - - !----------------------------------------------------------------------- - subroutine CNNDeposition( bounds, & - atm2lnd_inst, soilbiogeochem_nitrogenflux_inst ) - ! - ! !DESCRIPTION: - ! On the radiation time step, update the nitrogen deposition rate - ! from atmospheric forcing. For now it is assumed that all the atmospheric - ! N deposition goes to the soil mineral N pool. - ! This could be updated later to divide the inputs between mineral N absorbed - ! directly into the canopy and mineral N entering the soil pool. - ! - ! !USES: - use CNSharedParamsMod , only: use_fun - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: g,c ! indices - !----------------------------------------------------------------------- - - associate( & - forc_ndep => atm2lnd_inst%forc_ndep_grc , & ! Input: [real(r8) (:)] nitrogen deposition rate (gN/m2/s) - ndep_to_sminn => soilbiogeochem_nitrogenflux_inst%ndep_to_sminn_col & ! Output: [real(r8) (:)] atmospheric N deposition to soil mineral N (gN/m2/s) - ) - - ! Loop through columns - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - ndep_to_sminn(c) = forc_ndep(g) - - end do - - end associate - - end subroutine CNNDeposition - - !----------------------------------------------------------------------- - subroutine CNFreeLivingFixation(num_soilc, filter_soilc, & - waterflux_inst, soilbiogeochem_nitrogenflux_inst) - - - use clm_time_manager , only : get_days_per_year, get_step_size - use shr_sys_mod , only : shr_sys_flush - use clm_varcon , only : secspday, spval - - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,fc !indices - real(r8) :: dayspyr !days per year - real(r8) :: secs_per_year !seconds per year - - associate( & - AnnET => waterflux_inst%AnnET, & ! Input: [real(:) ] : Annual average ET flux mmH20/s - freelivfix_slope => params_inst%freelivfix_slope_wET, & ! Input: [real ] : slope of fixation with ET - freelivfix_inter => params_inst%freelivfix_intercept, & ! Input: [real ] : intercept of fixation with ET - ffix_to_sminn => soilbiogeochem_nitrogenflux_inst%ffix_to_sminn_col & ! Output: [real(:) ] : free living N fixation to soil mineral N (gN/m2/s) - ) - - dayspyr = get_days_per_year() - secs_per_year = dayspyr*24_r8*3600_r8 - - do fc = 1,num_soilc - c = filter_soilc(fc) - ffix_to_sminn(c) = (freelivfix_slope*(max(0._r8,AnnET(c))*secs_per_year) + freelivfix_inter )/secs_per_year !(units g N m-2 s-1) - - end do - - end associate - end subroutine CNFreeLivingFixation - - !----------------------------------------------------------------------- - subroutine CNNFixation(num_soilc, filter_soilc, & - cnveg_carbonflux_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update the nitrogen fixation rate - ! as a function of annual total NPP. This rate gets updated once per year. - ! All N fixation goes to the soil mineral N pool. - ! - ! !USES: - use clm_time_manager , only : get_days_per_year, get_step_size - use shr_sys_mod , only : shr_sys_flush - use clm_varcon , only : secspday, spval - use CNSharedParamsMod , only: use_fun - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,fc ! indices - real(r8) :: t ! temporary - real(r8) :: dayspyr ! days per year - !----------------------------------------------------------------------- - - associate( & - cannsum_npp => cnveg_carbonflux_inst%annsum_npp_col , & ! Input: [real(r8) (:)] nitrogen deposition rate (gN/m2/s) - col_lag_npp => cnveg_carbonflux_inst%lag_npp_col , & ! Input: [real(r8) (:)] (gC/m2/s) lagged net primary production - - nfix_to_sminn => soilbiogeochem_nitrogenflux_inst%nfix_to_sminn_col & ! Output: [real(r8) (:)] symbiotic/asymbiotic N fixation to soil mineral N (gN/m2/s) - ) - - dayspyr = get_days_per_year() - - if ( nfix_timeconst > 0._r8 .and. nfix_timeconst < 500._r8 ) then - ! use exponential relaxation with time constant nfix_timeconst for NPP - NFIX relation - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (col_lag_npp(c) /= spval) then - ! need to put npp in units of gC/m^2/year here first - t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * col_lag_npp(c)*(secspday * dayspyr))))/(secspday * dayspyr) - nfix_to_sminn(c) = max(0._r8,t) - else - nfix_to_sminn(c) = 0._r8 - endif - end do - else - ! use annual-mean values for NPP-NFIX relation - do fc = 1,num_soilc - c = filter_soilc(fc) - - t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * cannsum_npp(c))))/(secspday * dayspyr) - nfix_to_sminn(c) = max(0._r8,t) - end do - endif - if(use_fun)then - nfix_to_sminn(c) = 0.0_r8 - end if - - end associate - - end subroutine CNNFixation - - !----------------------------------------------------------------------- - subroutine CNNFert(bounds, num_soilc, filter_soilc, & - cnveg_nitrogenflux_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update the nitrogen fertilizer for crops - ! All fertilizer goes into the soil mineral N pool. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,fc ! indices - !----------------------------------------------------------------------- - - associate( & - fert => cnveg_nitrogenflux_inst%fert_patch , & ! Input: [real(r8) (:)] nitrogen fertilizer rate (gN/m2/s) - fert_to_sminn => soilbiogeochem_nitrogenflux_inst%fert_to_sminn_col & ! Output: [real(r8) (:)] - ) - - call p2c(bounds, num_soilc, filter_soilc, & - fert(bounds%begp:bounds%endp), & - fert_to_sminn(bounds%begc:bounds%endc)) - - end associate - - end subroutine CNNFert - - !----------------------------------------------------------------------- - subroutine CNSoyfix (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - waterstate_inst, crop_inst, cnveg_state_inst, cnveg_nitrogenflux_inst , & - soilbiogeochem_state_inst, soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! This routine handles the fixation of nitrogen for soybeans based on - ! the EPICPHASE model M. Cabelguenne et al., Agricultural systems 60: 175-196, 1999 - ! N-fixation is based on soil moisture, plant growth phase, and availibility of - ! nitrogen in the soil root zone. - ! - ! !USES: - use pftconMod, only : ntmp_soybean, nirrig_tmp_soybean - use pftconMod, only : ntrp_soybean, nirrig_trp_soybean - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(waterstate_type) , intent(in) :: waterstate_inst - type(crop_type) , intent(in) :: crop_inst - type(cnveg_state_type) , intent(in) :: cnveg_state_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,p,c - real(r8):: fxw,fxn,fxg,fxr ! soil water factor, nitrogen factor, growth stage factor - real(r8):: soy_ndemand ! difference between nitrogen supply and demand - real(r8):: GDDfrac - real(r8):: sminnthreshold1, sminnthreshold2 - real(r8):: GDDfracthreshold1, GDDfracthreshold2 - real(r8):: GDDfracthreshold3, GDDfracthreshold4 - !----------------------------------------------------------------------- - - associate( & - wf => waterstate_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.5 m - - hui => crop_inst%gddplant_patch , & ! Input: [real(r8) (:) ] gdd since planting (gddplant) - croplive => crop_inst%croplive_patch , & ! Input: [logical (:) ] true if planted and not harvested - - gddmaturity => cnveg_state_inst%gddmaturity_patch , & ! Input: [real(r8) (:) ] gdd needed to harvest - - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Input: [real(r8) (:) ] N flux required to support initial GPP (gN/m2/s) - soyfixn => cnveg_nitrogenflux_inst%soyfixn_patch , & ! Output: [real(r8) (:) ] nitrogen fixed to each soybean crop - - fpg => soilbiogeochem_state_inst%fpg_col , & ! Input: [real(r8) (:) ] fraction of potential gpp (no units) - - sminn => soilbiogeochem_nitrogenstate_inst%sminn_col , & ! Input: [real(r8) (:) ] (kgN/m2) soil mineral N - soyfixn_to_sminn => soilbiogeochem_nitrogenflux_inst%soyfixn_to_sminn_col & ! Output: [real(r8) (:) ] - ) - - sminnthreshold1 = 30._r8 - sminnthreshold2 = 10._r8 - GDDfracthreshold1 = 0.15_r8 - GDDfracthreshold2 = 0.30_r8 - GDDfracthreshold3 = 0.55_r8 - GDDfracthreshold4 = 0.75_r8 - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! if soybean currently growing then calculate fixation - - if (croplive(p) .and. & - (patch%itype(p) == ntmp_soybean .or. & - patch%itype(p) == nirrig_tmp_soybean .or. & - patch%itype(p) == ntrp_soybean .or. & - patch%itype(p) == nirrig_trp_soybean) ) then - - ! difference between supply and demand - - if (fpg(c) < 1._r8) then - soy_ndemand = 0._r8 - soy_ndemand = plant_ndemand(p) - plant_ndemand(p)*fpg(c) - - ! fixation depends on nitrogen, soil water, and growth stage - - ! soil water factor - - fxw = 0._r8 - fxw = wf(c)/0.85_r8 - - ! soil nitrogen factor (Beth says: CHECK UNITS) - - if (sminn(c) > sminnthreshold1) then - fxn = 0._r8 - else if (sminn(c) > sminnthreshold2 .and. sminn(c) <= sminnthreshold1) then - fxn = 1.5_r8 - .005_r8 * (sminn(c) * 10._r8) - else if (sminn(c) <= sminnthreshold2) then - fxn = 1._r8 - end if - - ! growth stage factor - ! slevis: to replace GDDfrac, assume... - ! Beth's crit_offset_gdd_def is similar to my gddmaturity - ! Beth's ac_gdd (base 5C) similar to my hui=gddplant (base 10 - ! for soy) - ! Ranges below are not firm. Are they lit. based or tuning based? - - GDDfrac = hui(p) / gddmaturity(p) - - if (GDDfrac <= GDDfracthreshold1) then - fxg = 0._r8 - else if (GDDfrac > GDDfracthreshold1 .and. GDDfrac <= GDDfracthreshold2) then - fxg = 6.67_r8 * GDDfrac - 1._r8 - else if (GDDfrac > GDDfracthreshold2 .and. GDDfrac <= GDDfracthreshold3) then - fxg = 1._r8 - else if (GDDfrac > GDDfracthreshold3 .and. GDDfrac <= GDDfracthreshold4) then - fxg = 3.75_r8 - 5._r8 * GDDfrac - else ! GDDfrac > GDDfracthreshold4 - fxg = 0._r8 - end if - - ! calculate the nitrogen fixed by the soybean - - fxr = min(1._r8, fxw, fxn) * fxg - fxr = max(0._r8, fxr) - soyfixn(p) = fxr * soy_ndemand - soyfixn(p) = min(soyfixn(p), soy_ndemand) - - else ! if nitrogen demand met, no fixation - - soyfixn(p) = 0._r8 - - end if - - else ! if not live soybean, no fixation - - soyfixn(p) = 0._r8 - - end if - end do - - call p2c(bounds, num_soilc, filter_soilc, & - soyfixn(bounds%begp:bounds%endp), & - soyfixn_to_sminn(bounds%begc:bounds%endc)) - - end associate - - end subroutine CNSoyfix - -end module CNNDynamicsMod diff --git a/src/biogeochem/CNNStateUpdate1Mod.F90 b/src/biogeochem/CNNStateUpdate1Mod.F90 deleted file mode 100644 index 6c1d112029..0000000000 --- a/src/biogeochem/CNNStateUpdate1Mod.F90 +++ /dev/null @@ -1,287 +0,0 @@ -module CNNStateUpdate1Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for nitrogen state variable updates, non-mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size, get_step_size_real - use clm_varpar , only : nlevdecomp, ndecomp_pools, ndecomp_cascade_transitions - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use clm_varctl , only : iulog, use_nitrif_denitrif - use clm_varcon , only : nitrif_n2o_loss_frac - use pftconMod , only : npcropmin, pftcon - use decompMod , only : bounds_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: NStateUpdateDynPatch - public :: NStateUpdate1 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine NStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Update nitrogen states based on fluxes from dyn_cnbal_patch - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_soilc_with_inactive ! number of columns in soil filter - integer, intent(in) :: filter_soilc_with_inactive(:) ! soil column filter that includes inactive points - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c ! column index - integer :: g ! gridcell index - integer :: fc ! column filter index - integer :: j ! level index - real(r8) :: dt ! time step (seconds) - - character(len=*), parameter :: subname = 'NStateUpdateDynPatch' - !----------------------------------------------------------------------- - - associate( & - nf_veg => cnveg_nitrogenflux_inst , & - ns_veg => cnveg_nitrogenstate_inst , & - ns_soil => soilbiogeochem_nitrogenstate_inst & - ) - - dt = get_step_size_real() - - do j = 1, nlevdecomp - do fc = 1, num_soilc_with_inactive - c = filter_soilc_with_inactive(fc) - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + & - nf_veg%dwt_frootn_to_litr_met_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + & - nf_veg%dwt_frootn_to_litr_cel_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + & - nf_veg%dwt_frootn_to_litr_lig_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cwd) = ns_soil%decomp_npools_vr_col(c,j,i_cwd) + & - ( nf_veg%dwt_livecrootn_to_cwdn_col(c,j) + nf_veg%dwt_deadcrootn_to_cwdn_col(c,j) ) * dt - end do - end do - - do g = bounds%begg, bounds%endg - ns_veg%seedn_grc(g) = ns_veg%seedn_grc(g) - nf_veg%dwt_seedn_to_leaf_grc(g) * dt - ns_veg%seedn_grc(g) = ns_veg%seedn_grc(g) - nf_veg%dwt_seedn_to_deadstem_grc(g) * dt - end do - - end associate - - end subroutine NStateUpdateDynPatch - - !----------------------------------------------------------------------- - subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic nitrogen state - ! variables (except for gap-phase mortality and fire fluxes) - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l,g,k ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - - nf_veg => cnveg_nitrogenflux_inst , & ! Input: - ns_veg => cnveg_nitrogenstate_inst , & ! Output: - nf_soil => soilbiogeochem_nitrogenflux_inst & ! Output: - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - - ! soilbiogeochemistry fluxes TODO - this should be moved elsewhere - ! plant to litter fluxes - phenology and dynamic landcover fluxes - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - nf_soil%decomp_npools_sourcesink_col(c,j,i_met_lit) = & - nf_veg%phenology_n_to_litr_met_n_col(c,j) * dt - - nf_soil%decomp_npools_sourcesink_col(c,j,i_cel_lit) = & - nf_veg%phenology_n_to_litr_cel_n_col(c,j) * dt - - nf_soil%decomp_npools_sourcesink_col(c,j,i_lig_lit) = & - nf_veg%phenology_n_to_litr_lig_n_col(c,j) * dt - - ! NOTE(wjs, 2017-01-02) This used to be set to a non-zero value, but the - ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every - ! time step, but to be safe, I'm explicitly setting it to zero here. - nf_soil%decomp_npools_sourcesink_col(c,j,i_cwd) = 0._r8 - - end do - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! phenology: transfer growth fluxes - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) + nf_veg%leafn_xfer_to_leafn_patch(p)*dt - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) - nf_veg%leafn_xfer_to_leafn_patch(p)*dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) + nf_veg%frootn_xfer_to_frootn_patch(p)*dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) - nf_veg%frootn_xfer_to_frootn_patch(p)*dt - - if (woody(ivt(p)) == 1.0_r8) then - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) + nf_veg%livestemn_xfer_to_livestemn_patch(p)*dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) - nf_veg%livestemn_xfer_to_livestemn_patch(p)*dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) + nf_veg%deadstemn_xfer_to_deadstemn_patch(p)*dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) - nf_veg%deadstemn_xfer_to_deadstemn_patch(p)*dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) + nf_veg%livecrootn_xfer_to_livecrootn_patch(p)*dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) - nf_veg%livecrootn_xfer_to_livecrootn_patch(p)*dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) + nf_veg%deadcrootn_xfer_to_deadcrootn_patch(p)*dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) - nf_veg%deadcrootn_xfer_to_deadcrootn_patch(p)*dt - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) + nf_veg%livestemn_xfer_to_livestemn_patch(p)*dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) - nf_veg%livestemn_xfer_to_livestemn_patch(p)*dt - ns_veg%grainn_patch(p) = ns_veg%grainn_patch(p) + nf_veg%grainn_xfer_to_grainn_patch(p)*dt - ns_veg%grainn_xfer_patch(p) = ns_veg%grainn_xfer_patch(p) - nf_veg%grainn_xfer_to_grainn_patch(p)*dt - end if - - ! phenology: litterfall and retranslocation fluxes - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) - nf_veg%leafn_to_litter_patch(p)*dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) - nf_veg%frootn_to_litter_patch(p)*dt - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) - nf_veg%leafn_to_retransn_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%leafn_to_retransn_patch(p)*dt - - ! live wood turnover and retranslocation fluxes - if (woody(ivt(p)) == 1._r8) then - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - nf_veg%livestemn_to_deadstemn_patch(p)*dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) + nf_veg%livestemn_to_deadstemn_patch(p)*dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - nf_veg%livestemn_to_retransn_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%livestemn_to_retransn_patch(p)*dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) - nf_veg%livecrootn_to_deadcrootn_patch(p)*dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) + nf_veg%livecrootn_to_deadcrootn_patch(p)*dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) - nf_veg%livecrootn_to_retransn_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%livecrootn_to_retransn_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! Beth adds retrans from froot - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) - nf_veg%frootn_to_retransn_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%frootn_to_retransn_patch(p)*dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - nf_veg%livestemn_to_litter_patch(p)*dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - nf_veg%livestemn_to_retransn_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%livestemn_to_retransn_patch(p)*dt - ns_veg%grainn_patch(p) = ns_veg%grainn_patch(p) & - - (nf_veg%grainn_to_food_patch(p) + nf_veg%grainn_to_seed_patch(p))*dt - ns_veg%cropseedn_deficit_patch(p) = ns_veg%cropseedn_deficit_patch(p) & - - nf_veg%crop_seedn_to_leaf_patch(p) * dt & - + nf_veg%grainn_to_seed_patch(p) * dt - end if - - ! uptake from soil mineral N pool - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) + nf_veg%sminn_to_npool_patch(p)*dt - - ! deployment from retranslocation pool - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) + nf_veg%retransn_to_npool_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) - nf_veg%retransn_to_npool_patch(p)*dt - - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) + nf_veg%free_retransn_to_npool_patch(p)*dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) - nf_veg%free_retransn_to_npool_patch(p)*dt !how is retransn a state? - - ! allocation fluxes - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_leafn_patch(p)*dt - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) + nf_veg%npool_to_leafn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_leafn_storage_patch(p)*dt - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) + nf_veg%npool_to_leafn_storage_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_frootn_patch(p)*dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) + nf_veg%npool_to_frootn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_frootn_storage_patch(p)*dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) + nf_veg%npool_to_frootn_storage_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livestemn_patch(p)*dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) + nf_veg%npool_to_livestemn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livestemn_storage_patch(p)*dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) + nf_veg%npool_to_livestemn_storage_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_deadstemn_patch(p)*dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) + nf_veg%npool_to_deadstemn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_deadstemn_storage_patch(p)*dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) + nf_veg%npool_to_deadstemn_storage_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livecrootn_patch(p)*dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) + nf_veg%npool_to_livecrootn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livecrootn_storage_patch(p)*dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) + nf_veg%npool_to_livecrootn_storage_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_deadcrootn_patch(p)*dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) + nf_veg%npool_to_deadcrootn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_deadcrootn_storage_patch(p)*dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) + nf_veg%npool_to_deadcrootn_storage_patch(p)*dt - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livestemn_patch(p)*dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) + nf_veg%npool_to_livestemn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_livestemn_storage_patch(p)*dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) + nf_veg%npool_to_livestemn_storage_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_grainn_patch(p)*dt - ns_veg%grainn_patch(p) = ns_veg%grainn_patch(p) + nf_veg%npool_to_grainn_patch(p)*dt - ns_veg%npool_patch(p) = ns_veg%npool_patch(p) - nf_veg%npool_to_grainn_storage_patch(p)*dt - ns_veg%grainn_storage_patch(p) = ns_veg%grainn_storage_patch(p) + nf_veg%npool_to_grainn_storage_patch(p)*dt - end if - - ! move storage pools into transfer pools - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) - nf_veg%leafn_storage_to_xfer_patch(p)*dt - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) + nf_veg%leafn_storage_to_xfer_patch(p)*dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) - nf_veg%frootn_storage_to_xfer_patch(p)*dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) + nf_veg%frootn_storage_to_xfer_patch(p)*dt - - if (woody(ivt(p)) == 1._r8) then - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) - nf_veg%livestemn_storage_to_xfer_patch(p)*dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) + nf_veg%livestemn_storage_to_xfer_patch(p)*dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) - nf_veg%deadstemn_storage_to_xfer_patch(p)*dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) + nf_veg%deadstemn_storage_to_xfer_patch(p)*dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) - nf_veg%livecrootn_storage_to_xfer_patch(p)*dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) + nf_veg%livecrootn_storage_to_xfer_patch(p)*dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) - nf_veg%deadcrootn_storage_to_xfer_patch(p)*dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) + nf_veg%deadcrootn_storage_to_xfer_patch(p)*dt - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) - nf_veg%livestemn_storage_to_xfer_patch(p)*dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) + nf_veg%livestemn_storage_to_xfer_patch(p)*dt - ns_veg%grainn_storage_patch(p) = ns_veg%grainn_storage_patch(p) - nf_veg%grainn_storage_to_xfer_patch(p)*dt - ns_veg%grainn_xfer_patch(p) = ns_veg%grainn_xfer_patch(p) + nf_veg%grainn_storage_to_xfer_patch(p)*dt - end if - - end do - - end associate - - end subroutine NStateUpdate1 - -end module CNNStateUpdate1Mod diff --git a/src/biogeochem/CNNStateUpdate2Mod.F90 b/src/biogeochem/CNNStateUpdate2Mod.F90 deleted file mode 100644 index 24070f6890..0000000000 --- a/src/biogeochem/CNNStateUpdate2Mod.F90 +++ /dev/null @@ -1,238 +0,0 @@ -module CNNStateUpdate2Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for nitrogen state variable update, mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevdecomp - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use clm_varctl , only : iulog - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: NStateUpdate2 - public:: NStateUpdate2h - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic nitrogen state - ! variables affected by gap-phase mortality fluxes - ! NOTE - associate statements have been removed where there are - ! no science equations. This increases readability and maintainability - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l ! indices - integer :: fp,fc ! lake filter indices - real(r8) :: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - nf_veg => cnveg_nitrogenflux_inst , & - ns_veg => cnveg_nitrogenstate_inst , & - ns_soil => soilbiogeochem_nitrogenstate_inst & - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column-level nitrogen fluxes from gap-phase mortality - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + nf_veg%gap_mortality_n_to_litr_met_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + nf_veg%gap_mortality_n_to_litr_cel_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + nf_veg%gap_mortality_n_to_litr_lig_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cwd) = & - ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%gap_mortality_n_to_cwdn_col(c,j) * dt - end do - end do - - ! patch -level nitrogen fluxes from gap-phase mortality - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! displayed pools - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) & - - nf_veg%m_leafn_to_litter_patch(p) * dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) & - - nf_veg%m_frootn_to_litter_patch(p) * dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) & - - nf_veg%m_livestemn_to_litter_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & - - nf_veg%m_deadstemn_to_litter_patch(p) * dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) & - - nf_veg%m_livecrootn_to_litter_patch(p) * dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) & - - nf_veg%m_deadcrootn_to_litter_patch(p) * dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) & - - nf_veg%m_retransn_to_litter_patch(p) * dt - - ! storage pools - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) & - - nf_veg%m_leafn_storage_to_litter_patch(p) * dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) & - - nf_veg%m_frootn_storage_to_litter_patch(p) * dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) & - - nf_veg%m_livestemn_storage_to_litter_patch(p) * dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) & - - nf_veg%m_deadstemn_storage_to_litter_patch(p) * dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) & - - nf_veg%m_livecrootn_storage_to_litter_patch(p) * dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) & - - nf_veg%m_deadcrootn_storage_to_litter_patch(p) * dt - - ! transfer pools - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) & - - nf_veg%m_leafn_xfer_to_litter_patch(p) * dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) & - - nf_veg%m_frootn_xfer_to_litter_patch(p) * dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) & - - nf_veg%m_livestemn_xfer_to_litter_patch(p) * dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) & - - nf_veg%m_deadstemn_xfer_to_litter_patch(p) * dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) & - - nf_veg%m_livecrootn_xfer_to_litter_patch(p) * dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) & - - nf_veg%m_deadcrootn_xfer_to_litter_patch(p) * dt - - end do - - end associate - - end subroutine NStateUpdate2 - - !----------------------------------------------------------------------- - subroutine NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Update all the prognostic nitrogen state - ! variables affected by harvest mortality fluxes - ! NOTE - associate statements have been removed where there are - ! no science equations. This increases readability and maintainability - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - nf_veg => cnveg_nitrogenflux_inst , & - ns_veg => cnveg_nitrogenstate_inst , & - ns_soil => soilbiogeochem_nitrogenstate_inst & - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column-level nitrogen fluxes from harvest mortality - - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + nf_veg%harvest_n_to_litr_met_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + nf_veg%harvest_n_to_litr_cel_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = & - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + nf_veg%harvest_n_to_litr_lig_n_col(c,j) * dt - ns_soil%decomp_npools_vr_col(c,j,i_cwd) = & - ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%harvest_n_to_cwdn_col(c,j) * dt - end do - end do - - ! patch-level nitrogen fluxes from harvest mortality - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! displayed pools - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) & - - nf_veg%hrv_leafn_to_litter_patch(p) * dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) & - - nf_veg%hrv_frootn_to_litter_patch(p) * dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) & - - nf_veg%hrv_livestemn_to_litter_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & - - nf_veg%wood_harvestn_patch(p) * dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) & - - nf_veg%hrv_livecrootn_to_litter_patch(p) * dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) & - - nf_veg%hrv_deadcrootn_to_litter_patch(p) * dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) & - - nf_veg%hrv_retransn_to_litter_patch(p) * dt - - ! storage pools - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) & - - nf_veg%hrv_leafn_storage_to_litter_patch(p) * dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) & - - nf_veg%hrv_frootn_storage_to_litter_patch(p) * dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) & - - nf_veg%hrv_livestemn_storage_to_litter_patch(p) * dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) & - - nf_veg%hrv_deadstemn_storage_to_litter_patch(p) * dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) & - - nf_veg%hrv_livecrootn_storage_to_litter_patch(p) * dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) & - - nf_veg%hrv_deadcrootn_storage_to_litter_patch(p) * dt - - ! transfer pools - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) & - - nf_veg%hrv_leafn_xfer_to_litter_patch(p) *dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) & - - nf_veg%hrv_frootn_xfer_to_litter_patch(p) *dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) & - - nf_veg%hrv_livestemn_xfer_to_litter_patch(p) *dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) & - - nf_veg%hrv_deadstemn_xfer_to_litter_patch(p) *dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) & - - nf_veg%hrv_livecrootn_xfer_to_litter_patch(p) *dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) & - - nf_veg%hrv_deadcrootn_xfer_to_litter_patch(p) *dt - - end do - - end associate - - end subroutine NStateUpdate2h - -end module CNNStateUpdate2Mod diff --git a/src/biogeochem/CNNStateUpdate3Mod.F90 b/src/biogeochem/CNNStateUpdate3Mod.F90 deleted file mode 100644 index 455f69765b..0000000000 --- a/src/biogeochem/CNNStateUpdate3Mod.F90 +++ /dev/null @@ -1,210 +0,0 @@ -module CNNStateUpdate3Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for nitrogen state variable update, mortality fluxes. - ! Also, sminn leaching flux. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use clm_varpar , only: nlevdecomp, ndecomp_pools - use clm_time_manager , only : get_step_size - use clm_varctl , only : iulog, use_nitrif_denitrif - use clm_varpar , only : i_cwd, i_met_lit, i_cel_lit, i_lig_lit - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: NStateUpdate3 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine NStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic nitrogen state - ! variables affected by gap-phase mortality fluxes. Also the Sminn leaching flux. - ! NOTE - associate statements have been removed where there are - ! no science equations. This increases readability and maintainability. - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(in) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l,k ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - !----------------------------------------------------------------------- - - associate( & - nf_veg => cnveg_nitrogenflux_inst , & ! Input - ns_veg => cnveg_nitrogenstate_inst , & ! Output - nf_soil => soilbiogeochem_nitrogenflux_inst , & ! Input - ns_soil => soilbiogeochem_nitrogenstate_inst & ! Output - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (.not. use_nitrif_denitrif) then - ! mineral N loss due to leaching - ns_soil%sminn_vr_col(c,j) = ns_soil%sminn_vr_col(c,j) - nf_soil%sminn_leached_vr_col(c,j) * dt - else - ! mineral N loss due to leaching and runoff - ns_soil%smin_no3_vr_col(c,j) = max( ns_soil%smin_no3_vr_col(c,j) - & - ( nf_soil%smin_no3_leached_vr_col(c,j) + nf_soil%smin_no3_runoff_vr_col(c,j) ) * dt, 0._r8) - - ns_soil%sminn_vr_col(c,j) = ns_soil%smin_no3_vr_col(c,j) + ns_soil%smin_nh4_vr_col(c,j) - end if - - ! column level nitrogen fluxes from fire - ! patch-level wood to column-level CWD (uncombusted wood) - ns_soil%decomp_npools_vr_col(c,j,i_cwd) = ns_soil%decomp_npools_vr_col(c,j,i_cwd) + & - nf_veg%fire_mortality_n_to_cwdn_col(c,j) * dt - - ! patch-level wood to column-level litter (uncombusted wood) - ns_soil%decomp_npools_vr_col(c,j,i_met_lit) = ns_soil%decomp_npools_vr_col(c,j,i_met_lit) + & - nf_veg%m_n_to_litr_met_fire_col(c,j)* dt - ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) = ns_soil%decomp_npools_vr_col(c,j,i_cel_lit) + & - nf_veg%m_n_to_litr_cel_fire_col(c,j)* dt - ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) = ns_soil%decomp_npools_vr_col(c,j,i_lig_lit) + & - nf_veg%m_n_to_litr_lig_fire_col(c,j)* dt - end do ! end of column loop - end do - - ! litter and CWD losses to fire - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - ns_soil%decomp_npools_vr_col(c,j,l) = ns_soil%decomp_npools_vr_col(c,j,l) - & - nf_veg%m_decomp_npools_to_fire_vr_col(c,j,l) * dt - end do - end do - end do - - ! patch-level nitrogen fluxes - - do fp = 1,num_soilp - p = filter_soilp(fp) - - !from fire displayed pools - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) - & - nf_veg%m_leafn_to_fire_patch(p) * dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) - & - nf_veg%m_frootn_to_fire_patch(p) * dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - & - nf_veg%m_livestemn_to_fire_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) - & - nf_veg%m_deadstemn_to_fire_patch(p) * dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) - & - nf_veg%m_livecrootn_to_fire_patch(p) * dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) - & - nf_veg%m_deadcrootn_to_fire_patch(p) * dt - - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) - & - nf_veg%m_leafn_to_litter_fire_patch(p) * dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) - & - nf_veg%m_frootn_to_litter_fire_patch(p) * dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - & - nf_veg%m_livestemn_to_litter_fire_patch(p) * dt - & - nf_veg%m_livestemn_to_deadstemn_fire_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) - & - nf_veg%m_deadstemn_to_litter_fire_patch(p) * dt + & - nf_veg%m_livestemn_to_deadstemn_fire_patch(p) * dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) - & - nf_veg%m_livecrootn_to_litter_fire_patch(p) * dt - & - nf_veg%m_livecrootn_to_deadcrootn_fire_patch(p) * dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) - & - nf_veg%m_deadcrootn_to_litter_fire_patch(p) * dt + & - nf_veg%m_livecrootn_to_deadcrootn_fire_patch(p) * dt - - ! storage pools - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) - & - nf_veg%m_leafn_storage_to_fire_patch(p) * dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) - & - nf_veg%m_frootn_storage_to_fire_patch(p) * dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) - & - nf_veg%m_livestemn_storage_to_fire_patch(p) * dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) - & - nf_veg%m_deadstemn_storage_to_fire_patch(p) * dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) - & - nf_veg%m_livecrootn_storage_to_fire_patch(p) * dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) - & - nf_veg%m_deadcrootn_storage_to_fire_patch(p) * dt - - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) - & - nf_veg%m_leafn_storage_to_litter_fire_patch(p) * dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) - & - nf_veg%m_frootn_storage_to_litter_fire_patch(p) * dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) - & - nf_veg%m_livestemn_storage_to_litter_fire_patch(p) * dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) - & - nf_veg%m_deadstemn_storage_to_litter_fire_patch(p) * dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) - & - nf_veg%m_livecrootn_storage_to_litter_fire_patch(p) * dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) - & - nf_veg%m_deadcrootn_storage_to_litter_fire_patch(p) * dt - - - ! transfer pools - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) - & - nf_veg%m_leafn_xfer_to_fire_patch(p) * dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) - & - nf_veg%m_frootn_xfer_to_fire_patch(p) * dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) - & - nf_veg%m_livestemn_xfer_to_fire_patch(p) * dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) - & - nf_veg%m_deadstemn_xfer_to_fire_patch(p) * dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) - & - nf_veg%m_livecrootn_xfer_to_fire_patch(p) * dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) - & - nf_veg%m_deadcrootn_xfer_to_fire_patch(p) * dt - - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) - & - nf_veg%m_leafn_xfer_to_litter_fire_patch(p) * dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) - & - nf_veg%m_frootn_xfer_to_litter_fire_patch(p) * dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) - & - nf_veg%m_livestemn_xfer_to_litter_fire_patch(p) * dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) - & - nf_veg%m_deadstemn_xfer_to_litter_fire_patch(p) * dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) - & - nf_veg%m_livecrootn_xfer_to_litter_fire_patch(p) * dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) - & - nf_veg%m_deadcrootn_xfer_to_litter_fire_patch(p) * dt - - ! retranslocated N pool - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) - & - nf_veg%m_retransn_to_fire_patch(p) * dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) - & - nf_veg%m_retransn_to_litter_fire_patch(p) * dt - end do - - end associate - - end subroutine NStateUpdate3 - -end module CNNStateUpdate3Mod diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 deleted file mode 100644 index 9d66373085..0000000000 --- a/src/biogeochem/CNPhenologyMod.F90 +++ /dev/null @@ -1,3014 +0,0 @@ -module CNPhenologyMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !MODULE: CNPhenologyMod - ! - ! !DESCRIPTION: - ! Module holding routines used in phenology model for coupled carbon - ! nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_sys_mod , only : shr_sys_flush - use decompMod , only : bounds_type - use clm_varpar , only : numpft, nlevdecomp_full - use clm_varctl , only : iulog, use_cndv - use clm_varcon , only : tfrz - use abortutils , only : endrun - use CanopyStateType , only : canopystate_type - use CNDVType , only : dgvs_type - use CNVegstateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use CNVegnitrogenfluxType , only : cnveg_nitrogenflux_type - use CropType , only : crop_type - use pftconMod , only : pftcon - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use ColumnType , only : col - use GridcellType , only : grc - use PatchType , only : patch - use atm2lndType , only : atm2lnd_type - use atm2lndType , only : atm2lnd_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams ! Read parameters - public :: CNPhenologyreadNML ! Read namelist - public :: CNPhenologyInit ! Initialization - public :: CNPhenology ! Update - ! - ! !PRIVATE DATA MEMBERS: - type, private :: params_type - real(r8) :: crit_dayl ! critical day length for senescence - real(r8) :: ndays_on ! number of days to complete leaf onset - real(r8) :: ndays_off ! number of days to complete leaf offset - real(r8) :: fstor2tran ! fraction of storage to move to transfer for each onset - real(r8) :: crit_onset_fdd ! critical number of freezing days to set gdd counter - real(r8) :: crit_onset_swi ! critical number of days > soilpsi_on for onset - real(r8) :: soilpsi_on ! critical soil water potential for leaf onset - real(r8) :: crit_offset_fdd ! critical number of freezing days to initiate offset - real(r8) :: crit_offset_swi ! critical number of water stress days to initiate offset - real(r8) :: soilpsi_off ! critical soil water potential for leaf offset - real(r8) :: lwtop ! live wood turnover proportion (annual fraction) - end type params_type - - type(params_type) :: params_inst - - real(r8) :: dt ! radiation time step delta t (seconds) - real(r8) :: fracday ! dtime as a fraction of day - real(r8) :: crit_dayl ! critical daylength for offset (seconds) - real(r8) :: ndays_on ! number of days to complete onset - real(r8) :: ndays_off ! number of days to complete offset - real(r8) :: fstor2tran ! fraction of storage to move to transfer on each onset - real(r8) :: crit_onset_fdd ! critical number of freezing days - real(r8) :: crit_onset_swi ! water stress days for offset trigger - real(r8) :: soilpsi_on ! water potential for onset trigger (MPa) - real(r8) :: crit_offset_fdd ! critical number of freezing degree days to trigger offset - real(r8) :: crit_offset_swi ! water stress days for offset trigger - real(r8) :: soilpsi_off ! water potential for offset trigger (MPa) - real(r8) :: lwtop ! live wood turnover proportion (annual fraction) - - ! CropPhenology variables and constants - real(r8) :: p1d, p1v ! photoperiod factor constants for crop vernalization - real(r8) :: hti ! cold hardening index threshold for vernalization - real(r8) :: tbase ! base temperature for vernalization - - integer, parameter :: NOT_Planted = 999 ! If not planted yet in year - integer, parameter :: NOT_Harvested = 999 ! If not harvested yet in year - integer, parameter :: inNH = 1 ! Northern Hemisphere - integer, parameter :: inSH = 2 ! Southern Hemisphere - integer, pointer :: inhemi(:) ! Hemisphere that patch is in - - integer, allocatable :: minplantjday(:,:) ! minimum planting julian day - integer, allocatable :: maxplantjday(:,:) ! maximum planting julian day - integer :: jdayyrstart(inSH) ! julian day of start of year - - real(r8), private :: initial_seed_at_planting = 3._r8 ! Initial seed at planting - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNPhenologyReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CNPhenology - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNPhenologyReadNML' - character(len=*), parameter :: nmlname = 'cnphenology' - !----------------------------------------------------------------------- - namelist /cnphenology/ initial_seed_at_planting - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cnphenology, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (initial_seed_at_planting, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cnphenology) - write(iulog,*) ' ' - end if - - - !----------------------------------------------------------------------- - - end subroutine CNPhenologyReadNML - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! - ! !USES: - use ncdio_pio , only: file_desc_t,ncd_io - - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNPhenolParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - ! - ! read in parameters - ! - tString='crit_dayl' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%crit_dayl=tempr - - tString='ndays_on' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ndays_on=tempr - - tString='ndays_off' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ndays_off=tempr - - tString='fstor2tran' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%fstor2tran=tempr - - tString='crit_onset_fdd' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%crit_onset_fdd=tempr - - tString='crit_onset_swi' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%crit_onset_swi=tempr - - tString='soilpsi_on' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%soilpsi_on=tempr - - tString='crit_offset_fdd' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%crit_offset_fdd=tempr - - tString='crit_offset_swi' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%crit_offset_swi=tempr - - tString='soilpsi_off' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%soilpsi_off=tempr - - tString='lwtop_ann' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%lwtop=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine CNPhenology (bounds, num_soilc, filter_soilc, num_soilp, & - filter_soilp, num_pcropp, filter_pcropp, & - doalb, waterstate_inst, temperature_inst, atm2lnd_inst, crop_inst, & - canopystate_inst, soilstate_inst, dgvs_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - leaf_prof_patch, froot_prof_patch, phase) - ! !USES: - use CNSharedParamsMod, only: use_fun - ! - ! !DESCRIPTION: - ! Dynamic phenology routine for coupled carbon-nitrogen code (CN) - ! 1. grass phenology - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter - integer , intent(in) :: filter_pcropp(:)! filter for prognostic crop patches - logical , intent(in) :: doalb ! true if time for sfc albedo calc - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(crop_type) , intent(inout) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - integer , intent(in) :: phase - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - - ! each of the following phenology type routines includes a filter - ! to operate only on the relevant patches - - - if ( phase == 1 ) then - call CNPhenologyClimate(num_soilp, filter_soilp, num_pcropp, filter_pcropp, & - temperature_inst, cnveg_state_inst, crop_inst) - - call CNEvergreenPhenology(num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNSeasonDecidPhenology(num_soilp, filter_soilp, & - temperature_inst, cnveg_state_inst, dgvs_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNStressDecidPhenology(num_soilp, filter_soilp, & - soilstate_inst, temperature_inst, atm2lnd_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - if (doalb .and. num_pcropp > 0 ) then - call CropPhenology(num_pcropp, filter_pcropp, & - waterstate_inst, temperature_inst, crop_inst, canopystate_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst) - end if - else if ( phase == 2 ) then - ! the same onset and offset routines are called regardless of - ! phenology type - they depend only on onset_flag, offset_flag, bglfr, and bgtr - - call CNOnsetGrowth(num_soilp, filter_soilp, & - cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNOffsetLitterfall(num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNBackgroundLitterfall(num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNLivewoodTurnover(num_soilp, filter_soilp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - call CNGrainToProductPools(bounds, num_soilp, filter_soilp, num_soilc, filter_soilc, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - ! gather all patch-level litterfall fluxes to the column for litter C and N inputs - - call CNLitterToColumn(bounds, num_soilc, filter_soilc, & - cnveg_state_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch(bounds%begp:bounds%endp,1:nlevdecomp_full), & - froot_prof_patch(bounds%begp:bounds%endp,1:nlevdecomp_full)) - else - call endrun( 'bad phase' ) - end if - - end subroutine CNPhenology - - !----------------------------------------------------------------------- - subroutine CNPhenologyInit(bounds) - ! - ! !DESCRIPTION: - ! Initialization of CNPhenology. Must be called after time-manager is - ! initialized, and after pftcon file is read in. - ! - ! !USES: - use clm_time_manager, only: get_step_size - use clm_varctl , only: use_crop - use clm_varcon , only: secspday - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - !------------------------------------------------------------------------ - - ! - ! Get time-step and what fraction of a day it is - ! - dt = real( get_step_size(), r8 ) - fracday = dt/secspday - - ! set constants for CNSeasonDecidPhenology - ! (critical daylength from Biome-BGC, v4.1.2) - crit_dayl=params_inst%crit_dayl - - ! Set constants for CNSeasonDecidPhenology and CNStressDecidPhenology - ndays_on=params_inst%ndays_on - ndays_off=params_inst%ndays_off - - ! set transfer parameters - fstor2tran=params_inst%fstor2tran - - ! ----------------------------------------- - ! Constants for CNStressDecidPhenology - ! ----------------------------------------- - - ! onset parameters - crit_onset_fdd=params_inst%crit_onset_fdd - ! critical onset gdd now being calculated as a function of annual - ! average 2m temp. - ! crit_onset_gdd = 150.0 ! c3 grass value - ! crit_onset_gdd = 1000.0 ! c4 grass value - crit_onset_swi=params_inst%crit_onset_swi - soilpsi_on=params_inst%soilpsi_on - - ! offset parameters - crit_offset_fdd=params_inst%crit_offset_fdd - crit_offset_swi=params_inst%crit_offset_swi - soilpsi_off=params_inst%soilpsi_off - - ! ----------------------------------------- - ! Constants for CNLivewoodTurnover - ! ----------------------------------------- - - ! set the global parameter for livewood turnover rate - ! define as an annual fraction (0.7), and convert to fraction per second - lwtop=params_inst%lwtop/31536000.0_r8 !annual fraction converted to per second - - ! ----------------------------------------- - ! Call any subroutine specific initialization routines - ! ----------------------------------------- - - if ( use_crop ) call CropPhenologyInit(bounds) - - end subroutine CNPhenologyInit - - !----------------------------------------------------------------------- - subroutine CNPhenologyClimate (num_soilp, filter_soilp, num_pcropp, filter_pcropp, & - temperature_inst, cnveg_state_inst, crop_inst) - ! - ! !DESCRIPTION: - ! For coupled carbon-nitrogen code (CN). - ! - ! !USES: - use clm_time_manager , only : get_days_per_year - use clm_time_manager , only : get_curr_date, is_first_step - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_pcropp ! number of prognostic crops in filter - integer , intent(in) :: filter_pcropp(:)! filter for prognostic crop patches - type(temperature_type) , intent(inout) :: temperature_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(inout) :: crop_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter patch index - real(r8) :: dayspyr ! days per year (days) - integer :: kyr ! current year - integer :: kmo ! month of year (1, ..., 12) - integer :: kda ! day of month (1, ..., 31) - integer :: mcsec ! seconds of day (0, ..., seconds/day) - real(r8), parameter :: yravg = 20.0_r8 ! length of years to average for gdd - real(r8), parameter :: yravgm1 = yravg-1.0_r8 ! minus 1 of above - !----------------------------------------------------------------------- - - associate( & - nyrs_crop_active => crop_inst%nyrs_crop_active_patch, & ! InOut: [integer (:) ] number of years this crop patch has been active - - t_ref2m => temperature_inst%t_ref2m_patch , & ! Input: [real(r8) (:) ] 2m air temperature (K) - gdd0 => temperature_inst%gdd0_patch , & ! Output: [real(r8) (:) ] growing deg. days base 0 deg C (ddays) - gdd8 => temperature_inst%gdd8_patch , & ! Output: [real(r8) (:) ] " " " " 8 " " " - gdd10 => temperature_inst%gdd10_patch , & ! Output: [real(r8) (:) ] " " " " 10 " " " - gdd020 => temperature_inst%gdd020_patch , & ! Output: [real(r8) (:) ] 20-yr mean of gdd0 (ddays) - gdd820 => temperature_inst%gdd820_patch , & ! Output: [real(r8) (:) ] 20-yr mean of gdd8 (ddays) - gdd1020 => temperature_inst%gdd1020_patch , & ! Output: [real(r8) (:) ] 20-yr mean of gdd10 (ddays) - - tempavg_t2m => cnveg_state_inst%tempavg_t2m_patch & ! Output: [real(r8) (:) ] temp. avg 2m air temperature (K) - ) - - ! set time steps - - dayspyr = get_days_per_year() - - do fp = 1,num_soilp - p = filter_soilp(fp) - tempavg_t2m(p) = tempavg_t2m(p) + t_ref2m(p) * (fracday/dayspyr) - end do - - ! - ! The following crop related steps are done here rather than CropPhenology - ! so that they will be completed each time-step rather than with doalb. - ! - ! The following lines come from ibis's climate.f + stats.f - ! gdd SUMMATIONS ARE RELATIVE TO THE PLANTING DATE (see subr. updateAccFlds) - - if (num_pcropp > 0) then - ! get time-related info - call get_curr_date(kyr, kmo, kda, mcsec) - end if - - do fp = 1,num_pcropp - p = filter_pcropp(fp) - if (kmo == 1 .and. kda == 1 .and. nyrs_crop_active(p) == 0) then ! YR 1: - gdd020(p) = 0._r8 ! set gdd..20 variables to 0 - gdd820(p) = 0._r8 ! and crops will not be planted - gdd1020(p) = 0._r8 - end if - if (kmo == 1 .and. kda == 1 .and. mcsec == 0) then ! <-- END of EVERY YR: - if (nyrs_crop_active(p) == 1) then ! <-- END of YR 1 - gdd020(p) = gdd0(p) ! <-- END of YR 1 - gdd820(p) = gdd8(p) ! <-- END of YR 1 - gdd1020(p) = gdd10(p) ! <-- END of YR 1 - end if ! <-- END of YR 1 - gdd020(p) = (yravgm1* gdd020(p) + gdd0(p)) / yravg ! gdd..20 must be long term avgs - gdd820(p) = (yravgm1* gdd820(p) + gdd8(p)) / yravg ! so ignore results for yrs 1 & 2 - gdd1020(p) = (yravgm1* gdd1020(p) + gdd10(p)) / yravg - end if - end do - - end associate - - end subroutine CNPhenologyClimate - - !----------------------------------------------------------------------- - subroutine CNEvergreenPhenology (num_soilp, filter_soilp , & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! cnveg_state_inst) - ! - ! !DESCRIPTION: - ! For coupled carbon-nitrogen code (CN). - ! - ! !USES: - use clm_varcon , only : secspday - use clm_time_manager , only : get_days_per_year - use clm_varctl , only : CN_evergreen_phenology_opt - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type), intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - real(r8):: dayspyr ! Days per year - integer :: p ! indices - integer :: fp ! lake filter patch index - - real(r8):: tranr - real(r8):: t1 ! temporary variable - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - evergreen => pftcon%evergreen , & ! Input: binary flag for evergreen leaf habit (0 or 1) - leaf_long => pftcon%leaf_long , & ! Input: leaf longevity (yrs) - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C storage - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C storage - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C storage - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) growth respiration storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead coarse root C transfer - - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N storage - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N storage - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead coarse root N transfer - - leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - frootc_storage_to_xfer => cnveg_carbonflux_inst%frootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livestemc_storage_to_xfer => cnveg_carbonflux_inst%livestemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadstemc_storage_to_xfer => cnveg_carbonflux_inst%deadstemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livecrootc_storage_to_xfer => cnveg_carbonflux_inst%livecrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadcrootc_storage_to_xfer => cnveg_carbonflux_inst%deadcrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - gresp_storage_to_xfer => cnveg_carbonflux_inst%gresp_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! InOut: [real(r8) (:)] - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! InOut: [real(r8) (:)] - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! InOut: [real(r8) (:)] - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! InOut: [real(r8) (:)] - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! InOut: [real(r8) (:)] - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! InOut: [real(r8) (:)] - - leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - frootn_storage_to_xfer => cnveg_nitrogenflux_inst%frootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livestemn_storage_to_xfer => cnveg_nitrogenflux_inst%livestemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadstemn_storage_to_xfer => cnveg_nitrogenflux_inst%deadstemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livecrootn_storage_to_xfer => cnveg_nitrogenflux_inst%livecrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadcrootn_storage_to_xfer => cnveg_nitrogenflux_inst%deadcrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! InOut: [real(r8) (:)] - frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! InOut: [real(r8) (:)] - livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! InOut: [real(r8) (:)] - deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! InOut: [real(r8) (:)] - livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! InOut: [real(r8) (:)] - deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch , & ! InOut: [real(r8) (:)] - - bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) - bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) - lgsf => cnveg_state_inst%lgsf_patch & ! Output: [real(r8) (:) ] long growing season factor [0-1] - ) - - dayspyr = get_days_per_year() - - do fp = 1,num_soilp - p = filter_soilp(fp) - if (evergreen(ivt(p)) == 1._r8) then - bglfr(p) = 1._r8/(leaf_long(ivt(p)) * dayspyr * secspday) - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - end if - end do - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (CN_evergreen_phenology_opt == 1) then - do fp = 1,num_soilp - p = filter_soilp(fp) - if (evergreen(ivt(p)) == 1._r8) then - - tranr=0.0002_r8 - ! set carbon fluxes for shifting storage pools to transfer pools - leafc_storage_to_xfer(p) = tranr * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = tranr * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = tranr * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = tranr * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = tranr * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = tranr * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = tranr * gresp_storage(p)/dt - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = tranr * leafn_storage(p)/dt - frootn_storage_to_xfer(p) = tranr * frootn_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = tranr * livestemn_storage(p)/dt - deadstemn_storage_to_xfer(p) = tranr * deadstemn_storage(p)/dt - livecrootn_storage_to_xfer(p) = tranr * livecrootn_storage(p)/dt - deadcrootn_storage_to_xfer(p) = tranr * deadcrootn_storage(p)/dt - end if - - t1 = 1.0_r8 / dt - - leafc_xfer_to_leafc(p) = t1 * leafc_xfer(p) - frootc_xfer_to_frootc(p) = t1 * frootc_xfer(p) - - leafn_xfer_to_leafn(p) = t1 * leafn_xfer(p) - frootn_xfer_to_frootn(p) = t1 * frootn_xfer(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = t1 * livestemc_xfer(p) - deadstemc_xfer_to_deadstemc(p) = t1 * deadstemc_xfer(p) - livecrootc_xfer_to_livecrootc(p) = t1 * livecrootc_xfer(p) - deadcrootc_xfer_to_deadcrootc(p) = t1 * deadcrootc_xfer(p) - - livestemn_xfer_to_livestemn(p) = t1 * livestemn_xfer(p) - deadstemn_xfer_to_deadstemn(p) = t1 * deadstemn_xfer(p) - livecrootn_xfer_to_livecrootn(p) = t1 * livecrootn_xfer(p) - deadcrootn_xfer_to_deadcrootn(p) = t1 * deadcrootn_xfer(p) - end if - - end if ! end of if (evergreen(ivt(p)) == 1._r8) then - - end do ! end of pft loop - - end if ! end of if (CN_evergreen_phenology_opt == 1) then - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - end associate - - end subroutine CNEvergreenPhenology - - !----------------------------------------------------------------------- - subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & - temperature_inst, cnveg_state_inst, dgvs_inst , & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! For coupled carbon-nitrogen code (CN). - ! This routine handles the seasonal deciduous phenology code (temperate - ! deciduous vegetation that has only one growing season per year). - ! - ! !USES: - use shr_const_mod , only: SHR_CONST_TKFRZ, SHR_CONST_PI - use clm_varcon , only: secspday - use clm_varctl , only: use_cndv - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(temperature_type) , intent(in) :: temperature_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(dgvs_type) , intent(inout) :: dgvs_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: g,c,p !indices - integer :: fp !lake filter patch index - real(r8):: ws_flag !winter-summer solstice flag (0 or 1) - real(r8):: crit_onset_gdd !critical onset growing degree-day sum - real(r8):: soilt - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - dayl => grc%dayl , & ! Input: [real(r8) (:) ] daylength (s) - prev_dayl => grc%prev_dayl , & ! Input: [real(r8) (:) ] daylength from previous time step (s) - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal-deciduous leaf habit (0 or 1) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - pftmayexist => dgvs_inst%pftmayexist_patch , & ! Output: [logical (:) ] exclude seasonal decid patches from tropics - - annavg_t2m => cnveg_state_inst%annavg_t2m_patch , & ! Input: [real(r8) (:) ] annual average 2m air temperature (K) - dormant_flag => cnveg_state_inst%dormant_flag_patch , & ! Output: [real(r8) (:) ] dormancy flag - days_active => cnveg_state_inst%days_active_patch , & ! Output: [real(r8) (:) ] number of days since last dormancy - onset_flag => cnveg_state_inst%onset_flag_patch , & ! Output: [real(r8) (:) ] onset flag - onset_counter => cnveg_state_inst%onset_counter_patch , & ! Output: [real(r8) (:) ] onset counter (seconds) - onset_gddflag => cnveg_state_inst%onset_gddflag_patch , & ! Output: [real(r8) (:) ] onset freeze flag - onset_gdd => cnveg_state_inst%onset_gdd_patch , & ! Output: [real(r8) (:) ] onset growing degree days - offset_flag => cnveg_state_inst%offset_flag_patch , & ! Output: [real(r8) (:) ] offset flag - offset_counter => cnveg_state_inst%offset_counter_patch , & ! Output: [real(r8) (:) ] offset counter (seconds) - bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) - bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) - lgsf => cnveg_state_inst%lgsf_patch , & ! Output: [real(r8) (:) ] long growing season factor [0-1] - - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - - prev_leafc_to_litter => cnveg_carbonflux_inst%prev_leafc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep leaf C litterfall flux (gC/m2/s) - prev_frootc_to_litter => cnveg_carbonflux_inst%prev_frootc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep froot C litterfall flux (gC/m2/s) - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! Output: [real(r8) (:) ] - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Output: [real(r8) (:) ] - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! Output: [real(r8) (:) ] - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! Output: [real(r8) (:) ] - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - frootc_storage_to_xfer => cnveg_carbonflux_inst%frootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livestemc_storage_to_xfer => cnveg_carbonflux_inst%livestemc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadstemc_storage_to_xfer => cnveg_carbonflux_inst%deadstemc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livecrootc_storage_to_xfer => cnveg_carbonflux_inst%livecrootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadcrootc_storage_to_xfer => cnveg_carbonflux_inst%deadcrootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - gresp_storage_to_xfer => cnveg_carbonflux_inst%gresp_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - - leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! Output: [real(r8) (:) ] - frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! Output: [real(r8) (:) ] - livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! Output: [real(r8) (:) ] - deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! Output: [real(r8) (:) ] - deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] - leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - frootn_storage_to_xfer => cnveg_nitrogenflux_inst%frootn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livestemn_storage_to_xfer => cnveg_nitrogenflux_inst%livestemn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadstemn_storage_to_xfer => cnveg_nitrogenflux_inst%deadstemn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livecrootn_storage_to_xfer => cnveg_nitrogenflux_inst%livecrootn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadcrootn_storage_to_xfer => cnveg_nitrogenflux_inst%deadcrootn_storage_to_xfer_patch & ! Output: [real(r8) (:) ] - ) - - ! start patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - g = patch%gridcell(p) - - if (season_decid(ivt(p)) == 1._r8) then - - ! set background litterfall rate, background transfer rate, and - ! long growing season factor to 0 for seasonal deciduous types - bglfr(p) = 0._r8 - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - - ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) - - ! set flag for solstice period (winter->summer = 1, summer->winter = 0) - if (dayl(g) >= prev_dayl(g)) then - ws_flag = 1._r8 - else - ws_flag = 0._r8 - end if - - ! update offset_counter and test for the end of the offset period - if (offset_flag(p) == 1.0_r8) then - ! decrement counter for offset period - offset_counter(p) = offset_counter(p) - dt - - ! if this is the end of the offset_period, reset phenology - ! flags and indices - if (offset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_offset_cleanup(p) - ! inlined during vectorization - - offset_flag(p) = 0._r8 - offset_counter(p) = 0._r8 - dormant_flag(p) = 1._r8 - days_active(p) = 0._r8 - if (use_cndv) then - pftmayexist(p) = .true. - end if - - ! reset the previous timestep litterfall flux memory - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! update onset_counter and test for the end of the onset period - if (onset_flag(p) == 1.0_r8) then - ! decrement counter for onset period - onset_counter(p) = onset_counter(p) - dt - - ! if this is the end of the onset period, reset phenology - ! flags and indices - if (onset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_onset_cleanup(p) - ! inlined during vectorization - - onset_flag(p) = 0.0_r8 - onset_counter(p) = 0.0_r8 - ! set all transfer growth rates to 0.0 - leafc_xfer_to_leafc(p) = 0.0_r8 - frootc_xfer_to_frootc(p) = 0.0_r8 - leafn_xfer_to_leafn(p) = 0.0_r8 - frootn_xfer_to_frootn(p) = 0.0_r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = 0.0_r8 - deadstemc_xfer_to_deadstemc(p) = 0.0_r8 - livecrootc_xfer_to_livecrootc(p) = 0.0_r8 - deadcrootc_xfer_to_deadcrootc(p) = 0.0_r8 - livestemn_xfer_to_livestemn(p) = 0.0_r8 - deadstemn_xfer_to_deadstemn(p) = 0.0_r8 - livecrootn_xfer_to_livecrootn(p) = 0.0_r8 - deadcrootn_xfer_to_deadcrootn(p) = 0.0_r8 - end if - ! set transfer pools to 0.0 - leafc_xfer(p) = 0.0_r8 - leafn_xfer(p) = 0.0_r8 - frootc_xfer(p) = 0.0_r8 - frootn_xfer(p) = 0.0_r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer(p) = 0.0_r8 - livestemn_xfer(p) = 0.0_r8 - deadstemc_xfer(p) = 0.0_r8 - deadstemn_xfer(p) = 0.0_r8 - livecrootc_xfer(p) = 0.0_r8 - livecrootn_xfer(p) = 0.0_r8 - deadcrootc_xfer(p) = 0.0_r8 - deadcrootn_xfer(p) = 0.0_r8 - end if - end if - end if - - ! test for switching from dormant period to growth period - if (dormant_flag(p) == 1.0_r8) then - - ! Test to turn on growing degree-day sum, if off. - ! switch on the growing degree day sum on the winter solstice - - if (onset_gddflag(p) == 0._r8 .and. ws_flag == 1._r8) then - onset_gddflag(p) = 1._r8 - onset_gdd(p) = 0._r8 - end if - - ! Test to turn off growing degree-day sum, if on. - ! This test resets the growing degree day sum if it gets past - ! the summer solstice without reaching the threshold value. - ! In that case, it will take until the next winter solstice - ! before the growing degree-day summation starts again. - - if (onset_gddflag(p) == 1._r8 .and. ws_flag == 0._r8) then - onset_gddflag(p) = 0._r8 - onset_gdd(p) = 0._r8 - end if - - ! if the gdd flag is set, and if the soil is above freezing - ! then accumulate growing degree days for onset trigger - - soilt = t_soisno(c,3) - if (onset_gddflag(p) == 1.0_r8 .and. soilt > SHR_CONST_TKFRZ) then - onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday - end if - - ! set onset_flag if critical growing degree-day sum is exceeded - if (onset_gdd(p) > crit_onset_gdd) then - onset_flag(p) = 1.0_r8 - dormant_flag(p) = 0.0_r8 - onset_gddflag(p) = 0.0_r8 - onset_gdd(p) = 0.0_r8 - onset_counter(p) = ndays_on * secspday - - ! move all the storage pools into transfer pools, - ! where they will be transfered to displayed growth over the onset period. - ! this code was originally handled with call cn_storage_to_xfer(p) - ! inlined during vectorization - - ! set carbon fluxes for shifting storage pools to transfer pools - leafc_storage_to_xfer(p) = fstor2tran * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = fstor2tran * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = fstor2tran * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = fstor2tran * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = fstor2tran * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = fstor2tran * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = fstor2tran * gresp_storage(p)/dt - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = fstor2tran * leafn_storage(p)/dt - frootn_storage_to_xfer(p) = fstor2tran * frootn_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = fstor2tran * livestemn_storage(p)/dt - deadstemn_storage_to_xfer(p) = fstor2tran * deadstemn_storage(p)/dt - livecrootn_storage_to_xfer(p) = fstor2tran * livecrootn_storage(p)/dt - deadcrootn_storage_to_xfer(p) = fstor2tran * deadcrootn_storage(p)/dt - end if - end if - - ! test for switching from growth period to offset period - else if (offset_flag(p) == 0.0_r8) then - if (use_cndv) then - ! If days_active > 355, then remove patch in - ! CNDVEstablishment at the end of the year. - ! days_active > 355 is a symptom of seasonal decid. patches occurring in - ! gridcells where dayl never drops below crit_dayl. - ! This results in TLAI>1e4 in a few gridcells. - days_active(p) = days_active(p) + fracday - if (days_active(p) > 355._r8) pftmayexist(p) = .false. - end if - - ! only begin to test for offset daylength once past the summer sol - if (ws_flag == 0._r8 .and. dayl(g) < crit_dayl) then - offset_flag(p) = 1._r8 - offset_counter(p) = ndays_off * secspday - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - end if ! end if seasonal deciduous - - end do ! end of patch loop - - end associate - - end subroutine CNSeasonDecidPhenology - - !----------------------------------------------------------------------- - subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & - soilstate_inst, temperature_inst, atm2lnd_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! This routine handles phenology for vegetation types, such as grasses and - ! tropical drought deciduous trees, that respond to cold and drought stress - ! signals and that can have multiple growing seasons in a given year. - ! This routine allows for the possibility that leaves might persist year-round - ! in the absence of a suitable stress trigger, by switching to an essentially - ! evergreen habit, but maintaining a deciduous leaf longevity, while waiting - ! for the next stress trigger. This is in contrast to the seasonal deciduous - ! algorithm (for temperate deciduous trees) that forces a single growing season - ! per year. - ! - ! !USES: - use clm_time_manager , only : get_days_per_year - use CNSharedParamsMod, only : use_fun - use clm_varcon , only : secspday - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_PI - use CNSharedParamsMod, only : CNParamsShareInst - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - real(r8),parameter :: secspqtrday = secspday / 4 ! seconds per quarter day - integer :: g,c,p ! indices - integer :: fp ! lake filter patch index - real(r8):: dayspyr ! days per year - real(r8):: crit_onset_gdd ! degree days for onset trigger - real(r8):: soilt ! temperature of top soil layer - real(r8):: psi ! water stress of top soil layer - real(r8):: rain_threshold ! rain threshold for leaf on [mm] - logical :: additional_onset_condition ! additional condition for leaf onset - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - dayl => grc%dayl , & ! Input: [real(r8) (:) ] daylength (s) - - prec10 => atm2lnd_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - leaf_long => pftcon%leaf_long , & ! Input: leaf longevity (yrs) - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress-deciduous leaf habit (0 or 1) - - soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - dormant_flag => cnveg_state_inst%dormant_flag_patch , & ! Output: [real(r8) (:) ] dormancy flag - days_active => cnveg_state_inst%days_active_patch , & ! Output: [real(r8) (:) ] number of days since last dormancy - onset_flag => cnveg_state_inst%onset_flag_patch , & ! Output: [real(r8) (:) ] onset flag - onset_counter => cnveg_state_inst%onset_counter_patch , & ! Output: [real(r8) (:) ] onset counter (seconds) - onset_gddflag => cnveg_state_inst%onset_gddflag_patch , & ! Output: [real(r8) (:) ] onset freeze flag - onset_fdd => cnveg_state_inst%onset_fdd_patch , & ! Output: [real(r8) (:) ] onset freezing degree days counter - onset_gdd => cnveg_state_inst%onset_gdd_patch , & ! Output: [real(r8) (:) ] onset growing degree days - onset_swi => cnveg_state_inst%onset_swi_patch , & ! Output: [real(r8) (:) ] onset soil water index - offset_flag => cnveg_state_inst%offset_flag_patch , & ! Output: [real(r8) (:) ] offset flag - offset_counter => cnveg_state_inst%offset_counter_patch , & ! Output: [real(r8) (:) ] offset counter (seconds) - offset_fdd => cnveg_state_inst%offset_fdd_patch , & ! Output: [real(r8) (:) ] offset freezing degree days counter - offset_swi => cnveg_state_inst%offset_swi_patch , & ! Output: [real(r8) (:) ] offset soil water index - lgsf => cnveg_state_inst%lgsf_patch , & ! Output: [real(r8) (:) ] long growing season factor [0-1] - bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) - bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) - annavg_t2m => cnveg_state_inst%annavg_t2m_patch , & ! Output: [real(r8) (:) ] annual average 2m air temperature (K) - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - - prev_leafc_to_litter => cnveg_carbonflux_inst%prev_leafc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep leaf C litterfall flux (gC/m2/s) - prev_frootc_to_litter => cnveg_carbonflux_inst%prev_frootc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep froot C litterfall flux (gC/m2/s) - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! Output: [real(r8) (:) ] - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Output: [real(r8) (:) ] - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! Output: [real(r8) (:) ] - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! Output: [real(r8) (:) ] - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - frootc_storage_to_xfer => cnveg_carbonflux_inst%frootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livestemc_storage_to_xfer => cnveg_carbonflux_inst%livestemc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadstemc_storage_to_xfer => cnveg_carbonflux_inst%deadstemc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livecrootc_storage_to_xfer => cnveg_carbonflux_inst%livecrootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadcrootc_storage_to_xfer => cnveg_carbonflux_inst%deadcrootc_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - gresp_storage_to_xfer => cnveg_carbonflux_inst%gresp_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - - leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! Output: [real(r8) (:) ] - frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! Output: [real(r8) (:) ] - livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! Output: [real(r8) (:) ] - deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! Output: [real(r8) (:) ] - deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] - leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - frootn_storage_to_xfer => cnveg_nitrogenflux_inst%frootn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livestemn_storage_to_xfer => cnveg_nitrogenflux_inst%livestemn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadstemn_storage_to_xfer => cnveg_nitrogenflux_inst%deadstemn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - livecrootn_storage_to_xfer => cnveg_nitrogenflux_inst%livecrootn_storage_to_xfer_patch , & ! Output: [real(r8) (:) ] - deadcrootn_storage_to_xfer => cnveg_nitrogenflux_inst%deadcrootn_storage_to_xfer_patch & ! Output: [real(r8) (:) ] - ) - - ! set time steps - dayspyr = get_days_per_year() - - ! specify rain threshold for leaf onset - rain_threshold = 20._r8 - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - g = patch%gridcell(p) - - if (stress_decid(ivt(p)) == 1._r8) then - soilt = t_soisno(c,3) - psi = soilpsi(c,3) - - ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) - - - ! update offset_counter and test for the end of the offset period - if (offset_flag(p) == 1._r8) then - ! decrement counter for offset period - offset_counter(p) = offset_counter(p) - dt - - ! if this is the end of the offset_period, reset phenology - ! flags and indices - if (offset_counter(p) == 0._r8) then - ! this code block was originally handled by call cn_offset_cleanup(p) - ! inlined during vectorization - offset_flag(p) = 0._r8 - offset_counter(p) = 0._r8 - dormant_flag(p) = 1._r8 - days_active(p) = 0._r8 - - ! reset the previous timestep litterfall flux memory - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! update onset_counter and test for the end of the onset period - if (onset_flag(p) == 1.0_r8) then - ! decrement counter for onset period - onset_counter(p) = onset_counter(p) - dt - - ! if this is the end of the onset period, reset phenology - ! flags and indices - if (onset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_onset_cleanup(p) - ! inlined during vectorization - onset_flag(p) = 0._r8 - onset_counter(p) = 0._r8 - ! set all transfer growth rates to 0.0 - leafc_xfer_to_leafc(p) = 0._r8 - frootc_xfer_to_frootc(p) = 0._r8 - leafn_xfer_to_leafn(p) = 0._r8 - frootn_xfer_to_frootn(p) = 0._r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = 0._r8 - deadstemc_xfer_to_deadstemc(p) = 0._r8 - livecrootc_xfer_to_livecrootc(p) = 0._r8 - deadcrootc_xfer_to_deadcrootc(p) = 0._r8 - livestemn_xfer_to_livestemn(p) = 0._r8 - deadstemn_xfer_to_deadstemn(p) = 0._r8 - livecrootn_xfer_to_livecrootn(p) = 0._r8 - deadcrootn_xfer_to_deadcrootn(p) = 0._r8 - end if - ! set transfer pools to 0.0 - leafc_xfer(p) = 0._r8 - leafn_xfer(p) = 0._r8 - frootc_xfer(p) = 0._r8 - frootn_xfer(p) = 0._r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer(p) = 0._r8 - livestemn_xfer(p) = 0._r8 - deadstemc_xfer(p) = 0._r8 - deadstemn_xfer(p) = 0._r8 - livecrootc_xfer(p) = 0._r8 - livecrootn_xfer(p) = 0._r8 - deadcrootc_xfer(p) = 0._r8 - deadcrootn_xfer(p) = 0._r8 - end if - end if - end if - - ! test for switching from dormant period to growth period - if (dormant_flag(p) == 1._r8) then - - ! keep track of the number of freezing degree days in this - ! dormancy period (only if the freeze flag has not previously been set - ! for this dormancy period - - if (onset_gddflag(p) == 0._r8 .and. soilt < SHR_CONST_TKFRZ) onset_fdd(p) = onset_fdd(p) + fracday - - ! if the number of freezing degree days exceeds a critical value, - ! then onset will require both wet soils and a critical soil - ! temperature sum. If this case is triggered, reset any previously - ! accumulated value in onset_swi, so that onset now depends on - ! the accumulated soil water index following the freeze trigger - - if (onset_fdd(p) > crit_onset_fdd) then - onset_gddflag(p) = 1._r8 - onset_fdd(p) = 0._r8 - onset_swi(p) = 0._r8 - end if - - ! if the freeze flag is set, and if the soil is above freezing - ! then accumulate growing degree days for onset trigger - - if (onset_gddflag(p) == 1._r8 .and. soilt > SHR_CONST_TKFRZ) then - onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday - end if - - ! if soils are wet, accumulate soil water index for onset trigger - additional_onset_condition = .true. - if(CNParamsShareInst%constrain_stress_deciduous_onset) then - ! if additional constraint condition not met, set to false - if ((prec10(p) * (3600.0_r8*10.0_r8*24.0_r8)) < rain_threshold) then - additional_onset_condition = .false. - endif - endif - - if (psi >= soilpsi_on) then - onset_swi(p) = onset_swi(p) + fracday - endif - - ! if critical soil water index is exceeded, set onset_flag, and - ! then test for soil temperature criteria - - ! Adding in Kyla's rainfall trigger when fun on. RF. prec10 (mm/s) needs to be higher than 8mm over 10 days. - - if (onset_swi(p) > crit_onset_swi.and. additional_onset_condition) then - onset_flag(p) = 1._r8 - - ! only check soil temperature criteria if freeze flag set since - ! beginning of last dormancy. If freeze flag set and growing - ! degree day sum (since freeze trigger) is lower than critical - ! value, then override the onset_flag set from soil water. - - if (onset_gddflag(p) == 1._r8 .and. onset_gdd(p) < crit_onset_gdd) onset_flag(p) = 0._r8 - end if - - ! only allow onset if dayl > 6hrs - if (onset_flag(p) == 1._r8 .and. dayl(g) <= secspqtrday) then - onset_flag(p) = 0._r8 - end if - - ! if this is the beginning of the onset period - ! then reset the phenology flags and indices - - if (onset_flag(p) == 1._r8) then - dormant_flag(p) = 0._r8 - days_active(p) = 0._r8 - onset_gddflag(p) = 0._r8 - onset_fdd(p) = 0._r8 - onset_gdd(p) = 0._r8 - onset_swi(p) = 0._r8 - onset_counter(p) = ndays_on * secspday - - ! call subroutine to move all the storage pools into transfer pools, - ! where they will be transfered to displayed growth over the onset period. - ! this code was originally handled with call cn_storage_to_xfer(p) - ! inlined during vectorization - - ! set carbon fluxes for shifting storage pools to transfer pools - leafc_storage_to_xfer(p) = fstor2tran * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = fstor2tran * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = fstor2tran * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = fstor2tran * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = fstor2tran * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = fstor2tran * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = fstor2tran * gresp_storage(p)/dt - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = fstor2tran * leafn_storage(p)/dt - frootn_storage_to_xfer(p) = fstor2tran * frootn_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = fstor2tran * livestemn_storage(p)/dt - deadstemn_storage_to_xfer(p) = fstor2tran * deadstemn_storage(p)/dt - livecrootn_storage_to_xfer(p) = fstor2tran * livecrootn_storage(p)/dt - deadcrootn_storage_to_xfer(p) = fstor2tran * deadcrootn_storage(p)/dt - end if - end if - - ! test for switching from growth period to offset period - else if (offset_flag(p) == 0._r8) then - - ! if soil water potential lower than critical value, accumulate - ! as stress in offset soil water index - - if (psi <= soilpsi_off) then - offset_swi(p) = offset_swi(p) + fracday - - ! if the offset soil water index exceeds critical value, and - ! if this is not the middle of a previously initiated onset period, - ! then set flag to start the offset period and reset index variables - - if (offset_swi(p) >= crit_offset_swi .and. onset_flag(p) == 0._r8) offset_flag(p) = 1._r8 - - ! if soil water potential higher than critical value, reduce the - ! offset water stress index. By this mechanism, there must be a - ! sustained period of water stress to initiate offset. - - else if (psi >= soilpsi_on) then - offset_swi(p) = offset_swi(p) - fracday - offset_swi(p) = max(offset_swi(p),0._r8) - end if - - ! decrease freezing day accumulator for warm soil - if (offset_fdd(p) > 0._r8 .and. soilt > SHR_CONST_TKFRZ) then - offset_fdd(p) = offset_fdd(p) - fracday - offset_fdd(p) = max(0._r8, offset_fdd(p)) - end if - - ! increase freezing day accumulator for cold soil - if (soilt <= SHR_CONST_TKFRZ) then - offset_fdd(p) = offset_fdd(p) + fracday - - ! if freezing degree day sum is greater than critical value, initiate offset - if (offset_fdd(p) > crit_offset_fdd .and. onset_flag(p) == 0._r8) offset_flag(p) = 1._r8 - end if - - ! force offset if daylength is < 6 hrs - if (dayl(g) <= secspqtrday) then - offset_flag(p) = 1._r8 - end if - - ! if this is the beginning of the offset period - ! then reset flags and indices - if (offset_flag(p) == 1._r8) then - offset_fdd(p) = 0._r8 - offset_swi(p) = 0._r8 - offset_counter(p) = ndays_off * secspday - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! keep track of number of days since last dormancy for control on - ! fraction of new growth to send to storage for next growing season - - if (dormant_flag(p) == 0.0_r8) then - days_active(p) = days_active(p) + fracday - end if - - ! calculate long growing season factor (lgsf) - ! only begin to calculate a lgsf greater than 0.0 once the number - ! of days active exceeds days/year. - lgsf(p) = max(min(3.0_r8*(days_active(p)-leaf_long(ivt(p))*dayspyr )/dayspyr, 1._r8),0._r8) - ! RosieF. 5 Nov 2015. Changed this such that the increase in leaf turnover is faster after - ! trees enter the 'fake evergreen' state. Otherwise, they have a whole year of - ! cheating, with less litterfall than they should have, resulting in very high LAI. - ! Further, the 'fake evergreen' state (where lgsf>0) is entered at the end of a single leaf lifespan - ! and not a whole year. The '3' is arbitrary, given that this entire system is quite abstract. - - - ! set background litterfall rate, when not in the phenological offset period - if (offset_flag(p) == 1._r8) then - bglfr(p) = 0._r8 - else - ! calculate the background litterfall rate (bglfr) - ! in units 1/s, based on leaf longevity (yrs) and correction for long growing season - - bglfr(p) = (1._r8/(leaf_long(ivt(p))*dayspyr*secspday))*lgsf(p) - end if - - ! set background transfer rate when active but not in the phenological onset period - if (onset_flag(p) == 1._r8) then - bgtr(p) = 0._r8 - else - ! the background transfer rate is calculated as the rate that would result - ! in complete turnover of the storage pools in one year at steady state, - ! once lgsf has reached 1.0 (after 730 days active). - - bgtr(p) = (1._r8/(dayspyr*secspday))*lgsf(p) - - ! set carbon fluxes for shifting storage pools to transfer pools - - ! reduced the amount of stored carbon flowing to display pool by only counting the delta - ! between leafc and leafc_store in the flux. RosieF, Nov5 2015. - leafc_storage_to_xfer(p) = max(0.0_r8,(leafc_storage(p)-leafc(p))) * bgtr(p) - frootc_storage_to_xfer(p) = max(0.0_r8,(frootc_storage(p)-frootc(p))) * bgtr(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = livestemc_storage(p) * bgtr(p) - deadstemc_storage_to_xfer(p) = deadstemc_storage(p) * bgtr(p) - livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * bgtr(p) - deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * bgtr(p) - gresp_storage_to_xfer(p) = gresp_storage(p) * bgtr(p) - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = leafn_storage(p) * bgtr(p) - frootn_storage_to_xfer(p) = frootn_storage(p) * bgtr(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = livestemn_storage(p) * bgtr(p) - deadstemn_storage_to_xfer(p) = deadstemn_storage(p) * bgtr(p) - livecrootn_storage_to_xfer(p) = livecrootn_storage(p) * bgtr(p) - deadcrootn_storage_to_xfer(p) = deadcrootn_storage(p) * bgtr(p) - end if - end if - - end if ! end if stress deciduous - - end do ! end of patch loop - - end associate - - end subroutine CNStressDecidPhenology - - !----------------------------------------------------------------------- - subroutine CropPhenology(num_pcropp, filter_pcropp , & - waterstate_inst, temperature_inst, crop_inst, canopystate_inst, cnveg_state_inst , & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst,& - c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst) - - ! !DESCRIPTION: - ! Code from AgroIBIS to determine crop phenology and code from CN to - ! handle CN fluxes during the phenological onset & offset periods. - - ! !USES: - use clm_time_manager , only : get_curr_date, get_curr_calday, get_days_per_year, get_rad_step_size - use pftconMod , only : ntmp_corn, nswheat, nwwheat, ntmp_soybean - use pftconMod , only : nirrig_tmp_corn, nirrig_swheat, nirrig_wwheat, nirrig_tmp_soybean - use pftconMod , only : ntrp_corn, nsugarcane, ntrp_soybean, ncotton, nrice - use pftconMod , only : nirrig_trp_corn, nirrig_sugarcane, nirrig_trp_soybean - use pftconMod , only : nirrig_cotton, nirrig_rice - use clm_varcon , only : spval, secspday - use clm_varctl , only : use_fertilizer - use clm_varctl , only : use_c13, use_c14 - use clm_varcon , only : c13ratio, c14ratio - ! - ! !ARGUMENTS: - integer , intent(in) :: num_pcropp ! number of prog crop patches in filter - integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(crop_type) , intent(inout) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - ! - ! LOCAL VARAIBLES: - integer kyr ! current year - integer kmo ! month of year (1, ..., 12) - integer kda ! day of month (1, ..., 31) - integer mcsec ! seconds of day (0, ..., seconds/day) - integer jday ! julian day of the year - integer fp,p ! patch indices - integer c ! column indices - integer g ! gridcell indices - integer h ! hemisphere indices - integer idpp ! number of days past planting - real(r8) :: dtrad ! radiation time step delta t (seconds) - real(r8) dayspyr ! days per year - real(r8) crmcorn ! comparitive relative maturity for corn - real(r8) ndays_on ! number of days to fertilize - !------------------------------------------------------------------------ - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - leaf_long => pftcon%leaf_long , & ! Input: leaf longevity (yrs) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - manunitro => pftcon%manunitro , & ! Input: max manure to be applied in total (kgN/m2) - mxmat => pftcon%mxmat , & ! Input: - minplanttemp => pftcon%minplanttemp , & ! Input: - planttemp => pftcon%planttemp , & ! Input: - gddmin => pftcon%gddmin , & ! Input: - hybgdd => pftcon%hybgdd , & ! Input: - lfemerg => pftcon%lfemerg , & ! Input: - grnfill => pftcon%grnfill , & ! Input: - - t_ref2m_min => temperature_inst%t_ref2m_min_patch , & ! Input: [real(r8) (:) ] daily minimum of average 2 m height surface air temperature (K) - t10 => temperature_inst%t_a10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of the 2 m temperature (K) - a5tmin => temperature_inst%t_a5min_patch , & ! Input: [real(r8) (:) ] 5-day running mean of min 2-m temperature - a10tmin => temperature_inst%t_a10min_patch , & ! Input: [real(r8) (:) ] 10-day running mean of min 2-m temperature - gdd020 => temperature_inst%gdd020_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd0 - gdd820 => temperature_inst%gdd820_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd8 - gdd1020 => temperature_inst%gdd1020_patch , & ! Input: [real(r8) (:) ] 20 yr mean of gdd10 - - fertnitro => crop_inst%fertnitro_patch , & ! Input: [real(r8) (:) ] fertilizer nitrogen - hui => crop_inst%gddplant_patch , & ! Input: [real(r8) (:) ] gdd since planting (gddplant) - leafout => crop_inst%gddtsoi_patch , & ! Input: [real(r8) (:) ] gdd from top soil layer temperature - harvdate => crop_inst%harvdate_patch , & ! Output: [integer (:) ] harvest date - croplive => crop_inst%croplive_patch , & ! Output: [logical (:) ] Flag, true if planted, not harvested - cropplant => crop_inst%cropplant_patch , & ! Output: [logical (:) ] Flag, true if crop may be planted - vf => crop_inst%vf_patch , & ! Output: [real(r8) (:) ] vernalization factor - peaklai => cnveg_state_inst%peaklai_patch , & ! Output: [integer (:) ] 1: max allowed lai; 0: not at max - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - - idop => cnveg_state_inst%idop_patch , & ! Output: [integer (:) ] date of planting - gddmaturity => cnveg_state_inst%gddmaturity_patch , & ! Output: [real(r8) (:) ] gdd needed to harvest - huileaf => cnveg_state_inst%huileaf_patch , & ! Output: [real(r8) (:) ] heat unit index needed from planting to leaf emergence - huigrain => cnveg_state_inst%huigrain_patch , & ! Output: [real(r8) (:) ] same to reach vegetative maturity - cumvd => cnveg_state_inst%cumvd_patch , & ! Output: [real(r8) (:) ] cumulative vernalization d?ependence? - hdidx => cnveg_state_inst%hdidx_patch , & ! Output: [real(r8) (:) ] cold hardening index? - bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) - bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) - lgsf => cnveg_state_inst%lgsf_patch , & ! Output: [real(r8) (:) ] long growing season factor [0-1] - onset_flag => cnveg_state_inst%onset_flag_patch , & ! Output: [real(r8) (:) ] onset flag - offset_flag => cnveg_state_inst%offset_flag_patch , & ! Output: [real(r8) (:) ] offset flag - onset_counter => cnveg_state_inst%onset_counter_patch , & ! Output: [real(r8) (:) ] onset counter - offset_counter => cnveg_state_inst%offset_counter_patch , & ! Output: [real(r8) (:) ] offset counter - - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer - - crop_seedc_to_leaf => cnveg_carbonflux_inst%crop_seedc_to_leaf_patch, & ! Output: [real(r8) (:) ] (gC/m2/s) seed source to leaf - - fert_counter => cnveg_nitrogenflux_inst%fert_counter_patch , & ! Output: [real(r8) (:) ] >0 fertilize; <=0 not (seconds) - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Output: [real(r8) (:) ] (gN/m2) leaf N transfer - crop_seedn_to_leaf => cnveg_nitrogenflux_inst%crop_seedn_to_leaf_patch, & ! Output: [real(r8) (:) ] (gN/m2/s) seed source to leaf - cphase => crop_inst%cphase_patch , & ! Output: [real(r8) (:)] phenology phase - fert => cnveg_nitrogenflux_inst%fert_patch & ! Output: [real(r8) (:) ] (gN/m2/s) fertilizer applied each timestep - ) - - ! get time info - dayspyr = get_days_per_year() - jday = get_curr_calday() - call get_curr_date(kyr, kmo, kda, mcsec) - dtrad = real( get_rad_step_size(), r8 ) - - if (use_fertilizer) then - ndays_on = 20._r8 ! number of days to fertilize - else - ndays_on = 0._r8 ! number of days to fertilize - end if - - do fp = 1, num_pcropp - p = filter_pcropp(fp) - c = patch%column(p) - g = patch%gridcell(p) - h = inhemi(p) - - ! background litterfall and transfer rates; long growing season factor - - bglfr(p) = 0._r8 ! this value changes later in a crop's life cycle - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - - ! --------------------------------- - ! from AgroIBIS subroutine planting - ! --------------------------------- - - ! in order to allow a crop to be planted only once each year - ! initialize cropplant = .false., but hold it = .true. through the end of the year - - ! initialize other variables that are calculated for crops - ! on an annual basis in cropresidue subroutine - - if ( jday == jdayyrstart(h) .and. mcsec == 0 )then - - ! make sure variables aren't changed at beginning of the year - ! for a crop that is currently planted, such as - ! WINTER TEMPERATE CEREAL = winter (wheat + barley + rye) - ! represented here by the winter wheat pft - - if (.not. croplive(p)) then - cropplant(p) = .false. - idop(p) = NOT_Planted - - ! keep next for continuous, annual winter temperate cereal crop; - ! if we removed elseif, - ! winter cereal grown continuously would amount to a cereal/fallow - ! rotation because cereal would only be planted every other year - - else if (croplive(p) .and. (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat)) then - cropplant(p) = .false. - ! else ! not possible to have croplive and ivt==cornORsoy? (slevis) - end if - - end if - - if ( (.not. croplive(p)) .and. (.not. cropplant(p)) ) then - - ! gdd needed for * chosen crop and a likely hybrid (for that region) * - ! to reach full physiological maturity - - ! based on accumulated seasonal average growing degree days from - ! April 1 - Sept 30 (inclusive) - ! for corn and soybeans in the United States - - ! decided upon by what the typical average growing season length is - ! and the gdd needed to reach maturity in those regions - - ! first choice is used for spring temperate cereal and/or soybeans and maize - - ! slevis: ibis reads xinpdate in io.f from control.crops.nc variable name 'plantdate' - ! According to Chris Kucharik, the dataset of - ! xinpdate was generated from a previous model run at 0.5 deg resolution - - ! winter temperate cereal : use gdd0 as a limit to plant winter cereal - - if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then - - ! add check to only plant winter cereal after other crops (soybean, maize) - ! have been harvested - - ! *** remember order of planting is crucial - in terms of which crops you want - ! to be grown in what order *** - - ! in this case, corn or soybeans are assumed to be planted before - ! cereal would be in any particular year that both patches are allowed - ! to grow in the same grid cell (e.g., double-cropping) - - ! slevis: harvdate below needs cropplant(p) above to be cropplant(p,ivt(p)) - ! where ivt(p) has rotated to winter cereal because - ! cropplant through the end of the year for a harvested crop. - ! Also harvdate(p) should be harvdate(p,ivt(p)) and should be - ! updated on Jan 1st instead of at harvest (slevis) - if (a5tmin(p) /= spval .and. & - a5tmin(p) <= minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - (gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p)))) then - - cumvd(p) = 0._r8 - hdidx(p) = 0._r8 - vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - - ! latest possible date to plant winter cereal and after all other - ! crops were harvested for that year - - else if (jday >= maxplantjday(ivt(p),h) .and. & - gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p))) then - - cumvd(p) = 0._r8 - hdidx(p) = 0._r8 - vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - else - gddmaturity(p) = 0._r8 - end if - - else ! not winter cereal... slevis: added distinction between NH and SH - ! slevis: The idea is that jday will equal idop sooner or later in the year - ! while the gdd part is either true or false for the year. - if (t10(p) /= spval.and. a10tmin(p) /= spval .and. & - t10(p) > planttemp(ivt(p)) .and. & - a10tmin(p) > minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - jday <= maxplantjday(ivt(p),h) .and. & - t10(p) /= spval .and. a10tmin(p) /= spval .and. & - gdd820(p) /= spval .and. & - gdd820(p) >= gddmin(ivt(p))) then - - ! impose limit on growing season length needed - ! for crop maturity - for cold weather constraints - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - - ! go a specified amount of time before/after - ! climatological date - if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & - ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then - gddmaturity(p) = min(gdd1020(p), hybgdd(ivt(p))) - end if - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & - ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & - ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane) then - gddmaturity(p) = max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) - gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) - end if - if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & - ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & - ivt(p) == nrice .or. ivt(p) == nirrig_rice) then - gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) - end if - - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - - - ! If hit the max planting julian day -- go ahead and plant - else if (jday == maxplantjday(ivt(p),h) .and. gdd820(p) > 0._r8 .and. & - gdd820(p) /= spval ) then - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - - if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & - ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then - gddmaturity(p) = min(gdd1020(p), hybgdd(ivt(p))) - end if - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & - ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & - ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane) then - gddmaturity(p) = max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) - end if - if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & - ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & - ivt(p) == nrice .or. ivt(p) == nirrig_rice) then - gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) - end if - - leafc_xfer(p) = initial_seed_at_planting - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - crop_seedc_to_leaf(p) = leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = leafn_xfer(p)/dt - - ! because leafc_xfer is set above rather than incremneted through the normal process, must also set its isotope - ! pools here. use totvegc_patch as the closest analogue if nonzero, and use initial value otherwise - if (use_c13) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c13_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c13ratio - endif - endif - if (use_c14) then - if ( cnveg_carbonstate_inst%totvegc_patch(p) .gt. 0._r8) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * & - c14_cnveg_carbonstate_inst%totvegc_patch(p) / cnveg_carbonstate_inst%totvegc_patch(p) - else - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = leafc_xfer(p) * c14ratio - endif - endif - - else - gddmaturity(p) = 0._r8 - end if - end if ! crop patch distinction - - ! crop phenology (gdd thresholds) controlled by gdd needed for - ! maturity (physiological) which is based on the average gdd - ! accumulation and hybrids in United States from April 1 - Sept 30 - - ! calculate threshold from phase 1 to phase 2: - ! threshold for attaining leaf emergence (based on fraction of - ! gdd(i) -- climatological average) - ! Hayhoe and Dwyer, 1990, Can. J. Soil Sci 70:493-497 - ! Carlson and Gage, 1989, Agric. For. Met., 45: 313-324 - ! J.T. Ritchie, 1991: Modeling Plant and Soil systems - - huileaf(p) = lfemerg(ivt(p)) * gddmaturity(p) ! 3-7% in cereal - - ! calculate threshhold from phase 2 to phase 3: - ! from leaf emergence to beginning of grain-fill period - ! this hypothetically occurs at the end of tassling, not the beginning - ! tassel initiation typically begins at 0.5-0.55 * gddmaturity - - ! calculate linear relationship between huigrain fraction and relative - ! maturity rating for maize - - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & - ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & - ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane) then - ! the following estimation of crmcorn from gddmaturity is based on a linear - ! regression using data from Pioneer-brand corn hybrids (Kucharik, 2003, - ! Earth Interactions 7:1-33: fig. 2) - crmcorn = max(73._r8, min(135._r8, (gddmaturity(p)+ 53.683_r8)/13.882_r8)) - - ! the following adjustment of grnfill based on crmcorn is based on a tuning - ! of Agro-IBIS to give reasonable results for max LAI and the seasonal - ! progression of LAI growth (pers. comm. C. Kucharik June 10, 2010) - huigrain(p) = -0.002_r8 * (crmcorn - 73._r8) + grnfill(ivt(p)) - - huigrain(p) = min(max(huigrain(p), grnfill(ivt(p))-0.1_r8), grnfill(ivt(p))) - huigrain(p) = huigrain(p) * gddmaturity(p) ! Cabelguenne et - else - huigrain(p) = grnfill(ivt(p)) * gddmaturity(p) ! al. 1999 - end if - - end if ! crop not live nor planted - - ! ---------------------------------- - ! from AgroIBIS subroutine phenocrop - ! ---------------------------------- - - ! all of the phenology changes are based on the total number of gdd needed - ! to change to the next phase - based on fractions of the total gdd typical - ! for that region based on the April 1 - Sept 30 window of development - - ! crop phenology (gdd thresholds) controlled by gdd needed for - ! maturity (physiological) which is based on the average gdd - ! accumulation and hybrids in United States from April 1 - Sept 30 - - ! Phase 1: Planting to leaf emergence (now in CNAllocation) - ! Phase 2: Leaf emergence to beginning of grain fill (general LAI accumulation) - ! Phase 3: Grain fill to physiological maturity and harvest (LAI decline) - ! Harvest: if gdd past grain fill initiation exceeds limit - ! or number of days past planting reaches a maximum, the crop has - ! reached physiological maturity and plant is harvested; - ! crop could be live or dead at this stage - these limits - ! could lead to reaching physiological maturity or determining - ! a harvest date for a crop killed by an early frost (see next comments) - ! --- --- --- - ! keeping comments without the code (slevis): - ! if minimum temperature, t_ref2m_min <= freeze kill threshold, tkill - ! for 3 consecutive days and lai is above a minimum, - ! plant will be damaged/killed. This function is more for spring freeze events - ! or for early fall freeze events - - ! spring temperate cereal is affected by this, winter cereal kill function - ! is determined in crops.f - is a more elaborate function of - ! cold hardening of the plant - - ! currently simulates too many grid cells killed by freezing temperatures - - ! removed on March 12 2002 - C. Kucharik - ! until it can be a bit more refined, or used at a smaller scale. - ! we really have no way of validating this routine - ! too difficult to implement on 0.5 degree scale grid cells - ! --- --- --- - - onset_flag(p) = 0._r8 ! CN terminology to trigger certain - offset_flag(p) = 0._r8 ! carbon and nitrogen transfers - - if (croplive(p)) then - cphase(p) = 1._r8 - - ! call vernalization if winter temperate cereal planted, living, and the - ! vernalization factor is not 1; - ! vf affects the calculation of gddtsoi & gddplant - - if (t_ref2m_min(p) < 1.e30_r8 .and. vf(p) /= 1._r8 .and. & - (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat)) then - call vernalization(p, & - canopystate_inst, temperature_inst, waterstate_inst, cnveg_state_inst, & - crop_inst) - end if - - ! days past planting may determine harvest - - if (jday >= idop(p)) then - idpp = jday - idop(p) - else - idpp = int(dayspyr) + jday - idop(p) - end if - - ! onset_counter initialized to zero when .not. croplive - ! offset_counter relevant only at time step of harvest - - onset_counter(p) = onset_counter(p) - dt - - ! enter phase 2 onset for one time step: - ! transfer seed carbon to leaf emergence - - if (peaklai(p) >= 1) then - hui(p) = max(hui(p),huigrain(p)) - endif - - if (leafout(p) >= huileaf(p) .and. hui(p) < huigrain(p) .and. idpp < mxmat(ivt(p))) then - cphase(p) = 2._r8 - if (abs(onset_counter(p)) > 1.e-6_r8) then - onset_flag(p) = 1._r8 - onset_counter(p) = dt - fert_counter(p) = ndays_on * secspday - if (ndays_on .gt. 0) then - fert(p) = (manunitro(ivt(p)) * 1000._r8 + fertnitro(p))/ fert_counter(p) - else - fert(p) = 0._r8 - end if - else - ! this ensures no re-entry to onset of phase2 - ! b/c onset_counter(p) = onset_counter(p) - dt - ! at every time step - - onset_counter(p) = dt - end if - - ! enter harvest for one time step: - ! - transfer live biomass to litter and to crop yield - ! - send xsmrpool to the atmosphere - ! if onset and harvest needed to last longer than one timestep - ! the onset_counter would change from dt and you'd need to make - ! changes to the offset subroutine below - - else if (hui(p) >= gddmaturity(p) .or. idpp >= mxmat(ivt(p))) then - if (harvdate(p) >= NOT_Harvested) harvdate(p) = jday - croplive(p) = .false. ! no re-entry in greater if-block - cphase(p) = 4._r8 - if (tlai(p) > 0._r8) then ! plant had emerged before harvest - offset_flag(p) = 1._r8 - offset_counter(p) = dt - else ! plant never emerged from the ground - ! Revert planting transfers; this will replenish the crop seed deficit. - ! We subtract from any existing value in crop_seedc_to_leaf / - ! crop_seedn_to_leaf in the unlikely event that we enter this block of - ! code in the same time step where the planting transfer originally - ! occurred. - crop_seedc_to_leaf(p) = crop_seedc_to_leaf(p) - leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = crop_seedn_to_leaf(p) - leafn_xfer(p)/dt - leafc_xfer(p) = 0._r8 - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) - if (use_c13) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = 0._r8 - endif - if (use_c14) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = 0._r8 - endif - - end if - - ! enter phase 3 while previous criteria fail and next is true; - ! in terms of order, phase 3 occurs before harvest, but when - ! harvest *can* occur, we want it to have first priority. - ! AgroIBIS uses a complex formula for lai decline. - ! Use CN's simple formula at least as a place holder (slevis) - - else if (hui(p) >= huigrain(p)) then - cphase(p) = 3._r8 - bglfr(p) = 1._r8/(leaf_long(ivt(p))*dayspyr*secspday) - end if - - ! continue fertilizer application while in phase 2; - ! assumes that onset of phase 2 took one time step only - - if (fert_counter(p) <= 0._r8) then - fert(p) = 0._r8 - else ! continue same fert application every timestep - fert_counter(p) = fert_counter(p) - dtrad - end if - - else ! crop not live - ! next 2 lines conserve mass if leaf*_xfer > 0 due to interpinic. - ! We subtract from any existing value in crop_seedc_to_leaf / - ! crop_seedn_to_leaf in the unlikely event that we enter this block of - ! code in the same time step where the planting transfer originally - ! occurred. - crop_seedc_to_leaf(p) = crop_seedc_to_leaf(p) - leafc_xfer(p)/dt - crop_seedn_to_leaf(p) = crop_seedn_to_leaf(p) - leafn_xfer(p)/dt - onset_counter(p) = 0._r8 - leafc_xfer(p) = 0._r8 - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) - if (use_c13) then - c13_cnveg_carbonstate_inst%leafc_xfer_patch(p) = 0._r8 - endif - if (use_c14) then - c14_cnveg_carbonstate_inst%leafc_xfer_patch(p) = 0._r8 - endif - end if ! croplive - - end do ! prognostic crops loop - - end associate - - end subroutine CropPhenology - - !----------------------------------------------------------------------- - subroutine CropPhenologyInit(bounds) - ! - ! !DESCRIPTION: - ! Initialization of CropPhenology. Must be called after time-manager is - ! initialized, and after pftcon file is read in. - ! - ! !USES: - use pftconMod , only: npcropmin, npcropmax - use clm_time_manager, only: get_calday - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! LOCAL VARAIBLES: - integer :: p,g,n,i ! indices - !------------------------------------------------------------------------ - - allocate( inhemi(bounds%begp:bounds%endp) ) - - allocate( minplantjday(0:numpft,inSH)) ! minimum planting julian day - allocate( maxplantjday(0:numpft,inSH)) ! minimum planting julian day - - ! Julian day for the start of the year (mid-winter) - jdayyrstart(inNH) = 1 - jdayyrstart(inSH) = 182 - - ! Convert planting dates into julian day - minplantjday(:,:) = huge(1) - maxplantjday(:,:) = huge(1) - do n = npcropmin, npcropmax - if (pftcon%is_pft_known_to_model(n)) then - minplantjday(n, inNH) = int( get_calday( pftcon%mnNHplantdate(n), 0 ) ) - maxplantjday(n, inNH) = int( get_calday( pftcon%mxNHplantdate(n), 0 ) ) - - minplantjday(n, inSH) = int( get_calday( pftcon%mnSHplantdate(n), 0 ) ) - maxplantjday(n, inSH) = int( get_calday( pftcon%mxSHplantdate(n), 0 ) ) - end if - end do - - ! Figure out what hemisphere each PATCH is in - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - ! Northern hemisphere - if ( grc%latdeg(g) > 0.0_r8 )then - inhemi(p) = inNH - else - inhemi(p) = inSH - end if - end do - - ! - ! Constants for Crop vernalization - ! - ! photoperiod factor calculation - ! genetic constant - can be modified - - p1d = 0.004_r8 ! average for genotypes from Ritchey, 1991. - ! Modeling plant & soil systems: Wheat phasic developmt - p1v = 0.003_r8 ! average for genotypes from Ritchey, 1991. - - hti = 1._r8 - tbase = 0._r8 - - end subroutine CropPhenologyInit - - !----------------------------------------------------------------------- - subroutine vernalization(p, & - canopystate_inst, temperature_inst, waterstate_inst, cnveg_state_inst, crop_inst) - ! - ! !DESCRIPTION: - ! - ! * * * only call for winter temperate cereal * * * - ! - ! subroutine calculates vernalization and photoperiod effects on - ! gdd accumulation in winter temperate cereal varieties. Thermal time accumulation - ! is reduced in 1st period until plant is fully vernalized. During this - ! time of emergence to spikelet formation, photoperiod can also have a - ! drastic effect on plant development. - ! - ! !ARGUMENTS: - integer , intent(in) :: p ! PATCH index running over - type(canopystate_type) , intent(in) :: canopystate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(inout) :: crop_inst - ! - ! LOCAL VARAIBLES: - real(r8) tcrown ! ? - real(r8) vd, vd1, vd2 ! vernalization dependence - real(r8) tkil ! Freeze kill threshold - integer c,g ! indices - !------------------------------------------------------------------------ - - associate( & - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - - t_ref2m => temperature_inst%t_ref2m_patch , & ! Input: [real(r8) (:) ] 2 m height surface air temperature (K) - t_ref2m_min => temperature_inst%t_ref2m_min_patch , & ! Input: [real(r8) (:) ] daily minimum of average 2 m height surface air temperature (K) - t_ref2m_max => temperature_inst%t_ref2m_max_patch , & ! Input: [real(r8) (:) ] daily maximum of average 2 m height surface air temperature (K) - - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - - hdidx => cnveg_state_inst%hdidx_patch , & ! Output: [real(r8) (:) ] cold hardening index? - cumvd => cnveg_state_inst%cumvd_patch , & ! Output: [real(r8) (:) ] cumulative vernalization d?ependence? - gddmaturity => cnveg_state_inst%gddmaturity_patch , & ! Output: [real(r8) (:) ] gdd needed to harvest - huigrain => cnveg_state_inst%huigrain_patch , & ! Output: [real(r8) (:) ] heat unit index needed to reach vegetative maturity - - vf => crop_inst%vf_patch & ! Output: [real(r8) (:) ] vernalization factor for cereal - ) - - c = patch%column(p) - - ! for all equations - temperatures must be in degrees (C) - ! calculate temperature of crown of crop (e.g., 3 cm soil temperature) - ! snow depth in centimeters - - if (t_ref2m(p) < tfrz) then !slevis: t_ref2m inst of td=daily avg (K) - tcrown = 2._r8 + (t_ref2m(p) - tfrz) * (0.4_r8 + 0.0018_r8 * & - (min(snow_depth(c)*100._r8, 15._r8) - 15._r8)**2) - else !slevis: snow_depth inst of adsnod=daily average (m) - tcrown = t_ref2m(p) - tfrz - end if - - ! vernalization factor calculation - ! if vf(p) = 1. then plant is fully vernalized - and thermal time - ! accumulation in phase 1 will be unaffected - ! refers to gddtsoi & gddplant, defined in the accumulation routines (slevis) - ! reset vf, cumvd, and hdidx to 0 at planting of crop (slevis) - - if (t_ref2m_max(p) > tfrz) then - if (t_ref2m_min(p) <= tfrz+15._r8) then - vd1 = 1.4_r8 - 0.0778_r8 * tcrown - vd2 = 0.5_r8 + 13.44_r8 / ((t_ref2m_max(p)-t_ref2m_min(p)+3._r8)**2) * tcrown - vd = max(0._r8, min(1._r8, vd1, vd2)) - cumvd(p) = cumvd(p) + vd - end if - - if (cumvd(p) < 10._r8 .and. t_ref2m_max(p) > tfrz+30._r8) then - cumvd(p) = cumvd(p) - 0.5_r8 * (t_ref2m_max(p) - tfrz - 30._r8) - end if - cumvd(p) = max(0._r8, cumvd(p)) ! must be > 0 - - vf(p) = 1._r8 - p1v * (50._r8 - cumvd(p)) - vf(p) = max(0._r8, min(vf(p), 1._r8)) ! must be between 0 - 1 - end if - - ! calculate cold hardening of plant - ! determines for winter cereal varieties whether the plant has completed - ! a period of cold hardening to protect it from freezing temperatures. If - ! not, then exposure could result in death or killing of plants. - - ! there are two distinct phases of hardening - - if (t_ref2m_min(p) <= tfrz-3._r8 .or. hdidx(p) /= 0._r8) then - if (hdidx(p) >= hti) then ! done with phase 1 - hdidx(p) = hdidx(p) + 0.083_r8 - hdidx(p) = min(hdidx(p), hti*2._r8) - end if - - if (t_ref2m_max(p) >= tbase + tfrz + 10._r8) then - hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - if (hdidx(p) > hti) hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - hdidx(p) = max(0._r8, hdidx(p)) - end if - - else if (tcrown >= tbase-1._r8) then - if (tcrown <= tbase+8._r8) then - hdidx(p) = hdidx(p) + 0.1_r8 - (tcrown-tbase+3.5_r8)**2 / 506._r8 - if (hdidx(p) >= hti .and. tcrown <= tbase + 0._r8) then - hdidx(p) = hdidx(p) + 0.083_r8 - hdidx(p) = min(hdidx(p), hti*2._r8) - end if - end if - - if (t_ref2m_max(p) >= tbase + tfrz + 10._r8) then - hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - if (hdidx(p) > hti) hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - hdidx(p) = max(0._r8, hdidx(p)) - end if - end if - - ! calculate what the cereal killing temperature - ! there is a linear inverse relationship between - ! hardening of the plant and the killing temperature or - ! threshold that the plant can withstand - ! when plant is fully-hardened (hdidx = 2), the killing threshold is -18 C - - ! will have to develop some type of relationship that reduces LAI and - ! biomass pools in response to cold damaged crop - - if (t_ref2m_min(p) <= tfrz - 6._r8) then - tkil = (tbase - 6._r8) - 6._r8 * hdidx(p) - if (tkil >= tcrown) then - if ((0.95_r8 - 0.02_r8 * (tcrown - tkil)**2) >= 0.02_r8) then - write (iulog,*) 'crop damaged by cold temperatures at p,c =', p,c - else if (tlai(p) > 0._r8) then ! slevis: kill if past phase1 - gddmaturity(p) = 0._r8 ! by forcing through - huigrain(p) = 0._r8 ! harvest - write (iulog,*) '95% of crop killed by cold temperatures at p,c =', p,c - end if - end if - end if - - end associate - - end subroutine vernalization - - !----------------------------------------------------------------------- - subroutine CNOnsetGrowth (num_soilp, filter_soilp, & - cnveg_state_inst, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Determines the flux of stored C and N from transfer pools to display - ! pools during the phenological onset period. - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(in) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter patch index - real(r8):: t1 ! temporary variable - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - - onset_flag => cnveg_state_inst%onset_flag_patch , & ! Input: [real(r8) (:) ] onset flag - onset_counter => cnveg_state_inst%onset_counter_patch , & ! Input: [real(r8) (:) ] onset days counter - bgtr => cnveg_state_inst%bgtr_patch , & ! Input: [real(r8) (:) ] background transfer growth rate (1/s) - - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! Output: [real(r8) (:) ] - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Output: [real(r8) (:) ] - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! Output: [real(r8) (:) ] - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! Output: [real(r8) (:) ] - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - - leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! Output: [real(r8) (:) ] - frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! Output: [real(r8) (:) ] - livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! Output: [real(r8) (:) ] - deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! Output: [real(r8) (:) ] - deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch & ! Output: [real(r8) (:) ] - ) - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes during onset period - if (onset_flag(p) == 1._r8) then - - ! The transfer rate is a linearly decreasing function of time, - ! going to zero on the last timestep of the onset period - - if (onset_counter(p) == dt) then - t1 = 1.0_r8 / dt - else - t1 = 2.0_r8 / (onset_counter(p)) - end if - leafc_xfer_to_leafc(p) = t1 * leafc_xfer(p) - frootc_xfer_to_frootc(p) = t1 * frootc_xfer(p) - leafn_xfer_to_leafn(p) = t1 * leafn_xfer(p) - frootn_xfer_to_frootn(p) = t1 * frootn_xfer(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = t1 * livestemc_xfer(p) - deadstemc_xfer_to_deadstemc(p) = t1 * deadstemc_xfer(p) - livecrootc_xfer_to_livecrootc(p) = t1 * livecrootc_xfer(p) - deadcrootc_xfer_to_deadcrootc(p) = t1 * deadcrootc_xfer(p) - livestemn_xfer_to_livestemn(p) = t1 * livestemn_xfer(p) - deadstemn_xfer_to_deadstemn(p) = t1 * deadstemn_xfer(p) - livecrootn_xfer_to_livecrootn(p) = t1 * livecrootn_xfer(p) - deadcrootn_xfer_to_deadcrootn(p) = t1 * deadcrootn_xfer(p) - end if - - end if ! end if onset period - - ! calculate the background rate of transfer growth (used for stress - ! deciduous algorithm). In this case, all of the mass in the transfer - ! pools should be moved to displayed growth in each timestep. - - if (bgtr(p) > 0._r8) then - leafc_xfer_to_leafc(p) = leafc_xfer(p) / dt - frootc_xfer_to_frootc(p) = frootc_xfer(p) / dt - leafn_xfer_to_leafn(p) = leafn_xfer(p) / dt - frootn_xfer_to_frootn(p) = frootn_xfer(p) / dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = livestemc_xfer(p) / dt - deadstemc_xfer_to_deadstemc(p) = deadstemc_xfer(p) / dt - livecrootc_xfer_to_livecrootc(p) = livecrootc_xfer(p) / dt - deadcrootc_xfer_to_deadcrootc(p) = deadcrootc_xfer(p) / dt - livestemn_xfer_to_livestemn(p) = livestemn_xfer(p) / dt - deadstemn_xfer_to_deadstemn(p) = deadstemn_xfer(p) / dt - livecrootn_xfer_to_livecrootn(p) = livecrootn_xfer(p) / dt - deadcrootn_xfer_to_deadcrootn(p) = deadcrootn_xfer(p) / dt - end if - end if ! end if bgtr - - end do ! end patch loop - - end associate - - end subroutine CNOnsetGrowth - - !----------------------------------------------------------------------- - subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Determines the flux of C and N from displayed pools to litter - ! pools during the phenological offset period. - ! - ! !USES: - use pftconMod , only : npcropmin - use CNSharedParamsMod, only : use_fun - use clm_varctl , only : CNratio_floating - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type), intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p, c ! indices - integer :: fp ! lake filter patch index - real(r8):: t1 ! temporary variable - real(r8):: denom ! temporary variable for divisor - real(r8) :: ntovr_leaf - real(r8) :: fr_leafn_to_litter ! fraction of the nitrogen turnover that goes to litter; remaining fraction is retranslocated - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - lflitcn => pftcon%lflitcn , & ! Input: leaf litter C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - graincn => pftcon%graincn , & ! Input: grain C:N (gC/gN) - - offset_flag => cnveg_state_inst%offset_flag_patch , & ! Input: [real(r8) (:) ] offset flag - offset_counter => cnveg_state_inst%offset_counter_patch , & ! Input: [real(r8) (:) ] offset days counter - - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - grainc => cnveg_carbonstate_inst%grainc_patch , & ! Input: [real(r8) (:) ] (gC/m2) grain C - cropseedc_deficit => cnveg_carbonstate_inst%cropseedc_deficit_patch , & ! Input: [real(r8) (:) ] (gC/m2) crop seed C deficit - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) livestem C - cropseedn_deficit => cnveg_nitrogenstate_inst%cropseedn_deficit_patch , & ! Input: [real(r8) (:) ] (gC/m2) crop seed N deficit - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) livestem N - - cpool_to_grainc => cnveg_carbonflux_inst%cpool_to_grainc_patch , & ! Input: [real(r8) (:) ] allocation to grain C (gC/m2/s) - npool_to_grainn => cnveg_nitrogenflux_inst%npool_to_grainn_patch , & ! Input: [real(r8) (:) ] allocation to grain N (gN/m2/s) - grainn => cnveg_nitrogenstate_inst%grainn_patch , & ! Input: [real(r8) (:) ] (kgN/m2) grain N - cpool_to_livestemc => cnveg_carbonflux_inst%cpool_to_livestemc_patch , & ! Input: [real(r8) (:) ] allocation to live stem C (gC/m2/s) - cpool_to_leafc => cnveg_carbonflux_inst%cpool_to_leafc_patch , & ! Input: [real(r8) (:) ] allocation to leaf C (gC/m2/s) - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Input: [real(r8) (:) ] allocation to fine root C (gC/m2/s) - prev_leafc_to_litter => cnveg_carbonflux_inst%prev_leafc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep leaf C litterfall flux (gC/m2/s) - prev_frootc_to_litter => cnveg_carbonflux_inst%prev_frootc_to_litter_patch , & ! Output: [real(r8) (:) ] previous timestep froot C litterfall flux (gC/m2/s) - leafc_to_litter => cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Output: [real(r8) (:) ] leaf C litterfall (gC/m2/s) - frootc_to_litter => cnveg_carbonflux_inst%frootc_to_litter_patch , & ! Output: [real(r8) (:) ] fine root C litterfall (gC/m2/s) - livestemc_to_litter => cnveg_carbonflux_inst%livestemc_to_litter_patch , & ! Output: [real(r8) (:) ] live stem C litterfall (gC/m2/s) - grainc_to_food => cnveg_carbonflux_inst%grainc_to_food_patch , & ! Output: [real(r8) (:) ] grain C to food (gC/m2/s) - grainc_to_seed => cnveg_carbonflux_inst%grainc_to_seed_patch , & ! Output: [real(r8) (:) ] grain C to seed (gC/m2/s) - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - - livestemn_to_litter => cnveg_nitrogenflux_inst%livestemn_to_litter_patch , & ! Output: [real(r8) (:) ] livestem N to litter (gN/m2/s) - grainn_to_food => cnveg_nitrogenflux_inst%grainn_to_food_patch , & ! Output: [real(r8) (:) ] grain N to food (gN/m2/s) - grainn_to_seed => cnveg_nitrogenflux_inst%grainn_to_seed_patch , & ! Output: [real(r8) (:) ] grain N to seed (gN/m2/s) - leafn_to_litter => cnveg_nitrogenflux_inst%leafn_to_litter_patch , & ! Output: [real(r8) (:) ] leaf N litterfall (gN/m2/s) - leafn_to_retransn => cnveg_nitrogenflux_inst%leafn_to_retransn_patch , & ! Input: [real(r8) (:) ] leaf N to retranslocated N pool (gN/m2/s) - free_retransn_to_npool=> cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) - paid_retransn_to_npool=> cnveg_nitrogenflux_inst%retransn_to_npool_patch, & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) - frootn_to_litter => cnveg_nitrogenflux_inst%frootn_to_litter_patch , & ! Output: [real(r8) (:) ] fine root N litterfall (gN/m2/s) - leafc_to_litter_fun => cnveg_carbonflux_inst%leafc_to_litter_fun_patch , & ! Output: [real(r8) (:) ] leaf C litterfall used by FUN (gC/m2/s) - leafcn_offset => cnveg_state_inst%leafcn_offset_patch & ! Output: [real(r8) (:) ] Leaf C:N used by FUN - ) - - ! The litterfall transfer rate starts at 0.0 and increases linearly - ! over time, with displayed growth going to 0.0 on the last day of litterfall - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate fluxes during offset period - if (offset_flag(p) == 1._r8) then - - if (offset_counter(p) == dt) then - t1 = 1.0_r8 / dt - leafc_to_litter(p) = t1 * leafc(p) + cpool_to_leafc(p) - frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) - ! this assumes that offset_counter == dt for crops - ! if this were ever changed, we'd need to add code to the "else" - if (ivt(p) >= npcropmin) then - ! Replenish the seed deficits from grain, if there is enough - ! available grain. (If there is not enough available grain, the seed - ! deficits will accumulate until there is eventually enough grain to - ! replenish them.) - grainc_to_seed(p) = t1 * min(-cropseedc_deficit(p), grainc(p)) - grainn_to_seed(p) = t1 * min(-cropseedn_deficit(p), grainn(p)) - ! Send the remaining grain to the food product pool - grainc_to_food(p) = t1 * grainc(p) + cpool_to_grainc(p) - grainc_to_seed(p) - grainn_to_food(p) = t1 * grainn(p) + npool_to_grainn(p) - grainn_to_seed(p) - - livestemc_to_litter(p) = t1 * livestemc(p) + cpool_to_livestemc(p) - end if - else - t1 = dt * 2.0_r8 / (offset_counter(p) * offset_counter(p)) - leafc_to_litter(p) = prev_leafc_to_litter(p) + t1*(leafc(p) - prev_leafc_to_litter(p)*offset_counter(p)) - frootc_to_litter(p) = prev_frootc_to_litter(p) + t1*(frootc(p) - prev_frootc_to_litter(p)*offset_counter(p)) - - end if - - if ( use_fun ) then - if(leafc_to_litter(p)*dt.gt.leafc(p))then - leafc_to_litter(p) = leafc(p)/dt + cpool_to_leafc(p) - endif - if(frootc_to_litter(p)*dt.gt.frootc(p))then - frootc_to_litter(p) = frootc(p)/dt + cpool_to_frootc(p) - endif - end if - - - if ( use_fun ) then - leafc_to_litter_fun(p) = leafc_to_litter(p) - leafn_to_retransn(p) = paid_retransn_to_npool(p) + free_retransn_to_npool(p) - if (leafn(p).gt.0._r8) then - if (leafn(p)-leafn_to_retransn(p)*dt.gt.0._r8) then - leafcn_offset(p) = leafc(p)/(leafn(p)-leafn_to_retransn(p)*dt) - else - leafcn_offset(p) = leafc(p)/leafn(p) - end if - else - leafcn_offset(p) = leafcn(ivt(p)) - end if - leafn_to_litter(p) = leafc_to_litter(p)/leafcn_offset(p) - leafn_to_retransn(p) - leafn_to_litter(p) = max(leafn_to_litter(p),0._r8) - - denom = ( leafn_to_retransn(p) + leafn_to_litter(p) ) - if ( denom /= 0.0_r8 ) then - fr_leafn_to_litter = leafn_to_litter(p) / ( leafn_to_retransn(p) + leafn_to_litter(p) ) - else if ( leafn_to_litter(p) == 0.0_r8 ) then - fr_leafn_to_litter = 0.0_r8 - else - fr_leafn_to_litter = 1.0_r8 - end if - - else - if (CNratio_floating .eqv. .true.) then - fr_leafn_to_litter = 0.5_r8 ! assuming 50% of nitrogen turnover goes to litter - end if - ! calculate the leaf N litterfall and retranslocation - leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) - leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) - - end if - - ! calculate fine root N litterfall (no retranslocation of fine root N) - frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - - if (CNratio_floating .eqv. .true.) then - if (leafc(p) == 0.0_r8) then - ntovr_leaf = 0.0_r8 - else - ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) - end if - - leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf - leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) - if (frootc(p) == 0.0_r8) then - frootn_to_litter(p) = 0.0_r8 - else - frootn_to_litter(p) = frootc_to_litter(p) * (frootn(p) / frootc(p)) - end if - end if - - if ( use_fun ) then - if(frootn_to_litter(p)*dt.gt.frootn(p))then - frootn_to_litter(p) = frootn(p)/dt - endif - end if - - if (ivt(p) >= npcropmin) then - ! NOTE(slevis, 2014-12) results in -ve livestemn and -ve totpftn - !X! livestemn_to_litter(p) = livestemc_to_litter(p) / livewdcn(ivt(p)) - ! NOTE(slevis, 2014-12) Beth Drewniak suggested this instead - livestemn_to_litter(p) = livestemn(p) / dt - end if - - ! save the current litterfall fluxes - prev_leafc_to_litter(p) = leafc_to_litter(p) - prev_frootc_to_litter(p) = frootc_to_litter(p) - - end if ! end if offset period - - end do ! end patch loop - - end associate - - end subroutine CNOffsetLitterfall - - !----------------------------------------------------------------------- - subroutine CNBackgroundLitterfall (num_soilp, filter_soilp, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Determines the flux of C and N from displayed pools to litter - ! pools as the result of background litter fall. - ! - ! !USES: - use CNSharedParamsMod , only : use_fun - use clm_varctl , only : CNratio_floating - ! !ARGUMENTS: - implicit none - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type), intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter patch index - real(r8) :: fr_leafn_to_litter ! fraction of the nitrogen turnover that goes to litter; remaining fraction is retranslocated - real(r8) :: ntovr_leaf - real(r8) :: denom - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - lflitcn => pftcon%lflitcn , & ! Input: leaf litter C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - - bglfr => cnveg_state_inst%bglfr_patch , & ! Input: [real(r8) (:) ] background litterfall rate (1/s) - - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - - leafc_to_litter => cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Output: [real(r8) (:) ] - frootc_to_litter => cnveg_carbonflux_inst%frootc_to_litter_patch , & ! Output: [real(r8) (:) ] - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - leafn_to_litter => cnveg_nitrogenflux_inst%leafn_to_litter_patch , & ! Output: [real(r8) (:) ] - leafn_to_retransn => cnveg_nitrogenflux_inst%leafn_to_retransn_patch , & ! Output: [real(r8) (:) ] - frootn_to_litter => cnveg_nitrogenflux_inst%frootn_to_litter_patch , & ! Output: [real(r8) (:) ] - leafc_to_litter_fun => cnveg_carbonflux_inst%leafc_to_litter_fun_patch, & ! Output: [real(r8) (:) ] leaf C litterfall used by FUN (gC/m2/s) - leafcn_offset => cnveg_state_inst%leafcn_offset_patch , & ! Output: [real(r8) (:) ] Leaf C:N used by FUN - free_retransn_to_npool=> cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) - paid_retransn_to_npool=> cnveg_nitrogenflux_inst%retransn_to_npool_patch & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) - ) - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes if the background litterfall rate is non-zero - if (bglfr(p) > 0._r8) then - ! units for bglfr are already 1/s - leafc_to_litter(p) = bglfr(p) * leafc(p) - frootc_to_litter(p) = bglfr(p) * frootc(p) - if ( use_fun ) then - leafc_to_litter_fun(p) = leafc_to_litter(p) - leafn_to_retransn(p) = paid_retransn_to_npool(p) + free_retransn_to_npool(p) - if (leafn(p).gt.0._r8) then - if (leafn(p)-leafn_to_retransn(p)*dt.gt.0._r8) then - leafcn_offset(p) = leafc(p)/(leafn(p)-leafn_to_retransn(p)*dt) - else - leafcn_offset(p) = leafc(p)/leafn(p) - end if - else - leafcn_offset(p) = leafcn(ivt(p)) - end if - leafn_to_litter(p) = leafc_to_litter(p)/leafcn_offset(p) - leafn_to_retransn(p) - leafn_to_litter(p) = max(leafn_to_litter(p),0._r8) - - denom = ( leafn_to_retransn(p) + leafn_to_litter(p) ) - if ( denom /= 0.0_r8 ) then - fr_leafn_to_litter = leafn_to_litter(p) / ( leafn_to_retransn(p) + leafn_to_litter(p) ) - else if ( leafn_to_litter(p) == 0.0_r8 ) then - fr_leafn_to_litter = 0.0_r8 - else - fr_leafn_to_litter = 1.0_r8 - end if - - - else - if (CNratio_floating .eqv. .true.) then - fr_leafn_to_litter = 0.5_r8 ! assuming 50% of nitrogen turnover goes to litter - end if - ! calculate the leaf N litterfall and retranslocation - leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) - leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) - - end if - - ! calculate fine root N litterfall (no retranslocation of fine root N) - frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - - if (CNratio_floating .eqv. .true.) then - if (leafc(p) == 0.0_r8) then - ntovr_leaf = 0.0_r8 - else - ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) - end if - - leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf - leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) - if (frootc(p) == 0.0_r8) then - frootn_to_litter(p) = 0.0_r8 - else - frootn_to_litter(p) = frootc_to_litter(p) * (frootn(p) / frootc(p)) - end if - end if - - if ( use_fun ) then - if(frootn_to_litter(p)*dt.gt.frootn(p))then - frootn_to_litter(p) = frootn(p)/dt - endif - end if - - end if - - end do - - end associate - - end subroutine CNBackgroundLitterfall - - !----------------------------------------------------------------------- - subroutine CNLivewoodTurnover (num_soilp, filter_soilp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Determines the flux of C and N from live wood to - ! dead wood pools, for stem and coarse root. - ! - use CNSharedParamsMod, only: use_fun - use clm_varctl , only : CNratio_floating - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter patch index - real(r8):: ctovr ! temporary variable for carbon turnover - real(r8):: ntovr ! temporary variable for nitrogen turnover - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - deadwdcn => pftcon%deadwdcn , & ! Input: dead wood (xylem and heartwood) C:N (gC/gN) - - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N - - livestemc_to_deadstemc => cnveg_carbonflux_inst%livestemc_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - livecrootc_to_deadcrootc => cnveg_carbonflux_inst%livecrootc_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - - livestemn_to_deadstemn => cnveg_nitrogenflux_inst%livestemn_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - livestemn_to_retransn => cnveg_nitrogenflux_inst%livestemn_to_retransn_patch , & ! Output: [real(r8) (:) ] - livecrootn_to_deadcrootn => cnveg_nitrogenflux_inst%livecrootn_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] - livecrootn_to_retransn => cnveg_nitrogenflux_inst%livecrootn_to_retransn_patch & ! Output: [real(r8) (:) ] - ) - - - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes for woody types - if (woody(ivt(p)) > 0._r8) then - - ! live stem to dead stem turnover - - ctovr = livestemc(p) * lwtop - ntovr = ctovr / livewdcn(ivt(p)) - livestemc_to_deadstemc(p) = ctovr - livestemn_to_deadstemn(p) = ctovr / deadwdcn(ivt(p)) - - if (CNratio_floating .eqv. .true.) then - if (livestemc(p) == 0.0_r8) then - ntovr = 0.0_r8 - else - ntovr = ctovr * (livestemn(p) / livestemc(p)) - end if - - livestemn_to_deadstemn(p) = 0.5_r8 * ntovr ! assuming 50% goes to deadstemn - end if - - livestemn_to_retransn(p) = ntovr - livestemn_to_deadstemn(p) - - ! live coarse root to dead coarse root turnover - - ctovr = livecrootc(p) * lwtop - ntovr = ctovr / livewdcn(ivt(p)) - livecrootc_to_deadcrootc(p) = ctovr - livecrootn_to_deadcrootn(p) = ctovr / deadwdcn(ivt(p)) - - if (CNratio_floating .eqv. .true.) then - if (livecrootc(p) == 0.0_r8) then - ntovr = 0.0_r8 - else - ntovr = ctovr * (livecrootn(p) / livecrootc(p)) - end if - - livecrootn_to_deadcrootn(p) = 0.5_r8 * ntovr ! assuming 50% goes to deadstemn - end if - - livecrootn_to_retransn(p) = ntovr - livecrootn_to_deadcrootn(p) - if(use_fun)then - !TURNED OFF FLUXES TO CORRECT N ACCUMULATION ISSUE. RF. Oct 2015. - livecrootn_to_retransn(p) = 0.0_r8 - livestemn_to_retransn(p) = 0.0_r8 - endif - - end if - - end do - - end associate - - end subroutine CNLivewoodTurnover - - !----------------------------------------------------------------------- - subroutine CNGrainToProductPools(bounds, num_soilp, filter_soilp, num_soilc, filter_soilc, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! If using prognostic crop along with use_grainproduct, then move the patch-level - ! grain-to-food fluxes into the column-level grain-to-cropprod fluxes - ! - ! !USES: - use clm_varctl , only : use_crop - use clm_varctl , only : use_grainproduct - use subgridAveMod , only : p2c - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fp, p - - character(len=*), parameter :: subname = 'CNGrainToProductPools' - !----------------------------------------------------------------------- - - ! Explicitly checking use_crop is probably unnecessary here (because presumably - ! use_grainproduct is only true if use_crop is true), but we do it for safety because - ! the grain*_to_food_patch fluxes are not set if use_crop is false. - if (use_crop .and. use_grainproduct) then - do fp = 1, num_soilp - p = filter_soilp(fp) - cnveg_carbonflux_inst%grainc_to_cropprodc_patch(p) = & - cnveg_carbonflux_inst%grainc_to_food_patch(p) - cnveg_nitrogenflux_inst%grainn_to_cropprodn_patch(p) = & - cnveg_nitrogenflux_inst%grainn_to_food_patch(p) - end do - - call p2c (bounds, num_soilc, filter_soilc, & - cnveg_carbonflux_inst%grainc_to_cropprodc_patch(bounds%begp:bounds%endp), & - cnveg_carbonflux_inst%grainc_to_cropprodc_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_soilc, filter_soilc, & - cnveg_nitrogenflux_inst%grainn_to_cropprodn_patch(bounds%begp:bounds%endp), & - cnveg_nitrogenflux_inst%grainn_to_cropprodn_col(bounds%begc:bounds%endc)) - end if - - ! No else clause: if use_grainproduct is false, then the grain*_to_cropprod fluxes - ! will remain at their initial value (0). - - end subroutine CNGrainToProductPools - - !----------------------------------------------------------------------- - subroutine CNLitterToColumn (bounds, num_soilc, filter_soilc, & - cnveg_state_inst,cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - leaf_prof_patch, froot_prof_patch) - ! - ! !DESCRIPTION: - ! called at the end of cn_phenology to gather all patch-level litterfall fluxes - ! to the column level and assign them to the three litter pools - ! - ! !USES: - use clm_varpar , only : max_patch_per_col, nlevdecomp - use pftconMod , only : npcropmin - use clm_varctl , only : use_grainproduct - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(cnveg_state_type) , intent(in) :: cnveg_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: leaf_prof_patch(bounds%begp:,1:) - real(r8) , intent(in) :: froot_prof_patch(bounds%begp:,1:) - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j ! indices - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(leaf_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(froot_prof_patch) == (/bounds%endp,nlevdecomp_full/)), errMsg(sourcefile, __LINE__)) - - associate( & - leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) for this patch (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction - - leafc_to_litter => cnveg_carbonflux_inst%leafc_to_litter_patch , & ! Input: [real(r8) (:) ] leaf C litterfall (gC/m2/s) - frootc_to_litter => cnveg_carbonflux_inst%frootc_to_litter_patch , & ! Input: [real(r8) (:) ] fine root N litterfall (gN/m2/s) - livestemc_to_litter => cnveg_carbonflux_inst%livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] live stem C litterfall (gC/m2/s) - grainc_to_food => cnveg_carbonflux_inst%grainc_to_food_patch , & ! Input: [real(r8) (:) ] grain C to food (gC/m2/s) - phenology_c_to_litr_met_c => cnveg_carbonflux_inst%phenology_c_to_litr_met_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s) - phenology_c_to_litr_cel_c => cnveg_carbonflux_inst%phenology_c_to_litr_cel_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s) - phenology_c_to_litr_lig_c => cnveg_carbonflux_inst%phenology_c_to_litr_lig_c_col , & ! Output: [real(r8) (:,:) ] C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s) - - livestemn_to_litter => cnveg_nitrogenflux_inst%livestemn_to_litter_patch , & ! Input: [real(r8) (:) ] livestem N to litter (gN/m2/s) - grainn_to_food => cnveg_nitrogenflux_inst%grainn_to_food_patch , & ! Input: [real(r8) (:) ] grain N to food (gN/m2/s) - leafn_to_litter => cnveg_nitrogenflux_inst%leafn_to_litter_patch , & ! Input: [real(r8) (:) ] leaf N litterfall (gN/m2/s) - frootn_to_litter => cnveg_nitrogenflux_inst%frootn_to_litter_patch , & ! Input: [real(r8) (:) ] fine root N litterfall (gN/m2/s) - phenology_n_to_litr_met_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_met_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) - phenology_n_to_litr_cel_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_cel_n_col , & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s) - phenology_n_to_litr_lig_n => cnveg_nitrogenflux_inst%phenology_n_to_litr_lig_n_col & ! Output: [real(r8) (:,:) ] N fluxes associated with phenology (litterfall and crop) to litter lignin pool (gN/m3/s) - ) - - do j = 1, nlevdecomp - do pi = 1,max_patch_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - - if ( pi <= col%npatches(c) ) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - - ! leaf litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! leaf litter nitrogen fluxes - phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) & - + leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) & - + leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) & - + leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! fine root litter nitrogen fluxes - phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) & - + frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) & - + frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) & - + frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! agroibis puts crop stem litter together with leaf litter - ! so I've used the leaf lf_f* parameters instead of making - ! new ones for now (slevis) - ! also for simplicity I've put "food" into the litter pools - - if (ivt(p) >= npcropmin) then ! add livestemc to litter - ! stem litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + livestemc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + livestemc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + livestemc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! stem litter nitrogen fluxes - phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) & - + livestemn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) & - + livestemn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) & - + livestemn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - if (.not. use_grainproduct) then - ! grain litter carbon fluxes - phenology_c_to_litr_met_c(c,j) = phenology_c_to_litr_met_c(c,j) & - + grainc_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_cel_c(c,j) = phenology_c_to_litr_cel_c(c,j) & - + grainc_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_c_to_litr_lig_c(c,j) = phenology_c_to_litr_lig_c(c,j) & - + grainc_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! grain litter nitrogen fluxes - phenology_n_to_litr_met_n(c,j) = phenology_n_to_litr_met_n(c,j) & - + grainn_to_food(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_cel_n(c,j) = phenology_n_to_litr_cel_n(c,j) & - + grainn_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - phenology_n_to_litr_lig_n(c,j) = phenology_n_to_litr_lig_n(c,j) & - + grainn_to_food(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - end if - - - end if - end if - end if - - end do - - end do - end do - - end associate - - end subroutine CNLitterToColumn - -end module CNPhenologyMod diff --git a/src/biogeochem/CNPrecisionControlMod.F90 b/src/biogeochem/CNPrecisionControlMod.F90 deleted file mode 100644 index 818e8eabca..0000000000 --- a/src/biogeochem/CNPrecisionControlMod.F90 +++ /dev/null @@ -1,615 +0,0 @@ -module CNPrecisionControlMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! controls on very low values in critical state variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use PatchType , only : patch - use abortutils , only : endrun - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: CNPrecisionControlReadNML - public:: CNPrecisionControl - - ! !PUBLIC DATA: - real(r8), public :: ccrit = 1.e-8_r8 ! critical carbon state value for truncation (gC/m2) - real(r8), public :: cnegcrit = -6.e+1_r8 ! critical negative carbon state value for abort (gC/m2) - real(r8), public :: ncrit = 1.e-8_r8 ! critical nitrogen state value for truncation (gN/m2) - real(r8), public :: nnegcrit = -6.e+0_r8 ! critical negative nitrogen state value for abort (gN/m2) - real(r8), public, parameter :: n_min = 0.000000001_r8 ! Minimum Nitrogen value to use when calculating CN ratio (gN/m2) - - ! !PRIVATE DATA: - logical, private :: prec_control_for_froot = .true. ! If true do precision control for frootc/frootn - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNPrecisionControlReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CN Precision control - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog, use_nguardrail - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNPrecisionControlReadNML' - character(len=*), parameter :: nmlname = 'cnprecision_inparm' - !----------------------------------------------------------------------- - namelist /cnprecision_inparm/ ncrit, ccrit, cnegcrit, nnegcrit - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cnprecision_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (ncrit , mpicom) - call shr_mpi_bcast (ccrit , mpicom) - call shr_mpi_bcast (nnegcrit, mpicom) - call shr_mpi_bcast (cnegcrit, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cnprecision_inparm) - write(iulog,*) ' ' - end if - - ! Have precision control for froot be determined by use_nguardrail setting - prec_control_for_froot = .not. use_nguardrail - - end subroutine CNPrecisionControlReadNML - - !----------------------------------------------------------------------- - subroutine CNPrecisionControl(bounds, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - cnveg_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Force leaf and deadstem c and n to 0 if they get too small. - ! - ! !USES: - use clm_varctl , only : iulog, use_c13, use_c14 - use clm_varpar , only : use_crop - use pftconMod , only : nc3crop - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_soilp ! number of soil patchs in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,j,k ! indices - integer :: fp ! filter indices - real(r8):: pc(bounds%begp:bounds%endp) ! truncation terms for patch-level corrections Carbon - real(r8):: pn(bounds%begp:bounds%endp) ! truncation terms for patch-level corrections nitrogen - real(r8):: pc13(bounds%begp:bounds%endp) ! truncation terms for patch-level corrections - real(r8):: pc14(bounds%begp:bounds%endp) ! truncation terms for patch-level corrections - !----------------------------------------------------------------------- - - ! cnveg_carbonstate_inst%cpool_patch Output: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool - ! cnveg_carbonstate_inst%deadcrootc_patch Output: [real(r8) (:) ] (gC/m2) dead coarse root C - ! cnveg_carbonstate_inst%deadcrootc_storage_patch Output: [real(r8) (:) ] (gC/m2) dead coarse root C storage - ! cnveg_carbonstate_inst%deadcrootc_xfer_patch Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - ! cnveg_carbonstate_inst%deadstemc_patch Output: [real(r8) (:) ] (gC/m2) dead stem C - ! cnveg_carbonstate_inst%deadstemc_storage_patch Output: [real(r8) (:) ] (gC/m2) dead stem C storage - ! cnveg_carbonstate_inst%deadstemc_xfer_patch Output: [real(r8) (:) ] (gC/m2) dead stem C transfer - ! cnveg_carbonstate_inst%frootc_patch Output: [real(r8) (:) ] (gC/m2) fine root C - ! cnveg_carbonstate_inst%frootc_storage_patch Output: [real(r8) (:) ] (gC/m2) fine root C storage - ! cnveg_carbonstate_inst%frootc_xfer_patch Output: [real(r8) (:) ] (gC/m2) fine root C transfer - ! cnveg_carbonstate_inst%gresp_storage_patch Output: [real(r8) (:) ] (gC/m2) growth respiration storage - ! cnveg_carbonstate_inst%gresp_xfer_patch Output: [real(r8) (:) ] (gC/m2) growth respiration transfer - ! cnveg_carbonstate_inst%leafc_patch Output: [real(r8) (:) ] (gC/m2) leaf C - ! cnveg_carbonstate_inst%leafc_storage_patch Output: [real(r8) (:) ] (gC/m2) leaf C storage - ! cnveg_carbonstate_inst%leafc_xfer_patch Output: [real(r8) (:) ] (gC/m2) leaf C transfer - ! cnveg_carbonstate_inst%livecrootc_patch Output: [real(r8) (:) ] (gC/m2) live coarse root C - ! cnveg_carbonstate_inst%livecrootc_storage_patch Output: [real(r8) (:) ] (gC/m2) live coarse root C storage - ! cnveg_carbonstate_inst%livecrootc_xfer_patch Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer - ! cnveg_carbonstate_inst%livestemc_patch Output: [real(r8) (:) ] (gC/m2) live stem C - ! cnveg_carbonstate_inst%livestemc_storage_patch Output: [real(r8) (:) ] (gC/m2) live stem C storage - ! cnveg_carbonstate_inst%livestemc_xfer_patch Output: [real(r8) (:) ] (gC/m2) live stem C transfer - ! cnveg_carbonstate_inst%ctrunc_patch Output: [real(r8) (:) ] (gC/m2) patch-level sink for C truncation - ! cnveg_carbonstate_inst%xsmrpool_patch Output: [real(r8) (:) ] (gC/m2) execss maint resp C pool - ! cnveg_carbonstate_inst%grainc_patch Output: [real(r8) (:) ] (gC/m2) grain C - ! cnveg_carbonstate_inst%grainc_storage_patch Output: [real(r8) (:) ] (gC/m2) grain C storage - ! cnveg_carbonstate_inst%grainc_xfer_patch Output: [real(r8) (:) ] (gC/m2) grain C transfer - - ! cnveg_nitrogenstate_inst%deadcrootn_patch Output: [real(r8) (:) ] (gN/m2) dead coarse root N - ! cnveg_nitrogenstate_inst%deadcrootn_storage_patch Output: [real(r8) (:) ] (gN/m2) dead coarse root N storage - ! cnveg_nitrogenstate_inst%deadcrootn_xfer_patch Output: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - ! cnveg_nitrogenstate_inst%deadstemn_patch Output: [real(r8) (:) ] (gN/m2) dead stem N - ! cnveg_nitrogenstate_inst%deadstemn_storage_patch Output: [real(r8) (:) ] (gN/m2) dead stem N storage - ! cnveg_nitrogenstate_inst%deadstemn_xfer_patch Output: [real(r8) (:) ] (gN/m2) dead stem N transfer - ! cnveg_nitrogenstate_inst%frootn_patch Output: [real(r8) (:) ] (gN/m2) fine root N - ! cnveg_nitrogenstate_inst%frootn_storage_patch Output: [real(r8) (:) ] (gN/m2) fine root N storage - ! cnveg_nitrogenstate_inst%frootn_xfer_patch Output: [real(r8) (:) ] (gN/m2) fine root N transfer - ! cnveg_nitrogenstate_inst%leafn_patch Output: [real(r8) (:) ] (gN/m2) leaf N - ! cnveg_nitrogenstate_inst%leafn_storage_patch Output: [real(r8) (:) ] (gN/m2) leaf N storage - ! cnveg_nitrogenstate_inst%leafn_xfer_patch Output: [real(r8) (:) ] (gN/m2) leaf N transfer - ! cnveg_nitrogenstate_inst%livecrootn_patch Output: [real(r8) (:) ] (gN/m2) live coarse root N - ! cnveg_nitrogenstate_inst%livecrootn_storage_patch Output: [real(r8) (:) ] (gN/m2) live coarse root N storage - ! cnveg_nitrogenstate_inst%livecrootn_xfer_patch Output: [real(r8) (:) ] (gN/m2) live coarse root N transfer - ! cnveg_nitrogenstate_inst%grainn_patch Output: [real(r8) (:) ] (gC/m2) grain N - ! cnveg_nitrogenstate_inst%grainn_storage_patch Output: [real(r8) (:) ] (gC/m2) grain N storage - ! cnveg_nitrogenstate_inst%grainn_xfer_patch Output: [real(r8) (:) ] (gC/m2) grain N transfer - ! cnveg_nitrogenstate_inst%livestemn_patch Output: [real(r8) (:) ] (gN/m2) live stem N - ! cnveg_nitrogenstate_inst%livestemn_storage_patch Output: [real(r8) (:) ] (gN/m2) live stem N storage - ! cnveg_nitrogenstate_inst%livestemn_xfer_patch Output: [real(r8) (:) ] (gN/m2) live stem N transfer - ! cnveg_nitrogenstate_inst%npool_patch Output: [real(r8) (:) ] (gN/m2) temporary plant N pool - ! cnveg_nitrogenstate_inst%ntrunc_patch Output: [real(r8) (:) ] (gN/m2) patch-level sink for N truncation - ! cnveg_nitrogenstate_inst%retransn_patch Output: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - - - associate( & - cs => cnveg_carbonstate_inst , & - ns => cnveg_nitrogenstate_inst , & - c13cs => c13_cnveg_carbonstate_inst , & - c14cs => c14_cnveg_carbonstate_inst & - ) - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! initialize the patch-level C and N truncation terms - pc(p) = 0._r8 - pn(p) = 0._r8 - if ( use_c13 ) pc13(p) = 0._r8 - if ( use_c14 ) pc14(p) = 0._r8 - end do - - ! do tests on state variables for precision control - ! for linked C-N state variables, perform precision test on - ! the C component, but truncate C, C13, and N components - - ! leaf C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_patch(bounds%begp:bounds%endp), & - ns%leafn_patch(bounds%begp:bounds%endp), & - pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%leafc_patch, c14=c14cs%leafc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! leaf storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_storage_patch(bounds%begp:bounds%endp), & - ns%leafn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%leafc_storage_patch, c14=c14cs%leafc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! leaf transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%leafc_xfer_patch(bounds%begp:bounds%endp), & - ns%leafn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%leafc_xfer_patch, c14=c14cs%leafc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! froot C and N - ! EBK KO DML: For some reason frootc/frootn can go negative and allowing - ! it to be negative is important for C4 crops (otherwise they die) Jun/3/2016 - if ( prec_control_for_froot ) then - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%frootc_patch(bounds%begp:bounds%endp), & - ns%frootn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%frootc_patch, c14=c14cs%frootc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), allowneg=.true. ) - end if - - ! froot storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%frootc_storage_patch(bounds%begp:bounds%endp), & - ns%frootn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%frootc_storage_patch, c14=c14cs%frootc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! froot transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%frootc_xfer_patch(bounds%begp:bounds%endp), & - ns%frootn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%frootc_xfer_patch, c14=c14cs%frootc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - if ( use_crop )then - ! grain C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%grainc_patch(bounds%begp:bounds%endp), & - ns%grainn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%grainc_patch, c14=c14cs%grainc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), croponly=.true. ) - - ! grain storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%grainc_storage_patch(bounds%begp:bounds%endp), & - ns%grainn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%grainc_storage_patch, c14=c14cs%grainc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), croponly=.true. ) - - ! grain transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%grainc_xfer_patch(bounds%begp:bounds%endp), & - ns%grainn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%grainc_xfer_patch, c14=c14cs%grainc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), croponly=.true. ) - - ! grain transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%cropseedc_deficit_patch(bounds%begp:bounds%endp), & - ns%cropseedn_deficit_patch(bounds%begp:bounds%endp), pc(bounds%begp:), & - pn(bounds%begp:), __LINE__, & - c13=c13cs%cropseedc_deficit_patch, c14=c14cs%cropseedc_deficit_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), allowneg=.true., croponly=.true. ) - - end if - - ! livestem C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livestemc_patch(bounds%begp:bounds%endp), & - ns%livestemn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%livestemc_patch, c14=c14cs%livestemc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! livestem storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livestemc_storage_patch(bounds%begp:bounds%endp), & - ns%livestemn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%livestemc_storage_patch, c14=c14cs%livestemc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! livestem transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livestemc_xfer_patch(bounds%begp:bounds%endp), & - ns%livestemn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%livestemc_xfer_patch, c14=c14cs%livestemc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! deadstem C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadstemc_patch(bounds%begp:bounds%endp), & - ns%deadstemn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%deadstemc_patch, c14=c14cs%deadstemc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - ! deadstem storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadstemc_storage_patch(bounds%begp:bounds%endp), & - ns%deadstemn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%deadstemc_storage_patch, c14=c14cs%deadstemc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! deadstem transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadstemc_xfer_patch(bounds%begp:bounds%endp), & - ns%deadstemn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%deadstemc_xfer_patch, c14=c14cs%deadstemc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! livecroot C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livecrootc_patch(bounds%begp:bounds%endp), & - ns%livecrootn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%livecrootc_patch, c14=c14cs%livecrootc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! livecroot storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livecrootc_storage_patch(bounds%begp:bounds%endp), & - ns%livecrootn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%livecrootc_storage_patch, c14=c14cs%livecrootc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! livecroot transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%livecrootc_xfer_patch(bounds%begp:bounds%endp), & - ns%livecrootn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%livecrootc_xfer_patch, c14=c14cs%livecrootc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! deadcroot C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadcrootc_patch(bounds%begp:bounds%endp), & - ns%deadcrootn_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), __LINE__, & - c13=c13cs%deadcrootc_patch, c14=c14cs%deadcrootc_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! deadcroot storage C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadcrootc_storage_patch(bounds%begp:bounds%endp), & - ns%deadcrootn_storage_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%deadcrootc_storage_patch, c14=c14cs%deadcrootc_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! deadcroot transfer C and N - call TruncateCandNStates( bounds, filter_soilp, num_soilp, cs%deadcrootc_xfer_patch(bounds%begp:bounds%endp), & - ns%deadcrootn_xfer_patch(bounds%begp:bounds%endp), pc(bounds%begp:), pn(bounds%begp:), & - __LINE__, c13=c13cs%deadcrootc_xfer_patch, c14=c14cs%deadcrootc_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! gresp_storage (C only) - call TruncateCStates( bounds, filter_soilp, num_soilp, cs%gresp_storage_patch(bounds%begp:bounds%endp), & - pc(bounds%begp:), __LINE__, & - c13=c13cs%gresp_storage_patch, c14=c14cs%gresp_storage_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! gresp_xfer(c only) - call TruncateCStates( bounds, filter_soilp, num_soilp, cs%gresp_xfer_patch(bounds%begp:bounds%endp), & - pc(bounds%begp:), __LINE__, & - c13=c13cs%gresp_xfer_patch, c14=c14cs%gresp_xfer_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - ! cpool (C only) - call TruncateCStates( bounds, filter_soilp, num_soilp, cs%cpool_patch(bounds%begp:bounds%endp), & - pc(bounds%begp:), __LINE__, & - c13=c13cs%cpool_patch, c14=c14cs%cpool_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:) ) - - if ( use_crop )then - ! xsmrpool (C only) - ! xsmr is a pool to balance the budget and as such can be freely negative - call TruncateCStates( bounds, filter_soilp, num_soilp, cs%xsmrpool_patch(bounds%begp:bounds%endp), & - pc(bounds%begp:), __LINE__, & - c13=c13cs%xsmrpool_patch, c14=c14cs%xsmrpool_patch, & - pc13=pc13(bounds%begp:), pc14=pc14(bounds%begp:), allowneg=.true., croponly=.true. ) - - end if - - ! retransn (N only) - call TruncateNStates( bounds, filter_soilp, num_soilp, ns%retransn_patch(bounds%begp:bounds%endp), pn(bounds%begp:), & - __LINE__ ) - - ! npool (N only) - call TruncateNStates( bounds, filter_soilp, num_soilp, ns%npool_patch(bounds%begp:bounds%endp), pn(bounds%begp:), & - __LINE__ ) - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - cs%ctrunc_patch(p) = cs%ctrunc_patch(p) + pc(p) - - ns%ntrunc_patch(p) = ns%ntrunc_patch(p) + pn(p) - - if ( use_c13 ) then - c13cs%ctrunc_patch(p) = c13cs%ctrunc_patch(p) + pc13(p) - endif - if ( use_c14 ) then - c14cs%ctrunc_patch(p) = c14cs%ctrunc_patch(p) + pc14(p) - endif - end do - - end associate - - end subroutine CNPrecisionControl - - subroutine TruncateCandNStates( bounds, filter_soilp, num_soilp, carbon_patch, nitrogen_patch, pc, pn, lineno, c13, c14, & - pc13, pc14, croponly, allowneg ) - ! - ! !DESCRIPTION: - ! Truncate paired Carbon and Nitrogen states. If a paired carbon and nitrogen state iare too small truncate - ! the pair of them to zero. - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - use clm_varctl , only : use_c13, use_c14, use_nguardrail - use clm_varctl , only : iulog - use pftconMod , only : nc3crop - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_soilp ! number of soil patchs in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - real(r8), intent(inout) :: carbon_patch(bounds%begp:) - real(r8), intent(inout) :: nitrogen_patch(bounds%begp:) - real(r8), intent(inout) :: pc(bounds%begp:) - real(r8), intent(inout) :: pn(bounds%begp:) - integer, intent(in) :: lineno - real(r8), intent(inout), optional, pointer :: c13(:) - real(r8), intent(inout), optional, pointer :: c14(:) - real(r8), intent(inout), optional :: pc13(bounds%begp:) - real(r8), intent(inout), optional :: pc14(bounds%begp:) - logical , intent(in) , optional :: croponly - logical , intent(in) , optional :: allowneg - - logical :: lcroponly, lallowneg - integer :: fp, p - - SHR_ASSERT_ALL((ubound(carbon_patch) == (/bounds%endp/)), 'ubnd(carb)'//errMsg(sourcefile, lineno)) - SHR_ASSERT_ALL((ubound(nitrogen_patch) == (/bounds%endp/)), 'ubnd(nitro)'//errMsg(sourcefile, lineno)) - SHR_ASSERT_ALL((ubound(pc) == (/bounds%endp/)), 'ubnd(pc)'//errMsg(sourcefile, lineno)) - SHR_ASSERT_ALL((ubound(pn) == (/bounds%endp/)), 'ubnd(pn)'//errMsg(sourcefile, lineno)) -#ifndef _OPENMP - if ( present(c13) .and. use_c13 )then - SHR_ASSERT_ALL((lbound(c13) == (/bounds%begp/)), 'lbnd(c13)'//errMsg(sourcefile, lineno)) - SHR_ASSERT_ALL((ubound(c13) == (/bounds%endp/)), 'ubnd(c13)'//errMsg(sourcefile, lineno)) - end if - if ( present(c14) .and. use_c14 )then - SHR_ASSERT_ALL((lbound(c14) == (/bounds%begp/)), 'lbnd(c14)'//errMsg(sourcefile, lineno)) - SHR_ASSERT_ALL((ubound(c14) == (/bounds%endp/)), 'ubnd(c14)'//errMsg(sourcefile, lineno)) - end if -#endif - if ( present(pc13) )then - SHR_ASSERT_ALL((ubound(pc13) == (/bounds%endp/)), 'ubnd(pc13)'//errMsg(sourcefile, lineno)) - end if - if ( present(pc14) )then - SHR_ASSERT_ALL((ubound(pc14) == (/bounds%endp/)), 'ubnd(pc14)'//errMsg(sourcefile, lineno)) - end if - ! patch loop - lcroponly = .false. - if ( present(croponly) )then - if ( croponly ) lcroponly = .true. - end if - lallowneg = .false. - if ( present(allowneg) )then - if ( allowneg ) lallowneg = .true. - end if - do fp = 1,num_soilp - p = filter_soilp(fp) - - if ( .not. lcroponly .or. (patch%itype(p) >= nc3crop) ) then - if ( .not. lallowneg .and. ((carbon_patch(p) < cnegcrit) .or. (nitrogen_patch(p) < nnegcrit)) ) then - write(iulog,*) 'ERROR: Carbon or Nitrogen patch negative = ', carbon_patch(p), nitrogen_patch(p) - write(iulog,*) 'ERROR: limits = ', cnegcrit, nnegcrit - call endrun(msg='ERROR: carbon or nitrogen state critically negative '//errMsg(sourcefile, lineno)) - else if ( abs(carbon_patch(p)) < ccrit .or. (use_nguardrail .and. abs(nitrogen_patch(p)) < ncrit) ) then - pc(p) = pc(p) + carbon_patch(p) - carbon_patch(p) = 0._r8 - - pn(p) = pn(p) + nitrogen_patch(p) - nitrogen_patch(p) = 0._r8 - - if ( use_c13 .and. present(c13) .and. present(pc13) ) then - pc13(p) = pc13(p) + c13(p) - c13(p) = 0._r8 - endif - if ( use_c14 .and. present(c14) .and. present(pc14)) then - pc14(p) = pc14(p) + c14(p) - c14(p) = 0._r8 - endif - end if - end if - end do - end subroutine TruncateCandNStates - - subroutine TruncateCStates( bounds, filter_soilp, num_soilp, carbon_patch, pc, lineno, c13, c14, pc13, pc14, croponly, allowneg ) - ! - ! !DESCRIPTION: - ! Truncate Carbon states. If a carbon state is too small truncate it to - ! zero. - ! - ! !USES: - use abortutils , only : endrun - use clm_varctl , only : iulog - use shr_log_mod, only : errMsg => shr_log_errMsg - use clm_varctl , only : use_c13, use_c14 - use pftconMod , only : nc3crop - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_soilp ! number of soil patchs in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - real(r8) , intent(inout) :: carbon_patch(bounds%begp:) - real(r8) , intent(inout) :: pc(bounds%begp:) - integer , intent(in) :: lineno - real(r8) , intent(inout), optional, pointer :: c13(:) - real(r8) , intent(inout), optional, pointer :: c14(:) - real(r8) , intent(inout), optional :: pc13(bounds%begp:) - real(r8) , intent(inout), optional :: pc14(bounds%begp:) - logical , intent(in) , optional :: croponly - logical , intent(in) , optional :: allowneg - - logical :: lcroponly, lallowneg - integer :: fp, p - - SHR_ASSERT_ALL((ubound(carbon_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(pc) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) -#ifndef _OPENMP - if ( present(c13) .and. use_c13 )then - SHR_ASSERT_ALL((lbound(c13) == (/bounds%begp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c13) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - if ( present(c14) .and. use_c14 )then - SHR_ASSERT_ALL((lbound(c14) == (/bounds%begp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c14) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if -#endif - if ( present(pc13) )then - SHR_ASSERT_ALL((ubound(pc13) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - if ( present(pc14) )then - SHR_ASSERT_ALL((ubound(pc14) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - if ( -ccrit < cnegcrit )then - call endrun(msg='ERROR: cnegcrit should be less than -ccrit: '//errMsg(sourcefile, lineno)) - end if - lcroponly = .false. - if ( present(croponly) )then - if ( croponly ) lcroponly = .true. - end if - lallowneg = .false. - if ( present(allowneg) )then - if ( allowneg ) lallowneg = .true. - end if - do fp = 1,num_soilp - p = filter_soilp(fp) - - if ( .not. lcroponly .or. (patch%itype(p) >= nc3crop) ) then - if ( .not. lallowneg .and. (carbon_patch(p) < cnegcrit) ) then - write(iulog,*) 'ERROR: Carbon patch negative = ', carbon_patch(p) - write(iulog,*) 'ERROR: limit = ', cnegcrit - call endrun(msg='ERROR: carbon state critically negative '//errMsg(sourcefile, lineno)) - else if ( abs(carbon_patch(p)) < ccrit) then - pc(p) = pc(p) + carbon_patch(p) - carbon_patch(p) = 0._r8 - - if ( use_c13 .and. present(c13) .and. present(pc13) ) then - pc13(p) = pc13(p) + c13(p) - c13(p) = 0._r8 - endif - if ( use_c14 .and. present(c14) .and. present(pc14)) then - pc14(p) = pc14(p) + c14(p) - c14(p) = 0._r8 - endif - end if - end if - end do - end subroutine TruncateCStates - - subroutine TruncateNStates( bounds, filter_soilp, num_soilp, nitrogen_patch, pn, lineno ) - ! - ! !DESCRIPTION: - ! Truncate Nitrogen states. If a nitrogen state is too small truncate it to - ! zero. - ! - ! !USES: - use abortutils , only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_soilp ! number of soil patchs in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - real(r8), intent(inout) :: nitrogen_patch(bounds%begp:) - real(r8), intent(inout) :: pn(bounds%begp:) - integer, intent(in) :: lineno - - integer :: fp, p - - SHR_ASSERT_ALL((ubound(nitrogen_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(pn) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - do fp = 1,num_soilp - p = filter_soilp(fp) - if ( nitrogen_patch(p) < nnegcrit ) then - !write(iulog,*) 'WARNING: Nitrogen patch negative = ', nitrogen_patch - !call endrun(msg='ERROR: nitrogen state critically negative'//errMsg(sourcefile, lineno)) - else if ( abs(nitrogen_patch(p)) < ncrit) then - pn(p) = pn(p) + nitrogen_patch(p) - nitrogen_patch(p) = 0._r8 - - end if - end do - end subroutine TruncateNStates - -end module CNPrecisionControlMod diff --git a/src/biogeochem/CNProductsMod.F90 b/src/biogeochem/CNProductsMod.F90 deleted file mode 100644 index 59891ba330..0000000000 --- a/src/biogeochem/CNProductsMod.F90 +++ /dev/null @@ -1,741 +0,0 @@ -module CNProductsMod - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate loss fluxes from wood products pools, and update product pool state variables - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_time_manager , only : get_step_size - use SpeciesBaseType , only : species_base_type - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC TYPES: - type, public :: cn_products_type - private - ! ------------------------------------------------------------------------ - ! Public instance variables - ! ------------------------------------------------------------------------ - - real(r8), pointer, public :: product_loss_grc(:) ! (g[C or N]/m2/s) total decomposition loss from ALL product pools - - ! ------------------------------------------------------------------------ - ! Private instance variables - ! ------------------------------------------------------------------------ - - class(species_base_type), allocatable :: species ! C, N, C13, C14, etc. - - ! States - real(r8), pointer :: cropprod1_grc(:) ! (g[C or N]/m2) grain product pool, 1-year lifespan - real(r8), pointer :: prod10_grc(:) ! (g[C or N]/m2) wood product pool, 10-year lifespan - real(r8), pointer :: prod100_grc(:) ! (g[C or N]/m2) wood product pool, 100-year lifespan - real(r8), pointer :: tot_woodprod_grc(:) ! (g[C or N]/m2) total wood product pool - - ! Fluxes: gains - real(r8), pointer :: dwt_prod10_gain_grc(:) ! (g[C or N]/m2/s) dynamic landcover addition to 10-year wood product pool - real(r8), pointer :: dwt_prod100_gain_grc(:) ! (g[C or N]/m2/s) dynamic landcover addition to 100-year wood product pool - real(r8), pointer :: dwt_woodprod_gain_grc(:) ! (g[C or N]/m2/s) dynamic landcover addition to wood product pools - real(r8), pointer :: dwt_cropprod1_gain_grc(:) ! (g[C or N]/m2/s) dynamic landcover addition to 1-year crop product pool - real(r8), pointer :: hrv_deadstem_to_prod10_patch(:) ! (g[C or N]/m2/s) dead stem harvest to 10-year wood product pool - real(r8), pointer :: hrv_deadstem_to_prod10_grc(:) ! (g[C or N]/m2/s) dead stem harvest to 10-year wood product pool - real(r8), pointer :: hrv_deadstem_to_prod100_patch(:) ! (g[C or N]/m2/s) dead stem harvest to 100-year wood product pool - real(r8), pointer :: hrv_deadstem_to_prod100_grc(:) ! (g[C or N]/m2/s) dead stem harvest to 100-year wood product pool - real(r8), pointer :: grain_to_cropprod1_patch(:) ! (g[C or N]/m2/s) grain to 1-year crop product pool - real(r8), pointer :: grain_to_cropprod1_grc(:) ! (g[C or N]/m2/s) grain to 1-year crop product pool - - ! Fluxes: losses - real(r8), pointer :: cropprod1_loss_grc(:) ! (g[C or N]/m2/s) decomposition loss from 1-yr grain product pool - real(r8), pointer :: prod10_loss_grc(:) ! (g[C or N]/m2/s) decomposition loss from 10-yr wood product pool - real(r8), pointer :: prod100_loss_grc(:) ! (g[C or N]/m2/s) decomposition loss from 100-yr wood product pool - real(r8), pointer :: tot_woodprod_loss_grc(:) ! (g[C or N]/m2/s) decompomposition loss from all wood product pools - - contains - - ! Infrastructure routines - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: Restart - - ! Science routines - procedure, public :: UpdateProducts - procedure, private :: PartitionWoodFluxes - procedure, private :: PartitionGrainFluxes - procedure, private :: ComputeSummaryVars - - end type cn_products_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds, species) - ! !ARGUMENTS: - class(cn_products_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - - ! species tells whether this object is being used for C, N, C13, C14, etc. This is - ! just used for naming history and restart fields - class(species_base_type), intent(in) :: species - - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - allocate(this%species, source = species) - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! !ARGUMENTS: - class(cn_products_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begg,endg - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - begg = bounds%begg - endg = bounds%endg - - allocate(this%cropprod1_grc(begg:endg)) ; this%cropprod1_grc(:) = nan - allocate(this%prod10_grc(begg:endg)) ; this%prod10_grc(:) = nan - allocate(this%prod100_grc(begg:endg)) ; this%prod100_grc(:) = nan - allocate(this%tot_woodprod_grc(begg:endg)) ; this%tot_woodprod_grc(:) = nan - - allocate(this%dwt_prod10_gain_grc(begg:endg)) ; this%dwt_prod10_gain_grc(:) = nan - allocate(this%dwt_prod100_gain_grc(begg:endg)) ; this%dwt_prod100_gain_grc(:) = nan - allocate(this%dwt_woodprod_gain_grc(begg:endg)) ; this%dwt_woodprod_gain_grc(:) = nan - - allocate(this%dwt_cropprod1_gain_grc(begg:endg)) ; this%dwt_cropprod1_gain_grc(:) = nan - - allocate(this%hrv_deadstem_to_prod10_patch(begp:endp)) ; this%hrv_deadstem_to_prod10_patch(:) = nan - allocate(this%hrv_deadstem_to_prod10_grc(begg:endg)) ; this%hrv_deadstem_to_prod10_grc(:) = nan - - allocate(this%hrv_deadstem_to_prod100_patch(begp:endp)) ; this%hrv_deadstem_to_prod100_patch(:) = nan - allocate(this%hrv_deadstem_to_prod100_grc(begg:endg)) ; this%hrv_deadstem_to_prod100_grc(:) = nan - - allocate(this%grain_to_cropprod1_patch(begp:endp)) ; this%grain_to_cropprod1_patch(:) = nan - allocate(this%grain_to_cropprod1_grc(begg:endg)) ; this%grain_to_cropprod1_grc(:) = nan - - allocate(this%cropprod1_loss_grc(begg:endg)) ; this%cropprod1_loss_grc(:) = nan - allocate(this%prod10_loss_grc(begg:endg)) ; this%prod10_loss_grc(:) = nan - allocate(this%prod100_loss_grc(begg:endg)) ; this%prod100_loss_grc(:) = nan - allocate(this%tot_woodprod_loss_grc(begg:endg)) ; this%tot_woodprod_loss_grc(:) = nan - allocate(this%product_loss_grc(begg:endg)) ; this%product_loss_grc(:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! !USES: - use histFileMod, only : hist_addfld1d - use clm_varcon , only : spval - ! - ! !ARGUMENTS: - class(cn_products_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begg,endg - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begg = bounds%begg - endg = bounds%endg - - this%cropprod1_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('CROPPROD1'), & - units = 'g' // this%species%get_species() // '/m^2', & - avgflag = 'A', & - long_name = '1-yr grain product ' // this%species%get_species(), & - ptr_gcell = this%cropprod1_grc) - - this%prod10_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('PROD10'), & - units = 'g' // this%species%get_species() // '/m^2', & - avgflag = 'A', & - long_name = '10-yr wood product ' // this%species%get_species(), & - ptr_gcell = this%prod10_grc, default='inactive') - - this%prod100_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('PROD100'), & - units = 'g' // this%species%get_species() // '/m^2', & - avgflag = 'A', & - long_name = '100-yr wood product ' // this%species%get_species(), & - ptr_gcell = this%prod100_grc, default='inactive') - - this%tot_woodprod_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('TOT_WOODPROD'), & - units = 'g' // this%species%get_species() // '/m^2', & - avgflag = 'A', & - long_name = 'total wood product ' // this%species%get_species(), & - ptr_gcell = this%tot_woodprod_grc) - - this%dwt_prod10_gain_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('DWT_PROD10', suffix='_GAIN'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'landcover change-driven addition to 10-yr wood product pool', & - ptr_gcell = this%dwt_prod10_gain_grc, default='inactive') - - this%dwt_prod100_gain_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('DWT_PROD100', suffix='_GAIN'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'landcover change-driven addition to 100-yr wood product pool', & - ptr_gcell = this%dwt_prod100_gain_grc, default='inactive') - - this%dwt_woodprod_gain_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('DWT_WOODPROD', suffix='_GAIN'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'landcover change-driven addition to wood product pools', & - ptr_gcell = this%dwt_woodprod_gain_grc) - - this%dwt_cropprod1_gain_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('DWT_CROPPROD1', suffix='_GAIN'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'landcover change-driven addition to 1-year crop product pool', & - ptr_gcell = this%dwt_cropprod1_gain_grc) - - this%cropprod1_loss_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('CROPPROD1', suffix='_LOSS'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'loss from 1-yr grain product pool', & - ptr_gcell = this%cropprod1_loss_grc) - - this%prod10_loss_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('PROD10', suffix='_LOSS'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'loss from 10-yr wood product pool', & - ptr_gcell = this%prod10_loss_grc, default='inactive') - - this%prod100_loss_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('PROD100', suffix='_LOSS'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'loss from 100-yr wood product pool', & - ptr_gcell = this%prod100_loss_grc, default='inactive') - - this%tot_woodprod_loss_grc(begg:endg) = spval - call hist_addfld1d( & - fname = this%species%hist_fname('TOT_WOODPROD', suffix='_LOSS'), & - units = 'g' // this%species%get_species() // '/m^2/s', & - avgflag = 'A', & - long_name = 'total loss from wood product pools', & - ptr_gcell = this%tot_woodprod_loss_grc) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! !ARGUMENTS: - class(cn_products_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, p - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - this%cropprod1_grc(g) = 0._r8 - this%prod10_grc(g) = 0._r8 - this%prod100_grc(g) = 0._r8 - this%tot_woodprod_grc(g) = 0._r8 - end do - - ! Need to set these patch-level fluxes to 0 everywhere for the sake of special - ! landunits (because they don't get set over special landunits in the run loop) - do p = bounds%begp, bounds%endp - this%hrv_deadstem_to_prod10_patch(p) = 0._r8 - this%hrv_deadstem_to_prod100_patch(p) = 0._r8 - this%grain_to_cropprod1_patch(p) = 0._r8 - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag, & - template_for_missing_fields, template_multiplier) - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_double - use restUtilMod, only : restartvar, set_missing_from_template, set_grc_field_from_col_field - ! - ! !ARGUMENTS: - class(cn_products_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*), intent(in) :: flag ! 'read' or 'write' - - ! If template_for_missing_fields and template_multiplier are provided, then: When - ! reading the restart file, for any field not present on the restart file, the field - ! in this object is set equal to the corresponding field in - ! template_for_missing_fields times template_multiplier. - ! - ! The Restart routine must have been called on template_for_missing_fields before - ! calling it on this object. - ! - ! (Must provide both template_for_missing_fields and template_multiplier or neither) - class(cn_products_type), optional, intent(in) :: template_for_missing_fields - real(r8), optional, intent(in) :: template_multiplier - - ! - ! !LOCAL VARIABLES: - logical :: template_provided - logical :: readvar - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - if (present(template_for_missing_fields) .and. present(template_multiplier)) then - template_provided = .true. - else if (present(template_for_missing_fields)) then - call endrun(& - msg='template_for_missing_fields provided; must also provide template_multiplier' // & - errMsg(sourcefile, __LINE__)) - else if (present(template_multiplier)) then - call endrun(& - msg='template_multiplier provided; must also provide template_for_missing_fields' // & - errMsg(sourcefile, __LINE__)) - else - template_provided = .false. - end if - - ! NOTE(wjs, 2016-03-29) Adding '_g' suffixes to the end of the restart field names to - ! distinguish these gridcell-level restart fields from the obsolete column-level - ! restart fields that are present on old restart files. - - call restartvar(ncid=ncid, flag=flag, & - varname=this%species%rest_fname('cropprod1', suffix='_g'), & - xtype=ncd_double, dim1name='gridcell', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%cropprod1_grc) - if (flag == 'read' .and. .not. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2016-03-31) If the gridcell-level field isn't - ! present, try to find a column-level field (which may be present on an older - ! restart file). - call set_grc_field_from_col_field( & - bounds = bounds, & - ncid = ncid, & - varname = this%species%rest_fname('cropprod1'), & - data_grc = this%cropprod1_grc, & - readvar = readvar) - - ! If we still haven't found an appropriate field on the restart file, then set - ! this field from the template, if provided - if (.not. readvar .and. template_provided) then - call set_missing_from_template(this%cropprod1_grc, & - template_for_missing_fields%cropprod1_grc, & - multiplier = template_multiplier) - end if - end if - - call restartvar(ncid=ncid, flag=flag, & - varname=this%species%rest_fname('prod10', suffix='_g'), & - xtype=ncd_double, dim1name='gridcell', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%prod10_grc) - if (flag == 'read' .and. .not. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2016-03-31) If the gridcell-level field isn't - ! present, try to find a column-level field (which may be present on an older - ! restart file). - call set_grc_field_from_col_field( & - bounds = bounds, & - ncid = ncid, & - varname = this%species%rest_fname('prod10'), & - data_grc = this%prod10_grc, & - readvar = readvar) - - ! If we still haven't found an appropriate field on the restart file, then set - ! this field from the template, if provided - if (.not. readvar .and. template_provided) then - call set_missing_from_template(this%prod10_grc, & - template_for_missing_fields%prod10_grc, & - multiplier = template_multiplier) - end if - end if - - call restartvar(ncid=ncid, flag=flag, & - varname=this%species%rest_fname('prod100', suffix='_g'), & - xtype=ncd_double, dim1name='gridcell', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%prod100_grc) - if (flag == 'read' .and. .not. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2016-03-31) If the gridcell-level field isn't - ! present, try to find a column-level field (which may be present on an older - ! restart file). - call set_grc_field_from_col_field( & - bounds = bounds, & - ncid = ncid, & - varname = this%species%rest_fname('prod100'), & - data_grc = this%prod100_grc, & - readvar = readvar) - - ! If we still haven't found an appropriate field on the restart file, then set - ! this field from the template, if provided - if (.not. readvar .and. template_provided) then - call set_missing_from_template(this%prod100_grc, & - template_for_missing_fields%prod100_grc, & - multiplier = template_multiplier) - end if - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine UpdateProducts(this, bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch, & - wood_harvest_patch, & - dwt_crop_product_gain_patch, & - grain_to_cropprod_patch) - ! - ! !DESCRIPTION: - ! Update all loss fluxes from wood and grain product pools, and update product pool - ! state variables for both loss and gain terms - ! - ! !ARGUMENTS: - class(cn_products_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - - ! dynamic landcover addition to wood product pools (g/m2/s) [patch]; although this is - ! a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), intent(in) :: dwt_wood_product_gain_patch( bounds%begp: ) - - ! wood harvest addition to wood product pools (g/m2/s) [patch] - real(r8), intent(in) :: wood_harvest_patch( bounds%begp: ) - - ! dynamic landcover addition to crop product pools (g/m2/s) [patch]; although this is - ! a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), intent(in) :: dwt_crop_product_gain_patch( bounds%begp: ) - - ! grain to crop product pool (g/m2/s) [patch] - real(r8), intent(in) :: grain_to_cropprod_patch( bounds%begp: ) - ! - ! !LOCAL VARIABLES: - integer :: g ! indices - real(r8) :: dt ! time step (seconds) - real(r8) :: kprod1 ! decay constant for 1-year product pool - real(r8) :: kprod10 ! decay constant for 10-year product pool - real(r8) :: kprod100 ! decay constant for 100-year product pool - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(dwt_wood_product_gain_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wood_harvest_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_crop_product_gain_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(grain_to_cropprod_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - call this%PartitionWoodFluxes(bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch(bounds%begp:bounds%endp), & - wood_harvest_patch(bounds%begp:bounds%endp)) - - call this%PartitionGrainFluxes(bounds, & - num_soilp, filter_soilp, & - dwt_crop_product_gain_patch(bounds%begp:bounds%endp), & - grain_to_cropprod_patch(bounds%begp:bounds%endp)) - - ! calculate losses from product pools - ! the following (1/s) rate constants result in ~90% loss of initial state over 1, 10 and 100 years, - ! respectively, using a discrete-time fractional decay algorithm. - kprod1 = 7.2e-8 - kprod10 = 7.2e-9 - kprod100 = 7.2e-10 - - do g = bounds%begg, bounds%endg - ! calculate fluxes out of product pools (1/sec) - this%cropprod1_loss_grc(g) = this%cropprod1_grc(g) * kprod1 - this%prod10_loss_grc(g) = this%prod10_grc(g) * kprod10 - this%prod100_loss_grc(g) = this%prod100_grc(g) * kprod100 - end do - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! update product state variables - do g = bounds%begg, bounds%endg - - ! fluxes into wood & grain product pools, from landcover change - this%cropprod1_grc(g) = this%cropprod1_grc(g) + this%dwt_cropprod1_gain_grc(g)*dt - this%prod10_grc(g) = this%prod10_grc(g) + this%dwt_prod10_gain_grc(g)*dt - this%prod100_grc(g) = this%prod100_grc(g) + this%dwt_prod100_gain_grc(g)*dt - - ! fluxes into wood & grain product pools, from harvest - this%cropprod1_grc(g) = this%cropprod1_grc(g) + this%grain_to_cropprod1_grc(g)*dt - this%prod10_grc(g) = this%prod10_grc(g) + this%hrv_deadstem_to_prod10_grc(g)*dt - this%prod100_grc(g) = this%prod100_grc(g) + this%hrv_deadstem_to_prod100_grc(g)*dt - - ! fluxes out of wood & grain product pools, from decomposition - this%cropprod1_grc(g) = this%cropprod1_grc(g) - this%cropprod1_loss_grc(g)*dt - this%prod10_grc(g) = this%prod10_grc(g) - this%prod10_loss_grc(g)*dt - this%prod100_grc(g) = this%prod100_grc(g) - this%prod100_loss_grc(g)*dt - - end do - - call this%ComputeSummaryVars(bounds) - - end subroutine UpdateProducts - - !----------------------------------------------------------------------- - subroutine PartitionWoodFluxes(this, bounds, & - num_soilp, filter_soilp, & - dwt_wood_product_gain_patch, & - wood_harvest_patch) - ! - ! !DESCRIPTION: - ! Partition input wood fluxes into 10 and 100 year product pools - ! - ! !USES: - use pftconMod , only : pftcon - use subgridAveMod, only : p2g - ! - ! !ARGUMENTS: - class(cn_products_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - - ! dynamic landcover addition to wood product pools (g/m2/s) [patch]; although this is - ! a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), intent(in) :: dwt_wood_product_gain_patch( bounds%begp: ) - - ! wood harvest addition to wood product pools (g/m2/s) [patch] - real(r8), intent(in) :: wood_harvest_patch( bounds%begp: ) - - ! - ! !LOCAL VARIABLES: - integer :: fp - integer :: p - integer :: g - real(r8) :: pprod10 ! PFT proportion of deadstem to 10-year product pool - real(r8) :: pprod100 ! PFT proportion of deadstem to 100-year product pool - real(r8) :: pprod_tot ! PFT proportion of deadstem to any product pool - real(r8) :: pprod10_frac ! PFT fraction of deadstem to product pool that goes to 10-year product pool - real(r8) :: pprod100_frac ! PFT fraction of deadstem to product pool that goes to 100-year product pool - - character(len=*), parameter :: subname = 'PartitionWoodFluxes' - !----------------------------------------------------------------------- - - ! Partition patch-level harvest fluxes to 10 and 100-year product pools - do fp = 1, num_soilp - p = filter_soilp(fp) - this%hrv_deadstem_to_prod10_patch(p) = & - wood_harvest_patch(p) * pftcon%pprodharv10(patch%itype(p)) - this%hrv_deadstem_to_prod100_patch(p) = & - wood_harvest_patch(p) * (1.0_r8 - pftcon%pprodharv10(patch%itype(p))) - end do - - ! Average harvest fluxes from patch to gridcell - call p2g(bounds, & - this%hrv_deadstem_to_prod10_patch(bounds%begp:bounds%endp), & - this%hrv_deadstem_to_prod10_grc(bounds%begg:bounds%endg), & - p2c_scale_type = 'unity', & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - call p2g(bounds, & - this%hrv_deadstem_to_prod100_patch(bounds%begp:bounds%endp), & - this%hrv_deadstem_to_prod100_grc(bounds%begg:bounds%endg), & - p2c_scale_type = 'unity', & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - ! Zero the dwt gains - do g = bounds%begg, bounds%endg - this%dwt_prod10_gain_grc(g) = 0._r8 - this%dwt_prod100_gain_grc(g) = 0._r8 - end do - - ! Partition dynamic land cover fluxes to 10 and 100-year product pools. - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - - ! Note that pprod10 + pprod100 do NOT sum to 1: some fraction of the dwt changes - ! was lost to other fluxes. dwt_wood_product_gain_patch gives the amount that goes - ! to all product pools, so we need to determine the fraction of that flux that - ! goes to each pool. - pprod10 = pftcon%pprod10(patch%itype(p)) - pprod100 = pftcon%pprod100(patch%itype(p)) - pprod_tot = pprod10 + pprod100 - if (pprod_tot > 0) then - pprod10_frac = pprod10 / pprod_tot - pprod100_frac = pprod100 / pprod_tot - else - ! Avoid divide by 0 - pprod10_frac = 0._r8 - pprod100_frac = 0._r8 - end if - - ! Note that the patch-level fluxes are expressed per unit gridcell area. So, to go - ! from patch-level fluxes to gridcell-level fluxes, we simply add up the various - ! patch contributions, without having to multiply by any area weightings. - this%dwt_prod10_gain_grc(g) = this%dwt_prod10_gain_grc(g) + & - dwt_wood_product_gain_patch(p) * pprod10_frac - this%dwt_prod100_gain_grc(g) = this%dwt_prod100_gain_grc(g) + & - dwt_wood_product_gain_patch(p) * pprod100_frac - end do - - end subroutine PartitionWoodFluxes - - !----------------------------------------------------------------------- - subroutine PartitionGrainFluxes(this, bounds, & - num_soilp, filter_soilp, & - dwt_crop_product_gain_patch, & - grain_to_cropprod_patch) - ! - ! !DESCRIPTION: - ! Partition input grain fluxes into crop product pools - ! - ! For now this doesn't do much, since there is just a single (1-year) crop product - ! pool. But this provides the capability to add different crop product pools in the - ! future, without requiring any changes to code outside of this class. It also gives - ! symmetry with the wood fluxes. - ! - ! !USES: - use subgridAveMod, only : p2g - ! - ! !ARGUMENTS: - class(cn_products_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - - ! dynamic landcover addition to crop product pool (g/m2/s) [patch]; although this is - ! a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), intent(in) :: dwt_crop_product_gain_patch( bounds%begp: ) - - ! grain to crop product pool(s) (g/m2/s) [patch] - real(r8) , intent(in) :: grain_to_cropprod_patch( bounds%begp: ) - ! - ! !LOCAL VARIABLES: - integer :: fp - integer :: p - integer :: g - - character(len=*), parameter :: subname = 'PartitionGrainFluxes' - !----------------------------------------------------------------------- - - ! Determine gains from crop harvest - - do fp = 1, num_soilp - p = filter_soilp(fp) - - ! For now all crop product is put in the 1-year crop product pool - this%grain_to_cropprod1_patch(p) = grain_to_cropprod_patch(p) - end do - - call p2g(bounds, & - this%grain_to_cropprod1_patch(bounds%begp:bounds%endp), & - this%grain_to_cropprod1_grc(bounds%begg:bounds%endg), & - p2c_scale_type = 'unity', & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - ! Determine gains from dynamic landcover - - do g = bounds%begg, bounds%endg - this%dwt_cropprod1_gain_grc(g) = 0._r8 - end do - - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - - ! Note that the patch-level fluxes are expressed per unit gridcell area. So, to go - ! from patch-level fluxes to gridcell-level fluxes, we simply add up the various - ! patch contributions, without having to multiply by any area weightings. - this%dwt_cropprod1_gain_grc(g) = this%dwt_cropprod1_gain_grc(g) + & - dwt_crop_product_gain_patch(p) - end do - - end subroutine PartitionGrainFluxes - - - !----------------------------------------------------------------------- - subroutine ComputeSummaryVars(this, bounds) - ! - ! !DESCRIPTION: - ! Compute summary variables in this object: sums across multiple product pools - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_products_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g ! indices - - character(len=*), parameter :: subname = 'ComputeSummaryVars' - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - - ! total wood products - this%tot_woodprod_grc(g) = & - this%prod10_grc(g) + & - this%prod100_grc(g) - - ! total loss from wood products - this%tot_woodprod_loss_grc(g) = & - this%prod10_loss_grc(g) + & - this%prod100_loss_grc(g) - - ! total loss from ALL products - this%product_loss_grc(g) = & - this%cropprod1_loss_grc(g) + & - this%prod10_loss_grc(g) + & - this%prod100_loss_grc(g) - - this%dwt_woodprod_gain_grc(g) = & - this%dwt_prod100_gain_grc(g) + & - this%dwt_prod10_gain_grc(g) - end do - - end subroutine ComputeSummaryVars - - -end module CNProductsMod diff --git a/src/biogeochem/CNRootDynMod.F90 b/src/biogeochem/CNRootDynMod.F90 deleted file mode 100644 index b6ac830905..0000000000 --- a/src/biogeochem/CNRootDynMod.F90 +++ /dev/null @@ -1,277 +0,0 @@ -module CNRootDynMod - -!----------------------------------------------------------------------- -! !DESCRIPTION: -! Module holding routines used for determining fine root distribution for all pfts. -! Includes dynamic root depth for crops -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd - use clm_varctl , only : use_vertsoilc, use_bedrock - use decompMod , only : bounds_type - use pftconMod , only : noveg, npcropmin, pftcon - use ColumnType , only : col - use PatchType , only : patch - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use SoilStateType , only : soilstate_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use CropType , only : crop_type - -! !PUBLIC TYPES: - implicit none - save - private - public :: CNRootDyn -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -! -subroutine CNRootDyn(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, & - cnveg_state_inst, crop_inst, soilstate_inst, soilbiogeochem_nitrogenstate_inst) -! -! !DESCRIPTION: -! This routine determine the fine root distribution -! Needs to be called after the photosynthesis calculation -! May need to update other subroutines that use the fixed root profile for calculations -! i.e. CNVerticalProfileMod -! -! !USES: - - -! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer, intent(in) :: num_soilc - integer, intent(in) :: filter_soilc(:) - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - type(cnveg_state_type) , intent(in) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(crop_type) , intent(in) :: crop_inst - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - -! -! !LOCAL VARIABLES: - - integer :: f,c,p,lev,j ! indices - real(r8):: dt ! radiation time step delta t (seconds) - real(r8), allocatable :: w_limit(:) - real(r8), allocatable :: rswa(:,:) ! soil water availability in each soil layer - real(r8), allocatable :: rsmn(:,:) ! soil nitrogen availability in each soil layer - real(r8), allocatable :: sumrswa(:) ! scaling soil water availability in each soil layer - real(r8), allocatable :: sumrsmn(:) ! scaling soil mineral N availability in each soil layer - real(r8) :: frootc_dz(bounds%begp:bounds%endp, 1:nlevgrnd) - real(r8), allocatable :: sumfrootc(:) ! fine root carbon total before turnover in each step - real(r8):: minpsi ! minimum soil moisture potential - real(r8):: psi - real(r8):: maxpsi - real(r8):: new_growth - -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - associate(& - ivt => patch%itype , & ! Input: [integer (:)] pft vegetation type - pcolumn => patch%column , & ! Input: [integer (:)] pft's column index - roota_par => pftcon%roota_par , & ! Input: [real(r8) (:)] pft's roota index - rootb_par => pftcon%rootb_par , & ! Input: [real(r8) (:)] pft's rootb index - root_dmx => pftcon%root_dmx , & ! Input: [real(r8) (:)] crop maximum root depth - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Input: [real(r8) (:)] allocation to fine root C (gC/m2/s) - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Input: [real(r8) (:)] fine root C growth from storage (gC/m2/s) - dormant_flag => cnveg_state_inst%dormant_flag_patch , & ! Input: [real(r8) (:)] dormancy flag - root_depth => soilstate_inst%root_depth_patch , & ! InOut: [real(r8) (:)] current root depth - dz => col%dz , & ! Input: layer thickness (m) (-nlevsno+1:nlevgrnd) - zi => col%zi , & ! Input: interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) - rootfr => soilstate_inst%rootfr_patch , & ! Output: [real(r8) (:,:)] fraction of roots in each soil layer - sucsat => soilstate_inst%sucsat_col , & ! Input: minimum soil suction (mm) - soilpsi => soilstate_inst%soilpsi_col , & ! Input: soil water potential in each soil layer (MPa) - sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Iniput: [real(r8) (:,:)] (gN/m3) soil mineral N - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C - hui => crop_inst%gddplant_patch , & ! Input: [real(r8) (:)] =gdd since planting (gddplant) - croplive => crop_inst%croplive_patch , & ! Input: [logical (:)] flag, true if planted, not harvested - huigrain => cnveg_state_inst%huigrain_patch & ! Input: [real(r8) (:)] same to reach vegetative maturity - ) - -! set time steps - dt = get_step_size() - -! set minpsi to permanent wilting point - minpsi = -1.5_r8 - - allocate(sumrswa(bounds%begp:bounds%endp)) - allocate(sumrsmn(bounds%begp:bounds%endp)) - allocate(sumfrootc(bounds%begp:bounds%endp)) - allocate(rswa(bounds%begp:bounds%endp,nlevgrnd)) - allocate(rsmn(bounds%begp:bounds%endp,nlevgrnd)) - allocate(w_limit(bounds%begp:bounds%endp)) - -!initialize to 0 - w_limit(bounds%begp:bounds%endp) = 0._r8 - sumrswa(bounds%begp:bounds%endp) = 0._r8 - sumrsmn(bounds%begp:bounds%endp) = 0._r8 - sumfrootc(bounds%begp:bounds%endp) = 0._r8 - rswa(bounds%begp:bounds%endp,:) = 0._r8 - rsmn(bounds%begp:bounds%endp,:) = 0._r8 - - frootc_dz(bounds%begp:bounds%endp,1:nlevgrnd) = 0._r8 - - -!--------------------------------------------------------------- -! Set root depth, dynamic for crops, fixed for other vegetation -!--------------------------------------------------------------- - - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - if (ivt(p) /= noveg) then - if((ivt(p)) >= npcropmin)then !skip generic crop types - if(huigrain(p) > 0._r8)then - root_depth(p) = max(zi(c,2), min(hui(p)/huigrain(p)* root_dmx(ivt(p)), root_dmx(ivt(p)))) - end if - else - ! this can be changed to any depth (i.e. the maximum soil depth) - root_depth(p) = zi(c,nlevsoi) - end if - if (use_bedrock) then - root_depth(p) = min(root_depth(p),zi(c,col%nbedrock(c))) - end if - else - root_depth(p) = 0._r8 - end if - end do - -!---------------------------------------------------------------- -! ! calculate a weighting function by soil depth that depends on the - ! fine root distribution per pft and depth and the pft weight on the column. - ! This will be used to weight the temperature and water potential scalars - ! for decomposition control. - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlevsoi - do f = 1,num_soilp - p = filter_soilp(f) - c = pcolumn(p) - maxpsi = sucsat(c,j) * (-9.8e-6_r8) - psi = min(soilpsi(c,j),maxpsi) - if (psi > minpsi) then -! First calculate water in the root zone - if(root_depth(p) > 0.15_r8 .and. (zi(c,j) <= root_depth(p) .or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p)))) then - w_limit(p) = w_limit(p) + max(0._r8,log(minpsi/psi)/log(minpsi/maxpsi))*rootfr(p,j) - end if -! Calculate the water in each soil layer - if (root_depth(p) >= zi(c,j) .or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p))) then - rswa(p,j) = max(0._r8, (log(minpsi/psi)/log(minpsi/maxpsi))) - end if - end if - sumrswa(p) = sumrswa(p) + rswa(p,j) - -! Calculate the nitrogen profile in each layer -! For now, the profile for each PFT is equivilent to the -! column profile, in the future, this could be changed to a weighted profile - if(use_vertsoilc) then !for vertical soil profile - rsmn(p,j) = sminn_vr(c,j) - else ! need to calculate a profile, top 0.2m are constant, and decrease linearly - if(zi(c,j) <= 0.2_r8)then - rsmn(p,j) = dz(c,j) - end if - if(zi(c,j) > 0.2_r8)then - rsmn(p,j) = dz(c,j) * (zi(c,nlevsoi) - zi(c,j)) / (zi(c,nlevsoi) - 0.2_r8) - end if - end if - if (root_depth(p) >= zi(c,j).or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p))) then - sumrsmn(p) = sumrsmn(p) + rsmn(p,j) - end if - end do - end do - - -!-------------------------------------------------------------------- -! Now calculate the density of roots in each soil layer for each pft -! based on this timesteps growth -!-------------------------------------------------------------------- - do lev = 1, nlevgrnd - - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - - new_growth = (cpool_to_frootc(p) + frootc_xfer_to_frootc(p))*dt - if(zi(c,lev) <= root_depth(p) .or. & - (zi(c,lev-1) < root_depth(p) .and. zi(c,lev) > root_depth(p))) then - if(sumrswa(p) <= 0._r8 .or. sumrsmn(p) <= 0._r8) then -! when sumrswa or sumrsmn are less than or equal to 0 rootfr will not be updated - else - frootc_dz(p,lev) = (frootc(p))*rootfr(p,lev) & - + new_growth * ((1._r8 - w_limit(p)) * rswa(p,lev) / sumrswa(p) & - + w_limit(p) * rsmn(p,lev) / sumrsmn(p)) - end if - else - frootc_dz(p,lev) = 0._r8 - end if - - sumfrootc(p) = sumfrootc(p) + frootc_dz(p,lev) - - end do - end do -!---------------------------------- -!Calculate root fraction -!---------------------------------- - - do lev = 1, nlevgrnd - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - if(sumfrootc(p) > 0._r8)then - rootfr(p,lev) = frootc_dz(p,lev)/sumfrootc(p) - end if - if(ivt(p) >= npcropmin .and. .not. croplive(p))then -! CROPS are dormant, there are no roots! -! but, need an initial frootr so crops can start root production - if (lev < 2)then - rootfr(p,lev) = .5_r8*( exp(-roota_par(patch%itype(p)) * zi(c,lev-1)) & - + exp(-rootb_par(patch%itype(p)) * zi(c,lev-1)) & - - exp(-roota_par(patch%itype(p)) * zi(c,lev )) & - - exp(-rootb_par(patch%itype(p)) * zi(c,lev )) ) - elseif (lev == 2) then - rootfr(p,lev) = .5_r8*( exp(-roota_par(patch%itype(p)) * zi(c,lev-1)) & - + exp(-rootb_par(patch%itype(p)) * zi(c,lev-1)) ) - else - rootfr(p,lev) = 0.0_r8 - end if - - end if - end do - end do - -!********************** - deallocate(sumrswa) - deallocate(sumrsmn) - deallocate(sumfrootc) - deallocate(rsmn) - deallocate(rswa) - deallocate(w_limit) - - end associate - - end subroutine CNRootDyn - -end module CNRootDynMod diff --git a/src/biogeochem/CNSharedParamsMod.F90 b/src/biogeochem/CNSharedParamsMod.F90 deleted file mode 100644 index 42156b1158..0000000000 --- a/src/biogeochem/CNSharedParamsMod.F90 +++ /dev/null @@ -1,192 +0,0 @@ -module CNSharedParamsMod - - !----------------------------------------------------------------------- - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - implicit none - - ! CNParamsShareInst. PGI wants the type decl. public but the instance - ! is indeed protected. A generic private statement at the start of the module - ! overrides the protected functionality with PGI - - type, public :: CNParamsShareType - real(r8) :: Q10 ! temperature dependence - real(r8) :: minpsi ! minimum soil water potential for heterotrophic resp - real(r8) :: cwd_fcel ! cellulose fraction of coarse woody debris - real(r8) :: cwd_flig ! lignin fraction of coarse woody debris - real(r8) :: froz_q10 ! separate q10 for frozen soil respiration rates - real(r8) :: decomp_depth_efolding ! e-folding depth for reduction in decomposition (m) - real(r8) :: mino2lim ! minimum anaerobic decomposition rate as a fraction of potential aerobic rate - real(r8) :: organic_max ! organic matter content (kg/m3) where soil is assumed to act like peat - logical :: constrain_stress_deciduous_onset ! if true use additional constraint on stress deciduous onset trigger - end type CNParamsShareType - - type(CNParamsShareType), protected :: CNParamsShareInst - - logical, public :: anoxia_wtsat = .false. - logical, public :: use_fun = .false. ! Use the FUN2.0 model - integer, public :: nlev_soildecomp_standard = 5 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNParamsReadShared(ncid, namelist_file) - - use ncdio_pio , only : file_desc_t - - type(file_desc_t), intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: namelist_file - - call CNParamsReadShared_netcdf(ncid) - call CNParamsReadShared_namelist(namelist_file) - - end subroutine CNParamsReadShared - - !----------------------------------------------------------------------- - subroutine CNParamsReadShared_netcdf(ncid) - ! - use ncdio_pio , only : file_desc_t, ncd_io - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - character(len=32) :: subname = 'CNParamsReadShared' - character(len=100) :: errCode = '-Error reading in CN and BGC shared params file. Var:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - ! - ! netcdf read here - ! - tString='q10_mr' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%Q10=tempr - - tString='minpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%minpsi=tempr - - tString='cwd_fcel' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%cwd_fcel=tempr - - tString='cwd_flig' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%cwd_flig=tempr - - tString='froz_q10' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%froz_q10=tempr - - tString='mino2lim' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%mino2lim=tempr - !CNParamsShareInst%mino2lim=0.2_r8 - - tString='organic_max' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - CNParamsShareInst%organic_max=tempr - - end subroutine CNParamsReadShared_netcdf - - !----------------------------------------------------------------------- - subroutine CNParamsReadShared_namelist(namelist_file) - ! - ! !DESCRIPTION: - ! Read and initialize CN Shared parameteres from the namelist. - ! - ! !USES: - use fileutils , only : relavu, getavu - use spmdMod , only : masterproc, mpicom, MPI_REAL8, MPI_LOGICAL - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_mpi_mod , only : shr_mpi_bcast - - ! - implicit none - ! - - character(len=*), intent(in) :: namelist_file - - integer :: i,j,n ! loop indices - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - real(r8) :: decomp_depth_efolding = 0.0_r8 - logical :: constrain_stress_deciduous_onset = .false. - - character(len=32) :: subroutine_name = 'CNParamsReadNamelist' - character(len=10) :: namelist_group = 'bgc_shared' - - !----------------------------------------------------------------------- - - ! ---------------------------------------------------------------------- - ! Namelist Variables - ! ---------------------------------------------------------------------- - - namelist /bgc_shared/ & - decomp_depth_efolding, & - constrain_stress_deciduous_onset - - - ! Read namelist from standard input. - if (masterproc) then - - write(iulog,*) 'Attempting to read CN/BGC shared namelist parameters .....' - unitn = getavu() - write(iulog,*) 'Read in ' // namelist_group // ' namelist from: ', trim(namelist_file) - open( unitn, file=trim(namelist_file), status='old' ) - call shr_nl_find_group_name(unitn, namelist_group, status=ierr) - if (ierr == 0) then - read(unitn, bgc_shared, iostat=ierr) - if (ierr /= 0) then - call endrun(msg='error in reading in ' // namelist_group // ' namelist' // & - errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='error in finding ' // namelist_group // ' namelist' // & - errMsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if ! masterproc - - ! Broadcast the parameters from master - call shr_mpi_bcast ( decomp_depth_efolding, mpicom ) - call shr_mpi_bcast ( constrain_stress_deciduous_onset, mpicom ) - - ! Save the parameter to the instance - CNParamsShareInst%decomp_depth_efolding = decomp_depth_efolding - CNParamsShareInst%constrain_stress_deciduous_onset = constrain_stress_deciduous_onset - - ! Output read parameters to the lnd.log - if (masterproc) then - write(iulog,*) 'CN/BGC shared namelist parameters:' - write(iulog,*)' ' - write(iulog,*)' decomp_depth_efolding = ', decomp_depth_efolding - write(iulog,*)' constrain_stress_deciduous_onset = ',constrain_stress_deciduous_onset - - write(iulog,*) - - end if - - end subroutine CNParamsReadShared_namelist - -end module CNSharedParamsMod diff --git a/src/biogeochem/CNSpeciesMod.F90 b/src/biogeochem/CNSpeciesMod.F90 deleted file mode 100644 index fc89f3ac02..0000000000 --- a/src/biogeochem/CNSpeciesMod.F90 +++ /dev/null @@ -1,68 +0,0 @@ -module CNSpeciesMod - - !----------------------------------------------------------------------- - ! Module holding information about different species available in the CN code (C, C13, - ! C14, N). - ! - ! - ! NOTE(wjs, 2016-06-05) Eventually I could imagine having a cn_species base class, with - ! derived classes for each species type - so a cn_species_c class, a cn_species_c13 - ! class, a cn_species_c14 class and a cn_species_n class. These would contain methods - ! to handle calculations specific to each species type. For example, there could be a - ! carbon_multiplier method that returns the species-specific multiplier that you would - ! apply to a variable in units of gC/m2 to give you g[this species]/m2 (this would - ! depend on pft type). - ! - ! Basically, anywhere where there is code that has a conditional based on the constants - ! defined here, we could replace that with polymorphism using a cn_species class. - ! - ! Eventually I think it would make sense to make this contain an instance of - ! species_base_type (i.e., the class used to determine history & restart field names), - ! with forwarding methods. So then (e.g.) a cn_products_type object would just contain a - ! cn_species object (which in turn would contain a species_metadata [or whatever we call - ! it] object). - - implicit none - private - - integer, parameter, public :: CN_SPECIES_C12 = 1 - integer, parameter, public :: CN_SPECIES_C13 = 2 - integer, parameter, public :: CN_SPECIES_C14 = 3 - integer, parameter, public :: CN_SPECIES_N = 4 - - public :: species_from_string ! convert a string representation to one of the constants defined here - -contains - - !----------------------------------------------------------------------- - function species_from_string(species_string) result(species) - ! - ! !DESCRIPTION: - ! Convert a string representation to one of the constants defined here - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: species ! function result - character(len=*), intent(in) :: species_string ! string representation of species (should be lowercase) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'species_from_string' - !----------------------------------------------------------------------- - - select case (species_string) - case ('c12') - species = CN_SPECIES_C12 - case ('c13') - species = CN_SPECIES_C13 - case ('c14') - species = CN_SPECIES_C14 - case ('n') - species = CN_SPECIES_N - end select - - end function species_from_string - - -end module CNSpeciesMod diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90 deleted file mode 100644 index 2ec35353f0..0000000000 --- a/src/biogeochem/CNVegCarbonFluxType.F90 +++ /dev/null @@ -1,4597 +0,0 @@ -module CNVegCarbonFluxType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : nlevdecomp_full, nlevgrnd, nlevdecomp - use clm_varcon , only : spval, dzsoi_decomp - use clm_varctl , only : use_cndv, use_c13, use_nitrif_denitrif, use_crop - use clm_varctl , only : use_grainproduct - use clm_varctl , only : iulog - use landunit_varcon , only : istsoil, istcrop, istdlak - use pftconMod , only : npcropmin - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use AnnualFluxDribbler , only : annual_flux_dribbler_type, annual_flux_dribbler_gridcell - use dynSubgridControlMod , only : get_for_testing_allow_non_annual_changes - use abortutils , only : endrun - ! - ! !PUBLIC TYPES: - implicit none - private - ! - type, public :: cnveg_carbonflux_type - - ! gap mortality fluxes - real(r8), pointer :: m_leafc_to_litter_patch (:) ! leaf C mortality (gC/m2/s) - real(r8), pointer :: m_leafc_storage_to_litter_patch (:) ! leaf C storage mortality (gC/m2/s) - real(r8), pointer :: m_leafc_xfer_to_litter_patch (:) ! leaf C transfer mortality (gC/m2/s) - real(r8), pointer :: m_frootc_to_litter_patch (:) ! fine root C mortality (gC/m2/s) - real(r8), pointer :: m_frootc_storage_to_litter_patch (:) ! fine root C storage mortality (gC/m2/s) - real(r8), pointer :: m_frootc_xfer_to_litter_patch (:) ! fine root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_to_litter_patch (:) ! live stem C mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_storage_to_litter_patch (:) ! live stem C storage mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_xfer_to_litter_patch (:) ! live stem C transfer mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_to_litter_patch (:) ! dead stem C mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_storage_to_litter_patch (:) ! dead stem C storage mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_xfer_to_litter_patch (:) ! dead stem C transfer mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_to_litter_patch (:) ! live coarse root C mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_storage_to_litter_patch (:) ! live coarse root C storage mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_xfer_to_litter_patch (:) ! live coarse root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_litter_patch (:) ! dead coarse root C mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_storage_to_litter_patch (:) ! dead coarse root C storage mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_xfer_to_litter_patch (:) ! dead coarse root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_gresp_storage_to_litter_patch (:) ! growth respiration storage mortality (gC/m2/s) - real(r8), pointer :: m_gresp_xfer_to_litter_patch (:) ! growth respiration transfer mortality (gC/m2/s) - - ! harvest mortality fluxes - real(r8), pointer :: hrv_leafc_to_litter_patch (:) ! leaf C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_leafc_storage_to_litter_patch (:) ! leaf C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_leafc_xfer_to_litter_patch (:) ! leaf C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_to_litter_patch (:) ! fine root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_storage_to_litter_patch (:) ! fine root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_xfer_to_litter_patch (:) ! fine root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_to_litter_patch (:) ! live stem C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_storage_to_litter_patch (:) ! live stem C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_xfer_to_litter_patch (:) ! live stem C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_storage_to_litter_patch (:) ! dead stem C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter_patch (:) ! dead stem C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_to_litter_patch (:) ! live coarse root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_storage_to_litter_patch (:) ! live coarse root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter_patch (:) ! live coarse root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_to_litter_patch (:) ! dead coarse root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter_patch (:) ! dead coarse root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter_patch (:) ! dead coarse root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_gresp_storage_to_litter_patch (:) ! growth respiration storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_gresp_xfer_to_litter_patch (:) ! growth respiration transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_xsmrpool_to_atm_patch (:) ! excess MR pool harvest mortality (gC/m2/s) - - ! fire fluxes - real(r8), pointer :: m_leafc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from leafc - real(r8), pointer :: m_leafc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from leafc_storage - real(r8), pointer :: m_leafc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from leafc_xfer - real(r8), pointer :: m_livestemc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livestemc - real(r8), pointer :: m_livestemc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livestemc_storage - real(r8), pointer :: m_livestemc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livestemc_xfer - real(r8), pointer :: m_deadstemc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadstemc_xfer - real(r8), pointer :: m_deadstemc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadstemc_storage - real(r8), pointer :: m_deadstemc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadstemc_xfer - real(r8), pointer :: m_frootc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from frootc - real(r8), pointer :: m_frootc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from frootc_storage - real(r8), pointer :: m_frootc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from frootc_xfer - real(r8), pointer :: m_livecrootc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livecrootc - real(r8), pointer :: m_livecrootc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livecrootc_storage - real(r8), pointer :: m_livecrootc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from livecrootc_xfer - real(r8), pointer :: m_deadcrootc_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadcrootc - real(r8), pointer :: m_deadcrootc_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadcrootc_storage - real(r8), pointer :: m_deadcrootc_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from deadcrootc_xfer - real(r8), pointer :: m_gresp_storage_to_fire_patch (:) ! (gC/m2/s) fire C emissions from gresp_storage - real(r8), pointer :: m_gresp_xfer_to_fire_patch (:) ! (gC/m2/s) fire C emissions from gresp_xfer - real(r8), pointer :: m_leafc_to_litter_fire_patch (:) ! (gC/m2/s) from leafc to litter c due to fire - real(r8), pointer :: m_leafc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from leafc_storage to litter C due to fire - real(r8), pointer :: m_leafc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from leafc_xfer to litter C due to fire - real(r8), pointer :: m_livestemc_to_litter_fire_patch (:) ! (gC/m2/s) from livestemc to litter C due to fire - real(r8), pointer :: m_livestemc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from livestemc_storage to litter C due to fire - real(r8), pointer :: m_livestemc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from livestemc_xfer to litter C due to fire - real(r8), pointer :: m_livestemc_to_deadstemc_fire_patch (:) ! (gC/m2/s) from livestemc to deadstemc due to fire - real(r8), pointer :: m_deadstemc_to_litter_fire_patch (:) ! (gC/m2/s) from deadstemc to litter C due to fire - real(r8), pointer :: m_deadstemc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from deadstemc_storage to litter C due to fire - real(r8), pointer :: m_deadstemc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from deadstemc_xfer to litter C due to fire - real(r8), pointer :: m_frootc_to_litter_fire_patch (:) ! (gC/m2/s) from frootc to litter C due to fire - real(r8), pointer :: m_frootc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from frootc_storage to litter C due to fire - real(r8), pointer :: m_frootc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from frootc_xfer to litter C due to fire - real(r8), pointer :: m_livecrootc_to_litter_fire_patch (:) ! (gC/m2/s) from livecrootc to litter C due to fire - real(r8), pointer :: m_livecrootc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from livecrootc_storage to litter C due to fire - real(r8), pointer :: m_livecrootc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from livecrootc_xfer to litter C due to fire - real(r8), pointer :: m_livecrootc_to_deadcrootc_fire_patch (:) ! (gC/m2/s) from livecrootc to deadstemc due to fire - real(r8), pointer :: m_deadcrootc_to_litter_fire_patch (:) ! (gC/m2/s) from deadcrootc to litter C due to fire - real(r8), pointer :: m_deadcrootc_storage_to_litter_fire_patch (:) ! (gC/m2/s) from deadcrootc_storage to litter C due to fire - real(r8), pointer :: m_deadcrootc_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from deadcrootc_xfer to litter C due to fire - real(r8), pointer :: m_gresp_storage_to_litter_fire_patch (:) ! (gC/m2/s) from gresp_storage to litter C due to fire - real(r8), pointer :: m_gresp_xfer_to_litter_fire_patch (:) ! (gC/m2/s) from gresp_xfer to litter C due to fire - - ! phenology fluxes from transfer pools - real(r8), pointer :: grainc_xfer_to_grainc_patch (:) ! grain C growth from storage for prognostic crop(gC/m2/s) - real(r8), pointer :: leafc_xfer_to_leafc_patch (:) ! leaf C growth from storage (gC/m2/s) - real(r8), pointer :: frootc_xfer_to_frootc_patch (:) ! fine root C growth from storage (gC/m2/s) - real(r8), pointer :: livestemc_xfer_to_livestemc_patch (:) ! live stem C growth from storage (gC/m2/s) - real(r8), pointer :: deadstemc_xfer_to_deadstemc_patch (:) ! dead stem C growth from storage (gC/m2/s) - real(r8), pointer :: livecrootc_xfer_to_livecrootc_patch (:) ! live coarse root C growth from storage (gC/m2/s) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc_patch (:) ! dead coarse root C growth from storage (gC/m2/s) - - ! leaf and fine root litterfall fluxes - real(r8), pointer :: leafc_to_litter_patch (:) ! leaf C litterfall (gC/m2/s) - real(r8), pointer :: leafc_to_litter_fun_patch (:) ! leaf C litterfall used by FUN (gC/m2/s) - real(r8), pointer :: frootc_to_litter_patch (:) ! fine root C litterfall (gC/m2/s) - real(r8), pointer :: livestemc_to_litter_patch (:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc_to_food_patch (:) ! grain C to food for prognostic crop(gC/m2/s) - real(r8), pointer :: grainc_to_seed_patch (:) ! grain C to seed for prognostic crop(gC/m2/s) - - ! maintenance respiration fluxes - real(r8), pointer :: cpool_to_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_leafc_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_leafc_storage_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_frootc_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_frootc_storage_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc_storage_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc_storage_resp_patch (:) ! CNflex excess C maintenance respiration (gC/m2/s) - real(r8), pointer :: leaf_mr_patch (:) ! leaf maintenance respiration (gC/m2/s) - real(r8), pointer :: froot_mr_patch (:) ! fine root maintenance respiration (gC/m2/s) - real(r8), pointer :: livestem_mr_patch (:) ! live stem maintenance respiration (gC/m2/s) - real(r8), pointer :: livecroot_mr_patch (:) ! live coarse root maintenance respiration (gC/m2/s) - real(r8), pointer :: grain_mr_patch (:) ! crop grain or organs maint. respiration (gC/m2/s) - real(r8), pointer :: leaf_curmr_patch (:) ! leaf maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: froot_curmr_patch (:) ! fine root maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: livestem_curmr_patch (:) ! live stem maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: livecroot_curmr_patch (:) ! live coarse root maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: grain_curmr_patch (:) ! crop grain or organs maint. respiration from current GPP (gC/m2/s) - real(r8), pointer :: leaf_xsmr_patch (:) ! leaf maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: froot_xsmr_patch (:) ! fine root maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: livestem_xsmr_patch (:) ! live stem maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: livecroot_xsmr_patch (:) ! live coarse root maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: grain_xsmr_patch (:) ! crop grain or organs maint. respiration from storage (gC/m2/s) - - ! photosynthesis fluxes - real(r8), pointer :: psnsun_to_cpool_patch (:) ! C fixation from sunlit canopy (gC/m2/s) - real(r8), pointer :: psnshade_to_cpool_patch (:) ! C fixation from shaded canopy (gC/m2/s) - - ! allocation fluxes, from current GPP - real(r8), pointer :: cpool_to_xsmrpool_patch (:) ! allocation to maintenance respiration storage pool (gC/m2/s) - real(r8), pointer :: cpool_to_grainc_patch (:) ! allocation to grain C for prognostic crop(gC/m2/s) - real(r8), pointer :: cpool_to_grainc_storage_patch (:) ! allocation to grain C storage for prognostic crop(gC/m2/s) - real(r8), pointer :: cpool_to_leafc_patch (:) ! allocation to leaf C (gC/m2/s) - real(r8), pointer :: cpool_to_leafc_storage_patch (:) ! allocation to leaf C storage (gC/m2/s) - real(r8), pointer :: cpool_to_frootc_patch (:) ! allocation to fine root C (gC/m2/s) - real(r8), pointer :: cpool_to_frootc_storage_patch (:) ! allocation to fine root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc_patch (:) ! allocation to live stem C (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc_storage_patch (:) ! allocation to live stem C storage (gC/m2/s) - real(r8), pointer :: cpool_to_deadstemc_patch (:) ! allocation to dead stem C (gC/m2/s) - real(r8), pointer :: cpool_to_deadstemc_storage_patch (:) ! allocation to dead stem C storage (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc_patch (:) ! allocation to live coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc_storage_patch (:) ! allocation to live coarse root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc_patch (:) ! allocation to dead coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc_storage_patch (:) ! allocation to dead coarse root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_gresp_storage_patch (:) ! allocation to growth respiration storage (gC/m2/s) - - ! growth respiration fluxes - real(r8), pointer :: xsmrpool_to_atm_patch (:) ! excess MR pool harvest mortality (gC/m2/s) - real(r8), pointer :: cpool_leaf_gr_patch (:) ! leaf growth respiration (gC/m2/s) - real(r8), pointer :: cpool_leaf_storage_gr_patch (:) ! leaf growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_leaf_gr_patch (:) ! leaf growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_froot_gr_patch (:) ! fine root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_froot_storage_gr_patch (:) ! fine root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_froot_gr_patch (:) ! fine root growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_livestem_gr_patch (:) ! live stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livestem_storage_gr_patch (:) ! live stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_livestem_gr_patch (:) ! live stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_deadstem_gr_patch (:) ! dead stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadstem_storage_gr_patch (:) ! dead stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_deadstem_gr_patch (:) ! dead stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_livecroot_gr_patch (:) ! live coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livecroot_storage_gr_patch (:) ! live coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_livecroot_gr_patch (:) ! live coarse root growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_deadcroot_gr_patch (:) ! dead coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadcroot_storage_gr_patch (:) ! dead coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_deadcroot_gr_patch (:) ! dead coarse root growth respiration from storage (gC/m2/s) - - ! growth respiration for prognostic crop model - real(r8), pointer :: cpool_grain_gr_patch (:) ! grain growth respiration (gC/m2/s) - real(r8), pointer :: cpool_grain_storage_gr_patch (:) ! grain growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_grain_gr_patch (:) ! grain growth respiration from storage (gC/m2/s) - - ! annual turnover of storage to transfer pools - real(r8), pointer :: grainc_storage_to_xfer_patch (:) ! grain C shift storage to transfer for prognostic crop model (gC/m2/s) - real(r8), pointer :: leafc_storage_to_xfer_patch (:) ! leaf C shift storage to transfer (gC/m2/s) - real(r8), pointer :: frootc_storage_to_xfer_patch (:) ! fine root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: livestemc_storage_to_xfer_patch (:) ! live stem C shift storage to transfer (gC/m2/s) - real(r8), pointer :: deadstemc_storage_to_xfer_patch (:) ! dead stem C shift storage to transfer (gC/m2/s) - real(r8), pointer :: livecrootc_storage_to_xfer_patch (:) ! live coarse root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: deadcrootc_storage_to_xfer_patch (:) ! dead coarse root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: gresp_storage_to_xfer_patch (:) ! growth respiration shift storage to transfer (gC/m2/s) - - ! turnover of livewood to deadwood - real(r8), pointer :: livestemc_to_deadstemc_patch (:) ! live stem C turnover (gC/m2/s) - real(r8), pointer :: livecrootc_to_deadcrootc_patch (:) ! live coarse root C turnover (gC/m2/s) - - ! phenology: litterfall and crop fluxes - real(r8), pointer :: phenology_c_to_litr_met_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gC/m3/s) - real(r8), pointer :: phenology_c_to_litr_cel_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gC/m3/s) - real(r8), pointer :: phenology_c_to_litr_lig_c_col (:,:) ! C fluxes associated with phenology (litterfall and crop) to litter lignin pool (gC/m3/s) - - ! gap mortality - real(r8), pointer :: gap_mortality_c_to_litr_met_c_col (:,:) ! C fluxes associated with gap mortality to litter metabolic pool (gC/m3/s) - real(r8), pointer :: gap_mortality_c_to_litr_cel_c_col (:,:) ! C fluxes associated with gap mortality to litter cellulose pool (gC/m3/s) - real(r8), pointer :: gap_mortality_c_to_litr_lig_c_col (:,:) ! C fluxes associated with gap mortality to litter lignin pool (gC/m3/s) - real(r8), pointer :: gap_mortality_c_to_cwdc_col (:,:) ! C fluxes associated with gap mortality to CWD pool (gC/m3/s) - - ! fire - real(r8), pointer :: fire_mortality_c_to_cwdc_col (:,:) ! C fluxes associated with fire mortality to CWD pool (gC/m3/s) - - ! harvest - real(r8), pointer :: harvest_c_to_litr_met_c_col (:,:) ! C fluxes associated with harvest to litter metabolic pool (gC/m3/s) - real(r8), pointer :: harvest_c_to_litr_cel_c_col (:,:) ! C fluxes associated with harvest to litter cellulose pool (gC/m3/s) - real(r8), pointer :: harvest_c_to_litr_lig_c_col (:,:) ! C fluxes associated with harvest to litter lignin pool (gC/m3/s) - real(r8), pointer :: harvest_c_to_cwdc_col (:,:) ! C fluxes associated with harvest to CWD pool (gC/m3/s) - real(r8), pointer :: grainc_to_cropprodc_patch (:) ! grain C to crop product pool (gC/m2/s) - real(r8), pointer :: grainc_to_cropprodc_col (:) ! grain C to crop product pool (gC/m2/s) - - ! fire fluxes - real(r8), pointer :: m_decomp_cpools_to_fire_vr_col (:,:,:) ! vertically-resolved decomposing C fire loss (gC/m3/s) - real(r8), pointer :: m_decomp_cpools_to_fire_col (:,:) ! vertically-integrated (diagnostic) decomposing C fire loss (gC/m2/s) - real(r8), pointer :: m_c_to_litr_met_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter labile C by fire (gC/m3/s) - real(r8), pointer :: m_c_to_litr_cel_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter cellulose C by fire (gC/m3/s) - real(r8), pointer :: m_c_to_litr_lig_fire_col (:,:) ! C from leaf, froot, xfer and storage C to litter lignin C by fire (gC/m3/s) - - ! dynamic landcover fluxes - real(r8), pointer :: dwt_seedc_to_leaf_patch (:) ! (gC/m2/s) seed source to patch-level; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_seedc_to_leaf_grc (:) ! (gC/m2/s) dwt_seedc_to_leaf_patch summed to the gridcell-level - real(r8), pointer :: dwt_seedc_to_deadstem_patch (:) ! (gC/m2/s) seed source to patch-level; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_seedc_to_deadstem_grc (:) ! (gC/m2/s) dwt_seedc_to_leaf_patch summed to the gridcell-level - real(r8), pointer :: dwt_conv_cflux_patch (:) ! (gC/m2/s) conversion C flux (immediate loss to atm); although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_conv_cflux_grc (:) ! (gC/m2/s) dwt_conv_cflux_patch summed to the gridcell-level - real(r8), pointer :: dwt_conv_cflux_dribbled_grc (:) ! (gC/m2/s) dwt_conv_cflux_grc dribbled evenly throughout the year - real(r8), pointer :: dwt_wood_productc_gain_patch (:) ! (gC/m2/s) addition to wood product pools from landcover change; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_crop_productc_gain_patch (:) ! (gC/m2/s) addition to crop product pools from landcover change; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_slash_cflux_col (:) ! (gC/m2/s) conversion slash flux due to landcover change - real(r8), pointer :: dwt_frootc_to_litr_met_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootc_to_litr_cel_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootc_to_litr_lig_c_col (:,:) ! (gC/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_livecrootc_to_cwdc_col (:,:) ! (gC/m3/s) live coarse root to CWD due to landcover change - real(r8), pointer :: dwt_deadcrootc_to_cwdc_col (:,:) ! (gC/m3/s) dead coarse root to CWD due to landcover change - - ! crop fluxes - real(r8), pointer :: crop_seedc_to_leaf_patch (:) ! (gC/m2/s) seed source to leaf, for crops - - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: gpp_before_downreg_patch (:) ! (gC/m2/s) gross primary production before down regulation - real(r8), pointer :: current_gr_patch (:) ! (gC/m2/s) growth resp for new growth displayed in this timestep - real(r8), pointer :: transfer_gr_patch (:) ! (gC/m2/s) growth resp for transfer growth displayed in this timestep - real(r8), pointer :: storage_gr_patch (:) ! (gC/m2/s) growth resp for growth sent to storage for later display - real(r8), pointer :: plant_calloc_patch (:) ! (gC/m2/s) total allocated C flux - real(r8), pointer :: excess_cflux_patch (:) ! (gC/m2/s) C flux not allocated due to downregulation - real(r8), pointer :: prev_leafc_to_litter_patch (:) ! (gC/m2/s) previous timestep leaf C litterfall flux - real(r8), pointer :: prev_frootc_to_litter_patch (:) ! (gC/m2/s) previous timestep froot C litterfall flux - real(r8), pointer :: availc_patch (:) ! (gC/m2/s) C flux available for allocation - real(r8), pointer :: xsmrpool_recover_patch (:) ! (gC/m2/s) C flux assigned to recovery of negative cpool - real(r8), pointer :: xsmrpool_c13ratio_patch (:) ! C13/C(12+13) ratio for xsmrpool (proportion) - - real(r8), pointer :: cwdc_hr_col (:) ! (gC/m2/s) col-level coarse woody debris C heterotrophic respiration - real(r8), pointer :: cwdc_loss_col (:) ! (gC/m2/s) col-level coarse woody debris C loss - real(r8), pointer :: litterc_loss_col (:) ! (gC/m2/s) col-level litter C loss - real(r8), pointer :: frootc_alloc_patch (:) ! (gC/m2/s) patch-level fine root C alloc - real(r8), pointer :: frootc_loss_patch (:) ! (gC/m2/s) patch-level fine root C loss - real(r8), pointer :: leafc_alloc_patch (:) ! (gC/m2/s) patch-level leaf C alloc - real(r8), pointer :: leafc_loss_patch (:) ! (gC/m2/s) patch-level leaf C loss - real(r8), pointer :: woodc_alloc_patch (:) ! (gC/m2/s) patch-level wood C alloc - real(r8), pointer :: woodc_loss_patch (:) ! (gC/m2/s) patch-level wood C loss - - real(r8), pointer :: gpp_patch (:) ! (gC/m2/s) patch gross primary production - real(r8), pointer :: gpp_col (:) ! (gC/m2/s) column GPP flux before downregulation (p2c) - real(r8), pointer :: rr_patch (:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: rr_col (:) ! (gC/m2/s) root respiration (fine root MR + total root GR) (p2c) - real(r8), pointer :: mr_patch (:) ! (gC/m2/s) maintenance respiration - real(r8), pointer :: gr_patch (:) ! (gC/m2/s) total growth respiration - real(r8), pointer :: ar_patch (:) ! (gC/m2/s) patch autotrophic respiration (MR + GR) - real(r8), pointer :: ar_col (:) ! (gC/m2/s) column autotrophic respiration (MR + GR) (p2c) - real(r8), pointer :: npp_patch (:) ! (gC/m2/s) patch net primary production - real(r8), pointer :: npp_col (:) ! (gC/m2/s) column net primary production (p2c) - real(r8), pointer :: agnpp_patch (:) ! (gC/m2/s) aboveground NPP - real(r8), pointer :: bgnpp_patch (:) ! (gC/m2/s) belowground NPP - real(r8), pointer :: litfall_patch (:) ! (gC/m2/s) patch litterfall (leaves and fine roots) - real(r8), pointer :: wood_harvestc_patch (:) ! (gC/m2/s) patch-level wood harvest (to product pools) - real(r8), pointer :: wood_harvestc_col (:) ! (gC/m2/s) column-level wood harvest (to product pools) (p2c) - real(r8), pointer :: slash_harvestc_patch (:) ! (gC/m2/s) patch-level slash from harvest (to litter) - real(r8), pointer :: cinputs_patch (:) ! (gC/m2/s) patch-level carbon inputs (for balance checking) - real(r8), pointer :: coutputs_patch (:) ! (gC/m2/s) patch-level carbon outputs (for balance checking) - real(r8), pointer :: sr_col (:) ! (gC/m2/s) total soil respiration (HR + root resp) - real(r8), pointer :: er_col (:) ! (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - real(r8), pointer :: litfire_col (:) ! (gC/m2/s) litter fire losses - real(r8), pointer :: somfire_col (:) ! (gC/m2/s) soil organic matter fire losses - real(r8), pointer :: totfire_col (:) ! (gC/m2/s) total ecosystem fire losses - real(r8), pointer :: hrv_xsmrpool_to_atm_col (:) ! (gC/m2/s) excess MR pool harvest mortality (p2c) - - ! fire code - real(r8), pointer :: fire_closs_patch (:) ! (gC/m2/s) total fire C loss - real(r8), pointer :: fire_closs_p2c_col (:) ! (gC/m2/s) patch2col averaged column-level fire C loss (p2c) - real(r8), pointer :: fire_closs_col (:) ! (gC/m2/s) total patch-level fire C loss - - ! temporary and annual sums - real(r8), pointer :: tempsum_litfall_patch (:) ! (gC/m2/yr) temporary annual sum of litfall (CNDV only for now) - real(r8), pointer :: annsum_litfall_patch (:) ! (gC/m2/yr) annual sum of litfall (CNDV only for now) - real(r8), pointer :: tempsum_npp_patch (:) ! (gC/m2/yr) temporary annual sum of NPP - real(r8), pointer :: annsum_npp_patch (:) ! (gC/m2/yr) annual sum of NPP - real(r8), pointer :: annsum_npp_col (:) ! (gC/m2/yr) annual sum of NPP, averaged from patch-level - real(r8), pointer :: lag_npp_col (:) ! (gC/m2/yr) lagged net primary production - - ! Summary C fluxes. - real(r8), pointer :: nep_col (:) ! (gC/m2/s) net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink - real(r8), pointer :: nbp_grc (:) ! (gC/m2/s) net biome production, includes fire, landuse, harvest and hrv_xsmrpool flux, positive for sink (same as net carbon exchange between land and atmosphere) - real(r8), pointer :: nee_grc (:) ! (gC/m2/s) net ecosystem exchange of carbon, includes fire and hrv_xsmrpool, excludes landuse and harvest flux, positive for source - - ! Dynamic landcover fluxnes - real(r8), pointer :: landuseflux_grc(:) ! (gC/m2/s) dwt_conv_cflux+product_closs - real(r8), pointer :: npp_Nactive_patch (:) ! C used by mycorrhizal uptake (gC/m2/s) - real(r8), pointer :: npp_burnedoff_patch (:) ! C that cannot be used for N uptake (gC/m2/s) - real(r8), pointer :: npp_Nnonmyc_patch (:) ! C used by non-myc uptake (gC/m2/s) - real(r8), pointer :: npp_Nam_patch (:) ! C used by AM plant (gC/m2/s) - real(r8), pointer :: npp_Necm_patch (:) ! C used by ECM plant (gC/m2/s) - real(r8), pointer :: npp_Nactive_no3_patch (:) ! C used by mycorrhizal uptake (gC/m2/s) - real(r8), pointer :: npp_Nactive_nh4_patch (:) ! C used by mycorrhizal uptake (gC/m2/s) - real(r8), pointer :: npp_Nnonmyc_no3_patch (:) ! C used by non-myc (gC/m2/s) - real(r8), pointer :: npp_Nnonmyc_nh4_patch (:) ! C used by non-myc (gC/m2/s) - real(r8), pointer :: npp_Nam_no3_patch (:) ! C used by AM plant (gC/m2/s) - real(r8), pointer :: npp_Nam_nh4_patch (:) ! C used by AM plant (gC/m2/s) - real(r8), pointer :: npp_Necm_no3_patch (:) ! C used by ECM plant (gC/m2/s) - real(r8), pointer :: npp_Necm_nh4_patch (:) ! C used by ECM plant (gC/m2/s) - real(r8), pointer :: npp_Nfix_patch (:) ! C used by Symbiotic BNF (gC/m2/s) - real(r8), pointer :: npp_Nretrans_patch (:) ! C used by retranslocation (gC/m2/s) - real(r8), pointer :: npp_Nuptake_patch (:) ! Total C used by N uptake in FUN (gC/m2/s) - real(r8), pointer :: npp_growth_patch (:) ! Total C u for growth in FUN (gC/m2/s) - real(r8), pointer :: leafc_change_patch (:) ! Total used C from leaves (gC/m2/s) - real(r8), pointer :: soilc_change_patch (:) ! Total used C from soil (gC/m2/s) - -! real(r8), pointer :: soilc_change_col (:) ! Total used C from soil (gC/m2/s) - - ! Objects that help convert once-per-year dynamic land cover changes into fluxes - ! that are dribbled throughout the year - type(annual_flux_dribbler_type) :: dwt_conv_cflux_dribbler - type(annual_flux_dribbler_type) :: hrv_xsmrpool_to_atm_dribbler - contains - - procedure , public :: Init - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - procedure , public :: Restart - procedure , private :: RestartBulkOnly ! Handle restart fields only present for bulk C - procedure , private :: RestartAllIsotopes ! Handle restart fields present for both bulk C and isotopes - procedure , public :: SetValues - procedure , public :: ZeroDWT - procedure , public :: Summary => Summary_carbonflux - - end type cnveg_carbonflux_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type) - - class(cnveg_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - - call this%InitAllocate ( bounds, carbon_type) - call this%InitHistory ( bounds, carbon_type ) - call this%InitCold (bounds ) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds, carbon_type) - ! - ! !ARGUMENTS: - class (cnveg_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - logical :: allows_non_annual_delta - character(len=:), allocatable :: carbon_type_suffix - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%m_leafc_to_litter_patch (begp:endp)) ; this%m_leafc_to_litter_patch (:) = nan - allocate(this%m_frootc_to_litter_patch (begp:endp)) ; this%m_frootc_to_litter_patch (:) = nan - allocate(this%m_leafc_storage_to_litter_patch (begp:endp)) ; this%m_leafc_storage_to_litter_patch (:) = nan - allocate(this%m_frootc_storage_to_litter_patch (begp:endp)) ; this%m_frootc_storage_to_litter_patch (:) = nan - allocate(this%m_livestemc_storage_to_litter_patch (begp:endp)) ; this%m_livestemc_storage_to_litter_patch (:) = nan - allocate(this%m_deadstemc_storage_to_litter_patch (begp:endp)) ; this%m_deadstemc_storage_to_litter_patch (:) = nan - allocate(this%m_livecrootc_storage_to_litter_patch (begp:endp)) ; this%m_livecrootc_storage_to_litter_patch (:) = nan - allocate(this%m_deadcrootc_storage_to_litter_patch (begp:endp)) ; this%m_deadcrootc_storage_to_litter_patch (:) = nan - allocate(this%m_leafc_xfer_to_litter_patch (begp:endp)) ; this%m_leafc_xfer_to_litter_patch (:) = nan - allocate(this%m_frootc_xfer_to_litter_patch (begp:endp)) ; this%m_frootc_xfer_to_litter_patch (:) = nan - allocate(this%m_livestemc_xfer_to_litter_patch (begp:endp)) ; this%m_livestemc_xfer_to_litter_patch (:) = nan - allocate(this%m_deadstemc_xfer_to_litter_patch (begp:endp)) ; this%m_deadstemc_xfer_to_litter_patch (:) = nan - allocate(this%m_livecrootc_xfer_to_litter_patch (begp:endp)) ; this%m_livecrootc_xfer_to_litter_patch (:) = nan - allocate(this%m_deadcrootc_xfer_to_litter_patch (begp:endp)) ; this%m_deadcrootc_xfer_to_litter_patch (:) = nan - allocate(this%m_livestemc_to_litter_patch (begp:endp)) ; this%m_livestemc_to_litter_patch (:) = nan - allocate(this%m_deadstemc_to_litter_patch (begp:endp)) ; this%m_deadstemc_to_litter_patch (:) = nan - allocate(this%m_livecrootc_to_litter_patch (begp:endp)) ; this%m_livecrootc_to_litter_patch (:) = nan - allocate(this%m_deadcrootc_to_litter_patch (begp:endp)) ; this%m_deadcrootc_to_litter_patch (:) = nan - allocate(this%m_gresp_storage_to_litter_patch (begp:endp)) ; this%m_gresp_storage_to_litter_patch (:) = nan - allocate(this%m_gresp_xfer_to_litter_patch (begp:endp)) ; this%m_gresp_xfer_to_litter_patch (:) = nan - allocate(this%hrv_leafc_to_litter_patch (begp:endp)) ; this%hrv_leafc_to_litter_patch (:) = nan - allocate(this%hrv_leafc_storage_to_litter_patch (begp:endp)) ; this%hrv_leafc_storage_to_litter_patch (:) = nan - allocate(this%hrv_leafc_xfer_to_litter_patch (begp:endp)) ; this%hrv_leafc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_frootc_to_litter_patch (begp:endp)) ; this%hrv_frootc_to_litter_patch (:) = nan - allocate(this%hrv_frootc_storage_to_litter_patch (begp:endp)) ; this%hrv_frootc_storage_to_litter_patch (:) = nan - allocate(this%hrv_frootc_xfer_to_litter_patch (begp:endp)) ; this%hrv_frootc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_livestemc_to_litter_patch (begp:endp)) ; this%hrv_livestemc_to_litter_patch (:) = nan - allocate(this%hrv_livestemc_storage_to_litter_patch (begp:endp)) ; this%hrv_livestemc_storage_to_litter_patch (:) = nan - allocate(this%hrv_livestemc_xfer_to_litter_patch (begp:endp)) ; this%hrv_livestemc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_deadstemc_storage_to_litter_patch (begp:endp)) ; this%hrv_deadstemc_storage_to_litter_patch (:) = nan - allocate(this%hrv_deadstemc_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadstemc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_livecrootc_to_litter_patch (begp:endp)) ; this%hrv_livecrootc_to_litter_patch (:) = nan - allocate(this%hrv_livecrootc_storage_to_litter_patch (begp:endp)) ; this%hrv_livecrootc_storage_to_litter_patch (:) = nan - allocate(this%hrv_livecrootc_xfer_to_litter_patch (begp:endp)) ; this%hrv_livecrootc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootc_to_litter_patch (begp:endp)) ; this%hrv_deadcrootc_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootc_storage_to_litter_patch (begp:endp)) ; this%hrv_deadcrootc_storage_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootc_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadcrootc_xfer_to_litter_patch (:) = nan - allocate(this%hrv_gresp_storage_to_litter_patch (begp:endp)) ; this%hrv_gresp_storage_to_litter_patch (:) = nan - allocate(this%hrv_gresp_xfer_to_litter_patch (begp:endp)) ; this%hrv_gresp_xfer_to_litter_patch (:) = nan - allocate(this%hrv_xsmrpool_to_atm_patch (begp:endp)) ; this%hrv_xsmrpool_to_atm_patch (:) = nan - allocate(this%m_leafc_to_fire_patch (begp:endp)) ; this%m_leafc_to_fire_patch (:) = nan - allocate(this%m_leafc_storage_to_fire_patch (begp:endp)) ; this%m_leafc_storage_to_fire_patch (:) = nan - allocate(this%m_leafc_xfer_to_fire_patch (begp:endp)) ; this%m_leafc_xfer_to_fire_patch (:) = nan - allocate(this%m_livestemc_to_fire_patch (begp:endp)) ; this%m_livestemc_to_fire_patch (:) = nan - allocate(this%m_livestemc_storage_to_fire_patch (begp:endp)) ; this%m_livestemc_storage_to_fire_patch (:) = nan - allocate(this%m_livestemc_xfer_to_fire_patch (begp:endp)) ; this%m_livestemc_xfer_to_fire_patch (:) = nan - allocate(this%m_deadstemc_to_fire_patch (begp:endp)) ; this%m_deadstemc_to_fire_patch (:) = nan - allocate(this%m_deadstemc_storage_to_fire_patch (begp:endp)) ; this%m_deadstemc_storage_to_fire_patch (:) = nan - allocate(this%m_deadstemc_xfer_to_fire_patch (begp:endp)) ; this%m_deadstemc_xfer_to_fire_patch (:) = nan - allocate(this%m_frootc_to_fire_patch (begp:endp)) ; this%m_frootc_to_fire_patch (:) = nan - allocate(this%m_frootc_storage_to_fire_patch (begp:endp)) ; this%m_frootc_storage_to_fire_patch (:) = nan - allocate(this%m_frootc_xfer_to_fire_patch (begp:endp)) ; this%m_frootc_xfer_to_fire_patch (:) = nan - allocate(this%m_livecrootc_to_fire_patch (begp:endp)) ; this%m_livecrootc_to_fire_patch (:) = nan - allocate(this%m_livecrootc_storage_to_fire_patch (begp:endp)) ; this%m_livecrootc_storage_to_fire_patch (:) = nan - allocate(this%m_livecrootc_xfer_to_fire_patch (begp:endp)) ; this%m_livecrootc_xfer_to_fire_patch (:) = nan - allocate(this%m_deadcrootc_to_fire_patch (begp:endp)) ; this%m_deadcrootc_to_fire_patch (:) = nan - allocate(this%m_deadcrootc_storage_to_fire_patch (begp:endp)) ; this%m_deadcrootc_storage_to_fire_patch (:) = nan - allocate(this%m_deadcrootc_xfer_to_fire_patch (begp:endp)) ; this%m_deadcrootc_xfer_to_fire_patch (:) = nan - allocate(this%m_gresp_storage_to_fire_patch (begp:endp)) ; this%m_gresp_storage_to_fire_patch (:) = nan - allocate(this%m_gresp_xfer_to_fire_patch (begp:endp)) ; this%m_gresp_xfer_to_fire_patch (:) = nan - allocate(this%m_leafc_to_litter_fire_patch (begp:endp)) ; this%m_leafc_to_litter_fire_patch (:) = nan - allocate(this%m_leafc_storage_to_litter_fire_patch (begp:endp)) ; this%m_leafc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_leafc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_leafc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livestemc_to_litter_fire_patch (begp:endp)) ; this%m_livestemc_to_litter_fire_patch (:) = nan - allocate(this%m_livestemc_storage_to_litter_fire_patch (begp:endp)) ; this%m_livestemc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_livestemc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_livestemc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livestemc_to_deadstemc_fire_patch (begp:endp)) ; this%m_livestemc_to_deadstemc_fire_patch (:) = nan - allocate(this%m_deadstemc_to_litter_fire_patch (begp:endp)) ; this%m_deadstemc_to_litter_fire_patch (:) = nan - allocate(this%m_deadstemc_storage_to_litter_fire_patch (begp:endp)) ; this%m_deadstemc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_deadstemc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_deadstemc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_frootc_to_litter_fire_patch (begp:endp)) ; this%m_frootc_to_litter_fire_patch (:) = nan - allocate(this%m_frootc_storage_to_litter_fire_patch (begp:endp)) ; this%m_frootc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_frootc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_frootc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootc_to_litter_fire_patch (begp:endp)) ; this%m_livecrootc_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootc_storage_to_litter_fire_patch (begp:endp)) ; this%m_livecrootc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_livecrootc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootc_to_deadcrootc_fire_patch (begp:endp)) ; this%m_livecrootc_to_deadcrootc_fire_patch (:) = nan - allocate(this%m_deadcrootc_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootc_to_litter_fire_patch (:) = nan - allocate(this%m_deadcrootc_storage_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootc_storage_to_litter_fire_patch (:) = nan - allocate(this%m_deadcrootc_xfer_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootc_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_gresp_storage_to_litter_fire_patch (begp:endp)) ; this%m_gresp_storage_to_litter_fire_patch (:) = nan - allocate(this%m_gresp_xfer_to_litter_fire_patch (begp:endp)) ; this%m_gresp_xfer_to_litter_fire_patch (:) = nan - allocate(this%leafc_xfer_to_leafc_patch (begp:endp)) ; this%leafc_xfer_to_leafc_patch (:) = nan - allocate(this%frootc_xfer_to_frootc_patch (begp:endp)) ; this%frootc_xfer_to_frootc_patch (:) = nan - allocate(this%livestemc_xfer_to_livestemc_patch (begp:endp)) ; this%livestemc_xfer_to_livestemc_patch (:) = nan - allocate(this%deadstemc_xfer_to_deadstemc_patch (begp:endp)) ; this%deadstemc_xfer_to_deadstemc_patch (:) = nan - allocate(this%livecrootc_xfer_to_livecrootc_patch (begp:endp)) ; this%livecrootc_xfer_to_livecrootc_patch (:) = nan - allocate(this%deadcrootc_xfer_to_deadcrootc_patch (begp:endp)) ; this%deadcrootc_xfer_to_deadcrootc_patch (:) = nan - allocate(this%leafc_to_litter_patch (begp:endp)) ; this%leafc_to_litter_patch (:) = nan - allocate(this%leafc_to_litter_fun_patch (begp:endp)) ; this%leafc_to_litter_fun_patch (:) = nan - allocate(this%frootc_to_litter_patch (begp:endp)) ; this%frootc_to_litter_patch (:) = nan - allocate(this%cpool_to_resp_patch (begp:endp)) ; this%cpool_to_resp_patch (:) = nan - allocate(this%cpool_to_leafc_resp_patch (begp:endp)) ; this%cpool_to_leafc_resp_patch (:) = nan - allocate(this%cpool_to_leafc_storage_resp_patch (begp:endp)) ; this%cpool_to_leafc_storage_resp_patch (:) = nan - allocate(this%cpool_to_frootc_resp_patch (begp:endp)) ; this%cpool_to_frootc_resp_patch (:) = nan - allocate(this%cpool_to_frootc_storage_resp_patch (begp:endp)) ; this%cpool_to_frootc_storage_resp_patch (:) = nan - allocate(this%cpool_to_livecrootc_resp_patch (begp:endp)) ; this%cpool_to_livecrootc_resp_patch (:) = nan - allocate(this%cpool_to_livecrootc_storage_resp_patch (begp:endp)) ; this%cpool_to_livecrootc_storage_resp_patch (:) = nan - allocate(this%cpool_to_livestemc_resp_patch (begp:endp)) ; this%cpool_to_livestemc_resp_patch (:) = nan - allocate(this%cpool_to_livestemc_storage_resp_patch (begp:endp)) ; this%cpool_to_livestemc_storage_resp_patch (:) = nan - allocate(this%leaf_mr_patch (begp:endp)) ; this%leaf_mr_patch (:) = nan - allocate(this%froot_mr_patch (begp:endp)) ; this%froot_mr_patch (:) = nan - allocate(this%livestem_mr_patch (begp:endp)) ; this%livestem_mr_patch (:) = nan - allocate(this%livecroot_mr_patch (begp:endp)) ; this%livecroot_mr_patch (:) = nan - allocate(this%grain_mr_patch (begp:endp)) ; this%grain_mr_patch (:) = nan - allocate(this%leaf_curmr_patch (begp:endp)) ; this%leaf_curmr_patch (:) = nan - allocate(this%froot_curmr_patch (begp:endp)) ; this%froot_curmr_patch (:) = nan - allocate(this%livestem_curmr_patch (begp:endp)) ; this%livestem_curmr_patch (:) = nan - allocate(this%livecroot_curmr_patch (begp:endp)) ; this%livecroot_curmr_patch (:) = nan - allocate(this%grain_curmr_patch (begp:endp)) ; this%grain_curmr_patch (:) = nan - allocate(this%leaf_xsmr_patch (begp:endp)) ; this%leaf_xsmr_patch (:) = nan - allocate(this%froot_xsmr_patch (begp:endp)) ; this%froot_xsmr_patch (:) = nan - allocate(this%livestem_xsmr_patch (begp:endp)) ; this%livestem_xsmr_patch (:) = nan - allocate(this%livecroot_xsmr_patch (begp:endp)) ; this%livecroot_xsmr_patch (:) = nan - allocate(this%grain_xsmr_patch (begp:endp)) ; this%grain_xsmr_patch (:) = nan - allocate(this%psnsun_to_cpool_patch (begp:endp)) ; this%psnsun_to_cpool_patch (:) = nan - allocate(this%psnshade_to_cpool_patch (begp:endp)) ; this%psnshade_to_cpool_patch (:) = nan - allocate(this%cpool_to_xsmrpool_patch (begp:endp)) ; this%cpool_to_xsmrpool_patch (:) = nan - allocate(this%cpool_to_leafc_patch (begp:endp)) ; this%cpool_to_leafc_patch (:) = nan - allocate(this%cpool_to_leafc_storage_patch (begp:endp)) ; this%cpool_to_leafc_storage_patch (:) = nan - allocate(this%cpool_to_frootc_patch (begp:endp)) ; this%cpool_to_frootc_patch (:) = nan - allocate(this%cpool_to_frootc_storage_patch (begp:endp)) ; this%cpool_to_frootc_storage_patch (:) = nan - allocate(this%cpool_to_livestemc_patch (begp:endp)) ; this%cpool_to_livestemc_patch (:) = nan - allocate(this%cpool_to_livestemc_storage_patch (begp:endp)) ; this%cpool_to_livestemc_storage_patch (:) = nan - allocate(this%cpool_to_deadstemc_patch (begp:endp)) ; this%cpool_to_deadstemc_patch (:) = nan - allocate(this%cpool_to_deadstemc_storage_patch (begp:endp)) ; this%cpool_to_deadstemc_storage_patch (:) = nan - allocate(this%cpool_to_livecrootc_patch (begp:endp)) ; this%cpool_to_livecrootc_patch (:) = nan - allocate(this%cpool_to_livecrootc_storage_patch (begp:endp)) ; this%cpool_to_livecrootc_storage_patch (:) = nan - allocate(this%cpool_to_deadcrootc_patch (begp:endp)) ; this%cpool_to_deadcrootc_patch (:) = nan - allocate(this%cpool_to_deadcrootc_storage_patch (begp:endp)) ; this%cpool_to_deadcrootc_storage_patch (:) = nan - allocate(this%cpool_to_gresp_storage_patch (begp:endp)) ; this%cpool_to_gresp_storage_patch (:) = nan - allocate(this%cpool_leaf_gr_patch (begp:endp)) ; this%cpool_leaf_gr_patch (:) = nan - allocate(this%cpool_leaf_storage_gr_patch (begp:endp)) ; this%cpool_leaf_storage_gr_patch (:) = nan - allocate(this%transfer_leaf_gr_patch (begp:endp)) ; this%transfer_leaf_gr_patch (:) = nan - allocate(this%cpool_froot_gr_patch (begp:endp)) ; this%cpool_froot_gr_patch (:) = nan - allocate(this%cpool_froot_storage_gr_patch (begp:endp)) ; this%cpool_froot_storage_gr_patch (:) = nan - allocate(this%transfer_froot_gr_patch (begp:endp)) ; this%transfer_froot_gr_patch (:) = nan - allocate(this%cpool_livestem_gr_patch (begp:endp)) ; this%cpool_livestem_gr_patch (:) = nan - allocate(this%cpool_livestem_storage_gr_patch (begp:endp)) ; this%cpool_livestem_storage_gr_patch (:) = nan - allocate(this%transfer_livestem_gr_patch (begp:endp)) ; this%transfer_livestem_gr_patch (:) = nan - allocate(this%cpool_deadstem_gr_patch (begp:endp)) ; this%cpool_deadstem_gr_patch (:) = nan - allocate(this%cpool_deadstem_storage_gr_patch (begp:endp)) ; this%cpool_deadstem_storage_gr_patch (:) = nan - allocate(this%transfer_deadstem_gr_patch (begp:endp)) ; this%transfer_deadstem_gr_patch (:) = nan - allocate(this%cpool_livecroot_gr_patch (begp:endp)) ; this%cpool_livecroot_gr_patch (:) = nan - allocate(this%cpool_livecroot_storage_gr_patch (begp:endp)) ; this%cpool_livecroot_storage_gr_patch (:) = nan - allocate(this%transfer_livecroot_gr_patch (begp:endp)) ; this%transfer_livecroot_gr_patch (:) = nan - allocate(this%cpool_deadcroot_gr_patch (begp:endp)) ; this%cpool_deadcroot_gr_patch (:) = nan - allocate(this%cpool_deadcroot_storage_gr_patch (begp:endp)) ; this%cpool_deadcroot_storage_gr_patch (:) = nan - allocate(this%transfer_deadcroot_gr_patch (begp:endp)) ; this%transfer_deadcroot_gr_patch (:) = nan - allocate(this%leafc_storage_to_xfer_patch (begp:endp)) ; this%leafc_storage_to_xfer_patch (:) = nan - allocate(this%frootc_storage_to_xfer_patch (begp:endp)) ; this%frootc_storage_to_xfer_patch (:) = nan - allocate(this%livestemc_storage_to_xfer_patch (begp:endp)) ; this%livestemc_storage_to_xfer_patch (:) = nan - allocate(this%deadstemc_storage_to_xfer_patch (begp:endp)) ; this%deadstemc_storage_to_xfer_patch (:) = nan - allocate(this%livecrootc_storage_to_xfer_patch (begp:endp)) ; this%livecrootc_storage_to_xfer_patch (:) = nan - allocate(this%deadcrootc_storage_to_xfer_patch (begp:endp)) ; this%deadcrootc_storage_to_xfer_patch (:) = nan - allocate(this%gresp_storage_to_xfer_patch (begp:endp)) ; this%gresp_storage_to_xfer_patch (:) = nan - allocate(this%livestemc_to_deadstemc_patch (begp:endp)) ; this%livestemc_to_deadstemc_patch (:) = nan - allocate(this%livecrootc_to_deadcrootc_patch (begp:endp)) ; this%livecrootc_to_deadcrootc_patch (:) = nan - allocate(this%current_gr_patch (begp:endp)) ; this%current_gr_patch (:) = nan - allocate(this%transfer_gr_patch (begp:endp)) ; this%transfer_gr_patch (:) = nan - allocate(this%storage_gr_patch (begp:endp)) ; this%storage_gr_patch (:) = nan - allocate(this%plant_calloc_patch (begp:endp)) ; this%plant_calloc_patch (:) = nan - allocate(this%excess_cflux_patch (begp:endp)) ; this%excess_cflux_patch (:) = nan - allocate(this%prev_leafc_to_litter_patch (begp:endp)) ; this%prev_leafc_to_litter_patch (:) = nan - allocate(this%prev_frootc_to_litter_patch (begp:endp)) ; this%prev_frootc_to_litter_patch (:) = nan - allocate(this%gpp_before_downreg_patch (begp:endp)) ; this%gpp_before_downreg_patch (:) = nan - allocate(this%availc_patch (begp:endp)) ; this%availc_patch (:) = nan - allocate(this%xsmrpool_recover_patch (begp:endp)) ; this%xsmrpool_recover_patch (:) = nan - allocate(this%xsmrpool_c13ratio_patch (begp:endp)) ; this%xsmrpool_c13ratio_patch (:) = nan - - allocate(this%cpool_to_grainc_patch (begp:endp)) ; this%cpool_to_grainc_patch (:) = nan - allocate(this%cpool_to_grainc_storage_patch (begp:endp)) ; this%cpool_to_grainc_storage_patch (:) = nan - allocate(this%livestemc_to_litter_patch (begp:endp)) ; this%livestemc_to_litter_patch (:) = nan - allocate(this%grainc_to_food_patch (begp:endp)) ; this%grainc_to_food_patch (:) = nan - allocate(this%grainc_to_seed_patch (begp:endp)) ; this%grainc_to_seed_patch (:) = nan - allocate(this%grainc_xfer_to_grainc_patch (begp:endp)) ; this%grainc_xfer_to_grainc_patch (:) = nan - allocate(this%cpool_grain_gr_patch (begp:endp)) ; this%cpool_grain_gr_patch (:) = nan - allocate(this%cpool_grain_storage_gr_patch (begp:endp)) ; this%cpool_grain_storage_gr_patch (:) = nan - allocate(this%transfer_grain_gr_patch (begp:endp)) ; this%transfer_grain_gr_patch (:) = nan - allocate(this%xsmrpool_to_atm_patch (begp:endp)) ; this%xsmrpool_to_atm_patch (:) = nan - allocate(this%grainc_storage_to_xfer_patch (begp:endp)) ; this%grainc_storage_to_xfer_patch (:) = nan - allocate(this%frootc_alloc_patch (begp:endp)) ; this%frootc_alloc_patch (:) = nan - allocate(this%frootc_loss_patch (begp:endp)) ; this%frootc_loss_patch (:) = nan - allocate(this%leafc_alloc_patch (begp:endp)) ; this%leafc_alloc_patch (:) = nan - allocate(this%leafc_loss_patch (begp:endp)) ; this%leafc_loss_patch (:) = nan - allocate(this%woodc_alloc_patch (begp:endp)) ; this%woodc_alloc_patch (:) = nan - allocate(this%woodc_loss_patch (begp:endp)) ; this%woodc_loss_patch (:) = nan - - allocate(this%phenology_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); - this%phenology_c_to_litr_met_c_col (:,:)=nan - - allocate(this%phenology_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%phenology_c_to_litr_cel_c_col (:,:)=nan - allocate(this%phenology_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%phenology_c_to_litr_lig_c_col (:,:)=nan - - allocate(this%gap_mortality_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_met_c_col(:,:)=nan - allocate(this%gap_mortality_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_cel_c_col(:,:)=nan - allocate(this%gap_mortality_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_litr_lig_c_col(:,:)=nan - - allocate(this%gap_mortality_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%gap_mortality_c_to_cwdc_col (:,:)=nan - allocate(this%fire_mortality_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%fire_mortality_c_to_cwdc_col (:,:)=nan - allocate(this%m_c_to_litr_met_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_met_fire_col (:,:)=nan - allocate(this%m_c_to_litr_cel_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_cel_fire_col (:,:)=nan - allocate(this%m_c_to_litr_lig_fire_col (begc:endc,1:nlevdecomp_full)); this%m_c_to_litr_lig_fire_col (:,:)=nan - allocate(this%harvest_c_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_met_c_col (:,:)=nan - allocate(this%harvest_c_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_cel_c_col (:,:)=nan - allocate(this%harvest_c_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_litr_lig_c_col (:,:)=nan - allocate(this%harvest_c_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%harvest_c_to_cwdc_col (:,:)=nan - - allocate(this%dwt_slash_cflux_col (begc:endc)) ; this%dwt_slash_cflux_col (:) =nan - allocate(this%dwt_frootc_to_litr_met_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_met_c_col (:,:)=nan - allocate(this%dwt_frootc_to_litr_cel_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_cel_c_col (:,:)=nan - allocate(this%dwt_frootc_to_litr_lig_c_col (begc:endc,1:nlevdecomp_full)); this%dwt_frootc_to_litr_lig_c_col (:,:)=nan - allocate(this%dwt_livecrootc_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%dwt_livecrootc_to_cwdc_col (:,:)=nan - allocate(this%dwt_deadcrootc_to_cwdc_col (begc:endc,1:nlevdecomp_full)); this%dwt_deadcrootc_to_cwdc_col (:,:)=nan - - allocate(this%dwt_seedc_to_leaf_patch (begp:endp)) ; this%dwt_seedc_to_leaf_patch (:) =nan - allocate(this%dwt_seedc_to_leaf_grc (begg:endg)) ; this%dwt_seedc_to_leaf_grc (:) =nan - allocate(this%dwt_seedc_to_deadstem_patch (begp:endp)) ; this%dwt_seedc_to_deadstem_patch(:) =nan - allocate(this%dwt_seedc_to_deadstem_grc (begg:endg)) ; this%dwt_seedc_to_deadstem_grc (:) =nan - allocate(this%dwt_conv_cflux_patch (begp:endp)) ; this%dwt_conv_cflux_patch (:) =nan - allocate(this%dwt_conv_cflux_grc (begg:endg)) ; this%dwt_conv_cflux_grc (:) =nan - allocate(this%dwt_conv_cflux_dribbled_grc (begg:endg)) ; this%dwt_conv_cflux_dribbled_grc(:) =nan - allocate(this%dwt_wood_productc_gain_patch (begp:endp)) ; this%dwt_wood_productc_gain_patch(:) =nan - allocate(this%dwt_crop_productc_gain_patch (begp:endp)) ; this%dwt_crop_productc_gain_patch(:) =nan - - allocate(this%crop_seedc_to_leaf_patch (begp:endp)) ; this%crop_seedc_to_leaf_patch (:) =nan - - allocate(this%cwdc_hr_col (begc:endc)) ; this%cwdc_hr_col (:) =nan - allocate(this%cwdc_loss_col (begc:endc)) ; this%cwdc_loss_col (:) =nan - allocate(this%litterc_loss_col (begc:endc)) ; this%litterc_loss_col (:) =nan - - allocate(this%grainc_to_cropprodc_patch(begp:endp)) - this%grainc_to_cropprodc_patch(:) = nan - - allocate(this%grainc_to_cropprodc_col(begc:endc)) - this%grainc_to_cropprodc_col(:) = nan - - allocate(this%m_decomp_cpools_to_fire_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%m_decomp_cpools_to_fire_vr_col(:,:,:)= nan - - allocate(this%m_decomp_cpools_to_fire_col(begc:endc,1:ndecomp_pools)) - this%m_decomp_cpools_to_fire_col(:,:)= nan - - allocate(this%m_decomp_cpools_to_fire_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%m_decomp_cpools_to_fire_vr_col(:,:,:)= nan - - allocate(this%m_decomp_cpools_to_fire_col(begc:endc,1:ndecomp_pools)) - this%m_decomp_cpools_to_fire_col(:,:)= nan - - allocate(this%rr_patch (begp:endp)) ; this%rr_patch (:) = nan - allocate(this%mr_patch (begp:endp)) ; this%mr_patch (:) = nan - allocate(this%gr_patch (begp:endp)) ; this%gr_patch (:) = nan - allocate(this%ar_patch (begp:endp)) ; this%ar_patch (:) = nan - allocate(this%npp_patch (begp:endp)) ; this%npp_patch (:) = nan - allocate(this%agnpp_patch (begp:endp)) ; this%agnpp_patch (:) = nan - allocate(this%bgnpp_patch (begp:endp)) ; this%bgnpp_patch (:) = nan - allocate(this%litfall_patch (begp:endp)) ; this%litfall_patch (:) = nan - allocate(this%wood_harvestc_patch (begp:endp)) ; this%wood_harvestc_patch (:) = nan - allocate(this%slash_harvestc_patch (begp:endp)) ; this%slash_harvestc_patch (:) = nan - allocate(this%cinputs_patch (begp:endp)) ; this%cinputs_patch (:) = nan - allocate(this%coutputs_patch (begp:endp)) ; this%coutputs_patch (:) = nan - allocate(this%gpp_patch (begp:endp)) ; this%gpp_patch (:) = nan - allocate(this%fire_closs_patch (begp:endp)) ; this%fire_closs_patch (:) = nan - allocate(this%sr_col (begc:endc)) ; this%sr_col (:) = nan - allocate(this%er_col (begc:endc)) ; this%er_col (:) = nan - allocate(this%litfire_col (begc:endc)) ; this%litfire_col (:) = nan - allocate(this%somfire_col (begc:endc)) ; this%somfire_col (:) = nan - allocate(this%totfire_col (begc:endc)) ; this%totfire_col (:) = nan - allocate(this%rr_col (begc:endc)) ; this%rr_col (:) = nan - allocate(this%ar_col (begc:endc)) ; this%ar_col (:) = nan - allocate(this%gpp_col (begc:endc)) ; this%gpp_col (:) = nan - allocate(this%npp_col (begc:endc)) ; this%npp_col (:) = nan - allocate(this%fire_closs_p2c_col (begc:endc)) ; this%fire_closs_p2c_col (:) = nan - allocate(this%fire_closs_col (begc:endc)) ; this%fire_closs_col (:) = nan - allocate(this%wood_harvestc_col (begc:endc)) ; this%wood_harvestc_col (:) = nan - allocate(this%hrv_xsmrpool_to_atm_col (begc:endc)) ; this%hrv_xsmrpool_to_atm_col (:) = nan - allocate(this%tempsum_npp_patch (begp:endp)) ; this%tempsum_npp_patch (:) = nan - allocate(this%annsum_npp_patch (begp:endp)) ; this%annsum_npp_patch (:) = nan - allocate(this%tempsum_litfall_patch (begp:endp)) ; this%tempsum_litfall_patch (:) = nan - allocate(this%annsum_litfall_patch (begp:endp)) ; this%annsum_litfall_patch (:) = nan - allocate(this%annsum_npp_col (begc:endc)) ; this%annsum_npp_col (:) = nan - allocate(this%lag_npp_col (begc:endc)) ; this%lag_npp_col (:) = spval - - allocate(this%nep_col (begc:endc)) ; this%nep_col (:) = nan - allocate(this%nbp_grc (begg:endg)) ; this%nbp_grc (:) = nan - allocate(this%nee_grc (begg:endg)) ; this%nee_grc (:) = nan - allocate(this%landuseflux_grc (begg:endg)) ; this%landuseflux_grc (:) = nan - allocate(this%npp_Nactive_patch (begp:endp)) ; this%npp_Nactive_patch (:) = nan - allocate(this%npp_burnedoff_patch (begp:endp)) ; this%npp_burnedoff_patch (:) = nan - allocate(this%npp_Nnonmyc_patch (begp:endp)) ; this%npp_Nnonmyc_patch (:) = nan - allocate(this%npp_Nam_patch (begp:endp)) ; this%npp_Nam_patch (:) = nan - allocate(this%npp_Necm_patch (begp:endp)) ; this%npp_Necm_patch (:) = nan - allocate(this%npp_Nactive_no3_patch (begp:endp)) ; this%npp_Nactive_no3_patch (:) = nan - allocate(this%npp_Nactive_nh4_patch (begp:endp)) ; this%npp_Nactive_nh4_patch (:) = nan - allocate(this%npp_Nnonmyc_no3_patch (begp:endp)) ; this%npp_Nnonmyc_no3_patch (:) = nan - allocate(this%npp_Nnonmyc_nh4_patch (begp:endp)) ; this%npp_Nnonmyc_nh4_patch (:) = nan - allocate(this%npp_Nam_no3_patch (begp:endp)) ; this%npp_Nam_no3_patch (:) = nan - allocate(this%npp_Nam_nh4_patch (begp:endp)) ; this%npp_Nam_nh4_patch (:) = nan - allocate(this%npp_Necm_no3_patch (begp:endp)) ; this%npp_Necm_no3_patch (:) = nan - allocate(this%npp_Necm_nh4_patch (begp:endp)) ; this%npp_Necm_nh4_patch (:) = nan - allocate(this%npp_Nfix_patch (begp:endp)) ; this%npp_Nfix_patch (:) = nan - allocate(this%npp_Nretrans_patch (begp:endp)) ; this%npp_Nretrans_patch (:) = nan - allocate(this%npp_Nuptake_patch (begp:endp)) ; this%npp_Nuptake_patch (:) = nan - allocate(this%npp_growth_patch (begp:endp)) ; this%npp_growth_patch (:) = nan - allocate(this%leafc_change_patch (begp:endp)) ; this%leafc_change_patch (:) = nan - allocate(this%soilc_change_patch (begp:endp)) ; this%soilc_change_patch (:) = nan - - ! Construct restart field names consistently to what is done in SpeciesNonIsotope & - ! SpeciesIsotope, to aid future migration to that infrastructure - if (carbon_type == 'c12') then - carbon_type_suffix = 'c' - else if (carbon_type == 'c13') then - carbon_type_suffix = 'c_13' - else if (carbon_type == 'c14') then - carbon_type_suffix = 'c_14' - else - write(iulog,*) 'CNVegCarbonFluxType InitAllocate: Unknown carbon_type: ', trim(carbon_type) - call endrun(msg='CNVegCarbonFluxType InitAllocate: Unknown carbon_type: ' // & - errMsg(sourcefile, __LINE__)) - end if - - ! Note that, for both of these dribblers, we set allows_non_annual_delta to false - ! because we expect both land cover change and harvest to be applied entirely at the - ! start of the year, and want to be notified if this changes. If this behavior is - ! changed intentionally, then this setting of allows_non_annual_delta to .false. can - ! safely be removed. - ! - ! However, we do keep allows_non_annual_delta = .true. for the dwt_conv_cflux_dribbler if - ! running with CNDV, because (in contrast with other land cover change) CNDV currently - ! still interpolates land cover change throughout the year. - if (get_for_testing_allow_non_annual_changes()) then - allows_non_annual_delta = .true. - else if (use_cndv) then - allows_non_annual_delta = .true. - else - allows_non_annual_delta = .false. - end if - this%dwt_conv_cflux_dribbler = annual_flux_dribbler_gridcell( & - bounds = bounds, & - name = 'dwt_conv_flux_' // carbon_type_suffix, & - units = 'gC/m^2', & - allows_non_annual_delta = allows_non_annual_delta) - this%hrv_xsmrpool_to_atm_dribbler = annual_flux_dribbler_gridcell( & - bounds = bounds, & - name = 'hrv_xsmrpool_to_atm_' // carbon_type_suffix, & - units = 'gC/m^2', & - allows_non_annual_delta = .false.) - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, carbon_type) - ! - ! !DESCRIPTION: - ! add history fields for all CN variables, always set as default='inactive' - ! - ! !USES: - use clm_varpar , only : nlevdecomp, nlevdecomp_full, nlevgrnd - use clm_varctl , only : hist_wrtch4diag - use CNSharedParamsMod, only: use_fun - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class(cnveg_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - ! - ! !LOCAL VARIABLES: - integer :: k,l,ii,jj - character(8) :: vr_suffix - character(10) :: active - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - real(r8), pointer :: data2dptr(:,:) ! temp. pointer for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - !------------------------------- - ! C flux variables - patch - !------------------------------- - - if (carbon_type == 'c12') then - - if (use_crop) then - this%grainc_to_food_patch(begp:endp) = spval - call hist_addfld1d (fname='GRAINC_TO_FOOD', units='gC/m^2/s', & - avgflag='A', long_name='grain C to food', & - ptr_patch=this%grainc_to_food_patch) - - this%grainc_to_seed_patch(begp:endp) = spval - call hist_addfld1d (fname='GRAINC_TO_SEED', units='gC/m^2/s', & - avgflag='A', long_name='grain C to seed', & - ptr_patch=this%grainc_to_seed_patch) - end if - - this%litterc_loss_col(begc:endc) = spval - call hist_addfld1d (fname='LITTERC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='litter C loss', & - ptr_col=this%litterc_loss_col) - - this%woodc_alloc_patch(begp:endp) = spval - call hist_addfld1d (fname='WOODC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='wood C eallocation', & - ptr_patch=this%woodc_alloc_patch) - - this%woodc_loss_patch(begp:endp) = spval - call hist_addfld1d (fname='WOODC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='wood C loss', & - ptr_patch=this%woodc_loss_patch) - - this%leafc_loss_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='leaf C loss', & - ptr_patch=this%leafc_loss_patch) - - this%leafc_alloc_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='leaf C allocation', & - ptr_patch=this%leafc_alloc_patch) - - this%frootc_loss_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='fine root C loss', & - ptr_patch=this%frootc_loss_patch) - - this%frootc_alloc_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='fine root C allocation', & - ptr_patch=this%frootc_alloc_patch) - - this%m_leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C mortality', & - ptr_patch=this%m_leafc_to_litter_patch, default='inactive') - - this%m_frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C mortality', & - ptr_patch=this%m_frootc_to_litter_patch, default='inactive') - - this%m_leafc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C storage mortality', & - ptr_patch=this%m_leafc_storage_to_litter_patch, default='inactive') - - this%m_frootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage mortality', & - ptr_patch=this%m_frootc_storage_to_litter_patch, default='inactive') - - this%m_livestemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage mortality', & - ptr_patch=this%m_livestemc_storage_to_litter_patch, default='inactive') - - this%m_deadstemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage mortality', & - ptr_patch=this%m_deadstemc_storage_to_litter_patch, default='inactive') - - this%m_livecrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C storage mortality', & - ptr_patch=this%m_livecrootc_storage_to_litter_patch, default='inactive') - - this%m_deadcrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C storage mortality', & - ptr_patch=this%m_deadcrootc_storage_to_litter_patch, default='inactive') - - this%m_leafc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer mortality', & - ptr_patch=this%m_leafc_xfer_to_litter_patch, default='inactive') - - this%m_frootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer mortality', & - ptr_patch=this%m_frootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer mortality', & - ptr_patch=this%m_livestemc_xfer_to_litter_patch, default='inactive') - - this%m_deadstemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer mortality', & - ptr_patch=this%m_deadstemc_xfer_to_litter_patch, default='inactive') - - this%m_livecrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C transfer mortality', & - ptr_patch=this%m_livecrootc_xfer_to_litter_patch, default='inactive') - - this%m_deadcrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C transfer mortality', & - ptr_patch=this%m_deadcrootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C mortality', & - ptr_patch=this%m_livestemc_to_litter_patch, default='inactive') - - this%m_deadstemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C mortality', & - ptr_patch=this%m_deadstemc_to_litter_patch, default='inactive') - - this%m_livecrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C mortality', & - ptr_patch=this%m_livecrootc_to_litter_patch, default='inactive') - - this%m_deadcrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C mortality', & - ptr_patch=this%m_deadcrootc_to_litter_patch, default='inactive') - - this%m_gresp_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage mortality', & - ptr_patch=this%m_gresp_storage_to_litter_patch, default='inactive') - - this%m_gresp_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer mortality', & - ptr_patch=this%m_gresp_xfer_to_litter_patch, default='inactive') - - this%m_leafc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C fire loss', & - ptr_patch=this%m_leafc_to_fire_patch, default='inactive') - - this%m_leafc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C storage fire loss', & - ptr_patch=this%m_leafc_storage_to_fire_patch, default='inactive') - - this%m_leafc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer fire loss', & - ptr_patch=this%m_leafc_xfer_to_fire_patch, default='inactive') - - this%m_livestemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C fire loss', & - ptr_patch=this%m_livestemc_to_fire_patch, default='inactive') - - this%m_livestemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage fire loss', & - ptr_patch=this%m_livestemc_storage_to_fire_patch, default='inactive') - - this%m_livestemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer fire loss', & - ptr_patch=this%m_livestemc_xfer_to_fire_patch, default='inactive') - - this%m_deadstemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C fire loss', & - ptr_patch=this%m_deadstemc_to_fire_patch, default='inactive') - - this%m_deadstemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage fire loss', & - ptr_patch=this%m_deadstemc_storage_to_fire_patch, default='inactive') - - this%m_deadstemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer fire loss', & - ptr_patch=this%m_deadstemc_xfer_to_fire_patch, default='inactive') - - this%m_frootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C fire loss', & - ptr_patch=this%m_frootc_to_fire_patch, default='inactive') - - this%m_frootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage fire loss', & - ptr_patch=this%m_frootc_storage_to_fire_patch, default='inactive') - - this%m_frootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer fire loss', & - ptr_patch=this%m_frootc_xfer_to_fire_patch, default='inactive') - - this%m_livecrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C fire loss', & - ptr_patch=this%m_livecrootc_to_fire_patch, default='inactive') - - this%m_livecrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C storage fire loss', & - ptr_patch=this%m_livecrootc_storage_to_fire_patch, default='inactive') - - this%m_livecrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C transfer fire loss', & - ptr_patch=this%m_livecrootc_xfer_to_fire_patch, default='inactive') - - this%m_deadcrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C fire loss', & - ptr_patch=this%m_deadcrootc_to_fire_patch, default='inactive') - - this%m_deadcrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C storage fire loss', & - ptr_patch=this%m_deadcrootc_storage_to_fire_patch, default='inactive') - - this%m_deadcrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C transfer fire loss', & - ptr_patch=this%m_deadcrootc_xfer_to_fire_patch, default='inactive') - - this%m_gresp_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage fire loss', & - ptr_patch=this%m_gresp_storage_to_fire_patch, default='inactive') - - this%m_gresp_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer fire loss', & - ptr_patch=this%m_gresp_xfer_to_fire_patch, default='inactive') - - this%m_leafc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C fire mortality to litter', & - ptr_patch=this%m_leafc_to_litter_fire_patch, default='inactive') - - ! add by F. Li and S. Levis - this%m_leafc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C fire mortality to litter', & - ptr_patch=this%m_leafc_storage_to_litter_fire_patch, default='inactive') - - this%m_leafc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer fire mortality to litter', & - ptr_patch=this%m_leafc_xfer_to_litter_fire_patch, default='inactive') - - this%m_livestemc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C fire mortality to litter', & - ptr_patch=this%m_livestemc_to_litter_fire_patch, default='inactive') - - this%m_livestemc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage fire mortality to litter', & - ptr_patch=this%m_livestemc_storage_to_litter_fire_patch, default='inactive') - - this%m_livestemc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer fire mortality to litter', & - ptr_patch=this%m_livestemc_xfer_to_litter_fire_patch, default='inactive') - - this%m_livestemc_to_deadstemc_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMC_TO_DEADSTEMC_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C fire mortality to dead stem C', & - ptr_patch=this%m_livestemc_to_deadstemc_fire_patch, default='inactive') - - this%m_deadstemc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C fire mortality to litter', & - ptr_patch=this%m_deadstemc_to_litter_fire_patch, default='inactive') - - this%m_deadstemc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage fire mortality to litter', & - ptr_patch=this%m_deadstemc_storage_to_litter_fire_patch, default='inactive') - - this%m_deadstemc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer fire mortality to litter', & - ptr_patch=this%m_deadstemc_xfer_to_litter_fire_patch, default='inactive') - - this%m_frootc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C fire mortality to litter', & - ptr_patch=this%m_frootc_to_litter_fire_patch, default='inactive') - - this%m_frootc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage fire mortality to litter', & - ptr_patch=this%m_frootc_storage_to_litter_fire_patch, default='inactive') - - this%m_frootc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer fire mortality to litter', & - ptr_patch=this%m_frootc_xfer_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C fire mortality to litter', & - ptr_patch=this%m_livecrootc_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C storage fire mortality to litter', & - ptr_patch=this%m_livecrootc_storage_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C transfer fire mortality to litter', & - ptr_patch=this%m_livecrootc_xfer_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_to_deadcrootc_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVEROOTC_TO_DEADROOTC_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live root C fire mortality to dead root C', & - ptr_patch=this%m_livecrootc_to_deadcrootc_fire_patch, default='inactive') - - - this%m_deadcrootc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C fire mortality to litter', & - ptr_patch=this%m_deadcrootc_to_litter_fire_patch, default='inactive') - - this%m_deadcrootc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C storage fire mortality to litter', & - ptr_patch=this%m_deadcrootc_storage_to_litter_fire_patch, default='inactive') - - this%m_deadcrootc_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADROOTC_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead root C transfer fire mortality to litter', & - ptr_patch=this%m_deadcrootc_xfer_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C fire mortality to litter', & - ptr_patch=this%m_livecrootc_storage_to_litter_fire_patch, default='inactive') - - this%m_deadcrootc_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTC_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C storage fire mortality to litter', & - ptr_patch=this%m_deadcrootc_storage_to_litter_fire_patch, default='inactive') - - this%m_gresp_storage_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage fire mortality to litter', & - ptr_patch=this%m_gresp_storage_to_litter_fire_patch, default='inactive') - - this%m_gresp_xfer_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_GRESP_XFER_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer fire mortality to litter', & - ptr_patch=this%m_gresp_xfer_to_litter_fire_patch, default='inactive') - - this%leafc_xfer_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_XFER_TO_LEAFC', units='gC/m^2/s', & - avgflag='A', long_name='leaf C growth from storage', & - ptr_patch=this%leafc_xfer_to_leafc_patch, default='inactive') - - this%frootc_xfer_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_XFER_TO_FROOTC', units='gC/m^2/s', & - avgflag='A', long_name='fine root C growth from storage', & - ptr_patch=this%frootc_xfer_to_frootc_patch, default='inactive') - - this%livestemc_xfer_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC_XFER_TO_LIVESTEMC', units='gC/m^2/s', & - avgflag='A', long_name='live stem C growth from storage', & - ptr_patch=this%livestemc_xfer_to_livestemc_patch, default='inactive') - - this%deadstemc_xfer_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMC_XFER_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C growth from storage', & - ptr_patch=this%deadstemc_xfer_to_deadstemc_patch, default='inactive') - - this%livecrootc_xfer_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC_XFER_TO_LIVECROOTC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C growth from storage', & - ptr_patch=this%livecrootc_xfer_to_livecrootc_patch, default='inactive') - - this%deadcrootc_xfer_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTC_XFER_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C growth from storage', & - ptr_patch=this%deadcrootc_xfer_to_deadcrootc_patch, default='inactive') - - this%leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall', & - ptr_patch=this%leafc_to_litter_patch, default='inactive') - - if ( use_fun ) then - this%leafc_to_litter_fun_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_TO_LITTER_FUN', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall used by FUN', & - ptr_patch=this%leafc_to_litter_fun_patch) - end if - - this%frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C litterfall', & - ptr_patch=this%frootc_to_litter_patch, default='inactive') - - this%cpool_to_resp_patch(begp:endp) = spval - call hist_addfld1d (fname='EXCESSC_MR', units='gC/m^2/s', & - avgflag='A', long_name='excess C maintenance respiration', & - ptr_patch=this%cpool_to_resp_patch, default='inactive') - this%leaf_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAF_MR', units='gC/m^2/s', & - avgflag='A', long_name='leaf maintenance respiration', & - ptr_patch=this%leaf_mr_patch) - - this%froot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOT_MR', units='gC/m^2/s', & - avgflag='A', long_name='fine root maintenance respiration', & - ptr_patch=this%froot_mr_patch, default='inactive') - - this%livestem_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEM_MR', units='gC/m^2/s', & - avgflag='A', long_name='live stem maintenance respiration', & - ptr_patch=this%livestem_mr_patch, default='inactive') - - this%livecroot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOT_MR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root maintenance respiration', & - ptr_patch=this%livecroot_mr_patch, default='inactive') - - this%psnsun_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='PSNSUN_TO_CPOOL', units='gC/m^2/s', & - avgflag='A', long_name='C fixation from sunlit canopy', & - ptr_patch=this%psnsun_to_cpool_patch) - - this%psnshade_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='PSNSHADE_TO_CPOOL', units='gC/m^2/s', & - avgflag='A', long_name='C fixation from shaded canopy', & - ptr_patch=this%psnshade_to_cpool_patch) - - this%cpool_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LEAFC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to leaf C', & - ptr_patch=this%cpool_to_leafc_patch, default='inactive') - - this%cpool_to_leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LEAFC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to leaf C storage', & - ptr_patch=this%cpool_to_leafc_storage_patch, default='inactive') - - this%cpool_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_FROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to fine root C', & - ptr_patch=this%cpool_to_frootc_patch, default='inactive') - - this%cpool_to_frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_FROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to fine root C storage', & - ptr_patch=this%cpool_to_frootc_storage_patch, default='inactive') - - this%cpool_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LIVESTEMC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live stem C', & - ptr_patch=this%cpool_to_livestemc_patch, default='inactive') - - this%cpool_to_livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LIVESTEMC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live stem C storage', & - ptr_patch=this%cpool_to_livestemc_storage_patch, default='inactive') - - this%cpool_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead stem C', & - ptr_patch=this%cpool_to_deadstemc_patch, default='inactive') - - this%cpool_to_deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_DEADSTEMC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead stem C storage', & - ptr_patch=this%cpool_to_deadstemc_storage_patch, default='inactive') - - this%cpool_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LIVECROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live coarse root C', & - ptr_patch=this%cpool_to_livecrootc_patch, default='inactive') - - this%cpool_to_livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_LIVECROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live coarse root C storage', & - ptr_patch=this%cpool_to_livecrootc_storage_patch, default='inactive') - - this%cpool_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root C', & - ptr_patch=this%cpool_to_deadcrootc_patch, default='inactive') - - this%cpool_to_deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_DEADCROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root C storage', & - ptr_patch=this%cpool_to_deadcrootc_storage_patch, default='inactive') - - this%cpool_to_gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_TO_GRESP_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to growth respiration storage', & - ptr_patch=this%cpool_to_gresp_storage_patch, default='inactive') - - this%cpool_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LEAF_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration', & - ptr_patch=this%cpool_leaf_gr_patch, default='inactive') - - this%cpool_leaf_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LEAF_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration to storage', & - ptr_patch=this%cpool_leaf_storage_gr_patch, default='inactive') - - this%transfer_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_LEAF_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration from storage', & - ptr_patch=this%transfer_leaf_gr_patch, default='inactive') - - this%cpool_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_FROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration', & - ptr_patch=this%cpool_froot_gr_patch, default='inactive') - - this%cpool_froot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_FROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration to storage', & - ptr_patch=this%cpool_froot_storage_gr_patch, default='inactive') - - this%transfer_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_FROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration from storage', & - ptr_patch=this%transfer_froot_gr_patch, default='inactive') - - this%cpool_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LIVESTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration', & - ptr_patch=this%cpool_livestem_gr_patch, default='inactive') - - this%cpool_livestem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LIVESTEM_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration to storage', & - ptr_patch=this%cpool_livestem_storage_gr_patch, default='inactive') - - this%transfer_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_LIVESTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration from storage', & - ptr_patch=this%transfer_livestem_gr_patch, default='inactive') - - this%cpool_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_DEADSTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration', & - ptr_patch=this%cpool_deadstem_gr_patch, default='inactive') - - this%cpool_deadstem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_DEADSTEM_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration to storage', & - ptr_patch=this%cpool_deadstem_storage_gr_patch, default='inactive') - - this%transfer_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_DEADSTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration from storage', & - ptr_patch=this%transfer_deadstem_gr_patch, default='inactive') - - this%cpool_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LIVECROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration', & - ptr_patch=this%cpool_livecroot_gr_patch, default='inactive') - - this%cpool_livecroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_LIVECROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration to storage', & - ptr_patch=this%cpool_livecroot_storage_gr_patch, default='inactive') - - this%transfer_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_LIVECROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration from storage', & - ptr_patch=this%transfer_livecroot_gr_patch, default='inactive') - - this%cpool_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_DEADCROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration', & - ptr_patch=this%cpool_deadcroot_gr_patch, default='inactive') - - this%cpool_deadcroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL_DEADCROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration to storage', & - ptr_patch=this%cpool_deadcroot_storage_gr_patch, default='inactive') - - this%transfer_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_DEADCROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration from storage', & - ptr_patch=this%transfer_deadcroot_gr_patch, default='inactive') - - this%leafc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C shift storage to transfer', & - ptr_patch=this%leafc_storage_to_xfer_patch, default='inactive') - - this%frootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C shift storage to transfer', & - ptr_patch=this%frootc_storage_to_xfer_patch, default='inactive') - - this%livestemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C shift storage to transfer', & - ptr_patch=this%livestemc_storage_to_xfer_patch, default='inactive') - - this%deadstemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C shift storage to transfer', & - ptr_patch=this%deadstemc_storage_to_xfer_patch, default='inactive') - - this%livecrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C shift storage to transfer', & - ptr_patch=this%livecrootc_storage_to_xfer_patch, default='inactive') - - this%deadcrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C shift storage to transfer', & - ptr_patch=this%deadcrootc_storage_to_xfer_patch, default='inactive') - - this%gresp_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='GRESP_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration shift storage to transfer', & - ptr_patch=this%gresp_storage_to_xfer_patch, default='inactive') - - this%livestemc_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='live stem C turnover', & - ptr_patch=this%livestemc_to_deadstemc_patch, default='inactive') - - this%livecrootc_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C turnover', & - ptr_patch=this%livecrootc_to_deadcrootc_patch, default='inactive') - - this%gpp_before_downreg_patch(begp:endp) = spval - call hist_addfld1d (fname='INIT_GPP', units='gC/m^2/s', & - avgflag='A', long_name='GPP flux before downregulation', & - ptr_patch=this%gpp_before_downreg_patch, default='inactive') - - this%current_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='CURRENT_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for new growth displayed in this timestep', & - ptr_patch=this%current_gr_patch, default='inactive') - - this%transfer_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='TRANSFER_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for transfer growth displayed in this timestep', & - ptr_patch=this%transfer_gr_patch, default='inactive') - - this%storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for growth sent to storage for later display', & - ptr_patch=this%storage_gr_patch, default='inactive') - - this%availc_patch(begp:endp) = spval - call hist_addfld1d (fname='AVAILC', units='gC/m^2/s', & - avgflag='A', long_name='C flux available for allocation', & - ptr_patch=this%availc_patch, default='inactive') - - this%plant_calloc_patch(begp:endp) = spval - call hist_addfld1d (fname='PLANT_CALLOC', units='gC/m^2/s', & - avgflag='A', long_name='total allocated C flux', & - ptr_patch=this%plant_calloc_patch, default='inactive') - - this%excess_cflux_patch(begp:endp) = spval - call hist_addfld1d (fname='EXCESS_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='C flux not allocated due to downregulation', & - ptr_patch=this%excess_cflux_patch, default='inactive') - - this%prev_leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='PREV_LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='previous timestep leaf C litterfall flux', & - ptr_patch=this%prev_leafc_to_litter_patch, default='inactive') - - this%prev_frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='PREV_FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='previous timestep froot C litterfall flux', & - ptr_patch=this%prev_frootc_to_litter_patch, default='inactive') - - this%xsmrpool_recover_patch(begp:endp) = spval - call hist_addfld1d (fname='XSMRPOOL_RECOVER', units='gC/m^2/s', & - avgflag='A', long_name='C flux assigned to recovery of negative xsmrpool', & - ptr_patch=this%xsmrpool_recover_patch) - - this%gpp_patch(begp:endp) = spval - call hist_addfld1d (fname='GPP', units='gC/m^2/s', & - avgflag='A', long_name='gross primary production', & - ptr_patch=this%gpp_patch) - - this%rr_patch(begp:endp) = spval - call hist_addfld1d (fname='RR', units='gC/m^2/s', & - avgflag='A', long_name='root respiration (fine root MR + total root GR)', & - ptr_patch=this%rr_patch) - - this%mr_patch(begp:endp) = spval - call hist_addfld1d (fname='MR', units='gC/m^2/s', & - avgflag='A', long_name='maintenance respiration', & - ptr_patch=this%mr_patch) - - this%gr_patch(begp:endp) = spval - call hist_addfld1d (fname='GR', units='gC/m^2/s', & - avgflag='A', long_name='total growth respiration', & - ptr_patch=this%gr_patch) - - this%ar_patch(begp:endp) = spval - call hist_addfld1d (fname='AR', units='gC/m^2/s', & - avgflag='A', long_name='autotrophic respiration (MR + GR)', & - ptr_patch=this%ar_patch) - - this%npp_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP', units='gC/m^2/s', & - avgflag='A', long_name='net primary production', & - ptr_patch=this%npp_patch) - - this%agnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='AGNPP', units='gC/m^2/s', & - avgflag='A', long_name='aboveground NPP', & - ptr_patch=this%agnpp_patch) - - this%bgnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='BGNPP', units='gC/m^2/s', & - avgflag='A', long_name='belowground NPP', & - ptr_patch=this%bgnpp_patch) - - this%litfall_patch(begp:endp) = spval - call hist_addfld1d (fname='LITFALL', units='gC/m^2/s', & - avgflag='A', long_name='litterfall (leaves and fine roots)', & - ptr_patch=this%litfall_patch) - - this%wood_harvestc_patch(begp:endp) = spval - call hist_addfld1d (fname='WOOD_HARVESTC', units='gC/m^2/s', & - avgflag='A', long_name='wood harvest carbon (to product pools)', & - ptr_patch=this%wood_harvestc_patch) - - this%slash_harvestc_patch(begp:endp) = spval - call hist_addfld1d (fname='SLASH_HARVESTC', units='gC/m^2/s', & - avgflag='A', long_name='slash harvest carbon (to litter)', & - ptr_patch=this%slash_harvestc_patch) - - this%fire_closs_patch(begp:endp) = spval - call hist_addfld1d (fname='PFT_FIRE_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total patch-level fire C loss for non-peat fires outside land-type converted region', & - ptr_patch=this%fire_closs_patch) - - if ( use_fun ) then - this%npp_Nactive_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NACTIVE', units='gC/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake used C', & - ptr_patch=this%npp_Nactive_patch) - - ! BUG(wjs, 2016-04-13, bugz 2292) This field has a threading bug. Making it - ! inactive for now. - this%npp_burnedoff_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_BURNEDOFF', units='gC/m^2/s', & - avgflag='A', long_name='C that cannot be used for N uptake', & - ptr_patch=this%npp_burnedoff_patch, default='inactive') - - this%npp_Nnonmyc_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NNONMYC', units='gC/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake used C', & - ptr_patch=this%npp_Nnonmyc_patch) - - this%npp_Nam_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NAM', units='gC/m^2/s', & - avgflag='A', long_name='AM-associated N uptake used C', & - ptr_patch=this%npp_Nam_patch) - - this%npp_Necm_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NECM', units='gC/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake used C', & - ptr_patch=this%npp_Necm_patch) - - if (use_nitrif_denitrif) then - this%npp_Nactive_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NACTIVE_NO3', units='gC/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake used C', & - ptr_patch=this%npp_Nactive_no3_patch) - - this%npp_Nactive_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NACTIVE_NH4', units='gC/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake use C', & - ptr_patch=this%npp_Nactive_nh4_patch) - - this%npp_Nnonmyc_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NNONMYC_NO3', units='gC/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake use C', & - ptr_patch=this%npp_Nnonmyc_no3_patch) - - this%npp_Nnonmyc_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NNONMYC_NH4', units='gC/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake use C', & - ptr_patch=this%npp_Nnonmyc_nh4_patch) - - this%npp_Nam_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NAM_NO3', units='gC/m^2/s', & - avgflag='A', long_name='AM-associated N uptake use C', & - ptr_patch=this%npp_Nam_no3_patch) - - this%npp_Nam_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NAM_NH4', units='gC/m^2/s', & - avgflag='A', long_name='AM-associated N uptake use C', & - ptr_patch=this%npp_Nam_nh4_patch) - - this%npp_Necm_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NECM_NO3', units='gC/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake used C', & - ptr_patch=this%npp_Necm_no3_patch) - - this%npp_Necm_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NECM_NH4', units='gC/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake use C', & - ptr_patch=this%npp_Necm_nh4_patch) - end if - - this%npp_Nfix_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NFIX', units='gC/m^2/s', & - avgflag='A', long_name='Symbiotic BNF uptake used C', & - ptr_patch=this%npp_Nfix_patch) - - this%npp_Nretrans_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NRETRANS', units='gC/m^2/s', & - avgflag='A', long_name='Retranslocated N uptake flux', & - ptr_patch=this%npp_Nretrans_patch) - - this%npp_Nuptake_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_NUPTAKE', units='gC/m^2/s', & - avgflag='A', long_name='Total C used by N uptake in FUN', & - ptr_patch=this%npp_Nuptake_patch) - - this%npp_growth_patch(begp:endp) = spval - call hist_addfld1d (fname='NPP_GROWTH', units='gC/m^2/s', & - avgflag='A', long_name='Total C used for growth in FUN', & - ptr_patch=this%npp_growth_patch) - - this%leafc_change_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_CHANGE', units='gC/m^2/s', & - avgflag='A', long_name='C change in leaf', & - ptr_patch=this%leafc_change_patch) - - this%soilc_change_patch(begp:endp) = spval - call hist_addfld1d (fname='SOILC_CHANGE', units='gC/m^2/s', & - avgflag='A', long_name='C change in soil', & - ptr_patch=this%soilc_change_patch) - end if -! FUN Ends - - end if ! end of if-c12 - - !------------------------------- - ! C13 flux variables - patch - !------------------------------- - - if ( carbon_type == 'c13') then - - this%gpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 gross primary production', & - ptr_patch=this%gpp_patch) - - this%rr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_RR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 root respiration (fine root MR + total root GR)', & - ptr_patch=this%rr_patch) - - this%mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 maintenance respiration', & - ptr_patch=this%mr_patch) - - this%gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total growth respiration', & - ptr_patch=this%gr_patch) - - this%ar_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_AR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 autotrophic respiration (MR + GR)', & - ptr_patch=this%ar_patch) - - this%npp_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_NPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net primary production', & - ptr_patch=this%npp_patch) - - this%agnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_AGNPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 aboveground NPP', & - ptr_patch=this%agnpp_patch) - - this%bgnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_BGNPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 belowground NPP', & - ptr_patch=this%bgnpp_patch) - - this%litfall_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LITFALL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litterfall (leaves and fine roots)', & - ptr_patch=this%litfall_patch, default='inactive') - - this%fire_closs_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PFT_FIRE_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total patch-level fire C loss', & - ptr_patch=this%fire_closs_patch) - - this%m_leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C mortality', & - ptr_patch=this%m_leafc_to_litter_patch, default='inactive') - - this%m_frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C mortality', & - ptr_patch=this%m_frootc_to_litter_patch, default='inactive') - - this%m_leafc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C storage mortality', & - ptr_patch=this%m_leafc_storage_to_litter_patch, default='inactive') - - this%m_frootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C storage mortality', & - ptr_patch=this%m_frootc_storage_to_litter_patch, default='inactive') - - this%m_livestemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C storage mortality', & - ptr_patch=this%m_livestemc_storage_to_litter_patch, default='inactive') - - this%m_deadstemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C storage mortality', & - ptr_patch=this%m_deadstemc_storage_to_litter_patch, default='inactive') - - this%m_livecrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C storage mortality', & - ptr_patch=this%m_livecrootc_storage_to_litter_patch, default='inactive') - - this%m_deadcrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C storage mortality', & - ptr_patch=this%m_deadcrootc_storage_to_litter_patch, default='inactive') - - this%m_leafc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C transfer mortality', & - ptr_patch=this%m_leafc_xfer_to_litter_patch, default='inactive') - - this%m_frootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C transfer mortality', & - ptr_patch=this%m_frootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C transfer mortality', & - ptr_patch=this%m_livestemc_xfer_to_litter_patch, default='inactive') - - this%m_deadstemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C transfer mortality', & - ptr_patch=this%m_deadstemc_xfer_to_litter_patch, default='inactive') - - this%m_livecrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C transfer mortality', & - ptr_patch=this%m_livecrootc_xfer_to_litter_patch, default='inactive') - - this%m_deadcrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C transfer mortality', & - ptr_patch=this%m_deadcrootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C mortality', & - ptr_patch=this%m_livestemc_to_litter_patch, default='inactive') - - this%m_deadstemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C mortality', & - ptr_patch=this%m_deadstemc_to_litter_patch, default='inactive') - - this%m_livecrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C mortality', & - ptr_patch=this%m_livecrootc_to_litter_patch, default='inactive') - - this%m_deadcrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C mortality', & - ptr_patch=this%m_deadcrootc_to_litter_patch, default='inactive') - - this%m_gresp_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_GRESP_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration storage mortality', & - ptr_patch=this%m_gresp_storage_to_litter_patch, default='inactive') - - this%m_gresp_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_GRESP_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration transfer mortality', & - ptr_patch=this%m_gresp_xfer_to_litter_patch, default='inactive') - - this%m_leafc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C fire loss', & - ptr_patch=this%m_leafc_to_fire_patch, default='inactive') - - this%m_frootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C fire loss', & - ptr_patch=this%m_frootc_to_fire_patch, default='inactive') - - this%m_leafc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C storage fire loss', & - ptr_patch=this%m_leafc_storage_to_fire_patch, default='inactive') - - this%m_frootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C storage fire loss', & - ptr_patch=this%m_frootc_storage_to_fire_patch, default='inactive') - - this%m_livestemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C storage fire loss', & - ptr_patch=this%m_livestemc_storage_to_fire_patch, default='inactive') - - this%m_deadstemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C storage fire loss', & - ptr_patch=this%m_deadstemc_storage_to_fire_patch, default='inactive') - - this%m_livecrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C storage fire loss', & - ptr_patch=this%m_livecrootc_storage_to_fire_patch, default='inactive') - - this%m_deadcrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C storage fire loss', & - ptr_patch=this%m_deadcrootc_storage_to_fire_patch, default='inactive') - - this%m_leafc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LEAFC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C transfer fire loss', & - ptr_patch=this%m_leafc_xfer_to_fire_patch, default='inactive') - - this%m_frootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_FROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C transfer fire loss', & - ptr_patch=this%m_frootc_xfer_to_fire_patch, default='inactive') - - this%m_livestemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C transfer fire loss', & - ptr_patch=this%m_livestemc_xfer_to_fire_patch, default='inactive') - - this%m_deadstemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C transfer fire loss', & - ptr_patch=this%m_deadstemc_xfer_to_fire_patch, default='inactive') - - this%m_livecrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C transfer fire loss', & - ptr_patch=this%m_livecrootc_xfer_to_fire_patch, default='inactive') - - this%m_deadcrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C transfer fire loss', & - ptr_patch=this%m_deadcrootc_xfer_to_fire_patch, default='inactive') - - this%m_livestemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVESTEMC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C fire loss', & - ptr_patch=this%m_livestemc_to_fire_patch, default='inactive') - - this%m_deadstemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C fire loss', & - ptr_patch=this%m_deadstemc_to_fire_patch, default='inactive') - - this%m_deadstemc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_LITTER_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C fire mortality to litter', & - ptr_patch=this%m_deadstemc_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_LIVECROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C fire loss', & - ptr_patch=this%m_livecrootc_to_fire_patch, default='inactive') - - this%m_deadcrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C fire loss', & - ptr_patch=this%m_deadcrootc_to_fire_patch, default='inactive') - - this%m_deadcrootc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_LITTER_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C fire mortality to litter', & - ptr_patch=this%m_deadcrootc_to_litter_fire_patch, default='inactive') - - this%m_gresp_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_GRESP_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration storage fire loss', & - ptr_patch=this%m_gresp_storage_to_fire_patch, default='inactive') - - this%m_gresp_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_M_GRESP_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration transfer fire loss', & - ptr_patch=this%m_gresp_xfer_to_fire_patch, default='inactive') - - this%leafc_xfer_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_XFER_TO_LEAFC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C growth from storage', & - ptr_patch=this%leafc_xfer_to_leafc_patch, default='inactive') - - this%frootc_xfer_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC_XFER_TO_FROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C growth from storage', & - ptr_patch=this%frootc_xfer_to_frootc_patch, default='inactive') - - this%livestemc_xfer_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC_XFER_TO_LIVESTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C growth from storage', & - ptr_patch=this%livestemc_xfer_to_livestemc_patch, default='inactive') - - this%deadstemc_xfer_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADSTEMC_XFER_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C growth from storage', & - ptr_patch=this%deadstemc_xfer_to_deadstemc_patch, default='inactive') - - this%livecrootc_xfer_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC_XFER_TO_LIVECROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C growth from storage', & - ptr_patch=this%livecrootc_xfer_to_livecrootc_patch, default='inactive') - - this%deadcrootc_xfer_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADCROOTC_XFER_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C growth from storage', & - ptr_patch=this%deadcrootc_xfer_to_deadcrootc_patch, default='inactive') - - this%leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C litterfall', & - ptr_patch=this%leafc_to_litter_patch, default='inactive') - - this%frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall', & - ptr_patch=this%frootc_to_litter_patch, default='inactive') - - this%leaf_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAF_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf maintenance respiration', & - ptr_patch=this%leaf_mr_patch, default='inactive') - - this%froot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOT_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root maintenance respiration', & - ptr_patch=this%froot_mr_patch, default='inactive') - - this%livestem_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEM_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem maintenance respiration', & - ptr_patch=this%livestem_mr_patch, default='inactive') - - this%livecroot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOT_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root maintenance respiration', & - ptr_patch=this%livecroot_mr_patch, default='inactive') - - this%psnsun_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PSNSUN_TO_CPOOL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 C fixation from sunlit canopy', & - ptr_patch=this%psnsun_to_cpool_patch) - - this%psnshade_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PSNSHADE_TO_CPOOL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 C fixation from shaded canopy', & - ptr_patch=this%psnshade_to_cpool_patch) - - this%cpool_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to leaf C', & - ptr_patch=this%cpool_to_leafc_patch, default='inactive') - - this%cpool_to_leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to leaf C storage', & - ptr_patch=this%cpool_to_leafc_storage_patch, default='inactive') - - this%cpool_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_FROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to fine root C', & - ptr_patch=this%cpool_to_frootc_patch, default='inactive') - - this%cpool_to_frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_FROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to fine root C storage', & - ptr_patch=this%cpool_to_frootc_storage_patch, default='inactive') - - this%cpool_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LIVESTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live stem C', & - ptr_patch=this%cpool_to_livestemc_patch, default='inactive') - - this%cpool_to_livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LIVESTEMC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live stem C storage', & - ptr_patch=this%cpool_to_livestemc_storage_patch, default='inactive') - - this%cpool_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead stem C', & - ptr_patch=this%cpool_to_deadstemc_patch, default='inactive') - - this%cpool_to_deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_DEADSTEMC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead stem C storage', & - ptr_patch=this%cpool_to_deadstemc_storage_patch, default='inactive') - - this%cpool_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LIVECROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live coarse root C', & - ptr_patch=this%cpool_to_livecrootc_patch, default='inactive') - - this%cpool_to_livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_LIVECROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live coarse root C storage', & - ptr_patch=this%cpool_to_livecrootc_storage_patch, default='inactive') - - this%cpool_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead coarse root C', & - ptr_patch=this%cpool_to_deadcrootc_patch, default='inactive') - - this%cpool_to_deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_DEADCROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead coarse root C storage', & - ptr_patch=this%cpool_to_deadcrootc_storage_patch, default='inactive') - - this%cpool_to_gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_TO_GRESP_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to growth respiration storage', & - ptr_patch=this%cpool_to_gresp_storage_patch, default='inactive') - - this%cpool_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LEAF_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration', & - ptr_patch=this%cpool_leaf_gr_patch, default='inactive') - - this%cpool_leaf_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LEAF_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration to storage', & - ptr_patch=this%cpool_leaf_storage_gr_patch, default='inactive') - - this%transfer_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_LEAF_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration from storage', & - ptr_patch=this%transfer_leaf_gr_patch, default='inactive') - - this%cpool_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_FROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration', & - ptr_patch=this%cpool_froot_gr_patch, default='inactive') - - this%cpool_froot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_FROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration to storage', & - ptr_patch=this%cpool_froot_storage_gr_patch, default='inactive') - - this%transfer_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_FROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration from storage', & - ptr_patch=this%transfer_froot_gr_patch, default='inactive') - - this%cpool_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LIVESTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration', & - ptr_patch=this%cpool_livestem_gr_patch, default='inactive') - - this%cpool_livestem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LIVESTEM_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration to storage', & - ptr_patch=this%cpool_livestem_storage_gr_patch, default='inactive') - - this%transfer_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_LIVESTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration from storage', & - ptr_patch=this%transfer_livestem_gr_patch, default='inactive') - - this%cpool_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_DEADSTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration', & - ptr_patch=this%cpool_deadstem_gr_patch, default='inactive') - - this%cpool_deadstem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_DEADSTEM_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration to storage', & - ptr_patch=this%cpool_deadstem_storage_gr_patch, default='inactive') - - this%transfer_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_DEADSTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration from storage', & - ptr_patch=this%transfer_deadstem_gr_patch, default='inactive') - - this%cpool_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LIVECROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration', & - ptr_patch=this%cpool_livecroot_gr_patch, default='inactive') - - this%cpool_livecroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_LIVECROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration to storage', & - ptr_patch=this%cpool_livecroot_storage_gr_patch, default='inactive') - - this%transfer_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_LIVECROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration from storage', & - ptr_patch=this%transfer_livecroot_gr_patch, default='inactive') - - this%cpool_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_DEADCROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration', & - ptr_patch=this%cpool_deadcroot_gr_patch, default='inactive') - - this%cpool_deadcroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL_DEADCROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration to storage', & - ptr_patch=this%cpool_deadcroot_storage_gr_patch, default='inactive') - - this%transfer_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_DEADCROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration from storage', & - ptr_patch=this%transfer_deadcroot_gr_patch, default='inactive') - - this%leafc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C shift storage to transfer', & - ptr_patch=this%leafc_storage_to_xfer_patch, default='inactive') - - this%frootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C shift storage to transfer', & - ptr_patch=this%frootc_storage_to_xfer_patch, default='inactive') - - this%livestemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C shift storage to transfer', & - ptr_patch=this%livestemc_storage_to_xfer_patch, default='inactive') - - this%deadstemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C shift storage to transfer', & - ptr_patch=this%deadstemc_storage_to_xfer_patch, default='inactive') - - this%livecrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C shift storage to transfer', & - ptr_patch=this%livecrootc_storage_to_xfer_patch, default='inactive') - - this%deadcrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C shift storage to transfer', & - ptr_patch=this%deadcrootc_storage_to_xfer_patch, default='inactive') - - this%gresp_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GRESP_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration shift storage to transfer', & - ptr_patch=this%gresp_storage_to_xfer_patch, default='inactive') - - this%livestemc_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C turnover', & - ptr_patch=this%livestemc_to_deadstemc_patch, default='inactive') - - this%livecrootc_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C turnover', & - ptr_patch=this%livecrootc_to_deadcrootc_patch, default='inactive') - - this%current_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CURRENT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for new growth displayed in this timestep', & - ptr_patch=this%current_gr_patch, default='inactive') - - this%transfer_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TRANSFER_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for transfer growth displayed in this timestep', & - ptr_patch=this%transfer_gr_patch, default='inactive') - - this%storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for growth sent to storage for later display', & - ptr_patch=this%storage_gr_patch, default='inactive') - - this%xsmrpool_c13ratio_patch(begp:endp) = spval - call hist_addfld1d (fname='XSMRPOOL_C13RATIO', units='proportion', & - avgflag='A', long_name='C13/C(12+13) ratio for xsmrpool', & - ptr_patch=this%xsmrpool_c13ratio_patch, default='inactive') - - endif - - !------------------------------- - ! C14 flux variables - patch - !------------------------------- - - if ( carbon_type == 'c14' ) then - - this%m_leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C mortality', & - ptr_patch=this%m_leafc_to_litter_patch, default='inactive') - - this%m_frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C mortality', & - ptr_patch=this%m_frootc_to_litter_patch, default='inactive') - - this%m_leafc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C storage mortality', & - ptr_patch=this%m_leafc_storage_to_litter_patch, default='inactive') - - this%m_frootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C storage mortality', & - ptr_patch=this%m_frootc_storage_to_litter_patch, default='inactive') - - this%m_livestemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C storage mortality', & - ptr_patch=this%m_livestemc_storage_to_litter_patch, default='inactive') - - this%m_deadstemc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C storage mortality', & - ptr_patch=this%m_deadstemc_storage_to_litter_patch, default='inactive') - - this%m_livecrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C storage mortality', & - ptr_patch=this%m_livecrootc_storage_to_litter_patch, default='inactive') - - this%m_deadcrootc_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C storage mortality', & - ptr_patch=this%m_deadcrootc_storage_to_litter_patch, default='inactive') - - this%m_leafc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C transfer mortality', & - ptr_patch=this%m_leafc_xfer_to_litter_patch, default='inactive') - - this%m_frootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C transfer mortality', & - ptr_patch=this%m_frootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C transfer mortality', & - ptr_patch=this%m_livestemc_xfer_to_litter_patch, default='inactive') - - this%m_deadstemc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C transfer mortality', & - ptr_patch=this%m_deadstemc_xfer_to_litter_patch, default='inactive') - - this%m_livecrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C transfer mortality', & - ptr_patch=this%m_livecrootc_xfer_to_litter_patch, default='inactive') - - this%m_deadcrootc_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C transfer mortality', & - ptr_patch=this%m_deadcrootc_xfer_to_litter_patch, default='inactive') - - this%m_livestemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C mortality', & - ptr_patch=this%m_livestemc_to_litter_patch, default='inactive') - - this%m_deadstemc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C mortality', & - ptr_patch=this%m_deadstemc_to_litter_patch, default='inactive') - - this%m_livecrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C mortality', & - ptr_patch=this%m_livecrootc_to_litter_patch, default='inactive') - - this%m_deadcrootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C mortality', & - ptr_patch=this%m_deadcrootc_to_litter_patch, default='inactive') - - this%m_gresp_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_GRESP_STORAGE_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth respiration storage mortality', & - ptr_patch=this%m_gresp_storage_to_litter_patch, default='inactive') - - this%m_gresp_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_GRESP_XFER_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth respiration transfer mortality', & - ptr_patch=this%m_gresp_xfer_to_litter_patch, default='inactive') - - this%m_leafc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C fire loss', & - ptr_patch=this%m_leafc_to_fire_patch, default='inactive') - - this%m_frootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C fire loss', & - ptr_patch=this%m_frootc_to_fire_patch, default='inactive') - - this%m_leafc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C storage fire loss', & - ptr_patch=this%m_leafc_storage_to_fire_patch, default='inactive') - - this%m_frootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C storage fire loss', & - ptr_patch=this%m_frootc_storage_to_fire_patch, default='inactive') - - this%m_livestemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C storage fire loss', & - ptr_patch=this%m_livestemc_storage_to_fire_patch, default='inactive') - - this%m_deadstemc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C storage fire loss', & - ptr_patch=this%m_deadstemc_storage_to_fire_patch, default='inactive') - - this%m_livecrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C storage fire loss', & - ptr_patch=this%m_livecrootc_storage_to_fire_patch, default='inactive') - - this%m_deadcrootc_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C storage fire loss', & - ptr_patch=this%m_deadcrootc_storage_to_fire_patch, default='inactive') - - this%m_leafc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LEAFC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C transfer fire loss', & - ptr_patch=this%m_leafc_xfer_to_fire_patch, default='inactive') - - this%m_frootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_FROOTC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C transfer fire loss', & - ptr_patch=this%m_frootc_xfer_to_fire_patch, default='inactive') - - this%m_livestemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C transfer fire loss', & - ptr_patch=this%m_livestemc_xfer_to_fire_patch, default='inactive') - - this%m_deadstemc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C transfer fire loss', & - ptr_patch=this%m_deadstemc_xfer_to_fire_patch, default='inactive') - - this%m_livecrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C transfer fire loss', & - ptr_patch=this%m_livecrootc_xfer_to_fire_patch, default='inactive') - - this%m_deadcrootc_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C transfer fire loss', & - ptr_patch=this%m_deadcrootc_xfer_to_fire_patch, default='inactive') - - this%m_livestemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVESTEMC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C fire loss', & - ptr_patch=this%m_livestemc_to_fire_patch, default='inactive') - - this%m_deadstemc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C fire loss', & - ptr_patch=this%m_deadstemc_to_fire_patch, default='inactive') - - this%m_deadstemc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADSTEMC_TO_LITTER_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C fire mortality to litter', & - ptr_patch=this%m_deadstemc_to_litter_fire_patch, default='inactive') - - this%m_livecrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_LIVECROOTC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C fire loss', & - ptr_patch=this%m_livecrootc_to_fire_patch, default='inactive') - - this%m_deadcrootc_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C fire loss', & - ptr_patch=this%m_deadcrootc_to_fire_patch, default='inactive') - - this%m_deadcrootc_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_DEADCROOTC_TO_LITTER_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C fire mortality to litter', & - ptr_patch=this%m_deadcrootc_to_litter_fire_patch, default='inactive') - - this%m_gresp_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_GRESP_STORAGE_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth respiration storage fire loss', & - ptr_patch=this%m_gresp_storage_to_fire_patch, default='inactive') - - this%m_gresp_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_M_GRESP_XFER_TO_FIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth respiration transfer fire loss', & - ptr_patch=this%m_gresp_xfer_to_fire_patch, default='inactive') - - this%leafc_xfer_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_XFER_TO_LEAFC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C growth from storage', & - ptr_patch=this%leafc_xfer_to_leafc_patch, default='inactive') - - this%frootc_xfer_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC_XFER_TO_FROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C growth from storage', & - ptr_patch=this%frootc_xfer_to_frootc_patch, default='inactive') - - this%livestemc_xfer_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC_XFER_TO_LIVESTEMC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C growth from storage', & - ptr_patch=this%livestemc_xfer_to_livestemc_patch, default='inactive') - - this%deadstemc_xfer_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADSTEMC_XFER_TO_DEADSTEMC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C growth from storage', & - ptr_patch=this%deadstemc_xfer_to_deadstemc_patch, default='inactive') - - this%livecrootc_xfer_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC_XFER_TO_LIVECROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C growth from storage', & - ptr_patch=this%livecrootc_xfer_to_livecrootc_patch, default='inactive') - - this%deadcrootc_xfer_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADCROOTC_XFER_TO_DEADCROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C growth from storage', & - ptr_patch=this%deadcrootc_xfer_to_deadcrootc_patch, default='inactive') - - this%leafc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C litterfall', & - ptr_patch=this%leafc_to_litter_patch, default='inactive') - - this%frootc_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC_TO_LITTER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C litterfall', & - ptr_patch=this%frootc_to_litter_patch, default='inactive') - - this%leaf_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAF_MR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf maintenance respiration', & - ptr_patch=this%leaf_mr_patch, default='inactive') - - this%froot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOT_MR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root maintenance respiration', & - ptr_patch=this%froot_mr_patch, default='inactive') - - this%livestem_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEM_MR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem maintenance respiration', & - ptr_patch=this%livestem_mr_patch, default='inactive') - - this%livecroot_mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOT_MR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root maintenance respiration', & - ptr_patch=this%livecroot_mr_patch, default='inactive') - - this%psnsun_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PSNSUN_TO_CPOOL', units='gC14/m^2/s', & - avgflag='A', long_name='C14 C fixation from sunlit canopy', & - ptr_patch=this%psnsun_to_cpool_patch) - - this%psnshade_to_cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PSNSHADE_TO_CPOOL', units='gC14/m^2/s', & - avgflag='A', long_name='C14 C fixation from shaded canopy', & - ptr_patch=this%psnshade_to_cpool_patch) - - this%cpool_to_leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LEAFC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to leaf C', & - ptr_patch=this%cpool_to_leafc_patch, default='inactive') - - this%cpool_to_leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LEAFC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to leaf C storage', & - ptr_patch=this%cpool_to_leafc_storage_patch, default='inactive') - - this%cpool_to_frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_FROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to fine root C', & - ptr_patch=this%cpool_to_frootc_patch, default='inactive') - - this%cpool_to_frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_FROOTC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to fine root C storage', & - ptr_patch=this%cpool_to_frootc_storage_patch, default='inactive') - - this%cpool_to_livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LIVESTEMC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to live stem C', & - ptr_patch=this%cpool_to_livestemc_patch, default='inactive') - - this%cpool_to_livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LIVESTEMC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to live stem C storage', & - ptr_patch=this%cpool_to_livestemc_storage_patch, default='inactive') - - this%cpool_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_DEADSTEMC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to dead stem C', & - ptr_patch=this%cpool_to_deadstemc_patch, default='inactive') - - this%cpool_to_deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_DEADSTEMC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to dead stem C storage', & - ptr_patch=this%cpool_to_deadstemc_storage_patch, default='inactive') - - this%cpool_to_livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LIVECROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to live coarse root C', & - ptr_patch=this%cpool_to_livecrootc_patch, default='inactive') - - this%cpool_to_livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_LIVECROOTC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to live coarse root C storage', & - ptr_patch=this%cpool_to_livecrootc_storage_patch, default='inactive') - - this%cpool_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_DEADCROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to dead coarse root C', & - ptr_patch=this%cpool_to_deadcrootc_patch, default='inactive') - - this%cpool_to_deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_DEADCROOTC_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to dead coarse root C storage', & - ptr_patch=this%cpool_to_deadcrootc_storage_patch, default='inactive') - - this%cpool_to_gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_TO_GRESP_STORAGE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 allocation to growth respiration storage', & - ptr_patch=this%cpool_to_gresp_storage_patch, default='inactive') - - this%cpool_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LEAF_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf growth respiration', & - ptr_patch=this%cpool_leaf_gr_patch, default='inactive') - - this%cpool_leaf_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LEAF_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf growth respiration to storage', & - ptr_patch=this%cpool_leaf_storage_gr_patch, default='inactive') - - this%transfer_leaf_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_LEAF_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf growth respiration from storage', & - ptr_patch=this%transfer_leaf_gr_patch, default='inactive') - - this%cpool_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_FROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root growth respiration', & - ptr_patch=this%cpool_froot_gr_patch, default='inactive') - - this%cpool_froot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_FROOT_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root growth respiration to storage', & - ptr_patch=this%cpool_froot_storage_gr_patch, default='inactive') - - this%transfer_froot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_FROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root growth respiration from storage', & - ptr_patch=this%transfer_froot_gr_patch, default='inactive') - - this%cpool_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LIVESTEM_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem growth respiration', & - ptr_patch=this%cpool_livestem_gr_patch, default='inactive') - - this%cpool_livestem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LIVESTEM_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem growth respiration to storage', & - ptr_patch=this%cpool_livestem_storage_gr_patch, default='inactive') - - this%transfer_livestem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_LIVESTEM_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem growth respiration from storage', & - ptr_patch=this%transfer_livestem_gr_patch, default='inactive') - - this%cpool_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_DEADSTEM_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem growth respiration', & - ptr_patch=this%cpool_deadstem_gr_patch, default='inactive') - - this%cpool_deadstem_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_DEADSTEM_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem growth respiration to storage', & - ptr_patch=this%cpool_deadstem_storage_gr_patch, default='inactive') - - this%transfer_deadstem_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_DEADSTEM_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem growth respiration from storage', & - ptr_patch=this%transfer_deadstem_gr_patch, default='inactive') - - this%cpool_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LIVECROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root growth respiration', & - ptr_patch=this%cpool_livecroot_gr_patch, default='inactive') - - this%cpool_livecroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_LIVECROOT_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root growth respiration to storage', & - ptr_patch=this%cpool_livecroot_storage_gr_patch, default='inactive') - - this%transfer_livecroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_LIVECROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root growth respiration from storage', & - ptr_patch=this%transfer_livecroot_gr_patch, default='inactive') - - this%cpool_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_DEADCROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root growth respiration', & - ptr_patch=this%cpool_deadcroot_gr_patch, default='inactive') - - this%cpool_deadcroot_storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL_DEADCROOT_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root growth respiration to storage', & - ptr_patch=this%cpool_deadcroot_storage_gr_patch, default='inactive') - - this%transfer_deadcroot_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_DEADCROOT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root growth respiration from storage', & - ptr_patch=this%transfer_deadcroot_gr_patch, default='inactive') - - this%leafc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 leaf C shift storage to transfer', & - ptr_patch=this%leafc_storage_to_xfer_patch, default='inactive') - - this%frootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 fine root C shift storage to transfer', & - ptr_patch=this%frootc_storage_to_xfer_patch, default='inactive') - - this%livestemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C shift storage to transfer', & - ptr_patch=this%livestemc_storage_to_xfer_patch, default='inactive') - - this%deadstemc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADSTEMC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead stem C shift storage to transfer', & - ptr_patch=this%deadstemc_storage_to_xfer_patch, default='inactive') - - this%livecrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C shift storage to transfer', & - ptr_patch=this%livecrootc_storage_to_xfer_patch, default='inactive') - - this%deadcrootc_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADCROOTC_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 dead coarse root C shift storage to transfer', & - ptr_patch=this%deadcrootc_storage_to_xfer_patch, default='inactive') - - this%gresp_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GRESP_STORAGE_TO_XFER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth respiration shift storage to transfer', & - ptr_patch=this%gresp_storage_to_xfer_patch, default='inactive') - - this%livestemc_to_deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC_TO_DEADSTEMC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live stem C turnover', & - ptr_patch=this%livestemc_to_deadstemc_patch, default='inactive') - - this%livecrootc_to_deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC_TO_DEADCROOTC', units='gC14/m^2/s', & - avgflag='A', long_name='C14 live coarse root C turnover', & - ptr_patch=this%livecrootc_to_deadcrootc_patch, default='inactive') - - this%current_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CURRENT_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth resp for new growth displayed in this timestep', & - ptr_patch=this%current_gr_patch, default='inactive') - - this%transfer_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TRANSFER_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth resp for transfer growth displayed in this timestep', & - ptr_patch=this%transfer_gr_patch, default='inactive') - - this%storage_gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_STORAGE_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 growth resp for growth sent to storage for later display', & - ptr_patch=this%storage_gr_patch, default='inactive') - - this%gpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GPP', units='gC14/m^2/s', & - avgflag='A', long_name='C14 gross primary production', & - ptr_patch=this%gpp_patch) - - this%rr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_RR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 root respiration (fine root MR + total root GR)', & - ptr_patch=this%rr_patch) - - this%mr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_MR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 maintenance respiration', & - ptr_patch=this%mr_patch) - - this%gr_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total growth respiration', & - ptr_patch=this%gr_patch) - - this%ar_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_AR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 autotrophic respiration (MR + GR)', & - ptr_patch=this%ar_patch) - - this%npp_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_NPP', units='gC14/m^2/s', & - avgflag='A', long_name='C14 net primary production', & - ptr_patch=this%npp_patch) - - this%agnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_AGNPP', units='gC14/m^2/s', & - avgflag='A', long_name='C14 aboveground NPP', & - ptr_patch=this%agnpp_patch) - - this%bgnpp_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_BGNPP', units='gC14/m^2/s', & - avgflag='A', long_name='C14 belowground NPP', & - ptr_patch=this%bgnpp_patch) - - this%litfall_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LITFALL', units='gC14/m^2/s', & - avgflag='A', long_name='C14 litterfall (leaves and fine roots)', & - ptr_patch=this%litfall_patch, default='inactive') - - this%fire_closs_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PFT_FIRE_CLOSS', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total patch-level fire C loss', & - ptr_patch=this%fire_closs_patch) - endif - - !------------------------------- - ! C flux variables - column - !------------------------------- - - if (carbon_type == 'c12') then - - this%cwdc_loss_col(begc:endc) = spval - call hist_addfld1d (fname='CWDC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='coarse woody debris C loss', & - ptr_col=this%cwdc_loss_col) - - this%m_decomp_cpools_to_fire_col(begc:endc,:) = spval - this%m_decomp_cpools_to_fire_vr_col(begc:endc,:,:) = spval - do k = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(k) .or. decomp_cascade_con%is_cwd(k) ) then - data1dptr => this%m_decomp_cpools_to_fire_col(:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld1d (fname=fieldname, units='gC/m^2/s', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - if ( nlevdecomp_full > 1 ) then - data2dptr => this%m_decomp_cpools_to_fire_vr_col(:,:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE'//trim(vr_suffix) - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - endif - end do - - this%dwt_seedc_to_leaf_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_SEEDC_TO_LEAF', units='gC/m^2/s', & - avgflag='A', long_name='seed source to patch-level leaf', & - ptr_gcell=this%dwt_seedc_to_leaf_grc, default='inactive') - - this%dwt_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_SEEDC_TO_LEAF_PATCH', units='gC/m^2/s', & - avgflag='A', & - long_name='patch-level seed source to patch-level leaf ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_leaf_patch, default='inactive') - - this%dwt_seedc_to_deadstem_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_SEEDC_TO_DEADSTEM', units='gC/m^2/s', & - avgflag='A', long_name='seed source to patch-level deadstem', & - ptr_gcell=this%dwt_seedc_to_deadstem_grc, default='inactive') - - this%dwt_seedc_to_deadstem_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_SEEDC_TO_DEADSTEM_PATCH', units='gC/m^2/s', & - avgflag='A', & - long_name='patch-level seed source to patch-level deadstem ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_deadstem_patch, default='inactive') - - this%dwt_conv_cflux_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_CONV_CFLUX', units='gC/m^2/s', & - avgflag='A', & - long_name='conversion C flux (immediate loss to atm) (0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_cflux_grc) - - this%dwt_conv_cflux_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_CONV_CFLUX_PATCH', units='gC/m^2/s', & - avgflag='A', & - long_name='patch-level conversion C flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year) ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_conv_cflux_patch, default='inactive') - - this%dwt_conv_cflux_dribbled_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_CONV_CFLUX_DRIBBLED', units='gC/m^2/s', & - avgflag='A', & - long_name='conversion C flux (immediate loss to atm), dribbled throughout the year', & - ptr_gcell=this%dwt_conv_cflux_dribbled_grc) - - this%dwt_wood_productc_gain_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_WOOD_PRODUCTC_GAIN_PATCH', units='gC/m^2/s', & - avgflag='A', & - long_name='patch-level landcover change-driven addition to wood product pools' // & - '(0 at all times except first timestep of year) ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_wood_productc_gain_patch, default='inactive') - - this%dwt_slash_cflux_col(begc:endc) = spval - call hist_addfld1d (fname='DWT_SLASH_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='slash C flux to litter and CWD due to land use', & - ptr_col=this%dwt_slash_cflux_col) - - this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_MET_C', units='gC/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive') - - this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_CEL_C', units='gC/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive') - - this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTC_TO_LITR_LIG_C', units='gC/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive') - - this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_LIVECROOTC_TO_CWDC', units='gC/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='live coarse root to CWD due to landcover change', & - ptr_col=this%dwt_livecrootc_to_cwdc_col, default='inactive') - - this%dwt_deadcrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_DEADCROOTC_TO_CWDC', units='gC/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='dead coarse root to CWD due to landcover change', & - ptr_col=this%dwt_deadcrootc_to_cwdc_col, default='inactive') - - this%crop_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='CROP_SEEDC_TO_LEAF', units='gC/m^2/s', & - avgflag='A', long_name='crop seed source to leaf', & - ptr_patch=this%crop_seedc_to_leaf_patch, default='inactive') - - this%sr_col(begc:endc) = spval - call hist_addfld1d (fname='SR', units='gC/m^2/s', & - avgflag='A', long_name='total soil respiration (HR + root resp)', & - ptr_col=this%sr_col) - - this%er_col(begc:endc) = spval - call hist_addfld1d (fname='ER', units='gC/m^2/s', & - avgflag='A', long_name='total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=this%er_col) - - this%litfire_col(begc:endc) = spval - call hist_addfld1d (fname='LITFIRE', units='gC/m^2/s', & - avgflag='A', long_name='litter fire losses', & - ptr_col=this%litfire_col, default='inactive') - - this%somfire_col(begc:endc) = spval - call hist_addfld1d (fname='SOMFIRE', units='gC/m^2/s', & - avgflag='A', long_name='soil organic matter fire losses', & - ptr_col=this%somfire_col, default='inactive') - - this%totfire_col(begc:endc) = spval - call hist_addfld1d (fname='TOTFIRE', units='gC/m^2/s', & - avgflag='A', long_name='total ecosystem fire losses', & - ptr_col=this%totfire_col, default='inactive') - - this%fire_closs_col(begc:endc) = spval - call hist_addfld1d (fname='COL_FIRE_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total column-level fire C loss for non-peat fires outside land-type converted region', & - ptr_col=this%fire_closs_col) - - this%annsum_npp_patch(begp:endp) = spval - call hist_addfld1d (fname='ANNSUM_NPP', units='gC/m^2/yr', & - avgflag='A', long_name='annual sum of NPP', & - ptr_patch=this%annsum_npp_patch, default='inactive') - - this%annsum_npp_col(begc:endc) = spval - call hist_addfld1d (fname='CANNSUM_NPP', units='gC/m^2/s', & - avgflag='A', long_name='annual sum of column-level NPP', & - ptr_col=this%annsum_npp_col, default='inactive') - - this%nep_col(begc:endc) = spval - call hist_addfld1d (fname='NEP', units='gC/m^2/s', & - avgflag='A', long_name='net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink', & - ptr_col=this%nep_col) - - this%nbp_grc(begg:endg) = spval - call hist_addfld1d (fname='NBP', units='gC/m^2/s', & - avgflag='A', long_name='net biome production, includes fire, landuse,'& - //' harvest and hrv_xsmrpool flux (latter smoothed over the year), positive for sink'& - //' (same as net carbon exchange between land and atmosphere)', & - ptr_gcell=this%nbp_grc) - - this%nee_grc(begg:endg) = spval - call hist_addfld1d (fname='NEE', units='gC/m^2/s', & - avgflag='A', long_name='net ecosystem exchange of carbon,'& - //' includes fire and hrv_xsmrpool (latter smoothed over the year),'& - //' excludes landuse and harvest flux, positive for source', & - ptr_gcell=this%nee_grc) - - this%landuseflux_grc(begg:endg) = spval - call hist_addfld1d (fname='LAND_USE_FLUX', units='gC/m^2/s', & - avgflag='A', & - long_name='total C emitted from land cover conversion (smoothed over the year)'& - //' and wood and grain product pools (NOTE: not a net value)', & - ptr_gcell=this%landuseflux_grc) - - end if - !------------------------------- - ! C13 flux variables - column - !------------------------------- - - if ( carbon_type == 'c13' ) then - - this%m_decomp_cpools_to_fire_col(begc:endc,:) = spval - this%m_decomp_cpools_to_fire_vr_col(begc:endc,:,:) = spval - do k = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(k) .or. decomp_cascade_con%is_cwd(k) ) then - data1dptr => this%m_decomp_cpools_to_fire_col(:,k) - fieldname = 'C13_M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE' - longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld1d (fname=fieldname, units='gC13/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - if ( nlevdecomp_full > 1 ) then - data2dptr => this%m_decomp_cpools_to_fire_vr_col(:,:,k) - fieldname = 'C13_M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE'//trim(vr_suffix) - longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld_decomp (fname=fieldname, units='gC13/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - end if - endif - end do - - this%dwt_seedc_to_leaf_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_LEAF', units='gC13/m^2/s', & - avgflag='A', long_name='C13 seed source to patch-level leaf', & - ptr_gcell=this%dwt_seedc_to_leaf_grc, default='inactive') - - this%dwt_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_LEAF_PATCH', units='gC13/m^2/s', & - avgflag='A', & - long_name='patch-level C13 seed source to patch-level leaf ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_leaf_patch, default='inactive') - - this%dwt_seedc_to_deadstem_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_DEADSTEM', units='gC13/m^2/s', & - avgflag='A', long_name='C13 seed source to patch-level deadstem', & - ptr_gcell=this%dwt_seedc_to_deadstem_grc, default='inactive') - - this%dwt_seedc_to_deadstem_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_DEADSTEM_PATCH', units='gC13/m^2/s', & - avgflag='A', & - long_name='patch-level C13 seed source to patch-level deadstem ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_deadstem_patch, default='inactive') - - this%dwt_conv_cflux_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_DWT_CONV_CFLUX', units='gC13/m^2/s', & - avgflag='A', long_name='C13 conversion C flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_cflux_grc) - - this%dwt_conv_cflux_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_PATCH', units='gC13/m^2/s', & - avgflag='A', & - long_name='patch-level C13 conversion C flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year) ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_conv_cflux_patch, default='inactive') - - this%dwt_conv_cflux_dribbled_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_DRIBBLED', units='gC13/m^2/s', & - avgflag='A', & - long_name='C13 conversion C flux (immediate loss to atm), dribbled throughout the year', & - ptr_gcell=this%dwt_conv_cflux_dribbled_grc) - - this%dwt_slash_cflux_col(begc:endc) = spval - call hist_addfld1d (fname='C13_DWT_SLASH_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='C13 slash C flux to litter and CWD due to land use', & - ptr_col=this%dwt_slash_cflux_col) - - this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_MET_C', units='gC13/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive') - - this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_CEL_C', units='gC13/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive') - - this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_LIG_C', units='gC13/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive') - - this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C13_DWT_LIVECROOTC_TO_CWDC', units='gC13/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C13 live coarse root to CWD due to landcover change', & - ptr_col=this%dwt_livecrootc_to_cwdc_col, default='inactive') - - this%dwt_deadcrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C13_DWT_DEADCROOTC_TO_CWDC', units='gC13/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C13 dead coarse root to CWD due to landcover change', & - ptr_col=this%dwt_deadcrootc_to_cwdc_col, default='inactive') - - this%crop_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CROP_SEEDC_TO_LEAF', units='gC13/m^2/s', & - avgflag='A', long_name='C13 crop seed source to leaf', & - ptr_patch=this%crop_seedc_to_leaf_patch, default='inactive') - - this%sr_col(begc:endc) = spval - call hist_addfld1d (fname='C13_SR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total soil respiration (HR + root resp)', & - ptr_col=this%sr_col) - - this%er_col(begc:endc) = spval - call hist_addfld1d (fname='C13_ER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=this%er_col) - - this%litfire_col(begc:endc) = spval - call hist_addfld1d (fname='C13_LITFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter fire losses', & - ptr_col=this%litfire_col, default='inactive') - - this%somfire_col(begc:endc) = spval - call hist_addfld1d (fname='C13_SOMFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 soil organic matter fire losses', & - ptr_col=this%somfire_col, default='inactive') - - this%totfire_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total ecosystem fire losses', & - ptr_col=this%totfire_col, default='inactive') - - this%fire_closs_col(begc:endc) = spval - call hist_addfld1d (fname='C13_COL_FIRE_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total column-level fire C loss', & - ptr_col=this%fire_closs_col) - - this%nep_col(begc:endc) = spval - call hist_addfld1d (fname='C13_NEP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net ecosystem production, excludes fire flux, positive for sink', & - ptr_col=this%nep_col) - - this%nee_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_NEE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net ecosystem exchange of carbon, includes fire flux, positive for source', & - ptr_gcell=this%nee_grc) - - endif - - !------------------------------- - ! C14 flux variables - column - !------------------------------- - - if (carbon_type == 'c14') then - - this%m_decomp_cpools_to_fire_col(begc:endc,:) = spval - this%m_decomp_cpools_to_fire_vr_col(begc:endc,:,:) = spval - do k = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(k) .or. decomp_cascade_con%is_cwd(k) ) then - data1dptr => this%m_decomp_cpools_to_fire_col(:,k) - fieldname = 'C14_M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE' - longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld1d (fname=fieldname, units='gC14/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - if ( nlevdecomp_full > 1 ) then - data2dptr => this%m_decomp_cpools_to_fire_vr_col(:,:,k) - fieldname = 'C14_M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_FIRE'//trim(vr_suffix) - longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_long(k))//' C fire loss' - call hist_addfld_decomp (fname=fieldname, units='gC14/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - end if - endif - end do - - this%dwt_seedc_to_leaf_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_DWT_SEEDC_TO_LEAF', units='gC14/m^2/s', & - avgflag='A', long_name='C14 seed source to patch-level leaf', & - ptr_gcell=this%dwt_seedc_to_leaf_grc, default='inactive') - - this%dwt_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DWT_SEEDC_TO_LEAF_PATCH', units='gC14/m^2/s', & - avgflag='A', & - long_name='patch-level C14 seed source to patch-level leaf ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_leaf_patch, default='inactive') - - this%dwt_seedc_to_deadstem_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_DWT_SEEDC_TO_DEADSTEM', units='gC14/m^2/s', & - avgflag='A', long_name='C14 seed source to patch-level deadstem', & - ptr_gcell=this%dwt_seedc_to_deadstem_grc, default='inactive') - - this%dwt_seedc_to_deadstem_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DWT_SEEDC_TO_DEADSTEM_PATCH', units='gC14/m^2/s', & - avgflag='A', & - long_name='patch-level C14 seed source to patch-level deadstem ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedc_to_deadstem_patch, default='inactive') - - this%dwt_conv_cflux_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_DWT_CONV_CFLUX', units='gC14/m^2/s', & - avgflag='A', long_name='C14 conversion C flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_cflux_grc) - - this%dwt_conv_cflux_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_PATCH', units='gC14/m^2/s', & - avgflag='A', & - long_name='patch-level C14 conversion C flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year) ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_conv_cflux_patch, default='inactive') - - this%dwt_conv_cflux_dribbled_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_DRIBBLED', units='gC14/m^2/s', & - avgflag='A', & - long_name='C14 conversion C flux (immediate loss to atm), dribbled throughout the year', & - ptr_gcell=this%dwt_conv_cflux_dribbled_grc) - - this%dwt_slash_cflux_col(begc:endc) = spval - call hist_addfld1d (fname='C14_DWT_SLASH_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='C14 slash C flux to litter and CWD due to land use', & - ptr_col=this%dwt_slash_cflux_col) - - this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_MET_C', units='gC14/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C14 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_met_c_col, default='inactive') - - this%dwt_frootc_to_litr_cel_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_CEL_C', units='gC14/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C14 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_cel_c_col, default='inactive') - - this%dwt_frootc_to_litr_lig_c_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_LIG_C', units='gC14/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C14 fine root to litter due to landcover change', & - ptr_col=this%dwt_frootc_to_litr_lig_c_col, default='inactive') - - this%dwt_livecrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C14_DWT_LIVECROOTC_TO_CWDC', units='gC14/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C14 live coarse root to CWD due to landcover change', & - ptr_col=this%dwt_livecrootc_to_cwdc_col, default='inactive') - - this%dwt_deadcrootc_to_cwdc_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='C14_DWT_DEADCROOTC_TO_CWDC', units='gC14/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='C14 dead coarse root to CWD due to landcover change', & - ptr_col=this%dwt_deadcrootc_to_cwdc_col, default='inactive') - - this%crop_seedc_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CROP_SEEDC_TO_LEAF', units='gC14/m^2/s', & - avgflag='A', long_name='C14 crop seed source to leaf', & - ptr_patch=this%crop_seedc_to_leaf_patch, default='inactive') - - this%sr_col(begc:endc) = spval - call hist_addfld1d (fname='C14_SR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total soil respiration (HR + root resp)', & - ptr_col=this%sr_col) - - this%er_col(begc:endc) = spval - call hist_addfld1d (fname='C14_ER', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=this%er_col) - - this%litfire_col(begc:endc) = spval - call hist_addfld1d (fname='C14_LITFIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 litter fire losses', & - ptr_col=this%litfire_col, default='inactive') - - this%somfire_col(begc:endc) = spval - call hist_addfld1d (fname='C14_SOMFIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 soil organic matter fire losses', & - ptr_col=this%somfire_col, default='inactive') - - this%totfire_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTFIRE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total ecosystem fire losses', & - ptr_col=this%totfire_col, default='inactive') - - this%fire_closs_col(begc:endc) = spval - call hist_addfld1d (fname='C14_COL_FIRE_CLOSS', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total column-level fire C loss', & - ptr_col=this%fire_closs_col) - - this%nep_col(begc:endc) = spval - call hist_addfld1d (fname='C14_NEP', units='gC14/m^2/s', & - avgflag='A', long_name='C14 net ecosystem production, excludes fire flux, positive for sink', & - ptr_col=this%nep_col) - - this%nee_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_NEE', units='gC14/m^2/s', & - avgflag='A', long_name='C14 net ecosystem exchange of carbon, includes fire flux, positive for source', & - ptr_gcell=this%nee_grc) - - endif - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !ARGUMENTS: - class(cnveg_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p, c, l, j - integer :: fc ! filter index - integer :: num_special_col ! number of good values in special_col filter - integer :: num_special_patch ! number of good values in special_patch filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - integer :: special_patch(bounds%endp-bounds%begp+1) ! special landunit filter - patches - !----------------------------------------------------------------------- - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - ! Set patch filters - - num_special_patch = 0 - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - - if (lun%ifspecial(l)) then - num_special_patch = num_special_patch + 1 - special_patch(num_special_patch) = p - end if - end do - - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - this%gpp_before_downreg_patch(p) = 0._r8 - ! WW should these be considered spval or 0? - if (lun%ifspecial(l)) then - this%availc_patch(p) = spval - this%xsmrpool_recover_patch(p) = spval - this%excess_cflux_patch(p) = spval - this%plant_calloc_patch(p) = spval - this%prev_leafc_to_litter_patch(p) = spval - this%prev_frootc_to_litter_patch(p) = spval - this%leafc_to_litter_fun_patch(p) = spval - if ( use_c13 ) then - this%xsmrpool_c13ratio_patch(p) = spval - endif - end if - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%availc_patch(p) = 0._r8 - this%xsmrpool_recover_patch(p) = 0._r8 - this%excess_cflux_patch(p) = 0._r8 - this%prev_leafc_to_litter_patch(p) = 0._r8 - this%leafc_to_litter_fun_patch(p) = 0._r8 - this%prev_frootc_to_litter_patch(p) = 0._r8 - this%plant_calloc_patch(p) = 0._r8 - end if - end do - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - ! also initialize dynamic landcover fluxes so that they have - ! real values on first timestep, prior to calling pftdyn_cnbal - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%dwt_slash_cflux_col(c) = 0._r8 - do j = 1, nlevdecomp_full - this%dwt_frootc_to_litr_met_c_col(c,j) = 0._r8 - this%dwt_frootc_to_litr_cel_c_col(c,j) = 0._r8 - this%dwt_frootc_to_litr_lig_c_col(c,j) = 0._r8 - this%dwt_livecrootc_to_cwdc_col(c,j) = 0._r8 - this%dwt_deadcrootc_to_cwdc_col(c,j) = 0._r8 - end do - end if - end do - - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - - this%gpp_patch(p) = 0._r8 - if (lun%ifspecial(l)) then - this%tempsum_npp_patch(p) = spval - this%annsum_npp_patch(p) = spval - this%tempsum_litfall_patch(p) = spval - this%annsum_litfall_patch(p) = spval - end if - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%tempsum_npp_patch(p) = 0._r8 - this%annsum_npp_patch(p) = 0._r8 - this%tempsum_litfall_patch(p) = 0._r8 - this%annsum_litfall_patch(p) = 0._r8 - end if - end do - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (lun%ifspecial(l)) then - this%annsum_npp_col(c) = spval - end if - - ! also initialize dynamic landcover fluxes so that they have - ! real values on first timestep, prior to calling pftdyn_cnbal - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%annsum_npp_col(c) = 0._r8 - end if - end do - - ! initialize fields for special filters - - call this%SetValues (& - num_patch=num_special_patch, filter_patch=special_patch, value_patch=0._r8, & - num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart ( this, bounds, ncid, flag, carbon_type ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon fluxes - ! - ! !USES: - use ncdio_pio, only : file_desc_t - ! - ! !ARGUMENTS: - class (cnveg_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - character(len=*) , intent(in) :: carbon_type ! 'c12' or 'c13' or 'c14' - !------------------------------------------------------------------------ - - if (carbon_type == 'c12') then - call this%RestartBulkOnly(bounds, ncid, flag) - end if - - call this%RestartAllIsotopes(bounds, ncid, flag) - - end subroutine Restart - - - !----------------------------------------------------------------------- - subroutine RestartBulkOnly ( this, bounds, ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon fluxes - fields only present for bulk C - ! - ! !USES: - use shr_infnan_mod , only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - use clm_time_manager , only : is_restart - use clm_varcon , only : c13ratio, c14ratio - use clm_varctl , only : use_lch4 - use CNSharedParamsMod, only : use_fun - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class (cnveg_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !------------------------------------------------------------------------ - - if (use_crop) then - - call restartvar(ncid=ncid, flag=flag, varname='grainc_xfer_to_grainc', xtype=ncd_double, & - dim1name='pft', & - long_name='grain C growth from storage', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_xfer_to_grainc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_to_litter', xtype=ncd_double, & - dim1name='pft', & - long_name='live stem C litterfall', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_to_litter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainc_to_food', xtype=ncd_double, & - dim1name='pft', & - long_name='grain C to food', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_to_food_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cpool_to_grainc', xtype=ncd_double, & - dim1name='pft', & - long_name='allocation to grain C', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_to_grainc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cpool_to_grainc_storage', xtype=ncd_double, & - dim1name='pft', & - long_name='allocation to grain C storage', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_to_grainc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cpool_grain_gr', xtype=ncd_double, & - dim1name='pft', & - long_name='grain growth respiration', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_grain_gr_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cpool_grain_storage_gr', xtype=ncd_double, & - dim1name='pft', & - long_name='grain growth respiration to storage', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_grain_storage_gr_patch) - - call restartvar(ncid=ncid, flag=flag, varname='transfer_grain_gr', xtype=ncd_double, & - dim1name='pft', & - long_name='grain growth respiration from storage', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%transfer_grain_gr_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainc_storage_to_xfer', xtype=ncd_double, & - dim1name='pft', & - long_name='grain C shift storage to transfer', units='gC/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_storage_to_xfer_patch) - - end if - - call restartvar(ncid=ncid, flag=flag, varname='gpp_pepv', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gpp_before_downreg_patch) - - call restartvar(ncid=ncid, flag=flag, varname='availc', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%availc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='xsmrpool_recover', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%xsmrpool_recover_patch) - - call restartvar(ncid=ncid, flag=flag, varname='plant_calloc', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%plant_calloc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='excess_cflux', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%excess_cflux_patch) - - call restartvar(ncid=ncid, flag=flag, varname='prev_leafc_to_litter', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%prev_leafc_to_litter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='prev_frootc_to_litter', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%prev_frootc_to_litter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tempsum_npp', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempsum_npp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annsum_npp', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_npp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='col_lag_npp', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%lag_npp_col) - - call restartvar(ncid=ncid, flag=flag, varname='cannsum_npp', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_npp_col) - - call restartvar(ncid=ncid, flag=flag, varname='tempsum_litfall', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempsum_litfall_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annsum_litfall', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_litfall_patch) - - if ( use_fun ) then - call restartvar(ncid=ncid, flag=flag, varname='leafc_to_litter_fun', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_to_litter_fun_patch) - ! BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 - call set_missing_vals_to_constant(this%leafc_to_litter_fun_patch, 0._r8) - end if - - end subroutine RestartBulkOnly - - - !----------------------------------------------------------------------- - subroutine RestartAllIsotopes ( this, bounds, ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon fluxes - fields present for both bulk C and isotopes - ! - ! !USES: - use ncdio_pio, only : file_desc_t - ! - ! !ARGUMENTS: - class (cnveg_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - !----------------------------------------------------------------------- - - call this%dwt_conv_cflux_dribbler%Restart(bounds, ncid, flag) - call this%hrv_xsmrpool_to_atm_dribbler%Restart(bounds, ncid, flag) - - end subroutine RestartAllIsotopes - - !----------------------------------------------------------------------- - subroutine SetValues ( this, & - num_patch, filter_patch, value_patch, & - num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set carbon state fluxes - ! - ! !ARGUMENTS: - class (cnveg_carbonflux_type) :: this - integer , intent(in) :: num_patch - integer , intent(in) :: filter_patch(:) - real(r8), intent(in) :: value_patch - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i ! loop index - integer :: j,k,l ! indices - !------------------------------------------------------------------------ - - do fi = 1,num_patch - i = filter_patch(fi) - - this%m_leafc_to_litter_patch(i) = value_patch - this%m_frootc_to_litter_patch(i) = value_patch - this%m_leafc_storage_to_litter_patch(i) = value_patch - this%m_frootc_storage_to_litter_patch(i) = value_patch - this%m_livestemc_storage_to_litter_patch(i) = value_patch - this%m_deadstemc_storage_to_litter_patch(i) = value_patch - this%m_livecrootc_storage_to_litter_patch(i) = value_patch - this%m_deadcrootc_storage_to_litter_patch(i) = value_patch - this%m_leafc_xfer_to_litter_patch(i) = value_patch - this%m_frootc_xfer_to_litter_patch(i) = value_patch - this%m_livestemc_xfer_to_litter_patch(i) = value_patch - this%m_deadstemc_xfer_to_litter_patch(i) = value_patch - this%m_livecrootc_xfer_to_litter_patch(i) = value_patch - this%m_deadcrootc_xfer_to_litter_patch(i) = value_patch - this%m_livestemc_to_litter_patch(i) = value_patch - this%m_deadstemc_to_litter_patch(i) = value_patch - this%m_livecrootc_to_litter_patch(i) = value_patch - this%m_deadcrootc_to_litter_patch(i) = value_patch - this%m_gresp_storage_to_litter_patch(i) = value_patch - this%m_gresp_xfer_to_litter_patch(i) = value_patch - this%hrv_leafc_to_litter_patch(i) = value_patch - this%hrv_leafc_storage_to_litter_patch(i) = value_patch - this%hrv_leafc_xfer_to_litter_patch(i) = value_patch - this%hrv_frootc_to_litter_patch(i) = value_patch - this%hrv_frootc_storage_to_litter_patch(i) = value_patch - this%hrv_frootc_xfer_to_litter_patch(i) = value_patch - this%hrv_livestemc_to_litter_patch(i) = value_patch - this%hrv_livestemc_storage_to_litter_patch(i) = value_patch - this%hrv_livestemc_xfer_to_litter_patch(i) = value_patch - this%hrv_deadstemc_storage_to_litter_patch(i) = value_patch - this%hrv_deadstemc_xfer_to_litter_patch(i) = value_patch - this%hrv_livecrootc_to_litter_patch(i) = value_patch - this%hrv_livecrootc_storage_to_litter_patch(i) = value_patch - this%hrv_livecrootc_xfer_to_litter_patch(i) = value_patch - this%hrv_deadcrootc_to_litter_patch(i) = value_patch - this%hrv_deadcrootc_storage_to_litter_patch(i) = value_patch - this%hrv_deadcrootc_xfer_to_litter_patch(i) = value_patch - this%hrv_gresp_storage_to_litter_patch(i) = value_patch - this%hrv_gresp_xfer_to_litter_patch(i) = value_patch - this%hrv_xsmrpool_to_atm_patch(i) = value_patch - - this%m_leafc_to_fire_patch(i) = value_patch - this%m_leafc_storage_to_fire_patch(i) = value_patch - this%m_leafc_xfer_to_fire_patch(i) = value_patch - this%m_livestemc_to_fire_patch(i) = value_patch - this%m_livestemc_storage_to_fire_patch(i) = value_patch - this%m_livestemc_xfer_to_fire_patch(i) = value_patch - this%m_deadstemc_to_fire_patch(i) = value_patch - this%m_deadstemc_storage_to_fire_patch(i) = value_patch - this%m_deadstemc_xfer_to_fire_patch(i) = value_patch - this%m_frootc_to_fire_patch(i) = value_patch - this%m_frootc_storage_to_fire_patch(i) = value_patch - this%m_frootc_xfer_to_fire_patch(i) = value_patch - this%m_livecrootc_to_fire_patch(i) = value_patch - this%m_livecrootc_storage_to_fire_patch(i) = value_patch - this%m_livecrootc_xfer_to_fire_patch(i) = value_patch - this%m_deadcrootc_to_fire_patch(i) = value_patch - this%m_deadcrootc_storage_to_fire_patch(i) = value_patch - this%m_deadcrootc_xfer_to_fire_patch(i) = value_patch - this%m_gresp_storage_to_fire_patch(i) = value_patch - this%m_gresp_xfer_to_fire_patch(i) = value_patch - - this%m_leafc_to_litter_fire_patch(i) = value_patch - this%m_leafc_storage_to_litter_fire_patch(i) = value_patch - this%m_leafc_xfer_to_litter_fire_patch(i) = value_patch - this%m_livestemc_to_litter_fire_patch(i) = value_patch - this%m_livestemc_storage_to_litter_fire_patch(i) = value_patch - this%m_livestemc_xfer_to_litter_fire_patch(i) = value_patch - this%m_livestemc_to_deadstemc_fire_patch(i) = value_patch - this%m_deadstemc_to_litter_fire_patch(i) = value_patch - this%m_deadstemc_storage_to_litter_fire_patch(i) = value_patch - this%m_deadstemc_xfer_to_litter_fire_patch(i) = value_patch - this%m_frootc_to_litter_fire_patch(i) = value_patch - this%m_frootc_storage_to_litter_fire_patch(i) = value_patch - this%m_frootc_xfer_to_litter_fire_patch(i) = value_patch - this%m_livecrootc_to_litter_fire_patch(i) = value_patch - this%m_livecrootc_storage_to_litter_fire_patch(i) = value_patch - this%m_livecrootc_xfer_to_litter_fire_patch(i) = value_patch - this%m_livecrootc_to_deadcrootc_fire_patch(i) = value_patch - this%m_deadcrootc_to_litter_fire_patch(i) = value_patch - this%m_deadcrootc_storage_to_litter_fire_patch(i) = value_patch - this%m_deadcrootc_xfer_to_litter_fire_patch(i) = value_patch - this%m_gresp_storage_to_litter_fire_patch(i) = value_patch - this%m_gresp_xfer_to_litter_fire_patch(i) = value_patch - - this%leafc_xfer_to_leafc_patch(i) = value_patch - this%frootc_xfer_to_frootc_patch(i) = value_patch - this%livestemc_xfer_to_livestemc_patch(i) = value_patch - this%deadstemc_xfer_to_deadstemc_patch(i) = value_patch - this%livecrootc_xfer_to_livecrootc_patch(i) = value_patch - this%deadcrootc_xfer_to_deadcrootc_patch(i) = value_patch - this%leafc_to_litter_patch(i) = value_patch - this%frootc_to_litter_patch(i) = value_patch - this%cpool_to_resp_patch(i) = value_patch - this%cpool_to_leafc_resp_patch(i) = value_patch - this%cpool_to_leafc_storage_resp_patch(i) = value_patch - this%cpool_to_frootc_resp_patch(i) = value_patch - this%cpool_to_frootc_storage_resp_patch(i) = value_patch - this%cpool_to_livecrootc_resp_patch(i) = value_patch - this%cpool_to_livecrootc_storage_resp_patch(i) = value_patch - this%cpool_to_livestemc_resp_patch(i) = value_patch - this%cpool_to_livestemc_storage_resp_patch(i) = value_patch - this%leaf_mr_patch(i) = value_patch - this%froot_mr_patch(i) = value_patch - this%livestem_mr_patch(i) = value_patch - this%livecroot_mr_patch(i) = value_patch - this%grain_mr_patch(i) = value_patch - this%leaf_curmr_patch(i) = value_patch - this%froot_curmr_patch(i) = value_patch - this%livestem_curmr_patch(i) = value_patch - this%livecroot_curmr_patch(i) = value_patch - this%grain_curmr_patch(i) = value_patch - this%leaf_xsmr_patch(i) = value_patch - this%froot_xsmr_patch(i) = value_patch - this%livestem_xsmr_patch(i) = value_patch - this%livecroot_xsmr_patch(i) = value_patch - this%grain_xsmr_patch(i) = value_patch - this%psnsun_to_cpool_patch(i) = value_patch - this%psnshade_to_cpool_patch(i) = value_patch - this%cpool_to_xsmrpool_patch(i) = value_patch - this%cpool_to_leafc_patch(i) = value_patch - this%cpool_to_leafc_storage_patch(i) = value_patch - this%cpool_to_frootc_patch(i) = value_patch - this%cpool_to_frootc_storage_patch(i) = value_patch - this%cpool_to_livestemc_patch(i) = value_patch - this%cpool_to_livestemc_storage_patch(i) = value_patch - this%cpool_to_deadstemc_patch(i) = value_patch - this%cpool_to_deadstemc_storage_patch(i) = value_patch - this%cpool_to_livecrootc_patch(i) = value_patch - this%cpool_to_livecrootc_storage_patch(i) = value_patch - this%cpool_to_deadcrootc_patch(i) = value_patch - this%cpool_to_deadcrootc_storage_patch(i) = value_patch - this%cpool_to_gresp_storage_patch(i) = value_patch - this%cpool_leaf_gr_patch(i) = value_patch - this%cpool_leaf_storage_gr_patch(i) = value_patch - this%transfer_leaf_gr_patch(i) = value_patch - this%cpool_froot_gr_patch(i) = value_patch - this%cpool_froot_storage_gr_patch(i) = value_patch - this%transfer_froot_gr_patch(i) = value_patch - this%cpool_livestem_gr_patch(i) = value_patch - this%cpool_livestem_storage_gr_patch(i) = value_patch - this%transfer_livestem_gr_patch(i) = value_patch - this%cpool_deadstem_gr_patch(i) = value_patch - this%cpool_deadstem_storage_gr_patch(i) = value_patch - this%transfer_deadstem_gr_patch(i) = value_patch - this%cpool_livecroot_gr_patch(i) = value_patch - this%cpool_livecroot_storage_gr_patch(i) = value_patch - this%transfer_livecroot_gr_patch(i) = value_patch - this%cpool_deadcroot_gr_patch(i) = value_patch - this%cpool_deadcroot_storage_gr_patch(i) = value_patch - this%transfer_deadcroot_gr_patch(i) = value_patch - this%leafc_storage_to_xfer_patch(i) = value_patch - this%frootc_storage_to_xfer_patch(i) = value_patch - this%livestemc_storage_to_xfer_patch(i) = value_patch - this%deadstemc_storage_to_xfer_patch(i) = value_patch - this%livecrootc_storage_to_xfer_patch(i) = value_patch - this%deadcrootc_storage_to_xfer_patch(i) = value_patch - this%gresp_storage_to_xfer_patch(i) = value_patch - this%livestemc_to_deadstemc_patch(i) = value_patch - this%livecrootc_to_deadcrootc_patch(i) = value_patch - - this%current_gr_patch(i) = value_patch - this%transfer_gr_patch(i) = value_patch - this%storage_gr_patch(i) = value_patch - this%frootc_alloc_patch(i) = value_patch - this%frootc_loss_patch(i) = value_patch - this%leafc_alloc_patch(i) = value_patch - this%leafc_loss_patch(i) = value_patch - this%woodc_alloc_patch(i) = value_patch - this%woodc_loss_patch(i) = value_patch - - this%crop_seedc_to_leaf_patch(i) = value_patch - this%grainc_to_cropprodc_patch(i) = value_patch - end do - - if ( use_crop )then - do fi = 1,num_patch - i = filter_patch(fi) - this%xsmrpool_to_atm_patch(i) = value_patch - this%livestemc_to_litter_patch(i) = value_patch - this%grainc_to_food_patch(i) = value_patch - this%grainc_to_seed_patch(i) = value_patch - this%grainc_xfer_to_grainc_patch(i) = value_patch - this%cpool_to_grainc_patch(i) = value_patch - this%cpool_to_grainc_storage_patch(i) = value_patch - this%cpool_grain_gr_patch(i) = value_patch - this%cpool_grain_storage_gr_patch(i) = value_patch - this%transfer_grain_gr_patch(i) = value_patch - this%grainc_storage_to_xfer_patch(i) = value_patch - end do - end if - - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - - this%phenology_c_to_litr_met_c_col(i,j) = value_column - this%phenology_c_to_litr_cel_c_col(i,j) = value_column - this%phenology_c_to_litr_lig_c_col(i,j) = value_column - - this%gap_mortality_c_to_litr_met_c_col(i,j) = value_column - this%gap_mortality_c_to_litr_cel_c_col(i,j) = value_column - this%gap_mortality_c_to_litr_lig_c_col(i,j) = value_column - this%gap_mortality_c_to_cwdc_col(i,j) = value_column - - this%fire_mortality_c_to_cwdc_col(i,j) = value_column - this%m_c_to_litr_met_fire_col(i,j) = value_column - this%m_c_to_litr_cel_fire_col(i,j) = value_column - this%m_c_to_litr_lig_fire_col(i,j) = value_column - - this%harvest_c_to_litr_met_c_col(i,j) = value_column - this%harvest_c_to_litr_cel_c_col(i,j) = value_column - this%harvest_c_to_litr_lig_c_col(i,j) = value_column - this%harvest_c_to_cwdc_col(i,j) = value_column - - end do - end do - - do k = 1, ndecomp_pools - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%m_decomp_cpools_to_fire_vr_col(i,j,k) = value_column - end do - end do - end do - - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%m_decomp_cpools_to_fire_col(i,k) = value_column - end do - end do - - do fi = 1,num_column - i = filter_column(fi) - - this%grainc_to_cropprodc_col(i) = value_column - this%cwdc_hr_col(i) = value_column - this%cwdc_loss_col(i) = value_column - this%litterc_loss_col(i) = value_column - end do - - do fi = 1,num_patch - i = filter_patch(fi) - - this%gpp_patch(i) = value_patch - this%mr_patch(i) = value_patch - this%gr_patch(i) = value_patch - this%ar_patch(i) = value_patch - this%rr_patch(i) = value_patch - this%npp_patch(i) = value_patch - this%agnpp_patch(i) = value_patch - this%bgnpp_patch(i) = value_patch - this%litfall_patch(i) = value_patch - this%wood_harvestc_patch(i) = value_patch - this%slash_harvestc_patch(i) = value_patch - this%cinputs_patch(i) = value_patch - this%coutputs_patch(i) = value_patch - this%fire_closs_patch(i) = value_patch - this%npp_Nactive_patch(i) = value_patch - this%npp_burnedoff_patch(i) = value_patch - this%npp_Nnonmyc_patch(i) = value_patch - this%npp_Nam_patch(i) = value_patch - this%npp_Necm_patch(i) = value_patch - this%npp_Nactive_no3_patch(i) = value_patch - this%npp_Nactive_nh4_patch(i) = value_patch - this%npp_Nnonmyc_no3_patch(i) = value_patch - this%npp_Nnonmyc_nh4_patch(i) = value_patch - this%npp_Nam_no3_patch(i) = value_patch - this%npp_Nam_nh4_patch(i) = value_patch - this%npp_Necm_no3_patch(i) = value_patch - this%npp_Necm_nh4_patch(i) = value_patch - this%npp_Nfix_patch(i) = value_patch - this%npp_Nretrans_patch(i) = value_patch - this%npp_Nuptake_patch(i) = value_patch - this%npp_growth_patch(i) = value_patch - this%leafc_change_patch(i) = value_patch - this%soilc_change_patch(i) = value_patch - end do - - do fi = 1,num_column - i = filter_column(fi) - - this%sr_col(i) = value_column - this%er_col(i) = value_column - this%litfire_col(i) = value_column - this%somfire_col(i) = value_column - this%totfire_col(i) = value_column - this%fire_closs_col(i) = value_column - - ! Zero p2c column fluxes - this%rr_col(i) = value_column - this%ar_col(i) = value_column - this%gpp_col(i) = value_column - this%npp_col(i) = value_column - this%fire_closs_col(i) = value_column - this%wood_harvestc_col(i) = value_column - this%hrv_xsmrpool_to_atm_col(i) = value_column - - this%nep_col(i) = value_column - - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine ZeroDwt( this, bounds ) - ! - ! !DESCRIPTION - ! Initialize flux variables needed for dynamic land use. - ! - ! !ARGUMENTS: - class(cnveg_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c, g, j ! indices - !----------------------------------------------------------------------- - - ! set conversion and product pool fluxes to 0 at the beginning of every timestep - - do g = bounds%begg, bounds%endg - this%dwt_seedc_to_leaf_grc(g) = 0._r8 - this%dwt_seedc_to_deadstem_grc(g) = 0._r8 - this%dwt_conv_cflux_grc(g) = 0._r8 - end do - - do c = bounds%begc,bounds%endc - this%dwt_slash_cflux_col(c) = 0._r8 - end do - - do j = 1, nlevdecomp_full - do c = bounds%begc,bounds%endc - this%dwt_frootc_to_litr_met_c_col(c,j) = 0._r8 - this%dwt_frootc_to_litr_cel_c_col(c,j) = 0._r8 - this%dwt_frootc_to_litr_lig_c_col(c,j) = 0._r8 - this%dwt_livecrootc_to_cwdc_col(c,j) = 0._r8 - this%dwt_deadcrootc_to_cwdc_col(c,j) = 0._r8 - end do - end do - - end subroutine ZeroDwt - - !----------------------------------------------------------------------- - subroutine Summary_carbonflux(this, & - bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - isotope, soilbiogeochem_hr_col, soilbiogeochem_lithr_col, & - soilbiogeochem_decomp_cascade_ctransfer_col, & - product_closs_grc) - ! - ! !DESCRIPTION: - ! Perform patch and column-level carbon summary calculations - ! - ! !USES: - use clm_time_manager , only: get_step_size - use clm_varcon , only: secspday - use clm_varctl , only: nfix_timeconst, carbon_resp_opt - use subgridAveMod , only: p2c, c2g - use SoilBiogeochemDecompCascadeConType , only: decomp_cascade_con - use CNSharedParamsMod , only: use_fun - ! - ! !ARGUMENTS: - class(cnveg_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - character(len=*) , intent(in) :: isotope - real(r8) , intent(in) :: soilbiogeochem_hr_col(bounds%begc:) - real(r8) , intent(in) :: soilbiogeochem_lithr_col(bounds%begc:) - real(r8) , intent(in) :: soilbiogeochem_decomp_cascade_ctransfer_col(bounds%begc:,1:) - real(r8) , intent(in) :: product_closs_grc(bounds%begg:) - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l,g ! indices - integer :: fp,fc ! lake filter indices - real(r8) :: nfixlags, dtime ! temp variables for making lagged npp - real(r8) :: maxdepth ! depth to integrate soil variables - real(r8) :: nep_grc(bounds%begg:bounds%endg) ! nep_col averaged to gridcell - real(r8) :: fire_closs_grc(bounds%begg:bounds%endg) ! fire_closs_col averaged to gridcell - real(r8) :: hrv_xsmrpool_to_atm_grc(bounds%begg:bounds%endg) ! hrv_xsmrpool_to_atm_col averaged to gridcell (gC/m2/s) - real(r8) :: hrv_xsmrpool_to_atm_delta_grc(bounds%begg:bounds%endg) ! hrv_xsmrpool_to_atm_col averaged to gridcell, expressed as a delta (not a flux) (gC/m2) - real(r8) :: hrv_xsmrpool_to_atm_dribbled_grc(bounds%begg:bounds%endg) ! hrv_xsmrpool_to_atm, dribbled over the year (gC/m2/s) - real(r8) :: dwt_conv_cflux_delta_grc(bounds%begg:bounds%endg) ! dwt_conv_cflux_grc expressed as a total delta (not a flux) (gC/m2) - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(product_closs_grc) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - ! calculate patch-level summary carbon fluxes and states - - dtime = get_step_size() - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! maintenance respiration (MR) - if ( trim(isotope) == 'c13' .or. trim(isotope) == 'c14') then - this%leaf_mr_patch(p) = this%leaf_curmr_patch(p) + this%leaf_xsmr_patch(p) - this%froot_mr_patch(p) = this%froot_curmr_patch(p) + this%froot_xsmr_patch(p) - this%livestem_mr_patch(p) = this%livestem_curmr_patch(p) + this%livestem_xsmr_patch(p) - this%livecroot_mr_patch(p) = this%livecroot_curmr_patch(p) + this%livecroot_xsmr_patch(p) - endif - - this%mr_patch(p) = & - this%leaf_mr_patch(p) + & - this%froot_mr_patch(p) + & - this%livestem_mr_patch(p) + & - this%livecroot_mr_patch(p) - - if (carbon_resp_opt == 1) then - this%mr_patch(p) = & - this%cpool_to_resp_patch(p) + & - this%leaf_mr_patch(p) + & - this%froot_mr_patch(p) + & - this%livestem_mr_patch(p) + & - this%livecroot_mr_patch(p) - end if - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%mr_patch(p) = & - this%mr_patch(p) + & - this%grain_mr_patch(p) - end if - - ! growth respiration (GR) - - ! current GR is respired this time step for new growth displayed in this timestep - this%current_gr_patch(p) = & - this%cpool_leaf_gr_patch(p) + & - this%cpool_froot_gr_patch(p) + & - this%cpool_livestem_gr_patch(p) + & - this%cpool_deadstem_gr_patch(p) + & - this%cpool_livecroot_gr_patch(p) + & - this%cpool_deadcroot_gr_patch(p) - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%current_gr_patch(p) = this%current_gr_patch(p) + & - this%cpool_grain_gr_patch(p) - end if - - - ! transfer GR is respired this time step for transfer growth displayed in this timestep - this%transfer_gr_patch(p) = & - this%transfer_leaf_gr_patch(p) + & - this%transfer_froot_gr_patch(p) + & - this%transfer_livestem_gr_patch(p) + & - this%transfer_deadstem_gr_patch(p) + & - this%transfer_livecroot_gr_patch(p) + & - this%transfer_deadcroot_gr_patch(p) - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%transfer_gr_patch(p) = this%transfer_gr_patch(p) + & - this%transfer_grain_gr_patch(p) - end if - - ! storage GR is respired this time step for growth sent to storage for later display - this%storage_gr_patch(p) = & - this%cpool_leaf_storage_gr_patch(p) + & - this%cpool_froot_storage_gr_patch(p) + & - this%cpool_livestem_storage_gr_patch(p) + & - this%cpool_deadstem_storage_gr_patch(p) + & - this%cpool_livecroot_storage_gr_patch(p) + & - this%cpool_deadcroot_storage_gr_patch(p) - - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%storage_gr_patch(p) = this%storage_gr_patch(p) + & - this%cpool_grain_storage_gr_patch(p) - end if - - ! GR is the sum of current + transfer + storage GR - this%gr_patch(p) = & - this%current_gr_patch(p) + & - this%transfer_gr_patch(p) + & - this%storage_gr_patch(p) - - ! autotrophic respiration (AR) adn - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%ar_patch(p) = & - this%mr_patch(p) + & - this%gr_patch(p) + & - this%xsmrpool_to_atm_patch(p) ! xsmr... is -ve (slevis) - else - this%ar_patch(p) = & - this%mr_patch(p) + & - this%gr_patch(p) - end if - - if (use_fun) then - this%ar_patch(p) = this%ar_patch(p) + this%soilc_change_patch(p) - end if - - ! gross primary production (GPP) - this%gpp_patch(p) = & - this%psnsun_to_cpool_patch(p) + & - this%psnshade_to_cpool_patch(p) - - ! net primary production (NPP) - this%npp_patch(p) = & - this%gpp_patch(p) - & - this%ar_patch(p) - - ! root respiration (RR) - this%rr_patch(p) = & - this%froot_mr_patch(p) + & - this%cpool_froot_gr_patch(p) + & - this%cpool_livecroot_gr_patch(p) + & - this%cpool_deadcroot_gr_patch(p) + & - this%transfer_froot_gr_patch(p) + & - this%transfer_livecroot_gr_patch(p) + & - this%transfer_deadcroot_gr_patch(p) + & - this%cpool_froot_storage_gr_patch(p) + & - this%cpool_livecroot_storage_gr_patch(p) + & - this%cpool_deadcroot_storage_gr_patch(p) - - ! update the annual NPP accumulator, for use in allocation code - if (trim(isotope) == 'bulk') then - this%tempsum_npp_patch(p) = & - this%tempsum_npp_patch(p) + & - this%npp_patch(p) - end if - - ! aboveground NPP: leaf, live stem, dead stem (AGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of AGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - - this%agnpp_patch(p) = & - this%cpool_to_leafc_patch(p) + & - this%leafc_xfer_to_leafc_patch(p) + & - this%cpool_to_livestemc_patch(p) + & - this%livestemc_xfer_to_livestemc_patch(p) + & - this%cpool_to_deadstemc_patch(p) + & - this%deadstemc_xfer_to_deadstemc_patch(p) - - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%agnpp_patch(p) = & - this%agnpp_patch(p) + & - this%cpool_to_grainc_patch(p) + & - this%grainc_xfer_to_grainc_patch(p) - end if - - ! belowground NPP: fine root, live coarse root, dead coarse root (BGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of BGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - - this%bgnpp_patch(p) = & - this%cpool_to_frootc_patch(p) + & - this%frootc_xfer_to_frootc_patch(p) + & - this%cpool_to_livecrootc_patch(p) + & - this%livecrootc_xfer_to_livecrootc_patch(p) + & - this%cpool_to_deadcrootc_patch(p) + & - this%deadcrootc_xfer_to_deadcrootc_patch(p) - - ! litterfall (LITFALL) - - this%litfall_patch(p) = & - this%leafc_to_litter_patch(p) + & - this%frootc_to_litter_patch(p) + & - this%m_leafc_to_litter_patch(p) + & - this%m_leafc_storage_to_litter_patch(p) + & - this%m_leafc_xfer_to_litter_patch(p) + & - this%m_frootc_to_litter_patch(p) + & - this%m_frootc_storage_to_litter_patch(p) + & - this%m_frootc_xfer_to_litter_patch(p) + & - this%m_livestemc_to_litter_patch(p) + & - this%m_livestemc_storage_to_litter_patch(p) + & - this%m_livestemc_xfer_to_litter_patch(p) + & - this%m_deadstemc_to_litter_patch(p) + & - this%m_deadstemc_storage_to_litter_patch(p) + & - this%m_deadstemc_xfer_to_litter_patch(p) + & - this%m_livecrootc_to_litter_patch(p) + & - this%m_livecrootc_storage_to_litter_patch(p) + & - this%m_livecrootc_xfer_to_litter_patch(p) + & - this%m_deadcrootc_to_litter_patch(p) + & - this%m_deadcrootc_storage_to_litter_patch(p) + & - this%m_deadcrootc_xfer_to_litter_patch(p) + & - this%m_gresp_storage_to_litter_patch(p) + & - this%m_gresp_xfer_to_litter_patch(p) + & - - this%m_leafc_to_litter_fire_patch(p) + & - this%m_leafc_storage_to_litter_fire_patch(p) + & - this%m_leafc_xfer_to_litter_fire_patch(p) + & - this%m_livestemc_to_litter_fire_patch(p) + & - this%m_livestemc_storage_to_litter_fire_patch(p) + & - this%m_livestemc_xfer_to_litter_fire_patch(p) + & - this%m_deadstemc_to_litter_fire_patch(p) + & - this%m_deadstemc_storage_to_litter_fire_patch(p) + & - this%m_deadstemc_xfer_to_litter_fire_patch(p) + & - this%m_frootc_to_litter_fire_patch(p) + & - this%m_frootc_storage_to_litter_fire_patch(p) + & - this%m_frootc_xfer_to_litter_fire_patch(p) + & - this%m_livecrootc_to_litter_fire_patch(p) + & - this%m_livecrootc_storage_to_litter_fire_patch(p) + & - this%m_livecrootc_xfer_to_litter_fire_patch(p) + & - this%m_deadcrootc_to_litter_fire_patch(p) + & - this%m_deadcrootc_storage_to_litter_fire_patch(p) + & - this%m_deadcrootc_xfer_to_litter_fire_patch(p) + & - this%m_gresp_storage_to_litter_fire_patch(p) + & - this%m_gresp_xfer_to_litter_fire_patch(p) + & - - this%hrv_leafc_to_litter_patch(p) + & - this%hrv_leafc_storage_to_litter_patch(p) + & - this%hrv_leafc_xfer_to_litter_patch(p) + & - this%hrv_frootc_to_litter_patch(p) + & - this%hrv_frootc_storage_to_litter_patch(p) + & - this%hrv_frootc_xfer_to_litter_patch(p) + & - this%hrv_livestemc_to_litter_patch(p) + & - this%hrv_livestemc_storage_to_litter_patch(p) + & - this%hrv_livestemc_xfer_to_litter_patch(p) + & - this%hrv_deadstemc_storage_to_litter_patch(p) + & - this%hrv_deadstemc_xfer_to_litter_patch(p) + & - this%hrv_livecrootc_to_litter_patch(p) + & - this%hrv_livecrootc_storage_to_litter_patch(p) + & - this%hrv_livecrootc_xfer_to_litter_patch(p) + & - this%hrv_deadcrootc_to_litter_patch(p) + & - this%hrv_deadcrootc_storage_to_litter_patch(p) + & - this%hrv_deadcrootc_xfer_to_litter_patch(p) + & - this%hrv_gresp_storage_to_litter_patch(p) + & - this%hrv_gresp_xfer_to_litter_patch(p) - - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%litfall_patch(p) = & - this%litfall_patch(p) + & - this%livestemc_to_litter_patch(p) - - if (.not. use_grainproduct) then - this%litfall_patch(p) = & - this%litfall_patch(p) + & - this%grainc_to_food_patch(p) - end if - end if - - ! update the annual litfall accumulator, for use in mortality code - - if (use_cndv) then - this%tempsum_litfall_patch(p) = & - this%tempsum_litfall_patch(p) + & - this%leafc_to_litter_patch(p) + & - this%frootc_to_litter_patch(p) - end if - - ! patch-level carbon losses to fire changed by F. Li and S. Levis - - this%fire_closs_patch(p) = & - this%m_leafc_to_fire_patch(p) + & - this%m_leafc_storage_to_fire_patch(p) + & - this%m_leafc_xfer_to_fire_patch(p) + & - this%m_frootc_to_fire_patch(p) + & - this%m_frootc_storage_to_fire_patch(p) + & - this%m_frootc_xfer_to_fire_patch(p) + & - this%m_livestemc_to_fire_patch(p) + & - this%m_livestemc_storage_to_fire_patch(p) + & - this%m_livestemc_xfer_to_fire_patch(p) + & - this%m_deadstemc_to_fire_patch(p) + & - this%m_deadstemc_storage_to_fire_patch(p) + & - this%m_deadstemc_xfer_to_fire_patch(p) + & - this%m_livecrootc_to_fire_patch(p) + & - this%m_livecrootc_storage_to_fire_patch(p) + & - this%m_livecrootc_xfer_to_fire_patch(p) + & - this%m_deadcrootc_to_fire_patch(p) + & - this%m_deadcrootc_storage_to_fire_patch(p) + & - this%m_deadcrootc_xfer_to_fire_patch(p) + & - this%m_gresp_storage_to_fire_patch(p) + & - this%m_gresp_xfer_to_fire_patch(p) - - ! new summary variables for CLAMP - - ! (FROOTC_ALLOC) - fine root C allocation - this%frootc_alloc_patch(p) = & - this%frootc_xfer_to_frootc_patch(p) + & - this%cpool_to_frootc_patch(p) - - ! (FROOTC_LOSS) - fine root C loss changed by F. Li and S. Levis - this%frootc_loss_patch(p) = & - this%m_frootc_to_litter_patch(p) + & - this%m_frootc_to_fire_patch(p) + & - this%m_frootc_to_litter_fire_patch(p) + & - this%hrv_frootc_to_litter_patch(p) + & - this%frootc_to_litter_patch(p) - - ! (LEAFC_ALLOC) - leaf C allocation - this%leafc_alloc_patch(p) = & - this%leafc_xfer_to_leafc_patch(p) + & - this%cpool_to_leafc_patch(p) - - ! (LEAFC_LOSS) - leaf C loss changed by F. Li and S. Levis - this%leafc_loss_patch(p) = & - this%m_leafc_to_litter_patch(p) + & - this%m_leafc_to_fire_patch(p) + & - this%m_leafc_to_litter_fire_patch(p) + & - this%hrv_leafc_to_litter_patch(p) + & - this%leafc_to_litter_patch(p) - - ! (WOODC_ALLOC) - wood C allocation - this%woodc_alloc_patch(p) = & - this%livestemc_xfer_to_livestemc_patch(p) + & - this%deadstemc_xfer_to_deadstemc_patch(p) + & - this%livecrootc_xfer_to_livecrootc_patch(p) + & - this%deadcrootc_xfer_to_deadcrootc_patch(p) + & - this%cpool_to_livestemc_patch(p) + & - this%cpool_to_deadstemc_patch(p) + & - this%cpool_to_livecrootc_patch(p) + & - this%cpool_to_deadcrootc_patch(p) - - ! (WOODC_LOSS) - wood C loss - this%woodc_loss_patch(p) = & - this%m_livestemc_to_litter_patch(p) + & - this%m_deadstemc_to_litter_patch(p) + & - this%m_livecrootc_to_litter_patch(p) + & - this%m_deadcrootc_to_litter_patch(p) + & - this%m_livestemc_to_fire_patch(p) + & - this%m_deadstemc_to_fire_patch(p) + & - this%m_livecrootc_to_fire_patch(p) + & - this%m_deadcrootc_to_fire_patch(p) + & - this%hrv_livestemc_to_litter_patch(p) + & - this%hrv_livestemc_storage_to_litter_patch(p) + & - this%hrv_livestemc_xfer_to_litter_patch(p) + & - this%wood_harvestc_patch(p) + & - this%hrv_deadstemc_storage_to_litter_patch(p) + & - this%hrv_deadstemc_xfer_to_litter_patch(p) + & - this%hrv_livecrootc_to_litter_patch(p) + & - this%hrv_livecrootc_storage_to_litter_patch(p) + & - this%hrv_livecrootc_xfer_to_litter_patch(p) + & - this%hrv_deadcrootc_to_litter_patch(p) + & - this%hrv_deadcrootc_storage_to_litter_patch(p) + & - this%hrv_deadcrootc_xfer_to_litter_patch(p) - - ! (Slash Harvest Flux) - Additional Wood Harvest Veg C Losses - this%slash_harvestc_patch(p) = & - this%hrv_leafc_to_litter_patch(p) + & - this%hrv_leafc_storage_to_litter_patch(p) + & - this%hrv_leafc_xfer_to_litter_patch(p) + & - this%hrv_frootc_to_litter_patch(p) + & - this%hrv_frootc_storage_to_litter_patch(p) + & - this%hrv_frootc_xfer_to_litter_patch(p) + & - this%hrv_livestemc_to_litter_patch(p) + & - this%hrv_livestemc_storage_to_litter_patch(p) + & - this%hrv_livestemc_xfer_to_litter_patch(p) + & - this%hrv_deadstemc_storage_to_litter_patch(p) + & - this%hrv_deadstemc_xfer_to_litter_patch(p) + & - this%hrv_livecrootc_to_litter_patch(p) + & - this%hrv_livecrootc_storage_to_litter_patch(p) + & - this%hrv_livecrootc_xfer_to_litter_patch(p) + & - this%hrv_deadcrootc_to_litter_patch(p) + & - this%hrv_deadcrootc_storage_to_litter_patch(p) + & - this%hrv_deadcrootc_xfer_to_litter_patch(p) + & - this%hrv_xsmrpool_to_atm_patch(p) + & - this%hrv_gresp_storage_to_litter_patch(p) + & - this%hrv_gresp_xfer_to_litter_patch(p) - - end do ! end of patches loop - - !------------------------------------------------ - ! column variables - !------------------------------------------------ - - ! use p2c routine to get selected column-average patch-level fluxes and states - - call p2c(bounds, num_soilc, filter_soilc, & - this%hrv_xsmrpool_to_atm_patch(bounds%begp:bounds%endp), & - this%hrv_xsmrpool_to_atm_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%fire_closs_patch(bounds%begp:bounds%endp), & - this%fire_closs_p2c_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%npp_patch(bounds%begp:bounds%endp), & - this%npp_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%rr_patch(bounds%begp:bounds%endp), & - this%rr_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%ar_patch(bounds%begp:bounds%endp), & - this%ar_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%gpp_patch(bounds%begp:bounds%endp), & - this%gpp_col(bounds%begc:bounds%endc)) - - ! this code is to calculate an exponentially-relaxed npp value for use in NDynamics code - - if ( trim(isotope) == 'bulk') then - if (nfix_timeconst > 0._r8 .and. nfix_timeconst < 500._r8 ) then - nfixlags = nfix_timeconst * secspday - do fc = 1,num_soilc - c = filter_soilc(fc) - if ( this%lag_npp_col(c) /= spval ) then - this%lag_npp_col(c) = & - this%lag_npp_col(c) * exp(-dtime/nfixlags) + & - this%npp_col(c) * (1._r8 - exp(-dtime/nfixlags)) - else - ! first timestep - this%lag_npp_col(c) = this%npp_col(c) - endif - end do - endif - endif - - - ! vertically integrate column-level carbon fire losses - do l = 1, ndecomp_pools - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%m_decomp_cpools_to_fire_col(c,l) = & - this%m_decomp_cpools_to_fire_col(c,l) + & - this%m_decomp_cpools_to_fire_vr_col(c,j,l)*dzsoi_decomp(j) - end do - end do - end do - - do fc = 1,num_soilc - c = filter_soilc(fc) - - g = col%gridcell(c) - - ! litter fire losses (LITFIRE) - this%litfire_col(c) = 0._r8 - - ! soil organic matter fire losses (SOMFIRE) - this%somfire_col(c) = 0._r8 - - ! total ecosystem fire losses (TOTFIRE) - this%totfire_col(c) = & - this%litfire_col(c) + & - this%somfire_col(c) - - ! carbon losses to fire, including patch losses - this%fire_closs_col(c) = this%fire_closs_p2c_col(c) - do l = 1, ndecomp_pools - this%fire_closs_col(c) = & - this%fire_closs_col(c) + & - this%m_decomp_cpools_to_fire_col(c,l) - end do - - ! total soil respiration, heterotrophic + root respiration (SR) - this%sr_col(c) = & - this%rr_col(c) + & - soilbiogeochem_hr_col(c) - - ! total ecosystem respiration, autotrophic + heterotrophic (ER) - this%er_col(c) = & - this%ar_col(c) + & - soilbiogeochem_hr_col(c) - - ! coarse woody debris heterotrophic respiration - this%cwdc_hr_col(c) = 0._r8 - - ! net ecosystem production, excludes fire flux, landcover change, - ! and loss from wood products, positive for sink (NEP) - this%nep_col(c) = & - this%gpp_col(c) - & - this%er_col(c) - - end do - - call c2g( bounds = bounds, & - carr = this%nep_col(bounds%begc:bounds%endc), & - garr = nep_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - call c2g( bounds = bounds, & - carr = this%fire_closs_col(bounds%begc:bounds%endc), & - garr = fire_closs_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - call c2g( bounds = bounds, & - carr = this%hrv_xsmrpool_to_atm_col(bounds%begc:bounds%endc), & - garr = hrv_xsmrpool_to_atm_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - hrv_xsmrpool_to_atm_delta_grc(bounds%begg:bounds%endg) = & - hrv_xsmrpool_to_atm_grc(bounds%begg:bounds%endg) * dtime - call this%hrv_xsmrpool_to_atm_dribbler%set_curr_delta(bounds, & - hrv_xsmrpool_to_atm_delta_grc(bounds%begg:bounds%endg)) - call this%hrv_xsmrpool_to_atm_dribbler%get_curr_flux(bounds, & - hrv_xsmrpool_to_atm_dribbled_grc(bounds%begg:bounds%endg)) - - dwt_conv_cflux_delta_grc(bounds%begg:bounds%endg) = & - this%dwt_conv_cflux_grc(bounds%begg:bounds%endg) * dtime - call this%dwt_conv_cflux_dribbler%set_curr_delta(bounds, & - dwt_conv_cflux_delta_grc(bounds%begg:bounds%endg)) - call this%dwt_conv_cflux_dribbler%get_curr_flux(bounds, & - this%dwt_conv_cflux_dribbled_grc(bounds%begg:bounds%endg)) - - do g = bounds%begg, bounds%endg - ! net ecosystem exchange of carbon, includes fire flux and hrv_xsmrpool flux, - ! positive for source (NEE) - this%nee_grc(g) = & - -nep_grc(g) + & - fire_closs_grc(g) + & - hrv_xsmrpool_to_atm_dribbled_grc(g) - - this%landuseflux_grc(g) = & - this%dwt_conv_cflux_dribbled_grc(g) + & - product_closs_grc(g) - - ! net biome production of carbon, positive for sink - this%nbp_grc(g) = & - -this%nee_grc(g) - & - this%landuseflux_grc(g) - end do - - ! coarse woody debris C loss - do fc = 1,num_soilc - c = filter_soilc(fc) - this%cwdc_loss_col(c) = 0._r8 - end do - associate(is_cwd => decomp_cascade_con%is_cwd) ! TRUE => pool is a cwd pool - do l = 1, ndecomp_pools - if ( is_cwd(l) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%cwdc_loss_col(c) = & - this%cwdc_loss_col(c) + & - this%m_decomp_cpools_to_fire_col(c,l) - end do - end if - end do - do k = 1, ndecomp_cascade_transitions - if ( is_cwd(decomp_cascade_con%cascade_donor_pool(k)) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%cwdc_loss_col(c) = & - this%cwdc_loss_col(c) + & - soilbiogeochem_decomp_cascade_ctransfer_col(c,k) - end do - end if - end do - end associate - - - ! litter C loss - do fc = 1,num_soilc - c = filter_soilc(fc) - this%litterc_loss_col(c) = soilbiogeochem_lithr_col(c) - end do - associate(is_litter => decomp_cascade_con%is_litter) ! TRUE => pool is a litter pool - do l = 1, ndecomp_pools - if ( is_litter(l) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%litterc_loss_col(c) = & - this%litterc_loss_col(c) + & - this%m_decomp_cpools_to_fire_col(c,l) - end do - end if - end do - do k = 1, ndecomp_cascade_transitions - if ( is_litter(decomp_cascade_con%cascade_donor_pool(k)) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%litterc_loss_col(c) = & - this%litterc_loss_col(c) + & - soilbiogeochem_decomp_cascade_ctransfer_col(c,k) - end do - end if - end do - end associate - - end subroutine Summary_carbonflux - -end module CNVegCarbonFluxType - - diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90 deleted file mode 100644 index 41eb79134f..0000000000 --- a/src/biogeochem/CNVegCarbonStateType.F90 +++ /dev/null @@ -1,2743 +0,0 @@ -module CNVegCarbonStateType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_const_mod , only : SHR_CONST_PDB - use shr_log_mod , only : errMsg => shr_log_errMsg - use pftconMod , only : noveg, npcropmin, pftcon - use clm_varcon , only : spval, c3_r2, c4_r2, c14ratio - use clm_varctl , only : iulog, use_cndv, use_crop - use decompMod , only : bounds_type - use abortutils , only : endrun - use spmdMod , only : masterproc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use CNSpeciesMod , only : species_from_string, CN_SPECIES_C12 - use dynPatchStateUpdaterMod, only : patch_state_updater_type - use CNVegComputeSeedMod, only : ComputeSeedAmounts - ! - ! !PUBLIC TYPES: - implicit none - private - ! - - type, public :: cnveg_carbonstate_type - - integer :: species ! c12, c13, c14 - - real(r8), pointer :: grainc_patch (:) ! (gC/m2) grain C (crop model) - real(r8), pointer :: grainc_storage_patch (:) ! (gC/m2) grain C storage (crop model) - real(r8), pointer :: grainc_xfer_patch (:) ! (gC/m2) grain C transfer (crop model) - real(r8), pointer :: leafc_patch (:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage_patch (:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer_patch (:) ! (gC/m2) leaf C transfer - real(r8), pointer :: leafc_storage_xfer_acc_patch (:) ! (gC/m2) Accmulated leaf C transfer - real(r8), pointer :: storage_cdemand_patch (:) ! (gC/m2) C use from the C storage pool - real(r8), pointer :: frootc_patch (:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage_patch (:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer_patch (:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_patch (:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage_patch (:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer_patch (:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_patch (:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage_patch (:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer_patch (:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_patch (:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage_patch (:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer_patch (:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_patch (:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage_patch (:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer_patch (:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: gresp_storage_patch (:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer_patch (:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: cpool_patch (:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool_patch (:) ! (gC/m2) abstract C pool to meet excess MR demand - real(r8), pointer :: ctrunc_patch (:) ! (gC/m2) patch-level sink for C truncation - real(r8), pointer :: woodc_patch (:) ! (gC/m2) wood C - real(r8), pointer :: leafcmax_patch (:) ! (gC/m2) ann max leaf C - real(r8), pointer :: totc_patch (:) ! (gC/m2) total patch-level carbon, including cpool - real(r8), pointer :: rootc_col (:) ! (gC/m2) root carbon at column level (fire) - real(r8), pointer :: leafc_col (:) ! (gC/m2) column-level leafc (fire) - real(r8), pointer :: deadstemc_col (:) ! (gC/m2) column-level deadstemc (fire) - real(r8), pointer :: fuelc_col (:) ! fuel load outside cropland - real(r8), pointer :: fuelc_crop_col (:) ! fuel load for cropland - real(r8), pointer :: cropseedc_deficit_patch (:) ! (gC/m2) pool for seeding new crop growth; this is a NEGATIVE term, indicating the amount of seed usage that needs to be repaid - - ! pools for dynamic landcover - real(r8), pointer :: seedc_grc (:) ! (gC/m2) gridcell-level pool for seeding new PFTs via dynamic landcover - - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: dispvegc_patch (:) ! (gC/m2) displayed veg carbon, excluding storage and cpool - real(r8), pointer :: storvegc_patch (:) ! (gC/m2) stored vegetation carbon, excluding cpool - real(r8), pointer :: totvegc_patch (:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: totvegc_col (:) ! (gC/m2) total vegetation carbon, excluding cpool averaged to column (p2c) - - ! Total C pools - real(r8), pointer :: totc_p2c_col (:) ! (gC/m2) totc_patch averaged to col - real(r8), pointer :: totc_col (:) ! (gC/m2) total column carbon, incl veg and cpool - real(r8), pointer :: totecosysc_col (:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - - contains - - procedure , public :: Init - procedure , public :: SetValues - procedure , public :: ZeroDWT - procedure , public :: Restart - procedure , public :: Summary => Summary_carbonstate - procedure , public :: DynamicPatchAdjustments ! adjust state variables when patch areas change - - procedure , private :: InitAllocate ! Allocate arrays - procedure , private :: InitReadNML ! Read in namelist - procedure , private :: InitHistory ! Initialize history - procedure , private :: InitCold ! Initialize arrays for a cold-start - - end type cnveg_carbonstate_type - - ! !PRIVATE DATA: - - type, private :: cnvegcarbonstate_const_type - ! !PRIVATE MEMBER DATA: - real(r8) :: initial_vegC = 20._r8 ! Initial vegetation carbon for leafc/frootc and storage - end type - type(cnvegcarbonstate_const_type), private :: cnvegcstate_const ! Constants used here - character(len=*), parameter :: sourcefile = & - __FILE__ - - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type, ratio, NLFilename, & - c12_cnveg_carbonstate_inst) - - class(cnveg_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: ratio - character(len=*) , intent(in) :: carbon_type ! Carbon isotope type C12, C13 or C1 - character(len=*) , intent(in) :: NLFilename ! Namelist filename - type(cnveg_carbonstate_type) , intent(in), optional :: c12_cnveg_carbonstate_inst ! cnveg_carbonstate for C12 (if C13 or C14) - !----------------------------------------------------------------------- - - this%species = species_from_string(carbon_type) - - call this%InitAllocate ( bounds) - call this%InitReadNML ( NLFilename ) - call this%InitHistory ( bounds, carbon_type) - if (present(c12_cnveg_carbonstate_inst)) then - call this%InitCold ( bounds, ratio, carbon_type, c12_cnveg_carbonstate_inst ) - else - call this%InitCold ( bounds, ratio, carbon_type ) - end if - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitReadNML(this, NLFilename) - ! - ! !DESCRIPTION: - ! Read the namelist for CNVegCarbonState - ! - !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(cnveg_carbonstate_type) :: this - character(len=*) , intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'InitReadNML' - character(len=*), parameter :: nmlname = 'cnvegcarbonstate' ! MUST match what is in namelist below - !----------------------------------------------------------------------- - real(r8) :: initial_vegC - namelist /cnvegcarbonstate/ initial_vegC - - initial_vegC = cnvegcstate_const%initial_vegC - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cnvegcarbonstate, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (initial_vegC , mpicom) - - cnvegcstate_const%initial_vegC = initial_vegC - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cnvegcarbonstate) ! Name here MUST be the same as in nmlname above! - write(iulog,*) ' ' - end if - - !----------------------------------------------------------------------- - - end subroutine InitReadNML - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (cnveg_carbonstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%leafc_patch (begp:endp)) ; this%leafc_patch (:) = nan - allocate(this%leafc_storage_patch (begp:endp)) ; this%leafc_storage_patch (:) = nan - allocate(this%leafc_xfer_patch (begp:endp)) ; this%leafc_xfer_patch (:) = nan - allocate(this%leafc_storage_xfer_acc_patch (begp:endp)) ; this%leafc_storage_xfer_acc_patch (:) = nan - allocate(this%storage_cdemand_patch (begp:endp)) ; this%storage_cdemand_patch (:) = nan - allocate(this%frootc_patch (begp:endp)) ; this%frootc_patch (:) = nan - allocate(this%frootc_storage_patch (begp:endp)) ; this%frootc_storage_patch (:) = nan - allocate(this%frootc_xfer_patch (begp:endp)) ; this%frootc_xfer_patch (:) = nan - allocate(this%livestemc_patch (begp:endp)) ; this%livestemc_patch (:) = nan - allocate(this%livestemc_storage_patch (begp:endp)) ; this%livestemc_storage_patch (:) = nan - allocate(this%livestemc_xfer_patch (begp:endp)) ; this%livestemc_xfer_patch (:) = nan - allocate(this%deadstemc_patch (begp:endp)) ; this%deadstemc_patch (:) = nan - allocate(this%deadstemc_storage_patch (begp:endp)) ; this%deadstemc_storage_patch (:) = nan - allocate(this%deadstemc_xfer_patch (begp:endp)) ; this%deadstemc_xfer_patch (:) = nan - allocate(this%livecrootc_patch (begp:endp)) ; this%livecrootc_patch (:) = nan - allocate(this%livecrootc_storage_patch (begp:endp)) ; this%livecrootc_storage_patch (:) = nan - allocate(this%livecrootc_xfer_patch (begp:endp)) ; this%livecrootc_xfer_patch (:) = nan - allocate(this%deadcrootc_patch (begp:endp)) ; this%deadcrootc_patch (:) = nan - allocate(this%deadcrootc_storage_patch (begp:endp)) ; this%deadcrootc_storage_patch (:) = nan - allocate(this%deadcrootc_xfer_patch (begp:endp)) ; this%deadcrootc_xfer_patch (:) = nan - allocate(this%gresp_storage_patch (begp:endp)) ; this%gresp_storage_patch (:) = nan - allocate(this%gresp_xfer_patch (begp:endp)) ; this%gresp_xfer_patch (:) = nan - allocate(this%cpool_patch (begp:endp)) ; this%cpool_patch (:) = nan - allocate(this%xsmrpool_patch (begp:endp)) ; this%xsmrpool_patch (:) = nan - allocate(this%ctrunc_patch (begp:endp)) ; this%ctrunc_patch (:) = nan - allocate(this%dispvegc_patch (begp:endp)) ; this%dispvegc_patch (:) = nan - allocate(this%storvegc_patch (begp:endp)) ; this%storvegc_patch (:) = nan - allocate(this%leafcmax_patch (begp:endp)) ; this%leafcmax_patch (:) = nan - allocate(this%totc_patch (begp:endp)) ; this%totc_patch (:) = nan - allocate(this%grainc_patch (begp:endp)) ; this%grainc_patch (:) = nan - allocate(this%grainc_storage_patch (begp:endp)) ; this%grainc_storage_patch (:) = nan - allocate(this%grainc_xfer_patch (begp:endp)) ; this%grainc_xfer_patch (:) = nan - allocate(this%woodc_patch (begp:endp)) ; this%woodc_patch (:) = nan - - allocate(this%cropseedc_deficit_patch (begp:endp)) ; this%cropseedc_deficit_patch (:) = nan - allocate(this%seedc_grc (begg:endg)) ; this%seedc_grc (:) = nan - allocate(this%rootc_col (begc:endc)) ; this%rootc_col (:) = nan - allocate(this%leafc_col (begc:endc)) ; this%leafc_col (:) = nan - allocate(this%deadstemc_col (begc:endc)) ; this%deadstemc_col (:) = nan - allocate(this%fuelc_col (begc:endc)) ; this%fuelc_col (:) = nan - allocate(this%fuelc_crop_col (begc:endc)) ; this%fuelc_crop_col (:) = nan - - allocate(this%totvegc_patch (begp:endp)) ; this%totvegc_patch (:) = nan - allocate(this%totvegc_col (begc:endc)) ; this%totvegc_col (:) = nan - - allocate(this%totc_p2c_col (begc:endc)) ; this%totc_p2c_col (:) = nan - allocate(this%totc_col (begc:endc)) ; this%totc_col (:) = nan - allocate(this%totecosysc_col (begc:endc)) ; this%totecosysc_col (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, carbon_type) - ! - ! !DESCRIPTION: - ! add history fields for all CN variables, always set as default='inactive' - ! - ! !USES: - use clm_varctl , only : use_c13, use_c14 - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class (cnveg_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - ! - ! !LOCAL VARIABLES: - integer :: k,l,ii,jj - character(10) :: active - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - real(r8), pointer :: data2dptr(:,:) ! temp. pointer for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - !------------------------------- - ! C12 state variables - !------------------------------- - - if (carbon_type == 'c12') then - - if (use_crop) then - this%grainc_patch(begp:endp) = spval - call hist_addfld1d (fname='GRAINC', units='gC/m^2', & - avgflag='A', long_name='grain C (does not equal yield)', & - ptr_patch=this%grainc_patch) - this%cropseedc_deficit_patch(begp:endp) = spval - call hist_addfld1d (fname='CROPSEEDC_DEFICIT', units='gC/m^2', & - avgflag='A', long_name='C used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedc_deficit_patch) - end if - - this%woodc_patch(begp:endp) = spval - call hist_addfld1d (fname='WOODC', units='gC/m^2', & - avgflag='A', long_name='wood C', & - ptr_patch=this%woodc_patch) - - this%leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC', units='gC/m^2', & - avgflag='A', long_name='leaf C', & - ptr_patch=this%leafc_patch) - - this%leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='leaf C storage', & - ptr_patch=this%leafc_storage_patch, default='inactive') - - this%leafc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_XFER', units='gC/m^2', & - avgflag='A', long_name='leaf C transfer', & - ptr_patch=this%leafc_xfer_patch, default='inactive') - - this%leafc_storage_xfer_acc_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFC_STORAGE_XFER_ACC', units='gC/m^2', & - avgflag='A', long_name='Accumulated leaf C transfer', & - ptr_patch=this%leafc_storage_xfer_acc_patch, default='inactive') - - this%storage_cdemand_patch(begp:endp) = spval - call hist_addfld1d (fname='STORAGE_CDEMAND', units='gC/m^2', & - avgflag='A', long_name='C use from the C storage pool', & - ptr_patch=this%storage_cdemand_patch, default='inactive') - - this%frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC', units='gC/m^2', & - avgflag='A', long_name='fine root C', & - ptr_patch=this%frootc_patch) - - this%frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='fine root C storage', & - ptr_patch=this%frootc_storage_patch, default='inactive') - - this%frootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='fine root C transfer', & - ptr_patch=this%frootc_xfer_patch, default='inactive') - - this%livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC', units='gC/m^2', & - avgflag='A', long_name='live stem C', & - ptr_patch=this%livestemc_patch) - - this%livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='live stem C storage', & - ptr_patch=this%livestemc_storage_patch, default='inactive') - - this%livestemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMC_XFER', units='gC/m^2', & - avgflag='A', long_name='live stem C transfer', & - ptr_patch=this%livestemc_xfer_patch, default='inactive') - - this%deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMC', units='gC/m^2', & - avgflag='A', long_name='dead stem C', & - ptr_patch=this%deadstemc_patch) - - this%deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='dead stem C storage', & - ptr_patch=this%deadstemc_storage_patch, default='inactive') - - this%deadstemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMC_XFER', units='gC/m^2', & - avgflag='A', long_name='dead stem C transfer', & - ptr_patch=this%deadstemc_xfer_patch, default='inactive') - - this%livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC', units='gC/m^2', & - avgflag='A', long_name='live coarse root C', & - ptr_patch=this%livecrootc_patch) - - this%livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='live coarse root C storage', & - ptr_patch=this%livecrootc_storage_patch, default='inactive') - - this%livecrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='live coarse root C transfer', & - ptr_patch=this%livecrootc_xfer_patch, default='inactive') - - this%deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTC', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C', & - ptr_patch=this%deadcrootc_patch) - - this%deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C storage', & - ptr_patch=this%deadcrootc_storage_patch, default='inactive') - - this%deadcrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C transfer', & - ptr_patch=this%deadcrootc_xfer_patch, default='inactive') - - this%gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='GRESP_STORAGE', units='gC/m^2', & - avgflag='A', long_name='growth respiration storage', & - ptr_patch=this%gresp_storage_patch, default='inactive') - - this%gresp_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='GRESP_XFER', units='gC/m^2', & - avgflag='A', long_name='growth respiration transfer', & - ptr_patch=this%gresp_xfer_patch, default='inactive') - - this%cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='CPOOL', units='gC/m^2', & - avgflag='A', long_name='temporary photosynthate C pool', & - ptr_patch=this%cpool_patch) - - this%xsmrpool_patch(begp:endp) = spval - call hist_addfld1d (fname='XSMRPOOL', units='gC/m^2', & - avgflag='A', long_name='temporary photosynthate C pool', & - ptr_patch=this%xsmrpool_patch) - - this%ctrunc_patch(begp:endp) = spval - call hist_addfld1d (fname='PFT_CTRUNC', units='gC/m^2', & - avgflag='A', long_name='patch-level sink for C truncation', & - ptr_patch=this%ctrunc_patch, default='inactive') - - this%dispvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='DISPVEGC', units='gC/m^2', & - avgflag='A', long_name='displayed veg carbon, excluding storage and cpool', & - ptr_patch=this%dispvegc_patch) - - this%storvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='STORVEGC', units='gC/m^2', & - avgflag='A', long_name='stored vegetation carbon, excluding cpool', & - ptr_patch=this%storvegc_patch) - - this%totvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='TOTVEGC', units='gC/m^2', & - avgflag='A', long_name='total vegetation carbon, excluding cpool', & - ptr_patch=this%totvegc_patch) - - this%totc_patch(begp:endp) = spval - call hist_addfld1d (fname='TOTPFTC', units='gC/m^2', & - avgflag='A', long_name='total patch-level carbon, including cpool', & - ptr_patch=this%totc_patch) - - this%seedc_grc(begg:endg) = spval - call hist_addfld1d (fname='SEEDC', units='gC/m^2', & - avgflag='A', long_name='pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedc_grc) - - this%fuelc_col(begc:endc) = spval - call hist_addfld1d (fname='FUELC', units='gC/m^2', & - avgflag='A', long_name='fuel load', & - ptr_col=this%fuelc_col) - - this%totc_col(begc:endc) = spval - call hist_addfld1d (fname='TOTCOLC', units='gC/m^2', & - avgflag='A', long_name='total column carbon, incl veg and cpool but excl product pools', & - ptr_col=this%totc_col) - - this%totecosysc_col(begc:endc) = spval - call hist_addfld1d (fname='TOTECOSYSC', units='gC/m^2', & - avgflag='A', long_name='total ecosystem carbon, incl veg but excl cpool and product pools', & - ptr_col=this%totecosysc_col) - - end if - - !------------------------------- - ! C13 state variables - !------------------------------- - - if ( carbon_type == 'c13' ) then - - this%leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C', & - ptr_patch=this%leafc_patch) - - this%leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C storage', & - ptr_patch=this%leafc_storage_patch, default='inactive') - - this%leafc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C transfer', & - ptr_patch=this%leafc_xfer_patch, default='inactive') - - this%leafc_storage_xfer_acc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LEAFC_STORAGE_XFER_ACC', units='gC13/m^2', & - avgflag='A', long_name='Accumulated C13 leaf C transfer', & - ptr_patch=this%leafc_storage_xfer_acc_patch, default='inactive') - - this%frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C', & - ptr_patch=this%frootc_patch) - - this%frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C storage', & - ptr_patch=this%frootc_storage_patch, default='inactive') - - this%frootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_FROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C transfer', & - ptr_patch=this%frootc_xfer_patch, default='inactive') - - this%livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C', & - ptr_patch=this%livestemc_patch) - - this%livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C storage', & - ptr_patch=this%livestemc_storage_patch, default='inactive') - - this%livestemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVESTEMC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C transfer', & - ptr_patch=this%livestemc_xfer_patch, default='inactive') - - this%deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADSTEMC', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C', & - ptr_patch=this%deadstemc_patch) - - this%deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C storage', & - ptr_patch=this%deadstemc_storage_patch, default='inactive') - - this%deadstemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADSTEMC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C transfer', & - ptr_patch=this%deadstemc_xfer_patch, default='inactive') - - this%livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C', & - ptr_patch=this%livecrootc_patch) - - this%livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C storage', & - ptr_patch=this%livecrootc_storage_patch, default='inactive') - - this%livecrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_LIVECROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C transfer', & - ptr_patch=this%livecrootc_xfer_patch, default='inactive') - - this%deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADCROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C', & - ptr_patch=this%deadcrootc_patch) - - this%deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C storage', & - ptr_patch=this%deadcrootc_storage_patch, default='inactive') - - this%deadcrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DEADCROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C transfer', & - ptr_patch=this%deadcrootc_xfer_patch, default='inactive') - - this%gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GRESP_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 growth respiration storage', & - ptr_patch=this%gresp_storage_patch, default='inactive') - - this%gresp_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GRESP_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 growth respiration transfer', & - ptr_patch=this%gresp_xfer_patch, default='inactive') - - this%cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CPOOL', units='gC13/m^2', & - avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_patch=this%cpool_patch) - - this%xsmrpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_XSMRPOOL', units='gC13/m^2', & - avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_patch=this%xsmrpool_patch) - - this%ctrunc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PFT_CTRUNC', units='gC13/m^2', & - avgflag='A', long_name='C13 patch-level sink for C truncation', & - ptr_patch=this%ctrunc_patch, default='inactive') - - this%dispvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_DISPVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 displayed veg carbon, excluding storage and cpool', & - ptr_patch=this%dispvegc_patch) - - this%storvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_STORVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 stored vegetation carbon, excluding cpool', & - ptr_patch=this%storvegc_patch) - - this%totvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TOTVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 total vegetation carbon, excluding cpool', & - ptr_patch=this%totvegc_patch) - - this%totc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_TOTPFTC', units='gC13/m^2', & - avgflag='A', long_name='C13 total patch-level carbon, including cpool', & - ptr_patch=this%totc_patch) - - this%seedc_grc(begg:endg) = spval - call hist_addfld1d (fname='C13_SEEDC', units='gC13/m^2', & - avgflag='A', long_name='C13 pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedc_grc) - - this%totc_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTCOLC', units='gC13/m^2', & - avgflag='A', long_name='C13 total column carbon, incl veg and cpool but excl product pools', & - ptr_col=this%totc_col) - - this%totecosysc_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTECOSYSC', units='gC13/m^2', & - avgflag='A', long_name='C13 total ecosystem carbon, incl veg but excl cpool and product pools', & - ptr_col=this%totecosysc_col) - - if (use_crop) then - this%grainc_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_GRAINC', units='gC/m^2', & - avgflag='A', long_name='C13 grain C (does not equal yield)', & - ptr_patch=this%grainc_patch) - this%cropseedc_deficit_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_CROPSEEDC_DEFICIT', units='gC/m^2', & - avgflag='A', long_name='C13 C used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedc_deficit_patch) - end if - - - endif - - !------------------------------- - ! C14 state variables - !------------------------------- - - if ( carbon_type == 'c14') then - - this%leafc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC', units='gC14/m^2', & - avgflag='A', long_name='C14 leaf C', & - ptr_patch=this%leafc_patch) - - this%leafc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 leaf C storage', & - ptr_patch=this%leafc_storage_patch, default='inactive') - - this%leafc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 leaf C transfer', & - ptr_patch=this%leafc_xfer_patch, default='inactive') - - this%leafc_storage_xfer_acc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LEAFC_STORAGE_XFER_ACC', units='gC14/m^2', & - avgflag='A', long_name='Accumulated C14 leaf C transfer', & - ptr_patch=this%leafc_storage_xfer_acc_patch, default='inactive') - - this%frootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC', units='gC14/m^2', & - avgflag='A', long_name='C14 fine root C', & - ptr_patch=this%frootc_patch) - - this%frootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 fine root C storage', & - ptr_patch=this%frootc_storage_patch, default='inactive') - - this%frootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_FROOTC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 fine root C transfer', & - ptr_patch=this%frootc_xfer_patch, default='inactive') - - this%livestemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC', units='gC14/m^2', & - avgflag='A', long_name='C14 live stem C', & - ptr_patch=this%livestemc_patch) - - this%livestemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 live stem C storage', & - ptr_patch=this%livestemc_storage_patch, default='inactive') - - this%livestemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVESTEMC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 live stem C transfer', & - ptr_patch=this%livestemc_xfer_patch, default='inactive') - - this%deadstemc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADSTEMC', units='gC14/m^2', & - avgflag='A', long_name='C14 dead stem C', & - ptr_patch=this%deadstemc_patch) - - this%deadstemc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADSTEMC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 dead stem C storage', & - ptr_patch=this%deadstemc_storage_patch, default='inactive') - - this%deadstemc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADSTEMC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 dead stem C transfer', & - ptr_patch=this%deadstemc_xfer_patch, default='inactive') - - this%livecrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC', units='gC14/m^2', & - avgflag='A', long_name='C14 live coarse root C', & - ptr_patch=this%livecrootc_patch) - - this%livecrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 live coarse root C storage', & - ptr_patch=this%livecrootc_storage_patch, default='inactive') - - this%livecrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_LIVECROOTC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 live coarse root C transfer', & - ptr_patch=this%livecrootc_xfer_patch, default='inactive') - - this%deadcrootc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADCROOTC', units='gC14/m^2', & - avgflag='A', long_name='C14 dead coarse root C', & - ptr_patch=this%deadcrootc_patch) - - this%deadcrootc_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADCROOTC_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 dead coarse root C storage', & - ptr_patch=this%deadcrootc_storage_patch, default='inactive') - - this%deadcrootc_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DEADCROOTC_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 dead coarse root C transfer', & - ptr_patch=this%deadcrootc_xfer_patch, default='inactive') - - this%gresp_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GRESP_STORAGE', units='gC14/m^2', & - avgflag='A', long_name='C14 growth respiration storage', & - ptr_patch=this%gresp_storage_patch, default='inactive') - - this%gresp_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GRESP_XFER', units='gC14/m^2', & - avgflag='A', long_name='C14 growth respiration transfer', & - ptr_patch=this%gresp_xfer_patch, default='inactive') - - this%cpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CPOOL', units='gC14/m^2', & - avgflag='A', long_name='C14 temporary photosynthate C pool', & - ptr_patch=this%cpool_patch) - - this%xsmrpool_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_XSMRPOOL', units='gC14/m^2', & - avgflag='A', long_name='C14 temporary photosynthate C pool', & - ptr_patch=this%xsmrpool_patch) - - this%ctrunc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PFT_CTRUNC', units='gC14/m^2', & - avgflag='A', long_name='C14 patch-level sink for C truncation', & - ptr_patch=this%ctrunc_patch) - - this%dispvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_DISPVEGC', units='gC14/m^2', & - avgflag='A', long_name='C14 displayed veg carbon, excluding storage and cpool', & - ptr_patch=this%dispvegc_patch) - - this%storvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_STORVEGC', units='gC14/m^2', & - avgflag='A', long_name='C14 stored vegetation carbon, excluding cpool', & - ptr_patch=this%storvegc_patch) - - this%totvegc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TOTVEGC', units='gC14/m^2', & - avgflag='A', long_name='C14 total vegetation carbon, excluding cpool', & - ptr_patch=this%totvegc_patch) - - this%totc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_TOTPFTC', units='gC14/m^2', & - avgflag='A', long_name='C14 total patch-level carbon, including cpool', & - ptr_patch=this%totc_patch) - - this%seedc_grc(begg:endg) = spval - call hist_addfld1d (fname='C14_SEEDC', units='gC14/m^2', & - avgflag='A', long_name='C14 pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedc_grc) - - this%totc_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTCOLC', units='gC14/m^2', & - avgflag='A', long_name='C14 total column carbon, incl veg and cpool but excl product pools', & - ptr_col=this%totc_col) - - this%totecosysc_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTECOSYSC', units='gC14/m^2', & - avgflag='A', long_name='C14 total ecosystem carbon, incl veg but excl cpool and product pools', & - ptr_col=this%totecosysc_col) - - if (use_crop) then - this%grainc_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_GRAINC', units='gC/m^2', & - avgflag='A', long_name='C14 grain C (does not equal yield)', & - ptr_patch=this%grainc_patch) - this%cropseedc_deficit_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_CROPSEEDC_DEFICIT', units='gC/m^2', & - avgflag='A', long_name='C14 C used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedc_deficit_patch) - end if - - - endif - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, ratio, carbon_type, c12_cnveg_carbonstate_inst) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - ! !USES: - use landunit_varcon , only : istsoil, istcrop - use clm_time_manager , only : is_restart, get_nstep - use clm_varctl, only : MM_Nuptake_opt - ! - ! !ARGUMENTS: - class(cnveg_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: ratio ! Standard isotope ratio - character(len=*) , intent(in) :: carbon_type ! 'c12' or 'c13' or 'c14' - type(cnveg_carbonstate_type) , optional, intent(in) :: c12_cnveg_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g,j,k,i - integer :: fc ! filter index - integer :: num_special_col ! number of good values in special_col filter - integer :: num_special_patch ! number of good values in special_patch filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - integer :: special_patch(bounds%endp-bounds%begp+1) ! special landunit filter - patches - !----------------------------------------------------------------------- - - if (carbon_type == 'c13' .or. carbon_type == 'c14') then - if (.not. present(c12_cnveg_carbonstate_inst)) then - call endrun(msg=' ERROR: for C13 or C14 must pass in c12_cnveg_carbonstate_inst as argument' //& - errMsg(sourcefile, __LINE__)) - end if - end if - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - ! Set patch filters - - num_special_patch = 0 - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - if (lun%ifspecial(l)) then - num_special_patch = num_special_patch + 1 - special_patch(num_special_patch) = p - end if - end do - - !----------------------------------------------- - ! initialize patch-level carbon state variables - !----------------------------------------------- - - do p = bounds%begp,bounds%endp - - this%leafcmax_patch(p) = 0._r8 - - l = patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - if (patch%itype(p) == noveg) then - this%leafc_patch(p) = 0._r8 - this%leafc_storage_patch(p) = 0._r8 - this%frootc_patch(p) = 0._r8 - this%frootc_storage_patch(p) = 0._r8 - else - if (pftcon%evergreen(patch%itype(p)) == 1._r8) then - this%leafc_patch(p) = cnvegcstate_const%initial_vegC * ratio - this%leafc_storage_patch(p) = 0._r8 - this%frootc_patch(p) = cnvegcstate_const%initial_vegC * ratio - this%frootc_storage_patch(p) = 0._r8 - else if (patch%itype(p) >= npcropmin) then ! prognostic crop types - this%leafc_patch(p) = 0._r8 - this%leafc_storage_patch(p) = 0._r8 - this%frootc_patch(p) = 0._r8 - this%frootc_storage_patch(p) = 0._r8 - else - this%leafc_patch(p) = 0._r8 - this%leafc_storage_patch(p) = cnvegcstate_const%initial_vegC * ratio - this%frootc_patch(p) = 0._r8 - this%frootc_storage_patch(p) = cnvegcstate_const%initial_vegC * ratio - end if - end if - this%leafc_xfer_patch(p) = 0._r8 - this%leafc_storage_xfer_acc_patch(p) = 0._r8 - this%storage_cdemand_patch(p) = 0._r8 - - if (MM_Nuptake_opt .eqv. .false.) then ! if not running in floating CN ratio option - this%frootc_patch(p) = 0._r8 - this%frootc_storage_patch(p) = 0._r8 - end if - this%frootc_xfer_patch(p) = 0._r8 - - this%livestemc_patch(p) = 0._r8 - this%livestemc_storage_patch(p) = 0._r8 - this%livestemc_xfer_patch(p) = 0._r8 - - if (pftcon%woody(patch%itype(p)) == 1._r8) then - this%deadstemc_patch(p) = 0.1_r8 * ratio - else - this%deadstemc_patch(p) = 0._r8 - end if - this%deadstemc_storage_patch(p) = 0._r8 - this%deadstemc_xfer_patch(p) = 0._r8 - - this%livecrootc_patch(p) = 0._r8 - this%livecrootc_storage_patch(p) = 0._r8 - this%livecrootc_xfer_patch(p) = 0._r8 - - this%deadcrootc_patch(p) = 0._r8 - this%deadcrootc_storage_patch(p) = 0._r8 - this%deadcrootc_xfer_patch(p) = 0._r8 - - this%gresp_storage_patch(p) = 0._r8 - this%gresp_xfer_patch(p) = 0._r8 - - this%cpool_patch(p) = 0._r8 - this%xsmrpool_patch(p) = 0._r8 - this%ctrunc_patch(p) = 0._r8 - this%dispvegc_patch(p) = 0._r8 - this%storvegc_patch(p) = 0._r8 - this%woodc_patch(p) = 0._r8 - this%totc_patch(p) = 0._r8 - - if ( use_crop )then - this%grainc_patch(p) = 0._r8 - this%grainc_storage_patch(p) = 0._r8 - this%grainc_xfer_patch(p) = 0._r8 - this%cropseedc_deficit_patch(p) = 0._r8 - end if - - endif - - end do - - ! ----------------------------------------------- - ! initialize column-level variables - ! ----------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then -! this%totgrainc_col(c) = 0._r8 - - ! total carbon pools - this%totecosysc_col(c) = 0._r8 - this%totc_p2c_col(c) = 0._r8 - this%totc_col(c) = 0._r8 - end if - end do - - - do g = bounds%begg, bounds%endg - this%seedc_grc(g) = 0._r8 - end do - - if ( .not. is_restart() .and. get_nstep() == 1 ) then - - do p = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(p)) == 1._r8) then - this%grainc_patch(p) = c12_cnveg_carbonstate_inst%grainc_patch(p) * c3_r2 - this%grainc_storage_patch(p) = c12_cnveg_carbonstate_inst%grainc_storage_patch(p) * c3_r2 - this%grainc_xfer_patch(p) = c12_cnveg_carbonstate_inst%grainc_xfer_patch(p) * c3_r2 - this%dispvegc_patch(p) = c12_cnveg_carbonstate_inst%dispvegc_patch(p) * c3_r2 - this%storvegc_patch(p) = c12_cnveg_carbonstate_inst%storvegc_patch(p) * c3_r2 - this%totvegc_patch(p) = c12_cnveg_carbonstate_inst%totvegc_patch(p) * c3_r2 - this%totc_patch(p) = c12_cnveg_carbonstate_inst%totc_patch(p) * c3_r2 - this%woodc_patch(p) = c12_cnveg_carbonstate_inst%woodc_patch(p) * c3_r2 - else - this%grainc_patch(p) = c12_cnveg_carbonstate_inst%grainc_patch(p) * c4_r2 - this%grainc_storage_patch(p) = c12_cnveg_carbonstate_inst%grainc_storage_patch(p) * c4_r2 - this%grainc_xfer_patch(p) = c12_cnveg_carbonstate_inst%grainc_xfer_patch(p) * c4_r2 - this%dispvegc_patch(p) = c12_cnveg_carbonstate_inst%dispvegc_patch(p) * c4_r2 - this%storvegc_patch(p) = c12_cnveg_carbonstate_inst%storvegc_patch(p) * c4_r2 - this%totvegc_patch(p) = c12_cnveg_carbonstate_inst%totvegc_patch(p) * c4_r2 - this%totc_patch(p) = c12_cnveg_carbonstate_inst%totc_patch(p) * c4_r2 - this%woodc_patch(p) = c12_cnveg_carbonstate_inst%woodc_patch(p) * c4_r2 - end if - end do - end if - - ! initialize fields for special filters - - call this%SetValues (& - num_patch=num_special_patch, filter_patch=special_patch, value_patch=0._r8, & - num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart ( this, bounds, ncid, flag, carbon_type, reseed_dead_plants, & - c12_cnveg_carbonstate_inst, filter_reseed_patch, & - num_reseed_patch) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon state - ! - ! !USES: - use shr_infnan_mod , only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - use clm_varcon , only : c13ratio, c14ratio - use clm_varctl , only : spinup_state, use_cndv, MM_Nuptake_opt - use clm_time_manager , only : get_nstep, is_restart, get_nstep - use landunit_varcon , only : istsoil, istcrop - use spmdMod , only : mpicom - use shr_mpi_mod , only : shr_mpi_sum - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class (cnveg_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - character(len=*) , intent(in) :: carbon_type ! 'c12' or 'c13' or 'c14' - logical , intent(in) :: reseed_dead_plants - type (cnveg_carbonstate_type) , intent(in), optional :: c12_cnveg_carbonstate_inst - integer , intent(out), optional :: filter_reseed_patch(:) - integer , intent(out), optional :: num_reseed_patch - ! - ! !LOCAL VARIABLES: - integer :: i,j,k,l,c,p - real(r8) :: ratio - character(len=128) :: varname ! temporary - logical :: readvar - integer :: idata - logical :: exit_spinup = .false. - logical :: enter_spinup = .false. - ! flags for comparing the model and restart decomposition cascades - integer :: decomp_cascade_state, restart_file_decomp_cascade_state - ! spinup state as read from restart file, for determining whether to enter or exit spinup mode. - integer :: restart_file_spinup_state - integer :: total_num_reseed_patch ! Total number of patches to reseed across all processors - - !------------------------------------------------------------------------ - - if (carbon_type == 'c13' .or. carbon_type == 'c14') then - if (.not. present(c12_cnveg_carbonstate_inst)) then - call endrun(msg=' ERROR: for C14 must pass in c12_cnveg_carbonstate_inst as argument' //& - errMsg(sourcefile, __LINE__)) - end if - end if - if (carbon_type == 'c12') then - ratio = 1._r8 - else if (carbon_type == 'c13') then - ratio = c13ratio - else if (carbon_type == 'c14') then - ratio = c14ratio - end if - - if ( ( present(num_reseed_patch) .and. .not. present(filter_reseed_patch)) & - .or. (.not. present(num_reseed_patch) .and. present(filter_reseed_patch) ) )then - call endrun(msg=' ERROR: filter_reseed_patch and num_reseed_patch both need to be entered ' //& - errMsg(sourcefile, __LINE__)) - end if - if ( present(num_reseed_patch) )then - num_reseed_patch = 0 - filter_reseed_patch(:) = -1 - end if - - !-------------------------------- - ! patch carbon state variables (c12) - !-------------------------------- - - if (carbon_type == 'c12') then - call restartvar(ncid=ncid, flag=flag, varname='leafc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafc_storage_xfer_acc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_storage_xfer_acc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='storage_cdemand', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%storage_cdemand_patch) - - call restartvar(ncid=ncid, flag=flag, varname='frootc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='frootc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='frootc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='gresp_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='gresp_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cpool', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_patch) - - call restartvar(ncid=ncid, flag=flag, varname='xsmrpool', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%xsmrpool_patch) - - call restartvar(ncid=ncid, flag=flag, varname='pft_ctrunc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ctrunc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafcmax', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafcmax_patch) - - if (flag == 'read') then - call restartvar(ncid=ncid, flag=flag, varname='spinup_state', xtype=ncd_int, & - long_name='Spinup state of the model that wrote this restart file: ' & - // ' 0 = normal model mode, 1 = AD spinup, 2 = AAD spinup', units='', & - interpinic_flag='copy', readvar=readvar, data=idata) - - if (readvar) then - restart_file_spinup_state = idata - else - restart_file_spinup_state = spinup_state - if ( masterproc ) then - write(iulog,*) ' CNRest: WARNING! Restart file does not contain info ' & - // ' on spinup state used to generate the restart file. ' - write(iulog,*) ' Assuming the same as current setting: ', spinup_state - end if - end if - end if - - if (flag == 'read' .and. spinup_state /= restart_file_spinup_state .and. .not. use_cndv) then - if ( masterproc ) write(iulog, *) 'exit_spinup ',exit_spinup,' restart_file_spinup_state ',restart_file_spinup_state - if (spinup_state <= 1 .and. restart_file_spinup_state == 2 ) then - if ( masterproc ) write(iulog,*) ' CNRest: taking Dead wood C pools out of AD spinup mode' - exit_spinup = .true. - if ( masterproc ) write(iulog, *) 'Multiplying stemc and crootc by 10 for exit spinup' - do i = bounds%begp,bounds%endp - this%deadstemc_patch(i) = this%deadstemc_patch(i) * 10._r8 - this%deadcrootc_patch(i) = this%deadcrootc_patch(i) * 10._r8 - end do - else if (spinup_state == 2 .and. restart_file_spinup_state <= 1 )then - if (spinup_state == 2 .and. restart_file_spinup_state <= 1 )then - if ( masterproc ) write(iulog,*) ' CNRest: taking Dead wood C pools into AD spinup mode' - enter_spinup = .true. - if ( masterproc ) write(iulog, *) 'Dividing stemc and crootc by 10 for enter spinup ' - do i = bounds%begp,bounds%endp - this%deadstemc_patch(i) = this%deadstemc_patch(i) / 10._r8 - this%deadcrootc_patch(i) = this%deadcrootc_patch(i) / 10._r8 - end do - end if - end if - end if - !-------------------------------- - ! C12 carbon state variables - !-------------------------------- - - if (carbon_type == 'c12') then - call restartvar(ncid=ncid, flag=flag, varname='totvegc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_patch) - ! totvegc_col needed for resetting soil carbon stocks during AD spinup exit - call restartvar(ncid=ncid, flag=flag, varname='totvegc_col', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_col) - end if - - !-------------------------------- - ! C13 carbon state variables - !-------------------------------- - - if ( carbon_type == 'c13') then - call restartvar(ncid=ncid, flag=flag, varname='totvegc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing cnveg_carbonstate_inst%totvegc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%totvegc_patch(i) = c12_cnveg_carbonstate_inst%totvegc_patch(i) * c3_r2 - else - this%totvegc_patch(i) = c12_cnveg_carbonstate_inst%totvegc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='totvegc_col_13', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_col) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing cnveg_carbonstate_inst%totvegc with atmospheric c13 value' - do i = bounds%begc,bounds%endc - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%totvegc_col(i) = c12_cnveg_carbonstate_inst%totvegc_col(i) * c3_r2 - else - this%totvegc_col(i) = c12_cnveg_carbonstate_inst%totvegc_col(i) * c4_r2 - endif - end do - end if - - end if - - !-------------------------------- - ! C14 patch carbon state variables - !-------------------------------- - - if ( carbon_type == 'c14') then - call restartvar(ncid=ncid, flag=flag, varname='totvegc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%totvegc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%totvegc_patch(i) /= spval .and. & - .not. isnan(this%totvegc_patch(i)) ) then - this%totvegc_patch(i) = c12_cnveg_carbonstate_inst%totvegc_patch(i) * c14ratio - endif - end do - endif - - call restartvar(ncid=ncid, flag=flag, varname='totvegc_col_14', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%totvegc_col) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing cnveg_carbonstate_inst%totvegc with atmospheric c14 value' - do i = bounds%begc,bounds%endc - if (this%totvegc_col(i) /= spval .and. & - .not. isnan(this%totvegc_col(i)) ) then - this%totvegc_col(i) = c12_cnveg_carbonstate_inst%totvegc_col(i) * c14ratio - endif - end do - end if - end if - - - if ( flag == 'read' .and. (enter_spinup .or. (reseed_dead_plants .and. .not. is_restart())) .and. .not. use_cndv) then - if ( masterproc ) write(iulog, *) 'Reseeding dead plants for CNVegCarbonState' - ! If a pft is dead (indicated by totvegc = 0) then we reseed that - ! pft according to the cold start protocol in the InitCold subroutine. - ! Thus, the variable totvegc is required to be read before here - ! so that if it is zero for a given pft, the pft can be reseeded. - do i = bounds%begp,bounds%endp - if (this%totvegc_patch(i) .le. 0.0_r8) then - !----------------------------------------------- - ! initialize patch-level carbon state variables - !----------------------------------------------- - - this%leafcmax_patch(i) = 0._r8 - - l = patch%landunit(i) - if (lun%itype(l) == istsoil )then - if ( present(num_reseed_patch) ) then - num_reseed_patch = num_reseed_patch + 1 - filter_reseed_patch(num_reseed_patch) = i - end if - - if (patch%itype(i) == noveg) then - this%leafc_patch(i) = 0._r8 - this%leafc_storage_patch(i) = 0._r8 - this%frootc_patch(i) = 0._r8 - this%frootc_storage_patch(i) = 0._r8 - else - if (pftcon%evergreen(patch%itype(i)) == 1._r8) then - this%leafc_patch(i) = cnvegcstate_const%initial_vegC * ratio - this%leafc_storage_patch(i) = 0._r8 - this%frootc_patch(i) = cnvegcstate_const%initial_vegC * ratio - this%frootc_storage_patch(i) = 0._r8 - else - this%leafc_patch(i) = 0._r8 - this%leafc_storage_patch(i) = cnvegcstate_const%initial_vegC * ratio - this%frootc_patch(i) = 0._r8 - this%frootc_storage_patch(i) = cnvegcstate_const%initial_vegC * ratio - end if - end if - this%leafc_xfer_patch(i) = 0._r8 - this%leafc_storage_xfer_acc_patch(i) = 0._r8 - this%storage_cdemand_patch(i) = 0._r8 - - if (MM_Nuptake_opt .eqv. .false.) then ! if not running in floating CN ratio option - this%frootc_patch(i) = 0._r8 - this%frootc_storage_patch(i) = 0._r8 - end if - this%frootc_xfer_patch(i) = 0._r8 - - this%livestemc_patch(i) = 0._r8 - this%livestemc_storage_patch(i) = 0._r8 - this%livestemc_xfer_patch(i) = 0._r8 - - if (pftcon%woody(patch%itype(i)) == 1._r8) then - this%deadstemc_patch(i) = 0.1_r8 * ratio - else - this%deadstemc_patch(i) = 0._r8 - end if - this%deadstemc_storage_patch(i) = 0._r8 - this%deadstemc_xfer_patch(i) = 0._r8 - - this%livecrootc_patch(i) = 0._r8 - this%livecrootc_storage_patch(i) = 0._r8 - this%livecrootc_xfer_patch(i) = 0._r8 - - this%deadcrootc_patch(i) = 0._r8 - this%deadcrootc_storage_patch(i) = 0._r8 - this%deadcrootc_xfer_patch(i) = 0._r8 - - this%gresp_storage_patch(i) = 0._r8 - this%gresp_xfer_patch(i) = 0._r8 - - this%cpool_patch(i) = 0._r8 - this%xsmrpool_patch(i) = 0._r8 - this%ctrunc_patch(i) = 0._r8 - this%dispvegc_patch(i) = 0._r8 - this%storvegc_patch(i) = 0._r8 - this%woodc_patch(i) = 0._r8 - this%totc_patch(i) = 0._r8 - - if ( use_crop )then - this%grainc_patch(i) = 0._r8 - this%grainc_storage_patch(i) = 0._r8 - this%grainc_xfer_patch(i) = 0._r8 - this%cropseedc_deficit_patch(i) = 0._r8 - end if - - ! calculate totvegc explicitly so that it is available for the isotope - ! code on the first time step. - - this%totvegc_patch(i) = & - this%leafc_patch(i) + & - this%leafc_storage_patch(i) + & - this%leafc_xfer_patch(i) + & - this%frootc_patch(i) + & - this%frootc_storage_patch(i) + & - this%frootc_xfer_patch(i) + & - this%livestemc_patch(i) + & - this%livestemc_storage_patch(i) + & - this%livestemc_xfer_patch(i) + & - this%deadstemc_patch(i) + & - this%deadstemc_storage_patch(i) + & - this%deadstemc_xfer_patch(i) + & - this%livecrootc_patch(i) + & - this%livecrootc_storage_patch(i) + & - this%livecrootc_xfer_patch(i) + & - this%deadcrootc_patch(i) + & - this%deadcrootc_storage_patch(i) + & - this%deadcrootc_xfer_patch(i) + & - this%gresp_storage_patch(i) + & - this%gresp_xfer_patch(i) + & - this%cpool_patch(i) - - if ( use_crop )then - this%totvegc_patch(i) = & - this%totvegc_patch(i) + & - this%grainc_patch(i) + & - this%grainc_storage_patch(i) + & - this%grainc_xfer_patch(i) - end if - - endif - end if - end do - if ( .not. is_restart() .and. get_nstep() == 1 ) then - - do p = bounds%begp,bounds%endp - if (this%leafc_patch(p) .lt. 0.01_r8) then - if (pftcon%c3psn(patch%itype(p)) == 1._r8) then - this%grainc_patch(p) = c12_cnveg_carbonstate_inst%grainc_patch(p) * c3_r2 - this%grainc_storage_patch(p) = c12_cnveg_carbonstate_inst%grainc_storage_patch(p) * c3_r2 - this%grainc_xfer_patch(p) = c12_cnveg_carbonstate_inst%grainc_xfer_patch(p) * c3_r2 - this%dispvegc_patch(p) = c12_cnveg_carbonstate_inst%dispvegc_patch(p) * c3_r2 - this%storvegc_patch(p) = c12_cnveg_carbonstate_inst%storvegc_patch(p) * c3_r2 - this%totvegc_patch(p) = c12_cnveg_carbonstate_inst%totvegc_patch(p) * c3_r2 - this%totc_patch(p) = c12_cnveg_carbonstate_inst%totc_patch(p) * c3_r2 - this%woodc_patch(p) = c12_cnveg_carbonstate_inst%woodc_patch(p) * c3_r2 - else - this%grainc_patch(p) = c12_cnveg_carbonstate_inst%grainc_patch(p) * c4_r2 - this%grainc_storage_patch(p) = c12_cnveg_carbonstate_inst%grainc_storage_patch(p) * c4_r2 - this%grainc_xfer_patch(p) = c12_cnveg_carbonstate_inst%grainc_xfer_patch(p) * c4_r2 - this%dispvegc_patch(p) = c12_cnveg_carbonstate_inst%dispvegc_patch(p) * c4_r2 - this%storvegc_patch(p) = c12_cnveg_carbonstate_inst%storvegc_patch(p) * c4_r2 - this%totvegc_patch(p) = c12_cnveg_carbonstate_inst%totvegc_patch(p) * c4_r2 - this%totc_patch(p) = c12_cnveg_carbonstate_inst%totc_patch(p) * c4_r2 - this%woodc_patch(p) = c12_cnveg_carbonstate_inst%woodc_patch(p) * c4_r2 - end if - end if - end do - end if - if ( present(num_reseed_patch) ) then - call shr_mpi_sum( num_reseed_patch, total_num_reseed_patch, mpicom ) - if ( masterproc ) write(iulog,*) 'Total num_reseed, over all tasks = ', total_num_reseed_patch - end if - end if - - end if - - !-------------------------------- - ! C13 patch carbon state variables - !-------------------------------- - - if ( carbon_type == 'c13') then - call restartvar(ncid=ncid, flag=flag, varname='leafc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%leafc_patch(i) = c12_cnveg_carbonstate_inst%leafc_patch(i) * c3_r2 - else - this%leafc_patch(i) = c12_cnveg_carbonstate_inst%leafc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='leafc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%leafc_storage_patch(i) = c12_cnveg_carbonstate_inst%leafc_storage_patch(i) * c3_r2 - else - this%leafc_storage_patch(i) = c12_cnveg_carbonstate_inst%leafc_storage_patch(i) * c4_r2 - this%leafc_storage_patch(i) = c12_cnveg_carbonstate_inst%leafc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='leafc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%leafc_xfer_patch(i) = c12_cnveg_carbonstate_inst%leafc_xfer_patch(i) * c3_r2 - else - this%leafc_xfer_patch(i) = c12_cnveg_carbonstate_inst%leafc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%frootc_patch(i) = c12_cnveg_carbonstate_inst%frootc_patch(i) * c3_r2 - else - this%frootc_patch(i) = c12_cnveg_carbonstate_inst%frootc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%frootc_storage_patch(i) = c12_cnveg_carbonstate_inst%frootc_storage_patch(i) * c3_r2 - else - this%frootc_storage_patch(i) = c12_cnveg_carbonstate_inst%frootc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%frootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%frootc_xfer_patch(i) * c3_r2 - else - this%frootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%frootc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livestemc_patch(i) = c12_cnveg_carbonstate_inst%livestemc_patch(i) * c3_r2 - else - this%livestemc_patch(i) = c12_cnveg_carbonstate_inst%livestemc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livestemc_storage_patch(i) = c12_cnveg_carbonstate_inst%livestemc_storage_patch(i) * c3_r2 - else - this%livestemc_storage_patch(i) = c12_cnveg_carbonstate_inst%livestemc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livestemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livestemc_xfer_patch(i) * c3_r2 - else - this%livestemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livestemc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadstemc_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_patch(i) * c3_r2 - else - this%deadstemc_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadstemc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_storage_patch(i) * c3_r2 - else - this%deadstemc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadstemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_xfer_patch(i) * c3_r2 - else - this%deadstemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livecrootc_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_patch(i) * c3_r2 - else - this%livecrootc_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livecrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_storage_patch(i) * c3_r2 - else - this%livecrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%livecrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_xfer_patch(i) * c3_r2 - else - this%livecrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadcrootc_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_patch(i) * c3_r2 - else - this%deadcrootc_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadcrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_storage_patch(i) * c3_r2 - else - this%deadcrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_xfer_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%deadcrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_xfer_patch(i) * c3_r2 - else - this%deadcrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='gresp_storage_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%gresp_storage with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%gresp_storage_patch(i) = c12_cnveg_carbonstate_inst%gresp_storage_patch(i) * c3_r2 - else - this%gresp_storage_patch(i) = c12_cnveg_carbonstate_inst%gresp_storage_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='gresp_xfer_13', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%gresp_xfer with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%gresp_xfer_patch(i) = c12_cnveg_carbonstate_inst%gresp_xfer_patch(i) * c3_r2 - else - this%gresp_xfer_patch(i) = c12_cnveg_carbonstate_inst%gresp_xfer_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='cpool_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%cpool with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%cpool_patch(i) = c12_cnveg_carbonstate_inst%cpool_patch(i) * c3_r2 - else - this%cpool_patch(i) = c12_cnveg_carbonstate_inst%cpool_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='xsmrpool_13', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%xsmrpool_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%xsmrpool with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%xsmrpool_patch(i) = c12_cnveg_carbonstate_inst%xsmrpool_patch(i) * c3_r2 - else - this%xsmrpool_patch(i) = c12_cnveg_carbonstate_inst%xsmrpool_patch(i) * c4_r2 - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='pft_ctrunc_13', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ctrunc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%ctrunc with atmospheric c13 value' - do i = bounds%begp,bounds%endp - if (pftcon%c3psn(patch%itype(i)) == 1._r8) then - this%ctrunc_patch(i) = c12_cnveg_carbonstate_inst%ctrunc_patch(i) * c3_r2 - else - this%ctrunc_patch(i) = c12_cnveg_carbonstate_inst%ctrunc_patch(i) * c4_r2 - endif - end do - end if - - end if - - !-------------------------------- - ! C14 patch carbon state variables - !-------------------------------- - - if ( carbon_type == 'c14') then - call restartvar(ncid=ncid, flag=flag, varname='leafc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%leafc_patch(i) /= spval .and. & - .not. isnan(this%leafc_patch(i)) ) then - this%leafc_patch(i) = c12_cnveg_carbonstate_inst%leafc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='leafc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%leafc_storage_patch(i) /= spval .and. & - .not. isnan(this%leafc_storage_patch(i)) ) then - this%leafc_storage_patch(i) = c12_cnveg_carbonstate_inst%leafc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='leafc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%leafc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%leafc_xfer_patch(i) /= spval .and. .not. isnan(this%leafc_xfer_patch(i)) ) then - this%leafc_xfer_patch(i) = c12_cnveg_carbonstate_inst%leafc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%frootc_patch(i) /= spval .and. & - .not. isnan(this%frootc_patch(i)) ) then - this%frootc_patch(i) = c12_cnveg_carbonstate_inst%frootc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%frootc_storage_patch(i) /= spval .and. & - .not. isnan(this%frootc_storage_patch(i)) ) then - this%frootc_storage_patch(i) = c12_cnveg_carbonstate_inst%frootc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='frootc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%frootc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%frootc_xfer_patch(i) /= spval .and. & - .not. isnan(this%frootc_xfer_patch(i)) ) then - this%frootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%frootc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livestemc_patch(i) /= spval .and. .not. isnan(this%livestemc_patch(i)) ) then - this%livestemc_patch(i) = c12_cnveg_carbonstate_inst%livestemc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livestemc_storage_patch(i) /= spval .and. .not. isnan(this%livestemc_storage_patch(i)) ) then - this%livestemc_storage_patch(i) = c12_cnveg_carbonstate_inst%livestemc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livestemc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livestemc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livestemc_xfer_patch(i) /= spval .and. .not. isnan(this%livestemc_xfer_patch(i)) ) then - this%livestemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livestemc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadstemc_patch(i) /= spval .and. .not. isnan(this%deadstemc_patch(i)) ) then - this%deadstemc_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadstemc_storage_patch(i) /= spval .and. .not. isnan(this%deadstemc_storage_patch(i)) ) then - this%deadstemc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadstemc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadstemc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadstemc_xfer_patch(i) /= spval .and. .not. isnan(this%deadstemc_xfer_patch(i)) ) then - this%deadstemc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadstemc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livecrootc_patch(i) /= spval .and. .not. isnan(this%livecrootc_patch(i)) ) then - this%livecrootc_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livecrootc_storage_patch(i) /= spval .and. .not. isnan(this%livecrootc_storage_patch(i)) ) then - this%livecrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='livecrootc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%livecrootc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%livecrootc_xfer_patch(i) /= spval .and. .not. isnan(this%livecrootc_xfer_patch(i)) ) then - this%livecrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%livecrootc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadcrootc_patch(i) /= spval .and. .not. isnan(this%deadcrootc_patch(i)) ) then - this%deadcrootc_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadcrootc_storage_patch(i) /= spval .and. .not. isnan(this%deadcrootc_storage_patch(i)) ) then - this%deadcrootc_storage_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootc_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%deadcrootc_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%deadcrootc_xfer_patch(i) /= spval .and. .not. isnan(this%deadcrootc_xfer_patch(i)) ) then - this%deadcrootc_xfer_patch(i) = c12_cnveg_carbonstate_inst%deadcrootc_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='gresp_storage_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_storage_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%gresp_storage_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%gresp_storage_patch(i) /= spval .and. .not. isnan(this%gresp_storage_patch(i)) ) then - this%gresp_storage_patch(i) = c12_cnveg_carbonstate_inst%gresp_storage_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='gresp_xfer_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%gresp_xfer_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%gresp_xfer_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%gresp_xfer_patch(i) /= spval .and. .not. isnan(this%gresp_xfer_patch(i)) ) then - this%gresp_xfer_patch(i) = c12_cnveg_carbonstate_inst%gresp_xfer_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='cpool_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%cpool_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%cpool_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%cpool_patch(i) /= spval .and. .not. isnan(this%cpool_patch(i)) ) then - this%cpool_patch(i) = c12_cnveg_carbonstate_inst%cpool_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='xsmrpool_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%xsmrpool_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%xsmrpool_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%xsmrpool_patch(i) /= spval .and. .not. isnan(this%xsmrpool_patch(i)) ) then - this%xsmrpool_patch(i) = c12_cnveg_carbonstate_inst%xsmrpool_patch(i) * c14ratio - endif - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='pft_ctrunc_14', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ctrunc_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%ctrunc_patch with atmospheric c14 value' - do i = bounds%begp,bounds%endp - if (this%ctrunc_patch(i) /= spval .and. .not. isnan(this%ctrunc_patch(i)) ) then - this%ctrunc_patch(i) = c12_cnveg_carbonstate_inst%ctrunc_patch(i) * c14ratio - endif - end do - end if - - end if - - !-------------------------------- - ! patch prognostic crop variables - !-------------------------------- - - if (use_crop) then - if (carbon_type == 'c12') then - call restartvar(ncid=ncid, flag=flag, varname='grainc', xtype=ncd_double, & - dim1name='pft', long_name='grain C', units='gC/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainc_storage', xtype=ncd_double, & - dim1name='pft', long_name='grain C storage', units='gC/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainc_xfer', xtype=ncd_double, & - dim1name='pft', long_name='grain C transfer', units='gC/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cropseedc_deficit', xtype=ncd_double, & - dim1name='pft', long_name='pool for seeding new crop growth', units='gC/m2', & - interpinic_flag='interp', readvar=readvar, data=this%cropseedc_deficit_patch) - end if - - if (carbon_type == 'c13') then - call restartvar(ncid=ncid, flag=flag, varname='grainc_13', xtype=ncd_double, & - dim1name='pft', long_name='c13 grain C', units='gC13/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='grainc_13_storage', xtype=ncd_double, & - dim1name='pft', long_name='c13 grain C storage', units='gC13/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_storage_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_storage_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_storage_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='grainc_13_xfer', xtype=ncd_double, & - dim1name='pft', long_name='c13 grain C transfer', units='gC13/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_xfer_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_xfer_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='cropseedc_13_deficit', xtype=ncd_double, & - dim1name='pft', long_name='pool for seeding new crop growth', units='gC13/m2', & - interpinic_flag='interp', readvar=readvar, data=this%cropseedc_deficit_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%cropseedc_deficit_patch, & - template_var = c12_cnveg_carbonstate_inst%cropseedc_deficit_patch, & - multiplier = c3_r2) - end if - end if - - if ( carbon_type == 'c14' ) then - - call restartvar(ncid=ncid, flag=flag, varname='grainc_14', xtype=ncd_double, & - dim1name='pft', long_name='c14 grain C', units='gC14/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='grainc_14_storage', xtype=ncd_double, & - dim1name='pft', long_name='c14 grain C storage', units='gC14/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_storage_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_storage_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_storage_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='grainc_14_xfer', xtype=ncd_double, & - dim1name='pft', long_name='c14 grain C transfer', units='gC14/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainc_xfer_patch) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%grainc_xfer_patch, & - template_var = c12_cnveg_carbonstate_inst%grainc_xfer_patch, & - multiplier = c3_r2) - end if - - call restartvar(ncid=ncid, flag=flag, varname='cropseedc_14_deficit', xtype=ncd_double, & - dim1name='pft', long_name='pool for seeding new crop growth', units='gC14/m2', & - interpinic_flag='interp', readvar=readvar, data=this%cropseedc_deficit_patch) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%cropseedc_deficit_patch with atmospheric c14 value' - call set_missing_from_template( & - my_var = this%cropseedc_deficit_patch, & - template_var = c12_cnveg_carbonstate_inst%cropseedc_deficit_patch, & - multiplier = c14ratio) - end if - end if - end if - - !-------------------------------- - ! gridcell carbon state variables - !-------------------------------- - - if (carbon_type == 'c12') then - ! BACKWARDS_COMPATIBILITY(wjs, 2017-01-12) Naming this with a _g suffix in order - ! to distinguish it from the old column-level seedc restart variable - call restartvar(ncid=ncid, flag=flag, varname='seedc_g', xtype=ncd_double, & - dim1name='gridcell', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%seedc_grc) - end if - - !-------------------------------- - ! C13 gridcell carbon state variables - !-------------------------------- - - if (carbon_type == 'c13') then - call restartvar(ncid=ncid, flag=flag, varname='seedc_13_g', xtype=ncd_double, & - dim1name='gridcell', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%seedc_grc) - if (flag=='read' .and. .not. readvar) then - call set_missing_from_template( & - my_var = this%seedc_grc, & - template_var = c12_cnveg_carbonstate_inst%seedc_grc, & - multiplier = c3_r2) - end if - end if - - !-------------------------------- - ! C14 column carbon state variables - !-------------------------------- - - if ( carbon_type == 'c14' ) then - call restartvar(ncid=ncid, flag=flag, varname='seedc_14_g', xtype=ncd_double, & - dim1name='gridcell', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%seedc_grc) - if (flag=='read' .and. .not. readvar) then - if ( masterproc ) write(iulog,*) 'initializing this%seedc_grc with atmospheric c14 value' - call set_missing_from_template( & - my_var = this%seedc_grc, & - template_var = c12_cnveg_carbonstate_inst%seedc_grc, & - multiplier = c14ratio) - end if - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, & - num_patch, filter_patch, value_patch, & - num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set carbon state variables - ! - ! !ARGUMENTS: - class (cnveg_carbonstate_type) :: this - integer , intent(in) :: num_patch - integer , intent(in) :: filter_patch(:) - real(r8), intent(in) :: value_patch - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i,j,k,l ! loop index - !------------------------------------------------------------------------ - - do fi = 1,num_patch - i = filter_patch(fi) - this%leafc_patch(i) = value_patch - this%leafc_storage_patch(i) = value_patch - this%leafc_xfer_patch(i) = value_patch - this%leafc_storage_xfer_acc_patch(i) = value_patch - this%storage_cdemand_patch(i) = value_patch - this%frootc_patch(i) = value_patch - this%frootc_storage_patch(i) = value_patch - this%frootc_xfer_patch(i) = value_patch - this%livestemc_patch(i) = value_patch - this%livestemc_storage_patch(i) = value_patch - this%livestemc_xfer_patch(i) = value_patch - this%deadstemc_patch(i) = value_patch - this%deadstemc_storage_patch(i) = value_patch - this%deadstemc_xfer_patch(i) = value_patch - this%livecrootc_patch(i) = value_patch - this%livecrootc_storage_patch(i) = value_patch - this%livecrootc_xfer_patch(i) = value_patch - this%deadcrootc_patch(i) = value_patch - this%deadcrootc_storage_patch(i) = value_patch - this%deadcrootc_xfer_patch(i) = value_patch - this%gresp_storage_patch(i) = value_patch - this%gresp_xfer_patch(i) = value_patch - this%cpool_patch(i) = value_patch - this%xsmrpool_patch(i) = value_patch - this%ctrunc_patch(i) = value_patch - this%dispvegc_patch(i) = value_patch - this%storvegc_patch(i) = value_patch - this%woodc_patch(i) = value_patch - this%totvegc_patch(i) = value_patch - this%totc_patch(i) = value_patch - if ( use_crop ) then - this%grainc_patch(i) = value_patch - this%grainc_storage_patch(i) = value_patch - this%grainc_xfer_patch(i) = value_patch - this%cropseedc_deficit_patch(i) = value_patch - end if - end do - - do fi = 1,num_column - i = filter_column(fi) - this%rootc_col(i) = value_column - this%leafc_col(i) = value_column - this%deadstemc_col(i) = value_column - this%fuelc_col(i) = value_column - this%fuelc_crop_col(i) = value_column - this%totvegc_col(i) = value_column - this%totc_p2c_col(i) = value_column - this%totc_col(i) = value_column - this%totecosysc_col(i) = value_column - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine ZeroDwt( this, bounds ) - ! - ! !DESCRIPTION - ! Initialize variables needed for dynamic land use. - ! - ! !ARGUMENTS: - class(cnveg_carbonstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - !----------------------------------------------------------------------- - - do p = bounds%begp,bounds%endp - this%dispvegc_patch(p) = 0._r8 - this%storvegc_patch(p) = 0._r8 - this%totc_patch(p) = 0._r8 - end do - - end subroutine ZeroDwt - - !----------------------------------------------------------------------- - subroutine Summary_carbonstate(this, bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_cwdc_col, soilbiogeochem_totlitc_col, soilbiogeochem_totsomc_col, & - soilbiogeochem_ctrunc_col) - ! - ! !USES: - use subgridAveMod, only : p2c - use clm_time_manager , only : get_nstep - - ! - ! !DESCRIPTION: - ! Perform patch and column-level carbon summary calculations - ! - ! !ARGUMENTS: - class(cnveg_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - real(r8) , intent(in) :: soilbiogeochem_cwdc_col(bounds%begc:) - real(r8) , intent(in) :: soilbiogeochem_totlitc_col(bounds%begc:) - real(r8) , intent(in) :: soilbiogeochem_totsomc_col(bounds%begc:) - real(r8) , intent(in) :: soilbiogeochem_ctrunc_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l ! indices - integer :: fp,fc ! lake filter indices - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(soilbiogeochem_cwdc_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(soilbiogeochem_totlitc_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(soilbiogeochem_totsomc_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(soilbiogeochem_ctrunc_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - ! calculate patch -level summary of carbon state - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! displayed vegetation carbon, excluding storage and cpool (DISPVEGC) - this%dispvegc_patch(p) = & - this%leafc_patch(p) + & - this%frootc_patch(p) + & - this%livestemc_patch(p) + & - this%deadstemc_patch(p) + & - this%livecrootc_patch(p) + & - this%deadcrootc_patch(p) - - ! stored vegetation carbon, excluding cpool (STORVEGC) - this%storvegc_patch(p) = & - this%cpool_patch(p) + & - this%leafc_storage_patch(p) + & - this%frootc_storage_patch(p) + & - this%livestemc_storage_patch(p) + & - this%deadstemc_storage_patch(p) + & - this%livecrootc_storage_patch(p) + & - this%deadcrootc_storage_patch(p) + & - this%leafc_xfer_patch(p) + & - this%frootc_xfer_patch(p) + & - this%livestemc_xfer_patch(p) + & - this%deadstemc_xfer_patch(p) + & - this%livecrootc_xfer_patch(p) + & - this%deadcrootc_xfer_patch(p) + & - this%gresp_storage_patch(p) + & - this%gresp_xfer_patch(p) - - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%storvegc_patch(p) = & - this%storvegc_patch(p) + & - this%grainc_storage_patch(p) + & - this%grainc_xfer_patch(p) - - this%dispvegc_patch(p) = & - this%dispvegc_patch(p) + & - this%grainc_patch(p) - end if - - ! total vegetation carbon, excluding cpool (TOTVEGC) - this%totvegc_patch(p) = & - this%dispvegc_patch(p) + & - this%storvegc_patch(p) - - ! total patch-level carbon, including xsmrpool, ctrunc - this%totc_patch(p) = & - this%totvegc_patch(p) + & - this%xsmrpool_patch(p) + & - this%ctrunc_patch(p) - - if (use_crop) then - this%totc_patch(p) = this%totc_patch(p) + this%cropseedc_deficit_patch(p) - end if - - ! (WOODC) - wood C - this%woodc_patch(p) = & - this%deadstemc_patch(p) + & - this%livestemc_patch(p) + & - this%deadcrootc_patch(p) + & - this%livecrootc_patch(p) - - end do - - ! -------------------------------------------- - ! column level summary - ! -------------------------------------------- - - call p2c(bounds, num_soilc, filter_soilc, & - this%totvegc_patch(bounds%begp:bounds%endp), & - this%totvegc_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%totc_patch(bounds%begp:bounds%endp), & - this%totc_p2c_col(bounds%begc:bounds%endc)) - - do fc = 1,num_allc - c = filter_allc(fc) - - ! total ecosystem carbon, including veg but excluding cpool (TOTECOSYSC) - this%totecosysc_col(c) = & - soilbiogeochem_cwdc_col(c) + & - soilbiogeochem_totlitc_col(c) + & - soilbiogeochem_totsomc_col(c) + & - this%totvegc_col(c) - - ! total column carbon, including veg and cpool (TOTCOLC) - this%totc_col(c) = this%totc_p2c_col(c) + & - soilbiogeochem_cwdc_col(c) + & - soilbiogeochem_totlitc_col(c) + & - soilbiogeochem_totsomc_col(c) + & - soilbiogeochem_ctrunc_col(c) - - end do - - end subroutine Summary_carbonstate - - !----------------------------------------------------------------------- - subroutine DynamicPatchAdjustments(this, bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed, deadstemc_seed, & - conv_cflux, wood_product_cflux, crop_product_cflux, & - dwt_frootc_to_litter, & - dwt_livecrootc_to_litter, & - dwt_deadcrootc_to_litter, & - dwt_leafc_seed, & - dwt_deadstemc_seed) - ! - ! !DESCRIPTION: - ! Adjust state variables and compute associated fluxes when patch areas change due to - ! dynamic landuse - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cnveg_carbonstate_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp_with_inactive ! number of points in filter - integer , intent(in) :: filter_soilp_with_inactive(:) ! soil patch filter that includes inactive points - type(patch_state_updater_type) , intent(in) :: patch_state_updater - real(r8) , intent(in) :: leafc_seed ! seed amount for leaf C - real(r8) , intent(in) :: deadstemc_seed ! seed amount for deadstem C - real(r8) , intent(inout) :: conv_cflux( bounds%begp: ) ! patch-level conversion C flux to atm (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: wood_product_cflux( bounds%begp: ) ! patch-level product C flux (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: crop_product_cflux( bounds%begp: ) ! patch-level crop product C flux (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: dwt_frootc_to_litter( bounds%begp: ) ! patch-level fine root C to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_livecrootc_to_litter( bounds%begp: ) ! patch-level live coarse root C to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_deadcrootc_to_litter( bounds%begp: ) ! patch-level live coarse root C to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_leafc_seed( bounds%begp: ) ! patch-level mass gain due to seeding of new area: leaf C (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: dwt_deadstemc_seed( bounds%begp: ) ! patch-level mass gain due to seeding of new area: deadstem C (expressed per unit GRIDCELL area) - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - logical :: old_weight_was_zero(bounds%begp:bounds%endp) - logical :: patch_grew(bounds%begp:bounds%endp) - - ! The following are only set for growing patches: - real(r8) :: seed_leafc_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leafc_storage_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leafc_xfer_patch(bounds%begp:bounds%endp) - real(r8) :: seed_deadstemc_patch(bounds%begp:bounds%endp) - - character(len=*), parameter :: subname = 'DynamicPatchAdjustments' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - SHR_ASSERT_ALL((ubound(conv_cflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wood_product_cflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(crop_product_cflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_frootc_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_livecrootc_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_deadcrootc_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_leafc_seed) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_deadstemc_seed) == (/endp/)), errMsg(sourcefile, __LINE__)) - - old_weight_was_zero = patch_state_updater%old_weight_was_zero(bounds) - patch_grew = patch_state_updater%patch_grew(bounds) - - call ComputeSeedAmounts(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - species = this%species, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - leaf_patch = this%leafc_patch(begp:endp), & - leaf_storage_patch = this%leafc_storage_patch(begp:endp), & - leaf_xfer_patch = this%leafc_xfer_patch(begp:endp), & - - ! Calculations only needed for patches that grew: - compute_here_patch = patch_grew(begp:endp), & - - ! For patches that previously had zero area, ignore the current state for the - ! sake of computing leaf proportions: - ignore_current_state_patch = old_weight_was_zero(begp:endp), & - - seed_leaf_patch = seed_leafc_patch(begp:endp), & - seed_leaf_storage_patch = seed_leafc_storage_patch(begp:endp), & - seed_leaf_xfer_patch = seed_leafc_xfer_patch(begp:endp), & - seed_deadstem_patch = seed_deadstemc_patch(begp:endp)) - - call update_patch_state( & - var = this%leafc_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp), & - seed = seed_leafc_patch(begp:endp), & - seed_addition = dwt_leafc_seed(begp:endp)) - - call update_patch_state( & - var = this%leafc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp), & - seed = seed_leafc_storage_patch(begp:endp), & - seed_addition = dwt_leafc_seed(begp:endp)) - - call update_patch_state( & - var = this%leafc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp), & - seed = seed_leafc_xfer_patch(begp:endp), & - seed_addition = dwt_leafc_seed(begp:endp)) - - call update_patch_state( & - var = this%frootc_patch(begp:endp), & - flux_out_col_area = dwt_frootc_to_litter(begp:endp)) - - call update_patch_state( & - var = this%frootc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%frootc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%livestemc_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%livestemc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%livestemc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call patch_state_updater%update_patch_state_partition_flux_by_type(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - flux1_fraction_by_pft_type = pftcon%pconv, & - var = this%deadstemc_patch(begp:endp), & - flux1_out = conv_cflux(begp:endp), & - flux2_out = wood_product_cflux(begp:endp), & - seed = seed_deadstemc_patch(begp:endp), & - seed_addition = dwt_deadstemc_seed(begp:endp)) - - call update_patch_state( & - var = this%deadstemc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%deadstemc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%livecrootc_patch(begp:endp), & - flux_out_col_area = dwt_livecrootc_to_litter(begp:endp)) - - call update_patch_state( & - var = this%livecrootc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%livecrootc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%deadcrootc_patch(begp:endp), & - flux_out_col_area = dwt_deadcrootc_to_litter(begp:endp)) - - call update_patch_state( & - var = this%deadcrootc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%deadcrootc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%gresp_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%gresp_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%cpool_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%xsmrpool_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%ctrunc_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - if (use_crop) then - call update_patch_state( & - var = this%grainc_patch(begp:endp), & - flux_out_grc_area = crop_product_cflux(begp:endp)) - - call update_patch_state( & - var = this%grainc_storage_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - call update_patch_state( & - var = this%grainc_xfer_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - - if (use_crop) then - ! This is a negative pool. So any deficit that we haven't repaid gets sucked out - ! of the atmosphere. - call update_patch_state( & - var = this%cropseedc_deficit_patch(begp:endp), & - flux_out_grc_area = conv_cflux(begp:endp)) - end if - end if - - contains - subroutine update_patch_state(var, flux_out_col_area, flux_out_grc_area, & - seed, seed_addition) - ! Wraps call to update_patch_state, in order to remove duplication - real(r8), intent(inout) :: var( bounds%begp: ) - real(r8), intent(inout), optional :: flux_out_col_area( bounds%begp: ) - real(r8), intent(inout), optional :: flux_out_grc_area( bounds%begp: ) - real(r8), intent(in), optional :: seed( bounds%begp: ) - real(r8), intent(inout), optional :: seed_addition( bounds%begp: ) - - call patch_state_updater%update_patch_state(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - var = var, & - flux_out_col_area = flux_out_col_area, & - flux_out_grc_area = flux_out_grc_area, & - seed = seed, & - seed_addition = seed_addition) - end subroutine update_patch_state - - end subroutine DynamicPatchAdjustments - -end module CNVegCarbonStateType diff --git a/src/biogeochem/CNVegComputeSeedMod.F90 b/src/biogeochem/CNVegComputeSeedMod.F90 deleted file mode 100644 index 01cf471e20..0000000000 --- a/src/biogeochem/CNVegComputeSeedMod.F90 +++ /dev/null @@ -1,259 +0,0 @@ -module CNVegComputeSeedMod - - !----------------------------------------------------------------------- - ! Module to compute seed amounts for new patch areas - ! - ! !USES: -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use pftconMod , only : pftcon, noveg - use clm_varcon , only : c3_r2, c4_r2, c14ratio - use clm_varctl , only : iulog - use PatchType , only : patch - use abortutils , only : endrun - use CNSpeciesMod , only : CN_SPECIES_C12, CN_SPECIES_C13, CN_SPECIES_C14, CN_SPECIES_N - ! - ! !PUBLIC ROUTINES: - implicit none - private - - public :: ComputeSeedAmounts - - ! !PRIVATE ROUTINES: - - private :: SpeciesTypeMultiplier - private :: LeafProportions ! compute leaf proportions (leaf, storage and xfer) - - ! !PRIVATE DATA: - - integer, parameter :: COMPONENT_LEAF = 1 - integer, parameter :: COMPONENT_DEADWOOD = 2 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine ComputeSeedAmounts(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - species, & - leafc_seed, deadstemc_seed, & - leaf_patch, leaf_storage_patch, leaf_xfer_patch, & - compute_here_patch, ignore_current_state_patch, & - seed_leaf_patch, seed_leaf_storage_patch, seed_leaf_xfer_patch, & - seed_deadstem_patch) - ! - ! !DESCRIPTION: - ! Compute seed amounts for patches that increase in area, for various variables, for - ! the given species (c12, c13, c14 or n). - ! - ! The output variables are only set for patches inside the filter, where - ! compute_here_patch is true; for other patches, they remain at their original values. - ! - ! Note that, regardless of the species, leafc_seed and deadstemc_seed are specified - ! in terms of gC/m2; these amounts are converted to the amount of the given species - ! here. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp_with_inactive ! number of points in filter - integer , intent(in) :: filter_soilp_with_inactive(:) ! soil patch filter that includes inactive points - integer , intent(in) :: species ! which C/N species we're operating on; should be one of the values in CNSpeciesMod - real(r8) , intent(in) :: leafc_seed ! seed amount for leaf C - real(r8) , intent(in) :: deadstemc_seed ! seed amount for deadstem C - real(r8) , intent(in) :: leaf_patch( bounds%begp: ) ! current leaf C or N content (g/m2) - real(r8) , intent(in) :: leaf_storage_patch( bounds%begp: ) ! current leaf C or N storage content (g/m2) - real(r8) , intent(in) :: leaf_xfer_patch( bounds%begp: ) ! current leaf C or N xfer content (g/m2) - - ! whether to compute outputs for each patch - logical, intent(in) :: compute_here_patch( bounds%begp: ) - - ! If ignore_current_state is true, then use default leaf proportions rather than - ! proportions based on current state. - logical, intent(in) :: ignore_current_state_patch( bounds%begp: ) - - real(r8), intent(inout) :: seed_leaf_patch( bounds%begp: ) ! seed amount for leaf itself for this species (g/m2) - real(r8), intent(inout) :: seed_leaf_storage_patch( bounds%begp: ) ! seed amount for leaf storage for this species (g/m2) - real(r8), intent(inout) :: seed_leaf_xfer_patch( bounds%begp: ) ! seed amount for leaf xfer for this species (g/m2) - real(r8), intent(inout) :: seed_deadstem_patch( bounds%begp: ) ! seed amount for deadstem for this species (g/m2) - ! - ! !LOCAL VARIABLES: - integer :: fp, p - integer :: begp, endp - real(r8) :: my_leaf_seed - real(r8) :: my_deadstem_seed - integer :: pft_type - real(r8) :: pleaf - real(r8) :: pstor - real(r8) :: pxfer - - character(len=*), parameter :: subname = 'ComputeSeedAmounts' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - SHR_ASSERT_ALL((ubound(leaf_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(leaf_storage_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(leaf_xfer_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(compute_here_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ignore_current_state_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(seed_leaf_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(seed_leaf_storage_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(seed_leaf_xfer_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(seed_deadstem_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - - - do fp = 1, num_soilp_with_inactive - p = filter_soilp_with_inactive(fp) - - if (compute_here_patch(p)) then - - my_leaf_seed = 0._r8 - my_deadstem_seed = 0._r8 - - pft_type = patch%itype(p) - - call LeafProportions( & - ignore_current_state = ignore_current_state_patch(p), & - pft_type = pft_type, & - leaf = leaf_patch(p), & - leaf_storage = leaf_storage_patch(p), & - leaf_xfer = leaf_xfer_patch(p), & - pleaf = pleaf, & - pstorage = pstor, & - pxfer = pxfer) - - if (pft_type /= noveg) then - my_leaf_seed = leafc_seed * & - SpeciesTypeMultiplier(species, pft_type, COMPONENT_LEAF) - if (pftcon%woody(pft_type) == 1._r8) then - my_deadstem_seed = deadstemc_seed * & - SpeciesTypeMultiplier(species, pft_type, COMPONENT_DEADWOOD) - end if - end if - - seed_leaf_patch(p) = my_leaf_seed * pleaf - seed_leaf_storage_patch(p) = my_leaf_seed * pstor - seed_leaf_xfer_patch(p) = my_leaf_seed * pxfer - seed_deadstem_patch(p) = my_deadstem_seed - end if - - end do - - end subroutine ComputeSeedAmounts - - - !----------------------------------------------------------------------- - function SpeciesTypeMultiplier(species, pft_type, component) result(multiplier) - ! - ! !DESCRIPTION: - ! Returns a multiplier based on the species type. This multiplier is - ! meant to be applied to some state variable expressed in terms of g C, translating - ! this value into an appropriate value for c13, c14 or n. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8) :: multiplier ! function result - integer, intent(in) :: species ! which C/N species we're operating on; should be one of the values in CNSpeciesMod - integer, intent(in) :: pft_type - integer, intent(in) :: component ! which plant component; should be one of the COMPONENT_* parameters defined in this module - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'SpeciesTypeMultiplier' - !----------------------------------------------------------------------- - - select case (species) - case (CN_SPECIES_C12) - multiplier = 1._r8 - - case (CN_SPECIES_C13) - if (pftcon%c3psn(pft_type) == 1._r8) then - multiplier = c3_r2 - else - multiplier = c4_r2 - end if - - case (CN_SPECIES_C14) - ! 14c state is initialized assuming initial "modern" 14C of 1.e-12 - multiplier = c14ratio - - case (CN_SPECIES_N) - select case (component) - case (COMPONENT_LEAF) - multiplier = 1._r8 / pftcon%leafcn(pft_type) - case (COMPONENT_DEADWOOD) - multiplier = 1._r8 / pftcon%deadwdcn(pft_type) - case default - write(iulog,*) subname//' ERROR: unknown component: ', component - call endrun(subname//': unknown component') - end select - - case default - write(iulog,*) subname//' ERROR: unknown species: ', species - call endrun(subname//': unknown species') - end select - - end function SpeciesTypeMultiplier - - - !----------------------------------------------------------------------- - subroutine LeafProportions(ignore_current_state, & - pft_type, & - leaf, leaf_storage, leaf_xfer, & - pleaf, pstorage, pxfer) - ! - ! !DESCRIPTION: - ! Compute leaf proportions (leaf, storage and xfer) - ! - ! If ignore_current_state is true, then use default proportions rather than - ! proportions based on current state. (Also use default proportions if total leaf mass - ! is 0 for this patch.) - ! - ! !USES: - ! - ! !ARGUMENTS: - logical, intent(in) :: ignore_current_state ! see comment above - integer , intent(in) :: pft_type - real(r8), intent(in) :: leaf ! g/m2 leaf C or N - real(r8), intent(in) :: leaf_storage ! g/m2 leaf C or N storage - real(r8), intent(in) :: leaf_xfer ! g/m2 leaf C or N transfer - - real(r8), intent(out) :: pleaf ! proportion in leaf itself - real(r8), intent(out) :: pstorage ! proportion in leaf storage - real(r8), intent(out) :: pxfer ! proportion in leaf xfer - ! - ! !LOCAL VARIABLES: - real(r8) :: tot_leaf - - character(len=*), parameter :: subname = 'LeafProportions' - !----------------------------------------------------------------------- - - tot_leaf = leaf + leaf_storage + leaf_xfer - pleaf = 0._r8 - pstorage = 0._r8 - pxfer = 0._r8 - - if (tot_leaf == 0._r8 .or. ignore_current_state) then - if (pftcon%evergreen(pft_type) == 1._r8) then - pleaf = 1._r8 - else - pstorage = 1._r8 - end if - else - pleaf = leaf/tot_leaf - pstorage = leaf_storage/tot_leaf - pxfer = leaf_xfer/tot_leaf - end if - - end subroutine LeafProportions - -end module CNVegComputeSeedMod diff --git a/src/biogeochem/CNVegNitrogenFluxType.F90 b/src/biogeochem/CNVegNitrogenFluxType.F90 deleted file mode 100644 index 47b620bf91..0000000000 --- a/src/biogeochem/CNVegNitrogenFluxType.F90 +++ /dev/null @@ -1,1881 +0,0 @@ -module CNVegNitrogenFluxType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : nlevdecomp_full, nlevdecomp - use clm_varcon , only : spval, ispval, dzsoi_decomp - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_crop - use CNSharedParamsMod , only : use_fun - use decompMod , only : bounds_type - use abortutils , only : endrun - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - private - ! - type, public :: cnveg_nitrogenflux_type - - ! gap mortality fluxes - real(r8), pointer :: m_leafn_to_litter_patch (:) ! patch leaf N mortality (gN/m2/s) - real(r8), pointer :: m_frootn_to_litter_patch (:) ! patch fine root N mortality (gN/m2/s) - real(r8), pointer :: m_leafn_storage_to_litter_patch (:) ! patch leaf N storage mortality (gN/m2/s) - real(r8), pointer :: m_frootn_storage_to_litter_patch (:) ! patch fine root N storage mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_storage_to_litter_patch (:) ! patch live stem N storage mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_storage_to_litter_patch (:) ! patch dead stem N storage mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_storage_to_litter_patch (:) ! patch live coarse root N storage mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_storage_to_litter_patch (:) ! patch dead coarse root N storage mortality (gN/m2/s) - real(r8), pointer :: m_leafn_xfer_to_litter_patch (:) ! patch leaf N transfer mortality (gN/m2/s) - real(r8), pointer :: m_frootn_xfer_to_litter_patch (:) ! patch fine root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_xfer_to_litter_patch (:) ! patch live stem N transfer mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_xfer_to_litter_patch (:) ! patch dead stem N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_xfer_to_litter_patch (:) ! patch live coarse root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_xfer_to_litter_patch (:) ! patch dead coarse root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_to_litter_patch (:) ! patch live stem N mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_to_litter_patch (:) ! patch dead stem N mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_to_litter_patch (:) ! patch live coarse root N mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_litter_patch (:) ! patch dead coarse root N mortality (gN/m2/s) - real(r8), pointer :: m_retransn_to_litter_patch (:) ! patch retranslocated N pool mortality (gN/m2/s) - - ! harvest fluxes - real(r8), pointer :: hrv_leafn_to_litter_patch (:) ! patch leaf N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_to_litter_patch (:) ! patch fine root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_leafn_storage_to_litter_patch (:) ! patch leaf N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_storage_to_litter_patch (:) ! patch fine root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_storage_to_litter_patch (:) ! patch live stem N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_storage_to_litter_patch (:) ! patch dead stem N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_storage_to_litter_patch (:) ! patch live coarse root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_storage_to_litter_patch (:) ! patch dead coarse root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_leafn_xfer_to_litter_patch (:) ! patch leaf N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_xfer_to_litter_patch (:) ! patch fine root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_xfer_to_litter_patch (:) ! patch live stem N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_xfer_to_litter_patch (:) ! patch dead stem N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_xfer_to_litter_patch (:) ! patch live coarse root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litter_patch (:) ! patch dead coarse root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_to_litter_patch (:) ! patch live stem N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_to_litter_patch (:) ! patch live coarse root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_to_litter_patch (:) ! patch dead coarse root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_retransn_to_litter_patch (:) ! patch retranslocated N pool harvest mortality (gN/m2/s) - real(r8), pointer :: grainn_to_cropprodn_patch (:) ! patch grain N to crop product pool (gN/m2/s) - real(r8), pointer :: grainn_to_cropprodn_col (:) ! col grain N to crop product pool (gN/m2/s) - real(r8), pointer :: m_n_to_litr_met_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter labile N by fire (gN/m3/s) - real(r8), pointer :: m_n_to_litr_cel_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter cellulose N by fire (gN/m3/s) - real(r8), pointer :: m_n_to_litr_lig_fire_col (:,:) ! col N from leaf, froot, xfer and storage N to litter lignin N by fire (gN/m3/s) - real(r8), pointer :: harvest_n_to_litr_met_n_col (:,:) ! col N fluxes associated with harvest to litter metabolic pool (gN/m3/s) - real(r8), pointer :: harvest_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with harvest to litter cellulose pool (gN/m3/s) - real(r8), pointer :: harvest_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with harvest to litter lignin pool (gN/m3/s) - real(r8), pointer :: harvest_n_to_cwdn_col (:,:) ! col N fluxes associated with harvest to CWD pool (gN/m3/s) - - ! fire N fluxes - real(r8), pointer :: m_decomp_npools_to_fire_vr_col (:,:,:) ! col vertically-resolved decomposing N fire loss (gN/m3/s) - real(r8), pointer :: m_decomp_npools_to_fire_col (:,:) ! col vertically-integrated (diagnostic) decomposing N fire loss (gN/m2/s) - real(r8), pointer :: m_leafn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from leafn - real(r8), pointer :: m_leafn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from leafn_storage - real(r8), pointer :: m_leafn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from leafn_xfer - real(r8), pointer :: m_livestemn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from livestemn - real(r8), pointer :: m_livestemn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from livestemn_storage - real(r8), pointer :: m_livestemn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from livestemn_xfer - real(r8), pointer :: m_deadstemn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadstemn - real(r8), pointer :: m_deadstemn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadstemn_storage - real(r8), pointer :: m_deadstemn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadstemn_xfer - real(r8), pointer :: m_frootn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from frootn - real(r8), pointer :: m_frootn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from frootn_storage - real(r8), pointer :: m_frootn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from frootn_xfer - real(r8), pointer :: m_livecrootn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from m_livecrootn_to_fire - real(r8), pointer :: m_livecrootn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from livecrootn_storage - real(r8), pointer :: m_livecrootn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from livecrootn_xfer - real(r8), pointer :: m_deadcrootn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadcrootn - real(r8), pointer :: m_deadcrootn_storage_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadcrootn_storage - real(r8), pointer :: m_deadcrootn_xfer_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from deadcrootn_xfer - real(r8), pointer :: m_retransn_to_fire_patch (:) ! patch (gN/m2/s) fire N emissions from retransn - real(r8), pointer :: m_leafn_to_litter_fire_patch (:) ! patch (gN/m2/s) from leafn to litter N due to fire - real(r8), pointer :: m_leafn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from leafn_storage to litter N due to fire - real(r8), pointer :: m_leafn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from leafn_xfer to litter N due to fire - real(r8), pointer :: m_livestemn_to_litter_fire_patch (:) ! patch (gN/m2/s) from livestemn to litter N due to fire - real(r8), pointer :: m_livestemn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from livestemn_storage to litter N due to fire - real(r8), pointer :: m_livestemn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from livestemn_xfer to litter N due to fire - real(r8), pointer :: m_livestemn_to_deadstemn_fire_patch (:) ! patch (gN/m2/s) from livestemn to deadstemn N due to fire - real(r8), pointer :: m_deadstemn_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadstemn to litter N due to fire - real(r8), pointer :: m_deadstemn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadstemn_storage to litter N due to fire - real(r8), pointer :: m_deadstemn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadstemn_xfer to litter N due to fire - real(r8), pointer :: m_frootn_to_litter_fire_patch (:) ! patch (gN/m2/s) from frootn to litter N due to fire - real(r8), pointer :: m_frootn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from frootn_storage to litter N due to fire - real(r8), pointer :: m_frootn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from frootn_xfer to litter N due to fire - real(r8), pointer :: m_livecrootn_to_litter_fire_patch (:) ! patch (gN/m2/s) from livecrootn to litter N due to fire - real(r8), pointer :: m_livecrootn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from livecrootn_storage to litter N due to fire - real(r8), pointer :: m_livecrootn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from livecrootn_xfer to litter N due to fire - real(r8), pointer :: m_livecrootn_to_deadcrootn_fire_patch (:) ! patch (gN/m2/s) from livecrootn_xfer to deadcrootn due to fire - real(r8), pointer :: m_deadcrootn_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadcrootn to deadcrootn due to fire - real(r8), pointer :: m_deadcrootn_storage_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadcrootn_storage to deadcrootn due to fire - real(r8), pointer :: m_deadcrootn_xfer_to_litter_fire_patch (:) ! patch (gN/m2/s) from deadcrootn_xfer to deadcrootn due to fire - real(r8), pointer :: m_retransn_to_litter_fire_patch (:) ! patch (gN/m2/s) from retransn to deadcrootn due to fire - real(r8), pointer :: fire_nloss_patch (:) ! patch total patch-level fire N loss (gN/m2/s) - real(r8), pointer :: fire_nloss_col (:) ! col total column-level fire N loss (gN/m2/s) - real(r8), pointer :: fire_nloss_p2c_col (:) ! col patch2col column-level fire N loss (gN/m2/s) (p2c) - real(r8), pointer :: fire_mortality_n_to_cwdn_col (:,:) ! col N fluxes associated with fire mortality to CWD pool (gN/m3/s) - - ! phenology fluxes from transfer pool - real(r8), pointer :: grainn_xfer_to_grainn_patch (:) ! patch grain N growth from storage for prognostic crop model (gN/m2/s) - real(r8), pointer :: leafn_xfer_to_leafn_patch (:) ! patch leaf N growth from storage (gN/m2/s) - real(r8), pointer :: frootn_xfer_to_frootn_patch (:) ! patch fine root N growth from storage (gN/m2/s) - real(r8), pointer :: livestemn_xfer_to_livestemn_patch (:) ! patch live stem N growth from storage (gN/m2/s) - real(r8), pointer :: deadstemn_xfer_to_deadstemn_patch (:) ! patch dead stem N growth from storage (gN/m2/s) - real(r8), pointer :: livecrootn_xfer_to_livecrootn_patch (:) ! patch live coarse root N growth from storage (gN/m2/s) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn_patch (:) ! patch dead coarse root N growth from storage (gN/m2/s) - - ! litterfall fluxes - real(r8), pointer :: livestemn_to_litter_patch (:) ! patch livestem N to litter (gN/m2/s) - real(r8), pointer :: grainn_to_food_patch (:) ! patch grain N to food for prognostic crop (gN/m2/s) - real(r8), pointer :: grainn_to_seed_patch (:) ! patch grain N to seed for prognostic crop (gN/m2/s) - real(r8), pointer :: leafn_to_litter_patch (:) ! patch leaf N litterfall (gN/m2/s) - real(r8), pointer :: leafn_to_retransn_patch (:) ! patch leaf N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: frootn_to_retransn_patch (:) ! patch fine root N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: frootn_to_litter_patch (:) ! patch fine root N litterfall (gN/m2/s) - - ! allocation fluxes - real(r8), pointer :: retransn_to_npool_patch (:) ! patch deployment of retranslocated N (gN/m2/s) - real(r8), pointer :: free_retransn_to_npool_patch (:) ! patch deployment of free retranslocated N (gN/m2/s) - real(r8), pointer :: sminn_to_npool_patch (:) ! patch deployment of soil mineral N uptake (gN/m2/s) - real(r8), pointer :: npool_to_grainn_patch (:) ! patch allocation to grain N for prognostic crop (gN/m2/s) - real(r8), pointer :: npool_to_grainn_storage_patch (:) ! patch allocation to grain N storage for prognostic crop (gN/m2/s) - real(r8), pointer :: npool_to_leafn_patch (:) ! patch allocation to leaf N (gN/m2/s) - real(r8), pointer :: npool_to_leafn_storage_patch (:) ! patch allocation to leaf N storage (gN/m2/s) - real(r8), pointer :: npool_to_frootn_patch (:) ! patch allocation to fine root N (gN/m2/s) - real(r8), pointer :: npool_to_frootn_storage_patch (:) ! patch allocation to fine root N storage (gN/m2/s) - real(r8), pointer :: npool_to_livestemn_patch (:) ! patch allocation to live stem N (gN/m2/s) - real(r8), pointer :: npool_to_livestemn_storage_patch (:) ! patch allocation to live stem N storage (gN/m2/s) - real(r8), pointer :: npool_to_deadstemn_patch (:) ! patch allocation to dead stem N (gN/m2/s) - real(r8), pointer :: npool_to_deadstemn_storage_patch (:) ! patch allocation to dead stem N storage (gN/m2/s) - real(r8), pointer :: npool_to_livecrootn_patch (:) ! patch allocation to live coarse root N (gN/m2/s) - real(r8), pointer :: npool_to_livecrootn_storage_patch (:) ! patch allocation to live coarse root N storage (gN/m2/s) - real(r8), pointer :: npool_to_deadcrootn_patch (:) ! patch allocation to dead coarse root N (gN/m2/s) - real(r8), pointer :: npool_to_deadcrootn_storage_patch (:) ! patch allocation to dead coarse root N storage (gN/m2/s) - - ! annual turnover of storage to transfer pools - real(r8), pointer :: grainn_storage_to_xfer_patch (:) ! patch grain N shift storage to transfer for prognostic crop (gN/m2/s) - real(r8), pointer :: leafn_storage_to_xfer_patch (:) ! patch leaf N shift storage to transfer (gN/m2/s) - real(r8), pointer :: frootn_storage_to_xfer_patch (:) ! patch fine root N shift storage to transfer (gN/m2/s) - real(r8), pointer :: livestemn_storage_to_xfer_patch (:) ! patch live stem N shift storage to transfer (gN/m2/s) - real(r8), pointer :: deadstemn_storage_to_xfer_patch (:) ! patch dead stem N shift storage to transfer (gN/m2/s) - real(r8), pointer :: livecrootn_storage_to_xfer_patch (:) ! patch live coarse root N shift storage to transfer (gN/m2/s) - real(r8), pointer :: deadcrootn_storage_to_xfer_patch (:) ! patch dead coarse root N shift storage to transfer (gN/m2/s) - real(r8), pointer :: fert_patch (:) ! patch applied fertilizer (gN/m2/s) - real(r8), pointer :: fert_counter_patch (:) ! patch >0 fertilize; <=0 not - real(r8), pointer :: soyfixn_patch (:) ! patch soybean fixed N (gN/m2/s) - - ! turnover of livewood to deadwood, with retranslocation - real(r8), pointer :: livestemn_to_deadstemn_patch (:) ! patch live stem N turnover (gN/m2/s) - real(r8), pointer :: livestemn_to_retransn_patch (:) ! patch live stem N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: livecrootn_to_deadcrootn_patch (:) ! patch live coarse root N turnover (gN/m2/s) - real(r8), pointer :: livecrootn_to_retransn_patch (:) ! patch live coarse root N to retranslocated N pool (gN/m2/s) - - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: ndeploy_patch (:) ! patch total N deployed to growth and storage (gN/m2/s) - real(r8), pointer :: wood_harvestn_patch (:) ! patch total N losses to wood product pools (gN/m2/s) - real(r8), pointer :: wood_harvestn_col (:) ! col total N losses to wood product pools (gN/m2/s) (p2c) - ! phenology: litterfall and crop fluxes - real(r8), pointer :: phenology_n_to_litr_met_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter metabolic pool (gN/m3/s) - real(r8), pointer :: phenology_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter cellulose pool (gN/m3/s) - real(r8), pointer :: phenology_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with phenology (litterfall and crop) to litter lignin pool (gN/m3/s) - - ! gap mortality fluxes - real(r8), pointer :: gap_mortality_n_to_litr_met_n_col (:,:) ! col N fluxes associated with gap mortality to litter metabolic pool (gN/m3/s) - real(r8), pointer :: gap_mortality_n_to_litr_cel_n_col (:,:) ! col N fluxes associated with gap mortality to litter cellulose pool (gN/m3/s) - real(r8), pointer :: gap_mortality_n_to_litr_lig_n_col (:,:) ! col N fluxes associated with gap mortality to litter lignin pool (gN/m3/s) - real(r8), pointer :: gap_mortality_n_to_cwdn_col (:,:) ! col N fluxes associated with gap mortality to CWD pool (gN/m3/s) - - ! dynamic landcover fluxes - real(r8), pointer :: dwt_seedn_to_leaf_patch (:) ! (gN/m2/s) seed source to patch-level; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_seedn_to_leaf_grc (:) ! (gN/m2/s) dwt_seedn_to_leaf_patch summed to the gridcell-level - real(r8), pointer :: dwt_seedn_to_deadstem_patch (:) ! (gN/m2/s) seed source to patch-level; although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_seedn_to_deadstem_grc (:) ! (gN/m2/s) dwt_seedn_to_deadstem_patch summed to the gridcell-level - real(r8), pointer :: dwt_conv_nflux_patch (:) ! (gN/m2/s) conversion N flux (immediate loss to atm); although this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_conv_nflux_grc (:) ! (gN/m2/s) dwt_conv_nflux_patch summed to the gridcell-level - real(r8), pointer :: dwt_wood_productn_gain_patch (:) ! patch (gN/m2/s) addition to wood product pools from landcover change; even though this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_crop_productn_gain_patch (:) ! patch (gN/m2/s) addition to crop product pool from landcover change; even though this is a patch-level flux, it is expressed per unit GRIDCELL area - real(r8), pointer :: dwt_frootn_to_litr_met_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootn_to_litr_cel_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootn_to_litr_lig_n_col (:,:) ! col (gN/m3/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_livecrootn_to_cwdn_col (:,:) ! col (gN/m3/s) live coarse root to CWD due to landcover change - real(r8), pointer :: dwt_deadcrootn_to_cwdn_col (:,:) ! col (gN/m3/s) dead coarse root to CWD due to landcover change - - ! crop fluxes - real(r8), pointer :: crop_seedn_to_leaf_patch (:) ! patch (gN/m2/s) seed source to leaf, for crops - - ! Misc - real(r8), pointer :: plant_ndemand_patch (:) ! N flux required to support initial GPP (gN/m2/s) - real(r8), pointer :: avail_retransn_patch (:) ! N flux available from retranslocation pool (gN/m2/s) - real(r8), pointer :: plant_nalloc_patch (:) ! total allocated N flux (gN/m2/s) - real(r8), pointer :: plant_ndemand_retrans_patch (:) ! The N demand pool generated for FUN2.0; mainly used for deciduous trees (gN/m2/s) - real(r8), pointer :: plant_ndemand_season_patch (:) ! The N demand pool for seasonal deciduous (gN/m2/s) - real(r8), pointer :: plant_ndemand_stress_patch (:) ! The N demand pool for stress deciduous (gN/m2/s) - real(r8), pointer :: Nactive_patch (:) ! N acquired by mycorrhizal uptake (gN/m2/s) - real(r8), pointer :: Nnonmyc_patch (:) ! N acquired by non-myc uptake (gN/m2/s) - real(r8), pointer :: Nam_patch (:) ! N acquired by AM plant (gN/m2/s) - real(r8), pointer :: Necm_patch (:) ! N acquired by ECM plant (gN/m2/s) - real(r8), pointer :: Nactive_no3_patch (:) ! N acquired by mycorrhizal uptake (gN/m2/s) - real(r8), pointer :: Nactive_nh4_patch (:) ! N acquired by mycorrhizal uptake (gN/m2/s) - real(r8), pointer :: Nnonmyc_no3_patch (:) ! N acquired by non-myc (gN/m2/s) - real(r8), pointer :: Nnonmyc_nh4_patch (:) ! N acquired by non-myc (gN/m2/s) - real(r8), pointer :: Nam_no3_patch (:) ! N acquired by AM plant (gN/m2/s) - real(r8), pointer :: Nam_nh4_patch (:) ! N acquired by AM plant (gN/m2/s) - real(r8), pointer :: Necm_no3_patch (:) ! N acquired by ECM plant (gN/m2/s) - real(r8), pointer :: Necm_nh4_patch (:) ! N acquired by ECM plant (gN/m2/s) - real(r8), pointer :: Nfix_patch (:) ! N acquired by Symbiotic BNF (gN/m2/s) - real(r8), pointer :: Npassive_patch (:) ! N acquired by passive uptake (gN/m2/s) - real(r8), pointer :: Nretrans_patch (:) ! N acquired by retranslocation (gN/m2/s) - real(r8), pointer :: Nretrans_org_patch (:) ! N acquired by retranslocation (gN/m2/s) - real(r8), pointer :: Nretrans_season_patch (:) ! N acquired by retranslocation (gN/m2/s) - real(r8), pointer :: Nretrans_stress_patch (:) ! N acquired by retranslocation (gN/m2/s) - real(r8), pointer :: Nuptake_patch (:) ! Total N uptake of FUN (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_patch (:) ! Total soil N uptake of FUN (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_vr_patch (:,:) ! Total layer soil N uptake of FUN (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_no3_vr_patch (:,:) ! Total layer no3 uptake of FUN (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_nh4_vr_patch (:,:) ! Total layer nh4 uptake of FUN (gN/m2/s) - real(r8), pointer :: cost_nfix_patch (:) ! Average cost of fixation (gN/m2/s) - real(r8), pointer :: cost_nactive_patch (:) ! Average cost of active uptake (gN/m2/s) - real(r8), pointer :: cost_nretrans_patch (:) ! Average cost of retranslocation (gN/m2/s) - real(r8), pointer :: nuptake_npp_fraction_patch (:) ! frac of npp spent on N acquisition (gN/m2/s) - - contains - - procedure , public :: Init - procedure , public :: Restart - procedure , public :: SetValues - procedure , public :: ZeroDWT - procedure , public :: Summary => Summary_nitrogenflux - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - - end type cnveg_nitrogenflux_type - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(cnveg_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate (bounds) - call this%InitHistory (bounds) - call this%InitCold (bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize patch nitrogen flux - ! - ! !ARGUMENTS: - class (cnveg_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%m_leafn_to_litter_patch (begp:endp)) ; this%m_leafn_to_litter_patch (:) = nan - allocate(this%m_frootn_to_litter_patch (begp:endp)) ; this%m_frootn_to_litter_patch (:) = nan - allocate(this%m_leafn_storage_to_litter_patch (begp:endp)) ; this%m_leafn_storage_to_litter_patch (:) = nan - allocate(this%m_frootn_storage_to_litter_patch (begp:endp)) ; this%m_frootn_storage_to_litter_patch (:) = nan - allocate(this%m_livestemn_storage_to_litter_patch (begp:endp)) ; this%m_livestemn_storage_to_litter_patch (:) = nan - allocate(this%m_deadstemn_storage_to_litter_patch (begp:endp)) ; this%m_deadstemn_storage_to_litter_patch (:) = nan - allocate(this%m_livecrootn_storage_to_litter_patch (begp:endp)) ; this%m_livecrootn_storage_to_litter_patch (:) = nan - allocate(this%m_deadcrootn_storage_to_litter_patch (begp:endp)) ; this%m_deadcrootn_storage_to_litter_patch (:) = nan - allocate(this%m_leafn_xfer_to_litter_patch (begp:endp)) ; this%m_leafn_xfer_to_litter_patch (:) = nan - allocate(this%m_frootn_xfer_to_litter_patch (begp:endp)) ; this%m_frootn_xfer_to_litter_patch (:) = nan - allocate(this%m_livestemn_xfer_to_litter_patch (begp:endp)) ; this%m_livestemn_xfer_to_litter_patch (:) = nan - allocate(this%m_deadstemn_xfer_to_litter_patch (begp:endp)) ; this%m_deadstemn_xfer_to_litter_patch (:) = nan - allocate(this%m_livecrootn_xfer_to_litter_patch (begp:endp)) ; this%m_livecrootn_xfer_to_litter_patch (:) = nan - allocate(this%m_deadcrootn_xfer_to_litter_patch (begp:endp)) ; this%m_deadcrootn_xfer_to_litter_patch (:) = nan - allocate(this%m_livestemn_to_litter_patch (begp:endp)) ; this%m_livestemn_to_litter_patch (:) = nan - allocate(this%m_deadstemn_to_litter_patch (begp:endp)) ; this%m_deadstemn_to_litter_patch (:) = nan - allocate(this%m_livecrootn_to_litter_patch (begp:endp)) ; this%m_livecrootn_to_litter_patch (:) = nan - allocate(this%m_deadcrootn_to_litter_patch (begp:endp)) ; this%m_deadcrootn_to_litter_patch (:) = nan - allocate(this%m_retransn_to_litter_patch (begp:endp)) ; this%m_retransn_to_litter_patch (:) = nan - allocate(this%hrv_leafn_to_litter_patch (begp:endp)) ; this%hrv_leafn_to_litter_patch (:) = nan - allocate(this%hrv_frootn_to_litter_patch (begp:endp)) ; this%hrv_frootn_to_litter_patch (:) = nan - allocate(this%hrv_leafn_storage_to_litter_patch (begp:endp)) ; this%hrv_leafn_storage_to_litter_patch (:) = nan - allocate(this%hrv_frootn_storage_to_litter_patch (begp:endp)) ; this%hrv_frootn_storage_to_litter_patch (:) = nan - allocate(this%hrv_livestemn_storage_to_litter_patch (begp:endp)) ; this%hrv_livestemn_storage_to_litter_patch (:) = nan - allocate(this%hrv_deadstemn_storage_to_litter_patch (begp:endp)) ; this%hrv_deadstemn_storage_to_litter_patch (:) = nan - allocate(this%hrv_livecrootn_storage_to_litter_patch (begp:endp)) ; this%hrv_livecrootn_storage_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootn_storage_to_litter_patch (begp:endp)) ; this%hrv_deadcrootn_storage_to_litter_patch (:) = nan - allocate(this%hrv_leafn_xfer_to_litter_patch (begp:endp)) ; this%hrv_leafn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_frootn_xfer_to_litter_patch (begp:endp)) ; this%hrv_frootn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_livestemn_xfer_to_litter_patch (begp:endp)) ; this%hrv_livestemn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_deadstemn_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadstemn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_livecrootn_xfer_to_litter_patch (begp:endp)) ; this%hrv_livecrootn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootn_xfer_to_litter_patch (begp:endp)) ; this%hrv_deadcrootn_xfer_to_litter_patch (:) = nan - allocate(this%hrv_livestemn_to_litter_patch (begp:endp)) ; this%hrv_livestemn_to_litter_patch (:) = nan - allocate(this%hrv_livecrootn_to_litter_patch (begp:endp)) ; this%hrv_livecrootn_to_litter_patch (:) = nan - allocate(this%hrv_deadcrootn_to_litter_patch (begp:endp)) ; this%hrv_deadcrootn_to_litter_patch (:) = nan - allocate(this%hrv_retransn_to_litter_patch (begp:endp)) ; this%hrv_retransn_to_litter_patch (:) = nan - - allocate(this%m_leafn_to_fire_patch (begp:endp)) ; this%m_leafn_to_fire_patch (:) = nan - allocate(this%m_leafn_storage_to_fire_patch (begp:endp)) ; this%m_leafn_storage_to_fire_patch (:) = nan - allocate(this%m_leafn_xfer_to_fire_patch (begp:endp)) ; this%m_leafn_xfer_to_fire_patch (:) = nan - allocate(this%m_livestemn_to_fire_patch (begp:endp)) ; this%m_livestemn_to_fire_patch (:) = nan - allocate(this%m_livestemn_storage_to_fire_patch (begp:endp)) ; this%m_livestemn_storage_to_fire_patch (:) = nan - allocate(this%m_livestemn_xfer_to_fire_patch (begp:endp)) ; this%m_livestemn_xfer_to_fire_patch (:) = nan - allocate(this%m_deadstemn_to_fire_patch (begp:endp)) ; this%m_deadstemn_to_fire_patch (:) = nan - allocate(this%m_deadstemn_storage_to_fire_patch (begp:endp)) ; this%m_deadstemn_storage_to_fire_patch (:) = nan - allocate(this%m_deadstemn_xfer_to_fire_patch (begp:endp)) ; this%m_deadstemn_xfer_to_fire_patch (:) = nan - allocate(this%m_frootn_to_fire_patch (begp:endp)) ; this%m_frootn_to_fire_patch (:) = nan - allocate(this%m_frootn_storage_to_fire_patch (begp:endp)) ; this%m_frootn_storage_to_fire_patch (:) = nan - allocate(this%m_frootn_xfer_to_fire_patch (begp:endp)) ; this%m_frootn_xfer_to_fire_patch (:) = nan - allocate(this%m_livecrootn_to_fire_patch (begp:endp)) ; - allocate(this%m_livecrootn_storage_to_fire_patch (begp:endp)) ; this%m_livecrootn_storage_to_fire_patch (:) = nan - allocate(this%m_livecrootn_xfer_to_fire_patch (begp:endp)) ; this%m_livecrootn_xfer_to_fire_patch (:) = nan - allocate(this%m_deadcrootn_to_fire_patch (begp:endp)) ; this%m_deadcrootn_to_fire_patch (:) = nan - allocate(this%m_deadcrootn_storage_to_fire_patch (begp:endp)) ; this%m_deadcrootn_storage_to_fire_patch (:) = nan - allocate(this%m_deadcrootn_xfer_to_fire_patch (begp:endp)) ; this%m_deadcrootn_xfer_to_fire_patch (:) = nan - allocate(this%m_retransn_to_fire_patch (begp:endp)) ; this%m_retransn_to_fire_patch (:) = nan - - allocate(this%m_leafn_to_litter_fire_patch (begp:endp)) ; this%m_leafn_to_litter_fire_patch (:) = nan - allocate(this%m_leafn_storage_to_litter_fire_patch (begp:endp)) ; this%m_leafn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_leafn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_leafn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livestemn_to_litter_fire_patch (begp:endp)) ; this%m_livestemn_to_litter_fire_patch (:) = nan - allocate(this%m_livestemn_storage_to_litter_fire_patch (begp:endp)) ; this%m_livestemn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_livestemn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_livestemn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livestemn_to_deadstemn_fire_patch (begp:endp)) ; this%m_livestemn_to_deadstemn_fire_patch (:) = nan - allocate(this%m_deadstemn_to_litter_fire_patch (begp:endp)) ; this%m_deadstemn_to_litter_fire_patch (:) = nan - allocate(this%m_deadstemn_storage_to_litter_fire_patch (begp:endp)) ; this%m_deadstemn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_deadstemn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_deadstemn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_frootn_to_litter_fire_patch (begp:endp)) ; this%m_frootn_to_litter_fire_patch (:) = nan - allocate(this%m_frootn_storage_to_litter_fire_patch (begp:endp)) ; this%m_frootn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_frootn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_frootn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootn_to_litter_fire_patch (begp:endp)) ; this%m_livecrootn_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootn_storage_to_litter_fire_patch (begp:endp)) ; this%m_livecrootn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_livecrootn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_livecrootn_to_deadcrootn_fire_patch (begp:endp)) ; this%m_livecrootn_to_deadcrootn_fire_patch (:) = nan - allocate(this%m_deadcrootn_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootn_to_litter_fire_patch (:) = nan - allocate(this%m_deadcrootn_storage_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootn_storage_to_litter_fire_patch (:) = nan - allocate(this%m_deadcrootn_xfer_to_litter_fire_patch (begp:endp)) ; this%m_deadcrootn_xfer_to_litter_fire_patch (:) = nan - allocate(this%m_retransn_to_litter_fire_patch (begp:endp)) ; this%m_retransn_to_litter_fire_patch (:) = nan - - allocate(this%leafn_xfer_to_leafn_patch (begp:endp)) ; this%leafn_xfer_to_leafn_patch (:) = nan - allocate(this%frootn_xfer_to_frootn_patch (begp:endp)) ; this%frootn_xfer_to_frootn_patch (:) = nan - allocate(this%livestemn_xfer_to_livestemn_patch (begp:endp)) ; this%livestemn_xfer_to_livestemn_patch (:) = nan - allocate(this%deadstemn_xfer_to_deadstemn_patch (begp:endp)) ; this%deadstemn_xfer_to_deadstemn_patch (:) = nan - allocate(this%livecrootn_xfer_to_livecrootn_patch (begp:endp)) ; this%livecrootn_xfer_to_livecrootn_patch (:) = nan - allocate(this%deadcrootn_xfer_to_deadcrootn_patch (begp:endp)) ; this%deadcrootn_xfer_to_deadcrootn_patch (:) = nan - allocate(this%leafn_to_litter_patch (begp:endp)) ; this%leafn_to_litter_patch (:) = nan - allocate(this%leafn_to_retransn_patch (begp:endp)) ; this%leafn_to_retransn_patch (:) = nan - allocate(this%frootn_to_retransn_patch (begp:endp)) ; this%frootn_to_retransn_patch (:) = nan - allocate(this%frootn_to_litter_patch (begp:endp)) ; this%frootn_to_litter_patch (:) = nan - allocate(this%retransn_to_npool_patch (begp:endp)) ; this%retransn_to_npool_patch (:) = nan - allocate(this%free_retransn_to_npool_patch (begp:endp)) ; this%free_retransn_to_npool_patch (:) = nan - allocate(this%sminn_to_npool_patch (begp:endp)) ; this%sminn_to_npool_patch (:) = nan - - allocate(this%npool_to_leafn_patch (begp:endp)) ; this%npool_to_leafn_patch (:) = nan - allocate(this%npool_to_leafn_storage_patch (begp:endp)) ; this%npool_to_leafn_storage_patch (:) = nan - allocate(this%npool_to_frootn_patch (begp:endp)) ; this%npool_to_frootn_patch (:) = nan - allocate(this%npool_to_frootn_storage_patch (begp:endp)) ; this%npool_to_frootn_storage_patch (:) = nan - allocate(this%npool_to_livestemn_patch (begp:endp)) ; this%npool_to_livestemn_patch (:) = nan - allocate(this%npool_to_livestemn_storage_patch (begp:endp)) ; this%npool_to_livestemn_storage_patch (:) = nan - allocate(this%npool_to_deadstemn_patch (begp:endp)) ; this%npool_to_deadstemn_patch (:) = nan - allocate(this%npool_to_deadstemn_storage_patch (begp:endp)) ; this%npool_to_deadstemn_storage_patch (:) = nan - allocate(this%npool_to_livecrootn_patch (begp:endp)) ; this%npool_to_livecrootn_patch (:) = nan - allocate(this%npool_to_livecrootn_storage_patch (begp:endp)) ; this%npool_to_livecrootn_storage_patch (:) = nan - allocate(this%npool_to_deadcrootn_patch (begp:endp)) ; this%npool_to_deadcrootn_patch (:) = nan - allocate(this%npool_to_deadcrootn_storage_patch (begp:endp)) ; this%npool_to_deadcrootn_storage_patch (:) = nan - allocate(this%leafn_storage_to_xfer_patch (begp:endp)) ; this%leafn_storage_to_xfer_patch (:) = nan - allocate(this%frootn_storage_to_xfer_patch (begp:endp)) ; this%frootn_storage_to_xfer_patch (:) = nan - allocate(this%livestemn_storage_to_xfer_patch (begp:endp)) ; this%livestemn_storage_to_xfer_patch (:) = nan - allocate(this%deadstemn_storage_to_xfer_patch (begp:endp)) ; this%deadstemn_storage_to_xfer_patch (:) = nan - allocate(this%livecrootn_storage_to_xfer_patch (begp:endp)) ; this%livecrootn_storage_to_xfer_patch (:) = nan - allocate(this%deadcrootn_storage_to_xfer_patch (begp:endp)) ; this%deadcrootn_storage_to_xfer_patch (:) = nan - allocate(this%livestemn_to_deadstemn_patch (begp:endp)) ; this%livestemn_to_deadstemn_patch (:) = nan - allocate(this%livestemn_to_retransn_patch (begp:endp)) ; this%livestemn_to_retransn_patch (:) = nan - allocate(this%livecrootn_to_deadcrootn_patch (begp:endp)) ; this%livecrootn_to_deadcrootn_patch (:) = nan - allocate(this%livecrootn_to_retransn_patch (begp:endp)) ; this%livecrootn_to_retransn_patch (:) = nan - allocate(this%ndeploy_patch (begp:endp)) ; this%ndeploy_patch (:) = nan - allocate(this%wood_harvestn_patch (begp:endp)) ; this%wood_harvestn_patch (:) = nan - allocate(this%fire_nloss_patch (begp:endp)) ; this%fire_nloss_patch (:) = nan - allocate(this%npool_to_grainn_patch (begp:endp)) ; this%npool_to_grainn_patch (:) = nan - allocate(this%npool_to_grainn_storage_patch (begp:endp)) ; this%npool_to_grainn_storage_patch (:) = nan - allocate(this%livestemn_to_litter_patch (begp:endp)) ; this%livestemn_to_litter_patch (:) = nan - allocate(this%grainn_to_food_patch (begp:endp)) ; this%grainn_to_food_patch (:) = nan - allocate(this%grainn_to_seed_patch (begp:endp)) ; this%grainn_to_seed_patch (:) = nan - allocate(this%grainn_xfer_to_grainn_patch (begp:endp)) ; this%grainn_xfer_to_grainn_patch (:) = nan - allocate(this%grainn_storage_to_xfer_patch (begp:endp)) ; this%grainn_storage_to_xfer_patch (:) = nan - allocate(this%fert_patch (begp:endp)) ; this%fert_patch (:) = nan - allocate(this%fert_counter_patch (begp:endp)) ; this%fert_counter_patch (:) = nan - allocate(this%soyfixn_patch (begp:endp)) ; this%soyfixn_patch (:) = nan - - allocate(this%grainn_to_cropprodn_patch (begp:endp)) ; this%grainn_to_cropprodn_patch (:) = nan - allocate(this%grainn_to_cropprodn_col (begc:endc)) ; this%grainn_to_cropprodn_col (:) = nan - - allocate(this%fire_nloss_col (begc:endc)) ; this%fire_nloss_col (:) = nan - allocate(this%fire_nloss_p2c_col (begc:endc)) ; this%fire_nloss_p2c_col (:) = nan - - allocate(this%m_n_to_litr_met_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_met_fire_col (:,:) = nan - allocate(this%m_n_to_litr_cel_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_cel_fire_col (:,:) = nan - allocate(this%m_n_to_litr_lig_fire_col (begc:endc,1:nlevdecomp_full)) ; this%m_n_to_litr_lig_fire_col (:,:) = nan - - allocate(this%dwt_seedn_to_leaf_patch (begp:endp)) ; this%dwt_seedn_to_leaf_patch (:) = nan - allocate(this%dwt_seedn_to_leaf_grc (begg:endg)) ; this%dwt_seedn_to_leaf_grc (:) = nan - allocate(this%dwt_seedn_to_deadstem_patch (begp:endp)) ; this%dwt_seedn_to_deadstem_patch (:) = nan - allocate(this%dwt_seedn_to_deadstem_grc (begg:endg)) ; this%dwt_seedn_to_deadstem_grc (:) = nan - allocate(this%dwt_conv_nflux_patch (begp:endp)) ; this%dwt_conv_nflux_patch (:) = nan - allocate(this%dwt_conv_nflux_grc (begg:endg)) ; this%dwt_conv_nflux_grc (:) = nan - allocate(this%dwt_wood_productn_gain_patch (begp:endp)) ; this%dwt_wood_productn_gain_patch (:) = nan - allocate(this%dwt_crop_productn_gain_patch (begp:endp)) ; this%dwt_crop_productn_gain_patch (:) = nan - allocate(this%wood_harvestn_col (begc:endc)) ; this%wood_harvestn_col (:) = nan - - allocate(this%dwt_frootn_to_litr_met_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_met_n_col (:,:) = nan - allocate(this%dwt_frootn_to_litr_cel_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_cel_n_col (:,:) = nan - allocate(this%dwt_frootn_to_litr_lig_n_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_frootn_to_litr_lig_n_col (:,:) = nan - allocate(this%dwt_livecrootn_to_cwdn_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_livecrootn_to_cwdn_col (:,:) = nan - allocate(this%dwt_deadcrootn_to_cwdn_col (begc:endc,1:nlevdecomp_full)) ; this%dwt_deadcrootn_to_cwdn_col (:,:) = nan - - allocate(this%crop_seedn_to_leaf_patch (begp:endp)) ; this%crop_seedn_to_leaf_patch (:) = nan - - allocate(this%m_decomp_npools_to_fire_vr_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - allocate(this%m_decomp_npools_to_fire_col (begc:endc,1:ndecomp_pools )) - - this%m_decomp_npools_to_fire_vr_col (:,:,:) = nan - this%m_decomp_npools_to_fire_col (:,:) = nan - - allocate(this%phenology_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%phenology_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%phenology_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%gap_mortality_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%gap_mortality_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%gap_mortality_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%gap_mortality_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%fire_mortality_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%harvest_n_to_litr_met_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%harvest_n_to_litr_cel_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%harvest_n_to_litr_lig_n_col (begc:endc, 1:nlevdecomp_full)) - allocate(this%harvest_n_to_cwdn_col (begc:endc, 1:nlevdecomp_full)) - - this%phenology_n_to_litr_met_n_col (:,:) = nan - this%phenology_n_to_litr_cel_n_col (:,:) = nan - this%phenology_n_to_litr_lig_n_col (:,:) = nan - this%gap_mortality_n_to_litr_met_n_col (:,:) = nan - this%gap_mortality_n_to_litr_cel_n_col (:,:) = nan - this%gap_mortality_n_to_litr_lig_n_col (:,:) = nan - this%gap_mortality_n_to_cwdn_col (:,:) = nan - this%fire_mortality_n_to_cwdn_col (:,:) = nan - this%harvest_n_to_litr_met_n_col (:,:) = nan - this%harvest_n_to_litr_cel_n_col (:,:) = nan - this%harvest_n_to_litr_lig_n_col (:,:) = nan - this%harvest_n_to_cwdn_col (:,:) = nan - - allocate(this%plant_ndemand_patch (begp:endp)) ; this%plant_ndemand_patch (:) = nan - allocate(this%avail_retransn_patch (begp:endp)) ; this%avail_retransn_patch (:) = nan - allocate(this%plant_nalloc_patch (begp:endp)) ; this%plant_nalloc_patch (:) = nan - - allocate(this%plant_ndemand_retrans_patch (begp:endp)) ; this%plant_ndemand_retrans_patch (:) = nan - allocate(this%plant_ndemand_season_patch (begp:endp)) ; this%plant_ndemand_season_patch (:) = nan - allocate(this%plant_ndemand_stress_patch (begp:endp)) ; this%plant_ndemand_stress_patch (:) = nan - allocate(this%Nactive_patch (begp:endp)) ; this%Nactive_patch (:) = nan - allocate(this%Nnonmyc_patch (begp:endp)) ; this%Nnonmyc_patch (:) = nan - allocate(this%Nam_patch (begp:endp)) ; this%Nam_patch (:) = nan - allocate(this%Necm_patch (begp:endp)) ; this%Necm_patch (:) = nan - allocate(this%Nactive_no3_patch (begp:endp)) ; this%Nactive_no3_patch (:) = nan - allocate(this%Nactive_nh4_patch (begp:endp)) ; this%Nactive_nh4_patch (:) = nan - allocate(this%Nnonmyc_no3_patch (begp:endp)) ; this%Nnonmyc_no3_patch (:) = nan - allocate(this%Nnonmyc_nh4_patch (begp:endp)) ; this%Nnonmyc_nh4_patch (:) = nan - allocate(this%Nam_no3_patch (begp:endp)) ; this%Nam_no3_patch (:) = nan - allocate(this%Nam_nh4_patch (begp:endp)) ; this%Nam_nh4_patch (:) = nan - allocate(this%Necm_no3_patch (begp:endp)) ; this%Necm_no3_patch (:) = nan - allocate(this%Necm_nh4_patch (begp:endp)) ; this%Necm_nh4_patch (:) = nan - allocate(this%Npassive_patch (begp:endp)) ; this%Npassive_patch (:) = nan - allocate(this%Nfix_patch (begp:endp)) ; this%Nfix_patch (:) = nan - allocate(this%Nretrans_patch (begp:endp)) ; this%Nretrans_patch (:) = nan - allocate(this%Nretrans_org_patch (begp:endp)) ; this%Nretrans_org_patch (:) = nan - allocate(this%Nretrans_season_patch (begp:endp)) ; this%Nretrans_season_patch (:) = nan - allocate(this%Nretrans_stress_patch (begp:endp)) ; this%Nretrans_stress_patch (:) = nan - allocate(this%Nuptake_patch (begp:endp)) ; this%Nuptake_patch (:) = nan - allocate(this%sminn_to_plant_fun_patch (begp:endp)) ; this%sminn_to_plant_fun_patch (:) = nan - allocate(this%sminn_to_plant_fun_vr_patch (begp:endp,1:nlevdecomp_full)) - this%sminn_to_plant_fun_vr_patch (:,:) = nan - allocate(this%sminn_to_plant_fun_no3_vr_patch (begp:endp,1:nlevdecomp_full)) - this%sminn_to_plant_fun_no3_vr_patch (:,:) = nan - allocate(this%sminn_to_plant_fun_nh4_vr_patch (begp:endp,1:nlevdecomp_full)) - this%sminn_to_plant_fun_nh4_vr_patch (:,:) = nan - allocate(this%cost_nfix_patch (begp:endp)) ; this%cost_nfix_patch (:) = nan - allocate(this%cost_nactive_patch (begp:endp)) ; this%cost_nactive_patch (:) = nan - allocate(this%cost_nretrans_patch (begp:endp)) ; this%cost_nretrans_patch (:) = nan - allocate(this%nuptake_npp_fraction_patch (begp:endp)) ; this%nuptake_npp_fraction_patch (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevgrnd - use histFileMod , only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class(cnveg_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: k,l - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - character(10) :: active - character(24) :: fieldname - character(100) :: longname - character(8) :: vr_suffix - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - ! add suffix if number of soil decomposition depths is greater than 1 - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - this%m_leafn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N mortality', & - ptr_patch=this%m_leafn_to_litter_patch, default='inactive') - - this%m_frootn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N mortality', & - ptr_patch=this%m_frootn_to_litter_patch, default='inactive') - - this%m_leafn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N storage mortality', & - ptr_patch=this%m_leafn_storage_to_litter_patch, default='inactive') - - this%m_frootn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N storage mortality', & - ptr_patch=this%m_frootn_storage_to_litter_patch, default='inactive') - - this%m_livestemn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N storage mortality', & - ptr_patch=this%m_livestemn_storage_to_litter_patch, default='inactive') - - this%m_deadstemn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N storage mortality', & - ptr_patch=this%m_deadstemn_storage_to_litter_patch, default='inactive') - - this%m_livecrootn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N storage mortality', & - ptr_patch=this%m_livecrootn_storage_to_litter_patch, default='inactive') - - this%m_deadcrootn_storage_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N storage mortality', & - ptr_patch=this%m_deadcrootn_storage_to_litter_patch, default='inactive') - - this%m_leafn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N transfer mortality', & - ptr_patch=this%m_leafn_xfer_to_litter_patch, default='inactive') - - this%m_frootn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N transfer mortality', & - ptr_patch=this%m_frootn_xfer_to_litter_patch, default='inactive') - - this%m_livestemn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N transfer mortality', & - ptr_patch=this%m_livestemn_xfer_to_litter_patch, default='inactive') - - this%m_deadstemn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N transfer mortality', & - ptr_patch=this%m_deadstemn_xfer_to_litter_patch, default='inactive') - - this%m_livecrootn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N transfer mortality', & - ptr_patch=this%m_livecrootn_xfer_to_litter_patch, default='inactive') - - this%m_deadcrootn_xfer_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N transfer mortality', & - ptr_patch=this%m_deadcrootn_xfer_to_litter_patch, default='inactive') - - this%m_livestemn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N mortality', & - ptr_patch=this%m_livestemn_to_litter_patch, default='inactive') - - this%m_deadstemn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N mortality', & - ptr_patch=this%m_deadstemn_to_litter_patch, default='inactive') - - this%m_livecrootn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N mortality', & - ptr_patch=this%m_livecrootn_to_litter_patch, default='inactive') - - this%m_deadcrootn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N mortality', & - ptr_patch=this%m_deadcrootn_to_litter_patch, default='inactive') - - this%m_retransn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='M_RETRANSN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='retranslocated N pool mortality', & - ptr_patch=this%m_retransn_to_litter_patch, default='inactive') - - this%m_leafn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N fire loss', & - ptr_patch=this%m_leafn_to_fire_patch, default='inactive') - - this%m_frootn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N fire loss ', & - ptr_patch=this%m_frootn_to_fire_patch, default='inactive') - - this%m_leafn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N storage fire loss', & - ptr_patch=this%m_leafn_storage_to_fire_patch, default='inactive') - - this%m_frootn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N storage fire loss', & - ptr_patch=this%m_frootn_storage_to_fire_patch, default='inactive') - - this%m_livestemn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N storage fire loss', & - ptr_patch=this%m_livestemn_storage_to_fire_patch, default='inactive') - - this%m_deadstemn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N storage fire loss', & - ptr_patch=this%m_deadstemn_storage_to_fire_patch, default='inactive') - - this%m_livecrootn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N storage fire loss', & - ptr_patch=this%m_livecrootn_storage_to_fire_patch, default='inactive') - - this%m_deadcrootn_storage_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N storage fire loss', & - ptr_patch=this%m_deadcrootn_storage_to_fire_patch, default='inactive') - - this%m_leafn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LEAFN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N transfer fire loss', & - ptr_patch=this%m_leafn_xfer_to_fire_patch, default='inactive') - - this%m_frootn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_FROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N transfer fire loss', & - ptr_patch=this%m_frootn_xfer_to_fire_patch, default='inactive') - - this%m_livestemn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N transfer fire loss', & - ptr_patch=this%m_livestemn_xfer_to_fire_patch, default='inactive') - - this%m_deadstemn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N transfer fire loss', & - ptr_patch=this%m_deadstemn_xfer_to_fire_patch, default='inactive') - - this%m_livecrootn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N transfer fire loss', & - ptr_patch=this%m_livecrootn_xfer_to_fire_patch, default='inactive') - - this%m_deadcrootn_xfer_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N transfer fire loss', & - ptr_patch=this%m_deadcrootn_xfer_to_fire_patch, default='inactive') - - this%m_livestemn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVESTEMN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N fire loss', & - ptr_patch=this%m_livestemn_to_fire_patch, default='inactive') - - this%m_deadstemn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N fire loss', & - ptr_patch=this%m_deadstemn_to_fire_patch, default='inactive') - - this%m_deadstemn_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADSTEMN_TO_LITTER_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N fire mortality to litter', & - ptr_patch=this%m_deadstemn_to_litter_fire_patch, default='inactive') - - this%m_livecrootn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_LIVECROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N fire loss', & - ptr_patch=this%m_livecrootn_to_fire_patch, default='inactive') - - this%m_deadcrootn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N fire loss', & - ptr_patch=this%m_deadcrootn_to_fire_patch, default='inactive') - - this%m_deadcrootn_to_litter_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_DEADCROOTN_TO_LITTER_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N fire mortality to litter', & - ptr_patch=this%m_deadcrootn_to_litter_fire_patch, default='inactive') - - this%m_retransn_to_fire_patch(begp:endp) = spval - call hist_addfld1d (fname='M_RETRANSN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='retranslocated N pool fire loss', & - ptr_patch=this%m_retransn_to_fire_patch, default='inactive') - - this%leafn_xfer_to_leafn_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_XFER_TO_LEAFN', units='gN/m^2/s', & - avgflag='A', long_name='leaf N growth from storage', & - ptr_patch=this%leafn_xfer_to_leafn_patch, default='inactive') - - this%frootn_xfer_to_frootn_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN_XFER_TO_FROOTN', units='gN/m^2/s', & - avgflag='A', long_name='fine root N growth from storage', & - ptr_patch=this%frootn_xfer_to_frootn_patch, default='inactive') - - this%livestemn_xfer_to_livestemn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_XFER_TO_LIVESTEMN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N growth from storage', & - ptr_patch=this%livestemn_xfer_to_livestemn_patch, default='inactive') - - this%deadstemn_xfer_to_deadstemn_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMN_XFER_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N growth from storage', & - ptr_patch=this%deadstemn_xfer_to_deadstemn_patch, default='inactive') - - this%livecrootn_xfer_to_livecrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_XFER_TO_LIVECROOTN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N growth from storage', & - ptr_patch=this%livecrootn_xfer_to_livecrootn_patch, default='inactive') - - this%deadcrootn_xfer_to_deadcrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTN_XFER_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N growth from storage', & - ptr_patch=this%deadcrootn_xfer_to_deadcrootn_patch, default='inactive') - - this%leafn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N litterfall', & - ptr_patch=this%leafn_to_litter_patch) - - this%leafn_to_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='leaf N to retranslocated N pool', & - ptr_patch=this%leafn_to_retransn_patch, default='inactive') - - this%frootn_to_litter_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N litterfall', & - ptr_patch=this%frootn_to_litter_patch, default='inactive') - - this%retransn_to_npool_patch(begp:endp) = spval - call hist_addfld1d (fname='RETRANSN_TO_NPOOL', units='gN/m^2/s', & - avgflag='A', long_name='deployment of retranslocated N', & - ptr_patch=this%retransn_to_npool_patch) - - this%free_retransn_to_npool_patch(begp:endp) = spval - call hist_addfld1d (fname='FREE_RETRANSN_TO_NPOOL', units='gN/m^2/s', & - avgflag='A', long_name='deployment of retranslocated N', & - ptr_patch=this%free_retransn_to_npool_patch) - - this%sminn_to_npool_patch(begp:endp) = spval - call hist_addfld1d (fname='SMINN_TO_NPOOL', units='gN/m^2/s', & - avgflag='A', long_name='deployment of soil mineral N uptake', & - ptr_patch=this%sminn_to_npool_patch) - - this%npool_to_leafn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LEAFN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to leaf N', & - ptr_patch=this%npool_to_leafn_patch, default='inactive') - - this%npool_to_leafn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LEAFN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to leaf N storage', & - ptr_patch=this%npool_to_leafn_storage_patch, default='inactive') - - this%npool_to_frootn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_FROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to fine root N', & - ptr_patch=this%npool_to_frootn_patch, default='inactive') - - this%npool_to_frootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_FROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to fine root N storage', & - ptr_patch=this%npool_to_frootn_storage_patch, default='inactive') - - this%npool_to_livestemn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LIVESTEMN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live stem N', & - ptr_patch=this%npool_to_livestemn_patch, default='inactive') - - this%npool_to_livestemn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LIVESTEMN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live stem N storage', & - ptr_patch=this%npool_to_livestemn_storage_patch, default='inactive') - - this%npool_to_deadstemn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead stem N', & - ptr_patch=this%npool_to_deadstemn_patch, default='inactive') - - this%npool_to_deadstemn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_DEADSTEMN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead stem N storage', & - ptr_patch=this%npool_to_deadstemn_storage_patch, default='inactive') - - this%npool_to_livecrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LIVECROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live coarse root N', & - ptr_patch=this%npool_to_livecrootn_patch, default='inactive') - - this%npool_to_livecrootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_LIVECROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live coarse root N storage', & - ptr_patch=this%npool_to_livecrootn_storage_patch, default='inactive') - - this%npool_to_deadcrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root N', & - ptr_patch=this%npool_to_deadcrootn_patch, default='inactive') - - this%npool_to_deadcrootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL_TO_DEADCROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root N storage', & - ptr_patch=this%npool_to_deadcrootn_storage_patch, default='inactive') - - this%leafn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N shift storage to transfer', & - ptr_patch=this%leafn_storage_to_xfer_patch, default='inactive') - - this%frootn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N shift storage to transfer', & - ptr_patch=this%frootn_storage_to_xfer_patch, default='inactive') - - this%livestemn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N shift storage to transfer', & - ptr_patch=this%livestemn_storage_to_xfer_patch, default='inactive') - - this%deadstemn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N shift storage to transfer', & - ptr_patch=this%deadstemn_storage_to_xfer_patch, default='inactive') - - this%livecrootn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N shift storage to transfer', & - ptr_patch=this%livecrootn_storage_to_xfer_patch, default='inactive') - - this%deadcrootn_storage_to_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N shift storage to transfer', & - ptr_patch=this%deadcrootn_storage_to_xfer_patch, default='inactive') - - this%livestemn_to_deadstemn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N turnover', & - ptr_patch=this%livestemn_to_deadstemn_patch, default='inactive') - - this%livestemn_to_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N to retranslocated N pool', & - ptr_patch=this%livestemn_to_retransn_patch, default='inactive') - - this%livecrootn_to_deadcrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N turnover', & - ptr_patch=this%livecrootn_to_deadcrootn_patch, default='inactive') - - this%livecrootn_to_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N to retranslocated N pool', & - ptr_patch=this%livecrootn_to_retransn_patch, default='inactive') - - this%ndeploy_patch(begp:endp) = spval - call hist_addfld1d (fname='NDEPLOY', units='gN/m^2/s', & - avgflag='A', long_name='total N deployed in new growth', & - ptr_patch=this%ndeploy_patch) - - this%wood_harvestn_patch(begp:endp) = spval - call hist_addfld1d (fname='WOOD_HARVESTN', units='gN/m^2/s', & - avgflag='A', long_name='wood harvest N (to product pools)', & - ptr_patch=this%wood_harvestn_patch) - - this%fire_nloss_patch(begp:endp) = spval - call hist_addfld1d (fname='PFT_FIRE_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total patch-level fire N loss', & - ptr_patch=this%fire_nloss_patch) - - if (use_crop) then - this%fert_patch(begp:endp) = spval - call hist_addfld1d (fname='NFERTILIZATION', units='gN/m^2/s', & - avgflag='A', long_name='fertilizer added', & - ptr_patch=this%fert_patch) - end if - - if (use_crop .and. .not. use_fun) then - this%soyfixn_patch(begp:endp) = spval - call hist_addfld1d (fname='SOYFIXN', units='gN/m^2/s', & - avgflag='A', long_name='soybean fixation', & - ptr_patch=this%soyfixn_patch) - end if - - if (use_crop) then - this%fert_counter_patch(begp:endp) = spval - call hist_addfld1d (fname='FERT_COUNTER', units='seconds', & - avgflag='A', long_name='time left to fertilize', & - ptr_patch=this%fert_counter_patch, default='inactive') - end if - - !------------------------------- - ! N flux variables - native to column - !------------------------------- - - do k = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(k) .or. decomp_cascade_con%is_cwd(k) ) then - this%m_decomp_npools_to_fire_col(begc:endc,k) = spval - data1dptr => this%m_decomp_npools_to_fire_col(:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'N_TO_FIRE' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' N fire loss' - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - if ( nlevdecomp_full > 1 ) then - this%m_decomp_npools_to_fire_vr_col(begc:endc,:,k) = spval - data2dptr => this%m_decomp_npools_to_fire_vr_col(:,:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'N_TO_FIRE'//trim(vr_suffix) - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' N fire loss' - call hist_addfld_decomp (fname=fieldname, units='gN/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - endif - end do - - this%fire_nloss_col(begc:endc) = spval - call hist_addfld1d (fname='COL_FIRE_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total column-level fire N loss', & - ptr_col=this%fire_nloss_col) - - this%dwt_seedn_to_leaf_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_SEEDN_TO_LEAF', units='gN/m^2/s', & - avgflag='A', long_name='seed source to patch-level leaf', & - ptr_gcell=this%dwt_seedn_to_leaf_grc) - - this%dwt_seedn_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_SEEDN_TO_LEAF_PATCH', units='gN/m^2/s', & - avgflag='A', & - long_name='patch-level seed source to patch-level leaf ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedn_to_leaf_patch, default='inactive') - - this%dwt_seedn_to_deadstem_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_SEEDN_TO_DEADSTEM', units='gN/m^2/s', & - avgflag='A', long_name='seed source to patch-level deadstem', & - ptr_gcell=this%dwt_seedn_to_deadstem_grc) - - this%dwt_seedn_to_deadstem_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_SEEDN_TO_DEADSTEM_PATCH', units='gN/m^2/s', & - avgflag='A', & - long_name='patch-level seed source to patch-level deadstem ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_seedn_to_deadstem_patch, default='inactive') - - this%dwt_conv_nflux_grc(begg:endg) = spval - call hist_addfld1d (fname='DWT_CONV_NFLUX', units='gN/m^2/s', & - avgflag='A', & - long_name='conversion N flux (immediate loss to atm) (0 at all times except first timestep of year)', & - ptr_gcell=this%dwt_conv_nflux_grc) - - this%dwt_conv_nflux_patch(begp:endp) = spval - call hist_addfld1d (fname='DWT_CONV_NFLUX_PATCH', units='gN/m^2/s', & - avgflag='A', & - long_name='patch-level conversion N flux (immediate loss to atm) ' // & - '(0 at all times except first timestep of year) ' // & - '(per-area-gridcell; only makes sense with dov2xy=.false.)', & - ptr_patch=this%dwt_conv_nflux_patch, default='inactive') - - this%dwt_frootn_to_litr_met_n_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_MET_N', units='gN/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootn_to_litr_met_n_col, default='inactive') - - this%dwt_frootn_to_litr_cel_n_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_CEL_N', units='gN/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootn_to_litr_cel_n_col, default='inactive') - - this%dwt_frootn_to_litr_lig_n_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_FROOTN_TO_LITR_LIG_N', units='gN/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=this%dwt_frootn_to_litr_lig_n_col, default='inactive') - - this%dwt_livecrootn_to_cwdn_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_LIVECROOTN_TO_CWDN', units='gN/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='live coarse root to CWD due to landcover change', & - ptr_col=this%dwt_livecrootn_to_cwdn_col, default='inactive') - - this%dwt_deadcrootn_to_cwdn_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='DWT_DEADCROOTN_TO_CWDN', units='gN/m^2/s', type2d='levdcmp', & - avgflag='A', long_name='dead coarse root to CWD due to landcover change', & - ptr_col=this%dwt_deadcrootn_to_cwdn_col, default='inactive') - - this%crop_seedn_to_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='CROP_SEEDN_TO_LEAF', units='gN/m^2/s', & - avgflag='A', long_name='crop seed source to leaf', & - ptr_patch=this%crop_seedn_to_leaf_patch, default='inactive') - - this%plant_ndemand_patch(begp:endp) = spval - call hist_addfld1d (fname='PLANT_NDEMAND', units='gN/m^2/s', & - avgflag='A', long_name='N flux required to support initial GPP', & - ptr_patch=this%plant_ndemand_patch) - - this%avail_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='AVAIL_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='N flux available from retranslocation pool', & - ptr_patch=this%avail_retransn_patch, default='inactive') - - this%plant_nalloc_patch(begp:endp) = spval - call hist_addfld1d (fname='PLANT_NALLOC', units='gN/m^2/s', & - avgflag='A', long_name='total allocated N flux', & - ptr_patch=this%plant_nalloc_patch, default='inactive') - - if ( use_fun ) then - this%Nactive_patch(begp:endp) = spval - call hist_addfld1d (fname='NACTIVE', units='gN/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake flux', & - ptr_patch=this%Nactive_patch) - - this%Nnonmyc_patch(begp:endp) = spval - call hist_addfld1d (fname='NNONMYC', units='gN/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake flux', & - ptr_patch=this%Nnonmyc_patch) - - this%Nam_patch(begp:endp) = spval - call hist_addfld1d (fname='NAM', units='gN/m^2/s', & - avgflag='A', long_name='AM-associated N uptake flux', & - ptr_patch=this%Nam_patch) - - this%Necm_patch(begp:endp) = spval - call hist_addfld1d (fname='NECM', units='gN/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake flux', & - ptr_patch=this%Necm_patch) - - if (use_nitrif_denitrif) then - this%Nactive_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NACTIVE_NO3', units='gN/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake flux', & - ptr_patch=this%Nactive_no3_patch) - - this%Nactive_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NACTIVE_NH4', units='gN/m^2/s', & - avgflag='A', long_name='Mycorrhizal N uptake flux', & - ptr_patch=this%Nactive_nh4_patch) - - this%Nnonmyc_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NNONMYC_NO3', units='gN/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake flux', & - ptr_patch=this%Nnonmyc_no3_patch) - - this%Nnonmyc_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NNONMYC_NH4', units='gN/m^2/s', & - avgflag='A', long_name='Non-mycorrhizal N uptake flux', & - ptr_patch=this%Nnonmyc_nh4_patch) - - this%Nam_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NAM_NO3', units='gN/m^2/s', & - avgflag='A', long_name='AM-associated N uptake flux', & - ptr_patch=this%Nam_no3_patch) - - this%Nam_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NAM_NH4', units='gN/m^2/s', & - avgflag='A', long_name='AM-associated N uptake flux', & - ptr_patch=this%Nam_nh4_patch) - - this%Necm_no3_patch(begp:endp) = spval - call hist_addfld1d (fname='NECM_NO3', units='gN/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake flux', & - ptr_patch=this%Necm_no3_patch) - - this%Necm_nh4_patch(begp:endp) = spval - call hist_addfld1d (fname='NECM_NH4', units='gN/m^2/s', & - avgflag='A', long_name='ECM-associated N uptake flux', & - ptr_patch=this%Necm_nh4_patch) - end if - - this%Npassive_patch(begp:endp) = spval - call hist_addfld1d (fname='NPASSIVE', units='gN/m^2/s', & - avgflag='A', long_name='Passive N uptake flux', & - ptr_patch=this%Npassive_patch) - - this%Nfix_patch(begp:endp) = spval - call hist_addfld1d (fname='NFIX', units='gN/m^2/s', & - avgflag='A', long_name='Symbiotic BNF uptake flux', & - ptr_patch=this%Nfix_patch) - - this%Nretrans_patch(begp:endp) = spval - call hist_addfld1d (fname='NRETRANS', units='gN/m^2/s', & - avgflag='A', long_name='Retranslocated N uptake flux', & - ptr_patch=this%Nretrans_patch) - - this%Nretrans_org_patch(begp:endp) = spval - call hist_addfld1d (fname='NRETRANS_REG', units='gN/m^2/s', & - avgflag='A', long_name='Retranslocated N uptake flux', & - ptr_patch=this%Nretrans_org_patch) - - this%Nretrans_season_patch(begp:endp) = spval - call hist_addfld1d (fname='NRETRANS_SEASON', units='gN/m^2/s', & - avgflag='A', long_name='Retranslocated N uptake flux', & - ptr_patch=this%Nretrans_season_patch) - - this%Nretrans_stress_patch(begp:endp) = spval - call hist_addfld1d (fname='NRETRANS_STRESS', units='gN/m^2/s', & - avgflag='A', long_name='Retranslocated N uptake flux', & - ptr_patch=this%Nretrans_stress_patch) - - this%Nuptake_patch(begp:endp) = spval - call hist_addfld1d (fname='NUPTAKE', units='gN/m^2/s', & - avgflag='A', long_name='Total N uptake of FUN', & - ptr_patch=this%Nuptake_patch) - - this%sminn_to_plant_fun_patch(begp:endp) = spval - call hist_addfld1d (fname='SMINN_TO_PLANT_FUN', units='gN/m^2/s',& - avgflag='A', long_name='Total soil N uptake of FUN', & - ptr_patch=this%sminn_to_plant_fun_patch) - - this%cost_nfix_patch(begp:endp) = spval - call hist_addfld1d (fname='COST_NFIX', units='gN/gC', & - avgflag='A', long_name='Cost of fixation', & - ptr_patch=this%cost_nfix_patch) - - this%cost_nactive_patch(begp:endp) = spval - call hist_addfld1d (fname='COST_NACTIVE', units='gN/gC', & - avgflag='A', long_name='Cost of active uptake', & - ptr_patch=this%cost_nactive_patch) - - this%cost_nretrans_patch(begp:endp) = spval - call hist_addfld1d (fname='COST_NRETRANS', units='gN/gC', & - avgflag='A', long_name='Cost of retranslocation', & - ptr_patch=this%cost_nretrans_patch) - - this%nuptake_npp_fraction_patch(begp:endp) = spval - call hist_addfld1d (fname='NUPTAKE_NPP_FRACTION', units='-', & - avgflag='A', long_name='frac of NPP used in N uptake', & - ptr_patch=this%nuptake_npp_fraction_patch) - - - end if - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - ! !USES: - use landunit_varcon , only : istsoil, istcrop - ! - ! !ARGUMENTS: - class(cnveg_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,j - integer :: fp, fc ! filter indices - integer :: num_special_col ! number of good values in special_col filter - integer :: num_special_patch ! number of good values in special_patch filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - integer :: special_patch(bounds%endp-bounds%begp+1) ! special landunit filter - patches - !--------------------------------------------------------------------- - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - ! Set patch filters - - num_special_patch = 0 - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - if (lun%ifspecial(l)) then - num_special_patch = num_special_patch + 1 - special_patch(num_special_patch) = p - end if - end do - - !----------------------------------------------- - ! initialize nitrogen flux variables - !----------------------------------------------- - - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - - if ( use_crop )then - this%fert_counter_patch(p) = spval - this%fert_patch(p) = 0._r8 - this%soyfixn_patch(p) = 0._r8 - end if - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%fert_counter_patch(p) = 0._r8 - end if - if ( use_fun ) then !previously set to spval for special land units - if (lun%ifspecial(l)) then - this%plant_ndemand_patch(p) = 0._r8 - this%avail_retransn_patch(p) = 0._r8 - this%plant_nalloc_patch(p) = 0._r8 - this%Npassive_patch(p) = 0._r8 - this%Nactive_patch(p) = 0._r8 - this%Nnonmyc_patch(p) = 0._r8 - this%Nam_patch(p) = 0._r8 - this%Necm_patch(p) = 0._r8 - if (use_nitrif_denitrif) then - this%Nactive_no3_patch(p) = 0._r8 - this%Nactive_nh4_patch(p) = 0._r8 - this%Nnonmyc_no3_patch(p) = 0._r8 - this%Nnonmyc_nh4_patch(p) = 0._r8 - this%Nam_no3_patch(p) = 0._r8 - this%Nam_nh4_patch(p) = 0._r8 - this%Necm_no3_patch(p) = 0._r8 - this%Necm_nh4_patch(p) = 0._r8 - end if - this%Nfix_patch(p) = 0._r8 - this%Nretrans_patch(p) = 0._r8 - this%Nretrans_org_patch(p) = 0._r8 - this%Nretrans_season_patch(p) = 0._r8 - this%Nretrans_stress_patch(p) = 0._r8 - this%Nuptake_patch(p) = 0._r8 - this%sminn_to_plant_fun_patch(p) = 0._r8 - this%cost_nfix_patch = 0._r8 - this%cost_nactive_patch = 0._r8 - this%cost_nretrans_patch = 0._r8 - this%nuptake_npp_fraction_patch = 0._r8 - - do j = 1, nlevdecomp - this%sminn_to_plant_fun_vr_patch(p,j) = 0._r8 - this%sminn_to_plant_fun_no3_vr_patch(p,j) = 0._r8 - this%sminn_to_plant_fun_nh4_vr_patch(p,j) = 0._r8 - end do - end if - end if - end do - - ! initialize fields for special filters - - call this%SetValues (& - num_patch=num_special_patch, filter_patch=special_patch, value_patch=0._r8, & - num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart (this, bounds, ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon state - ! - ! !USES: - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class (cnveg_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='fert_counter', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fert_counter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fert', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fert_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='grainn_xfer_to_grainn', xtype=ncd_double, & - dim1name='pft', & - long_name='grain N growth from storage', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_xfer_to_grainn_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='livestemn_to_litter', xtype=ncd_double, & - dim1name='pft', & - long_name='livestem N to litter', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%livestemn_to_litter_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='grainn_to_food', xtype=ncd_double, & - dim1name='pft', & - long_name='grain N to food', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_to_food_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='npool_to_grainn', xtype=ncd_double, & - dim1name='pft', & - long_name='allocation to grain N', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%npool_to_grainn_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='npool_to_grainn_storage', xtype=ncd_double, & - dim1name='pft', & - long_name='allocation to grain N storage', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%npool_to_grainn_storage_patch) - end if - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='grainn_storage_to_xfer', xtype=ncd_double, & - dim1name='pft', & - long_name='grain N shift storage to transfer', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_storage_to_xfer_patch) - end if - - call restartvar(ncid=ncid, flag=flag, varname='plant_ndemand', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%plant_ndemand_patch) - - call restartvar(ncid=ncid, flag=flag, varname='avail_retransn', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%avail_retransn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='plant_nalloc', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%plant_nalloc_patch) - - if ( use_fun ) then -! set_missing_vals_to_constant for BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 -! special land units previously set to spval, not 0 -! modifications here should correct this - call restartvar(ncid=ncid, flag=flag, varname='Nactive', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nactive_patch) - call set_missing_vals_to_constant(this%Nactive_patch, 0._r8) -! - call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_patch) - call set_missing_vals_to_constant(this%Nnonmyc_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nam', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nam_patch) - call set_missing_vals_to_constant(this%Nam_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Necm', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Necm_patch) - call set_missing_vals_to_constant(this%Necm_patch, 0._r8) - - if (use_nitrif_denitrif) then - call restartvar(ncid=ncid, flag=flag, varname='Nactive_no3', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nactive_no3_patch) - call set_missing_vals_to_constant(this%Nactive_no3_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nactive_nh4', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nactive_nh4_patch) - call set_missing_vals_to_constant(this%Nactive_nh4_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc_no3', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_no3_patch) - call set_missing_vals_to_constant(this%Nnonmyc_no3_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nnonmyc_nh4', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nnonmyc_nh4_patch) - call set_missing_vals_to_constant(this%Nnonmyc_nh4_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nam_no3', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nam_no3_patch) - call set_missing_vals_to_constant(this%Nam_no3_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nam_nh4', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nam_nh4_patch) - call set_missing_vals_to_constant(this%Nam_nh4_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Necm_no3', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Necm_no3_patch) - call set_missing_vals_to_constant(this%Necm_no3_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Necm_nh4', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Necm_nh4_patch) - call set_missing_vals_to_constant(this%Necm_nh4_patch, 0._r8) - end if -! - call restartvar(ncid=ncid, flag=flag, varname='Npassive', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Npassive_patch) - call set_missing_vals_to_constant(this%Npassive_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nfix', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nfix_patch) - call set_missing_vals_to_constant(this%Nfix_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nretrans', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nretrans_patch) - call set_missing_vals_to_constant(this%Nretrans_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nretrans_org', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nretrans_org_patch) - call set_missing_vals_to_constant(this%Nretrans_org_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nretrans_season', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nretrans_season_patch) - call set_missing_vals_to_constant(this%Nretrans_season_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nretrans_stress', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nretrans_stress_patch) - call set_missing_vals_to_constant(this%Nretrans_stress_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='Nuptake', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%Nuptake_patch) - call set_missing_vals_to_constant(this%Nuptake_patch, 0._r8) - - call restartvar(ncid=ncid, flag=flag, varname='sminn_to_plant_fun', xtype=ncd_double, & - dim1name='pft', & - long_name='Total soil N uptake of FUN', units='gN/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%sminn_to_plant_fun_patch) - call set_missing_vals_to_constant(this%sminn_to_plant_fun_patch, 0._r8) - end if -! End BACKWARDS_COMPATIBILITY(wrw, 2018-06-28) re. issue #426 - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, & - num_patch, filter_patch, value_patch, & - num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set nitrogen flux variables - ! - ! !ARGUMENTS: - ! !ARGUMENTS: - class (cnveg_nitrogenflux_type) :: this - integer , intent(in) :: num_patch - integer , intent(in) :: filter_patch(:) - real(r8), intent(in) :: value_patch - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i,j,k,l ! loop index - !------------------------------------------------------------------------ - - do fi = 1,num_patch - i=filter_patch(fi) - - this%m_leafn_to_litter_patch(i) = value_patch - this%m_frootn_to_litter_patch(i) = value_patch - this%m_leafn_storage_to_litter_patch(i) = value_patch - this%m_frootn_storage_to_litter_patch(i) = value_patch - this%m_livestemn_storage_to_litter_patch(i) = value_patch - this%m_deadstemn_storage_to_litter_patch(i) = value_patch - this%m_livecrootn_storage_to_litter_patch(i) = value_patch - this%m_deadcrootn_storage_to_litter_patch(i) = value_patch - this%m_leafn_xfer_to_litter_patch(i) = value_patch - this%m_frootn_xfer_to_litter_patch(i) = value_patch - this%m_livestemn_xfer_to_litter_patch(i) = value_patch - this%m_deadstemn_xfer_to_litter_patch(i) = value_patch - this%m_livecrootn_xfer_to_litter_patch(i) = value_patch - this%m_deadcrootn_xfer_to_litter_patch(i) = value_patch - this%m_livestemn_to_litter_patch(i) = value_patch - this%m_deadstemn_to_litter_patch(i) = value_patch - this%m_livecrootn_to_litter_patch(i) = value_patch - this%m_deadcrootn_to_litter_patch(i) = value_patch - this%m_retransn_to_litter_patch(i) = value_patch - this%hrv_leafn_to_litter_patch(i) = value_patch - this%hrv_frootn_to_litter_patch(i) = value_patch - this%hrv_leafn_storage_to_litter_patch(i) = value_patch - this%hrv_frootn_storage_to_litter_patch(i) = value_patch - this%hrv_livestemn_storage_to_litter_patch(i) = value_patch - this%hrv_deadstemn_storage_to_litter_patch(i) = value_patch - this%hrv_livecrootn_storage_to_litter_patch(i) = value_patch - this%hrv_deadcrootn_storage_to_litter_patch(i) = value_patch - this%hrv_leafn_xfer_to_litter_patch(i) = value_patch - this%hrv_frootn_xfer_to_litter_patch(i) = value_patch - this%hrv_livestemn_xfer_to_litter_patch(i) = value_patch - this%hrv_deadstemn_xfer_to_litter_patch(i) = value_patch - this%hrv_livecrootn_xfer_to_litter_patch(i) = value_patch - this%hrv_deadcrootn_xfer_to_litter_patch(i) = value_patch - this%hrv_livestemn_to_litter_patch(i) = value_patch - this%hrv_livecrootn_to_litter_patch(i) = value_patch - this%hrv_deadcrootn_to_litter_patch(i) = value_patch - this%hrv_retransn_to_litter_patch(i) = value_patch - - this%m_leafn_to_fire_patch(i) = value_patch - this%m_leafn_storage_to_fire_patch(i) = value_patch - this%m_leafn_xfer_to_fire_patch(i) = value_patch - this%m_livestemn_to_fire_patch(i) = value_patch - this%m_livestemn_storage_to_fire_patch(i) = value_patch - this%m_livestemn_xfer_to_fire_patch(i) = value_patch - this%m_deadstemn_to_fire_patch(i) = value_patch - this%m_deadstemn_storage_to_fire_patch(i) = value_patch - this%m_deadstemn_xfer_to_fire_patch(i) = value_patch - this%m_frootn_to_fire_patch(i) = value_patch - this%m_frootn_storage_to_fire_patch(i) = value_patch - this%m_frootn_xfer_to_fire_patch(i) = value_patch - this%m_livecrootn_to_fire_patch(i) = value_patch - this%m_livecrootn_storage_to_fire_patch(i) = value_patch - this%m_livecrootn_xfer_to_fire_patch(i) = value_patch - this%m_deadcrootn_to_fire_patch(i) = value_patch - this%m_deadcrootn_storage_to_fire_patch(i) = value_patch - this%m_deadcrootn_xfer_to_fire_patch(i) = value_patch - this%m_retransn_to_fire_patch(i) = value_patch - - - this%m_leafn_to_litter_fire_patch(i) = value_patch - this%m_leafn_storage_to_litter_fire_patch(i) = value_patch - this%m_leafn_xfer_to_litter_fire_patch(i) = value_patch - this%m_livestemn_to_litter_fire_patch(i) = value_patch - this%m_livestemn_storage_to_litter_fire_patch(i) = value_patch - this%m_livestemn_xfer_to_litter_fire_patch(i) = value_patch - this%m_livestemn_to_deadstemn_fire_patch(i) = value_patch - this%m_deadstemn_to_litter_fire_patch(i) = value_patch - this%m_deadstemn_storage_to_litter_fire_patch(i) = value_patch - this%m_deadstemn_xfer_to_litter_fire_patch(i) = value_patch - this%m_frootn_to_litter_fire_patch(i) = value_patch - this%m_frootn_storage_to_litter_fire_patch(i) = value_patch - this%m_frootn_xfer_to_litter_fire_patch(i) = value_patch - this%m_livecrootn_to_litter_fire_patch(i) = value_patch - this%m_livecrootn_storage_to_litter_fire_patch(i) = value_patch - this%m_livecrootn_xfer_to_litter_fire_patch(i) = value_patch - this%m_livecrootn_to_deadcrootn_fire_patch(i) = value_patch - this%m_deadcrootn_to_litter_fire_patch(i) = value_patch - this%m_deadcrootn_storage_to_litter_fire_patch(i) = value_patch - this%m_deadcrootn_xfer_to_litter_fire_patch(i) = value_patch - this%m_retransn_to_litter_fire_patch(i) = value_patch - - this%leafn_xfer_to_leafn_patch(i) = value_patch - this%frootn_xfer_to_frootn_patch(i) = value_patch - this%livestemn_xfer_to_livestemn_patch(i) = value_patch - this%deadstemn_xfer_to_deadstemn_patch(i) = value_patch - this%livecrootn_xfer_to_livecrootn_patch(i) = value_patch - this%deadcrootn_xfer_to_deadcrootn_patch(i) = value_patch - this%leafn_to_litter_patch(i) = value_patch - this%leafn_to_retransn_patch(i) = value_patch - this%frootn_to_litter_patch(i) = value_patch - this%retransn_to_npool_patch(i) = value_patch - this%free_retransn_to_npool_patch(i) = value_patch - this%sminn_to_npool_patch(i) = value_patch - this%npool_to_leafn_patch(i) = value_patch - this%npool_to_leafn_storage_patch(i) = value_patch - this%npool_to_frootn_patch(i) = value_patch - this%npool_to_frootn_storage_patch(i) = value_patch - this%npool_to_livestemn_patch(i) = value_patch - this%npool_to_livestemn_storage_patch(i) = value_patch - this%npool_to_deadstemn_patch(i) = value_patch - this%npool_to_deadstemn_storage_patch(i) = value_patch - this%npool_to_livecrootn_patch(i) = value_patch - this%npool_to_livecrootn_storage_patch(i) = value_patch - this%npool_to_deadcrootn_patch(i) = value_patch - this%npool_to_deadcrootn_storage_patch(i) = value_patch - this%leafn_storage_to_xfer_patch(i) = value_patch - this%frootn_storage_to_xfer_patch(i) = value_patch - this%livestemn_storage_to_xfer_patch(i) = value_patch - this%deadstemn_storage_to_xfer_patch(i) = value_patch - this%livecrootn_storage_to_xfer_patch(i) = value_patch - this%deadcrootn_storage_to_xfer_patch(i) = value_patch - this%livestemn_to_deadstemn_patch(i) = value_patch - this%livestemn_to_retransn_patch(i) = value_patch - this%livecrootn_to_deadcrootn_patch(i) = value_patch - this%livecrootn_to_retransn_patch(i) = value_patch - this%ndeploy_patch(i) = value_patch - this%wood_harvestn_patch(i) = value_patch - this%fire_nloss_patch(i) = value_patch - - this%crop_seedn_to_leaf_patch(i) = value_patch - this%grainn_to_cropprodn_patch(i) = value_patch - end do - - if ( use_crop )then - do fi = 1,num_patch - i = filter_patch(fi) - this%livestemn_to_litter_patch(i) = value_patch - this%grainn_to_food_patch(i) = value_patch - this%grainn_to_seed_patch(i) = value_patch - this%grainn_xfer_to_grainn_patch(i) = value_patch - this%npool_to_grainn_patch(i) = value_patch - this%npool_to_grainn_storage_patch(i) = value_patch - this%grainn_storage_to_xfer_patch(i) = value_patch - this%soyfixn_patch(i) = value_patch - this%frootn_to_retransn_patch(i) = value_patch - end do - end if - - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - - ! phenology: litterfall and crop fluxes associated wit - this%phenology_n_to_litr_met_n_col(i,j) = value_column - this%phenology_n_to_litr_cel_n_col(i,j) = value_column - this%phenology_n_to_litr_lig_n_col(i,j) = value_column - - ! gap mortality - this%gap_mortality_n_to_litr_met_n_col(i,j) = value_column - this%gap_mortality_n_to_litr_cel_n_col(i,j) = value_column - this%gap_mortality_n_to_litr_lig_n_col(i,j) = value_column - this%gap_mortality_n_to_cwdn_col(i,j) = value_column - - ! fire - this%fire_mortality_n_to_cwdn_col(i,j) = value_column - this%m_n_to_litr_met_fire_col(i,j) = value_column - this%m_n_to_litr_cel_fire_col(i,j) = value_column - this%m_n_to_litr_lig_fire_col(i,j) = value_column - - ! harvest - this%harvest_n_to_litr_met_n_col(i,j) = value_column - this%harvest_n_to_litr_cel_n_col(i,j) = value_column - this%harvest_n_to_litr_lig_n_col(i,j) = value_column - this%harvest_n_to_cwdn_col(i,j) = value_column - end do - end do - - do fi = 1,num_column - i = filter_column(fi) - - this%grainn_to_cropprodn_col(i) = value_column - this%fire_nloss_col(i) = value_column - - ! Zero p2c column fluxes - this%fire_nloss_col(i) = value_column - this%wood_harvestn_col(i) = value_column - end do - - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%m_decomp_npools_to_fire_col(i,k) = value_column - end do - end do - - do k = 1, ndecomp_pools - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%m_decomp_npools_to_fire_vr_col(i,j,k) = value_column - end do - end do - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine ZeroDwt( this, bounds ) - ! - ! !DESCRIPTION - ! Initialize flux variables needed for dynamic land use. - ! - ! !ARGUMENTS: - class(cnveg_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c, g, j ! indices - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - this%dwt_seedn_to_leaf_grc(g) = 0._r8 - this%dwt_seedn_to_deadstem_grc(g) = 0._r8 - this%dwt_conv_nflux_grc(g) = 0._r8 - end do - - do j = 1, nlevdecomp_full - do c = bounds%begc,bounds%endc - this%dwt_frootn_to_litr_met_n_col(c,j) = 0._r8 - this%dwt_frootn_to_litr_cel_n_col(c,j) = 0._r8 - this%dwt_frootn_to_litr_lig_n_col(c,j) = 0._r8 - this%dwt_livecrootn_to_cwdn_col(c,j) = 0._r8 - this%dwt_deadcrootn_to_cwdn_col(c,j) = 0._r8 - end do - end do - - end subroutine ZeroDwt - - !----------------------------------------------------------------------- - subroutine Summary_nitrogenflux(this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp) - ! - ! !USES: - use clm_varpar , only: nlevdecomp,ndecomp_cascade_transitions,ndecomp_pools - use clm_varctl , only: use_nitrif_denitrif - use subgridAveMod , only: p2c - ! - ! !ARGUMENTS: - class (cnveg_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l ! indices - integer :: fp,fc ! lake filter indices - real(r8) :: maxdepth ! depth to integrate soil variables - !----------------------------------------------------------------------- - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! total N deployment (from sminn and retranslocated N pool) (NDEPLOY) - this%ndeploy_patch(p) = & - this%sminn_to_npool_patch(p) + & - this%retransn_to_npool_patch(p) + & - this%free_retransn_to_npool_patch(p) - - ! total patch-level fire N losses - this%fire_nloss_patch(p) = & - this%m_leafn_to_fire_patch(p) + & - this%m_leafn_storage_to_fire_patch(p) + & - this%m_leafn_xfer_to_fire_patch(p) + & - this%m_frootn_to_fire_patch(p) + & - this%m_frootn_storage_to_fire_patch(p) + & - this%m_frootn_xfer_to_fire_patch(p) + & - this%m_livestemn_to_fire_patch(p) + & - this%m_livestemn_storage_to_fire_patch(p) + & - this%m_livestemn_xfer_to_fire_patch(p) + & - this%m_deadstemn_to_fire_patch(p) + & - this%m_deadstemn_storage_to_fire_patch(p) + & - this%m_deadstemn_xfer_to_fire_patch(p) + & - this%m_livecrootn_to_fire_patch(p) + & - this%m_livecrootn_storage_to_fire_patch(p) + & - this%m_livecrootn_xfer_to_fire_patch(p) + & - this%m_deadcrootn_to_fire_patch(p) + & - this%m_deadcrootn_storage_to_fire_patch(p) + & - this%m_deadcrootn_xfer_to_fire_patch(p) + & - this%m_retransn_to_fire_patch(p) - - end do - - call p2c(bounds, num_soilc, filter_soilc, & - this%fire_nloss_patch(bounds%begp:bounds%endp), & - this%fire_nloss_p2c_col(bounds%begc:bounds%endc)) - - ! vertically integrate column-level fire N losses - do k = 1, ndecomp_pools - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%m_decomp_npools_to_fire_col(c,k) = & - this%m_decomp_npools_to_fire_col(c,k) + & - this%m_decomp_npools_to_fire_vr_col(c,j,k) * dzsoi_decomp(j) - end do - end do - end do - - ! total column-level fire N losses - do fc = 1,num_soilc - c = filter_soilc(fc) - this%fire_nloss_col(c) = this%fire_nloss_p2c_col(c) - end do - do k = 1, ndecomp_pools - do fc = 1,num_soilc - c = filter_soilc(fc) - this%fire_nloss_col(c) = & - this%fire_nloss_col(c) + & - this%m_decomp_npools_to_fire_col(c,k) - end do - end do - - end subroutine Summary_nitrogenflux - -end module CNVegNitrogenFluxType - diff --git a/src/biogeochem/CNVegNitrogenStateType.F90 b/src/biogeochem/CNVegNitrogenStateType.F90 deleted file mode 100644 index 97a5ffaae4..0000000000 --- a/src/biogeochem/CNVegNitrogenStateType.F90 +++ /dev/null @@ -1,1286 +0,0 @@ -module CNVegNitrogenStateType - -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan - use clm_varpar , only : nlevdecomp_full, nlevdecomp - use clm_varcon , only : spval, ispval, dzsoi_decomp, zisoi - use landunit_varcon , only : istcrop, istsoil - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_century_decomp - use clm_varctl , only : iulog, override_bgc_restart_mismatch_dump - use clm_varctl , only : use_crop - use CNSharedParamsMod , only : use_fun - use decompMod , only : bounds_type - use pftconMod , only : npcropmin, noveg, pftcon - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use abortutils , only : endrun - use spmdMod , only : masterproc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use dynPatchStateUpdaterMod, only : patch_state_updater_type - use CNSpeciesMod , only : CN_SPECIES_N - use CNVegComputeSeedMod, only : ComputeSeedAmounts - ! - ! !PUBLIC TYPES: - implicit none - - private - - - ! - type, public :: cnveg_nitrogenstate_type - - real(r8), pointer :: grainn_patch (:) ! (gN/m2) grain N (crop) - real(r8), pointer :: grainn_storage_patch (:) ! (gN/m2) grain N storage (crop) - real(r8), pointer :: grainn_xfer_patch (:) ! (gN/m2) grain N transfer (crop) - real(r8), pointer :: leafn_patch (:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage_patch (:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer_patch (:) ! (gN/m2) leaf N transfer - real(r8), pointer :: leafn_storage_xfer_acc_patch (:) ! (gN/m2) Accmulated leaf N transfer - real(r8), pointer :: storage_ndemand_patch (:) ! (gN/m2) N demand during the offset period - real(r8), pointer :: frootn_patch (:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage_patch (:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer_patch (:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_patch (:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage_patch (:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer_patch (:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_patch (:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage_patch (:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer_patch (:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_patch (:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage_patch (:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer_patch (:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_patch (:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage_patch (:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer_patch (:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: retransn_patch (:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: npool_patch (:) ! (gN/m2) temporary plant N pool - real(r8), pointer :: ntrunc_patch (:) ! (gN/m2) patch-level sink for N truncation - real(r8), pointer :: cropseedn_deficit_patch (:) ! (gN/m2) pool for seeding new crop growth; this is a NEGATIVE term, indicating the amount of seed usage that needs to be repaid - real(r8), pointer :: seedn_grc (:) ! (gN/m2) gridcell-level pool for seeding new pFTs via dynamic landcover - - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: dispvegn_patch (:) ! (gN/m2) displayed veg nitrogen, excluding storage - real(r8), pointer :: storvegn_patch (:) ! (gN/m2) stored vegetation nitrogen - real(r8), pointer :: totvegn_patch (:) ! (gN/m2) total vegetation nitrogen - real(r8), pointer :: totvegn_col (:) ! (gN/m2) total vegetation nitrogen (p2c) - real(r8), pointer :: totn_patch (:) ! (gN/m2) total patch-level nitrogen - real(r8), pointer :: totn_p2c_col (:) ! (gN/m2) totn_patch averaged to col - real(r8), pointer :: totn_col (:) ! (gN/m2) total column nitrogen, incl veg - real(r8), pointer :: totecosysn_col (:) ! (gN/m2) total ecosystem nitrogen, incl veg - - contains - - procedure , public :: Init - procedure , public :: Restart - procedure , public :: SetValues - procedure , public :: ZeroDWT - procedure , public :: Summary => Summary_nitrogenstate - procedure , public :: DynamicPatchAdjustments ! adjust state variables when patch areas change - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - - end type cnveg_nitrogenstate_type - !------------------------------------------------------------------------ - - ! !PRIVATE DATA: - character(len=*), parameter :: sourcefile = & - __FILE__ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, & - leafc_patch, leafc_storage_patch, frootc_patch, frootc_storage_patch, deadstemc_patch) - - class(cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: leafc_patch (bounds%begp:) - real(r8) , intent(in) :: leafc_storage_patch (bounds%begp:) - real(r8) , intent(in) :: frootc_patch (bounds%begp:) - real(r8) , intent(in) :: frootc_storage_patch (bounds%begp:) - real(r8) , intent(in) :: deadstemc_patch (bounds%begp:) - - call this%InitAllocate (bounds ) - call this%InitHistory (bounds) - call this%InitCold ( bounds, & - leafc_patch, leafc_storage_patch, frootc_patch, frootc_storage_patch, deadstemc_patch) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%grainn_patch (begp:endp)) ; this%grainn_patch (:) = nan - allocate(this%grainn_storage_patch (begp:endp)) ; this%grainn_storage_patch (:) = nan - allocate(this%grainn_xfer_patch (begp:endp)) ; this%grainn_xfer_patch (:) = nan - allocate(this%leafn_patch (begp:endp)) ; this%leafn_patch (:) = nan - allocate(this%leafn_storage_patch (begp:endp)) ; this%leafn_storage_patch (:) = nan - allocate(this%leafn_xfer_patch (begp:endp)) ; this%leafn_xfer_patch (:) = nan - allocate(this%leafn_storage_xfer_acc_patch (begp:endp)) ; this%leafn_storage_xfer_acc_patch (:) = nan - allocate(this%storage_ndemand_patch (begp:endp)) ; this%storage_ndemand_patch (:) = nan - allocate(this%frootn_patch (begp:endp)) ; this%frootn_patch (:) = nan - allocate(this%frootn_storage_patch (begp:endp)) ; this%frootn_storage_patch (:) = nan - allocate(this%frootn_xfer_patch (begp:endp)) ; this%frootn_xfer_patch (:) = nan - allocate(this%livestemn_patch (begp:endp)) ; this%livestemn_patch (:) = nan - allocate(this%livestemn_storage_patch (begp:endp)) ; this%livestemn_storage_patch (:) = nan - allocate(this%livestemn_xfer_patch (begp:endp)) ; this%livestemn_xfer_patch (:) = nan - allocate(this%deadstemn_patch (begp:endp)) ; this%deadstemn_patch (:) = nan - allocate(this%deadstemn_storage_patch (begp:endp)) ; this%deadstemn_storage_patch (:) = nan - allocate(this%deadstemn_xfer_patch (begp:endp)) ; this%deadstemn_xfer_patch (:) = nan - allocate(this%livecrootn_patch (begp:endp)) ; this%livecrootn_patch (:) = nan - allocate(this%livecrootn_storage_patch (begp:endp)) ; this%livecrootn_storage_patch (:) = nan - allocate(this%livecrootn_xfer_patch (begp:endp)) ; this%livecrootn_xfer_patch (:) = nan - allocate(this%deadcrootn_patch (begp:endp)) ; this%deadcrootn_patch (:) = nan - allocate(this%deadcrootn_storage_patch (begp:endp)) ; this%deadcrootn_storage_patch (:) = nan - allocate(this%deadcrootn_xfer_patch (begp:endp)) ; this%deadcrootn_xfer_patch (:) = nan - allocate(this%retransn_patch (begp:endp)) ; this%retransn_patch (:) = nan - allocate(this%npool_patch (begp:endp)) ; this%npool_patch (:) = nan - allocate(this%ntrunc_patch (begp:endp)) ; this%ntrunc_patch (:) = nan - allocate(this%dispvegn_patch (begp:endp)) ; this%dispvegn_patch (:) = nan - allocate(this%storvegn_patch (begp:endp)) ; this%storvegn_patch (:) = nan - allocate(this%totvegn_patch (begp:endp)) ; this%totvegn_patch (:) = nan - allocate(this%totn_patch (begp:endp)) ; this%totn_patch (:) = nan - - allocate(this%cropseedn_deficit_patch (begp:endp)) ; this%cropseedn_deficit_patch (:) = nan - allocate(this%seedn_grc (begg:endg)) ; this%seedn_grc (:) = nan - allocate(this%totvegn_col (begc:endc)) ; this%totvegn_col (:) = nan - allocate(this%totn_p2c_col (begc:endc)) ; this%totn_p2c_col (:) = nan - allocate(this%totn_col (begc:endc)) ; this%totn_col (:) = nan - allocate(this%totecosysn_col (begc:endc)) ; this%totecosysn_col (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! add history fields for all CN variables, always set as default='inactive' - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: k,l,ii,jj - integer :: begp,endp - integer :: begc,endc - integer :: begg,endg - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - !------------------------------- - ! patch state variables - !------------------------------- - - if (use_crop) then - this%grainn_patch(begp:endp) = spval - call hist_addfld1d (fname='GRAINN', units='gN/m^2', & - avgflag='A', long_name='grain N', & - ptr_patch=this%grainn_patch) - call hist_addfld1d (fname='CROPSEEDN_DEFICIT', units='gN/m^2', & - avgflag='A', long_name='N used for crop seed that needs to be repaid', & - ptr_patch=this%cropseedn_deficit_patch, default='inactive') - end if - - this%leafn_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN', units='gN/m^2', & - avgflag='A', long_name='leaf N', & - ptr_patch=this%leafn_patch) - - this%leafn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='leaf N storage', & - ptr_patch=this%leafn_storage_patch, default='inactive') - - this%leafn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_XFER', units='gN/m^2', & - avgflag='A', long_name='leaf N transfer', & - ptr_patch=this%leafn_xfer_patch, default='inactive') - - if ( use_fun ) then - this%leafn_storage_xfer_acc_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFN_STORAGE_XFER_ACC', units='gN/m^2', & - avgflag='A', long_name='Accmulated leaf N transfer', & - ptr_patch=this%leafn_storage_xfer_acc_patch, default='inactive') - - this%storage_ndemand_patch(begp:endp) = spval - call hist_addfld1d (fname='STORAGE_NDEMAND', units='gN/m^2', & - avgflag='A', long_name='N demand during the offset period', & - ptr_patch=this%storage_ndemand_patch, default='inactive') - end if - - this%frootn_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN', units='gN/m^2', & - avgflag='A', long_name='fine root N', & - ptr_patch=this%frootn_patch) - - this%frootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='fine root N storage', & - ptr_patch=this%frootn_storage_patch, default='inactive') - - this%frootn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='FROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='fine root N transfer', & - ptr_patch=this%frootn_xfer_patch, default='inactive') - - this%livestemn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN', units='gN/m^2', & - avgflag='A', long_name='live stem N', & - ptr_patch=this%livestemn_patch) - - this%livestemn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='live stem N storage', & - ptr_patch=this%livestemn_storage_patch, default='inactive') - - this%livestemn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVESTEMN_XFER', units='gN/m^2', & - avgflag='A', long_name='live stem N transfer', & - ptr_patch=this%livestemn_xfer_patch, default='inactive') - - this%deadstemn_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMN', units='gN/m^2', & - avgflag='A', long_name='dead stem N', & - ptr_patch=this%deadstemn_patch) - - this%deadstemn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='dead stem N storage', & - ptr_patch=this%deadstemn_storage_patch, default='inactive') - - this%deadstemn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADSTEMN_XFER', units='gN/m^2', & - avgflag='A', long_name='dead stem N transfer', & - ptr_patch=this%deadstemn_xfer_patch, default='inactive') - - this%livecrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN', units='gN/m^2', & - avgflag='A', long_name='live coarse root N', & - ptr_patch=this%livecrootn_patch) - - this%livecrootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='live coarse root N storage', & - ptr_patch=this%livecrootn_storage_patch, default='inactive') - - this%livecrootn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='LIVECROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='live coarse root N transfer', & - ptr_patch=this%livecrootn_xfer_patch, default='inactive') - - this%deadcrootn_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTN', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N', & - ptr_patch=this%deadcrootn_patch) - - this%deadcrootn_storage_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N storage', & - ptr_patch=this%deadcrootn_storage_patch, default='inactive') - - this%deadcrootn_xfer_patch(begp:endp) = spval - call hist_addfld1d (fname='DEADCROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N transfer', & - ptr_patch=this%deadcrootn_xfer_patch, default='inactive') - - this%retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='RETRANSN', units='gN/m^2', & - avgflag='A', long_name='plant pool of retranslocated N', & - ptr_patch=this%retransn_patch) - - this%npool_patch(begp:endp) = spval - call hist_addfld1d (fname='NPOOL', units='gN/m^2', & - avgflag='A', long_name='temporary plant N pool', & - ptr_patch=this%npool_patch) - - this%ntrunc_patch(begp:endp) = spval - call hist_addfld1d (fname='PFT_NTRUNC', units='gN/m^2', & - avgflag='A', long_name='patch-level sink for N truncation', & - ptr_patch=this%ntrunc_patch, default='inactive') - - this%dispvegn_patch(begp:endp) = spval - call hist_addfld1d (fname='DISPVEGN', units='gN/m^2', & - avgflag='A', long_name='displayed vegetation nitrogen', & - ptr_patch=this%dispvegn_patch) - - this%storvegn_patch(begp:endp) = spval - call hist_addfld1d (fname='STORVEGN', units='gN/m^2', & - avgflag='A', long_name='stored vegetation nitrogen', & - ptr_patch=this%storvegn_patch) - - this%totvegn_patch(begp:endp) = spval - call hist_addfld1d (fname='TOTVEGN', units='gN/m^2', & - avgflag='A', long_name='total vegetation nitrogen', & - ptr_patch=this%totvegn_patch) - - this%totn_patch(begp:endp) = spval - call hist_addfld1d (fname='TOTPFTN', units='gN/m^2', & - avgflag='A', long_name='total patch-level nitrogen', & - ptr_patch=this%totn_patch) - - !------------------------------- - ! column state variables - !------------------------------- - - this%seedn_grc(begg:endg) = spval - call hist_addfld1d (fname='SEEDN', units='gN/m^2', & - avgflag='A', long_name='pool for seeding new PFTs via dynamic landcover', & - ptr_gcell=this%seedn_grc) - - this%totecosysn_col(begc:endc) = spval - call hist_addfld1d (fname='TOTECOSYSN', units='gN/m^2', & - avgflag='A', long_name='total ecosystem N, excluding product pools', & - ptr_col=this%totecosysn_col) - - this%totn_col(begc:endc) = spval - call hist_addfld1d (fname='TOTCOLN', units='gN/m^2', & - avgflag='A', long_name='total column-level N, excluding product pools', & - ptr_col=this%totn_col) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, & - leafc_patch, leafc_storage_patch, frootc_patch, frootc_storage_patch, deadstemc_patch) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - use clm_varctl , only : MM_Nuptake_opt - ! !ARGUMENTS: - class(cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: leafc_patch(bounds%begp:) - real(r8) , intent(in) :: leafc_storage_patch(bounds%begp:) - real(r8) , intent(in) :: frootc_patch(bounds%begp:) - real(r8) , intent(in) :: frootc_storage_patch(bounds%begp:) - real(r8) , intent(in) :: deadstemc_patch(bounds%begp:) - ! - ! !LOCAL VARIABLES: - integer :: fc,fp,g,l,c,p,j,k ! indices - integer :: num_special_col ! number of good values in special_col filter - integer :: num_special_patch ! number of good values in special_patch filter - integer :: special_col (bounds%endc-bounds%begc+1) ! special landunit filter - columns - integer :: special_patch (bounds%endp-bounds%begp+1) ! special landunit filter - patches - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(leafc_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(leafc_storage_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frootc_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frootc_storage_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(deadstemc_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - ! Set column filters - - num_special_patch = 0 - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - if (lun%ifspecial(l)) then - num_special_patch = num_special_patch + 1 - special_patch(num_special_patch) = p - end if - end do - - ! Set patch filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - !------------------------------------------- - ! initialize patch-level variables - !------------------------------------------- - - do p = bounds%begp,bounds%endp - - l = patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - if (patch%itype(p) == noveg) then - this%leafn_patch(p) = 0._r8 - this%leafn_storage_patch(p) = 0._r8 - if (MM_Nuptake_opt .eqv. .true.) then - this%frootn_patch(p) = 0._r8 - this%frootn_storage_patch(p) = 0._r8 - end if - else - this%leafn_patch(p) = leafc_patch(p) / pftcon%leafcn(patch%itype(p)) - this%leafn_storage_patch(p) = leafc_storage_patch(p) / pftcon%leafcn(patch%itype(p)) - if (MM_Nuptake_opt .eqv. .true.) then - this%frootn_patch(p) = frootc_patch(p) / pftcon%frootcn(patch%itype(p)) - this%frootn_storage_patch(p) = frootc_storage_patch(p) / pftcon%frootcn(patch%itype(p)) - end if - end if - - this%leafn_xfer_patch(p) = 0._r8 - - this%leafn_storage_xfer_acc_patch(p) = 0._r8 - this%storage_ndemand_patch(p) = 0._r8 - - if ( use_crop )then - this%grainn_patch(p) = 0._r8 - this%grainn_storage_patch(p) = 0._r8 - this%grainn_xfer_patch(p) = 0._r8 - this%cropseedn_deficit_patch(p) = 0._r8 - end if - if (MM_Nuptake_opt .eqv. .false.) then ! if not running in floating CN ratio option - this%frootn_patch(p) = 0._r8 - this%frootn_storage_patch(p) = 0._r8 - end if - this%frootn_xfer_patch(p) = 0._r8 - this%livestemn_patch(p) = 0._r8 - this%livestemn_storage_patch(p) = 0._r8 - this%livestemn_xfer_patch(p) = 0._r8 - - ! tree types need to be initialized with some stem mass so that - ! roughness length is not zero in canopy flux calculation - - if (pftcon%woody(patch%itype(p)) == 1._r8) then - this%deadstemn_patch(p) = deadstemc_patch(p) / pftcon%deadwdcn(patch%itype(p)) - else - this%deadstemn_patch(p) = 0._r8 - end if - - this%deadstemn_storage_patch(p) = 0._r8 - this%deadstemn_xfer_patch(p) = 0._r8 - this%livecrootn_patch(p) = 0._r8 - this%livecrootn_storage_patch(p) = 0._r8 - this%livecrootn_xfer_patch(p) = 0._r8 - this%deadcrootn_patch(p) = 0._r8 - this%deadcrootn_storage_patch(p) = 0._r8 - this%deadcrootn_xfer_patch(p) = 0._r8 - this%retransn_patch(p) = 0._r8 - this%npool_patch(p) = 0._r8 - this%ntrunc_patch(p) = 0._r8 - this%dispvegn_patch(p) = 0._r8 - this%storvegn_patch(p) = 0._r8 - this%totvegn_patch(p) = 0._r8 - this%totn_patch(p) = 0._r8 - end if - end do - - !------------------------------------------- - ! initialize column-level variables - !------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - ! total nitrogen pools - this%totecosysn_col(c) = 0._r8 - this%totn_p2c_col(c) = 0._r8 - this%totn_col(c) = 0._r8 - end if - end do - - - do g = bounds%begg, bounds%endg - this%seedn_grc(g) = 0._r8 - end do - - ! now loop through special filters and explicitly set the variables that - ! have to be in place for biogeophysics - - ! initialize fields for special filters - - call this%SetValues (& - num_patch=num_special_patch, filter_patch=special_patch, value_patch=0._r8, & - num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart ( this, bounds, ncid, flag, leafc_patch, & - leafc_storage_patch, frootc_patch, frootc_storage_patch, & - deadstemc_patch, filter_reseed_patch, num_reseed_patch ) - ! - ! !DESCRIPTION: - ! Read/write restart data - ! - ! !USES: - use restUtilMod - use ncdio_pio - use clm_varctl , only : spinup_state, use_cndv - use clm_time_manager , only : get_nstep, is_restart - use clm_varctl , only : MM_Nuptake_opt - - ! - ! !ARGUMENTS: - class (cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid - character(len=*) , intent(in) :: flag !'read' or 'write' or 'define' - real(r8) , intent(in) :: leafc_patch(bounds%begp:) - real(r8) , intent(in) :: leafc_storage_patch(bounds%begp:) - real(r8) , intent(in) :: frootc_patch(bounds%begp:) - real(r8) , intent(in) :: frootc_storage_patch(bounds%begp:) - real(r8) , intent(in) :: deadstemc_patch(bounds%begp:) - integer , intent(in) :: filter_reseed_patch(:) - integer , intent(in) :: num_reseed_patch - ! - ! !LOCAL VARIABLES: - integer :: i, p, l - logical :: readvar - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - character(len=128) :: varname ! temporary - logical :: exit_spinup = .false. - logical :: enter_spinup = .false. - integer :: idata - - ! spinup state as read from restart file, for determining whether to enter or exit spinup mode. - integer :: restart_file_spinup_state - - !------------------------------------------------------------------------ - - !-------------------------------- - ! patch nitrogen state variables - !-------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='leafn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafn_xfer_patch) - - if ( use_fun ) then - call restartvar(ncid=ncid, flag=flag, varname='leafn_storage_xfer_acc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafn_storage_xfer_acc_patch) - - call restartvar(ncid=ncid, flag=flag, varname='storage_ndemand', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%storage_ndemand_patch) - end if - - - call restartvar(ncid=ncid, flag=flag, varname='frootn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='frootn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='frootn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frootn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livestemn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livestemn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadstemn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadstemn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='livecrootn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%livecrootn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootn_storage', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='deadcrootn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%deadcrootn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='retransn', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%retransn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='npool', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%npool_patch) - - call restartvar(ncid=ncid, flag=flag, varname='pft_ntrunc', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ntrunc_patch) - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='grainn', xtype=ncd_double, & - dim1name='pft', long_name='grain N', units='gN/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainn_storage', xtype=ncd_double, & - dim1name='pft', long_name='grain N storage', units='gN/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_storage_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grainn_xfer', xtype=ncd_double, & - dim1name='pft', long_name='grain N transfer', units='gN/m2', & - interpinic_flag='interp', readvar=readvar, data=this%grainn_xfer_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cropseedn_deficit', xtype=ncd_double, & - dim1name='pft', long_name='pool for seeding new crop growth', units='gN/m2', & - interpinic_flag='interp', readvar=readvar, data=this%cropseedn_deficit_patch) - end if - - !-------------------------------- - ! gridcell nitrogen state variables - !-------------------------------- - - ! BACKWARDS_COMPATIBILITY(wjs, 2017-01-12) Naming this with a _g suffix in order to - ! distinguish it from the old column-level seedn restart variable - call restartvar(ncid=ncid, flag=flag, varname='seedn_g', xtype=ncd_double, & - dim1name='gridcell', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%seedn_grc) - - - if (flag == 'read') then - call restartvar(ncid=ncid, flag=flag, varname='spinup_state', xtype=ncd_int, & - long_name='Spinup state of the model that wrote this restart file: ' & - // ' 0 = normal model mode, 1 = AD spinup', units='', & - interpinic_flag='copy', readvar=readvar, data=idata) - - if (readvar) then - restart_file_spinup_state = idata - else - restart_file_spinup_state = spinup_state - if ( masterproc ) then - write(iulog,*) ' CNRest: WARNING! Restart file does not contain info ' & - // ' on spinup state used to generate the restart file. ' - write(iulog,*) ' Assuming the same as current setting: ', spinup_state - end if - end if - end if - - if (flag == 'read' .and. spinup_state /= restart_file_spinup_state .and. .not. use_cndv) then - if (spinup_state <= 1 .and. restart_file_spinup_state == 2 ) then - if ( masterproc ) write(iulog,*) ' CNRest: taking Dead wood N pools out of AD spinup mode' - exit_spinup = .true. - if ( masterproc ) write(iulog, *) 'Multiplying stemn and crootn by 10 for exit spinup ' - do i = bounds%begp,bounds%endp - this%deadstemn_patch(i) = this%deadstemn_patch(i) * 10._r8 - this%deadcrootn_patch(i) = this%deadcrootn_patch(i) * 10._r8 - end do - else if (spinup_state == 2 .and. restart_file_spinup_state <= 1 ) then - if ( masterproc ) write(iulog,*) ' CNRest: taking Dead wood N pools into AD spinup mode' - enter_spinup = .true. - if ( masterproc ) write(iulog, *) 'Dividing stemn and crootn by 10 for enter spinup ' - do i = bounds%begp,bounds%endp - this%deadstemn_patch(i) = this%deadstemn_patch(i) / 10._r8 - this%deadcrootn_patch(i) = this%deadcrootn_patch(i) / 10._r8 - end do - endif - - end if - ! Reseed dead plants - if ( flag == 'read' .and. num_reseed_patch > 0 )then - if ( masterproc ) write(iulog, *) 'Reseed dead plants for CNVegNitrogenState' - do i = 1, num_reseed_patch - p = filter_reseed_patch(i) - - l = patch%landunit(p) - - if (patch%itype(p) == noveg) then - this%leafn_patch(p) = 0._r8 - this%leafn_storage_patch(p) = 0._r8 - if (MM_Nuptake_opt .eqv. .true.) then - this%frootn_patch(p) = 0._r8 - this%frootn_storage_patch(p) = 0._r8 - end if - else - this%leafn_patch(p) = leafc_patch(p) / pftcon%leafcn(patch%itype(p)) - this%leafn_storage_patch(p) = leafc_storage_patch(p) / pftcon%leafcn(patch%itype(p)) - if (MM_Nuptake_opt .eqv. .true.) then - this%frootn_patch(p) = frootc_patch(p) / pftcon%frootcn(patch%itype(p)) - this%frootn_storage_patch(p) = frootc_storage_patch(p) / pftcon%frootcn(patch%itype(p)) - end if - end if - - this%leafn_xfer_patch(p) = 0._r8 - - this%leafn_storage_xfer_acc_patch(p) = 0._r8 - this%storage_ndemand_patch(p) = 0._r8 - - if ( use_crop )then - this%grainn_patch(p) = 0._r8 - this%grainn_storage_patch(p) = 0._r8 - this%grainn_xfer_patch(p) = 0._r8 - this%cropseedn_deficit_patch(p) = 0._r8 - end if - if (MM_Nuptake_opt .eqv. .false.) then ! if not running in floating CN ratio option - this%frootn_patch(p) = 0._r8 - this%frootn_storage_patch(p) = 0._r8 - end if - this%frootn_xfer_patch(p) = 0._r8 - this%livestemn_patch(p) = 0._r8 - this%livestemn_storage_patch(p) = 0._r8 - this%livestemn_xfer_patch(p) = 0._r8 - - ! tree types need to be initialized with some stem mass so that - ! roughness length is not zero in canopy flux calculation - - if (pftcon%woody(patch%itype(p)) == 1._r8) then - this%deadstemn_patch(p) = deadstemc_patch(p) / pftcon%deadwdcn(patch%itype(p)) - else - this%deadstemn_patch(p) = 0._r8 - end if - - this%deadstemn_storage_patch(p) = 0._r8 - this%deadstemn_xfer_patch(p) = 0._r8 - this%livecrootn_patch(p) = 0._r8 - this%livecrootn_storage_patch(p) = 0._r8 - this%livecrootn_xfer_patch(p) = 0._r8 - this%deadcrootn_patch(p) = 0._r8 - this%deadcrootn_storage_patch(p) = 0._r8 - this%deadcrootn_xfer_patch(p) = 0._r8 - this%retransn_patch(p) = 0._r8 - this%npool_patch(p) = 0._r8 - this%ntrunc_patch(p) = 0._r8 - this%dispvegn_patch(p) = 0._r8 - this%storvegn_patch(p) = 0._r8 - this%totvegn_patch(p) = 0._r8 - this%totn_patch(p) = 0._r8 - - ! calculate totvegc explicitly so that it is available for the isotope - ! code on the first time step. - - this%totvegn_patch(p) = & - this%leafn_patch(p) + & - this%leafn_storage_patch(p) + & - this%leafn_xfer_patch(p) + & - this%frootn_patch(p) + & - this%frootn_storage_patch(p) + & - this%frootn_xfer_patch(p) + & - this%livestemn_patch(p) + & - this%livestemn_storage_patch(p) + & - this%livestemn_xfer_patch(p) + & - this%deadstemn_patch(p) + & - this%deadstemn_storage_patch(p) + & - this%deadstemn_xfer_patch(p) + & - this%livecrootn_patch(p) + & - this%livecrootn_storage_patch(p) + & - this%livecrootn_xfer_patch(p) + & - this%deadcrootn_patch(p) + & - this%deadcrootn_storage_patch(p) + & - this%deadcrootn_xfer_patch(p) + & - this%npool_patch(p) - - if ( use_crop )then - this%totvegn_patch(p) = & - this%totvegn_patch(p) + & - this%grainn_patch(p) + & - this%grainn_storage_patch(p) + & - this%grainn_xfer_patch(p) - end if - end do - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, & - num_patch, filter_patch, value_patch, & - num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set nitrogen state variables - ! - ! !ARGUMENTS: - class (cnveg_nitrogenstate_type) :: this - integer , intent(in) :: num_patch - integer , intent(in) :: filter_patch(:) - real(r8), intent(in) :: value_patch - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i ! loop index - integer :: j,k ! indices - !------------------------------------------------------------------------ - - do fi = 1,num_patch - i = filter_patch(fi) - - this%leafn_patch(i) = value_patch - this%leafn_storage_patch(i) = value_patch - this%leafn_xfer_patch(i) = value_patch - this%leafn_storage_xfer_acc_patch(i) = value_patch - this%frootn_patch(i) = value_patch - this%frootn_storage_patch(i) = value_patch - this%frootn_xfer_patch(i) = value_patch - this%livestemn_patch(i) = value_patch - this%livestemn_storage_patch(i) = value_patch - this%livestemn_xfer_patch(i) = value_patch - this%deadstemn_patch(i) = value_patch - this%deadstemn_storage_patch(i) = value_patch - this%deadstemn_xfer_patch(i) = value_patch - this%livecrootn_patch(i) = value_patch - this%livecrootn_storage_patch(i) = value_patch - this%livecrootn_xfer_patch(i) = value_patch - this%deadcrootn_patch(i) = value_patch - this%deadcrootn_storage_patch(i) = value_patch - this%deadcrootn_xfer_patch(i) = value_patch - this%retransn_patch(i) = value_patch - this%npool_patch(i) = value_patch - this%ntrunc_patch(i) = value_patch - this%dispvegn_patch(i) = value_patch - this%storvegn_patch(i) = value_patch - this%totvegn_patch(i) = value_patch - this%totn_patch(i) = value_patch - end do - - if ( use_crop )then - do fi = 1,num_patch - i = filter_patch(fi) - this%grainn_patch(i) = value_patch - this%grainn_storage_patch(i) = value_patch - this%grainn_xfer_patch(i) = value_patch - this%cropseedn_deficit_patch(i) = value_patch - end do - end if - - do fi = 1,num_column - i = filter_column(fi) - - this%totecosysn_col(i) = value_column - this%totvegn_col(i) = value_column - this%totn_p2c_col(i) = value_column - this%totn_col(i) = value_column - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine ZeroDwt( this, bounds ) - ! - ! !DESCRIPTION - ! Initialize variables needed for dynamic land use. - ! - ! !ARGUMENTS: - class(cnveg_nitrogenstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p ! indices - !----------------------------------------------------------------------- - - do p = bounds%begp,bounds%endp - this%dispvegn_patch(p) = 0._r8 - this%storvegn_patch(p) = 0._r8 - this%totvegn_patch(p) = 0._r8 - this%totn_patch(p) = 0._r8 - end do - - end subroutine ZeroDwt - - !----------------------------------------------------------------------- - subroutine Summary_nitrogenstate(this, bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp,& - soilbiogeochem_nitrogenstate_inst) - ! - ! !USES: - use subgridAveMod, only : p2c - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - ! - ! !ARGUMENTS: - class(cnveg_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,k,l ! indices - integer :: fp,fc ! lake filter indices - real(r8) :: maxdepth ! depth to integrate soil variables - !----------------------------------------------------------------------- - - ! -------------------------------------------- - ! patch level summary - ! -------------------------------------------- - - do fp = 1,num_soilp - p = filter_soilp(fp) - - - ! displayed vegetation nitrogen, excluding storage (DISPVEGN) - this%dispvegn_patch(p) = & - this%leafn_patch(p) + & - this%frootn_patch(p) + & - this%livestemn_patch(p) + & - this%deadstemn_patch(p) + & - this%livecrootn_patch(p) + & - this%deadcrootn_patch(p) - - ! stored vegetation nitrogen, including retranslocated N pool (STORVEGN) - this%storvegn_patch(p) = & - this%leafn_storage_patch(p) + & - this%frootn_storage_patch(p) + & - this%livestemn_storage_patch(p) + & - this%deadstemn_storage_patch(p) + & - this%livecrootn_storage_patch(p) + & - this%deadcrootn_storage_patch(p) + & - this%leafn_xfer_patch(p) + & - this%frootn_xfer_patch(p) + & - this%livestemn_xfer_patch(p) + & - this%deadstemn_xfer_patch(p) + & - this%livecrootn_xfer_patch(p) + & - this%deadcrootn_xfer_patch(p) + & - this%npool_patch(p) + & - this%retransn_patch(p) - - if ( use_crop .and. patch%itype(p) >= npcropmin )then - this%dispvegn_patch(p) = & - this%dispvegn_patch(p) + & - this%grainn_patch(p) - - this%storvegn_patch(p) = & - this%storvegn_patch(p) + & - this%grainn_storage_patch(p) + & - this%grainn_xfer_patch(p) + & - this%cropseedn_deficit_patch(p) - end if - - ! total vegetation nitrogen (TOTVEGN) - this%totvegn_patch(p) = & - this%dispvegn_patch(p) + & - this%storvegn_patch(p) - - ! total patch-level carbon (add ntrunc) - this%totn_patch(p) = & - this%totvegn_patch(p) + & - this%ntrunc_patch(p) - - end do - - ! -------------------------------------------- - ! column level summary - ! -------------------------------------------- - - call p2c(bounds, num_soilc, filter_soilc, & - this%totvegn_patch(bounds%begp:bounds%endp), & - this%totvegn_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_soilc, filter_soilc, & - this%totn_patch(bounds%begp:bounds%endp), & - this%totn_p2c_col(bounds%begc:bounds%endc)) - - do fc = 1,num_allc - c = filter_allc(fc) - - ! total ecosystem nitrogen, including veg (TOTECOSYSN) - this%totecosysn_col(c) = & - soilbiogeochem_nitrogenstate_inst%cwdn_col(c) + & - soilbiogeochem_nitrogenstate_inst%totlitn_col(c) + & - soilbiogeochem_nitrogenstate_inst%totsomn_col(c) + & - soilbiogeochem_nitrogenstate_inst%sminn_col(c) + & - this%totvegn_col(c) - - ! total column nitrogen, including patch (TOTCOLN) - - this%totn_col(c) = this%totn_p2c_col(c) + & - soilbiogeochem_nitrogenstate_inst%cwdn_col(c) + & - soilbiogeochem_nitrogenstate_inst%totlitn_col(c) + & - soilbiogeochem_nitrogenstate_inst%totsomn_col(c) + & - soilbiogeochem_nitrogenstate_inst%sminn_col(c) + & - soilbiogeochem_nitrogenstate_inst%ntrunc_col(c) - - end do - - - - - end subroutine Summary_nitrogenstate - - !----------------------------------------------------------------------- - subroutine DynamicPatchAdjustments(this, bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed, deadstemc_seed, & - conv_nflux, wood_product_nflux, crop_product_nflux, & - dwt_frootn_to_litter, & - dwt_livecrootn_to_litter, & - dwt_deadcrootn_to_litter, & - dwt_leafn_seed, & - dwt_deadstemn_seed) - ! - ! !DESCRIPTION: - ! Adjust state variables and compute associated fluxes when patch areas change due to - ! dynamic landuse - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cnveg_nitrogenstate_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp_with_inactive ! number of points in filter - integer , intent(in) :: filter_soilp_with_inactive(:) ! soil patch filter that includes inactive points - type(patch_state_updater_type) , intent(in) :: patch_state_updater - real(r8) , intent(in) :: leafc_seed ! seed amount for leaf C - real(r8) , intent(in) :: deadstemc_seed ! seed amount for deadstem C - real(r8) , intent(inout) :: conv_nflux( bounds%begp: ) ! patch-level conversion N flux to atm (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: wood_product_nflux( bounds%begp: ) ! patch-level product N flux (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: crop_product_nflux( bounds%begp: ) ! patch-level crop product N flux (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: dwt_frootn_to_litter( bounds%begp: ) ! patch-level fine root N to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_livecrootn_to_litter( bounds%begp: ) ! patch-level live coarse root N to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_deadcrootn_to_litter( bounds%begp: ) ! patch-level live coarse root N to litter (expressed per unit COLUMN area) - real(r8) , intent(inout) :: dwt_leafn_seed( bounds%begp: ) ! patch-level mass gain due to seeding of new area: leaf N (expressed per unit GRIDCELL area) - real(r8) , intent(inout) :: dwt_deadstemn_seed( bounds%begp: ) ! patch-level mass gain due to seeding of new area: deadstem N (expressed per unit GRIDCELL area) - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - logical :: old_weight_was_zero(bounds%begp:bounds%endp) - logical :: patch_grew(bounds%begp:bounds%endp) - - ! The following are only set for growing patches: - real(r8) :: seed_leafn_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leafn_storage_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leafn_xfer_patch(bounds%begp:bounds%endp) - real(r8) :: seed_deadstemn_patch(bounds%begp:bounds%endp) - - character(len=*), parameter :: subname = 'DynamicPatchAdjustments' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - SHR_ASSERT_ALL((ubound(conv_nflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wood_product_nflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(crop_product_nflux) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_frootn_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_livecrootn_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_deadcrootn_to_litter) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_leafn_seed) == (/endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dwt_deadstemn_seed) == (/endp/)), errMsg(sourcefile, __LINE__)) - - old_weight_was_zero = patch_state_updater%old_weight_was_zero(bounds) - patch_grew = patch_state_updater%patch_grew(bounds) - - call ComputeSeedAmounts(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - species = CN_SPECIES_N, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - leaf_patch = this%leafn_patch(begp:endp), & - leaf_storage_patch = this%leafn_storage_patch(begp:endp), & - leaf_xfer_patch = this%leafn_xfer_patch(begp:endp), & - - ! Calculations only needed for patches that grew: - compute_here_patch = patch_grew(begp:endp), & - - ! For patches that previously had zero area, ignore the current state for the - ! sake of computing leaf proportions: - ignore_current_state_patch = old_weight_was_zero(begp:endp), & - - seed_leaf_patch = seed_leafn_patch(begp:endp), & - seed_leaf_storage_patch = seed_leafn_storage_patch(begp:endp), & - seed_leaf_xfer_patch = seed_leafn_xfer_patch(begp:endp), & - seed_deadstem_patch = seed_deadstemn_patch(begp:endp)) - - call update_patch_state( & - var = this%leafn_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp), & - seed = seed_leafn_patch(begp:endp), & - seed_addition = dwt_leafn_seed(begp:endp)) - - call update_patch_state( & - var = this%leafn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp), & - seed = seed_leafn_storage_patch(begp:endp), & - seed_addition = dwt_leafn_seed(begp:endp)) - - call update_patch_state( & - var = this%leafn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp), & - seed = seed_leafn_xfer_patch(begp:endp), & - seed_addition = dwt_leafn_seed(begp:endp)) - - call update_patch_state( & - var = this%frootn_patch(begp:endp), & - flux_out_col_area = dwt_frootn_to_litter(begp:endp)) - - call update_patch_state( & - var = this%frootn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%frootn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%livestemn_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%livestemn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%livestemn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call patch_state_updater%update_patch_state_partition_flux_by_type(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - flux1_fraction_by_pft_type = pftcon%pconv, & - var = this%deadstemn_patch(begp:endp), & - flux1_out = conv_nflux(begp:endp), & - flux2_out = wood_product_nflux(begp:endp), & - seed = seed_deadstemn_patch(begp:endp), & - seed_addition = dwt_deadstemn_seed(begp:endp)) - - call update_patch_state( & - var = this%deadstemn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%deadstemn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%livecrootn_patch(begp:endp), & - flux_out_col_area = dwt_livecrootn_to_litter(begp:endp)) - - call update_patch_state( & - var = this%livecrootn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%livecrootn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%deadcrootn_patch(begp:endp), & - flux_out_col_area = dwt_deadcrootn_to_litter(begp:endp)) - - call update_patch_state( & - var = this%deadcrootn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%deadcrootn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%retransn_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%npool_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%ntrunc_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - if (use_crop) then - call update_patch_state( & - var = this%grainn_patch(begp:endp), & - flux_out_grc_area = crop_product_nflux(begp:endp)) - - call update_patch_state( & - var = this%grainn_storage_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - call update_patch_state( & - var = this%grainn_xfer_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - - if (use_crop) then - ! This is a negative pool. So any deficit that we haven't repaid gets sucked out - ! of the atmosphere. - call update_patch_state( & - var = this%cropseedn_deficit_patch(begp:endp), & - flux_out_grc_area = conv_nflux(begp:endp)) - end if - end if - - contains - subroutine update_patch_state(var, flux_out_col_area, flux_out_grc_area, & - seed, seed_addition) - ! Wraps call to update_patch_state, in order to remove duplication - real(r8), intent(inout) :: var( bounds%begp: ) - real(r8), intent(inout), optional :: flux_out_col_area( bounds%begp: ) - real(r8), intent(inout), optional :: flux_out_grc_area( bounds%begp: ) - real(r8), intent(in), optional :: seed( bounds%begp: ) - real(r8), intent(inout), optional :: seed_addition( bounds%begp: ) - - call patch_state_updater%update_patch_state(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - var = var, & - flux_out_col_area = flux_out_col_area, & - flux_out_grc_area = flux_out_grc_area, & - seed = seed, & - seed_addition = seed_addition) - end subroutine update_patch_state - - - end subroutine DynamicPatchAdjustments - -end module CNVegNitrogenStateType diff --git a/src/biogeochem/CNVegStateType.F90 b/src/biogeochem/CNVegStateType.F90 deleted file mode 100644 index 85d18431c9..0000000000 --- a/src/biogeochem/CNVegStateType.F90 +++ /dev/null @@ -1,948 +0,0 @@ -module CNVegStateType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use abortutils , only : endrun - use spmdMod , only : masterproc - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevsoi - use clm_varctl , only : use_cn, iulog, fsurdat, use_crop, use_cndv - use clm_varcon , only : spval, ispval, grlnd - use landunit_varcon, only : istsoil, istcrop - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use AnnualFluxDribbler, only : annual_flux_dribbler_type, annual_flux_dribbler_patch - use dynSubgridControlMod, only : get_for_testing_allow_non_annual_changes - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC TYPES: - type, public :: cnveg_state_type - - integer , pointer :: burndate_patch (:) ! patch crop burn date - type(annual_flux_dribbler_type) :: dwt_dribbler_patch ! object to convert instantaneous dwt values into values that are smoothed / dribbled throughout the year - real(r8) , pointer :: dwt_smoothed_patch (:) ! change in patch weight (-1 to 1) on the gridcell in this time step; changes in first time step of year are smoothed (dribbled) over the whole year - - ! Prognostic crop model - ! - ! TODO(wjs, 2016-02-22) Most / all of these crop-specific state variables should be - ! moved to CropType - real(r8) , pointer :: hdidx_patch (:) ! patch cold hardening index? - real(r8) , pointer :: cumvd_patch (:) ! patch cumulative vernalization d?ependence? - real(r8) , pointer :: gddmaturity_patch (:) ! patch growing degree days (gdd) needed to harvest (ddays) - real(r8) , pointer :: huileaf_patch (:) ! patch heat unit index needed from planting to leaf emergence - real(r8) , pointer :: huigrain_patch (:) ! patch heat unit index needed to reach vegetative maturity - real(r8) , pointer :: aleafi_patch (:) ! patch saved leaf allocation coefficient from phase 2 - real(r8) , pointer :: astemi_patch (:) ! patch saved stem allocation coefficient from phase 2 - real(r8) , pointer :: aleaf_patch (:) ! patch leaf allocation coefficient - real(r8) , pointer :: astem_patch (:) ! patch stem allocation coefficient - real(r8) , pointer :: htmx_patch (:) ! patch max hgt attained by a crop during yr (m) - integer , pointer :: peaklai_patch (:) ! patch 1: max allowed lai; 0: not at max - - integer , pointer :: idop_patch (:) ! patch date of planting - - real(r8) , pointer :: gdp_lf_col (:) ! col global real gdp data (k US$/capita) - real(r8) , pointer :: peatf_lf_col (:) ! col global peatland fraction data (0-1) - integer , pointer :: abm_lf_col (:) ! col global peak month of crop fire emissions - - real(r8) , pointer :: lgdp_col (:) ! col gdp limitation factor for fire occurrence (0-1) - real(r8) , pointer :: lgdp1_col (:) ! col gdp limitation factor for fire spreading (0-1) - real(r8) , pointer :: lpop_col (:) ! col pop limitation factor for fire spreading (0-1) - - real(r8) , pointer :: tempavg_t2m_patch (:) ! patch temporary average 2m air temperature (K) - real(r8) , pointer :: annavg_t2m_patch (:) ! patch annual average 2m air temperature (K) - real(r8) , pointer :: annavg_t2m_col (:) ! col annual average of 2m air temperature, averaged from patch-level (K) - real(r8) , pointer :: annsum_counter_col (:) ! col seconds since last annual accumulator turnover - - ! Fire - real(r8) , pointer :: nfire_col (:) ! col fire counts (count/km2/sec), valid only in Reg. C - real(r8) , pointer :: fsr_col (:) ! col fire spread rate at column level (m/s) - real(r8) , pointer :: fd_col (:) ! col fire duration at column level (hr) - real(r8) , pointer :: lfc_col (:) ! col conversion area fraction of BET and BDT that haven't burned before (/timestep) - real(r8) , pointer :: lfc2_col (:) ! col conversion area fraction of BET and BDT that burned (/sec) - real(r8) , pointer :: dtrotr_col (:) ! col annual decreased fraction coverage of BET on the gridcell (0-1) - real(r8) , pointer :: trotr1_col (:) ! col patch weight of BET on the column (0-1) - real(r8) , pointer :: trotr2_col (:) ! col patch weight of BDT on the column (0-1) - real(r8) , pointer :: cropf_col (:) ! col crop fraction in veg column (0-1) - real(r8) , pointer :: baf_crop_col (:) ! col baf for cropland(/sec) - real(r8) , pointer :: baf_peatf_col (:) ! col baf for peatland (/sec) - real(r8) , pointer :: fbac_col (:) ! col total burned area out of conversion (/sec) - real(r8) , pointer :: fbac1_col (:) ! col burned area out of conversion region due to land use fire (/sec) - real(r8) , pointer :: wtlf_col (:) ! col fractional coverage of non-crop Patches (0-1) - real(r8) , pointer :: lfwt_col (:) ! col fractional coverage of non-crop and non-bare-soil Patches (0-1) - real(r8) , pointer :: farea_burned_col (:) ! col fractional area burned (/sec) - - real(r8), pointer :: dormant_flag_patch (:) ! patch dormancy flag - real(r8), pointer :: days_active_patch (:) ! patch number of days since last dormancy - real(r8), pointer :: onset_flag_patch (:) ! patch onset flag - real(r8), pointer :: onset_counter_patch (:) ! patch onset days counter - real(r8), pointer :: onset_gddflag_patch (:) ! patch onset flag for growing degree day sum - real(r8), pointer :: onset_fdd_patch (:) ! patch onset freezing degree days counter - real(r8), pointer :: onset_gdd_patch (:) ! patch onset growing degree days - real(r8), pointer :: onset_swi_patch (:) ! patch onset soil water index - real(r8), pointer :: offset_flag_patch (:) ! patch offset flag - real(r8), pointer :: offset_counter_patch (:) ! patch offset days counter - real(r8), pointer :: offset_fdd_patch (:) ! patch offset freezing degree days counter - real(r8), pointer :: offset_swi_patch (:) ! patch offset soil water index - real(r8), pointer :: grain_flag_patch (:) ! patch 1: grain fill stage; 0: not - real(r8), pointer :: lgsf_patch (:) ! patch long growing season factor [0-1] - real(r8), pointer :: bglfr_patch (:) ! patch background litterfall rate (1/s) - real(r8), pointer :: bgtr_patch (:) ! patch background transfer growth rate (1/s) - real(r8), pointer :: c_allometry_patch (:) ! patch C allocation index (DIM) - real(r8), pointer :: n_allometry_patch (:) ! patch N allocation index (DIM) - - real(r8), pointer :: tempsum_potential_gpp_patch (:) ! patch temporary annual sum of potential GPP - real(r8), pointer :: annsum_potential_gpp_patch (:) ! patch annual sum of potential GPP - real(r8), pointer :: tempmax_retransn_patch (:) ! patch temporary annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: annmax_retransn_patch (:) ! patch annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: downreg_patch (:) ! patch fractional reduction in GPP due to N limitation (DIM) - real(r8), pointer :: leafcn_offset_patch (:) ! patch leaf C:N used by FUN - real(r8), pointer :: plantCN_patch (:) ! patch plant C:N used by FUN - - contains - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type cnveg_state_type - !------------------------------------------------------------------------ - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate ( bounds ) - if (use_cn) then - call this%InitHistory ( bounds ) - end if - call this%InitCold ( bounds ) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - logical :: allows_non_annual_delta - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - ! Note that we set allows_non_annual_delta to false because we expect land cover - ! change to be applied entirely at the start of the year. Currently the fire code - ! appears to assume that the land cover change rate is constant throughout the year, - ! in this code (which is accompanied by the comment, 'land cover conversion in CLM4.5 - ! is the same for each timestep except for the beginning'): - ! - ! if( kmo == 1 .and. kda == 1 .and. mcsec == dt)then - ! lfc(c) = dtrotr_col(c)*dayspyr*secspday/dt - ! end if - ! - ! so setting allows_non_annual_delta to .false. helps ensure that remains true. - ! - ! However, we do keep allows_non_annual_delta = .true. if running with CNDV, because - ! (in contrast with other land cover change) CNDV currently still interpolates land - ! cover change throughout the year. Note that there is therefore an inconsistency with - ! the fire code if we're using CNDV, due to the way the annual flux dribbler works: - ! The dwt generated by CNDV on the first time step of the year is dribbled throughout - ! the year by dwt_dribbler_patch, but the CNDV dwt on every other time step comes at - ! its full value. So there will be a lower dwt in the first time step of the year - ! relative to every other time step of the year. If CNDV is the main contributor to - ! dwt, I think this can lead to a large violation of the above assumption of constant - ! dwt in the fire code. However, the fire code doesn't seem designed to work with - ! CNDV at all (because land cover change is assumed to be associated with - ! deforestation, not natural changes in areas), so maybe this inconsistency is the - ! least of the problem: see bug 2392. - if (get_for_testing_allow_non_annual_changes()) then - allows_non_annual_delta = .true. - else if (use_cndv) then - allows_non_annual_delta = .true. - else - allows_non_annual_delta = .false. - end if - this%dwt_dribbler_patch = annual_flux_dribbler_patch( & - bounds = bounds, & - name = 'dwt', & - units = 'fractional area', & - allows_non_annual_delta = allows_non_annual_delta) - - allocate(this%burndate_patch (begp:endp)) ; this%burndate_patch (:) = ispval - allocate(this%dwt_smoothed_patch (begp:endp)) ; this%dwt_smoothed_patch (:) = nan - - allocate(this%hdidx_patch (begp:endp)) ; this%hdidx_patch (:) = nan - allocate(this%cumvd_patch (begp:endp)) ; this%cumvd_patch (:) = nan - allocate(this%gddmaturity_patch (begp:endp)) ; this%gddmaturity_patch (:) = spval - allocate(this%huileaf_patch (begp:endp)) ; this%huileaf_patch (:) = nan - allocate(this%huigrain_patch (begp:endp)) ; this%huigrain_patch (:) = 0.0_r8 - allocate(this%aleafi_patch (begp:endp)) ; this%aleafi_patch (:) = nan - allocate(this%astemi_patch (begp:endp)) ; this%astemi_patch (:) = nan - allocate(this%aleaf_patch (begp:endp)) ; this%aleaf_patch (:) = nan - allocate(this%astem_patch (begp:endp)) ; this%astem_patch (:) = nan - allocate(this%htmx_patch (begp:endp)) ; this%htmx_patch (:) = 0.0_r8 - allocate(this%peaklai_patch (begp:endp)) ; this%peaklai_patch (:) = 0 - - allocate(this%idop_patch (begp:endp)) ; this%idop_patch (:) = huge(1) - - allocate(this%gdp_lf_col (begc:endc)) ; - allocate(this%peatf_lf_col (begc:endc)) ; - allocate(this%abm_lf_col (begc:endc)) ; - - allocate(this%lgdp_col (begc:endc)) ; - allocate(this%lgdp1_col (begc:endc)) ; - allocate(this%lpop_col (begc:endc)) ; - - allocate(this%tempavg_t2m_patch (begp:endp)) ; this%tempavg_t2m_patch (:) = nan - allocate(this%annsum_counter_col (begc:endc)) ; this%annsum_counter_col (:) = nan - allocate(this%annavg_t2m_col (begc:endc)) ; this%annavg_t2m_col (:) = nan - allocate(this%annavg_t2m_patch (begp:endp)) ; this%annavg_t2m_patch (:) = nan - - allocate(this%nfire_col (begc:endc)) ; this%nfire_col (:) = spval - allocate(this%fsr_col (begc:endc)) ; this%fsr_col (:) = nan - allocate(this%fd_col (begc:endc)) ; this%fd_col (:) = nan - allocate(this%lfc_col (begc:endc)) ; this%lfc_col (:) = spval - allocate(this%lfc2_col (begc:endc)) ; this%lfc2_col (:) = 0._r8 - allocate(this%dtrotr_col (begc:endc)) ; this%dtrotr_col (:) = 0._r8 - allocate(this%trotr1_col (begc:endc)) ; this%trotr1_col (:) = 0._r8 - allocate(this%trotr2_col (begc:endc)) ; this%trotr2_col (:) = 0._r8 - allocate(this%cropf_col (begc:endc)) ; this%cropf_col (:) = nan - allocate(this%baf_crop_col (begc:endc)) ; this%baf_crop_col (:) = nan - allocate(this%baf_peatf_col (begc:endc)) ; this%baf_peatf_col (:) = nan - allocate(this%fbac_col (begc:endc)) ; this%fbac_col (:) = nan - allocate(this%fbac1_col (begc:endc)) ; this%fbac1_col (:) = nan - allocate(this%wtlf_col (begc:endc)) ; this%wtlf_col (:) = nan - allocate(this%lfwt_col (begc:endc)) ; this%lfwt_col (:) = nan - allocate(this%farea_burned_col (begc:endc)) ; this%farea_burned_col (:) = nan - - allocate(this%dormant_flag_patch (begp:endp)) ; this%dormant_flag_patch (:) = nan - allocate(this%days_active_patch (begp:endp)) ; this%days_active_patch (:) = nan - allocate(this%onset_flag_patch (begp:endp)) ; this%onset_flag_patch (:) = nan - allocate(this%onset_counter_patch (begp:endp)) ; this%onset_counter_patch (:) = nan - allocate(this%onset_gddflag_patch (begp:endp)) ; this%onset_gddflag_patch (:) = nan - allocate(this%onset_fdd_patch (begp:endp)) ; this%onset_fdd_patch (:) = nan - allocate(this%onset_gdd_patch (begp:endp)) ; this%onset_gdd_patch (:) = nan - allocate(this%onset_swi_patch (begp:endp)) ; this%onset_swi_patch (:) = nan - allocate(this%offset_flag_patch (begp:endp)) ; this%offset_flag_patch (:) = nan - allocate(this%offset_counter_patch (begp:endp)) ; this%offset_counter_patch (:) = nan - allocate(this%offset_fdd_patch (begp:endp)) ; this%offset_fdd_patch (:) = nan - allocate(this%offset_swi_patch (begp:endp)) ; this%offset_swi_patch (:) = nan - allocate(this%grain_flag_patch (begp:endp)) ; this%grain_flag_patch (:) = nan - allocate(this%lgsf_patch (begp:endp)) ; this%lgsf_patch (:) = nan - allocate(this%bglfr_patch (begp:endp)) ; this%bglfr_patch (:) = nan - allocate(this%bgtr_patch (begp:endp)) ; this%bgtr_patch (:) = nan - allocate(this%c_allometry_patch (begp:endp)) ; this%c_allometry_patch (:) = nan - allocate(this%n_allometry_patch (begp:endp)) ; this%n_allometry_patch (:) = nan - allocate(this%tempsum_potential_gpp_patch (begp:endp)) ; this%tempsum_potential_gpp_patch (:) = nan - allocate(this%annsum_potential_gpp_patch (begp:endp)) ; this%annsum_potential_gpp_patch (:) = nan - allocate(this%tempmax_retransn_patch (begp:endp)) ; this%tempmax_retransn_patch (:) = nan - allocate(this%annmax_retransn_patch (begp:endp)) ; this%annmax_retransn_patch (:) = nan - allocate(this%downreg_patch (begp:endp)) ; this%downreg_patch (:) = nan - allocate(this%leafcn_offset_patch (begp:endp)) ; this%leafcn_offset_patch (:) = nan - allocate(this%plantCN_patch (begp:endp)) ; this%plantCN_patch (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use histFileMod , only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp, no_snow_normal - ! - ! !ARGUMENTS: - class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - character(8) :: vr_suffix - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - if ( use_crop) then - this%gddmaturity_patch(begp:endp) = spval - call hist_addfld1d (fname='GDDHARV', units='ddays', & - avgflag='A', long_name='Growing degree days (gdd) needed to harvest', & - ptr_patch=this%gddmaturity_patch, default='inactive') - end if - - this%lfc2_col(begc:endc) = spval - call hist_addfld1d (fname='LFC2', units='per sec', & - avgflag='A', long_name='conversion area fraction of BET and BDT that burned', & - ptr_col=this%lfc2_col) - - this%annsum_counter_col(begc:endc) = spval - call hist_addfld1d (fname='ANNSUM_COUNTER', units='s', & - avgflag='A', long_name='seconds since last annual accumulator turnover', & - ptr_col=this%annsum_counter_col, default='inactive') - - this%annavg_t2m_col(begc:endc) = spval - call hist_addfld1d (fname='CANNAVG_T2M', units='K', & - avgflag='A', long_name='annual average of 2m air temperature', & - ptr_col=this%annavg_t2m_col, default='inactive') - - this%nfire_col(begc:endc) = spval - call hist_addfld1d (fname='NFIRE', units='counts/km2/sec', & - avgflag='A', long_name='fire counts valid only in Reg.C', & - ptr_col=this%nfire_col) - - this%farea_burned_col(begc:endc) = spval - call hist_addfld1d (fname='FAREA_BURNED', units='proportion/sec', & - avgflag='A', long_name='timestep fractional area burned', & - ptr_col=this%farea_burned_col) - - this%baf_crop_col(begc:endc) = spval - call hist_addfld1d (fname='BAF_CROP', units='proportion/sec', & - avgflag='A', long_name='fractional area burned for crop', & - ptr_col=this%baf_crop_col) - - this%baf_peatf_col(begc:endc) = spval - call hist_addfld1d (fname='BAF_PEATF', units='proportion/sec', & - avgflag='A', long_name='fractional area burned in peatland', & - ptr_col=this%baf_peatf_col) - - this%annavg_t2m_patch(begp:endp) = spval - call hist_addfld1d (fname='ANNAVG_T2M', units='K', & - avgflag='A', long_name='annual average 2m air temperature', & - ptr_patch=this%annavg_t2m_patch, default='inactive') - - this%tempavg_t2m_patch(begp:endp) = spval - call hist_addfld1d (fname='TEMPAVG_T2M', units='K', & - avgflag='A', long_name='temporary average 2m air temperature', & - ptr_patch=this%tempavg_t2m_patch, default='inactive') - - this%dormant_flag_patch(begp:endp) = spval - call hist_addfld1d (fname='DORMANT_FLAG', units='none', & - avgflag='A', long_name='dormancy flag', & - ptr_patch=this%dormant_flag_patch, default='inactive') - - this%days_active_patch(begp:endp) = spval - call hist_addfld1d (fname='DAYS_ACTIVE', units='days', & - avgflag='A', long_name='number of days since last dormancy', & - ptr_patch=this%days_active_patch, default='inactive') - - this%onset_flag_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_FLAG', units='none', & - avgflag='A', long_name='onset flag', & - ptr_patch=this%onset_flag_patch, default='inactive') - - this%onset_counter_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_COUNTER', units='days', & - avgflag='A', long_name='onset days counter', & - ptr_patch=this%onset_counter_patch, default='inactive') - - this%onset_gddflag_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_GDDFLAG', units='none', & - avgflag='A', long_name='onset flag for growing degree day sum', & - ptr_patch=this%onset_gddflag_patch, default='inactive') - - this%onset_fdd_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_FDD', units='C degree-days', & - avgflag='A', long_name='onset freezing degree days counter', & - ptr_patch=this%onset_fdd_patch, default='inactive') - - this%onset_gdd_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_GDD', units='C degree-days', & - avgflag='A', long_name='onset growing degree days', & - ptr_patch=this%onset_gdd_patch, default='inactive') - - this%onset_swi_patch(begp:endp) = spval - call hist_addfld1d (fname='ONSET_SWI', units='none', & - avgflag='A', long_name='onset soil water index', & - ptr_patch=this%onset_swi_patch, default='inactive') - - this%offset_flag_patch(begp:endp) = spval - call hist_addfld1d (fname='OFFSET_FLAG', units='none', & - avgflag='A', long_name='offset flag', & - ptr_patch=this%offset_flag_patch, default='inactive') - - this%offset_counter_patch(begp:endp) = spval - call hist_addfld1d (fname='OFFSET_COUNTER', units='days', & - avgflag='A', long_name='offset days counter', & - ptr_patch=this%offset_counter_patch, default='inactive') - - this%offset_fdd_patch(begp:endp) = spval - call hist_addfld1d (fname='OFFSET_FDD', units='C degree-days', & - avgflag='A', long_name='offset freezing degree days counter', & - ptr_patch=this%offset_fdd_patch, default='inactive') - - this%offset_swi_patch(begp:endp) = spval - call hist_addfld1d (fname='OFFSET_SWI', units='none', & - avgflag='A', long_name='offset soil water index', & - ptr_patch=this%offset_swi_patch, default='inactive') - - this%lgsf_patch(begp:endp) = spval - call hist_addfld1d (fname='LGSF', units='proportion', & - avgflag='A', long_name='long growing season factor', & - ptr_patch=this%lgsf_patch, default='inactive') - - this%bglfr_patch(begp:endp) = spval - call hist_addfld1d (fname='BGLFR', units='1/s', & - avgflag='A', long_name='background litterfall rate', & - ptr_patch=this%bglfr_patch, default='inactive') - - this%bgtr_patch(begp:endp) = spval - call hist_addfld1d (fname='BGTR', units='1/s', & - avgflag='A', long_name='background transfer growth rate', & - ptr_patch=this%bgtr_patch, default='inactive') - - this%c_allometry_patch(begp:endp) = spval - call hist_addfld1d (fname='C_ALLOMETRY', units='none', & - avgflag='A', long_name='C allocation index', & - ptr_patch=this%c_allometry_patch, default='inactive') - - this%n_allometry_patch(begp:endp) = spval - call hist_addfld1d (fname='N_ALLOMETRY', units='none', & - avgflag='A', long_name='N allocation index', & - ptr_patch=this%n_allometry_patch, default='inactive') - - this%tempsum_potential_gpp_patch(begp:endp) = spval - call hist_addfld1d (fname='TEMPSUM_POTENTIAL_GPP', units='gC/m^2/yr', & - avgflag='A', long_name='temporary annual sum of potential GPP', & - ptr_patch=this%tempsum_potential_gpp_patch, default='inactive') - - this%annsum_potential_gpp_patch(begp:endp) = spval - call hist_addfld1d (fname='ANNSUM_POTENTIAL_GPP', units='gN/m^2/yr', & - avgflag='A', long_name='annual sum of potential GPP', & - ptr_patch=this%annsum_potential_gpp_patch, default='inactive') - - this%tempmax_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='TEMPMAX_RETRANSN', units='gN/m^2', & - avgflag='A', long_name='temporary annual max of retranslocated N pool', & - ptr_patch=this%tempmax_retransn_patch, default='inactive') - - this%annmax_retransn_patch(begp:endp) = spval - call hist_addfld1d (fname='ANNMAX_RETRANSN', units='gN/m^2', & - avgflag='A', long_name='annual max of retranslocated N pool', & - ptr_patch=this%annmax_retransn_patch, default='inactive') - - this%downreg_patch(begp:endp) = spval - call hist_addfld1d (fname='DOWNREG', units='proportion', & - avgflag='A', long_name='fractional reduction in GPP due to N limitation', & - ptr_patch=this%downreg_patch, default='inactive') - - this%leafcn_offset_patch(begp:endp) = spval - call hist_addfld1d (fname='LEAFCN_OFFSET', units='unitless', & - avgflag='A', long_name='Leaf C:N used by FUN', & - ptr_patch=this%leafcn_offset_patch, default='inactive') - - this%plantCN_patch(begp:endp) = spval - call hist_addfld1d (fname='PLANTCN', units='unitless', & - avgflag='A', long_name='Plant C:N used by FUN', & - ptr_patch=this%plantCN_patch, default='inactive') - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine initCold(this, bounds) - ! - ! !USES: - use spmdMod , only : masterproc - use fileutils , only : getfil - use clm_varctl , only : nsrest, nsrStartup - use ncdio_pio - ! - ! !ARGUMENTS: - class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p,n,j,m ! indices - real(r8) ,pointer :: gdp (:) ! global gdp data (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: peatf (:) ! global peatf data (needs to be a pointer for use in ncdio) - integer ,pointer :: abm (:) ! global abm data (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: gti (:) ! read in - fmax (needs to be a pointer for use in ncdio) - integer :: dimid ! dimension id - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar - character(len=256) :: locfn ! local filename - integer :: begc, endc - integer :: begg, endg - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - ! -------------------------------------------------------------------- - ! Open surface dataset - ! -------------------------------------------------------------------- - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! -------------------------------------------------------------------- - ! Read in GDP data - ! -------------------------------------------------------------------- - - allocate(gdp(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%gdp_lf_col(c) = gdp(g) - end do - deallocate(gdp) - - ! -------------------------------------------------------------------- - ! Read in peatf data - ! -------------------------------------------------------------------- - - allocate(peatf(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%peatf_lf_col(c) = peatf(g) - end do - deallocate(peatf) - - ! -------------------------------------------------------------------- - ! Read in ABM data - ! -------------------------------------------------------------------- - - allocate(abm(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%abm_lf_col(c) = abm(g) - end do - deallocate(abm) - - ! Close file - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' - write(iulog,*) - endif - - ! -------------------------------------------------------------------- - ! Initialize terms needed for dust model - ! TODO - move these terms to DUSTMod module variables - ! -------------------------------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - this%annsum_counter_col (c) = spval - this%annavg_t2m_col (c) = spval - this%nfire_col (c) = spval - this%baf_crop_col (c) = spval - this%baf_peatf_col (c) = spval - this%fbac_col (c) = spval - this%fbac1_col (c) = spval - this%farea_burned_col (c) = spval - end if - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%annsum_counter_col(c) = 0._r8 - this%annavg_t2m_col(c) = 280._r8 - - ! fire related variables - this%baf_crop_col(c) = 0._r8 - this%baf_peatf_col(c) = 0._r8 - this%fbac_col(c) = 0._r8 - this%fbac1_col(c) = 0._r8 - this%farea_burned_col(c) = 0._r8 - this%nfire_col(c) = 0._r8 - end if - end do - - ! ecophysiological and phenology variables - - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - - if (lun%ifspecial(l)) then - this%annavg_t2m_patch (p) = spval - this%tempavg_t2m_patch (p) = spval - this%dormant_flag_patch(p) = spval - this%days_active_patch(p) = spval - this%onset_flag_patch(p) = spval - this%onset_counter_patch(p) = spval - this%onset_gddflag_patch(p) = spval - this%onset_fdd_patch(p) = spval - this%onset_gdd_patch(p) = spval - this%onset_swi_patch(p) = spval - this%offset_flag_patch(p) = spval - this%offset_counter_patch(p) = spval - this%offset_fdd_patch(p) = spval - this%offset_swi_patch(p) = spval - this%grain_flag_patch(p) = spval - this%lgsf_patch(p) = spval - this%bglfr_patch(p) = spval - this%bgtr_patch(p) = spval - this%c_allometry_patch(p) = spval - this%n_allometry_patch(p) = spval - this%tempsum_potential_gpp_patch(p) = spval - this%annsum_potential_gpp_patch(p) = spval - this%tempmax_retransn_patch(p) = spval - this%annmax_retransn_patch(p) = spval - this%downreg_patch(p) = spval - this%leafcn_offset_patch(p) = spval - this%plantCN_patch(p) = spval - end if - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - ! phenology variables - this%dormant_flag_patch(p) = 1._r8 - this%days_active_patch(p) = 0._r8 - this%onset_flag_patch(p) = 0._r8 - this%onset_counter_patch(p) = 0._r8 - this%onset_gddflag_patch(p) = 0._r8 - this%onset_fdd_patch(p) = 0._r8 - this%onset_gdd_patch(p) = 0._r8 - this%onset_swi_patch(p) = 0._r8 - this%offset_flag_patch(p) = 0._r8 - this%offset_counter_patch(p) = 0._r8 - this%offset_fdd_patch(p) = 0._r8 - this%offset_swi_patch(p) = 0._r8 - this%lgsf_patch(p) = 0._r8 - this%bglfr_patch(p) = 0._r8 - this%bgtr_patch(p) = 0._r8 - this%annavg_t2m_patch(p) = 280._r8 - this%tempavg_t2m_patch(p) = 0._r8 - this%grain_flag_patch(p) = 0._r8 - - ! non-phenology variables - this%c_allometry_patch(p) = 0._r8 - this%n_allometry_patch(p) = 0._r8 - this%tempsum_potential_gpp_patch(p) = 0._r8 - this%annsum_potential_gpp_patch(p) = 0._r8 - this%tempmax_retransn_patch(p) = 0._r8 - this%annmax_retransn_patch(p) = 0._r8 - this%downreg_patch(p) = 0._r8 - this%leafcn_offset_patch(p) = spval - this%plantCN_patch(p) = spval - end if - - end do - - ! fire variables - - do c = bounds%begc,bounds%endc - this%lfc2_col(c) = 0._r8 - end do - - end subroutine initCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag, cnveg_carbonstate, & - cnveg_nitrogenstate, filter_reseed_patch, num_reseed_patch) - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use CNVegNitrogenStateType, only: cnveg_nitrogenstate_type - use CNVegCarbonStateType , only: cnveg_carbonstate_type - use restUtilMod - use ncdio_pio - use pftconMod , only : pftcon - ! - ! !ARGUMENTS: - class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - type(cnveg_nitrogenstate_type), intent(in) :: cnveg_nitrogenstate - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate - integer , intent(out), optional :: filter_reseed_patch(:) - integer , intent(out), optional :: num_reseed_patch - ! - ! !LOCAL VARIABLES: - integer :: j,c,i,p ! indices - logical :: readvar ! determine if variable is on initial file - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - !----------------------------------------------------------------------- - - call this%dwt_dribbler_patch%Restart(bounds, ncid, flag) - - call restartvar(ncid=ncid, flag=flag, varname='dormant_flag', xtype=ncd_double, & - dim1name='pft', & - long_name='dormancy flag', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%dormant_flag_patch) - - call restartvar(ncid=ncid, flag=flag, varname='days_active', xtype=ncd_double, & - dim1name='pft', & - long_name='number of days since last dormancy', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%days_active_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_flag', xtype=ncd_double, & - dim1name='pft', & - long_name='flag if critical growing degree-day sum is exceeded', units='unitless' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_flag_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_counter', xtype=ncd_double, & - dim1name='pft', & - long_name='onset days counter', units='sec' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_counter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_gddflag', xtype=ncd_double, & - dim1name='pft', & - long_name='onset flag for growing degree day sum', units='' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_gddflag_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_fdd', xtype=ncd_double, & - dim1name='pft', & - long_name='onset freezing degree days counter', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_fdd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_gdd', xtype=ncd_double, & - dim1name='pft', & - long_name='onset growing degree days', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_gdd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='onset_swi', xtype=ncd_double, & - dim1name='pft', & - long_name='onset soil water index', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_swi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='offset_flag', xtype=ncd_double, & - dim1name='pft', & - long_name='offset flag', units='unitless' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_flag_patch) - - call restartvar(ncid=ncid, flag=flag, varname='offset_counter', xtype=ncd_double, & - dim1name='pft', & - long_name='offset days counter', units='sec' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_counter_patch) - - call restartvar(ncid=ncid, flag=flag, varname='offset_fdd', xtype=ncd_double, & - dim1name='pft', & - long_name='offset freezing degree days counter', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_fdd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='offset_swi', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%offset_swi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='lgsf', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%lgsf_patch) - - call restartvar(ncid=ncid, flag=flag, varname='bglfr', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%bglfr_patch) - - call restartvar(ncid=ncid, flag=flag, varname='bgtr', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%bgtr_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annavg_t2m', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tempavg_t2m', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempavg_t2m_patch) - - call restartvar(ncid=ncid, flag=flag, varname='c_allometry', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%c_allometry_patch) - - call restartvar(ncid=ncid, flag=flag, varname='n_allometry', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%n_allometry_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tempsum_potential_gpp', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempsum_potential_gpp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annsum_potential_gpp', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_potential_gpp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tempmax_retransn', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempmax_retransn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annmax_retransn', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annmax_retransn_patch) - - call restartvar(ncid=ncid, flag=flag, varname='downreg', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%downreg_patch) - - call restartvar(ncid=ncid, flag=flag, varname='leafcn_offset', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%leafcn_offset_patch) - - call restartvar(ncid=ncid, flag=flag, varname='plantCN', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%plantCN_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annsum_counter', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_counter_col) - - call restartvar(ncid=ncid, flag=flag, varname='burndate', xtype=ncd_int, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%burndate_patch) - - call restartvar(ncid=ncid, flag=flag, varname='lfc', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%lfc_col) - - call restartvar(ncid=ncid, flag=flag, varname='cannavg_t2m', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_col) - - if (use_crop) then - - call restartvar(ncid=ncid, flag=flag, varname='htmx', xtype=ncd_double, & - dim1name='pft', long_name='max height attained by a crop during year', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%htmx_patch) - - call restartvar(ncid=ncid, flag=flag, varname='peaklai', xtype=ncd_int, & - dim1name='pft', long_name='Flag if at max allowed LAI or not', & - flag_values=(/0,1/), nvalid_range=(/0,1/), & - flag_meanings=(/'NOT-at-peak', 'AT_peak-LAI' /) , & - interpinic_flag='interp', readvar=readvar, data=this%peaklai_patch) - - call restartvar(ncid=ncid, flag=flag, varname='idop', xtype=ncd_int, & - dim1name='pft', long_name='Date of planting', units='jday', nvalid_range=(/1,366/), & - interpinic_flag='interp', readvar=readvar, data=this%idop_patch) - - call restartvar(ncid=ncid, flag=flag, varname='aleaf', xtype=ncd_double, & - dim1name='pft', long_name='leaf allocation coefficient', units='', & - interpinic_flag='interp', readvar=readvar, data=this%aleaf_patch) - - call restartvar(ncid=ncid, flag=flag, varname='aleafi', xtype=ncd_double, & - dim1name='pft', long_name='Saved leaf allocation coefficient from phase 2', units='', & - interpinic_flag='interp', readvar=readvar, data=this%aleafi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='astem', xtype=ncd_double, & - dim1name='pft', long_name='stem allocation coefficient', units='', & - interpinic_flag='interp', readvar=readvar, data=this%astem_patch) - - call restartvar(ncid=ncid, flag=flag, varname='astemi', xtype=ncd_double, & - dim1name='pft', long_name='Saved stem allocation coefficient from phase 2', units='', & - interpinic_flag='interp', readvar=readvar, data=this%astemi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='hdidx', xtype=ncd_double, & - dim1name='pft', long_name='cold hardening index', units='', & - interpinic_flag='interp', readvar=readvar, data=this%hdidx_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cumvd', xtype=ncd_double, & - dim1name='pft', long_name='cumulative vernalization d', units='', & - interpinic_flag='interp', readvar=readvar, data=this%cumvd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='gddmaturity', xtype=ncd_double, & - dim1name='pft', long_name='Growing degree days needed to harvest', units='ddays', & - interpinic_flag='interp', readvar=readvar, data=this%gddmaturity_patch) - - call restartvar(ncid=ncid, flag=flag, varname='huileaf', xtype=ncd_double, & - dim1name='pft', long_name='heat unit index needed from planting to leaf emergence', units='', & - interpinic_flag='interp', readvar=readvar, data=this%huileaf_patch) - - call restartvar(ncid=ncid, flag=flag, varname='huigrain', xtype=ncd_double, & - dim1name='pft', long_name='heat unit index needed to reach vegetative maturity', units='', & - interpinic_flag='interp', readvar=readvar, data=this%huigrain_patch) - - call restartvar(ncid=ncid, flag=flag, varname='grain_flag', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%grain_flag_patch) - end if - if ( flag == 'read' .and. num_reseed_patch > 0 )then - if ( masterproc ) write(iulog, *) 'Reseed dead plants for CNVegState' - do i = 1, num_reseed_patch - p = filter_reseed_patch(i) - ! phenology variables - this%dormant_flag_patch(p) = 1._r8 - this%days_active_patch(p) = 0._r8 - this%onset_flag_patch(p) = 0._r8 - this%onset_counter_patch(p) = 0._r8 - this%onset_gddflag_patch(p) = 0._r8 - this%onset_fdd_patch(p) = 0._r8 - this%onset_gdd_patch(p) = 0._r8 - this%onset_swi_patch(p) = 0._r8 - this%offset_flag_patch(p) = 0._r8 - this%offset_counter_patch(p) = 0._r8 - this%offset_fdd_patch(p) = 0._r8 - this%offset_swi_patch(p) = 0._r8 - this%lgsf_patch(p) = 0._r8 - this%bglfr_patch(p) = 0._r8 - this%bgtr_patch(p) = 0._r8 - this%annavg_t2m_patch(p) = 280._r8 - this%tempavg_t2m_patch(p) = 0._r8 - this%grain_flag_patch(p) = 0._r8 - - this%c_allometry_patch(p) = 0._r8 - this%n_allometry_patch(p) = 0._r8 - this%tempsum_potential_gpp_patch(p) = 0._r8 - this%annsum_potential_gpp_patch(p) = 0._r8 - this%tempmax_retransn_patch(p) = 0._r8 - this%annmax_retransn_patch(p) = 0._r8 - this%downreg_patch(p) = 0._r8 - this%leafcn_offset_patch(p) = spval - this%plantCN_patch(p) = spval - end do - end if - - end subroutine Restart - -end module CNVegStateType diff --git a/src/biogeochem/CNVegStructUpdateMod.F90 b/src/biogeochem/CNVegStructUpdateMod.F90 deleted file mode 100644 index 27b677b04d..0000000000 --- a/src/biogeochem/CNVegStructUpdateMod.F90 +++ /dev/null @@ -1,307 +0,0 @@ -module CNVegStructUpdateMod - - !----------------------------------------------------------------------- - ! Module for vegetation structure updates (LAI, SAI, htop, hbot) - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_PI - use clm_varctl , only : iulog, use_cndv - use CNDVType , only : dgv_ecophyscon - use WaterStateType , only : waterstate_type - use FrictionVelocityMod , only : frictionvel_type - use CNDVType , only : dgvs_type - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CanopyStateType , only : canopystate_type - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CNVegStructUpdate - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CNVegStructUpdate(num_soilp, filter_soilp, & - waterstate_inst, frictionvel_inst, dgvs_inst, cnveg_state_inst, crop_inst, & - cnveg_carbonstate_inst, canopystate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, use C state variables and epc to diagnose - ! vegetation structure (LAI, SAI, height) - ! - ! !USES: - use pftconMod , only : noveg, nc3crop, nc3irrig, nbrdlf_evr_shrub, nbrdlf_dcd_brl_shrub - use pftconMod , only : npcropmin - use pftconMod , only : ntmp_corn, nirrig_tmp_corn - use pftconMod , only : ntrp_corn, nirrig_trp_corn - use pftconMod , only : nsugarcane, nirrig_sugarcane - use pftconMod , only : pftcon - use clm_varctl , only : spinup_state - use clm_time_manager , only : get_rad_step_size - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilp ! number of column soil points in patch filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(waterstate_type) , intent(in) :: waterstate_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(dgvs_type) , intent(in) :: dgvs_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !REVISION HISTORY: - ! 10/28/03: Created by Peter Thornton - ! 2/29/08, David Lawrence: revised snow burial fraction for short vegetation - ! - ! !LOCAL VARIABLES: - integer :: p,c,g ! indices - integer :: fp ! lake filter indices - real(r8) :: taper ! ratio of height:radius_breast_height (tree allometry) - real(r8) :: stocking ! #stems / ha (stocking density) - real(r8) :: ol ! thickness of canopy layer covered by snow (m) - real(r8) :: fb ! fraction of canopy layer covered by snow - real(r8) :: tlai_old ! for use in Zeng tsai formula - real(r8) :: tsai_old ! for use in Zeng tsai formula - real(r8) :: tsai_min ! PATCH derived minimum tsai - real(r8) :: tsai_alpha ! monthly decay rate of tsai - real(r8) :: dt ! radiation time step (sec) - - real(r8), parameter :: dtsmonth = 2592000._r8 ! number of seconds in a 30 day month (60x60x24x30) - !----------------------------------------------------------------------- - ! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835 - ! - ! tsai(p) = max( tsai_alpha(ivt(p))*tsai_old + max(tlai_old-tlai(p),0_r8), tsai_min(ivt(p)) ) - ! notes: - ! * RHS tsai & tlai are from previous timestep - ! * should create tsai_alpha(ivt(p)) & tsai_min(ivt(p)) in pftconMod.F90 - slevis - ! * all non-crop patches use same values: - ! crop tsai_alpha,tsai_min = 0.0,0.1 - ! noncrop tsai_alpha,tsai_min = 0.5,1.0 (includes bare soil and urban) - !------------------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis [m^2/gC] - dsladlai => pftcon%dsladlai , & ! Input: dSLA/dLAI, projected area basis [m^2/gC] - z0mr => pftcon%z0mr , & ! Input: ratio of momentum roughness length to canopy top height (-) - displar => pftcon%displar , & ! Input: ratio of displacement height to canopy top height (-) - dwood => pftcon%dwood , & ! Input: density of wood (gC/m^3) - ztopmx => pftcon%ztopmx , & ! Input: - laimx => pftcon%laimx , & ! Input: - - allom2 => dgv_ecophyscon%allom2 , & ! Input: [real(r8) (:) ] ecophys const - allom3 => dgv_ecophyscon%allom3 , & ! Input: [real(r8) (:) ] ecophys const - - nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m**2) - fpcgrid => dgvs_inst%fpcgrid_patch , & ! Input: [real(r8) (:) ] fractional area of patch (pft area/nat veg area) - - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch-level [m] - - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - - farea_burned => cnveg_state_inst%farea_burned_col , & ! Input: [real(r8) (:) ] F. Li and S. Levis - htmx => cnveg_state_inst%htmx_patch , & ! Output: [real(r8) (:) ] max hgt attained by a crop during yr (m) - peaklai => cnveg_state_inst%peaklai_patch , & ! Output: [integer (:) ] 1: max allowed lai; 0: not at max - - harvdate => crop_inst%harvdate_patch , & ! Input: [integer (:) ] harvest date - - ! *** Key Output from CN*** - tlai => canopystate_inst%tlai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index, no burying by snow - htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) - hbot => canopystate_inst%hbot_patch , & ! Output: [real(r8) (:) ] canopy bottom (m) - elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index with burying by snow - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch & ! Output: [integer (:) ] frac of vegetation not covered by snow [-] - ) - - dt = real( get_rad_step_size(), r8 ) - - ! constant allometric parameters - taper = 200._r8 - stocking = 1000._r8 - - ! convert from stems/ha -> stems/m^2 - stocking = stocking / 10000._r8 - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - g = patch%gridcell(p) - - if (ivt(p) /= noveg) then - - tlai_old = tlai(p) ! n-1 value - tsai_old = tsai(p) ! n-1 value - - ! update the leaf area index based on leafC and SLA - ! Eq 3 from Thornton and Zimmerman, 2007, J Clim, 20, 3902-3923. - if (dsladlai(ivt(p)) > 0._r8) then - tlai(p) = (slatop(ivt(p))*(exp(leafc(p)*dsladlai(ivt(p))) - 1._r8))/dsladlai(ivt(p)) - else - tlai(p) = slatop(ivt(p)) * leafc(p) - end if - tlai(p) = max(0._r8, tlai(p)) - - ! update the stem area index and height based on LAI, stem mass, and veg type. - ! With the exception of htop for woody vegetation, this follows the DGVM logic. - - ! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835 (see notes) - ! Assumes doalb time step .eq. CLM time step, SAI min and monthly decay factor - ! alpha are set by PFT, and alpha is scaled to CLM time step by multiplying by - ! dt and dividing by dtsmonth (seconds in average 30 day month) - ! tsai_min scaled by 0.5 to match MODIS satellite derived values - if (ivt(p) == nc3crop .or. ivt(p) == nc3irrig) then ! generic crops - - tsai_alpha = 1.0_r8-1.0_r8*dt/dtsmonth - tsai_min = 0.1_r8 - else - tsai_alpha = 1.0_r8-0.5_r8*dt/dtsmonth - tsai_min = 1.0_r8 - end if - tsai_min = tsai_min * 0.5_r8 - tsai(p) = max(tsai_alpha*tsai_old+max(tlai_old-tlai(p),0._r8),tsai_min) - - if (woody(ivt(p)) == 1._r8) then - - ! trees and shrubs - - ! if shrubs have a squat taper - if (ivt(p) >= nbrdlf_evr_shrub .and. ivt(p) <= nbrdlf_dcd_brl_shrub) then - taper = 10._r8 - ! otherwise have a tall taper - else - taper = 200._r8 - end if - - ! trees and shrubs for now have a very simple allometry, with hard-wired - ! stem taper (height:radius) and hard-wired stocking density (#individuals/area) - if (use_cndv) then - - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 patch area - htop(p) = allom2(ivt(p)) * ( (24._r8 * deadstemc(p) / & - (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) )**allom3(ivt(p)) ! lpj's htop w/ cn's stemdiam - - else - htop(p) = 0._r8 - end if - - else - !correct height calculation if doing accelerated spinup - if (spinup_state == 2) then - htop(p) = ((3._r8 * deadstemc(p) * 10._r8 * taper * taper)/ & - (SHR_CONST_PI * stocking * dwood(ivt(p))))**(1._r8/3._r8) - else - htop(p) = ((3._r8 * deadstemc(p) * taper * taper)/ & - (SHR_CONST_PI * stocking * dwood(ivt(p))))**(1._r8/3._r8) - end if - - endif - - ! Peter Thornton, 5/3/2004 - ! Adding test to keep htop from getting too close to forcing height for windspeed - ! Also added for grass, below, although it is not likely to ever be an issue. - htop(p) = min(htop(p),(forc_hgt_u_patch(p)/(displar(ivt(p))+z0mr(ivt(p))))-3._r8) - - ! Peter Thornton, 8/11/2004 - ! Adding constraint to keep htop from going to 0.0. - ! This becomes an issue when fire mortality is pushing deadstemc - ! to 0.0. - htop(p) = max(htop(p), 0.01_r8) - - hbot(p) = max(0._r8, min(3._r8, htop(p)-1._r8)) - - else if (ivt(p) >= npcropmin) then ! prognostic crops - - if (tlai(p) >= laimx(ivt(p))) peaklai(p) = 1 ! used in CNAllocation - - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & - ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & - ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane) then - tsai(p) = 0.1_r8 * tlai(p) - else - tsai(p) = 0.2_r8 * tlai(p) - end if - - ! "stubble" after harvest - if (harvdate(p) < 999 .and. tlai(p) == 0._r8) then - tsai(p) = 0.25_r8*(1._r8-farea_burned(c)*0.90_r8) !changed by F. Li and S. Levis - htmx(p) = 0._r8 - peaklai(p) = 0 - end if - !if (harvdate(p) < 999 .and. tlai(p) > 0._r8) write(iulog,*) 'CNVegStructUpdate: tlai>0 after harvest!' ! remove after initial debugging? - - ! canopy top and bottom heights - htop(p) = ztopmx(ivt(p)) * (min(tlai(p)/(laimx(ivt(p))-1._r8),1._r8))**2 - htmx(p) = max(htmx(p), htop(p)) - htop(p) = max(0.05_r8, max(htmx(p),htop(p))) - hbot(p) = 0.02_r8 - - else ! generic crops and ... - - ! grasses - - ! height for grasses depends only on LAI - htop(p) = max(0.25_r8, tlai(p) * 0.25_r8) - - htop(p) = min(htop(p),(forc_hgt_u_patch(p)/(displar(ivt(p))+z0mr(ivt(p))))-3._r8) - - ! Peter Thornton, 8/11/2004 - ! Adding constraint to keep htop from going to 0.0. - htop(p) = max(htop(p), 0.01_r8) - - hbot(p) = max(0.0_r8, min(0.05_r8, htop(p)-0.20_r8)) - end if - - else - - tlai(p) = 0._r8 - tsai(p) = 0._r8 - htop(p) = 0._r8 - hbot(p) = 0._r8 - - end if - - ! adjust lai and sai for burying by snow. - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. - if (ivt(p) > noveg .and. ivt(p) <= nbrdlf_dcd_brl_shrub ) then - ol = min( max(snow_depth(c)-hbot(p), 0._r8), htop(p)-hbot(p)) - fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) - else - fb = 1._r8 - max(min(snow_depth(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed - !depth of snow required for complete burial of grasses - endif - - elai(p) = max(tlai(p)*fb, 0.0_r8) - esai(p) = max(tsai(p)*fb, 0.0_r8) - - ! Fraction of vegetation free of snow - if ((elai(p) + esai(p)) > 0._r8) then - frac_veg_nosno_alb(p) = 1 - else - frac_veg_nosno_alb(p) = 0 - end if - - end do - - end associate - - end subroutine CNVegStructUpdate - -end module CNVegStructUpdateMod diff --git a/src/biogeochem/CNVegetationFacade.F90 b/src/biogeochem/CNVegetationFacade.F90 deleted file mode 100644 index 9f555f6b14..0000000000 --- a/src/biogeochem/CNVegetationFacade.F90 +++ /dev/null @@ -1,1437 +0,0 @@ -module CNVegetationFacade - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Facade for the CN Vegetation subsystem. - ! - ! (A "facade", in software engineering terms, is a unified interface to a set of - ! interfaces in a subsystem. The facade defines a higher-level interface that makes the - ! subsystem easier to use.) - ! - ! NOTE(wjs, 2016-02-19) I envision that we will introduce an abstract base class - ! (VegBase). Then both CNVeg and EDVeg will extend VegBase. The rest of the CLM code can - ! then have an instance of VegBase, which depending on the run, can be either a CNVeg or - ! EDVeg instance. - ! - ! In addition, we probably want an implementation when running without CN or fates - i.e., - ! an SPVeg inst. This would provide implementations for get_leafn_patch, - ! get_downreg_patch, etc., so that we don't need to handle the non-cn case here (note - ! that, currently, we return NaN for most of these getters, because these arrays are - ! invalid and shouldn't be used when running in SP mode). Also, in its EcosystemDynamics - ! routine, it would call SatellitePhenology (but note that the desired interface for - ! EcosystemDynamics would be quite different... could just pass everything needed by any - ! model, and ignore unneeded arguments). Then we can get rid of comments in this module - ! like, "only call if use_cn is true", as well as use_cn conditionals in this module. - ! - ! NOTE(wjs, 2016-02-23) Currently, SatellitePhenology is called even when running with - ! CN, for the sake of dry deposition. This seems weird to me, and my gut feeling - - ! without understanding it well - is that this should be rewritten to depend on LAI from - ! CN rather than from satellite phenology. Until that is done, the separation between SP - ! and other Veg modes will be messier. - ! - ! NOTE(wjs, 2016-02-23) Currently, this class coordinates calls to soil BGC routines as - ! well as veg BGC routines (even though it doesn't contain any soil BGC types). This is - ! because CNDriver coordinates both the veg & soil BGC. We should probably split up - ! CNDriver so that there is a cleaner separation between veg BGC and soil BGC, to allow - ! easier swapping of (for example) CN and ED. At that point, this class could - ! coordinate just the calls to veg BGC routines, with a similar facade class - ! coordinating the calls to soil BGC routines. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use perf_mod , only : t_startf, t_stopf - use decompMod , only : bounds_type - use clm_varctl , only : iulog, use_cn, use_cndv, use_c13, use_c14 - use abortutils , only : endrun - use spmdMod , only : masterproc - use clm_time_manager , only : get_curr_date, get_ref_date - use clm_time_manager , only : get_nstep, is_end_curr_year, is_first_step - use CNBalanceCheckMod , only : cn_balance_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNFireMethodMod , only : cnfire_method_type - use CNProductsMod , only : cn_products_type - use NutrientCompetitionMethodMod , only : nutrient_competition_method_type - use SpeciesIsotopeType , only : species_isotope_type - use SpeciesNonIsotopeType , only : species_non_isotope_type - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use atm2lndType , only : atm2lnd_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use CropType , only : crop_type - use ch4Mod , only : ch4_type - use CNDVType , only : dgvs_type - use CNDVDriverMod , only : CNDVDriver, CNDVHIST - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use FrictionVelocityMod , only : frictionvel_type - use SoilBiogeochemStateType , only : soilBiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilBiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use CNFireEmissionsMod , only : fireemis_type, CNFireEmisUpdate - use CNDriverMod , only : CNDriverInit - use CNDriverMod , only : CNDriverSummarizeStates, CNDriverSummarizeFluxes - use CNDriverMod , only : CNDriverNoLeaching, CNDriverLeaching - use CNCStateUpdate1Mod , only : CStateUpdateDynPatch - use CNNStateUpdate1Mod , only : NStateUpdateDynPatch - use CNVegStructUpdateMod , only : CNVegStructUpdate - use CNAnnualUpdateMod , only : CNAnnualUpdate - use dynConsBiogeochemMod , only : dyn_cnbal_patch, dyn_cnbal_col - use dynCNDVMod , only : dynCNDV_init, dynCNDV_interp - use CNPrecisionControlMod , only: CNPrecisionControl - use SoilBiogeochemPrecisionControlMod , only: SoilBiogeochemPrecisionControl - ! - implicit none - private - - ! !PUBLIC TYPES: - - type, public :: cn_vegetation_type - ! FIXME(bja, 2016-06) These need to be public for use when fates is - ! turned on. Should either be moved out of here or create some ED - ! version of the facade.... - type(cnveg_state_type) :: cnveg_state_inst - type(cnveg_carbonstate_type) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) :: cnveg_carbonflux_inst - - !X!private - - type(cnveg_carbonstate_type) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) :: c14_cnveg_carbonstate_inst - type(cnveg_carbonflux_type) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) :: cnveg_nitrogenflux_inst - - type(cn_products_type) :: c_products_inst - type(cn_products_type) :: c13_products_inst - type(cn_products_type) :: c14_products_inst - type(cn_products_type) :: n_products_inst - - type(cn_balance_type) :: cn_balance_inst - class(cnfire_method_type), allocatable :: cnfire_method - type(dgvs_type) :: dgvs_inst - - ! Control variables - logical, private :: reseed_dead_plants ! Flag to indicate if should reseed dead plants when starting up the model - - ! TODO(wjs, 2016-02-19) Evaluate whether some other variables should be moved in - ! here. Whether they should be moved in depends on how tightly they are tied in with - ! the other CN Vegetation stuff. A question to ask is: Is this module used when - ! running with SP or ED? If so, then it should probably remain outside of CNVeg. - ! - ! From the clm_instMod section on "CN vegetation types": - ! - nutrient_competition_method - ! - I'm pretty sure this should be moved into here; it's just a little messy to do - ! so, because of how it's initialized (specifically, the call to readParameters - ! in clm_initializeMod). - ! - ! From the clm_instMod section on "general biogeochem types": - ! - ch4_inst - ! - probably not: really seems to belong in soilbiogeochem - ! - crop_inst - ! - dust_inst - ! - vocemis_inst - ! - fireemis_inst - ! - drydepvel_inst - - contains - procedure, public :: Init - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - procedure, public :: Restart - - procedure, public :: Init2 ! Do initialization in initialize phase, after subgrid weights are determined - procedure, public :: InitEachTimeStep ! Do initializations at the start of each time step - procedure, public :: InterpFileInputs ! Interpolate inputs from files - procedure, public :: UpdateSubgridWeights ! Update subgrid weights if running with prognostic patch weights - procedure, public :: DynamicAreaConservation ! Conserve C & N with updates in subgrid weights - procedure, public :: InitColumnBalance ! Set the starting point for col-level balance checks - procedure, public :: EcosystemDynamicsPreDrainage ! Do the main science that needs to be done before hydrology-drainage - procedure, public :: EcosystemDynamicsPostDrainage ! Do the main science that needs to be done after hydrology-drainage - procedure, public :: BalanceCheck ! Check the carbon and nitrogen balance - procedure, public :: EndOfTimeStepVegDynamics ! Do vegetation dynamics that should be done at the end of each time step - procedure, public :: WriteHistory ! Do any history writes that are specific to veg dynamics - - procedure, public :: get_net_carbon_exchange_grc ! Get gridcell-level net carbon exchange array - procedure, public :: get_leafn_patch ! Get patch-level leaf nitrogen array - procedure, public :: get_downreg_patch ! Get patch-level downregulation array - procedure, public :: get_root_respiration_patch ! Get patch-level root respiration array - procedure, public :: get_annsum_npp_patch ! Get patch-level annual sum NPP array - procedure, public :: get_agnpp_patch ! Get patch-level aboveground NPP array - procedure, public :: get_bgnpp_patch ! Get patch-level belowground NPP array - procedure, public :: get_froot_carbon_patch ! Get patch-level fine root carbon array - procedure, public :: get_croot_carbon_patch ! Get patch-level coarse root carbon array - procedure, public :: get_totvegc_col ! Get column-level total vegetation carbon array - - procedure, private :: CNReadNML ! Read in the CN general namelist - end type cn_vegetation_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds, NLFilename) - ! - ! !DESCRIPTION: - ! Initialize a CNVeg object. - ! - ! Should be called regardless of whether use_cn is true - ! - ! !USES: - use CNFireFactoryMod , only : create_cnfire_method - use clm_varcon , only : c13ratio, c14ratio - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - ! Note - always initialize the memory for cnveg_state_inst (used in biogeophys/) - call this%cnveg_state_inst%Init(bounds) - - if (use_cn) then - - ! Read in the general CN namelist - call this%CNReadNML( NLFilename ) ! MUST be called first as passes down control information to others - - call this%cnveg_carbonstate_inst%Init(bounds, carbon_type='c12', ratio=1._r8, NLFilename=NLFilename) - if (use_c13) then - call this%c13_cnveg_carbonstate_inst%Init(bounds, carbon_type='c13', ratio=c13ratio, & - NLFilename=NLFilename, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) - end if - if (use_c14) then - call this%c14_cnveg_carbonstate_inst%Init(bounds, carbon_type='c14', ratio=c14ratio, & - NLFilename=NLFilename, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) - end if - call this%cnveg_carbonflux_inst%Init(bounds, carbon_type='c12') - if (use_c13) then - call this%c13_cnveg_carbonflux_inst%Init(bounds, carbon_type='c13') - end if - if (use_c14) then - call this%c14_cnveg_carbonflux_inst%Init(bounds, carbon_type='c14') - end if - call this%cnveg_nitrogenstate_inst%Init(bounds, & - this%cnveg_carbonstate_inst%leafc_patch(begp:endp), & - this%cnveg_carbonstate_inst%leafc_storage_patch(begp:endp), & - this%cnveg_carbonstate_inst%frootc_patch(begp:endp), & - this%cnveg_carbonstate_inst%frootc_storage_patch(begp:endp), & - this%cnveg_carbonstate_inst%deadstemc_patch(begp:endp) ) - call this%cnveg_nitrogenflux_inst%Init(bounds) - - call this%c_products_inst%Init(bounds, species_non_isotope_type('C')) - if (use_c13) then - call this%c13_products_inst%Init(bounds, species_isotope_type('C', '13')) - end if - if (use_c14) then - call this%c14_products_inst%Init(bounds, species_isotope_type('C', '14')) - end if - call this%n_products_inst%Init(bounds, species_non_isotope_type('N')) - - call this%cn_balance_inst%Init(bounds) - - ! Initialize the memory for the dgvs_inst data structure regardless of whether - ! use_cndv is true so that it can be used in associate statements (nag compiler - ! complains otherwise) - call this%dgvs_inst%Init(bounds) - end if - - allocate(this%cnfire_method, & - source=create_cnfire_method(NLFilename)) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine CNReadNML( this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read in the general CN control namelist - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - character(len=*) , intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CNReadNML' - character(len=*), parameter :: nmlname = 'cn_general' ! MUST match what is in namelist below - !----------------------------------------------------------------------- - logical :: reseed_dead_plants - namelist /cn_general/ reseed_dead_plants - - reseed_dead_plants = this%reseed_dead_plants - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=cn_general, iostat=ierr) ! Namelist name here MUST be the same as in nmlname above! - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (reseed_dead_plants , mpicom) - - this%reseed_dead_plants = reseed_dead_plants - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=cn_general) ! Name here MUST be the same as in nmlname above! - write(iulog,*) ' ' - end if - - !----------------------------------------------------------------------- - - end subroutine CNReadNML - - - !----------------------------------------------------------------------- - subroutine InitAccBuffer(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for types contained here - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitAccBuffer' - !----------------------------------------------------------------------- - - if (use_cndv) then - call this%dgvs_inst%InitAccBuffer(bounds) - end if - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize variables that are associated with accumulated fields - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitAccVars' - !----------------------------------------------------------------------- - - if (use_cndv) then - call this%dgvs_inst%initAccVars(bounds) - end if - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine UpdateAccVars(this, bounds, t_a10_patch, t_ref2m_patch) - ! - ! !DESCRIPTION: - ! Update accumulated variables - ! - ! Should be called every time step - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! NOTE(wjs, 2016-02-23) These need to be pointers to agree with the interface of - ! UpdateAccVars in CNDVType (they are pointers there as a workaround for a compiler - ! bug). - real(r8), pointer , intent(in) :: t_a10_patch(:) ! 10-day running mean of the 2 m temperature (K) - real(r8), pointer , intent(in) :: t_ref2m_patch(:) ! 2 m height surface air temperature (K) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'UpdateAccVars' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(t_a10_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_ref2m_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - if (use_cndv) then - call this%dgvs_inst%UpdateAccVars(bounds, & - t_a10_patch = t_a10_patch, & - t_ref2m_patch = t_ref2m_patch) - end if - - end subroutine UpdateAccVars - - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Handle restart (read / write) for CNVeg - ! - ! Should be called regardless of whether use_cn is true - ! - ! !USES: - use ncdio_pio, only : file_desc_t - use clm_varcon, only : c3_r2, c14ratio - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - integer :: reseed_patch(bounds%endp-bounds%begp+1) - integer :: num_reseed_patch - ! - ! !LOCAL VARIABLES: - - integer :: begp, endp - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - if (use_cn) then - begp = bounds%begp - endp = bounds%endp - call this%cnveg_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c12', & - reseed_dead_plants=this%reseed_dead_plants, filter_reseed_patch=reseed_patch, & - num_reseed_patch=num_reseed_patch ) - if ( flag /= 'read' .and. num_reseed_patch /= 0 )then - call endrun(msg="ERROR num_reseed should be zero and is not"//errmsg(sourcefile, __LINE__)) - end if - if (use_c13) then - call this%c13_cnveg_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c13', & - reseed_dead_plants=this%reseed_dead_plants, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) - end if - if (use_c14) then - call this%c14_cnveg_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c14', & - reseed_dead_plants=this%reseed_dead_plants, c12_cnveg_carbonstate_inst=this%cnveg_carbonstate_inst) - end if - - call this%cnveg_carbonflux_inst%restart(bounds, ncid, flag=flag, carbon_type='c12') - if (use_c13) then - call this%c13_cnveg_carbonflux_inst%restart(bounds, ncid, flag=flag, carbon_type='c13') - end if - if (use_c14) then - call this%c14_cnveg_carbonflux_inst%restart(bounds, ncid, flag=flag, carbon_type='c14') - end if - - call this%cnveg_nitrogenstate_inst%restart(bounds, ncid, flag=flag, & - leafc_patch=this%cnveg_carbonstate_inst%leafc_patch(begp:endp), & - leafc_storage_patch=this%cnveg_carbonstate_inst%leafc_storage_patch(begp:endp), & - frootc_patch=this%cnveg_carbonstate_inst%frootc_patch(begp:endp), & - frootc_storage_patch=this%cnveg_carbonstate_inst%frootc_storage_patch(begp:endp), & - deadstemc_patch=this%cnveg_carbonstate_inst%deadstemc_patch(begp:endp), & - filter_reseed_patch=reseed_patch, num_reseed_patch=num_reseed_patch) - call this%cnveg_nitrogenflux_inst%restart(bounds, ncid, flag=flag) - call this%cnveg_state_inst%restart(bounds, ncid, flag=flag, & - cnveg_carbonstate=this%cnveg_carbonstate_inst, & - cnveg_nitrogenstate=this%cnveg_nitrogenstate_inst, & - filter_reseed_patch=reseed_patch, num_reseed_patch=num_reseed_patch) - - call this%c_products_inst%restart(bounds, ncid, flag) - if (use_c13) then - call this%c13_products_inst%restart(bounds, ncid, flag, & - template_for_missing_fields = this%c_products_inst, & - template_multiplier = c3_r2) - end if - if (use_c14) then - call this%c14_products_inst%restart(bounds, ncid, flag, & - template_for_missing_fields = this%c_products_inst, & - template_multiplier = c14ratio) - end if - call this%n_products_inst%restart(bounds, ncid, flag) - - end if - - if (use_cndv) then - call this%dgvs_inst%Restart(bounds, ncid, flag=flag) - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine Init2(this, bounds, NLFilename) - ! - ! !DESCRIPTION: - ! Do initialization that is needed in the initialize phase, after subgrid weights are - ! determined - ! - ! Should only be called if use_cn is true - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! namelist filename - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init2' - !----------------------------------------------------------------------- - - call CNDriverInit(bounds, NLFilename, this%cnfire_method) - - if (use_cndv) then - call dynCNDV_init(bounds, this%dgvs_inst) - end if - - end subroutine Init2 - - - !----------------------------------------------------------------------- - subroutine InitEachTimeStep(this, bounds, num_soilc, filter_soilc) - ! - ! !DESCRIPTION: - ! Do initializations that need to be done at the start of every time step - ! - ! This includes zeroing fluxes - ! - ! Should only be called if use_cn is true - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitEachTimeStep' - !----------------------------------------------------------------------- - - call this%cnveg_carbonflux_inst%ZeroDWT(bounds) - if (use_c13) then - call this%c13_cnveg_carbonflux_inst%ZeroDWT(bounds) - end if - if (use_c14) then - call this%c14_cnveg_carbonflux_inst%ZeroDWT(bounds) - end if - call this%cnveg_nitrogenflux_inst%ZeroDWT(bounds) - call this%cnveg_carbonstate_inst%ZeroDWT(bounds) - call this%cnveg_nitrogenstate_inst%ZeroDWT(bounds) - - end subroutine InitEachTimeStep - - !----------------------------------------------------------------------- - subroutine InterpFileInputs(this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate inputs from files - ! - ! NOTE(wjs, 2016-02-23) Stuff done here could probably be done at the end of - ! InitEachTimeStep, rather than in this separate routine, except for the fact that - ! (currently) this Interp stuff is done with proc bounds rather thna clump bounds. I - ! think that is needed so that you don't update a given stream multiple times. If we - ! rework the handling of threading / clumps so that there is a separate object for - ! each clump, then I think this problem would disappear - at which point we could - ! remove this Interp routine, moving its body to the end of InitEachTimeStep. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InterpFileInputs' - !----------------------------------------------------------------------- - - call this%cnfire_method%CNFireInterp(bounds) - - end subroutine InterpFileInputs - - - !----------------------------------------------------------------------- - subroutine UpdateSubgridWeights(this, bounds) - ! - ! !DESCRIPTION: - ! Update subgrid weights if running with prognostic patch weights - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'UpdateSubgridWeights' - !----------------------------------------------------------------------- - - if (use_cndv) then - call dynCNDV_interp(bounds, this%dgvs_inst) - end if - - end subroutine UpdateSubgridWeights - - - !----------------------------------------------------------------------- - subroutine DynamicAreaConservation(this, bounds, clump_index, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - num_soilc_with_inactive, filter_soilc_with_inactive, & - prior_weights, patch_state_updater, column_state_updater, & - canopystate_inst, photosyns_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst, ch4_inst, soilbiogeochem_state_inst) - ! - ! !DESCRIPTION: - ! Conserve C & N with updates in subgrid weights - ! - ! Should only be called if use_cn is true - ! - ! !USES: - use dynPriorWeightsMod , only : prior_weights_type - use dynPatchStateUpdaterMod, only : patch_state_updater_type - use dynColumnStateUpdaterMod, only : column_state_updater_type - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - integer , intent(in) :: num_soilp_with_inactive ! number of points in filter_soilp_with_inactive - integer , intent(in) :: filter_soilp_with_inactive(:) ! soil patch filter that includes inactive points - integer , intent(in) :: num_soilc_with_inactive ! number of points in filter_soilc_with_inactive - integer , intent(in) :: filter_soilc_with_inactive(:) ! soil column filter that includes inactive points - type(prior_weights_type) , intent(in) :: prior_weights ! weights prior to the subgrid weight updates - type(patch_state_updater_type) , intent(in) :: patch_state_updater - type(column_state_updater_type) , intent(in) :: column_state_updater - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(ch4_type) , intent(inout) :: ch4_inst - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'DynamicAreaConservation' - !----------------------------------------------------------------------- - - call t_startf('dyn_cnbal_patch') - call dyn_cnbal_patch(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - prior_weights, patch_state_updater, & - canopystate_inst, photosyns_inst, & - this%cnveg_state_inst, & - this%cnveg_carbonstate_inst, this%c13_cnveg_carbonstate_inst, this%c14_cnveg_carbonstate_inst, & - this%cnveg_carbonflux_inst, this%c13_cnveg_carbonflux_inst, this%c14_cnveg_carbonflux_inst, & - this%cnveg_nitrogenstate_inst, this%cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_state_inst) - call t_stopf('dyn_cnbal_patch') - - ! It is important to update column-level state variables based on the fluxes - ! generated by dyn_cnbal_patch (which handles the change in aboveground / patch-level - ! C/N due to shrinking patches), before calling dyn_cnbal_col (which handles the - ! change in belowground / column-level C/N due to changing column areas). This way, - ! any aboveground biomass which is sent to litter or soil due to shrinking patch - ! areas is accounted for by the column-level conservation. This is important if - ! column weights on the grid cell are changing at the same time as patch weights on - ! the grid cell (which will typically be the case when columns change in area). - ! - ! The filters here need to include inactive points as well as active points so that - ! we correctly update column states in columns that have just shrunk to 0 area - - ! since those column states are still important in the following dyn_cnbal_col. - call t_startf('CNUpdateDynPatch') - call CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst, & - soilbiogeochem_carbonstate_inst) - if (use_c13) then - call CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - this%c13_cnveg_carbonflux_inst, this%c13_cnveg_carbonstate_inst, & - soilbiogeochem_carbonstate_inst) - end if - if (use_c14) then - call CStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - this%c14_cnveg_carbonflux_inst, this%c14_cnveg_carbonstate_inst, & - soilbiogeochem_carbonstate_inst) - end if - call NStateUpdateDynPatch(bounds, num_soilc_with_inactive, filter_soilc_with_inactive, & - this%cnveg_nitrogenflux_inst, this%cnveg_nitrogenstate_inst, & - soilbiogeochem_nitrogenstate_inst) - call t_stopf('CNUpdateDynPatch') - - call t_startf('dyn_cnbal_col') - call dyn_cnbal_col(bounds, clump_index, column_state_updater, & - soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, soilbiogeochem_nitrogenstate_inst, & - ch4_inst) - call t_stopf('dyn_cnbal_col') - - end subroutine DynamicAreaConservation - - !----------------------------------------------------------------------- - subroutine InitColumnBalance(this, bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Set the starting point for column-level balance checks. - ! - ! This should be called after DynamicAreaConservation, since the changes made by - ! DynamicAreaConservation can break column-level conservation checks. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitColumnBalance' - !----------------------------------------------------------------------- - - call CNDriverSummarizeStates(bounds, & - num_allc, filter_allc, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - this%cnveg_carbonstate_inst, & - this%c13_cnveg_carbonstate_inst, & - this%c14_cnveg_carbonstate_inst, & - this%cnveg_nitrogenstate_inst, & - soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst) - - call this%cn_balance_inst%BeginCNBalance( & - bounds, num_soilc, filter_soilc, & - this%cnveg_carbonstate_inst, this%cnveg_nitrogenstate_inst) - - end subroutine InitColumnBalance - - - !----------------------------------------------------------------------- - subroutine EcosystemDynamicsPreDrainage(this, bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - num_pcropp, filter_pcropp, & - doalb, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, fireemis_inst) - ! - ! !DESCRIPTION: - ! Do the main science for CN vegetation that needs to be done before hydrology-drainage - ! - ! Should only be called if use_cn is true - ! - ! !USES: - - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter - integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches - logical , intent(in) :: doalb ! true = surface albedo calculation time step - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(crop_type) , intent(inout) :: crop_inst - type(ch4_type) , intent(in) :: ch4_inst - type(photosyns_type) , intent(in) :: photosyns_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(energyflux_type) , intent(in) :: energyflux_inst - class(nutrient_competition_method_type) , intent(inout) :: nutrient_competition_method - type(fireemis_type) , intent(inout) :: fireemis_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'EcosystemDynamicsPreDrainage' - !----------------------------------------------------------------------- - - call crop_inst%CropIncrementYear(num_pcropp, filter_pcropp) - - call CNDriverNoLeaching(bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - num_pcropp, filter_pcropp, doalb, & - this%cnveg_state_inst, & - this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst, & - this%c13_cnveg_carbonflux_inst, this%c13_cnveg_carbonstate_inst, & - this%c14_cnveg_carbonflux_inst, this%c14_cnveg_carbonstate_inst, & - this%cnveg_nitrogenflux_inst, this%cnveg_nitrogenstate_inst, & - this%c_products_inst, this%c13_products_inst, this%c14_products_inst, & - this%n_products_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - this%dgvs_inst, photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, this%cnfire_method) - - ! fire carbon emissions - call CNFireEmisUpdate(bounds, num_soilp, filter_soilp, & - this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst, fireemis_inst ) - - call CNAnnualUpdate(bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - this%cnveg_state_inst, this%cnveg_carbonflux_inst) - - end subroutine EcosystemDynamicsPreDrainage - - !----------------------------------------------------------------------- - subroutine EcosystemDynamicsPostDrainage(this, bounds, num_allc, filter_allc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, doalb, crop_inst, & - waterstate_inst, waterflux_inst, frictionvel_inst, canopystate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! Do the main science for CN vegetation that needs to be done after hydrology-drainage - ! - ! Should only be called if use_cn is true - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - logical , intent(in) :: doalb ! true = surface albedo calculation time step - type(crop_type) , intent(in) :: crop_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'EcosystemDynamicsPostDrainage' - !----------------------------------------------------------------------- - - ! Update the nitrogen leaching rate as a function of soluble mineral N - ! and total soil water outflow. - - call CNDriverLeaching(bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - waterstate_inst, waterflux_inst, & - this%cnveg_nitrogenflux_inst, this%cnveg_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - - ! Set controls on very low values in critical state variables - - call t_startf('CNPrecisionControl') - call CNPrecisionControl(bounds, num_soilp, filter_soilp, & - this%cnveg_carbonstate_inst, this%c13_cnveg_carbonstate_inst, & - this%c14_cnveg_carbonstate_inst, this%cnveg_nitrogenstate_inst) - call t_stopf('CNPrecisionControl') - - call t_startf('SoilBiogeochemPrecisionControl') - call SoilBiogeochemPrecisionControl(num_soilc, filter_soilc, & - soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst,soilbiogeochem_nitrogenstate_inst) - call t_stopf('SoilBiogeochemPrecisionControl') - - ! Call to all CN summary routines - - call CNDriverSummarizeStates(bounds, & - num_allc, filter_allc, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - this%cnveg_carbonstate_inst, & - this%c13_cnveg_carbonstate_inst, & - this%c14_cnveg_carbonstate_inst, & - this%cnveg_nitrogenstate_inst, & - soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst) - - call CNDriverSummarizeFluxes(bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - this%cnveg_carbonflux_inst, & - this%c13_cnveg_carbonflux_inst, & - this%c14_cnveg_carbonflux_inst, & - this%cnveg_nitrogenflux_inst, & - this%c_products_inst, this%c13_products_inst, this%c14_products_inst, & - soilbiogeochem_carbonflux_inst, & - c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenflux_inst) - - ! On the radiation time step, use C state variables to calculate - ! vegetation structure (LAI, SAI, height) - - if (doalb) then - call CNVegStructUpdate(num_soilp, filter_soilp, & - waterstate_inst, frictionvel_inst, this%dgvs_inst, this%cnveg_state_inst, & - crop_inst, this%cnveg_carbonstate_inst, canopystate_inst) - end if - - end subroutine EcosystemDynamicsPostDrainage - - !----------------------------------------------------------------------- - subroutine BalanceCheck(this, bounds, num_soilc, filter_soilc, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Check the carbon and nitrogen balance - ! - ! Should only be called if use_cn is true - ! - ! !USES: - use clm_time_manager , only : get_nstep_since_startup_or_lastDA_restart_or_pause - ! - ! !ARGUMENTS: - class(cn_vegetation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: DA_nstep ! time step number - - character(len=*), parameter :: subname = 'BalanceCheck' - !----------------------------------------------------------------------- - - DA_nstep = get_nstep_since_startup_or_lastDA_restart_or_pause() - if (DA_nstep < 2 )then - if (masterproc) then - write(iulog,*) '--WARNING-- skipping CN balance check for first timesteps after startup or data assimilation' - end if - else - - call this%cn_balance_inst%CBalanceCheck( & - bounds, num_soilc, filter_soilc, & - soilbiogeochem_carbonflux_inst, & - this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst) - - call this%cn_balance_inst%NBalanceCheck( & - bounds, num_soilc, filter_soilc, & - soilbiogeochem_nitrogenflux_inst, & - this%cnveg_nitrogenflux_inst, this%cnveg_nitrogenstate_inst) - - end if - - end subroutine BalanceCheck - - !----------------------------------------------------------------------- - subroutine EndOfTimeStepVegDynamics(this, bounds, num_natvegp, filter_natvegp, & - atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Do vegetation dynamics that should be done at the end of each time step - ! - ! Should only be called if use_cn is true - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(inout) :: num_natvegp ! number of naturally-vegetated patches in filter - integer , intent(inout) :: filter_natvegp(:) ! filter for naturally-vegetated patches - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst - ! - ! !LOCAL VARIABLES: - integer :: nstep ! time step number - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - integer :: ncdate ! current date - integer :: nbdate ! base date (reference date) - integer :: kyr ! thousand years, equals 2 at end of first year - - character(len=*), parameter :: subname = 'EndOfTimeStepVegDynamics' - !----------------------------------------------------------------------- - - if (use_cndv) then - ! Call dv (dynamic vegetation) at last time step of year - - call t_startf('d2dgvm') - if (is_end_curr_year() .and. .not. is_first_step()) then - - ! Get date info. kyr is used in lpj(). At end of first year, kyr = 2. - call get_curr_date(yr, mon, day, sec) - ncdate = yr*10000 + mon*100 + day - call get_ref_date(yr, mon, day, sec) - nbdate = yr*10000 + mon*100 + day - kyr = ncdate/10000 - nbdate/10000 + 1 - - if (masterproc) then - nstep = get_nstep() - write(iulog,*) 'End of year. CNDV called now: ncdate=', & - ncdate,' nbdate=',nbdate,' kyr=',kyr,' nstep=', nstep - end if - - call CNDVDriver(bounds, & - num_natvegp, filter_natvegp, kyr, & - atm2lnd_inst, & - this%cnveg_carbonflux_inst, this%cnveg_carbonstate_inst, this%dgvs_inst) - end if - call t_stopf('d2dgvm') - end if - - end subroutine EndOfTimeStepVegDynamics - - !----------------------------------------------------------------------- - subroutine WriteHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Do any history writes that are specific to vegetation dynamics - ! - ! NOTE(wjs, 2016-02-23) This could probably be combined with - ! EndOfTimeStepVegDynamics, except for the fact that (currently) history writes are - ! done with proc bounds rather than clump bounds. If that were changed, then the body - ! of this could be moved into EndOfTimeStepVegDynamics, inside a "if (.not. - ! use_noio)" conditional. - ! - ! Should only be called if use_cn is true - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'WriteHistory' - !----------------------------------------------------------------------- - - ! Write to CNDV history buffer if appropriate - if (use_cndv) then - if (is_end_curr_year() .and. .not. is_first_step()) then - call t_startf('clm_drv_io_hdgvm') - call CNDVHist( bounds, this%dgvs_inst ) - if (masterproc) write(iulog,*) 'Annual CNDV calculations are complete' - call t_stopf('clm_drv_io_hdgvm') - end if - end if - - end subroutine WriteHistory - - - !----------------------------------------------------------------------- - function get_net_carbon_exchange_grc(this, bounds) result(net_carbon_exchange_grc) - ! - ! !DESCRIPTION: - ! Get gridcell-level net carbon exchange array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: net_carbon_exchange_grc(bounds%begg:bounds%endg) ! function result: net carbon exchange between land and atmosphere, includes fire, landuse, harvest and hrv_xsmrpool flux, positive for source (gC/m2/s) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_net_carbon_exchange_grc' - !----------------------------------------------------------------------- - - if (use_cn) then - net_carbon_exchange_grc(bounds%begg:bounds%endg) = & - -this%cnveg_carbonflux_inst%nbp_grc(bounds%begg:bounds%endg) - else - net_carbon_exchange_grc(bounds%begg:bounds%endg) = 0._r8 - end if - - end function get_net_carbon_exchange_grc - - - !----------------------------------------------------------------------- - function get_leafn_patch(this, bounds) result(leafn_patch) - ! - ! !DESCRIPTION: - ! Get patch-level leaf nitrogen array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: leafn_patch(bounds%begp:bounds%endp) ! function result: leaf N (gN/m2) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_leafn_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - leafn_patch(bounds%begp:bounds%endp) = & - this%cnveg_nitrogenstate_inst%leafn_patch(bounds%begp:bounds%endp) - else - leafn_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_leafn_patch - - !----------------------------------------------------------------------- - function get_downreg_patch(this, bounds) result(downreg_patch) - ! - ! !DESCRIPTION: - ! Get patch-level downregulation array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: downreg_patch(bounds%begp:bounds%endp) ! function result: fractional reduction in GPP due to N limitation (dimensionless) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_downreg_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - downreg_patch(bounds%begp:bounds%endp) = & - this%cnveg_state_inst%downreg_patch(bounds%begp:bounds%endp) - else - downreg_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_downreg_patch - - !----------------------------------------------------------------------- - function get_root_respiration_patch(this, bounds) result(root_respiration_patch) - ! - ! !DESCRIPTION: - ! Get patch-level root respiration array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: root_respiration_patch(bounds%begp:bounds%endp) ! function result: root respiration (fine root MR + total root GR) (gC/m2/s) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_root_respiration_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - root_respiration_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonflux_inst%rr_patch(bounds%begp:bounds%endp) - else - root_respiration_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_root_respiration_patch - - ! TODO(wjs, 2016-02-19) annsum_npp, agnpp and bgnpp are all needed for the estimation - ! of tillers in ch4Mod. Rather than providing getters for these three things so that - ! ch4Mod can estimate tillers, it would probably be better if the tiller estimation - ! algorithm was moved into some CNVeg-specific module, and then tillers could be - ! queried directly. - - !----------------------------------------------------------------------- - function get_annsum_npp_patch(this, bounds) result(annsum_npp_patch) - ! - ! !DESCRIPTION: - ! Get patch-level annual sum NPP array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: annsum_npp_patch(bounds%begp:bounds%endp) ! function result: annual sum NPP (gC/m2/yr) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_annsum_npp_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - annsum_npp_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonflux_inst%annsum_npp_patch(bounds%begp:bounds%endp) - else - annsum_npp_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_annsum_npp_patch - - !----------------------------------------------------------------------- - function get_agnpp_patch(this, bounds) result(agnpp_patch) - ! - ! !DESCRIPTION: - ! Get patch-level aboveground NPP array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: agnpp_patch(bounds%begp:bounds%endp) ! function result: aboveground NPP (gC/m2/s) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_agnpp_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - agnpp_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonflux_inst%agnpp_patch(bounds%begp:bounds%endp) - else - agnpp_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_agnpp_patch - - !----------------------------------------------------------------------- - function get_bgnpp_patch(this, bounds) result(bgnpp_patch) - ! - ! !DESCRIPTION: - ! Get patch-level belowground NPP array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: bgnpp_patch(bounds%begp:bounds%endp) ! function result: belowground NPP (gC/m2/s) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_bgnpp_patch' - !----------------------------------------------------------------------- - - if (use_cn) then - bgnpp_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonflux_inst%bgnpp_patch(bounds%begp:bounds%endp) - else - bgnpp_patch(bounds%begp:bounds%endp) = nan - end if - - end function get_bgnpp_patch - - !----------------------------------------------------------------------- - function get_froot_carbon_patch(this, bounds, tlai) result(froot_carbon_patch) - ! - ! !DESCRIPTION: - ! Get patch-level fine root carbon array - ! - ! !USES: - use pftconMod , only : pftcon - use PatchType , only : patch - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) , intent(in) :: tlai( bounds%begp: ) - real(r8) :: froot_carbon_patch(bounds%begp:bounds%endp) ! function result: (gC/m2) - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: subname = 'get_froot_carbon_patch' - integer :: p - !----------------------------------------------------------------------- - - if (use_cn) then - froot_carbon_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonstate_inst%frootc_patch(bounds%begp:bounds%endp) - else -! To get leaf biomass: -! bleaf = LAI / slatop -! g/m2 = m2/m2 / m2/g -! To get root biomass: -! broot = bleaf * froot_leaf(ivt(p)) -! g/m2 = g/m2 * g/g - do p=bounds%begp, bounds%endp - if (pftcon%slatop(patch%itype(p)) > 0._r8) then - froot_carbon_patch(p) = tlai(p) & - / pftcon%slatop(patch%itype(p)) & - *pftcon%froot_leaf(patch%itype(p)) - else - froot_carbon_patch(p) = 0._r8 - endif - enddo - end if - - end function get_froot_carbon_patch - - !----------------------------------------------------------------------- - function get_croot_carbon_patch(this, bounds, tlai) result(croot_carbon_patch) - ! - ! !DESCRIPTION: - ! Get patch-level live coarse root carbon array - ! - ! !USES: - use pftconMod , only : pftcon - use PatchType , only : patch - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) , intent(in) :: tlai( bounds%begp: ) - real(r8) :: croot_carbon_patch(bounds%begp:bounds%endp) ! function result: (gC/m2) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_croot_carbon_patch' - integer :: p - !----------------------------------------------------------------------- - - if (use_cn) then - croot_carbon_patch(bounds%begp:bounds%endp) = & - this%cnveg_carbonstate_inst%livecrootc_patch(bounds%begp:bounds%endp) - else -! To get leaf biomass: -! bleaf = LAI / slatop -! g/m2 = m2/m2 / m2/g -! To get root biomass: -! broot = bleaf * froot_leaf(ivt(p)) -! g/m2 = g/m2 * g/g - do p=bounds%begp, bounds%endp - if (pftcon%slatop(patch%itype(p)) > 0._r8) then - croot_carbon_patch(p) = tlai(p) & - / pftcon%slatop(patch%itype(p)) & - *pftcon%stem_leaf(patch%itype(p)) & - *pftcon%croot_stem(patch%itype(p)) - else - croot_carbon_patch(p) = 0._r8 - endif - enddo - end if - - end function get_croot_carbon_patch - - !----------------------------------------------------------------------- - function get_totvegc_col(this, bounds) result(totvegc_col) - ! - ! !DESCRIPTION: - ! Get column-level total vegetation carbon array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(cn_vegetation_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8) :: totvegc_col(bounds%begc:bounds%endc) ! function result: (gC/m2) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_totvegc_col' - !----------------------------------------------------------------------- - - if (use_cn) then - totvegc_col(bounds%begc:bounds%endc) = & - this%cnveg_carbonstate_inst%totvegc_col(bounds%begc:bounds%endc) - else - totvegc_col(bounds%begc:bounds%endc) = nan - end if - - end function get_totvegc_col - - -end module CNVegetationFacade diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 deleted file mode 100644 index eaed486bc5..0000000000 --- a/src/biogeochem/CropType.F90 +++ /dev/null @@ -1,723 +0,0 @@ -module CropType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing variables needed for the crop model - ! - ! TODO(wjs, 2014-08-05) Move more crop-specific variables into here - many are - ! currently in CNVegStateType - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varcon , only : spval - use clm_varctl , only : iulog, use_crop - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC DATA TYPES: - ! - ! Crop state variables structure - type, public :: crop_type - - ! Note that cropplant and harvdate could be 2D to facilitate rotation - integer , pointer :: nyrs_crop_active_patch (:) ! number of years this crop patch has been active (0 for non-crop patches) - logical , pointer :: croplive_patch (:) ! patch Flag, true if planted, not harvested - logical , pointer :: cropplant_patch (:) ! patch Flag, true if planted - integer , pointer :: harvdate_patch (:) ! patch harvest date - real(r8), pointer :: fertnitro_patch (:) ! patch fertilizer nitrogen - real(r8), pointer :: gddplant_patch (:) ! patch accum gdd past planting date for crop (ddays) - real(r8), pointer :: gddtsoi_patch (:) ! patch growing degree-days from planting (top two soil layers) (ddays) - real(r8), pointer :: vf_patch (:) ! patch vernalization factor for cereal - real(r8), pointer :: cphase_patch (:) ! phenology phase - real(r8), pointer :: latbaset_patch (:) ! Latitude vary baset for gddplant (degree C) - character(len=20) :: baset_mapping - real(r8) :: baset_latvary_intercept - real(r8) :: baset_latvary_slope - - contains - ! Public routines - procedure, public :: Init ! Initialize the crop type - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: Restart - procedure, public :: ReadNML ! Read in the crop namelist - - ! NOTE(wjs, 2014-09-29) need to rename this from UpdateAccVars to CropUpdateAccVars - ! to prevent cryptic error messages with pgi (v. 13.9 on yellowstone) - ! This is probably related to this bug - ! , which was fixed in pgi 14.7. - procedure, public :: CropUpdateAccVars - - procedure, public :: CropIncrementYear - - ! Private routines - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, private, nopass :: checkDates - - end type crop_type - - character(len=*), parameter, private :: baset_map_constant = 'constant' - character(len=*), parameter, private :: baset_map_latvary = 'varytropicsbylat' - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !------------------------------------------------------------------------ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! - ! !ARGUMENTS: - class(crop_type) , intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - - if (use_crop) then - call this%InitHistory(bounds) - call this%InitCold(bounds) - end if - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine ReadNML(this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CropType - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(crop_type) , intent(inout) :: this - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'Crop::ReadNML' - character(len=*), parameter :: nmlname = 'crop' - !----------------------------------------------------------------------- - character(len=20) :: baset_mapping - real(r8) :: baset_latvary_intercept - real(r8) :: baset_latvary_slope - namelist /crop/ baset_mapping, baset_latvary_intercept, baset_latvary_slope - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - baset_mapping = 'constant' - baset_latvary_intercept = 12._r8 - baset_latvary_slope = 0.4_r8 - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=crop, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (baset_mapping , mpicom) - call shr_mpi_bcast (baset_latvary_intercept , mpicom) - call shr_mpi_bcast (baset_latvary_slope , mpicom) - - this%baset_mapping = baset_mapping - this%baset_latvary_intercept = baset_latvary_intercept - this%baset_latvary_slope = baset_latvary_slope - if ( trim(this%baset_mapping) == baset_map_constant ) then - if ( masterproc ) write(iulog,*) 'baset mapping for ALL crops are constant' - else if ( trim(this%baset_mapping) == baset_map_latvary ) then - if ( masterproc ) write(iulog,*) 'baset mapping for crops vary with latitude' - else - call endrun(msg="Bad value for baset_mapping in "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=crop) - write(iulog,*) ' ' - end if - - !----------------------------------------------------------------------- - - end subroutine ReadNML - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! !USES: - ! - ! !ARGUMENTS: - class(crop_type) , intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - allocate(this%nyrs_crop_active_patch(begp:endp)) ; this%nyrs_crop_active_patch(:) = 0 - allocate(this%croplive_patch (begp:endp)) ; this%croplive_patch (:) = .false. - allocate(this%cropplant_patch(begp:endp)) ; this%cropplant_patch(:) = .false. - allocate(this%harvdate_patch (begp:endp)) ; this%harvdate_patch (:) = huge(1) - allocate(this%fertnitro_patch (begp:endp)) ; this%fertnitro_patch (:) = spval - allocate(this%gddplant_patch (begp:endp)) ; this%gddplant_patch (:) = spval - allocate(this%gddtsoi_patch (begp:endp)) ; this%gddtsoi_patch (:) = spval - allocate(this%vf_patch (begp:endp)) ; this%vf_patch (:) = 0.0_r8 - allocate(this%cphase_patch (begp:endp)) ; this%cphase_patch (:) = 0.0_r8 - allocate(this%latbaset_patch (begp:endp)) ; this%latbaset_patch (:) = spval - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(crop_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - this%fertnitro_patch(begp:endp) = spval - call hist_addfld1d (fname='FERTNITRO', units='gN/m2/yr', & - avgflag='A', long_name='Nitrogen fertilizer for each crop', & - ptr_patch=this%fertnitro_patch, default='inactive') - - this%gddplant_patch(begp:endp) = spval - call hist_addfld1d (fname='GDDPLANT', units='ddays', & - avgflag='A', long_name='Accumulated growing degree days past planting date for crop', & - ptr_patch=this%gddplant_patch, default='inactive') - - this%gddtsoi_patch(begp:endp) = spval - call hist_addfld1d (fname='GDDTSOI', units='ddays', & - avgflag='A', long_name='Growing degree-days from planting (top two soil layers)', & - ptr_patch=this%gddtsoi_patch, default='inactive') - - this%cphase_patch(begp:endp) = spval - call hist_addfld1d (fname='CPHASE', units='0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest', & - avgflag='A', long_name='crop phenology phase', & - ptr_patch=this%cphase_patch, default='active') - - if ( (trim(this%baset_mapping) == baset_map_latvary) )then - this%latbaset_patch(begp:endp) = spval - call hist_addfld1d (fname='LATBASET', units='degree C', & - avgflag='A', long_name='latitude vary base temperature for gddplant', & - ptr_patch=this%latbaset_patch, default='inactive') - end if - - end subroutine InitHistory - - subroutine InitCold(this, bounds) - ! !USES: - use LandunitType, only : lun - use landunit_varcon, only : istcrop - use PatchType, only : patch - use clm_instur, only : fert_cft - use pftconMod , only : pftcon - use GridcellType , only : grc - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! !ARGUMENTS: - class(crop_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c, l, g, p, m, ivt ! indices - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - -!DLL - added wheat & sugarcane restrictions to base T vary by lat - do p= bounds%begp,bounds%endp - g = patch%gridcell(p) - ivt = patch%itype(p) - - this%nyrs_crop_active_patch(p) = 0 - - if ( grc%latdeg(g) >= 0.0_r8 .and. grc%latdeg(g) <= 30.0_r8) then - this%latbaset_patch(p)=pftcon%baset(ivt)+12._r8-0.4_r8*grc%latdeg(g) - else if (grc%latdeg(g) < 0.0_r8 .and. grc%latdeg(g) >= -30.0_r8) then - this%latbaset_patch(p)=pftcon%baset(ivt)+12._r8+0.4_r8*grc%latdeg(g) - else - this%latbaset_patch(p)=pftcon%baset(ivt) - end if - if ( trim(this%baset_mapping) == baset_map_constant ) then - this%latbaset_patch(p) = nan - end if - end do -!DLL -- end of mods - - if (use_crop) then - do p= bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - c = patch%column(p) - - if (lun%itype(l) == istcrop) then - m = patch%itype(p) - this%fertnitro_patch(p) = fert_cft(g,m) - end if - end do - end if - - end subroutine InitCold - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! Each interval and accumulation type is unique to each field processed. - ! Routine [initAccBuffer] defines the fields to be processed - ! and the type of accumulation. - ! Routine [updateAccVars] does the actual accumulation for a given field. - ! Fields are accumulated by calls to subroutine [update_accum_field]. - ! To accumulate a field, it must first be defined in subroutine [initAccVars] - ! and then accumulated by calls to [updateAccVars]. - ! - ! Should only be called if use_crop is true - ! - ! !USES - use accumulMod , only : init_accum_field - ! - ! !ARGUMENTS: - class(crop_type) , intent(in) :: this - type(bounds_type), intent(in) :: bounds - - ! - ! !LOCAL VARIABLES: - integer, parameter :: not_used = huge(1) - - !--------------------------------------------------------------------- - - call init_accum_field (name='GDDPLANT', units='K', & - desc='growing degree-days from planting', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDDTSOI', units='K', & - desc='growing degree-days from planting (top two soil layers)', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES: - use accumulMod , only : extract_accum_field - use clm_time_manager , only : get_nstep - ! - ! !ARGUMENTS: - class(crop_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: nstep - integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary - - character(len=*), parameter :: subname = 'InitAccVars' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg=" allocation error for rbufslp"//& - errMsg(sourcefile, __LINE__)) - endif - - nstep = get_nstep() - - call extract_accum_field ('GDDPLANT', rbufslp, nstep) - this%gddplant_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('GDDTSOI', rbufslp, nstep) - this%gddtsoi_patch(begp:endp) = rbufslp(begp:endp) - - deallocate(rbufslp) - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use restUtilMod - use ncdio_pio - use PatchType, only : patch - use pftconMod, only : npcropmin, npcropmax - ! - ! !ARGUMENTS: - class(crop_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - ! - ! !LOCAL VARIABLES: - integer, pointer :: temp1d(:) ! temporary - integer :: restyear - integer :: p - logical :: readvar ! determine if variable is on initial file - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='nyrs_crop_active', xtype=ncd_int, & - dim1name='pft', & - long_name='Number of years this crop patch has been active (0 for non-crop patches)', & - units='years', & - interpinic_flag='interp', readvar=readvar, data=this%nyrs_crop_active_patch) - if (flag == 'read' .and. .not. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2017-02-17) Old restart files did not have this - ! patch-level variable. Instead, they had a single scalar tracking the number - ! of years the crop model ran. Copy this scalar onto all *active* crop patches. - - ! Some arguments in the following restartvar call are irrelevant, because we - ! only call this for 'read'. I'm simply maintaining the old restartvar call. - call restartvar(ncid=ncid, flag=flag, varname='restyear', xtype=ncd_int, & - long_name='Number of years prognostic crop ran', units="years", & - interpinic_flag='copy', readvar=readvar, data=restyear) - if (readvar) then - do p = bounds%begp, bounds%endp - if (patch%itype(p) >= npcropmin .and. patch%itype(p) <= npcropmax .and. & - patch%active(p)) then - this%nyrs_crop_active_patch(p) = restyear - end if - end do - end if - end if - - allocate(temp1d(bounds%begp:bounds%endp)) - if (flag == 'write') then - do p= bounds%begp,bounds%endp - if (this%croplive_patch(p)) then - temp1d(p) = 1 - else - temp1d(p) = 0 - end if - end do - end if - call restartvar(ncid=ncid, flag=flag, varname='croplive', xtype=ncd_log, & - dim1name='pft', & - long_name='Flag that crop is alive, but not harvested', & - interpinic_flag='interp', readvar=readvar, data=temp1d) - if (flag == 'read') then - do p= bounds%begp,bounds%endp - if (temp1d(p) == 1) then - this%croplive_patch(p) = .true. - else - this%croplive_patch(p) = .false. - end if - end do - end if - deallocate(temp1d) - - allocate(temp1d(bounds%begp:bounds%endp)) - if (flag == 'write') then - do p= bounds%begp,bounds%endp - if (this%cropplant_patch(p)) then - temp1d(p) = 1 - else - temp1d(p) = 0 - end if - end do - end if - call restartvar(ncid=ncid, flag=flag, varname='cropplant', xtype=ncd_log, & - dim1name='pft', & - long_name='Flag that crop is planted, but not harvested' , & - interpinic_flag='interp', readvar=readvar, data=temp1d) - if (flag == 'read') then - do p= bounds%begp,bounds%endp - if (temp1d(p) == 1) then - this%cropplant_patch(p) = .true. - else - this%cropplant_patch(p) = .false. - end if - end do - end if - deallocate(temp1d) - - call restartvar(ncid=ncid, flag=flag, varname='harvdate', xtype=ncd_int, & - dim1name='pft', long_name='harvest date', units='jday', nvalid_range=(/1,366/), & - interpinic_flag='interp', readvar=readvar, data=this%harvdate_patch) - - call restartvar(ncid=ncid, flag=flag, varname='vf', xtype=ncd_double, & - dim1name='pft', long_name='vernalization factor', units='', & - interpinic_flag='interp', readvar=readvar, data=this%vf_patch) - - call restartvar(ncid=ncid, flag=flag, varname='cphase',xtype=ncd_double, & - dim1name='pft', long_name='crop phenology phase', & - units='0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest', & - interpinic_flag='interp', readvar=readvar, data=this%cphase_patch) - if (flag=='read' )then - call this%checkDates( ) ! Check that restart date is same calendar date (even if year is different) - ! This is so that it properly goes through - ! the crop phases - end if - end if - - end subroutine Restart - - - !----------------------------------------------------------------------- - subroutine CropUpdateAccVars(this, bounds, t_ref2m_patch, t_soisno_col) - ! - ! !DESCRIPTION: - ! Update accumulated variables. Should be called every time step. - ! Should only be called if use_crop is true. - ! - ! !USES: - use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - use clm_time_manager , only : get_step_size, get_nstep - use clm_varpar , only : nlevsno, nlevgrnd - use pftconMod , only : nswheat, nirrig_swheat, pftcon - use pftconMod , only : nwwheat, nirrig_wwheat - use pftconMod , only : nsugarcane, nirrig_sugarcane - use ColumnType , only : col - use PatchType , only : patch - ! - ! !ARGUMENTS: - implicit none - class(crop_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: t_ref2m_patch( bounds%begp:) - real(r8) , intent(inout) :: t_soisno_col(bounds%begc:, -nlevsno+1:) - ! - ! !LOCAL VARIABLES: - integer :: p,c,g ! indices - integer :: ivt ! vegetation type - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: ier ! error status - integer :: begp, endp - integer :: begc, endc - real(r8), pointer :: rbufslp(:) ! temporary single level - patch level - character(len=*), parameter :: subname = 'CropUpdateAccVars' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(t_ref2m_patch) == (/endp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno_col) == (/endc,nlevgrnd/)) , errMsg(sourcefile, __LINE__)) - - dtime = get_step_size() - nstep = get_nstep() - - ! Allocate needed dynamic memory for single level patch field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - ! Accumulate and extract GDDPLANT - - call extract_accum_field ('GDDPLANT', rbufslp, nstep) - do p = begp,endp - rbufslp(p) = max(0.,this%gddplant_patch(p)-rbufslp(p)) - end do - call update_accum_field ('GDDPLANT', rbufslp, nstep) - do p = begp,endp - if (this%croplive_patch(p)) then ! relative to planting date - ivt = patch%itype(p) - if ( (trim(this%baset_mapping) == baset_map_latvary) .and. & - ((ivt == nswheat) .or. (ivt == nirrig_swheat) .or. & - (ivt == nsugarcane) .or. (ivt == nirrig_sugarcane)) ) then - rbufslp(p) = max(0._r8, min(pftcon%mxtmp(ivt), & - t_ref2m_patch(p)-(SHR_CONST_TKFRZ + this%latbaset_patch(p)))) & - * dtime/SHR_CONST_CDAY - else - rbufslp(p) = max(0._r8, min(pftcon%mxtmp(ivt), & - t_ref2m_patch(p)-(SHR_CONST_TKFRZ + pftcon%baset(ivt)))) & - * dtime/SHR_CONST_CDAY - end if - if (ivt == nwwheat .or. ivt == nirrig_wwheat) then - rbufslp(p) = rbufslp(p) * this%vf_patch(p) - end if - else - rbufslp(p) = accumResetVal - end if - end do - call update_accum_field ('GDDPLANT', rbufslp, nstep) - call extract_accum_field ('GDDPLANT', this%gddplant_patch, nstep) - - ! Accumulate and extract GDDTSOI - ! In agroibis this variable is calculated - ! to 0.05 m, so here we use the top two soil layers - - do p = begp,endp - if (this%croplive_patch(p)) then ! relative to planting date - ivt = patch%itype(p) - c = patch%column(p) - rbufslp(p) = max(0._r8, min(pftcon%mxtmp(ivt), & - ((t_soisno_col(c,1)*col%dz(c,1) + & - t_soisno_col(c,2)*col%dz(c,2))/(col%dz(c,1)+col%dz(c,2))) - & - (SHR_CONST_TKFRZ + pftcon%baset(ivt)))) * dtime/SHR_CONST_CDAY - if (ivt == nwwheat .or. ivt == nwwheat) then - rbufslp(p) = rbufslp(p) * this%vf_patch(p) - end if - else - rbufslp(p) = accumResetVal - end if - end do - call update_accum_field ('GDDTSOI', rbufslp, nstep) - call extract_accum_field ('GDDTSOI', this%gddtsoi_patch, nstep) - - deallocate(rbufslp) - - end subroutine CropUpdateAccVars - - !----------------------------------------------------------------------- - subroutine CropIncrementYear (this, num_pcropp, filter_pcropp) - ! - ! !DESCRIPTION: - ! Increment the crop year, if appropriate - ! - ! This routine should be called every time step - ! - ! !USES: - use clm_time_manager , only : get_curr_date, is_first_step - ! - ! !ARGUMENTS: - class(crop_type) :: this - integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter - integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches - ! - ! !LOCAL VARIABLES: - integer kyr ! current year - integer kmo ! month of year (1, ..., 12) - integer kda ! day of month (1, ..., 31) - integer mcsec ! seconds of day (0, ..., seconds/day) - integer :: fp, p - !----------------------------------------------------------------------- - - call get_curr_date ( kyr, kmo, kda, mcsec) - ! Update nyrs when it's the end of the year (unless it's the very start of the - ! run). This assumes that, if this patch is active at the end of the year, then it was - ! active for the whole year. - if ((kmo == 1 .and. kda == 1 .and. mcsec == 0) .and. .not. is_first_step()) then - do fp = 1, num_pcropp - p = filter_pcropp(fp) - - this%nyrs_crop_active_patch(p) = this%nyrs_crop_active_patch(p) + 1 - end do - end if - - end subroutine CropIncrementYear - - !----------------------------------------------------------------------- - subroutine checkDates( ) - ! - ! !DESCRIPTION: - ! Make sure the dates are compatible. The date given to startup the model - ! and the date on the restart file must be the same although years can be - ! different. The dates need to be checked when the restart file is being - ! read in for a startup or branch case (they are NOT allowed to be different - ! for a restart case). - ! - ! For the prognostic crop model the date of planting is tracked and growing - ! degree days is tracked (with a 20 year mean) -- so shifting the start dates - ! messes up these bits of saved information. - ! - ! !ARGUMENTS: - use clm_time_manager, only : get_driver_start_ymd, get_start_date - use clm_varctl , only : iulog - use clm_varctl , only : nsrest, nsrBranch, nsrStartup - ! - ! !LOCAL VARIABLES: - integer :: stymd ! Start date YYYYMMDD from driver - integer :: styr ! Start year from driver - integer :: stmon_day ! Start date MMDD from driver - integer :: rsmon_day ! Restart date MMDD from restart file - integer :: rsyr ! Restart year from restart file - integer :: rsmon ! Restart month from restart file - integer :: rsday ! Restart day from restart file - integer :: tod ! Restart time of day from restart file - character(len=*), parameter :: formDate = '(A,i4.4,"/",i2.2,"/",i2.2)' ! log output format - character(len=32) :: subname = 'CropRest::checkDates' - !----------------------------------------------------------------------- - ! - ! If branch or startup make sure the startdate is compatible with the date - ! on the restart file. - ! - if ( nsrest == nsrBranch .or. nsrest == nsrStartup )then - stymd = get_driver_start_ymd() - styr = stymd / 10000 - stmon_day = stymd - styr*10000 - call get_start_date( rsyr, rsmon, rsday, tod ) - rsmon_day = rsmon*100 + rsday - if ( masterproc ) & - write(iulog,formDate) 'Date on the restart file is: ', rsyr, rsmon, rsday - if ( stmon_day /= rsmon_day )then - write(iulog,formDate) 'Start date is: ', styr, stmon_day/100, & - (stmon_day - stmon_day/100) - call endrun(msg=' ERROR: For prognostic crop to work correctly, the start date (month and day)'// & - ' and the date on the restart file needs to match (years can be different)'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine checkDates - -end module CropType - diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 deleted file mode 100644 index ad2e5bf6a9..0000000000 --- a/src/biogeochem/DUSTMod.F90 +++ /dev/null @@ -1,925 +0,0 @@ -module DUSTMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Routines in this module calculate Dust mobilization and dry deposition for dust. - ! Simulates dust mobilization due to wind from the surface into the - ! lowest atmospheric layer. On output flx_mss_vrt_dst(ndst) is the surface dust - ! emission (kg/m**2/s) [ + = to atm]. - ! Calculates the turbulent component of dust dry deposition, (the turbulent deposition - ! velocity through the lowest atmospheric layer). CAM will calculate the settling - ! velocity through the whole atmospheric column. The two calculations will determine - ! the dust dry deposition flux to the surface. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : dst_src_nbr, ndst, sz_nbr - use clm_varcon , only : grav, spval - use landunit_varcon , only : istcrop, istsoil - use clm_varctl , only : iulog - use abortutils , only : endrun - use subgridAveMod , only : p2l_1d - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use SoilStateType , only : soilstate_type - use CanopyStateType , only : canopystate_type - use WaterstateType , only : waterstate_type - use FrictionVelocityMod , only : frictionvel_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - ! - public DustEmission ! Dust mobilization - public DustDryDep ! Turbulent dry deposition for dust - ! - ! !PUBLIC DATA: - ! - real(r8) , allocatable :: ovr_src_snk_mss(:,:) - real(r8) , allocatable :: dmt_vwr(:) ![m] Mass-weighted mean diameter resolved - real(r8) , allocatable :: stk_crc(:) ![frc] Correction to Stokes settling velocity - real(r8) tmp1 !Factor in saltation computation (named as in Charlie's code) - real(r8) dns_aer ![kg m-3] Aerosol density - ! - ! !PUBLIC DATA TYPES: - ! - type, public :: dust_type - - real(r8), pointer, PUBLIC :: flx_mss_vrt_dst_patch (:,:) ! surface dust emission (kg/m**2/s) [ + = to atm] (ndst) - real(r8), pointer, private :: flx_mss_vrt_dst_tot_patch (:) ! total dust flux into atmosphere - real(r8), pointer, private :: vlc_trb_patch (:,:) ! turbulent deposition velocity (m/s) (ndst) - real(r8), pointer, private :: vlc_trb_1_patch (:) ! turbulent deposition velocity 1(m/s) - real(r8), pointer, private :: vlc_trb_2_patch (:) ! turbulent deposition velocity 2(m/s) - real(r8), pointer, private :: vlc_trb_3_patch (:) ! turbulent deposition velocity 3(m/s) - real(r8), pointer, private :: vlc_trb_4_patch (:) ! turbulent deposition velocity 4(m/s) - real(r8), pointer, private :: mbl_bsn_fct_col (:) ! basin factor - - contains - - procedure , public :: Init - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - procedure , private :: InitDustVars ! Initialize variables used in subroutine Dust - - end type dust_type - !------------------------------------------------------------------------ - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(dust_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate (bounds) - call this%InitHistory (bounds) - call this%InitCold (bounds) - call this%InitDustVars (bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (dust_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - !------------------------------------------------------------------------ - - begp = bounds%begp ; endp = bounds%endp - begc = bounds%begc ; endc = bounds%endc - - allocate(this%flx_mss_vrt_dst_patch (begp:endp,1:ndst)) ; this%flx_mss_vrt_dst_patch (:,:) = nan - allocate(this%flx_mss_vrt_dst_tot_patch (begp:endp)) ; this%flx_mss_vrt_dst_tot_patch (:) = nan - allocate(this%vlc_trb_patch (begp:endp,1:ndst)) ; this%vlc_trb_patch (:,:) = nan - allocate(this%vlc_trb_1_patch (begp:endp)) ; this%vlc_trb_1_patch (:) = nan - allocate(this%vlc_trb_2_patch (begp:endp)) ; this%vlc_trb_2_patch (:) = nan - allocate(this%vlc_trb_3_patch (begp:endp)) ; this%vlc_trb_3_patch (:) = nan - allocate(this%vlc_trb_4_patch (begp:endp)) ; this%vlc_trb_4_patch (:) = nan - allocate(this%mbl_bsn_fct_col (begc:endc)) ; this%mbl_bsn_fct_col (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! - ! !ARGUMENTS: - class (dust_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - - this%flx_mss_vrt_dst_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='DSTFLXT', units='kg/m2/s', & - avgflag='A', long_name='total surface dust emission', & - ptr_patch=this%flx_mss_vrt_dst_tot_patch, set_lake=0._r8, set_urb=0._r8) - - this%vlc_trb_1_patch(begp:endp) = spval - call hist_addfld1d (fname='DPVLTRB1', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 1', & - ptr_patch=this%vlc_trb_1_patch, default='inactive') - - this%vlc_trb_2_patch(begp:endp) = spval - call hist_addfld1d (fname='DPVLTRB2', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 2', & - ptr_patch=this%vlc_trb_2_patch, default='inactive') - - this%vlc_trb_3_patch(begp:endp) = spval - call hist_addfld1d (fname='DPVLTRB3', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 3', & - ptr_patch=this%vlc_trb_3_patch, default='inactive') - - this%vlc_trb_4_patch(begp:endp) = spval - call hist_addfld1d (fname='DPVLTRB4', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 4', & - ptr_patch=this%vlc_trb_4_patch, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !ARGUMENTS: - class (dust_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,l - !----------------------------------------------------------------------- - - ! Set basin factor to 1 for now - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (.not.lun%lakpoi(l)) then - this%mbl_bsn_fct_col(c) = 1.0_r8 - end if - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine DustEmission (bounds, & - num_nolakep, filter_nolakep, & - atm2lnd_inst, soilstate_inst, canopystate_inst, waterstate_inst, & - frictionvel_inst, dust_inst) - ! - ! !DESCRIPTION: - ! Dust mobilization. This code simulates dust mobilization due to wind - ! from the surface into the lowest atmospheric layer - ! On output flx_mss_vrt_dst(ndst) is the surface dust emission - ! (kg/m**2/s) [ + = to atm] - ! Source: C. Zender's dust model - ! - ! !USES - use shr_const_mod, only : SHR_CONST_RHOFW - use subgridaveMod, only : p2g - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(dust_type) , intent(inout) :: dust_inst - - ! - ! !LOCAL VARIABLES - integer :: fp,p,c,l,g,m,n ! indices - real(r8) :: liqfrac ! fraction of total water that is liquid - real(r8) :: wnd_frc_rat ! [frc] Wind friction threshold over wind friction - real(r8) :: wnd_frc_slt_dlt ! [m s-1] Friction velocity increase from saltatn - real(r8) :: wnd_rfr_dlt ! [m s-1] Reference windspeed excess over threshld - real(r8) :: dst_slt_flx_rat_ttl - real(r8) :: flx_mss_hrz_slt_ttl - real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) - real(r8) :: frc_thr_wet_fct - real(r8) :: frc_thr_rgh_fct - real(r8) :: wnd_frc_thr_slt - real(r8) :: wnd_rfr_thr_slt - real(r8) :: wnd_frc_slt - real(r8) :: lnd_frc_mbl(bounds%begp:bounds%endp) - real(r8) :: bd - real(r8) :: gwc_sfc - real(r8) :: ttlai(bounds%begp:bounds%endp) - real(r8) :: tlai_lu(bounds%begl:bounds%endl) - real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights - logical :: found ! temporary for error check - integer :: index - ! - ! constants - ! - real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant - real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization - !------------------------------------------------------------------------ - - associate( & - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] downscaled density (kg/m**3) - - gwc_thr => soilstate_inst%gwc_thr_col , & ! Input: [real(r8) (:) ] threshold gravimetric soil moisture based on clay content - mss_frc_cly_vld => soilstate_inst%mss_frc_cly_vld_col , & ! Input: [real(r8) (:) ] [frc] Mass fraction clay limited to 0.20 - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] saturated volumetric soil water - - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2) - - fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) (for dust model) - u10 => frictionvel_inst%u10_patch , & ! Input: [real(r8) (:) ] 10-m wind (m/s) (created for dust model) - - mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor - flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) - flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) - ) - - ttlai(bounds%begp : bounds%endp) = 0._r8 - ! make lai average at landunit level - do fp = 1,num_nolakep - p = filter_nolakep(fp) - ttlai(p) = tlai(p)+tsai(p) - enddo - - tlai_lu(bounds%begl : bounds%endl) = spval - sumwt(bounds%begl : bounds%endl) = 0._r8 - do p = bounds%begp,bounds%endp - if (ttlai(p) /= spval .and. patch%active(p) .and. patch%wtlunit(p) /= 0._r8) then - c = patch%column(p) - l = patch%landunit(p) - if (sumwt(l) == 0._r8) tlai_lu(l) = 0._r8 - tlai_lu(l) = tlai_lu(l) + ttlai(p) * patch%wtlunit(p) - sumwt(l) = sumwt(l) + patch%wtlunit(p) - end if - end do - found = .false. - do l = bounds%begl,bounds%endl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - exit - else if (sumwt(l) /= 0._r8) then - tlai_lu(l) = tlai_lu(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*) 'p2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Loop through patches - - ! initialize variables which get passed to the atmosphere - flx_mss_vrt_dst(bounds%begp:bounds%endp,:)=0._r8 - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - l = patch%landunit(p) - - ! the following code from subr. lnd_frc_mbl_get was adapted for lsm use - ! purpose: return fraction of each gridcell suitable for dust mobilization - - ! the "bare ground" fraction of the current sub-gridscale cell decreases - ! linearly from 1 to 0 as VAI(=tlai+tsai) increases from 0 to vai_mbl_thr - ! if ice sheet, wetland, or lake, no dust allowed - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (tlai_lu(l) < vai_mbl_thr) then - lnd_frc_mbl(p) = 1.0_r8 - (tlai_lu(l))/vai_mbl_thr - else - lnd_frc_mbl(p) = 0.0_r8 - endif - lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno(c)) - else - lnd_frc_mbl(p) = 0.0_r8 - end if - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p)>1.0_r8 .or. lnd_frc_mbl(p)<0.0_r8) then - write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - - ! reset history output variables before next if-statement to avoid output = inf - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - flx_mss_vrt_dst_tot(p) = 0.0_r8 - end do - do n = 1, ndst - do fp = 1,num_nolakep - p = filter_nolakep(fp) - flx_mss_vrt_dst(p,n) = 0.0_r8 - end do - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - - ! only perform the following calculations if lnd_frc_mbl is non-zero - - if (lnd_frc_mbl(p) > 0.0_r8) then - - ! the following comes from subr. frc_thr_rgh_fct_get - ! purpose: compute factor by which surface roughness increases threshold - ! friction velocity (currently a constant) - - frc_thr_rgh_fct = 1.0_r8 - - ! the following comes from subr. frc_thr_wet_fct_get - ! purpose: compute factor by which soil moisture increases threshold friction velocity - ! adjust threshold velocity for inhibition by moisture - ! modified 4/5/2002 (slevis) to use gravimetric instead of volumetric - ! water content - - bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil - gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont - if (gwc_sfc > gwc_thr(c)) then - frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) - else - frc_thr_wet_fct = 1.0_r8 - end if - - ! slevis: adding liqfrac here, because related to effects from soil water - - liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) - - ! the following lines come from subr. dst_mbl - ! purpose: adjust threshold friction velocity to acct for moisture and - ! roughness. The ratio tmp1 / sqrt(forc_rho) comes from - ! subr. wnd_frc_thr_slt_get which computes dry threshold - ! friction velocity for saltation - - wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct - - ! reset these variables which will be updated in the following if-block - - wnd_frc_slt = fv(p) - flx_mss_hrz_slt_ttl = 0.0_r8 - flx_mss_vrt_dst_ttl(p) = 0.0_r8 - - ! the following line comes from subr. dst_mbl - ! purpose: threshold saltation wind speed - - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) - - ! the following if-block comes from subr. wnd_frc_slt_get - ! purpose: compute the saltating friction velocity - ! theory: saltation roughens the boundary layer, AKA "Owen's effect" - - if (u10(p) >= wnd_rfr_thr_slt) then - wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - wnd_frc_slt = fv(p) + wnd_frc_slt_dlt - end if - - ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get - ! purpose: compute vertically integrated streamwise mass flux of particles - - if (wnd_frc_slt > wnd_frc_thr_slt) then - wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt - flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & - (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav - - ! the following loop originates from subr. dst_mbl - ! purpose: apply land sfc and veg limitations and global tuning factor - ! slevis: multiply flx_mss_hrz_slt_ttl by liqfrac to incude the effect - ! of frozen soil - - flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & - flx_mss_fdg_fct * liqfrac - end if - - ! the following comes from subr. flx_mss_vrt_dst_ttl_MaB95_get - ! purpose: diagnose total vertical mass flux of dust from vertically - ! integrated streamwise mass flux - - dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) - flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl - - end if ! lnd_frc_mbl > 0.0 - - end do - - ! the following comes from subr. flx_mss_vrt_dst_prt in C. Zender's code - ! purpose: partition total vertical mass flux of dust into transport bins - - do n = 1, ndst - do m = 1, dst_src_nbr - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p) > 0.0_r8) then - flx_mss_vrt_dst(p,n) = flx_mss_vrt_dst(p,n) + ovr_src_snk_mss(m,n) * flx_mss_vrt_dst_ttl(p) - end if - end do - end do - end do - - do n = 1, ndst - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p) > 0.0_r8) then - flx_mss_vrt_dst_tot(p) = flx_mss_vrt_dst_tot(p) + flx_mss_vrt_dst(p,n) - end if - end do - end do - - end associate - - end subroutine DustEmission - - !------------------------------------------------------------------------ - subroutine DustDryDep (bounds, & - atm2lnd_inst, frictionvel_inst, dust_inst) - ! - ! !DESCRIPTION: - ! - ! Determine Turbulent dry deposition for dust. Calculate the turbulent - ! component of dust dry deposition, (the turbulent deposition velocity - ! through the lowest atmospheric layer. CAM will calculate the settling - ! velocity through the whole atmospheric column. The two calculations - ! will determine the dust dry deposition flux to the surface. - ! Note: Same process should occur over oceans. For the coupled CESM, - ! we may find it more efficient to let CAM calculate the turbulent dep - ! velocity over all surfaces. This would require passing the - ! aerodynamic resistance, ram(1), and the friction velocity, fv, from - ! the land to the atmosphere component. In that case, dustini need not - ! calculate particle diamter (dmt_vwr) and particle density (dns_aer). - ! Source: C. Zender's dry deposition code - ! - ! !USES - use shr_const_mod, only : SHR_CONST_PI, SHR_CONST_RDAIR, SHR_CONST_BOLTZ - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(dust_type) , intent(inout) :: dust_inst - ! - ! !LOCAL VARIABLES - integer :: p,c,g,m,n ! indices - real(r8) :: vsc_dyn_atm(bounds%begp:bounds%endp) ! [kg m-1 s-1] Dynamic viscosity of air - real(r8) :: vsc_knm_atm(bounds%begp:bounds%endp) ! [m2 s-1] Kinematic viscosity of atmosphere - real(r8) :: shm_nbr_xpn ! [frc] Sfc-dep exponent for aerosol-diffusion dependence on Schmidt number - real(r8) :: shm_nbr ! [frc] Schmidt number - real(r8) :: stk_nbr ! [frc] Stokes number - real(r8) :: mfp_atm ! [m] Mean free path of air - real(r8) :: dff_aer ! [m2 s-1] Brownian diffusivity of particle - real(r8) :: rss_trb ! [s m-1] Resistance to turbulent deposition - real(r8) :: slp_crc(bounds%begp:bounds%endp,ndst) ! [frc] Slip correction factor - real(r8) :: vlc_grv(bounds%begp:bounds%endp,ndst) ! [m s-1] Settling velocity - real(r8) :: rss_lmn(bounds%begp:bounds%endp,ndst) ! [s m-1] Quasi-laminar layer resistance - real(r8) :: tmp ! temporary - real(r8), parameter::shm_nbr_xpn_lnd=-2._r8/3._r8 ![frc] shm_nbr_xpn over land - !------------------------------------------------------------------------ - - associate( & - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atm pressure (Pa) - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] atm density (kg/m**3) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atm temperature (K) - - ram1 => frictionvel_inst%ram1_patch , & ! Input: [real(r8) (:) ] aerodynamical resistance (s/m) - fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) - - vlc_trb => dust_inst%vlc_trb_patch , & ! Output: [real(r8) (:,:) ] Turbulent deposn velocity (m/s) - vlc_trb_1 => dust_inst%vlc_trb_1_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 1 - vlc_trb_2 => dust_inst%vlc_trb_2_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 2 - vlc_trb_3 => dust_inst%vlc_trb_3_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 3 - vlc_trb_4 => dust_inst%vlc_trb_4_patch & ! Output: [real(r8) (:) ] Turbulent deposition velocity 4 - ) - - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - g = patch%gridcell(p) - c = patch%column(p) - - ! from subroutine dst_dps_dry (consider adding sanity checks from line 212) - ! when code asks to use midlayer density, pressure, temperature, - ! I use the data coming in from the atmosphere, ie forc_t, forc_pbot, forc_rho - - ! Quasi-laminar layer resistance: call rss_lmn_get - ! Size-independent thermokinetic properties - - vsc_dyn_atm(p) = 1.72e-5_r8 * ((forc_t(c)/273.0_r8)**1.5_r8) * 393.0_r8 / & - (forc_t(c)+120.0_r8) ![kg m-1 s-1] RoY94 p. 102 - mfp_atm = 2.0_r8 * vsc_dyn_atm(p) / & ![m] SeP97 p. 455 - (forc_pbot(c)*sqrt(8.0_r8/(SHR_CONST_PI*SHR_CONST_RDAIR*forc_t(c)))) - vsc_knm_atm(p) = vsc_dyn_atm(p) / forc_rho(c) ![m2 s-1] Kinematic viscosity of air - - do m = 1, ndst - slp_crc(p,m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ![frc] Slip correction factor SeP97 p. 464 - vlc_grv(p,m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & - grav * slp_crc(p,m) / vsc_dyn_atm(p) ![m s-1] Stokes' settling velocity SeP97 p. 466 - vlc_grv(p,m) = vlc_grv(p,m) * stk_crc(m) ![m s-1] Correction to Stokes settling velocity - end do - end if - end do - - do m = 1, ndst - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - g = patch%gridcell(p) - c = patch%column(p) - - stk_nbr = vlc_grv(p,m) * fv(p) * fv(p) / (grav * vsc_knm_atm(p)) ![frc] SeP97 p.965 - dff_aer = SHR_CONST_BOLTZ * forc_t(c) * slp_crc(p,m) / & ![m2 s-1] - (3.0_r8*SHR_CONST_PI * vsc_dyn_atm(p) * dmt_vwr(m)) !SeP97 p.474 - shm_nbr = vsc_knm_atm(p) / dff_aer ![frc] SeP97 p.972 - shm_nbr_xpn = shm_nbr_xpn_lnd ![frc] - - ! fxm: Turning this on dramatically reduces - ! deposition velocity in low wind regimes - ! Schmidt number exponent is -2/3 over solid surfaces and - ! -1/2 over liquid surfaces SlS80 p. 1014 - ! if (oro(i)==0.0) shm_nbr_xpn=shm_nbr_xpn_ocn else shm_nbr_xpn=shm_nbr_xpn_lnd - ! [frc] Surface-dependent exponent for aerosol-diffusion dependence on Schmidt # - - tmp = shm_nbr**shm_nbr_xpn + 10.0_r8**(-3.0_r8/stk_nbr) - rss_lmn(p,m) = 1.0_r8 / (tmp * fv(p)) ![s m-1] SeP97 p.972,965 - end if - end do - end do - - ! Lowest layer: Turbulent deposition (CAM will calc. gravitational dep) - - do m = 1, ndst - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - rss_trb = ram1(p) + rss_lmn(p,m) + ram1(p) * rss_lmn(p,m) * vlc_grv(p,m) ![s m-1] - vlc_trb(p,m) = 1.0_r8 / rss_trb ![m s-1] - end if - end do - end do - - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - vlc_trb_1(p) = vlc_trb(p,1) - vlc_trb_2(p) = vlc_trb(p,2) - vlc_trb_3(p) = vlc_trb(p,3) - vlc_trb_4(p) = vlc_trb(p,4) - end if - end do - - end associate - - end subroutine DustDryDep - - !------------------------------------------------------------------------ - subroutine InitDustVars(this, bounds) - ! - ! !DESCRIPTION: - ! - ! Compute source efficiency factor from topography - ! Initialize other variables used in subroutine Dust: - ! ovr_src_snk_mss(m,n) and tmp1. - ! Define particle diameter and density needed by atm model - ! as well as by dry dep model - ! Source: Paul Ginoux (for source efficiency factor) - ! Modifications by C. Zender and later by S. Levis - ! Rest of subroutine from C. Zender's dust model - ! - ! !USES - use shr_const_mod , only: SHR_CONST_PI, SHR_CONST_RDAIR - use shr_spfn_mod , only: erf => shr_spfn_erf - use decompMod , only : get_proc_bounds - ! - ! !ARGUMENTS: - class(dust_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES - integer :: fc,c,l,m,n ! indices - real(r8) :: ovr_src_snk_frc - real(r8) :: sqrt2lngsdi ! [frc] Factor in erf argument - real(r8) :: lndmaxjovrdmdni ! [frc] Factor in erf argument - real(r8) :: lndminjovrdmdni ! [frc] Factor in erf argument - real(r8) :: ryn_nbr_frc_thr_prx_opt ! [frc] Threshold friction Reynolds number approximation for optimal size - real(r8) :: ryn_nbr_frc_thr_opt_fnc ! [frc] Threshold friction Reynolds factor for saltation calculation - real(r8) :: icf_fct ! Interpartical cohesive forces factor for saltation calc - real(r8) :: dns_fct ! Density ratio factor for saltation calculation - real(r8) :: dmt_min(ndst) ! [m] Size grid minimum - real(r8) :: dmt_max(ndst) ! [m] Size grid maximum - real(r8) :: dmt_ctr(ndst) ! [m] Diameter at bin center - real(r8) :: dmt_dlt(ndst) ! [m] Width of size bin - real(r8) :: slp_crc(ndst) ! [frc] Slip correction factor - real(r8) :: vlm_rsl(ndst) ! [m3 m-3] Volume concentration resolved - real(r8) :: vlc_stk(ndst) ! [m s-1] Stokes settling velocity - real(r8) :: vlc_grv(ndst) ! [m s-1] Settling velocity - real(r8) :: ryn_nbr_grv(ndst) ! [frc] Reynolds number at terminal velocity - real(r8) :: cff_drg_grv(ndst) ! [frc] Drag coefficient at terminal velocity - real(r8) :: tmp ! temporary - real(r8) :: ln_gsd ! [frc] ln(gsd) - real(r8) :: gsd_anl ! [frc] Geometric standard deviation - real(r8) :: dmt_vma ! [m] Mass median diameter analytic She84 p.75 Tabl.1 - real(r8) :: dmt_nma ! [m] Number median particle diameter - real(r8) :: lgn_dst ! Lognormal distribution at sz_ctr - real(r8) :: eps_max ! [frc] Relative accuracy for convergence - real(r8) :: eps_crr ! [frc] Current relative accuracy - real(r8) :: itr_idx ! [idx] Counting index - real(r8) :: dns_mdp ! [kg m-3] Midlayer density - real(r8) :: mfp_atm ! [m] Mean free path of air - real(r8) :: vsc_dyn_atm ! [kg m-1 s-1] Dynamic viscosity of air - real(r8) :: vsc_knm_atm ! [kg m-1 s-1] Kinematic viscosity of air - real(r8) :: vlc_grv_old ! [m s-1] Previous gravitational settling velocity - real(r8) :: series_ratio ! Factor for logarithmic grid - real(r8) :: lngsdsqrttwopi_rcp ! Factor in lognormal distribution - real(r8) :: sz_min(sz_nbr) ! [m] Size Bin minima - real(r8) :: sz_max(sz_nbr) ! [m] Size Bin maxima - real(r8) :: sz_ctr(sz_nbr) ! [m] Size Bin centers - real(r8) :: sz_dlt(sz_nbr) ! [m] Size Bin widths - - ! constants - real(r8), allocatable :: dmt_vma_src(:) ! [m] Mass median diameter BSM96 p. 73 Table 2 - real(r8), allocatable :: gsd_anl_src(:) ! [frc] Geometric std deviation BSM96 p. 73 Table 2 - real(r8), allocatable :: mss_frc_src(:) ! [frc] Mass fraction BSM96 p. 73 Table 2 - - real(r8) :: dmt_grd(5) = & ! [m] Particle diameter grid - (/ 0.1e-6_r8, 1.0e-6_r8, 2.5e-6_r8, 5.0e-6_r8, 10.0e-6_r8 /) - real(r8), parameter :: dmt_slt_opt = 75.0e-6_r8 ! [m] Optim diam for saltation - real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles - !------------------------------------------------------------------------ - - associate(& - mbl_bsn_fct => this%mbl_bsn_fct_col & ! Output: [real(r8) (:)] basin factor - ) - - ! allocate module variable - allocate (ovr_src_snk_mss(dst_src_nbr,ndst)) - allocate (dmt_vwr(ndst)) - allocate (stk_crc(ndst)) - - ! allocate local variable - allocate (dmt_vma_src(dst_src_nbr)) - allocate (gsd_anl_src(dst_src_nbr)) - allocate (mss_frc_src(dst_src_nbr)) - - dmt_vma_src(:) = (/ 0.832e-6_r8 , 4.82e-6_r8 , 19.38e-6_r8 /) - gsd_anl_src(:) = (/ 2.10_r8 , 1.90_r8 , 1.60_r8 /) - mss_frc_src(:) = (/ 0.036_r8 , 0.957_r8 , 0.007_r8 /) - - ! the following comes from (1) szdstlgn.F subroutine ovr_src_snk_frc_get - ! and (2) dstszdst.F subroutine dst_szdst_ini - ! purpose(1): given one set (the "source") of lognormal distributions, - ! and one set of bin boundaries (the "sink"), compute and return - ! the overlap factors between the source and sink distributions - ! purpose(2): set important statistics of size distributions - - do m = 1, dst_src_nbr - sqrt2lngsdi = sqrt(2.0_r8) * log(gsd_anl_src(m)) - do n = 1, ndst - lndmaxjovrdmdni = log(dmt_grd(n+1)/dmt_vma_src(m)) - lndminjovrdmdni = log(dmt_grd(n )/dmt_vma_src(m)) - ovr_src_snk_frc = 0.5_r8 * (erf(lndmaxjovrdmdni/sqrt2lngsdi) - & - erf(lndminjovrdmdni/sqrt2lngsdi)) - ovr_src_snk_mss(m,n) = ovr_src_snk_frc * mss_frc_src(m) - end do - end do - - ! The following code from subroutine wnd_frc_thr_slt_get was placed - ! here because tmp1 needs to be defined just once - - ryn_nbr_frc_thr_prx_opt = 0.38_r8 + 1331.0_r8 * (100.0_r8*dmt_slt_opt)**1.56_r8 - - if (ryn_nbr_frc_thr_prx_opt < 0.03_r8) then - write(iulog,*) 'dstmbl: ryn_nbr_frc_thr_prx_opt < 0.03' - call endrun(msg=errMsg(sourcefile, __LINE__)) - else if (ryn_nbr_frc_thr_prx_opt < 10.0_r8) then - ryn_nbr_frc_thr_opt_fnc = -1.0_r8 + 1.928_r8 * (ryn_nbr_frc_thr_prx_opt**0.0922_r8) - ryn_nbr_frc_thr_opt_fnc = 0.1291_r8 * 0.1291_r8 / ryn_nbr_frc_thr_opt_fnc - else - ryn_nbr_frc_thr_opt_fnc = 1.0_r8 - 0.0858_r8 * exp(-0.0617_r8*(ryn_nbr_frc_thr_prx_opt-10.0_r8)) - ryn_nbr_frc_thr_opt_fnc = 0.120_r8 * 0.120_r8 * ryn_nbr_frc_thr_opt_fnc * ryn_nbr_frc_thr_opt_fnc - end if - - icf_fct = 1.0_r8 + 6.0e-07_r8 / (dns_slt * grav * (dmt_slt_opt**2.5_r8)) - dns_fct = dns_slt * grav * dmt_slt_opt - tmp1 = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) - - ! Introducing particle diameter. Needed by atm model and by dry dep model. - ! Taken from Charlie Zender's subroutines dst_psd_ini, dst_sz_rsl, - ! grd_mk (dstpsd.F90) and subroutine lgn_evl (psdlgn.F90) - - ! Charlie allows logarithmic or linear option for size distribution - ! however, he hardwires the distribution to logarithmic in his code - ! therefore, I take his logarithmic code only - ! furthermore, if dst_nbr == 4, he overrides the automatic grid calculation - ! he currently works with dst_nbr = 4, so I only take the relevant code - ! if ndst ever becomes different from 4, must add call grd_mk (dstpsd.F90) - ! as done in subroutine dst_psd_ini - ! note that here ndst = dst_nbr - - ! Override automatic grid with preset grid if available - - if (ndst == 4) then - do n = 1, ndst - dmt_min(n) = dmt_grd(n) ![m] Max diameter in bin - dmt_max(n) = dmt_grd(n+1) ![m] Min diameter in bin - dmt_ctr(n) = 0.5_r8 * (dmt_min(n)+dmt_max(n)) ![m] Diameter at bin ctr - dmt_dlt(n) = dmt_max(n)-dmt_min(n) ![m] Width of size bin - end do - else - write(iulog,*) 'Dustini error: ndst must equal to 4 with current code' - call endrun(msg=errMsg(sourcefile, __LINE__)) - !see more comments above end if ndst == 4 - end if - - ! Bin physical properties - - gsd_anl = 2.0_r8 ! [frc] Geometric std dev PaG77 p. 2080 Table1 - ln_gsd = log(gsd_anl) - dns_aer = 2.5e+3_r8 ! [kg m-3] Aerosol density - - ! Set a fundamental statistic for each bin - - dmt_vma = 3.5000e-6_r8 ! [m] Mass median diameter analytic She84 p.75 Table1 - - ! Compute analytic size statistics - ! Convert mass median diameter to number median diameter (call vma2nma) - - dmt_nma = dmt_vma * exp(-3.0_r8*ln_gsd*ln_gsd) ! [m] - - ! Compute resolved size statistics for each size distribution - ! In C. Zender's code call dst_sz_rsl - - do n = 1, ndst - - series_ratio = (dmt_max(n)/dmt_min(n))**(1.0_r8/sz_nbr) - sz_min(1) = dmt_min(n) - do m = 2, sz_nbr ! Loop starts at 2 - sz_min(m) = sz_min(m-1) * series_ratio - end do - - ! Derived grid values - do m = 1, sz_nbr-1 ! Loop ends at sz_nbr-1 - sz_max(m) = sz_min(m+1) ! [m] - end do - sz_max(sz_nbr) = dmt_max(n) ! [m] - - ! Final derived grid values - do m = 1, sz_nbr - sz_ctr(m) = 0.5_r8 * (sz_min(m)+sz_max(m)) - sz_dlt(m) = sz_max(m)-sz_min(m) - end do - - lngsdsqrttwopi_rcp = 1.0_r8 / (ln_gsd*sqrt(2.0_r8*SHR_CONST_PI)) - dmt_vwr(n) = 0.0_r8 ! [m] Mass wgted diameter resolved - vlm_rsl(n) = 0.0_r8 ! [m3 m-3] Volume concentration resolved - - do m = 1, sz_nbr - - ! Evaluate lognormal distribution for these sizes (call lgn_evl) - tmp = log(sz_ctr(m)/dmt_nma) / ln_gsd - lgn_dst = lngsdsqrttwopi_rcp * exp(-0.5_r8*tmp*tmp) / sz_ctr(m) - - ! Integrate moments of size distribution - dmt_vwr(n) = dmt_vwr(n) + sz_ctr(m) * & - SHR_CONST_PI / 6.0_r8 * (sz_ctr(m)**3.0_r8) * & ![m3] Volume - lgn_dst * sz_dlt(m) ![# m-3] Number concentrn - vlm_rsl(n) = vlm_rsl(n) + & - SHR_CONST_PI / 6.0_r8 * (sz_ctr(m)**3.0_r8) * & ![m3] Volume - lgn_dst * sz_dlt(m) ![# m-3] Number concentrn - - end do - - dmt_vwr(n) = dmt_vwr(n) / vlm_rsl(n) ![m] Mass weighted diameter resolved - - end do - - ! calculate correction to Stokes' settling velocity (subroutine stk_crc_get) - - eps_max = 1.0e-4_r8 - dns_mdp = 100000._r8 / (295.0_r8*SHR_CONST_RDAIR) ![kg m-3] const prs_mdp & tpt_vrt - - ! Size-independent thermokinetic properties - - vsc_dyn_atm = 1.72e-5_r8 * ((295.0_r8/273.0_r8)**1.5_r8) * 393.0_r8 / & - (295.0_r8+120.0_r8) ![kg m-1 s-1] RoY94 p.102 tpt_mdp=295.0 - mfp_atm = 2.0_r8 * vsc_dyn_atm / & !SeP97 p. 455 constant prs_mdp, tpt_mdp - (100000._r8*sqrt(8.0_r8/(SHR_CONST_PI*SHR_CONST_RDAIR*295.0_r8))) - vsc_knm_atm = vsc_dyn_atm / dns_mdp ![m2 s-1] Kinematic viscosity of air - - do m = 1, ndst - slp_crc(m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ! [frc] Slip correction factor SeP97 p.464 - vlc_stk(m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & - grav * slp_crc(m) / vsc_dyn_atm ! [m s-1] SeP97 p.466 - end do - - ! For Reynolds number flows Re < 0.1 Stokes' velocity is valid for - ! vlc_grv SeP97 p. 466 (8.42). For larger Re, inertial effects become - ! important and empirical drag coefficients must be employed - ! Implicit equation for Re, Cd, and Vt is SeP97 p. 467 (8.44) - ! Using Stokes' velocity rather than iterative solution with empirical - ! drag coefficient causes 60% errors for D = 200 um SeP97 p. 468 - - ! Iterative solution for drag coefficient, Reynolds number, and terminal veloc - do m = 1, ndst - - ! Initialize accuracy and counter - eps_crr = eps_max + 1.0_r8 ![frc] Current relative accuracy - itr_idx = 0 ![idx] Counting index - - ! Initial guess for vlc_grv is exact for Re < 0.1 - vlc_grv(m) = vlc_stk(m) ![m s-1] - - do while(eps_crr > eps_max) - - ! Save terminal velocity for convergence test - vlc_grv_old = vlc_grv(m) ![m s-1] - ryn_nbr_grv(m) = vlc_grv(m) * dmt_vwr(m) / vsc_knm_atm !SeP97 p.460 - - ! Update drag coefficient based on new Reynolds number - if (ryn_nbr_grv(m) < 0.1_r8) then - cff_drg_grv(m) = 24.0_r8 / ryn_nbr_grv(m) !Stokes' law Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 2.0_r8) then - cff_drg_grv(m) = (24.0_r8/ryn_nbr_grv(m)) * & - (1.0_r8 + 3.0_r8*ryn_nbr_grv(m)/16.0_r8 + & - 9.0_r8*ryn_nbr_grv(m)*ryn_nbr_grv(m)* & - log(2.0_r8*ryn_nbr_grv(m))/160.0_r8) !Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 500.0_r8) then - cff_drg_grv(m) = (24.0_r8/ryn_nbr_grv(m)) * & - (1.0_r8 + 0.15_r8*ryn_nbr_grv(m)**0.687_r8) !Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 2.0e5_r8) then - cff_drg_grv(m) = 0.44_r8 !Sep97 p.463 (8.32) - else - write(iulog,'(a,es9.2)') "ryn_nbr_grv(m) = ",ryn_nbr_grv(m) - write(iulog,*)'Dustini error: Reynolds number too large in stk_crc_get()' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Update terminal velocity based on new Reynolds number and drag coeff - ! [m s-1] Terminal veloc SeP97 p.467 (8.44) - - vlc_grv(m) = sqrt(4.0_r8 * grav * dmt_vwr(m) * slp_crc(m) * dns_aer / & - (3.0_r8*cff_drg_grv(m)*dns_mdp)) - eps_crr = abs((vlc_grv(m)-vlc_grv_old)/vlc_grv(m)) !Relative convergence - if (itr_idx == 12) then - ! Numerical pingpong may occur when Re = 0.1, 2.0, or 500.0 - ! due to discontinuities in derivative of drag coefficient - vlc_grv(m) = 0.5_r8 * (vlc_grv(m)+vlc_grv_old) ! [m s-1] - end if - if (itr_idx > 20) then - write(iulog,*) 'Dustini error: Terminal velocity not converging ',& - ' in stk_crc_get(), breaking loop...' - goto 100 !to next iteration - end if - itr_idx = itr_idx + 1 - - end do !end while - -100 continue !Label to jump to when iteration does not converge - end do !end loop over size - - ! Compute factors to convert Stokes' settling velocities to - ! actual settling velocities - - do m = 1, ndst - stk_crc(m) = vlc_grv(m) / vlc_stk(m) - end do - - end associate - - end subroutine InitDustVars - -end module DUSTMod diff --git a/src/biogeochem/DryDepVelocity.F90 b/src/biogeochem/DryDepVelocity.F90 deleted file mode 100644 index 603e9d24c4..0000000000 --- a/src/biogeochem/DryDepVelocity.F90 +++ /dev/null @@ -1,678 +0,0 @@ -Module DryDepVelocity - - !----------------------------------------------------------------------- - ! - ! Purpose: - ! Deposition velocity (m/s) - ! - ! Method: - ! This code simulates dry deposition velocities using the Wesely scheme. - ! Details of this method can be found in: - ! - ! M.L Wesely. Parameterization of surface resistances to gaseous dry deposition - ! in regional-scale numericl models. 1989. Atmospheric Environment vol.23 No.6 - ! pp. 1293-1304. - ! - ! In Wesely (1998) "the magnitude of the dry deposition velocity can be found - ! as: - ! - ! |vd|=(ra+rb+rc)^-1 - ! - ! where ra is the aerodynamic resistance (common to all gases) between a - ! specific height and the surface, rb is the quasilaminar sublayer resistance - ! (whose only dependence on the porperties of the gas of interest is its - ! molecular diffusivity in air), and rc is the bulk surface resistance". - ! - ! In this subroutine both ra and rb are calculated elsewhere in CLM. - ! - ! In Wesely (1989) rc is estimated for five seasonal categories and 11 landuse - ! types. For each season and landuse type, Wesely compiled data into a - ! look-up-table for several parameters used to calculate rc. In this subroutine - ! the same values are used as found in wesely's look-up-tables, the only - ! difference is that this subroutine uses a CLM generated LAI to select values - ! from the look-up-table instead of seasonality. Inaddition, Wesely(1989) - ! land use types are "mapped" into CLM patch types. - ! - ! Subroutine written to operate at the patch level. - ! - ! Output: - ! - ! vd(n_species) !Dry deposition velocity [m s-1] for each molecule or species - ! - ! Author: Beth Holland and James Sulzman - ! - ! Modified: Francis Vitt -- 30 Mar 2007 - ! Modified: Maria Val Martin -- 15 Jan 2014 - ! Corrected major bugs in the leaf and stomatal resitances. The code is now - ! coupled to LAI and Rs uses the Ball-Berry Scheme. Also, corrected minor - ! bugs in rlu and rcl calculations. Added - ! no vegetation removal for CO. See README for details and - ! Val Martin et al., 2014 GRL for major corrections - ! Modified: Louisa Emmons -- 30 November 2017 - ! Corrected the equation calculating stomatal resistance from rssun and rssha, - ! and removed factor that scaled Rs to match observations - ! - !----------------------------------------------------------------------- - - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - use abortutils , only : endrun - use clm_time_manager , only : get_nstep, get_curr_date, get_curr_time - use spmdMod , only : masterproc - use seq_drydep_mod , only : n_drydep, drydep_list - use seq_drydep_mod , only : drydep_method, DD_XLND - use seq_drydep_mod , only : index_o3=>o3_ndx, index_o3a=>o3a_ndx, index_so2=>so2_ndx, index_h2=>h2_ndx - use seq_drydep_mod , only : index_co=>co_ndx, index_ch4=>ch4_ndx, index_pan=>pan_ndx - use seq_drydep_mod , only : index_xpan=>xpan_ndx - use decompMod , only : bounds_type - use clm_varcon , only : namep - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use FrictionVelocityMod , only : frictionvel_type - use PhotosynthesisMod , only : photosyns_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use LandunitType , only : lun - use PatchType , only : patch - ! - implicit none - private - ! - public :: depvel_compute - ! - type, public :: drydepvel_type - - real(r8), pointer, public :: velocity_patch (:,:) ! Dry Deposition Velocity - real(r8), pointer, private :: rs_drydep_patch (:) ! Stomatal resistance associated with dry deposition velocity for Ozone - - contains - - procedure , public :: Init - procedure , private :: InitAllocate - procedure , private :: InitHistory - - end type drydepvel_type - !----------------------------------------------------------------------- - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -CONTAINS - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(drydepvel_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - ! - ! !ARGUMENTS: - class(drydepvel_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - - ! Dry Deposition Velocity - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - allocate(this%velocity_patch(begp:endp, n_drydep)); this%velocity_patch(:,:) = nan - allocate(this%rs_drydep_patch(begp:endp)) ; this%rs_drydep_patch(:) = nan - end if - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize history output fields for dry deposition diagnositics - ! - ! !USES - use clm_varcon , only : spval - use histFileMod , only : hist_addfld1d - use seq_drydep_mod , only : mapping - ! - ! !ARGUMENTS: - class(drydepvel_type) :: this - type(bounds_type), intent(in) :: bounds - real(r8), pointer :: ptr_1d(:) ! pointer to 1d patch array - ! - ! !LOCAL VARIABLES - integer :: ispec - integer :: begp, endp - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - if ( n_drydep == 0 .or. drydep_method /= DD_XLND ) return - - do ispec=1,n_drydep - if(mapping(ispec) <= 0) cycle - - this%velocity_patch(begp:endp,ispec)= spval - ptr_1d => this%velocity_patch(begp:endp,ispec) - call hist_addfld1d ( fname='DRYDEPV_'//trim(drydep_list(ispec)), units='cm/sec', & - avgflag='A', long_name='Dry Deposition Velocity', & - ptr_patch=ptr_1d, default='inactive' ) - end do - - this%rs_drydep_patch(begp:endp)= spval - call hist_addfld1d ( fname='RS_DRYDEP_O3', units='s/m', & - avgflag='A', long_name='Stomatal Resistance Associated with Ozone Dry Deposition Velocity', & - ptr_patch=this%rs_drydep_patch, default='inactive' ) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine depvel_compute( bounds, & - atm2lnd_inst, canopystate_inst, waterstate_inst, frictionvel_inst, & - photosyns_inst, drydepvel_inst) - ! - ! !DESCRIPTION: - ! computes the dry deposition velocity of tracers - ! - ! !USES: - use shr_const_mod , only : tmelt => shr_const_tkfrz - use seq_drydep_mod , only : seq_drydep_setHCoeff, mapping, drat, foxd - use seq_drydep_mod , only : rcls, h2_a, h2_b, h2_c, ri, rac, rclo, rlu, rgss, rgso - use landunit_varcon, only : istsoil, istice_mec, istdlak, istwet - use clm_varctl , only : iulog - use pftconMod , only : noveg, ndllf_evr_tmp_tree, ndllf_evr_brl_tree - use pftconMod , only : ndllf_dcd_brl_tree, nbrdlf_evr_trp_tree - use pftconMod , only : nbrdlf_evr_tmp_tree, nbrdlf_dcd_trp_tree - use pftconMod , only : nbrdlf_dcd_tmp_tree, nbrdlf_dcd_brl_tree - use pftconMod , only : nbrdlf_evr_shrub, nbrdlf_dcd_tmp_shrub - use pftconMod , only : nbrdlf_dcd_brl_shrub,nc3_arctic_grass - use pftconMod , only : nc3_nonarctic_grass, nc4_grass, nc3crop - use pftconMod , only : nc3irrig, npcropmin, npcropmax - use clm_varcon , only : spval - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(photosyns_type) , intent(in) :: photosyns_inst - type(drydepvel_type) , intent(inout) :: drydepvel_inst - ! - ! !LOCAL VARIABLES: - integer :: c - real(r8) :: soilw, var_soilw, fact_h2, dv_soil_h2 - integer :: pi,g, l - integer :: ispec - integer :: length - integer :: wesveg !wesely vegegation index - integer :: clmveg !clm veg index from ivegtype - integer :: i - integer :: index_season !seasonal index based on LAI. This indexs wesely data tables - integer :: nstep !current step - integer :: indexp - - real(r8) :: pg ! surface pressure - real(r8) :: tc ! temperature in celsius - real(r8) :: es ! saturation vapor pressur - real(r8) :: ws ! saturation mixing ratio - real(r8) :: rmx ! resistance by vegetation - real(r8) :: qs ! saturation specific humidity - real(r8) :: dewm ! multiplier for rs when dew occurs - real(r8) :: crs ! multiplier to calculate crs - real(r8) :: rdc ! part of lower canopy resistance - real(r8) :: rain ! rain fall - real(r8) :: spec_hum ! specific humidity - real(r8) :: solar_flux ! solar radiation(direct beam) W/m2 - real(r8) :: lat ! latitude in degrees - real(r8) :: lon ! longitude in degrees - real(r8) :: sfc_temp ! surface temp - real(r8) :: minlai ! minimum of monthly lai - real(r8) :: maxlai ! maximum of monthly lai - real(r8) :: rds ! resistance for aerosols - - !mvm 11/30/2013 - real(r8) :: rlu_lai ! constant to calculate rlu over bulk canopy - - logical :: has_dew - logical :: has_rain - real(r8), parameter :: rain_threshold = 1.e-7_r8 ! of the order of 1cm/day expressed in m/s - - ! local arrays: dependent on species only - real(r8), dimension(n_drydep) :: rsmx !vegetative resistance (plant mesophyll) - real(r8), dimension(n_drydep) :: rclx !lower canopy resistance - real(r8), dimension(n_drydep) :: rlux !vegetative resistance (upper canopy) - real(r8), dimension(n_drydep) :: rgsx !gournd resistance - real(r8), dimension(n_drydep) :: heff - real(r8) :: rs ! stomatal resistance associated with dry deposition velocity (s/m) - real(r8) :: rc !combined surface resistance - real(r8) :: cts !correction to flu rcl and rgs for frost - real(r8) :: rlux_o3 !to calculate O3 leaf resistance in dew/rain conditions - - ! constants - real(r8), parameter :: slope = 0._r8 ! Used to calculate rdc in (lower canopy resistance) - integer, parameter :: wveg_unset = -1 ! Unset Wesley vegetation type - character(len=32), parameter :: subname = "depvel_compute" - - ! jfl : mods for PAN - real(r8) :: dv_pan - real(r8) :: c0_pan(11) = (/ 0.000_r8, 0.006_r8, 0.002_r8, 0.009_r8, 0.015_r8, & - 0.006_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.002_r8, 0.002_r8 /) - real(r8) :: k_pan (11) = (/ 0.000_r8, 0.010_r8, 0.005_r8, 0.004_r8, 0.003_r8, & - 0.005_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.075_r8, 0.002_r8 /) - !----------------------------------------------------------------------- - - if ( n_drydep == 0 .or. drydep_method /= DD_XLND ) return - - associate( & - forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (visible only) - forc_solad => atm2lnd_inst%forc_solad_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (visible only) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric specific humidity (kg/kg) - forc_psrf => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] downscaled surface pressure (Pa) - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain rate [mm/s] - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - - ram1 => frictionvel_inst%ram1_patch , & ! Input: [real(r8) (:) ] aerodynamical resistance - rb1 => frictionvel_inst%rb1_patch , & ! Input: [real(r8) (:) ] leaf boundary layer resistance [s/m] - vds => frictionvel_inst%vds_patch , & ! Input: [real(r8) (:) ] aerodynamical resistance - - rssun => photosyns_inst%rssun_patch , & ! Input: [real(r8) (:) ] stomatal resistance - rssha => photosyns_inst%rssha_patch , & ! Input: [real(r8) (:) ] shaded stomatal resistance (s/m) - - fsun => canopystate_inst%fsun_patch , & ! Input: [real(r8) (:) ] sunlit fraction of canopy - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - mlaidiff => canopystate_inst%mlaidiff_patch , & ! Input: [real(r8) (:) ] difference in lai between month one and month two - annlai => canopystate_inst%annlai_patch , & ! Input: [real(r8) (:,:) ] 12 months of monthly lai from input data set - - velocity => drydepvel_inst%velocity_patch , & ! Output: [real(r8) (:,:) ] cm/sec - rs_drydep => drydepvel_inst%rs_drydep_patch & ! Output: [real(r8) (:) ] stomatal resistance associated with Ozone dry deposition velocity (s/m) - ) - - !_________________________________________________________________ - ! Begin loop through patches - - pft_loop: do pi = bounds%begp,bounds%endp - l = patch%landunit(pi) - - active: if (patch%active(pi)) then - - c = patch%column(pi) - g = patch%gridcell(pi) - pg = forc_psrf(c) - spec_hum = forc_q(c) - rain = forc_rain(c) - sfc_temp = forc_t(c) - solar_flux = forc_solad(g,1) - lat = grc%latdeg(g) - lon = grc%londeg(g) - clmveg = patch%itype(pi) - soilw = h2osoi_vol(c,1) - - !map CLM veg type into Wesely veg type - wesveg = wveg_unset - if (clmveg == noveg ) wesveg = 8 - if (clmveg == ndllf_evr_tmp_tree ) wesveg = 5 - if (clmveg == ndllf_evr_brl_tree ) wesveg = 5 - if (clmveg == ndllf_dcd_brl_tree ) wesveg = 5 - if (clmveg == nbrdlf_evr_trp_tree ) wesveg = 4 - if (clmveg == nbrdlf_evr_tmp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_trp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_tmp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_brl_tree ) wesveg = 4 - if (clmveg == nbrdlf_evr_shrub ) wesveg = 11 - if (clmveg == nbrdlf_dcd_tmp_shrub ) wesveg = 11 - if (clmveg == nbrdlf_dcd_brl_shrub ) wesveg = 11 - if (clmveg == nc3_arctic_grass ) wesveg = 3 - if (clmveg == nc3_nonarctic_grass ) wesveg = 3 - if (clmveg == nc4_grass ) wesveg = 3 - if (clmveg == nc3crop ) wesveg = 2 - if (clmveg == nc3irrig ) wesveg = 2 - if (clmveg >= npcropmin .and. clmveg <= npcropmax ) wesveg = 2 - if (wesveg == wveg_unset )then - write(iulog,*) 'clmveg = ', clmveg, 'lun%itype = ', lun%itype(l) - call endrun(decomp_index=pi, clmlevel=namep, & - msg='ERROR: Not able to determine Wesley vegetation type'//& - errMsg(sourcefile, __LINE__)) - end if - - ! create seasonality index used to index wesely data tables from LAI, Bascially - !if elai is between max lai from input data and half that max the index_season=1 - - - !mail1j and mlai2j are the two monthly lai values pulled from a CLM input data set - !/fs/cgd/csm/inputdata/lnd/clm2/rawdata/mksrf_lai.nc. lai for dates in the middle - !of the month are interpolated using using these values and stored in the variable - !elai (done elsewhere). If the difference between mlai1j and mlai2j is greater - !than zero it is assumed to be fall and less than zero it is assumed to be spring. - - !wesely seasonal "index_season" - ! 1 - midsummer with lush vegetation - ! 2 - Autumn with unharvested cropland - ! 3 - Late autumn after frost, no snow - ! 4 - Winter, snow on ground and subfreezing - ! 5 - Transitional spring with partially green short annuals - - - !mlaidiff=jan-feb - minlai=minval(annlai(:,pi)) - maxlai=maxval(annlai(:,pi)) - - index_season = -1 - - if ( lun%itype(l) /= istsoil )then - if ( lun%itype(l) == istice_mec ) then - wesveg = 8 - index_season = 4 - elseif ( lun%itype(l) == istdlak ) then - wesveg = 7 - index_season = 4 - elseif ( lun%itype(l) == istwet ) then - wesveg = 9 - index_season = 2 - elseif ( lun%urbpoi(l) ) then - wesveg = 1 - index_season = 2 - end if - else if ( snow_depth(c) > 0 ) then - index_season = 4 - else if(elai(pi) > 0.5_r8*maxlai) then - index_season = 1 - endif - - if (index_season<0) then - if (elai(pi) < (minlai+0.05*(maxlai-minlai))) then - index_season = 3 - endif - endif - - if (index_season<0) then - if (mlaidiff(pi) > 0.0_r8) then - index_season = 2 - elseif (mlaidiff(pi) < 0.0_r8) then - index_season = 5 - elseif (mlaidiff(pi).eq.0.0_r8) then - index_season = 3 - endif - endif - - if (index_season<0) then - call endrun('ERROR: not able to determine season'//errmsg(sourcefile, __LINE__)) - endif - - ! saturation specific humidity - ! - es = 611_r8*exp(5414.77_r8*((1._r8/tmelt)-(1._r8/sfc_temp))) - ws = .622_r8*es/(pg-es) - qs = ws/(1._r8+ws) - - has_dew = .false. - if( qs <= spec_hum ) then - has_dew = .true. - end if - if( sfc_temp < tmelt ) then - has_dew = .false. - end if - - has_rain = rain > rain_threshold - - if ( has_dew .or. has_rain ) then - dewm = 3._r8 - else - dewm = 1._r8 - end if - - !Define tc - tc = sfc_temp - tmelt - - ! - ! rdc (lower canopy res) - ! - rdc=100._r8*(1._r8+1000._r8/(solar_flux+10._r8))/(1._r8+1000._r8*slope) - - ! surface resistance : depends on both land type and species - ! land types are computed seperately, then resistance is computed as average of values - ! following wesely rc=(1/(rs+rm) + 1/rlu +1/(rdc+rcl) + 1/(rac+rgs))**-1 - - !******************************************************* - call seq_drydep_setHCoeff( sfc_temp, heff(:n_drydep) ) - !********************************************************* - - species_loop1: do ispec=1, n_drydep - if(mapping(ispec) <= 0) cycle - - if(ispec.eq.index_o3.or.ispec.eq.index_o3a.or.ispec.eq.index_so2) then - rmx=0._r8 - else - rmx=1._r8/((heff(ispec)/3000._r8)+(100._r8*foxd(ispec))) - endif - - ! correction for frost - cts = 1000._r8*exp( -tc - 4._r8 ) - - !ground resistance - rgsx(ispec) = 1._r8/((heff(ispec)/(1.e5_r8*(rgss(index_season,wesveg)+cts))) + & - (foxd(ispec)/(rgso(index_season,wesveg)+cts))) - - !------------------------------------------------------------------------------------- - ! special case for H2 and CO;; CH4 is set ot a fraction of dv(H2) - !------------------------------------------------------------------------------------- - if( ispec == index_h2 .or. ispec == index_co .or. ispec == index_ch4 ) then - - if( ispec == index_co ) then - fact_h2 = 1.0_r8 - elseif ( ispec == index_h2 ) then - fact_h2 = 0.5_r8 - elseif ( ispec == index_ch4 ) then - fact_h2 = 50.0_r8 - end if - - !------------------------------------------------------------------------------------- - ! no deposition on snow, ice, desert, and water - !------------------------------------------------------------------------------------- - if( wesveg == 1 .or. wesveg == 7 .or. wesveg == 8 .or. index_season == 4 ) then - rgsx(ispec) = spval - else - var_soilw = max( .1_r8,min( soilw,.3_r8 ) ) - if( wesveg == 3 ) then - var_soilw = log( var_soilw ) - end if - dv_soil_h2 = h2_c(wesveg) + var_soilw*(h2_b(wesveg) + var_soilw*h2_a(wesveg)) - if( dv_soil_h2 > 0._r8 ) then - rgsx(ispec) = fact_h2/(dv_soil_h2*1.e-4_r8) - end if - end if - end if - - !------------------------------------------------------------------------------------- - ! no deposition on water or no vegetation or snow (elai<=0) - !------------------------------------------------------------------------------------- - - no_dep: if( wesveg == 7 .or. elai(pi).le.0_r8 ) then !mvm 11/26/2013 - rclx(ispec) = spval - rsmx(ispec) = spval - rlux(ispec) = spval - rs = spval - else - - !Stomatal resistance - - ! fvitt -- at midnight rssun and/or rssha can be zero in some places which sets rs to zero - ! --- this fix prevents divide by zero error (when rsmx is zero) - if (rssun(pi)>0._r8 .and. rssun(pi)<1.e30 .and. rssha(pi)>0._r8 .and. rssha(pi)<1.e30 ) then - !LKE: corrected rs to add rssun and rssha in parallel (11/30/2017) - rs=1._r8/(fsun(pi)*elai(pi)/rssun(pi) + (1.-fsun(pi))*elai(pi)/rssha(pi)) - else - rs=spval - endif - - rsmx(ispec) = rs*drat(ispec)+rmx - - ! Leaf resistance - !MVM: adjusted rlu by LAI to get leaf resistance over bulk canopy (gao and wesely, 1995) - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec) = rlu_lai/(1.e-5_r8*heff(ispec)+foxd(ispec)) - - !Lower canopy resistance - rclx(ispec) = 1._r8/((heff(ispec)/(1.e5_r8*(rcls(index_season,wesveg)+cts))) + & - (foxd(ispec)/(rclo(index_season,wesveg)+cts))) - - !----------------------------------- - !mvm 11/30/2013: special case for CO - !Dry deposition of CO and hydrocarbons is negligibly - !small in vegetation [Mueller and Brasseur, 1995]. - !------------------------------------ - if( ispec == index_co ) then - rclx(ispec) = spval - rsmx(ispec) = spval - rlux(ispec) = spval - endif - - !-------------------------------------------- - ! jfl : special case for PAN - !-------------------------------------------- - if( ispec == index_pan ) then - dv_pan = c0_pan(wesveg) * (1._r8 - exp(-k_pan(wesveg)*(rs*drat(ispec))*1.e-2_r8 )) - - if( dv_pan > 0._r8 .and. index_season /= 4 ) then - rsmx(ispec) = ( 1._r8/dv_pan ) - end if - end if - - endif no_dep - if ( ispec == index_o3 )then - rs_drydep(pi) = rs - end if - - end do species_loop1 - - - !---------------------------------------------- - !Adjustment for dew and rain in leaf resitances - !--------------------------------------------- - ! no effect over water - no_water: if( wesveg.ne.7 ) then - !MVM: effect only on vegetated areas (elai> 0) - with_LAI: if (elai(pi).gt.0._r8) then - - ! - ! no effect if sfc_temp < O C - ! - non_freezing: if(sfc_temp.gt.tmelt) then - if( has_dew ) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux_o3 = 1._r8/((1._r8/3000._r8)+(1._r8/(3._r8*rlu_lai))) - - if (index_o3 > 0) then - rlux(index_o3) = rlux_o3 - endif - if (index_o3a > 0) then - rlux(index_o3a) = rlux_o3 - endif - endif - - if(has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux_o3 = 1._r8/((1._r8/1000._r8)+(1._r8/(3._r8*rlu_lai))) - - if (index_o3 > 0) then - rlux(index_o3) = rlux_o3 - endif - if (index_o3a > 0) then - rlux(index_o3a) = rlux_o3 - endif - endif - - species_loop2: do ispec=1,n_drydep - if(mapping(ispec).le.0) cycle - if(ispec.ne.index_o3.and.ispec.ne.index_o3a.and.ispec.ne.index_so2) then - - if( has_dew .or. has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec)=1._r8/((1._r8/(3._r8*rlu_lai))+ & - (1.e-7_r8*heff(ispec))+(foxd(ispec)/rlux_o3)) - endif - - elseif(ispec.eq.index_so2) then - - if( has_dew ) then - rlux(ispec) = 100._r8 - endif - - if(has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec) = 1._r8/((1._r8/5000._r8)+(1._r8/(3._r8*rlu_lai))) - endif - - if( has_dew .or. has_rain ) then - !MVM:rlux=50 for SO2 in dew or rain only for *urban land* type surfaces. - if (wesveg.eq.1) then - rlux(ispec)=50._r8 - endif - endif - end if - !mvm 11/30/2013: special case for CO - if( ispec.eq.index_co ) then - rlux(ispec) = spval - endif - end do species_loop2 - endif non_freezing - endif with_LAI - endif no_water - - ! resistance for aerosols - rds = 1._r8/vds(pi) - - species_loop3: do ispec=1,n_drydep - if(mapping(ispec) <= 0) cycle - - ! - ! compute rc - ! - rc = 1._r8/((1._r8/rsmx(ispec))+(1._r8/rlux(ispec)) + & - (1._r8/(rdc+rclx(ispec)))+(1._r8/(rac(index_season,wesveg)+rgsx(ispec)))) - rc = max( 10._r8, rc) - ! - ! assume no surface resistance for SO2 over water - ! - if ( drydep_list(ispec) == 'SO2' .and. wesveg == 7 ) then - rc = 0._r8 - end if - - select case( drydep_list(ispec) ) - case ( 'SO4' ) - velocity(pi,ispec) = (1._r8/(ram1(pi)+rds))*100._r8 - case ( 'NH4','NH4NO3','XNH4NO3' ) - velocity(pi,ispec) = (1._r8/(ram1(pi)+0.5_r8*rds))*100._r8 - case ( 'Pb' ) - velocity(pi,ispec) = 0.2_r8 - case ( 'CB1', 'CB2', 'OC1', 'OC2', 'SOAM', 'SOAI', 'SOAT', 'SOAB', 'SOAX' ) - velocity(pi,ispec) = 0.10_r8 - case ( 'SO2' ) - velocity(pi,ispec) = (1._r8/(ram1(pi)+rb1(pi)+rc))*200._r8 - case default - velocity(pi,ispec) = (1._r8/(ram1(pi)+rb1(pi)+rc))*100._r8 - end select - end do species_loop3 - endif active - end do pft_loop - - end associate - - end subroutine depvel_compute - -end module DryDepVelocity diff --git a/src/biogeochem/EDBGCDynMod.F90 b/src/biogeochem/EDBGCDynMod.F90 deleted file mode 100644 index 107cdf91c0..0000000000 --- a/src/biogeochem/EDBGCDynMod.F90 +++ /dev/null @@ -1,362 +0,0 @@ -module EDBGCDynMod - -! This module creates a pathway to call the belowground biogeochemistry code as driven by the fates vegetation model -! but bypassing the aboveground CN vegetation code. It is modeled after the CNDriverMod in its call sequence and -! functionality. - - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : use_c13, use_c14, use_fates - use decompMod , only : bounds_type - use perf_mod , only : t_startf, t_stopf - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : use_century_decomp, use_nitrif_denitrif - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use CanopyStateType , only : canopystate_type - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use atm2lndType , only : atm2lnd_type - use SoilStateType , only : soilstate_type - use ch4Mod , only : ch4_type - - - ! public :: EDBGCDynInit ! BGC dynamics: initialization - public :: EDBGCDyn ! BGC Dynamics - public :: EDBGCDynSummary ! BGC dynamics: summary - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - - !----------------------------------------------------------------------- - subroutine EDBGCDyn(bounds, & - num_soilc, filter_soilc, num_soilp, filter_soilp, num_pcropp, filter_pcropp, doalb, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst) - ! - ! !DESCRIPTION: - - ! - ! !USES: - use clm_varpar , only: nlevgrnd, nlevdecomp_full - use clm_varpar , only: nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use subgridAveMod , only: p2c - use CropType , only: crop_type - use CNNDynamicsMod , only: CNNDeposition,CNNFixation, CNNFert, CNSoyfix - use CNMRespMod , only: CNMResp - use CNPhenologyMod , only: CNPhenology - use CNGRespMod , only: CNGResp - use CNCIsoFluxMod , only: CIsoFlux1, CIsoFlux2, CIsoFlux2h, CIsoFlux3 - use CNC14DecayMod , only: C14Decay - use CNCStateUpdate1Mod , only: CStateUpdate1,CStateUpdate0 - use CNCStateUpdate2Mod , only: CStateUpdate2, CStateUpdate2h - use CNCStateUpdate3Mod , only: CStateUpdate3 - use CNNStateUpdate1Mod , only: NStateUpdate1 - use CNNStateUpdate2Mod , only: NStateUpdate2, NStateUpdate2h - use CNGapMortalityMod , only: CNGapMortality - use dynHarvestMod , only: CNHarvest - use SoilBiogeochemDecompCascadeBGCMod , only: decomp_rate_constants_bgc - use SoilBiogeochemDecompCascadeCNMod , only: decomp_rate_constants_cn - use SoilBiogeochemCompetitionMod , only: SoilBiogeochemCompetition - use SoilBiogeochemDecompMod , only: SoilBiogeochemDecomp - use SoilBiogeochemLittVertTranspMod , only: SoilBiogeochemLittVertTransp - use SoilBiogeochemPotentialMod , only: SoilBiogeochemPotential - use SoilBiogeochemVerticalProfileMod , only: SoilBiogeochemVerticalProfile - use SoilBiogeochemNitrifDenitrifMod , only: SoilBiogeochemNitrifDenitrif - use SoilBiogeochemNStateUpdate1Mod , only: SoilBiogeochemNStateUpdate1 - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter - integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches - logical , intent(in) :: doalb ! true = surface albedo calculation time step - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(crop_type) , intent(in) :: crop_inst - type(ch4_type) , intent(in) :: ch4_inst - ! - ! !LOCAL VARIABLES: - real(r8):: cn_decomp_pools(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_pools) - real(r8):: p_decomp_cpool_loss(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_cascade_transitions) !potential C loss from one pool to another - real(r8):: pmnf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,1:ndecomp_cascade_transitions) !potential mineral N flux, from one pool to another - real(r8):: arepr(bounds%begp:bounds%endp) ! reproduction allocation coefficient (only used for crop_prog) - real(r8):: aroot(bounds%begp:bounds%endp) ! root allocation coefficient (only used for crop_prog) - integer :: begp,endp - integer :: begc,endc - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - !real(r8) , intent(in) :: rootfr_patch(bounds%begp:, 1:) - !integer , intent(in) :: altmax_lastyear_indx_col(bounds%begc:) ! frost table depth (m) - - associate( & - rootfr_patch => soilstate_inst%rootfr_patch , & ! fraction of roots in each soil layer (nlevgrnd) - altmax_lastyear_indx_col => canopystate_inst%altmax_lastyear_indx_col , & ! frost table depth (m) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch , & ! Output: [integer (:) ] frac of vegetation not covered by snow [-] - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow - elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index with burying by snow - htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) - hbot => canopystate_inst%hbot_patch & ! Output: [real(r8) (:) ] canopy bottom (m) - ) - - ! -------------------------------------------------- - ! zero the column-level C and N fluxes - ! -------------------------------------------------- - - call t_startf('BGCZero') - - call soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonflux_inst%SetValues( & - num_soilc, filter_soilc, 0._r8) - end if - - call t_stopf('BGCZero') - - ! -------------------------------------------------- - ! Nitrogen Deposition, Fixation and Respiration - ! -------------------------------------------------- - - ! call t_startf('CNDeposition') - ! call CNNDeposition(bounds, & - ! atm2lnd_inst, soilbiogeochem_nitrogenflux_inst) - ! call t_stopf('CNDeposition') - - - ! if (crop_prog) then - ! call CNNFert(bounds, num_soilc,filter_soilc, & - ! cnveg_nitrogenflux_inst, soilbiogeochem_nitrogenflux_inst) - - ! call CNSoyfix (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - ! waterstate_inst, crop_inst, cnveg_state_inst, cnveg_nitrogenflux_inst , & - ! soilbiogeochem_state_inst, soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! end if - - !-------------------------------------------- - ! Soil Biogeochemistry - !-------------------------------------------- - - if (use_century_decomp) then - call decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - else - call decomp_rate_constants_cn(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - end if - - ! calculate potential decomp rates and total immobilization demand (previously inlined in CNDecompAlloc) - call SoilBiogeochemPotential (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools=cn_decomp_pools(begc:endc,1:nlevdecomp,1:ndecomp_pools), & - p_decomp_cpool_loss=p_decomp_cpool_loss(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions), & - pmnf_decomp_cascade=pmnf_decomp_cascade(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions)) - - - !-------------------------------------------- - ! Resolve the competition between plants and soil heterotrophs - ! for available soil mineral N resource - !-------------------------------------------- - ! will add this back in when integrtating hte nutirent cycles - - - !-------------------------------------------- - ! Calculate litter and soil decomposition rate - !-------------------------------------------- - - ! Calculation of actual immobilization and decomp rates, following - ! resolution of plant/heterotroph competition for mineral N (previously inlined in CNDecompAllocation in CNDecompMod) - - call t_startf('SoilBiogeochemDecomp') - - call SoilBiogeochemDecomp (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools=cn_decomp_pools(begc:endc,1:nlevdecomp,1:ndecomp_pools), & - p_decomp_cpool_loss=p_decomp_cpool_loss(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions), & - pmnf_decomp_cascade=pmnf_decomp_cascade(begc:endc,1:nlevdecomp,1:ndecomp_cascade_transitions)) - - call t_stopf('SoilBiogeochemDecomp') - - - !-------------------------------------------- - ! Update1 - !-------------------------------------------- - - call t_startf('BNGCUpdate1') - - - ! Update all prognostic carbon state variables (except for gap-phase mortality and fire fluxes) - call CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & - crop_inst, cnveg_carbonflux_inst, cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst) - - call t_stopf('BNGCUpdate1') - - !-------------------------------------------- - ! Calculate vertical mixing of soil and litter pools - !-------------------------------------------- - - call t_startf('SoilBiogeochemLittVertTransp') - - call SoilBiogeochemLittVertTransp(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilbiogeochem_state_inst, & - soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - - call t_stopf('SoilBiogeochemLittVertTransp') - - end associate - - end subroutine EDBGCDyn - - - !----------------------------------------------------------------------- - subroutine EDBGCDynSummary(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - clm_fates, nc) - ! - ! !DESCRIPTION: - ! Call to all CN and SoilBiogeochem summary routines - ! also aggregate production and decomposition fluxes to whole-ecosystem balance fluxes - ! - ! !USES: - use clm_varpar , only: ndecomp_cascade_transitions - use CNPrecisionControlMod , only: CNPrecisionControl - use SoilBiogeochemPrecisionControlMod , only: SoilBiogeochemPrecisionControl - use CLMFatesInterfaceMod , only: hlm_fates_interface_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(hlm_fates_interface_type) , intent(inout) :: clm_fates - integer , intent(in) :: nc ! thread index - ! - ! !LOCAL VARIABLES: - integer :: begc,endc - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - ! Call to all summary routines - - call t_startf('BGCsum') - - ! Set controls on very low values in critical state variables - - call SoilBiogeochemPrecisionControl(num_soilc, filter_soilc, & - soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst,soilbiogeochem_nitrogenstate_inst) - - ! Note - all summary updates to cnveg_carbonstate_inst and cnveg_carbonflux_inst are done in - ! soilbiogeochem_carbonstate_inst%summary and CNVeg_carbonstate_inst%summary - - ! ---------------------------------------------- - ! soilbiogeochem carbon/nitrogen state summary - ! ---------------------------------------------- - - call soilbiogeochem_carbonstate_inst%summary(bounds, num_soilc, filter_soilc) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonstate_inst%summary(bounds, num_soilc, filter_soilc) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonstate_inst%summary(bounds, num_soilc, filter_soilc) - end if - ! call soilbiogeochem_nitrogenstate_inst%summary(bounds, num_soilc, filter_soilc) - - ! ---------------------------------------------- - ! soilbiogeochem carbon/nitrogen flux summary - ! ---------------------------------------------- - - call soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - if ( use_c13 ) then - call c13_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - end if - if ( use_c14 ) then - call c14_soilbiogeochem_carbonflux_inst%Summary(bounds, num_soilc, filter_soilc) - end if - ! call soilbiogeochem_nitrogenflux_inst%Summary(bounds, num_soilc, filter_soilc) - - - ! ----------------------------------------------------------------------------------- - ! fates veg carbon state and flux summary, Nitrogen (TBD) and Balance Checks - ! ----------------------------------------------------------------------------------- - ! ---------------------------------------------- - ! fates veg nitrogen flux summary - ! ---------------------------------------------- - ! ---------------------------------------------- - ! calculate balance checks on entire carbon cycle (FATES + BGC) - ! ---------------------------------------------- - - call clm_fates%wrap_bgc_summary(nc, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_carbonstate_inst) - - call t_stopf('BGCsum') - - end subroutine EDBGCDynSummary - -end module EDBGCDynMod diff --git a/src/biogeochem/FireEmisFactorsMod.F90 b/src/biogeochem/FireEmisFactorsMod.F90 deleted file mode 100644 index 7aef11ffc3..0000000000 --- a/src/biogeochem/FireEmisFactorsMod.F90 +++ /dev/null @@ -1,262 +0,0 @@ -module FireEmisFactorsMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: FireEmisFactorsMod -! -! !DESCRIPTION: -! Manages input of fire emissions factors from netCDF file -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : iulog -! - implicit none - private - save -! -! !PUBLIC MEMBERS: - public :: fire_emis_factors_init - public :: fire_emis_factors_get - -! !PRIVATE MEMBERS: - integer :: npfts ! number of plant function types -! - type emis_eff_t - real(r8), pointer :: eff(:) ! emissions efficiency factor - real(r8) :: wght ! molecular weight - endtype emis_eff_t -! - type(emis_eff_t), pointer :: comp_factors_table(:) ! hash table of FireEmis factors (points to an array of pointers) - integer, pointer :: hash_table_indices(:) ! pointer to hash table indices - integer, parameter :: tbl_hash_sz = 2**16 ! hash table size -! -! -! !REVISION HISTORY: -! 28 Oct 2011: Created by Francis Vitt -! -!EOP -!----------------------------------------------------------------------- -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: fire_emis_factors_get -! -! !INTERFACE: - subroutine fire_emis_factors_get( comp_name, factors, molecwght ) -! -! !DESCRIPTION: -! Method for getting FireEmis information for a named compound -! -! !USES: - use pftconMod , only : nc3crop -! !ARGUMENTS: - character(len=*),intent(in) :: comp_name ! FireEmis compound name - real(r8), intent(out) :: factors(:) ! vegetation type factors for the compound of interest - real(r8), intent(out) :: molecwght ! molecular weight of the compound of intrest -! -!EOP -!----------------------------------------------------------------------- -! local vars: - integer :: hashkey, ndx - character(len=120) :: errmes - - hashkey = gen_hashkey(comp_name) - ndx = hash_table_indices(hashkey) - - if (ndx<1) then - errmes = 'fire_emis_factors_get: '//trim(comp_name)//' compound not found in FireEmis table' - write(iulog,*) trim(errmes) - call endrun(errmes) - endif - - factors(:npfts) = comp_factors_table( ndx )%eff(:npfts) - if ( size(factors) > npfts )then - factors(npfts+1:) = comp_factors_table( ndx )%eff(nc3crop) - end if - molecwght = comp_factors_table( ndx )%wght - - end subroutine fire_emis_factors_get -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: fire_emis_factors_init -! -! !INTERFACE: - subroutine fire_emis_factors_init( filename ) -! -! !DESCRIPTION: -! Initializes the FireEmis factors using data from input file -! -! !USES: - use ncdio_pio, only : ncd_pio_openfile,ncd_inqdlen - use pio, only : pio_inq_varid,pio_get_var,file_desc_t,pio_closefile - use fileutils , only : getfil - use clm_varpar , only : mxpft -! -! !ARGUMENTS: - character(len=*),intent(in) :: filename ! FireEmis factors input file - -!EOP -!----------------------------------------------------------------------- -! - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - - integer :: start(2), count(2) - - integer :: ierr, i, vid - integer :: dimid, n_comps, n_pfts - integer :: comp_ef_vid,comp_name_vid,comp_mw_vid - - real(r8), allocatable :: comp_factors(:) - character(len=64), allocatable :: comp_names(:) ! FireEmis compound names - real(r8), allocatable :: comp_molecwghts(:)! FireEmis compound molecular weights - - allocate(comp_factors_table(150)) - allocate(hash_table_indices(tbl_hash_sz)) - - call getfil(filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call ncd_inqdlen( ncid, dimid, n_comps, name='Comp_Num') - call ncd_inqdlen( ncid, dimid, n_pfts, name='PFT_Num') - - npfts = n_pfts - if ( npfts /= mxpft .and. npfts /= 16 )then - call endrun('Number of PFTs on fire emissions file is NOT correct. Its neither the total number of PFTS nor 16') - end if - - ierr = pio_inq_varid(ncid,'Comp_EF', comp_ef_vid) - ierr = pio_inq_varid(ncid,'Comp_Name',comp_name_vid) - ierr = pio_inq_varid(ncid,'Comp_MW', comp_mw_vid) - - allocate( comp_factors(n_pfts) ) - allocate( comp_names(n_comps) ) - allocate( comp_molecwghts(n_comps) ) - - ierr = pio_get_var( ncid, comp_name_vid, comp_names ) - ierr = pio_get_var( ncid, comp_mw_vid, comp_molecwghts ) - - ! set up hash table where data is stored - call bld_hash_table_indices( comp_names ) - do i=1,n_comps - start=(/i,1/) - count=(/1,npfts/) - ierr = pio_get_var( ncid, comp_ef_vid, start, count, comp_factors ) - - call enter_hash_data( trim(comp_names(i)), comp_factors, comp_molecwghts(i) ) - enddo - - call pio_closefile(ncid) - - deallocate( comp_factors, comp_names, comp_molecwghts ) - - endsubroutine fire_emis_factors_init -!----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! Private methods... - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine bld_hash_table_indices( names ) - character(len=*),intent(in) :: names(:) - - integer :: n, i, hashkey - - hash_table_indices(:) = 0 - - n = size(names) - do i=1,n - hashkey = gen_hashkey(names(i)) - hash_table_indices(hashkey) = i - enddo - - endsubroutine bld_hash_table_indices - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine enter_hash_data( name, data, molec_wght ) - character(len=*), intent(in) :: name - real(r8), intent(in) :: data(:) - real(r8), intent(in) :: molec_wght - - integer :: hashkey, ndx - integer :: nfactors - - hashkey = gen_hashkey(name) - nfactors = size(data) - ndx = hash_table_indices(hashkey) - - if(ndx < 1) then - call endrun('ndx out of bounds '//name) - endif - - allocate (comp_factors_table(ndx)%eff(nfactors)) - - comp_factors_table(ndx)%eff(:) = data(:) - comp_factors_table(ndx)%wght = molec_wght - - end subroutine enter_hash_data - - !----------------------------------------------------------------------- - !from cam_history - ! - ! Purpose: Generate a hash key on the interval [0 .. tbl_hash_sz-1] - ! given a character string. - ! - ! Algorithm is a variant of perl's internal hashing function. - ! - !----------------------------------------------------------------------- - integer function gen_hashkey(string) - - implicit none - ! - ! Arguments: - ! - character(len=*), intent(in) :: string - ! - ! Local vars - ! - integer :: hash - integer :: i - integer :: strlen - integer, parameter :: tbl_max_idx = 15 ! 2**N - 1 - integer, parameter :: gen_hash_key_offset = z'000053db' - integer, dimension(0:tbl_max_idx) :: tbl_gen_hash_key = (/61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1/) - - hash = gen_hash_key_offset - strlen = len_trim(string) - if ( strlen /= 19 ) then - ! - ! Process arbitrary string length. - ! - do i = 1, strlen - hash = ieor(hash , (ichar(string(i:i)) * tbl_gen_hash_key(iand(i-1,tbl_max_idx)))) - end do - else - ! - ! Special case string length = 19 - ! - do i = 1, tbl_max_idx+1 - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-1)) - end do - do i = tbl_max_idx+2, strlen - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-tbl_max_idx-2)) - end do - end if - - gen_hashkey = iand(hash, tbl_hash_sz-1) - - return - - end function gen_hashkey - -end module FireEmisFactorsMod - - diff --git a/src/biogeochem/MEGANFactorsMod.F90 b/src/biogeochem/MEGANFactorsMod.F90 deleted file mode 100644 index 8c91959b88..0000000000 --- a/src/biogeochem/MEGANFactorsMod.F90 +++ /dev/null @@ -1,307 +0,0 @@ -module MEGANFactorsMod - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Manages input of MEGAN emissions factors from netCDF file - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : iulog - use shr_log_mod, only : errMsg => shr_log_errMsg - ! - implicit none - private - ! - ! !PUBLIC MEMBERS: - public :: megan_factors_init - public :: megan_factors_get - public :: comp_names - ! - ! !PUBLIC DATA: - real(r8), public, allocatable :: LDF(:) ! light dependent fraction - real(r8), public, allocatable :: Agro(:) ! growing leaf age factor - real(r8), public, allocatable :: Amat(:) ! mature leaf age factor - real(r8), public, allocatable :: Anew(:) ! new leaf age factor - real(r8), public, allocatable :: Aold(:) ! old leaf age factor - real(r8), public, allocatable :: betaT(:)! temperature factor - real(r8), public, allocatable :: ct1(:) ! temperature coefficient 1 - real(r8), public, allocatable :: ct2(:) ! temperature coefficient 2 - real(r8), public, allocatable :: Ceo(:) ! Eopt coefficient - ! - ! !PRIVATE MEMBERS: - integer :: npfts ! number of plant function types - ! - type emis_eff_t - real(r8) , pointer :: eff (:) ! [real(r8) (:)] emissions efficiency factor - real(r8) :: wght ! molecular weight - integer :: class_num ! MEGAN class number - endtype emis_eff_t - ! - type(emis_eff_t) , pointer :: comp_factors_table (:) ! [type(emis_eff_t) (:)] hash table of MEGAN factors (points to an array of pointers) - integer , pointer :: hash_table_indices (:) ! [integer (:)] pointer to hash table indices - integer, parameter :: tbl_hash_sz = 2**16 ! hash table size - ! - character(len=40), allocatable :: comp_names(:) ! MEGAN compound names - real(r8), allocatable :: comp_molecwghts(:)! MEGAN compound molecular weights - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine megan_factors_get( comp_name, factors, class_n, molecwght ) - ! - ! !DESCRIPTION: - ! Method for getting MEGAN information for a named compound - ! - ! !ARGUMENTS: - character(len=*),intent(in) :: comp_name ! MEGAN compound name - real(r8), intent(out) :: factors(npfts) ! vegitation type factors for the compound of intrest - integer, intent(out) :: class_n ! MEGAN class number for the compound of intrest - real(r8), intent(out) :: molecwght ! molecular weight of the compound of intrest - ! - ! LOCAL VARS: - integer :: hashkey, ndx - character(len=120) :: errmes - !----------------------------------------------------------------------- - - hashkey = gen_hashkey(comp_name) - ndx = hash_table_indices(hashkey) - - if (ndx<1) then - errmes = 'megan_factors_get: '//trim(comp_name)//' compound not found in MEGAN table' - write(iulog,*) trim(errmes) - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - factors(:) = comp_factors_table( ndx )%eff(:) - class_n = comp_factors_table( ndx )%class_num - molecwght = comp_factors_table( ndx )%wght - - end subroutine megan_factors_get - - !----------------------------------------------------------------------- - subroutine megan_factors_init( filename ) - ! - ! !DESCRIPTION: - ! Initializes the MEGAN factors using data from input file - ! - ! !USES: - use ncdio_pio, only : ncd_pio_openfile,ncd_inqdlen - use pio, only : pio_inq_varid,pio_get_var,file_desc_t,pio_closefile - use fileutils , only : getfil - use clm_varpar , only : mxpft - ! - ! !ARGUMENTS: - character(len=*),intent(in) :: filename ! MEGAN factors input file - !----------------------------------------------------------------------- - - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - - integer :: start(2), count(2) - - integer :: ierr, i, vid - integer :: dimid, n_comps, n_classes, n_patchs - integer :: class_ef_vid,comp_ef_vid,comp_name_vid,class_num_vid - integer :: comp_mw_vid - integer, allocatable :: class_nums(:) - - real(r8),allocatable :: factors(:) - real(r8),allocatable :: comp_factors(:) - real(r8),allocatable :: class_factors(:) - - allocate(comp_factors_table(150)) - allocate(hash_table_indices(tbl_hash_sz)) - - - call getfil(filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call ncd_inqdlen( ncid, dimid, n_comps, name='Comp_Num') - call ncd_inqdlen( ncid, dimid, n_classes, name='Class_Num') - call ncd_inqdlen( ncid, dimid, n_patchs, name='PFT_Num') - - if ( n_patchs /= mxpft )then - call endrun(msg='PFT_Num does NOT equal mxpft: '//errMsg(sourcefile, __LINE__)) - end if - npfts = n_patchs - - ierr = pio_inq_varid(ncid,'Class_EF', class_ef_vid) - ierr = pio_inq_varid(ncid,'Comp_EF', comp_ef_vid) - ierr = pio_inq_varid(ncid,'Comp_Name',comp_name_vid) - ierr = pio_inq_varid(ncid,'Class_Num',class_num_vid) - ierr = pio_inq_varid(ncid,'Comp_MW', comp_mw_vid) - - allocate( factors(n_patchs) ) - allocate( comp_factors(n_patchs) ) - allocate( class_factors(n_patchs) ) - - factors(1:n_patchs) = 0._r8 - comp_factors(1:n_patchs) = 0._r8 - class_factors(1:n_patchs) = 0._r8 - - allocate( comp_names(n_comps) ) - allocate( comp_molecwghts(n_comps) ) - allocate( class_nums(n_comps) ) - - ierr = pio_get_var( ncid, comp_name_vid, comp_names ) - ierr = pio_get_var( ncid, comp_mw_vid, comp_molecwghts ) - ierr = pio_get_var( ncid, class_num_vid, class_nums ) - - ! set up hash table where data is stored - call bld_hash_table_indices( comp_names ) - do i=1,n_comps - start=(/i,1/) - count=(/1,mxpft/) - ierr = pio_get_var( ncid, comp_ef_vid, start, count, comp_factors ) - start=(/class_nums(i),1/) - ierr = pio_get_var( ncid, class_ef_vid, start, count, class_factors ) - factors(:) = comp_factors(:)*class_factors(:) - call enter_hash_data( trim(comp_names(i)), factors, class_nums(i), comp_molecwghts(i) ) - enddo - - allocate( LDF(n_classes) ) - allocate( Agro(n_classes) ) - allocate( Amat(n_classes) ) - allocate( Anew(n_classes) ) - allocate( Aold(n_classes) ) - allocate( betaT(n_classes) ) - allocate( ct1(n_classes) ) - allocate( ct2(n_classes) ) - allocate( Ceo(n_classes) ) - - ierr = pio_inq_varid(ncid,'LDF', vid) - ierr = pio_get_var( ncid, vid, LDF ) - - ierr = pio_inq_varid(ncid,'Agro', vid) - ierr = pio_get_var( ncid, vid, Agro ) - - ierr = pio_inq_varid(ncid,'Amat', vid) - ierr = pio_get_var( ncid, vid, Amat ) - - ierr = pio_inq_varid(ncid,'Anew', vid) - ierr = pio_get_var( ncid, vid, Anew ) - - ierr = pio_inq_varid(ncid,'Aold', vid) - ierr = pio_get_var( ncid, vid, Aold ) - - ierr = pio_inq_varid(ncid,'betaT', vid) - ierr = pio_get_var( ncid, vid, betaT ) - - ierr = pio_inq_varid(ncid,'ct1', vid) - ierr = pio_get_var( ncid, vid, ct1 ) - - ierr = pio_inq_varid(ncid,'ct2', vid) - ierr = pio_get_var( ncid, vid, ct2 ) - - ierr = pio_inq_varid(ncid,'Ceo', vid) - ierr = pio_get_var( ncid, vid, Ceo ) - - call pio_closefile(ncid) - - deallocate( class_nums, comp_factors,class_factors,factors ) - - endsubroutine megan_factors_init -!----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! Private methods... - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine bld_hash_table_indices( names ) - character(len=*),intent(in) :: names(:) - - integer :: n, i, hashkey - - hash_table_indices(:) = 0 - - n = size(names) - do i=1,n - hashkey = gen_hashkey(names(i)) - hash_table_indices(hashkey) = i - enddo - - endsubroutine bld_hash_table_indices - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine enter_hash_data( name, data, class_n, molec_wght ) - character(len=*), intent(in) :: name - real(r8), intent(in) :: data(:) - integer, intent(in) :: class_n - real(r8), intent(in) :: molec_wght - - integer :: hashkey, ndx - integer :: nfactors - - hashkey = gen_hashkey(name) - nfactors = size(data) - - ndx = hash_table_indices(hashkey) - - allocate (comp_factors_table(ndx)%eff(nfactors)) - - comp_factors_table(ndx)%eff(:) = data(:) - comp_factors_table(ndx)%class_num = class_n - comp_factors_table(ndx)%wght = molec_wght - - end subroutine enter_hash_data - - !----------------------------------------------------------------------- - !from cam_history - ! - ! Purpose: Generate a hash key on the interval [0 .. tbl_hash_sz-1] - ! given a character string. - ! - ! Algorithm is a variant of perl's internal hashing function. - ! - !----------------------------------------------------------------------- - integer function gen_hashkey(string) - - implicit none - ! - ! Arguments: - ! - character(len=*), intent(in) :: string - ! - ! Local vars - ! - integer :: hash - integer :: i - - integer, parameter :: tbl_max_idx = 15 ! 2**N - 1 - integer, parameter :: gen_hash_key_offset = z'000053db' - integer, dimension(0:tbl_max_idx) :: tbl_gen_hash_key = (/61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1/) - - hash = gen_hash_key_offset - - if ( len_trim(string) /= 19 ) then - ! - ! Process arbitrary string length. - ! - do i = 1, len_trim(string) - hash = ieor(hash , (ichar(string(i:i)) * tbl_gen_hash_key(iand(i-1,tbl_max_idx)))) - end do - else - ! - ! Special case string length = 19 - ! - do i = 1, tbl_max_idx+1 - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-1)) - end do - do i = tbl_max_idx+2, len_trim(string) - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-tbl_max_idx-2)) - end do - end if - - gen_hashkey = iand(hash, tbl_hash_sz-1) - - return - - end function gen_hashkey - -end module MEGANFactorsMod diff --git a/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 b/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 deleted file mode 100644 index 5d29efbeb5..0000000000 --- a/src/biogeochem/NutrientCompetitionCLM45defaultMod.F90 +++ /dev/null @@ -1,992 +0,0 @@ -module NutrientCompetitionCLM45defaultMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! DESCRIPTION - ! module contains different subroutines to do soil nutrient competition dynamics - ! - ! created by Jinyun Tang, Sep 8, 2014 - ! modified by Mariana Vertenstein, Nov 15, 2014 - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use NutrientCompetitionMethodMod, only : nutrient_competition_method_type - use NutrientCompetitionMethodMod, only : params_inst - !use clm_varctl , only : iulog - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: nutrient_competition_clm45default_type - ! - type, extends(nutrient_competition_method_type) :: nutrient_competition_clm45default_type - private - contains - ! public methocs - procedure, public :: init ! Initialize the class - procedure, public :: calc_plant_nutrient_competition ! calculate nutrient yield rate from competition - procedure, public :: calc_plant_nutrient_demand ! calculate plant nutrient demand - ! - ! private methods - procedure, private:: calc_plant_cn_alloc - procedure, private:: calc_plant_nitrogen_demand - end type nutrient_competition_clm45default_type - ! - interface nutrient_competition_clm45default_type - ! initialize a new nutrient_competition_clm45default_type object - module procedure constructor - end interface nutrient_competition_clm45default_type - ! - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - type(nutrient_competition_clm45default_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type nutrient_competition_clm45default_type. - ! For now, this is simply a place-holder. - - end function constructor - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize the class (currently empty for this version) - ! - class(nutrient_competition_clm45default_type) :: this - type(bounds_type), intent(in) :: bounds - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine calc_plant_nutrient_competition (this, & - bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, cnveg_carbonstate_inst, & - cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot, arepr, fpg_col) - ! - ! !USES: - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType, only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use CNSharedParamsMod , only : use_fun - ! - ! !ARGUMENTS: - class(nutrient_competition_clm45default_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - real(r8) , intent(in) :: aroot(bounds%begp:) - real(r8) , intent(in) :: arepr(bounds%begp:) - real(r8) , intent(in) :: fpg_col(bounds%begc:) - - call this%calc_plant_cn_alloc (bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, & - c14_cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - aroot=aroot(bounds%begp:bounds%endp), & - arepr=arepr(bounds%begp:bounds%endp), & - fpg_col=fpg_col(bounds%begc:bounds%endc)) - - end subroutine calc_plant_nutrient_competition - - !----------------------------------------------------------------------- - subroutine calc_plant_cn_alloc (this, bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, & - c14_cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, & - aroot, arepr, fpg_col) - ! - ! !USES: - use pftconMod , only : pftcon, npcropmin - use clm_varctl , only : use_c13, use_c14 - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNSharedParamsMod , only : use_fun - use shr_infnan_mod , only : shr_infnan_isnan - - ! - ! !ARGUMENTS: - class(nutrient_competition_clm45default_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(in) :: aroot(bounds%begp:) - real(r8) , intent(in) :: arepr(bounds%begp:) - real(r8) , intent(in) :: fpg_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - integer :: c,p,l,j ! indices - integer :: fp ! lake filter patch index - real(r8):: f1,f2,f3,f4,g1,g2 ! allocation parameters - real(r8):: cnl,cnfr,cnlw,cndw ! C:N ratios for leaf, fine root, and wood - real(r8):: fcur ! fraction of current psn displayed as growth - real(r8):: gresp_storage ! temporary variable for growth resp to storage - real(r8):: nlc ! temporary variable for total new leaf carbon allocation - real(r8):: f5 ! grain allocation parameter - real(r8):: cng ! C:N ratio for grain (= cnlw for now; slevis) - real(r8):: fsmn(bounds%begp:bounds%endp) ! A emperate variable for adjusting FUN uptakes - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(aroot) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(arepr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fpg_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - fpg => fpg_col , & ! Input: [real(r8) (:) ] fraction of potential gpp (no units) - - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - froot_leaf => pftcon%froot_leaf , & ! Input: allocation parameter: new fine root C per new leaf C (gC/gC) - croot_stem => pftcon%croot_stem , & ! Input: allocation parameter: new coarse root C per new stem C (gC/gC) - stem_leaf => pftcon%stem_leaf , & ! Input: allocation parameter: new stem c per new leaf C (gC/gC) - flivewd => pftcon%flivewd , & ! Input: allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - deadwdcn => pftcon%deadwdcn , & ! Input: dead wood (xylem and heartwood) C:N (gC/gN) - fcur2 => pftcon%fcur , & ! Input: allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - graincn => pftcon%graincn , & ! Input: grain C:N (gC/gN) - grperc => pftcon%grperc , & ! Input: growth respiration parameter - grpnow => pftcon%grpnow , & ! Input: growth respiration parameter - - croplive => crop_inst%croplive_patch , & ! Input: [logical (:) ] flag, true if planted, not harvested - - peaklai => cnveg_state_inst%peaklai_patch , & ! Input: [integer (:) ] 1: max allowed lai; 0: not at max - aleaf => cnveg_state_inst%aleaf_patch , & ! Output: [real(r8) (:) ] leaf allocation coefficient - astem => cnveg_state_inst%astem_patch , & ! Output: [real(r8) (:) ] stem allocation coefficient - c_allometry => cnveg_state_inst%c_allometry_patch , & ! Output: [real(r8) (:) ] C allocation index (DIM) - n_allometry => cnveg_state_inst%n_allometry_patch , & ! Output: [real(r8) (:) ] N allocation index (DIM) - downreg => cnveg_state_inst%downreg_patch , & ! Output: [real(r8) (:) ] fractional reduction in GPP due to N limitation (DIM) - - annsum_npp => cnveg_carbonflux_inst%annsum_npp_patch , & ! Input: [real(r8) (:) ] annual sum of NPP, for wood allocation - gpp => cnveg_carbonflux_inst%gpp_before_downreg_patch , & ! Output: [real(r8) (:) ] GPP flux before downregulation (gC/m2/s) - availc => cnveg_carbonflux_inst%availc_patch , & ! Output: [real(r8) (:) ] C flux available for allocation (gC/m2/s) - excess_cflux => cnveg_carbonflux_inst%excess_cflux_patch , & ! Output: [real(r8) (:) ] C flux not allocated due to downregulation (gC/m2/s) - plant_calloc => cnveg_carbonflux_inst%plant_calloc_patch , & ! Output: [real(r8) (:) ] total allocated C flux (gC/m2/s) - psnsun_to_cpool => cnveg_carbonflux_inst%psnsun_to_cpool_patch , & ! Output: [real(r8) (:) ] - psnshade_to_cpool => cnveg_carbonflux_inst%psnshade_to_cpool_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc => cnveg_carbonflux_inst%cpool_to_leafc_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc_storage => cnveg_carbonflux_inst%cpool_to_leafc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc_storage => cnveg_carbonflux_inst%cpool_to_frootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc => cnveg_carbonflux_inst%cpool_to_livestemc_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc_storage => cnveg_carbonflux_inst%cpool_to_livestemc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadstemc => cnveg_carbonflux_inst%cpool_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadstemc_storage => cnveg_carbonflux_inst%cpool_to_deadstemc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc => cnveg_carbonflux_inst%cpool_to_livecrootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc_storage => cnveg_carbonflux_inst%cpool_to_livecrootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadcrootc => cnveg_carbonflux_inst%cpool_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadcrootc_storage => cnveg_carbonflux_inst%cpool_to_deadcrootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_gresp_storage => cnveg_carbonflux_inst%cpool_to_gresp_storage_patch , & ! Output: [real(r8) (:) ] allocation to growth respiration storage (gC/m2/s) - cpool_to_grainc => cnveg_carbonflux_inst%cpool_to_grainc_patch , & ! Output: [real(r8) (:) ] allocation to grain C (gC/m2/s) - cpool_to_grainc_storage => cnveg_carbonflux_inst%cpool_to_grainc_storage_patch , & ! Output: [real(r8) (:) ] allocation to grain C storage (gC/m2/s) - - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Output: [real(r8) (:) ] N flux required to support initial GPP (gN/m2/s) - plant_nalloc => cnveg_nitrogenflux_inst%plant_nalloc_patch , & ! Output: [real(r8) (:) ] total allocated N flux (gN/m2/s) - npool_to_grainn => cnveg_nitrogenflux_inst%npool_to_grainn_patch , & ! Output: [real(r8) (:) ] allocation to grain N (gN/m2/s) - npool_to_grainn_storage => cnveg_nitrogenflux_inst%npool_to_grainn_storage_patch , & ! Output: [real(r8) (:) ] allocation to grain N storage (gN/m2/s) - retransn_to_npool => cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of retranslocated N (gN/m2/s) - sminn_to_npool => cnveg_nitrogenflux_inst%sminn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of soil mineral N uptake (gN/m2/s) - npool_to_leafn => cnveg_nitrogenflux_inst%npool_to_leafn_patch , & ! Output: [real(r8) (:) ] allocation to leaf N (gN/m2/s) - npool_to_leafn_storage => cnveg_nitrogenflux_inst%npool_to_leafn_storage_patch , & ! Output: [real(r8) (:) ] allocation to leaf N storage (gN/m2/s) - npool_to_frootn => cnveg_nitrogenflux_inst%npool_to_frootn_patch , & ! Output: [real(r8) (:) ] allocation to fine root N (gN/m2/s) - npool_to_frootn_storage => cnveg_nitrogenflux_inst%npool_to_frootn_storage_patch , & ! Output: [real(r8) (:) ] allocation to fine root N storage (gN/m2/s) - npool_to_livestemn => cnveg_nitrogenflux_inst%npool_to_livestemn_patch , & ! Output: [real(r8) (:) ] - npool_to_livestemn_storage => cnveg_nitrogenflux_inst%npool_to_livestemn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_deadstemn => cnveg_nitrogenflux_inst%npool_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - npool_to_deadstemn_storage => cnveg_nitrogenflux_inst%npool_to_deadstemn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_livecrootn => cnveg_nitrogenflux_inst%npool_to_livecrootn_patch , & ! Output: [real(r8) (:) ] - npool_to_livecrootn_storage => cnveg_nitrogenflux_inst%npool_to_livecrootn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_deadcrootn => cnveg_nitrogenflux_inst%npool_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] - npool_to_deadcrootn_storage => cnveg_nitrogenflux_inst%npool_to_deadcrootn_storage_patch , & ! Output: [real(r8) (:) ] - Npassive => cnveg_nitrogenflux_inst%Npassive_patch , & ! Output: [real(r8) (:) ] Passive N uptake (gN/m2/s) - Nfix => cnveg_nitrogenflux_inst%Nfix_patch , & ! Output: [real(r8) (:) ] Symbiotic BNF (gN/m2/s) - Nactive => cnveg_nitrogenflux_inst%Nactive_patch , & ! Output: [real(r8) (:) ] Mycorrhizal N uptake (gN/m2/s) - Nnonmyc => cnveg_nitrogenflux_inst%Nnonmyc_patch , & ! Output: [real(r8) (:) ] Non-mycorrhizal N uptake (gN/m2/s) - Nam => cnveg_nitrogenflux_inst%Nam_patch , & ! Output: [real(r8) (:) ] AM uptake (gN/m2/s) - Necm => cnveg_nitrogenflux_inst%Necm_patch , & ! Output: [real(r8) (:) ] ECM uptake (gN/m2/s) - sminn_to_plant_fun => cnveg_nitrogenflux_inst%sminn_to_plant_fun_patch & ! Output: [real(r8) (:) ] Total N uptake of FUN (gN/m2/s) - ) - - ! patch loop to distribute the available N between the competing patches - ! on the basis of relative demand, and allocate C and N to new growth and storage - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - - ! set some local allocation variables - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! There was an error in this formula in previous version, where the coefficient - ! was 0.004 instead of 0.0025. - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiology file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - fcur = fcur2(ivt(p)) - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - if (croplive(p).and.(.not.shr_infnan_isnan(aleaf(p)))) then - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - else - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - if(use_fun)then ! if we are using FUN, we get the N available from there. - sminn_to_npool(p) = sminn_to_plant_fun(p) - else ! no FUN. :( we get N available from the FPG calculation in soilbiogeochemistry competition. - sminn_to_npool(p) = plant_ndemand(p) * fpg(c) - endif - - plant_nalloc(p) = sminn_to_npool(p) + retransn_to_npool(p) - plant_calloc(p) = plant_nalloc(p) * (c_allometry(p)/n_allometry(p)) - - - if(.not.use_fun)then !ORIGINAL CLM(CN) downregulation code. - excess_cflux(p) = availc(p) - plant_calloc(p) - ! reduce gpp fluxes due to N limitation - if (gpp(p) > 0.0_r8) then - downreg(p) = excess_cflux(p)/gpp(p) - - psnsun_to_cpool(p) = psnsun_to_cpool(p) *(1._r8 - downreg(p)) - psnshade_to_cpool(p) = psnshade_to_cpool(p)*(1._r8 - downreg(p)) - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = & - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) *(1._r8 - downreg(p)) - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = & - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p)*(1._r8 - downreg(p)) - endif - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = & - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) *(1._r8 - downreg(p)) - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = & - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p)*(1._r8 - downreg(p)) - endif - end if - - end if !use_fun - - ! calculate the amount of new leaf C dictated by these allocation - ! decisions, and calculate the daily fluxes of C and N to current - ! growth and storage pools - - ! fcur is the proportion of this day's growth that is displayed now, - ! the remainder going into storage for display next year through the - ! transfer pools - - nlc = plant_calloc(p) / c_allometry(p) - - cpool_to_leafc(p) = nlc * fcur - cpool_to_leafc_storage(p) = nlc * (1._r8 - fcur) - cpool_to_frootc(p) = nlc * f1 * fcur - cpool_to_frootc_storage(p) = nlc * f1 * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_grainc(p) = nlc * f5 * fcur - cpool_to_grainc_storage(p) = nlc * f5 * (1._r8 -fcur) - end if - - ! corresponding N fluxes - npool_to_leafn(p) = (nlc / cnl) * fcur - npool_to_leafn_storage(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_frootn(p) = (nlc * f1 / cnfr) * fcur - npool_to_frootn_storage(p) = (nlc * f1 / cnfr) * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cng = graincn(ivt(p)) - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_grainn(p) = (nlc * f5 / cng) * fcur - npool_to_grainn_storage(p) = (nlc * f5 / cng) * (1._r8 -fcur) - end if - - ! Calculate the amount of carbon that needs to go into growth - ! respiration storage to satisfy all of the storage growth demands. - ! Allows for the fraction of growth respiration that is released at the - ! time of fixation, versus the remaining fraction that is stored for - ! release at the time of display. Note that all the growth respiration - ! fluxes that get released on a given timestep are calculated in growth_resp(), - ! but that the storage of C for growth resp during display of transferred - ! growth is assigned here. - - gresp_storage = cpool_to_leafc_storage(p) + cpool_to_frootc_storage(p) - if (woody(ivt(p)) == 1._r8) then - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadstemc_storage(p) - - gresp_storage = gresp_storage + cpool_to_livecrootc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadcrootc_storage(p) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_grainc_storage(p) - end if - cpool_to_gresp_storage(p) = gresp_storage * g1 * (1._r8 - g2) - - end do ! end patch loop - - end associate - - end subroutine calc_plant_cn_alloc - - !----------------------------------------------------------------------- - subroutine calc_plant_nutrient_demand(this, bounds, num_soilp, filter_soilp,& - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot, arepr) - ! - ! !USES: - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use CropType , only : crop_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemCarbonFluxType, only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use EnergyFluxType , only : energyflux_type - use CNSharedParamsMod , only : use_fun - ! - ! !ARGUMENTS: - class(nutrient_competition_clm45default_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(photosyns_type) , intent(in) :: photosyns_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - real(r8) , intent(out) :: aroot(bounds%begp:) - real(r8) , intent(out) :: arepr(bounds%begp:) - !----------------------------------------------------------------------- - - call this%calc_plant_nitrogen_demand(bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - aroot=aroot(bounds%begp:bounds%endp), & - arepr=arepr(bounds%begp:bounds%endp)) - - end subroutine calc_plant_nutrient_demand - - !----------------------------------------------------------------------- - subroutine calc_plant_nitrogen_demand(this, bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - aroot, arepr) - ! - ! !USES: - use pftconMod , only : npcropmin, pftcon - use pftconMod , only : ntmp_soybean, nirrig_tmp_soybean - use pftconMod , only : ntrp_soybean, nirrig_trp_soybean - use clm_varcon , only : secspday - use clm_varctl , only : use_c13, use_c14 - use clm_time_manager , only : get_step_size - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use CropType , only : crop_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNSharedParamsMod , only : use_fun - ! - ! !ARGUMENTS: - class(nutrient_competition_clm45default_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(photosyns_type) , intent(in) :: photosyns_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - real(r8) , intent(out) :: aroot(bounds%begp:) - real(r8) , intent(out) :: arepr(bounds%begp:) - ! - ! !LOCAL VARIABLES: - integer :: c,p,l,j ! indices - integer :: fp ! lake filter patch index - real(r8):: mr ! maintenance respiration (gC/m2/s) - real(r8):: f1,f2,f3,f4,g1,g2 ! allocation parameters - real(r8):: cnl,cnfr,cnlw,cndw ! C:N ratios for leaf, fine root, and wood - real(r8):: curmr, curmr_ratio ! xsmrpool temporary variables - real(r8):: f5 ! grain allocation parameter - real(r8):: cng ! C:N ratio for grain (= cnlw for now; slevis) - real(r8):: fleaf ! fraction allocated to leaf - real(r8):: t1 ! temporary variable - real(r8):: dt ! model time step - real(r8):: dayscrecover ! number of days to recover negative cpool - - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(aroot) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(arepr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - froot_leaf => pftcon%froot_leaf , & ! Input: allocation parameter: new fine root C per new leaf C (gC/gC) - croot_stem => pftcon%croot_stem , & ! Input: allocation parameter: new coarse root C per new stem C (gC/gC) - stem_leaf => pftcon%stem_leaf , & ! Input: allocation parameter: new stem c per new leaf C (gC/gC) - flivewd => pftcon%flivewd , & ! Input: allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - deadwdcn => pftcon%deadwdcn , & ! Input: dead wood (xylem and heartwood) C:N (gC/gN) - graincn => pftcon%graincn , & ! Input: grain C:N (gC/gN) - fleafcn => pftcon%fleafcn , & ! Input: leaf c:n during organ fill - ffrootcn => pftcon%ffrootcn , & ! Input: froot c:n during organ fill - fstemcn => pftcon%fstemcn , & ! Input: stem c:n during organ fill - bfact => pftcon%bfact , & ! Input: parameter used below - aleaff => pftcon%aleaff , & ! Input: parameter used below - arootf => pftcon%arootf , & ! Input: parameter used below - astemf => pftcon%astemf , & ! Input: parameter used below - arooti => pftcon%arooti , & ! Input: parameter used below - fleafi => pftcon%fleafi , & ! Input: parameter used below - allconsl => pftcon%allconsl , & ! Input: parameter used below - allconss => pftcon%allconss , & ! Input: parameter used below - grperc => pftcon%grperc , & ! Input: parameter used below - grpnow => pftcon%grpnow , & ! Input: parameter used below - declfact => pftcon%declfact , & ! Input: - season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal-deciduous leaf habit (0 or 1) - stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress-deciduous leaf habit (0 or 1) - psnsun => photosyns_inst%psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - psnsha => photosyns_inst%psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - c13_psnsun => photosyns_inst%c13_psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - c13_psnsha => photosyns_inst%c13_psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - c14_psnsun => photosyns_inst%c14_psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - c14_psnsha => photosyns_inst%c14_psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - - hui => crop_inst%gddplant_patch , & ! Input: [real(r8) (:) ] =gdd since planting (gddplant) - leafout => crop_inst%gddtsoi_patch , & ! Input: [real(r8) (:) ] =gdd from top soil layer temperature - croplive => crop_inst%croplive_patch , & ! Input: [logical (:) ] flag, true if planted, not harvested - - gddmaturity => cnveg_state_inst%gddmaturity_patch , & ! Input: [real(r8) (:) ] gdd needed to harvest - huileaf => cnveg_state_inst%huileaf_patch , & ! Input: [real(r8) (:) ] heat unit index needed from planting to leaf emergence - huigrain => cnveg_state_inst%huigrain_patch , & ! Input: [real(r8) (:) ] same to reach vegetative maturity - peaklai => cnveg_state_inst%peaklai_patch , & ! Input: [integer (:) ] 1: max allowed lai; 0: not at max - aleafi => cnveg_state_inst%aleafi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 - astemi => cnveg_state_inst%astemi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 - aleaf => cnveg_state_inst%aleaf_patch , & ! Output: [real(r8) (:) ] leaf allocation coefficient - astem => cnveg_state_inst%astem_patch , & ! Output: [real(r8) (:) ] stem allocation coefficient - grain_flag => cnveg_state_inst%grain_flag_patch , & ! Output: [real(r8) (:) ] 1: grain fill stage; 0: not - c_allometry => cnveg_state_inst%c_allometry_patch , & ! Output: [real(r8) (:) ] C allocation index (DIM) - n_allometry => cnveg_state_inst%n_allometry_patch , & ! Output: [real(r8) (:) ] N allocation index (DIM) - tempsum_potential_gpp => cnveg_state_inst%tempsum_potential_gpp_patch , & ! Output: [real(r8) (:) ] temporary annual sum of potential GPP - tempmax_retransn => cnveg_state_inst%tempmax_retransn_patch , & ! Output: [real(r8) (:) ] temporary annual max of retranslocated N pool (gN/m2) - annsum_potential_gpp => cnveg_state_inst%annsum_potential_gpp_patch , & ! Output: [real(r8) (:) ] annual sum of potential GPP - annmax_retransn => cnveg_state_inst%annmax_retransn_patch , & ! Output: [real(r8) (:) ] annual max of retranslocated N pool - - xsmrpool => cnveg_carbonstate_inst%xsmrpool_patch , & ! Input: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] - - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - - annsum_npp => cnveg_carbonflux_inst%annsum_npp_patch , & ! Input: [real(r8) (:) ] annual sum of NPP, for wood allocation - leaf_mr => cnveg_carbonflux_inst%leaf_mr_patch , & ! Input: [real(r8) (:) ] - froot_mr => cnveg_carbonflux_inst%froot_mr_patch , & ! Input: [real(r8) (:) ] - livestem_mr => cnveg_carbonflux_inst%livestem_mr_patch , & ! Input: [real(r8) (:) ] - livecroot_mr => cnveg_carbonflux_inst%livecroot_mr_patch , & ! Input: [real(r8) (:) ] - grain_mr => cnveg_carbonflux_inst%grain_mr_patch , & ! Input: [real(r8) (:) ] - gpp => cnveg_carbonflux_inst%gpp_before_downreg_patch , & ! Output: [real(r8) (:) ] GPP flux before downregulation (gC/m2/s) - availc => cnveg_carbonflux_inst%availc_patch , & ! Output: [real(r8) (:) ] C flux available for allocation (gC/m2/s) - xsmrpool_recover => cnveg_carbonflux_inst%xsmrpool_recover_patch , & ! Output: [real(r8) (:) ] C flux assigned to recovery of negative cpool (gC/m2/s) - psnsun_to_cpool => cnveg_carbonflux_inst%psnsun_to_cpool_patch , & ! Output: [real(r8) (:) ] - psnshade_to_cpool => cnveg_carbonflux_inst%psnshade_to_cpool_patch , & ! Output: [real(r8) (:) ] - leaf_curmr => cnveg_carbonflux_inst%leaf_curmr_patch , & ! Output: [real(r8) (:) ] - froot_curmr => cnveg_carbonflux_inst%froot_curmr_patch , & ! Output: [real(r8) (:) ] - livestem_curmr => cnveg_carbonflux_inst%livestem_curmr_patch , & ! Output: [real(r8) (:) ] - livecroot_curmr => cnveg_carbonflux_inst%livecroot_curmr_patch , & ! Output: [real(r8) (:) ] - grain_curmr => cnveg_carbonflux_inst%grain_curmr_patch , & ! Output: [real(r8) (:) ] - leaf_xsmr => cnveg_carbonflux_inst%leaf_xsmr_patch , & ! Output: [real(r8) (:) ] - froot_xsmr => cnveg_carbonflux_inst%froot_xsmr_patch , & ! Output: [real(r8) (:) ] - livestem_xsmr => cnveg_carbonflux_inst%livestem_xsmr_patch , & ! Output: [real(r8) (:) ] - livecroot_xsmr => cnveg_carbonflux_inst%livecroot_xsmr_patch , & ! Output: [real(r8) (:) ] - grain_xsmr => cnveg_carbonflux_inst%grain_xsmr_patch , & ! Output: [real(r8) (:) ] - cpool_to_xsmrpool => cnveg_carbonflux_inst%cpool_to_xsmrpool_patch , & ! Output: [real(r8) (:) ] - - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Output: [real(r8) (:) ] N flux required to support initial GPP (gN/m2/s) - avail_retransn => cnveg_nitrogenflux_inst%avail_retransn_patch , & ! Output: [real(r8) (:) ] N flux available from retranslocation pool (gN/m2/s) - retransn_to_npool => cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of retranslocated N (gN/m2/s) - sminn_to_npool => cnveg_nitrogenflux_inst%sminn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of soil mineral N uptake (gN/m2/s) - leafn_to_retransn => cnveg_nitrogenflux_inst%leafn_to_retransn_patch , & ! Output: [real(r8) (:) ] - frootn_to_retransn => cnveg_nitrogenflux_inst%frootn_to_retransn_patch , & ! Output: [real(r8) (:) ] - livestemn_to_retransn => cnveg_nitrogenflux_inst%livestemn_to_retransn_patch & ! Output: [real(r8) (:) ] - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! set number of days to recover negative cpool - dayscrecover = params_inst%dayscrecover - - ! loop over patches to assess the total plant N demand - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! get the time step total gross photosynthesis - ! this is coming from the canopy fluxes code, and is the - ! gpp that is used to control stomatal conductance. - ! For the nitrogen downregulation code, this is assumed - ! to be the potential gpp, and the actual gpp will be - ! reduced due to N limitation. - - ! Convert psn from umol/m2/s -> gC/m2/s - - ! The input psn (psnsun and psnsha) are expressed per unit LAI - ! in the sunlit and shaded canopy, respectively. These need to be - ! scaled by laisun and laisha to get the total gpp for allocation - - ! Note that no associate statement is used for the isotope carbon fluxes below - ! since they are not always allocated AND nag compiler will complain if you try to - ! to have an associate statement with unallocated memory - - psnsun_to_cpool(p) = psnsun(p) * laisun(p) * 12.011e-6_r8 - psnshade_to_cpool(p) = psnsha(p) * laisha(p) * 12.011e-6_r8 - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = c13_psnsun(p) * laisun(p) * 12.011e-6_r8 - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = c13_psnsha(p) * laisha(p) * 12.011e-6_r8 - endif - - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = c14_psnsun(p) * laisun(p) * 12.011e-6_r8 - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = c14_psnsha(p) * laisha(p) * 12.011e-6_r8 - endif - - gpp(p) = psnsun_to_cpool(p) + psnshade_to_cpool(p) - - ! get the time step total maintenance respiration - ! These fluxes should already be in gC/m2/s - - mr = leaf_mr(p) + froot_mr(p) - if (woody(ivt(p)) == 1.0_r8) then - mr = mr + livestem_mr(p) + livecroot_mr(p) - else if (ivt(p) >= npcropmin) then - if (croplive(p)) mr = mr + livestem_mr(p) + grain_mr(p) - end if - - ! carbon flux available for allocation - availc(p) = gpp(p) - mr - - ! new code added for isotope calculations, 7/1/05, PET - ! If mr > gpp, then some mr comes from gpp, the rest comes from - ! cpool (xsmr) - if (mr > 0._r8 .and. availc(p) < 0._r8) then - curmr = gpp(p) - curmr_ratio = curmr / mr - else - curmr_ratio = 1._r8 - end if - leaf_curmr(p) = leaf_mr(p) * curmr_ratio - leaf_xsmr(p) = leaf_mr(p) - leaf_curmr(p) - froot_curmr(p) = froot_mr(p) * curmr_ratio - froot_xsmr(p) = froot_mr(p) - froot_curmr(p) - livestem_curmr(p) = livestem_mr(p) * curmr_ratio - livestem_xsmr(p) = livestem_mr(p) - livestem_curmr(p) - livecroot_curmr(p) = livecroot_mr(p) * curmr_ratio - livecroot_xsmr(p) = livecroot_mr(p) - livecroot_curmr(p) - grain_curmr(p) = grain_mr(p) * curmr_ratio - grain_xsmr(p) = grain_mr(p) - grain_curmr(p) - - ! no allocation when available c is negative - availc(p) = max(availc(p),0.0_r8) - - ! test for an xsmrpool deficit - if (xsmrpool(p) < 0.0_r8) then - ! Running a deficit in the xsmrpool, so the first priority is to let - ! some availc from this timestep accumulate in xsmrpool. - ! Determine rate of recovery for xsmrpool deficit - - xsmrpool_recover(p) = -xsmrpool(p)/(dayscrecover*secspday) - if (xsmrpool_recover(p) < availc(p)) then - ! available carbon reduced by amount for xsmrpool recovery - availc(p) = availc(p) - xsmrpool_recover(p) - else - ! all of the available carbon goes to xsmrpool recovery - xsmrpool_recover(p) = availc(p) - availc(p) = 0.0_r8 - end if - cpool_to_xsmrpool(p) = xsmrpool_recover(p) - end if - - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiologfy file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - - ! calculate f1 to f5 for prog crops following AgroIBIS subr phenocrop - - f5 = 0._r8 ! continued intializations from above - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - if (croplive(p)) then - ! same phases appear in subroutine CropPhenology - - ! Phase 1 completed: - ! ================== - ! if hui is less than the number of gdd needed for filling of grain - ! leaf emergence also has to have taken place for lai changes to occur - ! and carbon assimilation - ! Next phase: leaf emergence to start of leaf decline - - if (leafout(p) >= huileaf(p) .and. hui(p) < huigrain(p)) then - - ! allocation rules for crops based on maturity and linear decrease - ! of amount allocated to roots over course of the growing season - - if (peaklai(p) == 1) then ! lai at maximum allowed - arepr(p) = 0._r8 - aleaf(p) = 1.e-5_r8 - astem(p) = 0._r8 - aroot(p) = 1._r8 - arepr(p) - aleaf(p) - astem(p) - else - arepr(p) = 0._r8 - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * & - min(1._r8, hui(p)/gddmaturity(p)))) - fleaf = fleafi(ivt(p)) * (exp(-bfact(ivt(p))) - & - exp(-bfact(ivt(p))*hui(p)/huigrain(p))) / & - (exp(-bfact(ivt(p)))-1) ! fraction alloc to leaf (from J Norman alloc curve) - aleaf(p) = max(1.e-5_r8, (1._r8 - aroot(p)) * fleaf) - astem(p) = 1._r8 - arepr(p) - aleaf(p) - aroot(p) - end if - - ! AgroIBIS included here an immediate adjustment to aleaf & astem if the - ! predicted lai from the above allocation coefficients exceeded laimx. - ! We have decided to live with lais slightly higher than laimx by - ! enforcing the cap in the following tstep through the peaklai logic above. - - astemi(p) = astem(p) ! save for use by equations after shift - aleafi(p) = aleaf(p) ! to reproductive phenology stage begins - grain_flag(p) = 0._r8 ! setting to 0 while in phase 2 - - ! Phase 2 completed: - ! ================== - ! shift allocation either when enough gdd are accumulated or maximum number - ! of days has elapsed since planting - - else if (hui(p) >= huigrain(p)) then - - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * min(1._r8, hui(p)/gddmaturity(p)))) - if (astemi(p) > astemf(ivt(p))) then - astem(p) = max(0._r8, max(astemf(ivt(p)), astem(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconss(ivt(p)) ))) - end if - if (aleafi(p) > aleaff(ivt(p))) then - aleaf(p) = max(1.e-5_r8, max(aleaff(ivt(p)), aleaf(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconsl(ivt(p)) ))) - end if - - !Beth's retranslocation of leafn, stemn, rootn to organ - !Filter excess plant N to retransn pool for organ N - !Only do one time then hold grain_flag till onset next season - - ! slevis: Will astem ever = astemf exactly? - ! Beth's response: ...looks like astem can equal astemf under the right circumstances. - !It might be worth a rewrite to capture what I was trying to do, but the retranslocation for - !corn and wheat begins at the beginning of the grain fill stage, but for soybean I was holding it - !until after the leaf and stem decline were complete. Looking at how astem is calculated, once the - !stem decline is near complete, astem should (usually) be set to astemf. The reason for holding off - !on soybean is that the retranslocation scheme begins at the beginning of the grain phase, when the - !leaf and stem are still growing, but declining. Since carbon is still getting allocated and now - !there is more nitrogen available, the nitrogen can be diverted from grain. For corn and wheat - !the impact was probably enough to boost productivity, but for soybean the nitrogen was better off - !fulfilling the grain fill. It seems that if the peak lai is reached for soybean though that this - !would be bypassed altogether, not the intended outcome. I checked several of my output files and - !they all seemed to be going through the retranslocation loop for soybean - good news. - - if (astem(p) == astemf(ivt(p)) .or. & - (ivt(p) /= ntmp_soybean .and. ivt(p) /= nirrig_tmp_soybean .and.& - ivt(p) /= ntrp_soybean .and. ivt(p) /= nirrig_trp_soybean)) then - if (grain_flag(p) == 0._r8)then - if(.not.use_fun) then - t1 = 1 / dt - leafn_to_retransn(p) = t1 * ((leafc(p) / leafcn(ivt(p))) - (leafc(p) / & - fleafcn(ivt(p)))) - livestemn_to_retransn(p) = t1 * ((livestemc(p) / livewdcn(ivt(p))) - (livestemc(p) / & - fstemcn(ivt(p)))) - frootn_to_retransn(p) = 0._r8 - if (ffrootcn(ivt(p)) > 0._r8) then - frootn_to_retransn(p) = t1 * ((frootc(p) / frootcn(ivt(p))) - (frootc(p) / & - ffrootcn(ivt(p)))) - end if - else !leafn retrans flux is handled in phenology - frootn_to_retransn(p) = 0._r8 - livestemn_to_retransn(p)=0.0_r8 - end if !fun - grain_flag(p) = 1._r8 - end if - end if - - arepr(p) = 1._r8 - aroot(p) - astem(p) - aleaf(p) - - else ! pre emergence - aleaf(p) = 1.e-5_r8 ! allocation coefficients should be irrelevant - astem(p) = 0._r8 ! because crops have no live carbon pools; - aroot(p) = 0._r8 ! this applies to this "else" and to the "else" - arepr(p) = 0._r8 ! a few lines down - end if - - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - - else ! .not croplive - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - ! based on available C, use constant allometric relationships to - ! determine N requirements - - !RF. I removed the growth respiration from this, because it is used to calculate - !plantCN for N uptake AND c_allometry for allocation. If we add gresp to the - !allometry calculation then we allocate too much carbon since gresp is not allocated here. - if(.not.use_fun)then - if (woody(ivt(p)) == 1.0_r8) then - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else if (ivt(p) >= npcropmin) then ! skip generic crops - cng = graincn(ivt(p)) - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f5+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + f5/cng + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else - c_allometry(p) = 1._r8+g1+f1+f1*g1 - n_allometry(p) = 1._r8/cnl + f1/cnfr - end if - else !no FUN. - if (woody(ivt(p)) == 1.0_r8) then - c_allometry(p) = (1._r8)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else if (ivt(p) >= npcropmin) then ! skip generic crops - cng = graincn(ivt(p)) - c_allometry(p) = (1._r8)*(1._r8+f1+f5+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + f5/cng + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else - c_allometry(p) = 1._r8+f1 - n_allometry(p) = 1._r8/cnl + f1/cnfr - end if - end if !use_fun - - plant_ndemand(p) = availc(p)*(n_allometry(p)/c_allometry(p)) - - ! retranslocated N deployment depends on seasonal cycle of potential GPP - ! (requires one year run to accumulate demand) - - tempsum_potential_gpp(p) = tempsum_potential_gpp(p) + gpp(p) - - ! Adding the following line to carry max retransn info to CN Annual Update - tempmax_retransn(p) = max(tempmax_retransn(p),retransn(p)) - - ! Beth's code: crops pull from retransn pool only during grain fill; - ! retransn pool has N from leaves, stems, and roots for - ! retranslocation - - if(.not.use_fun)then - - if (ivt(p) >= npcropmin .and. grain_flag(p) == 1._r8) then - avail_retransn(p) = plant_ndemand(p) - else if (ivt(p) < npcropmin .and. annsum_potential_gpp(p) > 0._r8) then - avail_retransn(p) = (annmax_retransn(p)/2._r8)*(gpp(p)/annsum_potential_gpp(p))/dt - else - avail_retransn(p) = 0.0_r8 - end if - - ! make sure available retrans N doesn't exceed storage - avail_retransn(p) = min(avail_retransn(p), retransn(p)/dt) - - ! modify plant N demand according to the availability of - ! retranslocated N - ! take from retransn pool at most the flux required to meet - ! plant ndemand - - if (plant_ndemand(p) > avail_retransn(p)) then - retransn_to_npool(p) = avail_retransn(p) - else - retransn_to_npool(p) = plant_ndemand(p) - end if - - if ( .not. use_fun ) then - plant_ndemand(p) = plant_ndemand(p) - retransn_to_npool(p) - else - if (season_decid(ivt(p)) == 1._r8.or.stress_decid(ivt(p))==1._r8) then - plant_ndemand(p) = plant_ndemand(p) - retransn_to_npool(p) - end if - end if - - end if !use_fun - - end do ! end patch loop - - end associate - - end subroutine calc_plant_nitrogen_demand - -end module NutrientCompetitionCLM45defaultMod diff --git a/src/biogeochem/NutrientCompetitionFactoryMod.F90 b/src/biogeochem/NutrientCompetitionFactoryMod.F90 deleted file mode 100644 index 99daa738ff..0000000000 --- a/src/biogeochem/NutrientCompetitionFactoryMod.F90 +++ /dev/null @@ -1,87 +0,0 @@ -module NutrientCompetitionFactoryMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Factory to create an instance of nutrient_competition_method_type. This module figures - ! out the particular type to return. - ! - ! !USES: - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - - implicit none - save - private - ! - ! !PUBLIC ROUTINES: - public :: create_nutrient_competition_method ! create an object of class nutrient_competition_method_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - function create_nutrient_competition_method(bounds) result(nutrient_competition_method) - ! - ! !DESCRIPTION: - ! Create and return an object of nutrient_competition_method_type. The particular type - ! is determined based on a namelist parameter. - ! - ! !USES: - use shr_kind_mod , only : SHR_KIND_CL - use NutrientCompetitionMethodMod , only : nutrient_competition_method_type - use NutrientCompetitionCLM45defaultMod, only : nutrient_competition_clm45default_type - use NutrientCompetitionFlexibleCNMod , only : nutrient_competition_FlexibleCN_type - use decompMod , only : bounds_type - - ! FIXME(bja, 2015-06) need to pass method control in as a parameter - ! instead of relying on a global! - use clm_varctl, only : use_flexibleCN - - ! - ! !ARGUMENTS: - class(nutrient_competition_method_type), allocatable :: nutrient_competition_method ! function result - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - ! For now, hard-code the method. Eventually this will be set from namelist, either by - ! this routine (appropriate if the 'method' is in its own namelist group), or do the - ! namelist read outside this module and pass the method in as a parameter (appropriate - ! if the 'method' is part of a larger namelist group). - character(len=SHR_KIND_CL) :: method - - character(len=*), parameter :: subname = 'create_nutrient_competition_method' - !----------------------------------------------------------------------- - - ! FIXME(bja, 2015-06) flexible_cn may need to be - ! merged with other nitrogen code, so a more robust method of - ! selecting the competition method will depend on how the science - ! is merged. - method = "clm45default" - if (use_flexibleCN) then - method = "flexible_cn" - end if - - select case (trim(method)) - - case ("clm45default") - allocate(nutrient_competition_method, & - source=nutrient_competition_clm45default_type()) - - case ("flexible_cn") - allocate(nutrient_competition_method, & - source=nutrient_competition_FlexibleCN_type()) - - case default - write(iulog,*) subname//' ERROR: unknown method: ', method - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end select - call nutrient_competition_method%Init(bounds) - - end function create_nutrient_competition_method - -end module NutrientCompetitionFactoryMod diff --git a/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 b/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 deleted file mode 100644 index f404ac9611..0000000000 --- a/src/biogeochem/NutrientCompetitionFlexibleCNMod.F90 +++ /dev/null @@ -1,1773 +0,0 @@ -module NutrientCompetitionFlexibleCNMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! DESCRIPTION - ! module contains different subroutines to do soil nutrient competition dynamics - ! - ! FIXME(bja, 2015-08) This module was copied from - ! NutrientCompetitionCLM45default then flexible cn modifications - ! were added for the clm50 nitrogen science changes (r120). There is - ! a significant amount of duplicate code between the two - ! modules. They need to be reexamined and the common code pulled out - ! into a common base class. - ! - ! created by Jinyun Tang, Sep 8, 2014 - ! modified by Mariana Vertenstein, Nov 15, 2014 - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use NutrientCompetitionMethodMod, only : nutrient_competition_method_type - use NutrientCompetitionMethodMod, only : params_inst - use clm_varctl , only : iulog - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: nutrient_competition_FlexibleCN_type - ! - type, extends(nutrient_competition_method_type) :: nutrient_competition_FlexibleCN_type - private - real(r8), pointer :: actual_leafcn(:) ! leaf CN ratio used by flexible CN - real(r8), pointer :: actual_storage_leafcn(:) ! storage leaf CN ratio used by flexible CN - contains - ! public methocs - procedure, public :: Init ! Initialization - procedure, public :: calc_plant_nutrient_competition ! calculate nutrient yield rate from competition - procedure, public :: calc_plant_nutrient_demand ! calculate plant nutrient demand - ! - ! private methods - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: calc_plant_cn_alloc - procedure, private :: calc_plant_nitrogen_demand - end type nutrient_competition_FlexibleCN_type - ! - interface nutrient_competition_FlexibleCN_type - ! initialize a new nutrient_competition_FlexibleCN_type object - module procedure constructor - end interface nutrient_competition_FlexibleCN_type - ! - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - type(nutrient_competition_FlexibleCN_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type nutrient_competition_FlexibleCN_type. - ! For now, this is simply a place-holder. - end function constructor - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize the class - ! - class(nutrient_competition_FlexibleCN_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate memory for the class data - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type) :: this - type(bounds_type), intent(in) :: bounds - - allocate(this%actual_leafcn(bounds%begp:bounds%endp)) ; this%actual_leafcn(:) = nan - allocate(this%actual_storage_leafcn(bounds%begp:bounds%endp)) ; this%actual_storage_leafcn(:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Send data to history file - ! - ! !USES: - use histFileMod , only : hist_addfld1d - use clm_varcon , only : spval - ! - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - - this%actual_leafcn(begp:endp) = spval - call hist_addfld1d (fname='LEAFCN', units='gC/gN', & - avgflag='A', long_name='Leaf CN ratio used for flexible CN', & - ptr_patch=this%actual_leafcn ) - this%actual_storage_leafcn(begp:endp) = spval - call hist_addfld1d (fname='LEAFCN_STORAGE', units='gC/gN', & - avgflag='A', long_name='Storage Leaf CN ratio used for flexible CN', & - ptr_patch=this%actual_storage_leafcn, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine calc_plant_nutrient_competition (this, & - bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, cnveg_carbonstate_inst, & - cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot, arepr, fpg_col) - ! - ! !USES: - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - ! - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - real(r8), intent(in) :: aroot (bounds%begp:) - real(r8), intent(in) :: arepr (bounds%begp:) - real(r8), intent(in) :: fpg_col (bounds%begc:) - - call this%calc_plant_cn_alloc(bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, & - c14_cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot=aroot(bounds%begp:bounds%endp), & - arepr=arepr(bounds%begp:bounds%endp), & - fpg_col=fpg_col(bounds%begc:bounds%endc)) - - end subroutine calc_plant_nutrient_competition - -!----------------------------------------------------------------------- - subroutine calc_plant_cn_alloc(this, bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, & - c14_cnveg_carbonflux_inst, cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot, arepr, fpg_col) - ! - ! !USES: - use pftconMod , only : pftcon, npcropmin - use clm_varctl , only : use_c13, use_c14, carbon_resp_opt - use clm_varctl , only : downreg_opt - use clm_varctl , only : CN_residual_opt - use clm_varctl , only : CN_partition_opt - use clm_time_manager , only : get_step_size - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use CNSharedParamsMod , only : use_fun - use CNPrecisionControlMod , only : n_min - use clm_varcon , only : spval - - ! - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - real(r8) , intent(in) :: aroot(bounds%begp:) - real(r8) , intent(in) :: arepr(bounds%begp:) - real(r8) , intent(in) :: fpg_col(bounds%begc:) - ! - ! !LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp ! lake filter patch index - real(r8) :: f1,f2,f3,f4,g1,g2 ! allocation parameters - real(r8) :: cnl,cnfr,cnlw,cndw ! C:N ratios for leaf, fine root, and wood - real(r8) :: fcur ! fraction of current psn displayed as growth - real(r8) :: gresp_storage ! temporary variable for growth resp to storage - real(r8) :: nlc ! temporary variable for total new leaf carbon allocation - real(r8) :: f5 ! grain allocation parameter - real(r8) :: cng ! C:N ratio for grain (= cnlw for now; slevis) - real(r8) :: dt ! model time step - real(r8):: fsmn(bounds%begp:bounds%endp) ! A emperate variable for adjusting FUN uptakes - - real(r8):: frootcn_storage_actual - real(r8):: frootcn_actual - real(r8):: livestemcn_storage_actual - real(r8):: livestemcn_actual - real(r8):: livecrootcn_storage_actual - real(r8):: livecrootcn_actual - real(r8):: leafcn_max - real(r8):: frootcn_max - real(r8):: livewdcn_max - real(r8):: frac_resp - real(r8) :: npool_to_leafn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_leafn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_leafn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_leafn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_frootn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_frootn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_frootn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_frootn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_livestemn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_livestemn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_livestemn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_livestemn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_livecrootn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_livecrootn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_livecrootn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_livecrootn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadstemn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadstemn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadstemn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadstemn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadcrootn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadcrootn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadcrootn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_deadcrootn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_grainn_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_grainn_supply (bounds%begp:bounds%endp) - real(r8) :: npool_to_grainn_storage_demand (bounds%begp:bounds%endp) - real(r8) :: npool_to_grainn_storage_supply (bounds%begp:bounds%endp) - real(r8) :: total_plant_Ndemand (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_leafn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_leafn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_frootn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_frootn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_livestemn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_livestemn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_deadstemn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_deadstemn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_livecrootn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_livecrootn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_deadcrootn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_deadcrootn_storage (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_grainn (bounds%begp:bounds%endp) - real(r8) :: frNdemand_npool_to_grainn_storage (bounds%begp:bounds%endp) - - ! ----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(aroot) == (/bounds%endp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(arepr) == (/bounds%endp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fpg_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(this%actual_storage_leafcn) >= (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((lbound(this%actual_storage_leafcn) <= (/bounds%begp/)), errMsg(sourcefile, __LINE__)) - - associate( & - fpg => fpg_col , & ! Input: [real(r8) (:) ] fraction of potential gpp (no units) - - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - froot_leaf => pftcon%froot_leaf , & ! Input: allocation parameter: new fine root C per new leaf C (gC/gC) - croot_stem => pftcon%croot_stem , & ! Input: allocation parameter: new coarse root C per new stem C (gC/gC) - stem_leaf => pftcon%stem_leaf , & ! Input: allocation parameter: new stem c per new leaf C (gC/gC) - flivewd => pftcon%flivewd , & ! Input: allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - deadwdcn => pftcon%deadwdcn , & ! Input: dead wood (xylem and heartwood) C:N (gC/gN) - fcur2 => pftcon%fcur , & ! Input: allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - graincn => pftcon%graincn , & ! Input: grain C:N (gC/gN) - grperc => pftcon%grperc , & ! Input: growth respiration parameter - grpnow => pftcon%grpnow , & ! Input: growth respiration parameter - evergreen => pftcon%evergreen , & ! Input: binary flag for evergreen leaf habit (0 or 1) - - croplive => crop_inst%croplive_patch , & ! Input: [logical (:) ] flag, true if planted, not harvested - - peaklai => cnveg_state_inst%peaklai_patch , & ! Input: [integer (:) ] 1: max allowed lai; 0: not at max - aleaf => cnveg_state_inst%aleaf_patch , & ! Output: [real(r8) (:) ] leaf allocation coefficient - astem => cnveg_state_inst%astem_patch , & ! Output: [real(r8) (:) ] stem allocation coefficient - c_allometry => cnveg_state_inst%c_allometry_patch , & ! Output: [real(r8) (:) ] C allocation index (DIM) - n_allometry => cnveg_state_inst%n_allometry_patch , & ! Output: [real(r8) (:) ] N allocation index (DIM) - downreg => cnveg_state_inst%downreg_patch , & ! Output: [real(r8) (:) ] fractional reduction in GPP due to N limitation (DIM) - - annsum_npp => cnveg_carbonflux_inst%annsum_npp_patch , & ! Input: [real(r8) (:) ] annual sum of NPP, for wood allocation - gpp => cnveg_carbonflux_inst%gpp_before_downreg_patch , & ! Output: [real(r8) (:) ] GPP flux before downregulation (gC/m2/s) - availc => cnveg_carbonflux_inst%availc_patch , & ! Output: [real(r8) (:) ] C flux available for allocation (gC/m2/s) - excess_cflux => cnveg_carbonflux_inst%excess_cflux_patch , & ! Output: [real(r8) (:) ] C flux not allocated due to downregulation (gC/m2/s) - plant_calloc => cnveg_carbonflux_inst%plant_calloc_patch , & ! Output: [real(r8) (:) ] total allocated C flux (gC/m2/s) - npp_growth => cnveg_carbonflux_inst%npp_growth_patch , & ! Output: [real(r8) (:) ] C for growth in FUN. g/m2/s - cpool_to_resp => cnveg_carbonflux_inst%cpool_to_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc_resp => cnveg_carbonflux_inst%cpool_to_leafc_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc_storage_resp => cnveg_carbonflux_inst%cpool_to_leafc_storage_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc_resp => cnveg_carbonflux_inst%cpool_to_frootc_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc_storage_resp => cnveg_carbonflux_inst%cpool_to_frootc_storage_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc_resp => cnveg_carbonflux_inst%cpool_to_livecrootc_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc_storage_resp => cnveg_carbonflux_inst%cpool_to_livecrootc_storage_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc_resp => cnveg_carbonflux_inst%cpool_to_livestemc_resp_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc_storage_resp => cnveg_carbonflux_inst%cpool_to_livestemc_storage_resp_patch , & ! Output: [real(r8) (:) ] - psnsun_to_cpool => cnveg_carbonflux_inst%psnsun_to_cpool_patch , & ! Output: [real(r8) (:) ] - psnshade_to_cpool => cnveg_carbonflux_inst%psnshade_to_cpool_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc => cnveg_carbonflux_inst%cpool_to_leafc_patch , & ! Output: [real(r8) (:) ] - cpool_to_leafc_storage => cnveg_carbonflux_inst%cpool_to_leafc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_frootc_storage => cnveg_carbonflux_inst%cpool_to_frootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc => cnveg_carbonflux_inst%cpool_to_livestemc_patch , & ! Output: [real(r8) (:) ] - cpool_to_livestemc_storage => cnveg_carbonflux_inst%cpool_to_livestemc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadstemc => cnveg_carbonflux_inst%cpool_to_deadstemc_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadstemc_storage => cnveg_carbonflux_inst%cpool_to_deadstemc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc => cnveg_carbonflux_inst%cpool_to_livecrootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_livecrootc_storage => cnveg_carbonflux_inst%cpool_to_livecrootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadcrootc => cnveg_carbonflux_inst%cpool_to_deadcrootc_patch , & ! Output: [real(r8) (:) ] - cpool_to_deadcrootc_storage => cnveg_carbonflux_inst%cpool_to_deadcrootc_storage_patch , & ! Output: [real(r8) (:) ] - cpool_to_gresp_storage => cnveg_carbonflux_inst%cpool_to_gresp_storage_patch , & ! Output: [real(r8) (:) ] allocation to growth respiration storage (gC/m2/s) - cpool_to_grainc => cnveg_carbonflux_inst%cpool_to_grainc_patch , & ! Output: [real(r8) (:) ] allocation to grain C (gC/m2/s) - cpool_to_grainc_storage => cnveg_carbonflux_inst%cpool_to_grainc_storage_patch , & ! Output: [real(r8) (:) ] allocation to grain C storage (gC/m2/s) - - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Output: [real(r8) (:,:) ] (gN/m3) soil mineral NO3 - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - npool => cnveg_nitrogenstate_inst%npool_patch , & ! Input: [real(r8) (:) ] (gN/m2) temporary plant N pool - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Output: [real(r8) (:) ] N flux required to support initial GPP (gN/m2/s) - plant_nalloc => cnveg_nitrogenflux_inst%plant_nalloc_patch , & ! Output: [real(r8) (:) ] total allocated N flux (gN/m2/s) - npool_to_grainn => cnveg_nitrogenflux_inst%npool_to_grainn_patch , & ! Output: [real(r8) (:) ] allocation to grain N (gN/m2/s) - npool_to_grainn_storage => cnveg_nitrogenflux_inst%npool_to_grainn_storage_patch , & ! Output: [real(r8) (:) ] allocation to grain N storage (gN/m2/s) - retransn_to_npool => cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of retranslocated N (gN/m2/s) - sminn_to_npool => cnveg_nitrogenflux_inst%sminn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of soil mineral N uptake (gN/m2/s) - npool_to_leafn => cnveg_nitrogenflux_inst%npool_to_leafn_patch , & ! Output: [real(r8) (:) ] allocation to leaf N (gN/m2/s) - npool_to_leafn_storage => cnveg_nitrogenflux_inst%npool_to_leafn_storage_patch , & ! Output: [real(r8) (:) ] allocation to leaf N storage (gN/m2/s) - npool_to_frootn => cnveg_nitrogenflux_inst%npool_to_frootn_patch , & ! Output: [real(r8) (:) ] allocation to fine root N (gN/m2/s) - npool_to_frootn_storage => cnveg_nitrogenflux_inst%npool_to_frootn_storage_patch , & ! Output: [real(r8) (:) ] allocation to fine root N storage (gN/m2/s) - npool_to_livestemn => cnveg_nitrogenflux_inst%npool_to_livestemn_patch , & ! Output: [real(r8) (:) ] - npool_to_livestemn_storage => cnveg_nitrogenflux_inst%npool_to_livestemn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_deadstemn => cnveg_nitrogenflux_inst%npool_to_deadstemn_patch , & ! Output: [real(r8) (:) ] - npool_to_deadstemn_storage => cnveg_nitrogenflux_inst%npool_to_deadstemn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_livecrootn => cnveg_nitrogenflux_inst%npool_to_livecrootn_patch , & ! Output: [real(r8) (:) ] - npool_to_livecrootn_storage => cnveg_nitrogenflux_inst%npool_to_livecrootn_storage_patch , & ! Output: [real(r8) (:) ] - npool_to_deadcrootn => cnveg_nitrogenflux_inst%npool_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] - npool_to_deadcrootn_storage => cnveg_nitrogenflux_inst%npool_to_deadcrootn_storage_patch , & ! Output: [real(r8) (:) ] - Npassive => cnveg_nitrogenflux_inst%Npassive_patch , & ! Output: [real(r8) (:) ] Passive N uptake (gN/m2/s) - Nfix => cnveg_nitrogenflux_inst%Nfix_patch , & ! Output: [real(r8) (:) ] Symbiotic BNF (gN/m2/s) - Nactive => cnveg_nitrogenflux_inst%Nactive_patch , & ! Output: [real(r8) (:) ] Mycorrhizal N uptake (gN/m2/s) - Nnonmyc => cnveg_nitrogenflux_inst%Nnonmyc_patch , & ! Output: [real(r8) (:) ] Non-mycorrhizal N uptake (gN/m2/s) - Nam => cnveg_nitrogenflux_inst%Nam_patch , & ! Output: [real(r8) (:) ] AM uptake (gN/m2/s) - Necm => cnveg_nitrogenflux_inst%Necm_patch , & ! Output: [real(r8) (:) ] ECM uptake (gN/m2/s) - sminn_to_plant_fun => cnveg_nitrogenflux_inst%sminn_to_plant_fun_patch & ! Output: [real(r8) (:) ] Total soil N uptake of FUN (gN/m2/s) - - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! patch loop to distribute the available N between the competing patches - ! on the basis of relative demand, and allocate C and N to new growth and storage - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - ! set some local allocation variables - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! There was an error in this formula in previous version, where the coefficient - ! was 0.004 instead of 0.0025. - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiology file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - fcur = fcur2(ivt(p)) - - if (.not. downreg_opt) then - if (evergreen(ivt(p)) == 1._r8) then - fcur = 0.0_r8 - end if - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - if (croplive(p)) then - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - else - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - ! increase fcur linearly with ndays_active, until fcur reaches 1.0 at - ! ndays_active = days/year. This prevents the continued storage of C and N. - ! turning off this correction (PET, 12/11/03), instead using bgtr in - ! phenology algorithm. - - - if(use_fun)then ! if we are using FUN, we get the N available from there. - sminn_to_npool(p) = sminn_to_plant_fun(p) - else ! no FUN. :( we get N available from the FPG calculation in soilbiogeochemistry competition. - sminn_to_npool(p) = plant_ndemand(p) * fpg(c) - endif - - plant_nalloc(p) = sminn_to_npool(p) + retransn_to_npool(p) - - if(.not.use_fun)then - if (downreg_opt) then - ! calculate the associated carbon allocation, and the excess - ! carbon flux that must be accounted for through downregulation - plant_calloc(p) = plant_nalloc(p) * (c_allometry(p)/n_allometry(p)) - excess_cflux(p) = availc(p) - plant_calloc(p) - - ! reduce gpp fluxes due to N limitation - if (gpp(p) > 0.0_r8) then - downreg(p) = excess_cflux(p)/gpp(p) - - psnsun_to_cpool(p) = psnsun_to_cpool(p) *(1._r8 - downreg(p)) - psnshade_to_cpool(p) = psnshade_to_cpool(p)*(1._r8 - downreg(p)) - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = & - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) *(1._r8 - downreg(p)) - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = & - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p)*(1._r8 - downreg(p)) - endif - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = & - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) *(1._r8 - downreg(p)) - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = & - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p)*(1._r8 - downreg(p)) - endif - end if - end if - end if - - - if(use_fun)then - plant_calloc(p) = npp_growth(p) - else - if (.not. downreg_opt) then - plant_calloc(p) = availc(p) - end if - end if - - ! calculate the amount of new leaf C dictated by these allocation - ! decisions, and calculate the daily fluxes of C and N to current - ! growth and storage pools - - ! fcur is the proportion of this day's growth that is displayed now, - ! the remainder going into storage for display next year through the - ! transfer pools - - nlc = plant_calloc(p) / c_allometry(p) - - cpool_to_leafc(p) = nlc * fcur - cpool_to_leafc_storage(p) = nlc * (1._r8 - fcur) - cpool_to_frootc(p) = nlc * f1 * fcur - cpool_to_frootc_storage(p) = nlc * f1 * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_grainc(p) = nlc * f5 * fcur - cpool_to_grainc_storage(p) = nlc * f5 * (1._r8 -fcur) - end if - - if (downreg_opt) then - ! corresponding N fluxes - npool_to_leafn(p) = (nlc / cnl) * fcur - npool_to_leafn_storage(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_frootn(p) = (nlc * f1 / cnfr) * fcur - npool_to_frootn_storage(p) = (nlc * f1 / cnfr) * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cng = graincn(ivt(p)) - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_grainn(p) = (nlc * f5 / cng) * fcur - npool_to_grainn_storage(p) = (nlc * f5 / cng) * (1._r8 -fcur) - end if - end if - - if (downreg_opt .eqv. .false. .AND. CN_partition_opt == 0) then - - ! N transfer depends on supply and demand - npool_to_frootn_demand(p) = (nlc * f1 / cnfr) * fcur - npool_to_frootn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) = max(min(npool_to_frootn_supply(p),npool_to_frootn_demand(p)),0.0_r8) - - npool_to_frootn_storage_demand(p) = (nlc * f1 / cnfr) * (1._r8 - fcur) - npool_to_frootn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) = max(min(npool_to_frootn_storage_supply(p),npool_to_frootn_storage_demand(p)),0.0_r8) - - npool_to_leafn_demand(p) = (nlc / cnl) * fcur - npool_to_leafn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_leafn(p) = max(min(npool_to_leafn_supply(p),npool_to_leafn_demand(p)),0.0_r8) - - npool_to_leafn_storage_demand(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_leafn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - npool_to_leafn_storage(p) = max(min(npool_to_leafn_storage_supply(p),npool_to_leafn_storage_demand(p)),0.0_r8) - - if (CN_residual_opt == 1) then - npool_to_leafn(p) = max(npool_to_leafn_supply(p),0.0_r8) - npool_to_leafn_storage(p) = max(npool_to_leafn_storage_supply(p),0.0_r8) - end if - - if (woody(ivt(p)) == 1._r8) then - npool_to_livestemn_demand(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) = max(min(npool_to_livestemn_supply(p),npool_to_livestemn_demand(p)),0.0_r8) - - npool_to_livestemn_storage_demand(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_livestemn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - npool_to_livestemn_storage(p) = max(min(npool_to_livestemn_storage_supply(p), & - npool_to_livestemn_storage_demand(p)),0.0_r8) - - npool_to_livecrootn_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - npool_to_livecrootn(p) = max(min(npool_to_livecrootn_supply(p),npool_to_livecrootn_demand(p)),0.0_r8) - - npool_to_livecrootn_storage_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_livecrootn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) = max(min(npool_to_livecrootn_storage_supply(p), & - npool_to_livecrootn_storage_demand(p)),0.0_r8) - - npool_to_deadstemn_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) = max(min(npool_to_deadstemn_supply(p),npool_to_deadstemn_demand(p)),0.0_r8) - - npool_to_deadstemn_storage_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_deadstemn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) = max(min(npool_to_deadstemn_storage_supply(p), & - npool_to_deadstemn_storage_demand(p)),0.0_r8) - - npool_to_deadcrootn_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) - npool_to_deadcrootn(p) = max(min(npool_to_deadcrootn_supply(p),npool_to_deadcrootn_demand(p)),0.0_r8) - - npool_to_deadcrootn_storage_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_deadcrootn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) - npool_to_deadcrootn_storage(p) = max(min(npool_to_deadcrootn_storage_supply(p), & - npool_to_deadcrootn_storage_demand(p)),0.0_r8) - - npool_to_leafn_demand(p) = (nlc / cnl) * fcur - npool_to_leafn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) - npool_to_deadcrootn(p) - npool_to_leafn(p) = max(min(npool_to_leafn_supply(p),npool_to_leafn_demand(p)),0.0_r8) - - npool_to_leafn_storage_demand(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_leafn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) - & - npool_to_deadcrootn_storage(p) - npool_to_leafn_storage(p) = max(min(npool_to_leafn_storage_supply(p),& - npool_to_leafn_storage_demand(p)),0.0_r8) - - if (CN_residual_opt == 1) then - npool_to_leafn(p) = max(npool_to_leafn_supply(p),0.0_r8) - npool_to_leafn_storage(p) = max(npool_to_leafn_storage_supply(p),0.0_r8) - end if - - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cng = graincn(ivt(p)) - npool_to_livestemn_demand(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) = max(min(npool_to_livestemn_supply(p),npool_to_livestemn_demand(p)),0.0_r8) - - npool_to_livestemn_storage_demand(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_livestemn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - npool_to_livestemn_storage(p) = max(min(npool_to_livestemn_storage_supply(p), & - npool_to_livestemn_storage_demand(p)),0.0_r8) - - npool_to_livecrootn_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - npool_to_livecrootn(p) = max(min(npool_to_livecrootn_supply(p),npool_to_livecrootn_demand(p)),0.0_r8) - - npool_to_livecrootn_storage_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_livecrootn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) = max(min(npool_to_livecrootn_storage_supply(p), & - npool_to_livecrootn_storage_demand(p)),0.0_r8) - - npool_to_deadstemn_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) = max(min(npool_to_deadstemn_supply(p), npool_to_deadstemn_demand(p)), 0.0_r8) - - npool_to_deadstemn_storage_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_deadstemn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) = max(min(npool_to_deadstemn_storage_supply(p), & - npool_to_deadstemn_storage_demand(p)),0.0_r8) - - npool_to_deadcrootn_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) - npool_to_deadcrootn(p) = max(min(npool_to_deadcrootn_supply(p), npool_to_deadcrootn_demand(p)), 0.0_r8) - - npool_to_deadcrootn_storage_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_deadcrootn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) - npool_to_deadcrootn_storage(p) = max(min(npool_to_deadcrootn_storage_supply(p), & - npool_to_deadcrootn_storage_demand(p)),0.0_r8) - - npool_to_grainn_demand(p) = (nlc * f5 / cng) * fcur - npool_to_grainn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) - npool_to_deadcrootn(p) - npool_to_grainn(p) = max(min(npool_to_grainn_supply(p), npool_to_grainn_demand(p)), 0.0_r8) - - npool_to_grainn_storage_demand(p) = (nlc * f5 / cng) * (1._r8 -fcur) - npool_to_grainn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) - npool_to_deadstemn_storage(p) - & - npool_to_deadcrootn_storage(p) - npool_to_grainn_storage(p) = max(min(npool_to_grainn_storage_supply(p), npool_to_grainn_storage_demand(p)), & - 0.0_r8) - - npool_to_leafn_demand(p) = (nlc / cnl) * fcur - npool_to_leafn_supply(p) = npool(p)/dt * fcur - npool_to_frootn(p) - npool_to_livestemn(p) - & - npool_to_livecrootn(p) - npool_to_deadstemn(p) - npool_to_deadcrootn(p) - npool_to_grainn(p) - npool_to_leafn(p) = max(min(npool_to_leafn_supply(p), npool_to_leafn_demand(p)), 0.0_r8) - - npool_to_leafn_storage_demand(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_leafn_storage_supply(p) = npool(p)/dt * (1._r8 - fcur) - npool_to_frootn_storage(p) - & - npool_to_livestemn_storage(p) - npool_to_livecrootn_storage(p) & - - npool_to_deadstemn_storage(p) - npool_to_deadcrootn_storage(p) - npool_to_grainn_storage(p) - npool_to_leafn_storage(p) = max(min(npool_to_leafn_storage_supply(p), npool_to_leafn_storage_demand(p)), & - 0.0_r8) - - if (CN_residual_opt == 1) then - npool_to_leafn(p) = max(npool_to_leafn_supply(p),0.0_r8) - npool_to_leafn_storage(p) = max(npool_to_leafn_storage_supply(p),0.0_r8) - end if - - end if - - end if - - - ! Calculate the amount of carbon that needs to go into growth - ! respiration storage to satisfy all of the storage growth demands. - ! Allows for the fraction of growth respiration that is released at the - ! time of fixation, versus the remaining fraction that is stored for - ! release at the time of display. Note that all the growth respiration - ! fluxes that get released on a given timestep are calculated in growth_resp(), - ! but that the storage of C for growth resp during display of transferred - ! growth is assigned here. - - gresp_storage = cpool_to_leafc_storage(p) + cpool_to_frootc_storage(p) - if (woody(ivt(p)) == 1._r8) then - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadstemc_storage(p) - - gresp_storage = gresp_storage + cpool_to_livecrootc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadcrootc_storage(p) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_grainc_storage(p) - end if - cpool_to_gresp_storage(p) = gresp_storage * g1 * (1._r8 - g2) - - - ! computing 1.) fractional N demand and 2.) N allocation after uptake for different plant parts - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if (downreg_opt .eqv. .false. .AND. CN_partition_opt == 1) then - - ! computing nitrogen demand for different pools based on carbon allocated and CN ratio - npool_to_leafn_demand(p) = (nlc / cnl) * fcur - npool_to_leafn_storage_demand(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_frootn_demand(p) = (nlc * f1 / cnfr) * fcur - npool_to_frootn_storage_demand(p) = (nlc * f1 / cnfr) * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - - npool_to_livestemn_demand(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage_demand(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - cng = graincn(ivt(p)) - npool_to_livestemn_demand(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage_demand(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage_demand(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage_demand(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage_demand(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_grainn_demand(p) = (nlc * f5 / cng) * fcur - npool_to_grainn_storage_demand(p) = (nlc * f5 / cng) * (1._r8 -fcur) - end if - - - ! computing 1.) fractional N demand for different plant parts - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - total_plant_Ndemand(p) = npool_to_leafn_demand(p) + npool_to_leafn_storage_demand(p) + & - npool_to_frootn_demand(p) + npool_to_frootn_storage_demand(p) - - if (woody(ivt(p)) == 1._r8) then - - total_plant_Ndemand(p) = npool_to_leafn_demand(p) + npool_to_leafn_storage_demand(p) + & - npool_to_frootn_demand(p) + npool_to_frootn_storage_demand(p) + & - npool_to_livestemn_demand(p) + npool_to_livestemn_storage_demand(p) + npool_to_deadstemn_demand(p) + & - npool_to_deadstemn_storage_demand(p) + & - npool_to_livecrootn_demand(p) + npool_to_livecrootn_storage_demand(p) + npool_to_deadcrootn_demand(p) + & - npool_to_deadcrootn_storage_demand(p) - - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - total_plant_Ndemand(p) = npool_to_leafn_demand(p) + npool_to_leafn_storage_demand(p) + & - npool_to_frootn_demand(p) + npool_to_frootn_storage_demand(p) + & - npool_to_livestemn_demand(p) + npool_to_livestemn_storage_demand(p) + npool_to_deadstemn_demand(p) + & - npool_to_deadstemn_storage_demand(p) + & - npool_to_livecrootn_demand(p) + npool_to_livecrootn_storage_demand(p) + npool_to_deadcrootn_demand(p) + & - npool_to_deadcrootn_storage_demand(p) + & - npool_to_grainn_demand(p) + npool_to_grainn_storage_demand(p) - - end if - - if (total_plant_Ndemand(p) == 0.0_r8) then ! removing division by zero - - frNdemand_npool_to_leafn(p) = 0.0_r8 - frNdemand_npool_to_leafn_storage(p) = 0.0_r8 - frNdemand_npool_to_frootn(p) = 0.0_r8 - frNdemand_npool_to_frootn_storage(p) = 0.0_r8 - if (woody(ivt(p)) == 1._r8) then - - frNdemand_npool_to_livestemn(p) = 0.0_r8 - frNdemand_npool_to_livestemn_storage(p) = 0.0_r8 - frNdemand_npool_to_deadstemn(p) = 0.0_r8 - frNdemand_npool_to_deadstemn_storage(p) = 0.0_r8 - frNdemand_npool_to_livecrootn(p) = 0.0_r8 - frNdemand_npool_to_livecrootn_storage(p) = 0.0_r8 - frNdemand_npool_to_deadcrootn(p) = 0.0_r8 - frNdemand_npool_to_deadcrootn_storage(p) = 0.0_r8 - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - frNdemand_npool_to_livestemn(p) = 0.0_r8 - frNdemand_npool_to_livestemn_storage(p) = 0.0_r8 - frNdemand_npool_to_deadstemn(p) = 0.0_r8 - frNdemand_npool_to_deadstemn_storage(p) = 0.0_r8 - frNdemand_npool_to_livecrootn(p) = 0.0_r8 - frNdemand_npool_to_livecrootn_storage(p) = 0.0_r8 - frNdemand_npool_to_deadcrootn(p) = 0.0_r8 - frNdemand_npool_to_deadcrootn_storage(p) = 0.0_r8 - frNdemand_npool_to_grainn(p) = 0.0_r8 - frNdemand_npool_to_grainn_storage(p) = 0.0_r8 - end if - - else - - frNdemand_npool_to_leafn(p) = npool_to_leafn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_leafn_storage(p) = npool_to_leafn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_frootn(p) = npool_to_frootn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_frootn_storage(p) = npool_to_frootn_storage_demand(p) / total_plant_Ndemand(p) - if (woody(ivt(p)) == 1._r8) then - - frNdemand_npool_to_livestemn(p) = npool_to_livestemn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livestemn_storage(p) = npool_to_livestemn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadstemn(p) = npool_to_deadstemn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadstemn_storage(p) = npool_to_deadstemn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livecrootn(p) = npool_to_livecrootn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livecrootn_storage(p) = npool_to_livecrootn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadcrootn(p) = npool_to_deadcrootn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadcrootn_storage(p) = npool_to_deadcrootn_storage_demand(p) / total_plant_Ndemand(p) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - frNdemand_npool_to_livestemn(p) = npool_to_livestemn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livestemn_storage(p) = npool_to_livestemn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadstemn(p) = npool_to_deadstemn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadstemn_storage(p) = npool_to_deadstemn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livecrootn(p) = npool_to_livecrootn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_livecrootn_storage(p) = npool_to_livecrootn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadcrootn(p) = npool_to_deadcrootn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_deadcrootn_storage(p) = npool_to_deadcrootn_storage_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_grainn(p) = npool_to_grainn_demand(p) / total_plant_Ndemand(p) - frNdemand_npool_to_grainn_storage(p) = npool_to_grainn_storage_demand(p) / total_plant_Ndemand(p) - end if - - end if - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! computing N allocation for different plant parts - ! allocating allocation to different plant parts in proportion to the fractional demand - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - npool_to_leafn(p) = frNdemand_npool_to_leafn(p) * npool(p) / dt - npool_to_leafn_storage(p) = frNdemand_npool_to_leafn_storage(p) * npool(p) / dt - npool_to_frootn(p) = frNdemand_npool_to_frootn(p) * npool(p) / dt - npool_to_frootn_storage(p) = frNdemand_npool_to_frootn_storage(p) * npool(p) / dt - if (woody(ivt(p)) == 1._r8) then - npool_to_livestemn(p) = frNdemand_npool_to_livestemn(p) * npool(p) / dt - npool_to_livestemn_storage(p) = frNdemand_npool_to_livestemn_storage(p) * npool(p) / dt - npool_to_deadstemn(p) = frNdemand_npool_to_deadstemn(p) * npool(p) / dt - npool_to_deadstemn_storage(p) = frNdemand_npool_to_deadstemn_storage(p) * npool(p) / dt - npool_to_livecrootn(p) = frNdemand_npool_to_livecrootn(p) * npool(p) / dt - npool_to_livecrootn_storage(p) = frNdemand_npool_to_livecrootn_storage(p) * npool(p) / dt - npool_to_deadcrootn(p) = frNdemand_npool_to_deadcrootn(p) * npool(p) / dt - npool_to_deadcrootn_storage(p) = frNdemand_npool_to_deadcrootn_storage(p) * npool(p) / dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - npool_to_livestemn(p) = frNdemand_npool_to_livestemn(p) * npool(p) / dt - npool_to_livestemn_storage(p) = frNdemand_npool_to_livestemn_storage(p) * npool(p) / dt - npool_to_deadstemn(p) = frNdemand_npool_to_deadstemn(p) * npool(p) / dt - npool_to_deadstemn_storage(p) = frNdemand_npool_to_deadstemn_storage(p) * npool(p) / dt - npool_to_livecrootn(p) = frNdemand_npool_to_livecrootn(p) * npool(p) / dt - npool_to_livecrootn_storage(p) = frNdemand_npool_to_livecrootn_storage(p) * npool(p) / dt - npool_to_deadcrootn(p) = frNdemand_npool_to_deadcrootn(p) * npool(p) / dt - npool_to_deadcrootn_storage(p) = frNdemand_npool_to_deadcrootn_storage(p) * npool(p) / dt - npool_to_grainn(p) = frNdemand_npool_to_grainn(p) * npool(p) / dt - npool_to_grainn_storage(p) = frNdemand_npool_to_grainn_storage(p) * npool(p) / dt - end if - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - cpool_to_resp(p) = 0.0_r8 - cpool_to_leafc_resp(p) = 0.0_r8 - cpool_to_leafc_storage_resp(p) = 0.0_r8 - cpool_to_frootc_resp(p) = 0.0_r8 - cpool_to_frootc_storage_resp(p) = 0.0_r8 - cpool_to_livecrootc_resp(p) = 0.0_r8 - cpool_to_livecrootc_storage_resp(p) = 0.0_r8 - cpool_to_livestemc_resp(p) = 0.0_r8 - cpool_to_livestemc_storage_resp(p) = 0.0_r8 - - if ( laisun(p)+laisha(p) > 0.0_r8 ) then - if (cnveg_nitrogenstate_inst%leafn_storage_patch(p) == 0.0_r8 ) then - ! to avoid division by zero, and also to make actual_leafncn(p) a very large number if leafn(p) is zero - this%actual_storage_leafcn(p) = spval - else - ! leaf CN ratio - this%actual_storage_leafcn(p) = cnveg_carbonstate_inst%leafc_storage_patch(p) & - / cnveg_nitrogenstate_inst%leafn_storage_patch(p) - end if - end if - - if (carbon_resp_opt == 1 .AND. laisun(p)+laisha(p) > 0.0_r8) then - ! computing carbon to nitrogen ratio of different plant parts - - - if (cnveg_nitrogenstate_inst%frootn_storage_patch(p) == 0.0_r8) then - ! to avoid division by zero, and also to make frootcn_actual(p) a very large number if frootc(p) is zero - frootcn_actual = cnveg_carbonstate_inst%frootc_storage_patch(p) / n_min - else - ! fine root CN ratio - frootcn_actual = cnveg_carbonstate_inst%frootc_storage_patch(p) / cnveg_nitrogenstate_inst%frootn_storage_patch(p) - end if - - if (woody(ivt(p)) == 1._r8) then - - if (cnveg_nitrogenstate_inst%livestemn_storage_patch(p) == 0.0_r8) then - ! to avoid division by zero, and also to make livestemcn_actual(p) a very large number if livestemc(p) is zero - livestemcn_actual = cnveg_carbonstate_inst%livestemc_storage_patch(p) / n_min - else - ! live stem CN ratio - livestemcn_actual = cnveg_carbonstate_inst%livestemc_storage_patch(p) / & - cnveg_nitrogenstate_inst%livestemn_storage_patch(p) - end if - - if (cnveg_nitrogenstate_inst%livecrootn_storage_patch(p) == 0.0_r8) then - ! to avoid division by zero, and also to make livecrootcn_actual(p) a very large number if livecrootc(p) is zero - livecrootcn_actual = cnveg_carbonstate_inst%livecrootc_storage_patch(p) / n_min - else - ! live coarse root CN ratio - livecrootcn_actual = cnveg_carbonstate_inst%livecrootc_storage_patch(p) / & - cnveg_nitrogenstate_inst%livecrootn_storage_patch(p) - end if - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - if (cnveg_nitrogenstate_inst%livestemn_storage_patch(p) == 0.0_r8) then - ! to avoid division by zero, and also to make livestemcn_actual(p) a very large number if livestemc(p) is zero - livestemcn_actual = cnveg_carbonstate_inst%livestemc_storage_patch(p) / n_min - else - ! live stem CN ratio - livestemcn_actual = cnveg_carbonstate_inst%livestemc_storage_patch(p) / & - cnveg_nitrogenstate_inst%livestemn_storage_patch(p) - end if - - if (cnveg_nitrogenstate_inst%livecrootn_storage_patch(p) == 0.0_r8) then - ! to avoid division by zero, and also to make livecrootcn_actual(p) a very large number if livecrootc(p) is zero - livecrootcn_actual = cnveg_carbonstate_inst%livecrootc_storage_patch(p) / n_min - else - ! live coarse root CN ratio - livecrootcn_actual = cnveg_carbonstate_inst%livecrootc_storage_patch(p) / & - cnveg_nitrogenstate_inst%livecrootn_storage_patch(p) - end if - end if - - leafcn_max = leafcn(ivt(p)) + 15.0_r8 - frootcn_max = frootcn(ivt(p)) + 15.0_r8 - - ! Note that for high CN ratio stress the plant part does not retranslocate nitrogen as the plant part will need the N - ! if high leaf CN ratio (i.e., high leaf C compared to N) then turnover extra C - if (this%actual_storage_leafcn(p) > leafcn_max) then - - frac_resp = (this%actual_storage_leafcn(p) - leafcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_leafc_resp(p) = frac_resp * cpool_to_leafc(p) - cpool_to_leafc_storage_resp(p) = frac_resp * cpool_to_leafc_storage(p) - - !cpool_to_leafc(p) = cpool_to_leafc(p) - cpool_to_leafc_resp(p) - !cpool_to_leafc_storage(p) = cpool_to_leafc_storage(p) - cpool_to_leafc_storage_resp(p) - - end if - - ! if high fine root CN ratio (i.e., high fine root C compared to N) then turnover extra C - if (frootcn_actual > frootcn_max) then - - frac_resp = (frootcn_actual - frootcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_frootc_resp(p) = frac_resp * cpool_to_frootc(p) - cpool_to_frootc_storage_resp(p) = frac_resp * cpool_to_frootc_storage(p) - - !cpool_to_frootc(p) = cpool_to_frootc(p) - cpool_to_frootc_resp(p) - !cpool_to_frootc_storage(p) = cpool_to_frootc_storage(p) - cpool_to_frootc_storage_resp(p) - - end if - - if (woody(ivt(p)) == 1._r8) then - - livewdcn_max = livewdcn(ivt(p)) + 15.0_r8 - - ! if high coarse root CN ratio (i.e., high coarse root C compared to N) then turnover extra C - if (livecrootcn_actual > livewdcn_max) then - - frac_resp = (livecrootcn_actual - livewdcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_livecrootc_resp(p) = frac_resp * cpool_to_livecrootc(p) - cpool_to_livecrootc_storage_resp(p) = frac_resp * cpool_to_livecrootc_storage(p) - - !cpool_to_livecrootc(p) = cpool_to_livecrootc(p) - cpool_to_livecrootc_resp(p) - !cpool_to_livecrootc_storage(p) = cpool_to_livecrootc_storage(p) - cpool_to_livecrootc_storage_resp(p) - - end if - - ! if high stem CN ratio (i.e., high stem C compared to N) then turnover extra C - if (livestemcn_actual > livewdcn_max) then - - frac_resp = (livestemcn_actual - livewdcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_livestemc_resp(p) = frac_resp * cpool_to_livestemc(p) - cpool_to_livestemc_storage_resp(p) = frac_resp * cpool_to_livestemc_storage(p) - - !cpool_to_livestemc(p) = cpool_to_livestemc(p) - cpool_to_livestemc_resp(p) - !cpool_to_livestemc_storage(p) = cpool_to_livestemc_storage(p) - cpool_to_livestemc_storage_resp(p) - - end if - - end if - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - livewdcn_max = livewdcn(ivt(p)) + 15.0_r8 - - ! if high coarse root CN ratio (i.e., high coarse root C compared to N) then turnover extra C - if (livecrootcn_actual > livewdcn_max) then - - frac_resp = (livecrootcn_actual - livewdcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_livecrootc_resp(p) = frac_resp * cpool_to_livecrootc(p) - cpool_to_livecrootc_storage_resp(p) = frac_resp * cpool_to_livecrootc_storage(p) - - !cpool_to_livecrootc(p) = cpool_to_livecrootc(p) - cpool_to_livecrootc_resp(p) - !cpool_to_livecrootc_storage(p) = cpool_to_livecrootc_storage(p) - cpool_to_livecrootc_storage_resp(p) - - end if - - ! if high stem CN ratio (i.e., high stem C compared to N) then turnover extra C - if (livestemcn_actual > livewdcn_max) then - - frac_resp = (livestemcn_actual - livewdcn_max) / 10.0_r8 - frac_resp = min(1.0_r8, max(0.0_r8, frac_resp)) - - cpool_to_livestemc_resp(p) = frac_resp * cpool_to_livestemc(p) - cpool_to_livestemc_storage_resp(p) = frac_resp * cpool_to_livestemc_storage(p) - - !cpool_to_livestemc(p) = cpool_to_livestemc(p) - cpool_to_livestemc_resp(p) - !cpool_to_livestemc_storage(p) = cpool_to_livestemc_storage(p) - cpool_to_livestemc_storage_resp(p) - - end if - - end if - - cpool_to_resp(p) = cpool_to_leafc_resp(p) + cpool_to_leafc_storage_resp(p) + cpool_to_frootc_resp(p) + & - cpool_to_frootc_storage_resp(p) + cpool_to_livecrootc_resp(p) + cpool_to_livecrootc_storage_resp(p) + & - cpool_to_livestemc_resp(p) + cpool_to_livestemc_storage_resp(p) - - end if ! end of if (carbon_resp_opt == 1 .AND. laisun(p)+laisha(p) > 0.0_r8) then - - !if (cnveg_nitrogenstate_inst%leafn_storage_patch(p) < n_min .or. laisun(p)+laisha(p) <= 0.0_r8) then - !! to make output on history missing value - !this%actual_storage_leafcn(p) = spval - !end if - - end if ! end of if (downreg_opt .eqv. .false. .AND. CN_partition_opt == 1) then - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - end do ! end patch loop - - end associate - - end subroutine calc_plant_cn_alloc - -! ----------------------------------------------------------------------- - subroutine calc_plant_nutrient_demand(this, bounds, num_soilp, filter_soilp,& - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot, arepr) - ! - ! !USES: - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use CropType , only : crop_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemCarbonFluxType, only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use EnergyFluxType , only : energyflux_type ! - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(photosyns_type) , intent(in) :: photosyns_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - real(r8) , intent(out) :: aroot(bounds%begp:) - real(r8) , intent(out) :: arepr(bounds%begp:) - !----------------------------------------------------------------------- - - call this%calc_plant_nitrogen_demand(bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot=aroot(bounds%begp:bounds%endp), & - arepr=arepr(bounds%begp:bounds%endp)) - - end subroutine calc_plant_nutrient_demand - - !----------------------------------------------------------------------- - subroutine calc_plant_nitrogen_demand(this, bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot, arepr) - ! - ! !USES: - use pftconMod , only : npcropmin, pftcon - use pftconMod , only : ntmp_soybean, nirrig_tmp_soybean - use pftconMod , only : ntrp_soybean, nirrig_trp_soybean - use clm_varcon , only : secspday, dzsoi_decomp - use clm_varctl , only : use_c13, use_c14 - use clm_varctl , only : nscalar_opt, plant_ndemand_opt, substrate_term_opt, temp_scalar_opt - use clm_varpar , only : nlevdecomp - use clm_time_manager , only : get_step_size - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use CropType , only : crop_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemCarbonFluxType, only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use EnergyFluxType , only : energyflux_type ! - use CNSharedParamsMod , only : use_fun - use CNPrecisionControlMod , only : n_min - use clm_varcon , only : spval - ! !ARGUMENTS: - class(nutrient_competition_FlexibleCN_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(photosyns_type) , intent(in) :: photosyns_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - real(r8) , intent(out) :: aroot(bounds%begp:) - real(r8) , intent(out) :: arepr(bounds%begp:) - ! - ! !LOCAL VARIABLES: - integer :: c, p, j ! indices - integer :: fp ! lake filter patch index - real(r8) :: mr ! maintenance respiration (gC/m2/s) - real(r8) :: f1, f2, f3, f4, g1, g2 ! allocation parameters - real(r8) :: cnl, cnfr, cnlw, cndw ! C:N ratios for leaf, fine root, and wood - real(r8) :: curmr, curmr_ratio ! xsmrpool temporary variables - real(r8) :: f5 ! grain allocation parameter - real(r8) :: cng ! C:N ratio for grain (= cnlw for now; slevis) - real(r8) :: fleaf ! fraction allocated to leaf - real(r8) :: t1 ! temporary variable - real(r8) :: dt ! model time step - real(r8) :: dayscrecover ! number of days to recover negative cpool - real(r8) :: f_N (bounds%begp:bounds%endp) - real(r8) :: Kmin - real(r8) :: leafcn_max - real(r8) :: leafcn_min - real(r8) :: nscalar - real(r8) :: sminn_total - real(r8) :: substrate_term - real(r8) :: temp_scalar - real(r8) :: Vmax_N - real(r8) :: allocation_leaf (bounds%begp:bounds%endp) - real(r8) :: allocation_stem (bounds%begp:bounds%endp) - real(r8) :: allocation_froot (bounds%begp:bounds%endp) - - ! ----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(aroot) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(arepr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(this%actual_leafcn) >= (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((lbound(this%actual_leafcn) <= (/bounds%begp/)), errMsg(sourcefile, __LINE__)) - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - froot_leaf => pftcon%froot_leaf , & ! Input: allocation parameter: new fine root C per new leaf C (gC/gC) - croot_stem => pftcon%croot_stem , & ! Input: allocation parameter: new coarse root C per new stem C (gC/gC) - stem_leaf => pftcon%stem_leaf , & ! Input: allocation parameter: new stem c per new leaf C (gC/gC) - flivewd => pftcon%flivewd , & ! Input: allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - livewdcn => pftcon%livewdcn , & ! Input: live wood (phloem and ray parenchyma) C:N (gC/gN) - deadwdcn => pftcon%deadwdcn , & ! Input: dead wood (xylem and heartwood) C:N (gC/gN) - graincn => pftcon%graincn , & ! Input: grain C:N (gC/gN) - fleafcn => pftcon%fleafcn , & ! Input: leaf c:n during organ fill - ffrootcn => pftcon%ffrootcn , & ! Input: froot c:n during organ fill - fstemcn => pftcon%fstemcn , & ! Input: stem c:n during organ fill - bfact => pftcon%bfact , & ! Input: parameter used below - aleaff => pftcon%aleaff , & ! Input: parameter used below - arootf => pftcon%arootf , & ! Input: parameter used below - astemf => pftcon%astemf , & ! Input: parameter used below - arooti => pftcon%arooti , & ! Input: parameter used below - fleafi => pftcon%fleafi , & ! Input: parameter used below - allconsl => pftcon%allconsl , & ! Input: parameter used below - allconss => pftcon%allconss , & ! Input: parameter used below - grperc => pftcon%grperc , & ! Input: parameter used below - grpnow => pftcon%grpnow , & ! Input: parameter used below - declfact => pftcon%declfact , & ! Input: - season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal-deciduous leaf habit (0 or 1) - stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress-deciduous leaf habit (0 or 1) - psnsun => photosyns_inst%psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - psnsha => photosyns_inst%psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - c13_psnsun => photosyns_inst%c13_psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - c13_psnsha => photosyns_inst%c13_psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - c14_psnsun => photosyns_inst%c14_psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - c14_psnsha => photosyns_inst%c14_psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index - - hui => crop_inst%gddplant_patch , & ! Input: [real(r8) (:) ] =gdd since planting (gddplant) - leafout => crop_inst%gddtsoi_patch , & ! Input: [real(r8) (:) ] =gdd from top soil layer temperature - croplive => crop_inst%croplive_patch , & ! Input: [logical (:) ] flag, true if planted, not harvested - - gddmaturity => cnveg_state_inst%gddmaturity_patch , & ! Input: [real(r8) (:) ] gdd needed to harvest - huileaf => cnveg_state_inst%huileaf_patch , & ! Input: [real(r8) (:) ] heat unit index needed from planting to leaf emergence - huigrain => cnveg_state_inst%huigrain_patch , & ! Input: [real(r8) (:) ] same to reach vegetative maturity - peaklai => cnveg_state_inst%peaklai_patch , & ! Input: [integer (:) ] 1: max allowed lai; 0: not at max - aleafi => cnveg_state_inst%aleafi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 - astemi => cnveg_state_inst%astemi_patch , & ! Output: [real(r8) (:) ] saved allocation coefficient from phase 2 - aleaf => cnveg_state_inst%aleaf_patch , & ! Output: [real(r8) (:) ] leaf allocation coefficient - astem => cnveg_state_inst%astem_patch , & ! Output: [real(r8) (:) ] stem allocation coefficient - grain_flag => cnveg_state_inst%grain_flag_patch , & ! Output: [real(r8) (:) ] 1: grain fill stage; 0: not - c_allometry => cnveg_state_inst%c_allometry_patch , & ! Output: [real(r8) (:) ] C allocation index (DIM) - n_allometry => cnveg_state_inst%n_allometry_patch , & ! Output: [real(r8) (:) ] N allocation index (DIM) - tempsum_potential_gpp => cnveg_state_inst%tempsum_potential_gpp_patch , & ! Output: [real(r8) (:) ] temporary annual sum of potential GPP - tempmax_retransn => cnveg_state_inst%tempmax_retransn_patch , & ! Output: [real(r8) (:) ] temporary annual max of retranslocated N pool (gN/m2) - annsum_potential_gpp => cnveg_state_inst%annsum_potential_gpp_patch , & ! Output: [real(r8) (:) ] annual sum of potential GPP - annmax_retransn => cnveg_state_inst%annmax_retransn_patch , & ! Output: [real(r8) (:) ] annual max of retranslocated N pool - - xsmrpool => cnveg_carbonstate_inst%xsmrpool_patch , & ! Input: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - - annsum_npp => cnveg_carbonflux_inst%annsum_npp_patch , & ! Input: [real(r8) (:) ] annual sum of NPP, for wood allocation - leaf_mr => cnveg_carbonflux_inst%leaf_mr_patch , & ! Input: [real(r8) (:) ] - froot_mr => cnveg_carbonflux_inst%froot_mr_patch , & ! Input: [real(r8) (:) ] - livestem_mr => cnveg_carbonflux_inst%livestem_mr_patch , & ! Input: [real(r8) (:) ] - livecroot_mr => cnveg_carbonflux_inst%livecroot_mr_patch , & ! Input: [real(r8) (:) ] - grain_mr => cnveg_carbonflux_inst%grain_mr_patch , & ! Input: [real(r8) (:) ] - gpp => cnveg_carbonflux_inst%gpp_before_downreg_patch , & ! Output: [real(r8) (:) ] GPP flux before downregulation (gC/m2/s) - availc => cnveg_carbonflux_inst%availc_patch , & ! Output: [real(r8) (:) ] C flux available for allocation (gC/m2/s) - xsmrpool_recover => cnveg_carbonflux_inst%xsmrpool_recover_patch , & ! Output: [real(r8) (:) ] C flux assigned to recovery of negative cpool (gC/m2/s) - psnsun_to_cpool => cnveg_carbonflux_inst%psnsun_to_cpool_patch , & ! Output: [real(r8) (:) ] - psnshade_to_cpool => cnveg_carbonflux_inst%psnshade_to_cpool_patch , & ! Output: [real(r8) (:) ] - leaf_curmr => cnveg_carbonflux_inst%leaf_curmr_patch , & ! Output: [real(r8) (:) ] - froot_curmr => cnveg_carbonflux_inst%froot_curmr_patch , & ! Output: [real(r8) (:) ] - livestem_curmr => cnveg_carbonflux_inst%livestem_curmr_patch , & ! Output: [real(r8) (:) ] - livecroot_curmr => cnveg_carbonflux_inst%livecroot_curmr_patch , & ! Output: [real(r8) (:) ] - grain_curmr => cnveg_carbonflux_inst%grain_curmr_patch , & ! Output: [real(r8) (:) ] - leaf_xsmr => cnveg_carbonflux_inst%leaf_xsmr_patch , & ! Output: [real(r8) (:) ] - froot_xsmr => cnveg_carbonflux_inst%froot_xsmr_patch , & ! Output: [real(r8) (:) ] - livestem_xsmr => cnveg_carbonflux_inst%livestem_xsmr_patch , & ! Output: [real(r8) (:) ] - livecroot_xsmr => cnveg_carbonflux_inst%livecroot_xsmr_patch , & ! Output: [real(r8) (:) ] - grain_xsmr => cnveg_carbonflux_inst%grain_xsmr_patch , & ! Output: [real(r8) (:) ] - cpool_to_xsmrpool => cnveg_carbonflux_inst%cpool_to_xsmrpool_patch , & ! Output: [real(r8) (:) ] - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - plant_ndemand => cnveg_nitrogenflux_inst%plant_ndemand_patch , & ! Output: [real(r8) (:) ] N flux required to support initial GPP (gN/m2/s) - avail_retransn => cnveg_nitrogenflux_inst%avail_retransn_patch , & ! Output: [real(r8) (:) ] N flux available from retranslocation pool (gN/m2/s) - retransn_to_npool => cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of retranslocated N (gN/m2/s) - sminn_to_npool => cnveg_nitrogenflux_inst%sminn_to_npool_patch , & ! Output: [real(r8) (:) ] deployment of soil mineral N uptake (gN/m2/s) - leafn_to_retransn => cnveg_nitrogenflux_inst%leafn_to_retransn_patch , & ! Output: [real(r8) (:) ] - frootn_to_retransn => cnveg_nitrogenflux_inst%frootn_to_retransn_patch , & ! Output: [real(r8) (:) ] - livestemn_to_retransn => cnveg_nitrogenflux_inst%livestemn_to_retransn_patch,& ! Output: [real(r8) (:) ] - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) livestem N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N - btran => energyflux_inst%btran_patch , & ! Input: [real(r8) (:) ] transpiration wetness factor (0 to 1) - t_scalar => soilbiogeochem_carbonflux_inst%t_scalar_col & ! Input: [real(r8) (:,:) ] soil temperature scalar for decomp - - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! set number of days to recover negative cpool - dayscrecover = params_inst%dayscrecover ! loop over patches to assess the total plant N demand - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! get the time step total gross photosynthesis - ! this is coming from the canopy fluxes code, and is the - ! gpp that is used to control stomatal conductance. - ! For the nitrogen downregulation code, this is assumed - ! to be the potential gpp, and the actual gpp will be - ! reduced due to N limitation. - - ! Convert psn from umol/m2/s -> gC/m2/s - - ! The input psn (psnsun and psnsha) are expressed per unit LAI - ! in the sunlit and shaded canopy, respectively. These need to be - ! scaled by laisun and laisha to get the total gpp for allocation - - ! Note that no associate statement is used for the isotope carbon fluxes below - ! since they are not always allocated AND nag compiler will complain if you try to - ! to have an associate statement with unallocated memory - - psnsun_to_cpool(p) = psnsun(p) * laisun(p) * 12.011e-6_r8 - psnshade_to_cpool(p) = psnsha(p) * laisha(p) * 12.011e-6_r8 - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = c13_psnsun(p) * laisun(p) * 12.011e-6_r8 - c13_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = c13_psnsha(p) * laisha(p) * 12.011e-6_r8 - endif - - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%psnsun_to_cpool_patch(p) = c14_psnsun(p) * laisun(p) * 12.011e-6_r8 - c14_cnveg_carbonflux_inst%psnshade_to_cpool_patch(p) = c14_psnsha(p) * laisha(p) * 12.011e-6_r8 - endif - - gpp(p) = psnsun_to_cpool(p) + psnshade_to_cpool(p) - - ! get the time step total maintenance respiration - ! These fluxes should already be in gC/m2/s - - mr = leaf_mr(p) + froot_mr(p) - if (woody(ivt(p)) == 1.0_r8) then - mr = mr + livestem_mr(p) + livecroot_mr(p) - else if (ivt(p) >= npcropmin) then - if (croplive(p)) mr = mr + livestem_mr(p) + grain_mr(p) - end if ! carbon flux available for allocation - availc(p) = gpp(p) - mr - - ! new code added for isotope calculations, 7/1/05, PET - ! If mr > gpp, then some mr comes from gpp, the rest comes from - ! cpool (xsmr) - if (mr > 0._r8 .and. availc(p) < 0._r8) then - curmr = gpp(p) - curmr_ratio = curmr / mr - else - curmr_ratio = 1._r8 - end if - leaf_curmr(p) = leaf_mr(p) * curmr_ratio - leaf_xsmr(p) = leaf_mr(p) - leaf_curmr(p) - froot_curmr(p) = froot_mr(p) * curmr_ratio - froot_xsmr(p) = froot_mr(p) - froot_curmr(p) - livestem_curmr(p) = livestem_mr(p) * curmr_ratio - livestem_xsmr(p) = livestem_mr(p) - livestem_curmr(p) - livecroot_curmr(p) = livecroot_mr(p) * curmr_ratio - livecroot_xsmr(p) = livecroot_mr(p) - livecroot_curmr(p) - grain_curmr(p) = grain_mr(p) * curmr_ratio - grain_xsmr(p) = grain_mr(p) - grain_curmr(p) - - ! no allocation when available c is negative - availc(p) = max(availc(p),0.0_r8) - - ! test for an xsmrpool deficit - if (xsmrpool(p) < 0.0_r8) then - ! Running a deficit in the xsmrpool, so the first priority is to let - ! some availc from this timestep accumulate in xsmrpool. - ! Determine rate of recovery for xsmrpool deficit - - xsmrpool_recover(p) = -xsmrpool(p)/(dayscrecover*secspday) - if (xsmrpool_recover(p) < availc(p)) then - ! available carbon reduced by amount for xsmrpool recovery - availc(p) = availc(p) - xsmrpool_recover(p) - else - ! all of the available carbon goes to xsmrpool recovery - xsmrpool_recover(p) = availc(p) - availc(p) = 0.0_r8 - end if - cpool_to_xsmrpool(p) = xsmrpool_recover(p) - end if - - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiology file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - - - ! calculate f1 to f5 for prog crops following AgroIBIS subr phenocrop - - f5 = 0._r8 ! continued intializations from above - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - if (croplive(p)) then - ! same phases appear in subroutine CropPhenology - - ! Phase 1 completed: - ! ================== - ! if hui is less than the number of gdd needed for filling of grain - ! leaf emergence also has to have taken place for lai changes to occur - ! and carbon assimilation - ! Next phase: leaf emergence to start of leaf decline - - if (leafout(p) >= huileaf(p) .and. hui(p) < huigrain(p)) then - - ! allocation rules for crops based on maturity and linear decrease - ! of amount allocated to roots over course of the growing season - - if (peaklai(p) == 1) then ! lai at maximum allowed - arepr(p) = 0._r8 - aleaf(p) = 1.e-5_r8 - astem(p) = 0._r8 - aroot(p) = 1._r8 - arepr(p) - aleaf(p) - astem(p) - else - arepr(p) = 0._r8 - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * & - min(1._r8, hui(p)/gddmaturity(p)))) - fleaf = fleafi(ivt(p)) * (exp(-bfact(ivt(p))) - & - exp(-bfact(ivt(p))*hui(p)/huigrain(p))) / & - (exp(-bfact(ivt(p)))-1) ! fraction alloc to leaf (from J Norman alloc curve) - aleaf(p) = max(1.e-5_r8, (1._r8 - aroot(p)) * fleaf) - astem(p) = 1._r8 - arepr(p) - aleaf(p) - aroot(p) - end if - - ! AgroIBIS included here an immediate adjustment to aleaf & astem if the - ! predicted lai from the above allocation coefficients exceeded laimx. - ! We have decided to live with lais slightly higher than laimx by - ! enforcing the cap in the following tstep through the peaklai logic above. - - astemi(p) = astem(p) ! save for use by equations after shift - aleafi(p) = aleaf(p) ! to reproductive phenology stage begins - grain_flag(p) = 0._r8 ! setting to 0 while in phase 2 - - ! Phase 2 completed: - ! ================== - ! shift allocation either when enough gdd are accumulated or maximum number - ! of days has elapsed since planting - - else if (hui(p) >= huigrain(p)) then - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * min(1._r8, hui(p)/gddmaturity(p)))) - if (astemi(p) > astemf(ivt(p))) then - astem(p) = max(0._r8, max(astemf(ivt(p)), astem(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconss(ivt(p)) ))) - end if - - ! If crops have hit peaklai, then set leaf allocation to small value - if (peaklai(p) == 1) then - aleaf(p) = 1.e-5_r8 - else if (aleafi(p) > aleaff(ivt(p))) then - aleaf(p) = max(1.e-5_r8, max(aleaff(ivt(p)), aleaf(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconsl(ivt(p)) ))) - end if - - !Beth's retranslocation of leafn, stemn, rootn to organ - !Filter excess plant N to retransn pool for organ N - !Only do one time then hold grain_flag till onset next season - - ! slevis: Will astem ever = astemf exactly? - ! Beth's response: ...looks like astem can equal astemf under the right circumstances. - !It might be worth a rewrite to capture what I was trying to do, but the retranslocation for - !corn and wheat begins at the beginning of the grain fill stage, but for soybean I was holding it - !until after the leaf and stem decline were complete. Looking at how astem is calculated, once the - !stem decline is near complete, astem should (usually) be set to astemf. The reason for holding off - !on soybean is that the retranslocation scheme begins at the beginning of the grain phase, when the - !leaf and stem are still growing, but declining. Since carbon is still getting allocated and now - !there is more nitrogen available, the nitrogen can be diverted from grain. For corn and wheat - !the impact was probably enough to boost productivity, but for soybean the nitrogen was better off - !fulfilling the grain fill. It seems that if the peak lai is reached for soybean though that this - !would be bypassed altogether, not the intended outcome. I checked several of my output files and - !they all seemed to be going through the retranslocation loop for soybean - good news. - - if (astem(p) == astemf(ivt(p)) .or. & - (ivt(p) /= ntmp_soybean .and. ivt(p) /= nirrig_tmp_soybean .and.& - ivt(p) /= ntrp_soybean .and. ivt(p) /= nirrig_trp_soybean)) then - if (grain_flag(p) == 0._r8) then - t1 = 1 / dt - leafn_to_retransn(p) = t1 * max(leafn(p)- (leafc(p) / fleafcn(ivt(p))),0._r8) - livestemn_to_retransn(p) = t1 * max(livestemn(p) - (livestemc(p) / fstemcn(ivt(p))),0._r8) - frootn_to_retransn(p) = 0._r8 - if (ffrootcn(ivt(p)) > 0._r8) then - frootn_to_retransn(p) = t1 * max(frootn(p) - (frootc(p) / ffrootcn(ivt(p))),0._r8) - end if - grain_flag(p) = 1._r8 - end if - end if - - arepr(p) = 1._r8 - aroot(p) - astem(p) - aleaf(p) - - else ! pre emergence - aleaf(p) = 1.e-5_r8 ! allocation coefficients should be irrelevant - astem(p) = 0._r8 ! because crops have no live carbon pools; - aroot(p) = 0._r8 ! this applies to this "else" and to the "else" - arepr(p) = 0._r8 ! a few lines down - end if - - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - - - else ! .not croplive - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - ! based on available C, use constant allometric relationships to - ! determine N requirements - if(use_fun)then ! In FUN, growth respiration is not part of the allometry calculation. - if (woody(ivt(p)) == 1.0_r8) then - c_allometry(p) = (1._r8)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else if (ivt(p) >= npcropmin) then ! skip generic crops - cng = graincn(ivt(p)) - c_allometry(p) = (1._r8)*(1._r8+f1+f5+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + f5/cng + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else - c_allometry(p) = 1._r8+f1 - n_allometry(p) = 1._r8/cnl + f1/cnfr - end if - else !no FUN. - if (woody(ivt(p)) == 1.0_r8) then - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else if (ivt(p) >= npcropmin) then ! skip generic crops - cng = graincn(ivt(p)) - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f5+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + f5/cng + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else - c_allometry(p) = 1._r8+g1+f1+f1*g1 - n_allometry(p) = 1._r8/cnl + f1/cnfr - end if - end if !FUN - - ! when we have "if (leafn(p) == 0.0_r8)" below then we - ! have floating overflow (out of floating point range) - ! error in "actual_leafcn(p) = leafc(p) / leafn(p)" - if (leafn(p) < n_min ) then - ! to avoid division by zero, and to set leafcn to missing value for history files - this%actual_leafcn(p) = spval - else - ! leaf CN ratio - this%actual_leafcn(p) = leafc(p) / leafn(p) - end if - - - if (nscalar_opt) then - - leafcn_min = leafcn(ivt(p)) - 10.0_r8 - leafcn_max = leafcn(ivt(p)) + 10.0_r8 - - this%actual_leafcn(p) = max( this%actual_leafcn(p), leafcn_min-0.0001_r8 ) - this%actual_leafcn(p) = min( this%actual_leafcn(p), leafcn_max ) - - nscalar = (this%actual_leafcn(p) - leafcn_min ) / (leafcn_max - leafcn_min) ! Nitrogen scaler factor - nscalar = min( max(0.0_r8, nscalar), 1.0_r8 ) - else ! if (nscalar_opt == .false.) then - nscalar = 1.0_r8 - end if - - - if (substrate_term_opt) then - c = patch%column(p) - sminn_total = 0.0_r8 - do j = 1, nlevdecomp - sminn_total = sminn_total + sminn_vr(c,j) * dzsoi_decomp(j) - end do - Kmin = 1.0_r8 - substrate_term = sminn_total / (sminn_total + Kmin) - else ! if (substrate_term_opt == .false) then - substrate_term = 1.0_r8 - end if - - if (.not. temp_scalar_opt) then - temp_scalar = 1.0_r8 - else !(temp_scalar_opt == .true.) then - c = patch%column(p) - temp_scalar=t_scalar(c,1) - temp_scalar = min( max(0.0_r8, temp_scalar), 1.0_r8 ) - end if - - if(use_fun)then ! in FUN, plant_ndemand is just used as a maximum draw on soil N pools. - plant_ndemand(p) = availc(p)*(n_allometry(p)/c_allometry(p)) - else !FUN - if (plant_ndemand_opt == 0) then - plant_ndemand(p) = availc(p)*(n_allometry(p)/c_allometry(p)) - else if (plant_ndemand_opt == 1) then - plant_ndemand(p) = availc(p)*(n_allometry(p)/c_allometry(p)) * substrate_term - else if (plant_ndemand_opt == 2) then ! N uptake happens at day time only - - if (gpp(p) > 0.0_r8) then - Vmax_N = 2.7E-8_r8 - plant_ndemand(p) = Vmax_N * frootc(p) * substrate_term * temp_scalar * nscalar - else - plant_ndemand(p) = 0.0_r8 - end if - else if (plant_ndemand_opt == 3) then ! N uptake happens at day and night time - - if (laisun(p)+laisha(p) > 0.0_r8) then - Vmax_N = 2.7E-8_r8 - plant_ndemand(p) = Vmax_N * frootc(p) * substrate_term * temp_scalar * nscalar - else - plant_ndemand(p) = 0.0_r8 - end if - - if (this%actual_leafcn(p) < leafcn_min )then - plant_ndemand(p) = 0.0_r8 - end if - - end if - end if !FUN - - !if (leafn(p) < n_min ) then - !! to set leafcn to missing value for history files - !this%actual_leafcn(p) = spval - !end if - - ! retranslocated N deployment depends on seasonal cycle of potential GPP - ! (requires one year run to accumulate demand) - - tempsum_potential_gpp(p) = tempsum_potential_gpp(p) + gpp(p) - - ! Adding the following line to carry max retransn info to CN Annual Update - tempmax_retransn(p) = max(tempmax_retransn(p),retransn(p)) - - ! Beth's code: crops pull from retransn pool only during grain fill; - ! retransn pool has N from leaves, stems, and roots for - ! retranslocation - - if (ivt(p) >= npcropmin .and. grain_flag(p) == 1._r8) then - avail_retransn(p) = plant_ndemand(p) - else if (ivt(p) < npcropmin .and. annsum_potential_gpp(p) > 0._r8) then - avail_retransn(p) = (annmax_retransn(p)/2._r8)*(gpp(p)/annsum_potential_gpp(p))/dt - else - avail_retransn(p) = 0.0_r8 - end if - - ! make sure available retrans N doesn't exceed storage - avail_retransn(p) = min(avail_retransn(p), retransn(p)/dt) - - ! modify plant N demand according to the availability of - ! retranslocated N - ! take from retransn pool at most the flux required to meet - ! plant ndemand - - if (plant_ndemand(p) > avail_retransn(p)) then - retransn_to_npool(p) = avail_retransn(p) - else - retransn_to_npool(p) = plant_ndemand(p) - end if - - if ( .not. use_fun ) then - plant_ndemand(p) = plant_ndemand(p) - retransn_to_npool(p) - end if - - end do ! end patch loop - - end associate - - end subroutine calc_plant_nitrogen_demand - -end module NutrientCompetitionFlexibleCNMod diff --git a/src/biogeochem/NutrientCompetitionMethodMod.F90 b/src/biogeochem/NutrientCompetitionMethodMod.F90 deleted file mode 100644 index 56ebcc4f67..0000000000 --- a/src/biogeochem/NutrientCompetitionMethodMod.F90 +++ /dev/null @@ -1,202 +0,0 @@ -module NutrientCompetitionMethodMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Abstract base class for functions to calculate nutrient competition - ! - ! Created by Jinyun Tang, following Bill Sack's implementation of polymorphism - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - implicit none - private - ! - ! !PUBLIC TYPES: - public :: nutrient_competition_method_type - - type, abstract :: nutrient_competition_method_type - private - contains - - ! initialization - procedure(init_interface), public, deferred :: init - - ! Read in parameters - procedure, public :: readParams - - ! compute plant nutrient demand - procedure(calc_plant_nutrient_demand_interface), public, deferred :: calc_plant_nutrient_demand - - ! compute the nutrient yield for different components - procedure(calc_plant_nutrient_competition_interface), public, deferred :: calc_plant_nutrient_competition - - end type nutrient_competition_method_type - - type, public :: params_type - real(r8) :: dayscrecover ! number of days to recover negative cpool - end type params_type - ! - type(params_type), public, protected :: params_inst ! params_inst is populated in readParamsMod - - abstract interface - - ! Note: The following code is adapted based on what Bill Scaks has done for soil water retention curve - ! polymorphism. Therefore, I also keep some suggestions he gave there. - ! - ! - Make the interfaces contain all possible inputs that are needed by any - ! implementation; each implementation will then ignore the inputs it doesn't need. - ! - ! - For inputs that are needed only by particular implementations - and particularly - ! for inputs that are constant in time - ! pass these into the constructor, and save pointers to these inputs as components - ! of the child type that needs them. Then they aren't needed as inputs to the - ! individual routines, allowing the interfaces for these routines to remain more - ! consistent between different implementations. - ! - !--------------------------------------------------------------------------- - subroutine init_interface(this, bounds) - ! !DESCRIPTION: - ! read in kinetic parameters that are needed for doing nutrient competition - ! - ! !USES: - use decompMod , only : bounds_type - import :: nutrient_competition_method_type - ! - ! !ARGUMENTS: - class(nutrient_competition_method_type) :: this - type(bounds_type) , intent(in) :: bounds - - end subroutine init_interface - - !--------------------------------------------------------------------------- - subroutine calc_plant_nutrient_demand_interface (this, bounds, num_soilp, filter_soilp, & - photosyns_inst, crop_inst, canopystate_inst, & - cnveg_state_inst, cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, & - energyflux_inst, & - aroot, arepr) - ! - ! DESCRIPTION - ! calculate nutrient yield after considering competition between different components - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use PhotosynthesisMod , only : photosyns_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemCarbonFluxType, only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use EnergyFluxType , only : energyflux_type - import :: nutrient_competition_method_type - ! - ! !ARGUMENTS: - class(nutrient_competition_method_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(photosyns_type) , intent(in) :: photosyns_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type), intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - real(r8) , intent(out) :: aroot(bounds%begp:) - real(r8) , intent(out) :: arepr(bounds%begp:) - - end subroutine calc_plant_nutrient_demand_interface - - !----------------------------------------------------------------------- - subroutine calc_plant_nutrient_competition_interface (this, & - bounds, num_soilp, filter_soilp, & - cnveg_state_inst, crop_inst, canopystate_inst, & - cnveg_carbonstate_inst, cnveg_carbonflux_inst, & - c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, & - soilbiogeochem_nitrogenstate_inst, & - aroot, arepr, fpg_col) - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use CNVegStateType , only : cnveg_state_type - use CropType , only : crop_type - use CanopyStateType , only : canopystate_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType, only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - import :: nutrient_competition_method_type - ! - ! !ARGUMENTS: - class(nutrient_competition_method_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(crop_type) , intent(in) :: crop_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type), intent(in) :: soilbiogeochem_nitrogenstate_inst - real(r8) , intent(in) :: aroot(bounds%begp:) - real(r8) , intent(in) :: arepr(bounds%begp:) - real(r8) , intent(in) :: fpg_col(bounds%begc:) - - end subroutine calc_plant_nutrient_competition_interface - - end interface - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine readParams (this, ncid ) - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use ncdio_pio , only : file_desc_t,ncd_io - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(nutrient_competition_method_type), intent(in) :: this - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNAllocParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - ! read in parameters - - tString='dayscrecover' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%dayscrecover=tempr - - end subroutine readParams - -end module NutrientCompetitionMethodMod diff --git a/src/biogeochem/SatellitePhenologyMod.F90 b/src/biogeochem/SatellitePhenologyMod.F90 deleted file mode 100644 index 78b2cf0e24..0000000000 --- a/src/biogeochem/SatellitePhenologyMod.F90 +++ /dev/null @@ -1,684 +0,0 @@ -module SatellitePhenologyMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! CLM Satelitte Phenology model (SP) ecosystem dynamics (phenology, vegetation). - ! Allow some subroutines to be used by the CLM Carbon Nitrogen model (CLMCN) - ! so that DryDeposition code can get estimates of LAI differences between months. - ! - ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_kind_mod , only : CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : scmlat,scmlon,single_column - use clm_varctl , only : iulog, use_lai_streams - use clm_varcon , only : grlnd - use controlMod , only : NLFilename - use decompMod , only : gsmap_lnd_gdc2glo - use domainMod , only : ldomain - use fileutils , only : getavu, relavu - use PatchType , only : patch - use CanopyStateType , only : canopystate_type - use WaterstateType , only : waterstate_type - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc - use spmdMod , only : mpicom, comp_id - use mct_mod - use ncdio_pio - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SatellitePhenology ! CLMSP Ecosystem dynamics: phenology, vegetation - public :: SatellitePhenologyInit ! Dynamically allocate memory - public :: interpMonthlyVeg ! interpolate monthly vegetation data - public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition) - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: readMonthlyVegetation ! read monthly vegetation data for two months - private :: lai_init ! position datasets for LAI - private :: lai_interp ! interpolates between two years of LAI data - - ! !PRIVATE MEMBER DATA: - type(shr_strdata_type) :: sdat_lai ! LAI input data stream - ! - ! !PRIVATE TYPES: - integer , private :: InterpMonths1 ! saved month index - real(r8), private :: timwt(2) ! time weights for month 1 and month 2 - real(r8), private, allocatable :: mlai2t(:,:) ! lai for interpolation (2 months) - real(r8), private, allocatable :: msai2t(:,:) ! sai for interpolation (2 months) - real(r8), private, allocatable :: mhvt2t(:,:) ! top vegetation height for interpolation (2 months) - real(r8), private, allocatable :: mhvb2t(:,:) ! bottom vegetation height for interpolation(2 months) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - ! - ! lai_init - ! - !----------------------------------------------------------------------- - subroutine lai_init(bounds) - ! - ! Initialize data stream information for LAI. - ! - ! - ! !USES: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - use shr_stream_mod , only : shr_stream_file_null - use shr_string_mod , only : shr_string_listCreateField - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: i ! index - integer :: stream_year_first_lai ! first year in Lai stream to use - integer :: stream_year_last_lai ! last year in Lai stream to use - integer :: model_year_align_lai ! align stream_year_first_lai with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read - character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm - - character(*), parameter :: subName = "('laidyn_init')" - character(*), parameter :: F00 = "('(laidyn_init) ',4a)" - character(*), parameter :: laiString = "LAI" ! base string for field string - integer , parameter :: numLaiFields = 16 ! number of fields to build field string - character(SHR_KIND_CXX) :: fldList ! field string - !----------------------------------------------------------------------- - ! - ! deal with namelist variables here in init - ! - namelist /lai_streams/ & - stream_year_first_lai, & - stream_year_last_lai, & - model_year_align_lai, & - lai_mapalgo, & - stream_fldFileName_lai - - ! Default values for namelist - stream_year_first_lai = 1 ! first year in stream to use - stream_year_last_lai = 1 ! last year in stream to use - model_year_align_lai = 1 ! align stream_year_first_lai with this model year - stream_fldFileName_lai = shr_stream_file_null - - ! Read lai_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=lai_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading lai_streams namelist') - end if - else - call endrun(subname // ':: ERROR finding lai_streams namelist') - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_lai, mpicom) - call shr_mpi_bcast(stream_year_last_lai, mpicom) - call shr_mpi_bcast(model_year_align_lai, mpicom) - call shr_mpi_bcast(stream_fldFileName_lai, mpicom) - - if (masterproc) then - - write(iulog,*) ' ' - write(iulog,*) 'lai_stream settings:' - write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai - write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai - write(iulog,*) ' model_year_align_lai = ',model_year_align_lai - write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) - - endif - - call clm_domain_mct (bounds, dom_clm) - - ! - ! create the field list for these lai fields...use in shr_strdata_create - ! - fldList = shr_string_listCreateField( numLaiFields, laiString ) - - call shr_strdata_create(sdat_lai,name="laidyn", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lai, & - yearLast=stream_year_last_lai, & - yearAlign=model_year_align_lai, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lai), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/stream_fldFileName_lai/), & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=lai_mapalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(sdat_lai,'LAI data') - endif - - end subroutine lai_init - - !----------------------------------------------------------------------- - ! - ! lai_interp - ! - !----------------------------------------------------------------------- - subroutine lai_interp(bounds, canopystate_inst) - ! - ! Interpolate data stream information for Lai. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use pftconMod , only : noveg - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: ivt, p, g, ip, ig, gpft - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - character(len=CL) :: stream_var_name - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') - - do p = bounds%begp, bounds%endp - ivt = patch%itype(p) - if (ivt /= noveg) then ! vegetated pft - write(stream_var_name,"(i6)") ivt - stream_var_name = 'LAI_'//trim(adjustl(stream_var_name)) - ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name)) - endif - gpft = patch%gridcell(p) - - ! - ! Determine vector index corresponding to gpft - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == gpft) exit - end do - - ! - ! Set lai for each gridcell/patch combination - ! - if (ivt /= noveg) then ! vegetated pft - canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig) - else ! non-vegetated pft - canopystate_inst%tlai_patch(p) = 0._r8 - endif - end do - - end subroutine lai_interp - - !----------------------------------------------------------------------- - subroutine SatellitePhenologyInit (bounds) - ! - ! !DESCRIPTION: - ! Dynamically allocate memory and set to signaling NaN. - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: ier ! error code - !----------------------------------------------------------------------- - - InterpMonths1 = -999 ! saved month index - - ier = 0 - if(.not.allocated(mlai2t)) then - allocate (mlai2t(bounds%begp:bounds%endp,2), & - msai2t(bounds%begp:bounds%endp,2), & - mhvt2t(bounds%begp:bounds%endp,2), & - mhvb2t(bounds%begp:bounds%endp,2), stat=ier) - end if - if (ier /= 0) then - write(iulog,*) 'EcosystemDynini allocation error' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - mlai2t(bounds%begp : bounds%endp, :) = nan - msai2t(bounds%begp : bounds%endp, :) = nan - mhvt2t(bounds%begp : bounds%endp, :) = nan - mhvb2t(bounds%begp : bounds%endp, :) = nan - - if (use_lai_streams) then - call lai_init(bounds) - endif - - end subroutine SatellitePhenologyInit - - !----------------------------------------------------------------------- - subroutine SatellitePhenology(bounds, num_nolakep, filter_nolakep, & - waterstate_inst, canopystate_inst) - ! - ! !DESCRIPTION: - ! Ecosystem dynamics: phenology, vegetation - ! Calculates leaf areas (tlai, elai), stem areas (tsai, esai) and height (htop). - ! - ! !USES: - use pftconMod, only : noveg, nbrdlf_dcd_brl_shrub - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - integer , intent(in) :: filter_nolakep(bounds%endp-bounds%begp+1) ! patch filter for non-lake points - type(waterstate_type) , intent(in) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,p,c ! indices - real(r8) :: ol ! thickness of canopy layer covered by snow (m) - real(r8) :: fb ! fraction of canopy layer covered by snow - !----------------------------------------------------------------------- - - associate( & - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - tlai => canopystate_inst%tlai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index, no burying by snow - elai => canopystate_inst%elai_patch , & ! Output: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Output: [real(r8) (:) ] one-sided stem area index with burying by snow - htop => canopystate_inst%htop_patch , & ! Output: [real(r8) (:) ] canopy top (m) - hbot => canopystate_inst%hbot_patch , & ! Output: [real(r8) (:) ] canopy bottom (m) - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - ) - - if (use_lai_streams) then - call lai_interp(bounds, canopystate_inst) - endif - - do fp = 1, num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - - ! need to update elai and esai only every albedo time step so do not - ! have any inconsistency in lai and sai between SurfaceAlbedo calls (i.e., - ! if albedos are not done every time step). - ! leaf phenology - ! Set leaf and stem areas based on day of year - ! Interpolate leaf area index, stem area index, and vegetation heights - ! between two monthly - ! The weights below (timwt(1) and timwt(2)) were obtained by a call to - ! routine InterpMonthlyVeg in subroutine NCARlsm. - ! Field Monthly Values - ! ------------------------- - ! leaf area index LAI <- mlai1 and mlai2 - ! leaf area index SAI <- msai1 and msai2 - ! top height HTOP <- mhvt1 and mhvt2 - ! bottom height HBOT <- mhvb1 and mhvb2 - - if (.not. use_lai_streams) then - tlai(p) = timwt(1)*mlai2t(p,1) + timwt(2)*mlai2t(p,2) - endif - - tsai(p) = timwt(1)*msai2t(p,1) + timwt(2)*msai2t(p,2) - htop(p) = timwt(1)*mhvt2t(p,1) + timwt(2)*mhvt2t(p,2) - hbot(p) = timwt(1)*mhvb2t(p,1) + timwt(2)*mhvb2t(p,2) - - ! adjust lai and sai for burying by snow. if exposed lai and sai - ! are less than 0.05, set equal to zero to prevent numerical - ! problems associated with very small lai and sai. - - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. - - if (patch%itype(p) > noveg .and. patch%itype(p) <= nbrdlf_dcd_brl_shrub ) then - ol = min( max(snow_depth(c)-hbot(p), 0._r8), htop(p)-hbot(p)) - fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) - else - fb = 1._r8 - max(min(snow_depth(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed - !depth of snow required for complete burial of grasses - endif - - ! area weight by snow covered fraction - - elai(p) = max(tlai(p)*(1.0_r8 - frac_sno(c)) + tlai(p)*fb*frac_sno(c), 0.0_r8) - esai(p) = max(tsai(p)*(1.0_r8 - frac_sno(c)) + tsai(p)*fb*frac_sno(c), 0.0_r8) - if (elai(p) < 0.05_r8) elai(p) = 0._r8 - if (esai(p) < 0.05_r8) esai(p) = 0._r8 - - ! Fraction of vegetation free of snow - - if ((elai(p) + esai(p)) >= 0.05_r8) then - frac_veg_nosno_alb(p) = 1 - else - frac_veg_nosno_alb(p) = 0 - end if - - end do ! end of patch loop - - end associate - - end subroutine SatellitePhenology - - !----------------------------------------------------------------------- - subroutine interpMonthlyVeg (bounds, canopystate_inst) - ! - ! !DESCRIPTION: - ! Determine if 2 new months of data are to be read. - ! - ! !USES: - use clm_varctl , only : fsurdat - use clm_time_manager, only : get_curr_date, get_step_size, get_nstep - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(canopystate_type), intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: kyr ! year (0, ...) for nstep+1 - integer :: kmo ! month (1, ..., 12) - integer :: kda ! day of month (1, ..., 31) - integer :: ksec ! seconds into current date for nstep+1 - real(r8):: dtime ! land model time step (sec) - real(r8):: t ! a fraction: kda/ndaypm - integer :: it(2) ! month 1 and month 2 (step 1) - integer :: months(2) ! months to be interpolated (1 to 12) - integer, dimension(12) :: ndaypm= & - (/31,28,31,30,31,30,31,31,30,31,30,31/) !days per month - !----------------------------------------------------------------------- - - dtime = get_step_size() - - call get_curr_date(kyr, kmo, kda, ksec, offset=int(dtime)) - - t = (kda-0.5_r8) / ndaypm(kmo) - it(1) = t + 0.5_r8 - it(2) = it(1) + 1 - months(1) = kmo + it(1) - 1 - months(2) = kmo + it(2) - 1 - if (months(1) < 1) months(1) = 12 - if (months(2) > 12) months(2) = 1 - timwt(1) = (it(1)+0.5_r8) - t - timwt(2) = 1._r8-timwt(1) - - if (InterpMonths1 /= months(1)) then - if (masterproc) then - write(iulog,*) 'Attempting to read monthly vegetation data .....' - write(iulog,*) 'nstep = ',get_nstep(),' month = ',kmo,' day = ',kda - end if - call t_startf('readMonthlyVeg') - call readMonthlyVegetation (bounds, fsurdat, months, canopystate_inst) - InterpMonths1 = months(1) - call t_stopf('readMonthlyVeg') - end if - - end subroutine interpMonthlyVeg - - !----------------------------------------------------------------------- - subroutine readAnnualVegetation (bounds, canopystate_inst) - ! - ! !DESCRIPTION: - ! read 12 months of veg data for dry deposition - ! - ! !USES: - use clm_varpar , only : numpft - use pftconMod , only : noveg - use domainMod , only : ldomain - use fileutils , only : getfil - use clm_varctl , only : fsurdat - use shr_scam_mod, only : shr_scam_getCloseLatLon - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(canopystate_type), intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - type(file_desc_t) :: ncid ! netcdf id - real(r8), pointer :: annlai(:,:) ! 12 months of monthly lai from input data set - real(r8), pointer :: mlai(:,:) ! lai read from input files - real(r8):: closelat,closelon ! single column vars - integer :: ier ! error code - integer :: g,k,l,m,n,p ! indices - integer :: ni,nj,ns ! indices - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: nlon_i ! number of input data longitudes - integer :: nlat_i ! number of input data latitudes - integer :: npft_i ! number of input data patch types - integer :: closelatidx,closelonidx ! single column vars - logical :: isgrid2d ! true => file is 2d - character(len=256) :: locfn ! local file name - character(len=32) :: subname = 'readAnnualVegetation' - !----------------------------------------------------------------------- - - annlai => canopystate_inst%annlai_patch - - ! Determine necessary indices - - allocate(mlai(bounds%begg:bounds%endg,0:numpft), stat=ier) - if (ier /= 0) then - write(iulog,*)subname, 'allocation error ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (masterproc) then - write (iulog,*) 'Attempting to read annual vegetation data .....' - end if - - call getfil(fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - call check_dim(ncid, 'lsmpft', numpft+1) - - if (single_column) then - call shr_scam_getCloseLatLon(locfn, scmlat, scmlon, & - closelat, closelon, closelatidx, closelonidx) - endif - - do k=1,12 !! loop over months and read vegetated data - - call ncd_io(ncid=ncid, varname='MONTHLY_LAI', flag='read', data=mlai, & - dim1name=grlnd, nt=k) - - !! only vegetated patches have nonzero values - !! Assign lai/sai/hgtt/hgtb to the top [maxpatch_pft] patches - !! as determined in subroutine surfrd - - do p = bounds%begp,bounds%endp - g =patch%gridcell(p) - if (patch%itype(p) /= noveg) then !! vegetated pft - do l = 0, numpft - if (l == patch%itype(p)) then - annlai(k,p) = mlai(g,l) - end if - end do - else !! non-vegetated pft - annlai(k,p) = 0._r8 - end if - end do ! end of loop over patches - - enddo ! months loop - - call ncd_pio_closefile(ncid) - - deallocate(mlai) - - endsubroutine readAnnualVegetation - - !----------------------------------------------------------------------- - subroutine readMonthlyVegetation (bounds, & - fveg, months, canopystate_inst) - ! - ! !DESCRIPTION: - ! Read monthly vegetation data for two consec. months. - ! - ! !USES: - use clm_varpar , only : numpft - use pftconMod , only : noveg - use fileutils , only : getfil - use spmdMod , only : masterproc, mpicom, MPI_REAL8, MPI_INTEGER - use shr_scam_mod , only : shr_scam_getCloseLatLon - use clm_time_manager , only : get_nstep - use netcdf - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: fveg ! file with monthly vegetation data - integer , intent(in) :: months(2) ! months to be interpolated (1 to 12) - type(canopystate_type), intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: g,n,k,l,m,p,ni,nj,ns ! indices - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: nlon_i ! number of input data longitudes - integer :: nlat_i ! number of input data latitudes - integer :: npft_i ! number of input data patch types - integer :: ier ! error code - integer :: closelatidx,closelonidx - real(r8):: closelat,closelon - logical :: readvar - real(r8), pointer :: mlai(:,:) ! lai read from input files - real(r8), pointer :: msai(:,:) ! sai read from input files - real(r8), pointer :: mhgtt(:,:) ! top vegetation height - real(r8), pointer :: mhgtb(:,:) ! bottom vegetation height - character(len=32) :: subname = 'readMonthlyVegetation' - !----------------------------------------------------------------------- - - ! Determine necessary indices - - allocate(& - mlai(bounds%begg:bounds%endg,0:numpft), & - msai(bounds%begg:bounds%endg,0:numpft), & - mhgtt(bounds%begg:bounds%endg,0:numpft), & - mhgtb(bounds%begg:bounds%endg,0:numpft), & - stat=ier) - if (ier /= 0) then - write(iulog,*)subname, 'allocation big error ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! ---------------------------------------------------------------------- - ! Open monthly vegetation file - ! Read data and convert from gridcell to patch data - ! ---------------------------------------------------------------------- - - call getfil(fveg, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - if (single_column) then - call shr_scam_getCloseLatLon (ncid, scmlat, scmlon, closelat, closelon,& - closelatidx, closelonidx) - endif - - do k=1,2 !loop over months and read vegetated data - - call ncd_io(ncid=ncid, varname='MONTHLY_LAI', flag='read', data=mlai, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun(msg=' ERROR: MONTHLY_LAI NOT on fveg file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='MONTHLY_SAI', flag='read', data=msai, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun(msg=' ERROR: MONTHLY_SAI NOT on fveg file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='MONTHLY_HEIGHT_TOP', flag='read', data=mhgtt, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun(msg=' ERROR: MONTHLY_HEIGHT_TOP NOT on fveg file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='MONTHLY_HEIGHT_BOT', flag='read', data=mhgtb, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun(msg=' ERROR: MONTHLY_HEIGHT_TOP NOT on fveg file'//errMsg(sourcefile, __LINE__)) - - ! Only vegetated patches have nonzero values - ! Assign lai/sai/hgtt/hgtb to the top [maxpatch_pft] patches - ! as determined in subroutine surfrd - - do p = bounds%begp,bounds%endp - g =patch%gridcell(p) - if (patch%itype(p) /= noveg) then ! vegetated pft - do l = 0, numpft - if (l == patch%itype(p)) then - mlai2t(p,k) = mlai(g,l) - msai2t(p,k) = msai(g,l) - mhvt2t(p,k) = mhgtt(g,l) - mhvb2t(p,k) = mhgtb(g,l) - end if - end do - else ! non-vegetated pft - mlai2t(p,k) = 0._r8 - msai2t(p,k) = 0._r8 - mhvt2t(p,k) = 0._r8 - mhvb2t(p,k) = 0._r8 - end if - end do ! end of loop over patches - - end do ! end of loop over months - - call ncd_pio_closefile(ncid) - - if (masterproc) then - k = 2 - write(iulog,*) 'Successfully read monthly vegetation data for' - write(iulog,*) 'month ', months(k) - write(iulog,*) - end if - - deallocate(mlai, msai, mhgtt, mhgtb) - - do p = bounds%begp,bounds%endp - canopystate_inst%mlaidiff_patch(p) = mlai2t(p,1)-mlai2t(p,2) - enddo - - end subroutine readMonthlyVegetation - -end module SatellitePhenologyMod diff --git a/src/biogeochem/SpeciesBaseType.F90 b/src/biogeochem/SpeciesBaseType.F90 deleted file mode 100644 index 239ca91fe3..0000000000 --- a/src/biogeochem/SpeciesBaseType.F90 +++ /dev/null @@ -1,67 +0,0 @@ -module SpeciesBaseType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Defines a base class for working with chemical species, such as building history and - ! restart field names. - ! - ! !USES: - ! - implicit none - private - - ! !PUBLIC TYPES: - - type, abstract, public :: species_base_type - contains - ! Get a history field name for this species - procedure(hist_fname_interface), public, deferred :: hist_fname - - ! Get a restart field name for this species - procedure(rest_fname_interface), public, deferred :: rest_fname - - ! Get the full species name - procedure(get_species_interface), public, deferred :: get_species - end type species_base_type - - abstract interface - pure function hist_fname_interface(this, basename, suffix) result(fname) - ! Get a history field name for this species - ! - ! basename gives the base name of the history field - ! - ! suffix, if provided, gives a suffix that appears after all species information - ! in the field name - import :: species_base_type - - character(len=:) , allocatable :: fname ! function result - class(species_base_type) , intent(in) :: this - character(len=*) , intent(in) :: basename - character(len=*) , optional, intent(in) :: suffix - end function hist_fname_interface - - function rest_fname_interface(this, basename, suffix) result(fname) - ! Get a restart field name for this species - ! - ! basename gives the base name of the restart field - ! - ! suffix, if provided, gives a suffix that appears after all species information - ! in the field name - import :: species_base_type - - character(len=:) , allocatable :: fname ! function result - class(species_base_type) , intent(in) :: this - character(len=*) , intent(in) :: basename - character(len=*) , optional, intent(in) :: suffix - end function rest_fname_interface - - pure function get_species_interface(this) result(species_name) - ! Get the full species name - import :: species_base_type - - character(len=:), allocatable :: species_name - class(species_base_type) , intent(in) :: this - end function get_species_interface - end interface - -end module SpeciesBaseType diff --git a/src/biogeochem/SpeciesIsotopeType.F90 b/src/biogeochem/SpeciesIsotopeType.F90 deleted file mode 100644 index b5fb749823..0000000000 --- a/src/biogeochem/SpeciesIsotopeType.F90 +++ /dev/null @@ -1,136 +0,0 @@ -module SpeciesIsotopeType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Defines a class for working with chemical species, such as building history and - ! restart field names. - ! - ! This version is used for isotopic species - ! - ! !USES: - ! - use SpeciesBaseType, only : species_base_type - use abortutils, only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - use clm_varctl, only : iulog - - implicit none - save - private - - ! COMPILER_BUG(wjs, 2016-03-16, pgi 15.10) Ideally, we would use allocatable characters - ! for species_name and isotope_name. However, this causes problems for pgi: it seems - ! that these allocatable characters randomly get changed. So, for now, using - ! fixed-length character variables. (It's possible that this was programmer error on my - ! part, although using allocatable character variables worked with other compilers.) - ! - ! If species_name and isotope_name were changed back to allocatable-length characters, - ! then we could remove the error checking in the constructor as well as various 'trim' - ! statements scattered throughout the code (because this%species_name and - ! this%isotope_name would already be trimmed). - integer, parameter :: species_name_maxlen = 8 - integer, parameter :: isotope_name_maxlen = 8 - - type, extends(species_base_type), public :: species_isotope_type - private - character(len=species_name_maxlen) :: species_name ! does not contain the isotope number - character(len=isotope_name_maxlen) :: isotope_name ! e.g., just the 13 for C13 - contains - procedure, public :: hist_fname - procedure, public :: rest_fname - procedure, public :: get_species - end type species_isotope_type - - interface species_isotope_type - module procedure constructor - end interface species_isotope_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - function constructor(species_name, isotope_name) result(this) - ! Create a species_isotope_type object - - type(species_isotope_type) :: this ! function result - character(len=*), intent(in) :: species_name ! e.g., 'C' or 'N' - without the isotope number - character(len=*), intent(in) :: isotope_name ! e.g., '13' for C13 - !----------------------------------------------------------------------- - - if (len_trim(species_name) > species_name_maxlen) then - write(iulog,*) 'species_isotope_type constructor: species_name too long' - write(iulog,*) trim(species_name) // ' exceeds max length: ', species_name_maxlen - call endrun(msg='species_isotope_type constructor: species_name too long: '// & - errMsg(sourcefile, __LINE__)) - end if - if (len_trim(isotope_name) > isotope_name_maxlen) then - write(iulog,*) 'species_isotope_type constructor: isotope_name too long' - write(iulog,*) trim(isotope_name) // ' exceeds max length: ', isotope_name_maxlen - call endrun(msg='species_isotope_type constructor: isotope_name too long: '// & - errMsg(sourcefile, __LINE__)) - end if - - this%species_name = trim(species_name) - this%isotope_name = trim(isotope_name) - end function constructor - - pure function hist_fname(this, basename, suffix) result(fname) - ! Get a history field name for this species - ! - ! basename gives the base name of the history field - ! - ! suffix, if provided, gives a suffix that appears after all species information - ! in the field name - - character(len=:), allocatable :: fname ! function result - class(species_isotope_type) , intent(in) :: this - character(len=*), intent(in) :: basename - character(len=*), optional, intent(in) :: suffix - !----------------------------------------------------------------------- - - fname = trim(this%species_name) // trim(this%isotope_name) // '_' // & - trim(basename) // trim(this%species_name) - if (present(suffix)) then - fname = trim(fname) // trim(suffix) - end if - - end function hist_fname - - function rest_fname(this, basename, suffix) result(fname) - ! Get a restart field name for this species - ! - ! basename gives the base name of the restart field - ! - ! suffix, if provided, gives a suffix that appears after all species information in - ! the field name - use shr_string_mod, only : shr_string_toLower - - character(len=:), allocatable :: fname ! function result - class(species_isotope_type) , intent(in) :: this - character(len=*), intent(in) :: basename - character(len=*), optional, intent(in) :: suffix - - character(len=:), allocatable :: species_name_lcase - !----------------------------------------------------------------------- - - species_name_lcase = shr_string_toLower(trim(this%species_name)) - fname = trim(basename) // species_name_lcase // '_' // trim(this%isotope_name) - if (present(suffix)) then - fname = trim(fname) // trim(suffix) - end if - - end function rest_fname - - pure function get_species(this) result(species_name) - ! Get the full species name (e.g., 'C13') - - character(len=:), allocatable :: species_name - class(species_isotope_type) , intent(in) :: this - !----------------------------------------------------------------------- - - species_name = trim(this%species_name) // trim(this%isotope_name) - - end function get_species - -end module SpeciesIsotopeType diff --git a/src/biogeochem/SpeciesNonIsotopeType.F90 b/src/biogeochem/SpeciesNonIsotopeType.F90 deleted file mode 100644 index 0daf6b3f72..0000000000 --- a/src/biogeochem/SpeciesNonIsotopeType.F90 +++ /dev/null @@ -1,125 +0,0 @@ -module SpeciesNonIsotopeType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Defines a class for working with chemical species, such as building history and - ! restart field names. - ! - ! This version is used for non-isotopic species - ! - ! !USES: - ! - use SpeciesBaseType, only : species_base_type - use abortutils, only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - use clm_varctl, only : iulog - - implicit none - save - private - - ! COMPILER_BUG(wjs, 2016-03-16, pgi 15.10) Ideally, we would use an allocatable - ! character variable for species_name. However, this causes problems for pgi: it seems - ! that this allocatable character variable randomly gets changed. So, for now, using a - ! fixed-length character variable. (It's possible that this was programmer error on my - ! part, although using allocatable character variables worked with other compilers.) - ! - ! If species_name was changed back to an allocatable-length character variable, then we - ! could remove the error checking in the constructor as well as various 'trim' - ! statements scattered throughout the code (because this%species_name would already be - ! trimmed). - integer, parameter :: species_name_maxlen = 8 - - type, extends(species_base_type), public :: species_non_isotope_type - private - character(len=species_name_maxlen) :: species_name - contains - procedure, public :: hist_fname - procedure, public :: rest_fname - procedure, public :: get_species - end type species_non_isotope_type - - interface species_non_isotope_type - module procedure constructor - end interface species_non_isotope_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - function constructor(species_name) result(this) - ! Create a species_non_isotope_type object - - type(species_non_isotope_type) :: this ! function result - character(len=*), intent(in) :: species_name ! e.g., 'C' or 'N' - !----------------------------------------------------------------------- - - if (len_trim(species_name) > species_name_maxlen) then - write(iulog,*) 'species_isotope_type constructor: species_name too long' - write(iulog,*) trim(species_name) // ' exceeds max length: ', species_name_maxlen - call endrun(msg='species_isotope_type constructor: species_name too long: '// & - errMsg(sourcefile, __LINE__)) - end if - - this%species_name = trim(species_name) - end function constructor - - pure function hist_fname(this, basename, suffix) result(fname) - ! Get a history field name for this species - ! - ! basename gives the base name of the history field - ! - ! suffix, if provided, gives a suffix that appears after all species information - ! in the field name - - character(len=:), allocatable :: fname ! function result - class(species_non_isotope_type) , intent(in) :: this - character(len=*), intent(in) :: basename - character(len=*), optional, intent(in) :: suffix - !----------------------------------------------------------------------- - - fname = trim(basename) // trim(this%species_name) - if (present(suffix)) then - fname = trim(fname) // trim(suffix) - end if - - end function hist_fname - - function rest_fname(this, basename, suffix) result(fname) - ! Get a restart field name for this species - ! - ! basename gives the base name of the restart field - ! - ! suffix, if provided, gives a suffix that appears after all species information in - ! the field name - use shr_string_mod, only : shr_string_toLower - - character(len=:), allocatable :: fname ! function result - class(species_non_isotope_type) , intent(in) :: this - character(len=*), intent(in) :: basename - character(len=*), optional, intent(in) :: suffix - - character(len=:), allocatable :: species_name_lcase - !----------------------------------------------------------------------- - - species_name_lcase = shr_string_toLower(trim(this%species_name)) - fname = trim(basename) // trim(species_name_lcase) - if (present(suffix)) then - fname = trim(fname) // trim(suffix) - end if - - end function rest_fname - - pure function get_species(this) result(species_name) - ! Get the full species name - - character(len=:), allocatable :: species_name - class(species_non_isotope_type) , intent(in) :: this - !----------------------------------------------------------------------- - - species_name = trim(this%species_name) - - end function get_species - -end module SpeciesNonIsotopeType diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 deleted file mode 100644 index 30dd5ba4e7..0000000000 --- a/src/biogeochem/VOCEmissionMod.F90 +++ /dev/null @@ -1,1102 +0,0 @@ -module VOCEmissionMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Volatile organic compound emission - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varpar , only : numpft, nlevcan - use pftconMod , only : ndllf_evr_tmp_tree, ndllf_evr_brl_tree - use pftconMod , only : ndllf_dcd_brl_tree, nbrdlf_evr_trp_tree - use pftconMod , only : nbrdlf_evr_tmp_tree, nbrdlf_dcd_brl_shrub - use pftconMod , only : nbrdlf_dcd_trp_tree, nbrdlf_dcd_tmp_tree - use pftconMod , only : nbrdlf_dcd_brl_tree, nbrdlf_evr_shrub - use pftconMod , only : nc3_arctic_grass , nc3crop - use pftconMod , only : nc4_grass, noveg - use shr_megan_mod , only : shr_megan_megcomps_n, shr_megan_megcomp_t, shr_megan_linkedlist - use shr_megan_mod , only : shr_megan_mechcomps_n, shr_megan_mechcomps, shr_megan_mapped_emisfctrs - use MEGANFactorsMod , only : Agro, Amat, Anew, Aold, betaT, ct1, ct2, LDF, Ceo - use decompMod , only : bounds_type - use abortutils , only : endrun - use fileutils , only : getfil - use clm_varcon , only : grlnd - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use SoilStateType , only : soilstate_type - use SolarAbsorbedType , only : solarabs_type - use TemperatureType , only : temperature_type - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: VOCEmission - ! - ! !PUBLIC TYPES: - type, public :: vocemis_type - real(r8) , pointer, private :: Eopt_out_patch (:) ! Eopt coefficient - real(r8) , pointer, private :: topt_out_patch (:) ! topt coefficient - real(r8) , pointer, private :: alpha_out_patch (:) ! alpha coefficient - real(r8) , pointer, private :: cp_out_patch (:) ! cp coefficient - real(r8) , pointer, private :: paru_out_patch (:) ! - real(r8) , pointer, private :: par24u_out_patch (:) ! - real(r8) , pointer, private :: par240u_out_patch (:) ! - real(r8) , pointer, private :: para_out_patch (:) ! - real(r8) , pointer, private :: par24a_out_patch (:) ! - real(r8) , pointer, private :: par240a_out_patch (:) ! - real(r8) , pointer, private :: gamma_out_patch (:) ! - real(r8) , pointer, private :: gammaL_out_patch (:) ! - real(r8) , pointer, private :: gammaT_out_patch (:) ! - real(r8) , pointer, private :: gammaP_out_patch (:) ! - real(r8) , pointer, private :: gammaA_out_patch (:) ! - real(r8) , pointer, private :: gammaS_out_patch (:) ! - real(r8) , pointer, private :: gammaC_out_patch (:) ! - real(r8) , pointer, private :: vocflx_tot_patch (:) ! total VOC flux into atmosphere [moles/m2/sec] - real(r8) , pointer, PUBLIC :: vocflx_patch (:,:) ! (num_mech_comps) MEGAN flux [moles/m2/sec] - real(r8) , pointer, private :: efisop_grc (:,:) ! gridcell isoprene emission factors - contains - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - end type vocemis_type - ! - ! !PRIVATE TYPES: - type :: megan_out_type - ! VOC fluxes structure for CLM history output - real(r8), pointer, private :: flux_out(:) ! patch MEGAN flux [ug C m-2 h-1] - end type megan_out_type - type(megan_out_type), private, pointer :: meg_out(:) ! (n_megan_comps) points to output fluxes - ! - logical, parameter :: debug = .false. - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(vocemis_type) :: this - type(bounds_type), intent(in) :: bounds - - if ( shr_megan_mechcomps_n > 0) then - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - end if - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! Allocate memory for module datatypes - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_megan_mod , only : shr_megan_factors_file - use MEGANFactorsMod , only : megan_factors_init, megan_factors_get - use clm_varpar , only : mxpft - ! - ! !ARGUMENTS: - class(vocemis_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: i, imeg - integer :: class_num - real(r8) :: factors(mxpft+1) - real(r8) :: molec_wght - integer :: begg, endg - integer :: begp, endp - type(shr_megan_megcomp_t), pointer :: meg_cmp - !----------------------------------------------------------------------- - - - begg = bounds%begg; endg = bounds%endg - begp = bounds%begp; endp = bounds%endp - - call megan_factors_init( shr_megan_factors_file ) - - meg_cmp => shr_megan_linkedlist - do while(associated(meg_cmp)) - allocate(meg_cmp%emis_factors(numpft)) - call megan_factors_get( trim(meg_cmp%name), factors, class_num, molec_wght ) - meg_cmp%emis_factors(1:numpft) = factors(1:numpft) - meg_cmp%class_number = class_num - meg_cmp%molec_weight = molec_wght - meg_cmp => meg_cmp%next_megcomp - enddo - - allocate(this%Eopt_out_patch (begp:endp)) ; this%EOPT_out_patch (:) = nan - allocate(this%topt_out_patch (begp:endp)) ; this%topt_out_patch (:) = nan - allocate(this%topt_out_patch (begp:endp)) ; this%Eopt_out_patch (:) = nan - allocate(this%alpha_out_patch (begp:endp)) ; this%alpha_out_patch (:) = nan - allocate(this%cp_out_patch (begp:endp)) ; this%cp_out_patch (:) = nan - allocate(this%para_out_patch (begp:endp)) ; this%para_out_patch (:) = nan - allocate(this%par24a_out_patch (begp:endp)) ; this%par24a_out_patch (:) = nan - allocate(this%par240a_out_patch (begp:endp)) ; this%par240a_out_patch (:) = nan - allocate(this%paru_out_patch (begp:endp)) ; this%paru_out_patch (:) = nan - allocate(this%par24u_out_patch (begp:endp)) ; this%par24u_out_patch (:) = nan - allocate(this%par240u_out_patch (begp:endp)) ; this%par240u_out_patch (:) = nan - allocate(this%gamma_out_patch (begp:endp)) ; this%gamma_out_patch (:) = nan - allocate(this%gammaL_out_patch (begp:endp)) ; this%gammaL_out_patch (:) = nan - allocate(this%gammaT_out_patch (begp:endp)) ; this%gammaT_out_patch (:) = nan - allocate(this%gammaP_out_patch (begp:endp)) ; this%gammaP_out_patch (:) = nan - allocate(this%gammaA_out_patch (begp:endp)) ; this%gammaA_out_patch (:) = nan - allocate(this%gammaS_out_patch (begp:endp)) ; this%gammaS_out_patch (:) = nan - allocate(this%gammaC_out_patch (begp:endp)) ; this%gammaC_out_patch (:) = nan - - allocate(this%vocflx_tot_patch (begp:endp)); this%vocflx_tot_patch (:) = nan - allocate(this%efisop_grc (6,begg:endg)); this%efisop_grc (:,:) = nan - - allocate(meg_out(shr_megan_megcomps_n)) - do i=1,shr_megan_megcomps_n - allocate(meg_out(i)%flux_out(begp:endp)) - meg_out(i)%flux_out(:) = 0._r8 - end do - - allocate(this%vocflx_patch(begp:endp,1:shr_megan_mechcomps_n)) - this%vocflx_patch(:,1:shr_megan_mechcomps_n)= nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize history output fields for MEGAN emissions diagnositics - ! - ! !USES - use clm_varcon , only : spval - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(vocemis_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES - integer :: imeg, ii - integer :: begp, endp - type(shr_megan_megcomp_t), pointer :: meg_cmp - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - if (shr_megan_megcomps_n>0) then - - ! loop over megan compounds - meg_cmp => shr_megan_linkedlist - do while(associated(meg_cmp)) - imeg = meg_cmp%index - - call hist_addfld1d ( fname='MEG_'//trim(meg_cmp%name), units='kg/m2/sec', & - avgflag='A', long_name='MEGAN flux', & - ptr_patch=meg_out(imeg)%flux_out, set_lake=0._r8, set_urb=0._r8 ) - - meg_cmp => meg_cmp%next_megcomp - enddo - - this%vocflx_tot_patch(begp:endp)= spval - call hist_addfld1d (fname='VOCFLXT', units='moles/m2/sec', & - avgflag='A', long_name='total VOC flux into atmosphere', & - ptr_patch=this%vocflx_tot_patch, set_lake=0._r8, set_urb=0._r8, default='inactive') - - this%gamma_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMA', units='non', & - avgflag='A', long_name='total gamma for VOC calc', & - ptr_patch=this%gamma_out_patch, set_lake=0._r8, default='inactive') - - this%gammaL_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAL', units='non', & - avgflag='A', long_name='gamma L for VOC calc', & - ptr_patch=this%gammaL_out_patch, set_lake=0._r8, default='inactive') - - this%gammaT_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAT', units='non', & - avgflag='A', long_name='gamma T for VOC calc', & - ptr_patch=this%gammaT_out_patch, set_lake=0._r8, default='inactive') - - this%gammaP_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAP', units='non', & - avgflag='A', long_name='gamma P for VOC calc', & - ptr_patch=this%gammaP_out_patch, set_lake=0._r8, default='inactive') - - this%gammaA_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAA', units='non', & - avgflag='A', long_name='gamma A for VOC calc', & - ptr_patch=this%gammaA_out_patch, set_lake=0._r8, default='inactive') - - this%gammaS_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAS', units='non', & - avgflag='A', long_name='gamma S for VOC calc', & - ptr_patch=this%gammaS_out_patch, set_lake=0._r8, default='inactive') - - this%gammaC_out_patch(begp:endp) = spval - call hist_addfld1d (fname='GAMMAC', units='non', & - avgflag='A', long_name='gamma C for VOC calc', & - ptr_patch=this%gammaC_out_patch, set_lake=0._r8, default='inactive') - - this%EOPT_out_patch(begp:endp) = spval - call hist_addfld1d (fname='EOPT', units='non', & - avgflag='A', long_name='Eopt coefficient for VOC calc', & - ptr_patch=this%Eopt_out_patch, set_lake=0._r8, default='inactive') - - this%topt_out_patch(begp:endp) = spval - call hist_addfld1d (fname='TOPT', units='non', & - avgflag='A', long_name='topt coefficient for VOC calc', & - ptr_patch=this%topt_out_patch, set_lake=0._r8, default='inactive') - - this%alpha_out_patch(begp:endp) = spval - call hist_addfld1d (fname='ALPHA', units='non', & - avgflag='A', long_name='alpha coefficient for VOC calc', & - ptr_patch=this%alpha_out_patch, set_lake=0._r8, default='inactive') - - this%cp_out_patch(begp:endp) = spval - call hist_addfld1d (fname='currentPatch', units='non', & - avgflag='A', long_name='currentPatch coefficient for VOC calc', & - ptr_patch=this%cp_out_patch, set_lake=0._r8, default='inactive') - - this%paru_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR', & - ptr_patch=this%paru_out_patch, set_lake=0._r8, default='inactive') - - this%par24u_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR24_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR (24 hrs)', & - ptr_patch=this%par24u_out_patch, set_lake=0._r8, default='inactive') - - this%par240u_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR240_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR (240 hrs)', & - ptr_patch=this%par240u_out_patch, set_lake=0._r8, default='inactive') - - this%para_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR', & - ptr_patch=this%para_out_patch, set_lake=0._r8, default='inactive') - - this%par24a_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR24_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR (24 hrs)', & - ptr_patch=this%par24a_out_patch, set_lake=0._r8, default='inactive') - - this%par240a_out_patch(begp:endp) = spval - call hist_addfld1d (fname='PAR240_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR (240 hrs)', & - ptr_patch=this%par240a_out_patch, set_lake=0._r8, default='inactive') - - end if - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize cold start conditions for module variables - ! - ! !USES - use ncdio_pio - use clm_varctl, only : fsurdat - ! - ! !ARGUMENTS: - class(vocemis_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - logical :: readvar - integer :: begg, endg - type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: locfn ! local filename - real(r8) ,pointer :: temp_ef(:) ! read in - temporary EFs - !----------------------------------------------------------------------- - - begg = bounds%begg; endg = bounds%endg - - ! Time constant - - allocate(temp_ef(begg:endg)) - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - call ncd_io(ncid=ncid, varname='EF1_BTR', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_BTR'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(1,begg:endg)=temp_ef(begg:endg) - - call ncd_io(ncid=ncid, varname='EF1_FET', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_FET'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(2,begg:endg)=temp_ef(begg:endg) - - call ncd_io(ncid=ncid, varname='EF1_FDT', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_FDT'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(3,begg:endg)=temp_ef(begg:endg) - - call ncd_io(ncid=ncid, varname='EF1_SHR', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_SHR'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(4,begg:endg)=temp_ef(begg:endg) - - call ncd_io(ncid=ncid, varname='EF1_GRS', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_GRS'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(5,begg:endg)=temp_ef(begg:endg) - - call ncd_io(ncid=ncid, varname='EF1_CRP', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg='iniTimeConst: errror reading EF1_CRP'//errMsg(sourcefile, __LINE__)) - end if - this%efisop_grc(6,begg:endg)=temp_ef(begg:endg) - - deallocate(temp_ef) - - call ncd_pio_closefile(ncid) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine VOCEmission (bounds, num_soilp, filter_soilp, & - atm2lnd_inst, canopystate_inst, photosyns_inst, temperature_inst, & - vocemis_inst) - ! - ! ! NEW DESCRIPTION - ! Volatile organic compound emission - ! This code simulates volatile organic compound emissions following - ! MEGAN (Model of Emissions of Gases and Aerosols from Nature) v2.1 - ! for 20 compound classes. The original description of this - ! algorithm (for isoprene only) can be found in Guenther et al., 2006 - ! (we follow equations 2-9, 16-17, 20 for explicit canopy). - ! The model scheme came be described as: - ! E= epsilon * gamma * rho - ! VOC flux (E) [ug m-2 h-1] is calculated from baseline emission - ! factors (epsilon) [ug m-2 h-1] which are specified for each of the 16 - ! CLM Patches (in input file) OR in the case of isoprene, from - ! mapped EFs for each PATCH which reflect species divergence of emissions, - ! particularly in North America. - ! The emission activity factor (gamma) [unitless] for includes - ! dependence on PPFT, temperature, LAI, leaf age and soil moisture. - ! For isoprene only we also include the effect of CO2 inhibition as - ! described by Heald et al., 2009. - ! The canopy environment constant was calculated offline for CLM+CAM at - ! standard conditions. - ! We assume that the escape efficiency (rho) here is unity following - ! Guenther et al., 2006. - ! A manuscript describing MEGAN 2.1 and the implementation in CLM is - ! in preparation: Guenther, Heald et al., 2012 - ! Subroutine written to operate at the patch level. - ! - ! Input: to be read in with EFs and some parameters. - ! Currently these are set in procedure init_EF_params - ! Output: vocflx(shr_megan_mechcomps_n) !VOC flux [moles/m2/sec] - ! - ! !USES: - use subgridAveMod , only : p2g - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp ! number of columns in soil patch filter - integer , intent(in) :: filter_soilp(num_soilp) ! patch filter for soil - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(photosyns_type) , intent(in) :: photosyns_inst - type(temperature_type) , intent(in) :: temperature_inst - type(vocemis_type) , intent(inout) :: vocemis_inst - ! - ! !REVISION HISTORY: - ! 4/29/11: Colette L. Heald: expand MEGAN to 20 compound classes - ! 7 Feb 2012: Francis Vitt: Implemented capability to specify MEGAN emissions in namelist - ! and read in MEGAN factors from file. - ! - ! !LOCAL VARIABLES: - integer :: fp,p,g,c ! indices - real(r8) :: epsilon ! emission factor [ug m-2 h-1] - real(r8) :: gamma ! activity factor (accounting for light, T, age, LAI conditions) - real(r8) :: gamma_p ! activity factor for PPFD - real(r8) :: gamma_l ! activity factor for PPFD & LAI - real(r8) :: gamma_t ! activity factor for temperature - real(r8) :: gamma_a ! activity factor for leaf age - real(r8) :: gamma_sm ! activity factor for soil moisture - real(r8) :: gamma_c ! activity factor for CO2 (only isoprene) - real(r8) :: par_sun ! temporary - real(r8) :: par24_sun ! temporary - real(r8) :: par240_sun ! temporary - real(r8) :: par_sha ! temporary - real(r8) :: par24_sha ! temporary - real(r8) :: par240_sha ! temporary - - integer :: class_num, n_meg_comps, imech, imeg, ii - character(len=16) :: mech_name - type(shr_megan_megcomp_t), pointer :: meg_cmp - real(r8) :: cp, alpha, Eopt, topt ! for history output - real(r8) :: co2_ppmv - - real(r8) :: vocflx_meg(shr_megan_megcomps_n) - - ! factor used convert MEGAN units [micro-grams/m2/hr] to CAM srf emis units [g/m2/sec] - real(r8), parameter :: megemis_units_factor = 1._r8/3600._r8/1.e6_r8 - - ! real(r8) :: root_depth(0:numpft) ! Root depth [m] - character(len=32), parameter :: subname = "VOCEmission" - !----------------------------------------------------------------------- - - ! ! root depth (m) (defined based on Zeng et al., 2001, cf Guenther 2006) - ! root_depth(noveg) = 0._r8 ! bare-soil - ! root_depth(ndllf_evr_tmp_tree:ndllf_evr_brl_tree) = 1.8_r8 ! evergreen tree - ! root_depth(ndllf_dcd_brl_tree) = 2.0_r8 ! needleleaf deciduous boreal tree - ! root_depth(nbrdlf_evr_trp_tree:nbrdlf_evr_tmp_tree) = 3.0_r8 ! broadleaf evergreen tree - ! root_depth(nbrdlf_dcd_trp_tree:nbrdlf_dcd_brl_tree) = 2.0_r8 ! broadleaf deciduous tree - ! root_depth(nbrdlf_evr_shrub:nbrdlf_dcd_brl_shrub) = 2.5_r8 ! shrub - ! root_depth(nc3_arctic_grass:numpft) = 1.5_r8 ! grass/crop - ! - if ( shr_megan_mechcomps_n < 1) return - - if ( nlevcan /= 1 )then - call endrun( subname//' error: can NOT work without nlevcan == 1' ) - end if - - associate( & - !dz => col%dz , & ! Input: [real(r8) (:,:) ] depth of layer (m) - !bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) - !clayfrac => soilstate_inst%clayfrac_col , & ! Input: [real(r8) (:) ] fraction of soil that is clay - !sandfrac => soilstate_inst%sandfrac_col , & ! Input: [real(r8) (:) ] fraction of soil that is sand - !watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) (nlevgrnd) - !sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) (nlevgrnd) - !h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (m3/m3) - !h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice soil content (kg/m3) - - forc_solad => atm2lnd_inst%forc_solad_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (visible only) - forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse radiation (visible only) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric pressure (Pa) - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - forc_solad24 => atm2lnd_inst%fsd24_patch , & ! Input: [real(r8) (:) ] direct beam radiation last 24hrs (visible only) - forc_solad240 => atm2lnd_inst%fsd240_patch , & ! Input: [real(r8) (:) ] direct beam radiation last 240hrs (visible only) - forc_solai24 => atm2lnd_inst%fsi24_patch , & ! Input: [real(r8) (:) ] diffuse radiation last 24hrs (visible only) - forc_solai240 => atm2lnd_inst%fsi240_patch , & ! Input: [real(r8) (:) ] diffuse radiation last 240hrs (visible only) - - fsun => canopystate_inst%fsun_patch , & ! Input: [real(r8) (:) ] sunlit fraction of canopy - fsun24 => canopystate_inst%fsun24_patch , & ! Input: [real(r8) (:) ] sunlit fraction of canopy last 24 hrs - fsun240 => canopystate_inst%fsun240_patch , & ! Input: [real(r8) (:) ] sunlit fraction of canopy last 240 hrs - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - elai240 => canopystate_inst%elai240_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow last 240 hrs - - cisun_z => photosyns_inst%cisun_z_patch , & ! Input: [real(r8) (:,:) ] sunlit intracellular CO2 (Pa) - cisha_z => photosyns_inst%cisha_z_patch , & ! Input: [real(r8) (:,:) ] shaded intracellular CO2 (Pa) - - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] patch vegetation temperature (Kelvin) - t_veg24 => temperature_inst%t_veg24_patch , & ! Input: [real(r8) (:) ] avg patch vegetation temperature for last 24 hrs - t_veg240 => temperature_inst%t_veg240_patch , & ! Input: [real(r8) (:) ] avg patch vegetation temperature for last 240 hrs - - Eopt_out => vocemis_inst%Eopt_out_patch , & ! Output: [real(r8) (:) ] - topt_out => vocemis_inst%topt_out_patch , & ! Output: [real(r8) (:) ] - alpha_out => vocemis_inst%alpha_out_patch , & ! Output: [real(r8) (:) ] - cp_out => vocemis_inst%cp_out_patch , & ! Output: [real(r8) (:) ] - paru_out => vocemis_inst%paru_out_patch , & ! Output: [real(r8) (:) ] - par24u_out => vocemis_inst%par24u_out_patch , & ! Output: [real(r8) (:) ] - par240u_out => vocemis_inst%par240u_out_patch , & ! Output: [real(r8) (:) ] - para_out => vocemis_inst%para_out_patch , & ! Output: [real(r8) (:) ] - par24a_out => vocemis_inst%par24a_out_patch , & ! Output: [real(r8) (:) ] - par240a_out => vocemis_inst%par240a_out_patch , & ! Output: [real(r8) (:) ] - gammaL_out => vocemis_inst%gammaL_out_patch , & ! Output: [real(r8) (:) ] - gammaT_out => vocemis_inst%gammaT_out_patch , & ! Output: [real(r8) (:) ] - gammaP_out => vocemis_inst%gammaP_out_patch , & ! Output: [real(r8) (:) ] - gammaA_out => vocemis_inst%gammaA_out_patch , & ! Output: [real(r8) (:) ] - gammaS_out => vocemis_inst%gammaS_out_patch , & ! Output: [real(r8) (:) ] - gammaC_out => vocemis_inst%gammaC_out_patch , & ! Output: [real(r8) (:) ] - gamma_out => vocemis_inst%gamma_out_patch , & ! Output: [real(r8) (:) ] - vocflx => vocemis_inst%vocflx_patch , & ! Output: [real(r8) (:,:) ] VOC flux [moles/m2/sec] - vocflx_tot => vocemis_inst%vocflx_tot_patch & ! Output: [real(r8) (:) ] VOC flux [moles/m2/sec] - ) - - ! initialize variables which get passed to the atmosphere - vocflx(bounds%begp:bounds%endp,:) = 0._r8 - vocflx_tot(bounds%begp:bounds%endp) = 0._r8 - - do imeg=1,shr_megan_megcomps_n - meg_out(imeg)%flux_out(bounds%begp:bounds%endp) = 0._r8 - enddo - - ! Begin loop over points - !_______________________________________________________________________________ - do fp = 1,num_soilp - p = filter_soilp(fp) - g = patch%gridcell(p) - c = patch%column(p) - - ! initialize EF - epsilon=0._r8 - - ! initalize to zero since this might not alway get set - ! this needs to be within the fp loop ... - vocflx_meg(:) = 0._r8 - - ! calculate VOC emissions for non-bare ground Patches - if (patch%itype(p) > 0) then - gamma=0._r8 - - ! Calculate PAR: multiply w/m2 by 4.6 to get umol/m2/s for par (added 8/14/02) - !------------------------ - ! SUN: - par_sun = (forc_solad(g,1) + fsun(p) * forc_solai(g,1)) * 4.6_r8 - par24_sun = (forc_solad24(p) + fsun24(p) * forc_solai24(p)) * 4.6_r8 - par240_sun = (forc_solad240(p) + fsun240(p) * forc_solai240(p)) * 4.6_r8 - - ! SHADE: - par_sha = ((1._r8 - fsun(p)) * forc_solai(g,1)) * 4.6_r8 - par24_sha = ((1._r8 - fsun24(p)) * forc_solai24(p)) * 4.6_r8 - par240_sha = ((1._r8 - fsun240(p)) * forc_solai240(p)) * 4.6_r8 - - ! Activity factor for LAI (Guenther et al., 2006): all species - gamma_l = get_gamma_L(fsun240(p), elai(p)) - - ! Activity factor for soil moisture: all species (commented out for now) - ! gamma_sm = get_gamma_SM(clayfrac(p), sandfrac(p), h2osoi_vol(c,:), h2osoi_ice(c,:), & - ! col%dz(c,:), soilstate_inst%bsw_col(c,:), watsat(c,:), sucsat(c,:), root_depth(patch%itype(p))) - gamma_sm = 1.0_r8 - - ! Loop through VOCs for light, temperature and leaf age activity factor & apply - ! all final activity factors to baseline emission factors - !_______________________________________________________________________________ - - ! loop over megan compounds - meg_cmp => shr_megan_linkedlist - meg_cmp_loop: do while(associated(meg_cmp)) - imeg = meg_cmp%index - - ! set emis factor - ! if specified, set EF for isoprene with mapped values - if ( trim(meg_cmp%name) == 'isoprene' .and. shr_megan_mapped_emisfctrs) then - epsilon = get_map_EF(patch%itype(p),g, vocemis_inst) - else - epsilon = meg_cmp%emis_factors(patch%itype(p)) - end if - - class_num = meg_cmp%class_number - - ! Activity factor for PPFD - gamma_p = get_gamma_P(par_sun, par24_sun, par240_sun, par_sha, par24_sha, par240_sha, & - fsun(p), fsun240(p), forc_solad240(p),forc_solai240(p), LDF(class_num), cp, alpha) - - ! Activity factor for T - gamma_t = get_gamma_T(t_veg240(p), t_veg24(p),t_veg(p), ct1(class_num), ct2(class_num),& - betaT(class_num),LDF(class_num), Ceo(class_num), Eopt, topt) - - ! Activity factor for Leaf Age - gamma_a = get_gamma_A(patch%itype(p), elai240(p),elai(p),class_num) - - ! Activity factor for CO2 (only for isoprene) - if (trim(meg_cmp%name) == 'isoprene') then - co2_ppmv = 1.e6*forc_pco2(g)/forc_pbot(c) - gamma_c = get_gamma_C(cisun_z(p,1),cisha_z(p,1),forc_pbot(c),fsun(p), co2_ppmv) - else - gamma_c = 1._r8 - end if - - ! Calculate total scaling factor - gamma = gamma_l * gamma_sm * gamma_a * gamma_p * gamma_T * gamma_c - - if ( (gamma >=0.0_r8) .and. (gamma< 100._r8) ) then - - vocflx_meg(imeg) = meg_cmp%coeff * epsilon * gamma * megemis_units_factor / meg_cmp%molec_weight ! moles/m2/sec - - ! assign to arrays for history file output (not weighted by landfrac) - meg_out(imeg)%flux_out(p) = meg_out(imeg)%flux_out(p) & - + epsilon * gamma * megemis_units_factor*1.e-3_r8 ! Kg/m2/sec - - if (imeg==1) then - ! - gamma_out(p)=gamma - gammaP_out(p)=gamma_p - gammaT_out(p)=gamma_t - gammaA_out(p)=gamma_a - gammaS_out(p)=gamma_sm - gammaL_out(p)=gamma_l - gammaC_out(p)=gamma_c - - paru_out(p)=par_sun - par24u_out(p)=par24_sun - par240u_out(p)=par240_sun - - para_out(p)=par_sha - par24a_out(p)=par24_sha - par240a_out(p)=par240_sha - - alpha_out(p)=alpha - cp_out(p)=cp - - topt_out(p)=topt - Eopt_out(p)=Eopt - - end if - endif - - if (debug .and. gamma > 0.0_r8) then - write(iulog,*) 'MEGAN: n, megan name, epsilon, gamma, vocflx: ', & - imeg, meg_cmp%name, epsilon, gamma, vocflx_meg(imeg), gamma_p,gamma_t,gamma_a,gamma_sm,gamma_l - endif - - meg_cmp => meg_cmp%next_megcomp - enddo meg_cmp_loop - - ! sum up the megan compound fluxes for the fluxes of chem mechanism compounds - do imech = 1,shr_megan_mechcomps_n - n_meg_comps = shr_megan_mechcomps(imech)%n_megan_comps - do imeg = 1,n_meg_comps ! loop over number of megan compounds that make up the nth mechanism compoud - ii = shr_megan_mechcomps(imech)%megan_comps(imeg)%ptr%index - vocflx(p,imech) = vocflx(p,imech) + vocflx_meg(ii) - enddo - vocflx_tot(p) = vocflx_tot(p) + vocflx(p,imech) ! moles/m2/sec - enddo - - end if ! patch%itype(1:15 only) - - enddo ! fp - - - end associate - end subroutine VOCEmission - - !----------------------------------------------------------------------- - function get_map_EF(ivt_in, g_in, vocemis_inst) - ! - ! Get mapped EF for isoprene - ! Use gridded values for 6 Patches specified by MEGAN following - ! Guenther et al. (2006). Map the numpft CLM Patches to these 6. - ! Units: [ug m-2 h-1] - ! - ! !ARGUMENTS: - integer, intent(in) :: ivt_in - integer, intent(in) :: g_in - type(vocemis_type), intent(in) :: vocemis_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: get_map_EF - !----------------------------------------------------------------------- - - ! vocemis_inst%efisop_patch ! Output: [real(r8) (:,:)] emission factors for isoprene for each patch [ug m-2 h-1] - - get_map_EF = 0._r8 - - if ( ivt_in == ndllf_evr_tmp_tree & - .or. ivt_in == ndllf_evr_brl_tree) then !fineleaf evergreen - get_map_EF = vocemis_inst%efisop_grc(2,g_in) - else if (ivt_in == ndllf_dcd_brl_tree) then !fineleaf deciduous - get_map_EF = vocemis_inst%efisop_grc(3,g_in) - else if (ivt_in >= nbrdlf_evr_trp_tree & - .and. ivt_in <= nbrdlf_dcd_brl_tree) then !broadleaf trees - get_map_EF = vocemis_inst%efisop_grc(1,g_in) - else if (ivt_in >= nbrdlf_evr_shrub & - .and. ivt_in <= nbrdlf_dcd_brl_shrub) then !shrubs - get_map_EF = vocemis_inst%efisop_grc(4,g_in) - else if (ivt_in >= nc3_arctic_grass & - .and. ivt_in <= nc4_grass) then !grass - get_map_EF = vocemis_inst%efisop_grc(5,g_in) - else if (ivt_in >= nc3crop) then !crops - get_map_EF = vocemis_inst%efisop_grc(6,g_in) - end if - - end function get_map_EF - - !----------------------------------------------------------------------- - function get_gamma_P(par_sun_in, par24_sun_in, par240_sun_in, par_sha_in, par24_sha_in, par240_sha_in, & - fsun_in, fsun240_in, forc_solad240_in,forc_solai240_in, LDF_in, cp, alpha) - ! - ! Activity factor for PPFD (Guenther et al., 2006): all light dependent species - !------------------------- - ! With distinction between sunlit and shaded leafs, weight scalings by - ! fsun and fshade - ! Scale total incident par by fraction of sunlit leaves (added on 1/2002) - - ! fvitt -- forc_solad240, forc_solai240 can be zero when CLM finidat is specified - ! which will cause par240 to be zero and produce NaNs via log(par240) - ! dml -- fsun240 can be equal to or greater than one before 10 day averages are - ! set on startup or if a new patch comes online during land cover change. - ! Avoid this problem by only doing calculations with fsun240 when fsun240 is - ! between 0 and 1 - ! - ! !ARGUMENTS: - implicit none - real(r8),intent(in) :: par_sun_in - real(r8),intent(in) :: par24_sun_in - real(r8),intent(in) :: par240_sun_in - real(r8),intent(in) :: par_sha_in - real(r8),intent(in) :: par24_sha_in - real(r8),intent(in) :: par240_sha_in - real(r8),intent(in) :: fsun_in - real(r8),intent(in) :: fsun240_in - real(r8),intent(in) :: forc_solad240_in - real(r8),intent(in) :: forc_solai240_in - real(r8),intent(in) :: LDF_in - real(r8),intent(out):: cp ! temporary - real(r8),intent(out):: alpha ! temporary - ! - ! !LOCAL VARIABLES: - real(r8) :: gamma_p_LDF ! activity factor for PPFD - real(r8) :: get_gamma_P ! return value - real(r8), parameter :: ca1 = 0.004_r8 ! empirical coefficent for alpha - real(r8), parameter :: ca2 = 0.0005_r8 ! empirical coefficent for alpha - real(r8), parameter :: ca3 = 0.0468_r8 ! empirical coefficent for cp - real(r8), parameter :: par0_sun = 200._r8 ! std conditions for past 24 hrs [umol/m2/s] - real(r8), parameter :: par0_shade = 50._r8 ! std conditions for past 24 hrs [umol/m2/s] - real(r8), parameter :: alpha_fix = 0.001_r8 ! empirical coefficient - real(r8), parameter :: cp_fix = 1.21_r8 ! empirical coefficient - !----------------------------------------------------------------------- - - if ( (fsun240_in > 0._r8) .and. (fsun240_in < 1._r8) .and. (forc_solad240_in > 0._r8) & - .and. (forc_solai240_in > 0._r8)) then - ! With alpha and cp calculated based on eq 6 and 7: - ! Note indexing for accumulated variables is all at patch level - ! SUN: - alpha = ca1 - ca2 * log(par240_sun_in) - cp = ca3 * exp(ca2 * (par24_sun_in-par0_sun))*par240_sun_in**(0.6_r8) - gamma_p_LDF = fsun_in * ( cp * alpha * par_sun_in * (1._r8 + alpha*alpha*par_sun_in*par_sun_in)**(-0.5_r8) ) - ! SHADE: - alpha = ca1 - ca2 * log(par240_sha_in) - cp = ca3 * exp(ca2 * (par_sha_in-par0_shade))*par240_sha_in**(0.6_r8) - gamma_p_LDF = gamma_p_LDF + (1._r8-fsun_in) * (cp*alpha*par_sha_in*(1._r8 + alpha*alpha*par_sha_in*par_sha_in)**(-0.5_r8)) - else - ! With fixed alpha and cp (from MEGAN User's Guide): - ! SUN: direct + diffuse - alpha = alpha_fix - cp = cp_fix - gamma_p_LDF = fsun_in * ( cp * alpha*par_sun_in * (1._r8 + alpha*alpha*par_sun_in*par_sun_in)**(-0.5_r8) ) - ! SHADE: diffuse - gamma_p_LDF = gamma_p_LDF + (1._r8-fsun_in) * (cp*alpha*par_sha_in*(1._r8 + alpha*alpha*par_sha_in*par_sha_in)**(-0.5_r8)) - end if - - ! Calculate total activity factor for PPFD accounting for light-dependent fraction - get_gamma_P = (1._r8 - LDF_in) + LDF_in * gamma_p_LDF - - end function get_gamma_P - - !----------------------------------------------------------------------- - function get_gamma_L(fsun240_in,elai_in) - ! - ! Activity factor for LAI (Guenther et al., 2006): all species - ! Guenther et al., 2006 eq 3 - ! - ! !USES: - use clm_varcon , only : denice - use clm_varpar , only : nlevsoi - ! - ! !ARGUMENTS: - implicit none - real(r8),intent(in) :: fsun240_in - real(r8),intent(in) :: elai_in - real(r8) :: get_gamma_L ! return value - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: cce = 0.30_r8 ! factor to set emissions to unity @ std - real(r8), parameter :: cce1 = 0.24_r8 ! same as Cce but for non-accumulated vars - !----------------------------------------------------------------------- - if ( (fsun240_in > 0.0_r8) .and. (fsun240_in < 1.e30_r8) ) then - get_gamma_L = cce * elai_in - else - get_gamma_L = cce1 * elai_in - end if - - end function get_gamma_L - - !----------------------------------------------------------------------- - function get_gamma_SM(clayfrac_in, sandfrac_in, h2osoi_vol_in, h2osoi_ice_in, dz_in, & - bsw_in, watsat_in, sucsat_in, root_depth_in) - ! - ! Activity factor for soil moisture (Guenther et al., 2006): all species - !---------------------------------- - ! Calculate the mean scaling factor throughout the root depth. - ! wilting point potential is in units of matric potential (mm) - ! (1 J/Kg = 0.001 MPa, approx = 0.1 m) - ! convert to volumetric soil water using equation 7.118 of the CLM4 Technical Note - ! - ! !USES: - use clm_varcon , only : denice - use clm_varpar , only : nlevsoi - ! - ! !ARGUMENTS: - implicit none - real(r8),intent(in) :: clayfrac_in - real(r8),intent(in) :: sandfrac_in - real(r8),intent(in) :: h2osoi_vol_in(nlevsoi) - real(r8),intent(in) :: h2osoi_ice_in(nlevsoi) - real(r8),intent(in) :: dz_in(nlevsoi) - real(r8),intent(in) :: bsw_in(nlevsoi) - real(r8),intent(in) :: watsat_in(nlevsoi) - real(r8),intent(in) :: sucsat_in(nlevsoi) - real(r8),intent(in) :: root_depth_in - ! - ! !LOCAL VARIABLES: - real(r8) :: get_gamma_SM - integer :: j - real(r8) :: nl ! temporary number of soil levels - real(r8) :: theta_ice ! water content in ice in m3/m3 - real(r8) :: wilt ! wilting point in m3/m3 - real(r8) :: theta1 ! temporary - real(r8), parameter :: deltheta1=0.06_r8 ! empirical coefficient - real(r8), parameter :: smpmax = 2.57e5_r8 ! maximum soil matrix potential - !----------------------------------------------------------------------- - - if ((clayfrac_in > 0) .and. (sandfrac_in > 0)) then - get_gamma_SM = 0._r8 - nl=0._r8 - - do j = 1,nlevsoi - if (sum(dz_in(1:j)) < root_depth_in) then - theta_ice = h2osoi_ice_in(j)/(dz_in(j)*denice) - wilt = ((smpmax/sucsat_in(j))**(-1._r8/bsw_in(j))) * (watsat_in(j) - theta_ice) - theta1 = wilt + deltheta1 - if (h2osoi_vol_in(j) >= theta1) then - get_gamma_SM = get_gamma_SM + 1._r8 - else if ( (h2osoi_vol_in(j) > wilt) .and. (h2osoi_vol_in(j) < theta1) ) then - get_gamma_SM = get_gamma_SM + ( h2osoi_vol_in(j) - wilt ) / deltheta1 - else - get_gamma_SM = get_gamma_SM + 0._r8 - end if - nl=nl+1._r8 - end if - end do - - if (nl > 0._r8) then - get_gamma_SM = get_gamma_SM/nl - endif - - if (get_gamma_SM > 1.0_r8) then - write(iulog,*) 'healdSM > 1: gamma_SM, nl', get_gamma_SM, nl - get_gamma_SM=1.0_r8 - endif - - else - get_gamma_SM = 1.0_r8 - end if - - end function get_gamma_SM - - !----------------------------------------------------------------------- - function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, LDF_in, Ceo_in, Eopt, topt) - - ! Activity factor for temperature - !-------------------------------- - ! Calculate both a light-dependent fraction as in Guenther et al., 2006 for isoprene - ! of a max saturation type form. Also caculate a light-independent fraction of the - ! form of an exponential. Final activity factor depends on light dependent fraction - ! of compound type. - ! - ! !ARGUMENTS: - implicit none - real(r8),intent(in) :: t_veg240_in - real(r8),intent(in) :: t_veg24_in - real(r8),intent(in) :: t_veg_in - real(r8),intent(in) :: ct1_in - real(r8),intent(in) :: ct2_in - real(r8),intent(in) :: betaT_in - real(r8),intent(in) :: LDF_in - real(r8),intent(in) :: Ceo_in - real(r8),intent(out) :: Eopt ! temporary - real(r8),intent(out) :: topt ! temporary - ! - ! !LOCAL VARIABLES: - real(r8) :: get_gamma_T - real(r8) :: gamma_t_LDF ! activity factor for temperature - real(r8) :: gamma_t_LIF ! activity factor for temperature - real(r8) :: x ! temporary - real(r8), parameter :: co1 = 313._r8 ! empirical coefficient - real(r8), parameter :: co2 = 0.6_r8 ! empirical coefficient - real(r8), parameter :: co4 = 0.05_r8 ! empirical coefficient - real(r8), parameter :: tstd0 = 297_r8 ! std temperature [K] - real(r8), parameter :: topt_fix = 317._r8 ! std temperature [K] - real(r8), parameter :: Eopt_fix = 2.26_r8 ! empirical coefficient - real(r8), parameter :: ct3 = 0.00831_r8 ! empirical coefficient (0.0083 in User's Guide) - real(r8), parameter :: tstd = 303.15_r8 ! std temperature [K] - real(r8), parameter :: bet = 0.09_r8 ! beta empirical coefficient [K-1] - !----------------------------------------------------------------------- - - ! Light dependent fraction (Guenther et al., 2006) - if ( (t_veg240_in > 0.0_r8) .and. (t_veg240_in < 1.e30_r8) ) then - ! topt and Eopt from eq 8 and 9: - topt = co1 + (co2 * (t_veg240_in-tstd0)) - Eopt = Ceo_in * exp (co4 * (t_veg24_in-tstd0)) * exp(co4 * (t_veg240_in -tstd0)) - else - topt = topt_fix - Eopt = Eopt_fix - endif - x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 - gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x)/(ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) - - - ! Light independent fraction (of exp(beta T) form) - gamma_t_LIF = exp(betaT_in * (t_veg_in - tstd)) - - ! Calculate total activity factor for light as a function of light-dependent fraction - !-------------------------------- - get_gamma_T = (1-LDF_in)*gamma_T_LIF + LDF_in*gamma_T_LDF - - end function get_gamma_T - - !----------------------------------------------------------------------- - function get_gamma_A(ivt_in, elai240_in, elai_in, nclass_in) - - ! Activity factor for leaf age (Guenther et al., 2006) - !----------------------------- - ! If not CNDV elai is constant therefore gamma_a=1.0 - ! gamma_a set to unity for evergreens (Patches 1, 2, 4, 5) - ! Note that we assume here that the time step is shorter than the number of - !days after budbreak required to induce isoprene emissions (ti=12 days) and - ! the number of days after budbreak to reach peak emission (tm=28 days) - ! - ! !ARGUMENTS: - implicit none - integer,intent(in) :: ivt_in - integer,intent(in) :: nclass_in - real(r8),intent(in) :: elai240_in - real(r8),intent(in) :: elai_in - ! - ! !LOCAL VARIABLES: - real(r8) :: get_gamma_A - real(r8) :: elai_prev ! lai for previous timestep - real(r8) :: fnew, fgro, fmat, fold ! fractions of leaves at different phenological stages - !----------------------------------------------------------------------- - if ( (ivt_in == ndllf_dcd_brl_tree) .or. (ivt_in >= nbrdlf_dcd_trp_tree) ) then ! non-evergreen - - if ( (elai240_in > 0.0_r8) .and. (elai240_in < 1.e30_r8) )then - elai_prev = 2._r8*elai240_in-elai_in ! have accumulated average lai over last 10 days - if (elai_prev == elai_in) then - fnew = 0.0_r8 - fgro = 0.0_r8 - fmat = 1.0_r8 - fold = 0.0_r8 - else if (elai_prev > elai_in) then - fnew = 0.0_r8 - fgro = 0.0_r8 - fmat = 1.0_r8 - (elai_prev - elai_in)/elai_prev - fold = (elai_prev - elai_in)/elai_prev - else if (elai_prev < elai_in) then - fnew = 1 - (elai_prev / elai_in) - fgro = 0.0_r8 - fmat = (elai_prev / elai_in) - fold = 0.0_r8 - end if - - get_gamma_A = fnew*Anew(nclass_in) + fgro*Agro(nclass_in) + fmat*Amat(nclass_in) + fold*Aold(nclass_in) - - else - get_gamma_A = 1.0_r8 - end if - - else - get_gamma_A = 1.0_r8 - end if - - - end function get_gamma_A - - !----------------------------------------------------------------------- - function get_gamma_C(cisun_in,cisha_in,forc_pbot_in,fsun_in, co2_ppmv) - - ! Activity factor for instantaneous CO2 changes (Heald et al., 2009) - !------------------------- - ! With distinction between sunlit and shaded leaves, weight scalings by - ! fsun and fshade - ! - ! !CALLED FROM: VOCEmission - ! - ! !REVISION HISTORY: - ! Author: Colette L. Heald (11/30/11) - ! Louisa K. Emmons (16/03/2015) - implement Colette's intended code - ! and use atmosphere CO2 (not nml setting) - ! - ! !USES: - ! use clm_varctl, only : co2_ppmv ! corresponds to CCSM_CO2_PPMV set in env_conf.xml - ! - ! !ARGUMENTS: - implicit none - ! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: cisun_in - real(r8),intent(in) :: cisha_in - real(r8),intent(in) :: forc_pbot_in - real(r8),intent(in) :: fsun_in - real(r8),intent(in) :: co2_ppmv - - real(r8) :: get_gamma_C - - ! local variables - real(r8) :: Ismax ! empirical coeff for CO2 - real(r8) :: h ! empirical coeff for CO2 - real(r8) :: Cstar ! empirical coeff for CO2 - real(r8) :: fint ! interpolation fraction for CO2 - real(r8) :: ci ! temporary sunlight/shade weighted cisun & cisha (umolCO2/mol) - real(r8) :: gamma_ci ! short-term exposure gamma - real(r8) :: gamma_ca ! long-term exposure gamma - real(r8), parameter :: Ismax_ca = 1.344_r8 ! Estimated asymptote at which further decreases in intercellular CO2 have a negligible effect on isoprene emission - real(r8), parameter :: h_ca = 1.4614_r8 ! Exponential scalar - real(r8), parameter :: Cstar_ca = 585._r8 ! Scaling coefficient - real(r8), parameter :: CiCa_ratio = 0.7_r8 ! Ratio of intercellular CO2 to atmospheric CO2 - !----------------------------------------------------------------------- - - - ! LONG-TERM EXPOSURE (based on ambient CO2, Ca) - !----------------------------------------------------------------------------- - gamma_ca = Ismax_ca - ((Ismax_ca * (CiCa_ratio*co2_ppmv)**h_ca) / (Cstar_ca**h_ca + (CiCa_ratio*co2_ppmv)**h_ca) ) - - - ! SHORT-TERM EXPOSURE (based on intercellular CO2, Ci) - !----------------------------------------------------------------------------- - ! Determine long-term CO2 growth environment (ie. ambient CO2) and interpolate - ! parameters - if ( co2_ppmv < 400._r8 ) then - Ismax = 1.072_r8 - h = 1.70_r8 - Cstar = 1218._r8 - else if ( (co2_ppmv > 400._r8) .and. (co2_ppmv < 600._r8) ) then - fint = (co2_ppmv - 400._r8)/200._r8 - Ismax = fint*1.036_r8 + (1.- fint)*1.072_r8 - h = fint*2.0125_r8 + (1.- fint)*1.70_r8 - Cstar = fint*1150._r8 + (1.- fint)*1218._r8 - else if ( (co2_ppmv > 600._r8) .and. (co2_ppmv < 800._r8) ) then - fint = (co2_ppmv - 600._r8)/200._r8 - Ismax = fint*1.046_r8 + (1.- fint)*1.036_r8 - h = fint*1.5380_r8 + (1.- fint)*2.0125_r8 - Cstar = fint*2025._r8 + (1.- fint)*1150._r8 - else if ( co2_ppmv > 800._r8 ) then - Ismax = 1.014_r8 - h = 2.861_r8 - Cstar = 1525._r8 - end if - - ! Intercellular CO2 concentrations (ci) given in Pa, divide by atmos - ! pressure to get mixing ratio (umolCO2/mol) - if ( (cisun_in .eq. cisun_in) .and. (cisha_in .eq. cisha_in) .and. (forc_pbot_in > 0._r8) .and. (fsun_in > 0._r8) ) then - ci = ( fsun_in*cisun_in + (1._r8-fsun_in)*cisha_in )/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else if ( (cisun_in > 0.0_r8) .and. (cisun_in < 1.e30_r8) .and. (forc_pbot_in > 0._r8) .and. (fsun_in .eq. 1._r8) ) then - ci = cisun_in/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else if ( (cisha_in > 0.0_r8) .and. (cisha_in < 1.e30_r8) .and. (forc_pbot_in > 0._r8) .and. (fsun_in .eq. 0._r8) ) then - ci = cisha_in/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else - gamma_ci = 1._r8 - end if - - get_gamma_C = gamma_ci * gamma_ca - - end function get_gamma_C - -end module VOCEmissionMod - - diff --git a/src/biogeochem/ch4FInundatedStreamType.F90 b/src/biogeochem/ch4FInundatedStreamType.F90 deleted file mode 100644 index eb9f743f67..0000000000 --- a/src/biogeochem/ch4FInundatedStreamType.F90 +++ /dev/null @@ -1,393 +0,0 @@ - -module ch4FInundatedStreamType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in finundated streams file for methane code. - ! - ! !USES - use shr_kind_mod , only: r8 => shr_kind_r8, CL => shr_kind_cl - use spmdMod , only: mpicom, masterproc - use clm_varctl , only: iulog - use abortutils , only: endrun - use decompMod , only: bounds_type - use ch4varcon , only: finundation_mtd - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: ch4finundatedstream_type - real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) - real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) - real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcFinundated ! Calculate finundated based on input streams - procedure, public :: UseStreams ! If streams will be used - - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: InitAllocate ! Allocate data - - end type ch4finundatedstream_type - - - ! ! PRIVATE DATA: - - type, private :: streamcontrol_type - character(len=CL) :: stream_fldFileName_ch4finundated ! Filename - character(len=CL) :: ch4finundatedmapalgo ! map algo - character(len=CL) :: fldList ! List of fields to read - contains - procedure, private :: ReadNML ! Read in namelist - end type streamcontrol_type - - type(streamcontrol_type), private :: control ! Stream control data - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine Init(this, bounds, NLFilename) - ! - ! Initialize the ch4 finundated stream object - ! - ! Uses: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar, get_curr_date - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use ndepStreamMod , only : clm_domain_mct - use domainMod , only : ldomain - use decompMod , only : bounds_type, gsmap_lnd_gdc2glo - use mct_mod , only : mct_ggrid, mct_avect_indexra - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use spmdMod , only : comp_id, iam - use ch4varcon , only : finundation_mtd_h2osfc - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! arguments - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: ig, g ! Indices - type(mct_ggrid) :: dom_clm ! domain information - type(shr_strdata_type) :: sdat ! input data stream - integer :: index_ZWT0 = 0 ! Index of ZWT0 field - integer :: index_F0 = 0 ! Index of F0 field - integer :: index_P3 = 0 ! Index of P3 field - integer :: index_FWS_TWS_A = 0 ! Index of FWS_TWS_A field - integer :: index_FWS_TWS_B = 0 ! Index of FWS_TWS_B field - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - character(len=*), parameter :: stream_name = 'ch4finundated' - character(*), parameter :: subName = "('ch4finundatedstream::Init')" - !----------------------------------------------------------------------- - if ( finundation_mtd /= finundation_mtd_h2osfc )then - call this%InitAllocate( bounds ) - call control%ReadNML( bounds, NLFileName ) - - if ( this%useStreams() )then - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name=stream_name,& - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=1996, & - yearLast=1996, & - yearAlign=1, & - offset=0, & - domFilePath='', & - domFileName=trim(control%stream_fldFileName_ch4finundated), & - domTvarName='time', & - domXvarName='LONGXY' , & - domYvarName='LATIXY' , & - domAreaName='AREA', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(control%stream_fldFileName_ch4finundated)/),& - fldListFile=control%fldList, & - fldListModel=control%fldList, & - fillalgo='none', & - mapalgo=control%ch4finundatedmapalgo, & - calendar=get_calendar(), & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(sdat,'CLM '//stream_name//' data') - endif - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - index_ZWT0 = mct_avect_indexra(sdat%avs(1),'ZWT0') - index_F0 = mct_avect_indexra(sdat%avs(1),'F0' ) - index_P3 = mct_avect_indexra(sdat%avs(1),'P3' ) - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - index_FWS_TWS_A = mct_avect_indexra(sdat%avs(1),'FWS_TWS_A') - index_FWS_TWS_B = mct_avect_indexra(sdat%avs(1),'FWS_TWS_B') - end if - - - ! Explicitly set current date to a hardcoded constant value. Otherwise - ! using the real date can cause roundoff differences that are - ! detrected as issues with exact restart. EBK M05/20/2017 - !call get_curr_date(year, mon, day, sec) - year = 1996 - mon = 12 - day = 31 - sec = 0 - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ch4finundated') - - ! Get the data - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if ( index_ZWT0 > 0 )then - this%zwt0_gdc(g) = sdat%avs(1)%rAttr(index_ZWT0,ig) - end if - if ( index_F0 > 0 )then - this%f0_gdc(g) = sdat%avs(1)%rAttr(index_F0,ig) - end if - if ( index_P3 > 0 )then - this%p3_gdc(g) = sdat%avs(1)%rAttr(index_P3,ig) - end if - if ( index_FWS_TWS_A > 0 )then - this%fws_slope_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_A,ig) - end if - if ( index_FWS_TWS_B > 0 )then - this%fws_intercept_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_B,ig) - end if - end do - end if - end if - - end subroutine Init - - !----------------------------------------------------------------------- - logical function UseStreams(this) - ! - ! !DESCRIPTION: - ! Return true if - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - ! - ! !LOCAL VARIABLES: - if ( trim(control%stream_fldFileName_ch4finundated) == '' )then - UseStreams = .false. - else - UseStreams = .true. - end if - end function UseStreams - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begg, endg - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan - allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan - allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan - allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan - end if - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, waterstate_inst, & - qflx_surf_lag_col, finundated ) - ! - ! !DESCRIPTION: - ! - ! Calculate finundated according to the appropriate methodology - ! - ! !USES: - use ColumnType , only : col - use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion - use ch4varcon , only : finundation_mtd_TWS_inversion - use clm_varpar , only : nlevsoi - use SoilHydrologyType, only : soilhydrology_type - use WaterstateType , only : waterstate_type - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of column soil points in column filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) - real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) - ! - ! !LOCAL VARIABLES: - integer :: g, c, fc ! Indices - real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions - - SHR_ASSERT_ALL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(finundated) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - ! Calculate finundated - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - select case( finundation_mtd ) - case ( finundation_mtd_h2osfc ) - finundated(c) = frac_h2osfc(c) - case ( finundation_mtd_ZWT_inversion ) - if (this%zwt0_gdc(g) > 0._r8) then - if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - zwt_actual = zwt_perched(c) - else - zwt_actual = zwt(c) - end if - finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) - else - finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) - end if - case ( finundation_mtd_TWS_inversion ) - finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) - end select - finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) - end do - end associate - - end subroutine CalcFinundated - !============================================================================== - - subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. - ! - ! Uses: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use fileutils , only : getavu, relavu - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! arguments - implicit none - class(streamcontrol_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_fldFileName_ch4finundated = ' ' - character(len=CL) :: ch4finundatedmapalgo = 'bilinear' - character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read - character(len=*), parameter :: shr_strdata_unset = 'NOT_SET' - character(len=*), parameter :: subName = "('ch4finundated::ReadNML')" - character(len=*), parameter :: F00 = "('(ch4finundated_readnml) ',4a)" - !----------------------------------------------------------------------- - - namelist /ch4finundated/ & ! MUST agree with namelist_name above - ch4finundatedmapalgo, stream_fldFileName_ch4finundated - - ! Default values for namelist - - ! Read ch4finundateddyn_nml namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ch4finundated,iostat=nml_error) ! MUST agree with namelist_name above - if (nml_error /= 0) then - call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_fldFileName_ch4finundated, mpicom) - call shr_mpi_bcast(ch4finundatedmapalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) namelist_name, ' stream settings:' - write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated - write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo - write(iulog,*) ' ' - endif - this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated - this%ch4finundatedmapalgo = ch4finundatedmapalgo - if ( finundation_mtd == finundation_mtd_ZWT_inversion )then - this%fldList = "ZWT0:F0:P3" - else if ( finundation_mtd == finundation_mtd_TWS_inversion )then - this%fldList = "FWS_TWS_A:FWS_TWS_B" - else - call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine ReadNML - -end module ch4FInundatedStreamType diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 deleted file mode 100644 index 26dc791f72..0000000000 --- a/src/biogeochem/ch4Mod.F90 +++ /dev/null @@ -1,4197 +0,0 @@ -module ch4Mod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding routines to calculate methane fluxes - ! The driver averages up to gridcell, weighting by finundated, and checks for balance errors. - ! Sources, sinks, "competition" for CH4 & O2, & transport are resolved in ch4_tran. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=), shr_infnan_isnan - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevsoi, ngases, nlevsno, nlevdecomp - use clm_varcon , only : denh2o, denice, tfrz, grav, spval, rgas, grlnd - use clm_varcon , only : catomw, s_con, d_con_w, d_con_g, c_h_inv, kh_theta, kh_tbase - use landunit_varcon , only : istsoil, istcrop, istdlak - use clm_time_manager , only : get_step_size, get_nstep - use clm_varctl , only : iulog, use_cn, use_nitrif_denitrif, use_lch4 - use abortutils , only : endrun - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use CNSharedParamsMod , only : CNParamsShareInst - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use EnergyFluxType , only : energyflux_type - use LakeStateType , only : lakestate_type - use lnd2atmType , only : lnd2atm_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use ch4FInundatedStreamType , only : ch4finundatedstream_type - ! - implicit none - private - - ! Non-tunable constants - real(r8) :: rgasm ! J/mol.K; rgas / 1000; will be set below - real(r8), parameter :: rgasLatm = 0.0821_r8 ! L.atm/mol.K - - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: ch4_init_balance_check - public :: ch4 - - ! !PRIVATE MEMBER FUNCTIONS: - private :: ch4_prod - private :: ch4_oxid - private :: ch4_aere - private :: ch4_ebul - private :: ch4_tran - private :: ch4_annualupdate - private :: ch4_totcolch4 - private :: get_jwt - - type, private :: params_type - ! ch4 production constants - real(r8) :: q10ch4 ! additional Q10 for methane production ABOVE the soil decomposition temperature relationship - real(r8) :: q10ch4base ! temperature at which the effective f_ch4 actually equals the constant f_ch4 - real(r8) :: f_ch4 ! ratio of CH4 production to total C mineralization - real(r8) :: rootlitfrac ! Fraction of soil organic matter associated with roots - real(r8) :: cnscalefactor ! scale factor on CN decomposition for assigning methane flux - real(r8) :: redoxlag ! Number of days to lag in the calculation of finundated_lag - real(r8) :: lake_decomp_fact ! Base decomposition rate (1/s) at 25C - real(r8) :: redoxlag_vertical ! time lag (days) to inhibit production for newly unsaturated layers - real(r8) :: pHmax ! maximum pH for methane production(= 9._r8) - real(r8) :: pHmin ! minimum pH for methane production(= 2.2_r8) - real(r8) :: oxinhib ! inhibition of methane production by oxygen (m^3/mol) - - ! ch4 oxidation constants - real(r8) :: vmax_ch4_oxid ! oxidation rate constant (= 45.e-6_r8 * 1000._r8 / 3600._r8) [mol/m3-w/s]; - real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration - real(r8) :: q10_ch4oxid ! Q10 oxidation constant - real(r8) :: smp_crit ! Critical soil moisture potential - real(r8) :: k_m_o2 ! Michaelis-Menten oxidation rate constant for O2 concentration - real(r8) :: k_m_unsat ! Michaelis-Menten oxidation rate constant for CH4 concentration - real(r8) :: vmax_oxid_unsat ! (= 45.e-6_r8 * 1000._r8 / 3600._r8 / 10._r8) [mol/m3-w/s] - - ! ch4 aerenchyma constants - real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere that will be - - ! oxidized rather than emitted - real(r8) :: scale_factor_aere ! scale factor on the aerenchyma area for sensitivity tests - real(r8) :: nongrassporosratio ! Ratio of root porosity in non-grass to grass, used for aerenchyma transport - real(r8) :: unsat_aere_ratio ! Ratio to multiply upland vegetation aerenchyma porosity by compared to inundated systems (= 0.05_r8 / 0.3_r8) - real(r8) :: porosmin ! minimum aerenchyma porosity (unitless)(= 0.05_r8) - - ! ch4 ebbulition constants - real(r8) :: vgc_max ! ratio of saturation pressure triggering ebullition - - ! ch4 transport constants - real(r8) :: satpow ! exponent on watsat for saturated soil solute diffusion - real(r8) :: scale_factor_gasdiff ! For sensitivity tests; convection would allow this to be > 1 - real(r8) :: scale_factor_liqdiff ! For sensitivity tests; convection would allow this to be > 1 - real(r8) :: capthick ! min thickness before assuming h2osfc is impermeable (mm) (= 100._r8) - - ! additional constants - real(r8) :: f_sat ! volumetric soil water defining top of water table or where production is allowed (=0.95) - real(r8) :: qflxlagd ! days to lag qflx_surf_lag in the tropics (days) ( = 30._r8) - real(r8) :: highlatfact ! multiple of qflxlagd for high latitudes (= 2._r8) - real(r8) :: q10lakebase ! (K) base temperature for lake CH4 production (= 298._r8) - real(r8) :: atmch4 ! Atmospheric CH4 mixing ratio to prescribe if not provided by the atmospheric model (= 1.7e-6_r8) (mol/mol) - real(r8) :: rob ! ratio of root length to vertical depth ("root obliquity") (= 3._r8) - end type params_type - type(params_type), private :: params_inst - - type, public :: ch4_type - real(r8), pointer, private :: ch4_prod_depth_sat_col (:,:) ! col CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_prod_depth_unsat_col (:,:) ! col CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_prod_depth_lake_col (:,:) ! col CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_oxid_depth_sat_col (:,:) ! col CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_oxid_depth_unsat_col (:,:) ! col CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_oxid_depth_lake_col (:,:) ! col CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_aere_depth_sat_col (:,:) ! col CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_aere_depth_unsat_col (:,:) ! col CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_tran_depth_sat_col (:,:) ! col CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_tran_depth_unsat_col (:,:) ! col CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_ebul_depth_sat_col (:,:) ! col CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_ebul_depth_unsat_col (:,:) ! col CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: ch4_ebul_total_sat_col (:) ! col Total col CH4 ebullition (mol/m2/s) - real(r8), pointer, private :: ch4_ebul_total_unsat_col (:) ! col Total col CH4 ebullition (mol/m2/s) - real(r8), pointer, private :: ch4_surf_aere_sat_col (:) ! col CH4 aerenchyma flux to atmosphere (after oxidation) (mol/m2/s) - real(r8), pointer, private :: ch4_surf_aere_unsat_col (:) ! col CH4 aerenchyma flux to atmosphere (after oxidation) (mol/m2/s) - real(r8), pointer, private :: ch4_surf_ebul_sat_col (:) ! col CH4 ebullition flux to atmosphere (after oxidation) (mol/m2/s) - real(r8), pointer, private :: ch4_surf_ebul_unsat_col (:) ! col CH4 ebullition flux to atmosphere (after oxidation) (mol/m2/s) - real(r8), pointer, private :: ch4_surf_ebul_lake_col (:) ! col CH4 ebullition flux to atmosphere (after oxidation) (mol/m2/s) - real(r8), pointer, private :: co2_aere_depth_sat_col (:,:) ! col CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: co2_aere_depth_unsat_col (:,:) ! col CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: o2_oxid_depth_sat_col (:,:) ! col O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: o2_oxid_depth_unsat_col (:,:) ! col O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: o2_aere_depth_sat_col (:,:) ! col O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: o2_aere_depth_unsat_col (:,:) ! col O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: co2_decomp_depth_sat_col (:,:) ! col CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - real(r8), pointer, private :: co2_decomp_depth_unsat_col (:,:) ! col CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - real(r8), pointer, private :: co2_oxid_depth_sat_col (:,:) ! col CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: co2_oxid_depth_unsat_col (:,:) ! col CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - real(r8), pointer, private :: conc_o2_lake_col (:,:) ! col O2 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, private :: conc_ch4_sat_col (:,:) ! col CH4 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, private :: conc_ch4_unsat_col (:,:) ! col CH4 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, private :: conc_ch4_lake_col (:,:) ! col CH4 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, private :: ch4_surf_diff_sat_col (:) ! col CH4 surface flux (mol/m2/s) - real(r8), pointer, private :: ch4_surf_diff_unsat_col (:) ! col CH4 surface flux (mol/m2/s) - real(r8), pointer, private :: ch4_surf_diff_lake_col (:) ! col CH4 surface flux (mol/m2/s) - real(r8), pointer, private :: ch4_dfsat_flux_col (:) ! col CH4 flux to atm due to decreasing fsat (kg C/m^2/s) [+] - - real(r8), pointer, private :: zwt_ch4_unsat_col (:) ! col depth of water table for unsaturated fraction (m) - real(r8), pointer, private :: lake_soilc_col (:,:) ! col total soil organic matter found in level (g C / m^3) (nlevsoi) - real(r8), pointer, private :: totcolch4_col (:) ! col total methane found in soil col (g C / m^2) - real(r8), pointer, private :: totcolch4_bef_col (:) ! col total methane found in soil col, start of timestep (g C / m^2) - real(r8), pointer, private :: annsum_counter_col (:) ! col seconds since last annual accumulator turnover - real(r8), pointer, private :: tempavg_somhr_col (:) ! col temporary average SOM heterotrophic resp. (gC/m2/s) - real(r8), pointer, private :: annavg_somhr_col (:) ! col annual average SOM heterotrophic resp. (gC/m2/s) - real(r8), pointer, private :: tempavg_finrw_col (:) ! col respiration-weighted annual average of finundated - real(r8), pointer, private :: annavg_finrw_col (:) ! col respiration-weighted annual average of finundated - real(r8), pointer, private :: sif_col (:) ! col (unitless) ratio applied to sat. prod. to account for seasonal inundation - real(r8), pointer, private :: ch4stress_unsat_col (:,:) ! col Ratio of methane available to the total per-timestep methane sinks (nlevsoi) - real(r8), pointer, private :: ch4stress_sat_col (:,:) ! col Ratio of methane available to the total per-timestep methane sinks (nlevsoi) - real(r8), pointer, private :: qflx_surf_lag_col (:) ! col time-lagged surface runoff (mm H2O /s) - real(r8), pointer, private :: finundated_lag_col (:) ! col time-lagged fractional inundated area - real(r8), pointer, private :: layer_sat_lag_col (:,:) ! col Lagged saturation status of soil layer in the unsaturated zone (1 = sat) - real(r8), pointer, private :: zwt0_col (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: f0_col (:) ! col maximum inundated fraction for a gridcell (for methane code) - real(r8), pointer, private :: p3_col (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: pH_col (:) ! col pH values for methane production - ! - real(r8), pointer, private :: dyn_ch4bal_adjustments_col (:) ! adjustments to each column made in this timestep via dynamic column area adjustments (only makes sense at the column-level: meaningless if averaged to the gridcell-level) (g C / m^2) - ! - real(r8), pointer, private :: c_atm_grc (:,:) ! grc atmospheric conc of CH4, O2, CO2 (mol/m3) - real(r8), pointer, private :: ch4co2f_grc (:) ! grc CO2 production from CH4 oxidation (g C/m**2/s) - real(r8), pointer, private :: ch4prodg_grc (:) ! grc average CH4 production (g C/m^2/s) - ! - ! for aerenchyma calculations - real(r8), pointer, private :: annavg_agnpp_patch (:) ! patch (gC/m2/s) annual average aboveground NPP - real(r8), pointer, private :: annavg_bgnpp_patch (:) ! patch (gC/m2/s) annual average belowground NPP - real(r8), pointer, private :: tempavg_agnpp_patch (:) ! patch (gC/m2/s) temp. average aboveground NPP - real(r8), pointer, private :: tempavg_bgnpp_patch (:) ! patch (gC/m2/s) temp. average belowground NPP - ! - ! The following variable reports whether this is the first timestep that includes - ! ch4. It is true in the first timestep of the run, and remains true until the - ! methane code is first run - at which point it becomes false, and remains - ! false. This could be a scalar, but scalars cause problems with threading, so we use - ! a column-level array (column-level for convenience, because it is referenced in - ! column-level loops). - logical , pointer, private :: ch4_first_time_col (:) ! col whether this is the first time step that includes ch4 - ! - real(r8), pointer, public :: finundated_col (:) ! col fractional inundated area (excluding dedicated wetland cols) - real(r8), pointer, public :: finundated_pre_snow_col (:) ! col fractional inundated area (excluding dedicated wetland cols) before snow - real(r8), pointer, public :: o2stress_unsat_col (:,:) ! col Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - real(r8), pointer, public :: o2stress_sat_col (:,:) ! col Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - real(r8), pointer, public :: conc_o2_sat_col (:,:) ! col O2 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, public :: conc_o2_unsat_col (:,:) ! col O2 conc in each soil layer (mol/m3) (nlevsoi) - real(r8), pointer, public :: o2_decomp_depth_sat_col (:,:) ! col O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - real(r8), pointer, public :: o2_decomp_depth_unsat_col (:,:) ! col O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - real(r8), pointer, public :: ch4_surf_flux_tot_col (:) ! col CH4 surface flux (to atm) (kg C/m**2/s) - - real(r8), pointer, public :: grnd_ch4_cond_patch (:) ! patch tracer conductance for boundary layer [m/s] - real(r8), pointer, public :: grnd_ch4_cond_col (:) ! col tracer conductance for boundary layer [m/s] - type(ch4finundatedstream_type), private :: ch4findstream ! ch4 finundated stream data - - contains - - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: Restart - procedure, public :: DynamicColumnAdjustments ! adjust state variables when column areas change - - end type ch4_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init( this, bounds, cellorg_col, fsurdat, NLFilename ) - - class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds - real(r8) , intent(in) :: cellorg_col (bounds%begc:, 1:) - character(len=*) , intent(in) :: fsurdat ! surface data file name - character(len=*), intent(in) :: NLFilename ! Namelist filename - - call this%InitAllocate (bounds) - if (use_lch4) then - call this%InitHistory (bounds) - call this%InitCold (bounds, cellorg_col, fsurdat) - call this%ch4findstream%Init( bounds, NLFilename ) - end if - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use clm_varpar , only: nlevgrnd - ! - ! !ARGUMENTS: - class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%ch4_prod_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4_prod_depth_sat_col (:,:) = nan - allocate(this%ch4_prod_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4_prod_depth_unsat_col (:,:) = nan - allocate(this%ch4_prod_depth_lake_col (begc:endc,1:nlevgrnd)) ; this%ch4_prod_depth_lake_col (:,:) = nan - allocate(this%ch4_oxid_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4_oxid_depth_sat_col (:,:) = nan - allocate(this%ch4_oxid_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4_oxid_depth_unsat_col (:,:) = nan - allocate(this%ch4_oxid_depth_lake_col (begc:endc,1:nlevgrnd)) ; this%ch4_oxid_depth_lake_col (:,:) = nan - allocate(this%o2_oxid_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%o2_oxid_depth_sat_col (:,:) = nan - allocate(this%o2_oxid_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2_oxid_depth_unsat_col (:,:) = nan - allocate(this%o2_aere_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%o2_aere_depth_sat_col (:,:) = nan - allocate(this%o2_aere_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2_aere_depth_unsat_col (:,:) = nan - allocate(this%co2_decomp_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%co2_decomp_depth_sat_col (:,:) = nan - allocate(this%co2_decomp_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%co2_decomp_depth_unsat_col (:,:) = nan - allocate(this%co2_oxid_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%co2_oxid_depth_sat_col (:,:) = nan - allocate(this%co2_oxid_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%co2_oxid_depth_unsat_col (:,:) = nan - allocate(this%ch4_aere_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4_aere_depth_sat_col (:,:) = nan - allocate(this%ch4_aere_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4_aere_depth_unsat_col (:,:) = nan - allocate(this%ch4_tran_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4_tran_depth_sat_col (:,:) = nan - allocate(this%ch4_tran_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4_tran_depth_unsat_col (:,:) = nan - allocate(this%co2_aere_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%co2_aere_depth_sat_col (:,:) = nan - allocate(this%co2_aere_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%co2_aere_depth_unsat_col (:,:) = nan - allocate(this%ch4_surf_aere_sat_col (begc:endc)) ; this%ch4_surf_aere_sat_col (:) = nan - allocate(this%ch4_surf_aere_unsat_col (begc:endc)) ; this%ch4_surf_aere_unsat_col (:) = nan - allocate(this%ch4_ebul_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4_ebul_depth_sat_col (:,:) = nan - allocate(this%ch4_ebul_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4_ebul_depth_unsat_col (:,:) = nan - allocate(this%ch4_ebul_total_sat_col (begc:endc)) ; this%ch4_ebul_total_sat_col (:) = nan - allocate(this%ch4_ebul_total_unsat_col (begc:endc)) ; this%ch4_ebul_total_unsat_col (:) = nan - allocate(this%ch4_surf_ebul_sat_col (begc:endc)) ; this%ch4_surf_ebul_sat_col (:) = nan - allocate(this%ch4_surf_ebul_unsat_col (begc:endc)) ; this%ch4_surf_ebul_unsat_col (:) = nan - allocate(this%ch4_surf_ebul_lake_col (begc:endc)) ; this%ch4_surf_ebul_lake_col (:) = nan - allocate(this%conc_ch4_sat_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_sat_col (:,:) = spval ! detect file input - allocate(this%conc_ch4_unsat_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_unsat_col (:,:) = spval ! detect file input - allocate(this%conc_ch4_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_lake_col (:,:) = nan - allocate(this%ch4_surf_diff_sat_col (begc:endc)) ; this%ch4_surf_diff_sat_col (:) = nan - allocate(this%ch4_surf_diff_unsat_col (begc:endc)) ; this%ch4_surf_diff_unsat_col (:) = nan - allocate(this%ch4_surf_diff_lake_col (begc:endc)) ; this%ch4_surf_diff_lake_col (:) = nan - allocate(this%conc_o2_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_lake_col (:,:) = nan - allocate(this%ch4_dfsat_flux_col (begc:endc)) ; this%ch4_dfsat_flux_col (:) = nan - allocate(this%zwt_ch4_unsat_col (begc:endc)) ; this%zwt_ch4_unsat_col (:) = nan - allocate(this%lake_soilc_col (begc:endc,1:nlevgrnd)) ; this%lake_soilc_col (:,:) = spval !first time-step - allocate(this%totcolch4_col (begc:endc)) ; this%totcolch4_col (:) = nan - allocate(this%totcolch4_bef_col (begc:endc)) ; this%totcolch4_bef_col (:) = nan - allocate(this%annsum_counter_col (begc:endc)) ; this%annsum_counter_col (:) = nan - allocate(this%tempavg_somhr_col (begc:endc)) ; this%tempavg_somhr_col (:) = nan - allocate(this%annavg_somhr_col (begc:endc)) ; this%annavg_somhr_col (:) = nan - allocate(this%tempavg_finrw_col (begc:endc)) ; this%tempavg_finrw_col (:) = nan - allocate(this%annavg_finrw_col (begc:endc)) ; this%annavg_finrw_col (:) = nan - allocate(this%sif_col (begc:endc)) ; this%sif_col (:) = nan - allocate(this%ch4stress_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4stress_unsat_col (:,:) = nan - allocate(this%ch4stress_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4stress_sat_col (:,:) = nan - allocate(this%qflx_surf_lag_col (begc:endc)) ; this%qflx_surf_lag_col (:) = nan - allocate(this%finundated_lag_col (begc:endc)) ; this%finundated_lag_col (:) = nan - allocate(this%layer_sat_lag_col (begc:endc,1:nlevgrnd)) ; this%layer_sat_lag_col (:,:) = nan - allocate(this%zwt0_col (begc:endc)) ; this%zwt0_col (:) = nan - allocate(this%f0_col (begc:endc)) ; this%f0_col (:) = nan - allocate(this%p3_col (begc:endc)) ; this%p3_col (:) = nan - allocate(this%pH_col (begc:endc)) ; this%pH_col (:) = nan - allocate(this%ch4_surf_flux_tot_col (begc:endc)) ; this%ch4_surf_flux_tot_col (:) = nan - allocate(this%dyn_ch4bal_adjustments_col (begc:endc)) ; this%dyn_ch4bal_adjustments_col (:) = nan - - allocate(this%c_atm_grc (begg:endg,1:ngases)) ; this%c_atm_grc (:,:) = nan - allocate(this%ch4co2f_grc (begg:endg)) ; this%ch4co2f_grc (:) = nan - allocate(this%ch4prodg_grc (begg:endg)) ; this%ch4prodg_grc (:) = nan - - allocate(this%tempavg_agnpp_patch (begp:endp)) ; this%tempavg_agnpp_patch (:) = nan - allocate(this%tempavg_bgnpp_patch (begp:endp)) ; this%tempavg_bgnpp_patch (:) = nan - allocate(this%annavg_agnpp_patch (begp:endp)) ; this%annavg_agnpp_patch (:) = spval ! To detect first year - allocate(this%annavg_bgnpp_patch (begp:endp)) ; this%annavg_bgnpp_patch (:) = spval ! To detect first year - - allocate(this%ch4_first_time_col (begc:endc)) ; this%ch4_first_time_col (:) = .true. - - allocate(this%finundated_col (begc:endc)) ; this%finundated_col (:) = nan - allocate(this%finundated_pre_snow_col (begc:endc)) ; this%finundated_pre_snow_col (:) = nan - allocate(this%o2stress_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_unsat_col (:,:) = nan - allocate(this%o2stress_sat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_sat_col (:,:) = nan - allocate(this%conc_o2_sat_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_sat_col (:,:) = nan - allocate(this%conc_o2_unsat_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_unsat_col (:,:) = nan - allocate(this%o2_decomp_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%o2_decomp_depth_sat_col (:,:) = nan - allocate(this%o2_decomp_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2_decomp_depth_unsat_col (:,:) = nan - allocate(this%ch4_surf_flux_tot_col (begc:endc)) ; this%ch4_surf_flux_tot_col (:) = nan - - allocate(this%grnd_ch4_cond_patch (begp:endp)) ; this%grnd_ch4_cond_patch (:) = nan - allocate(this%grnd_ch4_cond_col (begc:endc)) ; this%grnd_ch4_cond_col (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use clm_varpar , only : nlevgrnd, nlevdecomp - use clm_varctl , only : hist_wrtch4diag - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - use ch4varcon , only : allowlakeprod - ! - ! !ARGUMENTS: - class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - character(8) :: vr_suffix - character(10) :: active - integer :: begc,endc - integer :: begg,endg - real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - if (hist_wrtch4diag) then - active = "active" - else - active = "inactive" - end if - - this%finundated_col(begc:endc) = spval - ! Using l2g_scale_type='veg' to exclude values in special landunits, which can change - ! from dynamic column adjustments (also want to exclude lakes here, for which - ! finundated is implicitly 1). - call hist_addfld1d (fname='FINUNDATED', units='unitless', & - avgflag='A', long_name='fractional inundated area of vegetated columns', & - ptr_col=this%finundated_col, l2g_scale_type='veg') - - this%finundated_lag_col(begc:endc) = spval - ! Using l2g_scale_type='veg' to exclude values in special landunits, which can change - ! from dynamic column adjustments (also want to exclude lakes here, for which - ! finundated is implicitly 1). - call hist_addfld1d (fname='FINUNDATED_LAG', units='unitless', & - avgflag='A', long_name='time-lagged inundated fraction of vegetated columns', & - ptr_col=this%finundated_lag_col, l2g_scale_type='veg', default='inactive') - - this%ch4_surf_diff_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_DIFF_SAT', units='mol/m2/s', & - avgflag='A', long_name='diffusive surface CH4 flux for inundated / lake area; (+ to atm)', & - ptr_col=this%ch4_surf_diff_sat_col) - - this%ch4_surf_diff_unsat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_DIFF_UNSAT', units='mol/m2/s', & - avgflag='A', long_name='diffusive surface CH4 flux for non-inundated area; (+ to atm)', & - ptr_col=this%ch4_surf_diff_unsat_col) - - this%ch4_ebul_total_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_EBUL_TOTAL_SAT', units='mol/m2/s', & - avgflag='A', long_name='ebullition surface CH4 flux; (+ to atm)', & - ptr_col=this%ch4_ebul_total_sat_col, default='inactive') - - this%ch4_ebul_total_unsat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_EBUL_TOTAL_UNSAT', units='mol/m2/s', & - avgflag='A', long_name='ebullition surface CH4 flux; (+ to atm)', & - ptr_col=this%ch4_ebul_total_unsat_col, default='inactive') - - this%ch4_surf_ebul_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_EBUL_SAT', units='mol/m2/s', & - avgflag='A', long_name='ebullition surface CH4 flux for inundated / lake area; (+ to atm)', & - ptr_col=this%ch4_surf_ebul_sat_col) - - this%ch4_surf_ebul_unsat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_EBUL_UNSAT', units='mol/m2/s', & - avgflag='A', long_name='ebullition surface CH4 flux for non-inundated area; (+ to atm)', & - ptr_col=this%ch4_surf_ebul_unsat_col) - - this%ch4_surf_aere_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_AERE_SAT', units='mol/m2/s', & - avgflag='A', long_name='aerenchyma surface CH4 flux for inundated area; (+ to atm)', & - ptr_col=this%ch4_surf_aere_sat_col) - - this%ch4_surf_aere_unsat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_AERE_UNSAT', units='mol/m2/s', & - avgflag='A', long_name='aerenchyma surface CH4 flux for non-inundated area; (+ to atm)', & - ptr_col=this%ch4_surf_aere_unsat_col) - - this%totcolch4_col(begc:endc) = spval - ! Unlike other ch4 diagnostic fields, TOTCOLCH4 includes all landunits. Values will - ! typically be 0 for non-lake special landunits, but may be non-zero due to the state - ! adjustments from dynamic landunits. - call hist_addfld1d (fname='TOTCOLCH4', units='gC/m2', & - avgflag='A', & - long_name='total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits)', & - ptr_col=this%totcolch4_col) - - this%conc_ch4_sat_col(begc:endc,1:nlevgrnd) = spval - ! Using l2g_scale_type='veg_plus_lake' to exclude mass in non-lake special landunits, - ! which can arise from dynamic column adjustments - call hist_addfld2d (fname='CONC_CH4_SAT', units='mol/m3', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil Concentration for inundated / lake area', & - ptr_col=this%conc_ch4_sat_col, l2g_scale_type='veg_plus_lake', default='inactive') - - this%conc_ch4_unsat_col(begc:endc,1:nlevgrnd) = spval - ! Using l2g_scale_type='veg' to exclude mass in special landunits, which can arise - ! from dynamic column adjustments. (We also exclude lakes here, because they don't - ! have any unsaturated area.) - call hist_addfld2d (fname='CONC_CH4_UNSAT', units='mol/m3', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil Concentration for non-inundated area', & - ptr_col=this%conc_ch4_unsat_col, l2g_scale_type='veg', default='inactive') - - if (hist_wrtch4diag) then - this%ch4_prod_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_PROD_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil production for inundated / lake area', & - ptr_col=this%ch4_prod_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_prod_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_PROD_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil production for non-inundated area', & - ptr_col=this%ch4_prod_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_oxid_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_OXID_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil oxidation for inundated / lake area', & - ptr_col=this%ch4_oxid_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_oxid_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_OXID_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil oxidation for non-inundated area', & - ptr_col=this%ch4_oxid_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_aere_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_AERE_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil aerenchyma loss for inundated / lake area '// & - ' (including transpiration flux if activated)', & - ptr_col=this%ch4_aere_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_aere_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_AERE_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil aerenchyma loss for non-inundated area '// & - ' (including transpiration flux if activated)', & - ptr_col=this%ch4_aere_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - this%o2_aere_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='O2_AERE_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='O2 aerenchyma diffusion into soil for inundated / lake area', & - ptr_col=this%o2_aere_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%o2_aere_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='O2_AERE_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='O2 aerenchyma diffusion into soil for non-inundated area', & - ptr_col=this%o2_aere_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - call hist_addfld2d (fname='O2_DECOMP_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='O2 consumption from HR and AR for inundated / lake area', & - ptr_col=this%o2_decomp_depth_sat_col) - end if - - this%o2_decomp_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='O2_DECOMP_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='O2 consumption from HR and AR for non-inundated area', & - ptr_col=this%o2_decomp_depth_unsat_col, default=active) - - if (hist_wrtch4diag) then - this%ch4_tran_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_TRAN_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil loss from transpiration for inundated / lake area', & - ptr_col=this%ch4_tran_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_tran_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_TRAN_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil loss from transpiration for non-inundated area', & - ptr_col=this%ch4_tran_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_ebul_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_EBUL_DEPTH_SAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil ebullition for inundated / lake area', & - ptr_col=this%ch4_ebul_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%ch4_ebul_depth_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_EBUL_DEPTH_UNSAT', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 soil ebullition for non-inundated area', & - ptr_col=this%ch4_ebul_depth_unsat_col) - end if - - if (hist_wrtch4diag) then - this%o2stress_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='O2STRESS_SAT', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='Ratio of oxygen available to demanded for non-inundated area', & - ptr_col=this%o2stress_sat_col) - end if - - if (hist_wrtch4diag) then - this%o2stress_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='O2STRESS_UNSAT', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='Ratio of oxygen available to demanded for inundated / lake area', & - ptr_col=this%o2stress_unsat_col) - end if - - if (hist_wrtch4diag) then - this%ch4stress_unsat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4STRESS_UNSAT', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='Ratio of methane available to total potential sink for inundated / lake area', & - ptr_col=this%ch4stress_unsat_col) - end if - - if (hist_wrtch4diag) then - this%ch4stress_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4STRESS_SAT', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='Ratio of methane available to total potential sink for non-inundated area', & - ptr_col=this%ch4stress_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%ch4_prod_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_PROD_DEPTH_LAKE', units='mol/m3/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 production in each soil layer, lake col. only', & - ptr_col=this%ch4_prod_depth_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%conc_ch4_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CONC_CH4_LAKE', units='mol/m3', type2d='levgrnd', & - avgflag='A', long_name='CH4 Concentration each soil layer, lake col. only', & - ptr_col=this%conc_ch4_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%conc_o2_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CONC_O2_LAKE', units='mol/m3', type2d='levgrnd', & - avgflag='A', long_name='O2 Concentration each soil layer, lake col. only', & - ptr_col=this%conc_o2_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%ch4_surf_diff_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_DIFF_LAKE', units='mol/m2/s', & - avgflag='A', long_name='diffusive surface CH4 flux, lake col. only (+ to atm)', & - ptr_col=this%ch4_surf_diff_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%ch4_surf_ebul_sat_col(begc:endc) = spval - call hist_addfld1d (fname='CH4_SURF_EBUL_LAKE', units='mol/m2/s', & - avgflag='A', long_name='ebullition surface CH4 flux, lake col. only (+ to atm)', & - ptr_col=this%ch4_surf_ebul_sat_col) - end if - - if (hist_wrtch4diag .and. allowlakeprod) then - this%ch4_oxid_depth_sat_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='CH4_OXID_DEPTH_LAKE', units='mol/m2/s', type2d='levgrnd', & - avgflag='A', long_name='CH4 oxidation in each soil layer, lake col. only', & - ptr_col=this%ch4_oxid_depth_sat_col) - end if - - if (hist_wrtch4diag) then - this%layer_sat_lag_col(begc:endc,1:nlevgrnd) = spval - ! Using l2g_scale_type='veg' to exclude mass in special landunits, which can arise - ! from dynamic column adjustments. (We also exclude lakes here, because they don't - ! have any unsaturated area.) - call hist_addfld2d (fname='LAYER_SAT_LAG', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='lagged saturation status of layer in unsat. zone', & - ptr_col=this%layer_sat_lag_col, l2g_scale_type='veg') - end if - - if (hist_wrtch4diag) then - this%annavg_finrw_col(begc:endc) = spval - call hist_addfld1d (fname='ANNAVG_FINRW', units='unitless', & - avgflag='A', long_name='annual average respiration-weighted FINUNDATED', & - ptr_col=this%annavg_finrw_col) - end if - - if (hist_wrtch4diag) then - this%sif_col(begc:endc) = spval - call hist_addfld1d (fname='SIF', units='unitless', & - avgflag='A', long_name='seasonal inundation factor calculated for sat. CH4 prod. (non-lake)', & - ptr_col=this%sif_col) - end if - - this%conc_o2_sat_col(begc:endc,1:nlevgrnd) = spval - ! Using l2g_scale_type='veg_plus_lake' to exclude mass in non-lake special landunits, - ! which can arise from dynamic column adjustments - data2dptr => this%conc_o2_sat_col(:,1:nlevsoi) - call hist_addfld2d (fname='CONC_O2_SAT', units='mol/m3', type2d='levsoi', & - avgflag='A', long_name='O2 soil Concentration for inundated / lake area', & - ptr_col=data2dptr, l2g_scale_type='veg_plus_lake') - - this%conc_o2_unsat_col(begc:endc,1:nlevgrnd) = spval - ! Using l2g_scale_type='veg' to exclude mass in special landunits, which can arise - ! from dynamic column adjustments. (We also exclude lakes here, because they don't - ! have any unsaturated area.) - data2dptr => this%conc_o2_unsat_col(:,1:nlevsoi) - call hist_addfld2d (fname='CONC_O2_UNSAT', units='mol/m3', type2d='levsoi', & - avgflag='A', long_name='O2 soil Concentration for non-inundated area', & - ptr_col=data2dptr, l2g_scale_type='veg') - - this%ch4co2f_grc(begg:endg) = spval - call hist_addfld1d (fname='FCH4TOCO2', units='gC/m2/s', & - avgflag='A', long_name='Gridcell oxidation of CH4 to CO2', & - ptr_lnd=this%ch4co2f_grc) - - this%ch4prodg_grc(begg:endg) = spval - call hist_addfld1d (fname='CH4PROD', units='gC/m2/s', & - avgflag='A', long_name='Gridcell total production of CH4', & - ptr_lnd=this%ch4prodg_grc) - - this%ch4_dfsat_flux_col(begc:endc) = spval - call hist_addfld1d (fname='FCH4_DFSAT', units='kgC/m2/s', & - avgflag='A', long_name='CH4 additional flux due to changing fsat, vegetated landunits only', & - ptr_col=this%ch4_dfsat_flux_col) - - this%zwt_ch4_unsat_col(begc:endc) = spval - call hist_addfld1d (fname='ZWT_CH4_UNSAT', units='m', & - avgflag='A', long_name='depth of water table for methane production used in non-inundated area', & - ptr_col=this%zwt_ch4_unsat_col) - - this%qflx_surf_lag_col(begc:endc) = spval - call hist_addfld1d (fname='QOVER_LAG', units='mm/s', & - avgflag='A', long_name='time-lagged surface runoff for soil columns', & - ptr_col=this%qflx_surf_lag_col, default='inactive') - - if (allowlakeprod) then - this%lake_soilc_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld2d (fname='LAKE_SOILC', units='gC/m3', type2d='levgrnd', & - avgflag='A', long_name='Soil carbon under lakes', & - ptr_col=this%lake_soilc_col) - end if - - this%grnd_ch4_cond_col(begc:endc) = spval - call hist_addfld1d (fname='WTGQ', units='m/s', & - avgflag='A', long_name='surface tracer conductance', & - ptr_col=this%grnd_ch4_cond_col) - - this%dyn_ch4bal_adjustments_col(begc:endc) = spval - call hist_addfld1d (fname='DYN_COL_ADJUSTMENTS_CH4', units='gC/m^2', & - avgflag='SUM', & - long_name='Adjustments in ch4 due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_ch4bal_adjustments_col, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, cellorg_col, fsurdat) - ! - ! !DESCRIPTION: - ! - Sets cold start values for time varying values. - ! Initializes the following time varying variables: - ! conc_ch4_sat, conc_ch4_unsat, conc_o2_sat, conc_o2_unsat, - ! lake_soilc, o2stress, finunduated - ! - Sets variables for ch4 code that will not be input - ! from restart/inic file. - ! - Sets values for inactive CH4 columns to spval so that they will - ! not be averaged in history file. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp - use landunit_varcon , only : istsoil, istdlak, istcrop - use clm_varctl , only : iulog - use ch4varcon , only : allowlakeprod, usephfact, finundation_mtd - use ch4varcon , only : finundation_mtd_ZWT_inversion - use spmdMod , only : masterproc - use fileutils , only : getfil - use ncdio_pio - ! - ! !ARGUMENTS: - class(ch4_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: cellorg_col (bounds%begc:, 1:) - character(len=*) , intent(in) :: fsurdat ! surface data file name - ! - ! !LOCAL VARIABLES: - integer :: j ,g, l,c,p ! indices - type(file_desc_t) :: ncid ! netcdf id - real(r8) ,pointer :: zwt0_in (:) ! read in - zwt0 - real(r8) ,pointer :: f0_in (:) ! read in - f0 - real(r8) ,pointer :: p3_in (:) ! read in - p3 - real(r8) ,pointer :: pH_in (:) ! read in - pH - character(len=256) :: locfn ! local file name - logical :: readvar ! If read variable from file or not - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cellorg_col) == (/bounds%endc, nlevsoi/)), errMsg(sourcefile, __LINE__)) - - !---------------------------------------- - ! Initialize time constant variables - !---------------------------------------- - - allocate(zwt0_in (bounds%begg:bounds%endg)) - allocate(f0_in (bounds%begg:bounds%endg)) - allocate(p3_in (bounds%begg:bounds%endg)) - if (usephfact) allocate(ph_in(bounds%begg:bounds%endg)) - - ! Methane code parameters for finundated - - call getfil( fsurdat, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - if ( finundation_mtd == finundation_mtd_zwt_inversion ) then - call ncd_io(ncid=ncid, varname='ZWT0', flag='read', data=zwt0_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but ZWT0 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='F0', flag='read', data=f0_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but F0 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='P3', flag='read', data=p3_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Running with CH4 Model but P3 not on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - ! pH factor for methane model - if (usephfact) then - call ncd_io(ncid=ncid, varname='PH', flag='read', data=ph_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: CH4 pH production factor activated in ch4par_in'//& - 'but pH is not on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - end if - call ncd_pio_closefile(ncid) - - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - - if (finundation_mtd == finundation_mtd_ZWT_inversion ) then - this%zwt0_col(c) = zwt0_in(g) - this%f0_col(c) = f0_in(g) - this%p3_col(c) = p3_in(g) - end if - if (usephfact) this%pH_col(c) = pH_in(g) - end do - - deallocate(zwt0_in, f0_in, p3_in) - if (usephfact) deallocate(pH_in) - - !---------------------------------------- - ! Initialize time varying variables - !---------------------------------------- - - if ( masterproc ) write (iulog,*) 'Setting initial data to non-spun up values for CH4 Mod' - - do c = bounds%begc,bounds%endc - - ! To detect first year - this%annavg_somhr_col(c) = spval - this%annavg_finrw_col(c) = spval - - ! To detect file input - this%qflx_surf_lag_col (c) = spval - this%o2stress_sat_col (c,:) = spval - this%o2stress_unsat_col (c,:) = spval - this%ch4stress_sat_col (c,:) = spval - this%ch4stress_unsat_col(c,:) = spval - this%lake_soilc_col (c,:) = spval - - ! The following variables need to be initialized for all columns, for the sake of - ! DynamicColumnAdjustments - ! - ! TODO(wjs, 2016-02-11) Should the initial value of finundated depend on landunit - ! type? I am setting it to 1, because that's the appropriate value for lakes (and - ! probably other landunits, like wetlands and glaciers) - but this may not be - ! appropriate for urban. (The setting here should agree with the setting of - ! finundated_col where it was spval in subroutine Restart.) Note that - ! finundated_col is overwritten for istsoil / istcrop below. - this%finundated_col(c) = 1._r8 - this%finundated_pre_snow_col(c) = 1._r8 - this%finundated_lag_col(c) = 1._r8 - this%layer_sat_lag_col (c,1:nlevsoi) = 1._r8 - this%conc_ch4_sat_col (c,1:nlevsoi) = 0._r8 - this%conc_ch4_unsat_col (c,1:nlevsoi) = 0._r8 - this%conc_o2_sat_col (c,1:nlevsoi) = 0._r8 - this%conc_o2_unsat_col (c,1:nlevsoi) = 0._r8 - - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop .or. & - lun%itype(l) == istdlak) then - this%annsum_counter_col(c) = 0._r8 - this%tempavg_somhr_col(c) = 0._r8 - this%tempavg_finrw_col(c) = 0._r8 - end if - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - this%o2stress_sat_col (c,1:nlevsoi) = 1._r8 - this%o2stress_unsat_col (c,1:nlevsoi) = 1._r8 - this%o2_decomp_depth_sat_col(c,1:nlevsoi) = 0._r8 - this%o2_decomp_depth_unsat_col(c,1:nlevsoi) = 0._r8 - - this%qflx_surf_lag_col (c) = 0._r8 - this%finundated_col (c) = 0._r8 - this%finundated_pre_snow_col(c) = 0._r8 - this%finundated_lag_col (c) = 0._r8 - - else if (lun%itype(l) == istdlak) then - - this%lake_soilc_col (c,1:nlevsoi) = 580._r8 * cellorg_col(c,1:nlevsoi) - - end if - - ! Set values for all columns equal below nlevsoi - - this%conc_ch4_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%conc_ch4_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%conc_o2_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%conc_o2_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%lake_soilc_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2stress_sat_col (c,nlevsoi+1:nlevgrnd) = 1._r8 - this%o2stress_unsat_col (c,nlevsoi+1:nlevgrnd) = 1._r8 - this%layer_sat_lag_col (c,nlevsoi+1:nlevgrnd) = 1._r8 - this%ch4_prod_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_prod_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_prod_depth_lake_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_oxid_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_oxid_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_oxid_depth_lake_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_oxid_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_oxid_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_decomp_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_decomp_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_aere_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%o2_aere_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_decomp_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_decomp_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_oxid_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_oxid_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_aere_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_aere_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_tran_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_tran_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_aere_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%co2_aere_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_ebul_depth_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4_ebul_depth_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%conc_ch4_lake_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%conc_o2_lake_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4stress_unsat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - this%ch4stress_sat_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - this%conc_ch4_lake_col (c,:) = spval - this%conc_o2_lake_col (c,:) = spval - this%ch4_surf_diff_lake_col (c) = spval - this%ch4_surf_ebul_lake_col (c) = spval - this%ch4_prod_depth_lake_col (c,:) = spval - this%ch4_oxid_depth_lake_col (c,:) = spval - - else if (lun%itype(l) == istdlak .and. allowlakeprod) then - - this%ch4_prod_depth_unsat_col (c,:) = spval - this%ch4_oxid_depth_unsat_col (c,:) = spval - this%o2_oxid_depth_unsat_col (c,:) = spval - this%o2_decomp_depth_unsat_col (c,:) = spval - this%o2_aere_depth_unsat_col (c,:) = spval - this%co2_decomp_depth_unsat_col (c,:) = spval - this%co2_oxid_depth_unsat_col (c,:) = spval - this%ch4_aere_depth_unsat_col (c,:) = spval - this%ch4_tran_depth_unsat_col (c,:) = spval - this%co2_aere_depth_unsat_col (c,:) = spval - this%ch4_surf_aere_unsat_col (c) = spval - this%ch4_ebul_depth_unsat_col (c,:) = spval - this%ch4_ebul_total_unsat_col (c) = spval - this%ch4_surf_ebul_unsat_col (c) = spval - this%ch4_surf_diff_unsat_col (c) = spval - this%ch4_dfsat_flux_col (c) = spval - this%zwt_ch4_unsat_col (c) = spval - this%sif_col (c) = spval - this%o2stress_unsat_col (c,:) = spval - this%ch4stress_unsat_col (c,:) = spval - - else ! Inactive CH4 columns - - this%ch4_prod_depth_sat_col (c,:) = spval - this%ch4_prod_depth_unsat_col (c,:) = spval - this%ch4_prod_depth_lake_col (c,:) = spval - this%ch4_oxid_depth_sat_col (c,:) = spval - this%ch4_oxid_depth_unsat_col (c,:) = spval - this%ch4_oxid_depth_lake_col (c,:) = spval - this%o2_oxid_depth_sat_col (c,:) = spval - this%o2_oxid_depth_unsat_col (c,:) = spval - this%o2_decomp_depth_sat_col (c,:) = spval - this%o2_decomp_depth_unsat_col (c,:) = spval - this%o2_aere_depth_sat_col (c,:) = spval - this%o2_aere_depth_unsat_col (c,:) = spval - this%co2_decomp_depth_sat_col (c,:) = spval - this%co2_decomp_depth_unsat_col (c,:) = spval - this%co2_oxid_depth_sat_col (c,:) = spval - this%co2_oxid_depth_unsat_col (c,:) = spval - this%ch4_aere_depth_sat_col (c,:) = spval - this%ch4_aere_depth_unsat_col (c,:) = spval - this%ch4_tran_depth_sat_col (c,:) = spval - this%ch4_tran_depth_unsat_col (c,:) = spval - this%co2_aere_depth_sat_col (c,:) = spval - this%co2_aere_depth_unsat_col (c,:) = spval - this%ch4_surf_aere_sat_col (c) = spval - this%ch4_surf_aere_unsat_col (c) = spval - this%ch4_ebul_depth_sat_col (c,:) = spval - this%ch4_ebul_depth_unsat_col (c,:) = spval - this%ch4_ebul_total_sat_col (c) = spval - this%ch4_ebul_total_unsat_col (c) = spval - this%ch4_surf_ebul_sat_col (c) = spval - this%ch4_surf_ebul_unsat_col (c) = spval - this%ch4_surf_ebul_lake_col (c) = spval - this%ch4_surf_diff_sat_col (c) = spval - this%ch4_surf_diff_unsat_col (c) = spval - this%ch4_surf_diff_lake_col (c) = spval - this%ch4_dfsat_flux_col (c) = spval - this%zwt_ch4_unsat_col (c) = spval - this%conc_ch4_lake_col (c,:) = spval - this%conc_o2_lake_col (c,:) = spval - this%sif_col (c) = spval - this%o2stress_unsat_col (c,:) = spval - this%o2stress_sat_col (c,:) = spval - this%ch4stress_unsat_col (c,:) = spval - this%ch4stress_sat_col (c,:) = spval - this%grnd_ch4_cond_col (c) = spval - - ! totcolch4 Set to zero for inactive columns so that this can be used - ! as an appropriate area-weighted gridcell average soil methane content. - this%totcolch4_col (c) = 0._r8 - - end if - end do - - do p = bounds%begp, bounds%endp - l = patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop .or. & - lun%itype(l) == istdlak) then - this%tempavg_agnpp_patch(p) = 0._r8 - this%tempavg_bgnpp_patch(p) = 0._r8 - end if - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart( this, bounds, ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/Write biogeophysics information to/from restart file. - ! - ! !USES: - use ncdio_pio , only : ncd_double - use pio , only : file_desc_t - use decompMod , only : bounds_type - use restUtilMod - use filterColMod, only : filter_col_type - ! - ! !ARGUMENTS: - class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*), intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: c, p, j - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='tempavg_agnpp', xtype=ncd_double, & - dim1name='pft',& - long_name='Temp. Average AGNPP',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%tempavg_agnpp_patch) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-16) The following is needed for backwards - ! compatibility with older restart files, where this variable was nan or spval rather - ! than 0 over inactive points - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%tempavg_agnpp_patch, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='tempavg_bgnpp', xtype=ncd_double, & - dim1name='pft',& - long_name='Temp. Average BGNPP',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%tempavg_bgnpp_patch) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-16) The following is needed for backwards - ! compatibility with older restart files, where this variable was nan or spval rather - ! than 0 over inactive points - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%tempavg_bgnpp_patch, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='annavg_agnpp', xtype=ncd_double, & - dim1name='pft',& - long_name='Ann. Average AGNPP',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%annavg_agnpp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='annavg_bgnpp', xtype=ncd_double, & - dim1name='pft',& - long_name='Ann. Average BGNPP',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%annavg_bgnpp_patch) - - call restartvar(ncid=ncid, flag=flag, varname='CONC_O2_SAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='oxygen soil concentration', units='mol/m^3', & - readvar=readvar, interpinic_flag='interp', data=this%conc_o2_sat_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-17) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 0 for special landunits. - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%conc_o2_sat_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='CONC_O2_UNSAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='oxygen soil concentration', units='mol/m^3', & - readvar=readvar, interpinic_flag='interp', data=this%conc_o2_unsat_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-17) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 0 for special landunits. - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%conc_o2_unsat_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='O2STRESS_SAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='oxygen stress fraction', units='', & - readvar=readvar, interpinic_flag='interp', data=this%o2stress_sat_col) - - call restartvar(ncid=ncid, flag=flag, varname='O2STRESS_UNSAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='oxygen stress fraction', units='', & - readvar=readvar, interpinic_flag='interp', data=this%o2stress_unsat_col) - - call restartvar(ncid=ncid, flag=flag, varname='O2_DECOMP_DEPTH_SAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='O2 consumption during decomposition', units='mol/m3/s', & - readvar=readvar, interpinic_flag='interp', data=this%o2_decomp_depth_sat_col) - - call restartvar(ncid=ncid, flag=flag, varname='O2_DECOMP_DEPTH_UNSAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='O2 consumption during decomposition', units='mol/m3/s', & - readvar=readvar, interpinic_flag='interp', data=this%o2_decomp_depth_unsat_col) - - call restartvar(ncid=ncid, flag=flag, varname='CONC_CH4_SAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='methane soil concentration', units='mol/m^3', & - readvar=readvar, interpinic_flag='interp', data=this%conc_ch4_sat_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-02-11) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 0 for special landunits. - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%conc_ch4_sat_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='CONC_CH4_UNSAT', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='methane soil concentration', units='mol/m^3', & - readvar=readvar, interpinic_flag='interp', data=this%conc_ch4_unsat_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-02-11) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 0 for special landunits. - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%conc_ch4_unsat_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='LAYER_SAT_LAG', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='lagged saturation status of layer in unsat. zone', units='', & - readvar=readvar, interpinic_flag='interp', data=this%layer_sat_lag_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-18) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 1 for special landunits. - if (flag == 'read' .and. readvar) then - ! The value here (1) should agree with the setting for special landunits in initCold - call set_missing_vals_to_constant(this%layer_sat_lag_col, 1._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='QFLX_SURF_LAG', xtype=ncd_double, & - dim1name='column', & - long_name='time-lagged surface runoff', units='mm/s', & - readvar=readvar, interpinic_flag='interp', data=this%qflx_surf_lag_col) - - call restartvar(ncid=ncid, flag=flag, varname='FINUNDATED_LAG', xtype=ncd_double, & - dim1name='column', & - long_name='time-lagged inundated fraction', units='', & - readvar=readvar, interpinic_flag='interp', data=this%finundated_lag_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-18) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! this variable was initialized to spval rather than 1 for special landunits. - if (flag == 'read' .and. readvar) then - ! The value here (1) should agree with the setting for special landunits in initCold - call set_missing_vals_to_constant(this%finundated_lag_col, 1._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='FINUNDATED', xtype=ncd_double, & - dim1name='column', & - long_name='inundated fraction', units='', & - readvar=readvar, interpinic_flag='interp', data=this%finundated_col) - if (flag == 'read' .and. readvar) then - ! Determine whether the methane model was present in the run that generated the - ! restart file based on whether FINUNDATED is present on the restart file. We - ! could use any methane variable, but FINUNDATED is a good choice because this - ! "first time" variable is used in connection with FINUNDATED. - this%ch4_first_time_col(bounds%begc:bounds%endc) = .false. - - ! BACKWARDS_COMPATIBILITY(wjs, 2016-02-11) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! these variables were initialized to spval rather than 1 for special landunits. - ! - ! The value here (1) should agree with the setting for special landunits in initCold - call set_missing_vals_to_constant(this%finundated_col, 1._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='FINUNDATED_PRESNOW', xtype=ncd_double, & - dim1name='column', & - long_name='inundated fraction before snow', units='', & - readvar=readvar, interpinic_flag='interp', data=this%finundated_pre_snow_col) - if (flag == 'read' .and. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2016-02-11) The following is needed for backwards - ! compatibility with restart files generated from older versions of the code, where - ! these variables were initialized to spval rather than 1 for special landunits. - ! - ! The value here (1) should agree with the setting for special landunits in initCold - call set_missing_vals_to_constant(this%finundated_pre_snow_col, 1._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='annavg_somhr', xtype=ncd_double, & - dim1name='column',& - long_name='Annual Average SOMHR',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%annavg_somhr_col) - - call restartvar(ncid=ncid, flag=flag, varname='annavg_finrw', xtype=ncd_double, & - dim1name='column',& - long_name='Annual Average Respiration-Weighted FINUNDATED',units='', & - readvar=readvar, interpinic_flag='interp', data=this%annavg_finrw_col) - - call restartvar(ncid=ncid, flag=flag, varname='annsum_counter_ch4', xtype=ncd_double, & - dim1name='column',& - long_name='CH4 Ann. Sum Time Counter',units='s', & - readvar=readvar, interpinic_flag='interp', data=this%annsum_counter_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-16) The following is needed for backwards - ! compatibility with older restart files, where this variable was nan or spval rather - ! than 0 over inactive points - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%annsum_counter_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='tempavg_somhr', xtype=ncd_double, & - dim1name='column',& - long_name='Temp. Average SOMHR',units='gC/m^2/s', & - readvar=readvar, interpinic_flag='interp', data=this%tempavg_somhr_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-16) The following is needed for backwards - ! compatibility with older restart files, where this variable was nan or spval rather - ! than 0 over inactive points - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%tempavg_somhr_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='tempavg_finrw', xtype=ncd_double, & - dim1name='column',& - long_name='Temp. Average Respiration-Weighted FINUNDATED',units='', & - readvar=readvar, interpinic_flag='interp', data=this%tempavg_finrw_col) - ! BACKWARDS_COMPATIBILITY(wjs, 2016-05-16) The following is needed for backwards - ! compatibility with older restart files, where this variable was nan or spval rather - ! than 0 over inactive points - if (flag == 'read' .and. readvar) then - call set_missing_vals_to_constant(this%tempavg_finrw_col, 0._r8) - end if - - call restartvar(ncid=ncid, flag=flag, varname='LAKE_SOILC', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true.,& - long_name='lake soil carbon concentration', units='g/m^3', & - readvar=readvar, interpinic_flag='interp', data=this%lake_soilc_col) - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine DynamicColumnAdjustments(this, bounds, clump_index, column_state_updater) - ! - ! !DESCRIPTION: - ! Adjust state variables when column areas change due to dynamic landuse - ! - ! !USES: - use dynColumnStateUpdaterMod, only : column_state_updater_type - ! - ! !ARGUMENTS: - class(ch4_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - type(column_state_updater_type) , intent(in) :: column_state_updater - ! - ! !LOCAL VARIABLES: - real(r8) :: finundated_new_col(bounds%begc:bounds%endc) ! finundated after column adjustments - real(r8) :: f_uninundated_col(bounds%begc:bounds%endc) ! 1 - finundated_col - real(r8) :: f_uninundated_new_col(bounds%begc:bounds%endc) ! f_uninundated after column adjustments - real(r8) :: adjustment_one_level(bounds%begc:bounds%endc) - integer :: j, c - integer :: begc, endc - - character(len=*), parameter :: subname = 'DynamicColumnAdjustments' - !----------------------------------------------------------------------- - - ! BUG(wjs, 2016-02-16, bugz 2283) Need to do some special handling of finundated for - ! increases in lake area, since lakes are assumed to be 100% inundated. Probably it's - ! most appropriate for this special handling to happen elsewhere - i.e., within this - ! routine, we do the standard adjustments as they are currently done, but then in the - ! "science" code in this module, there is a check of whether a lake has finundated < - ! 1, and if so, variables are adjusted so that it is once again fully inundated. - - ! Note that some of the variables updated here aren't strictly needed for - ! conservation purposes (because they don't represent any mass in the system), but it - ! seems like a good idea to update these anyway so that growing columns will be in a - ! more self-consistent state. - - begc = bounds%begc - endc = bounds%endc - - finundated_new_col(begc:endc) = & - this%finundated_col(begc:endc) - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = finundated_new_col(begc:endc)) - - f_uninundated_col(begc:endc) = & - 1._r8 - this%finundated_col(begc:endc) - f_uninundated_new_col(begc:endc) = & - f_uninundated_col(begc:endc) - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = f_uninundated_new_col(begc:endc)) - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%finundated_lag_col(begc:endc)) - - this%dyn_ch4bal_adjustments_col(begc:endc) = 0._r8 - - do j = 1, nlevsoi - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%conc_ch4_sat_col(begc:endc, j), & - fractional_area_old = this%finundated_col(begc:endc), & - fractional_area_new = finundated_new_col(begc:endc), & - adjustment = adjustment_one_level(begc:endc)) - do c = bounds%begc, bounds%endc - this%dyn_ch4bal_adjustments_col(c) = & - this%dyn_ch4bal_adjustments_col(c) + & - adjustment_one_level(c) * col%dz(c,j) * catomw - end do - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%conc_ch4_unsat_col(begc:endc, j), & - fractional_area_old = f_uninundated_col(begc:endc), & - fractional_area_new = f_uninundated_new_col(begc:endc), & - adjustment = adjustment_one_level(begc:endc)) - do c = bounds%begc, bounds%endc - this%dyn_ch4bal_adjustments_col(c) = & - this%dyn_ch4bal_adjustments_col(c) + & - adjustment_one_level(c) * col%dz(c,j) * catomw - end do - - ! layer_sat_lag just applies to the UNinundated portion of the column - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%layer_sat_lag_col(begc:endc, j), & - fractional_area_old = f_uninundated_col(begc:endc), & - fractional_area_new = f_uninundated_new_col(begc:endc)) - - ! We don't bother tracking the adjustment terms for the following o2 state - ! variables, because they're not needed for balance checks and because people are - ! less likely to be interested in viewing those adjustment terms. - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%conc_o2_sat_col(begc:endc, j), & - fractional_area_old = this%finundated_col(begc:endc), & - fractional_area_new = finundated_new_col(begc:endc)) - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%conc_o2_unsat_col(begc:endc, j), & - fractional_area_old = f_uninundated_col(begc:endc), & - fractional_area_new = f_uninundated_new_col(begc:endc)) - end do - - this%finundated_col(begc:endc) = & - finundated_new_col(begc:endc) - - end subroutine DynamicColumnAdjustments - - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use ncdio_pio , only : file_desc_t,ncd_io - use ch4varcon , only : use_aereoxid_prog - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !-------------------------------------------------------------------- - - if ( .not. use_aereoxid_prog ) then - tString='aereoxid' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%aereoxid=tempr - else - ! value should never be used. - params_inst%aereoxid=nan - endif - - tString='q10ch4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%q10ch4=tempr - - tString='q10ch4base' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%q10ch4base=tempr - - tString='f_ch4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%f_ch4=tempr - - tString='rootlitfrac' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rootlitfrac=tempr - - tString='cnscalefactor' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cnscalefactor=tempr - - tString='redoxlag' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%redoxlag=tempr - - tString='lake_decomp_fact' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%lake_decomp_fact=tempr - - tString='redoxlag_vertical' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%redoxlag_vertical=tempr - - tString='pHmax' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%pHmax=tempr - - tString='pHmin' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%pHmin=tempr - - tString='vmax_ch4_oxid' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%vmax_ch4_oxid=45.e-6_r8 * 1000._r8 / 3600._r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%vmax_ch4_oxid=tempr - - tString='oxinhib' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%oxinhib=tempr - - tString='k_m' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_m= 5.e-6_r8 * 1000._r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%k_m=tempr - - tString='q10_ch4oxid' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%q10_ch4oxid=tempr - - tString='smp_crit' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%smp_crit=tempr - - tString='k_m_o2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_m_o2 = 20.e-6_r8 * 1000._r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%k_m_o2=tempr - - tString='k_m_unsat' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_m_unsat= 5.e-6_r8 * 1000._r8 / 10._r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%k_m_unsat=tempr - - tString='vmax_oxid_unsat' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%vmax_oxid_unsat = 45.e-6_r8 * 1000._r8 / 3600._r8 / 10._r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%vmax_oxid_unsat=tempr - - tString='scale_factor_aere' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%scale_factor_aere=tempr - - tString='nongrassporosratio' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%nongrassporosratio=tempr - - tString='unsat_aere_ratio' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%unsat_aere_ratio= 0.05_r8 / 0.3_r8 - ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide - !params_inst%unsat_aere_ratio=tempr - - tString='porosmin' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%porosmin=tempr - - tString='vgc_max' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%vgc_max=tempr - - tString='satpow' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%satpow=tempr - - tString='scale_factor_gasdiff' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%scale_factor_gasdiff=tempr - - tString='scale_factor_liqdiff' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%scale_factor_liqdiff=tempr - - tString='f_sat' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%f_sat=tempr - - tString='qflxlagd' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%qflxlagd=tempr - - tString='highlatfact' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%highlatfact=tempr - - tString='q10lakebase' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%q10lakebase=tempr - - tString='atmch4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%atmch4=tempr - - tString='rob' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rob=tempr - - tString='capthick' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%capthick=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine ch4_init_balance_check(bounds, num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - ch4_inst) - ! - ! !DESCRIPTION: - ! Calculate beginning column-level ch4 balance, for mass conservation check - ! - ! This sets ch4_inst%totcolch4_bef - ! - ! This should be called after the weight updates due to dynamic landunits, and the - ! associated filter updates - i.e., using the new version of the filters. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'ch4_init_balance_check' - !----------------------------------------------------------------------- - - ! This is only really needed for soilc and lakec, but we use nolakec rather than just - ! soilc for consistency with the other call to ch4_totcolch4 (which computes - ! ch4_inst%totcolch4 over all columns for diagnostic purposes). - call ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - ch4_inst, ch4_inst%totcolch4_bef_col(bounds%begc:bounds%endc)) - - end subroutine ch4_init_balance_check - - - !----------------------------------------------------------------------- - subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & - num_nolakec, filter_nolakec, num_soilp, filter_soilp, & - atm2lnd_inst, lakestate_inst, canopystate_inst, soilstate_inst, soilhydrology_inst, & - temperature_inst, energyflux_inst, waterstate_inst, waterflux_inst, & - soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenflux_inst, ch4_inst, lnd2atm_inst, & - agnpp, bgnpp, annsum_npp, rr) - ! - ! !DESCRIPTION: - ! Driver for the methane emissions model - ! - ! !USES: - use subgridAveMod , only : p2c, c2g - use clm_varpar , only : nlevgrnd, nlevdecomp - use pftconMod , only : noveg - use ch4varcon , only : replenishlakec, allowlakeprod, ch4offline - use clm_varcon , only : secspday - use ch4varcon , only : finundation_mtd, finundation_mtd_h2osfc - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of column soil points in column filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_soilp ! number of soil points in patch filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst ! output ONLY for forcp_ch4 in ch4offline mode - type(lakestate_type) , intent(in) :: lakestate_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(temperature_type) , intent(in) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(in) :: soilbiogeochem_nitrogenflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - type(lnd2atm_type) , intent(inout) :: lnd2atm_inst - real(r8) , intent(in) :: agnpp( bounds%begp: ) ! aboveground NPP (gC/m2/s) - real(r8) , intent(in) :: bgnpp( bounds%begp: ) ! belowground NPP (gC/m2/s) - real(r8) , intent(in) :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr) - real(r8) , intent(in) :: rr ( bounds%begp: ) ! root respiration (fine root MR + total root GR) (gC/m2/s) - ! - ! !LOCAL VARIABLES: - integer :: sat ! 0 = unsatured, 1 = saturated - logical :: lake ! lake or not lake - integer :: j,fc,c,g,fp,p ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: dtime_ch4 ! ch4 model time step (sec) - integer :: nstep - integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) - real(r8) :: ch4_prod_tot(bounds%begc:bounds%endc) ! CH4 production for column (g C/m**2/s) - real(r8) :: ch4_oxid_tot(bounds%begc:bounds%endc) ! CH4 oxidation for column (g C/m**2/s) - real(r8) :: nem_col(bounds%begc:bounds%endc) ! net adjustment to atm. C flux from methane production (g C/m**2/s) - real(r8) :: totalsat - real(r8) :: totalunsat - real(r8) :: dfsat - real(r8) :: rootfraction(bounds%begp:bounds%endp, 1:nlevgrnd) - real(r8) :: fsat_bef(bounds%begc:bounds%endc) ! finundated from previous timestep - real(r8) :: errch4 ! g C / m^2 - real(r8) :: zwt_actual - real(r8) :: qflxlags ! Time to lag qflx_surf_lag (s) - real(r8) :: redoxlag ! Redox time lag - real(r8) :: redoxlag_vertical ! Vertical redox lag time - real(r8) :: atmch4 ! Atmospheric CH4 mixing ratio to - ! prescribe if not provided by the atmospheric model (= 1.7e-6_r8) (mol/mol) - real(r8) :: redoxlags ! Redox time lag in s - real(r8) :: redoxlags_vertical ! Vertical redox lag time in s - real(r8) :: qflxlagd ! days to lag qflx_surf_lag in the tropics (days) - real(r8) :: highlatfact ! multiple of qflxlagd for high latitudes - integer :: dummyfilter(1) ! empty filter - character(len=32) :: subname='ch4' ! subroutine name - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(agnpp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bgnpp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(annsum_npp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - - forc_t => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_pbot => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] O2 partial pressure (Pa) - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] CO2 partial pressure (Pa) - forc_pch4 => atm2lnd_inst%forc_pch4_grc , & ! Input: [real(r8) (:) ] CH4 partial pressure (Pa) - - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) - rootfr_col => soilstate_inst%rootfr_col , & ! Output: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) (p2c) - - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) - - conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m) - f0 => ch4_inst%f0_col , & ! Input: [real(r8) (:) ] maximum gridcell fractional inundated area - p3 => ch4_inst%p3_col , & ! Input: [real(r8) (:) ] coefficient for qflx_surf_lag for finunated (s/mm) - totcolch4_bef => ch4_inst%totcolch4_bef_col , & ! Input: [real(r8) (:) ] total methane in soil column, start of timestep (g C / m^2) - - grnd_ch4_cond_patch => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - grnd_ch4_cond_col => ch4_inst%grnd_ch4_cond_col , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] (p2c) - - ch4_surf_diff_sat => ch4_inst%ch4_surf_diff_sat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_diff_unsat => ch4_inst%ch4_surf_diff_unsat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_diff_lake => ch4_inst%ch4_surf_diff_lake_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_ebul_sat => ch4_inst%ch4_surf_ebul_sat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_ebul_unsat => ch4_inst%ch4_surf_ebul_unsat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_ebul_lake => ch4_inst%ch4_surf_ebul_lake_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_aere_sat => ch4_inst%ch4_surf_aere_sat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) - ch4_surf_aere_unsat => ch4_inst%ch4_surf_aere_unsat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) - ch4_oxid_depth_sat => ch4_inst%ch4_oxid_depth_sat_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_oxid_depth_unsat => ch4_inst%ch4_oxid_depth_unsat_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_oxid_depth_lake => ch4_inst%ch4_oxid_depth_lake_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_prod_depth_sat => ch4_inst%ch4_prod_depth_sat_col , & ! Output: [real(r8) (:,:) ] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - ch4_prod_depth_unsat => ch4_inst%ch4_prod_depth_unsat_col , & ! Output: [real(r8) (:,:) ] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - ch4_prod_depth_lake => ch4_inst%ch4_prod_depth_lake_col , & ! Output: [real(r8) (:,:) ] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - lake_soilc => ch4_inst%lake_soilc_col , & ! Output: [real(r8) (:,:) ] total soil organic matter found in level (g C / m^3) (nlevsoi) - conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_lake => ch4_inst%conc_ch4_lake_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2_lake => ch4_inst%conc_o2_lake_col , & ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - ch4_dfsat_flux => ch4_inst%ch4_dfsat_flux_col , & ! Output: [real(r8) (:) ] CH4 flux to atm due to decreasing finundated (kg C/m^2/s) [+] - zwt_ch4_unsat => ch4_inst%zwt_ch4_unsat_col , & ! Output: [real(r8) (:) ] depth of water table for unsaturated fraction (m) - totcolch4 => ch4_inst%totcolch4_col , & ! Output: [real(r8) (:) ] total methane in soil column (g C / m^2) - finundated => ch4_inst%finundated_col , & ! Output: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) - finundated_pre_snow => ch4_inst%finundated_pre_snow_col , & ! Output: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) before snow - ch4_first_time => ch4_inst%ch4_first_time_col , & ! Output: [logical (:) ] whether this is the first time step that includes ch4 - qflx_surf_lag => ch4_inst%qflx_surf_lag_col , & ! Output: [real(r8) (:) ] time-lagged surface runoff (mm H2O /s) - finundated_lag => ch4_inst%finundated_lag_col , & ! Output: [real(r8) (:) ] time-lagged fractional inundated area - layer_sat_lag => ch4_inst%layer_sat_lag_col , & ! Output: [real(r8) (:,:) ] Lagged saturation status of soil layer in the unsaturated zone (1 = sat) - c_atm => ch4_inst%c_atm_grc , & ! Output: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) - ch4co2f => ch4_inst%ch4co2f_grc , & ! Output: [real(r8) (:) ] gridcell CO2 production from CH4 oxidation (g C/m**2/s) - ch4prodg => ch4_inst%ch4prodg_grc , & ! Output: [real(r8) (:) ] gridcell average CH4 production (g C/m^2/s) - ch4_surf_flux_tot => ch4_inst%ch4_surf_flux_tot_col , & ! Output: [real(r8) (:) ] col CH4 flux to atm. (kg C/m**2/s) - - nem_grc => lnd2atm_inst%nem_grc , & ! Output: [real(r8) (:) ] gridcell average net methane correction to CO2 flux (g C/m^2/s) - - begg => bounds%begg , & - endg => bounds%endg , & - begc => bounds%begc , & - endc => bounds%endc , & - begp => bounds%begp , & - endp => bounds%endp & - ) - - redoxlag = params_inst%redoxlag - redoxlag_vertical = params_inst%redoxlag_vertical - atmch4 = params_inst%atmch4 - qflxlagd = params_inst%qflxlagd - highlatfact = params_inst%highlatfact - - dtime = get_step_size() - nstep = get_nstep() - dtime_ch4 = dtime - redoxlags = redoxlag*secspday ! days --> s - redoxlags_vertical = redoxlag_vertical*secspday ! days --> s - rgasm = rgas / 1000._r8 - - jwt(begc:endc) = huge(1) - - ! Initialize local fluxes to zero: necessary for columns outside the filters because averaging up to gridcell will be done - ch4_surf_flux_tot(begc:endc) = 0._r8 - ch4_prod_tot(begc:endc) = 0._r8 - ch4_oxid_tot(begc:endc) = 0._r8 - rootfraction(begp:endp,:) = spval - - ! Adjustment to NEE for methane production - oxidation - nem_col(begc:endc) = 0._r8 - - do g= begg, endg - if (ch4offline) then - forc_pch4(g) = atmch4*forc_pbot(g) - else - if (forc_pch4(g) == 0._r8) then - write(iulog,*)'not using ch4offline, but methane concentration not passed from the atmosphere', & - 'to land model! CLM Model is stopping.' - call endrun(msg=' ERROR: Methane not being passed to atmosphere'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - c_atm(g,1) = forc_pch4(g) / rgasm / forc_t(g) ! [mol/m3 air] - c_atm(g,2) = forc_po2(g) / rgasm / forc_t(g) ! [mol/m3 air] - c_atm(g,3) = forc_pco2(g) / rgasm / forc_t(g) ! [mol/m3 air] - end do - - ! Save finundated before, and calculate lagged surface runoff - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - - fsat_bef(c) = finundated(c) - - ! Update lagged surface runoff - - if (grc%latdeg(g) < 45._r8) then - qflxlags = qflxlagd * secspday ! 30 days - else - qflxlags = qflxlagd * secspday * highlatfact ! 60 days - end if - qflx_surf_lag(c) = qflx_surf_lag(c) * exp(-dtime/qflxlags) & - + qflx_surf(c) * (1._r8 - exp(-dtime/qflxlags)) - - end do - - ! Caulculate finundated - if ( ch4_inst%ch4findstream%useStreams() & - .or. (finundation_mtd == finundation_mtd_h2osfc) )then - call ch4_inst%ch4findstream%CalcFinundated( bounds, num_soilc, & - filter_soilc, soilhydrology_inst, waterstate_inst, & - qflx_surf_lag(begc:endc), finundated(begc:endc) ) - else - - ! Calculate finundated with ZWT inversion from surface dataset - do fc = 1, num_soilc - c = filter_soilc(fc) - if (zwt0(c) > 0._r8) then - if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - zwt_actual = zwt_perched(c) - else - zwt_actual = zwt(c) - end if - finundated(c) = f0(c) * exp(-zwt_actual/zwt0(c)) + p3(c)*qflx_surf_lag(c) - else - finundated(c) = p3(c)*qflx_surf_lag(c) - end if - - end do - end if - - ! Calculate finundated before snow and lagged version of finundated - do fc = 1, num_soilc - c = filter_soilc(fc) - if (snow_depth(c) <= 0._r8) then ! If snow_depth<=0,use the above method to calculate finundated. - finundated(c) = max( min(finundated(c),1._r8), 0._r8) - finundated_pre_snow(c) = finundated(c) - else - finundated(c) = finundated_pre_snow(c) !If snow_depth>0, keep finundated from the previous time step of snow season. (by Xiyan Xu, 05/2016) - end if - - ! Update lagged finundated for redox calculation - if (redoxlags > 0._r8) then - finundated_lag(c) = finundated_lag(c) * exp(-dtime/redoxlags) & - + finundated(c) * (1._r8 - exp(-dtime/redoxlags)) - else - finundated_lag(c) = finundated(c) - end if - - end do - - ! Check to see if finundated changed since the last timestep. If it increased, then reduce conc_ch4_sat - ! proportionally. If it decreased, then add flux to atm. - - do j=1,nlevsoi - do fc = 1, num_soilc - c = filter_soilc(fc) - - if (j==1) then - ch4_dfsat_flux(c) = 0._r8 - end if - - if (.not. ch4_first_time(c)) then - if (finundated(c) > fsat_bef(c)) then !Reduce conc_ch4_sat - dfsat = finundated(c) - fsat_bef(c) - conc_ch4_sat(c,j) = (fsat_bef(c)*conc_ch4_sat(c,j) + dfsat*conc_ch4_unsat(c,j)) / finundated(c) - else if (finundated(c) < fsat_bef(c)) then - ch4_dfsat_flux(c) = ch4_dfsat_flux(c) + & - (fsat_bef(c) - finundated(c))*(conc_ch4_sat(c,j) - conc_ch4_unsat(c,j)) * & - dz(c,j) / dtime * catomw / 1000._r8 ! mol --> kg - end if - end if - end do - end do - - !!!! Begin biochemistry - - ! First for soil - lake = .false. - - ! Do CH4 Annual Averages - call ch4_annualupdate(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - agnpp(begp:endp), bgnpp(begp:endp), & - soilbiogeochem_carbonflux_inst, ch4_inst) - - ! Determine rootfr_col and also check for inactive columns - - if (nlevdecomp == 1) then - - ! Set rootfraction to spval for non-veg points, unless patch%wtcol > 0.99, - ! in which case set it equal to uniform dist. - do j=1, nlevsoi - do fp = 1, num_soilp - p = filter_soilp(fp) - c = patch%column(p) - - if (patch%itype(p) /= noveg) then - rootfraction(p,j) = rootfr(p,j) - else if (patch%wtcol(p) < 0.99_r8) then - rootfraction(p,j) = spval - else - rootfraction(p,j) = dz(c,j) / zi(c,nlevsoi) ! Set equal to uniform distribution - end if - end do - end do - - call p2c (bounds, nlevgrnd, & - rootfraction(bounds%begp:bounds%endp, :), & - rootfr_col(bounds%begc:bounds%endc, :), & - 'unity') - - do j=1, nlevsoi - do fc = 1, num_soilc - c = filter_soilc(fc) - if (.not. col%active(c)) rootfr_col(c,j) = dz(c,j) / zi(c,nlevsoi) - end do - end do - end if - - ! Determine grnd_ch4_cond_col - ! Needed to use non-filter form above so that spval would be treated properly. - - call p2c (bounds, num_soilc, filter_soilc, & - grnd_ch4_cond_patch(bounds%begp:bounds%endp), & - grnd_ch4_cond_col(bounds%begc:bounds%endc)) - - ! Set the gridcell atmospheric CH4 and O2 concentrations - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - - c_atm(g,1) = forc_pch4(g) / rgasm / forc_t(g) ! [mol/m3 air] - c_atm(g,2) = forc_po2(g) / rgasm / forc_t(g) ! [mol/m3 air] - !c_atm(g,3) = forc_pco2(g) / rgasm / forc_t(g) ! [mol/m3 air] - Not currently used - enddo - - !------------------------------------------------- - ! Loop over saturated and unsaturated, non-lakes - !------------------------------------------------ - - do sat = 0, 1 ! 0 == unsaturated; 1 = saturated - - ! Get index of water table - if (sat == 0) then ! unsaturated - - call get_jwt (bounds, num_soilc, filter_soilc, jwt(begc:endc), & - soilstate_inst, waterstate_inst, temperature_inst) - - do fc = 1, num_soilc - c = filter_soilc(fc) - zwt_ch4_unsat(c) = zi(c,jwt(c)) - - end do - - ! Update lagged saturation status of layer - do j=1,nlevsoi - do fc = 1, num_soilc - c = filter_soilc(fc) - - if (j > jwt(c) .and. redoxlags_vertical > 0._r8) then ! saturated currently - layer_sat_lag(c,j) = layer_sat_lag(c,j) * exp(-dtime/redoxlags_vertical) & - + (1._r8 - exp(-dtime/redoxlags_vertical)) - else if (redoxlags_vertical > 0._r8) then - layer_sat_lag(c,j) = layer_sat_lag(c,j) * exp(-dtime/redoxlags_vertical) - else if (j > jwt(c)) then ! redoxlags_vertical = 0 - layer_sat_lag(c,j) = 1._r8 - else - layer_sat_lag(c,j) = 0._r8 - end if - end do - end do - - else ! saturated - do fc = 1, num_soilc - c = filter_soilc(fc) - jwt(c) = 0 - end do - endif - - ! calculate CH4 production in each soil layer - call ch4_prod (bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - rr(begp:endp), jwt(begc:endc), sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, & - ch4_inst) - - ! calculate CH4 oxidation in each soil layer - call ch4_oxid (bounds, & - num_soilc, filter_soilc, & - jwt(begc:endc), sat, lake, & - waterstate_inst, soilstate_inst, temperature_inst, ch4_inst) - - ! calculate CH4 aerenchyma losses in each soil layer - call ch4_aere (bounds, & - num_soilc, filter_soilc, & - num_soilp, filter_soilp, & - annsum_npp(begp:endp), jwt(begc:endc), sat, lake, & - canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, & - waterstate_inst, waterflux_inst, ch4_inst) - - ! calculate CH4 ebullition losses in each soil layer - call ch4_ebul (bounds, & - num_soilc, filter_soilc, & - jwt(begc:endc), sat, lake, & - atm2lnd_inst, temperature_inst, lakestate_inst, soilstate_inst, waterstate_inst, & - ch4_inst) - - ! Solve CH4 reaction/diffusion equation - ! Competition for oxygen will occur here. - call ch4_tran (bounds, & - num_soilc, filter_soilc, & - jwt(begc:endc), dtime_ch4, sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, energyflux_inst, ch4_inst) - - enddo ! sat/unsat - - !------------------------------------------------- - ! Now do over lakes - !------------------------------------------------- - - if (allowlakeprod) then - lake = .true. - sat = 1 - do fc = 1, num_lakec - c = filter_lakec(fc) - jwt(c) = 0 - end do - - ! calculate CH4 production in each lake layer - call ch4_prod (bounds, num_lakec, filter_lakec, 0, dummyfilter, & - rr(begp:endp), jwt(begc:endc), sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, & - ch4_inst) - - ! calculate CH4 oxidation in each lake layer - call ch4_oxid (bounds, & - num_lakec, filter_lakec, & - jwt(begc:endc), sat, lake, & - waterstate_inst, soilstate_inst, temperature_inst, ch4_inst) - - ! calculate CH4 aerenchyma losses in each lake layer - ! The p filter will not be used here; the relevant column vars will just be set to 0. - call ch4_aere (bounds, num_lakec, filter_lakec, 0, dummyfilter, & - annsum_npp(begp:endp), jwt(begc:endc), sat, lake, & - canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, & - waterstate_inst, waterflux_inst, ch4_inst) - - ! calculate CH4 ebullition losses in each lake layer - call ch4_ebul (bounds, num_lakec, filter_lakec, & - jwt(begc:endc), sat, lake, & - atm2lnd_inst, temperature_inst, lakestate_inst, soilstate_inst, waterstate_inst, & - ch4_inst) - - ! Solve CH4 reaction/diffusion equation - ! Competition for oxygen will occur here. - call ch4_tran (bounds, num_lakec, filter_lakec, & - jwt(begc:endc), dtime_ch4, sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, energyflux_inst, ch4_inst) - - end if - - !------------------------------------------------- - ! Average up to gridcell flux and column oxidation and production rate. - !------------------------------------------------- - - ! First weight the soil columns by finundated. - do j=1,nlevsoi - do fc = 1, num_soilc - c = filter_soilc(fc) - - if (j == 1) then - totalsat = ch4_surf_diff_sat(c) + ch4_surf_aere_sat(c) + ch4_surf_ebul_sat(c) - totalunsat = ch4_surf_diff_unsat(c) + ch4_surf_aere_unsat(c) + ch4_surf_ebul_unsat(c) - ch4_surf_flux_tot(c) = (finundated(c)*totalsat + (1._r8 - finundated(c))*totalunsat) * & - catomw / 1000._r8 - !Convert from mol to kg C - ! ch4_oxid_tot and ch4_prod_tot are initialized to zero above - end if - - ch4_oxid_tot(c) = ch4_oxid_tot(c) + (finundated(c)*ch4_oxid_depth_sat(c,j) + & - (1._r8 - finundated(c))*ch4_oxid_depth_unsat(c,j))*dz(c,j) * catomw - !Convert from mol to g C - ch4_prod_tot(c) = ch4_prod_tot(c) + (finundated(c)*ch4_prod_depth_sat(c,j) + & - (1._r8 - finundated(c))*ch4_prod_depth_unsat(c,j))*dz(c,j) * catomw - !Convert from mol to g C - if (j == nlevsoi) then - ! Adjustment to NEE flux to atm. for methane production - nem_col(c) = nem_col(c) - ch4_prod_tot(c) - ! Adjustment to NEE flux to atm. for methane oxidation - nem_col(c) = nem_col(c) + ch4_oxid_tot(c) - end if - end do - end do - - ! Correct for discrepancies in CH4 concentration from changing finundated - - do fc = 1, num_soilc - c = filter_soilc(fc) - - ch4_surf_flux_tot(c) = ch4_surf_flux_tot(c) + ch4_dfsat_flux(c) - end do - - if (allowlakeprod) then - do j=1,nlevsoi - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j == 1) then - ! ch4_oxid_tot and ch4_prod_tot are initialized to zero above - totalsat = ch4_surf_diff_sat(c) + ch4_surf_aere_sat(c) + ch4_surf_ebul_sat(c) - ch4_surf_flux_tot(c) = totalsat*catomw / 1000._r8 - end if - - ch4_oxid_tot(c) = ch4_oxid_tot(c) + ch4_oxid_depth_sat(c,j)*dz(c,j)*catomw - ch4_prod_tot(c) = ch4_prod_tot(c) + ch4_prod_depth_sat(c,j)*dz(c,j)*catomw - - if (.not. replenishlakec) then - !Adjust lake_soilc for production. - lake_soilc(c,j) = lake_soilc(c,j) - 2._r8*ch4_prod_depth_sat(c,j)*dtime*catomw - ! Factor of 2 is for CO2 that comes off with CH4 because of stoichiometry - end if - - if (j == nlevsoi) then - ! Adjustment to NEE flux to atm. for methane production - if (.not. replenishlakec) then - nem_col(c) = nem_col(c) + ch4_prod_tot(c) - ! Here this is positive because it is actually the CO2 that comes off with the methane - ! NOTE THIS MODE ASSUMES TRANSIENT CARBON SUPPLY FROM LAKES; COUPLED MODEL WILL NOT CONSERVE CARBON - ! IN THIS MODE. - else ! replenishlakec - nem_col(c) = nem_col(c) - ch4_prod_tot(c) - ! Keep total C constant, just shift from CO2 to methane - end if - - ! Adjustment to NEE flux to atm. for methane oxidation - nem_col(c) = nem_col(c) + ch4_oxid_tot(c) - - end if - - - !Set lake diagnostic output variables - ch4_prod_depth_lake(c,j) = ch4_prod_depth_sat(c,j) - conc_ch4_lake(c,j) = conc_ch4_sat(c,j) - conc_o2_lake(c,j) = conc_o2_sat(c,j) - ch4_oxid_depth_lake(c,j) = ch4_oxid_depth_sat(c,j) - if (j == 1) then - ch4_surf_diff_lake(c) = ch4_surf_diff_sat(c) - ch4_surf_ebul_lake(c) = ch4_surf_ebul_sat(c) - end if - - end do - end do - end if ! ch4_surf_flux_tot, ch4_oxid_tot, and ch4_prod_tot should be initialized to 0 above if .not. allowlakeprod - - ! Finalize CH4 balance and check for errors - - call ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - ch4_inst, totcolch4(bounds%begc:bounds%endc)) - - do fc = 1, num_soilc - c = filter_soilc(fc) - - if (.not. ch4_first_time(c)) then - ! Check balance - errch4 = totcolch4(c) - totcolch4_bef(c) & - - dtime*(ch4_prod_tot(c) - ch4_oxid_tot(c) & - - ch4_surf_flux_tot(c)*1000._r8) ! kg C --> g C - if (abs(errch4) > 1.e-7_r8) then ! g C / m^2 / timestep - write(iulog,*)'CH4 Conservation Error in CH4Mod driver, nstep, c, errch4 (gC /m^2.timestep)', & - nstep,c,errch4 - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg,col%itype=',grc%latdeg(g),grc%londeg(g),col%itype(c) - write(iulog,*)'totcolch4 = ', totcolch4(c) - write(iulog,*)'totcolch4_bef = ', totcolch4_bef(c) - write(iulog,*)'dtime*ch4_prod_tot = ', dtime*ch4_prod_tot(c) - write(iulog,*)'dtime*ch4_oxid_tot = ', dtime*ch4_oxid_tot(c) - write(iulog,*)'dtime*ch4_surf_flux_tot*1000 = ', dtime*& - ch4_surf_flux_tot(c)*1000._r8 - call endrun(msg=' ERROR: Methane conservation error'//errMsg(sourcefile, __LINE__)) - end if - end if - - end do - if (allowlakeprod) then - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (.not. ch4_first_time(c)) then - ! Check balance - errch4 = totcolch4(c) - totcolch4_bef(c) & - - dtime*(ch4_prod_tot(c) - ch4_oxid_tot(c) & - - ch4_surf_flux_tot(c)*1000._r8) ! kg C --> g C - if (abs(errch4) > 1.e-7_r8) then ! g C / m^2 / timestep - write(iulog,*)'CH4 Conservation Error in CH4Mod driver for lake column, nstep, c, errch4 (gC/m^2.timestep)', & - nstep,c,errch4 - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - write(iulog,*)'totcolch4 = ', totcolch4(c) - write(iulog,*)'totcolch4_bef = ', totcolch4_bef(c) - write(iulog,*)'dtime*ch4_prod_tot = ', dtime*ch4_prod_tot(c) - write(iulog,*)'dtime*ch4_oxid_tot = ', dtime*ch4_oxid_tot(c) - write(iulog,*)'dtime*ch4_surf_flux_tot*1000 = ', dtime*& - ch4_surf_flux_tot(c)*1000._r8 - call endrun(msg=' ERROR: Methane conservation error, allowlakeprod'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - end do - end if - - ! Now average up to gridcell for fluxes - call c2g( bounds, & - ch4_oxid_tot(begc:endc), ch4co2f(begg:endg), & - c2l_scale_type= 'unity', l2g_scale_type='unity' ) - - call c2g( bounds, & - ch4_prod_tot(begc:endc), ch4prodg(begg:endg), & - c2l_scale_type= 'unity', l2g_scale_type='unity' ) - - call c2g( bounds, & - nem_col(begc:endc), nem_grc(begg:endg), & - c2l_scale_type= 'unity', l2g_scale_type='unity' ) - - ch4_first_time(begc:endc) = .false. - - end associate - - end subroutine ch4 - - !----------------------------------------------------------------------- - subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & - filter_methp, rr, jwt, sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst, & - ch4_inst) - ! - ! !DESCRIPTION: - ! Production is done below the water table, based on CN heterotrophic respiration. - ! O2 is consumed by roots & by heterotrophic aerobes. - ! Production is done separately for sat & unsat, and is adjusted for temperature, seasonal inundation, - ! pH (optional), & redox lag factor. - ! - ! !USES: - use ch4varcon , only: usephfact, anoxicmicrosites, ch4rmcnlim - use clm_varctl , only: anoxia - use clm_varpar , only: nlevdecomp, nlevdecomp_full - use CNSharedParamsMod , only: nlev_soildecomp_standard - use pftconMod , only: noveg - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(in) :: num_methp ! number of soil points in patch filter - integer , intent(in) :: filter_methp(:) ! patch filter for soil points - real(r8) , intent(in) :: rr ( bounds%begp: ) ! root respiration (fine root MR + total root GR) (gC/m2/s) - integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated - logical , intent(in) :: lake ! function called with lake filter - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenflux_type) , intent(in) :: soilbiogeochem_nitrogenflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,j,g ! indices - integer :: fc ! column index - integer :: fp ! PATCH index - real(r8) :: dtime - real(r8) :: base_decomp ! base rate (mol/m2/s) - real(r8) :: q10lake ! For now, take to be the same as q10ch4 * 1.5. - real(r8) :: q10lakebase ! (K) base temperature for lake CH4 production - real(r8) :: partition_z - real(r8) :: mino2lim ! minimum anaerobic decomposition rate as a fraction of potential aerobic rate - real(r8) :: q10ch4 ! additional Q10 for methane production ABOVE the soil decomposition temperature relationship - real(r8) :: q10ch4base ! temperature at which the effective f_ch4 actually equals the constant f_ch4 - real(r8) :: f_ch4 ! ratio of CH4 production to total C mineralization - real(r8) :: rootlitfrac ! Fraction of soil organic matter associated with roots - real(r8) :: cnscalefactor ! scale factor on CN decomposition for assigning methane flux - real(r8) :: lake_decomp_fact ! Base decomposition rate (1/s) at 25C - - ! added by Lei Meng to account for pH influence of CH4 production - real(r8) :: pHmax - real(r8) :: pHmin - real(r8) :: pH_fact_ch4 ! pH factor in methane production - - ! Factors for methanogen temperature dependence being greater than soil aerobes - real(r8) :: f_ch4_adj ! Adjusted f_ch4 - real(r8) :: t_fact_ch4 ! Temperature factor calculated using additional Q10 - ! O2 limitation on decomposition and methanogenesis - real(r8) :: seasonalfin ! finundated in excess of respiration-weighted annual average - real(r8) :: oxinhib ! inhibition of methane production by oxygen (m^3/mol) - - ! For calculating column average (rootfrac(p,j)*rr(p,j)) - real(r8) :: rr_vr(bounds%begc:bounds%endc, 1:nlevsoi) ! vertically resolved column-mean root respiration (g C/m^2/s) - real(r8), pointer :: ch4_prod_depth(:,:) ! backwards compatibility - real(r8), pointer :: o2_decomp_depth(:,:) ! backwards compatibility - real(r8), pointer :: co2_decomp_depth(:,:) ! backwards compatibility - real(r8), pointer :: conc_o2(:,:) ! backwards compatibility - - character(len=32) :: subname='ch4_prod' ! subroutine name - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(rr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - crootfr => soilstate_inst%crootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots for carbon in each soil layer (nlevsoi) - rootfr_col => soilstate_inst%rootfr_col , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) - - somhr => soilbiogeochem_carbonflux_inst%somhr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) soil organic matter heterotrophic respiration - lithr => soilbiogeochem_carbonflux_inst%lithr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) litter heterotrophic respiration - hr_vr => soilbiogeochem_carbonflux_inst%hr_vr_col , & ! Input: [real(r8) (:,:) ] total vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - o_scalar => soilbiogeochem_carbonflux_inst%o_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by anoxia - fphr => soilbiogeochem_carbonflux_inst%fphr_col , & ! Input: [real(r8) (:,:) ] fraction of potential heterotrophic respiration - - pot_f_nit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_nit_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3/s) potential soil nitrification flux - - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column - pH => ch4_inst%pH_col , & ! Input: [real(r8) (:) ] soil water pH - lake_soilc => ch4_inst%lake_soilc_col , & ! Input: [real(r8) (:,:) ] total soil organic matter found in level (g C / m^3) (nlevsoi) - annavg_finrw => ch4_inst%annavg_finrw_col , & ! Input: [real(r8) (:) ] respiration-weighted annual average of finundated - finundated_lag => ch4_inst%finundated_lag_col , & ! Input: [real(r8) (:) ] time-lagged fractional inundated area - layer_sat_lag => ch4_inst%layer_sat_lag_col , & ! Input: [real(r8) (: ,:) ] Lagged saturation status of soil layer in the unsaturated zone (1 = sat) - sif => ch4_inst%sif_col & ! Output: [real(r8) (:) ] (unitless) ratio applied to sat. prod. to account for seasonal inundation - ) - - if (sat == 0) then ! unsaturated - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Output: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - o2_decomp_depth => ch4_inst%o2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - co2_decomp_depth => ch4_inst%co2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - else ! saturated - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Output: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - co2_decomp_depth => ch4_inst%co2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - endif - - dtime = get_step_size() - - q10ch4 = params_inst%q10ch4 - q10ch4base = params_inst%q10ch4base - f_ch4 = params_inst%f_ch4 - rootlitfrac = params_inst%rootlitfrac - cnscalefactor = params_inst%cnscalefactor - lake_decomp_fact = params_inst%lake_decomp_fact - pHmax = params_inst%pHmax - pHmin = params_inst%pHmin - oxinhib = params_inst%oxinhib - q10lakebase = params_inst%q10lakebase - - ! Shared constant with other modules - mino2lim = CNParamsShareInst%mino2lim - - q10lake = q10ch4 * 1.5_r8 - - ! PATCH loop to calculate vertically resolved column-averaged root respiration - if (.not. lake) then - rr_vr(bounds%begc:bounds%endc,:) = nan - - do fp = 1, num_methc - c = filter_methc(fp) - rr_vr(c,:) = 0.0_r8 - end do - do j=1,nlevsoi - do fp = 1, num_methp - p = filter_methp(fp) - c = patch%column(p) - - if (wtcol(p) > 0._r8 .and. patch%itype(p) /= noveg) then - rr_vr(c,j) = rr_vr(c,j) + rr(p)*crootfr(p,j)*wtcol(p) - end if - end do - end do - end if - - partition_z = 1._r8 - base_decomp = 0.0_r8 - - ! column loop to partition decomposition_rate into each soil layer - do j=1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - if (.not. lake) then - - if (use_cn) then - ! Use soil heterotrophic respiration (based on Wania) - base_decomp = (somhr(c)+lithr(c)) / catomw - ! Convert from gC to molC - ! Multiply base_decomp by factor accounting for lower carbon stock in seasonally inundated areas than - ! if it were inundated all year. - ! This is to reduce emissions in seasonally inundated zones, because the eq. - ! C-flux will be less than predicted by a non-O2-lim model - if (sat == 1) then - sif(c) = 1._r8 - if (.not. anoxia) then - if (annavg_finrw(c) /= spval) then - seasonalfin = max(finundated(c)-annavg_finrw(c), 0._r8) - if (seasonalfin > 0._r8) then - sif(c) = (annavg_finrw(c) + mino2lim*seasonalfin) / finundated(c) - base_decomp = base_decomp * sif(c) - end if - end if - end if ! anoxia - end if - else - call endrun(msg=' ERROR: No source for decomp rate in CH4Prod.'//& - ' CH4 model currently requires CN.'//errMsg(sourcefile, __LINE__)) - end if ! use_cn - - ! For sensitivity studies - base_decomp = base_decomp * cnscalefactor - - else !lake - - base_decomp = lake_decomp_fact * lake_soilc(c,j) * dz(c,j) * & - q10lake**( (t_soisno(c,j)-q10lakebase)/10._r8) / catomw - ! convert from g C to mol C - end if - - ! For all landunits, prevent production or oxygen consumption when soil is at or below freezing. - ! If using VERTSOILC, it is OK to use base_decomp as given because liquid water stress will limit decomp. - if (t_soisno(c,j) <= tfrz .and. (nlevdecomp == 1 .or. lake)) base_decomp = 0._r8 - - ! depth dependence of production either from rootfr or decomp model - if (.not. lake) then ! use default rootfr, averaged to the column level in the ch4 driver, or vert HR - if (nlevdecomp == 1) then ! not VERTSOILC - if (j <= nlev_soildecomp_standard) then ! Top 5 levels are also used in the CLM code for establishing temperature - ! and moisture constraints on SOM activity - partition_z = rootfr_col(c,j)*rootlitfrac + (1._r8 - rootlitfrac)*dz(c,j)/zi(c,nlev_soildecomp_standard) - else - partition_z = rootfr_col(c,j)*rootlitfrac - end if - else - if ( (somhr(c) + lithr(c)) > 0._r8) then - partition_z = hr_vr(c,j) * dz(c,j) / (somhr(c) + lithr(c)) - else - partition_z = 1._r8 - end if - end if - else ! lake - partition_z = 1._r8 - endif - - ! Adjust f_ch4 to account for the fact that methanogens may have a higher Q10 than aerobic decomposers. - ! Note this is crude and should ideally be applied to all anaerobic decomposition rather than just the - ! f_ch4. - f_ch4_adj = 1.0_r8 - if (.not. lake) then - t_fact_ch4 = q10ch4**((t_soisno(c,j) - q10ch4base)/10._r8) - ! Adjust f_ch4 by the ratio - f_ch4_adj = f_ch4 * t_fact_ch4 - - ! Remove CN nitrogen limitation, as methanogenesis is not N limited. - ! Also remove (low) moisture limitation - if (ch4rmcnlim) then - if (j > nlevdecomp) then - if (fphr(c,1) > 0._r8) then - f_ch4_adj = f_ch4_adj / fphr(c,1) - end if - else ! j == 1 or VERTSOILC - if (fphr(c,j) > 0._r8) then - f_ch4_adj = f_ch4_adj / fphr(c,j) - end if - end if - end if - - else ! lake - f_ch4_adj = 0.5_r8 ! For lakes assume no redox limitation. Production only depends on temp, soil C, and - ! lifetime parameter. - end if - - ! If switched on, use pH factor for production based on spatial pH data defined in surface data. - if (.not. lake .and. usephfact .and. pH(c) > pHmin .and.pH(c) < pHmax) then - pH_fact_ch4 = 10._r8**(-0.2235_r8*pH(c)*pH(c) + 2.7727_r8*pH(c) - 8.6_r8) - ! fitted function using data from Dunfield et al. 1993 - ! Strictly less than one, with optimum at 6.5 - ! From Lei Meng - f_ch4_adj = f_ch4_adj * pH_fact_ch4 - else - ! if no data, then no pH effects - end if - - ! Redox factor - if ( (.not. lake) .and. sat == 1 .and. finundated_lag(c) < finundated(c)) then - f_ch4_adj = f_ch4_adj * finundated_lag(c) / finundated(c) - else if (sat == 0 .and. j > jwt(c)) then ! Assume lag in decay of alternative electron acceptors vertically - f_ch4_adj = f_ch4_adj * layer_sat_lag(c,j) - end if - ! Alternative electron acceptors will be consumed first after soil is inundated. - - f_ch4_adj = min(f_ch4_adj, 0.5_r8) - ! Must be less than 0.5 because otherwise the actual implied aerobic respiration would be negative. - ! The total of aer. respiration + methanogenesis must remain equal to the SOMHR calculated in CN, - ! so that the NEE is sensible. Even perfectly anaerobic conditions with no alternative - ! electron acceptors would predict no more than 0.5 b/c some oxygen is present in organic matter. - ! e.g. 2CH2O --> CH4 + CO2. - - - ! Decomposition uses 1 mol O2 per mol CO2 produced (happens below WT also, to deplete O2 below WT) - ! o2_decomp_depth is the demand in the absense of O2 supply limitation, in addition to autotrophic respiration. - ! Competition will be done in ch4_oxid - - o2_decomp_depth(c,j) = base_decomp * partition_z / dz (c,j) - if (anoxia) then - ! Divide off o_scalar to use potential O2-unlimited HR to represent aerobe demand for oxygen competition - if (.not. lake .and. j > nlevdecomp) then - if (o_scalar(c,1) > 0._r8) then - o2_decomp_depth(c,j) = o2_decomp_depth(c,j) / o_scalar(c,1) - end if - else if (.not. lake) then ! j == 1 or VERTSOILC - if (o_scalar(c,j) > 0._r8) then - o2_decomp_depth(c,j) = o2_decomp_depth(c,j) / o_scalar(c,j) - end if - end if - end if ! anoxia - - ! Add root respiration - if (.not. lake) then - o2_decomp_depth(c,j) = o2_decomp_depth(c,j) + rr_vr(c,j)/catomw/dz(c,j) ! mol/m^3/s - ! g C/m2/s ! gC/mol O2 ! m - end if - - ! Add oxygen demand for nitrification - if (use_nitrif_denitrif) then - if (.not. lake .and. j<= nlevdecomp_full ) then - o2_decomp_depth(c,j) = o2_decomp_depth(c,j) + pot_f_nit_vr(c,j) * 2.0_r8/14.0_r8 - ! g N/m^3/s mol O2 / g N - end if - end if - - if (j > jwt(c)) then ! Below the water table so anaerobic CH4 production can occur - ! partition decomposition to layer - ! turn into per volume-total by dz - ch4_prod_depth(c,j) = f_ch4_adj * base_decomp * partition_z / dz (c,j)! [mol/m3-total/s] - else ! Above the WT - if (anoxicmicrosites) then - ch4_prod_depth(c,j) = f_ch4_adj * base_decomp * partition_z / dz (c,j) & - / (1._r8 + oxinhib*conc_o2(c,j)) - else - ch4_prod_depth(c,j) = 0._r8 ! [mol/m3 total/s] - endif ! anoxicmicrosites - endif ! WT - - end do ! fc - end do ! nlevsoi - - end associate - - end subroutine ch4_prod - - !----------------------------------------------------------------------- - subroutine ch4_oxid (bounds, & - num_methc, filter_methc, & - jwt, sat, lake, & - waterstate_inst, soilstate_inst, temperature_inst, ch4_inst) - ! - ! !DESCRIPTION: - ! Oxidation is based on double Michaelis-Mentin kinetics, and is adjusted for low soil moisture. - ! Oxidation will be limited by available oxygen in ch4_tran. - - ! !USES: - use clm_time_manager, only : get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated - logical , intent(in) :: lake ! function called with lake filter - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(ch4_type) , intent(in) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j ! indices - integer :: fc ! column index - real(r8) :: dtime ! land model time step (sec) - real(r8):: t0 ! Base temperature for Q10 - real(r8):: porevol ! air-filled volume ratio to total soil volume - real(r8):: h2osoi_vol_min ! h2osoi_vol restricted to be below watsat - real(r8):: conc_ch4_rel ! concentration with respect to water volume (mol/m^3 water) - real(r8):: conc_o2_rel ! concentration with respect to water volume (mol/m^3 water) - real(r8):: oxid_a ! Oxidation predicted by method A (temperature & enzyme limited) (mol CH4/m3/s) - real(r8):: smp_fact ! factor for reduction based on soil moisture (unitless) - real(r8):: porewatfrac ! fraction of soil pore space that is filled with water - real(r8):: k_h_cc, k_h_inv ! see functions below for description - real(r8):: k_m_eff ! effective k_m - real(r8):: vmax_eff ! effective vmax - ! ch4 oxidation parameters - real(r8) :: vmax_ch4_oxid ! oxidation rate constant (= 45.e-6_r8 * 1000._r8 / 3600._r8) [mol/m3-w/s]; - real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration - real(r8) :: q10_ch4oxid ! Q10 oxidation constant - real(r8) :: smp_crit ! Critical soil moisture potential - real(r8) :: k_m_o2 ! Michaelis-Menten oxidation rate constant for O2 concentration - real(r8) :: k_m_unsat ! Michaelis-Menten oxidation rate constant for CH4 concentration - real(r8) :: vmax_oxid_unsat ! (= 45.e-6_r8 * 1000._r8 / 3600._r8 / 10._r8) [mol/m3-w/s] - ! - real(r8), pointer :: ch4_oxid_depth(:,:) - real(r8), pointer :: o2_oxid_depth(:,:) - real(r8), pointer :: co2_oxid_depth(:,:) - real(r8), pointer :: o2_decomp_depth(:,:) - real(r8), pointer :: conc_o2(:,:) - real(r8), pointer :: conc_ch4(:,:) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (: ,:) ] soil matrix potential [mm] - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - ) - - if (sat == 0) then ! unsaturated - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - o2_oxid_depth => ch4_inst%o2_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - co2_oxid_depth => ch4_inst%co2_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - o2_decomp_depth => ch4_inst%o2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - else ! saturated - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Output: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - o2_oxid_depth => ch4_inst%o2_oxid_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - co2_oxid_depth => ch4_inst%co2_oxid_depth_sat_col ! Output: [real(r8) (:,:)] CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - endif - - ! Get land model time step - dtime = get_step_size() - - ! Set oxidation parameters - vmax_ch4_oxid = params_inst%vmax_ch4_oxid - k_m = params_inst%k_m - q10_ch4oxid = params_inst%q10_ch4oxid - smp_crit = params_inst%smp_crit - k_m_o2 = params_inst%k_m_o2 - k_m_unsat = params_inst%k_m_unsat - vmax_oxid_unsat = params_inst%vmax_oxid_unsat - - t0 = tfrz + 12._r8 ! Walter, for Michigan site where the 45 M/h comes from - - ! Loop to determine oxidation in each layer - do j=1,nlevsoi - do fc = 1, num_methc - c = filter_methc(fc) - - if (sat == 1 .or. j > jwt(c)) then - ! Literature (e.g. Bender & Conrad, 1992) suggests lower k_m and vmax for high-CH4-affinity methanotrophs in - ! upland soils consuming ambient methane. - k_m_eff = k_m - vmax_eff = vmax_ch4_oxid - else - k_m_eff = k_m_unsat - vmax_eff = vmax_oxid_unsat - end if - - porevol = max(watsat(c,j) - h2osoi_vol(c,j), 0._r8) - h2osoi_vol_min = min(watsat(c,j), h2osoi_vol(c,j)) - if (j <= jwt(c) .and. smp_l(c,j) < 0._r8) then - smp_fact = exp(-smp_l(c,j)/smp_crit) - ! Schnell & King, 1996, Figure 3 - else - smp_fact = 1._r8 - end if - - if (j <= jwt(c)) then ! Above the water table - k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) - k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - conc_ch4_rel = conc_ch4(c,j) / (h2osoi_vol_min + porevol/k_h_cc) - - k_h_inv = exp(-c_h_inv(2) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(2))) - k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - conc_o2_rel = conc_o2(c,j) / (h2osoi_vol_min + porevol/k_h_cc) - else - conc_ch4_rel = conc_ch4(c,j) / watsat(c,j) - conc_o2_rel = conc_o2(c,j) / watsat(c,j) - endif - - oxid_a = vmax_eff * h2osoi_vol_min* conc_ch4_rel / (k_m_eff + conc_ch4_rel) & - ![mol/m3-t/s] [mol/m3-w/s] [m3-w/m3-t] [mol/m3-w] [mol/m3-w] [mol/m3-w] - * conc_o2_rel / (k_m_o2 + conc_o2_rel) & - * q10_ch4oxid ** ((t_soisno(c,j) - t0) / 10._r8) * smp_fact - - ! For all landunits / levels, prevent oxidation if at or below freezing - if (t_soisno(c,j) <= tfrz) oxid_a = 0._r8 - - ch4_oxid_depth(c,j) = oxid_a - o2_oxid_depth(c,j) = ch4_oxid_depth(c,j) * 2._r8 - - end do - end do - - end associate - end subroutine ch4_oxid - - !----------------------------------------------------------------------- - subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & - annsum_npp, jwt, sat, lake, & - canopystate_inst, soilstate_inst, temperature_inst, energyflux_inst, & - waterstate_inst, waterflux_inst, ch4_inst) - ! - ! !DESCRIPTION: - ! Arctic c3 grass (which is often present in fens) and all vegetation in inundated areas is assumed to have - ! some root porosity. Currently, root porosity is allowed to be different for grasses & non-grasses. - ! CH4 diffuses out and O2 diffuses into the soil. CH4 is also lossed via transpiration, which is both - ! included in the "aere" variables and output separately. In practice this value is small. - ! By default upland veg. has small 5% porosity but this can be switched to be equal to inundated porosity. - - ! !USES: - use clm_varcon , only : rpi - use clm_time_manager , only : get_step_size - use pftconMod , only : nc3_arctic_grass, nc3_nonarctic_grass, nc4_grass, noveg, pftcon - use ch4varcon , only : transpirationloss, use_aereoxid_prog - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(in) :: num_methp ! number of soil points in patch filter - integer , intent(in) :: filter_methp(:) ! patch filter for soil points - real(r8) , intent(in) :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr) - integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated - logical , intent(in) :: lake ! function called with lake filter - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,g,j ! indices - integer :: fc,fp ! soil filter column index - integer :: itype ! temporary - real(r8) :: f_oxid ! fraction of CH4 oxidized in oxic zone around roots - real(r8) :: diffus_aere ! gas diffusivity through aerenchyma (m^2/s) - real(r8) :: m_tiller - real(r8) :: n_tiller - real(r8) :: poros_tiller - real(r8) :: rob ! root obliquity, e.g. csc of root angle relative to vertical - ! (ratio of root total length to depth) - real(r8) :: area_tiller ! cross-sectional area of tillers (m^2/m^2) - real(r8) :: tranloss ! loss due to transpiration (mol / m3 /s) - real(r8) :: aere, aeretran, oxaere ! (mol / m3 /s) - real(r8) :: k_h_cc, k_h_inv, dtime, oxdiffus, anpp, nppratio, h2osoi_vol_min, conc_ch4_wat - real(r8) :: aerecond ! aerenchyma conductance (m/s) - ! ch4 aerenchyma parameters - real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere - real(r8) :: scale_factor_aere ! scale factor on the aerenchyma area for sensitivity tests - real(r8) :: nongrassporosratio ! Ratio of root porosity in non-grass to grass, used for aerenchyma transport - real(r8) :: unsat_aere_ratio ! Ratio to multiply upland vegetation aerenchyma porosity by compared to inundated systems (= 0.05_r8 / 0.3_r8) - real(r8) :: porosmin ! minimum aerenchyma porosity (unitless)(= 0.05_r8) - - real(r8), parameter :: smallnumber = 1.e-12_r8 - - real(r8), pointer :: ch4_aere_depth(:,:) - real(r8), pointer :: ch4_tran_depth(:,:) - real(r8), pointer :: o2_aere_depth(:,:) - real(r8), pointer :: co2_aere_depth(:,:) - real(r8), pointer :: ch4_oxid_depth(:,:) - real(r8), pointer :: ch4_prod_depth(:,:) - real(r8), pointer :: conc_o2(:,:) - real(r8), pointer :: conc_ch4(:,:) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(annsum_npp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) - - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - rootr => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer (nlevgrnd) - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - - canopy_cond => energyflux_inst%canopy_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for canopy [m/s] - - annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average aboveground NPP - annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average belowground NPP - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - c_atm => ch4_inst%c_atm_grc & ! Input: [real(r8) (: ,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) - ) - - if (sat == 0) then ! unsaturated - ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_tran_depth => ch4_inst%ch4_tran_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) - o2_aere_depth => ch4_inst%o2_aere_depth_unsat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - co2_aere_depth => ch4_inst%co2_aere_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Input: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - else ! saturated - ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_tran_depth => ch4_inst%ch4_tran_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) - o2_aere_depth => ch4_inst%o2_aere_depth_sat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - co2_aere_depth => ch4_inst%co2_aere_depth_sat_col ! Output: [real(r8) (:,:)] CO2 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Input: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) - endif - - dtime = get_step_size() - - ! Set aerenchyma parameters - aereoxid = params_inst%aereoxid - scale_factor_aere = params_inst%scale_factor_aere - nongrassporosratio = params_inst%nongrassporosratio - unsat_aere_ratio = params_inst%unsat_aere_ratio - porosmin = params_inst%porosmin - rob = params_inst%rob - - ! Initialize ch4_aere_depth - do j=1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - ch4_aere_depth(c,j) = 0._r8 - ch4_tran_depth(c,j) = 0._r8 - o2_aere_depth(c,j) = 0._r8 - end do - end do - - diffus_aere = d_con_g(1,1)*1.e-4_r8 ! for CH4: m^2/s - ! This parameter is poorly constrained and should be done on a patch-specific basis... - - ! point loop to partition aerenchyma flux into each soil layer - if (.not. lake) then - do j=1,nlevsoi - do fp = 1, num_methp - p = filter_methp (fp) - c = patch%column(p) - g = col%gridcell(c) - - ! Calculate transpiration loss - if (transpirationloss .and. patch%itype(p) /= noveg) then !allow tloss above WT ! .and. j > jwt(c)) then - ! Calculate water concentration - h2osoi_vol_min = min(watsat(c,j), h2osoi_vol(c,j)) - k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) - k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm - conc_ch4_wat = conc_ch4(c,j) / ( (watsat(c,j)-h2osoi_vol_min)/k_h_cc + h2osoi_vol_min) - - tranloss = conc_ch4_wat * rootr(p,j)*qflx_tran_veg(p) / dz(c,j) / 1000._r8 - ! mol/m3/s mol/m3 mm / s m mm/m - ! Use rootr here for effective per-layer transpiration, which may not be the same as rootfr - tranloss = max(tranloss, 0._r8) ! in case transpiration is pathological - else - tranloss = 0._r8 - end if - - ! Calculate aerenchyma diffusion - if (j > jwt(c) .and. t_soisno(c,j) > tfrz .and. patch%itype(p) /= noveg) then - ! Attn EK: This calculation of aerenchyma properties is very uncertain. Let's check in once all - ! the new components are in; if there is any tuning to be done to get a realistic global flux, - ! this would probably be the place. We will have to document clearly in the Tech Note - ! any major changes from the Riley et al. 2011 version. (There are a few other minor ones.) - - anpp = annsum_npp(p) ! g C / m^2/yr - anpp = max(anpp, 0._r8) ! NPP can be negative b/c of consumption of storage pools - - if (annavg_agnpp(p) /= spval .and. annavg_bgnpp(p) /= spval .and. & - annavg_agnpp(p) > 0._r8 .and. annavg_bgnpp(p) > 0._r8) then - nppratio = annavg_bgnpp(p) / (annavg_agnpp(p) + annavg_bgnpp(p)) - else - nppratio = 0.5_r8 - end if - - ! Estimate area of tillers (see Wania thesis) - ! m_tiller = anpp * r_leaf_root * lai ! (4.17 Wania) - ! m_tiller = 600._r8 * 0.5_r8 * 2._r8 ! used to be 300 - ! Note: this calculation is based on Arctic graminoids, and should be refined for woody plants, if not - ! done on a patch-specific basis. - - m_tiller = anpp * nppratio * 4._r8 !replace the elai(p) by constant 4 (by Xiyan Xu, 05/2016) - - n_tiller = m_tiller / 0.22_r8 - - itype = patch%itype(p) - if (itype == nc3_arctic_grass .or. pftcon%crop(itype) == 1 .or. & - itype == nc3_nonarctic_grass .or. itype == nc4_grass) then - poros_tiller = 0.3_r8 ! Colmer 2003 - else - poros_tiller = 0.3_r8 * nongrassporosratio - end if - - if (sat == 0) then - poros_tiller = poros_tiller * unsat_aere_ratio - end if - - poros_tiller = max(poros_tiller, porosmin) - - area_tiller = scale_factor_aere * n_tiller * poros_tiller * rpi * 2.9e-3_r8**2._r8 ! (m2/m2) - - k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) ! (4.12) Wania (L atm/mol) - k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - aerecond = area_tiller * rootfr(p,j) * diffus_aere / (z(c,j)*rob) - ! Add in boundary layer resistance - aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond(p)+smallnumber)) - - aere = aerecond * (conc_ch4(c,j)/watsat(c,j)/k_h_cc - c_atm(g,1)) / dz(c,j) ![mol/m3-total/s] - !ZS: Added watsat & Henry's const. - aere = max(aere, 0._r8) ! prevent backwards diffusion - - ! Do oxygen diffusion into layer - k_h_inv = exp(-c_h_inv(2) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(2))) - k_h_cc = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - oxdiffus = diffus_aere * d_con_g(2,1) / d_con_g(1,1) ! adjust for O2:CH4 molecular diffusion - aerecond = area_tiller * rootfr(p,j) * oxdiffus / (z(c,j)*rob) - aerecond = 1._r8 / (1._r8/(aerecond+smallnumber) + 1._r8/(grnd_ch4_cond(p)+smallnumber)) - oxaere = -aerecond *(conc_o2(c,j)/watsat(c,j)/k_h_cc - c_atm(g,2)) / dz(c,j) ![mol/m3-total/s] - oxaere = max(oxaere, 0._r8) - ! Diffusion in is positive; prevent backwards diffusion - if ( .not. use_aereoxid_prog ) then ! fixed aere oxid proportion; will be done in ch4_tran - oxaere = 0._r8 - end if - else - aere = 0._r8 - oxaere = 0._r8 - end if ! veg type, below water table, & above freezing - - ! Impose limitation based on available methane during timestep - ! By imposing the limitation here, don't allow aerenchyma access to methane from other Patches. - aeretran = min(aere+tranloss, conc_ch4(c,j)/dtime + ch4_prod_depth(c,j)) - ch4_aere_depth (c, j) = ch4_aere_depth(c,j) + aeretran*wtcol(p) ! patch weight in col. - ch4_tran_depth (c, j) = ch4_tran_depth(c,j) + min(tranloss, aeretran)*wtcol(p) - o2_aere_depth (c, j) = o2_aere_depth (c,j) + oxaere*wtcol(p) - end do ! p filter - end do ! over levels - end if ! not lake - - end associate - - end subroutine ch4_aere - - !----------------------------------------------------------------------- - subroutine ch4_ebul (bounds, & - num_methc, filter_methc, & - jwt, sat, lake, & - atm2lnd_inst, temperature_inst, lakestate_inst, soilstate_inst, waterstate_inst, & - ch4_inst) - ! - ! !DESCRIPTION: - ! Bubbling is based on temperature & pressure dependent solubility (k_h_cc), - ! with assumed proportion of bubbles - ! which are CH4, and assumed early nucleation at vgc_max sat (Wania). - ! Bubbles are released to the water table surface in ch4_tran. - - ! !USES: - use clm_time_manager , only : get_step_size - use LakeCon - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated - logical , intent(in) :: lake ! function called with lake filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(in) :: temperature_inst - type(lakestate_type) , intent(in) :: lakestate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j ! indices - integer :: fc ! soil filter column index - integer :: fp ! soil filter patch index - real(r8) :: dtime ! land model time step (sec) - real(r8) :: vgc ! volumetric CH4 content (m3 CH4/m3 pore air) - real(r8) :: vgc_min ! minimum aqueous CH4 content when ebullition ceases - real(r8) :: k_h_inv ! - real(r8) :: k_h ! - real(r8) :: k_h_cc ! - real(r8) :: pressure! sum atmospheric and hydrostatic pressure - real(r8) :: bubble_f! CH4 content in gas bubbles (Kellner et al. 2006) - real(r8) :: ebul_timescale - real(r8) :: vgc_max ! ratio of saturation pressure triggering ebullition - real(r8), pointer :: ch4_ebul_depth(:,:) ! backwards compatibility - real(r8), pointer :: ch4_ebul_total(:) ! backwards compatibility - real(r8), pointer :: conc_ch4(:,:) ! backwards compatibility - real(r8), pointer :: ch4_aere_depth(:,:) ! backwards compatibility - real(r8), pointer :: ch4_oxid_depth(:,:) ! backwards compatibility - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - lakedepth => col%lakedepth , & ! Input: [real(r8) (:) ] column lake depth (m) - - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Input: [real(r8) (:,:) ] mass fraction of lake layer that is frozen - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - if (sat == 0) then ! unsaturated - ch4_ebul_depth => ch4_inst%ch4_ebul_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - else ! saturated - ch4_ebul_depth => ch4_inst%ch4_ebul_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Input: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - endif - - ! Get land model time step - dtime = get_step_size() - vgc_max = params_inst%vgc_max - - bubble_f = 0.57_r8 ! CH4 content in gas bubbles (Kellner et al. 2006) - vgc_min = vgc_max - ebul_timescale = dtime ! Allow fast bubbling - - ! column loop to estimate ebullition CH4 flux from each soil layer - do j=1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - if (j > jwt(c) .and. t_soisno(c,j) > tfrz) then ! Ebullition occurs only below the water table - - k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) ! (4.12 Wania) (atm.L/mol) - k_h = 1._r8 / k_h_inv ! (mol/L.atm) - k_h_cc = t_soisno(c,j) * k_h * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - - if (.not. lake) then - pressure = forc_pbot(c) + denh2o * grav * (z(c,j)-zi(c,jwt(c))) ! (Pa) - if (sat == 1 .and. frac_h2osfc(c) > 0._r8) then ! Add ponding pressure head - pressure = pressure + denh2o * grav * h2osfc(c)/1000._r8/frac_h2osfc(c) - ! mm / mm/m - end if - else - pressure = forc_pbot(c) + denh2o * grav * (z(c,j) + lakedepth(c)) - end if - - ! Compare partial pressure to ambient pressure. - vgc = conc_ch4(c,j) / watsat(c,j) / k_h_cc * rgasm * t_soisno(c,j) / pressure - ! [mol/m3t] [m3w/m3t] [m3g/m3w] [Pa/(mol/m3g)] [Pa] - - if (vgc > vgc_max * bubble_f) then ! If greater than max value, remove amount down to vgc_min - ch4_ebul_depth (c,j) = (vgc - vgc_min * bubble_f) * conc_ch4(c,j) / ebul_timescale - ! [mol/m3t/s] [mol/m3t] [s] - else - ch4_ebul_depth (c,j) = 0._r8 - endif - - else ! above the water table or freezing - ch4_ebul_depth (c,j) = 0._r8 - endif ! below the water table and not freezing - - ! Prevent ebullition from reaching the surface for frozen lakes - if (lake .and. lake_icefrac(c,1) > 0.1_r8) ch4_ebul_depth(c,j) = 0._r8 - - end do ! fc - end do ! j - - end associate - - end subroutine ch4_ebul - - !----------------------------------------------------------------------- - subroutine ch4_tran (bounds, & - num_methc, filter_methc, & - jwt, dtime_ch4, sat, lake, & - soilstate_inst, temperature_inst, waterstate_inst, energyflux_inst, ch4_inst) - ! - ! !DESCRIPTION: - ! Solves the reaction & diffusion equation for the timestep. First "competition" between processes for - ! CH4 & O2 demand is done. Then concentrations are apportioned into gas & liquid fractions; only the gas - ! fraction is considered for diffusion in unsat. Snow and lake water resistance to diffusion is added as - ! a bulk term in the ground conductance (which is really a surface layer conductance), but concentrations - ! are not tracked and oxidation is not allowed inside snow and lake water. - ! Diffusivity is set based on soil texture and organic matter fraction. A Crank-Nicholson solution is used. - ! Then CH4 diffusive flux is calculated and consistency is checked. - - ! !USES: - use clm_time_manager , only : get_step_size, get_nstep - use TridiagonalMod , only : Tridiagonal - use ch4varcon , only : ch4frzout, use_aereoxid_prog - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - integer , intent(in) :: sat ! 0 = unsaturated; 1 = saturated - logical , intent(in) :: lake ! function called with lake filter - real(r8) , intent(in) :: dtime_ch4 ! time step for ch4 calculations - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,g,p,s,i,ll ! indices - integer :: fc ! soil filter column index - integer :: fp ! soil filter patch index - integer :: jtop(bounds%begc:bounds%endc) ! top level at each column - integer :: iter ! iteration counter when dtime_ch4 < dtime - real(r8) :: dtime ! land model time step (sec) - real(r8) :: at (bounds%begc:bounds%endc,0:nlevsoi) ! "a" vector for tridiagonal matrix - real(r8) :: bt (bounds%begc:bounds%endc,0:nlevsoi) ! "b" vector for tridiagonal matrix - real(r8) :: ct (bounds%begc:bounds%endc,0:nlevsoi) ! "c" vector for tridiagonal matrix - real(r8) :: rt (bounds%begc:bounds%endc,0:nlevsoi) ! "r" vector for tridiagonal solution - real(r8) :: f_a ! air-filled fraction of available pore space - real(r8) :: diffus (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity (m2/s) - real(r8) :: k_h_inv ! 1/Henry's Law Constant in Latm/mol - real(r8) :: k_h_cc(bounds%begc:bounds%endc,0:nlevsoi,ngases) ! ratio of mol/m3 in liquid to mol/m3 in gas - real(r8) :: dzj ! - real(r8) :: dp1_zp1 (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity/delta_z for next j - real(r8) :: dm1_zm1 (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity/delta_z for previous j - real(r8) :: t_soisno_c ! soil temperature (C) (-nlevsno+1:nlevsoi) - real(r8) :: eps ! either epsilon_a or epsilon_w, depending on where in soil, wrt WT - real(r8) :: deficit ! mol CH4 /m^2 that must be subtracted from diffusive flux to atm. to make up - ! for keeping concentrations always above zero - real(r8) :: conc_ch4_bef(bounds%begc:bounds%endc,1:nlevsoi) ! concentration at the beginning of the timestep - real(r8) :: errch4(bounds%begc:bounds%endc) ! Error (Mol CH4 /m^2) [+ = too much CH4] - real(r8) :: conc_ch4_rel(bounds%begc:bounds%endc,0:nlevsoi) ! Concentration per volume of air or water - real(r8) :: conc_o2_rel(bounds%begc:bounds%endc,0:nlevsoi) ! Concentration per volume of air or water - real(r8) :: conc_ch4_rel_old(bounds%begc:bounds%endc,0:nlevsoi) ! Concentration during last Crank-Nich. loop - real(r8) :: h2osoi_vol_min(bounds%begc:bounds%endc,1:nlevsoi) ! h2osoi_vol restricted to be <= watsat - real(r8), parameter :: smallnumber = 1.e-12_r8 - real(r8) :: snowdiff ! snow diffusivity (m^2/s) - real(r8) :: snowres(bounds%begc:bounds%endc) ! Cumulative Snow resistance (s/m). Also includes - real(r8) :: pondres ! Additional resistance from ponding, up to pondmx water on top of top soil layer (s/m) - real(r8) :: pondz ! Depth of ponding (m) - real(r8) :: ponddiff ! Pondwater diffusivity (m^2/s) - real(r8) :: spec_grnd_cond(bounds%begc:bounds%endc,1:ngases) ! species grnd conductance (s/m) - real(r8) :: airfrac ! air fraction in snow - real(r8) :: waterfrac ! water fraction in snow - real(r8) :: icefrac ! ice fraction in snow - real(r8) :: epsilon_t (bounds%begc:bounds%endc,1:nlevsoi,1:ngases) ! - real(r8) :: epsilon_t_old (bounds%begc:bounds%endc,1:nlevsoi,1:ngases) ! epsilon_t from last time step !Currently deprecated - real(r8) :: source (bounds%begc:bounds%endc,1:nlevsoi,1:ngases) ! source - real(r8) :: source_old (bounds%begc:bounds%endc,1:nlevsoi,1:ngases) ! source from last time step !Currently deprecated - real(r8) :: om_frac ! organic matter fraction - real(r8) :: o2demand, ch4demand ! mol/m^3/s - real(r8) :: liqfrac(bounds%begc:bounds%endc, 1:nlevsoi) - real(r8) :: capthick ! (mm) min thickness before assuming h2osfc is impermeable - real(r8) :: satpow ! exponent on watsat for saturated soil solute diffusion - real(r8) :: scale_factor_gasdiff ! For sensitivity tests; convection would allow this to be > 1 - real(r8) :: scale_factor_liqdiff ! For sensitivity tests; convection would allow this to be > 1 - real(r8) :: organic_max ! organic matter content (kg/m3) where soil is assumed to act like peat - real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere - - real(r8), pointer :: ch4_prod_depth (:,:) - real(r8), pointer :: ch4_oxid_depth (:,:) - real(r8), pointer :: ch4_aere_depth (:,:) - real(r8), pointer :: ch4_surf_aere (:) - real(r8), pointer :: ch4_ebul_depth (:,:) - real(r8), pointer :: ch4_ebul_total (:) - real(r8), pointer :: ch4_surf_ebul (:) - real(r8), pointer :: ch4_surf_diff (:) - real(r8), pointer :: o2_oxid_depth (:,:) - real(r8), pointer :: o2_decomp_depth (:,:) - real(r8), pointer :: o2_aere_depth (:,:) - real(r8), pointer :: o2stress (:,:) - real(r8), pointer :: ch4stress (:,:) - real(r8), pointer :: co2_decomp_depth (:,:) - real(r8), pointer :: conc_o2 (:,:) - real(r8), pointer :: conc_ch4 (:,:) - - integer :: nstep ! time step number - character(len=32) :: subname='ch4_tran' ! subroutine name - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - snl => col%snl , & ! Input: [integer (:) ] negative of number of snow layers - - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - cellorg => soilstate_inst%cellorg_col , & ! Input: [real(r8) (:,:) ] column 3D org (kg/m^3 organic matter) (nlevgrnd) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) [for snow & soil layers] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) [for snow & soil layers] - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - - c_atm => ch4_inst%c_atm_grc , & ! Input: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) - - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_col & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - ) - - if (sat == 0) then ! unsaturated - o2_decomp_depth => ch4_inst%o2_decomp_depth_unsat_col ! Output: [real(r8) (:,:) ] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - o2stress => ch4_inst%o2stress_unsat_col ! Output: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) - ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_surf_aere => ch4_inst%ch4_surf_aere_unsat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) - ch4_ebul_depth => ch4_inst%ch4_ebul_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) - ch4_surf_ebul => ch4_inst%ch4_surf_ebul_unsat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_diff => ch4_inst%ch4_surf_diff_unsat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - o2_oxid_depth => ch4_inst%o2_oxid_depth_unsat_col ! Output: [real(r8) (:,:) ] O2 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - o2_aere_depth => ch4_inst%o2_aere_depth_unsat_col ! Output: [real(r8) (:,:) ] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4stress => ch4_inst%ch4stress_unsat_col ! Output: [real(r8) (:,:) ] Ratio of methane available to the total per-timestep methane sinks (nlevsoi) - co2_decomp_depth => ch4_inst%co2_decomp_depth_unsat_col ! Output: [real(r8) (:,:) ] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - else ! saturated - o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:) ] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - o2stress => ch4_inst%o2stress_sat_col ! Output: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) - ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_surf_aere => ch4_inst%ch4_surf_aere_sat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) - ch4_ebul_depth => ch4_inst%ch4_ebul_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) - ch4_surf_ebul => ch4_inst%ch4_surf_ebul_sat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_diff => ch4_inst%ch4_surf_diff_sat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - o2_oxid_depth => ch4_inst%o2_oxid_depth_sat_col ! Output: [real(r8) (:,:) ] O2 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - o2_aere_depth => ch4_inst%o2_aere_depth_sat_col ! Output: [real(r8) (:,:) ] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4stress => ch4_inst%ch4stress_sat_col ! Output: [real(r8) (:,:) ] Ratio of methane available to the total per-timestep methane sinks (nlevsoi) - co2_decomp_depth => ch4_inst%co2_decomp_depth_sat_col ! Output: [real(r8) (:,:) ] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - endif - - ! Get land model time step - dtime = get_step_size() - nstep = get_nstep() - - ! Set transport parameters - satpow = params_inst%satpow - scale_factor_gasdiff = params_inst%scale_factor_gasdiff - scale_factor_liqdiff = params_inst%scale_factor_liqdiff - capthick = params_inst%capthick - aereoxid = params_inst%aereoxid - - ! Set shared constant - organic_max = CNParamsShareInst%organic_max - - ! Perform competition for oxygen and methane in each soil layer if demands over the course of the timestep - ! exceed that available. Assign to each process in proportion to the quantity demanded in the absense of - ! the limitation. - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - o2demand = o2_decomp_depth(c,j) + o2_oxid_depth(c,j) ! o2_decomp_depth includes autotrophic root respiration - if (o2demand > 0._r8) then - if ( (conc_o2(c,j) / dtime + o2_aere_depth(c,j)) > o2demand )then - o2stress(c,j) = 1._r8 - else - o2stress(c,j) = (conc_o2(c,j) / dtime + o2_aere_depth(c,j)) / o2demand - end if - else - o2stress(c,j) = 1._r8 - end if - - ch4demand = ch4_oxid_depth(c,j) + ch4_aere_depth(c,j) + ch4_ebul_depth(c,j) - if (ch4demand > 0._r8) then - ch4stress(c,j) = min((conc_ch4(c,j) / dtime + ch4_prod_depth(c,j)) / ch4demand, 1._r8) - else - ch4stress(c,j) = 1._r8 - end if - - ! Resolve methane oxidation - if (o2stress(c,j) < 1._r8 .or. ch4stress(c,j) < 1._r8) then - if (ch4stress(c,j) <= o2stress(c,j)) then ! methane limited - if (o2stress(c,j) < 1._r8) then - ! Recalculate oxygen limitation - o2demand = o2_decomp_depth(c,j) - if (o2demand > 0._r8) then - o2stress(c,j) = min( (conc_o2(c,j) / dtime + o2_aere_depth(c,j) - ch4stress(c,j)*o2_oxid_depth(c,j) ) & - / o2demand, 1._r8) - else - o2stress(c,j) = 1._r8 - end if - end if - ! Reset oxidation - ch4_oxid_depth(c,j) = ch4_oxid_depth(c,j) * ch4stress(c,j) - o2_oxid_depth(c,j) = o2_oxid_depth(c,j) * ch4stress(c,j) - else ! oxygen limited - if (ch4stress(c,j) < 1._r8) then - ! Recalculate methane limitation - ch4demand = ch4_aere_depth(c,j) + ch4_ebul_depth(c,j) - if (ch4demand > 0._r8) then - ch4stress(c,j) = min( (conc_ch4(c,j) / dtime + ch4_prod_depth(c,j) - & - o2stress(c,j)*ch4_oxid_depth(c,j)) / ch4demand, 1._r8) - else - ch4stress(c,j) = 1._r8 - end if - end if - ! Reset oxidation - ch4_oxid_depth(c,j) = ch4_oxid_depth(c,j) * o2stress(c,j) - o2_oxid_depth(c,j) = o2_oxid_depth(c,j) * o2stress(c,j) - end if - end if - - ! Reset non-methanotroph demands - ch4_aere_depth(c,j) = ch4_aere_depth(c,j) * ch4stress(c,j) - ch4_ebul_depth(c,j) = ch4_ebul_depth(c,j) * ch4stress(c,j) - o2_decomp_depth(c,j) = o2_decomp_depth(c,j) * o2stress(c,j) - - end do !c - end do !j - - - ! Accumulate ebullition to place in first layer above water table, or directly to atmosphere - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - if (j == 1) ch4_ebul_total(c) = 0._r8 - ch4_ebul_total(c) = ch4_ebul_total(c) + ch4_ebul_depth(c,j) * dz(c,j) - enddo - enddo - - - ! Set the Henry's Law coefficients - do j = 0,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - do s=1,2 - if (j == 0) then - k_h_inv = exp(-c_h_inv(s) * (1._r8 / t_grnd(c) - 1._r8 / kh_tbase) + log (kh_theta(s))) - ! (4.12) Wania (L atm/mol) - k_h_cc(c,j,s) = t_grnd(c) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - else - k_h_inv = exp(-c_h_inv(s) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(s))) - ! (4.12) Wania (L atm/mol) - k_h_cc(c,j,s) = t_soisno(c,j) / k_h_inv * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] - end if - end do - end do - end do - - - ! Set the source term for each species (no need to do j=0, since epsilon_t and source not used there) - ! Note that because of the semi-implicit diffusion and the 30 min timestep combined with explicit - ! sources, occasionally negative concentration will result. In this case it is brought to zero and the - ! surface flux is adjusted to conserve. This results in some inaccuracy as compared to a shorter timestep - ! or iterative solution. - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - if ( .not. use_aereoxid_prog ) then - ! First remove the CH4 oxidation that occurs at the base of root tissues (aere), and add to oxidation - ch4_oxid_depth(c,j) = ch4_oxid_depth(c,j) + aereoxid * ch4_aere_depth(c,j) - ch4_aere_depth(c,j) = ch4_aere_depth(c,j) - aereoxid * ch4_aere_depth(c,j) - end if ! else oxygen is allowed to diffuse in via aerenchyma - - source(c,j,1) = ch4_prod_depth(c,j) - ch4_oxid_depth(c,j) - & - ch4_aere_depth(c,j) - ch4_ebul_depth(c,j) ! [mol/m3-total/s] - ! aerenchyma added to surface flux below - ! ebul added to soil depth just above WT - if (source(c,j,1) + conc_ch4(c,j) / dtime < -1.e-12_r8) then - write(iulog,*) 'Methane demands exceed methane available. Error in methane competition (mol/m^3/s), c,j:', & - source(c,j,1) + conc_ch4(c,j) / dtime, c, j - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Methane demands exceed methane available.'& - //errMsg(sourcefile, __LINE__)) - else if (ch4stress(c,j) < 1._r8 .and. source(c,j,1) + conc_ch4(c,j) / dtime > 1.e-12_r8) then - write(iulog,*) 'Methane limited, yet some left over. Error in methane competition (mol/m^3/s), c,j:', & - source(c,j,1) + conc_ch4(c,j) / dtime, c, j - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Methane limited, yet some left over.'//& - errMsg(sourcefile, __LINE__)) - end if - - source(c,j,2) = -o2_oxid_depth(c,j) - o2_decomp_depth(c,j) + o2_aere_depth(c,j) ! O2 [mol/m3/s] - if (source(c,j,2) + conc_o2(c,j) / dtime < -1.e-12_r8) then - write(iulog,*) 'Oxygen demands exceed oxygen available. Error in oxygen competition (mol/m^3/s), c,j:', & - source(c,j,2) + conc_o2(c,j) / dtime, c, j - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Oxygen demands exceed oxygen available.'//& - errMsg(sourcefile, __LINE__) ) - else if (o2stress(c,j) < 1._r8 .and. source(c,j,2) + conc_o2(c,j) / dtime > 1.e-12_r8) then - write(iulog,*) 'Oxygen limited, yet some left over. Error in oxygen competition (mol/m^3/s), c,j:', & - source(c,j,2) + conc_o2(c,j) / dtime, c, j - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: Oxygen limited, yet some left over.'//errMsg(sourcefile, __LINE__)) - end if - - conc_ch4_bef(c,j) = conc_ch4(c,j) !For Balance Check - enddo ! fc - enddo ! j - - ! Accumulate aerenchyma to add directly to atmospheric flux - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - if (j==1) ch4_surf_aere(c) = 0._r8 - ch4_surf_aere(c) = ch4_surf_aere(c) + ch4_aere_depth(c,j) * dz(c,j) - enddo - enddo - - ! Add in ebullition to source at depth just above WT - do fc = 1, num_methc - c = filter_methc(fc) - if (jwt(c) /= 0) then - source(c,jwt(c),1) = source(c,jwt(c),1) + ch4_ebul_total(c)/dz(c,jwt(c)) - endif - enddo ! fc - - ! Calculate concentration relative to m^3 of air or water: needed for the diffusion - do j = 0,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - g = col%gridcell(c) - - if (j == 0) then - conc_ch4_rel(c,j) = c_atm(g,1) - conc_o2_rel(c,j) = c_atm(g,2) - else - h2osoi_vol_min(c,j) = min(watsat(c,j), h2osoi_vol(c,j)) - if (ch4frzout) then - liqfrac(c,j) = max(0.05_r8, (h2osoi_liq(c,j)/denh2o+smallnumber)/ & - (h2osoi_liq(c,j)/denh2o+h2osoi_ice(c,j)/denice+smallnumber)) - else - liqfrac(c,j) = 1._r8 - end if - if (j <= jwt(c)) then ! Above the WT - do s=1,2 - epsilon_t(c,j,s) = watsat(c,j)- (1._r8-k_h_cc(c,j,s))*h2osoi_vol_min(c,j)*liqfrac(c,j) - end do - ! Partition between the liquid and gas phases. The gas phase will drive the diffusion. - else ! Below the WT - do s=1,2 - epsilon_t(c,j,s) = watsat(c,j)*liqfrac(c,j) - end do - end if - conc_ch4_rel(c,j) = conc_ch4(c,j)/epsilon_t(c,j,1) - conc_o2_rel(c,j) = conc_o2(c,j) /epsilon_t(c,j,2) - end if - end do - end do - - - ! Loop over species - do s = 1, 2 ! 1=CH4; 2=O2; 3=CO2 - - - ! Adjust the grnd_ch4_cond to keep it positive, and add the snow resistance & pond resistance - do j = -nlevsno + 1,0 - do fc = 1, num_methc - c = filter_methc (fc) - - if (j == -nlevsno + 1) then - if (grnd_ch4_cond(c) < smallnumber .and. s==1) grnd_ch4_cond(c) = smallnumber - ! Needed to prevent overflow when ground is frozen, e.g. for lakes - snowres(c) = 0._r8 - end if - - ! Add snow resistance - if (j >= snl(c) + 1) then - t_soisno_c = t_soisno(c,j) - tfrz - icefrac = h2osoi_ice(c,j)/denice/dz(c,j) - waterfrac = h2osoi_liq(c,j)/denh2o/dz(c,j) - airfrac = max(1._r8 - icefrac - waterfrac, 0._r8) - ! Calculate snow diffusivity - if (airfrac > 0.05_r8) then - f_a = airfrac / (airfrac + waterfrac) - eps = airfrac ! Air-filled fraction of total snow volume - ! Use Millington-Quirk Expression, as hydraulic properties (bsw) not available - snowdiff = (d_con_g(s,1) + d_con_g(s,2)*t_soisno_c) * 1.e-4_r8 * & - f_a**(10._r8/3._r8) / (airfrac+waterfrac)**2 & - * scale_factor_gasdiff - else !solute diffusion in water only - eps = waterfrac ! Water-filled fraction of total soil volume - snowdiff = eps**satpow * (d_con_w(s,1) + d_con_w(s,2)*t_soisno_c + d_con_w(s,3)*t_soisno_c**2) * 1.e-9_r8 & - * scale_factor_liqdiff - end if - snowdiff = max(snowdiff, smallnumber) - snowres(c) = snowres(c) + dz(c,j)/snowdiff - end if - - if (j == 0) then ! final loop - ! Add pond resistance - pondres = 0._r8 - - ! First old pond formulation up to pondmx - if (.not. lake .and. snl(c) == 0 .and. h2osoi_vol(c,1) > watsat(c,1)) then - t_soisno_c = t_soisno(c,1) - tfrz - if (t_soisno(c,1) <= tfrz) then - ponddiff = (d_con_w(s,1) + d_con_w(s,2)*t_soisno_c + d_con_w(s,3)*t_soisno_c**2) * 1.e-9_r8 & - * (h2osoi_liq(c,1)/denh2o+smallnumber)/ & - (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice+smallnumber) & - * scale_factor_liqdiff - else ! Unfrozen - ponddiff = (d_con_w(s,1) + d_con_w(s,2)*t_soisno_c + d_con_w(s,3)*t_soisno_c**2) * 1.e-9_r8 & - * scale_factor_liqdiff - end if - pondz = dz(c,1) * (h2osoi_vol(c,1) - watsat(c,1)) - pondres = pondz / ponddiff - end if - - ! Now add new h2osfc form - if (.not. lake .and. sat == 1 .and. frac_h2osfc(c) > 0._r8 .and. t_h2osfc(c) >= tfrz) then - t_soisno_c = t_h2osfc(c) - tfrz - ponddiff = (d_con_w(s,1) + d_con_w(s,2)*t_soisno_c + d_con_w(s,3)*t_soisno_c**2) * 1.e-9_r8 & - * scale_factor_liqdiff - pondz = h2osfc(c) / 1000._r8 / frac_h2osfc(c) ! Assume all h2osfc corresponds to sat area - ! mm / mm/m - pondres = pondres + pondz / ponddiff - else if (.not. lake .and. sat == 1 .and. frac_h2osfc(c) > 0._r8 .and. & - h2osfc(c)/frac_h2osfc(c) > capthick) then ! Assuming short-circuit logic will avoid FPE here. - ! assume surface ice is impermeable - pondres = 1/smallnumber - end if - - spec_grnd_cond(c,s) = 1._r8/(1._r8/grnd_ch4_cond(c) + snowres(c) + pondres) - end if - - end do ! fc - end do ! j - - ! Determine gas diffusion and fraction of open pore (f_a) - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - g = col%gridcell(c) - - t_soisno_c = t_soisno(c,j) - tfrz - - if (j <= jwt(c)) then ! Above the WT - f_a = 1._r8 - h2osoi_vol_min(c,j) / watsat(c,j) - ! Provisionally calculate diffusivity as linear combination of the Millington-Quirk - ! expression in Wania (for peat) & Moldrup (for mineral soil) - eps = watsat(c,j)-h2osoi_vol_min(c,j) ! Air-filled fraction of total soil volume - if (organic_max > 0._r8) then - om_frac = min(cellorg(c,j)/organic_max, 1._r8) - ! Use first power, not square as in iniTimeConst - else - om_frac = 1._r8 - end if - diffus (c,j) = (d_con_g(s,1) + d_con_g(s,2)*t_soisno_c) * 1.e-4_r8 * & - (om_frac * f_a**(10._r8/3._r8) / watsat(c,j)**2._r8 + & - (1._r8-om_frac) * eps**2._r8 * f_a**(3._r8 / bsw(c,j)) ) & - * scale_factor_gasdiff - else ! Below the WT use saturated diffusivity and only water in epsilon_t - ! Note the following is not currently corrected for the effect on diffusivity of excess ice in soil under - ! lakes (which is currently experimental only). - eps = watsat(c,j) ! Water-filled fraction of total soil volume - diffus (c,j) = eps**satpow * (d_con_w(s,1) + d_con_w(s,2)*t_soisno_c + d_con_w(s,3)*t_soisno_c**2) * 1.e-9_r8 & - * scale_factor_liqdiff - if (t_soisno(c,j)<=tfrz) then - diffus(c,j) = diffus(c,j)*(h2osoi_liq(c,j)/denh2o+smallnumber)/ & - (h2osoi_liq(c,j)/denh2o+h2osoi_ice(c,j)/denice+smallnumber) - end if - endif ! Above/below the WT - diffus(c,j) = max(diffus(c,j), smallnumber) ! Prevent overflow - - enddo ! fp - enddo ! j - - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - ! Set up coefficients for tridiagonal solver. - if (j == 1 .and. j /= jwt(c) .and. j /= jwt(c)+1) then - dm1_zm1(c,j) = 1._r8/(1._r8/spec_grnd_cond(c,s)+dz(c,j)/(diffus(c,j)*2._r8)) - ! replace Diffusivity / Delta_z by conductance (grnd_ch4_cond) for top layer - dp1_zp1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - else if (j == 1 .and. j == jwt(c)) then - dm1_zm1(c,j) = 1._r8/(1._r8/spec_grnd_cond(c,s)+dz(c,j)/(diffus(c,j)*2._r8)) - ! layer resistance mult. by k_h_cc for dp1_zp1 term - dp1_zp1(c,j) = 2._r8/(dz(c,j)*k_h_cc(c,j,s)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - else if (j == 1) then ! water table at surface: multiply ground resistance by k_h_cc - dm1_zm1(c,j) = 1._r8/(k_h_cc(c,j-1,s)/spec_grnd_cond(c,s)+dz(c,j)/(diffus(c,j)*2._r8)) - ! air concentration will be mult. by k_h_cc below - dp1_zp1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - else if (j <= nlevsoi-1 .and. j /= jwt(c) .and. j /= jwt(c)+1) then - dm1_zm1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j-1)/diffus(c,j-1)) - dp1_zp1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - else if (j <= nlevsoi-1 .and. j == jwt(c)) then ! layer resistance mult. by k_h_cc for dp1_zp1 term - dm1_zm1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j-1)/diffus(c,j-1)) - dp1_zp1(c,j) = 2._r8/(dz(c,j)*k_h_cc(c,j,s)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - ! Concentration in layer will be mult. by k_h_cc below - else if (j <= nlevsoi-1) then ! j==jwt+1: layer above resistance mult. by k_h_cc for dm1_zm1 term - dm1_zm1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j-1)*k_h_cc(c,j-1,s)/diffus(c,j-1)) - ! Concentration in layer above will be mult. by k_h_cc below - dp1_zp1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j+1)/diffus(c,j+1)) - else if (j /= jwt(c)+1) then ! j ==nlevsoi - dm1_zm1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j-1)/diffus(c,j-1)) - else ! jwt == nlevsoi-1: layer above resistance mult. by k_h_cc for dm1_zm1 term - dm1_zm1(c,j) = 2._r8/(dz(c,j)/diffus(c,j)+dz(c,j-1)*k_h_cc(c,j-1,s)/diffus(c,j-1)) - end if - enddo ! fp; patch - end do ! j; nlevsoi - - ! Perform a second loop for the tridiagonal coefficients since need dp1_zp1 and dm1_z1 at each depth - do j = 0,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - g = col%gridcell(c) - - conc_ch4_rel_old(c,j) = conc_ch4_rel(c,j) - - if (j > 0) dzj = dz(c,j) - if (j == 0) then ! top layer (atmosphere) doesn't change regardless of where WT is - at(c,j) = 0._r8 - bt(c,j) = 1._r8 - ct(c,j) = 0._r8 - rt(c,j) = c_atm(g,s) ! 0th level stays at constant atmospheric conc - elseif (j < nlevsoi .and. j == jwt(c)) then ! concentration inside needs to be mult. by k_h_cc for dp1_zp1 term - at(c,j) = -0.5_r8 / dzj * dm1_zm1(c,j) - bt(c,j) = epsilon_t(c,j,s) / dtime_ch4 + 0.5_r8 / dzj * (dp1_zp1(c,j)*k_h_cc(c,j,s) + dm1_zm1(c,j)) - ct(c,j) = -0.5_r8 / dzj * dp1_zp1(c,j) - elseif (j < nlevsoi .and. j == jwt(c)+1) then - ! concentration above needs to be mult. by k_h_cc for dm1_zm1 term - at(c,j) = -0.5_r8 / dzj * dm1_zm1(c,j) * k_h_cc(c,j-1,s) - bt(c,j) = epsilon_t(c,j,s) / dtime_ch4 + 0.5_r8 / dzj * (dp1_zp1(c,j) + dm1_zm1(c,j)) - ct(c,j) = -0.5_r8 / dzj * dp1_zp1(c,j) - elseif (j < nlevsoi) then - at(c,j) = -0.5_r8 / dzj * dm1_zm1(c,j) - bt(c,j) = epsilon_t(c,j,s) / dtime_ch4 + 0.5_r8 / dzj * (dp1_zp1(c,j) + dm1_zm1(c,j)) - ct(c,j) = -0.5_r8 / dzj * dp1_zp1(c,j) - else if (j == nlevsoi .and. j== jwt(c)+1) then - ! concentration above needs to be mult. by k_h_cc for dm1_zm1 term - at(c,j) = -0.5_r8 / dzj * dm1_zm1(c,j) * k_h_cc(c,j-1,s) - bt(c,j) = epsilon_t(c,j,s) / dtime_ch4 + 0.5_r8 / dzj * dm1_zm1(c,j) - ct(c,j) = 0._r8 - else ! j==nlevsoi and jwt 1.e-3_r8 * scale_factor_gasdiff) then - if (deficit > 1.e-2_r8) then - write(iulog,*)'Note: sink > source in ch4_tran, sources are changing '// & - ' quickly relative to diffusion timestep, and/or diffusion is rapid.' - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - write(iulog,*)'This typically occurs when there is a larger than normal '// & - ' diffusive flux.' - write(iulog,*)'If this occurs frequently, consider reducing land model (or '// & - ' methane model) timestep, or reducing the max. sink per timestep in the methane model.' - end if - write(iulog,*) 'Negative conc. in ch4tran. c,j,deficit (mol):',c,j,deficit - end if - conc_ch4_rel(c,j) = 0._r8 - ! Subtract deficit - ch4_surf_diff(c) = ch4_surf_diff(c) - deficit/dtime_ch4 - end if - enddo - enddo - - - elseif (s == 2) then ! O2 - - ! Set rt, since it depends on conc - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - ! For correct balance, deprecate source_old. - source_old(c,j,s) = source(c,j,s) - ! source_old could be removed later - epsilon_t_old(c,j,s) = epsilon_t(c,j,s) - ! epsilon_t acts like source also - dzj = dz(c,j) - if (j < nlevsoi .and. j == jwt(c)) then ! concentration inside needs to be mult. by k_h_cc for dp1_zp1 term - rt(c,j) = epsilon_t_old(c,j,s) / dtime_ch4 * conc_o2_rel(c,j) + & - 0.5_r8 / dzj * (dp1_zp1(c,j) * (conc_o2_rel(c,j+1)-conc_o2_rel(c,j)*k_h_cc(c,j,s)) - & - dm1_zm1(c,j) * (conc_o2_rel(c,j) -conc_o2_rel(c,j-1))) + & - 0.5_r8 * (source(c,j,s) + source_old(c,j,s)) - elseif (j < nlevsoi .and. j == jwt(c)+1) then - ! concentration above needs to be mult. by k_h_cc for dm1_zm1 term - rt(c,j) = epsilon_t_old(c,j,s) / dtime_ch4 * conc_o2_rel(c,j) + & - 0.5_r8 / dzj * (dp1_zp1(c,j) * (conc_o2_rel(c,j+1)-conc_o2_rel(c,j)) - & - dm1_zm1(c,j) * (conc_o2_rel(c,j) -conc_o2_rel(c,j-1)*k_h_cc(c,j-1,s))) + & - 0.5_r8 * (source(c,j,s) + source_old(c,j,s)) - elseif (j < nlevsoi) then - rt(c,j) = epsilon_t_old(c,j,s) / dtime_ch4 * conc_o2_rel(c,j) + & - 0.5_r8 / dzj * (dp1_zp1(c,j) * (conc_o2_rel(c,j+1)-conc_o2_rel(c,j)) - & - dm1_zm1(c,j) * (conc_o2_rel(c,j) -conc_o2_rel(c,j-1))) + & - 0.5_r8 * (source(c,j,s) + source_old(c,j,s)) - else if (j == nlevsoi .and. j== jwt(c)+1) then - ! concentration above needs to be mult. by k_h_cc for dm1_zm1 term - rt(c,j) = epsilon_t_old(c,j,s) / dtime_ch4 * conc_o2_rel(c,j) + & - 0.5_r8 / dzj * ( - dm1_zm1(c,j) * (conc_o2_rel(c,j) -conc_o2_rel(c,j-1)*k_h_cc(c,j-1,s))) + & - 0.5_r8 * (source(c,j,s) + source_old(c,j,s)) - else !j==nlevsoi - rt(c,j) = epsilon_t_old(c,j,s) / dtime_ch4 * conc_o2_rel(c,j) + & - 0.5_r8 / dzj * ( - dm1_zm1(c,j) * (conc_o2_rel(c,j) -conc_o2_rel(c,j-1))) + & - 0.5_r8 * (source(c,j,s) + source_old(c,j,s)) - endif - epsilon_t_old(c,j,s) = epsilon_t(c,j,s) - source_old(c,j,s) = source(c,j,s) - - enddo ! fc; column - enddo ! j; nlevsoi - - call Tridiagonal(bounds, 0, nlevsoi, jtop(bounds%begc:bounds%endc), & - num_methc, filter_methc, & - at(bounds%begc:bounds%endc, :), & - bt(bounds%begc:bounds%endc, :), & - ct(bounds%begc:bounds%endc, :), & - rt(bounds%begc:bounds%endc, :), & - conc_o2_rel(bounds%begc:bounds%endc,0:nlevsoi)) - - ! Ensure that concentrations stay above 0 - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - g = col%gridcell(c) - conc_o2_rel(c,j) = max (conc_o2_rel(c,j), 1.e-12_r8) - ! In case of pathologically large aerenchyma conductance. Should be OK in general but - ! this will maintain stability even if a PATCH with very small weight somehow has an absurd NPP or LAI. - ! Also, oxygen above ambient will probably bubble. - conc_o2_rel(c,j) = min (conc_o2_rel(c,j), c_atm(g,2)/epsilon_t(c,j,2)) - enddo - enddo - - endif ! species - - enddo ! species - - ! Update absolute concentrations per unit volume - do j = 1,nlevsoi ! No need to update the atm. level concentrations - do fc = 1, num_methc - c = filter_methc (fc) - - conc_ch4(c,j) = conc_ch4_rel(c,j)*epsilon_t(c,j,1) - conc_o2(c,j) = conc_o2_rel(c,j) *epsilon_t(c,j,2) - end do - end do - - ! Do Balance Check and absorb small - ! discrepancy into surface flux. - do j = 1,nlevsoi - do fc = 1, num_methc - c = filter_methc (fc) - - if (j == 1) errch4(c) = 0._r8 - errch4(c) = errch4(c) + (conc_ch4(c,j) - conc_ch4_bef(c,j))*dz(c,j) - errch4(c) = errch4(c) - ch4_prod_depth(c,j)*dz(c,j)*dtime - errch4(c) = errch4(c) + ch4_oxid_depth(c,j)*dz(c,j)*dtime - end do - end do - - do fc = 1, num_methc - c = filter_methc (fc) - - ! For history make sure that grnd_ch4_cond includes snow, for methane diffusivity - grnd_ch4_cond(c) = spec_grnd_cond(c,1) - - errch4(c) = errch4(c) + (ch4_surf_aere(c) + ch4_surf_ebul(c) + ch4_surf_diff(c))*dtime - - if (abs(errch4(c)) < 1.e-8_r8) then - ch4_surf_diff(c) = ch4_surf_diff(c) - errch4(c)/dtime - else ! errch4 > 1e-8 mol / m^2 / timestep - write(iulog,*)'CH4 Conservation Error in CH4Mod during diffusion, nstep, c, errch4 (mol /m^2.timestep)', & - nstep,c,errch4(c) - g = col%gridcell(c) - write(iulog,*)'Latdeg,Londeg=',grc%latdeg(g),grc%londeg(g) - call endrun(msg=' ERROR: CH4 Conservation Error in CH4Mod during diffusion'//& - errMsg(sourcefile, __LINE__)) - end if - end do - - end associate - - end subroutine ch4_tran - - !----------------------------------------------------------------------- - subroutine get_jwt (bounds, num_methc, filter_methc, jwt, & - soilstate_inst, waterstate_inst, temperature_inst) - ! - ! !DESCRIPTION: - ! Finds the first unsaturated layer going up. Also allows a perched water table over ice. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of column soil points in column filter - integer , intent(in) :: filter_methc(:) ! column filter for soil points - integer , intent(out) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: f_sat ! volumetric soil water defining top of water table or where production is allowed - integer :: c,j,perch! indices - integer :: fc ! filter column index - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(jwt) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (: ,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - ) - - f_sat = params_inst%f_sat - - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table. - ! ZS: Loop is currently not vectorized. - do fc = 1, num_methc - c = filter_methc(fc) - - ! Check to see if any soil layers are frozen and saturated. If so, start looking at the first layer above the top - ! such layer. This is potentially important for perched water tables in the Tundra. - - perch = nlevsoi - do j = nlevsoi, 1, -1 - if (t_soisno(c,j) < tfrz .and. h2osoi_vol(c,j) > f_sat * watsat(c,j)) then - ! strictly less than freezing because it could be permeable otherwise - perch = j-1 - end if - end do - jwt(c) = perch - - do j = perch, 2, -1 - if(h2osoi_vol(c,j) > f_sat * watsat(c,j) .and. h2osoi_vol(c,j-1) < f_sat * watsat(c,j-1)) then - jwt(c) = j-1 - exit - end if - enddo - if (jwt(c) == perch .and. h2osoi_vol(c,1) > f_sat * watsat(c,1)) then ! missed that the top layer is saturated - jwt(c) = 0 - endif - end do - - end associate - - end subroutine get_jwt - - !----------------------------------------------------------------------- - subroutine ch4_annualupdate(bounds, num_methc, filter_methc, num_methp, filter_methp, & - agnpp, bgnpp, & - soilbiogeochem_carbonflux_inst, ch4_inst) - ! - ! !DESCRIPTION: Annual mean fields. - ! - ! !USES: - use clm_time_manager, only: get_step_size, get_days_per_year, get_nstep - use clm_varcon , only: secspday - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_methc ! number of soil columns in filter - integer , intent(in) :: filter_methc(:) ! filter for soil columns - integer , intent(in) :: num_methp ! number of soil points in patch filter - integer , intent(in) :: filter_methp(:) ! patch filter for soil points - real(r8) , intent(in) :: agnpp( bounds%begp: ) ! aboveground NPP (gC/m2/s) - real(r8) , intent(in) :: bgnpp( bounds%begp: ) ! belowground NPP (gC/m2/s) - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fc ! soil column filter indices - integer :: fp ! soil patch filter indices - real(r8):: dt ! time step (seconds) - real(r8):: secsperyear - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(agnpp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bgnpp) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - somhr => soilbiogeochem_carbonflux_inst%somhr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) soil organic matter heterotrophic respiration - - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column - tempavg_agnpp => ch4_inst%tempavg_agnpp_patch , & ! Output: [real(r8) (:) ] temporary average above-ground NPP (gC/m2/s) - annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Output: [real(r8) (:) ] annual average above-ground NPP (gC/m2/s) - tempavg_bgnpp => ch4_inst%tempavg_bgnpp_patch , & ! Output: [real(r8) (:) ] temporary average below-ground NPP (gC/m2/s) - annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Output: [real(r8) (:) ] annual average below-ground NPP (gC/m2/s) - annsum_counter => ch4_inst%annsum_counter_col , & ! Output: [real(r8) (:) ] seconds since last annual accumulator turnover - tempavg_somhr => ch4_inst%tempavg_somhr_col , & ! Output: [real(r8) (:) ] temporary average SOM heterotrophic resp. (gC/m2/s) - annavg_somhr => ch4_inst%annavg_somhr_col , & ! Output: [real(r8) (:) ] annual average SOM heterotrophic resp. (gC/m2/s) - tempavg_finrw => ch4_inst%tempavg_finrw_col , & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated - annavg_finrw => ch4_inst%annavg_finrw_col & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated - ) - - ! set time steps - dt = real(get_step_size(), r8) - secsperyear = real( get_days_per_year() * secspday, r8) - - do fc = 1,num_methc - c = filter_methc(fc) - annsum_counter(c) = annsum_counter(c) + dt - end do - - do fc = 1,num_methc - c = filter_methc(fc) - if (annsum_counter(c) >= secsperyear) then - - ! update annual average somhr - annavg_somhr(c) = tempavg_somhr(c) - tempavg_somhr(c) = 0._r8 - - ! update annual average finrw - if (annavg_somhr(c) > 0._r8) then - annavg_finrw(c) = tempavg_finrw(c) / annavg_somhr(c) - else - annavg_finrw(c) = 0._r8 - end if - tempavg_finrw(c) = 0._r8 - else - tempavg_somhr(c) = tempavg_somhr(c) + dt/secsperyear * somhr(c) - tempavg_finrw(c) = tempavg_finrw(c) + dt/secsperyear * finundated(c) * somhr(c) - end if - end do - - do fp = 1,num_methp - p = filter_methp(fp) - c = patch%column(p) - if (annsum_counter(c) >= secsperyear) then - - annavg_agnpp(p) = tempavg_agnpp(p) - tempavg_agnpp(p) = 0._r8 - - annavg_bgnpp(p) = tempavg_bgnpp(p) - tempavg_bgnpp(p) = 0._r8 - - else - tempavg_agnpp(p) = tempavg_agnpp(p) + dt/secsperyear * agnpp(p) - tempavg_bgnpp(p) = tempavg_bgnpp(p) + dt/secsperyear * bgnpp(p) - end if - end do - - ! column loop - do fc = 1,num_methc - c = filter_methc(fc) - if (annsum_counter(c) >= secsperyear) annsum_counter(c) = 0._r8 - end do - - end associate - - end subroutine ch4_annualupdate - - !----------------------------------------------------------------------- - subroutine ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - ch4_inst, totcolch4) - ! - ! !DESCRIPTION: - ! Computes total column ch4, returned in totcolch4 - ! - ! totcolch4 is set over both the nolakec and the lakec filters; elsewhere, it retains - ! its original values - ! - ! !USES: - use ch4varcon , only : allowlakeprod - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - type(ch4_type) , intent(in) :: ch4_inst - real(r8) , intent(inout) :: totcolch4( bounds%begc: ) ! total methane in soil column (g C / m^2) - ! - ! !LOCAL VARIABLES: - integer :: fc, c - integer :: j - - character(len=*), parameter :: subname = 'ch4_totcolch4' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(totcolch4) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) - conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - ) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - totcolch4(c) = 0._r8 - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - totcolch4(c) = 0._r8 - end do - - do j = 1, nlevsoi - do fc = 1, num_nolakec - c = filter_nolakec(fc) - totcolch4(c) = totcolch4(c) + & - (finundated(c)*conc_ch4_sat(c,j) + (1._r8-finundated(c))*conc_ch4_unsat(c,j)) * & - dz(c,j)*catomw - ! mol CH4 --> g C - end do - - if (allowlakeprod) then - do fc = 1, num_lakec - c = filter_lakec(fc) - totcolch4(c) = totcolch4(c) + conc_ch4_sat(c,j)*dz(c,j)*catomw ! mol CH4 --> g C - end do - end if - end do - - end associate - - end subroutine ch4_totcolch4 - - -end module ch4Mod - diff --git a/src/biogeochem/ch4varcon.F90 b/src/biogeochem/ch4varcon.F90 deleted file mode 100644 index 5bf4917e74..0000000000 --- a/src/biogeochem/ch4varcon.F90 +++ /dev/null @@ -1,192 +0,0 @@ -module ch4varcon - - !----------------------------------------------------------------------- - ! Module containing CH4 parameters and logical switches and routine to read constants from CLM namelist. - ! - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varctl , only : NLFileName_in - ! - implicit none - ! - ! Methane Model Parameters - ! - private - - logical, public :: use_aereoxid_prog = .true. ! if false then aereoxid is read off of - ! the parameter file and may be modifed by the user (default aereoxid on the - ! file is 0.0). - - logical, public :: transpirationloss = .true. ! switch for activating CH4 loss from transpiration - ! Transpiration loss assumes that the methane concentration in dissolved soil - ! water remains constant through the plant and is released when the water evaporates - ! from the stomata. - ! Currently hard-wired to true; impact is < 1 Tg CH4/yr - - logical, public :: allowlakeprod = .false. ! Switch to allow production under lakes based on soil carbon dataset - ! (Methane can be produced, and CO2 produced from methane oxidation, - ! which will slowly reduce the available carbon stock, if ! replenishlakec, but no other biogeochem is done.) - ! Note: switching this off turns off ALL lake methane biogeochem. However, 0 values - ! will still be averaged into the concentration _sat history fields. - - logical, public :: usephfact = .false. ! Switch to use pH factor in methane production - - logical, public :: replenishlakec = .true. ! Switch for keeping carbon storage under lakes constant - ! so that lakes do not affect the carbon balance - ! Good for long term rather than transient warming experiments - ! NOTE SWITCHING THIS OFF ASSUMES TRANSIENT CARBON SUPPLY FROM LAKES; COUPLED MODEL WILL NOT CONSERVE CARBON - ! IN THIS MODE. - - ! inundatrion fraction -- which is used in methane code and potentially soil code - integer, public :: finundation_mtd ! Finundation method type to use, one of the following - integer, public, parameter :: finundation_mtd_h2osfc = 0 ! Use prognostic fsat h2osfc - integer, public, parameter :: finundation_mtd_ZWT_inversion = 1 ! Use inversion of ZWT to Prigent satellite inundation obs. data - integer, public, parameter :: finundation_mtd_TWS_inversion = 2 ! Use inversion of TWS to Prigent satellite inundation obs. data - - logical, public :: usefrootc = .false. ! Use CLMCN fine root C rather than ann NPP & LAI based parameterization to - ! calculate tiller C for aerenchyma area calculation. - ! The NPP & LAI param. was based on Wania for Arctic sedges and may not be - ! appropriate for woody Patches, although nongrassporosratio above partly adjusts - ! for this. However, using fine root C reduces the aerenchyma area by a large - ! factor. - - logical, public :: ch4offline = .true. ! true --> Methane is not passed between the land & atmosphere. - ! NEM is not added to NEE flux to atm. to correct for methane production, - ! and ambient CH4 is set to constant 2009 value. - - logical, public :: ch4rmcnlim = .false. ! Remove the N and low moisture limitations on SOM HR when calculating - ! methanogenesis. - ! Note: this option has not been extensively tested. - ! Currently hardwired off. - - logical, public :: anoxicmicrosites = .false. ! Use Arah & Stephen 1998 expression to allow production above the water table - ! Currently hardwired off; expression is crude. - - logical, public :: ch4frzout = .false. ! Exclude CH4 from frozen fraction of soil pore H2O, to simulate "freeze-out" pulse - ! as in Mastepanov 2008. - ! Causes slight increase in emissions in the fall and decrease in the spring. - ! Currently hardwired off; small impact. - - public :: ch4conrd ! Read and initialize CH4 constants - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine ch4conrd () - ! - ! !DESCRIPTION: - ! Read and initialize CH4 constants - ! - ! !USES: - use fileutils , only : relavu, getavu - use spmdMod , only : masterproc, mpicom, MPI_REAL8, MPI_LOGICAL, MPI_INTEGER - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - implicit none - ! - integer :: i,j,n ! loop indices - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'ch4conrd' ! subroutine name - character(len=50) :: finundation_method = 'ZWT_inversion' ! String for finundation_method to use - !----------------------------------------------------------------------- - - ! ---------------------------------------------------------------------- - ! Namelist Variables - ! ---------------------------------------------------------------------- - - ! Driver - namelist /ch4par_in/ & - ch4offline, replenishlakec, allowlakeprod, finundation_method - - ! Production - namelist /ch4par_in/ & - usephfact - - ! Methane - namelist /ch4par_in/ & - use_aereoxid_prog, usefrootc - - ! ---------------------------------------------------------------------- - ! Read namelist from standard input. - ! ---------------------------------------------------------------------- - - if (masterproc) then - - write(iulog,*) 'Attempting to read CH4 parameters .....' - unitn = getavu() - write(iulog,*) 'Read in ch4par_in namelist from: ', trim(NLFilename_in) - open( unitn, file=trim(NLFilename_in), status='old' ) - call shr_nl_find_group_name(unitn, 'ch4par_in', status=ierr) - if (ierr == 0) then - read(unitn, ch4par_in, iostat=ierr) - if (ierr /= 0) then - call endrun(msg='error in reading in ch4par_in namelist'//& - errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='error in finding ch4par_in namelist'//& - errMsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - if ( trim(finundation_method) == "h2osfc" )then - finundation_mtd = finundation_mtd_h2osfc - else if ( trim(finundation_method) == "TWS_inversion" )then - finundation_mtd = finundation_mtd_tws_inversion - else if ( trim(finundation_method) == "ZWT_inversion" )then - finundation_mtd = finundation_mtd_zwt_inversion - else - call endrun(msg='error bad value for finundation_method in ch4par_in namelist'//& - errMsg(sourcefile, __LINE__)) - end if - - end if ! masterproc - - - call mpi_bcast ( use_aereoxid_prog, 1 , MPI_LOGICAL, 0, mpicom, ierr ) - call mpi_bcast (allowlakeprod, 1 , MPI_LOGICAL, 0, mpicom, ierr) - call mpi_bcast (usephfact, 1 , MPI_LOGICAL, 0, mpicom, ierr) - call mpi_bcast (replenishlakec, 1 , MPI_LOGICAL, 0, mpicom, ierr) - call mpi_bcast (finundation_mtd, 1 , MPI_INTEGER, 0, mpicom, ierr) - call mpi_bcast (usefrootc, 1 , MPI_LOGICAL, 0, mpicom, ierr) - call mpi_bcast (ch4offline, 1 , MPI_LOGICAL, 0, mpicom, ierr) - - if (masterproc) then - write(iulog,*) 'Successfully read CH4 namelist' - write(iulog,*)' ' - write(iulog,*)'allowlakeprod = ', allowlakeprod - write(iulog,*)'usephfact = ', usephfact - write(iulog,*)'replenishlakec = ', replenishlakec - write(iulog,*)'finundation_method = ', finundation_method - write(iulog,*)'usefrootc = ', usefrootc - write(iulog,*)'ch4offline = ', ch4offline - write(iulog,*)'use_aereoxid_prog = ', use_aereoxid_prog - - if (ch4offline) write(iulog,*)'CH4 Model will be running offline and not affect fluxes to atmosphere' - - if ( .not. use_aereoxid_prog ) then - write(iulog,*) 'Aerenchyma oxidation (aereoxid) value is being read from '//& - ' the parameters file' - endif - - if (.not. allowlakeprod) write(iulog,*) 'Lake production has been disabled. '// & - ' Lakes will not factor into CH4 BGC. "Sat" history fields will not average'// & - ' over lakes except for concentrations, which will average zero from lakes.' - if (.not. replenishlakec .and. .not. ch4offline) write(iulog,*)'LAKE SOIL CARBON WILL NOT BE REPLENISHED BUT INSTEAD ',& - 'WILL BE TRANSIENTLY RELEASED: COUPLED MODEL WILL NOT CONSERVE CARBON IN THIS MODE!' - write(iulog,*)'Successfully initialized CH4 parameters from namelist.' - write(iulog,*) - - end if - - end subroutine ch4conrd - -end module ch4varcon - diff --git a/src/biogeochem/dynCNDVMod.F90 b/src/biogeochem/dynCNDVMod.F90 deleted file mode 100644 index 2bea506938..0000000000 --- a/src/biogeochem/dynCNDVMod.F90 +++ /dev/null @@ -1,110 +0,0 @@ -module dynCNDVMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Handle weight updates associated with prognostic dynamic vegetation (CNDV) - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use LandunitType , only : lun - use PatchType , only : patch - use CNDVType , only : dgvs_type - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dynCNDV_init ! initialize CNDV weight updates - public :: dynCNDV_interp ! interpolate CNDV weight updates to the time step - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine dynCNDV_init(bounds, dgvs_inst) - ! - ! !DESCRIPTION: - ! Initialize time interpolation of cndv pft weights from annual to time step - ! - ! Should be called once, in model initialization - ! - ! !USES: - use clm_varctl, only : nsrest, nsrStartup - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(dgvs_type) , intent(inout) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - integer :: ier, p ! error status, do-loop index - character(len=32) :: subname='dynCNDV_init' ! subroutine name - !----------------------------------------------------------------------- - - if (nsrest == nsrStartup) then - do p = bounds%begp,bounds%endp - dgvs_inst%fpcgrid_patch(p) = patch%wtcol(p) - dgvs_inst%fpcgridold_patch(p) = patch%wtcol(p) - end do - end if - - end subroutine dynCNDV_init - - !----------------------------------------------------------------------- - subroutine dynCNDV_interp( bounds, dgvs_inst) - ! - ! !DESCRIPTION: - ! Time interpolate cndv pft weights from annual to time step - ! - ! !USES: - use clm_time_manager, only : get_curr_date, get_step_size, get_nstep, get_curr_yearfrac - use landunit_varcon , only : istsoil ! CNDV incompatible with dynLU - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(dgvs_type) , intent(inout) :: dgvs_inst - ! - ! !LOCAL VARIABLES: - integer :: c,g,l,p ! indices - real(r8) :: cday ! current calendar day (1.0 = 0Z on Jan 1) - real(r8) :: wt1 ! time interpolation weights (weight of time 1) - real(r8) :: dtime ! model time step - real(r8) :: days_per_year ! days per year - integer :: nstep ! time step number - integer :: year ! year (0, ...) at nstep + 1 - integer :: mon ! month (1, ..., 12) at nstep + 1 - integer :: day ! day of month (1, ..., 31) at nstep + 1 - integer :: sec ! seconds into current date at nstep + 1 - character(len=32) :: subname='dynCNDV_interp' ! subroutine name - !----------------------------------------------------------------------- - - ! Interpolate pft weight to current time step - ! Map interpolated pctpft to subgrid weights - ! assumes maxpatch_pft = numpft + 1, each landunit has 1 column, - ! SCAM not defined and create_croplandunit = .false. - - nstep = get_nstep() - dtime = get_step_size() - - wt1 = 1.0_r8 - get_curr_yearfrac(offset = -int(dtime)) - - call get_curr_date(year, mon, day, sec, offset=int(dtime)) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - - if (lun%itype(l) == istsoil .and. lun%wtgcell(l) > 0._r8) then ! CNDV incompatible with dynLU - patch%wtcol(p) = dgvs_inst%fpcgrid_patch(p) + & - wt1 * (dgvs_inst%fpcgridold_patch(p) - dgvs_inst%fpcgrid_patch(p)) - - if (mon==1 .and. day==1 .and. sec==dtime .and. nstep>0) then - dgvs_inst%fpcgridold_patch(p) = dgvs_inst%fpcgrid_patch(p) - end if - end if - end do - - end subroutine dynCNDV_interp - -end module dynCNDVMod diff --git a/src/biogeochem/dynConsBiogeochemMod.F90 b/src/biogeochem/dynConsBiogeochemMod.F90 deleted file mode 100644 index e233653ca7..0000000000 --- a/src/biogeochem/dynConsBiogeochemMod.F90 +++ /dev/null @@ -1,886 +0,0 @@ -module dynConsBiogeochemMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Handle conservation of biogeochemical quantities (C & N) with dynamic land cover. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_c13, use_c14, use_lch4 - use pftconMod , only : pftcon - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemStateType , only : soilBiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilBiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType, only : soilbiogeochem_carbonstate_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use ch4Mod , only : ch4_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dyn_cnbal_patch - public :: dyn_cnbal_col - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine dyn_cnbal_patch(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - prior_weights, patch_state_updater, & - canopystate_inst, photosyns_inst, cnveg_state_inst, & - cnveg_carbonstate_inst, c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, & - cnveg_carbonflux_inst, c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst, & - cnveg_nitrogenstate_inst, cnveg_nitrogenflux_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_state_inst) - ! - ! !DESCRIPTION: - ! Modify patch-level state and flux variables to maintain carbon and nitrogen balance with - ! dynamic patch-weights. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_PDB - use landunit_varcon , only : istsoil, istcrop - use clm_varpar , only : numveg, nlevdecomp - use clm_varcon , only : c13ratio, c14ratio, c3_r2, c4_r2 - use clm_time_manager , only : get_step_size - use dynPriorWeightsMod , only : prior_weights_type - use dynPatchStateUpdaterMod, only : patch_state_updater_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilp_with_inactive ! number of points in filter - integer , intent(in) :: filter_soilp_with_inactive(:) ! soil patch filter that includes inactive points - type(prior_weights_type) , intent(in) :: prior_weights ! weights prior to the subgrid weight updates - type(patch_state_updater_type) , intent(in) :: patch_state_updater - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c13_cnveg_carbonstate_inst - type(cnveg_carbonstate_type) , intent(inout) :: c14_cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c13_cnveg_carbonflux_inst - type(cnveg_carbonflux_type) , intent(inout) :: c14_cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g,j ! indices - integer :: begp, endp - integer :: ier ! error code - real(r8) :: dt ! land model time step (sec) - real(r8), allocatable :: dwt(:) ! change in patch weight (relative to gridcell) - real(r8), allocatable :: dwt_leafc_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_leafn_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemc_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemn_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_frootc_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable :: dwt_livecrootc_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable :: dwt_deadcrootc_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_frootn_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_livecrootn_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_deadcrootn_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable :: conv_cflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: wood_product_cflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: crop_product_cflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable, target :: conv_nflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: wood_product_nflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: crop_product_nflux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - character(len=32) :: subname='dyn_cbal' ! subroutine name - !! C13 - real(r8), allocatable :: dwt_leafc13_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemc13_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable, target :: dwt_frootc13_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_livecrootc13_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_deadcrootc13_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: conv_c13flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: wood_product_c13flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: crop_product_c13flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - !! C14 - real(r8), allocatable :: dwt_leafc14_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemc14_seed(:) ! patch-level mass gain due to seeding of new area - real(r8), allocatable, target :: dwt_frootc14_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_livecrootc14_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: dwt_deadcrootc14_to_litter(:) ! patch-level mass loss due to weight shift (expressed per unit COLUMN area) - real(r8), allocatable, target :: conv_c14flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: wood_product_c14flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - real(r8), allocatable :: crop_product_c14flux(:) ! patch-level mass loss due to weight shift (expressed per unit GRIDCELL area) - - logical :: patch_initiating(bounds%begp:bounds%endp) - - ! amounts to add to growing patches - real(r8), parameter :: leafc_seed = 1._r8 - real(r8), parameter :: deadstemc_seed = 0.1_r8 - - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - ! Allocate patch-level mass loss arrays - allocate(dwt(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_leafc_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafc_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_leafn_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafn_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadstemc_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemc_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadstemn_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemn_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_frootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootc_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_livecrootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootc_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadcrootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootc_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_frootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootn_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_livecrootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootn_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadcrootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootn_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(conv_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_cflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(wood_product_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for wood_product_cflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(crop_product_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for crop_product_cflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(conv_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_nflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(wood_product_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for wood_product_nflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(crop_product_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for crop_product_nflux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if ( use_c13 ) then - allocate(dwt_leafc13_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafc13_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadstemc13_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemc13_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_frootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootc13_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_livecrootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootc13_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadcrootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootc13_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(conv_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_c13flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(wood_product_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for wood_product_c13flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(crop_product_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for crop_product_c13flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - endif - if ( use_c14 ) then - allocate(dwt_leafc14_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafc14_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadstemc14_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemc14_seed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_frootc14_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootc14_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_livecrootc14_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootc14_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(dwt_deadcrootc14_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootc14_to_litter' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(conv_c14flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_c14flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(wood_product_c14flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for wood_product_c14flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(crop_product_c14flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for crop_product_c14flux' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - endif - - ! Get time step - dt = real( get_step_size(), r8 ) - - patch_initiating = patch_state_updater%patch_initiating(bounds) - - do p = begp,endp - c = patch%column(p) - ! initialize all the patch-level local flux arrays - dwt(p) = 0._r8 - dwt_leafc_seed(p) = 0._r8 - dwt_leafn_seed(p) = 0._r8 - dwt_deadstemc_seed(p) = 0._r8 - dwt_deadstemn_seed(p) = 0._r8 - dwt_frootc_to_litter(p) = 0._r8 - dwt_livecrootc_to_litter(p) = 0._r8 - dwt_deadcrootc_to_litter(p) = 0._r8 - dwt_frootn_to_litter(p) = 0._r8 - dwt_livecrootn_to_litter(p) = 0._r8 - dwt_deadcrootn_to_litter(p) = 0._r8 - conv_cflux(p) = 0._r8 - wood_product_cflux(p) = 0._r8 - crop_product_cflux(p) = 0._r8 - conv_nflux(p) = 0._r8 - wood_product_nflux(p) = 0._r8 - crop_product_nflux(p) = 0._r8 - - if ( use_c13 ) then - dwt_leafc13_seed(p) = 0._r8 - dwt_deadstemc13_seed(p) = 0._r8 - dwt_frootc13_to_litter(p) = 0._r8 - dwt_livecrootc13_to_litter(p) = 0._r8 - dwt_deadcrootc13_to_litter(p) = 0._r8 - conv_c13flux(p) = 0._r8 - wood_product_c13flux(p) = 0._r8 - crop_product_c13flux(p) = 0._r8 - endif - - if ( use_c14 ) then - dwt_leafc14_seed(p) = 0._r8 - dwt_deadstemc14_seed(p) = 0._r8 - dwt_frootc14_to_litter(p) = 0._r8 - dwt_livecrootc14_to_litter(p) = 0._r8 - dwt_deadcrootc14_to_litter(p) = 0._r8 - conv_c14flux(p) = 0._r8 - wood_product_c14flux(p) = 0._r8 - crop_product_c14flux(p) = 0._r8 - endif - - l = patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - ! calculate the change in weight for the timestep - dwt(p) = patch%wtgcell(p)-prior_weights%pwtgcell(p) - - ! Identify patches that are initiating on this timestep and set all the - ! necessary state and flux variables - - ! TODO(wjs, 2016-06-01) It seems like this code should be moved to a new - ! subroutine that is solely responsible for initializing newly-active patches - - ! NOTE(wjs, 2016-06-01) We could replace the check of patch_initiating with a - ! check of something like (patch%active(p) .and. .not. - ! prior_weights%pactive(p)). That would mean that 0-weight active patches would - ! remain in their spunup state when they began to grow. But I think that's a bad - ! idea, because it means that the evolution of the system depends on which - ! 0-weight patches we choose to keep active. It seems better to reinitialize - ! patches as soon as they grow to > 0 area, as is done here. - - if (patch_initiating(p)) then - - canopystate_inst%laisun_patch(p) = 0._r8 - canopystate_inst%laisha_patch(p) = 0._r8 - - cnveg_state_inst%dormant_flag_patch(p) = 1._r8 - cnveg_state_inst%days_active_patch(p) = 0._r8 - cnveg_state_inst%onset_flag_patch(p) = 0._r8 - cnveg_state_inst%onset_counter_patch(p) = 0._r8 - cnveg_state_inst%onset_gddflag_patch(p) = 0._r8 - cnveg_state_inst%onset_fdd_patch(p) = 0._r8 - cnveg_state_inst%onset_gdd_patch(p) = 0._r8 - cnveg_state_inst%onset_swi_patch(p) = 0._r8 - cnveg_state_inst%offset_flag_patch(p) = 0._r8 - cnveg_state_inst%offset_counter_patch(p) = 0._r8 - cnveg_state_inst%offset_fdd_patch(p) = 0._r8 - cnveg_state_inst%offset_swi_patch(p) = 0._r8 - cnveg_state_inst%lgsf_patch(p) = 0._r8 - cnveg_state_inst%bglfr_patch(p) = 0._r8 - cnveg_state_inst%bgtr_patch(p) = 0._r8 - cnveg_state_inst%annavg_t2m_patch(p) = cnveg_state_inst%annavg_t2m_col(c) - cnveg_state_inst%tempavg_t2m_patch(p) = 0._r8 - cnveg_state_inst%c_allometry_patch(p) = 0._r8 - cnveg_state_inst%n_allometry_patch(p) = 0._r8 - cnveg_state_inst%tempsum_potential_gpp_patch(p) = 0._r8 - cnveg_state_inst%annsum_potential_gpp_patch(p) = 0._r8 - cnveg_state_inst%tempmax_retransn_patch(p) = 0._r8 - cnveg_state_inst%annmax_retransn_patch(p) = 0._r8 - cnveg_state_inst%downreg_patch(p) = 0._r8 - - cnveg_carbonflux_inst%xsmrpool_recover_patch(p) = 0._r8 - cnveg_carbonflux_inst%plant_calloc_patch(p) = 0._r8 - cnveg_carbonflux_inst%excess_cflux_patch(p) = 0._r8 - cnveg_carbonflux_inst%prev_leafc_to_litter_patch(p) = 0._r8 - cnveg_carbonflux_inst%prev_frootc_to_litter_patch(p) = 0._r8 - cnveg_carbonflux_inst%availc_patch(p) = 0._r8 - cnveg_carbonflux_inst%gpp_before_downreg_patch(p) = 0._r8 - - cnveg_carbonflux_inst%tempsum_npp_patch(p) = 0._r8 - cnveg_carbonflux_inst%annsum_npp_patch(p) = 0._r8 - - cnveg_nitrogenflux_inst%plant_ndemand_patch(p) = 0._r8 - cnveg_nitrogenflux_inst%avail_retransn_patch(p) = 0._r8 - cnveg_nitrogenflux_inst%plant_nalloc_patch(p) = 0._r8 - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%xsmrpool_c13ratio_patch(p) = c13ratio - end if - - call photosyns_inst%NewPatchinit(p) - - end if ! end initialization of new patch - end if ! is soil - end do ! patch loop - - ! Determine annually-smoothed (dribbled) change in weight - call CNveg_state_inst%dwt_dribbler_patch%set_curr_delta(bounds, & - dwt(bounds%begp:bounds%endp)) - call CNveg_state_inst%dwt_dribbler_patch%get_dribbled_delta(bounds, & - CNveg_state_inst%dwt_smoothed_patch(bounds%begp:bounds%endp)) - - ! Adjust patch variables and compute associated fluxes for changing patch areas - - call cnveg_carbonstate_inst%DynamicPatchAdjustments(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - conv_cflux = conv_cflux(begp:endp), & - wood_product_cflux = wood_product_cflux(begp:endp), & - crop_product_cflux = crop_product_cflux(begp:endp), & - dwt_frootc_to_litter = dwt_frootc_to_litter(begp:endp), & - dwt_livecrootc_to_litter = dwt_livecrootc_to_litter(begp:endp), & - dwt_deadcrootc_to_litter = dwt_deadcrootc_to_litter(begp:endp), & - dwt_leafc_seed = dwt_leafc_seed(begp:endp), & - dwt_deadstemc_seed = dwt_deadstemc_seed(begp:endp)) - - ! These fluxes are computed as negative quantities, but are expected to be positive, - ! so flip the signs - do p = begp, endp - dwt_frootc_to_litter(p) = -1._r8 * dwt_frootc_to_litter(p) - dwt_livecrootc_to_litter(p) = -1._r8 * dwt_livecrootc_to_litter(p) - dwt_deadcrootc_to_litter(p) = -1._r8 * dwt_deadcrootc_to_litter(p) - end do - - if (use_c13) then - call c13_cnveg_carbonstate_inst%DynamicPatchAdjustments(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - conv_cflux = conv_c13flux(begp:endp), & - wood_product_cflux = wood_product_c13flux(begp:endp), & - crop_product_cflux = crop_product_c13flux(begp:endp), & - dwt_frootc_to_litter = dwt_frootc13_to_litter(begp:endp), & - dwt_livecrootc_to_litter = dwt_livecrootc13_to_litter(begp:endp), & - dwt_deadcrootc_to_litter = dwt_deadcrootc13_to_litter(begp:endp), & - dwt_leafc_seed = dwt_leafc13_seed(begp:endp), & - dwt_deadstemc_seed = dwt_deadstemc13_seed(begp:endp)) - - ! These fluxes are computed as negative quantities, but are expected to be positive, - ! so flip the signs - do p = begp,endp - dwt_frootc13_to_litter(p) = -1._r8 * dwt_frootc13_to_litter(p) - dwt_livecrootc13_to_litter(p) = -1._r8 * dwt_livecrootc13_to_litter(p) - dwt_deadcrootc13_to_litter(p) = -1._r8 * dwt_deadcrootc13_to_litter(p) - end do - - end if - - if (use_c14) then - call c14_cnveg_carbonstate_inst%DynamicPatchAdjustments(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - conv_cflux = conv_c14flux(begp:endp), & - wood_product_cflux = wood_product_c14flux(begp:endp), & - crop_product_cflux = crop_product_c14flux(begp:endp), & - dwt_frootc_to_litter = dwt_frootc14_to_litter(begp:endp), & - dwt_livecrootc_to_litter = dwt_livecrootc14_to_litter(begp:endp), & - dwt_deadcrootc_to_litter = dwt_deadcrootc14_to_litter(begp:endp), & - dwt_leafc_seed = dwt_leafc14_seed(begp:endp), & - dwt_deadstemc_seed = dwt_deadstemc14_seed(begp:endp)) - - ! These fluxes are computed as negative quantities, but are expected to be positive, - ! so flip the signs - do p = begp,endp - dwt_frootc14_to_litter(p) = -1._r8 * dwt_frootc14_to_litter(p) - dwt_livecrootc14_to_litter(p) = -1._r8 * dwt_livecrootc14_to_litter(p) - dwt_deadcrootc14_to_litter(p) = -1._r8 * dwt_deadcrootc14_to_litter(p) - end do - - end if - - call cnveg_nitrogenstate_inst%DynamicPatchAdjustments(bounds, & - num_soilp_with_inactive, filter_soilp_with_inactive, & - patch_state_updater, & - leafc_seed = leafc_seed, & - deadstemc_seed = deadstemc_seed, & - conv_nflux = conv_nflux(begp:endp), & - wood_product_nflux = wood_product_nflux(begp:endp), & - crop_product_nflux = crop_product_nflux(begp:endp), & - dwt_frootn_to_litter = dwt_frootn_to_litter(begp:endp), & - dwt_livecrootn_to_litter = dwt_livecrootn_to_litter(begp:endp), & - dwt_deadcrootn_to_litter = dwt_deadcrootn_to_litter(begp:endp), & - dwt_leafn_seed = dwt_leafn_seed(begp:endp), & - dwt_deadstemn_seed = dwt_deadstemn_seed(begp:endp)) - - ! These fluxes are computed as negative quantities, but are expected to be positive, - ! so flip the signs - do p = begp,endp - dwt_frootn_to_litter(p) = -1._r8 * dwt_frootn_to_litter(p) - dwt_livecrootn_to_litter(p) = -1._r8 * dwt_livecrootn_to_litter(p) - dwt_deadcrootn_to_litter(p) = -1._r8 * dwt_deadcrootn_to_litter(p) - end do - - ! calculate column-level seeding fluxes - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - - ! C fluxes - cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) = dwt_leafc_seed(p)/dt - cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) = & - cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) + & - cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) - - cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) = dwt_deadstemc_seed(p)/dt - cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) = & - cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) + & - cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) = dwt_leafc13_seed(p)/dt - c13_cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) = & - c13_cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) + & - c13_cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) - - c13_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) = dwt_deadstemc13_seed(p)/dt - c13_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) = & - c13_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) + & - c13_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) - endif - - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) = dwt_leafc14_seed(p)/dt - c14_cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) = & - c14_cnveg_carbonflux_inst%dwt_seedc_to_leaf_grc(g) + & - c14_cnveg_carbonflux_inst%dwt_seedc_to_leaf_patch(p) - - c14_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) = dwt_deadstemc14_seed(p)/dt - c14_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) = & - c14_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_grc(g) + & - c14_cnveg_carbonflux_inst%dwt_seedc_to_deadstem_patch(p) - endif - - ! N fluxes - cnveg_nitrogenflux_inst%dwt_seedn_to_leaf_patch(p) = dwt_leafn_seed(p)/dt - cnveg_nitrogenflux_inst%dwt_seedn_to_leaf_grc(g) = & - cnveg_nitrogenflux_inst%dwt_seedn_to_leaf_grc(g) + & - cnveg_nitrogenflux_inst%dwt_seedn_to_leaf_patch(p) - - cnveg_nitrogenflux_inst%dwt_seedn_to_deadstem_patch(p) = dwt_deadstemn_seed(p)/dt - cnveg_nitrogenflux_inst%dwt_seedn_to_deadstem_grc(g) = & - cnveg_nitrogenflux_inst%dwt_seedn_to_deadstem_grc(g) + & - cnveg_nitrogenflux_inst%dwt_seedn_to_deadstem_patch(p) - - end do - - - ! calculate patch-to-column slash fluxes into litter and CWD pools - do p = bounds%begp, bounds%endp - c = patch%column(p) - - ! fine and coarse root to litter and CWD slash carbon fluxes - cnveg_carbonflux_inst%dwt_slash_cflux_col(c) = & - cnveg_carbonflux_inst%dwt_slash_cflux_col(c) + & - dwt_frootc_to_litter(p)/dt + & - dwt_livecrootc_to_litter(p)/dt + & - dwt_deadcrootc_to_litter(p)/dt - - if ( use_c13 ) then - c13_cnveg_carbonflux_inst%dwt_slash_cflux_col(c) = & - c13_cnveg_carbonflux_inst%dwt_slash_cflux_col(c) + & - dwt_frootc13_to_litter(p)/dt + & - dwt_livecrootc13_to_litter(p)/dt + & - dwt_deadcrootc13_to_litter(p)/dt - endif - - if ( use_c14 ) then - c14_cnveg_carbonflux_inst%dwt_slash_cflux_col(c) = & - c14_cnveg_carbonflux_inst%dwt_slash_cflux_col(c) + & - dwt_frootc14_to_litter(p)/dt + & - dwt_livecrootc14_to_litter(p)/dt + & - dwt_deadcrootc14_to_litter(p)/dt - endif - - end do - - - ! calculate patch-to-column for fluxes into litter and CWD pools - do j = 1, nlevdecomp - do p = bounds%begp, bounds%endp - c = patch%column(p) - - ! fine root litter carbon fluxes - cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = & - cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + & - (dwt_frootc_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = & - cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + & - (dwt_frootc_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = & - cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + & - (dwt_frootc_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - - ! fine root litter nitrogen fluxes - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_met_n_col(c,j) = & - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_met_n_col(c,j) + & - (dwt_frootn_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_cel_n_col(c,j) = & - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_cel_n_col(c,j) + & - (dwt_frootn_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_lig_n_col(c,j) = & - cnveg_nitrogenflux_inst%dwt_frootn_to_litr_lig_n_col(c,j) + & - (dwt_frootn_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - ! livecroot fluxes to cwd - cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = & - cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) + & - (dwt_livecrootc_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - cnveg_nitrogenflux_inst%dwt_livecrootn_to_cwdn_col(c,j) = & - cnveg_nitrogenflux_inst%dwt_livecrootn_to_cwdn_col(c,j) + & - (dwt_livecrootn_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - ! deadcroot fluxes to cwd - cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) = & - cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) + & - (dwt_deadcrootc_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - cnveg_nitrogenflux_inst%dwt_deadcrootn_to_cwdn_col(c,j) = & - cnveg_nitrogenflux_inst%dwt_deadcrootn_to_cwdn_col(c,j) + & - (dwt_deadcrootn_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - if ( use_c13 ) then - ! C13 fine root litter fluxes - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = & - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = & - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = & - c13_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - ! livecroot fluxes to cwd - c13_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = & - c13_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) + & - (dwt_livecrootc13_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - ! deadcroot fluxes to cwd - c13_cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) = & - c13_cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) + & - (dwt_deadcrootc13_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - endif - - if ( use_c14 ) then - ! C14 fine root litter fluxes - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) = & - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_met_c_col(c,j) + & - (dwt_frootc14_to_litter(p)*pftcon%fr_flab(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) = & - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_cel_c_col(c,j) + & - (dwt_frootc14_to_litter(p)*pftcon%fr_fcel(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) = & - c14_cnveg_carbonflux_inst%dwt_frootc_to_litr_lig_c_col(c,j) + & - (dwt_frootc14_to_litter(p)*pftcon%fr_flig(patch%itype(p)))/dt & - * soilbiogeochem_state_inst%froot_prof_patch(p,j) - - ! livecroot fluxes to cwd - c14_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) = & - c14_cnveg_carbonflux_inst%dwt_livecrootc_to_cwdc_col(c,j) + & - (dwt_livecrootc14_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - - ! deadcroot fluxes to cwd - c14_cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) = & - c14_cnveg_carbonflux_inst%dwt_deadcrootc_to_cwdc_col(c,j) + & - (dwt_deadcrootc14_to_litter(p))/dt * soilbiogeochem_state_inst%croot_prof_patch(p,j) - endif - - end do - end do - - ! Store fluxes into product pools. Note that the temporary conv_cflux, wood_product_cflux - ! (and similar) fluxes are accumulated as negative values, but the values stored in - ! carbonflux_inst and nitrogenflux_inst are positive values. - do p = begp, endp - cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(p) = -wood_product_cflux(p)/dt - cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(p) = -crop_product_cflux(p)/dt - if (use_c13) then - c13_cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(p) = -wood_product_c13flux(p)/dt - c13_cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(p) = -crop_product_c13flux(p)/dt - end if - if (use_c14) then - c14_cnveg_carbonflux_inst%dwt_wood_productc_gain_patch(p) = -wood_product_c14flux(p)/dt - c14_cnveg_carbonflux_inst%dwt_crop_productc_gain_patch(p) = -crop_product_c14flux(p)/dt - end if - cnveg_nitrogenflux_inst%dwt_wood_productn_gain_patch(p) = -wood_product_nflux(p)/dt - cnveg_nitrogenflux_inst%dwt_crop_productn_gain_patch(p) = -crop_product_nflux(p)/dt - end do - - ! Set column-level conversion fluxes - - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - - ! Note that patch-level fluxes are stored per unit GRIDCELL area - thus, we don't - ! need to multiply by the patch's gridcell weight when translating patch-level - ! fluxes into gridcell-level fluxes. - - cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) = -conv_cflux(p)/dt - cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) = & - cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) + & - cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) - - if ( use_c13 ) then - ! C13 column-level flux updates - c13_cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) = -conv_c13flux(p)/dt - c13_cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) = & - c13_cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) + & - c13_cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) - endif - - if ( use_c14 ) then - ! C14 column-level flux updates - c14_cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) = -conv_c14flux(p)/dt - c14_cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) = & - c14_cnveg_carbonflux_inst%dwt_conv_cflux_grc(g) + & - c14_cnveg_carbonflux_inst%dwt_conv_cflux_patch(p) - endif - - cnveg_nitrogenflux_inst%dwt_conv_nflux_patch(p) = -conv_nflux(p)/dt - cnveg_nitrogenflux_inst%dwt_conv_nflux_grc(g) = & - cnveg_nitrogenflux_inst%dwt_conv_nflux_grc(g) + & - cnveg_nitrogenflux_inst%dwt_conv_nflux_patch(p) - - end do - - ! Deallocate patch-level flux arrays - deallocate(dwt) - deallocate(dwt_leafc_seed) - deallocate(dwt_leafn_seed) - deallocate(dwt_deadstemc_seed) - deallocate(dwt_deadstemn_seed) - deallocate(dwt_frootc_to_litter) - deallocate(dwt_livecrootc_to_litter) - deallocate(dwt_deadcrootc_to_litter) - deallocate(dwt_frootn_to_litter) - deallocate(dwt_livecrootn_to_litter) - deallocate(dwt_deadcrootn_to_litter) - deallocate(conv_cflux) - deallocate(wood_product_cflux) - deallocate(crop_product_cflux) - deallocate(conv_nflux) - deallocate(wood_product_nflux) - deallocate(crop_product_nflux) - - if ( use_c13 ) then - deallocate(dwt_leafc13_seed) - deallocate(dwt_deadstemc13_seed) - deallocate(dwt_frootc13_to_litter) - deallocate(dwt_livecrootc13_to_litter) - deallocate(dwt_deadcrootc13_to_litter) - deallocate(conv_c13flux) - deallocate(wood_product_c13flux) - deallocate(crop_product_c13flux) - endif - - if ( use_c14 ) then - deallocate(dwt_leafc14_seed) - deallocate(dwt_deadstemc14_seed) - deallocate(dwt_frootc14_to_litter) - deallocate(dwt_livecrootc14_to_litter) - deallocate(dwt_deadcrootc14_to_litter) - deallocate(conv_c14flux) - deallocate(wood_product_c14flux) - deallocate(crop_product_c14flux) - endif - - end subroutine dyn_cnbal_patch - - !----------------------------------------------------------------------- - subroutine dyn_cnbal_col(bounds, clump_index, column_state_updater, & - soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, soilbiogeochem_nitrogenstate_inst, & - ch4_inst) - ! - ! !DESCRIPTION: - ! Modify column-level state variables to maintain carbon and nitrogen balance with - ! dynamic column weights. - ! - ! !USES: - use dynColumnStateUpdaterMod, only : column_state_updater_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - type(column_state_updater_type) , intent(in) :: column_state_updater - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(ch4_type) , intent(inout) :: ch4_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'dyn_cnbal_col' - !----------------------------------------------------------------------- - - call soilbiogeochem_carbonstate_inst%DynamicColumnAdjustments(bounds, clump_index, & - column_state_updater) - if (use_c13) then - call c13_soilbiogeochem_carbonstate_inst%DynamicColumnAdjustments(bounds, clump_index, & - column_state_updater) - end if - if (use_c14) then - call c14_soilbiogeochem_carbonstate_inst%DynamicColumnAdjustments(bounds, clump_index, & - column_state_updater) - end if - - call soilbiogeochem_nitrogenstate_inst%DynamicColumnAdjustments(bounds, clump_index, & - column_state_updater) - - if (use_lch4) then - call ch4_inst%DynamicColumnAdjustments(bounds, clump_index, column_state_updater) - end if - - end subroutine dyn_cnbal_col - - -end module dynConsBiogeochemMod diff --git a/src/biogeochem/dynHarvestMod.F90 b/src/biogeochem/dynHarvestMod.F90 deleted file mode 100644 index a9344fd5cf..0000000000 --- a/src/biogeochem/dynHarvestMod.F90 +++ /dev/null @@ -1,648 +0,0 @@ -module dynHarvestMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle reading of the harvest data, as well as the state updates that happen as a - ! result of harvest. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use abortutils , only : endrun - use dynFileMod , only : dyn_file_type - use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type - use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use pftconMod , only : pftcon - use clm_varcon , only : grlnd - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dynHarvest_init ! initialize data structures for harvest information - public :: dynHarvest_interp ! get harvest data for current time step, if needed - public :: CNHarvest ! harvest mortality routine for CN code - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: CNHarvestPftToColumn ! gather patch-level harvest fluxes to the column level - ! - ! !PRIVATE TYPES: - - ! Note that, since we have our own dynHarvest_file object (distinct from dynpft_file), - ! we could theoretically have a separate file providing harvest data from that providing - ! the pftdyn data - type(dyn_file_type), target :: dynHarvest_file ! information for the file containing harvest data - - ! Define the underlying harvest variables - integer, parameter :: num_harvest_inst = 5 - character(len=64), parameter :: harvest_varnames(num_harvest_inst) = & - [character(len=64) :: 'HARVEST_VH1', 'HARVEST_VH2', 'HARVEST_SH1', 'HARVEST_SH2', 'HARVEST_SH3'] - - type(dyn_var_time_uninterp_type) :: harvest_inst(num_harvest_inst) ! value of each harvest variable - - real(r8) , allocatable :: harvest(:) ! harvest rates - logical :: do_harvest ! whether we're in a period when we should do harvest - character(len=*), parameter :: string_not_set = "not_set" ! string to initialize with to indicate string wasn't set - character(len=64) :: harvest_units = string_not_set ! units from harvest variables - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !--------------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine dynHarvest_init(bounds, harvest_filename) - ! - ! !DESCRIPTION: - ! Initialize data structures for harvest information. - ! This should be called once, during model initialization. - ! - ! !USES: - use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type - use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! proc-level bounds - character(len=*) , intent(in) :: harvest_filename ! name of file containing harvest information - ! - ! !LOCAL VARIABLES: - integer :: varnum ! counter for harvest variables - integer :: num_points ! number of spatial points - integer :: ier ! error code - character(len=64) :: units = string_not_set - - character(len=*), parameter :: subname = 'dynHarvest_init' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - allocate(harvest(bounds%begg:bounds%endg),stat=ier) - if (ier /= 0) then - call endrun(msg=' allocation error for harvest'//errMsg(sourcefile, __LINE__)) - end if - - ! Get the year from the START of the timestep for consistency with other dyn file - ! stuff (though it shouldn't actually matter for harvest, given the way the - ! once-per-year harvest is applied). - dynHarvest_file = dyn_file_type(harvest_filename, YEAR_POSITION_START_OF_TIMESTEP) - - ! Get initial harvest data - num_points = (bounds%endg - bounds%begg + 1) - do varnum = 1, num_harvest_inst - harvest_inst(varnum) = dyn_var_time_uninterp_type( & - dyn_file=dynHarvest_file, varname=harvest_varnames(varnum), & - dim1name=grlnd, conversion_factor=1.0_r8, & - do_check_sums_equal_1=.false., data_shape=[num_points]) - call harvest_inst(varnum)%get_att("units",units) - if ( trim(units) == string_not_set ) then - units = "unitless" - else if ( trim(units) == "unitless" ) then - - else if ( trim(units) /= "gC/m2/yr" ) then - call endrun(msg=' bad units read in from file='//trim(units)//errMsg(sourcefile, __LINE__)) - end if - if ( varnum > 1 .and. trim(units) /= trim(harvest_units) )then - call endrun(msg=' harvest units are inconsitent on file ='// & - trim(harvest_filename)//errMsg(sourcefile, __LINE__)) - end if - harvest_units = units - units = string_not_set - end do - - end subroutine dynHarvest_init - - - !----------------------------------------------------------------------- - subroutine dynHarvest_interp(bounds) - ! - ! !DESCRIPTION: - ! Get harvest data for model time, when needed. - ! - ! Note that harvest data are stored as rates (not weights) and so time interpolation - ! is not necessary - the harvest rate is held constant through the year. This is - ! consistent with the treatment of changing PFT weights, where interpolation of the - ! annual endpoint weights leads to a constant rate of change in PFT weight through the - ! year, with abrupt changes in the rate at annual boundaries. - ! - ! !USES: - use dynTimeInfoMod , only : time_info_type - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! proc-level bounds - ! - ! !LOCAL VARIABLES: - integer :: varnum ! counter for harvest variables - real(r8), allocatable :: this_data(:) ! data for a single harvest variable - - character(len=*), parameter :: subname = 'dynHarvest_interp' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - call dynHarvest_file%time_info%set_current_year() - - ! Get total harvest for this time step - harvest(bounds%begg:bounds%endg) = 0._r8 - - if (dynHarvest_file%time_info%is_before_time_series()) then - ! Turn off harvest before the start of the harvest time series - do_harvest = .false. - else - ! Note that do_harvest stays true even past the end of the time series. This - ! means that harvest rates will be maintained at the rate given in the last - ! year of the file for all years past the end of this specified time series. - do_harvest = .true. - allocate(this_data(bounds%begg:bounds%endg)) - do varnum = 1, num_harvest_inst - call harvest_inst(varnum)%get_current_data(this_data) - harvest(bounds%begg:bounds%endg) = harvest(bounds%begg:bounds%endg) + & - this_data(bounds%begg:bounds%endg) - end do - deallocate(this_data) - end if - - end subroutine dynHarvest_interp - - - !----------------------------------------------------------------------- - subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & - soilbiogeochem_state_inst, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Harvest mortality routine for coupled carbon-nitrogen code (CN) - ! - ! !USES: - use pftconMod , only : noveg, nbrdlf_evr_shrub - use clm_varcon , only : secspday - use clm_time_manager, only : get_step_size_real, is_beg_curr_year - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p ! patch index - integer :: g ! gridcell index - integer :: fp ! patch filter index - real(r8):: thistreec ! carbon in this tree for calculating harvest fraction (gC/m2) - real(r8):: cm ! rate for carbon harvest mortality (gC/m2/yr) - real(r8):: am ! rate for fractional harvest mortality (1/yr) - real(r8):: m ! rate for fractional harvest mortality (1/s) - real(r8):: dtime ! model time step (s) - !----------------------------------------------------------------------- - - associate(& - ivt => patch%itype , & ! Input: [integer (:)] pft vegetation type - - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C - xsmrpool => cnveg_carbonstate_inst%xsmrpool_patch , & ! Input: [real(r8) (:)] (gC/m2) abstract C pool to meet excess MR demand - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C storage - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C storage - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C storage - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) growth respiration storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C transfer - gresp_xfer => cnveg_carbonstate_inst%gresp_xfer_patch , & ! Input: [real(r8) (:)] (gC/m2) growth respiration transfer - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N - deadstemn => cnveg_nitrogenstate_inst%deadstemn_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N - deadcrootn => cnveg_nitrogenstate_inst%deadcrootn_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:)] (gN/m2) plant pool of retranslocated N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N storage - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N storage - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N transfer - - hrv_leafc_to_litter => cnveg_carbonflux_inst%hrv_leafc_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootc_to_litter => cnveg_carbonflux_inst%hrv_frootc_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemc_to_litter => cnveg_carbonflux_inst%hrv_livestemc_to_litter_patch , & ! Output: [real(r8) (:)] - wood_harvestc => cnveg_carbonflux_inst%wood_harvestc_patch , & ! Output: [real(r8) (:)] - hrv_livecrootc_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootc_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_xsmrpool_to_atm => cnveg_carbonflux_inst%hrv_xsmrpool_to_atm_patch , & ! Output: [real(r8) (:)] - hrv_leafc_storage_to_litter => cnveg_carbonflux_inst%hrv_leafc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootc_storage_to_litter => cnveg_carbonflux_inst%hrv_frootc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemc_storage_to_litter => cnveg_carbonflux_inst%hrv_livestemc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadstemc_storage_to_litter => cnveg_carbonflux_inst%hrv_deadstemc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livecrootc_storage_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootc_storage_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_gresp_storage_to_litter => cnveg_carbonflux_inst%hrv_gresp_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_leafc_xfer_to_litter => cnveg_carbonflux_inst%hrv_leafc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_frootc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemc_xfer_to_litter => cnveg_carbonflux_inst%hrv_livestemc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadstemc_xfer_to_litter => cnveg_carbonflux_inst%hrv_deadstemc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livecrootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_gresp_xfer_to_litter => cnveg_carbonflux_inst%hrv_gresp_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - - hrv_leafn_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootn_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemn_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_to_litter_patch , & ! Output: [real(r8) (:)] - wood_harvestn => cnveg_nitrogenflux_inst%wood_harvestn_patch , & ! Output: [real(r8) (:)] - hrv_livecrootn_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootn_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_retransn_to_litter => cnveg_nitrogenflux_inst%hrv_retransn_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_leafn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadstemn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_deadstemn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livecrootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_storage_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_leafn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_frootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livestemn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadstemn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_deadstemn_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_livecrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_xfer_to_litter_patch , & ! Output: [real(r8) (:)] - hrv_deadcrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_xfer_to_litter_patch & ! Output: [real(r8) (:)] - ) - - dtime = get_step_size_real() - - ! patch loop - do fp = 1,num_soilp - p = filter_soilp(fp) - g = patch%gridcell(p) - - ! If this is a tree pft, then - ! get the annual harvest "mortality" rate (am) from harvest array - ! and convert to rate per second - if (ivt(p) > noveg .and. ivt(p) < nbrdlf_evr_shrub) then - - if (do_harvest) then - if (harvest_units == "gC/m2/yr") then - thistreec = leafc(p) + frootc(p) + livestemc(p) + deadstemc(p) + livecrootc(p) + deadcrootc(p) + xsmrpool(p) - cm = harvest(g) - if (thistreec > 0.0_r8) then - am = min(0.98_r8,cm/thistreec) ! Only harvest up to 98% so regrowth is possible PJL - else - am = 0._r8 - end if - else - am = harvest(g) - end if - - ! Apply all harvest at the start of the year - if (is_beg_curr_year()) then - m = am/dtime - else - m = 0._r8 - end if - else - m = 0._r8 - end if - - ! patch-level harvest carbon fluxes - ! displayed pools - hrv_leafc_to_litter(p) = leafc(p) * m - hrv_frootc_to_litter(p) = frootc(p) * m - hrv_livestemc_to_litter(p) = livestemc(p) * m - wood_harvestc(p) = deadstemc(p) * m - hrv_livecrootc_to_litter(p) = livecrootc(p) * m - hrv_deadcrootc_to_litter(p) = deadcrootc(p) * m - hrv_xsmrpool_to_atm(p) = xsmrpool(p) * m - - ! storage pools - hrv_leafc_storage_to_litter(p) = leafc_storage(p) * m - hrv_frootc_storage_to_litter(p) = frootc_storage(p) * m - hrv_livestemc_storage_to_litter(p) = livestemc_storage(p) * m - hrv_deadstemc_storage_to_litter(p) = deadstemc_storage(p) * m - hrv_livecrootc_storage_to_litter(p) = livecrootc_storage(p) * m - hrv_deadcrootc_storage_to_litter(p) = deadcrootc_storage(p) * m - hrv_gresp_storage_to_litter(p) = gresp_storage(p) * m - - ! transfer pools - hrv_leafc_xfer_to_litter(p) = leafc_xfer(p) * m - hrv_frootc_xfer_to_litter(p) = frootc_xfer(p) * m - hrv_livestemc_xfer_to_litter(p) = livestemc_xfer(p) * m - hrv_deadstemc_xfer_to_litter(p) = deadstemc_xfer(p) * m - hrv_livecrootc_xfer_to_litter(p) = livecrootc_xfer(p) * m - hrv_deadcrootc_xfer_to_litter(p) = deadcrootc_xfer(p) * m - hrv_gresp_xfer_to_litter(p) = gresp_xfer(p) * m - - ! patch-level harvest mortality nitrogen fluxes - ! displayed pools - hrv_leafn_to_litter(p) = leafn(p) * m - hrv_frootn_to_litter(p) = frootn(p) * m - hrv_livestemn_to_litter(p) = livestemn(p) * m - wood_harvestn(p) = deadstemn(p) * m - hrv_livecrootn_to_litter(p) = livecrootn(p) * m - hrv_deadcrootn_to_litter(p) = deadcrootn(p) * m - hrv_retransn_to_litter(p) = retransn(p) * m - - ! storage pools - hrv_leafn_storage_to_litter(p) = leafn_storage(p) * m - hrv_frootn_storage_to_litter(p) = frootn_storage(p) * m - hrv_livestemn_storage_to_litter(p) = livestemn_storage(p) * m - hrv_deadstemn_storage_to_litter(p) = deadstemn_storage(p) * m - hrv_livecrootn_storage_to_litter(p) = livecrootn_storage(p) * m - hrv_deadcrootn_storage_to_litter(p) = deadcrootn_storage(p) * m - - ! transfer pools - hrv_leafn_xfer_to_litter(p) = leafn_xfer(p) * m - hrv_frootn_xfer_to_litter(p) = frootn_xfer(p) * m - hrv_livestemn_xfer_to_litter(p) = livestemn_xfer(p) * m - hrv_deadstemn_xfer_to_litter(p) = deadstemn_xfer(p) * m - hrv_livecrootn_xfer_to_litter(p) = livecrootn_xfer(p) * m - hrv_deadcrootn_xfer_to_litter(p) = deadcrootn_xfer(p) * m - - end if ! end tree block - - end do ! end of pft loop - - ! gather all patch-level litterfall fluxes from harvest to the column - ! for litter C and N inputs - - call CNHarvestPftToColumn(num_soilc, filter_soilc, & - soilbiogeochem_state_inst, cnveg_carbonflux_inst, cnveg_nitrogenflux_inst) - - end associate - - end subroutine CNHarvest - - !----------------------------------------------------------------------- - subroutine CNHarvestPftToColumn (num_soilc, filter_soilc, & - soilbiogeochem_state_inst, CNVeg_carbonflux_inst, cnveg_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! called at the end of CNHarvest to gather all patch-level harvest litterfall fluxes - ! to the column level and assign them to the three litter pools - ! - ! !USES: - use clm_varpar , only : maxpatch_pft, nlevdecomp - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! soil column filter - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c,pi,p,j ! indices - !----------------------------------------------------------------------- - - associate( & - ivt => patch%itype , & ! Input: [integer (:) ] pft vegetation type - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] pft weight relative to column (0-1) - - lf_flab => pftcon%lf_flab , & ! Input: leaf litter labile fraction - lf_fcel => pftcon%lf_fcel , & ! Input: leaf litter cellulose fraction - lf_flig => pftcon%lf_flig , & ! Input: leaf litter lignin fraction - fr_flab => pftcon%fr_flab , & ! Input: fine root litter labile fraction - fr_fcel => pftcon%fr_fcel , & ! Input: fine root litter cellulose fraction - fr_flig => pftcon%fr_flig , & ! Input: fine root litter lignin fraction - - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => soilbiogeochem_state_inst%stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - - hrv_leafc_to_litter => cnveg_carbonflux_inst%hrv_leafc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_to_litter => cnveg_carbonflux_inst%hrv_frootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_to_litter => cnveg_carbonflux_inst%hrv_livestemc_to_litter_patch , & ! Input: [real(r8) (:) ] - pwood_harvestc => cnveg_carbonflux_inst%wood_harvestc_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafc_storage_to_litter => cnveg_carbonflux_inst%hrv_leafc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_storage_to_litter => cnveg_carbonflux_inst%hrv_frootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_storage_to_litter => cnveg_carbonflux_inst%hrv_livestemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemc_storage_to_litter => cnveg_carbonflux_inst%hrv_deadstemc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_storage_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_storage_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_gresp_storage_to_litter => cnveg_carbonflux_inst%hrv_gresp_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafc_xfer_to_litter => cnveg_carbonflux_inst%hrv_leafc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_frootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemc_xfer_to_litter => cnveg_carbonflux_inst%hrv_livestemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemc_xfer_to_litter => cnveg_carbonflux_inst%hrv_deadstemc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_livecrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootc_xfer_to_litter => cnveg_carbonflux_inst%hrv_deadcrootc_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_gresp_xfer_to_litter => cnveg_carbonflux_inst%hrv_gresp_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - cwood_harvestc => cnveg_carbonflux_inst%wood_harvestc_col , & ! InOut: [real(r8) (:) ] - harvest_c_to_litr_met_c => cnveg_carbonflux_inst%harvest_c_to_litr_met_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter metabolic pool (gC/m3/s) - harvest_c_to_litr_cel_c => cnveg_carbonflux_inst%harvest_c_to_litr_cel_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter cellulose pool (gC/m3/s) - harvest_c_to_litr_lig_c => cnveg_carbonflux_inst%harvest_c_to_litr_lig_c_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to litter lignin pool (gC/m3/s) - harvest_c_to_cwdc => cnveg_carbonflux_inst%harvest_c_to_cwdc_col , & ! InOut: [real(r8) (:,:) ] C fluxes associated with harvest to CWD pool (gC/m3/s) - - hrv_leafn_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootn_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemn_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_to_litter_patch , & ! Input: [real(r8) (:) ] - pwood_harvestn => cnveg_nitrogenflux_inst%wood_harvestn_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootn_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootn_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_retransn_to_litter => cnveg_nitrogenflux_inst%hrv_retransn_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_deadstemn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootn_storage_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_storage_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_leafn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_leafn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_frootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_frootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livestemn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_livestemn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadstemn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_deadstemn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_livecrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_livecrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - hrv_deadcrootn_xfer_to_litter => cnveg_nitrogenflux_inst%hrv_deadcrootn_xfer_to_litter_patch , & ! Input: [real(r8) (:) ] - cwood_harvestn => cnveg_nitrogenflux_inst%wood_harvestn_col , & ! InOut: [real(r8) (:) ] - harvest_n_to_litr_met_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_met_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter metabolic pool (gN/m3/s) - harvest_n_to_litr_cel_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_cel_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter cellulose pool (gN/m3/s) - harvest_n_to_litr_lig_n => cnveg_nitrogenflux_inst%harvest_n_to_litr_lig_n_col , & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to litter lignin pool (gN/m3/s) - harvest_n_to_cwdn => cnveg_nitrogenflux_inst%harvest_n_to_cwdn_col & ! InOut: [real(r8) (:,:) ] N fluxes associated with harvest to CWD pool (gN/m3/s) - ) - - do j = 1, nlevdecomp - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - - ! leaf harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + & - hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + & - hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_cel_c(c,j) = harvest_c_to_litr_cel_c(c,j) + & - hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_lig_c(c,j) = harvest_c_to_litr_lig_c(c,j) + & - hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood harvest mortality carbon fluxes - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_livestemc_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_livecrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_cwdc(c,j) = harvest_c_to_cwdc(c,j) + & - hrv_deadcrootc_to_litter(p) * wtcol(p) * croot_prof(p,j) - - ! storage harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livestemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadstemc_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livecrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadcrootc_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_gresp_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! transfer harvest mortality carbon fluxes - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_leafc_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_frootc_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livestemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadstemc_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_livecrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_c_to_litr_met_c(c,j) = harvest_c_to_litr_met_c(c,j) + & - hrv_gresp_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! leaf harvest mortality nitrogen fluxes - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_n_to_litr_cel_n(c,j) = harvest_n_to_litr_cel_n(c,j) + & - hrv_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) * leaf_prof(p,j) - harvest_n_to_litr_lig_n(c,j) = harvest_n_to_litr_lig_n(c,j) + & - hrv_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) * leaf_prof(p,j) - - ! fine root litter nitrogen fluxes - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_n_to_litr_cel_n(c,j) = harvest_n_to_litr_cel_n(c,j) + & - hrv_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) * froot_prof(p,j) - harvest_n_to_litr_lig_n(c,j) = harvest_n_to_litr_lig_n(c,j) + & - hrv_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) * froot_prof(p,j) - - ! wood harvest mortality nitrogen fluxes - harvest_n_to_cwdn(c,j) = harvest_n_to_cwdn(c,j) + & - hrv_livestemn_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_n_to_cwdn(c,j) = harvest_n_to_cwdn(c,j) + & - hrv_livecrootn_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_n_to_cwdn(c,j) = harvest_n_to_cwdn(c,j) + & - hrv_deadcrootn_to_litter(p) * wtcol(p) * croot_prof(p,j) - - ! retranslocated N pool harvest mortality fluxes - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_retransn_to_litter(p) * wtcol(p) * leaf_prof(p,j) - - ! storage harvest mortality nitrogen fluxes - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_leafn_storage_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_frootn_storage_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_livestemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_deadstemn_storage_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_livecrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_deadcrootn_storage_to_litter(p) * wtcol(p) * croot_prof(p,j) - - ! transfer harvest mortality nitrogen fluxes - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_leafn_xfer_to_litter(p) * wtcol(p) * leaf_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_frootn_xfer_to_litter(p) * wtcol(p) * froot_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_livestemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_deadstemn_xfer_to_litter(p) * wtcol(p) * stem_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_livecrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - harvest_n_to_litr_met_n(c,j) = harvest_n_to_litr_met_n(c,j) + & - hrv_deadcrootn_xfer_to_litter(p) * wtcol(p) * croot_prof(p,j) - - end if - end if - - end do - - end do - end do - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - - if (patch%active(p)) then - ! wood harvest mortality carbon fluxes to product pools - cwood_harvestc(c) = cwood_harvestc(c) + & - pwood_harvestc(p) * wtcol(p) - - ! wood harvest mortality nitrogen fluxes to product pools - cwood_harvestn(c) = cwood_harvestn(c) + & - pwood_harvestn(p) * wtcol(p) - end if - end if - - end do - - end do - - end associate - - end subroutine CNHarvestPftToColumn - -end module dynHarvestMod diff --git a/src/biogeochem/test/CMakeLists.txt b/src/biogeochem/test/CMakeLists.txt deleted file mode 100644 index 15d41be10a..0000000000 --- a/src/biogeochem/test/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(Species_test) -add_subdirectory(CNVegComputeSeed_test) \ No newline at end of file diff --git a/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt b/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt deleted file mode 100644 index 35173a6dc3..0000000000 --- a/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set (pfunit_sources - test_ComputeSeedAmounts.pf) - -create_pFUnit_test(CNVegComputeSeed test_CNVegComputeSeed_exe - "${pfunit_sources}" "") - -target_link_libraries(test_CNVegComputeSeed_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/biogeochem/test/CNVegComputeSeed_test/test_ComputeSeedAmounts.pf b/src/biogeochem/test/CNVegComputeSeed_test/test_ComputeSeedAmounts.pf deleted file mode 100644 index f5e8aeff9b..0000000000 --- a/src/biogeochem/test/CNVegComputeSeed_test/test_ComputeSeedAmounts.pf +++ /dev/null @@ -1,361 +0,0 @@ -module test_ComputeSeedAmounts - - ! Tests of CNVegComputeSeedMod: ComputeSeedAmounts - - use pfunit_mod - use CNVegComputeSeedMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestFilterBuilderMod - use pftconMod - use CNSpeciesMod - use PatchType - use clm_varcon, only : c3_r2, c4_r2, c14ratio - - implicit none - - @TestCase - type, extends(TestCase) :: TestComputeSeed - ! filter - integer :: numf - integer, allocatable :: filter(:) - contains - procedure :: setUp - procedure :: tearDown - procedure :: do_ComputeSeedAmounts - end type TestComputeSeed - - real(r8), parameter :: tol = 1.e-13_r8 - - ! patch of interest - integer, parameter :: POI = begp + 1 - - ! PFT type in the patch of interest - integer, parameter :: POI_TYPE = 7 - - real(r8), parameter :: LEAFC_SEED = 12._r8 - real(r8), parameter :: DEADSTEMC_SEED = 13._r8 - - ! leaf contents in the patch of interest - real(r8), parameter :: LEAF_POI = 1._r8 - real(r8), parameter :: LEAF_STORAGE_POI = 2._r8 - real(r8), parameter :: LEAF_XFER_POI = 3._r8 - real(r8), parameter :: LEAF_TOTAL_POI = LEAF_POI + LEAF_STORAGE_POI + LEAF_XFER_POI - -contains - - subroutine setUp(this) - class(TestComputeSeed), intent(inout) :: this - integer :: pft_types(begp:begp+2) - - ! Tests use a grid with a single gridcell containing 3 vegetated patches, with a - ! filter active over all patches - pft_types(:) = 1 - pft_types(POI) = POI_TYPE - call setup_n_veg_patches(pwtcol = [0.25_r8, 0.5_r8, 0.25_r8], pft_types = pft_types) - call filter_from_range(bounds%begp, bounds%endp, this%numf, this%filter) - - ! Set relevant pftcon values to defaults; these should be overridden by individual - ! tests where they matter - call pftcon%InitForTesting() - pftcon%evergreen(:) = 0 - pftcon%woody(:) = 1 - pftcon%c3psn(:) = 1 - pftcon%leafcn(:) = 1._r8 - pftcon%deadwdcn(:) = 1._r8 - - end subroutine setUp - - subroutine tearDown(this) - class(TestComputeSeed), intent(inout) :: this - - call unittest_subgrid_teardown() - call pftcon%Clean() - end subroutine tearDown - - subroutine do_ComputeSeedAmounts(this, species, & - ignore_current_state, & - seed_leaf, seed_leaf_storage, seed_leaf_xfer, seed_deadstem) - ! Wraps the call to ComputeSeedAmounts - ! - ! Returns values for patch POI - class(TestComputeSeed), intent(inout) :: this - integer, intent(in) :: species - - ! if not provided, ignore_current_state is assumed to be false - logical, intent(in), optional :: ignore_current_state - - ! The following outputs are all for patch POI - real(r8), intent(out), optional :: seed_leaf - real(r8), intent(out), optional :: seed_leaf_storage - real(r8), intent(out), optional :: seed_leaf_xfer - real(r8), intent(out), optional :: seed_deadstem - - real(r8) :: leaf_patch(bounds%begp:bounds%endp) - real(r8) :: leaf_storage_patch(bounds%begp:bounds%endp) - real(r8) :: leaf_xfer_patch(bounds%begp:bounds%endp) - logical :: compute_here_patch(bounds%begp:bounds%endp) - logical :: ignore_current_state_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leaf_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leaf_storage_patch(bounds%begp:bounds%endp) - real(r8) :: seed_leaf_xfer_patch(bounds%begp:bounds%endp) - real(r8) :: seed_deadstem_patch(bounds%begp:bounds%endp) - - leaf_patch(:) = 0._r8 - leaf_patch(POI) = LEAF_POI - leaf_storage_patch(:) = 0._r8 - leaf_storage_patch(POI) = LEAF_STORAGE_POI - leaf_xfer_patch(:) = 0._r8 - leaf_xfer_patch(POI) = LEAF_XFER_POI - - compute_here_patch(:) = .true. - ignore_current_state_patch(:) = .false. - if (present(ignore_current_state)) then - ignore_current_state_patch(POI) = ignore_current_state - end if - - call ComputeSeedAmounts(bounds, & - this%numf, this%filter, & - species = species, & - leafc_seed = LEAFC_SEED, & - deadstemc_seed = DEADSTEMC_SEED, & - leaf_patch = leaf_patch, & - leaf_storage_patch = leaf_storage_patch, & - leaf_xfer_patch = leaf_xfer_patch, & - compute_here_patch = compute_here_patch, & - ignore_current_state_patch = ignore_current_state_patch, & - seed_leaf_patch = seed_leaf_patch, & - seed_leaf_storage_patch = seed_leaf_storage_patch, & - seed_leaf_xfer_patch = seed_leaf_xfer_patch, & - seed_deadstem_patch = seed_deadstem_patch) - - if (present(seed_leaf)) then - seed_leaf = seed_leaf_patch(POI) - end if - if (present(seed_leaf_storage)) then - seed_leaf_storage = seed_leaf_storage_patch(POI) - end if - if (present(seed_leaf_xfer)) then - seed_leaf_xfer = seed_leaf_xfer_patch(POI) - end if - if (present(seed_deadstem)) then - seed_deadstem = seed_deadstem_patch(POI) - end if - - end subroutine do_ComputeSeedAmounts - - @Test - subroutine c12_leaf(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf - real(r8) :: expected - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_leaf = seed_leaf) - - expected = LEAFC_SEED * LEAF_POI / LEAF_TOTAL_POI - @assertEqual(expected, seed_leaf, tolerance=tol) - end subroutine c12_leaf - - @Test - subroutine c12_leaf_storage(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf_storage - real(r8) :: expected - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_leaf_storage = seed_leaf_storage) - - expected = LEAFC_SEED * LEAF_STORAGE_POI / LEAF_TOTAL_POI - @assertEqual(expected, seed_leaf_storage, tolerance=tol) - end subroutine c12_leaf_storage - - @Test - subroutine c12_leaf_xfer(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf_xfer - real(r8) :: expected - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_leaf_xfer = seed_leaf_xfer) - - expected = LEAFC_SEED * LEAF_XFER_POI / LEAF_TOTAL_POI - @assertEqual(expected, seed_leaf_xfer, tolerance=tol) - end subroutine c12_leaf_xfer - - @Test - subroutine c12_deadstem_woody(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_deadstem - real(r8) :: expected - - pftcon%woody(POI_TYPE) = 1 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_deadstem = seed_deadstem) - - expected = DEADSTEMC_SEED - @assertEqual(expected, seed_deadstem, tolerance=tol) - end subroutine c12_deadstem_woody - - @Test - subroutine c12_deadstem_nonwoody(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_deadstem - - pftcon%woody(POI_TYPE) = 0 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_deadstem = seed_deadstem) - - @assertEqual(0._r8, seed_deadstem, tolerance=tol) - end subroutine c12_deadstem_nonwoody - - @Test - subroutine c12_leaf_ignoreCurrentState_evergreen(this) - ! When ignoring the current state, for evergreen, all leaf seed amount should be put - ! in the leaf itself - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf - real(r8) :: expected - - pftcon%evergreen(POI_TYPE) = 1 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - ignore_current_state = .true., & - seed_leaf = seed_leaf) - - expected = LEAFC_SEED - @assertEqual(expected, seed_leaf, tolerance=tol) - end subroutine c12_leaf_ignoreCurrentState_evergreen - - @Test - subroutine c12_leaf_storage_ignoreCurrentState_nonEvergreen(this) - ! When ignoring the current state, for evergreen, all leaf seed amount should be put - ! in leaf storage - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf_storage - real(r8) :: expected - - pftcon%evergreen(POI_TYPE) = 0 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - ignore_current_state = .true., & - seed_leaf_storage = seed_leaf_storage) - - expected = LEAFC_SEED - @assertEqual(expected, seed_leaf_storage, tolerance=tol) - end subroutine c12_leaf_storage_ignoreCurrentState_nonEvergreen - - @Test - subroutine c13_deadstem_woody_c3(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_deadstem - real(r8) :: expected - - pftcon%woody(POI_TYPE) = 1 - pftcon%c3psn(POI_TYPE) = 1 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C13, & - seed_deadstem = seed_deadstem) - - expected = DEADSTEMC_SEED * c3_r2 - @assertEqual(expected, seed_deadstem, tolerance=tol) - end subroutine c13_deadstem_woody_c3 - - @Test - subroutine c13_deadstem_woody_c4(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_deadstem - real(r8) :: expected - - pftcon%woody(POI_TYPE) = 1 - pftcon%c3psn(POI_TYPE) = 0 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C13, & - seed_deadstem = seed_deadstem) - - expected = DEADSTEMC_SEED * c4_r2 - @assertEqual(expected, seed_deadstem, tolerance=tol) - end subroutine c13_deadstem_woody_c4 - - @Test - subroutine c14_deadstem_woody(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_deadstem - real(r8) :: expected - - pftcon%woody(POI_TYPE) = 1 - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C14, & - seed_deadstem = seed_deadstem) - - expected = DEADSTEMC_SEED * c14ratio - @assertEqual(expected, seed_deadstem, tolerance=tol) - end subroutine c14_deadstem_woody - - @Test - subroutine n_leaf(this) - class(TestComputeSeed), intent(inout) :: this - real(r8), parameter :: leafcn = 10._r8 - real(r8) :: seed_leaf - real(r8) :: expected - - pftcon%leafcn(POI_TYPE) = leafcn - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_N, & - seed_leaf = seed_leaf) - - expected = (LEAFC_SEED / leafcn) * (LEAF_POI / LEAF_TOTAL_POI) - @assertEqual(expected, seed_leaf, tolerance=tol) - end subroutine n_leaf - - @Test - subroutine n_deadstem_woody(this) - class(TestComputeSeed), intent(inout) :: this - real(r8), parameter :: deadwdcn = 10._r8 - real(r8) :: seed_deadstem - real(r8) :: expected - - pftcon%deadwdcn(POI_TYPE) = deadwdcn - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_N, & - seed_deadstem = seed_deadstem) - - expected = DEADSTEMC_SEED / deadwdcn - @assertEqual(expected, seed_deadstem, tolerance=tol) - end subroutine n_deadstem_woody - - @Test - subroutine nonveg(this) - class(TestComputeSeed), intent(inout) :: this - real(r8) :: seed_leaf, seed_leaf_storage, seed_leaf_xfer, seed_deadstem - - patch%itype(POI) = noveg - - call this%do_ComputeSeedAmounts( & - species = CN_SPECIES_C12, & - seed_leaf = seed_leaf, seed_leaf_storage = seed_leaf_storage, & - seed_leaf_xfer = seed_leaf_xfer, seed_deadstem = seed_deadstem) - - @assertEqual(0._r8, seed_leaf) - @assertEqual(0._r8, seed_leaf_storage) - @assertEqual(0._r8, seed_leaf_xfer) - @assertEqual(0._r8, seed_deadstem) - end subroutine nonveg - -end module test_ComputeSeedAmounts - diff --git a/src/biogeochem/test/Species_test/CMakeLists.txt b/src/biogeochem/test/Species_test/CMakeLists.txt deleted file mode 100644 index 3a0bc4b50c..0000000000 --- a/src/biogeochem/test/Species_test/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set (pfunit_sources - test_SpeciesNonIsotope.pf - test_SpeciesIsotope.pf) - -create_pFUnit_test(Species test_Species_exe - "${pfunit_sources}" "") - -target_link_libraries(test_Species_exe clm csm_share) \ No newline at end of file diff --git a/src/biogeochem/test/Species_test/test_SpeciesIsotope.pf b/src/biogeochem/test/Species_test/test_SpeciesIsotope.pf deleted file mode 100644 index 8199b1c92a..0000000000 --- a/src/biogeochem/test/Species_test/test_SpeciesIsotope.pf +++ /dev/null @@ -1,95 +0,0 @@ -module test_SpeciesIsotope - - ! Tests of SpeciesIsotopeType - - use pfunit_mod - use SpeciesIsotopeType - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestSpeciesIsotope - contains - procedure :: setUp - procedure :: tearDown - end type TestSpeciesIsotope - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestSpeciesIsotope), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestSpeciesIsotope), intent(inout) :: this - end subroutine tearDown - - @Test - subroutine histFname_noSuffix(this) - class(TestSpeciesIsotope), intent(inout) :: this - type(species_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_isotope_type('C', '13') - - fname = species%hist_fname('FOO') - - @assertEqual('C13_FOOC', fname) - end subroutine histFname_noSuffix - - @Test - subroutine histFname_withSuffix(this) - class(TestSpeciesIsotope), intent(inout) :: this - type(species_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_isotope_type('C', '13') - - fname = species%hist_fname('FOO', suffix='_BAR') - - @assertEqual('C13_FOOC_BAR', fname) - end subroutine histFname_withSuffix - - @Test - subroutine restFname_noSuffix(this) - class(TestSpeciesIsotope), intent(inout) :: this - type(species_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_isotope_type('C', '13') - - fname = species%rest_fname('foo') - - @assertEqual('fooc_13', fname) - end subroutine restFname_noSuffix - - @Test - subroutine restFname_withSuffix(this) - class(TestSpeciesIsotope), intent(inout) :: this - type(species_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_isotope_type('C', '13') - - fname = species%rest_fname('foo', suffix='_bar') - - @assertEqual('fooc_13_bar', fname) - end subroutine restFname_withSuffix - - @Test - subroutine getSpecies(this) - class(TestSpeciesIsotope), intent(inout) :: this - type(species_isotope_type) :: species - character(len=:), allocatable :: species_name - - species = species_isotope_type('C', '13') - - species_name = species%get_species() - - @assertEqual('C13', species_name) - end subroutine getSpecies - -end module test_SpeciesIsotope diff --git a/src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf b/src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf deleted file mode 100644 index e9e4b9fac5..0000000000 --- a/src/biogeochem/test/Species_test/test_SpeciesNonIsotope.pf +++ /dev/null @@ -1,83 +0,0 @@ -module test_SpeciesNonIsotope - - ! Tests of SpeciesNonIsotopeType - - use pfunit_mod - use SpeciesNonIsotopeType - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestSpeciesNonIsotope - contains - procedure :: setUp - procedure :: tearDown - end type TestSpeciesNonIsotope - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - end subroutine tearDown - - @Test - subroutine histFname_noSuffix(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - type(species_non_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_non_isotope_type('C') - - fname = species%hist_fname('FOO') - - @assertEqual('FOOC', fname) - end subroutine histFname_noSuffix - - @Test - subroutine histFname_withSuffix(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - type(species_non_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_non_isotope_type('C') - - fname = species%hist_fname('FOO', suffix='_BAR') - - @assertEqual('FOOC_BAR', fname) - end subroutine histFname_withSuffix - - @Test - subroutine restFname_noSuffix(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - type(species_non_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_non_isotope_type('C') - - fname = species%rest_fname('foo') - - @assertEqual('fooc', fname) - end subroutine restFname_noSuffix - - @Test - subroutine restFname_withSuffix(this) - class(TestSpeciesNonIsotope), intent(inout) :: this - type(species_non_isotope_type) :: species - character(len=:), allocatable :: fname - - species = species_non_isotope_type('C') - - fname = species%rest_fname('foo', suffix='_bar') - - @assertEqual('fooc_bar', fname) - end subroutine restFname_withSuffix - - -end module test_SpeciesNonIsotope diff --git a/src/biogeophys/ActiveLayerMod.F90 b/src/biogeophys/ActiveLayerMod.F90 deleted file mode 100644 index a1b871829c..0000000000 --- a/src/biogeophys/ActiveLayerMod.F90 +++ /dev/null @@ -1,155 +0,0 @@ -module ActiveLayerMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding routines for calculation of active layer dynamics - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varctl , only : iulog - use TemperatureType , only : temperature_type - use CanopyStateType , only : canopystate_type - use GridcellType , only : grc - use ColumnType , only : col - ! - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: alt_calc - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine alt_calc(num_soilc, filter_soilc, & - temperature_inst, canopystate_inst) - ! - ! !DESCRIPTION: - ! define active layer thickness similarly to frost_table, except set as deepest thawed layer and define on nlevgrnd - ! also update annual maxima, and keep track of prior year for rooting memory - ! - ! BUG(wjs, 2014-12-15, bugz 2107) Because of this routine's placement in the driver - ! sequence (it is called very early in each timestep, before weights are adjusted and - ! filters are updated), it may be necessary for this routine to compute values over - ! inactive as well as active points (since some inactive points may soon become - ! active) - so that's what is done now. Currently, it seems to be okay to do this, - ! because the variables computed here seem to only depend on quantities that are valid - ! over inactive as well as active points. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varpar , only : nlevgrnd - use clm_time_manager , only : get_curr_date, get_step_size - use clm_varctl , only : iulog - use clm_varcon , only : zsoi - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(temperature_type) , intent(in) :: temperature_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc, g ! counters - integer :: alt_ind ! index of base of activel layer - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: dtime ! time step length in seconds - integer :: k_frz ! index of first nonfrozen soil layer - logical :: found_thawlayer ! used to break loop when first unfrozen layer reached - real(r8) :: t1, t2, z1, z2 ! temporary variables - !----------------------------------------------------------------------- - - associate( & - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - alt => canopystate_inst%alt_col , & ! Output: [real(r8) (:) ] current depth of thaw - altmax => canopystate_inst%altmax_col , & ! Output: [real(r8) (:) ] maximum annual depth of thaw - altmax_lastyear => canopystate_inst%altmax_lastyear_col , & ! Output: [real(r8) (:) ] prior year maximum annual depth of thaw - alt_indx => canopystate_inst%alt_indx_col , & ! Output: [integer (:) ] current depth of thaw - altmax_indx => canopystate_inst%altmax_indx_col , & ! Output: [integer (:) ] maximum annual depth of thaw - altmax_lastyear_indx => canopystate_inst%altmax_lastyear_indx_col & ! Output: [integer (:) ] prior year maximum annual depth of thaw - ) - - ! on a set annual timestep, update annual maxima - ! make this 1 January for NH columns, 1 July for SH columns - call get_curr_date(year, mon, day, sec) - dtime = get_step_size() - if ( (mon .eq. 1) .and. (day .eq. 1) .and. ( sec / dtime .eq. 1) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if ( grc%lat(g) > 0. ) then - altmax_lastyear(c) = altmax(c) - altmax_lastyear_indx(c) = altmax_indx(c) - altmax(c) = 0. - altmax_indx(c) = 0 - endif - end do - endif - if ( (mon .eq. 7) .and. (day .eq. 1) .and. ( sec / dtime .eq. 1) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - if ( grc%lat(g) <= 0. ) then - altmax_lastyear(c) = altmax(c) - altmax_lastyear_indx(c) = altmax_indx(c) - altmax(c) = 0. - altmax_indx(c) = 0 - endif - end do - endif - - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate alt for a given timestep - ! start from base of soil and search upwards for first thawed layer. - ! note that this will put talik in with active layer - ! a different way of doing this could be to keep track of how long a given layer has ben frozen for, and define ALT as the first layer that has been frozen for less than 2 years. - if (t_soisno(c,nlevgrnd) > SHR_CONST_TKFRZ ) then - alt(c) = zsoi(nlevgrnd) - alt_indx(c) = nlevgrnd - else - k_frz=0 - found_thawlayer = .false. - do j=nlevgrnd-1,1,-1 - if ( ( t_soisno(c,j) > SHR_CONST_TKFRZ ) .and. .not. found_thawlayer ) then - k_frz=j - found_thawlayer = .true. - endif - end do - - if ( k_frz > 0 ) then - ! define active layer as the depth at which the linearly interpolated temperature line intersects with zero - z1 = zsoi(k_frz) - z2 = zsoi(k_frz+1) - t1 = t_soisno(c,k_frz) - t2 = t_soisno(c,k_frz+1) - alt(c) = z1 + (t1-SHR_CONST_TKFRZ)*(z2-z1)/(t1-t2) - alt_indx(c) = k_frz - else - alt(c)=0._r8 - alt_indx(c) = 0 - endif - endif - - - ! if appropriate, update maximum annual active layer thickness - if (alt(c) > altmax(c)) then - altmax(c) = alt(c) - altmax_indx(c) = alt_indx(c) - endif - - end do - - end associate - - end subroutine alt_calc - -end module ActiveLayerMod diff --git a/src/biogeophys/AerosolMod.F90 b/src/biogeophys/AerosolMod.F90 deleted file mode 100644 index e45aad41ab..0000000000 --- a/src/biogeophys/AerosolMod.F90 +++ /dev/null @@ -1,797 +0,0 @@ -module AerosolMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use clm_varpar , only : nlevsno, nlevgrnd - use clm_time_manager , only : get_step_size - use atm2lndType , only : atm2lnd_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use ColumnType , only : col - use abortutils , only : endrun - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: AerosolMasses - public :: AerosolFluxes - ! - ! !PUBLIC DATA MEMBERS: - real(r8), public, parameter :: snw_rds_min = 54.526_r8 ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] - real(r8), public :: fresh_snw_rds_max = 204.526_r8 ! maximum warm fresh snow effective radius [microns] - ! - type, public :: aerosol_type - real(r8), pointer, public :: mss_bcpho_col(:,:) ! mass of hydrophobic BC in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_bcphi_col(:,:) ! mass of hydrophillic BC in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_bctot_col(:,:) ! total mass of BC in snow (pho+phi) (col,lyr) [kg] - real(r8), pointer, public :: mss_bc_col_col(:) ! column-integrated mass of total BC [kg] - real(r8), pointer, public :: mss_bc_top_col(:) ! top-layer mass of total BC [kg] - - real(r8), pointer, public :: mss_ocpho_col(:,:) ! mass of hydrophobic OC in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_ocphi_col(:,:) ! mass of hydrophillic OC in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_octot_col(:,:) ! total mass of OC in snow (pho+phi) (col,lyr) [kg] - real(r8), pointer, public :: mss_oc_col_col(:) ! column-integrated mass of total OC [kg] - real(r8), pointer, public :: mss_oc_top_col(:) ! top-layer mass of total OC [kg] - - real(r8), pointer, public :: mss_dst1_col(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_dst2_col(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_dst3_col(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_dst4_col(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_dsttot_col(:,:) ! total mass of dust in snow (col,lyr) [kg] - real(r8), pointer, public :: mss_dst_col_col(:) ! column-integrated mass of dust in snow [kg] - real(r8), pointer, public :: mss_dst_top_col(:) ! top-layer mass of dust in snow [kg] - - real(r8), pointer, public :: mss_cnc_bcphi_col(:,:) ! mass concentration of hydrophilic BC in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_bcpho_col(:,:) ! mass concentration of hydrophilic BC in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_ocphi_col(:,:) ! mass concentration of hydrophilic OC in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_ocpho_col(:,:) ! mass concentration of hydrophilic OC in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_dst1_col(:,:) ! mass concentration of dust species 1 in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_dst2_col(:,:) ! mass concentration of dust species 2 in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_dst3_col(:,:) ! mass concentration of dust species 3 in snow (col,lyr) [kg/kg] - real(r8), pointer, public :: mss_cnc_dst4_col(:,:) ! mass concentration of dust species 4 in snow (col,lyr) [kg/kg] - - real(r8), pointer, private :: flx_dst_dep_dry1_col(:) ! dust species 1 dry deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_wet1_col(:) ! dust species 1 wet deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_dry2_col(:) ! dust species 2 dry deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_wet2_col(:) ! dust species 2 wet deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_dry3_col(:) ! dust species 3 dry deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_wet3_col(:) ! dust species 3 wet deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_dry4_col(:) ! dust species 4 dry deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_wet4_col(:) ! dust species 4 wet deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_dst_dep_col(:) ! total (dry+wet) dust deposition on ground (positive definite) [kg/s] - - real(r8), pointer, private :: flx_bc_dep_dry_col(:) ! dry (BCPHO+BCPHI) BC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_bc_dep_wet_col(:) ! wet (BCPHI) BC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_bc_dep_pho_col(:) ! hydrophobic BC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_bc_dep_phi_col(:) ! hydrophillic BC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_bc_dep_col(:) ! total (dry+wet) BC deposition on ground (positive definite) [kg/s] - - real(r8), pointer, private :: flx_oc_dep_dry_col(:) ! dry (OCPHO+OCPHI) OC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_oc_dep_wet_col(:) ! wet (OCPHI) OC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_oc_dep_pho_col(:) ! hydrophobic OC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_oc_dep_phi_col(:) ! hydrophillic OC deposition on ground (positive definite) [kg/s] - real(r8), pointer, private :: flx_oc_dep_col(:) ! total (dry+wet) OC deposition on ground (positive definite) [kg/s] - - contains - - ! Public procedures - procedure, public :: Init - procedure, public :: Restart - procedure, public :: Reset - - ! Private procedures - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, private :: InitReadNML - - end type aerosol_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, NLFilename) - - class(aerosol_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Input namelist filename - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - call this%InitReadNML(NLFilename) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - !--------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - allocate(this%flx_dst_dep_dry1_col (begc:endc)) ; this%flx_dst_dep_dry1_col (:) = nan - allocate(this%flx_dst_dep_wet1_col (begc:endc)) ; this%flx_dst_dep_wet1_col (:) = nan - allocate(this%flx_dst_dep_dry2_col (begc:endc)) ; this%flx_dst_dep_dry2_col (:) = nan - allocate(this%flx_dst_dep_wet2_col (begc:endc)) ; this%flx_dst_dep_wet2_col (:) = nan - allocate(this%flx_dst_dep_dry3_col (begc:endc)) ; this%flx_dst_dep_dry3_col (:) = nan - allocate(this%flx_dst_dep_wet3_col (begc:endc)) ; this%flx_dst_dep_wet3_col (:) = nan - allocate(this%flx_dst_dep_dry4_col (begc:endc)) ; this%flx_dst_dep_dry4_col (:) = nan - allocate(this%flx_dst_dep_wet4_col (begc:endc)) ; this%flx_dst_dep_wet4_col (:) = nan - allocate(this%flx_dst_dep_col (begc:endc)) ; this%flx_dst_dep_col (:) = nan - - allocate(this%flx_bc_dep_dry_col (begc:endc)) ; this%flx_bc_dep_dry_col (:) = nan - allocate(this%flx_bc_dep_wet_col (begc:endc)) ; this%flx_bc_dep_wet_col (:) = nan - allocate(this%flx_bc_dep_pho_col (begc:endc)) ; this%flx_bc_dep_pho_col (:) = nan - allocate(this%flx_bc_dep_phi_col (begc:endc)) ; this%flx_bc_dep_phi_col (:) = nan - allocate(this%flx_bc_dep_col (begc:endc)) ; this%flx_bc_dep_col (:) = nan - - allocate(this%flx_oc_dep_dry_col (begc:endc)) ; this%flx_oc_dep_dry_col (:) = nan - allocate(this%flx_oc_dep_wet_col (begc:endc)) ; this%flx_oc_dep_wet_col (:) = nan - allocate(this%flx_oc_dep_pho_col (begc:endc)) ; this%flx_oc_dep_pho_col (:) = nan - allocate(this%flx_oc_dep_phi_col (begc:endc)) ; this%flx_oc_dep_phi_col (:) = nan - allocate(this%flx_oc_dep_col (begc:endc)) ; this%flx_oc_dep_col (:) = nan - - allocate(this%mss_bcpho_col (begc:endc,-nlevsno+1:0)) ; this%mss_bcpho_col (:,:) = nan - allocate(this%mss_bcphi_col (begc:endc,-nlevsno+1:0)) ; this%mss_bcphi_col (:,:) = nan - allocate(this%mss_bctot_col (begc:endc,-nlevsno+1:0)) ; this%mss_bctot_col (:,:) = nan - allocate(this%mss_bc_col_col (begc:endc)) ; this%mss_bc_col_col (:) = nan - allocate(this%mss_bc_top_col (begc:endc)) ; this%mss_bc_top_col (:) = nan - - allocate(this%mss_ocpho_col (begc:endc,-nlevsno+1:0)) ; this%mss_ocpho_col (:,:) = nan - allocate(this%mss_ocphi_col (begc:endc,-nlevsno+1:0)) ; this%mss_ocphi_col (:,:) = nan - allocate(this%mss_octot_col (begc:endc,-nlevsno+1:0)) ; this%mss_octot_col (:,:) = nan - allocate(this%mss_oc_col_col (begc:endc)) ; this%mss_oc_col_col (:) = nan - allocate(this%mss_oc_top_col (begc:endc)) ; this%mss_oc_top_col (:) = nan - - allocate(this%mss_dst1_col (begc:endc,-nlevsno+1:0)) ; this%mss_dst1_col (:,:) = nan - allocate(this%mss_dst2_col (begc:endc,-nlevsno+1:0)) ; this%mss_dst2_col (:,:) = nan - allocate(this%mss_dst3_col (begc:endc,-nlevsno+1:0)) ; this%mss_dst3_col (:,:) = nan - allocate(this%mss_dst4_col (begc:endc,-nlevsno+1:0)) ; this%mss_dst4_col (:,:) = nan - allocate(this%mss_dsttot_col (begc:endc,-nlevsno+1:0)) ; this%mss_dsttot_col (:,:) = nan - allocate(this%mss_dst_col_col (begc:endc)) ; this%mss_dst_col_col (:) = nan - allocate(this%mss_dst_top_col (begc:endc)) ; this%mss_dst_top_col (:) = nan - - allocate(this%mss_cnc_bcphi_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_bcphi_col (:,:) = nan - allocate(this%mss_cnc_bcpho_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_bcpho_col (:,:) = nan - allocate(this%mss_cnc_ocphi_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_ocphi_col (:,:) = nan - allocate(this%mss_cnc_ocpho_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_ocpho_col (:,:) = nan - allocate(this%mss_cnc_dst1_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_dst1_col (:,:) = nan - allocate(this%mss_cnc_dst2_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_dst2_col (:,:) = nan - allocate(this%mss_cnc_dst3_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_dst3_col (:,:) = nan - allocate(this%mss_cnc_dst4_col (begc:endc,-nlevsno+1:0)) ; this%mss_cnc_dst4_col (:,:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use clm_varcon , only: spval - use clm_varpar , only: nlevsno - use histFileMod , only: hist_addfld1d, hist_addfld2d - use histFileMod , only: no_snow_normal, no_snow_zero - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - !--------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - this%flx_dst_dep_col(begc:endc) = spval - call hist_addfld1d (fname='DSTDEP', units='kg/m^2/s', & - avgflag='A', long_name='total dust deposition (dry+wet) from atmosphere', & - ptr_col=this%flx_dst_dep_col, set_urb=spval) - - this%flx_bc_dep_col(begc:endc) = spval - call hist_addfld1d (fname='BCDEP', units='kg/m^2/s', & - avgflag='A', long_name='total BC deposition (dry+wet) from atmosphere', & - ptr_col=this%flx_bc_dep_col, set_urb=spval) - - this%flx_oc_dep_col(begc:endc) = spval - call hist_addfld1d (fname='OCDEP', units='kg/m^2/s', & - avgflag='A', long_name='total OC deposition (dry+wet) from atmosphere', & - ptr_col=this%flx_oc_dep_col, set_urb=spval) - - this%mss_bc_col_col(begc:endc) = spval - call hist_addfld1d (fname='SNOBCMCL', units='kg/m2', & - avgflag='A', long_name='mass of BC in snow column', & - ptr_col=this%mss_bc_col_col, set_urb=spval) - - this%mss_bc_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNOBCMSL', units='kg/m2', & - avgflag='A', long_name='mass of BC in top snow layer', & - ptr_col=this%mss_bc_top_col, set_urb=spval) - - this%mss_oc_col_col(begc:endc) = spval - call hist_addfld1d (fname='SNOOCMCL', units='kg/m2', & - avgflag='A', long_name='mass of OC in snow column', & - ptr_col=this%mss_oc_col_col, set_urb=spval) - - this%mss_oc_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNOOCMSL', units='kg/m2', & - avgflag='A', long_name='mass of OC in top snow layer', & - ptr_col=this%mss_oc_top_col, set_urb=spval) - - this%mss_dst_col_col(begc:endc) = spval - call hist_addfld1d (fname='SNODSTMCL', units='kg/m2', & - avgflag='A', long_name='mass of dust in snow column', & - ptr_col=this%mss_dst_col_col, set_urb=spval) - - this%mss_dst_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNODSTMSL', units='kg/m2', & - avgflag='A', long_name='mass of dust in top snow layer', & - ptr_col=this%mss_dst_top_col, set_urb=spval) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c ! index - !----------------------------------------------------------------------- - - do c = bounds%begc,bounds%endc - this%mss_cnc_bcphi_col(c,:) = 0._r8 - this%mss_cnc_bcpho_col(c,:) = 0._r8 - this%mss_cnc_ocphi_col(c,:) = 0._r8 - this%mss_cnc_ocpho_col(c,:) = 0._r8 - this%mss_cnc_dst1_col(c,:) = 0._r8 - this%mss_cnc_dst2_col(c,:) = 0._r8 - this%mss_cnc_dst3_col(c,:) = 0._r8 - this%mss_cnc_dst4_col(c,:) = 0._r8 - - this%mss_bctot_col(c,:) = 0._r8 - this%mss_bcpho_col(c,:) = 0._r8 - this%mss_bcphi_col(c,:) = 0._r8 - - this%mss_octot_col(c,:) = 0._r8 - this%mss_ocpho_col(c,:) = 0._r8 - this%mss_ocphi_col(c,:) = 0._r8 - - this%mss_dst1_col(c,:) = 0._r8 - this%mss_dst2_col(c,:) = 0._r8 - this%mss_dst3_col(c,:) = 0._r8 - this%mss_dst4_col(c,:) = 0._r8 - this%mss_dsttot_col(c,:) = 0._r8 - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine InitReadNML(this, NLFilename) - ! - ! !USES: - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - character(len=*), intent(in) :: NLFilename ! Input namelist filename - ! - ! !LOCAL VARIABLES: - !----------------------------------------------------------------------- - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'Aerosol::InitReadNML' - character(len=*), parameter :: nmlname = 'aerosol' - !----------------------------------------------------------------------- - namelist/aerosol/ fresh_snw_rds_max - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=aerosol, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//" namelist "//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//" namelist "//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (fresh_snw_rds_max , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=aerosol) - write(iulog,*) ' ' - end if - - end subroutine InitReadNML - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag, & - h2osoi_ice_col, h2osoi_liq_col) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use clm_varpar , only : nlevsno, nlevsoi - use clm_varcon , only : spval - use clm_varctl , only : iulog - use clm_varpar , only : nlevsno - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - real(r8) , intent(in) :: h2osoi_ice_col( bounds%begc: , -nlevsno+1: ) ! ice content (col,lyr) [kg/m2] - real(r8) , intent(in) :: h2osoi_liq_col( bounds%begc: , -nlevsno+1: ) ! liquid water content (col,lyr) [kg/m2] - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(h2osoi_ice_col) == (/bounds%endc,nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osoi_liq_col) == (/bounds%endc,nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - call restartvar(ncid=ncid, flag=flag, varname='mss_bcpho', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer hydrophobic black carbon mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_bcpho_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_bcpho to zero - this%mss_bcpho_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='mss_bcphi', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer hydrophilic black carbon mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_bcphi_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_bcphi to zero - this%mss_bcphi_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='mss_ocpho', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer hydrophobic organic carbon mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_ocpho_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_ocpho to zero - this%mss_ocpho_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='mss_ocphi', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer hydrophilic organic carbon mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_ocphi_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_ocphi to zero - this%mss_ocphi_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='mss_dst1', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer dust species 1 mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_dst1_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_dst1 to zero - this%mss_dst1_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='mss_dst2', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer dust species 2 mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_dst2_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_dst2 to zero - this%mss_dst2_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - endif - - call restartvar(ncid=ncid, flag=flag, varname='mss_dst3', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer dust species 3 mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_dst3_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_dst3 to zero - this%mss_dst3_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - endif - - call restartvar(ncid=ncid, flag=flag, varname='mss_dst4', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer dust species 4 mass', units='kg m-2', & - interpinic_flag='interp', readvar=readvar, data=this%mss_dst4_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize mss_dst4 to zero - this%mss_dst4_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - end if - - ! initialize other variables that are derived from those stored in the restart buffer (SNICAR variables) - if (flag == 'read' ) then - do j = -nlevsno+1,0 - do c = bounds%begc, bounds%endc - ! mass concentrations of aerosols in snow - if (h2osoi_ice_col(c,j) + h2osoi_liq_col(c,j) > 0._r8) then - this%mss_cnc_bcpho_col(c,j) = this%mss_bcpho_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_bcphi_col(c,j) = this%mss_bcphi_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_ocpho_col(c,j) = this%mss_ocpho_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_ocphi_col(c,j) = this%mss_ocphi_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - - this%mss_cnc_dst1_col(c,j) = this%mss_dst1_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_dst2_col(c,j) = this%mss_dst2_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_dst3_col(c,j) = this%mss_dst3_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - this%mss_cnc_dst4_col(c,j) = this%mss_dst4_col(c,j) / (h2osoi_ice_col(c,j)+h2osoi_liq_col(c,j)) - else - this%mss_cnc_bcpho_col(c,j) = 0._r8 - this%mss_cnc_bcphi_col(c,j) = 0._r8 - this%mss_cnc_ocpho_col(c,j) = 0._r8 - this%mss_cnc_ocphi_col(c,j) = 0._r8 - - this%mss_cnc_dst1_col(c,j) = 0._r8 - this%mss_cnc_dst2_col(c,j) = 0._r8 - this%mss_cnc_dst3_col(c,j) = 0._r8 - this%mss_cnc_dst4_col(c,j) = 0._r8 - endif - enddo - enddo - endif - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine Reset(this, column) - ! - ! !DESCRIPTION: - ! Intitialize SNICAR variables for fresh snow column - ! - ! !ARGUMENTS: - class(aerosol_type) :: this - integer , intent(in) :: column ! column index - !----------------------------------------------------------------------- - - this%mss_bcpho_col(column,:) = 0._r8 - this%mss_bcphi_col(column,:) = 0._r8 - this%mss_bctot_col(column,:) = 0._r8 - this%mss_bc_col_col(column) = 0._r8 - this%mss_bc_top_col(column) = 0._r8 - - this%mss_ocpho_col(column,:) = 0._r8 - this%mss_ocphi_col(column,:) = 0._r8 - this%mss_octot_col(column,:) = 0._r8 - this%mss_oc_col_col(column) = 0._r8 - this%mss_oc_top_col(column) = 0._r8 - - this%mss_dst1_col(column,:) = 0._r8 - this%mss_dst2_col(column,:) = 0._r8 - this%mss_dst3_col(column,:) = 0._r8 - this%mss_dst4_col(column,:) = 0._r8 - this%mss_dsttot_col(column,:) = 0._r8 - this%mss_dst_col_col(column) = 0._r8 - this%mss_dst_top_col(column) = 0._r8 - - end subroutine Reset - - !----------------------------------------------------------------------- - subroutine AerosolMasses(bounds, num_on, filter_on, num_off, filter_off, & - waterflux_inst, waterstate_inst, aerosol_inst) - ! - ! !DESCRIPTION: - ! Calculate column-integrated aerosol masses, and - ! mass concentrations for radiative calculations and output - ! (based on new snow level state, after SnowFilter is rebuilt. - ! NEEDS TO BE AFTER SnowFiler is rebuilt in Hydrology2, otherwise there - ! can be zero snow layers but an active column in filter) - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in ) :: bounds - integer , intent(in) :: num_on ! number of column filter-ON points - integer , intent(in) :: filter_on(:) ! column filter for filter-ON points - integer , intent(in) :: num_off ! number of column non filter-OFF points - integer , intent(in) :: filter_off(:) ! column filter for filter-OFF points - type(waterflux_type) , intent(in) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: dtime ! land model time step (sec) - integer :: g,l,c,j,fc ! indices - real(r8) :: snowmass ! liquid+ice snow mass in a layer [kg/m2] - real(r8) :: snowcap_scl_fct ! temporary factor used to correct for snow capping - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - - h2osno_top => waterstate_inst%h2osno_top_col , & ! Output: [real(r8) (:) | top-layer mass of snow [kg] - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective snow grain radius (col,lyr) [microns, m^-6] - - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! Output: [real(r8) (:,:) ] mass of hydrophobic BC in snow (col,lyr) [kg] - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] mass of hydrophillic BC in snow (col,lyr) [kg] - mss_bctot => aerosol_inst%mss_bctot_col , & ! Output: [real(r8) (:,:) ] total mass of BC (pho+phi) (col,lyr) [kg] - mss_bc_col => aerosol_inst%mss_bc_col_col , & ! Output: [real(r8) (:) ] total mass of BC in snow column (col) [kg] - mss_bc_top => aerosol_inst%mss_bc_top_col , & ! Output: [real(r8) (:) ] total mass of BC in top snow layer (col) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! Output: [real(r8) (:,:) ] mass of hydrophobic OC in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! Output: [real(r8) (:,:) ] mass of hydrophillic OC in snow (col,lyr) [kg] - mss_octot => aerosol_inst%mss_octot_col , & ! Output: [real(r8) (:,:) ] total mass of OC (pho+phi) (col,lyr) [kg] - mss_oc_col => aerosol_inst%mss_oc_col_col , & ! Output: [real(r8) (:) ] total mass of OC in snow column (col) [kg] - mss_oc_top => aerosol_inst%mss_oc_top_col , & ! Output: [real(r8) (:) ] total mass of OC in top snow layer (col) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! Output: [real(r8) (:,:) ] mass of dust species 1 in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! Output: [real(r8) (:,:) ] mass of dust species 2 in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! Output: [real(r8) (:,:) ] mass of dust species 3 in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! Output: [real(r8) (:,:) ] mass of dust species 4 in snow (col,lyr) [kg] - mss_dsttot => aerosol_inst%mss_dsttot_col , & ! Output: [real(r8) (:,:) ] total mass of dust in snow (col,lyr) [kg] - mss_dst_col => aerosol_inst%mss_dst_col_col , & ! Output: [real(r8) (:) ] total mass of dust in snow column (col) [kg] - mss_dst_top => aerosol_inst%mss_dst_top_col , & ! Output: [real(r8) (:) ] total mass of dust in top snow layer (col) [kg] - mss_cnc_bcphi => aerosol_inst%mss_cnc_bcphi_col , & ! Output: [real(r8) (:,:) ] mass concentration of BC species 1 (col,lyr) [kg/kg] - mss_cnc_bcpho => aerosol_inst%mss_cnc_bcpho_col , & ! Output: [real(r8) (:,:) ] mass concentration of BC species 2 (col,lyr) [kg/kg] - mss_cnc_ocphi => aerosol_inst%mss_cnc_ocphi_col , & ! Output: [real(r8) (:,:) ] mass concentration of OC species 1 (col,lyr) [kg/kg] - mss_cnc_ocpho => aerosol_inst%mss_cnc_ocpho_col , & ! Output: [real(r8) (:,:) ] mass concentration of OC species 2 (col,lyr) [kg/kg] - mss_cnc_dst1 => aerosol_inst%mss_cnc_dst1_col , & ! Output: [real(r8) (:,:) ] mass concentration of dust species 1 (col,lyr) [kg/kg] - mss_cnc_dst2 => aerosol_inst%mss_cnc_dst2_col , & ! Output: [real(r8) (:,:) ] mass concentration of dust species 2 (col,lyr) [kg/kg] - mss_cnc_dst3 => aerosol_inst%mss_cnc_dst3_col , & ! Output: [real(r8) (:,:) ] mass concentration of dust species 3 (col,lyr) [kg/kg] - mss_cnc_dst4 => aerosol_inst%mss_cnc_dst4_col & ! Output: [real(r8) (:,:) ] mass concentration of dust species 4 (col,lyr) [kg/kg] - ) - - dtime = get_step_size() - - do fc = 1, num_on - c = filter_on(fc) - - ! Zero column-integrated aerosol mass before summation - mss_bc_col(c) = 0._r8 - mss_oc_col(c) = 0._r8 - mss_dst_col(c) = 0._r8 - - do j = -nlevsno+1, 0 - - ! layer mass of snow: - snowmass = h2osoi_ice(c,j) + h2osoi_liq(c,j) - - if (j >= snl(c)+1) then - - mss_bctot(c,j) = mss_bcpho(c,j) + mss_bcphi(c,j) - mss_bc_col(c) = mss_bc_col(c) + mss_bctot(c,j) - mss_cnc_bcphi(c,j) = mss_bcphi(c,j) / snowmass - mss_cnc_bcpho(c,j) = mss_bcpho(c,j) / snowmass - - mss_octot(c,j) = mss_ocpho(c,j) + mss_ocphi(c,j) - mss_oc_col(c) = mss_oc_col(c) + mss_octot(c,j) - mss_cnc_ocphi(c,j) = mss_ocphi(c,j) / snowmass - mss_cnc_ocpho(c,j) = mss_ocpho(c,j) / snowmass - - mss_dsttot(c,j) = mss_dst1(c,j) + mss_dst2(c,j) + mss_dst3(c,j) + mss_dst4(c,j) - mss_dst_col(c) = mss_dst_col(c) + mss_dsttot(c,j) - mss_cnc_dst1(c,j) = mss_dst1(c,j) / snowmass - mss_cnc_dst2(c,j) = mss_dst2(c,j) / snowmass - mss_cnc_dst3(c,j) = mss_dst3(c,j) / snowmass - mss_cnc_dst4(c,j) = mss_dst4(c,j) / snowmass - - else - !set variables of empty snow layers to zero - snw_rds(c,j) = 0._r8 - - mss_bcpho(c,j) = 0._r8 - mss_bcphi(c,j) = 0._r8 - mss_bctot(c,j) = 0._r8 - mss_cnc_bcphi(c,j) = 0._r8 - mss_cnc_bcpho(c,j) = 0._r8 - - mss_ocpho(c,j) = 0._r8 - mss_ocphi(c,j) = 0._r8 - mss_octot(c,j) = 0._r8 - mss_cnc_ocphi(c,j) = 0._r8 - mss_cnc_ocpho(c,j) = 0._r8 - - mss_dst1(c,j) = 0._r8 - mss_dst2(c,j) = 0._r8 - mss_dst3(c,j) = 0._r8 - mss_dst4(c,j) = 0._r8 - mss_dsttot(c,j) = 0._r8 - mss_cnc_dst1(c,j) = 0._r8 - mss_cnc_dst2(c,j) = 0._r8 - mss_cnc_dst3(c,j) = 0._r8 - mss_cnc_dst4(c,j) = 0._r8 - endif - enddo - - ! top-layer diagnostics - h2osno_top(c) = h2osoi_ice(c,snl(c)+1) + h2osoi_liq(c,snl(c)+1) !TODO MV - is this correct to be placed here??? - mss_bc_top(c) = mss_bctot(c,snl(c)+1) - mss_oc_top(c) = mss_octot(c,snl(c)+1) - mss_dst_top(c) = mss_dsttot(c,snl(c)+1) - enddo - - ! Zero mass variables in columns without snow - - do fc = 1, num_off - c = filter_off(fc) - - mss_bc_top(c) = 0._r8 - mss_bc_col(c) = 0._r8 - mss_bcpho(c,:) = 0._r8 - mss_bcphi(c,:) = 0._r8 - mss_bctot(c,:) = 0._r8 - mss_cnc_bcphi(c,:) = 0._r8 - mss_cnc_bcpho(c,:) = 0._r8 - - mss_oc_top(c) = 0._r8 - mss_oc_col(c) = 0._r8 - mss_ocpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_octot(c,:) = 0._r8 - mss_cnc_ocphi(c,:) = 0._r8 - mss_cnc_ocpho(c,:) = 0._r8 - - mss_dst_top(c) = 0._r8 - mss_dst_col(c) = 0._r8 - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - mss_dsttot(c,:) = 0._r8 - - mss_cnc_dst1(c,:) = 0._r8 - mss_cnc_dst2(c,:) = 0._r8 - mss_cnc_dst3(c,:) = 0._r8 - mss_cnc_dst4(c,:) = 0._r8 - - enddo - - end associate - - end subroutine AerosolMasses - - !----------------------------------------------------------------------- - subroutine AerosolFluxes(bounds, num_snowc, filter_snowc, & - atm2lnd_inst, aerosol_inst) - ! - ! !DESCRIPTION: - ! Compute aerosol fluxes through snowpack and aerosol deposition fluxes into top layere - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: dtime ! land model time step (sec) - integer :: c,g,j,fc - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - forc_aer => atm2lnd_inst%forc_aer_grc , & ! Input: [real(r8) (:,:) ] aerosol deposition from atmosphere model (grd,aer) [kg m-1 s-1] - - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic BC mass in snow (col,lyr) [kg] - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic BC mass in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic OC mass in snow (col,lyr) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic OC mass in snow (col,lyr) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! Output: [real(r8) (:,:) ] mass of dust species 1 in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! Output: [real(r8) (:,:) ] mass of dust species 2 in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! Output: [real(r8) (:,:) ] mass of dust species 3 in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! Output: [real(r8) (:,:) ] mass of dust species 4 in snow (col,lyr) [kg] - - flx_bc_dep => aerosol_inst%flx_bc_dep_col , & ! Output: [real(r8) (:) ] total BC deposition (col) [kg m-2 s-1] - flx_bc_dep_wet => aerosol_inst%flx_bc_dep_wet_col , & ! Output: [real(r8) (:) ] wet BC deposition (col) [kg m-2 s-1] - flx_bc_dep_dry => aerosol_inst%flx_bc_dep_dry_col , & ! Output: [real(r8) (:) ] dry BC deposition (col) [kg m-2 s-1] - flx_bc_dep_phi => aerosol_inst%flx_bc_dep_phi_col , & ! Output: [real(r8) (:) ] hydrophillic BC deposition (col) [kg m-1 s-1] - flx_bc_dep_pho => aerosol_inst%flx_bc_dep_pho_col , & ! Output: [real(r8) (:) ] hydrophobic BC deposition (col) [kg m-1 s-1] - flx_oc_dep => aerosol_inst%flx_oc_dep_col , & ! Output: [real(r8) (:) ] total OC deposition (col) [kg m-2 s-1] - flx_oc_dep_wet => aerosol_inst%flx_oc_dep_wet_col , & ! Output: [real(r8) (:) ] wet OC deposition (col) [kg m-2 s-1] - flx_oc_dep_dry => aerosol_inst%flx_oc_dep_dry_col , & ! Output: [real(r8) (:) ] dry OC deposition (col) [kg m-2 s-1] - flx_oc_dep_phi => aerosol_inst%flx_oc_dep_phi_col , & ! Output: [real(r8) (:) ] hydrophillic OC deposition (col) [kg m-1 s-1] - flx_oc_dep_pho => aerosol_inst%flx_oc_dep_pho_col , & ! Output: [real(r8) (:) ] hydrophobic OC deposition (col) [kg m-1 s-1] - flx_dst_dep => aerosol_inst%flx_dst_dep_col , & ! Output: [real(r8) (:) ] total dust deposition (col) [kg m-2 s-1] - flx_dst_dep_wet1 => aerosol_inst%flx_dst_dep_wet1_col , & ! Output: [real(r8) (:) ] wet dust (species 1) deposition (col) [kg m-2 s-1] - flx_dst_dep_dry1 => aerosol_inst%flx_dst_dep_dry1_col , & ! Output: [real(r8) (:) ] dry dust (species 1) deposition (col) [kg m-2 s-1] - flx_dst_dep_wet2 => aerosol_inst%flx_dst_dep_wet2_col , & ! Output: [real(r8) (:) ] wet dust (species 2) deposition (col) [kg m-2 s-1] - flx_dst_dep_dry2 => aerosol_inst%flx_dst_dep_dry2_col , & ! Output: [real(r8) (:) ] dry dust (species 2) deposition (col) [kg m-2 s-1] - flx_dst_dep_wet3 => aerosol_inst%flx_dst_dep_wet3_col , & ! Output: [real(r8) (:) ] wet dust (species 3) deposition (col) [kg m-2 s-1] - flx_dst_dep_dry3 => aerosol_inst%flx_dst_dep_dry3_col , & ! Output: [real(r8) (:) ] dry dust (species 3) deposition (col) [kg m-2 s-1] - flx_dst_dep_wet4 => aerosol_inst%flx_dst_dep_wet4_col , & ! Output: [real(r8) (:) ] wet dust (species 4) deposition (col) [kg m-2 s-1] - flx_dst_dep_dry4 => aerosol_inst%flx_dst_dep_dry4_col & ! Output: [real(r8) (:) ] dry dust (species 4) deposition (col) [kg m-2 s-1] - ) - - ! set aerosol deposition fluxes from forcing array - ! The forcing array is either set from an external file - ! or from fluxes received from the atmosphere model - - do c = bounds%begc,bounds%endc - g = col%gridcell(c) - - flx_bc_dep_dry(c) = forc_aer(g,1) + forc_aer(g,2) - flx_bc_dep_wet(c) = forc_aer(g,3) - flx_bc_dep_phi(c) = forc_aer(g,1) + forc_aer(g,3) - flx_bc_dep_pho(c) = forc_aer(g,2) - flx_bc_dep(c) = forc_aer(g,1) + forc_aer(g,2) + forc_aer(g,3) - - flx_oc_dep_dry(c) = forc_aer(g,4) + forc_aer(g,5) - flx_oc_dep_wet(c) = forc_aer(g,6) - flx_oc_dep_phi(c) = forc_aer(g,4) + forc_aer(g,6) - flx_oc_dep_pho(c) = forc_aer(g,5) - flx_oc_dep(c) = forc_aer(g,4) + forc_aer(g,5) + forc_aer(g,6) - - flx_dst_dep_wet1(c) = forc_aer(g,7) - flx_dst_dep_dry1(c) = forc_aer(g,8) - flx_dst_dep_wet2(c) = forc_aer(g,9) - flx_dst_dep_dry2(c) = forc_aer(g,10) - flx_dst_dep_wet3(c) = forc_aer(g,11) - flx_dst_dep_dry3(c) = forc_aer(g,12) - flx_dst_dep_wet4(c) = forc_aer(g,13) - flx_dst_dep_dry4(c) = forc_aer(g,14) - flx_dst_dep(c) = forc_aer(g,7) + forc_aer(g,8) + forc_aer(g,9) + & - forc_aer(g,10) + forc_aer(g,11) + forc_aer(g,12) + & - forc_aer(g,13) + forc_aer(g,14) - end do - - ! aerosol deposition fluxes into top layer - ! This is done after the inter-layer fluxes so that some aerosol - ! is in the top layer after deposition, and is not immediately - ! washed out before radiative calculations are done - - dtime = get_step_size() - - do fc = 1, num_snowc - c = filter_snowc(fc) - mss_bcphi(c,snl(c)+1) = mss_bcphi(c,snl(c)+1) + (flx_bc_dep_phi(c)*dtime) - mss_bcpho(c,snl(c)+1) = mss_bcpho(c,snl(c)+1) + (flx_bc_dep_pho(c)*dtime) - mss_ocphi(c,snl(c)+1) = mss_ocphi(c,snl(c)+1) + (flx_oc_dep_phi(c)*dtime) - mss_ocpho(c,snl(c)+1) = mss_ocpho(c,snl(c)+1) + (flx_oc_dep_pho(c)*dtime) - - mss_dst1(c,snl(c)+1) = mss_dst1(c,snl(c)+1) + (flx_dst_dep_dry1(c) + flx_dst_dep_wet1(c))*dtime - mss_dst2(c,snl(c)+1) = mss_dst2(c,snl(c)+1) + (flx_dst_dep_dry2(c) + flx_dst_dep_wet2(c))*dtime - mss_dst3(c,snl(c)+1) = mss_dst3(c,snl(c)+1) + (flx_dst_dep_dry3(c) + flx_dst_dep_wet3(c))*dtime - mss_dst4(c,snl(c)+1) = mss_dst4(c,snl(c)+1) + (flx_dst_dep_dry4(c) + flx_dst_dep_wet4(c))*dtime - end do - - end associate - - end subroutine AerosolFluxes - -end module AerosolMod diff --git a/src/biogeophys/BalanceCheckMod.F90 b/src/biogeophys/BalanceCheckMod.F90 deleted file mode 100644 index 91fdd30ad3..0000000000 --- a/src/biogeophys/BalanceCheckMod.F90 +++ /dev/null @@ -1,637 +0,0 @@ -module BalanceCheckMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Water and energy balance check. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : namep, namec - use clm_varpar , only : nlevsoi - use GetGlobalValuesMod , only : GetGlobalIndex - use atm2lndType , only : atm2lnd_type - use EnergyFluxType , only : energyflux_type - use SolarAbsorbedType , only : solarabs_type - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use IrrigationMod , only : irrigation_type - use GlacierSurfaceMassBalanceMod, only : glacier_smb_type - use TotalWaterAndHeatMod, only : ComputeWaterMassNonLake, ComputeWaterMassLake - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use landunit_varcon , only : istdlak, istsoil,istcrop,istwet,istice_mec - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varcon , only : aquifer_water_baseline - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - - public :: BeginWaterBalance ! Initialize water balance check - public :: BalanceCheck ! Water and energy balance check - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine BeginWaterBalance(bounds, & - num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - soilhydrology_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Initialize column-level water balance at beginning of time step - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc ! indices - !----------------------------------------------------------------------- - - associate( & - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - wa => soilhydrology_inst%wa_col , & ! Output: [real(r8) (:) ] water in the unconfined aquifer (mm) - begwb => waterstate_inst%begwb_col & ! Output: [real(r8) (:) ] water mass begining of the time step - ) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if (col%hydrologically_active(c)) then - if(zwt(c) <= zi(c,nlevsoi)) then - wa(c) = aquifer_water_baseline - end if - end if - end do - - call ComputeWaterMassNonLake(bounds, num_nolakec, filter_nolakec, & - soilhydrology_inst, waterstate_inst, begwb(bounds%begc:bounds%endc)) - - call ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, begwb(bounds%begc:bounds%endc)) - - end associate - - end subroutine BeginWaterBalance - - !----------------------------------------------------------------------- - subroutine BalanceCheck( bounds, & - atm2lnd_inst, solarabs_inst, waterflux_inst, waterstate_inst, & - irrigation_inst, glacier_smb_inst, energyflux_inst, canopystate_inst) - ! - ! !DESCRIPTION: - ! This subroutine accumulates the numerical truncation errors of the water - ! and energy balance calculation. It is helpful to see the performance of - ! the process of integration. - ! - ! The error for energy balance: - ! - ! error = abs(Net radiation - change of internal energy - Sensible heat - ! - Latent heat) - ! - ! The error for water balance: - ! - ! error = abs(precipitation - change of water storage - evaporation - runoff) - ! - ! !USES: - use clm_varcon , only : spval - use clm_time_manager , only : get_step_size, get_nstep - use clm_time_manager , only : get_nstep_since_startup_or_lastDA_restart_or_pause - use clm_instMod , only : surfalb_inst - use CanopyStateType , only : canopystate_type - use subgridAveMod - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(irrigation_type) , intent(in) :: irrigation_inst - type(glacier_smb_type), intent(in) :: glacier_smb_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(canopystate_type), intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g,fc ! indices - real(r8) :: dtime ! land model time step (sec) - integer :: nstep ! time step number - integer :: DAnstep ! time step number since last Data Assimilation (DA) - logical :: found ! flag in search loop - integer :: indexp,indexc,indexl,indexg ! index of first found in search loop - real(r8) :: forc_rain_col(bounds%begc:bounds%endc) ! column level rain rate [mm/s] - real(r8) :: forc_snow_col(bounds%begc:bounds%endc) ! column level snow rate [mm/s] - !----------------------------------------------------------------------- - - associate( & - volr => atm2lnd_inst%volr_grc , & ! Input: [real(r8) (:) ] river water storage (m3) - forc_solad => atm2lnd_inst%forc_solad_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (vis=forc_sols , nir=forc_soll ) - forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse radiation (vis=forc_solsd, nir=forc_solld) - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] rain rate [mm/s] - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] snow rate [mm/s] - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osno_old => waterstate_inst%h2osno_old_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) at previous time step - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] effective snow fraction - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - begwb => waterstate_inst%begwb_col , & ! Input: [real(r8) (:) ] water mass begining of the time step - errh2o => waterstate_inst%errh2o_col , & ! Output: [real(r8) (:) ] water conservation error (mm H2O) - errh2osno => waterstate_inst%errh2osno_col , & ! Output: [real(r8) (:) ] error in h2osno (kg m-2) - endwb => waterstate_inst%endwb_col , & ! Output: [real(r8) (:) ] water mass end of the time step - total_plant_stored_h2o_col => waterstate_inst%total_plant_stored_h2o_col, & ! Input: [real(r8) (:) ] water mass in plant tissues (kg m-2) - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col , & ! Input [real(r8) (:) ] water loss in soil layers to root uptake (mm H2O/s) - ! (ie transpiration demand, often = transpiration) - qflx_rain_grnd_col => waterflux_inst%qflx_rain_grnd_col , & ! Input: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+] - qflx_snow_grnd_col => waterflux_inst%qflx_snow_grnd_col , & ! Input: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+] - qflx_evap_soi => waterflux_inst%qflx_evap_soi_col , & ! Input: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Input: [real(r8) (:) ] excess liquid h2o due to snow capping (outgoing) (mm H2O /s) [+]` - qflx_snwcp_ice => waterflux_inst%qflx_snwcp_ice_col , & ! Input: [real(r8) (:) ] excess solid h2o due to snow capping (outgoing) (mm H2O /s) [+]` - qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! Input: [real(r8) (:) ] excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+]` - qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! Input: [real(r8) (:) ] excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+]` - qflx_evap_tot => waterflux_inst%qflx_evap_tot_col , & ! Input: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Input: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col , & ! Input: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_prec_grnd => waterflux_inst%qflx_prec_grnd_col , & ! Input: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)] - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:) ] snow falling on surface water (mm/s) - qflx_h2osfc_to_ice => waterflux_inst%qflx_h2osfc_to_ice_col , & ! Input: [real(r8) (:) ] conversion of h2osfc to ice - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] total runoff due to flooding - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Input: [real(r8) (:) ] surface water runoff (mm/s) - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Input: [real(r8) (:) ] drainage from snow pack - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) - qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Input: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes - qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_runoff => waterflux_inst%qflx_runoff_col , & ! Input: [real(r8) (:) ] total runoff (mm H2O /s) - qflx_ice_runoff_snwcp => waterflux_inst%qflx_ice_runoff_snwcp_col, & ! Input: [real(r8) (:) ] solid runoff from snow capping (mm H2O /s) - qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Input: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) - qflx_sl_top_soil => waterflux_inst%qflx_sl_top_soil_col , & ! Input: [real(r8) (:) ] liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) - qflx_liq_dynbal => waterflux_inst%qflx_liq_dynbal_grc , & ! Input: [real(r8) (:) ] liq runoff due to dynamic land cover change (mm H2O /s) - qflx_ice_dynbal => waterflux_inst%qflx_ice_dynbal_grc , & ! Input: [real(r8) (:) ] ice runoff due to dynamic land cover change (mm H2O /s) - snow_sources => waterflux_inst%snow_sources_col , & ! Output: [real(r8) (:) ] snow sources (mm H2O /s) - snow_sinks => waterflux_inst%snow_sinks_col , & ! Output: [real(r8) (:) ] snow sinks (mm H2O /s) - - qflx_irrig => irrigation_inst%qflx_irrig_col , & ! Input: [real(r8) (:) ] irrigation flux (mm H2O /s) - - qflx_glcice_dyn_water_flux => glacier_smb_inst%qflx_glcice_dyn_water_flux_col, & ! Input: [real(r8) (:)] water flux needed for balance check due to glc_dyn_runoff_routing (mm H2O/s) (positive means addition of water to the system) - - eflx_lwrad_out => energyflux_inst%eflx_lwrad_out_patch , & ! Input: [real(r8) (:) ] emitted infrared (longwave) radiation (W/m**2) - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Input: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Input: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch , & ! Input: [real(r8) (:) ] total latent heat flux (W/m**2) [+ to atm] - eflx_soil_grnd => energyflux_inst%eflx_soil_grnd_patch , & ! Input: [real(r8) (:) ] soil heat flux (W/m**2) [+ = into soil] - eflx_wasteheat_patch => energyflux_inst%eflx_wasteheat_patch , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac_patch => energyflux_inst%eflx_heat_from_ac_patch , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_traffic_patch => energyflux_inst%eflx_traffic_patch , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_dynbal => energyflux_inst%eflx_dynbal_grc , & ! Input: [real(r8) (:) ] energy conversion flux due to dynamic land cover change(W/m**2) [+ to atm] - errsoi_col => energyflux_inst%errsoi_col , & ! Output: [real(r8) (:) ] column-level soil/lake energy conservation error (W/m**2) - errsol => energyflux_inst%errsol_patch , & ! Output: [real(r8) (:) ] solar radiation conservation error (W/m**2) - errseb => energyflux_inst%errseb_patch , & ! Output: [real(r8) (:) ] surface energy conservation error (W/m**2) - errlon => energyflux_inst%errlon_patch , & ! Output: [real(r8) (:) ] longwave radiation conservation error (W/m**2) - - sabg_soil => solarabs_inst%sabg_soil_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by soil (W/m**2) - sabg_snow => solarabs_inst%sabg_snow_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by snow (W/m**2) - sabg_chk => solarabs_inst%sabg_chk_patch , & ! Input: [real(r8) (:) ] sum of soil/snow using current fsno, for balance check - fsa => solarabs_inst%fsa_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed (total) (W/m**2) - fsr => solarabs_inst%fsr_patch , & ! Input: [real(r8) (:) ] solar radiation reflected (W/m**2) - sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2) - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:,:)] - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:,:)] - - fabd => surfalb_inst%fabd_patch , & ! Input: [real(r8) (:,:)] flux absorbed by canopy per unit direct flux - fabi => surfalb_inst%fabi_patch , & ! Input: [real(r8) (:,:)] flux absorbed by canopy per unit indirect flux - albd => surfalb_inst%albd_patch , & ! Output: [real(r8) (:,:)] surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Output: [real(r8) (:,:)] surface albedo (diffuse) - ftdd => surfalb_inst%ftdd_patch , & ! Input: [real(r8) (:,:)] down direct flux below canopy per unit direct flux - ftid => surfalb_inst%ftid_patch , & ! Input: [real(r8) (:,:)] down diffuse flux below canopy per unit direct flux - ftii => surfalb_inst%ftii_patch , & ! Input: [real(r8) (:,:)] down diffuse flux below canopy per unit diffuse flux - - netrad => energyflux_inst%netrad_patch & ! Output: [real(r8) (:) ] net radiation (positive downward) (W/m**2) - ) - - ! Get step size and time step - - nstep = get_nstep() - DAnstep = get_nstep_since_startup_or_lastDA_restart_or_pause() - dtime = get_step_size() - - ! Determine column level incoming snow and rain - ! Assume no incident precipitation on urban wall columns (as in CanopyHydrologyMod.F90). - - do c = bounds%begc,bounds%endc - g = col%gridcell(c) - l = col%landunit(c) - - if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - forc_rain_col(c) = 0. - forc_snow_col(c) = 0. - else - forc_rain_col(c) = forc_rain(c) - forc_snow_col(c) = forc_snow(c) - end if - end do - - ! Water balance check - - do c = bounds%begc, bounds%endc - - ! add qflx_drain_perched and qflx_flood - if (col%active(c)) then - - errh2o(c) = endwb(c) - begwb(c) & - - (forc_rain_col(c) & - + forc_snow_col(c) & - + qflx_floodc(c) & - + qflx_irrig(c) & - + qflx_glcice_dyn_water_flux(c) & - - qflx_evap_tot(c) & - - qflx_surf(c) & - - qflx_h2osfc_surf(c) & - - qflx_qrgwl(c) & - - qflx_drain(c) & - - qflx_drain_perched(c) & - - qflx_ice_runoff_snwcp(c) & - - qflx_ice_runoff_xs(c) & - - qflx_snwcp_discarded_liq(c) & - - qflx_snwcp_discarded_ice(c)) * dtime - - else - - errh2o(c) = 0.0_r8 - - end if - - end do - - found = .false. - do c = bounds%begc, bounds%endc - if (abs(errh2o(c)) > 1.e-9_r8) then - found = .true. - indexc = c - end if - end do - - if ( found ) then - - write(iulog,*)'WARNING: water balance error ',& - ' nstep= ',nstep, & - ' local indexc= ',indexc,& - ! ' global indexc= ',GetGlobalIndex(decomp_index=indexc, clmlevel=namec), & - ' errh2o= ',errh2o(indexc) - - if ((col%itype(indexc) == icol_roof .or. & - col%itype(indexc) == icol_road_imperv .or. & - col%itype(indexc) == icol_road_perv) .and. & - abs(errh2o(indexc)) > 1.e-5_r8 .and. (DAnstep > 2) ) then - - write(iulog,*)'clm urban model is stopping - error is greater than 1e-5 (mm)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errh2o = ',errh2o(indexc) - write(iulog,*)'forc_rain = ',forc_rain_col(indexc)*dtime - write(iulog,*)'forc_snow = ',forc_snow_col(indexc)*dtime - write(iulog,*)'endwb = ',endwb(indexc) - write(iulog,*)'begwb = ',begwb(indexc) - write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime - write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime - write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime - write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime - write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime - write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime - write(iulog,*)'qflx_ice_runoff_snwcp = ',qflx_ice_runoff_snwcp(indexc)*dtime - write(iulog,*)'qflx_ice_runoff_xs = ',qflx_ice_runoff_xs(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_ice = ',qflx_snwcp_discarded_ice(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_liq = ',qflx_snwcp_discarded_liq(indexc)*dtime - write(iulog,*)'qflx_rootsoi_col(1:nlevsoil) = ',qflx_rootsoi_col(indexc,:)*dtime - write(iulog,*)'total_plant_stored_h2o_col = ',total_plant_stored_h2o_col(indexc) - write(iulog,*)'deltawb = ',endwb(indexc)-begwb(indexc) - write(iulog,*)'deltawb/dtime = ',(endwb(indexc)-begwb(indexc))/dtime - write(iulog,*)'deltaflux = ',forc_rain_col(indexc)+forc_snow_col(indexc) - (qflx_evap_tot(indexc) + & - qflx_surf(indexc)+qflx_h2osfc_surf(indexc)+qflx_drain(indexc)) - - write(iulog,*)'clm model is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - - else if (abs(errh2o(indexc)) > 1.e-5_r8 .and. (DAnstep > 2) ) then - - write(iulog,*)'clm model is stopping - error is greater than 1e-5 (mm)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errh2o = ',errh2o(indexc) - write(iulog,*)'forc_rain = ',forc_rain_col(indexc)*dtime - write(iulog,*)'forc_snow = ',forc_snow_col(indexc)*dtime - write(iulog,*)'total_plant_stored_h2o_col = ',total_plant_stored_h2o_col(indexc) - write(iulog,*)'endwb = ',endwb(indexc) - write(iulog,*)'begwb = ',begwb(indexc) - - write(iulog,*)'qflx_evap_tot = ',qflx_evap_tot(indexc)*dtime - write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc)*dtime - write(iulog,*)'qflx_surf = ',qflx_surf(indexc)*dtime - write(iulog,*)'qflx_h2osfc_surf = ',qflx_h2osfc_surf(indexc)*dtime - write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc)*dtime - write(iulog,*)'qflx_drain = ',qflx_drain(indexc)*dtime - write(iulog,*)'qflx_drain_perched = ',qflx_drain_perched(indexc)*dtime - write(iulog,*)'qflx_flood = ',qflx_floodc(indexc)*dtime - write(iulog,*)'qflx_ice_runoff_snwcp = ',qflx_ice_runoff_snwcp(indexc)*dtime - write(iulog,*)'qflx_ice_runoff_xs = ',qflx_ice_runoff_xs(indexc)*dtime - write(iulog,*)'qflx_glcice_dyn_water_flux = ', qflx_glcice_dyn_water_flux(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_ice = ',qflx_snwcp_discarded_ice(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_liq = ',qflx_snwcp_discarded_liq(indexc)*dtime - write(iulog,*)'qflx_rootsoi_col(1:nlevsoil) = ',qflx_rootsoi_col(indexc,:)*dtime - write(iulog,*)'clm model is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Snow balance check - - do c = bounds%begc,bounds%endc - if (col%active(c)) then - g = col%gridcell(c) - l = col%landunit(c) - - ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at - ! any given time step but only if there is at least one snow layer. h2osno - ! also includes snow that is part of the soil column (an initial snow layer is - ! only created if h2osno > 10mm). - - if (col%snl(c) < 0) then - snow_sources(c) = qflx_prec_grnd(c) + qflx_dew_snow(c) + qflx_dew_grnd(c) - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) + qflx_snow_drain(c) & - + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) & - + qflx_snwcp_discarded_ice(c) + qflx_snwcp_discarded_liq(c) & - + qflx_sl_top_soil(c) - - if (lun%itype(l) == istdlak) then - snow_sources(c) = qflx_snow_grnd_col(c) & - + frac_sno_eff(c) * (qflx_rain_grnd_col(c) & - + qflx_dew_snow(c) + qflx_dew_grnd(c) ) - snow_sinks(c) = frac_sno_eff(c) * (qflx_sub_snow(c) + qflx_evap_grnd(c) ) & - + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) & - + qflx_snwcp_discarded_ice(c) + qflx_snwcp_discarded_liq(c) & - + qflx_snow_drain(c) + qflx_sl_top_soil(c) - endif - - if (col%itype(c) == icol_road_perv .or. lun%itype(l) == istsoil .or. & - lun%itype(l) == istcrop .or. lun%itype(l) == istwet .or. & - lun%itype(l) == istice_mec) then - snow_sources(c) = (qflx_snow_grnd_col(c) - qflx_snow_h2osfc(c) ) & - + frac_sno_eff(c) * (qflx_rain_grnd_col(c) & - + qflx_dew_snow(c) + qflx_dew_grnd(c) ) + qflx_h2osfc_to_ice(c) - snow_sinks(c) = frac_sno_eff(c) * (qflx_sub_snow(c) + qflx_evap_grnd(c)) & - + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) & - + qflx_snwcp_discarded_ice(c) + qflx_snwcp_discarded_liq(c) & - + qflx_snow_drain(c) + qflx_sl_top_soil(c) - endif - - errh2osno(c) = (h2osno(c) - h2osno_old(c)) - (snow_sources(c) - snow_sinks(c)) * dtime - else - snow_sources(c) = 0._r8 - snow_sinks(c) = 0._r8 - errh2osno(c) = 0._r8 - end if - - end if - end do - - found = .false. - do c = bounds%begc,bounds%endc - if (col%active(c)) then - if (abs(errh2osno(c)) > 1.0e-9_r8) then - found = .true. - indexc = c - end if - end if - end do - if ( found ) then - write(iulog,*)'WARNING: snow balance error ' - write(iulog,*)'nstep= ',nstep, & - ' local indexc= ',indexc, & - ! ' global indexc= ',GetGlobalIndex(decomp_index=indexc, clmlevel=namec), & - ' col%itype= ',col%itype(indexc), & - ' lun%itype= ',lun%itype(col%landunit(indexc)), & - ' errh2osno= ',errh2osno(indexc) - - if (abs(errh2osno(indexc)) > 1.e-5_r8 .and. (DAnstep > 2) ) then - write(iulog,*)'clm model is stopping - error is greater than 1e-5 (mm)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errh2osno = ',errh2osno(indexc) - write(iulog,*)'snl = ',col%snl(indexc) - write(iulog,*)'snow_depth = ',snow_depth(indexc) - write(iulog,*)'frac_sno_eff = ',frac_sno_eff(indexc) - write(iulog,*)'h2osno = ',h2osno(indexc) - write(iulog,*)'h2osno_old = ',h2osno_old(indexc) - write(iulog,*)'snow_sources = ',snow_sources(indexc)*dtime - write(iulog,*)'snow_sinks = ',snow_sinks(indexc)*dtime - write(iulog,*)'qflx_prec_grnd = ',qflx_prec_grnd(indexc)*dtime - write(iulog,*)'qflx_snow_grnd_col = ',qflx_snow_grnd_col(indexc)*dtime - write(iulog,*)'qflx_rain_grnd_col = ',qflx_rain_grnd_col(indexc)*dtime - write(iulog,*)'qflx_sub_snow = ',qflx_sub_snow(indexc)*dtime - write(iulog,*)'qflx_snow_drain = ',qflx_snow_drain(indexc)*dtime - write(iulog,*)'qflx_evap_grnd = ',qflx_evap_grnd(indexc)*dtime - write(iulog,*)'qflx_top_soil = ',qflx_top_soil(indexc)*dtime - write(iulog,*)'qflx_dew_snow = ',qflx_dew_snow(indexc)*dtime - write(iulog,*)'qflx_dew_grnd = ',qflx_dew_grnd(indexc)*dtime - write(iulog,*)'qflx_snwcp_ice = ',qflx_snwcp_ice(indexc)*dtime - write(iulog,*)'qflx_snwcp_liq = ',qflx_snwcp_liq(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_ice = ',qflx_snwcp_discarded_ice(indexc)*dtime - write(iulog,*)'qflx_snwcp_discarded_liq = ',qflx_snwcp_discarded_liq(indexc)*dtime - write(iulog,*)'qflx_sl_top_soil = ',qflx_sl_top_soil(indexc)*dtime - write(iulog,*)'clm model is stopping' - - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Energy balance checks - - do p = bounds%begp, bounds%endp - if (patch%active(p)) then - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - - ! Solar radiation energy balance - ! Do not do this check for an urban patch since it will not balance on a per-column - ! level because of interactions between columns and since a separate check is done - ! in the urban radiation module - if (.not. lun%urbpoi(l)) then - errsol(p) = fsa(p) + fsr(p) & - - (forc_solad(g,1) + forc_solad(g,2) + forc_solai(g,1) + forc_solai(g,2)) - else - errsol(p) = spval - end if - - ! Longwave radiation energy balance - ! Do not do this check for an urban patch since it will not balance on a per-column - ! level because of interactions between columns and since a separate check is done - ! in the urban radiation module - if (.not. lun%urbpoi(l)) then - errlon(p) = eflx_lwrad_out(p) - eflx_lwrad_net(p) - forc_lwrad(c) - else - errlon(p) = spval - end if - - ! Surface energy balance - ! Changed to using (eflx_lwrad_net) here instead of (forc_lwrad - eflx_lwrad_out) because - ! there are longwave interactions between urban columns (and therefore patches). - ! For surfaces other than urban, (eflx_lwrad_net) equals (forc_lwrad - eflx_lwrad_out), - ! and a separate check is done above for these terms. - - if (.not. lun%urbpoi(l)) then - errseb(p) = sabv(p) + sabg_chk(p) + forc_lwrad(c) - eflx_lwrad_out(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) - else - errseb(p) = sabv(p) + sabg(p) & - - eflx_lwrad_net(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) & - + eflx_wasteheat_patch(p) + eflx_heat_from_ac_patch(p) + eflx_traffic_patch(p) - end if - !TODO MV - move this calculation to a better place - does not belong in BalanceCheck - netrad(p) = fsa(p) - eflx_lwrad_net(p) - end if - end do - - ! Solar radiation energy balance check - - found = .false. - do p = bounds%begp, bounds%endp - if (patch%active(p)) then - if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 1.e-7_r8) ) then - found = .true. - indexp = p - indexg = patch%gridcell(indexp) - end if - end if - end do - if ( found .and. (DAnstep > 2) ) then - write(iulog,*)'WARNING:: BalanceCheck, solar radiation balance error (W/m2)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errsol = ',errsol(indexp) - if (abs(errsol(indexp)) > 1.e-5_r8 ) then - write(iulog,*)'clm model is stopping - error is greater than 1e-5 (W/m2)' - write(iulog,*)'fsa = ',fsa(indexp) - write(iulog,*)'fsr = ',fsr(indexp) - write(iulog,*)'forc_solad(1) = ',forc_solad(indexg,1) - write(iulog,*)'forc_solad(2) = ',forc_solad(indexg,2) - write(iulog,*)'forc_solai(1) = ',forc_solai(indexg,1) - write(iulog,*)'forc_solai(2) = ',forc_solai(indexg,2) - write(iulog,*)'forc_tot = ',forc_solad(indexg,1)+forc_solad(indexg,2) & - +forc_solai(indexg,1)+forc_solai(indexg,2) - write(iulog,*)'clm model is stopping' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Longwave radiation energy balance check - - found = .false. - do p = bounds%begp, bounds%endp - if (patch%active(p)) then - if ( (errlon(p) /= spval) .and. (abs(errlon(p)) > 1.e-7_r8) ) then - found = .true. - indexp = p - end if - end if - end do - if ( found .and. (DAnstep > 2) ) then - write(iulog,*)'WARNING: BalanceCheck: longwave energy balance error (W/m2)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errlon = ',errlon(indexp) - if (abs(errlon(indexp)) > 1.e-5_r8 ) then - write(iulog,*)'clm model is stopping - error is greater than 1e-5 (W/m2)' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Surface energy balance check - - found = .false. - do p = bounds%begp, bounds%endp - if (patch%active(p)) then - if (abs(errseb(p)) > 1.e-7_r8 ) then - found = .true. - indexp = p - indexc = patch%column(indexp) - indexg = patch%gridcell(indexp) - end if - end if - end do - if ( found .and. (DAnstep > 2) ) then - write(iulog,*)'WARNING: BalanceCheck: surface flux energy balance error (W/m2)' - write(iulog,*)'nstep = ' ,nstep - write(iulog,*)'errseb = ' ,errseb(indexp) - if (abs(errseb(indexp)) > 1.e-5_r8 ) then - write(iulog,*)'clm model is stopping - error is greater than 1e-5 (W/m2)' - write(iulog,*)'sabv = ' ,sabv(indexp) - - write(iulog,*)'sabg = ' ,sabg(indexp), ((1._r8- frac_sno(indexc))*sabg_soil(indexp) + & - frac_sno(indexc)*sabg_snow(indexp)),sabg_chk(indexp) - - write(iulog,*)'forc_tot = ' ,forc_solad(indexg,1) + forc_solad(indexg,2) + & - forc_solai(indexg,1) + forc_solai(indexg,2) - - write(iulog,*)'eflx_lwrad_net = ' ,eflx_lwrad_net(indexp) - write(iulog,*)'eflx_sh_tot = ' ,eflx_sh_tot(indexp) - write(iulog,*)'eflx_lh_tot = ' ,eflx_lh_tot(indexp) - write(iulog,*)'eflx_soil_grnd = ' ,eflx_soil_grnd(indexp) - write(iulog,*)'fsa fsr = ' ,fsa(indexp), fsr(indexp) - write(iulog,*)'fabd fabi = ' ,fabd(indexp,:), fabi(indexp,:) - write(iulog,*)'albd albi = ' ,albd(indexp,:), albi(indexp,:) - write(iulog,*)'ftii ftdd ftid = ' ,ftii(indexp,:), ftdd(indexp,:),ftid(indexp,:) - write(iulog,*)'elai esai = ' ,elai(indexp), esai(indexp) - write(iulog,*)'clm model is stopping' - call endrun(decomp_index=indexp, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Soil energy balance check - - found = .false. - do c = bounds%begc,bounds%endc - if (col%active(c)) then - if (abs(errsoi_col(c)) > 1.0e-5_r8 ) then - found = .true. - indexc = c - end if - end if - end do - if ( found ) then - write(iulog,*)'WARNING: BalanceCheck: soil balance error (W/m2)' - write(iulog,*)'nstep = ',nstep - write(iulog,*)'errsoi_col = ',errsoi_col(indexc) - if (abs(errsoi_col(indexc)) > 1.e-4_r8 .and. (DAnstep > 2) ) then - write(iulog,*)'clm model is stopping' - call endrun(decomp_index=indexc, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - end associate - - end subroutine BalanceCheck - -end module BalanceCheckMod diff --git a/src/biogeophys/BandDiagonalMod.F90 b/src/biogeophys/BandDiagonalMod.F90 deleted file mode 100644 index 5065ea59b5..0000000000 --- a/src/biogeophys/BandDiagonalMod.F90 +++ /dev/null @@ -1,224 +0,0 @@ -module BandDiagonalMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Band Diagonal matrix solution - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : iulog - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: BandDiagonal - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine BandDiagonal(bounds, lbj, ubj, jtop, jbot, numf, filter, nband, b, r, u) - ! - ! !DESCRIPTION: - ! Tridiagonal matrix solution - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: jtop( bounds%begc: ) ! top level for each column [col] - integer , intent(in) :: jbot( bounds%begc: ) ! bottom level for each column [col] - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: nband ! band width - integer , intent(in) :: filter(:) ! filter - real(r8), intent(in) :: b( bounds%begc: , 1: , lbj: ) ! compact band matrix [col, nband, j] - real(r8), intent(in) :: r( bounds%begc: , lbj: ) ! "r" rhs of linear system [col, j] - real(r8), intent(inout) :: u( bounds%begc: , lbj: ) ! solution [col, j] - ! - ! ! LOCAL VARIABLES: - integer :: j,ci,fc,info,m,n !indices - integer :: kl,ku !number of sub/super diagonals - integer, allocatable :: ipiv(:) !temporary - real(r8),allocatable :: ab(:,:),temp(:,:) !compact storage array - real(r8),allocatable :: result(:) - - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jtop) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(jbot) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(b) == (/bounds%endc, nband, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(r) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(u) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - - -!!$ SUBROUTINE SGBSV( N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO ) -!!$* -!!$* -- LAPACK driver routine (version 3.1) -- -!!$* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. -!!$* November 2006 -!!$* -!!$* .. Scalar Arguments .. -!!$ INTEGER INFO, KL, KU, LDAB, LDB, N, NRHS -!!$* .. -!!$* .. Array Arguments .. -!!$ INTEGER IPIV( * ) -!!$ REAL AB( LDAB, * ), B( LDB, * ) -!!$* .. -!!$* -!!$* Purpose -!!$* ======= -!!$* -!!$* SGBSV computes the solution to a real system of linear equations -!!$* A * X = B, where A is a band matrix of order N with KL subdiagonals -!!$* and KU superdiagonals, and X and B are N-by-NRHS matrices. -!!$* -!!$* The LU decomposition with partial pivoting and row interchanges is -!!$* used to factor A as A = L * U, where L is a product of permutation -!!$* and unit lower triangular matrices with KL subdiagonals, and U is -!!$* upper triangular with KL+KU superdiagonals. The factored form of A -!!$* is then used to solve the system of equations A * X = B. -!!$* -!!$* Arguments -!!$* ========= -!!$* -!!$* N (input) INTEGER -!!$* The number of linear equations, i.e., the order of the -!!$* matrix A. N >= 0. -!!$* -!!$* KL (input) INTEGER -!!$* The number of subdiagonals within the band of A. KL >= 0. -!!$* -!!$* KU (input) INTEGER -!!$* The number of superdiagonals within the band of A. KU >= 0. -!!$* -!!$* NRHS (input) INTEGER -!!$* The number of right hand sides, i.e., the number of columns -!!$* of the matrix B. NRHS >= 0. -!!$* -!!$* AB (input/output) REAL array, dimension (LDAB,N) -!!$* On entry, the matrix A in band storage, in rows KL+1 to -!!$* 2*KL+KU+1; rows 1 to KL of the array need not be set. -!!$* The j-th column of A is stored in the j-th column of the -!!$* array AB as follows: -!!$* AB(KL+KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+KL) -!!$* On exit, details of the factorization: U is stored as an -!!$* upper triangular band matrix with KL+KU superdiagonals in -!!$* rows 1 to KL+KU+1, and the multipliers used during the -!!$* factorization are stored in rows KL+KU+2 to 2*KL+KU+1. -!!$* See below for further details. -!!$* -!!$* LDAB (input) INTEGER -!!$* The leading dimension of the array AB. LDAB >= 2*KL+KU+1. -!!$* -!!$* IPIV (output) INTEGER array, dimension (N) -!!$* The pivot indices that define the permutation matrix P; -!!$* row i of the matrix was interchanged with row IPIV(i). -!!$* -!!$* B (input/output) REAL array, dimension (LDB,NRHS) -!!$* On entry, the N-by-NRHS right hand side matrix B. -!!$* On exit, if INFO = 0, the N-by-NRHS solution matrix X. -!!$* -!!$* LDB (input) INTEGER -!!$* The leading dimension of the array B. LDB >= max(1,N). -!!$* -!!$* INFO (output) INTEGER -!!$* = 0: successful exit -!!$* < 0: if INFO = -i, the i-th argument had an illegal value -!!$* > 0: if INFO = i, U(i,i) is exactly zero. The factorization -!!$* has been completed, but the factor U is exactly -!!$* singular, and the solution has not been computed. -!!$* -!!$* Further Details -!!$* =============== -!!$* -!!$* The band storage scheme is illustrated by the following example, when -!!$* M = N = 6, KL = 2, KU = 1: -!!$* -!!$* On entry: On exit: -!!$* -!!$* * * * + + + * * * u14 u25 u36 -!!$* * * + + + + * * u13 u24 u35 u46 -!!$* * a12 a23 a34 a45 a56 * u12 u23 u34 u45 u56 -!!$* a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66 -!!$* a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 * -!!$* a31 a42 a53 a64 * * m31 m42 m53 m64 * * -!!$* -!!$* Array elements marked * are not used by the routine; elements marked -!!$* + need not be set on entry, but are required by the routine to store -!!$* elements of U because of fill-in resulting from the row interchanges. - - -!Set up input matrix AB -!An m-by-n band matrix with kl subdiagonals and ku superdiagonals -!may be stored compactly in a two-dimensional array with -!kl+ku+1 rows and n columns -!AB(KL+KU+1+i-j,j) = A(i,j) - - do fc = 1,numf - ci = filter(fc) - - kl=(nband-1)/2 - ku=kl -! m is the number of rows required for storage space by dgbsv - m=2*kl+ku+1 -! n is the number of levels (snow/soil) -!scs: replace ubj with jbot - n=jbot(ci)-jtop(ci)+1 - - allocate(ab(m,n)) - ab=0.0 - - ab(kl+ku-1,3:n)=b(ci,1,jtop(ci):jbot(ci)-2) ! 2nd superdiagonal - ab(kl+ku+0,2:n)=b(ci,2,jtop(ci):jbot(ci)-1) ! 1st superdiagonal - ab(kl+ku+1,1:n)=b(ci,3,jtop(ci):jbot(ci)) ! diagonal - ab(kl+ku+2,1:n-1)=b(ci,4,jtop(ci)+1:jbot(ci)) ! 1st subdiagonal - ab(kl+ku+3,1:n-2)=b(ci,5,jtop(ci)+2:jbot(ci)) ! 2nd subdiagonal - - allocate(temp(m,n)) - temp=ab - - allocate(ipiv(n)) - allocate(result(n)) - -! on input result is rhs, on output result is solution vector - result(:)=r(ci,jtop(ci):jbot(ci)) - -! DGBSV( N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO ) - call dgbsv( n, kl, ku, 1, ab, m, ipiv, result, n, info ) - u(ci,jtop(ci):jbot(ci))=result(:) - - if(info /= 0) then - write(iulog,*)'index: ', ci - write(iulog,*)'n,kl,ku,m ',n,kl,ku,m - write(iulog,*)'dgbsv info: ',ci,info - - write(iulog,*) '' - write(iulog,*) 'ab matrix' - do j=1,n - ! write(iulog,'(i2,7f18.7)') j,temp(:,j) - write(iulog,'(i2,5f18.7)') j,temp(3:7,j) - enddo - write(iulog,*) '' - call endrun( 'BandDiagonal ERROR: dgbsv returned error code' ) - endif - deallocate(temp) - - deallocate(ab) - deallocate(ipiv) - deallocate(result) - end do - - end subroutine BandDiagonal - -end module BandDiagonalMod diff --git a/src/biogeophys/BareGroundFluxesMod.F90 b/src/biogeophys/BareGroundFluxesMod.F90 deleted file mode 100644 index cfbc99b740..0000000000 --- a/src/biogeophys/BareGroundFluxesMod.F90 +++ /dev/null @@ -1,431 +0,0 @@ -module BareGroundFluxesMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Compute sensible and latent fluxes and their derivatives with respect - ! to ground temperature using ground temperatures from previous time step. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use ch4Mod , only : ch4_type - use atm2lndType , only : atm2lnd_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use PhotosynthesisMod , only : photosyns_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use HumanIndexMod , only : humanindex_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: BareGroundFluxes ! Calculate sensible and latent heat fluxes - !------------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------------ - subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, & - atm2lnd_inst, soilstate_inst, & - frictionvel_inst, ch4_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, photosyns_inst, humanindex_inst) - ! - ! !DESCRIPTION: - ! Compute sensible and latent fluxes and their derivatives with respect - ! to ground temperature using ground temperatures from previous time step. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_RGAS - use clm_varpar , only : nlevgrnd - use clm_varcon , only : cpair, vkc, grav, denice, denh2o - use clm_varctl , only : use_lch4 - use landunit_varcon , only : istsoil, istcrop - use FrictionVelocityMod , only : FrictionVelocity, MoninObukIni - use QSatMod , only : QSat - use SurfaceResistanceMod , only : do_soilevap_beta,do_soil_resistance_sl14 - use HumanIndexMod , only : calc_human_stress_indices, Wet_Bulb, Wet_BulbS, HeatIndex, AppTemp, & - swbgt, hmdex, dis_coi, dis_coiS, THIndex, & - SwampCoolEff, KtoC, VaporPres - use FrictionVelocityMod , only : frictionvel_parms_inst - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp - integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 - ! (but does NOT include lake or urban) - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - type(ch4_type) , intent(inout) :: ch4_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(humanindex_type) , intent(inout) :: humanindex_inst - ! - ! !LOCAL VARIABLES: - integer, parameter :: niters = 3 ! maximum number of iterations for surface temperature - integer :: p,c,g,f,j,l ! indices - integer :: iter ! iteration index - real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m] - real(r8) :: displa(bounds%begp:bounds%endp) ! displacement height [m] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: dth(bounds%begp:bounds%endp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dqh(bounds%begp:bounds%endp) ! diff of humidity between ref. height and surface - real(r8) :: obu(bounds%begp:bounds%endp) ! Monin-Obukhov length (m) - real(r8) :: ur(bounds%begp:bounds%endp) ! wind speed at reference height [m/s] - real(r8) :: um(bounds%begp:bounds%endp) ! wind speed including the stablity effect [m/s] - real(r8) :: temp1(bounds%begp:bounds%endp) ! relation for potential temperature profile - real(r8) :: temp12m(bounds%begp:bounds%endp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(bounds%begp:bounds%endp) ! relation for specific humidity profile - real(r8) :: temp22m(bounds%begp:bounds%endp) ! relation for specific humidity profile applied at 2-m - real(r8) :: ustar(bounds%begp:bounds%endp) ! friction velocity [m/s] - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: cf_bare ! heat transfer coefficient from bare ground [-] - real(r8) :: ram ! aerodynamical resistance [s/m] - real(r8) :: rah ! thermal resistance [s/m] - real(r8) :: raw ! moisture resistance [s/m] - real(r8) :: raih ! temporary variable [kg/m2/s] - real(r8) :: raiw ! temporary variable [kg/m2/s] - real(r8) :: fm(bounds%begp:bounds%endp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: z0mg_patch(bounds%begp:bounds%endp) - real(r8) :: z0hg_patch(bounds%begp:bounds%endp) - real(r8) :: z0qg_patch(bounds%begp:bounds%endp) - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - real(r8) :: www ! surface soil wetness [-] - !------------------------------------------------------------------------------ - - associate( & - soilresis => soilstate_inst%soilresis_col , & ! Input: [real(r8) (:,:) ] evaporative soil resistance (s/m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - zii => col%zii , & ! Input: [real(r8) (:) ] convective boundary height [m] - - tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (C) - vap_ref2m => humanindex_inst%vap_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height vapor pressure (Pa) - appar_temp_ref2m => humanindex_inst%appar_temp_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m apparent temperature (C) - appar_temp_ref2m_r => humanindex_inst%appar_temp_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m apparent temperature (C) - swbgt_ref2m => humanindex_inst%swbgt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Simplified Wetbulb Globe temperature (C) - swbgt_ref2m_r => humanindex_inst%swbgt_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Simplified Wetbulb Globe temperature (C) - humidex_ref2m => humanindex_inst%humidex_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Humidex (C) - humidex_ref2m_r => humanindex_inst%humidex_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Humidex (C) - wbt_ref2m => humanindex_inst%wbt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Stull Wet Bulb temperature (C) - wbt_ref2m_r => humanindex_inst%wbt_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Stull Wet Bulb temperature (C) - wb_ref2m => humanindex_inst%wb_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Wet Bulb temperature (C) - wb_ref2m_r => humanindex_inst%wb_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Wet Bulb temperature (C) - teq_ref2m => humanindex_inst%teq_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent temperature (K) - teq_ref2m_r => humanindex_inst%teq_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Equivalent temperature (K) - ept_ref2m => humanindex_inst%ept_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent Potential temperature (K) - ept_ref2m_r => humanindex_inst%ept_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height Equivalent Potential temperature (K) - discomf_index_ref2m => humanindex_inst%discomf_index_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Discomfort Index temperature (C) - discomf_index_ref2m_r => humanindex_inst%discomf_index_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Discomfort Index temperature (C) - discomf_index_ref2mS => humanindex_inst%discomf_index_ref2mS_patch , & ! Output: [real(r8) (:) ] 2 m height Discomfort Index Stull temperature (C) - discomf_index_ref2mS_r => humanindex_inst%discomf_index_ref2mS_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Discomfort Index Stull temperature (K) - nws_hi_ref2m => humanindex_inst%nws_hi_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m NWS Heat Index (C) - nws_hi_ref2m_r => humanindex_inst%nws_hi_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m NWS Heat Index (C) - thip_ref2m => humanindex_inst%thip_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Physiology (C) - thip_ref2m_r => humanindex_inst%thip_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Temperature Humidity Index Physiology (C) - thic_ref2m => humanindex_inst%thic_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Comfort (C) - thic_ref2m_r => humanindex_inst%thic_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Temperature Humidity Index Comfort (C) - swmp65_ref2m => humanindex_inst%swmp65_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 65% effi (C) - swmp65_ref2m_r => humanindex_inst%swmp65_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 65% effi (C) - swmp80_ref2m => humanindex_inst%swmp80_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 80% effi (C) - swmp80_ref2m_r => humanindex_inst%swmp80_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 80% effi (C) - - forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) - forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) - forc_th => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric potential temperature (Kelvin) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg) - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - soilbeta => soilstate_inst%soilbeta_col , & ! Input: [real(r8) (:) ] soil wetness relative to field capacity - rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground surface temperature [K] - thv => temperature_inst%thv_col , & ! Input: [real(r8) (:) ] virtual potential temperature (kelvin) - thm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] intermediate variable (forc_t+0.0098*forc_hgt_t_patch) - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - beta => temperature_inst%beta_col , & ! Input: [real(r8) (:) ] coefficient of conective velocity [-] - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - qg_snow => waterstate_inst%qg_snow_col , & ! Input: [real(r8) (:) ] specific humidity at snow surface [kg/kg] - qg_soil => waterstate_inst%qg_soil_col , & ! Input: [real(r8) (:) ] specific humidity at soil surface [kg/kg] - qg_h2osfc => waterstate_inst%qg_h2osfc_col , & ! Input: [real(r8) (:) ] specific humidity at h2osfc surface [kg/kg] - qg => waterstate_inst%qg_col , & ! Input: [real(r8) (:) ] specific humidity at ground surface [kg/kg] - dqgdT => waterstate_inst%dqgdT_col , & ! Input: [real(r8) (:) ] temperature derivative of "qg" - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - - eflx_sh_snow => energyflux_inst%eflx_sh_snow_patch , & ! Output: [real(r8) (:) ] sensible heat flux from snow (W/m**2) [+ to atm] - eflx_sh_soil => energyflux_inst%eflx_sh_soil_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_h2osfc => energyflux_inst%eflx_sh_h2osfc_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) - tauy => energyflux_inst%tauy_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: n-s (kg/m/s**2) - dlrad => energyflux_inst%dlrad_patch , & ! Output: [real(r8) (:) ] downward longwave radiation below the canopy [W/m2] - ulrad => energyflux_inst%ulrad_patch , & ! Output: [real(r8) (:) ] upward longwave radiation above the canopy [W/m2] - cgrnds => energyflux_inst%cgrnds_patch , & ! Output: [real(r8) (:) ] deriv, of soil sensible heat flux wrt soil temp [w/m2/k] - cgrndl => energyflux_inst%cgrndl_patch , & ! Output: [real(r8) (:) ] deriv of soil latent heat flux wrt soil temp [w/m**2/k] - cgrnd => energyflux_inst%cgrnd_patch , & ! Output: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp [w/m2/k] - btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) - - t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) - t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) - t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) - - q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) - rh_ref2m_r => waterstate_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%) - rh_ref2m => waterstate_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) - - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: - u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:) ] 10 m height winds (m/s) - zetamax => frictionvel_parms_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions - z0mg_col => frictionvel_inst%z0mg_col , & ! Output: [real(r8) (:) ] roughness length, momentum [m] - z0hg_col => frictionvel_inst%z0hg_col , & ! Output: [real(r8) (:) ] roughness length, sensible heat [m] - z0qg_col => frictionvel_inst%z0qg_col , & ! Output: [real(r8) (:) ] roughness length, latent heat [m] - ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) [J/kg] - qflx_ev_snow => waterflux_inst%qflx_ev_snow_patch , & ! Output: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm] - qflx_ev_soil => waterflux_inst%qflx_ev_soil_patch , & ! Output: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_patch , & ! Output: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - - rssun => photosyns_inst%rssun_patch , & ! Output: [real(r8) (:) ] leaf sunlit stomatal resistance (s/m) (output from Photosynthesis) - rssha => photosyns_inst%rssha_patch , & ! Output: [real(r8) (:) ] leaf shaded stomatal resistance (s/m) (output from Photosynthesis) - - begp => bounds%begp , & - endp => bounds%endp & - ) - - ! First do some simple settings of values over points where frac vegetation covered - ! by snow is zero - - do f = 1, num_noexposedvegp - p = filter_noexposedvegp(f) - c = patch%column(p) - btran(p) = 0._r8 - t_veg(p) = forc_t(c) - cf_bare = forc_pbot(c)/(SHR_CONST_RGAS*0.001_r8*thm(p))*1.e06_r8 - rssun(p) = 1._r8/1.e15_r8 * cf_bare - rssha(p) = 1._r8/1.e15_r8 * cf_bare - do j = 1, nlevgrnd - rootr(p,j) = 0._r8 - rresis(p,j) = 0._r8 - end do - end do - - ! Compute sensible and latent fluxes and their derivatives with respect - ! to ground temperature using ground temperatures from previous time step - - do f = 1, num_noexposedvegp - p = filter_noexposedvegp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Initialization variables - - displa(p) = 0._r8 - dlrad(p) = 0._r8 - ulrad(p) = 0._r8 - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-t_grnd(c) - dqh(p) = forc_q(c) - qg(c) - dthv = dth(p)*(1._r8+0.61_r8*forc_q(c))+0.61_r8*forc_th(c)*dqh(p) - zldis(p) = forc_hgt_u_patch(p) - - ! Copy column roughness to local patch-level arrays - - z0mg_patch(p) = z0mg_col(c) - z0hg_patch(p) = z0hg_col(c) - z0qg_patch(p) = z0qg_col(c) - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv, zldis(p), z0mg_patch(p), um(p), obu(p)) - - end do - - ! Perform stability iteration - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - do iter = 1, niters - - call FrictionVelocity(begp, endp, num_noexposedvegp, filter_noexposedvegp, & - displa(begp:endp), z0mg_patch(begp:endp), z0hg_patch(begp:endp), z0qg_patch(begp:endp), & - obu(begp:endp), iter, ur(begp:endp), um(begp:endp), ustar(begp:endp), & - temp1(begp:endp), temp2(begp:endp), temp12m(begp:endp), temp22m(begp:endp), fm(begp:endp), & - frictionvel_inst) - - do f = 1, num_noexposedvegp - p = filter_noexposedvegp(f) - c = patch%column(p) - g = patch%gridcell(p) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - z0hg_patch(p) = z0mg_patch(p)/exp(0.13_r8 * (ustar(p)*z0mg_patch(p)/1.5e-5_r8)**0.45_r8) - z0qg_patch(p) = z0hg_patch(p) - thvstar = tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar - zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(zetamax,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta(c)*(-grav*ustar(p)*thvstar*zii(c)/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p) + wc*wc) - end if - obu(p) = zldis(p)/zeta - end do - - end do ! end stability iteration - - do f = 1, num_noexposedvegp - p = filter_noexposedvegp(f) - c = patch%column(p) - g = patch%gridcell(p) - l = patch%landunit(p) - - ! Determine aerodynamic resistances - - ram = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah = 1._r8/(temp1(p)*ustar(p)) - raw = 1._r8/(temp2(p)*ustar(p)) - raih = forc_rho(c)*cpair/rah - if (use_lch4) then - grnd_ch4_cond(p) = 1._r8/raw - end if - - ! Soil evaporation resistance - www = (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice)/dz(c,1)/watsat(c,1) - www = min(max(www,0.0_r8),1._r8) - - !changed by K.Sakaguchi. Soilbeta is used for evaporation - if (dqh(p) > 0._r8) then !dew (beta is not applied, just like rsoil used to be) - raiw = forc_rho(c)/(raw) - else - if(do_soilevap_beta())then - ! Lee and Pielke 1992 beta is applied - raiw = soilbeta(c)*forc_rho(c)/(raw) - endif - if(do_soil_resistance_sl14())then - ! Swenson & Lawrence 2014 soil resistance is applied - raiw = forc_rho(c)/(raw+soilresis(c)) - endif - end if - - ram1(p) = ram !pass value to global variable - - ! Output to patch-level data structures - ! Derivative of fluxes with respect to ground temperature - cgrnds(p) = raih - cgrndl(p) = raiw*dqgdT(c) - cgrnd(p) = cgrnds(p) + htvp(c)*cgrndl(p) - - - ! Variables needed by history tape - - ! Surface fluxes of momentum, sensible and latent heat - ! using ground temperatures from previous time step - taux(p) = -forc_rho(c)*forc_u(g)/ram - tauy(p) = -forc_rho(c)*forc_v(g)/ram - eflx_sh_grnd(p) = -raih*dth(p) - eflx_sh_tot(p) = eflx_sh_grnd(p) - - ! compute sensible heat fluxes individually - eflx_sh_snow(p) = -raih*(thm(p)-t_soisno(c,snl(c)+1)) - eflx_sh_soil(p) = -raih*(thm(p)-t_soisno(c,1)) - eflx_sh_h2osfc(p) = -raih*(thm(p)-t_h2osfc(c)) - - ! water fluxes from soil - qflx_evap_soi(p) = -raiw*dqh(p) - qflx_evap_tot(p) = qflx_evap_soi(p) - - ! compute latent heat fluxes individually - qflx_ev_snow(p) = -raiw*(forc_q(c) - qg_snow(c)) - qflx_ev_soil(p) = -raiw*(forc_q(c) - qg_soil(c)) - qflx_ev_h2osfc(p) = -raiw*(forc_q(c) - qg_h2osfc(c)) - - ! 2 m height air temperature - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - - ! 2 m height specific humidity - q_ref2m(p) = forc_q(c) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - rh_ref2m_r(p) = rh_ref2m(p) - t_ref2m_r(p) = t_ref2m(p) - end if - - ! Human Heat Stress - if ( calc_human_stress_indices )then - call KtoC(t_ref2m(p), tc_ref2m(p)) - call VaporPres(rh_ref2m(p), e_ref2m, vap_ref2m(p)) - call Wet_Bulb(t_ref2m(p), vap_ref2m(p), forc_pbot(c), rh_ref2m(p), q_ref2m(p), & - teq_ref2m(p), ept_ref2m(p), wb_ref2m(p)) - call Wet_BulbS(tc_ref2m(p),rh_ref2m(p), wbt_ref2m(p)) - call HeatIndex(tc_ref2m(p), rh_ref2m(p), nws_hi_ref2m(p)) - call AppTemp(tc_ref2m(p), vap_ref2m(p), u10_clm(p), appar_temp_ref2m(p)) - call swbgt(tc_ref2m(p), vap_ref2m(p), swbgt_ref2m(p)) - call hmdex(tc_ref2m(p), vap_ref2m(p), humidex_ref2m(p)) - call dis_coi(tc_ref2m(p), wb_ref2m(p), discomf_index_ref2m(p)) - call dis_coiS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p), discomf_index_ref2mS(p)) - call THIndex(tc_ref2m(p), wb_ref2m(p), thic_ref2m(p), thip_ref2m(p)) - call SwampCoolEff(tc_ref2m(p), wb_ref2m(p), swmp80_ref2m(p), swmp65_ref2m(p)) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - teq_ref2m_r(p) = teq_ref2m(p) - ept_ref2m_r(p) = ept_ref2m(p) - wb_ref2m_r(p) = wb_ref2m(p) - wbt_ref2m_r(p) = wbt_ref2m(p) - nws_hi_ref2m_r(p) = nws_hi_ref2m(p) - appar_temp_ref2m_r(p) = appar_temp_ref2m(p) - swbgt_ref2m_r(p) = swbgt_ref2m(p) - humidex_ref2m_r(p) = humidex_ref2m(p) - discomf_index_ref2m_r(p) = discomf_index_ref2m(p) - discomf_index_ref2mS_r(p) = discomf_index_ref2mS(p) - thic_ref2m_r(p) = thic_ref2m(p) - thip_ref2m_r(p) = thip_ref2m(p) - swmp80_ref2m_r(p) = swmp80_ref2m(p) - swmp65_ref2m_r(p) = swmp65_ref2m(p) - end if - end if - end do - - end associate - - end subroutine BareGroundFluxes - -end module BareGroundFluxesMod diff --git a/src/biogeophys/CMakeLists.txt b/src/biogeophys/CMakeLists.txt deleted file mode 100644 index 55ad7e1c65..0000000000 --- a/src/biogeophys/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources - AerosolMod.F90 - DaylengthMod.F90 - GlacierSurfaceMassBalanceMod.F90 - HumanIndexMod.F90 - IrrigationMod.F90 - LakeCon.F90 - QSatMod.F90 - RootBiophysMod.F90 - SnowHydrologyMod.F90 - SnowSnicarMod.F90 - SoilHydrologyType.F90 - SoilStateType.F90 - SoilWaterRetentionCurveMod.F90 - TemperatureType.F90 - TotalWaterAndHeatMod.F90 - UrbanParamsType.F90 - WaterfluxType.F90 - WaterStateType.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 deleted file mode 100644 index 9b662bb372..0000000000 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ /dev/null @@ -1,1372 +0,0 @@ -module CanopyFluxesMod - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Performs calculation of leaf temperature and surface fluxes. - ! SoilFluxes then determines soil/snow and ground temperatures and updates the surface - ! fluxes for the new ground temperature. - ! - ! !USES: - use shr_sys_mod , only : shr_sys_flush - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog, use_cn, use_lch4, use_c13, use_c14, use_cndv, use_fates, & - use_luna, use_hydrstress - use clm_varpar , only : nlevgrnd, nlevsno - use clm_varcon , only : namep - use pftconMod , only : pftcon - use decompMod , only : bounds_type - use PhotosynthesisMod , only : Photosynthesis, PhotoSynthesisHydraulicStress, PhotosynthesisTotal, Fractionation - use EDAccumulateFluxesMod , only : AccumulateFluxes_ED - use EDBtranMod , only : btran_ed - use SoilMoistStressMod , only : calc_effective_soilporosity, calc_volumetric_h2oliq - use SoilMoistStressMod , only : calc_root_moist_stress, set_perchroot_opt - use SimpleMathMod , only : array_div_vector - use SurfaceResistanceMod , only : do_soilevap_beta,do_soil_resistance_sl14 - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use FrictionvelocityMod , only : frictionvel_type - use OzoneBaseMod , only : ozone_base_type - use SoilStateType , only : soilstate_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use CanopyHydrologyMod , only : IsSnowvegFlagOn, IsSnowvegFlagOnRad - use HumanIndexMod , only : humanindex_type - use ch4Mod , only : ch4_type - use PhotosynthesisMod , only : photosyns_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - use EDTypesMod , only : ed_site_type - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use LunaMod , only : Update_Photosynthesis_Capacity, Acc24_Climate_LUNA,Acc240_Climate_LUNA,Clear24_Climate_LUNA - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CanopyFluxesReadNML ! Read in namelist settings - public :: CanopyFluxes ! Calculate canopy fluxes - ! - ! !PUBLIC DATA MEMBERS: - ! true => btran is based only on unfrozen soil levels - logical, public :: perchroot = .false. - - ! true => btran is based on active layer (defined over two years); - ! false => btran is based on currently unfrozen levels - logical, public :: perchroot_alt = .false. - ! - ! !PRIVATE DATA MEMBERS: - ! Snow in vegetation canopy namelist options. - logical, private :: snowveg_on = .false. ! snowveg_flag = 'ON' - logical, private :: snowveg_onrad = .true. ! snowveg_flag = 'ON_RAD' - logical, private :: use_undercanopy_stability = .true. ! use undercanopy stability term or not - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine CanopyFluxesReadNML(NLFilename) - ! - ! !DESCRIPTION: - ! Read the namelist for Canopy Fluxes - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'CanopyFluxeseadNML' - character(len=*), parameter :: nmlname = 'canopyfluxes_inparm' - !----------------------------------------------------------------------- - - namelist /canopyfluxes_inparm/ use_undercanopy_stability - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=canopyfluxes_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (use_undercanopy_stability, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=canopyfluxes_inparm) - write(iulog,*) ' ' - end if - - end subroutine CanopyFluxesReadNML - - !------------------------------------------------------------------------------ - subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, & - clm_fates, nc, atm2lnd_inst, canopystate_inst, & - energyflux_inst, frictionvel_inst, soilstate_inst, solarabs_inst, surfalb_inst, & - temperature_inst, waterflux_inst, waterstate_inst, ch4_inst, ozone_inst, photosyns_inst, & - humanindex_inst, soil_water_retention_curve, & - downreg_patch, leafn_patch, froot_carbon, croot_carbon) - ! - ! !DESCRIPTION: - ! 1. Calculates the leaf temperature: - ! 2. Calculates the leaf fluxes, transpiration, photosynthesis and - ! updates the dew accumulation due to evaporation. - ! - ! Method: - ! Use the Newton-Raphson iteration to solve for the foliage - ! temperature that balances the surface energy budget: - ! - ! f(t_veg) = Net radiation - Sensible - Latent = 0 - ! f(t_veg) + d(f)/d(t_veg) * dt_veg = 0 (*) - ! - ! Note: - ! (1) In solving for t_veg, t_grnd is given from the previous timestep. - ! (2) The partial derivatives of aerodynamical resistances, which cannot - ! be determined analytically, are ignored for d(H)/dT and d(LE)/dT - ! (3) The weighted stomatal resistance of sunlit and shaded foliage is used - ! (4) Canopy air temperature and humidity are derived from => Hc + Hg = Ha - ! => Ec + Eg = Ea - ! (5) Energy loss is due to: numerical truncation of energy budget equation - ! (*); and "ecidif" (see the code) which is dropped into the sensible - ! heat - ! (6) The convergence criteria: the difference, del = t_veg(n+1)-t_veg(n) - ! and del2 = t_veg(n)-t_veg(n-1) less than 0.01 K, and the difference - ! of water flux from the leaf between the iteration step (n+1) and (n) - ! less than 0.1 W/m2; or the iterative steps over 40. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_RGAS - use clm_time_manager , only : get_step_size, get_prev_date,is_end_curr_day - use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice - use clm_varcon , only : denh2o, tfrz, csoilc, tlsai_crit, alpha_aero - use clm_varcon , only : c14ratio - use perf_mod , only : t_startf, t_stopf - use QSatMod , only : QSat - use CLMFatesInterfaceMod, only : hlm_fates_interface_type - use FrictionVelocityMod, only : FrictionVelocity, MoninObukIni, frictionvel_parms_inst - use HumanIndexMod , only : calc_human_stress_indices, Wet_Bulb, Wet_BulbS, HeatIndex, AppTemp, & - swbgt, hmdex, dis_coi, dis_coiS, THIndex, & - SwampCoolEff, KtoC, VaporPres - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg - type(hlm_fates_interface_type) , intent(inout) :: clm_fates - integer , intent(in) :: nc ! clump index - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - class(ozone_base_type) , intent(inout) :: ozone_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(humanindex_type) , intent(inout) :: humanindex_inst - class(soil_water_retention_curve_type) , intent(in) :: soil_water_retention_curve - real(r8), intent(in) :: downreg_patch(bounds%begp:) ! fractional reduction in GPP due to N limitation (dimensionless) - real(r8), intent(in) :: leafn_patch(bounds%begp:) ! leaf N (gN/m2) - real(r8), intent(inout) :: froot_carbon(bounds%begp:) ! fine root biomass (gC/m2) - real(r8), intent(inout) :: croot_carbon(bounds%begp:) ! live coarse root biomass (gC/m2) - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: bsun(:) ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8), pointer :: bsha(:) ! shaded canopy transpiration wetness factor (0 to 1) - real(r8), parameter :: btran0 = 0.0_r8 ! initial value - real(r8), parameter :: zii = 1000.0_r8 ! convective boundary layer height [m] - real(r8), parameter :: beta = 1.0_r8 ! coefficient of conective velocity [-] - real(r8), parameter :: delmax = 1.0_r8 ! maxchange in leaf temperature [K] - real(r8), parameter :: dlemin = 0.1_r8 ! max limit for energy flux convergence [w/m2] - real(r8), parameter :: dtmin = 0.01_r8 ! max limit for temperature convergence [K] - integer , parameter :: itmax = 40 ! maximum number of iteration [-] - integer , parameter :: itmin = 2 ! minimum number of iteration [-] - - !added by K.Sakaguchi for litter resistance - real(r8), parameter :: lai_dl = 0.5_r8 ! placeholder for (dry) plant litter area index (m2/m2) - real(r8), parameter :: z_dl = 0.05_r8 ! placeholder for (dry) litter layer thickness (m) - - !added by K.Sakaguchi for stability formulation - real(r8), parameter :: ria = 0.5_r8 ! free parameter for stable formulation (currently = 0.5, "gamma" in Sakaguchi&Zeng,2008) - - real(r8) :: dtime ! land model time step (sec) - real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: dth(bounds%begp:bounds%endp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv(bounds%begp:bounds%endp) ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dqh(bounds%begp:bounds%endp) ! diff of humidity between ref. height and surface - real(r8) :: obu(bounds%begp:bounds%endp) ! Monin-Obukhov length (m) - real(r8) :: um(bounds%begp:bounds%endp) ! wind speed including the stablity effect [m/s] - real(r8) :: ur(bounds%begp:bounds%endp) ! wind speed at reference height [m/s] - real(r8) :: uaf(bounds%begp:bounds%endp) ! velocity of air within foliage [m/s] - real(r8) :: temp1(bounds%begp:bounds%endp) ! relation for potential temperature profile - real(r8) :: temp12m(bounds%begp:bounds%endp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(bounds%begp:bounds%endp) ! relation for specific humidity profile - real(r8) :: temp22m(bounds%begp:bounds%endp) ! relation for specific humidity profile applied at 2-m - real(r8) :: ustar(bounds%begp:bounds%endp) ! friction velocity [m/s] - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: taf(bounds%begp:bounds%endp) ! air temperature within canopy space [K] - real(r8) :: qaf(bounds%begp:bounds%endp) ! humidity of canopy air [kg/kg] - real(r8) :: rpp ! fraction of potential evaporation from leaf [-] - real(r8) :: rppdry ! fraction of potential evaporation through transp [-] - real(r8) :: cf ! heat transfer coefficient from leaves [-] - real(r8) :: rb(bounds%begp:bounds%endp) ! leaf boundary layer resistance [s/m] - real(r8) :: rah(bounds%begp:bounds%endp,2) ! thermal resistance [s/m] - real(r8) :: raw(bounds%begp:bounds%endp,2) ! moisture resistance [s/m] - real(r8) :: wta ! heat conductance for air [m/s] - real(r8) :: wtg(bounds%begp:bounds%endp) ! heat conductance for ground [m/s] - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: wta0(bounds%begp:bounds%endp) ! normalized heat conductance for air [-] - real(r8) :: wtl0(bounds%begp:bounds%endp) ! normalized heat conductance for leaf [-] - real(r8) :: wtg0 ! normalized heat conductance for ground [-] - real(r8) :: wtal(bounds%begp:bounds%endp) ! normalized heat conductance for air and leaf [-] - real(r8) :: wtga ! normalized heat cond. for air and ground [-] - real(r8) :: wtaq ! latent heat conductance for air [m/s] - real(r8) :: wtlq ! latent heat conductance for leaf [m/s] - real(r8) :: wtgq(bounds%begp:bounds%endp) ! latent heat conductance for ground [m/s] - real(r8) :: wtaq0(bounds%begp:bounds%endp) ! normalized latent heat conductance for air [-] - real(r8) :: wtlq0(bounds%begp:bounds%endp) ! normalized latent heat conductance for leaf [-] - real(r8) :: wtgq0 ! normalized heat conductance for ground [-] - real(r8) :: wtalq(bounds%begp:bounds%endp) ! normalized latent heat cond. for air and leaf [-] - real(r8) :: wtgaq ! normalized latent heat cond. for air and ground [-] - real(r8) :: el(bounds%begp:bounds%endp) ! vapor pressure on leaf surface [pa] - real(r8) :: deldT ! derivative of "el" on "t_veg" [pa/K] - real(r8) :: qsatl(bounds%begp:bounds%endp) ! leaf specific humidity [kg/kg] - real(r8) :: qsatldT(bounds%begp:bounds%endp) ! derivative of "qsatl" on "t_veg" - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - real(r8) :: air(bounds%begp:bounds%endp) ! atmos. radiation temporay set - real(r8) :: bir(bounds%begp:bounds%endp) ! atmos. radiation temporay set - real(r8) :: cir(bounds%begp:bounds%endp) ! atmos. radiation temporay set - real(r8) :: dc1,dc2 ! derivative of energy flux [W/m2/K] - real(r8) :: delt ! temporary - real(r8) :: delq(bounds%begp:bounds%endp) ! temporary - real(r8) :: del(bounds%begp:bounds%endp) ! absolute change in leaf temp in current iteration [K] - real(r8) :: del2(bounds%begp:bounds%endp) ! change in leaf temperature in previous iteration [K] - real(r8) :: dele(bounds%begp:bounds%endp) ! change in latent heat flux from leaf [K] - real(r8) :: dels ! change in leaf temperature in current iteration [K] - real(r8) :: det(bounds%begp:bounds%endp) ! maximum leaf temp. change in two consecutive iter [K] - real(r8) :: efeb(bounds%begp:bounds%endp) ! latent heat flux from leaf (previous iter) [mm/s] - real(r8) :: efeold ! latent heat flux from leaf (previous iter) [mm/s] - real(r8) :: efpot ! potential latent energy flux [kg/m2/s] - real(r8) :: efe(bounds%begp:bounds%endp) ! water flux from leaf [mm/s] - real(r8) :: efsh ! sensible heat from leaf [mm/s] - real(r8) :: obuold(bounds%begp:bounds%endp) ! monin-obukhov length from previous iteration - real(r8) :: tlbef(bounds%begp:bounds%endp) ! leaf temperature from previous iteration [K] - real(r8) :: ecidif ! excess energies [W/m2] - real(r8) :: err(bounds%begp:bounds%endp) ! balance error - real(r8) :: erre ! balance error - real(r8) :: co2(bounds%begp:bounds%endp) ! atmospheric co2 partial pressure (pa) - real(r8) :: c13o2(bounds%begp:bounds%endp) ! atmospheric c13o2 partial pressure (pa) - real(r8) :: o2(bounds%begp:bounds%endp) ! atmospheric o2 partial pressure (pa) - real(r8) :: svpts(bounds%begp:bounds%endp) ! saturation vapor pressure at t_veg (pa) - real(r8) :: eah(bounds%begp:bounds%endp) ! canopy air vapor pressure (pa) - real(r8) :: s_node ! vol_liq/eff_porosity - real(r8) :: smp_node ! matrix potential - real(r8) :: smp_node_lf ! F. Li and S. Levis - real(r8) :: vol_liq ! partial volume of liquid water in layer - integer :: itlef ! counter for leaf temperature iteration [-] - integer :: nmozsgn(bounds%begp:bounds%endp) ! number of times stability changes sign - real(r8) :: w ! exp(-LSAI) - real(r8) :: csoilcn ! interpolated csoilc for less than dense canopies - real(r8) :: fm(bounds%begp:bounds%endp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: wtshi ! sensible heat resistance for air, grnd and leaf [-] - real(r8) :: wtsqi ! latent heat resistance for air, grnd and leaf [-] - integer :: j ! soil/snow level index - integer :: p ! patch index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! gridcell index - integer :: fn ! number of values in vegetated patch filter - integer :: filterp(bounds%endp-bounds%begp+1) ! vegetated patch filter - integer :: fnorig ! number of values in patch filter copy - integer :: fporig(bounds%endp-bounds%begp+1) ! temporary filter - integer :: fnold ! temporary copy of patch count - integer :: f ! filter index - logical :: found ! error flag for canopy above forcing hgt - integer :: index ! patch index for error - real(r8) :: egvf ! effective green vegetation fraction - real(r8) :: lt ! elai+esai - real(r8) :: ri ! stability parameter for under canopy air (unitless) - real(r8) :: csoilb ! turbulent transfer coefficient over bare soil (unitless) - real(r8) :: ricsoilc ! modified transfer coefficient under dense canopy (unitless) - real(r8) :: snow_depth_c ! critical snow depth to cover plant litter (m) - real(r8) :: rdl ! dry litter layer resistance for water vapor (s/m) - real(r8) :: elai_dl ! exposed (dry) plant litter area index - real(r8) :: fsno_dl ! effective snow cover over plant litter - real(r8) :: dayl_factor(bounds%begp:bounds%endp) ! scalar (0-1) for daylength effect on Vcmax - ! If no unfrozen layers, put all in the top layer. - real(r8) :: rootsum(bounds%begp:bounds%endp) - real(r8) :: delt_snow - real(r8) :: delt_soil - real(r8) :: delt_h2osfc - real(r8) :: lw_grnd - real(r8) :: delq_snow - real(r8) :: delq_soil - real(r8) :: delq_h2osfc - real(r8) :: dt_veg(bounds%begp:bounds%endp) ! change in t_veg, last iteration (Kelvin) - integer :: jtop(bounds%begc:bounds%endc) ! lbning - integer :: filterc_tmp(bounds%endp-bounds%begp+1) ! temporary variable - integer :: ft ! plant functional type index - real(r8) :: temprootr - real(r8) :: dt_veg_temp(bounds%begp:bounds%endp) - integer :: iv - logical :: is_end_day ! is end of current day - - integer :: dummy_to_make_pgi_happy - !------------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(downreg_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(leafn_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - soilresis => soilstate_inst%soilresis_col , & ! Input: [real(r8) (:) ] soil evaporative resistance - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dayl => grc%dayl , & ! Input: [real(r8) (:) ] daylength (s) - max_dayl => grc%max_dayl , & ! Input: [real(r8) (:) ] maximum daylength for this grid cell (s) - - dleaf => pftcon%dleaf , & ! Input: characteristic leaf dimension (m) - - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_th => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric potential temperature (Kelvin) - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) - forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - forc_pc13o2 => atm2lnd_inst%forc_pc13o2_grc , & ! Input: [real(r8) (:) ] partial pressure c13o2 (Pa) - forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] partial pressure o2 (Pa) - - tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (C) - vap_ref2m => humanindex_inst%vap_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height vapor pressure (Pa) - appar_temp_ref2m => humanindex_inst%appar_temp_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m apparent temperature (C) - appar_temp_ref2m_r => humanindex_inst%appar_temp_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m apparent temperature (C) - swbgt_ref2m => humanindex_inst%swbgt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Simplified Wetbulb Globe temperature (C) - swbgt_ref2m_r => humanindex_inst%swbgt_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Simplified Wetbulb Globe temperature (C) - humidex_ref2m => humanindex_inst%humidex_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Humidex (C) - humidex_ref2m_r => humanindex_inst%humidex_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Humidex (C) - wbt_ref2m => humanindex_inst%wbt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Stull Wet Bulb temperature (C) - wbt_ref2m_r => humanindex_inst%wbt_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Stull Wet Bulb temperature (C) - wb_ref2m => humanindex_inst%wb_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Wet Bulb temperature (C) - wb_ref2m_r => humanindex_inst%wb_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Wet Bulb temperature (C) - teq_ref2m => humanindex_inst%teq_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent temperature (K) - teq_ref2m_r => humanindex_inst%teq_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Equivalent temperature (K) - ept_ref2m => humanindex_inst%ept_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent Potential temperature (K) - ept_ref2m_r => humanindex_inst%ept_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height Equivalent Potential temperature (K) - discomf_index_ref2m => humanindex_inst%discomf_index_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Discomfort Index temperature (C) - discomf_index_ref2m_r => humanindex_inst%discomf_index_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Discomfort Index temperature (C) - discomf_index_ref2mS => humanindex_inst%discomf_index_ref2mS_patch , & ! Output: [real(r8) (:) ] 2 m height Discomfort Index Stull temperature (C) - discomf_index_ref2mS_r => humanindex_inst%discomf_index_ref2mS_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Discomfort Index Stull temperature (K) - nws_hi_ref2m => humanindex_inst%nws_hi_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m NWS Heat Index (C) - nws_hi_ref2m_r => humanindex_inst%nws_hi_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m NWS Heat Index (C) - thip_ref2m => humanindex_inst%thip_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Physiology (C) - thip_ref2m_r => humanindex_inst%thip_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Temperature Humidity Index Physiology (C) - thic_ref2m => humanindex_inst%thic_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Comfort (C) - thic_ref2m_r => humanindex_inst%thic_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Temperature Humidity Index Comfort (C) - swmp65_ref2m => humanindex_inst%swmp65_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 65% effi (C) - swmp65_ref2m_r => humanindex_inst%swmp65_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 65% effi (C) - swmp80_ref2m => humanindex_inst%swmp80_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 80% effi (C) - swmp80_ref2m_r => humanindex_inst%swmp80_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m Swamp Cooler temperature 80% effi (C) - - sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2) - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - displa => canopystate_inst%displa_patch , & ! Input: [real(r8) (:) ] displacement height (m) - htop => canopystate_inst%htop_patch , & ! Input: [real(r8) (:) ] canopy top(m) - altmax_lastyear_indx => canopystate_inst%altmax_lastyear_indx_col , & ! Input: [integer (:) ] prior year maximum annual depth of thaw - altmax_indx => canopystate_inst%altmax_indx_col , & ! Input: [integer (:) ] maximum annual depth of thaw - dleaf_patch => canopystate_inst%dleaf_patch , & ! Output: [real(r8) (:) ] mean leaf diameter for this patch/pft - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) (constant) - watdry => soilstate_inst%watdry_col , & ! Input: [real(r8) (:,:) ] btran parameter for btran=0 (constant) - watopt => soilstate_inst%watopt_col , & ! Input: [real(r8) (:,:) ] btran parameter for btran=1 (constant) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective soil porosity - soilbeta => soilstate_inst%soilbeta_col , & ! Input: [real(r8) (:) ] soil wetness relative to field capacity - rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer - - u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:) ] 10 m height winds (m/s) - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch level [m] - z0mg => frictionvel_inst%z0mg_col , & ! Input: [real(r8) (:) ] roughness length of ground, momentum [m] - zetamax => frictionvel_parms_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions - ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - z0mv => frictionvel_inst%z0mv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, momentum [m] - z0hv => frictionvel_inst%z0hv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, sensible heat [m] - z0qv => frictionvel_inst%z0qv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, latent heat [m] - rb1 => frictionvel_inst%rb1_patch , & ! Output: [real(r8) (:) ] boundary layer resistance (s/m) - - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground surface temperature [K] - thv => temperature_inst%thv_col , & ! Input: [real(r8) (:) ] virtual potential temperature (kelvin) - thm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] intermediate variable (forc_t+0.0098*forc_hgt_t_patch) - emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity - emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] vegetation emissivity - t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) - t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) - t_ref2m_r => temperature_inst%t_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface air temperature (Kelvin) - t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) - - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of surface water - fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) - fdry => waterstate_inst%fdry_patch , & ! Input: [real(r8) (:) ] fraction of foliage that is green and dry [-] - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - qg_snow => waterstate_inst%qg_snow_col , & ! Input: [real(r8) (:) ] specific humidity at snow surface [kg/kg] - qg_soil => waterstate_inst%qg_soil_col , & ! Input: [real(r8) (:) ] specific humidity at soil surface [kg/kg] - qg_h2osfc => waterstate_inst%qg_h2osfc_col , & ! Input: [real(r8) (:) ] specific humidity at h2osfc surface [kg/kg] - qg => waterstate_inst%qg_col , & ! Input: [real(r8) (:) ] specific humidity at ground surface [kg/kg] - dqgdT => waterstate_inst%dqgdT_col , & ! Input: [real(r8) (:) ] temperature derivative of "qg" - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] by F. Li and S. Levis - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_liqvol => waterstate_inst%h2osoi_liqvol_col , & ! Output: [real(r8) (:,:) ] volumetric liquid water (v/v) - h2ocan => waterstate_inst%h2ocan_patch , & ! Output: [real(r8) (:) ] canopy water (mm H2O) - snocan => waterstate_inst%snocan_patch , & ! Output: [real(r8) (:) ] canopy snow (mm H2O) - liqcan => waterstate_inst%liqcan_patch , & ! Output: [real(r8) (:) ] canopy liquid (mm H2O) - snounload => waterstate_inst%snounload_patch , & ! Output: [real(r8) (:) ] canopy snow unloading mass (mm H2O) - - q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) - rh_ref2m_r => waterstate_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%) - rh_ref2m => waterstate_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) - rhaf => waterstate_inst%rh_af_patch , & ! Output: [real(r8) (:) ] fractional humidity of canopy air [dimensionless] - - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Output: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_evap_veg => waterflux_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm) - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_ev_snow => waterflux_inst%qflx_ev_snow_patch , & ! Output: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm] - qflx_ev_soil => waterflux_inst%qflx_ev_soil_patch , & ! Output: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_patch , & ! Output: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] - - rssun => photosyns_inst%rssun_patch , & ! Output: [real(r8) (:) ] leaf sunlit stomatal resistance (s/m) (output from Photosynthesis) - rssha => photosyns_inst%rssha_patch , & ! Output: [real(r8) (:) ] leaf shaded stomatal resistance (s/m) (output from Photosynthesis) - - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) [J/kg] (constant) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] F. Li and S. Levis - btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) - taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) - tauy => energyflux_inst%tauy_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: n-s (kg/m/s**2) - canopy_cond => energyflux_inst%canopy_cond_patch , & ! Output: [real(r8) (:) ] tracer conductance for canopy [m/s] - cgrnds => energyflux_inst%cgrnds_patch , & ! Output: [real(r8) (:) ] deriv. of soil sensible heat flux wrt soil temp [w/m2/k] - cgrndl => energyflux_inst%cgrndl_patch , & ! Output: [real(r8) (:) ] deriv. of soil latent heat flux wrt soil temp [w/m**2/k] - dlrad => energyflux_inst%dlrad_patch , & ! Output: [real(r8) (:) ] downward longwave radiation below the canopy [W/m2] - ulrad => energyflux_inst%ulrad_patch , & ! Output: [real(r8) (:) ] upward longwave radiation above the canopy [W/m2] - cgrnd => energyflux_inst%cgrnd_patch , & ! Output: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp [w/m2/k] - eflx_sh_snow => energyflux_inst%eflx_sh_snow_patch , & ! Output: [real(r8) (:) ] sensible heat flux from snow (W/m**2) [+ to atm] - eflx_sh_h2osfc => energyflux_inst%eflx_sh_h2osfc_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_soil => energyflux_inst%eflx_sh_soil_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_veg => energyflux_inst%eflx_sh_veg_patch , & ! Output: [real(r8) (:) ] sensible heat flux from leaves (W/m**2) [+ to atm] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - begp => bounds%begp , & - endp => bounds%endp , & - begg => bounds%begg , & - endg => bounds%endg & - ) - if (use_hydrstress) then - bsun => energyflux_inst%bsun_patch ! Output: [real(r8) (:) ] sunlit canopy transpiration wetness factor (0 to 1) - bsha => energyflux_inst%bsha_patch ! Output: [real(r8) (:) ] sunlit canopy transpiration wetness factor (0 to 1) - end if - - ! Determine step size - - dtime = get_step_size() - is_end_day = is_end_curr_day() - - ! Make a local copy of the exposedvegp filter. With the current implementation, - ! this is needed because the filter is modified in the iteration loop. - ! - ! TODO(wjs, 2014-09-24) Determine if this is really needed. I suspect that we could - ! do away with either this temporary fn/filterp, or the temporary fnorig/fporig, - ! with one of these simply using the passed-in filter (num_exposedvegp / - ! filter_exposedvegp) - - fn = num_exposedvegp - filterp(1:fn) = filter_exposedvegp(1:fn) - - ! ----------------------------------------------------------------- - ! Time step initialization of photosynthesis variables - ! ----------------------------------------------------------------- - - call photosyns_inst%TimeStepInit(bounds) - - - ! ----------------------------------------------------------------- - ! Prep some IO variables and some checks on patch pointers if FATES - ! is running. - ! Filter explanation: The patch filter in this routine identifies all - ! non-lake, non-urban patches that are not covered by ice. The - ! filter is set over a few steps: - ! - ! 1a) for CN: - ! clm_drv() -> - ! bgc_vegetation_inst%EcosystemDynamicsPostDrainage() -> - ! CNVegStructUpdate() - ! if(elai(p)+esai(p)>0) frac_veg_nosno_alb(p) = 1 - ! - ! 1b) for FATES: - ! clm_drv() -> - ! clm_fates%dynamics_driv() -> - ! ed_clm_link() -> - ! ed_clm_leaf_area_profile(): - ! if(elai(p)+esai(p)>0) frac_veg_nosno_alb(p) = 1 - ! - ! 2) during clm_drv()->clm_drv_init(): - ! frac_veg_nosno_alb(p) is then combined with the active(p) - ! flag via union to create frac_veg_nosno_patch(p) - ! 3) immediately after, during clm_drv()->setExposedvegpFilter() - ! the list used here "exposedvegp(fe)" is incremented if - ! frac_veg_nosno_patch > 0 - ! ----------------------------------------------------------------- - - if (use_fates) then - call clm_fates%prep_canopyfluxes(nc, fn, filterp, photosyns_inst) - end if - - ! Initialize - - do f = 1, fn - p = filterp(f) - del(p) = 0._r8 ! change in leaf temperature from previous iteration - efeb(p) = 0._r8 ! latent head flux from leaf for previous iteration - wtlq0(p) = 0._r8 - wtalq(p) = 0._r8 - wtgq(p) = 0._r8 - wtaq0(p) = 0._r8 - obuold(p) = 0._r8 - btran(p) = btran0 - btran2(p) = btran0 - end do - - ! calculate daylength control for Vcmax - do f = 1, fn - p=filterp(f) - g=patch%gridcell(p) - ! calculate dayl_factor as the ratio of (current:max dayl)^2 - ! set a minimum of 0.01 (1%) for the dayl_factor - dayl_factor(p)=min(1._r8,max(0.01_r8,(dayl(g)*dayl(g))/(max_dayl(g)*max_dayl(g)))) - end do - - rb1(begp:endp) = 0._r8 - - !assign the temporary filter - do f = 1, fn - p = filterp(f) - filterc_tmp(f)=patch%column(p) - enddo - - !compute effective soil porosity - call calc_effective_soilporosity(bounds, & - ubj = nlevgrnd, & - numf = fn, & - filter = filterc_tmp(1:fn), & - watsat = watsat(bounds%begc:bounds%endc, 1:nlevgrnd), & - h2osoi_ice = h2osoi_ice(bounds%begc:bounds%endc,1:nlevgrnd), & - denice = denice, & - eff_por=eff_porosity(bounds%begc:bounds%endc, 1:nlevgrnd) ) - - !compute volumetric liquid water content - jtop(bounds%begc:bounds%endc) = 1 - - call calc_volumetric_h2oliq(bounds, & - jtop = jtop(bounds%begc:bounds%endc), & - lbj = 1, & - ubj = nlevgrnd, & - numf = fn, & - filter = filterc_tmp(1:fn), & - eff_porosity = eff_porosity(bounds%begc:bounds%endc, 1:nlevgrnd), & - h2osoi_liq = h2osoi_liq(bounds%begc:bounds%endc, 1:nlevgrnd), & - denh2o = denh2o, & - vol_liq = h2osoi_liqvol(bounds%begc:bounds%endc, 1:nlevgrnd) ) - - !set up perchroot options - call set_perchroot_opt(perchroot, perchroot_alt) - - ! -------------------------------------------------------------------------- - ! if this is a FATES simulation - ! ask fates to calculate btran functions and distribution of uptake - ! this will require boundary conditions from CLM, boundary conditions which - ! may only be available from a smaller subset of patches that meet the - ! exposed veg. - ! calc_root_moist_stress already calculated root soil water stress 'rresis' - ! this is the input boundary condition to calculate the transpiration - ! wetness factor btran and the root weighting factors for FATES. These - ! values require knowledge of the belowground root structure. - ! -------------------------------------------------------------------------- - - if(use_fates)then - call clm_fates%wrap_btran(nc, fn, filterc_tmp(1:fn), soilstate_inst, waterstate_inst, & - temperature_inst, energyflux_inst, soil_water_retention_curve) - - else - - !calculate root moisture stress - call calc_root_moist_stress(bounds, & - nlevgrnd = nlevgrnd, & - fn = fn, & - filterp = filterp, & - canopystate_inst=canopystate_inst, & - energyflux_inst=energyflux_inst, & - soilstate_inst=soilstate_inst, & - temperature_inst=temperature_inst, & - waterstate_inst=waterstate_inst, & - soil_water_retention_curve=soil_water_retention_curve) - - - end if - - ! Modify aerodynamic parameters for sparse/dense canopy (X. Zeng) - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - lt = min(elai(p)+esai(p), tlsai_crit) - egvf =(1._r8 - alpha_aero * exp(-lt)) / (1._r8 - alpha_aero * exp(-tlsai_crit)) - displa(p) = egvf * displa(p) - z0mv(p) = exp(egvf * log(z0mv(p)) + (1._r8 - egvf) * log(z0mg(c))) - z0hv(p) = z0mv(p) - z0qv(p) = z0mv(p) - end do - - found = .false. - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Net absorbed longwave radiation by canopy and ground - ! =air+bir*t_veg**4+cir*t_grnd(c)**4 - - air(p) = emv(p) * (1._r8+(1._r8-emv(p))*(1._r8-emg(c))) * forc_lwrad(c) - bir(p) = - (2._r8-emv(p)*(1._r8-emg(c))) * emv(p) * sb - cir(p) = emv(p)*emg(c)*sb - - ! Saturated vapor pressure, specific humidity, and their derivatives - ! at the leaf surface - - call QSat (t_veg(p), forc_pbot(c), el(p), deldT, qsatl(p), qsatldT(p)) - - ! Determine atmospheric co2 and o2 - - co2(p) = forc_pco2(g) - o2(p) = forc_po2(g) - - if ( use_c13 ) then - c13o2(p) = forc_pc13o2(g) - end if - - ! Initialize flux profile - - nmozsgn(p) = 0 - - taf(p) = (t_grnd(c) + thm(p))/2._r8 - qaf(p) = (forc_q(c)+qg(c))/2._r8 - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-taf(p) - dqh(p) = forc_q(c)-qaf(p) - delq(p) = qg(c) - qaf(p) - dthv(p) = dth(p)*(1._r8+0.61_r8*forc_q(c))+0.61_r8*forc_th(c)*dqh(p) - zldis(p) = forc_hgt_u_patch(p) - displa(p) - - ! Check to see if the forcing height is below the canopy height - if (zldis(p) < 0._r8) then - found = .true. - index = p - end if - - end do - - if (found) then - if ( .not. use_fates ) then - write(iulog,*)'Error: Forcing height is below canopy height for patch index ' - call endrun(decomp_index=index, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv(p), zldis(p), z0mv(p), um(p), obu(p)) - - end do - - ! Set counter for leaf temperature iteration (itlef) - - itlef = 0 - fnorig = fn - fporig(1:fn) = filterp(1:fn) - - ! Begin stability iteration - - call t_startf('can_iter') - ITERATION : do while (itlef <= itmax .and. fn > 0) - - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - call FrictionVelocity (begp, endp, fn, filterp, & - displa(begp:endp), z0mv(begp:endp), z0hv(begp:endp), z0qv(begp:endp), & - obu(begp:endp), itlef+1, ur(begp:endp), um(begp:endp), ustar(begp:endp), & - temp1(begp:endp), temp2(begp:endp), temp12m(begp:endp), temp22m(begp:endp), fm(begp:endp), & - frictionvel_inst) - - - - - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - tlbef(p) = t_veg(p) - del2(p) = del(p) - - ! Determine aerodynamic resistances - - ram1(p) = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah(p,1) = 1._r8/(temp1(p)*ustar(p)) - raw(p,1) = 1._r8/(temp2(p)*ustar(p)) - - ! Bulk boundary layer resistance of leaves - - uaf(p) = um(p)*sqrt( 1._r8/(ram1(p)*um(p)) ) - - ! Use pft parameter for leaf characteristic width - ! dleaf_patch if this is not an fates patch. - ! Otherwise, the value has already been loaded - ! during the FATES dynamics call - if(.not.patch%is_fates(p)) then - dleaf_patch(p) = dleaf(patch%itype(p)) - end if - - cf = 0.01_r8/(sqrt(uaf(p))*sqrt( dleaf_patch(p) )) - rb(p) = 1._r8/(cf*uaf(p)) - rb1(p) = rb(p) - - ! Parameterization for variation of csoilc with canopy density from - ! X. Zeng, University of Arizona - - w = exp(-(elai(p)+esai(p))) - - ! changed by K.Sakaguchi from here - ! transfer coefficient over bare soil is changed to a local variable - ! just for readability of the code (from line 680) - csoilb = (vkc/(0.13_r8*(z0mg(c)*uaf(p)/1.5e-5_r8)**0.45_r8)) - - !compute the stability parameter for ricsoilc ("S" in Sakaguchi&Zeng,2008) - - ri = ( grav*htop(p) * (taf(p) - t_grnd(c)) ) / (taf(p) * uaf(p) **2.00_r8) - - !! modify csoilc value (0.004) if the under-canopy is in stable condition - - if (use_undercanopy_stability .and. (taf(p) - t_grnd(c) ) > 0._r8) then - ! decrease the value of csoilc by dividing it with (1+gamma*min(S, 10.0)) - ! ria ("gmanna" in Sakaguchi&Zeng, 2008) is a constant (=0.5) - ricsoilc = csoilc / (1.00_r8 + ria*min( ri, 10.0_r8) ) - csoilcn = csoilb*w + ricsoilc*(1._r8-w) - else - csoilcn = csoilb*w + csoilc*(1._r8-w) - end if - - !! Sakaguchi changes for stability formulation ends here - - rah(p,2) = 1._r8/(csoilcn*uaf(p)) - raw(p,2) = rah(p,2) - if (use_lch4) then - grnd_ch4_cond(p) = 1._r8/(raw(p,1)+raw(p,2)) - end if - - ! Stomatal resistances for sunlit and shaded fractions of canopy. - ! Done each iteration to account for differences in eah, tv. - - svpts(p) = el(p) ! pa - eah(p) = forc_pbot(c) * qaf(p) / 0.622_r8 ! pa - rhaf(p) = eah(p)/svpts(p) - end do - - if ( use_fates ) then - - call clm_fates%wrap_photosynthesis(nc, bounds, fn, filterp(1:fn), & - svpts(begp:endp), eah(begp:endp), o2(begp:endp), & - co2(begp:endp), rb(begp:endp), dayl_factor(begp:endp), & - atm2lnd_inst, temperature_inst, canopystate_inst, photosyns_inst) - - else ! not use_fates - - if ( use_hydrstress ) then - call PhotosynthesisHydraulicStress (bounds, fn, filterp, & - svpts(begp:endp), eah(begp:endp), o2(begp:endp), co2(begp:endp), rb(begp:endp), bsun(begp:endp), & - bsha(begp:endp), btran(begp:endp), dayl_factor(begp:endp), leafn_patch(begp:endp), & - qsatl(begp:endp), qaf(begp:endp), & - atm2lnd_inst, temperature_inst, soilstate_inst, waterstate_inst, surfalb_inst, solarabs_inst, & - canopystate_inst, ozone_inst, photosyns_inst, waterflux_inst, froot_carbon(begp:endp), croot_carbon(begp:endp)) - else - call Photosynthesis (bounds, fn, filterp, & - svpts(begp:endp), eah(begp:endp), o2(begp:endp), co2(begp:endp), rb(begp:endp), btran(begp:endp), & - dayl_factor(begp:endp), leafn_patch(begp:endp), & - atm2lnd_inst, temperature_inst, surfalb_inst, solarabs_inst, & - canopystate_inst, ozone_inst, photosyns_inst, phase='sun') - endif - - if ( use_cn .and. use_c13 ) then - call Fractionation (bounds, fn, filterp, downreg_patch(begp:endp), & - atm2lnd_inst, canopystate_inst, solarabs_inst, surfalb_inst, photosyns_inst, & - phase='sun') - endif - - if ( .not.(use_hydrstress) ) then - call Photosynthesis (bounds, fn, filterp, & - svpts(begp:endp), eah(begp:endp), o2(begp:endp), co2(begp:endp), rb(begp:endp), btran(begp:endp), & - dayl_factor(begp:endp), leafn_patch(begp:endp), & - atm2lnd_inst, temperature_inst, surfalb_inst, solarabs_inst, & - canopystate_inst, ozone_inst, photosyns_inst, phase='sha') - end if - - if ( use_cn .and. use_c13 ) then - call Fractionation (bounds, fn, filterp, downreg_patch(begp:endp), & - atm2lnd_inst, canopystate_inst, solarabs_inst, surfalb_inst, photosyns_inst, & - phase='sha') - end if - - end if ! end of if use_fates - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Sensible heat conductance for air, leaf and ground - ! Moved the original subroutine in-line... - - wta = 1._r8/rah(p,1) ! air - wtl = (elai(p)+esai(p))/rb(p) ! leaf - wtg(p) = 1._r8/rah(p,2) ! ground - wtshi = 1._r8/(wta+wtl+wtg(p)) - - wtl0(p) = wtl*wtshi ! leaf - wtg0 = wtg(p)*wtshi ! ground - wta0(p) = wta*wtshi ! air - - wtga = wta0(p)+wtg0 ! ground + air - wtal(p) = wta0(p)+wtl0(p) ! air + leaf - - ! Fraction of potential evaporation from leaf - - if (fdry(p) > 0._r8) then - rppdry = fdry(p)*rb(p)*(laisun(p)/(rb(p)+rssun(p)) + laisha(p)/(rb(p)+rssha(p)))/elai(p) - else - rppdry = 0._r8 - end if - - ! Calculate canopy conductance for methane / oxygen (e.g. stomatal conductance & leaf bdy cond) - if (use_lch4) then - canopy_cond(p) = (laisun(p)/(rb(p)+rssun(p)) + laisha(p)/(rb(p)+rssha(p)))/max(elai(p), 0.01_r8) - end if - - efpot = forc_rho(c)*wtl*(qsatl(p)-qaf(p)) - - ! When the hydraulic stress parameterization is active calculate rpp - ! but not transpiration - if ( use_hydrstress ) then - if (efpot > 0._r8) then - if (btran(p) > btran0) then - rpp = rppdry + fwet(p) - else - rpp = fwet(p) - end if - !Check total evapotranspiration from leaves - rpp = min(rpp, (qflx_tran_veg(p)+h2ocan(p)/dtime)/efpot) - else - rpp = 1._r8 - end if - else - if (efpot > 0._r8) then - if (btran(p) > btran0) then - qflx_tran_veg(p) = efpot*rppdry - rpp = rppdry + fwet(p) - else - !No transpiration if btran below 1.e-10 - rpp = fwet(p) - qflx_tran_veg(p) = 0._r8 - end if - !Check total evapotranspiration from leaves - rpp = min(rpp, (qflx_tran_veg(p)+h2ocan(p)/dtime)/efpot) - else - !No transpiration if potential evaporation less than zero - rpp = 1._r8 - qflx_tran_veg(p) = 0._r8 - end if - end if - - ! Update conductances for changes in rpp - ! Latent heat conductances for ground and leaf. - ! Air has same conductance for both sensible and latent heat. - ! Moved the original subroutine in-line... - - wtaq = frac_veg_nosno(p)/raw(p,1) ! air - wtlq = frac_veg_nosno(p)*(elai(p)+esai(p))/rb(p) * rpp ! leaf - - !Litter layer resistance. Added by K.Sakaguchi - snow_depth_c = z_dl ! critical depth for 100% litter burial by snow (=litter thickness) - fsno_dl = snow_depth(c)/snow_depth_c ! effective snow cover for (dry)plant litter - elai_dl = lai_dl*(1._r8 - min(fsno_dl,1._r8)) ! exposed (dry)litter area index - rdl = ( 1._r8 - exp(-elai_dl) ) / ( 0.004_r8*uaf(p)) ! dry litter layer resistance - - ! add litter resistance and Lee and Pielke 1992 beta - if (delq(p) < 0._r8) then !dew. Do not apply beta for negative flux (follow old rsoil) - wtgq(p) = frac_veg_nosno(p)/(raw(p,2)+rdl) - else - if (do_soilevap_beta()) then - wtgq(p) = soilbeta(c)*frac_veg_nosno(p)/(raw(p,2)+rdl) - endif - if (do_soil_resistance_sl14()) then - wtgq(p) = frac_veg_nosno(p)/(raw(p,2)+soilresis(c)) - endif - end if - - wtsqi = 1._r8/(wtaq+wtlq+wtgq(p)) - - wtgq0 = wtgq(p)*wtsqi ! ground - wtlq0(p) = wtlq*wtsqi ! leaf - wtaq0(p) = wtaq*wtsqi ! air - - wtgaq = wtaq0(p)+wtgq0 ! air + ground - wtalq(p) = wtaq0(p)+wtlq0(p) ! air + leaf - - dc1 = forc_rho(c)*cpair*wtl - dc2 = hvap*forc_rho(c)*wtlq - - efsh = dc1*(wtga*t_veg(p)-wtg0*t_grnd(c)-wta0(p)*thm(p)) - efe(p) = dc2*(wtgaq*qsatl(p)-wtgq0*qg(c)-wtaq0(p)*forc_q(c)) - - ! Evaporation flux from foliage - - erre = 0._r8 - if (efe(p)*efeb(p) < 0._r8) then - efeold = efe(p) - efe(p) = 0.1_r8*efeold - erre = efe(p) - efeold - end if - ! fractionate ground emitted longwave - lw_grnd=(frac_sno(c)*t_soisno(c,snl(c)+1)**4 & - +(1._r8-frac_sno(c)-frac_h2osfc(c))*t_soisno(c,1)**4 & - +frac_h2osfc(c)*t_h2osfc(c)**4) - - dt_veg(p) = (sabv(p) + air(p) + bir(p)*t_veg(p)**4 + & - cir(p)*lw_grnd - efsh - efe(p)) / & - (- 4._r8*bir(p)*t_veg(p)**3 +dc1*wtga +dc2*wtgaq*qsatldT(p)) - t_veg(p) = tlbef(p) + dt_veg(p) - dels = dt_veg(p) - del(p) = abs(dels) - err(p) = 0._r8 - if (del(p) > delmax) then - dt_veg(p) = delmax*dels/del(p) - t_veg(p) = tlbef(p) + dt_veg(p) - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + cir(p)*lw_grnd - & - (efsh + dc1*wtga*dt_veg(p)) - (efe(p) + & - dc2*wtgaq*qsatldT(p)*dt_veg(p)) - end if - - ! Fluxes from leaves to canopy space - ! "efe" was limited as its sign changes frequently. This limit may - ! result in an imbalance in "hvap*qflx_evap_veg" and - ! "efe + dc2*wtgaq*qsatdt_veg" - - efpot = forc_rho(c)*wtl*(wtgaq*(qsatl(p)+qsatldT(p)*dt_veg(p)) & - -wtgq0*qg(c)-wtaq0(p)*forc_q(c)) - qflx_evap_veg(p) = rpp*efpot - - ! Calculation of evaporative potentials (efpot) and - ! interception losses; flux in kg m**-2 s-1. ecidif - ! holds the excess energy if all intercepted water is evaporated - ! during the timestep. This energy is later added to the - ! sensible heat flux. - - ! Note that when the hydraulic stress parameterization is active we don't - ! adjust transpiration for the new values of potential evaporation and rppdry - ! as calculated above because transpiration would then no longer be consistent - ! with the vertical transpiration sink terms that are passed to Compute_VertTranSink_PHS, - ! thereby causing a water balance error. However, because this adjustment occurs - ! within the leaf temperature iteration, this ends up being a small inconsistency. - if ( use_hydrstress ) then - ecidif = max(0._r8, qflx_evap_veg(p)-qflx_tran_veg(p)-h2ocan(p)/dtime) - qflx_evap_veg(p) = min(qflx_evap_veg(p),qflx_tran_veg(p)+h2ocan(p)/dtime) - else - ecidif = 0._r8 - if (efpot > 0._r8 .and. btran(p) > btran0) then - qflx_tran_veg(p) = efpot*rppdry - else - qflx_tran_veg(p) = 0._r8 - end if - ecidif = max(0._r8, qflx_evap_veg(p)-qflx_tran_veg(p)-h2ocan(p)/dtime) - qflx_evap_veg(p) = min(qflx_evap_veg(p),qflx_tran_veg(p)+h2ocan(p)/dtime) - end if - - ! The energy loss due to above two limits is added to - ! the sensible heat flux. - - eflx_sh_veg(p) = efsh + dc1*wtga*dt_veg(p) + err(p) + erre + hvap*ecidif - - ! Re-calculate saturated vapor pressure, specific humidity, and their - ! derivatives at the leaf surface - - call QSat(t_veg(p), forc_pbot(c), el(p), deldT, qsatl(p), qsatldT(p)) - - ! Update vegetation/ground surface temperature, canopy air - ! temperature, canopy vapor pressure, aerodynamic temperature, and - ! Monin-Obukhov stability parameter for next iteration. - - taf(p) = wtg0*t_grnd(c) + wta0(p)*thm(p) + wtl0(p)*t_veg(p) - qaf(p) = wtlq0(p)*qsatl(p) + wtgq0*qg(c) + forc_q(c)*wtaq0(p) - - ! Update Monin-Obukhov length and wind speed including the - ! stability effect - - dth(p) = thm(p)-taf(p) - dqh(p) = forc_q(c)-qaf(p) - delq(p) = wtalq(p)*qg(c)-wtlq0(p)*qsatl(p)-wtaq0(p)*forc_q(c) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - - thvstar = tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar - zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(zetamax,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta*(-grav*ustar(p)*thvstar*zii/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p)+wc*wc) - end if - obu(p) = zldis(p)/zeta - - if (obuold(p)*obu(p) < 0._r8) nmozsgn(p) = nmozsgn(p)+1 - if (nmozsgn(p) >= 4) obu(p) = zldis(p)/(-0.01_r8) - obuold(p) = obu(p) - - end do ! end of filtered patch loop - - ! Test for convergence - - itlef = itlef+1 - if (itlef > itmin) then - do f = 1, fn - p = filterp(f) - dele(p) = abs(efe(p)-efeb(p)) - efeb(p) = efe(p) - det(p) = max(del(p),del2(p)) - end do - fnold = fn - fn = 0 - do f = 1, fnold - p = filterp(f) - if (.not. (det(p) < dtmin .and. dele(p) < dlemin)) then - fn = fn + 1 - filterp(fn) = p - end if - end do - end if - - end do ITERATION ! End stability iteration - call t_stopf('can_iter') - - fn = fnorig - filterp(1:fn) = fporig(1:fn) - - ! Set status of snowveg_flag - snowveg_on = IsSnowvegFlagOn() - snowveg_onrad = IsSnowvegFlagOnRad() - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Energy balance check in canopy - - lw_grnd=(frac_sno(c)*t_soisno(c,snl(c)+1)**4 & - +(1._r8-frac_sno(c)-frac_h2osfc(c))*t_soisno(c,1)**4 & - +frac_h2osfc(c)*t_h2osfc(c)**4) - - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) & - !+ cir(p)*t_grnd(c)**4 - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) - + cir(p)*lw_grnd - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) - - ! Fluxes from ground to canopy space - - delt = wtal(p)*t_grnd(c)-wtl0(p)*t_veg(p)-wta0(p)*thm(p) - taux(p) = -forc_rho(c)*forc_u(g)/ram1(p) - tauy(p) = -forc_rho(c)*forc_v(g)/ram1(p) - eflx_sh_grnd(p) = cpair*forc_rho(c)*wtg(p)*delt - - ! compute individual sensible heat fluxes - delt_snow = wtal(p)*t_soisno(c,snl(c)+1)-wtl0(p)*t_veg(p)-wta0(p)*thm(p) - eflx_sh_snow(p) = cpair*forc_rho(c)*wtg(p)*delt_snow - - delt_soil = wtal(p)*t_soisno(c,1)-wtl0(p)*t_veg(p)-wta0(p)*thm(p) - eflx_sh_soil(p) = cpair*forc_rho(c)*wtg(p)*delt_soil - - delt_h2osfc = wtal(p)*t_h2osfc(c)-wtl0(p)*t_veg(p)-wta0(p)*thm(p) - eflx_sh_h2osfc(p) = cpair*forc_rho(c)*wtg(p)*delt_h2osfc - qflx_evap_soi(p) = forc_rho(c)*wtgq(p)*delq(p) - - ! compute individual latent heat fluxes - delq_snow = wtalq(p)*qg_snow(c)-wtlq0(p)*qsatl(p)-wtaq0(p)*forc_q(c) - qflx_ev_snow(p) = forc_rho(c)*wtgq(p)*delq_snow - - delq_soil = wtalq(p)*qg_soil(c)-wtlq0(p)*qsatl(p)-wtaq0(p)*forc_q(c) - qflx_ev_soil(p) = forc_rho(c)*wtgq(p)*delq_soil - - delq_h2osfc = wtalq(p)*qg_h2osfc(c)-wtlq0(p)*qsatl(p)-wtaq0(p)*forc_q(c) - qflx_ev_h2osfc(p) = forc_rho(c)*wtgq(p)*delq_h2osfc - - ! 2 m height air temperature - - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - t_ref2m_r(p) = t_ref2m(p) - - ! 2 m height specific humidity - - q_ref2m(p) = forc_q(c) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - rh_ref2m_r(p) = rh_ref2m(p) - - ! Human Heat Stress - if ( calc_human_stress_indices )then - - call KtoC(t_ref2m(p), tc_ref2m(p)) - call VaporPres(rh_ref2m(p), e_ref2m, vap_ref2m(p)) - call Wet_Bulb(t_ref2m(p), vap_ref2m(p), forc_pbot(c), rh_ref2m(p), q_ref2m(p), & - teq_ref2m(p), ept_ref2m(p), wb_ref2m(p)) - call Wet_BulbS(tc_ref2m(p),rh_ref2m(p), wbt_ref2m(p)) - call HeatIndex(tc_ref2m(p), rh_ref2m(p), nws_hi_ref2m(p)) - call AppTemp(tc_ref2m(p), vap_ref2m(p), u10_clm(p), appar_temp_ref2m(p)) - call swbgt(tc_ref2m(p), vap_ref2m(p), swbgt_ref2m(p)) - call hmdex(tc_ref2m(p), vap_ref2m(p), humidex_ref2m(p)) - call dis_coi(tc_ref2m(p), wb_ref2m(p), discomf_index_ref2m(p)) - call dis_coiS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p), discomf_index_ref2mS(p)) - call THIndex(tc_ref2m(p), wb_ref2m(p), thic_ref2m(p), thip_ref2m(p)) - call SwampCoolEff(tc_ref2m(p), wb_ref2m(p), swmp80_ref2m(p), swmp65_ref2m(p)) - - teq_ref2m_r(p) = teq_ref2m(p) - ept_ref2m_r(p) = ept_ref2m(p) - wb_ref2m_r(p) = wb_ref2m(p) - wbt_ref2m_r(p) = wbt_ref2m(p) - nws_hi_ref2m_r(p) = nws_hi_ref2m(p) - appar_temp_ref2m_r(p) = appar_temp_ref2m(p) - swbgt_ref2m_r(p) = swbgt_ref2m(p) - humidex_ref2m_r(p) = humidex_ref2m(p) - discomf_index_ref2m_r(p) = discomf_index_ref2m(p) - discomf_index_ref2mS_r(p) = discomf_index_ref2mS(p) - thic_ref2m_r(p) = thic_ref2m(p) - thip_ref2m_r(p) = thip_ref2m(p) - swmp80_ref2m_r(p) = swmp80_ref2m(p) - swmp65_ref2m_r(p) = swmp65_ref2m(p) - end if - - ! Downward longwave radiation below the canopy - - dlrad(p) = (1._r8-emv(p))*emg(c)*forc_lwrad(c) + & - emv(p)*emg(c)*sb*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) - - ! Upward longwave radiation above the canopy - - ulrad(p) = ((1._r8-emg(c))*(1._r8-emv(p))*(1._r8-emv(p))*forc_lwrad(c) & - + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*lw_grnd) - - ! Calculate the skin temperature as a weighted sum of all the ground and vegetated fraction - ! The weight is the so-called vegetation emissivity, but not that emv is actually an attentuation - ! function that goes to zero as LAI (ELAI + ESAI) go to zero. - - t_skin_patch(p) = emv(p)*t_veg(p) + (1._r8 - emv(p))*sqrt(sqrt(lw_grnd)) - - ! Derivative of soil energy flux with respect to soil temperature - - cgrnds(p) = cgrnds(p) + cpair*forc_rho(c)*wtg(p)*wtal(p) - cgrndl(p) = cgrndl(p) + forc_rho(c)*wtgq(p)*wtalq(p)*dqgdT(c) - cgrnd(p) = cgrnds(p) + cgrndl(p)*htvp(c) - - ! Update dew accumulation (kg/m2) - h2ocan(p) = max(0._r8,h2ocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime) - - if (snowveg_on .or. snowveg_onrad) then - if (t_veg(p) > tfrz ) then ! above freezing, update accumulation in liqcan - if ((qflx_evap_veg(p)-qflx_tran_veg(p))*dtime > liqcan(p)) then ! all liq evap - ! In this case, all liqcan will evap. Take remainder from snocan - snocan(p)=snocan(p)+liqcan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime - end if - liqcan(p) = max(0._r8,liqcan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime) - - else if (t_veg(p) <= tfrz) then ! below freezing, update accumulation in snocan - if ((qflx_evap_veg(p)-qflx_tran_veg(p))*dtime > snocan(p)) then ! all sno evap - ! In this case, all snocan will evap. Take remainder from liqcan - liqcan(p)=liqcan(p)+snocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime - end if - snocan(p) = max(0._r8,snocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime) - end if - end if - - end do - - if ( use_fates ) then - - - call clm_fates%wrap_accumulatefluxes(nc,fn,filterp(1:fn)) - call clm_fates%wrap_hydraulics_drive(bounds,nc,soilstate_inst, & - waterstate_inst,waterflux_inst,solarabs_inst,energyflux_inst) - - else - - ! Determine total photosynthesis - - call PhotosynthesisTotal(fn, filterp, & - atm2lnd_inst, canopystate_inst, photosyns_inst) - - ! Calculate ozone stress. This needs to be done after rssun and rsshade are - ! computed by the Photosynthesis routine. However, Photosynthesis also uses the - ! ozone stress computed here. Thus, the ozone stress computed in timestep i is - ! applied in timestep (i+1). - - ! COMPILER_BUG(wjs, 2014-11-29, pgi 14.7) The following dummy variable assignment is - ! needed with pgi 14.7 on yellowstone; without it, forc_pbot_downscaled_col gets - ! resized inappropriately in the following subroutine call, due to a compiler bug. - dummy_to_make_pgi_happy = ubound(atm2lnd_inst%forc_pbot_downscaled_col, 1) - call ozone_inst%CalcOzoneStress( & - bounds, fn, filterp, & - forc_pbot = atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc), & - forc_th = atm2lnd_inst%forc_th_downscaled_col(bounds%begc:bounds%endc), & - rssun = photosyns_inst%rssun_patch(bounds%begp:bounds%endp), & - rssha = photosyns_inst%rssha_patch(bounds%begp:bounds%endp), & - rb = frictionvel_inst%rb1_patch(bounds%begp:bounds%endp), & - ram = frictionvel_inst%ram1_patch(bounds%begp:bounds%endp), & - tlai = canopystate_inst%tlai_patch(bounds%begp:bounds%endp)) - - !--------------------------------------------------------- - !update Vc,max and Jmax by LUNA model - if(use_luna)then - call Acc24_Climate_LUNA(bounds, fn, filterp, & - canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst, & - temperature_inst) - - if(is_end_day)then - - call Acc240_Climate_LUNA(bounds, fn, filterp, & - o2(begp:endp), & - co2(begp:endp), & - rb(begp:endp), & - rhaf(begp:endp),& - temperature_inst, & - photosyns_inst, & - surfalb_inst, & - solarabs_inst, & - waterstate_inst,& - frictionvel_inst) - - call Update_Photosynthesis_Capacity(bounds, fn, filterp, & - dayl_factor(begp:endp), & - atm2lnd_inst, & - temperature_inst, & - canopystate_inst, & - photosyns_inst, & - surfalb_inst, & - solarabs_inst, & - waterstate_inst,& - frictionvel_inst) - - call Clear24_Climate_LUNA(bounds, fn, filterp, & - canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst, & - temperature_inst) - endif - - endif - end if - - ! Filter out patches which have small energy balance errors; report others - - fnold = fn - fn = 0 - do f = 1, fnold - p = filterp(f) - if (abs(err(p)) > 0.1_r8) then - fn = fn + 1 - filterp(fn) = p - end if - end do - - do f = 1, fn - p = filterp(f) - write(iulog,*) 'energy balance in canopy ',p,', err=',err(p) - end do - - - end associate - - - end subroutine CanopyFluxes - -end module CanopyFluxesMod - diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 deleted file mode 100644 index ecb35092c7..0000000000 --- a/src/biogeophys/CanopyHydrologyMod.F90 +++ /dev/null @@ -1,923 +0,0 @@ -module CanopyHydrologyMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculation of - ! (1) water storage of intercepted precipitation - ! (2) direct throughfall and canopy drainage of precipitation - ! (3) the fraction of foliage covered by water and the fraction - ! of foliage that is dry and transpiring. - ! (4) snow layer initialization if the snow accumulation exceeds 10 mm. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_sys_mod , only : shr_sys_flush - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog - use LandunitType , only : lun - use atm2lndType , only : atm2lnd_type - use AerosolMod , only : aerosol_type - use CanopyStateType , only : canopystate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use IrrigationMod , only : irrigation_type - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CanopyHydrology_readnl ! Read namelist - public :: CanopyHydrology ! Run - public :: IsSnowvegFlagOff ! Returns true if snowveg_flag is OFF - public :: IsSnowvegFlagOn ! Returns true if snowveg_flag is ON - public :: IsSnowvegFlagOnRad ! Returns true if snowveg_flag is ON_RAD - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: FracWet ! Determine fraction of vegetated surface that is wet - private :: FracH2oSfc ! Determine fraction of land surfaces which are submerged - ! - ! !PRIVATE DATA MEMBERS: - integer :: oldfflag=0 ! use old fsno parameterization (N&Y07) - real(r8) :: interception_fraction ! Fraction of intercepted precipitation - real(r8) :: maximum_leaf_wetted_fraction ! Maximum fraction of leaf that may be wet - logical, private :: use_clm5_fpi = .false. ! use clm5 fpi equation - ! Snow in vegetation canopy namelist options. - logical, private :: snowveg_off = .false. ! snowveg_flag = 'OFF' - logical, private :: snowveg_on = .false. ! snowveg_flag = 'ON' - logical, private :: snowveg_onrad = .true. ! snowveg_flag = 'ON_RAD' - ! for now, all mods on by default: - character(len= 10), public :: snowveg_flag = 'ON_RAD' - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine CanopyHydrology_readnl( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for CanopyHydrology - ! - ! !USES: - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'CanopyHydrology_readnl' ! subroutine name - !----------------------------------------------------------------------- - - namelist /clm_canopyhydrology_inparm/ & - oldfflag, & - interception_fraction, & - maximum_leaf_wetted_fraction, & - use_clm5_fpi, & - snowveg_flag - - ! ---------------------------------------------------------------------- - ! Read namelist from standard input. - ! ---------------------------------------------------------------------- - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in clm_CanopyHydrology_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_canopyhydrology_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_canopyhydrology_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_canopyhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_canopyhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - snowveg_off = IsSnowvegFlagOff() - snowveg_on = IsSnowvegFlagOn() - snowveg_onrad = IsSnowvegFlagOnRad() - write(iulog,*) 'snowveg_off = ',snowveg_off - write(iulog,*) 'snowveg_on = ',snowveg_on - write(iulog,*) 'snowveg_onrad = ',snowveg_onrad - if (snowveg_off .or. snowveg_on .or. snowveg_onrad) then - write(iulog,*) 'snowveg_flag = ',snowveg_flag - else - call endrun(msg="snowveg_flag is set incorrectly (not ON, ON_RAD, or OFF)"//errmsg(sourcefile, __LINE__)) - end if - end if - ! Broadcast namelist variables read in - call shr_mpi_bcast(oldfflag, mpicom) - call shr_mpi_bcast(interception_fraction, mpicom) - call shr_mpi_bcast(maximum_leaf_wetted_fraction, mpicom) - call shr_mpi_bcast(use_clm5_fpi, mpicom) - call shr_mpi_bcast(snowveg_flag, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'canopyhydrology settings:' - write(iulog,*) ' interception_fraction = ',interception_fraction - write(iulog,*) ' maximum_leaf_wetted_fraction = ',maximum_leaf_wetted_fraction - write(iulog,*) ' use_clm5_fpi = ',use_clm5_fpi - endif - - end subroutine CanopyHydrology_readnl - - !----------------------------------------------------------------------- - subroutine CanopyHydrology(bounds, & - num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & - atm2lnd_inst, canopystate_inst, temperature_inst, & - aerosol_inst, waterstate_inst, waterflux_inst, irrigation_inst) - ! - ! !DESCRIPTION: - ! Calculation of - ! (1) water storage of intercepted precipitation - ! (2) direct throughfall and canopy drainage of precipitation - ! (3) the fraction of foliage covered by water and the fraction - ! of foliage that is dry and transpiring. - ! (4) snow layer initialization if the snow accumulation exceeds 10 mm. - ! Note: The evaporation loss is taken off after the calculation of leaf - ! temperature in the subroutine clm\_leaftem.f90, not in this subroutine. - ! - ! !USES: - use clm_varcon , only : hfus, denice, zlnd, rpi, spval, tfrz, int_snow_max - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use landunit_varcon , only : istcrop, istwet, istsoil, istice_mec - use clm_varctl , only : subgridflag - use clm_varpar , only : nlevsoi,nlevsno - use clm_time_manager , only : get_step_size - use subgridAveMod , only : p2c - use SnowHydrologyMod , only : NewSnowBulkDensity - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_nolakep ! number of pft non-lake points in pft filter - integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(irrigation_type) , intent(in) :: irrigation_inst - ! - ! !LOCAL VARIABLES: - integer :: f ! filter index - integer :: pi ! patch index - integer :: p ! patch index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! gridcell index - integer :: newnode ! flag when new snow node is set, (1=yes, 0=no) - real(r8) :: dtime ! land model time step (sec) - real(r8) :: h2ocanmx ! maximum allowed water on canopy [mm] - real(r8) :: snocanmx ! maximum allowed snow on canopy [mm equiv. water] - real(r8) :: liqcanmx ! maximum allowed snowliquid water on canopy [mm equiv. water] - real(r8) :: xsnorun ! excess snow that exceeds the leaf capacity [mm/s] - real(r8) :: xliqrun ! excess liquid water - real(r8) :: qflx_snocanfall(bounds%begp:bounds%endp) ! rate of excess canopy snow falling off canopy - real(r8) :: qflx_liqcanfall(bounds%begp:bounds%endp) ! rate of excess canopy liquid falling off canopy - real(r8) :: fpi ! coefficient of interception - real(r8) :: fpisnow ! coefficient of interception for snowfall - real(r8) :: xrun ! excess water that exceeds the leaf capacity [mm/s] - real(r8) :: dz_snowf ! layer thickness rate change due to precipitation [mm/s] - real(r8) :: bifall(bounds%begc:bounds%endc) ! bulk density of newly fallen dry snow [kg/m3] - real(r8) :: fracsnow(bounds%begp:bounds%endp) ! frac of precipitation that is snow - real(r8) :: fracrain(bounds%begp:bounds%endp) ! frac of precipitation that is rain - real(r8) :: qflx_candrip(bounds%begp:bounds%endp) ! rate of canopy runoff and snow falling off canopy [mm/s] - real(r8) :: qflx_through_rain(bounds%begp:bounds%endp) ! direct rain throughfall [mm/s] - real(r8) :: qflx_through_snow(bounds%begp:bounds%endp) ! direct snow throughfall [mm/s] - real(r8) :: qflx_prec_grnd_snow(bounds%begp:bounds%endp) ! snow precipitation incident on ground [mm/s] - real(r8) :: qflx_prec_grnd_rain(bounds%begp:bounds%endp) ! rain precipitation incident on ground [mm/s] - real(r8) :: z_avg ! grid cell average snow depth - real(r8) :: rho_avg ! avg density of snow column - real(r8) :: temp_snow_depth,temp_intsnow ! temporary variables - real(r8) :: fmelt - real(r8) :: smr - real(r8) :: delf_melt - real(r8) :: fsno_new - real(r8) :: accum_factor - real(r8) :: int_snow_limited ! integrated snowfall, limited to be no greater than int_snow_max [mm] - real(r8) :: newsnow(bounds%begc:bounds%endc) - real(r8) :: snowmelt(bounds%begc:bounds%endc) - integer :: j - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - n_melt => col%n_melt , & ! Input: [real(r8) (:) ] SCA shape parameter - zi => col%zi , & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Output: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Output: [real(r8) (:,:) ] layer thickness (m) - - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] rain rate [mm/s] - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] snow rate [mm/s] - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - qflx_floodg => atm2lnd_inst%forc_flood_grc , & ! Input: [real(r8) (:) ] gridcell flux of flood water from RTM - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - dewmx => canopystate_inst%dewmx_patch , & ! Input: [real(r8) (:) ] Maximum allowed dew [mm] - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2ocan => waterstate_inst%h2ocan_patch , & ! Output: [real(r8) (:) ] total canopy water (mm H2O) - snocan => waterstate_inst%snocan_patch , & ! Output: [real(r8) (:) ] canopy snow (mm H2O) - liqcan => waterstate_inst%liqcan_patch , & ! Output: [real(r8) (:) ] canopy liquid (mm H2O) - snounload => waterstate_inst%snounload_patch , & ! Output: [real(r8) (:) ] canopy snow unloading (mm H2O) - h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - h2osno => waterstate_inst%h2osno_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - int_snow => waterstate_inst%int_snow_col , & ! Output: [real(r8) (:) ] integrated snowfall [mm] - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Output: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_sno => waterstate_inst%frac_sno_col , & ! Output: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Output: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_iceold => waterstate_inst%frac_iceold_col , & ! Output: [real(r8) (:,:) ] fraction of ice relative to the tot water - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - swe_old => waterstate_inst%swe_old_col , & ! Output: [real(r8) (:,:) ] snow water before update - - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Output: [real(r8) (:) ] column flux of flood water from RTM - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Input: [real(r8) (:) ] drainage from snow pack from previous time step - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Output: [real(r8) (:) ] snow falling on surface water (mm/s) - qflx_snow_grnd_col => waterflux_inst%qflx_snow_grnd_col , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+] - qflx_snow_grnd_patch => waterflux_inst%qflx_snow_grnd_patch , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+] - qflx_prec_intr => waterflux_inst%qflx_prec_intr_patch , & ! Output: [real(r8) (:) ] interception of precipitation [mm/s] - qflx_prec_grnd => waterflux_inst%qflx_prec_grnd_patch , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)] - qflx_rain_grnd => waterflux_inst%qflx_rain_grnd_patch , & ! Output: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+] - - qflx_irrig => irrigation_inst%qflx_irrig_patch , & ! Input: [real(r8) (:) ] irrigation amount (mm/s) - qflx_snowindunload => waterflux_inst%qflx_snowindunload_patch , & ! Output: [real(r8) (:) ] canopy snow unloading from wind [mm/s] - qflx_snotempunload => waterflux_inst%qflx_snotempunload_patch & ! Output: [real(r8) (:) ] canopy snow unloading from temp. [mm/s] - ) - - ! Compute time step - - dtime = get_step_size() - - ! Set status of snowveg_flag - snowveg_on = IsSnowvegFlagOn() - snowveg_onrad = IsSnowvegFlagOnRad() - - ! Start patch loop - - do f = 1, num_nolakep - p = filter_nolakep(f) - g = patch%gridcell(p) - l = patch%landunit(p) - c = patch%column(p) - - ! Canopy interception and precipitation onto ground surface - ! Add precipitation to leaf water - - if (lun%itype(l)==istsoil .or. lun%itype(l)==istwet .or. lun%urbpoi(l) .or. & - lun%itype(l)==istcrop) then - - qflx_candrip(p) = 0._r8 ! rate of canopy runoff - qflx_snocanfall(p) = 0._r8 ! rate of just snow canopy fall - qflx_liqcanfall(p) = 0._r8 - qflx_snowindunload(p) = 0._r8 - qflx_snotempunload(p) = 0._r8 - snounload(p)=0._r8 - qflx_through_snow(p) = 0._r8 ! rain precipitation direct through canopy - qflx_through_rain(p) = 0._r8 ! snow precipitation direct through canopy - qflx_prec_intr(p) = 0._r8 ! total intercepted precipitation - fracsnow(p) = 0._r8 ! fraction of input precip that is snow - fracrain(p) = 0._r8 ! fraction of input precip that is rain - - - if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall) then - - if (frac_veg_nosno(p) == 1 .and. (forc_rain(c) + forc_snow(c)) > 0._r8) then - - ! determine fraction of input precipitation that is snow and rain - fracsnow(p) = forc_snow(c)/(forc_snow(c) + forc_rain(c)) - fracrain(p) = forc_rain(c)/(forc_snow(c) + forc_rain(c)) - - ! The leaf water capacities for solid and liquid are different, - ! generally double for snow, but these are of somewhat less - ! significance for the water budget because of lower evap. rate at - ! lower temperature. Hence, it is reasonable to assume that - ! vegetation storage of solid water is the same as liquid water. - h2ocanmx = dewmx(p) * (elai(p) + esai(p)) - ! Coefficient of interception - if(use_clm5_fpi) then - fpi = interception_fraction * tanh(elai(p) + esai(p)) - else - fpi = 0.25_r8*(1._r8 - exp(-0.5_r8*(elai(p) + esai(p)))) - endif - - if (snowveg_on .or. snowveg_onrad) then - snocanmx = 60._r8*dewmx(p) * (elai(p) + esai(p)) ! 6*(LAI+SAI) - liqcanmx = h2ocanmx - - fpisnow = (1._r8 - exp(-0.5_r8*(elai(p) + esai(p)))) ! max interception of 1 - ! Direct throughfall - qflx_through_snow(p) = forc_snow(c) * (1._r8-fpisnow) - else - ! Direct throughfall - qflx_through_snow(p) = forc_snow(c) * (1._r8-fpi) - end if - - ! Direct throughfall - qflx_through_rain(p) = forc_rain(c) * (1._r8-fpi) - - if (snowveg_on .or. snowveg_onrad) then - ! Intercepted precipitation [mm/s] - qflx_prec_intr(p) = forc_snow(c)*fpisnow + forc_rain(c)*fpi - ! storage of intercepted snowfall, rain, and dew - snocan(p) = max(0._r8, snocan(p) + dtime*forc_snow(c)*fpisnow) - liqcan(p) = max(0._r8, liqcan(p) + dtime*forc_rain(c)*fpi) - else - ! Intercepted precipitation [mm/s] - qflx_prec_intr(p) = (forc_snow(c) + forc_rain(c)) * fpi - end if - - ! Water storage of intercepted precipitation and dew - h2ocan(p) = max(0._r8, h2ocan(p) + dtime*qflx_prec_intr(p)) - - ! Initialize rate of canopy runoff and snow falling off canopy - qflx_candrip(p) = 0._r8 - qflx_snocanfall(p) = 0._r8 - qflx_liqcanfall(p) = 0._r8 - qflx_snowindunload(p) = 0._r8 - qflx_snotempunload(p) = 0._r8 - snounload(p)=0._r8 - - if (snowveg_on .or. snowveg_onrad) then - if (forc_t(c) > tfrz) then ! Above freezing (Use t_veg?) - xliqrun = (liqcan(p) - liqcanmx)/dtime - if (xliqrun > 0._r8) then - qflx_liqcanfall(p) = xliqrun - liqcan(p) = liqcanmx - end if - else ! Below freezing - xsnorun = (snocan(p) - snocanmx)/dtime - if (xsnorun > 0._r8) then ! exceeds snow capacity - qflx_snocanfall(p) = xsnorun - snocan(p) = snocanmx - end if - end if - qflx_candrip(p) = qflx_snocanfall(p) + qflx_liqcanfall(p) - h2ocan(p) = snocan(p) + liqcan(p) - else - ! Excess water that exceeds the leaf capacity - xrun = (h2ocan(p) - h2ocanmx)/dtime - - ! Test on maximum dew on leaf - ! Note if xrun > 0 then h2ocan must be at least h2ocanmx - if (xrun > 0._r8) then - qflx_candrip(p) = xrun - h2ocan(p) = h2ocanmx - end if - end if - end if - end if - - else if (lun%itype(l)==istice_mec) then - - h2ocan(p) = 0._r8 - qflx_candrip(p) = 0._r8 - qflx_through_snow(p) = 0._r8 - qflx_through_rain(p) = 0._r8 - qflx_prec_intr(p) = 0._r8 - fracsnow(p) = 0._r8 - fracrain(p) = 0._r8 - snocan(p) = 0._r8 - liqcan(p) = 0._r8 - qflx_snocanfall(p) = 0._r8 - qflx_liqcanfall(p) = 0._r8 - qflx_snowindunload(p) = 0._r8 - qflx_snotempunload(p) = 0._r8 - snounload(p)=0._r8 - - end if - - ! Precipitation onto ground (kg/(m2 s)) - - if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall) then - if (frac_veg_nosno(p) == 0) then - qflx_prec_grnd_snow(p) = forc_snow(c) - qflx_prec_grnd_rain(p) = forc_rain(c) - else - if (snowveg_on .or. snowveg_onrad) then - qflx_snowindunload(p)=0._r8 - qflx_snotempunload(p)=0._r8 - snounload(p)=0._r8 - if (snocan(p) > 0._r8) then - qflx_snotempunload(p) = max(0._r8,snocan(p)*(forc_t(c)-270.15_r8)/1.87e5_r8) - qflx_snowindunload(p) = 0.5_r8*snocan(p)*forc_wind(g)/1.56e5_r8 - snounload(p) = (qflx_snowindunload(p)+qflx_snotempunload(p))*dtime ! total canopy unloading in timestep - if ( snounload(p) > snocan(p) ) then ! Limit unloading to snow in canopy - snounload(p) = snocan(p) - write(iulog,"(A,I2.2,A,ES13.4E2)") "snocan",p,": ",snocan(p) - end if - snocan(p) = snocan(p) - snounload(p) - h2ocan(p) = h2ocan(p) - snounload(p) - endif - qflx_prec_grnd_snow(p) = qflx_through_snow(p) + qflx_snocanfall(p) + snounload(p)/dtime - qflx_prec_grnd_rain(p) = qflx_through_rain(p) + qflx_liqcanfall(p) - - else - qflx_prec_grnd_snow(p) = qflx_through_snow(p) + (qflx_candrip(p) * fracsnow(p)) - qflx_prec_grnd_rain(p) = qflx_through_rain(p) + (qflx_candrip(p) * fracrain(p)) - end if - end if - ! Urban sunwall and shadewall have no intercepted precipitation - else - qflx_prec_grnd_snow(p) = 0. - qflx_prec_grnd_rain(p) = 0. - end if - - ! Add irrigation water directly onto ground (bypassing canopy interception) - ! Note that it's still possible that (some of) this irrigation water will runoff (as runoff is computed later) - qflx_prec_grnd_rain(p) = qflx_prec_grnd_rain(p) + qflx_irrig(p) - - qflx_prec_grnd(p) = qflx_prec_grnd_snow(p) + qflx_prec_grnd_rain(p) - - qflx_snow_grnd_patch(p) = qflx_prec_grnd_snow(p) ! ice onto ground (mm/s) - qflx_rain_grnd(p) = qflx_prec_grnd_rain(p) ! liquid water onto ground (mm/s) - - end do ! (end patch loop) - - ! Determine the fraction of foliage covered by water and the - ! fraction of foliage that is dry and transpiring. - - call FracWet(num_nolakep, filter_nolakep, & - canopystate_inst, waterstate_inst) - - ! Update column level state variables for snow. - - call p2c(bounds, num_nolakec, filter_nolakec, & - qflx_snow_grnd_patch(bounds%begp:bounds%endp), & - qflx_snow_grnd_col(bounds%begc:bounds%endc)) - - ! apply gridcell flood water flux to non-lake columns - do f = 1, num_nolakec - c = filter_nolakec(f) - g = col%gridcell(c) - if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall) then - qflx_floodc(c) = qflx_floodg(g) - else - qflx_floodc(c) = 0._r8 - endif - enddo - - ! Determine snow height and snow water - - call NewSnowBulkDensity(bounds, num_nolakec, filter_nolakec, & - atm2lnd_inst, bifall(bounds%begc:bounds%endc)) - - do f = 1, num_nolakec - c = filter_nolakec(f) - l = col%landunit(c) - g = col%gridcell(c) - - ! Use Alta relationship, Anderson(1976); LaChapelle(1961), - ! U.S.Department of Agriculture Forest Service, Project F, - ! Progress Rep. 1, Alta Avalanche Study Center:Snow Layer Densification. - - qflx_snow_h2osfc(c) = 0._r8 - ! set temporary variables prior to updating - temp_snow_depth=snow_depth(c) - ! save initial snow content - do j= -nlevsno+1,snl(c) - swe_old(c,j) = 0.0_r8 - end do - do j= snl(c)+1,0 - swe_old(c,j)=h2osoi_liq(c,j)+h2osoi_ice(c,j) - enddo - - ! all snow falls on ground, no snow on h2osfc - newsnow(c) = qflx_snow_grnd_col(c) * dtime - - ! update int_snow - int_snow(c) = max(int_snow(c),h2osno(c)) !h2osno could be larger due to frost - - ! snowmelt from previous time step * dtime - snowmelt(c) = qflx_snow_drain(c) * dtime - - ! set shape factor for accumulation of snow - accum_factor=0.1 - - if (h2osno(c) > 0.0) then - - !====================== FSCA PARAMETERIZATIONS ====================== - ! fsca parameterization based on *changes* in swe - ! first compute change from melt during previous time step - if(snowmelt(c) > 0._r8) then - - int_snow_limited = min(int_snow(c), int_snow_max) - smr=min(1._r8,h2osno(c)/int_snow_limited) - - frac_sno(c) = 1. - (acos(min(1._r8,(2.*smr - 1._r8)))/rpi)**(n_melt(c)) - - endif - - ! update fsca by new snow event, add to previous fsca - if (newsnow(c) > 0._r8) then - fsno_new = 1._r8 - (1._r8 - tanh(accum_factor*newsnow(c)))*(1._r8 - frac_sno(c)) - frac_sno(c) = fsno_new - - ! reset int_snow after accumulation events - temp_intsnow= (h2osno(c) + newsnow(c)) & - / (0.5*(cos(rpi*(1._r8-max(frac_sno(c),1e-6_r8))**(1./n_melt(c)))+1._r8)) - int_snow(c) = min(1.e8_r8,temp_intsnow) - endif - - !==================================================================== - - ! for subgrid fluxes - if (subgridflag ==1 .and. .not. lun%urbpoi(l)) then - if (frac_sno(c) > 0._r8)then - snow_depth(c)=snow_depth(c) + newsnow(c)/(bifall(c) * frac_sno(c)) - else - snow_depth(c)=0._r8 - end if - else - ! for uniform snow cover - snow_depth(c)=snow_depth(c)+newsnow(c)/bifall(c) - endif - - ! use original fsca formulation (n&y 07) - if (oldfflag == 1) then - ! snow cover fraction in Niu et al. 2007 - if(snow_depth(c) > 0.0_r8) then - frac_sno(c) = tanh(snow_depth(c)/(2.5_r8*zlnd* & - (min(800._r8,(h2osno(c)+ newsnow(c))/snow_depth(c))/100._r8)**1._r8) ) - endif - if(h2osno(c) < 1.0_r8) then - frac_sno(c)=min(frac_sno(c),h2osno(c)) - endif - endif - - else !h2osno == 0 - ! initialize frac_sno and snow_depth when no snow present initially - if (newsnow(c) > 0._r8) then - z_avg = newsnow(c)/bifall(c) - fmelt=newsnow(c) - frac_sno(c) = tanh(accum_factor*newsnow(c)) - - ! make int_snow consistent w/ new fsno, h2osno - int_snow(c) = 0. !reset prior to adding newsnow below - temp_intsnow= (h2osno(c) + newsnow(c)) & - / (0.5*(cos(rpi*(1._r8-max(frac_sno(c),1e-6_r8))**(1./n_melt(c)))+1._r8)) - int_snow(c) = min(1.e8_r8,temp_intsnow) - - ! update snow_depth and h2osno to be consistent with frac_sno, z_avg - if (subgridflag ==1 .and. .not. lun%urbpoi(l)) then - snow_depth(c)=z_avg/frac_sno(c) - else - snow_depth(c)=newsnow(c)/bifall(c) - endif - ! use n&y07 formulation - if (oldfflag == 1) then - ! snow cover fraction in Niu et al. 2007 - if(snow_depth(c) > 0.0_r8) then - frac_sno(c) = tanh(snow_depth(c)/(2.5_r8*zlnd* & - (min(800._r8,newsnow(c)/snow_depth(c))/100._r8)**1._r8) ) - endif - endif - else - z_avg = 0._r8 - snow_depth(c) = 0._r8 - frac_sno(c) = 0._r8 - endif - endif ! end of h2osno > 0 - - ! no snow on surface water - qflx_snow_h2osfc(c) = 0._r8 - - ! update h2osno for new snow - h2osno(c) = h2osno(c) + newsnow(c) - int_snow(c) = int_snow(c) + newsnow(c) - - ! update change in snow depth - dz_snowf = (snow_depth(c) - temp_snow_depth) / dtime - - ! set frac_sno_eff variable - if (.not. lun%urbpoi(l)) then - if (subgridflag ==1) then - frac_sno_eff(c) = frac_sno(c) - else - frac_sno_eff(c) = 1._r8 - endif - else - frac_sno_eff(c) = 1._r8 - endif - - if (lun%itype(l)==istwet .and. t_grnd(c)>tfrz) then - h2osno(c)=0._r8 - snow_depth(c)=0._r8 - end if - - ! When the snow accumulation exceeds 10 mm, initialize snow layer - ! Currently, the water temperature for the precipitation is simply set - ! as the surface air temperature - - newnode = 0 ! flag for when snow node will be initialized - if (snl(c) == 0 .and. frac_sno(c)*snow_depth(c) >= 0.01_r8) then - newnode = 1 - snl(c) = -1 - dz(c,0) = snow_depth(c) ! meter - z(c,0) = -0.5_r8*dz(c,0) - zi(c,-1) = -dz(c,0) - t_soisno(c,0) = min(tfrz, forc_t(c)) ! K - h2osoi_ice(c,0) = h2osno(c) ! kg/m2 - h2osoi_liq(c,0) = 0._r8 ! kg/m2 - frac_iceold(c,0) = 1._r8 - - ! intitialize SNICAR variables for fresh snow: - call aerosol_inst%Reset(column=c) - call waterstate_inst%Reset(column=c) - end if - - ! The change of ice partial density of surface node due to precipitation. - ! Only ice part of snowfall is added here, the liquid part will be added - ! later. - - if (snl(c) < 0 .and. newnode == 0) then - h2osoi_ice(c,snl(c)+1) = h2osoi_ice(c,snl(c)+1)+newsnow(c) - dz(c,snl(c)+1) = dz(c,snl(c)+1)+dz_snowf*dtime - end if - - end do - - ! update surface water fraction (this may modify frac_sno) - call FracH2oSfc(bounds, num_nolakec, filter_nolakec, & - waterstate_inst) - - end associate - - end subroutine CanopyHydrology - - !----------------------------------------------------------------------- - subroutine FracWet(numf, filter, canopystate_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Determine fraction of vegetated surfaces which are wet and - ! fraction of elai which is dry. The variable ``fwet'' is the - ! fraction of all vegetation surfaces which are wet including - ! stem area which contribute to evaporation. The variable ``fdry'' - ! is the fraction of elai which is dry because only leaves - ! can transpire. Adjusted for stem area which does not transpire. - ! - ! ! USES: - use clm_varcon , only : tfrz - ! !ARGUMENTS: - integer , intent(in) :: numf ! number of filter non-lake points - integer , intent(in) :: filter(numf) ! patch filter for non-lake points - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,p ! indices - real(r8) :: vegt ! lsai - real(r8) :: dewmxi ! inverse of maximum allowed dew [1/mm] - !----------------------------------------------------------------------- - - associate( & - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:)] fraction of veg not covered by snow (0/1 now) [-] - dewmx => canopystate_inst%dewmx_patch , & ! Input: [real(r8) (:) ] Maximum allowed dew [mm] - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - - h2ocan => waterstate_inst%h2ocan_patch , & ! Input: [real(r8) (:) ] total canopy water (mm H2O) - snocan => waterstate_inst%snocan_patch , & ! Output: [real(r8) (:) ] canopy snow (mm H2O) - liqcan => waterstate_inst%liqcan_patch , & ! Output: [real(r8) (:) ] canopy liquid (mm H2O) - - fwet => waterstate_inst%fwet_patch , & ! Output: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) - fcansno => waterstate_inst%fcansno_patch , & ! Output: [real(r8) (:) ] fraction of canopy that is snow covered (0 to 1) - fdry => waterstate_inst%fdry_patch & ! Output: [real(r8) (:) ] fraction of foliage that is green and dry [-] (new) - ) - - ! Set status of snowveg_flag - snowveg_onrad = IsSnowvegFlagOnRad() - - do fp = 1,numf - p = filter(fp) - if (frac_veg_nosno(p) == 1) then - if (h2ocan(p) > 0._r8) then - vegt = frac_veg_nosno(p)*(elai(p) + esai(p)) - dewmxi = 1.0_r8/dewmx(p) - fwet(p) = ((dewmxi/vegt)*h2ocan(p))**0.666666666666_r8 - fwet(p) = min (fwet(p),maximum_leaf_wetted_fraction) ! Check for maximum limit of fwet - if (snowveg_onrad) then - if (snocan(p) > 0._r8) then - dewmxi = 1.0_r8/dewmx(p) - fcansno(p) = ((dewmxi/(vegt*6.0_r8*10.0_r8))*snocan(p))**0.15_r8 ! must match snocanmx - fcansno(p) = min (fcansno(p),1.0_r8) - else - fcansno(p) = 0._r8 - end if - else - fcansno(p) = 0._r8 - end if - else - fwet(p) = 0._r8 - fcansno(p) = 0._r8 - end if - fdry(p) = (1._r8-fwet(p))*elai(p)/(elai(p)+esai(p)) - else - fwet(p) = 0._r8 - fdry(p) = 0._r8 - end if - end do - - end associate - end subroutine FracWet - - !----------------------------------------------------------------------- - subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, & - waterstate_inst, no_update) - ! - ! !DESCRIPTION: - ! Determine fraction of land surfaces which are submerged - ! based on surface microtopography and surface water storage. - ! - ! !USES: - use shr_const_mod , only : shr_const_pi - use shr_spfn_mod , only : erf => shr_spfn_erf - use landunit_varcon , only : istsoil, istcrop - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_h2osfc ! number of column points in column filter - integer , intent(in) :: filter_h2osfc(:) ! column filter - type(waterstate_type) , intent(inout) :: waterstate_inst - integer , intent(in), optional :: no_update ! flag to make calculation w/o updating variables - ! - ! !LOCAL VARIABLES: - integer :: c,f,l ! indices - real(r8):: d,fd,dfdd ! temporary variable for frac_h2o iteration - real(r8):: sigma ! microtopography pdf sigma in mm - real(r8):: min_h2osfc - !----------------------------------------------------------------------- - - associate( & - micro_sigma => col%micro_sigma , & ! Input: [real(r8) (:) ] microtopography pdf sigma (m) - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (col,lyr) [kg/m2] - h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - frac_sno => waterstate_inst%frac_sno_col , & ! Output: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Output: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col, & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero - frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) - ) - - ! arbitrary lower limit on h2osfc for safer numerics... - min_h2osfc=1.e-8_r8 - - do f = 1, num_h2osfc - c = filter_h2osfc(f) - l = col%landunit(c) - - ! h2osfc only calculated for soil vegetated land units - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - ! Use newton-raphson method to iteratively determine frac_h2osfc - ! based on amount of surface water storage (h2osfc) and - ! microtopography variability (micro_sigma) - - if (h2osfc(c) > min_h2osfc) then - ! a cutoff is needed for numerical reasons...(nonconvergence after 5 iterations) - d=0.0 - - sigma=1.0e3 * micro_sigma(c) ! convert to mm - do l=1,10 - fd = 0.5*d*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) & - +sigma/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*sigma**2)) & - -h2osfc(c) - dfdd = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) - - d = d - fd/dfdd - enddo - !-- update the submerged areal fraction using the new d value - frac_h2osfc(c) = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) - - else - frac_h2osfc(c) = 0._r8 - h2osoi_liq(c,1) = h2osoi_liq(c,1) + h2osfc(c) - h2osfc(c)=0._r8 - endif - - frac_h2osfc_nosnow(c) = frac_h2osfc(c) - - - if (.not. present(no_update)) then - - ! adjust fh2o, fsno when sum is greater than zero - if (frac_sno(c) > (1._r8 - frac_h2osfc(c)) .and. h2osno(c) > 0) then - - if (frac_h2osfc(c) > 0.01_r8) then - frac_h2osfc(c) = max(1.0_r8 - frac_sno(c),0.01_r8) - frac_sno(c) = 1.0_r8 - frac_h2osfc(c) - else - frac_sno(c) = 1.0_r8 - frac_h2osfc(c) - endif - frac_sno_eff(c)=frac_sno(c) - - endif - - endif ! end of no_update construct - - else !if landunit not istsoil/istcrop, set frac_h2osfc to zero - - frac_h2osfc(c) = 0._r8 - - endif - - end do - - end associate - - end subroutine FracH2OSfc - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: IsSnowvegFlagOff - ! - ! !INTERFACE: - ! - logical function IsSnowvegFlagOff( ) - ! - ! !DESCRIPTION: - ! - ! Return true if snowveg_flag is OFF - ! - ! !USES: - implicit none - !EOP - !----------------------------------------------------------------------- - - IsSnowvegFlagOff = (trim(snowveg_flag) == 'OFF') - - end function IsSnowvegFlagOff - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: IsSnowvegFlagOn - ! - ! !INTERFACE: - ! - logical function IsSnowvegFlagOn( ) - ! - ! !DESCRIPTION: - ! - ! Return true if snowveg_flag is ON - ! - ! !USES: - implicit none - !EOP - !----------------------------------------------------------------------- - - IsSnowvegFlagOn = (trim(snowveg_flag) == 'ON') - - end function IsSnowvegFlagOn - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: IsSnowvegFlagOnRad - ! - ! !INTERFACE: - ! - logical function IsSnowvegFlagOnRad( ) - ! - ! !DESCRIPTION: - ! - ! Return true if snowveg_flag is ON_RAD - ! - ! !USES: - implicit none - !EOP - !----------------------------------------------------------------------- - - IsSnowvegFlagOnRad = (trim(snowveg_flag) == 'ON_RAD') - - end function IsSnowvegFlagOnRad - -end module CanopyHydrologyMod diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 deleted file mode 100644 index bfb5196d79..0000000000 --- a/src/biogeophys/CanopyStateType.F90 +++ /dev/null @@ -1,640 +0,0 @@ -module CanopyStateType - - !------------------------------------------------------------------------------ - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, shr_infnan_isnan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use landunit_varcon , only : istsoil, istcrop - use clm_varpar , only : nlevcan, nvegwcs - use clm_varcon , only : spval - use clm_varctl , only : iulog, use_cn, use_fates, use_hydrstress - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - save - private - ! - ! !PUBLIC TYPES: - type, public :: CanopyState_type - - integer , pointer :: frac_veg_nosno_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] - integer , pointer :: frac_veg_nosno_alb_patch (:) ! patch fraction of vegetation not covered by snow (0 OR 1) [-] - - real(r8) , pointer :: tlai_patch (:) ! patch canopy one-sided leaf area index, no burying by snow - real(r8) , pointer :: tsai_patch (:) ! patch canopy one-sided stem area index, no burying by snow - real(r8) , pointer :: elai_patch (:) ! patch canopy one-sided leaf area index with burying by snow - real(r8) , pointer :: esai_patch (:) ! patch canopy one-sided stem area index with burying by snow - real(r8) , pointer :: elai240_patch (:) ! patch canopy one-sided leaf area index with burying by snow average over 10days - real(r8) , pointer :: laisun_patch (:) ! patch patch sunlit projected leaf area index - real(r8) , pointer :: laisha_patch (:) ! patch patch shaded projected leaf area index - real(r8) , pointer :: laisun_z_patch (:,:) ! patch patch sunlit leaf area for canopy layer - real(r8) , pointer :: laisha_z_patch (:,:) ! patch patch shaded leaf area for canopy layer - real(r8) , pointer :: mlaidiff_patch (:) ! patch difference between lai month one and month two (for dry deposition of chemical tracers) - real(r8) , pointer :: annlai_patch (:,:) ! patch 12 months of monthly lai from input data set (for dry deposition of chemical tracers) - real(r8) , pointer :: htop_patch (:) ! patch canopy top (m) - real(r8) , pointer :: hbot_patch (:) ! patch canopy bottom (m) - real(r8) , pointer :: displa_patch (:) ! patch displacement height (m) - real(r8) , pointer :: fsun_patch (:) ! patch sunlit fraction of canopy - real(r8) , pointer :: fsun24_patch (:) ! patch 24hr average of sunlit fraction of canopy - real(r8) , pointer :: fsun240_patch (:) ! patch 240hr average of sunlit fraction of canopy - - real(r8) , pointer :: alt_col (:) ! col current depth of thaw - integer , pointer :: alt_indx_col (:) ! col current depth of thaw - real(r8) , pointer :: altmax_col (:) ! col maximum annual depth of thaw - real(r8) , pointer :: altmax_lastyear_col (:) ! col prior year maximum annual depth of thaw - integer , pointer :: altmax_indx_col (:) ! col maximum annual depth of thaw - integer , pointer :: altmax_lastyear_indx_col (:) ! col prior year maximum annual depth of thaw - - real(r8) , pointer :: dewmx_patch (:) ! patch maximum allowed dew [mm] - real(r8) , pointer :: dleaf_patch (:) ! patch characteristic leaf width (diameter) [m] - ! for non-ED/FATES this is the same as pftcon%dleaf() - real(r8) , pointer :: rscanopy_patch (:) ! patch canopy stomatal resistance (s/m) (ED specific) - - real(r8) , pointer :: vegwp_patch (:,:) ! patch vegetation water matric potential (mm) - - real(r8) :: leaf_mr_vcm = spval ! Scalar constant of leaf respiration with Vcmax - - contains - - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: ReadNML - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - procedure, public :: Restart - - end type CanopyState_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - if ( this%leaf_mr_vcm == spval ) then - call endrun(msg="ERROR canopystate Init called before ReadNML"//errmsg(sourcefile, __LINE__)) - end if - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - allocate(this%frac_veg_nosno_patch (begp:endp)) ; this%frac_veg_nosno_patch (:) = huge(1) - allocate(this%frac_veg_nosno_alb_patch (begp:endp)) ; this%frac_veg_nosno_alb_patch (:) = 0 - allocate(this%tlai_patch (begp:endp)) ; this%tlai_patch (:) = nan - allocate(this%tsai_patch (begp:endp)) ; this%tsai_patch (:) = nan - allocate(this%elai_patch (begp:endp)) ; this%elai_patch (:) = nan - allocate(this%elai240_patch (begp:endp)) ; this%elai240_patch (:) = nan - allocate(this%esai_patch (begp:endp)) ; this%esai_patch (:) = nan - allocate(this%laisun_patch (begp:endp)) ; this%laisun_patch (:) = nan - allocate(this%laisha_patch (begp:endp)) ; this%laisha_patch (:) = nan - allocate(this%laisun_z_patch (begp:endp,1:nlevcan)) ; this%laisun_z_patch (:,:) = nan - allocate(this%laisha_z_patch (begp:endp,1:nlevcan)) ; this%laisha_z_patch (:,:) = nan - allocate(this%mlaidiff_patch (begp:endp)) ; this%mlaidiff_patch (:) = nan - allocate(this%annlai_patch (12,begp:endp)) ; this%annlai_patch (:,:) = nan - allocate(this%htop_patch (begp:endp)) ; this%htop_patch (:) = nan - allocate(this%hbot_patch (begp:endp)) ; this%hbot_patch (:) = nan - allocate(this%displa_patch (begp:endp)) ; this%displa_patch (:) = nan - allocate(this%fsun_patch (begp:endp)) ; this%fsun_patch (:) = nan - allocate(this%fsun24_patch (begp:endp)) ; this%fsun24_patch (:) = nan - allocate(this%fsun240_patch (begp:endp)) ; this%fsun240_patch (:) = nan - - allocate(this%alt_col (begc:endc)) ; this%alt_col (:) = spval - allocate(this%altmax_col (begc:endc)) ; this%altmax_col (:) = spval - allocate(this%altmax_lastyear_col (begc:endc)) ; this%altmax_lastyear_col (:) = spval - allocate(this%alt_indx_col (begc:endc)) ; this%alt_indx_col (:) = huge(1) - allocate(this%altmax_indx_col (begc:endc)) ; this%altmax_indx_col (:) = huge(1) - allocate(this%altmax_lastyear_indx_col (begc:endc)) ; this%altmax_lastyear_indx_col (:) = huge(1) - - allocate(this%dewmx_patch (begp:endp)) ; this%dewmx_patch (:) = nan - allocate(this%dleaf_patch (begp:endp)) ; this%dleaf_patch (:) = nan - allocate(this%rscanopy_patch (begp:endp)) ; this%rscanopy_patch (:) = nan -! allocate(this%gccanopy_patch (begp:endp)) ; this%gccanopy_patch (:) = 0.0_r8 - allocate(this%vegwp_patch (begp:endp,1:nvegwcs)) ; this%vegwp_patch (:,:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod , only: hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begp, endp - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - this%elai_patch(begp:endp) = spval - call hist_addfld1d (fname='ELAI', units='m^2/m^2', & - avgflag='A', long_name='exposed one-sided leaf area index', & - ptr_patch=this%elai_patch) - - this%esai_patch(begp:endp) = spval - call hist_addfld1d (fname='ESAI', units='m^2/m^2', & - avgflag='A', long_name='exposed one-sided stem area index', & - ptr_patch=this%esai_patch) - - this%tlai_patch(begp:endp) = spval - call hist_addfld1d (fname='TLAI', units='m^2/m^2', & - avgflag='A', long_name='total projected leaf area index', & - ptr_patch=this%tlai_patch) - - this%tsai_patch(begp:endp) = spval - call hist_addfld1d (fname='TSAI', units='m^2/m^2', & - avgflag='A', long_name='total projected stem area index', & - ptr_patch=this%tsai_patch) - - this%laisun_patch(begp:endp) = spval - call hist_addfld1d (fname='LAISUN', units='m^2/m^2', & - avgflag='A', long_name='sunlit projected leaf area index', & - ptr_patch=this%laisun_patch, set_urb=0._r8) - - this%laisha_patch(begp:endp) = spval - call hist_addfld1d (fname='LAISHA', units='m^2/m^2', & - avgflag='A', long_name='shaded projected leaf area index', & - ptr_patch=this%laisha_patch, set_urb=0._r8) - - if (use_cn .or. use_fates) then - this%fsun_patch(begp:endp) = spval - call hist_addfld1d (fname='FSUN', units='proportion', & - avgflag='A', long_name='sunlit fraction of canopy', & - ptr_patch=this%fsun_patch, default='inactive') - - this%dewmx_patch(begp:endp) = spval - call hist_addfld1d (fname='DEWMX', units='mm', & - avgflag='A', long_name='Maximum allowed dew', & - ptr_patch=this%dewmx_patch, default='inactive') - - this%htop_patch(begp:endp) = spval - call hist_addfld1d (fname='HTOP', units='m', & - avgflag='A', long_name='canopy top', & - ptr_patch=this%htop_patch) - - this%hbot_patch(begp:endp) = spval - call hist_addfld1d (fname='HBOT', units='m', & - avgflag='A', long_name='canopy bottom', & - ptr_patch=this%hbot_patch, default='inactive') - - this%displa_patch(begp:endp) = spval - call hist_addfld1d (fname='DISPLA', units='m', & - avgflag='A', long_name='displacement height', & - ptr_patch=this%displa_patch, default='inactive') - end if - - if (use_cn) then - this%alt_col(begc:endc) = spval - call hist_addfld1d (fname='ALT', units='m', & - avgflag='A', long_name='current active layer thickness', & - ptr_col=this%alt_col) - - this%altmax_col(begc:endc) = spval - call hist_addfld1d (fname='ALTMAX', units='m', & - avgflag='A', long_name='maximum annual active layer thickness', & - ptr_col=this%altmax_col) - - this%altmax_lastyear_col(begc:endc) = spval - call hist_addfld1d (fname='ALTMAX_LASTYEAR', units='m', & - avgflag='A', long_name='maximum prior year active layer thickness', & - ptr_col=this%altmax_lastyear_col, default='inactive') - end if - - ! Allow active layer fields to be optionally output even if not running CN - - if (.not. use_cn) then - this%alt_col(begc:endc) = spval - call hist_addfld1d (fname='ALT', units='m', & - avgflag='A', long_name='current active layer thickness', & - ptr_col=this%alt_col, default='inactive') - - this%altmax_col(begc:endc) = spval - call hist_addfld1d (fname='ALTMAX', units='m', & - avgflag='A', long_name='maximum annual active layer thickness', & - ptr_col=this%altmax_col, default='inactive') - - this%altmax_lastyear_col(begc:endc) = spval - call hist_addfld1d (fname='ALTMAX_LASTYEAR', units='m', & - avgflag='A', long_name='maximum prior year active layer thickness', & - ptr_col=this%altmax_lastyear_col, default='inactive') - end if - - - - ! Accumulated fields - this%fsun24_patch(begp:endp) = spval - call hist_addfld1d (fname='FSUN24', units='K', & - avgflag='A', long_name='fraction sunlit (last 24hrs)', & - ptr_patch=this%fsun24_patch, default='inactive') - - this%fsun240_patch(begp:endp) = spval - call hist_addfld1d (fname='FSUN240', units='K', & - avgflag='A', long_name='fraction sunlit (last 240hrs)', & - ptr_patch=this%fsun240_patch, default='inactive') - - this%elai240_patch(begp:endp) = spval - call hist_addfld1d (fname='LAI240', units='m^2/m^2', & - avgflag='A', long_name='240hr average of leaf area index', & - ptr_patch=this%elai240_patch, default='inactive') - - ! Ed specific field - if ( use_fates ) then - this%rscanopy_patch(begp:endp) = spval - call hist_addfld1d (fname='RSCANOPY', units=' s m-1', & - avgflag='A', long_name='canopy resistance', & - ptr_patch=this%rscanopy_patch, set_lake=0._r8, set_urb=0._r8) - end if - -! call hist_addfld1d (fname='GCCANOPY', units='none', & -! avgflag='A', long_name='Canopy Conductance: mmol m-2 s-1', & -! ptr_patch=this%GCcanopy_patch, set_lake=0._r8, set_urb=0._r8) - - if ( use_hydrstress ) then - this%vegwp_patch(begp:endp,:) = spval - call hist_addfld2d (fname='VEGWP', units='mm', type2d='nvegwcs', & - avgflag='A', long_name='vegetation water matric potential for sun/sha canopy,xyl,root segments', & - ptr_patch=this%vegwp_patch) - end if - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! - ! !USES - use accumulMod , only : init_accum_field - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - !--------------------------------------------------------------------- - - this%fsun24_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSUN24', units='fraction', & - desc='24hr average of diffuse solar radiation', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%fsun240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSUN240', units='fraction', & - desc='240hr average of diffuse solar radiation', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%elai240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='LAI240', units='m2/m2', & - desc='240hr average of leaf area index', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES - use accumulMod , only : extract_accum_field - use clm_time_manager , only : get_nstep - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: nstep - integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg="extract_accum_hist allocation error for rbufslp"//& - errMsg(sourcefile, __LINE__)) - endif - - ! Determine time step - nstep = get_nstep() - - call extract_accum_field ('FSUN24', rbufslp, nstep) - this%fsun24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('FSUN240', rbufslp, nstep) - this%fsun240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('LAI240', rbufslp, nstep) - this%elai240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('FSUN24', rbufslp, nstep) - this%fsun24_patch(begp:endp) = rbufslp(begp:endp) - - deallocate(rbufslp) - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine ReadNML( this, NLFilename ) - ! - ! Read in canopy parameter namelist - ! - ! USES: - use shr_mpi_mod , only : shr_mpi_bcast - use abortutils , only : endrun - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! ARGUMENTS: - implicit none - class(canopystate_type) :: this - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - real(r8) :: leaf_mr_vcm ! Scalar of leaf respiration to vcmax - character(len=32) :: subname = 'CanopyStateType::ReadNML' ! subroutine name - !----------------------------------------------------------------------- - namelist / clm_canopy_inparm / leaf_mr_vcm - - ! ---------------------------------------------------------------------- - ! Read namelist from input namelist filename - ! ---------------------------------------------------------------------- - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in clm_canopy_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_canopy_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_canopy_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_canopy_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_canopy_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - ! Broadcast namelist variables read in - call shr_mpi_bcast(leaf_mr_vcm, mpicom) - this%leaf_mr_vcm = leaf_mr_vcm - - end subroutine ReadNML - - !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) - ! - ! USES - use clm_time_manager, only : get_nstep - use accumulMod , only : update_accum_field, extract_accum_field - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,p ! indices - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: ier ! error status - integer :: begp, endp - real(r8), pointer :: rbufslp(:) ! temporary single level - patch level - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - nstep = get_nstep() - - ! Allocate needed dynamic memory for single level patch field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - ! Accumulate and extract fsun24 & fsun240 - do p = begp,endp - rbufslp(p) = this%fsun_patch(p) - end do - call update_accum_field ('FSUN24' , rbufslp , nstep) - call extract_accum_field ('FSUN24' , this%fsun24_patch , nstep) - call update_accum_field ('FSUN240', rbufslp , nstep) - call extract_accum_field ('FSUN240', this%fsun240_patch , nstep) - - ! Accumulate and extract elai240 - do p = begp,endp - rbufslp(p) = this%elai_patch(p) - end do - call update_accum_field ('LAI240', rbufslp , nstep) - call extract_accum_field ('LAI240', this%elai240_patch , nstep) - - deallocate(rbufslp) - - end subroutine UpdateAccVars - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,l,c,g - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - l = patch%landunit(p) - - this%frac_veg_nosno_patch(p) = 0._r8 - this%tlai_patch(p) = 0._r8 - this%tsai_patch(p) = 0._r8 - this%elai_patch(p) = 0._r8 - this%esai_patch(p) = 0._r8 - this%htop_patch(p) = 0._r8 - this%hbot_patch(p) = 0._r8 - this%dewmx_patch(p) = 0.1_r8 - this%vegwp_patch(p,:) = -2.5e4_r8 - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%laisun_patch(p) = 0._r8 - this%laisha_patch(p) = 0._r8 - end if - - ! needs to be initialized to spval to avoid problems when averaging for the accum - ! field - this%fsun_patch(p) = spval - end do - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%alt_col(c) = 0._r8 !iniitialized to spval for all columns - this%altmax_col(c) = 0._r8 !iniitialized to spval for all columns - this%altmax_lastyear_col(c) = 0._r8 !iniitialized to spval for all columns - this%alt_indx_col(c) = 0 !initiialized to huge for all columns - this%altmax_indx_col(c) = 0 !initiialized to huge for all columns - this%altmax_lastyear_indx_col = 0 !initiialized to huge for all columns - end if - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(canopystate_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,p,c,iv ! indices - logical :: readvar ! determine if variable is on initial file - integer :: begp, endp - !----------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - call restartvar(ncid=ncid, flag=flag, varname='FRAC_VEG_NOSNO_ALB', xtype=ncd_int, & - dim1name='pft', long_name='fraction of vegetation not covered by snow (0 or 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frac_veg_nosno_alb_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tlai', xtype=ncd_double, & - dim1name='pft', long_name='one-sided leaf area index, no burying by snow', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tlai_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tsai', xtype=ncd_double, & - dim1name='pft', long_name='one-sided stem area index, no burying by snow', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tsai_patch) - - call restartvar(ncid=ncid, flag=flag, varname='elai', xtype=ncd_double, & - dim1name='pft', long_name='one-sided leaf area index, with burying by snow', units='', & - interpinic_flag='interp', readvar=readvar, data=this%elai_patch) - - call restartvar(ncid=ncid, flag=flag, varname='esai', xtype=ncd_double, & - dim1name='pft', long_name='one-sided stem area index, with burying by snow', units='', & - interpinic_flag='interp', readvar=readvar, data=this%esai_patch) - - call restartvar(ncid=ncid, flag=flag, varname='htop', xtype=ncd_double, & - dim1name='pft', long_name='canopy top', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%htop_patch) - - call restartvar(ncid=ncid, flag=flag, varname='hbot', xtype=ncd_double, & - dim1name='pft', long_name='canopy botton', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%hbot_patch) - - call restartvar(ncid=ncid, flag=flag, varname='mlaidiff', xtype=ncd_double, & - dim1name='pft', long_name='difference between lai month one and month two', units='', & - interpinic_flag='interp', readvar=readvar, data=this%mlaidiff_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fsun', xtype=ncd_double, & - dim1name='pft', long_name='sunlit fraction of canopy', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fsun_patch) - - if (flag=='read' )then - do p = bounds%begp,bounds%endp - if (shr_infnan_isnan(this%fsun_patch(p)) ) then - this%fsun_patch(p) = spval - end if - end do - end if - - if (use_cn .or. use_fates) then - call restartvar(ncid=ncid, flag=flag, varname='altmax', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%altmax_col) - - call restartvar(ncid=ncid, flag=flag, varname='altmax_lastyear', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%altmax_lastyear_col) - - call restartvar(ncid=ncid, flag=flag, varname='altmax_indx', xtype=ncd_int, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%altmax_indx_col) - - call restartvar(ncid=ncid, flag=flag, varname='altmax_lastyear_indx', xtype=ncd_int, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%altmax_lastyear_indx_col) - end if - - if ( use_hydrstress ) then - call restartvar(ncid=ncid, flag=flag, varname='vegwp', xtype=ncd_double, & - dim1name='pft', dim2name='vegwcs', switchdim=.true., & - long_name='vegetation water matric potential', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) - - end if - - end subroutine Restart - -end module CanopyStateType diff --git a/src/biogeophys/CanopyTemperatureMod.F90 b/src/biogeophys/CanopyTemperatureMod.F90 deleted file mode 100644 index de9c977f93..0000000000 --- a/src/biogeophys/CanopyTemperatureMod.F90 +++ /dev/null @@ -1,502 +0,0 @@ -module CanopyTemperatureMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! CanopyFluxes calculates the leaf temperature and the leaf fluxes, - ! transpiration, photosynthesis and updates the dew accumulation due to evaporation. - ! CanopyTemperature performs calculation of leaf temperature and surface fluxes. - ! SoilFluxes then determines soil/snow and ground temperatures and updates the surface - ! fluxes for the new ground temperature. - - ! - ! !USES: - use shr_sys_mod , only : shr_sys_flush - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_const_mod , only : SHR_CONST_PI - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, use_fates - use PhotosynthesisMod , only : Photosynthesis, PhotosynthesisTotal, Fractionation - use SurfaceResistanceMod , only : calc_soilevap_resis - use pftconMod , only : pftcon - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: CanopyTemperature - !------------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------------ - subroutine CanopyTemperature(bounds, & - num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & - clm_fates, & - atm2lnd_inst, canopystate_inst, soilstate_inst, frictionvel_inst, & - waterstate_inst, waterflux_inst, energyflux_inst, temperature_inst ) - ! - ! !DESCRIPTION: - ! This is the main subroutine to execute the calculation of leaf temperature - ! and surface fluxes. Subroutine SoilFluxes then determines soil/snow and ground - ! temperatures and updates the surface fluxes for the new ground temperature. - ! - ! Calling sequence is: - ! Biogeophysics1: surface biogeophysics driver - ! -> QSat: saturated vapor pressure, specific humidity, and - ! derivatives at ground surface and derivatives at - ! leaf surface using updated leaf temperature - ! Leaf temperature - ! Foliage energy conservation is given by the foliage energy budget - ! equation: - ! Rnet - Hf - LEf = 0 - ! The equation is solved by Newton-Raphson iteration, in which this - ! iteration includes the calculation of the photosynthesis and - ! stomatal resistance, and the integration of turbulent flux profiles. - ! The sensible and latent heat transfer between foliage and atmosphere - ! and ground is linked by the equations: - ! Ha = Hf + Hg and Ea = Ef + Eg - ! - ! !USES: - use QSatMod , only : QSat - use clm_varcon , only : denh2o, denice, roverg, hvap, hsub, zlnd, zsno, tfrz, spval - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv, icol_road_perv - use landunit_varcon , only : istice_mec, istwet, istsoil, istdlak, istcrop, istdlak - use clm_varpar , only : nlevgrnd, nlevurb, nlevsno, nlevsoi - use clm_varctl , only : use_fates - use CLMFatesInterfaceMod, only : hlm_fates_interface_type - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points - type(hlm_fates_interface_type), intent(inout) :: clm_fates - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p ! indices - integer :: j ! soil/snow level index - integer :: fp ! lake filter patch index - integer :: fc ! lake filter column index - real(r8) :: qred ! soil surface relative humidity - real(r8) :: avmuir ! ir inverse optical depth per unit leaf area - real(r8) :: eg ! water vapor pressure at temperature T [pa] - real(r8) :: qsatg ! saturated humidity [kg/kg] - real(r8) :: degdT ! d(eg)/dT - real(r8) :: qsatgdT ! d(qsatg)/dT - real(r8) :: fac ! soil wetness of surface layer - real(r8) :: psit ! negative potential of soil - real(r8) :: hr ! alpha soil - real(r8) :: hr_road_perv ! alpha soil for urban pervious road - real(r8) :: wx ! partial volume of ice and water of surface layer - real(r8) :: fac_fc ! soil wetness of surface layer relative to field capacity - real(r8) :: eff_porosity ! effective porosity in layer - real(r8) :: vol_ice ! partial volume of ice lens in layer - real(r8) :: vol_liq ! partial volume of liquid water in layer - real(r8) :: fh2o_eff(bounds%begc:bounds%endc) ! effective surface water fraction (i.e. seen by atm) - !------------------------------------------------------------------------------ - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - zii => col%zii , & ! Output: [real(r8) (:) ] convective boundary height [m] - z_0_town => lun%z_0_town , & ! Input: [real(r8) (:) ] momentum roughness length of urban landunit (m) - z_d_town => lun%z_d_town , & ! Input: [real(r8) (:) ] displacement height of urban landunit (m) - urbpoi => lun%urbpoi , & ! Input: [logical (:) ] true => landunit is an urban point - - z0mr => pftcon%z0mr , & ! Input: ratio of momentum roughness length to canopy top height (-) - displar => pftcon%displar , & ! Input: ratio of displacement height to canopy top height (-) - - forc_hgt_t => atm2lnd_inst%forc_hgt_t_grc , & ! Input: [real(r8) (:) ] observational height of temperature [m] - forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) - forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) - forc_hgt_u => atm2lnd_inst%forc_hgt_u_grc , & ! Input: [real(r8) (:) ] observational height of wind [m] - forc_hgt_q => atm2lnd_inst%forc_hgt_q_grc , & ! Input: [real(r8) (:) ] observational height of specific humidity [m] - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_th => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric potential temperature (Kelvin) - - - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - qg_snow => waterstate_inst%qg_snow_col , & ! Output: [real(r8) (:) ] specific humidity at snow surface [kg/kg] - qg_soil => waterstate_inst%qg_soil_col , & ! Output: [real(r8) (:) ] specific humidity at soil surface [kg/kg] - qg => waterstate_inst%qg_col , & ! Output: [real(r8) (:) ] ground specific humidity [kg/kg] - qg_h2osfc => waterstate_inst%qg_h2osfc_col , & ! Output: [real(r8) (:) ] specific humidity at h2osfc surface [kg/kg] - dqgdT => waterstate_inst%dqgdT_col , & ! Output: [real(r8) (:) ] d(qg)/dT - - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - qflx_evap_veg => waterflux_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm) - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Output: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - - htvp => energyflux_inst%htvp_col , & ! Output: [real(r8) (:) ] latent heat of vapor of water (or sublimation) [j/kg] - cgrnd => energyflux_inst%cgrnd_patch , & ! Output: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp [w/m2/k] - cgrnds => energyflux_inst%cgrnds_patch , & ! Output: [real(r8) (:) ] deriv. of soil sensible heat flux wrt soil temp [w/m2/k] - cgrndl => energyflux_inst%cgrndl_patch , & ! Output: [real(r8) (:) ] deriv. of soil latent heat flux wrt soil temp [w/m**2/k] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_tot_r => energyflux_inst%eflx_sh_tot_r_patch , & ! Output: [real(r8) (:) ] rural total sensible heat flux (W/m**2) [+ to atm] - eflx_lh_tot_u => energyflux_inst%eflx_lh_tot_u_patch , & ! Output: [real(r8) (:) ] urban total latent heat flux (W/m**2) [+ to atm] - eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch , & ! Output: [real(r8) (:) ] total latent heat flux (W/m**2) [+ to atm] - eflx_lh_tot_r => energyflux_inst%eflx_lh_tot_r_patch , & ! Output: [real(r8) (:) ] rural total latent heat flux (W/m**2) [+ to atm] - eflx_sh_tot_u => energyflux_inst%eflx_sh_tot_u_patch , & ! Output: [real(r8) (:) ] urban total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_veg => energyflux_inst%eflx_sh_veg_patch , & ! Output: [real(r8) (:) ] sensible heat flux from leaves (W/m**2) [+ to atm] - - forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Input: [real(r8) (:) ] observational height of temperature at patch level [m] - forc_hgt_q_patch => frictionvel_inst%forc_hgt_q_patch , & ! Input: [real(r8) (:) ] observational height of specific humidity at patch level [m] - z0m => frictionvel_inst%z0m_patch , & ! Output: [real(r8) (:) ] momentum roughness length (m) - z0mv => frictionvel_inst%z0mv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, momentum [m] - z0hv => frictionvel_inst%z0hv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, sensible heat [m] - z0qv => frictionvel_inst%z0qv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, latent heat [m] - z0hg => frictionvel_inst%z0hg_col , & ! Output: [real(r8) (:) ] roughness length over ground, sensible heat [m] - z0mg => frictionvel_inst%z0mg_col , & ! Output: [real(r8) (:) ] roughness length over ground, momentum [m] - z0qg => frictionvel_inst%z0qg_col , & ! Output: [real(r8) (:) ] roughness length over ground, latent heat [m] - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Output: [real(r8) (:) ] observational height of wind at patch level [m] - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - htop => canopystate_inst%htop_patch , & ! Input: [real(r8) (:) ] canopy top (m) - displa => canopystate_inst%displa_patch , & ! Output: [real(r8) (:) ] displacement height (m) - - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - watfc => soilstate_inst%watfc_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at field capacity - watdry => soilstate_inst%watdry_col , & ! Input: [real(r8) (:,:) ] volumetric soil moisture corresponding to no restriction on ET from urban pervious surface - watopt => soilstate_inst%watopt_col , & ! Input: [real(r8) (:,:) ] volumetric soil moisture corresponding to no restriction on ET from urban pervious surface - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - rootfr_road_perv => soilstate_inst%rootfr_road_perv_col , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer for urban pervious road - rootr_road_perv => soilstate_inst%rootr_road_perv_col , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer for urban pervious road - soilalpha => soilstate_inst%soilalpha_col , & ! Output: [real(r8) (:) ] factor that reduces ground saturated specific humidity (-) - soilalpha_u => soilstate_inst%soilalpha_u_col , & ! Output: [real(r8) (:) ] Urban factor that reduces ground saturated specific humidity (-) - - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - beta => temperature_inst%beta_col , & ! Output: [real(r8) (:) ] coefficient of convective velocity [-] - emg => temperature_inst%emg_col , & ! Output: [real(r8) (:) ] ground emissivity - emv => temperature_inst%emv_patch , & ! Output: [real(r8) (:) ] vegetation emissivity - t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Output: [real(r8) (:) ] saved surface water temperature - t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground temperature (Kelvin) - thv => temperature_inst%thv_col , & ! Output: [real(r8) (:) ] virtual potential temperature (kelvin) - thm => temperature_inst%thm_patch , & ! Output: [real(r8) (:) ] intermediate variable (forc_t+0.0098*forc_hgt_t_patch) - tssbef => temperature_inst%t_ssbef_col & ! Output: [real(r8) (:,:) ] soil/snow temperature before update - ) - - do j = -nlevsno+1, nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) .and. j > nlevurb) then - tssbef(c,j) = spval - else - tssbef(c,j) = t_soisno(c,j) - end if - ! record t_h2osfc prior to updating - t_h2osfc_bef(c) = t_h2osfc(c) - end do - end do - - ! calculate moisture stress/resistance for soil evaporation - call calc_soilevap_resis(bounds, num_nolakec, filter_nolakec, soilstate_inst, waterstate_inst, temperature_inst) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - - if (col%itype(c) == icol_road_perv) then - hr_road_perv = 0._r8 - end if - - ! begin calculations that relate only to the column level - ! Ground and soil temperatures from previous time step - - ! ground temperature is weighted average of exposed soil, snow, and h2osfc - if (snl(c) < 0) then - t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & - + (1.0_r8 - frac_sno_eff(c) - frac_h2osfc(c)) * t_soisno(c,1) & - + frac_h2osfc(c) * t_h2osfc(c) - else - t_grnd(c) = (1 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c) - endif - - ! Saturated vapor pressure, specific humidity and their derivatives - ! at ground surface - qred = 1._r8 - if (lun%itype(l)/=istwet .AND. lun%itype(l)/=istice_mec) then - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - wx = (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice)/dz(c,1) - fac = min(1._r8, wx/watsat(c,1)) - fac = max( fac, 0.01_r8 ) - psit = -sucsat(c,1) * fac ** (-bsw(c,1)) - psit = max(smpmin(c), psit) - ! modify qred to account for h2osfc - hr = exp(psit/roverg/t_soisno(c,1)) - qred = (1._r8 - frac_sno(c) - frac_h2osfc(c))*hr & - + frac_sno(c) + frac_h2osfc(c) - soilalpha(c) = qred - - else if (col%itype(c) == icol_road_perv) then - ! Pervious road depends on water in total soil column - do j = 1, nlevsoi - if (t_soisno(c,j) >= tfrz) then - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity = watsat(c,j)-vol_ice - vol_liq = min(eff_porosity, h2osoi_liq(c,j)/(dz(c,j)*denh2o)) - fac = min( max(vol_liq-watdry(c,j),0._r8) / (watopt(c,j)-watdry(c,j)), 1._r8 ) - else - fac = 0._r8 - end if - rootr_road_perv(c,j) = rootfr_road_perv(c,j)*fac - hr_road_perv = hr_road_perv + rootr_road_perv(c,j) - end do - ! Allows for sublimation of snow or dew on snow - qred = (1.-frac_sno(c))*hr_road_perv + frac_sno(c) - - ! Normalize root resistances to get layer contribution to total ET - if (hr_road_perv > 0._r8) then - do j = 1, nlevsoi - rootr_road_perv(c,j) = rootr_road_perv(c,j)/hr_road_perv - end do - end if - soilalpha_u(c) = qred - - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - qred = 0._r8 - soilalpha_u(c) = spval - - else if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - qred = 1._r8 - soilalpha_u(c) = spval - end if - - else - soilalpha(c) = spval - - end if - - ! compute humidities individually for snow, soil, h2osfc for vegetated landunits - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - call QSat(t_soisno(c,snl(c)+1), forc_pbot(c), eg, degdT, qsatg, qsatgdT) - if (qsatg > forc_q(c) .and. forc_q(c) > qsatg) then - qsatg = forc_q(c) - qsatgdT = 0._r8 - end if - - qg_snow(c) = qsatg - dqgdT(c) = frac_sno(c)*qsatgdT - - call QSat(t_soisno(c,1) , forc_pbot(c), eg, degdT, qsatg, qsatgdT) - if (qsatg > forc_q(c) .and. forc_q(c) > hr*qsatg) then - qsatg = forc_q(c) - qsatgdT = 0._r8 - end if - qg_soil(c) = hr*qsatg - dqgdT(c) = dqgdT(c) + (1._r8 - frac_sno(c) - frac_h2osfc(c))*hr*qsatgdT - - ! to be consistent with hs_top values in SoilTemp, set qg_snow to qg_soil for snl = 0 case - ! this ensures hs_top_snow will equal hs_top_soil - if (snl(c) >= 0) then - qg_snow(c) = qg_soil(c) - dqgdT(c) = (1._r8 - frac_h2osfc(c))*hr*dqgdT(c) - endif - - call QSat(t_h2osfc(c), forc_pbot(c), eg, degdT, qsatg, qsatgdT) - if (qsatg > forc_q(c) .and. forc_q(c) > qsatg) then - qsatg = forc_q(c) - qsatgdT = 0._r8 - end if - qg_h2osfc(c) = qsatg - dqgdT(c) = dqgdT(c) + frac_h2osfc(c) * qsatgdT - - ! qg(c) = frac_sno(c)*qg_snow(c) + (1._r8 - frac_sno(c) - frac_h2osfc(c))*qg_soil(c) & - qg(c) = frac_sno_eff(c)*qg_snow(c) + (1._r8 - frac_sno_eff(c) - frac_h2osfc(c))*qg_soil(c) & - + frac_h2osfc(c) * qg_h2osfc(c) - - else - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg, qsatgdT) - qg(c) = qred*qsatg - dqgdT(c) = qred*qsatgdT - - if (qsatg > forc_q(c) .and. forc_q(c) > qred*qsatg) then - qg(c) = forc_q(c) - dqgdT(c) = 0._r8 - end if - - qg_snow(c) = qg(c) - qg_soil(c) = qg(c) - qg_h2osfc(c) = qg(c) - endif - - ! Ground emissivity - only calculate for non-urban landunits - ! Urban emissivities are currently read in from data file - - if (.not. urbpoi(l)) then - if (lun%itype(l)==istice_mec) then - emg(c) = 0.97_r8 - else - emg(c) = (1._r8-frac_sno(c))*0.96_r8 + frac_sno(c)*0.97_r8 - end if - end if - - ! Latent heat. We arbitrarily assume that the sublimation occurs - ! only as h2osoi_liq = 0 - - htvp(c) = hvap - if (h2osoi_liq(c,snl(c)+1) <= 0._r8 .and. h2osoi_ice(c,snl(c)+1) > 0._r8) htvp(c) = hsub - - ! Ground roughness lengths over non-lake columns (includes bare ground, ground - ! underneath canopy, wetlands, etc.) - - if (frac_sno(c) > 0._r8) then - z0mg(c) = zsno - else - z0mg(c) = zlnd - end if - z0hg(c) = z0mg(c) ! initial set only - z0qg(c) = z0mg(c) ! initial set only - - ! Potential, virtual potential temperature, and wind speed at the - ! reference height - - beta(c) = 1._r8 - zii(c) = 1000._r8 - thv(c) = forc_th(c)*(1._r8+0.61_r8*forc_q(c)) - - end do ! (end of columns loop) - - - ! Set roughness and displacement - ! Note that FATES passes back z0m and displa at the end - ! of its dynamics call. If and when crops are - ! enabled simultaneously with FATES, we will - ! have to apply a filter here. - if(use_fates) then - call clm_fates%TransferZ0mDisp(bounds,frictionvel_inst,canopystate_inst) - end if - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if( .not.(patch%is_fates(p))) then - z0m(p) = z0mr(patch%itype(p)) * htop(p) - displa(p) = displar(patch%itype(p)) * htop(p) - end if - end do - - ! Initialization - do fp = 1,num_nolakep - p = filter_nolakep(fp) - - ! Initial set (needed for history tape fields) - - eflx_sh_tot(p) = 0._r8 - l = patch%landunit(p) - if (urbpoi(l)) then - eflx_sh_tot_u(p) = 0._r8 - else if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_sh_tot_r(p) = 0._r8 - end if - eflx_lh_tot(p) = 0._r8 - if (urbpoi(l)) then - eflx_lh_tot_u(p) = 0._r8 - else if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_lh_tot_r(p) = 0._r8 - end if - eflx_sh_veg(p) = 0._r8 - qflx_evap_tot(p) = 0._r8 - qflx_evap_veg(p) = 0._r8 - qflx_tran_veg(p) = 0._r8 - - ! Initial set for calculation - - cgrnd(p) = 0._r8 - cgrnds(p) = 0._r8 - cgrndl(p) = 0._r8 - - ! Vegetation Emissivity - - avmuir = 1._r8 - emv(p) = 1._r8-exp(-(elai(p)+esai(p))/avmuir) - - ! Roughness lengths over vegetation - - z0mv(p) = z0m(p) - z0hv(p) = z0mv(p) - z0qv(p) = z0mv(p) - end do - - ! Make forcing height a patch-level quantity that is the atmospheric forcing - ! height plus each patch's z0m+displa - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - g = patch%gridcell(p) - l = patch%landunit(p) - c = patch%column(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (frac_veg_nosno(p) == 0) then - forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(c) + displa(p) - forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(c) + displa(p) - forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(c) + displa(p) - else - forc_hgt_u_patch(p) = forc_hgt_u(g) + z0m(p) + displa(p) - forc_hgt_t_patch(p) = forc_hgt_t(g) + z0m(p) + displa(p) - forc_hgt_q_patch(p) = forc_hgt_q(g) + z0m(p) + displa(p) - end if - else if (lun%itype(l) == istwet .or. lun%itype(l) == istice_mec) then - forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(c) - forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(c) - forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(c) - ! Appropriate momentum roughness length will be added in LakeFLuxesMod. - else if (lun%itype(l) == istdlak) then - forc_hgt_u_patch(p) = forc_hgt_u(g) - forc_hgt_t_patch(p) = forc_hgt_t(g) - forc_hgt_q_patch(p) = forc_hgt_q(g) - else if (urbpoi(l)) then - forc_hgt_u_patch(p) = forc_hgt_u(g) + z_0_town(l) + z_d_town(l) - forc_hgt_t_patch(p) = forc_hgt_t(g) + z_0_town(l) + z_d_town(l) - forc_hgt_q_patch(p) = forc_hgt_q(g) + z_0_town(l) + z_d_town(l) - end if - end if - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - - thm(p) = forc_t(c) + 0.0098_r8*forc_hgt_t_patch(p) - end do - - end associate - - end subroutine CanopyTemperature - -end module CanopyTemperatureMod diff --git a/src/biogeophys/DaylengthMod.F90 b/src/biogeophys/DaylengthMod.F90 deleted file mode 100644 index 546ecb1e4f..0000000000 --- a/src/biogeophys/DaylengthMod.F90 +++ /dev/null @@ -1,215 +0,0 @@ -module DaylengthMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Computes daylength - ! -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use GridcellType , only : grc - ! - implicit none - save - private - - ! TODO(wjs, 2018-05-16) We should make this object-oriented, and move max_dayl, dayl - ! and prev_dayl out of GridcellType into a new type defined here. Then can also move - ! the hist_addfld1d calls for DAYL and PREV_DAYL to here. - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: InitDaylength ! initialize daylength for all grid cells - public :: UpdateDaylength ! update daylength for all grid cells - - ! The following are public only to support unit testing, and shouldn't generally be - ! called from outside this module. - public :: daylength ! function to compute daylength - public :: ComputeMaxDaylength ! compute max daylength for each grid cell - ! - !----------------------------------------------------------------------- - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - elemental real(r8) function daylength(lat, decl) - ! - ! !DESCRIPTION: - ! Computes daylength (in seconds) - ! - ! Latitude and solar declination angle should both be specified in radians. decl must - ! be strictly less than pi/2; lat must be less than pi/2 within a small tolerance. - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, & - assignment(=) - use shr_const_mod , only : SHR_CONST_PI - ! - ! !ARGUMENTS: - real(r8), intent(in) :: lat ! latitude (radians) - real(r8), intent(in) :: decl ! solar declination angle (radians) - ! - ! !LOCAL VARIABLES: - real(r8) :: my_lat ! local version of lat, possibly adjusted slightly - real(r8) :: temp ! temporary variable - - ! number of seconds per radian of hour-angle - real(r8), parameter :: secs_per_radian = 13750.9871_r8 - - ! epsilon for defining latitudes "near" the pole - real(r8), parameter :: lat_epsilon = 10._r8 * epsilon(1._r8) - - ! Define an offset pole as slightly less than pi/2 to avoid problems with cos(lat) being negative - real(r8), parameter :: pole = SHR_CONST_PI/2.0_r8 - real(r8), parameter :: offset_pole = pole - lat_epsilon - !----------------------------------------------------------------------- - - ! Can't SHR_ASSERT in an elemental function; instead, return a bad value if any - ! preconditions are violated - - ! lat must be less than pi/2 within a small tolerance - if (abs(lat) >= (pole + lat_epsilon)) then - daylength = nan - - ! decl must be strictly less than pi/2 - else if (abs(decl) >= pole) then - daylength = nan - - ! normal case - else - ! Ensure that latitude isn't too close to pole, to avoid problems with cos(lat) being negative - my_lat = min(offset_pole, max(-1._r8 * offset_pole, lat)) - - temp = -(sin(my_lat)*sin(decl))/(cos(my_lat) * cos(decl)) - temp = min(1._r8,max(-1._r8,temp)) - daylength = 2.0_r8 * secs_per_radian * acos(temp) - end if - - end function daylength - - !----------------------------------------------------------------------- - subroutine ComputeMaxDaylength(bounds, lat, obliquity, max_daylength) - ! - ! !DESCRIPTION: - ! Compute max daylength for each grid cell - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: obliquity ! earth's obliquity (radians) - real(r8), intent(in) :: lat(bounds%begg: ) ! latitude (radians) - real(r8), intent(out) :: max_daylength(bounds%begg: ) ! maximum daylength for each gridcell (s) - ! - ! !LOCAL VARIABLES: - integer :: g - real(r8) :: max_decl ! max declination angle - - character(len=*), parameter :: subname = 'ComputeMaxDaylength' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(lat) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(max_daylength) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - do g = bounds%begg,bounds%endg - max_decl = obliquity - if (lat(g) < 0._r8) max_decl = -max_decl - max_daylength(g) = daylength(lat(g), max_decl) - end do - - end subroutine ComputeMaxDaylength - - !----------------------------------------------------------------------- - subroutine InitDaylength(bounds, declin, declinm1, obliquity) - ! - ! !DESCRIPTION: - ! Initialize daylength, previous daylength and max daylength for all grid cells. - ! - ! This should be called with declin set at the value for the first model time step, - ! and declinm1 at the value for the previous time step - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: declin ! solar declination angle for the first model time step (radians) - real(r8), intent(in) :: declinm1 ! solar declination angle for the previous time step (radians) - real(r8), intent(in) :: obliquity ! earth's obliquity (radians) - ! - !----------------------------------------------------------------------- - - associate(& - lat => grc%lat, & ! Input: [real(r8) (:)] latitude (radians) - dayl => grc%dayl, & ! Output: [real(r8) (:)] day length (s) - prev_dayl => grc%prev_dayl, & ! Output: [real(r8) (:)] day length from previous time step (s) - max_dayl => grc%max_dayl , & ! Output: [real(r8) (:)] maximum day length (s) - - begg => bounds%begg , & ! beginning grid cell index - endg => bounds%endg & ! ending grid cell index - ) - - prev_dayl(begg:endg) = daylength(lat(begg:endg), declinm1) - dayl(begg:endg) = daylength(lat(begg:endg), declin) - - call ComputeMaxDaylength(bounds, & - lat = lat(bounds%begg:bounds%endg), & - obliquity = obliquity, & - max_daylength = max_dayl(bounds%begg:bounds%endg)) - - end associate - - end subroutine InitDaylength - - - !----------------------------------------------------------------------- - subroutine UpdateDaylength(bounds, declin, obliquity) - ! - ! !DESCRIPTION: - ! Update daylength, previous daylength and max daylength for all grid cells. - ! - ! This should be called exactly once per time step. - ! - ! Assumes that InitDaylength has been called in initialization. This Update routine - ! should NOT be called in initialization. - ! - ! !USES: - use clm_time_manager, only : is_first_step_of_this_run_segment - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: declin ! solar declination angle (radians) - real(r8), intent(in) :: obliquity ! earth's obliquity (radians) - ! - !----------------------------------------------------------------------- - - associate(& - lat => grc%lat, & ! Input: [real(r8) (:)] latitude (radians) - dayl => grc%dayl, & ! InOut: [real(r8) (:)] day length (s) - prev_dayl => grc%prev_dayl, & ! Output: [real(r8) (:)] day length from previous time step (s) - max_dayl => grc%max_dayl , & ! Output: [real(r8) (:)] maximum day length (s) - - begg => bounds%begg , & ! beginning grid cell index - endg => bounds%endg & ! ending grid cell index - ) - - if (is_first_step_of_this_run_segment()) then - ! DO NOTHING - ! - ! In the first time step, we simply use dayl & prev_dayl that were set in - ! initialization. (We do NOT want to run the normal code in that case, because that - ! would incorrectly set prev_dayl to be the same as the current dayl in the first - ! time step, because of the way prev_dayl is initialized.) - else - prev_dayl(begg:endg) = dayl(begg:endg) - dayl(begg:endg) = daylength(lat(begg:endg), declin) - end if - - call ComputeMaxDaylength(bounds, & - lat = lat(bounds%begg:bounds%endg), & - obliquity = obliquity, & - max_daylength = max_dayl(bounds%begg:bounds%endg)) - - end associate - - end subroutine UpdateDaylength - -end module DaylengthMod diff --git a/src/biogeophys/EnergyFluxType.F90 b/src/biogeophys/EnergyFluxType.F90 deleted file mode 100644 index 0869e4136e..0000000000 --- a/src/biogeophys/EnergyFluxType.F90 +++ /dev/null @@ -1,1036 +0,0 @@ -module EnergyFluxType - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! Energy flux data structure - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : spval - use decompMod , only : bounds_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use AnnualFluxDribbler, only : annual_flux_dribbler_type, annual_flux_dribbler_gridcell - ! - implicit none - save - private - ! - type, public :: energyflux_type - - ! Fluxes - real(r8), pointer :: eflx_h2osfc_to_snow_col (:) ! col snow melt to h2osfc heat flux (W/m**2) - real(r8), pointer :: eflx_sh_grnd_patch (:) ! patch sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_veg_patch (:) ! patch sensible heat flux from leaves (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_snow_patch (:) ! patch sensible heat flux from snow (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_soil_patch (:) ! patch sensible heat flux from soil (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_h2osfc_patch (:) ! patch sensible heat flux from surface water (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_patch (:) ! patch total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_u_patch (:) ! patch urban total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_r_patch (:) ! patch rural total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_precip_conversion_col(:) ! col sensible heat flux from precipitation conversion (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_patch (:) ! patch total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_u_patch (:) ! patch urban total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_r_patch (:) ! patch rural total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_vegt_patch (:) ! patch transpiration heat flux from veg (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_vege_patch (:) ! patch evaporation heat flux from veg (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_grnd_patch (:) ! patch evaporation heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_soil_grnd_patch (:) ! patch soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_u_patch (:) ! patch urban soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_r_patch (:) ! patch rural soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_lwrad_net_patch (:) ! patch net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_r_patch (:) ! patch rural net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_u_patch (:) ! patch urban net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_out_patch (:) ! patch emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_out_r_patch (:) ! patch rural emitted infrared (longwave) rad (W/m**2) - real(r8), pointer :: eflx_lwrad_out_u_patch (:) ! patch urban emitted infrared (longwave) rad (W/m**2) - real(r8), pointer :: eflx_snomelt_col (:) ! col snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_r_col (:) ! col rural snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_u_col (:) ! col urban snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_gnet_patch (:) ! patch net heat flux into ground (W/m**2) - real(r8), pointer :: eflx_grnd_lake_patch (:) ! patch net heat flux into lake / snow surface, excluding light transmission (W/m**2) - real(r8), pointer :: eflx_dynbal_grc (:) ! grc dynamic land cover change conversion energy flux (W/m**2) - real(r8), pointer :: eflx_bot_col (:) ! col heat flux from beneath the soil or ice column (W/m**2) - real(r8), pointer :: eflx_fgr12_col (:) ! col ground heat flux between soil layers 1 and 2 (W/m**2) - real(r8), pointer :: eflx_fgr_col (:,:) ! col (rural) soil downward heat flux (W/m2) (1:nlevgrnd) (pos upward; usually eflx_bot >= 0) - real(r8), pointer :: eflx_building_heat_errsoi_col(:) ! col heat flux to interior surface of walls and roof for errsoi check (W m-2) - real(r8), pointer :: eflx_urban_ac_col (:) ! col urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat_col (:) ! col urban heating flux (W/m**2) - real(r8), pointer :: eflx_anthro_patch (:) ! patch total anthropogenic heat flux (W/m**2) - real(r8), pointer :: eflx_traffic_patch (:) ! patch traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat_patch (:) ! patch sensible heat flux from domestic heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_patch (:) ! patch sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_traffic_lun (:) ! lun traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat_lun (:) ! lun sensible heat flux from domestic heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_lun (:) ! lun sensible heat flux to be put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_building_lun (:) ! lun building heat flux from change in interior building air temperature (W/m**2) - real(r8), pointer :: eflx_urban_ac_lun (:) ! lun urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat_lun (:) ! lun urban heating flux (W/m**2) - - ! Derivatives of energy fluxes - real(r8), pointer :: dgnetdT_patch (:) ! patch derivative of net ground heat flux wrt soil temp (W/m**2 K) - real(r8), pointer :: netrad_patch (:) ! col net radiation (W/m**2) [+ = to sfc] - real(r8), pointer :: cgrnd_patch (:) ! col deriv. of soil energy flux wrt to soil temp [W/m2/k] - real(r8), pointer :: cgrndl_patch (:) ! col deriv. of soil latent heat flux wrt soil temp [W/m**2/k] - real(r8), pointer :: cgrnds_patch (:) ! col deriv. of soil sensible heat flux wrt soil temp [W/m2/k] - - ! Canopy radiation - real(r8), pointer :: dlrad_patch (:) ! col downward longwave radiation below the canopy [W/m2] - real(r8), pointer :: ulrad_patch (:) ! col upward longwave radiation above the canopy [W/m2] - - ! Wind Stress - real(r8), pointer :: taux_patch (:) ! patch wind (shear) stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy_patch (:) ! patch wind (shear) stress: n-s (kg/m/s**2) - - ! Conductance - real(r8), pointer :: canopy_cond_patch (:) ! patch tracer conductance for canopy [m/s] - - ! Transpiration - real(r8), pointer :: btran_patch (:) ! patch transpiration wetness factor (0 to 1) - real(r8), pointer :: btran_min_patch (:) ! patch daily minimum transpiration wetness factor (0 to 1) - real(r8), pointer :: btran_min_inst_patch (:) ! patch instantaneous daily minimum transpiration wetness factor (0 to 1) - real(r8), pointer :: bsun_patch (:) ! patch sunlit canopy transpiration wetness factor (0 to 1) - real(r8), pointer :: bsha_patch (:) ! patch shaded canopy transpiration wetness factor (0 to 1) - - ! Roots - real(r8), pointer :: btran2_patch (:) ! patch root zone soil wetness factor (0 to 1) - real(r8), pointer :: rresis_patch (:,:) ! patch root resistance by layer (0-1) (nlevgrnd) - - ! Latent heat - real(r8), pointer :: htvp_col (:) ! latent heat of vapor of water (or sublimation) [j/kg] - - ! Balance Checks - real(r8), pointer :: errsoi_patch (:) ! soil/lake energy conservation error (W/m**2) - real(r8), pointer :: errsoi_col (:) ! soil/lake energy conservation error (W/m**2) - real(r8), pointer :: errseb_patch (:) ! surface energy conservation error (W/m**2) - real(r8), pointer :: errseb_col (:) ! surface energy conservation error (W/m**2) - real(r8), pointer :: errsol_patch (:) ! solar radiation conservation error (W/m**2) - real(r8), pointer :: errsol_col (:) ! solar radiation conservation error (W/m**2) - real(r8), pointer :: errlon_patch (:) ! longwave radiation conservation error (W/m**2) - real(r8), pointer :: errlon_col (:) ! longwave radiation conservation error (W/m**2) - - ! Objects that help convert once-per-year dynamic land cover changes into fluxes - ! that are dribbled throughout the year - type(annual_flux_dribbler_type) :: eflx_dynbal_dribbler - - contains - - procedure, public :: Init ! Public initialization method - procedure, private :: InitAllocate ! initialize/allocate - procedure, private :: InitHistory ! setup history fields - procedure, private :: InitCold ! initialize for cold start - procedure, public :: Restart ! setup restart fields - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - - end type energyflux_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, t_grnd_col, is_simple_buildtemp, is_prog_buildtemp ) - ! - ! !DESCRIPTION: - ! Allocate and initialize the data type and setup history, and initialize for cold-start. - ! !USES: - implicit none - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: t_grnd_col( bounds%begc: ) - logical , intent(in) :: is_simple_buildtemp ! If using simple building temp method - logical , intent(in) :: is_prog_buildtemp ! If using prognostic building temp method - - SHR_ASSERT_ALL((ubound(t_grnd_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - call this%InitAllocate ( bounds ) - call this%InitHistory ( bounds, is_simple_buildtemp ) - call this%InitCold ( bounds, t_grnd_col, is_simple_buildtemp, is_prog_buildtemp ) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize and allocate data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - implicit none - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - begg = bounds%begg; endg= bounds%endg - - allocate( this%eflx_h2osfc_to_snow_col (begc:endc)) ; this%eflx_h2osfc_to_snow_col (:) = nan - allocate( this%eflx_sh_snow_patch (begp:endp)) ; this%eflx_sh_snow_patch (:) = nan - allocate( this%eflx_sh_soil_patch (begp:endp)) ; this%eflx_sh_soil_patch (:) = nan - allocate( this%eflx_sh_h2osfc_patch (begp:endp)) ; this%eflx_sh_h2osfc_patch (:) = nan - allocate( this%eflx_sh_tot_patch (begp:endp)) ; this%eflx_sh_tot_patch (:) = nan - allocate( this%eflx_sh_tot_u_patch (begp:endp)) ; this%eflx_sh_tot_u_patch (:) = nan - allocate( this%eflx_sh_tot_r_patch (begp:endp)) ; this%eflx_sh_tot_r_patch (:) = nan - allocate( this%eflx_sh_grnd_patch (begp:endp)) ; this%eflx_sh_grnd_patch (:) = nan - allocate( this%eflx_sh_veg_patch (begp:endp)) ; this%eflx_sh_veg_patch (:) = nan - allocate( this%eflx_sh_precip_conversion_col(begc:endc)) ; this%eflx_sh_precip_conversion_col(:) = nan - allocate( this%eflx_lh_tot_u_patch (begp:endp)) ; this%eflx_lh_tot_u_patch (:) = nan - allocate( this%eflx_lh_tot_patch (begp:endp)) ; this%eflx_lh_tot_patch (:) = nan - allocate( this%eflx_lh_tot_r_patch (begp:endp)) ; this%eflx_lh_tot_r_patch (:) = nan - allocate( this%eflx_lh_grnd_patch (begp:endp)) ; this%eflx_lh_grnd_patch (:) = nan - allocate( this%eflx_lh_vege_patch (begp:endp)) ; this%eflx_lh_vege_patch (:) = nan - allocate( this%eflx_lh_vegt_patch (begp:endp)) ; this%eflx_lh_vegt_patch (:) = nan - allocate( this%eflx_soil_grnd_patch (begp:endp)) ; this%eflx_soil_grnd_patch (:) = nan - allocate( this%eflx_soil_grnd_u_patch (begp:endp)) ; this%eflx_soil_grnd_u_patch (:) = nan - allocate( this%eflx_soil_grnd_r_patch (begp:endp)) ; this%eflx_soil_grnd_r_patch (:) = nan - allocate( this%eflx_lwrad_net_patch (begp:endp)) ; this%eflx_lwrad_net_patch (:) = nan - allocate( this%eflx_lwrad_net_u_patch (begp:endp)) ; this%eflx_lwrad_net_u_patch (:) = nan - allocate( this%eflx_lwrad_net_r_patch (begp:endp)) ; this%eflx_lwrad_net_r_patch (:) = nan - allocate( this%eflx_lwrad_out_patch (begp:endp)) ; this%eflx_lwrad_out_patch (:) = nan - allocate( this%eflx_lwrad_out_u_patch (begp:endp)) ; this%eflx_lwrad_out_u_patch (:) = nan - allocate( this%eflx_lwrad_out_r_patch (begp:endp)) ; this%eflx_lwrad_out_r_patch (:) = nan - allocate( this%eflx_gnet_patch (begp:endp)) ; this%eflx_gnet_patch (:) = nan - allocate( this%eflx_grnd_lake_patch (begp:endp)) ; this%eflx_grnd_lake_patch (:) = nan - allocate( this%eflx_dynbal_grc (begg:endg)) ; this%eflx_dynbal_grc (:) = nan - allocate( this%eflx_bot_col (begc:endc)) ; this%eflx_bot_col (:) = nan - allocate( this%eflx_snomelt_col (begc:endc)) ; this%eflx_snomelt_col (:) = nan - allocate( this%eflx_snomelt_r_col (begc:endc)) ; this%eflx_snomelt_r_col (:) = nan - allocate( this%eflx_snomelt_u_col (begc:endc)) ; this%eflx_snomelt_u_col (:) = nan - allocate( this%eflx_fgr12_col (begc:endc)) ; this%eflx_fgr12_col (:) = nan - allocate( this%eflx_fgr_col (begc:endc, 1:nlevgrnd)) ; this%eflx_fgr_col (:,:) = nan - allocate( this%eflx_building_heat_errsoi_col (begc:endc)) ; this%eflx_building_heat_errsoi_col(:)= nan - allocate( this%eflx_urban_ac_col (begc:endc)) ; this%eflx_urban_ac_col (:) = nan - allocate( this%eflx_urban_heat_col (begc:endc)) ; this%eflx_urban_heat_col (:) = nan - allocate( this%eflx_wasteheat_patch (begp:endp)) ; this%eflx_wasteheat_patch (:) = nan - allocate( this%eflx_traffic_patch (begp:endp)) ; this%eflx_traffic_patch (:) = nan - allocate( this%eflx_heat_from_ac_patch (begp:endp)) ; this%eflx_heat_from_ac_patch (:) = nan - allocate( this%eflx_heat_from_ac_lun (begl:endl)) ; this%eflx_heat_from_ac_lun (:) = nan - allocate( this%eflx_building_lun (begl:endl)) ; this%eflx_building_lun (:) = nan - allocate( this%eflx_urban_ac_lun (begl:endl)) ; this%eflx_urban_ac_lun (:) = nan - allocate( this%eflx_urban_heat_lun (begl:endl)) ; this%eflx_urban_heat_lun (:) = nan - allocate( this%eflx_traffic_lun (begl:endl)) ; this%eflx_traffic_lun (:) = nan - allocate( this%eflx_wasteheat_lun (begl:endl)) ; this%eflx_wasteheat_lun (:) = nan - allocate( this%eflx_anthro_patch (begp:endp)) ; this%eflx_anthro_patch (:) = nan - - allocate( this%dgnetdT_patch (begp:endp)) ; this%dgnetdT_patch (:) = nan - allocate( this%cgrnd_patch (begp:endp)) ; this%cgrnd_patch (:) = nan - allocate( this%cgrndl_patch (begp:endp)) ; this%cgrndl_patch (:) = nan - allocate( this%cgrnds_patch (begp:endp)) ; this%cgrnds_patch (:) = nan - allocate( this%dlrad_patch (begp:endp)) ; this%dlrad_patch (:) = nan - allocate( this%ulrad_patch (begp:endp)) ; this%ulrad_patch (:) = nan - allocate( this%netrad_patch (begp:endp)) ; this%netrad_patch (:) = nan - - allocate( this%taux_patch (begp:endp)) ; this%taux_patch (:) = nan - allocate( this%tauy_patch (begp:endp)) ; this%tauy_patch (:) = nan - - allocate( this%canopy_cond_patch (begp:endp)) ; this%canopy_cond_patch (:) = nan - - allocate( this%htvp_col (begc:endc)) ; this%htvp_col (:) = nan - - allocate(this%rresis_patch (begp:endp,1:nlevgrnd)) ; this%rresis_patch (:,:) = nan - allocate(this%btran_patch (begp:endp)) ; this%btran_patch (:) = nan - allocate(this%btran_min_patch (begp:endp)) ; this%btran_min_patch (:) = nan - allocate(this%btran_min_inst_patch (begp:endp)) ; this%btran_min_inst_patch (:) = nan - allocate(this%btran2_patch (begp:endp)) ; this%btran2_patch (:) = nan - allocate( this%bsun_patch (begp:endp)) ; this%bsun_patch (:) = nan - allocate( this%bsha_patch (begp:endp)) ; this%bsha_patch (:) = nan - allocate( this%errsoi_patch (begp:endp)) ; this%errsoi_patch (:) = nan - allocate( this%errsoi_col (begc:endc)) ; this%errsoi_col (:) = nan - allocate( this%errseb_patch (begp:endp)) ; this%errseb_patch (:) = nan - allocate( this%errseb_col (begc:endc)) ; this%errseb_col (:) = nan - allocate( this%errsol_patch (begp:endp)) ; this%errsol_patch (:) = nan - allocate( this%errsol_col (begc:endc)) ; this%errsol_col (:) = nan - allocate( this%errlon_patch (begp:endp)) ; this%errlon_patch (:) = nan - allocate( this%errlon_col (begc:endc)) ; this%errlon_col (:) = nan - - this%eflx_dynbal_dribbler = annual_flux_dribbler_gridcell( & - bounds = bounds, & - name = 'eflx_dynbal', & - units = 'J/m**2') - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, is_simple_buildtemp) - ! - ! !DESCRIPTION: - ! Setup fields that can be output to history files - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevgrnd - use clm_varctl , only : use_cn, use_hydrstress - use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal - use ncdio_pio , only : ncd_inqvdlen - implicit none - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type), intent(in) :: bounds - logical , intent(in) :: is_simple_buildtemp ! If using simple building temp method - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - integer :: begg, endg - integer :: dimlen - integer :: err_code - logical :: do_io - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - begg = bounds%begg; endg= bounds%endg - - - this%eflx_dynbal_grc(begg:endg) = spval - call hist_addfld1d (fname='EFLX_DYNBAL', units='W/m^2', & - avgflag='A', long_name='dynamic land cover change conversion energy flux', & - ptr_lnd=this%eflx_dynbal_grc) - - this%eflx_snomelt_col(begc:endc) = spval - call hist_addfld1d (fname='FSM', units='W/m^2', & - avgflag='A', long_name='snow melt heat flux', & - ptr_col=this%eflx_snomelt_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSM_ICE', units='W/m^2', & - avgflag='A', long_name='snow melt heat flux (ice landunits only)', & - ptr_col=this%eflx_snomelt_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%eflx_snomelt_r_col(begc:endc) = spval - call hist_addfld1d (fname='FSM_R', units='W/m^2', & - avgflag='A', long_name='Rural snow melt heat flux', & - ptr_col=this%eflx_snomelt_r_col, set_spec=spval, default='inactive') - - this%eflx_snomelt_u_col(begc:endc) = spval - call hist_addfld1d (fname='FSM_U', units='W/m^2', & - avgflag='A', long_name='Urban snow melt heat flux', & - ptr_col=this%eflx_snomelt_u_col, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%eflx_lwrad_net_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRA', units='W/m^2', & - avgflag='A', long_name='net infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_net_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FIRA_ICE', units='W/m^2', & - avgflag='A', long_name='net infrared (longwave) radiation (ice landunits only)', & - ptr_patch=this%eflx_lwrad_net_patch, c2l_scale_type='urbanf', l2g_scale_type='ice',& - default='inactive') - - this%eflx_lwrad_net_r_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRA_R', units='W/m^2', & - avgflag='A', long_name='Rural net infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_net_r_patch, set_spec=spval) - - this%eflx_lwrad_out_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRE', units='W/m^2', & - avgflag='A', long_name='emitted infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_out_patch, c2l_scale_type='urbanf') - ! Rename of FIRE for Urban intercomparision project - call hist_addfld1d (fname='LWup', units='W/m^2', & - avgflag='A', long_name='upwelling longwave radiation', & - ptr_patch=this%eflx_lwrad_out_patch, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='FIRE_ICE', units='W/m^2', & - avgflag='A', long_name='emitted infrared (longwave) radiation (ice landunits only)', & - ptr_patch=this%eflx_lwrad_out_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%eflx_lwrad_out_r_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRE_R', units='W/m^2', & - avgflag='A', long_name='Rural emitted infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_out_r_patch, set_spec=spval) - - this%eflx_lh_vegt_patch(begp:endp) = spval - call hist_addfld1d (fname='FCTR', units='W/m^2', & - avgflag='A', long_name='canopy transpiration', & - ptr_patch=this%eflx_lh_vegt_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%eflx_lh_vege_patch(begp:endp) = spval - call hist_addfld1d (fname='FCEV', units='W/m^2', & - avgflag='A', long_name='canopy evaporation', & - ptr_patch=this%eflx_lh_vege_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%eflx_lh_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='FGEV', units='W/m^2', & - avgflag='A', long_name='ground evaporation', & - ptr_patch=this%eflx_lh_grnd_patch, c2l_scale_type='urbanf') - - this%eflx_sh_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='FSH', units='W/m^2', & - avgflag='A', long_name='sensible heat not including correction for land use change and rain/snow conversion', & - ptr_patch=this%eflx_sh_tot_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSH_ICE', units='W/m^2', & - avgflag='A', & - long_name='sensible heat not including correction for land use change and rain/snow conversion (ice landunits only)', & - ptr_patch=this%eflx_sh_tot_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%eflx_sh_tot_r_patch(begp:endp) = spval - call hist_addfld1d (fname='FSH_R', units='W/m^2', & - avgflag='A', long_name='Rural sensible heat', & - ptr_patch=this%eflx_sh_tot_r_patch, set_spec=spval) - - this%eflx_sh_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='Qh', units='W/m^2', & - avgflag='A', long_name='sensible heat', & - ptr_patch=this%eflx_sh_tot_patch, c2l_scale_type='urbanf', & - default = 'inactive') - - this%eflx_lh_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='Qle', units='W/m^2', & - avgflag='A', long_name='total evaporation', & - ptr_patch=this%eflx_lh_tot_patch, c2l_scale_type='urbanf', & - default = 'inactive') - - this%eflx_lh_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_LH_TOT', units='W/m^2', & - avgflag='A', long_name='total latent heat flux [+ to atm]', & - ptr_patch=this%eflx_lh_tot_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='EFLX_LH_TOT_ICE', units='W/m^2', & - avgflag='A', long_name='total latent heat flux [+ to atm] (ice landunits only)', & - ptr_patch=this%eflx_lh_tot_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%eflx_lh_tot_r_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_LH_TOT_R', units='W/m^2', & - avgflag='A', long_name='Rural total evaporation', & - ptr_patch=this%eflx_lh_tot_r_patch, set_spec=spval) - - this%eflx_soil_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='Qstor', units='W/m^2', & - avgflag='A', long_name='storage heat flux (includes snowmelt)', & - ptr_patch=this%eflx_soil_grnd_patch, c2l_scale_type='urbanf', & - default = 'inactive') - this%eflx_sh_veg_patch(begp:endp) = spval - call hist_addfld1d (fname='FSH_V', units='W/m^2', & - avgflag='A', long_name='sensible heat from veg', & - ptr_patch=this%eflx_sh_veg_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%eflx_sh_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='FSH_G', units='W/m^2', & - avgflag='A', long_name='sensible heat from ground', & - ptr_patch=this%eflx_sh_grnd_patch, c2l_scale_type='urbanf') - - this%eflx_soil_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='FGR', units='W/m^2', & - avgflag='A', long_name='heat flux into soil/snow including snow melt and lake / snow light transmission', & - ptr_patch=this%eflx_soil_grnd_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FGR_ICE', units='W/m^2', & - avgflag='A', & - long_name='heat flux into soil/snow including snow melt and lake / snow light transmission (ice landunits only)', & - ptr_patch=this%eflx_soil_grnd_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%eflx_soil_grnd_r_patch(begp:endp) = spval - call hist_addfld1d (fname='FGR_R', units='W/m^2', & - avgflag='A', long_name='Rural heat flux into soil/snow including snow melt and snow light transmission', & - ptr_patch=this%eflx_soil_grnd_r_patch, set_spec=spval, default='inactive') - - this%eflx_lwrad_net_u_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRA_U', units='W/m^2', & - avgflag='A', long_name='Urban net infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_net_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%eflx_soil_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_SOIL_GRND', units='W/m^2', & - avgflag='A', long_name='soil heat flux [+ into soil]', & - ptr_patch=this%eflx_soil_grnd_patch, default='inactive', c2l_scale_type='urbanf') - - this%eflx_lwrad_out_u_patch(begp:endp) = spval - call hist_addfld1d (fname='FIRE_U', units='W/m^2', & - avgflag='A', long_name='Urban emitted infrared (longwave) radiation', & - ptr_patch=this%eflx_lwrad_out_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%eflx_sh_tot_u_patch(begp:endp) = spval - call hist_addfld1d (fname='FSH_U', units='W/m^2', & - avgflag='A', long_name='Urban sensible heat', & - ptr_patch=this%eflx_sh_tot_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%eflx_sh_precip_conversion_col(begc:endc) = spval - call hist_addfld1d (fname = 'FSH_PRECIP_CONVERSION', units='W/m^2', & - avgflag='A', long_name='Sensible heat flux from conversion of rain/snow atm forcing', & - ptr_col=this%eflx_sh_precip_conversion_col, c2l_scale_type='urbanf') - - this%eflx_lh_tot_u_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_LH_TOT_U', units='W/m^2', & - avgflag='A', long_name='Urban total evaporation', & - ptr_patch=this%eflx_lh_tot_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%eflx_soil_grnd_u_patch(begp:endp) = spval - call hist_addfld1d (fname='FGR_U', units='W/m^2', & - avgflag='A', long_name='Urban heat flux into soil/snow including snow melt', & - ptr_patch=this%eflx_soil_grnd_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%netrad_patch(begp:endp) = spval - call hist_addfld1d (fname='Rnet', units='W/m^2', & - avgflag='A', long_name='net radiation', & - ptr_patch=this%netrad_patch, c2l_scale_type='urbanf', & - default='inactive') - - if (use_cn) then - this%dlrad_patch(begp:endp) = spval - call hist_addfld1d (fname='DLRAD', units='W/m^2', & - avgflag='A', long_name='downward longwave radiation below the canopy', & - ptr_patch=this%dlrad_patch, default='inactive', c2l_scale_type='urbanf') - end if - - if (use_cn) then - this%ulrad_patch(begp:endp) = spval - call hist_addfld1d (fname='ULRAD', units='W/m^2', & - avgflag='A', long_name='upward longwave radiation above the canopy', & - ptr_patch=this%ulrad_patch, default='inactive', c2l_scale_type='urbanf') - end if - - if (use_cn) then - this%cgrnd_patch(begp:endp) = spval - call hist_addfld1d (fname='CGRND', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil energy flux wrt to soil temp', & - ptr_patch=this%cgrnd_patch, default='inactive', c2l_scale_type='urbanf') - end if - - if (use_cn) then - this%cgrndl_patch(begp:endp) = spval - call hist_addfld1d (fname='CGRNDL', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil latent heat flux wrt soil temp', & - ptr_patch=this%cgrndl_patch, default='inactive', c2l_scale_type='urbanf') - end if - - if (use_cn) then - this%cgrnds_patch(begp:endp) = spval - call hist_addfld1d (fname='CGRNDS', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil sensible heat flux wrt soil temp', & - ptr_patch=this%cgrnds_patch, default='inactive', c2l_scale_type='urbanf') - end if - - if (use_cn) then - this%eflx_gnet_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_GNET', units='W/m^2', & - avgflag='A', long_name='net heat flux into ground', & - ptr_patch=this%eflx_gnet_patch, default='inactive', c2l_scale_type='urbanf') - end if - - this%eflx_grnd_lake_patch(begp:endp) = spval - call hist_addfld1d (fname='EFLX_GRND_LAKE', units='W/m^2', & - avgflag='A', long_name='net heat flux into lake/snow surface, excluding light transmission', & - ptr_patch=this%eflx_grnd_lake_patch, set_nolake=spval) - - if ( is_simple_buildtemp )then - this%eflx_building_heat_errsoi_col(begc:endc) = spval - call hist_addfld1d (fname='BUILDHEAT', units='W/m^2', & - avgflag='A', long_name='heat flux from urban building interior to walls and roof', & - ptr_col=this%eflx_building_heat_errsoi_col, set_nourb=0._r8, c2l_scale_type='urbanf') - - this%eflx_urban_ac_col(begc:endc) = spval - call hist_addfld1d (fname='URBAN_AC', units='W/m^2', & - avgflag='A', long_name='urban air conditioning flux', & - ptr_col=this%eflx_urban_ac_col, set_nourb=0._r8, c2l_scale_type='urbanf') - - this%eflx_urban_heat_col(begc:endc) = spval - call hist_addfld1d (fname='URBAN_HEAT', units='W/m^2', & - avgflag='A', long_name='urban heating flux', & - ptr_col=this%eflx_urban_heat_col, set_nourb=0._r8, c2l_scale_type='urbanf') - else - this%eflx_urban_ac_lun(begl:endl) = spval - call hist_addfld1d (fname='EFLXBUILD', units='W/m^2', & - avgflag='A', long_name='building heat flux from change in interior building air temperature', & - ptr_lunit=this%eflx_building_lun, set_nourb=0._r8, l2g_scale_type='unity') - - this%eflx_urban_ac_lun(begl:endl) = spval - call hist_addfld1d (fname='URBAN_AC', units='W/m^2', & - avgflag='A', long_name='urban air conditioning flux', & - ptr_lunit=this%eflx_urban_ac_lun, set_nourb=0._r8, l2g_scale_type='unity') - - this%eflx_urban_heat_lun(begl:endl) = spval - call hist_addfld1d (fname='URBAN_HEAT', units='W/m^2', & - avgflag='A', long_name='urban heating flux', & - ptr_lunit=this%eflx_urban_heat_lun, set_nourb=0._r8, l2g_scale_type='unity') - end if - - - this%dgnetdT_patch(begp:endp) = spval - call hist_addfld1d (fname='DGNETDT', units='W/m^2/K', & - avgflag='A', long_name='derivative of net ground heat flux wrt soil temp', & - ptr_patch=this%dgnetdT_patch, default='inactive', c2l_scale_type='urbanf') - - this%eflx_fgr12_col(begc:endc) = spval - call hist_addfld1d (fname='FGR12', units='W/m^2', & - avgflag='A', long_name='heat flux between soil layers 1 and 2', & - ptr_col=this%eflx_fgr12_col, set_lake=spval) - - this%eflx_fgr_col(begc:endc,:) = spval - call hist_addfld2d (fname='FGR_SOIL_R', units='watt/m^2', type2d='levgrnd', & - avgflag='A', long_name='Rural downward heat flux at interface below each soil layer', & - ptr_col=this%eflx_fgr_col, set_spec=spval, default='inactive') - - this%eflx_traffic_patch(begp:endp) = spval - call hist_addfld1d (fname='TRAFFICFLUX', units='W/m^2', & - avgflag='A', long_name='sensible heat flux from urban traffic', & - ptr_patch=this%eflx_traffic_patch, set_nourb=0._r8, c2l_scale_type='urbanf', & - default='inactive') - - this%eflx_wasteheat_patch(begp:endp) = spval - call hist_addfld1d (fname='WASTEHEAT', units='W/m^2', & - avgflag='A', long_name='sensible heat flux from heating/cooling sources of urban waste heat', & - ptr_patch=this%eflx_wasteheat_patch, set_nourb=0._r8, c2l_scale_type='urbanf') - - this%eflx_heat_from_ac_patch(begp:endp) = spval - call hist_addfld1d (fname='HEAT_FROM_AC', units='W/m^2', & - avgflag='A', long_name='sensible heat flux put into canyon due to heat removed from air conditioning', & - ptr_patch=this%eflx_heat_from_ac_patch, set_nourb=0._r8, c2l_scale_type='urbanf') - - if ( is_simple_buildtemp )then - this%eflx_anthro_patch(begp:endp) = spval - call hist_addfld1d (fname='Qanth', units='W/m^2', & - avgflag='A', long_name='anthropogenic heat flux', & - ptr_patch=this%eflx_anthro_patch, set_nourb=0._r8, c2l_scale_type='urbanf', & - default='inactive') - end if - - this%taux_patch(begp:endp) = spval - call hist_addfld1d (fname='TAUX', units='kg/m/s^2', & - avgflag='A', long_name='zonal surface stress', & - ptr_patch=this%taux_patch) - ! Rename of TAUX for Urban intercomparision project (when U=V) - call hist_addfld1d (fname='Qtau', units='kg/m/s^2', & - avgflag='A', long_name='momentum flux', & - ptr_patch=this%taux_patch, default='inactive') - - this%tauy_patch(begp:endp) = spval - call hist_addfld1d (fname='TAUY', units='kg/m/s^2', & - avgflag='A', long_name='meridional surface stress', & - ptr_patch=this%tauy_patch) - - this%btran_patch(begp:endp) = spval - if (.not. use_hydrstress) then - call hist_addfld1d (fname='BTRAN', units='unitless', & - avgflag='A', long_name='transpiration beta factor', & - ptr_patch=this%btran_patch, set_lake=spval, set_urb=spval) - end if - - this%btran_min_patch(begp:endp) = spval - call hist_addfld1d (fname='BTRANMN', units='unitless', & - avgflag='A', long_name='daily minimum of transpiration beta factor', & - ptr_patch=this%btran_min_patch, set_lake=spval, set_urb=spval) - - this%btran2_patch(begp:endp) = spval - call hist_addfld1d (fname='BTRAN2', units='unitless', & - avgflag='A', long_name='root zone soil wetness factor', & - ptr_patch=this%btran2_patch, set_lake=spval, set_urb=spval) - - if (use_cn) then - this%rresis_patch(begp:endp,:) = spval - call hist_addfld2d (fname='RRESIS', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='root resistance in each soil layer', & - ptr_patch=this%rresis_patch, default='inactive') - end if - - this%errsoi_col(begc:endc) = spval - call hist_addfld1d (fname='ERRSOI', units='W/m^2', & - avgflag='A', long_name='soil/lake energy conservation error', & - ptr_col=this%errsoi_col) - - this%errseb_patch(begp:endp) = spval - call hist_addfld1d (fname='ERRSEB', units='W/m^2', & - avgflag='A', long_name='surface energy conservation error', & - ptr_patch=this%errseb_patch) - - this%errsol_patch(begp:endp) = spval - call hist_addfld1d (fname='ERRSOL', units='W/m^2', & - avgflag='A', long_name='solar radiation conservation error', & - ptr_patch=this%errsol_patch, set_urb=spval) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, t_grnd_col, is_simple_buildtemp, is_prog_buildtemp) - ! - ! !DESCRIPTION: - ! Initialize cold start conditions for module variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varpar , only : nlevsoi, nlevgrnd, nlevsno, nlevlak, nlevurb - use clm_varcon , only : denice, denh2o, sb - use landunit_varcon , only : istwet, istsoil, istdlak - use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall - use column_varcon , only : icol_shadewall, icol_road_perv - use clm_varctl , only : iulog, use_vancouver, use_mexicocity - implicit none - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: t_grnd_col( bounds%begc: ) - logical , intent(in) :: is_simple_buildtemp ! If using simple building temp method - logical , intent(in) :: is_prog_buildtemp ! If using prognostic building temp method - ! - ! !LOCAL VARIABLES: - integer :: j,l,c,p,levs,lev - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(t_grnd_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - ! Columns - if ( is_simple_buildtemp )then - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (lun%urbpoi(l)) then - this%eflx_building_heat_errsoi_col(c) = 0._r8 - this%eflx_urban_ac_col(c) = 0._r8 - this%eflx_urban_heat_col(c) = 0._r8 - else - this%eflx_building_heat_errsoi_col(c) = 0._r8 - this%eflx_urban_ac_col(c) = 0._r8 - this%eflx_urban_heat_col(c) = 0._r8 - end if - - end do - end if - - ! Patches - do p = bounds%begp, bounds%endp - c = patch%column(p) - l = patch%landunit(p) - - if (.not. lun%urbpoi(l)) then ! non-urban - this%eflx_lwrad_net_u_patch(p) = spval - this%eflx_lwrad_out_u_patch(p) = spval - this%eflx_lh_tot_u_patch(p) = spval - this%eflx_sh_tot_u_patch(p) = spval - this%eflx_soil_grnd_u_patch(p) = spval - end if - - this%eflx_lwrad_out_patch(p) = sb * (t_grnd_col(c))**4 - end do - - ! patches - do p = bounds%begp, bounds%endp - l = patch%landunit(p) - - if (.not. lun%urbpoi(l)) then - this%eflx_traffic_lun(l) = spval - this%eflx_wasteheat_lun(l) = spval - if ( is_prog_buildtemp )then - this%eflx_building_lun(l) = 0._r8 - this%eflx_urban_ac_lun(l) = 0._r8 - this%eflx_urban_heat_lun(l) = 0._r8 - end if - - this%eflx_wasteheat_patch(p) = 0._r8 - this%eflx_heat_from_ac_patch(p) = 0._r8 - this%eflx_traffic_patch(p) = 0._r8 - if ( is_simple_buildtemp) & - this%eflx_anthro_patch(p) = 0._r8 - else - if ( is_prog_buildtemp )then - this%eflx_building_lun(l) = 0._r8 - this%eflx_urban_ac_lun(l) = 0._r8 - this%eflx_urban_heat_lun(l) = 0._r8 - end if - end if - end do - - ! initialize rresis, for use in ecosystemdyn - do p = bounds%begp,bounds%endp - do lev = 1,nlevgrnd - this%rresis_patch(p,lev) = 0._r8 - end do - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildtemp) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, & - ncd_inqvdlen - use restUtilMod - use decompMod , only : get_proc_global - implicit none - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - logical , intent(in) :: is_simple_buildtemp ! If using simple building temp method - logical , intent(in) :: is_prog_buildtemp ! If using prognostic building temp method - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - integer :: dimlen - integer :: err_code - integer :: numl_global - logical :: readvar ! determine if variable is on initial file - logical :: do_io - !----------------------------------------------------------------------- - - call get_proc_global(nl=numl_global) - call restartvar(ncid=ncid, flag=flag, varname='EFLX_LWRAD_OUT', xtype=ncd_double, & - dim1name='pft', & - long_name='emitted infrared (longwave) radiation', units='watt/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_lwrad_out_patch) - - ! Restart for building air temperature method - if ( is_prog_buildtemp )then - ! landunit urban energy state variable - eflx_urban_ac - do_io = .true. - ! On a read, confirm that this variable has the expected size (landunit-level); if not, - ! don't read it (instead give it a default value). This is needed to support older initial - ! conditions for which this variable had a different size (column-level). - if (flag == 'read') then - call ncd_inqvdlen(ncid, 'URBAN_AC_L', 1, dimlen, err_code) - if (dimlen /= numl_global) then - do_io = .false. - readvar = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='URBAN_AC_L', xtype=ncd_double, & - dim1name='landunit',& - long_name='urban air conditioning flux', units='watt/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_ac_lun) - else - this%eflx_urban_ac_lun = 0.0_r8 - end if - ! landunit urban energy state variable - eflx_urban_heat - do_io = .true. - ! On a read, confirm that this variable has the expected size (landunit-level); if not, - ! don't read it (instead give it a default value). This is needed to support older initial - ! conditions for which this variable had a different size (column-level). - if (flag == 'read') then - call ncd_inqvdlen(ncid, 'URBAN_HEAT_L', 1, dimlen, err_code) - if (dimlen /= numl_global) then - do_io = .false. - readvar = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='URBAN_HEAT_L', xtype=ncd_double, & - dim1name='landunit',& - long_name='urban heating flux', units='watt/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_heat_lun) - else - this%eflx_urban_heat_lun = 0.0_r8 - end if - else if ( is_simple_buildtemp )then - call restartvar(ncid=ncid, flag=flag, varname='URBAN_AC', xtype=ncd_double, & - dim1name='column', & - long_name='urban air conditioning flux', units='watt/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_ac_col) - call restartvar(ncid=ncid, flag=flag, varname='URBAN_HEAT', xtype=ncd_double, & - dim1name='column', & - long_name='urban heating flux', units='watt/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_urban_heat_col) - end if - - call restartvar(ncid=ncid, flag=flag, varname='btran2', xtype=ncd_double, & - dim1name='pft', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%btran2_patch) - - call restartvar(ncid=ncid, flag=flag, varname='BTRAN_MIN', xtype=ncd_double, & - dim1name='pft', & - long_name='daily minimum of transpiration wetness factor', units='', & - interpinic_flag='interp', readvar=readvar, data=this%btran_min_patch) - - call restartvar(ncid=ncid, flag=flag, varname='BTRAN_MIN_INST', xtype=ncd_double, & - dim1name='pft', & - long_name='instantaneous daily minimum of transpiration wetness factor', units='', & - interpinic_flag='interp', readvar=readvar, data=this%btran_min_inst_patch) - - call restartvar(ncid=ncid, flag=flag, varname='eflx_grnd_lake', xtype=ncd_double, & - dim1name='pft', & - long_name='net heat flux into lake/snow surface, excluding light transmission', units='W/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%eflx_grnd_lake_patch) - - call this%eflx_dynbal_dribbler%Restart(bounds, ncid, flag) - - end subroutine Restart - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! Each interval and accumulation type is unique to each field processed. - ! Routine [initAccBuffer] defines the fields to be processed - ! and the type of accumulation. - ! Routine [updateAccVars] does the actual accumulation for a given field. - ! Fields are accumulated by calls to subroutine [update_accum_field]. - ! To accumulate a field, it must first be defined in subroutine [initAccVars] - ! and then accumulated by calls to [updateAccVars]. - ! Four types of accumulations are possible: - ! o average over time interval - ! o running mean over time interval - ! o running accumulation over time interval - ! Time average fields are only valid at the end of the averaging interval. - ! Running means are valid once the length of the simulation exceeds the - ! averaging interval. Accumulated fields are continuously accumulated. - ! The trigger value "-99999." resets the accumulation to zero. - ! - ! !USES - use accumulMod , only : init_accum_field - use clm_time_manager , only : get_step_size - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - real(r8) :: dtime - integer, parameter :: not_used = huge(1) - !--------------------------------------------------------------------- - - dtime = get_step_size() - - call init_accum_field(name='BTRANAV', units='-', & - desc='average over an hour of btran', accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end subroutine InitAccBuffer - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES - use accumulMod , only : init_accum_field, extract_accum_field - use clm_time_manager , only : get_nstep - use clm_varctl , only : nsrest, nsrStartup - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: nstep - integer :: ier - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Initialize variables that are to be time accumulated - ! Initialize btran min values - if (nsrest == nsrStartup) then - this%btran_min_patch(begp:endp) = spval - - this%btran_min_inst_patch(begp:endp) = spval - end if - - end subroutine InitAccVars - !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) - ! - ! USES - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - use clm_time_manager , only : get_step_size, get_nstep, is_end_curr_day, get_curr_date - use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal - use clm_varctl , only : iulog - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(energyflux_type) :: this - type(bounds_type) , intent(in) :: bounds - - ! - ! !LOCAL VARIABLES: - integer :: m,g,l,c,p ! indices - integer :: ier ! error status - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: year ! year (0, ...) for nstep - integer :: month ! month (1, ..., 12) for nstep - integer :: day ! day of month (1, ..., 31) for nstep - integer :: secs ! seconds into current date for nstep - logical :: end_cd ! temporary for is_end_curr_day() value - integer :: begp, endp - real(r8), pointer :: rbufslp(:) ! temporary single level - pft level - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - dtime = get_step_size() - nstep = get_nstep() - call get_curr_date (year, month, day, secs) - - ! Allocate needed dynamic memory for single level pft field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun(msg=errMsg(__FILE__, __LINE__)) - endif - - ! Accumulate and extract BTRANAV - hourly average btran - ! Used to compute minimum of hourly averaged btran - ! over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('BTRANAV', this%btran_patch, nstep) - call extract_accum_field ('BTRANAV', rbufslp, nstep) - end_cd = is_end_curr_day() - do p = begp,endp - if (rbufslp(p) /= spval) then - this%btran_min_inst_patch(p) = min(rbufslp(p), this%btran_min_inst_patch(p)) - endif - if (end_cd) then - this%btran_min_patch(p) = this%btran_min_inst_patch(p) - this%btran_min_inst_patch(p) = spval - else if (secs == dtime) then - this%btran_min_patch(p) = spval - endif - end do - - deallocate(rbufslp) - - end subroutine UpdateAccVars - -end module EnergyFluxType diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 deleted file mode 100644 index ce793aa9bc..0000000000 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ /dev/null @@ -1,834 +0,0 @@ -module FrictionVelocityMod - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Calculation of the friction velocity, relation for potential - ! temperature and humidity profiles of surface boundary layer. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varcon , only : spval - use clm_varctl , only : use_cn, use_luna - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: FrictionVelReadNML ! Read in the namelist for settings and parameters - public :: FrictionVelocity ! Calculate friction velocity - public :: MoninObukIni ! Initialization of the Monin-Obukhov length - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: StabilityFunc1 ! Stability function for rib < 0. - private :: StabilityFunc2 ! Stability function for rib < 0. - - type, public :: frictionvel_type - - ! Roughness length/resistance for friction velocity calculation - - real(r8), pointer, public :: forc_hgt_u_patch (:) ! patch wind forcing height (10m+z0m+d) (m) - real(r8), pointer, public :: forc_hgt_t_patch (:) ! patch temperature forcing height (10m+z0m+d) (m) - real(r8), pointer, public :: forc_hgt_q_patch (:) ! patch specific humidity forcing height (10m+z0m+d) (m) - real(r8), pointer, public :: u10_patch (:) ! patch 10-m wind (m/s) (for dust model) - real(r8), pointer, public :: u10_clm_patch (:) ! patch 10-m wind (m/s) (for clm_map2gcell) - real(r8), pointer, public :: va_patch (:) ! patch atmospheric wind speed plus convective velocity (m/s) - real(r8), pointer, public :: vds_patch (:) ! patch deposition velocity term (m/s) (for dry dep SO4, NH4NO3) - real(r8), pointer, public :: fv_patch (:) ! patch friction velocity (m/s) (for dust model) - real(r8), pointer, public :: rb1_patch (:) ! patch aerodynamical resistance (s/m) (for dry deposition of chemical tracers) - real(r8), pointer, public :: rb10_patch (:) ! 10-day mean patch aerodynamical resistance (s/m) (for LUNA model) - real(r8), pointer, public :: ram1_patch (:) ! patch aerodynamical resistance (s/m) - real(r8), pointer, public :: z0m_patch (:) ! patch momentum roughness length (m) - real(r8), pointer, public :: z0mv_patch (:) ! patch roughness length over vegetation, momentum [m] - real(r8), pointer, public :: z0hv_patch (:) ! patch roughness length over vegetation, sensible heat [m] - real(r8), pointer, public :: z0qv_patch (:) ! patch roughness length over vegetation, latent heat [m] - real(r8), pointer, public :: z0mg_col (:) ! col roughness length over ground, momentum [m] - real(r8), pointer, public :: z0hg_col (:) ! col roughness length over ground, sensible heat [m] - real(r8), pointer, public :: z0qg_col (:) ! col roughness length over ground, latent heat [m] - - contains - - ! Public procedures - procedure, public :: Init - procedure, public :: Restart - - ! Private procedures - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type frictionvel_type - - type, public :: frictionvel_parms_type - real(r8) :: zetamaxstable ! Max value zeta ("height" used in Monin-Obukhov theory) can go to under stable conditions - end type frictionvel_parms_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------------ - - type(frictionvel_parms_type), public, protected :: frictionvel_parms_inst - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(frictionvel_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(frictionvel_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - allocate(this%forc_hgt_u_patch (begp:endp)) ; this%forc_hgt_u_patch (:) = nan - allocate(this%forc_hgt_t_patch (begp:endp)) ; this%forc_hgt_t_patch (:) = nan - allocate(this%forc_hgt_q_patch (begp:endp)) ; this%forc_hgt_q_patch (:) = nan - allocate(this%u10_patch (begp:endp)) ; this%u10_patch (:) = nan - allocate(this%u10_clm_patch (begp:endp)) ; this%u10_clm_patch (:) = nan - allocate(this%va_patch (begp:endp)) ; this%va_patch (:) = nan - allocate(this%vds_patch (begp:endp)) ; this%vds_patch (:) = nan - allocate(this%fv_patch (begp:endp)) ; this%fv_patch (:) = nan - allocate(this%rb1_patch (begp:endp)) ; this%rb1_patch (:) = nan - allocate(this%rb10_patch (begp:endp)) ; this%rb10_patch (:) = spval - allocate(this%ram1_patch (begp:endp)) ; this%ram1_patch (:) = nan - allocate(this%z0m_patch (begp:endp)) ; this%z0m_patch (:) = nan - allocate(this%z0mv_patch (begp:endp)) ; this%z0mv_patch (:) = nan - allocate(this%z0hv_patch (begp:endp)) ; this%z0hv_patch (:) = nan - allocate(this%z0qv_patch (begp:endp)) ; this%z0qv_patch (:) = nan - allocate(this%z0mg_col (begc:endc)) ; this%z0mg_col (:) = nan - allocate(this%z0qg_col (begc:endc)) ; this%z0qg_col (:) = nan - allocate(this%z0hg_col (begc:endc)) ; this%z0hg_col (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use histFileMod , only: hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(frictionvel_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begp, endp - !--------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - this%z0mg_col(begc:endc) = spval - call hist_addfld1d (fname='Z0MG', units='m', & - avgflag='A', long_name='roughness length over ground, momentum', & - ptr_col=this%z0mg_col, default='inactive') - - this%z0hg_col(begc:endc) = spval - call hist_addfld1d (fname='Z0HG', units='m', & - avgflag='A', long_name='roughness length over ground, sensible heat', & - ptr_col=this%z0hg_col, default='inactive') - - this%z0qg_col(begc:endc) = spval - call hist_addfld1d (fname='Z0QG', units='m', & - avgflag='A', long_name='roughness length over ground, latent heat', & - ptr_col=this%z0qg_col, default='inactive') - - this%va_patch(begp:endp) = spval - call hist_addfld1d (fname='VA', units='m/s', & - avgflag='A', long_name='atmospheric wind speed plus convective velocity', & - ptr_patch=this%va_patch, default='inactive') - - this%u10_clm_patch(begp:endp) = spval - call hist_addfld1d (fname='U10', units='m/s', & - avgflag='A', long_name='10-m wind', & - ptr_patch=this%u10_clm_patch) - - call hist_addfld1d (fname='U10_ICE', units='m/s', & - avgflag='A', long_name='10-m wind (ice landunits only)', & - ptr_patch=this%u10_clm_patch, l2g_scale_type='ice', default='inactive') - - this%u10_patch(begp:endp) = spval - call hist_addfld1d (fname='U10_DUST', units='m/s', & - avgflag='A', long_name='10-m wind for dust model', & - ptr_patch=this%u10_patch) - - if (use_cn) then - this%ram1_patch(begp:endp) = spval - call hist_addfld1d (fname='RAM1', units='s/m', & - avgflag='A', long_name='aerodynamical resistance ', & - ptr_patch=this%ram1_patch, default='inactive') - end if - - if (use_cn) then - this%fv_patch(begp:endp) = spval - call hist_addfld1d (fname='FV', units='m/s', & - avgflag='A', long_name='friction velocity for dust model', & - ptr_patch=this%fv_patch, default='inactive') - end if - - if (use_cn) then - this%z0hv_patch(begp:endp) = spval - call hist_addfld1d (fname='Z0HV', units='m', & - avgflag='A', long_name='roughness length over vegetation, sensible heat', & - ptr_patch=this%z0hv_patch, default='inactive') - end if - - if (use_cn) then - this%z0m_patch(begp:endp) = spval - call hist_addfld1d (fname='Z0M', units='m', & - avgflag='A', long_name='momentum roughness length', & - ptr_patch=this%z0m_patch, default='inactive') - end if - - if (use_cn) then - this%z0mv_patch(begp:endp) = spval - call hist_addfld1d (fname='Z0MV', units='m', & - avgflag='A', long_name='roughness length over vegetation, momentum', & - ptr_patch=this%z0mv_patch, default='inactive') - end if - - if (use_cn) then - this%z0qv_patch(begp:endp) = spval - call hist_addfld1d (fname='Z0QV', units='m', & - avgflag='A', long_name='roughness length over vegetation, latent heat', & - ptr_patch=this%z0qv_patch, default='inactive') - end if - - if (use_luna) then - call hist_addfld1d (fname='RB10', units='s/m', & - avgflag='A', long_name='10 day running mean boundary layer resistance', & - ptr_patch=this%rb10_patch, default='inactive') - end if - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! Initialize module surface albedos to reasonable values - ! - ! !ARGUMENTS: - class(frictionvel_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p, c, l ! indices - !----------------------------------------------------------------------- - - ! Added 5/4/04, PET: initialize forc_hgt_u (gridcell-level), - ! since this is not initialized before first call to CNVegStructUpdate, - ! and it is required to set the upper bound for canopy top height. - ! Changed 3/21/08, KO: still needed but don't have sufficient information - ! to set this properly (e.g., patch-level displacement height and roughness - ! length). So leave at 30m. - - if (use_cn) then - do p = bounds%begp, bounds%endp - this%forc_hgt_u_patch(p) = 30._r8 - end do - end if - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%lakpoi(l)) then !lake - this%z0mg_col(c) = 0.0004_r8 - end if - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(frictionvel_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='Z0MG', xtype=ncd_double, & - dim1name='column', & - long_name='ground momentum roughness length', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%z0mg_col) - - if(use_luna)then - call restartvar(ncid=ncid, flag=flag, varname='rb10', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean boundary layer resistance at the pacth', units='s/m', & - interpinic_flag='interp', readvar=readvar, data=this%rb10_patch) - endif - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine FrictionVelReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for Friction Velocity - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'FrictionVelocityReadNML' - character(len=*), parameter :: nmlname = 'friction_velocity' - !----------------------------------------------------------------------- - real(r8) :: zetamaxstable - namelist /friction_velocity/ zetamaxstable - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - zetamaxstable = 0.5_r8 - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=friction_velocity, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (zetamaxstable, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=friction_velocity) - write(iulog,*) ' ' - end if - frictionvel_parms_inst%zetamaxstable = zetamaxstable - - end subroutine FrictionVelReadNML - - !------------------------------------------------------------------------------ - subroutine FrictionVelocity(lbn, ubn, fn, filtern, & - displa, z0m, z0h, z0q, & - obu, iter, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm, frictionvel_inst, landunit_index) - ! - ! !DESCRIPTION: - ! Calculation of the friction velocity, relation for potential - ! temperature and humidity profiles of surface boundary layer. - ! The scheme is based on the work of Zeng et al. (1998): - ! Intercomparison of bulk aerodynamic algorithms for the computation - ! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, - ! Vol. 11, 2628-2644. - ! - ! !USES: - use clm_varcon, only : vkc - use clm_varctl, only : iulog - ! - ! !ARGUMENTS: - integer , intent(in) :: lbn, ubn ! pft/landunit array bounds - integer , intent(in) :: fn ! number of filtered pft/landunit elements - integer , intent(in) :: filtern(fn) ! pft/landunit filter - real(r8) , intent(in) :: displa ( lbn: ) ! displacement height (m) [lbn:ubn] - real(r8) , intent(in) :: z0m ( lbn: ) ! roughness length over vegetation, momentum [m] [lbn:ubn] - real(r8) , intent(in) :: z0h ( lbn: ) ! roughness length over vegetation, sensible heat [m] [lbn:ubn] - real(r8) , intent(in) :: z0q ( lbn: ) ! roughness length over vegetation, latent heat [m] [lbn:ubn] - real(r8) , intent(in) :: obu ( lbn: ) ! monin-obukhov length (m) [lbn:ubn] - integer , intent(in) :: iter ! iteration number - real(r8) , intent(in) :: ur ( lbn: ) ! wind speed at reference height [m/s] [lbn:ubn] - real(r8) , intent(in) :: um ( lbn: ) ! wind speed including the stablity effect [m/s] [lbn:ubn] - real(r8) , intent(out) :: ustar ( lbn: ) ! friction velocity [m/s] [lbn:ubn] - real(r8) , intent(out) :: temp1 ( lbn: ) ! relation for potential temperature profile [lbn:ubn] - real(r8) , intent(out) :: temp12m ( lbn: ) ! relation for potential temperature profile applied at 2-m [lbn:ubn] - real(r8) , intent(out) :: temp2 ( lbn: ) ! relation for specific humidity profile [lbn:ubn] - real(r8) , intent(out) :: temp22m ( lbn: ) ! relation for specific humidity profile applied at 2-m [lbn:ubn] - real(r8) , intent(inout) :: fm ( lbn: ) ! diagnose 10m wind (DUST only) [lbn:ubn] - type(frictionvel_type) , intent(inout) :: frictionvel_inst - logical , intent(in), optional :: landunit_index ! optional argument that defines landunit or pft level - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: zetam = 1.574_r8 ! transition point of flux-gradient relation (wind profile) - real(r8), parameter :: zetat = 0.465_r8 ! transition point of flux-gradient relation (temp. profile) - integer :: f ! pft/landunit filter index - integer :: n ! pft/landunit index - integer :: g ! gridcell index - integer :: pp ! pfti,pftf index - real(r8) :: zldis(lbn:ubn) ! reference height "minus" zero displacement heght [m] - real(r8) :: zeta(lbn:ubn) ! dimensionless height used in Monin-Obukhov theory - real(r8) :: tmp1,tmp2,tmp3,tmp4 ! Used to diagnose the 10 meter wind - real(r8) :: fmnew ! Used to diagnose the 10 meter wind - real(r8) :: fm10 ! Used to diagnose the 10 meter wind - real(r8) :: zeta10 ! Used to diagnose the 10 meter wind - real(r8) :: vds_tmp ! Temporary for dry deposition velocity - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(displa) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(z0m) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(z0h) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(z0q) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(obu) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ur) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(um) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ustar) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(temp1) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(temp12m) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(temp2) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(temp22m) == (/ubn/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fm) == (/ubn/)), errMsg(sourcefile, __LINE__)) - - associate( & - pfti => lun%patchi , & ! Input: [integer (:) ] beginning pfti index for landunit - pftf => lun%patchf , & ! Input: [integer (:) ] final pft index for landunit - - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at pft level [m] - forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Input: [real(r8) (:) ] observational height of temperature at pft level [m] - forc_hgt_q_patch => frictionvel_inst%forc_hgt_q_patch , & ! Input: [real(r8) (:) ] observational height of specific humidity at pft level [m] - vds => frictionvel_inst%vds_patch , & ! Output: [real(r8) (:) ] dry deposition velocity term (m/s) (for SO4 NH4NO3) - u10 => frictionvel_inst%u10_patch , & ! Output: [real(r8) (:) ] 10-m wind (m/s) (for dust model) - u10_clm => frictionvel_inst%u10_clm_patch , & ! Output: [real(r8) (:) ] 10-m wind (m/s) - va => frictionvel_inst%va_patch , & ! Output: [real(r8) (:) ] atmospheric wind speed plus convective velocity (m/s) - fv => frictionvel_inst%fv_patch & ! Output: [real(r8) (:) ] friction velocity (m/s) (for dust model) - ) - - ! Adjustment factors for unstable (moz < 0) or stable (moz > 0) conditions. - - do f = 1, fn - n = filtern(f) - if (present(landunit_index)) then - g = lun%gridcell(n) - else - g = patch%gridcell(n) - end if - - ! Wind profile - - if (present(landunit_index)) then - zldis(n) = forc_hgt_u_patch(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_u_patch(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetam) then - ustar(n) = vkc*um(n)/(log(-zetam*obu(n)/z0m(n))& - - StabilityFunc1(-zetam) & - + StabilityFunc1(z0m(n)/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) - else if (zeta(n) < 0._r8) then - ustar(n) = vkc*um(n)/(log(zldis(n)/z0m(n))& - - StabilityFunc1(zeta(n))& - + StabilityFunc1(z0m(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - ustar(n) = vkc*um(n)/(log(zldis(n)/z0m(n)) + 5._r8*zeta(n) -5._r8*z0m(n)/obu(n)) - else - ustar(n) = vkc*um(n)/(log(obu(n)/z0m(n))+5._r8-5._r8*z0m(n)/obu(n) & - +(5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - if (zeta(n) < 0._r8) then - vds_tmp = 2.e-3_r8*ustar(n) * ( 1._r8 + (300._r8/(-obu(n)))**0.666_r8) - else - vds_tmp = 2.e-3_r8*ustar(n) - endif - - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - vds(pp) = vds_tmp - end do - else - vds(n) = vds_tmp - end if - - ! Calculate a 10-m wind (10m + z0m + d) - ! For now, this will not be the same as the 10-m wind calculated for the dust - ! model because the CLM stability functions are used here, not the LSM stability - ! functions used in the dust model. We will eventually change the dust model to be - ! consistent with the following formulation. - ! Note that the 10-m wind calculated this way could actually be larger than the - ! atmospheric forcing wind because 1) this includes the convective velocity, 2) - ! this includes the 1 m/s minimum wind threshold - - ! If forcing height is less than or equal to 10m, then set 10-m wind to um - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - if (zldis(n)-z0m(n) <= 10._r8) then - u10_clm(pp) = um(n) - else - if (zeta(n) < -zetam) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(-zetam*obu(n)/(10._r8+z0m(n))) & - - StabilityFunc1(-zetam) & - + StabilityFunc1((10._r8+z0m(n))/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) ) - else if (zeta(n) < 0._r8) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - - StabilityFunc1(zeta(n)) & - + StabilityFunc1((10._r8+z0m(n))/obu(n))) ) - else if (zeta(n) <= 1._r8) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - + 5._r8*zeta(n) - 5._r8*(10._r8+z0m(n))/obu(n)) ) - else - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(obu(n)/(10._r8+z0m(n))) & - + 5._r8 - 5._r8*(10._r8+z0m(n))/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) ) - - end if - end if - va(pp) = um(n) - end do - else - if (zldis(n)-z0m(n) <= 10._r8) then - u10_clm(n) = um(n) - else - if (zeta(n) < -zetam) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(-zetam*obu(n)/(10._r8+z0m(n))) & - - StabilityFunc1(-zetam) & - + StabilityFunc1((10._r8+z0m(n))/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) ) - else if (zeta(n) < 0._r8) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - - StabilityFunc1(zeta(n)) & - + StabilityFunc1((10._r8+z0m(n))/obu(n))) ) - else if (zeta(n) <= 1._r8) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - + 5._r8*zeta(n) - 5._r8*(10._r8+z0m(n))/obu(n)) ) - else - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(obu(n)/(10._r8+z0m(n))) & - + 5._r8 - 5._r8*(10._r8+z0m(n))/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) ) - end if - end if - va(n) = um(n) - end if - - ! Temperature profile - - if (present(landunit_index)) then - zldis(n) = forc_hgt_t_patch(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_t_patch(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp1(n) = vkc/(log(-zetat*obu(n)/z0h(n))& - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0h(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp1(n) = vkc/(log(zldis(n)/z0h(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0h(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp1(n) = vkc/(log(zldis(n)/z0h(n)) + 5._r8*zeta(n) - 5._r8*z0h(n)/obu(n)) - else - temp1(n) = vkc/(log(obu(n)/z0h(n)) + 5._r8 - 5._r8*z0h(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - ! Humidity profile - - if (present(landunit_index)) then - if (forc_hgt_q_patch(pfti(n)) == forc_hgt_t_patch(pfti(n)) .and. z0q(n) == z0h(n)) then - temp2(n) = temp1(n) - else - zldis(n) = forc_hgt_q_patch(pfti(n))-displa(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) & - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp2(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - end if - else - if (forc_hgt_q_patch(n) == forc_hgt_t_patch(n) .and. z0q(n) == z0h(n)) then - temp2(n) = temp1(n) - else - zldis(n) = forc_hgt_q_patch(n)-displa(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) & - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp2(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - endif - endif - - ! Temperature profile applied at 2-m - - zldis(n) = 2.0_r8 + z0h(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp12m(n) = vkc/(log(-zetat*obu(n)/z0h(n))& - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0h(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp12m(n) = vkc/(log(zldis(n)/z0h(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0h(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp12m(n) = vkc/(log(zldis(n)/z0h(n)) + 5._r8*zeta(n) - 5._r8*z0h(n)/obu(n)) - else - temp12m(n) = vkc/(log(obu(n)/z0h(n)) + 5._r8 - 5._r8*z0h(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - ! Humidity profile applied at 2-m - - if (z0q(n) == z0h(n)) then - temp22m(n) = temp12m(n) - else - zldis(n) = 2.0_r8 + z0q(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp22m(n) = vkc/(log(-zetat*obu(n)/z0q(n)) - & - StabilityFunc2(-zetat) + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp22m(n) = vkc/(log(zldis(n)/z0q(n)) - & - StabilityFunc2(zeta(n))+StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp22m(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp22m(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - end if - - ! diagnose 10-m wind for dust model (dstmbl.F) - ! Notes from C. Zender's dst.F: - ! According to Bon96 p. 62, the displacement height d (here displa) is - ! 0.0 <= d <= 0.34 m in dust source regions (i.e., regions w/o trees). - ! Therefore d <= 0.034*z1 and may safely be neglected. - ! Code from LSM routine SurfaceTemperature was used to obtain u10 - - if (present(landunit_index)) then - zldis(n) = forc_hgt_u_patch(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_u_patch(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (min(zeta(n), 1._r8) < 0._r8) then - tmp1 = (1._r8 - 16._r8*min(zeta(n),1._r8))**0.25_r8 - tmp2 = log((1._r8+tmp1*tmp1)/2._r8) - tmp3 = log((1._r8+tmp1)/2._r8) - fmnew = 2._r8*tmp3 + tmp2 - 2._r8*atan(tmp1) + 1.5707963_r8 - else - fmnew = -5._r8*min(zeta(n),1._r8) - endif - if (iter == 1) then - fm(n) = fmnew - else - fm(n) = 0.5_r8 * (fm(n)+fmnew) - end if - zeta10 = min(10._r8/obu(n), 1._r8) - if (zeta(n) == 0._r8) zeta10 = 0._r8 - if (zeta10 < 0._r8) then - tmp1 = (1.0_r8 - 16.0_r8 * zeta10)**0.25_r8 - tmp2 = log((1.0_r8 + tmp1*tmp1)/2.0_r8) - tmp3 = log((1.0_r8 + tmp1)/2.0_r8) - fm10 = 2.0_r8*tmp3 + tmp2 - 2.0_r8*atan(tmp1) + 1.5707963_r8 - else ! not stable - fm10 = -5.0_r8 * zeta10 - end if - if (present(landunit_index)) then - tmp4 = log( max( 1.0_r8, forc_hgt_u_patch(pfti(n)) / 10._r8) ) - else - tmp4 = log( max( 1.0_r8, forc_hgt_u_patch(n) / 10._r8) ) - end if - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - u10(pp) = ur(n) - ustar(n)/vkc * (tmp4 - fm(n) + fm10) - fv(pp) = ustar(n) - end do - else - u10(n) = ur(n) - ustar(n)/vkc * (tmp4 - fm(n) + fm10) - fv(n) = ustar(n) - end if - - end do - - end associate - end subroutine FrictionVelocity - - !------------------------------------------------------------------------------ - real(r8) function StabilityFunc1(zeta) - ! - ! !DESCRIPTION: - ! Stability function for rib < 0. - ! - ! !USES: - use shr_const_mod, only: SHR_CONST_PI - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory - ! - ! !LOCAL VARIABLES: - real(r8) :: chik, chik2 - !------------------------------------------------------------------------------ - - chik2 = sqrt(1._r8-16._r8*zeta) - chik = sqrt(chik2) - StabilityFunc1 = 2._r8*log((1._r8+chik)*0.5_r8) & - + log((1._r8+chik2)*0.5_r8)-2._r8*atan(chik)+SHR_CONST_PI*0.5_r8 - - end function StabilityFunc1 - - !------------------------------------------------------------------------------ - real(r8) function StabilityFunc2(zeta) - ! - ! !DESCRIPTION: - ! Stability function for rib < 0. - ! - ! !USES: - use shr_const_mod, only: SHR_CONST_PI - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory - ! - ! !LOCAL VARIABLES: - real(r8) :: chik2 - !------------------------------------------------------------------------------ - - chik2 = sqrt(1._r8-16._r8*zeta) - StabilityFunc2 = 2._r8*log((1._r8+chik2)*0.5_r8) - - end function StabilityFunc2 - - !----------------------------------------------------------------------- - subroutine MoninObukIni (ur, thv, dthv, zldis, z0m, um, obu) - ! - ! !DESCRIPTION: - ! Initialization of the Monin-Obukhov length. - ! The scheme is based on the work of Zeng et al. (1998): - ! Intercomparison of bulk aerodynamic algorithms for the computation - ! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, - ! Vol. 11, 2628-2644. - ! - ! !USES: - use clm_varcon, only : grav - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: ur ! wind speed at reference height [m/s] - real(r8), intent(in) :: thv ! virtual potential temperature (kelvin) - real(r8), intent(in) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8), intent(in) :: zldis ! reference height "minus" zero displacement heght [m] - real(r8), intent(in) :: z0m ! roughness length, momentum [m] - real(r8), intent(out) :: um ! wind speed including the stability effect [m/s] - real(r8), intent(out) :: obu ! monin-obukhov length (m) - ! - ! !LOCAL VARIABLES: - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: rib ! bulk Richardson number - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: ustar ! friction velocity [m/s] - !----------------------------------------------------------------------- - - ! Initial values of u* and convective velocity - - ustar=0.06_r8 - wc=0.5_r8 - if (dthv >= 0._r8) then - um=max(ur,0.1_r8) - else - um=sqrt(ur*ur+wc*wc) - endif - - rib=grav*zldis*dthv/(thv*um*um) - - if (rib >= 0._r8) then ! neutral or stable - zeta = rib*log(zldis/z0m)/(1._r8-5._r8*min(rib,0.19_r8)) - zeta = min(frictionvel_parms_inst%zetamaxstable,max(zeta,0.01_r8 )) - else ! unstable - zeta=rib*log(zldis/z0m) - zeta = max(-100._r8,min(zeta,-0.01_r8 )) - endif - - obu=zldis/zeta - - end subroutine MoninObukIni - -end module FrictionVelocityMod diff --git a/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 b/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 deleted file mode 100644 index 22cf2a3a56..0000000000 --- a/src/biogeophys/GlacierSurfaceMassBalanceMod.F90 +++ /dev/null @@ -1,452 +0,0 @@ -module GlacierSurfaceMassBalanceMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Computes fluxes that are specific to glaciers - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use clm_varcon , only : spval, secspday - use clm_varpar , only : nlevgrnd - use clm_varctl , only : glc_snow_persistence_max_days - use clm_time_manager, only : get_step_size - use landunit_varcon, only : istice_mec - use ColumnType , only : col - use LandunitType , only : lun - use glc2lndMod , only : glc2lnd_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: glacier_smb_type - private - - ! ------------------------------------------------------------------------ - ! Public data - ! ------------------------------------------------------------------------ - - real(r8), pointer, public :: qflx_glcice_col(:) ! col net flux of new glacial ice (growth - melt) (mm H2O/s), passed to GLC; only valid inside the do_smb_c filter - real(r8), pointer, public :: qflx_glcice_dyn_water_flux_col(:) ! col water flux needed for balance check due to glc_dyn_runoff_routing (mm H2O/s) (positive means addition of water to the system); valid for all columns - - ! ------------------------------------------------------------------------ - ! Private data - ! ------------------------------------------------------------------------ - - real(r8), pointer :: qflx_glcice_frz_col (:) ! col ice growth (positive definite) (mm H2O/s); only valid inside the do_smb_c filter - real(r8), pointer :: qflx_glcice_melt_col(:) ! col ice melt (positive definite) (mm H2O/s); only valid inside the do_smb_c filter - - contains - - ! ------------------------------------------------------------------------ - ! Public routines - ! ------------------------------------------------------------------------ - - procedure, public :: Init - - ! The science routines need to be separated into a few pieces so they can be - ! sequenced properly based on what variables they depend on, and what they affect - procedure, public :: HandleIceMelt ! compute ice melt in glacier columns, and convert liquid back to ice - procedure, public :: ComputeSurfaceMassBalance ! compute fluxes other than ice melt - procedure, public :: AdjustRunoffTerms ! adjust liquid and ice runoff fluxes due to glacier fluxes - - ! ------------------------------------------------------------------------ - ! Private routines - ! ------------------------------------------------------------------------ - - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type glacier_smb_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Infrastructure routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - - integer :: begc, endc - !----------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - allocate(this%qflx_glcice_col (begc:endc)) ; this%qflx_glcice_col (:) = nan - allocate(this%qflx_glcice_dyn_water_flux_col(begc:endc)) ; this%qflx_glcice_dyn_water_flux_col (:) = nan - allocate(this%qflx_glcice_frz_col (begc:endc)) ; this%qflx_glcice_frz_col (:) = nan - allocate(this%qflx_glcice_melt_col (begc:endc)) ; this%qflx_glcice_melt_col (:) = nan - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - !----------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - this%qflx_glcice_col(begc:endc) = spval - call hist_addfld1d (fname='QICE', units='mm/s', & - avgflag='A', long_name='ice growth/melt', & - ptr_col=this%qflx_glcice_col, l2g_scale_type='ice') - - this%qflx_glcice_frz_col(begc:endc) = spval - call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & - avgflag='A', long_name='ice growth', & - ptr_col=this%qflx_glcice_frz_col, l2g_scale_type='ice') - - this%qflx_glcice_melt_col(begc:endc) = spval - call hist_addfld1d (fname='QICE_MELT', units='mm/s', & - avgflag='A', long_name='ice melt', & - ptr_col=this%qflx_glcice_melt_col, l2g_scale_type='ice') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - - integer :: c - !----------------------------------------------------------------------- - - ! Initialize qflx_glcice_dyn_water_flux_col to 0 for all columns because we want this - ! flux to remain 0 for columns where is is never set, including non-glacier columns. - ! - ! Other fluxes intentionally remain unset (spval) outside the do_smb filter, so that - ! they are flagged as missing value outside that filter. - do c = bounds%begc, bounds%endc - this%qflx_glcice_dyn_water_flux_col(c) = 0._r8 - end do - - end subroutine InitCold - - ! ======================================================================== - ! Science routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine HandleIceMelt(this, bounds, num_do_smb_c, filter_do_smb_c, & - waterstate_inst) - ! - ! !DESCRIPTION: - ! Compute ice melt in glacier columns, and convert liquid back to ice - ! - ! Ideally this should be called immediately after ice is melted, so that liquid is - ! converted back to ice as soon as possible. - ! - ! NOTE(wjs, 2016-06-29) Currently this is separated from the main ComputeSurfaceMassBalance - ! routine so that it can be called from the same place in the driver loop where it was - ! done before the introduction of GlacierSurfaceMassBalanceMod. This was needed to maintain - ! identical answers, due to the adjustment of h2osoi_ice and h2osoi_liq in this - ! routine. In principle we should be able to do these adjustments of h2osoi_ice and - ! h2osoi_liq later in the driver loop: this would just mean that some intervening - ! science code is operating on the temporarily-thawed state, before the water runs off - ! and is replaced by ice from below. The main reason to make this change would be to - ! simplify the driver logic, consolidating calls to this module. On the other hand, - ! having a period when there is liquid water at the top of the glacier column could - ! defeat some of the purpose of converting it immediately back to ice (i.e., so that - ! the surface fluxes are always generated based on an ice-covered surface) - so it - ! may be best to keep this separate. - ! - ! !ARGUMENTS: - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_do_smb_c ! number of column points in filter_do_smb_c - integer, intent(in) :: filter_do_smb_c(:) ! column filter for points where SMB is calculated - type(waterstate_type), intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: j - integer :: fc, c, l - real(r8) :: dtime ! land model time step (sec) - - character(len=*), parameter :: subname = 'HandleIceMelt' - !----------------------------------------------------------------------- - - associate( & - qflx_glcice_melt => this%qflx_glcice_melt_col , & ! Output: [real(r8) (:) ] ice melt (positive definite) (mm H2O/s) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - ) - - dtime = get_step_size() - - do fc = 1, num_do_smb_c - c = filter_do_smb_c(fc) - qflx_glcice_melt(c) = 0._r8 - end do - - ! Note that, because the following code only operates over the do_smb filter, that - ! means that the conversion of water back to ice only happens for glacier columns - ! where we're computing SMB. - - do j = 1, nlevgrnd - do fc = 1, num_do_smb_c - c = filter_do_smb_c(fc) - l = col%landunit(c) - - if (lun%itype(l) == istice_mec) then - if (h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater - qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime - - ! convert layer back to pure ice by "borrowing" ice from below the column - h2osoi_ice(c,j) = h2osoi_ice(c,j) + h2osoi_liq(c,j) - h2osoi_liq(c,j) = 0._r8 - end if ! liquid water is present - end if ! istice_mec - end do - end do - - end associate - - end subroutine HandleIceMelt - - !----------------------------------------------------------------------- - subroutine ComputeSurfaceMassBalance(this, bounds, num_allc, filter_allc, & - num_do_smb_c, filter_do_smb_c, glc2lnd_inst, waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Compute glacier fluxes other than ice melt. - ! - ! This sets the public fields qflx_glcice_col and qflx_glcice_dyn_water_flux_col to - ! their final values. - ! - ! Should be called after HandleIceMelt, and after waterflux_inst%qflx_snwcp_ice_col is - ! computed - ! - ! !ARGUMENTS: - class(glacier_smb_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_allc ! number of column points in filter_allc - integer, intent(in) :: filter_allc(:) ! column filter for all points - integer, intent(in) :: num_do_smb_c ! number of column points in filter_do_smb_c - integer, intent(in) :: filter_do_smb_c(:) ! column filter for points where SMB is calculated - type(glc2lnd_type), intent(in) :: glc2lnd_inst - type(waterstate_type), intent(in) :: waterstate_inst - type(waterflux_type), intent(in) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fc, c, l, g - - character(len=*), parameter :: subname = 'ComputeSurfaceMassBalance' - !----------------------------------------------------------------------- - - associate( & - qflx_glcice => this%qflx_glcice_col , & ! Output: [real(r8) (:)] net flux of new glacial ice (growth - melt) (mm H2O/s) - qflx_glcice_frz => this%qflx_glcice_frz_col , & ! Output: [real(r8) (:)] ice growth (positive definite) (mm H2O/s) - qflx_glcice_dyn_water_flux => this%qflx_glcice_dyn_water_flux_col , & ! Output: [real(r8) (:)] water flux needed for balance check due to glc_dyn_runoff_routing (mm H2O/s) (positive means addition of water to the system) - qflx_glcice_melt => this%qflx_glcice_melt_col , & ! Input: [real(r8) (:)] ice melt (positive definite) (mm H2O/s) - glc_dyn_runoff_routing => glc2lnd_inst%glc_dyn_runoff_routing_grc , & ! Input: [real(r8) (:)] whether we're doing runoff routing appropriate for having a dynamic icesheet - snow_persistence => waterstate_inst%snow_persistence_col , & ! Input: [real(r8) (:)] counter for length of time snow-covered - qflx_snwcp_ice => waterflux_inst%qflx_snwcp_ice_col & ! Input: [real(r8) (:)] excess solid h2o due to snow capping (outgoing) (mm H2O /s) [+] - ) - - ! NOTE(wjs, 2016-06-29) The following initialization is done in case the columns - ! included / excluded in the do_smb_c filter can change mid-run (besides just being - ! active vs. inactive): If an active column was inside this filter in the previous - ! timestep, but is no longer inside this filter in this timestep, we want this flux to - ! be 0 (rather than remaining at its previous value). (Currently, the set of active - ! columns included in the do_smb filter cannot change mid-run, but the logic is - ! complex enough that I don't want to assume that that will always remain true.) This - ! initialization also handles the case where glc_dyn_runoff_routing may change - ! mid-run, so that a point previously inside that mask no longer is. - do fc = 1, num_allc - c = filter_allc(fc) - qflx_glcice_dyn_water_flux(c) = 0._r8 - end do - - - ! Calculate positive surface mass balance to ice sheets, both from already-glaciated - ! landunits and from non-glaciated landunits (glacial inception) - do fc = 1, num_do_smb_c - c = filter_do_smb_c(fc) - l = col%landunit(c) - g = col%gridcell(c) - ! In the following, we convert glc_snow_persistence_max_days to r8 to avoid overflow - if ( (snow_persistence(c) >= (real(glc_snow_persistence_max_days, r8) * secspday)) & - .or. lun%itype(l) == istice_mec) then - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - else - qflx_glcice_frz(c) = 0._r8 - end if - - qflx_glcice(c) = qflx_glcice_frz(c) - qflx_glcice_melt(c) - - ! For glc_dyn_runoff_routing > 0:: - ! (1) All or part of the excess snow (from snow capping) has been incorporated in - ! qflx_glcice_frz. This flux must be included here to complete the water - ! balance, because it is a sink of water as far as CLM is concerned (this water - ! will now be owned by CISM). - ! (2) Meltwater from ice (qflx_glcice_melt) is allowed to run off and is included - ! in qflx_qrgwl, but the water content of the ice column has not changed - ! because an equivalent ice mass has been "borrowed" from the base of the - ! column. So this borrowing is a source of water as far as CLM is concerned. - ! - ! For glc_dyn_runoff_routing = 0: Point (2) is the same as for the - ! glc_dyn_runoff_routing > 0 case: there is a source of water equal to - ! qflx_glcice_melt. However, in this case, the sink of water is also equal to - ! qflx_glcice_melt: We have simply replaced some liquid water with an equal amount - ! of solid ice. Another way to think about this is: - ! (1) qflx_ice_runoff_snwcp is reduced by an amount equal to qflx_glcice_melt (done - ! elsewhere in this module). The amount of snow removal is therefore given by - ! (qflx_ice_runoff_snwcp + qflx_glcice_melt), meaning that there is an - ! additional sink of water equal to qflx_glcice_melt. - ! (2) Meltwater from ice (qflx_glcice_melt) is allowed to run off and is included - ! in qflx_qrgwl, but the water content of the ice column has not changed - ! because an equivalent ice mass has been "borrowed" from the base of the - ! column. So this borrowing is a source of water as far as CLM is concerned. - ! These two corrections cancel out, so nothing is done here. - qflx_glcice_dyn_water_flux(c) = glc_dyn_runoff_routing(g) * (qflx_glcice_melt(c) - qflx_glcice_frz(c)) - end do - - end associate - - end subroutine ComputeSurfaceMassBalance - - !----------------------------------------------------------------------- - subroutine AdjustRunoffTerms(this, bounds, num_do_smb_c, filter_do_smb_c, & - glc2lnd_inst, qflx_qrgwl, qflx_ice_runoff_snwcp) - ! - ! !DESCRIPTION: - ! Adjust liquid and ice runoff fluxes due to glacier fluxes - ! - ! Should be called after ComputeSurfaceMassBalance, and after qflx_qrgwl and - ! qflx_ice_runoff_snwcp have been given their initial values - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glacier_smb_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_do_smb_c ! number of column points in filter_do_smb_c - integer, intent(in) :: filter_do_smb_c(:) ! column filter for points where SMB is calculated - type(glc2lnd_type), intent(in) :: glc2lnd_inst - real(r8), intent(inout) :: qflx_qrgwl( bounds%begc: ) ! col qflx_surf at glaciers, wetlands, lakes - real(r8), intent(inout) :: qflx_ice_runoff_snwcp( bounds%begc: ) ! col solid runoff from snow capping (mm H2O /s) - ! - ! !LOCAL VARIABLES: - integer :: fc, c, g - - character(len=*), parameter :: subname = 'AdjustRunoffTerms' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(qflx_qrgwl) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qflx_ice_runoff_snwcp) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - qflx_glcice_frz => this%qflx_glcice_frz_col , & ! Input: [real(r8) (:)] ice growth (positive definite) (mm H2O/s) - qflx_glcice_melt => this%qflx_glcice_melt_col , & ! Input: [real(r8) (:)] ice melt (positive definite) (mm H2O/s) - glc_dyn_runoff_routing => glc2lnd_inst%glc_dyn_runoff_routing_grc & ! Input: [real(r8) (:)] gridcell fraction coupled to dynamic ice sheet - ) - - ! Note that, because the following code only operates over the do_smb filter, that - ! means that the adjustments here are only applied for glacier columns where we're - ! computing SMB. This is consistent with the use of the do_smb filter in - ! HandleIceMelt. - - do fc = 1, num_do_smb_c - c = filter_do_smb_c(fc) - g = col%gridcell(c) - - ! Melt is only generated for glacier columns. But it doesn't hurt to do this for - ! all columns in the do_smb filter: this melt term will be 0 for other columns. - ! Note: Ice melt is added to the runoff whether or not the column is coupled - ! to a dynamic glacier model. - - qflx_qrgwl(c) = qflx_qrgwl(c) + qflx_glcice_melt(c) - - ! For the part of the column that is coupled to a dynamic glacier model, - ! the glacier model handles the fate of capped snow, so we do not want it sent to runoff. - qflx_ice_runoff_snwcp(c) = qflx_ice_runoff_snwcp(c) - glc_dyn_runoff_routing(g)*qflx_glcice_frz(c) - - ! In places where we are not coupled to a dynamic glacier model, CLM sends all of - ! the snow capping to the ocean as an ice runoff term. (This is essentially a crude - ! parameterization of calving, assuming steady state - i.e., all ice gain is - ! balanced by an ice loss.) But each unit of melt that happens is an indication - ! that 1 unit of the ice shouldn't have made it to the ocean - but instead melted - ! before it got there. So we need to correct for that by removing 1 unit of ice - ! runoff for each unit of melt. Note that, for a given point in space & time, this - ! can result in negative ice runoff. However, we expect that, in a temporally and - ! spatially-integrated sense (if we're near equilibrium), this will just serve to - ! decrease the too-high positive ice runoff. - ! - ! Another way to think about this is: ice melt removes mass; the snow capping flux - ! also removes mass. If both the accumulation and melt remove mass, there is a - ! double-counting. So we need to correct that by: for each unit of ice melt - ! (resulting in 1 unit of liquid runoff), remove 1 unit of ice runoff. (This is not - ! an issue for parts of the column coupled to the dynamic glacier model, because - ! then the snow capping mass is retained in the LND-GLC coupled system.) - ! - ! The alternative of simply not adding ice melt to the runoff stream where - ! glc_dyn_runoff_routing = 0 conserves mass, but fails to conserve energy, for a - ! similar reason: Ice melt in CLM removes energy; also, the ocean's melting of the - ! snow capping flux removes energy. If both the accumulation and melting remove - ! energy, there is a double-counting. - ! - ! Yet another way to think about this is: When ice melted, we let the liquid run - ! off, and replaced it with new ice from below. But that new ice needed to come - ! from somewhere to keep the system in water balance. We "request" the new ice from - ! the ocean by generating a negataive ice runoff equivalent to the amount we have - ! melted (i.e., equivalent to the amount of new ice that we created from below). - - ! As above: Melt is only generated for glacier columns. But it doesn't hurt to do - ! this for all columns in the do_smb filter: this melt term will be 0 for other - ! columns. - - qflx_ice_runoff_snwcp(c) = qflx_ice_runoff_snwcp(c) - (1.0_r8 - glc_dyn_runoff_routing(g)) * qflx_glcice_melt(c) - - ! Recall that glc_dyn_runoff_routing = min(lfrac, Sg_icemask_coupled_fluxes_l) / lfrac. - ! - ! Consider a cell with lfrac = 0.8 and Sg_icemask_coupled_fluxes_l = 0.4. (For - ! instance, the cell might have half its land coverage in Greenland and the other - ! half in Ellemere.) Given qflx_ice_runoff_snwcp(c) = 1 m/yr, half the flux (0.5 - ! m/yr) will be sent to the runoff model, where it will be multiplied by lfrac to - ! give a net flux of 0.4 m/yr times the cell area. - ! - ! The full SMB of 1 m/yr will be sent to the coupler's prep_glc_mod, but it will be - ! weighted by 0.4 when integrating over the whole ice sheet. So a net flux of 0.4 - ! m/yr will also be applied to the ice sheet model. The total flux of 0.8 m/yr, - ! split evenly between runoff and ice sheet, is what we want. - - end do - - end associate - - end subroutine AdjustRunoffTerms - -end module GlacierSurfaceMassBalanceMod diff --git a/src/biogeophys/HumanIndexMod.F90 b/src/biogeophys/HumanIndexMod.F90 deleted file mode 100644 index b2f3d8abff..0000000000 --- a/src/biogeophys/HumanIndexMod.F90 +++ /dev/null @@ -1,1354 +0,0 @@ -module HumanIndexMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: HumanIndexMod -! -! !DESCRIPTION: -! Calculates Wetbulb Temperature, Stull Wet Bulb Temperature, -! Heat Index, Apparent Temperature, Simplified Wet Bulb -! Globe Temperature, Humidex, Discomfort Index, Stull -! Discomfort Index, Temperature Humidity Comfort Index, -! Temperature Humidity Physiology Index, Swamp Cooler -! Temperature, Kelvin to Celsius, Vapor Pressure, & QSat_2 -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type -! !PUBLIC TYPES: - implicit none - save - private -! -! !PUBLIC MEMBER FUNCTIONS: - public :: HumanIndexReadNML ! Read in the namelist for HumanIndex - public :: Wet_Bulb ! Wet bulb temperature - public :: Wet_BulbS ! Wet bulb temperature from relative humidity - public :: HeatIndex ! Heat index - public :: AppTemp ! Apparant temperature - public :: swbgt ! Simplified Wetbulb Globe temperature - public :: hmdex ! humidex, human discomfort based on heat and humidity - public :: dis_coi ! Discomfort index - public :: dis_coiS ! Discomfort index from relative humidity - public :: THIndex ! Temperature humidity index - public :: SwampCoolEff ! Swamp Cooling efficiency - public :: KtoC ! Convert Kelvin to Celcius - public :: VaporPres ! Vapor pressure - public :: QSat_2 ! Saturation mix. ratio and the change in sat. mix rat. with respect to Temp - -! -! !PUBLIC MEMBER DATA: - logical, public :: calc_human_stress_indices = .true. ! If should calculate the set of human stress indices - type, public :: humanindex_type - real(r8), pointer :: tc_ref2m_patch (:) ! Patch 2 m height surface air temperature (C) - real(r8), pointer :: vap_ref2m_patch (:) ! Patch 2 m height vapor pressure (Pa) - real(r8), pointer :: appar_temp_ref2m_patch (:) ! Patch 2 m apparent temperature (C) - real(r8), pointer :: appar_temp_ref2m_r_patch (:) ! Patch Rural 2 m apparent temperature (C) - real(r8), pointer :: swbgt_ref2m_patch (:) ! Patch 2 m Simplified Wetbulb Globe temperature (C) - real(r8), pointer :: swbgt_ref2m_r_patch (:) ! Patch Rural 2 m Simplified Wetbulb Globe temperature (C) - real(r8), pointer :: humidex_ref2m_patch (:) ! Patch 2 m Humidex (C) - real(r8), pointer :: humidex_ref2m_r_patch (:) ! Patch Rural 2 m Humidex (C) - real(r8), pointer :: wbt_ref2m_patch (:) ! Patch 2 m Stull Wet Bulb temperature (C) - real(r8), pointer :: wbt_ref2m_r_patch (:) ! Patch Rural 2 m Stull Wet Bulb temperature (C) - real(r8), pointer :: wb_ref2m_patch (:) ! Patch 2 m Wet Bulb temperature (C) - real(r8), pointer :: wb_ref2m_r_patch (:) ! Patch Rural 2 m Wet Bulb temperature (C) - real(r8), pointer :: teq_ref2m_patch (:) ! Patch 2 m height Equivalent temperature (K) - real(r8), pointer :: teq_ref2m_r_patch (:) ! Patch Rural 2 m Equivalent temperature (K) - real(r8), pointer :: ept_ref2m_patch (:) ! Patch 2 m height Equivalent Potential temperature (K) - real(r8), pointer :: ept_ref2m_r_patch (:) ! Patch Rural 2 m height Equivalent Potential temperature (K) - real(r8), pointer :: discomf_index_ref2m_patch (:) ! Patch 2 m Discomfort Index temperature (C) - real(r8), pointer :: discomf_index_ref2m_r_patch (:) ! Patch Rural 2 m Discomfort Index temperature (C) - real(r8), pointer :: discomf_index_ref2mS_patch (:) ! Patch 2 m height Discomfort Index Stull temperature (C) - real(r8), pointer :: discomf_index_ref2mS_r_patch(:) ! Patch Rural 2 m Discomfort Index Stull temperature (K) - real(r8), pointer :: nws_hi_ref2m_patch (:) ! Patch 2 m NWS Heat Index (C) - real(r8), pointer :: nws_hi_ref2m_r_patch (:) ! Patch Rural 2 m NWS Heat Index (C) - real(r8), pointer :: thip_ref2m_patch (:) ! Patch 2 m Temperature Humidity Index Physiology (C) - real(r8), pointer :: thip_ref2m_r_patch (:) ! Patch Rural 2 m Temperature Humidity Index Physiology (C) - real(r8), pointer :: thic_ref2m_patch (:) ! Patch 2 m Temperature Humidity Index Comfort (C) - real(r8), pointer :: thic_ref2m_r_patch (:) ! Patch Rural 2 m Temperature Humidity Index Comfort (C) - real(r8), pointer :: swmp65_ref2m_patch (:) ! Patch 2 m Swamp Cooler temperature 65% effi (C) - real(r8), pointer :: swmp65_ref2m_r_patch (:) ! Patch Rural 2 m Swamp Cooler temperature 65% effi (C) - real(r8), pointer :: swmp80_ref2m_patch (:) ! Patch 2 m Swamp Cooler temperature 80% effi (C) - real(r8), pointer :: swmp80_ref2m_r_patch (:) ! Patch Rural 2 m Swamp Cooler temperature 80% effi (C) - real(r8), pointer :: appar_temp_ref2m_u_patch (:) ! Patch Urban 2 m apparent temperature (C) - real(r8), pointer :: swbgt_ref2m_u_patch (:) ! Patch Urban 2 m Simplified Wetbulb Globe temperature (C) - real(r8), pointer :: humidex_ref2m_u_patch (:) ! Patch Urban 2 m Humidex (C) - real(r8), pointer :: wbt_ref2m_u_patch (:) ! Patch Urban 2 m Stull Wet Bulb temperature (C) - real(r8), pointer :: wb_ref2m_u_patch (:) ! Patch Urban 2 m Wet Bulb temperature (C) - real(r8), pointer :: teq_ref2m_u_patch (:) ! Patch Urban 2 m Equivalent - real(r8), pointer :: ept_ref2m_u_patch (:) ! Patch Urban 2 m height Equivalent Potential temperature (K) - real(r8), pointer :: discomf_index_ref2m_u_patch (:) !Urban 2 m Discomfort Index temperature (C) - real(r8), pointer :: discomf_index_ref2mS_u_patch(:) !Urban 2 m Discomfort Index Stull temperature (K) - real(r8), pointer :: nws_hi_ref2m_u_patch (:) !Urban 2 m NWS Heat Index (C) - real(r8), pointer :: thip_ref2m_u_patch (:) !Urban 2 m Temperature Humidity Index Physiology (C) - real(r8), pointer :: thic_ref2m_u_patch (:) !Urban 2 m Temperature Humidity Index Comfort (C) - real(r8), pointer :: swmp65_ref2m_u_patch (:) !Urban 2 m Swamp Cooler temperature 65% effi (C) - real(r8), pointer :: swmp80_ref2m_u_patch (:) !Urban 2 m Swamp Cooler temperature 80% effi (C) temperature (K) - contains - procedure, public :: Init ! Public initialization - procedure, private :: InitAllocate ! Private allocation method - procedure, private :: InitHistory ! Private history setup method - end type humanindex_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ -! -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-07-12 -! Modified 03-14-12--- filter routines for WB -! -! Modified 08-12-12--- filter for below zero calculation. -! Added WB = T at 0 and below -! Modified 05-13-13--- Adding additional Metrics. -! Added Apparent Temperature (Australian BOM) -! Added Simplified Wetbulb Globe Temperature -! Added Humidex -! Added Discomfort Index -! The previous Metrics were from Keith Oleson -! Added Temperature Humidity Index -! Added Swamp Cooler Efficiency -! -! Modified 05-16-13--- Added Current Vapor Pressure and -! Kelvin to Celsius and converted all -! equations that use these inputs -! Modified 08-30-13--- Finalized Comments. Added a new -! qsat algorithm. Changed wet bulb calculations -! to calculate over the large range of atmospheric -! conditions. -! Modified 03-21-14--- Changed Specific Humidity to Mixing -! Ratio. -! Modified 04-08-16--- Added new convergence routine for -! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. -! Davies-Jones is not calibrated for Tw above 40C. -! Modification makes all moisture calculations -! internal to Wet_Bulb. External input of RH used, -! Not external Q due to differences in QSat_2 and -! QSatMod at high RH and T>45C. -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Init -! -! !INTERFACE: -subroutine Init(this, bounds ) -! -! !DESCRIPTION: Initialize human index object -! -! !USES: -! !ARGUMENTS: - implicit none - class(humanindex_type) :: this - type(bounds_type) , intent(in) :: bounds -! !LOCAL VARIABLES: - type(bounds_type) :: bounds_tmp -!EOP -!----------------------------------------------------------------------- - if ( calc_human_stress_indices ) then - call this%InitAllocate ( bounds ) - call this%InitHistory ( bounds ) - else - ! Associate statements need humanindex_inst to be allocated - ! So allocate with size 1 when not being used - bounds_tmp%begp = 1 - bounds_tmp%endp = 1 - call this%InitAllocate ( bounds ) - end if - -end subroutine Init - -!------------------------------------------------------------------------ -subroutine InitAllocate(this, bounds) -! -! !DESCRIPTION: -! Initialize module data structure -! -! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) -! -! !ARGUMENTS: - class(humanindex_type) :: this - type(bounds_type), intent(in) :: bounds -! -! !LOCAL VARIABLES: - integer :: begp, endp -!------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - - allocate(this%vap_ref2m_patch (begp:endp)) ; this%vap_ref2m_patch (:) = nan - allocate(this%humidex_ref2m_u_patch (begp:endp)) ; this%humidex_ref2m_u_patch (:) = nan - allocate(this%humidex_ref2m_patch (begp:endp)) ; this%humidex_ref2m_patch (:) = nan - allocate(this%humidex_ref2m_r_patch (begp:endp)) ; this%humidex_ref2m_r_patch (:) = nan - allocate(this%nws_hi_ref2m_patch (begp:endp)) ; this%nws_hi_ref2m_patch (:) = nan - allocate(this%nws_hi_ref2m_r_patch (begp:endp)) ; this%nws_hi_ref2m_r_patch (:) = nan - allocate(this%thip_ref2m_patch (begp:endp)) ; this%thip_ref2m_patch (:) = nan - allocate(this%thip_ref2m_r_patch (begp:endp)) ; this%thip_ref2m_r_patch (:) = nan - allocate(this%thic_ref2m_patch (begp:endp)) ; this%thic_ref2m_patch (:) = nan - allocate(this%thic_ref2m_r_patch (begp:endp)) ; this%thic_ref2m_r_patch (:) = nan - allocate(this%nws_hi_ref2m_u_patch (begp:endp)) ; this%nws_hi_ref2m_u_patch (:) = nan - allocate(this%thip_ref2m_u_patch (begp:endp)) ; this%thip_ref2m_u_patch (:) = nan - allocate(this%thic_ref2m_u_patch (begp:endp)) ; this%thic_ref2m_u_patch (:) = nan - allocate(this%tc_ref2m_patch (begp:endp)) ; this%tc_ref2m_patch (:) = nan - allocate(this%appar_temp_ref2m_patch (begp:endp)) ; this%appar_temp_ref2m_patch (:) = nan - allocate(this%appar_temp_ref2m_r_patch (begp:endp)) ; this%appar_temp_ref2m_r_patch (:) = nan - allocate(this%swbgt_ref2m_patch (begp:endp)) ; this%swbgt_ref2m_patch (:) = nan - allocate(this%swbgt_ref2m_r_patch (begp:endp)) ; this%swbgt_ref2m_r_patch (:) = nan - allocate(this%wbt_ref2m_patch (begp:endp)) ; this%wbt_ref2m_patch (:) = nan - allocate(this%wbt_ref2m_r_patch (begp:endp)) ; this%wbt_ref2m_r_patch (:) = nan - allocate(this%wb_ref2m_patch (begp:endp)) ; this%wb_ref2m_patch (:) = nan - allocate(this%wb_ref2m_r_patch (begp:endp)) ; this%wb_ref2m_r_patch (:) = nan - allocate(this%teq_ref2m_patch (begp:endp)) ; this%teq_ref2m_patch (:) = nan - allocate(this%teq_ref2m_r_patch (begp:endp)) ; this%teq_ref2m_r_patch (:) = nan - allocate(this%ept_ref2m_patch (begp:endp)) ; this%ept_ref2m_patch (:) = nan - allocate(this%ept_ref2m_r_patch (begp:endp)) ; this%ept_ref2m_r_patch (:) = nan - allocate(this%discomf_index_ref2m_patch (begp:endp)) ; this%discomf_index_ref2m_patch (:) = nan - allocate(this%discomf_index_ref2m_r_patch(begp:endp)) ; this%discomf_index_ref2m_r_patch(:) = nan - allocate(this%discomf_index_ref2mS_patch(begp:endp)) ; this%discomf_index_ref2mS_patch (:) = nan - allocate(this%discomf_index_ref2mS_r_patch(begp:endp)) ; this%discomf_index_ref2mS_r_patch(:) = nan - allocate(this%discomf_index_ref2mS_u_patch(begp:endp)) ; this%discomf_index_ref2mS_u_patch(:) = nan - allocate(this%swmp65_ref2m_patch (begp:endp)) ; this%swmp65_ref2m_patch (:) = nan - allocate(this%swmp65_ref2m_r_patch (begp:endp)) ; this%swmp65_ref2m_r_patch (:) = nan - allocate(this%swmp80_ref2m_patch (begp:endp)) ; this%swmp80_ref2m_patch (:) = nan - allocate(this%swmp80_ref2m_r_patch (begp:endp)) ; this%swmp80_ref2m_r_patch (:) = nan - allocate(this%swmp80_ref2m_u_patch (begp:endp)) ; this%swmp80_ref2m_u_patch (:) = nan - allocate(this%appar_temp_ref2m_u_patch (begp:endp)) ; this%appar_temp_ref2m_u_patch (:) = nan - allocate(this%swbgt_ref2m_u_patch (begp:endp)) ; this%swbgt_ref2m_u_patch (:) = nan - allocate(this%wbt_ref2m_u_patch (begp:endp)) ; this%wbt_ref2m_u_patch (:) = nan - allocate(this%wb_ref2m_u_patch (begp:endp)) ; this%wb_ref2m_u_patch (:) = nan - allocate(this%teq_ref2m_u_patch (begp:endp)) ; this%teq_ref2m_u_patch (:) = nan - allocate(this%ept_ref2m_u_patch (begp:endp)) ; this%ept_ref2m_u_patch (:) = nan - allocate(this%discomf_index_ref2m_u_patch(begp:endp)) ; this%discomf_index_ref2m_u_patch(:) = nan - allocate(this%swmp65_ref2m_u_patch (begp:endp)) ; this%swmp65_ref2m_u_patch (:) = nan -end subroutine InitAllocate - - -!------------------------------------------------------------------------ -subroutine InitHistory(this, bounds) -! -! !DESCRIPTION: -! Initialize history data -! -! !USES: - use clm_varcon , only : spval - use histFileMod , only : hist_addfld1d -! -! !ARGUMENTS: - class(humanindex_type) :: this - type(bounds_type), intent(in) :: bounds -! -! !LOCAL VARIABLES: - integer :: begp, endp -!------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - - this%appar_temp_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='APPAR_TEMP', units='C', & - avgflag='A', long_name='2 m apparent temperature', & - ptr_patch=this%appar_temp_ref2m_patch, default='inactive') - - this%appar_temp_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='APPAR_TEMP_U', units='C', & - avgflag='A', long_name='Urban 2 m apparent temperature', & - ptr_patch=this%appar_temp_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%appar_temp_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='APPAR_TEMP_R', units='C', & - avgflag='A', long_name='Rural 2 m apparent temperature', & - ptr_patch=this%appar_temp_ref2m_r_patch, set_spec=spval, default='inactive') - - this%swbgt_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='SWBGT', units='C', & - avgflag='A', long_name='2 m Simplified Wetbulb Globe Temp', & - ptr_patch=this%swbgt_ref2m_patch) - - this%swbgt_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='SWBGT_U', units='C', & - avgflag='A', long_name='Urban 2 m Simplified Wetbulb Globe Temp', & - ptr_patch=this%swbgt_ref2m_u_patch, set_nourb=spval) - - this%swbgt_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='SWBGT_R', units='C', & - avgflag='A', long_name='Rural 2 m Simplified Wetbulb Globe Temp', & - ptr_patch=this%swbgt_ref2m_r_patch, set_spec=spval) - - this%humidex_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='HUMIDEX', units='C', & - avgflag='A', long_name='2 m Humidex', & - ptr_patch=this%humidex_ref2m_patch) - - this%humidex_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='HUMIDEX_U', units='C', & - avgflag='A', long_name='Urban 2 m Humidex', & - ptr_patch=this%humidex_ref2m_u_patch, set_nourb=spval) - - this%humidex_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='HUMIDEX_R', units='C', & - avgflag='A', long_name='Rural 2 m Humidex', & - ptr_patch=this%humidex_ref2m_r_patch, set_spec=spval) - - this%wbt_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='WBT', units='C', & - avgflag='A', long_name='2 m Stull Wet Bulb', & - ptr_patch=this%wbt_ref2m_patch) - - this%wbt_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='WBT_U', units='C', & - avgflag='A', long_name='Urban 2 m Stull Wet Bulb', & - ptr_patch=this%wbt_ref2m_u_patch, set_nourb=spval) - - this%wbt_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='WBT_R', units='C', & - avgflag='A', long_name='Rural 2 m Stull Wet Bulb', & - ptr_patch=this%wbt_ref2m_r_patch, set_spec=spval) - - this%wb_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='WBA', units='C', & - avgflag='A', long_name='2 m Wet Bulb', & - ptr_patch=this%wb_ref2m_patch, default='inactive') - - this%wb_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='WBA_U', units='C', & - avgflag='A', long_name='Urban 2 m Wet Bulb', & - ptr_patch=this%wb_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%wb_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='WBA_R', units='C', & - avgflag='A', long_name='Rural 2 m Wet Bulb', & - ptr_patch=this%wb_ref2m_r_patch, set_spec=spval, default='inactive') - - this%teq_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='TEQ', units='K', & - avgflag='A', long_name='2 m Equiv Temp', & - ptr_patch=this%teq_ref2m_patch, default='inactive') - - this%teq_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='TEQ_U', units='K', & - avgflag='A', long_name='Urban 2 m Equiv Temp', & - ptr_patch=this%teq_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%teq_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='TEQ_R', units='K', & - avgflag='A', long_name='Rural 2 m Equiv Temp', & - ptr_patch=this%teq_ref2m_r_patch, set_spec=spval, default='inactive') - - this%ept_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='EPT', units='K', & - avgflag='A', long_name='2 m Equiv Pot Temp', & - ptr_patch=this%ept_ref2m_patch, default='inactive') - - this%ept_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='EPT_U', units='K', & - avgflag='A', long_name='Urban 2 m Equiv Pot Temp', & - ptr_patch=this%ept_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%ept_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='EPT_R', units='K', & - avgflag='A', long_name='Rural 2 m Equiv Pot Temp', & - ptr_patch=this%ept_ref2m_r_patch, set_spec=spval, default='inactive') - - this%discomf_index_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOI', units='C', & - avgflag='A', long_name='2 m Discomfort Index', & - ptr_patch=this%discomf_index_ref2m_patch, default='inactive') - - this%discomf_index_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOI_U', units='C', & - avgflag='A', long_name='Urban 2 m Discomfort Index', & - ptr_patch=this%discomf_index_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%discomf_index_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOI_R', units='C', & - avgflag='A', long_name='Rural 2 m Discomfort Index', & - ptr_patch=this%discomf_index_ref2m_r_patch, set_spec=spval, default='inactive') - - this%discomf_index_ref2mS_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOIS', units='C', & - avgflag='A', long_name='2 m Stull Discomfort Index', & - ptr_patch=this%discomf_index_ref2mS_patch, default='inactive') - - this%discomf_index_ref2mS_u_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOIS_U', units='C', & - avgflag='A', long_name='Urban 2 m Stull Discomfort Index', & - ptr_patch=this%discomf_index_ref2mS_u_patch, set_nourb=spval, default='inactive') - - this%discomf_index_ref2mS_r_patch(begp:endp) = spval - call hist_addfld1d (fname='DISCOIS_R', units='C', & - avgflag='A', long_name='Rural 2 m Stull Discomfort Index', & - ptr_patch=this%discomf_index_ref2mS_r_patch, set_spec=spval, default='inactive') - - this%nws_hi_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='HIA', units='C', & - avgflag='A', long_name='2 m NWS Heat Index', & - ptr_patch=this%nws_hi_ref2m_patch) - - this%nws_hi_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='HIA_U', units='C', & - avgflag='A', long_name='Urban 2 m NWS Heat Index', & - ptr_patch=this%nws_hi_ref2m_u_patch, set_nourb=spval) - - this%nws_hi_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='HIA_R', units='C', & - avgflag='A', long_name='Rural 2 m NWS Heat Index', & - ptr_patch=this%nws_hi_ref2m_r_patch, set_spec=spval) - - this%thip_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='THIP', units='C', & - avgflag='A', long_name='2 m Temp Hum Index Physiology', & - ptr_patch=this%thip_ref2m_patch, default='inactive') - - this%thip_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='THIP_U', units='C', & - avgflag='A', long_name='Urban 2 m Temp Hum Index Physiology', & - ptr_patch=this%thip_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%thip_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='THIP_R', units='C', & - avgflag='A', long_name='Rural 2 m Temp Hum Index Physiology', & - ptr_patch=this%thip_ref2m_r_patch, set_spec=spval, default='inactive') - - this%thic_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='THIC', units='C', & - avgflag='A', long_name='2 m Temp Hum Index Comfort', & - ptr_patch=this%thic_ref2m_patch, default='inactive') - - this%thic_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='THIC_U', units='C', & - avgflag='A', long_name='Urban 2 m Temp Hum Index Comfort', & - ptr_patch=this%thic_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%thic_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='THIC_R', units='C', & - avgflag='A', long_name='Rural 2 m Temp Hum Index Comfort', & - ptr_patch=this%thic_ref2m_r_patch, set_spec=spval, default='inactive') - - this%swmp65_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP65', units='C', & - avgflag='A', long_name='2 m Swamp Cooler Temp 65% Eff', & - ptr_patch=this%swmp65_ref2m_patch, default='inactive') - - this%swmp65_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP65_U', units='C', & - avgflag='A', long_name='Urban 2 m Swamp Cooler Temp 65% Eff', & - ptr_patch=this%swmp65_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%swmp65_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP65_R', units='C', & - avgflag='A', long_name='Rural 2 m Swamp Cooler Temp 65% Eff', & - ptr_patch=this%swmp65_ref2m_r_patch, set_spec=spval, default='inactive') - - this%swmp80_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP80', units='C', & - avgflag='A', long_name='2 m Swamp Cooler Temp 80% Eff', & - ptr_patch=this%swmp80_ref2m_patch, default='inactive') - - this%swmp80_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP80_U', units='C', & - avgflag='A', long_name='Urban 2 m Swamp Cooler Temp 80% Eff', & - ptr_patch=this%swmp80_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%swmp80_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='SWMP80_R', units='C', & - avgflag='A', long_name='Rural 2 m Swamp Cooler Temp 80% Eff', & - ptr_patch=this%swmp80_ref2m_r_patch, set_spec=spval, default='inactive') - -end subroutine InitHistory - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: HumanIndexReadNML -! -! !INTERFACE: - subroutine HumanIndexReadNML( NLFilename ) -! -! !DESCRIPTION: -! -! !USES: - use shr_mpi_mod , only : shr_mpi_bcast - use abortutils , only : endrun - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg -! -! !ARGUMENTS: - implicit none - character(len=*), intent(IN) :: NLFilename ! Namelist filename -! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'UrbanReadNML' ! subroutine name -!EOP -!----------------------------------------------------------------------- - namelist / clm_humanindex_inparm / calc_human_stress_indices - - ! ---------------------------------------------------------------------- - ! Read namelist from input namelist filename - ! ---------------------------------------------------------------------- - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in clm_humanindex_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_humanindex_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_humanindex_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_humanindex_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_humanindex_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - ! Broadcast namelist variables read in - call shr_mpi_bcast(calc_human_stress_indices, mpicom) - - end subroutine HumanIndexReadNML - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: AppTemp -! -! !INTERFACE: - subroutine AppTemp (Tc_1, vap_pres, u10_m, app_temp) -! -! !DESCRIPTION: -! Apparent Temperature (Australian BOM): Here we use equation 22 -! where AT is a function of air temperature (C), water -! vapor pressure (kPa), and 10-m wind speed (m/s). vap_pres -! from Erich Fischer (consistent with CLM equations) -! -! Reference: Steadman, R.G., 1994: Norms of apparent temperature -! in Australia, Aust. Met. Mag., 43, 1-16. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_1 ! temperature (C) - real(r8), intent(in) :: vap_pres ! Vapor Pressure (pa) - real(r8), intent(in) :: u10_m ! Winds at 10m (m/s) - real(r8), intent(out) :: app_temp ! Apparent Temperature (C) -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - app_temp = Tc_1 + 3.30_r8*vap_pres/1000._r8 - 0.70_r8*u10_m - 4.0_r8 - - end subroutine AppTemp -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: swbgt -! -! !INTERFACE: - subroutine swbgt (Tc_2, vap_pres, s_wbgt) -! -! !DESCRIPTION: -! Simplified Wet Bulb Globe Temperature: -! Requires air temperature (C), water vapor pressure (hPa) -! -! Reference: Willett, K.M., and S. Sherwood, 2010: Exceedance of heat -! index thresholds for 15 regions under a warming -! climate using the wet-bulb globe temperature, -! Int. J. Climatol., doi:10.1002/joc.2257 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_2 ! temperature (C) - real(r8), intent(in) :: vap_pres ! Vapor Pressure (pa) - real(r8), intent(out) :: s_wbgt ! Simplified Wet Bulb Globe Temperature (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - s_wbgt = 0.567_r8*(Tc_2) + 0.393_r8*vap_pres/100._r8 + 3.94_r8 - - end subroutine swbgt -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hmdex -! -! !INTERFACE: - subroutine hmdex (Tc_3, vap_pres, humidex) -! -! !DESCRIPTION: -! Humidex: -! Requires air temperature (C), water vapor pressure (hPa) -! Reference: Masterson, J., and F. Richardson, 1979: Humidex, a -! method of quantifying human discomfort due to -! excessive heat and humidity, CLI 1-79, Environment -! Canada, Atmosheric Environment Service, Downsview, Ontario -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_3 ! temperature (C) - real(r8), intent(in) :: vap_pres ! Vapor Pressure (Pa) - real(r8), intent(out) :: humidex ! Humidex (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - humidex = Tc_3 + ((5._r8/9._r8) * (vap_pres/100._r8 - 10._r8)) - - end subroutine hmdex -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: dis_coi -! -! !INTERFACE: - subroutine dis_coi (Tc_4, wb_t, discoi) -! -! !DESCRIPTION: -! Discomfort Index -! The wet bulb temperature is from Davies-Jones, 2008. -! Requires air temperature (C), wet bulb temperature (C) -! Reference: Epstein, Y., and D.S. Moran, 2006: Thermal comfort and the heat stress indices, -! Ind. Health, 44, 388-398. -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_4 ! temperature (C) - real(r8), intent(in) :: wb_t ! Wet Bulb Temperature (C) - real(r8), intent(out) :: discoi ! Discomfort Index (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - discoi = 0.5_r8*wb_t + 0.5_r8*Tc_4 - - end subroutine dis_coi -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: dis_coiS -! -! !INTERFACE: - subroutine dis_coiS (Tc_5, relhum, wbt_s, discois) -! -! !DESCRIPTION: -! Discomfort Index -! The wet bulb temperature is from Stull, 2011. -! Requires air temperature (C), wet bulb temperature (C) -! Reference: Epstein, Y., and D.S. Moran, 2006: Thermal comfort and the heat stress indices, -! Ind. Health, 44, 388-398. -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_5 ! temperature (C) - real(r8), intent(in) :: wbt_s ! Wet Bulb Temperature (C) - real(r8), intent(in) :: relhum ! Relative Humidity (%) - real(r8), intent(out) :: discois ! Discomfort Index (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: Tc ! 2-m temperature with limit (C) - real(r8) :: rh ! 2-m relative humidity with limit (%) - real(r8) :: rh_min ! Minimum 2-m relative humidity (%) - -! -!----------------------------------------------------------------------- - Tc = min(Tc_5,50._r8) - rh = min(relhum,99._r8) - rh = max(rh,5._r8) - rh_min = Tc*(-2.27_r8)+27.7_r8 - if (Tc < -20._r8 .or. rh < rh_min) then - ! wbt_s calculation invalid - discois = Tc - else - ! wbt_s calculation valid - discois = 0.5_r8*wbt_s + 0.5_r8*Tc - end if - - end subroutine dis_coiS -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Wet_Bulb -! -! !INTERFACE: - subroutine Wet_Bulb (Tin_1,vape,pin,relhum,qin,Teq,epott,wb_it) - -! -! !DESCRIPTION: -! Calculates Wet Bulb Temperature, Theta_wb, Theta_e, Moist Pot Temp, -! Lifting Cond Temp, and Equiv Temp using Davies-Jones 2008 Method. -! 1st calculates the lifting cond temperature (Bolton 1980 eqn 22). -! Then calculates the moist pot temp (Bolton 1980 eqn 24). Then -! calculates Equivalent Potential Temperature (Bolton 1980 eqn 39). -! From equivalent pot temp, equiv temp and Theta_w (Davies-Jones -! 2008 eqn 3.5-3.8). An accurate 'first guess' of wet bulb temperature -! is determined (Davies-Jones 2008 eqn 4.8-4.11). Newton-Raphson -! is used for 2 iterations, determining final wet bulb temperature -! (Davies-Jones 2008 eqn 2.6). -! Requires Temperature,Vapor Pressure,Atmospheric Pressure,Relative Humidity,Mixing Ratio -! Reference: Bolton: The computation of equivalent potential temperature. -! Monthly weather review (1980) vol. 108 (7) pp. 1046-1053 -! Davies-Jones: An efficient and accurate method for computing the -! wet-bulb temperature along pseudoadiabats. Monthly Weather Review -! (2008) vol. 136 (7) pp. 2764-2785 -! Flatau et al: Polynomial fits to saturation vapor pressure. -! Journal of Applied Meteorology (1992) vol. 31 pp. 1507-1513 -! Note: Pressure needs to be in mb, mixing ratio needs to be in -! kg/kg in some equations, and in g/kg in others. -! Calculates Iteration via Newton-Raphson Method. Only 2 iterations. -! Reference: Davies-Jones: An efficient and accurate method for computing the -! wet-bulb temperature along pseudoadiabats. Monthly Weather Review -! (2008) vol. 136 (7) pp. 2764-2785 -! Flatau et al: Polynomial fits to saturation vapor pressure. -! Journal of Applied Meteorology (1992) vol. 31 pp. 1507-1513 -! Note: Pressure needs to be in mb, mixing ratio needs to be in -! kg/kg in some equations. -! -! !REVISION HISTORY: -! -! Created by Jonathan R Buzan 03-07-12 -! Modified JRBuzan 06-29-13: Major Revision. Changes all Calculations to be based -! upon Bolton eqn 39. Uses Derivatives in Davies-Jones -! 2008 for calculation of vapor pressure. -! Modified JRBuzan 03-21-14: Minor Revision. Changed specific humidity to mixing -! ratio. -! Modified JRBuzan 04-08-16: Added new convergence routine for -! Wet_Bulb. CLM4.5 Inputs at 50C 100% RH cause NaN. -! Davies-Jones is not calibrated for Tw above 40C. -! Modification makes all moisture calculations -! internal to Wet_Bulb. External input of RH used, -! Not external Q due to differences in QSat_2 and -! QSatMod at high RH and T>45C. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ - use clm_varctl , only: iulog -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tin_1 ! 2-m air temperature (K) - real(r8), intent(in) :: vape ! Vapor Pressure (Pa) - real(r8), intent(in) :: pin ! Atmospheric Pressure (Pa) - real(r8), intent(in) :: relhum ! Relative Humidity (%) - real(r8), intent(in) :: qin ! Specific Humidity (kg/kg) - - real(r8), intent(out) :: Teq ! Equivalent Temperature (K) - real(r8), intent(out) :: epott ! Equivalent Potential Temperature (K) - real(r8), intent(out) :: wb_it ! Wet bulb Temperature (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: k1 ! Quadratic Parameter (C) - real(r8) :: k2 ! Quadratic Parameter scaled by X (C) - real(r8) :: pmb ! Atmospheric Surface Pressure (mb) - real(r8) :: D ! Linear Interpolation of X - - real(r8) :: constA = 2675._r8 ! Constant used for extreme cold temparatures (K) - real(r8) :: grms = 1000._r8 ! Gram per Kilogram (g/kg) - real(r8) :: p0 = 1000._r8 ! surface pressure (mb) - real(r8) :: C ! Temperature of Freezing (K) - - real(r8) :: hot ! Dimensionless Quantity used for changing temperature regimes - real(r8) :: cold ! Dimensionless Quantity used for changing temperature regimes - - real(r8) :: kappad = 0.2854_r8 ! Heat Capacity - real(r8) :: T1 ! Temperature (K) - real(r8) :: vapemb ! Vapor Pressure (mb) - real(r8) :: mixr ! Mixing Ratio (g/kg) - - real(r8) :: es_mb_teq ! saturated vapour pressure for wrt TEQ (mb) - real(r8) :: de_mbdTeq ! Derivative of Saturated Vapor pressure wrt TEQ (mb/K) - real(r8) :: dlnes_mbdTeq ! Log derivative of the sat. vap pressure wrt TEQ (mb/K) - real(r8) :: rs_teq ! Mixing Ratio wrt TEQ (kg/kg) - real(r8) :: rsdTeq ! Derivative of Mixing Ratio wrt TEQ (kg/kg/K) - real(r8) :: foftk_teq ! Function of EPT wrt TEQ - real(r8) :: fdTeq ! Derivative of Function of EPT wrt TEQ - - real(r8) :: wb_temp ! Wet Bulb Temperature First Guess (C) - real(r8) :: es_mb_wb_temp ! Vapor Pressure wrt Wet Bulb Temp (mb) - real(r8) :: de_mbdwb_temp ! Derivative of Sat. Vapor Pressure wrt WB Temp (mb/K) - real(r8) :: dlnes_mbdwb_temp ! Log Derivative of sat. vap. pressure wrt WB Temp (mb/K) - real(r8) :: rs_wb_temp ! Mixing Ratio wrt WB Temp (kg/kg) - real(r8) :: rsdwb_temp ! Derivative of Mixing Ratio wrt WB Temp (kg/kg/K) - real(r8) :: foftk_wb_temp ! Function of EPT wrt WB Temp - real(r8) :: fdwb_temp ! Derivative of function of EPT wrt WB Temp - - real(r8) :: tl ! Lifting Condensation Temperature (K) - real(r8) :: theta_dl ! Moist Potential Temperature (K) - real(r8) :: pi ! Non dimensional Pressure - real(r8) :: X ! Ratio of equivalent temperature to freezing scaled by Heat Capacity - real(r8) :: vapemb_sat ! Saturated vapor pressure (mb) - real(r8) :: de_mbdT_sat ! Saturated d(es)/d(T) - real(r8) :: dlnes_mbdT_sat ! Saturated dln(es)/d(T) - real(r8) :: rs_T_sat ! Saturated humidity (kg/kg) - real(r8) :: rsdT_sat ! Saturated d(qs)/d(T) - real(r8) :: foftk_t_sat ! Saturated Davies-Jones eqn 2.3 - real(r8) :: fdT_sat ! Saturated d(f)/d(T) - real(r8) :: convergence = 0.00001_r8 ! Convergence value - real(r8) :: wb_temp_new ! Wet Bulb Temperature Subsequent Guess (C) - integer :: iter ! Iteration number - integer :: max_iter = 10000 ! Iteration Maximum - integer :: converged ! Converge Result: 0 = No, 1 = Yes - integer :: j ! Iteration Step Number -!----------------------------------------------------------------------- - - C = SHR_CONST_TKFRZ ! Freezing Temperature - pmb = pin*0.01_r8 ! pa to mb - T1 = Tin_1 ! Use holder for T - - call QSat_2(T1, pin, vapemb_sat, de_mbdT_sat, dlnes_mbdT_sat, rs_T_sat, rsdT_sat, foftk_t_sat, fdT_sat) - - vapemb = vapemb_sat * relhum * 0.01_r8 ! vapor pressure (mb) - mixr = rs_T_sat * relhum * 0.01_r8 * grms ! change specific humidity to mixing ratio (g/kg) - - ! Calculate Equivalent Pot. Temp (pmb, T, mixing ratio (g/kg), pott, epott) - ! Calculate Parameters for Wet Bulb Temp (epott, pmb) - pi = (pmb/p0)**(kappad) - D = (0.1859_r8*pmb/p0 + 0.6512)**(-1._r8) - k1 = -38.5_r8*pi*pi +137.81_r8*pi -53.737_r8 - k2 = -4.392_r8*pi*pi +56.831_r8*pi -0.384_r8 - - ! Calculate lifting condensation level. first eqn - ! uses vapor pressure (mb) - ! 2nd eqn uses relative humidity. - ! first equation: Bolton 1980 Eqn 21. - ! tl = (2840._r8/(3.5_r8*log(T1) - log(vapemb) - 4.805_r8)) + 55._r8 - ! second equation: Bolton 1980 Eqn 22. relhum = relative humidity - tl = (1._r8/((1._r8/((T1 - 55._r8))) - (log(relhum/100._r8)/2840._r8))) + 55._r8 - - ! Theta_DL: Bolton 1980 Eqn 24. - theta_dl = T1*((p0/(pmb-vapemb))**kappad)*((T1/tl)**(mixr*0.00028_r8)) - - ! EPT: Bolton 1980 Eqn 39. - epott = theta_dl*exp(((3.036_r8/tl)-0.00178_r8)*mixr*(1._r8 + 0.000448_r8*mixr)) - Teq = epott*pi ! Equivalent Temperature at pressure - X = (C/Teq)**3.504_r8 - - ! Calculates the regime requirements of wet bulb equations. - if (Teq > 355.15_r8) then - hot = 1.0_r8 - else - hot = 0.0_r8 - endif - - if ((X >= 1._r8) .AND. (X <= D)) then - cold = 0._r8 - else - cold = 1._r8 - endif - - ! Calculate Wet Bulb Temperature, initial guess - ! Extremely cold regime if X.gt.D then need to - ! calculate dlnesTeqdTeq - if (X > D) then - call QSat_2(Teq, pin, es_mb_teq, de_mbdTeq, dlnes_mbdTeq, rs_teq, rsdTeq, foftk_teq, fdTeq) - wb_temp = Teq - C - ((constA*rs_teq)/(1._r8 + (constA*rs_teq*dlnes_mbdTeq))) - else - wb_temp = k1 - 1.21_r8 * cold - 1.45_r8 * hot - (k2 - 1.21_r8 * cold) * X + (0.58_r8 / X) * hot - endif - - converged = 0 - iter = 0 - do while ( converged .eq. 0 .and. iter < max_iter) - - iter = iter + 1 - if ( wb_temp > 100._r8 ) exit - call QSat_2(wb_temp+C, pin, es_mb_wb_temp, de_mbdwb_temp, dlnes_mbdwb_temp, & - rs_wb_temp, rsdwb_temp, foftk_wb_temp, fdwb_temp) - wb_temp_new = wb_temp - ((foftk_wb_temp - X)/fdwb_temp) - - if ( abs(wb_temp - wb_temp_new) < convergence ) converged = 1 - wb_temp = (0.9_r8*wb_temp + 0.1_r8*wb_temp_new) - - end do - - if ( converged .eq. 1 ) then - wb_it = wb_temp - else - wb_it = T1 - C ! Place Holder. wet bulb temperature same as dry bulb (C) - write(iulog,*) 'WARNING: Wet_Bulb algorithm failed to converge. Setting to T: WB, P, T, RH, Q, VaporP: ', & - wb_it, pin, T1, relhum, qin, vape - endif - - end subroutine Wet_Bulb -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Wet_BulbS -! -! !INTERFACE: - subroutine Wet_BulbS (Tc_6,rh,wbt) - -! -! !DESCRIPTION: -! Reference: Stull, R., 2011: Wet-bulb temperature from relative humidity -! and air temperature, J. Appl. Meteor. Climatol., doi:10.1175/JAMC-D-11-0143.1 -! Note: Requires air temperature (C) and relative humidity (%) -! Note: Pressure needs to be in mb, mixing ratio needs to be in -! kg/kg in some equations. -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-07-12 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_6 ! Temperature (C) - real(r8), intent(in) :: rh ! Relative Humidity (%) - real(r8), intent(out) :: wbt ! Wet Bulb Temperature (C) -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! - wbt = Tc_6 * atan(0.151977_r8*sqrt(rh + 8.313659_r8)) + & - atan(Tc_6+rh) - atan(rh-1.676331_r8) + & - 0.00391838_r8*rh**(3._r8/2._r8)*atan(0.023101_r8*rh) - & - 4.686035_r8 - - end subroutine Wet_BulbS -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: HeatIndex -! -! !INTERFACE: - subroutine HeatIndex (Tc_7, rh, hi) -! -! !DESCRIPTION: -! National Weather Service Heat Index -! Requires air temperature (F), relative humidity (%) -! Valid for air temperatures above 20C. If below this set heatindex to air temperature. -! Reference: Steadman. The assessment of sultriness. Part I: -! A temperature-humidity index based on human physiology -! and clothing science. J Appl Meteorol (1979) vol. 18 (7) pp. 861-873 -! Lans P. Rothfusz. "The heat index 'equation' (or -! more than you ever wanted to know about heat index)", -! Scientific Services Division (NWS Southern Region Headquarters), 1 July 1990 -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-07-12 -! Modified JRBuzan 03-10-12 -! Modified JRBuzan 05-14-13: removed testing algorithm -! Switched output to Celsius -! Used Boundary Conditions from -! Keith Oleson -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_7 ! temperature (C) - real(r8), intent(in) :: rh ! relative humidity (%) - real(r8), intent(out) :: hi ! Heat Index (C) -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: tf -! -!----------------------------------------------------------------------- - tf = (Tc_7) * 9._r8/5._r8 + 32._r8 ! fahrenheit - - if (tf < 68._r8) then - hi = tf - else - hi = -42.379_r8 + 2.04901523_r8*tf & - + 10.14333127_r8*rh & - + (-0.22475541_r8*tf*rh) & - + (-6.83783e-3_r8*tf**2._r8) & - + (-5.481717e-2_r8*rh**2._r8) & - + 1.22874e-3_r8*(tf**2._r8)*rh & - + 8.5282e-4_r8*tf*rh**2._r8 & - + (-1.99e-6_r8*(tf**2._r8)*(rh**2._r8)) - endif - hi = (hi - 32._r8) * 5._r8/9._r8 ! Celsius - - end subroutine HeatIndex -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: THIndex -! -! !INTERFACE: - subroutine THIndex (Tc_8, wb_t, thic, thip) -! -! !DESCRIPTION: -! Temperature Humidity Index -! The wet bulb temperature is Davies-Jones 2008 (subroutine WetBulb) -! Requires air temperature (C), wet bulb temperature (C) -! Calculates two forms of the index: Comfort and Physiology -! Reference: NWSCR (1976): Livestock hot weather stress. -! Regional operations manual letter C-31-76. -! National Weather Service Central Region, USA -! Ingram: Evaporative cooling in the pig. Nature (1965) -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-15-13 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_8 ! temperature (C) - real(r8), intent(in) :: wb_t ! Wet Bulb Temperature (C) - real(r8), intent(out) :: thic ! Temperature Humidity Index Comfort (C) - real(r8), intent(out) :: thip ! Temperature Humidity Index Physiology (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! -! real(r8) :: - -! -!----------------------------------------------------------------------- - thic = 0.72_r8*wb_t + 0.72_r8*(Tc_8) + 40.6_r8 - thip = 0.63_r8*wb_t + 1.17_r8*(Tc_8) + 32._r8 - - end subroutine THIndex -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SwampCoolEff -! -! !INTERFACE: - subroutine SwampCoolEff (Tc_9, wb_t, tswmp80, tswmp65) -! -! !DESCRIPTION: -! Swamp Cooler Efficiency -! The wet bulb temperature is Davies-Jones 2008 (subroutine WetBulb) -! Requires air temperature (C), wet bulb temperature (C) -! Assumes that the Swamp Cooler Efficiency 80% (properly maintained) -! and 65% (improperly maintained). -! Reference: Koca et al: Evaporative cooling pads: test -! procedure and evaluation. Applied engineering -! in agriculture (1991) vol. 7 -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-15-13 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: Tc_9 ! temperature (C) - real(r8), intent(in) :: wb_t ! Wet Bulb Temperature (C) - real(r8), intent(out) :: tswmp80 ! Swamp Cooler Temp 80% Efficient (C) - real(r8), intent(out) :: tswmp65 ! Swamp Cooler Temp 65% Efficient (C) - -! -! !CALLED FROM: -! subroutine LakeFluxes in module LakeFluxesMod -! subroutine CanopyFluxes in module CanopyFluxesMod -! subroutine UrbanFluxes in module UrbanFluxesMod -! subroutine BareGroundFluxes in module BareGroundFluxesMod -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: neu80 = 0.80_r8 ! 80% Efficient - real(r8) :: neu65 = 0.65_r8 ! 65% Efficient - -! -!----------------------------------------------------------------------- - tswmp80 = Tc_9 - neu80*(Tc_9 - wb_t) - tswmp65 = Tc_9 - neu65*(Tc_9 - wb_t) - - end subroutine SwampCoolEff -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: KtoC -! -! !INTERFACE: - subroutine KtoC (T_k, T_c) -! -! !DESCRIPTION: -! Converts Kelvins to Celsius -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-16-13 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: T_k ! temperature (K) - real(r8), intent(out) :: T_c ! temperature (C) - -! -! !CALLED FROM: -! subroutines within this module -! -! !LOCAL VARIABLES: -!EOP -! -! real(r8) :: - -! -!----------------------------------------------------------------------- - T_c = T_k - SHR_CONST_TKFRZ - - end subroutine KtoC -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: VaporPres -! -! !INTERFACE: - subroutine VaporPres (rh, e, erh) -! -! !DESCRIPTION: -! Calculates Vapor Pressure -! Vapor Pressure from Erich Fischer (consistent with CLM -! equations, Keith Oleson) -! !REVISION HISTORY: -! Created by Jonathan R Buzan 03-16-13 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: rh ! Relative Humidity (%) - real(r8), intent(in) :: e ! Saturated Vapor Pressure (Pa) - real(r8), intent(out) :: erh ! Vapor Pressure (Pa) - -! -! !CALLED FROM: -! subroutines within this module -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - erh = (rh/100._r8) *e ! Pa - - end subroutine VaporPres -!EOP -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: QSat_2 -! -! !INTERFACE: - subroutine QSat_2 (T_k, p_t, es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT) -! -! !DESCRIPTION: -! Computes saturation mixing ratio and the change in saturation -! mixing ratio with respect to temperature. Uses Bolton eqn 10, 39. -! Davies-Jones eqns 2.3,A.1-A.10 -! Reference: Bolton: The computation of equivalent potential temperature. -! Monthly weather review (1980) vol. 108 (7) pp. 1046-1053 -! Davies-Jones: An efficient and accurate method for computing the -! wet-bulb temperature along pseudoadiabats. Monthly Weather Review -! (2008) vol. 136 (7) pp. 2764-2785 -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: T_k ! temperature (K) - real(r8), intent(in) :: p_t ! surface atmospheric pressure (pa) - real(r8), intent(out) :: es_mb ! vapor pressure (pa) - real(r8), intent(out) :: de_mbdT ! d(es)/d(T) - real(r8), intent(out) :: dlnes_mbdT ! dln(es)/d(T) - real(r8), intent(out) :: rs ! humidity (kg/kg) - real(r8), intent(out) :: rsdT ! d(qs)/d(T) - real(r8), intent(out) :: foftk ! Davies-Jones eqn 2.3 - real(r8), intent(out) :: fdT ! d(f)/d(T) - -! -! !CALLED FROM: -! subroutines within this module -! -! !REVISION HISTORY: -! Created by: Jonathan R Buzan 08/08/13 -! -! !LOCAL VARIABLES: -!EOP -! -! - real(r8) :: lambd_a = 3.504_r8 ! Inverse of Heat Capacity - real(r8) :: alpha = 17.67_r8 ! Constant to calculate vapour pressure - real(r8) :: beta = 243.5_r8 ! Constant to calculate vapour pressure - real(r8) :: epsilon = 0.6220_r8 ! Conversion between pressure/mixing ratio - real(r8) :: es_C = 6.112_r8 ! Vapor Pressure at Freezing STD (mb) - real(r8) :: vkp = 0.2854_r8 ! Heat Capacity - real(r8) :: y0 = 3036._r8 ! constant - real(r8) :: y1 = 1.78_r8 ! constant - real(r8) :: y2 = 0.448_r8 ! constant - real(r8) :: Cf = SHR_CONST_TKFRZ ! Freezing Temp (K) - real(r8) :: refpres = 1000._r8 ! Reference Pressure (mb) - real(r8) :: p_tmb ! Pressure (mb) - real(r8) :: ndimpress ! Non-dimensional Pressure - real(r8) :: prersdt ! Place Holder for derivative humidity - real(r8) :: pminuse ! Vapor Pressure Difference (mb) - real(r8) :: tcfbdiff ! Temp diff ref (C) - real(r8) :: p0ndplam ! dimensionless pressure modified by ref pressure - - real(r8) :: rsy2rs2 ! Constant function of humidity - real(r8) :: oty2rs ! Constant function of humidity - real(r8) :: y0tky1 ! Constant function of Temp - - real(r8) :: d2e_mbdT2 ! d2(es)/d(T)2 - real(r8) :: d2rsdT2 ! d2(r)/d(T)2 - real(r8) :: goftk ! g(T) exponential in f(T) - real(r8) :: gdT ! d(g)/d(T) - real(r8) :: d2gdT2 ! d2(g)/d(T)2 - - real(r8) :: d2fdT2 ! d2(f)/d(T)2 (K) -! -!----------------------------------------------------------------------- - ! Constants used to calculate es(T) - ! Clausius-Clapeyron - p_tmb = p_t*0.01_r8 - tcfbdiff = T_k - Cf + beta - es_mb = es_C*exp(alpha*(T_k - Cf)/(tcfbdiff)) - dlnes_mbdT = alpha*beta/((tcfbdiff)*(tcfbdiff)) - pminuse = p_tmb - es_mb - de_mbdT = es_mb*dlnes_mbdT - d2e_mbdT2 = dlnes_mbdT*(de_mbdT - 2*es_mb/(tcfbdiff)) - - ! Constants used to calculate rs(T) - ndimpress = (p_tmb/refpres)**vkp - p0ndplam = refpres*ndimpress**lambd_a - rs = epsilon*es_mb/(p0ndplam - es_mb) - prersdt = epsilon*p_tmb/((pminuse)*(pminuse)) - rsdT = prersdt*de_mbdT - d2rsdT2 = prersdt*(d2e_mbdT2 -de_mbdT*de_mbdT*(2._r8/(pminuse))) - - ! Constants used to calculate g(T) - rsy2rs2 = rs + y2*rs*rs - oty2rs = 1._r8 + 2._r8*y2*rs - y0tky1 = y0/T_k - y1 - goftk = y0tky1*(rs + y2*rs*rs) - gdT = - y0*(rsy2rs2)/(T_k*T_k) + (y0tky1)*(oty2rs)*rsdT - d2gdT2 = 2._r8*y0*rsy2rs2/(T_k*T_k*T_k) - 2._r8*y0*rsy2rs2*(oty2rs)*rsdT + & - y0tky1*2._r8*y2*rsdT*rsdT + y0tky1*oty2rs*d2rsdT2 - - ! Calculations for used to calculate f(T,ndimpress) - foftk = ((Cf/T_k)**lambd_a)*(1._r8 - es_mb/p0ndplam)**(vkp*lambd_a)* & - exp(-lambd_a*goftk) - fdT = -lambd_a*(1._r8/T_k + vkp*de_mbdT/pminuse + gdT) - d2fdT2 = lambd_a*(1._r8/(T_k*T_k) - vkp*de_mbdT*de_mbdT/(pminuse*pminuse) - & - vkp*d2e_mbdT2/pminuse - d2gdT2) - - end subroutine QSat_2 -!EOP -!----------------------------------------------------------------------- - -end module HumanIndexMod - diff --git a/src/biogeophys/HydrologyDrainageMod.F90 b/src/biogeophys/HydrologyDrainageMod.F90 deleted file mode 100644 index 3dd434661b..0000000000 --- a/src/biogeophys/HydrologyDrainageMod.F90 +++ /dev/null @@ -1,225 +0,0 @@ -module HydrologyDrainageMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates soil/snow hydrology with drainage (subsurface runoff) - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varctl , only : iulog, use_vichydro - use clm_varcon , only : e_ice, denh2o, denice, rpi, spval - use atm2lndType , only : atm2lnd_type - use glc2lndMod , only : glc2lnd_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use IrrigationMod , only : irrigation_type - use GlacierSurfaceMassBalanceMod, only : glacier_smb_type - use TotalWaterAndHeatMod, only : ComputeWaterMassNonLake - use LandunitType , only : lun - use ColumnType , only : col - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: HydrologyDrainage ! Calculates soil/snow hydrolog with drainage - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine HydrologyDrainage(bounds, & - num_nolakec, filter_nolakec, & - num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - num_do_smb_c, filter_do_smb_c, & - atm2lnd_inst, glc2lnd_inst, temperature_inst, & - soilhydrology_inst, soilstate_inst, waterstate_inst, waterflux_inst, & - irrigation_inst, glacier_smb_inst) - ! - ! !DESCRIPTION: - ! Calculates soil/snow hydrology with drainage (subsurface runoff) - ! - ! !USES: - use landunit_varcon , only : istwet, istsoil, istice_mec, istcrop - use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv, icol_sunwall, icol_shadewall - use clm_varcon , only : denh2o, denice - use clm_varctl , only : use_vichydro - use clm_varpar , only : nlevgrnd, nlevurb - use clm_time_manager , only : get_step_size, get_nstep - use SoilHydrologyMod , only : CLMVICMap, Drainage, PerchedLateralFlow, LateralFlowPowerLaw - use SoilWaterMovementMod , only : use_aquifer_layer - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: num_do_smb_c ! number of columns in which SMB is calculated, in column filter - integer , intent(in) :: filter_do_smb_c(:) ! column filter for bare landwhere SMB is calculated - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(glc2lnd_type) , intent(in) :: glc2lnd_inst - type(temperature_type) , intent(in) :: temperature_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(irrigation_type) , intent(in) :: irrigation_inst - type(glacier_smb_type) , intent(in) :: glacier_smb_inst - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,j,fc ! indices - real(r8) :: dtime ! land model time step (sec) - !----------------------------------------------------------------------- - - associate( & ! Input: layer thickness depth (m) - dz => col%dz , & ! Input: column type - ctype => col%itype , & ! Input: gridcell flux of flood water from RTM - qflx_floodg => atm2lnd_inst%forc_flood_grc , & ! Input: rain rate [mm/s] - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: snow rate [mm/s] - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: water mass begining of the time step - begwb => waterstate_inst%begwb_col , & ! Output:water mass end of the time step - endwb => waterstate_inst%endwb_col , & ! Output:water mass end of the time step - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: liquid water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: volumetric soil water - ! (0<=h2osoi_vol<=watsat) [m3/m3] - qflx_evap_tot => waterflux_inst%qflx_evap_tot_col , & ! Input: qflx_evap_soi + qflx_evap_can + qflx_tran_veg - qflx_snwcp_ice => waterflux_inst%qflx_snwcp_ice_col , & ! Input: excess solid h2o due to snow - ! capping (outgoing) (mm H2O /s) [+] - qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! excess solid h2o due to snow capping, - ! which we simply discard in order to reset - ! the snow pack (mm H2O /s) [+] - qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! excess liquid h2o due to snow capping, - ! which we simply discard in order to reset - ! the snow pack (mm H2O /s) [+] - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! surface water runoff (mm/s) - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! sub-surface runoff from perched zwt (mm H2O /s) - qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! soil saturation excess [mm h2o/s] - qflx_drain => waterflux_inst%qflx_drain_col , & ! sub-surface runoff (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! surface runoff (mm H2O /s) - qflx_infl => waterflux_inst%qflx_infl_col , & ! infiltration (mm H2O /s) - qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! qflx_surf at glaciers, wetlands, lakes - qflx_runoff => waterflux_inst%qflx_runoff_col , & ! total runoff - ! (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - qflx_runoff_u => waterflux_inst%qflx_runoff_u_col , & ! Urban total runoff (qflx_drain+qflx_surf) (mm H2O /s) - qflx_runoff_r => waterflux_inst%qflx_runoff_r_col , & ! Rural total runoff - ! (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - qflx_ice_runoff_snwcp => waterflux_inst%qflx_ice_runoff_snwcp_col, & ! solid runoff from snow capping (mm H2O /s) - qflx_irrig => irrigation_inst%qflx_irrig_col & ! irrigation flux (mm H2O /s) - ) - - ! Determine time step and step size - - dtime = get_step_size() - - if (use_vichydro) then - call CLMVICMap(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, waterstate_inst) - endif - - if (use_aquifer_layer()) then - call Drainage(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc,& - temperature_inst, soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - else - - call PerchedLateralFlow(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc,& - soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - - - call LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc,& - soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - - endif - - do j = 1, nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if ((ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall & - .or. ctype(c) == icol_roof) .and. j > nlevurb) then - else - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) - end if - end do - end do - - call ComputeWaterMassNonLake(bounds, num_nolakec, filter_nolakec, & - soilhydrology_inst, waterstate_inst, endwb(bounds%begc:bounds%endc)) - - - - - ! Determine wetland and land ice hydrology (must be placed here - ! since need snow updated from CombineSnowLayers) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - g = col%gridcell(c) - - if (lun%itype(l)==istwet .or. lun%itype(l)==istice_mec) then - - qflx_drain(c) = 0._r8 - qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 - qflx_surf(c) = 0._r8 - qflx_infl(c) = 0._r8 - qflx_qrgwl(c) = forc_rain(c) + forc_snow(c) + qflx_floodg(g) - qflx_evap_tot(c) - qflx_snwcp_ice(c) - & - qflx_snwcp_discarded_ice(c) - qflx_snwcp_discarded_liq(c) - & - (endwb(c)-begwb(c))/dtime - - else if (lun%urbpoi(l) .and. ctype(c) /= icol_road_perv) then - - qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 - qflx_rsub_sat(c) = spval - - end if - - qflx_ice_runoff_snwcp(c) = qflx_snwcp_ice(c) - end do - - ! This call needs to be here so that it comes after the initial calculation of - ! qflx_qrgwl and qflx_ice_runoff_snwcp, but before the ues of qflx_qrgwl in - ! qflx_runoff. - call glacier_smb_inst%AdjustRunoffTerms(bounds, num_do_smb_c, filter_do_smb_c, & - glc2lnd_inst, & - qflx_qrgwl = qflx_qrgwl(bounds%begc:bounds%endc), & - qflx_ice_runoff_snwcp = qflx_ice_runoff_snwcp(bounds%begc:bounds%endc)) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - - qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_h2osfc_surf(c) + qflx_qrgwl(c) + qflx_drain_perched(c) - - if ((lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) .and. col%active(c)) then - qflx_runoff(c) = qflx_runoff(c) - qflx_irrig(c) - end if - if (lun%urbpoi(l)) then - qflx_runoff_u(c) = qflx_runoff(c) - else if (lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) then - qflx_runoff_r(c) = qflx_runoff(c) - end if - - end do - - end associate - - end subroutine HydrologyDrainage - -end module HydrologyDrainageMod diff --git a/src/biogeophys/HydrologyNoDrainageMod.F90 b/src/biogeophys/HydrologyNoDrainageMod.F90 deleted file mode 100644 index 05dcb8a145..0000000000 --- a/src/biogeophys/HydrologyNoDrainageMod.F90 +++ /dev/null @@ -1,574 +0,0 @@ -Module HydrologyNoDrainageMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate snow and soil temperatures including phase change - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varctl , only : iulog, use_vichydro, use_fates - use clm_varcon , only : e_ice, denh2o, denice, rpi, spval - use CLMFatesInterfaceMod, only : hlm_fates_interface_type - use atm2lndType , only : atm2lnd_type - use AerosolMod , only : aerosol_type - use EnergyFluxType , only : energyflux_type - use TemperatureType , only : temperature_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use CanopyStateType , only : canopystate_type - use LandunitType , only : lun - use ColumnType , only : col - use TopoMod, only : topo_type - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: HydrologyNoDrainage ! Calculates soil/snow hydrology without drainage - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine HydrologyNoDrainage(bounds, & - num_nolakec, filter_nolakec, & - num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - num_snowc, filter_snowc, & - num_nosnowc, filter_nosnowc, & - clm_fates, & - atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, & - soilhydrology_inst, aerosol_inst, & - canopystate_inst, soil_water_retention_curve, topo_inst) - ! - ! !DESCRIPTION: - ! This is the main subroutine to execute the calculation of soil/snow - ! hydrology - ! Calling sequence is: - ! -> SnowWater: change of snow mass and snow water onto soil - ! -> SurfaceRunoff: surface runoff - ! -> Infiltration: infiltration into surface soil layer - ! -> SoilWater: soil water movement between layers - ! -> Tridiagonal tridiagonal matrix solution - ! -> Drainage: subsurface runoff - ! -> SnowCompaction: compaction of snow layers - ! -> CombineSnowLayers: combine snow layers that are thinner than minimum - ! -> DivideSnowLayers: subdivide snow layers that are thicker than maximum - ! - ! !USES: - use clm_varcon , only : denh2o, denice, hfus, grav, tfrz - use landunit_varcon , only : istwet, istsoil, istcrop, istdlak - use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv, icol_sunwall - use column_varcon , only : icol_shadewall - use clm_varctl , only : use_cn - use clm_varpar , only : nlevgrnd, nlevsno, nlevsoi, nlevurb - use clm_time_manager , only : get_step_size, get_nstep - use SnowHydrologyMod , only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, SnowCapping - use SnowHydrologyMod , only : SnowWater, BuildSnowFilter - use SoilHydrologyMod , only : CLMVICMap, SurfaceRunoff, Infiltration, WaterTable, PerchedWaterTable - use SoilHydrologyMod , only : ThetaBasedWaterTable, RenewCondensation - use SoilWaterMovementMod , only : SoilWater - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use SoilWaterMovementMod , only : use_aquifer_layer - use SoilWaterPlantSinkMod , only : Compute_EffecRootFrac_And_VertTranSink - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(inout) :: num_snowc ! number of column snow points - integer , intent(inout) :: filter_snowc(:) ! column filter for snow points - integer , intent(inout) :: num_nosnowc ! number of column non-snow points - integer , intent(inout) :: filter_nosnowc(:) ! column filter for non-snow points - type(hlm_fates_interface_type), intent(inout) :: clm_fates - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - class(topo_type) , intent(in) :: topo_inst - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,j,fc ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: psi,vwc,fsattmp,psifrz ! temporary variables for soilpsi calculation - real(r8) :: watdry ! temporary - real(r8) :: rwat(bounds%begc:bounds%endc) ! soil water wgted by depth to maximum depth of 0.5 m - real(r8) :: swat(bounds%begc:bounds%endc) ! same as rwat but at saturation - real(r8) :: rz(bounds%begc:bounds%endc) ! thickness of soil layers contributing to rwat (m) - real(r8) :: tsw ! volumetric soil water to 0.5 m - real(r8) :: stsw ! volumetric soil water to 0.5 m at saturation - real(r8) :: fracl ! fraction of soil layer contributing to 10cm total soil water - real(r8) :: s_node ! soil wetness (-) - real(r8) :: icefrac(bounds%begc:bounds%endc,1:nlevsoi) - !----------------------------------------------------------------------- - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface depth (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - ctype => col%itype , & ! Input: [integer (:) ] column type - - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - dTdz_top => temperature_inst%dTdz_top_col , & ! Output: [real(r8) (:) ] temperature gradient in top layer (col) [K m-1] ! - snot_top => temperature_inst%snot_top_col , & ! Output: [real(r8) (:) ] snow temperature in top layer (col) [K] - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground temperature (Kelvin) - t_grnd_u => temperature_inst%t_grnd_u_col , & ! Output: [real(r8) (:) ] Urban ground temperature (Kelvin) - t_grnd_r => temperature_inst%t_grnd_r_col , & ! Output: [real(r8) (:) ] Rural ground temperature (Kelvin) - tsl => temperature_inst%tsl_col , & ! Output: [real(r8) (:) ] temperature of near-surface soil layer (Kelvin) - t_soi_10cm => temperature_inst%t_soi10cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 10cm of soil (Kelvin) - tsoi17 => temperature_inst%t_soi17cm_col , & ! Output: [real(r8) (:) ] soil temperature in top 17cm of soil (Kelvin) - t_sno_mul_mss => temperature_inst%t_sno_mul_mss_col , & ! Output: [real(r8) (:) ] col snow temperature multiplied by layer mass, layer sum (K * kg/m2) - - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height of snow covered area (m) - snowdp => waterstate_inst%snowdp_col , & ! Input: [real(r8) (:) ] area-averaged snow height (m) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. snow cover fraction (col) [frc] - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective snow grain radius (col,lyr) [microns, m^-6] - snw_rds_top => waterstate_inst%snw_rds_top_col , & ! Output: [real(r8) (:) ] effective snow grain size, top layer(col) [microns] - sno_liq_top => waterstate_inst%sno_liq_top_col , & ! Output: [real(r8) (:) ] liquid water fraction in top snow layer (col) [frc] - snowice => waterstate_inst%snowice_col , & ! Output: [real(r8) (:) ] average snow ice lens - snowliq => waterstate_inst%snowliq_col , & ! Output: [real(r8) (:) ] average snow liquid water - snow_persistence => waterstate_inst%snow_persistence_col , & ! Output: [real(r8) (:) ] counter for length of time snow-covered - h2osoi_liqice_10cm => waterstate_inst%h2osoi_liqice_10cm_col , & ! Output: [real(r8) (:) ] liquid water + ice lens in top 10cm of soil (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice_tot => waterstate_inst%h2osoi_ice_tot_col , & ! Output: [real(r8) (:) ] vertically summed ice lens (kg/m2) - h2osoi_liq_tot => waterstate_inst%h2osoi_liq_tot_col , & ! Output: [real(r8) (:) ] vertically summed liquid water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osno_top => waterstate_inst%h2osno_top_col , & ! Output: [real(r8) (:) ] mass of snow in top layer (col) [kg] - wf => waterstate_inst%wf_col , & ! Output: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m - wf2 => waterstate_inst%wf2_col , & ! Output: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - soilpsi => soilstate_inst%soilpsi_col & ! Output: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - ) - - ! Determine step size - - dtime = get_step_size() - - ! Determine initial snow/no-snow filters (will be modified possibly by - ! routines CombineSnowLayers and DivideSnowLayers below - - call BuildSnowFilter(bounds, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - - ! Determine the change of snow mass and the snow water onto soil - - call SnowWater(bounds, num_snowc, filter_snowc, num_nosnowc, filter_nosnowc, & - atm2lnd_inst, waterflux_inst, waterstate_inst, aerosol_inst) - - ! mapping soilmoist from CLM to VIC layers for runoff calculations - if (use_vichydro) then - call CLMVICMap(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, waterstate_inst) - end if - - call SurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - soilhydrology_inst, soilstate_inst, waterflux_inst, waterstate_inst) - - call Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc,& - energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & - waterflux_inst, waterstate_inst) - - call Compute_EffecRootFrac_And_VertTranSink(bounds, num_hydrologyc, & - filter_hydrologyc, soilstate_inst, canopystate_inst, waterflux_inst, energyflux_inst) - - if ( use_fates ) call clm_fates%ComputeRootSoilFlux(bounds, num_hydrologyc, filter_hydrologyc, soilstate_inst, waterflux_inst) - - call SoilWater(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - soilhydrology_inst, soilstate_inst, waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - - if (use_vichydro) then - ! mapping soilmoist from CLM to VIC layers for runoff calculations - call CLMVICMap(bounds, num_hydrologyc, filter_hydrologyc, & - soilhydrology_inst, waterstate_inst) - end if - - if (use_aquifer_layer()) then - call WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - soilhydrology_inst, soilstate_inst, temperature_inst, waterstate_inst, waterflux_inst) - else - - call PerchedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - temperature_inst, waterstate_inst, waterflux_inst) - - call ThetaBasedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - - call RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc,& - soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - - endif - - ! Snow capping - call SnowCapping(bounds, num_nolakec, filter_nolakec, num_snowc, filter_snowc, & - aerosol_inst, waterflux_inst, waterstate_inst, topo_inst) - - ! Natural compaction and metamorphosis. - call SnowCompaction(bounds, num_snowc, filter_snowc, & - temperature_inst, waterstate_inst, atm2lnd_inst) - - ! Combine thin snow elements - call CombineSnowLayers(bounds, num_snowc, filter_snowc, & - aerosol_inst, temperature_inst, waterflux_inst, waterstate_inst) - - ! Divide thick snow elements - call DivideSnowLayers(bounds, num_snowc, filter_snowc, & - aerosol_inst, temperature_inst, waterstate_inst, is_lake=.false.) - - ! Set empty snow layers to zero - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j <= snl(c) .and. snl(c) > -nlevsno) then - h2osoi_ice(c,j) = 0._r8 - h2osoi_liq(c,j) = 0._r8 - t_soisno(c,j) = 0._r8 - dz(c,j) = 0._r8 - z(c,j) = 0._r8 - zi(c,j-1) = 0._r8 - end if - end do - end do - - ! Build new snow filter - - call BuildSnowFilter(bounds, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - - ! For columns where snow exists, accumulate 'time-covered-by-snow' counters. - ! Otherwise, re-zero counter, since it is bareland - - do fc = 1, num_snowc - c = filter_snowc(fc) - snow_persistence(c) = snow_persistence(c) + dtime - end do - do fc = 1, num_nosnowc - c = filter_nosnowc(fc) - snow_persistence(c) = 0._r8 - enddo - - ! Vertically average t_soisno and sum of h2osoi_liq and h2osoi_ice - ! over all snow layers for history output - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - snowice(c) = 0._r8 - snowliq(c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - snowice(c) = snowice(c) + h2osoi_ice(c,j) - snowliq(c) = snowliq(c) + h2osoi_liq(c,j) - end if - end do - end do - - ! Calculate column average snow depth - do c = bounds%begc,bounds%endc - snowdp(c) = snow_depth(c) * frac_sno_eff(c) - end do - - ! Calculate snow internal temperature - ! - ! Snow internal (or: integrated) temperature is the average temperature of the entire - ! snowpack, weighted by the layer mass. In a formula this reads: - ! - ! SIT = [ Sum_t Sum_i w(t,i) * T(t,i) ] / - ! [ Sum_t Sum_i w(t,i) ] - ! - ! where - ! - ! t = time - ! i = layer index - ! w(t,i) = layer mass or weight (kg /m2) - ! T(t,i) = layer temperature (K) - ! - ! SIT can be calculated offline from two components: the nominator and denominator, which are output - ! separately. - ! - ! Both the nominator and denominator are scaled with a factor 1/Nstep, the number of time samples, - ! to make them independent of the number of time steps that were used in the averaging. - ! This is simply implemented as avgflag='A' in any calls to the history output routines. - ! - ! Snow packs without layers are not taken into account, as they have no temperature. - ! - ! The denominator Sum_t Sum_i w(t,i) is already output as SNOWICE and SNOWLIQ (mass of - ! snow in layered snowpacks). Note that these != H2OSNO which does account for layerless snowpacks. - ! - ! The nominator Sum_t Sum_i w(t,i) * T(t,i) is computed and stored as t_sno_mul_mss - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - t_sno_mul_mss(c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - t_sno_mul_mss(c) = t_sno_mul_mss(c) + h2osoi_ice(c,j) * t_soisno(c,j) - t_sno_mul_mss(c) = t_sno_mul_mss(c) + h2osoi_liq(c,j) * tfrz - end if - end do - end do - - ! Determine ground temperature, ending water balance and volumetric soil water - ! Calculate temperature of near-surface soil layer - ! Calculate soil temperature and total water (liq+ice) in top 10cm of soil - ! Calculate soil temperature and total water (liq+ice) in top 17cm of soil - do fc = 1, num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - t_soi_10cm(c) = 0._r8 - tsoi17(c) = 0._r8 - h2osoi_liqice_10cm(c) = 0._r8 - h2osoi_liq_tot(c) = 0._r8 - h2osoi_ice_tot(c) = 0._r8 - end if - end do - do j = 1, nlevsoi - do fc = 1, num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j == 1) then - tsl(c) = t_soisno(c,j) - end if - ! soil T at top 17 cm added by F. Li and S. Levis - if (zi(c,j) <= 0.17_r8) then - fracl = 1._r8 - tsoi17(c) = tsoi17(c) + t_soisno(c,j)*dz(c,j)*fracl - else - if (zi(c,j) > 0.17_r8 .and. zi(c,j-1) < 0.17_r8) then - fracl = (0.17_r8 - zi(c,j-1))/dz(c,j) - tsoi17(c) = tsoi17(c) + t_soisno(c,j)*dz(c,j)*fracl - end if - end if - - if (zi(c,j) <= 0.1_r8) then - fracl = 1._r8 - t_soi_10cm(c) = t_soi_10cm(c) + t_soisno(c,j)*dz(c,j)*fracl - h2osoi_liqice_10cm(c) = h2osoi_liqice_10cm(c) + & - (h2osoi_liq(c,j)+h2osoi_ice(c,j))* & - fracl - else - if (zi(c,j) > 0.1_r8 .and. zi(c,j-1) < 0.1_r8) then - fracl = (0.1_r8 - zi(c,j-1))/dz(c,j) - t_soi_10cm(c) = t_soi_10cm(c) + t_soisno(c,j)*dz(c,j)*fracl - h2osoi_liqice_10cm(c) = h2osoi_liqice_10cm(c) + & - (h2osoi_liq(c,j)+h2osoi_ice(c,j))* & - fracl - end if - end if - - h2osoi_liq_tot(c) = h2osoi_liq_tot(c) + h2osoi_liq(c,j) - h2osoi_ice_tot(c) = h2osoi_ice_tot(c) + h2osoi_ice(c,j) - - end if - end do - end do - - ! TODO - if this block of code is moved out of here - the SoilHydrology - ! will NOT effect t_grnd, t_grnd_u or t_grnd_r - - do fc = 1, num_nolakec - - c = filter_nolakec(fc) - l = col%landunit(c) - - ! t_grnd is weighted average of exposed soil and snow - if (snl(c) < 0) then - t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & - + (1 - frac_sno_eff(c)- frac_h2osfc(c)) * t_soisno(c,1) & - + frac_h2osfc(c) * t_h2osfc(c) - else - t_grnd(c) = (1 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c) - endif - - if (lun%urbpoi(l)) then - t_grnd_u(c) = t_soisno(c,snl(c)+1) - else - t_soi_10cm(c) = t_soi_10cm(c)/0.1_r8 - tsoi17(c) = tsoi17(c)/0.17_r8 ! F. Li and S. Levis - end if - if (lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) then - t_grnd_r(c) = t_soisno(c,snl(c)+1) - end if - - end do - - do j = 1, nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if ((ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall & - .or. ctype(c) == icol_roof) .and. j > nlevurb) then - else - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) - end if - end do - end do - -! if (use_cn) then - ! Update soilpsi. - ! ZMS: Note this could be merged with the following loop updating smp_l in the future. - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - if (h2osoi_liq(c,j) > 0._r8) then - - vwc = h2osoi_liq(c,j)/(dz(c,j)*denh2o) - - ! the following limit set to catch very small values of - ! fractional saturation that can crash the calculation of psi - - ! use the same contants used in the supercool so that psi for frozen soils is consistent - fsattmp = max(vwc/watsat(c,j), 0.001_r8) - psi = sucsat(c,j) * (-9.8e-6_r8) * (fsattmp)**(-bsw(c,j)) ! Mpa - soilpsi(c,j) = min(max(psi,-15.0_r8),0._r8) - - else - soilpsi(c,j) = -15.0_r8 - end if - end do - end do -! end if - - ! Update smp_l for history and for ch4Mod. - ! ZMS: Note, this form, which seems to be the same as used in SoilWater, DOES NOT distinguish between - ! ice and water volume, in contrast to the soilpsi calculation above. It won't be used in ch4Mod if - ! t_soisno <= tfrz, though. - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - s_node = min(1.0_r8, s_node) - - smp_l(c,j) = -sucsat(c,j)*s_node**(-bsw(c,j)) - smp_l(c,j) = max(smpmin(c), smp_l(c,j)) - end do - end do - - ! if (use_cn) then - ! Available soil water up to a depth of 0.05 m. - ! Potentially available soil water (=whc) up to a depth of 0.05 m. - ! Water content as fraction of whc up to a depth of 0.05 m. - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - rwat(c) = 0._r8 - swat(c) = 0._r8 - rz(c) = 0._r8 - end do - - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - !if (z(c,j)+0.5_r8*dz(c,j) <= 0.5_r8) then - if (z(c,j)+0.5_r8*dz(c,j) <= 0.05_r8) then - watdry = watsat(c,j) * (316230._r8/sucsat(c,j)) ** (-1._r8/bsw(c,j)) - rwat(c) = rwat(c) + (h2osoi_vol(c,j)-watdry) * dz(c,j) - swat(c) = swat(c) + (watsat(c,j) -watdry) * dz(c,j) - rz(c) = rz(c) + dz(c,j) - end if - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (rz(c) /= 0._r8) then - tsw = rwat(c)/rz(c) - stsw = swat(c)/rz(c) - else - watdry = watsat(c,1) * (316230._r8/sucsat(c,1)) ** (-1._r8/bsw(c,1)) - tsw = h2osoi_vol(c,1) - watdry - stsw = watsat(c,1) - watdry - end if - wf(c) = tsw/stsw - end do - - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (z(c,j)+0.5_r8*dz(c,j) <= 0.17_r8) then - watdry = watsat(c,j) * (316230._r8/sucsat(c,j)) ** (-1._r8/bsw(c,j)) - rwat(c) = rwat(c) + (h2osoi_vol(c,j)-watdry) * dz(c,j) - swat(c) = swat(c) + (watsat(c,j) -watdry) * dz(c,j) - rz(c) = rz(c) + dz(c,j) - end if - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (rz(c) /= 0._r8) then - tsw = rwat(c)/rz(c) - stsw = swat(c)/rz(c) - else - watdry = watsat(c,1) * (316230._r8/sucsat(c,1)) ** (-1._r8/bsw(c,1)) - tsw = h2osoi_vol(c,1) - watdry - stsw = watsat(c,1) - watdry - end if - wf2(c) = tsw/stsw - end do - ! end if - - ! top-layer diagnostics - do fc = 1, num_snowc - c = filter_snowc(fc) - h2osno_top(c) = h2osoi_ice(c,snl(c)+1) + h2osoi_liq(c,snl(c)+1) - enddo - - ! Zero variables in columns without snow - do fc = 1, num_nosnowc - c = filter_nosnowc(fc) - - h2osno_top(c) = 0._r8 - snw_rds(c,:) = 0._r8 - - ! top-layer diagnostics (spval is not averaged when computing history fields) - snot_top(c) = spval - dTdz_top(c) = spval - snw_rds_top(c) = spval - sno_liq_top(c) = spval - end do - - end associate - - end subroutine HydrologyNoDrainage - -end Module HydrologyNoDrainageMod diff --git a/src/biogeophys/IrrigationMod.F90 b/src/biogeophys/IrrigationMod.F90 deleted file mode 100644 index cccb8dbc6b..0000000000 --- a/src/biogeophys/IrrigationMod.F90 +++ /dev/null @@ -1,1206 +0,0 @@ -module IrrigationMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates irrigation flux. - ! - ! Usage: - ! - ! - Call CalcIrrigationNeeded in order to compute whether and how much irrigation is - ! needed for the next call to ApplyIrrigation. This should be called once per - ! timestep. - ! - ! - Call ApplyIrrigation in order to calculate qflx_irrig. This should be called - ! exactly once per time step, before the first time qflx_irrig is needed by other - ! parts of the code. It is acceptable for this to be called earlier in the timestep - ! than CalcIrrigationNeeded. - ! - ! - Access the timestep's irrigation flux via qflx_irrig_patch or - ! qflx_irrig_col. These should be treated as read-only. - ! - ! Design notes: - ! - ! In principle, ApplyIrrigation and CalcIrrigationNeeded could be combined into a - ! single routine. Their separation is largely for historical reasons: In the past, - ! irrigation depended on btran, and qflx_irrig is needed earlier in the driver loop - ! than when btran becomes available. (And qflx_irrig is also used late in the driver - ! loop - so it wouldn't work, for example, to calculate qflx_irrig after btran is - ! computed, and then save it on the restart file for the next iteration of the driver - ! loop: then the uses of qflx_irrig early and late in the driver loop would be - ! inconsistent.) - ! - ! Now that we no longer have a dependency on btran, we could call CalcIrrigationNeeded - ! before the first time qflx_irrig is needed. Thus, there might be some advantage to - ! combining ApplyIrrigation and CalcIrrigationNeeded - or at least calling these two - ! routines from the same place. In particular: this separation of the irrigation - ! calculation into two routines that are done at different times in the driver loop - ! makes it harder and less desirable to nest the irrigation object within some other - ! object: Doing so might make it harder to do the two separate steps at the right - ! time, and would lead to less clarity about how these two steps are ordered with - ! respect to the rest of the driver loop. So if we start trying to create a hierarchy - ! of objects in CLM, we may want to rework this design. And we may want to rework it - ! to keep things simpler anyway, even if we aren't nesting objects. Note that this - ! rework would change behavior slightly, because irrigation would be applied in the - ! same time step that CalcIrrigationNeeded first determines it's needed, rather than - ! waiting until the following time step. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, get_proc_global - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : isecspday, degpsec, denh2o, spval, namec - use clm_varpar , only : nlevsoi, nlevgrnd - use clm_time_manager , only : get_step_size - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - use subgridAveMod , only : p2c, c2g - use filterColMod , only : filter_col_type, col_filter_from_logical_array - ! - implicit none - private - - ! !PUBLIC TYPES: - - ! This type is public (and its components are public, too) to aid unit testing - type, public :: irrigation_params_type - ! Minimum LAI for irrigation - real(r8) :: irrig_min_lai - - ! Time of day to check whether we need irrigation, seconds (0 = midnight). - ! We start applying the irrigation in the time step FOLLOWING this time, - ! since we won't begin irrigating until the next call to ApplyIrrigation - integer :: irrig_start_time - - ! Desired amount of time to irrigate per day (sec). Actual time may - ! differ if this is not a multiple of dtime. Irrigation won't work properly - ! if dtime > secsperday - integer :: irrig_length - - ! Target soil matric potential for irrigation (mm) - ! - ! When we irrigate, we aim to bring the total soil moisture in the top (irrig_depth) - ! m of soil up to this level. - ! - ! (Note: When we convert this to a relative saturation, we ensure that the relative - ! saturation target is bounded by [0,1].) - real(r8) :: irrig_target_smp - - ! Soil depth to which we measure for irrigation (m) - real(r8) :: irrig_depth - - ! Determines soil moisture threshold at which we irrigate. If - ! h2osoi_liq_wilting_point is the soil moisture level at wilting point and - ! h2osoi_liq_target is the soil moisture level at the target irrigation level (given - ! by irrig_target_smp), then the threshold at which we irrigate is - ! h2osoi_liq_wilting_point + - ! irrig_threshold_fraction*(h2osoi_liq_target - h2osoi_liq_wilting_point) - ! A value of 1 means that we irrigate whenever soil moisture falls below the target - ! A value of 0 means that we only irrigate when soil moisture falls below the - ! wilting point - real(r8) :: irrig_threshold_fraction - - ! Threshold for river water volume below which irrigation is shut off, if - ! limit_irrigation is .true. (fraction of available river water). A threshold of 0 - ! means allow all river water to be used; a threshold of 0.1 means allow 90% of the - ! river volume to be used; etc. - real(r8) :: irrig_river_volume_threshold - - ! Whether irrigation is limited based on river storage. This only applies if ROF is - ! enabled (i.e., rof_prognostic is .true.) - otherwise we don't limit irrigation, - ! regardless of the value of this flag. - logical :: limit_irrigation_if_rof_enabled - - end type irrigation_params_type - - - type, public :: irrigation_type - private - ! Public data members - ! Note: these should be treated as read-only by other modules - real(r8), pointer, public :: qflx_irrig_patch(:) ! patch irrigation flux (mm H2O/s) - real(r8), pointer, public :: qflx_irrig_col (:) ! col irrigation flux (mm H2O/s) - - ! Private data members; set in initialization: - type(irrigation_params_type) :: params - integer :: dtime ! land model time step (sec) - integer :: irrig_nsteps_per_day ! number of time steps per day in which we irrigate - real(r8), pointer :: relsat_wilting_point_col(:,:) ! relative saturation at which smp = wilting point [col, nlevsoi] - real(r8), pointer :: relsat_target_col(:,:) ! relative saturation at which smp is at the irrigation target [col, nlevsoi] - - ! Private data members; time-varying: - real(r8), pointer :: irrig_rate_patch (:) ! current irrigation rate [mm/s] - real(r8), pointer :: irrig_rate_demand_patch (:) ! current irrigation rate, neglecting surface water source limitation [mm/s] - integer , pointer :: n_irrig_steps_left_patch (:) ! number of time steps for which we still need to irrigate today (if 0, ignore) - real(r8), pointer :: qflx_irrig_demand_patch (:) ! irrigation flux neglecting surface water source limitation [mm/s] - - contains - ! Public routines - ! COMPILER_BUG(wjs, 2014-10-15, pgi 14.7) Add an "Irrigation" prefix to some generic routines like "Init" - ! (without this workaround, pgi compilation fails in restFileMod) - procedure, public :: Init => IrrigationInit - procedure, public :: Restart - procedure, public :: ApplyIrrigation - procedure, public :: CalcIrrigationNeeded - procedure, public :: Clean => IrrigationClean ! deallocate memory - - ! Public simply to support unit testing; should not be used from CLM code - procedure, public :: InitForTesting ! version of Init meant for unit testing - procedure, public :: RelsatToH2osoi ! convert from relative saturation to kg/m2 water for a single column and layer - - ! Private routines - procedure, private :: ReadNamelist - procedure, private :: CheckNamelistValidity ! Check for validity of input parameters - procedure, private :: InitAllocate => IrrigationInitAllocate - procedure, private :: InitHistory => IrrigationInitHistory - procedure, private :: InitCold => IrrigationInitCold - procedure, private :: CalcIrrigNstepsPerDay ! given dtime, calculate irrig_nsteps_per_day - procedure, private :: PointNeedsCheckForIrrig ! whether a given point needs to be checked for irrigation now - procedure, private :: CalcDeficitVolrLimited ! calculate deficit limited by river volume for each patch - end type irrigation_type - - interface irrigation_params_type - module procedure irrigation_params_constructor - end interface irrigation_params_type - - ! Soil matric potential at wilting point (mm) - ! - ! There is no reason to make this a tunable parameter, because the behavior it governs - ! (the trigger for irrigation) can be tuned via other parameters. - ! - ! TODO(wjs, 2016-09-08) It looks like there is other code in CLM that also uses an - ! assumed wilting point (CNRootDynMod, maybe others). We should probably make this a - ! shared parameter, e.g., in clm_varcon. - real(r8), parameter, private :: wilting_point_smp = -150000._r8 - - ! Conversion factors - real(r8), parameter :: m3_over_km2_to_mm = 1.e-3_r8 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function irrigation_params_constructor(irrig_min_lai, & - irrig_start_time, irrig_length, & - irrig_target_smp, & - irrig_depth, irrig_threshold_fraction, irrig_river_volume_threshold, & - limit_irrigation_if_rof_enabled) & - result(this) - ! - ! !DESCRIPTION: - ! Create an irrigation_params instance - ! - ! !USES: - ! - ! !ARGUMENTS: - type(irrigation_params_type) :: this ! function result - real(r8), intent(in) :: irrig_min_lai - integer , intent(in) :: irrig_start_time - integer , intent(in) :: irrig_length - real(r8), intent(in) :: irrig_target_smp - real(r8), intent(in) :: irrig_depth - real(r8), intent(in) :: irrig_threshold_fraction - real(r8), intent(in) :: irrig_river_volume_threshold - logical , intent(in) :: limit_irrigation_if_rof_enabled - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'irrigation_params_constructor' - !----------------------------------------------------------------------- - - this%irrig_min_lai = irrig_min_lai - this%irrig_start_time = irrig_start_time - this%irrig_length = irrig_length - this%irrig_depth = irrig_depth - this%irrig_target_smp = irrig_target_smp - this%irrig_threshold_fraction = irrig_threshold_fraction - this%irrig_river_volume_threshold = irrig_river_volume_threshold - this%limit_irrigation_if_rof_enabled = limit_irrigation_if_rof_enabled - - end function irrigation_params_constructor - - - ! ======================================================================== - ! Infrastructure routines (initialization, restart, etc.) - ! ======================================================================== - - !------------------------------------------------------------------------ - subroutine IrrigationInit(this, bounds, NLFilename, & - soilstate_inst, soil_water_retention_curve) - use SoilStateType , only : soilstate_type - - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! Namelist filename - type(soilstate_type) , intent(in) :: soilstate_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - - call this%ReadNamelist(NLFilename) - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds, soilstate_inst, soil_water_retention_curve) - end subroutine IrrigationInit - - !----------------------------------------------------------------------- - subroutine InitForTesting(this, bounds, params, dtime, & - relsat_wilting_point, relsat_target) - ! - ! !DESCRIPTION: - ! Does initialization needed for unit testing. Allows caller to prescribe values of - ! some internal variables. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - type(irrigation_params_type) , intent(in) :: params - integer , intent(in) :: dtime ! model time step (sec) - real(r8) , intent(in) :: relsat_wilting_point( bounds%begc: , 1: ) ! relative saturation at which smp = irrig_wilting_point_smp [col, nlevsoi] - real(r8) , intent(in) :: relsat_target( bounds%begc: , 1: ) ! relative saturation at which smp = irrig_target_smp [col, nlevsoi] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitForTesting' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(relsat_wilting_point) == (/bounds%endc, nlevsoi/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(relsat_target) == (/bounds%endc, nlevsoi/)), errMsg(sourcefile, __LINE__)) - - call this%InitAllocate(bounds) - this%params = params - this%dtime = dtime - this%irrig_nsteps_per_day = this%CalcIrrigNstepsPerDay(dtime) - this%relsat_wilting_point_col(:,:) = relsat_wilting_point(:,:) - this%relsat_target_col(:,:) = relsat_target(:,:) - - end subroutine InitForTesting - - !----------------------------------------------------------------------- - subroutine ReadNamelist(this, NLFilename) - ! - ! !DESCRIPTION: - ! Read the irrigation namelist - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - class(irrigation_type) , intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - ! temporary variables corresponding to the components of irrigation_params_type - real(r8) :: irrig_min_lai - integer :: irrig_start_time - integer :: irrig_length - real(r8) :: irrig_target_smp - real(r8) :: irrig_depth - real(r8) :: irrig_threshold_fraction - real(r8) :: irrig_river_volume_threshold - logical :: limit_irrigation_if_rof_enabled - - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=*), parameter :: nmlname = 'irrigation_inparm' - - character(len=*), parameter :: subname = 'ReadNamelist' - !----------------------------------------------------------------------- - - namelist /irrigation_inparm/ irrig_min_lai, irrig_start_time, irrig_length, & - irrig_target_smp, irrig_depth, irrig_threshold_fraction, & - irrig_river_volume_threshold, limit_irrigation_if_rof_enabled - - ! Initialize options to garbage defaults, forcing all to be specified explicitly in - ! order to get reasonable results - irrig_min_lai = nan - irrig_start_time = 0 - irrig_length = 0 - irrig_target_smp = nan - irrig_depth = nan - irrig_threshold_fraction = nan - irrig_river_volume_threshold = nan - limit_irrigation_if_rof_enabled = .false. - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=irrigation_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast(irrig_min_lai, mpicom) - call shr_mpi_bcast(irrig_start_time, mpicom) - call shr_mpi_bcast(irrig_length, mpicom) - call shr_mpi_bcast(irrig_target_smp, mpicom) - call shr_mpi_bcast(irrig_depth, mpicom) - call shr_mpi_bcast(irrig_threshold_fraction, mpicom) - call shr_mpi_bcast(irrig_river_volume_threshold, mpicom) - call shr_mpi_bcast(limit_irrigation_if_rof_enabled, mpicom) - - this%params = irrigation_params_type( & - irrig_min_lai = irrig_min_lai, & - irrig_start_time = irrig_start_time, & - irrig_length = irrig_length, & - irrig_target_smp = irrig_target_smp, & - irrig_depth = irrig_depth, & - irrig_threshold_fraction = irrig_threshold_fraction, & - irrig_river_volume_threshold = irrig_river_volume_threshold, & - limit_irrigation_if_rof_enabled = limit_irrigation_if_rof_enabled) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - ! Write settings one-by-one rather than with a nml write because - ! irrig_river_volume_threshold may be NaN - write(iulog,*) 'irrig_min_lai = ', irrig_min_lai - write(iulog,*) 'irrig_start_time = ', irrig_start_time - write(iulog,*) 'irrig_length = ', irrig_length - write(iulog,*) 'irrig_target_smp = ', irrig_target_smp - write(iulog,*) 'irrig_depth = ', irrig_depth - write(iulog,*) 'irrig_threshold_fraction = ', irrig_threshold_fraction - write(iulog,*) 'limit_irrigation_if_rof_enabled = ', limit_irrigation_if_rof_enabled - if (limit_irrigation_if_rof_enabled) then - write(iulog,*) 'irrig_river_volume_threshold = ', irrig_river_volume_threshold - end if - write(iulog,*) ' ' - - call this%CheckNamelistValidity() - end if - - end subroutine ReadNamelist - - !----------------------------------------------------------------------- - subroutine CheckNamelistValidity(this) - ! - ! !DESCRIPTION: - ! Check for validity of input parameters. - ! - ! Assumes that the inputs have already been packed into 'this%params'. - ! - ! Only needs to be called by the master task, since parameters are the same for all - ! tasks. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(irrigation_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'CheckNamelistValidity' - !----------------------------------------------------------------------- - - associate( & - irrig_min_lai => this%params%irrig_min_lai, & - irrig_start_time => this%params%irrig_start_time, & - irrig_length => this%params%irrig_length, & - irrig_target_smp => this%params%irrig_target_smp, & - irrig_depth => this%params%irrig_depth, & - irrig_threshold_fraction => this%params%irrig_threshold_fraction, & - irrig_river_volume_threshold => this%params%irrig_river_volume_threshold, & - limit_irrigation_if_rof_enabled => this%params%limit_irrigation_if_rof_enabled) - - if (irrig_min_lai < 0._r8) then - write(iulog,*) ' ERROR: irrig_min_lai must be >= 0' - write(iulog,*) ' irrig_min_lai = ', irrig_min_lai - call endrun(msg=' ERROR: irrig_min_lai must be >= 0 ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_start_time < 0 .or. irrig_start_time >= isecspday) then - write(iulog,*) ' ERROR: irrig_start_time must be >= 0 and < ', isecspday - write(iulog,*) ' irrig_start_time = ', irrig_start_time - call endrun(msg=' ERROR: irrig_start_time out of bounds ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_length <= 0 .or. irrig_length > isecspday) then - write(iulog,*) ' ERROR: irrig_length must be > 0 and <= ', isecspday - write(iulog,*) ' irrig_length = ', irrig_length - call endrun(msg=' ERROR: irrig_length out of bounds ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_target_smp >= 0._r8) then - write(iulog,*) ' ERROR: irrig_target_smp must be negative' - write(iulog,*) ' irrig_target_smp = ', irrig_target_smp - call endrun(msg=' ERROR: irrig_target_smp must be negative ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_target_smp < wilting_point_smp) then - write(iulog,*) ' ERROR: irrig_target_smp must be >= wilting_point_smp' - write(iulog,*) ' irrig_target_smp (from namelist) = ', irrig_target_smp - write(iulog,*) ' wilting_point_smp (hard-coded) = ', wilting_point_smp - call endrun(msg=' ERROR: irrig_target_smp must be >= wilting_point_smp ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_depth < 0._r8) then - write(iulog,*) ' ERROR: irrig_depth must be > 0' - write(iulog,*) ' irrig_depth = ', irrig_depth - call endrun(msg=' ERROR: irrig_depth must be > 0 ' // errMsg(sourcefile, __LINE__)) - end if - - if (irrig_threshold_fraction < 0._r8 .or. irrig_threshold_fraction > 1._r8) then - write(iulog,*) ' ERROR: irrig_threshold_fraction must be between 0 and 1' - write(iulog,*) ' irrig_threshold_fraction = ', irrig_threshold_fraction - call endrun(msg=' ERROR: irrig_threshold_fraction must be between 0 and 1 ' // & - errMsg(sourcefile, __LINE__)) - end if - - if (limit_irrigation_if_rof_enabled) then - if (irrig_river_volume_threshold < 0._r8 .or. irrig_river_volume_threshold > 1._r8) then - write(iulog,*) ' ERROR: irrig_river_volume_threshold must be between 0 and 1' - write(iulog,*) ' irrig_river_volume_threshold = ', irrig_river_volume_threshold - call endrun(msg=' ERROR: irrig_river_volume_threshold must be between 0 and 1 ' // & - errMsg(sourcefile, __LINE__)) - end if - end if - - end associate - - end subroutine CheckNamelistValidity - - - !----------------------------------------------------------------------- - subroutine IrrigationInitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize irrigation data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - allocate(this%qflx_irrig_patch (begp:endp)) ; this%qflx_irrig_patch (:) = nan - allocate(this%qflx_irrig_demand_patch (begp:endp)) ; this%qflx_irrig_demand_patch (:) = nan - allocate(this%qflx_irrig_col (begc:endc)) ; this%qflx_irrig_col (:) = nan - allocate(this%relsat_wilting_point_col (begc:endc,nlevsoi)) ; this%relsat_wilting_point_col (:,:) = nan - allocate(this%relsat_target_col (begc:endc,nlevsoi)) ; this%relsat_target_col (:,:) = nan - allocate(this%irrig_rate_patch (begp:endp)) ; this%irrig_rate_patch (:) = nan - allocate(this%irrig_rate_demand_patch (begp:endp)) ; this%irrig_rate_demand_patch (:) = nan - allocate(this%n_irrig_steps_left_patch (begp:endp)) ; this%n_irrig_steps_left_patch (:) = 0 - - end subroutine IrrigationInitAllocate - - !----------------------------------------------------------------------- - subroutine IrrigationInitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize irrigation history fields - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - - this%qflx_irrig_patch(begp:endp) = spval - call hist_addfld1d (fname='QIRRIG', units='mm/s', & - avgflag='A', long_name='water added through irrigation', & - ptr_patch=this%qflx_irrig_patch) - - this%qflx_irrig_demand_patch(begp:endp) = spval - call hist_addfld1d (fname='QIRRIG_DEMAND', units='mm/s', & - avgflag='A', long_name='irrigation demand', & - ptr_patch=this%qflx_irrig_demand_patch, default='inactive') - - end subroutine IrrigationInitHistory - - !----------------------------------------------------------------------- - subroutine IrrigationInitCold(this, bounds, soilstate_inst, soil_water_retention_curve) - ! - ! !DESCRIPTION: - ! Do cold-start initialization for irrigation data structure - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - type(soilstate_type) , intent(in) :: soilstate_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - ! - ! !LOCAL VARIABLES: - integer :: c ! col index - integer :: j ! level index - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - do j = 1, nlevsoi - do c = bounds%begc, bounds%endc - call soil_water_retention_curve%soil_suction_inverse( & - c = c, & - j = j, & - smp_target = wilting_point_smp, & - soilstate_inst = soilstate_inst, & - s_target = this%relsat_wilting_point_col(c,j)) - - call soil_water_retention_curve%soil_suction_inverse( & - c = c, & - j = j, & - smp_target = this%params%irrig_target_smp, & - soilstate_inst = soilstate_inst, & - s_target = this%relsat_target_col(c,j)) - - ! Make sure relative saturation targets are bounded by [0,1] - ! - ! NOTE(wjs, 2016-11-17) These targets can be > 1 if smp_target is too small of - ! a negative value; we want to force the target to a relative saturation of 1 - ! in that case. I don't see how these targets could end up negative, though I - ! had a note that I saw negative values at one point. In practice, for - ! reasonable parameter values, it seems that these min and max functions have - ! no effect. - this%relsat_wilting_point_col(c,j) = min(this%relsat_wilting_point_col(c,j), 1._r8) - this%relsat_wilting_point_col(c,j) = max(this%relsat_wilting_point_col(c,j), 0._r8) - this%relsat_target_col(c,j) = min(this%relsat_target_col(c,j), 1._r8) - this%relsat_target_col(c,j) = max(this%relsat_target_col(c,j), 0._r8) - end do - end do - - this%dtime = get_step_size() - this%irrig_nsteps_per_day = this%CalcIrrigNstepsPerDay(this%dtime) - - end subroutine IrrigationInitCold - - !----------------------------------------------------------------------- - pure function CalcIrrigNstepsPerDay(this, dtime) result(irrig_nsteps_per_day) - ! - ! !DESCRIPTION: - ! Given dtime (sec), determine number of irrigation steps per day - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: irrig_nsteps_per_day ! function result - class(irrigation_type) , intent(in) :: this - integer , intent(in) :: dtime ! model time step (sec) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'CalcIrrigNstepsPerDay' - !----------------------------------------------------------------------- - - irrig_nsteps_per_day = ((this%params%irrig_length + (dtime - 1))/dtime) ! round up - - end function CalcIrrigNstepsPerDay - - - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Handle restart of irrigation variables - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_inqvdlen, ncd_double, ncd_int - use restUtilMod - ! - ! !ARGUMENTS: - class(irrigation_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read', 'write' or 'define' - ! - ! !LOCAL VARIABLES: - logical :: do_io - integer :: dimlen ! dimension length - integer :: nump_global ! total number of patchs, globally - integer :: err_code ! error code - logical :: readvar ! determine if variable is on initial file - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - ! Get expected total number of points, for later error checks - call get_proc_global(np=nump_global) - - do_io = .true. - readvar = .false. - if (flag == 'read') then - ! BACKWARDS_COMPATIBILITY - ! On a read, confirm that this variable has the expected size; if not, don't read - ! it (instead give it a default value). This is needed to support older initial - ! conditions for which this variable had a different size. - call ncd_inqvdlen(ncid, 'n_irrig_steps_left', 1, dimlen, err_code) - if (dimlen /= nump_global) then - do_io = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='n_irrig_steps_left', xtype=ncd_int, & - dim1name='pft', & - long_name='number of irrigation time steps left', units='#', & - interpinic_flag='interp', readvar=readvar, data=this%n_irrig_steps_left_patch) - end if - if (flag=='read' .and. .not. readvar) then - this%n_irrig_steps_left_patch = 0 - end if - - do_io = .true. - readvar = .false. - if (flag == 'read') then - ! BACKWARDS_COMPATIBILITY - ! On a read, confirm that this variable has the expected size; if not, don't read - ! it (instead give it a default value). This is needed to support older initial - ! conditions for which this variable had a different size. - call ncd_inqvdlen(ncid, 'irrig_rate', 1, dimlen, err_code) - if (dimlen /= nump_global) then - do_io = .false. - end if - end if - if (do_io) then - call restartvar(ncid=ncid, flag=flag, varname='irrig_rate', xtype=ncd_double, & - dim1name='pft', & - long_name='irrigation rate', units='mm/s', & - interpinic_flag='interp', readvar=readvar, data=this%irrig_rate_patch) - end if - if (flag=='read' .and. .not. readvar) then - this%irrig_rate_patch = 0.0_r8 - end if - - ! BACKWARDS_COMPATIBILITY(wjs, 2016-11-23) To support older restart files without an - ! irrig_rate_demand field, get irrig_rate_demand from irrig_rate. I'm abusing the - ! capability to specify multiple variable names here (even though irrig_rate isn't - ! really an old version of irrig_rate_demand), rather than having code like 'if - ! (.not. readvar) then ...', because the latter doesn't work when using init_interp. - call restartvar(ncid=ncid, flag=flag, varname='irrig_rate_demand:irrig_rate', & - xtype=ncd_double, & - dim1name='pft', & - long_name='irrigation rate demand, neglecting surface water source limitation', & - units='mm/s', & - interpinic_flag='interp', readvar=readvar, data=this%irrig_rate_demand_patch) - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine IrrigationClean(this) - ! - ! !DESCRIPTION: - ! Deallocate memory - ! - ! !ARGUMENTS: - class(irrigation_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - deallocate(this%qflx_irrig_patch) - deallocate(this%qflx_irrig_demand_patch) - deallocate(this%qflx_irrig_col) - deallocate(this%relsat_wilting_point_col) - deallocate(this%relsat_target_col) - deallocate(this%irrig_rate_patch) - deallocate(this%irrig_rate_demand_patch) - deallocate(this%n_irrig_steps_left_patch) - - end subroutine IrrigationClean - - - ! ======================================================================== - ! Science routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine ApplyIrrigation(this, bounds) - ! - ! !DESCRIPTION: - ! Apply the irrigation computed by CalcIrrigationNeeded to qflx_irrig. - ! - ! Should be called once, AND ONLY ONCE, per time step. After this is called, you may - ! access qflx_irrig_patch or qflx_irrig_col. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p ! patch index - integer :: g ! grid cell index - - character(len=*), parameter :: subname = 'ApplyIrrigation' - - !----------------------------------------------------------------------- - - ! This should be called exactly once per time step, so that this counter decrease - ! works correctly. - - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - - if (this%n_irrig_steps_left_patch(p) > 0) then - this%qflx_irrig_patch(p) = this%irrig_rate_patch(p) - this%qflx_irrig_demand_patch(p) = this%irrig_rate_demand_patch(p) - this%n_irrig_steps_left_patch(p) = this%n_irrig_steps_left_patch(p) - 1 - else - this%qflx_irrig_patch(p) = 0._r8 - this%qflx_irrig_demand_patch(p) = 0._r8 - end if - - end do - - call p2c (bounds = bounds, & - parr = this%qflx_irrig_patch(bounds%begp:bounds%endp), & - carr = this%qflx_irrig_col(bounds%begc:bounds%endc), & - p2c_scale_type = 'unity') - - end subroutine ApplyIrrigation - - - !----------------------------------------------------------------------- - subroutine CalcIrrigationNeeded(this, bounds, num_exposedvegp, filter_exposedvegp, & - time_prev, elai, t_soisno, eff_porosity, h2osoi_liq, volr, rof_prognostic) - ! - ! !DESCRIPTION: - ! Calculate whether and how much irrigation is needed for each column. However, this - ! does NOT actually set the irrigation flux. - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_TKFRZ - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! time of day (in seconds since 0Z) at start of timestep - integer, intent(in) :: time_prev - - ! number of points in filter_exposedvegp - integer, intent(in) :: num_exposedvegp - - ! patch filter for non-snow-covered veg - integer, intent(in) :: filter_exposedvegp(:) - - ! one-sided leaf area index with burying by snow [patch] - real(r8), intent(in) :: elai( bounds%begp: ) - - ! col soil temperature (K) [col, nlevgrnd] (note that this does NOT contain the snow levels) - real(r8), intent(in) :: t_soisno( bounds%begc: , 1: ) - - ! effective porosity (0 to 1) [col, nlevgrnd] - real(r8), intent(in) :: eff_porosity( bounds%begc: , 1: ) - - ! column liquid water (kg/m2) [col, nlevgrnd] (note that this does NOT contain the snow levels) - real(r8), intent(in) :: h2osoi_liq( bounds%begc: , 1: ) - - ! river water volume (m3) (ignored if rof_prognostic is .false.) - real(r8), intent(in) :: volr( bounds%begg: ) - - ! whether we're running with a prognostic ROF component; this is needed to determine - ! whether we can limit irrigation based on river volume. - logical, intent(in) :: rof_prognostic - - ! - ! !LOCAL VARIABLES: - integer :: fp ! patch filter index - integer :: fc ! column filter index - integer :: p ! patch index - integer :: c ! column index - integer :: g ! gridcell index - integer :: j ! level - - ! Filter for columns where we need to check for irrigation - type(filter_col_type) :: check_for_irrig_col_filter - - ! target soil moisture for this layer [kg/m2] - real(r8) :: h2osoi_liq_target - - ! soil moisture at wilting point for this layer [kg/m2] - real(r8) :: h2osoi_liq_wilting_point - - ! Total of h2osoi down to the depth of irrigation in each column [kg/m2] - real(r8) :: h2osoi_liq_tot(bounds%begc:bounds%endc) - - ! Total of h2osoi_liq_target down to the depth of irrigation in each column [kg/m2] - real(r8) :: h2osoi_liq_target_tot(bounds%begc:bounds%endc) - - ! Total of h2osoi_liq at wilting point down to the depth of irrigation in each column - ! [kg/m2] - real(r8) :: h2osoi_liq_wilting_point_tot(bounds%begc:bounds%endc) - - ! h2osoi_liq at the threshold for irrigation in this column [kg/m2] - real(r8) :: h2osoi_liq_at_threshold - - ! difference between desired soil moisture level for each column and current soil - ! moisture level [kg/m2] [i.e., mm] - real(r8) :: deficit(bounds%begc:bounds%endc) - - ! deficit limited by river volume [kg/m2] [i.e., mm] - real(r8) :: deficit_volr_limited(bounds%begc:bounds%endc) - - ! where do we need to check soil moisture to see if we need to irrigate? - logical :: check_for_irrig_patch(bounds%begp:bounds%endp) - logical :: check_for_irrig_col(bounds%begc:bounds%endc) - - ! set to true once we have reached the max allowable depth for irrigation in a given - ! column - logical :: reached_max_depth(bounds%begc:bounds%endc) - - ! Whether we should limit deficits by available volr - logical :: limit_irrigation - - character(len=*), parameter :: subname = 'CalcIrrigationNeeded' - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(elai) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eff_porosity) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osoi_liq) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(volr) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - - ! Determine if irrigation is needed (over irrigated soil columns) - - ! First, determine in what grid cells we need to bother 'measuring' soil water, to see - ! if we need irrigation - check_for_irrig_col(bounds%begc:bounds%endc) = .false. - do fp = 1, num_exposedvegp - p = filter_exposedvegp(fp) - g = patch%gridcell(p) - - check_for_irrig_patch(p) = this%PointNeedsCheckForIrrig( & - pft_type=patch%itype(p), elai=elai(p), & - time_prev=time_prev, londeg=grc%londeg(g)) - if (check_for_irrig_patch(p)) then - c = patch%column(p) - check_for_irrig_col(c) = .true. - end if - end do - - check_for_irrig_col_filter = col_filter_from_logical_array(bounds, & - check_for_irrig_col(bounds%begc:bounds%endc)) - - ! Initialize some variables - do fc = 1, check_for_irrig_col_filter%num - c = check_for_irrig_col_filter%indices(fc) - - reached_max_depth(c) = .false. - h2osoi_liq_tot(c) = 0._r8 - h2osoi_liq_target_tot(c) = 0._r8 - h2osoi_liq_wilting_point_tot(c) = 0._r8 - end do - - ! Now 'measure' soil water for the grid cells identified above and see if the soil is - ! dry enough to warrant irrigation - do j = 1,nlevsoi - do fc = 1, check_for_irrig_col_filter%num - c = check_for_irrig_col_filter%indices(fc) - - if (.not. reached_max_depth(c)) then - if (col%z(c,j) > this%params%irrig_depth) then - reached_max_depth(c) = .true. - else if (j > col%nbedrock(c)) then - reached_max_depth(c) = .true. - else if (t_soisno(c,j) <= SHR_CONST_TKFRZ) then - ! if level L was frozen, then we don't look at any levels below L - reached_max_depth(c) = .true. - else - h2osoi_liq_tot(c) = h2osoi_liq_tot(c) + h2osoi_liq(c,j) - - h2osoi_liq_target = this%RelsatToH2osoi( & - relsat = this%relsat_target_col(c,j), & - eff_porosity = eff_porosity(c,j), & - dz = col%dz(c,j)) - h2osoi_liq_target_tot(c) = h2osoi_liq_target_tot(c) + & - h2osoi_liq_target - - h2osoi_liq_wilting_point = this%RelsatToH2osoi( & - relsat = this%relsat_wilting_point_col(c,j), & - eff_porosity = eff_porosity(c,j), & - dz = col%dz(c,j)) - h2osoi_liq_wilting_point_tot(c) = h2osoi_liq_wilting_point_tot(c) + & - h2osoi_liq_wilting_point - end if - end if ! if (.not. reached_max_depth(c)) - end do ! do fc - end do ! do j - - ! Compute deficits - ! First initialize deficits to 0 everywhere; this is needed for later averaging up to gridcell - deficit(bounds%begc:bounds%endc) = 0._r8 - do fc = 1, check_for_irrig_col_filter%num - c = check_for_irrig_col_filter%indices(fc) - - h2osoi_liq_at_threshold = h2osoi_liq_wilting_point_tot(c) + & - this%params%irrig_threshold_fraction * & - (h2osoi_liq_target_tot(c) - h2osoi_liq_wilting_point_tot(c)) - if (h2osoi_liq_tot(c) < h2osoi_liq_at_threshold) then - deficit(c) = h2osoi_liq_target_tot(c) - h2osoi_liq_tot(c) - ! deficit shouldn't be less than 0: if it is, that implies that the - ! irrigation target is less than the irrigation threshold, which is not - ! supposed to happen - if (deficit(c) < 0._r8) then - write(iulog,*) subname//' ERROR: deficit < 0' - write(iulog,*) 'This implies that irrigation target is less than irrigatio& - &n threshold, which should never happen' - call endrun(decomp_index=c, clmlevel=namec, msg='deficit < 0 '// & - errMsg(sourcefile, __LINE__)) - end if - else - ! We're above the threshold - so don't irrigate - deficit(c) = 0._r8 - end if - end do - - ! Limit deficits by available volr, if desired. Note that we cannot do this limiting - ! if running without a prognostic river model, since we need river volume for this - ! limiting. - ! - ! NOTE(wjs, 2016-11-22) In principle we could base this on rof_present rather than - ! rof_prognostic, but that would depend on the data runoff (drof) model sending river - ! volume, which it currently does not. - limit_irrigation = (this%params%limit_irrigation_if_rof_enabled .and. rof_prognostic) - if (limit_irrigation) then - call this%CalcDeficitVolrLimited( & - bounds = bounds, & - check_for_irrig_col_filter = check_for_irrig_col_filter, & - deficit = deficit(bounds%begc:bounds%endc), & - volr = volr(bounds%begg:bounds%endg), & - deficit_volr_limited = deficit_volr_limited(bounds%begc:bounds%endc)) - else - deficit_volr_limited(bounds%begc:bounds%endc) = deficit(bounds%begc:bounds%endc) - end if - - ! Convert deficits to irrigation rate - do fp = 1, num_exposedvegp - p = filter_exposedvegp(fp) - c = patch%column(p) - - if (check_for_irrig_patch(p)) then - ! Convert units from mm to mm/sec - this%irrig_rate_patch(p) = deficit_volr_limited(c) / & - (this%dtime*this%irrig_nsteps_per_day) - this%irrig_rate_demand_patch(p) = deficit(c) / & - (this%dtime*this%irrig_nsteps_per_day) - - ! n_irrig_steps_left(p) > 0 is ok even if irrig_rate(p) ends up = 0 - ! in this case, we'll irrigate by 0 for the given number of time steps - this%n_irrig_steps_left_patch(p) = this%irrig_nsteps_per_day - end if - end do - - end subroutine CalcIrrigationNeeded - - !----------------------------------------------------------------------- - function PointNeedsCheckForIrrig(this, pft_type, elai, time_prev, londeg) & - result(check_for_irrig) - ! - ! !DESCRIPTION: - ! Determine whether a given patch needs to be checked for irrigation now. - ! - ! !USES: - use pftconMod, only : pftcon - ! - ! !ARGUMENTS: - logical :: check_for_irrig ! function result - class(irrigation_type), intent(in) :: this - integer , intent(in) :: pft_type ! type of pft in this patch - real(r8), intent(in) :: elai ! one-sided leaf area index with burying by snow - integer , intent(in) :: time_prev ! time of day (in seconds since 0Z) at start of timestep - real(r8), intent(in) :: londeg ! longitude (degrees) - ! - ! !LOCAL VARIABLES: - ! local time at start of time step (seconds after solar midnight) - integer :: local_time - - ! number of seconds since the prescribed irrigation start time - integer :: seconds_since_irrig_start_time - - character(len=*), parameter :: subname = 'PointNeedsCheckForIrrig' - !----------------------------------------------------------------------- - - if (pftcon%irrigated(pft_type) == 1._r8 .and. & - elai > this%params%irrig_min_lai) then - ! see if it's the right time of day to start irrigating: - local_time = modulo(time_prev + nint(londeg/degpsec), isecspday) - seconds_since_irrig_start_time = modulo(local_time - this%params%irrig_start_time, isecspday) - if (seconds_since_irrig_start_time < this%dtime) then - check_for_irrig = .true. - else - check_for_irrig = .false. - end if - else - check_for_irrig = .false. - end if - - end function PointNeedsCheckForIrrig - - !----------------------------------------------------------------------- - subroutine CalcDeficitVolrLimited(this, bounds, check_for_irrig_col_filter, & - deficit, volr, deficit_volr_limited) - ! - ! !DESCRIPTION: - ! Calculates deficit limited by river volume for each column. - ! - ! The output array (deficit_volr_limited) is set to 0 outside the given filter. - ! - ! If the deficit is lower than the volr-based threshold for a given gridcell, then the - ! volr-limited deficit is simply the original deficit; if the deficit is higher than - ! the volr-based threshold for a gridcell, then the volr-limited deficit for each - ! column in the gridcell is equal to: - ! (original deficit in the column) * (volr-based threshold)/(gridcell-level deficit) - ! - ! The logic here relies on the fact that all irrigated columns in a given grid cell - ! will be irrigated at the same time of day. (As opposed to, say, some being irrigated - ! at 4 AM and others being irrigated at 6 AM: in that case we couldn't just average - ! this time step's column-level deficits to the gridcell to get the total daily - ! irrigation deficit: we'd need to account for the fact that we have some irrigation - ! commitment from earlier deficits, etc.) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(irrigation_type) , intent(in) :: this - type(bounds_type) , intent(in) :: bounds - - ! filter of columns where we need to check for irrigation - type(filter_col_type) , intent(in) :: check_for_irrig_col_filter - - ! original deficit: the amount by which we would irrigate if there were no volr - ! limitation [kg/m2] [i.e., mm] - ! - ! Should be set for all columns, even those outside the filter, so that averaging to - ! grid cell happens properly - real(r8), intent(in) :: deficit( bounds%begc: ) - - ! river water volume [m3] - real(r8), intent(in) :: volr( bounds%begg: ) - - ! deficit limited by river volume [kg/m2] [i.e., mm] - real(r8), intent(out) :: deficit_volr_limited( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: fc ! column filter index - integer :: c ! column index - integer :: g ! gridcell index - - ! Deficit averaged up to gridcell level [kg/m2] [i.e., mm] - real(r8) :: deficit_grc(bounds%begg:bounds%endg) - - real(r8) :: available_volr ! volr available for withdrawal [m3] - - real(r8) :: max_deficit_supported_by_volr ! [kg/m2] [i.e., mm] - - ! ratio of deficit_volr_limited to deficit for each grid cell - real(r8) :: deficit_limited_ratio_grc(bounds%begg:bounds%endg) - - character(len=*), parameter :: subname = 'CalcDeficitVolrLimited' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(deficit) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(volr) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(deficit_volr_limited) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - call c2g(bounds, & - carr = deficit(bounds%begc:bounds%endc), & - garr = deficit_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - - do g = bounds%begg, bounds%endg - if (volr(g) > 0._r8) then - available_volr = volr(g) * (1._r8 - this%params%irrig_river_volume_threshold) - max_deficit_supported_by_volr = available_volr / grc%area(g) * m3_over_km2_to_mm - else - ! Ensure that negative volr is treated the same as 0 volr - max_deficit_supported_by_volr = 0._r8 - end if - - if (deficit_grc(g) > max_deficit_supported_by_volr) then - ! inadequate river storage, adjust irrigation demand - deficit_limited_ratio_grc(g) = max_deficit_supported_by_volr / deficit_grc(g) - else - ! adequate river storage, no adjustment to irrigation demand - deficit_limited_ratio_grc(g) = 1._r8 - end if - end do - - deficit_volr_limited(bounds%begc:bounds%endc) = 0._r8 - do fc = 1, check_for_irrig_col_filter%num - c = check_for_irrig_col_filter%indices(fc) - - g = col%gridcell(c) - deficit_volr_limited(c) = deficit(c) * deficit_limited_ratio_grc(g) - end do - - end subroutine CalcDeficitVolrLimited - - - !----------------------------------------------------------------------- - pure function RelsatToH2osoi(this, relsat, eff_porosity, dz) result(h2osoi_liq) - ! - ! !DESCRIPTION: - ! For a given column and layer, convert relative saturation to kg/m2 water - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8) :: h2osoi_liq ! function result (kg/m2) - class(irrigation_type), intent(in) :: this - real(r8), intent(in) :: relsat ! relative saturation (0 to 1) - real(r8), intent(in) :: eff_porosity ! effective porosity (0 to 1) - real(r8), intent(in) :: dz ! level thickness (m) - ! - ! !LOCAL VARIABLES: - real(r8) :: vol_liq ! partial volume of liquid water in layer [0 to 1] - - character(len=*), parameter :: subname = 'RelsatToH2osoi' - !----------------------------------------------------------------------- - - vol_liq = eff_porosity * relsat - h2osoi_liq = vol_liq * denh2o * dz - - end function RelsatToH2osoi - -end module IrrigationMod diff --git a/src/biogeophys/LakeCon.F90 b/src/biogeophys/LakeCon.F90 deleted file mode 100644 index a42a3d0137..0000000000 --- a/src/biogeophys/LakeCon.F90 +++ /dev/null @@ -1,178 +0,0 @@ -module LakeCon - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing constants and parameters for the Lake code - ! (CLM4-LISSS, documented in Subin et al. 2011, JAMES) - ! Also contains time constant variables for Lake code - ! Created by Zack Subin, 2011 - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varctl , only : iulog - use spmdMod , only : masterproc - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: LakeConInit - !----------------------------------------------------------------------- - - !------------------------------------------------------------------ - ! Lake Model non-tuneable constants - !------------------------------------------------------------------ - - ! temperature of maximum water density (K) - ! This is from Hostetler and Bartlein (1990); more updated sources suggest 277.13 K. - real(r8), parameter :: tdmax = 277._r8 - - !------------------------------------------------------------------ - ! Lake Model tuneable constants - !------------------------------------------------------------------ - - ! lake emissivity. This is used for both frozen and unfrozen lakes. - ! This is pulled in from CLM4 and the reference is unclear. - real(r8), parameter :: emg_lake = 0.97_r8 - - ! The fraction of the visible (e.g. vis not nir from atm) sunlight - ! absorbed in ~1 m of water (the surface layer za_lake). - ! This is roughly the fraction over 700 nm but may depend on the details - ! of atmospheric radiative transfer. As long as NIR = 700 nm and up, this can be zero. - real(r8) :: betavis = 0.0_r8 - - ! Momentum Roughness length over frozen lakes without snow (m) - ! Typical value found in the literature, and consistent with Mironov expressions. - ! See e.g. Morris EM 1989, Andreas EL 1987, Guest & Davidson 1991 (as cited in Vavrus 1996) - real(r8), parameter :: z0frzlake = 0.001_r8 - - ! Base of surface light absorption layer for lakes (m) - real(r8), parameter :: za_lake = 0.6_r8 - - ! For calculating prognostic roughness length - real(r8), parameter :: cur0 = 0.01_r8 ! min. Charnock parameter - real(r8), parameter :: cus = 0.1_r8 ! empirical constant for roughness under smooth flow - real(r8), parameter :: curm = 0.1_r8 ! maximum Charnock parameter - - ! The following will be set in initLake based on namelists. !TODO - fix this commend - real(r8) :: fcrit ! critical dimensionless fetch for Charnock parameter. - real(r8) :: minz0lake ! (m) Minimum allowed roughness length for unfrozen lakes. - - ! For calculating enhanced diffusivity - real(r8), parameter :: n2min = 7.5e-5_r8 ! (s^-2) (yields diffusivity about 6 times km) ! Fang & Stefan 1996 - - ! Note, this will be adjusted in initLake if the timestep is not 1800 s. - ! Lake top numerics can oscillate with 0.01m top layer and 1800 s timestep. - ! The problem is that the surface flux is fixed during the calculation of the top - ! layer temperature in the diffusion and not corrected for the tendency of the top layer. - ! This thickness will be added to all minimum and maximum snow layer thicknesses compared to that used over non-lakes. - ! Analysis of the CFL condition suggests that the minimum snow layer thickness for 1800 s needs - ! to be at least ~1.2 cm for the bulk snow values of conductivity and heat capacity - ! and as much as 2.3 cm for pure ice. - ! Alternatively, a check could be done in LakeTemperature in case - ! t_grnd(c) - t_soisno(c,snl(c)+1) changed sign after the Crank-Nicholson step. - ! Such an approach, while perhaps allowing additional snow layer resolution, has not been tested. - ! The approach used over non-lakes is to have a first-order surface flux correction. - ! We choose not to do that here because t_grnd can vary independently of the top model - ! layer temperature, while it is fixed to the top layer temperature if tbot > tfrz and - ! the lake is frozen, or if there is an unstable density gradient in the top unfrozen lake layer. - real(r8) :: lsadz = 0.03_r8 ! m - - !! The following will be set in initLake based on namelists. - real(r8) :: pudz ! (m) Optional minimum total ice thickness required to allow lake puddling. - ! Currently used for sensitivity tests only. - real(r8) :: depthcrit ! (m) Depth beneath which to increase mixing. See discussion in Subin et al. 2011 - real(r8) :: mixfact ! Mixing increase factor. - - !!!!!!!!!!! - ! Namelists (some of these have not been extensively tested and are hardwired to default values currently). - !!!!!!!!!!! - - ! used in LakeFluxes - ! true => use old fcrit & minz0 as per Subin et al 2011 form - ! See initLakeMod for details. Difference is very small for - ! small lakes and negligible for large lakes. Currently hardwired off. - logical, public :: lake_use_old_fcrit_minz0 = .false. - - ! used in LakeTemperature - ! Increase mixing by a large factor for deep lakes - ! Crude but enhanced performance at all 4 deep lakes tested. - ! See Subin et al 2011 (JAMES) for details - - ! (m) minimum lake depth to invoke deepmixing - real(r8), public :: deepmixing_depthcrit = 25._r8 - - ! factor to increase mixing by - real(r8), public :: deepmixing_mixfact = 10._r8 - - ! true => Suppress enhanced diffusion. Small differences. - ! Currently hardwired .false. - ! See Subin et al 2011 for details. - ! Enhanced diffusion is intended for under ice and at large depths. - ! It is a much smaller change on its own than the "deepmixing" - ! above, but it increases the effect of deepmixing under ice and for large depths. - logical, public :: lake_no_ed = .false. - - ! puddling (not extensively tested and currently hardwired off) - ! used in LakeTemperature and SurfaceAlbedo - - ! true => suppress convection when greater than minimum amount - ! of ice is present. This also effectively sets lake_no_melt_icealb. - logical, public :: lakepuddling = .false. - - ! (m) minimum amount of total ice nominal thickness before - ! convection is suppressed - real(r8), public :: lake_puddle_thick = 0.2_r8 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine LakeConInit() - ! - ! !DESCRIPTION: - ! Initialize time invariant variables for S Lake code - !------------------------------------------------------------------------ - - if (masterproc) write (iulog,*) 'Attempting to initialize time invariant variables for lakes' - - ! Set LakeCon constants according to namelist fields - if (lake_use_old_fcrit_minz0) then - ! critical dimensionless fetch for Charnock parameter. From Vickers & Mahrt 1997 - ! but converted to use u instead of u* (Form used in Subin et al. 2011) - fcrit = 22._r8 - - ! (m) Minimum allowed roughness length for unfrozen lakes. - ! (Used in Subin et al. 2011) - minz0lake = 1.e-5_r8 - else - ! Vickers & Mahrt 1997 - fcrit = 100._r8 - - ! (m) Minimum allowed roughness length for unfrozen lakes. - ! Now set low so it is only to avoid floating point exceptions. - minz0lake = 1.e-10_r8 - end if - - if (lakepuddling) then - ! (m) Minimum total ice thickness required to allow lake puddling. Default is 0.2m. - ! This option has not been extensively tested. - ! This option turns on lake_no_melt_icealb, as the decrease in albedo will be based - ! on whether there is water over nice, not purely a function of ice top temperature. - pudz = lake_puddle_thick - end if - - ! (m) Depth beneath which to increase mixing. See discussion in Subin et al. 2011 - depthcrit = deepmixing_depthcrit - - ! Mixing increase factor. ! Defaults are 25 m, increase by 10. - ! Note some other namelists will be used directly in lake physics during model integration. - mixfact = deepmixing_mixfact - - if (masterproc) write (iulog,*) 'Successfully initialized time invariant variables for lakes' - - end subroutine LakeConInit - -end module LakeCon diff --git a/src/biogeophys/LakeFluxesMod.F90 b/src/biogeophys/LakeFluxesMod.F90 deleted file mode 100644 index 3d447ec111..0000000000 --- a/src/biogeophys/LakeFluxesMod.F90 +++ /dev/null @@ -1,668 +0,0 @@ -module LakeFluxesMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates surface fluxes and temperature for lakes. - ! Created by Zack Subin, 2009 - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use LakeStateType , only : lakestate_type - use SolarAbsorbedType , only : solarabs_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use HumanIndexMod , only : humanindex_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: LakeFluxes - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, & - atm2lnd_inst, solarabs_inst, frictionvel_inst, temperature_inst, & - energyflux_inst, waterstate_inst, waterflux_inst, lakestate_inst, & - humanindex_inst) - ! - ! !DESCRIPTION: - ! Calculates lake temperatures and surface fluxes. - ! Lakes have variable depth, possible snow layers above, freezing & thawing of lake water, - ! and soil layers with active temperature and gas diffusion below. - ! WARNING: This subroutine assumes lake columns have one and only one pft. - ! - ! !USES: - use clm_varpar , only : nlevlak - use clm_varcon , only : hvap, hsub, hfus, cpair, cpliq, tkwat, tkice, tkair - use clm_varcon , only : sb, vkc, grav, denh2o, tfrz, spval, zsno - use clm_varctl , only : use_lch4 - use LakeCon , only : betavis, z0frzlake, tdmax, emg_lake - use LakeCon , only : lake_use_old_fcrit_minz0 - use LakeCon , only : minz0lake, cur0, cus, curm, fcrit - use QSatMod , only : QSat - use FrictionVelocityMod , only : FrictionVelocity, MoninObukIni, frictionvel_parms_inst - use HumanIndexMod , only : calc_human_stress_indices, Wet_Bulb, Wet_BulbS, HeatIndex, AppTemp, & - swbgt, hmdex, dis_coi, dis_coiS, THIndex, & - SwampCoolEff, KtoC, VaporPres - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for non-lake points - integer , intent(in) :: num_lakep ! number of column non-lake points in pft filter - integer , intent(in) :: filter_lakep(:) ! patch filter for non-lake points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(lakestate_type) , intent(inout) :: lakestate_inst - type(humanindex_type) , intent(inout) :: humanindex_inst - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: z0mg_col(:) ! roughness length over ground, momentum [m] - real(r8), pointer :: z0hg_col(:) ! roughness length over ground, sensible heat [m] - real(r8), pointer :: z0qg_col(:) ! roughness length over ground, latent heat [m] - integer , parameter :: niters = 4 ! maximum number of iterations for surface temperature - real(r8), parameter :: beta1 = 1._r8 ! coefficient of convective velocity (in computing W_*) [-] - real(r8), parameter :: zii = 1000._r8 ! convective boundary height [m] - integer :: i,fc,fp,g,c,p ! do loop or array index - integer :: fncopy ! number of values in pft filter copy - integer :: fnold ! previous number of pft filter values - integer :: fpcopy(num_lakep) ! patch filter copy for iteration loop - integer :: iter ! iteration index - integer :: nmozsgn(bounds%begp:bounds%endp) ! number of times moz changes sign - integer :: jtop(bounds%begc:bounds%endc) ! top level for each column (no longer all 1) - real(r8) :: ax ! used in iteration loop for calculating t_grnd (numerator of NR solution) - real(r8) :: bx ! used in iteration loop for calculating t_grnd (denomin. of NR solution) - real(r8) :: degdT ! d(eg)/dT - real(r8) :: dqh(bounds%begp:bounds%endp) ! diff of humidity between ref. height and surface - real(r8) :: dth(bounds%begp:bounds%endp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dzsur(bounds%begc:bounds%endc) ! 1/2 the top layer thickness (m) - real(r8) :: eg ! water vapor pressure at temperature T [pa] - real(r8) :: htvp(bounds%begc:bounds%endc) ! latent heat of vapor of water (or sublimation) [j/kg] - real(r8) :: obu(bounds%begp:bounds%endp) ! monin-obukhov length (m) - real(r8) :: obuold(bounds%begp:bounds%endp) ! monin-obukhov length of previous iteration - real(r8) :: qsatg(bounds%begc:bounds%endc) ! saturated humidity [kg/kg] - real(r8) :: qsatgdT(bounds%begc:bounds%endc) ! d(qsatg)/dT - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: ram(bounds%begp:bounds%endp) ! aerodynamical resistance [s/m] - real(r8) :: rah(bounds%begp:bounds%endp) ! thermal resistance [s/m] - real(r8) :: raw(bounds%begp:bounds%endp) ! moisture resistance [s/m] - real(r8) :: stftg3(bounds%begp:bounds%endp) ! derivative of fluxes w.r.t ground temperature - real(r8) :: temp1(bounds%begp:bounds%endp) ! relation for potential temperature profile - real(r8) :: temp12m(bounds%begp:bounds%endp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(bounds%begp:bounds%endp) ! relation for specific humidity profile - real(r8) :: temp22m(bounds%begp:bounds%endp) ! relation for specific humidity profile applied at 2-m - real(r8) :: tgbef(bounds%begc:bounds%endc) ! initial ground temperature - real(r8) :: thm(bounds%begp:bounds%endp) ! intermediate variable (forc_t+0.0098*forc_hgt_t_patch) - real(r8) :: thv(bounds%begc:bounds%endc) ! virtual potential temperature (kelvin) - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: tksur(bounds%begc:bounds%endc) ! thermal conductivity of snow/soil (w/m/kelvin) - real(r8) :: tsur(bounds%begc:bounds%endc) ! top layer temperature - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: um(bounds%begp:bounds%endp) ! wind speed including the stablity effect [m/s] - real(r8) :: ur(bounds%begp:bounds%endp) ! wind speed at reference height [m/s] - real(r8) :: ustar(bounds%begp:bounds%endp) ! friction velocity [m/s] - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m] - real(r8) :: displa(bounds%begp:bounds%endp) ! displacement (always zero) [m] - real(r8) :: z0mg(bounds%begp:bounds%endp) ! roughness length over ground, momentum [m] - real(r8) :: z0hg(bounds%begp:bounds%endp) ! roughness length over ground, sensible heat [m] - real(r8) :: z0qg(bounds%begp:bounds%endp) ! roughness length over ground, latent heat [m] - real(r8) :: u2m ! 2 m wind speed (m/s) - real(r8) :: fm(bounds%begp:bounds%endp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: bw ! partial density of water (ice + liquid) - real(r8) :: t_grnd_temp ! Used in surface flux correction over frozen ground - real(r8) :: betaprime(bounds%begc:bounds%endc) ! Effective beta: sabg_lyr(p,jtop) for snow layers, beta otherwise - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - real(r8) :: sabg_nir ! NIR that is absorbed (W/m^2) - - ! For calculating roughness lengths - real(r8) :: cur ! Charnock parameter (-) - real(r8) :: fetch(bounds%begc:bounds%endc) ! Fetch (m) - real(r8) :: sqre0 ! root of roughness Reynolds number - real(r8), parameter :: kva0 = 1.51e-5_r8 ! kinematic viscosity of air (m^2/s) at 20C and 1.013e5 Pa - real(r8) :: kva0temp ! (K) temperature for kva0; will be set below - real(r8), parameter :: kva0pres = 1.013e5_r8 ! (Pa) pressure for kva0 - real(r8) :: kva ! kinematic viscosity of air at ground temperature and forcing pressure - real(r8), parameter :: prn = 0.713 ! Prandtl # for air at neutral stability - real(r8), parameter :: sch = 0.66 ! Schmidt # for water in air at neutral stability - - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness for soil or snow (m) - dz_lake => col%dz_lake , & ! Input: [real(r8) (:,:) ] layer thickness for lake (m) - lakedepth => col%lakedepth , & ! Input: [real(r8) (:) ] variable lake depth (m) - - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_th => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric potential temperature (Kelvin) - forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg) - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] snow rate [mm/s] - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] rain rate [mm/s] - forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) - forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) - - fsds_nir_d => solarabs_inst%fsds_nir_d_patch , & ! Input: [real(r8) (:) ] incident direct beam nir solar radiation (W/m**2) - fsds_nir_i => solarabs_inst%fsds_nir_i_patch , & ! Input: [real(r8) (:) ] incident diffuse nir solar radiation (W/m**2) - fsr_nir_d => solarabs_inst%fsr_nir_d_patch , & ! Input: [real(r8) (:) ] reflected direct beam nir solar radiation (W/m**2) - fsr_nir_i => solarabs_inst%fsr_nir_i_patch , & ! Input: [real(r8) (:) ] reflected diffuse nir solar radiation (W/m**2) - sabg_lyr => solarabs_inst%sabg_lyr_patch , & ! Input: [real(r8) (:,:) ] absorbed solar radiation (pft,lyr) [W/m2] - sabg_chk => solarabs_inst%sabg_chk_patch , & ! Output: [real(r8) (:) ] sum of soil/snow using current fsno, for balance check - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - - savedtke1 => lakestate_inst%savedtke1_col , & ! Input: [real(r8) (:) ] top level eddy conductivity from previous timestep (W/mK) - lakefetch => lakestate_inst%lakefetch_col , & ! Input: [real(r8) (:) ] lake fetch from surface data (m) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) - - t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) - - u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:)] 10 m height winds (m/s) - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at pft level [m] - forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Input: [real(r8) (:) ] observational height of temperature at pft level [m] - forc_hgt_q_patch => frictionvel_inst%forc_hgt_q_patch , & ! Input: [real(r8) (:) ] observational height of specific humidity at pft level [m] - zetamax => frictionvel_parms_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions - ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - - q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) - rh_ref2m => waterstate_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) - - tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:)] 2 m height surface air temperature (C) - vap_ref2m => humanindex_inst%vap_ref2m_patch , & ! Output: [real(r8) (:)] 2 m height vapor pressure (Pa) - appar_temp_ref2m => humanindex_inst%appar_temp_ref2m_patch , & ! Output: [real(r8) (:)] 2 m apparent temperature (C) - swbgt_ref2m => humanindex_inst%swbgt_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Simplified Wetbulb Globe temperature (C) - humidex_ref2m => humanindex_inst%humidex_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Humidex (C) - wbt_ref2m => humanindex_inst%wbt_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Stull Wet Bulb temperature (C) - wb_ref2m => humanindex_inst%wb_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Wet Bulb temperature (C) - teq_ref2m => humanindex_inst%teq_ref2m_patch , & ! Output: [real(r8) (:)] 2 m height Equivalent temperature (K) - ept_ref2m => humanindex_inst%ept_ref2m_patch , & ! Output: [real(r8) (:)] 2 m height Equivalent Potential temperature (K) - discomf_index_ref2m => humanindex_inst%discomf_index_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Discomfort Index temperature (C) - discomf_index_ref2mS => humanindex_inst%discomf_index_ref2mS_patch, & ! Output: [real(r8) (:)] 2 m height Discomfort Index Stull temperature (C) - nws_hi_ref2m => humanindex_inst%nws_hi_ref2m_patch , & ! Output: [real(r8) (:)] 2 m NWS Heat Index (C) - thip_ref2m => humanindex_inst%thip_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Temperature Humidity Index Physiology (C) - thic_ref2m => humanindex_inst%thic_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Temperature Humidity Index Comfort (C) - swmp65_ref2m => humanindex_inst%swmp65_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Swamp Cooler temperature 65% effi (C) - swmp80_ref2m => humanindex_inst%swmp80_ref2m_patch , & ! Output: [real(r8) (:)] 2 m Swamp Cooler temperature 80% effi (C) - - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - qflx_prec_grnd => waterflux_inst%qflx_prec_grnd_patch , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)] - - t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) - t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground temperature (Kelvin) - - eflx_lwrad_out => energyflux_inst%eflx_lwrad_out_patch , & ! Output: [real(r8) (:) ] emitted infrared (longwave) radiation (W/m**2) - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Output: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_soil_grnd => energyflux_inst%eflx_soil_grnd_patch , & ! Output: [real(r8) (:) ] soil heat flux (W/m**2) [+ = into soil] - eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch , & ! Output: [real(r8) (:) ] total latent heat flux (W/m**2) [+ to atm] - eflx_lh_grnd => energyflux_inst%eflx_lh_grnd_patch , & ! Output: [real(r8) (:) ] ground evaporation heat flux (W/m**2) [+ to atm] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_gnet => energyflux_inst%eflx_gnet_patch , & ! Output: [real(r8) (:) ] net heat flux into ground (W/m**2) - taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) - tauy => energyflux_inst%tauy_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: n-s (kg/m/s**2) - - ks => lakestate_inst%ks_col , & ! Output: [real(r8) (:) ] coefficient passed to LakeTemperature - ws => lakestate_inst%ws_col , & ! Output: [real(r8) (:) ] surface friction velocity (m/s) - betaprime => lakestate_inst%betaprime_col , & ! Output: [real(r8) (:) ] fraction of solar rad absorbed at surface: equal to NIR fraction - ram1_lake => lakestate_inst%ram1_lake_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - ust_lake => lakestate_inst%ust_lake_col , & ! Output: [real(r8) (:) ] friction velocity (m/s) - lake_raw => lakestate_inst%lake_raw_col , & ! Output: [real(r8) (:) ] aerodynamic resistance for moisture (s/m) - - begp => bounds%begp , & - endp => bounds%endp & - ) - - ! the following cause a crash if they are set as associated - z0mg_col => frictionvel_inst%z0mg_col - z0hg_col => frictionvel_inst%z0hg_col - z0qg_col => frictionvel_inst%z0qg_col - - kva0temp = 20._r8 + tfrz - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - g = col%gridcell(c) - - ! Set fetch for prognostic roughness length-- if not found in surface data. - ! This is poorly constrained, and should eventually be based on global lake data - ! For now, base on lake depth, assuming that small lakes are likely to be shallower - ! The dependence will be weak, especially for large fetch - ! http://www.chebucto.ns.ca/ccn/info/Science/SWCS/DATA/morphology.html#zr, based on - ! Hutchinson, G.E. 1957 A treatise on limnology v.1. Geography, Physics and Chemistry, - ! and Wetzel, R.G., and Likens, G.E.. 1991. Limnological Analyses, suggests lakes usually have - ! depths less than 2% of their diameter. - - if (lakefetch(c) > 0._r8) then ! fetch available in surface data - fetch(c) = lakefetch(c) - else ! Estimate crudely based on lake depth - if (lakedepth(c) < 4._r8) then - fetch(c) = 100._r8 ! Roughly the smallest lakes resolveable in the GLWD - else - fetch(c) = 25._r8*lakedepth(c) - end if - end if - - ! Initialize roughness lengths - - if (t_grnd(c) > tfrz) then ! for unfrozen lake - z0mg(p) = z0mg_col(c) - kva = kva0 * (t_grnd(c)/kva0temp)**1.5_r8 * kva0pres/forc_pbot(c) ! kinematic viscosity of air - sqre0 = (max(z0mg(p)*ust_lake(c)/kva,0.1_r8))**0.5_r8 ! Square root of roughness Reynolds number - z0hg(p) = z0mg(p) * exp( -vkc/prn*( 4._r8*sqre0 - 3.2_r8) ) ! SH roughness length - z0qg(p) = z0mg(p) * exp( -vkc/sch*( 4._r8*sqre0 - 4.2_r8) ) ! LH roughness length - z0qg(p) = max(z0qg(p), minz0lake) - z0hg(p) = max(z0hg(p), minz0lake) - else if (snl(c) == 0) then ! frozen lake with ice - z0mg(p) = z0frzlake - z0hg(p) = z0mg(p)/exp(0.13_r8 * (ust_lake(c)*z0mg(p)/1.5e-5_r8)**0.45_r8) ! Consistent with BareGroundFluxes - z0qg(p) = z0hg(p) - else ! use roughness over snow as in Biogeophysics1 - z0mg(p) = zsno - z0hg(p) = z0mg(p)/exp(0.13_r8 * (ust_lake(c)*z0mg(p)/1.5e-5_r8)**0.45_r8) ! Consistent with BareGroundFluxes - z0qg(p) = z0hg(p) - end if - - ! Surface temperature and fluxes - - forc_hgt_u_patch(p) = forc_hgt_u_patch(p) + z0mg(p) - forc_hgt_t_patch(p) = forc_hgt_t_patch(p) + z0mg(p) - forc_hgt_q_patch(p) = forc_hgt_q_patch(p) + z0mg(p) - - ! Find top layer - jtop(c) = snl(c) + 1 - - if (snl(c) < 0) then - betaprime(c) = sabg_lyr(p,jtop(c))/max(1.e-5_r8,sabg(p)) ! Assuming one pft - dzsur(c) = dz(c,jtop(c))/2._r8 - else ! no snow layers - ! Calculate the NIR fraction of absorbed solar. - sabg_nir = fsds_nir_d(p) + fsds_nir_i(p) - fsr_nir_d(p) - fsr_nir_i(p) - sabg_nir = min(sabg_nir, sabg(p)) - betaprime(c) = sabg_nir/max(1.e-5_r8,sabg(p)) - ! Some fraction of the "visible" may be absorbed in the surface layer. - betaprime(c) = betaprime(c) + (1._r8-betaprime(c))*betavis - dzsur(c) = dz_lake(c,1)/2._r8 - end if - - sabg_chk(p) = sabg(p) - ! Originally dzsur was 1*dz, but it should it be 1/2 dz. - - ! Saturated vapor pressure, specific humidity and their derivatives - ! at lake surface - - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg(c), qsatgdT(c)) - - ! Potential, virtual potential temperature, and wind speed at the - ! reference height - - thm(p) = forc_t(c) + 0.0098_r8*forc_hgt_t_patch(p) ! intermediate variable - thv(c) = forc_th(c)*(1._r8+0.61_r8*forc_q(c)) ! virtual potential T - end do - - - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - g = patch%gridcell(p) - - nmozsgn(p) = 0 - obuold(p) = 0._r8 - displa(p) = 0._r8 - - ! Latent heat - - if (t_grnd(c) > tfrz) then - htvp(c) = hvap - else - htvp(c) = hsub - end if - ! Zack Subin, 3/26/09: Changed to ground temperature rather than the air temperature above. - - ! Initialize stability variables - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-t_grnd(c) - dqh(p) = forc_q(c)-qsatg(c) - dthv = dth(p)*(1._r8+0.61_r8*forc_q(c))+0.61_r8*forc_th(c)*dqh(p) - zldis(p) = forc_hgt_u_patch(p) - 0._r8 - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv, zldis(p), z0mg(p), um(p), obu(p)) - - end do - - iter = 1 - fncopy = num_lakep - fpcopy(1:num_lakep) = filter_lakep(1:num_lakep) - - ! Begin stability iteration - - ITERATION : do while (iter <= niters .and. fncopy > 0) - - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - call FrictionVelocity(begp, endp, fncopy, fpcopy, & - displa(begp:endp), z0mg(begp:endp), z0hg(begp:endp), z0qg(begp:endp), & - obu(begp:endp), iter, ur(begp:endp), um(begp:endp), ustar(begp:endp), & - temp1(begp:endp), temp2(begp:endp), temp12m(begp:endp), temp22m(begp:endp), fm(begp:endp), & - frictionvel_inst) - - do fp = 1, fncopy - p = fpcopy(fp) - c = patch%column(p) - g = patch%gridcell(p) - - tgbef(c) = t_grnd(c) - if (t_grnd(c) > tfrz .and. t_lake(c,1) > tfrz .and. snl(c) == 0) then - tksur(c) = savedtke1(c) - ! Set this to the eddy conductivity from the last - ! timestep, as the molecular conductivity will be orders of magnitude too small. - ! It will be initialized in initLakeMod to the molecular conductivity for the first timestep if arbinit. - tsur(c) = t_lake(c,1) - else if (snl(c) == 0) then !frozen but no snow layers - tksur(c) = tkice ! This is an approximation because the whole layer may not be frozen, and it is not - ! accounting for the physical (but not nominal) expansion of the frozen layer. - tsur(c) = t_lake(c,1) - else - !Need to calculate thermal conductivity of the top snow layer - bw = (h2osoi_ice(c,jtop(c))+h2osoi_liq(c,jtop(c)))/dz(c,jtop(c)) - tksur(c) = tkair + (7.75e-5_r8 *bw + 1.105e-6_r8*bw*bw)*(tkice-tkair) - tsur(c) = t_soisno(c,jtop(c)) - end if - - ! Determine aerodynamic resistances - - ram(p) = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah(p) = 1._r8/(temp1(p)*ustar(p)) - raw(p) = 1._r8/(temp2(p)*ustar(p)) - - if (use_lch4) then - lake_raw(c) = raw(p) ! Pass out for calculating ground ch4 conductance - end if - ram1(p) = ram(p) ! pass value to global variable - ram1_lake(p) = ram1(p) ! for history - - ! Get derivative of fluxes with respect to ground temperature - - stftg3(p) = emg_lake*sb*tgbef(c)*tgbef(c)*tgbef(c) - - ! Changed surface temperature from t_lake(c,1) to tsur(c). - ! Also adjusted so that if there are snow layers present, the top layer absorption - ! from SNICAR is assigned to the surface skin. - ax = betaprime(c)*sabg(p) + emg_lake*forc_lwrad(c) + 3._r8*stftg3(p)*tgbef(c) & - + forc_rho(c)*cpair/rah(p)*thm(p) & - - htvp(c)*forc_rho(c)/raw(p)*(qsatg(c)-qsatgdT(c)*tgbef(c) - forc_q(c)) & - + tksur(c)*tsur(c)/dzsur(c) - !Changed sabg(p) to betaprime(c)*sabg(p). - bx = 4._r8*stftg3(p) + forc_rho(c)*cpair/rah(p) & - + htvp(c)*forc_rho(c)/raw(p)*qsatgdT(c) + tksur(c)/dzsur(c) - - t_grnd(c) = ax/bx - - ! Update htvp - if (t_grnd(c) > tfrz) then - htvp(c) = hvap - else - htvp(c) = hsub - end if - - ! Surface fluxes of momentum, sensible and latent heat - ! using ground temperatures from previous time step - - eflx_sh_grnd(p) = forc_rho(c)*cpair*(t_grnd(c)-thm(p))/rah(p) - qflx_evap_soi(p) = forc_rho(c)*(qsatg(c)+qsatgdT(c)*(t_grnd(c)-tgbef(c))-forc_q(c))/raw(p) - - ! Re-calculate saturated vapor pressure, specific humidity and their - ! derivatives at lake surface - - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg(c), qsatgdT(c)) - - dth(p)=thm(p)-t_grnd(c) - dqh(p)=forc_q(c)-qsatg(c) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - - thvstar=tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar - zeta=zldis(p)*vkc * grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(zetamax,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta1*(-grav*ustar(p)*thvstar*zii/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p)+wc*wc) - end if - obu(p) = zldis(p)/zeta - - if (obuold(p)*obu(p) < 0._r8) nmozsgn(p) = nmozsgn(p)+1 - - obuold(p) = obu(p) - - if (t_grnd(c) > tfrz .and. snl(c) == 0) then ! t_grnd hasn't been corrected yet if snow layers but above frz - ! Update roughness lengths using approach in Subin et al. 2011 - ! Also allow wave development (phase speed) to be depth-limited as well as fetch-limited - if (lake_use_old_fcrit_minz0) then - ! Original formulation in Subin et al. 2011; converted Vickers & Mahrt 1997 to use u instead of u* - ! assuming u = 0.1 u*. - ! That probably slightly overestimates the dimensionless fetch as u* is often smaller than 0.1 u - cur = cur0 + curm* exp( max( -(fetch(c)*grav/ur(p)/ur(p))**(1._r8/3._r8)/fcrit, & ! Fetch-limited - -(lakedepth(c)*grav/ur(p)/ur(p))**0.5_r8 ) ) ! depth-limited - ! In this case fcrit is 22, not 100 in clm_varcon - else - ! Fetch relationship from Vickers & Mahrt 1997 - cur = cur0 + curm* exp( max( -(fetch(c)*grav/ustar(p)/ustar(p))**(1._r8/3._r8)/fcrit, & ! Fetch-limited - -(lakedepth(c)*grav/ur(p)/ur(p))**0.5_r8 ) ) ! depth-limited - end if - - - kva = kva0 * (t_grnd(c)/kva0temp)**1.5_r8 * kva0pres/forc_pbot(c) ! kinematic viscosity of air - z0mg(p) = max(cus*kva/max(ustar(p),1.e-4_r8), cur*ustar(p)*ustar(p)/grav) ! momentum roughness length - ! This lower limit on ustar is just to prevent floating point exceptions and - ! should not be important - z0mg(p) = max(z0mg(p), minz0lake) ! This limit is redundant with current values. - sqre0 = (max(z0mg(p)*ustar(p)/kva,0.1_r8))**0.5_r8 ! Square root of roughness Reynolds number - z0hg(p) = z0mg(p) * exp( -vkc/prn*( 4._r8*sqre0 - 3.2_r8) ) ! SH roughness length - z0qg(p) = z0mg(p) * exp( -vkc/sch*( 4._r8*sqre0 - 4.2_r8) ) ! LH roughness length - z0qg(p) = max(z0qg(p), minz0lake) - z0hg(p) = max(z0hg(p), minz0lake) - else if (snl(c) == 0) then - ! in case it was above freezing and now below freezing - z0mg(p) = z0frzlake - z0hg(p) = z0mg(p)/exp(0.13_r8 * (ustar(p)*z0mg(p)/1.5e-5_r8)**0.45_r8) ! Consistent with BareGroundFluxes - z0qg(p) = z0hg(p) - else ! Snow layers - ! z0mg won't have changed - z0hg(p) = z0mg(p)/exp(0.13_r8 * (ustar(p)*z0mg(p)/1.5e-5_r8)**0.45_r8) ! Consistent with BareGroundFluxes - z0qg(p) = z0hg(p) - end if - - end do ! end of filtered pft loop - - iter = iter + 1 - if (iter <= niters ) then - ! Rebuild copy of pft filter for next pass through the ITERATION loop - - fnold = fncopy - fncopy = 0 - do fp = 1, fnold - p = fpcopy(fp) - if (nmozsgn(p) < 3) then - fncopy = fncopy + 1 - fpcopy(fncopy) = p - end if - end do ! end of filtered pft loop - end if - - end do ITERATION ! end of stability iteration - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - g = patch%gridcell(p) - - ! If there is snow on the ground or lake is frozen and t_grnd > tfrz: reset t_grnd = tfrz. - ! Re-evaluate ground fluxes. - ! [ZMS 1/7/11] Only for resolved snow layers, as unresolved snow does not have a temperature state and - ! can accumulate on unfrozen lakes in LakeHydrology; will be melted in LakeTemperature or bring lake top - ! to freezing. - ! note that qsatg and qsatgdT should be f(tgbef) (PET: not sure what this - ! comment means) - ! Zack Subin, 3/27/09: Since they are now a function of whatever t_grnd was before cooling - ! to freezing temperature, then this value should be used in the derivative correction term. - ! Allow convection if ground temp is colder than lake but warmer than 4C, or warmer than - ! lake which is warmer than freezing but less than 4C. - if ( (snl(c) < 0 .or. t_lake(c,1) <= tfrz) .and. t_grnd(c) > tfrz) then - t_grnd_temp = t_grnd(c) - t_grnd(c) = tfrz - eflx_sh_grnd(p) = forc_rho(c)*cpair*(t_grnd(c)-thm(p))/rah(p) - qflx_evap_soi(p) = forc_rho(c)*(qsatg(c)+qsatgdT(c)*(t_grnd(c)-t_grnd_temp) - forc_q(c))/raw(p) - else if ( (t_lake(c,1) > t_grnd(c) .and. t_grnd(c) > tdmax) .or. & - (t_lake(c,1) < t_grnd(c) .and. t_lake(c,1) > tfrz .and. t_grnd(c) < tdmax) ) then - ! Convective mixing will occur at surface - t_grnd_temp = t_grnd(c) - t_grnd(c) = t_lake(c,1) - eflx_sh_grnd(p) = forc_rho(c)*cpair*(t_grnd(c)-thm(p))/rah(p) - qflx_evap_soi(p) = forc_rho(c)*(qsatg(c)+qsatgdT(c)*(t_grnd(c)-t_grnd_temp) - forc_q(c))/raw(p) - end if - - ! Update htvp - if (t_grnd(c) > tfrz) then - htvp(c) = hvap - else - htvp(c) = hsub - end if - - ! Net longwave from ground to atmosphere - ! eflx_lwrad_out(p) = (1._r8-emg_lake)*forc_lwrad(c) + stftg3(p)*(-3._r8*tgbef(c)+4._r8*t_grnd(c)) - ! What is tgbef doing in this equation? Can't it be exact now? --Zack Subin, 4/14/09 - - eflx_lwrad_out(p) = (1._r8-emg_lake)*forc_lwrad(c) + emg_lake*sb*t_grnd(c)**4._r8 - - ! Ground heat flux - - eflx_soil_grnd(p) = sabg(p) + forc_lwrad(c) - eflx_lwrad_out(p) - & - eflx_sh_grnd(p) - htvp(c)*qflx_evap_soi(p) - ! The original code in Biogeophysiclake had a bug that calculated incorrect fluxes but conserved energy. - ! This is kept as the full sabg (not just that absorbed at surface) so that the energy balance check will be correct. - !This is the effective energy flux into the ground including the lake [and now snow in CLM 4] solar absorption - !below the surface. This also keeps the output FGR similar to non-lakes by including the light & heat flux. - ! The variable eflx_gnet will be used to pass the actual heat flux - !from the ground interface into the lake. - - taux(p) = -forc_rho(c)*forc_u(g)/ram(p) - tauy(p) = -forc_rho(c)*forc_v(g)/ram(p) - - eflx_sh_tot(p) = eflx_sh_grnd(p) - qflx_evap_tot(p) = qflx_evap_soi(p) - eflx_lh_tot(p) = htvp(c)*qflx_evap_soi(p) - eflx_lh_grnd(p) = htvp(c)*qflx_evap_soi(p) - - ! 2 m height air temperature - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - - ! 2 m height specific humidity - q_ref2m(p) = forc_q(c) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - - ! Human Heat Stress - - if ( calc_human_stress_indices )then - call KtoC(t_ref2m(p), tc_ref2m(p)) - call VaporPres(rh_ref2m(p), e_ref2m, vap_ref2m(p)) - call Wet_Bulb(t_ref2m(p), vap_ref2m(p), forc_pbot(c), rh_ref2m(p), & - q_ref2m(p), teq_ref2m(p), ept_ref2m(p), wb_ref2m(p)) - call Wet_BulbS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p)) - call HeatIndex(tc_ref2m(p), rh_ref2m(p), nws_hi_ref2m(p)) - call AppTemp(tc_ref2m(p), vap_ref2m(p), u10_clm(p), appar_temp_ref2m(p)) - call swbgt(tc_ref2m(p), vap_ref2m(p), swbgt_ref2m(p)) - call hmdex(tc_ref2m(p), vap_ref2m(p), humidex_ref2m(p)) - call dis_coi(tc_ref2m(p), wb_ref2m(p), discomf_index_ref2m(p)) - call dis_coiS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p), discomf_index_ref2mS(p)) - call THIndex(tc_ref2m(p), wb_ref2m(p), thic_ref2m(p), thip_ref2m(p)) - call SwampCoolEff(tc_ref2m(p), wb_ref2m(p), swmp80_ref2m(p), swmp65_ref2m(p)) - end if - - - ! Energy residual used for melting snow - ! Effectively moved to LakeTemp - - eflx_gnet(p) = betaprime(c) * sabg(p) + forc_lwrad(c) - (eflx_lwrad_out(p) + & - eflx_sh_tot(p) + eflx_lh_tot(p)) - ! This is the actual heat flux from the ground interface into the lake, not including - ! the light that penetrates the surface. - - !u2m = max(1.0_r8,ustar(p)/vkc*log(2._r8/z0mg(p))) - ! u2 often goes below 1 m/s; it seems like the only reason for this minimum is to - ! keep it from being zero in the ks equation below; 0.1 m/s is a better limit for - ! stable conditions --ZS - u2m = max(0.1_r8,ustar(p)/vkc*log(2._r8/z0mg(p))) - - ws(c) = 1.2e-03_r8 * u2m - ks(c) = 6.6_r8*sqrt(abs(sin(grc%lat(g))))*(u2m**(-1.84_r8)) - - ! Update column roughness lengths and friction velocity - z0mg_col(c) = z0mg(p) - z0hg_col(c) = z0hg(p) - z0qg_col(c) = z0qg(p) - ust_lake(c) = ustar(p) - - end do - - ! The following are needed for global average on history tape. - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - t_veg(p) = forc_t(c) - eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) - qflx_prec_grnd(p) = forc_rain(c) + forc_snow(c) - t_skin_patch(p) = t_veg(p) - end do - - end associate - - end subroutine LakeFluxes - -end module LakeFluxesMod diff --git a/src/biogeophys/LakeHydrologyMod.F90 b/src/biogeophys/LakeHydrologyMod.F90 deleted file mode 100644 index b7e91a4fc3..0000000000 --- a/src/biogeophys/LakeHydrologyMod.F90 +++ /dev/null @@ -1,684 +0,0 @@ -module LakeHydrologyMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculation of Lake Hydrology. Full hydrology, aerosol deposition, etc. of snow layers is - ! done. However, there is no infiltration, and the water budget is balanced with - ! qflx_qrgwl. Lake water mass is kept constant. The soil is simply maintained at - ! volumetric saturation if ice melting frees up pore space. Likewise, if the water - ! portion alone at some point exceeds pore capacity, it is reduced. This is consistent - ! with the possibility of initializing the soil layer with excess ice. - ! - ! If snow layers are present over an unfrozen lake, and the top layer of the lake - ! is capable of absorbing the latent heat without going below freezing, - ! the snow-water is runoff and the latent heat is subtracted from the lake. - ! - ! Minimum snow layer thickness for lakes has been increased to avoid instabilities with 30 min timestep. - ! Also frost / dew is prevented from being added to top snow layers that have already melted during the phase change step. - ! - ! ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use ColumnType , only : col - use PatchType , only : patch - use atm2lndType , only : atm2lnd_type - use AerosolMod , only : aerosol_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use LakeStateType , only : lakestate_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use TotalWaterAndHeatMod , only : ComputeWaterMassLake - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: LakeHydrology ! Calculates soil/snow hydrology - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine LakeHydrology(bounds, & - num_lakec, filter_lakec, num_lakep, filter_lakep, & - num_shlakesnowc, filter_shlakesnowc, num_shlakenosnowc, filter_shlakenosnowc, & - atm2lnd_inst, temperature_inst, soilstate_inst, waterstate_inst, waterflux_inst, & - energyflux_inst, aerosol_inst, lakestate_inst, topo_inst) - ! - ! !DESCRIPTION: - ! WARNING: This subroutine assumes lake columns have one and only one pft. - ! - ! Sequence is: - ! LakeHydrology: - ! Do needed tasks from CanopyHydrology, Biogeophysics2, & top of SoilHydrology. - ! -> SnowWater: change of snow mass and snow water onto soil - ! -> SnowCompaction: compaction of snow layers - ! -> CombineSnowLayers: combine snow layers that are thinner than minimum - ! -> DivideSnowLayers: subdivide snow layers that are thicker than maximum - ! - ! Add water to soil if melting has left it with open pore space. - ! If snow layers are found above a lake with unfrozen top layer, whose top - ! layer has enough heat to melt all the snow ice without freezing, do so - ! and eliminate the snow layers. - ! Cleanup and do water balance. - ! - ! !USES: - use clm_varcon , only : denh2o, denice, spval, hfus, tfrz, cpliq, cpice - use clm_varpar , only : nlevsno, nlevgrnd, nlevsoi - use clm_varctl , only : iulog - use clm_time_manager, only : get_step_size - use SnowHydrologyMod, only : SnowCompaction, CombineSnowLayers, SnowWater, BuildSnowFilter, SnowCapping - use SnowHydrologyMod, only : DivideSnowLayers, NewSnowBulkDensity - use LakeCon , only : lsadz - use TopoMod, only : topo_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - integer , intent(in) :: num_lakep ! number of pft lake points in column filter - integer , intent(in) :: filter_lakep(:) ! patch filter for lake points - integer , intent(out) :: num_shlakesnowc ! number of column snow points - integer , intent(out) :: filter_shlakesnowc(:) ! column filter for snow points - integer , intent(out) :: num_shlakenosnowc ! number of column non-snow points - integer , intent(out) :: filter_shlakenosnowc(:) ! column filter for non-snow points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - type(lakestate_type) , intent(inout) :: lakestate_inst - class(topo_type) , intent(in) :: topo_inst - ! - ! !LOCAL VARIABLES: - integer :: p,fp,g,l,c,j,fc,jtop ! indices - real(r8) :: dtime ! land model time step (sec) - integer :: newnode ! flag when new snow node is set, (1=yes, 0=no) - real(r8) :: dz_snowf ! layer thickness rate change due to precipitation [mm/s] - real(r8) :: bifall(bounds%begc:bounds%endc) ! bulk density of newly fallen dry snow [kg/m3] - real(r8) :: fracsnow(bounds%begp:bounds%endp) ! frac of precipitation that is snow - real(r8) :: fracrain(bounds%begp:bounds%endp) ! frac of precipitation that is rain - real(r8) :: qflx_prec_grnd_snow(bounds%begp:bounds%endp) ! snow precipitation incident on ground [mm/s] - real(r8) :: qflx_prec_grnd_rain(bounds%begp:bounds%endp) ! rain precipitation incident on ground [mm/s] - real(r8) :: qflx_evap_soi_lim ! temporary evap_soi limited by top snow layer content [mm/s] - real(r8) :: h2osno_temp ! temporary h2osno [kg/m^2] - real(r8) :: sumsnowice(bounds%begc:bounds%endc) ! sum of snow ice if snow layers found above unfrozen lake [kg/m&2] - logical :: unfrozen(bounds%begc:bounds%endc) ! true if top lake layer is unfrozen with snow layers above - real(r8) :: heatrem ! used in case above [J/m^2] - real(r8) :: heatsum(bounds%begc:bounds%endc) ! used in case above [J/m^2] - real(r8) :: snowmass ! liquid+ice snow mass in a layer [kg/m2] - real(r8) :: snowcap_scl_fct ! temporary factor used to correct for snow capping - real(r8), parameter :: snow_bd = 250._r8 ! assumed snow bulk density (for lakes w/out resolved snow layers) [kg/m^3] - ! Should only be used for frost below. - !----------------------------------------------------------------------- - - associate( & - pcolumn => patch%column , & ! Input: [integer (:) ] pft's column index - pgridcell => patch%gridcell , & ! Input: [integer (:) ] pft's gridcell index - cgridcell => col%gridcell , & ! Input: [integer (:) ] column's gridcell - clandunit => col%landunit , & ! Input: [integer (:) ] column's landunit - dz_lake => col%dz_lake , & ! Input: [real(r8) (:,:) ] layer thickness for lake (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface depth (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - forc_rain => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] rain rate [mm/s] - forc_snow => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] snow rate [mm/s] - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - qflx_floodg => atm2lnd_inst%forc_flood_grc , & ! Input: [real(r8) (:) ] gridcell flux of flood water from RTM - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - - t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] snow temperature (Kelvin) - dTdz_top => temperature_inst%dTdz_top_col , & ! Output: [real(r8) (:) ] temperature gradient in top layer K m-1] !TOD - snot_top => temperature_inst%snot_top_col , & ! Output: [real(r8) (:) ] snow temperature in top layer [K] !TODO - t_sno_mul_mss => temperature_inst%t_sno_mul_mss_col , & ! Output: [real(r8) (:) ] col snow temperature multiplied by layer mass, layer sum (K * kg/m2) - - begwb => waterstate_inst%begwb_col , & ! Input: [real(r8) (:) ] water mass begining of the time step - endwb => waterstate_inst%endwb_col , & ! Output: [real(r8) (:) ] water mass end of the time step - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective snow grain radius (col,lyr) [microns, m^-6] - snw_rds_top => waterstate_inst%snw_rds_top_col , & ! Output: [real(r8) (:) ] effective snow grain size, top layer [microns] - h2osno_top => waterstate_inst%h2osno_top_col , & ! Output: [real(r8) (:) ] mass of snow in top layer [kg] - sno_liq_top => waterstate_inst%sno_liq_top_col , & ! Output: [real(r8) (:) ] liquid water fraction in top snow layer [frc] - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Output: [real(r8) (:) ] needed for snicar code - frac_iceold => waterstate_inst%frac_iceold_col , & ! Output: [real(r8) (:,:) ] fraction of ice relative to the tot water - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - h2osno => waterstate_inst%h2osno_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) - snowice => waterstate_inst%snowice_col , & ! Output: [real(r8) (:) ] average snow ice lens - snowliq => waterstate_inst%snowliq_col , & ! Output: [real(r8) (:) ] average snow liquid water - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: [real(r8) (:,:) ] volumetric soil water [m3/m3] - - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Output: [real(r8) (:) ] column flux of flood water from RTM - qflx_prec_grnd => waterflux_inst%qflx_prec_grnd_patch , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)] - qflx_snow_grnd_patch => waterflux_inst%qflx_snow_grnd_patch , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+] - qflx_rain_grnd => waterflux_inst%qflx_rain_grnd_patch , & ! Output: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+] - qflx_rain_grnd_col => waterflux_inst%qflx_rain_grnd_col , & ! Output: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+] - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_sub_snow => waterflux_inst%qflx_sub_snow_patch , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_patch , & ! Output: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_patch , & ! Output: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_patch , & ! Output: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_snomelt => waterflux_inst%qflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt (mm H2O /s) - qflx_snomelt_lyr => waterflux_inst%qflx_snomelt_lyr_col , & ! Output: [real(r8) (:) ] snow melt in each layer (mm H2O /s) - qflx_prec_grnd_col => waterflux_inst%qflx_prec_grnd_col , & ! Output: [real(r8) (:) ] water onto ground including canopy runoff [kg/(m2 s)] - qflx_evap_grnd_col => waterflux_inst%qflx_evap_grnd_col , & ! Output: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_dew_grnd_col => waterflux_inst%qflx_dew_grnd_col , & ! Output: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_dew_snow_col => waterflux_inst%qflx_dew_snow_col , & ! Output: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_sub_snow_col => waterflux_inst%qflx_sub_snow_col , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_snow_grnd_col => waterflux_inst%qflx_snow_grnd_col , & ! Output: [real(r8) (:) ] snow on ground after interception (mm H2O/s) [+] - qflx_evap_tot_col => waterflux_inst%qflx_evap_tot_col , & ! Output: [real(r8) (:) ] pft quantity averaged to the column (assuming one pft) - qflx_snwcp_ice => waterflux_inst%qflx_snwcp_ice_col , & ! Output: [real(r8) (:) ] excess solid h2o due to snow capping (outgoing) (mm H2O /s) [+] - qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! Input: [real(r8) (:) ] excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] - qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! Input: [real(r8) (:) ] excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) !TODO - move this to somewhere else - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s) - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Output: [real(r8) (:) ] drainage from snow pack - qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) - qflx_drain => waterflux_inst%qflx_drain_col , & ! Output: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Output: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes - qflx_runoff => waterflux_inst%qflx_runoff_col , & ! Output: [real(r8) (:) ] total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - qflx_ice_runoff_snwcp => waterflux_inst%qflx_ice_runoff_snwcp_col, & ! Output: [real(r8) (:)] solid runoff from snow capping (mm H2O /s) - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) - - eflx_snomelt => energyflux_inst%eflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_soil_grnd => energyflux_inst%eflx_soil_grnd_patch , & ! Output: [real(r8) (:) ] heat flux into snow / lake (W/m**2) [+ = into soil] - eflx_gnet => energyflux_inst%eflx_gnet_patch , & ! Output: [reay(r8) (:) ] net heat flux into ground (W/m**2) - eflx_grnd_lake => energyflux_inst%eflx_grnd_lake_patch , & ! Output: [real(r8) (:) ] net heat flux into lake / snow surface, excluding light transmission (W/m**2) - - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Output: [real(r8) (:,:) ] mass fraction of lake layer that is frozen - - begc => bounds%begc, & - endc => bounds%endc & - ) - - ! Determine step size - dtime = get_step_size() - - !!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Do precipitation onto ground, etc., from CanopyHydrology - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - - qflx_prec_grnd_snow(p) = forc_snow(c) - qflx_prec_grnd_rain(p) = forc_rain(c) - qflx_prec_grnd(p) = qflx_prec_grnd_snow(p) + qflx_prec_grnd_rain(p) - - qflx_snow_grnd_patch(p) = qflx_prec_grnd_snow(p) ! ice onto ground (mm/s) - qflx_rain_grnd(p) = qflx_prec_grnd_rain(p) ! liquid water onto ground (mm/s) - - ! Assuming one PFT; needed for below - qflx_snow_grnd_col(c) = qflx_snow_grnd_patch(p) - qflx_rain_grnd_col(c) = qflx_rain_grnd(p) - - end do ! (end pft loop) - - ! Determine snow height and snow water - - call NewSnowBulkDensity(bounds, num_lakec, filter_lakec, & - atm2lnd_inst, bifall(bounds%begc:bounds%endc)) - - do fc = 1, num_lakec - c = filter_lakec(fc) - - ! Use Alta relationship, Anderson(1976); LaChapelle(1961), - ! U.S.Department of Agriculture Forest Service, Project F, - ! Progress Rep. 1, Alta Avalanche Study Center:Snow Layer Densification. - - dz_snowf = qflx_snow_grnd_col(c)/bifall(c) - snow_depth(c) = snow_depth(c) + dz_snowf*dtime - h2osno(c) = h2osno(c) + qflx_snow_grnd_col(c)*dtime ! snow water equivalent (mm) - - ! When the snow accumulation exceeds 40 mm, initialize snow layer - ! Currently, the water temperature for the precipitation is simply set - ! as the surface air temperature - - newnode = 0 ! flag for when snow node will be initialized - if (snl(c) == 0 .and. qflx_snow_grnd_col(c) > 0.0_r8 .and. snow_depth(c) >= 0.01_r8 + lsadz) then - newnode = 1 - snl(c) = -1 - dz(c,0) = snow_depth(c) ! meter - z(c,0) = -0.5_r8*dz(c,0) - zi(c,-1) = -dz(c,0) - t_soisno(c,0) = min(tfrz, forc_t(c)) ! K - h2osoi_ice(c,0) = h2osno(c) ! kg/m2 - h2osoi_liq(c,0) = 0._r8 ! kg/m2 - frac_iceold(c,0) = 1._r8 - - ! intitialize SNICAR variables for fresh snow: - call aerosol_inst%Reset(column=c) - call waterstate_inst%Reset(column=c) - - end if - - ! The change of ice partial density of surface node due to precipitation. - ! Only ice part of snowfall is added here, the liquid part will be added - ! later. - - if (snl(c) < 0 .and. newnode == 0) then - h2osoi_ice(c,snl(c)+1) = h2osoi_ice(c,snl(c)+1)+dtime*qflx_snow_grnd_col(c) - dz(c,snl(c)+1) = dz(c,snl(c)+1)+dz_snowf*dtime - end if - - end do - - ! Calculate sublimation and dew, adapted from HydrologyLake and Biogeophysics2. - - do fp = 1,num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - jtop = snl(c)+1 - - qflx_evap_grnd(p) = 0._r8 - qflx_sub_snow(p) = 0._r8 - qflx_dew_snow(p) = 0._r8 - qflx_dew_grnd(p) = 0._r8 - - if (jtop <= 0) then ! snow layers - j = jtop - ! Assign ground evaporation to sublimation from soil ice or to dew - ! on snow or ground - - if (qflx_evap_soi(p) >= 0._r8) then - ! for evaporation partitioning between liquid evap and ice sublimation, - ! use the ratio of liquid to (liquid+ice) in the top layer to determine split - ! Since we're not limiting evap over lakes, but still can't remove more from top - ! snow layer than there is there, create temp. limited evap_soi. - qflx_evap_soi_lim = min(qflx_evap_soi(p), (h2osoi_liq(c,j)+h2osoi_ice(c,j))/dtime) - if ((h2osoi_liq(c,j)+h2osoi_ice(c,j)) > 0._r8) then - qflx_evap_grnd(p) = max(qflx_evap_soi_lim*(h2osoi_liq(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j))), 0._r8) - else - qflx_evap_grnd(p) = 0._r8 - end if - qflx_sub_snow(p) = qflx_evap_soi_lim - qflx_evap_grnd(p) - else - ! if (t_grnd(c) < tfrz) then - ! Causes rare blowup when thin snow layer should completely melt and has a high temp after thermal physics, - ! but then is not eliminated in SnowHydrology because of this added frost. Also see below removal of - ! completely melted single snow layer. - if (t_grnd(c) < tfrz .and. t_soisno(c,j) < tfrz) then - qflx_dew_snow(p) = abs(qflx_evap_soi(p)) - ! If top layer is only snow layer, SnowHydrology won't eliminate it if dew is added. - else if (j < 0 .or. (t_grnd(c) == tfrz .and. t_soisno(c,j) == tfrz)) then - qflx_dew_grnd(p) = abs(qflx_evap_soi(p)) - end if - end if - - else ! No snow layers - if (qflx_evap_soi(p) >= 0._r8) then - ! Sublimation: do not allow for more sublimation than there is snow - ! after melt. Remaining surface evaporation used for infiltration. - qflx_sub_snow(p) = min(qflx_evap_soi(p), h2osno(c)/dtime) - qflx_evap_grnd(p) = qflx_evap_soi(p) - qflx_sub_snow(p) - else - if (t_grnd(c) < tfrz-0.1_r8) then - qflx_dew_snow(p) = abs(qflx_evap_soi(p)) - else - qflx_dew_grnd(p) = abs(qflx_evap_soi(p)) - end if - end if - - ! Update snow pack for dew & sub. - - h2osno_temp = h2osno(c) - h2osno(c) = h2osno(c) + (-qflx_sub_snow(p)+qflx_dew_snow(p))*dtime - if (h2osno_temp > 0._r8) then - snow_depth(c) = snow_depth(c) * h2osno(c) / h2osno_temp - else - snow_depth(c) = h2osno(c)/snow_bd !Assume a constant snow bulk density = 250. - end if - - h2osno(c) = max(h2osno(c), 0._r8) - end if - end do - - ! patch averages must be done here -- BEFORE SNOW CALCULATIONS AS THEY USE IT. - ! for output to history tape and other uses - ! (note that pft2col is called before LakeHydrology, so we can't use that routine - ! to do these column -> pft averages) - do fp = 1,num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - - qflx_evap_tot_col(c) = qflx_evap_tot(p) - qflx_prec_grnd_col(c) = qflx_prec_grnd(p) - qflx_evap_grnd_col(c) = qflx_evap_grnd(p) - qflx_dew_grnd_col(c) = qflx_dew_grnd(p) - qflx_dew_snow_col(c) = qflx_dew_snow(p) - qflx_sub_snow_col(c) = qflx_sub_snow(p) - enddo - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! Determine initial snow/no-snow filters (will be modified possibly by - ! routines CombineSnowLayers and DivideSnowLayers below) - - call BuildSnowFilter(bounds, num_lakec, filter_lakec, & - num_shlakesnowc, filter_shlakesnowc, num_shlakenosnowc, filter_shlakenosnowc) - - ! specify snow fraction - do fc = 1, num_lakec - c = filter_lakec(fc) - if (h2osno(c) > 0.0_r8) then - frac_sno_eff(c) = 1._r8 - else - frac_sno_eff(c) = 0._r8 - endif - enddo - - ! Determine the change of snow mass and the snow water onto soil - - call SnowWater(bounds, & - num_shlakesnowc, filter_shlakesnowc, num_shlakenosnowc, filter_shlakenosnowc, & - atm2lnd_inst, waterflux_inst, waterstate_inst, aerosol_inst) - - call SnowCapping(bounds, num_lakec, filter_lakec, num_shlakesnowc, filter_shlakesnowc, & - aerosol_inst, waterflux_inst, waterstate_inst, topo_inst) - - ! Determine soil hydrology - ! Here this consists only of making sure that soil is saturated even as it melts and - ! pore space opens up. Conversely, if excess ice is melting and the liquid water exceeds the - ! saturation value, then remove water. - - do j = 1,nlevsoi !nlevgrnd - ! changed to nlevsoi on 8/11/10 to make consistent with non-lake bedrock - do fc = 1, num_lakec - c = filter_lakec(fc) - - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) - ! Could have changed during phase change! (Added 8/11/10) - - if (h2osoi_vol(c,j) < watsat(c,j)) then - h2osoi_liq(c,j) = (watsat(c,j)*dz(c,j) - h2osoi_ice(c,j)/denice)*denh2o - ! h2osoi_vol will be updated below, and this water addition will come from qflx_qrgwl - else if (h2osoi_liq(c,j) > watsat(c,j)*denh2o*dz(c,j)) then - h2osoi_liq(c,j) = watsat(c,j)*denh2o*dz(c,j) - ! Another way to do this would be: if h2osoi_vol > watsat then remove min(h2osoi_liq, - !(h2osoi_vol-watsat)*dz*denh2o) from h2osoi_liq. The question is whether the excess ice - ! melts first or last (or simultaneously) to the pore ice. Because excess ice is often in chunks, - ! requiring greater convergence of heat to melt, assume it melts last. - ! This will also improve the initialization behavior or in an occasionally warm year, the excess ice - ! won't start going away if a layer is briefly at freezing. - - ! Allow up to 10% excess ice over watsat in refreezing soil, - ! e.g. heaving soil. (As with > 10% excess ice modeling, and for the lake water, - ! the thermal conductivity will be adjusted down to compensate for the fact that the nominal dz is smaller - ! than the real soil volume.) The current solution is consistent but perhaps unrealistic in real soils, - ! where slow drainage may occur during freezing; drainage is only assumed to occur here when >10% excess - ! ice melts. The latter is more likely to be permanent rather than seasonal anyway. Attempting to remove the - ! ice volume after some has already frozen during the timestep would not conserve energy unless this were - ! incorporated into the ice stream. - - end if - - end do - end do - !!!!!!!!!! - - ! Natural compaction and metamorphosis. - - call SnowCompaction(bounds, num_shlakesnowc, filter_shlakesnowc, & - temperature_inst, waterstate_inst, atm2lnd_inst) - - ! Combine thin snow elements - - call CombineSnowLayers(bounds, num_shlakesnowc, filter_shlakesnowc, & - aerosol_inst, temperature_inst, waterflux_inst, waterstate_inst) - - ! Divide thick snow elements - - call DivideSnowLayers(bounds, num_shlakesnowc, filter_shlakesnowc, & - aerosol_inst, temperature_inst, waterstate_inst, is_lake=.true.) - - ! Check for single completely unfrozen snow layer over lake. Modeling this ponding is unnecessary and - ! can cause instability after the timestep when melt is completed, as the temperature after melt can be - ! excessive because the fluxes were calculated with a fixed ground temperature of freezing, but the - ! phase change was unable to restore the temperature to freezing. - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - - j = 0 - - if (snl(c) == -1) then - if (h2osoi_ice(c,j) > 0._r8 .and. t_soisno(c,j) > tfrz) then - - ! Take extra heat of layer and release to sensible heat in order - ! to maintain energy conservation. - heatrem = (cpliq*h2osoi_liq(c,j))*(t_soisno(c,j) - tfrz) - t_soisno(c,j) = tfrz - eflx_sh_tot(p) = eflx_sh_tot(p) + heatrem/dtime - eflx_sh_grnd(p) = eflx_sh_grnd(p) + heatrem/dtime - eflx_soil_grnd(p) = eflx_soil_grnd(p) - heatrem/dtime - eflx_gnet(p) = eflx_gnet(p) - heatrem/dtime - eflx_grnd_lake(p) = eflx_grnd_lake(p) - heatrem/dtime - else if (h2osoi_ice(c,j) == 0._r8) then - ! Remove layer - ! Take extra heat of layer and release to sensible heat in order - ! to maintain energy conservation. - heatrem = cpliq*h2osoi_liq(c,j)*(t_soisno(c,j) - tfrz) - eflx_sh_tot(p) = eflx_sh_tot(p) + heatrem/dtime - eflx_sh_grnd(p) = eflx_sh_grnd(p) + heatrem/dtime - eflx_soil_grnd(p) = eflx_soil_grnd(p) - heatrem/dtime - eflx_gnet(p) = eflx_gnet(p) - heatrem/dtime - eflx_grnd_lake(p) = eflx_grnd_lake(p) - heatrem/dtime - qflx_snow_drain(c) = qflx_snow_drain(c) + h2osno(c)/dtime - snl(c) = 0 - h2osno(c) = 0._r8 - snow_depth(c) = 0._r8 - ! Rest of snow layer book-keeping will be done below. - else - eflx_grnd_lake(p) = eflx_gnet(p) - end if - else - eflx_grnd_lake(p) = eflx_gnet(p) - end if - end do - - ! Check for snow layers above lake with unfrozen top layer. Mechanically, - ! the snow will fall into the lake and melt or turn to ice. If the top layer has - ! sufficient heat to melt the snow without freezing, then that will be done. - ! Otherwise, the top layer will undergo freezing, but only if the top layer will - ! not freeze completely. Otherwise, let the snow layers persist and melt by diffusion. - - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (t_lake(c,1) > tfrz .and. lake_icefrac(c,1) == 0._r8 .and. snl(c) < 0) then - unfrozen(c) = .true. - else - unfrozen(c) = .false. - end if - end do - - do j = -nlevsno+1,0 - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (unfrozen(c)) then - if (j == -nlevsno+1) then - sumsnowice(c) = 0._r8 - heatsum(c) = 0._r8 - end if - if (j >= snl(c)+1) then - sumsnowice(c) = sumsnowice(c) + h2osoi_ice(c,j) - heatsum(c) = heatsum(c) + h2osoi_ice(c,j)*cpice*(tfrz - t_soisno(c,j)) & - + h2osoi_liq(c,j)*cpliq*(tfrz - t_soisno(c,j)) - end if - end if - end do - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (unfrozen(c)) then - heatsum(c) = heatsum(c) + sumsnowice(c)*hfus - heatrem = (t_lake(c,1) - tfrz)*cpliq*denh2o*dz_lake(c,1) - heatsum(c) - - if (heatrem + denh2o*dz_lake(c,1)*hfus > 0._r8) then - ! Remove snow and subtract the latent heat from the top layer. - qflx_snomelt(c) = qflx_snomelt(c) + sumsnowice(c)/dtime - eflx_snomelt(c) = eflx_snomelt(c) + sumsnowice(c)*hfus/dtime - - ! Update melt per layer. Note that sumsnowice = sum(h2osoi_ice), where the - ! sum is taken over layers snl(c)+1 to 0. Thus, this code partitions the - ! above addition to qflx_snomelt (which is based on sumsnowice). - do j = snl(c)+1,0 - qflx_snomelt_lyr(c,j) = qflx_snomelt_lyr(c,j) + h2osoi_ice(c,j) / dtime - end do - - ! update incidental drainage from snow pack for this case - qflx_snow_drain(c) = qflx_snow_drain(c) + h2osno(c)/dtime - - h2osno(c) = 0._r8 - snow_depth(c) = 0._r8 - snl(c) = 0 - ! The rest of the bookkeeping for the removed snow will be done below. - if (heatrem > 0._r8) then ! simply subtract the heat from the layer - t_lake(c,1) = t_lake(c,1) - heatrem/(cpliq*denh2o*dz_lake(c,1)) - else !freeze part of the layer - t_lake(c,1) = tfrz - lake_icefrac(c,1) = -heatrem/(denh2o*dz_lake(c,1)*hfus) - end if - end if - end if - end do - - ! Set empty snow layers to zero - - do j = -nlevsno+1,0 - do fc = 1, num_shlakesnowc - c = filter_shlakesnowc(fc) - if (j <= snl(c) .and. snl(c) > -nlevsno) then - h2osoi_ice(c,j) = 0._r8 - h2osoi_liq(c,j) = 0._r8 - t_soisno(c,j) = 0._r8 - dz(c,j) = 0._r8 - z(c,j) = 0._r8 - zi(c,j-1) = 0._r8 - end if - end do - end do - - ! Build new snow filter - - call BuildSnowFilter(bounds, num_lakec, filter_lakec, & - num_shlakesnowc, filter_shlakesnowc, num_shlakenosnowc, filter_shlakenosnowc) - - ! Vertically average t_soisno and sum of h2osoi_liq and h2osoi_ice - ! over all snow layers for history output - - do fc = 1, num_lakec - c = filter_lakec(fc) - snowice(c) = 0._r8 - snowliq(c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_shlakesnowc - c = filter_shlakesnowc(fc) - if (j >= snl(c)+1) then - snowice(c) = snowice(c) + h2osoi_ice(c,j) - snowliq(c) = snowliq(c) + h2osoi_liq(c,j) - end if - end do - end do - - ! Snow internal temperature - ! See description in HydrologyNoDrainageMod - - do fc = 1, num_lakec - c = filter_lakec(fc) - t_sno_mul_mss(c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_shlakesnowc - c = filter_shlakesnowc(fc) - if (j >= snl(c)+1) then - t_sno_mul_mss(c) = t_sno_mul_mss(c) + h2osoi_ice(c,j) * t_soisno(c,j) - t_sno_mul_mss(c) = t_sno_mul_mss(c) + h2osoi_liq(c,j) * tfrz - end if - end do - end do - - ! Determine ending water balance and volumetric soil water - - call ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, endwb(bounds%begc:bounds%endc)) - - do j = 1, nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) - end do - end do - - do fp = 1,num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - g = pgridcell(p) - - qflx_drain_perched(c) = 0._r8 - qflx_h2osfc_surf(c) = 0._r8 - qflx_rsub_sat(c) = 0._r8 - qflx_infl(c) = 0._r8 - qflx_surf(c) = 0._r8 - qflx_drain(c) = 0._r8 - - ! Insure water balance using qflx_qrgwl - ! qflx_snwcp_ice(c) has been computed in routine SnowCapping - qflx_qrgwl(c) = forc_rain(c) + forc_snow(c) - qflx_evap_tot(p) - qflx_snwcp_ice(c) - & - qflx_snwcp_discarded_ice(c) - qflx_snwcp_discarded_liq(c) - & - (endwb(c)-begwb(c))/dtime + qflx_floodg(g) - qflx_floodc(c) = qflx_floodg(g) - qflx_runoff(c) = qflx_drain(c) + qflx_qrgwl(c) - qflx_top_soil(c) = qflx_prec_grnd_rain(p) + qflx_snow_drain(c) - qflx_ice_runoff_snwcp(c) = qflx_snwcp_ice(c) - - enddo - - ! top-layer diagnostics - do fc = 1, num_shlakesnowc - c = filter_shlakesnowc(fc) - h2osno_top(c) = h2osoi_ice(c,snl(c)+1) + h2osoi_liq(c,snl(c)+1) - end do - - ! Zero variables in columns without snow - do fc = 1, num_shlakenosnowc - c = filter_shlakenosnowc(fc) - - h2osno_top(c) = 0._r8 - snw_rds(c,:) = 0._r8 - - ! top-layer diagnostics (spval is not averaged when computing history fields) - snot_top(c) = spval - dTdz_top(c) = spval - snw_rds_top(c) = spval - sno_liq_top(c) = spval - end do - - end associate - - end subroutine LakeHydrology - -end module LakeHydrologyMod diff --git a/src/biogeophys/LakeStateType.F90 b/src/biogeophys/LakeStateType.F90 deleted file mode 100644 index 11074aaae1..0000000000 --- a/src/biogeophys/LakeStateType.F90 +++ /dev/null @@ -1,296 +0,0 @@ -module LakeStateType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Lake data types and associated procesures - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : spval, grlnd - use decompMod , only : bounds_type - use spmdMod , only : masterproc - use abortUtils , only : endrun - use LandunitType , only : lun - use ColumnType , only : col - ! - implicit none - save - private - ! - ! !PUBLIC TYPES: - type, public :: lakestate_type - ! Time constant variables - real(r8), pointer :: lakefetch_col (:) ! col lake fetch from surface data (m) - real(r8), pointer :: etal_col (:) ! col lake extinction coefficient from surface data (1/m) - - ! Time varying variables - real(r8), pointer :: lake_raw_col (:) ! col aerodynamic resistance for moisture (s/m) - real(r8), pointer :: ks_col (:) ! col coefficient for calculation of decay of eddy diffusivity with depth - real(r8), pointer :: ws_col (:) ! col surface friction velocity (m/s) - real(r8), pointer :: ust_lake_col (:) ! col friction velocity (m/s) - real(r8), pointer :: betaprime_col (:) ! col effective beta: sabg_lyr(p,jtop) for snow layers, beta otherwise - real(r8), pointer :: savedtke1_col (:) ! col top level eddy conductivity from previous timestep (W/mK) - real(r8), pointer :: lake_icefrac_col (:,:) ! col mass fraction of lake layer that is frozen - real(r8), pointer :: lake_icefracsurf_col(:) ! col mass fraction of surface lake layer that is frozen - real(r8), pointer :: lake_icethick_col (:) ! col ice thickness (m) (integrated if lakepuddling) - real(r8), pointer :: lakeresist_col (:) ! col [s/m] (Needed for calc. of grnd_ch4_cond) - real(r8), pointer :: ram1_lake_patch (:) ! patch aerodynamical resistance (s/m) - - contains - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type lakestate_type - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(lakestate_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate ( bounds ) - call this%InitHistory ( bounds ) - call this%InitCold ( bounds ) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use clm_varpar , only: nlevlak, nlevsno - ! - ! !ARGUMENTS: - class(lakestate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !--------------------------------------------------------------------- - - ! Initialize savedtke1 to spval so that c->g averaging will be done correctly - ! TODO: can this be now be set to nan??? - ! Initialize ust_lake to spval to detect input from restart file if not arbinit - ! TODO: can this be removed now??? - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc = bounds%endc - - allocate(this%etal_col (begc:endc)) ; this%etal_col (:) = nan - allocate(this%lakefetch_col (begc:endc)) ; this%lakefetch_col (:) = nan - allocate(this%lakeresist_col (begc:endc)) ; this%lakeresist_col (:) = nan - allocate(this%savedtke1_col (begc:endc)) ; this%savedtke1_col (:) = spval - allocate(this%lake_icefrac_col (begc:endc,1:nlevlak)) ; this%lake_icefrac_col (:,:) = nan - allocate(this%lake_icefracsurf_col (begc:endc)) ; this%lake_icefracsurf_col (:) = nan - allocate(this%lake_icethick_col (begc:endc)) ; this%lake_icethick_col (:) = nan - allocate(this%ust_lake_col (begc:endc)) ; this%ust_lake_col (:) = spval - allocate(this%ram1_lake_patch (begp:endp)) ; this%ram1_lake_patch (:) = nan - allocate(this%lake_raw_col (begc:endc)) ; this%lake_raw_col (:) = nan - allocate(this%ks_col (begc:endc)) ; this%ks_col (:) = nan - allocate(this%ws_col (begc:endc)) ; this%ws_col (:) = nan - allocate(this%betaprime_col (begc:endc)) ; this%betaprime_col (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use histFileMod , only: hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(lakestate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !--------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - this%lake_icefrac_col(begc:endc,:) = spval - call hist_addfld2d (fname='LAKEICEFRAC', units='unitless', type2d='levlak', & - avgflag='A', long_name='lake layer ice mass fraction', & - ptr_col=this%lake_icefrac_col, default='inactive') - - this%lake_icefracsurf_col(begc:endc) = spval - call hist_addfld1d (fname='LAKEICEFRAC_SURF', units='unitless', & - avgflag='A', long_name='surface lake layer ice mass fraction', & - ptr_col=this%lake_icefracsurf_col, set_nolake=spval) - - this%lake_icethick_col(begc:endc) = spval ! This will be more useful than LAKEICEFRAC for many users. - call hist_addfld1d (fname='LAKEICETHICK', units='m', & - avgflag='A', long_name='thickness of lake ice (including physical expansion on freezing)', & - ptr_col=this%lake_icethick_col, set_nolake=spval) - - this%savedtke1_col(begc:endc) = spval - call hist_addfld1d (fname='TKE1', units='W/(mK)', & - avgflag='A', long_name='top lake level eddy thermal conductivity', & - ptr_col=this%savedtke1_col) - - this%ram1_lake_patch(begp:endp) = spval - call hist_addfld1d (fname='RAM_LAKE', units='s/m', & - avgflag='A', long_name='aerodynamic resistance for momentum (lakes only)', & - ptr_patch=this%ram1_lake_patch, set_nolake=spval, default='inactive') - - this%ust_lake_col(begc:endc) = spval - call hist_addfld1d (fname='UST_LAKE', units='m/s', & - avgflag='A', long_name='friction velocity (lakes only)', & - ptr_col=this%ust_lake_col, set_nolake=spval, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize time constant and time varying module variables - ! - ! !USES: - use clm_varctl , only : fsurdat - use clm_varctl , only : iulog - use clm_varpar , only : nlevlak - use clm_varcon , only : tkwat - use fileutils , only : getfil - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use ncdio_pio , only : ncd_pio_openfile, ncd_inqfdims, ncd_pio_closefile, ncd_inqdid, ncd_inqdlen - ! - ! !ARGUMENTS: - class(lakestate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,g,i,j,l,lev - logical :: readvar - type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: locfn ! local filename - real(r8) :: depthratio ! ratio of lake depth to standard deep lake depth - real(r8) ,pointer :: lakefetch_in (:) ! read in - lakefetch - real(r8) ,pointer :: etal_in (:) ! read in - etal - !----------------------------------------------------------------------- - - !------------------------------------------------- - ! Initialize time constant variables - !------------------------------------------------- - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! Read lake eta - allocate(etal_in(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='ETALAKE', flag='read', data=etal_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - if (masterproc) then - write(iulog,*) 'WARNING:: ETALAKE not found on surface data set. All lake columns will have eta', & - ' set equal to default value as a function of depth.' - end if - etal_in(:) = -1._r8 - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%etal_col(c) = etal_in(g) - end do - deallocate(etal_in) - - ! Read lake fetch - allocate(lakefetch_in(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='LAKEFETCH', flag='read', data=lakefetch_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - if (masterproc) then - write(iulog,*) 'WARNING:: LAKEFETCH not found on surface data set. All lake columns will have fetch', & - ' set equal to default value as a function of depth.' - end if - lakefetch_in(:) = -1._r8 - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%lakefetch_col(c) = lakefetch_in(g) - end do - deallocate(lakefetch_in) - - call ncd_pio_closefile(ncid) - - !------------------------------------------------- - ! Initialize time varying variables - !------------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%lakpoi(l)) then - - ! Set lake ice fraction and top eddy conductivity from previous timestep - ! Always initialize with no ice to prevent excessive ice sheets from forming when - ! starting with old lake model that has unrealistically cold lake conseratures. - ! Keep lake temperature as is, and the energy deficit below freezing (which is no smaller - ! than it would have been with prognostic ice, as the temperature would then have been higher - ! and more heat would have flowed out of the lake) will be converted to ice in the first timestep. - this%lake_icefrac_col(c,1:nlevlak) = 0._r8 - - ! Set lake top eddy conductivity from previous timestep - this%savedtke1_col(c) = tkwat - - ! Set column friction vlocity - this%ust_lake_col(c) = 0.1_r8 - end if - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(lakestate_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='LAKE_ICEFRAC', xtype=ncd_double, & - dim1name='column', dim2name='levlak', switchdim=.true., & - long_name='lake layer ice fraction', units='kg/kg', & - interpinic_flag='interp', readvar=readvar, data=this%lake_icefrac_col) - - call restartvar(ncid=ncid, flag=flag, varname='SAVEDTKE1', xtype=ncd_double, & - dim1name='column', & - long_name='top lake layer eddy conductivity', units='W/(m K)', & - interpinic_flag='interp', readvar=readvar, data=this%savedtke1_col) - - call restartvar(ncid=ncid, flag=flag, varname='USTLAKE', xtype=ncd_double, & - dim1name='column', & - long_name='friction velocity for lakes', units='m/s', & - interpinic_flag='interp', readvar=readvar, data=this%ust_lake_col) - - end subroutine Restart - -end module LakeStateType - diff --git a/src/biogeophys/LakeTemperatureMod.F90 b/src/biogeophys/LakeTemperatureMod.F90 deleted file mode 100644 index bcb2965afa..0000000000 --- a/src/biogeophys/LakeTemperatureMod.F90 +++ /dev/null @@ -1,1466 +0,0 @@ -module LakeTemperatureMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates surface fluxes and temperature for lakes. - ! Created by Zack Subin, 2009 - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use ch4Mod , only : ch4_type - use EnergyFluxType , only : energyflux_type - use LakeStateType , only : lakestate_type - use SoilStateType , only : soilstate_type - use SolarAbsorbedType , only : solarabs_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: LakeTemperature ! Calculates Lake related temperature - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: SoilThermProp_Lake ! Set therm conductivities and heat cap of snow/soil layers - private :: PhaseChange_Lake ! Calculation of the phase change within snow/soil/lake layers - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine LakeTemperature(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep, & - solarabs_inst, soilstate_inst, waterstate_inst, waterflux_inst, ch4_inst, & - energyflux_inst, temperature_inst, lakestate_inst) - ! - ! !DESCRIPTION: - ! Calculates temperatures in the 25-45 layer column of (possible) snow, - ! lake water, soil, and bedrock beneath lake. - ! Snow and soil temperatures are determined as in Laketemperature, except - ! for appropriate boundary conditions at the top of the snow (the flux is fixed - ! to be the ground heat flux calculated in LakeFluxes), the bottom of the snow - ! (adjacent to top lake layer), and the top of the soil (adjacent to the bottom - ! lake layer). Also, the soil is kept fully saturated. - ! The whole column is solved simultaneously as one tridiagonal matrix. - ! Major changes from CLM4: - ! i) Lake water layers can freeze by any fraction and release latent heat; thermal - ! and mechanical properties are adjusted for ice fraction. - ! ii) Convective mixing (though not eddy diffusion) still occurs for frozen lakes. - ! iii) No sunlight is absorbed in the lake if there are snow layers (except for that allowed through - ! to the top "soil" layer by SNICAR) - ! iv) Light is allowed to reach the top soil layer (where it is assumed to be completely absorbed). - ! v) Lakes have variable depth, set ultimately in surface data set but now in initLakeMod. - ! vi) The extinction coefficient is now variable with depth. - ! vii) The fraction of shortwave absorbed at the surface is now the NIR fraction, rather than a fixed parameter. - ! viii) Enhanced background diffusion and option for increased mixing for deep lakes is added. - ! See discussion in Subin et al. 2011 - ! - ! Lakes are allowed to have variable depth, set in initLakeMod. - ! - ! Use the Crank-Nicholson method to set up tridiagonal system of equations to - ! solve for ts at time n+1, where the temperature equation for layer i is - ! r_i = a_i [ts_i-1] n+1 + b_i [ts_i] n+1 + c_i [ts_i+1] n+1 - ! - ! The solution conserves energy as: - ! - ! - ! cv*([ts(top soisno layer)] n+1 - [ts(top soisno layer)] n)*dz(top soisno layer)/dt + ... + - ! cv*([ts(nlevlak+nlevgrnd)] n+1 - [ts(nlevlak+nlevgrnd)] n)*dz(nlevlak+nlevgrnd)/dt = eflx_soil_grnd - ! cv is not constant. - ! ts is with respect to freezing temperature, as there is a discontinuity in cv at this temperature. - ! - ! where: - ! [ts] n = old temperature (kelvin) - ! [ts] n+1 = new temperature (kelvin) - ! eflx_soil_grnd = energy flux into lake (w/m**2) - ! = betaprime*sabg + forc_lwrad - eflx_lwrad_out - eflx_sh_tot - eflx_lh_tot - ! (This is now the same as the ground heat flux.) - ! + phi(1) + ... + phi(nlevlak) + phi(top soil level) - ! betaprime = beta (NIR fraction) for no snow layers, and sabg_lyr(p,jtop)/sabg(p) for snow layers. - ! - ! WARNING: This subroutine assumes lake columns have one and only one pft. - ! - ! Outline: - ! 1 ) Initialization - ! 2 ) Lake density - ! 3 ) Diffusivity - ! 4 ) Heat source term from solar radiation penetrating lake - ! 5 ) Set thermal props and find initial energy content - ! 6 ) Set up vectors for tridiagonal matrix solution - ! 7 ) Solve tridiagonal and back-substitute - ! 8 ) (Optional) Do first energy check using temperature change at constant heat capacity. - ! 9 ) Phase change - ! 9.5) (Optional) Do second energy check using temperature change and latent heat, - ! considering changed heat capacity. Also do soil water balance check. - ! 10 ) Convective mixing - ! 11 ) Do final energy check to detect small numerical errors (especially from convection) - ! and dump small imbalance into sensible heat, or pass large errors to BalanceCheckMod for abort. - ! - ! !USES: - use LakeCon , only : betavis, za_lake, n2min, tdmax, pudz, depthcrit, mixfact - use LakeCon , only : lakepuddling, lake_no_ed - use QSatMod , only : QSat - use TridiagonalMod , only : Tridiagonal - use clm_varpar , only : nlevlak, nlevgrnd, nlevsno - use clm_time_manager , only : get_step_size - use clm_varcon , only : hfus, cpliq, cpice, tkwat, tkice, denice - use clm_varcon , only : vkc, grav, denh2o, tfrz, cnfac - use clm_varctl , only : iulog, use_lch4 - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for non-lake points - integer , intent(in) :: num_lakep ! number of column non-lake points in pft filter - integer , intent(in) :: filter_lakep(:) ! patch filter for non-lake points - type(solarabs_type) , intent(in) :: solarabs_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(lakestate_type) , intent(inout) :: lakestate_inst - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: p0 = 1._r8 ! neutral value of turbulent prandtl number - integer :: i,j,fc,fp,g,c,p ! do loop or array index - real(r8) :: dtime ! land model time step (sec) - real(r8) :: beta(bounds%begc:bounds%endc) ! fraction of solar rad absorbed at surface: equal to NIR fraction - ! of surface absorbed shortwave - real(r8) :: eta ! light extinction coefficient (/m): depends on lake type - real(r8) :: cwat ! specific heat capacity of water (j/m**3/kelvin) - real(r8) :: cice_eff ! effective heat capacity of ice (using density of - ! water because layer depth is not adjusted when freezing - real(r8) :: cfus ! effective heat of fusion per unit volume - ! using water density as above - real(r8) :: km ! molecular diffusion coefficient (m**2/s) - real(r8) :: tkice_eff ! effective conductivity since layer depth is constant - real(r8) :: a(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! "a" vector for tridiagonal matrix - real(r8) :: b(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! "b" vector for tridiagonal matrix - real(r8) :: c1(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! "c" vector for tridiagonal matrix - real(r8) :: r(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! "r" vector for tridiagonal solution - real(r8) :: rhow(bounds%begc:bounds%endc,nlevlak) ! density of water (kg/m**3) - real(r8) :: phi(bounds%begc:bounds%endc,nlevlak) ! solar radiation absorbed by layer (w/m**2) - real(r8) :: kme(bounds%begc:bounds%endc,nlevlak) ! molecular + eddy diffusion coefficient (m**2/s) - real(r8) :: rsfin ! relative flux of solar radiation into layer - real(r8) :: rsfout ! relative flux of solar radiation out of layer - real(r8) :: phi_soil(bounds%begc:bounds%endc) ! solar radiation into top soil layer (W/m**2) - real(r8) :: ri ! richardson number - real(r8) :: fin(bounds%begc:bounds%endc) ! net heat flux into lake at ground interface (w/m**2) - real(r8) :: ocvts(bounds%begc:bounds%endc) ! (cwat*(t_lake[n ])*dz - real(r8) :: ncvts(bounds%begc:bounds%endc) ! (cwat*(t_lake[n+1])*dz - real(r8) :: ke ! eddy diffusion coefficient (m**2/s) - real(r8) :: zin ! depth at top of layer (m) - real(r8) :: zout ! depth at bottom of layer (m) - real(r8) :: drhodz ! d [rhow] /dz (kg/m**4) - real(r8) :: n2 ! brunt-vaisala frequency (/s**2) - real(r8) :: num ! used in calculating ri - real(r8) :: den ! used in calculating ri - real(r8) :: tav_froz(bounds%begc:bounds%endc) ! used in aver temp for convectively mixed layers (C) - real(r8) :: tav_unfr(bounds%begc:bounds%endc) ! " - real(r8) :: nav(bounds%begc:bounds%endc) ! used in aver temp for convectively mixed layers - real(r8) :: phidum ! temporary value of phi - real(r8) :: iceav(bounds%begc:bounds%endc) ! used in calc aver ice for convectively mixed layers - real(r8) :: qav(bounds%begc:bounds%endc) ! used in calc aver heat content for conv. mixed layers - integer :: jtop(bounds%begc:bounds%endc) ! top level for each column (no longer all 1) - real(r8) :: cv (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat capacity of soil/snow [J/(m2 K)] - real(r8) :: tk (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! thermal conductivity of soil/snow [W/(m K)] - ! (at interface below, except for j=0) - real(r8) :: cv_lake (bounds%begc:bounds%endc,1:nlevlak) ! heat capacity [J/(m2 K)] - real(r8) :: tk_lake (bounds%begc:bounds%endc,1:nlevlak) ! thermal conductivity at layer node [W/(m K)] - real(r8) :: cvx (bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! heat capacity for whole column [J/(m2 K)] - real(r8) :: tkix(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! thermal conductivity at layer interfaces - ! for whole column [W/(m K)] - real(r8) :: tx(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! temperature of whole column [K] - real(r8) :: tktopsoillay(bounds%begc:bounds%endc) ! thermal conductivity [W/(m K)] - real(r8) :: fnx(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! heat diffusion through the layer interface below [W/m2] - real(r8) :: phix(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! solar source term for whole column [W/m**2] - real(r8) :: zx(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! interface depth (+ below surface) for whole column [m] - real(r8) :: dzm ! used in computing tridiagonal matrix [m] - real(r8) :: dzp ! used in computing tridiagonal matrix [m] - integer :: jprime ! j - nlevlak - real(r8) :: factx(bounds%begc:bounds%endc,-nlevsno+1:nlevlak+nlevgrnd) ! coefficient used in computing tridiagonal matrix - real(r8) :: t_lake_bef(bounds%begc:bounds%endc,1:nlevlak) ! beginning lake temp for energy conservation check [K] - real(r8) :: t_soisno_bef(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! beginning soil temp for E cons. check [K] - real(r8) :: lhabs(bounds%begc:bounds%endc) ! total per-column latent heat abs. from phase change (J/m^2) - real(r8) :: esum1(bounds%begc:bounds%endc) ! temp for checking energy (J/m^2) - real(r8) :: esum2(bounds%begc:bounds%endc) ! "" - real(r8) :: zsum(bounds%begc:bounds%endc) ! temp for putting ice at the top during convection (m) - real(r8) :: wsum(bounds%begc:bounds%endc) ! temp for checking water (kg/m^2) - real(r8) :: wsum_end(bounds%begc:bounds%endc) ! temp for checking water (kg/m^2) - real(r8) :: sabg_col(bounds%begc:bounds%endc) ! absorbed ground solar for column (W/m^2) - real(r8) :: sabg_lyr_col(bounds%begc:bounds%endc,-nlevsno+1:1) ! absorbed ground solar in layer for column (W/m^2) - real(r8) :: sabg_nir ! NIR that is absorbed (W/m^2) - integer :: jconvect(bounds%begc:bounds%endc) ! Lowest level where convection occurs - integer :: jconvectbot(bounds%begc:bounds%endc) ! Hightest level where bottom-originating convection occurs - logical :: bottomconvect(bounds%begc:bounds%endc) ! Convection originating in bottom layer of lake triggers special convection loop - real(r8) :: fangkm ! (m^2/s) extra diffusivity based on Fang & Stefan 1996, citing Ellis, 1991 - - ! They think that mixing energy will generally get into lake to make - ! diffusivity exceed molecular; the energy is damped out according to the Brunt-Vaisala - ! frequency, yielding a maximum diffusivity for neutral stability of about 6 times molecular - ! For puddling - logical :: puddle(bounds%begc:bounds%endc) - real(r8) :: icesum(bounds%begc:bounds%endc) ! m - logical :: frzn(bounds%begc:bounds%endc) - !----------------------------------------------------------------------- - - associate( & - dz_lake => col%dz_lake , & ! Input: [real(r8) (:,:) ] layer thickness for lake (m) - z_lake => col%z_lake , & ! Input: [real(r8) (:,:) ] layer depth for lake (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness for snow & soil (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth for snow & soil (m) - snl => col%snl , & ! Input: [integer (:) ] negative of number of snow layers - lakedepth => col%lakedepth , & ! Input: [real(r8) (:) ] column lake depth (m) - - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - sabg_lyr => solarabs_inst%sabg_lyr_patch , & ! Input: [real(r8) (:,:) ] absorbed solar radiation (pft,lyr) [W/m2] - fsds_nir_d => solarabs_inst%fsds_nir_d_patch , & ! Input: [real(r8) (:) ] incident direct beam nir solar radiation (W/m**2) - fsds_nir_i => solarabs_inst%fsds_nir_i_patch , & ! Input: [real(r8) (:) ] incident diffuse nir solar radiation (W/m**2) - fsr_nir_d => solarabs_inst%fsr_nir_d_patch , & ! Input: [real(r8) (:) ] reflected direct beam nir solar radiation (W/m**2) - fsr_nir_i => solarabs_inst%fsr_nir_i_patch , & ! Input: [real(r8) (:) ] reflected diffuse nir solar radiation (W/m**2) - - etal => lakestate_inst%etal_col , & ! Input: [real(r8) (:) ] extinction coefficient from surface data (1/m) - ks => lakestate_inst%ks_col , & ! Input: [real(r8) (:) ] coefficient passed to LakeTemperature - ws => lakestate_inst%ws_col , & ! Input: [real(r8) (:) ] surface friction velocity (m/s) - lake_raw => lakestate_inst%lake_raw_col , & ! Input: [real(r8) (:) ] aerodynamic resistance for moisture (s/m) - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) [for snow & soil layers] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) [for snow & soil layers] - frac_iceold => waterstate_inst%frac_iceold_col , & ! Output: [real(r8) (:,:) ] fraction of ice relative to the tot water - - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil (or snow) temperature (Kelvin) - t_lake => temperature_inst%t_lake_col , & ! Output: [real(r8) (:,:) ] col lake temperature (Kelvin) - - beta => lakestate_inst%betaprime_col , & ! Output: [real(r8) (:) ] col effective beta: sabg_lyr(p,jtop) for snow layers, beta otherwise - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Output: [real(r8) (:,:) ] col mass fraction of lake layer that is frozen - lake_icefracsurf => lakestate_inst%lake_icefracsurf_col , & ! Output: [real(r8) (:,:) ] col mass fraction of surface lake layer that is frozen - lake_icethick => lakestate_inst%lake_icethick_col , & ! Output: [real(r8) (:) ] col ice thickness (m) (integrated if lakepuddling) - savedtke1 => lakestate_inst%savedtke1_col , & ! Output: [real(r8) (:) ] col top level eddy conductivity (W/mK) - lakeresist => lakestate_inst%lakeresist_col , & ! Output: [real(r8) (:) ] col (Needed for calc. of grnd_ch4_cond) (s/m) - - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_col , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] (only over lake points) - - eflx_soil_grnd => energyflux_inst%eflx_soil_grnd_patch , & ! Output: [real(r8) (:) ] heat flux into snow / lake (W/m**2) [+ = into soil] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_gnet => energyflux_inst%eflx_gnet_patch , & ! Output: [real(r8) ( :) ] net heat flux into ground (W/m**2) at the surface interface - errsoi => energyflux_inst%errsoi_col & ! Output: [real(r8) (:) ] soil/lake energy conservation error (W/m**2) - ) - - ! 1!) Initialization - ! Determine step size - - dtime = get_step_size() - - ! Initialize constants - cwat = cpliq*denh2o ! water heat capacity per unit volume - cice_eff = cpice*denh2o !use water density because layer depth is not adjusted - !for freezing - cfus = hfus*denh2o ! latent heat per unit volume - tkice_eff = tkice * denice/denh2o !effective conductivity since layer depth is constant - km = tkwat/cwat ! a constant (molecular diffusivity) - - ! Needed for Lahey compiler which doesn't seem to allow shortcircuit logic for undefined variables. - puddle(bounds%begc:bounds%endc) = .false. - frzn(bounds%begc:bounds%endc) = .false. - - ! Begin calculations - - do fc = 1, num_lakec - c = filter_lakec(fc) - - ! Initialize quantities needed below - - ocvts(c) = 0._r8 - ncvts(c) = 0._r8 - esum1(c) = 0._r8 - esum2(c) = 0._r8 - if (use_lch4) then - jconvect(c) = 0 - jconvectbot(c) = nlevlak+1 - lakeresist(c) = 0._r8 - end if - bottomconvect(bounds%begc:bounds%endc) = .false. - - end do - - ! Initialize set of previous time-step variables as in DriverInit, - ! which is currently not called over lakes. This has to be done - ! here because phase change will occur in this routine. - ! Ice fraction of snow at previous time step - - do j = -nlevsno+1,0 - do fc = 1, num_lakec - c = filter_lakec(fc) - if (j >= snl(c) + 1) then - frac_iceold(c,j) = h2osoi_ice(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j)) - end if - end do - end do - - ! Prepare for lake layer temperature calculations below - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - - ! fin(c) = betaprime * sabg(p) + forc_lwrad(c) - (eflx_lwrad_out(p) + & - ! eflx_sh_tot(p) + eflx_lh_tot(p)) - ! fin(c) now passed from LakeFluxes as eflx_gnet - fin(c) = eflx_gnet(p) - - ! Calculate the NIR fraction of absorbed solar. This will now be the "beta" parameter. - ! Total NIR absorbed: - sabg_nir = fsds_nir_d(p) + fsds_nir_i(p) - fsr_nir_d(p) - fsr_nir_i(p) - sabg_nir = min(sabg_nir, sabg(p)) - beta(c) = sabg_nir/max(1.e-5_r8,sabg(p)) - beta(c) = beta(c) + (1._r8-beta(c))*betavis - - end do - - ! 2!) Lake density - - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - rhow(c,j) = (1._r8 - lake_icefrac(c,j)) * & - 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,j)-tdmax))**1.68_r8 ) & - + lake_icefrac(c,j)*denice - ! Allow for ice fraction; assume constant ice density. - ! This is not the correct average-weighting but that's OK because the density will only - ! be used for convection for lakes with ice, and the ice fraction will dominate the - ! density differences between layers. - ! Using this average will make sure that surface ice is treated properly during - ! convective mixing. - end do - end do - - ! 3!) Diffusivity and implied thermal "conductivity" = diffusivity * cwat - do j = 1, nlevlak-1 - do fc = 1, num_lakec - c = filter_lakec(fc) - drhodz = (rhow(c,j+1)-rhow(c,j)) / (z_lake(c,j+1)-z_lake(c,j)) - n2 = grav / rhow(c,j) * drhodz - - ! Fixed sign error here: our z goes up going down into the lake, so no negative - ! sign is needed to make this positive unlike in Hostetler. --ZS - num = 40._r8 * n2 * (vkc*z_lake(c,j))**2._r8 - den = max( (ws(c)**2._r8) * exp(-2._r8*ks(c)*z_lake(c,j)), 1.e-10_r8 ) - ri = ( -1._r8 + sqrt( max(1._r8+num/den, 0._r8) ) ) / 20._r8 - - if (lakepuddling .and. j == 1) frzn(c) = .false. - - if (t_grnd(c) > tfrz .and. t_lake(c,1) > tfrz .and. snl(c) == 0 .and. & - (.not. lakepuddling .or. (lake_icefrac(c,j) == 0._r8 .and. .not. frzn(c))) ) then - ke = vkc*ws(c)*z_lake(c,j)/p0 * exp(-ks(c)*z_lake(c,j)) / (1._r8+37._r8*ri*ri) - kme(c,j) = km + ke - - if (.not. lake_no_ed) then - fangkm = 1.039e-8_r8 * max(n2,n2min)**(-0.43_r8) ! Fang & Stefan 1996, citing Ellis et al 1991 - kme(c,j) = kme(c,j) + fangkm - end if - if (lakedepth(c) >= depthcrit) then - kme(c,j) = kme(c,j) * mixfact - end if - - tk_lake(c,j) = kme(c,j)*cwat - else - kme(c,j) = km - if (.not. lake_no_ed) then - fangkm = 1.039e-8_r8 * max(n2,n2min)**(-0.43_r8) - kme(c,j) = kme(c,j) + fangkm - if (lakedepth(c) >= depthcrit) then - kme(c,j) = kme(c,j) * mixfact - end if - tk_lake(c,j) = kme(c,j)*cwat*tkice_eff / ( (1._r8-lake_icefrac(c,j))*tkice_eff & - + kme(c,j)*cwat*lake_icefrac(c,j) ) - else - tk_lake(c,j) = tkwat*tkice_eff / ( (1._r8-lake_icefrac(c,j))*tkice_eff & - + tkwat*lake_icefrac(c,j) ) - ! Assume the resistances add as for the calculation of conductivities at layer interfaces. - end if - if (lakepuddling) frzn(c) = .true. - ! Prevent eddy mixing beneath frozen layers even when surface is unfrozen. - end if - end do - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - - j = nlevlak - kme(c,nlevlak) = kme(c,nlevlak-1) - - if (t_grnd(c) > tfrz .and. t_lake(c,1) > tfrz .and. snl(c) == 0 .and. & - (.not. lakepuddling .or. (lake_icefrac(c,j) == 0._r8 .and. .not. frzn(c)) ) ) then - tk_lake(c,j) = tk_lake(c,j-1) - else - if (.not. lake_no_ed) then - tk_lake(c,j) = kme(c,j)*cwat*tkice_eff / ( (1._r8-lake_icefrac(c,j))*tkice_eff & - + kme(c,j)*cwat*lake_icefrac(c,j) ) - else - tk_lake(c,j) = tkwat*tkice_eff / ( (1._r8-lake_icefrac(c,j))*tkice_eff & - + tkwat*lake_icefrac(c,j) ) - end if - end if - - ! Use in surface flux calculation for next timestep. - savedtke1(c) = kme(c,1)*cwat ! Will only be used if unfrozen - ! set number of column levels for use by Tridiagonal below - jtop(c) = snl(c) + 1 - end do - - ! 4!) Heat source term - do j = 1, nlevlak - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - - ! If no eta from surface data, - ! Set eta, the extinction coefficient, according to L Hakanson, Aquatic Sciences, 1995 - ! (regression of Secchi Depth with lake depth for small glacial basin lakes), and the - ! Poole & Atkins expression for extinction coeffient of 1.7 / Secchi Depth (m). - if (etal(c) > 0._r8) then ! use eta from surface data - eta = etal(c) - else - eta = 1.1925_r8*max(lakedepth(c),1._r8)**(-0.424_r8) - end if - - zin = z_lake(c,j) - 0.5_r8*dz_lake(c,j) - zout = z_lake(c,j) + 0.5_r8*dz_lake(c,j) - rsfin = exp( -eta*max( zin-za_lake,0._r8 ) ) - rsfout = exp( -eta*max( zout-za_lake,0._r8 ) ) - - ! Let rsfout for bottom layer go into soil. - ! This looks like it should be robust even for pathological cases, - ! like lakes thinner than za_lake. - - if (t_grnd(c) > tfrz .and. t_lake(c,1) > tfrz .and. snl(c) == 0) then - phidum = (rsfin-rsfout) * sabg(p) * (1._r8-beta(c)) - if (j == nlevlak) then - phi_soil(c) = rsfout * sabg(p) * (1._r8-beta(c)) - end if - else if (j == 1 .and. snl(c) == 0) then !if frozen but no snow layers - phidum = sabg(p) * (1._r8-beta(c)) - ! This should be improved upon; Mironov 2002 suggests that SW can penetrate thin ice and may - ! cause spring convection. - else if (j == 1) then - phidum = sabg_lyr(p,j) - !some radiation absorbed in snow layers, the rest in the top layer of lake - !radiation absorbed in snow layers will be applied below - else - phidum = 0._r8 - if (j == nlevlak) phi_soil(c) = 0._r8 - end if - phi(c,j) = phidum - - end do - end do - - ! 5!) Set thermal properties and check initial energy content. - - ! For lake - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - cv_lake(c,j) = dz_lake(c,j) * (cwat*(1._r8-lake_icefrac(c,j)) + cice_eff*lake_icefrac(c,j)) - end do - end do - - ! For snow / soil - call SoilThermProp_Lake(bounds, num_lakec, filter_lakec, & - tk(bounds%begc:bounds%endc, :), & - cv(bounds%begc:bounds%endc, :), & - tktopsoillay(bounds%begc:bounds%endc), & - soilstate_inst, waterstate_inst, temperature_inst) - - ! Sum cv*t_lake for energy check - ! Include latent heat term, and use tfrz as reference temperature - ! to prevent abrupt change in heat content due to changing heat capacity with phase change. - - ! This will need to be over all soil / lake / snow layers. Lake is below. - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - ocvts(c) = ocvts(c) + cv_lake(c,j)*(t_lake(c,j)-tfrz) & - + cfus*dz_lake(c,j)*(1._r8-lake_icefrac(c,j)) - t_lake_bef(c,j) = t_lake(c,j) - end do - end do - - ! Now do for soil / snow layers - do j = -nlevsno + 1, nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j >= jtop(c)) then - ocvts(c) = ocvts(c) + cv(c,j)*(t_soisno(c,j)-tfrz) & - + hfus*h2osoi_liq(c,j) - if (j == 1 .and. h2osno(c) > 0._r8 .and. j == jtop(c)) then - ocvts(c) = ocvts(c) - h2osno(c)*hfus - end if - t_soisno_bef(c,j) = t_soisno(c,j) - end if - end do - end do - - !!!!!!!!!!!!!!!!!!! - ! 6!) Set up vector r and vectors a, b, c1 that define tridiagonal matrix - - ! Heat capacity and resistance of snow without snow layers (<1cm) is ignored during diffusion, - ! but its capacity to absorb latent heat may be used during phase change. - - ! Transfer sabg and sabg_lyr to column level - do j = -nlevsno+1,1 - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - - if (j >= jtop(c)) then - if (j == jtop(c)) sabg_col(c) = sabg(p) - sabg_lyr_col(c,j) = sabg_lyr(p,j) - end if - end do - end do - - ! Set up interface depths, zx, heat capacities, cvx, solar source terms, phix, and temperatures, tx. - do j = -nlevsno+1, nlevlak+nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - - jprime = j - nlevlak - - if (j >= jtop(c)) then - if (j < 1) then !snow layer - zx(c,j) = z(c,j) - cvx(c,j) = cv(c,j) - if (j == jtop(c)) then ! no absorption because it has already been assigned to the surface - ! interface - phix(c,j) = 0._r8 - else - phix(c,j) = sabg_lyr_col(c,j) !New for SNICAR - end if - tx(c,j) = t_soisno(c,j) - else if (j <= nlevlak) then !lake layer - zx(c,j) = z_lake(c,j) - cvx(c,j) = cv_lake(c,j) - phix(c,j) = phi(c,j) - tx(c,j) = t_lake(c,j) - else !soil layer - zx(c,j) = zx(c,nlevlak) + dz_lake(c,nlevlak)/2._r8 + z(c,jprime) - cvx(c,j) = cv(c,jprime) - if (j == nlevlak + 1) then !top soil layer - phix(c,j) = phi_soil(c) - else !middle or bottom soil layer - phix(c,j) = 0._r8 - end if - tx(c,j) = t_soisno(c,jprime) - end if - end if - - end do - end do - - ! Determine interface thermal conductivities, tkix - - do j = -nlevsno+1, nlevlak+nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - - jprime = j - nlevlak - - if (j >= jtop(c)) then - if (j < 0) then !non-bottom snow layer - tkix(c,j) = tk(c,j) - else if (j == 0) then !bottom snow layer - dzp = zx(c,j+1) - zx(c,j) - tkix(c,j) = tk_lake(c,1)*tk(c,j)*dzp / & - (tk(c,j)*z_lake(c,1) + tk_lake(c,1)*(-z(c,j)) ) - ! tk(c,0) is the conductivity at the middle of that layer, as defined in SoilThermProp_Lake - else if (j < nlevlak) then !non-bottom lake layer - tkix(c,j) = ( tk_lake(c,j)*tk_lake(c,j+1) * (dz_lake(c,j+1)+dz_lake(c,j)) ) & - / ( tk_lake(c,j)*dz_lake(c,j+1) + tk_lake(c,j+1)*dz_lake(c,j) ) - else if (j == nlevlak) then !bottom lake layer - dzp = zx(c,j+1) - zx(c,j) - tkix(c,j) = (tktopsoillay(c)*tk_lake(c,j)*dzp / & - (tktopsoillay(c)*dz_lake(c,j)/2._r8 + tk_lake(c,j)*z(c,1) ) ) - ! tktopsoillay is the conductivity at the middle of that layer, as defined in SoilThermProp_Lake - else !soil layer - tkix(c,j) = tk(c,jprime) - end if - end if - - end do - end do - - - ! Determine heat diffusion through the layer interface and factor used in computing - ! tridiagonal matrix and set up vector r and vectors a, b, c1 that define tridiagonal - ! matrix and solve system - - do j = -nlevsno+1, nlevlak+nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - if (j >= jtop(c)) then - if (j < nlevlak+nlevgrnd) then !top or interior layer - factx(c,j) = dtime/cvx(c,j) - fnx(c,j) = tkix(c,j)*(tx(c,j+1)-tx(c,j))/(zx(c,j+1)-zx(c,j)) - else !bottom soil layer - factx(c,j) = dtime/cvx(c,j) - fnx(c,j) = 0._r8 !not used - end if - end if - enddo - end do - - do j = -nlevsno+1,nlevlak+nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - if (j >= jtop(c)) then - if (j == jtop(c)) then !top layer - dzp = zx(c,j+1)-zx(c,j) - a(c,j) = 0._r8 - b(c,j) = 1+(1._r8-cnfac)*factx(c,j)*tkix(c,j)/dzp - c1(c,j) = -(1._r8-cnfac)*factx(c,j)*tkix(c,j)/dzp - r(c,j) = tx(c,j) + factx(c,j)*( fin(c) + phix(c,j) + cnfac*fnx(c,j) ) - else if (j < nlevlak+nlevgrnd) then !middle layer - dzm = (zx(c,j)-zx(c,j-1)) - dzp = (zx(c,j+1)-zx(c,j)) - a(c,j) = - (1._r8-cnfac)*factx(c,j)* tkix(c,j-1)/dzm - b(c,j) = 1._r8+ (1._r8-cnfac)*factx(c,j)*(tkix(c,j)/dzp + tkix(c,j-1)/dzm) - c1(c,j) = - (1._r8-cnfac)*factx(c,j)* tkix(c,j)/dzp - r(c,j) = tx(c,j) + cnfac*factx(c,j)*( fnx(c,j) - fnx(c,j-1) ) + factx(c,j)*phix(c,j) - else !bottom soil layer - dzm = (zx(c,j)-zx(c,j-1)) - a(c,j) = - (1._r8-cnfac)*factx(c,j)*tkix(c,j-1)/dzm - b(c,j) = 1._r8+ (1._r8-cnfac)*factx(c,j)*tkix(c,j-1)/dzm - c1(c,j) = 0._r8 - r(c,j) = tx(c,j) - cnfac*factx(c,j)*fnx(c,j-1) - end if - end if - enddo - end do - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - - ! 7!) Solve for tdsolution - - call Tridiagonal(bounds, -nlevsno + 1, nlevlak + nlevgrnd, & - jtop(bounds%begc:bounds%endc), & - num_lakec, filter_lakec, & - a(bounds%begc:bounds%endc, :), & - b(bounds%begc:bounds%endc, :), & - c1(bounds%begc:bounds%endc, :), & - r(bounds%begc:bounds%endc, :), & - tx(bounds%begc:bounds%endc, :)) - - ! Set t_soisno and t_lake - do j = -nlevsno+1, nlevlak + nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - - jprime = j - nlevlak - - ! Don't do anything with invalid snow layers. - if (j >= jtop(c)) then - if (j < 1) then !snow layer - t_soisno(c,j) = tx(c,j) - else if (j <= nlevlak) then !lake layer - t_lake(c,j) = tx(c,j) - else !soil layer - t_soisno(c,jprime) = tx(c,j) - end if - end if - end do - end do - - !!!!!!!!!!!!!!!!!!!!!!! - - ! 8!) Sum energy content and total energy into lake for energy check. Any errors will be from the - ! Tridiagonal solution. - ! This section was for debugging only and has been removed. See original "ch4" branch code. - - !!!!!!!!!!!!!!!!!!!!!!! - - ! 9!) Phase change - call PhaseChange_Lake(bounds, num_lakec, filter_lakec, & - cv(bounds%begc:bounds%endc, :), & - cv_lake(bounds%begc:bounds%endc, :), & - lhabs(bounds%begc:bounds%endc), & - waterstate_inst, waterflux_inst, temperature_inst, & - energyflux_inst, lakestate_inst) - - !!!!!!!!!!!!!!!!!!!!!!! - - ! 9.5!) Second energy check and water check. Now check energy balance before and after phase - ! change, considering the possibility of changed heat capacity during phase change, by - ! using initial heat capacity in the first step, final heat capacity in the second step, - ! and differences from tfrz only to avoid enthalpy correction for (cpliq-cpice)*melt*tfrz. - ! Also check soil water sum. - ! This section was for debugging only and has been removed. See original "ch4" branch code. - - !!!!!!!!!!!!!!!!!!!!!!!!!! - ! 10!) Convective mixing: make sure fracice*dz is conserved, heat content c*dz*T is conserved, and - ! all ice ends up at the top. Done over all lakes even if frozen. - ! Either an unstable density profile or ice in a layer below an incompletely frozen layer will trigger. - - !Recalculate density - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - rhow(c,j) = (1._r8 - lake_icefrac(c,j)) * & - 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,j)-tdmax))**1.68_r8 ) & - + lake_icefrac(c,j)*denice - end do - end do - - if (lakepuddling) then - ! For sensitivity tests - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j == 1) then - icesum(c) = 0._r8 - puddle(c) = .false. - end if - - icesum(c) = icesum(c) + lake_icefrac(c,j)*dz(c,j) - - if (j == nlevlak) then - if (icesum(c) >= pudz) puddle(c) = .true. - end if - end do - end do - end if - - ! ZMS: The algorithm here, from CLM2-4 and presumably Hostetler, starts at the top and proceeds down; - ! each time it finds an unstable density profile the lake is mixed from this point to the top fully. - ! Occasionally in deep temperate lakes, the unstable profile can originate at the bottom because of small amounts of - ! heat coming from the sediments. To prevent an unrealistic complete overturning, convection starting in the bottom - ! layer is treated separately, mixing from the bottom up only one level at a time until - ! a stable density profile is attained, rather than mixing all the way to the top immediately. - - ! First examine top nlevlak-1 layers. - do j = 1, nlevlak-2 - do fc = 1, num_lakec - c = filter_lakec(fc) - qav(c) = 0._r8 - nav(c) = 0._r8 - iceav(c) = 0._r8 - end do - - do i = 1, j+1 - do fc = 1, num_lakec - c = filter_lakec(fc) - if ( (.not. lakepuddling .or. .not. puddle(c) ) .and. (rhow(c,j) > rhow(c,j+1) .or. & - (lake_icefrac(c,j) < 1._r8 .and. lake_icefrac(c,j+1) > 0._r8) ) ) then - qav(c) = qav(c) + dz_lake(c,i)*(t_lake(c,i)-tfrz) * & - ((1._r8 - lake_icefrac(c,i))*cwat + lake_icefrac(c,i)*cice_eff) - !tav(c) = tav(c) + t_lake(c,i)*dz_lake(c,i) - iceav(c) = iceav(c) + lake_icefrac(c,i)*dz_lake(c,i) - nav(c) = nav(c) + dz_lake(c,i) - if (use_lch4) then - jconvect(c) = j+1 - end if - end if - end do - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - - if ( (.not. lakepuddling .or. .not. puddle(c) ) .and. (rhow(c,j) > rhow(c,j+1) .or. & - (lake_icefrac(c,j) < 1._r8 .and. lake_icefrac(c,j+1) > 0._r8) ) ) then - qav(c) = qav(c)/nav(c) - iceav(c) = iceav(c)/nav(c) - !If the average temperature is above freezing, put the extra energy into the water. - !If it is below freezing, take it away from the ice. - if (qav(c) > 0._r8) then - tav_froz(c) = 0._r8 !Celsius - tav_unfr(c) = qav(c) / ((1._r8 - iceav(c))*cwat) - else if (qav(c) < 0._r8) then - tav_froz(c) = qav(c) / (iceav(c)*cice_eff) - tav_unfr(c) = 0._r8 !Celsius - else - tav_froz(c) = 0._r8 - tav_unfr(c) = 0._r8 - end if - end if - end do - - do i = 1, j+1 - do fc = 1, num_lakec - c = filter_lakec(fc) - if (nav(c) > 0._r8) then - - !Put all the ice at the top.! - !If the average temperature is above freezing, put the extra energy into the water. - !If it is below freezing, take it away from the ice. - !For the layer with both ice & water, be careful to use the average temperature - !that preserves the correct total heat content given what the heat capacity of that - !layer will actually be. - if (i == 1) zsum(c) = 0._r8 - if ((zsum(c)+dz_lake(c,i))/nav(c) <= iceav(c)) then - lake_icefrac(c,i) = 1._r8 - t_lake(c,i) = tav_froz(c) + tfrz - else if (zsum(c)/nav(c) < iceav(c)) then - lake_icefrac(c,i) = (iceav(c)*nav(c) - zsum(c)) / dz_lake(c,i) - ! Find average value that preserves correct heat content. - t_lake(c,i) = ( lake_icefrac(c,i)*tav_froz(c)*cice_eff & - + (1._r8 - lake_icefrac(c,i))*tav_unfr(c)*cwat ) & - / ( lake_icefrac(c,i)*cice_eff + (1-lake_icefrac(c,i))*cwat ) + tfrz - else - lake_icefrac(c,i) = 0._r8 - t_lake(c,i) = tav_unfr(c) + tfrz - end if - zsum(c) = zsum(c) + dz_lake(c,i) - - rhow(c,i) = (1._r8 - lake_icefrac(c,i)) * & - 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,i)-tdmax))**1.68_r8 ) & - + lake_icefrac(c,i)*denice - end if - end do - end do - end do - - ! Now check bottom layer - j = nlevlak-1 - do fc = 1, num_lakec - c = filter_lakec(fc) - - if ( (.not. lakepuddling .or. .not. puddle(c) ) .and. (rhow(c,j) > rhow(c,j+1) .or. & - (lake_icefrac(c,j) < 1._r8 .and. lake_icefrac(c,j+1) > 0._r8) ) ) then - ! convection originating in bottom layer. Could be coming from sediments-- be careful not to - ! unnecessarily mix all the way to the top of the lake - bottomconvect(c) = .true. - end if - end do - - ! Start mixing from bottom up. Only mix as high as the unstable density profile persists. - do j = nlevlak-1, 1, -1 - do fc = 1, num_lakec - c = filter_lakec(fc) - qav(c) = 0._r8 - nav(c) = 0._r8 - iceav(c) = 0._r8 - end do - - do i = j, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - if ( bottomconvect(c) .and. & - (.not. lakepuddling .or. .not. puddle(c) ) .and. (rhow(c,j) > rhow(c,j+1) .or. & - (lake_icefrac(c,j) < 1._r8 .and. lake_icefrac(c,j+1) > 0._r8) ) ) then - qav(c) = qav(c) + dz_lake(c,i)*(t_lake(c,i)-tfrz) * & - ((1._r8 - lake_icefrac(c,i))*cwat + lake_icefrac(c,i)*cice_eff) - !tav(c) = tav(c) + t_lake(c,i)*dz_lake(c,i) - iceav(c) = iceav(c) + lake_icefrac(c,i)*dz_lake(c,i) - nav(c) = nav(c) + dz_lake(c,i) - if (use_lch4) then - jconvectbot(c) = j - end if - end if - end do - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - - if ( bottomconvect(c) .and. & - (.not. lakepuddling .or. .not. puddle(c) ) .and. (rhow(c,j) > rhow(c,j+1) .or. & - (lake_icefrac(c,j) < 1._r8 .and. lake_icefrac(c,j+1) > 0._r8) ) ) then - qav(c) = qav(c)/nav(c) - iceav(c) = iceav(c)/nav(c) - !If the average temperature is above freezing, put the extra energy into the water. - !If it is below freezing, take it away from the ice. - if (qav(c) > 0._r8) then - tav_froz(c) = 0._r8 !Celsius - tav_unfr(c) = qav(c) / ((1._r8 - iceav(c))*cwat) - else if (qav(c) < 0._r8) then - tav_froz(c) = qav(c) / (iceav(c)*cice_eff) - tav_unfr(c) = 0._r8 !Celsius - else - tav_froz(c) = 0._r8 - tav_unfr(c) = 0._r8 - end if - end if - end do - - do i = j, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - if (bottomconvect(c) .and. nav(c) > 0._r8) then - - !Put all the ice at the top.! - !If the average temperature is above freezing, put the extra energy into the water. - !If it is below freezing, take it away from the ice. - !For the layer with both ice & water, be careful to use the average temperature - !that preserves the correct total heat content given what the heat capacity of that - !layer will actually be. - - if (i == j) zsum(c) = 0._r8 - if ((zsum(c)+dz_lake(c,i))/nav(c) <= iceav(c)) then - lake_icefrac(c,i) = 1._r8 - t_lake(c,i) = tav_froz(c) + tfrz - else if (zsum(c)/nav(c) < iceav(c)) then - lake_icefrac(c,i) = (iceav(c)*nav(c) - zsum(c)) / dz_lake(c,i) - ! Find average value that preserves correct heat content. - t_lake(c,i) = ( lake_icefrac(c,i)*tav_froz(c)*cice_eff & - + (1._r8 - lake_icefrac(c,i))*tav_unfr(c)*cwat ) & - / ( lake_icefrac(c,i)*cice_eff + (1-lake_icefrac(c,i))*cwat ) + tfrz - else - lake_icefrac(c,i) = 0._r8 - t_lake(c,i) = tav_unfr(c) + tfrz - end if - - zsum(c) = zsum(c) + dz_lake(c,i) - - rhow(c,i) = (1._r8 - lake_icefrac(c,i)) * & - 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,i)-tdmax))**1.68_r8 ) & - + lake_icefrac(c,i)*denice - end if - end do - end do - end do - - ! Calculate lakeresist and grnd_ch4_cond for CH4 Module - ! The CH4 will diffuse directly from the top soil layer to the atmosphere, so - ! the whole lake resistance is included. - - if (use_lch4) then - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j > jconvect(c) .and. j < jconvectbot(c)) then ! Assume resistance is zero for levels that convect - lakeresist(c) = lakeresist(c) + dz(c,j)/kme(c,j) ! dz/eddy or molecular diffusivity - end if - - if (j == nlevlak) then ! Calculate grnd_ch4_cond - grnd_ch4_cond(c) = 1._r8 / (lakeresist(c) + lake_raw(c)) - - ! Lake water R + aerodynamic R - ! Snow will be considered in methane routine - ! No methane conduction through frozen lake - if (lake_icefrac(c,1) > 0.1_r8) grnd_ch4_cond(c) = 0._r8 - end if - - end do - end do - end if - - !!!!!!!!!!!!!!!!!!!!!!! - ! 11!) Re-evaluate thermal properties and sum energy content. - ! For lake - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - cv_lake(c,j) = dz_lake(c,j) * (cwat*(1._r8-lake_icefrac(c,j)) + cice_eff*lake_icefrac(c,j)) - end do - end do - - ! For snow / soil - call SoilThermProp_Lake(bounds, num_lakec, filter_lakec, & - tk(bounds%begc:bounds%endc, :), & - cv(bounds%begc:bounds%endc, :), & - tktopsoillay(bounds%begc:bounds%endc), & - soilstate_inst, waterstate_inst, temperature_inst) - - - ! Do as above to sum energy content - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - ncvts(c) = ncvts(c) + cv_lake(c,j)*(t_lake(c,j)-tfrz) & - + cfus*dz_lake(c,j)*(1._r8-lake_icefrac(c,j)) - fin(c) = fin(c) + phi(c,j) - end do - end do - - do j = -nlevsno + 1, nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j >= jtop(c)) then - ncvts(c) = ncvts(c) + cv(c,j)*(t_soisno(c,j)-tfrz) & - + hfus*h2osoi_liq(c,j) - if (j < 1) fin(c) = fin(c) + phix(c,j) !For SNICAR - if (j == 1 .and. h2osno(c) > 0._r8 .and. j == jtop(c)) then - ncvts(c) = ncvts(c) - h2osno(c)*hfus - end if - end if - if (j == 1) fin(c) = fin(c) + phi_soil(c) - end do - end do - - - ! Check energy conservation. - do fp = 1, num_lakep - p = filter_lakep(fp) - c = patch%column(p) - errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c) - if (abs(errsoi(c)) < 0.10_r8) then ! else send to Balance Check and abort - eflx_sh_tot(p) = eflx_sh_tot(p) - errsoi(c) - eflx_sh_grnd(p) = eflx_sh_grnd(p) - errsoi(c) - eflx_soil_grnd(p) = eflx_soil_grnd(p) + errsoi(c) - eflx_gnet(p) = eflx_gnet(p) + errsoi(c) - if (abs(errsoi(c)) > 1.e-3_r8) then - write(iulog,*)'errsoi incorporated into sensible heat in LakeTemperature: c, (W/m^2):', c, errsoi(c) - end if - errsoi(c) = 0._r8 - end if - - end do - ! This loop assumes only one point per column. - - ! lake_icethickness and lake_icefraction at surface diagnostic. - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - if (j == 1) lake_icethick(c) = 0._r8 - if (j == 1) lake_icefracsurf(c) = lake_icefrac(c,1) - - lake_icethick(c) = lake_icethick(c) + lake_icefrac(c,j)*dz_lake(c,j)*denh2o/denice - ! Convert from nominal to physical thickness - end do - end do - - end associate - end subroutine LakeTemperature - - !----------------------------------------------------------------------- - subroutine SoilThermProp_Lake (bounds, num_lakec, filter_lakec, tk, cv, tktopsoillay, & - soilstate_inst, waterstate_inst, temperature_inst) - ! - ! !DESCRIPTION: - ! Calculation of thermal conductivities and heat capacities of - ! snow/soil layers - ! (1) The volumetric heat capacity is calculated as a linear combination - ! in terms of the volumetric fraction of the constituent phases. - ! - ! (2) The thermal conductivity of soil is computed from the algorithm of - ! Johansen (as reported by Farouki 1981), and of snow is from the - ! formulation used in SNTHERM (Jordan 1991). - ! The thermal conductivities at the interfaces between two neighboring - ! layers (j, j+1) are derived from an assumption that the flux across - ! the interface is equal to that from the node j to the interface and the - ! flux from the interface to the node j+1. - ! - ! For lakes, the proper soil layers (not snow) should always be saturated. - ! - ! !USES: - use clm_varcon , only : denh2o, denice, tfrz, tkwat, tkice, tkair - use clm_varcon , only : cpice, cpliq, thk_bedrock, csol_bedrock - use clm_varpar , only : nlevsno, nlevsoi, nlevgrnd - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - real(r8) , intent(out) :: cv( bounds%begc: , -nlevsno+1: ) ! heat capacity [J/(m2 K)] [col, lev] - real(r8) , intent(out) :: tk( bounds%begc: , -nlevsno+1: ) ! thermal conductivity [W/(m K)] [col, lev] - real(r8) , intent(out) :: tktopsoillay( bounds%begc: ) ! thermal conductivity [W/(m K)] [col] - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - - ! - ! !LOCAL VARIABLES: - integer :: l,c,j ! indices - integer :: fc ! lake filtered column indices - real(r8) :: bw ! partial density of water (ice + liquid) - real(r8) :: dksat ! thermal conductivity for saturated soil (j/(k s m)) - real(r8) :: dke ! kersten number - real(r8) :: fl ! fraction of liquid or unfrozen water to total water - real(r8) :: satw ! relative total water content of soil. - real(r8) :: thk(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! thermal conductivity of layer - real(r8) :: xicevol ! (virtual excess ice volume per nominal soil volume) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(cv) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tktopsoillay) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl , & ! Input: [integer (:)] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:)] layer thickness (m) - zi => col%zi , & ! Input: [real(r8) (:,:)] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:)] layer depth (m) - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:)] volumetric soil water at saturation (porosity) - tksatu => soilstate_inst%tksatu_col , & ! Input: [real(r8) (:,:)] thermal conductivity, saturated soil [W/m-K] - tkmg => soilstate_inst%tkmg_col , & ! Input: [real(r8) (:,:)] thermal conductivity, soil minerals [W/m-K] - tkdry => soilstate_inst%tkdry_col , & ! Input: [real(r8) (:,:)] thermal conductivity, dry soil (W/m/Kelvin) - csol => soilstate_inst%csol_col , & ! Input: [real(r8) (:,:)] heat capacity, soil solids (J/m**3/Kelvin) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:)] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:)] ice lens (kg/m2) - - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (:,:)] soil temperature (Kelvin) - ) - - ! Thermal conductivity of soil from Farouki (1981) - - do j = -nlevsno+1,nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - - ! Only examine levels from 1->nlevsoi - if (j >= 1 .and. j <= nlevsoi) then - ! l = clandunit(c) - ! if (ityplun(l) /= istwet .AND. ityplun(l) /= istice) then - ! This could be altered later for allowing this to be over glaciers. - - ! Soil should be saturated in LakeHydrology - satw = 1._r8 - ! ZMS: Note the following needs to be updated for the corrections to be merged into SoilTemperature. - ! They are especially important here because of no supercooled water. - fl = h2osoi_liq(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j)) - if (t_soisno(c,j) >= tfrz) then ! Unfrozen soil - dke = max(0._r8, log10(satw) + 1.0_r8) - dksat = tksatu(c,j) - else ! Frozen soil - dke = satw - dksat = tkmg(c,j)*0.249_r8**(fl*watsat(c,j))*2.29_r8**watsat(c,j) - endif - thk(c,j) = dke*dksat + (1._r8-dke)*tkdry(c,j) - satw = (h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice)/(dz(c,j)*watsat(c,j)) - ! Hydrology routine won't let the excess be liquid. - if (satw > 1._r8) then - xicevol = (satw-1._r8)*watsat(c,j) - thk(c,j) = (thk(c,j) + xicevol*tkice)/(1._r8 + xicevol)/(1._r8 + xicevol) - ! Use simple mean because excess ice is likely to be in chunks, thus conductivities add - ! rather than the usual addition of resistances. - ! Conductivity is reduced by the extra virtual volume fraction, as dz is not changing. - end if - ! See discussion in LakeHydrology. This is the simplest way to treat thermal cycling near - ! freezing even if not modeling excess ice, to assume up to 10% excess ice over watsat after refreezing. - ! Assume some ground heaving rather than drainage of the water while it's freezing. - ! This allows for energy conservation and for the final allowed ice volume to be independent - ! of the timestep or precise freezing trajectory. - ! Does real sediment under lakes heave or drain? Could revisit later. - elseif (j > nlevsoi) then - thk(c,j) = thk_bedrock - endif - - ! Thermal conductivity of snow, which from Jordan (1991) pp. 18 - ! Only examine levels from snl(c)+1 -> 0 where snl(c) < 1 - if (snl(c)+1 < 1 .AND. (j >= snl(c)+1) .AND. (j <= 0)) then - bw = (h2osoi_ice(c,j)+h2osoi_liq(c,j))/dz(c,j) - thk(c,j) = tkair + (7.75e-5_r8 *bw + 1.105e-6_r8*bw*bw)*(tkice-tkair) - end if - - end do - end do - - ! Thermal conductivity at the layer interface - - ! Have to correct for the fact that bottom snow layer and top soil layer border lake. - ! For the first case, the snow layer conductivity for the middle of the layer will be returned. - ! Because the interfaces are below the soil layers, the conductivity for the top soil layer - ! will have to be returned separately. - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - if (j >= snl(c)+1 .AND. j <= nlevgrnd-1 .AND. j /= 0) then - tk(c,j) = thk(c,j)*thk(c,j+1)*(z(c,j+1)-z(c,j)) & - /(thk(c,j)*(z(c,j+1)-zi(c,j))+thk(c,j+1)*(zi(c,j)-z(c,j))) - else if (j == 0 .and. j >= snl(c)+1) then - tk(c,j) = thk(c,j) - else if (j == nlevgrnd) then - tk(c,j) = 0._r8 - end if - ! For top soil layer. - if (j == 1) tktopsoillay(c) = thk(c,j) - end do - end do - - ! Soil heat capacity, from de Vires (1963) - - do j = 1, nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - cv(c,j) = csol(c,j)*(1-watsat(c,j))*dz(c,j) + & - (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - ! if (j == 1) then - ! if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8) then - ! cv(c,j) = cv(c,j) + cpice*h2osno(c) - ! end if - ! end if - ! Won't worry about heat capacity for thin snow on lake with no snow layers. - ! Its temperature will be assigned based on air temperature anyway if a new node is formed. - if (j > nlevsoi) then - cv(c,j) = csol_bedrock*dz(c,j) - endif - enddo - end do - - ! Snow heat capacity - - do j = -nlevsno+1,0 - do fc = 1,num_lakec - c = filter_lakec(fc) - if (snl(c)+1 < 1 .and. j >= snl(c)+1) then - cv(c,j) = cpliq*h2osoi_liq(c,j) + cpice*h2osoi_ice(c,j) - end if - end do - end do - - end associate - - end subroutine SoilThermProp_Lake - - !----------------------------------------------------------------------- - subroutine PhaseChange_Lake (bounds, num_lakec, filter_lakec, cv, cv_lake, lhabs, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst, lakestate_inst) - ! - ! !DESCRIPTION: - ! Calculation of the phase change within snow, soil, & lake layers: - ! (1) Check the conditions for which the phase change may take place, - ! i.e., the layer temperature is great than the freezing point - ! and the ice mass is not equal to zero (i.e. melting), - ! or the layer temperature is less than the freezing point - ! and the liquid water mass is greater than zero (i.e. melting). No supercooling. - ! (2) Assess the amount of phase change from the energy excess (or deficit) - ! after setting the layer temperature to freezing point, depending on - ! how much water or ice is available. - ! (3) Re-adjust the ice and liquid mass, and the layer temperature: either to - ! the freezing point if enough water or ice is available to fully compensate, - ! or to a remaining temperature. - ! The specific heats are adjusted during phase change for precise energy conservation. - ! Errors will be trapped at the end of LakeTemperature. - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varcon , only : tfrz, hfus, denh2o, denice, cpliq, cpice - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of lake columns - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - real(r8) , intent(inout) :: cv( bounds%begc: , -nlevsno+1: ) ! heat capacity [J/(m2 K)] [col, lev] - real(r8) , intent(inout) :: cv_lake( bounds%begc: , 1: ) ! heat capacity [J/(m2 K)] [col, levlak] - real(r8) , intent(out) :: lhabs( bounds%begc: ) ! total per-column latent heat abs. (J/m^2) [col] - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(lakestate_type) , intent(inout) :: lakestate_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,g ! do loop index - integer :: fc ! lake filtered column indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: heatavail ! available energy for melting or freezing (J/m^2) - real(r8) :: heatrem ! energy residual or loss after melting or freezing - real(r8) :: melt ! actual melting (+) or freezing (-) [kg/m2] - !real(r8), parameter :: smallnumber = 1.e-7_r8 ! to prevent tiny residuals from rounding error - real(r8), parameter :: smallnumber = 1.e-12_r8 ! The above actually was enough to cause a 0.1 W/m^2 energy imbalance - ! when the bottom lake layer started freezing in a 50m Arctic lake - logical :: dophasechangeflag - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(cv) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cv_lake) == (/bounds%endc, nlevlak/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lhabs) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - dz_lake => col%dz_lake , & ! Input: [real(r8) (:,:) ] lake layer thickness (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - h2osno => waterstate_inst%h2osno_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Input: [real(r8) (:,:) ] mass fraction of lake layer that is frozen - - qflx_snofrz_lyr => waterflux_inst%qflx_snofrz_lyr_col , & ! Output: [real(r8) (:,:) ] snow freezing rate (positive definite) (col,lyr) [kg m-2 s-1] - qflx_snomelt_lyr => waterflux_inst%qflx_snomelt_lyr_col, & ! Output: [real(r8) (:) ] snow melt in each layer (mm H2O /s) - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Output: [real(r8) (:) ] drainage from snow column - qflx_snomelt => waterflux_inst%qflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt (mm H2O /s) - qflx_snofrz => waterflux_inst%qflx_snofrz_col , & ! Output: [real(r8) (:) ] column-integrated snow freezing rate (kg m-2 s-1) [+] - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - t_lake => temperature_inst%t_lake_col , & ! Input: [real(r8) (:,:) ] lake temperature (Kelvin) - imelt => temperature_inst%imelt_col , & ! Output: [integer (:,:) ] flag for melting (=1), freezing (=2), Not=0 (new) - - eflx_snomelt => energyflux_inst%eflx_snomelt_col & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) - ) - - ! Get step size - - dtime = get_step_size() - - ! Initialization - - do fc = 1,num_lakec - c = filter_lakec(fc) - - qflx_snomelt(c) = 0._r8 - qflx_snofrz(c) = 0._r8 - eflx_snomelt(c) = 0._r8 - lhabs(c) = 0._r8 - qflx_snow_drain(c) = 0._r8 - end do - - do j = -nlevsno+1,0 - do fc = 1,num_lakec - c = filter_lakec(fc) - - ! Do for all possible snow layers in case snl changes over timestep. - qflx_snomelt_lyr(c,j) = 0._r8 - qflx_snofrz_lyr(c,j) = 0._r8 - imelt(c,j) = 0 - end do - end do - - ! Check for case of snow without snow layers and top lake layer temp above freezing. - - do fc = 1,num_lakec - c = filter_lakec(fc) - - if (snl(c) == 0 .and. h2osno(c) > 0._r8 .and. t_lake(c,1) > tfrz) then - heatavail = (t_lake(c,1) - tfrz) * cv_lake(c,1) - melt = min(h2osno(c), heatavail/hfus) - heatrem = max(heatavail - melt*hfus, 0._r8) - !catch small negative value to keep t at tfrz - t_lake(c,1) = tfrz + heatrem/(cv_lake(c,1)) - snow_depth(c) = snow_depth(c)*(1._r8 - melt/h2osno(c)) - h2osno(c) = h2osno(c) - melt - lhabs(c) = lhabs(c) + melt*hfus - qflx_snomelt(c) = qflx_snomelt(c) + melt/dtime - ! no snow layers, so qflx_snomelt_lyr is not set - qflx_snow_drain(c) = qflx_snow_drain(c) + melt/dtime - ! Prevent tiny residuals - if (h2osno(c) < smallnumber) h2osno(c) = 0._r8 - if (snow_depth(c) < smallnumber) snow_depth(c) = 0._r8 - end if - end do - - ! Lake phase change - - do j = 1,nlevlak - do fc = 1,num_lakec - c = filter_lakec(fc) - - dophasechangeflag = .false. - if (t_lake(c,j) > tfrz .and. lake_icefrac(c,j) > 0._r8) then ! melting - dophasechangeflag = .true. - heatavail = (t_lake(c,j) - tfrz) * cv_lake(c,j) - melt = min(lake_icefrac(c,j)*denh2o*dz_lake(c,j), heatavail/hfus) - !denh2o is used because layer thickness is not adjusted for freezing - heatrem = max(heatavail - melt*hfus, 0._r8) - !catch small negative value to keep t at tfrz - else if (t_lake(c,j) < tfrz .and. lake_icefrac(c,j) < 1._r8) then !freezing - dophasechangeflag = .true. - heatavail = (t_lake(c,j) - tfrz) * cv_lake(c,j) - melt = max(-(1._r8-lake_icefrac(c,j))*denh2o*dz_lake(c,j), heatavail/hfus) - !denh2o is used because layer thickness is not adjusted for freezing - heatrem = min(heatavail - melt*hfus, 0._r8) - !catch small positive value to keep t at tfrz - end if - ! Update temperature and ice fraction. - if (dophasechangeflag) then - lake_icefrac(c,j) = lake_icefrac(c,j) - melt/(denh2o*dz_lake(c,j)) - lhabs(c) = lhabs(c) + melt*hfus - ! Update heat capacity - cv_lake(c,j) = cv_lake(c,j) + melt*(cpliq-cpice) - t_lake(c,j) = tfrz + heatrem/cv_lake(c,j) - ! Prevent tiny residuals - if (lake_icefrac(c,j) > 1._r8 - smallnumber) lake_icefrac(c,j) = 1._r8 - if (lake_icefrac(c,j) < smallnumber) lake_icefrac(c,j) = 0._r8 - end if - end do - end do - - ! Snow & soil phase change - ! Currently, does not do freezing point depression. - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_lakec - c = filter_lakec(fc) - dophasechangeflag = .false. - - if (j >= snl(c) + 1) then - - if (t_soisno(c,j) > tfrz .and. h2osoi_ice(c,j) > 0._r8) then ! melting - dophasechangeflag = .true. - heatavail = (t_soisno(c,j) - tfrz) * cv(c,j) - melt = min(h2osoi_ice(c,j), heatavail/hfus) - heatrem = max(heatavail - melt*hfus, 0._r8) - !catch small negative value to keep t at tfrz - if (j <= 0) then !snow - imelt(c,j) = 1 - qflx_snomelt_lyr(c,j) = melt/dtime - qflx_snomelt(c) = qflx_snomelt(c) + qflx_snomelt_lyr(c,j) - end if - else if (t_soisno(c,j) < tfrz .and. h2osoi_liq(c,j) > 0._r8) then !freezing - dophasechangeflag = .true. - heatavail = (t_soisno(c,j) - tfrz) * cv(c,j) - melt = max(-h2osoi_liq(c,j), heatavail/hfus) - heatrem = min(heatavail - melt*hfus, 0._r8) - !catch small positive value to keep t at tfrz - if (j <= 0) then !snow - imelt(c,j) = 2 - ! layer freezing mass flux (positive): - qflx_snofrz_lyr(c,j) = -melt/dtime - qflx_snofrz(c) = qflx_snofrz(c) + qflx_snofrz_lyr(c,j) - end if - end if - - ! Update temperature and soil components. - if (dophasechangeflag) then - h2osoi_ice(c,j) = h2osoi_ice(c,j) - melt - h2osoi_liq(c,j) = h2osoi_liq(c,j) + melt - lhabs(c) = lhabs(c) + melt*hfus - ! Update heat capacity - cv(c,j) = cv(c,j) + melt*(cpliq-cpice) - t_soisno(c,j) = tfrz + heatrem/cv(c,j) - ! Prevent tiny residuals - if (h2osoi_ice(c,j) < smallnumber) h2osoi_ice(c,j) = 0._r8 - if (h2osoi_liq(c,j) < smallnumber) h2osoi_liq(c,j) = 0._r8 - end if - - end if - end do - end do - - ! Update eflx_snomelt(c) - do fc = 1,num_lakec - c = filter_lakec(fc) - eflx_snomelt(c) = qflx_snomelt(c)*hfus - end do - - end associate - - end subroutine PhaseChange_Lake - - end module LakeTemperatureMod - diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 deleted file mode 100644 index 66b608022e..0000000000 --- a/src/biogeophys/LunaMod.F90 +++ /dev/null @@ -1,1358 +0,0 @@ -module LunaMod - -#include "shr_assert.h" - - !********************************************************************************************************************************************************************** - ! !DESCRIPTION: - ! Calculates the photosynthetic capacities based on a prescribed leaf nitrogen content, using the LUNA model, developed by Chonggang Xu, Ashehad Ali and Rosie Fisher - ! Currently only works for C3 plants. See Xu et al 2012; Ali et al 2015a. Ecological Applications. http://dx.doi.org/10.1890/14-2111.1. and Ali et al 2015b.In Review. - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : rgas, tfrz,spval - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : namep - use clm_varpar , only : nlevcan - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use FrictionvelocityMod , only : frictionvel_type - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use PhotosynthesisMod , only : photosyns_type - use TemperatureType , only : temperature_type - use PatchType , only : patch - use GridcellType , only : grc - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use WaterstateType , only : waterstate_type - !use EDPhotosynthesisMod , only : vcmaxc, jmaxc - - - implicit none - save - - !------------------------------------------------------------------------------ - ! PRIVATE MEMBER FUNCTIONS: - public :: LunaReadNML !subroutine to read in the Luna namelist - public :: Update_Photosynthesis_Capacity !subroutine to update the canopy nitrogen profile - public :: NitrogenAllocation !subroutine to update the Vcmax25 and Jmax25 at the leaf level - public :: Acc24_Climate_LUNA !subroutine to accumulate 24 hr climates - public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates - public :: Clear24_Climate_LUNA !subroutine to clear 24 hr climates - private :: NUEref !Calculate the Nitrogen use effieciency based on reference CO2 and leaf temperature - private :: NUE !Calculate the Nitrogen use effieciency based on current CO2 and leaf temperature - private :: JmxTLeuning !Calculate the temperature response for Jmax, based on Leunning 2002 Plant, Cell & Environment - private :: JmxTKattge !Calculate the temperature response for Jmax, based on Kattge and Knorr 2007 - private :: VcmxTLeuning !Calculate the temperature response for Vcmax, based on Leunning 2002 Plant, Cell & Environment - private :: VcmxTKattge !Calculate the temperature response for Vcmax, based on Kattge and Knorr 2007 - private :: RespTBernacchi !Calculate the temperature response for respiration, following Bernacchi PCE 2001 - private :: Photosynthesis_luna !calculate the photosynthetic rate for nitrogen allocation - private :: Quadratic !Calculate the soultion using the quadratic formula - - !------------------------------------------------------------------------------ - !Constants - real(r8), parameter :: Cv = 1.2e-5_r8 * 3600.0 ! conversion factor from umol CO2 to g carbon - real(r8), parameter :: Kc25 = 40.49_r8 ! Mechanis constant of CO2 for rubisco(Pa), Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - real(r8), parameter :: Ko25 = 27840_r8 ! Mechanis constant of O2 for rubisco(Pa), Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - real(r8), parameter :: Cp25 = 4.275_r8 ! CO2 compensation point at 25C (Pa), Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - real(r8), parameter :: Fc25 = 294.2_r8 ! Fc25 = 6.22*47.3 #see Rogers (2014) Photosynthesis Research - real(r8), parameter :: Fj25 = 1257.0_r8 ! Fj25 = 8.06*156 # #see COSTE 2005 and Xu et al 2012 - real(r8), parameter :: NUEr25 = 33.69_r8 ! nitrogen use efficiency for respiration, see Xu et al 2012 - real(r8), parameter :: Cb = 1.78_r8 ! nitrogen use effiency for choloraphyll for light capture, see Evans 1989 - real(r8), parameter :: O2ref = 209460.0_r8 ! ppm of O2 in the air - real(r8), parameter :: CO2ref = 380.0_r8 ! reference CO2 concentration for calculation of reference NUE. - real(r8), parameter :: forc_pbot_ref = 101325.0_r8 ! reference air pressure for calculation of reference NUE - real(r8), parameter :: Q10Enz = 2.0_r8 ! Q10 value for enzyme decay rate - real(r8), parameter :: Jmaxb0 = 0.0311_r8 ! the baseline proportion of nitrogen allocated for electron transport (J) - real(r8) :: Jmaxb1 = 0.1_r8 ! the baseline proportion of nitrogen allocated for electron transport (J) - real(r8), parameter :: Wc2Wjb0 = 0.8054_r8 ! the baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) - real(r8), parameter :: relhExp = 6.0999_r8 ! electron transport parameters related to relative humidity - real(r8), parameter :: Enzyme_turnover_daily = 0.1_r8 ! the daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) - real(r8), parameter :: NMCp25 = 0.715_r8 ! estimated by assuming 80% maintenance respiration is used for photosynthesis enzyme maintenance - real(r8), parameter :: Trange1 = 5.0_r8 ! lower temperature limit (oC) for nitrogen optimization - real(r8), parameter :: Trange2 = 42.0_r8 ! upper temperature limit (oC) for nitrogen optimization - real(r8), parameter :: SNC = 0.004_r8 ! structural nitrogen concentration (g N g-1 dry mass carbon) - real(r8), parameter :: mp = 9.0_r8 ! slope of stomatal conductance; this is used to estimate model parameter, but may need to be updated from the physiology file, - real(r8), parameter :: PARLowLim = 200.0_r8 ! minimum photosynthetically active radiation for nitrogen optimization - real(r8), parameter :: minrelh = 0.25_r8 ! minimum relative humdity for nitrogen optimization - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------------ - - contains - - !********************************************************************************************************************************************************************** - ! Read in LUNA namelist - subroutine LunaReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for LUNA - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'lunaReadNML' - character(len=*), parameter :: nmlname = 'luna' - !----------------------------------------------------------------------- - namelist /luna/ Jmaxb1 - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=luna, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (Jmaxb1, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=luna) - write(iulog,*) ' ' - end if - - end subroutine lunaReadNML - - !********************************************************************************************************************************************************************** - ! this subroutine updates the photosynthetic capacity as determined by Vcmax25 and Jmax25 - subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & - dayl_factor, atm2lnd_inst, temperature_inst, canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst, waterstate_inst, frictionvel_inst) - ! - ! !DESCRIPTION: - ! Calculates Nitrogen fractionation within the leaf, based on optimum calculated fractions in rubisco, cholorophyll, - ! Respiration and Storage. Based on Xu et al. 2012 and Ali et al 2015.In Review - - ! - ! !REVISION HISTORY: - ! version 1.0, by Chonggang Xu, Ashehad Ali and Rosie Fisher. July 14 2015. - ! version 0.1, by Chonggang Xu, Ashehad Ali and Rosie Fisher. October 30 2014. - - ! CALLED FROM: - ! subroutine CanopyFluxes - - ! !USES: - use clm_time_manager , only : get_step_size, is_end_curr_day - use clm_varpar , only : nlevsoi, mxpft - use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : use_cn - use quadraticMod , only : quadratic - use CNSharedParamsMod , only : CNParamsShareInst - use shr_infnan_mod, only : isnan => shr_infnan_isnan - - implicit none - - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - real(r8) , intent(in) :: dayl_factor( bounds%begp: ) ! scalar (0-1) for daylength - - - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit in variables - - integer :: c,CL,f,g,iv,j,p,ps ! indices - integer :: NCL_p ! number of canopy layers in patch - integer :: ft ! plant functional type - integer :: z ! the index across leaf layers - real (r8) :: PNstoreopt,PNlcopt,PNetopt,PNrespopt,PNcbopt ! the optimal nitrogen allocations - real (r8) :: PNstoreold,PNlcold,PNetold,PNrespold,PNcbold ! the previous time step nitrogen allocations - real (r8) :: delta_fn ! daily change in nitrogen investiment - real (r8) :: relCLNCa ! the relative factor for LNCa due to canopy location and seasonal growth - real (r8) :: relSLNCa ! the relative factor for LNCa due to seasonal growth - real (r8) :: relRad ! the realtive radiation to the top of the canopy - real (r8) :: FNCmtar ! target functional nitrogen content (g N/g leaf c) - real (r8) :: LMA ! leaf mass per unit area (g leaf c/m2 leaf) - real (r8) :: PARTop ! photosynthetic active radiation on the top of canopy (umol/m2/s) - real (r8) :: RadTop ! short-wave radiation on the top of canopy (w/m2) - real (r8) :: TRad ! total short-wave radiation on the top of canopy (w/m2) - real (r8) :: PARi10 ! 10-day mean photosynthetic active radiation on in the canopy (umol/m2/s) - real (r8) :: PARimx10 ! 10-day mean maximum photosynthetic active radiation on in the canopy (umol/m2/s) - real (r8) :: tleaf10 ! 10-day mean leaf temperature (oC) - real (r8) :: tleafd10 ! 10-day mean daytime leaf temperature (oC) - real (r8) :: tleafn10 ! 10-day mean nighttime leaf temperature (oC) - real (r8) :: hourpd ! hours per day (hours) - real (r8) :: CO2a10 ! 10-day mean air co2 concentration (pa) - real (r8) :: O2a10 ! 10-day mean air o2 concentration (pa) - real (r8) :: max_daily_pchg ! maximum daily percentrage change for nitrogen allocation - real (r8) :: max_daily_decay ! maximum daily decay for nitrogen allocation - real (r8) :: radk ! light extintion factor - real (r8) :: FNCa ! leaf functional nitrogen content (g/m2) - real (r8) :: FNCa_z(1:nlevcan) ! profile of leaf functional nitrogen content (g/m2) - real (r8) :: fnps ! fraction of light absorbed by non-photosynthetic pigments - real (r8) :: radmax2mean ! ratio of max radiation to mean - real (r8) :: qabs ! PAR absorbed by PS II (umol photons/m**2/s) - real (r8) :: EnzTurnoverTFactor ! temperature adjust factor for enzyme decay - real (r8) :: vcmax25 ! Predicted vcmax25 from EDN model umol CO2/m**2/s - real (r8) :: jmax25 ! Predicted jmax25 from EDN model umol electrons/m**2/s - real (r8) :: dtime ! stepsize in seconds - real (r8) :: rb10v ! 10-day mean boundary layer resistance - real (r8) :: relh10 ! 10-day mean relative humidity (unitless) - real (r8) :: tair10 ! 10-day running mean of the 2m temperature (oC) - real (r8) :: rabsorb ! ratio of absorbed raditation to the total incident radiation - real (r8) :: tlaii ! total leaf area index for a certain canopy layer - real (r8) :: SNCa ! structural leaf nitrogen content (g N/m2 leaf) - real (r8) :: vcmx25_opt ! optimal Vc,max25 (umol CO2/m**2/s) - real (r8) :: jmx25_opt ! optimal Jmax25 (umol electron/m**2/s) - real (r8) :: chg ! change in Vcmax25 or Jmax25 - real (r8) :: chg_constrn ! constrained change in Vcmax25 or Jmax25 - logical :: is_end_day ! is end of current day - !------------------------------------------------------------------------------------------------------------------------------------------------- - associate( & - c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 - slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] - leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) - forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) - CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) - O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index - tlai_z => surfalb_inst%tlai_z_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index - dayl => grc%dayl , & ! Input: [real(r8) (:) ] daylength (s) - sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] patch solar radiation absorbed by vegetation (W/m**2) - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] vegetation temperature (Kelvin) - rhol => pftcon%rhol , & ! Input: [real(r8) (:) ] leaf reflectance: 1=vis, 2=nir - taul => pftcon%taul , & ! Input: [real(r8) (:) ] leaf transmittance: 1=vis, 2=nir - par240d_z => solarabs_inst%par240d_z_patch , & ! Input: [real(r8) (:,:) ] 10-day running mean of daytime patch absorbed PAR for leaves in canopy layer (W/m**2) - par24d_z => solarabs_inst%par24d_z_patch , & ! Input: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) - par240x_z => solarabs_inst%par240x_z_patch , & ! Input: [real(r8) (:,:) ] 10-day running mean of maximum patch absorbed PAR for leaves in canopy layer (W/m**2) - par24x_z => solarabs_inst%par24x_z_patch , & ! Input: [real(r8) (:,:) ] daily maximum of patch absorbed PAR for leaves in canopy layer (W/m**2) - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] pft number of canopy layers, above snow for radiative transfer - lnc => photosyns_inst%lnca_patch , & ! Input: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) - t10 => temperature_inst%t_a10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of the 2 m temperature (K) - t_veg_day => temperature_inst%t_veg_day_patch , & ! Input: [real(r8) (:) ] daytime mean vegetation temperature (Kelvin) - t_veg_night => temperature_inst%t_veg_night_patch , & ! Input: [real(r8) (:) ] nighttime mean vegetation temperature (Kelvin) - t_veg10_day => temperature_inst%t_veg10_day_patch , & ! Input: [real(r8) (:) ] 10-day mean daytime vegetation temperature (Kelvin) - t_veg10_night => temperature_inst%t_veg10_night_patch , & ! Input: [real(r8) (:) ] 10-day mean nighttime vegetation temperature (Kelvin) - rh10_p => waterstate_inst%rh10_af_patch , & ! Input: [real(r8) (:) ] 10-day mean canopy air relative humidity at the pacth (unitless) - rb10_p => frictionvel_inst%rb10_patch , & ! Input: [real(r8) (:) ] 10-day mean boundary layer resistance at the pacth (s/m) - gpp_day => photosyns_inst%fpsn24_patch , & ! Input: [real(r8) (:) ] patch 24 hours mean gpp(umol CO2/m**2 ground/day) for canopy layer - vcmx25_z => photosyns_inst%vcmx25_z_patch , & ! Output: [real(r8) (:,:) ] patch leaf Vc,max25 (umol/m2 leaf/s) for canopy layer - jmx25_z => photosyns_inst%jmx25_z_patch , & ! Output: [real(r8) (:,:) ] patch leaf Jmax25 (umol electron/m**2/s) for canopy layer - pnlc_z => photosyns_inst%pnlc_z_patch , & ! Output: [real(r8) (:,:) ] patch proportion of leaf nitrogen allocated for light capture for canopy layer - enzs_z => photosyns_inst%enzs_z_patch & ! Output: [real(r8) (:,:) ] enzyme decay status 1.0-fully active; 0-all decayed during stress - ) - !---------------------------------------------------------------------------------------------------------------------------------------------------------- - !set timestep - - !Initialize enzyme decay Q10 - dtime = get_step_size() - - is_end_day = is_end_curr_day() - fnps = 0.15_r8 - call t_startf('LUNA') - do f = 1,fn - p = filterp(f) - ft = patch%itype(p) - g = patch%gridcell(p) - c = patch%column(p) - !---------------------------------------------------- - !store the daily mean climate conditions - if(t_veg_day(p).ne.spval) then !check whether it is the first day - !------------------------------------------ - !get the climate driver - CO2a10 = CO2_p240(p) - O2a10 = O2_p240(p) - hourpd = dayl(g) / 3600._r8 - tleafd10 = t_veg10_day(p) - tfrz - tleafn10 = t_veg10_night(p) - tfrz - tleaf10 = (dayl(g)*tleafd10 +(86400._r8-dayl(g)) * tleafd10)/86400._r8 - tair10 = t10(p)- tfrz - relh10 = min(1.0_r8, rh10_p(p)) - rb10v = rb10_p(p) - !-------------------------------------------------------------------- - !calculate the enzyme ternover rate - EnzTurnoverTFactor = Q10Enz**(0.1_r8*(min(40.0_r8, tleaf10) - 25.0_r8)) - max_daily_pchg = EnzTurnoverTFactor * Enzyme_turnover_daily - !----------------------------------------------------------------- - rabsorb = 1.0_r8-rhol(ft,1)-taul(ft,1) - !Implemented the nitrogen allocation model - if(tlai(p) > 0.0_r8 .and. lnc(p) > 0._r8)then - RadTop = par240d_z(p,1)/rabsorb - PARTop = RadTop*4.6 !conversion from w/m2 to umol/m2/s. PAR is still in umol photons, not electrons. Also the par240d_z is only for radiation at visible range. Hence 4.6 not 2.3 multiplier. - !------------------------------------------------------------- - !the nitrogen allocation model, may need to be feed from the parameter file in CLM - if (nint(c3psn(ft)) == 1)then - if(gpp_day(p)>0.0 )then !only optimize if there is growth and it is C3 plants - !------------------------------------------------------------- - do z = 1, nrad(p) - if(tlai_z(p,z)>0.0_r8)then - qabs = par240d_z(p,z)/rabsorb - PARi10 = qabs * 4.6_r8 - else - PARi10 = 0.01_r8 - endif - !----------------------------------------------------------------------- - relRad = PARi10/PARTop - relCLNCa = 0.1802_r8*log(relRad)+1.0_r8 !see Ali et al 2015. - relCLNCa = max(0.2_r8,relCLNCa) - relCLNCa = min(1.0_r8,relCLNCa) - relSLNCa = 1.0_r8 - !------------------------------------------------------------------ - SNCa = 1.0_r8/slatop(ft) * SNC - if(0.9_r8 * lnc(p)> SNCa)then - FNCa_z(z)= relCLNCa*(lnc(p)-SNCa) - else - FNCa_z(z)= relCLNCa*0.1_r8*lnc(p) - endif - enddo - - !---------------------------------------------------------------------- - !nitrogen allocation model - do z = 1 , nrad(p) - - !------------------------------------------------------------------------------------------- - !for different layers of leaves - FNCa = FNCa_z(z) - if(FNCa>15.0_r8) then !boundary condition check for unrealistically high leaf nitrogen content - FNCa = 15.0_r8 - write(iulog, *) 'Warning: leaf nitrogen content become unrealistically high (>15.0 g N/m2 leaf) ', & - 'for patch=', p, 'z=', z, "pft=", ft - endif - radmax2mean = par240x_z(p,z) / par240d_z(p,z) - if(tlai_z(p,z)>0.0_r8)then - qabs = par240d_z(p,z)/rabsorb - PARi10 = qabs * 4.6_r8 - else - PARi10 = 0.01_r8 - endif - PARimx10 = PARi10*radmax2mean - !----------------------------------------------------------------------------------------------------- - - !nitrogen allocastion model-start - PNlcold = PNlc_z(p,z) - PNetold = 0.0_r8 - PNrespold = 0.0_r8 - PNcbold = 0.0_r8 - call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & - tair10, tleafd10, tleafn10, & - Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp, PNstoreold, PNlcold, PNetold, PNrespold, & - PNcbold, PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) - vcmx25_opt= PNcbopt * FNCa * Fc25 - jmx25_opt= PNetopt * FNCa * Fj25 - - chg = vcmx25_opt-vcmx25_z(p, z) - chg_constrn = min(abs(chg),vcmx25_z(p, z)*max_daily_pchg) - vcmx25_z(p, z) = vcmx25_z(p, z)+sign(1.0_r8,chg)*chg_constrn - - chg = jmx25_opt-jmx25_z(p, z) - chg_constrn = min(abs(chg),jmx25_z(p, z)*max_daily_pchg) - jmx25_z(p, z) = jmx25_z(p, z)+sign(1.0_r8,chg)*chg_constrn - - PNlc_z(p, z)= PNlcopt - - if(enzs_z(p,z)<1.0) then - enzs_z(p,z) = enzs_z(p,z)* (1.0_r8 + max_daily_pchg) - endif - !nitrogen allocastion model-end - -!DML turn off endrun and instead modify vcmx25_z(p,z) and jmx25_z(p,z) to a reasonable value - !----------------------------------------------------------------------------------------------------- - if(isnan(vcmx25_z(p, z)))then - write(iulog, *) 'Error: Vc,mx25 is NaN for patch=', & - p, 'z=', z, "pft=", ft - write(iulog, *) 'LUNA env:',FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, & - hourpd, tair10, tleafd10, tleafn10 - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - if(vcmx25_z(p, z)>1000._r8 .or. vcmx25_z(p, z)<0._r8)then - write(iulog, *) 'Warning: Vc,mx25 become unrealistic (>1000 or negative) for patch=', & - p, 'z=', z, "pft=", ft - write(iulog, *) 'LUNA env:',vcmx25_z(p,z),FNCa,forc_pbot10(p), relh10, CO2a10, & - O2a10, PARi10, PARimx10, rb10v, hourpd, tair10, tleafd10, tleafn10 - vcmx25_z(p,z) = 50._r8 - endif - if(isnan(jmx25_z(p, z)))then - write(iulog, *) 'Error: Jmx25 is NaN for patch=', & - p, 'z=', z, "pft=", ft - write(iulog, *) 'LUNA env:', FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, & - hourpd, tair10, tleafd10, tleafn10 - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - if(jmx25_z(p, z)>2000._r8 .or. jmx25_z(p, z)<0._r8)then - write(iulog, *) 'Warning: Jmx25 become unrealistic (>2000, or negative) for patch=', & - p, 'z=', z, "pft=", ft - write(iulog, *) 'LUNA env:', jmx25_z(p,z),FNCa,forc_pbot10(p), relh10, CO2a10, & - O2a10, PARi10, PARimx10, rb10v, hourpd, tair10, tleafd10, tleafn10 - jmx25_z(p,z) = 85._r8 - endif - - enddo ! finished loop of leaf layers - else !decay during drought or winter - max_daily_decay = min(0.5_r8, 0.1_r8 * max_daily_pchg) - !assume enzyme turnover under maintenance is 10 - !times lower than enzyme change under growth - do z = 1 , nrad(p) - if(enzs_z(p,z)>0.5_r8) then - !decay is set at only 50% of original - !enzyme in view that plant will need to - !maintain their basic functionality - enzs_z(p,z) = enzs_z(p,z)* (1.0_r8 - max_daily_decay) - jmx25_z(p, z) = jmx25_z(p, z)* (1.0_r8 - max_daily_decay) - vcmx25_z(p, z) = vcmx25_z(p, z)* (1.0_r8 - max_daily_decay) - endif - end do - endif !checking for growth - endif !if not C3 plants - else - do z = 1 , nrad(p) - jmx25_z(p, z) = 85._r8 - vcmx25_z(p, z) = 50._r8 - end do - endif !checking for LAI and LNC - endif !the first daycheck - end do !fn loop - call t_stopf('LUNA') - end associate - -end subroutine Update_Photosynthesis_Capacity - - - -subroutine Acc240_Climate_LUNA(bounds, fn, filterp, oair, cair, & - rb,rh, temperature_inst, photosyns_inst, & - surfalb_inst, solarabs_inst, waterstate_inst, frictionvel_inst) - ! - ! !DESCRIPTION: - ! Accumulate the 10-day running mean climates for LUNA model - - ! - ! !REVISION HISTORY: - ! version 1.0, by Chonggang Xu July 14 2015. - - ! CALLED FROM: - ! subroutine CanopyFluxes - - ! !USES: - use clm_time_manager , only : get_step_size, is_end_curr_day - implicit none - - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - real(r8) , intent(in) :: oair( bounds%begp: ) ! Atmospheric O2 partial pressure (Pa) - real(r8) , intent(in) :: cair( bounds%begp: ) ! Atmospheric CO2 partial pressure (Pa) - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) - real(r8) , intent(in) :: rh( bounds%begp: ) ! canopy air relative humidity - - type(temperature_type) , intent(inout) :: temperature_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit in variables - - integer :: c,f,g,iv,j,p ! indices - integer :: ft ! plant functional type - integer :: z ! the index across leaf layers - real (r8) :: dtime ! stepsize in seconds - real (r8) :: TRad ! total short-wave radiation on the top of canopy (w/m2) - real (r8) :: tlaii ! total leaf area index for a certain canopy layer - real (r8) :: t_veg_dayi ! daytime mean vegetation temperature (Kelvin) - real (r8) :: t_veg_nighti ! nighttime mean vegetation temperature (Kelvin) - real (r8) :: par24d_z_i(1:nlevcan) ! daytime mean radiation (w/m**2) - logical :: is_end_day ! is end of current day - !------------------------------------------------------------------------------------------------------------------------------------------------- - associate( & - par24d_z => solarabs_inst%par24d_z_patch , & ! Input: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) - par24x_z => solarabs_inst%par24x_z_patch , & ! Input: [real(r8) (:,:) ] daily maximum of patch absorbed PAR for leaves in canopy layer (W/m**2) - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] pft number of canopy layers, above snow for radiative transfer - t_veg_day => temperature_inst%t_veg_day_patch , & ! Input: [real(r8) (:) ] daytime accumulative vegetation temperature (Kelvin*nsteps) - t_veg_night => temperature_inst%t_veg_night_patch , & ! Input: [real(r8) (:) ] nighttime accumulative vegetation temperature (Kelvin*nsteps) - nnightsteps => temperature_inst%nnightsteps_patch , & ! Input: [integer (:) ] number of nighttime steps in 24 hours from mid-night, LUNA specific - ndaysteps => temperature_inst%ndaysteps_patch , & ! Input: [integer (:) ] number of daytime steps in 24 hours from mid-night, LUNA specific - t_veg10_day => temperature_inst%t_veg10_day_patch , & ! Output: [real(r8) (:) ] 10-day mean vegetation temperature (Kelvin) - t_veg10_night => temperature_inst%t_veg10_night_patch , & ! Output: [real(r8) (:) ] 10-day mean vegetation temperature (Kelvin) - rh10_p => waterstate_inst%rh10_af_patch , & ! Output: [real(r8) (:) ] 10-day mean canopy air relative humidity at the pacth (s/m) - rb10_p => frictionvel_inst%rb10_patch , & ! Output: [real(r8) (:) ] 10-day mean boundary layer resistance at the pacth (s/m) - par240d_z => solarabs_inst%par240d_z_patch , & ! Output: [real(r8) (:,:) ] 10-day running mean of daytime patch absorbed PAR for leaves in canopy layer (W/m**2) - par240x_z => solarabs_inst%par240x_z_patch & ! Output: [real(r8) (:,:) ] 10-day running mean of maximum patch absorbed PAR for leaves in canopy layer (W/m**2) - - ) - !---------------------------------------------------------------------------------------------------------------------------------------------------------- - !set timestep - - !Initialize enzyme decay Q10 - dtime = get_step_size() - is_end_day = is_end_curr_day() - do f = 1,fn - p = filterp(f) - ft = patch%itype(p) - g = patch%gridcell(p) - c = patch%column(p) - if(t_veg_day(p).ne.spval) then !check whether it is the first day - !--------------------------------------------------------- - !calculate the 10 day running mean radiations - if(ndaysteps(p)>0.0) then - par24d_z_i=par24d_z(p,:)/(dtime * ndaysteps(p)) - else - par24d_z_i = 0._r8 - endif - if(par240d_z(p,1).eq. spval)then !first day set as the same of first day environmental conditions - par240x_z(p,:)= par24x_z(p,:) - par240d_z(p,:)= par24d_z_i - else - par240x_z(p,:)= 0.9_r8 * par240x_z(p,:) + 0.1_r8 * par24x_z(p,:) - par240d_z(p,:)= 0.9_r8 * par240d_z(p,:) + 0.1_r8 * par24d_z_i - endif - !------------------------------------------------------- - !calculate the 10 day running mean daytime temperature - if(ndaysteps(p)>0.0)then - t_veg_dayi = t_veg_day(p) / ndaysteps(p) - else - t_veg_dayi = t_veg_night(p) / nnightsteps(p) - endif - if(t_veg10_day(p).eq. spval)then - t_veg10_day(p) = t_veg_dayi - endif - t_veg10_day(p) = 0.9_r8 * t_veg10_day(p)+ 0.1_r8 * t_veg_dayi - !------------------------------------------------------- - !calculate the 10 day running mean nighttime temperature - if(nnightsteps(p)>0)then - t_veg_nighti = t_veg_night(p) / nnightsteps(p) - else - t_veg_nighti = t_veg_day(p) / ndaysteps(p) - endif - if(t_veg10_night(p).eq. spval)then - t_veg10_night(p) = t_veg_nighti - endif - t_veg10_night(p) = 0.9_r8 * t_veg10_night(p) + 0.1_r8 * t_veg_nighti - !-------------------------------------------------------------------- - if(rh10_p(p).eq. spval)then - rh10_p(p) = rh(p) - endif - rh10_p(p) = 0.9_r8 * rh10_p(p) + 0.1_r8 * min(1.0_r8, rh(p)) - - if(rb10_p(p).eq. spval)then - rb10_p(p) = rb(p) - endif - rb10_p(p) = 0.9_r8 * rb10_p(p) + 0.1_r8 * rb(p) - endif !the first day check - end do !fn loop - end associate -end subroutine Acc240_Climate_LUNA - - -subroutine Acc24_Climate_LUNA(bounds, fn, filterp, canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst,temperature_inst) - ! - ! !DESCRIPTION: - ! Accumulate the 24 hr climates for LUNA model - - ! - ! !REVISION HISTORY: - ! version 1.0, by Chonggang Xu July 14 2015. - - ! CALLED FROM: - ! subroutine CanopyFluxes - - ! !USES: - use clm_time_manager , only : get_step_size - implicit none - - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - - - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(temperature_type) , intent(inout) :: temperature_inst - - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit in variables - - integer :: c,f,g,iv,j,p ! indices - integer :: ft ! plant functional type - integer :: z ! the index across leaf layers - real (r8) :: dtime ! stepsize in seconds - real (r8) :: TRad ! total short-wave radiation on the top of canopy (w/m2) - real (r8) :: tlaii ! total leaf area index for a certain canopy layer - - !------------------------------------------------------------------------------------------------------------------------------------------------- - associate( & - sabv => solarabs_inst%sabv_patch , & ! Input: [real(r8) (:) ] patch solar radiation absorbed by vegetation (W/m**2) - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] vegetation temperature (Kelvin) - par_sun_z => solarabs_inst%parsun_z_patch , & ! Input: [real(r8) (:,:) ] par absorbed per unit lai for sunlit canopy layer (w/m**2) - par_sha_z => solarabs_inst%parsha_z_patch , & ! Input: [real(r8) (:,:) ] par absorbed per unit lai for shaded canopy layer (w/m**2) - lai_sun_z => canopystate_inst%laisun_z_patch , & ! Input: [real(r8) (:,:) ] leaf area index for sunlit canopy layer - lai_sha_z => canopystate_inst%laisha_z_patch , & ! Input: [real(r8) (:,:) ] leaf area index for canopy shaded layer - par24d_z => solarabs_inst%par24d_z_patch , & ! Input: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) - par24x_z => solarabs_inst%par24x_z_patch , & ! Input: [real(r8) (:,:) ] daily maximum of patch absorbed PAR for leaves in canopy layer (W/m**2) - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] pft number of canopy layers, above snow for radiative transfer - gpp => photosyns_inst%fpsn_patch , & ! Input: [real(r8) (:) ] patch instaneous gpp (umol CO2/m**2 ground/s) for canopy layer - gpp_day => photosyns_inst%fpsn24_patch , & ! Output: [real(r8) (:) ] patch 24 hours acculative gpp(umol CO2/m**2 ground/day) from mid-night - t_veg_day => temperature_inst%t_veg_day_patch , & ! Output: [real(r8) (:) ] daytime mean vegetation temperature (Kelvin) - t_veg_night => temperature_inst%t_veg_night_patch , & ! Output: [real(r8) (:) ] nighttime mean vegetation temperature (Kelvin) - nnightsteps => temperature_inst%nnightsteps_patch , & ! Output: [integer (:) ] number of nighttime steps in 24 hours from mid-night, LUNA specific - ndaysteps => temperature_inst%ndaysteps_patch & ! Output: [integer (:) ] number of daytime steps in 24 hours from mid-night, LUNA specific - ) - !---------------------------------------------------------------------------------------------------------------------------------------------------------- - !set timestep - - !Initialize enzyme decay Q10 - dtime = get_step_size() - do f = 1,fn - p = filterp(f) - ft = patch%itype(p) - g = patch%gridcell(p) - c = patch%column(p) - !---------------------------------------------------- - !store the daily mean climate conditions - if(t_veg_day(p).ne.spval) then !check whether it is the first day - if(sabv(p)>0)then - t_veg_day(p) = t_veg_day(p) + t_veg(p) - ndaysteps(p) = ndaysteps(p) + 1 - else - t_veg_night(p) = t_veg_night(p) + t_veg(p) - nnightsteps(p) = nnightsteps(p) + 1 - endif - do z = 1, nrad(p) - !average of sunlit and shaded leaves - tlaii = lai_sun_z(p,z) + lai_sha_z(p,z) - if(tlaii > 0._r8)then - TRad = (par_sun_z(p,z)*lai_sun_z(p,z)+par_sha_z(p,z)*lai_sha_z(p,z))/tlaii - TRad = par_sun_z(p,z) !RF & GBB. Make LUNA predict sunlit fraction N fractionation, scale in PhotosynthesisMod. - par24d_z(p,z)= par24d_z(p,z)+ dtime * TRad - if(TRad > par24x_z(p,z))then - par24x_z(p,z) = TRad - endif - endif - enddo - gpp_day(p) = gpp_day(p) + dtime * gpp(p) - endif !first day check - end do !fn loop - end associate -end subroutine Acc24_Climate_LUNA - - - - -subroutine Clear24_Climate_LUNA(bounds, fn, filterp, canopystate_inst, photosyns_inst, & - surfalb_inst, solarabs_inst,temperature_inst) - ! - ! !DESCRIPTION: - ! Zero out the 24 hr climates for LUNA model - - ! - ! !REVISION HISTORY: - ! version 1.0, by Chonggang Xu July 14 2015. - - ! CALLED FROM: - ! subroutine CanopyFluxes - - ! !USES: - use clm_time_manager , only : get_step_size, is_end_curr_day - implicit none - - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - - - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(temperature_type) , intent(inout) :: temperature_inst - - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit in variables - - integer :: c,f,g,iv,j,p ! indices - integer :: ft ! plant functional type - integer :: z ! the index across leaf layers - real (r8) :: dtime ! stepsize in seconds - logical :: is_end_day ! is end of current day - !------------------------------------------------------------------------------------------------------------------------------------------------- - associate( & - par24d_z => solarabs_inst%par24d_z_patch , & ! Output: [real(r8) (:,:) ] daily accumulated absorbed PAR for leaves in canopy layer (W/m**2) - par24x_z => solarabs_inst%par24x_z_patch , & ! Output: [real(r8) (:,:) ] daily maximum of patch absorbed PAR for leaves in canopy layer (W/m**2) - gpp_day => photosyns_inst%fpsn24_patch , & ! Output: [real(r8) (:) ] patch 24 hours acculative gpp(umol CO2/m**2 ground/day) from mid-night - t_veg_day => temperature_inst%t_veg_day_patch , & ! Output: [real(r8) (:) ] daytime mean vegetation temperature (Kelvin) - t_veg_night => temperature_inst%t_veg_night_patch , & ! Output: [real(r8) (:) ] nighttime mean vegetation temperature (Kelvin) - nnightsteps => temperature_inst%nnightsteps_patch , & ! Output: [integer (:) ] number of nighttime steps in 24 hours from mid-night, LUNA specific - ndaysteps => temperature_inst%ndaysteps_patch & ! Output: [integer (:) ] number of daytime steps in 24 hours from mid-night, LUNA specific - ) - !---------------------------------------------------------------------------------------------------------------------------------------------------------- - !set timestep - - !Initialize enzyme decay Q10 - dtime = get_step_size() - is_end_day = is_end_curr_day() - do f = 1,fn - p = filterp(f) - ft = patch%itype(p) - g = patch%gridcell(p) - c = patch%column(p) - !------------------------------------------------------------------------------ - !clear out the daily state variables at the begining of simulations - t_veg_day(p) = 0.0_r8 - t_veg_night(p) = 0.0_r8 - par24d_z(p,:) = 0.0_r8 - par24x_z(p,:) = 0.0_r8 - gpp_day(p) = 0.0_r8 - nnightsteps(p) = 0.0_r8 - ndaysteps(p) = 0.0_r8 - - end do !fn loop - end associate -end subroutine Clear24_Climate_LUNA - - -!************************************************************************************************************************************************ -!Use the LUNA model to calculate the Nitrogen partioning -subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp,& - PNstoreold, PNlcold, PNetold, PNrespold, PNcbold, & - PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) - implicit none - real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) - real(r8), intent (in) :: forc_pbot10 !10-day mean air pressure (Pa) - real(r8), intent (in) :: relh10 !10-day mean relative humidity (unitless) - real(r8), intent (in) :: CO2a10 !10-day meanCO2 concentration in the air (Pa) - real(r8), intent (in) :: O2a10 !10-day mean O2 concentration in the air (Pa) - real(r8), intent (in) :: PARi10 !10-day mean photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8), intent (in) :: PARimx10 !10-day mean 24hr maximum photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8), intent (in) :: rb10 !10-day mean boundary layer resistance - real(r8), intent (in) :: hourpd !hours of light in a the day (hrs) - real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) - real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) - real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) - real(r8), intent (in) :: Jmaxb0 !baseline proportion of nitrogen allocated for electron transport rate (unitless) - real(r8), intent (in) :: Jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) - real(r8), intent (in) :: Wc2Wjb0 !the baseline ratio of rubisco-limited rate vs light-limited photosynthetic rate (Wc:Wj) - real(r8), intent (in) :: relhExp !specifies the impact of relative humidity on electron transport rate (unitless) - real(r8), intent (in) :: PNstoreold !old value of the proportion of nitrogen allocated to storage (unitless) - real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) - real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) - real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) - real(r8), intent (in) :: PNcbold !old value of the proportion of nitrogen allocated to carboxylation (unitless) - real(r8), intent (out):: PNstoreopt !optimal proportion of nitrogen for storage - real(r8), intent (out):: PNlcopt !optimal proportion of nitrogen for light capture - real(r8), intent (out):: PNetopt !optimal proportion of nitrogen for electron transport - real(r8), intent (out):: PNrespopt !optimal proportion of nitrogen for respiration - real(r8), intent (out):: PNcbopt !optial proportion of nitrogen for carboxyaltion - - !------------------------------------------------------------------------------------------------------------------------------- - !intermediate variables - real(r8) :: Carboncost1 !absolute amount of carbon cost associated with maintenance respiration due to deccrease in light capture nitrogen(g dry mass per day) - real(r8) :: Carboncost2 !absolute amount of carbon cost associated with maintenance respiration due to increase in light capture nitrogen(g dry mass per day) - real(r8) :: Carbongain1 !absolute amount of carbon gain associated with maintenance respiration due to deccrease in light capture nitrogen(g dry mass per day) - real(r8) :: Carbongain2 !absolute amount of carbon gain associated with maintenance respiration due to increase in light capture nitrogen(g dry mass per day) - real(r8) :: Fc !the temperature adjustment factor for Vcmax - real(r8) :: Fj !the temperature adjustment factor for Jmax - real(r8) :: PNlc !the current nitrogen allocation proportion for light capture - real(r8) :: Jmax !the maximum electron transport rate (umol/m2/s) - real(r8) :: JmaxCoef !coefficient determining the response of electron transport rate to light availability (unitless) and humidity - real(r8) :: Jmaxb0act !base value of Jmax (umol/m2/s) - real(r8) :: JmaxL !the electron transport rate with maximum daily radiation (umol/m2/s) - real(r8) :: JmeanL !the electron transport rate with mean radiation (umol/m2/s) - real(r8) :: Nstore !absolute amount of nitrogen allocated to storage (gN/m2 leaf) - real(r8) :: Nresp !absolute amount of nitrogen allocated to respiration (gN/m2 leaf) - real(r8) :: Nlc !absolute amount of nitrogen allocated to light capture (gN/m2 leaf) - real(r8) :: Net !absolute amount of nitrogen allocated to electron transport (gN/m2 leaf) - real(r8) :: Ncb !absolute amount of nitrogen allocated to carboxylation (gN/m2 leaf) - real(r8) :: Nresp1 !absolute amount of nitrogen allocated to respiration due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: Nlc1 !absolute amount of nitrogen allocated to light capture due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: Net1 !absolute amount of nitrogen allocated to electron transport due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: Ncb1 !absolute amount of nitrogen allocated to carboyxlation due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: Nresp2 !absolute amount of nitrogen allocated to respiration due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: Nlc2 !absolute amount of nitrogen allocated to light capture due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: Net2 !absolute amount of nitrogen allocated to electron transport due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: Ncb2 !absolute amount of nitrogen allocated to carboxylation due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: PSN !g carbon photosynthesized per day per unit(m2) of leaf - real(r8) :: RESP !g carbon respired per day per unit(m2) of leaf due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: PSN1 !g carbon photosynthesized per day per unit(m2) of leaf due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: RESP1 !g carbon respired per day per unit(m2) of leaf due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: PSN2 !g carbon photosynthesized per day per unit(m2) of leaf due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: RESP2 !g carbon respired per day per unit(m2) of leaf - real(r8) :: Npsntarget !absolute amount of target nitrogen for photosynthesis(gN/m2 leaf) - real(r8) :: Npsntarget1 !absolute amount of target nitrogen for photosynthesis due to increase in light capture nitrogen(gN/m2 leaf) - real(r8) :: Npsntarget2 !absolute amount of target nitrogen for photosynthesis due to decrease in light capture nitrogen(gN/m2 leaf) - real(r8) :: NUEj !nitrogen use efficiency for electron transport under current environmental conditions - real(r8) :: NUEc !nitrogen use efficiency for carboxylation under current environmental conditions - real(r8) :: NUEjref !nitrogen use efficiency for electron transport under reference environmental conditions (25oC and 385ppm Co2) - real(r8) :: NUEcref !nitrogen use efficiency for carboxylation under reference environmental conditions (25oC and 385ppm Co2) - real(r8) :: NUEr !nitrogen use efficiency for respiration - real(r8) :: PARi10c !10-day mean constrained photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8) :: PARimx10c !10-day mean constrained 24hr maximum photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8) :: Kj2Kcref !the ratio of rubisco-limited photosynthetic rate (Wc) to light limited photosynthetic rate (Wj) - real(r8) :: PNlcoldi !old value of the proportion of nitrogen allocated to light capture (unitless) - real(r8) :: Kj2Kc !the ratio of Wc to Wj under changed conditions - real(r8) :: Kc !conversion factors for Vc,max to Wc - real(r8) :: Kj !conversion factor for electron transport rate to Wj - real(r8) :: theta !efficiency of light energy conversion (unitless) - real(r8) :: chg_per_step !the nitrogen change per interation - real(r8) :: Vcmaxnight !Vcmax during night (umol/m2/s) - real(r8) :: ci !inter-cellular CO2 concentration (Pa) - real(r8) :: theta_cj !interpolation coefficient - real(r8) :: tleafd10c !10-day mean daytime leaf temperature, contrained for physiological range (oC) - real(r8) :: tleafn10c !10-day mean leaf temperature for night, constrained for physiological range (oC) - real(r8) :: Vcmax !the maximum carboxyaltion rate (umol/m2/s) - integer :: KcKjFlag !flag to indicate whether to update the Kc and Kj using the photosynthesis subroutine; 0--Kc and Kj need to be calculated; 1--Kc and Kj is prescribed. - integer :: jj !index record fo the number of iterations - integer :: increase_flag !whether to increase or decrease - - call NUEref(NUEjref, NUEcref, Kj2Kcref) - theta_cj = 0.95_r8 - Nstore = PNstoreold * FNCa !proportion of storage nitrogen in functional nitrogen - Nlc = PNlcold * FNCa !proportion of light capturing nitrogen in functional nitrogen - Net = PNetold * FNCa !proportion of light harvesting (electron transport) nitrogen in functional nitrogen - Nresp = PNrespold * FNCa !proportion of respirational nitrogen in functional nitrogen - Ncb = PNcbold * FNCa !proportion of carboxylation nitrogen in functional nitrogen - if (Nlc > FNCa * 0.5_r8) Nlc = 0.5_r8 * FNCa - chg_per_step = 0.02* FNCa - PNlc = PNlcold - PNlcoldi = PNlcold - 0.001_r8 - PARi10c = max(PARLowLim, PARi10) - PARimx10c = max(PARLowLim, PARimx10) - increase_flag = 0 - jj = 1 - tleafd10c = min(max(tleafd10, Trange1), Trange2) !constrain the physiological range - tleafn10c = min(max(tleafn10, Trange1), Trange2) !constrain the physiological range - ci = 0.7_r8 * CO2a10 - JmaxCoef = Jmaxb1 * ((hourpd / 12.0_r8)**2.0_r8) * (1.0_r8 - exp(-relhExp * max(relh10 - minrelh, 0.0_r8) / & - (1.0_r8 - minrelh))) - do while (PNlcoldi .NE. PNlc .and. jj < 100) - Fc = VcmxTKattge(tair10, tleafd10c) * Fc25 - Fj = JmxTKattge(tair10, tleafd10c) * Fj25 - NUEr = Cv * NUEr25 * (RespTBernacchi(tleafd10c) * hourpd + RespTBernacchi(tleafn10c) * (24.0_r8 - hourpd)) !nitrogen use efficiency for respiration (g biomass/m2/day/g N) - !**************************************************** - !Nitrogen Allocation Scheme: store the initial value - !**************************************************** - KcKjFlag = 0 - call NUE(O2a10, ci, tair10, tleafd10c, NUEj, NUEc, Kj2Kc) - call Nitrogen_investments (KcKjFlag,FNCa, Nlc, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, tair10, & - tleafd10c,tleafn10c, & - Kj2Kc, Wc2Wjb0, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, Kc, Kj, ci, & - Vcmax, Jmax,JmeanL,JmaxL, Net, Ncb, Nresp, PSN, RESP) - - Npsntarget = Nlc + Ncb + Net !target nitrogen allocated to photosynthesis, which may be lower or higher than Npsn_avail - PNlcoldi = Nlc / FNCa - Nstore = FNCa - Npsntarget - Nresp - !------------------------------------------------------------------------------------ - !test the increase of light capture nitrogen - if (Nstore > 0.0_r8 .and.(increase_flag .eq. 1 .or. jj .eq. 1)) then - Nlc2 = Nlc + chg_per_step - if (Nlc2 / FNCa > 0.95_r8) Nlc2 = 0.95_r8 * FNCa - KcKjFlag = 1 - call Nitrogen_investments (KcKjFlag,FNCa, Nlc2, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & - tair10, tleafd10c,tleafn10c, & - Kj2Kc, Wc2Wjb0, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, Kc, Kj, ci, & - Vcmax, Jmax,JmeanL,JmaxL, Net2, Ncb2, Nresp2, PSN2, RESP2) - - Npsntarget2 = Nlc2 + Ncb2 + Net2 - !update the nitrogen change - Carboncost2 = (Npsntarget2 - Npsntarget) * NMCp25 * Cv * (RespTBernacchi(tleafd10c) * hourpd + & - RespTBernacchi(tleafn10c) * (24.0_r8 - hourpd)) - Carbongain2 = PSN2 - PSN - if(Carbongain2 > Carboncost2 .and. (Npsntarget2 + Nresp2 < 0.95_r8 * FNCa))then - Nlc = Nlc2 - Net = Net2 - Ncb = Ncb2 - Nstore = FNCa - Npsntarget2 - Nresp2 - if (jj == 1) increase_flag = 1 - end if - end if - !------------------------------------------------------------------------------------ - !test the decrease of light capture nitrogen - if (increase_flag == 0) then - if (Nstore < 0.0_r8) then - Nlc1 = Nlc * 0.8_r8 !bigger step of decrease if it is negative - else - Nlc1 = Nlc - chg_per_step - end if - if (Nlc1 < 0.05_r8) Nlc1 = 0.05_r8 - KcKjFlag = 1 - call Nitrogen_investments (KcKjFlag,FNCa, Nlc1,forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & - tair10, tleafd10c,tleafn10c, & - Kj2Kc, Wc2Wjb0, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, Kc, Kj, ci,& - Vcmax, Jmax,JmeanL,JmaxL, Net1, Ncb1, Nresp1, PSN1, RESP1) - Npsntarget1 = Nlc1 + Ncb1 + Net1 - Carboncost1 = (Npsntarget - Npsntarget1) * NMCp25 * Cv * (RespTBernacchi(tleafd10c) * hourpd + & - RespTBernacchi(tleafn10c) * (24.0_r8 - hourpd)) - Carbongain1 = PSN - PSN1 - if((Carbongain1 < Carboncost1 .and. Nlc1 > 0.05_r8) .or. (Npsntarget + Nresp) > 0.95_r8 * FNCa)then - Nlc = Nlc1 - Net = Net1 - Ncb = Ncb1 - Nstore = FNCa - Npsntarget1 - Nresp1 - end if - end if - PNlc = Nlc / FNCa - jj = jj + 1 - end do - PNlcopt = Nlc / FNCa - PNstoreopt = Nstore / FNCa - PNcbopt = Ncb / FNCa - PNetopt = Net / FNCa - PNrespopt = Nresp / FNCa - -end subroutine NitrogenAllocation - -!***************************************************************************************************************** -!calcualte the nitrogen investment for electron transport, carb10oxylation, respiration given a specified value -!of nitrogen allocation in light capture [Nlc]. This equation are based on Ali et al 2015b. - -subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & - CO2a10, O2a10, PARi10, PARimx10, rb10, hourpd, tair10, tleafd10, tleafn10, & - Kj2Kc, Wc2Wjb0, JmaxCoef, Fc, Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, Kc, & - Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) - implicit none - integer, intent (in) :: KcKjFlag !flag to indicate whether to update the Kc and Kj using the photosynthesis subroutine; 0--Kc and Kj need to be calculated; 1--Kc and Kj is prescribed. - real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) - real(r8), intent (in) :: Nlc !nitrogen content for light capture(g N/m2 leaf) - real(r8), intent (in) :: forc_pbot10 !10-day mean air pressure (Pa) - real(r8), intent (in) :: relh10 !10-day mean relative humidity (unitless) - real(r8), intent (in) :: CO2a10 !10-day mean CO2 concentration in the air (Pa) - real(r8), intent (in) :: O2a10 !10-day mean O2 concentration in the air (Pa) - real(r8), intent (in) :: PARi10 !10-day mean photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8), intent (in) :: PARimx10 !10-day mean 24hr maximum photosynthetic active radiation on in a canopy (umol/m2/s) - real(r8), intent (in) :: rb10 !10-day mean boundary layer resistance (s/m) - real(r8), intent (in) :: hourpd !hours of light in a the day (hrs) - real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) - real(r8), intent (in) :: tleafd10 !10-day mean daytime leaf temperature (oC) - real(r8), intent (in) :: tleafn10 !10-day mean nighttime leaf temperature (oC) - real(r8), intent (in) :: Kj2Kc !ratio: Kj / Kc - real(r8), intent (in) :: Wc2Wjb0 !the baseline ratio of rubisco-limited rate vs light-limited photosynthetic rate (Wc:Wj) - real(r8), intent (in) :: JmaxCoef !coefficient determining the response of electron transport rate to light availability (unitless) and humidity - real(r8), intent (in) :: Fc !the temperature adjustment factor for Vcmax - real(r8), intent (in) :: Fj !the temperature adjustment factor for Jmax - real(r8), intent (in) :: NUEc !nitrogen use efficiency for carboxylation - real(r8), intent (in) :: NUEj !nitrogen use efficiency for electron transport - real(r8), intent (in) :: NUEcref !nitrogen use efficiency for carboxylation under reference climates - real(r8), intent (in) :: NUEjref !nitrogen use efficiency for electron transport under reference climates - real(r8), intent (in) :: NUEr !nitrogen use efficiency for respiration - real(r8), intent (inout) :: Kc !conversion factors from Vc,max to Wc - real(r8), intent (inout) :: Kj !conversion factor from electron transport rate to Wj - real(r8), intent (inout) :: ci !inter-cellular CO2 concentration (Pa) - real(r8), intent (out) :: Vcmax !the maximum carboxyaltion rate (umol/m2/s) - real(r8), intent (out) :: Jmax !the maximum electron transport rate (umol/m2/s) - real(r8), intent (out) :: JmaxL !the electron transport rate with maximum daily radiation (umol/m2/s) - real(r8), intent (out) :: JmeanL !the electron transport rate with mean radiation (umol/m2/s) - real(r8), intent (out) :: Net !nitrogen content for electron transport(g N/m2 leaf) - real(r8), intent (out) :: Ncb !nitrogen content for carboxylation(g N/m2 leaf) - real(r8), intent (out) :: Nresp !nitrogen content for respiration(g N/m2 leaf) - real(r8), intent (out) :: PSN !daily photosynthetic rate(g C/day/m2 leaf) - real(r8), intent (out) :: RESP !daily respiration rate(g C/day/m2 leaf) - !------------------------------------------------------------------------------------------------------------------------------- - !intermediate variables - real(r8) :: A !Gross photosynthetic rate (umol CO2/m2/s) - real(r8) :: Wc2Wj !ratio: Wc/Wj - real(r8) :: ELTRNabsorb !absorbed electron rate, umol electron/m2 leaf /s - real(r8) :: Jmaxb0act !base value of Jmax (umol/m2/s) - real(r8) :: theta_cj !interpolation coefficient - real(r8) :: theta !light absorption rate (0-1) - real(r8) :: Vcmaxnight !Vcmax during night (umol/m2/s) - real(r8) :: Wc !rubisco-limited photosynthetic rate (umol/m2/s) - real(r8) :: Wj !light limited photosynthetic rate (umol/m2/s) - real(r8) :: NUECHG !the nitrogen use efficiency change under current conidtions compared to reference climate conditions (25oC and 385 ppm ) - real(r8), parameter :: leaf_mr_vcm = 0.015_r8 !Scalar constant of leaf respiration with Vcmax (should use parameter in CanopyStateMod) - - theta_cj = 0.95_r8 - theta = 0.292_r8 / (1.0_r8 + 0.076_r8 / (Nlc * Cb)) - ELTRNabsorb = theta * PARi10 - Jmaxb0act = Jmaxb0 * FNCa * Fj - Jmax = Jmaxb0act + JmaxCoef * ELTRNabsorb - JmaxL = theta * PARimx10 / (sqrt(1.0_r8 + (theta * PARimx10 / Jmax)**2.0_r8)) - NUEchg = (NUEc / NUEcref) * (NUEjref / NUEj) - Wc2Wj = Wc2Wjb0 * (NUEchg**0.5_r8) - Wc2Wj = min(1.0_r8, Wc2Wj) - Vcmax = Wc2Wj * JmaxL * Kj2Kc - JmeanL = theta * PARi10 / (sqrt(1.0_r8 + (ELTRNabsorb / Jmax)**2.0_r8)) - if(KcKjFlag.eq.0)then !update the Kc,Kj, anc ci information - call Photosynthesis_luna(forc_pbot10, tleafd10, relh10, CO2a10, O2a10,rb10, Vcmax, JmeanL, ci, Kc, Kj, A) - else - Wc = Kc * Vcmax - Wj = Kj * JmeanL - A = (1.0_r8 - theta_cj) * max(Wc, Wj) + theta_cj * min(Wc, Wj) - endif - PSN = Cv * A * hourpd - Vcmaxnight = VcmxTKattge(tair10, tleafn10) / VcmxTKattge(tair10, tleafd10) * Vcmax - RESP = Cv * leaf_mr_vcm * (Vcmax * hourpd + Vcmaxnight * (24.0_r8 - hourpd)) - Net = Jmax / Fj - Ncb = Vcmax / Fc - Nresp = RESP / NUEr - -end subroutine Nitrogen_investments - - - -!******************************************************************************************************************** -! Calculate the photosynthesis by solving the following 3 equations for 3 unknowns (A, gs, Ci): Farquahr's non-linear equation (A versus Ci), -! Ball-Berry equation (gs versus A) and the diffusion equation (A = gs * (Ca - Ci). The approach taken is the following; Solve the 3 equations for -! two phases. First phase is where Rubisco is limiting (Wc <= Wj) and second phase is where light is limiting (Wj > Wc). - -subroutine Photosynthesis_luna(forc_pbot, tleafd, relh, CO2a,O2a, rb, Vcmax, JmeanL, ci, Kc, Kj, A) - implicit none - real(r8), intent (in) :: forc_pbot !air presure (Pa) - real(r8), intent (in) :: tleafd !daytime leaf temperature (oC) - real(r8), intent (in) :: relh !relative humidity (unitless) - real(r8), intent (in) :: CO2a !atmospheric CO2 partial pressure(Pa) - real(r8), intent (in) :: O2a !atmospheric O2 partial pressure(Pa) - real(r8), intent (in) :: rb !boundary layer resistance (s/m) - real(r8), intent (in) :: Vcmax !maximum carboxylation rate (umol/m2/s) - real(r8), intent (in) :: JmeanL !average electron transport rate (umol/m2/s) - real(r8), intent (out):: ci !inter-cellular CO2 concentration (ppm) - real(r8), intent (out):: Kc !conversion factors for Vc,max to Wc - real(r8), intent (out):: Kj !conversion factors for Jmax to Wj - real(r8), intent (out):: A !g dry mass photosynthesized per day - - !------------------------------------------------------------------------------------------------------------------------------- - !intermediate variables - real(r8) :: awc !second deminator term for rubsico limited carboxylation rate based on Farquhar model - real(r8) :: cf !conversion factor of resistance: m**2/umol -> s/m - real(r8) :: bp !maximum stomatal resistance - real(r8) :: mpe !plant functional type dependent parameter for stomatal conductance - real(r8) :: rs !stomatal resistance (s/m) - real(r8) :: r1 !root1 of quadratic equations - real(r8) :: r2 !root2 of quadratic equations - real(r8) :: Wc !rubisco-limited photosynthetic rate (umol/m2/s) - real(r8) :: Wj !light-limited photosynthetic rate (umol/m2/s) - real(r8) :: k_o !Michaelis-menten constant for O2 in Farquhar's model - real(r8) :: k_c !Michaelis-menten constant for CO2 in Farquhar's model - real(r8) :: CO2c !partial pressure of CO2 (Pa) - real(r8) :: O2c !partial pressure of oxygen (Pa) - real(r8) :: c_p !Michaelis-menten constant for Farquhar's model related to rubisco specificity factor - real(r8) :: tdayk !daytime temperature in Kelvin - real(r8) :: ciold !old value of inter-cellular CO2 concentration for convergence check - real(r8) :: bbb !Ball-Berry minimum leaf conductance (umol H20/m2/s) - real(r8) :: mbb !Ball-Berry slope of conductance photosynthesis relationship (stressed) - real(r8) :: gs_mol !leaf stomatal conductance (umol H20/m2/s) - real(r8) :: gb_mol !leaf boundary layer conductance (umol H20/m2/s) - real(r8) :: aquad !terms of quadratic equations - real(r8) :: bquad !terms of quadratic equations - real(r8) :: cquad !terms of quadratic equations - real(r8) :: phi !terms of quadratic equations - real(r8) :: rsmax0 !maximum stomata conductance (s/m) - real(r8) :: tleaf !daytime leaf temperature (oC) - real(r8) :: tleafk !the temperature of the leaf in Kelvin - real(r8) :: theta_cj !the interpolation coefficient for Wj and Wc - real(r8) :: relhc !constrained relative humidity (unitless) - integer :: i !index record the number of iterations - - theta_cj = 0.95_r8 - rsmax0 = 2.0_r8 * 1.0e4_r8 - bp = 2000.0_r8 - tleaf = tleafd - tleafk = tleaf + tfrz - aquad = 1.0_r8 - relhc = max(minrelh, relh) - bbb = 1.0_r8 / bp - mbb = mp - CO2c = CO2a - O2c = O2a - ci = 0.7_r8 * CO2c - ciold = ci - 0.02_r8 - cf = forc_pbot / (8.314_r8 * tleafk) * 1.0e6_r8 - gb_mol = cf / rb - k_c = kc25 * exp((79430.0_r8 / (8.314_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - k_o = ko25 * exp((36380.0_r8 / (8.314_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - c_p = Cp25 * exp((37830.0_r8 / (8.314_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25_r8) / (tfrz + tleaf))) - awc = k_c * (1.0_r8 + O2c / k_o) - i = 1 - do while (abs(ci - ciold) > 0.01_r8 .and. i < 100) ! for RUBISCO limitation - i = i + 1 - ciold = ci - Kc = max(ci - c_p, 0.0_r8) / (ci + awc) - Wc = Kc * Vcmax - gs_mol = bbb + mbb * Wc / CO2c * forc_pbot * relhc - phi = forc_pbot * (1.37_r8 * gs_mol + 1.6_r8 * gb_mol) / (gb_mol * gs_mol) - bquad = awc - CO2c + phi * Vcmax - cquad = -(c_p * phi * Vcmax + awc * CO2c) - call Quadratic(aquad, bquad, cquad, r1, r2) - ci = max(r1, r2) - if (ci < 0.0_r8) ci = c_p + 0.5_r8 * ciold - end do - Kj = max(ci - c_p, 0.0_r8) / (4.0_r8 * ci + 8.0_r8 * c_p) - Kc = max(ci - c_p, 0.0_r8) / (ci + awc) - Wc = Kc * Vcmax - Wj = Kj * JmeanL - ciold = ci - 0.02_r8 - if (Wj < Wc) then !light limitation - i = 1 - do while (abs(ci - ciold) > 0.01_r8 .and. i < 100) - i = i + 1 - ciold = ci - gs_mol = bbb + mbb * Wj / CO2c * forc_pbot * relhc - phi = forc_pbot * (1.37_r8 * gs_mol + 1.6_r8 * gb_mol) / (gb_mol * gs_mol) - bquad = 2.0_r8 * c_p - CO2c + phi * JmeanL / 4.0_r8 - cquad = -(c_p * phi * JmeanL / 4.0_r8 + 2.0_r8 * c_p * CO2c) - call Quadratic(aquad, bquad, cquad, r1, r2) - ci = max(r1, r2) - if (ci < 0.0_r8) ci = c_p + 0.5_r8 * ciold - Kj = max(ci - c_p, 0.0_r8) / (4.0_r8 * ci + 8.0_r8 * c_p) - Wj = Kj * JmeanL - end do - Kj = max(ci - c_p, 0.0_r8) / (4.0_r8 * ci + 8.0_r8 * c_p) - Kc = max(ci - c_p, 0.0_r8) / (ci + awc) - Wc = Kc * Vcmax - Wj = Kj * JmeanL - end if - A = (1.0_r8 - theta_cj) * max(Wc, Wj) + theta_cj * min(Wc, Wj) !use this instead of the quadratic to avoid values not in the range of wc and wj - rs = cf / gs_mol - rs = min(rsmax0, rs) - -end subroutine Photosynthesis_luna - - - -!********************************************************************************************************************************************************************** -!Calculate the reference nitrogen use effieciency dependence on CO2 and leaf temperature - -subroutine NUEref(NUEjref,NUEcref,Kj2Kcref) - implicit none - real(r8), intent (out):: NUEjref !nitrogen use efficiency for electron transport under refernce environmental conditions (25oC and 385 ppm co2) - real(r8), intent (out):: NUEcref !nitrogen use efficiency for carboxylation under reference environmental conditions (25oC and 385 ppm co2) - real(r8), intent (out):: Kj2Kcref !the ratio of Wc to Wj under reference (25oC and 385 ppm co2) conditions - !--------------------------------------------- - !intermediate variables - real(r8) :: Fj !the temperature adjust factor for Jmax - real(r8) :: Fc !the temperatuer adjust factor for Vcmax - real(r8) :: tgrow !10 day mean growth temperature (oC), 24 hour mean temperature - real(r8) :: tleaf !leaf temperature (oC) - real(r8) :: CO2c !CO2 concentration (ppm) - real(r8) :: O2c !O2 concentration (ppm) - real(r8) :: k_o !Rubsico O2 specifity - real(r8) :: k_c !Rubsico CO2 specifity - real(r8) :: awc !second deminator term for rubsico limited carboxylation rate based on Farquhar model - real(r8) :: c_p !CO2 compenstation point (Pa) - real(r8) :: ci !leaf internal [CO2] (Pa) - real(r8) :: Kc !converstion factor from Vcmax to Wc - real(r8) :: Kj !converstion factor from J to Wc - - tgrow = 25.0_r8 - tleaf = 25.0_r8 - Fc = VcmxTKattge(tgrow, tleaf) * Fc25 - Fj = JmxTKattge(tgrow, tleaf) * Fj25 - CO2c = co2ref * forc_pbot_ref * 1.0e-6_r8 !pa - O2c = O2ref * forc_pbot_ref * 1.0e-6_r8 !pa - k_c = Kc25 * exp((79430.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - k_o = Ko25 * exp((36380.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - c_p = Cp25 * exp((37830.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - awc = k_c * (1.0_r8+O2c/k_o) - ci = 0.7_r8 * CO2c - Kj = max( ci-c_p,0.0_r8 ) / ( 4.0_r8*ci + 8.0_r8*c_p ) - Kc = max( ci-c_p,0.0_r8 ) / (ci+awc) - NUEjref = Kj * Fj - NUEcref = Kc * Fc - Kj2Kcref = Kj / Kc - -end subroutine NUEref - - -!******************************************************************************************************************** -!Calculate the Nitrogen use effieciency dependence on CO2 and leaf temperature - -subroutine NUE(O2a, ci, tgrow, tleaf, NUEj,NUEc,Kj2Kc) - implicit none - real(r8), intent (in) :: o2a !air O2 partial presuure (Pa) - real(r8), intent (in) :: ci !leaf inter-cellular [CO2] (PPM) - real(r8), intent (in) :: tgrow !10 day growth temperature (oC), 24 hour mean temperature - real(r8), intent (in) :: tleaf !leaf temperature (oC) - real(r8), intent (out):: NUEj !nitrogen use efficiency for electron transport under refernce environmental conditions (25oC and 385 ppm co2) - real(r8), intent (out):: NUEc !nitrogen use efficiency for carboxylation under reference environmental conditions (25oC and 385 ppm co2) - real(r8), intent (out):: Kj2Kc !the ratio of Kj to Kc - !------------------------------------------------ - !intermediate variables - real(r8) :: Fj !the temperatuer adjust factor for Jmax - real(r8) :: Fc !the temperatuer adjust factor for Vcmax - real(r8) :: Kc !conversion factor from Vcmax to Wc - real(r8) :: Kj !conversion factor from J to W - real(r8) :: k_o !Rubsico O2 specifity - real(r8) :: k_c !Rubsico CO2 specifity - real(r8) :: awc !second deminator term for rubsico limited carboxylation rate based on Farquhar model - real(r8) :: c_p !CO2 compenstation point (Pa) - - Fc = VcmxTKattge(tgrow, tleaf) * Fc25 - Fj = JmxTKattge(tgrow, tleaf) * Fj25 - k_c = Kc25 * exp((79430.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - k_o = Ko25 * exp((36380.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - c_p = Cp25 * exp((37830.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - awc = k_c * ( 1.0_r8 + O2a/k_o ) - Kj = max( ci-c_p,0.0_r8 ) / ( 4.0_r8*ci + 8.0_r8*c_p ) - Kc = max( ci-c_p,0.0_r8 ) / ( ci+awc ) - NUEj = Kj * Fj - NUEc = Kc * Fc - Kj2Kc = Kj / Kc -end subroutine NUE - -!************************************************************************************************************************************************ -!Calculate the temperature response for Vcmax; assuming temperature acclimation as in CLM4.5, based on Kattge and Knorr 2007 - -real(r8) function VcmxTKattge(tgrow, tleaf) - implicit none - real(r8), intent(in):: tgrow !daytime and nightime growth temperature (oC) - real(r8), intent(in):: tleaf !leaf temperature (oC) - real(r8) :: TlimVcmx !Vcmax activation energy - real(r8) :: Vcmxf1 !Vcmax coef1 - real(r8) :: Vcmxf2 !Vcmax coef2 - real(r8) :: Vcmxf3 !Vcmax coef3 - - TlimVcmx = 668.39_r8- 1.07_r8 * (min(max(tgrow, 11.0_r8), 35.0_r8)) - Vcmxf1 = 1.0_r8 + exp((TlimVcmx * (25.0_r8 + tfrz) - 200000.0_r8) / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) - Vcmxf2 = exp((72000.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1.0_r8 - (tfrz+ 25.0_r8) / (tfrz + tleaf))) - Vcmxf3 = 1.0_r8 + exp((TlimVcmx * (tleaf + tfrz) - 200000.0_r8) / (rgas*1.e-3_r8 * (tleaf + tfrz))) - VcmxTKattge = Vcmxf1 * Vcmxf2 / Vcmxf3 - -end function VcmxTKattge - -!************************************************************************************************************************************************ -!Calculate the temperature response for Jmax; assuming temperature acclimation as in CLM4.5, based on Kattge and Knorr 2007 - -real(r8) function JmxTKattge(tgrow, tleaf) - implicit none - real(r8), intent(in):: tgrow !daytime and nightime growth temperature (oC) - real(r8), intent(in):: tleaf !leaf temperature (oC) - real(r8) :: TlimJmx !Jmax activation energy - real(r8) :: Jmxf1 !Jmax coef1 - real(r8) :: Jmxf2 !Jmax coef2 - real(r8) :: Jmxf3 !Jmax coef3 - - TlimJmx = 659.7_r8 - 0.75_r8 * (min(max(tgrow, 11.0_r8), 35.0_r8)) - Jmxf1 = 1.0_r8 + exp((TlimJmx * (25.0_r8 + tfrz) - 200000.0_r8) / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) - Jmxf2 = exp((50000.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1._r8 - (tfrz + 25.0_r8) / (tleaf+tfrz))) - Jmxf3 = 1.0_r8 + exp((TlimJmx * (tleaf + tfrz) - 200000.0_r8) / (rgas*1.e-3_r8 * (tleaf + tfrz))) - JmxTKattge = Jmxf1 * Jmxf2 / Jmxf3 - -end function JmxTKattge - -!******************************************************************************************************************** -!Calculate the temperature response for Vcmax; without assuming temperature acclimation and following Leunning 2002 Plant, Cell & Environment - -real(r8) function VcmxTLeuning(tgrow, tleaf) - implicit none - real(r8), intent(in) :: tgrow !daytime and nightime growth temperature (oC) - real(r8), intent(in) :: tleaf !leaf temperature (oC) - real(r8) :: TlimVcmx !Vcmax activation energy - real(r8) :: Vcmxf1 !Vcmax coef1 - real(r8) :: Vcmxf2 !Vcmax coef2 - real(r8) :: Vcmxf3 !Vcmax coef3 - - TlimVcmx = 486.0_r8 - Vcmxf1 = 1.0_r8 + exp((TlimVcmx * (25.0_r8 + tfrz) - 149252.0_r8) / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) - Vcmxf2 = exp((73637.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1._r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - Vcmxf3 = 1.0_r8 + exp((TlimVcmx * (tleaf + tfrz) - 149252.0_r8) / (rgas*1.e-3_r8 * (tleaf + tfrz))) - VcmxTLeuning = Vcmxf1 * Vcmxf2 / Vcmxf3 - -end function VcmxTLeuning - -!******************************************************************************************************************** -!Calculate the temperature response for Jmax; without assuming temperature acclimation and following Leunning 2002 Plant, Cell & Environment -real(r8) function JmxTLeuning(tgrow, tleaf) - implicit none - real(r8), intent(in):: tgrow !daytime and nightime growth temperature (oC) - real(r8), intent(in):: tleaf !leaf temperature (oC) - real(r8) :: TlimJmx !Jmax activation energy - real(r8) :: Jmxf1 !Jmax coef1 - real(r8) :: Jmxf2 !Jmax coef2 - real(r8) :: Jmxf3 !Jmax coef3 - - TlimJmx = 495.0_r8 - Jmxf1 = 1.0_r8 + exp((TlimJmx * (25.0_r8 + tfrz) - 152044.0_r8) / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) - Jmxf2 = exp((50300.0_r8 / (rgas*1.e-3_r8 * (25.0_r8 + tfrz))) * (1._r8 - (tfrz + 25.0_r8) / (tfrz + tleaf))) - Jmxf3 = 1.0_r8 + exp((TlimJmx * (tleaf + tfrz) - 152044.0_r8) / (rgas*1.e-3_r8 * (tleaf + tfrz))) - JmxTLeuning = Jmxf1 * Jmxf2 / Jmxf3 - -end function JmxTLeuning - -!******************************************************************************************************************** -!Calculate the temperature response for respiration, following Bernacchi PCE 2001 - -real(r8) function RespTBernacchi(tleaf) - implicit none - real(r8), intent(in):: tleaf !leaf temperature (oC) - RespTBernacchi= exp(18.72_r8-46.39_r8/(rgas*1.e-6_r8 *(tleaf+tfrz))) - -end function RespTBernacchi - - -!******************************************************************************************************************** -!Calculate the soultion using the quadratic formula - -subroutine Quadratic(a,b,c,r1,r2) - implicit none - real(r8), intent(in) :: a !coefficient a - real(r8), intent(in) :: b !coefficient b - real(r8), intent(in) :: c !coefficient c - real(r8), intent(out) :: r1 !root one - real(r8), intent(out) :: r2 !root one - real(r8) :: q ! temporary term for quadratic solution - - r1 = 1.0e36_r8 - r2 = 1.0e36_r8 - - if (a == 0.0_r8) return - - if (b .GE. 0.0_r8) then - q = -0.5_r8 * (b + sqrt(b*b - 4.0_r8*a*c)) - else - q = -0.5_r8 * (b - sqrt(b*b - 4.0_r8*a*c)) - end if - - r1 = q / a - - if (q .NE. 0.0_r8)then - r2 = c / q - else - r2 = 1.0e36_r8 - end if - -end subroutine Quadratic - - -end module LunaMod - diff --git a/src/biogeophys/OzoneBaseMod.F90 b/src/biogeophys/OzoneBaseMod.F90 deleted file mode 100644 index c50818f380..0000000000 --- a/src/biogeophys/OzoneBaseMod.F90 +++ /dev/null @@ -1,146 +0,0 @@ -module OzoneBaseMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Define the interface for ozone_type, which calculates ozone-induced stress. The type - ! defined here is abstract; it will get instantiated as a concrete type that extends - ! this base type (e.g., an ozone-off or ozone-on version). - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - - implicit none - save - private - - ! !PUBLIC TYPES: - type, abstract, public :: ozone_base_type - private - - ! Public data members - ! These should be treated as read-only by other modules (except that they can be - ! modified by extensions of the ozone_base_type) - real(r8), pointer, public :: o3coefvsha_patch(:) ! ozone coefficient for photosynthesis, shaded leaves (0 - 1) - real(r8), pointer, public :: o3coefvsun_patch(:) ! ozone coefficient for photosynthesis, sunlit leaves (0 - 1) - real(r8), pointer, public :: o3coefgsha_patch(:) ! ozone coefficient for conductance, shaded leaves (0 - 1) - real(r8), pointer, public :: o3coefgsun_patch(:) ! ozone coefficient for conductance, sunlit leaves (0 - 1) - - - contains - ! The following routines need to be implemented by all type extensions - procedure(Init_interface) , public, deferred :: Init - procedure(Restart_interface) , public, deferred :: Restart - procedure(CalcOzoneStress_interface) , public, deferred :: CalcOzoneStress - - ! The following routines should only be called by extensions of the ozone_base_type - procedure, public :: InitAllocateBase - procedure, public :: InitColdBase - - end type ozone_base_type - - abstract interface - - subroutine Init_interface(this, bounds) - use decompMod, only : bounds_type - import :: ozone_base_type - - class(ozone_base_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - end subroutine Init_interface - - subroutine Restart_interface(this, bounds, ncid, flag) - use decompMod , only : bounds_type - use ncdio_pio , only : file_desc_t - import :: ozone_base_type - - class(ozone_base_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read', 'write' or 'define' - end subroutine Restart_interface - - subroutine CalcOzoneStress_interface(this, bounds, num_exposedvegp, filter_exposedvegp, & - forc_pbot, forc_th, rssun, rssha, rb, ram, tlai) - use decompMod , only : bounds_type - use shr_kind_mod , only : r8 => shr_kind_r8 - import :: ozone_base_type - - class(ozone_base_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg - real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa) - real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K) - real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m) - real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m) - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) - real(r8) , intent(in) :: ram( bounds%begp: ) ! aerodynamical resistance (s/m) - real(r8) , intent(in) :: tlai( bounds%begp: ) ! one-sided leaf area index, no burying by snow - end subroutine CalcOzoneStress_interface - - end interface - -contains - - !----------------------------------------------------------------------- - subroutine InitAllocateBase(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate variables in the base class - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(ozone_base_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitAllocateBase' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - allocate(this%o3coefvsha_patch(begp:endp)) ; this%o3coefvsha_patch(:) = nan - allocate(this%o3coefvsun_patch(begp:endp)) ; this%o3coefvsun_patch(:) = nan - allocate(this%o3coefgsha_patch(begp:endp)) ; this%o3coefgsha_patch(:) = nan - allocate(this%o3coefgsun_patch(begp:endp)) ; this%o3coefgsun_patch(:) = nan - - end subroutine InitAllocateBase - - - !----------------------------------------------------------------------- - subroutine InitColdBase(this, bounds) - ! - ! !DESCRIPTION: - ! Do cold start initialization for variables in the base class. Note that this - ! initialization will be the same for all ozone implementations, including the - ! ozone-off implementation. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(ozone_base_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitColdBase' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - this%o3coefvsha_patch(begp:endp) = 1._r8 - this%o3coefvsun_patch(begp:endp) = 1._r8 - this%o3coefgsha_patch(begp:endp) = 1._r8 - this%o3coefgsun_patch(begp:endp) = 1._r8 - - end subroutine InitColdBase - -end module OzoneBaseMod diff --git a/src/biogeophys/OzoneFactoryMod.F90 b/src/biogeophys/OzoneFactoryMod.F90 deleted file mode 100644 index 2b28587a99..0000000000 --- a/src/biogeophys/OzoneFactoryMod.F90 +++ /dev/null @@ -1,53 +0,0 @@ -module OzoneFactoryMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Factory to create an instance of ozone_base_type. This module figures out the - ! particular type to return. - ! - ! !USES: - use decompMod , only : bounds_type - - implicit none - save - private - - ! - ! !PUBLIC ROUTINES: - public :: create_and_init_ozone_type ! create an object of class ozone_base_type - -contains - - !----------------------------------------------------------------------- - function create_and_init_ozone_type(bounds) result(ozone) - ! - ! !DESCRIPTION: - ! Create and initialize an object of ozone_base_type, and return this object. The - ! particular type is determined based on the use_ozone namelist parameter. - ! - ! !USES: - use clm_varctl , only : use_ozone - use OzoneBaseMod , only : ozone_base_type - use OzoneOffMod , only : ozone_off_type - use OzoneMod , only : ozone_type - ! - ! !ARGUMENTS: - class(ozone_base_type), allocatable :: ozone ! function result - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'create_and_init_ozone_type' - !----------------------------------------------------------------------- - - if (use_ozone) then - allocate(ozone, source = ozone_type()) - else - allocate(ozone, source = ozone_off_type()) - end if - - call ozone%Init(bounds) - - end function create_and_init_ozone_type - -end module OzoneFactoryMod diff --git a/src/biogeophys/OzoneMod.F90 b/src/biogeophys/OzoneMod.F90 deleted file mode 100644 index 29b94fa34f..0000000000 --- a/src/biogeophys/OzoneMod.F90 +++ /dev/null @@ -1,543 +0,0 @@ -module OzoneMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates ozone-induced stress. - ! - ! Note that the ozone calculations need to happen AFTER rssun and rsshade are computed - ! by the Photosynthesis routine. However, Photosynthesis also uses the ozone stress - ! computed here. Thus, the ozone stress computed in timestep i is applied in timestep - ! (i+1), requiring these stresses to be saved on the restart file. - ! - ! Developed by Danica Lombardozzi. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod, only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varcon , only : spval - use shr_log_mod , only : errMsg => shr_log_errMsg - use OzoneBaseMod, only : ozone_base_type - use abortutils , only : endrun - - implicit none - save - private - - ! !PUBLIC TYPES: - type, extends(ozone_base_type), public :: ozone_type - private - ! Private data members - real(r8), pointer :: o3uptakesha_patch(:) ! ozone dose, shaded leaves (mmol O3/m^2) - real(r8), pointer :: o3uptakesun_patch(:) ! ozone dose, sunlit leaves (mmol O3/m^2) - - ! NOTE(wjs, 2014-09-29) tlai_old_patch really belongs alongside tlai_patch in - ! CanopyStateType. But there are problems with any way I can think to implement - ! that: - ! - ! - Updating tlai_old from a call in clm_driver, just before tlai is updated: This - ! is problematic to do correctly because tlai is updated in different places - ! depending on whether you're using SP, CN or ED. - ! - ! - Updating tlai_old within each routine that updates tlai: This feels fragile, - ! since it depends on each scheme remembering to do this update at the correct - ! time. - ! - ! - Making tlai a private member of CanopyFluxes, with getter and setter methods. - ! Then the setter method would also set tlai_old. This feels like the most robust - ! solution, but we don't have any precedent for using getters and setters for data - ! arrays. - real(r8), pointer :: tlai_old_patch(:) ! tlai from last time step - - contains - ! Public routines - procedure, public :: Init - procedure, public :: Restart - procedure, public :: CalcOzoneStress - - ! Private routines - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - ! Calculate ozone stress for a single point, for just sunlit or shaded leaves - procedure, private, nopass :: CalcOzoneStressOnePoint - end type ozone_type - - interface ozone_type - module procedure constructor - end interface ozone_type - - ! !PRIVATE TYPES: - - ! TODO(wjs, 2014-09-29) This parameter will eventually become a spatially-varying - ! value, obtained from ATM - real(r8), parameter :: forc_ozone = 100._r8 * 1.e-9_r8 ! ozone partial pressure [mol/mol] - - ! TODO(wjs, 2014-09-29) The following parameters should eventually be moved to the - ! params file. Parameters differentiated on veg type should be put on the params file - ! with a pft dimension. - - ! o3:h2o resistance ratio defined by Sitch et al. 2007 - real(r8), parameter :: ko3 = 1.67_r8 - - ! LAI threshold for LAIs that asymptote and don't reach 0 - real(r8), parameter :: lai_thresh = 0.5_r8 - - ! threshold below which o3flux is set to 0 (nmol m^-2 s^-1) - real(r8), parameter :: o3_flux_threshold = 0.8_r8 - - ! o3 intercepts and slopes for photosynthesis - real(r8), parameter :: needleleafPhotoInt = 0.8390_r8 ! units = unitless - real(r8), parameter :: needleleafPhotoSlope = 0._r8 ! units = per mmol m^-2 - real(r8), parameter :: broadleafPhotoInt = 0.8752_r8 ! units = unitless - real(r8), parameter :: broadleafPhotoSlope = 0._r8 ! units = per mmol m^-2 - real(r8), parameter :: nonwoodyPhotoInt = 0.8021_r8 ! units = unitless - real(r8), parameter :: nonwoodyPhotoSlope = -0.0009_r8 ! units = per mmol m^-2 - - ! o3 intercepts and slopes for conductance - real(r8), parameter :: needleleafCondInt = 0.7823_r8 ! units = unitless - real(r8), parameter :: needleleafCondSlope = 0.0048_r8 ! units = per mmol m^-2 - real(r8), parameter :: broadleafCondInt = 0.9125_r8 ! units = unitless - real(r8), parameter :: broadleafCondSlope = 0._r8 ! units = per mmol m^-2 - real(r8), parameter :: nonwoodyCondInt = 0.7511_r8 ! units = unitless - real(r8), parameter :: nonwoodyCondSlope = 0._r8 ! units = per mmol m^-2 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Infrastructure routines (initialization, restart, etc.) - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor() result(ozone) - ! - ! !DESCRIPTION: - ! Return an instance of ozone_type - ! - ! !USES: - ! - ! !ARGUMENTS: - type(ozone_type) :: ozone ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - ! DO NOTHING (simply return a variable of the appropriate type) - - ! Eventually this should call the Init routine (or replace the Init routine - ! entirely). But I think it would be confusing to do that until we switch everything - ! to use a constructor rather than the init routine. - - end function constructor - - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize ozone data structure - ! - ! !ARGUMENTS: - class(ozone_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate memory for ozone data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(ozone_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - call this%InitAllocateBase(bounds) - - allocate(this%o3uptakesha_patch(begp:endp)) ; this%o3uptakesha_patch(:) = nan - allocate(this%o3uptakesun_patch(begp:endp)) ; this%o3uptakesun_patch(:) = nan - allocate(this%tlai_old_patch(begp:endp)) ; this%tlai_old_patch(:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize ozone history variables - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(ozone_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - this%o3uptakesun_patch(begp:endp) = spval - call hist_addfld1d (fname='O3UPTAKESUN', units='mmol/m^2', & - avgflag='A', long_name='total ozone flux into sunlit leaves', & - ptr_patch=this%o3uptakesun_patch) - - this%o3uptakesha_patch(begp:endp) = spval - call hist_addfld1d (fname='O3UPTAKESHA', units='mmol/m^2', & - avgflag='A', long_name='total ozone flux into shaded leaves', & - ptr_patch=this%o3uptakesha_patch) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Perform cold-start initialization for ozone - ! - ! !ARGUMENTS: - class(ozone_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - begp = bounds%begp - endp = bounds%endp - - call this%InitColdBase(bounds) - - this%o3uptakesha_patch(begp:endp) = 0._r8 - this%o3uptakesun_patch(begp:endp) = 0._r8 - this%tlai_old_patch(begp:endp) = 0._r8 - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Handle restart of ozone variables. - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_inqvdlen, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(ozone_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read', 'write' or 'define' - ! - ! !LOCAL VARIABLES: - logical :: readvar - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='o3_tlaiold', xtype=ncd_double, & - dim1name='pft', & - long_name='one-sided leaf area index, from previous timestep, for ozone calculations', units='', & - readvar=readvar, interpinic_flag='interp', data=this%tlai_old_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3uptakesha', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone uptake for shaded leaves', units='mmol m^-3', & - readvar=readvar, interpinic_flag='interp', data=this%o3uptakesha_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3uptakesun', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone uptake for sunlit leaves', units='mmol m^-3', & - readvar=readvar, interpinic_flag='interp', data=this%o3uptakesun_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3coefvsun', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone coefficient for photosynthesis for sunlit leaves', units='unitless', & - readvar=readvar, interpinic_flag='interp', data=this%o3coefvsun_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3coefgsun', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone coefficient for stomatal conductance for sunlit leaves', units='unitless', & - readvar=readvar, interpinic_flag='interp', data=this%o3coefgsun_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3coefvsha', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone coefficient for photosynthesis for shaded leaves', units='unitless', & - readvar=readvar, interpinic_flag='interp', data=this%o3coefvsha_patch) - - call restartvar(ncid=ncid, flag=flag, varname='o3coefgsha', xtype=ncd_double, & - dim1name='pft', & - long_name='ozone coefficient for stomatal conductance for shaded leaves', units='unitless', & - readvar=readvar, interpinic_flag='interp', data=this%o3coefgsha_patch) - - end subroutine Restart - - ! ======================================================================== - ! Science routines - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, & - forc_pbot, forc_th, rssun, rssha, rb, ram, tlai) - ! - ! !DESCRIPTION: - ! Calculate ozone stress. - ! - ! !USES: - use PatchType , only : patch - ! - ! !ARGUMENTS: - class(ozone_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg - real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa) - real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K) - real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m) - real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m) - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) - real(r8) , intent(in) :: ram( bounds%begp: ) ! aerodynamical resistance (s/m) - real(r8) , intent(in) :: tlai( bounds%begp: ) ! one-sided leaf area index, no burying by snow - ! - ! !LOCAL VARIABLES: - integer :: fp ! filter index - integer :: p ! patch index - integer :: c ! column index - - character(len=*), parameter :: subname = 'CalcOzoneStress' - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(forc_pbot) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(forc_th) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rssun) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rssha) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ram) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tlai) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - o3coefvsha => this%o3coefvsha_patch , & ! Output: [real(r8) (:)] ozone coef - o3coefvsun => this%o3coefvsun_patch , & ! Output: [real(r8) (:)] ozone coef - o3coefgsha => this%o3coefgsha_patch , & ! Output: [real(r8) (:)] ozone coef - o3coefgsun => this%o3coefgsun_patch , & ! Output: [real(r8) (:)] ozone coef - o3uptakesha => this%o3uptakesha_patch , & ! Output: [real(r8) (:)] ozone dose - o3uptakesun => this%o3uptakesun_patch , & ! Output: [real(r8) (:)] ozone dose - tlai_old => this%tlai_old_patch & ! Output: [real(r8) (:)] tlai from last time step - ) - - do fp = 1, num_exposedvegp - p = filter_exposedvegp(fp) - c = patch%column(p) - -! if (.not.patch%is_fates(p)) then ! When FATES coexists with other vegetation, - ! or when it has an ozone compatible module, this - ! logic will likely come into play - - ! Ozone stress for shaded leaves - call CalcOzoneStressOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssha(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesha(p), o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p)) - - ! Ozone stress for sunlit leaves - call CalcOzoneStressOnePoint( & - forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), & - rs=rssun(p), rb=rb(p), ram=ram(p), & - tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), & - o3uptake=o3uptakesun(p), o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p)) - - tlai_old(p) = tlai(p) - -! else -! ! FATES is fundamentlaly incompatible with this type of patch-level -! ! association with plant functional type, so for the time -! ! being, fates patches will just push these values to invalid -! o3uptakesha(p) = spval -! o3coefvsha(p) = spval -! o3coefgsha(p) = spval -! o3uptakesun(p) = spval -! o3coefvsun(p) = spval -! o3coefgsun(p) = spval -! -! end if - -! else -! ! FATES is fundamentlaly incompatible with this type of patch-level -! ! association with plant functional type, so for the time -! ! being, fates patches will just push these values to invalid -! o3uptakesha(p) = spval -! o3coefvsha(p) = spval -! o3coefgsha(p) = spval -! o3uptakesun(p) = spval -! o3coefvsun(p) = spval -! o3coefgsun(p) = spval -! -! end if - - end do - - end associate - - end subroutine CalcOzoneStress - - !----------------------------------------------------------------------- - subroutine CalcOzoneStressOnePoint( & - forc_ozone, forc_pbot, forc_th, & - rs, rb, ram, & - tlai, tlai_old, pft_type, & - o3uptake, o3coefv, o3coefg) - ! - ! !DESCRIPTION: - ! Calculates ozone stress for a single point, for just sunlit or shaded leaves - ! - ! !USES: - use shr_const_mod , only : SHR_CONST_RGAS - use pftconMod , only : pftcon - use clm_time_manager , only : get_step_size - ! - ! !ARGUMENTS: - real(r8) , intent(in) :: forc_ozone ! ozone partial pressure (mol/mol) - real(r8) , intent(in) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) , intent(in) :: forc_th ! atmospheric potential temperature (K) - real(r8) , intent(in) :: rs ! leaf stomatal resistance (s/m) - real(r8) , intent(in) :: rb ! boundary layer resistance (s/m) - real(r8) , intent(in) :: ram ! aerodynamical resistance (s/m) - real(r8) , intent(in) :: tlai ! one-sided leaf area index, no burying by snow - real(r8) , intent(in) :: tlai_old ! tlai from last time step - integer , intent(in) :: pft_type ! vegetation type, for indexing into pftvarcon arrays - real(r8) , intent(inout) :: o3uptake ! ozone entering the leaf - real(r8) , intent(out) :: o3coefv ! ozone coefficient for photosynthesis (0 - 1) - real(r8) , intent(out) :: o3coefg ! ozone coefficient for conductance (0 - 1) - ! - ! !LOCAL VARIABLES: - integer :: dtime ! land model time step (sec) - real(r8) :: dtimeh ! time step in hours - real(r8) :: o3concnmolm3 ! o3 concentration (nmol/m^3) - real(r8) :: o3flux ! instantaneous o3 flux (nmol m^-2 s^-1) - real(r8) :: o3fluxcrit ! instantaneous o3 flux beyond threshold (nmol m^-2 s^-1) - real(r8) :: o3fluxperdt ! o3 flux per timestep (mmol m^-2) - real(r8) :: heal ! o3uptake healing rate based on % of new leaves growing (mmol m^-2) - real(r8) :: leafturn ! leaf turnover time / mortality rate (per hour) - real(r8) :: decay ! o3uptake decay rate based on leaf lifetime (mmol m^-2) - real(r8) :: photoInt ! intercept for photosynthesis - real(r8) :: photoSlope ! slope for photosynthesis - real(r8) :: condInt ! intercept for conductance - real(r8) :: condSlope ! slope for conductance - - character(len=*), parameter :: subname = 'CalcOzoneStressOnePoint' - !----------------------------------------------------------------------- - - ! convert o3 from mol/mol to nmol m^-3 - o3concnmolm3 = forc_ozone * 1.e9_r8 * (forc_pbot/(forc_th*SHR_CONST_RGAS*0.001_r8)) - - ! calculate instantaneous flux - o3flux = o3concnmolm3/ (ko3*rs+ rb + ram) - - ! apply o3 flux threshold - if (o3flux < o3_flux_threshold) then - o3fluxcrit = 0._r8 - else - o3fluxcrit = o3flux - o3_flux_threshold - endif - - dtime = get_step_size() - dtimeh = dtime / 3600._r8 - - ! calculate o3 flux per timestep - o3fluxperdt = o3fluxcrit * dtime * 0.000001_r8 - - if (tlai > lai_thresh) then - ! checking if new leaf area was added - if (tlai - tlai_old > 0) then - ! minimizing o3 damage to new leaves - heal = max(0._r8,(((tlai-tlai_old)/tlai)*o3fluxperdt)) - else - heal = 0._r8 - endif - - if (pftcon%evergreen(pft_type) == 1) then - leafturn = 1._r8/(pftcon%leaf_long(pft_type)*365._r8*24._r8) - else - leafturn = 0._r8 - endif - - ! o3 uptake decay based on leaf lifetime for evergreen plants - decay = o3uptake * leafturn * dtimeh - !cumulative uptake (mmol m^-2) - o3uptake = max(0._r8, o3uptake + o3fluxperdt - decay - heal) - - else - o3uptake = 0._r8 - end if - - - if (o3uptake == 0._r8) then - ! No o3 damage if no o3 uptake - o3coefv = 1._r8 - o3coefg = 1._r8 - else - ! Determine parameter values for this pft - ! TODO(wjs, 2014-10-01) Once these parameters are moved into the params file, this - ! logic can be removed. - if (pft_type>3) then - if (pftcon%woody(pft_type)==0) then - photoInt = nonwoodyPhotoInt - photoSlope = nonwoodyPhotoSlope - condInt = nonwoodyCondInt - condSlope = nonwoodyCondSlope - else - photoInt = broadleafPhotoInt - photoSlope = broadleafPhotoSlope - condInt = broadleafCondInt - condSlope = broadleafCondSlope - end if - else - photoInt = needleleafPhotoInt - photoSlope = needleleafPhotoSlope - condInt = needleleafCondInt - condSlope = needleleafCondSlope - end if - - ! Apply parameter values to compute o3 coefficients - o3coefv = max(0._r8, min(1._r8, photoInt + photoSlope * o3uptake)) - o3coefg = max(0._r8, min(1._r8, condInt + condSlope * o3uptake)) - - end if - - end subroutine CalcOzoneStressOnePoint - - -end module OzoneMod diff --git a/src/biogeophys/OzoneOffMod.F90 b/src/biogeophys/OzoneOffMod.F90 deleted file mode 100644 index 8d0df71fd3..0000000000 --- a/src/biogeophys/OzoneOffMod.F90 +++ /dev/null @@ -1,118 +0,0 @@ -module OzoneOffMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Provides an implementatio of ozone_base_type for the ozone-off case. Note that very - ! little needs to be done in this case, so this module mainly provides empty - ! implementations to satisfy the interface. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use OzoneBaseMod, only : ozone_base_type - - implicit none - save - private - - ! !PUBLIC TYPES: - type, extends(ozone_base_type), public :: ozone_off_type - private - contains - procedure, public :: Init - procedure, public :: Restart - procedure, public :: CalcOzoneStress - end type ozone_off_type - - interface ozone_off_type - module procedure constructor - end interface ozone_off_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - function constructor() result(ozone_off) - ! - ! !DESCRIPTION: - ! Return an instance of ozone_off_type - ! - ! !USES: - ! - ! !ARGUMENTS: - type(ozone_off_type) :: ozone_off ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - ! DO NOTHING (simply return a variable of the appropriate type) - - ! Eventually this should call the Init routine (or replace the Init routine - ! entirely). But I think it would be confusing to do that until we switch everything - ! to use a constructor rather than the init routine. - - end function constructor - - - subroutine Init(this, bounds) - class(ozone_off_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - call this%InitAllocateBase(bounds) - call this%InitColdBase(bounds) - end subroutine Init - - subroutine Restart(this, bounds, ncid, flag) - use ncdio_pio , only : file_desc_t - - class(ozone_off_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read', 'write' or 'define' - - ! DO NOTHING - - end subroutine Restart - - subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, & - forc_pbot, forc_th, rssun, rssha, rb, ram, tlai) - - class(ozone_off_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp - integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg - real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa) - real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K) - real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m) - real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m) - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) - real(r8) , intent(in) :: ram( bounds%begp: ) ! aerodynamical resistance (s/m) - real(r8) , intent(in) :: tlai( bounds%begp: ) ! one-sided leaf area index, no burying by snow - - ! Enforce expected array sizes (mainly so that a debug-mode threaded test with - ! ozone-off can pick up problems with the call to this routine) - SHR_ASSERT_ALL((ubound(forc_pbot) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(forc_th) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rssun) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rssha) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ram) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tlai) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - ! Explicitly set outputs to 1. This isn't really needed, because they should still be - ! at 1 from cold-start initialization, but do this for clarity here. - - this%o3coefvsha_patch(bounds%begp:bounds%endp) = 1._r8 - this%o3coefvsun_patch(bounds%begp:bounds%endp) = 1._r8 - this%o3coefgsha_patch(bounds%begp:bounds%endp) = 1._r8 - this%o3coefgsun_patch(bounds%begp:bounds%endp) = 1._r8 - - end subroutine CalcOzoneStress - -end module OzoneOffMod diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 deleted file mode 100644 index e735d74ce0..0000000000 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ /dev/null @@ -1,4948 +0,0 @@ -module PhotosynthesisMod - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Leaf photosynthesis and stomatal conductance calculation as described by - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 and extended to - ! a multi-layer canopy - ! - ! !USES: - use shr_sys_mod , only : shr_sys_flush - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use abortutils , only : endrun - use clm_varctl , only : use_c13, use_c14, use_cn, use_cndv, use_fates, use_luna, use_hydrstress - use clm_varctl , only : iulog - use clm_varpar , only : nlevcan, nvegwcs, mxpft - use clm_varcon , only : namep, c14ratio, spval - use decompMod , only : bounds_type - use QuadraticMod , only : quadratic - use pftconMod , only : pftcon - use CIsoAtmTimeseriesMod, only : C14BombSpike, use_c14_bombspike, C13TimeSeries, use_c13_timeseries, nsectors_c14 - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use WaterStateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use OzoneBaseMod , only : ozone_base_type - use LandunitType , only : lun - use PatchType , only : patch - use GridcellType , only : grc - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: Photosynthesis ! Leaf stomatal resistance and leaf photosynthesis - public :: PhotosynthesisTotal ! Determine of total photosynthesis - public :: Fractionation ! C13 fractionation during photosynthesis - ! For plant hydraulics approach - public :: PhotosynthesisHydraulicStress ! Leaf stomatal resistance and leaf photosynthesis - ! Simultaneous solution of sunlit/shaded per Pierre - ! Gentine/Daniel Kennedy plant hydraulic stress method - public :: plc ! Return value of vulnerability curve at x - - ! !PRIVATE MEMBER FUNCTIONS: - private :: hybrid ! hybrid solver for ci - private :: ci_func ! ci function - private :: brent ! brent solver for root of a single variable function - private :: ft ! photosynthesis temperature response - private :: fth ! photosynthesis temperature inhibition - private :: fth25 ! scaling factor for photosynthesis temperature inhibition - ! For plant hydraulics approach - private :: hybrid_PHS ! hybrid solver for ci - private :: ci_func_PHS ! ci function - private :: brent_PHS ! brent solver for root of a single variable function - private :: calcstress ! compute the root water stress - private :: getvegwp ! calculate vegetation water potential (sun, sha, xylem, root) - private :: getqflx ! calculate sunlit and shaded transpiration - private :: spacF ! flux divergence across each vegetation segment - private :: spacA ! the inverse Jacobian matrix relating delta(vegwp) to f, d(vegwp)=A*f - private :: d1plc ! compute 1st deriv of conductance attenuation for each segment - - ! !PRIVATE DATA: - integer, parameter, private :: leafresp_mtd_ryan1991 = 1 ! Ryan 1991 method for lmr25top - integer, parameter, private :: leafresp_mtd_atkin2015 = 2 ! Atkin 2015 method for lmr25top - integer, parameter, private :: sun=1 ! index for sunlit - integer, parameter, private :: sha=2 ! index for shaded - integer, parameter, private :: xyl=3 ! index for xylem - integer, parameter, private :: root=4 ! index for root - integer, parameter, private :: veg=0 ! index for vegetation - integer, parameter, private :: soil=1 ! index for soil - integer, parameter, private :: stomatalcond_mtd_bb1987 = 1 ! Ball-Berry 1987 method for photosynthesis - integer, parameter, private :: stomatalcond_mtd_medlyn2011 = 2 ! Medlyn 2011 method for photosynthesis - ! !PUBLIC VARIABLES: - - type :: photo_params_type - real(r8), allocatable, public :: krmax (:) - real(r8), allocatable, private :: kmax (:,:) - real(r8), allocatable, private :: psi50 (:,:) - real(r8), allocatable, private :: ck (:,:) - real(r8), allocatable, public :: psi_soil_ref (:) - real(r8), allocatable, private :: lmr_intercept_atkin(:) - contains - procedure, private :: allocParams - end type photo_params_type - ! - type(photo_params_type), public, protected :: params_inst ! params_inst is populated in readParamsMod - - type, public :: photosyns_type - - logical , pointer, private :: c3flag_patch (:) ! patch true if C3 and false if C4 - ! Plant hydraulic stress specific variables - real(r8), pointer, private :: ac_phs_patch (:,:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: aj_phs_patch (:,:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: ap_phs_patch (:,:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: ag_phs_patch (:,:,:) ! patch co-limited gross leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: an_sun_patch (:,:) ! patch sunlit net leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: an_sha_patch (:,:) ! patch shaded net leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: vcmax_z_phs_patch (:,:,:) ! patch maximum rate of carboxylation (umol co2/m**2/s) - real(r8), pointer, private :: kp_z_phs_patch (:,:,:) ! patch initial slope of CO2 response curve (C4 plants) - real(r8), pointer, private :: tpu_z_phs_patch (:,:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) - real(r8), pointer, private :: gs_mol_sun_patch (:,:) ! patch sunlit leaf stomatal conductance (umol H2O/m**2/s) - real(r8), pointer, private :: gs_mol_sha_patch (:,:) ! patch shaded leaf stomatal conductance (umol H2O/m**2/s) - real(r8), pointer, private :: gs_mol_sun_ln_patch (:,:) ! patch sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - real(r8), pointer, private :: gs_mol_sha_ln_patch (:,:) ! patch shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - real(r8), pointer, private :: ac_patch (:,:) ! patch Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: aj_patch (:,:) ! patch RuBP-limited gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: ap_patch (:,:) ! patch product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: ag_patch (:,:) ! patch co-limited gross leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: an_patch (:,:) ! patch net leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: vcmax_z_patch (:,:) ! patch maximum rate of carboxylation (umol co2/m**2/s) - real(r8), pointer, private :: cp_patch (:) ! patch CO2 compensation point (Pa) - real(r8), pointer, private :: kc_patch (:) ! patch Michaelis-Menten constant for CO2 (Pa) - real(r8), pointer, private :: ko_patch (:) ! patch Michaelis-Menten constant for O2 (Pa) - real(r8), pointer, private :: qe_patch (:) ! patch quantum efficiency, used only for C4 (mol CO2 / mol photons) - real(r8), pointer, private :: tpu_z_patch (:,:) ! patch triose phosphate utilization rate (umol CO2/m**2/s) - real(r8), pointer, private :: kp_z_patch (:,:) ! patch initial slope of CO2 response curve (C4 plants) - real(r8), pointer, private :: theta_cj_patch (:) ! patch empirical curvature parameter for ac, aj photosynthesis co-limitation - real(r8), pointer, private :: bbb_patch (:) ! patch Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - real(r8), pointer, private :: mbb_patch (:) ! patch Ball-Berry slope of conductance-photosynthesis relationship - real(r8), pointer, private :: gs_mol_patch (:,:) ! patch leaf stomatal conductance (umol H2O/m**2/s) - real(r8), pointer, private :: gb_mol_patch (:) ! patch leaf boundary layer conductance (umol H2O/m**2/s) - real(r8), pointer, private :: rh_leaf_patch (:) ! patch fractional humidity at leaf surface (dimensionless) - - real(r8), pointer, private :: alphapsnsun_patch (:) ! patch sunlit 13c fractionation ([]) - real(r8), pointer, private :: alphapsnsha_patch (:) ! patch shaded 13c fractionation ([]) - - real(r8), pointer, public :: rc13_canair_patch (:) ! patch C13O2/C12O2 in canopy air - real(r8), pointer, public :: rc13_psnsun_patch (:) ! patch C13O2/C12O2 in sunlit canopy psn flux - real(r8), pointer, public :: rc13_psnsha_patch (:) ! patch C13O2/C12O2 in shaded canopy psn flux - - real(r8), pointer, public :: psnsun_patch (:) ! patch sunlit leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, public :: psnsha_patch (:) ! patch shaded leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, public :: c13_psnsun_patch (:) ! patch c13 sunlit leaf photosynthesis (umol 13CO2/m**2/s) - real(r8), pointer, public :: c13_psnsha_patch (:) ! patch c13 shaded leaf photosynthesis (umol 13CO2/m**2/s) - real(r8), pointer, public :: c14_psnsun_patch (:) ! patch c14 sunlit leaf photosynthesis (umol 14CO2/m**2/s) - real(r8), pointer, public :: c14_psnsha_patch (:) ! patch c14 shaded leaf photosynthesis (umol 14CO2/m**2/s) - - real(r8), pointer, private :: psnsun_z_patch (:,:) ! patch canopy layer: sunlit leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsha_z_patch (:,:) ! patch canopy layer: shaded leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsun_wc_patch (:) ! patch Rubsico-limited sunlit leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsha_wc_patch (:) ! patch Rubsico-limited shaded leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsun_wj_patch (:) ! patch RuBP-limited sunlit leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsha_wj_patch (:) ! patch RuBP-limited shaded leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsun_wp_patch (:) ! patch product-limited sunlit leaf photosynthesis (umol CO2/m**2/s) - real(r8), pointer, private :: psnsha_wp_patch (:) ! patch product-limited shaded leaf photosynthesis (umol CO2/m**2/s) - - real(r8), pointer, public :: fpsn_patch (:) ! patch photosynthesis (umol CO2/m**2 ground/s) - real(r8), pointer, private :: fpsn_wc_patch (:) ! patch Rubisco-limited photosynthesis (umol CO2/m**2 ground/s) - real(r8), pointer, private :: fpsn_wj_patch (:) ! patch RuBP-limited photosynthesis (umol CO2/m**2 ground/s) - real(r8), pointer, private :: fpsn_wp_patch (:) ! patch product-limited photosynthesis (umol CO2/m**2 ground/s) - - real(r8), pointer, public :: lnca_patch (:) ! top leaf layer leaf N concentration (gN leaf/m^2) - - real(r8), pointer, public :: lmrsun_patch (:) ! patch sunlit leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), pointer, public :: lmrsha_patch (:) ! patch shaded leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), pointer, private :: lmrsun_z_patch (:,:) ! patch canopy layer: sunlit leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), pointer, private :: lmrsha_z_patch (:,:) ! patch canopy layer: shaded leaf maintenance respiration rate (umol CO2/m**2/s) - - real(r8), pointer, public :: cisun_z_patch (:,:) ! patch intracellular sunlit leaf CO2 (Pa) - real(r8), pointer, public :: cisha_z_patch (:,:) ! patch intracellular shaded leaf CO2 (Pa) - - real(r8), pointer, private :: rssun_z_patch (:,:) ! patch canopy layer: sunlit leaf stomatal resistance (s/m) - real(r8), pointer, private :: rssha_z_patch (:,:) ! patch canopy layer: shaded leaf stomatal resistance (s/m) - real(r8), pointer, public :: rssun_patch (:) ! patch sunlit stomatal resistance (s/m) - real(r8), pointer, public :: rssha_patch (:) ! patch shaded stomatal resistance (s/m) - real(r8), pointer, public :: luvcmax25top_patch (:) ! vcmax25 ! (umol/m2/s) - real(r8), pointer, public :: lujmax25top_patch (:) ! vcmax25 (umol/m2/s) - real(r8), pointer, public :: lutpu25top_patch (:) ! vcmax25 (umol/m2/s) -!! - - - ! LUNA specific variables - real(r8), pointer, public :: vcmx25_z_patch (:,:) ! patch leaf Vc,max25 (umol CO2/m**2/s) for canopy layer - real(r8), pointer, public :: jmx25_z_patch (:,:) ! patch leaf Jmax25 (umol electron/m**2/s) for canopy layer - real(r8), pointer, public :: pnlc_z_patch (:,:) ! patch proportion of leaf nitrogen allocated for light capture for canopy layer - real(r8), pointer, public :: enzs_z_patch (:,:) ! enzyme decay status 1.0-fully active; 0-all decayed during stress - real(r8), pointer, public :: fpsn24_patch (:) ! 24 hour mean patch photosynthesis (umol CO2/m**2 ground/day) - - ! Logical switches for different options - logical, public :: rootstem_acc ! Respiratory acclimation for roots and stems - logical, private :: light_inhibit ! If light should inhibit respiration - integer, private :: leafresp_method ! leaf maintencence respiration at 25C for canopy top method to use - integer, private :: stomatalcond_mtd ! Stomatal conduction method type - logical, private :: modifyphoto_and_lmr_forcrop ! Modify photosynthesis and LMR for crop - contains - - ! Public procedures - procedure, public :: Init - procedure, public :: Restart - procedure, public :: ReadNML - procedure, public :: ReadParams - procedure, public :: TimeStepInit - procedure, public :: NewPatchInit - - ! Private procedures - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type photosyns_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(photosyns_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate (bounds) - call this%InitHistory (bounds) - call this%InitCold (bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - allocate(this%c3flag_patch (begp:endp)) ; this%c3flag_patch (:) =.false. - allocate(this%ac_phs_patch (begp:endp,2,1:nlevcan)) ; this%ac_phs_patch (:,:,:) = nan - allocate(this%aj_phs_patch (begp:endp,2,1:nlevcan)) ; this%aj_phs_patch (:,:,:) = nan - allocate(this%ap_phs_patch (begp:endp,2,1:nlevcan)) ; this%ap_phs_patch (:,:,:) = nan - allocate(this%ag_phs_patch (begp:endp,2,1:nlevcan)) ; this%ag_phs_patch (:,:,:) = nan - allocate(this%an_sun_patch (begp:endp,1:nlevcan)) ; this%an_sun_patch (:,:) = nan - allocate(this%an_sha_patch (begp:endp,1:nlevcan)) ; this%an_sha_patch (:,:) = nan - allocate(this%vcmax_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%vcmax_z_phs_patch (:,:,:) = nan - allocate(this%tpu_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%tpu_z_phs_patch (:,:,:) = nan - allocate(this%kp_z_phs_patch (begp:endp,2,1:nlevcan)) ; this%kp_z_phs_patch (:,:,:) = nan - allocate(this%gs_mol_sun_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_patch (:,:) = nan - allocate(this%gs_mol_sha_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_patch (:,:) = nan - allocate(this%gs_mol_sun_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sun_ln_patch (:,:) = nan - allocate(this%gs_mol_sha_ln_patch (begp:endp,1:nlevcan)) ; this%gs_mol_sha_ln_patch (:,:) = nan - allocate(this%ac_patch (begp:endp,1:nlevcan)) ; this%ac_patch (:,:) = nan - allocate(this%aj_patch (begp:endp,1:nlevcan)) ; this%aj_patch (:,:) = nan - allocate(this%ap_patch (begp:endp,1:nlevcan)) ; this%ap_patch (:,:) = nan - allocate(this%ag_patch (begp:endp,1:nlevcan)) ; this%ag_patch (:,:) = nan - allocate(this%an_patch (begp:endp,1:nlevcan)) ; this%an_patch (:,:) = nan - allocate(this%vcmax_z_patch (begp:endp,1:nlevcan)) ; this%vcmax_z_patch (:,:) = nan - allocate(this%tpu_z_patch (begp:endp,1:nlevcan)) ; this%tpu_z_patch (:,:) = nan - allocate(this%kp_z_patch (begp:endp,1:nlevcan)) ; this%kp_z_patch (:,:) = nan - allocate(this%gs_mol_patch (begp:endp,1:nlevcan)) ; this%gs_mol_patch (:,:) = nan - allocate(this%cp_patch (begp:endp)) ; this%cp_patch (:) = nan - allocate(this%kc_patch (begp:endp)) ; this%kc_patch (:) = nan - allocate(this%ko_patch (begp:endp)) ; this%ko_patch (:) = nan - allocate(this%qe_patch (begp:endp)) ; this%qe_patch (:) = nan - allocate(this%theta_cj_patch (begp:endp)) ; this%theta_cj_patch (:) = nan - allocate(this%bbb_patch (begp:endp)) ; this%bbb_patch (:) = nan - allocate(this%mbb_patch (begp:endp)) ; this%mbb_patch (:) = nan - allocate(this%gb_mol_patch (begp:endp)) ; this%gb_mol_patch (:) = nan - allocate(this%rh_leaf_patch (begp:endp)) ; this%rh_leaf_patch (:) = nan - - allocate(this%psnsun_patch (begp:endp)) ; this%psnsun_patch (:) = nan - allocate(this%psnsha_patch (begp:endp)) ; this%psnsha_patch (:) = nan - allocate(this%c13_psnsun_patch (begp:endp)) ; this%c13_psnsun_patch (:) = nan - allocate(this%c13_psnsha_patch (begp:endp)) ; this%c13_psnsha_patch (:) = nan - allocate(this%c14_psnsun_patch (begp:endp)) ; this%c14_psnsun_patch (:) = nan - allocate(this%c14_psnsha_patch (begp:endp)) ; this%c14_psnsha_patch (:) = nan - - allocate(this%psnsun_z_patch (begp:endp,1:nlevcan)) ; this%psnsun_z_patch (:,:) = nan - allocate(this%psnsha_z_patch (begp:endp,1:nlevcan)) ; this%psnsha_z_patch (:,:) = nan - allocate(this%psnsun_wc_patch (begp:endp)) ; this%psnsun_wc_patch (:) = nan - allocate(this%psnsha_wc_patch (begp:endp)) ; this%psnsha_wc_patch (:) = nan - allocate(this%psnsun_wj_patch (begp:endp)) ; this%psnsun_wj_patch (:) = nan - allocate(this%psnsha_wj_patch (begp:endp)) ; this%psnsha_wj_patch (:) = nan - allocate(this%psnsun_wp_patch (begp:endp)) ; this%psnsun_wp_patch (:) = nan - allocate(this%psnsha_wp_patch (begp:endp)) ; this%psnsha_wp_patch (:) = nan - allocate(this%fpsn_patch (begp:endp)) ; this%fpsn_patch (:) = nan - allocate(this%fpsn_wc_patch (begp:endp)) ; this%fpsn_wc_patch (:) = nan - allocate(this%fpsn_wj_patch (begp:endp)) ; this%fpsn_wj_patch (:) = nan - allocate(this%fpsn_wp_patch (begp:endp)) ; this%fpsn_wp_patch (:) = nan - - allocate(this%lnca_patch (begp:endp)) ; this%lnca_patch (:) = nan - - allocate(this%lmrsun_z_patch (begp:endp,1:nlevcan)) ; this%lmrsun_z_patch (:,:) = nan - allocate(this%lmrsha_z_patch (begp:endp,1:nlevcan)) ; this%lmrsha_z_patch (:,:) = nan - allocate(this%lmrsun_patch (begp:endp)) ; this%lmrsun_patch (:) = nan - allocate(this%lmrsha_patch (begp:endp)) ; this%lmrsha_patch (:) = nan - - allocate(this%alphapsnsun_patch (begp:endp)) ; this%alphapsnsun_patch (:) = nan - allocate(this%alphapsnsha_patch (begp:endp)) ; this%alphapsnsha_patch (:) = nan - allocate(this%rc13_canair_patch (begp:endp)) ; this%rc13_canair_patch (:) = nan - allocate(this%rc13_psnsun_patch (begp:endp)) ; this%rc13_psnsun_patch (:) = nan - allocate(this%rc13_psnsha_patch (begp:endp)) ; this%rc13_psnsha_patch (:) = nan - - allocate(this%cisun_z_patch (begp:endp,1:nlevcan)) ; this%cisun_z_patch (:,:) = nan - allocate(this%cisha_z_patch (begp:endp,1:nlevcan)) ; this%cisha_z_patch (:,:) = nan - - allocate(this%rssun_z_patch (begp:endp,1:nlevcan)) ; this%rssun_z_patch (:,:) = nan - allocate(this%rssha_z_patch (begp:endp,1:nlevcan)) ; this%rssha_z_patch (:,:) = nan - allocate(this%rssun_patch (begp:endp)) ; this%rssun_patch (:) = nan - allocate(this%rssha_patch (begp:endp)) ; this%rssha_patch (:) = nan - allocate(this%luvcmax25top_patch(begp:endp)) ; this%luvcmax25top_patch(:) = nan - allocate(this%lujmax25top_patch (begp:endp)) ; this%lujmax25top_patch(:) = nan - allocate(this%lutpu25top_patch (begp:endp)) ; this%lutpu25top_patch(:) = nan -!! -! allocate(this%psncanopy_patch (begp:endp)) ; this%psncanopy_patch (:) = nan -! allocate(this%lmrcanopy_patch (begp:endp)) ; this%lmrcanopy_patch (:) = nan - if(use_luna)then - ! NOTE(bja, 2015-09) because these variables are only allocated - ! when luna is turned on, they can not be placed into associate - ! statements. - allocate(this%vcmx25_z_patch (begp:endp,1:nlevcan)) ; this%vcmx25_z_patch (:,:) = 30._r8 - allocate(this%jmx25_z_patch (begp:endp,1:nlevcan)) ; this%jmx25_z_patch (:,:) = 60._r8 - allocate(this%pnlc_z_patch (begp:endp,1:nlevcan)) ; this%pnlc_z_patch (:,:) = 0.01_r8 - allocate(this%fpsn24_patch (begp:endp)) ; this%fpsn24_patch (:) = nan - allocate(this%enzs_z_patch (begp:endp,1:nlevcan)) ; this%enzs_z_patch (:,:) = 1._r8 - endif - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod , only: hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - type(bounds_type), intent(in) :: bounds - real(r8), pointer :: ptr_1d(:) ! pointer to 1d patch array - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - !--------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - - this%rh_leaf_patch(begp:endp) = spval - call hist_addfld1d (fname='RH_LEAF', units='fraction', & - avgflag='A', long_name='fractional humidity at leaf surface', & - ptr_patch=this%rh_leaf_patch, set_spec=spval, default='inactive') - this%lnca_patch(begp:endp) = spval - call hist_addfld1d (fname='LNC', units='gN leaf/m^2', & - avgflag='A', long_name='leaf N concentration', & - ptr_patch=this%lnca_patch, set_spec=spval) - - ! Don't output photosynthesis variables when FATES is on as they aren't calculated - if (.not. use_fates) then - this%fpsn_patch(begp:endp) = spval - call hist_addfld1d (fname='FPSN', units='umol/m2s', & - avgflag='A', long_name='photosynthesis', & - ptr_patch=this%fpsn_patch, set_lake=0._r8, set_urb=0._r8) - - ! Don't by default output this rate limiting step as only makes sense if you are outputing - ! the others each time-step - this%fpsn_wc_patch(begp:endp) = spval - call hist_addfld1d (fname='FPSN_WC', units='umol/m2s', & - avgflag='I', long_name='Rubisco-limited photosynthesis', & - ptr_patch=this%fpsn_wc_patch, set_lake=0._r8, set_urb=0._r8, & - default='inactive') - - ! Don't by default output this rate limiting step as only makes sense if you are outputing - ! the others each time-step - this%fpsn_wj_patch(begp:endp) = spval - call hist_addfld1d (fname='FPSN_WJ', units='umol/m2s', & - avgflag='I', long_name='RuBP-limited photosynthesis', & - ptr_patch=this%fpsn_wj_patch, set_lake=0._r8, set_urb=0._r8, & - default='inactive') - - ! Don't by default output this rate limiting step as only makes sense if you are outputing - ! the others each time-step - this%fpsn_wp_patch(begp:endp) = spval - call hist_addfld1d (fname='FPSN_WP', units='umol/m2s', & - avgflag='I', long_name='Product-limited photosynthesis', & - ptr_patch=this%fpsn_wp_patch, set_lake=0._r8, set_urb=0._r8, & - default='inactive') - end if - - if (use_cn) then - this%psnsun_patch(begp:endp) = spval - call hist_addfld1d (fname='PSNSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='sunlit leaf photosynthesis', & - ptr_patch=this%psnsun_patch) - - this%psnsha_patch(begp:endp) = spval - call hist_addfld1d (fname='PSNSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='shaded leaf photosynthesis', & - ptr_patch=this%psnsha_patch) - end if - - if ( use_c13 ) then - this%c13_psnsun_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PSNSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='C13 sunlit leaf photosynthesis', & - ptr_patch=this%c13_psnsun_patch) - - this%c13_psnsha_patch(begp:endp) = spval - call hist_addfld1d (fname='C13_PSNSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='C13 shaded leaf photosynthesis', & - ptr_patch=this%c13_psnsha_patch) - end if - - if ( use_c14 ) then - this%c14_psnsun_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PSNSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='C14 sunlit leaf photosynthesis', & - ptr_patch=this%c14_psnsun_patch) - - this%c14_psnsha_patch(begp:endp) = spval - call hist_addfld1d (fname='C14_PSNSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='C14 shaded leaf photosynthesis', & - ptr_patch=this%c14_psnsha_patch) - end if - - if ( use_c13 ) then - this%rc13_canair_patch(begp:endp) = spval - call hist_addfld1d (fname='RC13_CANAIR', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for canopy air', & - ptr_patch=this%rc13_canair_patch) - - this%rc13_psnsun_patch(begp:endp) = spval - call hist_addfld1d (fname='RC13_PSNSUN', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for sunlit photosynthesis', & - ptr_patch=this%rc13_psnsun_patch) - - this%rc13_psnsha_patch(begp:endp) = spval - call hist_addfld1d (fname='RC13_PSNSHA', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for shaded photosynthesis', & - ptr_patch=this%rc13_psnsha_patch) - endif - - ! Canopy physiology - - if ( use_c13 ) then - this%alphapsnsun_patch(begp:endp) = spval - call hist_addfld1d (fname='ALPHAPSNSUN', units='proportion', & - avgflag='A', long_name='sunlit c13 fractionation', & - ptr_patch=this%alphapsnsun_patch, default='inactive') - - this%alphapsnsha_patch(begp:endp) = spval - call hist_addfld1d (fname='ALPHAPSNSHA', units='proportion', & - avgflag='A', long_name='shaded c13 fractionation', & - ptr_patch=this%alphapsnsha_patch, default='inactive') - endif - - this%rssun_patch(begp:endp) = spval - call hist_addfld1d (fname='RSSUN', units='s/m', & - avgflag='M', long_name='sunlit leaf stomatal resistance', & - ptr_patch=this%rssun_patch, set_lake=spval, set_urb=spval) - - this%rssha_patch(begp:endp) = spval - call hist_addfld1d (fname='RSSHA', units='s/m', & - avgflag='M', long_name='shaded leaf stomatal resistance', & - ptr_patch=this%rssha_patch, set_lake=spval, set_urb=spval) - - this%gs_mol_sun_patch(begp:endp,:) = spval - this%gs_mol_sha_patch(begp:endp,:) = spval - if (nlevcan>1) then - call hist_addfld2d (fname='GSSUN', units='umol H20/m2/s', type2d='nlevcan', & - avgflag='A', long_name='sunlit leaf stomatal conductance', & - ptr_patch=this%gs_mol_sun_patch, set_lake=spval, set_urb=spval) - - call hist_addfld2d (fname='GSSHA', units='umol H20/m2/s', type2d='nlevcan', & - avgflag='A', long_name='shaded leaf stomatal conductance', & - ptr_patch=this%gs_mol_sha_patch, set_lake=spval, set_urb=spval) - else - ptr_1d => this%gs_mol_sun_patch(begp:endp,1) - call hist_addfld1d (fname='GSSUN', units='umol H20/m2/s', & - avgflag='A', long_name='sunlit leaf stomatal conductance', & - ptr_patch=ptr_1d) - - ptr_1d => this%gs_mol_sha_patch(begp:endp,1) - call hist_addfld1d (fname='GSSHA', units='umol H20/m2/s', & - avgflag='A', long_name='shaded leaf stomatal conductance', & - ptr_patch=ptr_1d) - - endif - this%gs_mol_sun_ln_patch(begp:endp,:) = spval - this%gs_mol_sha_ln_patch(begp:endp,:) = spval - if (nlevcan>1) then - call hist_addfld2d (fname='GSSUNLN', units='umol H20/m2/s', type2d='nlevcan', & - avgflag='A', long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & - ptr_patch=this%gs_mol_sun_ln_patch, set_lake=spval, set_urb=spval) - - call hist_addfld2d (fname='GSSHALN', units='umol H20/m2/s', type2d='nlevcan', & - avgflag='A', long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & - ptr_patch=this%gs_mol_sha_ln_patch, set_lake=spval, set_urb=spval) - else - ptr_1d => this%gs_mol_sun_ln_patch(begp:endp,1) - call hist_addfld1d (fname='GSSUNLN', units='umol H20/m2/s', & - avgflag='A', long_name='sunlit leaf stomatal conductance at local noon', & - ptr_patch=ptr_1d) - - ptr_1d => this%gs_mol_sha_ln_patch(begp:endp,1) - call hist_addfld1d (fname='GSSHALN', units='umol H20/m2/s', & - avgflag='A', long_name='shaded leaf stomatal conductance at local noon', & - ptr_patch=ptr_1d) - - endif - if(use_luna)then - if(nlevcan>1)then - call hist_addfld2d (fname='Vcmx25Z', units='umol/m2/s', type2d='nlevcan', & - avgflag='A', long_name='canopy profile of vcmax25 predicted by LUNA model', & - ptr_patch=this%vcmx25_z_patch) - - call hist_addfld2d (fname='Jmx25Z', units='umol/m2/s', type2d='nlevcan', & - avgflag='A', long_name='canopy profile of vcmax25 predicted by LUNA model', & - ptr_patch=this%jmx25_z_patch) - - call hist_addfld2d (fname='PNLCZ', units='unitless', type2d='nlevcan', & - avgflag='A', long_name='Proportion of nitrogen allocated for light capture', & - ptr_patch=this%pnlc_z_patch,default='inactive') - else - ptr_1d => this%vcmx25_z_patch(:,1) - call hist_addfld1d (fname='Vcmx25Z', units='umol/m2/s',& - avgflag='A', long_name='canopy profile of vcmax25 predicted by LUNA model', & - ptr_patch=ptr_1d) - ptr_1d => this%jmx25_z_patch(:,1) - call hist_addfld1d (fname='Jmx25Z', units='umol/m2/s',& - avgflag='A', long_name='canopy profile of vcmax25 predicted by LUNA model', & - ptr_patch=ptr_1d) - ptr_1d => this%pnlc_z_patch(:,1) - call hist_addfld1d (fname='PNLCZ', units='unitless', & - avgflag='A', long_name='Proportion of nitrogen allocated for light capture', & - ptr_patch=ptr_1d,default='inactive') - - this%luvcmax25top_patch(begp:endp) = spval - call hist_addfld1d (fname='VCMX25T', units='umol/m2/s', & - avgflag='M', long_name='canopy profile of vcmax25', & - ptr_patch=this%luvcmax25top_patch, set_lake=spval, set_urb=spval) - - this%lujmax25top_patch(begp:endp) = spval - call hist_addfld1d (fname='JMX25T', units='umol/m2/s', & - avgflag='M', long_name='canopy profile of jmax', & - ptr_patch=this%lujmax25top_patch, set_lake=spval, set_urb=spval) - - this%lutpu25top_patch(begp:endp) = spval - call hist_addfld1d (fname='TPU25T', units='umol/m2/s', & - avgflag='M', long_name='canopy profile of tpu', & - ptr_patch=this%lutpu25top_patch, set_lake=spval, set_urb=spval) - - endif - this%fpsn24_patch = spval - call hist_addfld1d (fname='FPSN24', units='umol CO2/m**2 ground/day',& - avgflag='A', long_name='24 hour accumulative patch photosynthesis starting from mid-night', & - ptr_patch=this%fpsn24_patch, default='inactive') - - endif - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,l ! indices - !----------------------------------------------------------------------- - - do p = bounds%begp,bounds%endp - l = patch%landunit(p) - - this%alphapsnsun_patch(p) = spval - this%alphapsnsha_patch(p) = spval - - if (lun%ifspecial(l)) then - this%psnsun_patch(p) = 0._r8 - this%psnsha_patch(p) = 0._r8 - if ( use_c13 ) then - this%c13_psnsun_patch(p) = 0._r8 - this%c13_psnsha_patch(p) = 0._r8 - endif - if ( use_c14 ) then - this%c14_psnsun_patch(p) = 0._r8 - this%c14_psnsha_patch(p) = 0._r8 - endif - end if - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine allocParams ( this ) - ! - implicit none - - ! !ARGUMENTS: - class(photo_params_type) :: this - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'allocParams' - !----------------------------------------------------------------------- - - ! allocate parameters - - allocate( this%krmax (0:mxpft) ) ; this%krmax(:) = nan - allocate( this%kmax (0:mxpft,nvegwcs) ) ; this%kmax(:,:) = nan - allocate( this%psi50 (0:mxpft,nvegwcs) ) ; this%psi50(:,:) = nan - allocate( this%ck (0:mxpft,nvegwcs) ) ; this%ck(:,:) = nan - allocate( this%psi_soil_ref(0:mxpft) ) ; this%psi_soil_ref(:) = nan - - if ( use_hydrstress .and. nvegwcs /= 4 )then - call endrun(msg='Error:: the Plant Hydraulics Stress methodology is for the spacA function is hardcoded for nvegwcs==4' & - //errMsg(__FILE__, __LINE__)) - end if - - end subroutine allocParams - - !----------------------------------------------------------------------- - subroutine readParams ( this, ncid ) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - implicit none - - ! !ARGUMENTS: - class(photosyns_type) :: this - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'readParams' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter - real(r8) :: temp2d(0:mxpft,nvegwcs) ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - ! read in parameters - - - call params_inst%allocParams() - - tString = "krmax" - call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%krmax=temp1d - tString = "psi_soil_ref" - call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%psi_soil_ref=temp1d - tString = "lmr_intercept_atkin" - call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%lmr_intercept_atkin=temp1d - tString = "kmax" - call ncd_io(varname=trim(tString),data=temp2d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%kmax=temp2d - tString = "psi50" - call ncd_io(varname=trim(tString),data=temp2d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%psi50=temp2d - tString = "ck" - call ncd_io(varname=trim(tString),data=temp2d, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ck=temp2d - - end subroutine readParams - - - !------------------------------------------------------------------------ - subroutine ReadNML(this, NLFilename) - ! - ! !DESCRIPTION: - ! Read the namelist for Photosynthesis - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'Photosyn::ReadNML' - character(len=*), parameter :: nmlname = 'photosyns_inparm' - logical :: rootstem_acc = .false. ! Respiratory acclimation for roots and stems - logical :: light_inhibit = .false. ! If light should inhibit respiration - integer :: leafresp_method = leafresp_mtd_ryan1991 ! leaf maintencence respiration at 25C for canopy top method to use - logical :: modifyphoto_and_lmr_forcrop = .false. ! Modify photosynthesis and LMR for crop - character(len=50) :: stomatalcond_method = 'Ball-Berry1987' ! Photosynthesis method string - !----------------------------------------------------------------------- - - namelist /photosyns_inparm/ leafresp_method, light_inhibit, & - rootstem_acc, stomatalcond_method, modifyphoto_and_lmr_forcrop - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=photosyns_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - this%rootstem_acc = rootstem_acc - this%leafresp_method = leafresp_method - this%light_inhibit = light_inhibit - this%modifyphoto_and_lmr_forcrop = modifyphoto_and_lmr_forcrop - if ( trim(stomatalcond_method) == 'Ball-Berry1987' ) then - this%stomatalcond_mtd = stomatalcond_mtd_bb1987 - else if ( trim(stomatalcond_method) == 'Medlyn2011' ) then - this%stomatalcond_mtd = stomatalcond_mtd_medlyn2011 - else - call endrun(msg="ERROR bad value for stomtalcond_method in "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - end if - - call shr_mpi_bcast (this%rootstem_acc , mpicom) - call shr_mpi_bcast (this%leafresp_method, mpicom) - call shr_mpi_bcast (this%light_inhibit , mpicom) - call shr_mpi_bcast (this%stomatalcond_mtd, mpicom) - call shr_mpi_bcast (this%modifyphoto_and_lmr_forcrop, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=photosyns_inparm) - write(iulog,*) ' ' - end if - - end subroutine ReadNML - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - if ( use_c13 ) then - call restartvar(ncid=ncid, flag=flag, varname='rc13_canair', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%rc13_canair_patch) - - call restartvar(ncid=ncid, flag=flag, varname='rc13_psnsun', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%rc13_psnsun_patch) - - call restartvar(ncid=ncid, flag=flag, varname='rc13_psnsha', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%rc13_psnsha_patch) - endif - - call restartvar(ncid=ncid, flag=flag, varname='GSSUN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='sunlit leaf stomatal conductance', units='umol H20/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_patch) - - call restartvar(ncid=ncid, flag=flag, varname='GSSHA', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='shaded leaf stomatal conductance', units='umol H20/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_patch) - - call restartvar(ncid=ncid, flag=flag, varname='GSSUNLN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & - units='umol H20/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sun_ln_patch) - - call restartvar(ncid=ncid, flag=flag, varname='GSSHALN', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon', & - units='umol H20/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%gs_mol_sha_ln_patch) - - call restartvar(ncid=ncid, flag=flag, varname='lnca', xtype=ncd_double, & - dim1name='pft', long_name='leaf N concentration', units='gN leaf/m^2', & - interpinic_flag='interp', readvar=readvar, data=this%lnca_patch) - - if(use_luna) then - call restartvar(ncid=ncid, flag=flag, varname='vcmx25_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Maximum carboxylation rate at 25 celcius for canopy layers', units='umol CO2/m**2/s', & - interpinic_flag='interp', readvar=readvar, data=this%vcmx25_z_patch) - call restartvar(ncid=ncid, flag=flag, varname='jmx25_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Maximum carboxylation rate at 25 celcius for canopy layers', units='umol CO2/m**2/s', & - interpinic_flag='interp', readvar=readvar, data=this%jmx25_z_patch) - call restartvar(ncid=ncid, flag=flag, varname='pnlc_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='proportion of leaf nitrogen allocated for light capture', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%pnlc_z_patch ) - call restartvar(ncid=ncid, flag=flag, varname='enzs_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='enzyme decay status during stress: 1.0-fully active; 0.0-all decayed', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%enzs_z_patch ) - call restartvar(ncid=ncid, flag=flag, varname='gpp24', xtype=ncd_double, & - dim1name='pft', long_name='accumulative gross primary production', units='umol CO2/m**2 ground/day', & - interpinic_flag='interp', readvar=readvar, data=this%fpsn24_patch) - endif - call restartvar(ncid=ncid, flag=flag, varname='vcmx25t', xtype=ncd_double, & - dim1name='pft', long_name='canopy profile of vcmax25', & - units='umol/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%luvcmax25top_patch) - - call restartvar(ncid=ncid, flag=flag, varname='jmx25t', xtype=ncd_double, & - dim1name='pft', long_name='canopy profile of jmax', & - units='umol/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%lujmax25top_patch) - - call restartvar(ncid=ncid, flag=flag, varname='tpu25t', xtype=ncd_double, & - dim1name='pft', long_name='canopy profile of tpu', & - units='umol/m2/s', & - interpinic_flag='interp', readvar=readvar, data=this%lutpu25top_patch) - - end subroutine Restart - - !------------------------------------------------------------------------------ - subroutine TimeStepInit (this, bounds) - ! - ! Time step initialization - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop, istice_mec, istwet - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,l ! indices - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - l = patch%landunit(p) - if (.not. lun%lakpoi(l)) then - this%psnsun_patch(p) = 0._r8 - this%psnsun_wc_patch(p) = 0._r8 - this%psnsun_wj_patch(p) = 0._r8 - this%psnsun_wp_patch(p) = 0._r8 - - this%psnsha_patch(p) = 0._r8 - this%psnsha_wc_patch(p) = 0._r8 - this%psnsha_wj_patch(p) = 0._r8 - this%psnsha_wp_patch(p) = 0._r8 - - this%fpsn_patch(p) = 0._r8 - this%fpsn_wc_patch(p) = 0._r8 - this%fpsn_wj_patch(p) = 0._r8 - this%fpsn_wp_patch(p) = 0._r8 - - if ( use_c13 ) then - this%alphapsnsun_patch(p) = 0._r8 - this%alphapsnsha_patch(p) = 0._r8 - this%c13_psnsun_patch(p) = 0._r8 - this%c13_psnsha_patch(p) = 0._r8 - endif - if ( use_c14 ) then - this%c14_psnsun_patch(p) = 0._r8 - this%c14_psnsha_patch(p) = 0._r8 - endif - end if - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop & - .or. lun%itype(l) == istice_mec & - .or. lun%itype(l) == istwet) then - if (use_c13) then - this%rc13_canair_patch(p) = 0._r8 - this%rc13_psnsun_patch(p) = 0._r8 - this%rc13_psnsha_patch(p) = 0._r8 - end if - end if - end do - - end subroutine TimeStepInit - - !------------------------------------------------------------------------------ - subroutine NewPatchInit (this, p) - ! - ! For new run-time pft, modify state and flux variables to maintain - ! carbon and nitrogen balance with dynamic pft-weights. - ! Called from dyn_cnbal_patch - ! - ! !ARGUMENTS: - class(photosyns_type) :: this - integer, intent(in) :: p - !----------------------------------------------------------------------- - - if ( use_c13 ) then - this%alphapsnsun_patch(p) = 0._r8 - this%alphapsnsha_patch(p) = 0._r8 - this%rc13_canair_patch(p) = 0._r8 - this%rc13_psnsun_patch(p) = 0._r8 - this%rc13_psnsha_patch(p) = 0._r8 - endif - - this%psnsun_patch(p) = 0._r8 - this%psnsha_patch(p) = 0._r8 - - if (use_c13) then - this%c13_psnsun_patch(p) = 0._r8 - this%c13_psnsha_patch(p) = 0._r8 - end if - if ( use_c14 ) then - this%c14_psnsun_patch(p) = 0._r8 - this%c14_psnsha_patch(p) = 0._r8 - end if - - end subroutine NewPatchInit - - !------------------------------------------------------------------------------ - !------------------------------------------------------------------------------ - subroutine Photosynthesis ( bounds, fn, filterp, & - esat_tv, eair, oair, cair, rb, btran, & - dayl_factor, leafn, & - atm2lnd_inst, temperature_inst, surfalb_inst, solarabs_inst, & - canopystate_inst, ozone_inst, photosyns_inst, phase) - ! - ! !DESCRIPTION: - ! Leaf photosynthesis and stomatal conductance calculation as described by - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 and extended to - ! a multi-layer canopy - ! - ! !USES: - use clm_varcon , only : rgas, tfrz, spval, degpsec, isecspday - use GridcellType , only : grc - use clm_time_manager , only : get_curr_date, get_step_size - use clm_varctl , only : cnallocate_carbon_only - use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt - use pftconMod , only : nbrdlf_dcd_tmp_shrub, npcropmin - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! patch filter - real(r8) , intent(in) :: esat_tv( bounds%begp: ) ! saturation vapor pressure at t_veg (Pa) [pft] - real(r8) , intent(in) :: eair( bounds%begp: ) ! vapor pressure of canopy air (Pa) [pft] - real(r8) , intent(in) :: oair( bounds%begp: ) ! Atmospheric O2 partial pressure (Pa) [pft] - real(r8) , intent(in) :: cair( bounds%begp: ) ! Atmospheric CO2 partial pressure (Pa) [pft] - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) [pft] - real(r8) , intent(in) :: btran( bounds%begp: ) ! transpiration wetness factor (0 to 1) [pft] - real(r8) , intent(in) :: dayl_factor( bounds%begp: ) ! scalar (0-1) for daylength - real(r8) , intent(in) :: leafn( bounds%begp: ) ! leaf N (gN/m2) - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(in) :: temperature_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(canopystate_type) , intent(in) :: canopystate_inst - class(ozone_base_type) , intent(in) :: ozone_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - character(len=*) , intent(in) :: phase ! 'sun' or 'sha' - - ! - ! !LOCAL VARIABLES: - ! - ! Leaf photosynthesis parameters - real(r8) :: jmax_z(bounds%begp:bounds%endp,nlevcan) ! maximum electron transport rate (umol electrons/m**2/s) - !real(r8) :: lnc(bounds%begp:bounds%endp) ! leaf N concentration (gN leaf/m^2) - real(r8) :: bbbopt(bounds%begp:bounds%endp)! Ball-Berry minimum leaf conductance, unstressed (umol H2O/m**2/s) - real(r8) :: kn(bounds%begp:bounds%endp) ! leaf nitrogen decay coefficient - real(r8) :: vcmax25top ! canopy top: maximum rate of carboxylation at 25C (umol CO2/m**2/s) - real(r8) :: jmax25top ! canopy top: maximum electron transport rate at 25C (umol electrons/m**2/s) - real(r8) :: tpu25top ! canopy top: triose phosphate utilization rate at 25C (umol CO2/m**2/s) - real(r8) :: lmr25top ! canopy top: leaf maintenance respiration rate at 25C (umol CO2/m**2/s) - real(r8) :: kp25top ! canopy top: initial slope of CO2 response curve (C4 plants) at 25C - - real(r8) :: vcmax25 ! leaf layer: maximum rate of carboxylation at 25C (umol CO2/m**2/s) - real(r8) :: jmax25 ! leaf layer: maximum electron transport rate at 25C (umol electrons/m**2/s) - real(r8) :: tpu25 ! leaf layer: triose phosphate utilization rate at 25C (umol CO2/m**2/s) - real(r8) :: lmr25 ! leaf layer: leaf maintenance respiration rate at 25C (umol CO2/m**2/s) - real(r8) :: kp25 ! leaf layer: Initial slope of CO2 response curve (C4 plants) at 25C - real(r8) :: kc25 ! Michaelis-Menten constant for CO2 at 25C (Pa) - real(r8) :: ko25 ! Michaelis-Menten constant for O2 at 25C (Pa) - real(r8) :: cp25 ! CO2 compensation point at 25C (Pa) - - real(r8) :: vcmaxha ! activation energy for vcmax (J/mol) - real(r8) :: jmaxha ! activation energy for jmax (J/mol) - real(r8) :: tpuha ! activation energy for tpu (J/mol) - real(r8) :: lmrha ! activation energy for lmr (J/mol) - real(r8) :: kcha ! activation energy for kc (J/mol) - real(r8) :: koha ! activation energy for ko (J/mol) - real(r8) :: cpha ! activation energy for cp (J/mol) - - real(r8) :: vcmaxhd ! deactivation energy for vcmax (J/mol) - real(r8) :: jmaxhd ! deactivation energy for jmax (J/mol) - real(r8) :: tpuhd ! deactivation energy for tpu (J/mol) - real(r8) :: lmrhd ! deactivation energy for lmr (J/mol) - - real(r8) :: vcmaxse ! entropy term for vcmax (J/mol/K) - real(r8) :: jmaxse ! entropy term for jmax (J/mol/K) - real(r8) :: tpuse ! entropy term for tpu (J/mol/K) - real(r8) :: lmrse ! entropy term for lmr (J/mol/K) - - real(r8) :: vcmaxc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: jmaxc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: tpuc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: lmrc ! scaling factor for high temperature inhibition (25 C = 1.0) - - real(r8) :: fnps ! fraction of light absorbed by non-photosynthetic pigments - real(r8) :: theta_psii ! empirical curvature parameter for electron transport rate - - real(r8) :: theta_ip ! empirical curvature parameter for ap photosynthesis co-limitation - - ! Other - integer :: f,p,c,iv ! indices - real(r8) :: cf ! s m**2/umol -> s/m - real(r8) :: rsmax0 ! maximum stomatal resistance [s/m] - real(r8) :: gb ! leaf boundary layer conductance (m/s) - real(r8) :: cs ! CO2 partial pressure at leaf surface (Pa) - real(r8) :: gs ! leaf stomatal conductance (m/s) - real(r8) :: hs ! fractional humidity at leaf surface (dimensionless) - real(r8) :: sco ! relative specificity of rubisco - real(r8) :: ft ! photosynthesis temperature response (statement function) - real(r8) :: fth ! photosynthesis temperature inhibition (statement function) - real(r8) :: fth25 ! ccaling factor for photosynthesis temperature inhibition (statement function) - real(r8) :: tl ! leaf temperature in photosynthesis temperature function (K) - real(r8) :: ha ! activation energy in photosynthesis temperature function (J/mol) - real(r8) :: hd ! deactivation energy in photosynthesis temperature function (J/mol) - real(r8) :: se ! entropy term in photosynthesis temperature function (J/mol/K) - real(r8) :: scaleFactor ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: ciold ! previous value of Ci for convergence check - real(r8) :: gs_mol_err ! gs_mol for error check - real(r8) :: je ! electron transport rate (umol electrons/m**2/s) - real(r8) :: qabs ! PAR absorbed by PS II (umol photons/m**2/s) - real(r8) :: aquad,bquad,cquad ! terms for quadratic equations - real(r8) :: r1,r2 ! roots of quadratic equation - real(r8) :: ceair ! vapor pressure of air, constrained (Pa) - real(r8) :: fnr ! (gRubisco/gN in Rubisco) - real(r8) :: act25 ! (umol/mgRubisco/min) Rubisco activity at 25 C - integer :: niter ! iteration loop index - real(r8) :: nscaler ! leaf nitrogen scaling coefficient - - real(r8) :: ai ! intermediate co-limited photosynthesis (umol CO2/m**2/s) - - real(r8) :: psn_wc_z(bounds%begp:bounds%endp,nlevcan) ! Rubisco-limited contribution to psn_z (umol CO2/m**2/s) - real(r8) :: psn_wj_z(bounds%begp:bounds%endp,nlevcan) ! RuBP-limited contribution to psn_z (umol CO2/m**2/s) - real(r8) :: psn_wp_z(bounds%begp:bounds%endp,nlevcan) ! product-limited contribution to psn_z (umol CO2/m**2/s) - - real(r8) :: psncan ! canopy sum of psn_z - real(r8) :: psncan_wc ! canopy sum of psn_wc_z - real(r8) :: psncan_wj ! canopy sum of psn_wj_z - real(r8) :: psncan_wp ! canopy sum of psn_wp_z - real(r8) :: lmrcan ! canopy sum of lmr_z - real(r8) :: gscan ! canopy sum of leaf conductance - real(r8) :: laican ! canopy sum of lai_z - real(r8) :: rh_can - real(r8) , pointer :: lai_z (:,:) - real(r8) , pointer :: par_z (:,:) - real(r8) , pointer :: vcmaxcint (:) - real(r8) , pointer :: alphapsn (:) - real(r8) , pointer :: psn (:) - real(r8) , pointer :: psn_wc (:) - real(r8) , pointer :: psn_wj (:) - real(r8) , pointer :: psn_wp (:) - real(r8) , pointer :: psn_z (:,:) - real(r8) , pointer :: lmr (:) - real(r8) , pointer :: lmr_z (:,:) - real(r8) , pointer :: rs (:) - real(r8) , pointer :: rs_z (:,:) - real(r8) , pointer :: ci_z (:,:) - real(r8) , pointer :: o3coefv (:) ! o3 coefficient used in photo calculation - real(r8) , pointer :: o3coefg (:) ! o3 coefficient used in rs calculation - real(r8) , pointer :: alphapsnsun (:) - real(r8) , pointer :: alphapsnsha (:) - - real(r8) :: sum_nscaler - real(r8) :: total_lai - integer :: nptreemax - - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - integer :: g ! index - integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon - !------------------------------------------------------------------------------ - - ! Temperature and soil water response functions - - ft(tl,ha) = exp( ha / (rgas*1.e-3_r8*(tfrz+25._r8)) * (1._r8 - (tfrz+25._r8)/tl) ) - fth(tl,hd,se,scaleFactor) = scaleFactor / ( 1._r8 + exp( (-hd+se*tl) / (rgas*1.e-3_r8*tl) ) ) - fth25(hd,se) = 1._r8 + exp( (-hd+se*(tfrz+25._r8)) / (rgas*1.e-3_r8*(tfrz+25._r8)) ) - - ! Enforce expected array sizes - - SHR_ASSERT_ALL((ubound(esat_tv) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(oair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(btran) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dayl_factor) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(leafn) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - c3psn => pftcon%c3psn , & ! Input: photosynthetic pathway: 0. = c4, 1. = c3 - crop => pftcon%crop , & ! Input: crop or not (0 =not crop and 1 = crop) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - flnr => pftcon%flnr , & ! Input: fraction of leaf N in the Rubisco enzyme (gN Rubisco / gN leaf) - fnitr => pftcon%fnitr , & ! Input: foliage nitrogen limitation factor (-) - slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis [m^2/gC] - dsladlai => pftcon%dsladlai , & ! Input: change in sla per unit lai - i_vcad => pftcon%i_vcad , & ! Input: [real(r8) (:) ] - s_vcad => pftcon%s_vcad , & ! Input: [real(r8) (:) ] - i_flnr => pftcon%i_flnr , & ! Input: [real(r8) (:) ] - s_flnr => pftcon%s_flnr , & ! Input: [real(r8) (:) ] - mbbopt => pftcon%mbbopt , & ! Input: [real(r8) (:) ] Ball-Berry slope of conduct/photosyn (umol H2O/umol CO2) - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] vegetation temperature (Kelvin) - t10 => temperature_inst%t_a10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of the 2 m temperature (K) - tgcm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] air temperature at agcm reference height (kelvin) - - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] pft number of canopy layers, above snow for radiative transfer - tlai_z => surfalb_inst%tlai_z_patch , & ! Input: [real(r8) (:,:) ] pft total leaf area index for canopy layer - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8)(:) ] one-sided leaf area index, no burying by snow - c3flag => photosyns_inst%c3flag_patch , & ! Output: [logical (:) ] true if C3 and false if C4 - ac => photosyns_inst%ac_patch , & ! Output: [real(r8) (:,:) ] Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - aj => photosyns_inst%aj_patch , & ! Output: [real(r8) (:,:) ] RuBP-limited gross photosynthesis (umol CO2/m**2/s) - ap => photosyns_inst%ap_patch , & ! Output: [real(r8) (:,:) ] product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - ag => photosyns_inst%ag_patch , & ! Output: [real(r8) (:,:) ] co-limited gross leaf photosynthesis (umol CO2/m**2/s) - an => photosyns_inst%an_patch , & ! Output: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) - gb_mol => photosyns_inst%gb_mol_patch , & ! Output: [real(r8) (:) ] leaf boundary layer conductance (umol H2O/m**2/s) - gs_mol => photosyns_inst%gs_mol_patch , & ! Output: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - vcmax_z => photosyns_inst%vcmax_z_patch , & ! Output: [real(r8) (:,:) ] maximum rate of carboxylation (umol co2/m**2/s) - cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) - kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) - ko => photosyns_inst%ko_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for O2 (Pa) - qe => photosyns_inst%qe_patch , & ! Output: [real(r8) (:) ] quantum efficiency, used only for C4 (mol CO2 / mol photons) - tpu_z => photosyns_inst%tpu_z_patch , & ! Output: [real(r8) (:,:) ] triose phosphate utilization rate (umol CO2/m**2/s) - kp_z => photosyns_inst%kp_z_patch , & ! Output: [real(r8) (:,:) ] initial slope of CO2 response curve (C4 plants) - theta_cj => photosyns_inst%theta_cj_patch , & ! Output: [real(r8) (:) ] empirical curvature parameter for ac, aj photosynthesis co-limitation - bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - mbb => photosyns_inst%mbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship - rh_leaf => photosyns_inst%rh_leaf_patch , & ! Output: [real(r8) (:) ] fractional humidity at leaf surface (dimensionless) - lnc => photosyns_inst%lnca_patch , & ! Output: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) - light_inhibit=> photosyns_inst%light_inhibit , & ! Input: [logical ] flag if light should inhibit respiration - leafresp_method=> photosyns_inst%leafresp_method , & ! Input: [integer ] method type to use for leaf-maint.-respiration at 25C canopy top - stomatalcond_mtd=> photosyns_inst%stomatalcond_mtd , & ! Input: [integer ] method type to use for stomatal conductance.GC.fnlprmsn15_r22845 - leaf_mr_vcm => canopystate_inst%leaf_mr_vcm & ! Input: [real(r8) ] scalar constant of leaf respiration with Vcmax - ) - - if (phase == 'sun') then - par_z => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) - lai_z => canopystate_inst%laisun_z_patch ! Input: [real(r8) (:,:) ] leaf area index for canopy layer, sunlit or shaded - vcmaxcint => surfalb_inst%vcmaxcintsun_patch ! Input: [real(r8) (:) ] leaf to canopy scaling coefficient - alphapsn => photosyns_inst%alphapsnsun_patch ! Input: [real(r8) (:) ] 13C fractionation factor for PSN () - o3coefv => ozone_inst%o3coefvsun_patch ! Input: [real(r8) (:) ] O3 coefficient used in photosynthesis calculation - o3coefg => ozone_inst%o3coefgsun_patch ! Input: [real(r8) (:) ] O3 coefficient used in rs calculation - ci_z => photosyns_inst%cisun_z_patch ! Output: [real(r8) (:,:) ] intracellular leaf CO2 (Pa) - rs => photosyns_inst%rssun_patch ! Output: [real(r8) (:) ] leaf stomatal resistance (s/m) - rs_z => photosyns_inst%rssun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf stomatal resistance (s/m) - lmr => photosyns_inst%lmrsun_patch ! Output: [real(r8) (:) ] leaf maintenance respiration rate (umol CO2/m**2/s) - lmr_z => photosyns_inst%lmrsun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - psn => photosyns_inst%psnsun_patch ! Output: [real(r8) (:) ] foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_z => photosyns_inst%psnsun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wc => photosyns_inst%psnsun_wc_patch ! Output: [real(r8) (:) ] Rubisco-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wj => photosyns_inst%psnsun_wj_patch ! Output: [real(r8) (:) ] RuBP-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wp => photosyns_inst%psnsun_wp_patch ! Output: [real(r8) (:) ] product-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - else if (phase == 'sha') then - par_z => solarabs_inst%parsha_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) - lai_z => canopystate_inst%laisha_z_patch ! Input: [real(r8) (:,:) ] leaf area index for canopy layer, sunlit or shaded - vcmaxcint => surfalb_inst%vcmaxcintsha_patch ! Input: [real(r8) (:) ] leaf to canopy scaling coefficient - alphapsn => photosyns_inst%alphapsnsha_patch ! Input: [real(r8) (:) ] 13C fractionation factor for PSN () - o3coefv => ozone_inst%o3coefvsha_patch ! Input: [real(r8) (:) ] O3 coefficient used in photosynthesis calculation - o3coefg => ozone_inst%o3coefgsha_patch ! Input: [real(r8) (:) ] O3 coefficient used in rs calculation - ci_z => photosyns_inst%cisha_z_patch ! Output: [real(r8) (:,:) ] intracellular leaf CO2 (Pa) - rs => photosyns_inst%rssha_patch ! Output: [real(r8) (:) ] leaf stomatal resistance (s/m) - rs_z => photosyns_inst%rssha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf stomatal resistance (s/m) - lmr => photosyns_inst%lmrsha_patch ! Output: [real(r8) (:) ] leaf maintenance respiration rate (umol CO2/m**2/s) - lmr_z => photosyns_inst%lmrsha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - psn => photosyns_inst%psnsha_patch ! Output: [real(r8) (:) ] foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_z => photosyns_inst%psnsha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wc => photosyns_inst%psnsha_wc_patch ! Output: [real(r8) (:) ] Rubisco-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wj => photosyns_inst%psnsha_wj_patch ! Output: [real(r8) (:) ] RuBP-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wp => photosyns_inst%psnsha_wp_patch ! Output: [real(r8) (:) ] product-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - end if - - !==============================================================================! - ! Photosynthesis and stomatal conductance parameters, from: - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - !==============================================================================! - - ! Determine seconds of current time step - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! vcmax25 parameters, from CN - - fnr = 7.16_r8 - act25 = 3.6_r8 !umol/mgRubisco/min - ! Convert rubisco activity units from umol/mgRubisco/min -> umol/gRubisco/s - act25 = act25 * 1000.0_r8 / 60.0_r8 - - ! Activation energy, from: - ! Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - ! Bernacchi et al (2003) Plant, Cell and Environment 26:1419-1430 - ! except TPU from: Harley et al (1992) Plant, Cell and Environment 15:271-282 - - kcha = 79430._r8 - koha = 36380._r8 - cpha = 37830._r8 - vcmaxha = 72000._r8 - jmaxha = 50000._r8 - tpuha = 72000._r8 - lmrha = 46390._r8 - - ! High temperature deactivation, from: - ! Leuning (2002) Plant, Cell and Environment 25:1205-1210 - ! The factor "c" scales the deactivation to a value of 1.0 at 25C - - vcmaxhd = 200000._r8 - jmaxhd = 200000._r8 - tpuhd = 200000._r8 - lmrhd = 150650._r8 - lmrse = 490._r8 - lmrc = fth25 (lmrhd, lmrse) - - ! Miscellaneous parameters, from Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - - fnps = 0.15_r8 - theta_psii = 0.7_r8 - theta_ip = 0.95_r8 - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - ! C3 or C4 photosynthesis logical variable - - if (nint(c3psn(patch%itype(p))) == 1) then - c3flag(p) = .true. - else if (nint(c3psn(patch%itype(p))) == 0) then - c3flag(p) = .false. - end if - - ! C3 and C4 dependent parameters - - if (c3flag(p)) then - qe(p) = 0._r8 - theta_cj(p) = 0.98_r8 - bbbopt(p) = 10000._r8 - else - qe(p) = 0.05_r8 - theta_cj(p) = 0.80_r8 - bbbopt(p) = 40000._r8 - end if - - ! Soil water stress applied to Ball-Berry parameters - - bbb(p) = max (bbbopt(p)*btran(p), 1._r8) - mbb(p) = mbbopt(patch%itype(p)) - - ! kc, ko, cp, from: Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - ! - ! kc25 = 404.9 umol/mol - ! ko25 = 278.4 mmol/mol - ! cp25 = 42.75 umol/mol - ! - ! Derive sco from cp and O2 using present-day O2 (0.209 mol/mol) and re-calculate - ! cp to account for variation in O2 using cp = 0.5 O2 / sco - ! - - kc25 = (404.9_r8 / 1.e06_r8) * forc_pbot(c) - ko25 = (278.4_r8 / 1.e03_r8) * forc_pbot(c) - sco = 0.5_r8 * 0.209_r8 / (42.75_r8 / 1.e06_r8) - cp25 = 0.5_r8 * oair(p) / sco - - kc(p) = kc25 * ft(t_veg(p), kcha) - ko(p) = ko25 * ft(t_veg(p), koha) - cp(p) = cp25 * ft(t_veg(p), cpha) - - end do - - ! Multi-layer parameters scaled by leaf nitrogen profile. - ! Loop through each canopy layer to calculate nitrogen profile using - ! cumulative lai at the midpoint of the layer - - do f = 1, fn - p = filterp(f) - - if (lnc_opt .eqv. .false.) then - ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) - - if ( (slatop(patch%itype(p)) *leafcn(patch%itype(p))) .le. 0.0_r8)then - call endrun( "ERROR: slatop or leafcn is zero" ) - end if - lnc(p) = 1._r8 / (slatop(patch%itype(p)) * leafcn(patch%itype(p))) - end if - - ! Using the actual nitrogen allocated to the leaf after - ! uptake rather than fixing leaf nitrogen based on SLA and CN - ! ratio - if (lnc_opt .eqv. .true.) then - ! nlevcan and nrad(p) look like the same variable ?? check this later - sum_nscaler = 0.0_r8 - laican = 0.0_r8 - total_lai = 0.0_r8 - - do iv = 1, nrad(p) - - if (iv == 1) then - laican = 0.5_r8 * tlai_z(p,iv) - total_lai = tlai_z(p,iv) - else - laican = laican + 0.5_r8 * (tlai_z(p,iv-1)+tlai_z(p,iv)) - total_lai = total_lai + tlai_z(p,iv) - end if - - ! Scale for leaf nitrogen profile. If multi-layer code, use explicit - ! profile. If sun/shade big leaf code, use canopy integrated factor. - if (nlevcan == 1) then - nscaler = 1.0_r8 - else if (nlevcan > 1) then - nscaler = exp(-kn(p) * laican) - end if - - sum_nscaler = sum_nscaler + nscaler - - end do - - if (tlai(p) > 0.0_r8 .AND. sum_nscaler > 0.0_r8) then - ! dividing by LAI to convert total leaf nitrogen - ! from m2 ground to m2 leaf; dividing by sum_nscaler to - ! convert total leaf N to leaf N at canopy top - lnc(p) = leafn(p) / (tlai(p) * sum_nscaler) - else - lnc(p) = 0.0_r8 - end if - - end if - - - ! reduce_dayl_factor .eqv. .false. - if (reduce_dayl_factor .eqv. .true.) then - if (dayl_factor(p) > 0.25_r8) then - ! dayl_factor(p) = 1.0_r8 - end if - end if - - - ! Default - if (vcmax_opt == 0) then - ! vcmax25 at canopy top, as in CN but using lnc at top of the canopy - vcmax25top = lnc(p) * flnr(patch%itype(p)) * fnr * act25 * dayl_factor(p) - if (.not. use_cn) then - vcmax25top = vcmax25top * fnitr(patch%itype(p)) - else - if ( CNAllocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) - end if - else if (vcmax_opt == 3) then - vcmax25top = ( i_vcad(patch%itype(p)) + s_vcad(patch%itype(p)) * lnc(p) ) * dayl_factor(p) - else if (vcmax_opt == 4) then - nptreemax = 9 ! is this number correct? check later - if (patch%itype(p) >= nptreemax) then ! if not tree - ! for shrubs and herbs - vcmax25top = lnc(p) * ( i_flnr(patch%itype(p)) + s_flnr(patch%itype(p)) * lnc(p) ) * fnr * act25 * & - dayl_factor(p) - else - ! if tree - vcmax25top = lnc(p) * ( i_flnr(patch%itype(p)) * exp(s_flnr(patch%itype(p)) * lnc(p)) ) * fnr * act25 * & - dayl_factor(p) - ! for trees - end if - end if - - - ! Parameters derived from vcmax25top. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - ! used jmax25 = 1.97 vcmax25, from Wullschleger (1993) Journal of Experimental Botany 44:907-920. - - jmax25top = (2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top - tpu25top = 0.167_r8 * vcmax25top - kp25top = 20000._r8 * vcmax25top - - ! Nitrogen scaling factor. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 used - ! kn = 0.11. Here, derive kn from vcmax25 as in Lloyd et al (2010) Biogeosciences, 7, 1833-1859 - ! Remove daylength factor from vcmax25 so that kn is based on maximum vcmax25 - ! But not used as defined here if using sun/shade big leaf code. Instead, - ! will use canopy integrated scaling factors from SurfaceAlbedo. - - if (dayl_factor(p) < 1.0e-12_r8) then - kn(p) = 0._r8 - else - kn(p) = exp(0.00963_r8 * vcmax25top/dayl_factor(p) - 2.43_r8) - end if - - if (use_cn) then - if ( leafresp_method == leafresp_mtd_ryan1991 ) then - ! Leaf maintenance respiration to match the base rate used in CN - ! but with the new temperature functions for C3 and C4 plants. - ! - ! Base rate for maintenance respiration is from: - ! M. Ryan, 1991. Effects of climate change on plant respiration. - ! Ecological Applications, 1(2), 157-167. - ! Original expression is br = 0.0106 molC/(molN h) - ! Conversion by molecular weights of C and N gives 2.525e-6 gC/(gN s) - ! - ! Base rate is at 20C. Adjust to 25C using the CN Q10 = 1.5 - ! - ! CN respiration has units: g C / g N [leaf] / s. This needs to be - ! converted from g C / g N [leaf] / s to umol CO2 / m**2 [leaf] / s - ! - ! Then scale this value at the top of the canopy for canopy depth - - lmr25top = 2.525e-6_r8 * (1.5_r8 ** ((25._r8 - 20._r8)/10._r8)) - lmr25top = lmr25top * lnc(p) / 12.e-06_r8 - - else if ( leafresp_method == leafresp_mtd_atkin2015 ) then - !using new form for respiration base rate from Atkin - !communication. - if ( lnc(p) > 0.0_r8 ) then - lmr25top = params_inst%lmr_intercept_atkin(ivt(p)) + (lnc(p) * 0.2061_r8) - (0.0402_r8 * (t10(p)-tfrz)) - else - lmr25top = 0.0_r8 - end if - end if - - else - ! Leaf maintenance respiration in proportion to vcmax25top - - if (c3flag(p)) then - lmr25top = vcmax25top * leaf_mr_vcm - else - lmr25top = vcmax25top * 0.025_r8 - end if - end if - - ! Loop through canopy layers (above snow). Respiration needs to be - ! calculated every timestep. Others are calculated only if daytime - - laican = 0._r8 - do iv = 1, nrad(p) - - ! Cumulative lai at middle of layer - - if (iv == 1) then - laican = 0.5_r8 * tlai_z(p,iv) - else - laican = laican + 0.5_r8 * (tlai_z(p,iv-1)+tlai_z(p,iv)) - end if - - ! Scale for leaf nitrogen profile. If multi-layer code, use explicit - ! profile. If sun/shade big leaf code, use canopy integrated factor. - - if (nlevcan == 1) then - nscaler = vcmaxcint(p) - else if (nlevcan > 1) then - nscaler = exp(-kn(p) * laican) - end if - - ! Maintenance respiration - - lmr25 = lmr25top * nscaler - - if(use_luna.and.c3flag(p).and.crop(patch%itype(p))== 0) then - if(.not.use_cn)then ! If CN is on, use leaf N to predict respiration (above). Otherwise, use Vcmax term from LUNA. RF - lmr25 = leaf_mr_vcm * photosyns_inst%vcmx25_z_patch(p,iv) - endif - endif - - if (c3flag(p)) then - lmr_z(p,iv) = lmr25 * ft(t_veg(p), lmrha) * fth(t_veg(p), lmrhd, lmrse, lmrc) - else - lmr_z(p,iv) = lmr25 * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - lmr_z(p,iv) = lmr_z(p,iv) / (1._r8 + exp( 1.3_r8*(t_veg(p)-(tfrz+55._r8)) )) - end if - - if (par_z(p,iv) <= 0._r8) then ! night time - - vcmax_z(p,iv) = 0._r8 - jmax_z(p,iv) = 0._r8 - tpu_z(p,iv) = 0._r8 - kp_z(p,iv) = 0._r8 - - if ( use_c13 ) then - alphapsn(p) = 1._r8 - end if - - else ! day time - - if(use_luna.and.c3flag(p).and.crop(patch%itype(p))== 0)then - vcmax25 = photosyns_inst%vcmx25_z_patch(p,iv) - jmax25 = photosyns_inst%jmx25_z_patch(p,iv) - tpu25 = 0.167_r8 * vcmax25 - !Implement scaling of Vcmax25 from sunlit average to shaded canopy average value. RF & GBB. 1 July 2016 - if(phase == 'sha'.and.surfalb_inst%vcmaxcintsun_patch(p).gt.0._r8.and.nlevcan==1) then - vcmax25 = vcmax25 * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - jmax25 = jmax25 * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - tpu25 = tpu25 * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - end if - - else - vcmax25 = vcmax25top * nscaler - jmax25 = jmax25top * nscaler - tpu25 = tpu25top * nscaler - endif - kp25 = kp25top * nscaler - - ! Adjust for temperature - - vcmaxse = 668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - jmaxse = 659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - tpuse = vcmaxse - vcmaxc = fth25 (vcmaxhd, vcmaxse) - jmaxc = fth25 (jmaxhd, jmaxse) - tpuc = fth25 (tpuhd, tpuse) - vcmax_z(p,iv) = vcmax25 * ft(t_veg(p), vcmaxha) * fth(t_veg(p), vcmaxhd, vcmaxse, vcmaxc) - jmax_z(p,iv) = jmax25 * ft(t_veg(p), jmaxha) * fth(t_veg(p), jmaxhd, jmaxse, jmaxc) - tpu_z(p,iv) = tpu25 * ft(t_veg(p), tpuha) * fth(t_veg(p), tpuhd, tpuse, tpuc) - - if (.not. c3flag(p)) then - vcmax_z(p,iv) = vcmax25 * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - vcmax_z(p,iv) = vcmax_z(p,iv) / (1._r8 + exp( 0.2_r8*((tfrz+15._r8)-t_veg(p)) )) - vcmax_z(p,iv) = vcmax_z(p,iv) / (1._r8 + exp( 0.3_r8*(t_veg(p)-(tfrz+40._r8)) )) - end if - - kp_z(p,iv) = kp25 * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - - end if - - ! Adjust for soil water - - vcmax_z(p,iv) = vcmax_z(p,iv) * btran(p) - lmr_z(p,iv) = lmr_z(p,iv) * btran(p) - - ! Change to add in light inhibition of respiration. 0.67 from Lloyd et al. 2010, & Metcalfe et al. 2012 - ! Also pers. comm from Peter Reich (Nov 2015). Might potentially be updated pending findings of Atkin et al. (in prep) - ! review of light inhibition database. - if ( light_inhibit .and. par_z(p,1) > 0._r8) then ! are the lights on? - lmr_z(p,iv) = lmr_z(p,iv) * 0.67_r8 ! inhibit respiration accordingly. - end if - - end do ! canopy layer loop - end do ! patch loop - - !==============================================================================! - ! Leaf-level photosynthesis and stomatal conductance - !==============================================================================! - - rsmax0 = 2.e4_r8 - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Leaf boundary layer conductance, umol/m**2/s - - cf = forc_pbot(c)/(rgas*1.e-3_r8*tgcm(p))*1.e06_r8 - gb = 1._r8/rb(p) - gb_mol(p) = gb * cf - - ! Loop through canopy layers (above snow). Only do calculations if daytime - - do iv = 1, nrad(p) - - if (par_z(p,iv) <= 0._r8) then ! night time - - ac(p,iv) = 0._r8 - aj(p,iv) = 0._r8 - ap(p,iv) = 0._r8 - ag(p,iv) = 0._r8 - an(p,iv) = ag(p,iv) - lmr_z(p,iv) - psn_z(p,iv) = 0._r8 - psn_wc_z(p,iv) = 0._r8 - psn_wj_z(p,iv) = 0._r8 - psn_wp_z(p,iv) = 0._r8 - rs_z(p,iv) = min(rsmax0, 1._r8/bbb(p) * cf) - ci_z(p,iv) = 0._r8 - rh_leaf(p) = 0._r8 - - else ! day time - - !now the constraint is no longer needed, Jinyun Tang - ceair = min( eair(p), esat_tv(p) ) - if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - rh_can = ceair / esat_tv(p) - else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used - rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 - end if - - ! Electron transport rate for C3 plants. Convert par from W/m2 to - ! umol photons/m**2/s using the factor 4.6 - - qabs = 0.5_r8 * (1._r8 - fnps) * par_z(p,iv) * 4.6_r8 - aquad = theta_psii - bquad = -(qabs + jmax_z(p,iv)) - cquad = qabs * jmax_z(p,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - je = min(r1,r2) - - ! Iterative loop for ci beginning with initial guess - - if (c3flag(p)) then - ci_z(p,iv) = 0.7_r8 * cair(p) - else - ci_z(p,iv) = 0.4_r8 * cair(p) - end if - - niter = 0 - - ! Increment iteration counter. Stop if too many iterations - - niter = niter + 1 - - ! Save old ci - - ciold = ci_z(p,iv) - - !find ci and stomatal conductance - call hybrid(ciold, p, iv, c, gb_mol(p), je, cair(p), oair(p), & - lmr_z(p,iv), par_z(p,iv), rh_can, gs_mol(p,iv), niter, & - atm2lnd_inst, photosyns_inst) - - ! End of ci iteration. Check for an < 0, in which case gs_mol = bbb - - if (an(p,iv) < 0._r8) gs_mol(p,iv) = bbb(p) - - ! Get local noon sunlit and shaded stomatal conductance - local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - - ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) - if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then - if (phase == 'sun') then - gs_mol_sun_ln(p,iv) = gs_mol(p,iv) - else if (phase == 'sha') then - gs_mol_sha_ln(p,iv) = gs_mol(p,iv) - end if - else - if (phase == 'sun') then - gs_mol_sun_ln(p,iv) = spval - else if (phase == 'sha') then - gs_mol_sha_ln(p,iv) = spval - end if - end if - - ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) - - cs = cair(p) - 1.4_r8/gb_mol(p) * an(p,iv) * forc_pbot(c) - cs = max(cs,1.e-06_r8) - ci_z(p,iv) = cair(p) - an(p,iv) * forc_pbot(c) * (1.4_r8*gs_mol(p,iv)+1.6_r8*gb_mol(p)) / (gb_mol(p)*gs_mol(p,iv)) - - ! Trap for values of ci_z less than 1.e-06. This is needed for - ! Megan (which can crash with negative values) - ci_z(p,iv) = max( ci_z(p,iv), 1.e-06_r8 ) - - ! Convert gs_mol (umol H2O/m**2/s) to gs (m/s) and then to rs (s/m) - - gs = gs_mol(p,iv) / cf - rs_z(p,iv) = min(1._r8/gs, rsmax0) - rs_z(p,iv) = rs_z(p,iv) / o3coefg(p) - - ! Photosynthesis. Save rate-limiting photosynthesis - - psn_z(p,iv) = ag(p,iv) - psn_z(p,iv) = psn_z(p,iv) * o3coefv(p) - - psn_wc_z(p,iv) = 0._r8 - psn_wj_z(p,iv) = 0._r8 - psn_wp_z(p,iv) = 0._r8 - - if (ac(p,iv) <= aj(p,iv) .and. ac(p,iv) <= ap(p,iv)) then - psn_wc_z(p,iv) = psn_z(p,iv) - else if (aj(p,iv) < ac(p,iv) .and. aj(p,iv) <= ap(p,iv)) then - psn_wj_z(p,iv) = psn_z(p,iv) - else if (ap(p,iv) < ac(p,iv) .and. ap(p,iv) < aj(p,iv)) then - psn_wp_z(p,iv) = psn_z(p,iv) - end if - - ! Make sure iterative solution is correct - - if (gs_mol(p,iv) < 0._r8) then - write (iulog,*)'Negative stomatal conductance:' - write (iulog,*)'p,iv,gs_mol= ',p,iv,gs_mol(p,iv) - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - - ! Compare with Ball-Berry model: gs_mol = m * an * hs/cs p + b - - hs = (gb_mol(p)*ceair + gs_mol(p,iv)*esat_tv(p)) / ((gb_mol(p)+gs_mol(p,iv))*esat_tv(p)) - rh_leaf(p) = hs - gs_mol_err = mbb(p)*max(an(p,iv), 0._r8)*hs/cs*forc_pbot(c) + bbb(p) - - if (abs(gs_mol(p,iv)-gs_mol_err) > 1.e-01_r8) then - write (iulog,*) 'Ball-Berry error check - stomatal conductance error:' - write (iulog,*) gs_mol(p,iv), gs_mol_err - end if - - end if ! night or day if branch - end do ! canopy layer loop - end do ! patch loop - - !==============================================================================! - ! Canopy photosynthesis and stomatal conductance - !==============================================================================! - - ! Sum canopy layer fluxes and then derive effective leaf-level fluxes (per - ! unit leaf area), which are used in other parts of the model. Here, laican - ! sums to either laisun or laisha. - - do f = 1, fn - p = filterp(f) - - psncan = 0._r8 - psncan_wc = 0._r8 - psncan_wj = 0._r8 - psncan_wp = 0._r8 - lmrcan = 0._r8 - gscan = 0._r8 - laican = 0._r8 - do iv = 1, nrad(p) - psncan = psncan + psn_z(p,iv) * lai_z(p,iv) - psncan_wc = psncan_wc + psn_wc_z(p,iv) * lai_z(p,iv) - psncan_wj = psncan_wj + psn_wj_z(p,iv) * lai_z(p,iv) - psncan_wp = psncan_wp + psn_wp_z(p,iv) * lai_z(p,iv) - lmrcan = lmrcan + lmr_z(p,iv) * lai_z(p,iv) - gscan = gscan + lai_z(p,iv) / (rb(p)+rs_z(p,iv)) - laican = laican + lai_z(p,iv) - end do - if (laican > 0._r8) then - psn(p) = psncan / laican - psn_wc(p) = psncan_wc / laican - psn_wj(p) = psncan_wj / laican - psn_wp(p) = psncan_wp / laican - lmr(p) = lmrcan / laican - rs(p) = laican / gscan - rb(p) - else - psn(p) = 0._r8 - psn_wc(p) = 0._r8 - psn_wj(p) = 0._r8 - psn_wp(p) = 0._r8 - lmr(p) = 0._r8 - rs(p) = 0._r8 - end if - end do - - end associate - - end subroutine Photosynthesis - - !------------------------------------------------------------------------------ - subroutine PhotosynthesisTotal (fn, filterp, & - atm2lnd_inst, canopystate_inst, photosyns_inst) - ! - ! Determine total photosynthesis - ! - ! !ARGUMENTS: - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! patch filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - ! - ! !LOCAL VARIABLES: - integer :: f,fp,p,l,g ! indices - - real(r8) :: rc14_atm(nsectors_c14), rc13_atm - integer :: sector_c14 - !----------------------------------------------------------------------- - - associate( & - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - forc_pc13o2 => atm2lnd_inst%forc_pc13o2_grc , & ! Input: [real(r8) (:) ] partial pressure c13o2 (Pa) - forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] partial pressure o2 (Pa) - - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - - psnsun => photosyns_inst%psnsun_patch , & ! Input: [real(r8) (:) ] sunlit leaf photosynthesis (umol CO2 /m**2/ s) - psnsha => photosyns_inst%psnsha_patch , & ! Input: [real(r8) (:) ] shaded leaf photosynthesis (umol CO2 /m**2/ s) - rc13_canair => photosyns_inst%rc13_canair_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in canopy air - rc13_psnsun => photosyns_inst%rc13_psnsun_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in sunlit canopy psn flux - rc13_psnsha => photosyns_inst%rc13_psnsha_patch , & ! Output: [real(r8) (:) ] C13O2/C12O2 in shaded canopy psn flux - alphapsnsun => photosyns_inst%alphapsnsun_patch , & ! Output: [real(r8) (:) ] fractionation factor in sunlit canopy psn flux - alphapsnsha => photosyns_inst%alphapsnsha_patch , & ! Output: [real(r8) (:) ] fractionation factor in shaded canopy psn flux - psnsun_wc => photosyns_inst%psnsun_wc_patch , & ! Output: [real(r8) (:) ] Rubsico-limited sunlit leaf photosynthesis (umol CO2 /m**2/ s) - psnsun_wj => photosyns_inst%psnsun_wj_patch , & ! Output: [real(r8) (:) ] RuBP-limited sunlit leaf photosynthesis (umol CO2 /m**2/ s) - psnsun_wp => photosyns_inst%psnsun_wp_patch , & ! Output: [real(r8) (:) ] product-limited sunlit leaf photosynthesis (umol CO2 /m**2/ s) - psnsha_wc => photosyns_inst%psnsha_wc_patch , & ! Output: [real(r8) (:) ] Rubsico-limited shaded leaf photosynthesis (umol CO2 /m**2/ s) - psnsha_wj => photosyns_inst%psnsha_wj_patch , & ! Output: [real(r8) (:) ] RuBP-limited shaded leaf photosynthesis (umol CO2 /m**2/ s) - psnsha_wp => photosyns_inst%psnsha_wp_patch , & ! Output: [real(r8) (:) ] product-limited shaded leaf photosynthesis (umol CO2 /m**2/ s) - c13_psnsun => photosyns_inst%c13_psnsun_patch , & ! Output: [real(r8) (:) ] sunlit leaf photosynthesis (umol 13CO2 /m**2/ s) - c13_psnsha => photosyns_inst%c13_psnsha_patch , & ! Output: [real(r8) (:) ] shaded leaf photosynthesis (umol 13CO2 /m**2/ s) - c14_psnsun => photosyns_inst%c14_psnsun_patch , & ! Output: [real(r8) (:) ] sunlit leaf photosynthesis (umol 14CO2 /m**2/ s) - c14_psnsha => photosyns_inst%c14_psnsha_patch , & ! Output: [real(r8) (:) ] shaded leaf photosynthesis (umol 14CO2 /m**2/ s) - fpsn => photosyns_inst%fpsn_patch , & ! Output: [real(r8) (:) ] photosynthesis (umol CO2 /m**2 /s) - fpsn_wc => photosyns_inst%fpsn_wc_patch , & ! Output: [real(r8) (:) ] Rubisco-limited photosynthesis (umol CO2 /m**2 /s) - fpsn_wj => photosyns_inst%fpsn_wj_patch , & ! Output: [real(r8) (:) ] RuBP-limited photosynthesis (umol CO2 /m**2 /s) - fpsn_wp => photosyns_inst%fpsn_wp_patch & ! Output: [real(r8) (:) ] product-limited photosynthesis (umol CO2 /m**2 /s) - ) - - if ( use_c14 ) then - if (use_c14_bombspike) then - call C14BombSpike(rc14_atm) - else - rc14_atm(:) = c14ratio - end if - end if - - if ( use_c13 ) then - if (use_c13_timeseries) then - call C13TimeSeries(rc13_atm) - end if - end if - - do f = 1, fn - p = filterp(f) - g = patch%gridcell(p) - - if (.not. use_fates) then - fpsn(p) = psnsun(p) *laisun(p) + psnsha(p) *laisha(p) - fpsn_wc(p) = psnsun_wc(p)*laisun(p) + psnsha_wc(p)*laisha(p) - fpsn_wj(p) = psnsun_wj(p)*laisun(p) + psnsha_wj(p)*laisha(p) - fpsn_wp(p) = psnsun_wp(p)*laisun(p) + psnsha_wp(p)*laisha(p) - end if - - if (use_cn) then - if ( use_c13 ) then - if (use_c13_timeseries) then - rc13_canair(p) = rc13_atm - else - rc13_canair(p) = forc_pc13o2(g)/(forc_pco2(g) - forc_pc13o2(g)) - endif - rc13_psnsun(p) = rc13_canair(p)/alphapsnsun(p) - rc13_psnsha(p) = rc13_canair(p)/alphapsnsha(p) - c13_psnsun(p) = psnsun(p) * (rc13_psnsun(p)/(1._r8+rc13_psnsun(p))) - c13_psnsha(p) = psnsha(p) * (rc13_psnsha(p)/(1._r8+rc13_psnsha(p))) - - ! use fixed c13 ratio with del13C of -25 to test the overall c13 structure - ! c13_psnsun(p) = 0.01095627 * psnsun(p) - ! c13_psnsha(p) = 0.01095627 * psnsha(p) - endif - if ( use_c14 ) then - - ! determine latitute sector for radiocarbon bomb spike inputs - if ( grc%latdeg(g) .ge. 30._r8 ) then - sector_c14 = 1 - else if ( grc%latdeg(g) .ge. -30._r8 ) then - sector_c14 = 2 - else - sector_c14 = 3 - endif - - c14_psnsun(p) = rc14_atm(sector_c14) * psnsun(p) - c14_psnsha(p) = rc14_atm(sector_c14) * psnsha(p) - endif - end if - - end do - - end associate - - end subroutine PhotosynthesisTotal - - !------------------------------------------------------------------------------ - subroutine Fractionation(bounds, fn, filterp, downreg, & - atm2lnd_inst, canopystate_inst, solarabs_inst, surfalb_inst, photosyns_inst, & - phase) - ! - ! !DESCRIPTION: - ! C13 fractionation during photosynthesis is calculated here after the nitrogen - ! limitation is taken into account in the CNAllocation module. - ! - ! As of CLM5, nutrient downregulation occurs prior to photosynthesis via leafcn, so we may - ! ignore the downregulation term in this and assume that the Ci/Ca used in the photosynthesis - ! calculation is consistent with that in the isotope calculation - ! - !!USES: - use clm_varctl , only : use_hydrstress - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! patch filter - real(r8) , intent(in) :: downreg( bounds%begp: ) ! fractional reduction in GPP due to N limitation (dimensionless) - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(photosyns_type) , intent(in) :: photosyns_inst - character(len=*) , intent(in) :: phase ! 'sun' or 'sha' - ! - ! !LOCAL VARIABLES: - real(r8) , pointer :: par_z (:,:) ! needed for backwards compatiblity - real(r8) , pointer :: alphapsn (:) ! needed for backwards compatiblity - real(r8) , pointer :: gs_mol(:,:) ! leaf stomatal conductance (umol H2O/m**2/s) - real(r8) , pointer :: an(:,:) ! net leaf photosynthesis (umol CO2/m**2/s) - integer :: f,p,c,g,iv ! indices - real(r8) :: co2(bounds%begp:bounds%endp) ! atmospheric co2 partial pressure (pa) - real(r8) :: ci - !------------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(downreg) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - - c3psn => pftcon%c3psn , & ! Input: photosynthetic pathway: 0. = c4, 1. = c3 - - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] number of canopy layers, above snow for radiative transfer - - gb_mol => photosyns_inst%gb_mol_patch & ! Input: [real(r8) (:) ] leaf boundary layer conductance (umol H2O/m**2/s) - ) - - if (phase == 'sun') then - par_z => solarabs_inst%parsun_z_patch ! Input : [real(r8) (:,:)] par absorbed per unit lai for canopy layer (w/m**2) - alphapsn => photosyns_inst%alphapsnsun_patch ! Output: [real(r8) (:)] - if (use_hydrstress) then - gs_mol => photosyns_inst%gs_mol_sun_patch ! Input: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) - an => photosyns_inst%an_sun_patch ! Input: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) - else - gs_mol => photosyns_inst%gs_mol_patch ! Input: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) - an => photosyns_inst%an_patch ! Input: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) - end if - else if (phase == 'sha') then - par_z => solarabs_inst%parsha_z_patch ! Input : [real(r8) (:,:)] par absorbed per unit lai for canopy layer (w/m**2) - alphapsn => photosyns_inst%alphapsnsha_patch ! Output: [real(r8) (:)] - if (use_hydrstress) then - gs_mol => photosyns_inst%gs_mol_sha_patch ! Input: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) - an => photosyns_inst%an_sha_patch ! Input: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) - else - gs_mol => photosyns_inst%gs_mol_patch ! Input: [real(r8) (:,:) ] leaf stomatal conductance (umol H2O/m**2/s) - an => photosyns_inst%an_patch ! Input: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) - end if - end if - - do f = 1, fn - p = filterp(f) - c= patch%column(p) - g= patch%gridcell(p) - - co2(p) = forc_pco2(g) - do iv = 1,nrad(p) - if (par_z(p,iv) <= 0._r8) then ! night time - alphapsn(p) = 1._r8 - else ! day time - ci = co2(p) - (an(p,iv) * & - forc_pbot(c) * & - (1.4_r8*gs_mol(p,iv)+1.6_r8*gb_mol(p)) / (gb_mol(p)*gs_mol(p,iv))) - alphapsn(p) = 1._r8 + (((c3psn(patch%itype(p)) * & - (4.4_r8 + (22.6_r8*(ci/co2(p))))) + & - ((1._r8 - c3psn(patch%itype(p))) * 4.4_r8))/1000._r8) - end if - end do - end do - - end associate - - end subroutine Fractionation - - !------------------------------------------------------------------------------- - subroutine hybrid(x0, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z,& - rh_can, gs_mol,iter, & - atm2lnd_inst, photosyns_inst) - ! - !! DESCRIPTION: - ! use a hybrid solver to find the root of equation - ! f(x) = x- h(x), - !we want to find x, s.t. f(x) = 0. - !the hybrid approach combines the strength of the newton secant approach (find the solution domain) - !and the bisection approach implemented with the Brent's method to guarrantee convergence. - - ! - !! REVISION HISTORY: - !Dec 14/2012: created by Jinyun Tang - ! - !!USES: - ! - !! ARGUMENTS: - implicit none - real(r8), intent(inout) :: x0 !initial guess and final value of the solution - real(r8), intent(in) :: lmr_z ! canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), intent(in) :: par_z ! par absorbed per unit lai for canopy layer (w/m**2) - real(r8), intent(in) :: rh_can ! canopy air relative humidity - real(r8), intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8), intent(in) :: je ! electron transport rate (umol electrons/m**2/s) - real(r8), intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8), intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - integer, intent(in) :: p, iv, c ! pft, c3/c4, and column index - real(r8), intent(out) :: gs_mol ! leaf stomatal conductance (umol H2O/m**2/s) - integer, intent(out) :: iter !number of iterations used, for record only - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type), intent(inout) :: photosyns_inst - ! - !! LOCAL VARIABLES - real(r8) :: a, b - real(r8) :: fa, fb - real(r8) :: x1, f0, f1 - real(r8) :: x, dx - real(r8), parameter :: eps = 1.e-2_r8 !relative accuracy - real(r8), parameter :: eps1= 1.e-4_r8 - integer, parameter :: itmax = 40 !maximum number of iterations - real(r8) :: tol,minx,minf - - call ci_func(x0, f0, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z, rh_can, gs_mol, & - atm2lnd_inst, photosyns_inst) - - if(f0 == 0._r8)return - - minx=x0 - minf=f0 - x1 = x0 * 0.99_r8 - - call ci_func(x1,f1, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z, rh_can, gs_mol, & - atm2lnd_inst, photosyns_inst) - - if(f1==0._r8)then - x0 = x1 - return - endif - if(f1itmax)then - !in case of failing to converge within itmax iterations - !stop at the minimum function - !this happens because of some other issues besides the stomatal conductance calculation - !and it happens usually in very dry places and more likely with c4 plants. - - call ci_func(minx,f1, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z, rh_can, gs_mol, & - atm2lnd_inst, photosyns_inst) - - exit - endif - enddo - - end subroutine hybrid - - !------------------------------------------------------------------------------ - subroutine brent(x, x1,x2,f1, f2, tol, ip, iv, ic, gb_mol, je, cair, oair,& - lmr_z, par_z, rh_can, gs_mol, & - atm2lnd_inst, photosyns_inst) - ! - !!DESCRIPTION: - !Use Brent's method to find the root of a single variable function ci_func, which is known to exist between x1 and x2. - !The found root will be updated until its accuracy is tol. - - !!REVISION HISTORY: - !Dec 14/2012: Jinyun Tang, modified from numerical recipes in F90 by press et al. 1188-1189 - ! - !!ARGUMENTS: - real(r8), intent(out) :: x ! indepedent variable of the single value function ci_func(x) - real(r8), intent(in) :: x1, x2, f1, f2 ! minimum and maximum of the variable domain to search for the solution ci_func(x1) = f1, ci_func(x2)=f2 - real(r8), intent(in) :: tol ! the error tolerance - real(r8), intent(in) :: lmr_z ! canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), intent(in) :: par_z ! par absorbed per unit lai for canopy layer (w/m**2) - real(r8), intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8), intent(in) :: je ! electron transport rate (umol electrons/m**2/s) - real(r8), intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8), intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - real(r8), intent(in) :: rh_can ! inside canopy relative humidity - integer, intent(in) :: ip, iv, ic ! pft, c3/c4, and column index - real(r8), intent(out) :: gs_mol ! leaf stomatal conductance (umol H2O/m**2/s) - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type), intent(inout) :: photosyns_inst - ! - !!LOCAL VARIABLES: - integer, parameter :: itmax=20 !maximum number of iterations - real(r8), parameter :: eps=1.e-2_r8 !relative error tolerance - integer :: iter - real(r8) :: a,b,c,d,e,fa,fb,fc,p,q,r,s,tol1,xm - !------------------------------------------------------------------------------ - - a=x1 - b=x2 - fa=f1 - fb=f2 - if((fa > 0._r8 .and. fb > 0._r8).or.(fa < 0._r8 .and. fb < 0._r8))then - write(iulog,*) 'root must be bracketed for brent' - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - c=b - fc=fb - iter = 0 - do - if(iter==itmax)exit - iter=iter+1 - if((fb > 0._r8 .and. fc > 0._r8) .or. (fb < 0._r8 .and. fc < 0._r8))then - c=a !Rename a, b, c and adjust bounding interval d. - fc=fa - d=b-a - e=d - endif - if( abs(fc) < abs(fb)) then - a=b - b=c - c=a - fa=fb - fb=fc - fc=fa - endif - tol1=2._r8*eps*abs(b)+0.5_r8*tol !Convergence check. - xm=0.5_r8*(c-b) - if(abs(xm) <= tol1 .or. fb == 0.)then - x=b - return - endif - if(abs(e) >= tol1 .and. abs(fa) > abs(fb)) then - s=fb/fa !Attempt inverse quadratic interpolation. - if(a == c) then - p=2._r8*xm*s - q=1._r8-s - else - q=fa/fc - r=fb/fc - p=s*(2._r8*xm*q*(q-r)-(b-a)*(r-1._r8)) - q=(q-1._r8)*(r-1._r8)*(s-1._r8) - endif - if(p > 0._r8) q=-q !Check whether in bounds. - p=abs(p) - if(2._r8*p < min(3._r8*xm*q-abs(tol1*q),abs(e*q))) then - e=d !Accept interpolation. - d=p/q - else - d=xm !Interpolation failed, use bisection. - e=d - endif - else !Bounds decreasing too slowly, use bisection. - d=xm - e=d - endif - a=b !Move last best guess to a. - fa=fb - if(abs(d) > tol1) then !Evaluate new trial root. - b=b+d - else - b=b+sign(tol1,xm) - endif - - call ci_func(b, fb, ip, iv, ic, gb_mol, je, cair, oair, lmr_z, par_z, rh_can, gs_mol, & - atm2lnd_inst, photosyns_inst) - - if(fb==0._r8)exit - - enddo - - if(iter==itmax)write(iulog,*) 'brent exceeding maximum iterations', b, fb - x=b - - return - end subroutine brent - - !------------------------------------------------------------------------------- - function ft(tl, ha) result(ans) - ! - !!DESCRIPTION: - ! photosynthesis temperature response - ! - ! !REVISION HISTORY - ! Jinyun Tang separated it out from Photosynthesis, Feb. 07/2013 - ! - !!USES - use clm_varcon , only : rgas, tfrz - ! - ! !ARGUMENTS: - real(r8), intent(in) :: tl ! leaf temperature in photosynthesis temperature function (K) - real(r8), intent(in) :: ha ! activation energy in photosynthesis temperature function (J/mol) - ! - ! !LOCAL VARIABLES: - real(r8) :: ans - !------------------------------------------------------------------------------- - - ans = exp( ha / (rgas*1.e-3_r8*(tfrz+25._r8)) * (1._r8 - (tfrz+25._r8)/tl) ) - - return - end function ft - - !------------------------------------------------------------------------------- - function fth(tl,hd,se,scaleFactor) result(ans) - ! - !!DESCRIPTION: - !photosynthesis temperature inhibition - ! - ! !REVISION HISTORY - ! Jinyun Tang separated it out from Photosynthesis, Feb. 07/2013 - ! - use clm_varcon , only : rgas, tfrz - ! - ! !ARGUMENTS: - real(r8), intent(in) :: tl ! leaf temperature in photosynthesis temperature function (K) - real(r8), intent(in) :: hd ! deactivation energy in photosynthesis temperature function (J/mol) - real(r8), intent(in) :: se ! entropy term in photosynthesis temperature function (J/mol/K) - real(r8), intent(in) :: scaleFactor ! scaling factor for high temperature inhibition (25 C = 1.0) - ! - ! !LOCAL VARIABLES: - real(r8) :: ans - !------------------------------------------------------------------------------- - - ans = scaleFactor / ( 1._r8 + exp( (-hd+se*tl) / (rgas*1.e-3_r8*tl) ) ) - - return - end function fth - - !------------------------------------------------------------------------------- - function fth25(hd,se)result(ans) - ! - !!DESCRIPTION: - ! scaling factor for photosynthesis temperature inhibition - ! - ! !REVISION HISTORY: - ! Jinyun Tang separated it out from Photosynthesis, Feb. 07/2013 - ! - !!USES - use clm_varcon , only : rgas, tfrz - ! - ! !ARGUMENTS: - real(r8), intent(in) :: hd ! deactivation energy in photosynthesis temperature function (J/mol) - real(r8), intent(in) :: se ! entropy term in photosynthesis temperature function (J/mol/K) - ! - ! !LOCAL VARIABLES: - real(r8) :: ans - !------------------------------------------------------------------------------- - - ans = 1._r8 + exp( (-hd+se*(tfrz+25._r8)) / (rgas*1.e-3_r8*(tfrz+25._r8)) ) - - return - end function fth25 - - !------------------------------------------------------------------------------ - subroutine ci_func(ci, fval, p, iv, c, gb_mol, je, cair, oair, lmr_z, par_z,& - rh_can, gs_mol, atm2lnd_inst, photosyns_inst) - ! - !! DESCRIPTION: - ! evaluate the function - ! f(ci)=ci - (ca - (1.37rb+1.65rs))*patm*an - ! - ! remark: I am attempting to maintain the original code structure, also - ! considering one may be interested to output relevant variables for the - ! photosynthesis model, I have decided to add these relevant variables to - ! the relevant data types. - ! - !!ARGUMENTS: - real(r8) , intent(in) :: ci ! intracellular leaf CO2 (Pa) - real(r8) , intent(in) :: lmr_z ! canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8) , intent(in) :: par_z ! par absorbed per unit lai for canopy layer (w/m**2) - real(r8) , intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: je ! electron transport rate (umol electrons/m**2/s) - real(r8) , intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8) , intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - real(r8) , intent(in) :: rh_can ! canopy air realtive humidity - integer , intent(in) :: p, iv, c ! pft, vegetation type and column indexes - real(r8) , intent(out) :: fval ! return function of the value f(ci) - real(r8) , intent(out) :: gs_mol ! leaf stomatal conductance (umol H2O/m**2/s) - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - ! - !local variables - real(r8) :: ai ! intermediate co-limited photosynthesis (umol CO2/m**2/s) - real(r8) :: cs ! CO2 partial pressure at leaf surface (Pa) - - real(r8) :: aquad, bquad, cquad ! terms for quadratic equations - real(r8) :: r1, r2 ! roots of quadratic equation - real(r8) :: fnps ! fraction of light absorbed by non-photosynthetic pigments - real(r8) :: theta_psii ! empirical curvature parameter for electron transport rate - real(r8) :: theta_ip ! empirical curvature parameter for ap photosynthesis co-limitation - !------------------------------------------------------------------------------ - - associate(& - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Output: [real(r8) (:) ] atmospheric pressure (Pa) - c3flag => photosyns_inst%c3flag_patch , & ! Output: [logical (:) ] true if C3 and false if C4 - ac => photosyns_inst%ac_patch , & ! Output: [real(r8) (:,:) ] Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - aj => photosyns_inst%aj_patch , & ! Output: [real(r8) (:,:) ] RuBP-limited gross photosynthesis (umol CO2/m**2/s) - ap => photosyns_inst%ap_patch , & ! Output: [real(r8) (:,:) ] product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - ag => photosyns_inst%ag_patch , & ! Output: [real(r8) (:,:) ] co-limited gross leaf photosynthesis (umol CO2/m**2/s) - an => photosyns_inst%an_patch , & ! Output: [real(r8) (:,:) ] net leaf photosynthesis (umol CO2/m**2/s) - vcmax_z => photosyns_inst%vcmax_z_patch , & ! Input: [real(r8) (:,:) ] maximum rate of carboxylation (umol co2/m**2/s) - cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) - kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) - ko => photosyns_inst%ko_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for O2 (Pa) - qe => photosyns_inst%qe_patch , & ! Output: [real(r8) (:) ] quantum efficiency, used only for C4 (mol CO2 / mol photons) - tpu_z => photosyns_inst%tpu_z_patch , & ! Output: [real(r8) (:,:) ] triose phosphate utilization rate (umol CO2/m**2/s) - kp_z => photosyns_inst%kp_z_patch , & ! Output: [real(r8) (:,:) ] initial slope of CO2 response curve (C4 plants) - theta_cj => photosyns_inst%theta_cj_patch , & ! Output: [real(r8) (:) ] empirical curvature parameter for ac, aj photosynthesis co-limitation - bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - mbb => photosyns_inst%mbb_patch & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship - ) - - ! Miscellaneous parameters, from Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - fnps = 0.15_r8 - theta_psii = 0.7_r8 - theta_ip = 0.95_r8 - - if (c3flag(p)) then - ! C3: Rubisco-limited photosynthesis - ac(p,iv) = vcmax_z(p,iv) * max(ci-cp(p), 0._r8) / (ci+kc(p)*(1._r8+oair/ko(p))) - - ! C3: RuBP-limited photosynthesis - aj(p,iv) = je * max(ci-cp(p), 0._r8) / (4._r8*ci+8._r8*cp(p)) - - ! C3: Product-limited photosynthesis - ap(p,iv) = 3._r8 * tpu_z(p,iv) - - else - - ! C4: Rubisco-limited photosynthesis - ac(p,iv) = vcmax_z(p,iv) - - ! C4: RuBP-limited photosynthesis - aj(p,iv) = qe(p) * par_z * 4.6_r8 - - ! C4: PEP carboxylase-limited (CO2-limited) - ap(p,iv) = kp_z(p,iv) * max(ci, 0._r8) / forc_pbot(c) - - end if - - ! Gross photosynthesis. First co-limit ac and aj. Then co-limit ap - - aquad = theta_cj(p) - bquad = -(ac(p,iv) + aj(p,iv)) - cquad = ac(p,iv) * aj(p,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ai = min(r1,r2) - - aquad = theta_ip - bquad = -(ai + ap(p,iv)) - cquad = ai * ap(p,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ag(p,iv) = max(0._r8,min(r1,r2)) - - ! Net photosynthesis. Exit iteration if an < 0 - - an(p,iv) = ag(p,iv) - lmr_z - if (an(p,iv) < 0._r8) then - fval = 0._r8 - return - endif - ! Quadratic gs_mol calculation with an known. Valid for an >= 0. - ! With an <= 0, then gs_mol = bbb - - cs = cair - 1.4_r8/gb_mol * an(p,iv) * forc_pbot(c) - cs = max(cs,1.e-06_r8) - aquad = cs - bquad = cs*(gb_mol - bbb(p)) - mbb(p)*an(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs*bbb(p) + mbb(p)*an(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol = max(r1,r2) - - ! Derive new estimate for ci - - fval =ci - cair + an(p,iv) * forc_pbot(c) * (1.4_r8*gs_mol+1.6_r8*gb_mol) / (gb_mol*gs_mol) - - end associate - - end subroutine ci_func - - !------------------------------------------------------------------------------ - subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & - esat_tv, eair, oair, cair, rb, bsun, bsha, btran, dayl_factor, leafn, & - qsatl, qaf, & - atm2lnd_inst, temperature_inst, soilstate_inst, waterstate_inst, & - surfalb_inst, solarabs_inst, canopystate_inst, ozone_inst, & - photosyns_inst, waterflux_inst, froot_carbon, croot_carbon) - ! - ! !DESCRIPTION: - ! Leaf photosynthesis and stomatal conductance calculation as described by - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 and extended to - ! a multi-layer canopy - ! Here, sunlit and shaded photosynthesis and stomatal conductance are solved - ! simultaneously per Pierre Gentine/Daniel Kennedy plant hydraulic stress - ! method - ! - ! !USES: - use clm_varcon , only : rgas, tfrz, rpi, spval, degpsec, isecspday - use GridcellType , only : grc - use clm_time_manager , only : get_curr_date, get_step_size - use clm_varctl , only : cnallocate_carbon_only - use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt - use clm_varpar , only : nlevsoi - use pftconMod , only : nbrdlf_dcd_tmp_shrub, npcropmin - use ColumnType , only : col - use shr_infnan_mod , only : shr_infnan_isnan - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! patch filter - real(r8) , intent(in) :: esat_tv( bounds%begp: ) ! saturation vapor pressure at t_veg (Pa) [pft] - real(r8) , intent(in) :: eair( bounds%begp: ) ! vapor pressure of canopy air (Pa) [pft] - real(r8) , intent(in) :: oair( bounds%begp: ) ! Atmospheric O2 partial pressure (Pa) [pft] - real(r8) , intent(in) :: cair( bounds%begp: ) ! Atmospheric CO2 partial pressure (Pa) [pft] - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) [pft] - real(r8) , intent(in) :: dayl_factor( bounds%begp: ) ! scalar (0-1) for daylength - real(r8) , intent(in) :: qsatl ( bounds%begp: ) ! leaf specific humidity [kg/kg] - real(r8) , intent(in) :: qaf ( bounds%begp: ) ! humidity of canopy air [kg/kg] - real(r8) , intent(in) :: leafn( bounds%begp: ) ! leaf N (gN/m2) - real(r8) , intent(out) :: bsun( bounds%begp: ) ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8) , intent(out) :: bsha( bounds%begp: ) ! shaded canopy transpiration wetness factor (0 to 1) - real(r8) , intent(out) :: btran( bounds%begp: ) ! transpiration wetness factor (0 to 1) [pft] - real(r8) , intent(in) :: froot_carbon( bounds%begp: ) ! fine root carbon (gC/m2) [pft] - real(r8) , intent(in) :: croot_carbon( bounds%begp: ) ! live coarse root carbon (gC/m2) [pft] - - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(in) :: temperature_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - class(ozone_base_type) , intent(in) :: ozone_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - ! - ! !LOCAL VARIABLES: - ! - ! Leaf photosynthesis parameters - real(r8) :: jmax_z(bounds%begp:bounds%endp,2,nlevcan) ! maximum electron transport rate (umol electrons/m**2/s) - real(r8) :: bbbopt(bounds%begp:bounds%endp) ! Ball-Berry minimum leaf conductance, unstressed (umol H2O/m**2/s) - real(r8) :: kn(bounds%begp:bounds%endp) ! leaf nitrogen decay coefficient - real(r8) :: vcmax25top ! canopy top: maximum rate of carboxylation at 25C (umol CO2/m**2/s) - real(r8) :: jmax25top ! canopy top: maximum electron transport rate at 25C (umol electrons/m**2/s) - real(r8) :: tpu25top ! canopy top: triose phosphate utilization rate at 25C (umol CO2/m**2/s) - real(r8) :: lmr25top ! canopy top: leaf maintenance respiration rate at 25C (umol CO2/m**2/s) - real(r8) :: kp25top ! canopy top: initial slope of CO2 response curve (C4 plants) at 25C - - real(r8) :: vcmax25_sun ! sunlit leaf layer: maximum rate of carboxylation at 25C (umol CO2/m**2/s) - real(r8) :: vcmax25_sha ! shaded leaf layer: maximum rate of carboxylation at 25C (umol CO2/m**2/s) - real(r8) :: jmax25_sun ! sunlit leaf layer: maximum electron transport rate at 25C (umol electrons/m**2/s) - real(r8) :: jmax25_sha ! shaded leaf layer: maximum electron transport rate at 25C (umol electrons/m**2/s) - real(r8) :: tpu25_sun ! sunlit leaf layer: triose phosphate utilization rate at 25C (umol CO2/m**2/s) - real(r8) :: tpu25_sha ! shaded leaf layer: triose phosphate utilization rate at 25C (umol CO2/m**2/s) - real(r8) :: lmr25_sun ! sunlit leaf layer: leaf maintenance respiration rate at 25C (umol CO2/m**2/s) - real(r8) :: lmr25_sha ! shaded leaf layer: leaf maintenance respiration rate at 25C (umol CO2/m**2/s) - real(r8) :: kp25_sun ! sunlit leaf layer: Initial slope of CO2 response curve (C4 plants) at 25C - real(r8) :: kp25_sha ! shaded leaf layer: Initial slope of CO2 response curve (C4 plants) at 25C - real(r8) :: kc25 ! Michaelis-Menten constant for CO2 at 25C (Pa) - real(r8) :: ko25 ! Michaelis-Menten constant for O2 at 25C (Pa) - real(r8) :: cp25 ! CO2 compensation point at 25C (Pa) - - real(r8) :: vcmaxha ! activation energy for vcmax (J/mol) - real(r8) :: jmaxha ! activation energy for jmax (J/mol) - real(r8) :: tpuha ! activation energy for tpu (J/mol) - real(r8) :: lmrha ! activation energy for lmr (J/mol) - real(r8) :: kcha ! activation energy for kc (J/mol) - real(r8) :: koha ! activation energy for ko (J/mol) - real(r8) :: cpha ! activation energy for cp (J/mol) - - real(r8) :: vcmaxhd ! deactivation energy for vcmax (J/mol) - real(r8) :: jmaxhd ! deactivation energy for jmax (J/mol) - real(r8) :: tpuhd ! deactivation energy for tpu (J/mol) - real(r8) :: lmrhd ! deactivation energy for lmr (J/mol) - - real(r8) :: vcmaxse ! entropy term for vcmax (J/mol/K) - real(r8) :: jmaxse ! entropy term for jmax (J/mol/K) - real(r8) :: tpuse ! entropy term for tpu (J/mol/K) - real(r8) :: lmrse ! entropy term for lmr (J/mol/K) - - real(r8) :: vcmaxc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: jmaxc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: tpuc ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: lmrc ! scaling factor for high temperature inhibition (25 C = 1.0) - - real(r8) :: fnps ! fraction of light absorbed by non-photosynthetic pigments - real(r8) :: theta_psii ! empirical curvature parameter for electron transport rate - - real(r8) :: theta_ip ! empirical curvature parameter for ap photosynthesis co-limitation - - ! Other - integer :: f,p,c,iv ! indices - real(r8) :: cf ! s m**2/umol -> s/m - real(r8) :: rsmax0 ! maximum stomatal resistance [s/m] - real(r8) :: gb ! leaf boundary layer conductance (m/s) - real(r8) :: cs_sun ! CO2 partial pressure at sunlit leaf surface (Pa) - real(r8) :: cs_sha ! CO2 partial pressure at shaded leaf surface (Pa) - real(r8) :: gs ! leaf stomatal conductance (m/s) - real(r8) :: hs ! fractional humidity at leaf surface (dimensionless) - real(r8) :: sco ! relative specificity of rubisco - real(r8) :: ft ! photosynthesis temperature response (statement function) - real(r8) :: fth ! photosynthesis temperature inhibition (statement function) - real(r8) :: fth25 ! ccaling factor for photosynthesis temperature inhibition (statement function) - real(r8) :: tl ! leaf temperature in photosynthesis temperature function (K) - real(r8) :: ha ! activation energy in photosynthesis temperature function (J/mol) - real(r8) :: hd ! deactivation energy in photosynthesis temperature function (J/mol) - real(r8) :: se ! entropy term in photosynthesis temperature function (J/mol/K) - real(r8) :: scaleFactor ! scaling factor for high temperature inhibition (25 C = 1.0) - real(r8) :: ciold ! previous value of Ci for convergence check - real(r8) :: gs_mol_err ! gs_mol for error check - real(r8) :: je_sun ! sunlit leaf electron transport rate (umol electrons/m**2/s) - real(r8) :: je_sha ! shaded leaf electron transport rate (umol electrons/m**2/s) - real(r8) :: qabs ! PAR absorbed by PS II (umol photons/m**2/s) - real(r8) :: aquad,bquad,cquad ! terms for quadratic equations - real(r8) :: r1,r2 ! roots of quadratic equation - real(r8) :: ceair ! vapor pressure of air, constrained (Pa) - real(r8) :: fnr ! (gRubisco/gN in Rubisco) - real(r8) :: act25 ! (umol/mgRubisco/min) Rubisco activity at 25 C - integer :: iter1 ! number of iterations used, for record only - integer :: iter2 ! number of iterations used, for record only - real(r8) :: nscaler ! leaf nitrogen scaling coefficient - real(r8) :: nscaler_sun ! sunlit leaf nitrogen scaling coefficient - real(r8) :: nscaler_sha ! shaded leaf nitrogen scaling coefficient - - real(r8) :: ai ! intermediate co-limited photosynthesis (umol CO2/m**2/s) - - real(r8) :: psn_wc_z_sun(bounds%begp:bounds%endp,nlevcan) ! Rubisco-limited contribution to sunlit psn_z (umol CO2/m**2/s) - real(r8) :: psn_wj_z_sun(bounds%begp:bounds%endp,nlevcan) ! RuBP-limited contribution to sunlit psn_z (umol CO2/m**2/s) - real(r8) :: psn_wp_z_sun(bounds%begp:bounds%endp,nlevcan) ! product-limited contribution to sunlit psn_z (umol CO2/m**2/s) - real(r8) :: psn_wc_z_sha(bounds%begp:bounds%endp,nlevcan) ! Rubisco-limited contribution to shaded psn_z (umol CO2/m**2/s) - real(r8) :: psn_wj_z_sha(bounds%begp:bounds%endp,nlevcan) ! RuBP-limited contribution to shaded psn_z (umol CO2/m**2/s) - real(r8) :: psn_wp_z_sha(bounds%begp:bounds%endp,nlevcan) ! product-limited contribution to shaded psn_z (umol CO2/m**2/s) - real(r8) :: rh_leaf_sun(bounds%begp:bounds%endp) ! fractional humidity at sunlit leaf surface (dimensionless) - real(r8) :: rh_leaf_sha(bounds%begp:bounds%endp) ! fractional humidity at shaded leaf surface (dimensionless) - - real(r8) :: psncan_sun ! canopy sum of sunlit psn_z - real(r8) :: psncan_wc_sun ! canopy sum of sunlit psn_wc_z - real(r8) :: psncan_wj_sun ! canopy sum of sunlit psn_wj_z - real(r8) :: psncan_wp_sun ! canopy sum of sunlit psn_wp_z - real(r8) :: lmrcan_sun ! canopy sum of sunlit lmr_z - real(r8) :: gscan_sun ! canopy sum of sunlit leaf conductance - real(r8) :: laican_sun ! canopy sum of sunlit lai_z - real(r8) :: psncan_sha ! canopy sum of shaded psn_z - real(r8) :: psncan_wc_sha ! canopy sum of shaded psn_wc_z - real(r8) :: psncan_wj_sha ! canopy sum of shaded psn_wj_z - real(r8) :: psncan_wp_sha ! canopy sum of shaded psn_wp_z - real(r8) :: lmrcan_sha ! canopy sum of shaded lmr_z - real(r8) :: gscan_sha ! canopy sum of shaded leaf conductance - real(r8) :: laican_sha ! canopy sum of shaded lai_z - real(r8) :: laican ! canopy sum of lai_z - real(r8) :: rh_can ! canopy air relative humidity - - real(r8) , pointer :: lai_z_sun (:,:) ! leaf area index for canopy layer, sunlit - real(r8) , pointer :: par_z_sun (:,:) ! par absorbed per unit lai for canopy layer, sunlit (w/m**2) - real(r8) , pointer :: vcmaxcint_sun (:) ! leaf to canopy scaling coefficient, sunlit - real(r8) , pointer :: alphapsn_sun (:) ! 13C fractionation factor for PSN, sunlit () - real(r8) , pointer :: psn_sun (:) ! foliage photosynthesis, sunlit (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wc_sun (:) ! Rubisco-limited foliage photosynthesis, sunlit (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wj_sun (:) ! RuBP-limited foliage photosynthesis, sunlit (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wp_sun (:) ! product-limited foliage photosynthesis, sunlit (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_z_sun (:,:) ! canopy layer: foliage photosynthesis, sunlit (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: lmr_sun (:) ! leaf maintenance respiration rate, sunlit (umol CO2/m**2/s) - real(r8) , pointer :: lmr_z_sun (:,:) ! canopy layer: leaf maintenance respiration rate, sunlit (umol CO2/m**2/s) - real(r8) , pointer :: rs_sun (:) ! leaf stomatal resistance, sunlit (s/m) - real(r8) , pointer :: rs_z_sun (:,:) ! canopy layer: leaf stomatal resistance, sunlit (s/m) - real(r8) , pointer :: ci_z_sun (:,:) ! intracellular leaf CO2, sunlit (Pa) - real(r8) , pointer :: o3coefv_sun (:) ! o3 coefficient used in photo calculation, sunlit - real(r8) , pointer :: o3coefg_sun (:) ! o3 coefficient used in rs calculation, sunlit - real(r8) , pointer :: lai_z_sha (:,:) ! leaf area index for canopy layer, shaded - real(r8) , pointer :: par_z_sha (:,:) ! par absorbed per unit lai for canopy layer, shaded (w/m**2) - real(r8) , pointer :: vcmaxcint_sha (:) ! leaf to canopy scaling coefficient, shaded - real(r8) , pointer :: alphapsn_sha (:) ! 13C fractionation factor for PSN, shaded () - real(r8) , pointer :: psn_sha (:) ! foliage photosynthesis, shaded (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wc_sha (:) ! Rubisco-limited foliage photosynthesis, shaded (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wj_sha (:) ! RuBP-limited foliage photosynthesis, shaded (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_wp_sha (:) ! product-limited foliage photosynthesis, shaded (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: psn_z_sha (:,:) ! canopy layer: foliage photosynthesis, shaded (umol co2 /m**2/ s) [always +] - real(r8) , pointer :: lmr_sha (:) ! leaf maintenance respiration rate, shaded (umol CO2/m**2/s) - real(r8) , pointer :: lmr_z_sha (:,:) ! canopy layer: leaf maintenance respiration rate, shaded (umol CO2/m**2/s) - real(r8) , pointer :: rs_sha (:) ! leaf stomatal resistance, shaded (s/m) - real(r8) , pointer :: rs_z_sha (:,:) ! canopy layer: leaf stomatal resistance, shaded (s/m) - real(r8) , pointer :: ci_z_sha (:,:) ! intracellular leaf CO2, shaded (Pa) - real(r8) , pointer :: o3coefv_sha (:) ! o3 coefficient used in photo calculation, shaded - real(r8) , pointer :: o3coefg_sha (:) ! o3 coefficient used in rs calculation, shaded - real(r8) :: sum_nscaler - real(r8) :: total_lai - integer :: nptreemax - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - integer :: j,g ! index - real(r8) :: rs_resis ! combined soil-root resistance [s] - real(r8) :: r_soil ! root spacing [m] - real(r8) :: root_biomass_density ! root biomass density [g/m3] - real(r8) :: root_cross_sec_area ! root cross sectional area [m2] - real(r8) :: root_length_density ! root length density [m/m3] - real(r8) :: froot_average_length ! average coarse root length [m] - real(r8) :: croot_average_length ! average coarse root length [m] - real(r8) :: soil_conductance ! soil to root hydraulic conductance [1/s] - real(r8) :: root_conductance ! root hydraulic conductance [1/s] - real(r8) :: rai(nlevsoi) ! root area index [m2/m2] - real(r8) :: fs(nlevsoi) ! root conductance scale factor (reduction in conductance due to decreasing (more negative) root water potential) - real(r8) :: gsminsun ! Minimum stomatal conductance sunlit - real(r8) :: gsminsha ! Minimum stomatal conductance shaded - real(r8) :: gs_slope_sun ! Slope stomatal conductance sunlit - real(r8) :: gs_slope_sha ! Slope stomatal conductance shaded - real(r8), parameter :: croot_lateral_length = 0.25_r8 ! specified lateral coarse root length [m] - real(r8), parameter :: c_to_b = 2.0_r8 !(g biomass /g C) -!Note that root density is for dry biomass not carbon. CLM provides root biomass as carbon. The conversion is 0.5 g C / g biomass - integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon - - !------------------------------------------------------------------------------ - - ! Temperature and soil water response functions - - ft(tl,ha) = exp( ha / (rgas*1.e-3_r8*(tfrz+25._r8)) * (1._r8 - (tfrz+25._r8)/tl) ) - fth(tl,hd,se,scaleFactor) = scaleFactor / ( 1._r8 + exp( (-hd+se*tl) / (rgas*1.e-3_r8*tl) ) ) - fth25(hd,se) = 1._r8 + exp( (-hd+se*(tfrz+25._r8)) / (rgas*1.e-3_r8*(tfrz+25._r8)) ) - - ! Enforce expected array sizes - - SHR_ASSERT_ALL((ubound(esat_tv) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(oair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cair) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bsun) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bsha) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(btran) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dayl_factor) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qsatl) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qaf) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - associate( & - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] soil-root interface conductance (mm/s) - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - - froot_leaf => pftcon%froot_leaf , & ! fine root to leaf ratio - root_conductance_patch => soilstate_inst%root_conductance_patch , & ! Output: [real(r8) (:,:)] root conductance - soil_conductance_patch => soilstate_inst%soil_conductance_patch , & ! Output: [real(r8) (:,:)] soil conductance - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:)] - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - root_radius => pftcon%root_radius , & ! Input: 0.29e-03_r8 !(m) - root_density => pftcon%root_density , & ! Input: 0.31e06_r8 !(g biomass / m3 root) - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] patch canopy one-sided stem area index, no burying by snow - c3psn => pftcon%c3psn , & ! Input: photosynthetic pathway: 0. = c4, 1. = c3 - crop => pftcon%crop , & ! Input: crop or not (0 =not crop and 1 = crop) - leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) - flnr => pftcon%flnr , & ! Input: fraction of leaf N in the Rubisco enzyme (gN Rubisco / gN leaf) - fnitr => pftcon%fnitr , & ! Input: foliage nitrogen limitation factor (-) - slatop => pftcon%slatop , & ! Input: specific leaf area at top of canopy, projected area basis [m^2/gC] - dsladlai => pftcon%dsladlai , & ! Input: change in sla per unit lai - i_vcad => pftcon%i_vcad , & ! Input: [real(r8) (:) ] - s_vcad => pftcon%s_vcad , & ! Input: [real(r8) (:) ] - i_flnr => pftcon%i_flnr , & ! Input: [real(r8) (:) ] - s_flnr => pftcon%s_flnr , & ! Input: [real(r8) (:) ] - mbbopt => pftcon%mbbopt , & - medlynintercept=> pftcon%medlynintercept , & ! Input: [real(r8) (:) ] Intercept for Medlyn stomatal conductance model method - medlynslope=> pftcon%medlynslope , & ! Input: [real(r8) (:) ] Slope for Medlyn stomatal conductance model method - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] vegetation temperature (Kelvin) - t10 => temperature_inst%t_a10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of the 2 m temperature (K) - tgcm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] air temperature at agcm reference height (kelvin) - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] pft number of canopy layers, above snow for radiative transfer - tlai_z => surfalb_inst%tlai_z_patch , & ! Input: [real(r8) (:,:) ] pft total leaf area index for canopy layer - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8)(:) ] one-sided leaf area index, no burying by snow - c3flag => photosyns_inst%c3flag_patch , & ! Output: [logical (:) ] true if C3 and false if C4 - ac => photosyns_inst%ac_phs_patch , & ! Output: [real(r8) (:,:,:) ] Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - aj => photosyns_inst%aj_phs_patch , & ! Output: [real(r8) (:,:,:) ] RuBP-limited gross photosynthesis (umol CO2/m**2/s) - ap => photosyns_inst%ap_phs_patch , & ! Output: [real(r8) (:,:,:) ] product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - ag => photosyns_inst%ag_phs_patch , & ! Output: [real(r8) (:,:,:) ] co-limited gross leaf photosynthesis (umol CO2/m**2/s) - vcmax_z => photosyns_inst%vcmax_z_phs_patch , & ! Output: [real(r8) (:,:,:) ] maximum rate of carboxylation (umol co2/m**2/s) - luvcmax25top => photosyns_inst%luvcmax25top_patch , & ! Output: [real(r8) (:) ] maximum rate of carboxylation (umol co2/m**2/s) - lujmax25top => photosyns_inst%lujmax25top_patch , & ! Output: [real(r8) (:) ] maximum rate of carboxylation (umol co2/m**2/s) - lutpu25top => photosyns_inst%lutpu25top_patch , & ! Output: [real(r8) (:) ] maximum rate of carboxylation (umol co2/m**2/s) -!!! - tpu_z => photosyns_inst%tpu_z_phs_patch , & ! Output: [real(r8) (:,:,:) ] triose phosphate utilization rate (umol CO2/m**2/s) - kp_z => photosyns_inst%kp_z_phs_patch , & ! Output: [real(r8) (:,:,:) ] initial slope of CO2 response curve (C4 plants) - gb_mol => photosyns_inst%gb_mol_patch , & ! Output: [real(r8) (:) ] leaf boundary layer conductance (umol H2O/m**2/s) - cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) - kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) - ko => photosyns_inst%ko_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for O2 (Pa) - qe => photosyns_inst%qe_patch , & ! Output: [real(r8) (:) ] quantum efficiency, used only for C4 (mol CO2 / mol photons) - theta_cj => photosyns_inst%theta_cj_patch , & ! Output: [real(r8) (:) ] empirical curvature parameter for ac, aj photosynthesis co-limitation - bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - mbb => photosyns_inst%mbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship - rh_leaf => photosyns_inst%rh_leaf_patch , & ! Output: [real(r8) (:) ] fractional humidity at leaf surface (dimensionless) - lnc => photosyns_inst%lnca_patch , & ! Output: [real(r8) (:) ] top leaf layer leaf N concentration (gN leaf/m^2) - light_inhibit=> photosyns_inst%light_inhibit , & ! Input: [logical ] flag if light should inhibit respiration - leafresp_method=> photosyns_inst%leafresp_method , & ! Input: [integer ] method type to use for leaf-maint.-respiration at 25C canopy top - stomatalcond_mtd=> photosyns_inst%stomatalcond_mtd , & ! Input: [integer ] method type to use for stomatal conductance - modifyphoto_and_lmr_forcrop=> photosyns_inst%modifyphoto_and_lmr_forcrop, & ! Input: [logical ] modifyphoto_and_lmr_forcrop - leaf_mr_vcm => canopystate_inst%leaf_mr_vcm , & ! Input: [real(r8) ] scalar constant of leaf respiration with Vcmax - vegwp => canopystate_inst%vegwp_patch , & ! Input/Output: [real(r8) (:,:) ] vegetation water matric potential (mm) - an_sun => photosyns_inst%an_sun_patch , & ! Output: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) - an_sha => photosyns_inst%an_sha_patch , & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) - gs_mol_sun => photosyns_inst%gs_mol_sun_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sha => photosyns_inst%gs_mol_sha_patch , & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance (umol H2O/m**2/s) - gs_mol_sun_ln => photosyns_inst%gs_mol_sun_ln_patch , & ! Output: [real(r8) (:,:) ] sunlit leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - gs_mol_sha_ln => photosyns_inst%gs_mol_sha_ln_patch & ! Output: [real(r8) (:,:) ] shaded leaf stomatal conductance averaged over 1 hour before to 1 hour after local noon (umol H2O/m**2/s) - ) - - par_z_sun => solarabs_inst%parsun_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) - lai_z_sun => canopystate_inst%laisun_z_patch ! Input: [real(r8) (:,:) ] leaf area index for canopy layer, sunlit or shaded - vcmaxcint_sun => surfalb_inst%vcmaxcintsun_patch ! Input: [real(r8) (:) ] leaf to canopy scaling coefficient - alphapsn_sun => photosyns_inst%alphapsnsun_patch ! Input: [real(r8) (:) ] 13C fractionation factor for PSN () - o3coefv_sun => ozone_inst%o3coefvsun_patch ! Input: [real(r8) (:) ] O3 coefficient used in photosynthesis calculation - o3coefg_sun => ozone_inst%o3coefgsun_patch ! Input: [real(r8) (:) ] O3 coefficient used in rs calculation - ci_z_sun => photosyns_inst%cisun_z_patch ! Output: [real(r8) (:,:) ] intracellular leaf CO2 (Pa) - rs_sun => photosyns_inst%rssun_patch ! Output: [real(r8) (:) ] leaf stomatal resistance (s/m) - rs_z_sun => photosyns_inst%rssun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf stomatal resistance (s/m) - lmr_sun => photosyns_inst%lmrsun_patch ! Output: [real(r8) (:) ] leaf maintenance respiration rate (umol CO2/m**2/s) - lmr_z_sun => photosyns_inst%lmrsun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - psn_sun => photosyns_inst%psnsun_patch ! Output: [real(r8) (:) ] foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_z_sun => photosyns_inst%psnsun_z_patch ! Output: [real(r8) (:,:) ] canopy layer: foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wc_sun => photosyns_inst%psnsun_wc_patch ! Output: [real(r8) (:) ] Rubisco-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wj_sun => photosyns_inst%psnsun_wj_patch ! Output: [real(r8) (:) ] RuBP-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wp_sun => photosyns_inst%psnsun_wp_patch ! Output: [real(r8) (:) ] product-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - par_z_sha => solarabs_inst%parsha_z_patch ! Input: [real(r8) (:,:) ] par absorbed per unit lai for canopy layer (w/m**2) - lai_z_sha => canopystate_inst%laisha_z_patch ! Input: [real(r8) (:,:) ] leaf area index for canopy layer, sunlit or shaded - vcmaxcint_sha => surfalb_inst%vcmaxcintsha_patch ! Input: [real(r8) (:) ] leaf to canopy scaling coefficient - alphapsn_sha => photosyns_inst%alphapsnsha_patch ! Input: [real(r8) (:) ] 13C fractionation factor for PSN () - o3coefv_sha => ozone_inst%o3coefvsha_patch ! Input: [real(r8) (:) ] O3 coefficient used in photosynthesis calculation - o3coefg_sha => ozone_inst%o3coefgsha_patch ! Input: [real(r8) (:) ] O3 coefficient used in rs calculation - ci_z_sha => photosyns_inst%cisha_z_patch ! Output: [real(r8) (:,:) ] intracellular leaf CO2 (Pa) - rs_sha => photosyns_inst%rssha_patch ! Output: [real(r8) (:) ] leaf stomatal resistance (s/m) - rs_z_sha => photosyns_inst%rssha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf stomatal resistance (s/m) - lmr_sha => photosyns_inst%lmrsha_patch ! Output: [real(r8) (:) ] leaf maintenance respiration rate (umol CO2/m**2/s) - lmr_z_sha => photosyns_inst%lmrsha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - psn_sha => photosyns_inst%psnsha_patch ! Output: [real(r8) (:) ] foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_z_sha => photosyns_inst%psnsha_z_patch ! Output: [real(r8) (:,:) ] canopy layer: foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wc_sha => photosyns_inst%psnsha_wc_patch ! Output: [real(r8) (:) ] Rubisco-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wj_sha => photosyns_inst%psnsha_wj_patch ! Output: [real(r8) (:) ] RuBP-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - psn_wp_sha => photosyns_inst%psnsha_wp_patch ! Output: [real(r8) (:) ] product-limited foliage photosynthesis (umol co2 /m**2/ s) [always +] - !==============================================================================! - ! Photosynthesis and stomatal conductance parameters, from: - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - !==============================================================================! - - ! Determine seconds off current time step - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! vcmax25 parameters, from CN - - fnr = 7.16_r8 - act25 = 3.6_r8 !umol/mgRubisco/min - ! Convert rubisco activity units from umol/mgRubisco/min -> umol/gRubisco/s - act25 = act25 * 1000.0_r8 / 60.0_r8 - - ! Activation energy, from: - ! Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - ! Bernacchi et al (2003) Plant, Cell and Environment 26:1419-1430 - ! except TPU from: Harley et al (1992) Plant, Cell and Environment 15:271-282 - - kcha = 79430._r8 - koha = 36380._r8 - cpha = 37830._r8 - vcmaxha = 72000._r8 - jmaxha = 50000._r8 - tpuha = 72000._r8 - lmrha = 46390._r8 - - ! High temperature deactivation, from: - ! Leuning (2002) Plant, Cell and Environment 25:1205-1210 - ! The factor "c" scales the deactivation to a value of 1.0 at 25C - - vcmaxhd = 200000._r8 - jmaxhd = 200000._r8 - tpuhd = 200000._r8 - lmrhd = 150650._r8 - lmrse = 490._r8 - lmrc = fth25 (lmrhd, lmrse) - -! calculate root-soil interface conductance - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - do j = 1,nlevsoi - -! calculate conversion from conductivity to conductance - root_biomass_density = c_to_b * froot_carbon(p) * rootfr(p,j) / dz(c,j) -! ensure minimum root biomass (using 1gC/m2) - root_biomass_density = max(c_to_b*1._r8,root_biomass_density) - - ! Root length density: m root per m3 soil - root_cross_sec_area = rpi*root_radius(ivt(p))**2 - root_length_density = root_biomass_density / (root_density(ivt(p)) * root_cross_sec_area) - - ! Root-area index (RAI) - rai(j) = (tsai(p)+tlai(p)) * froot_leaf(ivt(p)) * rootfr(p,j) - -! fix coarse root_average_length to specified length - croot_average_length = croot_lateral_length - -! calculate r_soil using Gardner/spa equation (Bonan, GMD, 2014) - r_soil = sqrt(1./(rpi*root_length_density)) - - ! length scale approach - soil_conductance = min(hksat(c,j),hk_l(c,j))/(1.e3*r_soil) - -! use vegetation plc function to adjust root conductance - fs(j)= plc(smp(c,j),p,c,root,veg) - -! krmax is root conductance per area per length - root_conductance = (fs(j)*rai(j)*params_inst%krmax(ivt(p)))/(croot_average_length + z(c,j)) - - soil_conductance = max(soil_conductance, 1.e-16_r8) - root_conductance = max(root_conductance, 1.e-16_r8) - - root_conductance_patch(p,j) = root_conductance - soil_conductance_patch(p,j) = soil_conductance - -! sum resistances in soil and root - rs_resis = 1._r8/soil_conductance + 1._r8/root_conductance - -! conductance is inverse resistance -! explicitly set conductance to zero for top soil layer - if(rai(j)*rootfr(p,j) > 0._r8 .and. j > 1) then - k_soil_root(p,j) = 1._r8/rs_resis - else - k_soil_root(p,j) = 0. - endif - - end do - enddo - - ! Miscellaneous parameters, from Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - - fnps = 0.15_r8 - theta_psii = 0.7_r8 - theta_ip = 0.95_r8 - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - ! C3 or C4 photosynthesis logical variable - - if (nint(c3psn(patch%itype(p))) == 1) then - c3flag(p) = .true. - else if (nint(c3psn(patch%itype(p))) == 0) then - c3flag(p) = .false. - end if - - ! C3 and C4 dependent parameters - - if (c3flag(p)) then - qe(p) = 0._r8 - theta_cj(p) = 0.98_r8 - bbbopt(p) = 10000._r8 - else - qe(p) = 0.05_r8 - theta_cj(p) = 0.80_r8 - bbbopt(p) = 40000._r8 - end if - - if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - ! Soil water stress applied to Ball-Berry parameters later in ci_func_PHS - bbb(p) = bbbopt(p) - mbb(p) = mbbopt(patch%itype(p)) - end if - ! kc, ko, cp, from: Bernacchi et al (2001) Plant, Cell and Environment 24:253-259 - ! - ! kc25 = 404.9 umol/mol - ! ko25 = 278.4 mmol/mol - ! cp25 = 42.75 umol/mol - ! - ! Derive sco from cp and O2 using present-day O2 (0.209 mol/mol) and re-calculate - ! cp to account for variation in O2 using cp = 0.5 O2 / sco - ! - - kc25 = (404.9_r8 / 1.e06_r8) * forc_pbot(c) - ko25 = (278.4_r8 / 1.e03_r8) * forc_pbot(c) - sco = 0.5_r8 * 0.209_r8 / (42.75_r8 / 1.e06_r8) - cp25 = 0.5_r8 * oair(p) / sco - - kc(p) = kc25 * ft(t_veg(p), kcha) - ko(p) = ko25 * ft(t_veg(p), koha) - cp(p) = cp25 * ft(t_veg(p), cpha) - - end do - - ! Multi-layer parameters scaled by leaf nitrogen profile. - ! Loop through each canopy layer to calculate nitrogen profile using - ! cumulative lai at the midpoint of the layer - - do f = 1, fn - p = filterp(f) - - if (lnc_opt .eqv. .false.) then - ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) - lnc(p) = 1._r8 / (slatop(patch%itype(p)) * leafcn(patch%itype(p))) - end if - - ! Using the actual nitrogen allocated to the leaf after - ! uptake rather than fixing leaf nitrogen based on SLA and CN - ! ratio - if (lnc_opt .eqv. .true.) then - ! nlevcan and nrad(p) look like the same variable ?? check this later - sum_nscaler = 0.0_r8 - laican = 0.0_r8 - total_lai = 0.0_r8 - - do iv = 1, nrad(p) - - if (iv == 1) then - laican = 0.5_r8 * tlai_z(p,iv) - total_lai = tlai_z(p,iv) - else - laican = laican + 0.5_r8 * (tlai_z(p,iv-1)+tlai_z(p,iv)) - total_lai = total_lai + tlai_z(p,iv) - end if - - ! Scale for leaf nitrogen profile. If multi-layer code, use explicit - ! profile. If sun/shade big leaf code, use canopy integrated factor. - if (nlevcan == 1) then - nscaler = 1.0_r8 - else if (nlevcan > 1) then - nscaler = exp(-kn(p) * laican) - end if - - sum_nscaler = sum_nscaler + nscaler - - end do - - if (tlai(p) > 0.0_r8 .AND. sum_nscaler > 0.0_r8) then - ! dividing by LAI to convert total leaf nitrogen - ! from m2 ground to m2 leaf; dividing by sum_nscaler to - ! convert total leaf N to leaf N at canopy top - lnc(p) = leafn(p) / (tlai(p) * sum_nscaler) - else - lnc(p) = 0.0_r8 - end if - - end if - lnc(p) = min(lnc(p),10._r8) - - ! reduce_dayl_factor .eqv. .false. - if (reduce_dayl_factor .eqv. .true.) then - if (dayl_factor(p) > 0.25_r8) then - ! dayl_factor(p) = 1.0_r8 - end if - end if - - - ! Default - if (vcmax_opt == 0) then - ! vcmax25 at canopy top, as in CN but using lnc at top of the canopy - vcmax25top = lnc(p) * flnr(patch%itype(p)) * fnr * act25 * dayl_factor(p) - if (.not. use_cn) then - vcmax25top = vcmax25top * fnitr(patch%itype(p)) - else - if ( CNAllocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) - end if - else if (vcmax_opt == 3) then - vcmax25top = ( i_vcad(patch%itype(p)) + s_vcad(patch%itype(p)) * lnc(p) ) * dayl_factor(p) - else if (vcmax_opt == 4) then - nptreemax = 9 ! is this number correct? check later - if (patch%itype(p) >= nptreemax) then ! if not tree - ! for shrubs and herbs - vcmax25top = lnc(p) * ( i_flnr(patch%itype(p)) + s_flnr(patch%itype(p)) * lnc(p) ) * fnr * act25 * & - dayl_factor(p) - else - ! if tree - vcmax25top = lnc(p) * ( i_flnr(patch%itype(p)) * exp(s_flnr(patch%itype(p)) * lnc(p)) ) * fnr * act25 * & - dayl_factor(p) - ! for trees - end if - end if - - ! Parameters derived from vcmax25top. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - ! used jmax25 = 1.97 vcmax25, from Wullschleger (1993) Journal of Experimental Botany 44:907-920. - - jmax25top = (2.59_r8 - 0.035_r8*min(max((t10(p)-tfrz),11._r8),35._r8)) * vcmax25top - tpu25top = 0.167_r8 * vcmax25top - kp25top = 20000._r8 * vcmax25top - luvcmax25top(p) = vcmax25top - lujmax25top(p) = jmax25top - lutpu25top(p)=tpu25top - - ! Nitrogen scaling factor. Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 used - ! kn = 0.11. Here, derive kn from vcmax25 as in Lloyd et al (2010) Biogeosciences, 7, 1833-1859 - ! Remove daylength factor from vcmax25 so that kn is based on maximum vcmax25 - ! But not used as defined here if using sun/shade big leaf code. Instead, - ! will use canopy integrated scaling factors from SurfaceAlbedo. - - if (dayl_factor(p) .eq. 0._r8) then - kn(p) = 0._r8 - else - kn(p) = exp(0.00963_r8 * vcmax25top/dayl_factor(p) - 2.43_r8) - end if - - if (use_cn) then - if ( leafresp_method == leafresp_mtd_ryan1991 ) then - ! Leaf maintenance respiration to match the base rate used in CN - ! but with the new temperature functions for C3 and C4 plants. - ! - ! Base rate for maintenance respiration is from: - ! M. Ryan, 1991. Effects of climate change on plant respiration. - ! Ecological Applications, 1(2), 157-167. - ! Original expression is br = 0.0106 molC/(molN h) - ! Conversion by molecular weights of C and N gives 2.525e-6 gC/(gN s) - ! - ! Base rate is at 20C. Adjust to 25C using the CN Q10 = 1.5 - ! - ! CN respiration has units: g C / g N [leaf] / s. This needs to be - ! converted from g C / g N [leaf] / s to umol CO2 / m**2 [leaf] / s - ! - ! Then scale this value at the top of the canopy for canopy depth - - lmr25top = 2.525e-6_r8 * (1.5_r8 ** ((25._r8 - 20._r8)/10._r8)) - lmr25top = lmr25top * lnc(p) / 12.e-06_r8 - - else if ( leafresp_method == leafresp_mtd_atkin2015 ) then - !using new form for respiration base rate from Atkin - !communication. - if ( lnc(p) > 0.0_r8 ) then - lmr25top = params_inst%lmr_intercept_atkin(ivt(p)) + (lnc(p) * 0.2061_r8) - (0.0402_r8 * (t10(p)-tfrz)) - else - lmr25top = 0.0_r8 - end if - end if - - else - ! Leaf maintenance respiration in proportion to vcmax25top - - if (c3flag(p)) then - lmr25top = vcmax25top * leaf_mr_vcm - else - lmr25top = vcmax25top * 0.025_r8 - end if - end if - - ! Loop through canopy layers (above snow). Respiration needs to be - ! calculated every timestep. Others are calculated only if daytime - - laican = 0._r8 - do iv = 1, nrad(p) - - ! Cumulative lai at middle of layer - - if (iv == 1) then - laican = 0.5_r8 * tlai_z(p,iv) - else - laican = laican + 0.5_r8 * (tlai_z(p,iv-1)+tlai_z(p,iv)) - end if - - ! Scale for leaf nitrogen profile. If multi-layer code, use explicit - ! profile. If sun/shade big leaf code, use canopy integrated factor. - - if (nlevcan == 1) then - nscaler_sun = vcmaxcint_sun(p) - nscaler_sha = vcmaxcint_sha(p) - else if (nlevcan > 1) then - nscaler_sun = exp(-kn(p) * laican) - nscaler_sha = exp(-kn(p) * laican) - end if - - ! Maintenance respiration - - lmr25_sun = lmr25top * nscaler_sun - lmr25_sha = lmr25top * nscaler_sha - - if(use_luna.and.c3flag(p).and.crop(patch%itype(p))== 0)then - if(.not.use_cn)then ! If CN is on, use leaf N to predict respiration (above). Otherwise, use Vcmax term from LUNA. RF - lmr25_sun = leaf_mr_vcm * photosyns_inst%vcmx25_z_patch(p,iv) - lmr25_sha = leaf_mr_vcm * photosyns_inst%vcmx25_z_patch(p,iv) - endif - endif - - if (c3flag(p)) then - lmr_z_sun(p,iv) = lmr25_sun * ft(t_veg(p), lmrha) * fth(t_veg(p), lmrhd, lmrse, lmrc) - lmr_z_sha(p,iv) = lmr25_sha * ft(t_veg(p), lmrha) * fth(t_veg(p), lmrhd, lmrse, lmrc) - else - lmr_z_sun(p,iv) = lmr25_sun * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - lmr_z_sun(p,iv) = lmr_z_sun(p,iv) / (1._r8 + exp( 1.3_r8*(t_veg(p)-(tfrz+55._r8)) )) - lmr_z_sha(p,iv) = lmr25_sha * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - lmr_z_sha(p,iv) = lmr_z_sha(p,iv) / (1._r8 + exp( 1.3_r8*(t_veg(p)-(tfrz+55._r8)) )) - end if - - ! Reduce lmr w/ low lai - lmr_z_sun(p,iv) = lmr_z_sun(p,iv)*min((0.2_r8*exp(3.218_r8*tlai_z(p,iv))),1._r8) - lmr_z_sha(p,iv) = lmr_z_sha(p,iv)*min((0.2_r8*exp(3.218_r8*tlai_z(p,iv))),1._r8) - - if (par_z_sun(p,iv) <= 0._r8) then ! night time - - vcmax_z(p,sun,iv) = 0._r8 - jmax_z(p,sun,iv) = 0._r8 - tpu_z(p,sun,iv) = 0._r8 - kp_z(p,sun,iv) = 0._r8 - - vcmax_z(p,sha,iv) = 0._r8 - jmax_z(p,sha,iv) = 0._r8 - tpu_z(p,sha,iv) = 0._r8 - kp_z(p,sha,iv) = 0._r8 - - if ( use_c13 ) then - alphapsn_sun(p) = 1._r8 - alphapsn_sha(p) = 1._r8 - end if - - else ! day time - - if(use_luna.and.c3flag(p).and.crop(patch%itype(p))== 0)then - vcmax25_sun = photosyns_inst%vcmx25_z_patch(p,iv) - vcmax25_sha = photosyns_inst%vcmx25_z_patch(p,iv) - jmax25_sun = photosyns_inst%jmx25_z_patch(p,iv) - jmax25_sha = photosyns_inst%jmx25_z_patch(p,iv) - tpu25_sun = 0.167_r8 * vcmax25_sun - tpu25_sha = 0.167_r8 * vcmax25_sha - if(surfalb_inst%vcmaxcintsun_patch(p).gt.0._r8.and.nlevcan==1) then - vcmax25_sha = vcmax25_sun * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - jmax25_sha = jmax25_sun * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - tpu25_sha = tpu25_sun * surfalb_inst%vcmaxcintsha_patch(p)/surfalb_inst%vcmaxcintsun_patch(p) - end if - else - vcmax25_sun = vcmax25top * nscaler_sun - jmax25_sun = jmax25top * nscaler_sun - tpu25_sun = tpu25top * nscaler_sun - vcmax25_sha = vcmax25top * nscaler_sha - jmax25_sha = jmax25top * nscaler_sha - tpu25_sha = tpu25top * nscaler_sha - endif - kp25_sun = kp25top * nscaler_sun - kp25_sha = kp25top * nscaler_sha - - ! Adjust for temperature - - vcmaxse = 668.39_r8 - 1.07_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - jmaxse = 659.70_r8 - 0.75_r8 * min(max((t10(p)-tfrz),11._r8),35._r8) - tpuse = vcmaxse - vcmaxc = fth25 (vcmaxhd, vcmaxse) - jmaxc = fth25 (jmaxhd, jmaxse) - tpuc = fth25 (tpuhd, tpuse) - vcmax_z(p,sun,iv) = vcmax25_sun * ft(t_veg(p), vcmaxha) * fth(t_veg(p), vcmaxhd, vcmaxse, vcmaxc) - jmax_z(p,sun,iv) = jmax25_sun * ft(t_veg(p), jmaxha) * fth(t_veg(p), jmaxhd, jmaxse, jmaxc) - tpu_z(p,sun,iv) = tpu25_sun * ft(t_veg(p), tpuha) * fth(t_veg(p), tpuhd, tpuse, tpuc) - vcmax_z(p,sha,iv) = vcmax25_sha * ft(t_veg(p), vcmaxha) * fth(t_veg(p), vcmaxhd, vcmaxse, vcmaxc) - jmax_z(p,sha,iv) = jmax25_sha * ft(t_veg(p), jmaxha) * fth(t_veg(p), jmaxhd, jmaxse, jmaxc) - tpu_z(p,sha,iv) = tpu25_sha * ft(t_veg(p), tpuha) * fth(t_veg(p), tpuhd, tpuse, tpuc) - - if (.not. c3flag(p)) then - vcmax_z(p,sun,iv) = vcmax25_sun * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - vcmax_z(p,sun,iv) = vcmax_z(p,sun,iv) / (1._r8 + exp( 0.2_r8*((tfrz+15._r8)-t_veg(p)) )) - vcmax_z(p,sun,iv) = vcmax_z(p,sun,iv) / (1._r8 + exp( 0.3_r8*(t_veg(p)-(tfrz+40._r8)) )) - vcmax_z(p,sha,iv) = vcmax25_sha * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - vcmax_z(p,sha,iv) = vcmax_z(p,sha,iv) / (1._r8 + exp( 0.2_r8*((tfrz+15._r8)-t_veg(p)) )) - vcmax_z(p,sha,iv) = vcmax_z(p,sha,iv) / (1._r8 + exp( 0.3_r8*(t_veg(p)-(tfrz+40._r8)) )) - end if - - kp_z(p,sun,iv) = kp25_sun * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - kp_z(p,sha,iv) = kp25_sha * 2._r8**((t_veg(p)-(tfrz+25._r8))/10._r8) - - end if - - ! Change to add in light inhibition of respiration. 0.67 from Lloyd et al. 2010, & Metcalfe et al. 2012 - ! Also pers. comm from Peter Reich (Nov 2015). Might potentially be updated pending findings of Atkin et al. (in prep) - ! review of light inhibition database. - if ( light_inhibit .and. par_z_sun(p,1) > 0._r8) then ! are the lights on? - lmr_z_sun(p,iv) = lmr_z_sun(p,iv) * 0.67_r8 ! inhibit respiration accordingly. - end if - if ( light_inhibit .and. par_z_sha(p,1) > 0._r8) then ! are the lights on? - lmr_z_sha(p,iv) = lmr_z_sha(p,iv) * 0.67_r8 ! inhibit respiration accordingly. - end if - - end do ! canopy layer loop - end do ! patch loop - - !==============================================================================! - ! Leaf-level photosynthesis and stomatal conductance - !==============================================================================! - - rsmax0 = 2.e4_r8 - - do f = 1, fn - p = filterp(f) - c = patch%column(p) - g = patch%gridcell(p) - - ! Leaf boundary layer conductance, umol/m**2/s - - cf = forc_pbot(c)/(rgas*1.e-3_r8*tgcm(p))*1.e06_r8 - gb = 1._r8/rb(p) - gb_mol(p) = gb * cf - - ! Loop through canopy layers (above snow). Only do calculations if daytime - - do iv = 1, nrad(p) - - if (par_z_sun(p,iv) <= 0._r8) then ! night time - - !zqz temporary signal for night time - vegwp(p,sun)=1._r8 - - if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - gsminsun = bbb(p) - gsminsha = bbb(p) - else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - gsminsun = medlynintercept(patch%itype(p)) - gsminsha = medlynintercept(patch%itype(p)) - else - gsminsun = nan - gsminsha = nan - end if - call calcstress(p,c,vegwp(p,:),bsun(p),bsha(p),gb_mol(p),gsminsun, gsminsha, & - qsatl(p),qaf(p), atm2lnd_inst,canopystate_inst,waterstate_inst, & - soilstate_inst,temperature_inst, waterflux_inst) - - ac(p,sun,iv) = 0._r8 - aj(p,sun,iv) = 0._r8 - ap(p,sun,iv) = 0._r8 - ag(p,sun,iv) = 0._r8 - if(crop(patch%itype(p))== 0 .or. .not. modifyphoto_and_lmr_forcrop) then - an_sun(p,iv) = ag(p,sun,iv) - bsun(p) * lmr_z_sun(p,iv) - else - an_sun(p,iv) = ag(p,sun,iv) - lmr_z_sun(p,iv) - endif - psn_z_sun(p,iv) = 0._r8 - psn_wc_z_sun(p,iv) = 0._r8 - psn_wj_z_sun(p,iv) = 0._r8 - psn_wp_z_sun(p,iv) = 0._r8 - rs_z_sun(p,iv) = min(rsmax0, 1._r8/(max( bsun(p)*gsminsun, 1._r8 )) * cf) - ci_z_sun(p,iv) = 0._r8 - rh_leaf_sun(p) = 0._r8 - - ac(p,sha,iv) = 0._r8 - aj(p,sha,iv) = 0._r8 - ap(p,sha,iv) = 0._r8 - ag(p,sha,iv) = 0._r8 - if(crop(patch%itype(p))== 0 .or. .not. modifyphoto_and_lmr_forcrop) then - an_sha(p,iv) = ag(p,sha,iv) - bsha(p) * lmr_z_sha(p,iv) - else - an_sha(p,iv) = ag(p,sha,iv) - lmr_z_sha(p,iv) - endif - psn_z_sha(p,iv) = 0._r8 - psn_wc_z_sha(p,iv) = 0._r8 - psn_wj_z_sha(p,iv) = 0._r8 - psn_wp_z_sha(p,iv) = 0._r8 - rs_z_sha(p,iv) = min(rsmax0, 1._r8/(max( bsha(p)*gsminsha, 1._r8 )) * cf) - ci_z_sha(p,iv) = 0._r8 - rh_leaf_sha(p) = 0._r8 - - else ! day time - - !now the constraint is no longer needed, Jinyun Tang - ceair = min( eair(p), esat_tv(p) ) - if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - rh_can = ceair / esat_tv(p) - else if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - ! Put some constraints on RH in the canopy when Medlyn stomatal conductance is being used - rh_can = max((esat_tv(p) - ceair), 50._r8) * 0.001_r8 - end if - - ! Electron transport rate for C3 plants. Convert par from W/m2 to - ! umol photons/m**2/s using the factor 4.6 - - ! sun - qabs = 0.5_r8 * (1._r8 - fnps) * par_z_sun(p,iv) * 4.6_r8 - aquad = theta_psii - bquad = -(qabs + jmax_z(p,sun,iv)) - cquad = qabs * jmax_z(p,sun,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - je_sun = min(r1,r2) - - ! sha - qabs = 0.5_r8 * (1._r8 - fnps) * par_z_sha(p,iv) * 4.6_r8 - aquad = theta_psii - bquad = -(qabs + jmax_z(p,sha,iv)) - cquad = qabs * jmax_z(p,sha,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - je_sha = min(r1,r2) - - ! Iterative loop for ci beginning with initial guess - - if (c3flag(p)) then - ci_z_sun(p,iv) = 0.7_r8 * cair(p) - ci_z_sha(p,iv) = 0.7_r8 * cair(p) - else - ci_z_sun(p,iv) = 0.4_r8 * cair(p) - ci_z_sha(p,iv) = 0.4_r8 * cair(p) - end if - - !find ci and stomatal conductance - call hybrid_PHS(ci_z_sun(p,iv), ci_z_sha(p,iv), p, iv, c, gb_mol(p), bsun(p),bsha(p), je_sun, & - je_sha, cair(p), oair(p), lmr_z_sun(p,iv), lmr_z_sha(p,iv), & - par_z_sun(p,iv), par_z_sha(p,iv), rh_can, gs_mol_sun(p,iv), gs_mol_sha(p,iv), & - qsatl(p), qaf(p), iter1, iter2, atm2lnd_inst, photosyns_inst, & - canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst, waterflux_inst) - if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - gsminsun = medlynintercept(patch%itype(p)) - gsminsha = medlynintercept(patch%itype(p)) - gs_slope_sun = medlynslope(patch%itype(p)) - gs_slope_sha = medlynslope(patch%itype(p)) - else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - gsminsun = bbb(p) - gsminsha = bbb(p) - gs_slope_sun = mbb(p) - gs_slope_sha = mbb(p) - end if - - ! End of ci iteration. Check for an < 0, in which case gs_mol = bbb - - if (an_sun(p,iv) < 0._r8) gs_mol_sun(p,iv) = max( bsun(p)*gsminsun, 1._r8 ) - if (an_sha(p,iv) < 0._r8) gs_mol_sha(p,iv) = max( bsha(p)*gsminsha, 1._r8 ) - ! Get local noon sunlit and shaded stomatal conductance - local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - ! Use time period 1 hour before and 1 hour after local noon inclusive (11AM-1PM) - if (local_secp1 >= (isecspday/2 - 3600) .and. local_secp1 <= (isecspday/2 + 3600)) then - gs_mol_sun_ln(p,iv) = gs_mol_sun(p,iv) - gs_mol_sha_ln(p,iv) = gs_mol_sha(p,iv) - else - gs_mol_sun_ln(p,iv) = spval - gs_mol_sha_ln(p,iv) = spval - end if - - ! Final estimates for cs and ci (needed for early exit of ci iteration when an < 0) - - cs_sun = cair(p) - 1.4_r8/gb_mol(p) * an_sun(p,iv) * forc_pbot(c) - cs_sun = max(cs_sun,1.e-06_r8) - ci_z_sun(p,iv) = cair(p) - an_sun(p,iv) * forc_pbot(c) * & - (1.4_r8*gs_mol_sun(p,iv)+1.6_r8*gb_mol(p)) / & - (gb_mol(p)*gs_mol_sun(p,iv)) - - ! Trap for values of ci_z_sun less than 1.e-06. This is needed for - ! Megan (which can crash with negative values) - ci_z_sun(p,iv) = max( ci_z_sun(p,iv), 1.e-06_r8 ) - - cs_sha = cair(p) - 1.4_r8/gb_mol(p) * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,1.e-06_r8) - ci_z_sha(p,iv) = cair(p) - an_sha(p,iv) * forc_pbot(c) * & - (1.4_r8*gs_mol_sha(p,iv)+1.6_r8*gb_mol(p)) / & - (gb_mol(p)*gs_mol_sha(p,iv)) - - ! Trap for values of ci_z_sha less than 1.e-06. This is needed for - ! Megan (which can crash with negative values) - ci_z_sha(p,iv) = max( ci_z_sha(p,iv), 1.e-06_r8 ) - - ! Convert gs_mol (umol H2O/m**2/s) to gs (m/s) and then to rs (s/m) - - gs = gs_mol_sun(p,iv) / cf - rs_z_sun(p,iv) = min(1._r8/gs, rsmax0) - rs_z_sun(p,iv) = rs_z_sun(p,iv) / o3coefg_sun(p) - gs = gs_mol_sha(p,iv) / cf - rs_z_sha(p,iv) = min(1._r8/gs, rsmax0) - rs_z_sha(p,iv) = rs_z_sha(p,iv) / o3coefg_sha(p) - - ! Photosynthesis. Save rate-limiting photosynthesis - - psn_z_sun(p,iv) = ag(p,sun,iv) - psn_z_sun(p,iv) = psn_z_sun(p,iv) * o3coefv_sun(p) - - psn_wc_z_sun(p,iv) = 0._r8 - psn_wj_z_sun(p,iv) = 0._r8 - psn_wp_z_sun(p,iv) = 0._r8 - - if (ac(p,sun,iv) <= aj(p,sun,iv) .and. ac(p,sun,iv) <= ap(p,sun,iv)) then - psn_wc_z_sun(p,iv) = psn_z_sun(p,iv) - else if (aj(p,sun,iv) < ac(p,sun,iv) .and. aj(p,sun,iv) <= ap(p,sun,iv)) then - psn_wj_z_sun(p,iv) = psn_z_sun(p,iv) - else if (ap(p,sun,iv) < ac(p,sun,iv) .and. ap(p,sun,iv) < aj(p,sun,iv)) then - psn_wp_z_sun(p,iv) = psn_z_sun(p,iv) - end if - - psn_z_sha(p,iv) = ag(p,sha,iv) - psn_z_sha(p,iv) = psn_z_sha(p,iv) * o3coefv_sha(p) - - psn_wc_z_sha(p,iv) = 0._r8 - psn_wj_z_sha(p,iv) = 0._r8 - psn_wp_z_sha(p,iv) = 0._r8 - - if (ac(p,sha,iv) <= aj(p,sha,iv) .and. ac(p,sha,iv) <= ap(p,sha,iv)) then - psn_wc_z_sha(p,iv) = psn_z_sha(p,iv) - else if (aj(p,sha,iv) < ac(p,sha,iv) .and. aj(p,sha,iv) <= ap(p,sha,iv)) then - psn_wj_z_sha(p,iv) = psn_z_sha(p,iv) - else if (ap(p,sha,iv) < ac(p,sha,iv) .and. ap(p,sha,iv) < aj(p,sha,iv)) then - psn_wp_z_sha(p,iv) = psn_z_sha(p,iv) - end if - - ! Make sure iterative solution is correct - - if (gs_mol_sun(p,iv) < 0._r8 .or. gs_mol_sha(p,iv) < 0._r8) then - write (iulog,*)'Negative stomatal conductance:' - write (iulog,*)'p,iv,gs_mol_sun,gs_mol_sha= ',p,iv,gs_mol_sun(p,iv),gs_mol_sha(p,iv) - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - - ! Compare with Ball-Berry model: gs_mol = m * an * hs/cs p + b - - hs = (gb_mol(p)*ceair + gs_mol_sun(p,iv)*esat_tv(p)) / ((gb_mol(p)+gs_mol_sun(p,iv))*esat_tv(p)) - rh_leaf_sun(p) = hs - gs_mol_err = gs_slope_sun*max(an_sun(p,iv), 0._r8)*hs/cs_sun*forc_pbot(c) + max( bsun(p)*gsminsun, 1._r8 ) - - if (abs(gs_mol_sun(p,iv)-gs_mol_err) > 1.e-01_r8 .and. (stomatalcond_mtd == stomatalcond_mtd_bb1987) ) then - write (iulog,*) 'Ball-Berry error check - sunlit stomatal conductance error:' - write (iulog,*) gs_mol_sun(p,iv), gs_mol_err - end if - - hs = (gb_mol(p)*ceair + gs_mol_sha(p,iv)*esat_tv(p)) / ((gb_mol(p)+gs_mol_sha(p,iv))*esat_tv(p)) - rh_leaf_sha(p) = hs - gs_mol_err = gs_slope_sha*max(an_sha(p,iv), 0._r8)*hs/cs_sha*forc_pbot(c) + max( bsha(p)*gsminsha, 1._r8) - - if (abs(gs_mol_sha(p,iv)-gs_mol_err) > 1.e-01_r8 .and. (stomatalcond_mtd == stomatalcond_mtd_bb1987) ) then - write (iulog,*) 'Ball-Berry error check - shaded stomatal conductance error:' - write (iulog,*) gs_mol_sha(p,iv), gs_mol_err - end if - - end if ! night or day if branch - end do ! canopy layer loop - end do ! patch loop - - !==============================================================================! - ! Canopy photosynthesis and stomatal conductance - !==============================================================================! - - ! Sum canopy layer fluxes and then derive effective leaf-level fluxes (per - ! unit leaf area), which are used in other parts of the model. Here, laican - ! sums to either laisun or laisha. - - do f = 1, fn - p = filterp(f) - - psncan_sun = 0._r8 - psncan_wc_sun = 0._r8 - psncan_wj_sun = 0._r8 - psncan_wp_sun = 0._r8 - lmrcan_sun = 0._r8 - gscan_sun = 0._r8 - laican_sun = 0._r8 - do iv = 1, nrad(p) - psncan_sun = psncan_sun + psn_z_sun(p,iv) * lai_z_sun(p,iv) - psncan_wc_sun = psncan_wc_sun + psn_wc_z_sun(p,iv) * lai_z_sun(p,iv) - psncan_wj_sun = psncan_wj_sun + psn_wj_z_sun(p,iv) * lai_z_sun(p,iv) - psncan_wp_sun = psncan_wp_sun + psn_wp_z_sun(p,iv) * lai_z_sun(p,iv) - if(crop(patch%itype(p))== 0 .and. modifyphoto_and_lmr_forcrop) then - lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) * bsun(p) - else - lmrcan_sun = lmrcan_sun + lmr_z_sun(p,iv) * lai_z_sun(p,iv) - endif - gscan_sun = gscan_sun + lai_z_sun(p,iv) / (rb(p)+rs_z_sun(p,iv)) - laican_sun = laican_sun + lai_z_sun(p,iv) - end do - if (laican_sun > 0._r8) then - psn_sun(p) = psncan_sun / laican_sun - psn_wc_sun(p) = psncan_wc_sun / laican_sun - psn_wj_sun(p) = psncan_wj_sun / laican_sun - psn_wp_sun(p) = psncan_wp_sun / laican_sun - lmr_sun(p) = lmrcan_sun / laican_sun - rs_sun(p) = laican_sun / gscan_sun - rb(p) - else - psn_sun(p) = 0._r8 - psn_wc_sun(p) = 0._r8 - psn_wj_sun(p) = 0._r8 - psn_wp_sun(p) = 0._r8 - lmr_sun(p) = 0._r8 - rs_sun(p) = 0._r8 - end if - psncan_sha = 0._r8 - psncan_wc_sha = 0._r8 - psncan_wj_sha = 0._r8 - psncan_wp_sha = 0._r8 - lmrcan_sha = 0._r8 - gscan_sha = 0._r8 - laican_sha = 0._r8 - do iv = 1, nrad(p) - psncan_sha = psncan_sha + psn_z_sha(p,iv) * lai_z_sha(p,iv) - psncan_wc_sha = psncan_wc_sha + psn_wc_z_sha(p,iv) * lai_z_sha(p,iv) - psncan_wj_sha = psncan_wj_sha + psn_wj_z_sha(p,iv) * lai_z_sha(p,iv) - psncan_wp_sha = psncan_wp_sha + psn_wp_z_sha(p,iv) * lai_z_sha(p,iv) - if(crop(patch%itype(p))== 0 .and. modifyphoto_and_lmr_forcrop) then - lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) * bsha(p) - else - lmrcan_sha = lmrcan_sha + lmr_z_sha(p,iv) * lai_z_sha(p,iv) - endif - gscan_sha = gscan_sha + lai_z_sha(p,iv) / (rb(p)+rs_z_sha(p,iv)) - laican_sha = laican_sha + lai_z_sha(p,iv) - end do - if (laican_sha > 0._r8) then - psn_sha(p) = psncan_sha / laican_sha - psn_wc_sha(p) = psncan_wc_sha / laican_sha - psn_wj_sha(p) = psncan_wj_sha / laican_sha - psn_wp_sha(p) = psncan_wp_sha / laican_sha - lmr_sha(p) = lmrcan_sha / laican_sha - rs_sha(p) = laican_sha / gscan_sha - rb(p) - else - psn_sha(p) = 0._r8 - psn_wc_sha(p) = 0._r8 - psn_wj_sha(p) = 0._r8 - psn_wp_sha(p) = 0._r8 - lmr_sha(p) = 0._r8 - rs_sha(p) = 0._r8 - end if - - if ( laican_sha+laican_sun > 0._r8 ) then - btran(p) = bsun(p) * (laican_sun / (laican_sun + laican_sha)) + & - bsha(p) * (laican_sha / (laican_sun + laican_sha)) - else - ! In this case, bsun and bsha should have the same value and btran - ! can be set to either bsun or bsha. - btran(p) = bsun(p) - end if - - end do - - end associate - - end subroutine PhotosynthesisHydraulicStress - !------------------------------------------------------------------------------ - - !-------------------------------------------------------------------------------- - subroutine hybrid_PHS(x0sun, x0sha, p, iv, c, gb_mol, bsun, bsha, jesun, jesha, & - cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - gs_mol_sun, gs_mol_sha, qsatl, qaf, iter1, iter2, atm2lnd_inst, photosyns_inst, & - canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst, waterflux_inst) - ! - !! DESCRIPTION: - !use a hybrid solver to find the root of the ci_func equation for sunlit and shaded leaves - ! f(x) = x- h(x) - !we want to find x, s.t. f(x) = 0. - !outside loop iterates for bsun/bsha, which are functions of stomatal conductance - !the hybrid approach combines the strength of the newton secant approach (find the solution domain) - !and the bisection approach implemented with the Brent's method to guarantee convergence. - ! - !! REVISION HISTORY: - ! - ! - !!USES: - ! - !! ARGUMENTS: - implicit none - real(r8), intent(inout) :: x0sun,x0sha ! initial guess and final value of the solution for cisun/cisha - integer , intent(in) :: p ! pft index - integer , intent(in) :: iv ! radiation canopy layer index - integer , intent(in) :: c ! column index - real(r8), intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8), intent(out) :: bsun ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8), intent(out) :: bsha ! shaded canopy transpiration wetness factor (0 to 1) - real(r8), intent(in) :: jesun ! sunlit leaf electron transport rate (umol electrons/m**2/s) - real(r8), intent(in) :: jesha ! shaded leaf electron transport rate (umol electrons/m**2/s) - real(r8), intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8), intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - real(r8), intent(in) :: lmr_z_sun ! sunlit canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), intent(in) :: lmr_z_sha ! shaded canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), intent(in) :: par_z_sun ! par absorbed per unit lai for sunlit canopy layer (w/m**2) - real(r8), intent(in) :: par_z_sha ! par absorbed per unit lai for shaded canopy layer (w/m**2) - real(r8), intent(in) :: rh_can ! canopy air relative humidity - real(r8), intent(out) :: gs_mol_sun ! sunlit leaf stomatal conductance (umol H2O/m**2/s) - real(r8), intent(out) :: gs_mol_sha ! shaded leaf stomatal conductance (umol H2O/m**2/s) - real(r8), intent(in) :: qsatl ! leaf specific humidity [kg/kg] - real(r8), intent(in) :: qaf ! humidity of canopy air [kg/kg] - integer, intent(out) :: iter1 ! number of iterations used to find appropriate bsun/bsha - integer, intent(out) :: iter2 ! number of iterations used to find cisun/cisha - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - ! - !! LOCAL VARIABLES - real(r8) :: x(nvegwcs) ! working copy of vegwp(p,:) - real(r8) :: gs0sun ! unstressed sunlit stomatal conductance - real(r8) :: gs0sha ! unstressed shaded stomatal conductance - logical :: havegs ! signals direction of calculation gs->qflx or qflx->gs - real(r8) :: soilflux ! total soil column transpiration [mm/s] - real(r8) :: x1sun ! second guess for cisun - real(r8) :: f0sun ! error of cifunc(x0sun) - real(r8) :: f1sun ! error of cifunc(x1sun) - real(r8) :: xsun ! open variable for brent to return cisun solution - real(r8) :: dxsun ! delta cisun from iter_i to iter_i+1 - real(r8) :: x1sha ! second guess for cisha - real(r8) :: f0sha ! error of cifunc(x0sha) - real(r8) :: f1sha ! error of cifunc(x1sha) - real(r8) :: xsha ! open variable for brent to return cisha solution - real(r8) :: dxsha ! delta cisha from iter_i to iter_i+1 - real(r8) :: b0sun ! bsun from previous iter - real(r8) :: b0sha ! bsha from previous iter - real(r8) :: dbsun ! delta(bsun) from iter_i to iter_i+1 - real(r8) :: dbsha ! delta(bsun) from iter_i to iter_i+1 - logical :: bflag ! signals to call calcstress to recalc bsun/bsha (or not) - real(r8) :: tolsun ! error tolerance for cisun solution [Pa] - real(r8) :: tolsha ! error tolerance for cisun solution [Pa] - real(r8) :: minf ! storage spot for best cisun/cisha solution - real(r8) :: minxsun ! cisun associated with minf - real(r8) :: minxsha ! cisha associated with minf - real(r8), parameter :: toldb = 1.e-2_r8 ! tolerance for satisfactory bsun/bsha solution - real(r8), parameter :: eps = 1.e-2_r8 ! relative accuracy - real(r8), parameter :: eps1= 1.e-4_r8 ! absolute accuracy threshold for fsun/fsha - integer , parameter :: itmax = 3 ! maximum number of iterations zqz (increase later) - !------------------------------------------------------------------------------ - - associate( & - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - vegwp => canopystate_inst%vegwp_patch & ! Input/Output: [real(r8) (:,:) ] vegetation water matric potential (mm) - ) - - - x1sun = x0sun - x1sha = x0sha - bflag = .false. - b0sun = -1._r8 - b0sha = -1._r8 - gs0sun = 0._r8 ! Initialize to zero as good form, not used on first itteration below because of bflag - gs0sha = 0._r8 ! Initialize to zero as good form, not used on first itteration below because of bflag - bsun = 1._r8 - bsha = 1._r8 - iter1 = 0 - - do !outer loop updates bsun/bsha and makes two ci_func calls for interpolation - x=vegwp(p,:) - iter1=iter1+1 - iter2=0 - x0sun=max(0.1_r8,x1sun) !need to make sure x0 .neq. x1 - x1sun=0.99_r8*x1sun - x0sha=max(0.1_r8,x1sha) - x1sha=0.99_r8*x1sha - tolsun = abs(x1sun) * eps - tolsha = abs(x1sha) * eps - - ! this ci_func_PHS call updates bsun/bsha (except on first iter) - call ci_func_PHS(x,x0sun, x0sha, f0sun, f0sha, p, iv, c, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha,& - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - - ! update bsun/bsha convergence vars - dbsun=b0sun-bsun - dbsha=b0sha-bsha - b0sun=bsun - b0sha=bsha - bflag=.false. - - ! this ci_func_PHS call creates second point for ci interpolation - call ci_func_PHS(x,x1sun, x1sha, f1sun, f1sha, p, iv, c, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha,& - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - - do !inner loop finds ci - if ( (abs(f0sun) < eps1) .and. (abs(f0sha) < eps1) ) then - x1sun=x0sun - x1sha=x0sha - exit - endif - if ( (abs(f1sun) < eps1) .and. (abs(f1sha) < eps1) ) then - exit - endif - iter2=iter2+1 - - if ( (f1sun - f0sun) == 0._r8) then - !makes next x1sun the midpt between current x1 & x0 - dxsun = 0.5_r8*(x1sun+x0sun)-x1sun - else - dxsun=-f1sun*(x1sun-x0sun)/(f1sun-f0sun) - end if - if ( (f1sha - f0sha) == 0._r8) then - dxsha = 0.5_r8*(x1sha+x0sha)-x1sha - else - dxsha=-f1sha*(x1sha-x0sha)/(f1sha-f0sha) - end if - x0sun=x1sun - x1sun=x1sun+dxsun - x0sha=x1sha - x1sha=x1sha+dxsha - - call ci_func_PHS(x,x1sun, x1sha, f1sun, f1sha, p, iv, c, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha,& - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - - if ( (abs(dxsun) < tolsun ) .and. (abs(dxsha) itmax) then - x1sun=minxsun - x1sha=minxsha - call ci_func_PHS(x,x1sun, x1sha, f1sun, f1sha, p, iv, c, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha,& - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - exit - endif - - enddo - - !update unstressed stomatal conductance - if (bsun>0.01_r8) then - gs0sun=gs_mol_sun/bsun - endif - if (bsha>0.01_r8) then - gs0sha=gs_mol_sha/bsha - endif - - bflag=.true. - - if ( (abs(dbsun) < toldb) .and. (abs(dbsha) < toldb) ) then - exit - endif - - if (iter1 > itmax) then - exit - endif - - enddo - x0sun=x1sun - x0sha=x1sha - - !set vegwp for the final gs_mol solution - call getvegwp(p, c, x, gb_mol, gs_mol_sun, gs_mol_sha, qsatl, qaf, soilflux, & - atm2lnd_inst, canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst) - vegwp(p,:)=x - if (soilflux<0._r8) soilflux = 0._r8 - qflx_tran_veg(p) = soilflux - - end associate - - end subroutine hybrid_PHS - !-------------------------------------------------------------------------------- - - !------------------------------------------------------------------------------ - subroutine brent_PHS(xsun, x1sun, x2sun, f1sun, f2sun, xsha, x1sha, x2sha, f1sha, f2sha, & - tol, ip, iv, ic, gb_mol, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha,& - rh_can, gs_mol_sun, gs_mol_sha, bsun, bsha, qsatl, qaf, atm2lnd_inst, photosyns_inst, & - canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst, waterflux_inst) - !------------------------------------------------------------------------------ - implicit none - ! - !!DESCRIPTION: - !Use Brent's method to find the root of a single variable function ci_func, which is known to exist between x1 and x2. - !The found root will be updated until its accuracy is tol. Performed for cisun and cisha. - ! - !!REVISION HISTORY: - ! - !!ARGUMENTS: - real(r8), intent(out) :: xsun ! independent variable of the single value function ci_func(x) - real(r8), intent(in) :: x1sun, x2sun ! minimum and maximum of the variable domain to search for the solution ci_func(x1) = f1, ci_func(x2)=f2 - real(r8), intent(in) :: f1sun, f2sun ! minimum and maximum of the variable domain to search for the solution ci_func(x1) = f1, ci_func(x2)=f2 - real(r8), intent(out) :: xsha ! independent variable of the single value function ci_func(x) - real(r8), intent(in) :: x1sha, x2sha ! minimum and maximum of the variable domain to search for the solution ci_func(x1) = f1, ci_func(x2)=f2 - real(r8), intent(in) :: f1sha, f2sha ! minimum and maximum of the variable domain to search for the solution ci_func(x1) = f1, ci_func(x2)=f2 - real(r8), intent(in) :: tol ! the error tolerance - integer , intent(in) :: ip, iv, ic ! pft, c3/c4, and column index - real(r8), intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8), intent(in) :: jesun,jesha ! electron transport rate (umol electrons/m**2/s) - real(r8), intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8), intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - real(r8), intent(in) :: lmr_z_sun, lmr_z_sha ! canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8), intent(in) :: par_z_sun, par_z_sha ! par absorbed per unit lai for canopy layer (w/m**2) - real(r8), intent(in) :: rh_can ! inside canopy relative humidity - real(r8), intent(out) :: gs_mol_sun ! sunlit leaf stomatal conductance (umol H2O/m**2/s) - real(r8), intent(out) :: gs_mol_sha ! shaded leaf stomatal conductance (umol H2O/m**2/s) - real(r8), intent(inout) :: bsun ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8), intent(inout) :: bsha ! shaded canopy transpiration wetness factor (0 to 1) - real(r8), intent(in) :: qsatl ! leaf specific humidity [kg/kg] - real(r8), intent(in) :: qaf ! humidity of canopy air [kg/kg] - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - !------------------------------------------------------------------------------ - ! !LOCAL VARIABLES: - real(r8) :: gs0sun ! sunlit leaf stomatal conductance (umol H2O/m**2/s) - real(r8) :: gs0sha ! shaded leaf stomatal conductance (umol H2O/m**2/s) - integer :: phase ! sun==1, sha==2 - integer , parameter :: nphs = 2 ! number of phases for sun/shade - integer , parameter :: itmax = 20 ! maximum number of iterations - real(r8), parameter :: eps = 1.e-4_r8 ! relative error tolerance - integer :: iter ! - real(r8) :: a(nphs),b(nphs),c(nphs),d(nphs),e(nphs),fa(nphs),fb(nphs),fc(nphs) - real(r8) :: p(nphs),q(nphs),r(nphs),s(nphs),tol1(nphs),xm(nphs) - real(r8) :: x(nvegwcs) !dummy variable passed to cifunc - logical , parameter :: bflag = .false. !indicates the cifunc should not call calcstress - !------------------------------------------------------------------------------ - - a(:)=(/x1sun,x1sha/) - b(:)=(/x2sun,x2sha/) - fa(:)=(/f1sun,f1sha/) - fb(:)=(/f2sun,f2sha/) - - do phase=1, nphs - if ( (fa(phase) > 0._r8 .and. fb(phase) > 0._r8) .or. (fa(phase) < 0._r8 .and. fb(phase) < 0._r8) ) then - write(iulog,*) 'root must be bracketed for brent' - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - enddo - - c=b - fc=fb - iter = 0 - do - if( iter == itmax ) exit - iter=iter+1 - - do phase=1, nphs - if( (fb(phase) > 0._r8 .and. fc(phase) > 0._r8) .or. (fb(phase) < 0._r8 .and. fc(phase) < 0._r8)) then - c(phase)=a(phase) !Rename a, b, c and adjust bounding interval d. - fc(phase)=fa(phase) - d(phase)=b(phase)-a(phase) - e(phase)=d(phase) - endif - if( abs(fc(phase)) < abs(fb(phase)) ) then - a(phase)=b(phase) - b(phase)=c(phase) - c(phase)=a(phase) - fa(phase)=fb(phase) - fb(phase)=fc(phase) - fc(phase)=fa(phase) - endif - enddo - tol1=2._r8*eps*abs(b)+0.5_r8*tol !Convergence check. - xm=0.5_r8*(c-b) - - if( abs(xm(sun)) <= tol1(sun) .or. fb(sun) == 0._r8 ) then - if( abs(xm(sha)) <= tol1(sha) .or. fb(sha) == 0._r8 ) then - xsun=b(sun) - xsha=b(sha) - return - endif - endif - - do phase=1, nphs - if( abs(e(phase)) >= tol1(phase) .and. abs(fa(phase)) > abs(fb(phase)) ) then - s(phase)=fb(phase)/fa(phase) !Attempt inverse quadratic interpolation. - if(a(phase) == c(phase)) then - p(phase)=2._r8*xm(phase)*s(phase) - q(phase)=1._r8-s(phase) - else - q(phase)=fa(phase)/fc(phase) - r(phase)=fb(phase)/fc(phase) - p(phase)=s(phase)*(2._r8*xm(phase)*q(phase)*(q(phase)-r(phase))-(b(phase)-a(phase))*(r(phase)-1._r8)) - q(phase)=(q(phase)-1._r8)*(r(phase)-1._r8)*(s(phase)-1._r8) - endif - if( p(phase) > 0._r8 ) q(phase)=-q(phase) !Check whether in bounds. - p(phase)=abs(p(phase)) - if( 2._r8*p(phase) < min(3._r8*xm(phase)*q(phase)-abs(tol1(phase)*q(phase)),abs(e(phase)*q(phase))) ) then - e(phase)=d(phase) !Accept interpolation. - d(phase)=p(phase)/q(phase) - else - d(phase)=xm(phase) !Interpolation failed, use bisection. - e(phase)=d(phase) - endif - else !Bounds decreasing too slowly, use bisection. - d(phase)=xm(phase) - e(phase)=d(phase) - endif - a(phase)=b(phase) !Move last best guess to a. - fa(phase)=fb(phase) - if( abs(d(phase)) > tol1(phase) ) then !Evaluate new trial root. - b(phase)=b(phase)+d(phase) - else - b(phase)=b(phase)+sign(tol1(phase),xm(phase)) - endif - enddo - - gs0sun = gs_mol_sun - gs0sha = gs_mol_sha - call ci_func_PHS(x,b(sun), b(sha), fb(sun), fb(sha), ip, iv, ic, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha, & - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - - if( (fb(sun) == 0._r8) .and. (fb(sha) == 0._r8) ) exit - enddo - if( iter == itmax) write(iulog,*) 'brent exceeding maximum iterations', b, fb - xsun=b(sun) - xsha=b(sha) - - return - - end subroutine brent_PHS - !-------------------------------------------------------------------------------- - - !------------------------------------------------------------------------------ - subroutine ci_func_PHS(x,cisun, cisha, fvalsun, fvalsha, p, iv, c, bsun, bsha, bflag, gb_mol, gs0sun, gs0sha,& - gs_mol_sun, gs_mol_sha, jesun, jesha, cair, oair, lmr_z_sun, lmr_z_sha, par_z_sun, par_z_sha, rh_can, & - qsatl, qaf, atm2lnd_inst, photosyns_inst, canopystate_inst, waterstate_inst, soilstate_inst, & - temperature_inst, waterflux_inst) - !------------------------------------------------------------------------------ - ! - ! !DESCRIPTION: - ! evaluate the function - ! f(ci)=ci - (ca - (1.37rb+1.65rs))*patm*an for sunlit and shaded leaves - ! - ! !REVISION HISTORY: - ! - ! - ! !USES: - use clm_varpar , only : nlevsoi - implicit none - ! - ! !ARGUMENTS: - real(r8) , intent(inout) :: x(nvegwcs) ! working copy of vegwp(p,:) - real(r8) , intent(in) :: cisun,cisha ! intracellular leaf CO2 (Pa) - real(r8) , intent(out) :: fvalsun,fvalsha ! return function of the value f(ci) - integer , intent(in) :: p,c,iv ! pft, column, and radiation indexes - real(r8) , intent(inout) :: bsun ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8) , intent(inout) :: bsha ! shaded canopy transpiration wetness factor (0 to 1) - logical , intent(in) :: bflag ! signals to call calcstress to recalc bsun/bsha (or not) - real(r8) , intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: gs0sun,gs0sha ! local gs_mol copies - real(r8) , intent(inout) :: gs_mol_sun,gs_mol_sha !leaf stomatal conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: jesun, jesha ! electron transport rate (umol electrons/m**2/s) - real(r8) , intent(in) :: cair ! Atmospheric CO2 partial pressure (Pa) - real(r8) , intent(in) :: oair ! Atmospheric O2 partial pressure (Pa) - real(r8) , intent(in) :: lmr_z_sun, lmr_z_sha ! canopy layer: leaf maintenance respiration rate (umol CO2/m**2/s) - real(r8) , intent(in) :: par_z_sun, par_z_sha ! par absorbed per unit lai for canopy layer (w/m**2) - real(r8) , intent(in) :: rh_can ! canopy air relative humidity - real(r8) , intent(in) :: qsatl ! leaf specific humidity [kg/kg] - real(r8) , intent(in) :: qaf ! humidity of canopy air [kg/kg] - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - - ! !LOCAL VARIABLES: - real(r8) :: ai ! intermediate co-limited photosynthesis (umol CO2/m**2/s) - real(r8) :: cs_sun,cs_sha ! CO2 partial pressure at leaf surface (Pa) - real(r8) :: aquad, bquad, cquad ! terms for quadratic equations - real(r8) :: r1, r2 ! roots of quadratic equation - real(r8) :: fnps ! fraction of light absorbed by non-photosynthetic pigments - real(r8) :: theta_psii ! empirical curvature parameter for electron transport rate - real(r8) :: theta_ip ! empirical curvature parameter for ap photosynthesis co-limitation - real(r8) :: term ! intermediate in Medlyn stomatal model - ! - !------------------------------------------------------------------------------ - - associate( & - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - c3flag => photosyns_inst%c3flag_patch , & ! Input: [logical (:) ] true if C3 and false if C4 - medlynslope=> pftcon%medlynslope , & ! Input: [real(r8) (:) ] Slope for Medlyn stomatal conductance model method - medlynintercept=> pftcon%medlynintercept , & ! Input: [real(r8) (:) ] Intercept for Medlyn stomatal conductance model method - stomatalcond_mtd=> photosyns_inst%stomatalcond_mtd , & ! Input: [integer ] method type to use for stomatal conductance.GC.fnlprmsn15_r22845 - ac => photosyns_inst%ac_phs_patch , & ! Output: [real(r8) (:,:,:) ] Rubisco-limited gross photosynthesis (umol CO2/m**2/s) - aj => photosyns_inst%aj_phs_patch , & ! Output: [real(r8) (:,:,:) ] RuBP-limited gross photosynthesis (umol CO2/m**2/s) - ap => photosyns_inst%ap_phs_patch , & ! Output: [real(r8) (:,:,:) ] product-limited (C3) or CO2-limited (C4) gross photosynthesis (umol CO2/m**2/s) - ag => photosyns_inst%ag_phs_patch , & ! Output: [real(r8) (:,:,:) ] co-limited gross leaf photosynthesis (umol CO2/m**2/s) - vcmax_z => photosyns_inst%vcmax_z_phs_patch , & ! Input: [real(r8) (:,:,:) ] maximum rate of carboxylation (umol co2/m**2/s) - cp => photosyns_inst%cp_patch , & ! Output: [real(r8) (:) ] CO2 compensation point (Pa) - kc => photosyns_inst%kc_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for CO2 (Pa) - ko => photosyns_inst%ko_patch , & ! Output: [real(r8) (:) ] Michaelis-Menten constant for O2 (Pa) - qe => photosyns_inst%qe_patch , & ! Output: [real(r8) (:) ] quantum efficiency, used only for C4 (mol CO2 / mol photons) - tpu_z => photosyns_inst%tpu_z_phs_patch , & ! Output: [real(r8) (:,:,:) ] triose phosphate utilization rate (umol CO2/m**2/s) - kp_z => photosyns_inst%kp_z_phs_patch , & ! Output: [real(r8) (:,:,:) ] initial slope of CO2 response curve (C4 plants) - theta_cj => photosyns_inst%theta_cj_patch , & ! Output: [real(r8) (:) ] empirical curvature parameter for ac, aj photosynthesis co-limitation - bbb => photosyns_inst%bbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - mbb => photosyns_inst%mbb_patch , & ! Output: [real(r8) (:) ] Ball-Berry slope of conductance-photosynthesis relationship - an_sun => photosyns_inst%an_sun_patch , & ! Output: [real(r8) (:,:) ] net sunlit leaf photosynthesis (umol CO2/m**2/s) - an_sha => photosyns_inst%an_sha_patch & ! Output: [real(r8) (:,:) ] net shaded leaf photosynthesis (umol CO2/m**2/s) - ) - - !------------------------------------------------------------------------------ - ! Miscellaneous parameters, from Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 - fnps = 0.15_r8 - theta_psii = 0.7_r8 - theta_ip = 0.95_r8 - - if (bflag) then !zqz what if bsun==0 ... doesn't break... but follow up - - call calcstress(p,c,x,bsun,bsha,gb_mol,gs0sun,gs0sha,qsatl,qaf, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst, & - temperature_inst, waterflux_inst) - endif - - if (c3flag(p)) then - ! C3: Rubisco-limited photosynthesis - ac(p,sun,iv) = bsun * vcmax_z(p,sun,iv) * max(cisun-cp(p), 0._r8) / (cisun+kc(p)*(1._r8+oair/ko(p))) - ac(p,sha,iv) = bsha * vcmax_z(p,sha,iv) * max(cisha-cp(p), 0._r8) / (cisha+kc(p)*(1._r8+oair/ko(p))) - - ! C3: RuBP-limited photosynthesis - aj(p,sun,iv) = jesun * max(cisun-cp(p), 0._r8) / (4._r8*cisun+8._r8*cp(p)) - aj(p,sha,iv) = jesha * max(cisha-cp(p), 0._r8) / (4._r8*cisha+8._r8*cp(p)) - - ! C3: Product-limited photosynthesis - ap(p,sun,iv) = 3._r8 * tpu_z(p,sun,iv) - ap(p,sha,iv) = 3._r8 * tpu_z(p,sha,iv) - - else - ! C4: Rubisco-limited photosynthesis - ac(p,sun,iv) = bsun * vcmax_z(p,sun,iv) - ac(p,sha,iv) = bsha * vcmax_z(p,sha,iv) - - ! C4: RuBP-limited photosynthesis - aj(p,sun,iv) = qe(p) * par_z_sun * 4.6_r8 - aj(p,sha,iv) = qe(p) * par_z_sha * 4.6_r8 - - ! C4: PEP carboxylase-limited (CO2-limited) - ap(p,sun,iv) = kp_z(p,sun,iv) * max(cisun, 0._r8) / forc_pbot(c) - ap(p,sha,iv) = kp_z(p,sha,iv) * max(cisha, 0._r8) / forc_pbot(c) - - end if - - ! Gross photosynthesis. First co-limit ac and aj. Then co-limit ap - - ! Sunlit - aquad = theta_cj(p) - bquad = -(ac(p,sun,iv) + aj(p,sun,iv)) - cquad = ac(p,sun,iv) * aj(p,sun,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ai = min(r1,r2) - - aquad = theta_ip - bquad = -(ai + ap(p,sun,iv)) - cquad = ai * ap(p,sun,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ag(p,sun,iv) = max(0._r8,min(r1,r2)) - - ! Shaded - aquad = theta_cj(p) - bquad = -(ac(p,sha,iv) + aj(p,sha,iv)) - cquad = ac(p,sha,iv) * aj(p,sha,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ai = min(r1,r2) - - aquad = theta_ip - bquad = -(ai + ap(p,sha,iv)) - cquad = ai * ap(p,sha,iv) - call quadratic (aquad, bquad, cquad, r1, r2) - ag(p,sha,iv) = max(0._r8,min(r1,r2)) - - ! Net photosynthesis. Exit iteration if an < 0 - an_sun(p,iv) = ag(p,sun,iv) - bsun * lmr_z_sun - an_sha(p,iv) = ag(p,sha,iv) - bsha * lmr_z_sha - - if (an_sun(p,iv) < 0._r8) then - if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - gs_mol_sun = medlynintercept(patch%itype(p)) - else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - gs_mol_sun = bbb(p) - else - gs_mol_sun = nan - end if - gs_mol_sun = max( bsun*gs_mol_sun, 1._r8) - fvalsun = 0._r8 ! really tho? zqz - endif - if (an_sha(p,iv) < 0._r8) then - if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - gs_mol_sha = medlynintercept(patch%itype(p)) - else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - gs_mol_sha = bbb(p) - else - gs_mol_sha = nan - end if - gs_mol_sha = max( bsha*gs_mol_sha, 1._r8) - fvalsha = 0._r8 - endif - if ((an_sun(p,iv) < 0._r8) .AND. (an_sha(p,iv) < 0._r8)) then - return - endif - - ! Quadratic gs_mol calculation with an known. Valid for an >= 0. - ! With an <= 0, then gs_mol = bbb - - ! Sunlit - cs_sun = cair - 1.4_r8/gb_mol * an_sun(p,iv) * forc_pbot(c) - cs_sun = max(cs_sun,10.e-06_r8) - - if ( stomatalcond_mtd == stomatalcond_mtd_medlyn2011 )then - term = 1.6_r8 * an_sun(p,iv) / (cs_sun / forc_pbot(c) * 1.e06_r8) - aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & - (gb_mol*1.e-06_r8 * rh_can)) - cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & - (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * & - (1.0 - medlynslope(patch%itype(p))* medlynslope(patch%itype(p)) / rh_can)) * term - - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sun = max(r1,r2) * 1.e06_r8 - - ! Shaded - cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) - - term = 1.6_r8 * an_sha(p,iv) / (cs_sha / forc_pbot(c) * 1.e06_r8) - aquad = 1.0_r8 - bquad = -(2.0 * (medlynintercept(patch%itype(p))*1.e-06_r8 + term) + (medlynslope(patch%itype(p)) * term)**2 / & - (gb_mol*1.e-06_r8 * rh_can)) - cquad = medlynintercept(patch%itype(p))*medlynintercept(patch%itype(p))*1.e-12_r8 + & - (2.0*medlynintercept(patch%itype(p))*1.e-06_r8 + term * (1.0 - medlynslope(patch%itype(p))* & - medlynslope(patch%itype(p)) / rh_can)) * term - - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sha = max(r1,r2)* 1.e06_r8 - else if ( stomatalcond_mtd == stomatalcond_mtd_bb1987 )then - aquad = cs_sun - bquad = cs_sun*(gb_mol - max(bsun*bbb(p),1._r8)) - mbb(p)*an_sun(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs_sun*max(bsun*bbb(p),1._r8) + mbb(p)*an_sun(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sun = max(r1,r2) - - ! Shaded - cs_sha = cair - 1.4_r8/gb_mol * an_sha(p,iv) * forc_pbot(c) - cs_sha = max(cs_sha,10.e-06_r8) - - aquad = cs_sha - bquad = cs_sha*(gb_mol - max(bsha*bbb(p),1._r8)) - mbb(p)*an_sha(p,iv)*forc_pbot(c) - cquad = -gb_mol*(cs_sha*max(bsha*bbb(p),1._r8) + mbb(p)*an_sha(p,iv)*forc_pbot(c)*rh_can) - call quadratic (aquad, bquad, cquad, r1, r2) - gs_mol_sha = max(r1,r2) - end if - - ! Derive new estimate for cisun,cisha - if (an_sun(p,iv) >= 0._r8) then - if (gs_mol_sun > 0._r8) then - fvalsun =cisun - cair + an_sun(p,iv) * forc_pbot(c) * (1.4_r8*gs_mol_sun+1.6_r8*gb_mol) / (gb_mol*gs_mol_sun) - else - fvalsun =cisun - cair - endif - endif - if (an_sha(p,iv) >= 0._r8) then - if (gs_mol_sha > 0._r8) then - fvalsha =cisha - cair + an_sha(p,iv) * forc_pbot(c) * (1.4_r8*gs_mol_sha+1.6_r8*gb_mol) / (gb_mol*gs_mol_sha) - else - fvalsha =cisha - cair - endif - endif - end associate - end subroutine ci_func_PHS - !-------------------------------------------------------------------------------- - - !------------------------------------------------------------------------------ - subroutine calcstress(p,c,x,bsun,bsha,gb_mol,gs_mol_sun,gs_mol_sha,qsatl,qaf, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst, & - temperature_inst, waterflux_inst) - ! - ! DESCRIPTIONS - ! compute the transpiration stress using a plant hydraulics approach - ! calls spacF, spacA, and getvegwp - ! - ! USES - use clm_varpar , only : nlevsoi - use clm_varcon , only : rgas - !! - ! !ARGUMENTS: - integer , intent(in) :: p ! pft index - integer , intent(in) :: c ! column index - real(r8) , intent(inout) :: x(nvegwcs) ! working copy of vegwp(p,:) - real(r8) , intent(out) :: bsun ! sunlit canopy transpiration wetness factor (0 to 1) - real(r8) , intent(out) :: bsha ! shaded sunlit canopy transpiration wetness factor (0 to 1) - real(r8) , intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: gs_mol_sun ! Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: gs_mol_sha ! Ball-Berry minimum leaf conductance (umol H2O/m**2/s) - real(r8) , intent(in) :: qsatl ! leaf specific humidity [kg/kg] - real(r8) , intent(in) :: qaf ! humidity of canopy air [kg/kg] - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterflux_type) , intent(in) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: A(nvegwcs,nvegwcs) ! matrix relating d(vegwp) and f: d(vegwp)=A*f - real(r8) :: f(nvegwcs) ! flux divergence (mm/s) - real(r8) :: dx(nvegwcs) ! change in vegwp from one iter to the next [mm] - real(r8) :: efpot ! potential latent energy flux [kg/m2/s] - real(r8) :: rppdry_sun ! fraction of potential evaporation through transp - sunlit [-] - real(r8) :: rppdry_sha ! fraction of potential evaporation through transp - shaded [-] - real(r8) :: qflx_sun ! [kg/m2/s] - real(r8) :: qflx_sha ! [kg/m2/s] - real(r8) :: gs0sun,gs0sha ! local gs_mol copies - real(r8) :: qsun,qsha ! attenuated transpiration fluxes - integer :: j ! index - real(r8) :: cf ! s m**2/umol -> s/m - integer :: iter ! newton's method iteration number - logical :: flag ! signal that matrix was not invertible - logical :: night ! signal to store vegwp within this routine, b/c it is night-time and full suite won't be called - integer, parameter :: itmax=50 ! exit newton's method if iters>itmax - real(r8), parameter :: tolf=1.e-6,toldx=1.e-9 !tolerances for a satisfactory solution - logical :: havegs ! signals direction of calculation gs->qflx or qflx->gs - real(r8) :: soilflux ! total soil column transpiration [mm/s] - real(r8), parameter :: tol_lai=.001_r8 ! minimum lai where transpiration is calc'd - !------------------------------------------------------------------------------ - - associate( & - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] patch canopy one-sided stem area index, no burying by snow - fdry => waterstate_inst%fdry_patch , & ! Input: [real(r8) (:) ] fraction of foliage that is green and dry [-] - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - tgcm => temperature_inst%thm_patch , & ! Input: [real(r8) (:) ] air temperature at agcm reference height (kelvin) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - sucsat => soilstate_inst%sucsat_col & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - ) - - !temporary flag for night time vegwp(sun)>0 - if (x(sun)>0._r8) then - night=.TRUE. - x(sun)=x(sha) - else - night=.FALSE. - endif - - !copy to avoid rewriting gs_mol_sun - gs0sun=gs_mol_sun - gs0sha=gs_mol_sha - - !compute transpiration demand - havegs=.true. - call getqflx(p,c,gb_mol,gs0sun,gs0sha,qflx_sun,qflx_sha,qsatl,qaf,havegs, & - atm2lnd_inst, canopystate_inst, waterstate_inst, temperature_inst) - - if ((laisun(p)>tol_lai .or. laisha(p)>tol_lai).and.& - (qflx_sun>0._r8 .or. qflx_sha>0._r8))then - - !newton's method solves for matching fluxes through the spac - iter=0 - do - - iter=iter+1 - - call spacF(p,c,x,f,qflx_sun,qflx_sha, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst,temperature_inst,waterflux_inst) - - if ( sqrt(sum(f*f)) < tolf*(qflx_sun+qflx_sha) ) then !fluxes balanced -> exit - flag = .false. - exit - end if - if ( iter>itmax ) then !exceeds max iters -> exit - flag = .false. - exit - end if - - call spacA(p,c,x,A,qflx_sun,qflx_sha,flag, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst,temperature_inst,waterflux_inst) - - if (flag) then - ! cannot invert the matrix, solve for x algebraically assuming no flux - exit - end if - - if (laisun(p)>tol_lai.and.laisha(p)>tol_lai)then - dx = matmul(A,f) - else - !reduces to 3x3 system - !in this case, dx is not always [sun,sha,xyl,root] - !sun and sha flip depending on which is lai==0 - dx(sun)=0._r8 - dx(sha:root)=matmul(A(sha:root,sha:root),f(sha:root)) - endif - - - if ( maxval(abs(dx)) > 50000._r8) then - dx = 50000._r8 * dx / maxval(abs(dx)) !rescale step to max of 50000 - end if - - - if (laisun(p)>tol_lai.and.laisha(p)>tol_lai)then - x=x+dx - elseif (laisha(p)>tol_lai) then - x=x+dx - x(sun)=x(xyl) ! psi_sun = psi_xyl because laisun==0 - else - x(xyl:root)=x(xyl:root)+dx(xyl:root) - x(sun)=x(sun)+dx(sha) ! implementation ugly bit, chose to flip dx(sun) and dx(sha) for laisha==0 case - x(sha)=x(xyl) ! psi_sha = psi_xyl because laisha==0 - - endif - - - if ( sqrt(sum(dx*dx)) < toldx) then - !step in vegwp small -> exit - exit - end if - - ! this is a catch to force spac gradient to atmosphere - if ( x(xyl) > x(root) ) x(xyl) = x(root) - if ( x(sun) > x(xyl) ) x(sun) = x(xyl) - if ( x(sha) > x(xyl) ) x(sha) = x(xyl) - - end do - - else - ! both qflxsun and qflxsha==0 - flag=.true. - end if - - if (flag) then - ! solve algebraically - call getvegwp(p, c, x, gb_mol, gs0sun, gs0sha, qsatl, qaf, soilflux, & - atm2lnd_inst, canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst) - bsun = plc(x(sun),p,c,sun,veg) - bsha = plc(x(sha),p,c,sha,veg) - else - ! compute attenuated flux - qsun=qflx_sun*plc(x(sun),p,c,sun,veg) - qsha=qflx_sha*plc(x(sha),p,c,sha,veg) - - ! retrieve stressed stomatal conductance - havegs=.FALSE. - call getqflx(p,c,gb_mol,gs0sun,gs0sha,qsun,qsha,qsatl,qaf,havegs, & - atm2lnd_inst, canopystate_inst, waterstate_inst, temperature_inst) - - ! compute water stress - ! .. generally -> B= gs_stressed / gs_unstressed - ! .. when gs=0 -> B= plc( x ) - if (qflx_sun>0._r8) then - bsun = gs0sun/gs_mol_sun - else - bsun = plc(x(sun),p,c,sun,veg) - endif - if (qflx_sha>0._r8) then - bsha = gs0sha/gs_mol_sha - else - bsha = plc(x(sha),p,c,sha,veg) - endif - endif - if ( bsun < 0.01_r8 ) bsun = 0._r8 - if ( bsha < 0.01_r8 ) bsha = 0._r8 - - !zqz is this the best place to do this? - ! was looking like qflx_tran_veg/vegwp was not being set at night time - ! set vegwp for the final gs_mol solution - if (night) then - gs0sun=bsun*gs_mol_sun - gs0sha=bsha*gs_mol_sha - call getvegwp(p, c, x, gb_mol, gs0sun, gs0sha, qsatl, qaf, soilflux, & - atm2lnd_inst, canopystate_inst, waterstate_inst, soilstate_inst, temperature_inst) - if (soilflux<0._r8) soilflux = 0._r8 - qflx_tran_veg(p) = soilflux - endif - - - end associate - - end subroutine calcstress - - !------------------------------------------------------------------------------ - - !------------------------------------------------------------------------------ - subroutine spacA(p,c,x,invA,qflx_sun,qflx_sha,flag, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst, & - temperature_inst, waterflux_inst) - - ! - ! DESCRIPTION - ! Returns invA, the inverse matrix relating delta(vegwp) to f - ! d(vegwp)=invA*f - ! evaluated at vegwp(p) - ! - ! The methodology is currently hardcoded for linear algebra assuming the - ! number of vegetation segments is four. Thus the matrix A and it's inverse - ! invA are both 4x4 matrices. A more general method could be done using for - ! example a LINPACK linear algebra solver. - ! - ! USES - use clm_varpar , only : nlevsoi - use clm_varcon , only : rgas - ! - ! !ARGUMENTS: - integer , intent(in) :: p ! pft index - integer , intent(in) :: c ! column index - real(r8) , intent(in) :: x(nvegwcs) ! working copy of veg water potential for patch p [mm H2O] - real(r8) , intent(out) :: invA(nvegwcs,nvegwcs) ! matrix relating d(vegwp) and f: d(vegwp)=invA*f - real(r8) , intent(in) :: qflx_sun ! Sunlit leaf transpiration [kg/m2/s] - real(r8) , intent(in) :: qflx_sha ! Shaded leaf transpiration [kg/m2/s] - logical , intent(out) :: flag ! tells calling function that the matrix is not invertible - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterflux_type) , intent(in) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: fsto1 ! sunlit transpiration reduction function [-] - real(r8) :: fsto2 ! shaded transpiration reduction function [-] - real(r8) :: fx ! fraction of maximum conductance, xylem-to-leaf [-] - real(r8) :: fr ! fraction of maximum conductance, root-to-xylem [-] - real(r8) :: dfsto1 ! 1st derivative of fsto1 w.r.t. change in vegwp - real(r8) :: dfsto2 ! 1st derivative of fsto2 w.r.t. change in vegwp - real(r8) :: dfx ! 1st derivative of fx w.r.t. change in vegwp - real(r8) :: dfr ! 1st derivative of fr w.r.t. change in vegwp - real(r8) :: A(nvegwcs,nvegwcs) ! matrix relating vegwp to flux divergence f=A*d(vegwp) - real(r8) :: leading ! inverse of determiniant - real(r8) :: determ ! determinant of matrix - real(r8) :: grav1 ! gravitational potential surface to canopy top (mm H2O) - real(r8) :: invfactor ! - real(r8), parameter :: tol_lai=.001_r8 ! minimum lai where transpiration is calc'd - integer :: j ! index - !------------------------------------------------------------------------------ -#ifndef NDEBUG - ! Only execute this code if DEBUG=TRUE - if ( nvegwcs /= 4 )then - call endrun(msg='Error:: this function is hardcoded for 4x4 matrices with nvegwcs==4'//errMsg(__FILE__, __LINE__)) - end if -#endif - - associate( & - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] soil-root interface conductance (mm/s) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - htop => canopystate_inst%htop_patch , & ! Input: [real(r8) (:) ] patch canopy top (m) - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] patch canopy one-sided stem area index, no burying by snow - ivt => patch%itype & ! Input: [integer (:) ] patch vegetation type - ) - - ! initialize all elements to zero - A = 0._r8 - invA = 0._r8 - - grav1 = htop(p)*1000._r8 - - !compute conductance attentuation for each segment - fsto1= plc(x(sun),p,c,sun,veg) - fsto2= plc(x(sha),p,c,sha,veg) - fx= plc(x(xyl),p,c,xyl,veg) - fr= plc(x(root),p,c,root,veg) - - !compute 1st deriv of conductance attenuation for each segment - dfsto1= d1plc(x(sun),p,c,sun,veg) - dfsto2= d1plc(x(sha),p,c,sha,veg) - dfx= d1plc(x(xyl),p,c,xyl,veg) - dfr= d1plc(x(root),p,c,root,veg) - - !A - f=A*d(vegwp) - A(1,1)= - laisun(p) * params_inst%kmax(ivt(p),sun) * fx& - - qflx_sun * dfsto1 - A(1,3)= laisun(p) * params_inst%kmax(ivt(p),sun) * dfx * (x(xyl)-x(sun))& - + laisun(p) * params_inst%kmax(ivt(p),sun) * fx - A(2,2)= - laisha(p) * params_inst%kmax(ivt(p),sha) * fx& - - qflx_sha * dfsto2 - A(2,3)= laisha(p) * params_inst%kmax(ivt(p),sha) * dfx * (x(xyl)-x(sha))& - + laisha(p) * params_inst%kmax(ivt(p),sha) * fx - A(3,1)= laisun(p) * params_inst%kmax(ivt(p),sun) * fx - A(3,2)= laisha(p) * params_inst%kmax(ivt(p),sha) * fx - A(3,3)= - laisun(p) * params_inst%kmax(ivt(p),sun) * dfx * (x(xyl)-x(sun))& - - laisun(p) * params_inst%kmax(ivt(p),sun) * fx& - - laisha(p) * params_inst%kmax(ivt(p),sha) * dfx * (x(xyl)-x(sha))& - - laisha(p) * params_inst%kmax(ivt(p),sha) * fx& - - tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr - A(3,4)= tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * dfr * (x(root)-x(xyl)-grav1)& - + tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr - A(4,3)= tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr - A(4,4)= - tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr& - - tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * dfr * (x(root)-x(xyl)-grav1)& - - sum(k_soil_root(p,1:nlevsoi)) - - invfactor=1._r8 - A=invfactor*A - - !matrix inversion - if (laisun(p)>tol_lai .and. laisha(p)>tol_lai) then - ! general case - - determ=A(4,4)*A(2,2)*A(3,3)*A(1,1) - A(4,4)*A(2,2)*A(3,1)*A(1,3)& - - A(4,4)*A(3,2)*A(2,3)*A(1,1) - A(4,3)*A(1,1)*A(2,2)*A(3,4) - if ( abs(determ) <= 1.e-50_r8 ) then - flag = .true. !tells calling function that the matrix is not invertible - return - else - flag = .false. - end if - - leading = 1._r8/determ - - !algebraic inversion of the matrix - invA(1,1)=leading*A(4,4)*A(2,2)*A(3,3) - leading*A(4,4)*A(3,2)*A(2,3) - leading*A(4,3)*A(2,2)*A(3,4) - invA(2,1)=leading*A(2,3)*A(4,4)*A(3,1) - invA(3,1)=-leading*A(4,4)*A(2,2)*A(3,1) - invA(4,1)=leading*A(4,3)*A(2,2)*A(3,1) - invA(1,2)=leading*A(1,3)*A(4,4)*A(3,2) - invA(2,2)=leading*A(4,4)*A(3,3)*A(1,1)-leading*A(4,4)*A(3,1)*A(1,3)-leading*A(4,3)*A(1,1)*A(3,4) - invA(3,2)=-leading*A(1,1)*A(4,4)*A(3,2) - invA(4,2)=leading*A(4,3)*A(1,1)*A(3,2) - invA(1,3)=-leading*A(1,3)*A(2,2)*A(4,4) - invA(2,3)=-leading*A(2,3)*A(1,1)*A(4,4) - invA(3,3)=leading*A(2,2)*A(1,1)*A(4,4) - invA(4,3)=-leading*A(4,3)*A(1,1)*A(2,2) - invA(1,4)=leading*A(1,3)*A(3,4)*A(2,2) - invA(2,4)=leading*A(2,3)*A(3,4)*A(1,1) - invA(3,4)=-leading*A(3,4)*A(1,1)*A(2,2) - invA(4,4)=leading*A(2,2)*A(3,3)*A(1,1)-leading*A(2,2)*A(3,1)*A(1,3)-leading*A(3,2)*A(2,3)*A(1,1) - invA=invfactor*invA !undo inversion scaling - else - ! if laisun or laisha ==0 invert the corresponding 3x3 matrix - ! if both are zero, this routine is not called - if (laisha(p)<=tol_lai) then - ! shift nonzero matrix values so that both 3x3 cases can be inverted with the same code - A(2,2)=A(1,1) - A(3,2)=A(3,1) - A(2,3)=A(1,3) - endif - determ=A(2,2)*A(3,3)*A(4,4)-A(3,4)*A(2,2)*A(4,3)-A(2,3)*A(3,2)*A(4,4) - if ( abs(determ) <= 1.e-50_r8 ) then - flag = .true. !tells calling function that the matrix is not invertible - return - else - flag = .false. - end if - - !algebraic inversion of the 3x3 matrix stored in A(2:4,2:4) - invA(2,2)=A(3,3)*A(4,4)-A(3,4)*A(4,3) - invA(2,3)=-A(2,3)*A(4,4) - invA(2,4)=A(3,4)*A(2,3) - invA(3,2)=-A(3,2)*A(4,4) - invA(3,3)=A(2,2)*A(4,4) - invA(3,4)=-A(3,4)*A(2,2) - invA(4,2)=A(3,2)*A(4,3) - invA(4,3)=-A(2,2)*A(4,3) - invA(4,4)=A(2,2)*A(3,3)-A(2,3)*A(3,2) - invA=1._r8/determ*invA - - endif - - end associate - - end subroutine spacA - - !-------------------------------------------------------------------------------- - - !------------------------------------------------------------------------------ - subroutine spacF(p,c,x,f,qflx_sun,qflx_sha, & - atm2lnd_inst,canopystate_inst,waterstate_inst,soilstate_inst, & - temperature_inst, waterflux_inst) - ! - ! DESCRIPTION - ! Returns f, the flux divergence across each vegetation segment - ! calculated for vegwp(p,:) as passed in via x - ! - ! USES - use clm_varpar , only : nlevsoi - use clm_varcon , only : rgas - use ColumnType , only : col - ! - ! !ARGUMENTS: - integer , intent(in) :: p ! pft index - integer , intent(in) :: c ! column index - real(r8) , intent(in) :: x(nvegwcs) ! working copy of veg water potential for patch p [mm H2O] - real(r8) , intent(out) :: f(nvegwcs) ! water flux divergence [mm/s] - real(r8) , intent(in) :: qflx_sun ! Sunlit leaf transpiration [kg/m2/s] - real(r8) , intent(in) :: qflx_sha ! Shaded leaf transpiration [kg/m2/s] - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterflux_type) , intent(in) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: fsto1 ! sunlit transpiration reduction function [-] - real(r8) :: fsto2 ! shaded transpiration reduction function [-] - real(r8) :: fx ! fraction of maximum conductance, xylem-to-leaf [-] - real(r8) :: fr ! fraction of maximum conductance, root-to-xylem [-] - real(r8) :: grav1 ! gravitational potential surface to canopy top (mm H2O) - real(r8) :: grav2(nlevsoi) ! soil layer gravitational potential relative to surface (mm H2O) - real(r8) :: temp ! used to copy f(sun) to f(sha) for special case - real(r8), parameter :: tol_lai=.001_r8 ! needs to be the same as in calcstress and spacA (poor form, refactor)< - integer :: j ! index - !------------------------------------------------------------------------------ - - associate( & - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] soil-root interface conductance (mm/s) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - htop => canopystate_inst%htop_patch , & ! Input: [real(r8) (:) ] patch canopy top (m) - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] patch canopy one-sided stem area index, no burying by snow - smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - z => col%z & ! Input: [real(r8) (:,:) ] layer node depth (m) - ) - - grav1 = htop(p) * 1000._r8 - grav2(1:nlevsoi) = z(c,1:nlevsoi) * 1000._r8 - - fsto1= plc(x(sun),p,c,sun,veg) - fsto2= plc(x(sha),p,c,sha,veg) - fx= plc(x(xyl),p,c,xyl,veg) - fr= plc(x(root),p,c,root,veg) - - !compute flux divergence across each plant segment - f(sun)= qflx_sun * fsto1 - laisun(p) * params_inst%kmax(ivt(p),sun) * fx * (x(xyl)-x(sun)) - f(sha)= qflx_sha * fsto2 - laisha(p) * params_inst%kmax(ivt(p),sha) * fx * (x(xyl)-x(sha)) - f(xyl)= laisun(p) * params_inst%kmax(ivt(p),sun) * fx * (x(xyl)-x(sun))& - + laisha(p) * params_inst%kmax(ivt(p),sha) * fx * (x(xyl)-x(sha)) & - - tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr * (x(root)-x(xyl)-grav1) - f(root)= tsai(p) * params_inst%kmax(ivt(p),xyl) / htop(p) * fr * (x(root)-x(xyl)-grav1) & - + sum( k_soil_root(p,1:nlevsoi) * (x(root)+grav2(1:nlevsoi)) ) & - - sum( k_soil_root(p,1:nlevsoi) * smp(c,1:nlevsoi) ) - - if (laisha(p)qflx or qflx->gs - !---------------------------------------------------------------------- - associate( & - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] soil-root interface conductance (mm/s) - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - htop => canopystate_inst%htop_patch , & ! Input: [real(r8) (:) ] patch canopy top (m) - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] patch canopy one-sided stem area index, no burying by snow - smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - z => col%z & ! Input: [real(r8) (:,:) ] layer node depth (m) - ) - - grav1 = 1000._r8 *htop(p) - grav2(1:nlevsoi) = 1000._r8 * z(c,1:nlevsoi) - - !compute transpiration demand - havegs=.true. - call getqflx(p,c,gb_mol,gs_mol_sun,gs_mol_sha,qflx_sun,qflx_sha,qsatl,qaf,havegs, & - atm2lnd_inst, canopystate_inst, waterstate_inst, temperature_inst) - - !calculate root water potential - if ( abs(sum(k_soil_root(p,1:nlevsoi))) == 0._r8 ) then - x(root) = sum(smp(c,1:nlevsoi) - grav2)/nlevsoi - else - x(root) = (sum(k_soil_root(p,1:nlevsoi)*(smp(c,1:nlevsoi)-grav2))-qflx_sun-qflx_sha) & - /sum(k_soil_root(p,1:nlevsoi)) - endif - - !calculate xylem water potential - fr = plc(x(root),p,c,root,veg) - if ( (tsai(p) > 0._r8) .and. (fr > 0._r8) ) then - x(xyl) = x(root) - grav1 - (qflx_sun+qflx_sha)/(fr*params_inst%kmax(ivt(p),root)/htop(p)*tsai(p))!removed htop conversion - else - x(xyl) = x(root) - grav1 - endif - - !calculate sun/sha leaf water potential - fx = plc(x(xyl),p,c,xyl,veg) - if ( (laisha(p) > 0._r8) .and. (fx > 0._r8) ) then - x(sha) = x(xyl) - (qflx_sha/(fx*params_inst%kmax(ivt(p),xyl)*laisha(p))) - else - x(sha) = x(xyl) - endif - if ( (laisun(p) > 0._r8) .and. (fx > 0._r8) ) then - x(sun) = x(xyl) - (qflx_sun/(fx*params_inst%kmax(ivt(p),xyl)*laisun(p))) - else - x(sun) = x(xyl) - endif - - !calculate soil flux - soilflux = 0._r8 - do j = 1,nlevsoi - soilflux = soilflux + k_soil_root(p,j)*(smp(c,j)-x(root)-grav2(j)) - enddo - - end associate - - end subroutine getvegwp - - !-------------------------------------------------------------------------------- - subroutine getqflx(p,c,gb_mol,gs_mol_sun,gs_mol_sha,qflx_sun,qflx_sha,qsatl,qaf,havegs, & - atm2lnd_inst, canopystate_inst, waterstate_inst, temperature_inst) - ! !DESCRIPTION: - ! calculate sunlit and shaded transpiration using gb_MOL and gs_MOL - ! !USES: - ! - use clm_varcon , only : rgas - implicit none - ! - ! !ARGUMENTS: - integer , intent(in) :: p ! pft index - integer , intent(in) :: c ! column index - real(r8) , intent(in) :: gb_mol ! leaf boundary layer conductance (umol H2O/m**2/s) - real(r8) , intent(inout) :: gs_mol_sun ! Ball-Berry leaf conductance (umol H2O/m**2/s) - real(r8) , intent(inout) :: gs_mol_sha ! Ball-Berry leaf conductance (umol H2O/m**2/s) - real(r8) , intent(inout) :: qflx_sun ! Sunlit leaf transpiration [kg/m2/s] - real(r8) , intent(inout) :: qflx_sha ! Shaded leaf transpiration [kg/m2/s] - real(r8) , intent(in) :: qsatl ! leaf specific humidity [kg/kg] - real(r8) , intent(in) :: qaf ! humidity of canopy air [kg/kg] - logical , intent(in) :: havegs ! signals direction of calculation gs->qflx or qflx->gs - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: efpot ! potential latent energy flux [kg/m2/s] - real(r8) :: rppdry_sun ! fraction of potential evaporation through transp - sunlit [-] - real(r8) :: rppdry_sha ! fraction of potential evaporation through transp - shaded [-] - real(r8) :: cf ! s m**2/umol -> s/m - !---------------------------------------------------------------------- - - associate( & - laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area - laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded leaf area - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - fdry => waterstate_inst%fdry_patch , & ! Input: [real(r8) (:) ] fraction of foliage that is green and dry [-] - forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - tgcm => temperature_inst%thm_patch & ! Input: [real(r8) (:) ] air temperature at agcm reference height (kelvin) - ) - - - cf = forc_pbot(c)/(rgas*1.e-3_r8*tgcm(p))*1.e6_r8 ! gb->gbmol conversion factor - wtl = (elai(p)+esai(p))*gb_mol - efpot = forc_rho(c)*wtl*(qsatl-qaf) - if (havegs) then - - if ( (efpot > 0._r8) .and. (elai(p) > 0._r8) ) then - if ( gs_mol_sun > 0._r8 ) then - rppdry_sun = fdry(p)/gb_mol*(laisun(p)/(1._r8/gb_mol+1._r8/gs_mol_sun))/elai(p) - qflx_sun = efpot*rppdry_sun/cf - else - qflx_sun = 0._r8 - end if - if ( gs_mol_sha > 0._r8 ) then - rppdry_sha = fdry(p)/gb_mol*(laisha(p)/(1._r8/gb_mol+1._r8/gs_mol_sha))/elai(p) - qflx_sha = efpot*rppdry_sha/cf - else - qflx_sha = 0._r8 - end if - else - qflx_sun = 0._r8 - qflx_sha = 0._r8 - end if - - else - if (qflx_sun > 0._r8) then - gs_mol_sun=gb_mol*qflx_sun*cf*elai(p)/(efpot*fdry(p)*laisun(p)-qflx_sun*cf*elai(p)) - else - gs_mol_sun=0._r8 - endif - if (qflx_sha > 0._r8) then - gs_mol_sha=gb_mol*qflx_sha*cf*elai(p)/(efpot*fdry(p)*laisha(p)-qflx_sha*cf*elai(p)) - else - gs_mol_sha=0._r8 - endif - - endif - - end associate - - end subroutine getqflx - - !-------------------------------------------------------------------------------- - function plc(x,p,c,level,plc_method) - ! !DESCRIPTION - ! Return value of vulnerability curve at x - ! - ! !ARGUMENTS - real(r8) , intent(in) :: x ! water potential input - integer , intent(in) :: p ! index for pft - integer , intent(in) :: c ! index for column - integer , intent(in) :: level ! veg segment lvl (1:nvegwcs) - integer , intent(in) :: plc_method ! - real(r8) :: plc ! attenuated conductance [0:1] 0=no flow - ! - ! !PARAMETERS - integer , parameter :: vegetation_weibull=0 ! case number - !------------------------------------------------------------------------------ - associate( & - ivt => patch%itype & ! Input: [integer (:) ] patch vegetation type - ) - - select case (plc_method) - !possible to add other methods later - case (vegetation_weibull) - plc=2._r8**(-(x/params_inst%psi50(ivt(p),level))**params_inst%ck(ivt(p),level)) - if ( plc < 0.005_r8) plc = 0._r8 - case default - print *,'must choose plc method' - end select - - end associate - - end function plc - !-------------------------------------------------------------------------------- - - !-------------------------------------------------------------------------------- - function d1plc(x,p,c,level,plc_method) - ! !DESCRIPTION - ! Return 1st derivative of vulnerability curve at x - ! - ! !ARGUMENTS - real(r8) , intent(in) :: x ! water potential input - integer , intent(in) :: p ! index for pft - integer , intent(in) :: c ! index for column - integer , intent(in) :: level ! veg segment lvl (1:nvegwcs) - integer , intent(in) :: plc_method ! 0 for vegetation, 1 for soil - real(r8) :: d1plc ! first deriv of plc curve at x - ! - ! !PARAMETERS - integer , parameter :: vegetation_weibull=0 ! case number - !------------------------------------------------------------------------------ - associate( & - ivt => patch%itype & ! Input: [integer (:) ] patch vegetation type - ) - - select case (plc_method) - !possible to add other methods later - case (vegetation_weibull) - d1plc= -params_inst%ck(ivt(p),level) * log(2._r8) * (2._r8**(-(x/params_inst%psi50(ivt(p),level)) & - **params_inst%ck(ivt(p),level))) & - * ((x/params_inst%psi50(ivt(p),level))**params_inst%ck(ivt(p),level)) / x - case default - print *,'must choose plc method' - end select - - end associate - - end function d1plc - -end module PhotosynthesisMod diff --git a/src/biogeophys/QSatMod.F90 b/src/biogeophys/QSatMod.F90 deleted file mode 100644 index 0b1819e467..0000000000 --- a/src/biogeophys/QSatMod.F90 +++ /dev/null @@ -1,167 +0,0 @@ -module QSatMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Computes saturation mixing ratio and the change in saturation - ! - ! !PUBLIC TYPES: - use shr_kind_mod , only: r8 => shr_kind_r8 - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: QSat - public :: rhoSat - !----------------------------------------------------------------------- - - ! For water vapor (temperature range 0C-100C) - real(r8), parameter :: a0 = 6.11213476_r8 - real(r8), parameter :: a1 = 0.444007856_r8 - real(r8), parameter :: a2 = 0.143064234e-01_r8 - real(r8), parameter :: a3 = 0.264461437e-03_r8 - real(r8), parameter :: a4 = 0.305903558e-05_r8 - real(r8), parameter :: a5 = 0.196237241e-07_r8 - real(r8), parameter :: a6 = 0.892344772e-10_r8 - real(r8), parameter :: a7 = -0.373208410e-12_r8 - real(r8), parameter :: a8 = 0.209339997e-15_r8 - ! For derivative:water vapor - real(r8), parameter :: b0 = 0.444017302_r8 - real(r8), parameter :: b1 = 0.286064092e-01_r8 - real(r8), parameter :: b2 = 0.794683137e-03_r8 - real(r8), parameter :: b3 = 0.121211669e-04_r8 - real(r8), parameter :: b4 = 0.103354611e-06_r8 - real(r8), parameter :: b5 = 0.404125005e-09_r8 - real(r8), parameter :: b6 = -0.788037859e-12_r8 - real(r8), parameter :: b7 = -0.114596802e-13_r8 - real(r8), parameter :: b8 = 0.381294516e-16_r8 - ! For ice (temperature range -75C-0C) - real(r8), parameter :: c0 = 6.11123516_r8 - real(r8), parameter :: c1 = 0.503109514_r8 - real(r8), parameter :: c2 = 0.188369801e-01_r8 - real(r8), parameter :: c3 = 0.420547422e-03_r8 - real(r8), parameter :: c4 = 0.614396778e-05_r8 - real(r8), parameter :: c5 = 0.602780717e-07_r8 - real(r8), parameter :: c6 = 0.387940929e-09_r8 - real(r8), parameter :: c7 = 0.149436277e-11_r8 - real(r8), parameter :: c8 = 0.262655803e-14_r8 - ! For derivative:ice - real(r8), parameter :: d0 = 0.503277922_r8 - real(r8), parameter :: d1 = 0.377289173e-01_r8 - real(r8), parameter :: d2 = 0.126801703e-02_r8 - real(r8), parameter :: d3 = 0.249468427e-04_r8 - real(r8), parameter :: d4 = 0.313703411e-06_r8 - real(r8), parameter :: d5 = 0.257180651e-08_r8 - real(r8), parameter :: d6 = 0.133268878e-10_r8 - real(r8), parameter :: d7 = 0.394116744e-13_r8 - real(r8), parameter :: d8 = 0.498070196e-16_r8 -contains - - - - !----------------------------------------------------------------------- - subroutine QSat (T, p, es, esdT, qs, qsdT) - ! - ! !DESCRIPTION: - ! Computes saturation mixing ratio and the change in saturation - ! mixing ratio with respect to temperature. - ! Reference: Polynomial approximations from: - ! Piotr J. Flatau, et al.,1992: Polynomial fits to saturation - ! vapor pressure. Journal of Applied Meteorology, 31, 1507-1513. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: T ! temperature (K) - real(r8), intent(in) :: p ! surface atmospheric pressure (pa) - real(r8), intent(out) :: es ! vapor pressure (pa) - real(r8), intent(out) :: esdT ! d(es)/d(T) - real(r8), intent(out) :: qs ! humidity (kg/kg) - real(r8), intent(out) :: qsdT ! d(qs)/d(T) - ! - ! !LOCAL VARIABLES: - real(r8) :: T_limit - real(r8) :: td,vp,vp1,vp2 - !----------------------------------------------------------------------- - - T_limit = T - SHR_CONST_TKFRZ - if (T_limit > 100.0_r8) T_limit=100.0_r8 - if (T_limit < -75.0_r8) T_limit=-75.0_r8 - - td = T_limit - if (td >= 0.0_r8) then - es = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & - + td*(a5 + td*(a6 + td*(a7 + td*a8))))))) - - esdT = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & - + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) - - else - es = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & - + td*(c5 + td*(c6 + td*(c7 + td*c8))))))) - - esdT = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & - + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) - - endif - - es = es * 100._r8 ! pa - - esdT = esdT * 100._r8 ! pa/K - - - vp = 1.0_r8 / (p - 0.378_r8*es) - vp1 = 0.622_r8 * vp - vp2 = vp1 * vp - - qs = es * vp1 ! kg/kg - qsdT = esdT * vp2 * p ! 1 / K - - - end subroutine QSat - - - -!------------------------------------------------------------------------------- - subroutine rhoSat(T, rho, rhodT) - ! compute the saturated vapor pressure density and its derivative against the temperature - ! jyt - use clm_varcon, only: rwat - use shr_const_mod, only: SHR_CONST_TKFRZ - - implicit none - real(r8), intent(in) :: T - real(r8), intent(out) :: rho - real(r8), optional, intent(out) :: rhodT - - - !------------------ - - real(r8) :: T_limit - real(r8) :: td, es, esdT - - T_limit = T - SHR_CONST_TKFRZ - if (T_limit > 100.0_r8) T_limit=100.0_r8 - if (T_limit < -75.0_r8) T_limit=-75.0_r8 - - td = T_limit - if (td >= 0.0_r8) then - es = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & - + td*(a5 + td*(a6 + td*(a7 + td*a8))))))) - esdT = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & - + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) - else - es = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & - + td*(c5 + td*(c6 + td*(c7 + td*c8))))))) - esdT = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & - + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) - endif - - es = es * 100._r8 ! pa - rho = es/(rwat*T) !kg m^-3 - if(present(rhodT))rhodT= esdT/(rwat*T)-rho/T !kg m^-3 K^-1 - end subroutine rhoSat -end module QSatMod diff --git a/src/biogeophys/RootBiophysMod.F90 b/src/biogeophys/RootBiophysMod.F90 deleted file mode 100644 index ba05705614..0000000000 --- a/src/biogeophys/RootBiophysMod.F90 +++ /dev/null @@ -1,332 +0,0 @@ -module RootBiophysMod - -#include "shr_assert.h" - - !-------------------------------------------------------------------------------------- - ! DESCRIPTION: - ! module contains subroutine for root biophysics - ! - ! HISTORY - ! created by Jinyun Tang, Mar 1st, 2014 - implicit none - private - ! - public :: init_vegrootfr - public :: init_rootprof - - integer, private, parameter :: zeng_2001_root = 0 !the zeng 2001 root profile function - integer, private, parameter :: jackson_1996_root = 1 !the jackson 1996 root profile function - integer, private, parameter :: koven_exp_root = 2 !the koven exponential root profile function - - integer, public :: rooting_profile_method_water !select the type of rooting profile parameterization for water - integer, public :: rooting_profile_method_carbon !select the type of rooting profile parameterization for carbon - integer, public :: rooting_profile_varindex_water !select the variant number of rooting profile parameterization for water - integer, public :: rooting_profile_varindex_carbon !select the variant number of rooting profile parameterization for carbon - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !-------------------------------------------------------------------------------------- - -contains - - !-------------------------------------------------------------------------------------- - subroutine init_rootprof(NLFilename) - ! - !DESCRIPTION - ! initialize methods for root profile calculation - - ! !USES: - use abortutils , only : endrun - use fileutils , only : getavu, relavu - use spmdMod , only : mpicom, masterproc - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use clm_nlUtilsMod , only : find_nlgroup_name - - ! !ARGUMENTS: - !------------------------------------------------------------------------------ - implicit none - character(len=*), intent(in) :: NLFilename - - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(*), parameter :: subName = "('init_rootprof')" - - !----------------------------------------------------------------------- - -! MUST agree with name in namelist and read statement - namelist /rooting_profile_inparm/ rooting_profile_method_water, rooting_profile_method_carbon, & - rooting_profile_varindex_water, rooting_profile_varindex_carbon - - ! Default values for namelist - - rooting_profile_method_water = zeng_2001_root - rooting_profile_method_carbon = zeng_2001_root - rooting_profile_varindex_water = 1 - rooting_profile_varindex_carbon = 2 - - ! Read rooting_profile namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'rooting_profile_inparm', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=rooting_profile_inparm,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading rooting_profile namelist') - end if - else - call endrun(subname // ':: ERROR finding rooting_profile namelist') - end if - close(nu_nml) - call relavu( nu_nml ) - - endif - - call shr_mpi_bcast(rooting_profile_method_water, mpicom) - call shr_mpi_bcast(rooting_profile_method_carbon, mpicom) - call shr_mpi_bcast(rooting_profile_varindex_water, mpicom) - call shr_mpi_bcast(rooting_profile_varindex_carbon, mpicom) - - if (masterproc) then - - write(iulog,*) ' ' - write(iulog,*) 'rooting_profile settings:' - write(iulog,*) ' rooting_profile_method_water = ',rooting_profile_method_water - if ( rooting_profile_method_water == jackson_1996_root )then - write(iulog,*) ' (rooting_profile_varindex_water = ',rooting_profile_varindex_water, ')' - end if - write(iulog,*) ' rooting_profile_method_carbon = ',rooting_profile_method_carbon - if ( rooting_profile_method_carbon == jackson_1996_root )then - write(iulog,*) ' (rooting_profile_varindex_carbon = ',rooting_profile_varindex_carbon, ')' - end if - - endif - - end subroutine init_rootprof - - !-------------------------------------------------------------------------------------- - subroutine init_vegrootfr(bounds, nlevsoi, nlevgrnd, rootfr, water_carbon) - ! - !DESCRIPTION - !initialize plant root profiles - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer, intent(in) :: nlevsoi ! number of hydactive layers - integer, intent(in) :: nlevgrnd ! number of soil layers - real(r8), intent(out):: rootfr(bounds%begp: , 1: ) ! root fraction by layer - character(len=*), intent(in) :: water_carbon ! roots for water or carbon - - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'init_vegrootfr' ! subroutine name - integer :: c,p - integer :: rooting_profile_method ! Rooting profile method to use - integer :: rooting_profile_varidx ! Rooting profile variant index to use - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(rootfr) == (/bounds%endp, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - if ( water_carbon == 'water' ) then - rooting_profile_method = rooting_profile_method_water - rooting_profile_varidx = rooting_profile_varindex_water - else if (water_carbon == 'carbon') then - rooting_profile_method = rooting_profile_method_carbon - rooting_profile_varidx = rooting_profile_varindex_carbon - else - call endrun(subname // ':: input type can only be water or carbon = '//water_carbon ) - end if - - select case( rooting_profile_method ) - - case (zeng_2001_root) - rootfr(bounds%begp:bounds%endp, 1 : nlevsoi) = zeng2001_rootfr(bounds, nlevsoi) - case (jackson_1996_root) - rootfr(bounds%begp:bounds%endp, 1 : nlevsoi) = jackson1996_rootfr(bounds, nlevsoi, rooting_profile_varidx, water_carbon) - case (koven_exp_root) - rootfr(bounds%begp:bounds%endp, 1 : nlevsoi) = exponential_rootfr(bounds, nlevsoi) - case default - call endrun(subname // ':: a root fraction function must be specified!') - end select - rootfr(bounds%begp:bounds%endp,nlevsoi+1:nlevgrnd)=0._r8 - - ! shift roots up above bedrock boundary (distribute equally to each layer) - ! may not matter if normalized later - do p = bounds%begp,bounds%endp - c = patch%column(p) - rootfr(p,1:col%nbedrock(c)) = rootfr(p,1:col%nbedrock(c)) & - + sum(rootfr(p,col%nbedrock(c)+1:nlevsoi))/real(col%nbedrock(c)) - rootfr(p,col%nbedrock(c)+1:nlevsoi) = 0._r8 - enddo - end subroutine init_vegrootfr - - !------------------------------------------------------------------------- - function zeng2001_rootfr(bounds, ubj) result(rootfr) - ! - ! DESCRIPTION - ! compute root profile for soil water uptake - ! using equation from Zeng 2001, J. Hydrometeorology - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use PatchType , only : patch - use ColumnType , only : col - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: ubj ! ubnd - ! - ! !RESULT - real(r8) :: rootfr(bounds%begp:bounds%endp , 1:ubj ) ! - ! - ! !LOCAL VARIABLES: - integer :: p, lev, c - !------------------------------------------------------------------------ - - !(computing from surface, d is depth in meter): - ! Y = 1 -1/2 (exp(-ad)+exp(-bd) under the constraint that - ! Y(d =0.1m) = 1-beta^(10 cm) and Y(d=d_obs)=0.99 with - ! beta & d_obs given in Zeng et al. (1998). - - do p = bounds%begp,bounds%endp - - if (.not. patch%is_fates(p)) then - c = patch%column(p) - do lev = 1, ubj-1 - rootfr(p,lev) = .5_r8*( & - exp(-pftcon%roota_par(patch%itype(p)) * col%zi(c,lev-1)) & - + exp(-pftcon%rootb_par(patch%itype(p)) * col%zi(c,lev-1)) & - - exp(-pftcon%roota_par(patch%itype(p)) * col%zi(c,lev )) & - - exp(-pftcon%rootb_par(patch%itype(p)) * col%zi(c,lev )) ) - end do - rootfr(p,ubj) = .5_r8*( & - exp(-pftcon%roota_par(patch%itype(p)) * col%zi(c,ubj-1)) & - + exp(-pftcon%rootb_par(patch%itype(p)) * col%zi(c,ubj-1)) ) - - else - rootfr(p,1:ubj) = 0._r8 - endif - - enddo - return - - end function zeng2001_rootfr - - !------------------------------------------------------------------------- - function jackson1996_rootfr(bounds, ubj, varindx, water_carbon) result(rootfr) - ! - ! DESCRIPTION - ! compute root profile for soil water uptake - ! using equation from Jackson et al. 1996, Oec. - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use PatchType , only : patch - use ColumnType , only : col - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: ubj ! ubnd - integer , intent(in) :: varindx ! variant index - character(len=*) , intent(in) :: water_carbon ! roots for water or carbon - ! - ! !RESULT - real(r8) :: rootfr(bounds%begp:bounds%endp , 1:ubj ) ! - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: m_to_cm = 1.e2_r8 - real(r8) :: beta !patch specific shape parameter - integer :: p, lev, c - !------------------------------------------------------------------------ - - !(computing from surface, d is depth in centimeters): - ! Y = (1 - beta^d); beta given in Jackson et al. (1996). - - rootfr(bounds%begp:bounds%endp, :) = 0._r8 - do p = bounds%begp,bounds%endp - c = patch%column(p) - if (.not.patch%is_fates(p)) then - beta = pftcon%rootprof_beta(patch%itype(p),varindx) - do lev = 1, ubj - rootfr(p,lev) = ( & - beta ** (col%zi(c,lev-1)*m_to_cm) - & - beta ** (col%zi(c,lev)*m_to_cm) ) - end do - else - rootfr(p,:) = 0. - endif - - enddo - return - - end function jackson1996_rootfr - - !------------------------------------------------------------------------- - function exponential_rootfr(bounds, ubj) result(rootfr) - ! - ! DESCRIPTION - ! compute root profile for soil water uptake - ! using equation from Koven - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use pftconMod , only : pftcon - use PatchType , only : patch - use ColumnType , only : col - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: ubj ! ubnd - ! - ! !RESULT - real(r8) :: rootfr(bounds%begp:bounds%endp , 1:ubj ) ! - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: rootprof_exp = 3. ! how steep profile is for root C inputs (1/ e-folding depth) (1/m) - real(r8) :: norm - integer :: p, lev, c - - !------------------------------------------------------------------------ - - rootfr(bounds%begp:bounds%endp, :) = 0._r8 - do p = bounds%begp,bounds%endp - c = patch%column(p) - if (.not.patch%is_fates(p)) then - do lev = 1, ubj - rootfr(p,lev) = exp(-rootprof_exp * col%z(c,lev)) * col%dz(c,lev) - end do - else - rootfr(p,1) = 0. - endif - norm = -1./rootprof_exp * (exp(-rootprof_exp * col%z(c,ubj)) - 1._r8) - rootfr(p,:) = rootfr(p,:) / norm - - enddo - - return - - end function exponential_rootfr - -end module RootBiophysMod diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 deleted file mode 100644 index 15f3f57674..0000000000 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ /dev/null @@ -1,2143 +0,0 @@ -! -*- mode: f90; indent-tabs-mode: nil; f90-do-indent:3; f90-if-indent:3; f90-type-indent:3; f90-program-indent:2; f90-associate-indent:0; f90-continuation-indent:5 -*- -module SnowHydrologyMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate snow hydrology. - ! - Using as input aerosol deposition from atmosphere model calculate - ! aerosol fluxes and masses in each layer - need for surface albedo calculation - ! - Change of snow mass and the snow water onto soil - ! - Change in snow layer thickness due to compaction - ! - Combine snow layers less than a min thickness - ! - Subdivide snow layers if they exceed maximum thickness - ! - Construct snow/no-snow filters - - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varpar , only : nlevsno - use clm_varctl , only : iulog - use clm_varcon , only : namec, h2osno_max - use atm2lndType , only : atm2lnd_type - use AerosolMod , only : aerosol_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use LandunitType , only : lun - use TopoMod, only : topo_type - use ColumnType , only : col - use landunit_varcon , only : istsoil, istdlak, istsoil, istwet, istice_mec, istcrop - use clm_time_manager, only : get_step_size, get_nstep - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SnowHydrology_readnl ! Read namelist - public :: SnowWater ! Change of snow mass and the snow water onto soil - public :: SnowCompaction ! Change in snow layer thickness due to compaction - public :: CombineSnowLayers ! Combine snow layers less than a min thickness - public :: DivideSnowLayers ! Subdivide snow layers if they exceed maximum thickness - public :: InitSnowLayers ! Initialize cold-start snow layer thickness - public :: BuildSnowFilter ! Construct snow/no-snow filters - public :: SnowCapping ! Remove snow mass for capped columns - public :: NewSnowBulkDensity ! Compute bulk density of any newly-fallen snow - - ! The following are public just for the sake of unit testing: - public :: SnowCappingExcess ! Determine the excess snow that needs to be capped - public :: SnowHydrologySetControlForTesting ! Set some of the control settings - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: Combo ! Returns the combined variables: dz, t, wliq, wice. - private :: MassWeightedSnowRadius ! Mass weighted snow grain size - ! - ! !PUBLIC DATA MEMBERS: - ! Aerosol species indices: - ! 1= hydrophillic black carbon - ! 2= hydrophobic black carbon - ! 3= hydrophilic organic carbon - ! 4= hydrophobic organic carbon - ! 5= dust species 1 - ! 6= dust species 2 - ! 7= dust species 3 - ! 8= dust species 4 - ! - real(r8), public, parameter :: scvng_fct_mlt_bcphi = 0.20_r8 ! scavenging factor for hydrophillic BC inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_bcpho = 0.03_r8 ! scavenging factor for hydrophobic BC inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_ocphi = 0.20_r8 ! scavenging factor for hydrophillic OC inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_ocpho = 0.03_r8 ! scavenging factor for hydrophobic OC inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst1 = 0.02_r8 ! scavenging factor for dust species 1 inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst2 = 0.02_r8 ! scavenging factor for dust species 2 inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst3 = 0.01_r8 ! scavenging factor for dust species 3 inclusion in meltwater [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst4 = 0.01_r8 ! scavenging factor for dust species 4 inclusion in meltwater [frc] - - ! The following are public for the sake of unit testing - integer, parameter, public :: LoTmpDnsSlater2017 = 2 ! For temperature below -15C use equation from Slater 2017 - integer, parameter, public :: LoTmpDnsTruncatedAnderson1976 = 1 ! Truncate low temp. snow density from the Anderson-1976 version at -15C - - ! Definition of snow pack vertical structure - ! Hardcoded maximum of 12 snowlayers, this is checked elsewhere (controlMod.F90) - ! The bottom layer has no limit on thickness, hence the last element of the dzmax_* - ! arrays is 'huge'. - real(r8), parameter :: dzmin(12) = & ! minimum of top snow layer - (/ 0.010_r8, 0.015_r8, 0.025_r8, 0.055_r8, 0.115_r8, 0.235_r8, & - 0.475_r8, 0.955_r8, 1.915_r8, 3.835_r8, 7.675_r8, 15.355_r8 /) - real(r8), parameter :: dzmax_l(12) = & ! maximum thickness of layer when no layers beneath - (/ 0.03_r8, 0.07_r8, 0.18_r8, 0.41_r8, 0.88_r8, 1.83_r8, & - 3.74_r8, 7.57_r8, 15.24_r8, 30.59_r8, 61.3_r8, huge(1._r8) /) - real(r8), parameter :: dzmax_u(12) = & ! maximum thickness of layer when layers beneath - (/ 0.02_r8, 0.05_r8, 0.11_r8, 0.23_r8, 0.47_r8, 0.95_r8, & - 1.91_r8, 3.83_r8, 7.67_r8, 15.35_r8, 30.71_r8, huge(1._r8) /) - - ! - ! !PRIVATE DATA MEMBERS: - - integer, parameter :: OverburdenCompactionMethodAnderson1976 = 1 - integer, parameter :: OverburdenCompactionMethodVionnet2012 = 2 - - ! If true, the density of new snow depends on wind speed, and there is also - ! wind-dependent snow compaction - logical :: wind_dependent_snow_density ! If snow density depends on wind or not - integer :: overburden_compaction_method = -1 - integer :: new_snow_density = LoTmpDnsSlater2017 ! Snow density type - real(r8) :: upplim_destruct_metamorph = 100.0_r8 ! Upper Limit on Destructive Metamorphism Compaction [kg/m3] - real(r8) :: overburden_compress_Tfactor = 0.08_r8 ! snow compaction overburden exponential factor (1/K) - real(r8) :: min_wind_snowcompact = 5._r8 ! minimum wind speed tht results in compaction (m/s) - - ! ------------------------------------------------------------------------ - ! Parameters controlling the resetting of the snow pack - ! ------------------------------------------------------------------------ - - logical :: reset_snow = .false. ! If set to true, we reset the non-glc snow pack, based on the following parameters - logical :: reset_snow_glc = .false. ! If set to true, we reset the glc snow pack, based reset_snow_glc_ela - - ! Default for reset_snow_glc_ela implies that snow will be reset for all glacier columns if reset_snow_glc = .true. - real(r8) :: reset_snow_glc_ela = 1.e9_r8 ! equilibrium line altitude (m); snow is reset for glacier columns below this elevation if reset_snow_glc = .true. (ignored if reset_snow_glc = .false.) - - ! The following are public simply to support unit testing - - ! 35 mm was chosen by Raymond Sellevold, based on finding the location in Greenland - ! with the least amount of snowfall from Sept. 1 (roughly the end of the melt season) - ! and Jan. 1 (when we typically start simulations). This location with the least amount - ! of snowfall had an average of 35 mm snow fall over this 4-month period. - real(r8), parameter, public :: reset_snow_h2osno = 35._r8 ! mm SWE to reset the snow pack to - - ! We scale the number of reset time steps with the number of snow layers, since we can - ! remove up to one layer per time step. In the absence of snow accumulation, we might - ! be able to get away with 1 reset time step per layer. However, we specify a larger - ! number to be more robust. - real(r8), parameter, public :: reset_snow_timesteps_per_layer = 4 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SnowHydrology_readnl( NLFilename) - ! - ! !DESCRIPTION: - ! Read the namelist for SnowHydrology - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=64) :: snow_overburden_compaction_method - character(len=25) :: lotmp_snowdensity_method - - character(len=*), parameter :: subname = 'SnowHydrology_readnl' - !----------------------------------------------------------------------- - - namelist /clm_snowhydrology_inparm/ & - wind_dependent_snow_density, snow_overburden_compaction_method, & - lotmp_snowdensity_method, upplim_destruct_metamorph, & - overburden_compress_Tfactor, min_wind_snowcompact, & - reset_snow, reset_snow_glc, reset_snow_glc_ela - - ! Initialize options to default values, in case they are not specified in the namelist - wind_dependent_snow_density = .false. - snow_overburden_compaction_method = ' ' - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in clm_SnowHydrology_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_SnowHydrology_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_snowhydrology_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_snowhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_snowhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (wind_dependent_snow_density, mpicom) - call shr_mpi_bcast (snow_overburden_compaction_method, mpicom) - call shr_mpi_bcast (lotmp_snowdensity_method , mpicom) - call shr_mpi_bcast (upplim_destruct_metamorph , mpicom) - call shr_mpi_bcast (overburden_compress_Tfactor, mpicom) - call shr_mpi_bcast (min_wind_snowcompact , mpicom) - call shr_mpi_bcast (reset_snow , mpicom) - call shr_mpi_bcast (reset_snow_glc , mpicom) - call shr_mpi_bcast (reset_snow_glc_ela , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'SnowHydrology settings:' - write(iulog,nml=clm_snowhydrology_inparm) - write(iulog,*) ' ' - end if - - if ( trim(lotmp_snowdensity_method) == 'Slater2017' ) then - new_snow_density = LoTmpDnsSlater2017 - else if ( trim(lotmp_snowdensity_method) == 'TruncatedAnderson1976' ) then - new_snow_density = LoTmpDnsTruncatedAnderson1976 - else - call endrun(msg="ERROR bad lotmp_snowdensity_method name"//errmsg(sourcefile, __LINE__)) - end if - - if (trim(snow_overburden_compaction_method) == 'Anderson1976') then - overburden_compaction_method = OverburdenCompactionMethodAnderson1976 - else if (trim(snow_overburden_compaction_method) == 'Vionnet2012') then - overburden_compaction_method = OverburdenCompactionMethodVionnet2012 - else - call endrun(msg="ERROR bad snow_overburden_compaction_method name"// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine SnowHydrology_readnl - - - !----------------------------------------------------------------------- - subroutine SnowWater(bounds, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc, & - atm2lnd_inst, waterflux_inst, waterstate_inst, aerosol_inst) - ! - ! !DESCRIPTION: - ! Evaluate the change of snow mass and the snow water onto soil. - ! Water flow within snow is computed by an explicit and non-physical - ! based scheme, which permits a part of liquid water over the holding - ! capacity (a tentative value is used, i.e. equal to 0.033*porosity) to - ! percolate into the underlying layer. Except for cases where the - ! porosity of one of the two neighboring layers is less than 0.05, zero - ! flow is assumed. The water flow out of the bottom of the snow pack will - ! participate as the input of the soil water and runoff. This subroutine - ! uses a filter for columns containing snow which must be constructed prior - ! to being called. - ! - ! !USES: - use clm_varcon , only : denh2o, denice, wimp, ssi - use AerosolMod , only : AerosolFluxes - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - integer , intent(in) :: num_nosnowc ! number of non-snow points in column filter - integer , intent(in) :: filter_nosnowc(:) ! column filter for non-snow points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(aerosol_type) , intent(inout) :: aerosol_inst - ! - ! !LOCAL VARIABLES: - integer :: g ! gridcell loop index - integer :: c, j, fc, l ! do loop/array indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: qin(bounds%begc:bounds%endc) ! water flow into the element (mm/s) - real(r8) :: qout(bounds%begc:bounds%endc) ! water flow out of the elmement (mm/s) - real(r8) :: qin_bc_phi (bounds%begc:bounds%endc) ! flux of hydrophilic BC into layer [kg] - real(r8) :: qout_bc_phi (bounds%begc:bounds%endc) ! flux of hydrophilic BC out of layer [kg] - real(r8) :: qin_bc_pho (bounds%begc:bounds%endc) ! flux of hydrophobic BC into layer [kg] - real(r8) :: qout_bc_pho (bounds%begc:bounds%endc) ! flux of hydrophobic BC out of layer [kg] - real(r8) :: qin_oc_phi (bounds%begc:bounds%endc) ! flux of hydrophilic OC into layer [kg] - real(r8) :: qout_oc_phi (bounds%begc:bounds%endc) ! flux of hydrophilic OC out of layer [kg] - real(r8) :: qin_oc_pho (bounds%begc:bounds%endc) ! flux of hydrophobic OC into layer [kg] - real(r8) :: qout_oc_pho (bounds%begc:bounds%endc) ! flux of hydrophobic OC out of layer [kg] - real(r8) :: qin_dst1 (bounds%begc:bounds%endc) ! flux of dust species 1 into layer [kg] - real(r8) :: qout_dst1 (bounds%begc:bounds%endc) ! flux of dust species 1 out of layer [kg] - real(r8) :: qin_dst2 (bounds%begc:bounds%endc) ! flux of dust species 2 into layer [kg] - real(r8) :: qout_dst2 (bounds%begc:bounds%endc) ! flux of dust species 2 out of layer [kg] - real(r8) :: qin_dst3 (bounds%begc:bounds%endc) ! flux of dust species 3 into layer [kg] - real(r8) :: qout_dst3 (bounds%begc:bounds%endc) ! flux of dust species 3 out of layer [kg] - real(r8) :: qin_dst4 (bounds%begc:bounds%endc) ! flux of dust species 4 into layer [kg] - real(r8) :: qout_dst4 (bounds%begc:bounds%endc) ! flux of dust species 4 out of layer [kg] - real(r8) :: wgdif ! ice mass after minus sublimation - real(r8) :: vol_liq(bounds%begc:bounds%endc,-nlevsno+1:0) ! partial volume of liquid water in layer - real(r8) :: vol_ice(bounds%begc:bounds%endc,-nlevsno+1:0) ! partial volume of ice lens in layer - real(r8) :: eff_porosity(bounds%begc:bounds%endc,-nlevsno+1:0) ! effective porosity = porosity - vol_ice - real(r8) :: mss_liqice(bounds%begc:bounds%endc,-nlevsno+1:0) ! mass of liquid+ice in a layer - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - int_snow => waterstate_inst%int_snow_col , & ! Output: [real(r8) (:) ] integrated snowfall [mm] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - - qflx_snomelt => waterflux_inst%qflx_snomelt_col , & ! Input: [real(r8) (:) ] snow melt (mm H2O /s) - qflx_rain_grnd => waterflux_inst%qflx_rain_grnd_col , & ! Input: [real(r8) (:) ] rain on ground after interception (mm H2O/s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col , & ! Input: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Input: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col,& ! Output: [real(r8) (:) ] net snow melt - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic BC mass in snow (col,lyr) [kg] - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic BC mass in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! Output: [real(r8) (:,:) ] hydrophillic OC mass in snow (col,lyr) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic OC mass in snow (col,lyr) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! Output: [real(r8) (:,:) ] mass of dust species 1 in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! Output: [real(r8) (:,:) ] mass of dust species 2 in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! Output: [real(r8) (:,:) ] mass of dust species 3 in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! Output: [real(r8) (:,:) ] mass of dust species 4 in snow (col,lyr) [kg] - - begc => bounds%begc , & - endc => bounds%endc & - ) - - ! Determine model time step - - dtime = get_step_size() - - ! Renew the mass of ice lens (h2osoi_ice) and liquid (h2osoi_liq) in the - ! surface snow layer resulting from sublimation (frost) / evaporation (condense) - - do fc = 1,num_snowc - c = filter_snowc(fc) - l=col%landunit(c) - - wgdif = h2osoi_ice(c,snl(c)+1) & - + frac_sno_eff(c) * (qflx_dew_snow(c) - qflx_sub_snow(c)) * dtime - h2osoi_ice(c,snl(c)+1) = wgdif - if (wgdif < 0._r8) then - h2osoi_ice(c,snl(c)+1) = 0._r8 - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + wgdif - end if - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + & - frac_sno_eff(c) * (qflx_rain_grnd(c) + qflx_dew_grnd(c) & - - qflx_evap_grnd(c)) * dtime - - ! if negative, reduce deeper layer's liquid water content sequentially - if(h2osoi_liq(c,snl(c)+1) < 0._r8) then - do j = snl(c)+1, 1 - wgdif=h2osoi_liq(c,j) - if (wgdif >= 0._r8) exit - h2osoi_liq(c,j) = 0._r8 - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) + wgdif - enddo - end if - end do - - ! Porosity and partial volume - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - ! need to scale dz by frac_sno to convert to grid cell average depth - vol_ice(c,j) = min(1._r8, h2osoi_ice(c,j)/(dz(c,j)*frac_sno_eff(c)*denice)) - eff_porosity(c,j) = 1._r8 - vol_ice(c,j) - vol_liq(c,j) = min(eff_porosity(c,j),h2osoi_liq(c,j)/(dz(c,j)*frac_sno_eff(c)*denh2o)) - end if - end do - end do - - ! Capillary forces within snow are usually two or more orders of magnitude - ! less than those of gravity. Only gravity terms are considered. - ! the genernal expression for water flow is "K * ss**3", however, - ! no effective parameterization for "K". Thus, a very simple consideration - ! (not physically based) is introduced: - ! when the liquid water of layer exceeds the layer's holding - ! capacity, the excess meltwater adds to the underlying neighbor layer. - - ! Also compute aerosol fluxes through snowpack in this loop: - ! 1) compute aerosol mass in each layer - ! 2) add aerosol mass flux from above layer to mass of this layer - ! 3) qout_xxx is mass flux of aerosol species xxx out bottom of - ! layer in water flow, proportional to (current) concentration - ! of aerosol in layer multiplied by a scavenging ratio. - ! 4) update mass of aerosol in top layer, accordingly - ! 5) update mass concentration of aerosol accordingly - - do c = bounds%begc,bounds%endc - qin(c) = 0._r8 - qin_bc_phi (c) = 0._r8 - qin_bc_pho (c) = 0._r8 - qin_oc_phi (c) = 0._r8 - qin_oc_pho (c) = 0._r8 - qin_dst1 (c) = 0._r8 - qin_dst2 (c) = 0._r8 - qin_dst3 (c) = 0._r8 - qin_dst4 (c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - - h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c) - - mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c) - mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c) - mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c) - mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c) - - mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c) - mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c) - mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c) - mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c) - - if (j <= -1) then - ! No runoff over snow surface, just ponding on surface - if (eff_porosity(c,j) < wimp .OR. eff_porosity(c,j+1) < wimp) then - qout(c) = 0._r8 - else - ! dz must be scaled by frac_sno to obtain gridcell average value - qout(c) = max(0._r8,(vol_liq(c,j) & - - ssi*eff_porosity(c,j))*dz(c,j)*frac_sno_eff(c)) - qout(c) = min(qout(c),(1._r8-vol_ice(c,j+1) & - - vol_liq(c,j+1))*dz(c,j+1)*frac_sno_eff(c)) - end if - else - qout(c) = max(0._r8,(vol_liq(c,j) & - - ssi*eff_porosity(c,j))*dz(c,j)*frac_sno_eff(c)) - end if - qout(c) = qout(c)*1000._r8 - h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c) - qin(c) = qout(c) - - ! mass of ice+water: in extremely rare circumstances, this can - ! be zero, even though there is a snow layer defined. In - ! this case, set the mass to a very small value to - ! prevent division by zero. - - mss_liqice(c,j) = h2osoi_liq(c,j)+h2osoi_ice(c,j) - if (mss_liqice(c,j) < 1E-30_r8) then - mss_liqice(c,j) = 1E-30_r8 - endif - - ! BCPHI: - ! 1. flux with meltwater: - qout_bc_phi(c) = qout(c)*scvng_fct_mlt_bcphi*(mss_bcphi(c,j)/mss_liqice(c,j)) - if (qout_bc_phi(c) > mss_bcphi(c,j)) then - qout_bc_phi(c) = mss_bcphi(c,j) - endif - mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c) - qin_bc_phi(c) = qout_bc_phi(c) - - ! BCPHO: - ! 1. flux with meltwater: - qout_bc_pho(c) = qout(c)*scvng_fct_mlt_bcpho*(mss_bcpho(c,j)/mss_liqice(c,j)) - if (qout_bc_pho(c) > mss_bcpho(c,j)) then - qout_bc_pho(c) = mss_bcpho(c,j) - endif - mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c) - qin_bc_pho(c) = qout_bc_pho(c) - - ! OCPHI: - ! 1. flux with meltwater: - qout_oc_phi(c) = qout(c)*scvng_fct_mlt_ocphi*(mss_ocphi(c,j)/mss_liqice(c,j)) - if (qout_oc_phi(c) > mss_ocphi(c,j)) then - qout_oc_phi(c) = mss_ocphi(c,j) - endif - mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c) - qin_oc_phi(c) = qout_oc_phi(c) - - ! OCPHO: - ! 1. flux with meltwater: - qout_oc_pho(c) = qout(c)*scvng_fct_mlt_ocpho*(mss_ocpho(c,j)/mss_liqice(c,j)) - if (qout_oc_pho(c) > mss_ocpho(c,j)) then - qout_oc_pho(c) = mss_ocpho(c,j) - endif - mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c) - qin_oc_pho(c) = qout_oc_pho(c) - - ! DUST 1: - ! 1. flux with meltwater: - qout_dst1(c) = qout(c)*scvng_fct_mlt_dst1*(mss_dst1(c,j)/mss_liqice(c,j)) - if (qout_dst1(c) > mss_dst1(c,j)) then - qout_dst1(c) = mss_dst1(c,j) - endif - mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c) - qin_dst1(c) = qout_dst1(c) - - ! DUST 2: - ! 1. flux with meltwater: - qout_dst2(c) = qout(c)*scvng_fct_mlt_dst2*(mss_dst2(c,j)/mss_liqice(c,j)) - if (qout_dst2(c) > mss_dst2(c,j)) then - qout_dst2(c) = mss_dst2(c,j) - endif - mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c) - qin_dst2(c) = qout_dst2(c) - - ! DUST 3: - ! 1. flux with meltwater: - qout_dst3(c) = qout(c)*scvng_fct_mlt_dst3*(mss_dst3(c,j)/mss_liqice(c,j)) - if (qout_dst3(c) > mss_dst3(c,j)) then - qout_dst3(c) = mss_dst3(c,j) - endif - mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c) - qin_dst3(c) = qout_dst3(c) - - ! DUST 4: - ! 1. flux with meltwater: - qout_dst4(c) = qout(c)*scvng_fct_mlt_dst4*(mss_dst4(c,j)/mss_liqice(c,j)) - if (qout_dst4(c) > mss_dst4(c,j)) then - qout_dst4(c) = mss_dst4(c,j) - endif - mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c) - qin_dst4(c) = qout_dst4(c) - - end if - end do - end do - - ! Compute aerosol fluxes through snowpack and aerosol deposition fluxes into top layere - - call AerosolFluxes(bounds, num_snowc, filter_snowc, & - atm2lnd_inst, aerosol_inst) - - ! Adjust layer thickness for any water+ice content changes in excess of previous - ! layer thickness. Strictly speaking, only necessary for top snow layer, but doing - ! it for all snow layers will catch problems with older initial files. - ! Layer interfaces (zi) and node depths (z) do not need adjustment here because they - ! are adjusted in CombineSnowLayers and are not used up to that point. - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - dz(c,j) = max(dz(c,j),h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice) - end if - end do - end do - - do fc = 1, num_snowc - c = filter_snowc(fc) - ! Qout from snow bottom - qflx_snow_drain(c) = qflx_snow_drain(c) + (qout(c) / dtime) - - qflx_top_soil(c) = (qout(c) / dtime) & - + (1.0_r8 - frac_sno_eff(c)) * qflx_rain_grnd(c) - int_snow(c) = int_snow(c) + frac_sno_eff(c) & - * (qflx_dew_snow(c) + qflx_dew_grnd(c) + qflx_rain_grnd(c)) * dtime - end do - - do fc = 1, num_nosnowc - c = filter_nosnowc(fc) - qflx_snow_drain(c) = qflx_snomelt(c) - - qflx_top_soil(c) = qflx_rain_grnd(c) + qflx_snomelt(c) - ! reset accumulated snow when no snow present - if (h2osno(c) <= 0._r8) then - int_snow(c) = 0._r8 - frac_sno(c) = 0._r8 - snow_depth(c) = 0._r8 - end if - end do - - end associate - end subroutine SnowWater - - !----------------------------------------------------------------------- - subroutine SnowCompaction(bounds, num_snowc, filter_snowc, & - temperature_inst, waterstate_inst, atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Determine the change in snow layer thickness due to compaction and - ! settling. - ! Three metamorphisms of changing snow characteristics are implemented, - ! i.e., destructive, overburden, and melt. The treatments of the former - ! two are from SNTHERM.89 and SNTHERM.99 (1991, 1999). The contribution - ! due to melt metamorphism is simply taken as a ratio of snow ice - ! fraction after the melting versus before the melting. - ! - ! !USES: - use clm_varcon , only : denice, denh2o, tfrz, rpi, int_snow_max - use clm_varctl , only : subgridflag - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of column snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - ! - ! !LOCAL VARIABLES: - integer :: j, l, c, fc ! indices - integer :: g ! gridcell index - real(r8):: dtime ! land model time step (sec) - ! parameters - real(r8), parameter :: c3 = 2.777e-6_r8 ! [1/s] - real(r8), parameter :: c4 = 0.04_r8 ! [1/K] - real(r8), parameter :: c5 = 2.0_r8 ! - ! - real(r8) :: burden(bounds%begc:bounds%endc) ! pressure of overlying snow [kg/m2] - real(r8) :: zpseudo(bounds%begc:bounds%endc) ! wind drift compaction / pseudo depth (only valid if wind_dependent_snow_density is .true.) - logical :: mobile(bounds%begc:bounds%endc) ! current snow layer is mobile, i.e. susceptible to wind drift (only valid if wind_dependent_snow_density is .true.) - real(r8) :: ddz1 ! Rate of settling of snowpack due to destructive metamorphism. - real(r8) :: ddz2 ! Rate of compaction of snowpack due to overburden. - real(r8) :: ddz3 ! Rate of compaction of snowpack due to melt [1/s] - real(r8) :: dexpf ! expf=exp(-c4*(273.15-t_soisno)). - real(r8) :: fi ! Fraction of ice relative to the total water content at current time step - real(r8) :: td ! t_soisno - tfrz [K] - real(r8) :: pdzdtc ! Nodal rate of change in fractional-thickness due to compaction [fraction/s] - real(r8) :: void ! void (1 - vol_ice - vol_liq) - real(r8) :: wx ! water mass (ice+liquid) [kg/m2] - real(r8) :: bi ! partial density of ice [kg/m3] - real(r8) :: wsum ! snowpack total water mass (ice+liquid) [kg/m2] - real(r8) :: fsno_melt - real(r8) :: ddz4 ! Rate of compaction of snowpack due to wind drift. - real(r8) :: int_snow_limited ! integrated snowfall, limited to be no greater than int_snow_max [mm] - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - n_melt => col%n_melt , & ! Input: [real(r8) (:) ] SCA shape parameter - lakpoi => lun%lakpoi , & ! Input: [logical (:) ] true => landunit is a lake point - urbpoi => lun%urbpoi , & ! Input: [logical (:) ] true => landunit is an urban point - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - imelt => temperature_inst%imelt_col , & ! Input: [integer (:,:) ] flag for melting (=1), freezing (=2), Not=0 - - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] snow covered fraction - swe_old => waterstate_inst%swe_old_col , & ! Input: [real(r8) (:,:) ] initial swe values - int_snow => waterstate_inst%int_snow_col , & ! Input: [real(r8) (:) ] integrated snowfall [mm] - frac_iceold => waterstate_inst%frac_iceold_col , & ! Input: [real(r8) (:,:) ] fraction of ice relative to the tot water - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - - dz => col%dz & ! Output: [real(r8) (: ,:) ] layer depth (m) - ) - - ! Get time step - - dtime = get_step_size() - - ! Begin calculation - note that the following column loops are only invoked if snl(c) < 0 - - do fc = 1, num_snowc - c = filter_snowc(fc) - - burden(c) = 0._r8 - zpseudo(c) = 0._r8 - mobile(c) = .true. - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - g = col%gridcell(c) - if (j >= snl(c)+1) then - - wx = (h2osoi_ice(c,j) + h2osoi_liq(c,j)) - void = 1._r8 - (h2osoi_ice(c,j)/denice + h2osoi_liq(c,j)/denh2o)& - /(frac_sno(c) * dz(c,j)) - - ! Allow compaction only for non-saturated node and higher ice lens node. - if (void > 0.001_r8 .and. h2osoi_ice(c,j) > .1_r8) then - - bi = h2osoi_ice(c,j) / (frac_sno(c) * dz(c,j)) - fi = h2osoi_ice(c,j) / wx - td = tfrz-t_soisno(c,j) - dexpf = exp(-c4*td) - - ! Settling as a result of destructive metamorphism - - ddz1 = -c3*dexpf - if (bi > upplim_destruct_metamorph) ddz1 = ddz1*exp(-46.0e-3_r8*(bi-upplim_destruct_metamorph)) - - ! Liquid water term - - if (h2osoi_liq(c,j) > 0.01_r8*dz(c,j)*frac_sno(c)) ddz1=ddz1*c5 - - select case (overburden_compaction_method) - case (OverburdenCompactionMethodAnderson1976) - ddz2 = OverburdenCompactionAnderson1976( & - burden = burden(c), & - wx = wx, & - td = td, & - bi = bi) - - case (OverburdenCompactionMethodVionnet2012) - ddz2 = OverburdenCompactionVionnet2012( & - h2osoi_liq = h2osoi_liq(c,j), & - dz = dz(c,j), & - burden = burden(c), & - wx = wx, & - td = td, & - bi = bi) - - case default - call endrun(msg="Unknown overburden_compaction_method") - end select - - ! Compaction occurring during melt - - if (imelt(c,j) == 1) then - l = col%landunit(c) - ! For consistency with other uses of subgridflag==1 (e.g., in - ! CanopyHydrologyMod), we apply this code over all landunits other - ! than lake and urban. (In CanopyHydrologyMod, the uses of subgridflag - ! are in a nolake filter, and check .not. urbpoi.) - if(subgridflag==1 .and. (.not. lakpoi(l) .and. .not. urbpoi(l))) then - ! first term is delta mass over mass - ddz3 = max(0._r8,min(1._r8,(swe_old(c,j) - wx)/wx)) - - ! 2nd term is delta fsno over fsno, allowing for negative values for ddz3 - if((swe_old(c,j) - wx) > 0._r8) then - wsum = sum(h2osoi_liq(c,snl(c)+1:0)+h2osoi_ice(c,snl(c)+1:0)) - int_snow_limited = min(int_snow(c), int_snow_max) - fsno_melt = 1. - (acos(2.*min(1._r8,wsum/int_snow_limited) - 1._r8)/rpi)**(n_melt(c)) - - ddz3 = ddz3 - max(0._r8,(fsno_melt - frac_sno(c))/frac_sno(c)) - endif - ddz3 = -1._r8/dtime * ddz3 - else - ddz3 = - 1._r8/dtime * max(0._r8,(frac_iceold(c,j) - fi)/frac_iceold(c,j)) - endif - else - ddz3 = 0._r8 - end if - - ! Compaction occurring due to wind drift - if (wind_dependent_snow_density) then - call WindDriftCompaction( & - bi = bi, & - forc_wind = forc_wind(g), & - dz = dz(c,j), & - zpseudo = zpseudo(c), & - mobile = mobile(c), & - compaction_rate = ddz4) - else - ddz4 = 0.0_r8 - end if - - ! Time rate of fractional change in dz (units of s-1) - pdzdtc = ddz1 + ddz2 + ddz3 + ddz4 - - ! The change in dz due to compaction - ! Limit compaction to be no greater than fully saturated layer thickness - dz(c,j) = max(dz(c,j) * (1._r8+pdzdtc*dtime),(h2osoi_ice(c,j)/denice+ h2osoi_liq(c,j)/denh2o)/frac_sno(c)) - - else - ! saturated node is immobile - ! - ! This is only needed if wind_dependent_snow_density is true, but it's - ! simplest just to update mobile always - mobile(c) = .false. - end if - - ! Pressure of overlying snow - - burden(c) = burden(c) + wx - - end if - end do - end do - - end associate - end subroutine SnowCompaction - - !----------------------------------------------------------------------- - subroutine CombineSnowLayers(bounds, num_snowc, filter_snowc, & - aerosol_inst, temperature_inst, waterflux_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Combine snow layers that are less than a minimum thickness or mass - ! If the snow element thickness or mass is less than a prescribed minimum, - ! then it is combined with a neighboring element. The subroutine - ! clm\_combo.f90 then executes the combination of mass and energy. - ! - ! !USES: - use LakeCon , only : lsadz - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(inout) :: num_snowc ! number of column snow points in column filter - integer , intent(inout) :: filter_snowc(:) ! column filter for snow points - type(aerosol_type) , intent(inout) :: aerosol_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c, fc ! column indices - integer :: i,k ! loop indices - integer :: j,l ! node indices - integer :: msn_old(bounds%begc:bounds%endc) ! number of top snow layer - integer :: mssi(bounds%begc:bounds%endc) ! node index - integer :: neibor ! adjacent node selected for combination - real(r8):: zwice(bounds%begc:bounds%endc) ! total ice mass in snow - real(r8):: zwliq (bounds%begc:bounds%endc) ! total liquid water in snow - real(r8):: dzminloc(size(dzmin)) ! minimum of top snow layer (local) - real(r8):: dtime !land model time step (sec) - - !----------------------------------------------------------------------- - - associate( & - ltype => lun%itype , & ! Input: [integer (:) ] landunit type - urbpoi => lun%urbpoi , & ! Input: [logical (:) ] true => landunit is an urban point - - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophilic BC mass in snow (col,lyr) [kg] - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic BC mass in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! Output: [real(r8) (:,:) ] hydrophilic OC mass in snow (col,lyr) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic OC mass in snow (col,lyr) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! Output: [real(r8) (:,:) ] dust species 1 mass in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! Output: [real(r8) (:,:) ] dust species 2 mass in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! Output: [real(r8) (:,:) ] dust species 3 mass in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! Output: [real(r8) (:,:) ] dust species 4 mass in snow (col,lyr) [kg] - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - int_snow => waterstate_inst%int_snow_col , & ! Output: [real(r8) (:) ] integrated snowfall [mm] - h2osno => waterstate_inst%h2osno_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective snow grain radius (col,lyr) [microns, m^-6] - - qflx_sl_top_soil => waterflux_inst%qflx_sl_top_soil_col , & ! Output: [real(r8) (:) ] liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) - - snl => col%snl , & ! Output: [integer (:) ] number of snow layers - dz => col%dz , & ! Output: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z & ! Output: [real(r8) (:,:) ] layer thickness (m) - ) - - ! Determine model time step - - dtime = get_step_size() - - ! Check the mass of ice lens of snow, when the total is less than a small value, - ! combine it with the underlying neighbor. - - dzminloc(:) = dzmin(:) ! dzmin will stay constant between timesteps - - ! Add lsadz to dzmin for lakes - ! Determine whether called from LakeHydrology - ! Note: this assumes that this function is called separately with the lake-snow and non-lake-snow filters. - if (num_snowc > 0) then - c = filter_snowc(1) - l = col%landunit(c) - if (ltype(l) == istdlak) then ! Called from LakeHydrology - dzminloc(:) = dzmin(:) + lsadz - end if - end if - - do fc = 1, num_snowc - c = filter_snowc(fc) - - msn_old(c) = snl(c) - qflx_sl_top_soil(c) = 0._r8 - end do - - ! The following loop is NOT VECTORIZED - - do fc = 1, num_snowc - c = filter_snowc(fc) - l = col%landunit(c) - do j = msn_old(c)+1,0 - ! use 0.01 to avoid runaway ice buildup - if (h2osoi_ice(c,j) <= .01_r8) then - if (ltype(l) == istsoil .or. urbpoi(l) .or. ltype(l) == istcrop) then - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) + h2osoi_liq(c,j) - h2osoi_ice(c,j+1) = h2osoi_ice(c,j+1) + h2osoi_ice(c,j) - - if (j == 0) then - qflx_sl_top_soil(c) = (h2osoi_liq(c,j) + h2osoi_ice(c,j))/dtime - end if - - if (j /= 0) dz(c,j+1) = dz(c,j+1) + dz(c,j) - - ! NOTE: Temperature, and similarly snw_rds, of the - ! underlying snow layer are NOT adjusted in this case. - ! Because the layer being eliminated has a small mass, - ! this should not make a large difference, but it - ! would be more thorough to do so. - if (j /= 0) then - mss_bcphi(c,j+1) = mss_bcphi(c,j+1) + mss_bcphi(c,j) - mss_bcpho(c,j+1) = mss_bcpho(c,j+1) + mss_bcpho(c,j) - mss_ocphi(c,j+1) = mss_ocphi(c,j+1) + mss_ocphi(c,j) - mss_ocpho(c,j+1) = mss_ocpho(c,j+1) + mss_ocpho(c,j) - mss_dst1(c,j+1) = mss_dst1(c,j+1) + mss_dst1(c,j) - mss_dst2(c,j+1) = mss_dst2(c,j+1) + mss_dst2(c,j) - mss_dst3(c,j+1) = mss_dst3(c,j+1) + mss_dst3(c,j) - mss_dst4(c,j+1) = mss_dst4(c,j+1) + mss_dst4(c,j) - end if - - else if (ltype(l) /= istsoil .and. .not. urbpoi(l) .and. ltype(l) /= istcrop .and. j /= 0) then - - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) + h2osoi_liq(c,j) - h2osoi_ice(c,j+1) = h2osoi_ice(c,j+1) + h2osoi_ice(c,j) - dz(c,j+1) = dz(c,j+1) + dz(c,j) - - mss_bcphi(c,j+1) = mss_bcphi(c,j+1) + mss_bcphi(c,j) - mss_bcpho(c,j+1) = mss_bcpho(c,j+1) + mss_bcpho(c,j) - mss_ocphi(c,j+1) = mss_ocphi(c,j+1) + mss_ocphi(c,j) - mss_ocpho(c,j+1) = mss_ocpho(c,j+1) + mss_ocpho(c,j) - mss_dst1(c,j+1) = mss_dst1(c,j+1) + mss_dst1(c,j) - mss_dst2(c,j+1) = mss_dst2(c,j+1) + mss_dst2(c,j) - mss_dst3(c,j+1) = mss_dst3(c,j+1) + mss_dst3(c,j) - mss_dst4(c,j+1) = mss_dst4(c,j+1) + mss_dst4(c,j) - - end if - - ! shift all elements above this down one. - if (j > snl(c)+1 .and. snl(c) < -1) then - do i = j, snl(c)+2, -1 - ! If the layer closest to the surface is less than 0.1 mm and the ltype is not - ! urban, soil or crop, the h2osoi_liq and h2osoi_ice associated with this layer is sent - ! to qflx_qrgwl later on in the code. To keep track of this for the snow balance - ! error check, we add this to qflx_sl_top_soil here - if (ltype(l) /= istsoil .and. ltype(l) /= istcrop .and. .not. urbpoi(l) .and. i == 0) then - qflx_sl_top_soil(c) = (h2osoi_liq(c,i) + h2osoi_ice(c,i))/dtime - end if - - t_soisno(c,i) = t_soisno(c,i-1) - h2osoi_liq(c,i) = h2osoi_liq(c,i-1) - h2osoi_ice(c,i) = h2osoi_ice(c,i-1) - - mss_bcphi(c,i) = mss_bcphi(c,i-1) - mss_bcpho(c,i) = mss_bcpho(c,i-1) - mss_ocphi(c,i) = mss_ocphi(c,i-1) - mss_ocpho(c,i) = mss_ocpho(c,i-1) - mss_dst1(c,i) = mss_dst1(c,i-1) - mss_dst2(c,i) = mss_dst2(c,i-1) - mss_dst3(c,i) = mss_dst3(c,i-1) - mss_dst4(c,i) = mss_dst4(c,i-1) - snw_rds(c,i) = snw_rds(c,i-1) - - dz(c,i) = dz(c,i-1) - end do - end if - snl(c) = snl(c) + 1 - end if - end do - end do - - do fc = 1, num_snowc - c = filter_snowc(fc) - h2osno(c) = 0._r8 - snow_depth(c) = 0._r8 - zwice(c) = 0._r8 - zwliq(c) = 0._r8 - end do - - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - h2osno(c) = h2osno(c) + h2osoi_ice(c,j) + h2osoi_liq(c,j) - snow_depth(c) = snow_depth(c) + dz(c,j) - zwice(c) = zwice(c) + h2osoi_ice(c,j) - zwliq(c) = zwliq(c) + h2osoi_liq(c,j) - end if - end do - end do - - ! Check the snow depth - all snow gone - ! The liquid water assumes ponding on soil surface. - - do fc = 1, num_snowc - c = filter_snowc(fc) - l = col%landunit(c) - if (snow_depth(c) > 0._r8) then - if ((ltype(l) == istdlak .and. snow_depth(c) < 0.01_r8 + lsadz ) .or. & - ((ltype(l) /= istdlak) .and. ((frac_sno_eff(c)*snow_depth(c) < 0.01_r8) & - .or. (h2osno(c)/(frac_sno_eff(c)*snow_depth(c)) < 50._r8)))) then - - snl(c) = 0 - h2osno(c) = zwice(c) - - mss_bcphi(c,:) = 0._r8 - mss_bcpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_ocpho(c,:) = 0._r8 - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - - if (h2osno(c) <= 0._r8) snow_depth(c) = 0._r8 - ! this is where water is transfered from layer 0 (snow) to layer 1 (soil) - if (ltype(l) == istsoil .or. urbpoi(l) .or. ltype(l) == istcrop) then - h2osoi_liq(c,0) = 0.0_r8 - h2osoi_liq(c,1) = h2osoi_liq(c,1) + zwliq(c) - end if - if (ltype(l) == istwet) then - h2osoi_liq(c,0) = 0.0_r8 - endif - if (ltype(l)==istice_mec) then - h2osoi_liq(c,0) = 0.0_r8 - endif - endif - end if - if (h2osno(c) <= 0._r8) then - snow_depth(c) = 0._r8 - frac_sno(c) = 0._r8 - frac_sno_eff(c) = 0._r8 - int_snow(c) = 0._r8 - endif - end do - - ! Check the snow depth - snow layers combined - ! The following loop IS NOT VECTORIZED - - do fc = 1, num_snowc - c = filter_snowc(fc) - - ! Two or more layers - - if (snl(c) < -1) then - - msn_old(c) = snl(c) - mssi(c) = 1 - - do i = msn_old(c)+1,0 - if ((frac_sno_eff(c)*dz(c,i) < dzminloc(mssi(c))) .or. & - ((h2osoi_ice(c,i) + h2osoi_liq(c,i))/(frac_sno_eff(c)*dz(c,i)) < 50._r8)) then - if (i == snl(c)+1) then - ! If top node is removed, combine with bottom neighbor. - neibor = i + 1 - else if (i == 0) then - ! If the bottom neighbor is not snow, combine with the top neighbor. - neibor = i - 1 - else - ! If none of the above special cases apply, combine with the thinnest neighbor - neibor = i + 1 - if ((dz(c,i-1)+dz(c,i)) < (dz(c,i+1)+dz(c,i))) neibor = i-1 - end if - - ! Node l and j are combined and stored as node j. - if (neibor > i) then - j = neibor - l = i - else - j = i - l = neibor - end if - - ! this should be included in 'Combo' for consistency, - ! but functionally it is the same to do it here - mss_bcphi(c,j)=mss_bcphi(c,j)+mss_bcphi(c,l) - mss_bcpho(c,j)=mss_bcpho(c,j)+mss_bcpho(c,l) - mss_ocphi(c,j)=mss_ocphi(c,j)+mss_ocphi(c,l) - mss_ocpho(c,j)=mss_ocpho(c,j)+mss_ocpho(c,l) - mss_dst1(c,j)=mss_dst1(c,j)+mss_dst1(c,l) - mss_dst2(c,j)=mss_dst2(c,j)+mss_dst2(c,l) - mss_dst3(c,j)=mss_dst3(c,j)+mss_dst3(c,l) - mss_dst4(c,j)=mss_dst4(c,j)+mss_dst4(c,l) - - ! mass-weighted combination of effective grain size: - snw_rds(c,j) = (snw_rds(c,j)*(h2osoi_liq(c,j)+h2osoi_ice(c,j)) + & - snw_rds(c,l)*(h2osoi_liq(c,l)+h2osoi_ice(c,l))) / & - (h2osoi_liq(c,j)+h2osoi_ice(c,j)+h2osoi_liq(c,l)+h2osoi_ice(c,l)) - - call Combo (dz(c,j), h2osoi_liq(c,j), h2osoi_ice(c,j), & - t_soisno(c,j), dz(c,l), h2osoi_liq(c,l), h2osoi_ice(c,l), t_soisno(c,l) ) - - ! Now shift all elements above this down one. - if (j-1 > snl(c)+1) then - - do k = j-1, snl(c)+2, -1 - t_soisno(c,k) = t_soisno(c,k-1) - h2osoi_ice(c,k) = h2osoi_ice(c,k-1) - h2osoi_liq(c,k) = h2osoi_liq(c,k-1) - - mss_bcphi(c,k) = mss_bcphi(c,k-1) - mss_bcpho(c,k) = mss_bcpho(c,k-1) - mss_ocphi(c,k) = mss_ocphi(c,k-1) - mss_ocpho(c,k) = mss_ocpho(c,k-1) - mss_dst1(c,k) = mss_dst1(c,k-1) - mss_dst2(c,k) = mss_dst2(c,k-1) - mss_dst3(c,k) = mss_dst3(c,k-1) - mss_dst4(c,k) = mss_dst4(c,k-1) - snw_rds(c,k) = snw_rds(c,k-1) - - dz(c,k) = dz(c,k-1) - end do - end if - - ! Decrease the number of snow layers - snl(c) = snl(c) + 1 - if (snl(c) >= -1) EXIT - - else - - ! The layer thickness is greater than the prescribed minimum value - mssi(c) = mssi(c) + 1 - - end if - end do - - end if - - end do - - ! Reset the node depth and the depth of layer interface - - do j = 0, -nlevsno+1, -1 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c) + 1) then - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end if - end do - end do - - end associate - end subroutine CombineSnowLayers - - !----------------------------------------------------------------------- - subroutine DivideSnowLayers(bounds, num_snowc, filter_snowc, & - aerosol_inst, temperature_inst, waterstate_inst, is_lake) - ! - ! !DESCRIPTION: - ! Subdivides snow layers if they exceed their prescribed maximum thickness. - ! - ! !USES: - use clm_varcon, only : tfrz - use LakeCon , only : lsadz - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of column snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - type(aerosol_type) , intent(inout) :: aerosol_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - logical , intent(in) :: is_lake !TODO - this should be examined and removed in the future - ! - ! !LOCAL VARIABLES: - integer :: j, c, fc, k ! indices - real(r8) :: drr ! thickness of the combined [m] - integer :: msno ! number of snow layer 1 (top) to msno (bottom) - real(r8) :: dzsno(bounds%begc:bounds%endc,nlevsno) ! Snow layer thickness [m] - real(r8) :: swice(bounds%begc:bounds%endc,nlevsno) ! Partial volume of ice [m3/m3] - real(r8) :: swliq(bounds%begc:bounds%endc,nlevsno) ! Partial volume of liquid water [m3/m3] - real(r8) :: tsno(bounds%begc:bounds%endc ,nlevsno) ! Nodel temperature [K] - real(r8) :: zwice ! temporary - real(r8) :: zwliq ! temporary - real(r8) :: propor ! temporary - real(r8) :: dtdz ! temporary - ! temporary variables mimicking the structure of other layer division variables - real(r8) :: mbc_phi(bounds%begc:bounds%endc,nlevsno) ! mass of BC in each snow layer - real(r8) :: zmbc_phi ! temporary - real(r8) :: mbc_pho(bounds%begc:bounds%endc,nlevsno) ! mass of BC in each snow layer - real(r8) :: zmbc_pho ! temporary - real(r8) :: moc_phi(bounds%begc:bounds%endc,nlevsno) ! mass of OC in each snow layer - real(r8) :: zmoc_phi ! temporary - real(r8) :: moc_pho(bounds%begc:bounds%endc,nlevsno) ! mass of OC in each snow layer - real(r8) :: zmoc_pho ! temporary - real(r8) :: mdst1(bounds%begc:bounds%endc,nlevsno) ! mass of dust 1 in each snow layer - real(r8) :: zmdst1 ! temporary - real(r8) :: mdst2(bounds%begc:bounds%endc,nlevsno) ! mass of dust 2 in each snow layer - real(r8) :: zmdst2 ! temporary - real(r8) :: mdst3(bounds%begc:bounds%endc,nlevsno) ! mass of dust 3 in each snow layer - real(r8) :: zmdst3 ! temporary - real(r8) :: mdst4(bounds%begc:bounds%endc,nlevsno) ! mass of dust 4 in each snow layer - real(r8) :: zmdst4 ! temporary - real(r8) :: rds(bounds%begc:bounds%endc,nlevsno) - ! Variables for consistency check - real(r8) :: dztot(bounds%begc:bounds%endc) - real(r8) :: snwicetot(bounds%begc:bounds%endc) - real(r8) :: snwliqtot(bounds%begc:bounds%endc) - real(r8) :: offset ! temporary - !----------------------------------------------------------------------- - - associate( & - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Output: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective snow grain radius (col,lyr) [microns, m^-6] - - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! Output: [real(r8) (:,:) ] hydrophilic BC mass in snow (col,lyr) [kg] - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic BC mass in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! Output: [real(r8) (:,:) ] hydrophilic OC mass in snow (col,lyr) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! Output: [real(r8) (:,:) ] hydrophobic OC mass in snow (col,lyr) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! Output: [real(r8) (:,:) ] dust species 1 mass in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! Output: [real(r8) (:,:) ] dust species 2 mass in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! Output: [real(r8) (:,:) ] dust species 3 mass in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! Output: [real(r8) (:,:) ] dust species 4 mass in snow (col,lyr) [kg] - - snl => col%snl , & ! Output: [integer (:) ] number of snow layers - dz => col%dz , & ! Output: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z & ! Output: [real(r8) (:,:) ] layer thickness (m) - ) - - if ( is_lake ) then - ! Initialize for consistency check - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - - if (j == -nlevsno+1) then - dztot(c) = 0._r8 - snwicetot(c) = 0._r8 - snwliqtot(c) = 0._r8 - end if - - if (j >= snl(c)+1) then - dztot(c) = dztot(c) + dz(c,j) - snwicetot(c) = snwicetot(c) + h2osoi_ice(c,j) - snwliqtot(c) = snwliqtot(c) + h2osoi_liq(c,j) - end if - end do - end do - end if - - ! Begin calculation - note that the following column loops are only invoked - ! for snow-covered columns - - do j = 1,nlevsno - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j <= abs(snl(c))) then - if (is_lake) then - dzsno(c,j) = dz(c,j+snl(c)) - else - dzsno(c,j) = frac_sno(c)*dz(c,j+snl(c)) - end if - swice(c,j) = h2osoi_ice(c,j+snl(c)) - swliq(c,j) = h2osoi_liq(c,j+snl(c)) - tsno(c,j) = t_soisno(c,j+snl(c)) - - mbc_phi(c,j) = mss_bcphi(c,j+snl(c)) - mbc_pho(c,j) = mss_bcpho(c,j+snl(c)) - moc_phi(c,j) = mss_ocphi(c,j+snl(c)) - moc_pho(c,j) = mss_ocpho(c,j+snl(c)) - mdst1(c,j) = mss_dst1(c,j+snl(c)) - mdst2(c,j) = mss_dst2(c,j+snl(c)) - mdst3(c,j) = mss_dst3(c,j+snl(c)) - mdst4(c,j) = mss_dst4(c,j+snl(c)) - rds(c,j) = snw_rds(c,j+snl(c)) - end if - end do - end do - - loop_snowcolumns: do fc = 1, num_snowc - c = filter_snowc(fc) - - msno = abs(snl(c)) - - ! Now traverse layers from top to bottom in a dynamic way, as the total - ! number of layers (msno) may increase during the loop. - ! Impose k < nlevsno; the special case 'k == nlevsno' is not relevant, - ! as it is neither allowed to subdivide nor does it have layers below. - k = 1 - loop_layers: do while( k <= msno .and. k < nlevsno ) - - ! Current layer is bottom layer - if (k == msno) then - - if (is_lake) then - offset = 2._r8 * lsadz - else - offset = 0._r8 - end if - - if (dzsno(c,k) > dzmax_l(k) + offset) then - ! Subdivide layer into two layers with equal thickness, water - ! content, ice content and temperature - msno = msno + 1 - dzsno(c,k) = dzsno(c,k) / 2.0_r8 - dzsno(c,k+1) = dzsno(c,k) - swice(c,k) = swice(c,k) / 2.0_r8 - swice(c,k+1) = swice(c,k) - swliq(c,k) = swliq(c,k) / 2.0_r8 - swliq(c,k+1) = swliq(c,k) - - if (k == 1) then - ! special case - tsno(c,k+1) = tsno(c,k) - else - ! use temperature gradient - dtdz = (tsno(c,k-1) - tsno(c,k))/((dzsno(c,k-1)+2*dzsno(c,k))/2.0_r8) - tsno(c,k+1) = tsno(c,k) - dtdz*dzsno(c,k)/2.0_r8 - if (tsno(c,k+1) >= tfrz) then - tsno(c,k+1) = tsno(c,k) - else - tsno(c,k) = tsno(c,k) + dtdz*dzsno(c,k)/2.0_r8 - endif - end if - - mbc_phi(c,k) = mbc_phi(c,k) / 2.0_r8 - mbc_phi(c,k+1) = mbc_phi(c,k) - mbc_pho(c,k) = mbc_pho(c,k) / 2.0_r8 - mbc_pho(c,k+1) = mbc_pho(c,k) - moc_phi(c,k) = moc_phi(c,k) / 2.0_r8 - moc_phi(c,k+1) = moc_phi(c,k) - moc_pho(c,k) = moc_pho(c,k) / 2.0_r8 - moc_pho(c,k+1) = moc_pho(c,k) - mdst1(c,k) = mdst1(c,k) / 2.0_r8 - mdst1(c,k+1) = mdst1(c,k) - mdst2(c,k) = mdst2(c,k) / 2.0_r8 - mdst2(c,k+1) = mdst2(c,k) - mdst3(c,k) = mdst3(c,k) / 2.0_r8 - mdst3(c,k+1) = mdst3(c,k) - mdst4(c,k) = mdst4(c,k) / 2.0_r8 - mdst4(c,k+1) = mdst4(c,k) - - rds(c,k+1) = rds(c,k) - end if - end if - - ! There are layers below (note this is not exclusive with previous - ! if-statement, since msno may have increased in the previous if-statement) - if (k < msno) then - - if (is_lake) then - offset = lsadz - else - offset = 0._r8 - end if - - if (dzsno(c,k) > dzmax_u(k) + offset ) then - ! Only dump excess snow to underlying layer in a conservative fashion. - ! Other quantities will depend on the height of the excess snow: a ratio is used for this. - drr = dzsno(c,k) - dzmax_u(k) - offset - - propor = drr/dzsno(c,k) - zwice = propor*swice(c,k) - zwliq = propor*swliq(c,k) - zmbc_phi = propor*mbc_phi(c,k) - zmbc_pho = propor*mbc_pho(c,k) - zmoc_phi = propor*moc_phi(c,k) - zmoc_pho = propor*moc_pho(c,k) - zmdst1 = propor*mdst1(c,k) - zmdst2 = propor*mdst2(c,k) - zmdst3 = propor*mdst3(c,k) - zmdst4 = propor*mdst4(c,k) - - propor = (dzmax_u(k)+offset)/dzsno(c,k) - swice(c,k) = propor*swice(c,k) - swliq(c,k) = propor*swliq(c,k) - mbc_phi(c,k) = propor*mbc_phi(c,k) - mbc_pho(c,k) = propor*mbc_pho(c,k) - moc_phi(c,k) = propor*moc_phi(c,k) - moc_pho(c,k) = propor*moc_pho(c,k) - mdst1(c,k) = propor*mdst1(c,k) - mdst2(c,k) = propor*mdst2(c,k) - mdst3(c,k) = propor*mdst3(c,k) - mdst4(c,k) = propor*mdst4(c,k) - - ! Set depth layer k to maximum allowed value - dzsno(c,k) = dzmax_u(k) + offset - - mbc_phi(c,k+1) = mbc_phi(c,k+1)+zmbc_phi ! (combo) - mbc_pho(c,k+1) = mbc_pho(c,k+1)+zmbc_pho ! (combo) - moc_phi(c,k+1) = moc_phi(c,k+1)+zmoc_phi ! (combo) - moc_pho(c,k+1) = moc_pho(c,k+1)+zmoc_pho ! (combo) - mdst1(c,k+1) = mdst1(c,k+1)+zmdst1 ! (combo) - mdst2(c,k+1) = mdst2(c,k+1)+zmdst2 ! (combo) - mdst3(c,k+1) = mdst3(c,k+1)+zmdst3 ! (combo) - mdst4(c,k+1) = mdst4(c,k+1)+zmdst4 ! (combo) - - ! Mass-weighted combination of radius - rds(c,k+1) = MassWeightedSnowRadius( rds(c,k), rds(c,k+1), & - (swliq(c,k+1)+swice(c,k+1)), (zwliq+zwice) ) - - call Combo (dzsno(c,k+1), swliq(c,k+1), swice(c,k+1), tsno(c,k+1), drr, & - zwliq, zwice, tsno(c,k)) - end if - end if - k = k+1 - end do loop_layers - - snl(c) = -msno - - end do loop_snowcolumns - - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - if (is_lake) then - dz(c,j) = dzsno(c,j-snl(c)) - else - dz(c,j) = dzsno(c,j-snl(c))/frac_sno(c) - end if - h2osoi_ice(c,j) = swice(c,j-snl(c)) - h2osoi_liq(c,j) = swliq(c,j-snl(c)) - t_soisno(c,j) = tsno(c,j-snl(c)) - mss_bcphi(c,j) = mbc_phi(c,j-snl(c)) - mss_bcpho(c,j) = mbc_pho(c,j-snl(c)) - mss_ocphi(c,j) = moc_phi(c,j-snl(c)) - mss_ocpho(c,j) = moc_pho(c,j-snl(c)) - mss_dst1(c,j) = mdst1(c,j-snl(c)) - mss_dst2(c,j) = mdst2(c,j-snl(c)) - mss_dst3(c,j) = mdst3(c,j-snl(c)) - mss_dst4(c,j) = mdst4(c,j-snl(c)) - snw_rds(c,j) = rds(c,j-snl(c)) - - end if - end do - end do - - ! Consistency check - if (is_lake) then - do j = -nlevsno + 1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - - if (j >= snl(c)+1) then - dztot(c) = dztot(c) - dz(c,j) - snwicetot(c) = snwicetot(c) - h2osoi_ice(c,j) - snwliqtot(c) = snwliqtot(c) - h2osoi_liq(c,j) - end if - - if (j == 0) then - if ( abs(dztot(c)) > 1.e-10_r8 .or. abs(snwicetot(c)) > 1.e-7_r8 .or. & - abs(snwliqtot(c)) > 1.e-7_r8 ) then - write(iulog,*)'Inconsistency in SnowDivision_Lake! c, remainders', & - 'dztot, snwicetot, snwliqtot = ',c,dztot(c),snwicetot(c),snwliqtot(c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - end if - end if - end do - end do - end if - - ! Reset the node depth and the depth of layer interface - - do j = 0, -nlevsno+1, -1 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end if - end do - end do - - end associate - end subroutine DivideSnowLayers - - !----------------------------------------------------------------------- - subroutine InitSnowLayers (bounds, snow_depth) - ! - ! !DESCRIPTION: - ! Initialize snow layer depth from specified total depth. - ! - ! !USES: - use clm_varcon , only : spval - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: snow_depth(bounds%begc:) - ! - ! - ! LOCAL VARAIBLES: - integer :: c,l,j ! indices - real(r8) :: minbound, maxbound ! helper variables - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(snow_depth) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl, & ! Output: [integer (:) ] number of snow layers - dz => col%dz, & ! Output: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevgrnd) - z => col%z, & ! Output: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevgrnd) - zi => col%zi & ! Output: [real(r8) (:,:) ] interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) - ) - - loop_columns: do c = bounds%begc,bounds%endc - l = col%landunit(c) - - dz(c,-nlevsno+1: 0) = spval - z (c,-nlevsno+1: 0) = spval - zi(c,-nlevsno :-1) = spval - - ! Special case: lake - if (lun%lakpoi(l)) then - snl(c) = 0 - dz(c,-nlevsno+1:0) = 0._r8 - z(c,-nlevsno+1:0) = 0._r8 - zi(c,-nlevsno+0:0) = 0._r8 - cycle - end if - - ! LvK 9-JUN-2015: in CanopyHydrologyMod , snow_depth is scaled with frac_sno - ! Here we do not apply scaling to snow_depth, so inconsistent? TODO - - ! Special case: too little snow for snowpack existence - if (snow_depth(c) < dzmin(1)) then - snl(c) = 0 - dz(c,-nlevsno+1:0) = 0._r8 - z(c,-nlevsno+1:0) = 0._r8 - zi(c,-nlevsno+0:0) = 0._r8 - cycle - end if - - ! There has to be at least one snow layer - snl(c) = -1 - minbound = dzmin(1) - maxbound = dzmax_l(1) - - if (snow_depth(c) >= minbound .and. snow_depth(c) <= maxbound) then - ! Special case: single layer - dz(c,0) = snow_depth(c) - - else - ! Search for appropriate number of layers (snl) by increasing the number - ! the number of layers and check for matching bounds. - snl(c) = snl(c) - 1 - minbound = maxbound - maxbound = sum(dzmax_u(1:-snl(c))) - - do while(snow_depth(c) > maxbound .and. -snl(c) < nlevsno ) - snl(c) = snl(c) - 1 - minbound = maxbound - maxbound = sum(dzmax_u(1:-snl(c))) - end do - - ! Set thickness of all layers except bottom two - do j = 1, -snl(c)-2 - dz(c,j+snl(c)) = dzmax_u(j) - enddo - - ! Determine whether the two bottom layers should be equal in size, - ! or not. The rule here is: always create equal size when possible. - if (snow_depth(c) <= sum(dzmax_u(1:-snl(c)-2)) + 2 * dzmax_u(-snl(c)-1)) then - dz(c,-1) = (snow_depth(c) - sum(dzmax_u(1:-snl(c)-2))) / 2._r8 - dz(c,0) = dz(c,-1) - else - dz(c,-1) = dzmax_u(-snl(c)-1) - dz(c,0) = snow_depth(c) - sum(dzmax_u(1:-snl(c)-1)) - endif - endif - - ! Initialize the node depth and the depth of layer interface - do j = 0, snl(c)+1, -1 - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end do - - end do loop_columns - - end associate - end subroutine InitSnowLayers - - !----------------------------------------------------------------------- - subroutine SnowCapping(bounds, num_initc, filter_initc, num_snowc, filter_snowc, & - aerosol_inst, waterflux_inst, waterstate_inst, topo_inst ) - ! - ! !DESCRIPTION: - ! Removes mass from bottom snow layer for columns that exceed the maximum snow depth. - ! This routine is called twice: once for non-lake columns and once for lake columns. - ! The initialization of the snow capping fluxes should only be done ONCE for each group, - ! therefore they are a passed as an extra argument (filter_initc). - ! Density and temperature of the layer are conserved (density needs some work, temperature is a state - ! variable) - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_initc ! number of column points that need to be initialized - integer , intent(in) :: filter_initc(:) ! column filter for points that need to be initialized - integer , intent(in) :: num_snowc ! number of column snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - type(aerosol_type) , intent(inout) :: aerosol_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - class(topo_type) , intent(in) :: topo_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: dtime ! land model time step (sec) - real(r8) :: mss_snwcp_tot ! total snow capping mass [kg/m2] - real(r8) :: mss_snow_bottom_lyr ! total snow mass (ice+liquid) in bottom layer [kg/m2] - real(r8) :: snwcp_flux_ice ! snow capping flux (ice) [kg/m2] - real(r8) :: snwcp_flux_liq ! snow capping flux (liquid) [kg/m2] - real(r8) :: icefrac ! fraction of ice mass w.r.t. total mass [unitless] - real(r8) :: frac_adjust ! fraction of mass remaining after capping - real(r8) :: rho ! partial density of ice (not scaled with frac_sno) [kg/m3] - integer :: fc, c ! counters - real(r8) :: h2osno_excess(bounds%begc:bounds%endc) ! excess snow that needs to be capped [mm H2O] - logical :: apply_runoff(bounds%begc:bounds%endc) ! for columns with capping, whether the capping flux should be sent to runoff - ! Always keep at least this fraction of the bottom snow layer when doing snow capping - ! This needs to be slightly greater than 0 to avoid roundoff problems - real(r8), parameter :: min_snow_to_keep = 1.e-9 ! fraction of bottom snow layer to keep with capping - - !----------------------------------------------------------------------- - associate( & - qflx_snwcp_ice => waterflux_inst%qflx_snwcp_ice_col , & ! Output: [real(r8) (:) ] excess solid h2o due to snow capping (outgoing) (mm H2O /s) [+] - qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess liquid h2o due to snow capping (outgoing) (mm H2O /s) [+] - qflx_snwcp_discarded_ice => waterflux_inst%qflx_snwcp_discarded_ice_col, & ! Output: [real(r8) (:) ] excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] - qflx_snwcp_discarded_liq => waterflux_inst%qflx_snwcp_discarded_liq_col, & ! Output: [real(r8) (:) ] excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) [+] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! In/Out: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! In/Out: [real(r8) (:,:) ] liquid water (kg/m2) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - mss_bcphi => aerosol_inst%mss_bcphi_col , & ! In/Out: [real(r8) (:,:) ] hydrophilic BC mass in snow (col,lyr) [kg] - mss_bcpho => aerosol_inst%mss_bcpho_col , & ! In/Out: [real(r8) (:,:) ] hydrophobic BC mass in snow (col,lyr) [kg] - mss_ocphi => aerosol_inst%mss_ocphi_col , & ! In/Out: [real(r8) (:,:) ] hydrophilic OC mass in snow (col,lyr) [kg] - mss_ocpho => aerosol_inst%mss_ocpho_col , & ! In/Out: [real(r8) (:,:) ] hydrophobic OC mass in snow (col,lyr) [kg] - mss_dst1 => aerosol_inst%mss_dst1_col , & ! In/Out: [real(r8) (:,:) ] dust species 1 mass in snow (col,lyr) [kg] - mss_dst2 => aerosol_inst%mss_dst2_col , & ! In/Out: [real(r8) (:,:) ] dust species 2 mass in snow (col,lyr) [kg] - mss_dst3 => aerosol_inst%mss_dst3_col , & ! In/Out: [real(r8) (:,:) ] dust species 3 mass in snow (col,lyr) [kg] - mss_dst4 => aerosol_inst%mss_dst4_col , & ! In/Out: [real(r8) (:,:) ] dust species 4 mass in snow (col,lyr) [kg] - topo => topo_inst%topo_col , & ! Input : [real(r8) (:) ] column surface height (m) - dz => col%dz & ! In/Out: [real(r8) (:,:) ] layer depth (m) - ) - - ! Determine model time step - dtime = get_step_size() - - ! Initialize capping fluxes for all columns in domain (lake or non-lake) - do fc = 1, num_initc - c = filter_initc(fc) - qflx_snwcp_ice(c) = 0.0_r8 - qflx_snwcp_liq(c) = 0.0_r8 - qflx_snwcp_discarded_ice(c) = 0.0_r8 - qflx_snwcp_discarded_liq(c) = 0.0_r8 - end do - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno = h2osno(bounds%begc:bounds%endc), & - topo = topo(bounds%begc:bounds%endc), & - h2osno_excess = h2osno_excess(bounds%begc:bounds%endc), & - apply_runoff = apply_runoff(bounds%begc:bounds%endc)) - - loop_columns: do fc = 1, num_snowc - c = filter_snowc(fc) - - if (h2osno_excess(c) > 0._r8) then - mss_snow_bottom_lyr = h2osoi_ice(c,0) + h2osoi_liq(c,0) - mss_snwcp_tot = min(h2osno_excess(c), mss_snow_bottom_lyr * (1._r8 - min_snow_to_keep)) ! Can't remove more mass than available - - ! Ratio of snow/liquid in bottom layer determines partitioning of runoff fluxes - icefrac = h2osoi_ice(c,0) / mss_snow_bottom_lyr - snwcp_flux_ice = mss_snwcp_tot/dtime * icefrac - snwcp_flux_liq = mss_snwcp_tot/dtime * (1._r8 - icefrac) - if (apply_runoff(c)) then - qflx_snwcp_ice(c) = snwcp_flux_ice - qflx_snwcp_liq(c) = snwcp_flux_liq - else - qflx_snwcp_discarded_ice(c) = snwcp_flux_ice - qflx_snwcp_discarded_liq(c) = snwcp_flux_liq - end if - - rho = h2osoi_ice(c,0) / dz(c,0) ! ice only - - ! Adjust water content - h2osoi_ice(c,0) = h2osoi_ice(c,0) - snwcp_flux_ice*dtime - h2osoi_liq(c,0) = h2osoi_liq(c,0) - snwcp_flux_liq*dtime - - ! Scale dz such that ice density (or: pore space) is conserved - ! - ! Avoid scaling dz for very low ice densities. This can occur, in principle, if - ! the layer is mostly liquid water. Furthermore, this check is critical in the - ! unlikely event that rho is 0, which can happen if the layer is entirely liquid - ! water. - if (rho > 1.0_r8) then - dz(c,0) = h2osoi_ice(c,0) / rho - end if - - ! Check that water capacity is still positive - if (h2osoi_ice(c,0) < 0._r8 .or. h2osoi_liq(c,0) < 0._r8 ) then - write(iulog,*)'ERROR: capping procedure failed (negative mass remaining) c = ',c - write(iulog,*)'h2osoi_ice = ', h2osoi_ice(c,0), ' h2osoi_liq = ', h2osoi_liq(c,0) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - end if - - ! Correct the top layer aerosol mass to account for snow capping. - ! This approach conserves the aerosol mass concentration but not aerosol mass. - frac_adjust = (mss_snow_bottom_lyr - mss_snwcp_tot) / mss_snow_bottom_lyr - mss_bcphi(c,0) = mss_bcphi(c,0) * frac_adjust - mss_bcpho(c,0) = mss_bcpho(c,0) * frac_adjust - mss_ocphi(c,0) = mss_ocphi(c,0) * frac_adjust - mss_ocpho(c,0) = mss_ocpho(c,0) * frac_adjust - mss_dst1(c,0) = mss_dst1(c,0) * frac_adjust - mss_dst2(c,0) = mss_dst2(c,0) * frac_adjust - mss_dst3(c,0) = mss_dst3(c,0) * frac_adjust - mss_dst4(c,0) = mss_dst4(c,0) * frac_adjust - end if - - end do loop_columns - - end associate - end subroutine SnowCapping - - !----------------------------------------------------------------------- - subroutine SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno, topo, h2osno_excess, apply_runoff) - ! - ! !DESCRIPTION: - ! Determine the amount of excess snow that needs to be capped - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of column snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - real(r8) , intent(in) :: h2osno( bounds%begc: ) ! snow water (mm H2O) - real(r8) , intent(in) :: topo( bounds%begc: ) ! column surface height (m) - real(r8) , intent(out) :: h2osno_excess( bounds%begc: ) ! excess snow that needs to be capped (mm H2O) - logical , intent(out) :: apply_runoff( bounds%begc: ) ! whether capped snow should be sent to runoff; only valid where h2osno_excess > 0 - ! - ! !LOCAL VARIABLES: - integer :: fc, c, l - integer :: reset_snow_timesteps - logical :: is_reset_snow_active ! whether snow resetting is active in this time step for at least some points - - character(len=*), parameter :: subname = 'SnowCappingExcess' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(h2osno) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(topo) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osno_excess) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(apply_runoff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do fc = 1, num_snowc - c = filter_snowc(fc) - h2osno_excess(c) = 0._r8 - if (h2osno(c) > h2osno_max) then - h2osno_excess(c) = h2osno(c) - h2osno_max - apply_runoff(c) = .true. - end if - end do - - ! Implement snow resetting (i.e., resetting points that have h2osno greater than some - ! value) by applying the snow capping scheme to a value that's smaller than - ! h2osno_max, but NOT sending the resulting capping flux to the coupler. It is easier - ! to implement the resetting this way than to try to manually reset the snow pack, - ! because there are so many snow pack variables that need to be kept consistent if - ! doing this resetting manually. Note that we need to continue to apply the resetting - ! for some number of time steps, because we can remove at most one snow layer per - ! time step. - - ! It is important that this snow resetting comes after the standard check (h2osno(c) > - ! h2osno_max), so that we override any standard capping. - is_reset_snow_active = .false. - if (reset_snow .or. reset_snow_glc) then - reset_snow_timesteps = reset_snow_timesteps_per_layer * nlevsno - if (get_nstep() <= reset_snow_timesteps) then - is_reset_snow_active = .true. - end if - end if - - if (is_reset_snow_active) then - do fc = 1, num_snowc - c = filter_snowc(fc) - l = col%landunit(c) - if ((lun%itype(l) /= istice_mec) .and. & - reset_snow .and. & - (h2osno(c) > reset_snow_h2osno)) then - h2osno_excess(c) = h2osno(c) - reset_snow_h2osno - apply_runoff(c) = .false. - else if ((lun%itype(l) == istice_mec) .and. & - reset_snow_glc .and. & - (h2osno(c) > reset_snow_h2osno) .and. & - (topo(c) <= reset_snow_glc_ela)) then - h2osno_excess(c) = h2osno(c) - reset_snow_h2osno - apply_runoff(c) = .false. - end if - end do - end if - - end subroutine SnowCappingExcess - - !----------------------------------------------------------------------- - subroutine NewSnowBulkDensity(bounds, num_c, filter_c, atm2lnd_inst, bifall) - ! - ! !DESCRIPTION: - ! Compute the bulk density of any newly-fallen snow. - ! - ! The return value is placed in bifall. Only columns within the given filter are set: - ! all other columns remain at their original values. - ! - ! !USES: - use clm_varcon, only : tfrz - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_c ! number of columns in filterc - integer , intent(in) :: filter_c(:) ! column-level filter to operate on - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - real(r8) , intent(inout) :: bifall(bounds%begc:) ! bulk density of newly fallen dry snow [kg/m3] - ! - ! !LOCAL VARIABLES: - integer :: fc, c, g - real(r8) :: t_for_bifall_degC ! temperature to use in bifall equation (deg C) - - character(len=*), parameter :: subname = 'NewSnowBulkDensity' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(bifall) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_wind => atm2lnd_inst%forc_wind_grc & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - ) - - do fc = 1, num_c - c = filter_c(fc) - g = col%gridcell(c) - - if (forc_t(c) > tfrz + 2._r8) then - bifall(c) = 50._r8 + 1.7_r8*(17.0_r8)**1.5_r8 - else if (forc_t(c) > tfrz - 15._r8) then - bifall(c) = 50._r8 + 1.7_r8*(forc_t(c) - tfrz + 15._r8)**1.5_r8 - else if ( new_snow_density == LoTmpDnsTruncatedAnderson1976 ) then - bifall(c) = 50._r8 - else if (new_snow_density == LoTmpDnsSlater2017) then - ! Andrew Slater: A temp of about -15C gives the nicest - ! "blower" powder, but as you get colder the flake size decreases so - ! density goes up. e.g. the smaller snow crystals from the Arctic and Antarctic - ! winters - if (forc_t(c) > tfrz - 57.55_r8) then - t_for_bifall_degC = (forc_t(c)-tfrz) - else - ! Below -57.55 deg C, the following function starts to decrease with - ! decreasing temperatures. Limit the function to avoid this turning over. - t_for_bifall_degC = -57.55_r8 - end if - bifall(c) = -(50._r8/15._r8 + 0.0333_r8*15_r8)*t_for_bifall_degC - 0.0333_r8*t_for_bifall_degC**2 - end if - - if (wind_dependent_snow_density .and. forc_wind(g) > 0.1_r8 ) then - ! Density offset for wind-driven compaction, initial ideas based on Liston et. al (2007) J. Glaciology, - ! 53(181), 241-255. Modified for a continuous wind impact and slightly more sensitive - ! to wind - Andrew Slater, 2016 - bifall(c) = bifall(c) + (266.861_r8 * ((1._r8 + TANH(forc_wind(g)/5.0_r8))/2._r8)**8.8_r8) - end if - - end do - - end associate - - end subroutine NewSnowBulkDensity - - !----------------------------------------------------------------------- - pure function OverburdenCompactionAnderson1976(burden, wx, td, bi) & - result(compaction_rate) - ! - ! !DESCRIPTION: - ! Compute snow overburden compaction for a single column and level using the Anderson - ! 1976 formula - ! - ! From Anderson 1976: A point energy and mass balance model of a snow cover, NOAA - ! Technical Report NWS 19 - ! - ! !ARGUMENTS: - real(r8) :: compaction_rate ! function result - real(r8) , intent(in) :: burden ! pressure of overlying snow in this column [kg/m2] - real(r8) , intent(in) :: wx ! water mass (ice+liquid) [kg/m2] - real(r8) , intent(in) :: td ! t_soisno - tfrz [K] - real(r8) , intent(in) :: bi ! partial density of ice [kg/m3] - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: c2 = 23.e-3_r8 ! [m3/kg] - real(r8), parameter :: eta0 = 9.e+5_r8 ! The Viscosity Coefficient Eta0 [kg-s/m2] - - character(len=*), parameter :: subname = 'OverburdenCompactionAnderson1976' - !----------------------------------------------------------------------- - - compaction_rate = -(burden+wx/2._r8)*exp(-overburden_compress_Tfactor*td - c2*bi)/eta0 - - end function OverburdenCompactionAnderson1976 - - !----------------------------------------------------------------------- - function OverburdenCompactionVionnet2012(h2osoi_liq, dz, burden, wx, td, bi) & - result(compaction_rate) - ! - ! !DESCRIPTION: - ! Compute snow overburden compaction for a single column and level using the Vionnet - ! et al. 2012 formula - ! - ! From Vionnet V et al. 2012, "The detailed snowpack scheme Crocus and its - ! implementation in SURFEX v7.2", Geosci. Model Dev. 5, 773–791. - ! - ! Preconditions (required to avoid divide by 0): - ! - dz > 0 - ! - bi > 0 - ! - ! !USES: - use clm_varcon, only : denh2o - ! - ! !ARGUMENTS: - real(r8) :: compaction_rate ! function result - real(r8) , intent(in) :: h2osoi_liq ! liquid water in this column and level [kg/m2] - real(r8) , intent(in) :: dz ! layer depth for this column and level [m] - real(r8) , intent(in) :: burden ! pressure of overlying snow in this column [kg/m2] - real(r8) , intent(in) :: wx ! water mass (ice+liquid) [kg/m2] - real(r8) , intent(in) :: td ! t_soisno - tfrz [K] - real(r8) , intent(in) :: bi ! partial density of ice [kg/m3] - ! - ! !LOCAL VARIABLES: - real(r8) :: f1, f2 ! overburden compaction modifiers to viscosity - real(r8) :: eta ! Viscosity - - real(r8), parameter :: ceta = 450._r8 ! overburden compaction constant [kg/m3] - real(r8), parameter :: aeta = 0.1_r8 ! overburden compaction constant [1/K] - real(r8), parameter :: beta = 0.023_r8 ! overburden compaction constant [m3/kg] - real(r8), parameter :: eta0 = 7.62237e6_r8 ! The Viscosity Coefficient Eta0 [kg-s/m2] - - character(len=*), parameter :: subname = 'OverburdenCompactionVionnet2012' - !----------------------------------------------------------------------- - - f1 = 1._r8 / (1._r8 + 60._r8 * h2osoi_liq / (denh2o * dz)) - f2 = 4.0_r8 ! currently fixed to maximum value, holds in absence of angular grains - eta = f1*f2*(bi/ceta)*exp(aeta*td + beta*bi)*eta0 - compaction_rate = -(burden+wx/2._r8) / eta - - end function OverburdenCompactionVionnet2012 - - !----------------------------------------------------------------------- - subroutine WindDriftCompaction(bi, forc_wind, dz, & - zpseudo, mobile, compaction_rate) - ! - ! !DESCRIPTION: - ! - ! Compute wind drift compaction for a single column and level. - ! - ! Also updates zpseudo and mobile for this column. However, zpseudo remains unchanged - ! if mobile is already false or becomes false within this subroutine. - ! - ! The structure of the updates done here for zpseudo and mobile requires that this - ! subroutine be called first for the top layer of snow, then for the 2nd layer down, - ! etc. - and finally for the bottom layer. Before beginning the loops over layers, - ! mobile should be initialized to .true. and zpseudo should be initialized to 0. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8) , intent(in) :: bi ! partial density of ice [kg/m3] - real(r8) , intent(in) :: forc_wind ! atmospheric wind speed [m/s] - real(r8) , intent(in) :: dz ! layer depth for this column and level [m] - real(r8) , intent(inout) :: zpseudo ! wind drift compaction / pseudo depth for this column at this layer - logical , intent(inout) :: mobile ! whether this snow column is still mobile at this layer (i.e., susceptible to wind drift) - real(r8) , intent(out) :: compaction_rate ! rate of compaction of snowpack due to wind drift, for the current column and layer - ! - ! !LOCAL VARIABLES: - real(r8) :: Frho ! Mobility density factor [-] - real(r8) :: MO ! Mobility index [-] - real(r8) :: SI ! Driftability index [-] - real(r8) :: gamma_drift ! Scaling factor for wind drift time scale [-] - real(r8) :: tau_inverse ! Inverse of the effective time scale [1/s] - - real(r8), parameter :: rho_min = 50._r8 ! wind drift compaction / minimum density [kg/m3] - real(r8), parameter :: rho_max = 350._r8 ! wind drift compaction / maximum density [kg/m3] - real(r8), parameter :: drift_gs = 0.35e-3_r8 ! wind drift compaction / grain size (fixed value for now) - real(r8), parameter :: drift_sph = 1.0_r8 ! wind drift compaction / sphericity - real(r8), parameter :: tau_ref = 48._r8 * 3600._r8 ! wind drift compaction / reference time [s] - - character(len=*), parameter :: subname = 'WindDriftCompaction' - !----------------------------------------------------------------------- - - if (mobile) then - Frho = 1.25_r8 - 0.0042_r8*(max(rho_min, bi)-rho_min) - ! assuming dendricity = 0, sphericity = 1, grain size = 0.35 mm Non-dendritic snow - MO = 0.34_r8 * (-0.583_r8*drift_gs - 0.833_r8*drift_sph + 0.833_r8) + 0.66_r8*Frho - SI = -2.868_r8 * exp(-0.085_r8*forc_wind) + 1._r8 + MO - - if (SI > 0.0_r8) then - SI = min(SI, 3.25_r8) - ! Increase zpseudo (wind drift / pseudo depth) to the middle of - ! the pseudo-node for the sake of the following calculation - zpseudo = zpseudo + 0.5_r8 * dz * (3.25_r8 - SI) - gamma_drift = SI*exp(-zpseudo/0.1_r8) - tau_inverse = gamma_drift / tau_ref - compaction_rate = -max(0.0_r8, rho_max-bi) * tau_inverse - ! Further increase zpseudo to the bottom of the pseudo-node for - ! the sake of calculations done on the underlying layer (i.e., - ! the next time through the j loop). - zpseudo = zpseudo + 0.5_r8 * dz * (3.25_r8 - SI) - else ! SI <= 0 - mobile = .false. - compaction_rate = 0._r8 - end if - else ! .not. mobile - compaction_rate = 0._r8 - end if - - end subroutine WindDriftCompaction - - - !----------------------------------------------------------------------- - subroutine Combo(dz, wliq, wice, t, dz2, wliq2, wice2, t2) - ! - ! !DESCRIPTION: - ! Combines two elements and returns the following combined - ! variables: dz, t, wliq, wice. - ! The combined temperature is based on the equation: - ! the sum of the enthalpies of the two elements = - ! that of the combined element. - ! - ! !USES: - use clm_varcon, only : cpice, cpliq, tfrz, hfus - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: dz2 ! nodal thickness of 2 elements being combined [m] - real(r8), intent(in) :: wliq2 ! liquid water of element 2 [kg/m2] - real(r8), intent(in) :: wice2 ! ice of element 2 [kg/m2] - real(r8), intent(in) :: t2 ! nodal temperature of element 2 [K] - real(r8), intent(inout) :: dz ! nodal thickness of 1 elements being combined [m] - real(r8), intent(inout) :: wliq ! liquid water of element 1 - real(r8), intent(inout) :: wice ! ice of element 1 [kg/m2] - real(r8), intent(inout) :: t ! nodel temperature of element 1 [K] - ! - ! !LOCAL VARIABLES: - real(r8) :: dzc ! Total thickness of nodes 1 and 2 (dzc=dz+dz2). - real(r8) :: wliqc ! Combined liquid water [kg/m2] - real(r8) :: wicec ! Combined ice [kg/m2] - real(r8) :: tc ! Combined node temperature [K] - real(r8) :: h ! enthalpy of element 1 [J/m2] - real(r8) :: h2 ! enthalpy of element 2 [J/m2] - real(r8) :: hc ! temporary - !----------------------------------------------------------------------- - - dzc = dz+dz2 - wicec = (wice+wice2) - wliqc = (wliq+wliq2) - h = (cpice*wice+cpliq*wliq) * (t-tfrz)+hfus*wliq - h2= (cpice*wice2+cpliq*wliq2) * (t2-tfrz)+hfus*wliq2 - - hc = h + h2 - tc = tfrz + (hc - hfus*wliqc) / (cpice*wicec + cpliq*wliqc) - - dz = dzc - wice = wicec - wliq = wliqc - t = tc - - end subroutine Combo - - !----------------------------------------------------------------------- - function MassWeightedSnowRadius( rds1, rds2, swtot, zwtot ) result(mass_weighted_snowradius) - ! - ! !DESCRIPTION: - ! Calculate the mass weighted snow radius when two layers are combined - ! - ! !USES: - use AerosolMod , only : snw_rds_min - use SnowSnicarMod, only : snw_rds_max - implicit none - ! !ARGUMENTS: - real(r8), intent(IN) :: rds1 ! Layer 1 radius - real(r8), intent(IN) :: rds2 ! Layer 2 radius - real(r8), intent(IN) :: swtot ! snow water total layer 2 - real(r8), intent(IN) :: zwtot ! snow water total layer 1 - real(r8) :: mass_weighted_snowradius ! resulting bounded mass weighted snow radius - - SHR_ASSERT( (swtot+zwtot > 0.0_r8), errMsg(sourcefile, __LINE__)) - mass_weighted_snowradius = (rds2*swtot + rds1*zwtot)/(swtot+zwtot) - - if ( mass_weighted_snowradius > snw_rds_max ) then - mass_weighted_snowradius = snw_rds_max - else if ( mass_weighted_snowradius < snw_rds_min ) then - mass_weighted_snowradius = snw_rds_min - end if - end function MassWeightedSnowRadius - - !----------------------------------------------------------------------- - subroutine BuildSnowFilter(bounds, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - ! - ! !DESCRIPTION: - ! Constructs snow filter for use in vectorized loops for snow hydrology. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(out) :: num_snowc ! number of column snow points in column filter - integer , intent(out) :: filter_snowc(:) ! column filter for snow points - integer , intent(out) :: num_nosnowc ! number of column non-snow points in column filter - integer , intent(out) :: filter_nosnowc(:) ! column filter for non-snow points - ! - ! !LOCAL VARIABLES: - integer :: fc, c - !----------------------------------------------------------------------- - - ! Build snow/no-snow filters for other subroutines - - num_snowc = 0 - num_nosnowc = 0 - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if (col%snl(c) < 0) then - num_snowc = num_snowc + 1 - filter_snowc(num_snowc) = c - else - num_nosnowc = num_nosnowc + 1 - filter_nosnowc(num_nosnowc) = c - end if - end do - end subroutine BuildSnowFilter - - subroutine SnowHydrologySetControlForTesting( set_winddep_snowdensity, set_new_snow_density, & - set_reset_snow, set_reset_snow_glc, set_reset_snow_glc_ela) - ! - ! !DESCRIPTION: - ! Sets some of the control settings for SnowHydrologyMod - ! NOTE: THIS IS JUST HERE AS AN INTERFACE FOR UNIT TESTING. - ! - ! !USES: - ! - ! !ARGUMENTS: - logical, intent(in), optional :: set_winddep_snowdensity ! Set wind dependent snow density - integer, intent(in), optional :: set_new_snow_density ! snow density method - logical, intent(in), optional :: set_reset_snow ! whether to reset the snow pack, non-glc_mec points - logical, intent(in), optional :: set_reset_snow_glc ! whether to reset the snow pack, glc_mec points - real(r8), intent(in), optional :: set_reset_snow_glc_ela ! elevation below which to reset the snow pack if set_reset_snow_glc is true (m) - !----------------------------------------------------------------------- - if (present(set_winddep_snowdensity)) then - wind_dependent_snow_density = set_winddep_snowdensity - end if - if (present(set_new_snow_density)) then - new_snow_density = set_new_snow_density - end if - if (present(set_reset_snow)) then - reset_snow = set_reset_snow - end if - if (present(set_reset_snow_glc)) then - reset_snow_glc = set_reset_snow_glc - end if - if (present(set_reset_snow_glc_ela)) then - reset_snow_glc_ela = set_reset_snow_glc_ela - end if - - end subroutine SnowHydrologySetControlForTesting - -end module SnowHydrologyMod diff --git a/src/biogeophys/SnowSnicarMod.F90 b/src/biogeophys/SnowSnicarMod.F90 deleted file mode 100644 index d8a4ebdabb..0000000000 --- a/src/biogeophys/SnowSnicarMod.F90 +++ /dev/null @@ -1,1480 +0,0 @@ -module SnowSnicarMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate albedo of snow containing impurities - ! and the evolution of snow effective radius - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varcon , only : namec , tfrz - use shr_const_mod , only : SHR_CONST_RHOICE - use abortutils , only : endrun - use decompMod , only : bounds_type - use AerosolMod , only : snw_rds_min - use atm2lndType , only : atm2lnd_type - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use TemperatureType , only : temperature_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - ! - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SNICAR_RT ! Snow albedo and vertically-resolved solar absorption - public :: SnowAge_grain ! Snow effective grain size evolution - public :: SnowAge_init ! Initial read in of snow-aging file - public :: SnowOptics_init ! Initial read in of snow-optics file - ! - ! !PUBLIC DATA MEMBERS: - integer, public, parameter :: sno_nbr_aer = 8 ! number of aerosol species in snowpack - ! (indices described above) [nbr] - logical, public, parameter :: DO_SNO_OC = .false. ! parameter to include organic carbon (OC) - ! in snowpack radiative calculations - logical, public, parameter :: DO_SNO_AER = .true. ! parameter to include aerosols in snowpack radiative calculations - - ! !PRIVATE DATA MEMBERS: - integer, parameter :: numrad_snw = 5 ! number of spectral bands used in snow model [nbr] - integer, parameter :: nir_bnd_bgn = 2 ! first band index in near-IR spectrum [idx] - integer, parameter :: nir_bnd_end = 5 ! ending near-IR band index [idx] - - integer, parameter :: idx_Mie_snw_mx = 1471 ! number of effective radius indices used in Mie lookup table [idx] - integer, parameter :: idx_T_max = 11 ! maxiumum temperature index used in aging lookup table [idx] - integer, parameter :: idx_T_min = 1 ! minimum temperature index used in aging lookup table [idx] - integer, parameter :: idx_Tgrd_max = 31 ! maxiumum temperature gradient index used in aging lookup table [idx] - integer, parameter :: idx_Tgrd_min = 1 ! minimum temperature gradient index used in aging lookup table [idx] - integer, parameter :: idx_rhos_max = 8 ! maxiumum snow density index used in aging lookup table [idx] - integer, parameter :: idx_rhos_min = 1 ! minimum snow density index used in aging lookup table [idx] - - integer, parameter :: snw_rds_max_tbl = 1500 ! maximum effective radius defined in Mie lookup table [microns] - integer, parameter :: snw_rds_min_tbl = 30 ! minimium effective radius defined in Mie lookup table [microns] - integer, parameter :: snw_rds_min_int = nint(snw_rds_min) ! minimum allowed snow effective radius as integer [microns] - real(r8), parameter :: snw_rds_max = 1500._r8 ! maximum allowed snow effective radius [microns] - real(r8), parameter :: snw_rds_refrz = 1000._r8 ! effective radius of re-frozen snow [microns] - - real(r8), parameter :: min_snw = 1.0E-30_r8 ! minimum snow mass required for SNICAR RT calculation [kg m-2] - - !real(r8), parameter :: C1_liq_Brun89 = 1.28E-17_r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89 - real(r8), parameter :: C1_liq_Brun89 = 0._r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89: zeroed to accomodate dry snow aging - real(r8), parameter :: C2_liq_Brun89 = 4.22E-13_r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89: corrected for LWC in units of percent - - real(r8), parameter :: tim_cns_bc_rmv = 2.2E-8_r8 ! time constant for removal of BC in snow on sea-ice - ! [s-1] (50% mass removal/year) - real(r8), parameter :: tim_cns_oc_rmv = 2.2E-8_r8 ! time constant for removal of OC in snow on sea-ice - ! [s-1] (50% mass removal/year) - real(r8), parameter :: tim_cns_dst_rmv = 2.2E-8_r8 ! time constant for removal of dust in snow on sea-ice - ! [s-1] (50% mass removal/year) - - ! scaling of the snow aging rate (tuning option): - logical :: flg_snoage_scl = .false. ! flag for scaling the snow aging rate by some arbitrary factor - real(r8), parameter :: xdrdt = 1.0_r8 ! arbitrary factor applied to snow aging rate - - ! snow and aerosol Mie parameters: - ! (arrays declared here, but are set in iniTimeConst) - ! (idx_Mie_snw_mx is number of snow radii with defined parameters (i.e. from 30um to 1500um)) - - ! direct-beam weighted ice optical properties - real(r8) :: ss_alb_snw_drc(idx_Mie_snw_mx,numrad_snw) - real(r8) :: asm_prm_snw_drc(idx_Mie_snw_mx,numrad_snw) - real(r8) :: ext_cff_mss_snw_drc(idx_Mie_snw_mx,numrad_snw) - - ! diffuse radiation weighted ice optical properties - real(r8) :: ss_alb_snw_dfs(idx_Mie_snw_mx,numrad_snw) - real(r8) :: asm_prm_snw_dfs(idx_Mie_snw_mx,numrad_snw) - real(r8) :: ext_cff_mss_snw_dfs(idx_Mie_snw_mx,numrad_snw) - - ! hydrophiliic BC - real(r8) :: ss_alb_bc1(numrad_snw) - real(r8) :: asm_prm_bc1(numrad_snw) - real(r8) :: ext_cff_mss_bc1(numrad_snw) - - ! hydrophobic BC - real(r8) :: ss_alb_bc2(numrad_snw) - real(r8) :: asm_prm_bc2(numrad_snw) - real(r8) :: ext_cff_mss_bc2(numrad_snw) - - ! hydrophobic OC - real(r8) :: ss_alb_oc1(numrad_snw) - real(r8) :: asm_prm_oc1(numrad_snw) - real(r8) :: ext_cff_mss_oc1(numrad_snw) - - ! hydrophilic OC - real(r8) :: ss_alb_oc2(numrad_snw) - real(r8) :: asm_prm_oc2(numrad_snw) - real(r8) :: ext_cff_mss_oc2(numrad_snw) - - ! dust species 1: - real(r8) :: ss_alb_dst1(numrad_snw) - real(r8) :: asm_prm_dst1(numrad_snw) - real(r8) :: ext_cff_mss_dst1(numrad_snw) - - ! dust species 2: - real(r8) :: ss_alb_dst2(numrad_snw) - real(r8) :: asm_prm_dst2(numrad_snw) - real(r8) :: ext_cff_mss_dst2(numrad_snw) - - ! dust species 3: - real(r8) :: ss_alb_dst3(numrad_snw) - real(r8) :: asm_prm_dst3(numrad_snw) - real(r8) :: ext_cff_mss_dst3(numrad_snw) - - ! dust species 4: - real(r8) :: ss_alb_dst4(numrad_snw) - real(r8) :: asm_prm_dst4(numrad_snw) - real(r8) :: ext_cff_mss_dst4(numrad_snw) - - ! best-fit parameters for snow aging defined over: - ! 11 temperatures from 225 to 273 K - ! 31 temperature gradients from 0 to 300 K/m - ! 8 snow densities from 0 to 350 kg/m3 - ! (arrays declared here, but are set in iniTimeConst) - real(r8), pointer :: snowage_tau(:,:,:) ! (idx_rhos_max,idx_Tgrd_max,idx_T_max) - real(r8), pointer :: snowage_kappa(:,:,:) ! (idx_rhos_max,idx_Tgrd_max,idx_T_max) - real(r8), pointer :: snowage_drdt0(:,:,:) ! idx_rhos_max,idx_Tgrd_max,idx_T_max) - ! - ! !REVISION HISTORY: - ! Created by Mark Flanner - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SNICAR_RT (flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen, flg_slr_in, h2osno_liq, h2osno_ice, snw_rds, & - mss_cnc_aer_in, albsfc, albout, flx_abs, waterstate_inst) - ! - ! !DESCRIPTION: - ! Determine reflectance of, and vertically-resolved solar absorption in, - ! snow with impurities. - ! - ! Original references on physical models of snow reflectance include: - ! Wiscombe and Warren [1980] and Warren and Wiscombe [1980], - ! Journal of Atmospheric Sciences, 37, - ! - ! The multi-layer solution for multiple-scattering used here is from: - ! Toon et al. [1989], Rapid calculation of radiative heating rates - ! and photodissociation rates in inhomogeneous multiple scattering atmospheres, - ! J. Geophys. Res., 94, D13, 16287-16301 - ! - ! The implementation of the SNICAR model in CLM/CSIM is described in: - ! Flanner, M., C. Zender, J. Randerson, and P. Rasch [2007], - ! Present-day climate forcing and response from black carbon in snow, - ! J. Geophys. Res., 112, D11202, doi: 10.1029/2006JD008003 - ! - ! !USES: - use clm_varpar , only : nlevsno, numrad - use clm_time_manager , only : get_nstep - use shr_const_mod , only : SHR_CONST_PI - ! - ! !ARGUMENTS: - integer , intent(in) :: flg_snw_ice ! flag: =1 when called from CLM, =2 when called from CSIM - type (bounds_type), intent(in) :: bounds - integer , intent(in) :: num_nourbanc ! number of columns in non-urban filter - integer , intent(in) :: filter_nourbanc(:) ! column filter for non-urban points - real(r8) , intent(in) :: coszen ( bounds%begc: ) ! cosine of solar zenith angle for next time step (col) [unitless] - integer , intent(in) :: flg_slr_in ! flag: =1 for direct-beam incident flux,=2 for diffuse incident flux - real(r8) , intent(in) :: h2osno_liq ( bounds%begc: , -nlevsno+1: ) ! liquid water content (col,lyr) [kg/m2] - real(r8) , intent(in) :: h2osno_ice ( bounds%begc: , -nlevsno+1: ) ! ice content (col,lyr) [kg/m2] - integer , intent(in) :: snw_rds ( bounds%begc: , -nlevsno+1: ) ! snow effective radius (col,lyr) [microns, m^-6] - real(r8) , intent(in) :: mss_cnc_aer_in ( bounds%begc: , -nlevsno+1: , 1: ) ! mass concentration of all aerosol species (col,lyr,aer) [kg/kg] - real(r8) , intent(in) :: albsfc ( bounds%begc: , 1: ) ! albedo of surface underlying snow (col,bnd) [frc] - real(r8) , intent(out) :: albout ( bounds%begc: , 1: ) ! snow albedo, averaged into 2 bands (=0 if no sun or no snow) (col,bnd) [frc] - real(r8) , intent(out) :: flx_abs ( bounds%begc: , -nlevsno+1: , 1: ) ! absorbed flux in each layer per unit flux incident (col, lyr, bnd) - type(waterstate_type) , intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - ! - ! variables for snow radiative transfer calculations - - ! Local variables representing single-column values of arrays: - integer :: snl_lcl ! negative number of snow layers [nbr] - integer :: snw_rds_lcl(-nlevsno+1:0) ! snow effective radius [m^-6] - real(r8):: flx_slrd_lcl(1:numrad_snw) ! direct beam incident irradiance [W/m2] (set to 1) - real(r8):: flx_slri_lcl(1:numrad_snw) ! diffuse incident irradiance [W/m2] (set to 1) - real(r8):: mss_cnc_aer_lcl(-nlevsno+1:0,1:sno_nbr_aer) ! aerosol mass concentration (lyr,aer_nbr) [kg/kg] - real(r8):: h2osno_lcl ! total column snow mass [kg/m2] - real(r8):: h2osno_liq_lcl(-nlevsno+1:0) ! liquid water mass [kg/m2] - real(r8):: h2osno_ice_lcl(-nlevsno+1:0) ! ice mass [kg/m2] - real(r8):: albsfc_lcl(1:numrad_snw) ! albedo of underlying surface [frc] - real(r8):: ss_alb_snw_lcl(-nlevsno+1:0) ! single-scatter albedo of ice grains (lyr) [frc] - real(r8):: asm_prm_snw_lcl(-nlevsno+1:0) ! asymmetry parameter of ice grains (lyr) [frc] - real(r8):: ext_cff_mss_snw_lcl(-nlevsno+1:0) ! mass extinction coefficient of ice grains (lyr) [m2/kg] - real(r8):: ss_alb_aer_lcl(sno_nbr_aer) ! single-scatter albedo of aerosol species (aer_nbr) [frc] - real(r8):: asm_prm_aer_lcl(sno_nbr_aer) ! asymmetry parameter of aerosol species (aer_nbr) [frc] - real(r8):: ext_cff_mss_aer_lcl(sno_nbr_aer) ! mass extinction coefficient of aerosol species (aer_nbr) [m2/kg] - - - ! Other local variables - integer :: APRX_TYP ! two-stream approximation type - ! (1=Eddington, 2=Quadrature, 3=Hemispheric Mean) [nbr] - integer :: DELTA ! flag to use Delta approximation (Joseph, 1976) - ! (1= use, 0= don't use) - real(r8):: flx_wgt(1:numrad_snw) ! weights applied to spectral bands, - ! specific to direct and diffuse cases (bnd) [frc] - - integer :: flg_nosnl ! flag: =1 if there is snow, but zero snow layers, - ! =0 if at least 1 snow layer [flg] - integer :: trip ! flag: =1 to redo RT calculation if result is unrealistic - integer :: flg_dover ! defines conditions for RT redo (explained below) - - real(r8):: albedo ! temporary snow albedo [frc] - real(r8):: flx_sum ! temporary summation variable for NIR weighting - real(r8):: albout_lcl(numrad_snw) ! snow albedo by band [frc] - real(r8):: flx_abs_lcl(-nlevsno+1:1,numrad_snw)! absorbed flux per unit incident flux at top of snowpack (lyr,bnd) [frc] - - real(r8):: L_snw(-nlevsno+1:0) ! h2o mass (liquid+solid) in snow layer (lyr) [kg/m2] - real(r8):: tau_snw(-nlevsno+1:0) ! snow optical depth (lyr) [unitless] - real(r8):: L_aer(-nlevsno+1:0,sno_nbr_aer) ! aerosol mass in snow layer (lyr,nbr_aer) [kg/m2] - real(r8):: tau_aer(-nlevsno+1:0,sno_nbr_aer) ! aerosol optical depth (lyr,nbr_aer) [unitless] - real(r8):: tau_sum ! cumulative (snow+aerosol) optical depth [unitless] - real(r8):: tau_clm(-nlevsno+1:0) ! column optical depth from layer bottom to snowpack top (lyr) [unitless] - real(r8):: omega_sum ! temporary summation of single-scatter albedo of all aerosols [frc] - real(r8):: g_sum ! temporary summation of asymmetry parameter of all aerosols [frc] - - real(r8):: tau(-nlevsno+1:0) ! weighted optical depth of snow+aerosol layer (lyr) [unitless] - real(r8):: omega(-nlevsno+1:0) ! weighted single-scatter albedo of snow+aerosol layer (lyr) [frc] - real(r8):: g(-nlevsno+1:0) ! weighted asymmetry parameter of snow+aerosol layer (lyr) [frc] - real(r8):: tau_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) optical depth of snow+aerosol layer - ! (lyr) [unitless] - real(r8):: omega_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) SSA of snow+aerosol layer (lyr) [frc] - real(r8):: g_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) asymmetry paramater of snow+aerosol layer - ! (lyr) [frc] - - integer :: nstep ! current timestep [nbr] (debugging only) - integer :: g_idx, c_idx, l_idx ! gridcell, column, and landunit indices [idx] - integer :: bnd_idx ! spectral band index (1 <= bnd_idx <= numrad_snw) [idx] - integer :: rds_idx ! snow effective radius index for retrieving - ! Mie parameters from lookup table [idx] - integer :: snl_btm ! index of bottom snow layer (0) [idx] - integer :: snl_top ! index of top snow layer (-4 to 0) [idx] - integer :: fc ! column filter index - integer :: i ! layer index [idx] - integer :: j ! aerosol number index [idx] - integer :: n ! tridiagonal matrix index [idx] - integer :: m ! secondary layer index [idx] - - real(r8):: F_direct(-nlevsno+1:0) ! direct-beam radiation at bottom of layer interface (lyr) [W/m^2] - real(r8):: F_net(-nlevsno+1:0) ! net radiative flux at bottom of layer interface (lyr) [W/m^2] - real(r8):: F_abs(-nlevsno+1:0) ! net absorbed radiative energy (lyr) [W/m^2] - real(r8):: F_abs_sum ! total absorbed energy in column [W/m^2] - real(r8):: F_sfc_pls ! upward radiative flux at snowpack top [W/m^2] - real(r8):: F_btm_net ! net flux at bottom of snowpack [W/m^2] - real(r8):: F_sfc_net ! net flux at top of snowpack [W/m^2] - real(r8):: energy_sum ! sum of all energy terms; should be 0.0 [W/m^2] - real(r8):: F_direct_btm ! direct-beam radiation at bottom of snowpack [W/m^2] - real(r8):: mu_not ! cosine of solar zenith angle (used locally) [frc] - - integer :: err_idx ! counter for number of times through error loop [nbr] - real(r8):: lat_coord ! gridcell latitude (debugging only) - real(r8):: lon_coord ! gridcell longitude (debugging only) - integer :: sfctype ! underlying surface type (debugging only) - real(r8):: pi ! 3.1415... - - ! intermediate variables for radiative transfer approximation: - real(r8):: gamma1(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma2(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma3(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma4(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: lambda(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: GAMMA(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: mu_one ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: e1(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e2(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e3(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e4(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: C_pls_btm(-nlevsno+1:0) ! intermediate variable: upward flux at bottom interface (lyr) [W/m2] - real(r8):: C_mns_btm(-nlevsno+1:0) ! intermediate variable: downward flux at bottom interface (lyr) [W/m2] - real(r8):: C_pls_top(-nlevsno+1:0) ! intermediate variable: upward flux at top interface (lyr) [W/m2] - real(r8):: C_mns_top(-nlevsno+1:0) ! intermediate variable: downward flux at top interface (lyr) [W/m2] - real(r8):: A(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: B(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: D(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: E(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: AS(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: DS(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: X(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: Y(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osno_liq) == (/bounds%endc, 0/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osno_ice) == (/bounds%endc, 0/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(snw_rds) == (/bounds%endc, 0/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(mss_cnc_aer_in) == (/bounds%endc, 0, sno_nbr_aer/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsfc) == (/bounds%endc, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albout) == (/bounds%endc, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(flx_abs) == (/bounds%endc, 1, numrad/)), errMsg(sourcefile, __LINE__)) - - associate(& - snl => col%snl , & ! Input: [integer (:)] negative number of snow layers (col) [nbr] - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:)] snow liquid water equivalent (col) [kg/m2] - frac_sno => waterstate_inst%frac_sno_eff_col & ! Input: [real(r8) (:)] fraction of ground covered by snow (0 to 1) - ) - - ! Define constants - pi = SHR_CONST_PI - - ! always use Delta approximation for snow - DELTA = 1 - - ! Get current timestep - nstep = get_nstep() - - ! Loop over all non-urban columns - ! (when called from CSIM, there is only one column) - do fc = 1,num_nourbanc - c_idx = filter_nourbanc(fc) - - - ! Zero absorbed radiative fluxes: - do i=-nlevsno+1,1,1 - flx_abs_lcl(:,:) = 0._r8 - flx_abs(c_idx,i,:) = 0._r8 - enddo - - ! set snow/ice mass to be used for RT: - if (flg_snw_ice == 1) then - h2osno_lcl = h2osno(c_idx) - else - h2osno_lcl = h2osno_ice(c_idx,0) - endif - - - ! Qualifier for computing snow RT: - ! 1) sunlight from atmosphere model - ! 2) minimum amount of snow on ground. - ! Otherwise, set snow albedo to zero - if ((coszen(c_idx) > 0._r8) .and. (h2osno_lcl > min_snw)) then - - ! Set variables specific to CLM - if (flg_snw_ice == 1) then - ! If there is snow, but zero snow layers, we must create a layer locally. - ! This layer is presumed to have the fresh snow effective radius. - if (snl(c_idx) > -1) then - flg_nosnl = 1 - snl_lcl = -1 - h2osno_ice_lcl(0) = h2osno_lcl - h2osno_liq_lcl(0) = 0._r8 - snw_rds_lcl(0) = snw_rds_min_int - else - flg_nosnl = 0 - snl_lcl = snl(c_idx) - h2osno_liq_lcl(:) = h2osno_liq(c_idx,:) - h2osno_ice_lcl(:) = h2osno_ice(c_idx,:) - snw_rds_lcl(:) = snw_rds(c_idx,:) - endif - - snl_btm = 0 - snl_top = snl_lcl+1 - - ! for debugging only - l_idx = col%landunit(c_idx) - g_idx = col%gridcell(c_idx) - sfctype = lun%itype(l_idx) - lat_coord = grc%latdeg(g_idx) - lon_coord = grc%londeg(g_idx) - - - ! Set variables specific to CSIM - else - flg_nosnl = 0 - snl_lcl = -1 - h2osno_liq_lcl(:) = h2osno_liq(c_idx,:) - h2osno_ice_lcl(:) = h2osno_ice(c_idx,:) - snw_rds_lcl(:) = snw_rds(c_idx,:) - snl_btm = 0 - snl_top = 0 - sfctype = -1 - lat_coord = -90 - lon_coord = 0 - endif - - ! Set local aerosol array - do j=1,sno_nbr_aer - mss_cnc_aer_lcl(:,j) = mss_cnc_aer_in(c_idx,:,j) - enddo - - - ! Set spectral underlying surface albedos to their corresponding VIS or NIR albedos - albsfc_lcl(1) = albsfc(c_idx,1) - albsfc_lcl(nir_bnd_bgn:nir_bnd_end) = albsfc(c_idx,2) - - - ! Error check for snow grain size: - do i=snl_top,snl_btm,1 - if ((snw_rds_lcl(i) < snw_rds_min_tbl) .or. (snw_rds_lcl(i) > snw_rds_max_tbl)) then - write (iulog,*) "SNICAR ERROR: snow grain radius of ", snw_rds_lcl(i), " out of bounds." - write (iulog,*) "NSTEP= ", nstep - write (iulog,*) "flg_snw_ice= ", flg_snw_ice - write (iulog,*) "column: ", c_idx, " level: ", i, " snl(c)= ", snl_lcl - write (iulog,*) "lat= ", lat_coord, " lon= ", lon_coord - write (iulog,*) "h2osno(c)= ", h2osno_lcl - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - endif - enddo - - ! Incident flux weighting parameters - ! - sum of all VIS bands must equal 1 - ! - sum of all NIR bands must equal 1 - ! - ! Spectral bands (5-band case) - ! Band 1: 0.3-0.7um (VIS) - ! Band 2: 0.7-1.0um (NIR) - ! Band 3: 1.0-1.2um (NIR) - ! Band 4: 1.2-1.5um (NIR) - ! Band 5: 1.5-5.0um (NIR) - ! - ! The following weights are appropriate for surface-incident flux in a mid-latitude winter atmosphere - ! - ! 3-band weights - if (numrad_snw==3) then - ! Direct: - if (flg_slr_in == 1) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.66628670195247_r8 - flx_wgt(3) = 0.33371329804753_r8 - ! Diffuse: - elseif (flg_slr_in == 2) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.77887652162877_r8 - flx_wgt(3) = 0.22112347837123_r8 - endif - - ! 5-band weights - elseif(numrad_snw==5) then - ! Direct: - if (flg_slr_in == 1) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.49352158521175_r8 - flx_wgt(3) = 0.18099494230665_r8 - flx_wgt(4) = 0.12094898498813_r8 - flx_wgt(5) = 0.20453448749347_r8 - ! Diffuse: - elseif (flg_slr_in == 2) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.58581507618433_r8 - flx_wgt(3) = 0.20156903770812_r8 - flx_wgt(4) = 0.10917889346386_r8 - flx_wgt(5) = 0.10343699264369_r8 - endif - endif - - ! Loop over snow spectral bands - do bnd_idx = 1,numrad_snw - - mu_not = coszen(c_idx) ! must set here, because of error handling - flg_dover = 1 ! default is to redo - err_idx = 0 ! number of times through loop - - do while (flg_dover > 0) - - ! DEFAULT APPROXIMATIONS: - ! VIS: Delta-Eddington - ! NIR (all): Delta-Hemispheric Mean - ! WARNING: DO NOT USE DELTA-EDDINGTON FOR NIR DIFFUSE - this sometimes results in negative albedo - ! - ! ERROR CONDITIONS: - ! Conditions which cause "trip", resulting in redo of RT approximation: - ! 1. negative absorbed flux - ! 2. total absorbed flux greater than incident flux - ! 3. negative albedo - ! NOTE: These errors have only been encountered in spectral bands 4 and 5 - ! - ! ERROR HANDLING - ! 1st error (flg_dover=2): switch approximation (Edd->HM or HM->Edd) - ! 2nd error (flg_dover=3): change zenith angle by 0.02 (this happens about 1 in 10^6 cases) - ! 3rd error (flg_dover=4): switch approximation with new zenith - ! Subsequent errors: repeatedly change zenith and approximations... - - if (bnd_idx == 1) then - if (flg_dover == 2) then - APRX_TYP = 3 - elseif (flg_dover == 3) then - APRX_TYP = 1 - if (coszen(c_idx) > 0.5_r8) then - mu_not = mu_not - 0.02_r8 - else - mu_not = mu_not + 0.02_r8 - endif - elseif (flg_dover == 4) then - APRX_TYP = 3 - else - APRX_TYP = 1 - endif - - else - if (flg_dover == 2) then - APRX_TYP = 1 - elseif (flg_dover == 3) then - APRX_TYP = 3 - if (coszen(c_idx) > 0.5_r8) then - mu_not = mu_not - 0.02_r8 - else - mu_not = mu_not + 0.02_r8 - endif - elseif (flg_dover == 4) then - APRX_TYP = 1 - else - APRX_TYP = 3 - endif - - endif - - ! Set direct or diffuse incident irradiance to 1 - ! (This has to be within the bnd loop because mu_not is adjusted in rare cases) - if (flg_slr_in == 1) then - flx_slrd_lcl(bnd_idx) = 1._r8/(mu_not*pi) ! this corresponds to incident irradiance of 1.0 - flx_slri_lcl(bnd_idx) = 0._r8 - else - flx_slrd_lcl(bnd_idx) = 0._r8 - flx_slri_lcl(bnd_idx) = 1._r8 - endif - - ! Pre-emptive error handling: aerosols can reap havoc on these absorptive bands. - ! Since extremely high soot concentrations have a negligible effect on these bands, zero them. - if ( (numrad_snw == 5).and.((bnd_idx == 5).or.(bnd_idx == 4)) ) then - mss_cnc_aer_lcl(:,:) = 0._r8 - endif - - if ( (numrad_snw == 3).and.(bnd_idx == 3) ) then - mss_cnc_aer_lcl(:,:) = 0._r8 - endif - - ! Define local Mie parameters based on snow grain size and aerosol species, - ! retrieved from a lookup table. - if (flg_slr_in == 1) then - do i=snl_top,snl_btm,1 - rds_idx = snw_rds_lcl(i) - snw_rds_min_tbl + 1 - ! snow optical properties (direct radiation) - ss_alb_snw_lcl(i) = ss_alb_snw_drc(rds_idx,bnd_idx) - asm_prm_snw_lcl(i) = asm_prm_snw_drc(rds_idx,bnd_idx) - ext_cff_mss_snw_lcl(i) = ext_cff_mss_snw_drc(rds_idx,bnd_idx) - enddo - elseif (flg_slr_in == 2) then - do i=snl_top,snl_btm,1 - rds_idx = snw_rds_lcl(i) - snw_rds_min_tbl + 1 - ! snow optical properties (diffuse radiation) - ss_alb_snw_lcl(i) = ss_alb_snw_dfs(rds_idx,bnd_idx) - asm_prm_snw_lcl(i) = asm_prm_snw_dfs(rds_idx,bnd_idx) - ext_cff_mss_snw_lcl(i) = ext_cff_mss_snw_dfs(rds_idx,bnd_idx) - enddo - endif - - ! aerosol species 1 optical properties - ss_alb_aer_lcl(1) = ss_alb_bc1(bnd_idx) - asm_prm_aer_lcl(1) = asm_prm_bc1(bnd_idx) - ext_cff_mss_aer_lcl(1) = ext_cff_mss_bc1(bnd_idx) - - ! aerosol species 2 optical properties - ss_alb_aer_lcl(2) = ss_alb_bc2(bnd_idx) - asm_prm_aer_lcl(2) = asm_prm_bc2(bnd_idx) - ext_cff_mss_aer_lcl(2) = ext_cff_mss_bc2(bnd_idx) - - ! aerosol species 3 optical properties - ss_alb_aer_lcl(3) = ss_alb_oc1(bnd_idx) - asm_prm_aer_lcl(3) = asm_prm_oc1(bnd_idx) - ext_cff_mss_aer_lcl(3) = ext_cff_mss_oc1(bnd_idx) - - ! aerosol species 4 optical properties - ss_alb_aer_lcl(4) = ss_alb_oc2(bnd_idx) - asm_prm_aer_lcl(4) = asm_prm_oc2(bnd_idx) - ext_cff_mss_aer_lcl(4) = ext_cff_mss_oc2(bnd_idx) - - ! aerosol species 5 optical properties - ss_alb_aer_lcl(5) = ss_alb_dst1(bnd_idx) - asm_prm_aer_lcl(5) = asm_prm_dst1(bnd_idx) - ext_cff_mss_aer_lcl(5) = ext_cff_mss_dst1(bnd_idx) - - ! aerosol species 6 optical properties - ss_alb_aer_lcl(6) = ss_alb_dst2(bnd_idx) - asm_prm_aer_lcl(6) = asm_prm_dst2(bnd_idx) - ext_cff_mss_aer_lcl(6) = ext_cff_mss_dst2(bnd_idx) - - ! aerosol species 7 optical properties - ss_alb_aer_lcl(7) = ss_alb_dst3(bnd_idx) - asm_prm_aer_lcl(7) = asm_prm_dst3(bnd_idx) - ext_cff_mss_aer_lcl(7) = ext_cff_mss_dst3(bnd_idx) - - ! aerosol species 8 optical properties - ss_alb_aer_lcl(8) = ss_alb_dst4(bnd_idx) - asm_prm_aer_lcl(8) = asm_prm_dst4(bnd_idx) - ext_cff_mss_aer_lcl(8) = ext_cff_mss_dst4(bnd_idx) - - - ! 1. snow and aerosol layer column mass (L_snw, L_aer [kg/m^2]) - ! 2. optical Depths (tau_snw, tau_aer) - ! 3. weighted Mie properties (tau, omega, g) - - ! Weighted Mie parameters of each layer - do i=snl_top,snl_btm,1 - L_snw(i) = h2osno_ice_lcl(i)+h2osno_liq_lcl(i) - tau_snw(i) = L_snw(i)*ext_cff_mss_snw_lcl(i) - - do j=1,sno_nbr_aer - L_aer(i,j) = L_snw(i)*mss_cnc_aer_lcl(i,j) - tau_aer(i,j) = L_aer(i,j)*ext_cff_mss_aer_lcl(j) - enddo - - tau_sum = 0._r8 - omega_sum = 0._r8 - g_sum = 0._r8 - - do j=1,sno_nbr_aer - tau_sum = tau_sum + tau_aer(i,j) - omega_sum = omega_sum + (tau_aer(i,j)*ss_alb_aer_lcl(j)) - g_sum = g_sum + (tau_aer(i,j)*ss_alb_aer_lcl(j)*asm_prm_aer_lcl(j)) - enddo - - tau(i) = tau_sum + tau_snw(i) - omega(i) = (1/tau(i))*(omega_sum+(ss_alb_snw_lcl(i)*tau_snw(i))) - g(i) = (1/(tau(i)*omega(i)))*(g_sum+ (asm_prm_snw_lcl(i)*ss_alb_snw_lcl(i)*tau_snw(i))) - enddo - - ! DELTA transformations, if requested - if (DELTA == 1) then - do i=snl_top,snl_btm,1 - g_star(i) = g(i)/(1+g(i)) - omega_star(i) = ((1-(g(i)**2))*omega(i)) / (1-(omega(i)*(g(i)**2))) - tau_star(i) = (1-(omega(i)*(g(i)**2)))*tau(i) - enddo - else - do i=snl_top,snl_btm,1 - g_star(i) = g(i) - omega_star(i) = omega(i) - tau_star(i) = tau(i) - enddo - endif - - ! Total column optical depth: - ! tau_clm(i) = total optical depth above the bottom of layer i - tau_clm(snl_top) = 0._r8 - do i=snl_top+1,snl_btm,1 - tau_clm(i) = tau_clm(i-1)+tau_star(i-1) - enddo - - ! Direct radiation at bottom of snowpack: - F_direct_btm = albsfc_lcl(bnd_idx)*mu_not * & - exp(-(tau_clm(snl_btm)+tau_star(snl_btm))/mu_not)*pi*flx_slrd_lcl(bnd_idx) - - ! Intermediates - ! Gamma values are approximation-specific. - - ! Eddington - if (APRX_TYP==1) then - do i=snl_top,snl_btm,1 - gamma1(i) = (7-(omega_star(i)*(4+(3*g_star(i)))))/4 - gamma2(i) = -(1-(omega_star(i)*(4-(3*g_star(i)))))/4 - gamma3(i) = (2-(3*g_star(i)*mu_not))/4 - gamma4(i) = 1-gamma3(i) - mu_one = 0.5 - enddo - - ! Quadrature - elseif (APRX_TYP==2) then - do i=snl_top,snl_btm,1 - gamma1(i) = (3**0.5)*(2-(omega_star(i)*(1+g_star(i))))/2 - gamma2(i) = omega_star(i)*(3**0.5)*(1-g_star(i))/2 - gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2 - gamma4(i) = 1-gamma3(i) - mu_one = 1/(3**0.5) - enddo - - ! Hemispheric Mean - elseif (APRX_TYP==3) then - do i=snl_top,snl_btm,1 - gamma1(i) = 2 - (omega_star(i)*(1+g_star(i))) - gamma2(i) = omega_star(i)*(1-g_star(i)) - gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2 - gamma4(i) = 1-gamma3(i) - mu_one = 0.5 - enddo - endif - - ! Intermediates for tri-diagonal solution - do i=snl_top,snl_btm,1 - lambda(i) = sqrt(abs((gamma1(i)**2) - (gamma2(i)**2))) - GAMMA(i) = gamma2(i)/(gamma1(i)+lambda(i)) - - e1(i) = 1+(GAMMA(i)*exp(-lambda(i)*tau_star(i))) - e2(i) = 1-(GAMMA(i)*exp(-lambda(i)*tau_star(i))) - e3(i) = GAMMA(i) + exp(-lambda(i)*tau_star(i)) - e4(i) = GAMMA(i) - exp(-lambda(i)*tau_star(i)) - enddo !enddo over snow layers - - - ! Intermediates for tri-diagonal solution - do i=snl_top,snl_btm,1 - if (flg_slr_in == 1) then - - C_pls_btm(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-(tau_clm(i)+tau_star(i))/mu_not)* & - (((gamma1(i)-(1/mu_not))*gamma3(i))+ & - (gamma4(i)*gamma2(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_mns_btm(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-(tau_clm(i)+tau_star(i))/mu_not)* & - (((gamma1(i)+(1/mu_not))*gamma4(i))+ & - (gamma2(i)*gamma3(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_pls_top(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-tau_clm(i)/mu_not)*(((gamma1(i)-(1/mu_not))* & - gamma3(i))+(gamma4(i)*gamma2(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_mns_top(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-tau_clm(i)/mu_not)*(((gamma1(i)+(1/mu_not))* & - gamma4(i))+(gamma2(i)*gamma3(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - else - C_pls_btm(i) = 0._r8 - C_mns_btm(i) = 0._r8 - C_pls_top(i) = 0._r8 - C_mns_top(i) = 0._r8 - endif - enddo - - ! Coefficients for tridiaganol matrix solution - do i=2*snl_lcl+1,0,1 - - !Boundary values for i=1 and i=2*snl_lcl, specifics for i=odd and i=even - if (i==(2*snl_lcl+1)) then - A(i) = 0 - B(i) = e1(snl_top) - D(i) = -e2(snl_top) - E(i) = flx_slri_lcl(bnd_idx)-C_mns_top(snl_top) - - elseif(i==0) then - A(i) = e1(snl_btm)-(albsfc_lcl(bnd_idx)*e3(snl_btm)) - B(i) = e2(snl_btm)-(albsfc_lcl(bnd_idx)*e4(snl_btm)) - D(i) = 0 - E(i) = F_direct_btm-C_pls_btm(snl_btm)+(albsfc_lcl(bnd_idx)*C_mns_btm(snl_btm)) - - elseif(mod(i,2)==-1) then ! If odd and i>=3 (n=1 for i=3) - n=floor(i/2.0) - A(i) = (e2(n)*e3(n))-(e4(n)*e1(n)) - B(i) = (e1(n)*e1(n+1))-(e3(n)*e3(n+1)) - D(i) = (e3(n)*e4(n+1))-(e1(n)*e2(n+1)) - E(i) = (e3(n)*(C_pls_top(n+1)-C_pls_btm(n)))+(e1(n)*(C_mns_btm(n)-C_mns_top(n+1))) - - elseif(mod(i,2)==0) then ! If even and i<=2*snl_lcl - n=(i/2) - A(i) = (e2(n+1)*e1(n))-(e3(n)*e4(n+1)) - B(i) = (e2(n)*e2(n+1))-(e4(n)*e4(n+1)) - D(i) = (e1(n+1)*e4(n+1))-(e2(n+1)*e3(n+1)) - E(i) = (e2(n+1)*(C_pls_top(n+1)-C_pls_btm(n)))+(e4(n+1)*(C_mns_top(n+1)-C_mns_btm(n))) - endif - enddo - - AS(0) = A(0)/B(0) - DS(0) = E(0)/B(0) - - do i=-1,(2*snl_lcl+1),-1 - X(i) = 1/(B(i)-(D(i)*AS(i+1))) - AS(i) = A(i)*X(i) - DS(i) = (E(i)-(D(i)*DS(i+1)))*X(i) - enddo - - Y(2*snl_lcl+1) = DS(2*snl_lcl+1) - do i=(2*snl_lcl+2),0,1 - Y(i) = DS(i)-(AS(i)*Y(i-1)) - enddo - - ! Downward direct-beam and net flux (F_net) at the base of each layer: - do i=snl_top,snl_btm,1 - F_direct(i) = mu_not*pi*flx_slrd_lcl(bnd_idx)*exp(-(tau_clm(i)+tau_star(i))/mu_not) - F_net(i) = (Y(2*i-1)*(e1(i)-e3(i))) + (Y(2*i)*(e2(i)-e4(i))) + & - C_pls_btm(i) - C_mns_btm(i) - F_direct(i) - enddo - - ! Upward flux at snowpack top: - F_sfc_pls = (Y(2*snl_lcl+1)*(exp(-lambda(snl_top)*tau_star(snl_top))+ & - GAMMA(snl_top))) + (Y(2*snl_lcl+2)*(exp(-lambda(snl_top)* & - tau_star(snl_top))-GAMMA(snl_top))) + C_pls_top(snl_top) - - ! Net flux at bottom = absorbed radiation by underlying surface: - F_btm_net = -F_net(snl_btm) - - - ! Bulk column albedo and surface net flux - albedo = F_sfc_pls/((mu_not*pi*flx_slrd_lcl(bnd_idx))+flx_slri_lcl(bnd_idx)) - F_sfc_net = F_sfc_pls - ((mu_not*pi*flx_slrd_lcl(bnd_idx))+flx_slri_lcl(bnd_idx)) - - trip = 0 - ! Absorbed flux in each layer - do i=snl_top,snl_btm,1 - if(i==snl_top) then - F_abs(i) = F_net(i)-F_sfc_net - else - F_abs(i) = F_net(i)-F_net(i-1) - endif - flx_abs_lcl(i,bnd_idx) = F_abs(i) - - - ! ERROR check: negative absorption - if (flx_abs_lcl(i,bnd_idx) < -0.00001) then - trip = 1 - endif - enddo - - flx_abs_lcl(1,bnd_idx) = F_btm_net - - if (flg_nosnl == 1) then - ! If there are no snow layers (but still snow), all absorbed energy must be in top soil layer - !flx_abs_lcl(:,bnd_idx) = 0._r8 - !flx_abs_lcl(1,bnd_idx) = F_abs(0) + F_btm_net - - ! changed on 20070408: - ! OK to put absorbed energy in the fictitous snow layer because routine SurfaceRadiation - ! handles the case of no snow layers. Then, if a snow layer is addded between now and - ! SurfaceRadiation (called in CanopyHydrology), absorbed energy will be properly distributed. - flx_abs_lcl(0,bnd_idx) = F_abs(0) - flx_abs_lcl(1,bnd_idx) = F_btm_net - - endif - - !Underflow check (we've already tripped the error condition above) - do i=snl_top,1,1 - if (flx_abs_lcl(i,bnd_idx) < 0._r8) then - flx_abs_lcl(i,bnd_idx) = 0._r8 - endif - enddo - - F_abs_sum = 0._r8 - do i=snl_top,snl_btm,1 - F_abs_sum = F_abs_sum + F_abs(i) - enddo - - - !ERROR check: absorption greater than incident flux - ! (should make condition more generic than "1._r8") - if (F_abs_sum > 1._r8) then - trip = 1 - endif - - !ERROR check: - if ((albedo < 0._r8).and.(trip==0)) then - trip = 1 - endif - - ! Set conditions for redoing RT calculation - if ((trip == 1).and.(flg_dover == 1)) then - flg_dover = 2 - elseif ((trip == 1).and.(flg_dover == 2)) then - flg_dover = 3 - elseif ((trip == 1).and.(flg_dover == 3)) then - flg_dover = 4 - elseif((trip == 1).and.(flg_dover == 4).and.(err_idx < 20)) then - flg_dover = 3 - err_idx = err_idx + 1 - elseif((trip == 1).and.(flg_dover == 4).and.(err_idx >= 20)) then - flg_dover = 0 - write(iulog,*) "SNICAR ERROR: FOUND A WORMHOLE. STUCK IN INFINITE LOOP! Called from: ", flg_snw_ice - write(iulog,*) "SNICAR STATS: snw_rds(0)= ", snw_rds(c_idx,0) - write(iulog,*) "SNICAR STATS: L_snw(0)= ", L_snw(0) - write(iulog,*) "SNICAR STATS: h2osno= ", h2osno_lcl, " snl= ", snl_lcl - write(iulog,*) "SNICAR STATS: soot1(0)= ", mss_cnc_aer_lcl(0,1) - write(iulog,*) "SNICAR STATS: soot2(0)= ", mss_cnc_aer_lcl(0,2) - write(iulog,*) "SNICAR STATS: dust1(0)= ", mss_cnc_aer_lcl(0,3) - write(iulog,*) "SNICAR STATS: dust2(0)= ", mss_cnc_aer_lcl(0,4) - write(iulog,*) "SNICAR STATS: dust3(0)= ", mss_cnc_aer_lcl(0,5) - write(iulog,*) "SNICAR STATS: dust4(0)= ", mss_cnc_aer_lcl(0,6) - l_idx = col%landunit(c_idx) - write(iulog,*) "column index: ", c_idx - write(iulog,*) "landunit type", lun%itype(l_idx) - write(iulog,*) "frac_sno: ", frac_sno(c_idx) - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - else - flg_dover = 0 - endif - - enddo !enddo while (flg_dover > 0) - - ! Energy conservation check: - ! Incident direct+diffuse radiation equals (absorbed+bulk_transmitted+bulk_reflected) - energy_sum = (mu_not*pi*flx_slrd_lcl(bnd_idx)) + flx_slri_lcl(bnd_idx) - (F_abs_sum + F_btm_net + F_sfc_pls) - if (abs(energy_sum) > 0.00001_r8) then - write (iulog,"(a,e12.6,a,i6,a,i6)") "SNICAR ERROR: Energy conservation error of : ", energy_sum, & - " at timestep: ", nstep, " at column: ", c_idx - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - endif - - albout_lcl(bnd_idx) = albedo - - ! Check that albedo is less than 1 - if (albout_lcl(bnd_idx) > 1.0) then - - write (iulog,*) "SNICAR ERROR: Albedo > 1.0 at c: ", c_idx, " NSTEP= ",nstep - write (iulog,*) "SNICAR STATS: bnd_idx= ",bnd_idx - write (iulog,*) "SNICAR STATS: albout_lcl(bnd)= ",albout_lcl(bnd_idx), & - " albsfc_lcl(bnd_idx)= ",albsfc_lcl(bnd_idx) - write (iulog,*) "SNICAR STATS: landtype= ", sfctype - write (iulog,*) "SNICAR STATS: h2osno= ", h2osno_lcl, " snl= ", snl_lcl - write (iulog,*) "SNICAR STATS: coszen= ", coszen(c_idx), " flg_slr= ", flg_slr_in - - write (iulog,*) "SNICAR STATS: soot(-4)= ", mss_cnc_aer_lcl(-4,1) - write (iulog,*) "SNICAR STATS: soot(-3)= ", mss_cnc_aer_lcl(-3,1) - write (iulog,*) "SNICAR STATS: soot(-2)= ", mss_cnc_aer_lcl(-2,1) - write (iulog,*) "SNICAR STATS: soot(-1)= ", mss_cnc_aer_lcl(-1,1) - write (iulog,*) "SNICAR STATS: soot(0)= ", mss_cnc_aer_lcl(0,1) - - write (iulog,*) "SNICAR STATS: L_snw(-4)= ", L_snw(-4) - write (iulog,*) "SNICAR STATS: L_snw(-3)= ", L_snw(-3) - write (iulog,*) "SNICAR STATS: L_snw(-2)= ", L_snw(-2) - write (iulog,*) "SNICAR STATS: L_snw(-1)= ", L_snw(-1) - write (iulog,*) "SNICAR STATS: L_snw(0)= ", L_snw(0) - - write (iulog,*) "SNICAR STATS: snw_rds(-4)= ", snw_rds(c_idx,-4) - write (iulog,*) "SNICAR STATS: snw_rds(-3)= ", snw_rds(c_idx,-3) - write (iulog,*) "SNICAR STATS: snw_rds(-2)= ", snw_rds(c_idx,-2) - write (iulog,*) "SNICAR STATS: snw_rds(-1)= ", snw_rds(c_idx,-1) - write (iulog,*) "SNICAR STATS: snw_rds(0)= ", snw_rds(c_idx,0) - - call endrun(decomp_index=c_idx, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - endif - - enddo ! loop over wvl bands - - - ! Weight output NIR albedo appropriately - albout(c_idx,1) = albout_lcl(1) - flx_sum = 0._r8 - do bnd_idx= nir_bnd_bgn,nir_bnd_end - flx_sum = flx_sum + flx_wgt(bnd_idx)*albout_lcl(bnd_idx) - end do - albout(c_idx,2) = flx_sum / sum(flx_wgt(nir_bnd_bgn:nir_bnd_end)) - - ! Weight output NIR absorbed layer fluxes (flx_abs) appropriately - flx_abs(c_idx,:,1) = flx_abs_lcl(:,1) - do i=snl_top,1,1 - flx_sum = 0._r8 - do bnd_idx= nir_bnd_bgn,nir_bnd_end - flx_sum = flx_sum + flx_wgt(bnd_idx)*flx_abs_lcl(i,bnd_idx) - enddo - flx_abs(c_idx,i,2) = flx_sum / sum(flx_wgt(nir_bnd_bgn:nir_bnd_end)) - end do - - ! If snow < minimum_snow, but > 0, and there is sun, set albedo to underlying surface albedo - elseif ( (coszen(c_idx) > 0._r8) .and. (h2osno_lcl < min_snw) .and. (h2osno_lcl > 0._r8) ) then - albout(c_idx,1) = albsfc(c_idx,1) - albout(c_idx,2) = albsfc(c_idx,2) - - ! There is either zero snow, or no sun - else - albout(c_idx,1) = 0._r8 - albout(c_idx,2) = 0._r8 - endif ! if column has snow and coszen > 0 - - enddo ! loop over all columns - - end associate - - end subroutine SNICAR_RT - - !----------------------------------------------------------------------- - subroutine SnowAge_grain(bounds, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc, & - waterflux_inst, waterstate_inst, temperature_inst, atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Updates the snow effective grain size (radius). - ! Contributions to grain size evolution are from: - ! 1. vapor redistribution (dry snow) - ! 2. liquid water redistribution (wet snow) - ! 3. re-freezing of liquid water - ! - ! Vapor redistribution: Method is to retrieve 3 best-bit parameters that - ! depend on snow temperature, temperature gradient, and density, - ! that are derived from the microphysical model described in: - ! Flanner and Zender (2006), Linking snowpack microphysics and albedo - ! evolution, J. Geophys. Res., 111, D12208, doi:10.1029/2005JD006834. - ! The parametric equation has the form: - ! dr/dt = drdt_0*(tau/(dr_fresh+tau))^(1/kappa), where: - ! r is the effective radius, - ! tau and kappa are best-fit parameters, - ! drdt_0 is the initial rate of change of effective radius, and - ! dr_fresh is the difference between the current and fresh snow states - ! (r_current - r_fresh). - ! - ! Liquid water redistribution: Apply the grain growth function from: - ! Brun, E. (1989), Investigation of wet-snow metamorphism in respect of - ! liquid-water content, Annals of Glaciology, 13, 22-26. - ! There are two parameters that describe the grain growth rate as - ! a function of snow liquid water content (LWC). The "LWC=0" parameter - ! is zeroed here because we are accounting for dry snowing with a - ! different representation - ! - ! Re-freezing of liquid water: Assume that re-frozen liquid water clumps - ! into an arbitrarily large effective grain size (snw_rds_refrz). - ! The phenomenon is observed (Grenfell), but so far unquantified, as far as - ! I am aware. - ! - ! !USES: - use clm_time_manager , only : get_step_size, get_nstep - use clm_varpar , only : nlevsno - use clm_varcon , only : spval - use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_PI - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_snowc ! number of column snow points in column filter - integer , intent(in) :: filter_snowc(:) ! column filter for snow points - integer , intent(in) :: num_nosnowc ! number of column non-snow points in column filter - integer , intent(in) :: filter_nosnowc(:) ! column filter for non-snow points - type(waterflux_type) , intent(in) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - ! - ! !LOCAL VARIABLES: - integer :: snl_top ! top snow layer index [idx] - integer :: snl_btm ! bottom snow layer index [idx] - integer :: i ! layer index [idx] - integer :: c_idx ! column index [idx] - integer :: fc ! snow column filter index [idx] - integer :: T_idx ! snow aging lookup table temperature index [idx] - integer :: Tgrd_idx ! snow aging lookup table temperature gradient index [idx] - integer :: rhos_idx ! snow aging lookup table snow density index [idx] - real(r8) :: t_snotop ! temperature at upper layer boundary [K] - real(r8) :: t_snobtm ! temperature at lower layer boundary [K] - real(r8) :: dTdz(bounds%begc:bounds%endc,-nlevsno:0) ! snow temperature gradient (col,lyr) [K m-1] - real(r8) :: bst_tau ! snow aging parameter retrieved from lookup table [hour] - real(r8) :: bst_kappa ! snow aging parameter retrieved from lookup table [unitless] - real(r8) :: bst_drdt0 ! snow aging parameter retrieved from lookup table [um hr-1] - real(r8) :: dr ! incremental change in snow effective radius [um] - real(r8) :: dr_wet ! incremental change in snow effective radius from wet growth [um] - real(r8) :: dr_fresh ! difference between fresh snow r_e and current r_e [um] - real(r8) :: newsnow ! fresh snowfall [kg m-2] - real(r8) :: refrzsnow ! re-frozen snow [kg m-2] - real(r8) :: frc_newsnow ! fraction of layer mass that is new snow [frc] - real(r8) :: frc_oldsnow ! fraction of layer mass that is old snow [frc] - real(r8) :: frc_refrz ! fraction of layer mass that is re-frozen snow [frc] - real(r8) :: frc_liq ! fraction of layer mass that is liquid water[frc] - real(r8) :: dtime ! land model time step [sec] - real(r8) :: rhos ! snow density [kg m-3] - real(r8) :: h2osno_lyr ! liquid + solid H2O in snow layer [kg m-2] - real(r8) :: cdz(-nlevsno+1:0) ! column average layer thickness [m] - real(r8) :: snw_rds_fresh ! fresh snow radius [microns] - !--------------------------------------------------------------------------! - - associate( & - snl => col%snl , & ! Input: [integer (:) ] negative number of snow layers (col) [nbr] - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (col,lyr) [m] - - qflx_snow_grnd_col => waterflux_inst%qflx_snow_grnd_col , & ! Input: [real(r8) (:) ] snow on ground after interception (col) [kg m-2 s-1] - qflx_snofrz_lyr => waterflux_inst%qflx_snofrz_lyr_col , & ! Input: [real(r8) (:,:) ] snow freezing rate (col,lyr) [kg m-2 s-1] - - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (col) [mm H2O] - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water content (col,lyr) [kg m-2] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice content (col,lyr) [kg m-2] - snw_rds => waterstate_inst%snw_rds_col , & ! Output: [real(r8) (:,:) ] effective grain radius (col,lyr) [microns, m-6] - snw_rds_top => waterstate_inst%snw_rds_top_col , & ! Output: [real(r8) (:) ] effective grain radius, top layer (col) [microns, m-6] - sno_liq_top => waterstate_inst%sno_liq_top_col , & ! Output: [real(r8) (:) ] liquid water fraction (mass) in top snow layer (col) [frc] - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil and snow temperature (col,lyr) [K] - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (col) [K] - snot_top => temperature_inst%snot_top_col , & ! Output: [real(r8) (:) ] temperature in top snow layer (col) [K] - dTdz_top => temperature_inst%dTdz_top_col & ! Output: [real(r8) (:) ] temperature gradient in top layer (col) [K m-1] - ) - - - ! set timestep and step interval - dtime = get_step_size() - - ! loop over columns that have at least one snow layer - do fc = 1, num_snowc - c_idx = filter_snowc(fc) - - snl_btm = 0 - snl_top = snl(c_idx) + 1 - - cdz(snl_top:snl_btm)=frac_sno(c_idx)*dz(c_idx,snl_top:snl_btm) - - ! loop over snow layers - do i=snl_top,snl_btm,1 - ! - !********** 1. DRY SNOW AGING *********** - ! - h2osno_lyr = h2osoi_liq(c_idx,i) + h2osoi_ice(c_idx,i) - - ! temperature gradient - if (i == snl_top) then - ! top layer - t_snotop = t_soisno(c_idx,snl_top) - t_snobtm = (t_soisno(c_idx,i+1)*dz(c_idx,i) & - + t_soisno(c_idx,i)*dz(c_idx,i+1)) & - / (dz(c_idx,i)+dz(c_idx,i+1)) - else - t_snotop = (t_soisno(c_idx,i-1)*dz(c_idx,i) & - + t_soisno(c_idx,i)*dz(c_idx,i-1)) & - / (dz(c_idx,i)+dz(c_idx,i-1)) - t_snobtm = (t_soisno(c_idx,i+1)*dz(c_idx,i) & - + t_soisno(c_idx,i)*dz(c_idx,i+1)) & - / (dz(c_idx,i)+dz(c_idx,i+1)) - endif - - dTdz(c_idx,i) = abs((t_snotop - t_snobtm) / cdz(i)) - - ! snow density - rhos = (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)) / cdz(i) - - ! make sure rhos doesn't drop below 50 (see rhos_idx below) - rhos=max(50._r8,rhos) - - ! best-fit table indecies - T_idx = nint((t_soisno(c_idx,i)-223) / 5) + 1 - Tgrd_idx = nint(dTdz(c_idx,i) / 10) + 1 - rhos_idx = nint((rhos-50) / 50) + 1 - - ! boundary check: - if (T_idx < idx_T_min) then - T_idx = idx_T_min - endif - if (T_idx > idx_T_max) then - T_idx = idx_T_max - endif - if (Tgrd_idx < idx_Tgrd_min) then - Tgrd_idx = idx_Tgrd_min - endif - if (Tgrd_idx > idx_Tgrd_max) then - Tgrd_idx = idx_Tgrd_max - endif - if (rhos_idx < idx_rhos_min) then - rhos_idx = idx_rhos_min - endif - if (rhos_idx > idx_rhos_max) then - rhos_idx = idx_rhos_max - endif - - ! best-fit parameters - bst_tau = snowage_tau(rhos_idx,Tgrd_idx,T_idx) - bst_kappa = snowage_kappa(rhos_idx,Tgrd_idx,T_idx) - bst_drdt0 = snowage_drdt0(rhos_idx,Tgrd_idx,T_idx) - - - !LvK extra boundary check, to prevent when using old restart file with lower snw_rds_min than current run - if (snw_rds(c_idx,i) < snw_rds_min) then - snw_rds(c_idx,i) = snw_rds_min - endif - - ! change in snow effective radius, using best-fit parameters - dr_fresh = snw_rds(c_idx,i)-snw_rds_min - dr = (bst_drdt0*(bst_tau/(dr_fresh+bst_tau))**(1/bst_kappa)) * (dtime/3600) - - ! - !********** 2. WET SNOW AGING *********** - ! - ! We are assuming wet and dry evolution occur simultaneously, and - ! the contributions from both can be summed. - ! This is justified by setting the linear offset constant C1_liq_Brun89 to zero [Brun, 1989] - - ! liquid water faction - frc_liq = min(0.1_r8, (h2osoi_liq(c_idx,i) / (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)))) - - !dr_wet = 1E6_r8*(dtime*(C1_liq_Brun89 + C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*(snw_rds(c_idx,i)/1E6)**(2))) - !simplified, units of microns: - dr_wet = 1E18_r8*(dtime*(C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*snw_rds(c_idx,i)**(2))) - - dr = dr + dr_wet - - ! - !********** 3. SNOWAGE SCALING (TURNED OFF BY DEFAULT) ************* - ! - ! Multiply rate of change of effective radius by some constant, xdrdt - if (flg_snoage_scl) then - dr = dr*xdrdt - endif - - - ! - !********** 4. INCREMENT EFFECTIVE RADIUS, ACCOUNTING FOR: *********** - ! DRY AGING - ! WET AGING - ! FRESH SNOW - ! RE-FREEZING - ! - ! new snowfall [kg/m2] - newsnow = max(0._r8, (qflx_snow_grnd_col(c_idx)*dtime)) - - ! snow that has re-frozen [kg/m2] - refrzsnow = max(0._r8, (qflx_snofrz_lyr(c_idx,i)*dtime)) - - ! fraction of layer mass that is re-frozen - frc_refrz = refrzsnow / h2osno_lyr - - ! fraction of layer mass that is new snow - if (i == snl_top) then - frc_newsnow = newsnow / h2osno_lyr - else - frc_newsnow = 0._r8 - endif - - if ((frc_refrz + frc_newsnow) > 1._r8) then - frc_refrz = frc_refrz / (frc_refrz + frc_newsnow) - frc_newsnow = 1._r8 - frc_refrz - frc_oldsnow = 0._r8 - else - frc_oldsnow = 1._r8 - frc_refrz - frc_newsnow - endif - - ! temperature dependent fresh grain size - snw_rds_fresh = FreshSnowRadius(c_idx, atm2lnd_inst) - - ! mass-weighted mean of fresh snow, old snow, and re-frozen snow effective radius - snw_rds(c_idx,i) = (snw_rds(c_idx,i)+dr)*frc_oldsnow + snw_rds_fresh*frc_newsnow + snw_rds_refrz*frc_refrz - ! - !********** 5. CHECK BOUNDARIES *********** - ! - ! boundary check - if (snw_rds(c_idx,i) < snw_rds_min) then - snw_rds(c_idx,i) = snw_rds_min - endif - - if (snw_rds(c_idx,i) > snw_rds_max) then - snw_rds(c_idx,i) = snw_rds_max - end if - - ! set top layer variables for history files - if (i == snl_top) then - snot_top(c_idx) = t_soisno(c_idx,i) - dTdz_top(c_idx) = dTdz(c_idx,i) - snw_rds_top(c_idx) = snw_rds(c_idx,i) - sno_liq_top(c_idx) = h2osoi_liq(c_idx,i) / (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)) - endif - - enddo - enddo - - ! Special case: snow on ground, but not enough to have defined a snow layer: - ! set snw_rds to fresh snow grain size: - do fc = 1, num_nosnowc - c_idx = filter_nosnowc(fc) - if (h2osno(c_idx) > 0._r8) then - snw_rds(c_idx,0) = snw_rds_min - endif - enddo - - end associate - - end subroutine SnowAge_grain - - - !----------------------------------------------------------------------- - real(r8) function FreshSnowRadius(c_idx, atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Returns fresh snow grain radius, which is linearly dependent on temperature. - ! This is implemented to remedy an outstanding bias that SNICAR has in initial - ! grain size. See e.g. Sandells et al, 2017 for a discussion (10.5194/tc-11-229-2017). - ! - ! Yang et al. (2017), 10.1016/j.jqsrt.2016.03.033 - ! discusses grain size observations, which suggest a temperature dependence. - ! - ! !REVISION HISTORY: - ! Author: Leo VanKampenhout - ! - ! !USES: - use AerosolMod , only : fresh_snw_rds_max - ! !ARGUMENTS: - integer, intent(in) :: c_idx ! column index - type(atm2lnd_type) , intent(in) :: atm2lnd_inst ! Forcing from atmosphere - ! - ! !LOCAL VARIABLES: - !----------------------------------------------------------------------- - real(r8), parameter :: tmin = tfrz - 30._r8 ! start of linear ramp - real(r8), parameter :: tmax = tfrz - 0._r8 ! end of linear ramp - real(r8), parameter :: gs_min = snw_rds_min ! minimum value - real(r8) :: gs_max ! maximum value - - associate( & - forc_t => atm2lnd_inst%forc_t_downscaled_col & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - ) - if ( fresh_snw_rds_max <= snw_rds_min )then - FreshSnowRadius = snw_rds_min - else - gs_max = fresh_snw_rds_max - - if (forc_t(c_idx) < tmin) then - FreshSnowRadius = gs_min - else if (forc_t(c_idx) > tmax) then - FreshSnowRadius = gs_max - else - FreshSnowRadius = (tmax-forc_t(c_idx))/(tmax-tmin)*gs_min + & - (forc_t(c_idx)-tmin)/(tmax-tmin)*gs_max - end if - end if - - end associate - - end function FreshSnowRadius - - - - !----------------------------------------------------------------------- - subroutine SnowOptics_init( ) - - use fileutils , only : getfil - use CLM_varctl , only : fsnowoptics - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - - type(file_desc_t) :: ncid ! netCDF file id - character(len=256) :: locfn ! local filename - character(len= 32) :: subname = 'SnowOptics_init' ! subroutine name - integer :: ier ! error status - - ! - ! Open optics file: - if(masterproc) write(iulog,*) 'Attempting to read snow optical properties .....' - call getfil (fsnowoptics, locfn, 0) - call ncd_pio_openfile(ncid, locfn, 0) - if(masterproc) write(iulog,*) subname,trim(fsnowoptics) - - ! direct-beam snow Mie parameters: - call ncd_io('ss_alb_ice_drc', ss_alb_snw_drc, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ice_drc',asm_prm_snw_drc, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ice_drc', ext_cff_mss_snw_drc, 'read', ncid, posNOTonfile=.true.) - - ! diffuse snow Mie parameters - call ncd_io( 'ss_alb_ice_dfs', ss_alb_snw_dfs, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ice_dfs', asm_prm_snw_dfs, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ice_dfs', ext_cff_mss_snw_dfs, 'read', ncid, posNOTonfile=.true.) - - ! BC species 1 Mie parameters - call ncd_io( 'ss_alb_bcphil', ss_alb_bc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_bcphil', asm_prm_bc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_bcphil', ext_cff_mss_bc1, 'read', ncid, posNOTonfile=.true.) - - ! BC species 2 Mie parameters - call ncd_io( 'ss_alb_bcphob', ss_alb_bc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_bcphob', asm_prm_bc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_bcphob', ext_cff_mss_bc2, 'read', ncid, posNOTonfile=.true.) - - ! OC species 1 Mie parameters - call ncd_io( 'ss_alb_ocphil', ss_alb_oc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ocphil', asm_prm_oc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ocphil', ext_cff_mss_oc1, 'read', ncid, posNOTonfile=.true.) - - ! OC species 2 Mie parameters - call ncd_io( 'ss_alb_ocphob', ss_alb_oc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ocphob', asm_prm_oc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ocphob', ext_cff_mss_oc2, 'read', ncid, posNOTonfile=.true.) - - ! dust species 1 Mie parameters - call ncd_io( 'ss_alb_dust01', ss_alb_dst1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust01', asm_prm_dst1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust01', ext_cff_mss_dst1, 'read', ncid, posNOTonfile=.true.) - - ! dust species 2 Mie parameters - call ncd_io( 'ss_alb_dust02', ss_alb_dst2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust02', asm_prm_dst2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust02', ext_cff_mss_dst2, 'read', ncid, posNOTonfile=.true.) - - ! dust species 3 Mie parameters - call ncd_io( 'ss_alb_dust03', ss_alb_dst3, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust03', asm_prm_dst3, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust03', ext_cff_mss_dst3, 'read', ncid, posNOTonfile=.true.) - - ! dust species 4 Mie parameters - call ncd_io( 'ss_alb_dust04', ss_alb_dst4, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust04', asm_prm_dst4, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust04', ext_cff_mss_dst4, 'read', ncid, posNOTonfile=.true.) - - - call ncd_pio_closefile(ncid) - if (masterproc) then - - write(iulog,*) 'Successfully read snow optical properties' - ! print some diagnostics: - write (iulog,*) 'SNICAR: Mie single scatter albedos for direct-beam ice, rds=100um: ', & - ss_alb_snw_drc(71,1), ss_alb_snw_drc(71,2), ss_alb_snw_drc(71,3), & - ss_alb_snw_drc(71,4), ss_alb_snw_drc(71,5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for diffuse ice, rds=100um: ', & - ss_alb_snw_dfs(71,1), ss_alb_snw_dfs(71,2), ss_alb_snw_dfs(71,3), & - ss_alb_snw_dfs(71,4), ss_alb_snw_dfs(71,5) - if (DO_SNO_OC) then - write (iulog,*) 'SNICAR: Including OC aerosols from snow radiative transfer calculations' - else - write (iulog,*) 'SNICAR: Excluding OC aerosols from snow radiative transfer calculations' - endif - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophillic BC: ', & - ss_alb_bc1(1), ss_alb_bc1(2), ss_alb_bc1(3), ss_alb_bc1(4), ss_alb_bc1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophobic BC: ', & - ss_alb_bc2(1), ss_alb_bc2(2), ss_alb_bc2(3), ss_alb_bc2(4), ss_alb_bc2(5) - if (DO_SNO_OC) then - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophillic OC: ', & - ss_alb_oc1(1), ss_alb_oc1(2), ss_alb_oc1(3), ss_alb_oc1(4), ss_alb_oc1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophobic OC: ', & - ss_alb_oc2(1), ss_alb_oc2(2), ss_alb_oc2(3), ss_alb_oc2(4), ss_alb_oc2(5) - endif - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 1: ', & - ss_alb_dst1(1), ss_alb_dst1(2), ss_alb_dst1(3), ss_alb_dst1(4), ss_alb_dst1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 2: ', & - ss_alb_dst2(1), ss_alb_dst2(2), ss_alb_dst2(3), ss_alb_dst2(4), ss_alb_dst2(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 3: ', & - ss_alb_dst3(1), ss_alb_dst3(2), ss_alb_dst3(3), ss_alb_dst3(4), ss_alb_dst3(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 4: ', & - ss_alb_dst4(1), ss_alb_dst4(2), ss_alb_dst4(3), ss_alb_dst4(4), ss_alb_dst4(5) - write(iulog,*) - end if - - end subroutine SnowOptics_init - - !----------------------------------------------------------------------- - subroutine SnowAge_init( ) - use CLM_varctl , only : fsnowaging - use fileutils , only : getfil - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - - type(file_desc_t) :: ncid ! netCDF file id - character(len=256) :: locfn ! local filename - character(len= 32) :: subname = 'SnowOptics_init' ! subroutine name - integer :: varid ! netCDF id's - integer :: ier ! error status - - ! Open snow aging (effective radius evolution) file: - allocate(snowage_tau(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - allocate(snowage_kappa(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - allocate(snowage_drdt0(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - - if(masterproc) write(iulog,*) 'Attempting to read snow aging parameters .....' - call getfil (fsnowaging, locfn, 0) - call ncd_pio_openfile(ncid, locfn, 0) - if(masterproc) write(iulog,*) subname,trim(fsnowaging) - - ! snow aging parameters - - call ncd_io('tau', snowage_tau, 'read', ncid, posNOTonfile=.true.) - call ncd_io('kappa', snowage_kappa, 'read', ncid, posNOTonfile=.true.) - call ncd_io('drdsdt0', snowage_drdt0, 'read', ncid, posNOTonfile=.true.) - - call ncd_pio_closefile(ncid) - if (masterproc) then - - write(iulog,*) 'Successfully read snow aging properties' - - ! print some diagnostics: - write (iulog,*) 'SNICAR: snowage tau for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_tau(3,11,9) - write (iulog,*) 'SNICAR: snowage kappa for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_kappa(3,11,9) - write (iulog,*) 'SNICAR: snowage dr/dt_0 for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_drdt0(3,11,9) - endif - - end subroutine SnowAge_init - - end module SnowSnicarMod diff --git a/src/biogeophys/SoilFluxesMod.F90 b/src/biogeophys/SoilFluxesMod.F90 deleted file mode 100644 index fefb8e617f..0000000000 --- a/src/biogeophys/SoilFluxesMod.F90 +++ /dev/null @@ -1,461 +0,0 @@ -module SoilFluxesMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Updates surface fluxes based on the new ground temperature. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : iulog - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, max_patch_per_col - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use SolarAbsorbedType , only : solarabs_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilFluxes ! Calculate soil/snow and ground temperatures - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilFluxes (bounds, num_urbanl, filter_urbanl, & - num_urbanp, filter_urbanp, & - num_nolakec, filter_nolakec, num_nolakep, filter_nolakep, & - atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, & - waterstate_inst, energyflux_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Update surface fluxes based on the new ground temperature - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb - use landunit_varcon , only : istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv - use subgridAveMod , only : p2c - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - integer , intent(in) :: num_urbanp ! number of urban pfts in clump - integer , intent(in) :: filter_urbanp(:) ! urban pft filter - integer , intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(temperature_type) , intent(in) :: temperature_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,g,j,pi,l ! indices - integer :: fc,fp ! lake filtered column and pft indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: egsmax(bounds%begc:bounds%endc) ! max. evaporation which soil can provide at one time step - real(r8) :: egirat(bounds%begc:bounds%endc) ! ratio of topsoil_evap_tot : egsmax - real(r8) :: tinc(bounds%begc:bounds%endc) ! temperature difference of two time step - real(r8) :: sumwt(bounds%begc:bounds%endc) ! temporary - real(r8) :: evaprat(bounds%begp:bounds%endp) ! ratio of qflx_evap_soi/topsoil_evap_tot - real(r8) :: save_qflx_evap_soi ! temporary storage for qflx_evap_soi - real(r8) :: topsoil_evap_tot(bounds%begc:bounds%endc) ! column-level total evaporation from top soil layer - real(r8) :: eflx_lwrad_del(bounds%begp:bounds%endp) ! update due to eflx_lwrad - real(r8) :: t_grnd0(bounds%begc:bounds%endc) ! t_grnd of previous time step - real(r8) :: lw_grnd - real(r8) :: fsno_eff - !----------------------------------------------------------------------- - - associate( & - eflx_h2osfc_to_snow_col => energyflux_inst%eflx_h2osfc_to_snow_col , & ! Input: [real(r8) (:) ] col snow melt to h2osfc heat flux (W/m**2) - - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of veg not covered by snow (0/1 now) [-] - - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) (new) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) - - sabg_soil => solarabs_inst%sabg_soil_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by soil (W/m**2) - sabg_snow => solarabs_inst%sabg_snow_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by snow (W/m**2) - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - - emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity -! emv => temperature_inst%emv_patch , & ! Input: [real(r8) (:) ] vegetation emissivity -! t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (Kelvin) - t_skin_patch => temperature_inst%t_skin_patch , & ! Output: [real(r8) (:) ] patch skin temperature (K) - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] soil/snow temperature before update - t_h2osfc_bef => temperature_inst%t_h2osfc_bef_col , & ! Input: [real(r8) (:) ] saved surface water temperature - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - xmf => temperature_inst%xmf_col , & ! Input: [real(r8) (:) ] - xmf_h2osfc => temperature_inst%xmf_h2osfc_col , & ! Input: [real(r8) (:) ] - fact => temperature_inst%fact_col , & ! Input: [real(r8) (:) ] - c_h2osfc => temperature_inst%c_h2osfc_col , & ! Input: [real(r8) (:) ] - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of vapor of water (or sublimation) [j/kg] - eflx_building_heat_errsoi=> energyflux_inst%eflx_building_heat_errsoi_col , & ! Input: [real(r8) (:)] heat flux to interior surface of walls and roof for errsoi check (W m-2) - eflx_wasteheat_patch => energyflux_inst%eflx_wasteheat_patch , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac_patch => energyflux_inst%eflx_heat_from_ac_patch , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_traffic_patch => energyflux_inst%eflx_traffic_patch , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - dlrad => energyflux_inst%dlrad_patch , & ! Input: [real(r8) (:) ] downward longwave radiation below the canopy [W/m2] - ulrad => energyflux_inst%ulrad_patch , & ! Input: [real(r8) (:) ] upward longwave radiation above the canopy [W/m2] - cgrnds => energyflux_inst%cgrnds_patch , & ! Input: [real(r8) (:) ] deriv, of soil sensible heat flux wrt soil temp [w/m2/k] - cgrndl => energyflux_inst%cgrndl_patch , & ! Input: [real(r8) (:) ] deriv of soil latent heat flux wrt soil temp [w/m**2/k] - - qflx_evap_can => waterflux_inst%qflx_evap_can_patch , & ! Output: [real(r8) (:) ] evaporation from leaves and stems (mm H2O/s) (+ = to atm) - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_evap_veg => waterflux_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm) - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_veg + qflx_tran_veg - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_patch , & ! Output: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_patch , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_patch , & ! Output: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_patch , & ! Output: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_ev_snow => waterflux_inst%qflx_ev_snow_patch , & ! In/Out: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm] - qflx_ev_soil => waterflux_inst%qflx_ev_soil_patch , & ! In/Out: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_patch , & ! In/Out: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_sh_veg => energyflux_inst%eflx_sh_veg_patch , & ! Output: [real(r8) (:) ] sensible heat flux from leaves (W/m**2) [+ to atm] - eflx_soil_grnd => energyflux_inst%eflx_soil_grnd_patch , & ! Output: [real(r8) (:) ] soil heat flux (W/m**2) [+ = into soil] - eflx_soil_grnd_u => energyflux_inst%eflx_soil_grnd_u_patch , & ! Output: [real(r8) (:) ] urban soil heat flux (W/m**2) [+ = into soil] - eflx_soil_grnd_r => energyflux_inst%eflx_soil_grnd_r_patch , & ! Output: [real(r8) (:) ] rural soil heat flux (W/m**2) [+ = into soil] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_tot_u => energyflux_inst%eflx_sh_tot_u_patch , & ! Output: [real(r8) (:) ] urban total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_tot_r => energyflux_inst%eflx_sh_tot_r_patch , & ! Output: [real(r8) (:) ] rural total sensible heat flux (W/m**2) [+ to atm] - eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch , & ! Output: [real(r8) (:) ] total latent heat flux (W/m**2) [+ to atm] - eflx_lh_tot_u => energyflux_inst%eflx_lh_tot_u_patch , & ! Output: [real(r8) (:) ] urban total latent heat flux (W/m**2) [+ to atm] - eflx_lh_tot_r => energyflux_inst%eflx_lh_tot_r_patch , & ! Output: [real(r8) (:) ] rural total latent heat flux (W/m**2) [+ to atm] - eflx_lwrad_out => energyflux_inst%eflx_lwrad_out_patch , & ! Output: [real(r8) (:) ] emitted infrared (longwave) radiation (W/m**2) - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Output: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_lwrad_net_r => energyflux_inst%eflx_lwrad_net_r_patch , & ! Output: [real(r8) (:) ] rural net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_lwrad_out_r => energyflux_inst%eflx_lwrad_out_r_patch , & ! Output: [real(r8) (:) ] rural emitted infrared (longwave) rad (W/m**2) - eflx_lwrad_net_u => energyflux_inst%eflx_lwrad_net_u_patch , & ! Output: [real(r8) (:) ] urban net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_lwrad_out_u => energyflux_inst%eflx_lwrad_out_u_patch , & ! Output: [real(r8) (:) ] urban emitted infrared (longwave) rad (W/m**2) - eflx_lh_vege => energyflux_inst%eflx_lh_vege_patch , & ! Output: [real(r8) (:) ] veg evaporation heat flux (W/m**2) [+ to atm] - eflx_lh_vegt => energyflux_inst%eflx_lh_vegt_patch , & ! Output: [real(r8) (:) ] veg transpiration heat flux (W/m**2) [+ to atm] - eflx_lh_grnd => energyflux_inst%eflx_lh_grnd_patch , & ! Output: [real(r8) (:) ] ground evaporation heat flux (W/m**2) [+ to atm] - errsoi_col => energyflux_inst%errsoi_col , & ! Output: [real(r8) (:) ] column-level soil/lake energy conservation error (W/m**2) - errsoi_patch => energyflux_inst%errsoi_patch & ! Output: [real(r8) (:) ] patch-level soil/lake energy conservation error (W/m**2) - ) - - ! Get step size - - dtime = get_step_size() - - call t_startf('bgp2_loop_1') - do fc = 1,num_nolakec - c = filter_nolakec(fc) - j = col%snl(c)+1 - - ! Calculate difference in soil temperature from last time step, for - ! flux corrections - - if (col%snl(c) < 0) then - t_grnd0(c) = frac_sno_eff(c) * tssbef(c,col%snl(c)+1) & - + (1 - frac_sno_eff(c) - frac_h2osfc(c)) * tssbef(c,1) & - + frac_h2osfc(c) * t_h2osfc_bef(c) - else - t_grnd0(c) = (1 - frac_h2osfc(c)) * tssbef(c,1) + frac_h2osfc(c) * t_h2osfc_bef(c) - endif - - tinc(c) = t_grnd(c) - t_grnd0(c) - - ! Determine ratio of topsoil_evap_tot - - egsmax(c) = (h2osoi_ice(c,j)+h2osoi_liq(c,j)) / dtime - - ! added to trap very small negative soil water,ice - - if (egsmax(c) < 0._r8) then - egsmax(c) = 0._r8 - end if - end do - - ! A preliminary pft loop to determine if corrections are required for - ! excess evaporation from the top soil layer... Includes new logic - ! to distribute the corrections between patches on the basis of their - ! evaporative demands. - ! egirat holds the ratio of demand to availability if demand is - ! greater than availability, or 1.0 otherwise. - ! Correct fluxes to present soil temperature - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - eflx_sh_grnd(p) = eflx_sh_grnd(p) + tinc(c)*cgrnds(p) - qflx_evap_soi(p) = qflx_evap_soi(p) + tinc(c)*cgrndl(p) - - ! set ev_snow, ev_soil for urban landunits here - l = patch%landunit(p) - if (lun%urbpoi(l)) then - qflx_ev_snow(p) = qflx_evap_soi(p) - qflx_ev_soil(p) = 0._r8 - qflx_ev_h2osfc(p) = 0._r8 - else - qflx_ev_snow(p) = qflx_ev_snow(p) + tinc(c)*cgrndl(p) - qflx_ev_soil(p) = qflx_ev_soil(p) + tinc(c)*cgrndl(p) - qflx_ev_h2osfc(p) = qflx_ev_h2osfc(p) + tinc(c)*cgrndl(p) - endif - end do - - ! Set the column-average qflx_evap_soi as the weighted average over all patches - ! but only count the patches that are evaporating - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - topsoil_evap_tot(c) = 0._r8 - sumwt(c) = 0._r8 - end do - - do pi = 1,max_patch_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ( pi <= col%npatches(c) ) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - topsoil_evap_tot(c) = topsoil_evap_tot(c) + qflx_evap_soi(p) * patch%wtcol(p) - end if - end if - end do - end do - call t_stopf('bgp2_loop_1') - call t_startf('bgp2_loop_2') - - ! Calculate ratio for rescaling patch-level fluxes to meet availability - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (topsoil_evap_tot(c) > egsmax(c)) then - egirat(c) = (egsmax(c)/topsoil_evap_tot(c)) - else - egirat(c) = 1.0_r8 - end if - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - j = col%snl(c)+1 - - ! Correct soil fluxes for possible evaporation in excess of top layer water - ! excess energy is added to the sensible heat flux from soil - - if (egirat(c) < 1.0_r8) then - save_qflx_evap_soi = qflx_evap_soi(p) - qflx_evap_soi(p) = qflx_evap_soi(p) * egirat(c) - eflx_sh_grnd(p) = eflx_sh_grnd(p) + (save_qflx_evap_soi - qflx_evap_soi(p))*htvp(c) - qflx_ev_snow(p) = qflx_ev_snow(p) * egirat(c) - qflx_ev_soil(p) = qflx_ev_soil(p) * egirat(c) - qflx_ev_h2osfc(p) = qflx_ev_h2osfc(p) * egirat(c) - end if - - ! Ground heat flux - - if (.not. lun%urbpoi(l)) then - lw_grnd=(frac_sno_eff(c)*tssbef(c,col%snl(c)+1)**4 & - +(1._r8-frac_sno_eff(c)-frac_h2osfc(c))*tssbef(c,1)**4 & - +frac_h2osfc(c)*t_h2osfc_bef(c)**4) - - eflx_soil_grnd(p) = ((1._r8- frac_sno_eff(c))*sabg_soil(p) + frac_sno_eff(c)*sabg_snow(p)) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) & - - emg(c)*sb*lw_grnd - emg(c)*sb*t_grnd0(c)**3*(4._r8*tinc(c)) & - - (eflx_sh_grnd(p)+qflx_evap_soi(p)*htvp(c)) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_soil_grnd_r(p) = eflx_soil_grnd(p) - end if - else - ! For all urban columns we use the net longwave radiation (eflx_lwrad_net) since - ! the term (emg*sb*tssbef(col%snl+1)**4) is not the upward longwave flux because of - ! interactions between urban columns. - - eflx_lwrad_del(p) = 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) - - ! Include transpiration term because needed for pervious road - ! and wasteheat and traffic flux - eflx_soil_grnd(p) = sabg(p) + dlrad(p) & - - eflx_lwrad_net(p) - eflx_lwrad_del(p) & - - (eflx_sh_grnd(p) + qflx_evap_soi(p)*htvp(c) + qflx_tran_veg(p)*hvap) & - + eflx_wasteheat_patch(p) + eflx_heat_from_ac_patch(p) + eflx_traffic_patch(p) - eflx_soil_grnd_u(p) = eflx_soil_grnd(p) - end if - - ! Total fluxes (vegetation + ground) - - eflx_sh_tot(p) = eflx_sh_veg(p) + eflx_sh_grnd(p) - qflx_evap_tot(p) = qflx_evap_veg(p) + qflx_evap_soi(p) - eflx_lh_tot(p)= hvap*qflx_evap_veg(p) + htvp(c)*qflx_evap_soi(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_lh_tot_r(p)= eflx_lh_tot(p) - eflx_sh_tot_r(p)= eflx_sh_tot(p) - else if (lun%urbpoi(l)) then - eflx_lh_tot_u(p)= eflx_lh_tot(p) - eflx_sh_tot_u(p)= eflx_sh_tot(p) - end if - - ! Assign ground evaporation to sublimation from soil ice or to dew - ! on snow or ground - - qflx_evap_grnd(p) = 0._r8 - qflx_sub_snow(p) = 0._r8 - qflx_dew_snow(p) = 0._r8 - qflx_dew_grnd(p) = 0._r8 - - if (qflx_ev_snow(p) >= 0._r8) then - ! for evaporation partitioning between liquid evap and ice sublimation, - ! use the ratio of liquid to (liquid+ice) in the top layer to determine split - if ((h2osoi_liq(c,j)+h2osoi_ice(c,j)) > 0.) then - qflx_evap_grnd(p) = max(qflx_ev_snow(p)*(h2osoi_liq(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j))), 0._r8) - else - qflx_evap_grnd(p) = 0. - end if - qflx_sub_snow(p) = qflx_ev_snow(p) - qflx_evap_grnd(p) - else - if (t_grnd(c) < tfrz) then - qflx_dew_snow(p) = abs(qflx_ev_snow(p)) - else - qflx_dew_grnd(p) = abs(qflx_ev_snow(p)) - end if - end if - - ! Variables needed by history tape - - qflx_evap_can(p) = qflx_evap_veg(p) - qflx_tran_veg(p) - eflx_lh_vege(p) = (qflx_evap_veg(p) - qflx_tran_veg(p)) * hvap - eflx_lh_vegt(p) = qflx_tran_veg(p) * hvap - eflx_lh_grnd(p) = qflx_evap_soi(p) * htvp(c) - - end do - call t_stopf('bgp2_loop_2') - call t_startf('bgp2_loop_3') - - ! Soil Energy balance check - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - errsoi_patch(p) = eflx_soil_grnd(p) - xmf(c) - xmf_h2osfc(c) & - - frac_h2osfc(c)*(t_h2osfc(c)-t_h2osfc_bef(c)) & - *(c_h2osfc(c)/dtime) - errsoi_patch(p) = errsoi_patch(p)+eflx_h2osfc_to_snow_col(c) - ! For urban sunwall, shadewall, and roof columns, the "soil" energy balance check - ! must include the heat flux from the interior of the building. - if (col%itype(c)==icol_sunwall .or. col%itype(c)==icol_shadewall .or. col%itype(c)==icol_roof) then - errsoi_patch(p) = errsoi_patch(p) + eflx_building_heat_errsoi(c) - end if - end do - do j = -nlevsno+1,nlevgrnd - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - - if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then - ! area weight heat absorbed by snow layers - if (j >= col%snl(c)+1 .and. j < 1) errsoi_patch(p) = errsoi_patch(p) & - - frac_sno_eff(c)*(t_soisno(c,j)-tssbef(c,j))/fact(c,j) - if (j >= 1) errsoi_patch(p) = errsoi_patch(p) & - - (t_soisno(c,j)-tssbef(c,j))/fact(c,j) - end if - end do - end do - call t_stopf('bgp2_loop_3') - call t_startf('bgp2_loop_4') - - ! Outgoing long-wave radiation from vegetation + ground - ! For conservation we put the increase of ground longwave to outgoing - ! For urban patches, ulrad=0 and (1-fracveg_nosno)=1, and eflx_lwrad_out and eflx_lwrad_net - ! are calculated in UrbanRadiation. The increase of ground longwave is added directly - ! to the outgoing longwave and the net longwave. - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - j = col%snl(c)+1 - - if (.not. lun%urbpoi(l)) then - lw_grnd=(frac_sno_eff(c)*tssbef(c,col%snl(c)+1)**4 & - +(1._r8-frac_sno_eff(c)-frac_h2osfc(c))*tssbef(c,1)**4 & - +frac_h2osfc(c)*t_h2osfc_bef(c)**4) - - eflx_lwrad_out(p) = ulrad(p) & - + (1-frac_veg_nosno(p))*(1.-emg(c))*forc_lwrad(c) & - + (1-frac_veg_nosno(p))*emg(c)*sb*lw_grnd & - + 4._r8*emg(c)*sb*t_grnd0(c)**3*tinc(c) - - - ! Calculate the skin temperature as a weighted sum of all the surface contributions (surface water table, snow, etc...) - ! Note: This is the bare ground calculation of skin temperature - ! The Urban and Vegetation are done in other place. Urban=Later in this function Veg=CanopyFluxMod -! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + emv(p)*t_veg(p) -! if( frac_veg_nosno(p).eq.0 ) then -! t_skin_patch(p) = ((1._r8 - emv(p))*(1-frac_veg_nosno(p)) * sqrt(sqrt(lw_grnd))) + & -! emv(p) * frac_veg_nosno(p) * t_veg(p) -! end if - if(frac_veg_nosno(p).eq.0) t_skin_patch(p) = sqrt(sqrt(lw_grnd)) - - eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_lwrad_net_r(p) = eflx_lwrad_out(p) - forc_lwrad(c) - eflx_lwrad_out_r(p) = eflx_lwrad_out(p) - end if - else - eflx_lwrad_out(p) = eflx_lwrad_out(p) + eflx_lwrad_del(p) - eflx_lwrad_net(p) = eflx_lwrad_net(p) + eflx_lwrad_del(p) - eflx_lwrad_net_u(p) = eflx_lwrad_net_u(p) + eflx_lwrad_del(p) - eflx_lwrad_out_u(p) = eflx_lwrad_out(p) - end if - end do - - ! lake balance for errsoi is not over pft - ! therefore obtain column-level radiative temperature - - call p2c(bounds, num_nolakec, filter_nolakec, & - errsoi_patch(bounds%begp:bounds%endp), & - errsoi_col(bounds%begc:bounds%endc)) - - ! Assign column-level t_soisno(snl+1) to t_skin for each urban pft - do fp = 1, num_urbanp - p = filter_urbanp(fp) - c = patch%column(p) - - t_skin_patch(p) = t_soisno(c,col%snl(c)+1) - - end do - - call t_stopf('bgp2_loop_4') - - end associate - - end subroutine SoilFluxes - -end module SoilFluxesMod - diff --git a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 b/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 deleted file mode 100644 index 101059da4e..0000000000 --- a/src/biogeophys/SoilHydrologyInitTimeConstMod.F90 +++ /dev/null @@ -1,568 +0,0 @@ -module SoilHydrologyInitTimeConstMod - - !------------------------------------------------------------------------------ - ! DESCRIPTION: - ! Initialize time constant variables for SoilHydrologyType - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use SoilHydrologyType , only : soilhydrology_type - use LandunitType , only : lun - use ColumnType , only : col - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilHydrologyInitTimeConst - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: initSoilParVIC ! Convert default CLM soil properties to VIC parameters - private :: initCLMVICMap ! Initialize map from VIC to CLM layers - private :: linear_interp ! function for linear interperation - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - ! -contains - - !----------------------------------------------------------------------- - subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) - ! - ! !USES: - use shr_const_mod , only : shr_const_pi - use shr_spfn_mod , only : shr_spfn_erf - use abortutils , only : endrun - use spmdMod , only : masterproc - use clm_varctl , only : fsurdat, paramfile, iulog, use_vichydro, soil_layerstruct - use clm_varpar , only : nlevsoifl, toplev_equalspace - use clm_varpar , only : nlevsoi, nlevgrnd, nlevsno, nlevlak, nlevurb, nlayer, nlayert - use clm_varcon , only : zsoi, dzsoi, zisoi, spval, nlvic, dzvic, pc, grlnd - use clm_varcon , only : aquifer_water_baseline - use landunit_varcon , only : istwet, istsoil, istdlak, istcrop, istice_mec - use column_varcon , only : icol_shadewall, icol_road_perv, icol_road_imperv, icol_roof, icol_sunwall - use fileutils , only : getfil - use organicFileMod , only : organicrd - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,j,l,g,lev,nlevs - integer :: ivic,ivicstrt,ivicend - real(r8) :: maxslope, slopemax, minslope - real(r8) :: d, fd, dfdd, slope0,slopebeta - real(r8) ,pointer :: tslope(:) - logical :: readvar - type(file_desc_t) :: ncid - character(len=256) :: locfn - real(r8) :: clay,sand ! temporaries - real(r8) :: om_frac ! organic matter fraction - real(r8) :: organic_max ! organic matter (kg/m3) where soil is assumed to act like peat - real(r8) ,pointer :: b2d (:) ! read in - VIC b - real(r8) ,pointer :: ds2d (:) ! read in - VIC Ds - real(r8) ,pointer :: dsmax2d (:) ! read in - VIC Dsmax - real(r8) ,pointer :: ws2d (:) ! read in - VIC Ws - real(r8), pointer :: sandcol (:,:) ! column level sand fraction for calculating VIC parameters - real(r8), pointer :: claycol (:,:) ! column level clay fraction for calculating VIC parameters - real(r8), pointer :: om_fraccol (:,:) ! column level organic matter fraction for calculating VIC parameters - real(r8) ,pointer :: sand3d (:,:) ! read in - soil texture: percent sand - real(r8) ,pointer :: clay3d (:,:) ! read in - soil texture: percent clay - real(r8) ,pointer :: organic3d (:,:) ! read in - organic matter: kg/m3 - real(r8) ,pointer :: zisoifl (:) ! original soil interface depth - real(r8) ,pointer :: zsoifl (:) ! original soil midpoint - real(r8) ,pointer :: dzsoifl (:) ! original soil thickness - !----------------------------------------------------------------------- - ! ----------------------------------------------------------------- - ! Initialize frost table - ! ----------------------------------------------------------------- - - soilhydrology_inst%wa_col(bounds%begc:bounds%endc) = aquifer_water_baseline - soilhydrology_inst%zwt_col(bounds%begc:bounds%endc) = 0._r8 - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (.not. lun%lakpoi(l)) then !not lake - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_perv) then - ! Note that the following hard-coded constants (on the next two lines) - ! seem implicitly related to aquifer_water_baseline - soilhydrology_inst%wa_col(c) = 4800._r8 - soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - soilhydrology_inst%wa_col(c)/0.2_r8 /1000._r8 ! One meter below soil column - else - soilhydrology_inst%wa_col(c) = spval - soilhydrology_inst%zwt_col(c) = spval - end if - ! initialize frost_table, zwt_perched - soilhydrology_inst%zwt_perched_col(c) = spval - soilhydrology_inst%frost_table_col(c) = spval - else - ! Note that the following hard-coded constants (on the next two lines) seem - ! implicitly related to aquifer_water_baseline - soilhydrology_inst%wa_col(c) = 4000._r8 - soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - soilhydrology_inst%wa_col(c)/0.2_r8 /1000._r8 ! One meter below soil column - ! initialize frost_table, zwt_perched to bottom of soil column - soilhydrology_inst%zwt_perched_col(c) = col%zi(c,nlevsoi) - soilhydrology_inst%frost_table_col(c) = col%zi(c,nlevsoi) - end if - end if - end do - - ! Initialize VIC variables - - if (use_vichydro) then - - allocate(b2d (bounds%begg:bounds%endg)) - allocate(ds2d (bounds%begg:bounds%endg)) - allocate(dsmax2d (bounds%begg:bounds%endg)) - allocate(ws2d (bounds%begg:bounds%endg)) - allocate(sandcol (bounds%begc:bounds%endc,1:nlevgrnd )) - allocate(claycol (bounds%begc:bounds%endc,1:nlevgrnd )) - allocate(om_fraccol (bounds%begc:bounds%endc,1:nlevgrnd )) - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - call ncd_io(ncid=ncid, varname='binfl', flag='read', data=b2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: binfl NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='Ds', flag='read', data=ds2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Ds NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='Dsmax', flag='read', data=dsmax2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Dsmax NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='Ws', flag='read', data=ws2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: Ws NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile(ncid) - - !define the depth of VIC soil layers here - nlvic(1) = 3 - nlvic(2) = toplev_equalspace - nlvic(1) - nlvic(3) = nlevsoi - (nlvic(1) + nlvic(2)) - - dzvic(:) = 0._r8 - ivicstrt = 1 - - do ivic = 1,nlayer - ivicend = ivicstrt+nlvic(ivic)-1 - do j = ivicstrt,ivicend - dzvic(ivic) = dzvic(ivic)+dzsoi(j) - end do - ivicstrt = ivicend+1 - end do - - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - soilhydrology_inst%b_infil_col(c) = b2d(g) - soilhydrology_inst%ds_col(c) = ds2d(g) - soilhydrology_inst%dsmax_col(c) = dsmax2d(g) - soilhydrology_inst%Wsvic_col(c) = ws2d(g) - end do - - do c = bounds%begc, bounds%endc - soilhydrology_inst%max_infil_col(c) = spval - soilhydrology_inst%i_0_col(c) = spval - do lev = 1, nlayer - soilhydrology_inst%ice_col(c,lev) = spval - soilhydrology_inst%moist_col(c,lev) = spval - soilhydrology_inst%moist_vol_col(c,lev) = spval - soilhydrology_inst%max_moist_col(c,lev) = spval - soilhydrology_inst%porosity_col(c,lev) = spval - soilhydrology_inst%expt_col(c,lev) = spval - soilhydrology_inst%ksat_col(c,lev) = spval - soilhydrology_inst%phi_s_col(c,lev) = spval - soilhydrology_inst%depth_col(c,lev) = spval - sandcol(c,lev) = spval - claycol(c,lev) = spval - om_fraccol(c,lev) = spval - end do - end do - - allocate(sand3d(bounds%begg:bounds%endg,nlevsoifl)) - allocate(clay3d(bounds%begg:bounds%endg,nlevsoifl)) - allocate(organic3d(bounds%begg:bounds%endg,nlevsoifl)) - - call organicrd(organic3d) - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - call ncd_io(ncid=ncid, varname='PCT_SAND', flag='read', data=sand3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: PCT_SAND NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='PCT_CLAY', flag='read', data=clay3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: PCT_CLAY NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile(ncid) - - ! Determine organic_max - call getfil (paramfile, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_io(ncid=ncid, varname='organic_max', flag='read', data=organic_max, readvar=readvar) - if ( .not. readvar ) then - call endrun(msg=' ERROR: organic_max not on param file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile(ncid) - - ! get original soil depths to be used in interpolation of sand and clay - allocate(zsoifl(1:nlevsoifl), zisoifl(0:nlevsoifl), dzsoifl(1:nlevsoifl)) - do j = 1, nlevsoifl - zsoifl(j) = 0.025*(exp(0.5_r8*(j-0.5_r8))-1._r8) !node depths - enddo - - dzsoifl(1) = 0.5_r8*(zsoifl(1)+zsoifl(2)) !thickness b/n two interfaces - do j = 2,nlevsoifl-1 - dzsoifl(j)= 0.5_r8*(zsoifl(j+1)-zsoifl(j-1)) - enddo - dzsoifl(nlevsoifl) = zsoifl(nlevsoifl)-zsoifl(nlevsoifl-1) - - zisoifl(0) = 0._r8 - do j = 1, nlevsoifl-1 - zisoifl(j) = 0.5_r8*(zsoifl(j)+zsoifl(j+1)) !interface depths - enddo - zisoifl(nlevsoifl) = zsoifl(nlevsoifl) + 0.5_r8*dzsoifl(nlevsoifl) - - if ( masterproc )then - if ( soil_layerstruct /= '10SL_3.5m' ) write(iulog,*) 'Setting clay, sand, organic, in Soil Hydrology for VIC' - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - l = col%landunit(c) - - if (lun%itype(l) /= istdlak) then ! soil columns of both urban and non-urban types - if (lun%itype(l)==istwet .or. lun%itype(l)==istice_mec) then - ! do nothing - else if (lun%urbpoi(l) .and. (col%itype(c) /= icol_road_perv) .and. (col%itype(c) /= icol_road_imperv) )then - ! do nothing - else - do lev = 1,nlevgrnd - if ( soil_layerstruct /= '10SL_3.5m' )then - if (lev .eq. 1) then - clay = clay3d(g,1) - sand = sand3d(g,1) - om_frac = organic3d(g,1)/organic_max - else if (lev <= nlevsoi) then - do j = 1,nlevsoifl-1 - if (zisoi(lev) >= zisoifl(j) .AND. zisoi(lev) < zisoifl(j+1)) then - clay = clay3d(g,j+1) - sand = sand3d(g,j+1) - om_frac = organic3d(g,j+1)/organic_max - endif - end do - else - clay = clay3d(g,nlevsoifl) - sand = sand3d(g,nlevsoifl) - om_frac = 0._r8 - endif - else - ! duplicate clay and sand values from 10th soil layer - if (lev <= nlevsoi) then - clay = clay3d(g,lev) - sand = sand3d(g,lev) - om_frac = (organic3d(g,lev)/organic_max)**2._r8 - else - clay = clay3d(g,nlevsoi) - sand = sand3d(g,nlevsoi) - om_frac = 0._r8 - endif - end if - - if (lun%urbpoi(l)) om_frac = 0._r8 - claycol(c,lev) = clay - sandcol(c,lev) = sand - om_fraccol(c,lev) = om_frac - end do - end if - end if ! end of if not lake - - if (lun%itype(l) /= istdlak) then ! soil columns of both urban and non-urban types - if (lun%urbpoi(l)) then - if (col%itype(c)==icol_sunwall .or. col%itype(c)==icol_shadewall .or. col%itype(c)==icol_roof) then - ! do nothing - else - soilhydrology_inst%depth_col(c, 1:nlayer) = dzvic - soilhydrology_inst%depth_col(c, nlayer+1:nlayert) = col%dz(c, nlevsoi+1:nlevgrnd) - - ! create weights to map soil moisture profiles (10 layer) to 3 layers for VIC hydrology, M.Huang - call initCLMVICMap(c, soilhydrology_inst) - call initSoilParVIC(c, claycol, sandcol, om_fraccol, soilhydrology_inst) - end if - else - soilhydrology_inst%depth_col(c, 1:nlayer) = dzvic - soilhydrology_inst%depth_col(c, nlayer+1:nlayert) = col%dz(c, nlevsoi+1:nlevgrnd) - - ! create weights to map soil moisture profiles (10 layer) to 3 layers for VIC hydrology, M.Huang - call initCLMVICMap(c, soilhydrology_inst) - call initSoilParVIC(c, claycol, sandcol, om_fraccol, soilhydrology_inst) - end if - end if ! end of if not lake - - end do ! end of loop over columns - - deallocate(b2d, ds2d, dsmax2d, ws2d) - deallocate(sandcol, claycol, om_fraccol) - deallocate(sand3d, clay3d, organic3d) - deallocate(zisoifl, zsoifl, dzsoifl) - - end if ! end of if use_vichydro - - associate(micro_sigma => col%micro_sigma) - do c = bounds%begc, bounds%endc - - ! determine h2osfc threshold ("fill & spill" concept) - ! set to zero for no h2osfc (w/frac_infclust =large) - - soilhydrology_inst%h2osfc_thresh_col(c) = 0._r8 - if (micro_sigma(c) > 1.e-6_r8 .and. (soilhydrology_inst%h2osfcflag /= 0)) then - d = 0.0 - do p = 1,4 - fd = 0.5*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0)))) - pc - dfdd = exp(-d**2/(2.0*micro_sigma(c)**2))/(micro_sigma(c)*sqrt(2.0*shr_const_pi)) - d = d - fd/dfdd - enddo - soilhydrology_inst%h2osfc_thresh_col(c) = 0.5*d*(1.0_r8+shr_spfn_erf(d/(micro_sigma(c)*sqrt(2.0)))) + & - micro_sigma(c)/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*micro_sigma(c)**2)) - soilhydrology_inst%h2osfc_thresh_col(c) = 1.e3_r8 * soilhydrology_inst%h2osfc_thresh_col(c) !convert to mm from meters - else - soilhydrology_inst%h2osfc_thresh_col(c) = 0._r8 - endif - - if (soilhydrology_inst%h2osfcflag == 0) then - soilhydrology_inst%h2osfc_thresh_col(c) = 0._r8 ! set to zero for no h2osfc (w/frac_infclust =large) - endif - - ! set decay factor - soilhydrology_inst%hkdepth_col(c) = 1._r8/2.5_r8 - - end do - end associate - - end subroutine SoilhydrologyInitTimeConst - - !----------------------------------------------------------------------- - subroutine initSoilParVIC(c, claycol, sandcol, om_fraccol, soilhydrology_inst) - ! - ! !DESCRIPTION: - ! Convert default CLM soil properties to VIC parameters - ! to be used for runoff simulations (added by M. Huang) - ! - ! !USES: - use clm_varpar, only : nlevsoi, nlayert, nlayer - ! - ! !ARGUMENTS: - integer , intent(in) :: c ! column index - real(r8) , pointer :: sandcol(:,:) ! read in - soil texture: percent sand - real(r8) , pointer :: claycol(:,:) ! read in - soil texture: percent clay - real(r8) , pointer :: om_fraccol(:,:) ! read in - organic matter: kg/m3 - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - - ! !LOCAL VARIABLES: - real(r8) :: om_watsat = 0.9_r8 ! porosity of organic soil - real(r8) :: om_hksat = 0.1_r8 ! saturated hydraulic conductivity of organic soil [mm/s] - real(r8) :: om_tkm = 0.25_r8 ! thermal conductivity of organic soil (Farouki, 1986) [W/m/K] - real(r8) :: om_sucsat = 10.3_r8 ! saturated suction for organic matter (Letts, 2000) - real(r8) :: om_csol = 2.5_r8 ! heat capacity of peat soil *10^6 (J/K m3) (Farouki, 1986) - real(r8) :: om_tkd = 0.05_r8 ! thermal conductivity of dry organic soil (Farouki, 1981) - real(r8) :: om_b = 2.7_r8 ! Clapp Hornberger paramater for oragnic soil (Letts, 2000) - real(r8) :: om_expt = 3._r8+2._r8*2.7_r8 ! soil expt for VIC - real(r8) :: csol_bedrock = 2.0e6_r8 ! vol. heat capacity of granite/sandstone J/(m3 K)(Shabbir, 2000) - real(r8) :: pc = 0.5_r8 ! percolation threshold - real(r8) :: pcbeta = 0.139_r8 ! percolation exponent - real(r8) :: xksat ! maximum hydraulic conductivity of soil [mm/s] - real(r8) :: perc_frac ! "percolating" fraction of organic soil - real(r8) :: perc_norm ! normalize to 1 when 100% organic soil - real(r8) :: uncon_hksat ! series conductivity of mineral/organic soil - real(r8) :: uncon_frac ! fraction of "unconnected" soil - real(r8) :: temp_sum_frac ! sum of node fractions in each VIC layer - real(r8) :: sandvic(1:nlayert) ! temporary, weighted averaged sand% for VIC layers - real(r8) :: clayvic(1:nlayert) ! temporary, weighted averaged clay% for VIC layers - real(r8) :: om_fracvic(1:nlayert) ! temporary, weighted averaged organic matter fract for VIC layers - integer :: i, j ! indices - !------------------------------------------------------------------------------------------- - - ! soilhydrology_inst%depth_col(:,:) Output: layer depth of upper layer(m) - ! soilhydrology_inst%vic_clm_fract_col(:,:,:) Output: fraction of VIC layers in CLM layers - ! soilhydrology_inst%c_param_col(:) Output: baseflow exponent (Qb) - ! soilhydrology_inst%expt_col(:,:) Output: pore-size distribution related paramter(Q12) - ! soilhydrology_inst%ksat_col(:,:) Output: Saturated hydrologic conductivity (mm/s) - ! soilhydrology_inst%phi_s_col(:,:) Output: soil moisture dissusion parameter - ! soilhydrology_inst%porosity_col(:,:) Output: soil porosity - ! soilhydrology_inst%max_moist_col(:,:) Output: maximum soil moisture (ice + liq) - - ! map parameters between VIC layers and CLM layers - soilhydrology_inst%c_param_col(c) = 2._r8 - - ! map the CLM layers to VIC layers - do i = 1, nlayer - - sandvic(i) = 0._r8 - clayvic(i) = 0._r8 - om_fracvic(i) = 0._r8 - temp_sum_frac = 0._r8 - do j = 1, nlevsoi - sandvic(i) = sandvic(i) + sandcol(c,j) * soilhydrology_inst%vic_clm_fract_col(c,i,j) - clayvic(i) = clayvic(i) + claycol(c,j) * soilhydrology_inst%vic_clm_fract_col(c,i,j) - om_fracvic(i) = om_fracvic(i) + om_fraccol(c,j) * soilhydrology_inst%vic_clm_fract_col(c,i,j) - temp_sum_frac = temp_sum_frac + soilhydrology_inst%vic_clm_fract_col(c,i,j) - end do - - !average soil properties, M.Huang, 08/11/2010 - sandvic(i) = sandvic(i)/temp_sum_frac - clayvic(i) = clayvic(i)/temp_sum_frac - om_fracvic(i) = om_fracvic(i)/temp_sum_frac - - !make sure sand, clay and om fractions are between 0 and 100% - sandvic(i) = min(100._r8 , sandvic(i)) - clayvic(i) = min(100._r8 , clayvic(i)) - om_fracvic(i) = min(100._r8 , om_fracvic(i)) - sandvic(i) = max(0._r8 , sandvic(i)) - clayvic(i) = max(0._r8 , clayvic(i)) - om_fracvic(i) = max(0._r8 , om_fracvic(i)) - - !calculate other parameters based on teh percentages - soilhydrology_inst%porosity_col(c, i) = 0.489_r8 - 0.00126_r8*sandvic(i) - soilhydrology_inst%expt_col(c, i) = 3._r8+ 2._r8*(2.91_r8 + 0.159_r8*clayvic(i)) - xksat = 0.0070556 *( 10.**(-0.884+0.0153*sandvic(i)) ) - - !consider organic matter, M.Huang - soilhydrology_inst%expt_col(c, i) = & - (1._r8 - om_fracvic(i))*soilhydrology_inst%expt_col(c, i) + om_fracvic(i)*om_expt - soilhydrology_inst%porosity_col(c,i) = & - (1._r8 - om_fracvic(i))*soilhydrology_inst%porosity_col(c,i) + om_watsat*om_fracvic(i) - - ! perc_frac is zero unless perf_frac greater than percolation threshold - if (om_fracvic(i) > pc) then - perc_norm=(1._r8 - pc)**(-pcbeta) - perc_frac=perc_norm*(om_fracvic(i) - pc)**pcbeta - else - perc_frac=0._r8 - endif - ! uncon_frac is fraction of mineral soil plus fraction of "nonpercolating" organic soil - uncon_frac=(1._r8-om_fracvic(i))+(1._r8-perc_frac)*om_fracvic(i) - - ! uncon_hksat is series addition of mineral/organic conductivites - if (om_fracvic(i) < 1._r8) then - uncon_hksat=uncon_frac/((1._r8-om_fracvic(i))/xksat & - +((1._r8-perc_frac)*om_fracvic(i))/om_hksat) - else - uncon_hksat = 0._r8 - end if - - soilhydrology_inst%ksat_col(c,i) = & - uncon_frac*uncon_hksat + (perc_frac*om_fracvic(i))*om_hksat - - soilhydrology_inst%max_moist_col(c,i) = & - soilhydrology_inst%porosity_col(c,i) * soilhydrology_inst%depth_col(c,i) * 1000._r8 !in mm! - - soilhydrology_inst%phi_s_col(c,i) = & - -(exp((1.54_r8 - 0.0095_r8*sandvic(i) + & - 0.0063_r8*(100.0_r8-sandvic(i)-clayvic(i)))*log(10.0_r8))*9.8e-5_r8) - - end do ! end of loop over layers - - end subroutine initSoilParVIC - - !----------------------------------------------------------------------- - subroutine initCLMVICMap(c, soilhydrology_inst) - ! - ! !DESCRIPTION: - ! Calculates mapping between CLM and VIC layers - ! added by AWang, modified by M.Huang for CLM4 - ! NOTE: in CLM h2osoil_liq unit is kg/m2, in VIC moist is mm - ! h2osoi_ice is actually water equavlent ice content. - ! - ! !USES: - use clm_varpar , only : nlevsoi, nlayer - ! - ! !ARGUMENTS: - integer , intent(in) :: c - type(soilhydrology_type), intent(inout) :: soilhydrology_inst - ! - ! !REVISION HISTORY: - ! Created by Maoyi Huang - ! 11/13/2012, Maoyi Huang: rewrite the mapping modules in CLM4VIC - ! - ! !LOCAL VARIABLES - real(r8) :: sum_frac(1:nlayer) ! sum of fraction for each layer - real(r8) :: deltal(1:nlayer+1) ! temporary - real(r8) :: zsum ! temporary - real(r8) :: lsum ! temporary - real(r8) :: temp ! temporary - integer :: i, j, fc - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - depth => soilhydrology_inst%depth_col , & ! Input: [real(r8) (:,:) ] layer depth of VIC (m) - vic_clm_fract => soilhydrology_inst%vic_clm_fract_col & ! Output: [real(r8) (:,:,:) ] fraction of VIC layers in clm layers - ) - - ! set fraction of VIC layer in each CLM layer - - lsum = 0._r8 - do i = 1, nlayer - deltal(i) = depth(c,i) - end do - do i = 1, nlayer - zsum = 0._r8 - sum_frac(i) = 0._r8 - do j = 1, nlevsoi - if( (zsum < lsum) .and. (zsum + dz(c,j) >= lsum )) then - call linear_interp(lsum, temp, zsum, zsum + dz(c,j), 0._r8, 1._r8) - vic_clm_fract(c,i,j) = 1._r8 - temp - if(lsum + deltal(i) < zsum + dz(c,j)) then - call linear_interp(lsum + deltal(i), temp, zsum, zsum + dz(c,j), 1._r8, 0._r8) - vic_clm_fract(c,i,j) = vic_clm_fract(c,i,j) - temp - end if - else if( (zsum < lsum + deltal(i)) .and. (zsum + dz(c,j) >= lsum + deltal(i)) ) then - call linear_interp(lsum + deltal(i), temp, zsum, zsum + dz(c,j), 0._r8, 1._r8) - vic_clm_fract(c,i,j) = temp - if(zsum<=lsum) then - call linear_interp(lsum, temp, zsum, zsum + dz(c,j), 0._r8, 1._r8) - vic_clm_fract(c,i,j) = vic_clm_fract(c,i,j) - temp - end if - else if( (zsum >= lsum .and. zsum + dz(c,j) <= lsum + deltal(i)) ) then - vic_clm_fract(c,i,j) = 1._r8 - else - vic_clm_fract(c,i,j) = 0._r8 - end if - zsum = zsum + dz(c,j) - sum_frac(i) = sum_frac(i) + vic_clm_fract(c,i,j) - end do ! end CLM layer calculation - lsum = lsum + deltal(i) - end do ! end VIC layer calcultion - - end associate - - end subroutine initCLMVICMap - - !------------------------------------------------------------------- - subroutine linear_interp(x,y, x0, x1, y0, y1) - ! - ! !DESCRIPTION: - ! Provides linear interpolation - ! - ! !ARGUMENTS: - real(r8), intent(in) :: x, x0, y0, x1, y1 - real(r8), intent(out) :: y - !------------------------------------------------------------------- - - y = y0 + (x - x0) * (y1 - y0) / (x1 - x0) - - end subroutine linear_interp - -end module SoilHydrologyInitTimeConstMod diff --git a/src/biogeophys/SoilHydrologyMod.F90 b/src/biogeophys/SoilHydrologyMod.F90 deleted file mode 100644 index 7f9b4ed08a..0000000000 --- a/src/biogeophys/SoilHydrologyMod.F90 +++ /dev/null @@ -1,2337 +0,0 @@ -module SoilHydrologyMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate soil hydrology - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varctl , only : iulog, use_vichydro - use clm_varcon , only : e_ice, denh2o, denice, rpi, aquifer_water_baseline - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use TemperatureType , only : temperature_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilHydReadNML ! Read in the Soil hydrology namelist - public :: SurfaceRunoff ! Calculate surface runoff - public :: Infiltration ! Calculate infiltration into surface soil layer - public :: WaterTable ! Calculate water table before imposing drainage - public :: Drainage ! Calculate subsurface drainage - public :: CLMVICMap - public :: PerchedWaterTable ! Calculate perched water table - public :: PerchedLateralFlow ! Calculate lateral flow from perched saturated zone - public :: ThetaBasedWaterTable ! Calculate water table from soil moisture state - public :: LateralFlowPowerLaw ! Calculate lateral flow based on power law drainage function - public :: RenewCondensation ! Misc. corrections - - !----------------------------------------------------------------------- - real(r8), private :: baseflow_scalar = 1.e-2_r8 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine soilHydReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for soil hydrology - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'soilHydReadNML' - character(len=*), parameter :: nmlname = 'soilhydrology_inparm' - !----------------------------------------------------------------------- - namelist /soilhydrology_inparm/ baseflow_scalar - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=soilhydrology_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (baseflow_scalar, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=soilhydrology_inparm) - write(iulog,*) ' ' - end if - - end subroutine soilhydReadNML - - !----------------------------------------------------------------------- - subroutine SurfaceRunoff (bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, waterflux_inst, & - waterstate_inst) - ! - ! !DESCRIPTION: - ! Calculate surface runoff - ! - ! !USES: - use clm_varcon , only : denice, denh2o, wimp, pondmx_urban - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv, icol_road_perv - use clm_varpar , only : nlevsoi, maxpatch_pft - use clm_time_manager, only : get_step_size - use clm_varpar , only : nlayer, nlayert - use abortutils , only : endrun - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,fc,g,l,i !indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit - real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) !partial volume of ice lens in layer - real(r8) :: fff(bounds%begc:bounds%endc) !decay factor (m-1) - real(r8) :: s1 !variable to calculate qinmax - real(r8) :: su !variable to calculate qinmax - real(r8) :: v !variable to calculate qinmax - real(r8) :: qinmax !maximum infiltration capacity (mm/s) - real(r8) :: A(bounds%begc:bounds%endc) !fraction of the saturated area - real(r8) :: ex(bounds%begc:bounds%endc) !temporary variable (exponent) - real(r8) :: top_moist(bounds%begc:bounds%endc) !temporary, soil moisture in top VIC layers - real(r8) :: top_max_moist(bounds%begc:bounds%endc) !temporary, maximum soil moisture in top VIC layers - real(r8) :: top_ice(bounds%begc:bounds%endc) !temporary, ice len in top VIC layers - character(len=32) :: subname = 'SurfaceRunoff' !subroutine name - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - wtfact => soilstate_inst%wtfact_col , & ! Input: [real(r8) (:) ] maximum saturated fraction for a gridcell - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - - qflx_snow_h2osfc => waterflux_inst%qflx_snow_h2osfc_col , & ! Input: [real(r8) (:) ] snow falling on surface water (mm/s) - qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Output: [real(r8) (:) ] net water input into soil from top (mm/s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) - - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) - hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) - origflag => soilhydrology_inst%origflag , & ! Input: logical - fcov => soilhydrology_inst%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area - fsat => soilhydrology_inst%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface - fracice => soilhydrology_inst%fracice_col , & ! Output: [real(r8) (:,:) ] fractional impermeability (-) - icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] - ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) - max_infil => soilhydrology_inst%max_infil_col , & ! Output: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) - i_0 => soilhydrology_inst%i_0_col & ! Output: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) - ) - - ! Get time step - - dtime = get_step_size() - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, - ! fractional impermeability - - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - if (origflag == 1) then - icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) - else - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - endif - - fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) - end do - end do - - ! Saturated fraction - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - fff(c) = 0.5_r8 - if (use_vichydro) then - top_moist(c) = 0._r8 - top_ice(c) = 0._r8 - top_max_moist(c) = 0._r8 - do j = 1, nlayer - 1 - top_ice(c) = top_ice(c) + ice(c,j) - top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) - top_max_moist(c) = top_max_moist(c) + max_moist(c,j) - end do - if(top_moist(c)> top_max_moist(c)) top_moist(c)= top_max_moist(c) - top_ice(c) = max(0._r8,top_ice(c)) - max_infil(c) = (1._r8+b_infil(c)) * top_max_moist(c) - ex(c) = b_infil(c) / (1._r8 + b_infil(c)) - A(c) = 1._r8 - (1._r8 - top_moist(c) / top_max_moist(c))**ex(c) - i_0(c) = max_infil(c) * (1._r8 - (1._r8 - A(c))**(1._r8/b_infil(c))) - fsat(c) = A(c) !for output - else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) - end if - - ! use perched water table to determine fsat (if present) - if ( frost_table(c) > zwt(c)) then - if (use_vichydro) then - fsat(c) = A(c) - else - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) - end if - else - if ( frost_table(c) > zwt_perched(c)) then - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt_perched(c))!*( frost_table(c) - zwt_perched(c))/4.0 - endif - endif - if (origflag == 1) then - if (use_vichydro) then - call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) - else - fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) - end if - else - fcov(c) = fsat(c) - endif - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! assume qinmax large relative to qflx_top_soil in control - if (origflag == 1) then - qflx_surf(c) = fcov(c) * qflx_top_soil(c) - else - ! only send fast runoff directly to streams - qflx_surf(c) = fsat(c) * qflx_top_soil(c) - endif - end do - - ! Determine water in excess of ponding limit for urban roof and impervious road. - ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - - ! If there are snow layers then all qflx_top_soil goes to surface runoff - if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_top_soil(c)) - else - xs(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_top_soil(c) - qflx_evap_grnd(c) - & - pondmx_urban/dtime) - if (xs(c) > 0.) then - h2osoi_liq(c,1) = pondmx_urban - else - h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_top_soil(c)-qflx_evap_grnd(c))*dtime) - end if - qflx_surf(c) = xs(c) - end if - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - qflx_surf(c) = 0._r8 - end if - ! send flood water flux to runoff for all urban columns - qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) - - end do - - ! remove stormflow and snow on h2osfc from qflx_top_soil - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! add flood water flux to qflx_top_soil - qflx_top_soil(c) = qflx_top_soil(c) + qflx_snow_h2osfc(c) + qflx_floodc(c) - end do - - end associate - - end subroutine SurfaceRunoff - - !----------------------------------------------------------------------- - subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - energyflux_inst, soilhydrology_inst, soilstate_inst, temperature_inst, & - waterflux_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Calculate infiltration into surface soil layer (minus the evaporation) - ! - ! !USES: - use shr_const_mod , only : shr_const_pi - use clm_varpar , only : nlayer, nlayert - use clm_varpar , only : nlevsoi - use clm_varcon , only : denh2o, denice, roverg, wimp, pc, mu, tfrz - use column_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, icol_road_perv - use landunit_varcon , only : istsoil, istcrop - use clm_time_manager , only : get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(energyflux_type) , intent(in) :: energyflux_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,l,fc ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: s1,su,v ! variable to calculate qinmax - real(r8) :: qinmax ! maximum infiltration capacity (mm/s) - real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) ! partial volume of ice lens in layer - real(r8) :: alpha_evap(bounds%begc:bounds%endc) ! fraction of total evap from h2osfc - real(r8) :: qflx_evap(bounds%begc:bounds%endc) ! local evaporation array - real(r8) :: qflx_h2osfc_drain(bounds%begc:bounds%endc) ! bottom drainage from h2osfc - real(r8) :: qflx_in_h2osfc(bounds%begc:bounds%endc) ! surface input to h2osfc - real(r8) :: qflx_in_soil(bounds%begc:bounds%endc) ! surface input to soil - real(r8) :: qflx_infl_excess(bounds%begc:bounds%endc) ! infiltration excess runoff -> h2osfc - real(r8) :: frac_infclust ! fraction of submerged area that is connected - real(r8) :: fsno ! copy of frac_sno - real(r8) :: k_wet ! linear reservoir coefficient for h2osfc - real(r8) :: fac ! soil wetness of surface layer - real(r8) :: psit ! negative potential of soil - real(r8) :: hr ! relative humidity - real(r8) :: wx ! partial volume of ice and water of surface layer - real(r8) :: z_avg - real(r8) :: rho_avg - real(r8) :: fmelt - real(r8) :: f_sno - real(r8) :: imped - real(r8) :: d - real(r8) :: h2osoi_vol - real(r8) :: basis ! temporary, variable soil moisture holding capacity - ! in top VIC layers for runoff calculation - real(r8) :: rsurf_vic ! temp VIC surface runoff - real(r8) :: top_moist(bounds%begc:bounds%endc) ! temporary, soil moisture in top VIC layers - real(r8) :: top_max_moist(bounds%begc:bounds%endc) ! temporary, maximum soil moisture in top VIC layers - real(r8) :: top_ice(bounds%begc:bounds%endc) ! temporary, ice len in top VIC layers - real(r8) :: top_icefrac ! temporary, ice fraction in top VIC layers - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_h2osfc_nosnow => waterstate_inst%frac_h2osfc_nosnow_col, & ! Output: [real(r8) (:) ] col fractional area with surface water greater than zero (if no snow present) - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - - qflx_ev_soil => waterflux_inst%qflx_ev_soil_col , & ! Input: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - qflx_evap_soi => waterflux_inst%qflx_evap_soi_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+] - qflx_top_soil => waterflux_inst%qflx_top_soil_col , & ! Input: [real(r8) (:) ] net water input into soil from top (mm/s) - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] - qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] surface runoff (mm H2O /s) - qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm/s) - qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s) - - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Output: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - - h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates" - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - fcov => soilhydrology_inst%fcov_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - b_infil => soilhydrology_inst%b_infil_col , & ! Input: [real(r8) (:) ] VIC b infiltration parameter - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - fsat => soilhydrology_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil moisture in each VIC layers (liq, mm) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq, mm) - max_infil => soilhydrology_inst%max_infil_col , & ! Input: [real(r8) (:) ] maximum infiltration capacity in VIC (mm) - ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] ice len in each VIC layers(ice, mm) - i_0 => soilhydrology_inst%i_0_col , & ! Input: [real(r8) (:) ] column average soil moisture in top VIC layers (mm) - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical - icefrac => soilhydrology_inst%icefrac_col & ! Output: [real(r8) (:,:) ] fraction of ice - ) - - dtime = get_step_size() - - ! Infiltration into surface soil layer (minus the evaporation) - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! Porosity of soil, partial volume of ice and liquid - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! partition moisture fluxes between soil and h2osfc - if (lun%itype(col%landunit(c)) == istsoil .or. lun%itype(col%landunit(c))==istcrop) then - - ! explicitly use frac_sno=0 if snl=0 - if (snl(c) >= 0) then - fsno=0._r8 - ! if no snow layers, sublimation is removed from h2osoi_ice in drainage - qflx_evap(c)=qflx_evap_grnd(c) - else - fsno=frac_sno(c) - qflx_evap(c)=qflx_ev_soil(c) - endif - - !1. partition surface inputs between soil and h2osfc - qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_surf(c)) - qflx_in_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_surf(c)) - - !2. remove evaporation (snow treated in SnowHydrology) - qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c) - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - frac_h2osfc(c) * qflx_ev_h2osfc(c) - - !3. determine maximum infiltration rate - if (use_vichydro) then - top_moist(c)= 0._r8 - top_ice(c)=0._r8 - top_max_moist(c)= 0._r8 - do j = 1, nlayer - 1 - top_ice(c) = top_ice(c) + ice(c,j) - top_moist(c) = top_moist(c) + moist(c,j) + ice(c,j) - top_max_moist(c) = top_max_moist(c) + max_moist(c,j) - end do - top_icefrac = min(1._r8,top_ice(c)/top_max_moist(c)) - if(qflx_in_soil(c) <= 0._r8) then - rsurf_vic = 0._r8 - else if(max_infil(c) <= 0._r8) then - rsurf_vic = qflx_in_soil(c) - else if((i_0(c) + qflx_in_soil(c)*dtime) > max_infil(c)) then !(Eq.(3a) Wood et al. 1992) - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c))/dtime - else !(Eq.(3b) Wood et al. 1992) - basis = 1._r8 - (i_0(c) + qflx_in_soil(c)*dtime)/max_infil(c) - rsurf_vic = (qflx_in_soil(c)*dtime - top_max_moist(c) + top_moist(c) & - + top_max_moist(c) * basis**(1._r8 + b_infil(c)))/dtime - end if - rsurf_vic = min(qflx_in_soil(c), rsurf_vic) - qinmax = (1._r8 - fsat(c)) * 10._r8**(-e_ice*top_icefrac)*(qflx_in_soil(c) - rsurf_vic) - else - qinmax=(1._r8 - fsat(c)) * minval(10._r8**(-e_ice*(icefrac(c,1:3)))*hksat(c,1:3)) - end if - qflx_infl_excess(c) = max(0._r8,qflx_in_soil(c) - (1.0_r8 - frac_h2osfc(c))*qinmax) - - !4. soil infiltration and h2osfc "run-on" - qflx_infl(c) = qflx_in_soil(c) - qflx_infl_excess(c) - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) + qflx_infl_excess(c) - - !5. surface runoff from h2osfc - if (h2osfcflag==1) then - ! calculate runoff from h2osfc ------------------------------------- - if (frac_h2osfc_nosnow(c) <= pc) then - frac_infclust=0.0_r8 - else - frac_infclust=(frac_h2osfc_nosnow(c)-pc)**mu - endif - endif - - ! limit runoff to value of storage above S(pc) - if(h2osfc(c) >= h2osfc_thresh(c) .and. h2osfcflag/=0) then - ! spatially variable k_wet - k_wet=1.0e-4_r8 * sin((rpi/180.) * col%topo_slope(c)) - qflx_h2osfc_surf(c) = k_wet * frac_infclust * (h2osfc(c) - h2osfc_thresh(c)) - - qflx_h2osfc_surf(c)=min(qflx_h2osfc_surf(c),(h2osfc(c) - h2osfc_thresh(c))/dtime) - else - qflx_h2osfc_surf(c)= 0._r8 - endif - - ! cutoff lower limit - if ( qflx_h2osfc_surf(c) < 1.0e-8) qflx_h2osfc_surf(c) = 0._r8 - - ! use this for non-h2osfc code - if(h2osfcflag==0) then - qflx_h2osfc_surf(c)= 0._r8 - ! shift infiltration excess from h2osfc input to surface runoff - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_infl_excess(c) - qflx_surf(c)= qflx_surf(c) + qflx_infl_excess(c) - qflx_infl_excess(c) = 0._r8 - endif - - qflx_in_h2osfc(c) = qflx_in_h2osfc(c) - qflx_h2osfc_surf(c) - - !6. update h2osfc prior to calculating bottom drainage from h2osfc - h2osfc(c) = h2osfc(c) + qflx_in_h2osfc(c) * dtime - - !-- if all water evaporates, there will be no bottom drainage - if (h2osfc(c) < 0.0) then - qflx_infl(c) = qflx_infl(c) + h2osfc(c)/dtime - h2osfc(c) = 0.0 - qflx_h2osfc_drain(c)= 0._r8 - else - qflx_h2osfc_drain(c)=min(frac_h2osfc(c)*qinmax,h2osfc(c)/dtime) - endif - - if(h2osfcflag==0) then - qflx_h2osfc_drain(c)= max(0._r8,h2osfc(c)/dtime) !ensure no h2osfc - endif - - !7. remove drainage from h2osfc and add to qflx_infl - h2osfc(c) = h2osfc(c) - qflx_h2osfc_drain(c) * dtime - qflx_infl(c) = qflx_infl(c) + qflx_h2osfc_drain(c) - else - ! non-vegetated landunits (i.e. urban) use original CLM4 code - if (snl(c) >= 0) then - ! when no snow present, sublimation is removed in Drainage - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) - qflx_evap_grnd(c) - else - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) & - - (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c) - end if - qflx_h2osfc_surf(c) = 0._r8 - endif - - enddo - - ! No infiltration for impervious urban surfaces - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) /= icol_road_perv) then - qflx_infl(c) = 0._r8 - end if - end do - - end associate - - end subroutine Infiltration - - !----------------------------------------------------------------------- - subroutine WaterTable(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - soilhydrology_inst, soilstate_inst, temperature_inst, waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate watertable, considering aquifer recharge but no drainage. - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o - use clm_varpar , only : nlevsoi - use column_varcon , only : icol_roof, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,fc,i ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: xs(bounds%begc:bounds%endc) ! water needed to bring soil moisture to watmin (mm) - real(r8) :: dzmm(bounds%begc:bounds%endc,1:nlevsoi) ! layer thickness (mm) - integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) - real(r8) :: rsub_bot(bounds%begc:bounds%endc) ! subsurface runoff - bottom drainage (mm/s) - real(r8) :: rsub_top(bounds%begc:bounds%endc) ! subsurface runoff - topographic control (mm/s) - real(r8) :: fff(bounds%begc:bounds%endc) ! decay factor (m-1) - real(r8) :: xsi(bounds%begc:bounds%endc) ! excess soil water above saturation at layer i (mm) - real(r8) :: rous ! aquifer yield (-) - real(r8) :: wh ! smpfz(jwt)-z(jwt) (mm) - real(r8) :: ws ! summation of pore space of layers below water table (mm) - real(r8) :: s_node ! soil wetness (-) - real(r8) :: dzsum ! summation of dzmm of layers below water table (mm) - real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) - real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) - real(r8) :: ka ! hydraulic conductivity of the aquifer (mm/s) - real(r8) :: dza ! fff*(zwt-z(jwt)) (-) - real(r8) :: available_h2osoi_liq ! available soil liquid water in a layer - real(r8) :: imped - real(r8) :: rsub_top_tot - real(r8) :: rsub_top_layer - real(r8) :: qcharge_tot - real(r8) :: qcharge_layer - real(r8) :: theta_unsat - real(r8) :: f_unsat - real(r8) :: s_y - integer :: k,k_frz,k_perch - real(r8) :: sat_lev - real(r8) :: s1 - real(r8) :: s2 - real(r8) :: m - real(r8) :: b - real(r8) :: q_perch - real(r8) :: q_perch_max - real(r8) :: dflag=0._r8 - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] - - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Input: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - - zwt => soilhydrology_inst%zwt_col , & ! Output: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Output: [real(r8) (:) ] perched water table depth (m) - frost_table => soilhydrology_inst%frost_table_col , & ! Output: [real(r8) (:) ] frost table depth (m) - wa => soilhydrology_inst%wa_col , & ! Output: [real(r8) (:) ] water in the unconfined aquifer (mm) - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - origflag => soilhydrology_inst%origflag , & ! Input: logical - - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_drain => waterflux_inst%qflx_drain_col , & ! Output: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) - qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] - ) - - ! Get time step - - dtime = get_step_size() - - ! Convert layer thicknesses from m to mm - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - dzmm(c,j) = dz(c,j)*1.e3_r8 - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_drain(c) = 0._r8 - qflx_rsub_sat(c) = 0._r8 - qflx_drain_perched(c) = 0._r8 - end do - - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - ! allow jwt to equal zero when zwt is in top layer - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end do - - !============================== QCHARGE ========================================= - ! Water table changes due to qcharge - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! use analytical expression for aquifer specific yield - rous = watsat(c,nlevsoi) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,nlevsoi))**(-1./bsw(c,nlevsoi))) - rous=max(rous,0.02_r8) - - !-- water table is below the soil column -------------------------------------- - if(jwt(c) == nlevsoi) then - wa(c) = wa(c) + qcharge(c) * dtime - zwt(c) = zwt(c) - (qcharge(c) * dtime)/1000._r8/rous - else - !-- water table within soil layers 1-9 ------------------------------------- - ! try to raise water table to account for qcharge - qcharge_tot = qcharge(c) * dtime - if(qcharge_tot > 0.) then !rising water table - do j = jwt(c)+1, 1,-1 - ! use analytical expression for specific yield - s_y = watsat(c,j) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,j))**(-1./bsw(c,j))) - s_y=max(s_y,0.02_r8) - - qcharge_layer=min(qcharge_tot,(s_y*(zwt(c) - zi(c,j-1))*1.e3)) - qcharge_layer=max(qcharge_layer,0._r8) - - if(s_y > 0._r8) zwt(c) = zwt(c) - qcharge_layer/s_y/1000._r8 - - qcharge_tot = qcharge_tot - qcharge_layer - if (qcharge_tot <= 0.) exit - enddo - else ! deepening water table (negative qcharge) - do j = jwt(c)+1, nlevsoi - ! use analytical expression for specific yield - s_y = watsat(c,j) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,j))**(-1./bsw(c,j))) - s_y=max(s_y,0.02_r8) - - qcharge_layer=max(qcharge_tot,-(s_y*(zi(c,j) - zwt(c))*1.e3)) - qcharge_layer=min(qcharge_layer,0._r8) - qcharge_tot = qcharge_tot - qcharge_layer - if (qcharge_tot >= 0.) then - zwt(c) = zwt(c) - qcharge_layer/s_y/1000._r8 - exit - else - zwt(c) = zi(c,j) - endif - - enddo - if (qcharge_tot > 0.) zwt(c) = zwt(c) - qcharge_tot/1000._r8/rous - endif - - !-- recompute jwt for following calculations --------------------------------- - ! allow jwt to equal zero when zwt is in top layer - jwt(c) = nlevsoi - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - endif - enddo - - - !== BASEFLOW ================================================== - ! perched water table code - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! define frost table as first frozen layer with unfrozen layer above it - if(t_soisno(c,1) > tfrz) then - k_frz=nlevsoi - else - k_frz=1 - endif - - do k=2, nlevsoi - if (t_soisno(c,k-1) > tfrz .and. t_soisno(c,k) <= tfrz) then - k_frz=k - exit - endif - enddo - - frost_table(c)=z(c,k_frz) - - ! initialize perched water table to frost table, and qflx_drain_perched(c) to zero - zwt_perched(c)=frost_table(c) - - !=================== water table above frost table ============================= - ! if water table is above frost table, do not use topmodel baseflow formulation - if (zwt(c) < frost_table(c) .and. t_soisno(c,k_frz) <= tfrz & - .and. origflag == 0) then - else - !=================== water table below frost table ============================= - !-- compute possible perched water table *and* groundwater table afterwards - ! locate perched water table from bottom up starting at frost table - ! sat_lev is an arbitrary saturation level used to determine perched water table - sat_lev=0.9 - - k_perch=1 - do k=k_frz,1,-1 - h2osoi_vol(c,k) = h2osoi_liq(c,k)/(dz(c,k)*denh2o) & - + h2osoi_ice(c,k)/(dz(c,k)*denice) - - if (h2osoi_vol(c,k)/watsat(c,k) <= sat_lev) then - k_perch=k - exit - endif - enddo - - ! if frost_table = nlevsoi, only compute perched water table if frozen - if (t_soisno(c,k_frz) > tfrz) k_perch=k_frz - - ! if perched water table exists - if (k_frz > k_perch) then - ! interpolate between k_perch and k_perch+1 to find perched water table height - s1 = (h2osoi_liq(c,k_perch)/(dz(c,k_perch)*denh2o) & - + h2osoi_ice(c,k_perch)/(dz(c,k_perch)*denice))/watsat(c,k_perch) - s2 = (h2osoi_liq(c,k_perch+1)/(dz(c,k_perch+1)*denh2o) & - + h2osoi_ice(c,k_perch+1)/(dz(c,k_perch+1)*denice))/watsat(c,k_perch+1) - - m=(z(c,k_perch+1)-z(c,k_perch))/(s2-s1) - b=z(c,k_perch+1)-m*s2 - zwt_perched(c)=max(0._r8,m*sat_lev+b) - - endif !k_frz > k_perch - endif - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Renew the ice and liquid mass due to condensation - - if (snl(c)+1 >= 1) then - - ! make consistent with how evap_grnd removed in infiltration - h2osoi_liq(c,1) = h2osoi_liq(c,1) + (1._r8 - frac_h2osfc(c))*qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (1._r8 - frac_h2osfc(c))*qflx_dew_snow(c) * dtime - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (1._r8 - frac_h2osfc(c)) * qflx_sub_snow(c) * dtime - end if - end if - end do - - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - ! Renew the ice and liquid mass due to condensation for urban roof and impervious road - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - if (snl(c)+1 >= 1) then - h2osoi_liq(c,1) = h2osoi_liq(c,1) + qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (qflx_dew_snow(c) * dtime) - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (qflx_sub_snow(c) * dtime) - end if - end if - end if - - end do - - end associate - - end subroutine WaterTable - - !----------------------------------------------------------------------- - subroutine Drainage(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, filter_urbanc, & - temperature_inst, soilhydrology_inst, soilstate_inst, waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate subsurface drainage - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert - use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic - use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(temperature_type) , intent(in) :: temperature_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'Drainage' ! subroutine name - integer :: c,j,fc,i ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: xs(bounds%begc:bounds%endc) ! water needed to bring soil moisture to watmin (mm) - real(r8) :: dzmm(bounds%begc:bounds%endc,1:nlevsoi) ! layer thickness (mm) - integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) - real(r8) :: rsub_bot(bounds%begc:bounds%endc) ! subsurface runoff - bottom drainage (mm/s) - real(r8) :: rsub_top(bounds%begc:bounds%endc) ! subsurface runoff - topographic control (mm/s) - real(r8) :: fff(bounds%begc:bounds%endc) ! decay factor (m-1) - real(r8) :: xsi(bounds%begc:bounds%endc) ! excess soil water above saturation at layer i (mm) - real(r8) :: xsia(bounds%begc:bounds%endc) ! available pore space at layer i (mm) - real(r8) :: xs1(bounds%begc:bounds%endc) ! excess soil water above saturation at layer 1 (mm) - real(r8) :: smpfz(1:nlevsoi) ! matric potential of layer right above water table (mm) - real(r8) :: wtsub ! summation of hk*dzmm for layers below water table (mm**2/s) - real(r8) :: rous ! aquifer yield (-) - real(r8) :: wh ! smpfz(jwt)-z(jwt) (mm) - real(r8) :: wh_zwt ! water head at the water table depth (mm) - real(r8) :: ws ! summation of pore space of layers below water table (mm) - real(r8) :: s_node ! soil wetness (-) - real(r8) :: dzsum ! summation of dzmm of layers below water table (mm) - real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) - real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) - real(r8) :: ka ! hydraulic conductivity of the aquifer (mm/s) - real(r8) :: dza ! fff*(zwt-z(jwt)) (-) - real(r8) :: available_h2osoi_liq ! available soil liquid water in a layer - real(r8) :: rsub_top_max - real(r8) :: h2osoi_vol - real(r8) :: imped - real(r8) :: rsub_top_tot - real(r8) :: rsub_top_layer - real(r8) :: qcharge_tot - real(r8) :: qcharge_layer - real(r8) :: theta_unsat - real(r8) :: f_unsat - real(r8) :: s_y - integer :: k,k_frz,k_perch - real(r8) :: sat_lev - real(r8) :: s1 - real(r8) :: s2 - real(r8) :: m - real(r8) :: b - real(r8) :: q_perch - real(r8) :: q_perch_max - real(r8) :: vol_ice - real(r8) :: dsmax_tmp(bounds%begc:bounds%endc) ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: rsub_tmp ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: frac ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: rel_moist ! relative moisture, temporary variable - real(r8) :: wtsub_vic ! summation of hk*dzmm for layers in the third VIC layer - !----------------------------------------------------------------------- - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - - depth => soilhydrology_inst%depth_col , & ! Input: [real(r8) (:,:) ] VIC soil depth - c_param => soilhydrology_inst%c_param_col , & ! Input: [real(r8) (:) ] baseflow exponent (Qb) - Dsmax => soilhydrology_inst%dsmax_col , & ! Input: [real(r8) (:) ] max. velocity of baseflow (mm/day) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq) - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) - Ds => soilhydrology_inst%ds_col , & ! Input: [real(r8) (:) ] fracton of Dsmax where non-linear baseflow begins - Wsvic => soilhydrology_inst%Wsvic_col , & ! Input: [real(r8) (:) ] fraction of maximum soil moisutre where non-liear base flow occurs - icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] fraction of ice in layer - hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - wa => soilhydrology_inst%wa_col , & ! Input: [real(r8) (:) ] water in the unconfined aquifer (mm) - ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical - - qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess liquid h2o due to snow capping (outgoing) (mm H2O /s) [+] - qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Output: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Output: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_drain => waterflux_inst%qflx_drain_col , & ! Output: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Output: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes (mm H2O /s) - qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - ) - - ! Get time step - - dtime = get_step_size() - - ! Convert layer thicknesses from m to mm - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - dzmm(c,j) = dz(c,j)*1.e3_r8 - - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - icefrac(c,j) = min(1._r8,vol_ice/watsat(c,j)) - end do - end do - - ! Initial set - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_drain(c) = 0._r8 - rsub_bot(c) = 0._r8 - qflx_rsub_sat(c) = 0._r8 - rsub_top(c) = 0._r8 - fracice_rsub(c) = 0._r8 - - end do - - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - ! allow jwt to equal zero when zwt is in top layer - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end do - - rous = 0.2_r8 - - !== BASEFLOW ================================================== - ! perched water table code - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! specify maximum drainage rate - q_perch_max = 1.e-5_r8 * sin(col%topo_slope(c) * (rpi/180._r8)) - - ! if layer containing water table is frozen, compute the following: - ! frost table, perched water table, and drainage from perched saturated layer - - ! define frost table as first frozen layer with unfrozen layer above it - if(t_soisno(c,1) > tfrz) then - k_frz=nlevsoi - else - k_frz=1 - endif - - do k=2, nlevsoi - if (t_soisno(c,k-1) > tfrz .and. t_soisno(c,k) <= tfrz) then - k_frz=k - exit - endif - enddo - - frost_table(c)=z(c,k_frz) - - ! initialize perched water table to frost table, and qflx_drain_perched(c) to zero - zwt_perched(c)=frost_table(c) - qflx_drain_perched(c) = 0._r8 - - !=================== water table above frost table ============================= - ! if water table is above frost table, do not use topmodel baseflow formulation - - if (zwt(c) < frost_table(c) .and. t_soisno(c,k_frz) <= tfrz & - .and. origflag == 0) then - ! compute drainage from perched saturated region - wtsub = 0._r8 - q_perch = 0._r8 - do k = jwt(c)+1, k_frz - imped=10._r8**(-e_ice*(0.5_r8*(icefrac(c,k)+icefrac(c,min(nlevsoi, k+1))))) - q_perch = q_perch + imped*hksat(c,k)*dzmm(c,k) - wtsub = wtsub + dzmm(c,k) - end do - if (wtsub > 0._r8) q_perch = q_perch/wtsub - - qflx_drain_perched(c) = q_perch_max * q_perch & - *(frost_table(c) - zwt(c)) - - ! remove drainage from perched saturated layers - rsub_top_tot = - qflx_drain_perched(c) * dtime - do k = jwt(c)+1, k_frz - rsub_top_layer=max(rsub_top_tot,-(h2osoi_liq(c,k)-watmin)) - rsub_top_layer=min(rsub_top_layer,0._r8) - rsub_top_tot = rsub_top_tot - rsub_top_layer - - h2osoi_liq(c,k) = h2osoi_liq(c,k) + rsub_top_layer - - if (rsub_top_tot >= 0.) then - zwt(c) = zwt(c) - rsub_top_layer/eff_porosity(c,k)/1000._r8 - exit - else - zwt(c) = zi(c,k) - endif - enddo - - ! if rsub_top_tot is greater than available water (above frost table), - ! then decrease qflx_drain_perched by residual amount for water balance - qflx_drain_perched(c) = qflx_drain_perched(c) + rsub_top_tot/dtime - - !-- recompute jwt --------------------------------------------------------- - ! allow jwt to equal zero when zwt is in top layer - jwt(c) = nlevsoi - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - else - !=================== water table below frost table ============================= - !-- compute possible perched water table *and* groundwater table afterwards - ! locate perched water table from bottom up starting at frost table - ! sat_lev is an arbitrary saturation level used to determine perched water table - sat_lev=0.9 - - k_perch=1 - do k=k_frz,1,-1 - h2osoi_vol = h2osoi_liq(c,k)/(dz(c,k)*denh2o) & - + h2osoi_ice(c,k)/(dz(c,k)*denice) - - if (h2osoi_vol/watsat(c,k) <= sat_lev) then - k_perch=k - exit - endif - enddo - - ! if frost_table = nlevsoi, only compute perched water table if frozen - if (t_soisno(c,k_frz) > tfrz) k_perch=k_frz - - ! if perched water table exists - if (k_frz > k_perch) then - ! interpolate between k_perch and k_perch+1 to find perched water table height - s1 = (h2osoi_liq(c,k_perch)/(dz(c,k_perch)*denh2o) & - + h2osoi_ice(c,k_perch)/(dz(c,k_perch)*denice))/watsat(c,k_perch) - s2 = (h2osoi_liq(c,k_perch+1)/(dz(c,k_perch+1)*denh2o) & - + h2osoi_ice(c,k_perch+1)/(dz(c,k_perch+1)*denice))/watsat(c,k_perch+1) - - m=(z(c,k_perch+1)-z(c,k_perch))/(s2-s1) - b=z(c,k_perch+1)-m*s2 - zwt_perched(c)=max(0._r8,m*sat_lev+b) - - ! compute drainage from perched saturated region - wtsub = 0._r8 - q_perch = 0._r8 - do k = k_perch, k_frz - imped=10._r8**(-e_ice*(0.5_r8*(icefrac(c,k)+icefrac(c,min(nlevsoi, k+1))))) - q_perch = q_perch + imped*hksat(c,k)*dzmm(c,k) - wtsub = wtsub + dzmm(c,k) - end do - if (wtsub > 0._r8) q_perch = q_perch/wtsub - - qflx_drain_perched(c) = q_perch_max * q_perch & - *(frost_table(c) - zwt_perched(c)) - - ! no perched water table drainage if using original formulation - if(origflag == 1) qflx_drain_perched(c) = 0._r8 - - ! remove drainage from perched saturated layers - rsub_top_tot = - qflx_drain_perched(c) * dtime - do k = k_perch+1, k_frz - rsub_top_layer=max(rsub_top_tot,-(h2osoi_liq(c,k)-watmin)) - rsub_top_layer=min(rsub_top_layer,0._r8) - rsub_top_tot = rsub_top_tot - rsub_top_layer - - h2osoi_liq(c,k) = h2osoi_liq(c,k) + rsub_top_layer - - if (rsub_top_tot >= 0.) then - zwt_perched(c) = zwt_perched(c) - rsub_top_layer/eff_porosity(c,k)/1000._r8 - exit - else - zwt_perched(c) = zi(c,k) - endif - - enddo - - ! if rsub_top_tot is greater than available water (above frost table), - ! then decrease qflx_drain_perched by residual amount for water balance - qflx_drain_perched(c) = qflx_drain_perched(c) + rsub_top_tot/dtime - - else - qflx_drain_perched(c) = 0._r8 - endif !k_frz > k_perch - - !-- Topographic runoff ---------------------------------------------------------------------- - fff(c) = 1._r8/ hkdepth(c) - dzsum = 0._r8 - icefracsum = 0._r8 - do j = max(jwt(c),1), nlevsoi - dzsum = dzsum + dzmm(c,j) - icefracsum = icefracsum + icefrac(c,j) * dzmm(c,j) - end do - ! add ice impedance factor to baseflow - if(origflag == 1) then - if (use_vichydro) then - call endrun(msg="VICHYDRO is not available for origflag=1"//errmsg(sourcefile, __LINE__)) - else - fracice_rsub(c) = max(0._r8,exp(-3._r8*(1._r8-(icefracsum/dzsum))) & - - exp(-3._r8))/(1.0_r8-exp(-3._r8)) - imped=(1._r8 - fracice_rsub(c)) - rsub_top_max = 5.5e-3_r8 - end if - else - if (use_vichydro) then - imped=10._r8**(-e_ice*min(1.0_r8,ice(c,nlayer)/max_moist(c,nlayer))) - dsmax_tmp(c) = Dsmax(c) * dtime/ secspday !mm/day->mm/dtime - rsub_top_max = dsmax_tmp(c) - else - imped=10._r8**(-e_ice*(icefracsum/dzsum)) - rsub_top_max = 10._r8 * sin((rpi/180.) * col%topo_slope(c)) - end if - endif - if (use_vichydro) then - ! ARNO model for the bottom soil layer (based on bottom soil layer - ! moisture from previous time step - ! use watmin instead for resid_moist to be consistent with default hydrology - rel_moist = (moist(c,nlayer) - watmin)/(max_moist(c,nlayer)-watmin) - frac = (Ds(c) * rsub_top_max )/Wsvic(c) - rsub_tmp = (frac * rel_moist)/dtime - if(rel_moist > Wsvic(c))then - frac = (rel_moist - Wsvic(c))/(1.0_r8 - Wsvic(c)) - rsub_tmp = rsub_tmp + (rsub_top_max * (1.0_r8 - Ds(c)/Wsvic(c)) *frac**c_param(c))/dtime - end if - rsub_top(c) = imped * rsub_tmp - ! make sure baseflow isn't negative - rsub_top(c) = max(0._r8, rsub_top(c)) - else - rsub_top(c) = imped * rsub_top_max* exp(-fff(c)*zwt(c)) - end if - - ! use analytical expression for aquifer specific yield - rous = watsat(c,nlevsoi) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,nlevsoi))**(-1./bsw(c,nlevsoi))) - rous=max(rous,0.02_r8) - - !-- water table is below the soil column -------------------------------------- - if(jwt(c) == nlevsoi) then - wa(c) = wa(c) - rsub_top(c) * dtime - zwt(c) = zwt(c) + (rsub_top(c) * dtime)/1000._r8/rous - h2osoi_liq(c,nlevsoi) = h2osoi_liq(c,nlevsoi) + max(0._r8,(wa(c)-aquifer_water_baseline)) - wa(c) = min(wa(c), aquifer_water_baseline) - else - !-- water table within soil layers 1-9 ------------------------------------- - !============================== RSUB_TOP ========================================= - !-- Now remove water via rsub_top - rsub_top_tot = - rsub_top(c) * dtime - !should never be positive... but include for completeness - if(rsub_top_tot > 0.) then !rising water table - - call endrun(msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) - - else ! deepening water table - if (use_vichydro) then - wtsub_vic = 0._r8 - do j = (nlvic(1)+nlvic(2)+1), nlevsoi - wtsub_vic = wtsub_vic + hk_l(c,j)*dzmm(c,j) - end do - - do j = (nlvic(1)+nlvic(2)+1), nlevsoi - rsub_top_layer=max(rsub_top_tot, rsub_top_tot*hk_l(c,j)*dzmm(c,j)/wtsub_vic) - rsub_top_layer=min(rsub_top_layer,0._r8) - h2osoi_liq(c,j) = h2osoi_liq(c,j) + rsub_top_layer - rsub_top_tot = rsub_top_tot - rsub_top_layer - end do - else - do j = jwt(c)+1, nlevsoi - ! use analytical expression for specific yield - s_y = watsat(c,j) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,j))**(-1./bsw(c,j))) - s_y=max(s_y,0.02_r8) - - rsub_top_layer=max(rsub_top_tot,-(s_y*(zi(c,j) - zwt(c))*1.e3)) - rsub_top_layer=min(rsub_top_layer,0._r8) - h2osoi_liq(c,j) = h2osoi_liq(c,j) + rsub_top_layer - - rsub_top_tot = rsub_top_tot - rsub_top_layer - - if (rsub_top_tot >= 0.) then - zwt(c) = zwt(c) - rsub_top_layer/s_y/1000._r8 - - exit - else - zwt(c) = zi(c,j) - endif - enddo - end if - - !-- remove residual rsub_top --------------------------------------------- - zwt(c) = zwt(c) - rsub_top_tot/1000._r8/rous - wa(c) = wa(c) + rsub_top_tot - endif - - !-- recompute jwt --------------------------------------------------------- - ! allow jwt to equal zero when zwt is in top layer - jwt(c) = nlevsoi - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end if! end of jwt if construct - - zwt(c) = max(0.0_r8,zwt(c)) - zwt(c) = min(80._r8,zwt(c)) - - endif - - end do - - ! excessive water above saturation added to the above unsaturated layer like a bucket - ! if column fully saturated, excess water goes to runoff - - do j = nlevsoi,2,-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - xsi(c) = max(h2osoi_liq(c,j)-eff_porosity(c,j)*dzmm(c,j),0._r8) - h2osoi_liq(c,j) = min(eff_porosity(c,j)*dzmm(c,j), h2osoi_liq(c,j)) - h2osoi_liq(c,j-1) = h2osoi_liq(c,j-1) + xsi(c) - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! watmin addition to fix water balance errors - xs1(c) = max(max(h2osoi_liq(c,1)-watmin,0._r8)- & - max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1)-watmin)),0._r8) - h2osoi_liq(c,1) = h2osoi_liq(c,1) - xs1(c) - - if (lun%urbpoi(col%landunit(c))) then - qflx_rsub_sat(c) = xs1(c) / dtime - else - if(h2osfcflag == 1) then - ! send this water up to h2osfc rather than sending to drainage - h2osfc(c) = h2osfc(c) + xs1(c) - qflx_rsub_sat(c) = 0._r8 - else - ! use original code to send water to drainage (non-h2osfc case) - qflx_rsub_sat(c) = xs1(c) / dtime - endif - endif - ! add in ice check - xs1(c) = max(max(h2osoi_ice(c,1),0._r8)-max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_liq(c,1))),0._r8) - h2osoi_ice(c,1) = min(max(0._r8,pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_liq(c,1)), h2osoi_ice(c,1)) - qflx_ice_runoff_xs(c) = xs1(c) / dtime - end do - - ! Limit h2osoi_liq to be greater than or equal to watmin. - ! Get water needed to bring h2osoi_liq equal watmin from lower layer. - ! If insufficient water in soil layers, get from aquifer water - - do j = 1, nlevsoi-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin - h2osoi_liq(c,j) - ! deepen water table if water is passed from below zwt layer - if(j == jwt(c)) then - zwt(c) = zwt(c) + xs(c)/eff_porosity(c,j)/1000._r8 - endif - else - xs(c) = 0._r8 - end if - h2osoi_liq(c,j ) = h2osoi_liq(c,j ) + xs(c) - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) - xs(c) - end do - end do - - ! Get water for bottom layer from layers above if possible - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin-h2osoi_liq(c,j) - searchforwater: do i = nlevsoi-1, 1, -1 - available_h2osoi_liq = max(h2osoi_liq(c,i)-watmin-xs(c),0._r8) - if (available_h2osoi_liq >= xs(c)) then - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - h2osoi_liq(c,i) = h2osoi_liq(c,i) - xs(c) - xs(c) = 0._r8 - exit searchforwater - else - h2osoi_liq(c,j) = h2osoi_liq(c,j) + available_h2osoi_liq - h2osoi_liq(c,i) = h2osoi_liq(c,i) - available_h2osoi_liq - xs(c) = xs(c) - available_h2osoi_liq - end if - end do searchforwater - else - xs(c) = 0._r8 - end if - ! Needed in case there is no water to be found - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - ! Instead of removing water from aquifer where it eventually - ! shows up as excess drainage to the ocean, take it back out of - ! drainage - rsub_top(c) = rsub_top(c) - xs(c)/dtime - - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Sub-surface runoff and drainage - - qflx_drain(c) = qflx_rsub_sat(c) + rsub_top(c) - - ! Set imbalance for snow capping - - qflx_qrgwl(c) = qflx_snwcp_liq(c) - - end do - - ! No drainage for urban columns (except for pervious road as computed above) - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) /= icol_road_perv) then - qflx_drain(c) = 0._r8 - ! This must be done for roofs and impervious road (walls will be zero) - qflx_qrgwl(c) = qflx_snwcp_liq(c) - end if - end do - - end associate - - end subroutine Drainage - - !----------------------------------------------------------------------- - subroutine CLMVICMap(bounds, numf, filter, & - soilhydrology_inst, waterstate_inst) - ! - ! !DESCRIPTION: - ! Performs the mapping from CLM layers to VIC layers - ! CLM hydrologically active soil layers are mapped to three VIC layers - ! by assigning the first nlvic(1) layers to VIC layer 1 - ! the next nlvic(2) layers to VIC alyer 2 - ! and the remaining to VIC layer 3 - ! mapping from VIC to CLM layers, M.Huang - ! - ! !USES: - use clm_varcon , only : denh2o, denice, watmin - use clm_varpar , only : nlevsoi, nlayer, nlayert, nlevgrnd - use decompMod , only : bounds_type - ! - ! !REVISION HISTORY: - ! Created by Maoyi Huang - ! 11/13/2012, Maoyi Huang: rewrite the mapping modules in CLM4VIC - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: numf ! number of column soil points in column filter - integer , intent(in) :: filter(:) ! column filter for soil points - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - ! - ! !LOCAL VARIABLES - real(r8) :: ice0(1:nlayer) ! last step ice lens (mm) (new) - real(r8) :: moist0(1:nlayer) ! last step soil water (mm) (new) - integer :: i, j, c, fc - ! note: in CLM4 h2osoil_liq unit is kg/m2, in VIC moist is mm - ! h2osoi_ice is actually water equivalent ice content. - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) - - depth => soilhydrology_inst%depth_col , & ! Input: [real(r8) (:,:) ] layer depth of upper layer (m) - porosity => soilhydrology_inst%porosity_col , & ! Input: [real(r8) (:,:) ] soil porisity (1-bulk_density/soil_density) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] max layer moist + ice (mm) - vic_clm_fract => soilhydrology_inst%vic_clm_fract_col , & ! Input: [real(r8) (:,:,:) ] fraction of VIC layers in each CLM layer - moist => soilhydrology_inst%moist_col , & ! Output: [real(r8) (:,:) ] liquid water (mm) - ice => soilhydrology_inst%ice_col , & ! Output: [real(r8) (:,:) ] ice lens (mm) - moist_vol => soilhydrology_inst%moist_vol_col & ! Output: [real(r8) (:,:) ] volumetric soil moisture for VIC soil layers - ) - - ! map CLM to VIC - do fc = 1, numf - c = filter(fc) - do i = 1, nlayer - ice0(i) = ice(c,i) - moist0(i) = moist(c,i) - ice(c,i) = 0._r8 - moist(c,i) = 0._r8 - do j = 1, nlevsoi - ice(c,i) = ice(c,i) + h2osoi_ice(c,j) * vic_clm_fract(c,i,j) - moist(c,i) = moist(c,i) + h2osoi_liq(c,j) * vic_clm_fract(c,i,j) - end do - ice(c,i) = min((moist0(i) + ice0(i)), ice(c,i)) - ice(c,i) = max(0._r8, ice(c,i)) - moist(c,i) = max(watmin, moist(c,i)) - moist(c,i) = min(max_moist(c,i)-ice(c,i), moist(c,i)) - moist_vol(c,i) = moist(c,i)/(depth(c,i)*denice) + ice(c,i)/(depth(c,i)*denh2o) - moist_vol(c,i) = min(porosity(c,i), moist_vol(c,i)) - moist_vol(c,i) = max(0.01_r8, moist_vol(c,i)) - end do - - ! hydrologic inactive layers - ice(c, nlayer+1:nlayert) = h2osoi_ice(c, nlevsoi+1:nlevgrnd) - moist(c, nlayer+1:nlayert) = h2osoi_liq(c, nlevsoi+1:nlevgrnd) - moist_vol(c, nlayer+1:nlayert) = h2osoi_vol(c, nlevsoi+1:nlevgrnd) - end do - - end associate - - end subroutine CLMVICMap - -!#3 - !----------------------------------------------------------------------- - subroutine PerchedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - temperature_inst, waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate watertable, considering aquifer recharge but no drainage. - ! - ! !USES: - use clm_varcon , only : pondmx, tfrz, watmin,denice,denh2o - use clm_varpar , only : nlevsoi - use column_varcon , only : icol_roof, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,fc,i ! indices - real(r8) :: s_y - integer :: k,k_frz,k_perch,k_zwt - real(r8) :: sat_lev - real(r8) :: s1 - real(r8) :: s2 - real(r8) :: m - real(r8) :: b - integer :: sat_flag - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - zwt => soilhydrology_inst%zwt_col , & ! Output: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Output: [real(r8) (:) ] perched water table depth (m) - frost_table => soilhydrology_inst%frost_table_col , & ! Output: [real(r8) (:) ] frost table depth (m) - origflag => soilhydrology_inst%origflag & ! Input: logical - ) - - ! calculate perched water table location - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! define frost table as first frozen layer with unfrozen layer above it - if(t_soisno(c,1) > tfrz) then - k_frz=nlevsoi - else - k_frz=1 - endif - - do k=2, nlevsoi - if (t_soisno(c,k-1) > tfrz .and. t_soisno(c,k) <= tfrz) then - k_frz=k - exit - endif - enddo - - frost_table(c)=z(c,k_frz) - - ! initialize perched water table to frost table, and qflx_drain_perched(c) to zero - zwt_perched(c)=frost_table(c) - - !======= water table above frost table =================== - ! if water table is above frost table, do nothing - if (zwt(c) < frost_table(c) .and. t_soisno(c,k_frz) <= tfrz & - .and. origflag == 0) then - else - !========== water table below frost table ============ - ! locate perched water table from bottom up starting at - ! frost table sat_lev is an arbitrary saturation level - ! used to determine perched water table - - sat_lev=0.9 - - k_perch=1 - do k=k_frz,1,-1 - h2osoi_vol(c,k) = h2osoi_liq(c,k)/(dz(c,k)*denh2o) & - + h2osoi_ice(c,k)/(dz(c,k)*denice) - - if (h2osoi_vol(c,k)/watsat(c,k) <= sat_lev) then - k_perch=k - exit - endif - enddo - - ! if frost_table = nlevsoi, only compute perched water table if frozen - if (t_soisno(c,k_frz) > tfrz) k_perch=k_frz - - ! if perched water table exists - ! interpolate between k_perch and k_perch+1 to find - ! perched water table height - if (k_frz > k_perch) then - s1 = (h2osoi_liq(c,k_perch)/(dz(c,k_perch)*denh2o) & - + h2osoi_ice(c,k_perch)/(dz(c,k_perch)*denice))/watsat(c,k_perch) - s2 = (h2osoi_liq(c,k_perch+1)/(dz(c,k_perch+1)*denh2o) & - + h2osoi_ice(c,k_perch+1)/(dz(c,k_perch+1)*denice))/watsat(c,k_perch+1) - - m=(z(c,k_perch+1)-z(c,k_perch))/(s2-s1) - b=z(c,k_perch+1)-m*s2 - zwt_perched(c)=max(0._r8,m*sat_lev+b) - - endif !k_frz > k_perch - endif - end do - - end associate - - end subroutine PerchedWaterTable - -!#4 - !----------------------------------------------------------------------- - subroutine PerchedLateralFlow(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate subsurface drainage from perched saturated zone - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert - use clm_varcon , only : pondmx, tfrz, watmin,rpi, secspday, nlvic - use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'PerchedLateralFlow' ! subroutine name - integer :: c,j,fc,i ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: dzmm(bounds%begc:bounds%endc,1:nlevsoi) ! layer thickness (mm) - real(r8) :: wtsub ! summation of hk*dzmm for layers below water table (mm**2/s) - real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) - real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) - real(r8) :: h2osoi_vol - real(r8) :: imped - real(r8) :: drainage_tot - real(r8) :: drainage_layer - real(r8) :: s_y - integer :: k,k_frz,k_perch - real(r8) :: sat_lev - real(r8) :: s1, s2, m, b - real(r8) :: q_perch - real(r8) :: q_perch_max - real(r8) :: vol_ice - !----------------------------------------------------------------------- - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - - icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] fraction of ice in layer - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - origflag => soilhydrology_inst%origflag , & ! Input: logical - - qflx_drain_perched => waterflux_inst%qflx_drain_perched_col , & ! Output: [real(r8) (:) ] perched wt sub-surface runoff (mm H2O /s) - - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - ) - - ! Get time step - - dtime = get_step_size() - - ! Compute ice fraction in each layer - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - dzmm(c,j) = dz(c,j)*1.e3_r8 - - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - icefrac(c,j) = min(1._r8,vol_ice/watsat(c,j)) - end do - end do - - ! compute drainage from perched saturated region - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - qflx_drain_perched(c) = 0._r8 - - if ((frost_table(c) > zwt_perched(c)) .and. origflag == 0) then - - ! specify maximum drainage rate - q_perch_max = 1.e-5_r8 * sin(col%topo_slope(c) * (rpi/180._r8)) - - ! calculate frost table and perched water table locations - do k=1, nlevsoi - if (frost_table(c) >= zi(c,k-1) .and. frost_table(c) <= zi(c,k)) then - k_frz=k - exit - endif - enddo - - do k=1, nlevsoi - if (zwt_perched(c) >= zi(c,k-1) .and. zwt_perched(c) <= zi(c,k)) then - k_perch=k - exit - endif - enddo - - wtsub = 0._r8 - q_perch = 0._r8 - do k = k_perch, k_frz - imped=10._r8**(-e_ice*(0.5_r8*(icefrac(c,k)+icefrac(c,min(nlevsoi, k+1))))) - q_perch = q_perch + imped*hksat(c,k)*dzmm(c,k) - wtsub = wtsub + dzmm(c,k) - end do - if (wtsub > 0._r8) q_perch = q_perch/wtsub - - qflx_drain_perched(c) = q_perch_max * q_perch & - *(frost_table(c) - zwt_perched(c)) - - ! no perched water table drainage if using original formulation - if(origflag == 1) qflx_drain_perched(c) = 0._r8 - - ! if perched water table exists - if (k_frz > k_perch) then - ! remove drainage from perched saturated layers - drainage_tot = - qflx_drain_perched(c) * dtime - do k = k_perch+1, k_frz - drainage_layer=max(drainage_tot,-(h2osoi_liq(c,k)-watmin)) - drainage_layer=min(drainage_layer,0._r8) - drainage_tot = drainage_tot - drainage_layer - - h2osoi_liq(c,k) = h2osoi_liq(c,k) + drainage_layer - - s_y = watsat(c,k) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,k))**(-1./bsw(c,k))) - s_y=max(s_y,0.02_r8) - if (drainage_tot >= 0.) then - zwt_perched(c) = zwt_perched(c) - drainage_layer/s_y/1000._r8 - exit - else - zwt_perched(c) = zi(c,k) - endif - enddo - - ! if drainage_tot is greater than available water - ! (above frost table), then decrease qflx_drain_perched - ! by residual amount for water balance - qflx_drain_perched(c) = qflx_drain_perched(c) + drainage_tot/dtime - else - qflx_drain_perched(c) = 0._r8 - endif !k_frz > k_perch - endif - enddo - - end associate - - end subroutine PerchedLateralFlow - -!#5 - !----------------------------------------------------------------------- - subroutine ThetaBasedWaterTable(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate watertable, considering aquifer recharge but no drainage. - ! - ! !USES: - use clm_varcon , only : denice,denh2o - use clm_varpar , only : nlevsoi - use column_varcon , only : icol_roof, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,fc,i ! indices - integer :: k,k_zwt - real(r8) :: sat_lev - real(r8) :: s1,s2,m,b ! temporary variables used to interpolate theta - integer :: sat_flag - !----------------------------------------------------------------------- - - associate( & - nbedrock => col%nbedrock , & ! Input: [real(r8) (:,:) ] depth to bedrock (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - zwt => soilhydrology_inst%zwt_col & ! Output: [real(r8) (:) ] water table depth (m) - ) - - ! calculate water table based on soil moisture state - ! this is a simple search for 1st layer with soil moisture - ! less than specified threshold (sat_lev) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - -! initialize to depth of bottom of lowest layer - zwt(c)=zi(c,nlevsoi) - - ! locate water table from bottom up starting at bottom of soil column - ! sat_lev is an arbitrary saturation level used to determine water table - sat_lev=0.9 - - k_zwt=nbedrock(c) - sat_flag=1 !will remain unchanged if all layers at saturation - do k=nbedrock(c),1,-1 - h2osoi_vol(c,k) = h2osoi_liq(c,k)/(dz(c,k)*denh2o) & - + h2osoi_ice(c,k)/(dz(c,k)*denice) - - if (h2osoi_vol(c,k)/watsat(c,k) <= sat_lev) then - k_zwt=k - sat_flag=0 - exit - endif - enddo - if (sat_flag == 1) k_zwt=1 - - ! if soil column above sat_lev, set water table to lower - ! interface of first layer - if (k_zwt == 1) then - zwt(c)=zi(c,1) - else if (k_zwt < nbedrock(c)) then - ! interpolate between k_zwt and k_zwt+1 to find water table height - s1 = (h2osoi_liq(c,k_zwt)/(dz(c,k_zwt)*denh2o) & - + h2osoi_ice(c,k_zwt)/(dz(c,k_zwt)*denice))/watsat(c,k_zwt) - s2 = (h2osoi_liq(c,k_zwt+1)/(dz(c,k_zwt+1)*denh2o) & - + h2osoi_ice(c,k_zwt+1)/(dz(c,k_zwt+1)*denice))/watsat(c,k_zwt+1) - - m=(z(c,k_zwt+1)-z(c,k_zwt))/(s2-s1) - b=z(c,k_zwt+1)-m*s2 - zwt(c)=max(0._r8,m*sat_lev+b) - else - zwt(c)=zi(c,nbedrock(c)) - endif - - end do - - end associate - - end subroutine ThetaBasedWaterTable - - -!#6 - !----------------------------------------------------------------------- - subroutine LateralFlowPowerLaw(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc,soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate subsurface drainage - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi, nlevgrnd, nlayer, nlayert - use clm_varcon , only : pondmx, watmin,rpi, secspday, nlvic - use column_varcon , only : icol_roof, icol_road_imperv, icol_road_perv - use abortutils , only : endrun - use GridcellType , only : grc - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'Drainage' ! subroutine name - integer :: c,j,fc,i ! indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: xs(bounds%begc:bounds%endc) ! water needed to bring soil moisture to watmin (mm) - real(r8) :: dzmm(bounds%begc:bounds%endc,1:nlevsoi) ! layer thickness (mm) - integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) - real(r8) :: rsub_bot(bounds%begc:bounds%endc) ! subsurface runoff - bottom drainage (mm/s) - real(r8) :: rsub_top(bounds%begc:bounds%endc) ! subsurface runoff - topographic control (mm/s) - real(r8) :: fff(bounds%begc:bounds%endc) ! decay factor (m-1) - real(r8) :: xsi(bounds%begc:bounds%endc) ! excess soil water above saturation at layer i (mm) - real(r8) :: xsia(bounds%begc:bounds%endc) ! available pore space at layer i (mm) - real(r8) :: xs1(bounds%begc:bounds%endc) ! excess soil water above saturation at layer 1 (mm) - real(r8) :: smpfz(1:nlevsoi) ! matric potential of layer right above water table (mm) - real(r8) :: wtsub ! summation of hk*dzmm for layers below water table (mm**2/s) - real(r8) :: dzsum ! summation of dzmm of layers below water table (mm) - real(r8) :: icefracsum ! summation of icefrac*dzmm of layers below water table (-) - real(r8) :: fracice_rsub(bounds%begc:bounds%endc) ! fractional impermeability of soil layers (-) - real(r8) :: available_h2osoi_liq ! available soil liquid water in a layer - real(r8) :: h2osoi_vol - real(r8) :: imped - real(r8) :: rsub_top_tot - real(r8) :: rsub_top_layer - real(r8) :: theta_unsat - real(r8) :: f_unsat - real(r8) :: s_y - integer :: k - real(r8) :: s1 - real(r8) :: s2 - real(r8) :: m - real(r8) :: b - real(r8) :: vol_ice - real(r8) :: dsmax_tmp(bounds%begc:bounds%endc) ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: rsub_tmp ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: frac ! temporary variable for ARNO subsurface runoff calculation - real(r8) :: rel_moist ! relative moisture, temporary variable - real(r8) :: wtsub_vic ! summation of hk*dzmm for layers in the third VIC layer - integer :: g - real(r8), parameter :: n_baseflow = 1 !drainage power law exponent - !----------------------------------------------------------------------- - - associate( & - nbedrock => col%nbedrock , & ! Input: [real(r8) (:,:) ] depth to bedrock (m) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] surface water (mm) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - - depth => soilhydrology_inst%depth_col , & ! Input: [real(r8) (:,:) ] VIC soil depth - c_param => soilhydrology_inst%c_param_col , & ! Input: [real(r8) (:) ] baseflow exponent (Qb) - Dsmax => soilhydrology_inst%dsmax_col , & ! Input: [real(r8) (:) ] max. velocity of baseflow (mm/day) - max_moist => soilhydrology_inst%max_moist_col , & ! Input: [real(r8) (:,:) ] maximum soil moisture (ice + liq) - moist => soilhydrology_inst%moist_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) - Ds => soilhydrology_inst%ds_col , & ! Input: [real(r8) (:) ] fracton of Dsmax where non-linear baseflow begins - Wsvic => soilhydrology_inst%Wsvic_col , & ! Input: [real(r8) (:) ] fraction of maximum soil moisutre where non-liear base flow occurs - icefrac => soilhydrology_inst%icefrac_col , & ! Output: [real(r8) (:,:) ] fraction of ice in layer - hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) - frost_table => soilhydrology_inst%frost_table_col , & ! Input: [real(r8) (:) ] frost table depth (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - wa => soilhydrology_inst%wa_col , & ! Input: [real(r8) (:) ] water in the unconfined aquifer (mm) - ice => soilhydrology_inst%ice_col , & ! Input: [real(r8) (:,:) ] soil layer moisture (mm) - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - origflag => soilhydrology_inst%origflag , & ! Input: logical - h2osfcflag => soilhydrology_inst%h2osfcflag , & ! Input: logical - - qflx_snwcp_liq => waterflux_inst%qflx_snwcp_liq_col , & ! Output: [real(r8) (:) ] excess rainfall due to snow capping (mm H2O /s) [+] - qflx_ice_runoff_xs => waterflux_inst%qflx_ice_runoff_xs_col , & ! Output: [real(r8) (:) ] solid runoff from excess ice in soil (mm H2O /s) [+] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Output: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Output: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col , & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - qflx_drain => waterflux_inst%qflx_drain_col , & ! Output: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_qrgwl => waterflux_inst%qflx_qrgwl_col , & ! Output: [real(r8) (:) ] qflx_surf at glaciers, wetlands, lakes (mm H2O /s) - qflx_rsub_sat => waterflux_inst%qflx_rsub_sat_col , & ! Output: [real(r8) (:) ] soil saturation excess [mm h2o/s] - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - ) - - ! Get time step - - dtime = get_step_size() - - ! Convert layer thicknesses from m to mm - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - dzmm(c,j) = dz(c,j)*1.e3_r8 - - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - icefrac(c,j) = min(1._r8,vol_ice/watsat(c,j)) - end do - end do - - ! Initial set - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_drain(c) = 0._r8 - rsub_bot(c) = 0._r8 - qflx_rsub_sat(c) = 0._r8 - rsub_top(c) = 0._r8 - fracice_rsub(c) = 0._r8 - end do - - ! The layer index of the first unsaturated layer, - ! i.e., the layer right above the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - ! allow jwt to equal zero when zwt is in top layer - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end do - - !-- Topographic runoff ------------------------- - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - fff(c) = 1._r8/ hkdepth(c) - - dzsum = 0._r8 - icefracsum = 0._r8 - do j = max(jwt(c),1), nlevsoi - dzsum = dzsum + dzmm(c,j) - icefracsum = icefracsum + icefrac(c,j) * dzmm(c,j) - end do - imped=10._r8**(-e_ice*(icefracsum/dzsum)) - !@@ - ! baseflow is power law expression relative to bedrock layer - if(zwt(c) <= zi(c,nbedrock(c))) then - rsub_top(c) = imped * baseflow_scalar * tan(rpi/180._r8*col%topo_slope(c))* & - (zi(c,nbedrock(c)) - zwt(c))**(n_baseflow) - else - rsub_top(c) = 0._r8 - endif - - !-- Now remove water via rsub_top - rsub_top_tot = - rsub_top(c) * dtime - !should never be positive... but include for completeness - if(rsub_top_tot > 0.) then !rising water table - - call endrun(msg="RSUB_TOP IS POSITIVE in Drainage!"//errmsg(sourcefile, __LINE__)) - - else ! deepening water table - do j = jwt(c)+1, nbedrock(c) - ! use analytical expression for specific yield - s_y = watsat(c,j) & - * ( 1. - (1.+1.e3*zwt(c)/sucsat(c,j))**(-1./bsw(c,j))) - s_y=max(s_y,0.02_r8) - - rsub_top_layer=max(rsub_top_tot,-(s_y*(zi(c,j) - zwt(c))*1.e3)) - rsub_top_layer=min(rsub_top_layer,0._r8) - h2osoi_liq(c,j) = h2osoi_liq(c,j) + rsub_top_layer - - rsub_top_tot = rsub_top_tot - rsub_top_layer - - if (rsub_top_tot >= 0.) then - zwt(c) = zwt(c) - rsub_top_layer/s_y/1000._r8 - - exit - else - zwt(c) = zi(c,j) - endif - enddo - - !-- remove residual rsub_top --------------------------------------------- - ! make sure no extra water removed from soil column - rsub_top(c) = rsub_top(c) - rsub_top_tot/dtime - endif - - zwt(c) = max(0.0_r8,zwt(c)) - zwt(c) = min(80._r8,zwt(c)) - - end do - - ! excessive water above saturation added to the above unsaturated layer like a bucket - ! if column fully saturated, excess water goes to runoff - - do j = nlevsoi,2,-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - xsi(c) = max(h2osoi_liq(c,j)-eff_porosity(c,j)*dzmm(c,j),0._r8) - h2osoi_liq(c,j) = min(eff_porosity(c,j)*dzmm(c,j), h2osoi_liq(c,j)) - h2osoi_liq(c,j-1) = h2osoi_liq(c,j-1) + xsi(c) - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! watmin addition to fix water balance errors - xs1(c) = max(max(h2osoi_liq(c,1)-watmin,0._r8)- & - max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1)-watmin)),0._r8) - h2osoi_liq(c,1) = h2osoi_liq(c,1) - xs1(c) - - if (lun%urbpoi(col%landunit(c))) then - qflx_rsub_sat(c) = xs1(c) / dtime - else - ! send this water up to h2osfc rather than sending to drainage - h2osfc(c) = h2osfc(c) + xs1(c) - qflx_rsub_sat(c) = 0._r8 - endif - ! add in ice check - xs1(c) = max(max(h2osoi_ice(c,1),0._r8)-max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_liq(c,1))),0._r8) - h2osoi_ice(c,1) = min(max(0._r8,pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_liq(c,1)), h2osoi_ice(c,1)) - qflx_ice_runoff_xs(c) = xs1(c) / dtime - end do - - ! Limit h2osoi_liq to be greater than or equal to watmin. - ! Get water needed to bring h2osoi_liq equal watmin from lower layer. - ! If insufficient water in soil layers, get from aquifer water - - do j = 1, nlevsoi-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin - h2osoi_liq(c,j) - ! deepen water table if water is passed from below zwt layer - if(j == jwt(c)) then - zwt(c) = zwt(c) + xs(c)/eff_porosity(c,j)/1000._r8 - endif - else - xs(c) = 0._r8 - end if - h2osoi_liq(c,j ) = h2osoi_liq(c,j ) + xs(c) - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) - xs(c) - end do - end do - - ! Get water for bottom layer from layers above if possible - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin-h2osoi_liq(c,j) - searchforwater: do i = nlevsoi-1, 1, -1 - available_h2osoi_liq = max(h2osoi_liq(c,i)-watmin-xs(c),0._r8) - if (available_h2osoi_liq >= xs(c)) then - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - h2osoi_liq(c,i) = h2osoi_liq(c,i) - xs(c) - xs(c) = 0._r8 - exit searchforwater - else - h2osoi_liq(c,j) = h2osoi_liq(c,j) + available_h2osoi_liq - h2osoi_liq(c,i) = h2osoi_liq(c,i) - available_h2osoi_liq - xs(c) = xs(c) - available_h2osoi_liq - end if - end do searchforwater - else - xs(c) = 0._r8 - end if - ! Needed in case there is no water to be found - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - ! Instead of removing water from aquifer where it eventually - ! shows up as excess drainage to the ocean, take it back out of - ! drainage - qflx_rsub_sat(c) = qflx_rsub_sat(c) - xs(c)/dtime - - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Sub-surface runoff and drainage - - qflx_drain(c) = qflx_rsub_sat(c) + rsub_top(c) - - ! Set imbalance for snow capping - - qflx_qrgwl(c) = qflx_snwcp_liq(c) - - end do - - ! No drainage for urban columns (except for pervious road as computed above) - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (col%itype(c) /= icol_road_perv) then - qflx_drain(c) = 0._r8 - ! This must be done for roofs and impervious road (walls will be zero) - qflx_qrgwl(c) = qflx_snwcp_liq(c) - end if - end do - - end associate - - end subroutine LateralFlowPowerLaw - -!#7 - !----------------------------------------------------------------------- - subroutine RenewCondensation(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterstate_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Calculate watertable, considering aquifer recharge but no drainage. - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi - use column_varcon , only : icol_roof, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,fc,i ! indices - real(r8) :: dtime ! land model time step (sec) - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] - qflx_dew_grnd => waterflux_inst%qflx_dew_grnd_col , & ! Input: [real(r8) (:) ] ground surface dew formation (mm H2O /s) [+] - qflx_dew_snow => waterflux_inst%qflx_dew_snow_col , & ! Input: [real(r8) (:) ] surface dew added to snow pack (mm H2O /s) [+] - qflx_sub_snow => waterflux_inst%qflx_sub_snow_col & ! Output: [real(r8) (:) ] sublimation rate from snow pack (mm H2O /s) [+] - ) - - ! Get time step - - dtime = get_step_size() - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Renew the ice and liquid mass due to condensation - - if (snl(c)+1 >= 1) then - - ! make consistent with how evap_grnd removed in infiltration - h2osoi_liq(c,1) = h2osoi_liq(c,1) + (1._r8 - frac_h2osfc(c))*qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (1._r8 - frac_h2osfc(c))*qflx_dew_snow(c) * dtime - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (1._r8 - frac_h2osfc(c)) * qflx_sub_snow(c) * dtime - end if - end if - - end do - - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - ! Renew the ice and liquid mass due to condensation for urban roof and impervious road - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - if (snl(c)+1 >= 1) then - h2osoi_liq(c,1) = h2osoi_liq(c,1) + qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (qflx_dew_snow(c) * dtime) - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (qflx_sub_snow(c) * dtime) - end if - end if - end if - - end do - - end associate - - end subroutine RenewCondensation - -!#0 -end module SoilHydrologyMod diff --git a/src/biogeophys/SoilHydrologyType.F90 b/src/biogeophys/SoilHydrologyType.F90 deleted file mode 100644 index 33aee7efda..0000000000 --- a/src/biogeophys/SoilHydrologyType.F90 +++ /dev/null @@ -1,338 +0,0 @@ -Module SoilHydrologyType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varpar , only : nlevgrnd, nlayer, nlayert, nlevsoi - use clm_varcon , only : spval - use clm_varctl , only : iulog - use LandunitType , only : lun - use ColumnType , only : col - ! - ! !PUBLIC TYPES: - implicit none - save - ! - type, public :: soilhydrology_type - - integer :: h2osfcflag ! true => surface water is active (namelist) - integer :: origflag ! used to control soil hydrology properties (namelist) - - real(r8), pointer :: num_substeps_col (:) ! col adaptive timestep counter - ! NON-VIC - real(r8), pointer :: frost_table_col (:) ! col frost table depth - real(r8), pointer :: zwt_col (:) ! col water table depth - real(r8), pointer :: zwts_col (:) ! col water table depth, the shallower of the two water depths - real(r8), pointer :: zwt_perched_col (:) ! col perched water table depth - real(r8), pointer :: wa_col (:) ! col water in the unconfined aquifer (mm) - real(r8), pointer :: qcharge_col (:) ! col aquifer recharge rate (mm/s) - real(r8), pointer :: fracice_col (:,:) ! col fractional impermeability (-) - real(r8), pointer :: icefrac_col (:,:) ! col fraction of ice - real(r8), pointer :: fcov_col (:) ! col fractional impermeable area - real(r8), pointer :: fsat_col (:) ! col fractional area with water table at surface - real(r8), pointer :: h2osfc_thresh_col (:) ! col level at which h2osfc "percolates" (time constant) - - ! VIC - real(r8), pointer :: hkdepth_col (:) ! col VIC decay factor (m) (time constant) - real(r8), pointer :: b_infil_col (:) ! col VIC b infiltration parameter (time constant) - real(r8), pointer :: ds_col (:) ! col VIC fracton of Dsmax where non-linear baseflow begins (time constant) - real(r8), pointer :: dsmax_col (:) ! col VIC max. velocity of baseflow (mm/day) (time constant) - real(r8), pointer :: Wsvic_col (:) ! col VIC fraction of maximum soil moisutre where non-liear base flow occurs (time constant) - real(r8), pointer :: porosity_col (:,:) ! col VIC porosity (1-bulk_density/soil_density) - real(r8), pointer :: vic_clm_fract_col (:,:,:) ! col VIC fraction of VIC layers in CLM layers - real(r8), pointer :: depth_col (:,:) ! col VIC layer depth of upper layer - real(r8), pointer :: c_param_col (:) ! col VIC baseflow exponent (Qb) - real(r8), pointer :: expt_col (:,:) ! col VIC pore-size distribution related paramter(Q12) - real(r8), pointer :: ksat_col (:,:) ! col VIC Saturated hydrologic conductivity - real(r8), pointer :: phi_s_col (:,:) ! col VIC soil moisture dissusion parameter - real(r8), pointer :: moist_col (:,:) ! col VIC soil moisture (kg/m2) for VIC soil layers - real(r8), pointer :: moist_vol_col (:,:) ! col VIC volumetric soil moisture for VIC soil layers - real(r8), pointer :: max_moist_col (:,:) ! col VIC max layer moist + ice (mm) - real(r8), pointer :: max_infil_col (:) ! col VIC maximum infiltration rate calculated in VIC - real(r8), pointer :: i_0_col (:) ! col VIC average saturation in top soil layers - real(r8), pointer :: ice_col (:,:) ! col VIC soil ice (kg/m2) for VIC soil layers - - contains - - ! Public routines - procedure, public :: Init - procedure, public :: Restart - - ! Private routines - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, private :: ReadNL - - end type soilhydrology_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, NLFilename) - - class(soilhydrology_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - - call this%ReadNL(NLFilename) - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(soilhydrology_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - allocate(this%num_substeps_col (begc:endc)) ; this%num_substeps_col (:) = nan - allocate(this%frost_table_col (begc:endc)) ; this%frost_table_col (:) = nan - allocate(this%zwt_col (begc:endc)) ; this%zwt_col (:) = nan - allocate(this%zwt_perched_col (begc:endc)) ; this%zwt_perched_col (:) = nan - allocate(this%zwts_col (begc:endc)) ; this%zwts_col (:) = nan - - allocate(this%wa_col (begc:endc)) ; this%wa_col (:) = nan - allocate(this%qcharge_col (begc:endc)) ; this%qcharge_col (:) = nan - allocate(this%fracice_col (begc:endc,nlevgrnd)) ; this%fracice_col (:,:) = nan - allocate(this%icefrac_col (begc:endc,nlevgrnd)) ; this%icefrac_col (:,:) = nan - allocate(this%fcov_col (begc:endc)) ; this%fcov_col (:) = nan - allocate(this%fsat_col (begc:endc)) ; this%fsat_col (:) = nan - allocate(this%h2osfc_thresh_col (begc:endc)) ; this%h2osfc_thresh_col (:) = nan - - allocate(this%hkdepth_col (begc:endc)) ; this%hkdepth_col (:) = nan - allocate(this%b_infil_col (begc:endc)) ; this%b_infil_col (:) = nan - allocate(this%ds_col (begc:endc)) ; this%ds_col (:) = nan - allocate(this%dsmax_col (begc:endc)) ; this%dsmax_col (:) = nan - allocate(this%Wsvic_col (begc:endc)) ; this%Wsvic_col (:) = nan - allocate(this%depth_col (begc:endc,nlayert)) ; this%depth_col (:,:) = nan - allocate(this%porosity_col (begc:endc,nlayer)) ; this%porosity_col (:,:) = nan - allocate(this%vic_clm_fract_col (begc:endc,nlayer, nlevsoi)) ; this%vic_clm_fract_col (:,:,:) = nan - allocate(this%c_param_col (begc:endc)) ; this%c_param_col (:) = nan - allocate(this%expt_col (begc:endc,nlayer)) ; this%expt_col (:,:) = nan - allocate(this%ksat_col (begc:endc,nlayer)) ; this%ksat_col (:,:) = nan - allocate(this%phi_s_col (begc:endc,nlayer)) ; this%phi_s_col (:,:) = nan - allocate(this%moist_col (begc:endc,nlayert)) ; this%moist_col (:,:) = nan - allocate(this%moist_vol_col (begc:endc,nlayert)) ; this%moist_vol_col (:,:) = nan - allocate(this%max_moist_col (begc:endc,nlayer)) ; this%max_moist_col (:,:) = nan - allocate(this%max_infil_col (begc:endc)) ; this%max_infil_col (:) = nan - allocate(this%i_0_col (begc:endc)) ; this%i_0_col (:) = nan - allocate(this%ice_col (begc:endc,nlayert)) ; this%ice_col (:,:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(soilhydrology_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - this%wa_col(begc:endc) = spval - call hist_addfld1d (fname='WA', units='mm', & - avgflag='A', long_name='water in the unconfined aquifer (vegetated landunits only)', & - ptr_col=this%wa_col, l2g_scale_type='veg') - - this%qcharge_col(begc:endc) = spval - call hist_addfld1d (fname='QCHARGE', units='mm/s', & - avgflag='A', long_name='aquifer recharge rate (vegetated landunits only)', & - ptr_col=this%qcharge_col, l2g_scale_type='veg') - - this%fcov_col(begc:endc) = spval - call hist_addfld1d (fname='FCOV', units='unitless', & - avgflag='A', long_name='fractional impermeable area', & - ptr_col=this%fcov_col, l2g_scale_type='veg') - - this%fsat_col(begc:endc) = spval - call hist_addfld1d (fname='FSAT', units='unitless', & - avgflag='A', long_name='fractional area with water table at surface', & - ptr_col=this%fsat_col, l2g_scale_type='veg') - - this%num_substeps_col(begc:endc) = spval - call hist_addfld1d (fname='NSUBSTEPS', units='unitless', & - avgflag='A', long_name='number of adaptive timesteps in CLM timestep', & - ptr_col=this%num_substeps_col, l2g_scale_type='veg', & - default='inactive') - - this%frost_table_col(begc:endc) = spval - call hist_addfld1d (fname='FROST_TABLE', units='m', & - avgflag='A', long_name='frost table depth (vegetated landunits only)', & - ptr_col=this%frost_table_col, l2g_scale_type='veg', default='inactive') - - this%zwt_col(begc:endc) = spval - call hist_addfld1d (fname='ZWT', units='m', & - avgflag='A', long_name='water table depth (vegetated landunits only)', & - ptr_col=this%zwt_col, l2g_scale_type='veg') - - this%zwt_perched_col(begc:endc) = spval - call hist_addfld1d (fname='ZWT_PERCH', units='m', & - avgflag='A', long_name='perched water table depth (vegetated landunits only)', & - ptr_col=this%zwt_perched_col, l2g_scale_type='veg') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(soilhydrology_type) :: this - type(bounds_type) , intent(in) :: bounds - ! !LOCAL VARIABLES: - integer :: c ! indices - - !----------------------------------------------------------------------- - - ! Nothing for now - - ! needs to be initialized to spval to avoid problems when - ! averaging for the accum field - do c = bounds%begc, bounds%endc - this%num_substeps_col(c) = spval - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_io, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(soilhydrology_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='FROST_TABLE', xtype=ncd_double, & - dim1name='column', & - long_name='frost table depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%frost_table_col) - if (flag == 'read' .and. .not. readvar) then - this%frost_table_col(bounds%begc:bounds%endc) = col%zi(bounds%begc:bounds%endc,nlevsoi) - end if - - call restartvar(ncid=ncid, flag=flag, varname='WA', xtype=ncd_double, & - dim1name='column', & - long_name='water in the unconfined aquifer', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%wa_col) - - call restartvar(ncid=ncid, flag=flag, varname='ZWT', xtype=ncd_double, & - dim1name='column', & - long_name='water table depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%zwt_col) - - call restartvar(ncid=ncid, flag=flag, varname='ZWT_PERCH', xtype=ncd_double, & - dim1name='column', & - long_name='perched water table depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%zwt_perched_col) - if (flag == 'read' .and. .not. readvar) then - this%zwt_perched_col(bounds%begc:bounds%endc) = col%zi(bounds%begc:bounds%endc,nlevsoi) - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine ReadNL( this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read namelist for SoilHydrology - ! - ! !USES: - use shr_mpi_mod , only : shr_mpi_bcast - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use clm_nlUtilsMod , only : find_nlgroup_name - use clm_varctl , only : iulog - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(soilhydrology_type) :: this - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - integer :: origflag=0 !use to control soil hydraulic properties - integer :: h2osfcflag=1 !If surface water is active or not - character(len=32) :: subname = 'SoilHydrology_readnl' ! subroutine name - !----------------------------------------------------------------------- - - namelist / clm_soilhydrology_inparm / h2osfcflag, origflag - - ! preset values - - origflag = 0 - h2osfcflag = 1 - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in clm_soilhydrology_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call find_nlgroup_name(unitn, 'clm_soilhydrology_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_soilhydrology_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_soilhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_soilhydrology_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - call shr_mpi_bcast(h2osfcflag, mpicom) - call shr_mpi_bcast(origflag, mpicom) - - this%h2osfcflag = h2osfcflag - this%origflag = origflag - - end subroutine ReadNL - -end Module SoilHydrologyType diff --git a/src/biogeophys/SoilMoistStressMod.F90 b/src/biogeophys/SoilMoistStressMod.F90 deleted file mode 100644 index c472d66dbf..0000000000 --- a/src/biogeophys/SoilMoistStressMod.F90 +++ /dev/null @@ -1,520 +0,0 @@ -module SoilMoistStressMod - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Calculates soil moisture stress for plant gpp and transpiration - ! - ! After discussion with other developers, I have now removed all functions that - ! return array, and decalared all variables that will be modified as intent(inout). - ! The initialization will be done whenever the variable is initialized. This avoids - ! code crash when initialization is not done appropriately, and make the code safer - ! during the long-term maintenance - ! - ! Created by Jinyun Tang, Feb., 2014 - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: calc_root_moist_stress - public :: calc_effective_soilporosity - public :: calc_effective_snowporosity - public :: calc_volumetric_h2oliq - public :: set_perchroot_opt - public :: init_root_moist_stress - ! - ! !PRIVATE DATA MEMBERS: - integer :: root_moist_stress_method - integer, parameter :: moist_stress_clm_default = 0 !default method for calculating root moisture stress - logical, private :: perchroot = .false. ! true => btran is based only on unfrozen soil levels - logical, private :: perchroot_alt = .false. ! true => btran is based on active layer (defined over two years); - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !-------------------------------------------------------------------------------- - -contains - - !-------------------------------------------------------------------------------- - subroutine init_root_moist_stress() - ! - !DESCRIPTION - !specify the method to compute root soil moisture stress - ! - implicit none - - root_moist_stress_method = moist_stress_clm_default - end subroutine init_root_moist_stress - - !-------------------------------------------------------------------------------- - subroutine set_perchroot_opt(perchroot_global, perchroot_alt_global) - ! - !DESCRIPTIONS - !set up local perchroot logical switches, in the future, this wil be - !read in as namelist - ! - ! !ARGUMENTS: - implicit none - logical, intent(in) :: perchroot_global - logical, intent(in) :: perchroot_alt_global - !------------------------------------------------------------------------------ - - perchroot = perchroot_global - perchroot_alt = perchroot_alt_global - - end subroutine set_perchroot_opt - - !-------------------------------------------------------------------------------- - subroutine calc_effective_soilporosity(bounds, ubj, numf, filter, & - watsat, h2osoi_ice, denice, eff_por) - ! - ! !DESCRIPTIONS - ! compute the effective soil porosity - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: ubj ! lbinning level indices - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(:) ! filter - real(r8) , intent(in) :: watsat( bounds%begc: , 1: ) ! soil porosity - real(r8) , intent(in) :: h2osoi_ice( bounds%begc: , 1: ) ! ice water content, kg H2o/m2 - real(r8) , intent(in) :: denice ! ice density, kg/m3 - real(r8) , intent(inout) :: eff_por( bounds%begc: ,1: ) ! effective porosity - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc !indices - real(r8):: vol_ice !volumetric ice - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(watsat) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osoi_ice) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eff_por) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - - !main calculation loop - !it assumes the soil layers start from 1 - do j = 1, ubj - do fc = 1, numf - c = filter(fc) - !compute the volumetric ice content - vol_ice=min(watsat(c,j), h2osoi_ice(c,j)/(denice*col%dz(c,j))) - - !compute the maximum soil space to fill liquid water and air - eff_por(c,j) = watsat(c,j) - vol_ice - enddo - enddo - end subroutine calc_effective_soilporosity - - !-------------------------------------------------------------------------------- - subroutine calc_effective_snowporosity(bounds, lbj, jtop, numf, filter, & - h2osoi_ice, denice, eff_por) - ! - ! !DESCRIPTIONS - ! compute the effective porosity snow - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use shr_log_mod , only : errMsg => shr_log_errMsg - use ColumnType , only : col - implicit none - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds !bounds - integer , intent(in) :: lbj !ubing level indices - integer , intent(in) :: jtop( bounds%begc: ) !top level for each column [col] - integer , intent(in) :: numf !filter dimension - integer , intent(in) :: filter(:) !filter - real(r8) , intent(in) :: h2osoi_ice( bounds%begc: , lbj: ) !ice water content, kg H2o/m2 - real(r8) , intent(in) :: denice !ice density, kg/m3 - real(r8) , intent(inout) :: eff_por( bounds%begc: ,lbj: ) !returning effective porosity - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc !indices - integer :: ubj - real(r8) :: vol_ice !volumetric ice - !------------------------------------------------------------------------------ - - ubj = 0 - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jtop) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osoi_ice) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eff_por) == (/bounds%endc,0/)) , errMsg(sourcefile, __LINE__)) - - !main calculation loop - - !it assumes snow layer ends at 0 - do j = lbj,0 - do fc = 1, numf - c = filter(fc) - if (j>=jtop(c)) then - !compute the volumetric ice content - vol_ice=min(1._r8, h2osoi_ice(c,j)/(denice*col%dz(c,j))) - - !compute the maximum snow void space to fill liquid water and air - eff_por(c,j) = 1._r8 - vol_ice - endif - enddo - enddo - - end subroutine calc_effective_snowporosity - - !-------------------------------------------------------------------------------- - subroutine calc_volumetric_h2oliq(bounds, jtop, lbj, ubj, numf, filter,& - eff_porosity, h2osoi_liq, denh2o, vol_liq) - ! - ! !DESCRIPTIONS - ! compute the volumetric liquid water content - ! - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: jtop( bounds%begc: ) ! top level for each column [col] - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(:) ! filter - real(r8) , intent(in) :: eff_porosity(bounds%begc: , lbj: ) ! effective soil porosity - real(r8) , intent(in) :: h2osoi_liq(bounds%begc: , lbj: ) ! liquid water content [kg H2o/m2] - real(r8) , intent(in) :: denh2o ! water density [kg/m3] - real(r8) , intent(inout) :: vol_liq(bounds%begc: , lbj: ) ! volumetric liquid water content - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc ! indices - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jtop) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(h2osoi_liq) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eff_porosity) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(vol_liq) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - - !main calculation loop - do j = lbj, ubj - do fc = 1, numf - c = filter(fc) - if(j>=jtop(c))then - - !volume of liquid is no greater than effective void space - vol_liq(c,j) = min(eff_porosity(c,j), h2osoi_liq(c,j)/(col%dz(c,j)*denh2o)) - endif - enddo - enddo - - end subroutine calc_volumetric_h2oliq - - !-------------------------------------------------------------------------------- - subroutine normalize_unfrozen_rootfr(bounds, ubj, fn, filterp, & - canopystate_inst, soilstate_inst, temperature_inst, rootfr_unf) - ! - ! !DESCRIPTIONS - ! normalize root fraction for total unfrozen depth - ! - ! !USES - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : tfrz !temperature where water freezes [K], this is taken as constant at the moment - use decompMod , only : bounds_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use TemperatureType , only : temperature_type - use SoilStateType , only : soilstate_type - use WaterSTateType , only : waterstate_type - use SimpleMathMod , only : array_normalization - use PatchType , only : patch - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds !bounds - integer , intent(in) :: ubj !ubinning level indices - integer , intent(in) :: fn !filter dimension - integer , intent(in) :: filterp(:) !filter - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - real(r8) , intent(inout) :: rootfr_unf(bounds%begp:bounds%endp, 1:ubj) !normalized root fraction in unfrozen layers - ! - ! !LOCAL VARIABLES: - !real(r8) :: rootsum(bounds%begp:bounds%endp) - integer :: p, c, j, f !indices - !------------------------------------------------------------------------------ - - associate( & - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - altmax_lastyear_indx => canopystate_inst%altmax_lastyear_indx_col , & ! Input: [real(r8) (:) ] prior year maximum annual depth of thaw - altmax_indx => canopystate_inst%altmax_indx_col & ! Input: [real(r8) (:) ] maximum annual depth of thaw - ) - - ! main calculation loop - ! Initialize rootfr_unf to zero. - ! I found it necessary to ensure the pgi compiler not - ! to complain with float point exception. However, it raises a question how - ! to make sure those values that are initialized with nan or spval are not reset - ! to zero within similar coding style. Jinyun Tang, May 23, 2014. - - ! Define rootfraction for unfrozen soil only - if (perchroot .or. perchroot_alt) then - if (perchroot_alt) then - ! use total active layer (defined ass max thaw depth for current and prior year) - do j = 1, ubj - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - if ( j <= max(altmax_lastyear_indx(c), altmax_indx(c), 1) )then - rootfr_unf(p,j) = rootfr(p,j) - else - rootfr_unf(p,j) = 0._r8 - end if - end do - end do - else - ! use instantaneous temperature - do j = 1, ubj - do f = 1, fn - p = filterp(f) - c = patch%column(p) - - if (t_soisno(c,j) >= tfrz) then - rootfr_unf(p,j) = rootfr(p,j) - else - rootfr_unf(p,j) = 0._r8 - end if - end do - end do - - end if ! perchroot_alt - end if ! perchroot - - !normalize the root fraction for each pft - call array_normalization(bounds%begp, bounds%endp, 1, ubj, & - fn, filterp, rootfr_unf(bounds%begp:bounds%endp, 1:ubj)) - - end associate - - end subroutine normalize_unfrozen_rootfr - - !-------------------------------------------------------------------------------- - subroutine calc_root_moist_stress_clm45default(bounds, & - nlevgrnd, fn, filterp, rootfr_unf, & - temperature_inst, soilstate_inst, energyflux_inst, waterstate_inst, & - soil_water_retention_curve) - ! - ! DESCRIPTIONS - ! compute the root water stress using the default clm45 approach - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varcon , only : tfrz !temperature where water freezes [K], this is taken as constant at the moment - use pftconMod , only : pftcon - use TemperatureType , only : temperature_type - use SoilStateType , only : soilstate_type - use EnergyFluxType , only : energyflux_type - use WaterSTateType , only : waterstate_type - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use PatchType , only : patch - use clm_varctl , only : iulog, use_hydrstress - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds !bounds - integer , intent(in) :: nlevgrnd !number of vertical layers - integer , intent(in) :: fn !number of filters - integer , intent(in) :: filterp(:) !filter array - real(r8) , intent(in) :: rootfr_unf(bounds%begp: , 1: ) - type(energyflux_type) , intent(inout) :: energyflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: btran0 = 0.0_r8 ! initial value - real(r8) :: smp_node, s_node !temporary variables - real(r8) :: smp_node_lf !temporary variable - integer :: p, f, j, c, l !indices - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(rootfr_unf) == (/bounds%endp, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - smpso => pftcon%smpso , & ! Input: soil water potential at full stomatal opening (mm) - smpsc => pftcon%smpsc , & ! Input: soil water potential at full stomatal closure (mm) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) (constant) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) (constant) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (constant) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer - rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer - - btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) (integrated soil water stress) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] integrated soil water stress square - rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root soil water stress (resistance) by layer (0-1) (nlevgrnd) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osoi_liqvol => waterstate_inst%h2osoi_liqvol_col & ! Output: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR - ) - - do j = 1,nlevgrnd - do f = 1, fn - p = filterp(f) - c = patch%column(p) - l = patch%landunit(p) - - ! Root resistance factors - ! rootr effectively defines the active root fraction in each layer - if (h2osoi_liqvol(c,j) .le. 0._r8 .or. t_soisno(c,j) .le. tfrz-2._r8) then - rootr(p,j) = 0._r8 - else - s_node = max(h2osoi_liqvol(c,j)/eff_porosity(c,j),0.01_r8) - - !smp_node = max(smpsc(patch%itype(p)), -sucsat(c,j)*s_node**(-bsw(c,j))) -! call soil_water_retention_curve%soil_suction(sucsat(c,j), s_node, bsw(c,j), smp_node) -!scs - call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node) -!scs - smp_node = max(smpsc(patch%itype(p)), smp_node) - - rresis(p,j) = min( (eff_porosity(c,j)/watsat(c,j))* & - (smp_node - smpsc(patch%itype(p))) / (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8) - - - if (.not. (perchroot .or. perchroot_alt) ) then - rootr(p,j) = rootfr(p,j)*rresis(p,j) - else - rootr(p,j) = rootfr_unf(p,j)*rresis(p,j) - end if - - !it is possible to further separate out a btran function, but I will leave it for the moment, jyt - if ( .not.(use_hydrstress) ) then - btran(p) = btran(p) + max(rootr(p,j),0._r8) - end if - end if - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - - call soil_water_retention_curve%soil_suction(c, j, s_node, soilstate_inst, smp_node_lf) - - smp_node_lf = max(smpsc(patch%itype(p)), smp_node_lf) - btran2(p) = btran2(p) +rootfr(p,j)*max(0._r8,min((smp_node_lf - smpsc(patch%itype(p))) / & - (smpso(patch%itype(p)) - smpsc(patch%itype(p))), 1._r8)) - end do - end do - - ! Normalize root resistances to get layer contribution to ET - do j = 1,nlevgrnd - do f = 1, fn - p = filterp(f) - if (btran(p) > btran0) then - rootr(p,j) = rootr(p,j)/btran(p) - else - rootr(p,j) = 0._r8 - end if - end do - end do - end associate - - end subroutine calc_root_moist_stress_clm45default - - !-------------------------------------------------------------------------------- - subroutine calc_root_moist_stress(bounds, nlevgrnd, fn, filterp, & - canopystate_inst, energyflux_inst, soilstate_inst, temperature_inst, & - waterstate_inst, soil_water_retention_curve) - ! - ! DESCRIPTIONS - ! compute the root water stress using different approaches - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : tfrz !temperature where water freezes [K], this is taken as constant at the moment - use decompMod , only : bounds_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use TemperatureType , only : temperature_type - use SoilStateType , only : soilstate_type - use WaterSTateType , only : waterstate_type - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use abortutils , only : endrun - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds !bounds - integer , intent(in) :: nlevgrnd - integer , intent(in) :: fn - integer , intent(in) :: filterp(:) - type(canopystate_type) , intent(in) :: canopystate_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - ! - ! !LOCAL VARIABLES: - integer :: p, f, j, c, l ! indices - real(r8) :: smp_node, s_node ! temporary variables - real(r8) :: rootfr_unf(bounds%begp:bounds%endp,1:nlevgrnd) ! Rootfraction defined for unfrozen layers only. - character(len=32) :: subname = 'calc_root_moist_stress' ! subroutine name - !------------------------------------------------------------------------------ - - !define normalized rootfraction for unfrozen soil - !define normalized rootfraction for unfrozen soil - rootfr_unf(bounds%begp:bounds%endp,1:nlevgrnd) = 0._r8 - - call normalize_unfrozen_rootfr(bounds, & - ubj = nlevgrnd, & - fn = fn, & - filterp = filterp, & - canopystate_inst=canopystate_inst, & - soilstate_inst=soilstate_inst, & - temperature_inst=temperature_inst, & - rootfr_unf=rootfr_unf(bounds%begp:bounds%endp,1:nlevgrnd)) - - !suppose h2osoi_liq, eff_porosity are already computed somewhere else - - select case (root_moist_stress_method) - !add other methods later - case (moist_stress_clm_default) - - call calc_root_moist_stress_clm45default(bounds, & - nlevgrnd = nlevgrnd, & - fn = fn, & - filterp = filterp, & - energyflux_inst=energyflux_inst, & - temperature_inst=temperature_inst, & - soilstate_inst=soilstate_inst, & - waterstate_inst=waterstate_inst, & - rootfr_unf=rootfr_unf(bounds%begp:bounds%endp,1:nlevgrnd), & - soil_water_retention_curve=soil_water_retention_curve) - - case default - call endrun(subname // ':: a root moisture stress function must be specified!') - end select - - end subroutine calc_root_moist_stress - -end module SoilMoistStressMod diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 deleted file mode 100644 index a157e16bb6..0000000000 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ /dev/null @@ -1,630 +0,0 @@ -module SoilStateInitTimeConstMod - - !------------------------------------------------------------------------------ - ! DESCRIPTION: - ! Set hydraulic and thermal properties - ! - ! !USES - use SoilStateType , only : soilstate_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilStateInitTimeConst - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: ReadNL - ! - ! !PRIVATE DATA: - ! Control variables (from namelist) - logical, private :: organic_frac_squared ! If organic fraction should be squared (as in CLM4.5) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - ! -contains - - !----------------------------------------------------------------------- - subroutine ReadNL( nlfilename ) - ! - ! !DESCRIPTION: - ! Read namelist for SoilStateType - ! - ! !USES: - use shr_mpi_mod , only : shr_mpi_bcast - use shr_log_mod , only : errMsg => shr_log_errMsg - use fileutils , only : getavu, relavu, opnfil - use clm_nlUtilsMod , only : find_nlgroup_name - use clm_varctl , only : iulog - use spmdMod , only : mpicom, masterproc - use abortUtils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: nlfilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'SoilState_readnl' ! subroutine name - !----------------------------------------------------------------------- - - character(len=*), parameter :: nl_name = 'clm_soilstate_inparm' ! Namelist name - ! MUST agree with name in namelist and read - namelist / clm_soilstate_inparm / organic_frac_squared - - ! preset values - - organic_frac_squared = .false. - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in '//nl_name//' namelist' - call opnfil (nlfilename, unitn, 'F') - call find_nlgroup_name(unitn, nl_name, status=ierr) - if (ierr == 0) then - read(unit=unitn, nml=clm_soilstate_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading '//nl_name//' namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding '//nl_name//' namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - call shr_mpi_bcast(organic_frac_squared, mpicom) - - end subroutine ReadNL - - !----------------------------------------------------------------------- - subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use abortutils , only : endrun - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, ncd_inqdlen - use clm_varpar , only : numpft, numrad - use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlevsoifl, nlayer, nlayert, nlevurb, nlevsno - use clm_varcon , only : zsoi, dzsoi, zisoi, spval - use clm_varcon , only : secspday, pc, mu, denh2o, denice, grlnd - use clm_varctl , only : use_cn, use_lch4, use_fates - use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct - use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice_mec - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv - use fileutils , only : getfil - use organicFileMod , only : organicrd - use FuncPedotransferMod , only : pedotransf, get_ipedof - use RootBiophysMod , only : init_vegrootfr - use GridcellType , only : grc - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(soilstate_type) , intent(inout) :: soilstate_inst - character(len=*) , intent(in) :: nlfilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: p, lev, c, l, g, j ! indices - real(r8) :: om_frac ! organic matter fraction - real(r8) :: om_tkm = 0.25_r8 ! thermal conductivity of organic soil (Farouki, 1986) [W/m/K] - real(r8) :: om_watsat_lake = 0.9_r8 ! porosity of organic soil - real(r8) :: om_hksat_lake = 0.1_r8 ! saturated hydraulic conductivity of organic soil [mm/s] - real(r8) :: om_sucsat_lake = 10.3_r8 ! saturated suction for organic matter (Letts, 2000) - real(r8) :: om_b_lake = 2.7_r8 ! Clapp Hornberger paramater for oragnic soil (Letts, 2000) (lake) - real(r8) :: om_watsat ! porosity of organic soil - real(r8) :: om_hksat ! saturated hydraulic conductivity of organic soil [mm/s] - real(r8) :: om_sucsat ! saturated suction for organic matter (mm)(Letts, 2000) - real(r8) :: om_csol = 2.5_r8 ! heat capacity of peat soil *10^6 (J/K m3) (Farouki, 1986) - real(r8) :: om_tkd = 0.05_r8 ! thermal conductivity of dry organic soil (Farouki, 1981) - real(r8) :: om_b ! Clapp Hornberger paramater for oragnic soil (Letts, 2000) - real(r8) :: zsapric = 0.5_r8 ! depth (m) that organic matter takes on characteristics of sapric peat - real(r8) :: pcalpha = 0.5_r8 ! percolation threshold - real(r8) :: pcbeta = 0.139_r8 ! percolation exponent - real(r8) :: pc_lake = 0.5_r8 ! percolation threshold - real(r8) :: perc_frac ! "percolating" fraction of organic soil - real(r8) :: perc_norm ! normalize to 1 when 100% organic soil - real(r8) :: uncon_hksat ! series conductivity of mineral/organic soil - real(r8) :: uncon_frac ! fraction of "unconnected" soil - real(r8) :: bd ! bulk density of dry soil material [kg/m^3] - real(r8) :: tkm ! mineral conductivity - real(r8) :: xksat ! maximum hydraulic conductivity of soil [mm/s] - real(r8) :: clay,sand ! temporaries - real(r8) :: organic_max ! organic matter (kg/m3) where soil is assumed to act like peat - integer :: dimid ! dimension id - logical :: readvar - type(file_desc_t) :: ncid ! netcdf id - real(r8) ,pointer :: zsoifl (:) ! Output: [real(r8) (:)] original soil midpoint - real(r8) ,pointer :: zisoifl (:) ! Output: [real(r8) (:)] original soil interface depth - real(r8) ,pointer :: dzsoifl (:) ! Output: [real(r8) (:)] original soil thickness - real(r8) ,pointer :: gti (:) ! read in - fmax - real(r8) ,pointer :: sand3d (:,:) ! read in - soil texture: percent sand (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: clay3d (:,:) ! read in - soil texture: percent clay (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: organic3d (:,:) ! read in - organic matter: kg/m3 (needs to be a pointer for use in ncdio) - character(len=256) :: locfn ! local filename - integer :: ipedof - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !----------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - do c = begc,endc - soilstate_inst%smpmin_col(c) = -1.e8_r8 - end do - - ! -------------------------------------------------------------------- - ! Read namelist - ! -------------------------------------------------------------------- - - call ReadNL( nlfilename ) - - ! -------------------------------------------------------------------- - ! Initialize root fraction (computing from surface, d is depth in meter): - ! -------------------------------------------------------------------- - - ! Currently pervious road has same properties as soil - do c = begc,endc - l = col%landunit(c) - - if (lun%urbpoi(l) .and. col%itype(c) == icol_road_perv) then - do lev = 1, nlevgrnd - soilstate_inst%rootfr_road_perv_col(c,lev) = 0._r8 - enddo - do lev = 1,nlevsoi - soilstate_inst%rootfr_road_perv_col(c,lev) = 1.0_r8/real(nlevsoi,r8) - end do -! remove roots below bedrock layer - soilstate_inst%rootfr_road_perv_col(c,1:col%nbedrock(c)) = & - soilstate_inst%rootfr_road_perv_col(c,1:col%nbedrock(c)) & - + sum(soilstate_inst%rootfr_road_perv_col(c,col%nbedrock(c)+1:nlevsoi)) & - /real(col%nbedrock(c)) - soilstate_inst%rootfr_road_perv_col(c,col%nbedrock(c)+1:nlevsoi) = 0._r8 - end if - end do - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - soilstate_inst%rootfr_col (c,nlevsoi+1:nlevgrnd) = 0._r8 - else - ! Inactive CH4 columns - ! (Also includes (lun%itype(l)==istdlak .and. allowlakeprod), which used to be - ! in a separate branch of the conditional) - soilstate_inst%rootfr_col (c,:) = spval - end if - end do - - ! Initialize root fraction - ! Note that fates has its own root fraction root fraction routine and should not - ! use the following since it depends on patch%itype - which fates should not use - - if (.not. use_fates) then - call init_vegrootfr(bounds, nlevsoi, nlevgrnd, & - soilstate_inst%rootfr_patch(begp:endp,1:nlevgrnd),'water') - call init_vegrootfr(bounds, nlevsoi, nlevgrnd, & - soilstate_inst%crootfr_patch(begp:endp,1:nlevgrnd),'carbon') - end if - - ! -------------------------------------------------------------------- - ! dynamic memory allocation - ! -------------------------------------------------------------------- - - allocate(sand3d(begg:endg,nlevsoifl)) - allocate(clay3d(begg:endg,nlevsoifl)) - - ! Determine organic_max from parameter file - - call getfil (paramfile, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_io(ncid=ncid, varname='organic_max', flag='read', data=organic_max, readvar=readvar) - if ( .not. readvar ) call endrun(msg=' ERROR: organic_max not on param file'//errMsg(sourcefile, __LINE__)) - call ncd_pio_closefile(ncid) - - ! -------------------------------------------------------------------- - ! Read surface dataset - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to read soil color, sand and clay boundary data .....' - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! Read in organic matter dataset - - allocate(organic3d(begg:endg,nlevsoifl)) - call organicrd(organic3d) - - ! Read in sand and clay data - - call ncd_io(ncid=ncid, varname='PCT_SAND', flag='read', data=sand3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: PCT_SAND NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='PCT_CLAY', flag='read', data=clay3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: PCT_CLAY NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - - do p = begp,endp - g = patch%gridcell(p) - if ( sand3d(g,1)+clay3d(g,1) == 0.0_r8 )then - if ( any( sand3d(g,:)+clay3d(g,:) /= 0.0_r8 ) )then - call endrun(msg='found depth points that do NOT sum to zero when surface does'//& - errMsg(sourcefile, __LINE__)) - end if - sand3d(g,:) = 1.0_r8 - clay3d(g,:) = 1.0_r8 - end if - if ( any( sand3d(g,:)+clay3d(g,:) == 0.0_r8 ) )then - call endrun(msg='after setting, found points sum to zero'//errMsg(sourcefile, __LINE__)) - end if - - soilstate_inst%sandfrac_patch(p) = sand3d(g,1)/100.0_r8 - soilstate_inst%clayfrac_patch(p) = clay3d(g,1)/100.0_r8 - end do - - ! Read fmax - - allocate(gti(begg:endg)) - call ncd_io(ncid=ncid, varname='FMAX', flag='read', data=gti, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: FMAX NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = begc, endc - g = col%gridcell(c) - soilstate_inst%wtfact_col(c) = gti(g) - end do - deallocate(gti) - - ! Close file - - call ncd_pio_closefile(ncid) - - ! -------------------------------------------------------------------- - ! get original soil depths to be used in interpolation of sand and clay - ! -------------------------------------------------------------------- - - allocate(zsoifl(1:nlevsoifl), zisoifl(0:nlevsoifl), dzsoifl(1:nlevsoifl)) - do j = 1, nlevsoifl - zsoifl(j) = 0.025*(exp(0.5_r8*(j-0.5_r8))-1._r8) !node depths - enddo - - dzsoifl(1) = 0.5_r8*(zsoifl(1)+zsoifl(2)) !thickness b/n two interfaces - do j = 2,nlevsoifl-1 - dzsoifl(j)= 0.5_r8*(zsoifl(j+1)-zsoifl(j-1)) - enddo - dzsoifl(nlevsoifl) = zsoifl(nlevsoifl)-zsoifl(nlevsoifl-1) - - zisoifl(0) = 0._r8 - do j = 1, nlevsoifl-1 - zisoifl(j) = 0.5_r8*(zsoifl(j)+zsoifl(j+1)) !interface depths - enddo - zisoifl(nlevsoifl) = zsoifl(nlevsoifl) + 0.5_r8*dzsoifl(nlevsoifl) - - ! -------------------------------------------------------------------- - ! Set soil hydraulic and thermal properties: non-lake - ! -------------------------------------------------------------------- - - ! urban roof, sunwall and shadewall thermal properties used to - ! derive thermal conductivity and heat capacity are set to special - ! value because thermal conductivity and heat capacity for urban - ! roof, sunwall and shadewall are prescribed in SoilThermProp.F90 - ! in SoilPhysicsMod.F90 - - - do c = begc, endc - g = col%gridcell(c) - l = col%landunit(c) - - if (lun%itype(l)==istwet .or. lun%itype(l)==istice_mec) then - - do lev = 1,nlevgrnd - soilstate_inst%bsw_col(c,lev) = spval - soilstate_inst%watsat_col(c,lev) = spval - soilstate_inst%watfc_col(c,lev) = spval - soilstate_inst%hksat_col(c,lev) = spval - soilstate_inst%sucsat_col(c,lev) = spval - soilstate_inst%watdry_col(c,lev) = spval - soilstate_inst%watopt_col(c,lev) = spval - soilstate_inst%bd_col(c,lev) = spval - if (lev <= nlevsoi) then - soilstate_inst%cellsand_col(c,lev) = spval - soilstate_inst%cellclay_col(c,lev) = spval - soilstate_inst%cellorg_col(c,lev) = spval - end if - end do - - do lev = 1,nlevgrnd - soilstate_inst%tkmg_col(c,lev) = spval - soilstate_inst%tksatu_col(c,lev) = spval - soilstate_inst%tkdry_col(c,lev) = spval - soilstate_inst%csol_col(c,lev)= spval - end do - - else if (lun%urbpoi(l) .and. (col%itype(c) /= icol_road_perv) .and. (col%itype(c) /= icol_road_imperv) )then - - ! Urban Roof, sunwall, shadewall properties set to special value - do lev = 1,nlevgrnd - soilstate_inst%watsat_col(c,lev) = spval - soilstate_inst%watfc_col(c,lev) = spval - soilstate_inst%bsw_col(c,lev) = spval - soilstate_inst%hksat_col(c,lev) = spval - soilstate_inst%sucsat_col(c,lev) = spval - soilstate_inst%watdry_col(c,lev) = spval - soilstate_inst%watopt_col(c,lev) = spval - soilstate_inst%bd_col(c,lev) = spval - if (lev <= nlevsoi) then - soilstate_inst%cellsand_col(c,lev) = spval - soilstate_inst%cellclay_col(c,lev) = spval - soilstate_inst%cellorg_col(c,lev) = spval - end if - end do - - do lev = 1,nlevgrnd - soilstate_inst%tkmg_col(c,lev) = spval - soilstate_inst%tksatu_col(c,lev) = spval - soilstate_inst%tkdry_col(c,lev) = spval - soilstate_inst%csol_col(c,lev) = spval - end do - - else - - do lev = 1,nlevgrnd - ! DML - this if statement could probably be removed and just the - ! top part used for all soil layer structures - if ( soil_layerstruct /= '10SL_3.5m' )then ! apply soil texture from 10 layer input dataset - if (lev .eq. 1) then - clay = clay3d(g,1) - sand = sand3d(g,1) - om_frac = organic3d(g,1)/organic_max - else if (lev <= nlevsoi) then - do j = 1,nlevsoifl-1 - if (zisoi(lev) >= zisoifl(j) .AND. zisoi(lev) < zisoifl(j+1)) then - clay = clay3d(g,j+1) - sand = sand3d(g,j+1) - om_frac = organic3d(g,j+1)/organic_max - endif - end do - else - clay = clay3d(g,nlevsoifl) - sand = sand3d(g,nlevsoifl) - om_frac = 0._r8 - endif - else - if (lev <= nlevsoi) then ! duplicate clay and sand values from 10th soil layer - clay = clay3d(g,lev) - sand = sand3d(g,lev) - if ( organic_frac_squared )then - om_frac = (organic3d(g,lev)/organic_max)**2._r8 - else - om_frac = organic3d(g,lev)/organic_max - end if - else - clay = clay3d(g,nlevsoi) - sand = sand3d(g,nlevsoi) - om_frac = 0._r8 - endif - end if - - if (lun%itype(l) == istdlak) then - - if (lev <= nlevsoi) then - soilstate_inst%cellsand_col(c,lev) = sand - soilstate_inst%cellclay_col(c,lev) = clay - soilstate_inst%cellorg_col(c,lev) = om_frac*organic_max - end if - - else if (lun%itype(l) /= istdlak) then ! soil columns of both urban and non-urban types - - if (lun%urbpoi(l)) then - om_frac = 0._r8 ! No organic matter for urban - end if - - if (lev <= nlevsoi) then - soilstate_inst%cellsand_col(c,lev) = sand - soilstate_inst%cellclay_col(c,lev) = clay - soilstate_inst%cellorg_col(c,lev) = om_frac*organic_max - end if - - ! Note that the following properties are overwritten for urban impervious road - ! layers that are not soil in SoilThermProp.F90 within SoilTemperatureMod.F90 - - !determine the type of pedotransfer function to be used based on soil order - !I will use the following implementation to further explore the ET problem, now - !I set soil order to 0 for all soils. Jinyun Tang, Mar 20, 2014 - - ipedof=get_ipedof(0) - call pedotransf(ipedof, sand, clay, & - soilstate_inst%watsat_col(c,lev), soilstate_inst%bsw_col(c,lev), soilstate_inst%sucsat_col(c,lev), xksat) - - om_watsat = max(0.93_r8 - 0.1_r8 *(zsoi(lev)/zsapric), 0.83_r8) - om_b = min(2.7_r8 + 9.3_r8 *(zsoi(lev)/zsapric), 12.0_r8) - om_sucsat = min(10.3_r8 - 0.2_r8 *(zsoi(lev)/zsapric), 10.1_r8) - om_hksat = max(0.28_r8 - 0.2799_r8*(zsoi(lev)/zsapric), xksat) - - soilstate_inst%bd_col(c,lev) = (1._r8 - soilstate_inst%watsat_col(c,lev))*2.7e3_r8 - soilstate_inst%watsat_col(c,lev) = (1._r8 - om_frac) * soilstate_inst%watsat_col(c,lev) + om_watsat*om_frac - tkm = (1._r8-om_frac) * (8.80_r8*sand+2.92_r8*clay)/(sand+clay)+om_tkm*om_frac ! W/(m K) - soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac) * (2.91_r8 + 0.159_r8*clay) + om_frac*om_b - soilstate_inst%sucsat_col(c,lev) = (1._r8-om_frac) * soilstate_inst%sucsat_col(c,lev) + om_sucsat*om_frac - soilstate_inst%hksat_min_col(c,lev) = xksat - - ! perc_frac is zero unless perf_frac greater than percolation threshold - if (om_frac > pcalpha) then - perc_norm=(1._r8 - pcalpha)**(-pcbeta) - perc_frac=perc_norm*(om_frac - pcalpha)**pcbeta - else - perc_frac=0._r8 - endif - - ! uncon_frac is fraction of mineral soil plus fraction of "nonpercolating" organic soil - uncon_frac=(1._r8-om_frac)+(1._r8-perc_frac)*om_frac - - ! uncon_hksat is series addition of mineral/organic conductivites - if (om_frac < 1._r8) then - uncon_hksat=uncon_frac/((1._r8-om_frac)/xksat & - +((1._r8-perc_frac)*om_frac)/om_hksat) - else - uncon_hksat = 0._r8 - end if - soilstate_inst%hksat_col(c,lev) = uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat - - soilstate_inst%tkmg_col(c,lev) = tkm ** (1._r8- soilstate_inst%watsat_col(c,lev)) - - soilstate_inst%tksatu_col(c,lev) = soilstate_inst%tkmg_col(c,lev)*0.57_r8**soilstate_inst%watsat_col(c,lev) - - soilstate_inst%tkdry_col(c,lev) = ((0.135_r8*soilstate_inst%bd_col(c,lev) + 64.7_r8) / & - (2.7e3_r8 - 0.947_r8*soilstate_inst%bd_col(c,lev)))*(1._r8-om_frac) + om_tkd*om_frac - - soilstate_inst%csol_col(c,lev) = ((1._r8-om_frac)*(2.128_r8*sand+2.385_r8*clay) / (sand+clay) + & - om_csol*om_frac)*1.e6_r8 ! J/(m3 K) - - soilstate_inst%watdry_col(c,lev) = soilstate_inst%watsat_col(c,lev) * & - (316230._r8/soilstate_inst%sucsat_col(c,lev)) ** (-1._r8/soilstate_inst%bsw_col(c,lev)) - soilstate_inst%watopt_col(c,lev) = soilstate_inst%watsat_col(c,lev) * & - (158490._r8/soilstate_inst%sucsat_col(c,lev)) ** (-1._r8/soilstate_inst%bsw_col(c,lev)) - - !! added by K.Sakaguchi for beta from Lee and Pielke, 1992 - ! water content at field capacity, defined as hk = 0.1 mm/day - ! used eqn (7.70) in CLM3 technote with k = 0.1 (mm/day) / secspday (day/sec) - soilstate_inst%watfc_col(c,lev) = soilstate_inst%watsat_col(c,lev) * & - (0.1_r8 / (soilstate_inst%hksat_col(c,lev)*secspday))**(1._r8/(2._r8*soilstate_inst%bsw_col(c,lev)+3._r8)) - end if - end do - - ! Urban pervious and impervious road - if (col%itype(c) == icol_road_imperv) then - ! Impervious road layers -- same as above except set watdry and watopt as missing - do lev = 1,nlevgrnd - soilstate_inst%watdry_col(c,lev) = spval - soilstate_inst%watopt_col(c,lev) = spval - end do - else if (col%itype(c) == icol_road_perv) then - ! pervious road layers - set in UrbanInitTimeConst - end if - - end if - end do - - ! -------------------------------------------------------------------- - ! Set soil hydraulic and thermal properties: lake - ! -------------------------------------------------------------------- - - do c = begc, endc - g = col%gridcell(c) - l = col%landunit(c) - - if (lun%itype(l)==istdlak) then - - do lev = 1,nlevgrnd - if ( lev <= nlevsoi )then - clay = soilstate_inst%cellclay_col(c,lev) - sand = soilstate_inst%cellsand_col(c,lev) - if ( organic_frac_squared )then - om_frac = (soilstate_inst%cellorg_col(c,lev)/organic_max)**2._r8 - else - om_frac = soilstate_inst%cellorg_col(c,lev)/organic_max - end if - else - clay = soilstate_inst%cellclay_col(c,nlevsoi) - sand = soilstate_inst%cellsand_col(c,nlevsoi) - om_frac = 0.0_r8 - end if - - soilstate_inst%watsat_col(c,lev) = 0.489_r8 - 0.00126_r8*sand - - soilstate_inst%bsw_col(c,lev) = 2.91 + 0.159*clay - - soilstate_inst%sucsat_col(c,lev) = 10._r8 * ( 10._r8**(1.88_r8-0.0131_r8*sand) ) - - bd = (1._r8-soilstate_inst%watsat_col(c,lev))*2.7e3_r8 - - soilstate_inst%watsat_col(c,lev) = (1._r8 - om_frac)*soilstate_inst%watsat_col(c,lev) + om_watsat_lake * om_frac - - tkm = (1._r8-om_frac)*(8.80_r8*sand+2.92_r8*clay)/(sand+clay) + om_tkm * om_frac ! W/(m K) - - soilstate_inst%bsw_col(c,lev) = (1._r8-om_frac)*(2.91_r8 + 0.159_r8*clay) + om_frac * om_b_lake - - soilstate_inst%sucsat_col(c,lev) = (1._r8-om_frac)*soilstate_inst%sucsat_col(c,lev) + om_sucsat_lake * om_frac - - xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s - - ! perc_frac is zero unless perf_frac greater than percolation threshold - if (om_frac > pc_lake) then - perc_norm = (1._r8 - pc_lake)**(-pcbeta) - perc_frac = perc_norm*(om_frac - pc_lake)**pcbeta - else - perc_frac = 0._r8 - endif - - ! uncon_frac is fraction of mineral soil plus fraction of "nonpercolating" organic soil - uncon_frac = (1._r8-om_frac) + (1._r8-perc_frac)*om_frac - - ! uncon_hksat is series addition of mineral/organic conductivites - if (om_frac < 1._r8) then - xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s - uncon_hksat = uncon_frac/((1._r8-om_frac)/xksat + ((1._r8-perc_frac)*om_frac)/om_hksat_lake) - else - uncon_hksat = 0._r8 - end if - - soilstate_inst%hksat_col(c,lev) = uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat_lake - soilstate_inst%tkmg_col(c,lev) = tkm ** (1._r8- soilstate_inst%watsat_col(c,lev)) - soilstate_inst%tksatu_col(c,lev) = soilstate_inst%tkmg_col(c,lev)*0.57_r8**soilstate_inst%watsat_col(c,lev) - soilstate_inst%tkdry_col(c,lev) = ((0.135_r8*bd + 64.7_r8) / (2.7e3_r8 - 0.947_r8*bd))*(1._r8-om_frac) + & - om_tkd * om_frac - soilstate_inst%csol_col(c,lev) = ((1._r8-om_frac)*(2.128_r8*sand+2.385_r8*clay) / (sand+clay) + & - om_csol * om_frac)*1.e6_r8 ! J/(m3 K) - soilstate_inst%watdry_col(c,lev) = soilstate_inst%watsat_col(c,lev) & - * (316230._r8/soilstate_inst%sucsat_col(c,lev)) ** (-1._r8/soilstate_inst%bsw_col(c,lev)) - soilstate_inst%watopt_col(c,lev) = soilstate_inst%watsat_col(c,lev) & - * (158490._r8/soilstate_inst%sucsat_col(c,lev)) ** (-1._r8/soilstate_inst%bsw_col(c,lev)) - - !! added by K.Sakaguchi for beta from Lee and Pielke, 1992 - ! water content at field capacity, defined as hk = 0.1 mm/day - ! used eqn (7.70) in CLM3 technote with k = 0.1 (mm/day) / (# seconds/day) - soilstate_inst%watfc_col(c,lev) = soilstate_inst%watsat_col(c,lev) * (0.1_r8 / & - (soilstate_inst%hksat_col(c,lev)*secspday))**(1._r8/(2._r8*soilstate_inst%bsw_col(c,lev)+3._r8)) - end do - endif - - end do - - ! -------------------------------------------------------------------- - ! Initialize threshold soil moisture and mass fracion of clay limited to 0.20 - ! -------------------------------------------------------------------- - - do c = begc,endc - g = col%gridcell(c) - - soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 - soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8) - end do - - ! -------------------------------------------------------------------- - ! Deallocate memory - ! -------------------------------------------------------------------- - - deallocate(sand3d, clay3d, organic3d) - deallocate(zisoifl, zsoifl, dzsoifl) - - end subroutine SoilStateInitTimeConst - -end module SoilStateInitTimeConstMod diff --git a/src/biogeophys/SoilStateType.F90 b/src/biogeophys/SoilStateType.F90 deleted file mode 100644 index 18baac4976..0000000000 --- a/src/biogeophys/SoilStateType.F90 +++ /dev/null @@ -1,417 +0,0 @@ -module SoilStateType - - !------------------------------------------------------------------------------ - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlayer, nlevsno - use clm_varcon , only : spval - use clm_varctl , only : use_hydrstress, use_cn, use_lch4, use_dynroot - use clm_varctl , only : iulog, hist_wrtch4diag - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - save - private - ! - ! !PUBLIC TYPES: - type, public :: soilstate_type - - ! sand/ clay/ organic matter - real(r8), pointer :: sandfrac_patch (:) ! patch sand fraction - real(r8), pointer :: clayfrac_patch (:) ! patch clay fraction - real(r8), pointer :: mss_frc_cly_vld_col (:) ! col mass fraction clay limited to 0.20 - real(r8), pointer :: cellorg_col (:,:) ! col organic matter for gridcell containing column (1:nlevsoi) - real(r8), pointer :: cellsand_col (:,:) ! sand value for gridcell containing column (1:nlevsoi) - real(r8), pointer :: cellclay_col (:,:) ! clay value for gridcell containing column (1:nlevsoi) - real(r8), pointer :: bd_col (:,:) ! col bulk density of dry soil material [kg/m^3] (CN) - - ! hydraulic properties - real(r8), pointer :: hksat_col (:,:) ! col hydraulic conductivity at saturation (mm H2O /s) - real(r8), pointer :: hksat_min_col (:,:) ! col mineral hydraulic conductivity at saturation (hksat) (mm/s) - real(r8), pointer :: hk_l_col (:,:) ! col hydraulic conductivity (mm/s) - real(r8), pointer :: smp_l_col (:,:) ! col soil matric potential (mm) - real(r8), pointer :: smpmin_col (:) ! col restriction for min of soil potential (mm) - real(r8), pointer :: bsw_col (:,:) ! col Clapp and Hornberger "b" (nlevgrnd) - real(r8), pointer :: watsat_col (:,:) ! col volumetric soil water at saturation (porosity) - real(r8), pointer :: watdry_col (:,:) ! col btran parameter for btran = 0 - real(r8), pointer :: watopt_col (:,:) ! col btran parameter for btran = 1 - real(r8), pointer :: watfc_col (:,:) ! col volumetric soil water at field capacity (nlevsoi) - real(r8), pointer :: sucsat_col (:,:) ! col minimum soil suction (mm) (nlevgrnd) - real(r8), pointer :: dsl_col (:) ! col dry surface layer thickness (mm) - real(r8), pointer :: soilresis_col (:) ! col soil evaporative resistance S&L14 (s/m) - real(r8), pointer :: soilbeta_col (:) ! col factor that reduces ground evaporation L&P1992(-) - real(r8), pointer :: soilalpha_col (:) ! col factor that reduces ground saturated specific humidity (-) - real(r8), pointer :: soilalpha_u_col (:) ! col urban factor that reduces ground saturated specific humidity (-) - real(r8), pointer :: soilpsi_col (:,:) ! col soil water potential in each soil layer (MPa) (CN) - real(r8), pointer :: wtfact_col (:) ! col maximum saturated fraction for a gridcell - real(r8), pointer :: porosity_col (:,:) ! col soil porisity (1-bulk_density/soil_density) (VIC) - real(r8), pointer :: eff_porosity_col (:,:) ! col effective porosity = porosity - vol_ice (nlevgrnd) - real(r8), pointer :: gwc_thr_col (:) ! col threshold soil moisture based on clay content -!scs: vangenuchten - real(r8), pointer :: msw_col (:,:) ! col vanGenuchtenClapp "m" - real(r8), pointer :: nsw_col (:,:) ! col vanGenuchtenClapp "n" - real(r8), pointer :: alphasw_col (:,:) ! col vanGenuchtenClapp "nalpha" - real(r8), pointer :: watres_col (:,:) ! residual soil water content - ! thermal conductivity / heat capacity - real(r8), pointer :: thk_col (:,:) ! col thermal conductivity of each layer [W/m-K] - real(r8), pointer :: tkmg_col (:,:) ! col thermal conductivity, soil minerals [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: tkdry_col (:,:) ! col thermal conductivity, dry soil (W/m/Kelvin) (nlevgrnd) - real(r8), pointer :: tksatu_col (:,:) ! col thermal conductivity, saturated soil [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: csol_col (:,:) ! col heat capacity, soil solids (J/m**3/Kelvin) (nlevgrnd) - - ! roots - real(r8), pointer :: rootr_patch (:,:) ! patch effective fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rootr_col (:,:) ! col effective fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rootfr_col (:,:) ! col fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rootfr_patch (:,:) ! patch fraction of roots for water in each soil layer (nlevgrnd) - real(r8), pointer :: crootfr_patch (:,:) ! patch fraction of roots for carbon in each soil layer (nlevgrnd) - real(r8), pointer :: root_depth_patch (:) ! root depth - real(r8), pointer :: rootr_road_perv_col (:,:) ! col effective fraction of roots in each soil layer of urban pervious road - real(r8), pointer :: rootfr_road_perv_col (:,:) ! col effective fraction of roots in each soil layer of urban pervious road - real(r8), pointer :: k_soil_root_patch (:,:) ! patch soil-root interface conductance [mm/s] - real(r8), pointer :: root_conductance_patch(:,:) ! patch root conductance [mm/s] - real(r8), pointer :: soil_conductance_patch(:,:) ! patch soil conductance [mm/s] - - contains - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type soilstate_type - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(soilstate_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !ARGUMENTS: - class(soilstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - allocate(this%mss_frc_cly_vld_col (begc:endc)) ; this%mss_frc_cly_vld_col (:) = nan - allocate(this%sandfrac_patch (begp:endp)) ; this%sandfrac_patch (:) = nan - allocate(this%clayfrac_patch (begp:endp)) ; this%clayfrac_patch (:) = nan - allocate(this%cellorg_col (begc:endc,nlevsoi)) ; this%cellorg_col (:,:) = nan - allocate(this%cellsand_col (begc:endc,nlevsoi)) ; this%cellsand_col (:,:) = nan - allocate(this%cellclay_col (begc:endc,nlevsoi)) ; this%cellclay_col (:,:) = nan - allocate(this%bd_col (begc:endc,nlevgrnd)) ; this%bd_col (:,:) = nan - - allocate(this%hksat_col (begc:endc,nlevgrnd)) ; this%hksat_col (:,:) = spval - allocate(this%hksat_min_col (begc:endc,nlevgrnd)) ; this%hksat_min_col (:,:) = spval - allocate(this%hk_l_col (begc:endc,nlevgrnd)) ; this%hk_l_col (:,:) = nan - allocate(this%smp_l_col (begc:endc,nlevgrnd)) ; this%smp_l_col (:,:) = nan - allocate(this%smpmin_col (begc:endc)) ; this%smpmin_col (:) = nan - - allocate(this%bsw_col (begc:endc,nlevgrnd)) ; this%bsw_col (:,:) = nan - allocate(this%watsat_col (begc:endc,nlevgrnd)) ; this%watsat_col (:,:) = nan - allocate(this%watdry_col (begc:endc,nlevgrnd)) ; this%watdry_col (:,:) = spval - allocate(this%watopt_col (begc:endc,nlevgrnd)) ; this%watopt_col (:,:) = spval - allocate(this%watfc_col (begc:endc,nlevgrnd)) ; this%watfc_col (:,:) = nan - allocate(this%sucsat_col (begc:endc,nlevgrnd)) ; this%sucsat_col (:,:) = spval - allocate(this%dsl_col (begc:endc)) ; this%dsl_col (:) = spval!nan - allocate(this%soilresis_col (begc:endc)) ; this%soilresis_col (:) = spval!nan - allocate(this%soilbeta_col (begc:endc)) ; this%soilbeta_col (:) = nan - allocate(this%soilalpha_col (begc:endc)) ; this%soilalpha_col (:) = nan - allocate(this%soilalpha_u_col (begc:endc)) ; this%soilalpha_u_col (:) = nan - allocate(this%soilpsi_col (begc:endc,nlevgrnd)) ; this%soilpsi_col (:,:) = nan - allocate(this%wtfact_col (begc:endc)) ; this%wtfact_col (:) = nan - allocate(this%porosity_col (begc:endc,nlayer)) ; this%porosity_col (:,:) = spval - allocate(this%eff_porosity_col (begc:endc,nlevgrnd)) ; this%eff_porosity_col (:,:) = spval - allocate(this%gwc_thr_col (begc:endc)) ; this%gwc_thr_col (:) = nan - - allocate(this%thk_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%thk_col (:,:) = nan - allocate(this%tkmg_col (begc:endc,nlevgrnd)) ; this%tkmg_col (:,:) = nan - allocate(this%tkdry_col (begc:endc,nlevgrnd)) ; this%tkdry_col (:,:) = nan - allocate(this%tksatu_col (begc:endc,nlevgrnd)) ; this%tksatu_col (:,:) = nan - allocate(this%csol_col (begc:endc,nlevgrnd)) ; this%csol_col (:,:) = nan - - allocate(this%rootr_patch (begp:endp,1:nlevgrnd)) ; this%rootr_patch (:,:) = nan - allocate(this%root_depth_patch (begp:endp)) ; this%root_depth_patch (:) = nan - allocate(this%rootr_col (begc:endc,nlevgrnd)) ; this%rootr_col (:,:) = nan - allocate(this%rootr_road_perv_col (begc:endc,1:nlevgrnd)) ; this%rootr_road_perv_col (:,:) = nan - allocate(this%rootfr_patch (begp:endp,1:nlevgrnd)) ; this%rootfr_patch (:,:) = nan - allocate(this%crootfr_patch (begp:endp,1:nlevgrnd)) ; this%crootfr_patch (:,:) = nan - allocate(this%rootfr_col (begc:endc,1:nlevgrnd)) ; this%rootfr_col (:,:) = nan - allocate(this%rootfr_road_perv_col (begc:endc,1:nlevgrnd)) ; this%rootfr_road_perv_col (:,:) = nan - allocate(this%k_soil_root_patch (begp:endp,1:nlevsoi)) ; this%k_soil_root_patch (:,:) = nan - allocate(this%root_conductance_patch(begp:endp,1:nlevsoi)) ; this%root_conductance_patch (:,:) = nan - allocate(this%soil_conductance_patch(begp:endp,1:nlevsoi)) ; this%soil_conductance_patch (:,:) = nan - allocate(this%msw_col (begc:endc,1:nlevgrnd)) ; this%msw_col (:,:) = nan - allocate(this%nsw_col (begc:endc,1:nlevgrnd)) ; this%nsw_col (:,:) = nan - allocate(this%alphasw_col (begc:endc,1:nlevgrnd)) ; this%alphasw_col (:,:) = nan - allocate(this%watres_col (begc:endc,1:nlevgrnd)) ; this%watres_col (:,:) = nan - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use histFileMod , only: hist_addfld1d, hist_addfld2d, no_snow_normal - ! - ! !ARGUMENTS: - class(soilstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begp, endp - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - - if (use_lch4) then - if (hist_wrtch4diag) then - active = "active" - else - active = "inactive" - end if - else - active = "inactive" - end if - - call hist_addfld2d (fname='SMP', units='mm', type2d='levgrnd', & - avgflag='A', long_name='soil matric potential (vegetated landunits only)', & - ptr_col=this%smp_l_col, set_spec=spval, l2g_scale_type='veg') - - this%root_conductance_patch(begp:endp,:) = spval - call hist_addfld2d (fname='KROOT', units='1/s', type2d='levsoi', & - avgflag='A', long_name='root conductance each soil layer', & - ptr_patch=this%root_conductance_patch, default='inactive') - - this%soil_conductance_patch(begp:endp,:) = spval - call hist_addfld2d (fname='KSOIL', units='1/s', type2d='levsoi', & - avgflag='A', long_name='soil conductance in each soil layer', & - ptr_patch=this%soil_conductance_patch, default='inactive') - - if (use_cn) then - this%bsw_col(begc:endc,:) = spval - call hist_addfld2d (fname='bsw', units='unitless', type2d='levgrnd', & - avgflag='A', long_name='clap and hornberger B', & - ptr_col=this%bsw_col, default='inactive') - end if - - if (use_dynroot) then - this%rootfr_patch(begp:endp,:) = spval - call hist_addfld2d (fname='ROOTFR', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='fraction of roots in each soil layer', & - ptr_patch=this%rootfr_patch, default='active') - end if - - if ( use_dynroot ) then - this%root_depth_patch(begp:endp) = spval - call hist_addfld1d (fname='ROOT_DEPTH', units="m", & - avgflag='A', long_name='rooting depth', & - ptr_patch=this%root_depth_patch ) - end if - - if (use_cn) then - this%rootr_patch(begp:endp,:) = spval - call hist_addfld2d (fname='ROOTR', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective fraction of roots in each soil layer', & - ptr_patch=this%rootr_patch, default='inactive') - end if - - if (use_cn) then - this%rootr_col(begc:endc,:) = spval - call hist_addfld2d (fname='ROOTR_COLUMN', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective fraction of roots in each soil layer', & - ptr_col=this%rootr_col, default='inactive') - - end if - - if (use_cn) then - this%soilpsi_col(begc:endc,:) = spval - call hist_addfld2d (fname='SOILPSI', units='MPa', type2d='levgrnd', & - avgflag='A', long_name='soil water potential in each soil layer', & - ptr_col=this%soilpsi_col, default='inactive') - end if - - this%thk_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%thk_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_TK', units='W/m-K', type2d='levsno', & - avgflag='A', long_name='Thermal conductivity', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_TK_ICE', units='W/m-K', type2d='levsno', & - avgflag='A', long_name='Thermal conductivity (ice landunits only)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%hk_l_col(begc:endc,:) = spval - call hist_addfld2d (fname='HK', units='mm/s', type2d='levgrnd', & - avgflag='A', long_name='hydraulic conductivity (vegetated landunits only)', & - ptr_col=this%hk_l_col, set_spec=spval, l2g_scale_type='veg', default='inactive') - - this%soilalpha_col(begc:endc) = spval - call hist_addfld1d (fname='SoilAlpha', units='unitless', & - avgflag='A', long_name='factor limiting ground evap', & - ptr_col=this%soilalpha_col, set_urb=spval, default='inactive' ) - - this%soilalpha_u_col(begc:endc) = spval - call hist_addfld1d (fname='SoilAlpha_U', units='unitless', & - avgflag='A', long_name='urban factor limiting ground evap', & - ptr_col=this%soilalpha_u_col, set_nourb=spval, default='inactive') - - if (use_cn) then - this%watsat_col(begc:endc,:) = spval - call hist_addfld2d (fname='watsat', units='m^3/m^3', type2d='levgrnd', & - avgflag='A', long_name='water saturated', & - ptr_col=this%watsat_col, default='inactive') - end if - - if (use_cn) then - this%eff_porosity_col(begc:endc,:) = spval - call hist_addfld2d (fname='EFF_POROSITY', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective porosity = porosity - vol_ice', & - ptr_col=this%eff_porosity_col, default='inactive') - end if - - if (use_cn) then - this%watfc_col(begc:endc,:) = spval - call hist_addfld2d (fname='watfc', units='m^3/m^3', type2d='levgrnd', & - avgflag='A', long_name='water field capacity', & - ptr_col=this%watfc_col, default='inactive') - end if - - this%soilresis_col(begc:endc) = spval - call hist_addfld1d (fname='SOILRESIS', units='s/m', & - avgflag='A', long_name='soil resistance to evaporation', & - ptr_col=this%soilresis_col) - - this%dsl_col(begc:endc) = spval - call hist_addfld1d (fname='DSL', units='mm', & - avgflag='A', long_name='dry surface layer thickness', & - ptr_col=this%dsl_col) - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! Initialize module soil state variables to reasonable values - ! - ! !USES: - use clm_varpar , only : nlevgrnd - ! - ! !ARGUMENTS: - class(soilstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - !----------------------------------------------------------------------- - - this%smp_l_col(bounds%begc:bounds%endc,1:nlevgrnd) = -1000._r8 - this%hk_l_col(bounds%begc:bounds%endc,1:nlevgrnd) = 0._r8 - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use ncdio_pio , only : file_desc_t, ncd_io, ncd_double - use restUtilMod - use spmdMod , only : masterproc - use RootBiophysMod , only : init_vegrootfr - ! - ! !ARGUMENTS: - class(soilstate_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: c - logical :: readvar - logical :: readrootfr = .false. - !------------------------------------------------------------------------ - - call restartvar(ncid=ncid, flag=flag, varname='DSL', xtype=ncd_double, & - dim1name='column', long_name='dsl thickness', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%dsl_col) - - call restartvar(ncid=ncid, flag=flag, varname='SOILRESIS', xtype=ncd_double, & - dim1name='column', long_name='soil resistance', units='s/m', & - interpinic_flag='interp', readvar=readvar, data=this%soilresis_col) - - call restartvar(ncid=ncid, flag=flag, varname='SMP', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='soil matric potential', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%smp_l_col) - - call restartvar(ncid=ncid, flag=flag, varname='HK', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='hydraulic conductivity', units='mm/s', & - interpinic_flag='interp', readvar=readvar, data=this%hk_l_col) - - if( use_dynroot ) then - call restartvar(ncid=ncid, flag=flag, varname='root_depth', xtype=ncd_double, & - dim1name='pft', & - long_name='root depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%root_depth_patch) - - call restartvar(ncid=ncid, flag=flag, varname='rootfr', xtype=ncd_double, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & - long_name='root fraction', units='', & - interpinic_flag='interp', readvar=readrootfr, data=this%rootfr_patch) - else - readrootfr = .false. - end if - if (flag=='read' .and. .not. readrootfr ) then - if (masterproc) then - write(iulog,*) "can't find rootfr in restart (or initial) file..." - write(iulog,*) "Initialize rootfr to default" - end if - call init_vegrootfr(bounds, nlevsoi, nlevgrnd, & - this%rootfr_patch(bounds%begp:bounds%endp,1:nlevgrnd), 'water') - call init_vegrootfr(bounds, nlevsoi, nlevgrnd, & - this%crootfr_patch(bounds%begp:bounds%endp,1:nlevgrnd), 'carbon') - end if - - end subroutine Restart - -end module SoilStateType diff --git a/src/biogeophys/SoilTemperatureMod.F90 b/src/biogeophys/SoilTemperatureMod.F90 deleted file mode 100644 index 8f4a9760fd..0000000000 --- a/src/biogeophys/SoilTemperatureMod.F90 +++ /dev/null @@ -1,4763 +0,0 @@ -module SoilTemperatureMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates snow and soil temperatures including phase change - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use abortutils , only : endrun - use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : iulog - use UrbanParamsType , only : urbanparams_type - use UrbanTimeVarType , only : urbantv_type - use atm2lndType , only : atm2lnd_type - use CanopyStateType , only : canopystate_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use SolarAbsorbedType , only : solarabs_type - use SoilStateType , only : soilstate_type - use EnergyFluxType , only : energyflux_type - use TemperatureType , only : temperature_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilTemperature - ! - ! -> SoilTemperature: soil/snow and ground temperatures - ! -> SoilTermProp thermal conductivities and heat capacities - ! -> Tridiagonal tridiagonal matrix solution - ! -> PhaseChange phase change of liquid/ice contents - ! - ! (1) Snow and soil temperatures - ! o The volumetric heat capacity is calculated as a linear combination - ! in terms of the volumetric fraction of the constituent phases. - ! o The thermal conductivity of soil is computed from - ! the algorithm of Johansen (as reported by Farouki 1981), and the - ! conductivity of snow is from the formulation used in - ! SNTHERM (Jordan 1991). - ! o Boundary conditions: - ! F = Rnet - Hg - LEg (top), F= 0 (base of the soil column). - ! o Soil / snow temperature is predicted from heat conduction - ! in 10 soil layers and up to nlevsno snow layers. - ! The thermal conductivities at the interfaces between two - ! neighboring layers (j, j+1) are derived from an assumption that - ! the flux across the interface is equal to that from the node j - ! to the interface and the flux from the interface to the node j+1. - ! The equation is solved using the Crank-Nicholson method and - ! results in a tridiagonal system equation. - ! (2) Phase change - ! - ! The following is only public for the sake of unit testing; it should not be called - ! directly by CLM code outside this module - public :: ComputeGroundHeatFluxAndDeriv ! Computes G and dG/dT on surface of standing water, snow and soil - public :: ComputeHeatDiffFluxAndFactor ! Heat diffusion at layer interface and factor used in setting up of banded matrix - public :: SetRHSVec ! Sets up the RHS vector for the numerical solution of temperature for snow/standing-water/soil - public :: SetRHSVec_Snow ! Sets up the RHS vector corresponding to snow layers for Urban+Non-Urban columns - public :: SetRHSVec_SnowUrban ! Sets up the RHS vector corresponding to snow layers for Urban columns - public :: SetRHSVec_SnowUrbanNonRoad ! Sets up the RHS vector corresponding to snow layers for Urban columns that are sunwall, shadewall, and roof columns - public :: SetRHSVec_SnowUrbanRoad ! Sets up the RHS vector corresponding to snow layers for Urban columns that are pervious, and impervious columns - public :: SetRHSVec_SnowNonUrban ! Sets up the RHS vector corresponding to snow layers for Non-Urban columns - public :: SetRHSVec_StandingSurfaceWater ! Sets up the RHS vector corresponding to standing water layers for Urban+Non-Urban columns - public :: SetRHSVec_Soil ! Sets up the RHS vector corresponding to soil layers for Urban+Non-Urban columns - public :: SetRHSVec_SoilUrban ! Sets up the RHS vector corresponding to soil layers for Urban columns - public :: SetRHSVec_SoilUrbanNonRoad ! Sets up the RHS vector corresponding to soil layers for Urban columns that are pervious, and impervious columns - public :: SetRHSVec_SoilUrbanRoad ! Sets up the RHS vector corresponding to soil layers for Urban columns that are pervious, and impervious columns - public :: SetRHSVec_SoilNonUrban ! Sets up the RHS vector corresponding to soil layers for Non-Urban columns - public :: SetRHSVec_Soil_StandingSurfaceWater ! Adds contribution from standing water in the RHS vector corresponding to soil layers - public :: SetMatrix ! Sets up the matrix for the numerical solution of temperature for snow/standing-water/soil - public :: AssembleMatrixFromSubmatrices ! Assemble the full matrix from submatrices. - public :: SetMatrix_Snow ! Set up the matrix entries corresponding to snow layers for Urban+Non-Urban columns - public :: SetMatrix_SnowUrban ! Set up the matrix entries corresponding to snow layers for Urban column - public :: SetMatrix_SnowUrbanNonRoad ! Set up the matrix entries corresponding to snow layers for Urban column that are sunwall, shadewall, and roof columns - public :: SetMatrix_SnowUrbanRoad ! Set up the matrix entries corresponding to snow layers for Urban column that are pervious, and impervious columns - public :: SetMatrix_SnowNonUrban ! Set up the matrix entries corresponding to snow layers for Non-Urban column - public :: SetMatrix_Snow_Soil ! Set up the matrix entries corresponding to snow-soil interaction - public :: SetMatrix_Snow_SoilUrban ! Set up the matrix entries corresponding to snow-soil interaction for Urban column - public :: SetMatrix_Snow_SoilUrbanNonRoad ! Set up the matrix entries corresponding to snow-soil interaction for Urban column that are sunwall, shadewall, and roof columns - public :: SetMatrix_Snow_SoilUrbanRoad ! Set up the matrix entries corresponding to snow-soil interaction for Urban column that are pervious, and impervious columns - public :: SetMatrix_Snow_SoilNonUrban ! Set up the matrix entries corresponding to snow-soil interaction for Non-Urban column - public :: SetMatrix_Soil ! Set up the matrix entries corresponding to soil layers for Urban+Non-Urban columns - public :: SetMatrix_SoilUrban ! Set up the matrix entries corresponding to soil layers for Urban column - public :: SetMatrix_SoilUrbanNonRoad ! Set up the matrix entries corresponding to soil layers for Urban column that are sunwall, shadewall, and roof columns - public :: SetMatrix_SoilUrbanRoad ! Set up the matrix entries corresponding to soil layers for Urban column that are pervious, and impervious columns - public :: SetMatrix_SoilNonUrban ! Set up the matrix entries corresponding to soil layers for Non-Urban column - public :: SetMatrix_Soil_Snow ! Set up the matrix entries corresponding to soil-snow interction for Urban+Non-Urban columns - public :: SetMatrix_Soil_SnowUrban ! Set up the matrix entries corresponding to soil-snow interction for Urban column - public :: SetMatrix_Soil_SnowUrbanNonRoad ! Set up the matrix entries corresponding to soil-snow interction for Urban column that are sunwall, shadewall, and roof columns - public :: SetMatrix_Soil_SnowUrbanRoad ! Set up the matrix entries corresponding to soil-snow interction for Urban column that are pervious, and impervious columns - public :: SetMatrix_Soil_SnowNonUrban ! Set up the matrix entries corresponding to soil-snow interction for Non-Urban column - public :: SetMatrix_StandingSurfaceWater ! Set up the matrix entries corresponding to standing surface water - public :: SetMatrix_StandingSurfaceWater_Soil ! Set up the matrix entries corresponding to standing surface water-soil interaction - public :: SetMatrix_Soil_StandingSurfaceWater ! Set up the matrix entries corresponding to soil-standing surface water interction - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: SoilThermProp ! Set therm conduct. and heat cap of snow/soil layers - private :: PhaseChangeH2osfc ! When surface water freezes move ice to bottom snow layer - private :: PhaseChange_beta ! Calculation of the phase change within snow and soil layers - private :: BuildingHAC ! Building Heating and Cooling for simpler method (introduced in CLM4.5) - - real(r8), private, parameter :: thin_sfclayer = 1.0e-6_r8 ! Threshold for thin surface layer - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filter_nolakec, & - atm2lnd_inst, urbanparams_inst, canopystate_inst, waterstate_inst, waterflux_inst,& - solarabs_inst, soilstate_inst, energyflux_inst, temperature_inst, urbantv_inst) - ! - ! !DESCRIPTION: - ! Snow and soil temperatures including phase change - ! o The volumetric heat capacity is calculated as a linear combination - ! in terms of the volumetric fraction of the constituent phases. - ! o The thermal conductivity of soil is computed from - ! the algorithm of Johansen (as reported by Farouki 1981), and the - ! conductivity of snow is from the formulation used in - ! SNTHERM (Jordan 1991). - ! o Boundary conditions: - ! F = Rnet - Hg - LEg (top), F= 0 (base of the soil column). - ! o Soil / snow temperature is predicted from heat conduction - ! in 10 soil layers and up to nlevsno snow layers. - ! The thermal conductivities at the interfaces between two - ! neighboring layers (j, j+1) are derived from an assumption that - ! the flux across the interface is equal to that from the node j - ! to the interface and the flux from the interface to the node j+1. - ! The equation is solved using the Crank-Nicholson method and - ! results in a tridiagonal system equation. - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - use clm_varctl , only : iulog - use clm_varcon , only : cnfac, cpice, cpliq, denh2o - use landunit_varcon , only : istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv - use BandDiagonalMod , only : BandDiagonal - use UrbanParamsType , only : IsSimpleBuildTemp, IsProgBuildTemp - use UrbBuildTempOleson2015Mod, only : BuildingTemperature - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(urbantv_type) , intent(in) :: urbantv_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,l,g,pi ! indices - integer :: fc ! lake filtered column indices - integer :: fl ! urban filtered landunit indices - integer :: jtop(bounds%begc:bounds%endc) ! top level at each column - real(r8) :: dtime ! land model time step (sec) - real(r8) :: cv (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat capacity [J/(m2 K)] - real(r8) :: tk (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! thermal conductivity [W/(m K)] - real(r8) :: fn (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] - real(r8) :: fn1(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - real(r8) :: sabg_lyr_col(bounds%begc:bounds%endc,-nlevsno+1:1) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8) :: eflx_gnet_top ! net energy flux into surface layer, patch-level [W/m2] - real(r8) :: hs_top(bounds%begc:bounds%endc) ! net energy flux into surface layer (col) [W/m2] - logical :: cool_on(bounds%begl:bounds%endl) ! is urban air conditioning on? - logical :: heat_on(bounds%begl:bounds%endl) ! is urban heating on? - real(r8) :: fn_h2osfc(bounds%begc:bounds%endc) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8) :: dz_h2osfc(bounds%begc:bounds%endc) ! height of standing surface water [m] - integer, parameter :: nband=5 - real(r8) :: bmatrix(bounds%begc:bounds%endc,nband,-nlevsno:nlevgrnd) ! banded matrix for numerical solution of temperature - real(r8) :: tvector(bounds%begc:bounds%endc,-nlevsno:nlevgrnd) ! initial temperature solution [Kelvin] - real(r8) :: rvector(bounds%begc:bounds%endc,-nlevsno:nlevgrnd) ! RHS vector for numerical solution of temperature - real(r8) :: tk_h2osfc(bounds%begc:bounds%endc) ! thermal conductivity of h2osfc [W/(m K)] [col] - real(r8) :: dhsdT(bounds%begc:bounds%endc) ! temperature derivative of "hs" [col] - real(r8) :: hs_soil(bounds%begc:bounds%endc) ! heat flux on soil [W/m2] - real(r8) :: hs_top_snow(bounds%begc:bounds%endc) ! heat flux on top snow layer [W/m2] - real(r8) :: hs_h2osfc(bounds%begc:bounds%endc) ! heat flux on standing water [W/m2] - integer :: jbot(bounds%begc:bounds%endc) ! bottom level at each column - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - ctype => col%itype , & ! Input: [integer (:) ] column type - - - t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:) ] maximum internal building air temperature (K) - t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:) ] minimum internal building air temperature (K) - - - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - - - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - - - sabg_soil => solarabs_inst%sabg_soil_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by soil (W/m**2) - sabg_snow => solarabs_inst%sabg_snow_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by snow (W/m**2) - sabg_chk => solarabs_inst%sabg_chk_patch , & ! Output: [real(r8) (:) ] sum of soil/snow using current fsno, for balance check - sabg_lyr => solarabs_inst%sabg_lyr_patch , & ! Input: [real(r8) (:,:) ] absorbed solar radiation (pft,lyr) [W/m2] - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of vapor of water (or sublimation) [j/kg] - cgrnd => energyflux_inst%cgrnd_patch , & ! Input: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp [w/m2/k] - dlrad => energyflux_inst%dlrad_patch , & ! Input: [real(r8) (:) ] downward longwave radiation blow the canopy [W/m2] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Input: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Input: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_sh_snow => energyflux_inst%eflx_sh_snow_patch , & ! Input: [real(r8) (:) ] sensible heat flux from snow (W/m**2) [+ to atm] - eflx_sh_soil => energyflux_inst%eflx_sh_soil_patch , & ! Input: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_h2osfc => energyflux_inst%eflx_sh_h2osfc_patch , & ! Input: [real(r8) (:) ] sensible heat flux from surface water (W/m**2) [+ to atm] - eflx_bot => energyflux_inst%eflx_bot_col , & ! Input: [real(r8) (:) ] heat flux from beneath column (W/m**2) [+ = upward] - eflx_fgr12 => energyflux_inst%eflx_fgr12_col , & ! Output: [real(r8) (:) ] heat flux between soil layer 1 and 2 (W/m2) - eflx_fgr => energyflux_inst%eflx_fgr_col , & ! Output: [real(r8) (:,:) ] (rural) soil downward heat flux (W/m2) (1:nlevgrnd) - eflx_traffic => energyflux_inst%eflx_traffic_lun , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_traffic_patch => energyflux_inst%eflx_traffic_patch , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_wasteheat => energyflux_inst%eflx_wasteheat_lun , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_wasteheat_patch => energyflux_inst%eflx_wasteheat_patch , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac => energyflux_inst%eflx_heat_from_ac_lun , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_heat_from_ac_patch => energyflux_inst%eflx_heat_from_ac_patch , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_anthro => energyflux_inst%eflx_anthro_patch , & ! Input: [real(r8) (:) ] total anthropogenic heat flux (W/m**2) - dgnetdT => energyflux_inst%dgnetdT_patch , & ! Output: [real(r8) (:) ] temperature derivative of ground net heat flux - eflx_gnet => energyflux_inst%eflx_gnet_patch , & ! Output: [real(r8) (:) ] net ground heat flux into the surface (W/m**2) - eflx_building_heat_errsoi => energyflux_inst%eflx_building_heat_errsoi_col, & ! Output: [real(r8) (:)] heat flux from urban building interior to walls, roof (W/m**2) - eflx_urban_ac_col => energyflux_inst%eflx_urban_ac_col , & ! Output: [real(r8) (:) ] urban air conditioning flux (W/m**2) - eflx_urban_heat_col => energyflux_inst%eflx_urban_heat_col , & ! Output: [real(r8) (:) ] urban heating flux (W/m**2) - - emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity - tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:) ] temperature at previous time step [K] - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Output: [real(r8) (:) ] surface water temperature - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - t_grnd => temperature_inst%t_grnd_col , & ! Output: [real(r8) (:) ] ground surface temperature [K] - t_building => temperature_inst%t_building_lun , & ! Output: [real(r8) (:) ] internal building air temperature (K) - t_roof_inner => temperature_inst%t_roof_inner_lun , & ! Input: [real(r8) (:) ] roof inside surface temperature (K) - t_sunw_inner => temperature_inst%t_sunw_inner_lun , & ! Input: [real(r8) (:) ] sunwall inside surface temperature (K) - t_shdw_inner => temperature_inst%t_shdw_inner_lun , & ! Input: [real(r8) (:) ] shadewall inside surface temperature (K) - xmf => temperature_inst%xmf_col , & ! Output: [real(r8) (:) ] melting or freezing within a time step [kg/m2] - xmf_h2osfc => temperature_inst%xmf_h2osfc_col , & ! Output: [real(r8) (:) ] latent heat of phase change of surface water [col] - fact => temperature_inst%fact_col , & ! Output: [real(r8) (:) ] used in computing tridiagonal matrix [col, lev] - c_h2osfc => temperature_inst%c_h2osfc_col , & ! Output: [real(r8) (:) ] heat capacity of surface water [col] - - begc => bounds%begc , & - endc => bounds%endc & - ) - - ! Get step size - - dtime = get_step_size() - - if ( IsSimpleBuildTemp() ) call BuildingHAC( bounds, num_urbanl, & - filter_urbanl, temperature_inst, & - urbanparams_inst, urbantv_inst, & - cool_on, heat_on ) - - - ! set up compact matrix for band diagonal solver, requires additional - ! sub/super diagonals (1 each), and one additional row for t_h2osfc - jtop = -9999 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - jtop(c) = snl(c) - ! compute jbot - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) ) then - jbot(c) = nlevurb - else - jbot(c) = nlevgrnd - endif - end do - - !------------------------------------------------------ - ! Compute ground surface and soil temperatures - !------------------------------------------------------ - - ! Thermal conductivity and Heat capacity - - tk_h2osfc(begc:endc) = nan - call SoilThermProp(bounds, num_nolakec, filter_nolakec, & - tk(begc:endc, :), & - cv(begc:endc, :), & - tk_h2osfc(begc:endc), & - urbanparams_inst, temperature_inst, waterstate_inst, soilstate_inst) - - ! Net ground heat flux into the surface and its temperature derivative - ! Added a patches loop here to get the average of hs and dhsdT over - ! all Patches on the column. Precalculate the terms that do not depend on PFT. - - call ComputeGroundHeatFluxAndDeriv(bounds, num_nolakec, filter_nolakec, & - hs_h2osfc( begc:endc ), & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col( begc:endc, -nlevsno+1: ), & - atm2lnd_inst, urbanparams_inst, canopystate_inst, waterstate_inst, & - waterflux_inst, solarabs_inst, energyflux_inst, temperature_inst) - - ! Determine heat diffusion through the layer interface and factor used in computing - ! banded diagonal matrix and set up vector r and vectors a, b, c that define banded - ! diagonal matrix and solve system - - call ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, & - dtime, & - tk( begc:endc, -nlevsno+1: ), & - cv( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - energyflux_inst, temperature_inst) - - ! compute thermal properties of h2osfc - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ( (h2osfc(c) > thin_sfclayer) .and. (frac_h2osfc(c) > thin_sfclayer) ) then - c_h2osfc(c) = max(thin_sfclayer, cpliq*h2osfc(c)/frac_h2osfc(c) ) - dz_h2osfc(c) = max(thin_sfclayer, 1.0e-3*h2osfc(c)/frac_h2osfc(c) ) - else - c_h2osfc(c) = thin_sfclayer - dz_h2osfc(c) = thin_sfclayer - endif - enddo - - - ! Set up vector r and vectors a, b, c that define tridiagonal - - call SetRHSVec(bounds, num_nolakec, filter_nolakec, & - dtime, & - hs_h2osfc( begc:endc ), & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - c_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - temperature_inst, & - waterstate_inst, & - rvector( begc:endc, -nlevsno: )) - - ! Set up the banded diagonal matrix - - call SetMatrix(bounds, num_nolakec, filter_nolakec, & - dtime, & - nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - c_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - waterstate_inst, & - bmatrix( begc:endc, 1:, -nlevsno: )) - - ! initialize initial temperature vector - - tvector(begc:endc, :) = nan - do fc = 1,num_nolakec - c = filter_nolakec(fc) - do j = snl(c)+1, 0 - tvector(c,j-1) = t_soisno(c,j) - end do - - ! surface water layer has two coefficients - tvector(c,0) = t_h2osfc(c) - - ! soil layers; top layer will have one offset and one extra coefficient - tvector(c,1:nlevgrnd) = t_soisno(c,1:nlevgrnd) - - enddo - - call t_startf( 'SoilTempBandDiag') - - ! Solve the system - - call BandDiagonal(bounds, -nlevsno, nlevgrnd, jtop(begc:endc), jbot(begc:endc), & - num_nolakec, filter_nolakec, nband, bmatrix(begc:endc, :, :), & - rvector(begc:endc, :), tvector(begc:endc, :)) - call t_stopf( 'SoilTempBandDiag') - - ! return temperatures to original array - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - do j = snl(c)+1, 0 - t_soisno(c,j) = tvector(c,j-1) !snow layers - end do - t_soisno(c,1:nlevgrnd) = tvector(c,1:nlevgrnd) !soil layers - - if (frac_h2osfc(c) == 0._r8) then - t_h2osfc(c)=t_soisno(c,1) - else - t_h2osfc(c) = tvector(c,0) !surface water - endif - enddo - - ! Melting or Freezing - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) .and. j <= nlevurb) then - if (j >= snl(c)+1) then - if (j <= nlevurb-1) then - fn1(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j == nlevurb) then - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - if ( IsSimpleBuildTemp() )then - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - ! Note new formulation for fn, this will be used below in net energey flux computations - fn1(c,j) = tk(c,j) * (t_building(l) - t_soisno(c,j))/(zi(c,j) - z(c,j)) - fn(c,j) = tk(c,j) * (t_building(l) - tssbef(c,j))/(zi(c,j) - z(c,j)) - - else - ! the bottom "soil" layer and the equations are derived assuming a prognostic inner - ! surface temperature. - if (ctype(c) == icol_sunwall) then - fn1(c,j) = tk(c,j) * (t_sunw_inner(l) - t_soisno(c,j))/(zi(c,j) - z(c,j)) - fn(c,j) = tk(c,j) * (t_sunw_inner(l) - tssbef(c,j))/(zi(c,j) - z(c,j)) - else if (ctype(c) == icol_shadewall) then - fn1(c,j) = tk(c,j) * (t_shdw_inner(l) - t_soisno(c,j))/(zi(c,j) - z(c,j)) - fn(c,j) = tk(c,j) * (t_shdw_inner(l) - tssbef(c,j))/(zi(c,j) - z(c,j)) - else if (ctype(c) == icol_roof) then - fn1(c,j) = tk(c,j) * (t_roof_inner(l) - t_soisno(c,j))/(zi(c,j) - z(c,j)) - fn(c,j) = tk(c,j) * (t_roof_inner(l) - tssbef(c,j))/(zi(c,j) - z(c,j)) - end if - end if - end if - end if - else if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) then - if (j >= snl(c)+1) then - if (j <= nlevgrnd-1) then - fn1(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j == nlevgrnd) then - fn1(c,j) = 0._r8 - end if - end if - end if - end do - end do - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_roof) then - eflx_building_heat_errsoi(c) = cnfac*fn(c,nlevurb) + (1._r8-cnfac)*fn1(c,nlevurb) - else - eflx_building_heat_errsoi(c) = 0._r8 - end if - if ( IsSimpleBuildTemp() )then - if (cool_on(l)) then - eflx_urban_ac_col(c) = abs(eflx_building_heat_errsoi(c)) - eflx_urban_heat_col(c) = 0._r8 - else if (heat_on(l)) then - eflx_urban_ac_col(c) = 0._r8 - eflx_urban_heat_col(c) = abs(eflx_building_heat_errsoi(c)) - else - eflx_urban_ac_col(c) = 0._r8 - eflx_urban_heat_col(c) = 0._r8 - end if - end if - end if - end do - - ! compute phase change of h2osfc - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - xmf_h2osfc(c) = 0. - end do - - call PhaseChangeH2osfc (bounds, num_nolakec, filter_nolakec, & - dhsdT(bounds%begc:bounds%endc), & - waterstate_inst, waterflux_inst, temperature_inst,energyflux_inst) - - call Phasechange_beta (bounds, num_nolakec, filter_nolakec, & - dhsdT(bounds%begc:bounds%endc), & - soilstate_inst, waterstate_inst, waterflux_inst, energyflux_inst, temperature_inst) - - if ( IsProgBuildTemp() )then - call BuildingTemperature(bounds, num_urbanl, filter_urbanl, num_nolakec, filter_nolakec, & - tk(bounds%begc:bounds%endc, :), urbanparams_inst, & - temperature_inst, energyflux_inst, urbantv_inst) - end if - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - ! this expression will (should) work whether there is snow or not - if (snl(c) < 0) then - if(frac_h2osfc(c) /= 0._r8) then - t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & - + (1.0_r8 - frac_sno_eff(c) - frac_h2osfc(c)) * t_soisno(c,1) & - + frac_h2osfc(c) * t_h2osfc(c) - else - t_grnd(c) = frac_sno_eff(c) * t_soisno(c,snl(c)+1) & - + (1.0_r8 - frac_sno_eff(c)) * t_soisno(c,1) - end if - - else - if(frac_h2osfc(c) /= 0._r8) then - t_grnd(c) = (1 - frac_h2osfc(c)) * t_soisno(c,1) + frac_h2osfc(c) * t_h2osfc(c) - else - t_grnd(c) = t_soisno(c,1) - end if - endif - end do - - ! Initialize soil heat content - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - eflx_fgr12(c)= 0._r8 - end do - - ! Calculate soil heat content and soil plus snow heat content - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - - if (j == 1) then ! this only needs to be done once - eflx_fgr12(c) = -cnfac*fn(c,1) - (1._r8-cnfac)*fn1(c,1) - end if - if (j > 0 .and. j < nlevgrnd .and. (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop)) then - eflx_fgr(c,j) = -cnfac*fn(c,j) - (1._r8-cnfac)*fn1(c,j) - else if (j == nlevgrnd .and. (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop)) then - eflx_fgr(c,j) = 0._r8 - end if - - end do - end do - - end associate - - end subroutine SoilTemperature - - !----------------------------------------------------------------------- - subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, & - tk, cv, tk_h2osfc, & - urbanparams_inst, temperature_inst, waterstate_inst, soilstate_inst) - - ! - ! !DESCRIPTION: - ! Calculation of thermal conductivities and heat capacities of - ! snow/soil layers - ! (1) The volumetric heat capacity is calculated as a linear combination - ! in terms of the volumetric fraction of the constituent phases. - ! - ! (2) The thermal conductivity of soil is computed from the algorithm of - ! Johansen (as reported by Farouki 1981), and of snow is from the - ! formulation used in SNTHERM (Jordan 1991). - ! The thermal conductivities at the interfaces between two neighboring - ! layers (j, j+1) are derived from an assumption that the flux across - ! the interface is equal to that from the node j to the interface and the - ! flux from the interface to the node j+1. - ! - ! !USES: - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevsoi - use clm_varcon , only : denh2o, denice, tfrz, tkwat, tkice, tkair, cpice, cpliq, thk_bedrock, csol_bedrock - use landunit_varcon , only : istice_mec, istwet - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(out) :: cv( bounds%begc: , -nlevsno+1: ) ! heat capacity [J/(m2 K) ] [col, lev] - real(r8) , intent(out) :: tk( bounds%begc: , -nlevsno+1: ) ! thermal conductivity at the layer interface [W/(m K) ] [col, lev] - real(r8) , intent(out) :: tk_h2osfc( bounds%begc: ) ! thermal conductivity of h2osfc [W/(m K) ] [col] - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - ! - ! !LOCAL VARIABLES: - integer :: l,c,j ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dksat ! thermal conductivity for saturated soil (j/(k s m)) - real(r8) :: dke ! kersten number - real(r8) :: fl ! volume fraction of liquid or unfrozen water to total water - real(r8) :: satw ! relative total water content of soil. - real(r8) :: zh2osfc - !----------------------------------------------------------------------- - - call t_startf( 'SoilThermProp' ) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(cv) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - nbedrock => col%nbedrock , & ! Input: [real(r8) (:,:) ] depth to bedrock (m) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - nlev_improad => urbanparams_inst%nlev_improad , & ! Input: [integer (:) ] number of impervious road layers - tk_wall => urbanparams_inst%tk_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall - tk_roof => urbanparams_inst%tk_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof - tk_improad => urbanparams_inst%tk_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road - cv_wall => urbanparams_inst%cv_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall - cv_roof => urbanparams_inst%cv_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof - cv_improad => urbanparams_inst%cv_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fractional snow covered area - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface (mm H2O) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - bw => waterstate_inst%bw_col , & ! Output: [real(r8) (:,:) ] partial density of water in the snow pack (ice + liquid) [kg/m3] - - tkmg => soilstate_inst%tkmg_col , & ! Input: [real(r8) (:,:) ] thermal conductivity, soil minerals [W/m-K] - tkdry => soilstate_inst%tkdry_col , & ! Input: [real(r8) (:,:) ] thermal conductivity, dry soil (W/m/Kelvin) - csol => soilstate_inst%csol_col , & ! Input: [real(r8) (:,:) ] heat capacity, soil solids (J/m**3/Kelvin) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - tksatu => soilstate_inst%tksatu_col , & ! Input: [real(r8) (:,:) ] thermal conductivity, saturated soil [W/m-K] - thk => soilstate_inst%thk_col & ! Output: [real(r8) (:,:) ] thermal conductivity of each layer [W/m-K] - ) - - ! Thermal conductivity of soil from Farouki (1981) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. - - do j = -nlevsno+1,nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - - ! Only examine levels from 1->nlevgrnd - if (j >= 1) then - l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .OR. col%itype(c) == icol_shadewall) .and. j <= nlevurb) then - thk(c,j) = tk_wall(l,j) - else if (col%itype(c) == icol_roof .and. j <= nlevurb) then - thk(c,j) = tk_roof(l,j) - else if (col%itype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - thk(c,j) = tk_improad(l,j) - else if (lun%itype(l) /= istwet .AND. lun%itype(l) /= istice_mec & - .AND. col%itype(c) /= icol_sunwall .AND. col%itype(c) /= icol_shadewall .AND. & - col%itype(c) /= icol_roof) then - - satw = (h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice)/(dz(c,j)*watsat(c,j)) - satw = min(1._r8, satw) - if (satw > .1e-6_r8) then - if (t_soisno(c,j) >= tfrz) then ! Unfrozen soil - dke = max(0._r8, log10(satw) + 1.0_r8) - else ! Frozen soil - dke = satw - end if - fl = (h2osoi_liq(c,j)/(denh2o*dz(c,j))) / (h2osoi_liq(c,j)/(denh2o*dz(c,j)) + & - h2osoi_ice(c,j)/(denice*dz(c,j))) - dksat = tkmg(c,j)*tkwat**(fl*watsat(c,j))*tkice**((1._r8-fl)*watsat(c,j)) - thk(c,j) = dke*dksat + (1._r8-dke)*tkdry(c,j) - else - thk(c,j) = tkdry(c,j) - endif - if (j > nbedrock(c)) thk(c,j) = thk_bedrock - else if (lun%itype(l) == istice_mec) then - thk(c,j) = tkwat - if (t_soisno(c,j) < tfrz) thk(c,j) = tkice - else if (lun%itype(l) == istwet) then - if (j > nlevsoi) then - thk(c,j) = thk_bedrock - else - thk(c,j) = tkwat - if (t_soisno(c,j) < tfrz) thk(c,j) = tkice - endif - endif - endif - - ! Thermal conductivity of snow, which from Jordan (1991) pp. 18 - ! Only examine levels from snl(c)+1 -> 0 where snl(c) < 1 - if (snl(c)+1 < 1 .AND. (j >= snl(c)+1) .AND. (j <= 0)) then - bw(c,j) = (h2osoi_ice(c,j)+h2osoi_liq(c,j))/(frac_sno(c)*dz(c,j)) - thk(c,j) = tkair + (7.75e-5_r8 *bw(c,j) + 1.105e-6_r8*bw(c,j)*bw(c,j))*(tkice-tkair) - end if - - end do - end do - - ! Thermal conductivity at the layer interface - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) .and. j <= nlevurb) then - if (j >= snl(c)+1 .AND. j <= nlevurb-1) then - tk(c,j) = thk(c,j)*thk(c,j+1)*(z(c,j+1)-z(c,j)) & - /(thk(c,j)*(z(c,j+1)-zi(c,j))+thk(c,j+1)*(zi(c,j)-z(c,j))) - else if (j == nlevurb) then - - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - tk(c,j) = thk(c,j) - end if - else if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) then - if (j >= snl(c)+1 .AND. j <= nlevgrnd-1) then - tk(c,j) = thk(c,j)*thk(c,j+1)*(z(c,j+1)-z(c,j)) & - /(thk(c,j)*(z(c,j+1)-zi(c,j))+thk(c,j+1)*(zi(c,j)-z(c,j))) - else if (j == nlevgrnd) then - tk(c,j) = 0._r8 - end if - end if - end do - end do - - ! calculate thermal conductivity of h2osfc - do fc = 1, num_nolakec - c = filter_nolakec(fc) - zh2osfc=1.0e-3*(0.5*h2osfc(c)) !convert to [m] from [mm] - tk_h2osfc(c)= tkwat*thk(c,1)*(z(c,1)+zh2osfc) & - /(tkwat*z(c,1)+thk(c,1)*zh2osfc) - enddo - - ! Soil heat capacity, from de Vires (1963) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. - - do j = 1, nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .OR. col%itype(c) == icol_shadewall) .and. j <= nlevurb) then - cv(c,j) = cv_wall(l,j) * dz(c,j) - else if (col%itype(c) == icol_roof .and. j <= nlevurb) then - cv(c,j) = cv_roof(l,j) * dz(c,j) - else if (col%itype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - cv(c,j) = cv_improad(l,j) * dz(c,j) - else if (lun%itype(l) /= istwet .AND. lun%itype(l) /= istice_mec & - .AND. col%itype(c) /= icol_sunwall .AND. col%itype(c) /= icol_shadewall .AND. & - col%itype(c) /= icol_roof) then - cv(c,j) = csol(c,j)*(1-watsat(c,j))*dz(c,j) + (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - if (j > nbedrock(c)) cv(c,j) = csol_bedrock*dz(c,j) - else if (lun%itype(l) == istwet) then - cv(c,j) = (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - if (j > nbedrock(c)) cv(c,j) = csol_bedrock*dz(c,j) - else if (lun%itype(l) == istice_mec) then - cv(c,j) = (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - endif - if (j == 1) then - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8) then - cv(c,j) = cv(c,j) + cpice*h2osno(c) - end if - end if - enddo - end do - - ! Snow heat capacity - - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (snl(c)+1 < 1 .and. j >= snl(c)+1) then - if (frac_sno(c) > 0._r8) then - cv(c,j) = max(thin_sfclayer,(cpliq*h2osoi_liq(c,j) + cpice*h2osoi_ice(c,j))/frac_sno(c)) - else - cv(c,j) = thin_sfclayer - endif - end if - end do - end do - call t_stopf( 'SoilThermProp' ) - - end associate - - end subroutine SoilThermProp - - !----------------------------------------------------------------------- - subroutine PhaseChangeH2osfc (bounds, num_nolakec, filter_nolakec, & - dhsdT, waterstate_inst, waterflux_inst, temperature_inst,energyflux_inst) - ! - ! !DESCRIPTION: - ! Only freezing is considered. When water freezes, move ice to bottom snow layer. - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varcon , only : tfrz, hfus, grav, denice, cnfac, cpice, cpliq - use clm_varpar , only : nlevsno, nlevgrnd - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(in) :: dhsdT ( bounds%begc: ) ! temperature derivative of "hs" [col ] - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,g !do loop index - integer :: fc !lake filtered column indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: temp1 !temporary variables [kg/m2 ] - real(r8) :: hm(bounds%begc:bounds%endc) !energy residual [W/m2 ] - real(r8) :: xm(bounds%begc:bounds%endc) !melting or freezing within a time step [kg/m2 ] - real(r8) :: tinc !t(n+1)-t(n) (K) - real(r8) :: smp !frozen water potential (mm) - real(r8) :: rho_avg !average density - real(r8) :: z_avg !average of snow depth - real(r8) :: c1 !weight to use for lowest snow layer - real(r8) :: c2 !weight to use for surface water layer - !----------------------------------------------------------------------- - - call t_startf( 'PhaseChangeH2osfc' ) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - eflx_h2osfc_to_snow_col => energyflux_inst%eflx_h2osfc_to_snow_col , & ! Output: [real(r8) (:) ] col snow melt to h2osfc heat flux (W/m**2) - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) (new) - h2osfc => waterstate_inst%h2osfc_col , & ! Output: [real(r8) (:) ] surface water (mm) - int_snow => waterstate_inst%int_snow_col , & ! Output: [real(r8) (:) ] integrated snowfall [mm] - snow_depth => waterstate_inst%snow_depth_col , & ! Output: [real(r8) (:) ] snow height (m) - - qflx_h2osfc_to_ice => waterflux_inst%qflx_h2osfc_to_ice_col , & ! Output: [real(r8) (:) ] conversion of h2osfc to ice - - fact => temperature_inst%fact_col , & - c_h2osfc => temperature_inst%c_h2osfc_col , & - xmf_h2osfc => temperature_inst%xmf_h2osfc_col, & - t_soisno => temperature_inst%t_soisno_col , & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - t_h2osfc => temperature_inst%t_h2osfc_col & ! Output: [real(r8) (:) ] surface water temperature - ) - - ! Get step size - - dtime = get_step_size() - - ! Initialization - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - xmf_h2osfc(c) = 0._r8 - hm(c) = 0._r8 - xm(c) = 0._r8 - qflx_h2osfc_to_ice(c) = 0._r8 - eflx_h2osfc_to_snow_col(c) = 0._r8 - end do - - ! Freezing identification - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! If liquid exists below melt point, freeze some to ice. - if ( frac_h2osfc(c) > 0._r8 .AND. t_h2osfc(c) <= tfrz) then - tinc = tfrz - t_h2osfc(c) - t_h2osfc(c) = tfrz - - ! energy absorbed beyond freezing temperature - hm(c) = frac_h2osfc(c)*(dhsdT(c)*tinc - tinc*c_h2osfc(c)/dtime) - - ! mass of water converted from liquid to ice - xm(c) = hm(c)*dtime/hfus - temp1 = h2osfc(c) + xm(c) - - z_avg=frac_sno(c)*snow_depth(c) - if (z_avg > 0._r8) then - rho_avg=min(800._r8,h2osno(c)/z_avg) - else - rho_avg=200._r8 - endif - - !===================== xm < h2osfc ==================================== - if(temp1 >= 0._r8) then ! add some frozen water to snow column - - ! add ice to snow column - h2osno(c) = h2osno(c) - xm(c) - int_snow(c) = int_snow(c) - xm(c) - if(snl(c) < 0) h2osoi_ice(c,0) = h2osoi_ice(c,0) - xm(c) - - - ! remove ice from h2osfc - h2osfc(c) = h2osfc(c) + xm(c) - - xmf_h2osfc(c) = hm(c) - qflx_h2osfc_to_ice(c) = -xm(c)/dtime - - - ! update snow depth - if (frac_sno(c) > 0 .and. snl(c) < 0) then - snow_depth(c)=h2osno(c)/(rho_avg*frac_sno(c)) - else - snow_depth(c)=h2osno(c)/denice - endif - - ! adjust temperature of lowest snow layer to account for addition of ice - if (snl(c) == 0) then - !initialize for next time step - t_soisno(c,0) = t_h2osfc(c) - eflx_h2osfc_to_snow_col(c) = 0. - else - if (snl(c) == -1)then - c1=frac_sno(c)*(dtime/fact(c,0) - dhsdT(c)*dtime) - else - c1=frac_sno(c)/fact(c,0)*dtime - end if - if ( frac_h2osfc(c) /= 0.0_r8 )then - c2=(-cpliq*xm(c) - frac_h2osfc(c)*dhsdT(c)*dtime) - else - c2=0.0_r8 - end if - t_soisno(c,0) = (c1*t_soisno(c,0)+ c2*t_h2osfc(c)) & - /(c1 + c2) - eflx_h2osfc_to_snow_col(c) =(t_h2osfc(c)-t_soisno(c,0))*c2/dtime - - endif - - !========================= xm > h2osfc ============================= - else !all h2osfc converted to ice - - rho_avg=(h2osno(c)*rho_avg + h2osfc(c)*denice)/(h2osno(c) + h2osfc(c)) - h2osno(c) = h2osno(c) + h2osfc(c) - int_snow(c) = int_snow(c) + h2osfc(c) - - qflx_h2osfc_to_ice(c) = h2osfc(c)/dtime - - ! excess energy is used to cool ice layer - if(snl(c) < 0) h2osoi_ice(c,0) = h2osoi_ice(c,0) + h2osfc(c) - - ! NOTE: should compute and then use the heat capacity of frozen h2osfc layer - ! rather than using heat capacity of the liquid layer. But this causes - ! balance check errors as it doesn't know about it. - - ! cool frozen h2osfc layer with extra heat - t_h2osfc(c) = t_h2osfc(c) - temp1*hfus/(dtime*dhsdT(c) - c_h2osfc(c)) - - xmf_h2osfc(c) = (hm(c) - frac_h2osfc(c)*temp1*hfus/dtime) - - ! next, determine equilibrium temperature of combined ice/snow layer - if (snl(c) == 0) then - !initialize for next time step - t_soisno(c,0) = t_h2osfc(c) - else if (snl(c) == -1) then - c1=frac_sno(c)*(dtime/fact(c,0) - dhsdT(c)*dtime) - if ( frac_h2osfc(c) /= 0.0_r8 )then - c2=frac_h2osfc(c)*(c_h2osfc(c) - dtime*dhsdT(c)) - - else - c2=0.0_r8 - end if - t_soisno(c,0) = (c1*t_soisno(c,0)+ c2*t_h2osfc(c)) & - /(c1 + c2) - t_h2osfc(c) = t_soisno(c,0) - - else - c1=frac_sno(c)/fact(c,0)*dtime - if ( frac_h2osfc(c) /= 0.0_r8 )then - c2=frac_h2osfc(c)*(c_h2osfc(c) - dtime*dhsdT(c)) - else - c2=0.0_r8 - end if - t_soisno(c,0) = (c1*t_soisno(c,0)+ c2*t_h2osfc(c)) & - /(c1 + c2) - t_h2osfc(c) = t_soisno(c,0) - endif - - ! set h2osfc to zero (all liquid converted to ice) - h2osfc(c) = 0._r8 - - ! update snow depth - if (frac_sno(c) > 0 .and. snl(c) < 0) then - snow_depth(c)=h2osno(c)/(rho_avg*frac_sno(c)) - else - snow_depth(c)=h2osno(c)/denice - endif - - endif - endif - enddo - call t_stopf( 'PhaseChangeH2osfc' ) - - end associate - - end subroutine PhaseChangeH2osfc - - !----------------------------------------------------------------------- - subroutine Phasechange_beta (bounds, num_nolakec, filter_nolakec, dhsdT, & - soilstate_inst, waterstate_inst, waterflux_inst, energyflux_inst, temperature_inst) - ! - ! !DESCRIPTION: - ! Calculation of the phase change within snow and soil layers: - ! (1) Check the conditions for which the phase change may take place, - ! i.e., the layer temperature is great than the freezing point - ! and the ice mass is not equal to zero (i.e. melting), - ! or the layer temperature is less than the freezing point - ! and the liquid water mass is greater than the allowable supercooled - ! liquid water calculated from freezing point depression (i.e. freezing). - ! (2) Assess the rate of phase change from the energy excess (or deficit) - ! after setting the layer temperature to freezing point. - ! (3) Re-adjust the ice and liquid mass, and the layer temperature - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsno, nlevgrnd,nlevurb - use clm_varctl , only : iulog - use clm_varcon , only : tfrz, hfus, grav - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv - use landunit_varcon , only : istsoil, istcrop, istice_mec - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(in) :: dhsdT ( bounds%begc: ) ! temperature derivative of "hs" [col] - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,g,l !do loop index - integer :: fc !lake filtered column indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: heatr !energy residual or loss after melting or freezing - real(r8) :: temp1 !temporary variables [kg/m2] - real(r8) :: hm(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !energy residual [W/m2] - real(r8) :: xm(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !melting or freezing within a time step [kg/m2] - real(r8) :: wmass0(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of ice and liquid (kg/m2) - real(r8) :: wice0 (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of ice (kg/m2) - real(r8) :: wliq0 (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd)!initial mass of liquid (kg/m2) - real(r8) :: supercool(bounds%begc:bounds%endc,nlevgrnd) !supercooled water in soil (kg/m2) - real(r8) :: propor !proportionality constant (-) - real(r8) :: tinc(bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) !t(n+1)-t(n) (K) - real(r8) :: smp !frozen water potential (mm) - !----------------------------------------------------------------------- - - call t_startf( 'PhaseChangebeta' ) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - h2osno => waterstate_inst%h2osno_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) (new) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] ice lens (kg/m2) (new) - - qflx_snow_drain => waterflux_inst%qflx_snow_drain_col , & ! Output: [real(r8) (:) ] drainage from snow pack - qflx_snofrz_lyr => waterflux_inst%qflx_snofrz_lyr_col , & ! Output: [real(r8) (:,:) ] snow freezing rate (positive definite) (col,lyr) [kg m-2 s-1] - qflx_snofrz => waterflux_inst%qflx_snofrz_col , & ! Output: [real(r8) (:) ] column-integrated snow freezing rate (positive definite) [kg m-2 s-1] - qflx_snomelt => waterflux_inst%qflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt (mm H2O /s) - qflx_snomelt_lyr => waterflux_inst%qflx_snomelt_lyr_col , & ! Output: [real(r8) (:) ] snow melt in each layer (mm H2O /s) - - eflx_snomelt => energyflux_inst%eflx_snomelt_col , & ! Output: [real(r8) (:) ] snow melt heat flux (W/m**2) - eflx_snomelt_r => energyflux_inst%eflx_snomelt_r_col , & ! Output: [real(r8) (:) ] rural snow melt heat flux (W/m**2) - eflx_snomelt_u => energyflux_inst%eflx_snomelt_u_col , & ! Output: [real(r8) (:) ] urban snow melt heat flux (W/m**2) - - xmf => temperature_inst%xmf_col , & - fact => temperature_inst%fact_col , & - - imelt => temperature_inst%imelt_col , & ! Output: [integer (:,:) ] flag for melting (=1), freezing (=2), Not=0 (new) - t_soisno => temperature_inst%t_soisno_col & ! Output: [real(r8) (:,:) ] soil temperature (Kelvin) - ) - - ! Get step size - - dtime = get_step_size() - - ! Initialization - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - - xmf(c) = 0._r8 - qflx_snomelt(c) = 0._r8 - qflx_snofrz(c) = 0._r8 - qflx_snow_drain(c) = 0._r8 - end do - - do j = -nlevsno+1,nlevgrnd ! all layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (j >= snl(c)+1) then - - ! Initialization - imelt(c,j) = 0 - hm(c,j) = 0._r8 - xm(c,j) = 0._r8 - wice0(c,j) = h2osoi_ice(c,j) - wliq0(c,j) = h2osoi_liq(c,j) - wmass0(c,j) = h2osoi_ice(c,j) + h2osoi_liq(c,j) - endif ! end of snow layer if-block - - if (j <= 0) then - ! Do for all possible snow layers in case snl changes over timestep. - qflx_snomelt_lyr(c,j) = 0._r8 - qflx_snofrz_lyr(c,j) = 0._r8 - end if - end do ! end of column-loop - enddo ! end of level-loop - - !-- snow layers --------------------------------------------------- - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (j >= snl(c)+1) then - - ! Melting identification - ! If ice exists above melt point, melt some to liquid. - if (h2osoi_ice(c,j) > 0._r8 .AND. t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) - t_soisno(c,j) = tfrz - endif - - ! Freezing identification - ! If liquid exists below melt point, freeze some to ice. - if (h2osoi_liq(c,j) > 0._r8 .AND. t_soisno(c,j) < tfrz) then - imelt(c,j) = 2 - ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) - t_soisno(c,j) = tfrz - endif - endif ! end of snow layer if-block - end do ! end of column-loop - enddo ! end of level-loop - - !-- soil layers --------------------------------------------------- - do j = 1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - supercool(c,j) = 0.0_r8 - ! add in urban condition if-block - if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then - - - - if (h2osoi_ice(c,j) > 0. .AND. t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) - t_soisno(c,j) = tfrz - endif - - ! from Zhao (1997) and Koren (1999) - supercool(c,j) = 0.0_r8 - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop .or. col%itype(c) == icol_road_perv) then - if(t_soisno(c,j) < tfrz) then - smp = hfus*(tfrz-t_soisno(c,j))/(grav*t_soisno(c,j)) * 1000._r8 !(mm) - supercool(c,j) = watsat(c,j)*(smp/sucsat(c,j))**(-1._r8/bsw(c,j)) - supercool(c,j) = supercool(c,j)*dz(c,j)*1000._r8 ! (mm) - endif - endif - - if (h2osoi_liq(c,j) > supercool(c,j) .AND. t_soisno(c,j) < tfrz) then - imelt(c,j) = 2 - ! tinc(c,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) - t_soisno(c,j) = tfrz - endif - - ! If snow exists, but its thickness is less than the critical value (0.01 m) - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8 .AND. j == 1) then - if (t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - ! tincc,j) = t_soisno(c,j) - tfrz - tinc(c,j) = tfrz - t_soisno(c,j) - t_soisno(c,j) = tfrz - endif - endif - - endif - - end do - enddo - - - do j = -nlevsno+1,nlevgrnd ! all layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - if ((col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) .or. ( j <= nlevurb)) then - - if (j >= snl(c)+1) then - - ! Calculate the energy surplus and loss for melting and freezing - if (imelt(c,j) > 0) then - - ! added unique cases for this calculation, - ! to account for absorbed solar radiation in each layer - - !================================================================== - if (j == snl(c)+1) then ! top layer - if(j > 0) then - hm(c,j) = dhsdT(c)*tinc(c,j) - tinc(c,j)/fact(c,j) - else - hm(c,j) = frac_sno_eff(c)*(dhsdT(c)*tinc(c,j) - tinc(c,j)/fact(c,j)) - endif - - if ( j==1 .and. frac_h2osfc(c) /= 0.0_r8 ) then - hm(c,j) = hm(c,j) - frac_h2osfc(c)*(dhsdT(c)*tinc(c,j)) - end if - else if (j == 1) then - hm(c,j) = (1.0_r8 - frac_sno_eff(c) - frac_h2osfc(c)) & - *dhsdT(c)*tinc(c,j) - tinc(c,j)/fact(c,j) - else ! non-interfacial snow/soil layers - if(j < 1) then - hm(c,j) = - frac_sno_eff(c)*(tinc(c,j)/fact(c,j)) - else - hm(c,j) = - tinc(c,j)/fact(c,j) - endif - endif - endif - - ! These two errors were checked carefully (Y. Dai). They result from the - ! computed error of "Tridiagonal-Matrix" in subroutine "thermal". - if (imelt(c,j) == 1 .AND. hm(c,j) < 0._r8) then - hm(c,j) = 0._r8 - imelt(c,j) = 0 - endif - if (imelt(c,j) == 2 .AND. hm(c,j) > 0._r8) then - hm(c,j) = 0._r8 - imelt(c,j) = 0 - endif - - ! The rate of melting and freezing - - if (imelt(c,j) > 0 .and. abs(hm(c,j)) > 0._r8) then - xm(c,j) = hm(c,j)*dtime/hfus ! kg/m2 - - ! If snow exists, but its thickness is less than the critical value - ! (1 cm). Note: more work is needed to determine how to tune the - ! snow depth for this case - if (j == 1) then - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8 .AND. xm(c,j) > 0._r8) then - temp1 = h2osno(c) ! kg/m2 - h2osno(c) = max(0._r8,temp1-xm(c,j)) - propor = h2osno(c)/temp1 - snow_depth(c) = propor * snow_depth(c) - heatr = hm(c,j) - hfus*(temp1-h2osno(c))/dtime ! W/m2 - if (heatr > 0._r8) then - xm(c,j) = heatr*dtime/hfus ! kg/m2 - hm(c,j) = heatr ! W/m2 - else - xm(c,j) = 0._r8 - hm(c,j) = 0._r8 - endif - qflx_snomelt(c) = max(0._r8,(temp1-h2osno(c)))/dtime ! kg/(m2 s) - ! no snow layers, so qflx_snomelt_lyr is not set - xmf(c) = hfus*qflx_snomelt(c) - qflx_snow_drain(c) = qflx_snomelt(c) - endif - endif - - heatr = 0._r8 - if (xm(c,j) > 0._r8) then - h2osoi_ice(c,j) = max(0._r8, wice0(c,j)-xm(c,j)) - heatr = hm(c,j) - hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - else if (xm(c,j) < 0._r8) then - if (j <= 0) then - h2osoi_ice(c,j) = min(wmass0(c,j), wice0(c,j)-xm(c,j)) ! snow - else - if (wmass0(c,j) < supercool(c,j)) then - h2osoi_ice(c,j) = 0._r8 - else - h2osoi_ice(c,j) = min(wmass0(c,j) - supercool(c,j),wice0(c,j)-xm(c,j)) - endif - endif - heatr = hm(c,j) - hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - endif - - h2osoi_liq(c,j) = max(0._r8,wmass0(c,j)-h2osoi_ice(c,j)) - - if (abs(heatr) > 0._r8) then - if (j == snl(c)+1) then - - if(j==1) then - t_soisno(c,j) = t_soisno(c,j) + fact(c,j)*heatr & - /(1._r8-(1.0_r8 - frac_h2osfc(c))*fact(c,j)*dhsdT(c)) - else - t_soisno(c,j) = t_soisno(c,j) + (fact(c,j)/frac_sno_eff(c))*heatr & - /(1._r8-fact(c,j)*dhsdT(c)) - - endif - - else if (j == 1) then - - t_soisno(c,j) = t_soisno(c,j) + fact(c,j)*heatr & - /(1._r8-(1.0_r8 - frac_sno_eff(c) - frac_h2osfc(c))*fact(c,j)*dhsdT(c)) - else - if(j > 0) then - t_soisno(c,j) = t_soisno(c,j) + fact(c,j)*heatr - else - if(frac_sno_eff(c) > 0._r8) t_soisno(c,j) = t_soisno(c,j) + (fact(c,j)/frac_sno_eff(c))*heatr - endif - endif - - if (j <= 0) then ! snow - if (h2osoi_liq(c,j)*h2osoi_ice(c,j)>0._r8) t_soisno(c,j) = tfrz - end if - endif ! end of heatr > 0 if-block - - if (j >= 1) then - xmf(c) = xmf(c) + hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - else - xmf(c) = xmf(c) + hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - endif - - if (imelt(c,j) == 1 .AND. j < 1) then - qflx_snomelt_lyr(c,j) = max(0._r8,(wice0(c,j)-h2osoi_ice(c,j)))/dtime - qflx_snomelt(c) = qflx_snomelt(c) + qflx_snomelt_lyr(c,j) - endif - - ! layer freezing mass flux (positive): - if (imelt(c,j) == 2 .AND. j < 1) then - qflx_snofrz_lyr(c,j) = max(0._r8,(h2osoi_ice(c,j)-wice0(c,j)))/dtime - qflx_snofrz(c) = qflx_snofrz(c) + qflx_snofrz_lyr(c,j) - endif - - endif - - endif ! end of snow layer if-block - - endif - - end do ! end of column-loop - enddo ! end of level-loop - - ! Needed for history file output - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - eflx_snomelt(c) = qflx_snomelt(c) * hfus - l = col%landunit(c) - if (lun%urbpoi(l)) then - eflx_snomelt_u(c) = eflx_snomelt(c) - else if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - eflx_snomelt_r(c) = eflx_snomelt(c) - end if - end do - - call t_stopf( 'PhaseChangebeta' ) - end associate - - end subroutine Phasechange_beta - - !----------------------------------------------------------------------- - subroutine ComputeGroundHeatFluxAndDeriv(bounds, num_nolakec, filter_nolakec, & - hs_h2osfc, hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, & - atm2lnd_inst, urbanparams_inst, canopystate_inst, waterstate_inst, & - waterflux_inst, solarabs_inst, energyflux_inst, temperature_inst) - ! - ! !DESCRIPTION: - ! Computes ground heat flux on: - ! (1) The surface of standing water, - ! (2) The surface of snow, - ! (3) The surface of soil, and - ! (4) Net energy flux into soil surface. - ! Additionally, derivative of ground heat flux w.r.t to temeprature - ! - ! !USES: - use clm_varcon , only : sb, hvap - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, max_patch_per_col - use UrbanParamsType, only : IsSimpleBuildTemp - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec( : ) ! column filter for non-lake points - real(r8) , intent(out) :: hs_h2osfc( bounds%begc: ) ! heat flux on standing water [W/m2] - real(r8) , intent(out) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8) , intent(out) :: hs_soil( bounds%begc: ) ! heat flux on soil [W/m2] - real(r8) , intent(out) :: hs_top (bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8) , intent(out) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8) , intent(out) :: sabg_lyr_col( bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(temperature_type) , intent(in) :: temperature_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,p,l,g,pi ! indices - integer :: fc ! lake filtered column indices - real(r8) :: hs(bounds%begc:bounds%endc) ! net energy flux into the surface (w/m2) - real(r8) :: lwrad_emit(bounds%begc:bounds%endc) ! emitted longwave radiation - real(r8) :: dlwrad_emit(bounds%begc:bounds%endc) ! time derivative of emitted longwave radiation - integer :: lyr_top ! index of top layer of snowpack (-4 to 0) [idx] - real(r8) :: eflx_gnet_top ! net energy flux into surface layer, patch-level [W/m2] - real(r8) :: lwrad_emit_snow(bounds%begc:bounds%endc) ! - real(r8) :: lwrad_emit_soil(bounds%begc:bounds%endc) ! - real(r8) :: lwrad_emit_h2osfc(bounds%begc:bounds%endc) ! - real(r8) :: eflx_gnet_snow ! - real(r8) :: eflx_gnet_soil ! - real(r8) :: eflx_gnet_h2osfc ! - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc,1/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - forc_lwrad => atm2lnd_inst%forc_lwrad_downscaled_col , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - - qflx_ev_snow => waterflux_inst%qflx_ev_snow_patch , & ! Input: [real(r8) (:) ] evaporation flux from snow (mm H2O/s) [+ to atm] - qflx_ev_soil => waterflux_inst%qflx_ev_soil_patch , & ! Input: [real(r8) (:) ] evaporation flux from soil (mm H2O/s) [+ to atm] - qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_patch , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (mm H2O/s) [+ to atm] - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Input: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - - emg => temperature_inst%emg_col , & ! Input: [real(r8) (:) ] ground emissivity - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground surface temperature [K] - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of vapor of water (or sublimation) [j/kg] - cgrnd => energyflux_inst%cgrnd_patch , & ! Input: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp [w/m2/k] - dlrad => energyflux_inst%dlrad_patch , & ! Input: [real(r8) (:) ] downward longwave radiation blow the canopy [W/m2] - eflx_traffic => energyflux_inst%eflx_traffic_lun , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_wasteheat => energyflux_inst%eflx_wasteheat_lun , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac => energyflux_inst%eflx_heat_from_ac_lun , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_sh_snow => energyflux_inst%eflx_sh_snow_patch , & ! Input: [real(r8) (:) ] sensible heat flux from snow (W/m**2) [+ to atm] - eflx_sh_soil => energyflux_inst%eflx_sh_soil_patch , & ! Input: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_h2osfc => energyflux_inst%eflx_sh_h2osfc_patch , & ! Input: [real(r8) (:) ] sensible heat flux from surface water (W/m**2) [+ to atm] - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Input: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Input: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_wasteheat_patch => energyflux_inst%eflx_wasteheat_patch , & ! Input: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac_patch => energyflux_inst%eflx_heat_from_ac_patch , & ! Input: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_traffic_patch => energyflux_inst%eflx_traffic_patch , & ! Input: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_anthro => energyflux_inst%eflx_anthro_patch , & ! Input: [real(r8) (:) ] total anthropogenic heat flux (W/m**2) - eflx_gnet => energyflux_inst%eflx_gnet_patch , & ! Output: [real(r8) (:) ] net ground heat flux into the surface (W/m**2) - dgnetdT => energyflux_inst%dgnetdT_patch , & ! Output: [real(r8) (:) ] temperature derivative of ground net heat flux - - sabg => solarabs_inst%sabg_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - sabg_soil => solarabs_inst%sabg_soil_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by soil (W/m**2) - sabg_snow => solarabs_inst%sabg_snow_patch , & ! Input: [real(r8) (:) ] solar radiation absorbed by snow (W/m**2) - sabg_chk => solarabs_inst%sabg_chk_patch , & ! Output: [real(r8) (:) ] sum of soil/snow using current fsno, for balance check - sabg_lyr => solarabs_inst%sabg_lyr_patch , & ! Output: [real(r8) (:,:) ] absorbed solar radiation (pft,lyr) [W/m2] - - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Net ground heat flux into the surface and its temperature derivative - ! Added a pfts loop here to get the average of hs and dhsdT over - ! all PFTs on the column. Precalculate the terms that do not depend on PFT. - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - lwrad_emit(c) = emg(c) * sb * t_grnd(c)**4 - dlwrad_emit(c) = 4._r8*emg(c) * sb * t_grnd(c)**3 - - ! fractionate lwrad_emit; balanced in CanopyFluxes & Biogeophysics2 - lwrad_emit_snow(c) = emg(c) * sb * t_soisno(c,snl(c)+1)**4 - lwrad_emit_soil(c) = emg(c) * sb * t_soisno(c,1)**4 - lwrad_emit_h2osfc(c) = emg(c) * sb * t_h2osfc(c)**4 - end do - - hs_soil(begc:endc) = 0._r8 - hs_h2osfc(begc:endc) = 0._r8 - hs(begc:endc) = 0._r8 - dhsdT(begc:endc) = 0._r8 - do pi = 1,max_patch_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ( pi <= col%npatches(c) ) then - p = col%patchi(c) + pi - 1 - l = patch%landunit(p) - g = patch%gridcell(p) - - if (patch%active(p)) then - if (.not. lun%urbpoi(l)) then - eflx_gnet(p) = sabg(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) - lwrad_emit(c) & - - (eflx_sh_grnd(p)+qflx_evap_soi(p)*htvp(c)) - ! save sabg for balancecheck, in case frac_sno is set to zero later - sabg_chk(p) = frac_sno_eff(c) * sabg_snow(p) + (1._r8 - frac_sno_eff(c) ) * sabg_soil(p) - - eflx_gnet_snow = sabg_snow(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) - lwrad_emit_snow(c) & - - (eflx_sh_snow(p)+qflx_ev_snow(p)*htvp(c)) - - eflx_gnet_soil = sabg_soil(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) - lwrad_emit_soil(c) & - - (eflx_sh_soil(p)+qflx_ev_soil(p)*htvp(c)) - - eflx_gnet_h2osfc = sabg_soil(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) - lwrad_emit_h2osfc(c) & - - (eflx_sh_h2osfc(p)+qflx_ev_h2osfc(p)*htvp(c)) - else - ! For urban columns we use the net longwave radiation (eflx_lwrad_net) because of - ! interactions between urban columns. - - ! All wasteheat and traffic flux goes into canyon floor - if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - eflx_wasteheat_patch(p) = eflx_wasteheat(l)/(1._r8-lun%wtlunit_roof(l)) - eflx_heat_from_ac_patch(p) = eflx_heat_from_ac(l)/(1._r8-lun%wtlunit_roof(l)) - eflx_traffic_patch(p) = eflx_traffic(l)/(1._r8-lun%wtlunit_roof(l)) - else - eflx_wasteheat_patch(p) = 0._r8 - eflx_heat_from_ac_patch(p) = 0._r8 - eflx_traffic_patch(p) = 0._r8 - end if - ! Include transpiration term because needed for previous road - ! and include wasteheat and traffic flux - eflx_gnet(p) = sabg(p) + dlrad(p) & - - eflx_lwrad_net(p) & - - (eflx_sh_grnd(p) + qflx_evap_soi(p)*htvp(c) + qflx_tran_veg(p)*hvap) & - + eflx_wasteheat_patch(p) + eflx_heat_from_ac_patch(p) + eflx_traffic_patch(p) - if ( IsSimpleBuildTemp() ) then - eflx_anthro(p) = eflx_wasteheat_patch(p) + eflx_traffic_patch(p) - end if - eflx_gnet_snow = eflx_gnet(p) - eflx_gnet_soil = eflx_gnet(p) - eflx_gnet_h2osfc = eflx_gnet(p) - end if - dgnetdT(p) = - cgrnd(p) - dlwrad_emit(c) - hs(c) = hs(c) + eflx_gnet(p) * patch%wtcol(p) - dhsdT(c) = dhsdT(c) + dgnetdT(p) * patch%wtcol(p) - ! separate surface fluxes for soil/snow - hs_soil(c) = hs_soil(c) + eflx_gnet_soil * patch%wtcol(p) - hs_h2osfc(c) = hs_h2osfc(c) + eflx_gnet_h2osfc * patch%wtcol(p) - - end if - end if - end do - end do - - ! Additional calculations with SNICAR: - ! Set up tridiagonal matrix in a new manner. There is now - ! absorbed solar radiation in each snow layer, instead of - ! only the surface. Following the current implementation, - ! absorbed solar flux should be: S + ((delS/delT)*dT), - ! where S is absorbed radiation, and T is temperature. Now, - ! assume delS/delT is zero, then it is OK to just add S - ! to each layer - - ! Initialize: - sabg_lyr_col(begc:endc,-nlevsno+1:1) = 0._r8 - hs_top(begc:endc) = 0._r8 - hs_top_snow(begc:endc) = 0._r8 - - do pi = 1,max_patch_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - lyr_top = snl(c) + 1 - if ( pi <= col%npatches(c) ) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - g = patch%gridcell(p) - l = patch%landunit(p) - if (.not. lun%urbpoi(l)) then - - eflx_gnet_top = sabg_lyr(p,lyr_top) + dlrad(p) + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) & - - lwrad_emit(c) - (eflx_sh_grnd(p)+qflx_evap_soi(p)*htvp(c)) - - hs_top(c) = hs_top(c) + eflx_gnet_top*patch%wtcol(p) - - eflx_gnet_snow = sabg_lyr(p,lyr_top) + dlrad(p) + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) & - - lwrad_emit_snow(c) - (eflx_sh_snow(p)+qflx_ev_snow(p)*htvp(c)) - - eflx_gnet_soil = sabg_lyr(p,lyr_top) + dlrad(p) + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(c) & - - lwrad_emit_soil(c) - (eflx_sh_soil(p)+qflx_ev_soil(p)*htvp(c)) - - hs_top_snow(c) = hs_top_snow(c) + eflx_gnet_snow*patch%wtcol(p) - - do j = lyr_top,1,1 - sabg_lyr_col(c,j) = sabg_lyr_col(c,j) + sabg_lyr(p,j) * patch%wtcol(p) - enddo - else - - hs_top(c) = hs_top(c) + eflx_gnet(p)*patch%wtcol(p) - hs_top_snow(c) = hs_top_snow(c) + eflx_gnet(p)*patch%wtcol(p) - sabg_lyr_col(c,lyr_top) = sabg_lyr_col(c,lyr_top) + sabg(p) * patch%wtcol(p) - - endif - endif - - endif - enddo - enddo - - end associate - - end subroutine ComputeGroundHeatFluxAndDeriv - - !----------------------------------------------------------------------- - subroutine ComputeHeatDiffFluxAndFactor(bounds, num_nolakec, filter_nolakec, dtime, & - tk, cv, fn, fact, & - energyflux_inst, temperature_inst) - ! - ! !DESCRIPTION: - ! Computes: - ! (1) Heat diffusion at the interface of layers. - ! (2) Factor used in computing tridiagonal matrix - ! - ! !USES: - use clm_varcon , only : capr, cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - use UrbanParamsType, only : IsSimpleBuildTemp - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(in) :: dtime ! land model time step (sec) - real(r8) , intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8) , intent(in) :: cv (bounds%begc: ,-nlevsno+1: ) ! heat capacity [J/(m2 K)] - real(r8) , intent(out) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8) , intent(out) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - type(energyflux_type) , intent(in) :: energyflux_inst - type(temperature_type) , intent(in) :: temperature_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cv) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate(& - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - ctype => col%itype , & ! Input: [integer (:) ] column type - t_building => temperature_inst%t_building_lun , & ! Input: [real(r8) (:) ] internal building temperature (K) - t_roof_inner => temperature_inst%t_roof_inner_lun , & ! Input: [real(r8) (:) ] roof inside surface temperature (K) - t_sunw_inner => temperature_inst%t_sunw_inner_lun , & ! Input: [real(r8) (:) ] sunwall inside surface temperature (K) - t_shdw_inner => temperature_inst%t_shdw_inner_lun , & ! Input: [real(r8) (:) ] shadewall inside surface temperature (K) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - eflx_bot => energyflux_inst%eflx_bot_col & ! Input: [real(r8) (:) ] heat flux from beneath column (W/m**2) [+ = upward] - ) - - ! Determine heat diffusion through the layer interface and factor used in computing - ! tridiagonal matrix and set up vector r and vectors a, b, c that define tridiagonal - ! matrix and solve system - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) .and. j <= nlevurb) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - fact(c,j) = dtime/cv(c,j) - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j <= nlevurb-1) then - fact(c,j) = dtime/cv(c,j) - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - dzm = (z(c,j)-z(c,j-1)) - else if (j == nlevurb) then - fact(c,j) = dtime/cv(c,j) - if ( IsSimpleBuildTemp() )then - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - fn(c,j) = tk(c,j) * (t_building(l) - cnfac*t_soisno(c,j))/(zi(c,j) - z(c,j)) - else - ! the bottom "soil" layer and the equations are derived assuming a prognostic inner - ! surface temperature. - if (ctype(c) == icol_sunwall) then - fn(c,j) = tk(c,j) * (t_sunw_inner(l) - cnfac*t_soisno(c,j))/(zi(c,j) - z(c,j)) - else if (ctype(c) == icol_shadewall) then - fn(c,j) = tk(c,j) * (t_shdw_inner(l) - cnfac*t_soisno(c,j))/(zi(c,j) - z(c,j)) - else if (ctype(c) == icol_roof) then - fn(c,j) = tk(c,j) * (t_roof_inner(l) - cnfac*t_soisno(c,j))/(zi(c,j) - z(c,j)) - end if - end if - end if - end if - else if (col%itype(c) /= icol_sunwall .and. col%itype(c) /= icol_shadewall & - .and. col%itype(c) /= icol_roof) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - fact(c,j) = dtime/cv(c,j) * dz(c,j) / (0.5_r8*(z(c,j)-zi(c,j-1)+capr*(z(c,j+1)-zi(c,j-1)))) - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j <= nlevgrnd-1) then - fact(c,j) = dtime/cv(c,j) - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - dzm = (z(c,j)-z(c,j-1)) - else if (j == nlevgrnd) then - fact(c,j) = dtime/cv(c,j) - fn(c,j) = eflx_bot(c) - end if - end if - end if - end do - end do - - end associate - - end subroutine ComputeHeatDiffFluxAndFactor - - !----------------------------------------------------------------------- - subroutine SetRHSVec(bounds, num_nolakec, filter_nolakec, dtime, & - hs_h2osfc, hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, tk, & - tk_h2osfc, fact, fn, c_h2osfc, dz_h2osfc, & - temperature_inst, waterstate_inst, rvector) - - ! - ! !DESCRIPTION: - ! Setup the RHS-Vector for the numerical solution of temperature for snow, - ! standing surface water and soil layers. - ! - ! |===========| - ! | Snow | - ! !===========| - ! rvector = | SSW | - ! !===========| - ! ! Soil | - ! !===========| - ! - ! !USES: - use clm_varcon , only : cnfac, cpliq - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(in) :: dtime ! land model time step (sec) - real(r8) , intent(in) :: hs_h2osfc( bounds%begc: ) ! heat flux on standing water [W/m2] - real(r8) , intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8) , intent(in) :: hs_soil( bounds%begc: ) ! heat flux on soil [W/m2] - real(r8) , intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8) , intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8) , intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8) , intent(in) :: tk( bounds%begc: , -nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8) , intent(in) :: tk_h2osfc( bounds%begc: ) ! thermal conductivity of h2osfc [W/(m K)] [col] - real(r8) , intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8) , intent(in) :: fn( bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8) , intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8) , intent(in) :: dz_h2osfc( bounds%begc: ) ! Thickness of standing water [m] - real(r8) , intent(out) :: rvector( bounds%begc: , -nlevsno: ) ! RHS vector used in numerical solution of temperature - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: rt (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! "r" vector for tridiagonal solution - real(r8) :: fn_h2osfc(bounds%begc:bounds%endc) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8) :: rt_snow(bounds%begc:bounds%endc,-nlevsno:-1) ! RHS vector corresponding to snow layers - real(r8) :: rt_ssw(bounds%begc:bounds%endc,1) ! RHS vector corresponding to standing surface water - real(r8) :: rt_soil(bounds%begc:bounds%endc,1:nlevgrnd) ! RHS vector corresponding to soil layer - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rvector) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] eff. fraction of ground covered by snow (0 to 1) - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - rvector(begc:endc, :) = nan - - ! Set entries in RHS vector for snow layers - call SetRHSVec_Snow(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - t_soisno ( begc:endc, -nlevsno+1: ), & - t_h2osfc ( begc:endc ), & - rt_snow( begc:endc, -nlevsno:)) - - ! Set entries in RHS vector for surface water layer - call SetRHSVec_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, & - dtime, & - hs_h2osfc( begc:endc ), & - dhsdT( begc:endc ), & - tk_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fn_h2osfc( begc:endc ), & - t_soisno ( begc:endc, -nlevsno+1: ), & - t_h2osfc ( begc:endc), & - rt_ssw( begc:endc, 1:1)) - - ! Set entries in RHS vector for soil layers - call SetRHSVec_Soil(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - frac_h2osfc ( begc:endc), & - frac_sno_eff( begc:endc), & - t_soisno ( begc:endc, -nlevsno+1: ), & - rt_soil( begc:endc, 1: )) - - ! Combine the RHS vector - do fc = 1,num_nolakec - c = filter_nolakec(fc) - rvector(c, -nlevsno:-1) = rt_snow(c, -nlevsno:-1) - rvector(c, 0 ) = rt_ssw(c, 1 ) - rvector(c, 1:nlevgrnd) = rt_soil(c, 1:nlevgrnd ) - end do - - end associate - - end subroutine SetRHSVec - - !----------------------------------------------------------------------- - subroutine SetRHSVec_Snow(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_top, dhsdT, sabg_lyr_col, & - fact, fn, t_soisno, t_h2osfc, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to snow layers. - ! - ! !USES: - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(in) :: t_h2osfc(bounds%begc:) ! surface water temperature (Kelvin) - real(r8), intent(out) :: rt(bounds%begc: , -nlevsno: ) ! rhs vector entries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, -1/)), errMsg(sourcefile, __LINE__)) - - associate( & - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - rt(begc:endc, : ) = nan - - call SetRHSVec_SnowUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - t_soisno ( begc:endc, -nlevsno+1: ), & - t_h2osfc ( begc:endc ), & - rt( begc:endc, -nlevsno:)) - - call SetRHSVec_SnowNonUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - t_soisno ( begc:endc, -nlevsno+1: ), & - rt( begc:endc, -nlevsno:)) - - end associate - - end subroutine SetRHSVec_Snow - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SnowUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_top, dhsdT, sabg_lyr_col, & - fact, fn, t_soisno, t_h2osfc, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to snow layers for urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(in) :: t_h2osfc(bounds%begc:) ! surface water temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: , -nlevsno: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, -1/)), errMsg(sourcefile, __LINE__)) - - associate( & - begc => bounds%begc, & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetRHSVec_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, -nlevsno:)) - - call SetRHSVec_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - t_soisno( begc:endc, -nlevsno+1: ), & - t_h2osfc( begc:endc), & - rt( begc:endc, -nlevsno:)) - - end associate - - end subroutine SetRHSVec_SnowUrban - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_top, dhsdT, sabg_lyr_col, & - fact, fn, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to snow layers for urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8) , intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8) , intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8) , intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8) , intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8) , intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8) , intent(in) :: fn (bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8) , intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8) , intent(inout) :: rt(bounds%begc: , -nlevsno: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - real(r8) :: rt_snow_urban(bounds%begc:bounds%endc,-nlevsno:-1) ! rhs vector entries for urban columns - real(r8) :: rt_snow_nonurban(bounds%begc:bounds%endc,-nlevsno:-1) ! rhs vector entries for non-urban columns - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, -1/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:) ] layer thickness (m) - ) - - ! - ! urban columns ------------------------------------------------------------------ - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - ! changed hs to hs_top - rt(c,j-1) = t_soisno(c,j) + fact(c,j)*( hs_top(c) - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - rt(c,j-1) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - rt(c,j-1) = rt(c,j-1) + (fact(c,j)*sabg_lyr_col(c,j)) - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SnowUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_top, dhsdT, sabg_lyr_col, & - fact, fn, t_soisno, t_h2osfc, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to snow layers for urban road - ! (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(in) :: t_h2osfc(bounds%begc: ) ! surface water temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: , -nlevsno: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - real(r8) :: rt_snow_urban(bounds%begc:bounds%endc,-nlevsno:-1) ! - real(r8) :: rt_snow_nonurban(bounds%begc:bounds%endc,-nlevsno:-1) ! - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, -1/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:) ] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - rt(c,j-1) = t_soisno(c,j) + fact(c,j)*( hs_top_snow(c) & - - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - - rt(c,j-1) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - rt(c,j-1) = rt(c,j-1) + fact(c,j)*sabg_lyr_col(c,j) - - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SnowUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SnowNonUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_top, dhsdT, sabg_lyr_col, & - fact, fn, t_soisno, rt) - - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to snow layers for non-urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow( bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_top( bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT( bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col( bounds%begc: , -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: , -nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: , -nlevsno: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_top_snow) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hs_top) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, -1/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:) ] layer thickness (m) - ) - - ! - ! non-urban columns -------------------------------------------------------------- - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - rt(c,j-1) = t_soisno(c,j) + fact(c,j)*( hs_top_snow(c) & - - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - - else - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - - rt(c,j-1) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - rt(c,j-1) = rt(c,j-1) + fact(c,j)*sabg_lyr_col(c,j) - - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SnowNonUrban - - !----------------------------------------------------------------------- - subroutine SetRHSVec_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, dtime, & - hs_h2osfc, dhsdT, tk_h2osfc, c_h2osfc, dz_h2osfc, fn_h2osfc, & - t_soisno, t_h2osfc, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to standing surface water - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: dtime ! land model time step (sec) - real(r8), intent(in) :: hs_h2osfc(bounds%begc: ) ! - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(out) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(in) :: t_h2osfc(bounds%begc:) ! surface water temperature temperature (Kelvin) - real(r8), intent(out) :: rt(bounds%begc: , 1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc,1/)), errMsg(sourcefile, __LINE__)) - - ! Initialize - rt(bounds%begc:bounds%endc, : ) = nan - - ! - ! surface water ------------------------------------------------------------------ - ! - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! surface water layer has two coefficients - dzm=(0.5*dz_h2osfc(c)+col%z(c,1)) - - fn_h2osfc(c)=tk_h2osfc(c)*(t_soisno(c,1)-t_h2osfc(c))/dzm - rt(c,1)= t_h2osfc(c) + (dtime/c_h2osfc(c)) & - *( hs_h2osfc(c) - dhsdT(c)*t_h2osfc(c) + cnfac*fn_h2osfc(c) )!rhs for h2osfc - - enddo - - end subroutine SetRHSVec_StandingSurfaceWater - - !----------------------------------------------------------------------- - subroutine SetRHSVec_Soil(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - frac_h2osfc, frac_sno_eff, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: frac_h2osfc(bounds%begc: ) ! fractional area with surface water greater than zero - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(out) :: rt(bounds%begc: ,1: ) ! rhs vector entries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - rt(begc:endc, : ) = nan - - call SetRHSVec_SoilUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - frac_sno_eff( begc:endc ), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, 1: )) - - call SetRHSVec_SoilNonUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - frac_sno_eff(begc:endc), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, 1: )) - - call SetRHSVec_Soil_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - frac_h2osfc(begc:endc), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, 1: )) - - end associate - - end subroutine SetRHSVec_Soil - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SoilUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - frac_sno_eff, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers for urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: ,1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetRHSVec_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, 1: )) - - call SetRHSVec_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow( begc:endc ), & - hs_soil( begc:endc ), & - hs_top( begc:endc ), & - dhsdT( begc:endc ), & - sabg_lyr_col (begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - fn( begc:endc, -nlevsno+1: ), & - fn_h2osfc( begc:endc ), & - c_h2osfc( begc:endc ), & - frac_sno_eff( begc:endc ), & - t_soisno( begc:endc, -nlevsno+1: ), & - rt( begc:endc, 1: )) - - end associate - - end subroutine SetRHSVec_SoilUrban - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers for urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: ,1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:) ] layer thickness (m) - ) - - ! - ! urban columns ------------------------------------------------------------------ - ! - do j = 1,nlevurb - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - ! changed hs to hs_top - rt(c,j) = t_soisno(c,j) + fact(c,j)*( hs_top(c) - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else if (j <= nlevurb-1) then - ! if this is a snow layer or the top soil layer, - ! add absorbed solar flux to factor 'rt' - if (j == 1) then - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - rt(c,j) = rt(c,j) + (fact(c,j)*sabg_lyr_col(c,j)) - else - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - endif - - else if (j == nlevurb) then - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - rt(c,j) = t_soisno(c,j) + fact(c,j)*( fn(c,j) - cnfac*fn(c,j-1) ) - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SoilUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - frac_sno_eff, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers for urban road - ! (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: ,1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:) ] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = 1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j == col%snl(c)+1) then - rt(c,j) = t_soisno(c,j) + fact(c,j)*( hs_top_snow(c) & - - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else if (j == 1) then - ! this is the snow/soil interface layer - rt(c,j) = t_soisno(c,j) + fact(c,j) & - *((1._r8-frac_sno_eff(c))*(hs_soil(c) - dhsdT(c)*t_soisno(c,j)) & - + cnfac*(fn(c,j) - frac_sno_eff(c) * fn(c,j-1))) - - rt(c,j) = rt(c,j) + frac_sno_eff(c)*fact(c,j)*sabg_lyr_col(c,j) - - else if (j <= nlevgrnd-1) then - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - - else if (j == nlevgrnd) then - rt(c,j) = t_soisno(c,j) - cnfac*fact(c,j)*fn(c,j-1) + fact(c,j)*fn(c,j) - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SoilUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetRHSVec_SoilNonUrban(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - frac_sno_eff, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers. - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fractional area with surface water greater than zero - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: ,1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! non-urban columns -------------------------------------------------------------- - ! - do j = 1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j == col%snl(c)+1) then - rt(c,j) = t_soisno(c,j) + fact(c,j)*( hs_top_snow(c) & - - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else if (j == 1) then - ! this is the snow/soil interface layer - rt(c,j) = t_soisno(c,j) + fact(c,j) & - *((1._r8-frac_sno_eff(c))*(hs_soil(c) - dhsdT(c)*t_soisno(c,j)) & - + cnfac*(fn(c,j) - frac_sno_eff(c) * fn(c,j-1))) - - rt(c,j) = rt(c,j) + frac_sno_eff(c)*fact(c,j)*sabg_lyr_col(c,j) - - else if (j <= nlevgrnd-1) then - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - - else if (j == nlevgrnd) then - rt(c,j) = t_soisno(c,j) - cnfac*fact(c,j)*fn(c,j-1) + fact(c,j)*fn(c,j) - end if - end if - enddo - end do - - end associate - - end subroutine SetRHSVec_SoilNonUrban - - !----------------------------------------------------------------------- - subroutine SetRHSVec_Soil_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, & - hs_top_snow, hs_soil, hs_top, dhsdT, sabg_lyr_col, fact, fn, fn_h2osfc, c_h2osfc, & - frac_h2osfc, t_soisno, rt) - ! - ! !DESCRIPTION: - ! Sets up RHS vector corresponding to soil layers. - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: hs_top_snow(bounds%begc: ) ! heat flux on top snow layer [W/m2] - real(r8), intent(in) :: hs_soil(bounds%begc: ) ! heat flux on soil [W/m2] - real(r8), intent(in) :: hs_top(bounds%begc: ) ! net energy flux into surface layer (col) [W/m2] - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: sabg_lyr_col(bounds%begc:, -nlevsno+1: ) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: fn (bounds%begc: ,-nlevsno+1: ) ! heat diffusion through the layer interface [W/m2] - real(r8), intent(in) :: fn_h2osfc (bounds%begc: ) ! heat diffusion through standing-water/soil interface [W/m2] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: frac_h2osfc(bounds%begc: ) ! fractional area with surface water greater than zero - real(r8), intent(in) :: t_soisno(bounds%begc:, -nlevsno+1:) ! soil temperature (Kelvin) - real(r8), intent(inout) :: rt(bounds%begc: ,1: ) ! rhs vector entries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(hs_soil) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sabg_lyr_col) == (/bounds%endc, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fn_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rt) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - ! - ! surface water ----------------------------------------------------------------- - ! - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ( frac_h2osfc(c) /= 0.0_r8 )then - rt(c,1)=rt(c,1) & - -frac_h2osfc(c)*fact(c,1)*((hs_soil(c) - dhsdT(c)*t_soisno(c,1)) & - +cnfac*fn_h2osfc(c)) - end if - end do - - end subroutine SetRHSVec_Soil_StandingSurfaceWater - - !----------------------------------------------------------------------- - subroutine SetMatrix(bounds, num_nolakec, filter_nolakec, dtime, nband, & - dhsdT, tk, tk_h2osfc, fact, c_h2osfc, dz_h2osfc, waterstate_inst, bmatrix) - ! - ! !DESCRIPTION: - ! Setup the matrix for the numerical solution of temperature for snow, - ! standing surface water and soil layers. - ! - ! - ! |===========|===========|===========| - ! | Snow | | Snow-Soil | - ! !===========|===========|===========| - ! bmatrix = | | SSW | SSW-Soil | - ! !===========|===========|===========| - ! ! Soil-Snow | Soil-SSW | Soil | - ! !===========|===========|===========| - ! - ! - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: dtime ! land model time step (sec) - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(out) :: bmatrix(bounds%begc: , 1:,-nlevsno: ) ! matrix for numerical solution of temperature - type(waterstate_type), intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: at (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! "a" vector for tridiagonal matrix - real(r8) :: bt (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! "b" vector for tridiagonal matrix - real(r8) :: ct (bounds%begc:bounds%endc,-nlevsno+1:nlevgrnd) ! "c" vector for tridiagonal matrix - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - real(r8) :: bmatrix_snow(bounds%begc:bounds%endc,nband,-nlevsno:-1 ) ! block-diagonal matrix for snow layers - real(r8) :: bmatrix_ssw(bounds%begc:bounds%endc,nband, 0:0 ) ! block-diagonal matrix for standing surface water - real(r8) :: bmatrix_soil(bounds%begc:bounds%endc,nband, 1:nlevgrnd) ! block-diagonal matrix for soil layers - real(r8) :: bmatrix_snow_soil(bounds%begc:bounds%endc,nband,-1:-1) ! off-diagonal matrix for snow-soil interaction - real(r8) :: bmatrix_ssw_soil(bounds%begc:bounds%endc,nband, 0:0 ) ! off-diagonal matrix for standing surface water-soil interaction - real(r8) :: bmatrix_soil_snow(bounds%begc:bounds%endc,nband, 1:1 ) ! off-diagonal matrix for soil-snow interaction - real(r8) :: bmatrix_soil_ssw(bounds%begc:bounds%endc,nband, 1:1 ) ! off-diagonal matrix for soil-standing surface water interaction - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer thickness (m) - frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - frac_sno_eff => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Assemble smaller matrices - - call SetMatrix_Snow(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_snow( begc:endc, 1:, -nlevsno: )) - - call SetMatrix_Snow_Soil(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: )) - - call SetMatrix_Soil(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - frac_h2osfc(begc:endc), & - frac_sno_eff(begc:endc), & - bmatrix_soil( begc:endc, 1:, 1: )) - - call SetMatrix_Soil_Snow(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil_snow( begc:endc, 1:, 1: )) - - call SetMatrix_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, dtime, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - c_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - bmatrix_ssw( begc:endc, 1:, 0: )) - - call SetMatrix_StandingSurfaceWater_Soil(bounds, num_nolakec, filter_nolakec, dtime, nband, & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - c_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - bmatrix_ssw_soil( begc:endc, 1:, 0: )) - - call SetMatrix_Soil_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, nband, & - tk_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - dz_h2osfc( begc:endc ), & - frac_h2osfc(begc:endc), & - bmatrix_soil_ssw( begc:endc, 1:, 1: )) - - call AssembleMatrixFromSubmatrices(bounds, num_nolakec, filter_nolakec, nband, & - bmatrix_snow( begc:endc, 1:, -nlevsno: ), & - bmatrix_ssw( begc:endc, 1:, 0: ), & - bmatrix_soil( begc:endc, 1:, 1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: ), & - bmatrix_ssw_soil( begc:endc, 1:, 0: ), & - bmatrix_soil_snow( begc:endc, 1:, 1: ), & - bmatrix_soil_ssw( begc:endc, 1:, 1: ), & - bmatrix( begc:endc, 1:, -nlevsno: )) - - end associate - - end subroutine SetMatrix - - !----------------------------------------------------------------------- - subroutine AssembleMatrixFromSubmatrices(bounds, num_nolakec, filter_nolakec, nband, & - bmatrix_snow, bmatrix_ssw, bmatrix_soil, bmatrix_snow_soil, & - bmatrix_ssw_soil, bmatrix_soil_snow, bmatrix_soil_ssw, bmatrix) - - ! - ! !DESCRIPTION: - ! Assemble the full matrix from submatrices. - ! - ! Non-zero pattern of bmatrix (assuming 5 snow layers): - ! - ! SNOW-LAYERS - ! | - ! | STANDING-SURFACE-WATER - ! | | - ! | | SOIL-LAYERS - ! | | | - ! v v v - ! - ! -5 -4 -3 -2 -1| 0| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - ! ============================================================== - ! -5 | x x | | | - ! -4 | x x x | | | - ! -3 | x x x | | | - ! -2 | x x x| | | - ! -1 | x x| | x | - ! ============================================================== - ! 0 | | x| x | - ! ============================================================== - ! 1 | x| x| x x | - ! 2 | | | x x x | - ! 3 | | | x x x | - ! 4 | | | x x x | - ! 5 | | | x x x | - ! 6 | | | x x x | - ! 7 | | | x x x | - ! 8 | | | x x x | - ! 9 | | | x x x | - ! 10 | | | x x x | - ! 11 | | | x x x | - ! 12 | | | x x x | - ! 13 | | | x x x | - ! 14 | | | x x x| - ! 15 | | | x x| - ! ============================================================== - ! - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: bmatrix_snow(bounds%begc: , 1: , -nlevsno: ) ! block-diagonal matrix for snow layers [col, nband, nlevsno] - real(r8), intent(in) :: bmatrix_ssw(bounds%begc: , 1: , 0: ) ! block-diagonal matrix for standing surface water [col, nband, 0:0] - real(r8), intent(in) :: bmatrix_soil(bounds%begc: , 1: , 1: ) ! block-diagonal matrix for soil layers [col, nband, nlevgrnd] - real(r8), intent(in) :: bmatrix_snow_soil(bounds%begc: , 1: , -1: ) ! off-diagonal matrix for snow-soil interaction [col, nband, -1:-1] - real(r8), intent(in) :: bmatrix_ssw_soil(bounds%begc: , 1: , 0: ) ! off-diagonal matrix for standing surface water-soil interaction [col, nband, 0:0] - real(r8), intent(in) :: bmatrix_soil_snow(bounds%begc: , 1: , 1: ) ! off-diagonal matrix for soil-snow interaction [col, nband, 1:1] - real(r8), intent(in) :: bmatrix_soil_ssw(bounds%begc: , 1: , 1: ) ! off-diagonal matrix for soil-standing surface water interaction [col, nband, 1:1] - real(r8), intent(out) :: bmatrix(bounds%begc: , 1: , -nlevsno: ) ! full matrix used in numerical solution of temperature [col, nband, -nlevsno:nlevgrnd] - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - integer :: fc ! lake filtered column indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_ssw) == (/bounds%endc, nband, 0/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_ssw_soil) == (/bounds%endc, nband, 0/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_ssw) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - ! Assemble the full matrix - - bmatrix(bounds%begc:bounds%endc, :, :) = 0.0_r8 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! Snow - bmatrix(c,2:3,-nlevsno ) = bmatrix_snow(c,2:3,-nlevsno ) - bmatrix(c,2:4,-nlevsno+1:-2) = bmatrix_snow(c,2:4,-nlevsno+1:-2) - bmatrix(c,3:4,-1 ) = bmatrix_snow(c,3:4,-1 ) - - ! Snow-Soil - bmatrix(c,1,-1) = bmatrix_snow_soil(c,1,-1) - - ! StandingSurfaceWater - bmatrix(c,3,0) = bmatrix_ssw(c,3,0) - - ! StandingSurfaceWater-Soil - bmatrix(c,2,0) = bmatrix_ssw_soil(c,2,0) - - ! Soil - bmatrix(c,2:3,1 ) = bmatrix_soil(c,2:3,1 ) - bmatrix(c,2:4,2:nlevgrnd-1) = bmatrix_soil(c,2:4,2:nlevgrnd-1) - bmatrix(c,3:4,nlevgrnd ) = bmatrix_soil(c,3:4,nlevgrnd ) - - ! Soil-Snow - bmatrix(c,5,1) = bmatrix_soil_snow(c,5,1) - - ! Soil-StandingSurfaceWater - bmatrix(c,4,1) = bmatrix_soil_ssw(c,4,1) - - end do - - end subroutine AssembleMatrixFromSubmatrices - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, fact, frac_sno_eff, bmatrix_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal snow layers - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(out) :: bmatrix_snow(bounds%begc: , 1:, -nlevsno: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - bmatrix_snow(begc:endc, :, :) = 0.0_r8 - - call SetMatrix_SnowUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow( begc:endc, 1:, -nlevsno: )) - - call SetMatrix_SnowNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow( begc:endc, 1:, -nlevsno: )) - - end associate - - end subroutine SetMatrix_Snow - - !----------------------------------------------------------------------- - subroutine SetMatrix_SnowUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, fact, bmatrix_snow) - - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal snow layers for - ! urban soil columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow(bounds%begc: , 1:, -nlevsno: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetMatrix_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow( begc:endc, 1:, -nlevsno: )) - - call SetMatrix_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow( begc:endc, 1:, -nlevsno: )) - - end associate - - end subroutine SetMatrix_SnowUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, fact, bmatrix_snow) - - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal snow layers for - ! urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow(bounds%begc: , 1:, -nlevsno: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban non-road columns --------------------------------------------------------- - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow(c,4,j-1) = 0._r8 - bmatrix_snow(c,3,j-1) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - if ( j /= 0) then - bmatrix_snow(c,2,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - end if - else if (j <= nlevurb-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow(c,4,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bmatrix_snow(c,3,j-1) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - if (j /= 0) then - bmatrix_snow(c,2,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SnowUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, fact, bmatrix_snow) - - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal snow layers for - ! urban road (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow(bounds%begc: , 1:, -nlevsno: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow(c,4,j-1) = 0._r8 - bmatrix_snow(c,3,j-1) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - if ( j /= 0) then - bmatrix_snow(c,2,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - end if - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow(c,4,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bmatrix_snow(c,3,j-1) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - if ( j /= 0) then - bmatrix_snow(c,2,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SnowUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_SnowNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, fact, bmatrix_snow) - - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal snow layers for non-urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow(bounds%begc: , 1:, -nlevsno: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! non-urban landunits ------------------------------------------------------------ - ! - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow(c,4,j-1) = 0._r8 - bmatrix_snow(c,3,j-1) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - if ( j /= 0) then - bmatrix_snow(c,2,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - end if - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow(c,4,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bmatrix_snow(c,3,j-1) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - if ( j /= 0) then - bmatrix_snow(c,2,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SnowNonUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow_Soil(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_snow_soil) - - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to snow-soil interaction - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(out) :: bmatrix_snow_soil(bounds%begc: , 1:,-1: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - bmatrix_snow_soil(begc:endc, :, :) = 0.0_r8 - - call SetMatrix_Snow_SoilUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: )) - - call SetMatrix_Snow_SoilNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: )) - - end associate - - end subroutine SetMatrix_Snow_Soil - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow_SoilUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_snow_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to snow-soil interaction for urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow_soil(bounds%begc: , 1:,-1: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetMatrix_Snow_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: )) - - call SetMatrix_Snow_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_snow_soil( begc:endc, 1:, -1: )) - - end associate - - end subroutine SetMatrix_Snow_SoilUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_snow_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to snow-soil interaction for - ! urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow_soil(bounds%begc: , 1:,-1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - ! - ! urban non-road columns --------------------------------------------------------- - ! - do j = 0,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow_soil(c,1,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevurb-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow_soil(c,1,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_Snow_SoilUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_snow_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to snow-soil interaction for - ! urban road (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow_soil(bounds%begc: , 1:,-1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = 0,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow_soil(c,1,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow_soil(c,1,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_Snow_SoilUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_Snow_SoilNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_snow_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to snow-soil interaction for - ! non-urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_snow_soil(bounds%begc: , 1:,-1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_snow_soil) == (/bounds%endc, nband, -1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! non-urban columns -------------------------------------------------------------- - ! - do j = 0,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_snow_soil(c,1,j-1) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_snow_soil(c,1,j-1) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_Snow_SoilNonUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, tk_h2osfc, dz_h2osfc, fact, frac_h2osfc, frac_sno_eff, bmatrix_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal soil layers. - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_h2osfc(bounds%begc: ) ! fractional area with surface water greater than zero - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(out) :: bmatrix_soil(bounds%begc: , 1:, 1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - bmatrix_soil(begc:endc, :, :) = 0.0_r8 - - call SetMatrix_SoilUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil( begc:endc, 1:, 1: )) - - call SetMatrix_SoilNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil( begc:endc, 1:, 1: )) - - ! the solution will be organized as (snow:h2osfc:soil) to minimize - ! bandwidth; this requires a 5-element band instead of 3 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! surface water layer has two coefficients - dzm=(0.5*dz_h2osfc(c)+col%z(c,1)) - - ! diagonal element correction for presence of h2osfc - if ( frac_h2osfc(c) /= 0.0_r8 ) then - bmatrix_soil(c,3,1)=bmatrix_soil(c,3,1)+ frac_h2osfc(c) & - *((1._r8-cnfac)*fact(c,1)*tk_h2osfc(c)/dzm + fact(c,1)*dhsdT(c)) - end if - - enddo - - end associate - - end subroutine SetMatrix_Soil - - !----------------------------------------------------------------------- - subroutine SetMatrix_SoilUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, tk_h2osfc, dz_h2osfc, fact, frac_sno_eff, bmatrix_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal soil layers for - ! urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil(bounds%begc: , 1:, 1: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetMatrix_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_soil( begc:endc, 1:, 1: )) - - call SetMatrix_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT( begc:endc ), & - tk( begc:endc, -nlevsno+1: ), & - tk_h2osfc( begc:endc ), & - dz_h2osfc( begc:endc ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil( begc:endc, 1:, 1: )) - - end associate - - end subroutine SetMatrix_SoilUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_SoilUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, tk_h2osfc, dz_h2osfc, fact, bmatrix_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal soil layers for - ! urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_soil(bounds%begc: , 1:, 1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - zi => col%zi , & ! Input: [real(r8) (:,:)] interface level below a "z" level (m) - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban non-road columns --------------------------------------------------------- - ! - do j = 1,nlevurb - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - if (j /= 1) then - bmatrix_soil(c,4,j) = 0._r8 - end if - bmatrix_soil(c,3,j) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - bmatrix_soil(c,2,j) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevurb-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - if (j /= 1) then - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - end if - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - bmatrix_soil(c,2,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - else if (j == nlevurb) then - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prognostic inner - ! surface temperature. - dzm = ( z(c,j)-z(c,j-1)) - dzp = (zi(c,j)-z(c,j)) - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)*(tk(c,j-1)/dzm) - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j-1)/dzm + tk(c,j)/dzp) - bmatrix_soil(c,2,j) = 0._r8 - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SoilUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_SoilUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, tk_h2osfc, dz_h2osfc, fact, frac_sno_eff, bmatrix_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal soil layers for - ! urban road (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil(bounds%begc: , 1:, 1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = 1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - if (j /= 1) then - bmatrix_soil(c,4,j) = 0._r8 - end if - bmatrix_soil(c,3,j) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - bmatrix_soil(c,2,j) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j == 1) then - ! this is the snow/soil interface layer - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - if (j /= 1) then - bmatrix_soil(c,4,j) = - frac_sno_eff(c) * (1._r8-cnfac) * fact(c,j) & - * tk(c,j-1)/dzm - end if - bmatrix_soil(c,3,j) = 1._r8 + (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp & - + frac_sno_eff(c) * tk(c,j-1)/dzm) & - - (1._r8 - frac_sno_eff(c))*fact(c,j)*dhsdT(c) - bmatrix_soil(c,2,j) = - (1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - bmatrix_soil(c,2,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - else if (j == nlevgrnd) then - dzm = (z(c,j)-z(c,j-1)) - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - bmatrix_soil(c,2,j) = 0._r8 - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SoilUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_SoilNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - dhsdT, tk, tk_h2osfc, dz_h2osfc, fact, frac_sno_eff, bmatrix_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal soil layers. - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil(bounds%begc: , 1:, 1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil) == (/bounds%endc, nband, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! non-urban columns -------------------------------------------------------------- - ! - do j = 1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - if (j /= 1) then - bmatrix_soil(c,4,j) = 0._r8 - end if - bmatrix_soil(c,3,j) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - bmatrix_soil(c,2,j) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j == 1) then - ! this is the snow/soil interface layer - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - if (j /= 1) then - bmatrix_soil(c,4,j) = - frac_sno_eff(c) * (1._r8-cnfac) * fact(c,j) & - * tk(c,j-1)/dzm - end if - bmatrix_soil(c,3,j) = 1._r8 + (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp & - + frac_sno_eff(c) * tk(c,j-1)/dzm) & - - (1._r8 - frac_sno_eff(c))*fact(c,j)*dhsdT(c) - bmatrix_soil(c,2,j) = - (1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - bmatrix_soil(c,2,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - else if (j == nlevgrnd) then - dzm = (z(c,j)-z(c,j-1)) - bmatrix_soil(c,4,j) = - (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - bmatrix_soil(c,3,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - bmatrix_soil(c,2,j) = 0._r8 - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_SoilNonUrban - - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_Snow(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, frac_sno_eff, bmatrix_soil_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil-snow interaction - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(out) :: bmatrix_soil_snow(bounds%begc: , 1: ,1: ) ! matrix enteries - !------------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - associate( & - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - ! Initialize - bmatrix_soil_snow(begc:endc, :, :) = 0.0_r8 - - call SetMatrix_Soil_SnowUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil_snow( begc:endc, 1:, 1: )) - - call SetMatrix_Soil_SnowNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil_snow( begc:endc, 1:, 1: )) - - end associate - - end subroutine SetMatrix_Soil_Snow - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_SnowUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, frac_sno_eff, bmatrix_soil_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil-snow interaction for - ! urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil_snow(bounds%begc: , 1: ,1: ) ! matrix enteries - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - associate(& - begc => bounds%begc , & ! Input: [integer ] beginning column index - endc => bounds%endc & ! Input: [integer ] ending column index - ) - - call SetMatrix_Soil_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - bmatrix_soil_snow( begc:endc, 1:, 1: )) - - call SetMatrix_Soil_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk( begc:endc, -nlevsno+1: ), & - fact( begc:endc, -nlevsno+1: ), & - frac_sno_eff(begc:endc), & - bmatrix_soil_snow( begc:endc, 1:, 1: )) - - end associate - - endsubroutine SetMatrix_Soil_SnowUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_SnowUrbanNonRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, bmatrix_soil_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil-snow interaction for - ! urban sunwall/shadewall/roof columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(inout) :: bmatrix_soil_snow(bounds%begc: , 1: ,1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - associate( & - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - ! - ! - do j = 1,1 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if ((col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_soil_snow(c,5,j) = 0._r8 - else if (j <= nlevurb-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - bmatrix_soil_snow(c,5,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - end if - end if - end if - end if - enddo - end do - - end associate - - end subroutine SetMatrix_Soil_SnowUrbanNonRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_SnowUrbanRoad(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, frac_sno_eff, bmatrix_soil_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil-snow interaction for - ! urban road (impervious + pervious) columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_road_imperv, icol_road_perv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil_snow(bounds%begc: , 1: ,1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! urban road columns ------------------------------------------------------------- - ! - do j = 1,1 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_imperv .or. col%itype(c) == icol_road_perv) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_soil_snow(c,5,j) = 0._r8 - else if (j == 1) then - ! this is the snow/soil interface layer - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - - bmatrix_soil_snow(c,5,j) = - frac_sno_eff(c) * (1._r8-cnfac) * fact(c,j) & - * tk(c,j-1)/dzm - end if - end if - end if - end if - end do - end do - - end associate - - end subroutine SetMatrix_Soil_SnowUrbanRoad - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_SnowNonUrban(bounds, num_nolakec, filter_nolakec, nband, & - tk, fact, frac_sno_eff, bmatrix_soil_snow) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil-snow interaction for - ! non urban columns - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: frac_sno_eff(bounds%begc: ) ! fraction of ground covered by snow (0 to 1) - real(r8), intent(inout) :: bmatrix_soil_snow(bounds%begc: , 1: ,1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: j,c,l ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_sno_eff) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_snow) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - associate(& - z => col%z & ! Input: [real(r8) (:,:)] layer thickness (m) - ) - - ! - ! non-urban columns -------------------------------------------------------------- - ! - do j = 1,1 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (.not. lun%urbpoi(l)) then - if (j >= col%snl(c)+1) then - if (j == col%snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - bmatrix_soil_snow(c,5,j) = 0._r8 - else if (j == 1) then - ! this is the snow/soil interface layer - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - - bmatrix_soil_snow(c,5,j) = -frac_sno_eff(c) * (1._r8-cnfac) * fact(c,j) & - * tk(c,j-1)/dzm - end if - end if - end if - end do - end do - - end associate - - end subroutine SetMatrix_Soil_SnowNonUrban - - !----------------------------------------------------------------------- - subroutine SetMatrix_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, dtime, nband, & - dhsdT, tk, tk_h2osfc, fact, c_h2osfc, dz_h2osfc, bmatrix_ssw) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to internal standing water layer - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: dtime ! land model time step (sec) - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: dhsdT(bounds%begc: ) ! temperature derivative of "hs" [col] - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(out) :: bmatrix_ssw(bounds%begc: , 1:, 0: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(dhsdT) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_ssw) == (/bounds%endc, nband, 0/)), errMsg(sourcefile, __LINE__)) - - ! Initialize - bmatrix_ssw(bounds%begc:bounds%endc, :, :) = 0.0_r8 - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! surface water layer has two coefficients - dzm=(0.5*dz_h2osfc(c)+col%z(c,1)) - - bmatrix_ssw(c,3,0)= 1+(1._r8-cnfac)*(dtime/c_h2osfc(c)) & - *tk_h2osfc(c)/dzm -(dtime/c_h2osfc(c))*dhsdT(c) !interaction from atm - - enddo - - end subroutine SetMatrix_StandingSurfaceWater - - !----------------------------------------------------------------------- - subroutine SetMatrix_StandingSurfaceWater_Soil(bounds, num_nolakec, filter_nolakec, dtime, nband, & - tk, tk_h2osfc, fact, c_h2osfc, dz_h2osfc, bmatrix_ssw_soil) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to standing surface water-soil layer interaction - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - real(r8), intent(in) :: dtime ! land model time step (sec) - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk(bounds%begc: ,-nlevsno+1: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: c_h2osfc( bounds%begc: ) ! heat capacity of surface water [col] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(out) :: bmatrix_ssw_soil(bounds%begc: , 1: ,0: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_ssw_soil) == (/bounds%endc, nband, 0/)), errMsg(sourcefile, __LINE__)) - - ! Initialize - bmatrix_ssw_soil(bounds%begc:bounds%endc, :, :) = 0.0_r8 - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! surface water layer has two coefficients - dzm=(0.5*dz_h2osfc(c)+col%z(c,1)) - - bmatrix_ssw_soil(c,2,0)= -(1._r8-cnfac)*(dtime/c_h2osfc(c))*tk_h2osfc(c)/dzm !flux to top soil layer - - enddo - - end subroutine SetMatrix_StandingSurfaceWater_Soil - - !----------------------------------------------------------------------- - subroutine SetMatrix_Soil_StandingSurfaceWater(bounds, num_nolakec, filter_nolakec, nband, & - tk_h2osfc, fact, dz_h2osfc, frac_h2osfc, bmatrix_soil_ssw) - ! - ! !DESCRIPTION: - ! Setup the matrix entries corresponding to soil layer-standing surface water interaction - ! - ! !USES: - use clm_varcon , only : cnfac - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varpar , only : nlevsno, nlevgrnd - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: nband ! number of bands of the tridigonal matrix - real(r8), intent(in) :: tk_h2osfc(bounds%begc: ) ! thermal conductivity [W/(m K)] - real(r8), intent(in) :: fact( bounds%begc: , -nlevsno+1: ) ! used in computing tridiagonal matrix [col, lev] - real(r8), intent(in) :: dz_h2osfc(bounds%begc: ) ! Thickness of standing water [m] - real(r8), intent(in) :: frac_h2osfc(bounds%begc: ) ! fractional area with surface water greater than zero - real(r8), intent(out) :: bmatrix_soil_ssw(bounds%begc: , 1:, 1: ) ! matrix enteries - ! - ! !LOCAL VARIABLES: - integer :: c ! indices - integer :: fc ! lake filtered column indices - real(r8) :: dzm ! used in computing tridiagonal matrix - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fact) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(dz_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_h2osfc) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bmatrix_soil_ssw) == (/bounds%endc, nband, 1/)), errMsg(sourcefile, __LINE__)) - - ! Initialize - bmatrix_soil_ssw(bounds%begc:bounds%endc, :, :) = 0.0_r8 - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - ! surface water layer has two coefficients - dzm=(0.5*dz_h2osfc(c)+col%z(c,1)) - - ! top soil layer has sub coef shifted to 2nd super diagonal - if ( frac_h2osfc(c) /= 0.0_r8 )then - bmatrix_soil_ssw(c,4,1)= - frac_h2osfc(c) * (1._r8-cnfac) * fact(c,1) & - * tk_h2osfc(c)/dzm !flux from h2osfc - end if - enddo - - end subroutine SetMatrix_Soil_StandingSurfaceWater - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: BuildingHAC - ! - ! !INTERFACE: - subroutine BuildingHAC( bounds, num_urbanl, filter_urbanl, temperature_inst, urbanparams_inst, urbantv_inst, & - cool_on, heat_on ) - ! !DESCRIPTION: - ! Simpler method to manage building temperature (first introduced in CLM4.5). Restricts building - ! temperature to within bounds, and determine's if heating or cooling is on. - ! !USES: - implicit none - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - type(temperature_type) , intent(inout) :: temperature_inst ! Temperature variables - type(urbanparams_type) , intent(in) :: urbanparams_inst ! urban parameters - type(urbantv_type) , intent(in) :: urbantv_inst ! urban parameters - logical, intent(out) :: cool_on(bounds%begl:) ! is urban air conditioning on? - logical, intent(out) :: heat_on(bounds%begl:) ! is urban heating on? - !----------------------------------------------------------------------- - ! !LOCAL VARIABLES: - integer :: fl,l ! indices - !EOP - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(cool_on) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(heat_on) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - associate(& - urbpoi => lun%urbpoi , & ! Input: [logical (:)] true => landunit is an urban point - - t_building => temperature_inst%t_building_lun , & ! Input: [real(r8) (:)] internal building air temperature (K) - - t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) - t_building_min => urbanparams_inst%t_building_min & ! Input: [real(r8) (:)] minimum internal building air temperature (K) - ) - ! Restrict internal building temperature to between min and max - ! and determine if heating or air conditioning is on - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - cool_on(l) = .false. - heat_on(l) = .false. - if (t_building(l) > t_building_max(l)) then - t_building(l) = t_building_max(l) - cool_on(l) = .true. - heat_on(l) = .false. - else if (t_building(l) < t_building_min(l)) then - t_building(l) = t_building_min(l) - cool_on(l) = .false. - heat_on(l) = .true. - end if - end if - end do - - end associate - - end subroutine BuildingHAC - - !----------------------------------------------------------------------- - -end module SoilTemperatureMod - diff --git a/src/biogeophys/SoilWaterMovementMod.F90 b/src/biogeophys/SoilWaterMovementMod.F90 deleted file mode 100644 index e471118dcf..0000000000 --- a/src/biogeophys/SoilWaterMovementMod.F90 +++ /dev/null @@ -1,2233 +0,0 @@ -module SoilWaterMovementMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! DESCRIPTION - ! module contains different subroutines to couple soil and root water interactions - ! - ! created by Jinyun Tang, Mar 12, 2014 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use clm_instMod , only : clm_fates - - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilWater ! Calculate soil hydrology - public :: init_soilwater_movement - private :: soilwater_zengdecker2009 - private :: soilwater_moisture_form -! private :: soilwater_mixed_form -! private :: soilwater_head_form - private :: compute_hydraulic_properties - private :: compute_moisture_fluxes_and_derivs - private :: compute_RHS_moisture_form - private :: compute_LHS_moisture_form - private :: compute_qcharge - private :: IceImpedance - private :: TridiagonalCol - ! - ! The following is only public for the sake of unit testing; it should not be called - ! directly by CLM code outside this module - public :: BaseflowSink - public :: use_aquifer_layer - ! - ! !PUBLIC DATA MEMBERS: -! logical, public :: use_bedrock = .false. ! true => run with spatially variable soil depth - - ! !PRIVATE DATA MEMBERS: - - ! Solution method - integer, parameter :: zengdecker_2009 = 0 - integer, parameter :: moisture_form = 1 - integer, parameter :: mixed_form = 2 - integer, parameter :: head_form = 3 - - ! Boundary conditions - integer, parameter :: bc_head = 0 - integer, parameter :: bc_flux = 1 - integer, parameter :: bc_zero_flux = 2 - integer, parameter :: bc_waterTable = 3 - integer, parameter :: bc_aquifer = 4 - - ! Soil hydraulic properties - integer, parameter :: soil_hp_clapphornberg_1978=0 - integer, parameter :: soil_hp_vanGenuchten_1980=1 - - real(r8),parameter :: m_to_mm = 1.e3_r8 !convert meters to mm - - integer :: soilwater_movement_method ! method for solving richards equation - integer :: upper_boundary_condition ! named variable for the boundary condition - integer :: lower_boundary_condition ! named variable for the boundary condition - - ! Adaptive time stepping algorithmic control parameters - real(r8) :: dtmin ! minimum time step length (seconds) - real(r8) :: verySmall ! a very small number: used to check for sub step completion - real(r8) :: xTolerUpper ! tolerance to halve length of substep - real(r8) :: xTolerLower ! tolerance to double length of substep - integer :: expensive - integer :: inexpensive - integer :: flux_calculation - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - -!#1 - !----------------------------------------------------------------------- - subroutine init_soilwater_movement() - ! - !DESCRIPTION - !specify method for doing soil&root water interactions - ! - ! !USES: - use abortutils , only : endrun - use fileutils , only : getavu, relavu - use spmdMod , only : mpicom, masterproc - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog, use_bedrock - use controlMod , only : NLFilename - use clm_nlUtilsMod , only : find_nlgroup_name - - ! !ARGUMENTS: - !------------------------------------------------------------------------------ - implicit none - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(*), parameter :: subName = "('init_soilwater_movement')" - - !----------------------------------------------------------------------- - -! MUST agree with name in namelist and read statement - namelist /soilwater_movement_inparm/ & - soilwater_movement_method, & - upper_boundary_condition, & - lower_boundary_condition, & - dtmin, & - verySmall, & - xTolerUpper, & - xTolerLower, & - expensive, & - inexpensive, & - flux_calculation - - ! Default values for namelist - - soilwater_movement_method = zengdecker_2009 - upper_boundary_condition = bc_flux - lower_boundary_condition = bc_aquifer - - dtmin=60._r8 - verySmall=1.e-8_r8 - xTolerUpper=1.e-1_r8 - xTolerLower=1.e-2_r8 - expensive=42 - inexpensive=1 - flux_calculation=inexpensive - - ! Read soilwater_movement namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'soilwater_movement_inparm', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=soilwater_movement_inparm,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading soilwater_movement namelist') - end if - else - call endrun(subname // ':: ERROR reading soilwater_movement namelist') - end if - close(nu_nml) - call relavu( nu_nml ) - -! test for namelist consistency - if((soilwater_movement_method == zengdecker_2009) .and. & - (lower_boundary_condition /= bc_aquifer)) then - call endrun(subname // ':: ERROR inconsistent soilwater_movement namelist: ZD09 must use bc_aquifer lbc') - endif - if((use_bedrock) .and. (lower_boundary_condition /= bc_zero_flux)) then - call endrun(subname // ':: ERROR inconsistent soilwater_movement namelist: use_bedrock requires bc_zero_flux lbc') - endif - endif - - call shr_mpi_bcast(soilwater_movement_method, mpicom) - call shr_mpi_bcast(upper_boundary_condition, mpicom) - call shr_mpi_bcast(lower_boundary_condition, mpicom) - call shr_mpi_bcast(dtmin, mpicom) - call shr_mpi_bcast(verySmall, mpicom) - call shr_mpi_bcast(xTolerUpper, mpicom) - call shr_mpi_bcast(xTolerLower, mpicom) - call shr_mpi_bcast(expensive, mpicom) - call shr_mpi_bcast(inexpensive, mpicom) - call shr_mpi_bcast(flux_calculation, mpicom) - - - if (masterproc) then - - write(iulog,*) ' ' - write(iulog,*) 'soilwater_movement settings:' - write(iulog,*) ' soilwater_movement_method = ',soilwater_movement_method - write(iulog,*) ' upper_boundary_condition = ',upper_boundary_condition - write(iulog,*) ' lower_boundary_condition = ',lower_boundary_condition - - write(iulog,*) ' use_bedrock = ',use_bedrock - write(iulog,*) ' dtmin = ',dtmin - write(iulog,*) ' verySmall = ',verySmall - write(iulog,*) ' xTolerUpper = ',xTolerUpper - write(iulog,*) ' xTolerLower = ',xTolerLower - write(iulog,*) ' expensive = ',expensive - write(iulog,*) ' inexpensive = ',inexpensive - write(iulog,*) ' flux_calculation = ',flux_calculation - endif - - end subroutine init_soilwater_movement - - -!#2 - !------------------------------------------------------------------------------ - function use_aquifer_layer() result(lres) - ! - !DESCRIPTION - ! return true if an aquifer layer is used - ! otherwise false - implicit none - logical :: lres - - if(lower_boundary_condition == bc_aquifer .or. lower_boundary_condition == bc_watertable)then - lres=.true. - else - lres=.false. - endif - return - - end function use_aquifer_layer - -!#3 - !----------------------------------------------------------------------- - subroutine SoilWater(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - ! - ! DESCRIPTION - ! select one subroutine to do the soil and root water coupling - ! - !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : nlevsoi - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varpar , only : nlevsoi - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use EnergyFluxType , only : energyflux_type - use WaterStateType , only : waterstate_type - use CanopyStateType , only : canopystate_type - use ColumnType , only : col - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use clm_varcon , only : denh2o, denice - use clm_varctl, only : use_flexibleCN - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(temperature_type) , intent(in) :: temperature_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'SoilWater' ! subroutine name - real(r8) :: xs(bounds%begc:bounds%endc) !excess soil water above urban ponding limit - real(r8) :: watmin - integer :: fc, c, j - - !------------------------------------------------------------------------------ - - associate( & - wa => soilhydrology_inst%wa_col , & ! Input: [real(r8) (:) ] water in the unconfined aquifer (mm) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Output: [real(r8) (:,:) ] liquid water (kg/m2) - ) - - select case(soilwater_movement_method) - - case (zengdecker_2009) - - call soilwater_zengdecker2009(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - - case (moisture_form) - - call soilwater_moisture_form(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - - case (mixed_form) - -!!$ call soilwater_mixed_form(bounds, num_hydrologyc, filter_hydrologyc, & -!!$ num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & -!!$ waterflux_inst, waterstate_inst, temperature_inst) - - case (head_form) - -!!$ call soilwater_head_form(bounds, num_hydrologyc, filter_hydrologyc, & -!!$ num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & -!!$ waterflux_inst, waterstate_inst, temperature_inst) - - case default - - call endrun(subname // ':: a SoilWater implementation must be specified!') - - end select - - if (use_flexibleCN) then - !a work around of the negative liquid water. Jinyun Tang, Jan 14, 2015 - watmin = 0.001_r8 - - do j = 1, nlevsoi-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < 0._r8) then - xs(c) = watmin - h2osoi_liq(c,j) - else - xs(c) = 0._r8 - end if - h2osoi_liq(c,j ) = h2osoi_liq(c,j ) + xs(c) - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) - xs(c) - end do - end do - - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin-h2osoi_liq(c,j) - else - xs(c) = 0._r8 - end if - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - wa(c) = wa(c) - xs(c) - end do - - !update volumetric soil moisture for bgc calculation - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) & - + h2osoi_ice(c,j)/(dz(c,j)*denice) - enddo - enddo - end if - end associate - end subroutine SoilWater - -!#5 - !----------------------------------------------------------------------- - subroutine BaseflowSink(bounds, num_hydrologyc, & - filter_hydrologyc, baseflow_sink, waterflux_inst, soilstate_inst) - ! - ! Generic routine to apply baseflow as a sink condition that - ! is vertically distributed over the soil column. - ! - !USES: - use decompMod , only : bounds_type - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : nlevsoi, max_patch_per_col - use SoilStateType , only : soilstate_type - use WaterFluxType , only : waterflux_type - use PatchType , only : patch - use ColumnType , only : col - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - real(r8) , intent(out) :: baseflow_sink(bounds%begc:,1:) ! vertically distributed baseflow sink (mm H2O/s) (+ = to rof) - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,fc,j ! do loop indices - integer :: pi ! patch index - real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(baseflow_sink) == (/bounds%endc, nlevsoi/)), errMsg(sourcefile, __LINE__)) - -!this is just a placeholder for now - baseflow_sink = 0. - - end subroutine BaseflowSink - - -!#6 - !----------------------------------------------------------------------- - subroutine soilwater_zengdecker2009(bounds, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, soilhydrology_inst, soilstate_inst, & - waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - ! - ! !DESCRIPTION: - ! Soil hydrology - ! Soil moisture is predicted from a 10-layer model (as with soil - ! temperature), in which the vertical soil moisture transport is governed - ! by infiltration, runoff, gradient diffusion, gravity, and root - ! extraction through canopy transpiration. The net water applied to the - ! surface layer is the snowmelt plus precipitation plus the throughfall - ! of canopy dew minus surface runoff and evaporation. - ! CLM3.5 uses a zero-flow bottom boundary condition. - ! - ! The vertical water flow in an unsaturated porous media is described by - ! Darcy's law, and the hydraulic conductivity and the soil negative - ! potential vary with soil water content and soil texture based on the work - ! of Clapp and Hornberger (1978) and Cosby et al. (1984). The equation is - ! integrated over the layer thickness, in which the time rate of change in - ! water mass must equal the net flow across the bounding interface, plus the - ! rate of internal source or sink. The terms of water flow across the layer - ! interfaces are linearly expanded by using first-order Taylor expansion. - ! The equations result in a tridiagonal system equation. - ! - ! Note: length units here are all millimeter - ! (in temperature subroutine uses same soil layer - ! structure required but lengths are m) - ! - ! Richards equation: - ! - ! d wat d d wat d psi - ! ----- = - -- [ k(----- ----- - 1) ] + S - ! dt dz dz d wat - ! - ! where: wat = volume of water per volume of soil (mm**3/mm**3) - ! psi = soil matrix potential (mm) - ! dt = time step (s) - ! z = depth (mm) - ! dz = thickness (mm) - ! qin = inflow at top (mm h2o /s) - ! qout= outflow at bottom (mm h2o /s) - ! s = source/sink flux (mm h2o /s) - ! k = hydraulic conductivity (mm h2o /s) - ! - ! d qin d qin - ! qin[n+1] = qin[n] + -------- d wat(j-1) + --------- d wat(j) - ! d wat(j-1) d wat(j) - ! ==================|================= - ! < qin - ! - ! d wat(j)/dt * dz = qin[n+1] - qout[n+1] + S(j) - ! - ! > qout - ! ==================|================= - ! d qout d qout - ! qout[n+1] = qout[n] + --------- d wat(j) + --------- d wat(j+1) - ! d wat(j) d wat(j+1) - ! - ! - ! Solution: linearize k and psi about d wat and use tridiagonal - ! system of equations to solve for d wat, - ! where for layer j - ! - ! - ! r_j = a_j [d wat_j-1] + b_j [d wat_j] + c_j [d wat_j+1] - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use decompMod , only : bounds_type - use clm_varcon , only : wimp,grav,hfus,tfrz - use clm_varcon , only : e_ice,denh2o, denice - use clm_varpar , only : nlevsoi, max_patch_per_col, nlevgrnd - use clm_time_manager , only : get_step_size, get_nstep - use column_varcon , only : icol_roof, icol_road_imperv - use clm_varctl , only : use_flexibleCN, use_hydrstress - use TridiagonalMod , only : Tridiagonal - use abortutils , only : endrun - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use EnergyFluxType , only : energyflux_type - use WaterStateType , only : waterstate_type - use CanopyStateType , only : canopystate_type - use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use PatchType , only : patch - use ColumnType , only : col - use clm_varctl , only : iulog - use SoilWaterPlantSinkMod , only : COmpute_EffecRootFrac_And_VertTranSink - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(soilhydrology_type), intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(energyflux_type) , intent(in) :: energyflux_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'soilwater_zengdecker2009' ! subroutine name - integer :: p,c,fc,j ! do loop indices - integer :: jtop(bounds%begc:bounds%endc) ! top level at each column - real(r8) :: dtime ! land model time step (sec) - real(r8) :: hk(bounds%begc:bounds%endc,1:nlevsoi) ! hydraulic conductivity [mm h2o/s] - real(r8) :: dhkdw(bounds%begc:bounds%endc,1:nlevsoi) ! d(hk)/d(vol_liq) - real(r8) :: amx(bounds%begc:bounds%endc,1:nlevsoi+1) ! "a" left off diagonal of tridiagonal matrix - real(r8) :: bmx(bounds%begc:bounds%endc,1:nlevsoi+1) ! "b" diagonal column for tridiagonal matrix - real(r8) :: cmx(bounds%begc:bounds%endc,1:nlevsoi+1) ! "c" right off diagonal tridiagonal matrix - real(r8) :: rmx(bounds%begc:bounds%endc,1:nlevsoi+1) ! "r" forcing term of tridiagonal matrix - real(r8) :: zmm(bounds%begc:bounds%endc,1:nlevsoi+1) ! layer depth [mm] - real(r8) :: dzmm(bounds%begc:bounds%endc,1:nlevsoi+1) ! layer thickness [mm] - real(r8) :: den ! used in calculating qin, qout - real(r8) :: dqidw0(bounds%begc:bounds%endc,1:nlevsoi+1) ! d(qin)/d(vol_liq(i-1)) - real(r8) :: dqidw1(bounds%begc:bounds%endc,1:nlevsoi+1) ! d(qin)/d(vol_liq(i)) - real(r8) :: dqodw1(bounds%begc:bounds%endc,1:nlevsoi+1) ! d(qout)/d(vol_liq(i)) - real(r8) :: dqodw2(bounds%begc:bounds%endc,1:nlevsoi+1) ! d(qout)/d(vol_liq(i+1)) - real(r8) :: dsmpdw(bounds%begc:bounds%endc,1:nlevsoi+1) ! d(smp)/d(vol_liq) - real(r8) :: num ! used in calculating qin, qout - real(r8) :: qin(bounds%begc:bounds%endc,1:nlevsoi+1) ! flux of water into soil layer [mm h2o/s] - real(r8) :: qout(bounds%begc:bounds%endc,1:nlevsoi+1) ! flux of water out of soil layer [mm h2o/s] - real(r8) :: s_node ! soil wetness - real(r8) :: s1 ! "s" at interface of layer - real(r8) :: s2 ! k*s**(2b+2) - real(r8) :: smp(bounds%begc:bounds%endc,1:nlevsoi) ! soil matrix potential [mm] - real(r8) :: sdamp ! extrapolates soiwat dependence of evaporation - integer :: pi ! patch index - real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting - integer :: jwt(bounds%begc:bounds%endc) ! index of the soil layer right above the water table (-) - real(r8) :: smp1,dsmpdw1,wh,wh_zwt,ka - real(r8) :: dwat2(bounds%begc:bounds%endc,1:nlevsoi+1) - real(r8) :: dzq ! used in calculating qin, qout (difference in equilbirium matric potential) - real(r8) :: zimm(bounds%begc:bounds%endc,0:nlevsoi) ! layer interface depth [mm] - real(r8) :: zq(bounds%begc:bounds%endc,1:nlevsoi+1) ! equilibrium matric potential for each layer [mm] - real(r8) :: vol_eq(bounds%begc:bounds%endc,1:nlevsoi+1) ! equilibrium volumetric water content - real(r8) :: tempi ! temp variable for calculating vol_eq - real(r8) :: temp0 ! temp variable for calculating vol_eq - real(r8) :: voleq1 ! temp variable for calculating vol_eq - real(r8) :: zwtmm(bounds%begc:bounds%endc) ! water table depth [mm] - real(r8) :: imped(bounds%begc:bounds%endc,1:nlevsoi) - real(r8) :: vol_ice(bounds%begc:bounds%endc,1:nlevsoi) - real(r8) :: z_mid - real(r8) :: vwc_zwt(bounds%begc:bounds%endc) - real(r8) :: vwc_liq(bounds%begc:bounds%endc,1:nlevsoi+1) ! liquid volumetric water content - real(r8) :: smp_grad(bounds%begc:bounds%endc,1:nlevsoi+1) - real(r8) :: dsmpds !temporary variable - real(r8) :: dhkds !temporary variable - real(r8) :: hktmp !temporary variable - integer :: nstep - !----------------------------------------------------------------------- - - associate(& - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - origflag => soilhydrology_inst%origflag , & ! Input: constant - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - fracice => soilhydrology_inst%fracice_col , & ! Input: [real(r8) (:,:) ] fractional impermeability (-) - icefrac => soilhydrology_inst%icefrac_col , & ! Input: [real(r8) (:,:) ] fraction of ice - hkdepth => soilhydrology_inst%hkdepth_col , & ! Input: [real(r8) (:) ] decay factor (m) - - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - hksat => soilstate_inst%hksat_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice water (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - - qflx_deficit => waterflux_inst%qflx_deficit_col , & ! Input: [real(r8) (:) ] water deficit to keep non-negative liquid water content - qflx_infl => waterflux_inst%qflx_infl_col , & ! Input: [real(r8) (:) ] infiltration (mm H2O /s) - - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:,:) ] vegetation/soil water exchange (mm H2O/s) (+ = to atm) - qflx_tran_veg_col => waterflux_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - rootr_col => soilstate_inst%rootr_col , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - ) - - ! Get time step - - nstep = get_nstep() - dtime = get_step_size() - - - ! Because the depths in this routine are in mm, use local - ! variable arrays instead of pointers - - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zmm(c,j) = z(c,j)*1.e3_r8 - dzmm(c,j) = dz(c,j)*1.e3_r8 - zimm(c,j) = zi(c,j)*1.e3_r8 - - ! calculate icefrac up here - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - icefrac(c,j) = min(1._r8,vol_ice(c,j)/watsat(c,j)) - vwc_liq(c,j) = max(h2osoi_liq(c,j),1.0e-6_r8)/(dz(c,j)*denh2o) - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zimm(c,0) = 0.0_r8 - zwtmm(c) = zwt(c)*1.e3_r8 - end do - - ! compute jwt index - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - ! allow jwt to equal zero when zwt is in top layer - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - - ! compute vwc at water table depth (mainly for case when t < tfrz) - ! this will only be used when zwt is below the soil column - vwc_zwt(c) = watsat(c,nlevsoi) - if(t_soisno(c,jwt(c)+1) < tfrz) then - vwc_zwt(c) = vwc_liq(c,nlevsoi) - do j = nlevsoi,nlevgrnd - if(zwt(c) <= zi(c,j)) then - smp1 = hfus*(tfrz-t_soisno(c,j))/(grav*t_soisno(c,j)) * 1000._r8 !(mm) - !smp1 = max(0._r8,smp1) - smp1 = max(sucsat(c,nlevsoi),smp1) - vwc_zwt(c) = watsat(c,nlevsoi)*(smp1/sucsat(c,nlevsoi))**(-1._r8/bsw(c,nlevsoi)) - ! for temperatures close to tfrz, limit vwc to total water content - vwc_zwt(c) = min(vwc_zwt(c), 0.5*(watsat(c,nlevsoi) + h2osoi_vol(c,nlevsoi)) ) - exit - endif - enddo - endif - end do - - ! calculate the equilibrium water content based on the water table depth - - do j=1,nlevsoi - do fc=1, num_hydrologyc - c = filter_hydrologyc(fc) - if ((zwtmm(c) <= zimm(c,j-1))) then - vol_eq(c,j) = watsat(c,j) - - ! use the weighted average from the saturated part (depth > wtd) and the equilibrium solution for the - ! rest of the layer, the equilibrium solution is based on Clapp-Hornberg parameterization - ! and no extension to full range swrc is needed - - else if ((zwtmm(c) .lt. zimm(c,j)) .and. (zwtmm(c) .gt. zimm(c,j-1))) then - tempi = 1.0_r8 - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j-1))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - voleq1 = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zwtmm(c)-zimm(c,j-1))*(tempi-temp0) - vol_eq(c,j) = (voleq1*(zwtmm(c)-zimm(c,j-1)) + watsat(c,j)*(zimm(c,j)-zwtmm(c)))/(zimm(c,j)-zimm(c,j-1)) - vol_eq(c,j) = min(watsat(c,j),vol_eq(c,j)) - vol_eq(c,j) = max(vol_eq(c,j),0.0_r8) - else - tempi = (((sucsat(c,j)+zwtmm(c)-zimm(c,j))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j-1))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - vol_eq(c,j) = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zimm(c,j)-zimm(c,j-1))*(tempi-temp0) - vol_eq(c,j) = max(vol_eq(c,j),0.0_r8) - vol_eq(c,j) = min(watsat(c,j),vol_eq(c,j)) - endif - zq(c,j) = -sucsat(c,j)*(max(vol_eq(c,j)/watsat(c,j),0.01_r8))**(-bsw(c,j)) - zq(c,j) = max(smpmin(c), zq(c,j)) - end do - end do - - ! If water table is below soil column calculate zq for the 11th layer - j = nlevsoi - do fc=1, num_hydrologyc - c = filter_hydrologyc(fc) - if(jwt(c) == nlevsoi) then - tempi = 1._r8 - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - vol_eq(c,j+1) = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zwtmm(c)-zimm(c,j))*(tempi-temp0) - vol_eq(c,j+1) = max(vol_eq(c,j+1),0.0_r8) - vol_eq(c,j+1) = min(watsat(c,j),vol_eq(c,j+1)) - zq(c,j+1) = -sucsat(c,j)*(max(vol_eq(c,j+1)/watsat(c,j),0.01_r8))**(-bsw(c,j)) - zq(c,j+1) = max(smpmin(c), zq(c,j+1)) - end if - end do - - ! Hydraulic conductivity and soil matric potential and their derivatives - - sdamp = 0._r8 - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - ! compute hydraulic conductivity based on liquid water content only - - if (origflag == 1) then - s1 = 0.5_r8*(h2osoi_vol(c,j) + h2osoi_vol(c,min(nlevsoi, j+1))) / & - (0.5_r8*(watsat(c,j)+watsat(c,min(nlevsoi, j+1)))) - else - s1 = 0.5_r8*(vwc_liq(c,j) + vwc_liq(c,min(nlevsoi, j+1))) / & - (0.5_r8*(watsat(c,j)+watsat(c,min(nlevsoi, j+1)))) - endif - s1 = min(1._r8, s1) - s2 = hksat(c,j)*s1**(2._r8*bsw(c,j)+2._r8) - - ! replace fracice with impedance factor, as in zhao 97,99 - if (origflag == 1) then - imped(c,j)=(1._r8-0.5_r8*(fracice(c,j)+fracice(c,min(nlevsoi, j+1)))) - else - imped(c,j)=10._r8**(-e_ice*(0.5_r8*(icefrac(c,j)+icefrac(c,min(nlevsoi, j+1))))) - endif - hk(c,j) = imped(c,j)*s1*s2 - dhkdw(c,j) = imped(c,j)*(2._r8*bsw(c,j)+3._r8)*s2* & - (1._r8/(watsat(c,j)+watsat(c,min(nlevsoi, j+1)))) - - !compute un-restricted hydraulic conductivity - !call soil_water_retention_curve%soil_hk(hksat(c,j), imped(c,j), s1, bsw(c,j), hktmp, dhkds) - !if(hktmp/=hk(c,j))write(10,*)'diff',hktmp,hk(c,j) - ! call endrun('bad in hk') - !endif - !apply ice impedance - !hk(c,j) = imped(c,j)*hk(c,j) - !dhkdw(c,j) = imped(c,j) * dhkds * (1._r8/(watsat(c,j)+watsat(c,min(nlevsoi, j+1)))) - - - ! compute matric potential and derivative based on liquid water content only - if (origflag == 1) then - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - else - s_node = max(vwc_liq(c,j)/watsat(c,j), 0.01_r8) - endif - s_node = min(1.0_r8, s_node) - - !call soil_water_retention_curve%soil_suction(sucsat(c,j), s_node, bsw(c,j), smp(c,j), dsmpds) - - smp(c,j) = -sucsat(c,j)*s_node**(-bsw(c,j)) - smp(c,j) = max(smpmin(c), smp(c,j)) - !do not turn on the line below, which will cause bit to bit error, jyt, 2014 Mar 6 - !dsmpdw(c,j) = dsmpds/watsat(c,j) - - if (origflag == 1) then - dsmpdw(c,j) = -bsw(c,j)*smp(c,j)/(s_node*watsat(c,j)) - else - dsmpdw(c,j) = -bsw(c,j)*smp(c,j)/vwc_liq(c,j) - endif - - smp_l(c,j) = smp(c,j) - hk_l(c,j) = hk(c,j) - - end do - end do - - ! aquifer (11th) layer - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zmm(c,nlevsoi+1) = 0.5*(1.e3_r8*zwt(c) + zmm(c,nlevsoi)) - if(jwt(c) < nlevsoi) then - dzmm(c,nlevsoi+1) = dzmm(c,nlevsoi) - else - dzmm(c,nlevsoi+1) = (1.e3_r8*zwt(c) - zmm(c,nlevsoi)) - end if - end do - - ! Set up r, a, b, and c vectors for tridiagonal solution - - ! Node j=1 (top) - - j = 1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qin(c,j) = qflx_infl(c) - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp(c,j+1)-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw(c,j+1) + num*dhkdw(c,j))/den - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_rootsoi_col(c,j) - amx(c,j) = 0._r8 - bmx(c,j) = dzmm(c,j)*(sdamp+1._r8/dtime) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - - end do - - ! Nodes j=2 to j=nlevsoi-1 - - do j = 2, nlevsoi - 1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp(c,j+1)-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw(c,j+1) + num*dhkdw(c,j))/den - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_rootsoi_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - - end do - end do - - ! Node j=nlevsoi (bottom) - - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if(j > jwt(c)) then !water table is in soil column - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - qout(c,j) = 0._r8 - dqodw1(c,j) = 0._r8 - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_rootsoi_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = 0._r8 - - ! next set up aquifer layer; hydrologically inactive - rmx(c,j+1) = 0._r8 - amx(c,j+1) = 0._r8 - bmx(c,j+1) = dzmm(c,j+1)/dtime - cmx(c,j+1) = 0._r8 - else ! water table is below soil column - - ! compute aquifer soil moisture as average of layer 10 and saturation - if(origflag == 1) then - s_node = max(0.5*(1.0_r8+h2osoi_vol(c,j)/watsat(c,j)), 0.01_r8) - else - s_node = max(0.5*((vwc_zwt(c)+vwc_liq(c,j))/watsat(c,j)), 0.01_r8) - endif - s_node = min(1.0_r8, s_node) - - ! compute smp for aquifer layer - !call soil_water_retention_curve%soil_suction(sucsat(c,j), s_node, bsw(c,j), smp1, dsmpds) - smp1 = -sucsat(c,j)*s_node**(-bsw(c,j)) - smp1 = max(smpmin(c), smp1) - - ! compute dsmpdw for aquifer layer - !dsmpdw1 = dsmpds/watsat(c,j) - dsmpdw1 = -bsw(c,j)*smp1/(s_node*watsat(c,j)) - - ! first set up bottom layer of soil column - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp1-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw1 + num*dhkdw(c,j))/den - - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_rootsoi_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - - ! next set up aquifer layer; den/num unchanged, qin=qout - qin(c,j+1) = qout(c,j) - dqidw0(c,j+1) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqidw1(c,j+1) = -( hk(c,j)*dsmpdw1 + num*dhkdw(c,j))/den - qout(c,j+1) = 0._r8 ! zero-flow bottom boundary condition - dqodw1(c,j+1) = 0._r8 ! zero-flow bottom boundary condition - rmx(c,j+1) = qin(c,j+1) - qout(c,j+1) - amx(c,j+1) = -dqidw0(c,j+1) - bmx(c,j+1) = dzmm(c,j+1)/dtime - dqidw1(c,j+1) + dqodw1(c,j+1) - cmx(c,j+1) = 0._r8 - endif - end do - - ! Solve for dwat - - jtop(bounds%begc : bounds%endc) = 1 - call Tridiagonal(bounds, 1, nlevsoi+1, & - jtop(bounds%begc:bounds%endc), & - num_hydrologyc, filter_hydrologyc, & - amx(bounds%begc:bounds%endc, :), & - bmx(bounds%begc:bounds%endc, :), & - cmx(bounds%begc:bounds%endc, :), & - rmx(bounds%begc:bounds%endc, :), & - dwat2(bounds%begc:bounds%endc, :) ) - - ! Renew the mass of liquid water - ! also compute qcharge from dwat in aquifer layer - ! update in drainage for case jwt < nlevsoi - - do fc = 1,num_hydrologyc - c = filter_hydrologyc(fc) - - do j = 1, nlevsoi - h2osoi_liq(c,j) = h2osoi_liq(c,j) + dwat2(c,j)*dzmm(c,j) - end do - - ! calculate qcharge for case jwt < nlevsoi - if(jwt(c) < nlevsoi) then - wh_zwt = 0._r8 !since wh_zwt = -sucsat - zq_zwt, where zq_zwt = -sucsat - - ! Recharge rate qcharge to groundwater (positive to aquifer) - s_node = max(h2osoi_vol(c,jwt(c)+1)/watsat(c,jwt(c)+1), 0.01_r8) - s1 = min(1._r8, s_node) - - !scs: this is the expression for unsaturated hk - ka = imped(c,jwt(c)+1)*hksat(c,jwt(c)+1) & - *s1**(2._r8*bsw(c,jwt(c)+1)+3._r8) - - !compute unsaturated hk, this shall be tested later, because it - !is not bit for bit - !call soil_water_retention_curve%soil_hk(hksat(c,jwt(c)+1), s1, bsw(c,jwt(c)+1), ka) - !apply ice impedance - !ka = imped(c,jwt(c)+1) * ka - ! Recharge rate qcharge to groundwater (positive to aquifer) - smp1 = max(smpmin(c), smp(c,max(1,jwt(c)))) - wh = smp1 - zq(c,max(1,jwt(c))) - - !scs: original formulation - if(jwt(c) == 0) then - qcharge(c) = -ka * (wh_zwt-wh) /((zwt(c)+1.e-3)*1000._r8) - else - ! qcharge(c) = -ka * (wh_zwt-wh)/((zwt(c)-z(c,jwt(c)))*1000._r8) - !scs: 1/2, assuming flux is at zwt interface, saturation deeper than zwt - qcharge(c) = -ka * (wh_zwt-wh)/((zwt(c)-z(c,jwt(c)))*1000._r8*2.0) - endif - - ! To limit qcharge (for the first several timesteps) - qcharge(c) = max(-10.0_r8/dtime,qcharge(c)) - qcharge(c) = min( 10.0_r8/dtime,qcharge(c)) - else - ! if water table is below soil column, compute qcharge from dwat2(11) - qcharge(c) = dwat2(c,nlevsoi+1)*dzmm(c,nlevsoi+1)/dtime - endif - end do - - ! compute the water deficit and reset negative liquid water content - ! Jinyun Tang - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_deficit(c) = 0._r8 - do j = 1, nlevsoi - if(h2osoi_liq(c,j)<0._r8)then - qflx_deficit(c) = qflx_deficit(c) - h2osoi_liq(c,j) - endif - enddo - enddo - - end associate - - end subroutine soilwater_zengdecker2009 - -!#7 -!----------------------------------------------------------------------- - subroutine soilwater_moisture_form(bounds, num_hydrologyc, & - filter_hydrologyc, num_urbanc, filter_urbanc, soilhydrology_inst, & - soilstate_inst, waterflux_inst, waterstate_inst, temperature_inst, & - canopystate_inst, energyflux_inst, soil_water_retention_curve) - ! - ! !DESCRIPTION: - ! Soil hydrology - ! Soil moisture is predicted from a n-layer model (as with soil - ! temperature), in which the vertical soil moisture transport is governed - ! by infiltration, runoff, gradient diffusion, gravity, and root - ! extraction through canopy transpiration. The net water applied to the - ! surface layer is the snowmelt plus precipitation plus the throughfall - ! of canopy dew minus surface runoff and evaporation. - ! - ! Options are included for head conditions at the upper and lower boundary, - ! a flux boundary condition at the upper boundary, and a free drainage - ! condition - ! at the lower boundary - ! - ! The vertical water flow in an unsaturated porous media is described by - ! Darcy's law, and the hydraulic conductivity and the soil negative - ! potential vary with soil water content and soil texture based on the work - ! of van Genuchten (1980). The equation is integrated over the layer - ! thickness, - ! in which the time rate of change in water mass must equal the net flow - ! across - ! the bounding interface, plus the rate of internal source or sink. The - ! terms of - ! water flow across the layer interfaces are linearly expanded by using - ! first-order Taylor expansion. The equations result in a tridiagonal system - ! equation. - ! - ! Note: length units here are all millimeter - ! (in temperature subroutine uses same soil layer - ! structure required but lengths are m) - ! - ! Richards equation: - ! - ! d wat d d wat d psi - ! ----- = - -- [ k(----- ----- - 1) ] + S - ! dt dz dz d wat - ! - ! where: wat = volume of water per volume of soil (mm**3/mm**3) - ! psi = soil matrix potential (mm) - ! dt = time step (s) - ! z = depth (mm) - ! dz = thickness (mm) - ! qin = inflow at top (mm h2o /s) - ! qout= outflow at bottom (mm h2o /s) - ! s = source/sink flux (mm h2o /s) - ! k = hydraulic conductivity (mm h2o /s) - ! - ! d qin d qin - ! qin[n+1] = qin[n] + -------- d wat(j-1) + --------- d wat(j) - ! d wat(j-1) d wat(j) - ! ==================|================= - ! < qin - ! - ! d wat(j)/dt * dz = qin[n+1] - qout[n+1] + S(j) - ! - ! > qout - ! ==================|================= - ! d qout d qout - ! qout[n+1] = qout[n] + --------- d wat(j) + --------- d wat(j+1) - ! d wat(j) d wat(j+1) - ! - ! - ! Solution: linearize k and psi about d wat and use tridiagonal - ! system of equations to solve for d wat, - ! system of equations to solve for d wat, - ! where for layer j - ! - ! - ! r_j = a_j [d wat_j-1] + b_j [d wat_j] + c_j [d wat_j+1] - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE,SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varctl , only : iulog, use_hydrstress - use clm_varcon , only : denh2o, denice - use clm_varpar , only : nlevsoi - use clm_time_manager , only : get_step_size, get_nstep - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use WaterStateType , only : waterstate_type - use EnergyFluxType , only : energyflux_type - use CanopyStateType , only : canopystate_type - use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use PatchType , only : patch - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - type(soilhydrology_type), intent(inout) :: soilhydrology_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - - ! !LOCAL VARIABLES: - integer :: nstep - integer :: nlayers - integer :: p,c,fc,j ! do loop indices - integer :: jtop ! top level at each column - real(r8) :: dtime ! land model time step (sec) - real(r8) :: hk(bounds%begc:bounds%endc,1:nlevsoi) ! hydraulic conductivity [mm h2o/s] - real(r8) :: smp(bounds%begc:bounds%endc,1:nlevsoi) ! soil matrix potential [mm] - real(r8) :: dhkdw(bounds%begc:bounds%endc,1:nlevsoi) ! d(hk)/d(vol_liq) - real(r8) :: dsmpdw(bounds%begc:bounds%endc,1:nlevsoi) ! d(smp)/d(vol_liq) - real(r8) :: imped(bounds%begc:bounds%endc,1:nlevsoi) - real(r8) :: rmx_save(bounds%begc:bounds%endc,1:nlevsoi) ! residual vector - real(r8) :: vwc_save(bounds%begc:bounds%endc,1:nlevsoi) ! liquid volumetric water content - real(r8) :: rhs(1:nlevsoi) ! RHS vector for input to lapack - - real(r8) :: vwc_liq(bounds%begc:bounds%endc,1:nlevsoi) ! liquid volumetric water content - real(r8) :: dt_dz(bounds%begc:bounds%endc,1:nlevsoi) !temporary variable - real(r8) :: qin(bounds%begc:bounds%endc,1:nlevsoi) ! flux of water into soil layer [mm h2o/s] - real(r8) :: qout(bounds%begc:bounds%endc,1:nlevsoi) ! flux of water out of soil layer [mm h2o/s] - real(r8) :: dqidw0(bounds%begc:bounds%endc,1:nlevsoi) ! d(qin)/d(vol_liq(i-1)) - real(r8) :: dqidw1(bounds%begc:bounds%endc,1:nlevsoi) ! d(qin)/d(vol_liq(i)) - real(r8) :: dqodw1(bounds%begc:bounds%endc,1:nlevsoi) ! d(qout)/d(vol_liq(i)) - real(r8) :: dqodw2(bounds%begc:bounds%endc,1:nlevsoi) ! d(qout)/d(vol_liq(i+1)) - real(r8) :: dwat(bounds%begc:bounds%endc,1:nlevsoi) - real(r8) :: amx(bounds%begc:bounds%endc,1:nlevsoi) ! "a" left off diagonal of tridiagonal matrix - real(r8) :: bmx(bounds%begc:bounds%endc,1:nlevsoi) ! "b" diagonal column for tridiagonal matrix - real(r8) :: cmx(bounds%begc:bounds%endc,1:nlevsoi) ! "c" right off diagonal tridiagonal matrix - real(r8) :: rmx(bounds%begc:bounds%endc,1:nlevsoi) ! "r" forcing term of tridiagonal matrix - real(r8) :: dLow(1:nlevsoi-1) ! lower diagonal vector - real(r8) :: dUpp(1:nlevsoi-1) ! upper diagonal vector - real(r8) :: diag(1:nlevsoi) ! diagonal vector - integer :: err ! error code from the lapack routines - character(len=32) :: subname = 'soilwater_moisture_form' ! subroutine name - integer,parameter :: soil_hydraulic_properties_method = 0 ! 0 for CH78 - integer,parameter :: ice_impedance_method = 1 ! 1 for power form - integer,parameter :: lapack=1 - integer,parameter :: clmOrig=2 -! integer,parameter :: tridiagSolution=clmOrig - integer,parameter :: tridiagSolution=lapack - - integer :: nSubstep ! substep index - real(r8) :: dtsub ! length of the substep (seconds) - real(r8) :: dtdone ! substep completed (seconds) -!!$ real(r8),parameter :: dtmin=60._r8 ! minimum time step length (seconds) -!!$ real(r8),parameter :: verySmall=1.e-8_r8 ! a very small number: used to check for sub step completion -!!$ real(r8),parameter :: xTolerUpper=1.e-1_r8 ! tolerance to halve length of substep -!!$ real(r8),parameter :: xTolerLower=1.e-2_r8 ! tolerance to double length of substep -!!$ integer,parameter :: expensive=42 -!!$ integer,parameter :: inexpensive=1 -!!$ integer,parameter :: flux_calculation=inexpensive ! used to calculate first order taylor series approximation of the net flux - real(r8) :: qin_test,qout_test ! fluxes into and out of each layer - real(r8) :: fluxNet0(1:nlevsoi) ! net flux in each layer based on the first order taylor series approximation - real(r8) :: fluxNet1(1:nlevsoi) ! net flux in each layer based on the flux at the start of the substep - real(r8) :: errorVec(1:nlevsoi) ! error vector - real(r8) :: errorMax(1) ! max error - real(r8) :: qcTemp ! drainage flux for a given substep - -! temporarily use local variables for the following - real(r8) :: vwc_liq_ub(bounds%begc:bounds%endc) ! liquid volumetric water content at upper boundary - real(r8) :: vwc_liq_lb(bounds%begc:bounds%endc) ! liquid volumetric water content at lower boundary - real(r8) :: vLiqIter(bounds%begc:bounds%endc,1:nlevsoi) ! iteration increment for the volumetric liquid water content (v/v) - real(r8) :: vLiqRes(bounds%begc:bounds%endc,1:nlevsoi) ! residual for the volumetric liquid water content (v/v) - - real(r8) :: dwat_temp - !----------------------------------------------------------------------- - - associate(& - nbedrock => col%nbedrock , & ! Input: [real(r8) (:,:) ] depth to bedrock (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - - nsubsteps => soilhydrology_inst%num_substeps_col, & ! Input: [real(r8) (:) ] adaptive timestep counter - - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - hk_l => soilstate_inst%hk_l_col , & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice water (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col & - ) ! end associate statement - - ! Get time step - - nstep = get_nstep() - dtime = get_step_size() - - ! main spatial loop - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! set number of layers over which to solve soilwater movement - nlayers = nbedrock(c) - - dwat_temp = 0. - - ! initialize the number of substeps - nsubstep=0 - - ! initialize substeps - dtsub = dtime ! length of the substep - dtdone = 0._r8 ! substep completed - - ! initialize qcharge - qcharge(c) = 0._r8 - - ! adaptive sub-step loop - do ! continuous do loop with exit clause - - ! keep track of the number of trials - nsubstep=nsubstep+1 - - ! calculate commonly used variables - do j = 1, nlayers - vwc_liq(c,j) = max(h2osoi_liq(c,j),1.0e-6_r8)/(dz(c,j)*denh2o) - dt_dz(c,j) = dtsub/(m_to_mm * dz(c,j)) - end do - - ! Hydraulic conductivity and soil matric potential and their derivatives - call compute_hydraulic_properties(c, nlayers, & - soilhydrology_inst, soilstate_inst, & - soil_water_retention_curve, vwc_liq(c,1:nlayers), & - hk(c,1:nlayers) ,smp(c,1:nlayers), & - dhkdw(c,1:nlayers), dsmpdw(c,1:nlayers), & - imped(c,1:nlayers)) - - ! Soil moisture fluxes and their derivatives - call compute_moisture_fluxes_and_derivs(c, nlayers, & - soilhydrology_inst, soilstate_inst, & - temperature_inst, waterflux_inst, & - soil_water_retention_curve, & - vwc_liq(c,1:nlayers), & - hk(c,1:nlayers), & - smp(c,1:nlayers), & - dhkdw(c,1:nlayers), & - dsmpdw(c,1:nlayers), & - imped(c,1:nlayers), & - qin(c,1:nlayers), & - qout(c,1:nlayers), & - dqidw0(c,1:nlayers), & - dqidw1(c,1:nlayers), & - dqodw1(c,1:nlayers), & - dqodw2(c,1:nlayers)) - - ! RHS of system of equations - call compute_RHS_moisture_form(c, nlayers, & - qflx_rootsoi_col(c,1:nlayers), & - vwc_liq(c,1:nlayers), & - qin(c,1:nlayers), & - qout(c,1:nlayers), & - dt_dz(c,1:nlayers), & - rmx(c,1:nlayers)) - - ! LHS of system of equations - call compute_LHS_moisture_form(c, nlayers, & - soilhydrology_inst, & - dt_dz(c,1:nlayers), & - dqidw0(c,1:nlayers), & - dqidw1(c,1:nlayers), & - dqodw1(c,1:nlayers), & - dqodw2(c,1:nlayers), & - amx(c,1:nlayers), & - bmx(c,1:nlayers), & - cmx(c,1:nlayers)) - - ! solve A.X=B (done above, but using lapack as a test) - - ! solve tridiagonal matrix using the original clm solution - if(tridiagSolution==clmOrig)then - - ! Solve for dwat - - jtop = 1 - call TridiagonalCol(c, 1, nlayers, & - jtop, & - !num_hydrologyc, filter_hydrologyc, & - amx(c, 1:nlayers), & - bmx(c, 1:nlayers), & - cmx(c, 1:nlayers), & - rmx(c, 1:nlayers), & - dwat(c, 1:nlayers) ) - - ! solve tridiagonal matrix using the lapack solution - else - - ! NOTE: check for efficiency gains by passing vectors directly (no - ! copy); however, intent(inout) - - ! get a copy of the input vectors - dLow(1:nlayers-1) = amx(filter_hydrologyc(fc),2:nlayers) - diag(1:nlayers) = bmx(filter_hydrologyc(fc),1:nlayers) - dUpp(1:nlayers-1) = cmx(filter_hydrologyc(fc),1:nlayers-1) - - ! get a copy of the residual vector - rhs(1:nlayers) = rmx(filter_hydrologyc(fc),1:nlayers) - - ! call the lapack tri-diagonal solver - call dgtsv(nlayers, & ! intent(in): [integer] number of state variables - 1, & ! intent(in): [integer] number of columns of the matrix B - dLow, & ! intent(inout): [r8(nlayers-1)] sub-diagonal elements of A - diag, & ! intent(inout): [r8(nlayers )] diagonal elements of A - dUpp, & ! intent(inout): [r8(nlayers-1)] super-diagonal elements of A - rhs, & ! intent(inout): [r8(nlayers )] RHS vector; becomes the solution vector on output - nlayers, & ! intent(in): [integer] the leading dimension of matrix rhs - err) - if(err/=0) call endrun(subname // ':: problem with the lapack solver') - - ! save the iteration increment - dwat(filter_hydrologyc(fc),1:nlayers) = rhs(1:nlayers) - - endif ! solution method for the tridiagonal solution - - ! ********** - ! error estimation segment - ! (could be a separate subroutine) - - fluxNet1(1:nlevsoi) = 0._r8 - fluxNet0(1:nlevsoi) = 0._r8 - - ! estimate errors for each layer - do j = 1, nLayers - - ! compute the net flux using the first order taylor series approximation - - ! different options just for clarity - ! NOTE: we would never use the expensive option; just helps clarify what is happenning - if(flux_calculation==expensive)then - - ! compute influx (mm s-1) - if(j==1) then; qin_test = qin(c,j) + dqidw1(c,j)*dwat(c,j) ! upper layer - else; qin_test = qin(c,j) + dqidw0(c,j)*dwat(c,j-1) + dqidw1(c,j)*dwat(c,j) - endif - - ! compute outflux (mm s-1) - if(j==nLayers)then; qout_test = qout(c,j) + dqodw1(c,j)*dwat(c,j) ! lower layer - else; qout_test = qout(c,j) + dqodw1(c,j)*dwat(c,j) + dqodw2(c,j)*dwat(c,j+1) - endif - - ! compute the net flux - fluxNet0(j) = qin_test - qout_test - qflx_rootsoi_col(c,j) - - ! flux calculation is inexpensive - else - - ! convert iteration increment to a net flux (mm s-1) - fluxNet0(j) = dwat(c,j)/dt_dz(c,j) - - endif ! switch between the expensive and inexpensive fluxcalculations - - ! compute the net flux at the start of the sub-step - fluxNet1(j) = qin(c,j) - qout(c,j) - qflx_rootsoi_col(c,j) - - end do ! looping through layers - - ! compute absolute errors - errorVec(:nlayers) = abs(fluxNet1(:nlayers) - fluxNet0(:nlayers))*dtsub*0.5_r8 - errorMax = maxval(errorVec(:nlayers)) - - ! check if the error is above the upper tolerance - if(errorMax(1) > xTolerUpper .and. dtsub > dtmin)then - dtsub = max(dtsub/2._r8, dtmin) ! halve the length of the sub-step - cycle ! sub-step rejected; try again - endif - - - ! end of error estimation segment - ! ********** - - ! Renew the mass of liquid water - do j = 1, nlayers - h2osoi_liq(c,j) = h2osoi_liq(c,j) + dwat(c,j) * (m_to_mm * dz(c,j)) - end do - - ! compute drainage from the bottom of the soil column - select case(lower_boundary_condition) - - ! flux boundary condition - case(bc_flux) - qcTemp = hk(c,nlayers) + dhkdw(c,nlayers)*dwat(c,nlayers) - - ! zero flux lower boundary - case(bc_zero_flux) - qcTemp = 0._r8 - - ! coupling with a water table - case(bc_waterTable) - qcTemp = qout(c,nlayers) + dqodw1(c,nlayers)*dwat(c,nlayers) - - case default - call endrun(subname // ':: the lower boundary condition must be specified!') - - end select ! case for the lower boundary condition - - ! increment the qcharge flux - qcharge(c) = qcharge(c) + qcTemp *(dtsub / dtime) - - ! increment substep and check for completion of the substep - dtdone = dtdone + dtsub - if(abs(dtime - dtdone) < verySmall) exit ! time step completed so exit the do loop - - ! check if the error is below the lower tolerance - if(errorMax(1) < xTolerLower)then - dtsub = dtsub*2._r8 - endif - - ! ensure that the substep does not exceed the time remaining - dtsub = min(dtsub, dtime - dtdone) - - end do ! substep loop - -! save number of adaptive substeps used during time step - nsubsteps(c) = nsubstep - -! check for negative moisture values - do j = 2, nlayers - if(h2osoi_liq(c,j) < -1e-6_r8) then - write(*,*) 'layer, h2osoi_liq: ', c,j,h2osoi_liq(c,j) - ! call endrun(subname // ':: negative soil moisture values found!') - endif - end do - - end do ! spatial loop - - -! calculate qcharge when water table is in soil column and bc_watertable - if(use_aquifer_layer()) then - ! compute flux of water to aquifer - - call compute_qcharge(bounds, & - num_hydrologyc, filter_hydrologyc, soilhydrology_inst, & - soilstate_inst, waterstate_inst, & - soil_water_retention_curve, & - dwat(bounds%begc:bounds%endc,1:nlevsoi), & - smp(bounds%begc:bounds%endc,1:nlevsoi), & - imped(bounds%begc:bounds%endc,1:nlevsoi), & - vwc_liq(bounds%begc:bounds%endc,1:nlevsoi)) - - endif - - end associate - - end subroutine soilwater_moisture_form - -!#8 -!----------------------------------------------------------------------- - subroutine compute_hydraulic_properties(c, nlayers, & - soilhydrology_inst, soilstate_inst, & - soil_water_retention_curve, vwc_liq, hk ,smp, & - dhkdw, dsmpdw, imped) - ! - ! !DESCRIPTION: - - ! Calculate soil hydraulic conductivity and matric potential - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varcon , only : e_ice - use clm_varpar , only : nlevsoi - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: c ! column index - integer , intent(in) :: nlayers ! lower boundary index - - type(soilhydrology_type), intent(in) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - real(r8), intent(in) :: vwc_liq(1:nlayers) - - real(r8), intent(out) :: hk(1:nlayers) - real(r8), intent(out) :: smp(1:nlayers) - real(r8), intent(out) :: dhkdw(1:nlayers) - real(r8), intent(out) :: dsmpdw(1:nlayers) - real(r8), intent(out) :: imped(1:nlayers) - ! - ! !LOCAL VARIABLES: - integer :: j ! do loop indices - real(r8) :: s1 ! "s" at interface of layer - real(r8) :: s2(1:nlayers) ! "s" at layer node - real(r8) :: dsmpds !temporary variable - real(r8) :: dhkds !temporary variable - character(len=32) :: subname = 'calculate_hydraulic_properties' ! subroutine name - !----------------------------------------------------------------------- - -!scs: originally, associate statements selected sections rather than -! entire arrays, but due to pgi bug, removed array section selections -! using array sections allowed consistent 1d indexing throughout - associate(& - icefrac => soilhydrology_inst%icefrac_col , & ! Input: [real(r8) (:,:) ] fraction of ice - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix potential [mm] - hk_l => soilstate_inst%hk_l_col & ! Input: [real(r8) (:,:) ] hydraulic conductivity (mm/s) - ) ! end associate statement - - hk = 0._r8 - smp = 0._r8 - dhkdw = 0._r8 - dsmpdw = 0._r8 - imped = 0._r8 - - ! Hydraulic conductivity and soil matric potential and their derivatives - - ! compute the relative saturation at each layer first b/c - ! it is used later in calculation of s1 - do j = 1, nlayers - s2(j) = vwc_liq(j)/watsat(c,j) - ! impose constraints on relative saturation at the layer node - s2(j) = min(s2(j), 1._r8) - s2(j) = max(0.01_r8, s2(j)) - enddo - - do j = 1, nlayers - ! s1 is interface value, s2 is node value - if(j==nlayers)then - s1 = s2(j) - call IceImpedance(icefrac(c,j), e_ice, imped(j) ) - else - s1 = 0.5_r8 * (s2(j) + s2(j+1)) - call IceImpedance(0.5_r8*(icefrac(c,j) + icefrac(c,j+1)), e_ice, imped(j) ) - endif - - ! impose constraints on relative saturation at the layer interface - s1 = min(s1, 1._r8) - s1 = max(0.01_r8, s1) - - call soil_water_retention_curve%soil_hk(c, j, s1, & - imped(j), soilstate_inst, hk(j), dhkds=dhkds) - - call soil_water_retention_curve%soil_suction(c, j, s2(j), & - soilstate_inst,smp(j), dsmpds=dsmpds) - - - ! NOTE: here just save derivative in hydraulic conductivity - ! w.r.t relative raturation at the layer interface - ! --> the derivatives at the nodes are calculated - ! in compute_moisture_fluxes_and_derivs - dhkdw(j) = dhkds ! NOTE: the variable name does not make sense - - ! compute derivative w.r.t. volumetric liquid water content - ! NOTE: derivative for the layer - dsmpdw(j) = dsmpds / watsat(c,j) - - ! save for the output - smp_l(c,j) = smp(j) - hk_l(c,j) = hk(j) - - end do - - end associate - - end subroutine compute_hydraulic_properties - -!#9 -!----------------------------------------------------------------------- - subroutine compute_moisture_fluxes_and_derivs(c, nlayers, & - soilhydrology_inst, soilstate_inst, temperature_inst, waterflux_inst, & - soil_water_retention_curve, vwc_liq, hk ,smp, dhkdw, dsmpdw, & - imped, qin, qout, dqidw0, dqidw1, dqodw1, dqodw2) - ! - ! !DESCRIPTION: - - ! Calculate fluxes at the boundary of each layer and derivatives w.r.t. - ! relevant state variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varpar , only : nlevsoi - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: c ! column index - integer , intent(in) :: nlayers ! lower boundary index - - type(soilhydrology_type), intent(in) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterflux_type) , intent(in) :: waterflux_inst - - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - real(r8), intent(in) :: vwc_liq(1:nlayers) - real(r8), intent(in) :: hk(1:nlayers) - real(r8), intent(in) :: smp(1:nlayers) - real(r8), intent(in) :: dhkdw(1:nlayers) - real(r8), intent(in) :: dsmpdw(1:nlayers) - real(r8), intent(in) :: imped(1:nlayers) - - real(r8), intent(out) :: qin(1:nlayers) - real(r8), intent(out) :: qout(1:nlayers) - real(r8), intent(out) :: dqidw0(1:nlayers) - real(r8), intent(out) :: dqidw1(1:nlayers) - real(r8), intent(out) :: dqodw1(1:nlayers) - real(r8), intent(out) :: dqodw2(1:nlayers) - ! - ! !LOCAL VARIABLES: - integer :: j ! do loop indices - real(r8) :: s1 ! "s" at interface of layer - real(r8) :: s2 ! "s" at layer node - real(r8) :: smp1 !temporary variable - real(r8) :: hk1 !temporary variable - real(r8) :: num, den ! used in calculating qin, qout - real(r8) :: dhkds1, dhkds2 !temporary variable - real(r8),parameter :: m_to_mm = 1.e3_r8 !convert meters to mm -!scs: temporarily use local variables for the following - real(r8) :: vwc_liq_ub ! liquid volumetric water content at upper boundary - real(r8) :: vwc_liq_lb ! liquid volumetric water content at lower boundary - character(len=32) :: subname = 'calculate_moisture_fluxes_and_derivs' ! subroutine name - integer :: jwt !index of layer above water table - real(r8) :: dhkdw1, dsmpdw1, dsmpds1 - integer,parameter :: zdflag = 0 - !----------------------------------------------------------------------- - - associate(& - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - qflx_infl => waterflux_inst%qflx_infl_col , & ! Input: [real(r8) (:) ] infiltration (mm H2O /s) - watsat => soilstate_inst%watsat_col & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - ) ! end associate statement - - qin = 0._r8 - qout = 0._r8 - dqidw0 = 0._r8 - dqidw1 = 0._r8 - dqodw1 = 0._r8 - dqodw2 = 0._r8 - - ! Soil moisture fluxes and their derivatives - - j = 1 - - ! select type of boundary condition - select case(upper_boundary_condition) - - ! head boundary conditions - case(bc_head) - - ! compute the relative saturation at the upper boundary - s1 = vwc_liq_ub / watsat(c,j) - ! s1 = (vwc_liq_ub - watres(c,j)) / (watsat(c,j) - watres(c,j)) - s1 = min(s1, 1._r8) - s1 = max(0.01_r8, s1) - - ! compute the hydraulic conductivity and matric potential at the boundary - call soil_water_retention_curve%soil_hk(c, j, s1, & - imped(j), soilstate_inst, hk1) - - call soil_water_retention_curve%soil_suction(c, j, s1, & - soilstate_inst,smp1) - - ! compute the infiltration to the top of the layer - den = z(c,j)* m_to_mm * 0.5_r8 - qin(j) = -hk1*(smp(j) - smp1)/den + hk1 - - ! compute the flux derivative w.r.t influx - dqidw1(j) = -hk1*dsmpdw(j)/den - - ! flux boundary condition - case(bc_flux) - - ! specify infiltration - qin(j) = qflx_infl(c) - - ! compute the flux derivative w.r.t influx - dqidw1(j) = 0._r8 - - ! check the case is specified correctly - case default - - call endrun(subname // ':: the upper boundary condition must be specified!') - - end select - - ! NOTE: the rest of the code for j=1 is identical to the code for - ! the interior nodes (j=2,...,nlevsoi-1) - ! Not sure why this is split out in this way.... - - ! compute derivatives in hydraulic conductivity at the interface w.r.t. - ! volumetric liquid water content in the layer above and the layer below - ! NOTE: dhkdw(j) is the derivative in hydrualic conductivity at the - ! layer interface w.r.t relative saturation at the interface - dhkds1 = 0.5_r8 * dhkdw(j) / watsat(c,j) ! derivative w.r.t. volumetric liquid water in the upper layer - dhkds2 = 0.5_r8 * dhkdw(j) / watsat(c,j+1) ! derivative w.r.t. volumetric liquid water in the lower layer - -!scs: this is how zd is done - if (zdflag == 1) then - dhkds1 = dhkdw(j)/(watsat(c,j)+watsat(c,min(nlevsoi, j+1))) - dhkds2 = dhkds1 - endif -!scs - - ! compute flux at the bottom of the j-th layer - ! NOTE: hk(j) is hydraulic conductivity at the bottom of the j-th - ! layer - num = (smp(j+1)-smp(j)) - den = m_to_mm * (z(c,j+1)-z(c,j)) - qout(j) = -hk(j)*num/den + hk(j) - - ! compute flux derivatives - dqodw1(j) = (hk(j)*dsmpdw(j) - dhkds1*num)/den + dhkds1 - dqodw2(j) = (-hk(j)*dsmpdw(j+1) - dhkds2*num)/den + dhkds2 - - ! Interior nodes - - do j = 2, nlayers - 1 - - ! get the flux from above - qin(j) = qout(j-1) - - ! get the derivatives from above - dqidw0(j) = dqodw1(j-1) - dqidw1(j) = dqodw2(j-1) - - ! compute derivatives in hydraulic conductivity at the interface w.r.t. - ! volumetric liquid water content in the layer above and the layer below - ! NOTE: dhkdw(j) is the derivative in hydrualic conductivity at the - ! layer interface w.r.t relative saturation at the interface - dhkds1 = 0.5_r8 * dhkdw(j) / watsat(c,j) ! derivative w.r.t. volumetric liquid water in the upper layer - dhkds2 = 0.5_r8 * dhkdw(j) / watsat(c,j+1) ! derivative w.r.t. volumetric liquid water in the lower layer -!scs: this is how zd is done - if (zdflag == 1) then - dhkds1 = dhkdw(j)/(watsat(c,j)+watsat(c,min(nlevsoi, j+1))) - dhkds2 = dhkds1 - endif -!scs - - ! compute flux at the bottom of the j-th layer - ! NOTE: hk(j) is hydraulic conductivity at the bottom of the j-th layer - num = (smp(j+1)-smp(j)) - den = m_to_mm * (z(c,j+1)-z(c,j)) - qout(j) = -hk(j)*num/den + hk(j) - - ! compute flux derivatives - dqodw1(j) = (hk(j)*dsmpdw(j) - dhkds1*num)/den + dhkds1 - dqodw2(j) = (-hk(j)*dsmpdw(j+1) - dhkds2*num)/den + dhkds2 - - end do - - ! Node j=nlevsoi (bottom) - - j = nlayers - - ! get the flux from above - qin(j) = qout(j-1) - - ! get the derivatives from above - dqidw0(j) = dqodw1(j-1) - dqidw1(j) = dqodw2(j-1) - - ! select type of boundary condition - select case(lower_boundary_condition) - - ! water table boundary conditions (moving lower boundary) - case(bc_waterTable) - - jwt = nlevsoi - ! Locate index of layer above water table - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt = j-1 - exit - end if - enddo - - ! water table within soil column - j=nlevsoi - if(j > jwt) then - - ! no drainage - qout(j) = 0. - dqodw1(j) = 0. - dqodw2(j) = 0. - - ! water table below soil column - else - - ! following Niu et al. (JGR 2007), assume hydraulic conductivity at the bottom of the soil column - ! is equal to hydraulic conductivty at the lowest node. This provides a free-drainage lower boundary - ! condition when the water table is a long way below the soil column - dhkds1 = dhkdw(j) / watsat(c,j) - -!scs: this is how zd is done - if (zdflag == 1) then - dhkds1 = dhkdw(j)/(watsat(c,j)+watsat(c,min(nlevsoi, j+1))) - dhkds2 = dhkds1 - endif -!scs - ! compute flux - num = -smp(j) ! NOTE: assume saturation at water table depth (smp=0) - den = m_to_mm * (zwt(c) - z(c,j)) - qout(j) = -hk(j)*num/den + hk(j) ! using hydraulic conductivity at the midpoint of the two nodes - - ! compute derivatives - dqodw1(j) = (hk(j)*dsmpdw(j) - dhkds1*num)/den + dhkds1 - dqodw2(j) = 0._r8 ! no layer below - - endif ! switch between water table above/below soil column - - - ! head boundary conditions - case(bc_head) - - ! compute the relative saturation at the lower boundary - s1 = vwc_liq_lb / watsat(c,j) -!scs: mc's original expression s1 = (vwc_liq_lb - watres(c,j)) / (watsat(c,j) - watres(c,j)) - s1 = min(s1, 1._r8) - s1 = max(0.01_r8, s1) - - ! compute the hydraulic conductivity and matric potential at the boundary - call soil_water_retention_curve%soil_hk(c, j, s1, & - imped(j), soilstate_inst, hk1) - - call soil_water_retention_curve%soil_suction(c, j, s1, & - soilstate_inst,smp1) - - ! compute the flux at the bottom of the layer - den = m_to_mm * z(c,j) * 0.5_r8 - qout(j) = -hk1*(smp1 - smp(j))/den + hk1 - - ! compute the flux derivative - dqodw1(j) = hk1*dsmpdw(j)/den - - ! stop, because not tested yet - call endrun(subname // ':: the specified lower boundary condition is not fully implemented/tested yet') - - ! flux boundary condition - case(bc_flux) - - ! free drainage - qout(j) = hk(j) - - ! compute the flux derivative - dqodw1(j) = dhkdw(j) / watsat(c,j) - - case(bc_zero_flux) - - ! no drainage - qout(j) = 0. - - ! compute the flux derivative - dqodw1(j) = 0. - - ! check the case is specified correctly - case default - - call endrun(subname // ':: the lower boundary condition must be specified!') - - end select - - - end associate - - end subroutine compute_moisture_fluxes_and_derivs - - -!#10 -!----------------------------------------------------------------------- - subroutine compute_RHS_moisture_form(c, nlayers, vert_trans_sink, & - vwc_liq, qin, qout, dt_dz, rmx) - ! - ! !DESCRIPTION: - - ! Calculate RHS of moisture-based form of Richards equation - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varpar , only : nlevsoi - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: c ! column index - integer , intent(in) :: nlayers ! lower boundary index - - real(r8), intent(in) :: vert_trans_sink(1:nlayers) ! vertically distributed transpiration sink (mm H2O/s) (+ = to atm) - real(r8), intent(in) :: vwc_liq(1:nlayers) - real(r8), intent(in) :: qin(1:nlayers) - real(r8), intent(in) :: qout(1:nlayers) - real(r8), intent(in) :: dt_dz(1:nlayers) - real(r8), intent(out) :: rmx(1:nlayers) ! "r" forcing term of tridiagonal matrix - ! - ! !LOCAL VARIABLES: - integer :: j ! do loop indices - real(r8) :: fluxNet !temporary variable - integer,parameter :: ixIterate=1 - integer,parameter :: ixNonIterate=2 - integer :: iterateOption=ixNonIterate - character(len=32) :: subname = 'compute_RHS_moisture_form' ! subroutine name - !----------------------------------------------------------------------- - - associate(& - dz => col%dz & ! Input: [real(r8) (:,:) ] layer depth (m) - ) ! end associate statement - - rmx = 0._r8 - -! Compute RHS of moisture-based form of Richards equation - do j = 1, nlayers - - fluxNet = qin(j) - qout(j) - vert_trans_sink(j) -! rmx(j) = vwc_liq(j) - (vwc_liq(j) + fluxNet*dt_dz(j)) - - ! different options for iterative and non-iterative solutions - select case(iterateOption) - case(ixIterate) - ! for iterative solution entire soil hydrology routine should be - ! called multiple times using updated versions of vwc_trial - ! vwc_trial = wwc_liq for iteration=1 - !rmx(j) = vwc_trial(j) - (vwc_liq(j) + fluxNet*dt_dz(j)) - call endrun(subname // ':: ERROR iterative option not yet implemented') - case(ixNonIterate) - rmx(j) = -fluxNet*dt_dz(j) - case default - call endrun(subname // ':: ERROR unknown iterate option') - end select - - end do - - end associate - - end subroutine compute_RHS_moisture_form - -!#11 -!----------------------------------------------------------------------- - subroutine compute_LHS_moisture_form(c, nlayers, & - soilhydrology_inst, dt_dz, dqidw0, dqidw1, dqodw1, dqodw2, & - amx, bmx, cmx) - ! - ! !DESCRIPTION: - - ! Calculate LHS of moisture-based form of Richards equation - ! LHS is a tridiagonal matrix - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varpar , only : nlevsoi - use ColumnType , only : col - use SoilHydrologyType , only : soilhydrology_type - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: c ! column index - integer , intent(in) :: nlayers ! lower boundary index - type(soilhydrology_type), intent(in) :: soilhydrology_inst - - real(r8), intent(in) :: dt_dz(1:nlayers) - real(r8), intent(in) :: dqidw0(1:nlayers) - real(r8), intent(in) :: dqidw1(1:nlayers) - real(r8), intent(in) :: dqodw1(1:nlayers) - real(r8), intent(in) :: dqodw2(1:nlayers) - real(r8), intent(out) :: amx(1:nlayers) ! "a" left off diagonal of tridiagonal matrix - real(r8), intent(out) :: bmx(1:nlayers) ! "b" diagonal column for tridiagonal matrix - real(r8), intent(out) :: cmx(1:nlayers) ! "c" right off diagonal tridiagonal matrix - - ! - ! !LOCAL VARIABLES: - integer :: j ! do loop indices - character(len=32) :: subname = 'compute_LHS_moisture_form' ! subroutine name - integer :: jwt !index of layer above water table - !----------------------------------------------------------------------- - - associate(& - zi => col%zi , & ! Input: [real(r8) (:,:) ] layer interface depth (m) - zwt => soilhydrology_inst%zwt_col & ! Input: [real(r8) (:) ] water table depth (m) - ) ! end associate statement - - - amx = 0._r8 - bmx = 0._r8 - cmx = 0._r8 - -! Compute LHS of moisture-based form of Richards equation -! Top soil layer - j=1 - amx(j) = 0._r8 - bmx(j) = -1._r8 - (-dqidw1(j) + dqodw1(j))*dt_dz(j) - cmx(j) = -dqodw2(j)*dt_dz(j) - -! Interior soil layers - do j = 2, nlayers-1 - amx(j) = dqidw0(j)*dt_dz(j) - bmx(j) = -1._r8 - (-dqidw1(j) + dqodw1(j))*dt_dz(j) - cmx(j) = -dqodw2(j)*dt_dz(j) - enddo - - j=nlayers - amx(j) = dqidw0(j)*dt_dz(j) - bmx(j) = -1._r8 - (-dqidw1(j) + dqodw1(j))*dt_dz(j) - cmx(j) = 0._r8 - - end associate - - end subroutine compute_LHS_moisture_form - -!#12 -!----------------------------------------------------------------------- - subroutine compute_qcharge(bounds, num_hydrologyc, & - filter_hydrologyc, soilhydrology_inst, soilstate_inst, & - waterstate_inst, soil_water_retention_curve, & - dwat, smp, imped, vwc_liq) - ! - ! !DESCRIPTION: - - ! Calculate additional terms due to presence of aquifer layer - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevsoi - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use SoilStateType , only : soilstate_type - use SoilHydrologyType , only : soilhydrology_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use WaterStateType , only : waterstate_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(:) ! column filter for soil points - - type(soilhydrology_type), intent(in) :: soilhydrology_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - -! integer, intent(in) :: soil_hydraulic_properties_method - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - real(r8), intent(in) :: dwat(bounds%begc:bounds%endc,1:nlevsoi) - real(r8), intent(in) :: imped(bounds%begc:bounds%endc,1:nlevsoi) - real(r8), intent(in) :: smp(bounds%begc:bounds%endc,1:nlevsoi) - real(r8), intent(in) :: vwc_liq(bounds%begc:bounds%endc,1:nlevsoi) -! real(r8), intent(in) :: hksat(bounds%begc:bounds%endc,1:nlevsoi) - - ! - ! !LOCAL VARIABLES: - integer :: c,fc,j ! do loop indices - integer :: jwt - real(r8) :: ka - real(r8) :: wh_zwt - real(r8) :: wh - real(r8) :: dtime ! land model time step (sec) - real(r8) :: smp1 !temporary variable - real(r8) :: s1 !temporary variable - real(r8) :: dz_aquifer !temporary variable - - character(len=32) :: subname = 'compute_qcharge' ! subroutine name - !----------------------------------------------------------------------- - - associate(& - qcharge => soilhydrology_inst%qcharge_col , & ! Input: [real(r8) (:) ] aquifer recharge rate (mm/s) - wa => soilhydrology_inst%wa_col , & ! Input: [real(r8) (:) ] water in the unconfined aquifer (mm) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - smpmin => soilstate_inst%smpmin_col , & ! Input: [real(r8) (:) ] restriction for min of soil potential (mm) - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) - zi => col%zi & ! Input: [real(r8) (:,:) ] layer interface depth (m) - ) ! end associate statement - - ! Get time step - - dtime = get_step_size() - - ! compute flux of water to aquifer - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) -! Locate index of layer above water table - jwt = nlevsoi - do j = 1,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt = j-1 - exit - end if - enddo - ! calculate qcharge for case jwt < nlevsoi - if(jwt < nlevsoi) then - wh_zwt = - sucsat(c,jwt+1) - zwt(c)*m_to_mm - - ! Recharge rate qcharge to groundwater (positive to aquifer) -! s1 = max(h2osoi_vol(c,jwt+1)/watsat(c,jwt+1), 0.01_r8) - s1 = max(vwc_liq(c,jwt+1)/watsat(c,jwt+1), 0.01_r8) - s1 = min(1._r8, s1) - - !this is the expression for unsaturated hk - call soil_water_retention_curve%soil_hk(c, jwt+1, s1, & - imped(c,jwt+1), soilstate_inst, ka) - - ! Recharge rate qcharge to groundwater (positive to aquifer) - smp1 = max(smpmin(c), smp(c,max(1,jwt))) - wh = smp1 - z(c,max(1,jwt))*m_to_mm - - ! original formulation - if(jwt == 0) then - qcharge(c) = -ka * (wh_zwt-wh) /((zwt(c)+1.e-3)*m_to_mm) - else - ! qcharge(c) = -ka * (wh_zwt-wh)/((zwt(c)-z(c,jwt))*1000._r8) - ! 1/2, assuming flux is at zwt interface, saturation deeper than zwt - qcharge(c) = -ka * (wh_zwt-wh)/((zwt(c)-z(c,jwt))*m_to_mm*2.0) - endif - - ! To limit qcharge (for the first several timesteps) - qcharge(c) = max(-10.0_r8/dtime,qcharge(c)) - qcharge(c) = min( 10.0_r8/dtime,qcharge(c)) - endif - - end do - - end associate - - end subroutine compute_qcharge - -!#13 - !----------------------------------------------------------------------- - subroutine IceImpedance(icefrac, e_ice, imped) - ! - !DESCRIPTION - ! compute soil suction potential - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use abortutils , only : endrun - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: icefrac !fraction of pore space filled with ice - real(r8), intent(in) :: e_ice !shape parameter - - real(r8), intent(out) :: imped !hydraulic conductivity reduction due to the presence of ice in pore space - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'IceImpedance' ! subroutine name - !------------------------------------------------------------------------------ - - imped = 10._r8**(-e_ice*icefrac) - - end subroutine IceImpedance - -!#14 - !----------------------------------------------------------------------- - subroutine TridiagonalCol (ci, lbj, ubj, jtop, a, b, c, r, u) - ! - ! !DESCRIPTION: - ! Tridiagonal matrix solution - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevurb - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varctl , only : iulog - use decompMod , only : bounds_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: ci ! lbinning and ubing level indices - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: jtop ! top level for each column [col] - real(r8), intent(in) :: a( lbj: ) ! "a" left off diagonal of tridiagonal matrix [col, j] - real(r8), intent(in) :: b( lbj: ) ! "b" diagonal column for tridiagonal matrix [col, j] - real(r8), intent(in) :: c( lbj: ) ! "c" right off diagonal tridiagonal matrix [col, j] - real(r8), intent(in) :: r( lbj: ) ! "r" forcing term of tridiagonal matrix [col, j] - real(r8), intent(inout) :: u( lbj: ) ! solution [col, j] - ! - integer :: j,fc !indices - real(r8) :: gam(lbj:ubj) !temporary - real(r8) :: bet !temporary - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(a) == (/ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(b) == (/ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c) == (/ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(r) == (/ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(u) == (/ubj/)), errMsg(sourcefile, __LINE__)) - - ! Solve the matrix - - bet = b(jtop) - - do j = lbj, ubj - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb) then - if (j >= jtop) then - if (j == jtop) then - u(j) = r(j) / bet - else - gam(j) = c(j-1) / bet - bet = b(j) - a(j) * gam(j) - u(j) = (r(j) - a(j)*u(j-1)) / bet - end if - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop) then - if (j == jtop) then - u(j) = r(j) / bet - else - gam(j) = c(j-1) / bet - bet = b(j) - a(j) * gam(j) - u(j) = (r(j) - a(j)*u(j-1)) / bet - end if - end if - end if - end do - - do j = ubj-1,lbj,-1 - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb-1) then - if (j >= jtop) then - u(j) = u(j) - gam(j+1) * u(j+1) - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop) then - u(j) = u(j) - gam(j+1) * u(j+1) - end if - end if - end do - - end subroutine TridiagonalCol - - end module SoilWaterMovementMod diff --git a/src/biogeophys/SoilWaterPlantSinkMod.F90 b/src/biogeophys/SoilWaterPlantSinkMod.F90 deleted file mode 100644 index 90624ae70c..0000000000 --- a/src/biogeophys/SoilWaterPlantSinkMod.F90 +++ /dev/null @@ -1,444 +0,0 @@ -module SoilWaterPlantSinkMod - - use clm_varctl , only : use_hydrstress - use decompMod , only : bounds_type - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use landunit_varcon , only : istsoil,istcrop - use column_varcon , only : icol_road_perv - implicit none - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - subroutine Compute_EffecRootFrac_And_VertTranSink(bounds, num_hydrologyc, & - filter_hydrologyc, soilstate_inst, canopystate_inst, waterflux_inst, energyflux_inst) - - ! --------------------------------------------------------------------------------- - ! This is a wrapper for calculating the effective root fraction and soil - ! water sink due to plant transpiration. - ! Calculate Soil Water Sink to Roots over different types - ! of columns and for different process modules - ! The super-set of all columns that should have a root water sink - ! is filter_hydrologyc - ! There are three groups of columns: - ! 1) impervious roads, 2) non-natural vegetation and 3) natural vegetation - ! There are several methods available. - ! 1) the default version, 2) hydstress version and 3) fates boundary conditions - ! - ! There are only two quantities that are the result of this routine, and its - ! children: - ! waterflux_inst%qflx_rootsoi_col(c,j) - ! soilstate_inst%rootr_col(c,j) - ! - ! - ! --------------------------------------------------------------------------------- - - use SoilStateType , only : soilstate_type - use WaterFluxType , only : waterflux_type - use CanopyStateType , only : canopystate_type - use EnergyFluxType , only : energyflux_type - use ColumnType , only : col - use LandunitType , only : lun - - ! Arguments - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(num_hydrologyc) ! column filter for soil points - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(energyflux_type) , intent(in) :: energyflux_inst - - ! Local Variables - integer :: filterc(bounds%endc-bounds%begc+1) !column filter - integer :: num_filterc - integer :: num_filterc_tot - integer :: fc - integer :: c - integer :: l - - num_filterc_tot = 0 - - ! 1) pervious roads - num_filterc = 0 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (col%itype(c) == icol_road_perv) then - num_filterc = num_filterc + 1 - filterc(num_filterc) = c - end if - end do - num_filterc_tot = num_filterc_tot+num_filterc - if(use_hydrstress) then - call Compute_EffecRootFrac_And_VertTranSink_HydStress_Roads(bounds, & - num_filterc,filterc, soilstate_inst, waterflux_inst) - else - call Compute_EffecRootFrac_And_VertTranSink_Default(bounds, & - num_filterc,filterc, soilstate_inst, waterflux_inst) - end if - - - ! Note: 2 and 3 really don't need to be split. But I am leaving - ! it split in case someone wants to calculate uptake in a special - ! way for a specific LU or coverage type (RGK 04/2017). Feel - ! free to consolidate if there are no plans to do such a thing. - - - ! 2) not ( pervious road or natural vegetation) , everything else - num_filterc = 0 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - l = col%landunit(c) - if ( (col%itype(c) /= icol_road_perv) .and. (lun%itype(l) /= istsoil) ) then - num_filterc = num_filterc + 1 - filterc(num_filterc) = c - end if - end do - num_filterc_tot = num_filterc_tot+num_filterc - if(use_hydrstress) then - call Compute_EffecRootFrac_And_VertTranSink_HydStress(bounds, & - num_filterc, filterc, waterflux_inst, soilstate_inst, & - canopystate_inst, energyflux_inst) - else - call Compute_EffecRootFrac_And_VertTranSink_Default(bounds, & - num_filterc,filterc, soilstate_inst, waterflux_inst) - end if - - - ! 3) Natural vegetation - num_filterc = 0 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - l = col%landunit(c) - if ( (lun%itype(l) == istsoil) ) then - num_filterc = num_filterc + 1 - filterc(num_filterc) = c - end if - end do - num_filterc_tot = num_filterc_tot+num_filterc - if (use_hydrstress) then - call Compute_EffecRootFrac_And_VertTranSink_HydStress(bounds, & - num_filterc, filterc, waterflux_inst, soilstate_inst, & - canopystate_inst,energyflux_inst) - else - call Compute_EffecRootFrac_And_VertTranSink_Default(bounds, & - num_filterc,filterc, soilstate_inst, waterflux_inst) - end if - - if (num_hydrologyc /= num_filterc_tot) then - write(iulog,*) 'The total number of columns flagged to root water uptake' - write(iulog,*) 'did not match the total number calculated' - write(iulog,*) 'This is likely a problem with the interpretation of column/lu filters.' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - - return - end subroutine Compute_EffecRootFrac_And_VertTranSink - - ! ==================================================================================== - - subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress_Roads(bounds, & - num_filterc,filterc, soilstate_inst, waterflux_inst) - - use SoilStateType , only : soilstate_type - use WaterFluxType , only : waterflux_type - use clm_varpar , only : nlevsoi - use clm_varpar , only : max_patch_per_col - use PatchType , only : patch - use ColumnType , only : col - - ! Arguments - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_filterc - integer , intent(in) :: filterc(:) - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - - ! Locals - integer :: j - integer :: c - integer :: fc - integer :: pi - integer :: p - real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting - - - associate(& - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:,:) ] - ! vegetation/soil water exchange (mm H2O/s) (+ = to atm) - qflx_tran_veg_patch => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_tran_veg_col => waterflux_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - rootr_patch => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] - ! effective fraction of roots in each soil layer - rootr_col => soilstate_inst%rootr_col & ! Output: [real(r8) (:,:) ] - !effective fraction of roots in each soil layer - ) - - ! First step is to calculate the column-level effective rooting - ! fraction in each soil layer. This is done outside the usual - ! PATCH-to-column averaging routines because it is not a simple - ! weighted average of the PATCH level rootr arrays. Instead, the - ! weighting depends on both the per-unit-area transpiration - ! of the PATCH and the PATCHEs area relative to all PATCHES. - - temp(bounds%begc : bounds%endc) = 0._r8 - - - do j = 1, nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - rootr_col(c,j) = 0._r8 - end do - end do - - do pi = 1,max_patch_per_col - do j = 1,nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - rootr_col(c,j) = rootr_col(c,j) + rootr_patch(p,j) * & - qflx_tran_veg_patch(p) * patch%wtcol(p) - end if - end if - end do - end do - do fc = 1, num_filterc - c = filterc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - temp(c) = temp(c) + qflx_tran_veg_patch(p) * patch%wtcol(p) - end if - end if - end do - end do - - - do j = 1, nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - if (temp(c) /= 0._r8) then - rootr_col(c,j) = rootr_col(c,j)/temp(c) - end if - qflx_rootsoi_col(c,j) = rootr_col(c,j)*qflx_tran_veg_col(c) - end do - end do - end associate - return - end subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress_Roads - - ! ================================================================================== - - subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress( bounds, & - num_filterc, filterc, waterflux_inst, soilstate_inst, & - canopystate_inst, energyflux_inst) - - - ! - !USES: - use decompMod , only : bounds_type - use clm_varpar , only : nlevsoi - use clm_varpar , only : max_patch_per_col - use SoilStateType , only : soilstate_type - use WaterFluxType , only : waterflux_type - use CanopyStateType , only : canopystate_type - use PatchType , only : patch - use ColumnType , only : col - use clm_varctl , only : iulog - use PhotosynthesisMod, only : plc, params_inst - use column_varcon , only : icol_road_perv - use shr_infnan_mod , only : isnan => shr_infnan_isnan - use EnergyFluxType , only : energyflux_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_filterc ! number of column soil points in column filter - integer , intent(in) :: filterc(:) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(energyflux_type), intent(in) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,fc,j ! do loop indices - integer :: pi ! patch index - real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting - real(r8) :: grav2 ! soil layer gravitational potential relative to surface (mm H2O) - integer , parameter :: soil=1,root=4 ! index values - !----------------------------------------------------------------------- - - associate(& - k_soil_root => soilstate_inst%k_soil_root_patch , & ! Input: [real(r8) (:,:) ] - ! soil-root interface conductance (mm/s) - qflx_phs_neg_col => waterflux_inst%qflx_phs_neg_col , & ! Input: [real(r8) (:) ] n - ! net neg hydraulic redistribution flux(mm H2O/s) - qflx_tran_veg_col => waterflux_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_tran_veg_patch => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:) ] - ! col root and soil water - ! exchange [mm H2O/s] [+ into root] - rootr_col => soilstate_inst%rootr_col , & ! Input: [real(r8) (:,:) ] - ! effective fraction of roots in each soil layer - rootr_patch => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] - ! effective fraction of roots in each soil layer - smp => soilstate_inst%smp_l_col , & ! Input: [real(r8) (:,:) ] soil matrix pot. [mm] - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Input: [integer (:) ] - ! fraction of vegetation not - ! covered by snow (0 OR 1) [-] - z => col%z , & ! Input: [real(r8) (:,:) ] layer node depth (m) - vegwp => canopystate_inst%vegwp_patch & ! Input: [real(r8) (:,:) ] vegetation water - ! matric potential (mm) - ) - - do fc = 1, num_filterc - c = filterc(fc) - qflx_phs_neg_col(c) = 0._r8 - - do j = 1, nlevsoi - grav2 = z(c,j) * 1000._r8 - temp(c) = 0._r8 - do pi = 1,max_patch_per_col - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if (patch%active(p).and.frac_veg_nosno(p)>0) then - if (patch%wtcol(p) > 0._r8) then - temp(c) = temp(c) + k_soil_root(p,j) & - * (smp(c,j) - vegwp(p,4) - grav2)* patch%wtcol(p) - endif - end if - end if - end do - qflx_rootsoi_col(c,j)= temp(c) - - if (temp(c) < 0._r8) qflx_phs_neg_col(c) = qflx_phs_neg_col(c) + temp(c) - end do - - ! Back out the effective root density - if( sum(qflx_rootsoi_col(c,:))>0.0_r8 ) then - do j = 1, nlevsoi - rootr_col(c,j) = qflx_rootsoi_col(c,j)/sum( qflx_rootsoi_col(c,:)) - end do - else - rootr_col(c,:) = 0.0_r8 - end if - end do - - end associate - - return - end subroutine Compute_EffecRootFrac_And_VertTranSink_HydStress - - ! ================================================================================== - - subroutine Compute_EffecRootFrac_And_VertTranSink_Default(bounds, num_filterc, & - filterc, soilstate_inst, waterflux_inst) - - ! - ! Generic routine to apply transpiration as a sink condition that - ! is vertically distributed over the soil column. Should be - ! applicable to any Richards solver that is not coupled to plant - ! hydraulics. - ! - !USES: - use decompMod , only : bounds_type - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : nlevsoi, max_patch_per_col - use SoilStateType , only : soilstate_type - use WaterFluxType , only : waterflux_type - use PatchType , only : patch - use ColumnType , only : col - use clm_varctl , only : use_hydrstress - use column_varcon , only : icol_road_perv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_filterc ! number of column soil points in column filter - integer , intent(in) :: filterc(num_filterc) ! column filter for soil points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,fc,j ! do loop indices - integer :: pi ! patch index - real(r8) :: temp(bounds%begc:bounds%endc) ! accumulator for rootr weighting - associate(& - qflx_rootsoi_col => waterflux_inst%qflx_rootsoi_col , & ! Output: [real(r8) (:,:) ] - ! vegetation/soil water exchange (m H2O/s) (+ = to atm) - qflx_tran_veg_patch => waterflux_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_tran_veg_col => waterflux_inst%qflx_tran_veg_col , & ! Input: [real(r8) (:) ] - ! vegetation transpiration (mm H2O/s) (+ = to atm) - rootr_patch => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] - ! effective fraction of roots in each soil layer - rootr_col => soilstate_inst%rootr_col & ! Output: [real(r8) (:,:) ] - ! effective fraction of roots in each soil layer - ) - - ! First step is to calculate the column-level effective rooting - ! fraction in each soil layer. This is done outside the usual - ! PATCH-to-column averaging routines because it is not a simple - ! weighted average of the PATCH level rootr arrays. Instead, the - ! weighting depends on both the per-unit-area transpiration - ! of the PATCH and the PATCHEs area relative to all PATCHES. - - temp(bounds%begc : bounds%endc) = 0._r8 - - do j = 1, nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - rootr_col(c,j) = 0._r8 - end do - end do - - do pi = 1,max_patch_per_col - do j = 1,nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - rootr_col(c,j) = rootr_col(c,j) + rootr_patch(p,j) * & - qflx_tran_veg_patch(p) * patch%wtcol(p) - end if - end if - end do - end do - do fc = 1, num_filterc - c = filterc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - if (patch%active(p)) then - temp(c) = temp(c) + qflx_tran_veg_patch(p) * patch%wtcol(p) - end if - end if - end do - end do - - do j = 1, nlevsoi - do fc = 1, num_filterc - c = filterc(fc) - if (temp(c) /= 0._r8) then - rootr_col(c,j) = rootr_col(c,j)/temp(c) - end if - qflx_rootsoi_col(c,j) = rootr_col(c,j)*qflx_tran_veg_col(c) - - end do - end do - end associate - return - end subroutine Compute_EffecRootFrac_And_VertTranSink_Default - -end module SoilWaterPlantSinkMod - diff --git a/src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 b/src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 deleted file mode 100644 index c82e27d851..0000000000 --- a/src/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90 +++ /dev/null @@ -1,162 +0,0 @@ -module SoilWaterRetentionCurveClappHornberg1978Mod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Implementation of soil_water_retention_curve_type using the Clapp-Hornberg 1978 - ! parameterizations. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - implicit none - save - private - ! - ! !PUBLIC TYPES: - public :: soil_water_retention_curve_clapp_hornberg_1978_type - - type, extends(soil_water_retention_curve_type) :: & - soil_water_retention_curve_clapp_hornberg_1978_type - private - contains - procedure :: soil_hk ! compute hydraulic conductivity - procedure :: soil_suction ! compute soil suction potential - procedure :: soil_suction_inverse ! compute relative saturation at which soil suction is equal to a target value - end type soil_water_retention_curve_clapp_hornberg_1978_type - - interface soil_water_retention_curve_clapp_hornberg_1978_type - ! initialize a new soil_water_retention_curve_clapp_hornberg_1978_type object - module procedure constructor - end interface soil_water_retention_curve_clapp_hornberg_1978_type - -contains - - !----------------------------------------------------------------------- - type(soil_water_retention_curve_clapp_hornberg_1978_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type soil_water_retention_curve_clapp_hornberg_1978_type. - ! For now, this is simply a place-holder. - !----------------------------------------------------------------------- - - end function constructor - - !----------------------------------------------------------------------- - subroutine soil_hk(this, c, j, s, imped, soilstate_inst, hk, dhkds) - ! - ! !DESCRIPTION: - ! Compute hydraulic conductivity - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_clapp_hornberg_1978_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - real(r8), intent(in) :: imped !ice impedance - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out) :: hk !hydraulic conductivity [mm/s] - real(r8), optional, intent(out) :: dhkds !d[hk]/ds [mm/s] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_hk' - !----------------------------------------------------------------------- - - associate(& - hksat => soilstate_inst%hksat_col(c,j) , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - bsw => soilstate_inst%bsw_col(c,j) & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - ) - - - !compute hydraulic conductivity - hk=imped*hksat*s**(2._r8*bsw+3._r8) - - !compute the derivative - if(present(dhkds))then - dhkds=(2._r8*bsw+3._r8)*hk/s - endif - - end associate - - end subroutine soil_hk - - !----------------------------------------------------------------------- - subroutine soil_suction(this, c, j, s, soilstate_inst, smp, dsmpds) - ! - ! !DESCRIPTION: - ! Compute soil suction potential - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_clapp_hornberg_1978_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out) :: smp !soil suction, negative, [mm] - real(r8), optional, intent(out) :: dsmpds !d[smp]/ds, [mm] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_suction' - !----------------------------------------------------------------------- - - associate(& - bsw => soilstate_inst%bsw_col(c,j) , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col(c,j) & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - ) - - !compute soil suction potential, negative - smp = -sucsat*s**(-bsw) - - !compute derivative - if(present(dsmpds))then - dsmpds=-bsw*smp/s - endif - - end associate - - end subroutine soil_suction - - !----------------------------------------------------------------------- - subroutine soil_suction_inverse(this, c, j, smp_target, soilstate_inst, & - s_target) - ! - ! !DESCRIPTION: - ! Compute relative saturation at which soil suction is equal to a target value. - ! This is done by inverting the soil_suction equation to solve for s. - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_clapp_hornberg_1978_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - type(soilstate_type), intent(in) :: soilstate_inst - real(r8) , intent(in) :: smp_target ! target soil suction, negative [mm] - real(r8) , intent(out) :: s_target ! relative saturation at which smp = smp_target [0,1] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_suction_inverse' - !----------------------------------------------------------------------- - - associate(& - bsw => soilstate_inst%bsw_col(c,j) , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col(c,j) & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - ) - - s_target = (-smp_target/sucsat)**(-1._r8/bsw) - - end associate - - end subroutine soil_suction_inverse - -end module SoilWaterRetentionCurveClappHornberg1978Mod - diff --git a/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 b/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 deleted file mode 100644 index 61e579dd43..0000000000 --- a/src/biogeophys/SoilWaterRetentionCurveFactoryMod.F90 +++ /dev/null @@ -1,71 +0,0 @@ -module SoilWaterRetentionCurveFactoryMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Factory to create an instance of soil_water_retention_curve_type. This module figures - ! out the particular type to return. - ! - ! !USES: - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - implicit none - save - private - ! - ! !PUBLIC ROUTINES: - public :: create_soil_water_retention_curve ! create an object of class soil_water_retention_curve_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - function create_soil_water_retention_curve() result(soil_water_retention_curve) - ! - ! !DESCRIPTION: - ! Create and return an object of soil_water_retention_curve_type. The particular type - ! is determined based on a namelist parameter. - ! - ! !USES: - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - use SoilWaterRetentionCurveClappHornberg1978Mod, only : soil_water_retention_curve_clapp_hornberg_1978_type - use SoilWaterRetentionCurveVanGenuchten1980Mod, only : soil_water_retention_curve_vangenuchten_1980_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_type), allocatable :: soil_water_retention_curve ! function result - ! - ! !LOCAL VARIABLES: - - ! For now, hard-code the method. Eventually this will be set from namelist, either by - ! this routine (appropriate if the 'method' is in its own namelist group), or do the - ! namelist read outside this module and pass the method in as a parameter (appropriate - ! if the 'method' is part of a larger namelist group). -!scs character(len=*), parameter :: method = "clapphornberg_1978" - character(len=256) :: method - - character(len=*), parameter :: subname = 'create_soil_water_retention_curve' - !----------------------------------------------------------------------- - - method = "clapphornberg_1978" !scs: placeholder until bld scripts changed - - select case (trim(method)) - - case ("clapphornberg_1978") - allocate(soil_water_retention_curve, & - source=soil_water_retention_curve_clapp_hornberg_1978_type()) - - case ("vangenuchten_1980") - allocate(soil_water_retention_curve, & - source=soil_water_retention_curve_vangenuchten_1980_type()) - - case default - write(iulog,*) subname//' ERROR: unknown method: ', method - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end select - - end function create_soil_water_retention_curve - -end module SoilWaterRetentionCurveFactoryMod diff --git a/src/biogeophys/SoilWaterRetentionCurveMod.F90 b/src/biogeophys/SoilWaterRetentionCurveMod.F90 deleted file mode 100644 index 74f8299d54..0000000000 --- a/src/biogeophys/SoilWaterRetentionCurveMod.F90 +++ /dev/null @@ -1,111 +0,0 @@ -module SoilWaterRetentionCurveMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Abstract base class for functions to compute soil water retention curve - ! - ! !USES: - implicit none - save - private - ! - ! !PUBLIC TYPES: - public :: soil_water_retention_curve_type - - type, abstract :: soil_water_retention_curve_type - private - contains - ! compute hydraulic conductivity - procedure(soil_hk_interface), deferred :: soil_hk - - ! compute soil suction potential - procedure(soil_suction_interface), deferred :: soil_suction - - ! compute relative saturation at which soil suction is equal to a target value - procedure(soil_suction_inverse_interface), deferred :: soil_suction_inverse - end type soil_water_retention_curve_type - - abstract interface - - ! Note: The following interfaces are set up based on the arguments needed for the - ! clapphornberg1978 implementations. It's likely that these interfaces are not - ! totally general for all desired implementations. In that case, we'll need to think - ! about how to support different interfaces. Some possible solutions are: - ! - ! - Make the interfaces contain all possible inputs that are needed by any - ! implementation; each implementation will then ignore the inputs it doesn't need. - ! - ! - For inputs that are needed only by particular implementations - and particularly - ! for inputs that are constant in time (e.g., this is the case for bsw, I think): - ! pass these into the constructor, and save pointers to these inputs as components - ! of the child type that needs them. Then they aren't needed as inputs to the - ! individual routines, allowing the interfaces for these routines to remain more - ! consistent between different implementations. - - subroutine soil_hk_interface(this, c, j, s, imped, soilstate_inst, & - hk, dhkds) - - ! !DESCRIPTION: - ! Compute hydraulic conductivity - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilStateType , only : soilstate_type - import :: soil_water_retention_curve_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - real(r8), intent(in) :: imped !ice impedance - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out):: hk !hydraulic conductivity [mm/s] - real(r8), optional, intent(out):: dhkds !d[hk]/ds [mm/s] - end subroutine soil_hk_interface - - - subroutine soil_suction_interface(this, c, j, s, soilstate_inst, & - smp, dsmpds) - - ! !DESCRIPTION: - ! Compute soil suction potential - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilStateType , only : soilstate_type - import :: soil_water_retention_curve_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out) :: smp !soil suction, negative, [mm] - real(r8), optional, intent(out) :: dsmpds !d[smp]/ds, [mm] - end subroutine soil_suction_interface - - subroutine soil_suction_inverse_interface(this, c, j, smp_target, & - soilstate_inst, s_target) - ! !DESCRIPTION: - ! Compute relative saturation at which soil suction is equal to a target value. - ! This is done by inverting the soil_suction equation to solve for s. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilStateType , only : soilstate_type - import :: soil_water_retention_curve_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: smp_target ! target soil suction, negative [mm] - type(soilstate_type), intent(in) :: soilstate_inst - real(r8) , intent(out) :: s_target ! relative saturation at which smp = smp_target [0,1] - end subroutine soil_suction_inverse_interface - - end interface - -end module SoilWaterRetentionCurveMod diff --git a/src/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90 b/src/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90 deleted file mode 100644 index c8dacccb81..0000000000 --- a/src/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90 +++ /dev/null @@ -1,162 +0,0 @@ -module SoilWaterRetentionCurveVanGenuchten1980Mod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Implementation of soil_water_retention_curve_type using the Clapp-Hornberg 1978 - ! parameterizations. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - implicit none - save - private - ! - ! !PUBLIC TYPES: - public :: soil_water_retention_curve_vangenuchten_1980_type - - type, extends(soil_water_retention_curve_type) :: & - soil_water_retention_curve_vangenuchten_1980_type - private - contains - procedure :: soil_hk ! compute hydraulic conductivity - procedure :: soil_suction ! compute soil suction potential - procedure :: soil_suction_inverse ! compute relative saturation at which soil suction is equal to a target value - end type soil_water_retention_curve_vangenuchten_1980_type - - interface soil_water_retention_curve_vangenuchten_1980_type - ! initialize a new soil_water_retention_curve_vangenuchten_1980_type object - module procedure constructor - end interface soil_water_retention_curve_vangenuchten_1980_type - -contains - - !----------------------------------------------------------------------- - type(soil_water_retention_curve_vangenuchten_1980_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates an object of type soil_water_retention_curve_vangenuchten_1980_type. - ! For now, this is simply a place-holder. - !----------------------------------------------------------------------- - - end function constructor - - !----------------------------------------------------------------------- - subroutine soil_hk(this, c, j, s, imped, soilstate_inst, hk, dhkds) - ! - ! !DESCRIPTION: - ! Compute hydraulic conductivity - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_vangenuchten_1980_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - real(r8), intent(in) :: imped !ice impedance - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out) :: hk !hydraulic conductivity [mm/s] - real(r8), optional, intent(out) :: dhkds !d[hk]/ds [mm/s] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_hk' - !----------------------------------------------------------------------- - - associate(& - hksat => soilstate_inst%hksat_col(c,j) , & ! Input: [real(r8) (:,:) ] hydraulic conductivity at saturation (mm H2O /s) - bsw => soilstate_inst%bsw_col(c,j) & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - ) - - - !compute hydraulic conductivity - hk=imped*hksat*s**(2._r8*bsw+3._r8) - - !compute the derivative - if(present(dhkds))then - dhkds=(2._r8*bsw+3._r8)*hk/s - endif - - end associate - - end subroutine soil_hk - - !----------------------------------------------------------------------- - subroutine soil_suction(this, c, j, s, soilstate_inst, smp, dsmpds) - !j, - ! !DESCRIPTION: - ! Compute soil suction potential - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_vangenuchten_1980_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - real(r8), intent(in) :: s !relative saturation, [0, 1] - type(soilstate_type), intent(in) :: soilstate_inst - real(r8), intent(out) :: smp !soil suction, negative, [mm] - real(r8), optional, intent(out) :: dsmpds !d[smp]/ds, [mm] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_suction' - !----------------------------------------------------------------------- - - associate(& - bsw => soilstate_inst%bsw_col(c,j) , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col(c,j) & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - ) - - !compute soil suction potential, negative - smp = -sucsat*s**(-bsw) - - !compute derivative - if(present(dsmpds))then - dsmpds=-bsw*smp/s - endif - - end associate - - end subroutine soil_suction - - !----------------------------------------------------------------------- - subroutine soil_suction_inverse(this, c, j, smp_target, soilstate_inst, s_target) - ! - ! !DESCRIPTION: - ! Compute relative saturation at which soil suction is equal to a target value. - ! This is done by inverting the soil_suction equation to solve for s. - ! - ! !USES: - use SoilStateType , only : soilstate_type - ! - ! !ARGUMENTS: - class(soil_water_retention_curve_vangenuchten_1980_type), intent(in) :: this - integer, intent(in) :: c !column index - integer, intent(in) :: j !level index - type(soilstate_type), intent(in) :: soilstate_inst - real(r8) , intent(in) :: smp_target ! target soil suction, negative [mm] - real(r8) , intent(out) :: s_target ! relative saturation at which smp = smp_target [0,1] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'soil_suction_inverse' - !----------------------------------------------------------------------- - - associate(& - bsw => soilstate_inst%bsw_col(c,j) , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col(c,j) & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - ) - - s_target = (-smp_target/sucsat)**(-1._r8/bsw) - - end associate - - end subroutine soil_suction_inverse - -end module SoilWaterRetentionCurveVanGenuchten1980Mod - - diff --git a/src/biogeophys/SolarAbsorbedType.F90 b/src/biogeophys/SolarAbsorbedType.F90 deleted file mode 100644 index cff8cf9956..0000000000 --- a/src/biogeophys/SolarAbsorbedType.F90 +++ /dev/null @@ -1,423 +0,0 @@ -module SolarAbsorbedType - - !------------------------------------------------------------------------------ - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_log_mod , only: errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varcon , only : spval - use clm_varctl , only : use_luna - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC DATA MEMBERS: - type, public :: solarabs_type - - ! Solar reflected - real(r8), pointer :: fsr_patch (:) ! patch solar radiation reflected (W/m**2) - - ! Solar Absorbed - real(r8), pointer :: fsa_patch (:) ! patch solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_u_patch (:) ! patch urban solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_r_patch (:) ! patch rural solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: parsun_z_patch (:,:) ! patch absorbed PAR for sunlit leaves in canopy layer (W/m**2) - real(r8), pointer :: parsha_z_patch (:,:) ! patch absorbed PAR for shaded leaves in canopy layer (W/m**2) - real(r8), pointer :: par240d_z_patch (:,:) ! 10-day running mean of daytime patch absorbed PAR for leaves in canopy layer (W/m**2) - real(r8), pointer :: par240x_z_patch (:,:) ! 10-day running mean of maximum patch absorbed PAR for leaves in canopy layer (W/m**2) - real(r8), pointer :: par24d_z_patch (:,:) ! daily accumulated absorbed PAR for leaves in canopy layer from midnight to current step(J/m**2) - real(r8), pointer :: par24x_z_patch (:,:) ! daily max of patch absorbed PAR for leaves in canopy layer from midnight to current step(W/m**2) - real(r8), pointer :: sabg_soil_patch (:) ! patch solar radiation absorbed by soil (W/m**2) - real(r8), pointer :: sabg_snow_patch (:) ! patch solar radiation absorbed by snow (W/m**2) - real(r8), pointer :: sabg_patch (:) ! patch solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: sabg_chk_patch (:) ! patch fsno weighted sum (W/m**2) - real(r8), pointer :: sabg_lyr_patch (:,:) ! patch absorbed radiation in each snow layer and top soil layer (pft,lyr) [W/m2] - real(r8), pointer :: sabg_pen_patch (:) ! patch (rural) shortwave radiation penetrating top soisno layer [W/m2] - - real(r8), pointer :: sub_surf_abs_SW_patch (:) ! patch fraction of solar radiation absorbed below first snow layer - real(r8), pointer :: sabv_patch (:) ! patch solar radiation absorbed by vegetation (W/m**2) - - real(r8), pointer :: sabs_roof_dir_lun (:,:) ! lun direct solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_roof_dif_lun (:,:) ! lun diffuse solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_sunwall_dir_lun (:,:) ! lun direct solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_sunwall_dif_lun (:,:) ! lun diffuse solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dir_lun (:,:) ! lun direct solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dif_lun (:,:) ! lun diffuse solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_improad_dir_lun (:,:) ! lun direct solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_improad_dif_lun (:,:) ! lun diffuse solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dir_lun (:,:) ! lun direct solar absorbed by pervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dif_lun (:,:) ! lun diffuse solar absorbed by pervious road per unit ground area per unit incident flux - - ! Currently needed by lake code - ! TODO (MV 8/20/2014) should be moved in the future - real(r8), pointer :: fsds_nir_d_patch (:) ! patch incident direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_i_patch (:) ! patch incident diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_d_ln_patch (:) ! patch incident direct beam nir solar radiation at local noon (W/m**2) - real(r8), pointer :: fsr_nir_d_patch (:) ! patch reflected direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_i_patch (:) ! patch reflected diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_d_ln_patch (:) ! patch reflected direct beam nir solar radiation at local noon (W/m**2) - - contains - - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: Restart - - end type solarabs_type - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(solarabs_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevcan, nlevcan, numrad, nlevsno - ! - ! !ARGUMENTS: - class(solarabs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begl = bounds%begl; endl = bounds%endl - - allocate(this%fsa_patch (begp:endp)) ; this%fsa_patch (:) = nan - allocate(this%fsa_u_patch (begp:endp)) ; this%fsa_u_patch (:) = nan - allocate(this%fsa_r_patch (begp:endp)) ; this%fsa_r_patch (:) = nan - allocate(this%parsun_z_patch (begp:endp,1:nlevcan)) ; this%parsun_z_patch (:,:) = nan - allocate(this%parsha_z_patch (begp:endp,1:nlevcan)) ; this%parsha_z_patch (:,:) = nan - if(use_luna)then - allocate(this%par240d_z_patch (begp:endp,1:nlevcan)) ; this%par240d_z_patch (:,:) = spval - allocate(this%par240x_z_patch (begp:endp,1:nlevcan)) ; this%par240x_z_patch (:,:) = spval - allocate(this%par24d_z_patch (begp:endp,1:nlevcan)) ; this%par24d_z_patch (:,:) = spval - allocate(this%par24x_z_patch (begp:endp,1:nlevcan)) ; this%par24x_z_patch (:,:) = spval - endif - allocate(this%sabv_patch (begp:endp)) ; this%sabv_patch (:) = nan - allocate(this%sabg_patch (begp:endp)) ; this%sabg_patch (:) = nan - allocate(this%sabg_lyr_patch (begp:endp,-nlevsno+1:1)) ; this%sabg_lyr_patch (:,:) = nan - allocate(this%sabg_pen_patch (begp:endp)) ; this%sabg_pen_patch (:) = nan - allocate(this%sabg_soil_patch (begp:endp)) ; this%sabg_soil_patch (:) = nan - allocate(this%sabg_snow_patch (begp:endp)) ; this%sabg_snow_patch (:) = nan - allocate(this%sabg_chk_patch (begp:endp)) ; this%sabg_chk_patch (:) = nan - allocate(this%sabs_roof_dir_lun (begl:endl,1:numrad)) ; this%sabs_roof_dir_lun (:,:) = nan - allocate(this%sabs_roof_dif_lun (begl:endl,1:numrad)) ; this%sabs_roof_dif_lun (:,:) = nan - allocate(this%sabs_sunwall_dir_lun (begl:endl,1:numrad)) ; this%sabs_sunwall_dir_lun (:,:) = nan - allocate(this%sabs_sunwall_dif_lun (begl:endl,1:numrad)) ; this%sabs_sunwall_dif_lun (:,:) = nan - allocate(this%sabs_shadewall_dir_lun (begl:endl,1:numrad)) ; this%sabs_shadewall_dir_lun (:,:) = nan - allocate(this%sabs_shadewall_dif_lun (begl:endl,1:numrad)) ; this%sabs_shadewall_dif_lun (:,:) = nan - allocate(this%sabs_improad_dir_lun (begl:endl,1:numrad)) ; this%sabs_improad_dir_lun (:,:) = nan - allocate(this%sabs_improad_dif_lun (begl:endl,1:numrad)) ; this%sabs_improad_dif_lun (:,:) = nan - allocate(this%sabs_perroad_dir_lun (begl:endl,1:numrad)) ; this%sabs_perroad_dir_lun (:,:) = nan - allocate(this%sabs_perroad_dif_lun (begl:endl,1:numrad)) ; this%sabs_perroad_dif_lun (:,:) = nan - allocate(this%sub_surf_abs_SW_patch (begp:endp)) ; this%sub_surf_abs_SW_patch (:) = nan - allocate(this%fsr_patch (begp:endp)) ; this%fsr_patch (:) = nan - allocate(this%fsr_nir_d_patch (begp:endp)) ; this%fsr_nir_d_patch (:) = nan - allocate(this%fsr_nir_i_patch (begp:endp)) ; this%fsr_nir_i_patch (:) = nan - allocate(this%fsr_nir_d_ln_patch (begp:endp)) ; this%fsr_nir_d_ln_patch (:) = nan - allocate(this%fsds_nir_d_patch (begp:endp)) ; this%fsds_nir_d_patch (:) = nan - allocate(this%fsds_nir_i_patch (begp:endp)) ; this%fsds_nir_i_patch (:) = nan - allocate(this%fsds_nir_d_ln_patch (begp:endp)) ; this%fsds_nir_d_ln_patch (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use clm_varctl , only : use_snicar_frc - use clm_varpar , only : nlevsno - use histFileMod , only : hist_addfld1d, hist_addfld2d - use histFileMod , only : no_snow_normal - ! - ! !ARGUMENTS: - class(solarabs_type) :: this - type(bounds_type), intent(in) :: bounds - - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr_1d(:) ! pointer to 1d patch array - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - this%fsa_patch(begp:endp) = spval - call hist_addfld1d (fname='FSA', units='W/m^2', & - avgflag='A', long_name='absorbed solar radiation', & - ptr_patch=this%fsa_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSA_ICE', units='W/m^2', & - avgflag='A', long_name='absorbed solar radiation (ice landunits only)', & - ptr_patch=this%fsa_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%fsa_r_patch(begp:endp) = spval - call hist_addfld1d (fname='FSA_R', units='W/m^2', & - avgflag='A', long_name='Rural absorbed solar radiation', & - ptr_patch=this%fsa_r_patch, set_spec=spval, default='inactive') - - this%fsa_u_patch(begp:endp) = spval - call hist_addfld1d (fname='FSA_U', units='W/m^2', & - avgflag='A', long_name='Urban absorbed solar radiation', & - ptr_patch=this%fsa_u_patch, c2l_scale_type='urbanf', set_nourb=spval, default='inactive') - - this%fsr_patch(begp:endp) = spval - call hist_addfld1d (fname='FSR', units='W/m^2', & - avgflag='A', long_name='reflected solar radiation', & - ptr_patch=this%fsr_patch, c2l_scale_type='urbanf') - ! Rename of FSR for Urban intercomparision project - call hist_addfld1d (fname='SWup', units='W/m^2', & - avgflag='A', long_name='upwelling shortwave radiation', & - ptr_patch=this%fsr_patch, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='FSR_ICE', units='W/m^2', & - avgflag='A', long_name='reflected solar radiation (ice landunits only)', & - ptr_patch=this%fsr_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%sabg_lyr_patch(begp:endp,-nlevsno+1:0) = spval - data2dptr => this%sabg_lyr_patch(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_ABS', units='W/m^2', type2d='levsno', & - avgflag='A', long_name='Absorbed solar radiation in each snow layer', & - ptr_patch=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_ABS_ICE', units='W/m^2', type2d='levsno', & - avgflag='A', long_name='Absorbed solar radiation in each snow layer (ice landunits only)', & - ptr_patch=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%sabv_patch(begp:endp) = spval - call hist_addfld1d (fname='SABV', units='W/m^2', & - avgflag='A', long_name='solar rad absorbed by veg', & - ptr_patch=this%sabv_patch, c2l_scale_type='urbanf') - - this%sabg_patch(begp:endp) = spval - call hist_addfld1d (fname='SABG', units='W/m^2', & - avgflag='A', long_name='solar rad absorbed by ground', & - ptr_patch=this%sabg_patch, c2l_scale_type='urbanf') - - this%sabg_pen_patch(begp:endp) = spval - call hist_addfld1d (fname='SABG_PEN', units='watt/m^2', & - avgflag='A', long_name='Rural solar rad penetrating top soil or snow layer', & - ptr_patch=this%sabg_pen_patch, set_spec=spval) - - ! Currently needed by lake code - TODO should not be here - this%fsds_nir_d_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSND', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation', & - ptr_patch=this%fsds_nir_d_patch) - - this%fsds_nir_i_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir incident solar radiation', & - ptr_patch=this%fsds_nir_i_patch) - - this%fsds_nir_d_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSNDLN', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation at local noon', & - ptr_patch=this%fsds_nir_d_ln_patch) - - this%fsr_nir_d_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRND', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation', & - ptr_patch=this%fsr_nir_d_patch, c2l_scale_type='urbanf') - - this%fsr_nir_i_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir reflected solar radiation', & - ptr_patch=this%fsr_nir_i_patch, c2l_scale_type='urbanf') - - this%fsr_nir_d_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRNDLN', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation at local noon', & - ptr_patch=this%fsr_nir_d_ln_patch, c2l_scale_type='urbanf') - - this%sub_surf_abs_SW_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOINTABS', units='-', & - avgflag='A', long_name='Fraction of incoming solar absorbed by lower snow layers', & - ptr_patch=this%sub_surf_abs_SW_patch, set_lake=spval, set_urb=spval) - - if(use_luna)then - ptr_1d => this%par240d_z_patch(:,1) - call hist_addfld1d (fname='PAR240DZ', units='W/m^2', & - avgflag='A', long_name='10-day running mean of daytime patch absorbed PAR for leaves for top canopy layer', & - ptr_patch=ptr_1d, default='inactive') - ptr_1d => this%par240x_z_patch(:,1) - call hist_addfld1d (fname='PAR240XZ', units='W/m^2', & - avgflag='A', long_name='10-day running mean of maximum patch absorbed PAR for leaves for top canopy layer', & - ptr_patch=ptr_1d, default='inactive') - - endif - - end subroutine InitHistory - - !------------------------------------------------------------------------ - subroutine InitCold(this, bounds) - ! - ! Initialize module surface albedos to reasonable values - ! - use landunit_varcon, only : istsoil, istcrop - ! - ! !ARGUMENTS: - class(solarabs_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begl, endl - !----------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - this%sabs_roof_dir_lun (begl:endl, :) = 0._r8 - this%sabs_roof_dif_lun (begl:endl, :) = 0._r8 - this%sabs_sunwall_dir_lun (begl:endl, :) = 0._r8 - this%sabs_sunwall_dif_lun (begl:endl, :) = 0._r8 - this%sabs_shadewall_dir_lun (begl:endl, :) = 0._r8 - this%sabs_shadewall_dif_lun (begl:endl, :) = 0._r8 - this%sabs_improad_dir_lun (begl:endl, :) = 0._r8 - this%sabs_improad_dif_lun (begl:endl, :) = 0._r8 - this%sabs_perroad_dir_lun (begl:endl, :) = 0._r8 - this%sabs_perroad_dif_lun (begl:endl, :) = 0._r8 - - end subroutine InitCold - - !--------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use shr_infnan_mod , only : shr_infnan_isnan - use clm_varctl , only : use_snicar_frc, iulog - use spmdMod , only : masterproc - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(solarabs_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - logical :: readvar ! determine if variable is on initial file - integer :: p - !--------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='sabs_roof_dir', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by roof per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_roof_dir_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_roof_dif', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by roof per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_roof_dif_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_sunwall_dir', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by sunwall per unit wall area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_sunwall_dir_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_sunwall_dif', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by sunwall per unit wall area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_sunwall_dif_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_shadewall_dir', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by shadewall per unit wall area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_shadewall_dir_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_shadewall_dif', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by shadewall per unit wall area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_shadewall_dif_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_improad_dir', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by impervious road per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_improad_dir_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_improad_dif', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by impervious road per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_improad_dif_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_perroad_dir', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by pervious road per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_perroad_dir_lun) - - call restartvar(ncid=ncid, flag=flag, varname='sabs_perroad_dif', xtype=ncd_double, dim1name='landunit', & - dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by pervious road per unit ground area per unit incident flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%sabs_perroad_dif_lun) - - if(use_luna)then - call restartvar(ncid=ncid, flag=flag, varname='par240d', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='10-day running mean of daytime absorbed PAR for leaves in canopy layer', units='W/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%par240d_z_patch ) - call restartvar(ncid=ncid, flag=flag, varname='par24d', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Accumulative daytime absorbed PAR for leaves in canopy layer for 24 hours', units='J/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%par24d_z_patch ) - - call restartvar(ncid=ncid, flag=flag, varname='par240x', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='10-day running mean of maximum absorbed PAR for leaves in canopy layers', units='W/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%par240x_z_patch ) - call restartvar(ncid=ncid, flag=flag, varname='par24x', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Maximum absorbed PAR for leaves in canopy layer in 24 hours', units='J/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%par24x_z_patch ) - - call restartvar(ncid=ncid, flag=flag, varname='parsun', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Instaneous absorbed PAR for sunlit leaves in canopy layer', units='W/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%parsun_z_patch ) - call restartvar(ncid=ncid, flag=flag, varname='parsha', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='Instaneous absorbed PAR for shaded leaves in canopy layer', units='W/m**2 leaf', & - interpinic_flag='interp', readvar=readvar, data=this%parsha_z_patch ) - - endif - - end subroutine Restart - -end module SolarAbsorbedType diff --git a/src/biogeophys/SurfaceAlbedoMod.F90 b/src/biogeophys/SurfaceAlbedoMod.F90 deleted file mode 100644 index 9ad3229543..0000000000 --- a/src/biogeophys/SurfaceAlbedoMod.F90 +++ /dev/null @@ -1,1602 +0,0 @@ -module SurfaceAlbedoMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Performs surface albedo calculations - ! - ! !PUBLIC TYPES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use landunit_varcon , only : istsoil, istcrop, istdlak - use clm_varcon , only : grlnd, namep - use clm_varpar , only : numrad, nlevcan, nlevsno, nlevcan - use clm_varctl , only : fsurdat, iulog, use_snicar_frc - use pftconMod , only : pftcon - use SnowSnicarMod , only : sno_nbr_aer, SNICAR_RT, DO_SNO_AER, DO_SNO_OC - use AerosolMod , only : aerosol_type - use CanopyStateType , only : canopystate_type - use LakeStateType , only : lakestate_type - use SurfaceAlbedoType , only : surfalb_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - - use CanopyHydrologyMod, only : IsSnowvegFlagOn, IsSnowvegFlagOnRad - ! - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SurfaceAlbedoInitTimeConst - public :: SurfaceAlbedo ! Surface albedo and two-stream fluxes - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: SoilAlbedo ! Determine ground surface albedo - private :: TwoStream ! Two-stream fluxes for canopy radiative transfer - ! - ! !PUBLIC DATA MEMBERS: - ! The CLM default albice values are too high. - ! Full-spectral albedo for land ice is ~0.5 (Paterson, Physics of Glaciers, 1994, p. 59) - ! This is the value used in CAM3 by Pritchard et al., GRL, 35, 2008. - - ! albedo land ice by waveband (1=vis, 2=nir) - real(r8), public :: albice(numrad) = (/ 0.80_r8, 0.55_r8 /) - - ! namelist default setting for inputting alblakwi - real(r8), public :: lake_melt_icealb(numrad) = (/ 0.10_r8, 0.10_r8/) - - ! albedo frozen lakes by waveband (1=vis, 2=nir) - ! unclear what the reference is for this - real(r8), private :: alblak(numrad) = (/0.60_r8, 0.40_r8/) - - ! albedo of melting lakes due to puddling, open water, or white ice - ! From D. Mironov (2010) Boreal Env. Research - ! To revert albedo of melting lakes to the cold snow-free value, set - ! lake_melt_icealb namelist to 0.60, 0.40 like alblak above. - real(r8), private :: alblakwi(numrad) - - ! Coefficient for calculating ice "fraction" for lake surface albedo - ! From D. Mironov (2010) Boreal Env. Research - real(r8), parameter :: calb = 95.6_r8 - - ! - ! !PRIVATE DATA MEMBERS: - ! Snow in vegetation canopy namelist options. - logical, private :: snowveg_onrad = .true. ! snowveg_flag = 'ON_RAD' - - ! - ! !PRIVATE DATA FUNCTIONS: - real(r8), allocatable, private :: albsat(:,:) ! wet soil albedo by color class and waveband (1=vis,2=nir) - real(r8), allocatable, private :: albdry(:,:) ! dry soil albedo by color class and waveband (1=vis,2=nir) - integer , allocatable, private :: isoicol(:) ! column soil color class - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SurfaceAlbedoInitTimeConst(bounds) - ! - ! !DESCRIPTION: - ! Initialize module time constant variables - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - use fileutils , only : getfil - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_pio_openfile, ncd_pio_closefile - use spmdMod , only : masterproc - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,g ! indices - integer :: mxsoil_color ! maximum number of soil color classes - type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: locfn ! local filename - integer :: ier ! error status - logical :: readvar - integer ,pointer :: soic2d (:) ! read in - soil color - !--------------------------------------------------------------------- - - ! Allocate module variable for soil color - - allocate(isoicol(bounds%begc:bounds%endc)) - - ! Determine soil color and number of soil color classes - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - call ncd_io(ncid=ncid, varname='mxsoil_color', flag='read', data=mxsoil_color, readvar=readvar) - if ( .not. readvar ) then - call endrun(msg=' ERROR: mxsoil_color NOT on surfdata file '//errMsg(sourcefile, __LINE__)) - end if - - allocate(soic2d(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='SOIL_COLOR', flag='read', data=soic2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: SOIL_COLOR NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - isoicol(c) = soic2d(g) - end do - deallocate(soic2d) - - call ncd_pio_closefile(ncid) - - ! Determine saturated and dry soil albedos for n color classes and - ! numrad wavebands (1=vis, 2=nir) - - allocate(albsat(mxsoil_color,numrad), albdry(mxsoil_color,numrad), stat=ier) - if (ier /= 0) then - write(iulog,*)'allocation error for albsat, albdry' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (masterproc) then - write(iulog,*) 'Attempting to read soil colo data .....' - end if - - if (mxsoil_color == 8) then - albsat(1:8,1) = (/0.12_r8,0.11_r8,0.10_r8,0.09_r8,0.08_r8,0.07_r8,0.06_r8,0.05_r8/) - albsat(1:8,2) = (/0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8/) - albdry(1:8,1) = (/0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8/) - albdry(1:8,2) = (/0.48_r8,0.44_r8,0.40_r8,0.36_r8,0.32_r8,0.28_r8,0.24_r8,0.20_r8/) - else if (mxsoil_color == 20) then - albsat(1:20,1) = (/0.25_r8,0.23_r8,0.21_r8,0.20_r8,0.19_r8,0.18_r8,0.17_r8,0.16_r8,& - 0.15_r8,0.14_r8,0.13_r8,0.12_r8,0.11_r8,0.10_r8,0.09_r8,0.08_r8,0.07_r8,0.06_r8,0.05_r8,0.04_r8/) - albsat(1:20,2) = (/0.50_r8,0.46_r8,0.42_r8,0.40_r8,0.38_r8,0.36_r8,0.34_r8,0.32_r8,& - 0.30_r8,0.28_r8,0.26_r8,0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8,0.08_r8/) - albdry(1:20,1) = (/0.36_r8,0.34_r8,0.32_r8,0.31_r8,0.30_r8,0.29_r8,0.28_r8,0.27_r8,& - 0.26_r8,0.25_r8,0.24_r8,0.23_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8,0.08_r8/) - albdry(1:20,2) = (/0.61_r8,0.57_r8,0.53_r8,0.51_r8,0.49_r8,0.48_r8,0.45_r8,0.43_r8,& - 0.41_r8,0.39_r8,0.37_r8,0.35_r8,0.33_r8,0.31_r8,0.29_r8,0.27_r8,0.25_r8,0.23_r8,0.21_r8,0.16_r8/) - else - write(iulog,*)'maximum color class = ',mxsoil_color,' is not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Set alblakwi - alblakwi(:) = lake_melt_icealb(:) - - end subroutine SurfaceAlbedoInitTimeConst - - !----------------------------------------------------------------------- - subroutine SurfaceAlbedo(bounds,nc, & - num_nourbanc, filter_nourbanc, & - num_nourbanp, filter_nourbanp, & - num_urbanc , filter_urbanc, & - num_urbanp , filter_urbanp, & - nextsw_cday , declinp1, & - clm_fates, & - aerosol_inst, canopystate_inst, waterstate_inst, & - lakestate_inst, temperature_inst, surfalb_inst) - ! - ! !DESCRIPTION: - ! Surface albedo and two-stream fluxes - ! Surface albedos. Also fluxes (per unit incoming direct and diffuse - ! radiation) reflected, transmitted, and absorbed by vegetation. - ! Calculate sunlit and shaded fluxes as described by - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 and extended to - ! a multi-layer canopy to calculate APAR profile - ! - ! The calling sequence is: - ! -> SurfaceAlbedo: albedos for next time step - ! -> SoilAlbedo: soil/lake/glacier/wetland albedos - ! -> SNICAR_RT: snow albedos: direct beam (SNICAR) - ! -> SNICAR_RT: snow albedos: diffuse (SNICAR) - ! -> TwoStream: absorbed, reflected, transmitted solar fluxes (vis dir,vis dif, nir dir, nir dif) - ! - ! Note that this is called with the "inactive_and_active" version of the filters, because - ! the variables computed here are needed over inactive points that might later become - ! active (due to landuse change). Thus, this routine cannot depend on variables that are - ! only computed over active points. - ! - ! !USES: - use shr_orb_mod - use clm_time_manager , only : get_nstep - use abortutils , only : endrun - use clm_varctl , only : subgridflag, use_snicar_frc, use_fates - use CLMFatesInterfaceMod, only : hlm_fates_interface_type - - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: nc ! clump index - integer , intent(in) :: num_nourbanc ! number of columns in non-urban filter - integer , intent(in) :: filter_nourbanc(:) ! column filter for non-urban points - integer , intent(in) :: num_nourbanp ! number of patches in non-urban filter - integer , intent(in) :: filter_nourbanp(:) ! patch filter for non-urban points - integer , intent(in) :: num_urbanc ! number of columns in urban filter - integer , intent(in) :: filter_urbanc(:) ! column filter for urban points - integer , intent(in) :: num_urbanp ! number of patches in urban filter - integer , intent(in) :: filter_urbanp(:) ! patch filter for rban points - real(r8) , intent(in) :: nextsw_cday ! calendar day at Greenwich (1.00, ..., days/year) - real(r8) , intent(in) :: declinp1 ! declination angle (radians) for next time step - type(hlm_fates_interface_type), intent(inout) :: clm_fates - type(aerosol_type) , intent(in) :: aerosol_inst - type(canopystate_type) , intent(in) :: canopystate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(lakestate_type) , intent(in) :: lakestate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(surfalb_type) , intent(inout) :: surfalb_inst - ! - ! !LOCAL VARIABLES: - integer :: i ! index for layers [idx] - integer :: aer ! index for sno_nbr_aer - real(r8) :: extkn ! nitrogen allocation coefficient - integer :: fp,fc,g,c,p,iv ! indices - integer :: ib ! band index - integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - real(r8) :: dinc ! lai+sai increment for canopy layer - real(r8) :: dincmax ! maximum lai+sai increment for canopy layer - real(r8) :: dincmax_sum ! cumulative sum of maximum lai+sai increment for canopy layer - real(r8) :: laisum ! sum of canopy layer lai for error check - real(r8) :: saisum ! sum of canopy layer sai for error check - integer :: flg_slr ! flag for SNICAR (=1 if direct, =2 if diffuse) - integer :: flg_snw_ice ! flag for SNICAR (=1 when called from CLM, =2 when called from sea-ice) - integer :: num_vegsol ! number of vegetated patches where coszen>0 - integer :: num_novegsol ! number of vegetated patches where coszen>0 - integer :: filter_vegsol (bounds%endp-bounds%begp+1) ! patch filter where vegetated and coszen>0 - integer :: filter_novegsol (bounds%endp-bounds%begp+1) ! patch filter where vegetated and coszen>0 - real(r8) :: wl (bounds%begp:bounds%endp) ! fraction of LAI+SAI that is LAI - real(r8) :: ws (bounds%begp:bounds%endp) ! fraction of LAI+SAI that is SAI - real(r8) :: blai(bounds%begp:bounds%endp) ! lai buried by snow: tlai - elai - real(r8) :: bsai(bounds%begp:bounds%endp) ! sai buried by snow: tsai - esai - real(r8) :: coszen_gcell (bounds%begg:bounds%endg) ! cosine solar zenith angle for next time step (grc) - real(r8) :: coszen_patch (bounds%begp:bounds%endp) ! cosine solar zenith angle for next time step (patch) - real(r8) :: rho(bounds%begp:bounds%endp,numrad) ! leaf/stem refl weighted by fraction LAI and SAI - real(r8) :: tau(bounds%begp:bounds%endp,numrad) ! leaf/stem tran weighted by fraction LAI and SAI - real(r8) :: albsfc (bounds%begc:bounds%endc,numrad) ! albedo of surface underneath snow (col,bnd) - real(r8) :: albsnd(bounds%begc:bounds%endc,numrad) ! snow albedo (direct) - real(r8) :: albsni(bounds%begc:bounds%endc,numrad) ! snow albedo (diffuse) - real(r8) :: albsnd_pur (bounds%begc:bounds%endc,numrad) ! direct pure snow albedo (radiative forcing) - real(r8) :: albsni_pur (bounds%begc:bounds%endc,numrad) ! diffuse pure snow albedo (radiative forcing) - real(r8) :: albsnd_bc (bounds%begc:bounds%endc,numrad) ! direct snow albedo without BC (radiative forcing) - real(r8) :: albsni_bc (bounds%begc:bounds%endc,numrad) ! diffuse snow albedo without BC (radiative forcing) - real(r8) :: albsnd_oc (bounds%begc:bounds%endc,numrad) ! direct snow albedo without OC (radiative forcing) - real(r8) :: albsni_oc (bounds%begc:bounds%endc,numrad) ! diffuse snow albedo without OC (radiative forcing) - real(r8) :: albsnd_dst (bounds%begc:bounds%endc,numrad) ! direct snow albedo without dust (radiative forcing) - real(r8) :: albsni_dst (bounds%begc:bounds%endc,numrad) ! diffuse snow albedo without dust (radiative forcing) - real(r8) :: flx_absd_snw (bounds%begc:bounds%endc,-nlevsno+1:1,numrad) ! flux absorption factor for just snow (direct) [frc] - real(r8) :: flx_absi_snw (bounds%begc:bounds%endc,-nlevsno+1:1,numrad) ! flux absorption factor for just snow (diffuse) [frc] - real(r8) :: foo_snw (bounds%begc:bounds%endc,-nlevsno+1:1,numrad) ! dummy array for forcing calls - real(r8) :: h2osno_liq (bounds%begc:bounds%endc,-nlevsno+1:0) ! liquid snow content (col,lyr) [kg m-2] - real(r8) :: h2osno_ice (bounds%begc:bounds%endc,-nlevsno+1:0) ! ice content in snow (col,lyr) [kg m-2] - integer :: snw_rds_in (bounds%begc:bounds%endc,-nlevsno+1:0) ! snow grain size sent to SNICAR (col,lyr) [microns] - real(r8) :: mss_cnc_aer_in_frc_pur (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for forcing calculation (zero) (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_bc (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for BC forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_oc (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for OC forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_dst (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for dust forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_fdb (bounds%begc:bounds%endc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of all aerosol species for feedback calculation (col,lyr,aer) [kg kg-1] - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - integer , parameter :: nband =numrad ! number of solar radiation waveband classes - !----------------------------------------------------------------------- - - associate(& - rhol => pftcon%rhol , & ! Input: leaf reflectance: 1=vis, 2=nir - rhos => pftcon%rhos , & ! Input: stem reflectance: 1=vis, 2=nir - taul => pftcon%taul , & ! Input: leaf transmittance: 1=vis, 2=nir - taus => pftcon%taus , & ! Input: stem transmittance: 1=vis, 2=nir - - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow - tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water content (col,lyr) [kg/m2] - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens content (col,lyr) [kg/m2] - snw_rds => waterstate_inst%snw_rds_col , & ! Input: [real(r8) (:,:) ] snow grain radius (col,lyr) [microns] - - mss_cnc_bcphi => aerosol_inst%mss_cnc_bcphi_col , & ! Input: [real(r8) (:,:) ] mass concentration of hydrophilic BC (col,lyr) [kg/kg] - mss_cnc_bcpho => aerosol_inst%mss_cnc_bcpho_col , & ! Input: [real(r8) (:,:) ] mass concentration of hydrophobic BC (col,lyr) [kg/kg] - mss_cnc_ocphi => aerosol_inst%mss_cnc_ocphi_col , & ! Input: [real(r8) (:,:) ] mass concentration of hydrophilic OC (col,lyr) [kg/kg] - mss_cnc_ocpho => aerosol_inst%mss_cnc_ocpho_col , & ! Input: [real(r8) (:,:) ] mass concentration of hydrophobic OC (col,lyr) [kg/kg] - mss_cnc_dst1 => aerosol_inst%mss_cnc_dst1_col , & ! Input: [real(r8) (:,:) ] mass concentration of dust aerosol species 1 (col,lyr) [kg/kg] - mss_cnc_dst2 => aerosol_inst%mss_cnc_dst2_col , & ! Input: [real(r8) (:,:) ] mass concentration of dust aerosol species 2 (col,lyr) [kg/kg] - mss_cnc_dst3 => aerosol_inst%mss_cnc_dst3_col , & ! Input: [real(r8) (:,:) ] mass concentration of dust aerosol species 3 (col,lyr) [kg/kg] - mss_cnc_dst4 => aerosol_inst%mss_cnc_dst4_col , & ! Input: [real(r8) (:,:) ] mass concentration of dust aerosol species 4 (col,lyr) [kg/kg] - - fsun_z => surfalb_inst%fsun_z_patch , & ! Output: [real(r8) (:,:) ] sunlit fraction of canopy layer - tlai_z => surfalb_inst%tlai_z_patch , & ! Output: [real(r8) (:,:) ] tlai increment for canopy layer - tsai_z => surfalb_inst%tsai_z_patch , & ! Output: [real(r8) (:,:) ] tsai increment for canopy layer - vcmaxcintsun => surfalb_inst%vcmaxcintsun_patch , & ! Output: [real(r8) (:) ] leaf to canopy scaling coefficient, sunlit leaf vcmax - vcmaxcintsha => surfalb_inst%vcmaxcintsha_patch , & ! Output: [real(r8) (:) ] leaf to canopy scaling coefficient, shaded leaf vcmax - ncan => surfalb_inst%ncan_patch , & ! Output: [integer (:) ] number of canopy layers - nrad => surfalb_inst%nrad_patch , & ! Output: [integer (:) ] number of canopy layers, above snow for radiative transfer - coszen_col => surfalb_inst%coszen_col , & ! Output: [real(r8) (:) ] cosine of solar zenith angle - albgrd => surfalb_inst%albgrd_col , & ! Output: [real(r8) (:,:) ] ground albedo (direct) - albgri => surfalb_inst%albgri_col , & ! Output: [real(r8) (:,:) ] ground albedo (diffuse) - albsod => surfalb_inst%albsod_col , & ! Output: [real(r8) (:,:) ] direct-beam soil albedo (col,bnd) [frc] - albsoi => surfalb_inst%albsoi_col , & ! Output: [real(r8) (:,:) ] diffuse soil albedo (col,bnd) [frc] - albgrd_pur => surfalb_inst%albgrd_pur_col , & ! Output: [real(r8) (:,:) ] pure snow ground albedo (direct) - albgri_pur => surfalb_inst%albgri_pur_col , & ! Output: [real(r8) (:,:) ] pure snow ground albedo (diffuse) - albgrd_bc => surfalb_inst%albgrd_bc_col , & ! Output: [real(r8) (:,:) ] ground albedo without BC (direct) - albgri_bc => surfalb_inst%albgri_bc_col , & ! Output: [real(r8) (:,:) ] ground albedo without BC (diffuse) - albgrd_oc => surfalb_inst%albgrd_oc_col , & ! Output: [real(r8) (:,:) ] ground albedo without OC (direct) - albgri_oc => surfalb_inst%albgri_oc_col , & ! Output: [real(r8) (:,:) ] ground albedo without OC (diffuse) - albgrd_dst => surfalb_inst%albgrd_dst_col , & ! Output: [real(r8) (:,:) ] ground albedo without dust (direct) - albgri_dst => surfalb_inst%albgri_dst_col , & ! Output: [real(r8) (:,:) ] ground albedo without dust (diffuse) - albsnd_hst => surfalb_inst%albsnd_hst_col , & ! Output: [real(r8) (:,:) ] snow albedo, direct, for history files (col,bnd) [frc] - albsni_hst => surfalb_inst%albsni_hst_col , & ! Output: [real(r8) (:,:) ] snow ground albedo, diffuse, for history files (col,bnd) [frc] - albd => surfalb_inst%albd_patch , & ! Output: [real(r8) (:,:) ] surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Output: [real(r8) (:,:) ] surface albedo (diffuse) - fabd => surfalb_inst%fabd_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit direct flux - fabd_sun => surfalb_inst%fabd_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit direct flux - fabd_sha => surfalb_inst%fabd_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit direct flux - fabi => surfalb_inst%fabi_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit diffuse flux - fabi_sun => surfalb_inst%fabi_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit diffuse flux - fabi_sha => surfalb_inst%fabi_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit diffuse flux - ftdd => surfalb_inst%ftdd_patch , & ! Output: [real(r8) (:,:) ] down direct flux below canopy per unit direct flux - ftid => surfalb_inst%ftid_patch , & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit direct flux - ftii => surfalb_inst%ftii_patch , & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit diffuse flux - flx_absdv => surfalb_inst%flx_absdv_col , & ! Output: [real(r8) (:,:) ] direct flux absorption factor (col,lyr): VIS [frc] - flx_absdn => surfalb_inst%flx_absdn_col , & ! Output: [real(r8) (:,:) ] direct flux absorption factor (col,lyr): NIR [frc] - flx_absiv => surfalb_inst%flx_absiv_col , & ! Output: [real(r8) (:,:) ] diffuse flux absorption factor (col,lyr): VIS [frc] - flx_absin => surfalb_inst%flx_absin_col , & ! Output: [real(r8) (:,:) ] diffuse flux absorption factor (col,lyr): NIR [frc] - fabd_sun_z => surfalb_inst%fabd_sun_z_patch , & ! Output: [real(r8) (:,:) ] absorbed sunlit leaf direct PAR (per unit lai+sai) for each canopy layer - fabd_sha_z => surfalb_inst%fabd_sha_z_patch , & ! Output: [real(r8) (:,:) ] absorbed shaded leaf direct PAR (per unit lai+sai) for each canopy layer - fabi_sun_z => surfalb_inst%fabi_sun_z_patch , & ! Output: [real(r8) (:,:) ] absorbed sunlit leaf diffuse PAR (per unit lai+sai) for each canopy layer - fabi_sha_z => surfalb_inst%fabi_sha_z_patch & ! Output: [real(r8) (:,:) ] absorbed shaded leaf diffuse PAR (per unit lai+sai) for each canopy layer - ) - - ! Cosine solar zenith angle for next time step - - do g = bounds%begg,bounds%endg - coszen_gcell(g) = shr_orb_cosz (nextsw_cday, grc%lat(g), grc%lon(g), declinp1) - end do - do c = bounds%begc,bounds%endc - g = col%gridcell(c) - coszen_col(c) = coszen_gcell(g) - end do - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - g = patch%gridcell(p) - coszen_patch(p) = coszen_gcell(g) - end do - - ! Initialize output because solar radiation only done if coszen > 0 - - do ib = 1, numrad - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - albsod(c,ib) = 0._r8 - albsoi(c,ib) = 0._r8 - albgrd(c,ib) = 0._r8 - albgri(c,ib) = 0._r8 - albgrd_pur(c,ib) = 0._r8 - albgri_pur(c,ib) = 0._r8 - albgrd_bc(c,ib) = 0._r8 - albgri_bc(c,ib) = 0._r8 - albgrd_oc(c,ib) = 0._r8 - albgri_oc(c,ib) = 0._r8 - albgrd_dst(c,ib) = 0._r8 - albgri_dst(c,ib) = 0._r8 - do i=-nlevsno+1,1,1 - flx_absdv(c,i) = 0._r8 - flx_absdn(c,i) = 0._r8 - flx_absiv(c,i) = 0._r8 - flx_absin(c,i) = 0._r8 - enddo - end do - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - albd(p,ib) = 1._r8 - albi(p,ib) = 1._r8 - fabd(p,ib) = 0._r8 - fabd_sun(p,ib) = 0._r8 - fabd_sha(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - fabi_sun(p,ib) = 0._r8 - fabi_sha(p,ib) = 0._r8 - ftdd(p,ib) = 0._r8 - ftid(p,ib) = 0._r8 - ftii(p,ib) = 0._r8 - end do - - end do ! end of numrad loop - - ! SoilAlbedo called before SNICAR_RT - ! so that reflectance of soil beneath snow column is known - ! ahead of time for snow RT calculation. - - ! Snow albedos - ! Note that snow albedo routine will only compute nonzero snow albedos - ! where h2osno> 0 and coszen > 0 - - ! Ground surface albedos - ! Note that ground albedo routine will only compute nonzero snow albedos - ! where coszen > 0 - - call SoilAlbedo(bounds, & - num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - albsnd(bounds%begc:bounds%endc, :), & - albsni(bounds%begc:bounds%endc, :), & - lakestate_inst, temperature_inst, waterstate_inst, surfalb_inst) - - ! set variables to pass to SNICAR. - - flg_snw_ice = 1 ! calling from CLM, not CSIM - do c=bounds%begc,bounds%endc - albsfc(c,:) = albsoi(c,:) - h2osno_liq(c,:) = h2osoi_liq(c,-nlevsno+1:0) - h2osno_ice(c,:) = h2osoi_ice(c,-nlevsno+1:0) - snw_rds_in(c,:) = nint(snw_rds(c,:)) - end do - - ! zero aerosol input arrays - do aer = 1, sno_nbr_aer - do i = -nlevsno+1, 0 - do c = bounds%begc, bounds%endc - mss_cnc_aer_in_frc_pur(c,i,aer) = 0._r8 - mss_cnc_aer_in_frc_bc(c,i,aer) = 0._r8 - mss_cnc_aer_in_frc_oc(c,i,aer) = 0._r8 - mss_cnc_aer_in_frc_dst(c,i,aer) = 0._r8 - mss_cnc_aer_in_fdb(c,i,aer) = 0._r8 - end do - end do - end do - - ! Set aerosol input arrays - ! feedback input arrays have been zeroed - ! set soot and dust aerosol concentrations: - if (DO_SNO_AER) then - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,1) = mss_cnc_bcphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,2) = mss_cnc_bcpho(bounds%begc:bounds%endc,:) - - ! DO_SNO_OC is set in SNICAR_varpar. Default case is to ignore OC concentrations because: - ! 1) Knowledge of their optical properties is primitive - ! 2) When 'water-soluble' OPAC optical properties are applied to OC in snow, - ! it has a negligible darkening effect. - if (DO_SNO_OC) then - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,3) = mss_cnc_ocphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,4) = mss_cnc_ocpho(bounds%begc:bounds%endc,:) - endif - - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,5) = mss_cnc_dst1(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,6) = mss_cnc_dst2(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,7) = mss_cnc_dst3(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc,:,8) = mss_cnc_dst4(bounds%begc:bounds%endc,:) - endif - - ! If radiative forcing is being calculated, first estimate clean-snow albedo - - if (use_snicar_frc) then - ! 1. BC input array: - ! set dust and (optionally) OC concentrations, so BC_FRC=[(BC+OC+dust)-(OC+dust)] - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,5) = mss_cnc_dst1(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,6) = mss_cnc_dst2(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,7) = mss_cnc_dst3(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,8) = mss_cnc_dst4(bounds%begc:bounds%endc,:) - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,3) = mss_cnc_ocphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc,:,4) = mss_cnc_ocpho(bounds%begc:bounds%endc,:) - endif - - ! BC FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsnd_bc(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_bc(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsni_bc(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - ! 2. OC input array: - ! set BC and dust concentrations, so OC_FRC=[(BC+OC+dust)-(BC+dust)] - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,1) = mss_cnc_bcphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,2) = mss_cnc_bcpho(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,5) = mss_cnc_dst1(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,6) = mss_cnc_dst2(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,7) = mss_cnc_dst3(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc,:,8) = mss_cnc_dst4(bounds%begc:bounds%endc,:) - - ! OC FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsnd_oc(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_oc(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsni_oc(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - endif - - ! 3. DUST input array: - ! set BC and OC concentrations, so DST_FRC=[(BC+OC+dust)-(BC+OC)] - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc,:,1) = mss_cnc_bcphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc,:,2) = mss_cnc_bcpho(bounds%begc:bounds%endc,:) - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc,:,3) = mss_cnc_ocphi(bounds%begc:bounds%endc,:) - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc,:,4) = mss_cnc_ocpho(bounds%begc:bounds%endc,:) - endif - - ! DUST FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsnd_dst(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_dst(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsni_dst(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - ! 4. ALL AEROSOL FORCING CALCULATION - ! (pure snow albedo) - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_pur(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsnd_pur(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_frc_pur(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsni_pur(bounds%begc:bounds%endc, :), & - foo_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - end if - - ! CLIMATE FEEDBACK CALCULATIONS, ALL AEROSOLS: - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsnd(bounds%begc:bounds%endc, :), & - flx_absd_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, bounds, num_nourbanc, filter_nourbanc, & - coszen_col(bounds%begc:bounds%endc), & - flg_slr, & - h2osno_liq(bounds%begc:bounds%endc, :), & - h2osno_ice(bounds%begc:bounds%endc, :), & - snw_rds_in(bounds%begc:bounds%endc, :), & - mss_cnc_aer_in_fdb(bounds%begc:bounds%endc, :, :), & - albsfc(bounds%begc:bounds%endc, :), & - albsni(bounds%begc:bounds%endc, :), & - flx_absi_snw(bounds%begc:bounds%endc, :, :), & - waterstate_inst) - - ! ground albedos and snow-fraction weighting of snow absorption factors - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if (coszen_col(c) > 0._r8) then - ! ground albedo was originally computed in SoilAlbedo, but is now computed here - ! because the order of SoilAlbedo and SNICAR_RT was switched for SNICAR. - albgrd(c,ib) = albsod(c,ib)*(1._r8-frac_sno(c)) + albsnd(c,ib)*frac_sno(c) - albgri(c,ib) = albsoi(c,ib)*(1._r8-frac_sno(c)) + albsni(c,ib)*frac_sno(c) - - ! albedos for radiative forcing calculations: - if (use_snicar_frc) then - ! BC forcing albedo - albgrd_bc(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_bc(c,ib)*frac_sno(c) - albgri_bc(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_bc(c,ib)*frac_sno(c) - - if (DO_SNO_OC) then - ! OC forcing albedo - albgrd_oc(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_oc(c,ib)*frac_sno(c) - albgri_oc(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_oc(c,ib)*frac_sno(c) - endif - - ! dust forcing albedo - albgrd_dst(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_dst(c,ib)*frac_sno(c) - albgri_dst(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_dst(c,ib)*frac_sno(c) - - ! pure snow albedo for all-aerosol radiative forcing - albgrd_pur(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_pur(c,ib)*frac_sno(c) - albgri_pur(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_pur(c,ib)*frac_sno(c) - end if - - ! also in this loop (but optionally in a different loop for vectorized code) - ! weight snow layer radiative absorption factors based on snow fraction and soil albedo - ! (NEEDED FOR ENERGY CONSERVATION) - do i = -nlevsno+1,1,1 - if (subgridflag == 0 .or. lun%itype(col%landunit(c)) == istdlak) then - if (ib == 1) then - flx_absdv(c,i) = flx_absd_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsod(c,ib))*(flx_absd_snw(c,i,ib)/(1.-albsnd(c,ib)))) - flx_absiv(c,i) = flx_absi_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsoi(c,ib))*(flx_absi_snw(c,i,ib)/(1.-albsni(c,ib)))) - elseif (ib == 2) then - flx_absdn(c,i) = flx_absd_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsod(c,ib))*(flx_absd_snw(c,i,ib)/(1.-albsnd(c,ib)))) - flx_absin(c,i) = flx_absi_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsoi(c,ib))*(flx_absi_snw(c,i,ib)/(1.-albsni(c,ib)))) - endif - else - if (ib == 1) then - flx_absdv(c,i) = flx_absd_snw(c,i,ib) - flx_absiv(c,i) = flx_absi_snw(c,i,ib) - elseif (ib == 2) then - flx_absdn(c,i) = flx_absd_snw(c,i,ib) - flx_absin(c,i) = flx_absi_snw(c,i,ib) - endif - endif - enddo - endif - enddo - enddo - - ! For diagnostics, set snow albedo to spval over non-snow non-urban points - ! so that it is not averaged in history buffer (OPTIONAL) - ! TODO - this is set to 0 not spval - seems wrong since it will be averaged in - - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if ((coszen_col(c) > 0._r8) .and. (h2osno(c) > 0._r8)) then - albsnd_hst(c,ib) = albsnd(c,ib) - albsni_hst(c,ib) = albsni(c,ib) - else - albsnd_hst(c,ib) = 0._r8 - albsni_hst(c,ib) = 0._r8 - endif - enddo - enddo - - ! Create solar-vegetated filter for the following calculations - - num_vegsol = 0 - num_novegsol = 0 - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - if (coszen_patch(p) > 0._r8) then - if ((lun%itype(patch%landunit(p)) == istsoil .or. & - lun%itype(patch%landunit(p)) == istcrop ) & - .and. (elai(p) + esai(p)) > 0._r8) then - num_vegsol = num_vegsol + 1 - filter_vegsol(num_vegsol) = p - else - num_novegsol = num_novegsol + 1 - filter_novegsol(num_novegsol) = p - end if - end if - end do - - ! Weight reflectance/transmittance by lai and sai - ! Only perform on vegetated patches where coszen > 0 - - do fp = 1,num_vegsol - p = filter_vegsol(fp) - wl(p) = elai(p) / max( elai(p)+esai(p), mpe ) - ws(p) = esai(p) / max( elai(p)+esai(p), mpe ) - end do - - do ib = 1, numrad - do fp = 1,num_vegsol - p = filter_vegsol(fp) - rho(p,ib) = max( rhol(patch%itype(p),ib)*wl(p) + rhos(patch%itype(p),ib)*ws(p), mpe ) - tau(p,ib) = max( taul(patch%itype(p),ib)*wl(p) + taus(patch%itype(p),ib)*ws(p), mpe ) - end do - end do - - ! Diagnose number of canopy layers for radiative transfer, in increments of dincmax. - ! Add to number of layers so long as cumulative leaf+stem area does not exceed total - ! leaf+stem area. Then add any remaining leaf+stem area to next layer and exit the loop. - ! Do this first for elai and esai (not buried by snow) and then for the part of the - ! canopy that is buried by snow. - ! ------------------ - ! tlai_z = leaf area increment for a layer - ! tsai_z = stem area increment for a layer - ! nrad = number of canopy layers above snow - ! ncan = total number of canopy layers - ! - ! tlai_z summed from 1 to nrad = elai - ! tlai_z summed from 1 to ncan = tlai - - ! tsai_z summed from 1 to nrad = esai - ! tsai_z summed from 1 to ncan = tsai - ! ------------------ - ! - ! Canopy layering needs to be done for all "num_nourbanp" not "num_vegsol" - ! because layering is needed for all time steps regardless of radiation - ! - ! Sun/shade big leaf code uses only one layer (nrad = ncan = 1), triggered by - ! nlevcan = 1 - - dincmax = 0.25_r8 - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - - if (nlevcan == 1) then - nrad(p) = 1 - ncan(p) = 1 - tlai_z(p,1) = elai(p) - tsai_z(p,1) = esai(p) - else if (nlevcan > 1) then - if (elai(p)+esai(p) == 0._r8) then - nrad(p) = 0 - else - dincmax_sum = 0._r8 - do iv = 1, nlevcan - dincmax_sum = dincmax_sum + dincmax - if (((elai(p)+esai(p))-dincmax_sum) > 1.e-06_r8) then - nrad(p) = iv - dinc = dincmax - tlai_z(p,iv) = dinc * elai(p) / max(elai(p)+esai(p), mpe) - tsai_z(p,iv) = dinc * esai(p) / max(elai(p)+esai(p), mpe) - else - nrad(p) = iv - dinc = dincmax - (dincmax_sum - (elai(p)+esai(p))) - tlai_z(p,iv) = dinc * elai(p) / max(elai(p)+esai(p), mpe) - tsai_z(p,iv) = dinc * esai(p) / max(elai(p)+esai(p), mpe) - exit - end if - end do - - ! Mimumum of 4 canopy layers - - if (nrad(p) < 4) then - nrad(p) = 4 - do iv = 1, nrad(p) - tlai_z(p,iv) = elai(p) / nrad(p) - tsai_z(p,iv) = esai(p) / nrad(p) - end do - end if - end if - end if - - ! Error check: make sure cumulative of increments does not exceed total - - laisum = 0._r8 - saisum = 0._r8 - do iv = 1, nrad(p) - laisum = laisum + tlai_z(p,iv) - saisum = saisum + tsai_z(p,iv) - end do - if (abs(laisum-elai(p)) > 1.e-06_r8 .or. abs(saisum-esai(p)) > 1.e-06_r8) then - write (iulog,*) 'multi-layer canopy error 01 in SurfaceAlbedo: ',& - nrad(p),elai(p),laisum,esai(p),saisum - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - - ! Repeat to find canopy layers buried by snow - - if (nlevcan > 1) then - blai(p) = tlai(p) - elai(p) - bsai(p) = tsai(p) - esai(p) - if (blai(p)+bsai(p) == 0._r8) then - ncan(p) = nrad(p) - else - dincmax_sum = 0._r8 - do iv = nrad(p)+1, nlevcan - dincmax_sum = dincmax_sum + dincmax - if (((blai(p)+bsai(p))-dincmax_sum) > 1.e-06_r8) then - ncan(p) = iv - dinc = dincmax - tlai_z(p,iv) = dinc * blai(p) / max(blai(p)+bsai(p), mpe) - tsai_z(p,iv) = dinc * bsai(p) / max(blai(p)+bsai(p), mpe) - else - ncan(p) = iv - dinc = dincmax - (dincmax_sum - (blai(p)+bsai(p))) - tlai_z(p,iv) = dinc * blai(p) / max(blai(p)+bsai(p), mpe) - tsai_z(p,iv) = dinc * bsai(p) / max(blai(p)+bsai(p), mpe) - exit - end if - end do - end if - - ! Error check: make sure cumulative of increments does not exceed total - - laisum = 0._r8 - saisum = 0._r8 - do iv = 1, ncan(p) - laisum = laisum + tlai_z(p,iv) - saisum = saisum + tsai_z(p,iv) - end do - if (abs(laisum-tlai(p)) > 1.e-06_r8 .or. abs(saisum-tsai(p)) > 1.e-06_r8) then - write (iulog,*) 'multi-layer canopy error 02 in SurfaceAlbedo: ',nrad(p),ncan(p) - write (iulog,*) tlai(p),elai(p),blai(p),laisum,tsai(p),esai(p),bsai(p),saisum - call endrun(decomp_index=p, clmlevel=namep, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - end do - - ! Zero fluxes for active canopy layers - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - do iv = 1, nrad(p) - fabd_sun_z(p,iv) = 0._r8 - fabd_sha_z(p,iv) = 0._r8 - fabi_sun_z(p,iv) = 0._r8 - fabi_sha_z(p,iv) = 0._r8 - fsun_z(p,iv) = 0._r8 - end do - end do - - ! Default leaf to canopy scaling coefficients, used when coszen <= 0. - ! This is the leaf nitrogen profile integrated over the full canopy. - ! Integrate exp(-kn*x) over x=0 to x=elai and assign to shaded canopy, - ! because sunlit fraction is 0. Canopy scaling coefficients are set in - ! TwoStream for coszen > 0. So kn must be set here and in TwoStream. - - extkn = 0.30_r8 - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - if (nlevcan == 1) then - vcmaxcintsun(p) = 0._r8 - vcmaxcintsha(p) = (1._r8 - exp(-extkn*elai(p))) / extkn - if (elai(p) > 0._r8) then - vcmaxcintsha(p) = vcmaxcintsha(p) / elai(p) - else - vcmaxcintsha(p) = 0._r8 - end if - else if (nlevcan > 1) then - vcmaxcintsun(p) = 0._r8 - vcmaxcintsha(p) = 0._r8 - end if - end do - - ! Calculate surface albedos and fluxes - ! Only perform on vegetated pfts where coszen > 0 - - if (use_fates) then - - call clm_fates%wrap_canopy_radiation(bounds, nc, & - num_vegsol, filter_vegsol, & - coszen_patch(bounds%begp:bounds%endp), surfalb_inst) - - else - - call TwoStream (bounds, filter_vegsol, num_vegsol, & - coszen_patch(bounds%begp:bounds%endp), & - rho(bounds%begp:bounds%endp, :), & - tau(bounds%begp:bounds%endp, :), & - canopystate_inst, temperature_inst, waterstate_inst, surfalb_inst) - - endif - - ! Determine values for non-vegetated patches where coszen > 0 - - do ib = 1,numrad - do fp = 1,num_novegsol - p = filter_novegsol(fp) - c = patch%column(p) - fabd(p,ib) = 0._r8 - fabd_sun(p,ib) = 0._r8 - fabd_sha(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - fabi_sun(p,ib) = 0._r8 - fabi_sha(p,ib) = 0._r8 - ftdd(p,ib) = 1._r8 - ftid(p,ib) = 0._r8 - ftii(p,ib) = 1._r8 - albd(p,ib) = albgrd(c,ib) - albi(p,ib) = albgri(c,ib) - end do - end do - - end associate - - end subroutine SurfaceAlbedo - - !----------------------------------------------------------------------- - subroutine SoilAlbedo (bounds, & - num_nourbanc, filter_nourbanc, & - coszen, albsnd, albsni, & - lakestate_inst, temperature_inst, waterstate_inst, surfalb_inst) - ! - ! !DESCRIPTION: - ! Determine ground surface albedo, accounting for snow - ! - ! !USES: - use clm_varpar , only : numrad - use clm_varcon , only : tfrz - use landunit_varcon , only : istice_mec, istdlak - use LakeCon , only : lakepuddling - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nourbanc ! number of columns in non-urban points in column filter - integer , intent(in) :: filter_nourbanc(:) ! column filter for non-urban points - real(r8), intent(in) :: coszen( bounds%begc: ) ! cos solar zenith angle next time step [col] - real(r8), intent(in) :: albsnd( bounds%begc: , 1: ) ! snow albedo (direct) [col, numrad] - real(r8), intent(in) :: albsni( bounds%begc: , 1: ) ! snow albedo (diffuse) [col, numrad] - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(lakestate_type) , intent(in) :: lakestate_inst - type(surfalb_type) , intent(inout) :: surfalb_inst - ! - ! !LOCAL VARIABLES: - ! - integer, parameter :: nband =numrad ! number of solar radiation waveband classes - integer :: fc ! non-urban filter column index - integer :: c,l ! indices - integer :: ib ! waveband number (1=vis, 2=nir) - real(r8) :: inc ! soil water correction factor for soil albedo - integer :: soilcol ! soilcolor - real(r8) :: sicefr ! Lake surface ice fraction (based on D. Mironov 2010) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsnd) == (/bounds%endc, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsni) == (/bounds%endc, numrad/)), errMsg(sourcefile, __LINE__)) - - associate(& - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water [m3/m3] - - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Input: [real(r8) (:,:) ] mass fraction of lake layer that is frozen - - albgrd => surfalb_inst%albgrd_col , & ! Output: [real(r8) (:,:) ] ground albedo (direct) - albgri => surfalb_inst%albgri_col , & ! Output: [real(r8) (:,:) ] ground albedo (diffuse) - albsod => surfalb_inst%albsod_col , & ! Output: [real(r8) (:,:) ] soil albedo (direct) - albsoi => surfalb_inst%albsoi_col & ! Output: [real(r8) (:,:) ] soil albedo (diffuse) - ) - - ! Compute soil albedos - - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if (coszen(c) > 0._r8) then - l = col%landunit(c) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then ! soil - inc = max(0.11_r8-0.40_r8*h2osoi_vol(c,1), 0._r8) - soilcol = isoicol(c) - ! changed from local variable to clm_type: - !albsod = min(albsat(soilcol,ib)+inc, albdry(soilcol,ib)) - !albsoi = albsod - albsod(c,ib) = min(albsat(soilcol,ib)+inc, albdry(soilcol,ib)) - albsoi(c,ib) = albsod(c,ib) - else if (lun%itype(l) == istice_mec) then ! land ice - ! changed from local variable to clm_type: - !albsod = albice(ib) - !albsoi = albsod - albsod(c,ib) = albice(ib) - albsoi(c,ib) = albsod(c,ib) - ! unfrozen lake, wetland - else if (t_grnd(c) > tfrz .or. (lakepuddling .and. lun%itype(l) == istdlak .and. t_grnd(c) == tfrz .and. & - lake_icefrac(c,1) < 1._r8 .and. lake_icefrac(c,2) > 0._r8) ) then - - albsod(c,ib) = 0.05_r8/(max(0.001_r8,coszen(c)) + 0.15_r8) - ! This expression is apparently from BATS according to Yongjiu Dai. - - ! The diffuse albedo should be an average over the whole sky of an angular-dependent direct expression. - ! The expression above may have been derived to encompass both (e.g. Henderson-Sellers 1986), - ! but I'll assume it applies more appropriately to the direct form for now. - - ! ZMS: Attn EK, currently restoring this for wetlands even though it is wrong in order to try to get - ! bfb baseline comparison when no lakes are present. I'm assuming wetlands will be phased out anyway. - if (lun%itype(l) == istdlak) then - albsoi(c,ib) = 0.10_r8 - else - albsoi(c,ib) = albsod(c,ib) - end if - - else ! frozen lake, wetland - ! Introduce crude surface frozen fraction according to D. Mironov (2010) - ! Attn EK: This formulation is probably just as good for "wetlands" if they are not phased out. - ! Tenatively I'm restricting this to lakes because I haven't tested it for wetlands. But if anything - ! the albedo should be lower when melting over frozen ground than a solid frozen lake. - ! - if (lun%itype(l) == istdlak .and. .not. lakepuddling .and. snl(c) == 0) then - ! Need to reference snow layers here because t_grnd could be over snow or ice - ! but we really want the ice surface temperature with no snow - sicefr = 1._r8 - exp(-calb * (tfrz - t_grnd(c))/tfrz) - albsod(c,ib) = sicefr*alblak(ib) + (1._r8-sicefr)*max(alblakwi(ib), & - 0.05_r8/(max(0.001_r8,coszen(c)) + 0.15_r8)) - albsoi(c,ib) = sicefr*alblak(ib) + (1._r8-sicefr)*max(alblakwi(ib), 0.10_r8) - ! Make sure this is no less than the open water albedo above. - ! Setting lake_melt_icealb(:) = alblak(:) in namelist reverts the melting albedo to the cold - ! snow-free value. - else - albsod(c,ib) = alblak(ib) - albsoi(c,ib) = albsod(c,ib) - end if - end if - - ! Weighting is done in SurfaceAlbedo, after the call to SNICAR_RT - ! This had to be done, because SoilAlbedo is called before SNICAR_RT, so at - ! this point, snow albedo is not yet known. - end if - end do - end do - - end associate - end subroutine SoilAlbedo - - !----------------------------------------------------------------------- - subroutine TwoStream (bounds, & - filter_vegsol, num_vegsol, & - coszen, rho, tau, & - canopystate_inst, temperature_inst, waterstate_inst, surfalb_inst) - ! - ! !DESCRIPTION: - ! Two-stream fluxes for canopy radiative transfer - ! Use two-stream approximation of Dickinson (1983) Adv Geophysics - ! 25:305-353 and Sellers (1985) Int J Remote Sensing 6:1335-1372 - ! to calculate fluxes absorbed by vegetation, reflected by vegetation, - ! and transmitted through vegetation for unit incoming direct or diffuse - ! flux given an underlying surface with known albedo. - ! Calculate sunlit and shaded fluxes as described by - ! Bonan et al (2011) JGR, 116, doi:10.1029/2010JG001593 and extended to - ! a multi-layer canopy to calculate APAR profile - ! - ! !USES: - use clm_varpar, only : numrad, nlevcan - use clm_varcon, only : omegas, tfrz, betads, betais - use clm_varctl, only : iulog - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: filter_vegsol (:) ! filter for vegetated patches with coszen>0 - integer , intent(in) :: num_vegsol ! number of vegetated patches where coszen>0 - real(r8), intent(in) :: coszen( bounds%begp: ) ! cosine solar zenith angle for next time step [pft] - real(r8), intent(in) :: rho( bounds%begp: , 1: ) ! leaf/stem refl weighted by fraction LAI and SAI [pft, numrad] - real(r8), intent(in) :: tau( bounds%begp: , 1: ) ! leaf/stem tran weighted by fraction LAI and SAI [pft, numrad] - type(canopystate_type) , intent(in) :: canopystate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(surfalb_type) , intent(inout) :: surfalb_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,p,c,iv ! array indices - integer :: ib ! waveband number - real(r8) :: cosz ! 0.001 <= coszen <= 1.000 - real(r8) :: asu ! single scattering albedo - real(r8) :: chil(bounds%begp:bounds%endp) ! -0.4 <= xl <= 0.6 - real(r8) :: gdir(bounds%begp:bounds%endp) ! leaf projection in solar direction (0 to 1) - real(r8) :: twostext(bounds%begp:bounds%endp)! optical depth of direct beam per unit leaf area - real(r8) :: avmu(bounds%begp:bounds%endp) ! average diffuse optical depth - real(r8) :: omega(bounds%begp:bounds%endp,numrad) ! fraction of intercepted radiation that is scattered (0 to 1) - real(r8) :: omegal ! omega for leaves - real(r8) :: betai ! upscatter parameter for diffuse radiation - real(r8) :: betail ! betai for leaves - real(r8) :: betad ! upscatter parameter for direct beam radiation - real(r8) :: betadl ! betad for leaves - real(r8) :: tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9 ! temporary - real(r8) :: p1,p2,p3,p4,s1,s2,u1,u2,u3 ! temporary - real(r8) :: b,c1,d,d1,d2,f,h,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10 ! temporary - real(r8) :: phi1,phi2,sigma ! temporary - real(r8) :: temp1 ! temporary - real(r8) :: temp0 (bounds%begp:bounds%endp) ! temporary - real(r8) :: temp2(bounds%begp:bounds%endp) ! temporary - real(r8) :: t1 ! temporary - real(r8) :: a1,a2 ! parameter for sunlit/shaded leaf radiation absorption - real(r8) :: v,dv,u,du ! temporary for flux derivatives - real(r8) :: dh2,dh3,dh5,dh6,dh7,dh8,dh9,dh10 ! temporary for flux derivatives - real(r8) :: da1,da2 ! temporary for flux derivatives - real(r8) :: d_ftid,d_ftii ! ftid, ftii derivative with respect to lai+sai - real(r8) :: d_fabd,d_fabi ! fabd, fabi derivative with respect to lai+sai - real(r8) :: d_fabd_sun,d_fabd_sha ! fabd_sun, fabd_sha derivative with respect to lai+sai - real(r8) :: d_fabi_sun,d_fabi_sha ! fabi_sun, fabi_sha derivative with respect to lai+sai - real(r8) :: laisum ! cumulative lai+sai for canopy layer (at middle of layer) - real(r8) :: extkb ! direct beam extinction coefficient - real(r8) :: extkn ! nitrogen allocation coefficient - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(rho) == (/bounds%endp, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tau) == (/bounds%endp, numrad/)), errMsg(sourcefile, __LINE__)) - - associate(& - xl => pftcon%xl , & ! Input: ecophys const - leaf/stem orientation index - - t_veg => temperature_inst%t_veg_patch , & ! Input: [real(r8) (:) ] vegetation temperature (Kelvin) - - fwet => waterstate_inst%fwet_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is wet (0 to 1) - fcansno => waterstate_inst%fcansno_patch , & ! Input: [real(r8) (:) ] fraction of canopy that is snow-covered (0 to 1) - - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - - tlai_z => surfalb_inst%tlai_z_patch , & ! Input: [real(r8) (:,:) ] tlai increment for canopy layer - tsai_z => surfalb_inst%tsai_z_patch , & ! Input: [real(r8) (:,:) ] tsai increment for canopy layer - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] number of canopy layers, above snow for radiative transfer - albgrd => surfalb_inst%albgrd_col , & ! Input: [real(r8) (:,:) ] ground albedo (direct) (column-level) - albgri => surfalb_inst%albgri_col , & ! Input: [real(r8) (:,:) ] ground albedo (diffuse)(column-level) - fsun_z => surfalb_inst%fsun_z_patch , & ! Output: [real(r8) (:,:) ] sunlit fraction of canopy layer - vcmaxcintsun => surfalb_inst%vcmaxcintsun_patch , & ! Output: [real(r8) (:) ] leaf to canopy scaling coefficient, sunlit leaf vcmax - vcmaxcintsha => surfalb_inst%vcmaxcintsha_patch , & ! Output: [real(r8) (:) ] leaf to canopy scaling coefficient, shaded leaf vcmax - fabd_sun_z => surfalb_inst%fabd_sun_z_patch , & ! Output: [real(r8) (:,:) ] absorbed sunlit leaf direct PAR (per unit lai+sai) for each canopy layer - fabd_sha_z => surfalb_inst%fabd_sha_z_patch , & ! Output: [real(r8) (:,:) ] absorbed shaded leaf direct PAR (per unit lai+sai) for each canopy layer - fabi_sun_z => surfalb_inst%fabi_sun_z_patch , & ! Output: [real(r8) (:,:) ] absorbed sunlit leaf diffuse PAR (per unit lai+sai) for each canopy layer - fabi_sha_z => surfalb_inst%fabi_sha_z_patch , & ! Output: [real(r8) (:,:) ] absorbed shaded leaf diffuse PAR (per unit lai+sai) for each canopy layer - albd => surfalb_inst%albd_patch , & ! Output: [real(r8) (:,:) ] surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Output: [real(r8) (:,:) ] surface albedo (diffuse) - fabd => surfalb_inst%fabd_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit direct flux - fabd_sun => surfalb_inst%fabd_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit direct flux - fabd_sha => surfalb_inst%fabd_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit direct flux - fabi => surfalb_inst%fabi_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit diffuse flux - fabi_sun => surfalb_inst%fabi_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit diffuse flux - fabi_sha => surfalb_inst%fabi_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit diffuse flux - ftdd => surfalb_inst%ftdd_patch , & ! Output: [real(r8) (:,:) ] down direct flux below canopy per unit direct flx - ftid => surfalb_inst%ftid_patch , & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit direct flx - ftii => surfalb_inst%ftii_patch & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit diffuse flx - ) - - ! Calculate two-stream parameters that are independent of waveband: - ! chil, gdir, twostext, avmu, and temp0 and temp2 (used for asu) - - do fp = 1,num_vegsol - p = filter_vegsol(fp) - - ! note that the following limit only acts on cosz values > 0 and less than - ! 0.001, not on values cosz = 0, since these zero have already been filtered - ! out in filter_vegsol - cosz = max(0.001_r8, coszen(p)) - - chil(p) = min( max(xl(patch%itype(p)), -0.4_r8), 0.6_r8 ) - if (abs(chil(p)) <= 0.01_r8) chil(p) = 0.01_r8 - phi1 = 0.5_r8 - 0.633_r8*chil(p) - 0.330_r8*chil(p)*chil(p) - phi2 = 0.877_r8 * (1._r8-2._r8*phi1) - gdir(p) = phi1 + phi2*cosz - twostext(p) = gdir(p)/cosz - avmu(p) = ( 1._r8 - phi1/phi2 * log((phi1+phi2)/phi1) ) / phi2 - ! Restrict this calculation of temp0. We have seen cases where small temp0 - ! can cause unrealistic single scattering albedo (asu) associated with the - ! log calculation in temp2 below, thereby eventually causing a negative soil albedo - ! See bugzilla bug 2431: http://bugs.cgd.ucar.edu/show_bug.cgi?id=2431 - temp0(p) = max(gdir(p) + phi2*cosz,1.e-6_r8) - temp1 = phi1*cosz - temp2(p) = ( 1._r8 - temp1/temp0(p) * log((temp1+temp0(p))/temp1) ) - end do - - ! Loop over all wavebands to calculate for the full canopy the scattered fluxes - ! reflected upward and transmitted downward by the canopy and the flux absorbed by the - ! canopy for a unit incoming direct beam and diffuse flux at the top of the canopy given - ! an underlying surface of known albedo. - ! - ! Output: - ! ------------------ - ! Direct beam fluxes - ! ------------------ - ! albd - Upward scattered flux above canopy (per unit direct beam flux) - ! ftid - Downward scattered flux below canopy (per unit direct beam flux) - ! ftdd - Transmitted direct beam flux below canopy (per unit direct beam flux) - ! fabd - Flux absorbed by canopy (per unit direct beam flux) - ! fabd_sun - Sunlit portion of fabd - ! fabd_sha - Shaded portion of fabd - ! fabd_sun_z - absorbed sunlit leaf direct PAR (per unit sunlit lai+sai) for each canopy layer - ! fabd_sha_z - absorbed shaded leaf direct PAR (per unit shaded lai+sai) for each canopy layer - ! ------------------ - ! Diffuse fluxes - ! ------------------ - ! albi - Upward scattered flux above canopy (per unit diffuse flux) - ! ftii - Downward scattered flux below canopy (per unit diffuse flux) - ! fabi - Flux absorbed by canopy (per unit diffuse flux) - ! fabi_sun - Sunlit portion of fabi - ! fabi_sha - Shaded portion of fabi - ! fabi_sun_z - absorbed sunlit leaf diffuse PAR (per unit sunlit lai+sai) for each canopy layer - ! fabi_sha_z - absorbed shaded leaf diffuse PAR (per unit shaded lai+sai) for each canopy layer - - ! Set status of snowveg_flag - snowveg_onrad = IsSnowvegFlagOnRad() - - do ib = 1, numrad - do fp = 1,num_vegsol - p = filter_vegsol(fp) - c = patch%column(p) - - ! Calculate two-stream parameters omega, betad, and betai. - ! Omega, betad, betai are adjusted for snow. Values for omega*betad - ! and omega*betai are calculated and then divided by the new omega - ! because the product omega*betai, omega*betad is used in solution. - ! Also, the transmittances and reflectances (tau, rho) are linear - ! weights of leaf and stem values. - - omegal = rho(p,ib) + tau(p,ib) - asu = 0.5_r8*omegal*gdir(p)/temp0(p) *temp2(p) - betadl = (1._r8+avmu(p)*twostext(p))/(omegal*avmu(p)*twostext(p))*asu - betail = 0.5_r8 * ((rho(p,ib)+tau(p,ib)) + (rho(p,ib)-tau(p,ib)) & - * ((1._r8+chil(p))/2._r8)**2) / omegal - - ! Adjust omega, betad, and betai for intercepted snow - - if (snowveg_onrad) then - tmp0 = (1._r8-fcansno(p))*omegal + fcansno(p)*omegas(ib) - tmp1 = ( (1._r8-fcansno(p))*omegal*betadl + fcansno(p)*omegas(ib)*betads ) / tmp0 - tmp2 = ( (1._r8-fcansno(p))*omegal*betail + fcansno(p)*omegas(ib)*betais ) / tmp0 - else - if (t_veg(p) > tfrz) then !no snow - tmp0 = omegal - tmp1 = betadl - tmp2 = betail - else - tmp0 = (1._r8-fwet(p))*omegal + fwet(p)*omegas(ib) - tmp1 = ( (1._r8-fwet(p))*omegal*betadl + fwet(p)*omegas(ib)*betads ) / tmp0 - tmp2 = ( (1._r8-fwet(p))*omegal*betail + fwet(p)*omegas(ib)*betais ) / tmp0 - end if - end if - - omega(p,ib) = tmp0 - betad = tmp1 - betai = tmp2 - - ! Common terms - - b = 1._r8 - omega(p,ib) + omega(p,ib)*betai - c1 = omega(p,ib)*betai - tmp0 = avmu(p)*twostext(p) - d = tmp0 * omega(p,ib)*betad - f = tmp0 * omega(p,ib)*(1._r8-betad) - tmp1 = b*b - c1*c1 - h = sqrt(tmp1) / avmu(p) - sigma = tmp0*tmp0 - tmp1 - p1 = b + avmu(p)*h - p2 = b - avmu(p)*h - p3 = b + tmp0 - p4 = b - tmp0 - - ! Absorbed, reflected, transmitted fluxes per unit incoming radiation - ! for full canopy - - t1 = min(h*(elai(p)+esai(p)), 40._r8) - s1 = exp(-t1) - t1 = min(twostext(p)*(elai(p)+esai(p)), 40._r8) - s2 = exp(-t1) - - ! Direct beam - - u1 = b - c1/albgrd(c,ib) - u2 = b - c1*albgrd(c,ib) - u3 = f + c1*albgrd(c,ib) - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h1 = -d*p4 - c1*f - tmp6 = d - h1*p3/sigma - tmp7 = ( d - c1 - h1/sigma*(u1+tmp0) ) * s2 - h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1 - h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1 - h4 = -f*p3 - c1*d - tmp8 = h4/sigma - tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2 - h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2 - h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2 - - albd(p,ib) = h1/sigma + h2 + h3 - ftid(p,ib) = h4*s2/sigma + h5*s1 + h6/s1 - ftdd(p,ib) = s2 - fabd(p,ib) = 1._r8 - albd(p,ib) - (1._r8-albgrd(c,ib))*ftdd(p,ib) - (1._r8-albgri(c,ib))*ftid(p,ib) - - a1 = h1 / sigma * (1._r8 - s2*s2) / (2._r8 * twostext(p)) & - + h2 * (1._r8 - s2*s1) / (twostext(p) + h) & - + h3 * (1._r8 - s2/s1) / (twostext(p) - h) - - a2 = h4 / sigma * (1._r8 - s2*s2) / (2._r8 * twostext(p)) & - + h5 * (1._r8 - s2*s1) / (twostext(p) + h) & - + h6 * (1._r8 - s2/s1) / (twostext(p) - h) - - fabd_sun(p,ib) = (1._r8 - omega(p,ib)) * ( 1._r8 - s2 + 1._r8 / avmu(p) * (a1 + a2) ) - fabd_sha(p,ib) = fabd(p,ib) - fabd_sun(p,ib) - - ! Diffuse - - u1 = b - c1/albgri(c,ib) - u2 = b - c1*albgri(c,ib) - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h7 = (c1*tmp2) / (d1*s1) - h8 = (-c1*tmp3*s1) / d1 - h9 = tmp4 / (d2*s1) - h10 = (-tmp5*s1) / d2 - - albi(p,ib) = h7 + h8 - ftii(p,ib) = h9*s1 + h10/s1 - fabi(p,ib) = 1._r8 - albi(p,ib) - (1._r8-albgri(c,ib))*ftii(p,ib) - - a1 = h7 * (1._r8 - s2*s1) / (twostext(p) + h) + h8 * (1._r8 - s2/s1) / (twostext(p) - h) - a2 = h9 * (1._r8 - s2*s1) / (twostext(p) + h) + h10 * (1._r8 - s2/s1) / (twostext(p) - h) - - fabi_sun(p,ib) = (1._r8 - omega(p,ib)) / avmu(p) * (a1 + a2) - fabi_sha(p,ib) = fabi(p,ib) - fabi_sun(p,ib) - - ! Repeat two-stream calculations for each canopy layer to calculate derivatives. - ! tlai_z and tsai_z are the leaf+stem area increment for a layer. Derivatives are - ! calculated at the center of the layer. Derivatives are needed only for the - ! visible waveband to calculate absorbed PAR (per unit lai+sai) for each canopy layer. - ! Derivatives are calculated first per unit lai+sai and then normalized for sunlit - ! or shaded fraction of canopy layer. - - ! Sun/shade big leaf code uses only one layer, with canopy integrated values from above - ! and also canopy-integrated scaling coefficients - - if (ib == 1) then - if (nlevcan == 1) then - - ! sunlit fraction of canopy - fsun_z(p,1) = (1._r8 - s2) / t1 - - ! absorbed PAR (per unit sun/shade lai+sai) - laisum = elai(p)+esai(p) - fabd_sun_z(p,1) = fabd_sun(p,ib) / (fsun_z(p,1)*laisum) - fabi_sun_z(p,1) = fabi_sun(p,ib) / (fsun_z(p,1)*laisum) - fabd_sha_z(p,1) = fabd_sha(p,ib) / ((1._r8 - fsun_z(p,1))*laisum) - fabi_sha_z(p,1) = fabi_sha(p,ib) / ((1._r8 - fsun_z(p,1))*laisum) - - ! leaf to canopy scaling coefficients - extkn = 0.30_r8 - extkb = twostext(p) - vcmaxcintsun(p) = (1._r8 - exp(-(extkn+extkb)*elai(p))) / (extkn + extkb) - vcmaxcintsha(p) = (1._r8 - exp(-extkn*elai(p))) / extkn - vcmaxcintsun(p) - if (elai(p) > 0._r8) then - vcmaxcintsun(p) = vcmaxcintsun(p) / (fsun_z(p,1)*elai(p)) - vcmaxcintsha(p) = vcmaxcintsha(p) / ((1._r8 - fsun_z(p,1))*elai(p)) - else - vcmaxcintsun(p) = 0._r8 - vcmaxcintsha(p) = 0._r8 - end if - - else if (nlevcan > 1) then - do iv = 1, nrad(p) - - ! Cumulative lai+sai at center of layer - - if (iv == 1) then - laisum = 0.5_r8 * (tlai_z(p,iv)+tsai_z(p,iv)) - else - laisum = laisum + 0.5_r8 * ((tlai_z(p,iv-1)+tsai_z(p,iv-1))+(tlai_z(p,iv)+tsai_z(p,iv))) - end if - - ! Coefficients s1 and s2 depend on cumulative lai+sai. s2 is the sunlit fraction - - t1 = min(h*laisum, 40._r8) - s1 = exp(-t1) - t1 = min(twostext(p)*laisum, 40._r8) - s2 = exp(-t1) - fsun_z(p,iv) = s2 - - ! =============== - ! Direct beam - ! =============== - - ! Coefficients h1-h6 and a1,a2 depend of cumulative lai+sai - - u1 = b - c1/albgrd(c,ib) - u2 = b - c1*albgrd(c,ib) - u3 = f + c1*albgrd(c,ib) - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h1 = -d*p4 - c1*f - tmp6 = d - h1*p3/sigma - tmp7 = ( d - c1 - h1/sigma*(u1+tmp0) ) * s2 - h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1 - h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1 - h4 = -f*p3 - c1*d - tmp8 = h4/sigma - tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2 - h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2 - h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2 - - a1 = h1 / sigma * (1._r8 - s2*s2) / (2._r8 * twostext(p)) & - + h2 * (1._r8 - s2*s1) / (twostext(p) + h) & - + h3 * (1._r8 - s2/s1) / (twostext(p) - h) - - a2 = h4 / sigma * (1._r8 - s2*s2) / (2._r8 * twostext(p)) & - + h5 * (1._r8 - s2*s1) / (twostext(p) + h) & - + h6 * (1._r8 - s2/s1) / (twostext(p) - h) - - ! Derivatives for h2, h3, h5, h6 and a1, a2 - - v = d1 - dv = h * p1 * tmp2 / s1 + h * p2 * tmp3 * s1 - - u = tmp6 * tmp2 / s1 - p2 * tmp7 - du = h * tmp6 * tmp2 / s1 + twostext(p) * p2 * tmp7 - dh2 = (v * du - u * dv) / (v * v) - - u = -tmp6 * tmp3 * s1 + p1 * tmp7 - du = h * tmp6 * tmp3 * s1 - twostext(p) * p1 * tmp7 - dh3 = (v * du - u * dv) / (v * v) - - v = d2 - dv = h * tmp4 / s1 + h * tmp5 * s1 - - u = -h4/sigma * tmp4 / s1 - tmp9 - du = -h * h4/sigma * tmp4 / s1 + twostext(p) * tmp9 - dh5 = (v * du - u * dv) / (v * v) - - u = h4/sigma * tmp5 * s1 + tmp9 - du = -h * h4/sigma * tmp5 * s1 - twostext(p) * tmp9 - dh6 = (v * du - u * dv) / (v * v) - - da1 = h1/sigma * s2*s2 + h2 * s2*s1 + h3 * s2/s1 & - + (1._r8 - s2*s1) / (twostext(p) + h) * dh2 & - + (1._r8 - s2/s1) / (twostext(p) - h) * dh3 - da2 = h4/sigma * s2*s2 + h5 * s2*s1 + h6 * s2/s1 & - + (1._r8 - s2*s1) / (twostext(p) + h) * dh5 & - + (1._r8 - s2/s1) / (twostext(p) - h) * dh6 - - ! Flux derivatives - - d_ftid = -twostext(p)*h4/sigma*s2 - h*h5*s1 + h*h6/s1 + dh5*s1 + dh6/s1 - d_fabd = -(dh2+dh3) + (1._r8-albgrd(c,ib))*twostext(p)*s2 - (1._r8-albgri(c,ib))*d_ftid - d_fabd_sun = (1._r8 - omega(p,ib)) * (twostext(p)*s2 + 1._r8 / avmu(p) * (da1 + da2)) - d_fabd_sha = d_fabd - d_fabd_sun - - fabd_sun_z(p,iv) = max(d_fabd_sun, 0._r8) - fabd_sha_z(p,iv) = max(d_fabd_sha, 0._r8) - - ! Flux derivatives are APARsun and APARsha per unit (LAI+SAI). Need - ! to normalize derivatives by sunlit or shaded fraction to get - ! APARsun per unit (LAI+SAI)sun and APARsha per unit (LAI+SAI)sha - - fabd_sun_z(p,iv) = fabd_sun_z(p,iv) / fsun_z(p,iv) - fabd_sha_z(p,iv) = fabd_sha_z(p,iv) / (1._r8 - fsun_z(p,iv)) - - ! =============== - ! Diffuse - ! =============== - - ! Coefficients h7-h10 and a1,a2 depend of cumulative lai+sai - - u1 = b - c1/albgri(c,ib) - u2 = b - c1*albgri(c,ib) - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h7 = (c1*tmp2) / (d1*s1) - h8 = (-c1*tmp3*s1) / d1 - h9 = tmp4 / (d2*s1) - h10 = (-tmp5*s1) / d2 - - a1 = h7 * (1._r8 - s2*s1) / (twostext(p) + h) + h8 * (1._r8 - s2/s1) / (twostext(p) - h) - a2 = h9 * (1._r8 - s2*s1) / (twostext(p) + h) + h10 * (1._r8 - s2/s1) / (twostext(p) - h) - - ! Derivatives for h7, h8, h9, h10 and a1, a2 - - v = d1 - dv = h * p1 * tmp2 / s1 + h * p2 * tmp3 * s1 - - u = c1 * tmp2 / s1 - du = h * c1 * tmp2 / s1 - dh7 = (v * du - u * dv) / (v * v) - - u = -c1 * tmp3 * s1 - du = h * c1 * tmp3 * s1 - dh8 = (v * du - u * dv) / (v * v) - - v = d2 - dv = h * tmp4 / s1 + h * tmp5 * s1 - - u = tmp4 / s1 - du = h * tmp4 / s1 - dh9 = (v * du - u * dv) / (v * v) - - u = -tmp5 * s1 - du = h * tmp5 * s1 - dh10 = (v * du - u * dv) / (v * v) - - da1 = h7*s2*s1 + h8*s2/s1 + (1._r8-s2*s1)/(twostext(p)+h)*dh7 + (1._r8-s2/s1)/(twostext(p)-h)*dh8 - da2 = h9*s2*s1 + h10*s2/s1 + (1._r8-s2*s1)/(twostext(p)+h)*dh9 + (1._r8-s2/s1)/(twostext(p)-h)*dh10 - - ! Flux derivatives - - d_ftii = -h * h9 * s1 + h * h10 / s1 + dh9 * s1 + dh10 / s1 - d_fabi = -(dh7+dh8) - (1._r8-albgri(c,ib))*d_ftii - d_fabi_sun = (1._r8 - omega(p,ib)) / avmu(p) * (da1 + da2) - d_fabi_sha = d_fabi - d_fabi_sun - - fabi_sun_z(p,iv) = max(d_fabi_sun, 0._r8) - fabi_sha_z(p,iv) = max(d_fabi_sha, 0._r8) - - ! Flux derivatives are APARsun and APARsha per unit (LAI+SAI). Need - ! to normalize derivatives by sunlit or shaded fraction to get - ! APARsun per unit (LAI+SAI)sun and APARsha per unit (LAI+SAI)sha - - fabi_sun_z(p,iv) = fabi_sun_z(p,iv) / fsun_z(p,iv) - fabi_sha_z(p,iv) = fabi_sha_z(p,iv) / (1._r8 - fsun_z(p,iv)) - - end do ! end of canopy layer loop - end if - end if - - end do ! end of pft loop - end do ! end of radiation band loop - - end associate - -end subroutine TwoStream - -end module SurfaceAlbedoMod diff --git a/src/biogeophys/SurfaceAlbedoType.F90 b/src/biogeophys/SurfaceAlbedoType.F90 deleted file mode 100644 index 1540d9f991..0000000000 --- a/src/biogeophys/SurfaceAlbedoType.F90 +++ /dev/null @@ -1,636 +0,0 @@ -module SurfaceAlbedoType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : numrad, nlevcan, nlevsno - use abortutils , only : endrun - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC DATA MEMBERS: - type, public :: surfalb_type - - real(r8), pointer :: coszen_col (:) ! col cosine of solar zenith angle - real(r8), pointer :: albd_patch (:,:) ! patch surface albedo (direct) (numrad) - real(r8), pointer :: albi_patch (:,:) ! patch surface albedo (diffuse) (numrad) - real(r8), pointer :: albgrd_pur_col (:,:) ! col pure snow ground direct albedo (numrad) - real(r8), pointer :: albgri_pur_col (:,:) ! col pure snow ground diffuse albedo (numrad) - real(r8), pointer :: albgrd_bc_col (:,:) ! col ground direct albedo without BC (numrad) - real(r8), pointer :: albgri_bc_col (:,:) ! col ground diffuse albedo without BC (numrad) - real(r8), pointer :: albgrd_oc_col (:,:) ! col ground direct albedo without OC (numrad) - real(r8), pointer :: albgri_oc_col (:,:) ! col ground diffuse albedo without OC (numrad) - real(r8), pointer :: albgrd_dst_col (:,:) ! col ground direct albedo without dust (numrad) - real(r8), pointer :: albgri_dst_col (:,:) ! col ground diffuse albedo without dust (numrad) - real(r8), pointer :: albgrd_col (:,:) ! col ground albedo (direct) (numrad) - real(r8), pointer :: albgri_col (:,:) ! col ground albedo (diffuse) (numrad) - real(r8), pointer :: albsod_col (:,:) ! col soil albedo: direct (col,bnd) [frc] - real(r8), pointer :: albsoi_col (:,:) ! col soil albedo: diffuse (col,bnd) [frc] - real(r8), pointer :: albsnd_hst_col (:,:) ! col snow albedo, direct , for history files (col,bnd) [frc] - real(r8), pointer :: albsni_hst_col (:,:) ! col snow albedo, diffuse, for history files (col,bnd) [frc] - - real(r8), pointer :: ftdd_patch (:,:) ! patch down direct flux below canopy per unit direct flx (numrad) - real(r8), pointer :: ftid_patch (:,:) ! patch down diffuse flux below canopy per unit direct flx (numrad) - real(r8), pointer :: ftii_patch (:,:) ! patch down diffuse flux below canopy per unit diffuse flx (numrad) - real(r8), pointer :: fabd_patch (:,:) ! patch flux absorbed by canopy per unit direct flux (numrad) - real(r8), pointer :: fabd_sun_patch (:,:) ! patch flux absorbed by sunlit canopy per unit direct flux (numrad) - real(r8), pointer :: fabd_sha_patch (:,:) ! patch flux absorbed by shaded canopy per unit direct flux (numrad) - real(r8), pointer :: fabi_patch (:,:) ! patch flux absorbed by canopy per unit diffuse flux (numrad) - real(r8), pointer :: fabi_sun_patch (:,:) ! patch flux absorbed by sunlit canopy per unit diffuse flux (numrad) - real(r8), pointer :: fabi_sha_patch (:,:) ! patch flux absorbed by shaded canopy per unit diffuse flux (numrad) - real(r8), pointer :: fabd_sun_z_patch (:,:) ! patch absorbed sunlit leaf direct PAR (per unit lai+sai) for each canopy layer - real(r8), pointer :: fabd_sha_z_patch (:,:) ! patch absorbed shaded leaf direct PAR (per unit lai+sai) for each canopy layer - real(r8), pointer :: fabi_sun_z_patch (:,:) ! patch absorbed sunlit leaf diffuse PAR (per unit lai+sai) for each canopy layer - real(r8), pointer :: fabi_sha_z_patch (:,:) ! patch absorbed shaded leaf diffuse PAR (per unit lai+sai) for each canopy layer - real(r8), pointer :: flx_absdv_col (:,:) ! col absorbed flux per unit incident direct flux: VIS (col,lyr) [frc] - real(r8), pointer :: flx_absdn_col (:,:) ! col absorbed flux per unit incident direct flux: NIR (col,lyr) [frc] - real(r8), pointer :: flx_absiv_col (:,:) ! col absorbed flux per unit incident diffuse flux: VIS (col,lyr) [frc] - real(r8), pointer :: flx_absin_col (:,:) ! col absorbed flux per unit incident diffuse flux: NIR (col,lyr) [frc] - - real(r8) , pointer :: fsun_z_patch (:,:) ! patch patch sunlit fraction of canopy layer - real(r8) , pointer :: tlai_z_patch (:,:) ! patch tlai increment for canopy layer - real(r8) , pointer :: tsai_z_patch (:,:) ! patch tsai increment for canopy layer - integer , pointer :: ncan_patch (:) ! patch number of canopy layers - integer , pointer :: nrad_patch (:) ! patch number of canopy layers, above snow for radiative transfer - real(r8) , pointer :: vcmaxcintsun_patch (:) ! patch leaf to canopy scaling coefficient, sunlit leaf vcmax - real(r8) , pointer :: vcmaxcintsha_patch (:) ! patch leaf to canopy scaling coefficient, shaded leaf vcmax - - contains - - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: Restart - - end type surfalb_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(surfalb_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use clm_varcon , only: spval, ispval - ! - ! !ARGUMENTS: - class(surfalb_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - allocate(this%coszen_col (begc:endc)) ; this%coszen_col (:) = nan - allocate(this%albgrd_col (begc:endc,numrad)) ; this%albgrd_col (:,:) = nan - allocate(this%albgri_col (begc:endc,numrad)) ; this%albgri_col (:,:) = nan - allocate(this%albsnd_hst_col (begc:endc,numrad)) ; this%albsnd_hst_col (:,:) = spval - allocate(this%albsni_hst_col (begc:endc,numrad)) ; this%albsni_hst_col (:,:) = spval - allocate(this%albsod_col (begc:endc,numrad)) ; this%albsod_col (:,:) = spval - allocate(this%albsoi_col (begc:endc,numrad)) ; this%albsoi_col (:,:) = spval - allocate(this%albgrd_pur_col (begc:endc,numrad)) ; this%albgrd_pur_col (:,:) = nan - allocate(this%albgri_pur_col (begc:endc,numrad)) ; this%albgri_pur_col (:,:) = nan - allocate(this%albgrd_bc_col (begc:endc,numrad)) ; this%albgrd_bc_col (:,:) = nan - allocate(this%albgri_bc_col (begc:endc,numrad)) ; this%albgri_bc_col (:,:) = nan - allocate(this%albgrd_oc_col (begc:endc,numrad)) ; this%albgrd_oc_col (:,:) = nan - allocate(this%albgri_oc_col (begc:endc,numrad)) ; this%albgri_oc_col (:,:) = nan - allocate(this%albgrd_dst_col (begc:endc,numrad)) ; this%albgrd_dst_col (:,:) = nan - allocate(this%albgri_dst_col (begc:endc,numrad)) ; this%albgri_dst_col (:,:) = nan - allocate(this%albd_patch (begp:endp,numrad)) ; this%albd_patch (:,:) = nan - allocate(this%albi_patch (begp:endp,numrad)) ; this%albi_patch (:,:) = nan - - allocate(this%ftdd_patch (begp:endp,numrad)) ; this%ftdd_patch (:,:) = nan - allocate(this%ftid_patch (begp:endp,numrad)) ; this%ftid_patch (:,:) = nan - allocate(this%ftii_patch (begp:endp,numrad)) ; this%ftii_patch (:,:) = nan - allocate(this%fabd_patch (begp:endp,numrad)) ; this%fabd_patch (:,:) = nan - allocate(this%fabd_sun_patch (begp:endp,numrad)) ; this%fabd_sun_patch (:,:) = nan - allocate(this%fabd_sha_patch (begp:endp,numrad)) ; this%fabd_sha_patch (:,:) = nan - allocate(this%fabi_patch (begp:endp,numrad)) ; this%fabi_patch (:,:) = nan - allocate(this%fabi_sun_patch (begp:endp,numrad)) ; this%fabi_sun_patch (:,:) = nan - allocate(this%fabi_sha_patch (begp:endp,numrad)) ; this%fabi_sha_patch (:,:) = nan - allocate(this%fabd_sun_z_patch (begp:endp,nlevcan)) ; this%fabd_sun_z_patch (:,:) = 0._r8 - allocate(this%fabd_sha_z_patch (begp:endp,nlevcan)) ; this%fabd_sha_z_patch (:,:) = 0._r8 - allocate(this%fabi_sun_z_patch (begp:endp,nlevcan)) ; this%fabi_sun_z_patch (:,:) = 0._r8 - allocate(this%fabi_sha_z_patch (begp:endp,nlevcan)) ; this%fabi_sha_z_patch (:,:) = 0._r8 - allocate(this%flx_absdv_col (begc:endc,-nlevsno+1:1)) ; this%flx_absdv_col (:,:) = spval - allocate(this%flx_absdn_col (begc:endc,-nlevsno+1:1)) ; this%flx_absdn_col (:,:) = spval - allocate(this%flx_absiv_col (begc:endc,-nlevsno+1:1)) ; this%flx_absiv_col (:,:) = spval - allocate(this%flx_absin_col (begc:endc,-nlevsno+1:1)) ; this%flx_absin_col (:,:) = spval - - allocate(this%fsun_z_patch (begp:endp,nlevcan)) ; this%fsun_z_patch (:,:) = 0._r8 - allocate(this%tlai_z_patch (begp:endp,nlevcan)) ; this%tlai_z_patch (:,:) = 0._r8 - allocate(this%tsai_z_patch (begp:endp,nlevcan)) ; this%tsai_z_patch (:,:) = 0._r8 - allocate(this%ncan_patch (begp:endp)) ; this%ncan_patch (:) = 0 - allocate(this%nrad_patch (begp:endp)) ; this%nrad_patch (:) = 0 - allocate(this%vcmaxcintsun_patch (begp:endp)) ; this%vcmaxcintsun_patch (:) = nan - allocate(this%vcmaxcintsha_patch (begp:endp)) ; this%vcmaxcintsha_patch (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use clm_varcon , only: spval - use histFileMod , only: hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(surfalb_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - this%coszen_col(begc:endc) = spval - call hist_addfld1d (fname='COSZEN', units='none', & - avgflag='A', long_name='cosine of solar zenith angle', & - ptr_col=this%coszen_col, default='inactive') - - this%albgri_col(begc:endc,:) = spval - call hist_addfld2d (fname='ALBGRD', units='proportion', type2d='numrad', & - avgflag='A', long_name='ground albedo (direct)', & - ptr_col=this%albgrd_col, default='inactive') - - this%albgri_col(begc:endc,:) = spval - call hist_addfld2d (fname='ALBGRI', units='proportion', type2d='numrad', & - avgflag='A', long_name='ground albedo (indirect)', & - ptr_col=this%albgri_col, default='inactive') - - this%albd_patch(begp:endp,:) = spval - call hist_addfld2d (fname='ALBD', units='proportion', type2d='numrad', & - avgflag='A', long_name='surface albedo (direct)', & - ptr_patch=this%albd_patch, default='inactive', c2l_scale_type='urbanf') - - this%albi_patch(begp:endp,:) = spval - call hist_addfld2d (fname='ALBI', units='proportion', type2d='numrad', & - avgflag='A', long_name='surface albedo (indirect)', & - ptr_patch=this%albi_patch, default='inactive', c2l_scale_type='urbanf') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! Initialize module surface albedos to reasonable values - ! - ! !ARGUMENTS: - class(surfalb_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begp, endp - !----------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - this%albgrd_col (begc:endc, :) = 0.2_r8 - this%albgri_col (begc:endc, :) = 0.2_r8 - this%albsod_col (begc:endc, :) = 0.2_r8 - this%albsoi_col (begc:endc, :) = 0.2_r8 - this%albsnd_hst_col (begc:endc, :) = 0.6_r8 - this%albsni_hst_col (begc:endc, :) = 0.6_r8 - this%albd_patch (begp:endp, :) = 0.2_r8 - this%albi_patch (begp:endp, :) = 0.2_r8 - - this%albgrd_pur_col (begc:endc, :) = 0.2_r8 - this%albgri_pur_col (begc:endc, :) = 0.2_r8 - this%albgrd_bc_col (begc:endc, :) = 0.2_r8 - this%albgri_bc_col (begc:endc, :) = 0.2_r8 - this%albgrd_oc_col (begc:endc, :) = 0.2_r8 - this%albgri_oc_col (begc:endc, :) = 0.2_r8 - this%albgrd_dst_col (begc:endc, :) = 0.2_r8 - this%albgri_dst_col (begc:endc, :) = 0.2_r8 - - this%fabi_patch (begp:endp, :) = 0.0_r8 - this%fabd_patch (begp:endp, :) = 0.0_r8 - this%fabi_sun_patch (begp:endp, :) = 0.0_r8 - this%fabd_sun_patch (begp:endp, :) = 0.0_r8 - this%fabd_sha_patch (begp:endp, :) = 0.0_r8 - this%fabi_sha_patch (begp:endp, :) = 0.0_r8 - this%ftdd_patch (begp:endp, :) = 1.0_r8 - this%ftid_patch (begp:endp, :) = 0.0_r8 - this%ftii_patch (begp:endp, :) = 1.0_r8 - - end subroutine InitCold - - !--------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag, & - tlai_patch, tsai_patch) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use clm_varctl , only : use_snicar_frc, iulog - use spmdMod , only : masterproc - use decompMod , only : bounds_type - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int, ncd_inqvdlen - use restUtilMod - ! - ! !ARGUMENTS: - class(surfalb_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - real(r8) , intent(in) :: tlai_patch(bounds%begp:) - real(r8) , intent(in) :: tsai_patch(bounds%begp:) - ! - ! !LOCAL VARIABLES: - logical :: readvar ! determine if variable is on initial file - integer :: iv - integer :: begp, endp - integer :: begc, endc - !--------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(tlai_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(tsai_patch) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - call restartvar(ncid=ncid, flag=flag, varname='coszen', xtype=ncd_double, & - dim1name='column', & - long_name='cosine of solar zenith angle', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%coszen_col) - - call restartvar(ncid=ncid, flag=flag, varname='albd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='surface albedo (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='albi', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='surface albedo (diffuse) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='albgrd', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgrd_col) - - call restartvar(ncid=ncid, flag=flag, varname='albgri', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo (indirect) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgri_col) - - call restartvar(ncid=ncid, flag=flag, varname='albsod', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='soil albedo (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albsod_col) - - call restartvar(ncid=ncid, flag=flag, varname='albsoi', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='soil albedo (indirect) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albsoi_col) - - call restartvar(ncid=ncid, flag=flag, varname='albsnd_hst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='snow albedo (direct) (0 to 1)', units='proportion', & - interpinic_flag='interp', readvar=readvar, data=this%albsnd_hst_col) - - call restartvar(ncid=ncid, flag=flag, varname='albsni_hst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='snow albedo (diffuse) (0 to 1)', units='proportion', & - interpinic_flag='interp', readvar=readvar, data=this%albsni_hst_col) - - call restartvar(ncid=ncid, flag=flag, varname='tlai_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='tlai increment for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tlai_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) then - write(iulog,*) "can't find tlai_z in restart (or initial) file..." - write(iulog,*) "Initialize tlai_z to tlai/nlevcan" - end if - do iv=1,nlevcan - this%tlai_z_patch(begp:endp,iv) = tlai_patch(begp:endp) / nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='tsai_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='tsai increment for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tsai_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) then - write(iulog,*) "can't find tsai_z in restart (or initial) file..." - write(iulog,*) "Initialize tsai_z to tsai/nlevcan" - end if - do iv=1,nlevcan - this%tsai_z_patch(begp:endp,iv) = tsai_patch(begp:endp) / nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='ncan', xtype=ncd_int, & - dim1name='pft', long_name='number of canopy layers', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ncan_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find ncan in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize ncan to nlevcan" - this%ncan_patch(begp:endp) = nlevcan - end if - - call restartvar(ncid=ncid, flag=flag, varname='nrad', xtype=ncd_int, & - dim1name='pft', long_name='number of canopy layers, above snow for radiative transfer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%nrad_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find nrad in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize nrad to nlevcan" - this%nrad_patch(begp:endp) = nlevcan - end if - - call restartvar(ncid=ncid, flag=flag, varname='fsun_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='sunlit fraction for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fsun_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fsun_z in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fsun_z to 0" - do iv=1,nlevcan - this%fsun_z_patch(begp:endp,iv) = 0._r8 - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='vcmaxcintsun', xtype=ncd_double, & - dim1name='pft', long_name='sunlit canopy scaling coefficient', units='', & - interpinic_flag='interp', readvar=readvar, data=this%vcmaxcintsun_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find vcmaxcintsun in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize vcmaxcintsun to 1" - this%vcmaxcintsun_patch(begp:endp) = 1._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='vcmaxcintsha', xtype=ncd_double, & - dim1name='pft', long_name='shaded canopy scaling coefficient', units='', & - interpinic_flag='interp', readvar=readvar, data=this%vcmaxcintsha_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find vcmaxcintsha in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize vcmaxcintsha to 1" - this%vcmaxcintsha_patch(begp:endp) = 1._r8 - end if - - if (use_snicar_frc) then - - call restartvar(ncid=ncid, flag=flag, varname='albgrd_bc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without BC (direct) (0 to 1)', units='', & - interpinic_flag='interp',readvar=readvar, data=this%albgrd_bc_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_bc in initial file..." - if (masterproc) write(iulog,*) "Initialize albgrd_bc to albgrd" - this%albgrd_bc_col(begc:endc,:) = this%albgrd_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgri_bc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without BC (diffuse) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgri_bc_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_bc in initial file..." - if (masterproc) write(iulog,*) "Initialize albgri_bc to albgri" - this%albgri_bc_col(begc:endc,:) = this%albgri_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgrd_pur', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='pure snow ground albedo (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgrd_pur_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_pur in initial file..." - if (masterproc) write(iulog,*) "Initialize albgrd_pur to albgrd" - this%albgrd_pur_col(begc:endc,:) = this%albgrd_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgri_pur', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='pure snow ground albedo (diffuse) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgri_pur_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_pur in initial file..." - if (masterproc) write(iulog,*) "Initialize albgri_pur to albgri" - this%albgri_pur_col(begc:endc,:) = this%albgri_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgrd_oc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without OC (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgrd_oc_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_oc in initial file..." - if (masterproc) write(iulog,*) "Initialize albgrd_oc to albgrd" - this%albgrd_oc_col(begc:endc,:) = this%albgrd_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgri_oc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without OC (diffuse) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgri_oc_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_oc in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgri_oc to albgri" - this%albgri_oc_col(begc:endc,:) = this%albgri_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgrd_dst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without dust (direct) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgrd_dst_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_dst in initial file..." - if (masterproc) write(iulog,*) "Initialize albgrd_dst to albgrd" - this%albgrd_dst_col(begc:endc,:) = this%albgrd_col(begc:endc,:) - end if - - call restartvar(ncid=ncid, flag=flag, varname='albgri_dst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without dust (diffuse) (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%albgri_dst_col) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_dst in initial file..." - if (masterproc) write(iulog,*) "Initialize albgri_dst to albgri" - this%albgri_dst_col(begc:endc,:) = this%albgri_col(begc:endc,:) - end if - - end if ! end of if-use_snicar_frc - - ! patch type physical state variable - fabd - call restartvar(ncid=ncid, flag=flag, varname='fabd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by veg per unit direct flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fabi', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by veg per unit diffuse flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabi_patch) - - call restartvar(ncid=ncid, flag=flag, varname='fabd_sun', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by sunlit leaf per unit direct flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabd_sun_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabd_sun in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabd_sun to fabd/2" - this%fabd_sun_patch(begp:endp,:) = this%fabd_patch(begp:endp,:)/2._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabd_sha', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by shaded leaf per unit direct flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabd_sha_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabd_sha in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabd_sha to fabd/2" - this%fabd_sha_patch(begp:endp,:) = this%fabd_patch(begp:endp,:)/2._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabi_sun', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by sunlit leaf per unit diffuse flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabi_sun_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabi_sun in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabi_sun to fabi/2" - this%fabi_sun_patch(begp:endp,:) = this%fabi_patch(begp:endp,:)/2._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabi_sha', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by shaded leaf per unit diffuse flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabi_sha_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabi_sha in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabi_sha to fabi/2" - this%fabi_sha_patch(begp:endp,:) = this%fabi_patch(begp:endp,:)/2._r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabd_sun_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='absorbed sunlit leaf direct PAR (per unit lai+sai) for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabd_sun_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabd_sun_z in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabd_sun_z to (fabd/2)/nlevcan" - do iv=1,nlevcan - this%fabd_sun_z_patch(begp:endp,iv) = (this%fabd_patch(begp:endp,1)/2._r8)/nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabd_sha_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='absorbed shaded leaf direct PAR (per unit lai+sai) for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabd_sha_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabd_sha_z in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabd_sha_z to (fabd/2)/nlevcan" - do iv=1,nlevcan - this%fabd_sha_z_patch(begp:endp,iv) = (this%fabd_patch(begp:endp,1)/2._r8)/nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabi_sun_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='absorbed sunlit leaf diffuse PAR (per unit lai+sai) for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabi_sun_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabi_sun_z in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabi_sun_z to (fabi/2)/nlevcan" - do iv=1,nlevcan - this%fabi_sun_z_patch(begp:endp,iv) = (this%fabi_patch(begp:endp,1)/2._r8)/nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='fabi_sha_z', xtype=ncd_double, & - dim1name='pft', dim2name='levcan', switchdim=.true., & - long_name='absorbed shaded leaf diffuse PAR (per unit lai+sai) for canopy layer', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fabi_sha_z_patch) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find fabi_sha_z in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize fabi_sha_z to (fabi/2)/nlevcan" - do iv=1,nlevcan - this%fabi_sha_z_patch(begp:endp,iv) = & - (this%fabi_patch(begp:endp,1)/2._r8)/nlevcan - end do - end if - - call restartvar(ncid=ncid, flag=flag, varname='ftdd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down direct flux below veg per unit direct flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ftdd_patch) - - call restartvar(ncid=ncid, flag=flag, varname='ftid', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down diffuse flux below veg per unit direct flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ftid_patch) - - call restartvar(ncid=ncid, flag=flag, varname='ftii', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down diffuse flux below veg per unit diffuse flux', units='', & - interpinic_flag='interp', readvar=readvar, data=this%ftii_patch) - - !-------------------------------- - ! variables needed for SNICAR - !-------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='flx_absdv', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., lowerb2=-nlevsno+1, upperb2=1, & - long_name='snow layer flux absorption factors (direct, VIS)', units='fraction', & - interpinic_flag='interp', readvar=readvar, data=this%flx_absdv_col) - - call restartvar(ncid=ncid, flag=flag, varname='flx_absdn', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., lowerb2=-nlevsno+1, upperb2=1, & - long_name='snow layer flux absorption factors (direct, NIR)', units='fraction', & - interpinic_flag='interp', readvar=readvar, data=this%flx_absdn_col) - - call restartvar(ncid=ncid, flag=flag, varname='flx_absiv', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., lowerb2=-nlevsno+1, upperb2=1, & - long_name='snow layer flux absorption factors (diffuse, VIS)', units='fraction', & - interpinic_flag='interp', readvar=readvar, data=this%flx_absiv_col) - - call restartvar(ncid=ncid, flag=flag, varname='flx_absin', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., lowerb2=-nlevsno+1, upperb2=1, & - long_name='snow layer flux absorption factors (diffuse, NIR)', units='fraction', & - interpinic_flag='interp', readvar=readvar, data=this%flx_absin_col) - - end subroutine Restart - -end module SurfaceAlbedoType diff --git a/src/biogeophys/SurfaceRadiationMod.F90 b/src/biogeophys/SurfaceRadiationMod.F90 deleted file mode 100644 index d0b56f6a27..0000000000 --- a/src/biogeophys/SurfaceRadiationMod.F90 +++ /dev/null @@ -1,953 +0,0 @@ -module SurfaceRadiationMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Calculate solar fluxes absorbed by vegetation and ground surface - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : use_snicar_frc, use_fates - use decompMod , only : bounds_type - use clm_varcon , only : namec - use atm2lndType , only : atm2lnd_type - use WaterstateType , only : waterstate_type - use CanopyStateType , only : canopystate_type - use SurfaceAlbedoType , only : surfalb_type - use SolarAbsorbedType , only : solarabs_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use landunit_varcon , only : istdlak - - ! !PRIVATE TYPES: - implicit none - private - - logical :: DEBUG = .false. ! for debugging this module - - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SurfaceRadiation ! Solar fluxes absorbed by veg and ground surface - public :: CanopySunShadeFracs ! Sun/Shade fractions and some area indices computations - - ! - ! !PRIVATE DATA: - type, public :: surfrad_type - real(r8), pointer, private :: sfc_frc_aer_patch (:) ! patch surface forcing of snow with all aerosols (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_bc_patch (:) ! patch surface forcing of snow with BC (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_oc_patch (:) ! patch surface forcing of snow with OC (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_dst_patch (:) ! patch surface forcing of snow with dust (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_aer_sno_patch (:) ! patch surface forcing of snow with all aerosols, averaged only when snow is present (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_bc_sno_patch (:) ! patch surface forcing of snow with BC, averaged only when snow is present (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_oc_sno_patch (:) ! patch surface forcing of snow with OC, averaged only when snow is present (patch) [W/m2] - real(r8), pointer, private :: sfc_frc_dst_sno_patch (:) ! patch surface forcing of snow with dust, averaged only when snow is present (patch) [W/m2] - - real(r8), pointer, private :: parveg_ln_patch (:) ! patch absorbed par by vegetation at local noon (W/m**2) - - real(r8), pointer, private :: fsr_sno_vd_patch (:) ! patch reflected direct beam vis solar radiation from snow (W/m**2) - real(r8), pointer, private :: fsr_sno_nd_patch (:) ! patch reflected direct beam NIR solar radiation from snow (W/m**2) - real(r8), pointer, private :: fsr_sno_vi_patch (:) ! patch reflected diffuse vis solar radiation from snow (W/m**2) - real(r8), pointer, private :: fsr_sno_ni_patch (:) ! patch reflected diffuse NIR solar radiation from snow (W/m**2) - - real(r8), pointer, private :: fsr_vis_d_patch (:) ! patch reflected direct beam vis solar radiation (W/m**2) - real(r8), pointer, private :: fsr_vis_i_patch (:) ! patch reflected diffuse vis solar radiation (W/m**2) - real(r8), pointer, private :: fsr_vis_d_ln_patch (:) ! patch reflected direct beam vis solar radiation at local noon (W/m**2) - - real(r8), pointer, private :: fsds_sno_vd_patch (:) ! patch incident visible, direct radiation on snow (for history files) [W/m2] - real(r8), pointer, private :: fsds_sno_nd_patch (:) ! patch incident near-IR, direct radiation on snow (for history files) [W/m2] - real(r8), pointer, private :: fsds_sno_vi_patch (:) ! patch incident visible, diffuse radiation on snow (for history files) [W/m2] - real(r8), pointer, private :: fsds_sno_ni_patch (:) ! patch incident near-IR, diffuse radiation on snow (for history files) [W/m2] - - real(r8), pointer, private :: fsds_vis_d_patch (:) ! patch incident direct beam vis solar radiation (W/m**2) - real(r8), pointer, private :: fsds_vis_i_patch (:) ! patch incident diffuse vis solar radiation (W/m**2) - real(r8), pointer, private :: fsds_vis_d_ln_patch (:) ! patch incident direct beam vis solar radiation at local noon (W/m**2) - real(r8), pointer, private :: fsds_vis_i_ln_patch (:) ! patch incident diffuse beam vis solar radiation at local noon (W/m**2) - - contains - - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type surfrad_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(surfrad_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(surfrad_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - allocate(this%sfc_frc_aer_patch (begp:endp)) ; this%sfc_frc_aer_patch (:) = nan - allocate(this%sfc_frc_bc_patch (begp:endp)) ; this%sfc_frc_bc_patch (:) = nan - allocate(this%sfc_frc_oc_patch (begp:endp)) ; this%sfc_frc_oc_patch (:) = nan - allocate(this%sfc_frc_dst_patch (begp:endp)) ; this%sfc_frc_dst_patch (:) = nan - allocate(this%sfc_frc_aer_sno_patch (begp:endp)) ; this%sfc_frc_aer_sno_patch (:) = nan - allocate(this%sfc_frc_bc_sno_patch (begp:endp)) ; this%sfc_frc_bc_sno_patch (:) = nan - allocate(this%sfc_frc_oc_sno_patch (begp:endp)) ; this%sfc_frc_oc_sno_patch (:) = nan - allocate(this%sfc_frc_dst_sno_patch (begp:endp)) ; this%sfc_frc_dst_sno_patch (:) = nan - - allocate(this%parveg_ln_patch (begp:endp)) ; this%parveg_ln_patch (:) = nan - - allocate(this%fsr_vis_d_patch (begp:endp)) ; this%fsr_vis_d_patch (:) = nan - allocate(this%fsr_vis_d_ln_patch (begp:endp)) ; this%fsr_vis_d_ln_patch (:) = nan - allocate(this%fsr_vis_i_patch (begp:endp)) ; this%fsr_vis_i_patch (:) = nan - allocate(this%fsr_sno_vd_patch (begp:endp)) ; this%fsr_sno_vd_patch (:) = nan - allocate(this%fsr_sno_nd_patch (begp:endp)) ; this%fsr_sno_nd_patch (:) = nan - allocate(this%fsr_sno_vi_patch (begp:endp)) ; this%fsr_sno_vi_patch (:) = nan - allocate(this%fsr_sno_ni_patch (begp:endp)) ; this%fsr_sno_ni_patch (:) = nan - - allocate(this%fsds_vis_d_patch (begp:endp)) ; this%fsds_vis_d_patch (:) = nan - allocate(this%fsds_vis_i_patch (begp:endp)) ; this%fsds_vis_i_patch (:) = nan - allocate(this%fsds_vis_d_ln_patch (begp:endp)) ; this%fsds_vis_d_ln_patch (:) = nan - allocate(this%fsds_vis_i_ln_patch (begp:endp)) ; this%fsds_vis_i_ln_patch (:) = nan - allocate(this%fsds_sno_vd_patch (begp:endp)) ; this%fsds_sno_vd_patch (:) = nan - allocate(this%fsds_sno_nd_patch (begp:endp)) ; this%fsds_sno_nd_patch (:) = nan - allocate(this%fsds_sno_vi_patch (begp:endp)) ; this%fsds_sno_vi_patch (:) = nan - allocate(this%fsds_sno_ni_patch (begp:endp)) ; this%fsds_sno_ni_patch (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! History fields initialization - ! - ! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use clm_varcon , only : spval - use histFileMod , only : hist_addfld1d, hist_addfld2d - ! - ! !ARGUMENTS: - class(surfrad_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - if (use_snicar_frc) then - this%sfc_frc_aer_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOAERFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of all aerosols in snow (land) ', & - ptr_patch=this%sfc_frc_aer_patch, set_urb=spval) - - this%sfc_frc_aer_sno_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOAERFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of all aerosols in snow, averaged only when snow is present (land)', & - ptr_patch=this%sfc_frc_aer_sno_patch, set_urb=spval) - - this%sfc_frc_bc_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOBCFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of BC in snow (land) ', & - ptr_patch=this%sfc_frc_bc_patch, set_urb=spval) - - this%sfc_frc_bc_sno_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOBCFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of BC in snow, averaged only when snow is present (land)', & - ptr_patch=this%sfc_frc_bc_sno_patch, set_urb=spval) - - this%sfc_frc_oc_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOOCFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of OC in snow (land) ', & - ptr_patch=this%sfc_frc_oc_patch, set_urb=spval) - - this%sfc_frc_oc_sno_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOOCFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of OC in snow, averaged only when snow is present (land)', & - ptr_patch=this%sfc_frc_oc_sno_patch, set_urb=spval) - - this%sfc_frc_dst_patch(begp:endp) = spval - call hist_addfld1d (fname='SNODSTFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of dust in snow (land) ', & - ptr_patch=this%sfc_frc_dst_patch, set_urb=spval) - - this%sfc_frc_dst_sno_patch(begp:endp) = spval - call hist_addfld1d (fname='SNODSTFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of dust in snow, averaged only when snow is present (land)', & - ptr_patch=this%sfc_frc_dst_sno_patch, set_urb=spval) - end if - - this%fsds_vis_d_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSVD', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation', & - ptr_patch=this%fsds_vis_d_patch) - - this%fsds_vis_i_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis incident solar radiation', & - ptr_patch=this%fsds_vis_i_patch) - - this%fsr_vis_d_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRVD', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation', & - ptr_patch=this%fsr_vis_d_patch, c2l_scale_type='urbanf') - - this%fsr_vis_i_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis reflected solar radiation', & - ptr_patch=this%fsr_vis_i_patch, c2l_scale_type='urbanf') - - this%fsds_vis_d_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSVDLN', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation at local noon', & - ptr_patch=this%fsds_vis_d_ln_patch) - - this%fsds_vis_i_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='FSDSVILN', units='W/m^2', & - avgflag='A', long_name='diffuse vis incident solar radiation at local noon', & - ptr_patch=this%fsds_vis_i_ln_patch) - - this%parveg_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='PARVEGLN', units='W/m^2', & - avgflag='A', long_name='absorbed par by vegetation at local noon', & - ptr_patch=this%parveg_ln_patch) - - this%fsr_vis_d_ln_patch(begp:endp) = spval - call hist_addfld1d (fname='FSRVDLN', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation at local noon', & - ptr_patch=this%fsr_vis_d_ln_patch, c2l_scale_type='urbanf') - - this%fsds_sno_vd_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSDSVD', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation on snow', & - ptr_patch=this%fsds_sno_vd_patch, default='inactive') - - this%fsds_sno_nd_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSDSND', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation on snow', & - ptr_patch=this%fsds_sno_nd_patch, default='inactive') - - this%fsds_sno_vi_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSDSVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis incident solar radiation on snow', & - ptr_patch=this%fsds_sno_vi_patch, default='inactive') - - this%fsds_sno_ni_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSDSNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir incident solar radiation on snow', & - ptr_patch=this%fsds_sno_ni_patch, default='inactive') - - this%fsr_sno_vd_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSRVD', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation from snow', & - ptr_patch=this%fsr_sno_vd_patch) - - this%fsr_sno_nd_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSRND', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation from snow', & - ptr_patch=this%fsr_sno_nd_patch) - - this%fsr_sno_vi_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSRVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis reflected solar radiation from snow', & - ptr_patch=this%fsr_sno_vi_patch) - - this%fsr_sno_ni_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOFSRNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir reflected solar radiation from snow', & - ptr_patch=this%fsr_sno_ni_patch) - - - end subroutine InitHistory - - !------------------------------------------------------------------------ - subroutine InitCold(this, bounds) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(surfrad_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,l - !----------------------------------------------------------------------- - - ! nothing for now - - end subroutine InitCold - - - subroutine CanopySunShadeFracs(filter_nourbanp, num_nourbanp, & - atm2lnd_inst, surfalb_inst, & - canopystate_inst, solarabs_inst) - - ! ------------------------------------------------------------------------------------ - ! This subroutine calculates and returns patch vectors of - ! - ! 1) absorbed PAR for sunlit leaves in canopy layer - ! 2) absorbed PAR for shaded leaves in canopy layer - ! 3) sunlit leaf area - ! 4) shaded leaf area - ! 5) sunlit leaf area for canopy layer - ! 6) shaded leaf area for canopy layer - ! 7) sunlit fraction of canopy - ! - ! This routine has a counterpart when the fates model is turned on. - ! CLMEDInterf_CanopySunShadeFracs() - ! If changes are applied to this routine, please take a moment to review that - ! subroutine as well and consider if any new information related to these types of - ! variables also needs to be augmented in that routine as well. - ! ------------------------------------------------------------------------------------ - - - implicit none - - ! Arguments (in) - - integer, intent(in),dimension(:) :: filter_nourbanp ! patch filter for non-urban points - integer, intent(in) :: num_nourbanp ! size of the nonurban filter - type(atm2lnd_type), intent(in) :: atm2lnd_inst - type(surfalb_type), intent(in) :: surfalb_inst - - ! Arguments (inout) - type(canopystate_type), intent(inout) :: canopystate_inst - type(solarabs_type), intent(inout) :: solarabs_inst - - ! local variables - integer :: fp ! non-urban filter patch index - integer :: p ! patch index - integer :: g ! gridcell index - integer :: iv ! canopy layer index - integer,parameter :: ipar = 1 ! The band index for PAR - - associate( tlai_z => surfalb_inst%tlai_z_patch, & ! tlai increment for canopy layer - fsun_z => surfalb_inst%fsun_z_patch, & ! sunlit fraction of canopy layer - elai => canopystate_inst%elai_patch, & ! one-sided leaf area index - forc_solad => atm2lnd_inst%forc_solad_grc, & ! direct beam radiation (W/m**2) - forc_solai => atm2lnd_inst%forc_solai_grc, & ! diffuse radiation (W/m**2) - fabd_sun_z => surfalb_inst%fabd_sun_z_patch, & ! absorbed sunlit leaf direct PAR - fabd_sha_z => surfalb_inst%fabd_sha_z_patch, & ! absorbed shaded leaf direct PAR - fabi_sun_z => surfalb_inst%fabi_sun_z_patch, & ! absorbed sunlit leaf diffuse PAR - fabi_sha_z => surfalb_inst%fabi_sha_z_patch, & ! absorbed shaded leaf diffuse PAR - nrad => surfalb_inst%nrad_patch, & ! number of canopy layers - parsun_z => solarabs_inst%parsun_z_patch, & ! absorbed PAR for sunlit leaves - parsha_z => solarabs_inst%parsha_z_patch, & ! absorbed PAR for shaded leaves - laisun => canopystate_inst%laisun_patch, & ! sunlit leaf area - laisha => canopystate_inst%laisha_patch, & ! shaded leaf area - laisun_z => canopystate_inst%laisun_z_patch, & ! sunlit leaf area for canopy layer - laisha_z => canopystate_inst%laisha_z_patch, & ! shaded leaf area for canopy layer - fsun => canopystate_inst%fsun_patch) ! sunlit fraction of canopy - - do fp = 1,num_nourbanp - - p = filter_nourbanp(fp) - - do iv = 1, nrad(p) - parsun_z(p,iv) = 0._r8 - parsha_z(p,iv) = 0._r8 - laisun_z(p,iv) = 0._r8 - laisha_z(p,iv) = 0._r8 - end do - - ! Loop over patches to calculate laisun_z and laisha_z for each layer. - ! Derive canopy laisun, laisha, and fsun from layer sums. - ! If sun/shade big leaf code, nrad=1 and fsun_z(p,1) and tlai_z(p,1) from - ! SurfaceAlbedo is canopy integrated so that layer value equals canopy value. - - laisun(p) = 0._r8 - laisha(p) = 0._r8 - do iv = 1, nrad(p) - laisun_z(p,iv) = tlai_z(p,iv) * fsun_z(p,iv) - laisha_z(p,iv) = tlai_z(p,iv) * (1._r8 - fsun_z(p,iv)) - laisun(p) = laisun(p) + laisun_z(p,iv) - laisha(p) = laisha(p) + laisha_z(p,iv) - end do - if (elai(p) > 0._r8) then - fsun(p) = laisun(p) / elai(p) - else - fsun(p) = 0._r8 - end if - - ! Absorbed PAR profile through canopy - ! If sun/shade big leaf code, nrad=1 and fluxes from SurfaceAlbedo - ! are canopy integrated so that layer values equal big leaf values. - - g = patch%gridcell(p) - - do iv = 1, nrad(p) - parsun_z(p,iv) = forc_solad(g,ipar)*fabd_sun_z(p,iv) + forc_solai(g,ipar)*fabi_sun_z(p,iv) - parsha_z(p,iv) = forc_solad(g,ipar)*fabd_sha_z(p,iv) + forc_solai(g,ipar)*fabi_sha_z(p,iv) - end do - - end do ! end of fp = 1,num_nourbanp loop - end associate - return - end subroutine CanopySunShadeFracs - - !------------------------------------------------------------------------------ - subroutine SurfaceRadiation(bounds, num_nourbanp, filter_nourbanp, & - num_urbanp, filter_urbanp, num_urbanc, filter_urbanc, & - atm2lnd_inst, waterstate_inst, canopystate_inst, & - surfalb_inst, solarabs_inst, surfrad_inst) - ! - ! !DESCRIPTION: - ! Solar fluxes absorbed by vegetation and ground surface - ! Note possible problem when land is on different grid than atmosphere. - ! Land may have sun above the horizon (coszen > 0) but atmosphere may - ! have sun below the horizon (forc_solad = 0 and forc_solai = 0). This is okay - ! because all fluxes (absorbed, reflected, transmitted) are multiplied - ! by the incoming flux and all will equal zero. - ! Atmosphere may have sun above horizon (forc_solad > 0 and forc_solai > 0) but - ! land may have sun below horizon. This is okay because fabd, fabi, - ! ftdd, ftid, and ftii all equal zero so that sabv=sabg=fsa=0. Also, - ! albd and albi equal one so that fsr=forc_solad+forc_solai. In other words, all - ! the radiation is reflected. NDVI should equal zero in this case. - ! However, the way the code is currently implemented this is only true - ! if (forc_solad+forc_solai)|vis = (forc_solad+forc_solai)|nir. - ! Output variables are parsun,parsha,sabv,sabg,fsa,fsr,ndvi - ! - ! !USES: - use clm_varpar , only : numrad, nlevsno - use clm_varcon , only : spval, degpsec, isecspday - use landunit_varcon , only : istsoil, istcrop - use clm_varctl , only : subgridflag, use_snicar_frc, iulog - use clm_time_manager , only : get_curr_date, get_step_size - use SnowSnicarMod , only : DO_SNO_OC - use abortutils , only : endrun - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nourbanp ! number of patches in non-urban points in patch filter - integer , intent(in) :: filter_nourbanp(:) ! patch filter for non-urban points - integer , intent(in) :: num_urbanp ! number of patches in non-urban points in patch filter - integer , intent(in) :: filter_urbanp(:) ! patch filter for non-urban points - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(surfrad_type) , intent(inout) :: surfrad_inst - ! - ! !LOCAL VARIABLES: - integer , parameter :: nband = numrad ! number of solar radiation waveband classes - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - integer :: fp ! non-urban filter patch index - integer :: p ! patch index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! grid cell index - integer :: ib ! waveband number (1=vis, 2=nir) - integer :: iv ! canopy layer - real(r8) :: absrad ! absorbed solar radiation (W/m**2) - integer :: i ! layer index [idx] - real(r8) :: rnir ! reflected solar radiation [nir] (W/m**2) - real(r8) :: rvis ! reflected solar radiation [vis] (W/m**2) - real(r8) :: trd(bounds%begp:bounds%endp,numrad) ! transmitted solar radiation: direct (W/m**2) - real(r8) :: tri(bounds%begp:bounds%endp,numrad) ! transmitted solar radiation: diffuse (W/m**2) - real(r8) :: cad(bounds%begp:bounds%endp,numrad) ! direct beam absorbed by canopy (W/m**2) - real(r8) :: cai(bounds%begp:bounds%endp,numrad) ! diffuse radiation absorbed by canopy (W/m**2) - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - real(r8) :: sabg_snl_sum ! temporary, absorbed energy in all active snow layers [W/m2] - real(r8) :: absrad_pur ! temp: absorbed solar radiation by pure snow [W/m2] - real(r8) :: absrad_bc ! temp: absorbed solar radiation without BC [W/m2] - real(r8) :: absrad_oc ! temp: absorbed solar radiation without OC [W/m2] - real(r8) :: absrad_dst ! temp: absorbed solar radiation without dust [W/m2] - real(r8) :: sabg_pur(bounds%begp:bounds%endp) ! solar radiation absorbed by ground with pure snow [W/m2] - real(r8) :: sabg_bc(bounds%begp:bounds%endp) ! solar radiation absorbed by ground without BC [W/m2] - real(r8) :: sabg_oc(bounds%begp:bounds%endp) ! solar radiation absorbed by ground without OC [W/m2] - real(r8) :: sabg_dst(bounds%begp:bounds%endp) ! solar radiation absorbed by ground without dust [W/m2] - real(r8) :: parveg(bounds%begp:bounds%endp) ! absorbed par by vegetation (W/m**2) - ! - integer, parameter :: noonsec = isecspday / 2 ! seconds at local noon - ! - !------------------------------------------------------------------------------ - - associate( & - snl => col%snl , & ! Input: [integer (:) ] negative number of snow layers [nbr] - - forc_solad => atm2lnd_inst%forc_solad_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (W/m**2) - forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse radiation (W/m**2) - - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - - nrad => surfalb_inst%nrad_patch , & ! Input: [integer (:) ] number of canopy layers, above snow for radiative transfer - coszen => surfalb_inst%coszen_col , & ! Input: [real(r8) (:) ] column cosine of solar zenith angle - albgrd => surfalb_inst%albgrd_col , & ! Input: [real(r8) (:,:) ] ground albedo (direct) - albgri => surfalb_inst%albgri_col , & ! Input: [real(r8) (:,:) ] ground albedo (diffuse) - albsod => surfalb_inst%albsod_col , & ! Input: [real(r8) (:,:) ] direct-beam soil albedo (col,bnd) [frc] - albgrd_oc => surfalb_inst%albgrd_oc_col , & ! Input: [real(r8) (:,:) ] ground albedo without OC (direct) (col,bnd) - albgri_oc => surfalb_inst%albgri_oc_col , & ! Input: [real(r8) (:,:) ] ground albedo without OC (diffuse) (col,bnd) - albgrd_dst => surfalb_inst%albgrd_dst_col , & ! Input: [real(r8) (:,:) ] ground albedo without dust (direct) (col,bnd) - albgri_dst => surfalb_inst%albgri_dst_col , & ! Input: [real(r8) (:,:) ] ground albedo without dust (diffuse) (col,bnd) - albsnd_hst => surfalb_inst%albsnd_hst_col , & ! Input: [real(r8) (:,:) ] snow albedo, direct, for history files (col,bnd) [frc] - albsni_hst => surfalb_inst%albsni_hst_col , & ! Input: [real(r8) (:,:) ] snow ground albedo, diffuse, for history files (col,bnd - flx_absdv => surfalb_inst%flx_absdv_col , & ! Input: [real(r8) (:,:) ] direct flux absorption factor (col,lyr): VIS [frc] - flx_absdn => surfalb_inst%flx_absdn_col , & ! Input: [real(r8) (:,:) ] direct flux absorption factor (col,lyr): NIR [frc] - flx_absiv => surfalb_inst%flx_absiv_col , & ! Input: [real(r8) (:,:) ] diffuse flux absorption factor (col,lyr): VIS [frc] - flx_absin => surfalb_inst%flx_absin_col , & ! Input: [real(r8) (:,:) ] diffuse flux absorption factor (col,lyr): NIR [frc] - albsoi => surfalb_inst%albsoi_col , & ! Input: [real(r8) (:,:) ] diffuse soil albedo (col,bnd) [frc] - albd => surfalb_inst%albd_patch , & ! Input: [real(r8) (:,:) ] surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Input: [real(r8) (:,:) ] surface albedo (diffuse) - fabd => surfalb_inst%fabd_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by canopy per unit direct flux - fabd_sun => surfalb_inst%fabd_sun_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit direct flux - fabd_sha => surfalb_inst%fabd_sha_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit direct flux - fabi => surfalb_inst%fabi_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by canopy per unit diffuse flux - fabi_sun => surfalb_inst%fabi_sun_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit diffuse flux - fabi_sha => surfalb_inst%fabi_sha_patch , & ! Input: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit diffuse flux - ftdd => surfalb_inst%ftdd_patch , & ! Input: [real(r8) (:,:) ] down direct flux below canopy per unit direct flux - ftid => surfalb_inst%ftid_patch , & ! Input: [real(r8) (:,:) ] down diffuse flux below canopy per unit direct flux - ftii => surfalb_inst%ftii_patch , & ! Input: [real(r8) (:,:) ] down diffuse flux below canopy per unit diffuse flux - fabd_sun_z => surfalb_inst%fabd_sun_z_patch , & ! Input: [real(r8) (:,:) ] absorbed sunlit leaf direct PAR (per unit lai+sai) for each canopy layer - fabd_sha_z => surfalb_inst%fabd_sha_z_patch , & ! Input: [real(r8) (:,:) ] absorbed shaded leaf direct PAR (per unit lai+sai) for each canopy layer - fabi_sun_z => surfalb_inst%fabi_sun_z_patch , & ! Input: [real(r8) (:,:) ] absorbed sunlit leaf diffuse PAR (per unit lai+sai) for each canopy layer - fabi_sha_z => surfalb_inst%fabi_sha_z_patch , & ! Input: [real(r8) (:,:) ] absorbed shaded leaf diffuse PAR (per unit lai+sai) for each canopy layer - albgrd_pur => surfalb_inst%albgrd_pur_col , & ! Input: [real(r8) (:,:) ] pure snow ground albedo (direct) - albgri_pur => surfalb_inst%albgri_pur_col , & ! Input: [real(r8) (:,:) ] pure snow ground albedo (diffuse) - albgrd_bc => surfalb_inst%albgrd_bc_col , & ! Input: [real(r8) (:,:) ] ground albedo without BC (direct) (col,bnd) - albgri_bc => surfalb_inst%albgri_bc_col , & ! Input: [real(r8) (:,:) ] ground albedo without BC (diffuse) (col,bnd) - tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - fsun => canopystate_inst%fsun_patch , & ! Output: [real(r8) (:) ] sunlit fraction of canopy - fsa => solarabs_inst%fsa_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed (total) (W/m**2) - fsr => solarabs_inst%fsr_patch , & ! Output: [real(r8) (:) ] solar radiation reflected (W/m**2) - sabv => solarabs_inst%sabv_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2) - sabg => solarabs_inst%sabg_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - sabg_pen => solarabs_inst%sabg_pen_patch , & ! Output: [real(r8) (:) ] solar (rural) radiation penetrating top soisno layer (W/m**2) - sabg_soil => solarabs_inst%sabg_soil_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by soil (W/m**2) - sabg_snow => solarabs_inst%sabg_snow_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by snow (W/m**2) - sabg_lyr => solarabs_inst%sabg_lyr_patch , & ! Output: [real(r8) (:,:) ] absorbed radiative flux (patch,lyr) [W/m2] - fsr_nir_d => solarabs_inst%fsr_nir_d_patch , & ! Output: [real(r8) (:) ] reflected direct beam nir solar radiation (W/m**2) - fsr_nir_i => solarabs_inst%fsr_nir_i_patch , & ! Output: [real(r8) (:) ] reflected diffuse nir solar radiation (W/m**2) - fsr_nir_d_ln => solarabs_inst%fsr_nir_d_ln_patch , & ! Output: [real(r8) (:) ] reflected direct beam nir solar rad at local noon (W/m**2) - fsds_nir_d => solarabs_inst%fsds_nir_d_patch , & ! Output: [real(r8) (:) ] incident direct beam nir solar radiation (W/m**2) - fsds_nir_d_ln => solarabs_inst%fsds_nir_d_ln_patch , & ! Output: [real(r8) (:) ] incident direct beam nir solar rad at local noon (W/m**2) - fsds_nir_i => solarabs_inst%fsds_nir_i_patch , & ! Output: [real(r8) (:) ] incident diffuse nir solar radiation (W/m**2) - fsa_r => solarabs_inst%fsa_r_patch , & ! Output: [real(r8) (:) ] rural solar radiation absorbed (total) (W/m**2) - sub_surf_abs_SW => solarabs_inst%sub_surf_abs_SW_patch , & ! Output: [real(r8) (:) ] fraction of solar radiation absorbed below first snow layer (W/M**2) - - parveg_ln => surfrad_inst%parveg_ln_patch , & ! Output: [real(r8) (:) ] absorbed par by vegetation at local noon (W/m**2) - fsr_vis_d => surfrad_inst%fsr_vis_d_patch , & ! Output: [real(r8) (:) ] reflected direct beam vis solar radiation (W/m**2) - fsr_vis_i => surfrad_inst%fsr_vis_i_patch , & ! Output: [real(r8) (:) ] reflected diffuse vis solar radiation (W/m**2) - fsds_vis_i_ln => surfrad_inst%fsds_vis_i_ln_patch , & ! Output: [real(r8) (:) ] incident diffuse beam vis solar rad at local noon (W/m**2) - fsr_vis_d_ln => surfrad_inst%fsr_vis_d_ln_patch , & ! Output: [real(r8) (:) ] reflected direct beam vis solar rad at local noon (W/m**2) - fsds_vis_d => surfrad_inst%fsds_vis_d_patch , & ! Output: [real(r8) (:) ] incident direct beam vis solar radiation (W/m**2) - fsds_vis_i => surfrad_inst%fsds_vis_i_patch , & ! Output: [real(r8) (:) ] incident diffuse vis solar radiation (W/m**2) - fsds_vis_d_ln => surfrad_inst%fsds_vis_d_ln_patch , & ! Output: [real(r8) (:) ] incident direct beam vis solar rad at local noon (W/m**2) - sfc_frc_aer => surfrad_inst%sfc_frc_aer_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with all aerosols (patch) [W/m2] - sfc_frc_aer_sno => surfrad_inst%sfc_frc_aer_sno_patch, & ! Output: [real(r8) (:) ] surface forcing of snow with all aerosols, averaged only when snow is present (patch) [W/m2] - sfc_frc_bc => surfrad_inst%sfc_frc_bc_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with BC (patch) [W/m2] - sfc_frc_bc_sno => surfrad_inst%sfc_frc_bc_sno_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with BC, averaged only when snow is present (patch) [W/m2] - sfc_frc_oc => surfrad_inst%sfc_frc_oc_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with OC (patch) [W/m2] - sfc_frc_oc_sno => surfrad_inst%sfc_frc_oc_sno_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with OC, averaged only when snow is present (patch) [W/m2] - sfc_frc_dst => surfrad_inst%sfc_frc_dst_patch , & ! Output: [real(r8) (:) ] surface forcing of snow with dust (patch) [W/m2] - sfc_frc_dst_sno => surfrad_inst%sfc_frc_dst_sno_patch, & ! Output: [real(r8) (:) ] surface forcing of snow with dust, averaged only when snow is present (patch) [W/m2] - fsr_sno_vd => surfrad_inst%fsr_sno_vd_patch , & ! Output: [real(r8) (:) ] reflected visible, direct radiation from snow (for history files) (patch) [W/m2] - fsr_sno_nd => surfrad_inst%fsr_sno_nd_patch , & ! Output: [real(r8) (:) ] reflected near-IR, direct radiation from snow (for history files) (patch) [W/m2] - fsr_sno_vi => surfrad_inst%fsr_sno_vi_patch , & ! Output: [real(r8) (:) ] reflected visible, diffuse radiation from snow (for history files) (patch) [W/m2] - fsr_sno_ni => surfrad_inst%fsr_sno_ni_patch , & ! Output: [real(r8) (:) ] reflected near-IR, diffuse radiation from snow (for history files) (patch) [W/m2] - fsds_sno_vd => surfrad_inst%fsds_sno_vd_patch , & ! Output: [real(r8) (:) ] incident visible, direct radiation on snow (for history files) (patch) [W/m2] - fsds_sno_nd => surfrad_inst%fsds_sno_nd_patch , & ! Output: [real(r8) (:) ] incident near-IR, direct radiation on snow (for history files) (patch) [W/m2] - fsds_sno_vi => surfrad_inst%fsds_sno_vi_patch , & ! Output: [real(r8) (:) ] incident visible, diffuse radiation on snow (for history files) (patch) [W/m2] - fsds_sno_ni => surfrad_inst%fsds_sno_ni_patch , & ! Output: [real(r8) (:) ] incident near-IR, diffuse radiation on snow (for history files) (patch) [W/m2] - frac_sno_eff => waterstate_inst%frac_sno_eff_col & !Input: - - ) - - ! Determine seconds off current time step - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Initialize fluxes - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - l = patch%landunit(p) - g = patch%gridcell(p) - - sabg_soil(p) = 0._r8 - sabg_snow(p) = 0._r8 - sabg(p) = 0._r8 - sabv(p) = 0._r8 - fsa(p) = 0._r8 - if (lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) then - fsa_r(p) = 0._r8 - end if - sabg_lyr(p,:) = 0._r8 - sabg_pur(p) = 0._r8 - sabg_bc(p) = 0._r8 - sabg_oc(p) = 0._r8 - sabg_dst(p) = 0._r8 - - end do - - ! zero-out fsun for the urban patches - ! the non-urban patches were set prior to this call - ! and split into fates and non-fates specific functions - do fp = 1,num_urbanp - p = filter_urbanp(fp) - fsun(p) = 0._r8 - end do - - ! Loop over nband wavebands - do ib = 1, nband - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - - ! Absorbed by canopy - - cad(p,ib) = forc_solad(g,ib)*fabd(p,ib) - cai(p,ib) = forc_solai(g,ib)*fabi(p,ib) - sabv(p) = sabv(p) + cad(p,ib) + cai(p,ib) - fsa(p) = fsa(p) + cad(p,ib) + cai(p,ib) - if (ib == 1) then - parveg(p) = cad(p,ib) + cai(p,ib) - end if - if (lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) then - fsa_r(p) = fsa_r(p) + cad(p,ib) + cai(p,ib) - end if - - ! Transmitted = solar fluxes incident on ground - - trd(p,ib) = forc_solad(g,ib)*ftdd(p,ib) - tri(p,ib) = forc_solad(g,ib)*ftid(p,ib) + forc_solai(g,ib)*ftii(p,ib) - ! Solar radiation absorbed by ground surface - ! calculate absorbed solar by soil/snow separately - absrad = trd(p,ib)*(1._r8-albsod(c,ib)) + tri(p,ib)*(1._r8-albsoi(c,ib)) - sabg_soil(p) = sabg_soil(p) + absrad - absrad = trd(p,ib)*(1._r8-albsnd_hst(c,ib)) + tri(p,ib)*(1._r8-albsni_hst(c,ib)) - sabg_snow(p) = sabg_snow(p) + absrad - absrad = trd(p,ib)*(1._r8-albgrd(c,ib)) + tri(p,ib)*(1._r8-albgri(c,ib)) - sabg(p) = sabg(p) + absrad - fsa(p) = fsa(p) + absrad - if (lun%itype(l)==istsoil .or. lun%itype(l)==istcrop) then - fsa_r(p) = fsa_r(p) + absrad - end if - if (snl(c) == 0) then - sabg_snow(p) = sabg(p) - sabg_soil(p) = sabg(p) - endif - ! if no subgrid fluxes, make sure to set both components equal to weighted average - if (subgridflag == 0 .or. lun%itype(l) == istdlak) then - sabg_snow(p) = sabg(p) - sabg_soil(p) = sabg(p) - endif - - if (use_snicar_frc) then - ! Solar radiation absorbed by ground surface without BC - absrad_bc = trd(p,ib)*(1._r8-albgrd_bc(c,ib)) + tri(p,ib)*(1._r8-albgri_bc(c,ib)) - sabg_bc(p) = sabg_bc(p) + absrad_bc - - ! Solar radiation absorbed by ground surface without OC - absrad_oc = trd(p,ib)*(1._r8-albgrd_oc(c,ib)) + tri(p,ib)*(1._r8-albgri_oc(c,ib)) - sabg_oc(p) = sabg_oc(p) + absrad_oc - - ! Solar radiation absorbed by ground surface without dust - absrad_dst = trd(p,ib)*(1._r8-albgrd_dst(c,ib)) + tri(p,ib)*(1._r8-albgri_dst(c,ib)) - sabg_dst(p) = sabg_dst(p) + absrad_dst - - ! Solar radiation absorbed by ground surface without any aerosols - absrad_pur = trd(p,ib)*(1._r8-albgrd_pur(c,ib)) + tri(p,ib)*(1._r8-albgri_pur(c,ib)) - sabg_pur(p) = sabg_pur(p) + absrad_pur - end if - - end do ! end of patch loop - end do ! end nbands loop - - ! compute absorbed flux in each snow layer and top soil layer, - ! based on flux factors computed in the radiative transfer portion of SNICAR. - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - c = patch%column(p) - l = patch%landunit(p) - sabg_snl_sum = 0._r8 - - sub_surf_abs_SW(p) = 0._r8 - - ! CASE1: No snow layers: all energy is absorbed in top soil layer - if (snl(c) == 0) then - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,1) = sabg(p) - sabg_snl_sum = sabg_lyr(p,1) - - ! CASE 2: Snow layers present: absorbed radiation is scaled according to - ! flux factors computed by SNICAR - else - do i = -nlevsno+1,1,1 - sabg_lyr(p,i) = flx_absdv(c,i)*trd(p,1) + flx_absdn(c,i)*trd(p,2) + & - flx_absiv(c,i)*tri(p,1) + flx_absin(c,i)*tri(p,2) - ! summed radiation in active snow layers: - if (i >= snl(c)+1) then - sabg_snl_sum = sabg_snl_sum + sabg_lyr(p,i) - endif - if (i > snl(c)+1) then ! if snow layer is below surface snow layer - !accumulate subsurface flux as a diagnostic for history file - sub_surf_abs_SW(p) = sub_surf_abs_SW(p) + sabg_lyr(p,i) - endif - enddo - - ! Divide absorbed by total, to get fraction absorbed in subsurface - if (sabg_snl_sum /= 0._r8) then - sub_surf_abs_SW(p) = sub_surf_abs_SW(p)/sabg_snl_sum - else - sub_surf_abs_SW(p) = 0._r8 - endif - - ! Error handling: The situation below can occur when solar radiation is - ! NOT computed every timestep. - ! When the number of snow layers has changed in between computations of the - ! absorbed solar energy in each layer, we must redistribute the absorbed energy - ! to avoid physically unrealistic conditions. The assumptions made below are - ! somewhat arbitrary, but this situation does not arise very frequently. - ! This error handling is implemented to accomodate any value of the - ! radiation frequency. - ! change condition to match sabg_snow isntead of sabg - if (abs(sabg_snl_sum-sabg_snow(p)) > 0.00001_r8) then - if (snl(c) == 0) then - sabg_lyr(p,-nlevsno+1:0) = 0._r8 - sabg_lyr(p,1) = sabg(p) - elseif (snl(c) == -1) then - sabg_lyr(p,-nlevsno+1:-1) = 0._r8 - sabg_lyr(p,0) = sabg_snow(p)*0.6_r8 - sabg_lyr(p,1) = sabg_snow(p)*0.4_r8 - else - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,snl(c)+1) = sabg_snow(p)*0.75_r8 - sabg_lyr(p,snl(c)+2) = sabg_snow(p)*0.25_r8 - endif - endif - - ! If shallow snow depth, all solar radiation absorbed in top or top two snow layers - ! to prevent unrealistic timestep soil warming - if (subgridflag == 0 .or. lun%itype(l) == istdlak) then - if (snow_depth(c) < 0.10_r8) then - if (snl(c) == 0) then - sabg_lyr(p,-nlevsno+1:0) = 0._r8 - sabg_lyr(p,1) = sabg(p) - elseif (snl(c) == -1) then - sabg_lyr(p,-nlevsno+1:-1) = 0._r8 - sabg_lyr(p,0) = sabg(p) - sabg_lyr(p,1) = 0._r8 - else - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,snl(c)+1) = sabg(p)*0.75_r8 - sabg_lyr(p,snl(c)+2) = sabg(p)*0.25_r8 - endif - endif - endif - endif - - ! This situation should not happen: - if (abs(sum(sabg_lyr(p,:))-sabg_snow(p)) > 0.00001_r8) then - write(iulog,*)"SNICAR ERROR: Absorbed ground radiation not equal to summed snow layer radiation" - write(iulog,*)"Diff = ",sum(sabg_lyr(p,:))-sabg_snow(p) - write(iulog,*)"sabg_snow(p)= ",sabg_snow(p) - write(iulog,*)"sabg_sum(p) = ",sum(sabg_lyr(p,:)) - write(iulog,*)"snl(c) = ",snl(c) - write(iulog,*)"flx_absdv1 = ",trd(p,1)*(1.-albgrd(c,1)) - write(iulog,*)"flx_absdv2 = ",sum(flx_absdv(c,:))*trd(p,1) - write(iulog,*)"flx_absiv1 = ",tri(p,1)*(1.-albgri(c,1)) - write(iulog,*)"flx_absiv2 = ",sum(flx_absiv(c,:))*tri(p,1) - write(iulog,*)"flx_absdn1 = ",trd(p,2)*(1.-albgrd(c,2)) - write(iulog,*)"flx_absdn2 = ",sum(flx_absdn(c,:))*trd(p,2) - write(iulog,*)"flx_absin1 = ",tri(p,2)*(1.-albgri(c,2)) - write(iulog,*)"flx_absin2 = ",sum(flx_absin(c,:))*tri(p,2) - write(iulog,*)"albgrd_nir = ",albgrd(c,2) - write(iulog,*)"coszen = ",coszen(c) - call endrun(decomp_index=c, clmlevel=namec, msg=errmsg(sourcefile, __LINE__)) - endif - - ! Diagnostic: shortwave penetrating ground (e.g. top layer) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - sabg_pen(p) = sabg(p) - sabg_lyr(p, snl(c)+1) - end if - - if (use_snicar_frc) then - - ! BC aerosol forcing (patch-level): - sfc_frc_bc(p) = sabg(p) - sabg_bc(p) - - ! OC aerosol forcing (patch-level): - if (DO_SNO_OC) then - sfc_frc_oc(p) = sabg(p) - sabg_oc(p) - else - sfc_frc_oc(p) = 0._r8 - endif - - ! dust aerosol forcing (patch-level): - sfc_frc_dst(p) = sabg(p) - sabg_dst(p) - - ! all-aerosol forcing (patch-level): - sfc_frc_aer(p) = sabg(p) - sabg_pur(p) - - ! forcings averaged only over snow: - if (frac_sno(c) > 0._r8) then - sfc_frc_bc_sno(p) = sfc_frc_bc(p)/frac_sno(c) - sfc_frc_oc_sno(p) = sfc_frc_oc(p)/frac_sno(c) - sfc_frc_dst_sno(p) = sfc_frc_dst(p)/frac_sno(c) - sfc_frc_aer_sno(p) = sfc_frc_aer(p)/frac_sno(c) - else - sfc_frc_bc_sno(p) = spval - sfc_frc_oc_sno(p) = spval - sfc_frc_dst_sno(p) = spval - sfc_frc_aer_sno(p) = spval - endif - end if - enddo - - ! Radiation diagnostics - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - g = patch%gridcell(p) - - ! NDVI and reflected solar radiation - - rvis = albd(p,1)*forc_solad(g,1) + albi(p,1)*forc_solai(g,1) - rnir = albd(p,2)*forc_solad(g,2) + albi(p,2)*forc_solai(g,2) - fsr(p) = rvis + rnir - - fsds_vis_d(p) = forc_solad(g,1) - fsds_nir_d(p) = forc_solad(g,2) - fsds_vis_i(p) = forc_solai(g,1) - fsds_nir_i(p) = forc_solai(g,2) - fsr_vis_d(p) = albd(p,1)*forc_solad(g,1) - fsr_nir_d(p) = albd(p,2)*forc_solad(g,2) - fsr_vis_i(p) = albi(p,1)*forc_solai(g,1) - fsr_nir_i(p) = albi(p,2)*forc_solai(g,2) - - local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - if (local_secp1 == isecspday/2) then - fsds_vis_d_ln(p) = forc_solad(g,1) - fsds_nir_d_ln(p) = forc_solad(g,2) - fsr_vis_d_ln(p) = albd(p,1)*forc_solad(g,1) - fsr_nir_d_ln(p) = albd(p,2)*forc_solad(g,2) - fsds_vis_i_ln(p) = forc_solai(g,1) - parveg_ln(p) = parveg(p) - else - fsds_vis_d_ln(p) = spval - fsds_nir_d_ln(p) = spval - fsr_vis_d_ln(p) = spval - fsr_nir_d_ln(p) = spval - fsds_vis_i_ln(p) = spval - parveg_ln(p) = spval - end if - - ! diagnostic variables (downwelling and absorbed radiation partitioning) for history files - ! (OPTIONAL) - c = patch%column(p) - if (snl(c) < 0) then - fsds_sno_vd(p) = forc_solad(g,1) - fsds_sno_nd(p) = forc_solad(g,2) - fsds_sno_vi(p) = forc_solai(g,1) - fsds_sno_ni(p) = forc_solai(g,2) - - fsr_sno_vd(p) = fsds_vis_d(p)*albsnd_hst(c,1) - fsr_sno_nd(p) = fsds_nir_d(p)*albsnd_hst(c,2) - fsr_sno_vi(p) = fsds_vis_i(p)*albsni_hst(c,1) - fsr_sno_ni(p) = fsds_nir_i(p)*albsni_hst(c,2) - else - fsds_sno_vd(p) = spval - fsds_sno_nd(p) = spval - fsds_sno_vi(p) = spval - fsds_sno_ni(p) = spval - - fsr_sno_vd(p) = spval - fsr_sno_nd(p) = spval - fsr_sno_vi(p) = spval - fsr_sno_ni(p) = spval - endif - end do - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - g = patch%gridcell(p) - - local_secp1 = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - - if(elai(p)==0.0_r8.and.fabd(p,1)>0._r8)then - if ( DEBUG ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p - endif - ! Solar incident - - fsds_vis_d(p) = forc_solad(g,1) - fsds_nir_d(p) = forc_solad(g,2) - fsds_vis_i(p) = forc_solai(g,1) - fsds_nir_i(p) = forc_solai(g,2) - - ! Determine local noon incident solar - if (local_secp1 == noonsec) then - fsds_vis_d_ln(p) = forc_solad(g,1) - fsds_nir_d_ln(p) = forc_solad(g,2) - fsds_vis_i_ln(p) = forc_solai(g,1) - parveg_ln(p) = 0._r8 - else - fsds_vis_d_ln(p) = spval - fsds_nir_d_ln(p) = spval - fsds_vis_i_ln(p) = spval - parveg_ln(p) = spval - endif - - ! Solar reflected - ! per unit ground area (roof, road) and per unit wall area (sunwall, shadewall) - - fsr_vis_d(p) = albd(p,1) * forc_solad(g,1) - fsr_nir_d(p) = albd(p,2) * forc_solad(g,2) - fsr_vis_i(p) = albi(p,1) * forc_solai(g,1) - fsr_nir_i(p) = albi(p,2) * forc_solai(g,2) - - ! Determine local noon reflected solar - if (local_secp1 == noonsec) then - fsr_vis_d_ln(p) = fsr_vis_d(p) - fsr_nir_d_ln(p) = fsr_nir_d(p) - else - fsr_vis_d_ln(p) = spval - fsr_nir_d_ln(p) = spval - endif - fsr(p) = fsr_vis_d(p) + fsr_nir_d(p) + fsr_vis_i(p) + fsr_nir_i(p) - end do - - end associate - - end subroutine SurfaceRadiation - -end module SurfaceRadiationMod diff --git a/src/biogeophys/SurfaceResistanceMod.F90 b/src/biogeophys/SurfaceResistanceMod.F90 deleted file mode 100644 index 55e41a1106..0000000000 --- a/src/biogeophys/SurfaceResistanceMod.F90 +++ /dev/null @@ -1,416 +0,0 @@ -module SurfaceResistanceMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding routines for calculation of surface resistances of the different tracers - ! transported with BeTR. The surface here refers to water and soil, not including canopy - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod , only: SHR_CONST_TKFRZ - use clm_varctl , only: iulog - use SoilStateType , only: soilstate_type - use WaterStateType, only: waterstate_type - use TemperatureType , only : temperature_type - implicit none - save - private - integer :: soil_resis_method !choose the method for soil resistance calculation - - integer, parameter :: leepielke_1992 = 0 ! - integer, parameter :: sl_14 = 1 - - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: calc_soilevap_resis - public :: do_soilevap_beta, do_soil_resistance_sl14 -! public :: init_soil_resistance - public :: soil_resistance_readNL - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - ! - ! !REVISION HISTORY: - ! 6/25/2013 Created by Jinyun Tang - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- -!!$ subroutine init_soil_resistance() -!!$ ! -!!$ !DESCRIPTIONS -!!$ ! initialize method for soil resis calculation -!!$ ! -!!$ ! !USES: -!!$ use abortutils , only : endrun -!!$ use fileutils , only : getavu, relavu -!!$ use spmdMod , only : mpicom, masterproc -!!$ use shr_mpi_mod , only : shr_mpi_bcast -!!$ use clm_varctl , only : iulog, use_bedrock -!!$ use controlMod , only : NLFilename -!!$ use clm_nlUtilsMod , only : find_nlgroup_name -!!$ -!!$ ! !ARGUMENTS: -!!$ !------------------------------------------------------------------------------ -!!$ implicit none -!!$ integer :: nu_nml ! unit for namelist file -!!$ integer :: nml_error ! namelist i/o error flag -!!$ character(*), parameter :: subName = "('init_soil_resistance')" -!!$ -!!$ !----------------------------------------------------------------------- -!!$ -!!$! MUST agree with name in namelist and read statement -!!$ namelist /soil_resis_inparm/ soil_resis_method -!!$ -!!$ ! Default values for namelist -!!$ -!!$ soil_resis_method = sl_14 -!!$ -!!$ ! Read soil_resis namelist -!!$ if (masterproc) then -!!$ nu_nml = getavu() -!!$ open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) -!!$ call find_nlgroup_name(nu_nml, 'soil_resis_inparm', status=nml_error) -!!$ if (nml_error == 0) then -!!$ read(nu_nml, nml=soil_resis_inparm,iostat=nml_error) -!!$ if (nml_error /= 0) then -!!$ call endrun(subname // ':: ERROR reading soil_resis namelist') -!!$ end if -!!$ end if -!!$ close(nu_nml) -!!$ call relavu( nu_nml ) -!!$ -!!$ endif -!!$ -!!$ call shr_mpi_bcast(soil_resis_method, mpicom) -!!$ -!!$ if (masterproc) then -!!$ write(iulog,*) ' ' -!!$ write(iulog,*) 'soil_resis settings:' -!!$ write(iulog,*) ' soil_resis_method = ',soil_resis_method -!!$ endif -!!$!scs -!!$! soil_resis_method = leepielke_1992 -!!$! soil_resis_method = sl_14 -!!$!scs -!!$ -!!$ end subroutine init_soil_resistance - - !----------------------------------------------------------------------- - subroutine soil_resistance_readNL(NLFilename) - ! - !DESCRIPTIONS - ! Read the namelist for soil resistance method - ! - ! !USES: - use abortutils , only : endrun - use fileutils , only : getavu, relavu - use spmdMod , only : mpicom, masterproc - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use clm_nlUtilsMod , only : find_nlgroup_name - - ! !ARGUMENTS: - !------------------------------------------------------------------------------ - implicit none - character(len=*), intent(IN) :: NLFilename ! Namelist filename - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(*), parameter :: subName = "('init_soil_resistance')" - - !----------------------------------------------------------------------- - -! MUST agree with name in namelist and read statement - namelist /soil_resis_inparm/ soil_resis_method - - ! Default values for namelist - - soil_resis_method = sl_14 - - ! Read soil_resis namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'soil_resis_inparm', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=soil_resis_inparm,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading soil_resis namelist') - end if - else - call endrun(subname // ':: ERROR reading soil_resis namelist') - end if - close(nu_nml) - call relavu( nu_nml ) - - endif - - call shr_mpi_bcast(soil_resis_method, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'soil_resis settings:' - write(iulog,*) ' soil_resis_method = ',soil_resis_method - endif - - end subroutine soil_resistance_readNL - - !------------------------------------------------------------------------------ - subroutine calc_soilevap_resis(bounds, num_nolakec, filter_nolakec, & - soilstate_inst, waterstate_inst, temperature_inst) - ! - ! DESCRIPTIONS - ! compute the resis factor for soil evaporation calculation - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_PI - use decompMod , only : bounds_type - use ColumnType , only : col - use LandunitType , only : lun - use abortutils , only : endrun - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type), intent(in) :: temperature_inst - character(len=32) :: subname = 'calc_soilevap_resis' ! subroutine name - associate( & - soilbeta => soilstate_inst%soilbeta_col , & ! Output: [real(r8) (:)] factor that reduces ground evaporation - dsl => soilstate_inst%dsl_col , & ! Output: [real(r8) (:)] soil dry surface layer thickness - soilresis => soilstate_inst%soilresis_col & ! Output: [real(r8) (:)] soil evaporative resistance - ) - - !select the right method and do the calculation - select case (soil_resis_method) - - case (leepielke_1992) - call calc_beta_leepielke1992(bounds, num_nolakec, filter_nolakec, & - soilstate_inst, waterstate_inst, soilbeta(bounds%begc:bounds%endc)) - - case (sl_14) - call calc_soil_resistance_sl14(bounds, num_nolakec, filter_nolakec, & - soilstate_inst, waterstate_inst,temperature_inst, & - dsl(bounds%begc:bounds%endc), soilresis(bounds%begc:bounds%endc)) - case default - call endrun(subname // ':: a soilevap resis function must be specified!') - end select - - end associate - - end subroutine calc_soilevap_resis - - !------------------------------------------------------------------------------ - subroutine calc_beta_leepielke1992(bounds, num_nolakec, filter_nolakec, & - soilstate_inst, waterstate_inst, soilbeta) - ! - ! DESCRIPTION - ! compute the lee-pielke beta factor to scal actual soil evaporation from potential evaporation - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_PI - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use clm_varcon , only : denh2o, denice - use landunit_varcon , only : istice_mec, istwet, istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv, icol_road_perv - use ColumnType , only : col - use LandunitType , only : lun - ! - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(inout) :: soilbeta(bounds%begc:bounds%endc) - - !local variables - real(r8) :: fac, fac_fc, wx !temporary variables - integer :: c, l, fc !indices - - SHR_ASSERT_ALL((ubound(soilbeta) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:)] volumetric soil water at saturation (porosity) - watfc => soilstate_inst%watfc_col , & ! Input: [real(r8) (:,:)] volumetric soil water at field capacity - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:)] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:)] liquid water (kg/m2) - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:)] fraction of ground covered by snow (0 to 1) - frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:)] fraction of ground covered by surface water (0 to 1) - ) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%itype(l)/=istwet .AND. lun%itype(l)/=istice_mec) then - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - wx = (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice)/col%dz(c,1) - fac = min(1._r8, wx/watsat(c,1)) - fac = max( fac, 0.01_r8 ) - !! Lee and Pielke 1992 beta, added by K.Sakaguchi - if (wx < watfc(c,1) ) then !when water content of ths top layer is less than that at F.C. - fac_fc = min(1._r8, wx/watfc(c,1)) !eqn5.66 but divided by theta at field capacity - fac_fc = max( fac_fc, 0.01_r8 ) - ! modify soil beta by snow cover. soilbeta for snow surface is one - soilbeta(c) = (1._r8-frac_sno(c)-frac_h2osfc(c)) & - *0.25_r8*(1._r8 - cos(SHR_CONST_PI*fac_fc))**2._r8 & - + frac_sno(c)+ frac_h2osfc(c) - else !when water content of ths top layer is more than that at F.C. - soilbeta(c) = 1._r8 - end if - else if (col%itype(c) == icol_road_perv) then - soilbeta(c) = 0._r8 - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - soilbeta(c) = 0._r8 - else if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - soilbeta(c) = 0._r8 - endif - else - soilbeta(c) = 1._r8 - endif - enddo - - end associate - - end subroutine calc_beta_leepielke1992 - - !------------------------------------------------------------------------------ - function do_soilevap_beta()result(lres) - ! - !DESCRIPTION - ! return true if the moisture stress for soil evaporation is computed as beta factor - ! otherwise false - implicit none - logical :: lres - - if(soil_resis_method==leepielke_1992)then - lres=.true. - else - lres=.false. - endif - return - - end function do_soilevap_beta - - !------------------------------------------------------------------------------ - subroutine calc_soil_resistance_sl14(bounds, num_nolakec, filter_nolakec, & - soilstate_inst, waterstate_inst, temperature_inst, dsl, soilresis) - ! - ! DESCRIPTION - ! compute the lee-pielke beta factor to scal actual soil evaporation from potential evaporation - ! - ! USES - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_PI - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use clm_varcon , only : denh2o, denice - use landunit_varcon , only : istice_mec, istwet, istsoil, istcrop - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_imperv, icol_road_perv - use ColumnType , only : col - use LandunitType , only : lun - ! - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type), intent(in) :: temperature_inst - real(r8) , intent(inout) :: dsl(bounds%begc:bounds%endc) - real(r8) , intent(inout) :: soilresis(bounds%begc:bounds%endc) - - !local variables - real(r8) :: aird, eps, dg, d0, vwc_liq - real(r8) :: eff_por_top - integer :: c, l, fc !indices - - SHR_ASSERT_ALL((ubound(dsl) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(soilresis) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:)] volumetric soil water at saturation (porosity) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) -! eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:)] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:)] liquid water (kg/m2) - ) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - if (lun%itype(l)/=istwet .AND. lun%itype(l)/=istice_mec) then - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - vwc_liq = max(h2osoi_liq(c,1),1.0e-6_r8)/(dz(c,1)*denh2o) -! eff_porosity not calculated til SoilHydrology - eff_por_top = max(0.01_r8,watsat(c,1)-min(watsat(c,1), h2osoi_ice(c,1)/(dz(c,1)*denice))) - -! calculate diffusivity and air free pore space - aird = watsat(c,1)*(sucsat(c,1)/1.e7_r8)**(1./bsw(c,1)) - d0 = 2.12e-5*(t_soisno(c,1)/273.15)**1.75 ![Bitelli et al., JH, 08] - eps = watsat(c,1) - aird - dg = eps*d0*(eps/watsat(c,1))**(3._r8/max(3._r8,bsw(c,1))) - -! dsl(c) = dzmm(c,1)*max(0.001_r8,(0.8*eff_porosity(c,1) - vwc_liq)) & -! try arbitrary scaling (not top layer thickness) -! dsl(c) = 15._r8*max(0.001_r8,(0.8*eff_porosity(c,1) - vwc_liq)) & - dsl(c) = 15._r8*max(0.001_r8,(0.8*eff_por_top - vwc_liq)) & - ! /max(0.001_r8,(watsat(c,1)- aird)) - /max(0.001_r8,(0.8*watsat(c,1)- aird)) - - dsl(c)=max(dsl(c),0._r8) - dsl(c)=min(dsl(c),200._r8) - - soilresis(c) = dsl(c)/(dg*eps*1.e3) + 20._r8 - soilresis(c) = min(1.e6_r8,soilresis(c)) - - else if (col%itype(c) == icol_road_perv) then - soilresis(c) = 1.e6_r8 - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - soilresis(c) = 1.e6_r8 - else if (col%itype(c) == icol_roof .or. col%itype(c) == icol_road_imperv) then - soilresis(c) = 1.e6_r8 - endif - else - soilresis(c) = 0._r8 - endif - enddo - end associate - end subroutine calc_soil_resistance_sl14 - - !------------------------------------------------------------------------------ - function do_soil_resistance_sl14()result(lres) - ! - !DESCRIPTION - ! return true if the soil evaporative resistance is computed using a DSL - ! otherwise false - implicit none - logical :: lres - - if(soil_resis_method==sl_14)then - lres=.true. - else - lres=.false. - endif - return - - end function do_soil_resistance_sl14 - -end module SurfaceResistanceMod diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 deleted file mode 100644 index 5dfc3bc704..0000000000 --- a/src/biogeophys/TemperatureType.F90 +++ /dev/null @@ -1,1502 +0,0 @@ -module TemperatureType - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : use_cndv, iulog, use_luna, use_crop - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevlak, nlevurb - use clm_varcon , only : spval, ispval - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - save - private - ! - type, public :: temperature_type - - ! Temperatures - real(r8), pointer :: t_veg_patch (:) ! patch vegetation temperature (Kelvin) - real(r8), pointer :: t_skin_patch (:) ! patch skin temperature (Kelvin) - real(r8), pointer :: t_veg_day_patch (:) ! patch daytime accumulative vegetation temperature (Kelvinx*nsteps), LUNA specific, from midnight to current step - real(r8), pointer :: t_veg_night_patch (:) ! patch night-time accumulative vegetation temperature (Kelvin*nsteps), LUNA specific, from midnight to current step - real(r8), pointer :: t_veg10_day_patch (:) ! 10 day running mean of patch daytime time vegetation temperature (Kelvin), LUNA specific, but can be reused - real(r8), pointer :: t_veg10_night_patch (:) ! 10 day running mean of patch night time vegetation temperature (Kelvin), LUNA specific, but can be reused - integer, pointer :: ndaysteps_patch (:) ! number of daytime steps accumulated from mid-night, LUNA specific - integer, pointer :: nnightsteps_patch (:) ! number of nighttime steps accumulated from mid-night, LUNA specific - real(r8), pointer :: t_h2osfc_col (:) ! col surface water temperature - real(r8), pointer :: t_h2osfc_bef_col (:) ! col surface water temperature from time-step before - real(r8), pointer :: t_ssbef_col (:,:) ! col soil/snow temperature before update (-nlevsno+1:nlevgrnd) - real(r8), pointer :: t_soisno_col (:,:) ! col soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: tsl_col (:) ! col temperature of near-surface soil layer (Kelvin) - real(r8), pointer :: t_soi10cm_col (:) ! col soil temperature in top 10cm of soil (Kelvin) - real(r8), pointer :: t_soi17cm_col (:) ! col soil temperature in top 17cm of soil (Kelvin) - real(r8), pointer :: t_sno_mul_mss_col (:) ! col snow temperature multiplied by layer mass, layer sum (K * kg/m2) - real(r8), pointer :: t_lake_col (:,:) ! col lake temperature (Kelvin) (1:nlevlak) - real(r8), pointer :: t_grnd_col (:) ! col ground temperature (Kelvin) - real(r8), pointer :: t_grnd_r_col (:) ! col rural ground temperature (Kelvin) - real(r8), pointer :: t_grnd_u_col (:) ! col urban ground temperature (Kelvin) (needed by Hydrology2Mod) - real(r8), pointer :: t_building_lun (:) ! lun internal building air temperature (K) - real(r8), pointer :: t_roof_inner_lun (:) ! lun roof inside surface temperature (K) - real(r8), pointer :: t_sunw_inner_lun (:) ! lun sunwall inside surface temperature (K) - real(r8), pointer :: t_shdw_inner_lun (:) ! lun shadewall inside surface temperature (K) - real(r8), pointer :: t_floor_lun (:) ! lun floor temperature (K) - real(r8), pointer :: snot_top_col (:) ! col temperature of top snow layer [K] - real(r8), pointer :: dTdz_top_col (:) ! col temperature gradient in top layer [K m-1] - real(r8), pointer :: dt_veg_patch (:) ! patch change in t_veg, last iteration (Kelvin) - - real(r8), pointer :: dt_grnd_col (:) ! col change in t_grnd, last iteration (Kelvin) - real(r8), pointer :: thv_col (:) ! col virtual potential temperature (kelvin) - real(r8), pointer :: thm_patch (:) ! patch intermediate variable (forc_t+0.0098*forc_hgt_t_patch) - real(r8), pointer :: t_a10_patch (:) ! patch 10-day running mean of the 2 m temperature (K) - real(r8), pointer :: t_a10min_patch (:) ! patch 10-day running mean of min 2-m temperature - real(r8), pointer :: t_a5min_patch (:) ! patch 5-day running mean of min 2-m temperature - - real(r8), pointer :: taf_lun (:) ! lun urban canopy air temperature (K) - - real(r8), pointer :: t_ref2m_patch (:) ! patch 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_r_patch (:) ! patch rural 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_u_patch (:) ! patch urban 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_min_patch (:) ! patch daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_r_patch (:) ! patch daily minimum of average 2 m height surface air temperature - rural(K) - real(r8), pointer :: t_ref2m_min_u_patch (:) ! patch daily minimum of average 2 m height surface air temperature - urban (K) - real(r8), pointer :: t_ref2m_max_patch (:) ! patch daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_r_patch (:) ! patch daily maximum of average 2 m height surface air temperature - rural(K) - real(r8), pointer :: t_ref2m_max_u_patch (:) ! patch daily maximum of average 2 m height surface air temperature - urban (K) - real(r8), pointer :: t_ref2m_min_inst_patch (:) ! patch instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_inst_r_patch (:) ! patch instantaneous daily min of average 2 m height surface air temp - rural (K) - real(r8), pointer :: t_ref2m_min_inst_u_patch (:) ! patch instantaneous daily min of average 2 m height surface air temp - urban (K) - real(r8), pointer :: t_ref2m_max_inst_patch (:) ! patch instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_r_patch (:) ! patch instantaneous daily max of average 2 m height surface air temp - rural (K) - real(r8), pointer :: t_ref2m_max_inst_u_patch (:) ! patch instantaneous daily max of average 2 m height surface air temp - urban (K) - - ! Accumulated quantities - ! - ! TODO(wjs, 2014-08-05) Move these to the module(s) where they are used, to improve - ! modularity. In cases where they are used by two completely different modules, - ! which only use the same variable out of convenience, introduce a duplicate (point - ! being: that way one parameterization is free to change the exact meaning of its - ! accumulator without affecting the other). - ! - real(r8), pointer :: t_veg24_patch (:) ! patch 24hr average vegetation temperature (K) - real(r8), pointer :: t_veg240_patch (:) ! patch 240hr average vegetation temperature (Kelvin) - real(r8), pointer :: gdd0_patch (:) ! patch growing degree-days base 0C from planting (ddays) - real(r8), pointer :: gdd8_patch (:) ! patch growing degree-days base 8C from planting (ddays) - real(r8), pointer :: gdd10_patch (:) ! patch growing degree-days base 10C from planting (ddays) - real(r8), pointer :: gdd020_patch (:) ! patch 20-year average of gdd0 (ddays) - real(r8), pointer :: gdd820_patch (:) ! patch 20-year average of gdd8 (ddays) - real(r8), pointer :: gdd1020_patch (:) ! patch 20-year average of gdd10 (ddays) - - ! Heat content - real(r8), pointer :: beta_col (:) ! coefficient of convective velocity [-] - real(r8), pointer :: heat1_grc (:) ! grc initial gridcell total heat content - real(r8), pointer :: heat2_grc (:) ! grc post land cover change total heat content - real(r8), pointer :: liquid_water_temp1_grc (:) ! grc initial weighted average liquid water temperature (K) - real(r8), pointer :: liquid_water_temp2_grc (:) ! grc post land cover change weighted average liquid water temperature (K) - - ! Flags - integer , pointer :: imelt_col (:,:) ! flag for melting (=1), freezing (=2), Not=0 (-nlevsno+1:nlevgrnd) - - ! Emissivities - real(r8), pointer :: emv_patch (:) ! patch vegetation emissivity - real(r8), pointer :: emg_col (:) ! col ground emissivity - - ! Misc - real(r8), pointer :: xmf_col (:) ! total latent heat of phase change of ground water - real(r8), pointer :: xmf_h2osfc_col (:) ! latent heat of phase change of surface water - real(r8), pointer :: fact_col (:,:) ! used in computing tridiagonal matrix - real(r8), pointer :: c_h2osfc_col (:) ! heat capacity of surface water - - contains - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - - end type temperature_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, & - em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp) - ! - ! !DESCRIPTION: - ! - ! Initialization of the data type. Allocate data, setup variables - ! for history output, and initialize values needed for a cold-start. - ! - class(temperature_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: em_roof_lun(bounds%begl:) - real(r8) , intent(in) :: em_wall_lun(bounds%begl:) - real(r8) , intent(in) :: em_improad_lun(bounds%begl:) - real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) - logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used - logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - - call this%InitAllocate ( bounds ) - call this%InitHistory ( bounds, is_simple_buildtemp, is_prog_buildtemp ) - call this%InitCold ( bounds, & - em_roof_lun(bounds%begl:bounds%endl), & - em_wall_lun(bounds%begl:bounds%endl), & - em_improad_lun(bounds%begl:bounds%endl), & - em_perroad_lun(bounds%begl:bounds%endl), & - is_simple_buildtemp, is_prog_buildtemp) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize and allocate data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - begg = bounds%begg; endg= bounds%endg - - ! Temperatures - allocate(this%t_veg_patch (begp:endp)) ; this%t_veg_patch (:) = nan - allocate(this%t_skin_patch (begp:endp)) ; this%t_skin_patch (:) = nan - if(use_luna) then - allocate(this%t_veg_day_patch (begp:endp)) ; this%t_veg_day_patch (:) = spval - allocate(this%t_veg_night_patch (begp:endp)) ; this%t_veg_night_patch (:) = spval - allocate(this%t_veg10_day_patch (begp:endp)) ; this%t_veg10_day_patch (:) = spval - allocate(this%t_veg10_night_patch (begp:endp)) ; this%t_veg10_night_patch (:) = spval - allocate(this%ndaysteps_patch (begp:endp)) ; this%ndaysteps_patch (:) = ispval - allocate(this%nnightsteps_patch (begp:endp)) ; this%nnightsteps_patch (:) = ispval - endif - allocate(this%t_h2osfc_col (begc:endc)) ; this%t_h2osfc_col (:) = nan - allocate(this%t_h2osfc_bef_col (begc:endc)) ; this%t_h2osfc_bef_col (:) = nan - allocate(this%t_ssbef_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%t_ssbef_col (:,:) = nan - allocate(this%t_soisno_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%t_soisno_col (:,:) = nan - allocate(this%t_lake_col (begc:endc,1:nlevlak)) ; this%t_lake_col (:,:) = nan - allocate(this%t_grnd_col (begc:endc)) ; this%t_grnd_col (:) = nan - allocate(this%t_grnd_r_col (begc:endc)) ; this%t_grnd_r_col (:) = nan - allocate(this%t_grnd_u_col (begc:endc)) ; this%t_grnd_u_col (:) = nan - allocate(this%t_building_lun (begl:endl)) ; this%t_building_lun (:) = nan - allocate(this%t_roof_inner_lun (begl:endl)) ; this%t_roof_inner_lun (:) = nan - allocate(this%t_sunw_inner_lun (begl:endl)) ; this%t_sunw_inner_lun (:) = nan - allocate(this%t_shdw_inner_lun (begl:endl)) ; this%t_shdw_inner_lun (:) = nan - allocate(this%t_floor_lun (begl:endl)) ; this%t_floor_lun (:) = nan - allocate(this%snot_top_col (begc:endc)) ; this%snot_top_col (:) = nan - allocate(this%dTdz_top_col (begc:endc)) ; this%dTdz_top_col (:) = nan - allocate(this%dt_veg_patch (begp:endp)) ; this%dt_veg_patch (:) = nan - - allocate(this%tsl_col (begc:endc)) ; this%tsl_col (:) = nan - allocate(this%t_sno_mul_mss_col (begc:endc)) ; this%t_sno_mul_mss_col (:) = nan - allocate(this%tsl_col (begc:endc)) ; this%tsl_col (:) = nan - allocate(this%t_soi10cm_col (begc:endc)) ; this%t_soi10cm_col (:) = nan - allocate(this%t_soi17cm_col (begc:endc)) ; this%t_soi17cm_col (:) = spval - allocate(this%dt_grnd_col (begc:endc)) ; this%dt_grnd_col (:) = nan - allocate(this%thv_col (begc:endc)) ; this%thv_col (:) = nan - allocate(this%thm_patch (begp:endp)) ; this%thm_patch (:) = nan - allocate(this%t_a10_patch (begp:endp)) ; this%t_a10_patch (:) = nan - allocate(this%t_a10min_patch (begp:endp)) ; this%t_a10min_patch (:) = nan - allocate(this%t_a5min_patch (begp:endp)) ; this%t_a5min_patch (:) = nan - - allocate(this%taf_lun (begl:endl)) ; this%taf_lun (:) = nan - - allocate(this%t_ref2m_patch (begp:endp)) ; this%t_ref2m_patch (:) = nan - allocate(this%t_ref2m_r_patch (begp:endp)) ; this%t_ref2m_r_patch (:) = nan - allocate(this%t_ref2m_u_patch (begp:endp)) ; this%t_ref2m_u_patch (:) = nan - allocate(this%t_ref2m_min_patch (begp:endp)) ; this%t_ref2m_min_patch (:) = nan - allocate(this%t_ref2m_min_r_patch (begp:endp)) ; this%t_ref2m_min_r_patch (:) = nan - allocate(this%t_ref2m_min_u_patch (begp:endp)) ; this%t_ref2m_min_u_patch (:) = nan - allocate(this%t_ref2m_max_patch (begp:endp)) ; this%t_ref2m_max_patch (:) = nan - allocate(this%t_ref2m_max_r_patch (begp:endp)) ; this%t_ref2m_max_r_patch (:) = nan - allocate(this%t_ref2m_max_u_patch (begp:endp)) ; this%t_ref2m_max_u_patch (:) = nan - allocate(this%t_ref2m_max_inst_patch (begp:endp)) ; this%t_ref2m_max_inst_patch (:) = nan - allocate(this%t_ref2m_max_inst_r_patch (begp:endp)) ; this%t_ref2m_max_inst_r_patch (:) = nan - allocate(this%t_ref2m_max_inst_u_patch (begp:endp)) ; this%t_ref2m_max_inst_u_patch (:) = nan - allocate(this%t_ref2m_min_inst_patch (begp:endp)) ; this%t_ref2m_min_inst_patch (:) = nan - allocate(this%t_ref2m_min_inst_r_patch (begp:endp)) ; this%t_ref2m_min_inst_r_patch (:) = nan - allocate(this%t_ref2m_min_inst_u_patch (begp:endp)) ; this%t_ref2m_min_inst_u_patch (:) = nan - - ! Accumulated fields - allocate(this%t_veg24_patch (begp:endp)) ; this%t_veg24_patch (:) = nan - allocate(this%t_veg240_patch (begp:endp)) ; this%t_veg240_patch (:) = nan - allocate(this%gdd0_patch (begp:endp)) ; this%gdd0_patch (:) = spval - allocate(this%gdd8_patch (begp:endp)) ; this%gdd8_patch (:) = spval - allocate(this%gdd10_patch (begp:endp)) ; this%gdd10_patch (:) = spval - allocate(this%gdd020_patch (begp:endp)) ; this%gdd020_patch (:) = spval - allocate(this%gdd820_patch (begp:endp)) ; this%gdd820_patch (:) = spval - allocate(this%gdd1020_patch (begp:endp)) ; this%gdd1020_patch (:) = spval - - ! Heat content - allocate(this%beta_col (begc:endc)) ; this%beta_col (:) = nan - allocate(this%heat1_grc (begg:endg)) ; this%heat1_grc (:) = nan - allocate(this%heat2_grc (begg:endg)) ; this%heat2_grc (:) = nan - allocate(this%liquid_water_temp1_grc (begg:endg)) ; this%liquid_water_temp1_grc (:) = nan - allocate(this%liquid_water_temp2_grc (begg:endg)) ; this%liquid_water_temp2_grc (:) = nan - - ! flags - allocate(this%imelt_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%imelt_col (:,:) = huge(1) - - ! emissivities - allocate(this%emv_patch (begp:endp)) ; this%emv_patch (:) = nan - allocate(this%emg_col (begc:endc)) ; this%emg_col (:) = nan - - allocate(this%xmf_col (begc:endc)) ; this%xmf_col (:) = nan - allocate(this%xmf_h2osfc_col (begc:endc)) ; this%xmf_h2osfc_col (:) = nan - allocate(this%fact_col (begc:endc, -nlevsno+1:nlevgrnd)) ; this%fact_col (:,:) = nan - allocate(this%c_h2osfc_col (begc:endc)) ; this%c_h2osfc_col (:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) - ! - ! !DESCRIPTION: - ! Setup the fields that can be output on history files. - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varctl , only : use_cn, use_cndv - use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type), intent(in) :: bounds - logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used - logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - integer :: begg, endg - character(10) :: active - character(100) :: lname - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - begg = bounds%begg; endg= bounds%endg - - this%t_h2osfc_col(begc:endc) = spval - call hist_addfld1d (fname='TH2OSFC', units='K', & - avgflag='A', long_name='surface water temperature', & - ptr_col=this%t_h2osfc_col) - - this%t_grnd_u_col(begc:endc) = spval - call hist_addfld1d (fname='TG_U', units='K', & - avgflag='A', long_name='Urban ground temperature', & - ptr_col=this%t_grnd_u_col, set_nourb=spval, c2l_scale_type='urbans', default='inactive') - - this%t_lake_col(begc:endc,:) = spval - call hist_addfld2d (fname='TLAKE', units='K', type2d='levlak', & - avgflag='A', long_name='lake temperature', & - ptr_col=this%t_lake_col) - - this%t_soisno_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%t_soisno_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_T', units='K', type2d='levsno', & - avgflag='A', long_name='Snow temperatures', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_T_ICE', units='K', type2d='levsno', & - avgflag='A', long_name='Snow temperatures (ice landunits only)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%t_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='TSA', units='K', & - avgflag='A', long_name='2m air temperature', & - ptr_patch=this%t_ref2m_patch) - - call hist_addfld1d (fname='TSA_ICE', units='K', & - avgflag='A', long_name='2m air temperature (ice landunits only)', & - ptr_patch=this%t_ref2m_patch, l2g_scale_type='ice', default='inactive') - - this%t_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='TSA_R', units='K', & - avgflag='A', long_name='Rural 2m air temperature', & - ptr_patch=this%t_ref2m_r_patch, set_spec=spval, default='inactive') - - this%t_ref2m_min_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMNAV', units='K', & - avgflag='A', long_name='daily minimum of average 2-m temperature', & - ptr_patch=this%t_ref2m_min_patch) - - this%t_ref2m_max_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMXAV', units='K', & - avgflag='A', long_name='daily maximum of average 2-m temperature', & - ptr_patch=this%t_ref2m_max_patch) - - this%t_ref2m_min_r_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMNAV_R', units='K', & - avgflag='A', long_name='Rural daily minimum of average 2-m temperature', & - ptr_patch=this%t_ref2m_min_r_patch, set_spec=spval, default='inactive') - - this%t_ref2m_max_r_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMXAV_R', units='K', & - avgflag='A', long_name='Rural daily maximum of average 2-m temperature', & - ptr_patch=this%t_ref2m_max_r_patch, set_spec=spval, default='inactive') - - this%t_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='TSA_U', units='K', & - avgflag='A', long_name='Urban 2m air temperature', & - ptr_patch=this%t_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%t_ref2m_min_u_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMNAV_U', units='K', & - avgflag='A', long_name='Urban daily minimum of average 2-m temperature', & - ptr_patch=this%t_ref2m_min_u_patch, set_nourb=spval, default='inactive') - - this%t_ref2m_max_u_patch(begp:endp) = spval - call hist_addfld1d (fname='TREFMXAV_U', units='K', & - avgflag='A', long_name='Urban daily maximum of average 2-m temperature', & - ptr_patch=this%t_ref2m_max_u_patch, set_nourb=spval, default='inactive') - - this%t_veg_patch(begp:endp) = spval - call hist_addfld1d (fname='TV', units='K', & - avgflag='A', long_name='vegetation temperature', & - ptr_patch=this%t_veg_patch) - - this%t_skin_patch(begp:endp) = spval - call hist_addfld1d(fname='TSKIN', units='K', & - avgflag='A', long_name='skin temperature', & - ptr_patch=this%t_skin_patch, c2l_scale_type='urbans') - - this%t_grnd_col(begc:endc) = spval - call hist_addfld1d (fname='TG', units='K', & - avgflag='A', long_name='ground temperature', & - ptr_col=this%t_grnd_col, c2l_scale_type='urbans') - - call hist_addfld1d (fname='TG_ICE', units='K', & - avgflag='A', long_name='ground temperature (ice landunits only)', & - ptr_col=this%t_grnd_col, c2l_scale_type='urbans', l2g_scale_type='ice', & - default='inactive') - - this%t_grnd_r_col(begc:endc) = spval - call hist_addfld1d (fname='TG_R', units='K', & - avgflag='A', long_name='Rural ground temperature', & - ptr_col=this%t_grnd_r_col, set_spec=spval, default='inactive') - - this%t_soisno_col(begc:endc,:) = spval - call hist_addfld2d (fname='TSOI', units='K', type2d='levgrnd', & - avgflag='A', long_name='soil temperature (vegetated landunits only)', & - ptr_col=this%t_soisno_col, l2g_scale_type='veg') - - call hist_addfld2d (fname='TSOI_ICE', units='K', type2d='levgrnd', & - avgflag='A', long_name='soil temperature (ice landunits only)', & - ptr_col=this%t_soisno_col, l2g_scale_type='ice') - - this%t_soi10cm_col(begc:endc) = spval - call hist_addfld1d (fname='TSOI_10CM', units='K', & - avgflag='A', long_name='soil temperature in top 10cm of soil', & - ptr_col=this%t_soi10cm_col, set_urb=spval) - - this%tsl_col(begc:endc) = spval - call hist_addfld1d (fname='TSL', units='K', & - avgflag='A', long_name='temperature of near-surface soil layer (vegetated landunits only)', & - ptr_col=this%tsl_col, l2g_scale_type='veg') - this%t_sno_mul_mss_col(begc:endc) = spval - call hist_addfld1d (fname='SNOTXMASS', units='K kg/m2', & - avgflag='A', long_name='snow temperature times layer mass, layer sum; '// & - 'to get mass-weighted temperature, divide by (SNOWICE+SNOWLIQ)', & - ptr_col=this%t_sno_mul_mss_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SNOTXMASS_ICE', units='K kg/m2', & - avgflag='A', long_name='snow temperature times layer mass, layer sum (ice landunits only); ' // & - 'to get mass-weighted temperature, divide by (SNOWICE_ICE+SNOWLIQ_ICE)', & - ptr_col=this%t_sno_mul_mss_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - if (use_cndv .or. use_crop) then - active = "active" - else - active = "inactive" - end if - this%t_a10_patch(begp:endp) = spval - call hist_addfld1d (fname='T10', units='K', & - avgflag='A', long_name='10-day running mean of 2-m temperature', & - ptr_patch=this%t_a10_patch, default='inactive') - - if (use_cn .and. use_crop )then - this%t_a5min_patch(begp:endp) = spval - call hist_addfld1d (fname='A5TMIN', units='K', & - avgflag='A', long_name='5-day running mean of min 2-m temperature', & - ptr_patch=this%t_a5min_patch, default='inactive') - end if - - if (use_cn .and. use_crop )then - this%t_a10min_patch(begp:endp) = spval - call hist_addfld1d (fname='A10TMIN', units='K', & - avgflag='A', long_name='10-day running mean of min 2-m temperature', & - ptr_patch=this%t_a10min_patch, default='inactive') - end if - - this%t_building_lun(begl:endl) = spval - if ( is_simple_buildtemp )then - lname = 'internal urban building temperature' - else if ( is_prog_buildtemp )then - lname = 'internal urban building air temperature' - end if - call hist_addfld1d(fname='TBUILD', units='K', & - avgflag='A', long_name=lname, & - ptr_lunit=this%t_building_lun, set_nourb=spval, l2g_scale_type='unity') - - if ( is_prog_buildtemp )then - this%t_roof_inner_lun(begl:endl) = spval - call hist_addfld1d(fname='TROOF_INNER', units='K', & - avgflag='A', long_name='roof inside surface temperature', & - ptr_lunit=this%t_roof_inner_lun, set_nourb=spval, l2g_scale_type='unity', & - default='inactive') - - this%t_sunw_inner_lun(begl:endl) = spval - call hist_addfld1d(fname='TSUNW_INNER', units='K', & - avgflag='A', long_name='sunwall inside surface temperature', & - ptr_lunit=this%t_sunw_inner_lun, set_nourb=spval, l2g_scale_type='unity', & - default='inactive') - - this%t_shdw_inner_lun(begl:endl) = spval - call hist_addfld1d(fname='TSHDW_INNER', units='K', & - avgflag='A', long_name='shadewall inside surface temperature', & - ptr_lunit=this%t_shdw_inner_lun, set_nourb=spval, l2g_scale_type='unity', & - default='inactive') - - this%t_floor_lun(begl:endl) = spval - call hist_addfld1d(fname='TFLOOR', units='K', & - avgflag='A', long_name='floor temperature', & - ptr_lunit=this%t_floor_lun, set_nourb=spval, l2g_scale_type='unity', & - default='inactive') - end if - - this%heat1_grc(begg:endg) = spval - call hist_addfld1d (fname='HEAT_CONTENT1', units='J/m^2', & - avgflag='A', long_name='initial gridcell total heat content', & - ptr_lnd=this%heat1_grc) - call hist_addfld1d (fname='HEAT_CONTENT1_VEG', units='J/m^2', & - avgflag='A', long_name='initial gridcell total heat content - vegetated landunits only', & - ptr_lnd=this%heat1_grc, l2g_scale_type='veg', default='inactive') - - this%heat2_grc(begg:endg) = spval - call hist_addfld1d (fname='HEAT_CONTENT2', units='J/m^2', & - avgflag='A', long_name='post land cover change total heat content', & - ptr_lnd=this%heat2_grc, default='inactive') - - this%liquid_water_temp1_grc(begg:endg) = spval - call hist_addfld1d (fname='LIQUID_WATER_TEMP1', units='K', & - avgflag='A', long_name='initial gridcell weighted average liquid water temperature', & - ptr_lnd=this%liquid_water_temp1_grc, default='inactive') - - this%snot_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNOTTOPL', units='K', & - avgflag='A', long_name='snow temperature (top layer)', & - ptr_col=this%snot_top_col, set_urb=spval, default='inactive') - - call hist_addfld1d (fname='SNOTTOPL_ICE', units='K', & - avgflag='A', long_name='snow temperature (top layer, ice landunits only)', & - ptr_col=this%snot_top_col, set_urb=spval, l2g_scale_type='ice', default='inactive') - - this%dTdz_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNOdTdzL', units='K/m', & - avgflag='A', long_name='top snow layer temperature gradient (land)', & - ptr_col=this%dTdz_top_col, set_urb=spval, default='inactive') - - if (use_cn) then - this%dt_veg_patch(begp:endp) = spval - call hist_addfld1d (fname='DT_VEG', units='K', & - avgflag='A', long_name='change in t_veg, last iteration', & - ptr_patch=this%dt_veg_patch, default='inactive') - end if - - if (use_cn ) then - this%emv_patch(begp:endp) = spval - call hist_addfld1d (fname='EMV', units='proportion', & - avgflag='A', long_name='vegetation emissivity', & - ptr_patch=this%emv_patch, default='inactive') - end if - - if (use_cn) then - this%emg_col(begc:endc) = spval - call hist_addfld1d (fname='EMG', units='proportion', & - avgflag='A', long_name='ground emissivity', & - ptr_col=this%emg_col, default='inactive') - end if - - if (use_cn) then - this%beta_col(begc:endc) = spval - call hist_addfld1d (fname='BETA', units='none', & - avgflag='A', long_name='coefficient of convective velocity', & - ptr_col=this%beta_col, default='inactive') - end if - - ! Accumulated quantities - - this%t_veg24_patch(begp:endp) = spval - call hist_addfld1d (fname='TV24', units='K', & - avgflag='A', long_name='vegetation temperature (last 24hrs)', & - ptr_patch=this%t_veg24_patch, default='inactive') - - this%t_veg240_patch(begp:endp) = spval - call hist_addfld1d (fname='TV240', units='K', & - avgflag='A', long_name='vegetation temperature (last 240hrs)', & - ptr_patch=this%t_veg240_patch, default='inactive') - - if (use_crop) then - this%gdd0_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD0', units='ddays', & - avgflag='A', long_name='Growing degree days base 0C from planting', & - ptr_patch=this%gdd0_patch, default='inactive') - end if - - if (use_crop) then - this%gdd8_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD8', units='ddays', & - avgflag='A', long_name='Growing degree days base 8C from planting', & - ptr_patch=this%gdd8_patch, default='inactive') - - this%gdd10_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD10', units='ddays', & - avgflag='A', long_name='Growing degree days base 10C from planting', & - ptr_patch=this%gdd10_patch, default='inactive') - - this%gdd020_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD020', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 0C from planting', & - ptr_patch=this%gdd020_patch, default='inactive') - - this%gdd820_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD820', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 8C from planting', & - ptr_patch=this%gdd820_patch, default='inactive') - - this%gdd1020_patch(begp:endp) = spval - call hist_addfld1d (fname='GDD1020', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 10C from planting', & - ptr_patch=this%gdd1020_patch, default='inactive') - - end if - if(use_luna)then - call hist_addfld1d (fname='TVEGD10', units='Kelvin', & - avgflag='A', long_name='10 day running mean of patch daytime vegetation temperature', & - ptr_patch=this%t_veg10_day_patch, default='inactive') - call hist_addfld1d (fname='TVEGN10', units='Kelvin', & - avgflag='A', long_name='10 day running mean of patch night-time vegetation temperature', & - ptr_patch=this%t_veg10_night_patch, default='inactive') - endif - - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, & - em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp) - ! - ! !DESCRIPTION: - ! Initialize cold start conditions for module variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varcon , only : denice, denh2o, sb - use landunit_varcon, only : istwet, istsoil, istdlak, istice_mec - use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall - use column_varcon , only : icol_shadewall, icol_road_perv - use clm_varctl , only : iulog, use_vancouver, use_mexicocity - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: em_roof_lun(bounds%begl:) - real(r8) , intent(in) :: em_wall_lun(bounds%begl:) - real(r8) , intent(in) :: em_improad_lun(bounds%begl:) - real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) - logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used - logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - ! - ! !LOCAL VARIABLES: - integer :: j,l,c,p ! indices - integer :: nlevs ! number of levels - real(r8) :: snowbd ! temporary calculation of snow bulk density (kg/m3) - real(r8) :: fmelt ! snowbd/100 - integer :: lev - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(em_roof_lun) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_wall_lun) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_improad_lun) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_perroad_lun) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - associate(snl => col%snl) ! Output: [integer (:) ] number of snow layers - - ! Set snow/soil temperature - ! t_lake only has valid values over non-lake - ! t_soisno, t_grnd and t_veg have valid values over all land - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - - this%t_soisno_col(c,-nlevsno+1:nlevgrnd) = spval - - ! Snow level temperatures - all land points - if (snl(c) < 0) then - do j = snl(c)+1, 0 - this%t_soisno_col(c,j) = 250._r8 - end do - end if - - ! Below snow temperatures - nonlake points (lake points are set below) - if (.not. lun%lakpoi(l)) then - - if (lun%itype(l)==istice_mec) then - this%t_soisno_col(c,1:nlevgrnd) = 250._r8 - - else if (lun%itype(l) == istwet) then - this%t_soisno_col(c,1:nlevgrnd) = 277._r8 - - else if (lun%urbpoi(l)) then - if (use_vancouver) then - if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - ! Set road top layer to initial air temperature and interpolate other - ! layers down to 20C in bottom layer - do j = 1, nlevgrnd - this%t_soisno_col(c,j) = 297.56 - (j-1) * ((297.56-293.16)/(nlevgrnd-1)) - end do - ! Set wall and roof layers to initial air temperature - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_roof) then - this%t_soisno_col(c,1:nlevurb) = 297.56 - else - this%t_soisno_col(c,1:nlevgrnd) = 283._r8 - end if - else if (use_mexicocity) then - if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - ! Set road top layer to initial air temperature and interpolate other - ! layers down to 22C in bottom layer - do j = 1, nlevgrnd - this%t_soisno_col(c,j) = 289.46 - (j-1) * ((289.46-295.16)/(nlevgrnd-1)) - end do - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_roof) then - ! Set wall and roof layers to initial air temperature - this%t_soisno_col(c,1:nlevurb) = 289.46 - else - this%t_soisno_col(c,1:nlevgrnd) = 283._r8 - end if - else - if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - this%t_soisno_col(c,1:nlevgrnd) = 274._r8 - else if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall & - .or. col%itype(c) == icol_roof) then - ! Set sunwall, shadewall, roof to fairly high temperature to avoid initialization - ! shock from large heating/air conditioning flux - this%t_soisno_col(c,1:nlevurb) = 292._r8 - end if - end if - else - this%t_soisno_col(c,1:nlevgrnd) = 274._r8 - - endif - endif - end do - - ! Initialize internal building temperature, inner temperatures of building - ! surfaces, and floor temperature - if ( is_prog_buildtemp )then - do l = bounds%begl, bounds%endl - do c = lun%coli(l),lun%colf(l) - if (col%itype(c) == icol_roof) then - this%t_roof_inner_lun(l) = this%t_soisno_col(c,nlevurb) - this%t_building_lun(l) = this%t_soisno_col(c,nlevurb) ! arbitrarily set to roof temperature - this%t_floor_lun(l) = this%t_soisno_col(c,nlevurb) ! arbitrarily set to roof temperature - else if (col%itype(c) == icol_sunwall) then - this%t_sunw_inner_lun(l) = this%t_soisno_col(c,nlevurb) - else if (col%itype(c) == icol_shadewall) then - this%t_shdw_inner_lun(l) = this%t_soisno_col(c,nlevurb) - end if - end do - end do - end if - - ! Set Ground temperatures - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - - if (lun%lakpoi(l)) then - this%t_grnd_col(c) = 277._r8 - else - this%t_grnd_col(c) = this%t_soisno_col(c,snl(c)+1) - end if - this%t_soi17cm_col(c) = this%t_grnd_col(c) - end do - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%lakpoi(l)) then ! lake - this%t_lake_col(c,1:nlevlak) = this%t_grnd_col(c) - this%t_soisno_col(c,1:nlevgrnd) = this%t_grnd_col(c) - end if - end do - - ! Set t_h2osfc_col - - this%t_h2osfc_col(bounds%begc:bounds%endc) = 274._r8 - - ! Set t_veg, t_ref2m, t_ref2m_u and tref2m_r - - do p = bounds%begp, bounds%endp - c = patch%column(p) - l = patch%landunit(p) - - if (use_vancouver) then - this%t_veg_patch(p) = 297.56 - else if (use_mexicocity) then - this%t_veg_patch(p) = 289.46 - else - this%t_veg_patch(p) = 283._r8 - end if - - if (use_vancouver) then - this%t_ref2m_patch(p) = 297.56 - else if (use_mexicocity) then - this%t_ref2m_patch(p) = 289.46 - else - this%t_ref2m_patch(p) = 283._r8 - end if - - if (lun%urbpoi(l)) then - if (use_vancouver) then - this%t_ref2m_u_patch(p) = 297.56 - else if (use_mexicocity) then - this%t_ref2m_u_patch(p) = 289.46 - else - this%t_ref2m_u_patch(p) = 283._r8 - end if - else - if (.not. lun%ifspecial(l)) then - if (use_vancouver) then - this%t_ref2m_r_patch(p) = 297.56 - else if (use_mexicocity) then - this%t_ref2m_r_patch(p) = 289.46 - else - this%t_ref2m_r_patch(p) = 283._r8 - end if - else - this%t_ref2m_r_patch(p) = spval - end if - end if - - end do - - end associate - - do l = bounds%begl, bounds%endl - if (lun%urbpoi(l)) then - if (use_vancouver) then - this%taf_lun(l) = 297.56_r8 - else if (use_mexicocity) then - this%taf_lun(l) = 289.46_r8 - else - this%taf_lun(l) = 283._r8 - end if - end if - end do - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - - if (col%itype(c) == icol_roof ) this%emg_col(c) = em_roof_lun(l) - if (col%itype(c) == icol_sunwall ) this%emg_col(c) = em_wall_lun(l) - if (col%itype(c) == icol_shadewall ) this%emg_col(c) = em_wall_lun(l) - if (col%itype(c) == icol_road_imperv) this%emg_col(c) = em_improad_lun(l) - if (col%itype(c) == icol_road_perv ) this%emg_col(c) = em_perroad_lun(l) - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildtemp) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_double, ncd_int - use restUtilMod - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used - logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - call restartvar(ncid=ncid, flag=flag, varname='T_SOISNO', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='soil-snow temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_soisno_col) - - call restartvar(ncid=ncid, flag=flag, varname='T_VEG', xtype=ncd_double, & - dim1name='pft', & - long_name='vegetation temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_veg_patch) - - call restartvar(ncid=ncid, flag=flag, varname='TH2OSFC', xtype=ncd_double, & - dim1name='column', & - long_name='surface water temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_h2osfc_col) - if (flag=='read' .and. .not. readvar) then - this%t_h2osfc_col(bounds%begc:bounds%endc) = 274.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='T_LAKE', xtype=ncd_double, & - dim1name='column', dim2name='levlak', switchdim=.true., & - long_name='lake temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_lake_col) - - call restartvar(ncid=ncid, flag=flag, varname='T_GRND', xtype=ncd_double, & - dim1name='column', & - long_name='ground temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_grnd_col) - - call restartvar(ncid=ncid, flag=flag, varname='T_GRND_R', xtype=ncd_double, & - dim1name='column', & - long_name='rural ground temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_grnd_r_col) - - call restartvar(ncid=ncid, flag=flag, varname='T_GRND_U', xtype=ncd_double, & - dim1name='column', & - long_name='urban ground temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_grnd_u_col) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M', xtype=ncd_double, & - dim1name='pft', & - long_name='2m height surface air temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_patch) - if (flag=='read' .and. .not. readvar) call endrun(msg=errMsg(sourcefile, __LINE__)) - - call restartvar(ncid=ncid, flag=flag, varname="T_REF2M_R", xtype=ncd_double, & - dim1name='pft', & - long_name='Rural 2m height surface air temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_r_patch) - - call restartvar(ncid=ncid, flag=flag, varname="T_REF2M_U", xtype=ncd_double, dim1name='pft', & - long_name='Urban 2m height surface air temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_u_patch) - - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN', xtype=ncd_double, & - dim1name='pft', & - long_name='daily minimum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural daily minimum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_r_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN_U', xtype=ncd_double, dim1name='pft', & - long_name='urban daily minimum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_u_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX', xtype=ncd_double, & - dim1name='pft', & - long_name='daily maximum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural daily maximum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_r_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX_U', xtype=ncd_double, dim1name='pft', & - long_name='urban daily maximum of average 2 m height surface air temperature (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_u_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN_INST', xtype=ncd_double, & - dim1name='pft', & - long_name='instantaneous daily min of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_inst_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN_INST_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural instantaneous daily min of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_inst_r_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MIN_INST_U', xtype=ncd_double, dim1name='pft', & - long_name='urban instantaneous daily min of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_min_inst_u_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX_INST', xtype=ncd_double, & - dim1name='pft', & - long_name='instantaneous daily max of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_inst_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX_INST_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural instantaneous daily max of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_inst_r_patch) - - call restartvar(ncid=ncid, flag=flag, varname='T_REF2M_MAX_INST_U', xtype=ncd_double, dim1name='pft', & - long_name='urban instantaneous daily max of average 2 m height surface air temp (K)', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_ref2m_max_inst_u_patch) - - call restartvar(ncid=ncid, flag=flag, varname='taf', xtype=ncd_double, dim1name='landunit', & - long_name='urban canopy air temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%taf_lun) - - if (use_crop) then - call restartvar(ncid=ncid, flag=flag, varname='gdd1020', xtype=ncd_double, & - dim1name='pft', long_name='20 year average of growing degree-days base 10C from planting', units='ddays', & - interpinic_flag='interp', readvar=readvar, data=this%gdd1020_patch) - - call restartvar(ncid=ncid, flag=flag, varname='gdd820', xtype=ncd_double, & - dim1name='pft', long_name='20 year average of growing degree-days base 8C from planting', units='ddays', & - interpinic_flag='interp', readvar=readvar, data=this%gdd820_patch) - - call restartvar(ncid=ncid, flag=flag, varname='gdd020', xtype=ncd_double, & - dim1name='pft', long_name='20 year average of growing degree-days base 0C from planting', units='ddays', & - interpinic_flag='interp', readvar=readvar, data=this%gdd020_patch) - end if - - if(use_luna)then - call restartvar(ncid=ncid, flag=flag, varname='tvegd10', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean daytime vegetation temperature', units='Kelvin', & - interpinic_flag='interp', readvar=readvar, data=this%t_veg10_day_patch ) - call restartvar(ncid=ncid, flag=flag, varname='tvegd', xtype=ncd_double, & - dim1name='pft', long_name='accumulative daytime vegetation temperature', units='Kelvin*steps', & - interpinic_flag='interp', readvar=readvar, data=this%t_veg_day_patch ) - call restartvar(ncid=ncid, flag=flag, varname='tvegn10', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean nighttime vegetation temperature', units='Kelvin', & - interpinic_flag='interp', readvar=readvar, data=this%t_veg10_night_patch ) - call restartvar(ncid=ncid, flag=flag, varname='tvegn', xtype=ncd_double, & - dim1name='pft', long_name='accumulative nighttime vegetation temperature', units='Kelvin*steps', & - interpinic_flag='interp', readvar=readvar, data=this%t_veg_night_patch ) - call restartvar(ncid=ncid, flag=flag, varname='tair10', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean air temperature', units='Kelvin', & - interpinic_flag='interp', readvar=readvar, data=this%t_a10_patch ) - call restartvar(ncid=ncid, flag=flag, varname='ndaysteps', xtype=ncd_int, & - dim1name='pft', long_name='accumulative daytime steps', units='steps', & - interpinic_flag='interp', readvar=readvar, data=this%ndaysteps_patch ) - call restartvar(ncid=ncid, flag=flag, varname='nnightsteps', xtype=ncd_int, & - dim1name='pft', long_name='accumulative nighttime steps', units='steps', & - interpinic_flag='interp', readvar=readvar, data=this%nnightsteps_patch ) - endif - - if ( is_prog_buildtemp )then - ! landunit type physical state variable - t_building - call restartvar(ncid=ncid, flag=flag, varname='t_building', xtype=ncd_double, & - dim1name='landunit', & - long_name='internal building air temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_building_lun) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find t_building in initial file..." - if (masterproc) write(iulog,*) "Initialize t_building to taf" - this%t_building_lun(bounds%begl:bounds%endl) = this%taf_lun(bounds%begl:bounds%endl) - end if - - ! landunit type physical state variable - t_roof_inner - call restartvar(ncid=ncid, flag=flag, varname='t_roof_inner', xtype=ncd_double, & - dim1name='landunit', & - long_name='roof inside surface temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_roof_inner_lun) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find t_roof_inner in initial file..." - if (masterproc) write(iulog,*) "Initialize t_roof_inner to taf" - this%t_roof_inner_lun(bounds%begl:bounds%endl) = this%taf_lun(bounds%begl:bounds%endl) - end if - - ! landunit type physical state variable - t_sunw_inner - call restartvar(ncid=ncid, flag=flag, varname='t_sunw_inner', xtype=ncd_double, & - dim1name='landunit', & - long_name='sunwall inside surface temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_sunw_inner_lun) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find t_sunw_inner in initial file..." - if (masterproc) write(iulog,*) "Initialize t_sunw_inner to taf" - this%t_sunw_inner_lun(bounds%begl:bounds%endl) = this%taf_lun(bounds%begl:bounds%endl) - end if - - ! landunit type physical state variable - t_shdw_inner - call restartvar(ncid=ncid, flag=flag, varname='t_shdw_inner', xtype=ncd_double, & - dim1name='landunit', & - long_name='shadewall inside surface temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_shdw_inner_lun) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find t_shdw_inner in initial file..." - if (masterproc) write(iulog,*) "Initialize t_shdw_inner to taf" - this%t_shdw_inner_lun(bounds%begl:bounds%endl) = this%taf_lun(bounds%begl:bounds%endl) - end if - - ! landunit type physical state variable - t_floor - call restartvar(ncid=ncid, flag=flag, varname='t_floor', xtype=ncd_double, & - dim1name='landunit', & - long_name='floor temperature', units='K', & - interpinic_flag='interp', readvar=readvar, data=this%t_floor_lun) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "can't find t_floor in initial file..." - if (masterproc) write(iulog,*) "Initialize t_floor to taf" - this%t_floor_lun(bounds%begl:bounds%endl) = this%taf_lun(bounds%begl:bounds%endl) - end if - end if - - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! Each interval and accumulation type is unique to each field processed. - ! Routine [initAccBuffer] defines the fields to be processed - ! and the type of accumulation. - ! Routine [updateAccVars] does the actual accumulation for a given field. - ! Fields are accumulated by calls to subroutine [update_accum_field]. - ! To accumulate a field, it must first be defined in subroutine [initAccVars] - ! and then accumulated by calls to [updateAccVars]. - ! Four types of accumulations are possible: - ! o average over time interval - ! o running mean over time interval - ! o running accumulation over time interval - ! Time average fields are only valid at the end of the averaging interval. - ! Running means are valid once the length of the simulation exceeds the - ! averaging interval. Accumulated fields are continuously accumulated. - ! The trigger value "-99999." resets the accumulation to zero. - ! - ! !USES - use accumulMod , only : init_accum_field - use clm_time_manager , only : get_step_size - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - real(r8) :: dtime - integer, parameter :: not_used = huge(1) - !--------------------------------------------------------------------- - - dtime = get_step_size() - - this%t_veg24_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='T_VEG24', units='K', & - desc='24hr average of vegetation temperature', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%t_veg240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='T_VEG240', units='K', & - desc='240hr average of vegetation temperature', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field(name='TREFAV', units='K', & - desc='average over an hour of 2-m temperature', accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field(name='TREFAV_U', units='K', & - desc='average over an hour of urban 2-m temperature', accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field(name='TREFAV_R', units='K', & - desc='average over an hour of rural 2-m temperature', accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! The following is a running mean. The accumulation period is set to -10 for a 10-day running mean. - call init_accum_field (name='T10', units='K', & - desc='10-day running mean of 2-m temperature', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1,init_value=SHR_CONST_TKFRZ+20._r8) - - if ( use_crop )then - call init_accum_field (name='TDM10', units='K', & - desc='10-day running mean of min 2-m temperature', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=SHR_CONST_TKFRZ) - - call init_accum_field (name='TDM5', units='K', & - desc='5-day running mean of min 2-m temperature', accum_type='runmean', accum_period=-5, & - subgrid_type='pft', numlev=1, init_value=SHR_CONST_TKFRZ) - end if - - if ( use_crop )then - - ! All GDD summations are relative to the planting date (Kucharik & Brye 2003) - call init_accum_field (name='GDD0', units='K', & - desc='growing degree-days base 0C from planting', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDD8', units='K', & - desc='growing degree-days base 8C from planting', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDD10', units='K', & - desc='growing degree-days base 10C from planting', accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end if - - if (use_cndv) then - ! 30-day average of 2m temperature. - call init_accum_field (name='TDA', units='K', & - desc='30-day average of 2-m temperature', accum_type='timeavg', accum_period=-30, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - end if - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES - use accumulMod , only : init_accum_field, extract_accum_field - use clm_time_manager , only : get_nstep - use clm_varctl , only : nsrest, nsrStartup - use abortutils , only : endrun - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: nstep - integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - ! Allocate needed dynamic memory for single level pft field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg="extract_accum_hist allocation error for rbufslp"//& - errMsg(sourcefile, __LINE__)) - endif - - ! Determine time step - nstep = get_nstep() - - call extract_accum_field ('T_VEG24', rbufslp, nstep) - this%t_veg24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('T_VEG240', rbufslp, nstep) - this%t_veg240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('T10', rbufslp, nstep) - this%t_a10_patch(begp:endp) = rbufslp(begp:endp) - - if (use_crop) then - call extract_accum_field ('TDM10', rbufslp, nstep) - this%t_a10min_patch(begp:endp)= rbufslp(begp:endp) - - call extract_accum_field ('TDM5', rbufslp, nstep) - this%t_a5min_patch(begp:endp) = rbufslp(begp:endp) - end if - - ! Initialize variables that are to be time accumulated - ! Initialize 2m ref temperature max and min values - - if (nsrest == nsrStartup) then - this%t_ref2m_max_patch(begp:endp) = spval - this%t_ref2m_max_r_patch(begp:endp) = spval - this%t_ref2m_max_u_patch(begp:endp) = spval - - this%t_ref2m_min_patch(begp:endp) = spval - this%t_ref2m_min_r_patch(begp:endp) = spval - this%t_ref2m_min_u_patch(begp:endp) = spval - - this%t_ref2m_max_inst_patch(begp:endp) = -spval - this%t_ref2m_max_inst_r_patch(begp:endp) = -spval - this%t_ref2m_max_inst_u_patch(begp:endp) = -spval - - this%t_ref2m_min_inst_patch(begp:endp) = spval - this%t_ref2m_min_inst_r_patch(begp:endp) = spval - this%t_ref2m_min_inst_u_patch(begp:endp) = spval - end if - - if ( use_crop ) then - - call extract_accum_field ('GDD0', rbufslp, nstep) - this%gdd0_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('GDD8', rbufslp, nstep) ; - this%gdd8_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('GDD10', rbufslp, nstep) - this%gdd10_patch(begp:endp) = rbufslp(begp:endp) - - end if - - deallocate(rbufslp) - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) - ! - ! USES - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - use clm_time_manager , only : get_step_size, get_nstep, is_end_curr_day, get_curr_date - use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal - ! - ! !ARGUMENTS: - class(temperature_type) :: this - type(bounds_type) , intent(in) :: bounds - - ! - ! !LOCAL VARIABLES: - integer :: m,g,l,c,p ! indices - integer :: ier ! error status - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: year ! year (0, ...) for nstep - integer :: month ! month (1, ..., 12) for nstep - integer :: day ! day of month (1, ..., 31) for nstep - integer :: secs ! seconds into current date for nstep - logical :: end_cd ! temporary for is_end_curr_day() value - integer :: begp, endp - real(r8), pointer :: rbufslp(:) ! temporary single level - pft level - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - - dtime = get_step_size() - nstep = get_nstep() - call get_curr_date (year, month, day, secs) - - ! Allocate needed dynamic memory for single level pft field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - ! Accumulate and extract T_VEG24 & T_VEG240 - do p = begp,endp - rbufslp(p) = this%t_veg_patch(p) - end do - call update_accum_field ('T_VEG24' , rbufslp , nstep) - call extract_accum_field ('T_VEG24' , this%t_veg24_patch , nstep) - call update_accum_field ('T_VEG240', rbufslp , nstep) - call extract_accum_field ('T_VEG240', this%t_veg240_patch , nstep) - - ! Accumulate and extract TREFAV - hourly average 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV', this%t_ref2m_patch, nstep) - call extract_accum_field ('TREFAV', rbufslp, nstep) - end_cd = is_end_curr_day() - do p = begp,endp - if (rbufslp(p) /= spval) then - this%t_ref2m_max_inst_patch(p) = max(rbufslp(p), this%t_ref2m_max_inst_patch(p)) - this%t_ref2m_min_inst_patch(p) = min(rbufslp(p), this%t_ref2m_min_inst_patch(p)) - endif - if (end_cd) then - this%t_ref2m_max_patch(p) = this%t_ref2m_max_inst_patch(p) - this%t_ref2m_min_patch(p) = this%t_ref2m_min_inst_patch(p) - this%t_ref2m_max_inst_patch(p) = -spval - this%t_ref2m_min_inst_patch(p) = spval - else if (secs == dtime) then - this%t_ref2m_max_patch(p) = spval - this%t_ref2m_min_patch(p) = spval - endif - end do - - ! Accumulate and extract TREFAV_U - hourly average urban 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV_U', this%t_ref2m_u_patch, nstep) - call extract_accum_field ('TREFAV_U', rbufslp, nstep) - do p = begp,endp - l = patch%landunit(p) - if (rbufslp(p) /= spval) then - this%t_ref2m_max_inst_u_patch(p) = max(rbufslp(p), this%t_ref2m_max_inst_u_patch(p)) - this%t_ref2m_min_inst_u_patch(p) = min(rbufslp(p), this%t_ref2m_min_inst_u_patch(p)) - endif - if (end_cd) then - if (lun%urbpoi(l)) then - this%t_ref2m_max_u_patch(p) = this%t_ref2m_max_inst_u_patch(p) - this%t_ref2m_min_u_patch(p) = this%t_ref2m_min_inst_u_patch(p) - this%t_ref2m_max_inst_u_patch(p) = -spval - this%t_ref2m_min_inst_u_patch(p) = spval - end if - else if (secs == dtime) then - this%t_ref2m_max_u_patch(p) = spval - this%t_ref2m_min_u_patch(p) = spval - endif - end do - - ! Accumulate and extract TREFAV_R - hourly average rural 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV_R', this%t_ref2m_r_patch, nstep) - call extract_accum_field ('TREFAV_R', rbufslp, nstep) - do p = begp,endp - l = patch%landunit(p) - if (rbufslp(p) /= spval) then - this%t_ref2m_max_inst_r_patch(p) = max(rbufslp(p), this%t_ref2m_max_inst_r_patch(p)) - this%t_ref2m_min_inst_r_patch(p) = min(rbufslp(p), this%t_ref2m_min_inst_r_patch(p)) - endif - if (end_cd) then - if (.not.(lun%ifspecial(l))) then - this%t_ref2m_max_r_patch(p) = this%t_ref2m_max_inst_r_patch(p) - this%t_ref2m_min_r_patch(p) = this%t_ref2m_min_inst_r_patch(p) - this%t_ref2m_max_inst_r_patch(p) = -spval - this%t_ref2m_min_inst_r_patch(p) = spval - end if - else if (secs == dtime) then - this%t_ref2m_max_r_patch(p) = spval - this%t_ref2m_min_r_patch(p) = spval - endif - end do - - ! Accumulate and extract T10 - !(acumulates TSA as 10-day running mean) - - call update_accum_field ('T10', this%t_ref2m_patch, nstep) - call extract_accum_field ('T10', this%t_a10_patch, nstep) - - if ( use_crop )then - ! Accumulate and extract TDM10 - - do p = begp,endp - rbufslp(p) = min(this%t_ref2m_min_patch(p),this%t_ref2m_min_inst_patch(p)) !slevis: ok choice? - if (rbufslp(p) > 1.e30_r8) rbufslp(p) = SHR_CONST_TKFRZ !and were 'min'& - end do !'min_inst' not initialized? - call update_accum_field ('TDM10', rbufslp, nstep) - call extract_accum_field ('TDM10', this%t_a10min_patch, nstep) - - ! Accumulate and extract TDM5 - - do p = begp,endp - rbufslp(p) = min(this%t_ref2m_min_patch(p),this%t_ref2m_min_inst_patch(p)) !slevis: ok choice? - if (rbufslp(p) > 1.e30_r8) rbufslp(p) = SHR_CONST_TKFRZ !and were 'min'& - end do !'min_inst' not initialized? - call update_accum_field ('TDM5', rbufslp, nstep) - call extract_accum_field ('TDM5', this%t_a5min_patch, nstep) - - ! Accumulate and extract GDD0 - - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(26._r8, this%t_ref2m_patch(p)-SHR_CONST_TKFRZ)) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD0', rbufslp, nstep) - call extract_accum_field ('GDD0', this%gdd0_patch, nstep) - - ! Accumulate and extract GDD8 - - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + 8._r8))) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD8', rbufslp, nstep) - call extract_accum_field ('GDD8', this%gdd8_patch, nstep) - - ! Accumulate and extract GDD10 - - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + 10._r8))) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD10', rbufslp, nstep) - call extract_accum_field ('GDD10', this%gdd10_patch, nstep) - - end if - - deallocate(rbufslp) - - end subroutine UpdateAccVars - -end module TemperatureType diff --git a/src/biogeophys/TotalWaterAndHeatMod.F90 b/src/biogeophys/TotalWaterAndHeatMod.F90 deleted file mode 100644 index 7b9153a029..0000000000 --- a/src/biogeophys/TotalWaterAndHeatMod.F90 +++ /dev/null @@ -1,909 +0,0 @@ -module TotalWaterAndHeatMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Routines for computing total column water and heat contents - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varcon , only : cpice, cpliq, denh2o, tfrz, hfus, aquifer_water_baseline - use clm_varpar , only : nlevgrnd, nlevsoi, nlevurb - use ColumnType , only : col - use LandunitType , only : lun - use subgridAveMod , only : p2c - use SoilHydrologyType , only : soilhydrology_type - use WaterstateType , only : waterstate_type - use UrbanParamsType , only : urbanparams_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv, icol_road_imperv - use landunit_varcon , only : istdlak, istsoil,istcrop,istwet,istice_mec - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - - ! For water (ComputeWaterMass* / ComputeLiqIceMass*): We have separate routines for lake - ! vs. non-lake because parts of the code call just one or the other. - ! - ! For heat (ComputeHeat*): We use separate routines for lake vs. non-lake to keep these - ! routines parallel with the water routines. - public :: ComputeWaterMassNonLake ! Compute total water mass of non-lake columns - public :: ComputeWaterMassLake ! Compute total water mass of lake columns - public :: ComputeLiqIceMassNonLake ! Compute total water mass of non-lake columns, separated into liquid and ice - public :: ComputeLiqIceMassLake ! Compute total water mass of lake columns, separated into liquid and ice - public :: ComputeHeatNonLake ! Compute heat content of non-lake columns - public :: ComputeHeatLake ! Compute heat content of lake columns - public :: AdjustDeltaHeatForDeltaLiq ! Adjusts the change in gridcell heat content due to land cover change to account for the implicit heat flux associated with delta_liq - public :: LiquidWaterHeat ! Get the total heat content of some mass of liquid water at a given temperature - - ! - ! !PUBLIC MEMBER DATA: - - ! While some parts of the code work just fine with any heat_base_temp, other parts - ! currently wouldn't work right if we changed this value. This is all related to the - ! fact that we don't currently track temperature explicitly for all components of the - ! system. Specifically: - ! - ! (1) For liquid water pools that don't have an explicit temperature, we assume a - ! temperature of heat_base_temp. This is not a terrible assumption for - ! heat_base_temp = tfrz, but would be a terrible assumption for (e.g.) - ! heat_base_temp = 0. - ! - ! (2) In AdjustDeltaHeatForDeltaLiq, we currently don't account for the energy - ! associated with delta_ice (as we do for delta_liq). This amounts to implicitly - ! assuming that this ice runoff is at heat_base_temp (this is tied in with the fact - ! that we don't explicitly track the temperature of runoff). This makes sense for - ! heat_base_temp = tfrz, but wouldn't make sense for other values of heat_base_temp. - real(r8), parameter, public :: heat_base_temp = tfrz ! Base temperature for heat sums [K] - - ! ------------------------------------------------------------------------ - ! The following are public just to support unit testing; they shouldn't be used by other code - ! ------------------------------------------------------------------------ - - ! Minimum and maximum temperatures for the water temperature used by AdjustDeltaHeatForDeltaLiq - real(r8), parameter :: DeltaLiqMinTemp = tfrz ! [K] - real(r8), parameter :: DeltaLiqMaxTemp = tfrz + 35._r8 ! [K] - - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: AccumulateLiquidWaterHeat ! For use by ComputeHeat* routines: accumulate quantities that we need to count for liquid water, for a single column - private :: TempToHeat ! For use by ComputeHeat* routines: convert temperature to heat content - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine ComputeWaterMassNonLake(bounds, num_nolakec, filter_nolakec, & - soilhydrology_inst, waterstate_inst, water_mass) - ! - ! !DESCRIPTION: - ! Compute total water mass for all non-lake columns - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(inout) :: water_mass( bounds%begc: ) ! computed water mass (kg m-2) - ! - ! !LOCAL VARIABLES: - real(r8) :: liquid_mass(bounds%begc:bounds%endc) ! kg m-2 - real(r8) :: ice_mass(bounds%begc:bounds%endc) ! kg m-2 - integer :: fc, c - - character(len=*), parameter :: subname = 'ComputeWaterMassNonLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(water_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - call ComputeLiqIceMassNonLake( & - bounds = bounds, & - num_nolakec = num_nolakec, & - filter_nolakec = filter_nolakec, & - soilhydrology_inst = soilhydrology_inst, & - waterstate_inst = waterstate_inst, & - liquid_mass = liquid_mass(bounds%begc:bounds%endc), & - ice_mass = ice_mass(bounds%begc:bounds%endc)) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - water_mass(c) = liquid_mass(c) + ice_mass(c) - end do - - end subroutine ComputeWaterMassNonLake - - !----------------------------------------------------------------------- - subroutine ComputeWaterMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, water_mass) - ! - ! !DESCRIPTION: - ! Compute total water mass for all lake columns - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(inout) :: water_mass( bounds%begc: ) ! computed water mass (kg m-2) - ! - ! !LOCAL VARIABLES: - real(r8) :: liquid_mass(bounds%begc:bounds%endc) ! kg m-2 - real(r8) :: ice_mass(bounds%begc:bounds%endc) ! kg m-2 - integer :: fc, c - - character(len=*), parameter :: subname = 'ComputeWaterMassLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(water_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - call ComputeLiqIceMassLake( & - bounds = bounds, & - num_lakec = num_lakec, & - filter_lakec = filter_lakec, & - waterstate_inst = waterstate_inst, & - liquid_mass = liquid_mass(bounds%begc:bounds%endc), & - ice_mass = ice_mass(bounds%begc:bounds%endc)) - - do fc = 1, num_lakec - c = filter_lakec(fc) - water_mass(c) = liquid_mass(c) + ice_mass(c) - end do - - end subroutine ComputeWaterMassLake - - - !----------------------------------------------------------------------- - subroutine ComputeLiqIceMassNonLake(bounds, num_nolakec, filter_nolakec, & - soilhydrology_inst, waterstate_inst, liquid_mass, ice_mass) - ! - ! !DESCRIPTION: - ! Compute total water mass for all non-lake columns, separated into liquid and ice - ! - ! Note: Changes to this routine should generally be accompanied by similar changes - ! to ComputeHeatNonLake - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! computed liquid water mass (kg m-2) - real(r8) , intent(inout) :: ice_mass( bounds%begc: ) ! computed ice mass (kg m-2) - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc ! indices - logical :: has_h2o ! whether this point potentially has water to add - real(r8) :: h2ocan_col(bounds%begc:bounds%endc) ! canopy water (mm H2O) - real(r8) :: snocan_col(bounds%begc:bounds%endc) ! canopy snow water (mm H2O) - real(r8) :: liqcan ! canopy liquid water (mm H2O) - - character(len=*), parameter :: subname = 'ComputeLiqIceMassNonLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(liquid_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ice_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl , & ! Input: [integer (:) ] negative number of snow layers - - h2osfc => waterstate_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2ocan_patch => waterstate_inst%h2ocan_patch , & ! Input: [real(r8) (:) ] canopy water (mm H2O) - snocan_patch => waterstate_inst%snocan_patch , & ! Input: [real(r8) (:) ] canopy snow water (mm H2O) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - total_plant_stored_h2o => waterstate_inst%total_plant_stored_h2o_col, & - ! Input: [real(r8) (:,:) ] plant internal stored water (mm H2O) - wa => soilhydrology_inst%wa_col & ! Input: [real(r8) (:) ] water in the unconfined aquifer (mm) - ) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - liquid_mass(c) = 0._r8 - ice_mass(c) = 0._r8 - end do - - call p2c(bounds, num_nolakec, filter_nolakec, & - h2ocan_patch(bounds%begp:bounds%endp), & - h2ocan_col(bounds%begc:bounds%endc)) - - call p2c(bounds, num_nolakec, filter_nolakec, & - snocan_patch(bounds%begp:bounds%endp), & - snocan_col(bounds%begc:bounds%endc)) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - - ! waterstate_inst%snocan_patch and waterstate_inst%liqcan_patch are only set if - ! we're using snow-on-veg; otherwise they are 0. However, we can rely on - ! h2ocan_patch being set in all cases, so we can always determine the liquid mass - ! as (h2ocan - snocan). - ! Note the difference between liqcan and total_plant_stored_h2o. The prior - ! is that which exists on the vegetation canopy surface, the latter is - ! that which exists within the plant xylems and tissues. In cases - ! where FATES hydraulics is not turned on, this total_plant_stored_h2o is - ! non-changing, and is set to 0 for a trivial solution. - - liqcan = h2ocan_col(c) - snocan_col(c) - liquid_mass(c) = liquid_mass(c) + liqcan + total_plant_stored_h2o(c) - ice_mass(c) = ice_mass(c) + snocan_col(c) - - if (snl(c) < 0) then - ! Loop over snow layers - do j = snl(c)+1,0 - liquid_mass(c) = liquid_mass(c) + h2osoi_liq(c,j) - ice_mass(c) = ice_mass(c) + h2osoi_ice(c,j) - end do - else if (h2osno(c) /= 0._r8) then - ! No explicit snow layers, but there may still be some ice in h2osno (there is - ! no liquid water in this case) - ice_mass(c) = ice_mass(c) + h2osno(c) - end if - - if (col%hydrologically_active(c)) then - ! It's important to exclude non-hydrologically-active points, because some of - ! them have wa set, but seemingly incorrectly (set to 4000). - - ! NOTE(wjs, 2017-03-23) We subtract aquifer_water_baseline because water in the - ! unconfined aquifer is in some senses a virtual water pool. For CLM45 physics, - ! it isn't clear to me if this subtraction is the "right" thing to do (it can - ! lead to a net negative value, though that's probably okay). But we definitely - ! want to do it for CLM5 physics: there, wa stays fixed at 5000 for - ! hydrologically-active columns, yet this apparently doesn't interact with the - ! system, so we don't want to count that water mass in the total column water. - liquid_mass(c) = liquid_mass(c) + (wa(c) - aquifer_water_baseline) - end if - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_sunwall & - .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_road_imperv) then - ! Nothing more to add in this case - else - liquid_mass(c) = liquid_mass(c) + h2osfc(c) - end if - end do - - ! Soil water content - do j = 1, nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if (col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall) then - has_h2o = .false. - else if (col%itype(c) == icol_roof) then - if (j <= nlevurb) then - has_h2o = .true. - else - has_h2o = .false. - end if - else - has_h2o = .true. - end if - - if (has_h2o) then - liquid_mass(c) = liquid_mass(c) + h2osoi_liq(c,j) - ice_mass(c) = ice_mass(c) + h2osoi_ice(c,j) - end if - end do - end do - - end associate - - end subroutine ComputeLiqIceMassNonLake - - !----------------------------------------------------------------------- - subroutine ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, liquid_mass, ice_mass) - ! - ! !DESCRIPTION: - ! Compute total water mass for all lake columns, separated into liquid and ice - ! - ! Note: Changes to this routine should generally be accompanied by similar changes - ! to ComputeHeatLake - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec ! number of column lake points in column filter - integer , intent(in) :: filter_lakec(:) ! column filter for lake points - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(inout) :: liquid_mass( bounds%begc: ) ! computed liquid water mass (kg m-2) - real(r8) , intent(inout) :: ice_mass( bounds%begc: ) ! computed ice mass (kg m-2) - ! - ! !LOCAL VARIABLES: - integer :: c, j, fc ! indices - - character(len=*), parameter :: subname = 'ComputeLiqIceMassLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(liquid_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ice_mass) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl , & ! Input: [integer (:) ] negative number of snow layers - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - ) - - do fc = 1, num_lakec - c = filter_lakec(fc) - liquid_mass(c) = 0._r8 - ice_mass(c) = 0._r8 - end do - - ! Snow water content - do fc = 1, num_lakec - c = filter_lakec(fc) - if (snl(c) < 0) then - ! Loop over snow layers - do j = snl(c)+1,0 - liquid_mass(c) = liquid_mass(c) + h2osoi_liq(c,j) - ice_mass(c) = ice_mass(c) + h2osoi_ice(c,j) - end do - else if (h2osno(c) /= 0._r8) then - ! No explicit snow layers, but there may still be some ice in h2osno (there is - ! no liquid water in this case) - ice_mass(c) = ice_mass(c) + h2osno(c) - end if - end do - - ! Soil water content of the soil under the lake - do j = 1, nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - liquid_mass(c) = liquid_mass(c) + h2osoi_liq(c,j) - ice_mass(c) = ice_mass(c) + h2osoi_ice(c,j) - end do - end do - - end associate - - end subroutine ComputeLiqIceMassLake - - !----------------------------------------------------------------------- - subroutine ComputeHeatNonLake(bounds, num_nolakec, filter_nolakec, & - urbanparams_inst, soilstate_inst, & - temperature_inst, waterstate_inst, soilhydrology_inst, & - heat, heat_liquid, cv_liquid) - ! - ! !DESCRIPTION: - ! Compute total heat content for all non-lake columns. - ! - ! Optionally, also return the total heat content just of liquid water for each column - ! (excluding latent heat), and/or the total heat capacity just of liquid water for - ! each column. Together, these can be used by the caller to compute the weighted - ! average liquid water temperature (with weightings done by the water mass). - ! - ! Note: Changes to this routine - for anything involving liquid or ice - should - ! generally be accompanied by similar changes to ComputeLiqIceMassNonLake - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - - real(r8) , intent(inout) :: heat( bounds%begc: ) ! sum of heat content for all columns [J/m^2] - real(r8) , intent(inout) :: heat_liquid( bounds%begc: ) ! sum of heat content for all columns: liquid water, excluding latent heat [J/m^2] - real(r8) , intent(inout) :: cv_liquid( bounds%begc: ) ! sum of liquid heat capacity for all columns [J/(m^2 K)] - ! - ! !LOCAL VARIABLES: - integer :: fc - integer :: l,c,j - - logical :: has_h2o ! whether this point potentially has water to add - - real(r8) :: h2ocan_col(bounds%begc:bounds%endc) ! canopy water (mm H2O) - real(r8) :: snocan_col(bounds%begc:bounds%endc) ! canopy snow water (mm H2O) - real(r8) :: liqcan ! canopy liquid water (mm H2O) - - real(r8) :: heat_dry_mass(bounds%begc:bounds%endc) ! sum of heat content: dry mass [J/m^2] - real(r8) :: heat_ice(bounds%begc:bounds%endc) ! sum of heat content: ice [J/m^2] - real(r8) :: latent_heat_liquid(bounds%begc:bounds%endc) ! sum of latent heat content of liquid water [J/m^2] - - character(len=*), parameter :: subname = 'ComputeHeatNonLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(heat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(heat_liquid) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cv_liquid) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl, & ! number of snow layers - dz => col%dz, & ! layer depth (m) - nlev_improad => urbanparams_inst%nlev_improad, & ! number of impervious road layers - cv_wall => urbanparams_inst%cv_wall, & ! heat capacity of urban wall (J/m^3/K) - cv_roof => urbanparams_inst%cv_roof, & ! heat capacity of urban roof (J/m^3/K) - cv_improad => urbanparams_inst%cv_improad, & ! heat capacity of urban impervious road (J/m^3/K) - watsat => soilstate_inst%watsat_col, & ! volumetric soil water at saturation (porosity) - csol => soilstate_inst%csol_col, & ! heat capacity, soil solids (J/m**3/Kelvin) - t_soisno => temperature_inst%t_soisno_col, & ! soil temperature (Kelvin) - t_h2osfc => temperature_inst%t_h2osfc_col, & ! surface water temperature (Kelvin) - h2osoi_liq => waterstate_inst%h2osoi_liq_col, & ! liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col, & ! frozen water (kg/m2) - h2osno => waterstate_inst%h2osno_col, & ! snow water (mm H2O) - h2osfc => waterstate_inst%h2osfc_col, & ! surface water (mm H2O) - h2ocan_patch => waterstate_inst%h2ocan_patch, & ! canopy water (mm H2O) - snocan_patch => waterstate_inst%snocan_patch, & ! canopy snow water (mm H2O) - total_plant_stored_h2o_col => waterstate_inst%total_plant_stored_h2o_col, & ! Input: [real(r8) (:) ] water mass in plant tissues (kg m-2) - wa => soilhydrology_inst%wa_col & ! water in the unconfined aquifer (mm) - ) - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - - heat_liquid(c) = 0._r8 - cv_liquid(c) = 0._r8 - heat_dry_mass(c) = 0._r8 - heat_ice(c) = 0._r8 - latent_heat_liquid(c) = 0._r8 - end do - - call p2c(bounds, & - parr = h2ocan_patch(bounds%begp:bounds%endp), & - carr = h2ocan_col(bounds%begc:bounds%endc), & - p2c_scale_type = 'unity') - - call p2c(bounds, & - parr = snocan_patch(bounds%begp:bounds%endp), & - carr = snocan_col(bounds%begc:bounds%endc), & - p2c_scale_type = 'unity') - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - - !--- canopy water --- - ! - ! TODO(wjs, 2017-03-11) Canopy water currently doesn't have an explicit - ! temperature; thus, we only add its latent heat of fusion. Eventually, we should - ! probably track its temperature explicitly - or at least give it an implicit - ! temperature for the sake of these energy calculations (I think that's needed for - ! full conservation). - ! - ! However, we still call the standard AccumulateLiquidWaterHeat routine, so that we - ! average in a heat_base_temp value in heat_liquid. I think this will generally - ! lead to less of a sensible heat flux adjustment needed by the dynbal energy - ! conservation code. (But I went back and forth on whether to do this, so could - ! be convinced otherwise.) - - ! snocan and liqcan are only set if we're using snow-on-veg; otherwise they are 0. - ! However, we can rely on h2ocan being set in all cases, so we can always - ! determine the liquid mass as (h2ocan - snocan). - - ! Note (rgk 04-2017): added total_plant_stored_h2o_col(c), which is the - ! water inside the plant, which is zero for all non-dynamic models. FATES hydraulics - ! is the only one with dynamic storage atm. - ! Commentary (rgk 04-2017): water has moved from the soil to the plant tissues, - ! and the two pools have different temperatures associated with them. However, - ! we are not accounting for or conserving the flux of energy between the two - ! pools. The energy in the plant water should "bring with it" the internal - ! energy of the soil-to-root water flux. - - liqcan = h2ocan_col(c) - snocan_col(c) + total_plant_stored_h2o_col(c) - call AccumulateLiquidWaterHeat( & - temp = heat_base_temp, & - h2o = liqcan, & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - - !--- snow --- - if ( snl(c) < 0 ) then - ! Loop over snow layers - do j = snl(c)+1,0 - call AccumulateLiquidWaterHeat( & - temp = t_soisno(c,j), & - h2o = h2osoi_liq(c,j), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - heat_ice(c) = heat_ice(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (h2osoi_ice(c,j)*cpice)) - end do - else if (h2osno(c) /= 0._r8) then - ! No explicit snow layers, but there may still be some ice in h2osno (there is - ! no liquid water in this case) - j = 1 - heat_ice(c) = heat_ice(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (h2osno(c)*cpice)) - end if - - if (col%hydrologically_active(c)) then - ! NOTE(wjs, 2017-03-23) Water in the unconfined aquifer currently doesn't have - ! an explicit temperature; thus, we only add its latent heat of - ! fusion. However, we still call the standard AccumulateLiquidWaterHeat routine, so - ! that we average in a heat_base_temp value in heat_liquid. I think this will - ! generally lead to less of a sensible heat flux adjustment needed by the - ! dynbal energy conservation code. (But I went back and forth on whether to do - ! this, so could be convinced otherwise.) In the default CLM5 configuration, - ! this should all be irrelevant, because (wa(c) - aquifer_water_baseline) - ! should be fixed at 0 for all hydrologically-active points. - - call AccumulateLiquidWaterHeat( & - temp = heat_base_temp, & - h2o = (wa(c) - aquifer_water_baseline), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - end if - - if (col%itype(c) == icol_roof .or. col%itype(c) == icol_sunwall & - .or. col%itype(c) == icol_shadewall .or. col%itype(c) == icol_road_imperv) then - ! Nothing more to add in this case - else - !--- surface water --- - call AccumulateLiquidWaterHeat( & - temp = t_h2osfc(c), & - h2o = h2osfc(c), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - end if - - end do - - - !--- below ground (soil & soil water) and related urban columns - do j = 1, nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - l = col%landunit(c) - - if (col%itype(c)==icol_sunwall .or. col%itype(c)==icol_shadewall) then - has_h2o = .false. - if (j <= nlevurb) then - heat_dry_mass(c) = heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (cv_wall(l,j) * dz(c,j))) - end if - - else if (col%itype(c) == icol_roof) then - if (j <= nlevurb) then - has_h2o = .true. - heat_dry_mass(c) = heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (cv_roof(l,j) * dz(c,j))) - else - has_h2o = .false. - end if - - else - has_h2o = .true. - - if (col%itype(c) == icol_road_imperv .and. j <= nlev_improad(l)) then - heat_dry_mass(c) = heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (cv_improad(l,j) * dz(c,j))) - else if (lun%itype(l) /= istwet .and. lun%itype(l) /= istice_mec) then - ! Note that this also includes impervious roads below nlev_improad (where - ! we have soil) - heat_dry_mass(c) = heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (csol(c,j)*(1-watsat(c,j))*dz(c,j))) - end if - end if - - if (has_h2o) then - call AccumulateLiquidWaterHeat( & - temp = t_soisno(c,j), & - h2o = h2osoi_liq(c,j), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - heat_ice(c) = heat_ice(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (h2osoi_ice(c,j)*cpice)) - end if - end do - end do - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - heat(c) = heat_dry_mass(c) + heat_ice(c) + heat_liquid(c) + latent_heat_liquid(c) - end do - - end associate - - end subroutine ComputeHeatNonLake - - !----------------------------------------------------------------------- - subroutine ComputeHeatLake(bounds, num_lakec, filter_lakec, & - soilstate_inst, temperature_inst, waterstate_inst, & - heat, heat_liquid, cv_liquid) - ! - ! !DESCRIPTION: - ! Compute total heat content for all lake columns - ! - ! Optionally, also return the total heat content just of liquid water for each column - ! (excluding latent heat), and/or the total heat capacity just of liquid water for - ! each column. Together, these can be used by the caller to compute the weighted - ! average liquid water temperature (with weightings done by the water mass). - ! - ! Note: Changes to this routine - for anything involving liquid or ice - should - ! generally be accompanied by similar changes to ComputeLiqIceMassLake - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_lakec - integer , intent(in) :: filter_lakec(:) - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - - real(r8) , intent(inout) :: heat( bounds%begc: ) ! sum of heat content for all columns [J/m^2] - real(r8) , intent(inout) :: heat_liquid( bounds%begc: ) ! sum of heat content for all columns: liquid water, excluding latent heat [J/m^2] - real(r8) , intent(inout) :: cv_liquid( bounds%begc: ) ! sum of liquid heat capacity for all columns [J/(m^2 K)] - ! - ! !LOCAL VARIABLES: - integer :: fc - integer :: c,j - - real(r8) :: heat_dry_mass(bounds%begc:bounds%endc) ! sum of heat content: dry mass [J/m^2] - real(r8) :: heat_ice(bounds%begc:bounds%endc) ! sum of heat content: ice [J/m^2] - real(r8) :: latent_heat_liquid(bounds%begc:bounds%endc) ! sum of latent heat content of liquid water [J/m^2] - - character(len=*), parameter :: subname = 'ComputeHeatLake' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(heat) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(heat_liquid) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(cv_liquid) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate( & - snl => col%snl, & ! number of snow layers - dz => col%dz, & ! layer depth (m) - watsat => soilstate_inst%watsat_col, & ! volumetric soil water at saturation (porosity) - csol => soilstate_inst%csol_col, & ! heat capacity, soil solids (J/m**3/Kelvin) - t_soisno => temperature_inst%t_soisno_col, & ! soil temperature (Kelvin) - h2osoi_liq => waterstate_inst%h2osoi_liq_col, & ! liquid water (kg/m2) - h2osoi_ice => waterstate_inst%h2osoi_ice_col, & ! frozen water (kg/m2) - h2osno => waterstate_inst%h2osno_col & ! snow water (mm H2O) - ) - - do fc = 1, num_lakec - c = filter_lakec(fc) - - heat_liquid(c) = 0._r8 - cv_liquid(c) = 0._r8 - heat_dry_mass(c) = 0._r8 - heat_ice(c) = 0._r8 - latent_heat_liquid(c) = 0._r8 - end do - - ! Snow heat content - do fc = 1, num_lakec - c = filter_lakec(fc) - if ( snl(c) < 0 ) then - ! Loop over snow layers - do j = snl(c)+1,0 - call AccumulateLiquidWaterHeat( & - temp = t_soisno(c,j), & - h2o = h2osoi_liq(c,j), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - heat_ice(c) = heat_ice(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (h2osoi_ice(c,j)*cpice)) - end do - else if (h2osno(c) /= 0._r8) then - ! TODO(wjs, 2017-03-16) (Copying this note from old code... I'm not positive - ! it's still true.) The heat capacity (not latent heat) of snow without snow - ! layers is currently ignored in LakeTemperature, so it should be ignored here. - ! Eventually we should consider this. - end if - end do - - ! Soil water content of the soil under the lake - do j = 1,nlevgrnd - do fc = 1, num_lakec - c = filter_lakec(fc) - - heat_dry_mass(c) = heat_dry_mass(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (csol(c,j)*(1-watsat(c,j))*dz(c,j))) - call AccumulateLiquidWaterHeat( & - temp = t_soisno(c,j), & - h2o = h2osoi_liq(c,j), & - cv_liquid = cv_liquid(c), & - heat_liquid = heat_liquid(c), & - latent_heat_liquid = latent_heat_liquid(c)) - heat_ice(c) = heat_ice(c) + & - TempToHeat(temp = t_soisno(c,j), cv = (h2osoi_ice(c,j)*cpice)) - end do - end do - - ! TODO(wjs, 2017-03-11) Include heat content of water in lakes, once we include - ! lake water as an explicit water state (https://github.com/NCAR/CLM/issues/2) - - do fc = 1, num_lakec - c = filter_lakec(fc) - heat(c) = heat_dry_mass(c) + heat_ice(c) + heat_liquid(c) + latent_heat_liquid(c) - end do - - end associate - - end subroutine ComputeHeatLake - - !----------------------------------------------------------------------- - subroutine AdjustDeltaHeatForDeltaLiq(bounds, delta_liq, & - liquid_water_temp1, liquid_water_temp2, & - delta_heat) - ! - ! !DESCRIPTION: - ! Adjusts delta_heat (the change in gridcell heat content due to land cover change - ! that needs to be accounted for via a heat flux) to account for the implicit heat - ! flux associated with delta_liq. - ! - ! Note that, throughout CLM, we don't explicitly track the temperature or heat content - ! of runoff. Furthermore, we currently cannot compute the exact heat content of - ! delta_liq (the dynamic landcover adjustment), because we aren't summing the liquid - ! water heat content on a pool-by-pool (and layer-by-layer) basis, but rather on a - ! bulk basis across each column. Thus, the formulation in this routine is currently - ! using a rough approximation of the temperature of delta_liq - assuming it is at the - ! average temperature of the liquid water in the grid cell. This can be a poor - ! assumption in some cases (e.g., if the grid cell is 90% glacier, 5% natural veg and - ! 5% crop, and the only transitions are between natural veg and crop - then the - ! glacier's liquid water temperature factors into the average liquid water - ! temperature, even though it doesn't contribute at all to delta_liq). - ! - ! Also note that we don't account for delta_ice here. This implicitly assumes that - ! ice runoff is at heat_base_temp (which is reasonable as long as heat_base_temp = - ! tfrz). - ! - ! Eventually, if we begin to explicitly account for the temperature / heat content of - ! liquid and ice runoff in CLM, then this routine should be reworked to use the true - ! heat contents of both liquid and ice runoff. - ! - ! Sign convention: delta_liq and delta_heat are positive if the post-landcover change - ! value is greater than the pre-landcover change value. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: delta_liq( bounds%begg: ) ! change in gridcell h2o liq content [kg/m^2] - real(r8), intent(in) :: liquid_water_temp1( bounds%begg: ) ! average liquid water temperature before land cover change [K] - real(r8), intent(in) :: liquid_water_temp2( bounds%begg: ) ! average liquid water temperature after land cover change [K] - real(r8), intent(inout) :: delta_heat( bounds%begg: ) ! change in gridcell heat content [J/m^2] - ! - ! !LOCAL VARIABLES: - integer :: g - real(r8) :: water_temperature ! [K] - real(r8) :: total_liquid_heat ! [J/m^2] - real(r8) :: heat_liquid ! [J/m^2] - real(r8) :: latent_heat_liquid ! [J/m^2] - real(r8) :: cv ! heat capacity [J/(m^2 K)] - - character(len=*), parameter :: subname = 'AdjustDeltaHeatForDeltaLiq' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(delta_liq) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(liquid_water_temp1) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(liquid_water_temp2) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(delta_heat) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - do g = bounds%begg, bounds%endg - if (delta_liq(g) /= 0._r8) then - if (delta_liq(g) < 0._r8) then - ! There was more water in the initial state than in the final state. We'll - ! generate a positive runoff. We assume that the runoff has a temperature equal - ! to the average temperature of liquid water in the initial state. - water_temperature = liquid_water_temp1(g) - else - ! There is more water in the final state than in the initial state. We'll - ! generate a negative runoff. We assume that we're sucking water out of the - ! ocean at a temperature equal to the average temperature of liquid water in - ! the final state. - water_temperature = liquid_water_temp2(g) - end if - - ! Since we're not trying to completely conserve energy here, it's better to - ! ensure that the estimated water temperature is in some reasonable bounds. - ! This protects against getting bad temperatures as a result of something like - ! catastrophic cancellation, or the weirdness that can arise from having - ! negative water volumes included in the averages. - water_temperature = max(water_temperature, DeltaLiqMinTemp) - water_temperature = min(water_temperature, DeltaLiqMaxTemp) - - total_liquid_heat = LiquidWaterHeat( & - temp = water_temperature, & - h2o = delta_liq(g)) - - ! For delta_liq < 0 (liq2 < liq1): We'll generate a positive runoff; we want to - ! effectively include some positive heat from that positive runoff in the heat2 - ! state, which means adding a positive term to delta_heat. Since the above heat - ! quantities will be negative, we need to subtract them. The reverse is true - ! for delta_liq > 0; again, we need to subtract the heat quantities. - delta_heat(g) = delta_heat(g) - total_liquid_heat - - end if - end do - - end subroutine AdjustDeltaHeatForDeltaLiq - - !----------------------------------------------------------------------- - function LiquidWaterHeat(temp, h2o) result(heat) - ! - ! !DESCRIPTION: - ! Get the total heat content (including latent heat) of some mass of liquid water at - ! a given temperature, using a base temperature of heat_base_temp. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8) :: heat ! function result - real(r8), intent(in) :: temp ! temperature [K] - real(r8), intent(in) :: h2o ! water mass [kg/m^2] - ! - ! !LOCAL VARIABLES: - real(r8) :: heat_liquid ! heat content of liquid water, excluding latent heat [J/m^2] - real(r8) :: latent_heat_liquid ! latent heat content of liquid water [J/m^2] - - character(len=*), parameter :: subname = 'LiquidWaterHeat' - !----------------------------------------------------------------------- - - heat_liquid = 0._r8 - latent_heat_liquid = 0._r8 - call AccumulateLiquidWaterHeat(temp = temp, h2o = h2o, & - heat_liquid = heat_liquid, latent_heat_liquid = latent_heat_liquid) - - heat = heat_liquid + latent_heat_liquid - - end function LiquidWaterHeat - - - !----------------------------------------------------------------------- - subroutine AccumulateLiquidWaterHeat(temp, h2o, & - heat_liquid, latent_heat_liquid, cv_liquid) - ! - ! !DESCRIPTION: - ! In the course of accumulating heat contents: Accumulate quantities that we need to - ! count for liquid water, for a single column - ! - ! !ARGUMENTS: - real(r8), intent(in) :: temp ! temperature [K] - real(r8), intent(in) :: h2o ! water mass [kg/m^2] - - real(r8), intent(inout) :: heat_liquid ! accumulated total heat content of liquid water for this column, excluding latent heat [J/m^2] - real(r8), intent(inout) :: latent_heat_liquid ! accumulated total latent heat content of liquid water for this column [J/m^2] - real(r8), intent(inout), optional :: cv_liquid ! accumulated total liquid heat capacity for this column [J/(m^2 K)] - ! - ! !LOCAL VARIABLES: - real(r8) :: cv ! heat capacity [J/(m^2 K)] - - character(len=*), parameter :: subname = 'AccumulateLiquidWaterHeat' - !----------------------------------------------------------------------- - - cv = h2o*cpliq - if (present(cv_liquid)) then - cv_liquid = cv_liquid + cv - end if - heat_liquid = heat_liquid + TempToHeat(temp = temp, cv = cv) - latent_heat_liquid = latent_heat_liquid + h2o*hfus - end subroutine AccumulateLiquidWaterHeat - - !----------------------------------------------------------------------- - pure function TempToHeat(temp, cv) result(heat) - ! - ! !DESCRIPTION: - ! Convert temperature to heat content - ! - ! !ARGUMENTS: - real(r8) :: heat ! function result: heat in J/m^2 - real(r8), intent(in) :: temp ! temperature [K] - real(r8), intent(in) :: cv ! heat capacity [J/(m^2 K)] - !----------------------------------------------------------------------- - - heat = cv*(temp - heat_base_temp) - - end function TempToHeat - -end module TotalWaterAndHeatMod diff --git a/src/biogeophys/TridiagonalMod.F90 b/src/biogeophys/TridiagonalMod.F90 deleted file mode 100644 index 68dbd71cce..0000000000 --- a/src/biogeophys/TridiagonalMod.F90 +++ /dev/null @@ -1,118 +0,0 @@ -module TridiagonalMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Tridiagonal matrix solution - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: Tridiagonal - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Tridiagonal (bounds, lbj, ubj, jtop, numf, filter, a, b, c, r, u) - ! - ! !DESCRIPTION: - ! Tridiagonal matrix solution - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevurb - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varctl , only : iulog - use decompMod , only : bounds_type - use ColumnType , only : col - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: jtop( bounds%begc: ) ! top level for each column [col] - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(:) ! filter - real(r8), intent(in) :: a( bounds%begc: , lbj: ) ! "a" left off diagonal of tridiagonal matrix [col, j] - real(r8), intent(in) :: b( bounds%begc: , lbj: ) ! "b" diagonal column for tridiagonal matrix [col, j] - real(r8), intent(in) :: c( bounds%begc: , lbj: ) ! "c" right off diagonal tridiagonal matrix [col, j] - real(r8), intent(in) :: r( bounds%begc: , lbj: ) ! "r" forcing term of tridiagonal matrix [col, j] - real(r8), intent(inout) :: u( bounds%begc: , lbj: ) ! solution [col, j] - ! - integer :: j,ci,fc !indices - real(r8) :: gam(bounds%begc:bounds%endc,lbj:ubj) !temporary - real(r8) :: bet(bounds%begc:bounds%endc) !temporary - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(jtop) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(a) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(b) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(r) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(u) == (/bounds%endc, ubj/)), errMsg(sourcefile, __LINE__)) - - ! Solve the matrix - - do fc = 1,numf - ci = filter(fc) - bet(ci) = b(ci,jtop(ci)) - end do - - do j = lbj, ubj - do fc = 1,numf - ci = filter(fc) - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb) then - if (j >= jtop(ci)) then - if (j == jtop(ci)) then - u(ci,j) = r(ci,j) / bet(ci) - else - gam(ci,j) = c(ci,j-1) / bet(ci) - bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) - u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) - end if - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop(ci)) then - if (j == jtop(ci)) then - u(ci,j) = r(ci,j) / bet(ci) - else - gam(ci,j) = c(ci,j-1) / bet(ci) - bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) - u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) - end if - end if - end if - end do - end do - - do j = ubj-1,lbj,-1 - do fc = 1,numf - ci = filter(fc) - if ((col%itype(ci) == icol_sunwall .or. col%itype(ci) == icol_shadewall & - .or. col%itype(ci) == icol_roof) .and. j <= nlevurb-1) then - if (j >= jtop(ci)) then - u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) - end if - else if (col%itype(ci) /= icol_sunwall .and. col%itype(ci) /= icol_shadewall & - .and. col%itype(ci) /= icol_roof) then - if (j >= jtop(ci)) then - u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) - end if - end if - end do - end do - - end subroutine Tridiagonal - -end module TridiagonalMod diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 deleted file mode 100644 index eaf1c14c36..0000000000 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ /dev/null @@ -1,938 +0,0 @@ -module UrbBuildTempOleson2015Mod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculates internal building air temperature - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use perf_mod , only : t_startf, t_stopf - use clm_varctl , only : iulog - use UrbanParamsType , only : urbanparams_type - use UrbanTimeVarType , only : urbantv_type - use EnergyFluxType , only : energyflux_type - use TemperatureType , only : temperature_type - use LandunitType , only : lun - use ColumnType , only : col - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: BuildingTemperature ! Calculation of interior building air temperature, inner - ! surface temperatures of walls and roof, and floor temperature - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BuildingTemperature -! -! !INTERFACE: - subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, & - filter_nolakec, tk, urbanparams_inst, temperature_inst, & - energyflux_inst, urbantv_inst) -! -! !DESCRIPTION: -! Solve for t_building, inner surface temperatures of roof, sunw, shdw, and floor temperature -! Five equations, five unknowns (t_roof_inner,t_sunw_inner,t_shdw_inner,t_floor,t_building at n+1) -! Derived from energy balance equations at each surface and building air -! rd (radiation), cd (conduction), cv (convection) -! qrd_roof + qcd_roof + qcv_roof = 0 -! qrd_sunw + qcd_sunw + qcv_sunw = 0 -! qrd_shdw + qcd_shdw + qcv_shdw = 0 -! qrd_floor + qcd_floor + qcv_floor = 0 -! Vbld*rho_dair*cpair*(dt_building/dt) = sum(Asfc*hcv_sfc*(t_sfc - t_building) -! + Vvent*rho_dair*cpair*(taf - t_building) -! where Vlbd is volume of building air, -! rho_dair is density of dry air at t_building (kg m-3), -! cpair is specific heat of dry air (J kg-1 K-1), -! dt_building is change in interior building temperature (K), -! dt is timestep (s), -! Asfc is surface area of roof, sunw, shdw, floor (m2) -! hcv_sfc is convective heat transfer coefficient for roof, sunw, shdw, floor (W m-2 K-1) -! t_sfc is inner surface temperature of roof, sunw, shdw, floor (K) -! t_building is interior building temperature (K) -! Vvent is ventilation airflow rate (m3 s-1) -! taf is urban canyon air temperature (K) -! -! This methodology was introduced as part of CLM5.0. -! -! Conduction fluxes are obtained from terms of soil temperature equations -! Radiation fluxes are obtained from linearizing the longwave radiation equations taking into -! account view factors for each surface. - -! qrd is positive away from the surface toward room air, so qrd = emitted - absorbed, -! so positive qrd will result in a decrease in temperature -! qcd_floor is positive away from surface toward room air, so positive -! qcd will result in a decrease in temperature -! qcv is positive toward room air, so positive qcv (t_surface > t_room) will -! result in a decrease in temperature - -! The LAPACK routine DGESV is used to compute the solution to the real system of linear equations -! a * x = b, -! where a is an n-by-n matrix and x and b are n-by-nrhs matrices. -! -! The LU decomposition with partial pivoting and row interchanges is -! used to factor a as -! a = P * L * U, -! where P is a permutation matrix, L is unit lower triangular, and U is -! upper triangular. The factored form of a is then used to solve the -! system of equations a * x = b. - -! The following is from LAPACK documentation -! DGESV computes the solution to system of linear equations A * X = B for GE matrices -! -! =========== DOCUMENTATION =========== -! -! Online html documentation available at -! http://www.netlib.org/lapack/explore-html/ -! -! Download DGESV + dependencies -! -! [TGZ] -! -! [ZIP] -! -! [TXT] -! -! Definition: -! =========== -! -! SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO ) -! -! .. Scalar Arguments .. -! INTEGER INFO, LDA, LDB, N, NRHS -! .. -! .. Array Arguments .. -! INTEGER IPIV( * ) -! DOUBLE PRECISION A( LDA, * ), B( LDB, * ) -! .. -! -! -! ============= -! -! -! DGESV computes the solution to a real system of linear equations -! A * X = B, -! where A is an N-by-N matrix and X and B are N-by-NRHS matrices. -! -! The LU decomposition with partial pivoting and row interchanges is -! used to factor A as -! A = P * L * U, -! where P is a permutation matrix, L is unit lower triangular, and U is -! upper triangular. The factored form of A is then used to solve the -! system of equations A * X = B. -! -! Arguments: -! ========== -! -! \param[in] N -! N is INTEGER -! The number of linear equations, i.e., the order of the -! matrix A. N >= 0. -! -! \param[in] NRHS -! NRHS is INTEGER -! The number of right hand sides, i.e., the number of columns -! of the matrix B. NRHS >= 0. -! -! \param[in,out] A -! A is DOUBLE PRECISION array, dimension (LDA,N) -! On entry, the N-by-N coefficient matrix A. -! On exit, the factors L and U from the factorization -! A = P*L*U; the unit diagonal elements of L are not stored. -! -! \param[in] LDA -! LDA is INTEGER -! The leading dimension of the array A. LDA >= max(1,N). -! -! \param[out] IPIV -! IPIV is INTEGER array, dimension (N) -! The pivot indices that define the permutation matrix P; -! row i of the matrix was interchanged with row IPIV(i). -! -! \param[in,out] B -! B is DOUBLE PRECISION array, dimension (LDB,NRHS) -! On entry, the N-by-NRHS matrix of right hand side matrix B. -! On exit, if INFO = 0, the N-by-NRHS solution matrix X. -! -! \param[in] LDB -! LDB is INTEGER -! The leading dimension of the array B. LDB >= max(1,N). -! -! \param[out] INFO -! INFO is INTEGER -! = 0: successful exit -! < 0: if INFO = -i, the i-th argument had an illegal value -! > 0: if INFO = i, U(i,i) is exactly zero. The factorization -! has been completed, but the factor U is exactly -! singular, so the solution could not be computed. -! -! Authors: -! ======== -! -! \author Univ. of Tennessee -! \author Univ. of California Berkeley -! \author Univ. of Colorado Denver -! \author NAG Ltd. -! -! \date November 2011 -! -! \ingroup doubleGEsolve - -! !CALLED FROM: -! subroutine SoilTemperature in this module -! -! !REVISION HISTORY: -! 08/17/12 Keith Oleson: Initial code - -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager, only : get_step_size - use clm_varcon , only : rair, pstd, cpair, sb, hcv_roof, hcv_roof_enhanced, & - hcv_floor, hcv_floor_enhanced, hcv_sunw, hcv_shdw, & - em_roof_int, em_floor_int, em_sunw_int, em_shdw_int, & - dz_floor, dens_floor, cp_floor, vent_ach - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_varctl , only : iulog - use abortutils , only : endrun - use clm_varpar , only : nlevurb, nlevsno, nlevgrnd - use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on -! -! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8), intent(in) :: tk(bounds%begc: , -nlevsno+1: ) ! thermal conductivity (W m-1 K-1) [col, j] - type(urbanparams_type), intent(in) :: urbanparams_inst ! urban parameters - type(temperature_type), intent(inout) :: temperature_inst ! temperature variables - type(energyflux_type) , intent(inout) :: energyflux_inst ! energy flux variables - type(urbantv_type) , intent(in) :: urbantv_inst ! urban time varying variables -! -! !LOCAL VARIABLES: - integer, parameter :: neq = 5 ! number of equation/unknowns - integer :: fc,fl,c,l ! indices - real(r8) :: dtime ! land model time step (s) - real(r8) :: t_roof_inner_bef(bounds%begl:bounds%endl) ! roof inside surface temperature at previous time step (K) - real(r8) :: t_sunw_inner_bef(bounds%begl:bounds%endl) ! sunwall inside surface temperature at previous time step (K) - real(r8) :: t_shdw_inner_bef(bounds%begl:bounds%endl) ! shadewall inside surface temperature at previous time step (K) - real(r8) :: t_floor_bef(bounds%begl:bounds%endl) ! floor temperature at previous time step (K) - real(r8) :: t_building_bef(bounds%begl:bounds%endl) ! internal building air temperature at previous time step [K] - real(r8) :: t_building_bef_hac(bounds%begl:bounds%endl)! internal building air temperature before applying HAC [K] - real(r8) :: hcv_roofi(bounds%begl:bounds%endl) ! roof convective heat transfer coefficient (W m-2 K-1) - real(r8) :: hcv_sunwi(bounds%begl:bounds%endl) ! sunwall convective heat transfer coefficient (W m-2 K-1) - real(r8) :: hcv_shdwi(bounds%begl:bounds%endl) ! shadewall convective heat transfer coefficient (W m-2 K-1) - real(r8) :: hcv_floori(bounds%begl:bounds%endl) ! floor convective heat transfer coefficient (W m-2 K-1) - real(r8) :: em_roofi(bounds%begl:bounds%endl) ! roof inside surface emissivity (-) - real(r8) :: em_sunwi(bounds%begl:bounds%endl) ! sunwall inside surface emissivity (-) - real(r8) :: em_shdwi(bounds%begl:bounds%endl) ! shadewall inside surface emissivity (-) - real(r8) :: em_floori(bounds%begl:bounds%endl) ! floor inside surface emissivity (-) - real(r8) :: dz_floori(bounds%begl:bounds%endl) ! concrete floor thickness (m) - real(r8) :: cp_floori(bounds%begl:bounds%endl) ! concrete floor volumetric heat capacity (J m-3 K-1) - real(r8) :: cv_floori(bounds%begl:bounds%endl) ! intermediate calculation for concrete floor (W m-2 K-1) - real(r8) :: rho_dair(bounds%begl:bounds%endl) ! density of dry air at standard pressure and t_building (kg m-3) - real(r8) :: vf_rf(bounds%begl:bounds%endl) ! view factor of roof for floor (-) - real(r8) :: vf_fr(bounds%begl:bounds%endl) ! view factor of floor for roof (-) - real(r8) :: vf_wf(bounds%begl:bounds%endl) ! view factor of wall for floor (-) - real(r8) :: vf_fw(bounds%begl:bounds%endl) ! view factor of floor for wall (-) - real(r8) :: vf_rw(bounds%begl:bounds%endl) ! view factor of roof for wall (-) - real(r8) :: vf_wr(bounds%begl:bounds%endl) ! view factor of wall for roof (-) - real(r8) :: vf_ww(bounds%begl:bounds%endl) ! view factor of wall for wall (-) - real(r8) :: zi_roof_innerl(bounds%begl:bounds%endl) ! interface depth of nlevurb roof (m) - real(r8) :: z_roof_innerl(bounds%begl:bounds%endl) ! node depth of nlevurb roof (m) - real(r8) :: zi_sunw_innerl(bounds%begl:bounds%endl) ! interface depth of nlevurb sunwall (m) - real(r8) :: z_sunw_innerl(bounds%begl:bounds%endl) ! node depth of nlevurb sunwall (m) - real(r8) :: zi_shdw_innerl(bounds%begl:bounds%endl) ! interface depth of nlevurb shadewall (m) - real(r8) :: z_shdw_innerl(bounds%begl:bounds%endl) ! node depth of nlevurb shadewall (m) - real(r8) :: t_roof_innerl_bef(bounds%begl:bounds%endl) ! roof temperature at nlevurb node depth at previous time step (K) - real(r8) :: t_sunw_innerl_bef(bounds%begl:bounds%endl) ! sunwall temperature at nlevurb node depth at previous time step (K) - real(r8) :: t_shdw_innerl_bef(bounds%begl:bounds%endl) ! shadewall temperature at nlevurb node depth at previous time step (K) - real(r8) :: t_roof_innerl(bounds%begl:bounds%endl) ! roof temperature at nlevurb node depth (K) - real(r8) :: t_sunw_innerl(bounds%begl:bounds%endl) ! sunwall temperature at nlevurb node depth (K) - real(r8) :: t_shdw_innerl(bounds%begl:bounds%endl) ! shadewall temperature at nlevurb node depth (K) - real(r8) :: tk_roof_innerl(bounds%begl:bounds%endl) ! roof thermal conductivity at nlevurb interface depth (W m-1 K-1) - real(r8) :: tk_sunw_innerl(bounds%begl:bounds%endl) ! sunwall thermal conductivity at nlevurb interface depth (W m-1 K-1) - real(r8) :: tk_shdw_innerl(bounds%begl:bounds%endl) ! shadewall thermal conductivity at nlevurb interface depth (W m-1 K-1) - real(r8) :: qrd_roof(bounds%begl:bounds%endl) ! roof inside net longwave for energy balance check (W m-2) - real(r8) :: qrd_sunw(bounds%begl:bounds%endl) ! sunwall inside net longwave for energy balance check (W m-2) - real(r8) :: qrd_shdw(bounds%begl:bounds%endl) ! shadewall inside net longwave for energy balance check (W m-2) - real(r8) :: qrd_floor(bounds%begl:bounds%endl) ! floor inside net longwave for energy balance check (W m-2) - real(r8) :: qrd_building(bounds%begl:bounds%endl) ! building inside net longwave for energy balance check (W m-2) - real(r8) :: qcv_roof(bounds%begl:bounds%endl) ! roof inside convection flux for energy balance check (W m-2) - real(r8) :: qcv_sunw(bounds%begl:bounds%endl) ! sunwall inside convection flux for energy balance check (W m-2) - real(r8) :: qcv_shdw(bounds%begl:bounds%endl) ! shadewall inside convection flux for energy balance check (W m-2) - real(r8) :: qcv_floor(bounds%begl:bounds%endl) ! floor inside convection flux for energy balance check (W m-2) - real(r8) :: qcd_roof(bounds%begl:bounds%endl) ! roof inside conduction flux for energy balance check (W m-2) - real(r8) :: qcd_sunw(bounds%begl:bounds%endl) ! sunwall inside conduction flux for energy balance check (W m-2) - real(r8) :: qcd_shdw(bounds%begl:bounds%endl) ! shadewall inside conduction flux for energy balance check (W m-2) - real(r8) :: qcd_floor(bounds%begl:bounds%endl) ! floor inside conduction flux for energy balance check (W m-2) - real(r8) :: enrgy_bal_roof(bounds%begl:bounds%endl) ! roof inside energy balance (W m-2) - real(r8) :: enrgy_bal_sunw(bounds%begl:bounds%endl) ! sunwall inside energy balance (W m-2) - real(r8) :: enrgy_bal_shdw(bounds%begl:bounds%endl) ! shadewall inside energy balance (W m-2) - real(r8) :: enrgy_bal_floor(bounds%begl:bounds%endl) ! floor inside energy balance (W m-2) - real(r8) :: enrgy_bal_buildair(bounds%begl:bounds%endl)! building air energy balance (W m-2) - real(r8) :: sum ! sum of view factors for floor, wall, roof - integer :: n ! number of linear equations (= neq) - integer :: nrhs ! number of right hand sides (= 1) - real(r8) :: a(neq,neq) ! n-by-n coefficient matrix a - integer :: lda ! leading dimension of the matrix a - integer :: ldb ! leading dimension of the matrix b - real(r8) :: result(neq) ! on entry, the right hand side of matrix b - ! on exit, if info = 0, the n-by-nrhs solution matrix x - integer :: info ! exit information for LAPACK routine dgesv - integer :: ipiv(neq) ! the pivot indices that define the permutation matrix P -!EOP -!----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(tk) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - associate(& - clandunit => col%landunit , & ! Input: [integer (:)] column's landunit - ctype => col%itype , & ! Input: [integer (:)] column type - zi => col%zi , & ! Input: [real(r8) (:,:)] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:)] layer thickness (m) - - ht_roof => lun%ht_roof , & ! Input: [real(r8) (:)] height of urban roof (m) - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:)] ratio of building height to street hwidth (-) - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:)] weight of roof with respect to landunit - urbpoi => lun%urbpoi , & ! Input: [logical (:)] true => landunit is an urban point - - taf => temperature_inst%taf_lun , & ! Input: [real(r8) (:)] urban canopy air temperature (K) - tssbef => temperature_inst%t_ssbef_col , & ! Input: [real(r8) (:,:)] temperature at previous time step (K) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:)] soil temperature (K) - t_roof_inner => temperature_inst%t_roof_inner_lun , & ! InOut: [real(r8) (:)] roof inside surface temperature (K) - t_sunw_inner => temperature_inst%t_sunw_inner_lun , & ! InOut: [real(r8) (:)] sunwall inside surface temperature (K) - t_shdw_inner => temperature_inst%t_shdw_inner_lun , & ! InOut: [real(r8) (:)] shadewall inside surface temperature (K) - t_floor => temperature_inst%t_floor_lun , & ! InOut: [real(r8) (:)] floor temperature (K) - t_building => temperature_inst%t_building_lun , & ! InOut: [real(r8) (:)] internal building air temperature (K) - - t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) - t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:)] minimum internal building air temperature (K) - - eflx_building => energyflux_inst%eflx_building_lun , & ! Output: [real(r8) (:)] building heat flux from change in interior building air temperature (W/m**2) - eflx_urban_ac => energyflux_inst%eflx_urban_ac_lun , & ! Output: [real(r8) (:)] urban air conditioning flux (W/m**2) - eflx_urban_heat => energyflux_inst%eflx_urban_heat_lun & ! Output: [real(r8) (:)] urban heating flux (W/m**2) - ) - - ! Get step size - - dtime = get_step_size() - - ! 1. Save t_* at previous time step - ! 2. Set convective heat transfer coefficients (Bueno et al. 2012, GMD). - ! An alternative is Salamanca et al. 2010, TAC, where they are all set to 8 W m-2 K-1. - ! See clm_varcon.F90 - ! 3. Set inner surface emissivities (Bueno et al. 2012, GMD). - ! 4. Set concrete floor properties (Salamanca et al. 2010, TAC). - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - t_roof_inner_bef(l) = t_roof_inner(l) - t_sunw_inner_bef(l) = t_sunw_inner(l) - t_shdw_inner_bef(l) = t_shdw_inner(l) - t_floor_bef(l) = t_floor(l) - t_building_bef(l) = t_building(l) - if (t_roof_inner_bef(l) .le. t_building_bef(l)) then - hcv_roofi(l) = hcv_roof_enhanced - else - hcv_roofi(l) = hcv_roof - end if - if (t_floor_bef(l) .ge. t_building_bef(l)) then - hcv_floori(l) = hcv_floor_enhanced - else - hcv_floori(l) = hcv_floor - end if - hcv_sunwi(l) = hcv_sunw - hcv_shdwi(l) = hcv_shdw - em_roofi(l) = em_roof_int - em_sunwi(l) = em_sunw_int - em_shdwi(l) = em_shdw_int - em_floori(l) = em_floor_int - ! Concrete floor thickness (m) - dz_floori(l) = dz_floor - ! Concrete floor volumetric heat capacity (J m-3 K-1) - cp_floori(l) = cp_floor - ! Intermediate calculation for concrete floor (W m-2 K-1) - cv_floori(l) = (dz_floori(l) * cp_floori(l)) / dtime - ! Density of dry air at standard pressure and t_building (kg m-3) - rho_dair(l) = pstd / (rair*t_building_bef(l)) - end if - end do - - ! Get terms from soil temperature equations to compute conduction flux - ! Negative is toward surface - heat added - ! Note that the conduction flux here is in W m-2 wall area but for purposes of solving the set of - ! simultaneous equations this must be converted to W m-2 ground area. This is done below when - ! setting up the equation coefficients. - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (urbpoi(l)) then - if (ctype(c) == icol_roof) then - zi_roof_innerl(l) = zi(c,nlevurb) - z_roof_innerl(l) = z(c,nlevurb) - t_roof_innerl_bef(l) = tssbef(c,nlevurb) - t_roof_innerl(l) = t_soisno(c,nlevurb) - tk_roof_innerl(l) = tk(c,nlevurb) - else if (ctype(c) == icol_sunwall) then - zi_sunw_innerl(l) = zi(c,nlevurb) - z_sunw_innerl(l) = z(c,nlevurb) - t_sunw_innerl_bef(l) = tssbef(c,nlevurb) - t_sunw_innerl(l) = t_soisno(c,nlevurb) - tk_sunw_innerl(l) = tk(c,nlevurb) - else if (ctype(c) == icol_shadewall) then - zi_shdw_innerl(l) = zi(c,nlevurb) - z_shdw_innerl(l) = z(c,nlevurb) - t_shdw_innerl_bef(l) = tssbef(c,nlevurb) - t_shdw_innerl(l) = t_soisno(c,nlevurb) - tk_shdw_innerl(l) = tk(c,nlevurb) - end if - end if - end do - - ! Calculate view factors - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - - vf_rf(l) = sqrt(1._r8 + canyon_hwr(l)**2._r8) - canyon_hwr(l) - vf_fr(l) = vf_rf(l) - - ! This view factor implicitly converts from per unit wall area to per unit floor area - vf_wf(l) = 0.5_r8*(1._r8 - vf_rf(l)) - - ! This view factor implicitly converts from per unit floor area to per unit wall area - vf_fw(l) = vf_wf(l) / canyon_hwr(l) - - ! This view factor implicitly converts from per unit roof area to per unit wall area - vf_rw(l) = vf_fw(l) - - ! This view factor implicitly converts from per unit wall area to per unit roof area - vf_wr(l) = vf_wf(l) - - vf_ww(l) = 1._r8 - vf_rw(l) - vf_fw(l) - - end if - end do - - ! error check -- make sure view factor sums to one for floor, wall, and roof - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - - sum = vf_rf(l) + 2._r8*vf_wf(l) - if (abs(sum-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban floor view factor error',sum - write (iulog,*) 'clm model is stopping' - call endrun() - endif - sum = vf_rw(l) + vf_fw(l) + vf_ww(l) - if (abs(sum-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban wall view factor error',sum - write (iulog,*) 'clm model is stopping' - call endrun() - endif - sum = vf_fr(l) + vf_wr(l) + vf_wr(l) - if (abs(sum-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban roof view factor error',sum - write (iulog,*) 'clm model is stopping' - call endrun() - endif - - endif - end do - - n = neq - nrhs = 1 - lda = neq - ldb = neq - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - - ! ROOF - a(1,1) = 0.5_r8*hcv_roofi(l) & - + 0.5_r8*tk_roof_innerl(l)/(zi_roof_innerl(l) - z_roof_innerl(l)) & - + 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8 & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fr(l) - - a(1,2) = - 4._r8*em_roofi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wr(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) - - a(1,3) = - 4._r8*em_roofi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wr(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) - - a(1,4) = - 4._r8*em_roofi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fr(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wr(l) - - a(1,5) = - 0.5_r8*hcv_roofi(l) - - result(1) = 0.5_r8*tk_roof_innerl(l)*t_roof_innerl(l)/(zi_roof_innerl(l) - z_roof_innerl(l)) & - - 0.5_r8*tk_roof_innerl(l)*(t_roof_inner_bef(l)-t_roof_innerl_bef(l))/(zi_roof_innerl(l) & - - z_roof_innerl(l)) & - - 3._r8*em_roofi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wr(l) & - - 3._r8*em_roofi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wr(l) & - - 3._r8*em_roofi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fr(l) & - + 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8 & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 0.5_r8*hcv_roofi(l)*(t_roof_inner_bef(l) - t_building_bef(l)) - - ! SUNWALL - a(2,1) = - 4._r8*em_sunwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) - - a(2,2) = 0.5_r8*hcv_sunwi(l)*canyon_hwr(l) & - + 0.5_r8*tk_sunw_innerl(l)/(zi_sunw_innerl(l) - z_sunw_innerl(l))*canyon_hwr(l) & - + 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8 & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) - - a(2,3) = - 4._r8*em_sunwi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) - - a(2,4) = - 4._r8*em_sunwi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_ww(l) - a(2,5) = - 0.5_r8*hcv_sunwi(l)*canyon_hwr(l) - - result(2) = 0.5_r8*tk_sunw_innerl(l)*t_sunw_innerl(l)/(zi_sunw_innerl(l) - z_sunw_innerl(l))*canyon_hwr(l) & - - 0.5_r8*tk_sunw_innerl(l)*(t_sunw_inner_bef(l)-t_sunw_innerl_bef(l))/(zi_sunw_innerl(l) & - - z_sunw_innerl(l))*canyon_hwr(l) & - - 3._r8*em_sunwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l) & - - 3._r8*em_sunwi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_ww(l) & - - 3._r8*em_sunwi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l) & - + 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8 & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 0.5_r8*hcv_sunwi(l)*(t_sunw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) - - ! SHADEWALL - a(3,1) = - 4._r8*em_shdwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) - - a(3,2) = - 4._r8*em_shdwi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) - - a(3,3) = 0.5_r8*hcv_shdwi(l)*canyon_hwr(l) & - + 0.5_r8*tk_shdw_innerl(l)/(zi_shdw_innerl(l) - z_shdw_innerl(l))*canyon_hwr(l) & - + 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8 & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) - - a(3,4) = - 4._r8*em_shdwi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_ww(l) - - a(3,5) = - 0.5_r8*hcv_shdwi(l)*canyon_hwr(l) - - result(3) = 0.5_r8*tk_shdw_innerl(l)*t_shdw_innerl(l)/(zi_shdw_innerl(l) - z_shdw_innerl(l))*canyon_hwr(l) & - - 0.5_r8*tk_shdw_innerl(l)*(t_shdw_inner_bef(l)-t_shdw_innerl_bef(l))/(zi_shdw_innerl(l) & - - z_shdw_innerl(l))*canyon_hwr(l) & - - 3._r8*em_shdwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l) & - - 3._r8*em_shdwi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_ww(l) & - - 3._r8*em_shdwi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l) & - + 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8 & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 0.5_r8*hcv_shdwi(l)*(t_shdw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) - - ! FLOOR - a(4,1) = - 4._r8*em_floori(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wf(l) - - a(4,2) = - 4._r8*em_floori(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) - - a(4,3) = - 4._r8*em_floori(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wf(l) - - a(4,4) = (cv_floori(l) + 0.5_r8*hcv_floori(l)) & - + 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8 & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wf(l) - - a(4,5) = - 0.5_r8*hcv_floori(l) - - result(4) = cv_floori(l)*t_floor_bef(l) & - - 3._r8*em_floori(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rf(l) & - - 3._r8*em_floori(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wf(l) & - - 3._r8*em_floori(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wf(l) & - + 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8 & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 3._r8*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 3._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 3._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 3._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 0.5_r8*hcv_floori(l)*(t_floor_bef(l) - t_building_bef(l)) - - ! Building air temperature - a(5,1) = - 0.5_r8*hcv_roofi(l) - a(5,2) = - 0.5_r8*hcv_sunwi(l)*canyon_hwr(l) - - a(5,3) = - 0.5_r8*hcv_shdwi(l)*canyon_hwr(l) - - a(5,4) = - 0.5_r8*hcv_floori(l) - - a(5,5) = ((ht_roof(l)*rho_dair(l)*cpair)/dtime) + & - ((ht_roof(l)*vent_ach)/3600._r8)*rho_dair(l)*cpair + & - 0.5_r8*hcv_roofi(l) + & - 0.5_r8*hcv_sunwi(l)*canyon_hwr(l) + & - 0.5_r8*hcv_shdwi(l)*canyon_hwr(l) + & - 0.5_r8*hcv_floori(l) - - result(5) = (ht_roof(l)*rho_dair(l)*cpair/dtime)*t_building_bef(l) & - + ((ht_roof(l)*vent_ach)/3600._r8)*rho_dair(l)*cpair*taf(l) & - + 0.5_r8*hcv_roofi(l)*(t_roof_inner_bef(l) - t_building_bef(l)) & - + 0.5_r8*hcv_sunwi(l)*(t_sunw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) & - + 0.5_r8*hcv_shdwi(l)*(t_shdw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) & - + 0.5_r8*hcv_floori(l)*(t_floor_bef(l) - t_building_bef(l)) - - ! Solve equations - call dgesv(n, nrhs, a, lda, ipiv, result, ldb, info) - - ! If dgesv fails, abort - if (info /= 0) then - write(iulog,*)'fl: ',fl - write(iulog,*)'l: ',l - write(iulog,*)'dgesv info: ',info - write (iulog,*) 'dgesv error' - write (iulog,*) 'clm model is stopping' - call endrun() - end if - ! Assign new temperatures - t_roof_inner(l) = result(1) - t_sunw_inner(l) = result(2) - t_shdw_inner(l) = result(3) - t_floor(l) = result(4) - t_building(l) = result(5) - end if - end do - - ! Energy balance checks - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - qrd_roof(l) = - em_roofi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wr(l) & - - 4._r8*em_roofi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wr(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - em_roofi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wr(l) & - - 4._r8*em_roofi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wr(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - em_roofi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fr(l) & - - 4._r8*em_roofi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fr(l)*(t_floor(l) - t_floor_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wr(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wr(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l)*(1._r8-em_floori(l))*vf_fr(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wr(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wr(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l)*(1._r8-em_floori(l))*vf_fr(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wr(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wr(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wr(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wr(l)*(t_floor(l) & - - t_floor_bef(l)) & - + em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8 & - + 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*(t_roof_inner(l) - t_roof_inner_bef(l)) - - qrd_sunw(l) = - em_sunwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l) & - - 4._r8*em_sunwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - em_sunwi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_ww(l) & - - 4._r8*em_sunwi(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_ww(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - em_sunwi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l) & - - 4._r8*em_sunwi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(t_floor(l) - t_floor_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_ww(l)*(1._r8-em_shdwi(l))*vf_ww(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rw(l)*(1._r8-em_shdwi(l))*vf_ww(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_shdwi(l))*vf_ww(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fw(l)*(1._r8-em_shdwi(l))*vf_ww(l)*(t_floor(l) & - - t_floor_bef(l)) & - + em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8 & - + 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*(t_sunw_inner(l) - t_sunw_inner_bef(l)) - - qrd_shdw(l) = - em_shdwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rw(l) & - - 4._r8*em_shdwi(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rw(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - em_shdwi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_ww(l) & - - 4._r8*em_shdwi(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_ww(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - em_shdwi(l)*em_floori(l)*sb*t_floor_bef(l)**4._r8*vf_fw(l) & - - 4._r8*em_shdwi(l)*em_floori(l)*sb*t_floor_bef(l)**3._r8*vf_fw(l)*(t_floor(l) - t_floor_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_ww(l)*(1._r8-em_sunwi(l))*vf_ww(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_wf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rw(l)*(1._r8-em_sunwi(l))*vf_ww(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rf(l)*(1._r8-em_floori(l))*vf_fw(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fr(l)*(1._r8-em_roofi(l))*vf_rw(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_sunwi(l))*vf_ww(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fw(l)*(1._r8-em_sunwi(l))*vf_ww(l)*(t_floor(l) & - - t_floor_bef(l)) & - + em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8 & - + 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*(t_shdw_inner(l) - t_shdw_inner_bef(l)) - - qrd_floor(l) = - em_floori(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8*vf_rf(l) & - - 4._r8*em_floori(l)*em_roofi(l)*sb*t_roof_inner_bef(l)**3._r8*vf_rf(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - em_floori(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8*vf_wf(l) & - - 4._r8*em_floori(l)*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3._r8*vf_wf(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - em_floori(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8*vf_wf(l) & - - 4._r8*em_floori(l)*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3._r8*vf_wf(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fr(l)*(1._r8-em_roofi(l))*vf_rf(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fw(l)*(1._r8-em_sunwi(l))*vf_wf(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_floori(l)*sb*t_floor_bef(l)**4._r8)*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*vf_fw(l)*(1._r8-em_shdwi(l))*vf_wf(l)*(t_floor(l) & - - t_floor_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_ww(l)*(1._r8-em_shdwi(l))*vf_wf(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_sunwi(l)*sb*t_sunw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 4._r8*em_sunwi(l)*sb*t_sunw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l)*(t_sunw_inner(l) & - - t_sunw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_wr(l)*(1._r8-em_roofi(l))*vf_rf(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_shdwi(l)*sb*t_shdw_inner_bef(l)**4._r8)*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 4._r8*em_shdwi(l)*sb*t_shdw_inner_bef(l)**3.*vf_ww(l)*(1._r8-em_sunwi(l))*vf_wf(l)*(t_shdw_inner(l) & - - t_shdw_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wf(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rw(l)*(1._r8-em_sunwi(l))*vf_wf(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - - (em_roofi(l)*sb*t_roof_inner_bef(l)**4._r8)*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wf(l) & - - 4._r8*em_roofi(l)*sb*t_roof_inner_bef(l)**3.*vf_rw(l)*(1._r8-em_shdwi(l))*vf_wf(l)*(t_roof_inner(l) & - - t_roof_inner_bef(l)) & - + em_floori(l)*sb*t_floor_bef(l)**4._r8 & - + 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*(t_floor(l) - t_floor_bef(l)) - - qrd_building(l) = qrd_roof(l) + canyon_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) - - if (abs(qrd_building(l)) > .10_r8 ) then - write (iulog,*) 'urban inside building net longwave radiation balance error ',qrd_building(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - qcv_roof(l) = 0.5_r8*hcv_roofi(l)*(t_roof_inner(l) - t_building(l)) + 0.5_r8*hcv_roofi(l)*(t_roof_inner_bef(l) & - - t_building_bef(l)) - qcd_roof(l) = 0.5_r8*tk_roof_innerl(l)*(t_roof_inner(l) - t_roof_innerl(l))/(zi_roof_innerl(l) - z_roof_innerl(l)) & - + 0.5_r8*tk_roof_innerl(l)*(t_roof_inner_bef(l) - t_roof_innerl_bef(l))/(zi_roof_innerl(l) & - - z_roof_innerl(l)) - enrgy_bal_roof(l) = qrd_roof(l) + qcv_roof(l) + qcd_roof(l) - if (abs(enrgy_bal_roof(l)) > .10_r8 ) then - write (iulog,*) 'urban inside roof energy balance error ',enrgy_bal_roof(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - qcv_sunw(l) = 0.5_r8*hcv_sunwi(l)*(t_sunw_inner(l) - t_building(l)) + 0.5_r8*hcv_sunwi(l)*(t_sunw_inner_bef(l) & - - t_building_bef(l)) - qcd_sunw(l) = 0.5_r8*tk_sunw_innerl(l)*(t_sunw_inner(l) - t_sunw_innerl(l))/(zi_sunw_innerl(l) - z_sunw_innerl(l)) & - + 0.5_r8*tk_sunw_innerl(l)*(t_sunw_inner_bef(l) - t_sunw_innerl_bef(l))/(zi_sunw_innerl(l) & - - z_sunw_innerl(l)) - enrgy_bal_sunw(l) = qrd_sunw(l) + qcv_sunw(l)*canyon_hwr(l) + qcd_sunw(l)*canyon_hwr(l) - if (abs(enrgy_bal_sunw(l)) > .10_r8 ) then - write (iulog,*) 'urban inside sunwall energy balance error ',enrgy_bal_sunw(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - qcv_shdw(l) = 0.5_r8*hcv_shdwi(l)*(t_shdw_inner(l) - t_building(l)) + 0.5_r8*hcv_shdwi(l)*(t_shdw_inner_bef(l) & - - t_building_bef(l)) - qcd_shdw(l) = 0.5_r8*tk_shdw_innerl(l)*(t_shdw_inner(l) - t_shdw_innerl(l))/(zi_shdw_innerl(l) - z_shdw_innerl(l)) & - + 0.5_r8*tk_shdw_innerl(l)*(t_shdw_inner_bef(l) - t_shdw_innerl_bef(l))/(zi_shdw_innerl(l) & - - z_shdw_innerl(l)) - enrgy_bal_shdw(l) = qrd_shdw(l) + qcv_shdw(l)*canyon_hwr(l) + qcd_shdw(l)*canyon_hwr(l) - if (abs(enrgy_bal_shdw(l)) > .10_r8 ) then - write (iulog,*) 'urban inside shadewall energy balance error ',enrgy_bal_shdw(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - qcv_floor(l) = 0.5_r8*hcv_floori(l)*(t_floor(l) - t_building(l)) + 0.5_r8*hcv_floori(l)*(t_floor_bef(l) & - - t_building_bef(l)) - qcd_floor(l) = cv_floori(l)*(t_floor(l) - t_floor_bef(l)) - enrgy_bal_floor(l) = qrd_floor(l) + qcv_floor(l) + qcd_floor(l) - if (abs(enrgy_bal_floor(l)) > .10_r8 ) then - write (iulog,*) 'urban inside floor energy balance error ',enrgy_bal_floor(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - enrgy_bal_buildair(l) = (ht_roof(l)*rho_dair(l)*cpair/dtime)*(t_building(l) - t_building_bef(l)) & - - ht_roof(l)*(vent_ach/3600._r8)*rho_dair(l)*cpair*(taf(l) - t_building(l)) & - - 0.5_r8*hcv_roofi(l)*(t_roof_inner(l) - t_building(l)) & - - 0.5_r8*hcv_roofi(l)*(t_roof_inner_bef(l) - t_building_bef(l)) & - - 0.5_r8*hcv_sunwi(l)*(t_sunw_inner(l) - t_building(l))*canyon_hwr(l) & - - 0.5_r8*hcv_sunwi(l)*(t_sunw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) & - - 0.5_r8*hcv_shdwi(l)*(t_shdw_inner(l) - t_building(l))*canyon_hwr(l) & - - 0.5_r8*hcv_shdwi(l)*(t_shdw_inner_bef(l) - t_building_bef(l))*canyon_hwr(l) & - - 0.5_r8*hcv_floori(l)*(t_floor(l) - t_building(l)) & - - 0.5_r8*hcv_floori(l)*(t_floor_bef(l) - t_building_bef(l)) - if (abs(enrgy_bal_buildair(l)) > .10_r8 ) then - write (iulog,*) 'urban building air energy balance error ',enrgy_bal_buildair(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - end if - end do - - ! Restrict internal building air temperature to between min and max - ! Calculate heating or air conditioning flux from energy required to change - ! internal building air temperature to t_building_min or t_building_max. - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (urbpoi(l)) then - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - t_building_bef_hac(l) = t_building(l) -! rho_dair(l) = pstd / (rair*t_building(l)) - - if (t_building_bef_hac(l) > t_building_max(l)) then - t_building(l) = t_building_max(l) - eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - else if (t_building_bef_hac(l) < t_building_min(l)) then - t_building(l) = t_building_min(l) - eflx_urban_heat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - else - eflx_urban_ac(l) = 0._r8 - eflx_urban_heat(l) = 0._r8 - end if - else - eflx_urban_ac(l) = 0._r8 - eflx_urban_heat(l) = 0._r8 - end if - eflx_building(l) = wtlunit_roof(l) * (ht_roof(l) * rho_dair(l)*cpair/dtime) * (t_building(l) - t_building_bef(l)) - end if - end do - - end associate - end subroutine BuildingTemperature - - !----------------------------------------------------------------------- - -end module UrbBuildTempOleson2015Mod diff --git a/src/biogeophys/UrbanAlbedoMod.F90 b/src/biogeophys/UrbanAlbedoMod.F90 deleted file mode 100644 index 06552ae1d0..0000000000 --- a/src/biogeophys/UrbanAlbedoMod.F90 +++ /dev/null @@ -1,1286 +0,0 @@ -module UrbanAlbedoMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate solar and longwave radiation, and turbulent fluxes for urban landunit - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : numrad - use clm_varcon , only : isecspday, degpsec, namel - use clm_varctl , only : iulog - use abortutils , only : endrun - use UrbanParamsType , only : urbanparams_type - use WaterstateType , only : waterstate_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanAlbedo ! Urban physics - albedos - ! - ! PRIVATE MEMBER FUNCTIONS - private :: SnowAlbedo ! Snow albedos - private :: incident_direct ! Direct beam solar rad incident on walls and road in urban canyon - private :: incident_diffuse ! Diffuse solar rad incident on walls and road in urban canyon - private :: net_solar ! Solar radiation absorbed by road and both walls in urban canyon - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, num_urbanp, filter_urbanp, & - waterstate_inst, urbanparams_inst, solarabs_inst, surfalb_inst) - ! - ! !DESCRIPTION: - ! Determine urban landunit component albedos - ! - ! Note that this is called with the "inactive_and_active" version of the filters, because - ! the variables computed here are needed over inactive points that might later become - ! active (due to landuse change). Thus, this routine cannot depend on variables that are - ! only computed over active points. - ! - ! !USES: - use shr_orb_mod , only : shr_orb_decl, shr_orb_cosz - use clm_varcon , only : sb - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban patches in clump - integer , intent(in) :: filter_urbanp(:) ! urban pft filter - type(waterstate_type) , intent(in) :: waterstate_inst - type(urbanparams_type) , intent(inout) :: urbanparams_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(surfalb_type) , intent(inout) :: surfalb_inst - ! - ! !LOCAL VARIABLES: - integer :: fl,fp,fc,g,l,p,c,ib ! indices - integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - integer :: num_solar ! counter - real(r8) :: coszen (bounds%begl:bounds%endl) ! cosine solar zenith angle for next time step (landunit) - real(r8) :: zen (bounds%begl:bounds%endl) ! solar zenith angle (radians) - real(r8) :: sdir (bounds%begl:bounds%endl, numrad) ! direct beam solar radiation on horizontal surface - real(r8) :: sdif (bounds%begl:bounds%endl, numrad) ! diffuse solar radiation on horizontal surface - real(r8) :: sdir_road (bounds%begl:bounds%endl, numrad) ! direct beam solar radiation incident on road - real(r8) :: sdif_road (bounds%begl:bounds%endl, numrad) ! diffuse solar radiation incident on road - real(r8) :: sdir_sunwall (bounds%begl:bounds%endl, numrad) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8) :: sdif_sunwall (bounds%begl:bounds%endl, numrad) ! diffuse solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8) :: sdir_shadewall (bounds%begl:bounds%endl, numrad) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8) :: sdif_shadewall (bounds%begl:bounds%endl, numrad) ! diffuse solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8) :: albsnd_roof (bounds%begl:bounds%endl, numrad) ! snow albedo for roof (direct) - real(r8) :: albsni_roof (bounds%begl:bounds%endl, numrad) ! snow albedo for roof (diffuse) - real(r8) :: albsnd_improad (bounds%begl:bounds%endl, numrad) ! snow albedo for impervious road (direct) - real(r8) :: albsni_improad (bounds%begl:bounds%endl, numrad) ! snow albedo for impervious road (diffuse) - real(r8) :: albsnd_perroad (bounds%begl:bounds%endl, numrad) ! snow albedo for pervious road (direct) - real(r8) :: albsni_perroad (bounds%begl:bounds%endl, numrad) ! snow albedo for pervious road (diffuse) - real(r8) :: alb_roof_dir_s (bounds%begl:bounds%endl, numrad) ! direct roof albedo with snow effects - real(r8) :: alb_roof_dif_s (bounds%begl:bounds%endl, numrad) ! diffuse roof albedo with snow effects - real(r8) :: alb_improad_dir_s (bounds%begl:bounds%endl, numrad) ! direct impervious road albedo with snow effects - real(r8) :: alb_perroad_dir_s (bounds%begl:bounds%endl, numrad) ! direct pervious road albedo with snow effects - real(r8) :: alb_improad_dif_s (bounds%begl:bounds%endl, numrad) ! diffuse impervious road albedo with snow effects - real(r8) :: alb_perroad_dif_s (bounds%begl:bounds%endl, numrad) ! diffuse pervious road albedo with snow effects - real(r8) :: sref_roof_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by roof per unit ground area per unit incident flux - real(r8) :: sref_roof_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by roof per unit ground area per unit incident flux - real(r8) :: sref_sunwall_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by sunwall per unit wall area per unit incident flux - real(r8) :: sref_sunwall_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by sunwall per unit wall area per unit incident flux - real(r8) :: sref_shadewall_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by shadewall per unit wall area per unit incident flux - real(r8) :: sref_shadewall_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by shadewall per unit wall area per unit incident flux - real(r8) :: sref_improad_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by impervious road per unit ground area per unit incident flux - real(r8) :: sref_improad_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by impervious road per unit ground area per unit incident flux - real(r8) :: sref_perroad_dir (bounds%begl:bounds%endl, numrad) ! direct solar reflected by pervious road per unit ground area per unit incident flux - real(r8) :: sref_perroad_dif (bounds%begl:bounds%endl, numrad) ! diffuse solar reflected by pervious road per unit ground area per unit incident flux - !----------------------------------------------------------------------- - - associate( & - ctype => col%itype , & ! Input: [integer (:) ] column type - coli => lun%coli , & ! Input: [integer (:) ] beginning column index for landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street width - wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - - alb_roof_dir => urbanparams_inst%alb_roof_dir , & ! Output: [real(r8) (:,:) ] direct roof albedo - alb_roof_dif => urbanparams_inst%alb_roof_dif , & ! Output: [real(r8) (:,:) ] diffuse roof albedo - alb_improad_dir => urbanparams_inst%alb_improad_dir , & ! Output: [real(r8) (:,:) ] direct impervious road albedo - alb_improad_dif => urbanparams_inst%alb_improad_dif , & ! Output: [real(r8) (:,:) ] diffuse imprevious road albedo - alb_perroad_dir => urbanparams_inst%alb_perroad_dir , & ! Output: [real(r8) (:,:) ] direct pervious road albedo - alb_perroad_dif => urbanparams_inst%alb_perroad_dif , & ! Output: [real(r8) (:,:) ] diffuse pervious road albedo - alb_wall_dir => urbanparams_inst%alb_wall_dir , & ! Output: [real(r8) (:,:) ] direct wall albedo - alb_wall_dif => urbanparams_inst%alb_wall_dif , & ! Output: [real(r8) (:,:) ] diffuse wall albedo - - sabs_roof_dir => solarabs_inst%sabs_roof_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by roof per unit ground area per unit incident flux - sabs_roof_dif => solarabs_inst%sabs_roof_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by roof per unit ground area per unit incident flux - sabs_sunwall_dir => solarabs_inst%sabs_sunwall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by sunwall per unit wall area per unit incident flux - sabs_sunwall_dif => solarabs_inst%sabs_sunwall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by sunwall per unit wall area per unit incident flux - sabs_shadewall_dir => solarabs_inst%sabs_shadewall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by shadewall per unit wall area per unit incident flux - sabs_shadewall_dif => solarabs_inst%sabs_shadewall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by shadewall per unit wall area per unit incident flux - sabs_improad_dir => solarabs_inst%sabs_improad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by impervious road per unit ground area per unit incident flux - sabs_improad_dif => solarabs_inst%sabs_improad_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by impervious road per unit ground area per unit incident flux - sabs_perroad_dir => solarabs_inst%sabs_perroad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by pervious road per unit ground area per unit incident flux - sabs_perroad_dif => solarabs_inst%sabs_perroad_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by pervious road per unit ground area per unit incident flux - - fabd => surfalb_inst%fabd_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit direct flux - fabd_sun => surfalb_inst%fabd_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit direct flux - fabd_sha => surfalb_inst%fabd_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit direct flux - fabi => surfalb_inst%fabi_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by canopy per unit diffuse flux - fabi_sun => surfalb_inst%fabi_sun_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by sunlit canopy per unit diffuse flux - fabi_sha => surfalb_inst%fabi_sha_patch , & ! Output: [real(r8) (:,:) ] flux absorbed by shaded canopy per unit diffuse flux - ftdd => surfalb_inst%ftdd_patch , & ! Output: [real(r8) (:,:) ] down direct flux below canopy per unit direct flux - ftid => surfalb_inst%ftid_patch , & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit direct flux - ftii => surfalb_inst%ftii_patch , & ! Output: [real(r8) (:,:) ] down diffuse flux below canopy per unit diffuse flux - albgrd => surfalb_inst%albgrd_col , & ! Output: [real(r8) (:,:) ] urban col ground albedo (direct) - albgri => surfalb_inst%albgri_col , & ! Output: [real(r8) (:,:) ] urban col ground albedo (diffuse) - albd => surfalb_inst%albd_patch , & ! Output [real(r8) (:,:) ] urban pft surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Output: [real(r8) (:,:) ] urban pft surface albedo (diffuse) - - begl => bounds%begl , & - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road - vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall - endl => bounds%endl & - ) - - ! ---------------------------------------------------------------------------- - ! Solar declination and cosine solar zenith angle and zenith angle for - ! next time step - ! ---------------------------------------------------------------------------- - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - coszen(l) = surfalb_inst%coszen_col(coli(l)) ! Assumes coszen for each column are the same - zen(l) = acos(coszen(l)) - end do - - ! Initialize output because solar radiation only done if coszen > 0 - - do ib = 1, numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) - albgrd(c,ib) = 0._r8 - albgri(c,ib) = 0._r8 - end do - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - l = patch%landunit(p) - ! Setting albedos to wall and road view factors ensures that urban - ! albedo will scale up to 1.0 - c = patch%column(p) - if (col%itype(c) == icol_sunwall) then - albd(p,ib) = vf_sw(l) - albi(p,ib) = vf_sw(l) - else if (col%itype(c) == icol_shadewall) then - albd(p,ib) = vf_sw(l) - albi(p,ib) = vf_sw(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - albd(p,ib) = vf_sr(l) - albi(p,ib) = vf_sr(l) - else if (col%itype(c) == icol_roof) then - albd(p,ib) = 1._r8 - albi(p,ib) = 1._r8 - endif - fabd(p,ib) = 0._r8 - fabd_sun(p,ib) = 0._r8 - fabd_sha(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - fabi_sun(p,ib) = 0._r8 - fabi_sha(p,ib) = 0._r8 - if (coszen(l) > 0._r8) then - ftdd(p,ib) = 1._r8 - else - ftdd(p,ib) = 0._r8 - end if - ftid(p,ib) = 0._r8 - if (coszen(l) > 0._r8) then - ftii(p,ib) = 1._r8 - else - ftii(p,ib) = 0._r8 - end if - end do - end do - - ! ---------------------------------------------------------------------------- - ! Urban Code - ! ---------------------------------------------------------------------------- - - num_solar = 0 - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) num_solar = num_solar + 1 - end do - - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - sabs_roof_dir(l,ib) = 0._r8 - sabs_roof_dif(l,ib) = 0._r8 - sabs_sunwall_dir(l,ib) = 0._r8 - sabs_sunwall_dif(l,ib) = 0._r8 - sabs_shadewall_dir(l,ib) = 0._r8 - sabs_shadewall_dif(l,ib) = 0._r8 - sabs_improad_dir(l,ib) = 0._r8 - sabs_improad_dif(l,ib) = 0._r8 - sabs_perroad_dir(l,ib) = 0._r8 - sabs_perroad_dif(l,ib) = 0._r8 - sref_roof_dir(l,ib) = 1._r8 - sref_roof_dif(l,ib) = 1._r8 - ! Setting sref to wall and road view factors ensures that urban - ! albedo will scale up to 1.0 - sref_sunwall_dir(l,ib) = vf_sw(l) - sref_sunwall_dif(l,ib) = vf_sw(l) - sref_shadewall_dir(l,ib) = vf_sw(l) - sref_shadewall_dif(l,ib) = vf_sw(l) - sref_improad_dir(l,ib) = vf_sr(l) - sref_improad_dif(l,ib) = vf_sr(l) - sref_perroad_dir(l,ib) = vf_sr(l) - sref_perroad_dif(l,ib) = vf_sr(l) - end do - end do - - ! ---------------------------------------------------------------------------- - ! Only do the rest if all coszen are positive - ! ---------------------------------------------------------------------------- - - if (num_solar > 0)then - - ! Set constants - solar fluxes are per unit incoming flux - - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - sdir(l,ib) = 1._r8 - sdif(l,ib) = 1._r8 - end do - end do - - ! Incident direct beam radiation for - ! (a) roof and (b) road and both walls in urban canyon - - if (num_urbanl > 0) then - call incident_direct (bounds, & - num_urbanl, filter_urbanl, & - canyon_hwr(begl:endl), & - coszen(begl:endl), & - zen(begl:endl), & - sdir(begl:endl, :), & - sdir_road(begl:endl, :), & - sdir_sunwall(begl:endl, :), & - sdir_shadewall(begl:endl, :)) - end if - - ! Incident diffuse radiation for - ! (a) roof and (b) road and both walls in urban canyon. - - if (num_urbanl > 0) then - call incident_diffuse (bounds, & - num_urbanl, filter_urbanl, & - canyon_hwr(begl:endl), & - sdif(begl:endl, :), & - sdif_road(begl:endl, :), & - sdif_sunwall(begl:endl, :), & - sdif_shadewall(begl:endl, :), & - urbanparams_inst) - end if - - ! Get snow albedos for roof and impervious and pervious road - if (num_urbanl > 0) then - ic = 0 - call SnowAlbedo(bounds, & - num_urbanc, filter_urbanc, & - coszen(begl:endl), & - ic, & - albsnd_roof(begl:endl, :), & - albsnd_improad(begl:endl, :), & - albsnd_perroad(begl:endl, :), & - waterstate_inst) - - ic = 1 - call SnowAlbedo(bounds, & - num_urbanc, filter_urbanc, & - coszen(begl:endl), & - ic, & - albsni_roof(begl:endl, :), & - albsni_improad(begl:endl, :), & - albsni_perroad(begl:endl, :), & - waterstate_inst) - end if - - ! Combine snow-free and snow albedos - do ib = 1,numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - if (ctype(c) == icol_roof) then - alb_roof_dir_s(l,ib) = alb_roof_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_roof(l,ib)*frac_sno(c) - alb_roof_dif_s(l,ib) = alb_roof_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_roof(l,ib)*frac_sno(c) - else if (ctype(c) == icol_road_imperv) then - alb_improad_dir_s(l,ib) = alb_improad_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_improad(l,ib)*frac_sno(c) - alb_improad_dif_s(l,ib) = alb_improad_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_improad(l,ib)*frac_sno(c) - else if (ctype(c) == icol_road_perv) then - alb_perroad_dir_s(l,ib) = alb_perroad_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_perroad(l,ib)*frac_sno(c) - alb_perroad_dif_s(l,ib) = alb_perroad_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_perroad(l,ib)*frac_sno(c) - end if - end do - end do - - ! Reflected and absorbed solar radiation per unit incident radiation - ! for road and both walls in urban canyon allowing for multiple reflection - ! Reflected and absorbed solar radiation per unit incident radiation for roof - - if (num_urbanl > 0) then - call net_solar (bounds, & - num_urbanl, filter_urbanl, & - coszen (begl:endl), & - canyon_hwr (begl:endl), & - wtroad_perv (begl:endl), & - sdir (begl:endl, :), & - sdif (begl:endl, :), & - alb_improad_dir_s (begl:endl, :), & - alb_perroad_dir_s (begl:endl, :), & - alb_wall_dir (begl:endl, :), & - alb_roof_dir_s (begl:endl, :), & - alb_improad_dif_s (begl:endl, :), & - alb_perroad_dif_s (begl:endl, :), & - alb_wall_dif (begl:endl, :), & - alb_roof_dif_s (begl:endl, :), & - sdir_road (begl:endl, :), & - sdir_sunwall (begl:endl, :), & - sdir_shadewall (begl:endl, :), & - sdif_road (begl:endl, :), & - sdif_sunwall (begl:endl, :), & - sdif_shadewall (begl:endl, :), & - sref_improad_dir (begl:endl, :), & - sref_perroad_dir (begl:endl, :), & - sref_sunwall_dir (begl:endl, :), & - sref_shadewall_dir (begl:endl, :), & - sref_roof_dir (begl:endl, :), & - sref_improad_dif (begl:endl, :), & - sref_perroad_dif (begl:endl, :), & - sref_sunwall_dif (begl:endl, :), & - sref_shadewall_dif (begl:endl, :), & - sref_roof_dif (begl:endl, :), & - urbanparams_inst, solarabs_inst) - end if - - ! ---------------------------------------------------------------------------- - ! Map urban output to surfalb_inst components - ! ---------------------------------------------------------------------------- - - ! Set albgrd and albgri (ground albedos) and albd and albi (surface albedos) - - do ib = 1,numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - if (ctype(c) == icol_roof) then - albgrd(c,ib) = sref_roof_dir(l,ib) - albgri(c,ib) = sref_roof_dif(l,ib) - else if (ctype(c) == icol_sunwall) then - albgrd(c,ib) = sref_sunwall_dir(l,ib) - albgri(c,ib) = sref_sunwall_dif(l,ib) - else if (ctype(c) == icol_shadewall) then - albgrd(c,ib) = sref_shadewall_dir(l,ib) - albgri(c,ib) = sref_shadewall_dif(l,ib) - else if (ctype(c) == icol_road_perv) then - albgrd(c,ib) = sref_perroad_dir(l,ib) - albgri(c,ib) = sref_perroad_dif(l,ib) - else if (ctype(c) == icol_road_imperv) then - albgrd(c,ib) = sref_improad_dir(l,ib) - albgri(c,ib) = sref_improad_dif(l,ib) - endif - end do - do fp = 1,num_urbanp - p = filter_urbanp(fp) - c = patch%column(p) - albd(p,ib) = albgrd(c,ib) - albi(p,ib) = albgri(c,ib) - end do - end do - end if - - end associate - - end subroutine UrbanAlbedo - - !----------------------------------------------------------------------- - subroutine SnowAlbedo (bounds , & - num_urbanc, filter_urbanc, coszen, ind , & - albsn_roof, albsn_improad, albsn_perroad, & - waterstate_inst) - ! - ! !DESCRIPTION: - ! Determine urban snow albedos - ! - ! !USES: - use column_varcon, only : icol_roof, icol_road_perv, icol_road_imperv - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - integer , intent(in) :: ind ! 0=direct beam, 1=diffuse radiation - real(r8), intent(in) :: coszen ( bounds%begl: ) ! cosine solar zenith angle [landunit] - real(r8), intent(out):: albsn_roof ( bounds%begl: , 1: ) ! roof snow albedo by waveband [landunit, numrad] - real(r8), intent(out):: albsn_improad ( bounds%begl: , 1: ) ! impervious road snow albedo by waveband [landunit, numrad] - real(r8), intent(out):: albsn_perroad ( bounds%begl: , 1: ) ! pervious road snow albedo by waveband [landunit, numrad] - type(waterstate_type), intent(in) :: waterstate_inst - ! - ! !LOCAL VARIABLES: - integer :: fc,c,l ! indices - ! - ! These values are derived from Marshall (1989) assuming soot content of 1.5e-5 - ! (three times what LSM uses globally). Note that snow age effects are ignored here. - real(r8), parameter :: snal0 = 0.66_r8 ! vis albedo of urban snow - real(r8), parameter :: snal1 = 0.56_r8 ! nir albedo of urban snow - !----------------------------------------------------------------------- - - ! this code assumes that numrad = 2 , with the following - ! index values: 1 = visible, 2 = NIR - SHR_ASSERT_ALL(numrad == 2, errMsg(sourcefile, __LINE__)) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsn_roof) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsn_improad) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(albsn_perroad) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - - associate( & - h2osno => waterstate_inst%h2osno_col & ! Input: [real(r8) (:) ] snow water (mm H2O) - ) - - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - if (coszen(l) > 0._r8 .and. h2osno(c) > 0._r8) then - if (col%itype(c) == icol_roof) then - albsn_roof(l,1) = snal0 - albsn_roof(l,2) = snal1 - else if (col%itype(c) == icol_road_imperv) then - albsn_improad(l,1) = snal0 - albsn_improad(l,2) = snal1 - else if (col%itype(c) == icol_road_perv) then - albsn_perroad(l,1) = snal0 - albsn_perroad(l,2) = snal1 - end if - else - if (col%itype(c) == icol_roof) then - albsn_roof(l,1) = 0._r8 - albsn_roof(l,2) = 0._r8 - else if (col%itype(c) == icol_road_imperv) then - albsn_improad(l,1) = 0._r8 - albsn_improad(l,2) = 0._r8 - else if (col%itype(c) == icol_road_perv) then - albsn_perroad(l,1) = 0._r8 - albsn_perroad(l,2) = 0._r8 - end if - end if - end do - - end associate - - end subroutine SnowAlbedo - - !----------------------------------------------------------------------- - subroutine incident_direct (bounds , & - num_urbanl, filter_urbanl, canyon_hwr, coszen, zen , & - sdir, sdir_road, sdir_sunwall, sdir_shadewall) - ! - ! !DESCRIPTION: - ! Direct beam solar radiation incident on walls and road in urban canyon - ! - ! Sun - ! / - ! roof / - ! ------ /--- - - ! | / | | - ! sunlit wall | / | shaded wall h - ! | / | | - ! -----/----- - - ! road - ! <--- w ---> - ! - ! Method: - ! Road = Horizontal surface. Account for shading by wall. Integrate over all canyon orientations - ! Wall (sunlit) = Adjust horizontal radiation for 90 degree surface. Account for shading by opposing wall. - ! Integrate over all canyon orientations - ! Wall (shaded) = 0 - ! - ! Conservation check: Total incoming direct beam (sdir) = sdir_road + (sdir_shadewall + sdir_sunwall)*canyon_hwr - ! Multiplication by canyon_hwr scales wall fluxes (per unit wall area) to per unit ground area - ! - ! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in - ! atmospheric models. Boundary-Layer Meteorology 94:357-397 - ! - ! This analytical solution from Masson (2000) agrees with the numerical solution to - ! within 0.6 W/m**2 for sdir = 1000 W/m**2 and for all H/W from 0.1 to 10 by 0.1 - ! and all solar zenith angles from 1 to 90 deg by 1 - ! - ! !USES: - use clm_varcon, only : rpi - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8), intent(in) :: canyon_hwr( bounds%begl: ) ! ratio of building height to street width [landunit] - real(r8), intent(in) :: coszen( bounds%begl: ) ! cosine solar zenith angle [landunit] - real(r8), intent(in) :: zen( bounds%begl: ) ! solar zenith angle (radians) [landunit] - real(r8), intent(in) :: sdir( bounds%begl: , 1: ) ! direct beam solar radiation incident on horizontal surface [landunit, numrad] - real(r8), intent(out) :: sdir_road( bounds%begl: , 1: ) ! direct beam solar radiation incident on road per unit incident flux [landunit, numrad] - real(r8), intent(out) :: sdir_sunwall( bounds%begl: , 1: ) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux [landunit, numrad] - real(r8), intent(out) :: sdir_shadewall( bounds%begl: , 1: ) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux [landunit, numrad] - ! - ! !LOCAL VARIABLES: - integer :: fl,l,i,ib ! indices - logical :: numchk = .false. ! true => perform numerical check of analytical solution - real(r8) :: theta0(bounds%begl:bounds%endl) ! critical canyon orientation for which road is no longer illuminated - real(r8) :: tanzen(bounds%begl:bounds%endl) ! tan(zenith angle) - real(r8) :: swall_projected ! direct beam solar radiation (per unit ground area) incident on wall - real(r8) :: err1(bounds%begl:bounds%endl) ! energy conservation error - real(r8) :: err2(bounds%begl:bounds%endl) ! energy conservation error - real(r8) :: err3(bounds%begl:bounds%endl) ! energy conservation error - real(r8) :: sumr ! sum of sroad for each orientation (0 <= theta <= pi/2) - real(r8) :: sumw ! sum of swall for each orientation (0 <= theta <= pi/2) - real(r8) :: num ! number of orientations - real(r8) :: theta ! canyon orientation relative to sun (0 <= theta <= pi/2) - real(r8) :: zen0 ! critical solar zenith angle for which sun begins to illuminate road - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(canyon_hwr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(zen) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_road) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_sunwall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_shadewall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - theta0(l) = asin(min( (1._r8/(canyon_hwr(l)*tan(max(zen(l),0.000001_r8)))), 1._r8 )) - tanzen(l) = tan(zen(l)) - end if - end do - - do ib = 1,numrad - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - sdir_shadewall(l,ib) = 0._r8 - - ! incident solar radiation on wall and road integrated over all canyon orientations (0 <= theta <= pi/2) - - sdir_road(l,ib) = sdir(l,ib) * & - (2._r8*theta0(l)/rpi - 2./rpi*canyon_hwr(l)*tanzen(l)*(1._r8-cos(theta0(l)))) - sdir_sunwall(l,ib) = 2._r8 * sdir(l,ib) * ((1._r8/canyon_hwr(l))* & - (0.5_r8-theta0(l)/rpi) + (1._r8/rpi)*tanzen(l)*(1._r8-cos(theta0(l)))) - - ! conservation check for road and wall. need to use wall fluxes converted to ground area - - swall_projected = (sdir_shadewall(l,ib) + sdir_sunwall(l,ib)) * canyon_hwr(l) - err1(l) = sdir(l,ib) - (sdir_road(l,ib) + swall_projected) - else - sdir_road(l,ib) = 0._r8 - sdir_sunwall(l,ib) = 0._r8 - sdir_shadewall(l,ib) = 0._r8 - endif - end do - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - if (abs(err1(l)) > 0.001_r8) then - write (iulog,*) 'urban direct beam solar radiation balance error',err1(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - endif - end do - - ! numerical check of analytical solution - ! sum sroad and swall over all canyon orientations (0 <= theta <= pi/2) - - if (numchk) then - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - sumr = 0._r8 - sumw = 0._r8 - num = 0._r8 - do i = 1, 9000 - theta = i/100._r8 * rpi/180._r8 - zen0 = atan(1._r8/(canyon_hwr(l)*sin(theta))) - if (zen(l) >= zen0) then - sumr = sumr + 0._r8 - sumw = sumw + sdir(l,ib) / canyon_hwr(l) - else - sumr = sumr + sdir(l,ib) * (1._r8-canyon_hwr(l)*sin(theta)*tanzen(l)) - sumw = sumw + sdir(l,ib) * sin(theta)*tanzen(l) - end if - num = num + 1._r8 - end do - err2(l) = sumr/num - sdir_road(l,ib) - err3(l) = sumw/num - sdir_sunwall(l,ib) - endif - end do - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - if (abs(err2(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - if (abs(err3(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban wall incident direct beam solar radiation error',err3(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - end if - end do - end if - - end do - - end subroutine incident_direct - - !----------------------------------------------------------------------- - subroutine incident_diffuse (bounds, & - num_urbanl, filter_urbanl, canyon_hwr, & - sdif, sdif_road, sdif_sunwall, sdif_shadewall, & - urbanparams_inst) - ! - ! !DESCRIPTION: - ! Diffuse solar radiation incident on walls and road in urban canyon - ! Conservation check: Total incoming diffuse - ! (sdif) = sdif_road + (sdif_shadewall + sdif_sunwall)*canyon_hwr - ! Multiplication by canyon_hwr scales wall fluxes (per unit wall area) to per unit ground area - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8) , intent(in) :: canyon_hwr ( bounds%begl: ) ! ratio of building height to street width [landunit] - real(r8) , intent(in) :: sdif ( bounds%begl: , 1: ) ! diffuse solar radiation incident on horizontal surface [landunit, numrad] - real(r8) , intent(out) :: sdif_road ( bounds%begl: , 1: ) ! diffuse solar radiation incident on road [landunit, numrad] - real(r8) , intent(out) :: sdif_sunwall ( bounds%begl: , 1: ) ! diffuse solar radiation (per unit wall area) incident on sunlit wall [landunit, numrad] - real(r8) , intent(out) :: sdif_shadewall ( bounds%begl: , 1: ) ! diffuse solar radiation (per unit wall area) incident on shaded wall [landunit, numrad] - type(urbanparams_type), intent(in) :: urbanparams_inst - ! - ! !LOCAL VARIABLES: - integer :: l, fl, ib ! indices - real(r8) :: err(bounds%begl:bounds%endl) ! energy conservation error (W/m**2) - real(r8) :: swall_projected ! diffuse solar radiation (per unit ground area) incident on wall (W/m**2) - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(canyon_hwr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_road) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_sunwall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_shadewall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - - associate( & - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road - vf_sw => urbanparams_inst%vf_sw & ! Input: [real(r8) (:) ] view factor of sky for one wall - ) - - do ib = 1, numrad - - ! diffuse solar and conservation check. need to convert wall fluxes to ground area - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - sdif_road(l,ib) = sdif(l,ib) * vf_sr(l) - sdif_sunwall(l,ib) = sdif(l,ib) * vf_sw(l) - sdif_shadewall(l,ib) = sdif(l,ib) * vf_sw(l) - - swall_projected = (sdif_shadewall(l,ib) + sdif_sunwall(l,ib)) * canyon_hwr(l) - err(l) = sdif(l,ib) - (sdif_road(l,ib) + swall_projected) - end do - - ! error check - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - if (abs(err(l)) > 0.001_r8) then - write (iulog,*) 'urban diffuse solar radiation balance error',err(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - end do - - end do - - end associate - - end subroutine incident_diffuse - - !----------------------------------------------------------------------- - subroutine net_solar (bounds , & - num_urbanl, filter_urbanl, coszen, canyon_hwr, wtroad_perv, sdir, sdif , & - alb_improad_dir, alb_perroad_dir, alb_wall_dir, alb_roof_dir , & - alb_improad_dif, alb_perroad_dif, alb_wall_dif, alb_roof_dif , & - sdir_road, sdir_sunwall, sdir_shadewall, & - sdif_road, sdif_sunwall, sdif_shadewall, & - sref_improad_dir, sref_perroad_dir, sref_sunwall_dir, sref_shadewall_dir, sref_roof_dir , & - sref_improad_dif, sref_perroad_dif, sref_sunwall_dif, sref_shadewall_dif, sref_roof_dif , & - urbanparams_inst, solarabs_inst) - ! - ! !DESCRIPTION: - ! Solar radiation absorbed by road and both walls in urban canyon allowing - ! for multiple reflection. - ! - ! !ARGUMENTS: - type (bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8), intent(in) :: coszen ( bounds%begl: ) ! cosine solar zenith angle [landunit] - real(r8), intent(in) :: canyon_hwr ( bounds%begl: ) ! ratio of building height to street width [landunit] - real(r8), intent(in) :: wtroad_perv ( bounds%begl: ) ! weight of pervious road wrt total road [landunit] - real(r8), intent(in) :: sdir ( bounds%begl: , 1: ) ! direct beam solar radiation incident on horizontal surface [landunit, numrad] - real(r8), intent(in) :: sdif ( bounds%begl: , 1: ) ! diffuse solar radiation on horizontal surface [landunit, numrad] - real(r8), intent(in) :: alb_improad_dir ( bounds%begl: , 1: ) ! direct impervious road albedo [landunit, numrad] - real(r8), intent(in) :: alb_perroad_dir ( bounds%begl: , 1: ) ! direct pervious road albedo [landunit, numrad] - real(r8), intent(in) :: alb_wall_dir ( bounds%begl: , 1: ) ! direct wall albedo [landunit, numrad] - real(r8), intent(in) :: alb_roof_dir ( bounds%begl: , 1: ) ! direct roof albedo [landunit, numrad] - real(r8), intent(in) :: alb_improad_dif ( bounds%begl: , 1: ) ! diffuse impervious road albedo [landunit, numrad] - real(r8), intent(in) :: alb_perroad_dif ( bounds%begl: , 1: ) ! diffuse pervious road albedo [landunit, numrad] - real(r8), intent(in) :: alb_wall_dif ( bounds%begl: , 1: ) ! diffuse wall albedo [landunit, numrad] - real(r8), intent(in) :: alb_roof_dif ( bounds%begl: , 1: ) ! diffuse roof albedo [landunit, numrad] - real(r8), intent(in) :: sdir_road ( bounds%begl: , 1: ) ! direct beam solar radiation incident on road per unit incident flux [landunit, numrad] - real(r8), intent(in) :: sdir_sunwall ( bounds%begl: , 1: ) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux [landunit, numrad] - real(r8), intent(in) :: sdir_shadewall ( bounds%begl: , 1: ) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux [landunit, numrad] - real(r8), intent(in) :: sdif_road ( bounds%begl: , 1: ) ! diffuse solar radiation incident on road per unit incident flux [landunit, numrad] - real(r8), intent(in) :: sdif_sunwall ( bounds%begl: , 1: ) ! diffuse solar radiation (per unit wall area) incident on sunlit wall per unit incident flux [landunit, numrad] - real(r8), intent(in) :: sdif_shadewall ( bounds%begl: , 1: ) ! diffuse solar radiation (per unit wall area) incident on shaded wall per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_improad_dir ( bounds%begl: , 1: ) ! direct solar rad reflected by impervious road (per unit ground area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_perroad_dir ( bounds%begl: , 1: ) ! direct solar rad reflected by pervious road (per unit ground area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_improad_dif ( bounds%begl: , 1: ) ! diffuse solar rad reflected by impervious road (per unit ground area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_perroad_dif ( bounds%begl: , 1: ) ! diffuse solar rad reflected by pervious road (per unit ground area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_sunwall_dir ( bounds%begl: , 1: ) ! direct solar rad reflected by sunwall (per unit wall area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_sunwall_dif ( bounds%begl: , 1: ) ! diffuse solar rad reflected by sunwall (per unit wall area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_shadewall_dir ( bounds%begl: , 1: ) ! direct solar rad reflected by shadewall (per unit wall area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_shadewall_dif ( bounds%begl: , 1: ) ! diffuse solar rad reflected by shadewall (per unit wall area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_roof_dir ( bounds%begl: , 1: ) ! direct solar rad reflected by roof (per unit ground area) per unit incident flux [landunit, numrad] - real(r8), intent(inout) :: sref_roof_dif ( bounds%begl: , 1: ) ! diffuse solar rad reflected by roof (per unit ground area) per unit incident flux [landunit, numrad] - type(urbanparams_type), intent(in) :: urbanparams_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - ! - ! !LOCAL VARIABLES - real(r8) :: wtroad_imperv(bounds%begl:bounds%endl) ! weight of impervious road wrt total road - real(r8) :: sabs_canyon_dir(bounds%begl:bounds%endl) ! direct solar rad absorbed by canyon per unit incident flux - real(r8) :: sabs_canyon_dif(bounds%begl:bounds%endl) ! diffuse solar rad absorbed by canyon per unit incident flux - real(r8) :: sref_canyon_dir(bounds%begl:bounds%endl) ! direct solar reflected by canyon per unit incident flux - real(r8) :: sref_canyon_dif(bounds%begl:bounds%endl) ! diffuse solar reflected by canyon per unit incident flux - - real(r8) :: improad_a_dir(bounds%begl:bounds%endl) ! absorbed direct solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_a_dif(bounds%begl:bounds%endl) ! absorbed diffuse solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_dir(bounds%begl:bounds%endl) ! reflected direct solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_dif(bounds%begl:bounds%endl) ! reflected diffuse solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_sky_dir(bounds%begl:bounds%endl) ! improad_r_dir to sky per unit incident flux - real(r8) :: improad_r_sunwall_dir(bounds%begl:bounds%endl) ! improad_r_dir to sunlit wall per unit incident flux - real(r8) :: improad_r_shadewall_dir(bounds%begl:bounds%endl) ! improad_r_dir to shaded wall per unit incident flux - real(r8) :: improad_r_sky_dif(bounds%begl:bounds%endl) ! improad_r_dif to sky per unit incident flux - real(r8) :: improad_r_sunwall_dif(bounds%begl:bounds%endl) ! improad_r_dif to sunlit wall per unit incident flux - real(r8) :: improad_r_shadewall_dif(bounds%begl:bounds%endl) ! improad_r_dif to shaded wall per unit incident flux - - real(r8) :: perroad_a_dir(bounds%begl:bounds%endl) ! absorbed direct solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_a_dif(bounds%begl:bounds%endl) ! absorbed diffuse solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_dir(bounds%begl:bounds%endl) ! reflected direct solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_dif(bounds%begl:bounds%endl) ! reflected diffuse solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_sky_dir(bounds%begl:bounds%endl) ! perroad_r_dir to sky per unit incident flux - real(r8) :: perroad_r_sunwall_dir(bounds%begl:bounds%endl) ! perroad_r_dir to sunlit wall per unit incident flux - real(r8) :: perroad_r_shadewall_dir(bounds%begl:bounds%endl) ! perroad_r_dir to shaded wall per unit incident flux - real(r8) :: perroad_r_sky_dif(bounds%begl:bounds%endl) ! perroad_r_dif to sky per unit incident flux - real(r8) :: perroad_r_sunwall_dif(bounds%begl:bounds%endl) ! perroad_r_dif to sunlit wall per unit incident flux - real(r8) :: perroad_r_shadewall_dif(bounds%begl:bounds%endl) ! perroad_r_dif to shaded wall per unit incident flux - - real(r8) :: road_a_dir(bounds%begl:bounds%endl) ! absorbed direct solar for total road after "n" reflections per unit incident flux - real(r8) :: road_a_dif(bounds%begl:bounds%endl) ! absorbed diffuse solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_dir(bounds%begl:bounds%endl) ! reflected direct solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_dif(bounds%begl:bounds%endl) ! reflected diffuse solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_sky_dir(bounds%begl:bounds%endl) ! road_r_dir to sky per unit incident flux - real(r8) :: road_r_sunwall_dir(bounds%begl:bounds%endl) ! road_r_dir to sunlit wall per unit incident flux - real(r8) :: road_r_shadewall_dir(bounds%begl:bounds%endl) ! road_r_dir to shaded wall per unit incident flux - real(r8) :: road_r_sky_dif(bounds%begl:bounds%endl) ! road_r_dif to sky per unit incident flux - real(r8) :: road_r_sunwall_dif(bounds%begl:bounds%endl) ! road_r_dif to sunlit wall per unit incident flux - real(r8) :: road_r_shadewall_dif(bounds%begl:bounds%endl) ! road_r_dif to shaded wall per unit incident flux - - real(r8) :: sunwall_a_dir(bounds%begl:bounds%endl) ! absorbed direct solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_a_dif(bounds%begl:bounds%endl) ! absorbed diffuse solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_dir(bounds%begl:bounds%endl) ! reflected direct solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_dif(bounds%begl:bounds%endl) ! reflected diffuse solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_sky_dir(bounds%begl:bounds%endl) ! sunwall_r_dir to sky per unit incident flux - real(r8) :: sunwall_r_road_dir(bounds%begl:bounds%endl) ! sunwall_r_dir to road per unit incident flux - real(r8) :: sunwall_r_shadewall_dir(bounds%begl:bounds%endl) ! sunwall_r_dir to opposing (shaded) wall per unit incident flux - real(r8) :: sunwall_r_sky_dif(bounds%begl:bounds%endl) ! sunwall_r_dif to sky per unit incident flux - real(r8) :: sunwall_r_road_dif(bounds%begl:bounds%endl) ! sunwall_r_dif to road per unit incident flux - real(r8) :: sunwall_r_shadewall_dif(bounds%begl:bounds%endl) ! sunwall_r_dif to opposing (shaded) wall per unit incident flux - - real(r8) :: shadewall_a_dir(bounds%begl:bounds%endl) ! absorbed direct solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_a_dif(bounds%begl:bounds%endl) ! absorbed diffuse solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_dir(bounds%begl:bounds%endl) ! reflected direct solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_dif(bounds%begl:bounds%endl) ! reflected diffuse solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_sky_dir(bounds%begl:bounds%endl) ! shadewall_r_dir to sky per unit incident flux - real(r8) :: shadewall_r_road_dir(bounds%begl:bounds%endl) ! shadewall_r_dir to road per unit incident flux - real(r8) :: shadewall_r_sunwall_dir(bounds%begl:bounds%endl) ! shadewall_r_dir to opposing (sunlit) wall per unit incident flux - real(r8) :: shadewall_r_sky_dif(bounds%begl:bounds%endl) ! shadewall_r_dif to sky per unit incident flux - real(r8) :: shadewall_r_road_dif(bounds%begl:bounds%endl) ! shadewall_r_dif to road per unit incident flux - real(r8) :: shadewall_r_sunwall_dif(bounds%begl:bounds%endl) ! shadewall_r_dif to opposing (sunlit) wall per unit incident flux - - real(r8) :: canyon_alb_dir(bounds%begl:bounds%endl) ! direct canyon albedo - real(r8) :: canyon_alb_dif(bounds%begl:bounds%endl) ! diffuse canyon albedo - - real(r8) :: stot(bounds%begl:bounds%endl) ! sum of radiative terms - real(r8) :: stot_dir(bounds%begl:bounds%endl) ! sum of direct radiative terms - real(r8) :: stot_dif(bounds%begl:bounds%endl) ! sum of diffuse radiative terms - - integer :: l,fl,ib ! indices - integer :: iter_dir,iter_dif ! iteration counter - real(r8) :: crit ! convergence criterion - real(r8) :: err ! energy conservation error - integer :: pass - integer, parameter :: n = 50 ! number of interations - real(r8) :: sabs_road ! temporary for absorption over road - real(r8) :: sref_road ! temporary for reflected over road - real(r8), parameter :: errcrit = .00001_r8 ! error criteria - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(coszen) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(canyon_hwr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wtroad_perv) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_improad_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_perroad_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_wall_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_roof_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_improad_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_perroad_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_wall_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(alb_roof_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_road) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_sunwall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdir_shadewall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_road) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_sunwall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sdif_shadewall) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_improad_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_perroad_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_improad_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_perroad_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_sunwall_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_sunwall_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_shadewall_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_shadewall_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_roof_dir) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sref_roof_dif) == (/bounds%endl, numrad/)), errMsg(sourcefile, __LINE__)) - - associate( & - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road - vf_wr => urbanparams_inst%vf_wr , & ! Input: [real(r8) (:) ] view factor of one wall for road - vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall - vf_rw => urbanparams_inst%vf_rw , & ! Input: [real(r8) (:) ] view factor of road for one wall - vf_ww => urbanparams_inst%vf_ww , & ! Input: [real(r8) (:) ] view factor of opposing wall for one wall - - sabs_roof_dir => solarabs_inst%sabs_roof_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by roof per unit ground area per unit incident flux - sabs_roof_dif => solarabs_inst%sabs_roof_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by roof per unit ground area per unit incident flux - sabs_sunwall_dir => solarabs_inst%sabs_sunwall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by sunwall per unit wall area per unit incident flux - sabs_sunwall_dif => solarabs_inst%sabs_sunwall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by sunwall per unit wall area per unit incident flux - sabs_shadewall_dir => solarabs_inst%sabs_shadewall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by shadewall per unit wall area per unit incident flux - sabs_shadewall_dif => solarabs_inst%sabs_shadewall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by shadewall per unit wall area per unit incident flux - sabs_improad_dir => solarabs_inst%sabs_improad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by impervious road per unit ground area per unit incident flux - sabs_improad_dif => solarabs_inst%sabs_improad_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by impervious road per unit ground area per unit incident flux - sabs_perroad_dir => solarabs_inst%sabs_perroad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by pervious road per unit ground area per unit incident flux - sabs_perroad_dif => solarabs_inst%sabs_perroad_dif_lun & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by pervious road per unit ground area per unit incident flux - ) - - ! Calculate impervious road - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - wtroad_imperv(l) = 1._r8 - wtroad_perv(l) - end do - - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - - ! initial absorption and reflection for road and both walls. - ! distribute reflected radiation to sky, road, and walls - ! according to appropriate view factor. radiation reflected to - ! road and walls will undergo multiple reflections within the canyon. - ! do separately for direct beam and diffuse radiation. - - ! direct beam - - road_a_dir(l) = 0.0_r8 - road_r_dir(l) = 0.0_r8 - improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * sdir_road(l,ib) - improad_r_dir(l) = alb_improad_dir(l,ib) * sdir_road(l,ib) - improad_r_sky_dir(l) = improad_r_dir(l) * vf_sr(l) - improad_r_sunwall_dir(l) = improad_r_dir(l) * vf_wr(l) - improad_r_shadewall_dir(l) = improad_r_dir(l) * vf_wr(l) - road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) - road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) - - perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * sdir_road(l,ib) - perroad_r_dir(l) = alb_perroad_dir(l,ib) * sdir_road(l,ib) - perroad_r_sky_dir(l) = perroad_r_dir(l) * vf_sr(l) - perroad_r_sunwall_dir(l) = perroad_r_dir(l) * vf_wr(l) - perroad_r_shadewall_dir(l) = perroad_r_dir(l) * vf_wr(l) - road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) - road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) - - road_r_sky_dir(l) = road_r_dir(l) * vf_sr(l) - road_r_sunwall_dir(l) = road_r_dir(l) * vf_wr(l) - road_r_shadewall_dir(l) = road_r_dir(l) * vf_wr(l) - - sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_sunwall(l,ib) - sunwall_r_dir(l) = alb_wall_dir(l,ib) * sdir_sunwall(l,ib) - sunwall_r_sky_dir(l) = sunwall_r_dir(l) * vf_sw(l) - sunwall_r_road_dir(l) = sunwall_r_dir(l) * vf_rw(l) - sunwall_r_shadewall_dir(l) = sunwall_r_dir(l) * vf_ww(l) - - shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_shadewall(l,ib) - shadewall_r_dir(l) = alb_wall_dir(l,ib) * sdir_shadewall(l,ib) - shadewall_r_sky_dir(l) = shadewall_r_dir(l) * vf_sw(l) - shadewall_r_road_dir(l) = shadewall_r_dir(l) * vf_rw(l) - shadewall_r_sunwall_dir(l) = shadewall_r_dir(l) * vf_ww(l) - - ! diffuse - - road_a_dif(l) = 0.0_r8 - road_r_dif(l) = 0.0_r8 - improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * sdif_road(l,ib) - improad_r_dif(l) = alb_improad_dif(l,ib) * sdif_road(l,ib) - improad_r_sky_dif(l) = improad_r_dif(l) * vf_sr(l) - improad_r_sunwall_dif(l) = improad_r_dif(l) * vf_wr(l) - improad_r_shadewall_dif(l) = improad_r_dif(l) * vf_wr(l) - road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) - road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) - - perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * sdif_road(l,ib) - perroad_r_dif(l) = alb_perroad_dif(l,ib) * sdif_road(l,ib) - perroad_r_sky_dif(l) = perroad_r_dif(l) * vf_sr(l) - perroad_r_sunwall_dif(l) = perroad_r_dif(l) * vf_wr(l) - perroad_r_shadewall_dif(l) = perroad_r_dif(l) * vf_wr(l) - road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) - road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) - - road_r_sky_dif(l) = road_r_dif(l) * vf_sr(l) - road_r_sunwall_dif(l) = road_r_dif(l) * vf_wr(l) - road_r_shadewall_dif(l) = road_r_dif(l) * vf_wr(l) - - sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_sunwall(l,ib) - sunwall_r_dif(l) = alb_wall_dif(l,ib) * sdif_sunwall(l,ib) - sunwall_r_sky_dif(l) = sunwall_r_dif(l) * vf_sw(l) - sunwall_r_road_dif(l) = sunwall_r_dif(l) * vf_rw(l) - sunwall_r_shadewall_dif(l) = sunwall_r_dif(l) * vf_ww(l) - - shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_shadewall(l,ib) - shadewall_r_dif(l) = alb_wall_dif(l,ib) * sdif_shadewall(l,ib) - shadewall_r_sky_dif(l) = shadewall_r_dif(l) * vf_sw(l) - shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) - shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) - - ! initialize sum of direct and diffuse solar absorption and reflection for road and both walls - - sabs_improad_dir(l,ib) = improad_a_dir(l) - sabs_perroad_dir(l,ib) = perroad_a_dir(l) - sabs_sunwall_dir(l,ib) = sunwall_a_dir(l) - sabs_shadewall_dir(l,ib) = shadewall_a_dir(l) - - sabs_improad_dif(l,ib) = improad_a_dif(l) - sabs_perroad_dif(l,ib) = perroad_a_dif(l) - sabs_sunwall_dif(l,ib) = sunwall_a_dif(l) - sabs_shadewall_dif(l,ib) = shadewall_a_dif(l) - - sref_improad_dir(l,ib) = improad_r_sky_dir(l) - sref_perroad_dir(l,ib) = perroad_r_sky_dir(l) - sref_sunwall_dir(l,ib) = sunwall_r_sky_dir(l) - sref_shadewall_dir(l,ib) = shadewall_r_sky_dir(l) - - sref_improad_dif(l,ib) = improad_r_sky_dif(l) - sref_perroad_dif(l,ib) = perroad_r_sky_dif(l) - sref_sunwall_dif(l,ib) = sunwall_r_sky_dif(l) - sref_shadewall_dif(l,ib) = shadewall_r_sky_dif(l) - endif - - end do - - ! absorption and reflection for walls and road with multiple reflections - ! (i.e., absorb and reflect initial reflection in canyon and allow for - ! subsequent scattering) - ! - ! (1) absorption and reflection of scattered solar radiation - ! road: reflected fluxes from walls need to be projected to ground area - ! wall: reflected flux from road needs to be projected to wall area - ! - ! (2) add absorbed radiation for ith reflection to total absorbed - ! - ! (3) distribute reflected radiation to sky, road, and walls according to view factors - ! - ! (4) add solar reflection to sky for ith reflection to total reflection - ! - ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. - ! small convergence criteria is required to ensure solar radiation is conserved - ! - ! do separately for direct beam and diffuse - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - - ! reflected direct beam - - do iter_dir = 1, n - ! step (1) - - stot(l) = (sunwall_r_road_dir(l) + shadewall_r_road_dir(l))*canyon_hwr(l) - - road_a_dir(l) = 0.0_r8 - road_r_dir(l) = 0.0_r8 - improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * stot(l) - improad_r_dir(l) = alb_improad_dir(l,ib) * stot(l) - road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) - road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) - perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * stot(l) - perroad_r_dir(l) = alb_perroad_dir(l,ib) * stot(l) - road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) - road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) - - stot(l) = road_r_sunwall_dir(l)/canyon_hwr(l) + shadewall_r_sunwall_dir(l) - sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) - sunwall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) - - stot(l) = road_r_shadewall_dir(l)/canyon_hwr(l) + sunwall_r_shadewall_dir(l) - shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) - shadewall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) - - ! step (2) - - sabs_improad_dir(l,ib) = sabs_improad_dir(l,ib) + improad_a_dir(l) - sabs_perroad_dir(l,ib) = sabs_perroad_dir(l,ib) + perroad_a_dir(l) - sabs_sunwall_dir(l,ib) = sabs_sunwall_dir(l,ib) + sunwall_a_dir(l) - sabs_shadewall_dir(l,ib) = sabs_shadewall_dir(l,ib) + shadewall_a_dir(l) - - ! step (3) - - improad_r_sky_dir(l) = improad_r_dir(l) * vf_sr(l) - improad_r_sunwall_dir(l) = improad_r_dir(l) * vf_wr(l) - improad_r_shadewall_dir(l) = improad_r_dir(l) * vf_wr(l) - - perroad_r_sky_dir(l) = perroad_r_dir(l) * vf_sr(l) - perroad_r_sunwall_dir(l) = perroad_r_dir(l) * vf_wr(l) - perroad_r_shadewall_dir(l) = perroad_r_dir(l) * vf_wr(l) - - road_r_sky_dir(l) = road_r_dir(l) * vf_sr(l) - road_r_sunwall_dir(l) = road_r_dir(l) * vf_wr(l) - road_r_shadewall_dir(l) = road_r_dir(l) * vf_wr(l) - - sunwall_r_sky_dir(l) = sunwall_r_dir(l) * vf_sw(l) - sunwall_r_road_dir(l) = sunwall_r_dir(l) * vf_rw(l) - sunwall_r_shadewall_dir(l) = sunwall_r_dir(l) * vf_ww(l) - - shadewall_r_sky_dir(l) = shadewall_r_dir(l) * vf_sw(l) - shadewall_r_road_dir(l) = shadewall_r_dir(l) * vf_rw(l) - shadewall_r_sunwall_dir(l) = shadewall_r_dir(l) * vf_ww(l) - - ! step (4) - - sref_improad_dir(l,ib) = sref_improad_dir(l,ib) + improad_r_sky_dir(l) - sref_perroad_dir(l,ib) = sref_perroad_dir(l,ib) + perroad_r_sky_dir(l) - sref_sunwall_dir(l,ib) = sref_sunwall_dir(l,ib) + sunwall_r_sky_dir(l) - sref_shadewall_dir(l,ib) = sref_shadewall_dir(l,ib) + shadewall_r_sky_dir(l) - - ! step (5) - - crit = max(road_a_dir(l), sunwall_a_dir(l), shadewall_a_dir(l)) - if (crit < errcrit) exit - end do - if (iter_dir >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, direct beam' - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - - ! reflected diffuse - - do iter_dif = 1, n - ! step (1) - - stot(l) = (sunwall_r_road_dif(l) + shadewall_r_road_dif(l))*canyon_hwr(l) - road_a_dif(l) = 0.0_r8 - road_r_dif(l) = 0.0_r8 - improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * stot(l) - improad_r_dif(l) = alb_improad_dif(l,ib) * stot(l) - road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) - road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) - perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * stot(l) - perroad_r_dif(l) = alb_perroad_dif(l,ib) * stot(l) - road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) - road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) - - stot(l) = road_r_sunwall_dif(l)/canyon_hwr(l) + shadewall_r_sunwall_dif(l) - sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) - sunwall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) - - stot(l) = road_r_shadewall_dif(l)/canyon_hwr(l) + sunwall_r_shadewall_dif(l) - shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) - shadewall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) - - ! step (2) - - sabs_improad_dif(l,ib) = sabs_improad_dif(l,ib) + improad_a_dif(l) - sabs_perroad_dif(l,ib) = sabs_perroad_dif(l,ib) + perroad_a_dif(l) - sabs_sunwall_dif(l,ib) = sabs_sunwall_dif(l,ib) + sunwall_a_dif(l) - sabs_shadewall_dif(l,ib) = sabs_shadewall_dif(l,ib) + shadewall_a_dif(l) - - ! step (3) - - improad_r_sky_dif(l) = improad_r_dif(l) * vf_sr(l) - improad_r_sunwall_dif(l) = improad_r_dif(l) * vf_wr(l) - improad_r_shadewall_dif(l) = improad_r_dif(l) * vf_wr(l) - - perroad_r_sky_dif(l) = perroad_r_dif(l) * vf_sr(l) - perroad_r_sunwall_dif(l) = perroad_r_dif(l) * vf_wr(l) - perroad_r_shadewall_dif(l) = perroad_r_dif(l) * vf_wr(l) - - road_r_sky_dif(l) = road_r_dif(l) * vf_sr(l) - road_r_sunwall_dif(l) = road_r_dif(l) * vf_wr(l) - road_r_shadewall_dif(l) = road_r_dif(l) * vf_wr(l) - - sunwall_r_sky_dif(l) = sunwall_r_dif(l) * vf_sw(l) - sunwall_r_road_dif(l) = sunwall_r_dif(l) * vf_rw(l) - sunwall_r_shadewall_dif(l) = sunwall_r_dif(l) * vf_ww(l) - - shadewall_r_sky_dif(l) = shadewall_r_dif(l) * vf_sw(l) - shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) - shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) - - ! step (4) - - sref_improad_dif(l,ib) = sref_improad_dif(l,ib) + improad_r_sky_dif(l) - sref_perroad_dif(l,ib) = sref_perroad_dif(l,ib) + perroad_r_sky_dif(l) - sref_sunwall_dif(l,ib) = sref_sunwall_dif(l,ib) + sunwall_r_sky_dif(l) - sref_shadewall_dif(l,ib) = sref_shadewall_dif(l,ib) + shadewall_r_sky_dif(l) - - ! step (5) - - crit = max(road_a_dif(l), sunwall_a_dif(l), shadewall_a_dif(l)) - if (crit < errcrit) exit - end do - if (iter_dif >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, diffuse' - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - - ! total reflected by canyon - sum of solar reflection to sky from canyon. - ! project wall fluxes to horizontal surface - - sref_canyon_dir(l) = 0.0_r8 - sref_canyon_dif(l) = 0.0_r8 - sref_canyon_dir(l) = sref_canyon_dir(l) + sref_improad_dir(l,ib)*wtroad_imperv(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + sref_improad_dif(l,ib)*wtroad_imperv(l) - sref_canyon_dir(l) = sref_canyon_dir(l) + sref_perroad_dir(l,ib)*wtroad_perv(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + sref_perroad_dif(l,ib)*wtroad_perv(l) - sref_canyon_dir(l) = sref_canyon_dir(l) + (sref_sunwall_dir(l,ib) + sref_shadewall_dir(l,ib))*canyon_hwr(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + (sref_sunwall_dif(l,ib) + sref_shadewall_dif(l,ib))*canyon_hwr(l) - - ! total absorbed by canyon. project wall fluxes to horizontal surface - - sabs_canyon_dir(l) = 0.0_r8 - sabs_canyon_dif(l) = 0.0_r8 - sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_improad_dir(l,ib)*wtroad_imperv(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_improad_dif(l,ib)*wtroad_imperv(l) - sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_perroad_dir(l,ib)*wtroad_perv(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_perroad_dif(l,ib)*wtroad_perv(l) - sabs_canyon_dir(l) = sabs_canyon_dir(l) + (sabs_sunwall_dir(l,ib) + sabs_shadewall_dir(l,ib))*canyon_hwr(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + (sabs_sunwall_dif(l,ib) + sabs_shadewall_dif(l,ib))*canyon_hwr(l) - - ! conservation check. note: previous conservation checks confirm partioning of total direct - ! beam and diffuse radiation from atmosphere to road and walls is conserved as - ! sdir (from atmosphere) = sdir_road + (sdir_sunwall + sdir_shadewall)*canyon_hwr - ! sdif (from atmosphere) = sdif_road + (sdif_sunwall + sdif_shadewall)*canyon_hwr - - stot_dir(l) = sdir_road(l,ib) + (sdir_sunwall(l,ib) + sdir_shadewall(l,ib))*canyon_hwr(l) - stot_dif(l) = sdif_road(l,ib) + (sdif_sunwall(l,ib) + sdif_shadewall(l,ib))*canyon_hwr(l) - - err = stot_dir(l) + stot_dif(l) & - - (sabs_canyon_dir(l) + sabs_canyon_dif(l) + sref_canyon_dir(l) + sref_canyon_dif(l)) - if (abs(err) > 0.001_r8 ) then - write(iulog,*)'urban net solar radiation balance error for ib=',ib,' err= ',err - write(iulog,*)' l= ',l,' ib= ',ib - write(iulog,*)' stot_dir = ',stot_dir(l) - write(iulog,*)' stot_dif = ',stot_dif(l) - write(iulog,*)' sabs_canyon_dir = ',sabs_canyon_dir(l) - write(iulog,*)' sabs_canyon_dif = ',sabs_canyon_dif(l) - write(iulog,*)' sref_canyon_dir = ',sref_canyon_dir(l) - write(iulog,*)' sref_canyon_dif = ',sref_canyon_dir(l) - write(iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - - ! canyon albedo - - canyon_alb_dif(l) = sref_canyon_dif(l) / max(stot_dif(l), 1.e-06_r8) - canyon_alb_dir(l) = sref_canyon_dir(l) / max(stot_dir(l), 1.e-06_r8) - end if - - end do ! end of landunit loop - - ! Refected and absorbed solar radiation per unit incident radiation for roof - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - sref_roof_dir(l,ib) = alb_roof_dir(l,ib) * sdir(l,ib) - sref_roof_dif(l,ib) = alb_roof_dif(l,ib) * sdif(l,ib) - sabs_roof_dir(l,ib) = sdir(l,ib) - sref_roof_dir(l,ib) - sabs_roof_dif(l,ib) = sdif(l,ib) - sref_roof_dif(l,ib) - end if - end do - - end do ! end of radiation band loop - - end associate - - end subroutine net_solar - -end module UrbanAlbedoMod - diff --git a/src/biogeophys/UrbanFluxesMod.F90 b/src/biogeophys/UrbanFluxesMod.F90 deleted file mode 100644 index 0a9702f295..0000000000 --- a/src/biogeophys/UrbanFluxesMod.F90 +++ /dev/null @@ -1,1115 +0,0 @@ -module UrbanFluxesMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate solar and longwave radiation, and turbulent fluxes for urban landunit - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : numrad - use clm_varcon , only : isecspday, degpsec, namel - use clm_varctl , only : iulog - use abortutils , only : endrun - use UrbanParamsType , only : urbanparams_type - use UrbanParamsType , only : urban_wasteheat_on, urban_hac_on, urban_hac - use UrbanParamsType , only : IsSimpleBuildTemp - use atm2lndType , only : atm2lnd_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use FrictionVelocityMod , only : frictionvel_type - use EnergyFluxType , only : energyflux_type - use WaterfluxType , only : waterflux_type - use HumanIndexMod , only : humanindex_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanFluxes ! Urban physics - turbulent fluxes - !----------------------------------------------------------------------- - - ! !PRIVATE FUNCTIONS: - private :: wasteheat ! Figure out the energy flux from urban heating and cooling - private :: simple_wasteheatfromac ! Calculate waste heat from air-conditioning with the simpler method (CLM4.5) - private :: calc_simple_internal_building_temp ! Calculate internal building temperature by simpler method (CLM4.5) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine UrbanFluxes (bounds, num_nourbanl, filter_nourbanl, & - num_urbanl, filter_urbanl, num_urbanc, filter_urbanc, num_urbanp, filter_urbanp, & - atm2lnd_inst, urbanparams_inst, soilstate_inst, temperature_inst, & - waterstate_inst, frictionvel_inst, energyflux_inst, waterflux_inst, & - humanindex_inst) - ! - ! !DESCRIPTION: - ! Turbulent and momentum fluxes from urban canyon (consisting of roof, sunwall, - ! shadewall, pervious and impervious road). - - ! !USES: - use clm_varcon , only : cpair, vkc, spval, grav, pondmx_urban, rpi, rgas - use clm_varcon , only : ht_wasteheat_factor, ac_wasteheat_factor, wasteheat_limit - use column_varcon , only : icol_shadewall, icol_road_perv, icol_road_imperv - use column_varcon , only : icol_roof, icol_sunwall - use filterMod , only : filter - use FrictionVelocityMod , only : FrictionVelocity, MoninObukIni, frictionvel_parms_inst - use QSatMod , only : QSat - use clm_varpar , only : maxpatch_urb, nlevurb, nlevgrnd - use clm_time_manager , only : get_curr_date, get_step_size, get_nstep - use HumanIndexMod , only : calc_human_stress_indices, Wet_Bulb, Wet_BulbS, HeatIndex, AppTemp, & - swbgt, hmdex, dis_coi, dis_coiS, THIndex, & - SwampCoolEff, KtoC, VaporPres - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nourbanl ! number of non-urban landunits in clump - integer , intent(in) :: filter_nourbanl(:) ! non-urban landunit filter - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban patches in clump - integer , intent(in) :: filter_urbanp(:) ! urban pft filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(humanindex_type) , intent(inout) :: humanindex_inst - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: sub="UrbanFluxes" - integer :: fp,fc,fl,f,p,c,l,g,j,pi,i ! indices - - real(r8) :: canyontop_wind(bounds%begl:bounds%endl) ! wind at canyon top (m/s) - real(r8) :: canyon_u_wind(bounds%begl:bounds%endl) ! u-component of wind speed inside canyon (m/s) - real(r8) :: canyon_wind(bounds%begl:bounds%endl) ! net wind speed inside canyon (m/s) - real(r8) :: canyon_resistance(bounds%begl:bounds%endl) ! resistance to heat and moisture transfer from canyon road/walls to canyon air (s/m) - - real(r8) :: ur(bounds%begl:bounds%endl) ! wind speed at reference height (m/s) - real(r8) :: ustar(bounds%begl:bounds%endl) ! friction velocity (m/s) - real(r8) :: ramu(bounds%begl:bounds%endl) ! aerodynamic resistance (s/m) - real(r8) :: rahu(bounds%begl:bounds%endl) ! thermal resistance (s/m) - real(r8) :: rawu(bounds%begl:bounds%endl) ! moisture resistance (s/m) - real(r8) :: temp1(bounds%begl:bounds%endl) ! relation for potential temperature profile - real(r8) :: temp12m(bounds%begl:bounds%endl) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(bounds%begl:bounds%endl) ! relation for specific humidity profile - real(r8) :: temp22m(bounds%begl:bounds%endl) ! relation for specific humidity profile applied at 2-m - real(r8) :: thm_g(bounds%begl:bounds%endl) ! intermediate variable (forc_t+0.0098*forc_hgt_t) - real(r8) :: thv_g(bounds%begl:bounds%endl) ! virtual potential temperature (K) - real(r8) :: dth(bounds%begl:bounds%endl) ! diff of virtual temp. between ref. height and surface - real(r8) :: dqh(bounds%begl:bounds%endl) ! diff of humidity between ref. height and surface - real(r8) :: zldis(bounds%begl:bounds%endl) ! reference height "minus" zero displacement height (m) - real(r8) :: um(bounds%begl:bounds%endl) ! wind speed including the stablity effect (m/s) - real(r8) :: obu(bounds%begl:bounds%endl) ! Monin-Obukhov length (m) - real(r8) :: taf_numer(bounds%begl:bounds%endl) ! numerator of taf equation (K m/s) - real(r8) :: taf_denom(bounds%begl:bounds%endl) ! denominator of taf equation (m/s) - real(r8) :: qaf_numer(bounds%begl:bounds%endl) ! numerator of qaf equation (kg m/kg s) - real(r8) :: qaf_denom(bounds%begl:bounds%endl) ! denominator of qaf equation (m/s) - real(r8) :: wtas(bounds%begl:bounds%endl) ! sensible heat conductance for urban air to atmospheric air (m/s) - real(r8) :: wtaq(bounds%begl:bounds%endl) ! latent heat conductance for urban air to atmospheric air (m/s) - real(r8) :: wts_sum(bounds%begl:bounds%endl) ! sum of wtas, wtus_roof, wtus_road_perv, wtus_road_imperv, wtus_sunwall, wtus_shadewall - real(r8) :: wtq_sum(bounds%begl:bounds%endl) ! sum of wtaq, wtuq_roof, wtuq_road_perv, wtuq_road_imperv, wtuq_sunwall, wtuq_shadewall - real(r8) :: beta(bounds%begl:bounds%endl) ! coefficient of convective velocity - real(r8) :: zii(bounds%begl:bounds%endl) ! convective boundary layer height (m) - real(r8) :: fm(bounds%begl:bounds%endl) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: wtus(bounds%begc:bounds%endc) ! sensible heat conductance for urban columns (scaled) (m/s) - real(r8) :: wtuq(bounds%begc:bounds%endc) ! latent heat conductance for urban columns (scaled) (m/s) - integer :: iter ! iteration index - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: wtus_roof(bounds%begl:bounds%endl) ! sensible heat conductance for roof (scaled) (m/s) - real(r8) :: wtuq_roof(bounds%begl:bounds%endl) ! latent heat conductance for roof (scaled) (m/s) - real(r8) :: wtus_road_perv(bounds%begl:bounds%endl) ! sensible heat conductance for pervious road (scaled) (m/s) - real(r8) :: wtuq_road_perv(bounds%begl:bounds%endl) ! latent heat conductance for pervious road (scaled) (m/s) - real(r8) :: wtus_road_imperv(bounds%begl:bounds%endl) ! sensible heat conductance for impervious road (scaled) (m/s) - real(r8) :: wtuq_road_imperv(bounds%begl:bounds%endl) ! latent heat conductance for impervious road (scaled) (m/s) - real(r8) :: wtus_sunwall(bounds%begl:bounds%endl) ! sensible heat conductance for sunwall (scaled) (m/s) - real(r8) :: wtuq_sunwall(bounds%begl:bounds%endl) ! latent heat conductance for sunwall (scaled) (m/s) - real(r8) :: wtus_shadewall(bounds%begl:bounds%endl) ! sensible heat conductance for shadewall (scaled) (m/s) - real(r8) :: wtuq_shadewall(bounds%begl:bounds%endl) ! latent heat conductance for shadewall (scaled) (m/s) - real(r8) :: wtus_roof_unscl(bounds%begl:bounds%endl) ! sensible heat conductance for roof (not scaled) (m/s) - real(r8) :: wtuq_roof_unscl(bounds%begl:bounds%endl) ! latent heat conductance for roof (not scaled) (m/s) - real(r8) :: wtus_road_perv_unscl(bounds%begl:bounds%endl) ! sensible heat conductance for pervious road (not scaled) (m/s) - real(r8) :: wtuq_road_perv_unscl(bounds%begl:bounds%endl) ! latent heat conductance for pervious road (not scaled) (m/s) - real(r8) :: wtus_road_imperv_unscl(bounds%begl:bounds%endl) ! sensible heat conductance for impervious road (not scaled) (m/s) - real(r8) :: wtuq_road_imperv_unscl(bounds%begl:bounds%endl) ! latent heat conductance for impervious road (not scaled) (m/s) - real(r8) :: wtus_sunwall_unscl(bounds%begl:bounds%endl) ! sensible heat conductance for sunwall (not scaled) (m/s) - real(r8) :: wtuq_sunwall_unscl(bounds%begl:bounds%endl) ! latent heat conductance for sunwall (not scaled) (m/s) - real(r8) :: wtus_shadewall_unscl(bounds%begl:bounds%endl) ! sensible heat conductance for shadewall (not scaled) (m/s) - real(r8) :: wtuq_shadewall_unscl(bounds%begl:bounds%endl) ! latent heat conductance for shadewall (not scaled) (m/s) - real(r8) :: wc ! convective velocity (m/s) - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: eflx_sh_grnd_scale(bounds%begp:bounds%endp) ! scaled sensible heat flux from ground (W/m**2) [+ to atm] - real(r8) :: qflx_evap_soi_scale(bounds%begp:bounds%endp) ! scaled soil evaporation (mm H2O/s) (+ = to atm) - real(r8) :: eflx_wasteheat_roof(bounds%begl:bounds%endl) ! sensible heat flux from urban heating/cooling sources of waste heat for roof (W/m**2) - real(r8) :: eflx_wasteheat_sunwall(bounds%begl:bounds%endl) ! sensible heat flux from urban heating/cooling sources of waste heat for sunwall (W/m**2) - real(r8) :: eflx_wasteheat_shadewall(bounds%begl:bounds%endl) ! sensible heat flux from urban heating/cooling sources of waste heat for shadewall (W/m**2) - real(r8) :: eflx_heat_from_ac_roof(bounds%begl:bounds%endl) ! sensible heat flux put back into canyon due to heat removal by AC for roof (W/m**2) - real(r8) :: eflx_heat_from_ac_sunwall(bounds%begl:bounds%endl) ! sensible heat flux put back into canyon due to heat removal by AC for sunwall (W/m**2) - real(r8) :: eflx_heat_from_ac_shadewall(bounds%begl:bounds%endl) ! sensible heat flux put back into canyon due to heat removal by AC for shadewall (W/m**2) - real(r8) :: eflx(bounds%begl:bounds%endl) ! total sensible heat flux for error check (W/m**2) - real(r8) :: qflx(bounds%begl:bounds%endl) ! total water vapor flux for error check (kg/m**2/s) - real(r8) :: eflx_scale(bounds%begl:bounds%endl) ! sum of scaled sensible heat fluxes for urban columns for error check (W/m**2) - real(r8) :: qflx_scale(bounds%begl:bounds%endl) ! sum of scaled water vapor fluxes for urban columns for error check (kg/m**2/s) - real(r8) :: eflx_err(bounds%begl:bounds%endl) ! sensible heat flux error (W/m**2) - real(r8) :: qflx_err(bounds%begl:bounds%endl) ! water vapor flux error (kg/m**2/s) - real(r8) :: fwet_roof ! fraction of roof surface that is wet (-) - real(r8) :: fwet_road_imperv ! fraction of impervious road surface that is wet (-) - integer :: local_secp1(bounds%begl:bounds%endl) ! seconds into current date in local time (sec) - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - logical :: found ! flag in search loop - integer :: indexl ! index of first found in search loop - integer :: nstep ! time step number - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - ! - real(r8), parameter :: lapse_rate = 0.0098_r8 ! Dry adiabatic lapse rate (K/m) - integer , parameter :: niters = 3 ! maximum number of iterations for surface temperature - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - ctype => col%itype , & ! Input: [integer (:) ] column type - z_0_town => lun%z_0_town , & ! Input: [real(r8) (:) ] momentum roughness length of urban landunit (m) - z_d_town => lun%z_d_town , & ! Input: [real(r8) (:) ] displacement height of urban landunit (m) - ht_roof => lun%ht_roof , & ! Input: [real(r8) (:) ] height of urban roof (m) - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:) ] weight of roof with respect to landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street width - wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road - - forc_t => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric temperature (K) - forc_th => atm2lnd_inst%forc_th_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric potential temperature (K) - forc_rho => atm2lnd_inst%forc_rho_not_downscaled_grc , & ! Input: [real(r8) (:) ] density (kg/m**3) - forc_q => atm2lnd_inst%forc_q_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg) - forc_pbot => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) - forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) - - wind_hgt_canyon => urbanparams_inst%wind_hgt_canyon , & ! Input: [real(r8) (:) ] height above road at which wind in canyon is to be computed (m) - eflx_traffic_factor => urbanparams_inst%eflx_traffic_factor , & ! Input: [real(r8) (:) ] multiplicative urban traffic factor for sensible heat flux - - rootr_road_perv => soilstate_inst%rootr_road_perv_col , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer for urban pervious road - soilalpha_u => soilstate_inst%soilalpha_u_col , & ! Input: [real(r8) (:) ] Urban factor that reduces ground saturated specific humidity (-) - rootr => soilstate_inst%rootr_patch , & ! Output: [real(r8) (:,:) ] effective fraction of roots in each soil layer - - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground surface temperature (K) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (K) - t_ref2m => temperature_inst%t_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (K) - t_ref2m_u => temperature_inst%t_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m height surface air temperature (K) - t_veg => temperature_inst%t_veg_patch , & ! Output: [real(r8) (:) ] vegetation temperature (K) - taf => temperature_inst%taf_lun , & ! Output: [real(r8) (:) ] urban canopy air temperature (K) - - - tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (C) - vap_ref2m => humanindex_inst%vap_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height vapor pressure (Pa) - appar_temp_ref2m => humanindex_inst%appar_temp_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m apparent temperature (C) - appar_temp_ref2m_u => humanindex_inst%appar_temp_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m apparent temperature (C) - swbgt_ref2m => humanindex_inst%swbgt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Simplified Wetbulb Globe temperature (C) - swbgt_ref2m_u => humanindex_inst%swbgt_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Simplified Wetbulb Globe temperature (C) - humidex_ref2m => humanindex_inst%humidex_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Humidex (C) - humidex_ref2m_u => humanindex_inst%humidex_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Humidex (C) - wbt_ref2m => humanindex_inst%wbt_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Stull Wet Bulb temperature (C) - wbt_ref2m_u => humanindex_inst%wbt_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Stull Wet Bulb temperature (C) - wb_ref2m => humanindex_inst%wb_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Wet Bulb temperature (C) - wb_ref2m_u => humanindex_inst%wb_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Wet Bulb temperature (C) - teq_ref2m => humanindex_inst%teq_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent temperature (K) - teq_ref2m_u => humanindex_inst%teq_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Equivalent temperature (K) - ept_ref2m => humanindex_inst%ept_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height Equivalent Potential temperature (K) - ept_ref2m_u => humanindex_inst%ept_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m height Equivalent Potential temperature (K) - discomf_index_ref2m => humanindex_inst%discomf_index_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Discomfort Index temperature (C) - discomf_index_ref2m_u => humanindex_inst%discomf_index_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Discomfort Index temperature (C) - discomf_index_ref2mS => humanindex_inst%discomf_index_ref2mS_patch , & ! Output: [real(r8) (:) ] 2 m height Discomfort Index Stull temperature (C) - discomf_index_ref2mS_u => humanindex_inst%discomf_index_ref2mS_u_patch, & ! Output: [real(r8) (:) ] Urban 2 m Discomfort Index Stull temperature (K) - nws_hi_ref2m => humanindex_inst%nws_hi_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m NWS Heat Index (C) - nws_hi_ref2m_u => humanindex_inst%nws_hi_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m NWS Heat Index (C) - thip_ref2m => humanindex_inst%thip_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Physiology (C) - thip_ref2m_u => humanindex_inst%thip_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Temperature Humidity Index Physiology (C) - thic_ref2m => humanindex_inst%thic_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Temperature Humidity Index Comfort (C) - thic_ref2m_u => humanindex_inst%thic_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Temperature Humidity Index Comfort (C) - swmp65_ref2m => humanindex_inst%swmp65_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 65% effi (C) - swmp65_ref2m_u => humanindex_inst%swmp65_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Swamp Cooler temperature 65% effi (C) - swmp80_ref2m => humanindex_inst%swmp80_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m Swamp Cooler temperature 80% effi (C) - swmp80_ref2m_u => humanindex_inst%swmp80_ref2m_u_patch , & ! Output: [real(r8) (:) ] Urban 2 m Swamp Cooler temperature 80% effi (C) - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - dqgdT => waterstate_inst%dqgdT_col , & ! Input: [real(r8) (:) ] temperature derivative of "qg" - qg => waterstate_inst%qg_col , & ! Input: [real(r8) (:) ] specific humidity at ground surface (kg/kg) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - qaf => waterstate_inst%qaf_lun , & ! Output: [real(r8) (:) ] urban canopy air specific humidity (kg/kg) - q_ref2m => waterstate_inst%q_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface specific humidity (kg/kg) - rh_ref2m => waterstate_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) - rh_ref2m_u => waterstate_inst%rh_ref2m_u_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%) - - forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch-level (m) - forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Input: [real(r8) (:) ] observational height of temperature at patch-level (m) - zetamax => frictionvel_parms_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions - ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m) - u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:) ] 10 m height winds (m/s) - - htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) (J/kg) - dlrad => energyflux_inst%dlrad_patch , & ! Output: [real(r8) (:) ] downward longwave radiation below the canopy (W/m**2) - ulrad => energyflux_inst%ulrad_patch , & ! Output: [real(r8) (:) ] upward longwave radiation above the canopy (W/m**2) - cgrnds => energyflux_inst%cgrnds_patch , & ! Output: [real(r8) (:) ] deriv, of soil sensible heat flux wrt soil temp (W/m**2/K) - cgrndl => energyflux_inst%cgrndl_patch , & ! Output: [real(r8) (:) ] deriv of soil latent heat flux wrt soil temp (W/m**2/K) - cgrnd => energyflux_inst%cgrnd_patch , & ! Output: [real(r8) (:) ] deriv. of soil energy flux wrt to soil temp (W/m**2/K) - eflx_sh_grnd => energyflux_inst%eflx_sh_grnd_patch , & ! Output: [real(r8) (:) ] sensible heat flux from ground (W/m**2) [+ to atm] - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch , & ! Output: [real(r8) (:) ] total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_tot_u => energyflux_inst%eflx_sh_tot_u_patch , & ! Output: [real(r8) (:) ] urban total sensible heat flux (W/m**2) [+ to atm] - eflx_sh_snow => energyflux_inst%eflx_sh_snow_patch , & ! Output: [real(r8) (:) ] sensible heat flux from snow (W/m**2) [+ to atm] - eflx_sh_soil => energyflux_inst%eflx_sh_soil_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_sh_h2osfc => energyflux_inst%eflx_sh_h2osfc_patch , & ! Output: [real(r8) (:) ] sensible heat flux from soil (W/m**2) [+ to atm] - eflx_traffic => energyflux_inst%eflx_traffic_lun , & ! Output: [real(r8) (:) ] traffic sensible heat flux (W/m**2) - eflx_wasteheat => energyflux_inst%eflx_wasteheat_lun , & ! Output: [real(r8) (:) ] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_urban_ac => energyflux_inst%eflx_urban_ac_lun , & ! Input: [real(r8) (:) ] urban air conditioning flux (W/m**2) - eflx_heat_from_ac => energyflux_inst%eflx_heat_from_ac_lun , & ! Output: [real(r8) (:) ] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_urban_heat => energyflux_inst%eflx_urban_heat_lun , & ! Input: [real(r8) (:) ] urban heating flux (W/m**2) - eflx_urban_ac_col => energyflux_inst%eflx_urban_ac_col , & ! Input: [real(r8) (:) ] urban air conditioning flux (W/m**2) - eflx_urban_heat_col => energyflux_inst%eflx_urban_heat_col , & ! Input: [real(r8) (:) ] urban heating flux (W/m**2) - taux => energyflux_inst%taux_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: e-w (kg/m/s**2) - tauy => energyflux_inst%tauy_patch , & ! Output: [real(r8) (:) ] wind (shear) stress: n-s (kg/m/s**2) - - qflx_evap_soi => waterflux_inst%qflx_evap_soi_patch , & ! Output: [real(r8) (:) ] soil evaporation (mm H2O/s) (+ = to atm) - qflx_tran_veg => waterflux_inst%qflx_tran_veg_patch , & ! Output: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - qflx_evap_veg => waterflux_inst%qflx_evap_veg_patch , & ! Output: [real(r8) (:) ] vegetation evaporation (mm H2O/s) (+ = to atm) - qflx_evap_tot => waterflux_inst%qflx_evap_tot_patch , & ! Output: [real(r8) (:) ] qflx_evap_soi + qflx_evap_can + qflx_tran_veg - - begl => bounds%begl , & - endl => bounds%endl & - ) - - ! Define fields that appear on the restart file for non-urban landunits - - do fl = 1,num_nourbanl - l = filter_nourbanl(fl) - taf(l) = spval - qaf(l) = spval - end do - - ! Get time step - nstep = get_nstep() - - ! Set constants (same as in Biogeophysics1Mod) - beta(begl:endl) = 1._r8 ! Should be set to the same values as in Biogeophysics1Mod - zii(begl:endl) = 1000._r8 ! Should be set to the same values as in Biogeophysics1Mod - - ! Get current date - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Compute canyontop wind using Masson (2000) - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - local_secp1(l) = secs + nint((grc%londeg(g)/degpsec)/dtime)*dtime - local_secp1(l) = mod(local_secp1(l),isecspday) - - ! Error checks - - if (ht_roof(l) - z_d_town(l) <= z_0_town(l)) then - write (iulog,*) 'aerodynamic parameter error in UrbanFluxes' - write (iulog,*) 'h_r - z_d <= z_0' - write (iulog,*) 'ht_roof, z_d_town, z_0_town: ', ht_roof(l), z_d_town(l), & - z_0_town(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - if (forc_hgt_u_patch(lun%patchi(l)) - z_d_town(l) <= z_0_town(l)) then - write (iulog,*) 'aerodynamic parameter error in UrbanFluxes' - write (iulog,*) 'h_u - z_d <= z_0' - write (iulog,*) 'forc_hgt_u_patch, z_d_town, z_0_town: ', forc_hgt_u_patch(lun%patchi(l)), z_d_town(l), & - z_0_town(l) - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - - ! Magnitude of atmospheric wind - - ur(l) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - - ! Canyon top wind - - canyontop_wind(l) = ur(l) * & - log( (ht_roof(l)-z_d_town(l)) / z_0_town(l) ) / & - log( (forc_hgt_u_patch(lun%patchi(l))-z_d_town(l)) / z_0_town(l) ) - - ! U component of canyon wind - - if (canyon_hwr(l) < 0.5_r8) then ! isolated roughness flow - canyon_u_wind(l) = canyontop_wind(l) * exp( -0.5_r8*canyon_hwr(l)* & - (1._r8-(wind_hgt_canyon(l)/ht_roof(l))) ) - else if (canyon_hwr(l) < 1.0_r8) then ! wake interference flow - canyon_u_wind(l) = canyontop_wind(l) * (1._r8+2._r8*(2._r8/rpi - 1._r8)* & - (ht_roof(l)/(ht_roof(l)/canyon_hwr(l)) - 0.5_r8)) * & - exp(-0.5_r8*canyon_hwr(l)*(1._r8-(wind_hgt_canyon(l)/ht_roof(l)))) - else ! skimming flow - canyon_u_wind(l) = canyontop_wind(l) * (2._r8/rpi) * & - exp(-0.5_r8*canyon_hwr(l)*(1._r8-(wind_hgt_canyon(l)/ht_roof(l)))) - end if - - end do - - ! Compute fluxes - Follows CLM approach for bare soils (Oleson et al 2004) - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - thm_g(l) = forc_t(g) + lapse_rate*forc_hgt_t_patch(lun%patchi(l)) - thv_g(l) = forc_th(g)*(1._r8+0.61_r8*forc_q(g)) - dth(l) = thm_g(l)-taf(l) - dqh(l) = forc_q(g)-qaf(l) - dthv = dth(l)*(1._r8+0.61_r8*forc_q(g))+0.61_r8*forc_th(g)*dqh(l) - zldis(l) = forc_hgt_u_patch(lun%patchi(l)) - z_d_town(l) - - ! Initialize Monin-Obukhov length and wind speed including convective velocity - - call MoninObukIni(ur(l), thv_g(l), dthv, zldis(l), z_0_town(l), um(l), obu(l)) - - end do - - ! Initialize conductances - wtus_roof(begl:endl) = 0._r8 - wtus_road_perv(begl:endl) = 0._r8 - wtus_road_imperv(begl:endl) = 0._r8 - wtus_sunwall(begl:endl) = 0._r8 - wtus_shadewall(begl:endl) = 0._r8 - wtuq_roof(begl:endl) = 0._r8 - wtuq_road_perv(begl:endl) = 0._r8 - wtuq_road_imperv(begl:endl) = 0._r8 - wtuq_sunwall(begl:endl) = 0._r8 - wtuq_shadewall(begl:endl) = 0._r8 - wtus_roof_unscl(begl:endl) = 0._r8 - wtus_road_perv_unscl(begl:endl) = 0._r8 - wtus_road_imperv_unscl(begl:endl) = 0._r8 - wtus_sunwall_unscl(begl:endl) = 0._r8 - wtus_shadewall_unscl(begl:endl) = 0._r8 - wtuq_roof_unscl(begl:endl) = 0._r8 - wtuq_road_perv_unscl(begl:endl) = 0._r8 - wtuq_road_imperv_unscl(begl:endl) = 0._r8 - wtuq_sunwall_unscl(begl:endl) = 0._r8 - wtuq_shadewall_unscl(begl:endl) = 0._r8 - - ! Start stability iteration - - do iter = 1,niters - - ! Get friction velocity, relation for potential - ! temperature and humidity profiles of surface boundary layer. - - if (num_urbanl > 0) then - call FrictionVelocity(begl, endl, & - num_urbanl, filter_urbanl, & - z_d_town(begl:endl), z_0_town(begl:endl), z_0_town(begl:endl), z_0_town(begl:endl), & - obu(begl:endl), iter, ur(begl:endl), um(begl:endl), ustar(begl:endl), & - temp1(begl:endl), temp2(begl:endl), temp12m(begl:endl), temp22m(begl:endl), fm(begl:endl), & - frictionvel_inst, landunit_index=.true.) - end if - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - ! Determine aerodynamic resistance to fluxes from urban canopy air to - ! atmosphere - - ramu(l) = 1._r8/(ustar(l)*ustar(l)/um(l)) - rahu(l) = 1._r8/(temp1(l)*ustar(l)) - rawu(l) = 1._r8/(temp2(l)*ustar(l)) - - ! Determine magnitude of canyon wind by using horizontal wind determined - ! previously and vertical wind from friction velocity (Masson 2000) - - canyon_wind(l) = sqrt(canyon_u_wind(l)**2._r8 + ustar(l)**2._r8) - - ! Determine canyon_resistance (currently this single resistance determines the - ! resistance from urban surfaces (roof, pervious and impervious road, sunlit and - ! shaded walls) to urban canopy air, since it is only dependent on wind speed - ! Also from Masson 2000. - - canyon_resistance(l) = cpair * forc_rho(g) / (11.8_r8 + 4.2_r8*canyon_wind(l)) - - end do - - ! This is the first term in the equation solutions for urban canopy air temperature - ! and specific humidity (numerator) and is a landunit quantity - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - taf_numer(l) = thm_g(l)/rahu(l) - taf_denom(l) = 1._r8/rahu(l) - qaf_numer(l) = forc_q(g)/rawu(l) - qaf_denom(l) = 1._r8/rawu(l) - - ! First term needed for derivative of heat fluxes - wtas(l) = 1._r8/rahu(l) - wtaq(l) = 1._r8/rawu(l) - - end do - - - ! Gather other terms for other urban columns for numerator and denominator of - ! equations for urban canopy air temperature and specific humidity - - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - - if (ctype(c) == icol_roof) then - - ! scaled sensible heat conductance - wtus(c) = wtlunit_roof(l)/canyon_resistance(l) - wtus_roof(l) = wtus(c) - ! unscaled sensible heat conductance - wtus_roof_unscl(l) = 1._r8/canyon_resistance(l) - - if (snow_depth(c) > 0._r8) then - fwet_roof = min(snow_depth(c)/0.05_r8, 1._r8) - else - fwet_roof = (max(0._r8, h2osoi_liq(c,1)+h2osoi_ice(c,1))/pondmx_urban)**0.666666666666_r8 - fwet_roof = min(fwet_roof,1._r8) - end if - if (qaf(l) > qg(c)) then - fwet_roof = 1._r8 - end if - ! scaled latent heat conductance - wtuq(c) = fwet_roof*(wtlunit_roof(l)/canyon_resistance(l)) - wtuq_roof(l) = wtuq(c) - ! unscaled latent heat conductance - wtuq_roof_unscl(l) = fwet_roof*(1._r8/canyon_resistance(l)) - if ( IsSimpleBuildTemp() ) call simple_wasteheatfromac( & - eflx_urban_ac_col(c), eflx_urban_heat_col(c), eflx_wasteheat_roof(l), & - eflx_heat_from_ac_roof(l) ) - - else if (ctype(c) == icol_road_perv) then - - ! scaled sensible heat conductance - wtus(c) = wtroad_perv(l)*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtus_road_perv(l) = wtus(c) - ! unscaled sensible heat conductance - wtus_road_perv_unscl(l) = 1._r8/canyon_resistance(l) - - ! scaled latent heat conductance - wtuq(c) = wtroad_perv(l)*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtuq_road_perv(l) = wtuq(c) - ! unscaled latent heat conductance - wtuq_road_perv_unscl(l) = 1._r8/canyon_resistance(l) - - else if (ctype(c) == icol_road_imperv) then - - ! scaled sensible heat conductance - wtus(c) = (1._r8-wtroad_perv(l))*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtus_road_imperv(l) = wtus(c) - ! unscaled sensible heat conductance - wtus_road_imperv_unscl(l) = 1._r8/canyon_resistance(l) - - if (snow_depth(c) > 0._r8) then - fwet_road_imperv = min(snow_depth(c)/0.05_r8, 1._r8) - else - fwet_road_imperv = (max(0._r8, h2osoi_liq(c,1)+h2osoi_ice(c,1))/pondmx_urban)**0.666666666666_r8 - fwet_road_imperv = min(fwet_road_imperv,1._r8) - end if - if (qaf(l) > qg(c)) then - fwet_road_imperv = 1._r8 - end if - ! scaled latent heat conductance - wtuq(c) = fwet_road_imperv*(1._r8-wtroad_perv(l))*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtuq_road_imperv(l) = wtuq(c) - ! unscaled latent heat conductance - wtuq_road_imperv_unscl(l) = fwet_road_imperv*(1._r8/canyon_resistance(l)) - - else if (ctype(c) == icol_sunwall) then - - ! scaled sensible heat conductance - wtus(c) = canyon_hwr(l)*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtus_sunwall(l) = wtus(c) - ! unscaled sensible heat conductance - wtus_sunwall_unscl(l) = 1._r8/canyon_resistance(l) - - ! scaled latent heat conductance - wtuq(c) = 0._r8 - wtuq_sunwall(l) = wtuq(c) - ! unscaled latent heat conductance - wtuq_sunwall_unscl(l) = 0._r8 - if ( IsSimpleBuildTemp() ) call simple_wasteheatfromac( eflx_urban_ac_col(c), & - eflx_urban_heat_col(c), eflx_wasteheat_sunwall(l), & - eflx_heat_from_ac_sunwall(l) ) - - else if (ctype(c) == icol_shadewall) then - - ! scaled sensible heat conductance - wtus(c) = canyon_hwr(l)*(1._r8-wtlunit_roof(l))/canyon_resistance(l) - wtus_shadewall(l) = wtus(c) - ! unscaled sensible heat conductance - wtus_shadewall_unscl(l) = 1._r8/canyon_resistance(l) - - ! scaled latent heat conductance - wtuq(c) = 0._r8 - wtuq_shadewall(l) = wtuq(c) - ! unscaled latent heat conductance - wtuq_shadewall_unscl(l) = 0._r8 - if ( IsSimpleBuildTemp() ) call simple_wasteheatfromac( eflx_urban_ac_col(c), & - eflx_urban_heat_col(c), eflx_wasteheat_shadewall(l), & - eflx_heat_from_ac_shadewall(l) ) - - else - write(iulog,*) 'c, ctype, pi = ', c, ctype(c), pi - write(iulog,*) 'Column indices for: shadewall, sunwall, road_imperv, road_perv, roof: ' - write(iulog,*) icol_shadewall, icol_sunwall, icol_road_imperv, icol_road_perv, icol_roof - call endrun(decomp_index=l, clmlevel=namel, msg="ERROR, ctype out of range"//errmsg(sourcefile, __LINE__)) - end if - - taf_numer(l) = taf_numer(l) + t_grnd(c)*wtus(c) - taf_denom(l) = taf_denom(l) + wtus(c) - qaf_numer(l) = qaf_numer(l) + qg(c)*wtuq(c) - qaf_denom(l) = qaf_denom(l) + wtuq(c) - - end do - - ! Calculate new urban canopy air temperature and specific humidity - - call wasteheat( bounds, num_urbanl, filter_urbanl, eflx_wasteheat_roof, eflx_wasteheat_sunwall, & - eflx_wasteheat_shadewall, eflx_heat_from_ac_roof, eflx_heat_from_ac_sunwall, & - eflx_heat_from_ac_shadewall, energyflux_inst ) - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - ! Calculate traffic heat flux - ! Only comes from impervious road - eflx_traffic(l) = (1._r8-wtlunit_roof(l))*(1._r8-wtroad_perv(l))* & - eflx_traffic_factor(l) - - taf(l) = taf_numer(l)/taf_denom(l) - qaf(l) = qaf_numer(l)/qaf_denom(l) - - wts_sum(l) = wtas(l) + wtus_roof(l) + wtus_road_perv(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l) - - wtq_sum(l) = wtaq(l) + wtuq_roof(l) + wtuq_road_perv(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l) - - end do - - ! This section of code is not required if niters = 1 - ! Determine stability using new taf and qaf - ! TODO: Some of these constants replicate what is in FrictionVelocity and BareGround fluxes should consildate. EBK - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - dth(l) = thm_g(l)-taf(l) - dqh(l) = forc_q(g)-qaf(l) - tstar = temp1(l)*dth(l) - qstar = temp2(l)*dqh(l) - thvstar = tstar*(1._r8+0.61_r8*forc_q(g)) + 0.61_r8*forc_th(g)*qstar - zeta = zldis(l)*vkc*grav*thvstar/(ustar(l)**2*thv_g(l)) - - if (zeta >= 0._r8) then !stable - zeta = min(zetamax,max(zeta,0.01_r8)) - um(l) = max(ur(l),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta(l)*(-grav*ustar(l)*thvstar*zii(l)/thv_g(l))**0.333_r8 - um(l) = sqrt(ur(l)*ur(l) + wc*wc) - end if - - obu(l) = zldis(l)/zeta - end do - - end do ! end iteration - - ! Determine fluxes from canyon surfaces - - ! the following initializations are needed to ensure that the values are 0 over non- - ! active urban Patches - eflx_sh_grnd_scale(bounds%begp : bounds%endp) = 0._r8 - qflx_evap_soi_scale(bounds%begp : bounds%endp) = 0._r8 - - do f = 1, num_urbanp - - p = filter_urbanp(f) - c = patch%column(p) - g = patch%gridcell(p) - l = patch%landunit(p) - - ram1(p) = ramu(l) !pass value to global variable - - ! Upward and downward canopy longwave are zero - - ulrad(p) = 0._r8 - dlrad(p) = 0._r8 - - ! Derivative of sensible and latent heat fluxes with respect to - ! ground temperature - - if (ctype(c) == icol_roof) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_road_perv(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_roof_unscl(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_road_perv(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_roof_unscl(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_road_perv) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_road_perv_unscl(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_roof(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_road_perv_unscl(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_road_imperv) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_road_imperv_unscl(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_roof(l) + & - wtuq_road_perv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_road_imperv_unscl(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_sunwall) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_road_imperv(l) + wtus_shadewall(l)) * & - (wtus_sunwall_unscl(l)/wts_sum(l)) - cgrndl(p) = 0._r8 - else if (ctype(c) == icol_shadewall) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_road_imperv(l) + wtus_sunwall(l)) * & - (wtus_shadewall_unscl(l)/wts_sum(l)) - cgrndl(p) = 0._r8 - end if - cgrnd(p) = cgrnds(p) + cgrndl(p)*htvp(c) - - ! Surface fluxes of momentum, sensible and latent heat - - taux(p) = -forc_rho(g)*forc_u(g)/ramu(l) - tauy(p) = -forc_rho(g)*forc_v(g)/ramu(l) - - ! Use new canopy air temperature - dth(l) = taf(l) - t_grnd(c) - - if (ctype(c) == icol_roof) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_roof_unscl(l)*dth(l) - eflx_sh_snow(p) = 0._r8 - eflx_sh_soil(p) = 0._r8 - eflx_sh_h2osfc(p)= 0._r8 - else if (ctype(c) == icol_road_perv) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_road_perv_unscl(l)*dth(l) - eflx_sh_snow(p) = 0._r8 - eflx_sh_soil(p) = 0._r8 - eflx_sh_h2osfc(p)= 0._r8 - else if (ctype(c) == icol_road_imperv) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_road_imperv_unscl(l)*dth(l) - eflx_sh_snow(p) = 0._r8 - eflx_sh_soil(p) = 0._r8 - eflx_sh_h2osfc(p)= 0._r8 - else if (ctype(c) == icol_sunwall) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_sunwall_unscl(l)*dth(l) - eflx_sh_snow(p) = 0._r8 - eflx_sh_soil(p) = 0._r8 - eflx_sh_h2osfc(p)= 0._r8 - else if (ctype(c) == icol_shadewall) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_shadewall_unscl(l)*dth(l) - eflx_sh_snow(p) = 0._r8 - eflx_sh_soil(p) = 0._r8 - eflx_sh_h2osfc(p)= 0._r8 - end if - - eflx_sh_tot(p) = eflx_sh_grnd(p) - eflx_sh_tot_u(p) = eflx_sh_tot(p) - - dqh(l) = qaf(l) - qg(c) - - if (ctype(c) == icol_roof) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_roof_unscl(l)*dqh(l) - else if (ctype(c) == icol_road_perv) then - ! Evaporation assigned to soil term if dew or snow - ! or if no liquid water available in soil column - if (dqh(l) > 0._r8 .or. frac_sno(c) > 0._r8 .or. soilalpha_u(c) <= 0._r8) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_road_perv_unscl(l)*dqh(l) - qflx_tran_veg(p) = 0._r8 - ! Otherwise, evaporation assigned to transpiration term - else - qflx_evap_soi(p) = 0._r8 - qflx_tran_veg(p) = -forc_rho(g)*wtuq_road_perv_unscl(l)*dqh(l) - end if - qflx_evap_veg(p) = qflx_tran_veg(p) - else if (ctype(c) == icol_road_imperv) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_road_imperv_unscl(l)*dqh(l) - else if (ctype(c) == icol_sunwall) then - qflx_evap_soi(p) = 0._r8 - else if (ctype(c) == icol_shadewall) then - qflx_evap_soi(p) = 0._r8 - end if - - ! SCALED sensible and latent heat flux for error check - eflx_sh_grnd_scale(p) = -forc_rho(g)*cpair*wtus(c)*dth(l) - qflx_evap_soi_scale(p) = -forc_rho(g)*wtuq(c)*dqh(l) - - end do - - ! Check to see that total sensible and latent heat equal the sum of - ! the scaled heat fluxes above - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - eflx(l) = -(forc_rho(g)*cpair/rahu(l))*(thm_g(l) - taf(l)) - qflx(l) = -(forc_rho(g)/rawu(l))*(forc_q(g) - qaf(l)) - eflx_scale(l) = sum(eflx_sh_grnd_scale(lun%patchi(l):lun%patchf(l))) - qflx_scale(l) = sum(qflx_evap_soi_scale(lun%patchi(l):lun%patchf(l))) - eflx_err(l) = eflx_scale(l) - eflx(l) - qflx_err(l) = qflx_scale(l) - qflx(l) - end do - - found = .false. - do fl = 1, num_urbanl - l = filter_urbanl(fl) - if (abs(eflx_err(l)) > 0.01_r8) then - found = .true. - indexl = l - exit - end if - end do - if ( found ) then - write(iulog,*)'WARNING: Total sensible heat does not equal sum of scaled heat fluxes for urban columns ',& - ' nstep = ',nstep,' indexl= ',indexl,' eflx_err= ',eflx_err(indexl) - if (abs(eflx_err(indexl)) > .01_r8) then - write(iulog,*)'clm model is stopping - error is greater than .01 W/m**2' - write(iulog,*)'eflx_scale = ',eflx_scale(indexl) - write(iulog,*)'eflx_sh_grnd_scale: ',eflx_sh_grnd_scale(lun%patchi(indexl):lun%patchf(indexl)) - write(iulog,*)'eflx = ',eflx(indexl) - call endrun(decomp_index=indexl, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - found = .false. - do fl = 1, num_urbanl - l = filter_urbanl(fl) - ! 4.e-9 kg/m**2/s = 0.01 W/m**2 - if (abs(qflx_err(l)) > 4.e-9_r8) then - found = .true. - indexl = l - exit - end if - end do - if ( found ) then - write(iulog,*)'WARNING: Total water vapor flux does not equal sum of scaled water vapor fluxes for urban columns ',& - ' nstep = ',nstep,' indexl= ',indexl,' qflx_err= ',qflx_err(indexl) - if (abs(qflx_err(indexl)) > 4.e-9_r8) then - write(iulog,*)'clm model is stopping - error is greater than 4.e-9 kg/m**2/s' - write(iulog,*)'qflx_scale = ',qflx_scale(indexl) - write(iulog,*)'qflx = ',qflx(indexl) - call endrun(decomp_index=indexl, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - end if - - ! Gather terms required to determine internal building temperature - - if ( IsSimpleBuildTemp() ) call calc_simple_internal_building_temp( & - bounds, num_urbanc, filter_urbanc, num_urbanl, filter_urbanl, & - temperature_inst) - - ! No roots for urban except for pervious road - - do j = 1, nlevgrnd - do f = 1, num_urbanp - p = filter_urbanp(f) - c = patch%column(p) - if (ctype(c) == icol_road_perv) then - rootr(p,j) = rootr_road_perv(c,j) - else - rootr(p,j) = 0._r8 - end if - end do - end do - - do f = 1, num_urbanp - - p = filter_urbanp(f) - c = patch%column(p) - g = patch%gridcell(p) - l = patch%landunit(p) - - ! Use urban canopy air temperature and specific humidity to represent - ! 2-m temperature and humidity - - t_ref2m(p) = taf(l) - q_ref2m(p) = qaf(l) - t_ref2m_u(p) = taf(l) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(g), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - rh_ref2m_u(p) = rh_ref2m(p) - - ! Human Heat Stress - if ( calc_human_stress_indices )then - - call KtoC(t_ref2m(p), tc_ref2m(p)) - call VaporPres(rh_ref2m(p), e_ref2m, vap_ref2m(p)) - call Wet_Bulb(t_ref2m(p), vap_ref2m(p), forc_pbot(g), rh_ref2m(p), q_ref2m(p), & - teq_ref2m(p), ept_ref2m(p), wb_ref2m(p)) - call Wet_BulbS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p)) - call HeatIndex(tc_ref2m(p), rh_ref2m(p), nws_hi_ref2m(p)) - call AppTemp(tc_ref2m(p), vap_ref2m(p), u10_clm(p), appar_temp_ref2m(p)) - call swbgt(tc_ref2m(p), vap_ref2m(p), swbgt_ref2m(p)) - call hmdex(tc_ref2m(p), vap_ref2m(p), humidex_ref2m(p)) - call dis_coi(tc_ref2m(p), wb_ref2m(p), discomf_index_ref2m(p)) - call dis_coiS(tc_ref2m(p), rh_ref2m(p), wbt_ref2m(p), discomf_index_ref2mS(p)) - call THIndex(tc_ref2m(p), wb_ref2m(p), thic_ref2m(p), thip_ref2m(p)) - call SwampCoolEff(tc_ref2m(p), wb_ref2m(p), swmp80_ref2m(p), swmp65_ref2m(p)) - - teq_ref2m_u(p) = teq_ref2m(p) - ept_ref2m_u(p) = ept_ref2m(p) - wb_ref2m_u(p) = wb_ref2m(p) - wbt_ref2m_u(p) = wbt_ref2m(p) - nws_hi_ref2m_u(p) = nws_hi_ref2m(p) - appar_temp_ref2m_u(p) = appar_temp_ref2m(p) - swbgt_ref2m_u(p) = swbgt_ref2m(p) - humidex_ref2m_u(p) = humidex_ref2m(p) - discomf_index_ref2m_u(p) = discomf_index_ref2m(p) - discomf_index_ref2mS_u(p) = discomf_index_ref2mS(p) - thic_ref2m_u(p) = thic_ref2m(p) - thip_ref2m_u(p) = thip_ref2m(p) - swmp80_ref2m_u(p) = swmp80_ref2m(p) - swmp65_ref2m_u(p) = swmp65_ref2m(p) - end if - - ! Variables needed by history tape - - t_veg(p) = forc_t(g) - - end do - - end associate - - end subroutine UrbanFluxes - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: wasteheat - ! - ! !INTERFACE: - subroutine wasteheat( bounds, num_urbanl, filter_urbanl, eflx_wasteheat_roof, eflx_wasteheat_sunwall, & - eflx_wasteheat_shadewall, eflx_heat_from_ac_roof, eflx_heat_from_ac_sunwall, & - eflx_heat_from_ac_shadewall, energyflux_inst ) - ! !DESCRIPTION: - ! - ! Calculate the wasteheat flux from urban heating or air-conditioning. - ! - ! !USES: - use clm_varcon , only : ht_wasteheat_factor, ac_wasteheat_factor, & - wasteheat_limit - use EnergyFluxType , only : energyflux_type - use UrbanParamsType , only : IsProgBuildTemp - implicit none - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8) , intent(in) :: eflx_wasteheat_roof(bounds%begl:bounds%endl) - real(r8) , intent(in) :: eflx_wasteheat_sunwall(bounds%begl:bounds%endl) - real(r8) , intent(in) :: eflx_wasteheat_shadewall(bounds%begl:bounds%endl) - real(r8) , intent(in) :: eflx_heat_from_ac_roof(bounds%begl:bounds%endl) - real(r8) , intent(in) :: eflx_heat_from_ac_sunwall(bounds%begl:bounds%endl) - real(r8) , intent(in) :: eflx_heat_from_ac_shadewall(bounds%begl:bounds%endl) - type(energyflux_type) , intent(inout) :: energyflux_inst ! data on landunit energy flux - - ! !LOCAL VARIABLES: - integer fl, l, g - !EOP - !----------------------------------------------------------------------- - - associate(& - lgridcell => lun%gridcell , & ! Input: [integer (:) ] gridcell of corresponding landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:)] ratio of building height to street width - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:)] weight of roof with respect to landunit - eflx_wasteheat => energyflux_inst%eflx_wasteheat_lun , & ! Output: [real(r8) (:)] sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - eflx_heat_from_ac=> energyflux_inst%eflx_heat_from_ac_lun , & ! Output: [real(r8) (:)] sensible heat flux put back into canyon due to removal by AC (W/m**2) - eflx_urban_ac => energyflux_inst%eflx_urban_ac_lun , & ! Input: [real(r8) (:)] urban air conditioning flux (W/m**2) - eflx_urban_heat => energyflux_inst%eflx_urban_heat_lun & ! Input: [real(r8) (:)] urban heating flux (W/m**2) - ) - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - if ( IsSimpleBuildTemp() )then - ! Total waste heat and heat from AC is sum of heat for walls and roofs - ! accounting for different surface areas - eflx_wasteheat(l) = wtlunit_roof(l)*eflx_wasteheat_roof(l) + & - (1._r8-wtlunit_roof(l))*(canyon_hwr(l)*(eflx_wasteheat_sunwall(l) + & - eflx_wasteheat_shadewall(l))) - - else if ( IsProgBuildTemp() )then - ! wasteheat from heating/cooling - if (trim(urban_hac) == urban_wasteheat_on) then - eflx_wasteheat(l) = ac_wasteheat_factor * eflx_urban_ac(l) + & - ht_wasteheat_factor * eflx_urban_heat(l) - else - eflx_wasteheat(l) = 0._r8 - end if - end if - - ! Limit wasteheat to ensure that we don't get any unrealistically strong - ! positive feedbacks due to AC in a warmer climate - eflx_wasteheat(l) = min(eflx_wasteheat(l),wasteheat_limit) - - if ( IsSimpleBuildTemp() )then - eflx_heat_from_ac(l) = wtlunit_roof(l)*eflx_heat_from_ac_roof(l) + & - (1._r8-wtlunit_roof(l))*(canyon_hwr(l)*(eflx_heat_from_ac_sunwall(l) + & - eflx_heat_from_ac_shadewall(l))) - - else if ( IsProgBuildTemp() )then - ! If air conditioning on, always replace heat removed with heat into canyon - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - eflx_heat_from_ac(l) = abs(eflx_urban_ac(l)) - else - eflx_heat_from_ac(l) = 0._r8 - end if - end if - end do - end associate - end subroutine wasteheat - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: simple_wasteheatfromac - ! - ! !INTERFACE: - subroutine simple_wasteheatfromac( eflx_urban_ac, eflx_urban_heat, eflx_wasteheat, & - eflx_heat_from_ac ) - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! - ! Calculate waste heat from Air conditioning with the simpler method introduced - ! in CLM4.5. - ! - ! !USES: - use clm_varcon , only : ht_wasteheat_factor, ac_wasteheat_factor - implicit none - ! !ARGUMENTS: - real(r8), intent(in) :: eflx_urban_ac - real(r8), intent(in) :: eflx_urban_heat - real(r8), intent(out) :: eflx_wasteheat - real(r8), intent(out) :: eflx_heat_from_ac - - ! wasteheat from heating/cooling - if (trim(urban_hac) == urban_wasteheat_on) then - eflx_wasteheat = ac_wasteheat_factor * eflx_urban_ac + & - ht_wasteheat_factor * eflx_urban_heat - else - eflx_wasteheat = 0._r8 - end if - - ! If air conditioning on, always replace heat removed with heat into canyon - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - eflx_heat_from_ac = abs(eflx_urban_ac) - else - eflx_heat_from_ac = 0._r8 - end if - - end subroutine simple_wasteheatfromac - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: calc_simple_internal_building_temp - ! - ! !INTERFACE: - subroutine calc_simple_internal_building_temp( bounds, num_urbanc, filter_urbanc, & - num_urbanl, filter_urbanl, temperature_inst ) - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! - ! Calculate the internal building temperature, based on the simpler method introduced - ! in CLM4.5. - ! - ! !USES: - use clm_varpar , only : nlevurb - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use LandunitType , only : landunit_type - use ColumnType , only : column_type - use TemperatureType, only : temperature_type - - implicit none - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - type(temperature_type), intent(inout) :: temperature_inst ! temperature variables - ! !LOCAL VARIABLES: - ! Gather terms required to determine internal building temperature - integer :: fl,fc,l,c ! indices - real(r8) :: t_sunwall_innerl(bounds%begl:bounds%endl) ! temp of inner layer of sunwall (K) - real(r8) :: t_shadewall_innerl(bounds%begl:bounds%endl) ! temp of inner layer of shadewall (K) - real(r8) :: t_roof_innerl(bounds%begl:bounds%endl) ! temp of inner layer of roof (K) - real(r8) :: lngth_roof ! length of roof (m) - !EOP - !----------------------------------------------------------------------- - - associate(& - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:)] soil temperature (K) - ht_roof => lun%ht_roof , & ! Input: [real(r8) (:)] height of urban roof (m) - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:)] ratio of building height to street width - wtlunit_roof => lun%wtlunit_roof , & ! Input: [real(r8) (:)] weight of roof with respect to landunit - t_building => temperature_inst%t_building_lun & ! Output: [real(r8) (:)] internal building temperature (K) - ) - - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - - if (col%itype(c) == icol_roof ) then - t_roof_innerl(l) = t_soisno(c,nlevurb) - else if (col%itype(c) == icol_sunwall ) then - t_sunwall_innerl(l) = t_soisno(c,nlevurb) - else if (col%itype(c) == icol_shadewall) then - t_shadewall_innerl(l) = t_soisno(c,nlevurb) - end if - - end do - - ! Calculate internal building temperature - do fl = 1, num_urbanl - l = filter_urbanl(fl) - - lngth_roof = (ht_roof(l)/canyon_hwr(l))*wtlunit_roof(l)/(1._r8-wtlunit_roof(l)) - t_building(l) = (ht_roof(l)*(t_shadewall_innerl(l) + t_sunwall_innerl(l)) & - +lngth_roof*t_roof_innerl(l))/(2._r8*ht_roof(l)+lngth_roof) - end do - - end associate - - end subroutine calc_simple_internal_building_temp - - !----------------------------------------------------------------------- - -end module UrbanFluxesMod diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 deleted file mode 100644 index 4b4187c3af..0000000000 --- a/src/biogeophys/UrbanParamsType.F90 +++ /dev/null @@ -1,961 +0,0 @@ -module UrbanParamsType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Urban Constants - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varctl , only : iulog, fsurdat - use clm_varcon , only : namel, grlnd, spval - use LandunitType , only : lun - ! - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanReadNML ! Read in the urban namelist items - public :: UrbanInput ! Read in urban input data - public :: CheckUrban ! Check validity of urban points - public :: IsSimpleBuildTemp ! If using the simple building temperature method - public :: IsProgBuildTemp ! If using the prognostic building temperature method - ! - ! !PRIVATE TYPE - type urbinp_type - real(r8), pointer :: canyon_hwr (:,:) - real(r8), pointer :: wtlunit_roof (:,:) - real(r8), pointer :: wtroad_perv (:,:) - real(r8), pointer :: em_roof (:,:) - real(r8), pointer :: em_improad (:,:) - real(r8), pointer :: em_perroad (:,:) - real(r8), pointer :: em_wall (:,:) - real(r8), pointer :: alb_roof_dir (:,:,:) - real(r8), pointer :: alb_roof_dif (:,:,:) - real(r8), pointer :: alb_improad_dir (:,:,:) - real(r8), pointer :: alb_improad_dif (:,:,:) - real(r8), pointer :: alb_perroad_dir (:,:,:) - real(r8), pointer :: alb_perroad_dif (:,:,:) - real(r8), pointer :: alb_wall_dir (:,:,:) - real(r8), pointer :: alb_wall_dif (:,:,:) - real(r8), pointer :: ht_roof (:,:) - real(r8), pointer :: wind_hgt_canyon (:,:) - real(r8), pointer :: tk_wall (:,:,:) - real(r8), pointer :: tk_roof (:,:,:) - real(r8), pointer :: tk_improad (:,:,:) - real(r8), pointer :: cv_wall (:,:,:) - real(r8), pointer :: cv_roof (:,:,:) - real(r8), pointer :: cv_improad (:,:,:) - real(r8), pointer :: thick_wall (:,:) - real(r8), pointer :: thick_roof (:,:) - integer, pointer :: nlev_improad (:,:) - real(r8), pointer :: t_building_min (:,:) - end type urbinp_type - type (urbinp_type), public :: urbinp ! urban input derived type - - ! !PUBLIC TYPE - type, public :: urbanparams_type - real(r8), allocatable :: wind_hgt_canyon (:) ! lun height above road at which wind in canyon is to be computed (m) - real(r8), allocatable :: em_roof (:) ! lun roof emissivity - real(r8), allocatable :: em_improad (:) ! lun impervious road emissivity - real(r8), allocatable :: em_perroad (:) ! lun pervious road emissivity - real(r8), allocatable :: em_wall (:) ! lun wall emissivity - real(r8), allocatable :: alb_roof_dir (:,:) ! lun direct roof albedo - real(r8), allocatable :: alb_roof_dif (:,:) ! lun diffuse roof albedo - real(r8), allocatable :: alb_improad_dir (:,:) ! lun direct impervious road albedo - real(r8), allocatable :: alb_improad_dif (:,:) ! lun diffuse impervious road albedo - real(r8), allocatable :: alb_perroad_dir (:,:) ! lun direct pervious road albedo - real(r8), allocatable :: alb_perroad_dif (:,:) ! lun diffuse pervious road albedo - real(r8), allocatable :: alb_wall_dir (:,:) ! lun direct wall albedo - real(r8), allocatable :: alb_wall_dif (:,:) ! lun diffuse wall albedo - - integer , pointer :: nlev_improad (:) ! lun number of impervious road layers (-) - real(r8), pointer :: tk_wall (:,:) ! lun thermal conductivity of urban wall (W/m/K) - real(r8), pointer :: tk_roof (:,:) ! lun thermal conductivity of urban roof (W/m/K) - real(r8), pointer :: tk_improad (:,:) ! lun thermal conductivity of urban impervious road (W/m/K) - real(r8), pointer :: cv_wall (:,:) ! lun heat capacity of urban wall (J/m^3/K) - real(r8), pointer :: cv_roof (:,:) ! lun heat capacity of urban roof (J/m^3/K) - real(r8), pointer :: cv_improad (:,:) ! lun heat capacity of urban impervious road (J/m^3/K) - real(r8), pointer :: thick_wall (:) ! lun total thickness of urban wall (m) - real(r8), pointer :: thick_roof (:) ! lun total thickness of urban roof (m) - - real(r8), pointer :: vf_sr (:) ! lun view factor of sky for road - real(r8), pointer :: vf_wr (:) ! lun view factor of one wall for road - real(r8), pointer :: vf_sw (:) ! lun view factor of sky for one wall - real(r8), pointer :: vf_rw (:) ! lun view factor of road for one wall - real(r8), pointer :: vf_ww (:) ! lun view factor of opposing wall for one wall - - real(r8), pointer :: t_building_min (:) ! lun minimum internal building air temperature (K) - real(r8), pointer :: eflx_traffic_factor (:) ! lun multiplicative traffic factor for sensible heat flux from urban traffic (-) - contains - - procedure, public :: Init - - end type urbanparams_type - ! - ! !Urban control variables - character(len= *), parameter, public :: urban_hac_off = 'OFF' - character(len= *), parameter, public :: urban_hac_on = 'ON' - character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' - character(len= 16), public :: urban_hac = urban_hac_off - logical, public :: urban_traffic = .false. ! urban traffic fluxes - - ! !PRIVATE MEMBER DATA: - logical, private :: ReadNamelist = .false. ! If namelist was read yet or not - integer, parameter, private :: BUILDING_TEMP_METHOD_SIMPLE = 0 ! Simple method introduced in CLM4.5 - integer, parameter, private :: BUILDING_TEMP_METHOD_PROG = 1 ! Prognostic method introduced in CLM5.0 - integer, private :: building_temp_method = BUILDING_TEMP_METHOD_PROG ! Method to calculate the building temperature - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevcan, nlevcan, numrad, nlevgrnd, nlevurb - use clm_varpar , only : nlevsoi, nlevgrnd - use clm_varctl , only : use_vancouver, use_mexicocity - use clm_varcon , only : vkc - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv, icol_road_imperv, icol_road_perv - use landunit_varcon , only : isturb_MIN - ! - ! !ARGUMENTS: - class(urbanparams_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: j,l,c,p,g ! indices - integer :: nc,fl,ib ! indices - integer :: dindx ! urban density type index - integer :: ier ! error status - real(r8) :: sumvf ! sum of view factors for wall or road - real(r8), parameter :: alpha = 4.43_r8 ! coefficient used to calculate z_d_town - real(r8), parameter :: beta = 1.0_r8 ! coefficient used to calculate z_d_town - real(r8), parameter :: C_d = 1.2_r8 ! drag coefficient as used in Grimmond and Oke (1999) - real(r8) :: plan_ai ! plan area index - ratio building area to plan area (-) - real(r8) :: frontal_ai ! frontal area index of buildings (-) - real(r8) :: build_lw_ratio ! building short/long side ratio (-) - integer :: begl, endl - integer :: begc, endc - integer :: begp, endp - integer :: begg, endg - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begl = bounds%begl; endl = bounds%endl - begg = bounds%begg; endg = bounds%endg - - ! Allocate urbanparams data structure - - if ( nlevurb > 0 )then - allocate(this%tk_wall (begl:endl,nlevurb)) ; this%tk_wall (:,:) = nan - allocate(this%tk_roof (begl:endl,nlevurb)) ; this%tk_roof (:,:) = nan - allocate(this%cv_wall (begl:endl,nlevurb)) ; this%cv_wall (:,:) = nan - allocate(this%cv_roof (begl:endl,nlevurb)) ; this%cv_roof (:,:) = nan - end if - allocate(this%t_building_min (begl:endl)) ; this%t_building_min (:) = nan - allocate(this%tk_improad (begl:endl,nlevurb)) ; this%tk_improad (:,:) = nan - allocate(this%cv_improad (begl:endl,nlevurb)) ; this%cv_improad (:,:) = nan - allocate(this%thick_wall (begl:endl)) ; this%thick_wall (:) = nan - allocate(this%thick_roof (begl:endl)) ; this%thick_roof (:) = nan - allocate(this%nlev_improad (begl:endl)) ; this%nlev_improad (:) = huge(1) - allocate(this%vf_sr (begl:endl)) ; this%vf_sr (:) = nan - allocate(this%vf_wr (begl:endl)) ; this%vf_wr (:) = nan - allocate(this%vf_sw (begl:endl)) ; this%vf_sw (:) = nan - allocate(this%vf_rw (begl:endl)) ; this%vf_rw (:) = nan - allocate(this%vf_ww (begl:endl)) ; this%vf_ww (:) = nan - allocate(this%wind_hgt_canyon (begl:endl)) ; this%wind_hgt_canyon (:) = nan - allocate(this%em_roof (begl:endl)) ; this%em_roof (:) = nan - allocate(this%em_improad (begl:endl)) ; this%em_improad (:) = nan - allocate(this%em_perroad (begl:endl)) ; this%em_perroad (:) = nan - allocate(this%em_wall (begl:endl)) ; this%em_wall (:) = nan - allocate(this%alb_roof_dir (begl:endl,numrad)) ; this%alb_roof_dir (:,:) = nan - allocate(this%alb_roof_dif (begl:endl,numrad)) ; this%alb_roof_dif (:,:) = nan - allocate(this%alb_improad_dir (begl:endl,numrad)) ; this%alb_improad_dir (:,:) = nan - allocate(this%alb_perroad_dir (begl:endl,numrad)) ; this%alb_perroad_dir (:,:) = nan - allocate(this%alb_improad_dif (begl:endl,numrad)) ; this%alb_improad_dif (:,:) = nan - allocate(this%alb_perroad_dif (begl:endl,numrad)) ; this%alb_perroad_dif (:,:) = nan - allocate(this%alb_wall_dir (begl:endl,numrad)) ; this%alb_wall_dir (:,:) = nan - allocate(this%alb_wall_dif (begl:endl,numrad)) ; this%alb_wall_dif (:,:) = nan - allocate(this%eflx_traffic_factor (begl:endl)) ; this%eflx_traffic_factor (:) = nan - - ! Initialize time constant urban variables - - do l = bounds%begl,bounds%endl - - ! "0" refers to urban wall/roof surface and "nlevsoi" refers to urban wall/roof bottom - if (lun%urbpoi(l)) then - - g = lun%gridcell(l) - dindx = lun%itype(l) - isturb_MIN + 1 - - this%wind_hgt_canyon(l) = urbinp%wind_hgt_canyon(g,dindx) - do ib = 1,numrad - this%alb_roof_dir (l,ib) = urbinp%alb_roof_dir (g,dindx,ib) - this%alb_roof_dif (l,ib) = urbinp%alb_roof_dif (g,dindx,ib) - this%alb_improad_dir(l,ib) = urbinp%alb_improad_dir(g,dindx,ib) - this%alb_perroad_dir(l,ib) = urbinp%alb_perroad_dir(g,dindx,ib) - this%alb_improad_dif(l,ib) = urbinp%alb_improad_dif(g,dindx,ib) - this%alb_perroad_dif(l,ib) = urbinp%alb_perroad_dif(g,dindx,ib) - this%alb_wall_dir (l,ib) = urbinp%alb_wall_dir (g,dindx,ib) - this%alb_wall_dif (l,ib) = urbinp%alb_wall_dif (g,dindx,ib) - end do - this%em_roof (l) = urbinp%em_roof (g,dindx) - this%em_improad(l) = urbinp%em_improad(g,dindx) - this%em_perroad(l) = urbinp%em_perroad(g,dindx) - this%em_wall (l) = urbinp%em_wall (g,dindx) - - ! Landunit level initialization for urban wall and roof layers and interfaces - - lun%canyon_hwr(l) = urbinp%canyon_hwr(g,dindx) - lun%wtroad_perv(l) = urbinp%wtroad_perv(g,dindx) - lun%ht_roof(l) = urbinp%ht_roof(g,dindx) - lun%wtlunit_roof(l) = urbinp%wtlunit_roof(g,dindx) - - this%tk_wall(l,:) = urbinp%tk_wall(g,dindx,:) - this%tk_roof(l,:) = urbinp%tk_roof(g,dindx,:) - this%tk_improad(l,:) = urbinp%tk_improad(g,dindx,:) - this%cv_wall(l,:) = urbinp%cv_wall(g,dindx,:) - this%cv_roof(l,:) = urbinp%cv_roof(g,dindx,:) - this%cv_improad(l,:) = urbinp%cv_improad(g,dindx,:) - this%thick_wall(l) = urbinp%thick_wall(g,dindx) - this%thick_roof(l) = urbinp%thick_roof(g,dindx) - this%nlev_improad(l) = urbinp%nlev_improad(g,dindx) - this%t_building_min(l) = urbinp%t_building_min(g,dindx) - - ! Inferred from Sailor and Lu 2004 - if (urban_traffic) then - this%eflx_traffic_factor(l) = 3.6_r8 * (lun%canyon_hwr(l)-0.5_r8) + 1.0_r8 - else - this%eflx_traffic_factor(l) = 0.0_r8 - end if - - if (use_vancouver .or. use_mexicocity) then - ! Freely evolving - this%t_building_min(l) = 200.00_r8 - else - if (urban_hac == urban_hac_off) then - ! Overwrite values read in from urbinp by freely evolving values - this%t_building_min(l) = 200.00_r8 - end if - end if - - !---------------------------------------------------------------------------------- - ! View factors for road and one wall in urban canyon (depends only on canyon_hwr) - ! --------------------------------------------------------------------------------------- - ! WALL | - ! ROAD | - ! wall | - ! -----\ /----- - - |\----------/ - ! | \ vsr / | | r | | \ vww / s - ! | \ / | h o w | \ / k - ! wall | \ / | wall | a | | \ / y - ! |vwr \ / vwr| | d | |vrw \ / vsw - ! ------\/------ - - |-----\/----- - ! road wall | - ! <----- w ----> | - ! <---- h --->| - ! - ! vsr = view factor of sky for road vrw = view factor of road for wall - ! vwr = view factor of one wall for road vww = view factor of opposing wall for wall - ! vsw = view factor of sky for wall - ! vsr + vwr + vwr = 1 vrw + vww + vsw = 1 - ! - ! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in - ! atmospheric models. Boundary-Layer Meteorology 94:357-397 - ! - ! - Calculate urban land unit aerodynamic constants using Macdonald (1998) as used in - ! Grimmond and Oke (1999) - ! --------------------------------------------------------------------------------------- - - ! road -- sky view factor -> 1 as building height -> 0 - ! and -> 0 as building height -> infinity - - this%vf_sr(l) = sqrt(lun%canyon_hwr(l)**2 + 1._r8) - lun%canyon_hwr(l) - this%vf_wr(l) = 0.5_r8 * (1._r8 - this%vf_sr(l)) - - ! one wall -- sky view factor -> 0.5 as building height -> 0 - ! and -> 0 as building height -> infinity - - this%vf_sw(l) = 0.5_r8 * (lun%canyon_hwr(l) + 1._r8 - sqrt(lun%canyon_hwr(l)**2+1._r8)) / lun%canyon_hwr(l) - this%vf_rw(l) = this%vf_sw(l) - this%vf_ww(l) = 1._r8 - this%vf_sw(l) - this%vf_rw(l) - - ! error check -- make sure view factor sums to one for road and wall - sumvf = this%vf_sr(l) + 2._r8*this%vf_wr(l) - if (abs(sumvf-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban road view factor error',sumvf - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - sumvf = this%vf_sw(l) + this%vf_rw(l) + this%vf_ww(l) - if (abs(sumvf-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban wall view factor error',sumvf - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - - !---------------------------------------------------------------------------------- - ! Calculate urban land unit aerodynamic constants using Macdonald (1998) as used in - ! Grimmond and Oke (1999) - !---------------------------------------------------------------------------------- - - ! Calculate plan area index - plan_ai = lun%canyon_hwr(l)/(lun%canyon_hwr(l) + 1._r8) - - ! Building shape shortside/longside ratio (e.g. 1 = square ) - ! This assumes the building occupies the entire canyon length - build_lw_ratio = plan_ai - - ! Calculate frontal area index - frontal_ai = (1._r8 - plan_ai) * lun%canyon_hwr(l) - - ! Adjust frontal area index for different building configuration - frontal_ai = frontal_ai * sqrt(1/build_lw_ratio) * sqrt(plan_ai) - - ! Calculate displacement height - if (use_vancouver) then - lun%z_d_town(l) = 3.5_r8 - else if (use_mexicocity) then - lun%z_d_town(l) = 10.9_r8 - else - lun%z_d_town(l) = (1._r8 + alpha**(-plan_ai) * (plan_ai - 1._r8)) * lun%ht_roof(l) - end if - - ! Calculate the roughness length - if (use_vancouver) then - lun%z_0_town(l) = 0.35_r8 - else if (use_mexicocity) then - lun%z_0_town(l) = 2.2_r8 - else - lun%z_0_town(l) = lun%ht_roof(l) * (1._r8 - lun%z_d_town(l) / lun%ht_roof(l)) * & - exp(-1.0_r8 * (0.5_r8 * beta * C_d / vkc**2 * & - (1 - lun%z_d_town(l) / lun%ht_roof(l)) * frontal_ai)**(-0.5_r8)) - end if - - else ! Not urban point - - this%eflx_traffic_factor(l) = spval - this%t_building_min(l) = spval - - this%vf_sr(l) = spval - this%vf_wr(l) = spval - this%vf_sw(l) = spval - this%vf_rw(l) = spval - this%vf_ww(l) = spval - - end if - end do - - ! Deallocate memory for urbinp datatype - - call UrbanInput(bounds%begg, bounds%endg, mode='finalize') - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine UrbanInput(begg, endg, mode) - ! - ! !DESCRIPTION: - ! Allocate memory and read in urban input data - ! - ! !USES: - use clm_varpar , only : numrad, nlevurb - use landunit_varcon , only : numurbl - use fileutils , only : getavu, relavu, getfil, opnfil - use spmdMod , only : masterproc - use domainMod , only : ldomain - use ncdio_pio , only : file_desc_t, ncd_io, ncd_inqvdlen, ncd_inqfdims - use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, ncd_inqdid, ncd_inqdlen - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: begg, endg - character(len=*), intent(in) :: mode - ! - ! !LOCAL VARIABLES: - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: dimid ! netCDF id - integer :: nw,n,k,i,j,ni,nj,ns ! indices - integer :: nlevurb_i ! input grid: number of urban vertical levels - integer :: numrad_i ! input grid: number of solar bands (VIS/NIR) - integer :: numurbl_i ! input grid: number of urban landunits - integer :: ier,ret ! error status - logical :: isgrid2d ! true => file is 2d - logical :: readvar ! true => variable is on dataset - logical :: has_numurbl ! true => numurbl dimension is on dataset - character(len=32) :: subname = 'UrbanInput' ! subroutine name - !----------------------------------------------------------------------- - - if ( nlevurb == 0 ) return - - if (mode == 'initialize') then - - ! Read urban data - - if (masterproc) then - write(iulog,*)' Reading in urban input data from fsurdat file ...' - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - if (masterproc) then - write(iulog,*) subname,trim(fsurdat) - end if - - ! Check whether this file has new-format urban data - call ncd_inqdid(ncid, 'numurbl', dimid, dimexist=has_numurbl) - - ! If file doesn't have numurbl, then it is old-format urban; - ! in this case, set nlevurb to zero - if (.not. has_numurbl) then - nlevurb = 0 - if (masterproc) write(iulog,*)'PCT_URBAN is not multi-density, nlevurb set to 0' - end if - - if ( nlevurb == 0 ) return - - ! Allocate dynamic memory - allocate(urbinp%canyon_hwr(begg:endg, numurbl), & - urbinp%wtlunit_roof(begg:endg, numurbl), & - urbinp%wtroad_perv(begg:endg, numurbl), & - urbinp%em_roof(begg:endg, numurbl), & - urbinp%em_improad(begg:endg, numurbl), & - urbinp%em_perroad(begg:endg, numurbl), & - urbinp%em_wall(begg:endg, numurbl), & - urbinp%alb_roof_dir(begg:endg, numurbl, numrad), & - urbinp%alb_roof_dif(begg:endg, numurbl, numrad), & - urbinp%alb_improad_dir(begg:endg, numurbl, numrad), & - urbinp%alb_perroad_dir(begg:endg, numurbl, numrad), & - urbinp%alb_improad_dif(begg:endg, numurbl, numrad), & - urbinp%alb_perroad_dif(begg:endg, numurbl, numrad), & - urbinp%alb_wall_dir(begg:endg, numurbl, numrad), & - urbinp%alb_wall_dif(begg:endg, numurbl, numrad), & - urbinp%ht_roof(begg:endg, numurbl), & - urbinp%wind_hgt_canyon(begg:endg, numurbl), & - urbinp%tk_wall(begg:endg, numurbl,nlevurb), & - urbinp%tk_roof(begg:endg, numurbl,nlevurb), & - urbinp%tk_improad(begg:endg, numurbl,nlevurb), & - urbinp%cv_wall(begg:endg, numurbl,nlevurb), & - urbinp%cv_roof(begg:endg, numurbl,nlevurb), & - urbinp%cv_improad(begg:endg, numurbl,nlevurb), & - urbinp%thick_wall(begg:endg, numurbl), & - urbinp%thick_roof(begg:endg, numurbl), & - urbinp%nlev_improad(begg:endg, numurbl), & - urbinp%t_building_min(begg:endg, numurbl), & - stat=ier) - if (ier /= 0) then - call endrun(msg="Allocation error "//errmsg(sourcefile, __LINE__)) - endif - - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun(msg=errmsg(sourcefile, __LINE__)) - end if - - call ncd_inqdid(ncid, 'nlevurb', dimid) - call ncd_inqdlen(ncid, dimid, nlevurb_i) - if (nlevurb_i /= nlevurb) then - write(iulog,*)trim(subname)// ': parameter nlevurb= ',nlevurb, & - 'does not equal input dataset nlevurb= ',nlevurb_i - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - - call ncd_inqdid(ncid, 'numrad', dimid) - call ncd_inqdlen(ncid, dimid, numrad_i) - if (numrad_i /= numrad) then - write(iulog,*)trim(subname)// ': parameter numrad= ',numrad, & - 'does not equal input dataset numrad= ',numrad_i - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - call ncd_inqdid(ncid, 'numurbl', dimid) - call ncd_inqdlen(ncid, dimid, numurbl_i) - if (numurbl_i /= numurbl) then - write(iulog,*)trim(subname)// ': parameter numurbl= ',numurbl, & - 'does not equal input dataset numurbl= ',numurbl_i - call endrun(msg=errmsg(sourcefile, __LINE__)) - endif - call ncd_io(ncid=ncid, varname='CANYON_HWR', flag='read', data=urbinp%canyon_hwr,& - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg='ERROR: CANYON_HWR NOT on fsurdat file '//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='WTLUNIT_ROOF', flag='read', data=urbinp%wtlunit_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: WTLUNIT_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='WTROAD_PERV', flag='read', data=urbinp%wtroad_perv, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: WTROAD_PERV NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='EM_ROOF', flag='read', data=urbinp%em_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: EM_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='EM_IMPROAD', flag='read', data=urbinp%em_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: EM_IMPROAD NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='EM_PERROAD', flag='read', data=urbinp%em_perroad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: EM_PERROAD NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='EM_WALL', flag='read', data=urbinp%em_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: EM_WALL NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='HT_ROOF', flag='read', data=urbinp%ht_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: HT_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='WIND_HGT_CANYON', flag='read', data=urbinp%wind_hgt_canyon, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: WIND_HGT_CANYON NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='THICK_WALL', flag='read', data=urbinp%thick_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: THICK_WALL NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='THICK_ROOF', flag='read', data=urbinp%thick_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: THICK_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='NLEV_IMPROAD', flag='read', data=urbinp%nlev_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: NLEV_IMPROAD NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='T_BUILDING_MIN', flag='read', data=urbinp%t_building_min, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: T_BUILDING_MIN NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_IMPROAD_DIR', flag='read', data=urbinp%alb_improad_dir, & - dim1name=grlnd, readvar=readvar) - if (.not.readvar) then - call endrun( msg=' ERROR: ALB_IMPROAD_DIR NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_IMPROAD_DIF', flag='read', data=urbinp%alb_improad_dif, & - dim1name=grlnd, readvar=readvar) - if (.not.readvar) then - call endrun( msg=' ERROR: ALB_IMPROAD_DIF NOT on fsurdat file'//errmsg(sourcefile, __LINE__) ) - end if - - call ncd_io(ncid=ncid, varname='ALB_PERROAD_DIR', flag='read',data=urbinp%alb_perroad_dir, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_PERROAD_DIR NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_PERROAD_DIF', flag='read',data=urbinp%alb_perroad_dif, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_PERROAD_DIF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_ROOF_DIR', flag='read', data=urbinp%alb_roof_dir, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_ROOF_DIR NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_ROOF_DIF', flag='read', data=urbinp%alb_roof_dif, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_ROOF_DIF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_WALL_DIR', flag='read', data=urbinp%alb_wall_dir, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_WALL_DIR NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='ALB_WALL_DIF', flag='read', data=urbinp%alb_wall_dif, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: ALB_WALL_DIF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='TK_IMPROAD', flag='read', data=urbinp%tk_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: TK_IMPROAD NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='TK_ROOF', flag='read', data=urbinp%tk_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: TK_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='TK_WALL', flag='read', data=urbinp%tk_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: TK_WALL NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='CV_IMPROAD', flag='read', data=urbinp%cv_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: CV_IMPROAD NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='CV_ROOF', flag='read', data=urbinp%cv_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: CV_ROOF NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid, varname='CV_WALL', flag='read', data=urbinp%cv_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: CV_WALL NOT on fsurdat file'//errmsg(sourcefile, __LINE__)) - end if - - call ncd_pio_closefile(ncid) - if (masterproc) then - write(iulog,*)' Sucessfully read urban input data' - write(iulog,*) - end if - - else if (mode == 'finalize') then - - if ( nlevurb == 0 ) return - - deallocate(urbinp%canyon_hwr, & - urbinp%wtlunit_roof, & - urbinp%wtroad_perv, & - urbinp%em_roof, & - urbinp%em_improad, & - urbinp%em_perroad, & - urbinp%em_wall, & - urbinp%alb_roof_dir, & - urbinp%alb_roof_dif, & - urbinp%alb_improad_dir, & - urbinp%alb_perroad_dir, & - urbinp%alb_improad_dif, & - urbinp%alb_perroad_dif, & - urbinp%alb_wall_dir, & - urbinp%alb_wall_dif, & - urbinp%ht_roof, & - urbinp%wind_hgt_canyon, & - urbinp%tk_wall, & - urbinp%tk_roof, & - urbinp%tk_improad, & - urbinp%cv_wall, & - urbinp%cv_roof, & - urbinp%cv_improad, & - urbinp%thick_wall, & - urbinp%thick_roof, & - urbinp%nlev_improad, & - urbinp%t_building_min, & - stat=ier) - if (ier /= 0) then - call endrun(msg='initUrbanInput: deallocation error '//errmsg(sourcefile, __LINE__)) - end if - else - write(iulog,*)'initUrbanInput error: mode ',trim(mode),' not supported ' - call endrun(msg=errmsg(sourcefile, __LINE__)) - end if - - end subroutine UrbanInput - - !----------------------------------------------------------------------- - subroutine CheckUrban(begg, endg, pcturb, caller) - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Confirm that we have valid urban data for all points with pct urban > 0. If this isn't - ! true, abort with a message. - ! - ! !USES: - use clm_instur , only : urban_valid - use landunit_varcon , only : numurbl - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: begg, endg ! beg & end grid cell indices - real(r8) , intent(in) :: pcturb(begg:,:) ! % urban - character(len=*), intent(in) :: caller ! identifier of caller, for more meaningful error messages - ! - ! !REVISION HISTORY: - ! Created by Bill Sacks 7/2013, mostly by moving code from surfrd_special - ! - ! !LOCAL VARIABLES: - logical :: found - integer :: nl, n - integer :: nindx, dindx - integer :: nlev - !----------------------------------------------------------------------- - - found = .false. - do nl = begg,endg - do n = 1, numurbl - if ( pcturb(nl,n) > 0.0_r8 ) then - if ( .not. urban_valid(nl) .or. & - urbinp%canyon_hwr(nl,n) <= 0._r8 .or. & - urbinp%em_improad(nl,n) <= 0._r8 .or. & - urbinp%em_perroad(nl,n) <= 0._r8 .or. & - urbinp%em_roof(nl,n) <= 0._r8 .or. & - urbinp%em_wall(nl,n) <= 0._r8 .or. & - urbinp%ht_roof(nl,n) <= 0._r8 .or. & - urbinp%thick_roof(nl,n) <= 0._r8 .or. & - urbinp%thick_wall(nl,n) <= 0._r8 .or. & - urbinp%t_building_min(nl,n) <= 0._r8 .or. & - urbinp%wind_hgt_canyon(nl,n) <= 0._r8 .or. & - urbinp%wtlunit_roof(nl,n) <= 0._r8 .or. & - urbinp%wtroad_perv(nl,n) <= 0._r8 .or. & - any(urbinp%alb_improad_dir(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_improad_dif(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_perroad_dir(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_perroad_dif(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_roof_dir(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_roof_dif(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_wall_dir(nl,n,:) <= 0._r8) .or. & - any(urbinp%alb_wall_dif(nl,n,:) <= 0._r8) .or. & - any(urbinp%tk_roof(nl,n,:) <= 0._r8) .or. & - any(urbinp%tk_wall(nl,n,:) <= 0._r8) .or. & - any(urbinp%cv_roof(nl,n,:) <= 0._r8) .or. & - any(urbinp%cv_wall(nl,n,:) <= 0._r8)) then - found = .true. - nindx = nl - dindx = n - exit - else - if (urbinp%nlev_improad(nl,n) > 0) then - nlev = urbinp%nlev_improad(nl,n) - if ( any(urbinp%tk_improad(nl,n,1:nlev) <= 0._r8) .or. & - any(urbinp%cv_improad(nl,n,1:nlev) <= 0._r8)) then - found = .true. - nindx = nl - dindx = n - exit - end if - end if - end if - if (found) exit - end if - end do - end do - if ( found ) then - write(iulog,*) trim(caller), ' ERROR: no valid urban data for nl=',nindx - write(iulog,*)'density type: ',dindx - write(iulog,*)'urban_valid: ',urban_valid(nindx) - write(iulog,*)'canyon_hwr: ',urbinp%canyon_hwr(nindx,dindx) - write(iulog,*)'em_improad: ',urbinp%em_improad(nindx,dindx) - write(iulog,*)'em_perroad: ',urbinp%em_perroad(nindx,dindx) - write(iulog,*)'em_roof: ',urbinp%em_roof(nindx,dindx) - write(iulog,*)'em_wall: ',urbinp%em_wall(nindx,dindx) - write(iulog,*)'ht_roof: ',urbinp%ht_roof(nindx,dindx) - write(iulog,*)'thick_roof: ',urbinp%thick_roof(nindx,dindx) - write(iulog,*)'thick_wall: ',urbinp%thick_wall(nindx,dindx) - write(iulog,*)'t_building_min: ',urbinp%t_building_min(nindx,dindx) - write(iulog,*)'wind_hgt_canyon: ',urbinp%wind_hgt_canyon(nindx,dindx) - write(iulog,*)'wtlunit_roof: ',urbinp%wtlunit_roof(nindx,dindx) - write(iulog,*)'wtroad_perv: ',urbinp%wtroad_perv(nindx,dindx) - write(iulog,*)'alb_improad_dir: ',urbinp%alb_improad_dir(nindx,dindx,:) - write(iulog,*)'alb_improad_dif: ',urbinp%alb_improad_dif(nindx,dindx,:) - write(iulog,*)'alb_perroad_dir: ',urbinp%alb_perroad_dir(nindx,dindx,:) - write(iulog,*)'alb_perroad_dif: ',urbinp%alb_perroad_dif(nindx,dindx,:) - write(iulog,*)'alb_roof_dir: ',urbinp%alb_roof_dir(nindx,dindx,:) - write(iulog,*)'alb_roof_dif: ',urbinp%alb_roof_dif(nindx,dindx,:) - write(iulog,*)'alb_wall_dir: ',urbinp%alb_wall_dir(nindx,dindx,:) - write(iulog,*)'alb_wall_dif: ',urbinp%alb_wall_dif(nindx,dindx,:) - write(iulog,*)'tk_roof: ',urbinp%tk_roof(nindx,dindx,:) - write(iulog,*)'tk_wall: ',urbinp%tk_wall(nindx,dindx,:) - write(iulog,*)'cv_roof: ',urbinp%cv_roof(nindx,dindx,:) - write(iulog,*)'cv_wall: ',urbinp%cv_wall(nindx,dindx,:) - if (urbinp%nlev_improad(nindx,dindx) > 0) then - nlev = urbinp%nlev_improad(nindx,dindx) - write(iulog,*)'tk_improad: ',urbinp%tk_improad(nindx,dindx,1:nlev) - write(iulog,*)'cv_improad: ',urbinp%cv_improad(nindx,dindx,1:nlev) - end if - call endrun(msg=errmsg(sourcefile, __LINE__)) - end if - - end subroutine CheckUrban - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: UrbanReadNML - ! - ! !INTERFACE: - ! - subroutine UrbanReadNML ( NLFilename ) - ! - ! !DESCRIPTION: - ! - ! Read in the urban namelist - ! - ! !USES: - use shr_mpi_mod , only : shr_mpi_bcast - use abortutils , only : endrun - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - implicit none - ! - ! !ARGUMENTS: - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'UrbanReadNML' ! subroutine name - - namelist / clmu_inparm / urban_hac, urban_traffic, building_temp_method - !EOP - !----------------------------------------------------------------------- - - ! ---------------------------------------------------------------------- - ! Read namelist from input namelist filename - ! ---------------------------------------------------------------------- - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in clmu_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clmu_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clmu_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clmu_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clmu_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - ! Broadcast namelist variables read in - call shr_mpi_bcast(urban_hac, mpicom) - call shr_mpi_bcast(urban_traffic, mpicom) - call shr_mpi_bcast(building_temp_method, mpicom) - - ! - if (urban_traffic) then - write(iulog,*)'Urban traffic fluxes are not implemented currently' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - ! - if ( masterproc )then - write(iulog,*) ' urban air conditioning/heating and wasteheat = ', urban_hac - write(iulog,*) ' urban traffic flux = ', urban_traffic - end if - - ReadNamelist = .true. - - end subroutine UrbanReadNML - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: IsSimpleBuildTemp - ! - ! !INTERFACE: - ! - logical function IsSimpleBuildTemp( ) - ! - ! !DESCRIPTION: - ! - ! If the simple building temperature method is being used - ! - ! !USES: - implicit none - !EOP - !----------------------------------------------------------------------- - - if ( .not. ReadNamelist )then - write(iulog,*)'Testing on building_temp_method before urban namelist was read in' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - IsSimpleBuildTemp = building_temp_method == BUILDING_TEMP_METHOD_SIMPLE - - end function IsSimpleBuildTemp - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - !BOP - ! - ! !IROUTINE: IsProgBuildTemp - ! - ! !INTERFACE: - ! - logical function IsProgBuildTemp( ) - ! - ! !DESCRIPTION: - ! - ! If the prognostic building temperature method is being used - ! - ! !USES: - implicit none - !EOP - !----------------------------------------------------------------------- - - if ( .not. ReadNamelist )then - write(iulog,*)'Testing on building_temp_method before urban namelist was read in' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - IsProgBuildTemp = building_temp_method == BUILDING_TEMP_METHOD_PROG - - end function IsProgBuildTemp - - !----------------------------------------------------------------------- - -end module UrbanParamsType - - - - diff --git a/src/biogeophys/UrbanRadiationMod.F90 b/src/biogeophys/UrbanRadiationMod.F90 deleted file mode 100644 index 102d2b6803..0000000000 --- a/src/biogeophys/UrbanRadiationMod.F90 +++ /dev/null @@ -1,720 +0,0 @@ -module UrbanRadiationMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate solar and longwave radiation, and turbulent fluxes for urban landunit - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : numrad - use clm_varcon , only : isecspday, degpsec, namel - use clm_varctl , only : iulog - use abortutils , only : endrun - use UrbanParamsType , only : urbanparams_type - use atm2lndType , only : atm2lnd_type - use WaterStateType , only : waterstate_type - use TemperatureType , only : temperature_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use UrbanParamsType , only : urbanparams_type - use EnergyFluxType , only : energyflux_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanRadiation ! Urban physics - radiative fluxes - ! - ! PRIVATE MEMBER FUNCTIONS - private :: net_longwave ! Net longwave radiation for road and both walls in urban canyon - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine UrbanRadiation (bounds , & - num_nourbanl, filter_nourbanl , & - num_urbanl, filter_urbanl , & - num_urbanc, filter_urbanc , & - num_urbanp, filter_urbanp , & - atm2lnd_inst, waterstate_inst, temperature_inst, urbanparams_inst, & - solarabs_inst, surfalb_inst, energyflux_inst) - ! - ! !DESCRIPTION: - ! Solar fluxes absorbed and reflected by roof and canyon (walls, road). - ! Also net and upward longwave fluxes. - - ! !USES: - use clm_varcon , only : spval, sb, tfrz - use column_varcon , only : icol_road_perv, icol_road_imperv - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_time_manager , only : get_curr_date, get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nourbanl ! number of non-urban landunits in clump - integer , intent(in) :: filter_nourbanl(:) ! non-urban landunit filter - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(:) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban patches in clump - integer , intent(in) :: filter_urbanp(:) ! urban pft filter - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: fp,fl,p,c,l,g ! indices - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day ! temporaries (not used) - integer :: secs ! seconds into current date - - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - real(r8), parameter :: snoem = 0.97_r8 ! snow emissivity (should use value from Biogeophysics1) - - real(r8) :: lwnet_roof(bounds%begl:bounds%endl) ! net (outgoing-incoming) longwave radiation (per unit ground area), roof (W/m**2) - real(r8) :: lwnet_improad(bounds%begl:bounds%endl) ! net (outgoing-incoming) longwave radiation (per unit ground area), impervious road (W/m**2) - real(r8) :: lwnet_perroad(bounds%begl:bounds%endl) ! net (outgoing-incoming) longwave radiation (per unit ground area), pervious road (W/m**2) - real(r8) :: lwnet_sunwall(bounds%begl:bounds%endl) ! net (outgoing-incoming) longwave radiation (per unit wall area), sunlit wall (W/m**2) - real(r8) :: lwnet_shadewall(bounds%begl:bounds%endl)! net (outgoing-incoming) longwave radiation (per unit wall area), shaded wall (W/m**2) - real(r8) :: lwnet_canyon(bounds%begl:bounds%endl) ! net (outgoing-incoming) longwave radiation for canyon, per unit ground area (W/m**2) - real(r8) :: lwup_roof(bounds%begl:bounds%endl) ! upward longwave radiation (per unit ground area), roof (W/m**2) - real(r8) :: lwup_improad(bounds%begl:bounds%endl) ! upward longwave radiation (per unit ground area), impervious road (W/m**2) - real(r8) :: lwup_perroad(bounds%begl:bounds%endl) ! upward longwave radiation (per unit ground area), pervious road (W/m**2) - real(r8) :: lwup_sunwall(bounds%begl:bounds%endl) ! upward longwave radiation, (per unit wall area), sunlit wall (W/m**2) - real(r8) :: lwup_shadewall(bounds%begl:bounds%endl) ! upward longwave radiation, (per unit wall area), shaded wall (W/m**2) - real(r8) :: lwup_canyon(bounds%begl:bounds%endl) ! upward longwave radiation for canyon, per unit ground area (W/m**2) - real(r8) :: t_roof(bounds%begl:bounds%endl) ! roof temperature (K) - real(r8) :: t_improad(bounds%begl:bounds%endl) ! imppervious road temperature (K) - real(r8) :: t_perroad(bounds%begl:bounds%endl) ! pervious road temperature (K) - real(r8) :: t_sunwall(bounds%begl:bounds%endl) ! sunlit wall temperature (K) - real(r8) :: t_shadewall(bounds%begl:bounds%endl) ! shaded wall temperature (K) - real(r8) :: lwdown(bounds%begl:bounds%endl) ! atmospheric downward longwave radiation (W/m**2) - real(r8) :: em_roof_s(bounds%begl:bounds%endl) ! roof emissivity with snow effects - real(r8) :: em_improad_s(bounds%begl:bounds%endl) ! impervious road emissivity with snow effects - real(r8) :: em_perroad_s(bounds%begl:bounds%endl) ! pervious road emissivity with snow effects - !----------------------------------------------------------------------- - - associate( & - ctype => col%itype , & ! Input: [integer (:) ] column type - coli => lun%coli , & ! Input: [integer (:) ] beginning column index for landunit - colf => lun%colf , & ! Input: [integer (:) ] ending column index for landunit - canyon_hwr => lun%canyon_hwr , & ! Input: [real(r8) (:) ] ratio of building height to street width - wtroad_perv => lun%wtroad_perv , & ! Input: [real(r8) (:) ] weight of pervious road wrt total road - - forc_solad => atm2lnd_inst%forc_solad_grc , & ! Input: [real(r8) (:,:) ] direct beam radiation (vis=forc_sols , nir=forc_soll ) (W/m**2) - forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse beam radiation (vis=forc_sols , nir=forc_soll ) (W/m**2) - forc_solar => atm2lnd_inst%forc_solar_grc , & ! Input: [real(r8) (:) ] incident solar radiation (W/m**2) - forc_lwrad => atm2lnd_inst%forc_lwrad_not_downscaled_grc , & ! Input: [real(r8) (:) ] downward infrared (longwave) radiation (W/m**2) - - frac_sno => waterstate_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - - t_ref2m => temperature_inst%t_ref2m_patch , & ! Input: [real(r8) (:) ] 2 m height surface air temperature (K) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (K) - - em_roof => urbanparams_inst%em_roof , & ! Input: [real(r8) (:) ] roof emissivity - em_improad => urbanparams_inst%em_improad , & ! Input: [real(r8) (:) ] impervious road emissivity - em_perroad => urbanparams_inst%em_perroad , & ! Input: [real(r8) (:) ] pervious road emissivity - em_wall => urbanparams_inst%em_wall , & ! Input: [real(r8) (:) ] wall emissivity - - albd => surfalb_inst%albd_patch , & ! Input: [real(r8) (:,:) ] pft surface albedo (direct) - albi => surfalb_inst%albi_patch , & ! Input: [real(r8) (:,:) ] pft surface albedo (diffuse) - - sabs_roof_dir => solarabs_inst%sabs_roof_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by roof per unit ground area per unit incident flux - sabs_roof_dif => solarabs_inst%sabs_roof_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by roof per unit ground area per unit incident flux - sabs_sunwall_dir => solarabs_inst%sabs_sunwall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by sunwall per unit wall area per unit incident flux - sabs_sunwall_dif => solarabs_inst%sabs_sunwall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by sunwall per unit wall area per unit incident flux - sabs_shadewall_dir => solarabs_inst%sabs_shadewall_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by shadewall per unit wall area per unit incident flux - sabs_shadewall_dif => solarabs_inst%sabs_shadewall_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by shadewall per unit wall area per unit incident flux - sabs_improad_dir => solarabs_inst%sabs_improad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by impervious road per unit ground area per unit incident flux - sabs_improad_dif => solarabs_inst%sabs_improad_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by impervious road per unit ground area per unit incident flux - sabs_perroad_dir => solarabs_inst%sabs_perroad_dir_lun , & ! Output: [real(r8) (:,:) ] direct solar absorbed by pervious road per unit ground area per unit incident flux - sabs_perroad_dif => solarabs_inst%sabs_perroad_dif_lun , & ! Output: [real(r8) (:,:) ] diffuse solar absorbed by pervious road per unit ground area per unit incident flux - sabg => solarabs_inst%sabg_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by ground (W/m**2) - sabv => solarabs_inst%sabv_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed by vegetation (W/m**2) - fsa => solarabs_inst%fsa_patch , & ! Output: [real(r8) (:) ] solar radiation absorbed (total) (W/m**2) - fsa_u => solarabs_inst%fsa_u_patch , & ! Output: [real(r8) (:) ] urban solar radiation absorbed (total) (W/m**2) - - eflx_lwrad_out => energyflux_inst%eflx_lwrad_out_patch , & ! Output: [real(r8) (:) ] emitted infrared (longwave) radiation (W/m**2) - eflx_lwrad_net => energyflux_inst%eflx_lwrad_net_patch , & ! Output: [real(r8) (:) ] net infrared (longwave) rad (W/m**2) [+ = to atm] - eflx_lwrad_net_u => energyflux_inst%eflx_lwrad_net_u_patch , & ! Output: [real(r8) (:) ] urban net infrared (longwave) rad (W/m**2) [+ = to atm] - - begl => bounds%begl , & - endl => bounds%endl & - ) - - ! Define fields that appear on the restart file for non-urban landunits - - do fl = 1,num_nourbanl - l = filter_nourbanl(fl) - sabs_roof_dir(l,:) = spval - sabs_roof_dif(l,:) = spval - sabs_sunwall_dir(l,:) = spval - sabs_sunwall_dif(l,:) = spval - sabs_shadewall_dir(l,:) = spval - sabs_shadewall_dif(l,:) = spval - sabs_improad_dir(l,:) = spval - sabs_improad_dif(l,:) = spval - sabs_perroad_dir(l,:) = spval - sabs_perroad_dif(l,:) = spval - end do - - ! Set input forcing fields - do fl = 1,num_urbanl - l = filter_urbanl(fl) - g = lun%gridcell(l) - - ! Need to set the following temperatures to some defined value even if it - ! does not appear in the urban landunit for the net_longwave computation - - t_roof(l) = 19._r8 + tfrz - t_sunwall(l) = 19._r8 + tfrz - t_shadewall(l) = 19._r8 + tfrz - t_improad(l) = 19._r8 + tfrz - t_perroad(l) = 19._r8 + tfrz - - ! Initial assignment of emissivity - em_roof_s(l) = em_roof(l) - em_improad_s(l) = em_improad(l) - em_perroad_s(l) = em_perroad(l) - - ! Set urban temperatures and emissivity including snow effects. - do c = coli(l),colf(l) - if (ctype(c) == icol_roof ) then - t_roof(l) = t_grnd(c) - em_roof_s(l) = em_roof(l)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_road_imperv) then - t_improad(l) = t_grnd(c) - em_improad_s(l) = em_improad(l)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_road_perv ) then - t_perroad(l) = t_grnd(c) - em_perroad_s(l) = em_perroad(l)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_sunwall ) then - t_sunwall(l) = t_grnd(c) - else if (ctype(c) == icol_shadewall ) then - t_shadewall(l) = t_grnd(c) - end if - end do - lwdown(l) = forc_lwrad(g) - end do - - ! Net longwave radiation for road and both walls in urban canyon allowing for multiple re-emission - - if (num_urbanl > 0) then - call net_longwave (bounds, & - num_urbanl, filter_urbanl, & - canyon_hwr(begl:endl), & - wtroad_perv(begl:endl), & - lwdown(begl:endl), & - em_roof_s(begl:endl), & - em_improad_s(begl:endl), & - em_perroad_s(begl:endl), & - em_wall(begl:endl), & - t_roof(begl:endl), & - t_improad(begl:endl), & - t_perroad(begl:endl), & - t_sunwall(begl:endl), & - t_shadewall(begl:endl), & - lwnet_roof(begl:endl), & - lwnet_improad(begl:endl), & - lwnet_perroad(begl:endl), & - lwnet_sunwall(begl:endl), & - lwnet_shadewall(begl:endl), & - lwnet_canyon(begl:endl), & - lwup_roof(begl:endl), & - lwup_improad(begl:endl), & - lwup_perroad(begl:endl), & - lwup_sunwall(begl:endl), & - lwup_shadewall(begl:endl), & - lwup_canyon(begl:endl), & - urbanparams_inst) - end if - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Determine variables needed for history output and communication with atm - ! Loop over urban patches in clump - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - - ! Solar absorbed and longwave out and net - ! per unit ground area (roof, road) and per unit wall area (sunwall, shadewall) - ! Each urban pft has its own column - this is used in the logic below - - if (ctype(c) == icol_roof) then - eflx_lwrad_out(p) = lwup_roof(l) - eflx_lwrad_net(p) = lwnet_roof(l) - eflx_lwrad_net_u(p) = lwnet_roof(l) - sabg(p) = sabs_roof_dir(l,1)*forc_solad(g,1) + & - sabs_roof_dif(l,1)*forc_solai(g,1) + & - sabs_roof_dir(l,2)*forc_solad(g,2) + & - sabs_roof_dif(l,2)*forc_solai(g,2) - - else if (ctype(c) == icol_sunwall) then - eflx_lwrad_out(p) = lwup_sunwall(l) - eflx_lwrad_net(p) = lwnet_sunwall(l) - eflx_lwrad_net_u(p) = lwnet_sunwall(l) - sabg(p) = sabs_sunwall_dir(l,1)*forc_solad(g,1) + & - sabs_sunwall_dif(l,1)*forc_solai(g,1) + & - sabs_sunwall_dir(l,2)*forc_solad(g,2) + & - sabs_sunwall_dif(l,2)*forc_solai(g,2) - - else if (ctype(c) == icol_shadewall) then - eflx_lwrad_out(p) = lwup_shadewall(l) - eflx_lwrad_net(p) = lwnet_shadewall(l) - eflx_lwrad_net_u(p) = lwnet_shadewall(l) - sabg(p) = sabs_shadewall_dir(l,1)*forc_solad(g,1) + & - sabs_shadewall_dif(l,1)*forc_solai(g,1) + & - sabs_shadewall_dir(l,2)*forc_solad(g,2) + & - sabs_shadewall_dif(l,2)*forc_solai(g,2) - - else if (ctype(c) == icol_road_perv) then - eflx_lwrad_out(p) = lwup_perroad(l) - eflx_lwrad_net(p) = lwnet_perroad(l) - eflx_lwrad_net_u(p) = lwnet_perroad(l) - sabg(p) = sabs_perroad_dir(l,1)*forc_solad(g,1) + & - sabs_perroad_dif(l,1)*forc_solai(g,1) + & - sabs_perroad_dir(l,2)*forc_solad(g,2) + & - sabs_perroad_dif(l,2)*forc_solai(g,2) - - else if (ctype(c) == icol_road_imperv) then - eflx_lwrad_out(p) = lwup_improad(l) - eflx_lwrad_net(p) = lwnet_improad(l) - eflx_lwrad_net_u(p) = lwnet_improad(l) - sabg(p) = sabs_improad_dir(l,1)*forc_solad(g,1) + & - sabs_improad_dif(l,1)*forc_solai(g,1) + & - sabs_improad_dir(l,2)*forc_solad(g,2) + & - sabs_improad_dif(l,2)*forc_solai(g,2) - end if - - sabv(p) = 0._r8 - fsa(p) = sabv(p) + sabg(p) - fsa_u(p) = fsa(p) - - end do ! end loop over urban patches - - end associate - - end subroutine UrbanRadiation - - !----------------------------------------------------------------------- - subroutine net_longwave (bounds , & - num_urbanl, filter_urbanl, canyon_hwr, wtroad_perv , & - lwdown, em_roof, em_improad, em_perroad, em_wall , & - t_roof, t_improad, t_perroad, t_sunwall, t_shadewall , & - lwnet_roof, lwnet_improad, lwnet_perroad, lwnet_sunwall, lwnet_shadewall, lwnet_canyon , & - lwup_roof, lwup_improad, lwup_perroad, lwup_sunwall, lwup_shadewall, lwup_canyon, & - urbanparams_inst) - ! - ! !DESCRIPTION: - ! Net longwave radiation for road and both walls in urban canyon allowing for - ! multiple reflection. Also net longwave radiation for urban roof. - ! - ! !USES: - use clm_varcon , only : sb - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8), intent(in) :: canyon_hwr( bounds%begl: ) ! ratio of building height to street width [landunit] - real(r8), intent(in) :: wtroad_perv( bounds%begl: ) ! weight of pervious road wrt total road [landunit] - - real(r8), intent(in) :: lwdown( bounds%begl: ) ! atmospheric longwave radiation (W/m**2) [landunit] - real(r8), intent(in) :: em_roof( bounds%begl: ) ! roof emissivity [landunit] - real(r8), intent(in) :: em_improad( bounds%begl: ) ! impervious road emissivity [landunit] - real(r8), intent(in) :: em_perroad( bounds%begl: ) ! pervious road emissivity [landunit] - real(r8), intent(in) :: em_wall( bounds%begl: ) ! wall emissivity [landunit] - - real(r8), intent(in) :: t_roof( bounds%begl: ) ! roof temperature (K) [landunit] - real(r8), intent(in) :: t_improad( bounds%begl: ) ! impervious road temperature (K) [landunit] - real(r8), intent(in) :: t_perroad( bounds%begl: ) ! ervious road temperature (K) [landunit] - real(r8), intent(in) :: t_sunwall( bounds%begl: ) ! sunlit wall temperature (K) [landunit] - real(r8), intent(in) :: t_shadewall( bounds%begl: ) ! shaded wall temperature (K) [landunit] - - real(r8), intent(out) :: lwnet_roof( bounds%begl: ) ! net (outgoing-incoming) longwave radiation, roof (W/m**2) [landunit] - real(r8), intent(out) :: lwnet_improad( bounds%begl: ) ! net (outgoing-incoming) longwave radiation, impervious road (W/m**2) [landunit] - real(r8), intent(out) :: lwnet_perroad( bounds%begl: ) ! net (outgoing-incoming) longwave radiation, pervious road (W/m**2) [landunit] - real(r8), intent(out) :: lwnet_sunwall( bounds%begl: ) ! net (outgoing-incoming) longwave radiation (per unit wall area), sunlit wall (W/m**2) [landunit] - real(r8), intent(out) :: lwnet_shadewall( bounds%begl: ) ! net (outgoing-incoming) longwave radiation (per unit wall area), shaded wall (W/m**2) [landunit] - real(r8), intent(out) :: lwnet_canyon( bounds%begl: ) ! net (outgoing-incoming) longwave radiation for canyon, per unit ground area (W/m**2) [landunit] - - real(r8), intent(out) :: lwup_roof( bounds%begl: ) ! upward longwave radiation, roof (W/m**2) [landunit] - real(r8), intent(out) :: lwup_improad( bounds%begl: ) ! upward longwave radiation, impervious road (W/m**2) [landunit] - real(r8), intent(out) :: lwup_perroad( bounds%begl: ) ! upward longwave radiation, pervious road (W/m**2) [landunit] - real(r8), intent(out) :: lwup_sunwall( bounds%begl: ) ! upward longwave radiation (per unit wall area), sunlit wall (W/m**2) [landunit] - real(r8), intent(out) :: lwup_shadewall( bounds%begl: ) ! upward longwave radiation (per unit wall area), shaded wall (W/m**2) [landunit] - real(r8), intent(out) :: lwup_canyon( bounds%begl: ) ! upward longwave radiation for canyon, per unit ground area (W/m**2) [landunit] - ! - type(urbanparams_type) , intent(in) :: urbanparams_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: lwdown_road(bounds%begl:bounds%endl) ! atmospheric longwave radiation for total road (W/m**2) - real(r8) :: lwdown_sunwall(bounds%begl:bounds%endl) ! atmospheric longwave radiation (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: lwdown_shadewall(bounds%begl:bounds%endl) ! atmospheric longwave radiation (per unit wall area) for shaded wall (W/m**2) - real(r8) :: lwtot(bounds%begl:bounds%endl) ! incoming longwave radiation (W/m**2) - - real(r8) :: improad_a(bounds%begl:bounds%endl) ! absorbed longwave for improad (W/m**2) - real(r8) :: improad_r(bounds%begl:bounds%endl) ! reflected longwave for improad (W/m**2) - real(r8) :: improad_r_sky(bounds%begl:bounds%endl) ! improad_r to sky (W/m**2) - real(r8) :: improad_r_sunwall(bounds%begl:bounds%endl) ! improad_r to sunlit wall (W/m**2) - real(r8) :: improad_r_shadewall(bounds%begl:bounds%endl) ! improad_r to shaded wall (W/m**2) - real(r8) :: improad_e(bounds%begl:bounds%endl) ! emitted longwave for improad (W/m**2) - real(r8) :: improad_e_sky(bounds%begl:bounds%endl) ! improad_e to sky (W/m**2) - real(r8) :: improad_e_sunwall(bounds%begl:bounds%endl) ! improad_e to sunlit wall (W/m**2) - real(r8) :: improad_e_shadewall(bounds%begl:bounds%endl) ! improad_e to shaded wall (W/m**2) - - real(r8) :: perroad_a(bounds%begl:bounds%endl) ! absorbed longwave for perroad (W/m**2) - real(r8) :: perroad_r(bounds%begl:bounds%endl) ! reflected longwave for perroad (W/m**2) - real(r8) :: perroad_r_sky(bounds%begl:bounds%endl) ! perroad_r to sky (W/m**2) - real(r8) :: perroad_r_sunwall(bounds%begl:bounds%endl) ! perroad_r to sunlit wall (W/m**2) - real(r8) :: perroad_r_shadewall(bounds%begl:bounds%endl) ! perroad_r to shaded wall (W/m**2) - real(r8) :: perroad_e(bounds%begl:bounds%endl) ! emitted longwave for perroad (W/m**2) - real(r8) :: perroad_e_sky(bounds%begl:bounds%endl) ! perroad_e to sky (W/m**2) - real(r8) :: perroad_e_sunwall(bounds%begl:bounds%endl) ! perroad_e to sunlit wall (W/m**2) - real(r8) :: perroad_e_shadewall(bounds%begl:bounds%endl) ! perroad_e to shaded wall (W/m**2) - - real(r8) :: road_a(bounds%begl:bounds%endl) ! absorbed longwave for total road (W/m**2) - real(r8) :: road_r(bounds%begl:bounds%endl) ! reflected longwave for total road (W/m**2) - real(r8) :: road_r_sky(bounds%begl:bounds%endl) ! total road_r to sky (W/m**2) - real(r8) :: road_r_sunwall(bounds%begl:bounds%endl) ! total road_r to sunlit wall (W/m**2) - real(r8) :: road_r_shadewall(bounds%begl:bounds%endl) ! total road_r to shaded wall (W/m**2) - real(r8) :: road_e(bounds%begl:bounds%endl) ! emitted longwave for total road (W/m**2) - real(r8) :: road_e_sky(bounds%begl:bounds%endl) ! total road_e to sky (W/m**2) - real(r8) :: road_e_sunwall(bounds%begl:bounds%endl) ! total road_e to sunlit wall (W/m**2) - real(r8) :: road_e_shadewall(bounds%begl:bounds%endl) ! total road_e to shaded wall (W/m**2) - - real(r8) :: sunwall_a(bounds%begl:bounds%endl) ! absorbed longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_r(bounds%begl:bounds%endl) ! reflected longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_r_sky(bounds%begl:bounds%endl) ! sunwall_r to sky (W/m**2) - real(r8) :: sunwall_r_road(bounds%begl:bounds%endl) ! sunwall_r to road (W/m**2) - real(r8) :: sunwall_r_shadewall(bounds%begl:bounds%endl) ! sunwall_r to opposing (shaded) wall (W/m**2) - real(r8) :: sunwall_e(bounds%begl:bounds%endl) ! emitted longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_e_sky(bounds%begl:bounds%endl) ! sunwall_e to sky (W/m**2) - real(r8) :: sunwall_e_road(bounds%begl:bounds%endl) ! sunwall_e to road (W/m**2) - real(r8) :: sunwall_e_shadewall(bounds%begl:bounds%endl) ! sunwall_e to opposing (shaded) wall (W/m**2) - - real(r8) :: shadewall_a(bounds%begl:bounds%endl) ! absorbed longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_r(bounds%begl:bounds%endl) ! reflected longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_r_sky(bounds%begl:bounds%endl) ! shadewall_r to sky (W/m**2) - real(r8) :: shadewall_r_road(bounds%begl:bounds%endl) ! shadewall_r to road (W/m**2) - real(r8) :: shadewall_r_sunwall(bounds%begl:bounds%endl) ! shadewall_r to opposing (sunlit) wall (W/m**2) - real(r8) :: shadewall_e(bounds%begl:bounds%endl) ! emitted longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_e_sky(bounds%begl:bounds%endl) ! shadewall_e to sky (W/m**2) - real(r8) :: shadewall_e_road(bounds%begl:bounds%endl) ! shadewall_e to road (W/m**2) - real(r8) :: shadewall_e_sunwall(bounds%begl:bounds%endl) ! shadewall_e to opposing (sunlit) wall (W/m**2) - integer :: l,fl,iter ! indices - integer, parameter :: n = 50 ! number of interations - real(r8) :: crit ! convergence criterion (W/m**2) - real(r8) :: err ! energy conservation error (W/m**2) - real(r8) :: wtroad_imperv(bounds%begl:bounds%endl) ! weight of impervious road wrt total road - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - - SHR_ASSERT_ALL((ubound(canyon_hwr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wtroad_perv) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwdown) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_roof) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_improad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_perroad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(em_wall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_roof) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_improad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_perroad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_sunwall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_shadewall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_roof) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_improad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_perroad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_sunwall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_shadewall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwnet_canyon) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_roof) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_improad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_perroad) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_sunwall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_shadewall) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(lwup_canyon) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - associate( & - vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:)] view factor of sky for road - vf_wr => urbanparams_inst%vf_wr , & ! Input: [real(r8) (:)] view factor of one wall for road - vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:)] view factor of sky for one wall - vf_rw => urbanparams_inst%vf_rw , & ! Input: [real(r8) (:)] view factor of road for one wall - vf_ww => urbanparams_inst%vf_ww & ! Input: [real(r8) (:)] view factor of opposing wall for one wall - ) - - ! Calculate impervious road - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - wtroad_imperv(l) = 1._r8 - wtroad_perv(l) - end do - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - ! atmospheric longwave radiation incident on walls and road in urban canyon. - ! check for conservation (need to convert wall fluxes to ground area). - ! lwdown (from atmosphere) = lwdown_road + (lwdown_sunwall + lwdown_shadewall)*canyon_hwr - - lwdown_road(l) = lwdown(l) * vf_sr(l) - lwdown_sunwall(l) = lwdown(l) * vf_sw(l) - lwdown_shadewall(l) = lwdown(l) * vf_sw(l) - - err = lwdown(l) - (lwdown_road(l) + (lwdown_shadewall(l) + lwdown_sunwall(l))*canyon_hwr(l)) - if (abs(err) > 0.10_r8 ) then - write(iulog,*) 'urban incident atmospheric longwave radiation balance error',err - write(iulog,*) 'l = ',l - write(iulog,*) 'lwdown = ',lwdown(l) - write(iulog,*) 'vf_sr = ',vf_sr(l) - write(iulog,*) 'vf_sw = ',vf_sw(l) - write(iulog,*) 'canyon_hwr = ',canyon_hwr(l) - write(iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - end do - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - ! initial absorption, reflection, and emission for road and both walls. - ! distribute reflected and emitted radiation to sky, road, and walls according - ! to appropriate view factor. radiation reflected to road and walls will - ! undergo multiple reflections within the canyon. - - road_a(l) = 0.0_r8 - road_r(l) = 0.0_r8 - road_e(l) = 0.0_r8 - improad_a(l) = em_improad(l) * lwdown_road(l) - improad_r(l) = (1._r8-em_improad(l)) * lwdown_road(l) - improad_r_sky(l) = improad_r(l) * vf_sr(l) - improad_r_sunwall(l) = improad_r(l) * vf_wr(l) - improad_r_shadewall(l) = improad_r(l) * vf_wr(l) - improad_e(l) = em_improad(l) * sb * (t_improad(l)**4) - improad_e_sky(l) = improad_e(l) * vf_sr(l) - improad_e_sunwall(l) = improad_e(l) * vf_wr(l) - improad_e_shadewall(l) = improad_e(l) * vf_wr(l) - road_a(l) = road_a(l) + improad_a(l)*wtroad_imperv(l) - road_r(l) = road_r(l) + improad_r(l)*wtroad_imperv(l) - road_e(l) = road_e(l) + improad_e(l)*wtroad_imperv(l) - - perroad_a(l) = em_perroad(l) * lwdown_road(l) - perroad_r(l) = (1._r8-em_perroad(l)) * lwdown_road(l) - perroad_r_sky(l) = perroad_r(l) * vf_sr(l) - perroad_r_sunwall(l) = perroad_r(l) * vf_wr(l) - perroad_r_shadewall(l) = perroad_r(l) * vf_wr(l) - perroad_e(l) = em_perroad(l) * sb * (t_perroad(l)**4) - perroad_e_sky(l) = perroad_e(l) * vf_sr(l) - perroad_e_sunwall(l) = perroad_e(l) * vf_wr(l) - perroad_e_shadewall(l) = perroad_e(l) * vf_wr(l) - road_a(l) = road_a(l) + perroad_a(l)*wtroad_perv(l) - road_r(l) = road_r(l) + perroad_r(l)*wtroad_perv(l) - road_e(l) = road_e(l) + perroad_e(l)*wtroad_perv(l) - - road_r_sky(l) = road_r(l) * vf_sr(l) - road_r_sunwall(l) = road_r(l) * vf_wr(l) - road_r_shadewall(l) = road_r(l) * vf_wr(l) - road_e_sky(l) = road_e(l) * vf_sr(l) - road_e_sunwall(l) = road_e(l) * vf_wr(l) - road_e_shadewall(l) = road_e(l) * vf_wr(l) - - sunwall_a(l) = em_wall(l) * lwdown_sunwall(l) - sunwall_r(l) = (1._r8-em_wall(l)) * lwdown_sunwall(l) - sunwall_r_sky(l) = sunwall_r(l) * vf_sw(l) - sunwall_r_road(l) = sunwall_r(l) * vf_rw(l) - sunwall_r_shadewall(l) = sunwall_r(l) * vf_ww(l) - sunwall_e(l) = em_wall(l) * sb * (t_sunwall(l)**4) - sunwall_e_sky(l) = sunwall_e(l) * vf_sw(l) - sunwall_e_road(l) = sunwall_e(l) * vf_rw(l) - sunwall_e_shadewall(l) = sunwall_e(l) * vf_ww(l) - - shadewall_a(l) = em_wall(l) * lwdown_shadewall(l) - shadewall_r(l) = (1._r8-em_wall(l)) * lwdown_shadewall(l) - shadewall_r_sky(l) = shadewall_r(l) * vf_sw(l) - shadewall_r_road(l) = shadewall_r(l) * vf_rw(l) - shadewall_r_sunwall(l) = shadewall_r(l) * vf_ww(l) - shadewall_e(l) = em_wall(l) * sb * (t_shadewall(l)**4) - shadewall_e_sky(l) = shadewall_e(l) * vf_sw(l) - shadewall_e_road(l) = shadewall_e(l) * vf_rw(l) - shadewall_e_sunwall(l) = shadewall_e(l) * vf_ww(l) - - ! initialize sum of net and upward longwave radiation for road and both walls - - lwnet_improad(l) = improad_e(l) - improad_a(l) - lwnet_perroad(l) = perroad_e(l) - perroad_a(l) - lwnet_sunwall(l) = sunwall_e(l) - sunwall_a(l) - lwnet_shadewall(l) = shadewall_e(l) - shadewall_a(l) - - lwup_improad(l) = improad_r_sky(l) + improad_e_sky(l) - lwup_perroad(l) = perroad_r_sky(l) + perroad_e_sky(l) - lwup_sunwall(l) = sunwall_r_sky(l) + sunwall_e_sky(l) - lwup_shadewall(l) = shadewall_r_sky(l) + shadewall_e_sky(l) - - end do - - ! now account for absorption and reflection within canyon of fluxes from road and walls - ! allowing for multiple reflections - ! - ! (1) absorption and reflection. note: emission from road and walls absorbed by walls and roads - ! only occurs in first iteration. zero out for later iterations. - ! - ! road: fluxes from walls need to be projected to ground area - ! wall: fluxes from road need to be projected to wall area - ! - ! (2) add net longwave for ith reflection to total net longwave - ! - ! (3) distribute reflected radiation to sky, road, and walls according to view factors - ! - ! (4) add upward longwave radiation to sky from road and walls for ith reflection to total - ! - ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. - ! small convergence criteria is required to ensure radiation is conserved - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - do iter = 1, n - ! step (1) - - lwtot(l) = (sunwall_r_road(l) + sunwall_e_road(l) & - + shadewall_r_road(l) + shadewall_e_road(l))*canyon_hwr(l) - road_a(l) = 0.0_r8 - road_r(l) = 0.0_r8 - improad_r(l) = (1._r8-em_improad(l)) * lwtot(l) - improad_a(l) = em_improad(l) * lwtot(l) - road_a(l) = road_a(l) + improad_a(l)*wtroad_imperv(l) - road_r(l) = road_r(l) + improad_r(l)*wtroad_imperv(l) - perroad_r(l) = (1._r8-em_perroad(l)) * lwtot(l) - perroad_a(l) = em_perroad(l) * lwtot(l) - road_a(l) = road_a(l) + perroad_a(l)*wtroad_perv(l) - road_r(l) = road_r(l) + perroad_r(l)*wtroad_perv(l) - - lwtot(l) = (road_r_sunwall(l) + road_e_sunwall(l))/canyon_hwr(l) & - + (shadewall_r_sunwall(l) + shadewall_e_sunwall(l)) - sunwall_a(l) = em_wall(l) * lwtot(l) - sunwall_r(l) = (1._r8-em_wall(l)) * lwtot(l) - - lwtot(l) = (road_r_shadewall(l) + road_e_shadewall(l))/canyon_hwr(l) & - + (sunwall_r_shadewall(l) + sunwall_e_shadewall(l)) - shadewall_a(l) = em_wall(l) * lwtot(l) - shadewall_r(l) = (1._r8-em_wall(l)) * lwtot(l) - - sunwall_e_road(l) = 0._r8 - shadewall_e_road(l) = 0._r8 - road_e_sunwall(l) = 0._r8 - shadewall_e_sunwall(l) = 0._r8 - road_e_shadewall(l) = 0._r8 - sunwall_e_shadewall(l) = 0._r8 - - ! step (2) - - lwnet_improad(l) = lwnet_improad(l) - improad_a(l) - lwnet_perroad(l) = lwnet_perroad(l) - perroad_a(l) - lwnet_sunwall(l) = lwnet_sunwall(l) - sunwall_a(l) - lwnet_shadewall(l) = lwnet_shadewall(l) - shadewall_a(l) - - ! step (3) - - improad_r_sky(l) = improad_r(l) * vf_sr(l) - improad_r_sunwall(l) = improad_r(l) * vf_wr(l) - improad_r_shadewall(l) = improad_r(l) * vf_wr(l) - - perroad_r_sky(l) = perroad_r(l) * vf_sr(l) - perroad_r_sunwall(l) = perroad_r(l) * vf_wr(l) - perroad_r_shadewall(l) = perroad_r(l) * vf_wr(l) - - road_r_sky(l) = road_r(l) * vf_sr(l) - road_r_sunwall(l) = road_r(l) * vf_wr(l) - road_r_shadewall(l) = road_r(l) * vf_wr(l) - - sunwall_r_sky(l) = sunwall_r(l) * vf_sw(l) - sunwall_r_road(l) = sunwall_r(l) * vf_rw(l) - sunwall_r_shadewall(l) = sunwall_r(l) * vf_ww(l) - - shadewall_r_sky(l) = shadewall_r(l) * vf_sw(l) - shadewall_r_road(l) = shadewall_r(l) * vf_rw(l) - shadewall_r_sunwall(l) = shadewall_r(l) * vf_ww(l) - - ! step (4) - - lwup_improad(l) = lwup_improad(l) + improad_r_sky(l) - lwup_perroad(l) = lwup_perroad(l) + perroad_r_sky(l) - lwup_sunwall(l) = lwup_sunwall(l) + sunwall_r_sky(l) - lwup_shadewall(l) = lwup_shadewall(l) + shadewall_r_sky(l) - - ! step (5) - - crit = max(road_a(l), sunwall_a(l), shadewall_a(l)) - if (crit < .001_r8) exit - end do - if (iter >= n) then - write (iulog,*) 'urban net longwave radiation error: no convergence' - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - endif - - ! total net longwave radiation for canyon. project wall fluxes to horizontal surface - - lwnet_canyon(l) = 0.0_r8 - lwnet_canyon(l) = lwnet_canyon(l) + lwnet_improad(l)*wtroad_imperv(l) - lwnet_canyon(l) = lwnet_canyon(l) + lwnet_perroad(l)*wtroad_perv(l) - lwnet_canyon(l) = lwnet_canyon(l) + (lwnet_sunwall(l) + lwnet_shadewall(l))*canyon_hwr(l) - - ! total emitted longwave for canyon. project wall fluxes to horizontal - - lwup_canyon(l) = 0.0_r8 - lwup_canyon(l) = lwup_canyon(l) + lwup_improad(l)*wtroad_imperv(l) - lwup_canyon(l) = lwup_canyon(l) + lwup_perroad(l)*wtroad_perv(l) - lwup_canyon(l) = lwup_canyon(l) + (lwup_sunwall(l) + lwup_shadewall(l))*canyon_hwr(l) - - ! conservation check. note: previous conservation check confirms partioning of incident - ! atmospheric longwave radiation to road and walls is conserved as - ! lwdown (from atmosphere) = lwdown_improad + lwdown_perroad + (lwdown_sunwall + lwdown_shadewall)*canyon_hwr - - err = lwnet_canyon(l) - (lwup_canyon(l) - lwdown(l)) - if (abs(err) > .10_r8 ) then - write (iulog,*) 'urban net longwave radiation balance error',err - write (iulog,*) 'clm model is stopping' - call endrun(decomp_index=l, clmlevel=namel, msg=errmsg(sourcefile, __LINE__)) - end if - - end do - - ! Net longwave radiation for roof - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - lwup_roof(l) = em_roof(l)*sb*(t_roof(l)**4) + (1._r8-em_roof(l))*lwdown(l) - lwnet_roof(l) = lwup_roof(l) - lwdown(l) - end do - - end associate - - end subroutine net_longwave - -end module UrbanRadiationMod diff --git a/src/biogeophys/UrbanTimeVarType.F90 b/src/biogeophys/UrbanTimeVarType.F90 deleted file mode 100644 index 81ceb9cf1e..0000000000 --- a/src/biogeophys/UrbanTimeVarType.F90 +++ /dev/null @@ -1,310 +0,0 @@ -module UrbanTimeVarType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Urban Time Varying Data - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varctl , only : iulog - use landunit_varcon , only : isturb_MIN, isturb_MAX - use clm_varcon , only : spval - use LandunitType , only : lun - use GridcellType , only : grc - use mct_mod - use shr_strdata_mod , only : shr_strdata_type - ! - implicit none - save - private - ! - ! - - ! !PUBLIC TYPE - type, public :: urbantv_type - - real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Allocate and initialize urbantv - procedure, public :: urbantv_init ! Initialize urban time varying stream - procedure, public :: urbantv_interp ! Interpolate urban time varying stream - - end type urbantv_type - - !----------------------------------------------------------------------- - character(15), private :: stream_var_name(isturb_MIN:isturb_MAX) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds, NLFilename) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl - !--------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Allocate urbantv data structure - - allocate(this%t_building_max (begl:endl)) ; this%t_building_max (:) = nan - - call this%urbantv_init(bounds, NLFilename) - call this%urbantv_interp(bounds) - - ! Add history fields - call hist_addfld1d (fname='TBUILD_MAX', units='K', & - avgflag='A', long_name='prescribed maximum interior building temperature', & - ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & - l2g_scale_type='unity') - - - end subroutine Init - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - subroutine urbantv_init(this, bounds, NLFilename) - ! - ! !DESCRIPTION: - ! Initialize data stream information for urban time varying data - ! - ! !USES: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use shr_mpi_mod , only : shr_mpi_bcast - use shr_string_mod , only : shr_string_listAppend - use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print - use decompMod , only : gsmap_lnd_gdc2glo - use domainMod , only : ldomain - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD - ! - ! !ARGUMENTS: - implicit none - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl ! landunits - integer :: ifield ! field index - integer :: stream_year_first_urbantv ! first year in urban tv stream to use - integer :: stream_year_last_urbantv ! last year in urban tv stream to use - integer :: model_year_align_urbantv ! align stream_year_first_urbantv - ! with this model year - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename - character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac - character(SHR_KIND_CL) :: fldList ! field string - character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string - character(*), parameter :: subName = "('urbantv_init')" - character(*), parameter :: F00 = "('(urbantv_init) ',4a)" - !----------------------------------------------------------------------- - namelist /urbantv_streams/ & - stream_year_first_urbantv, & - stream_year_last_urbantv, & - model_year_align_urbantv, & - urbantvmapalgo, & - stream_fldFileName_urbantv - !----------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Default values for namelist - stream_year_first_urbantv = 1 ! first year in stream to use - stream_year_last_urbantv = 1 ! last year in stream to use - model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year - stream_fldFileName_urbantv = ' ' - - ! Read urbantv_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'urbantv_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=urbantv_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading urbantv_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_urbantv, mpicom) - call shr_mpi_bcast(stream_year_last_urbantv, mpicom) - call shr_mpi_bcast(model_year_align_urbantv, mpicom) - call shr_mpi_bcast(stream_fldFileName_urbantv, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'urbantv_streams settings:' - write(iulog,*) ' stream_year_first_urbantv = ',stream_year_first_urbantv - write(iulog,*) ' stream_year_last_urbantv = ',stream_year_last_urbantv - write(iulog,*) ' model_year_align_urbantv = ',model_year_align_urbantv - write(iulog,*) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - ! create the field list for these urbantv fields...use in shr_strdata_create - stream_var_name(:) = "NOT_SET" - stream_var_name(isturb_TBD) = urbantvString//"TBD" - stream_var_name(isturb_HD) = urbantvString//"HD" - stream_var_name(isturb_MD) = urbantvString//"MD" - fldList = "" - do ifield = isturb_MIN, isturb_MAX - call shr_string_listAppend( fldList, stream_var_name(ifield) ) - end do - - call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_urbantv, & - yearLast=stream_year_last_urbantv, & - yearAlign=model_year_align_urbantv, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_urbantv), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(stream_fldFileName_urbantv)/) , & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=urbantvmapalgo, & - calendar=get_calendar(), & - tintalgo='linear', & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_urbantv,'urban time varying data') - endif - - - end subroutine urbantv_init - - !----------------------------------------------------------------------- - subroutine urbantv_interp(this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for urban time varying data. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use spmdMod , only : mpicom - use shr_strdata_mod , only : shr_strdata_advance - use clm_instur , only : urban_valid - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - logical :: found - integer :: l, glun, ig, g, ip - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - integer :: lindx ! landunit index - integer :: gindx ! gridcell index - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_urbantv, mcdate, sec, mpicom, 'urbantvdyn') - - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ip = mct_aVect_indexRA(this%sdat_urbantv%avs(1),trim(stream_var_name(lun%itype(l)))) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - this%t_building_max(l) = this%sdat_urbantv%avs(1)%rAttr(ip,ig) - else - this%t_building_max(l) = spval - end if - end do - - found = .false. - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then - found = .true. - gindx = g - lindx = l - exit - end if - end if - end do - if ( found ) then - write(iulog,*)'ERROR: no valid urban data for g= ',gindx - write(iulog,*)'landunit type: ',lun%itype(l) - write(iulog,*)'urban_valid: ',urban_valid(gindx) - write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - call endrun(msg=errmsg(sourcefile, __LINE__)) - end if - - - end subroutine urbantv_interp - - !----------------------------------------------------------------------- - -end module UrbanTimeVarType diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 deleted file mode 100644 index 9493a8a68a..0000000000 --- a/src/biogeophys/WaterStateType.F90 +++ /dev/null @@ -1,1137 +0,0 @@ -module WaterstateType - -#include "shr_assert.h" - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Module variables for hydrology - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varctl , only : use_vancouver, use_mexicocity, use_cn, iulog, use_luna - use clm_varpar , only : nlevgrnd, nlevurb, nlevsno - use clm_varcon , only : spval - use LandunitType , only : lun - use ColumnType , only : col - ! - implicit none - save - private - ! - ! !PUBLIC TYPES: - type, public :: waterstate_type - - real(r8), pointer :: snow_depth_col (:) ! col snow height of snow covered area (m) - real(r8), pointer :: snow_persistence_col (:) ! col length of time that ground has had non-zero snow thickness (sec) - real(r8), pointer :: snowdp_col (:) ! col area-averaged snow height (m) - real(r8), pointer :: snowice_col (:) ! col average snow ice lens - real(r8), pointer :: snowliq_col (:) ! col average snow liquid water - real(r8), pointer :: int_snow_col (:) ! col integrated snowfall (mm H2O) - real(r8), pointer :: snow_layer_unity_col (:,:) ! value 1 for each snow layer, used for history diagnostics - real(r8), pointer :: bw_col (:,:) ! col partial density of water in the snow pack (ice + liquid) [kg/m3] - - real(r8), pointer :: h2osno_col (:) ! col snow water (mm H2O) - real(r8), pointer :: h2osno_old_col (:) ! col snow mass for previous time step (kg/m2) (new) - real(r8), pointer :: h2osoi_liq_col (:,:) ! col liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_ice_col (:,:) ! col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_liq_tot_col (:) ! vertically summed col liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_ice_tot_col (:) ! vertically summed col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_liqice_10cm_col (:) ! col liquid water + ice lens in top 10cm of soil (kg/m2) - real(r8), pointer :: h2osoi_vol_col (:,:) ! col volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) - real(r8), pointer :: air_vol_col (:,:) ! col air filled porosity - real(r8), pointer :: h2osoi_liqvol_col (:,:) ! col volumetric liquid water content (v/v) - real(r8), pointer :: h2ocan_patch (:) ! patch canopy water (mm H2O) - real(r8), pointer :: h2osfc_col (:) ! col surface water (mm H2O) - real(r8), pointer :: snocan_patch (:) ! patch canopy snow water (mm H2O) - real(r8), pointer :: liqcan_patch (:) ! patch canopy liquid water (mm H2O) - real(r8), pointer :: snounload_patch (:) ! Canopy snow unloading (mm H2O) - real(r8), pointer :: swe_old_col (:,:) ! col initial snow water - real(r8), pointer :: liq1_grc (:) ! grc initial gridcell total h2o liq content - real(r8), pointer :: liq2_grc (:) ! grc post land cover change total liq content - real(r8), pointer :: ice1_grc (:) ! grc initial gridcell total h2o ice content - real(r8), pointer :: ice2_grc (:) ! grc post land cover change total ice content - real(r8), pointer :: tws_grc (:) ! grc total water storage (mm H2O) - - real(r8), pointer :: total_plant_stored_h2o_col(:) ! col water that is bound in plants, including roots, sapwood, leaves, etc - ! in most cases, the vegetation scheme does not have a dynamic - ! water storage in plants, and thus 0.0 is a suitable for the trivial case. - ! When FATES is coupled in with plant hydraulics turned on, this storage - ! term is set to non-zero. (kg/m2 H2O) - - real(r8), pointer :: snw_rds_col (:,:) ! col snow grain radius (col,lyr) [m^-6, microns] - real(r8), pointer :: snw_rds_top_col (:) ! col snow grain radius (top layer) [m^-6, microns] - real(r8), pointer :: h2osno_top_col (:) ! col top-layer mass of snow [kg] - real(r8), pointer :: sno_liq_top_col (:) ! col snow liquid water fraction (mass), top layer [fraction] - - real(r8), pointer :: q_ref2m_patch (:) ! patch 2 m height surface specific humidity (kg/kg) - real(r8), pointer :: rh_ref2m_patch (:) ! patch 2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m_r_patch (:) ! patch 2 m height surface relative humidity - rural (%) - real(r8), pointer :: rh_ref2m_u_patch (:) ! patch 2 m height surface relative humidity - urban (%) - real(r8), pointer :: rh_af_patch (:) ! patch fractional humidity of canopy air (dimensionless) ! private - real(r8), pointer :: rh10_af_patch (:) ! 10-day mean patch fractional humidity of canopy air (dimensionless) - real(r8), pointer :: qg_snow_col (:) ! col ground specific humidity [kg/kg] - real(r8), pointer :: qg_soil_col (:) ! col ground specific humidity [kg/kg] - real(r8), pointer :: qg_h2osfc_col (:) ! col ground specific humidity [kg/kg] - real(r8), pointer :: qg_col (:) ! col ground specific humidity [kg/kg] - real(r8), pointer :: dqgdT_col (:) ! col d(qg)/dT - real(r8), pointer :: qaf_lun (:) ! lun urban canopy air specific humidity (kg/kg) - - ! Fractions - real(r8), pointer :: frac_sno_col (:) ! col fraction of ground covered by snow (0 to 1) - real(r8), pointer :: frac_sno_eff_col (:) ! col fraction of ground covered by snow (0 to 1) - real(r8), pointer :: frac_iceold_col (:,:) ! col fraction of ice relative to the tot water (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: frac_h2osfc_col (:) ! col fractional area with surface water greater than zero - real(r8), pointer :: frac_h2osfc_nosnow_col (:) ! col fractional area with surface water greater than zero (if no snow present) - real(r8), pointer :: wf_col (:) ! col soil water as frac. of whc for top 0.05 m (0-1) - real(r8), pointer :: wf2_col (:) ! col soil water as frac. of whc for top 0.17 m (0-1) - real(r8), pointer :: fwet_patch (:) ! patch canopy fraction that is wet (0 to 1) - real(r8), pointer :: fcansno_patch (:) ! patch canopy fraction that is snow covered (0 to 1) - real(r8), pointer :: fdry_patch (:) ! patch canopy fraction of foliage that is green and dry [-] (new) - - ! Balance Checks - - real(r8), pointer :: begwb_col (:) ! water mass begining of the time step - real(r8), pointer :: endwb_col (:) ! water mass end of the time step - real(r8), pointer :: errh2o_patch (:) ! water conservation error (mm H2O) - real(r8), pointer :: errh2o_col (:) ! water conservation error (mm H2O) - real(r8), pointer :: errh2osno_col (:) ! snow water conservation error(mm H2O) - - contains - - procedure :: Init - procedure :: Restart - procedure, public :: Reset - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type waterstate_type - - ! minimum allowed snow effective radius (also "fresh snow" value) [microns] - real(r8), public, parameter :: snw_rds_min = 54.526_r8 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, & - h2osno_input_col, snow_depth_input_col, watsat_col, t_soisno_col) - - class(waterstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(inout) :: h2osno_input_col(bounds%begc:) - real(r8) , intent(inout) :: snow_depth_input_col(bounds%begc:) - real(r8) , intent(inout) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) - real(r8) , intent(inout) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) - -#ifdef __PGI -# if __PGIC__ == 14 && __PGIC_MINOR__ == 7 - ! COMPILER_BUG(bja, 2015-04, pgi 14.7-?) occurs at: call this%InitCold(...) - ! PGF90-F-0000-Internal compiler error. normalize_forall_array: non-conformable - ! not sure why this fixes things.... - real(r8), allocatable :: workaround_for_pgi_internal_compiler_error(:) -# endif -#endif - - call this%InitAllocate(bounds) - - call this%InitHistory(bounds) - - call this%InitCold(bounds, & - h2osno_input_col, snow_depth_input_col, watsat_col, t_soisno_col) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(waterstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - begg = bounds%begg; endg= bounds%endg - - allocate(this%snow_depth_col (begc:endc)) ; this%snow_depth_col (:) = nan - allocate(this%snow_persistence_col (begc:endc)) ; this%snow_persistence_col (:) = nan - allocate(this%snowdp_col (begc:endc)) ; this%snowdp_col (:) = nan - allocate(this%snowice_col (begc:endc)) ; this%snowice_col (:) = nan - allocate(this%snowliq_col (begc:endc)) ; this%snowliq_col (:) = nan - allocate(this%int_snow_col (begc:endc)) ; this%int_snow_col (:) = nan - allocate(this%snow_layer_unity_col (begc:endc,-nlevsno+1:0)) ; this%snow_layer_unity_col (:,:) = nan - allocate(this%bw_col (begc:endc,-nlevsno+1:0)) ; this%bw_col (:,:) = nan - allocate(this%h2osno_col (begc:endc)) ; this%h2osno_col (:) = nan - allocate(this%h2osno_old_col (begc:endc)) ; this%h2osno_old_col (:) = nan - allocate(this%h2osoi_liqice_10cm_col (begc:endc)) ; this%h2osoi_liqice_10cm_col (:) = nan - allocate(this%h2osoi_vol_col (begc:endc, 1:nlevgrnd)) ; this%h2osoi_vol_col (:,:) = nan - allocate(this%air_vol_col (begc:endc, 1:nlevgrnd)) ; this%air_vol_col (:,:) = nan - allocate(this%h2osoi_liqvol_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_liqvol_col (:,:) = nan - allocate(this%h2osoi_ice_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_ice_col (:,:) = nan - allocate(this%h2osoi_liq_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%h2osoi_liq_col (:,:) = nan - allocate(this%h2osoi_ice_tot_col (begc:endc)) ; this%h2osoi_ice_tot_col (:) = nan - allocate(this%h2osoi_liq_tot_col (begc:endc)) ; this%h2osoi_liq_tot_col (:) = nan - allocate(this%h2ocan_patch (begp:endp)) ; this%h2ocan_patch (:) = nan - allocate(this%snocan_patch (begp:endp)) ; this%snocan_patch (:) = nan - allocate(this%liqcan_patch (begp:endp)) ; this%liqcan_patch (:) = nan - allocate(this%snounload_patch (begp:endp)) ; this%snounload_patch (:) = nan - allocate(this%h2osfc_col (begc:endc)) ; this%h2osfc_col (:) = nan - allocate(this%swe_old_col (begc:endc,-nlevsno+1:0)) ; this%swe_old_col (:,:) = nan - allocate(this%liq1_grc (begg:endg)) ; this%liq1_grc (:) = nan - allocate(this%liq2_grc (begg:endg)) ; this%liq2_grc (:) = nan - allocate(this%ice1_grc (begg:endg)) ; this%ice1_grc (:) = nan - allocate(this%ice2_grc (begg:endg)) ; this%ice2_grc (:) = nan - allocate(this%tws_grc (begg:endg)) ; this%tws_grc (:) = nan - - allocate(this%total_plant_stored_h2o_col(begc:endc)) ; this%total_plant_stored_h2o_col(:) = nan - - allocate(this%snw_rds_col (begc:endc,-nlevsno+1:0)) ; this%snw_rds_col (:,:) = nan - allocate(this%snw_rds_top_col (begc:endc)) ; this%snw_rds_top_col (:) = nan - allocate(this%h2osno_top_col (begc:endc)) ; this%h2osno_top_col (:) = nan - allocate(this%sno_liq_top_col (begc:endc)) ; this%sno_liq_top_col (:) = nan - - allocate(this%qg_snow_col (begc:endc)) ; this%qg_snow_col (:) = nan - allocate(this%qg_soil_col (begc:endc)) ; this%qg_soil_col (:) = nan - allocate(this%qg_h2osfc_col (begc:endc)) ; this%qg_h2osfc_col (:) = nan - allocate(this%qg_col (begc:endc)) ; this%qg_col (:) = nan - allocate(this%dqgdT_col (begc:endc)) ; this%dqgdT_col (:) = nan - allocate(this%qaf_lun (begl:endl)) ; this%qaf_lun (:) = nan - allocate(this%q_ref2m_patch (begp:endp)) ; this%q_ref2m_patch (:) = nan - allocate(this%rh_ref2m_patch (begp:endp)) ; this%rh_ref2m_patch (:) = nan - allocate(this%rh_ref2m_u_patch (begp:endp)) ; this%rh_ref2m_u_patch (:) = nan - allocate(this%rh_ref2m_r_patch (begp:endp)) ; this%rh_ref2m_r_patch (:) = nan - allocate(this%rh_af_patch (begp:endp)) ; this%rh_af_patch (:) = nan - allocate(this%rh10_af_patch (begp:endp)) ; this%rh10_af_patch (:) = spval - - allocate(this%frac_sno_col (begc:endc)) ; this%frac_sno_col (:) = nan - allocate(this%frac_sno_eff_col (begc:endc)) ; this%frac_sno_eff_col (:) = nan - allocate(this%frac_iceold_col (begc:endc,-nlevsno+1:nlevgrnd)) ; this%frac_iceold_col (:,:) = nan - allocate(this%frac_h2osfc_col (begc:endc)) ; this%frac_h2osfc_col (:) = nan - allocate(this%frac_h2osfc_nosnow_col (begc:endc)) ; this%frac_h2osfc_nosnow_col (:) = nan - allocate(this%wf_col (begc:endc)) ; this%wf_col (:) = nan - allocate(this%wf2_col (begc:endc)) ; - allocate(this%fwet_patch (begp:endp)) ; this%fwet_patch (:) = nan - allocate(this%fcansno_patch (begp:endp)) ; this%fcansno_patch (:) = nan - allocate(this%fdry_patch (begp:endp)) ; this%fdry_patch (:) = nan - - allocate(this%begwb_col (begc:endc)) ; this%begwb_col (:) = nan - allocate(this%endwb_col (begc:endc)) ; this%endwb_col (:) = nan - allocate(this%errh2o_patch (begp:endp)) ; this%errh2o_patch (:) = nan - allocate(this%errh2o_col (begc:endc)) ; this%errh2o_col (:) = nan - allocate(this%errh2osno_col (begc:endc)) ; this%errh2osno_col (:) = nan - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varctl , only : use_cn, use_lch4 - use clm_varctl , only : hist_wrtch4diag - use clm_varpar , only : nlevsno, nlevsoi - use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal, no_snow_zero - ! - ! !ARGUMENTS: - class(waterstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - ! h2osno also includes snow that is part of the soil column (an - ! initial snow layer is only created if h2osno > 10mm). - - data2dptr => this%h2osoi_liq_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_LIQH2O', units='kg/m2', type2d='levsno', & - avgflag='A', long_name='Snow liquid water content', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - data2dptr => this%h2osoi_ice_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_ICE', units='kg/m2', type2d='levsno', & - avgflag='A', long_name='Snow ice content', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - data2dptr => this%h2osoi_vol_col(begc:endc,1:nlevsoi) - call hist_addfld2d (fname='H2OSOI', units='mm3/mm3', type2d='levsoi', & - avgflag='A', long_name='volumetric soil water (vegetated landunits only)', & - ptr_col=this%h2osoi_vol_col, l2g_scale_type='veg') - -! this%h2osoi_liq_col(begc:endc,:) = spval -! call hist_addfld2d (fname='SOILLIQ', units='kg/m2', type2d='levgrnd', & -! avgflag='A', long_name='soil liquid water (vegetated landunits only)', & -! ptr_col=this%h2osoi_liq_col, l2g_scale_type='veg') - - data2dptr => this%h2osoi_liq_col(begc:endc,1:nlevsoi) - call hist_addfld2d (fname='SOILLIQ', units='kg/m2', type2d='levsoi', & - avgflag='A', long_name='soil liquid water (vegetated landunits only)', & - ptr_col=data2dptr, l2g_scale_type='veg') - - data2dptr => this%h2osoi_ice_col(begc:endc,1:nlevsoi) - call hist_addfld2d (fname='SOILICE', units='kg/m2', type2d='levsoi', & - avgflag='A', long_name='soil ice (vegetated landunits only)', & - ptr_col=data2dptr, l2g_scale_type='veg') - - this%h2osoi_liqice_10cm_col(begc:endc) = spval - call hist_addfld1d (fname='SOILWATER_10CM', units='kg/m2', & - avgflag='A', long_name='soil liquid water + ice in top 10cm of soil (veg landunits only)', & - ptr_col=this%h2osoi_liqice_10cm_col, set_urb=spval, set_lake=spval, l2g_scale_type='veg') - - this%h2osoi_liq_tot_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOILLIQ', units='kg/m2', & - avgflag='A', long_name='vertically summed soil liquid water (veg landunits only)', & - ptr_col=this%h2osoi_liq_tot_col, set_urb=spval, set_lake=spval, l2g_scale_type='veg') - - this%h2osoi_ice_tot_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOILICE', units='kg/m2', & - avgflag='A', long_name='vertically summed soil cie (veg landunits only)', & - ptr_col=this%h2osoi_ice_tot_col, set_urb=spval, set_lake=spval, l2g_scale_type='veg') - - this%h2ocan_patch(begp:endp) = spval - call hist_addfld1d (fname='H2OCAN', units='mm', & - avgflag='A', long_name='intercepted water', & - ptr_patch=this%h2ocan_patch, set_lake=0._r8) - - this%snocan_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOCAN', units='mm', & - avgflag='A', long_name='intercepted snow', & - ptr_patch=this%snocan_patch, set_lake=0._r8) - - this%liqcan_patch(begp:endp) = spval - call hist_addfld1d (fname='LIQCAN', units='mm', & - avgflag='A', long_name='intercepted liquid water', & - ptr_patch=this%liqcan_patch, set_lake=0._r8) - - this%snounload_patch(begp:endp) = spval - call hist_addfld1d (fname='SNOUNLOAD', units='mm', & - avgflag='A', long_name='Canopy snow unloading', & - ptr_patch=this%snounload_patch, set_lake=0._r8) - - call hist_addfld1d (fname='H2OSNO', units='mm', & - avgflag='A', long_name='snow depth (liquid water)', & - ptr_col=this%h2osno_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='H2OSNO_ICE', units='mm', & - avgflag='A', long_name='snow depth (liquid water, ice landunits only)', & - ptr_col=this%h2osno_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%liq1_grc(begg:endg) = spval - call hist_addfld1d (fname='LIQUID_CONTENT1', units='mm', & - avgflag='A', long_name='initial gridcell total liq content', & - ptr_lnd=this%liq1_grc) - - this%liq2_grc(begg:endg) = spval - call hist_addfld1d (fname='LIQUID_CONTENT2', units='mm', & - avgflag='A', long_name='post landuse change gridcell total liq content', & - ptr_lnd=this%liq2_grc, default='inactive') - - this%ice1_grc(begg:endg) = spval - call hist_addfld1d (fname='ICE_CONTENT1', units='mm', & - avgflag='A', long_name='initial gridcell total ice content', & - ptr_lnd=this%ice1_grc) - - this%ice2_grc(begg:endg) = spval - call hist_addfld1d (fname='ICE_CONTENT2', units='mm', & - avgflag='A', long_name='post land cover change total ice content', & - ptr_lnd=this%ice2_grc, default='inactive') - - this%h2osfc_col(begc:endc) = spval - call hist_addfld1d (fname='H2OSFC', units='mm', & - avgflag='A', long_name='surface water depth', & - ptr_col=this%h2osfc_col) - - this%tws_grc(begg:endg) = spval - call hist_addfld1d (fname='TWS', units='mm', & - avgflag='A', long_name='total water storage', & - ptr_lnd=this%tws_grc) - - ! (rgk 02-02-2017) There is intentionally no entry here for stored plant water - ! I think that since the value is zero in all cases except - ! for FATES plant hydraulics, it will be confusing for users - ! when they see their plants have no water in output files. - ! So it is not useful diagnostic information. The information - ! can be provided through FATES specific history diagnostics - ! if need be. - - ! Humidity - - this%q_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='Q2M', units='kg/kg', & - avgflag='A', long_name='2m specific humidity', & - ptr_patch=this%q_ref2m_patch) - - this%rh_ref2m_patch(begp:endp) = spval - call hist_addfld1d (fname='RH2M', units='%', & - avgflag='A', long_name='2m relative humidity', & - ptr_patch=this%rh_ref2m_patch) - - this%rh_ref2m_r_patch(begp:endp) = spval - call hist_addfld1d (fname='RH2M_R', units='%', & - avgflag='A', long_name='Rural 2m specific humidity', & - ptr_patch=this%rh_ref2m_r_patch, set_spec=spval, default='inactive') - - this%rh_ref2m_u_patch(begp:endp) = spval - call hist_addfld1d (fname='RH2M_U', units='%', & - avgflag='A', long_name='Urban 2m relative humidity', & - ptr_patch=this%rh_ref2m_u_patch, set_nourb=spval, default='inactive') - - this%rh_af_patch(begp:endp) = spval - call hist_addfld1d (fname='RHAF', units='fraction', & - avgflag='A', long_name='fractional humidity of canopy air', & - ptr_patch=this%rh_af_patch, set_spec=spval, default='inactive') - - if(use_luna)then - call hist_addfld1d (fname='RHAF10', units='fraction', & - avgflag='A', long_name='10 day running mean of fractional humidity of canopy air', & - ptr_patch=this%rh10_af_patch, set_spec=spval, default='inactive') - endif - - ! Fractions - - this%frac_h2osfc_col(begc:endc) = spval - call hist_addfld1d (fname='FH2OSFC', units='unitless', & - avgflag='A', long_name='fraction of ground covered by surface water', & - ptr_col=this%frac_h2osfc_col) - - this%frac_h2osfc_nosnow_col(begc:endc) = spval - call hist_addfld1d (fname='FH2OSFC_NOSNOW', units='unitless', & - avgflag='A', & - long_name='fraction of ground covered by surface water (if no snow present)', & - ptr_col=this%frac_h2osfc_nosnow_col, default='inactive') - - this%frac_sno_col(begc:endc) = spval - call hist_addfld1d (fname='FSNO', units='unitless', & - avgflag='A', long_name='fraction of ground covered by snow', & - ptr_col=this%frac_sno_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSNO_ICE', units='unitless', & - avgflag='A', long_name='fraction of ground covered by snow (ice landunits only)', & - ptr_col=this%frac_sno_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%frac_sno_eff_col(begc:endc) = spval - call hist_addfld1d (fname='FSNO_EFF', units='unitless', & - avgflag='A', long_name='effective fraction of ground covered by snow', & - ptr_col=this%frac_sno_eff_col, c2l_scale_type='urbanf')!, default='inactive') - - if (use_cn) then - this%fwet_patch(begp:endp) = spval - call hist_addfld1d (fname='FWET', units='proportion', & - avgflag='A', long_name='fraction of canopy that is wet', & - ptr_patch=this%fwet_patch, default='inactive') - end if - - if (use_cn) then - this%fcansno_patch(begp:endp) = spval - call hist_addfld1d (fname='FCANSNO', units='proportion', & - avgflag='A', long_name='fraction of canopy that is wet', & - ptr_patch=this%fcansno_patch, default='inactive') - end if - - if (use_cn) then - this%fdry_patch(begp:endp) = spval - call hist_addfld1d (fname='FDRY', units='proportion', & - avgflag='A', long_name='fraction of foliage that is green and dry', & - ptr_patch=this%fdry_patch, default='inactive') - end if - - if (use_cn)then - this%frac_iceold_col(begc:endc,:) = spval - call hist_addfld2d (fname='FRAC_ICEOLD', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='fraction of ice relative to the tot water', & - ptr_col=this%frac_iceold_col, default='inactive') - end if - - ! Snow properties - these will be vertically averaged over the snow profile - - this%snow_depth_col(begc:endc) = spval - call hist_addfld1d (fname='SNOW_DEPTH', units='m', & - avgflag='A', long_name='snow height of snow covered area', & - ptr_col=this%snow_depth_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SNOW_DEPTH_ICE', units='m', & - avgflag='A', long_name='snow height of snow covered area (ice landunits only)', & - ptr_col=this%snow_depth_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%snowdp_col(begc:endc) = spval - call hist_addfld1d (fname='SNOWDP', units='m', & - avgflag='A', long_name='gridcell mean snow height', & - ptr_col=this%snowdp_col, c2l_scale_type='urbanf') - - this%snowliq_col(begc:endc) = spval - call hist_addfld1d (fname='SNOWLIQ', units='kg/m2', & - avgflag='A', long_name='snow liquid water', & - ptr_col=this%snowliq_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SNOWLIQ_ICE', units='kg/m2', & - avgflag='A', long_name='snow liquid water (ice landunits only)', & - ptr_col=this%snowliq_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%snowice_col(begc:endc) = spval - call hist_addfld1d (fname='SNOWICE', units='kg/m2', & - avgflag='A', long_name='snow ice', & - ptr_col=this%snowice_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SNOWICE_ICE', units='kg/m2', & - avgflag='A', long_name='snow ice (ice landunits only)', & - ptr_col=this%snowice_col, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%int_snow_col(begc:endc) = spval - call hist_addfld1d (fname='INT_SNOW', units='mm', & - avgflag='A', long_name='accumulated swe (vegetated landunits only)', & - ptr_col=this%int_snow_col, l2g_scale_type='veg', & - default='inactive') - - call hist_addfld1d (fname='INT_SNOW_ICE', units='mm', & - avgflag='A', long_name='accumulated swe (ice landunits only)', & - ptr_col=this%int_snow_col, l2g_scale_type='ice', & - default='inactive') - - this%snow_persistence_col(begc:endc) = spval - call hist_addfld1d (fname='SNOW_PERSISTENCE', units='seconds', & - avgflag='I', long_name='Length of time of continuous snow cover (nat. veg. landunits only)', & - ptr_col=this%snow_persistence_col, l2g_scale_type='natveg') - - if (use_cn) then - this%wf_col(begc:endc) = spval - call hist_addfld1d (fname='WF', units='proportion', & - avgflag='A', long_name='soil water as frac. of whc for top 0.05 m', & - ptr_col=this%wf_col, default='inactive') - end if - - this%h2osno_top_col(begc:endc) = spval - call hist_addfld1d (fname='H2OSNO_TOP', units='kg/m2', & - avgflag='A', long_name='mass of snow in top snow layer', & - ptr_col=this%h2osno_top_col, set_urb=spval) - - this%snw_rds_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNORDSL', units='m^-6', & - avgflag='A', long_name='top snow layer effective grain radius', & - ptr_col=this%snw_rds_top_col, set_urb=spval, default='inactive') - - this%sno_liq_top_col(begc:endc) = spval - call hist_addfld1d (fname='SNOLIQFL', units='fraction', & - avgflag='A', long_name='top snow layer liquid water fraction (land)', & - ptr_col=this%sno_liq_top_col, set_urb=spval, default='inactive') - - ! We determine the fractional time (and fraction of the grid cell) over which each - ! snow layer existed by running the snow averaging routine on a field whose value is 1 - ! everywhere - data2dptr => this%snow_layer_unity_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_EXISTENCE', units='unitless', type2d='levsno', & - avgflag='A', long_name='Fraction of averaging period for which each snow layer existed', & - ptr_col=data2dptr, no_snow_behavior=no_snow_zero, default='inactive') - - this%bw_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%bw_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_BW', units='kg/m3', type2d='levsno', & - avgflag='A', long_name='Partial density of water in the snow pack (ice + liquid)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_BW_ICE', units='kg/m3', type2d='levsno', & - avgflag='A', long_name='Partial density of water in the snow pack (ice + liquid, ice landunits only)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%snw_rds_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%snw_rds_col(:,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_GS', units='Microns', type2d='levsno', & - avgflag='A', long_name='Mean snow grain size', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_GS_ICE', units='Microns', type2d='levsno', & - avgflag='A', long_name='Mean snow grain size (ice landunits only)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%errh2o_col(begc:endc) = spval - call hist_addfld1d (fname='ERRH2O', units='mm', & - avgflag='A', long_name='total water conservation error', & - ptr_col=this%errh2o_col) - - this%errh2osno_col(begc:endc) = spval - call hist_addfld1d (fname='ERRH2OSNO', units='mm', & - avgflag='A', long_name='imbalance in snow depth (liquid water)', & - ptr_col=this%errh2osno_col, c2l_scale_type='urbanf') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, & - h2osno_input_col, snow_depth_input_col, watsat_col, t_soisno_col) - ! - ! !DESCRIPTION: - ! Initialize time constant variables and cold start conditions - ! - ! !USES: - use shr_const_mod , only : shr_const_pi - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_spfn_mod , only : shr_spfn_erf - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varpar , only : nlevsoi, nlevgrnd, nlevsno, nlevlak, nlevurb - use landunit_varcon , only : istwet, istsoil, istdlak, istcrop, istice_mec - use column_varcon , only : icol_shadewall, icol_road_perv - use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall - use clm_varcon , only : denice, denh2o, spval, sb, bdsno - use clm_varcon , only : zlnd, tfrz, spval, pc - use clm_varctl , only : fsurdat, iulog - use clm_varctl , only : use_bedrock - use spmdMod , only : masterproc - use abortutils , only : endrun - use fileutils , only : getfil - use ncdio_pio , only : file_desc_t, ncd_io - ! - ! !ARGUMENTS: - class(waterstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: h2osno_input_col(bounds%begc:) - real(r8) , intent(in) :: snow_depth_input_col(bounds%begc:) - real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) - real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) - ! - ! !LOCAL VARIABLES: - integer :: p,c,j,l,g,lev,nlevs - real(r8) :: maxslope, slopemax, minslope - real(r8) :: d, fd, dfdd, slope0,slopebeta - real(r8) ,pointer :: std (:) - logical :: readvar - type(file_desc_t) :: ncid - character(len=256) :: locfn - real(r8) :: snowbd ! temporary calculation of snow bulk density (kg/m3) - real(r8) :: fmelt ! snowbd/100 - integer :: nbedrock - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(h2osno_input_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(snow_depth_input_col) == (/bounds%endc/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(watsat_col) == (/bounds%endc,nlevgrnd/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(t_soisno_col) == (/bounds%endc,nlevgrnd/)) , errMsg(sourcefile, __LINE__)) - - ! The first three arrays are initialized from the input argument - do c = bounds%begc,bounds%endc - this%h2osno_col(c) = h2osno_input_col(c) - this%int_snow_col(c) = h2osno_input_col(c) - this%snow_depth_col(c) = snow_depth_input_col(c) - this%snow_persistence_col(c) = 0._r8 - this%snow_layer_unity_col(c,:) = 1._r8 - end do - - do c = bounds%begc,bounds%endc - this%wf_col(c) = spval - this%wf2_col(c) = spval - end do - - do l = bounds%begl, bounds%endl - if (lun%urbpoi(l)) then - if (use_vancouver) then - this%qaf_lun(l) = 0.0111_r8 - else if (use_mexicocity) then - this%qaf_lun(l) = 0.00248_r8 - else - this%qaf_lun(l) = 1.e-4_r8 ! Arbitrary set since forc_q is not yet available - end if - end if - end do - - ! Water Stored in plants is almost always a static entity, with the exception - ! of when FATES-hydraulics is used. As such, this is trivially set to 0.0 (rgk 03-2017) - this%total_plant_stored_h2o_col(bounds%begc:bounds%endc) = 0.0_r8 - - - associate(snl => col%snl) - - this%h2osfc_col(bounds%begc:bounds%endc) = 0._r8 - this%h2ocan_patch(bounds%begp:bounds%endp) = 0._r8 - this%snocan_patch(bounds%begp:bounds%endp) = 0._r8 - this%liqcan_patch(bounds%begp:bounds%endp) = 0._r8 - this%snounload_patch(bounds%begp:bounds%endp) = 0._r8 - this%frac_h2osfc_col(bounds%begc:bounds%endc) = 0._r8 - - this%fwet_patch(bounds%begp:bounds%endp) = 0._r8 - this%fdry_patch(bounds%begp:bounds%endp) = 0._r8 - this%fcansno_patch(bounds%begp:bounds%endp) = 0._r8 - !-------------------------------------------- - ! Set snow water - !-------------------------------------------- - - ! Note: Glacier_mec columns are initialized with half the maximum snow cover. - ! This gives more realistic values of qflx_glcice sooner in the simulation - ! for columns with net ablation, at the cost of delaying ice formation - ! in columns with net accumulation. - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - ! From Bonan 1996 (LSM technical note) - this%frac_sno_col(c) = min( this%snow_depth_col(c)/0.05_r8, 1._r8) - else - this%frac_sno_col(c) = 0._r8 - ! snow cover fraction as in Niu and Yang 2007 - if(this%snow_depth_col(c) > 0.0) then - snowbd = min(400._r8, this%h2osno_col(c)/this%snow_depth_col(c)) !bulk density of snow (kg/m3) - fmelt = (snowbd/100.)**1. - ! 100 is the assumed fresh snow density; 1 is a melting factor that could be - ! reconsidered, optimal value of 1.5 in Niu et al., 2007 - this%frac_sno_col(c) = tanh( this%snow_depth_col(c) /(2.5 * zlnd * fmelt) ) - endif - end if - end do - - do c = bounds%begc,bounds%endc - if (snl(c) < 0) then - this%snw_rds_col(c,snl(c)+1:0) = snw_rds_min - this%snw_rds_col(c,-nlevsno+1:snl(c)) = 0._r8 - this%snw_rds_top_col(c) = snw_rds_min - elseif (this%h2osno_col(c) > 0._r8) then - this%snw_rds_col(c,0) = snw_rds_min - this%snw_rds_col(c,-nlevsno+1:-1) = 0._r8 - this%snw_rds_top_col(c) = spval - this%sno_liq_top_col(c) = spval - else - this%snw_rds_col(c,:) = 0._r8 - this%snw_rds_top_col(c) = spval - this%sno_liq_top_col(c) = spval - endif - end do - - !-------------------------------------------- - ! Set soil water - !-------------------------------------------- - - ! volumetric water is set first and liquid content and ice lens are obtained - ! NOTE: h2osoi_vol, h2osoi_liq and h2osoi_ice only have valid values over soil - ! and urban pervious road (other urban columns have zero soil water) - - this%h2osoi_vol_col(bounds%begc:bounds%endc, 1:) = spval - this%h2osoi_liq_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval - this%h2osoi_ice_col(bounds%begc:bounds%endc,-nlevsno+1:) = spval - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (.not. lun%lakpoi(l)) then !not lake - - ! volumetric water - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - nlevs = nlevgrnd - do j = 1, nlevs - if (use_bedrock) then - nbedrock = col%nbedrock(c) - else - nbedrock = nlevsoi - endif - if (j > nbedrock) then - this%h2osoi_vol_col(c,j) = 0.0_r8 - else - this%h2osoi_vol_col(c,j) = 0.15_r8 - endif - end do - else if (lun%urbpoi(l)) then - if (col%itype(c) == icol_road_perv) then - nlevs = nlevgrnd - do j = 1, nlevs - if (j <= nlevsoi) then - this%h2osoi_vol_col(c,j) = 0.3_r8 - else - this%h2osoi_vol_col(c,j) = 0.0_r8 - end if - end do - else if (col%itype(c) == icol_road_imperv) then - nlevs = nlevgrnd - do j = 1, nlevs - this%h2osoi_vol_col(c,j) = 0.0_r8 - end do - else - nlevs = nlevurb - do j = 1, nlevs - this%h2osoi_vol_col(c,j) = 0.0_r8 - end do - end if - else if (lun%itype(l) == istwet) then - nlevs = nlevgrnd - do j = 1, nlevs - if (j > nlevsoi) then - this%h2osoi_vol_col(c,j) = 0.0_r8 - else - this%h2osoi_vol_col(c,j) = 1.0_r8 - endif - end do - else if (lun%itype(l) == istice_mec) then - nlevs = nlevgrnd - do j = 1, nlevs - this%h2osoi_vol_col(c,j) = 1.0_r8 - end do - endif - do j = 1, nlevs - this%h2osoi_vol_col(c,j) = min(this%h2osoi_vol_col(c,j), watsat_col(c,j)) - if (t_soisno_col(c,j) <= SHR_CONST_TKFRZ) then - this%h2osoi_ice_col(c,j) = col%dz(c,j)*denice*this%h2osoi_vol_col(c,j) - this%h2osoi_liq_col(c,j) = 0._r8 - else - this%h2osoi_ice_col(c,j) = 0._r8 - this%h2osoi_liq_col(c,j) = col%dz(c,j)*denh2o*this%h2osoi_vol_col(c,j) - endif - end do - do j = -nlevsno+1, 0 - if (j > snl(c)) then - this%h2osoi_ice_col(c,j) = col%dz(c,j)*250._r8 - this%h2osoi_liq_col(c,j) = 0._r8 - end if - end do - end if - end do - - - !-------------------------------------------- - ! Set Lake water - !-------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (lun%lakpoi(l)) then - do j = -nlevsno+1, 0 - if (j > snl(c)) then - this%h2osoi_ice_col(c,j) = col%dz(c,j)*bdsno - this%h2osoi_liq_col(c,j) = 0._r8 - end if - end do - do j = 1,nlevgrnd - if (j <= nlevsoi) then ! soil - this%h2osoi_vol_col(c,j) = watsat_col(c,j) - this%h2osoi_liq_col(c,j) = spval - this%h2osoi_ice_col(c,j) = spval - else ! bedrock - this%h2osoi_vol_col(c,j) = 0._r8 - end if - end do - end if - end do - - !-------------------------------------------- - ! For frozen layers !TODO - does the following make sense ???? it seems to overwrite everything - !-------------------------------------------- - - do c = bounds%begc, bounds%endc - do j = 1,nlevgrnd - if (this%h2osoi_vol_col(c,j) /= spval) then - if (t_soisno_col(c,j) <= tfrz) then - this%h2osoi_ice_col(c,j) = col%dz(c,j)*denice*this%h2osoi_vol_col(c,j) - this%h2osoi_liq_col(c,j) = 0._r8 - else - this%h2osoi_ice_col(c,j) = 0._r8 - this%h2osoi_liq_col(c,j) = col%dz(c,j)*denh2o*this%h2osoi_vol_col(c,j) - endif - end if - end do - end do - - end associate - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag, & - watsat_col) - ! - ! !DESCRIPTION: - ! Read/Write module information to/from restart file. - ! - ! !USES: - use spmdMod , only : masterproc - use clm_varcon , only : denice, denh2o, pondmx, watmin, spval, nameg - use landunit_varcon , only : istcrop, istdlak, istsoil - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use clm_time_manager , only : is_first_step - use clm_varctl , only : bound_h2osoi - use ncdio_pio , only : file_desc_t, ncd_io, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(waterstate_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - real(r8) , intent(in) :: watsat_col (bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) - ! - ! !LOCAL VARIABLES: - integer :: c,l,j,nlevs - logical :: readvar - real(r8) :: maxwatsat ! maximum porosity - real(r8) :: excess ! excess volumetric soil water - real(r8) :: totwat ! total soil water (mm) - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(watsat_col) == (/bounds%endc,nlevgrnd/)) , errMsg(sourcefile, __LINE__)) - - call restartvar(ncid=ncid, flag=flag, varname='INT_SNOW', xtype=ncd_double, & - dim1name='column', & - long_name='accuumulated snow', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%int_snow_col) - if (flag=='read' .and. .not. readvar) then - this%int_snow_col(:) = 0.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='H2OSFC', xtype=ncd_double, & - dim1name='column', & - long_name='surface water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%h2osfc_col) - if (flag=='read' .and. .not. readvar) then - this%h2osfc_col(bounds%begc:bounds%endc) = 0.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='H2OSNO', xtype=ncd_double, & - dim1name='column', & - long_name='snow water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%h2osno_col) - - call restartvar(ncid=ncid, flag=flag, varname='H2OSOI_LIQ', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='liquid water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%h2osoi_liq_col) - - call restartvar(ncid=ncid, flag=flag, varname='H2OSOI_ICE', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='ice lens', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%h2osoi_ice_col) - - call restartvar(ncid=ncid, flag=flag, varname='H2OCAN', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%h2ocan_patch) - - call restartvar(ncid=ncid, flag=flag, varname='SNOCAN', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy snow water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%snocan_patch) - - ! NOTE(wjs, 2015-07-01) In old restart files, there was no LIQCAN variable. However, - ! H2OCAN had similar meaning. So if we can't find LIQCAN, use H2OCAN to initialize - ! liqcan_patch. - call restartvar(ncid=ncid, flag=flag, varname='LIQCAN:H2OCAN', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy liquid water', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%liqcan_patch) - - call restartvar(ncid=ncid, flag=flag, varname='SNOUNLOAD', xtype=ncd_double, & - dim1name='pft', & - long_name='Canopy snow unloading', units='kg/m2', & - interpinic_flag='interp', readvar=readvar, data=this%snounload_patch) - - ! TWS is needed when methane is on and the TWS_inversion is used to get exact - ! restart. - call restartvar(ncid=ncid, flag=flag, varname='TWS', xtype=ncd_double, & - dim1name=nameg, & - long_name='Total Water Storage', units='mm', & - interpinic_flag='interp', readvar=readvar, data=this%tws_grc) - - if(use_luna)then - call restartvar(ncid=ncid, flag=flag, varname='rh10', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean boundary layer relatie humidity', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%rh10_af_patch) - endif - - ! Determine volumetric soil water (for read only) - if (flag == 'read' ) then - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if ( col%itype(c) == icol_sunwall .or. & - col%itype(c) == icol_shadewall .or. & - col%itype(c) == icol_roof )then - nlevs = nlevurb - else - nlevs = nlevgrnd - end if - if ( lun%itype(l) /= istdlak ) then ! This calculation is now done for lakes in initLake. - do j = 1,nlevs - this%h2osoi_vol_col(c,j) = this%h2osoi_liq_col(c,j)/(col%dz(c,j)*denh2o) & - + this%h2osoi_ice_col(c,j)/(col%dz(c,j)*denice) - end do - end if - end do - end if - - ! If initial run -- ensure that water is properly bounded (read only) - if (flag == 'read' ) then - if ( is_first_step() .and. bound_h2osoi) then - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if ( col%itype(c) == icol_sunwall .or. col%itype(c) == icol_shadewall .or. & - col%itype(c) == icol_roof )then - nlevs = nlevurb - else - nlevs = nlevgrnd - end if - do j = 1,nlevs - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%h2osoi_liq_col(c,j) = max(0._r8,this%h2osoi_liq_col(c,j)) - this%h2osoi_ice_col(c,j) = max(0._r8,this%h2osoi_ice_col(c,j)) - this%h2osoi_vol_col(c,j) = this%h2osoi_liq_col(c,j)/(col%dz(c,j)*denh2o) & - + this%h2osoi_ice_col(c,j)/(col%dz(c,j)*denice) - if (j == 1) then - maxwatsat = (watsat_col(c,j)*col%dz(c,j)*1000.0_r8 + pondmx) / (col%dz(c,j)*1000.0_r8) - else - maxwatsat = watsat_col(c,j) - end if - if (this%h2osoi_vol_col(c,j) > maxwatsat) then - excess = (this%h2osoi_vol_col(c,j) - maxwatsat)*col%dz(c,j)*1000.0_r8 - totwat = this%h2osoi_liq_col(c,j) + this%h2osoi_ice_col(c,j) - this%h2osoi_liq_col(c,j) = this%h2osoi_liq_col(c,j) - & - (this%h2osoi_liq_col(c,j)/totwat) * excess - this%h2osoi_ice_col(c,j) = this%h2osoi_ice_col(c,j) - & - (this%h2osoi_ice_col(c,j)/totwat) * excess - end if - this%h2osoi_liq_col(c,j) = max(watmin,this%h2osoi_liq_col(c,j)) - this%h2osoi_ice_col(c,j) = max(watmin,this%h2osoi_ice_col(c,j)) - this%h2osoi_vol_col(c,j) = this%h2osoi_liq_col(c,j)/(col%dz(c,j)*denh2o) & - + this%h2osoi_ice_col(c,j)/(col%dz(c,j)*denice) - end if - end do - end do - end if - - endif ! end if if-read flag - - call restartvar(ncid=ncid, flag=flag, varname='FH2OSFC', xtype=ncd_double, & - dim1name='column',& - long_name='fraction of ground covered by h2osfc (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%frac_h2osfc_col) - if (flag == 'read' .and. .not. readvar) then - this%frac_h2osfc_col(bounds%begc:bounds%endc) = 0.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='SNOW_DEPTH', xtype=ncd_double, & - dim1name='column', & - long_name='snow depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=this%snow_depth_col) - - call restartvar(ncid=ncid, flag=flag, varname='SNOW_PERS', xtype=ncd_double, & - dim1name='column', & - long_name='continuous snow cover time', units='sec', & - interpinic_flag='interp', readvar=readvar, data=this%snow_persistence_col) - if (flag=='read' .and. .not. readvar) then - this%snow_persistence_col(:) = 0.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='frac_sno_eff', xtype=ncd_double, & - dim1name='column', & - long_name='fraction of ground covered by snow (0 to 1)',units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%frac_sno_eff_col) - if (flag == 'read' .and. .not. readvar) then - this%frac_sno_eff_col(bounds%begc:bounds%endc) = 0.0_r8 - end if - - call restartvar(ncid=ncid, flag=flag, varname='frac_sno', xtype=ncd_double, & - dim1name='column', & - long_name='fraction of ground covered by snow (0 to 1)',units='unitless',& - interpinic_flag='interp', readvar=readvar, data=this%frac_sno_col) - - call restartvar(ncid=ncid, flag=flag, varname='FWET', xtype=ncd_double, & - dim1name='pft', & - long_name='fraction of canopy that is wet (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fwet_patch) - - call restartvar(ncid=ncid, flag=flag, varname='FCANSNO', xtype=ncd_double, & - dim1name='pft', & - long_name='fraction of canopy that is snow covered (0 to 1)', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fcansno_patch) - - ! column type physical state variable - snw_rds - call restartvar(ncid=ncid, flag=flag, varname='snw_rds', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer effective radius', units='um', & - interpinic_flag='interp', readvar=readvar, data=this%snw_rds_col) - if (flag == 'read' .and. .not. readvar) then - - ! initial run, not restart: initialize snw_rds - if (masterproc) then - write(iulog,*) "SNICAR: This is an initial run (not a restart), and grain size/aerosol " // & - "mass data are not defined in initial condition file. Initialize snow " // & - "effective radius to fresh snow value, and snow/aerosol masses to zero." - endif - - do c= bounds%begc, bounds%endc - if (col%snl(c) < 0) then - this%snw_rds_col(c,col%snl(c)+1:0) = snw_rds_min - this%snw_rds_col(c,-nlevsno+1:col%snl(c)) = 0._r8 - this%snw_rds_top_col(c) = snw_rds_min - this%sno_liq_top_col(c) = this%h2osoi_liq_col(c,col%snl(c)+1) / & - (this%h2osoi_liq_col(c,col%snl(c)+1)+this%h2osoi_ice_col(c,col%snl(c)+1)) - elseif (this%h2osno_col(c) > 0._r8) then - this%snw_rds_col(c,0) = snw_rds_min - this%snw_rds_col(c,-nlevsno+1:-1) = 0._r8 - this%snw_rds_top_col(c) = spval - this%sno_liq_top_col(c) = spval - else - this%snw_rds_col(c,:) = 0._r8 - this%snw_rds_top_col(c) = spval - this%sno_liq_top_col(c) = spval - endif - enddo - endif - - call restartvar(ncid=ncid, flag=flag, varname='qaf', xtype=ncd_double, dim1name='landunit', & - long_name='urban canopy specific humidity', units='kg/kg', & - interpinic_flag='interp', readvar=readvar, data=this%qaf_lun) - - if (use_cn) then - call restartvar(ncid=ncid, flag=flag, varname='wf', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%wf_col) - end if - - - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine Reset(this, column) - ! - ! !DESCRIPTION: - ! Intitialize SNICAR variables for fresh snow column - ! - ! !ARGUMENTS: - class(waterstate_type) :: this - integer , intent(in) :: column ! column index - !----------------------------------------------------------------------- - - this%snw_rds_col(column,0) = snw_rds_min - - end subroutine Reset - -end module WaterstateType diff --git a/src/biogeophys/WaterfluxType.F90 b/src/biogeophys/WaterfluxType.F90 deleted file mode 100644 index 905fe9471f..0000000000 --- a/src/biogeophys/WaterfluxType.F90 +++ /dev/null @@ -1,736 +0,0 @@ -module WaterfluxType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevsoi - use clm_varcon , only : spval - use decompMod , only : bounds_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use CNSharedParamsMod , only : use_fun - use AnnualFluxDribbler, only : annual_flux_dribbler_type, annual_flux_dribbler_gridcell - ! - implicit none - private - ! - ! !PUBLIC TYPES: - type, public :: waterflux_type - - ! water fluxes are in units or mm/s - - real(r8), pointer :: qflx_prec_grnd_patch (:) ! patch water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_prec_grnd_col (:) ! col water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_rain_grnd_patch (:) ! patch rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_rain_grnd_col (:) ! col rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd_patch (:) ! patch snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd_col (:) ! col snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_sub_snow_patch (:) ! patch sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_sub_snow_col (:) ! col sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_evap_soi_patch (:) ! patch soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_soi_col (:) ! col soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_veg_patch (:) ! patch vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_veg_col (:) ! col vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_can_patch (:) ! patch evaporation from leaves and stems (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_can_col (:) ! col evaporation from leaves and stems (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot_patch (:) ! patch pft_qflx_evap_soi + pft_qflx_evap_veg + qflx_tran_veg - real(r8), pointer :: qflx_evap_tot_col (:) ! col col_qflx_evap_soi + col_qflx_evap_veg + qflx_tran_veg - real(r8), pointer :: qflx_evap_grnd_patch (:) ! patch ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_evap_grnd_col (:) ! col ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_phs_neg_col (:) ! col sum of negative hydraulic redistribution fluxes (mm H2O/s) [+] - - ! In the snow capping parametrization excess mass above h2osno_max is removed. A breakdown of mass into liquid - ! and solid fluxes is done, these are represented by qflx_snwcp_liq_col and qflx_snwcp_ice_col. - real(r8), pointer :: qflx_snwcp_liq_col (:) ! col excess liquid h2o due to snow capping (outgoing) (mm H2O /s) - real(r8), pointer :: qflx_snwcp_ice_col (:) ! col excess solid h2o due to snow capping (outgoing) (mm H2O /s) - real(r8), pointer :: qflx_snwcp_discarded_liq_col(:) ! col excess liquid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) - real(r8), pointer :: qflx_snwcp_discarded_ice_col(:) ! col excess solid h2o due to snow capping, which we simply discard in order to reset the snow pack (mm H2O /s) - - real(r8), pointer :: qflx_tran_veg_patch (:) ! patch vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg_col (:) ! col vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_dew_snow_patch (:) ! patch surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow_col (:) ! col surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd_patch (:) ! patch ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd_col (:) ! col ground surface dew formation (mm H2O /s) [+] (+ = to atm); usually eflx_bot >= 0) - real(r8), pointer :: qflx_prec_intr_patch (:) ! patch interception of precipitation [mm/s] - real(r8), pointer :: qflx_prec_intr_col (:) ! col interception of precipitation [mm/s] - real(r8), pointer :: qflx_snowindunload_patch (:) ! patch canopy snow wind unloading (mm H2O /s) - real(r8), pointer :: qflx_snowindunload_col (:) ! col canopy snow wind unloading (mm H2O /s) - real(r8), pointer :: qflx_snotempunload_patch (:) ! patch canopy snow temp unloading (mm H2O /s) - real(r8), pointer :: qflx_snotempunload_col (:) ! col canopy snow temp unloading (mm H2O /s) - - real(r8), pointer :: qflx_ev_snow_patch (:) ! patch evaporation heat flux from snow (mm H2O/s) [+ to atm] - real(r8), pointer :: qflx_ev_snow_col (:) ! col evaporation heat flux from snow (mm H2O/s) [+ to atm] - real(r8), pointer :: qflx_ev_soil_patch (:) ! patch evaporation heat flux from soil (mm H2O/s) [+ to atm] - real(r8), pointer :: qflx_ev_soil_col (:) ! col evaporation heat flux from soil (mm H2O/s) [+ to atm] - real(r8), pointer :: qflx_ev_h2osfc_patch (:) ! patch evaporation heat flux from soil (mm H2O/s) [+ to atm] - real(r8), pointer :: qflx_ev_h2osfc_col (:) ! col evaporation heat flux from soil (mm H2O/s) [+ to atm] - - real(r8), pointer :: qflx_adv_col (:,:) ! col advective flux across different soil layer interfaces [mm H2O/s] [+ downward] - real(r8), pointer :: qflx_rootsoi_col (:,:) ! col root and soil water exchange [mm H2O/s] [+ into root] - real(r8), pointer :: qflx_infl_col (:) ! col infiltration (mm H2O /s) - real(r8), pointer :: qflx_surf_col (:) ! col surface runoff (mm H2O /s) - real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s) - real(r8), pointer :: qflx_h2osfc_to_ice_col (:) ! col conversion of h2osfc to ice - real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff - real(r8), pointer :: qflx_snow_h2osfc_col (:) ! col snow falling on surface water - real(r8), pointer :: qflx_drain_perched_col (:) ! col sub-surface runoff from perched wt (mm H2O /s) - real(r8), pointer :: qflx_deficit_col (:) ! col water deficit to keep non-negative liquid water content (mm H2O) - real(r8), pointer :: qflx_floodc_col (:) ! col flood water flux at column level - real(r8), pointer :: qflx_sl_top_soil_col (:) ! col liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) - real(r8), pointer :: qflx_snomelt_col (:) ! col snow melt (mm H2O /s) - real(r8), pointer :: qflx_snomelt_lyr_col (:,:) ! col snow melt in each layer (mm H2O /s) - real(r8), pointer :: qflx_snow_drain_col (:) ! col drainage from snow pack - real(r8), pointer :: qflx_qrgwl_col (:) ! col qflx_surf at glaciers, wetlands, lakes - real(r8), pointer :: qflx_runoff_col (:) ! col total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qflx_runoff_r_col (:) ! col Rural total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qflx_runoff_u_col (:) ! col urban total runoff (qflx_drain+qflx_surf) (mm H2O /s) - real(r8), pointer :: qflx_ice_runoff_snwcp_col(:) ! col solid runoff from snow capping (mm H2O /s) - real(r8), pointer :: qflx_ice_runoff_xs_col (:) ! col solid runoff from excess ice in soil (mm H2O /s) - real(r8), pointer :: qflx_rsub_sat_col (:) ! col soil saturation excess [mm/s] - real(r8), pointer :: qflx_snofrz_lyr_col (:,:) ! col snow freezing rate (positive definite) (col,lyr) [kg m-2 s-1] - real(r8), pointer :: qflx_snofrz_col (:) ! col column-integrated snow freezing rate (positive definite) (col) [kg m-2 s-1] - real(r8), pointer :: qflx_drain_vr_col (:,:) ! col liquid water losted as drainage (m /time step) - real(r8), pointer :: snow_sources_col (:) ! col snow sources (mm H2O/s) - real(r8), pointer :: snow_sinks_col (:) ! col snow sinks (mm H2O/s) - - ! Dynamic land cover change - real(r8), pointer :: qflx_liq_dynbal_grc (:) ! grc liq dynamic land cover change conversion runoff flux - real(r8), pointer :: qflx_ice_dynbal_grc (:) ! grc ice dynamic land cover change conversion runoff flux - - ! Objects that help convert once-per-year dynamic land cover changes into fluxes - ! that are dribbled throughout the year - type(annual_flux_dribbler_type) :: qflx_liq_dynbal_dribbler - type(annual_flux_dribbler_type) :: qflx_ice_dynbal_dribbler - - ! ET accumulation - real(r8), pointer :: AnnEt (:) ! Annual average ET flux mmH20/s - - - contains - - - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - - end type waterflux_type - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) ! same as "call initAllocate_type(hydro, bounds)" - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - allocate(this%qflx_prec_intr_patch (begp:endp)) ; this%qflx_prec_intr_patch (:) = nan - allocate(this%qflx_prec_grnd_patch (begp:endp)) ; this%qflx_prec_grnd_patch (:) = nan - allocate(this%qflx_rain_grnd_patch (begp:endp)) ; this%qflx_rain_grnd_patch (:) = nan - allocate(this%qflx_snow_grnd_patch (begp:endp)) ; this%qflx_snow_grnd_patch (:) = nan - allocate(this%qflx_sub_snow_patch (begp:endp)) ; this%qflx_sub_snow_patch (:) = 0.0_r8 - allocate(this%qflx_tran_veg_patch (begp:endp)) ; this%qflx_tran_veg_patch (:) = nan - - allocate(this%qflx_snowindunload_patch (begp:endp)) ; this%qflx_snowindunload_patch (:) = nan - allocate(this%qflx_snowindunload_col (begp:endp)) ; this%qflx_snowindunload_col (:) = nan - allocate(this%qflx_snotempunload_patch (begp:endp)) ; this%qflx_snotempunload_patch (:) = nan - allocate(this%qflx_snotempunload_col (begp:endp)) ; this%qflx_snotempunload_col (:) = nan - - allocate(this%qflx_dew_grnd_patch (begp:endp)) ; this%qflx_dew_grnd_patch (:) = nan - allocate(this%qflx_dew_snow_patch (begp:endp)) ; this%qflx_dew_snow_patch (:) = nan - - allocate(this%qflx_prec_intr_col (begc:endc)) ; this%qflx_prec_intr_col (:) = nan - allocate(this%qflx_prec_grnd_col (begc:endc)) ; this%qflx_prec_grnd_col (:) = nan - allocate(this%qflx_rain_grnd_col (begc:endc)) ; this%qflx_rain_grnd_col (:) = nan - allocate(this%qflx_snow_grnd_col (begc:endc)) ; this%qflx_snow_grnd_col (:) = nan - allocate(this%qflx_sub_snow_col (begc:endc)) ; this%qflx_sub_snow_col (:) = 0.0_r8 - allocate(this%qflx_snwcp_liq_col (begc:endc)) ; this%qflx_snwcp_liq_col (:) = nan - allocate(this%qflx_snwcp_ice_col (begc:endc)) ; this%qflx_snwcp_ice_col (:) = nan - allocate(this%qflx_snwcp_discarded_liq_col(begc:endc)) ; this%qflx_snwcp_discarded_liq_col(:) = nan - allocate(this%qflx_snwcp_discarded_ice_col(begc:endc)) ; this%qflx_snwcp_discarded_ice_col(:) = nan - allocate(this%qflx_tran_veg_col (begc:endc)) ; this%qflx_tran_veg_col (:) = nan - allocate(this%qflx_evap_veg_col (begc:endc)) ; this%qflx_evap_veg_col (:) = nan - allocate(this%qflx_evap_can_col (begc:endc)) ; this%qflx_evap_can_col (:) = nan - allocate(this%qflx_evap_soi_col (begc:endc)) ; this%qflx_evap_soi_col (:) = nan - allocate(this%qflx_evap_tot_col (begc:endc)) ; this%qflx_evap_tot_col (:) = nan - allocate(this%qflx_evap_grnd_col (begc:endc)) ; this%qflx_evap_grnd_col (:) = nan - allocate(this%qflx_dew_grnd_col (begc:endc)) ; this%qflx_dew_grnd_col (:) = nan - allocate(this%qflx_dew_snow_col (begc:endc)) ; this%qflx_dew_snow_col (:) = nan - allocate(this%qflx_evap_veg_patch (begp:endp)) ; this%qflx_evap_veg_patch (:) = nan - allocate(this%qflx_evap_can_patch (begp:endp)) ; this%qflx_evap_can_patch (:) = nan - allocate(this%qflx_evap_soi_patch (begp:endp)) ; this%qflx_evap_soi_patch (:) = nan - allocate(this%qflx_evap_tot_patch (begp:endp)) ; this%qflx_evap_tot_patch (:) = nan - allocate(this%qflx_evap_grnd_patch (begp:endp)) ; this%qflx_evap_grnd_patch (:) = nan - allocate(this%qflx_phs_neg_col (begc:endc)) ; this%qflx_phs_neg_col (:) = nan - - allocate( this%qflx_ev_snow_patch (begp:endp)) ; this%qflx_ev_snow_patch (:) = nan - allocate( this%qflx_ev_snow_col (begc:endc)) ; this%qflx_ev_snow_col (:) = nan - allocate( this%qflx_ev_soil_patch (begp:endp)) ; this%qflx_ev_soil_patch (:) = nan - allocate( this%qflx_ev_soil_col (begc:endc)) ; this%qflx_ev_soil_col (:) = nan - allocate( this%qflx_ev_h2osfc_patch (begp:endp)) ; this%qflx_ev_h2osfc_patch (:) = nan - allocate( this%qflx_ev_h2osfc_col (begc:endc)) ; this%qflx_ev_h2osfc_col (:) = nan - - allocate(this%qflx_drain_vr_col (begc:endc,1:nlevsoi)) ; this%qflx_drain_vr_col (:,:) = nan - allocate(this%qflx_adv_col (begc:endc,0:nlevsoi)) ; this%qflx_adv_col (:,:) = nan - allocate(this%qflx_rootsoi_col (begc:endc,1:nlevsoi)) ; this%qflx_rootsoi_col (:,:) = nan - allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan - allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan - allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan - allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan - allocate(this%qflx_h2osfc_to_ice_col (begc:endc)) ; this%qflx_h2osfc_to_ice_col (:) = nan - allocate(this%qflx_h2osfc_surf_col (begc:endc)) ; this%qflx_h2osfc_surf_col (:) = nan - allocate(this%qflx_snow_h2osfc_col (begc:endc)) ; this%qflx_snow_h2osfc_col (:) = nan - allocate(this%qflx_snomelt_col (begc:endc)) ; this%qflx_snomelt_col (:) = nan - allocate(this%qflx_snomelt_lyr_col (begc:endc,-nlevsno+1:0)) ; this%qflx_snomelt_lyr_col (:,:) = nan - allocate(this%qflx_snow_drain_col (begc:endc)) ; this%qflx_snow_drain_col (:) = nan - allocate(this%qflx_snofrz_col (begc:endc)) ; this%qflx_snofrz_col (:) = nan - allocate(this%qflx_snofrz_lyr_col (begc:endc,-nlevsno+1:0)) ; this%qflx_snofrz_lyr_col (:,:) = nan - allocate(this%qflx_qrgwl_col (begc:endc)) ; this%qflx_qrgwl_col (:) = nan - allocate(this%qflx_drain_perched_col (begc:endc)) ; this%qflx_drain_perched_col (:) = nan - allocate(this%qflx_deficit_col (begc:endc)) ; this%qflx_deficit_col (:) = nan - allocate(this%qflx_floodc_col (begc:endc)) ; this%qflx_floodc_col (:) = nan - allocate(this%qflx_sl_top_soil_col (begc:endc)) ; this%qflx_sl_top_soil_col (:) = nan - allocate(this%qflx_runoff_col (begc:endc)) ; this%qflx_runoff_col (:) = nan - allocate(this%qflx_runoff_r_col (begc:endc)) ; this%qflx_runoff_r_col (:) = nan - allocate(this%qflx_runoff_u_col (begc:endc)) ; this%qflx_runoff_u_col (:) = nan - allocate(this%qflx_ice_runoff_snwcp_col(begc:endc)) ; this%qflx_ice_runoff_snwcp_col(:) = nan - allocate(this%qflx_ice_runoff_xs_col (begc:endc)) ; this%qflx_ice_runoff_xs_col (:) = nan - allocate(this%qflx_rsub_sat_col (begc:endc)) ; this%qflx_rsub_sat_col (:) = nan - allocate(this%snow_sources_col (begc:endc)) ; this%snow_sources_col (:) = nan - allocate(this%snow_sinks_col (begc:endc)) ; this%snow_sinks_col (:) = nan - - allocate(this%qflx_liq_dynbal_grc (begg:endg)) ; this%qflx_liq_dynbal_grc (:) = nan - allocate(this%qflx_ice_dynbal_grc (begg:endg)) ; this%qflx_ice_dynbal_grc (:) = nan - allocate(this%AnnET (begc:endc)) ; this%AnnET (:) = nan - - this%qflx_liq_dynbal_dribbler = annual_flux_dribbler_gridcell( & - bounds = bounds, & - name = 'qflx_liq_dynbal', & - units = 'mm H2O') - - this%qflx_ice_dynbal_dribbler = annual_flux_dribbler_gridcell( & - bounds = bounds, & - name = 'qflx_ice_dynbal', & - units = 'mm H2O') - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !USES: - use clm_varctl , only : use_cn - use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: begg, endg - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - this%qflx_top_soil_col(begc:endc) = spval - call hist_addfld1d (fname='QTOPSOIL', units='mm/s', & - avgflag='A', long_name='water input to surface', & - ptr_col=this%qflx_top_soil_col, c2l_scale_type='urbanf', default='inactive') - - this%qflx_infl_col(begc:endc) = spval - call hist_addfld1d (fname='QINFL', units='mm/s', & - avgflag='A', long_name='infiltration', & - ptr_col=this%qflx_infl_col, c2l_scale_type='urbanf') - - this%qflx_surf_col(begc:endc) = spval - call hist_addfld1d (fname='QOVER', units='mm/s', & - avgflag='A', long_name='surface runoff', & - ptr_col=this%qflx_surf_col, c2l_scale_type='urbanf') - - this%qflx_qrgwl_col(begc:endc) = spval - call hist_addfld1d (fname='QRGWL', units='mm/s', & - avgflag='A', & - long_name='surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff from QSNWCPICE', & - ptr_col=this%qflx_qrgwl_col, c2l_scale_type='urbanf') - - this%qflx_drain_col(begc:endc) = spval - call hist_addfld1d (fname='QDRAI', units='mm/s', & - avgflag='A', long_name='sub-surface drainage', & - ptr_col=this%qflx_drain_col, c2l_scale_type='urbanf') - - this%qflx_liq_dynbal_grc(begg:endg) = spval - call hist_addfld1d (fname='QFLX_LIQ_DYNBAL', units='mm/s', & - avgflag='A', long_name='liq dynamic land cover change conversion runoff flux', & - ptr_lnd=this%qflx_liq_dynbal_grc) - - this%qflx_ice_dynbal_grc(begg:endg) = spval - call hist_addfld1d (fname='QFLX_ICE_DYNBAL', units='mm/s', & - avgflag='A', long_name='ice dynamic land cover change conversion runoff flux', & - ptr_lnd=this%qflx_ice_dynbal_grc) - - this%qflx_runoff_col(begc:endc) = spval - call hist_addfld1d (fname='QRUNOFF', units='mm/s', & - avgflag='A', & - long_name='total liquid runoff not including correction for land use change', & - ptr_col=this%qflx_runoff_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QRUNOFF_ICE', units='mm/s', avgflag='A', & - long_name='total liquid runoff not incl corret for LULCC (ice landunits only)', & - ptr_col=this%qflx_runoff_col, c2l_scale_type='urbanf', l2g_scale_type='ice') - - this%qflx_runoff_u_col(begc:endc) = spval - call hist_addfld1d (fname='QRUNOFF_U', units='mm/s', & - avgflag='A', long_name='Urban total runoff', & - ptr_col=this%qflx_runoff_u_col, set_nourb=spval, c2l_scale_type='urbanf', default='inactive') - - this%qflx_runoff_r_col(begc:endc) = spval - call hist_addfld1d (fname='QRUNOFF_R', units='mm/s', & - avgflag='A', long_name='Rural total runoff', & - ptr_col=this%qflx_runoff_r_col, set_spec=spval, default='inactive') - - this%qflx_snow_drain_col(begc:endc) = spval - call hist_addfld1d (fname='QFLX_SNOW_DRAIN', units='mm/s', & - avgflag='A', long_name='drainage from snow pack', & - ptr_col=this%qflx_snow_drain_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_SNOW_DRAIN_ICE', units='mm/s', & - avgflag='A', long_name='drainage from snow pack melt (ice landunits only)', & - ptr_col=this%qflx_snow_drain_col, c2l_scale_type='urbanf', l2g_scale_type='ice') - - this%qflx_snomelt_col(begc:endc) = spval - call hist_addfld1d (fname='QSNOMELT', units='mm/s', & - avgflag='A', long_name='snow melt rate', & - ptr_col=this%qflx_snomelt_col, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNOMELT_ICE', units='mm/s', & - avgflag='A', long_name='snow melt (ice landunits only)', & - ptr_col=this%qflx_snomelt_col, c2l_scale_type='urbanf', l2g_scale_type='ice') - - this%qflx_snomelt_lyr_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%qflx_snomelt_lyr_col(begc:endc,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_MELT', units='mm/s', type2d='levsno', & - avgflag='A', long_name='snow melt rate in each snow layer', & - ptr_col=data2dptr, c2l_scale_type='urbanf',no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_MELT_ICE', units='mm/s', type2d='levsno', & - avgflag='A', long_name='snow melt rate in each snow layer (ice landunits only)', & - ptr_col=data2dptr, c2l_scale_type='urbanf',no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%qflx_snofrz_col(begc:endc) = spval - call hist_addfld1d (fname='QSNOFRZ', units='kg/m2/s', & - avgflag='A', long_name='column-integrated snow freezing rate', & - ptr_col=this%qflx_snofrz_col, set_lake=spval, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNOFRZ_ICE', units='mm/s', & - avgflag='A', long_name='column-integrated snow freezing rate (ice landunits only)', & - ptr_col=this%qflx_snofrz_col, c2l_scale_type='urbanf', l2g_scale_type='ice') - - this%qflx_snofrz_lyr_col(begc:endc,-nlevsno+1:0) = spval - data2dptr => this%qflx_snofrz_lyr_col(begc:endc,-nlevsno+1:0) - call hist_addfld2d (fname='SNO_FRZ', units='kg/m2/s', type2d='levsno', & - avgflag='A', long_name='snow freezing rate in each snow layer', & - ptr_col=data2dptr, c2l_scale_type='urbanf',no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_FRZ_ICE', units='mm/s', type2d='levsno', & - avgflag='A', long_name='snow freezing rate in each snow layer (ice landunits only)', & - ptr_col=data2dptr, c2l_scale_type='urbanf',no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - this%qflx_h2osfc_to_ice_col(begc:endc) = spval - call hist_addfld1d (fname='QH2OSFC_TO_ICE', units='mm/s', & - avgflag='A', long_name='surface water converted to ice', & - ptr_col=this%qflx_h2osfc_to_ice_col, default='inactive') - - this%qflx_prec_intr_patch(begp:endp) = spval - call hist_addfld1d (fname='QINTR', units='mm/s', & - avgflag='A', long_name='interception', & - ptr_patch=this%qflx_prec_intr_patch, set_lake=0._r8) - - this%qflx_prec_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='QDRIP', units='mm/s', & - avgflag='A', long_name='throughfall', & - ptr_patch=this%qflx_prec_grnd_patch, c2l_scale_type='urbanf') - - this%qflx_evap_soi_patch(begp:endp) = spval - call hist_addfld1d (fname='QSOIL', units='mm/s', & - avgflag='A', long_name= 'Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew)', & - ptr_patch=this%qflx_evap_soi_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSOIL_ICE', units='mm/s', & - avgflag='A', long_name='Ground evaporation (ice landunits only)', & - ptr_patch=this%qflx_evap_soi_patch, c2l_scale_type='urbanf', l2g_scale_type='ice') - - call hist_addfld2d (fname='QROOTSINK', units='mm/s', type2d='levsoi', & - avgflag='A', long_name='water flux from soil to root in each soil-layer', & - ptr_col=this%qflx_rootsoi_col, set_spec=spval, l2g_scale_type='veg', default='inactive') - - this%qflx_evap_can_patch(begp:endp) = spval - call hist_addfld1d (fname='QVEGE', units='mm/s', & - avgflag='A', long_name='canopy evaporation', & - ptr_patch=this%qflx_evap_can_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%qflx_tran_veg_patch(begp:endp) = spval - call hist_addfld1d (fname='QVEGT', units='mm/s', & - avgflag='A', long_name='canopy transpiration', & - ptr_patch=this%qflx_tran_veg_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%qflx_ev_snow_patch(begp:endp) = spval - call hist_addfld1d (fname='QSNOEVAP', units='mm/s', & - avgflag='A', long_name='evaporation from snow', & - ptr_patch=this%qflx_tran_veg_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%qflx_snowindunload_patch(begp:endp) = spval - call hist_addfld1d (fname='QSNO_WINDUNLOAD', units='mm/s', & - avgflag='A', long_name='canopy snow wind unloading', & - ptr_patch=this%qflx_snowindunload_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%qflx_snotempunload_patch(begp:endp) = spval - call hist_addfld1d (fname='QSNO_TEMPUNLOAD', units='mm/s', & - avgflag='A', long_name='canopy snow temp unloading', & - ptr_patch=this%qflx_snotempunload_patch, set_lake=0._r8, c2l_scale_type='urbanf') - - this%qflx_snwcp_liq_col(begc:endc) = spval - call hist_addfld1d (fname='QSNOCPLIQ', units='mm H2O/s', & - avgflag='A', long_name='excess liquid h2o due to snow capping not including correction for land use change', & - ptr_col=this%qflx_snwcp_liq_col, c2l_scale_type='urbanf') - - this%qflx_snwcp_ice_col(begc:endc) = spval - call hist_addfld1d (fname='QSNWCPICE', units='mm H2O/s', & - avgflag='A', long_name='excess solid h2o due to snow capping not including correction for land use change', & - ptr_col=this%qflx_snwcp_ice_col, c2l_scale_type='urbanf') - - this%qflx_rain_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_RAIN_GRND', units='mm H2O/s', & - avgflag='A', long_name='rain on ground after interception', & - ptr_patch=this%qflx_rain_grnd_patch, default='inactive', c2l_scale_type='urbanf') - - this%qflx_snow_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_SNOW_GRND', units='mm H2O/s', & - avgflag='A', long_name='snow on ground after interception', & - ptr_patch=this%qflx_snow_grnd_patch, default='inactive', c2l_scale_type='urbanf') - - this%qflx_evap_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_EVAP_GRND', units='mm H2O/s', & - avgflag='A', long_name='ground surface evaporation', & - ptr_patch=this%qflx_evap_grnd_patch, default='inactive', c2l_scale_type='urbanf') - - this%qflx_evap_veg_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_EVAP_VEG', units='mm H2O/s', & - avgflag='A', long_name='vegetation evaporation', & - ptr_patch=this%qflx_evap_veg_patch, default='inactive', c2l_scale_type='urbanf') - - this%qflx_evap_tot_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_EVAP_TOT', units='mm H2O/s', & - avgflag='A', long_name='qflx_evap_soi + qflx_evap_can + qflx_tran_veg', & - ptr_patch=this%qflx_evap_tot_patch, c2l_scale_type='urbanf') - - this%qflx_dew_grnd_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_DEW_GRND', units='mm H2O/s', & - avgflag='A', long_name='ground surface dew formation', & - ptr_patch=this%qflx_dew_grnd_patch, c2l_scale_type='urbanf') - - this%qflx_sub_snow_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_SUB_SNOW', units='mm H2O/s', & - avgflag='A', & - long_name='sublimation rate from snow pack (also includes bare ice sublimation from glacier columns)', & - ptr_patch=this%qflx_sub_snow_patch, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_SUB_SNOW_ICE', units='mm H2O/s', & - avgflag='A', & - long_name='sublimation rate from snow pack (also includes bare ice sublimation from glacier columns) '// & - '(ice landunits only)', & - ptr_patch=this%qflx_sub_snow_patch, c2l_scale_type='urbanf', l2g_scale_type='ice', & - default='inactive') - - this%qflx_dew_snow_patch(begp:endp) = spval - call hist_addfld1d (fname='QFLX_DEW_SNOW', units='mm H2O/s', & - avgflag='A', long_name='surface dew added to snow pacK', & - ptr_patch=this%qflx_dew_snow_patch, c2l_scale_type='urbanf') - - this%qflx_h2osfc_surf_col(begc:endc) = spval - call hist_addfld1d (fname='QH2OSFC', units='mm/s', & - avgflag='A', long_name='surface water runoff', & - ptr_col=this%qflx_h2osfc_surf_col) - - this%qflx_drain_perched_col(begc:endc) = spval - call hist_addfld1d (fname='QDRAI_PERCH', units='mm/s', & - avgflag='A', long_name='perched wt drainage', & - ptr_col=this%qflx_drain_perched_col, c2l_scale_type='urbanf') - - this%qflx_rsub_sat_col(begc:endc) = spval - call hist_addfld1d (fname='QDRAI_XS', units='mm/s', & - avgflag='A', long_name='saturation excess drainage', & - ptr_col=this%qflx_rsub_sat_col, c2l_scale_type='urbanf') - - this%qflx_phs_neg_col(begc:endc) = spval - call hist_addfld1d (fname='QPHSNEG', units='mm/s', & - avgflag='A', long_name='net negative hydraulic redistribution flux', & - ptr_col=this%qflx_phs_neg_col, default='inactive') - - ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at any - ! given time step but only if there is at least one snow layer (for all landunits - ! except lakes). Also note that monthly average files of snow_sources and snow_sinks - ! sinks must be weighted by number of days in the month to diagnose, for example, an - ! annual value of the change in h2osno. - - this%snow_sources_col(begc:endc) = spval - call hist_addfld1d (fname='SNOW_SOURCES', units='mm/s', & - avgflag='A', long_name='snow sources (liquid water)', & - ptr_col=this%snow_sources_col, c2l_scale_type='urbanf') - - this%snow_sinks_col(begc:endc) = spval - call hist_addfld1d (fname='SNOW_SINKS', units='mm/s', & - avgflag='A', long_name='snow sinks (liquid water)', & - ptr_col=this%snow_sinks_col, c2l_scale_type='urbanf') - - this%AnnET(begc:endc) = spval - call hist_addfld1d (fname='AnnET', units='mm/s', & - avgflag='A', long_name='Annual ET', & - ptr_col=this%AnnET, c2l_scale_type='urbanf', default='inactive') - - end subroutine InitHistory - - - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! - ! !USES - use clm_varcon , only : spval - use accumulMod , only : init_accum_field - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - !--------------------------------------------------------------------- - - if (use_fun) then - - call init_accum_field (name='AnnET', units='MM H2O/S', & - desc='365-day running mean of total ET', accum_type='runmean', accum_period=-365, & - subgrid_type='column', numlev=1, init_value=0._r8) - - end if - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - ! - subroutine InitAccVars (this, bounds) - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES - use accumulMod , only : extract_accum_field - use clm_time_manager , only : get_nstep - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: nstep - integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary - !--------------------------------------------------------------------- - begc = bounds%begc; endc = bounds%endc - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begc:endc), stat=ier) - - ! Determine time step - nstep = get_nstep() - - if (use_fun) then - call extract_accum_field ('AnnET', rbufslp, nstep) - this%AnnET(begc:endc) = rbufslp(begc:endc) - end if - - deallocate(rbufslp) - - end subroutine InitAccVars - - - !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) - ! - ! USES - use clm_time_manager, only : get_nstep - use accumulMod , only : update_accum_field, extract_accum_field - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,c,p ! indices - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: ier ! error status - integer :: begc, endc - real(r8), pointer :: rbufslp(:) ! temporary single level - patch level - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - nstep = get_nstep() - - ! Allocate needed dynamic memory for single level patch field - - allocate(rbufslp(begc:endc), stat=ier) - - do c = begc,endc - rbufslp(c) = this%qflx_evap_tot_col(c) - end do - if (use_fun) then - ! Accumulate and extract AnnET (accumulates total ET as 365-day running mean) - call update_accum_field ('AnnET', rbufslp, nstep) - call extract_accum_field ('AnnET', this%AnnET, nstep) - - end if - - deallocate(rbufslp) - - end subroutine UpdateAccVars - - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,c,l - !----------------------------------------------------------------------- - - this%qflx_evap_grnd_patch(bounds%begp:bounds%endp) = 0.0_r8 - this%qflx_dew_grnd_patch (bounds%begp:bounds%endp) = 0.0_r8 - this%qflx_dew_snow_patch (bounds%begp:bounds%endp) = 0.0_r8 - - this%qflx_evap_grnd_col(bounds%begc:bounds%endc) = 0.0_r8 - this%qflx_dew_grnd_col (bounds%begc:bounds%endc) = 0.0_r8 - this%qflx_dew_snow_col (bounds%begc:bounds%endc) = 0.0_r8 - - this%qflx_phs_neg_col(bounds%begc:bounds%endc) = 0.0_r8 - - this%qflx_h2osfc_surf_col(bounds%begc:bounds%endc) = 0._r8 - this%qflx_snow_drain_col(bounds%begc:bounds%endc) = 0._r8 - - ! This variable only gets set in the hydrology filter; need to initialize it to 0 for - ! the sake of columns outside this filter - this%qflx_ice_runoff_xs_col(bounds%begc:bounds%endc) = 0._r8 - - ! needed for CNNLeaching - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%qflx_drain_col(c) = 0._r8 - this%qflx_surf_col(c) = 0._r8 - end if - end do - - end subroutine InitCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use ncdio_pio, only : file_desc_t, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(waterflux_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - logical :: readvar ! determine if variable is on initial file - !----------------------------------------------------------------------- - - ! needed for SNICAR - call restartvar(ncid=ncid, flag=flag, varname='qflx_snofrz_lyr', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer ice freezing rate', units='kg m-2 s-1', & - interpinic_flag='interp', readvar=readvar, data=this%qflx_snofrz_lyr_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize qflx_snofrz_lyr to zero - this%qflx_snofrz_lyr_col(bounds%begc:bounds%endc,-nlevsno+1:0) = 0._r8 - endif - - call restartvar(ncid=ncid, flag=flag, varname='qflx_snow_drain:qflx_snow_melt', xtype=ncd_double, & - dim1name='column', & - long_name='drainage from snow column', units='mm/s', & - interpinic_flag='interp', readvar=readvar, data=this%qflx_snow_drain_col) - if (flag == 'read' .and. .not. readvar) then - ! initial run, not restart: initialize qflx_snow_drain to zero - this%qflx_snow_drain_col(bounds%begc:bounds%endc) = 0._r8 - endif - - call this%qflx_liq_dynbal_dribbler%Restart(bounds, ncid, flag) - call this%qflx_ice_dynbal_dribbler%Restart(bounds, ncid, flag) - - end subroutine Restart - -end module WaterfluxType diff --git a/src/biogeophys/test/CMakeLists.txt b/src/biogeophys/test/CMakeLists.txt deleted file mode 100644 index 75b77d5391..0000000000 --- a/src/biogeophys/test/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_subdirectory(Daylength_test) -add_subdirectory(Irrigation_test) -add_subdirectory(HumanStress_test) -add_subdirectory(SnowHydrology_test) -add_subdirectory(TotalWaterAndHeat_test) diff --git a/src/biogeophys/test/Daylength_test/CMakeLists.txt b/src/biogeophys/test/Daylength_test/CMakeLists.txt deleted file mode 100644 index 6182551580..0000000000 --- a/src/biogeophys/test/Daylength_test/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set (pfunit_sources - test_daylength.pf - test_compute_max_daylength.pf) - -create_pFUnit_test(Daylength test_Daylength_exe - "${pfunit_sources}" "") - -target_link_libraries(test_Daylength_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/biogeophys/test/Daylength_test/test_compute_max_daylength.pf b/src/biogeophys/test/Daylength_test/test_compute_max_daylength.pf deleted file mode 100644 index 3c8d080128..0000000000 --- a/src/biogeophys/test/Daylength_test/test_compute_max_daylength.pf +++ /dev/null @@ -1,100 +0,0 @@ -module test_compute_max_daylength - - ! Tests of DaylengthMod: ComputeMaxDaylength - - use pfunit_mod - use DaylengthMod, only: ComputeMaxDaylength, daylength - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod, only : unittest_subgrid_teardown, bounds - use unittestSimpleSubgridSetupsMod, only : setup_ncells_single_veg_patch - use GridcellType, only : grc - - implicit none - - @TestCase - type, extends(TestCase) :: TestMaxDaylength - contains - procedure :: setUp - procedure :: tearDown - end type TestMaxDaylength - - ! Note larger tolerance here than what we typically use: - real(r8), parameter :: tol = 1.e-3_r8 - -contains - - subroutine setUp(this) - class(TestMaxDaylength), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestMaxDaylength), intent(inout) :: this - - call unittest_subgrid_teardown - end subroutine tearDown - - @Test - subroutine computeMaxDaylength_basic(this) - ! Basic tests of ComputeMaxDaylength, for both negative and positive latitudes - class(TestMaxDaylength), intent(inout) :: this - real(r8), parameter :: lat1 = 0.1_r8 - real(r8), parameter :: lat2 = 0.2_r8 - real(r8), parameter :: obliquity = 0.3_r8 - real(r8) :: expected_lat1, expected_lat2 - real(r8) :: expected(4) - - call setup_ncells_single_veg_patch(ncells=4, pft_type=1) - ! Mix of negative and positive latitudes: - grc%lat(bounds%begg:bounds%endg) = [-lat1, lat1, -lat2, lat2] - - expected_lat1 = daylength(lat1, obliquity) - expected_lat2 = daylength(lat2, obliquity) - ! Expected max daylength is the same for lat1 and -lat1 - expected(:) = [expected_lat1, expected_lat1, expected_lat2, expected_lat2] - - call ComputeMaxDaylength(bounds, & - lat = grc%lat(bounds%begg:bounds%endg), & - obliquity = obliquity, & - max_daylength = grc%max_dayl(bounds%begg:bounds%endg)) - - @assertEqual(expected, grc%max_dayl(bounds%begg:bounds%endg), tolerance=tol) - end subroutine computeMaxDaylength_basic - - @Test - subroutine computeMaxDaylength_equator(this) - ! At the equator, max daylength should be 12 hours - class(TestMaxDaylength), intent(inout) :: this - real(r8), parameter :: twelve_hours = 12._r8 * 60._r8 * 60._r8 ! in seconds - - call setup_ncells_single_veg_patch(ncells=1, pft_type=1) - grc%lat(bounds%begg) = 0._r8 - - call ComputeMaxDaylength(bounds, & - lat = grc%lat(bounds%begg:bounds%endg), & - obliquity = 0.3_r8, & - max_daylength = grc%max_dayl(bounds%begg:bounds%endg)) - - @assertEqual(twelve_hours, grc%max_dayl(bounds%begg), tolerance=tol) - end subroutine computeMaxDaylength_equator - - @Test - subroutine computeMaxDaylength_nearPoles(this) - ! Near the poles, max daylength should be 24 hours - class(TestMaxDaylength), intent(inout) :: this - real(r8), parameter :: twentyfour_hours = 24._r8 * 60._r8 * 60._r8 ! in seconds - real(r8) :: expected(2) - - call setup_ncells_single_veg_patch(ncells=2, pft_type=1) - grc%lat(bounds%begg:bounds%endg) = [1.5_r8, -1.5_r8] - - expected(:) = [twentyfour_hours, twentyfour_hours] - - call ComputeMaxDaylength(bounds, & - lat = grc%lat(bounds%begg:bounds%endg), & - obliquity = 0.3_r8, & - max_daylength = grc%max_dayl(bounds%begg:bounds%endg)) - - @assertEqual(expected, grc%max_dayl(bounds%begg:bounds%endg), tolerance=tol) - end subroutine computeMaxDaylength_nearPoles - -end module test_compute_max_daylength diff --git a/src/biogeophys/test/Daylength_test/test_daylength.pf b/src/biogeophys/test/Daylength_test/test_daylength.pf deleted file mode 100644 index b326a1190a..0000000000 --- a/src/biogeophys/test/Daylength_test/test_daylength.pf +++ /dev/null @@ -1,76 +0,0 @@ -module test_daylength - - ! Tests of the daylength function in DaylengthMod - - use pfunit_mod - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod, only : SHR_CONST_PI - use DaylengthMod , only : daylength - - implicit none - save - - real(r8), parameter :: tol = 1.e-3_r8 - -contains - - @Test - subroutine test_standard_points() - ! Tests multiple points, not edge cases - - @assertEqual([26125.331269192659_r8, 33030.159082987258_r8], daylength([-1.4_r8, -1.3_r8], 0.1_r8), tolerance=tol) - end subroutine test_standard_points - - - @Test - subroutine test_near_poles() - ! Tests points near the north and south pole, which should result in full night and - ! full day - - @assertEqual([0.0_r8, 86400.0_r8], daylength([-1.5_r8, 1.5_r8], 0.1_r8), tolerance=tol) - end subroutine test_near_poles - - - @Test - subroutine test_north_pole() - ! Tests north pole point, including rounding error - - @assertEqual(86400._r8, daylength(SHR_CONST_PI/2.0_r8, 0.1_r8), tolerance=tol) - @assertEqual(86400._r8, daylength(SHR_CONST_PI/1.999999999999999_r8, 0.1_r8), tolerance=tol) - end subroutine test_north_pole - - - @Test - subroutine test_south_pole() - ! Tests north pole point, including rounding error - - @assertEqual(0._r8, daylength(-1.0_r8 * SHR_CONST_PI/2.0_r8, 0.1_r8), tolerance=tol) - @assertEqual(0._r8, daylength(-1.0_r8 * SHR_CONST_PI/1.999999999999999_r8, 0.1_r8), tolerance=tol) - end subroutine test_south_pole - - - @Test - subroutine test_error_in_decl() - - @assertIsNaN(daylength(-1.0_r8, -3.0_r8)) - end subroutine test_error_in_decl - - - @Test - subroutine test_error_in_lat_scalar() - - @assertIsNaN(daylength(3.0_r8, 0.1_r8)) - end subroutine test_error_in_lat_scalar - - @Test - subroutine test_error_in_lat_array() - real(r8) :: my_result(2) - - my_result = daylength([1.0_r8, 3.0_r8], 0.1_r8) - @assertIsFinite(my_result(1)) - @assertIsNaN(my_result(2)) - end subroutine test_error_in_lat_array - - -end module test_daylength diff --git a/src/biogeophys/test/HumanStress_test/CMakeLists.txt b/src/biogeophys/test/HumanStress_test/CMakeLists.txt deleted file mode 100644 index d2583a3a47..0000000000 --- a/src/biogeophys/test/HumanStress_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(humanstress test_humanstress_exe - "test_humanstress.pf" "") - -target_link_libraries(test_humanstress_exe clm csm_share) diff --git a/src/biogeophys/test/HumanStress_test/test_humanstress.pf b/src/biogeophys/test/HumanStress_test/test_humanstress.pf deleted file mode 100644 index 51b41cf8e4..0000000000 --- a/src/biogeophys/test/HumanStress_test/test_humanstress.pf +++ /dev/null @@ -1,139 +0,0 @@ -module test_humanstress - - ! Tests of the humanstress functions in HumanIndexMod - - use pfunit_mod - - use shr_kind_mod , only : r8 => shr_kind_r8 - use HumanIndexMod - use shr_infnan_mod, only : shr_infnan_isnan - use shr_const_mod , only: SHR_CONST_TKFRZ - - implicit none - save - - real(r8), parameter :: tol = 1.e-8_r8 - -contains - - @Test - subroutine test_standard_WetBulb() - real(r8) :: temp ! Temperature - real(r8) :: rh ! relative humidity - real(r8) :: wbt ! Wet bulb temp - - call Wet_BulbS( 0.0_r8, 0.0_r8, wbt ) - @assertEqual( -3.6531108341574_r8, wbt, tolerance=tol) - call Wet_BulbS( 0.0_r8, 100.0_r8, wbt ) - @assertEqual( -0.13165370616986_r8, wbt, tolerance=tol) - call Wet_BulbS( 50.0_r8, 100.0_r8, wbt ) - @assertTrue( .not. shr_infnan_isnan(wbt) ) - - temp = 100._r8 - rh = 100.0_r8 - do while ( temp > -50.0 ) - call Wet_BulbS( temp, rh, wbt ) - @assertTrue( .not. shr_infnan_isnan(wbt) ) - temp = temp - 0.1_r8 - end do - - end subroutine test_standard_WetBulb - - @Test - subroutine test_WetBulb() - use QSatMod, only : QSat - implicit none - real(r8) :: temp ! Temperature - real(r8) :: rh ! relative humidity - real(r8) :: wbt ! Wet bulb temp - real(r8) :: pres ! atmospheric pressure - real(r8) :: vapor ! vapor pressure - real(r8) :: shum ! specific humidity - - real(r8) :: Teq, epott, sat_vapor - real(r8) :: esdT, qsdT - real(r8) :: es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT - - pres = 100000._r8 - - temp = 50._r8 + SHR_CONST_TKFRZ - rh = 100.0_r8 - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) - call VaporPres( rh, sat_vapor, vapor ) - call VaporPres( rh, rs, shum ) - call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) - @assertEqual( 50._r8, wbt, tolerance=1.e-2_r8 ) - - temp = 59._r8 + SHR_CONST_TKFRZ - rh = 65.0_r8 - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) - call VaporPres( rh, sat_vapor, vapor ) - call VaporPres( rh, rs, shum ) - call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) - @assertTrue( .not. shr_infnan_isnan(wbt) ) - - rh = 100.0_r8 - do while ( rh > 0.0_r8 ) - pres = 120000.0_r8 - do while ( pres > 85000._r8 ) - temp = 53._r8 + SHR_CONST_TKFRZ - do while ( temp > SHR_CONST_TKFRZ-127.0 ) - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) - call VaporPres( rh, sat_vapor, vapor ) - call VaporPres( rh, rs, shum ) - call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) - if ( rh == 100._r8 )then - @assertEqual( temp-SHR_CONST_TKFRZ, wbt, tolerance=1.e-2_r8 ) - else - @assertLessThan( wbt-1.e-6_r8, temp-SHR_CONST_TKFRZ ) - end if - temp = temp - 10.0_r8 - end do - pres = pres - 5000.0_r8 - end do - rh = rh - 5.0_r8 - if ( rh == 90.0_r8 ) rh = 5.0_r8 - end do - - end subroutine test_WetBulb - - - @Test - subroutine test_WetBulb_extremeTemps() - use QSatMod, only : QSat - implicit none - real(r8) :: temp ! Temperature - real(r8) :: rh ! relative humidity - real(r8) :: wbt ! Wet bulb temp - real(r8) :: pres ! atmospheric pressure - real(r8) :: vapor ! vapor pressure - real(r8) :: shum ! specific humidity - - real(r8) :: Teq, epott, sat_vapor - real(r8) :: esdT, qsdT - real(r8) :: es_mb, de_mbdT, dlnes_mbdT, rs, rsdT, foftk, fdT - - rh = 1.0_r8 - do while ( rh < 95.0_r8 ) - pres = 95000.0_r8 - do while ( pres < 110000._r8 ) - temp = 53._r8 + SHR_CONST_TKFRZ - do while ( temp <= SHR_CONST_TKFRZ+58.0 ) - call QSat (temp, pres, sat_vapor, esdT, rs, qsdT) - call VaporPres( rh, sat_vapor, vapor ) - call VaporPres( rh, rs, shum ) - write(*,*) 'temp, pres, rh : ', temp-SHR_CONST_TKFRZ, pres, rh - call Wet_Bulb (temp,vapor,pres,rh,shum,Teq,epott,wbt) - write(*,*) 'wbt: ', wbt - @assertLessThan( wbt-1.e-6_r8, temp-SHR_CONST_TKFRZ ) - temp = temp + 1.5_r8 - end do - pres = pres + 2500.0_r8 - end do - rh = rh + 5.0_r8 - end do - - end subroutine test_WetBulb_extremeTemps - - -end module test_humanstress diff --git a/src/biogeophys/test/Irrigation_test/CMakeLists.txt b/src/biogeophys/test/Irrigation_test/CMakeLists.txt deleted file mode 100644 index 7a1b7cc5ee..0000000000 --- a/src/biogeophys/test/Irrigation_test/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set (pfunit_sources - test_irrigation.pf) - -# extra sources used for this test, which are not .pf files -# (currently none) -set (extra_sources - ) - -create_pFUnit_test(irrigation test_irrigation_exe - "${pfunit_sources}" "${extra_sources}") - -target_link_libraries(test_irrigation_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/biogeophys/test/Irrigation_test/README b/src/biogeophys/test/Irrigation_test/README deleted file mode 100644 index 3619bfddba..0000000000 --- a/src/biogeophys/test/Irrigation_test/README +++ /dev/null @@ -1,68 +0,0 @@ ---- Some design notes --- - -There are a couple of important points about IrrigationMod that motivated how I -set up these tests: - -(1) There are two main routines in the public interface: CalcIrrigationNeeded - and ApplyIrrigation. CalcIrrigationNeeded does not have any effects that are - directly visible; instead, it sets some variables that are later used by - ApplyIrrigation. (These two routines are separated because they need to be - called at different points in the driver.) - -(2) Within CalcIrrigationNeeded, there is a filter loop inside a loop over - levels. (The looping was done in this order for the sake of vectorization, - despite the fact that the code - and possibly the testing - would haven - simpler if the loop nesting were reversed. But this seems typical of - multi-level code throughout CLM.) Furthermore, there is some interaction - between levels (in that a frozen layer j prevents any irrigation demand from - being counted below level j). - -Because of these considerations, it was not straightforward to pull out routines -that could operate on a single point, and just do the testing on these -single-point routines. So instead, I am just testing the public, multi-point -routines. However, for simplicity, most of my tests just use a single point in -the arrays - and then I have just enough multi-point tests to ensure that the -routines truly do work with multiple points. - -Furthermore, I have been influenced lately by advice to "test behavior, not -methods", and to test through the public interface. And in this case, it -actually feels easier to convince myself that the code is doing the right thing -if I set up my tests to operate similarly to how CLM itself will interact with -IrrigationMod - that is, calling CalcIrrigationNeeded followed by -ApplyIrrigation, then examining the resulting qflx_irrig. Thus, that is what I -do in my tests - as opposed to, say, testing CalcIrrigationNeeded by itself and -viewing resulting variables that aren't usually available through the public -interface; or as opposed to breaking the current routines down into smaller -methods just for the sake of testability. Testing through the public interface -also feels like it will make the tests more robust (with fewer changes needed) -if the private implementation changes. - -However, in cases where it's easier to pull out a single-point implementation of -an algorithm, with a relatively trivial wrapper to handle the looping over -multiple points, I'd probably still come down in favor of just testing the -single-point implementation - since doing so is significantly simpler, even if -it means you're testing something that should be private. - - ---- Motivation for use of a testCase --- - -The main purpose of using a TestCase here is so that the tearDown is done -automatically, rather than having to call this teardown manually from each -test. This is important because, if an assertion fails, a test immediately -exits. That means that manual teardown is skipped, whereas this automatic -teardown still happens. This, in turn, is important so that the remaining tests -can still run properly. - ---- Notes about separation into multiple files --- - -I have separated tests based on what needs to be done for the setup and teardown -of each test. Tests that need identical setup and teardown (or lack thereof) are -grouped together. - -IrrigationWrapperMod contains routines that are used by both the singlepatch and -multipatch tests. In terms of setup and teardown: I have put setup stuff in here -that is in common for both the singlepatch and multipatch tests. I then do the -symmetrical teardown here, as well (e.g., if a variable foo is allocated in -IrrigationWrapperMod, I also deallocate it in the teardown routine in -IrrigationWrapperMod). The setup done in the .pf files themselves is stuff that -differs between singlepatch and multipatch (or between individual tests). diff --git a/src/biogeophys/test/Irrigation_test/test_irrigation.pf b/src/biogeophys/test/Irrigation_test/test_irrigation.pf deleted file mode 100644 index 3c599aac02..0000000000 --- a/src/biogeophys/test/Irrigation_test/test_irrigation.pf +++ /dev/null @@ -1,976 +0,0 @@ -module test_irrigation - - ! Tests of IrrigationMod - - use pfunit_mod - use unittestSubgridMod - use IrrigationMod, only : irrigation_type, irrigation_params_type - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varpar, only : nlevsoi, nlevgrnd - use landunit_varcon, only : istsoil - use PatchType , only : patch - use ColumnType , only : col - use GridcellType , only : grc - use pftconMod , only : pftcon - use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use unittestFilterBuilderMod, only : filter_from_range - - implicit none - save - - real(r8), parameter :: tol = 1.e-13_r8 - integer , parameter :: dtime = 1800 ! model time step, seconds - - @TestCase - type, extends(TestCase) :: TestIrrigation - integer :: numf - integer, allocatable :: filter(:) - type(irrigation_type) :: irrigation - - ! Irrigation parameters - type(irrigation_params_type) :: irrigation_params - - ! Inputs to irrigation routines - real(r8), allocatable :: elai(:) - real(r8), allocatable :: t_soisno(:,:) - real(r8), allocatable :: eff_porosity(:,:) - real(r8), allocatable :: h2osoi_liq(:,:) - real(r8), allocatable :: relsat_wilting_point(:,:) - real(r8), allocatable :: relsat_target(:,:) - real(r8), allocatable :: volr(:) - - ! Previous model time - integer :: time_prev - contains - procedure :: setUp - procedure :: tearDown - procedure :: setupSinglePatch - procedure :: setupIrrigation - procedure :: setupEnvironment - procedure :: teardownEnvironment - - ! Computes irrigation deficit for every patch and level - procedure :: computeDeficits - - ! Wrapper that calls both CalcIrrigationNeeded and ApplyIrrigation - procedure :: calculateAndApplyIrrigation - end type TestIrrigation - - real(r8), parameter :: mm_times_km2_to_m3 = 1.e3_r8 - real(r8), parameter :: m3_over_km2_to_mm = 1.e-3_r8 - -contains - - ! ======================================================================== - ! Test helpers - ! ======================================================================== - - subroutine setUp(this) - class(TestIrrigation), intent(inout) :: this - - ! Need to set nlevgrnd before doing the subgrid setup (because it is needed when - ! allocating the col object). So we must do this before setupEnvironment, because - ! that assumes that the subgrid setup has already been done. - ! - ! Also set nlevsoi here for symmetry. - ! - ! Need nlevsoi at least 4 for some tests to be meaningful - nlevsoi = 4 - nlevgrnd = nlevsoi + 1 - - end subroutine setUp - - subroutine tearDown(this) - class(TestIrrigation), intent(inout) :: this - - call this%irrigation%Clean() - call this%teardownEnvironment() - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine setupSinglePatch(this) - ! Sets up grid with single veg patch; also sets up this%filter appropriately - class(TestIrrigation), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%numf, filter=this%filter) - end subroutine setupSinglePatch - - !----------------------------------------------------------------------- - subroutine setupIrrigation(this, maxpft, test_limit_irrigation, nlevirrig, & - irrig_river_volume_threshold) - ! - ! !DESCRIPTION: - ! Do the setup needed for most tests. - ! - ! Values are set up such that there is some irrigation deficit everywhere, and - ! irrigation would start in the following call to CalcIrrigationNeeded (followed by - ! ApplyIrrigation). Values are set the same for every patch/column, and are the same - ! at every level EXCEPT for relsat_wilting_point and relsat_target, which vary - ! linearly by level and col number. - ! - ! volr is set up to be non-limiting - ! - ! Assumes that nlevgrnd and nlevsoi have been set, and that all necessary subgrid - ! setup has been completed. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(TestIrrigation), intent(inout) :: this - - ! max pft type; if not given, set to 1 - integer, intent(in), optional :: maxpft - logical, intent(in), optional :: test_limit_irrigation - - ! number of levels to include in irrigation; if not given, defaults to nlevsoi; - ! irrig_depth is set using the column depths for the first column - integer, intent(in), optional :: nlevirrig - - ! Threshold for river water volume below which irrigation is shut off, if - ! limit_irrigation_if_rof_enabled is .true. (fraction of available river water). If - ! not given, defaults to 0.1 - real(r8), intent(in), optional :: irrig_river_volume_threshold - - ! - ! !LOCAL VARIABLES: - integer :: c,j - logical :: limit_irrigation_if_rof_enabled - integer :: l_maxpft - integer :: l_nlevirrig - real(r8) :: irrig_depth - real(r8) :: l_irrig_river_volume_threshold - !----------------------------------------------------------------------- - - limit_irrigation_if_rof_enabled = .false. - if (present(test_limit_irrigation)) then - limit_irrigation_if_rof_enabled = test_limit_irrigation - end if - - l_maxpft = 1 - if (present(maxpft)) then - l_maxpft = maxpft - end if - - l_nlevirrig = nlevsoi - if (present(nlevirrig)) then - l_nlevirrig = nlevirrig - end if - - l_irrig_river_volume_threshold = 0.1_r8 - if (present(irrig_river_volume_threshold)) then - l_irrig_river_volume_threshold = irrig_river_volume_threshold - end if - - call this%setupEnvironment(maxpft=l_maxpft) - - ! Set the irrigation depth to be just barely big enough to include the desired layers - irrig_depth = col%z(bounds%begc,l_nlevirrig) + 1.e-9_r8 - - ! Set parameters - this%irrigation_params = irrigation_params_type( & - irrig_min_lai = 0.0_r8, & - irrig_start_time = 21600, & - irrig_length = 14400, & - irrig_target_smp = -3400._r8, & - irrig_depth = irrig_depth, & - irrig_threshold_fraction = 0.5_r8, & - irrig_river_volume_threshold = l_irrig_river_volume_threshold, & - limit_irrigation_if_rof_enabled = limit_irrigation_if_rof_enabled) - - ! Set inputs to irrigation routines - allocate(this%elai(bounds%begp:bounds%endp), source=10._r8) - allocate(this%t_soisno(bounds%begc:bounds%endc, nlevgrnd), source=1000._r8) - allocate(this%eff_porosity(bounds%begc:bounds%endc, nlevgrnd), source=1._r8) - allocate(this%h2osoi_liq(bounds%begc:bounds%endc, nlevgrnd), source=0._r8) - allocate(this%relsat_wilting_point(bounds%begc:bounds%endc, nlevsoi)) - allocate(this%relsat_target(bounds%begc:bounds%endc, nlevsoi)) - ! By default, volr will be very limiting... but this should have no effect if - ! limit_irrigation_if_rof_enabled is false (the default) - allocate(this%volr(bounds%begg:bounds%endg), source=0._r8) - - do j = 1, nlevsoi - do c = bounds%begc, bounds%endc - this%relsat_wilting_point(c,j) = 0.07_r8 * j * (c - bounds%begc + 1) - this%relsat_target(c,j) = 0.1_r8 * j * (c - bounds%begc + 1) - end do - end do - - ! Set time_prev to the irrig_start_time minus 1 hour (since we're using a longitude - ! about 1 hour east of 0Z) - this%time_prev = this%irrigation_params%irrig_start_time - 3600 - - call this%irrigation%InitForTesting(bounds, this%irrigation_params, dtime, & - this%relsat_wilting_point, this%relsat_target) - - end subroutine setupIrrigation - - !----------------------------------------------------------------------- - subroutine setupEnvironment(this, maxpft) - ! - ! !DESCRIPTION: - ! Sets up the external environment used by Irrigation - i.e., things accessed via - ! 'use' statements. - ! - ! Assumes nlevgrnd and nlevsoi have been set, and that all necessary subgrid setup has - ! been completed. - ! - ! !ARGUMENTS: - class(TestIrrigation), intent(in) :: this - integer, intent(in) :: maxpft ! max pft type that needs to be supported - ! - integer :: c,j - - !----------------------------------------------------------------------- - - allocate(pftcon%irrigated(0:maxpft), source=1.0_r8) - - col%dz(:,1:nlevgrnd) = 1.0_r8 - do j = 1, nlevgrnd - do c = bounds%begc, bounds%endc - col%z(c,j) = sum(col%dz(c,1:j-1)) + 0.5_r8*col%dz(c,j) - end do - end do - - do c = bounds%begc, bounds%endc - ! Setting nbedrock to nlevsoi means that none of the layers from 1:nlevsoi are - ! considered bedrock - col%nbedrock(c) = nlevsoi - end do - - ! slightly greater than 1 hour offset - grc%londeg(:) = 15.1_r8 - - grc%area(:) = 10.0_r8 - - end subroutine setupEnvironment - - !----------------------------------------------------------------------- - subroutine teardownEnvironment(this) - ! - ! !DESCRIPTION: - ! Tears down the environment set up by setupEnvironment. Should be called after each - ! test. Note that this does NOT deallocate the subgrid variables - that cleanup - ! needs to be done separately. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(TestIrrigation), intent(in) :: this - ! - !----------------------------------------------------------------------- - - deallocate(pftcon%irrigated) - - end subroutine teardownEnvironment - - !----------------------------------------------------------------------- - subroutine computeDeficits(this, deficits) - ! - ! !DESCRIPTION: - ! Computes irrigation deficit for each patch and layer, from 1 to nlevsoi - ! - ! Allocates the 'deficits' variable, and gives it a lower bound of bounds%begp. - ! - ! The motivation for this function is: For most of the irrigation tests, we assume - ! that the RelsatToH2osoi function is working correctly, and we want to test the code - ! that builds on top of that function. By having this function, we can avoid having to - ! hard-code the deficits in each test. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(TestIrrigation), intent(in) :: this - real(r8), allocatable, intent(out) :: deficits(:,:) ! kg m-2 - ! - ! !LOCAL VARIABLES: - integer :: p, c, j - real(r8) :: h2osoi_liq_target - - character(len=*), parameter :: subname = 'computeDeficits' - !----------------------------------------------------------------------- - - allocate(deficits(bounds%begp:bounds%endp, nlevsoi)) - do j = 1, nlevsoi - do p = bounds%begp, bounds%endp - c = patch%column(p) - h2osoi_liq_target = this%irrigation%RelsatToH2osoi( & - relsat = this%relsat_target(c,j), & - eff_porosity = this%eff_porosity(c,j), & - dz = col%dz(c,j)) - deficits(p,j) = h2osoi_liq_target - this%h2osoi_liq(c,j) - end do - end do - - end subroutine computeDeficits - - !----------------------------------------------------------------------- - subroutine calculateAndApplyIrrigation(this) - ! - ! !DESCRIPTION: - ! Call CalculateIrrigationNeeded with the given irrigation parameters. Then call - ! ApplyIrrigation. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(TestIrrigation), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'calculateAndApplyIrrigation' - !----------------------------------------------------------------------- - - call this%irrigation%CalcIrrigationNeeded(& - bounds=bounds, & - num_exposedvegp = this%numf, & - filter_exposedvegp = this%filter, & - time_prev = this%time_prev, & - elai = this%elai, & - t_soisno = this%t_soisno, & - eff_porosity = this%eff_porosity, & - h2osoi_liq = this%h2osoi_liq, & - volr = this%volr, & - rof_prognostic = .true.) - - call this%irrigation%ApplyIrrigation(bounds) - - end subroutine calculateAndApplyIrrigation - - ! ======================================================================== - ! Begin actual tests - ! ======================================================================== - - ! ------------------------------------------------------------------------ - ! Tests on a single patch - ! ------------------------------------------------------------------------ - - @Test - subroutine irrigation_flux_is_correct(this) - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - expected = sum(deficits(bounds%begp,1:nlevsoi)) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - - end subroutine irrigation_flux_is_correct - - @Test - subroutine no_irrigation_for_wet_soil(this) - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - this%h2osoi_liq(:,:) = 1.e15_r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - end subroutine no_irrigation_for_wet_soil - - @Test - subroutine surplus_offsets_deficit(this) - ! A surplus in one layer offsets a deficit in another - class(TestIrrigation), intent(inout) :: this - real(r8), parameter :: surplus = 1._r8 - real(r8) :: h2osoi_target_layer1 - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - h2osoi_target_layer1 = this%irrigation%RelsatToH2osoi( & - relsat = this%relsat_target(bounds%begc,1), & - eff_porosity = this%eff_porosity(bounds%begc,1), & - dz = col%dz(bounds%begc,1)) - this%h2osoi_liq(bounds%begc,1) = h2osoi_target_layer1 + surplus - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - expected = (sum(deficits(bounds%begp,2:nlevsoi)) - surplus) / this%irrigation_params%irrig_length - ! This first assertion makes sure the test has been set up reasonably - to give a net deficit - @assertLessThan(0._r8, expected) - ! Here is the main assertion: - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - end subroutine surplus_offsets_deficit - - @Test - subroutine no_irrigation_for_unirrigated_pfts(this) - use PatchType, only : patch - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation(maxpft=2) - patch%itype(bounds%begp) = 2 - pftcon%irrigated(1:2) = [1.0, 0.0] - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine no_irrigation_for_unirrigated_pfts - - @Test - subroutine no_irrigation_for_lai0(this) - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - this%elai(bounds%begp) = 0._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine no_irrigation_for_lai0 - - @Test - subroutine no_irrigation_for_soil_moisture_above_threshold(this) - class(TestIrrigation), intent(inout) :: this - real(r8) :: h2osoi_target - integer :: j - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - ! Set h2osoi_liq to just a tiny bit below the target in each layer - with the - ! assumption that this will make it fall above the threshold for triggering irrigation - do j = 1, nlevsoi - h2osoi_target = this%irrigation%RelsatToH2osoi( & - relsat = this%relsat_target(bounds%begc,j), & - eff_porosity = this%eff_porosity(bounds%begc,j), & - dz = col%dz(bounds%begc,j)) - this%h2osoi_liq(bounds%begc,j) = h2osoi_target * 0.99_r8 - end do - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - end subroutine no_irrigation_for_soil_moisture_above_threshold - - @Test - subroutine no_irrigation_at_wrong_time(this) - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - ! Set previous time to be one time step before the time when we would start irrigating - this%time_prev = this%time_prev - dtime - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine no_irrigation_at_wrong_time - - @Test - subroutine unlimited_irrigation_for_non_limiting_volr(this) - use GridcellType, only : grc - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8), parameter :: irrig_river_volume_threshold = 0.1_r8 - real(r8) :: total_deficit ! kg m-2 (i.e., mm) - real(r8) :: volr_threshold ! m3 - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation(test_limit_irrigation=.true., & - irrig_river_volume_threshold=irrig_river_volume_threshold) - - call this%computeDeficits(deficits) - total_deficit = sum(deficits(bounds%begp,1:nlevsoi)) - - ! Set volr to be just above the limiting amount - volr_threshold = (total_deficit * grc%area(begg) * mm_times_km2_to_m3) / & - (1._r8 - irrig_river_volume_threshold) - this%volr(begg) = volr_threshold + 10._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - expected = total_deficit / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - end subroutine unlimited_irrigation_for_non_limiting_volr - - @Test - subroutine limited_irrigation_for_limiting_volr(this) - use GridcellType, only : grc - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8), parameter :: irrig_river_volume_threshold = 0.1_r8 - real(r8) :: total_deficit ! kg m-2 (i.e., mm) - real(r8) :: volr_threshold ! m3 - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation(test_limit_irrigation=.true., & - irrig_river_volume_threshold=irrig_river_volume_threshold) - - call this%computeDeficits(deficits) - total_deficit = sum(deficits(bounds%begp,1:nlevsoi)) - - ! Set volr to be somewhat below the limiting amount - volr_threshold = (total_deficit * grc%area(begg) * mm_times_km2_to_m3) / & - (1._r8 - irrig_river_volume_threshold) - this%volr(begg) = volr_threshold - 10._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - expected = ((this%volr(begg) * (1._r8 - irrig_river_volume_threshold)) & - / grc%area(begg) * m3_over_km2_to_mm) / & - this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - end subroutine limited_irrigation_for_limiting_volr - - @Test - subroutine irrigation_should_happen_for_big_longitude(this) - use GridcellType, only : grc - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - ! Use a big longitude and a time_prev that should lead to irrigation at that longitude - ! The main point of this is to test the modulo in the local_time calculation - grc%londeg(:) = 359.9_r8 - this%time_prev = this%irrigation_params%irrig_start_time + dtime - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertTrue(this%irrigation%qflx_irrig_patch(bounds%begp) > 0._r8) - - end subroutine irrigation_should_happen_for_big_longitude - - @Test - subroutine irrigation_continues_at_same_rate_for_multiple_time_steps(this) - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - - ! Call irrigation routines - ! First call the routines to get irrigation started. Then increment time, and also - ! adjust the soil water amount. Irrigation should continue at the original rate. - call this%calculateAndApplyIrrigation() - call this%computeDeficits(deficits) - expected = sum(deficits(bounds%begp,1:nlevsoi)) / this%irrigation_params%irrig_length - this%time_prev = this%time_prev + dtime - this%h2osoi_liq = 100._r8 - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - - end subroutine irrigation_continues_at_same_rate_for_multiple_time_steps - - @Test - subroutine irrigation_continues_for_correct_number_of_time_steps(this) - class(TestIrrigation), intent(inout) :: this - integer :: time - integer :: expected_num_time_steps - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - ! The following assumes that dtime divides evenly into to irrigation length; - ! if not, it will be off by one - expected_num_time_steps = this%irrigation_params%irrig_length / dtime - - ! Ensure that irrigation flux is still non-zero after the expected number of time - ! steps - do time = 1, expected_num_time_steps - call this%calculateAndApplyIrrigation() - this%time_prev = this%time_prev + dtime - end do - @assertTrue(this%irrigation%qflx_irrig_patch(bounds%begp) > 0._r8) - - ! Ensure that irrigation flux goes to 0 in the following time step - call this%calculateAndApplyIrrigation() - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine irrigation_continues_for_correct_number_of_time_steps - - @Test - subroutine irrigation_flux_is_correct_on_second_day(this) - ! Loops through to a point where irrigation gets to 0, then resets time to the irrig - ! start time and does another set of calls to the irrigation routines. Ensures that - ! we're back to the intended flux. - - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - integer :: time_prev_orig - integer :: time - integer :: expected_num_time_steps - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - time_prev_orig = this%time_prev - - ! Call irrigation routines for long enough that irrigation should go to 0 - expected_num_time_steps = this%irrigation_params%irrig_length / dtime - do time = 1, expected_num_time_steps + 1 - call this%calculateAndApplyIrrigation() - this%time_prev = this%time_prev + dtime - end do - ! The following assertion is mainly here to make sure the test is working as intended - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - ! Now reset time, change soil moisture, and make sure that irrigation happens as expected - this%time_prev = time_prev_orig - this%h2osoi_liq(:,:) = 100._r8 - call this%calculateAndApplyIrrigation() - call this%computeDeficits(deficits) - expected = sum(deficits(bounds%begp,1:nlevsoi)) / this%irrigation_params%irrig_length - ! Make sure that the test has been set up reasonably - to give a net deficit - @assertLessThan(0._r8, expected) - ! Here's the main assertion: - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - - end subroutine irrigation_flux_is_correct_on_second_day - - @Test - subroutine irrigation_excludes_deep_layers(this) - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - integer :: nlevirrig - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - nlevirrig = nlevsoi - 1 - call this%setupIrrigation(nlevirrig=nlevirrig) - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - ! Now on to the real assertion - expected = sum(deficits(bounds%begp,1:nlevirrig)) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - end subroutine irrigation_excludes_deep_layers - - @Test - subroutine irrigation_excludes_bedrock_layers(this) - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - ! Make the last layer a bedrock layer: - col%nbedrock(bounds%begc) = nlevsoi - 1 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - expected = sum(deficits(bounds%begp,1:(nlevsoi-1))) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - end subroutine irrigation_excludes_bedrock_layers - - @Test - subroutine no_irrigation_for_frozen_soil(this) - class(TestIrrigation), intent(inout) :: this - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - this%t_soisno(bounds%begc, :) = 272._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine no_irrigation_for_frozen_soil - - @Test - subroutine no_irrigation_below_frozen_soil_layer(this) - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup - call this%setupSinglePatch() - call this%setupIrrigation() - this%t_soisno(bounds%begc, 2) = 272._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - ! Only include deficit from top layer, since 2nd layer is frozen - expected = deficits(bounds%begp, 1) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp)) - - end subroutine no_irrigation_below_frozen_soil_layer - - ! ------------------------------------------------------------------------ - ! Tests on multiple patches - ! ------------------------------------------------------------------------ - - @Test - subroutine irrigation_flux_is_correct_for_multiple_cols(this) - use unittestFilterBuilderMod, only : filter_from_range - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected1, expected2 - real(r8), parameter :: wt1 = 0.75_r8 - real(r8), parameter :: wt2 = 0.25_r8 - - ! Setup grid - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=wt1) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1._r8) - call unittest_add_column(my_li=li, ctype=2, wtlunit=wt2) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1._r8) - call unittest_subgrid_setup_end() - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%numf, filter=this%filter) - - ! Other setup - call this%setupIrrigation() - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - expected1 = sum(deficits(bounds%begp,1:nlevsoi)) / this%irrigation_params%irrig_length - @assertEqual(expected1, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - expected2 = sum(deficits(bounds%endp,1:nlevsoi)) / this%irrigation_params%irrig_length - @assertEqual(expected2, this%irrigation%qflx_irrig_patch(bounds%endp), tolerance=tol) - ! Make sure this test had some power, by ensuring that the two points differ: - @assertTrue(expected1 /= expected2) - - end subroutine irrigation_flux_is_correct_for_multiple_cols - - @Test - subroutine multiple_patches_per_column(this) - ! If we have multiple patches on a column, some with irrigation and some without, - ! make sure (a) irrigation still happens, and (b) the column-level average irrigation - ! flux is computed correctly - class(TestIrrigation), intent(inout) :: this - real(r8), parameter :: wt_unirrig_1 = 0.25_r8 - real(r8), parameter :: wt_irrig = 0.5_r8 - real(r8), parameter :: wt_unirrig_2 = 0.25_r8 - real(r8), allocatable :: deficits(:,:) - real(r8) :: total_deficit - real(r8) :: col_total_deficit - real(r8) :: expected_col_flux - - ! Setup grid - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1._r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1._r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=wt_unirrig_1) - call unittest_add_patch(my_ci=ci, ptype=2, wtcol=wt_irrig) - call unittest_add_patch(my_ci=ci, ptype=3, wtcol=wt_unirrig_2) - call unittest_subgrid_setup_end() - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%numf, filter=this%filter) - - ! Other setup - call this%setupIrrigation(maxpft=3) - pftcon%irrigated(1:3) = [0.0, 1.0, 0.0] - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - ! Note that only the second patch contributes to the average, because it is the only - ! irrigated patch - total_deficit = sum(deficits(bounds%begp+1, 1:nlevsoi)) - col_total_deficit = total_deficit * wt_irrig - expected_col_flux = col_total_deficit / this%irrigation_params%irrig_length - @assertEqual(expected_col_flux, this%irrigation%qflx_irrig_col(bounds%begc), tolerance=tol) - end subroutine multiple_patches_per_column - - @Test - subroutine irrigation_only_happens_within_filter(this) - class(TestIrrigation), intent(inout) :: this - - ! Setup grid: 3 columns, each with one patch - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_subgrid_setup_end() - this%numf = 1 - allocate(this%filter(1)) - this%filter = [bounds%begp + 1] - - ! Other setup - call this%setupIrrigation() - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - ! Irrigation happens within filter - @assertTrue(this%irrigation%qflx_irrig_patch(bounds%begp + 1) > 0._r8) - ! Irrigation does NOT happen outside filter - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%endp)) - - end subroutine irrigation_only_happens_within_filter - - @Test - subroutine test_multiple_patches_with_different_frozen_soil(this) - ! The point of this test is to exercise the somewhat complex logic for determining - ! frozen soil across multiple patches, due to the nesting of the p loop inside the - ! nlevsoi loop (rather than the other way around). - - use unittestFilterBuilderMod, only : filter_from_range - class(TestIrrigation), intent(inout) :: this - real(r8), allocatable :: deficits(:,:) - real(r8) :: expected - - ! Setup grid: 3 columns, each with one patch - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_subgrid_setup_end() - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%numf, filter=this%filter) - - ! Other setup - call this%setupIrrigation() - ! first column has frozen soil - this%t_soisno(bounds%begc, :) = 272._r8 - ! second column has layer 2 frozen - this%t_soisno(bounds%begc+1, 2) = 272._r8 - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - call this%computeDeficits(deficits) - ! First patch should have no irrigation, because soil is all frozen - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp)) - ! Second patch should have irrigation just based on top layer, because 2nd layer is frozen - expected = deficits(bounds%begp+1, 1) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%begp+1), tolerance=tol) - ! Third patch should have irrigation from all layers - expected = sum(deficits(bounds%endp,1:nlevsoi)) / this%irrigation_params%irrig_length - @assertEqual(expected, this%irrigation%qflx_irrig_patch(bounds%endp), tolerance=tol) - - end subroutine test_multiple_patches_with_different_frozen_soil - - @Test - subroutine volr_limiting_with_multiple_columns(this) - ! Make sure that volr limiting is applied correctly when there are multiple columns - ! on the grid cell - including one that is unirrigated. - use unittestFilterBuilderMod, only : filter_from_range - use GridcellType, only : grc - class(TestIrrigation), intent(inout) :: this - real(r8), parameter :: wt1 = 0.1_r8 - real(r8), parameter :: wt2 = 0.4_r8 - real(r8), parameter :: wt3 = 0.5_r8 ! unirrigated - real(r8), allocatable :: deficits(:,:) - real(r8) :: total_deficit1, total_deficit2 ! kg m-2 (i.e., mm) - real(r8) :: gridcell_total_deficit ! kg m-2 (i.e., mm) - real(r8) :: gridcell_total_deficit_as_volr ! m3 - real(r8) :: expected1, expected2 - - ! Fraction of total gridcell deficit that can be accommodated by volr - real(r8), parameter :: volr_fraction = 0.75_r8 - - ! Setup grid - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=wt1) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1._r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=wt2) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1._r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=wt3) - call unittest_add_patch(my_ci=ci, ptype=2, wtcol=1._r8) - call unittest_subgrid_setup_end() - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%numf, filter=this%filter) - - ! Other setup - ! Keep irrig_river_volume_threshold set to 0 to simplify the calculations here - call this%setupIrrigation(maxpft=2, test_limit_irrigation=.true., & - irrig_river_volume_threshold=0._r8) - ! The first 2 patches are irrigated, the 3rd is unirrigated - pftcon%irrigated(1:2) = [1.0, 0.0] - - call this%computeDeficits(deficits) - total_deficit1 = sum(deficits(bounds%begp, 1:nlevsoi)) - total_deficit2 = sum(deficits(bounds%begp+1, 1:nlevsoi)) - gridcell_total_deficit = total_deficit1 * wt1 + total_deficit2 * wt2 - gridcell_total_deficit_as_volr = gridcell_total_deficit * grc%area(begg) * mm_times_km2_to_m3 - this%volr(begg) = gridcell_total_deficit_as_volr * volr_fraction - - ! Call irrigation routines - call this%calculateAndApplyIrrigation() - - ! Check result - expected1 = total_deficit1*volr_fraction / this%irrigation_params%irrig_length - @assertEqual(expected1, this%irrigation%qflx_irrig_patch(bounds%begp), tolerance=tol) - expected2 = total_deficit2*volr_fraction / this%irrigation_params%irrig_length - @assertEqual(expected2, this%irrigation%qflx_irrig_patch(bounds%begp+1), tolerance=tol) - ! Check of unirrigated patch isn't central to this test, but we might as well check - ! it while we're at it: - @assertEqual(0._r8, this%irrigation%qflx_irrig_patch(bounds%begp+2)) - end subroutine volr_limiting_with_multiple_columns - -end module test_irrigation diff --git a/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt b/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt deleted file mode 100644 index cfd1e3a4bb..0000000000 --- a/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set (pfunit_sources - test_SnowHydrology_initSnowLayers.pf - test_SnowHydrology_newSnowBulkDensity.pf - test_SnowHydrology_SnowCappingExcess.pf) - -create_pFUnit_test(SnowHydrology test_SnowHydrology_exe - "${pfunit_sources}" "") - -target_link_libraries(test_SnowHydrology_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/biogeophys/test/SnowHydrology_test/README b/src/biogeophys/test/SnowHydrology_test/README deleted file mode 100644 index e43325dda6..0000000000 --- a/src/biogeophys/test/SnowHydrology_test/README +++ /dev/null @@ -1,4 +0,0 @@ -The unit tests of InitSnowLayers were put here largely for the sake of working -out some bugs in the initial implementation. Since this code is only used during -cold start (and thus is not critical), these unit tests can be removed if they -become a maintenance problem. diff --git a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf b/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf deleted file mode 100644 index 7c67a69c9a..0000000000 --- a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_SnowCappingExcess.pf +++ /dev/null @@ -1,230 +0,0 @@ -module test_SnowHydrology_SnowCappingExcess - - ! Tests of SnowHydrologyMod: SnowCappingExcess - - use pfunit_mod - use SnowHydrologyMod - use TopoMod, only : topo_type - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestFilterBuilderMod - use unittestTimeManagerMod - use unittestArrayMod, only : col_array - use clm_varcon, only : h2osno_max - use clm_varpar, only : nlevsno - use landunit_varcon, only : istsoil, istice_mec - - implicit none - - @TestCase - type, extends(TestCase) :: TestSCE - contains - procedure :: setUp - procedure :: tearDown - end type TestSCE - - real(r8), parameter :: tol = 1.e-13_r8 - - ! Make sure the h2osno_max value is substantially larger than the reset_snow_h2osno - ! value, so that tests make sense. - real(r8), parameter :: my_h2osno_max = reset_snow_h2osno + 1000._r8 - -contains - - subroutine setUp(this) - class(TestSCE), intent(inout) :: this - h2osno_max = my_h2osno_max - call SnowHydrologySetControlForTesting( & - set_reset_snow = .false., & - set_reset_snow_glc = .false., & - set_reset_snow_glc_ela = 1.e9_r8) - call unittest_timemgr_setup() - end subroutine setUp - - subroutine tearDown(this) - class(TestSCE), intent(inout) :: this - call unittest_subgrid_teardown() - call unittest_timemgr_teardown() - end subroutine tearDown - - @Test - subroutine SnowCappingExcess_OneExceeds(this) - ! Test with one column that exceeds the max, two that don't - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call setup_landunit_ncols(ltype=istsoil, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [h2osno_max - 1._r8, h2osno_max + my_excess, h2osno_max - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(0._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, my_excess, 0._r8], h2osno_excess, tolerance=tol) - @assertTrue(apply_runoff(2)) - end subroutine SnowCappingExcess_OneExceeds - - @Test - subroutine SnowCappingExcess_ResetNonGlacier(this) - ! With reset_snow = .true., should reset non-glacier points - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow = .true.) - call setup_landunit_ncols(ltype=istsoil, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(0._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, my_excess, 0._r8], h2osno_excess, tolerance=tol) - @assertFalse(apply_runoff(2)) - end subroutine SnowCappingExcess_ResetNonGlacier - - @Test - subroutine SnowCappingExcess_DoNotResetGlacier(this) - ! With reset_snow = .true. but reset_snow_glc = .false., should not reset glacier - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow = .true., & - set_reset_snow_glc = .false., set_reset_snow_glc_ela = 1000._r8) - call setup_landunit_ncols(ltype=istice_mec, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(0._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, 0._r8, 0._r8], h2osno_excess, tolerance=tol) - end subroutine SnowCappingExcess_DoNotResetGlacier - - @Test - subroutine SnowCappingExcess_ResetLowGlacier(this) - ! With reset_snow_glc = .true., should reset low glacier points - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8), parameter :: ela = 1000._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow_glc = .true., & - set_reset_snow_glc_ela = ela) - call setup_landunit_ncols(ltype=istice_mec, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(ela - 1._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, my_excess, 0._r8], h2osno_excess, tolerance=tol) - @assertFalse(apply_runoff(2)) - end subroutine SnowCappingExcess_ResetLowGlacier - - @Test - subroutine SnowCappingExcess_DoNotResetHighGlacier(this) - ! With reset_snow_glc = .true., should not reset high glacier points - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8), parameter :: ela = 1000._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow_glc = .true., & - set_reset_snow_glc_ela = ela) - call setup_landunit_ncols(ltype=istice_mec, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(ela + 1._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, 0._r8, 0._r8], h2osno_excess, tolerance=tol) - end subroutine SnowCappingExcess_DoNotResetHighGlacier - - @Test - subroutine SnowCappingExcess_DoNotResetNonGlacier(this) - ! With reset_snow_glc = .true. but reset_snow = .false., should not reset non-glacier - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow = .false., & - set_reset_snow_glc = .true., set_reset_snow_glc_ela = 1000._r8) - call setup_landunit_ncols(ltype=istsoil, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(0._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, 0._r8, 0._r8], h2osno_excess, tolerance=tol) - end subroutine SnowCappingExcess_DoNotResetNonGlacier - - @Test - subroutine SnowCappingExcess_DoNotResetLater(this) - ! Make sure resetting doesn't happen after the given number of time steps - class(TestSCE), intent(inout) :: this - real(r8) :: h2osno(3) - real(r8), parameter :: my_excess = 1._r8 - real(r8) :: h2osno_excess(3) - logical :: apply_runoff(3) - integer :: num_snowc - integer :: nstep - integer, allocatable :: filter_snowc(:) - - call SnowHydrologySetControlForTesting(set_reset_snow = .true.) - call setup_landunit_ncols(ltype=istsoil, ctypes=[1,1,1], cweights=[0.5_r8, 0.25_r8, 0.25_r8]) - call filter_from_range(bounds%begc, bounds%endc, num_snowc, filter_snowc) - ! Column 2 exceeds the max, other columns don't - h2osno = [reset_snow_h2osno - 1._r8, reset_snow_h2osno + my_excess, reset_snow_h2osno - 1._r8] - nstep = nlevsno * reset_snow_timesteps_per_layer + 1 - call unittest_timemgr_set_nstep(nstep) - - call SnowCappingExcess(bounds, num_snowc, filter_snowc, & - h2osno=h2osno, topo=col_array(0._r8), & - h2osno_excess=h2osno_excess, apply_runoff=apply_runoff) - - @assertEqual([0._r8, 0._r8, 0._r8], h2osno_excess, tolerance=tol) - end subroutine SnowCappingExcess_DoNotResetLater - -end module test_SnowHydrology_SnowCappingExcess diff --git a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_initSnowLayers.pf b/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_initSnowLayers.pf deleted file mode 100644 index 2d6dcee480..0000000000 --- a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_initSnowLayers.pf +++ /dev/null @@ -1,73 +0,0 @@ -module test_SnowHydrology_initSnowLayers - - ! Tests of SnowHydrologyMod: initSnowLayers - - use pfunit_mod - use SnowHydrologyMod - use shr_kind_mod, only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use ColumnType, only : col - use clm_varpar, only : nlevsno - - implicit none - - @TestCase - type, extends(TestCase) :: TestSnowHydrology - contains - procedure :: setUp - procedure :: tearDown - end type TestSnowHydrology - -contains - - subroutine setUp(this) - class(TestSnowHydrology), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestSnowHydrology), intent(inout) :: this - call unittest_subgrid_teardown() - end subroutine tearDown - - @Test - subroutine test_initSnowLayers_depth0_snl(this) - class(TestSnowHydrology), intent(inout) :: this - real(r8), allocatable :: snow_depth(:) - - ! Setup - nlevsno = 5 - call setup_single_veg_patch(pft_type = 1) - allocate(snow_depth(bounds%begc:bounds%endc)) - snow_depth(:) = 0._r8 - col%zi(bounds%begc:bounds%endc,0) = 0._r8 ! Normally initialized elsewhere (initVerticalMod) - - ! Exercise - call InitSnowLayers(bounds, snow_depth) - - ! Verify - @assertEqual(0, col%snl(bounds%begc)) - - end subroutine test_initSnowLayers_depth0_snl - - @Test - subroutine test_initSnowLayers_depth1_snl(this) - class(TestSnowHydrology), intent(inout) :: this - real(r8), allocatable :: snow_depth(:) - - ! Setup - nlevsno = 5 - call setup_single_veg_patch(pft_type = 1) - allocate(snow_depth(bounds%begc:bounds%endc)) - snow_depth(:) = 1._r8 - col%zi(bounds%begc:bounds%endc,0) = 0._r8 ! Normally initialized elsewhere (initVerticalMod) - - ! Exercise - call InitSnowLayers(bounds, snow_depth) - - ! Verify - @assertEqual(-5, col%snl(bounds%begc)) - - end subroutine test_initSnowLayers_depth1_snl - -end module test_SnowHydrology_initSnowLayers diff --git a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf b/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf deleted file mode 100644 index db8c7ba980..0000000000 --- a/src/biogeophys/test/SnowHydrology_test/test_SnowHydrology_newSnowBulkDensity.pf +++ /dev/null @@ -1,260 +0,0 @@ -module test_SnowHydrology_newSnowBulkDensity - - ! Tests of SnowHydrologyMod: newSnowBulkDensity - - use pfunit_mod - use unittestSubgridMod - use SnowHydrologyMod - use atm2lndType , only : atm2lnd_type - use clm_varcon , only : tfrz - use shr_kind_mod, only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestSnowHydrology - integer :: numf - integer, allocatable :: filter(:) - real(r8), allocatable :: bifall(:) - type(atm2lnd_type) :: atm2lnd_inst - real(r8) :: NEG15C - real(r8) :: TWOC - real(r8) :: MINSNOWDENSITY - real(r8) :: MAXSNOWDENSITY - real(r8) :: MAXWINDEDSNOWDENSITY - contains - procedure :: setUp - procedure :: tearDown - end type TestSnowHydrology - - - real(r8), parameter :: tol = 1.e-13 ! tolerance for error checks - -contains - - subroutine setUp(this) - use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use unittestFilterBuilderMod, only : filter_from_range - class(TestSnowHydrology), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call filter_from_range(start=bounds%begc, end=bounds%endc, numf=this%numf, filter=this%filter) - @assertEqual( this%numf, 1 ) - call this%atm2lnd_inst%InitForTesting( bounds ) - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = 0.0_r8 - allocate( this%bifall(bounds%begc:bounds%endc) ) - this%NEG15C = tfrz - 15._r8 - this%TWOC = tfrz + 2._r8 - ! These constants agree with the hard-coded values in newSnowBulkDensity - this%MINSNOWDENSITY = 50.0_r8 - this%MAXSNOWDENSITY = 170.0_r8 - this%MAXWINDEDSNOWDENSITY = 270.0_r8 - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsTruncatedAnderson1976 ) - end subroutine setUp - - subroutine tearDown(this) - class(TestSnowHydrology), intent(inout) :: this - - call unittest_subgrid_teardown() - call this%atm2lnd_inst%Clean( ) - deallocate( this%filter ) - this%numf = -1 - deallocate( this%bifall ) - end subroutine tearDown - - @Test - subroutine newSnowBulkDensity_neg15_TruncatedMethod(this) - ! Test the input at negative 15 degrees C - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: minsnowdensity - - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsTruncatedAnderson1976 ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%NEG15C - epsilon(this%NEG15C) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - write(*,*) 'forc_t = ', this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) - write(*,*) 'min, max = ', this%MINSNOWDENSITY, this%MAXSNOWDENSITY - write(*,*) 'bifall = ', this%bifall(bounds%begc) - - @assertLessThanOrEqual( this%MINSNOWDENSITY, this%bifall(bounds%begc), message="at -15C" ) - minsnowdensity = this%bifall(bounds%begc) - - ! Test that below neg15 stays at the same value - do while( this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) > (tfrz - 100.0_r8) ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) - 0.1_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertEqual(this%bifall(bounds%begc), minsnowdensity, message="below -15C" ) - end do - - end subroutine newSnowBulkDensity_neg15_TruncatedMethod - - @Test - subroutine newSnowBulkDensity_neg15_SlaterDensity(this) - ! Test the input at negative 15 degrees C - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: minsnowdensity - - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsSlater2017 ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%NEG15C - epsilon(this%NEG15C) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - - @assertLessThanOrEqual( this%MINSNOWDENSITY, this%bifall(bounds%begc), message="at -15C SlaterDensity" ) - minsnowdensity = this%bifall(bounds%begc) - - ! Test that from -15 to -100, stays within bounds - do while( this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) > (tfrz - 100.0_r8) ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) - 0.1_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertLessThan( minsnowdensity, this%bifall(bounds%begc), message="below -15C Slater Density > min" ) - @assertGreaterThan( this%MAXSNOWDENSITY, this%bifall(bounds%begc), message="below -15C Slater Density < max" ) - end do - - end subroutine newSnowBulkDensity_neg15_SlaterDensity - - @Test - subroutine newSnowBulkDensity_lowT_SlaterDensity(this) - ! Test the input for very low temperatures: density should be no lower than at higher - ! temperatures - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: density_at_neg_57_c(1) - - ! Setup - - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsSlater2017 ) - - ! Get density at -57 C. This is close to the highest density for the cold-temperature - ! regime. - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = tfrz - 57._r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, density_at_neg_57_c) - - ! Exercise: Get density at very cold temperature: just above absolute zero - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = 0.1_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - - ! Make sure that (1) density at -57 C is greater than minsnowdensity, and (2) density - ! at really cold T is greater than or equal to than density at -57 C (which is close - ! to the maximum snow density for the cold-temperature regime). - @assertLessThan(this%MINSNOWDENSITY, density_at_neg_57_c(1), message="density at -57C > min") - @assertLessThanOrEqual(density_at_neg_57_c(1), this%bifall(bounds%begc), message="density at very cold > density at -57C") - - end subroutine newSnowBulkDensity_lowT_SlaterDensity - - - - @Test - subroutine checkWindDependentDensity(this) - ! Test the range of the wind denpendent density - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: base_density, last_density, diff - - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = (this%NEG15C + this%TWOC)*0.5 - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsTruncatedAnderson1976 ) - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = 0.0_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - base_density = this%bifall(bounds%begc) - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.true., & - set_new_snow_density=LoTmpDnsTruncatedAnderson1976 ) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertEqual( base_density, this%bifall(bounds%begc), tolerance=1.0e-12_r8, message="Expect no change with zero wind" ) - write(*,*) 'without wind-depend = ', base_density, ' with wind@0=', this%bifall(bounds%begc) - base_density = this%bifall(bounds%begc) - - last_density = base_density - ! Check that monotone increasing with wind - do while ( this%atm2lnd_inst%forc_wind_grc(bounds%begg) < 30.0 ) - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = this%atm2lnd_inst%forc_wind_grc(bounds%begg) + 0.1 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertLessThanOrEqual( base_density, this%bifall(bounds%begc), message="Density should increase with wind" ) - @assertLessThanOrEqual( last_density, this%bifall(bounds%begc), message="Density should increase with wind" ) - diff = this%bifall(bounds%begc)-base_density - @assertLessThanOrEqual( diff, this%MAXWINDEDSNOWDENSITY, message="density increase with wind < max" ) - @assertGreaterThanOrEqual(this%bifall(bounds%begc), this%MINSNOWDENSITY, message="density with wind > min" ) - last_density = this%bifall(bounds%begc) - end do - ! Check at certain values... - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = 5.0_R8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - diff = this%bifall(bounds%begc)-base_density - @assertEqual( 90.0_r8, diff, message="at 5m/sec should be around 90", tolerance=10.0_r8 ) - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = 10.0_R8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - diff = this%bifall(bounds%begc)-base_density - @assertEqual( 230.0_r8, diff, message="at 10m/sec should be around 230", tolerance=10.0_r8 ) - this%atm2lnd_inst%forc_wind_grc(bounds%begg) = 15.0_R8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - diff = this%bifall(bounds%begc)-base_density - @assertEqual( 258.0_r8, diff, message="at 10m/sec should be around 258", tolerance=8.0_r8 ) - - end subroutine checkWindDependentDensity - - @Test - subroutine newSnowBulkDensity_2C(this) - ! Test the input at 2 degrees C - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: maxsnowdensity - integer :: density_type - - do density_type = 1, 2 - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=density_type ) - write(*,*) 'snow density type = ', density_type - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%TWOC + epsilon(this%TWOC) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - - @assertGreaterThan( this%MAXSNOWDENSITY, this%bifall(bounds%begc), message="at 2C" ) - maxsnowdensity = this%bifall(bounds%begc) - - ! Test that stays the same above 2C - do while( this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) < (tfrz + 100.0_r8) ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) + 0.1_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertEqual(this%bifall(bounds%begc), maxsnowdensity, message="above 2C" ) - end do - end do - end subroutine newSnowBulkDensity_2C - - @Test - subroutine newSnowBulkDensity_monotoneincreasing(this) - ! Test that between -15C and 2C is monotone increasing - class(TestSnowHydrology), intent(inout) :: this - real(r8) :: minsnowdensity, maxsnowdensity, lastsnowdensity - integer :: density_type - - do density_type = 1, 2 - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=density_type ) - write(*,*) 'snow density type = ', density_type - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%TWOC + epsilon(this%TWOC) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - maxsnowdensity = this%bifall(bounds%begc) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%NEG15C - epsilon(this%NEG15C) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - minsnowdensity = this%bifall(bounds%begc) - - lastsnowdensity = minsnowdensity - ! Test that between -15 and 2 C is between range and monotone increasing - do while( this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) < this%TWOC ) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) = this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc) + 0.1_r8 - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertLessThanOrEqual( this%bifall(bounds%begc), maxsnowdensity, message="< max" ) - @assertGreaterThanOrEqual(this%bifall(bounds%begc), minsnowdensity, message="> min" ) - @assertGreaterThanOrEqual(this%bifall(bounds%begc), lastsnowdensity, message="> last" ) - lastsnowdensity = this%bifall(bounds%begc) - ! Check that both density types give same answers - if ( density_type == 1 ) then - call SnowHydrologySetControlForTesting( set_winddep_snowdensity=.false., & - set_new_snow_density=LoTmpDnsSlater2017 ) - call NewSnowBulkDensity(bounds, this%numf, this%filter, this%atm2lnd_inst, this%bifall) - @assertEqual( this%bifall(bounds%begc), lastsnowdensity, message="Density methods same for mid temps" ) - end if - end do - end do - - end subroutine newSnowBulkDensity_monotoneincreasing - - -end module test_SnowHydrology_newSnowBulkDensity diff --git a/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt b/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt deleted file mode 100644 index 67f2a4812e..0000000000 --- a/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set (pfunit_sources - test_total_water_and_heat.pf) - -# extra sources used for this test, which are not .pf files -# (currently none) -set (extra_sources - ) - -create_pFUnit_test(total_water_and_heat test_total_water_and_heat_exe - "${pfunit_sources}" "${extra_sources}") - -target_link_libraries(test_total_water_and_heat_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/biogeophys/test/TotalWaterAndHeat_test/test_total_water_and_heat.pf b/src/biogeophys/test/TotalWaterAndHeat_test/test_total_water_and_heat.pf deleted file mode 100644 index 05cb5eed57..0000000000 --- a/src/biogeophys/test/TotalWaterAndHeat_test/test_total_water_and_heat.pf +++ /dev/null @@ -1,187 +0,0 @@ -module test_total_water_and_heat - - ! Tests of TotalWaterAndHeatMod - - use pfunit_mod - use TotalWaterAndHeatMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use clm_varcon, only : tfrz, cpliq, hfus - - implicit none - - @TestCase - type, extends(TestCase) :: TestTWAH - contains - procedure :: setUp - procedure :: tearDown - end type TestTWAH - - real(r8), parameter :: tol = 1.e-13_r8 - real(r8), parameter :: irrelevant_temp = tfrz + 9999._r8 - -contains - - subroutine setUp(this) - class(TestTWAH), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestTWAH), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - ! ------------------------------------------------------------------------ - ! Tests of LiquidWaterHeat - ! ------------------------------------------------------------------------ - - @Test - subroutine LiquidWaterHeatBasic(this) - class(TestTWAH), intent(inout) :: this - real(r8), parameter :: h2o = 3._r8 - real(r8), parameter :: temp_above_base = 4._r8 - real(r8), parameter :: temp = heat_base_temp + temp_above_base - real(r8) :: heat - real(r8) :: expected_heat, expected_latent_heat, expected_total - - heat = LiquidWaterHeat(temp = temp, h2o = h2o) - expected_latent_heat = h2o * hfus - expected_heat = h2o * cpliq * temp_above_base - expected_total = expected_latent_heat + expected_heat - - @assertEqual(expected_total, heat, tolerance=tol) - end subroutine LiquidWaterHeatBasic - - ! ------------------------------------------------------------------------ - ! Tests of AdjustDeltaHeatForDeltaLiq - ! ------------------------------------------------------------------------ - - @Test - subroutine AdjustDeltaHeatNoDeltaLiq(this) - class(TestTWAH), intent(inout) :: this - real(r8) :: delta_heat(1) - real(r8), parameter :: delta_liq = 0._r8 - real(r8), parameter :: delta_heat_init = 17._r8 - - call setup_single_veg_patch(pft_type = 1) - - delta_heat(1) = delta_heat_init - - call AdjustDeltaHeatForDeltaLiq(bounds, [delta_liq], & - [irrelevant_temp], [irrelevant_temp], & - delta_heat) - - @assertEqual(delta_heat(1), delta_heat_init) - end subroutine AdjustDeltaHeatNoDeltaLiq - - @Test - subroutine AdjustDeltaHeatNegativeDeltaLiq(this) - class(TestTWAH), intent(inout) :: this - real(r8) :: delta_heat(1) - real(r8) :: heat_diff - real(r8) :: expected_total_heat - real(r8), parameter :: liquid_water_temp1 = tfrz + 3._r8 - real(r8), parameter :: delta_heat_init = 17._r8 - real(r8), parameter :: delta_liq = -2._r8 - - call setup_single_veg_patch(pft_type = 1) - - delta_heat(1) = delta_heat_init - - call AdjustDeltaHeatForDeltaLiq(bounds, [delta_liq], & - [liquid_water_temp1], [irrelevant_temp], & - delta_heat) - heat_diff = delta_heat(1) - delta_heat_init - - expected_total_heat = LiquidWaterHeat( & - temp = liquid_water_temp1, & - h2o = -delta_liq) - - @assertLessThan(0._r8, heat_diff) - @assertEqual(expected_total_heat, heat_diff, tolerance=tol) - - end subroutine AdjustDeltaHeatNegativeDeltaLiq - - @Test - subroutine AdjustDeltaHeatPositiveDeltaLiq(this) - class(TestTWAH), intent(inout) :: this - real(r8) :: delta_heat(1) - real(r8) :: heat_diff - real(r8) :: expected_total_heat - real(r8), parameter :: liquid_water_temp2 = tfrz + 3._r8 - real(r8), parameter :: delta_heat_init = 17._r8 - real(r8), parameter :: delta_liq = 2._r8 - - call setup_single_veg_patch(pft_type = 1) - - delta_heat(1) = delta_heat_init - - call AdjustDeltaHeatForDeltaLiq(bounds, [delta_liq], & - [irrelevant_temp], [liquid_water_temp2], & - delta_heat) - heat_diff = delta_heat(1) - delta_heat_init - - expected_total_heat = LiquidWaterHeat( & - temp = liquid_water_temp2, & - h2o = -delta_liq) - - @assertGreaterThan(0._r8, heat_diff) - @assertEqual(expected_total_heat, heat_diff, tolerance=tol) - - end subroutine AdjustDeltaHeatPositiveDeltaLiq - - @Test - subroutine AdjustDeltaHeatVeryColdTemperature(this) - class(TestTWAH), intent(inout) :: this - real(r8) :: delta_heat(1) - real(r8) :: heat_diff - real(r8) :: expected_total_heat - real(r8), parameter :: liquid_water_temp2 = DeltaLiqMinTemp - 1._r8 - real(r8), parameter :: delta_heat_init = 17._r8 - real(r8), parameter :: delta_liq = 2._r8 - - call setup_single_veg_patch(pft_type = 1) - - delta_heat(1) = delta_heat_init - - call AdjustDeltaHeatForDeltaLiq(bounds, [delta_liq], & - [irrelevant_temp], [liquid_water_temp2], & - delta_heat) - heat_diff = delta_heat(1) - delta_heat_init - - expected_total_heat = LiquidWaterHeat( & - temp = DeltaLiqMinTemp, & - h2o = -delta_liq) - - @assertEqual(expected_total_heat, heat_diff, tolerance=tol) - end subroutine AdjustDeltaHeatVeryColdTemperature - - @Test - subroutine AdjustDeltaHeatVeryHotTemperature(this) - class(TestTWAH), intent(inout) :: this - real(r8) :: delta_heat(1) - real(r8) :: heat_diff - real(r8) :: expected_total_heat - real(r8), parameter :: liquid_water_temp2 = DeltaLiqMaxTemp + 1._r8 - real(r8), parameter :: delta_heat_init = 17._r8 - real(r8), parameter :: delta_liq = 2._r8 - - call setup_single_veg_patch(pft_type = 1) - - delta_heat(1) = delta_heat_init - - call AdjustDeltaHeatForDeltaLiq(bounds, [delta_liq], & - [irrelevant_temp], [liquid_water_temp2], & - delta_heat) - heat_diff = delta_heat(1) - delta_heat_init - - expected_total_heat = LiquidWaterHeat( & - temp = DeltaLiqMaxTemp, & - h2o = -delta_liq) - - @assertEqual(expected_total_heat, heat_diff, tolerance=tol) - end subroutine AdjustDeltaHeatVeryHotTemperature - -end module test_total_water_and_heat diff --git a/src/cpl/clm_cpl_indices.F90 b/src/cpl/clm_cpl_indices.F90 deleted file mode 100644 index 525b709cc6..0000000000 --- a/src/cpl/clm_cpl_indices.F90 +++ /dev/null @@ -1,330 +0,0 @@ -module clm_cpl_indices - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing the indices for the fields passed between CLM and - ! the driver. Includes the River Transport Model fields (RTM) and the - ! fields needed by the land-ice component (sno). - ! - ! !USES: - - use shr_sys_mod, only : shr_sys_abort - implicit none - - SAVE - private ! By default make data private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_cpl_indices_set ! Set the coupler indices - ! - ! !PUBLIC DATA MEMBERS: - ! - integer , public :: glc_nec ! number of elevation classes for glacier_mec landunits - ! (from coupler) - must equal maxpatch_glcmec from namelist - - ! lnd -> drv (required) - - integer, public ::index_l2x_Flrl_rofsur ! lnd->rtm input liquid surface fluxes - integer, public ::index_l2x_Flrl_rofgwl ! lnd->rtm input liquid gwl fluxes - integer, public ::index_l2x_Flrl_rofsub ! lnd->rtm input liquid subsurface fluxes - integer, public ::index_l2x_Flrl_rofi ! lnd->rtm input frozen fluxes - integer, public ::index_l2x_Flrl_irrig ! irrigation withdrawal - - integer, public ::index_l2x_Sl_t ! temperature - integer, public ::index_l2x_Sl_tref ! 2m reference temperature - integer, public ::index_l2x_Sl_qref ! 2m reference specific humidity - integer, public ::index_l2x_Sl_avsdr ! albedo: direct , visible - integer, public ::index_l2x_Sl_anidr ! albedo: direct , near-ir - integer, public ::index_l2x_Sl_avsdf ! albedo: diffuse, visible - integer, public ::index_l2x_Sl_anidf ! albedo: diffuse, near-ir - integer, public ::index_l2x_Sl_snowh ! snow height - integer, public ::index_l2x_Sl_u10 ! 10m wind - integer, public ::index_l2x_Sl_ddvel ! dry deposition velocities (optional) - integer, public ::index_l2x_Sl_fv ! friction velocity - integer, public ::index_l2x_Sl_ram1 ! aerodynamical resistance - integer, public ::index_l2x_Sl_soilw ! volumetric soil water - integer, public ::index_l2x_Fall_taux ! wind stress, zonal - integer, public ::index_l2x_Fall_tauy ! wind stress, meridional - integer, public ::index_l2x_Fall_lat ! latent heat flux - integer, public ::index_l2x_Fall_sen ! sensible heat flux - integer, public ::index_l2x_Fall_lwup ! upward longwave heat flux - integer, public ::index_l2x_Fall_evap ! evaporation water flux - integer, public ::index_l2x_Fall_swnet ! heat flux shortwave net - integer, public ::index_l2x_Fall_fco2_lnd ! co2 flux **For testing set to 0 - integer, public ::index_l2x_Fall_flxdst1 ! dust flux size bin 1 - integer, public ::index_l2x_Fall_flxdst2 ! dust flux size bin 2 - integer, public ::index_l2x_Fall_flxdst3 ! dust flux size bin 3 - integer, public ::index_l2x_Fall_flxdst4 ! dust flux size bin 4 - integer, public ::index_l2x_Fall_flxvoc ! MEGAN fluxes - integer, public ::index_l2x_Fall_flxfire ! Fire fluxes - integer, public ::index_l2x_Sl_ztopfire ! Top of fire emissions (m) - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_l2x_Sl_tsrf(:) ! glc MEC temperature - integer, allocatable, public ::index_l2x_Sl_topo(:) ! glc MEC topo height - integer, allocatable, public ::index_l2x_Flgl_qice(:) ! glc MEC ice flux - - integer, public ::index_x2l_Sa_methane - integer, public ::index_l2x_Fall_methane - - integer, public :: nflds_l2x = 0 - - ! drv -> lnd (required) - - integer, public ::index_x2l_Sa_z ! bottom atm level height - integer, public ::index_x2l_Sa_topo ! atm surface height (m) - integer, public ::index_x2l_Sa_u ! bottom atm level zon wind - integer, public ::index_x2l_Sa_v ! bottom atm level mer wind - integer, public ::index_x2l_Sa_ptem ! bottom atm level pot temp - integer, public ::index_x2l_Sa_shum ! bottom atm level spec hum - integer, public ::index_x2l_Sa_pbot ! bottom atm level pressure - integer, public ::index_x2l_Sa_tbot ! bottom atm level temp - integer, public ::index_x2l_Faxa_lwdn ! downward lw heat flux - integer, public ::index_x2l_Faxa_rainc ! prec: liquid "convective" - integer, public ::index_x2l_Faxa_rainl ! prec: liquid "large scale" - integer, public ::index_x2l_Faxa_snowc ! prec: frozen "convective" - integer, public ::index_x2l_Faxa_snowl ! prec: frozen "large scale" - integer, public ::index_x2l_Faxa_swndr ! sw: nir direct downward - integer, public ::index_x2l_Faxa_swvdr ! sw: vis direct downward - integer, public ::index_x2l_Faxa_swndf ! sw: nir diffuse downward - integer, public ::index_x2l_Faxa_swvdf ! sw: vis diffuse downward - integer, public ::index_x2l_Sa_co2prog ! bottom atm level prognostic co2 - integer, public ::index_x2l_Sa_co2diag ! bottom atm level diagnostic co2 - integer, public ::index_x2l_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition - integer, public ::index_x2l_Faxa_ocphidry ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_ocphodry ! flux: Organic Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_ocphiwet ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_dstwet1 ! flux: Size 1 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet2 ! flux: Size 2 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet3 ! flux: Size 3 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet4 ! flux: Size 4 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstdry1 ! flux: Size 1 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition - - integer, public ::index_x2l_Faxa_nhx ! flux nhx from atm - integer, public ::index_x2l_Faxa_noy ! flux noy from atm - - integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof flood flux - integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr total volume - integer, public ::index_x2l_Flrr_volrmch ! rtm->lnd rof volr main channel volume - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_x2l_Sg_ice_covered(:) ! Fraction of glacier from glc model - integer, allocatable, public ::index_x2l_Sg_topo(:) ! Topo height from glc model - integer, allocatable, public ::index_x2l_Flgg_hflx(:) ! Heat flux from glc model - - integer, public ::index_x2l_Sg_icemask - integer, public ::index_x2l_Sg_icemask_coupled_fluxes - - integer, public :: nflds_x2l = 0 - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_cpl_indices_set( ) - ! - ! !DESCRIPTION: - ! Set the coupler indices needed by the land model coupler - ! interface. - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields, seq_flds_l2x_fields - use mct_mod , only: mct_aVect, mct_aVect_init, mct_avect_indexra - use mct_mod , only: mct_aVect_clean, mct_avect_nRattr - use seq_drydep_mod , only: drydep_fields_token, lnd_drydep - use shr_megan_mod , only: shr_megan_fields_token, shr_megan_mechcomps_n - use shr_fire_emis_mod,only: shr_fire_emis_fields_token, shr_fire_emis_ztop_token, shr_fire_emis_mechcomps_n - use clm_varctl , only: ndep_from_cpl - use glc_elevclass_mod, only: glc_get_num_elevation_classes, glc_elevclass_as_string - ! - ! !ARGUMENTS: - implicit none - ! - ! !REVISION HISTORY: - ! Author: Mariana Vertenstein - ! 01/2011, Erik Kluzek: Added protex headers - ! - ! !LOCAL VARIABLES: - type(mct_aVect) :: l2x ! temporary, land to coupler - type(mct_aVect) :: x2l ! temporary, coupler to land - integer :: num - character(len=:), allocatable :: nec_str ! string version of glc elev. class number - character(len=64) :: name - character(len=32) :: subname = 'clm_cpl_indices_set' ! subroutine name - !----------------------------------------------------------------------- - - ! Determine attribute vector indices - - ! create temporary attribute vectors - call mct_aVect_init(x2l, rList=seq_flds_x2l_fields, lsize=1) - nflds_x2l = mct_avect_nRattr(x2l) - - call mct_aVect_init(l2x, rList=seq_flds_l2x_fields, lsize=1) - nflds_l2x = mct_avect_nRattr(l2x) - - !------------------------------------------------------------- - ! clm -> drv - !------------------------------------------------------------- - - index_l2x_Flrl_rofsur = mct_avect_indexra(l2x,'Flrl_rofsur') - index_l2x_Flrl_rofgwl = mct_avect_indexra(l2x,'Flrl_rofgwl') - index_l2x_Flrl_rofsub = mct_avect_indexra(l2x,'Flrl_rofsub') - index_l2x_Flrl_rofi = mct_avect_indexra(l2x,'Flrl_rofi') - index_l2x_Flrl_irrig = mct_avect_indexra(l2x,'Flrl_irrig') - - index_l2x_Sl_t = mct_avect_indexra(l2x,'Sl_t') - index_l2x_Sl_snowh = mct_avect_indexra(l2x,'Sl_snowh') - index_l2x_Sl_avsdr = mct_avect_indexra(l2x,'Sl_avsdr') - index_l2x_Sl_anidr = mct_avect_indexra(l2x,'Sl_anidr') - index_l2x_Sl_avsdf = mct_avect_indexra(l2x,'Sl_avsdf') - index_l2x_Sl_anidf = mct_avect_indexra(l2x,'Sl_anidf') - index_l2x_Sl_tref = mct_avect_indexra(l2x,'Sl_tref') - index_l2x_Sl_qref = mct_avect_indexra(l2x,'Sl_qref') - index_l2x_Sl_u10 = mct_avect_indexra(l2x,'Sl_u10') - index_l2x_Sl_ram1 = mct_avect_indexra(l2x,'Sl_ram1') - index_l2x_Sl_fv = mct_avect_indexra(l2x,'Sl_fv') - index_l2x_Sl_soilw = mct_avect_indexra(l2x,'Sl_soilw',perrwith='quiet') - - if ( lnd_drydep )then - index_l2x_Sl_ddvel = mct_avect_indexra(l2x, trim(drydep_fields_token)) - else - index_l2x_Sl_ddvel = 0 - end if - - index_l2x_Fall_taux = mct_avect_indexra(l2x,'Fall_taux') - index_l2x_Fall_tauy = mct_avect_indexra(l2x,'Fall_tauy') - index_l2x_Fall_lat = mct_avect_indexra(l2x,'Fall_lat') - index_l2x_Fall_sen = mct_avect_indexra(l2x,'Fall_sen') - index_l2x_Fall_lwup = mct_avect_indexra(l2x,'Fall_lwup') - index_l2x_Fall_evap = mct_avect_indexra(l2x,'Fall_evap') - index_l2x_Fall_swnet = mct_avect_indexra(l2x,'Fall_swnet') - index_l2x_Fall_flxdst1 = mct_avect_indexra(l2x,'Fall_flxdst1') - index_l2x_Fall_flxdst2 = mct_avect_indexra(l2x,'Fall_flxdst2') - index_l2x_Fall_flxdst3 = mct_avect_indexra(l2x,'Fall_flxdst3') - index_l2x_Fall_flxdst4 = mct_avect_indexra(l2x,'Fall_flxdst4') - - index_l2x_Fall_fco2_lnd = mct_avect_indexra(l2x,'Fall_fco2_lnd',perrwith='quiet') - - index_l2x_Fall_methane = mct_avect_indexra(l2x,'Fall_methane',perrWith='quiet') - - ! MEGAN fluxes - if (shr_megan_mechcomps_n>0) then - index_l2x_Fall_flxvoc = mct_avect_indexra(l2x,trim(shr_megan_fields_token)) - else - index_l2x_Fall_flxvoc = 0 - endif - - ! Fire fluxes - if (shr_fire_emis_mechcomps_n>0) then - index_l2x_Fall_flxfire = mct_avect_indexra(l2x,trim(shr_fire_emis_fields_token)) - index_l2x_Sl_ztopfire = mct_avect_indexra(l2x,trim(shr_fire_emis_ztop_token)) - else - index_l2x_Fall_flxfire = 0 - index_l2x_Sl_ztopfire = 0 - endif - - !------------------------------------------------------------- - ! drv -> clm - !------------------------------------------------------------- - - index_x2l_Sa_z = mct_avect_indexra(x2l,'Sa_z') - index_x2l_Sa_topo = mct_avect_indexra(x2l,'Sa_topo') - index_x2l_Sa_u = mct_avect_indexra(x2l,'Sa_u') - index_x2l_Sa_v = mct_avect_indexra(x2l,'Sa_v') - index_x2l_Sa_ptem = mct_avect_indexra(x2l,'Sa_ptem') - index_x2l_Sa_pbot = mct_avect_indexra(x2l,'Sa_pbot') - index_x2l_Sa_tbot = mct_avect_indexra(x2l,'Sa_tbot') - index_x2l_Sa_shum = mct_avect_indexra(x2l,'Sa_shum') - index_x2l_Sa_co2prog = mct_avect_indexra(x2l,'Sa_co2prog',perrwith='quiet') - index_x2l_Sa_co2diag = mct_avect_indexra(x2l,'Sa_co2diag',perrwith='quiet') - - index_x2l_Sa_methane = mct_avect_indexra(x2l,'Sa_methane',perrWith='quiet') - - index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr') - index_x2l_Flrr_volrmch = mct_avect_indexra(x2l,'Flrr_volrmch') - - index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn') - index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc') - index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl') - index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc') - index_x2l_Faxa_snowl = mct_avect_indexra(x2l,'Faxa_snowl') - index_x2l_Faxa_swndr = mct_avect_indexra(x2l,'Faxa_swndr') - index_x2l_Faxa_swvdr = mct_avect_indexra(x2l,'Faxa_swvdr') - index_x2l_Faxa_swndf = mct_avect_indexra(x2l,'Faxa_swndf') - index_x2l_Faxa_swvdf = mct_avect_indexra(x2l,'Faxa_swvdf') - index_x2l_Faxa_bcphidry = mct_avect_indexra(x2l,'Faxa_bcphidry') - index_x2l_Faxa_bcphodry = mct_avect_indexra(x2l,'Faxa_bcphodry') - index_x2l_Faxa_bcphiwet = mct_avect_indexra(x2l,'Faxa_bcphiwet') - index_x2l_Faxa_ocphidry = mct_avect_indexra(x2l,'Faxa_ocphidry') - index_x2l_Faxa_ocphodry = mct_avect_indexra(x2l,'Faxa_ocphodry') - index_x2l_Faxa_ocphiwet = mct_avect_indexra(x2l,'Faxa_ocphiwet') - index_x2l_Faxa_dstdry1 = mct_avect_indexra(x2l,'Faxa_dstdry1') - index_x2l_Faxa_dstdry2 = mct_avect_indexra(x2l,'Faxa_dstdry2') - index_x2l_Faxa_dstdry3 = mct_avect_indexra(x2l,'Faxa_dstdry3') - index_x2l_Faxa_dstdry4 = mct_avect_indexra(x2l,'Faxa_dstdry4') - index_x2l_Faxa_dstwet1 = mct_avect_indexra(x2l,'Faxa_dstwet1') - index_x2l_Faxa_dstwet2 = mct_avect_indexra(x2l,'Faxa_dstwet2') - index_x2l_Faxa_dstwet3 = mct_avect_indexra(x2l,'Faxa_dstwet3') - index_x2l_Faxa_dstwet4 = mct_avect_indexra(x2l,'Faxa_dstwet4') - - index_x2l_Faxa_nhx = mct_avect_indexra(x2l,'Faxa_nhx', perrWith='quiet') - index_x2l_Faxa_noy = mct_avect_indexra(x2l,'Faxa_noy', perrWith='quiet') - - if (index_x2l_Faxa_nhx > 0 .and. index_x2l_Faxa_noy > 0) then - ndep_from_cpl = .true. - end if - - index_x2l_Flrr_flood = mct_avect_indexra(x2l,'Flrr_flood') - - !------------------------------------------------------------- - ! glc coupling - !------------------------------------------------------------- - - index_x2l_Sg_icemask = mct_avect_indexra(x2l,'Sg_icemask') - index_x2l_Sg_icemask_coupled_fluxes = mct_avect_indexra(x2l,'Sg_icemask_coupled_fluxes') - - glc_nec = glc_get_num_elevation_classes() - if (glc_nec < 1) then - call shr_sys_abort('ERROR: In CLM4.5 and later, glc_nec must be at least 1.') - end if - - ! Create coupling fields for all glc elevation classes (1:glc_nec) plus bare land - ! (index 0). - allocate(index_l2x_Sl_tsrf(0:glc_nec)) - allocate(index_l2x_Sl_topo(0:glc_nec)) - allocate(index_l2x_Flgl_qice(0:glc_nec)) - allocate(index_x2l_Sg_ice_covered(0:glc_nec)) - allocate(index_x2l_Sg_topo(0:glc_nec)) - allocate(index_x2l_Flgg_hflx(0:glc_nec)) - - do num = 0,glc_nec - nec_str = glc_elevclass_as_string(num) - - name = 'Sg_ice_covered' // nec_str - index_x2l_Sg_ice_covered(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Sg_topo' // nec_str - index_x2l_Sg_topo(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Flgg_hflx' // nec_str - index_x2l_Flgg_hflx(num) = mct_avect_indexra(x2l,trim(name)) - - name = 'Sl_tsrf' // nec_str - index_l2x_Sl_tsrf(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Sl_topo' // nec_str - index_l2x_Sl_topo(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Flgl_qice' // nec_str - index_l2x_Flgl_qice(num) = mct_avect_indexra(l2x,trim(name)) - end do - - call mct_aVect_clean(x2l) - call mct_aVect_clean(l2x) - - end subroutine clm_cpl_indices_set - -!======================================================================= - -end module clm_cpl_indices diff --git a/src/cpl/lnd_comp_mct.F90 b/src/cpl/lnd_comp_mct.F90 deleted file mode 100644 index 923d6f6c34..0000000000 --- a/src/cpl/lnd_comp_mct.F90 +++ /dev/null @@ -1,697 +0,0 @@ -module lnd_comp_mct - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Interface of the active land model component of CESM the CLM (Community Land Model) - ! with the main CESM driver. This is a thin interface taking CESM driver information - ! in MCT (Model Coupling Toolkit) format and converting it to use by CLM. - ! - ! !uses: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid - use decompmod , only : bounds_type, ldecomp - use lnd_import_export, only : lnd_import, lnd_export - ! - ! !public member functions: - implicit none - save - private ! by default make data private - ! - ! !public member functions: - public :: lnd_init_mct ! clm initialization - public :: lnd_run_mct ! clm run phase - public :: lnd_final_mct ! clm finalization/cleanup - ! - ! !private member functions: - private :: lnd_setgsmap_mct ! set the land model mct gs map - private :: lnd_domain_mct ! set the land model domain information - private :: lnd_handle_resume ! handle pause/resume signals from the coupler - !--------------------------------------------------------------------------- - -contains - - !==================================================================================== - - subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize land surface model and obtain relevant atmospheric model arrays - ! back from (i.e. albedos, surface temperature and snow cover over land). - ! - ! !USES: - use shr_kind_mod , only : shr_kind_cl - use abortutils , only : endrun - use clm_time_manager , only : get_nstep, get_step_size, set_timemgr_init, set_nextsw_cday - use clm_initializeMod, only : initialize1, initialize2, lnd2atm_inst, lnd2glc_inst - use clm_varctl , only : finidat,single_column, clm_varctl_set, iulog, noland - use clm_varctl , only : inst_index, inst_suffix, inst_name - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use controlMod , only : control_setNL - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use shr_file_mod , only : shr_file_getUnit, shr_file_setIO - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData - use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData, seq_infodata_PutData, & - seq_infodata_start_type_start, seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch - use seq_comm_mct , only : seq_comm_suffix, seq_comm_inst, seq_comm_name - use seq_flds_mod , only : seq_flds_x2l_fields, seq_flds_l2x_fields - use spmdMod , only : masterproc, spmd_init - use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch - use clm_cpl_indices , only : clm_cpl_indices_set - use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap_lsize - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock), intent(inout) :: EClock ! Input synchronization clock - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - type(mct_aVect), intent(inout) :: x2l_l, l2x_l ! land model import and export states - character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read - ! - ! !LOCAL VARIABLES: - integer :: LNDID ! Land identifyer - integer :: mpicom_lnd ! MPI communicator - type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map - type(mct_gGrid), pointer :: dom_l ! Land model domain - type(seq_infodata_type), pointer :: infodata ! CESM driver level info data - integer :: lsize ! size of attribute vector - integer :: g,i,j ! indices - integer :: dtime_sync ! coupling time-step from the input synchronization clock - integer :: dtime_clm ! clm time-step - logical :: exists ! true if file exists - logical :: atm_aero ! Flag if aerosol data sent from atm model - real(r8) :: scmlat ! single-column latitude - real(r8) :: scmlon ! single-column longitude - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - character(len=SHR_KIND_CL) :: caseid ! case identifier name - character(len=SHR_KIND_CL) :: ctitle ! case description title - character(len=SHR_KIND_CL) :: starttype ! start-type (startup, continue, branch, hybrid) - character(len=SHR_KIND_CL) :: calendar ! calendar type name - character(len=SHR_KIND_CL) :: hostname ! hostname of machine running on - character(len=SHR_KIND_CL) :: version ! Model version - character(len=SHR_KIND_CL) :: username ! user running the model - integer :: nsrest ! clm restart type - integer :: ref_ymd ! reference date (YYYYMMDD) - integer :: ref_tod ! reference time of day (sec) - integer :: start_ymd ! start date (YYYYMMDD) - integer :: start_tod ! start time of day (sec) - integer :: stop_ymd ! stop date (YYYYMMDD) - integer :: stop_tod ! stop time of day (sec) - logical :: brnch_retain_casename ! flag if should retain the case name on a branch start type - integer :: lbnum ! input to memory diagnostic - integer :: shrlogunit,shrloglev ! old values for log unit and log level - type(bounds_type) :: bounds ! bounds - character(len=32), parameter :: sub = 'lnd_init_mct' - character(len=*), parameter :: format = "('("//trim(sub)//") :',A)" - !----------------------------------------------------------------------- - - ! Set cdata data - - call seq_cdata_setptrs(cdata_l, ID=LNDID, mpicom=mpicom_lnd, & - gsMap=GSMap_lnd, dom=dom_l, infodata=infodata) - - ! Determine attriute vector indices - - call clm_cpl_indices_set() - - ! Initialize clm MPI communicator - - call spmd_init( mpicom_lnd, LNDID ) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_init_mct:start::',lbnum) - endif -#endif - - inst_name = seq_comm_name(LNDID) - inst_index = seq_comm_inst(LNDID) - inst_suffix = seq_comm_suffix(LNDID) - - ! Initialize io log unit - - call shr_file_getLogUnit (shrlogunit) - if (masterproc) then - inquire(file='lnd_modelio.nml'//trim(inst_suffix),exist=exists) - if (exists) then - iulog = shr_file_getUnit() - call shr_file_setIO('lnd_modelio.nml'//trim(inst_suffix),iulog) - end if - write(iulog,format) "CLM land model initialization" - else - iulog = shrlogunit - end if - - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Use infodata to set orbital values - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Consistency check on namelist filename - - call control_setNL("lnd_in"//trim(inst_suffix)) - - ! Initialize clm - ! initialize1 reads namelist, grid and surface data (need this to initialize gsmap) - ! initialize2 performs rest of initialization - - call seq_timemgr_EClockGetData(EClock, & - start_ymd=start_ymd, & - start_tod=start_tod, ref_ymd=ref_ymd, & - ref_tod=ref_tod, stop_ymd=stop_ymd, & - stop_tod=stop_tod, & - calendar=calendar ) - call seq_infodata_GetData(infodata, case_name=caseid, & - case_desc=ctitle, single_column=single_column, & - scmlat=scmlat, scmlon=scmlon, & - brnch_retain_casename=brnch_retain_casename, & - start_type=starttype, model_version=version, & - hostname=hostname, username=username ) - call set_timemgr_init( calendar_in=calendar, start_ymd_in=start_ymd, start_tod_in=start_tod, & - ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, stop_ymd_in=stop_ymd, & - stop_tod_in=stop_tod) - if ( trim(starttype) == trim(seq_infodata_start_type_start)) then - nsrest = nsrStartup - else if (trim(starttype) == trim(seq_infodata_start_type_cont) ) then - nsrest = nsrContinue - else if (trim(starttype) == trim(seq_infodata_start_type_brnch)) then - nsrest = nsrBranch - else - call endrun( sub//' ERROR: unknown starttype' ) - end if - - call clm_varctl_set(caseid_in=caseid, ctitle_in=ctitle, & - brnch_retain_casename_in=brnch_retain_casename, & - single_column_in=single_column, scmlat_in=scmlat, & - scmlon_in=scmlon, nsrest_in=nsrest, version_in=version, & - hostname_in=hostname, username_in=username) - - ! Read namelist, grid and surface data - - call initialize1( ) - - ! If no land then exit out of initialization - - if ( noland ) then - call seq_infodata_PutData( infodata, lnd_present =.false.) - call seq_infodata_PutData( infodata, lnd_prognostic=.false.) - return - end if - - ! Determine if aerosol and dust deposition come from atmosphere component - - call seq_infodata_GetData(infodata, atm_aero=atm_aero ) - if ( .not. atm_aero )then - call endrun( sub//' ERROR: atmosphere model MUST send aerosols to CLM' ) - end if - - ! Initialize clm gsMap, clm domain and clm attribute vectors - - call get_proc_bounds( bounds ) - - call lnd_SetgsMap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - lsize = mct_gsMap_lsize(gsMap_lnd, mpicom_lnd) - - call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) - - call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) - call mct_aVect_zero(x2l_l) - - call mct_aVect_init(l2x_l, rList=seq_flds_l2x_fields, lsize=lsize) - call mct_aVect_zero(l2x_l) - - ! Finish initializing clm - - call initialize2() - - ! Check that clm internal dtime aligns with clm coupling interval - - call seq_timemgr_EClockGetData(EClock, dtime=dtime_sync ) - dtime_clm = get_step_size() - if (masterproc) then - write(iulog,*)'dtime_sync= ',dtime_sync,& - ' dtime_clm= ',dtime_clm,' mod = ',mod(dtime_sync,dtime_clm) - end if - if (mod(dtime_sync,dtime_clm) /= 0) then - write(iulog,*)'clm dtime ',dtime_clm,' and Eclock dtime ',& - dtime_sync,' never align' - call endrun( sub//' ERROR: time out of sync' ) - end if - - ! Create land export state - - call lnd_export(bounds, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - - ! Fill in infodata settings - - call seq_infodata_PutData(infodata, lnd_prognostic=.true.) - call seq_infodata_PutData(infodata, lnd_nx=ldomain%ni, lnd_ny=ldomain%nj) - - ! Get infodata info - - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - call set_nextsw_cday(nextsw_cday) - call lnd_handle_resume( infodata ) - - ! Reset shr logging to original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - write(iulog,*) TRIM(Sub) // ':end::' - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_int_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - end subroutine lnd_init_mct - - !==================================================================================== - - subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Run clm model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_initializeMod, only : lnd2atm_inst, atm2lnd_inst, lnd2glc_inst, glc2lnd_inst - use clm_driver , only : clm_drv - use clm_time_manager, only : get_curr_date, get_nstep, get_curr_calday, get_step_size - use clm_time_manager, only : advance_timestep, set_nextsw_cday,update_rad_dtime - use decompMod , only : get_proc_bounds - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod , only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use seq_infodata_mod, only : seq_infodata_type, seq_infodata_GetData - use spmdMod , only : masterproc, mpicom - use perf_mod , only : t_startf, t_stopf, t_barrierf - use shr_orb_mod , only : shr_orb_decl - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - ! - ! !LOCAL VARIABLES: - integer :: ymd_sync ! Sync date (YYYYMMDD) - integer :: yr_sync ! Sync current year - integer :: mon_sync ! Sync current month - integer :: day_sync ! Sync current day - integer :: tod_sync ! Sync current time of day (sec) - integer :: ymd ! CLM current date (YYYYMMDD) - integer :: yr ! CLM current year - integer :: mon ! CLM current month - integer :: day ! CLM current day - integer :: tod ! CLM current time of day (sec) - integer :: dtime ! time step increment (sec) - integer :: nstep ! time step index - logical :: rstwr_sync ! .true. ==> write restart file before returning - logical :: rstwr ! .true. ==> write restart file before returning - logical :: nlend_sync ! Flag signaling last time-step - logical :: nlend ! .true. ==> last time-step - logical :: dosend ! true => send data back to driver - logical :: doalb ! .true. ==> do albedo calculation on this time step - logical :: rof_prognostic ! .true. => running with a prognostic ROF model - logical :: glc_present ! .true. => running with a non-stub GLC model - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - real(r8) :: caldayp1 ! clm calday plus dtime offset - integer :: shrlogunit,shrloglev ! old values for share log unit and log level - integer :: lbnum ! input to memory diagnostic - integer :: g,i,lsize ! counters - real(r8) :: calday ! calendar day for nstep - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinp1 ! solar declination angle in radians for nstep+1 - real(r8) :: eccf ! earth orbit eccentricity factor - real(r8) :: recip ! reciprical - logical,save :: first_call = .true. ! first call work - type(seq_infodata_type),pointer :: infodata ! CESM information from the driver - type(mct_gGrid), pointer :: dom_l ! Land model domain data - type(bounds_type) :: bounds ! bounds - character(len=32) :: rdate ! date char string for restart file names - character(len=32), parameter :: sub = "lnd_run_mct" - !--------------------------------------------------------------------------- - - ! Determine processor bounds - - call get_proc_bounds(bounds) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:start::',lbnum) - endif -#endif - - ! Reset shr logging to my log file - call shr_file_getLogUnit (shrlogunit) - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Determine time of next atmospheric shortwave calculation - call seq_cdata_setptrs(cdata_l, infodata=infodata, dom=dom_l) - call seq_timemgr_EClockGetData(EClock, & - curr_ymd=ymd, curr_tod=tod_sync, & - curr_yr=yr_sync, curr_mon=mon_sync, curr_day=day_sync) - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - - call set_nextsw_cday( nextsw_cday ) - dtime = get_step_size() - - ! Handle pause/resume signals from coupler - call lnd_handle_resume( infodata ) - - write(rdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr_sync,mon_sync,day_sync,tod_sync - nlend_sync = seq_timemgr_StopAlarmIsOn( EClock ) - rstwr_sync = seq_timemgr_RestartAlarmIsOn( EClock ) - - ! Determine if we're running with a prognostic ROF model, and if we're running with a - ! non-stub GLC model. These won't change throughout the run, but we can't count on - ! their being set in initialization, so need to get them in the run method. - - call seq_infodata_GetData( infodata, & - rof_prognostic=rof_prognostic, & - glc_present=glc_present) - - ! Map MCT to land data type - ! Perform downscaling if appropriate - - - ! Map to clm (only when state and/or fluxes need to be updated) - - call t_startf ('lc_lnd_import') - call lnd_import( bounds, & - x2l = x2l_l%rattr, & - glc_present = glc_present, & - atm2lnd_inst = atm2lnd_inst, & - glc2lnd_inst = glc2lnd_inst) - call t_stopf ('lc_lnd_import') - - ! Use infodata to set orbital values if updated mid-run - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Loop over time steps in coupling interval - - dosend = .false. - do while(.not. dosend) - - ! Determine if dosend - ! When time is not updated at the beginning of the loop - then return only if - ! are in sync with clock before time is updated - - call get_curr_date( yr, mon, day, tod ) - ymd = yr*10000 + mon*100 + day - tod = tod - dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) - - ! Determine doalb based on nextsw_cday sent from atm model - - nstep = get_nstep() - caldayp1 = get_curr_calday(offset=dtime) - if (nstep == 0) then - doalb = .false. - else if (nstep == 1) then - doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) - else - doalb = (nextsw_cday >= -0.5_r8) - end if - call update_rad_dtime(doalb) - - ! Determine if time to write cam restart and stop - - rstwr = .false. - if (rstwr_sync .and. dosend) rstwr = .true. - nlend = .false. - if (nlend_sync .and. dosend) nlend = .true. - - ! Run clm - - call t_barrierf('sync_clm_run1', mpicom) - call t_startf ('clm_run') - call t_startf ('shr_orb_decl') - calday = get_curr_calday() - call shr_orb_decl( calday , eccen, mvelpp, lambm0, obliqr, declin , eccf ) - call shr_orb_decl( nextsw_cday, eccen, mvelpp, lambm0, obliqr, declinp1, eccf ) - call t_stopf ('shr_orb_decl') - call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic) - call t_stopf ('clm_run') - - ! Create l2x_l export state - add river runoff input to l2x_l if appropriate - - call t_startf ('lc_lnd_export') - call lnd_export(bounds, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - call t_stopf ('lc_lnd_export') - - ! Advance clm time step - - call t_startf ('lc_clm2_adv_timestep') - call advance_timestep() - call t_stopf ('lc_clm2_adv_timestep') - - end do - - ! Check that internal clock is in sync with master clock - - call get_curr_date( yr, mon, day, tod, offset=-dtime ) - ymd = yr*10000 + mon*100 + day - tod = tod - if ( .not. seq_timemgr_EClockDateInSync( EClock, ymd, tod ) )then - call seq_timemgr_EclockGetData( EClock, curr_ymd=ymd_sync, curr_tod=tod_sync ) - write(iulog,*)' clm ymd=',ymd ,' clm tod= ',tod - write(iulog,*)'sync ymd=',ymd_sync,' sync tod= ',tod_sync - call endrun( sub//":: CLM clock not in sync with Master Sync clock" ) - end if - - ! Reset shr logging to my original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - first_call = .false. - - end subroutine lnd_run_mct - - !==================================================================================== - - subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Finalize land surface model - - use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod ,only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use esmf - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - !--------------------------------------------------------------------------- - - ! fill this in - end subroutine lnd_final_mct - - !==================================================================================== - - subroutine lnd_setgsmap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - ! - ! !DESCRIPTION: - ! Set the MCT GS map for the land model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use domainMod , only : ldomain - use mct_mod , only : mct_gsMap, mct_gsMap_init - implicit none - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: mpicom_lnd ! MPI communicator for the clm land model - integer , intent(in) :: LNDID ! Land model identifyer number - type(mct_gsMap) , intent(out) :: gsMap_lnd ! Resulting MCT GS map for the land model - ! - ! !LOCAL VARIABLES: - integer,allocatable :: gindex(:) ! Number the local grid points - integer :: i, j, n, gi ! Indices - integer :: lsize,gsize ! GS Map size - integer :: ier ! Error code - !--------------------------------------------------------------------------- - - ! Build the land grid numbering for MCT - ! NOTE: Numbering scheme is: West to East and South to North - ! starting at south pole. Should be the same as what's used in SCRIP - - allocate(gindex(bounds%begg:bounds%endg),stat=ier) - - ! number the local grid - - do n = bounds%begg, bounds%endg - gindex(n) = ldecomp%gdc2glo(n) - end do - lsize = bounds%endg - bounds%begg + 1 - gsize = ldomain%ni * ldomain%nj - - call mct_gsMap_init( gsMap_lnd, gindex, mpicom_lnd, LNDID, lsize, gsize ) - - deallocate(gindex) - - end subroutine lnd_SetgsMap_mct - - !==================================================================================== - - subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) - ! - ! !DESCRIPTION: - ! Send the land model domain information to the coupler - ! - ! !USES: - use clm_varcon , only: re - use domainMod , only: ldomain - use spmdMod , only: iam - use mct_mod , only: mct_gGrid_importIAttr - use mct_mod , only: mct_gGrid_importRAttr, mct_gGrid_init, mct_gsMap_orderedPoints - use seq_flds_mod, only: seq_flds_dom_coord, seq_flds_dom_other - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: lsize ! land model domain data size - type(mct_gsMap), intent(inout) :: gsMap_l ! Output land model MCT GS map - type(mct_ggrid), intent(out) :: dom_l ! Output domain information for land model - ! - ! Local Variables - integer :: g,i,j ! index - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !--------------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - call mct_gGrid_init( GGrid=dom_l, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsMap_l, iam, idata) - call mct_gGrid_importIAttr(dom_l,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_l,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_l,"mask" ,data,lsize) - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_l,"lon",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_l,"lat",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_l,"area",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"mask",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine lnd_domain_mct - - !==================================================================================== - - subroutine lnd_handle_resume( infodata ) - ! - ! !DESCRIPTION: - ! Handle resume signals for Data Assimilation (DA) - ! - ! !USES: - use shr_kind_mod , only : shr_kind_cl - use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData - use clm_time_manager , only : update_DA_nstep - use seq_comm_mct , only : num_inst_lnd - use clm_varctl , only : iulog - use clm_varctl , only : inst_index - implicit none - ! !ARGUMENTS: - type(seq_infodata_type), intent(IN) :: infodata ! CESM driver level info data - ! !LOCAL VARIABLES: - character(len=SHR_KIND_CL) :: lnd_resume(num_inst_lnd) ! land resume file (for data assimulation) - logical :: resume_from_data_assim ! flag if we are resuming after data assimulation was done - !--------------------------------------------------------------------------- - - call seq_infodata_GetData(infodata, lnd_resume=lnd_resume ) - ! If lnd_resume is blank, restart file wasn't modified - if ( len_trim(lnd_resume(min(num_inst_lnd,inst_index))) == 0 )then - resume_from_data_assim = .false. - ! Otherwise restart was modified and we are resuming from data assimulation - else - resume_from_data_assim = .true. - write(iulog,*) 'resume_from_DA ', resume_from_data_assim - end if - if ( resume_from_data_assim ) call update_DA_nstep() - - end subroutine lnd_handle_resume - -end module lnd_comp_mct diff --git a/src/cpl/lnd_import_export.F90 b/src/cpl/lnd_import_export.F90 deleted file mode 100644 index 4923b721af..0000000000 --- a/src/cpl/lnd_import_export.F90 +++ /dev/null @@ -1,429 +0,0 @@ -module lnd_import_export - - use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl - use abortutils , only: endrun - use decompmod , only: bounds_type - use lnd2atmType , only: lnd2atm_type - use lnd2glcMod , only: lnd2glc_type - use atm2lndType , only: atm2lnd_type - use glc2lndMod , only: glc2lnd_type - use clm_cpl_indices - ! - implicit none - !=============================================================================== - -contains - - !=============================================================================== - subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the input data from the coupler to the land model - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields - use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13 - use clm_varctl , only: ndep_from_cpl - use clm_varcon , only: rair, o2_molar_const, c13ratio - use shr_const_mod , only: SHR_CONST_TKFRZ - use shr_string_mod , only: shr_string_listGetName - use domainMod , only: ldomain - use shr_infnan_mod , only : isnan => shr_infnan_isnan - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - real(r8) , intent(in) :: x2l(:,:) ! driver import state to land model - logical , intent(in) :: glc_present ! .true. => running with a non-stub GLC model - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst ! clm internal input data type - type(glc2lnd_type) , intent(inout) :: glc2lnd_inst ! clm internal input data type - ! - ! !LOCAL VARIABLES: - integer :: g,i,k,nstep,ier ! indices, number of steps, and error code - real(r8) :: forc_rainc ! rainxy Atm flux mm/s - real(r8) :: e ! vapor pressure (Pa) - real(r8) :: qsat ! saturation specific humidity (kg/kg) - real(r8) :: forc_t ! atmospheric temperature (Kelvin) - real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) - real(r8) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) :: forc_rainl ! rainxy Atm flux mm/s - real(r8) :: forc_snowc ! snowfxy Atm flux mm/s - real(r8) :: forc_snowl ! snowfxl Atm flux mm/s - real(r8) :: co2_ppmv_diag ! temporary - real(r8) :: co2_ppmv_prog ! temporary - real(r8) :: co2_ppmv_val ! temporary - integer :: co2_type_idx ! integer flag for co2_type options - real(r8) :: esatw ! saturation vapor pressure over water (Pa) - real(r8) :: esati ! saturation vapor pressure over ice (Pa) - real(r8) :: a0,a1,a2,a3,a4,a5,a6 ! coefficients for esat over water - real(r8) :: b0,b1,b2,b3,b4,b5,b6 ! coefficients for esat over ice - real(r8) :: tdc, t ! Kelvins to Celcius function and its input - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_import' - - ! Constants to compute vapor pressure - parameter (a0=6.107799961_r8 , a1=4.436518521e-01_r8, & - a2=1.428945805e-02_r8, a3=2.650648471e-04_r8, & - a4=3.031240396e-06_r8, a5=2.034080948e-08_r8, & - a6=6.136820929e-11_r8) - - parameter (b0=6.109177956_r8 , b1=5.034698970e-01_r8, & - b2=1.886013408e-02_r8, b3=4.176223716e-04_r8, & - b4=5.824720280e-06_r8, b5=4.838803174e-08_r8, & - b6=1.838826904e-10_r8) - ! - ! function declarations - ! - tdc(t) = min( 50._r8, max(-50._r8,(t-SHR_CONST_TKFRZ)) ) - esatw(t) = 100._r8*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6)))))) - esati(t) = 100._r8*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6)))))) - !--------------------------------------------------------------------------- - - co2_type_idx = 0 - if (co2_type == 'prognostic') then - co2_type_idx = 1 - else if (co2_type == 'diagnostic') then - co2_type_idx = 2 - end if - if (co2_type == 'prognostic' .and. index_x2l_Sa_co2prog == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2prog for co2_type equal to prognostic' ) - else if (co2_type == 'diagnostic' .and. index_x2l_Sa_co2diag == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2diag for co2_type equal to diagnostic' ) - end if - - ! Note that the precipitation fluxes received from the coupler - ! are in units of kg/s/m^2. To convert these precipitation rates - ! in units of mm/sec, one must divide by 1000 kg/m^3 and multiply - ! by 1000 mm/m resulting in an overall factor of unity. - ! Below the units are therefore given in mm/s. - - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - - ! Determine flooding input, sign convention is positive downward and - ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, - ! change the sign to indicate addition of water to system. - - atm2lnd_inst%forc_flood_grc(g) = -x2l(index_x2l_Flrr_flood,i) - - atm2lnd_inst%volr_grc(g) = x2l(index_x2l_Flrr_volr,i) * (ldomain%area(g) * 1.e6_r8) - atm2lnd_inst%volrmch_grc(g)= x2l(index_x2l_Flrr_volrmch,i) * (ldomain%area(g) * 1.e6_r8) - - ! Determine required receive fields - - atm2lnd_inst%forc_hgt_grc(g) = x2l(index_x2l_Sa_z,i) ! zgcmxy Atm state m - atm2lnd_inst%forc_topo_grc(g) = x2l(index_x2l_Sa_topo,i) ! Atm surface height (m) - atm2lnd_inst%forc_u_grc(g) = x2l(index_x2l_Sa_u,i) ! forc_uxy Atm state m/s - atm2lnd_inst%forc_v_grc(g) = x2l(index_x2l_Sa_v,i) ! forc_vxy Atm state m/s - atm2lnd_inst%forc_solad_grc(g,2) = x2l(index_x2l_Faxa_swndr,i) ! forc_sollxy Atm flux W/m^2 - atm2lnd_inst%forc_solad_grc(g,1) = x2l(index_x2l_Faxa_swvdr,i) ! forc_solsxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,2) = x2l(index_x2l_Faxa_swndf,i) ! forc_solldxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,1) = x2l(index_x2l_Faxa_swvdf,i) ! forc_solsdxy Atm flux W/m^2 - - atm2lnd_inst%forc_th_not_downscaled_grc(g) = x2l(index_x2l_Sa_ptem,i) ! forc_thxy Atm state K - atm2lnd_inst%forc_q_not_downscaled_grc(g) = x2l(index_x2l_Sa_shum,i) ! forc_qxy Atm state kg/kg - atm2lnd_inst%forc_pbot_not_downscaled_grc(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa - atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K - atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 - - forc_rainc = x2l(index_x2l_Faxa_rainc,i) ! mm/s - forc_rainl = x2l(index_x2l_Faxa_rainl,i) ! mm/s - forc_snowc = x2l(index_x2l_Faxa_snowc,i) ! mm/s - forc_snowl = x2l(index_x2l_Faxa_snowl,i) ! mm/s - - ! atmosphere coupling, for prognostic/prescribed aerosols - atm2lnd_inst%forc_aer_grc(g,1) = x2l(index_x2l_Faxa_bcphidry,i) - atm2lnd_inst%forc_aer_grc(g,2) = x2l(index_x2l_Faxa_bcphodry,i) - atm2lnd_inst%forc_aer_grc(g,3) = x2l(index_x2l_Faxa_bcphiwet,i) - atm2lnd_inst%forc_aer_grc(g,4) = x2l(index_x2l_Faxa_ocphidry,i) - atm2lnd_inst%forc_aer_grc(g,5) = x2l(index_x2l_Faxa_ocphodry,i) - atm2lnd_inst%forc_aer_grc(g,6) = x2l(index_x2l_Faxa_ocphiwet,i) - atm2lnd_inst%forc_aer_grc(g,7) = x2l(index_x2l_Faxa_dstwet1,i) - atm2lnd_inst%forc_aer_grc(g,8) = x2l(index_x2l_Faxa_dstdry1,i) - atm2lnd_inst%forc_aer_grc(g,9) = x2l(index_x2l_Faxa_dstwet2,i) - atm2lnd_inst%forc_aer_grc(g,10) = x2l(index_x2l_Faxa_dstdry2,i) - atm2lnd_inst%forc_aer_grc(g,11) = x2l(index_x2l_Faxa_dstwet3,i) - atm2lnd_inst%forc_aer_grc(g,12) = x2l(index_x2l_Faxa_dstdry3,i) - atm2lnd_inst%forc_aer_grc(g,13) = x2l(index_x2l_Faxa_dstwet4,i) - atm2lnd_inst%forc_aer_grc(g,14) = x2l(index_x2l_Faxa_dstdry4,i) - - ! Determine optional receive fields - - if (index_x2l_Sa_co2prog /= 0) then - co2_ppmv_prog = x2l(index_x2l_Sa_co2prog,i) ! co2 atm state prognostic - else - co2_ppmv_prog = co2_ppmv - end if - - if (index_x2l_Sa_co2diag /= 0) then - co2_ppmv_diag = x2l(index_x2l_Sa_co2diag,i) ! co2 atm state diagnostic - else - co2_ppmv_diag = co2_ppmv - end if - - if (index_x2l_Sa_methane /= 0) then - atm2lnd_inst%forc_pch4_grc(g) = x2l(index_x2l_Sa_methane,i) - endif - - ! Determine derived quantities for required fields - - forc_t = atm2lnd_inst%forc_t_not_downscaled_grc(g) - forc_q = atm2lnd_inst%forc_q_not_downscaled_grc(g) - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - atm2lnd_inst%forc_hgt_u_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of wind [m] - atm2lnd_inst%forc_hgt_t_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of temperature [m] - atm2lnd_inst%forc_hgt_q_grc(g) = atm2lnd_inst%forc_hgt_grc(g) !observational height of humidity [m] - atm2lnd_inst%forc_vp_grc(g) = forc_q * forc_pbot / (0.622_r8 + 0.378_r8 * forc_q) - atm2lnd_inst%forc_rho_not_downscaled_grc(g) = & - (forc_pbot - 0.378_r8 * atm2lnd_inst%forc_vp_grc(g)) / (rair * forc_t) - atm2lnd_inst%forc_po2_grc(g) = o2_molar_const * forc_pbot - atm2lnd_inst%forc_wind_grc(g) = sqrt(atm2lnd_inst%forc_u_grc(g)**2 + atm2lnd_inst%forc_v_grc(g)**2) - atm2lnd_inst%forc_solar_grc(g) = atm2lnd_inst%forc_solad_grc(g,1) + atm2lnd_inst%forc_solai_grc(g,1) + & - atm2lnd_inst%forc_solad_grc(g,2) + atm2lnd_inst%forc_solai_grc(g,2) - - atm2lnd_inst%forc_rain_not_downscaled_grc(g) = forc_rainc + forc_rainl - atm2lnd_inst%forc_snow_not_downscaled_grc(g) = forc_snowc + forc_snowl - - if (forc_t > SHR_CONST_TKFRZ) then - e = esatw(tdc(forc_t)) - else - e = esati(tdc(forc_t)) - end if - qsat = 0.622_r8*e / (forc_pbot - 0.378_r8*e) - - !modify specific humidity if precip occurs - if(1==2) then - if((forc_rainc+forc_rainl) > 0._r8) then - forc_q = 0.95_r8*qsat - ! forc_q = qsat - atm2lnd_inst%forc_q_not_downscaled_grc(g) = forc_q - endif - endif - - atm2lnd_inst%forc_rh_grc(g) = 100.0_r8*(forc_q / qsat) - - ! Check that solar, specific-humidity and LW downward aren't negative - if ( atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) <= 0.0_r8 )then - call endrun( sub//' ERROR: Longwave down sent from the atmosphere model is negative or zero' ) - end if - if ( (atm2lnd_inst%forc_solad_grc(g,1) < 0.0_r8) .or. (atm2lnd_inst%forc_solad_grc(g,2) < 0.0_r8) & - .or. (atm2lnd_inst%forc_solai_grc(g,1) < 0.0_r8) .or. (atm2lnd_inst%forc_solai_grc(g,2) < 0.0_r8) ) then - call endrun( sub//' ERROR: One of the solar fields (indirect/diffuse, vis or near-IR)'// & - ' from the atmosphere model is negative or zero' ) - end if - if ( atm2lnd_inst%forc_q_not_downscaled_grc(g) < 0.0_r8 )then - call endrun( sub//' ERROR: Bottom layer specific humidty sent from the atmosphere model is less than zero' ) - end if - - ! Check if any input from the coupler is NaN - if ( any(isnan(x2l(:,i))) )then - write(iulog,*) '# of NaNs = ', count(isnan(x2l(:,i))) - write(iulog,*) 'Which are NaNs = ', isnan(x2l(:,i)) - do k = 1, size(x2l(:,i)) - if ( isnan(x2l(k,i)) )then - call shr_string_listGetName( seq_flds_x2l_fields, k, fname ) - write(iulog,*) trim(fname) - end if - end do - write(iulog,*) 'gridcell index = ', g - call endrun( sub//' ERROR: One or more of the input from the atmosphere model are NaN '// & - '(Not a Number from a bad floating point calculation)' ) - end if - - ! Make sure relative humidity is properly bounded - ! atm2lnd_inst%forc_rh_grc(g) = min( 100.0_r8, atm2lnd_inst%forc_rh_grc(g) ) - ! atm2lnd_inst%forc_rh_grc(g) = max( 0.0_r8, atm2lnd_inst%forc_rh_grc(g) ) - - ! Determine derived quantities for optional fields - ! Note that the following does unit conversions from ppmv to partial pressures (Pa) - ! Note that forc_pbot is in Pa - - if (co2_type_idx == 1) then - co2_ppmv_val = co2_ppmv_prog - else if (co2_type_idx == 2) then - co2_ppmv_val = co2_ppmv_diag - else - co2_ppmv_val = co2_ppmv - end if - if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then - call endrun( sub//' ERROR: CO2 is outside of an expected range' ) - end if - atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot - if (use_c13) then - atm2lnd_inst%forc_pc13o2_grc(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot - end if - - if (ndep_from_cpl) then - ! The coupler is sending ndep in units if kgN/m2/s - and clm uses units of gN/m2/sec - so the - ! following conversion needs to happen - atm2lnd_inst%forc_ndep_grc(g) = (x2l(index_x2l_Faxa_nhx, i) + x2l(index_x2l_faxa_noy, i))*1000._r8 - end if - - end do - - call glc2lnd_inst%set_glc2lnd_fields( & - bounds = bounds, & - glc_present = glc_present, & - ! NOTE(wjs, 2017-12-13) the x2l argument doesn't have the typical bounds - ! subsetting (bounds%begg:bounds%endg). This mirrors the lack of these bounds in - ! the call to lnd_import from lnd_run_mct. This is okay as long as this code is - ! outside a clump loop. - x2l = x2l, & - index_x2l_Sg_ice_covered = index_x2l_Sg_ice_covered, & - index_x2l_Sg_topo = index_x2l_Sg_topo, & - index_x2l_Flgg_hflx = index_x2l_Flgg_hflx, & - index_x2l_Sg_icemask = index_x2l_Sg_icemask, & - index_x2l_Sg_icemask_coupled_fluxes = index_x2l_Sg_icemask_coupled_fluxes) - - end subroutine lnd_import - - !=============================================================================== - - subroutine lnd_export( bounds, lnd2atm_inst, lnd2glc_inst, l2x) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the data to be sent from the clm model to the coupler - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use seq_flds_mod , only : seq_flds_l2x_fields - use clm_varctl , only : iulog - use clm_time_manager , only : get_nstep, get_step_size - use seq_drydep_mod , only : n_drydep - use shr_megan_mod , only : shr_megan_mechcomps_n - use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use domainMod , only : ldomain - use shr_string_mod , only : shr_string_listGetName - use shr_infnan_mod , only : isnan => shr_infnan_isnan - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - type(lnd2atm_type), intent(inout) :: lnd2atm_inst ! clm land to atmosphere exchange data type - type(lnd2glc_type), intent(inout) :: lnd2glc_inst ! clm land to atmosphere exchange data type - real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid - ! - ! !LOCAL VARIABLES: - integer :: g,i,k ! indices - integer :: ier ! error status - integer :: nstep ! time step index - integer :: dtime ! time step - integer :: num ! counter - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_export' - !--------------------------------------------------------------------------- - - ! cesm sign convention is that fluxes are positive downward - - l2x(:,:) = 0.0_r8 - - do g = bounds%begg,bounds%endg - i = 1 + (g-bounds%begg) - l2x(index_l2x_Sl_t,i) = lnd2atm_inst%t_rad_grc(g) - l2x(index_l2x_Sl_snowh,i) = lnd2atm_inst%h2osno_grc(g) - l2x(index_l2x_Sl_avsdr,i) = lnd2atm_inst%albd_grc(g,1) - l2x(index_l2x_Sl_anidr,i) = lnd2atm_inst%albd_grc(g,2) - l2x(index_l2x_Sl_avsdf,i) = lnd2atm_inst%albi_grc(g,1) - l2x(index_l2x_Sl_anidf,i) = lnd2atm_inst%albi_grc(g,2) - l2x(index_l2x_Sl_tref,i) = lnd2atm_inst%t_ref2m_grc(g) - l2x(index_l2x_Sl_qref,i) = lnd2atm_inst%q_ref2m_grc(g) - l2x(index_l2x_Sl_u10,i) = lnd2atm_inst%u_ref10m_grc(g) - l2x(index_l2x_Fall_taux,i) = -lnd2atm_inst%taux_grc(g) - l2x(index_l2x_Fall_tauy,i) = -lnd2atm_inst%tauy_grc(g) - l2x(index_l2x_Fall_lat,i) = -lnd2atm_inst%eflx_lh_tot_grc(g) - l2x(index_l2x_Fall_sen,i) = -lnd2atm_inst%eflx_sh_tot_grc(g) - l2x(index_l2x_Fall_lwup,i) = -lnd2atm_inst%eflx_lwrad_out_grc(g) - l2x(index_l2x_Fall_evap,i) = -lnd2atm_inst%qflx_evap_tot_grc(g) - l2x(index_l2x_Fall_swnet,i) = lnd2atm_inst%fsa_grc(g) - if (index_l2x_Fall_fco2_lnd /= 0) then - l2x(index_l2x_Fall_fco2_lnd,i) = -lnd2atm_inst%net_carbon_exchange_grc(g) - end if - - ! Additional fields for DUST, PROGSSLT, dry-deposition and VOC - ! These are now standard fields, but the check on the index makes sure the driver handles them - if (index_l2x_Sl_ram1 /= 0 ) l2x(index_l2x_Sl_ram1,i) = lnd2atm_inst%ram1_grc(g) - if (index_l2x_Sl_fv /= 0 ) l2x(index_l2x_Sl_fv,i) = lnd2atm_inst%fv_grc(g) - if (index_l2x_Sl_soilw /= 0 ) l2x(index_l2x_Sl_soilw,i) = lnd2atm_inst%h2osoi_vol_grc(g,1) - if (index_l2x_Fall_flxdst1 /= 0 ) l2x(index_l2x_Fall_flxdst1,i)= -lnd2atm_inst%flxdst_grc(g,1) - if (index_l2x_Fall_flxdst2 /= 0 ) l2x(index_l2x_Fall_flxdst2,i)= -lnd2atm_inst%flxdst_grc(g,2) - if (index_l2x_Fall_flxdst3 /= 0 ) l2x(index_l2x_Fall_flxdst3,i)= -lnd2atm_inst%flxdst_grc(g,3) - if (index_l2x_Fall_flxdst4 /= 0 ) l2x(index_l2x_Fall_flxdst4,i)= -lnd2atm_inst%flxdst_grc(g,4) - - - ! for dry dep velocities - if (index_l2x_Sl_ddvel /= 0 ) then - l2x(index_l2x_Sl_ddvel:index_l2x_Sl_ddvel+n_drydep-1,i) = & - lnd2atm_inst%ddvel_grc(g,:n_drydep) - end if - - ! for MEGAN VOC emis fluxes - if (index_l2x_Fall_flxvoc /= 0 ) then - l2x(index_l2x_Fall_flxvoc:index_l2x_Fall_flxvoc+shr_megan_mechcomps_n-1,i) = & - -lnd2atm_inst%flxvoc_grc(g,:shr_megan_mechcomps_n) - end if - - - ! for fire emis fluxes - if (index_l2x_Fall_flxfire /= 0 ) then - l2x(index_l2x_Fall_flxfire:index_l2x_Fall_flxfire+shr_fire_emis_mechcomps_n-1,i) = & - -lnd2atm_inst%fireflx_grc(g,:shr_fire_emis_mechcomps_n) - l2x(index_l2x_Sl_ztopfire,i) = lnd2atm_inst%fireztop_grc(g) - end if - - if (index_l2x_Fall_methane /= 0) then - l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%flux_ch4_grc(g) - endif - - ! sign convention is positive downward with - ! hierarchy of atm/glc/lnd/rof/ice/ocn. - ! I.e. water sent from land to rof is positive - - ! surface runoff is the sum of qflx_over, qflx_h2osfc_surf - l2x(index_l2x_Flrl_rofsur,i) = lnd2atm_inst%qflx_rofliq_qsur_grc(g) & - + lnd2atm_inst%qflx_rofliq_h2osfc_grc(g) - - ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain - l2x(index_l2x_Flrl_rofsub,i) = lnd2atm_inst%qflx_rofliq_qsub_grc(g) & - + lnd2atm_inst%qflx_rofliq_drain_perched_grc(g) - - ! qgwl sent individually to coupler - l2x(index_l2x_Flrl_rofgwl,i) = lnd2atm_inst%qflx_rofliq_qgwl_grc(g) - - ! ice sent individually to coupler - l2x(index_l2x_Flrl_rofi,i) = lnd2atm_inst%qflx_rofice_grc(g) - - ! irrigation flux to be removed from main channel storage (negative) - l2x(index_l2x_Flrl_irrig,i) = - lnd2atm_inst%qirrig_grc(g) - - ! glc coupling - ! We could avoid setting these fields if glc_present is .false., if that would - ! help with performance. (The downside would be that we wouldn't have these fields - ! available for diagnostic purposes or to force a later T compset with dlnd.) - do num = 0,glc_nec - l2x(index_l2x_Sl_tsrf(num),i) = lnd2glc_inst%tsrf_grc(g,num) - l2x(index_l2x_Sl_topo(num),i) = lnd2glc_inst%topo_grc(g,num) - l2x(index_l2x_Flgl_qice(num),i) = lnd2glc_inst%qice_grc(g,num) - end do - - ! Check if any output sent to the coupler is NaN - if ( any(isnan(l2x(:,i))) )then - write(iulog,*) '# of NaNs = ', count(isnan(l2x(:,i))) - write(iulog,*) 'Which are NaNs = ', isnan(l2x(:,i)) - do k = 1, size(l2x(:,i)) - if ( isnan(l2x(k,i)) )then - call shr_string_listGetName( seq_flds_l2x_fields, k, fname ) - write(iulog,*) trim(fname) - end if - end do - write(iulog,*) 'gridcell index = ', g - call endrun( sub//' ERROR: One or more of the output from CLM to the coupler are NaN ' ) - end if - - end do - - end subroutine lnd_export - -end module lnd_import_export diff --git a/src/dyn_subgrid/CMakeLists.txt b/src/dyn_subgrid/CMakeLists.txt deleted file mode 100644 index 41ed645376..0000000000 --- a/src/dyn_subgrid/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -set(genf90_files - dynVarMod.F90.in - dynVarTimeInterpMod.F90.in - dynVarTimeUninterpMod.F90.in - ) - -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) - -sourcelist_to_parent(clm_genf90_sources) - -list(APPEND clm_sources "${clm_genf90_sources}") - -list(APPEND clm_sources - dynColumnStateUpdaterMod.F90 - dynColumnTemplateMod.F90 - dynPatchStateUpdaterMod.F90 - dynPriorWeightsMod.F90 - dynTimeInfoMod.F90 - dynLandunitAreaMod.F90 - dynInitColumnsMod.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 b/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 deleted file mode 100644 index f5e3763cdc..0000000000 --- a/src/dyn_subgrid/dynColumnStateUpdaterMod.F90 +++ /dev/null @@ -1,951 +0,0 @@ -module dynColumnStateUpdaterMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Class for adjusting column-level state variables due to transient column areas. - ! - ! In each time step, the object should be set up with: - ! - ! - call column_state_updater%set_old_weights (before dyn subgrid weight updates) - ! - ! - call column_state_updater%set_new_weights (after dyn subgrid weight updates) - ! - ! Then it can be used to update each state variable with a call to one of the variants of: - ! - ! - call column_state_updater%update_column_state_* - ! - ! All calls must be made from within a loop over clumps. - ! - ! The following methods are available for state updates: - ! - ! - update_column_state_no_special_handling - ! No special handling is done for any columns. This method is appropriate for - ! state variables that have valid values for all landunits. It is also - ! appropriate for state variables that are not typically handled for special - ! landunits, but when you want the behavior to be: When a special landunit takes - ! over some area from a standard landunit, you want the mass below the shrinking - ! column to remain in place, "frozen" beneath the growing special column - and - ! this mass can later be released again if the special landunit is eventually - ! taken back over by a standard landunit. - ! - ! - update_column_state_fill_special_using_natveg - ! Columns on any "special" landunit contribute mass-per-unit-area equal to the - ! current state on the first natural vegetation column on its grid cell. This - ! method is appropriate for state variables that are not tracked on special - ! landunits, when you want their value to remain unchanged when a vegetated - ! landunit takes over area from a special landunit. - ! - ! - update_column_state_fill_using_fixed_values - ! Each specially-treated landunit is given its own constant value for the state - ! variable, which is the mass-per-unit-area contributed when a column on that - ! landunit shrinks. This method is appropriate when you want to treat certain - ! landunits as contributing some fixed amount of mass-per-unit-area when they - ! shrink - this fixed amount can be 0 or some non-0 value. - ! - ! - update_column_state_fill_special_using_fixed_value - ! Convenience wrapper to the more general - ! update_column_state_fill_using_fixed_values. This method is appropriate when - ! all special landunits contribute the same fixed value. - ! - ! All update methods accept optional fractional areas. If provided, these give the - ! fraction of the column over which the state variable applies. For example, this can be - ! used if each column is split into an inundated and uninundated fraction; if the state - ! variable gives mass per unit area of the inundated portion of the column, then - ! fractional_area should specify the inundated fraction of each column. (If no - ! fractional areas are provided, then the state variable is assumed to apply to the - ! entire column, which is the typical case.) If fractional areas are provided, both - ! 'old' (before area updates) and 'new' (after area updates) versions must be provided. - ! The determination of the new fractional areas should be done via a call to - ! update_column_state_no_special_handling: the code for working with fractional areas - ! has no capability to do any special handling, and there could be inconsistencies if - ! the new fractional areas were determined using a method that has some special - ! handling. Thus, fractional_area must be valid for all columns, even if the state - ! variable itself is filled using one of the special-handling methods here. - ! - ! For methods other than update_column_state_no_special_handling, an additional inout - ! argument (non_conserved_mass_grc) accumulates the non-conserved mass due to shrinking - ! or growing specially-treated columns. Note that the methods here add to (or subtract - ! from) the existing value in this variable; thus, the caller must zero this out at the - ! appropriate time (typically before making any calls to the methods here - either once - ! per time step or once for an entire run). (This accumulation is done so that multiple - ! state variables can all contribute to the same non-conserved-mass variable, and so - ! that - if desired - this non-conserved mass can accumulate over the course of a run.) - ! - ! All methods accept an optional output argument (adjustment) which gives the apparent - ! state adjustment in each column - that is, the per-column-area value after area - ! changes minus the per-column-area value before area changes. This adjustment will be 0 - ! for shrinking columns, and can be either positive or negative for growing - ! columns. If there are fractional areas, then this adjustment is defined as (val_new * - ! fractional_area_new - val_old * fractional_area_old). - ! - ! NOTE(wjs, 2017-02-24) The implementation involves a few levels of calls to get to the - ! real work routine (update_column_state). This design made sense (in terms of removing - ! code duplication) when there were a number of "front-end" routines, with different - ! special handling. But now it seems we're moving towards having no special handling. - ! If we ditch all of the special handling, we could also ditch these extra levels. This - ! would make the code more straightforward, and would also improve performance. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : namec, spval - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use ColumnType , only : col - use LandunitType , only : lun - use landunit_varcon , only : max_lunit, landunit_is_special - use dynColumnTemplateMod , only : template_col_from_natveg_array, TEMPLATE_NONE_FOUND - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: column_state_updater_type - - type column_state_updater_type - private - real(r8), allocatable :: cwtgcell_old(:) ! old column weights on the grid cell - real(r8), allocatable :: cwtgcell_new(:) ! new column weights on the grid cell - - ! (cwtgcell_new - cwtgcell_old) from last call to set_new_weights - real(r8), allocatable :: area_gained_col(:) - - ! For each column, a 'template' column determined as: the first active column on the - ! natural veg landunit in the same grid cell as the target column. 'active' is - ! determined at the time of the call to set_old_weights, so that we consider whether - ! a column was active in the previous time step, rather than newly-active. - integer , allocatable :: natveg_template_col(:) - - ! Whether there have been any changes in this time step. This is indexed by clump so - ! that it is thread-safe (so the different clumps don't stomp on each other). This - ! implies that the methods on this object need to be called from a loop over - ! clumps. (In the future, we plan to rework threading so that there is a separate - ! object for each clump. In this case the indexing by clump will go away here - - ! instead, there will be a single scalar 'any_changes' logical for each object.) - logical, allocatable :: any_changes(:) - - contains - ! Public routines - procedure, public :: set_old_weights ! set weights before dyn subgrid updates - procedure, public :: set_new_weights ! set weights after dyn subgrid updates - - ! Various ways to update a column-level state variable based on changing column areas: - procedure, public :: update_column_state_no_special_handling - procedure, public :: update_column_state_fill_special_using_natveg - procedure, public :: update_column_state_fill_using_fixed_values - procedure, public :: update_column_state_fill_special_using_fixed_value - - ! Private routines - - ! intermediate routine between the public routines and the real work routine - ! (update_column_state); this routine determines the fractional_areas to use in - ! update_column_state - procedure, private :: update_column_state_with_optional_fractions - - ! do the work of updating a column state - procedure, private :: update_column_state - end type column_state_updater_type - - interface column_state_updater_type - module procedure constructor ! initialize a column_state_updater_type object - end interface column_state_updater_type - - ! !PUBLIC VARIABLES: - ! For update_column_state_fill_using_fixed_values, any landunit with - ! FILLVAL_USE_EXISTING_VALUE will use the existing value in the state variable - real(r8), parameter, public :: FILLVAL_USE_EXISTING_VALUE = spval - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(bounds, nclumps) - ! - ! !DESCRIPTION: - ! Initialize a column_state_updater_type object - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - type(column_state_updater_type) :: constructor ! function result - type(bounds_type), intent(in) :: bounds ! processor bounds - integer , intent(in) :: nclumps ! number of clumps per proc - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, errMsg(sourcefile, __LINE__)) - - allocate(constructor%cwtgcell_old(bounds%begc:bounds%endc)) - constructor%cwtgcell_old(:) = nan - allocate(constructor%cwtgcell_new(bounds%begc:bounds%endc)) - constructor%cwtgcell_new(:) = nan - allocate(constructor%area_gained_col(bounds%begc:bounds%endc)) - constructor%area_gained_col(:) = nan - allocate(constructor%natveg_template_col(bounds%begc:bounds%endc)) - constructor%natveg_template_col(:) = TEMPLATE_NONE_FOUND - - allocate(constructor%any_changes(nclumps)) - constructor%any_changes(:) = .false. - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine set_old_weights(this, bounds) - ! - ! !DESCRIPTION: - ! Set subgrid weights before dyn subgrid updates - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c - - character(len=*), parameter :: subname = 'set_old_weights' - !----------------------------------------------------------------------- - - do c = bounds%begc, bounds%endc - this%cwtgcell_old(c) = col%wtgcell(c) - end do - - call template_col_from_natveg_array(bounds, col%active(bounds%begc:bounds%endc), & - this%natveg_template_col(bounds%begc:bounds%endc)) - - end subroutine set_old_weights - - !----------------------------------------------------------------------- - subroutine set_new_weights(this, bounds, clump_index) - ! - ! !DESCRIPTION: - ! Set subgrid weights after dyn subgrid updates - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - ! - ! !LOCAL VARIABLES: - integer :: c - - character(len=*), parameter :: subname = 'set_new_weights' - !----------------------------------------------------------------------- - - this%any_changes(clump_index) = .false. - do c = bounds%begc, bounds%endc - this%cwtgcell_new(c) = col%wtgcell(c) - this%area_gained_col(c) = this%cwtgcell_new(c) - this%cwtgcell_old(c) - if (this%area_gained_col(c) /= 0._r8) then - this%any_changes(clump_index) = .true. - end if - end do - - end subroutine set_new_weights - - !----------------------------------------------------------------------- - subroutine update_column_state_no_special_handling(this, bounds, clump_index, & - var, fractional_area_old, fractional_area_new, adjustment) - ! - ! !DESCRIPTION: - ! Adjust the values of a column-level state variable due to changes in subgrid - ! weights. - ! - ! This method does no special handling of any columns. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer, intent(in) :: clump_index - - real(r8), intent(inout) :: var( bounds%begc: ) ! column-level variable - - ! Fraction of each column over which the state variable applies. See module-level - ! documentation for details. You must provide both old & new fractional areas, or - ! neither: it is invalid to provide just one. Fractional areas should be valid for all - ! columns, and fractional_area_new should have been computed based on a call to - ! update_column_state_no_special_handling: code that works with these fractional areas - ! is not able to do any special handling. - real(r8), optional, intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), optional, intent(in) :: fractional_area_new( bounds%begc: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(out) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - real(r8) :: vals_input(bounds%begc:bounds%endc) - logical :: vals_input_valid(bounds%begc:bounds%endc) - logical :: has_prognostic_state(bounds%begc:bounds%endc) - real(r8) :: non_conserved_mass(bounds%begg:bounds%endg) - character(len=:), allocatable :: err_msg - real(r8), parameter :: conservation_tolerance = 1.e-12_r8 - - character(len=*), parameter :: subname = 'update_column_state_no_special_handling' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(var) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - ! Even if there's no work to be done, need to zero out adjustment, since it's - ! intent(out), and caller may expect it to return in a reasonable state. - if (present(adjustment)) then - SHR_ASSERT_ALL((ubound(adjustment) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - adjustment(bounds%begc:bounds%endc) = 0._r8 - end if - - if (this%any_changes(clump_index)) then - - vals_input(bounds%begc:bounds%endc) = var(bounds%begc:bounds%endc) - vals_input_valid(bounds%begc:bounds%endc) = .true. - has_prognostic_state(bounds%begc:bounds%endc) = .true. - non_conserved_mass(bounds%begg:bounds%endg) = 0._r8 - - ! explicit bounds not needed on any of these arguments - and specifying explicit - ! bounds defeats some later bounds checking (for fractional_area_old and - ! fractional_area_new) - call this%update_column_state_with_optional_fractions(& - bounds = bounds, & - vals_input = vals_input, & - vals_input_valid = vals_input_valid, & - has_prognostic_state = has_prognostic_state, & - var = var, & - non_conserved_mass = non_conserved_mass, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - ! Since there is no special handling in this routine, the non_conserved_mass variable - ! should not have any accumulation. We allow for roundoff-level accumulation in case - ! non-conserved mass is determined in a way that is prone to roundoff-level errors. - err_msg = subname//': ERROR: failure to conserve mass when using no special handling' - SHR_ASSERT_ALL(abs(non_conserved_mass(bounds%begg:bounds%endg)) < conservation_tolerance, err_msg) - - end if - - end subroutine update_column_state_no_special_handling - - !----------------------------------------------------------------------- - subroutine update_column_state_fill_special_using_natveg(this, bounds, clump_index, & - var, non_conserved_mass_grc, fractional_area_old, fractional_area_new, adjustment) - ! - ! !DESCRIPTION: - ! Adjust the values of a column-level state variable due to changes in subgrid - ! weights. - ! - ! In this method, any shrinking column on a special landunit contributes state equal - ! to the first natural vegetation column on its grid cell. - ! - ! For the sake of determining non-conserved mass, special landunits are treated as - ! having a value of 0 - i.e., any non-zero quantity in var(c) (for c in a special - ! landunit) is ignored. Thus, even though a shrinking special column can contribute a - ! non-zero value, this non-zero state is treated as having been created out of thin - ! air for conservation-tracking purposes. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer, intent(in) :: clump_index - - real(r8) , intent(inout) :: var( bounds%begc: ) ! column-level variable - - ! Mass lost (per unit of grid cell area) from each grid cell due to changing area of - ! special landunits. When a special landunit grows, it throws away all mass that would - ! be added to it; when a special landunit shrinks, it pulls some virtual mass out of - ! thin air (as given by the quantity in the vegetated column in that grid cell); this - ! variable accounts for both of these cases. Positive denotes mass lost from the grid - ! cell, negative denotes mass gained by the grid cell. Note that this accumulates on - ! top of whatever value is already present in this array: the caller must zero this - ! out appropriately. - real(r8) , intent(inout) :: non_conserved_mass_grc( bounds%begg: ) - - ! Fraction of each column over which the state variable applies. See module-level - ! documentation for details. You must provide both old & new fractional areas, or - ! neither: it is invalid to provide just one. Fractional areas should be valid for all - ! columns, and fractional_area_new should have been computed based on a call to - ! update_column_state_no_special_handling: code that works with these fractional areas - ! is not able to do any special handling. - real(r8), optional, intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), optional, intent(in) :: fractional_area_new( bounds%begc: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(out) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: c, l - integer :: template_col - real(r8) :: vals_input(bounds%begc:bounds%endc) - logical :: vals_input_valid(bounds%begc:bounds%endc) - logical :: has_prognostic_state(bounds%begc:bounds%endc) - - character(len=*), parameter :: subname = 'update_column_state_fill_special_using_natveg' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(var) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(non_conserved_mass_grc) == (/bounds%begg/)), errMsg(sourcefile, __LINE__)) - - ! Even if there's no work to be done, need to zero out adjustment, since it's - ! intent(out), and caller may expect it to return in a reasonable state. - if (present(adjustment)) then - SHR_ASSERT_ALL((ubound(adjustment) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - adjustment(bounds%begc:bounds%endc) = 0._r8 - end if - - if (this%any_changes(clump_index)) then - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - has_prognostic_state(c) = .false. - - template_col = this%natveg_template_col(c) - if (template_col == TEMPLATE_NONE_FOUND) then - vals_input(c) = spval - vals_input_valid(c) = .false. - else - vals_input(c) = var(template_col) - vals_input_valid(c) = .true. - end if - else - has_prognostic_state(c) = .true. - vals_input(c) = var(c) - vals_input_valid(c) = .true. - end if - end do - - ! explicit bounds not needed on any of these arguments - and specifying explicit - ! bounds defeats some later bounds checking (for fractional_area_old and - ! fractional_area_new) - call this%update_column_state_with_optional_fractions(& - bounds = bounds, & - vals_input = vals_input, & - vals_input_valid = vals_input_valid, & - has_prognostic_state = has_prognostic_state, & - var = var, & - non_conserved_mass = non_conserved_mass_grc, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - end if - - end subroutine update_column_state_fill_special_using_natveg - - !----------------------------------------------------------------------- - subroutine update_column_state_fill_using_fixed_values(this, bounds, clump_index, & - var, & - landunit_values, non_conserved_mass_grc, & - fractional_area_old, fractional_area_new, & - adjustment) - ! - ! !DESCRIPTION: - ! Adjust the values of a column-level state variable due to changes in subgrid - ! weights. - ! - ! In this method, any column in landunit type i is assumed to have state equal to - ! landunit_values(i). This is used when such a column is shrinking. However, if - ! landunit_values(i) is FILLVAL_USE_EXISTING_VALUE, then columns in landunit type i - ! keep their existing value in the state variable (var). - ! - ! Landunits with landunit_values(i) = FILLVAL_USE_EXISTING_VALUE can accept mass, - ! others cannot. - ! - ! For example: If landunit_values(istwet) = 30, then any shrinking wetland column - ! provides a mass-per-unit-area of 30 for this state variable, and growing wetland - ! columns cannot except mass. On the other hand, if landunit_values(istwet) = - ! FILLVAL_USE_EXISTING_VALUE, then shrinking wetland columns provide a - ! mass-per-unit-area equal to var for the given column, and growing wetland columns - ! can accept mass for this state variable. - ! - ! For the sake of determining non-conserved mass, specially-treated landunits (those - ! with landunit_values(i) /= FILLVAL_USE_EXISTING_VALUE) are treated as having a value - ! of 0 - i.e., any non-zero quantity in var(c) (for c in a specially-treated landunit) - ! is ignored. Thus, even though a shrinking special column can contribute a - ! non-zero value, this non-zero state is treated as having been created out of thin - ! air for conservation-tracking purposes. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer, intent(in) :: clump_index - - real(r8) , intent(inout) :: var( bounds%begc: ) ! column-level variable - real(r8) , intent(in) :: landunit_values(:) ! value to use as input for each landunit type - - ! Mass lost (per unit of grid cell area) from each grid cell due to changing area of - ! specially-treated landunits - any landunit with landunit_values(i) /= - ! FILLVAL_USE_EXISTING_VALUE. When a specially-treated landunit grows, it throws away - ! all mass that would be added to it; when a specially-treated landunit shrinks, it - ! pulls some virtual mass out of thin air (as given by landunit_values); this variable - ! accounts for both of these cases. Positive denotes mass lost from the grid cell, - ! negative denotes mass gained by the grid cell. Note that this accumulates on top of - ! whatever value is already present in this array: the caller must zero this out - ! appropriately. - real(r8) , intent(inout) :: non_conserved_mass_grc( bounds%begg: ) - - ! Fraction of each column over which the state variable applies. See module-level - ! documentation for details. You must provide both old & new fractional areas, or - ! neither: it is invalid to provide just one. Fractional areas should be valid for all - ! columns, and fractional_area_new should have been computed based on a call to - ! update_column_state_no_special_handling: code that works with these fractional areas - ! is not able to do any special handling. - real(r8), optional, intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), optional, intent(in) :: fractional_area_new( bounds%begc: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(out) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - character(len=:), allocatable :: err_msg - integer :: c, l - integer :: ltype - real(r8) :: my_fillval - real(r8) :: vals_input(bounds%begc:bounds%endc) - logical :: vals_input_valid(bounds%begc:bounds%endc) - logical :: has_prognostic_state(bounds%begc:bounds%endc) - - character(len=*), parameter :: subname = 'update_column_state_fill_using_fixed_values' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(var) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - err_msg = subname//': must provide values for all landunits' - SHR_ASSERT((size(landunit_values) == max_lunit), err_msg) - SHR_ASSERT_ALL((ubound(non_conserved_mass_grc) == (/bounds%begg/)), errMsg(sourcefile, __LINE__)) - - ! Even if there's no work to be done, need to zero out adjustment, since it's - ! intent(out), and caller may expect it to return in a reasonable state. - if (present(adjustment)) then - SHR_ASSERT_ALL((ubound(adjustment) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - adjustment(bounds%begc:bounds%endc) = 0._r8 - end if - - if (this%any_changes(clump_index)) then - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - ltype = lun%itype(l) - my_fillval = landunit_values(ltype) - - if (my_fillval == FILLVAL_USE_EXISTING_VALUE) then - vals_input(c) = var(c) - vals_input_valid(c) = .true. - has_prognostic_state(c) = .true. - else - vals_input(c) = my_fillval - vals_input_valid(c) = .true. - has_prognostic_state(c) = .false. - end if - end do - - ! explicit bounds not needed on any of these arguments - and specifying explicit - ! bounds defeats some later bounds checking (for fractional_area_old and - ! fractional_area_new) - call this%update_column_state_with_optional_fractions( & - bounds = bounds, & - vals_input = vals_input, & - vals_input_valid = vals_input_valid, & - has_prognostic_state = has_prognostic_state, & - var = var, & - non_conserved_mass = non_conserved_mass_grc, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - end if - - end subroutine update_column_state_fill_using_fixed_values - - !----------------------------------------------------------------------- - subroutine update_column_state_fill_special_using_fixed_value(this, bounds, clump_index, & - var, & - special_value, non_conserved_mass_grc, & - fractional_area_old, fractional_area_new, & - adjustment) - ! - ! !DESCRIPTION: - ! Adjust the values of a column-level state variable due to changes in subgrid - ! weights. - ! - ! This method is a convenience wrapper to the more general - ! update_column_state_fill_using_fixed_values. In this method, vegetated (non-special) - ! landunits are handled normally (i.e., given FILLVAL_USE_EXISTING_VALUE), and all - ! special landunits contribute the same fixed value. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer, intent(in) :: clump_index - - real(r8) , intent(inout) :: var( bounds%begc: ) ! column-level variable - real(r8) , intent(in) :: special_value ! value to use as input for all special landunits - - ! Mass lost (per unit of grid cell area) from each grid cell due to changing area of - ! special landunits. When a special landunit grows, it throws away all mass that would - ! be added to it; when a special landunit shrinks, it pulls some virtual mass out of - ! thin air (as given by the quantity in the vegetated column in that grid cell); this - ! variable accounts for both of these cases. Positive denotes mass lost from the grid - ! cell, negative denotes mass gained by the grid cell. Note that this accumulates on - ! top of whatever value is already present in this array: the caller must zero this - ! out appropriately. - real(r8) , intent(inout) :: non_conserved_mass_grc( bounds%begg: ) - - ! Fraction of each column over which the state variable applies. See module-level - ! documentation for details. You must provide both old & new fractional areas, or - ! neither: it is invalid to provide just one. Fractional areas should be valid for all - ! columns, and fractional_area_new should have been computed based on a call to - ! update_column_state_no_special_handling: code that works with these fractional areas - ! is not able to do any special handling. - real(r8), optional, intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), optional, intent(in) :: fractional_area_new( bounds%begc: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(out) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - real(r8) :: landunit_values(max_lunit) - integer :: ltype - - character(len=*), parameter :: subname = 'update_column_state_fill_special_using_fixed_value' - !----------------------------------------------------------------------- - - do ltype = 1, max_lunit - if (landunit_is_special(ltype)) then - landunit_values(ltype) = special_value - else - landunit_values(ltype) = FILLVAL_USE_EXISTING_VALUE - end if - end do - - call this%update_column_state_fill_using_fixed_values( & - bounds = bounds, & - clump_index = clump_index, & - var = var, & - landunit_values = landunit_values, & - non_conserved_mass_grc = non_conserved_mass_grc, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - end subroutine update_column_state_fill_special_using_fixed_value - - - - ! ======================================================================== - ! Private methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine update_column_state_with_optional_fractions(this, bounds, & - vals_input, vals_input_valid, has_prognostic_state, & - var, non_conserved_mass, & - fractional_area_old, fractional_area_new, & - adjustment) - ! - ! !DESCRIPTION: - ! Intermediate routine between the public routines and the real work routine - ! (update_column_state). This routine determines the fractional areas to use in the - ! call to update_column_state, and then does the call to update_column_state. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - - ! value used as input for each column, if that column is shrinking (can differ from - ! var if we're doing special handling of that column) - real(r8), intent(in) :: vals_input( bounds%begc: ) - - ! whether each item in vals_input_valid is valid. An entry can be invalid if there is - ! was no way to derive an input for that column. - logical, intent(in) :: vals_input_valid( bounds%begc: ) - - ! whether each column simulates the given variable (which, among other things, - ! determines whether it can accept mass of this variable) - logical, intent(in) :: has_prognostic_state( bounds%begc: ) - - ! column-level variable of interest, updated in-place - real(r8), intent(inout) :: var( bounds%begc: ) - - ! mass lost (per unit of grid cell area) from each grid cell, if doing special - ! handling that leads mass to not be conserved; this can happen due to growing columns - ! where has_prognostic_state is false, or due to shrinking columns where - ! has_prognostic_state is false but vals_input /= 0. Positive denotes mass lost from - ! the grid cell, negative denotes mass gained by the grid cell. - real(r8), intent(inout) :: non_conserved_mass( bounds%begg: ) - - ! Fraction of each column over which the state variable applies. See module-level - ! documentation for details. You must provide both old & new fractional areas, or - ! neither: it is invalid to provide just one. Fractional areas should be valid for all - ! columns, and fractional_area_new should have been computed based on a call to - ! update_column_state_no_special_handling: code that works with these fractional areas - ! is not able to do any special handling. - real(r8), optional, intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), optional, intent(in) :: fractional_area_new( bounds%begc: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(inout) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - real(r8) :: my_fractional_area_old(bounds%begc:bounds%endc) - real(r8) :: my_fractional_area_new(bounds%begc:bounds%endc) - - character(len=*), parameter :: subname = 'update_column_state_with_optional_fractions' - !----------------------------------------------------------------------- - - if (present(fractional_area_old) .and. .not. present(fractional_area_new)) then - call endrun(subname//' ERROR: If fractional_area_old is provided, then fractional_area_new must be provided, too') - end if - - if (present(fractional_area_new) .and. .not. present(fractional_area_old)) then - call endrun(subname//' ERROR: If fractional_area_new is provided, then fractional_area_old must be provided, too') - end if - - if (present(fractional_area_old)) then - SHR_ASSERT_ALL((ubound(fractional_area_old) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - my_fractional_area_old(bounds%begc:bounds%endc) = fractional_area_old(bounds%begc:bounds%endc) - else - my_fractional_area_old(bounds%begc:bounds%endc) = 1._r8 - end if - - if (present(fractional_area_new)) then - SHR_ASSERT_ALL((ubound(fractional_area_new) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - my_fractional_area_new(bounds%begc:bounds%endc) = fractional_area_new(bounds%begc:bounds%endc) - else - my_fractional_area_new(bounds%begc:bounds%endc) = 1._r8 - end if - - call this%update_column_state(& - bounds = bounds, & - vals_input = vals_input(bounds%begc:bounds%endc), & - vals_input_valid = vals_input_valid(bounds%begc:bounds%endc), & - has_prognostic_state = has_prognostic_state(bounds%begc:bounds%endc), & - fractional_area_old = my_fractional_area_old(bounds%begc:bounds%endc), & - fractional_area_new = my_fractional_area_new(bounds%begc:bounds%endc), & - var = var(bounds%begc:bounds%endc), & - non_conserved_mass = non_conserved_mass(bounds%begg:bounds%endg), & - adjustment = adjustment) - - end subroutine update_column_state_with_optional_fractions - - - !----------------------------------------------------------------------- - subroutine update_column_state(this, bounds, & - vals_input, vals_input_valid, has_prognostic_state, & - fractional_area_old, fractional_area_new, & - var, non_conserved_mass, adjustment) - ! - ! !DESCRIPTION: - ! Do the work of updating a column-level state variable due to changes in subgrid - ! weights. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(column_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - - ! value used as input for each column, if that column is shrinking (can differ from - ! var if we're doing special handling of that column) - real(r8), intent(in) :: vals_input( bounds%begc: ) - - ! whether each item in vals_input_valid is valid. An entry can be invalid if there is - ! was no way to derive an input for that column. - logical, intent(in) :: vals_input_valid( bounds%begc: ) - - ! whether each column simulates the given variable (which, among other things, - ! determines whether it can accept mass of this variable) - logical, intent(in) :: has_prognostic_state( bounds%begc: ) - - ! Fraction of each column over which the state variable applies, for both the old and - ! new subgrid weights - real(r8), intent(in) :: fractional_area_old( bounds%begc: ) - real(r8), intent(in) :: fractional_area_new( bounds%begc: ) - - ! column-level variable of interest, updated in-place - real(r8), intent(inout) :: var( bounds%begc: ) - - ! mass lost (per unit of grid cell area) from each grid cell, if doing special - ! handling that leads mass to not be conserved; this can happen due to growing columns - ! where has_prognostic_state is false, or due to shrinking columns where - ! has_prognostic_state is false but vals_input /= 0. Positive denotes mass lost from - ! the grid cell, negative denotes mass gained by the grid cell. - real(r8), intent(inout) :: non_conserved_mass( bounds%begg: ) - - ! Apparent state adjustment in each column - real(r8), optional, intent(inout) :: adjustment( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: c, g - - ! whether vals_input /= var in the columns where it should be equal - logical :: bad_vals_input(bounds%begc:bounds%endc) - - ! fractional area lost from this column - real(r8) :: area_lost - - ! area-weighted amount lost from a given column - real(r8) :: area_weighted_loss - - ! area-weighted amount lost from decreasing weights, in each grid cell - ! ((mass-per-unit-area) * (fractional area lost)) - real(r8) :: total_loss_grc(bounds%begg:bounds%endg) - - ! total area lost by columns decreasing in area (fractional area of grid cell) - ! Note that this should exactly equal the total area gained by columns increasing in area - real(r8) :: total_area_lost_grc(bounds%begg:bounds%endg) - - ! amount of state gain needed per unit area of area gained - real(r8) :: gain_per_unit_area_grc(bounds%begg:bounds%endg) - - ! mass gained by a given column ((mass-gained-per-unit-area) * (fractional area gained)) - real(r8) :: mass_gained - - ! value in a column before update - real(r8) :: val_old - - character(len=:), allocatable :: message - - character(len=*), parameter :: subname = 'update_column_state' - !----------------------------------------------------------------------- - - ! ------------------------------------------------------------------------ - ! Error-checking on inputs - ! ------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(var) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(vals_input) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(has_prognostic_state) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fractional_area_old) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(fractional_area_new) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(non_conserved_mass) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - if (present(adjustment)) then - SHR_ASSERT_ALL((ubound(adjustment) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - end if - - ! For the sake of conservation - including the calculation of non_conserved_mass - we - ! assume that vals_input == var wherever has_prognostic_state is .true. We ensure that - ! is the case here. - where(has_prognostic_state .and. vals_input_valid) - bad_vals_input = (vals_input /= var) - elsewhere - ! where has_prognostic_state is false, vals_input can be anything - bad_vals_input = .false. - end where - message = subname//': ERROR: where has_prognostic_state is true, vals_input must equal var' - SHR_ASSERT_ALL(.not. bad_vals_input, message) - - ! ------------------------------------------------------------------------ - ! Begin main work - ! ------------------------------------------------------------------------ - - ! Determine the total mass loss for each grid cell, along with the gross area loss - ! (which should match the gross area gain) - total_loss_grc(bounds%begg:bounds%endg) = 0._r8 - total_area_lost_grc(bounds%begg:bounds%endg) = 0._r8 - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - if (this%area_gained_col(c) < 0._r8) then - if (.not. vals_input_valid(c)) then - write(iulog,*) subname//' ERROR: shrinking column without valid input value' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - area_lost = -1._r8 * this%area_gained_col(c) - total_area_lost_grc(g) = total_area_lost_grc(g) + area_lost - area_weighted_loss = area_lost * vals_input(c) * fractional_area_old(c) - total_loss_grc(g) = total_loss_grc(g) + area_weighted_loss - - if (.not. has_prognostic_state(c)) then - ! If a column doesn't model this state variable, then its vals_input value is - ! really some fictitious quantity. So we track how much of this fictitious - ! quantity we added to the system. - non_conserved_mass(g) = non_conserved_mass(g) - area_weighted_loss - end if - end if - end do - - ! Determine the mass loss per unit area for each grid cell. We essentially lump all of - ! the loss together in a "loss" pool in each grid cell, so that we can then - ! distribute that loss amongst the growing columns. - do g = bounds%begg, bounds%endg - if (total_area_lost_grc(g) > 0._r8) then - gain_per_unit_area_grc(g) = total_loss_grc(g) / total_area_lost_grc(g) - else - gain_per_unit_area_grc(g) = 0._r8 - end if - end do - - ! Distribute gain to growing columns - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - if (this%area_gained_col(c) > 0._r8) then - mass_gained = this%area_gained_col(c) * gain_per_unit_area_grc(g) - if (has_prognostic_state(c)) then - val_old = var(c) - - ! Need to make sure fractional_area_new /= 0 to avoid divide-by-zero. Note - ! that fractional_area_new == 0 can only happen if both - ! fractional_area_old(c) == 0 and the fractional_areas of the shrinking - ! columns were all 0 - in which case the value of var is irrelevant for - ! conservation purposes. - if (fractional_area_new(c) /= 0._r8) then - var(c) = (this%cwtgcell_old(c) * var(c) * fractional_area_old(c) + mass_gained) / & - (this%cwtgcell_new(c) * fractional_area_new(c)) - end if - - if (present(adjustment)) then - adjustment(c) = var(c) * fractional_area_new(c) - & - val_old * fractional_area_old(c) - end if - else - non_conserved_mass(g) = non_conserved_mass(g) + mass_gained - end if - end if - end do - - end subroutine update_column_state - -end module dynColumnStateUpdaterMod diff --git a/src/dyn_subgrid/dynColumnTemplateMod.F90 b/src/dyn_subgrid/dynColumnTemplateMod.F90 deleted file mode 100644 index 7ac2921e8b..0000000000 --- a/src/dyn_subgrid/dynColumnTemplateMod.F90 +++ /dev/null @@ -1,168 +0,0 @@ -module dynColumnTemplateMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Routines for finding a template column to use for the state variables on some other - ! column of interest. - ! - ! For example, if a glacier column (with no carbon/nitrogen information) shrinks, and we - ! want to assume that its carbon and nitrogen state implicitly matches the state of the - ! vegetated landunit in that grid cell, then we can use a routine in this module to find - ! that vegetated lanadunit. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use clm_varcon , only : ispval - - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - - ! ------------------------------------------------------------------------ - ! Functions that operate on a single column at a time - ! ------------------------------------------------------------------------ - - ! Find column to use as template by looking for an active column on a particular landunit - public :: template_col_from_landunit - - ! ------------------------------------------------------------------------ - ! Subroutines that operate on the whole column-level array at once - ! ------------------------------------------------------------------------ - - ! Find column to use as template by looking for an active column on the natural veg landunit - public :: template_col_from_natveg_array - - ! - ! !PUBLIC VARIABLES: - - ! if no template column was found, this value is returned - integer, parameter, public :: TEMPLATE_NONE_FOUND = ispval - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ------------------------------------------------------------------------ - ! Functions that operate on a single column at a time - ! ------------------------------------------------------------------------ - - !----------------------------------------------------------------------- - function template_col_from_landunit(bounds, c_target, landunit_type, cactive) result(c_template) - ! - ! !DESCRIPTION: - ! Finds a column to serve as a template for the state variables on the target column. - ! - ! Looks for a landunit of the type given by landunit_type (e.g., istsoil, - ! istcrop). Looks for the first active column on this landunit type, in the same grid - ! cell; order of columns within a landunit is arbitrary (given by their order in - ! memory). Returns the column index of the first such column found. If there are no - ! active columns in this landunit in this grid cell, returns TEMPLATE_NONE_FOUND. - ! - ! Note that it is often most appropriate for cactive to be the active flags from the - ! *prior* time step, so that we don't identify a point that just became active for the - ! first time in this time step. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: c_template ! function return value - - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: c_target ! column index for which we want a template - integer , intent(in) :: landunit_type ! landunit type from which we want to find a template column (e.g., istsoil) - logical , intent(in) :: cactive( bounds%begc: ) ! column-level active flags (generally from prior time step) - ! - ! !LOCAL VARIABLES: - logical :: found ! whether a suitable template column has been found - integer :: g,l,c ! indices of grid cell, landunit, column - - character(len=*), parameter :: subname = 'template_col_from_landunit' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cactive) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - found = .false. - g = col%gridcell(c_target) - l = grc%landunit_indices(landunit_type, g) - - ! If this landunit exists on this grid cell... - if (l /= ispval) then - - ! Loop through columns on this landunit; stop if as soon as we find an active - ! column: that will serve as the template - c = lun%coli(l) - do while (.not. found .and. c <= lun%colf(l)) - if (cactive(c)) then - found = .true. - else - c = c + 1 - end if - end do - end if - - if (found) then - c_template = c - else - c_template = TEMPLATE_NONE_FOUND - end if - - end function template_col_from_landunit - - ! ------------------------------------------------------------------------ - ! Subroutines that operate on the whole column-level array at once - ! ------------------------------------------------------------------------ - - !----------------------------------------------------------------------- - subroutine template_col_from_natveg_array(bounds, cactive, c_templates) - ! - ! !DESCRIPTION: - ! For each column, finds a column to serve as a template for the state variables on - ! the target column. - ! - ! For each column: Looks for the first active column on the natural veg landunit in - ! the same grid cell as the target column. If there are no active columns in the - ! natural veg landunit in this grid cell, assigns TEMPLATE_NONE_FOUND. - ! - ! Note: If there are multiple columns on the natural veg. landunit, then a given - ! natural veg column may have a template col that differs from itself! The caller is - ! responsible for determining when this template column should be used and when it - ! should not be used. - ! - ! See also the notes about cactive under 'template_col_from_landunit'. - ! - ! !USES: - use landunit_varcon, only : istsoil - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - logical , intent(in) :: cactive( bounds%begc: ) ! column-level active flags (generally from prior time step) - integer , intent(out) :: c_templates( bounds%begc: ) ! template column for each column - ! - ! !LOCAL VARIABLES: - integer :: c - - character(len=*), parameter :: subname = 'template_col_from_natveg_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cactive) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(c_templates) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do c = bounds%begc, bounds%endc - c_templates(c) = template_col_from_landunit(bounds, c, istsoil, & - cactive(bounds%begc:bounds%endc)) - end do - - end subroutine template_col_from_natveg_array - - - -end module dynColumnTemplateMod diff --git a/src/dyn_subgrid/dynConsBiogeophysMod.F90 b/src/dyn_subgrid/dynConsBiogeophysMod.F90 deleted file mode 100644 index 540a3321ed..0000000000 --- a/src/dyn_subgrid/dynConsBiogeophysMod.F90 +++ /dev/null @@ -1,337 +0,0 @@ -module dynConsBiogeophysMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Handle conservation of biogeophysical quantities (water & energy) with dynamic land - ! cover. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use UrbanParamsType , only : urbanparams_type - use EnergyFluxType , only : energyflux_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use TemperatureType , only : temperature_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use TotalWaterAndHeatMod, only : ComputeLiqIceMassNonLake, ComputeLiqIceMassLake - use TotalWaterAndHeatMod, only : ComputeHeatNonLake, ComputeHeatLake - use TotalWaterAndHeatMod, only : AdjustDeltaHeatForDeltaLiq - use TotalWaterAndHeatMod, only : heat_base_temp - use subgridAveMod , only : p2c, c2g - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use clm_varcon , only : tfrz, cpliq, hfus - use dynSubgridControlMod, only : get_for_testing_zero_dynbal_fluxes - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dyn_hwcontent_init ! compute grid-level heat and water content, before land cover change - public :: dyn_hwcontent_final ! compute grid-level heat and water content, after land cover change; also compute dynbal fluxes - ! - ! !PRIVATE MEMBER FUNCTIONS - private :: dyn_water_content ! compute gridcell total liquid and ice water contents - private :: dyn_heat_content ! compute gridcell total heat contents - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !--------------------------------------------------------------------------- - -contains - - !--------------------------------------------------------------------------- - subroutine dyn_hwcontent_init(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst) - ! - ! !DESCRIPTION: - ! Initialize variables used for dyn_hwcontent, and compute grid cell-level heat - ! and water content before land cover change - ! - ! Should be called BEFORE any subgrid weight updates this time step - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - integer , intent(in) :: num_lakec - integer , intent(in) :: filter_lakec(:) - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - - !------------------------------------------------------------------------------- - - call dyn_water_content(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - soilhydrology_inst, waterstate_inst, & - liquid_mass = waterstate_inst%liq1_grc(bounds%begg:bounds%endg), & - ice_mass = waterstate_inst%ice1_grc(bounds%begg:bounds%endg)) - - call dyn_heat_content( bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - temperature_inst, waterstate_inst, & - heat_grc = temperature_inst%heat1_grc(bounds%begg:bounds%endg), & - liquid_water_temp_grc = temperature_inst%liquid_water_temp1_grc(bounds%begg:bounds%endg)) - - end subroutine dyn_hwcontent_init - - !--------------------------------------------------------------------------- - subroutine dyn_hwcontent_final(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst) - ! - ! !DESCRIPTION: - ! Compute grid cell-level heat and water content after land cover change, and compute - ! the dynbal fluxes - ! - ! Should be called AFTER all subgrid weight updates this time step - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - integer , intent(in) :: num_lakec - integer , intent(in) :: filter_lakec(:) - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: begg, endg - integer :: g ! grid cell index - real(r8) :: delta_liq(bounds%begg:bounds%endg) ! change in gridcell h2o liq content - real(r8) :: delta_ice(bounds%begg:bounds%endg) ! change in gridcell h2o ice content - real(r8) :: delta_heat(bounds%begg:bounds%endg) ! change in gridcell heat content - !--------------------------------------------------------------------------- - - begg = bounds%begg - endg = bounds%endg - - call dyn_water_content(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - soilhydrology_inst, waterstate_inst, & - liquid_mass = waterstate_inst%liq2_grc(bounds%begg:bounds%endg), & - ice_mass = waterstate_inst%ice2_grc(bounds%begg:bounds%endg)) - - call dyn_heat_content( bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - temperature_inst, waterstate_inst, & - heat_grc = temperature_inst%heat2_grc(bounds%begg:bounds%endg), & - liquid_water_temp_grc = temperature_inst%liquid_water_temp2_grc(bounds%begg:bounds%endg)) - - if (get_for_testing_zero_dynbal_fluxes()) then - do g = begg, endg - delta_liq(g) = 0._r8 - delta_ice(g) = 0._r8 - delta_heat(g) = 0._r8 - end do - else - do g = begg, endg - delta_liq(g) = waterstate_inst%liq2_grc(g) - waterstate_inst%liq1_grc(g) - delta_ice(g) = waterstate_inst%ice2_grc(g) - waterstate_inst%ice1_grc(g) - delta_heat(g) = temperature_inst%heat2_grc(g) - temperature_inst%heat1_grc(g) - end do - end if - - call AdjustDeltaHeatForDeltaLiq( & - bounds, & - delta_liq = delta_liq(bounds%begg:bounds%endg), & - liquid_water_temp1 = temperature_inst%liquid_water_temp1_grc(bounds%begg:bounds%endg), & - liquid_water_temp2 = temperature_inst%liquid_water_temp2_grc(bounds%begg:bounds%endg), & - delta_heat = delta_heat(bounds%begg:bounds%endg)) - - call waterflux_inst%qflx_liq_dynbal_dribbler%set_curr_delta(bounds, & - delta_liq(begg:endg)) - call waterflux_inst%qflx_liq_dynbal_dribbler%get_curr_flux(bounds, & - waterflux_inst%qflx_liq_dynbal_grc(begg:endg)) - - call waterflux_inst%qflx_ice_dynbal_dribbler%set_curr_delta(bounds, & - delta_ice(begg:endg)) - call waterflux_inst%qflx_ice_dynbal_dribbler%get_curr_flux(bounds, & - waterflux_inst%qflx_ice_dynbal_grc(begg:endg)) - - call energyflux_inst%eflx_dynbal_dribbler%set_curr_delta(bounds, & - delta_heat(begg:endg)) - call energyflux_inst%eflx_dynbal_dribbler%get_curr_flux(bounds, & - energyflux_inst%eflx_dynbal_grc(begg:endg)) - - end subroutine dyn_hwcontent_final - - !----------------------------------------------------------------------- - subroutine dyn_water_content(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - soilhydrology_inst, waterstate_inst, & - liquid_mass, ice_mass) - ! - ! !DESCRIPTION: - ! Compute gridcell total liquid and ice water contents - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - integer , intent(in) :: num_lakec - integer , intent(in) :: filter_lakec(:) - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterstate_type) , intent(in) :: waterstate_inst - real(r8) , intent(out) :: liquid_mass( bounds%begg: ) ! kg m-2 - real(r8) , intent(out) :: ice_mass( bounds%begg: ) ! kg m-2 - ! - ! !LOCAL VARIABLES: - real(r8) :: liquid_mass_col(bounds%begc:bounds%endc) ! kg m-2 - real(r8) :: ice_mass_col(bounds%begc:bounds%endc) ! kg m-2 - - character(len=*), parameter :: subname = 'dyn_water_content' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(liquid_mass) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(ice_mass) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call ComputeLiqIceMassNonLake(bounds, num_nolakec, filter_nolakec, & - soilhydrology_inst, waterstate_inst, & - liquid_mass_col(bounds%begc:bounds%endc), & - ice_mass_col(bounds%begc:bounds%endc)) - - call ComputeLiqIceMassLake(bounds, num_lakec, filter_lakec, & - waterstate_inst, & - liquid_mass_col(bounds%begc:bounds%endc), & - ice_mass_col(bounds%begc:bounds%endc)) - - call c2g(bounds, & - carr = liquid_mass_col(bounds%begc:bounds%endc), & - garr = liquid_mass(bounds%begg:bounds%endg), & - c2l_scale_type = 'urbanf', & - l2g_scale_type = 'unity') - - call c2g(bounds, & - carr = ice_mass_col(bounds%begc:bounds%endc), & - garr = ice_mass(bounds%begg:bounds%endg), & - c2l_scale_type = 'urbanf', & - l2g_scale_type = 'unity') - - end subroutine dyn_water_content - - - !--------------------------------------------------------------------------- - subroutine dyn_heat_content(bounds, & - num_nolakec, filter_nolakec, & - num_lakec, filter_lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - temperature_inst, waterstate_inst, & - heat_grc, liquid_water_temp_grc) - - ! !DESCRIPTION: - ! Compute grid-level heat and water content to track conservation with respect to - ! dynamic land cover. - ! - ! Heat content is computed relative to a baseline of 0 C. So temperatures above 0 C - ! lead to a positive heat content, temperatures below 0 C lead to a negative heat - ! content. For water, the baseline is considered to be ice at 0 C, so for liquid water - ! we include the latent heat of fusion. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec - integer , intent(in) :: filter_nolakec(:) - integer , intent(in) :: num_lakec - integer , intent(in) :: filter_lakec(:) - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(temperature_type) , intent(in) :: temperature_inst - type(waterstate_type) , intent(in) :: waterstate_inst - - real(r8) , intent(out) :: heat_grc( bounds%begg: ) ! total heat content for each grid cell [J/m^2] - real(r8) , intent(out) :: liquid_water_temp_grc( bounds%begg: ) ! weighted average liquid water temperature for each grid cell (K) - - ! - ! !LOCAL VARIABLES: - integer :: g - - real(r8) :: heat_col(bounds%begc:bounds%endc) ! sum of heat content for all columns [J/m^2] - real(r8) :: heat_liquid_col(bounds%begc:bounds%endc) ! sum of heat content for all columns: liquid water, excluding latent heat [J/m^2] - real(r8) :: cv_liquid_col(bounds%begc:bounds%endc) ! sum of liquid heat capacity for all columns [J/(m^2 K)] - - real(r8) :: heat_liquid_grc(bounds%begg:bounds%endg) ! heat_liquid_col averaged to grid cell [J/m^2] - real(r8) :: cv_liquid_grc(bounds%begg:bounds%endg) ! cv_liquid_col averaged to grid cell [J/(m^2 K)] - !------------------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(heat_grc) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(liquid_water_temp_grc) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call ComputeHeatNonLake(bounds, num_nolakec, filter_nolakec, & - urbanparams_inst, soilstate_inst, & - temperature_inst, waterstate_inst, soilhydrology_inst, & - heat = heat_col(bounds%begc:bounds%endc), & - heat_liquid = heat_liquid_col(bounds%begc:bounds%endc), & - cv_liquid = cv_liquid_col(bounds%begc:bounds%endc)) - - call ComputeHeatLake(bounds, num_lakec, filter_lakec, & - soilstate_inst, temperature_inst, waterstate_inst, & - heat = heat_col(bounds%begc:bounds%endc), & - heat_liquid = heat_liquid_col(bounds%begc:bounds%endc), & - cv_liquid = cv_liquid_col(bounds%begc:bounds%endc)) - - call c2g(bounds, & - carr = heat_col(bounds%begc:bounds%endc), & - garr = heat_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'urbanf', & - l2g_scale_type = 'unity') - - call c2g(bounds, & - carr = heat_liquid_col(bounds%begc:bounds%endc), & - garr = heat_liquid_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'urbanf', & - l2g_scale_type = 'unity') - - call c2g(bounds, & - carr = cv_liquid_col(bounds%begc:bounds%endc), & - garr = cv_liquid_grc(bounds%begg:bounds%endg), & - c2l_scale_type = 'urbanf', & - l2g_scale_type = 'unity') - - do g = bounds%begg, bounds%endg - if (cv_liquid_grc(g) > 0._r8) then - liquid_water_temp_grc(g) = & - (heat_liquid_grc(g) / cv_liquid_grc(g)) + heat_base_temp - else - ! 0 or negative water mass in this grid cell: set an arbitrary temperature - liquid_water_temp_grc(g) = tfrz - end if - end do - - end subroutine dyn_heat_content - -end module dynConsBiogeophysMod diff --git a/src/dyn_subgrid/dynEDMod.F90 b/src/dyn_subgrid/dynEDMod.F90 deleted file mode 100644 index e1cb1ccb42..0000000000 --- a/src/dyn_subgrid/dynEDMod.F90 +++ /dev/null @@ -1,43 +0,0 @@ -module dynEDMod - - !----------------------------------------------------------------------- - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use landunit_varcon, only : istsoil - use PatchType , only : patch - use ColumnType , only : col - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dyn_ED ! transfers weights calculated internally by fates into wtcol. - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine dyn_ED( bounds ) - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - - ! !LOCAL VARIABLES: - integer :: p,c ! indices - !------------------------------------------------------------------------ - - do p = bounds%begp,bounds%endp - c = patch%column(p) - if (col%itype(c) == istsoil) then - if (patch%is_veg(p) .or. patch%is_bareground(p)) then - patch%wtcol(p) = patch%wt_ed(p) - else - patch%wtcol(p) = 0.0_r8 - end if - end if - end do - - end subroutine dyn_ED - -end module dynEDMod diff --git a/src/dyn_subgrid/dynFileMod.F90 b/src/dyn_subgrid/dynFileMod.F90 deleted file mode 100644 index d7f22f9dcd..0000000000 --- a/src/dyn_subgrid/dynFileMod.F90 +++ /dev/null @@ -1,91 +0,0 @@ -module dynFileMod - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains a derived type that is essentially a file_desc_t, but also adds a - ! time_info_type object. This is used for tracking time information for a single - ! dynamic landuse file. - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use dynTimeInfoMod , only : time_info_type, year_position_type - use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_inqdid, ncd_inqdlen, ncd_io - use abortutils , only : endrun - implicit none - private - ! - ! !PUBLIC TYPES: - public :: dyn_file_type - - type, extends(file_desc_t) :: dyn_file_type - type(time_info_type) :: time_info ! time information for this file - end type dyn_file_type - - interface dyn_file_type - module procedure constructor ! initialize a new dyn_file_type object - end interface dyn_file_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - !----------------------------------------------------------------------- - type(dyn_file_type) function constructor(filename, year_position) - ! - ! !DESCRIPTION: - ! Initialize a dyn_file_type object - ! - ! Opens the file associated with filename for reading, reads the 'YEAR' variable from - ! this file (assumed to have dimension 'time'), and initializes a dyn_time_info object - ! based on this YEAR variable and the current model year. - ! - ! year_position is a flag saying how to obtain the model year relative to the current - ! timestep; it must be one of the parameters defined in dynTimeInfoMod (e.g., - ! YEAR_POSITION_START_OF_TIMESTEP or YEAR_POSITION_END_OF_TIMESTEP) - ! - ! !USES: - use fileutils , only : getfil - ! - ! !ARGUMENTS: - character(len=*) , intent(in) :: filename - type(year_position_type) , intent(in) :: year_position - ! - ! !LOCAL VARIABLES: - character(len=256) :: locfn ! local file name - integer :: ier ! error code - integer :: ntimes ! number of time samples - integer :: varid ! netcdf variable ID - integer, allocatable :: years(:) ! years in the file - - character(len=*), parameter :: subname = 'dyn_file_type constructor' - !----------------------------------------------------------------------- - - ! Obtain file - - call getfil(filename, locfn, 0) - call ncd_pio_openfile(constructor, locfn, 0) - - ! Obtain years - - call ncd_inqdid(constructor, 'time', varid) - call ncd_inqdlen(constructor, varid, ntimes) - allocate(years(ntimes), stat=ier) - if (ier /= 0) then - call endrun(msg=' allocation error for years'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=constructor, varname='YEAR', flag='read', data=years) - - ! Initialize object containing time information for the file - - constructor%time_info = time_info_type(years, year_position) - - deallocate(years) - - end function constructor - -end module dynFileMod diff --git a/src/dyn_subgrid/dynInitColumnsMod.F90 b/src/dyn_subgrid/dynInitColumnsMod.F90 deleted file mode 100644 index a7713f0c80..0000000000 --- a/src/dyn_subgrid/dynInitColumnsMod.F90 +++ /dev/null @@ -1,263 +0,0 @@ -module dynInitColumnsMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Handle initialization of columns that just switched from inactive to active - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : namec - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use SoilHydrologyType , only : soilhydrology_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use dynColumnTemplateMod , only : template_col_from_landunit, TEMPLATE_NONE_FOUND - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - ! The following is the public interface to the routines in this module: - public :: initialize_new_columns ! Do initialization for all columns that are newly-active in this time step - - ! The following are public only for unit testing purposes, and should not be called - ! directly by application code: - public :: initial_template_col_crop ! Find column to use as a template for a crop column that has newly become active - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: initial_template_col_dispatcher ! Find column to use as a template; dispatcher to the appropriate routine based on landunit type - private :: initial_template_col_soil ! Find column to use as a template for a vegetated column that has newly become active - private :: copy_state ! Copy a subset of state variables from template column to newly-active column - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !--------------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine initialize_new_columns(bounds, cactive_prior, & - temperature_inst, waterstate_inst, soilhydrology_inst) - ! - ! !DESCRIPTION: - ! Do initialization for all columns that are newly-active in this time step - ! - ! !USES: - use GetGlobalValuesMod , only : GetGlobalWrite - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - logical , intent(in) :: cactive_prior( bounds%begc: ) ! column-level active flags from prior time step - type(temperature_type) , intent(inout) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - ! - ! !LOCAL VARIABLES: - integer :: c ! column index - integer :: c_template ! index of template column - - character(len=*), parameter :: subname = 'initialize_new_columns' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cactive_prior) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do c = bounds%begc, bounds%endc - ! If this column is newly-active, then we need to initialize it using the routines in this module - if (col%active(c) .and. .not. cactive_prior(c)) then - c_template = initial_template_col_dispatcher(bounds, c, cactive_prior(bounds%begc:bounds%endc)) - if (c_template /= TEMPLATE_NONE_FOUND) then - call copy_state(c, c_template, & - temperature_inst, waterstate_inst, soilhydrology_inst) - else - write(iulog,*) subname// ' WARNING: No template column found to initialize newly-active column' - write(iulog,*) '-- keeping the state that was already in memory, possibly from arbitrary initialization' - call GetGlobalWrite(decomp_index=c, clmlevel=namec) - end if - end if - end do - - end subroutine initialize_new_columns - - - !----------------------------------------------------------------------- - function initial_template_col_dispatcher(bounds, c_new, cactive_prior) result(c_template) - ! - ! !DESCRIPTION: - ! Find column to use as a template for the given column that has newly become active; - ! this is a dispatcher that calls the appropriate routine based on the landunit type of c_new. - ! - ! Returns TEMPLATE_NONE_FOUND if there is no column to use for initialization - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop, istice_mec, istdlak, istwet, isturb_MIN, isturb_MAX - ! - ! !ARGUMENTS: - integer :: c_template ! function result - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: c_new ! column index that needs initialization - logical , intent(in) :: cactive_prior( bounds%begc: ) ! column-level active flags from prior time step - ! - ! !LOCAL VARIABLES: - integer :: l ! landunit index - integer :: ltype ! landunit type - - character(len=*), parameter :: subname = 'initial_template_col_dispatcher' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cactive_prior) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - l = col%landunit(c_new) - ltype = lun%itype(l) - select case(ltype) - case(istsoil) - c_template = initial_template_col_soil(c_new) - case(istcrop) - c_template = initial_template_col_crop(bounds, c_new, cactive_prior(bounds%begc:bounds%endc)) - case(istice_mec) - write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active glacier mec column not yet implemented' - write(iulog,*) 'Expectation is that glacier mec columns should be active from the start of the run wherever they can grow' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - case(istdlak) - write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active lake column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - case(istwet) - write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active wetland column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - case(isturb_MIN:isturb_MAX) - write(iulog,*) subname// ' ERROR: Ability to initialize a newly-active urban column not yet implemented' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - case default - write(iulog,*) subname// ' ERROR: Unknown landunit type: ', ltype - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end select - - end function initial_template_col_dispatcher - - - !----------------------------------------------------------------------- - function initial_template_col_soil(c_new) result(c_template) - ! - ! !DESCRIPTION: - ! Find column to use as a template for a vegetated column that has newly become active. - ! - ! For now, we assume that the only vegetated columns that can newly become active are - ! ones with 0 weight on the grid cell (i.e., virtual columns). For these, we simply - ! keep the state at the current value (likely arbitrary initial conditions), and so - ! return TEMPLATE_NONE_FOUND from this function. Within this function, we check this assumption. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: c_template ! function result - integer , intent(in) :: c_new ! column index that needs initialization - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'initial_template_col_soil' - !----------------------------------------------------------------------- - - if (col%wtgcell(c_new) > 0._r8) then - write(iulog,*) subname// ' ERROR: Expectation is that the only vegetated columns that& - & can newly become active are ones with 0 weight on the grid cell' - call endrun(decomp_index=c_new, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - - c_template = TEMPLATE_NONE_FOUND - - end function initial_template_col_soil - - !----------------------------------------------------------------------- - function initial_template_col_crop(bounds, c_new, cactive_prior) result(c_template) - ! - ! !DESCRIPTION: - ! Find column to use as a template for a crop column that has newly become active - ! - ! Returns TEMPLATE_NONE_FOUND if there is no column to use for initialization - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop - ! - ! !ARGUMENTS: - integer :: c_template ! function result - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: c_new ! column index that needs initialization - logical , intent(in) :: cactive_prior( bounds%begc: ) ! column-level active flags from prior time step - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'initial_template_col_crop' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(cactive_prior) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - ! First try to find an active column on the vegetated landunit; if there is none, then - ! find the first active column on the crop landunit; if there is none, then - ! template_col will be TEMPLATE_NONE_FOUND - c_template = template_col_from_landunit(bounds, c_new, istsoil, cactive_prior(bounds%begc:bounds%endc)) - if (c_template == TEMPLATE_NONE_FOUND) then - c_template = template_col_from_landunit(bounds, c_new, istcrop, cactive_prior(bounds%begc:bounds%endc)) - end if - - end function initial_template_col_crop - - - !----------------------------------------------------------------------- - subroutine copy_state(c_new, c_template, & - temperature_inst, waterstate_inst, soilhydrology_inst) - ! - ! !DESCRIPTION: - ! Copy a subset of state variables from a template column (c_template) to a newly- - ! active column (c_new) - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: c_new ! index of newly-active column - integer, intent(in) :: c_template ! index of column to use as a template - type(temperature_type) , intent(inout) :: temperature_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(soilhydrology_type), intent(inout) :: soilhydrology_inst - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'copy_state' - !----------------------------------------------------------------------- - - ! For now, just copy a few key variables - ! TODO(wjs, 2016-08-31) Figure out what else should be copied here - - ! We only copy the below-ground portion of these multi-level variables, not the - ! above-ground (snow) portion. This is because it is challenging to initialize the - ! snow pack in a consistent state, requiring copying many more state variables - and - ! if you initialize it in a partly-inconsistent state, you get balance errors. So, for - ! now at least, we (Dave Lawrence, Keith Oleson, Bill Sacks) have decided that it's - ! safest to just let the snow pack in the new column start at cold start conditions. - - temperature_inst%t_soisno_col(c_new,1:) = temperature_inst%t_soisno_col(c_template,1:) - - ! TODO(wjs, 2016-08-31) If we had more general uses of this initial template col - ! infrastructure (copying state between very different landunits), then we might need - ! to handle bedrock layers - e.g., zeroing out any water that would be added to a - ! bedrock layer(?). But for now we just use this initial template col infrastructure - ! for nat veg -> crop, for which the bedrock will be the same, so we're not dealing - ! with that complexity for now. - waterstate_inst%h2osoi_liq_col(c_new,1:) = waterstate_inst%h2osoi_liq_col(c_template,1:) - waterstate_inst%h2osoi_ice_col(c_new,1:) = waterstate_inst%h2osoi_ice_col(c_template,1:) - waterstate_inst%h2osoi_vol_col(c_new,1:) = waterstate_inst%h2osoi_vol_col(c_template,1:) - - soilhydrology_inst%wa_col(c_new) = soilhydrology_inst%wa_col(c_template) - - end subroutine copy_state - - - -end module dynInitColumnsMod diff --git a/src/dyn_subgrid/dynLandunitAreaMod.F90 b/src/dyn_subgrid/dynLandunitAreaMod.F90 deleted file mode 100644 index 1d13efa8f0..0000000000 --- a/src/dyn_subgrid/dynLandunitAreaMod.F90 +++ /dev/null @@ -1,166 +0,0 @@ -module dynLandunitAreaMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Handle dynamic landunit weights - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varcon , only : ispval, namel - use landunit_varcon, only : isturb_hd, isturb_md, isturb_tbd - use landunit_varcon, only : istsoil, istcrop, istdlak, istwet, max_lunit - use decompMod , only : bounds_type - use abortutils , only : endrun - use GridcellType , only : grc - use LandunitType , only : lun - ! - implicit none - private - ! - public :: update_landunit_weights ! update landunit weights for all grid cells - - ! The following is only public for the sake of unit testing; it should not be called - ! directly by CLM code outside this module - public :: update_landunit_weights_one_gcell - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - - !----------------------------------------------------------------------- - subroutine update_landunit_weights(bounds) - ! - ! !DESCRIPTION: - ! Update landunit weights for all grid cells. - ! - ! Assumes lun%wtgcell has been updated for all landunits whose areas are specified by - ! the dynamic subgrid code. Update lun%wtgcell for all other landunits (including - ! possibly changing some values of lun%wtgcell for landunits whose areas are - ! specified, e.g., if there are conflicts between glacier area and crop area). - ! - ! !USES: - use subgridWeightsMod, only : get_landunit_weight, set_landunit_weight - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - integer :: ltype ! landunit type - real(r8) :: landunit_weights(max_lunit) ! weight of each landunit on a single grid cell - - character(len=*), parameter :: subname = 'update_landunit_weights' - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - - ! Determine current landunit weights. Landunits that don't exist on this grid cell - ! get a weight of 0 - do ltype = 1, max_lunit - landunit_weights(ltype) = get_landunit_weight(g, ltype) - end do - - ! Adjust weights so they sum to 100% - call update_landunit_weights_one_gcell(landunit_weights) - - ! Put the new landunit weights back into lun%wtgcell - do ltype = 1, max_lunit - call set_landunit_weight(g, ltype, landunit_weights(ltype)) - end do - - end do - - end subroutine update_landunit_weights - - - !----------------------------------------------------------------------- - subroutine update_landunit_weights_one_gcell(landunit_weights) - ! - ! !DESCRIPTION: - ! Update landunit weights for a single grid cell. - ! - ! This should be called with a vector of landunit weights for this grid cell, which is - ! updated in-place. Element #1 in this vector is the weight of landunit #1 (e.g., - ! istsoil, assuming istsoil==1), element #2 is the weight of landunit #2 (e.g., - ! istcrop, assuming istcrop==2), etc. Landunits that do not exist in this grid cell - ! should be given a weight of 0 in the vector. - ! - ! After the execution of this routine, sum(landunit_weights) will be 1 within a small - ! roundoff-level tolerance. This is achieved by growing or shrinking landunits as - ! needed. - ! - ! !ARGUMENTS: - real(r8), intent(inout) :: landunit_weights(:) ! weight of each landunit; this is updated in-place - ! - ! !LOCAL VARIABLES: - real(r8) :: landunit_sum ! sum of all landunit weights on this grid cell - real(r8) :: excess ! excess landunit weight that needs to be removed - integer :: decrease_index ! the current index into decrease_order - integer :: cur_landunit ! the current element of decrease_order that we're dealing with - - ! This parameter specifies the order in which landunit areas are decreased when the - ! specified areas add to greater than 100%. Landunits not listed here can never be - ! decreased unless the forcings say they should be decreased. In particular, note - ! that istice_mec doesn't appear here, so that the istice_mec area always will match - ! the areas specified by GLC. In general, the code will NOT be robust if more than - ! one landunit is excluded from this list. Meaning: since istice_mec is excluded from - ! this list, all other landunits should appear in this list! - integer, parameter :: decrease_order(7) = & - (/istsoil, istcrop, isturb_md, isturb_hd, isturb_tbd, istwet, istdlak/) - - real(r8), parameter :: tol = 1.e-14 ! tolerance for making sure sum of landunit weights equals 1 - - character(len=*), parameter :: subname = 'update_landunit_weights_one_gcell' - !----------------------------------------------------------------------- - - SHR_ASSERT((size(landunit_weights) == max_lunit), errMsg(sourcefile, __LINE__)) - - landunit_sum = sum(landunit_weights) - - ! If landunits sum to ~ 100% already, we're done - if (abs(landunit_sum - 1._r8) <= tol) then - ! Do nothing - - ! If landunits sum to < 100%, increase natural vegetation so sum is 100% - else if (landunit_sum < 1._r8) then - landunit_weights(istsoil) = landunit_weights(istsoil) + (1._r8 - landunit_sum) - - ! If landunits sum to > 100%, decrease areas in priority order - else - decrease_index = 1 - excess = landunit_sum - 1._r8 - do while ((excess > tol) .and. decrease_index <= size(decrease_order)) - ! Decrease weight of the next landunit, but not below 0 - cur_landunit = decrease_order(decrease_index) - landunit_weights(cur_landunit) = landunit_weights(cur_landunit) - excess - if (landunit_weights(cur_landunit) < 0._r8) then - landunit_weights(cur_landunit) = 0._r8 - end if - - ! Update variables for next loop iteration - landunit_sum = sum(landunit_weights) - excess = landunit_sum - 1._r8 - decrease_index = decrease_index + 1 - end do - end if - - ! Confirm that landunit sum is now equal to 100%, within tolerance - landunit_sum = sum(landunit_weights) - if (abs(landunit_sum - 1._r8) > tol) then - write(iulog,*) subname//' ERROR: After all landunit adjustments, landunit weights still do not equal 100%' - write(iulog,*) 'landunit_sum = ', landunit_sum - write(iulog,*) 'landunit_weights = ', landunit_weights - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine update_landunit_weights_one_gcell - -end module dynLandunitAreaMod diff --git a/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 b/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 deleted file mode 100644 index a02eb15981..0000000000 --- a/src/dyn_subgrid/dynPatchStateUpdaterMod.F90 +++ /dev/null @@ -1,455 +0,0 @@ -module dynPatchStateUpdaterMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Class for adjusting patch-level (aboveground) state variables due to transient patch - ! areas. - ! - ! In each time step, the object should be set up with: - ! - ! - call patch_state_updater%set_old_weights (before dyn subgrid weight updates) - ! - ! - call patch_state_updater%set_new_weights (after dyn subgrid weight updates) - ! - ! Then it can be used to update each state variable with a call to: - ! - ! - call patch_state_updater%update_patch_state - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use PatchType , only : patch - use ColumnType , only : col - use clm_varpar , only : mxpft - use abortutils , only : endrun - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: patch_state_updater_type - - type patch_state_updater_type - private - real(r8), allocatable :: pwtgcell_old(:) ! old patch weights on the gridcell - real(r8), allocatable :: pwtgcell_new(:) ! new patch weights on the gridcell - - real(r8), allocatable :: cwtgcell_old(:) ! old column weights on the gridcell - - ! (pwtgcell_new - pwtgcell_old) from last call to set_new_weights - real(r8), allocatable :: dwt(:) - - ! (pwtgcell_old / pwtgcell_new) from last call to set_new_weights; only valid for - ! growing patches - real(r8), allocatable :: growing_old_fraction(:) - - ! (dwt / pwtgcell_new) from last call to set_new_weights; only valid for growing - ! patches - real(r8), allocatable :: growing_new_fraction(:) - - contains - ! Public routines - procedure, public :: set_old_weights ! set weights before dyn subgrid updates - procedure, public :: set_new_weights ! set weights after dyn subgrid updates - - ! Update a patch-level state variable and compute associated fluxes based on changing - ! patch areas - procedure, public :: update_patch_state - - ! Update a patch-level state variable and compute associated fluxes based on - ! changing patch areas, with flux out partitioned into two fluxes. Partitioning is - ! based on pft type. - procedure, public :: update_patch_state_partition_flux_by_type - - ! returns a patch-level logical array that is true wherever the patch weight was zero - ! prior to weight updates - procedure, public :: old_weight_was_zero - - ! returns a patch-level logical array that is true wherever the patch grew in this - ! time step - procedure, public :: patch_grew - - ! returns a patch-level logical array that is true wherever a patch newly has - ! non-zero weight in this time step - procedure, public :: patch_initiating - - end type patch_state_updater_type - - interface patch_state_updater_type - module procedure constructor - end interface patch_state_updater_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(bounds) result(this) - ! - ! !DESCRIPTION: - ! Initialize a patch_state_updater_type object - ! - ! !USES: - ! - ! !ARGUMENTS: - type(patch_state_updater_type) :: this ! function result - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, errMsg(sourcefile, __LINE__)) - - begp = bounds%begp - endp = bounds%endp - begc = bounds%begc - endc = bounds%endc - - allocate(this%pwtgcell_old(begp:endp)) - this%pwtgcell_old(:) = nan - allocate(this%pwtgcell_new(begp:endp)) - this%pwtgcell_new(:) = nan - allocate(this%cwtgcell_old(begc:endc)) - this%cwtgcell_old(:) = nan - allocate(this%dwt(begp:endp)) - this%dwt(:) = nan - allocate(this%growing_old_fraction(begp:endp)) - this%growing_old_fraction(:) = nan - allocate(this%growing_new_fraction(begp:endp)) - this%growing_new_fraction(:) = nan - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine set_old_weights(this, bounds) - ! - ! !DESCRIPTION: - ! Set subgrid weights before dyn subgrid updates - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p - integer :: c - - character(len=*), parameter :: subname = 'set_old_weights' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - c = patch%column(p) - this%pwtgcell_old(p) = patch%wtgcell(p) - this%cwtgcell_old(c) = col%wtgcell(c) - end do - - end subroutine set_old_weights - - !----------------------------------------------------------------------- - subroutine set_new_weights(this, bounds) - ! - ! !DESCRIPTION: - ! Set subgrid weights after dyn subgrid updates - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p - - character(len=*), parameter :: subname = 'set_new_weights' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - this%pwtgcell_new(p) = patch%wtgcell(p) - this%dwt(p) = this%pwtgcell_new(p) - this%pwtgcell_old(p) - if (this%dwt(p) > 0._r8) then - this%growing_old_fraction(p) = this%pwtgcell_old(p) / this%pwtgcell_new(p) - this%growing_new_fraction(p) = this%dwt(p) / this%pwtgcell_new(p) - else - ! These values are unused in this case, but set them to something reasonable for - ! safety. (We could set them to NaN, but that requires a more expensive - ! subroutine call, using the shr_infnan_mod infrastructure.) - this%growing_old_fraction(p) = 1._r8 - this%growing_new_fraction(p) = 0._r8 - end if - end do - - end subroutine set_new_weights - - !----------------------------------------------------------------------- - subroutine update_patch_state(this, bounds, & - num_filterp_with_inactive, filterp_with_inactive, & - var, flux_out_col_area, flux_out_grc_area, & - seed, seed_addition) - ! - ! !DESCRIPTION: - ! Update a patch-level state variable and compute associated fluxes based on changing - ! patch areas - ! - ! For growing patches, this subroutine adjusts var. For shrinking patches, this - ! subroutine accumulates flux in flux_out_col_area. - ! - ! Changes are only made within the given filter. Note that this filter should include - ! inactive as well as active patches, so that it includes patches that just became - ! inactive. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_filterp_with_inactive ! number of points in filterp_with_inactive - integer, intent(in) :: filterp_with_inactive(:) ! patch filter that includes inactive points - real(r8), intent(inout) :: var( bounds%begp: ) ! patch-level state variable - - ! Accumulated flux from shrinking areas, expressed as mass per unit area COLUMN, using - ! the OLD column weight. (The use of the old column weight is appropriate if the - ! fluxes from shrinking patches are applied to column-level state variables BEFORE - ! doing column-level state adjustments via the column_state_updater). For shrinking - ! areas, this is given as a NEGATIVE quantity. Often you will provide one of - ! flux_out_col_area or flux_out_grc_area, but it is okay to provide both, or to - ! provide neither if you don't need to track the flux out from this state variable. - real(r8), intent(inout), optional :: flux_out_col_area( bounds%begp: ) - - ! Accumulated flux from shrinking areas, expressed as mass per unit area GRIDCELL. For - ! shrinking areas, this is given as a NEGATIVE quantity. Often you will provide one of - ! flux_out_col_area or flux_out_grc_area, but it is okay to provide both, or to - ! provide neither if you don't need to track the flux out from this state variable. - real(r8), intent(inout), optional :: flux_out_grc_area( bounds%begp: ) - - ! If provided, this gives some 'seed' amount added to the state in the area into - ! which each growing patch grows. The value is ignored for patches that are either - ! constant or shrinking in area. - real(r8), intent(in), optional :: seed( bounds%begp: ) - - ! If provided, this accumulates the amount of seed added to each patch. This gives - ! seed(p) * dwt(p). This can only be provided if seed is provided. Even though this is - ! a patch-level array, it is expressed as mass per unit area GRIDCELL. - real(r8), intent(inout), optional :: seed_addition( bounds%begp: ) - ! - ! - ! !LOCAL VARIABLES: - integer :: fp, p, c - - character(len=*), parameter :: subname = 'update_patch_state' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(var) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - if (present(flux_out_col_area)) then - SHR_ASSERT_ALL((ubound(flux_out_col_area) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - - if (present(flux_out_grc_area)) then - SHR_ASSERT_ALL((ubound(flux_out_grc_area) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - - if (present(seed)) then - SHR_ASSERT_ALL((ubound(seed) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - - if (present(seed_addition)) then - if (.not. present(seed)) then - call endrun(subname//' ERROR: seed_addition can only be provided if seed is provided') - end if - SHR_ASSERT_ALL((ubound(seed_addition) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - end if - - do fp = 1, num_filterp_with_inactive - p = filterp_with_inactive(fp) - c = patch%column(p) - - if (this%dwt(p) > 0._r8) then - var(p) = var(p) * this%growing_old_fraction(p) - if (present(seed)) then - var(p) = var(p) + seed(p) * this%growing_new_fraction(p) - if (present(seed_addition)) then - seed_addition(p) = seed_addition(p) + seed(p) * this%dwt(p) - end if - end if - - else if (this%dwt(p) < 0._r8) then - if (present(flux_out_grc_area)) then - flux_out_grc_area(p) = flux_out_grc_area(p) + var(p) * this%dwt(p) - end if - if (present(flux_out_col_area)) then - ! No need to check for divide by 0 here: If dwt < 0 then we must have had - ! cwtgcell_old > 0. - flux_out_col_area(p) = flux_out_col_area(p) + & - var(p) * (this%dwt(p) / this%cwtgcell_old(c)) - end if - end if - end do - - end subroutine update_patch_state - - !----------------------------------------------------------------------- - subroutine update_patch_state_partition_flux_by_type(this, bounds, & - num_filterp_with_inactive, filterp_with_inactive, & - flux1_fraction_by_pft_type, & - var, flux1_out, flux2_out, & - seed, seed_addition) - ! - ! !DESCRIPTION: - ! Update a patch-level state variable and compute associated fluxes based on - ! changing patch areas, with flux out partitioned into two fluxes. Partitioning is - ! based on pft type. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_filterp_with_inactive ! number of points in filterp_with_inactive - integer, intent(in) :: filterp_with_inactive(:) ! patch filter that includes inactive points - real(r8), intent(in) :: flux1_fraction_by_pft_type( 0: ) ! fraction of flux that goes into flux1_out, indexed by pft type - real(r8), intent(inout) :: var( bounds%begp: ) ! patch-level state variable - - ! Accumulated fluxes from shrinking areas. For shrinking areas, these are given as - ! NEGATIVE quantities. Even though these are patch-level arrays, they are expressed - ! as mass per unit area GRIDCELL (so these are equivalent to the flux_out_grc_area - ! argument in the main update_patch_state routine). - real(r8), intent(inout) :: flux1_out( bounds%begp: ) - real(r8), intent(inout) :: flux2_out( bounds%begp: ) - - ! If provided, this gives some 'seed' amount added to the state in the area into - ! which each growing patch grows. The value is ignored for patches that are either - ! constant or shrinking in area. - real(r8), intent(in), optional :: seed( bounds%begp: ) - - ! If provided, this accumulates the amount of seed added to each patch. This gives - ! seed(p) * dwt(p). This can only be provided if seed is provided. Even though this is - ! a patch-level array, it is expressed as mass per unit area GRIDCELL. - real(r8), intent(inout), optional :: seed_addition( bounds%begp: ) - ! - ! !LOCAL VARIABLES: - integer :: fp, p - real(r8) :: total_flux_out(bounds%begp:bounds%endp) - real(r8) :: my_flux1_fraction - - character(len=*), parameter :: subname = 'update_patch_state_partition_flux_by_type' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(flux1_fraction_by_pft_type) == (/mxpft/)), errMsg(sourcefile, __LINE__)) - - total_flux_out(bounds%begp:bounds%endp) = 0._r8 - call this%update_patch_state(bounds, & - num_filterp_with_inactive, filterp_with_inactive, & - var, flux_out_grc_area = total_flux_out, & - seed = seed, seed_addition = seed_addition) - - do fp = 1, num_filterp_with_inactive - p = filterp_with_inactive(fp) - my_flux1_fraction = flux1_fraction_by_pft_type(patch%itype(p)) - flux1_out(p) = flux1_out(p) + total_flux_out(p) * my_flux1_fraction - flux2_out(p) = flux2_out(p) + total_flux_out(p) * (1._r8 - my_flux1_fraction) - end do - - end subroutine update_patch_state_partition_flux_by_type - - - !----------------------------------------------------------------------- - function old_weight_was_zero(this, bounds) - ! - ! !DESCRIPTION: - ! Returns a patch-level logical array that is true wherever the patch weight was zero - ! prior to weight updates - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - logical :: old_weight_was_zero(bounds%begp:bounds%endp) ! function result - ! - ! !LOCAL VARIABLES: - integer :: p - - character(len=*), parameter :: subname = 'old_weight_was_zero' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - old_weight_was_zero(p) = (this%pwtgcell_old(p) == 0._r8) - end do - - end function old_weight_was_zero - - !----------------------------------------------------------------------- - function patch_grew(this, bounds) - ! - ! !DESCRIPTION: - ! Returns a patch-level logical array that is true wherever the patch grew in this - ! time step - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - logical :: patch_grew(bounds%begp:bounds%endp) ! function result - ! - ! !LOCAL VARIABLES: - integer :: p - - character(len=*), parameter :: subname = 'patch_grew' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - patch_grew(p) = (this%dwt(p) > 0._r8) - end do - - end function patch_grew - - !----------------------------------------------------------------------- - function patch_initiating(this, bounds) - ! - ! !DESCRIPTION: - ! Returns a patch-level logical array wherever the patch is initiating - i.e., growing - ! from zero area to non-zero area - in this time step - ! - ! !USES: - ! - ! !ARGUMENTS: - class(patch_state_updater_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - logical :: patch_initiating(bounds%begp:bounds%endp) ! function result - ! - ! !LOCAL VARIABLES: - integer :: p - - character(len=*), parameter :: subname = 'patch_initiating' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - patch_initiating(p) = ( & - this%pwtgcell_old(p) == 0._r8 .and. & - this%pwtgcell_new(p) > 0._r8) - end do - - end function patch_initiating - - -end module dynPatchStateUpdaterMod diff --git a/src/dyn_subgrid/dynPriorWeightsMod.F90 b/src/dyn_subgrid/dynPriorWeightsMod.F90 deleted file mode 100644 index 577676f217..0000000000 --- a/src/dyn_subgrid/dynPriorWeightsMod.F90 +++ /dev/null @@ -1,95 +0,0 @@ -module dynPriorWeightsMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Defines a derived type and associated methods for working with prior subgrid weights - ! (i.e., before the weight updates of this time step) - ! - ! TODO(wjs, 2015-07-04) See if I can combine some functionality here with - ! dynColumnStateUpdaterMod, and/or change some of this to be more similar to the - ! implementation of dynColumnStateUpdaterMod (i.e., an active class rather than a - ! passive data-holder). - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use ColumnType , only : col - use PatchType , only : patch - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: prior_weights_type - - type prior_weights_type - ! Components are public for ease-of-use and efficiency. However, these components - ! should be treated as read-only! - real(r8), allocatable, public :: pwtgcell(:) ! prior pft weight on the gridcell - logical , allocatable, public :: cactive(:) ! prior col%active flags - contains - procedure :: set_prior_weights ! set prior weights to current weights - end type prior_weights_type - - interface prior_weights_type - module procedure constructor ! initialize a prior_weights_type object - end interface prior_weights_type - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - ! ---------------------------------------------------------------------- - type(prior_weights_type) function constructor(bounds) - ! - ! !DESCRIPTION: - ! Initialize a prior_weights_type object - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! processor bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'prior_weights_type constructor' - ! ---------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - allocate(constructor%pwtgcell(bounds%begp:bounds%endp)) - allocate(constructor%cactive(bounds%begc:bounds%endc)) - end function constructor - - - ! ====================================================================== - ! Public methods - ! ====================================================================== - - ! ---------------------------------------------------------------------- - subroutine set_prior_weights(this, bounds) - ! - ! !DESCRIPTION: - ! Set prior weights to current weights - ! - ! !ARGUMENTS: - class(prior_weights_type) , intent(inout) :: this ! this object - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p, c ! patch & col indices - ! ---------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - this%pwtgcell(p) = patch%wtgcell(p) - end do - - do c = bounds%begc, bounds%endc - this%cactive(c) = col%active(c) - end do - end subroutine set_prior_weights - -end module dynPriorWeightsMod diff --git a/src/dyn_subgrid/dynSubgridControlMod.F90 b/src/dyn_subgrid/dynSubgridControlMod.F90 deleted file mode 100644 index 58e3a40359..0000000000 --- a/src/dyn_subgrid/dynSubgridControlMod.F90 +++ /dev/null @@ -1,348 +0,0 @@ -module dynSubgridControlMod - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! Defines a class for storing and querying control flags related to dynamic subgrid - ! operation. - ! - ! Note that this is implemented (essentially) as a singleton, so the only instance of - ! this class is stored in this module. This is done for convenience, to avoid having to - ! pass around the single instance just to query these control flags. - ! - ! !USES: -#include "shr_assert.h" - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : fname_len - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: dynSubgridControl_init - public :: get_flanduse_timeseries ! return the value of the flanduse_timeseries file name - public :: get_do_transient_pfts ! return the value of the do_transient_pfts control flag - public :: get_do_transient_crops ! return the value of the do_transient_crops control flag - public :: run_has_transient_landcover ! returns true if any aspects of prescribed transient landcover are enabled - public :: get_do_harvest ! return the value of the do_harvest control flag - public :: get_for_testing_allow_non_annual_changes ! return true if user has requested to allow area changes at times other than the year boundary, for testing purposes - public :: get_for_testing_zero_dynbal_fluxes ! return true if user has requested to set the dynbal water and energy fluxes to zero, for testing purposes - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: read_namelist ! read namelist variables - private :: check_namelist_consistency ! check consistency of namelist settings - ! - ! !PRIVATE TYPES: - type dyn_subgrid_control_type - private - character(len=fname_len) :: flanduse_timeseries = ' ' ! transient landuse dataset - logical :: do_transient_pfts = .false. ! whether to apply transient natural PFTs from dataset - logical :: do_transient_crops = .false. ! whether to apply transient crops from dataset - logical :: do_harvest = .false. ! whether to apply harvest from dataset - - ! The following is only meant for testing: Whether area changes are allowed at times - ! other than the year boundary. This should only arise in some test configurations - ! where we artificially create changes more frequently so that we can run short - ! tests. This flag is only used for error-checking, not controlling any model - ! behavior. - logical :: for_testing_allow_non_annual_changes = .false. - - ! The following is only meant for testing: If .true., set the dynbal water and - ! energy fluxes to zero. This is needed in some tests where we have daily rather - ! than annual glacier dynamics: if we allow the true dynbal adjustment fluxes in - ! those tests, we end up with sensible heat fluxes of thousands of W m-2 or more, - ! which causes CAM to blow up. However, note that setting it to true will break - ! water and energy conservation! - logical :: for_testing_zero_dynbal_fluxes = .false. - - logical :: initialized = .false. ! whether this object has been initialized - end type dyn_subgrid_control_type - - type(dyn_subgrid_control_type) :: dyn_subgrid_control_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine dynSubgridControl_init( NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize the dyn_subgrid_control settings. - ! - ! !USES: - use spmdMod , only : masterproc - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'dynSubgridControl_init' - !----------------------------------------------------------------------- - - call read_namelist( NLFilename ) - if (masterproc) then - call check_namelist_consistency - end if - - dyn_subgrid_control_inst%initialized = .true. - - end subroutine dynSubgridControl_init - - !----------------------------------------------------------------------- - subroutine read_namelist( NLFilename ) - ! - ! !DESCRIPTION: - ! Read dyn_subgrid_control namelist variables - ! - ! !USES: - use fileutils , only : getavu, relavu - use clm_nlUtilsMod , only : find_nlgroup_name - use clm_varctl , only : iulog - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - ! temporary variables corresponding to the components of dyn_subgrid_control_type: - character(len=fname_len) :: flanduse_timeseries - logical :: do_transient_pfts - logical :: do_transient_crops - logical :: do_harvest - logical :: for_testing_allow_non_annual_changes - logical :: for_testing_zero_dynbal_fluxes - ! other local variables: - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - - character(len=*), parameter :: subname = 'read_namelist' - !----------------------------------------------------------------------- - - namelist /dynamic_subgrid/ & - flanduse_timeseries, & - do_transient_pfts, & - do_transient_crops, & - do_harvest, & - for_testing_allow_non_annual_changes, & - for_testing_zero_dynbal_fluxes - - ! Initialize options to default values, in case they are not specified in the namelist - flanduse_timeseries = ' ' - do_transient_pfts = .false. - do_transient_crops = .false. - do_harvest = .false. - for_testing_allow_non_annual_changes = .false. - for_testing_zero_dynbal_fluxes = .false. - - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'dynamic_subgrid', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=dynamic_subgrid, iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading dynamic_subgrid namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding dynamic_subgrid namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast (flanduse_timeseries, mpicom) - call shr_mpi_bcast (do_transient_pfts, mpicom) - call shr_mpi_bcast (do_transient_crops, mpicom) - call shr_mpi_bcast (do_harvest, mpicom) - call shr_mpi_bcast (for_testing_allow_non_annual_changes, mpicom) - call shr_mpi_bcast (for_testing_zero_dynbal_fluxes, mpicom) - - dyn_subgrid_control_inst = dyn_subgrid_control_type( & - flanduse_timeseries = flanduse_timeseries, & - do_transient_pfts = do_transient_pfts, & - do_transient_crops = do_transient_crops, & - do_harvest = do_harvest, & - for_testing_allow_non_annual_changes = for_testing_allow_non_annual_changes, & - for_testing_zero_dynbal_fluxes = for_testing_zero_dynbal_fluxes) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'dynamic_subgrid settings:' - write(iulog,nml=dynamic_subgrid) - write(iulog,*) ' ' - end if - - end subroutine read_namelist - - !----------------------------------------------------------------------- - subroutine check_namelist_consistency - ! - ! !DESCRIPTION: - ! Check consistency of namelist settingsn - ! - ! !USES: - use clm_varctl , only : iulog, use_cndv, use_fates, use_cn, use_crop - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_namelist_consistency' - !----------------------------------------------------------------------- - - if (dyn_subgrid_control_inst%flanduse_timeseries == ' ') then - if (dyn_subgrid_control_inst%do_transient_pfts) then - write(iulog,*) 'ERROR: do_transient_pfts can only be true if you are running with' - write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (dyn_subgrid_control_inst%do_transient_crops) then - write(iulog,*) 'ERROR: do_transient_crops can only be true if you are running with' - write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (dyn_subgrid_control_inst%do_harvest) then - write(iulog,*) 'ERROR: do_harvest can only be true if you are running with' - write(iulog,*) 'a flanduse_timeseries file (currently flanduse_timeseries is blank)' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - if (dyn_subgrid_control_inst%do_transient_pfts) then - if (use_cndv) then - write(iulog,*) 'ERROR: do_transient_pfts is incompatible with use_cndv' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (use_fates) then - write(iulog,*) 'ERROR: do_transient_pfts is incompatible with use_fates' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - if (dyn_subgrid_control_inst%do_transient_crops) then - if (.not. use_crop) then - write(iulog,*) 'ERROR: do_transient_crops can only be true if use_crop is true' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (use_fates) then - ! NOTE(wjs, 2017-01-13) ED / FATES does not currently have a mechanism for - ! changing its column areas, with the consequent changes in aboveground biomass - ! per unit area. See https://github.com/NGEET/ed-clm/issues/173 - write(iulog,*) 'ERROR: do_transient_crops does not currently work with use_fates' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - if (dyn_subgrid_control_inst%do_harvest) then - if (.not. use_cn) then - write(iulog,*) 'ERROR: do_harvest can only be true if use_cn is true' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (use_fates) then - write(iulog,*) 'ERROR: do_harvest currently does not work with use_fates' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine check_namelist_consistency - - !----------------------------------------------------------------------- - character(len=fname_len) function get_flanduse_timeseries() - ! !DESCRIPTION: - ! Return the value of the flanduse_timeseries file name - - character(len=*), parameter :: subname = 'get_flanduse_timeseries' - !----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_flanduse_timeseries = dyn_subgrid_control_inst%flanduse_timeseries - - end function get_flanduse_timeseries - - !----------------------------------------------------------------------- - logical function get_do_transient_pfts() - ! !DESCRIPTION: - ! Return the value of the do_transient_pfts control flag - !----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_do_transient_pfts = dyn_subgrid_control_inst%do_transient_pfts - - end function get_do_transient_pfts - - !----------------------------------------------------------------------- - logical function get_do_transient_crops() - ! !DESCRIPTION: - ! Return the value of the do_transient_crops control flag - !----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_do_transient_crops = dyn_subgrid_control_inst%do_transient_crops - - end function get_do_transient_crops - - !----------------------------------------------------------------------- - logical function run_has_transient_landcover() - ! !DESCRIPTION: - ! Returns true if any aspects of prescribed transient landcover are enabled - !----------------------------------------------------------------------- - - run_has_transient_landcover = & - (get_do_transient_pfts() .or. & - get_do_transient_crops()) - end function run_has_transient_landcover - - !----------------------------------------------------------------------- - logical function get_do_harvest() - ! !DESCRIPTION: - ! Return the value of the do_harvest control flag - !----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_do_harvest = dyn_subgrid_control_inst%do_harvest - - end function get_do_harvest - - !----------------------------------------------------------------------- - logical function get_for_testing_allow_non_annual_changes() - ! - ! !DESCRIPTION: - ! Return true if the user has requested to allow area changes at times other than the - ! year boundary. (This should typically only be true for testing.) (This only - ! controls error-checking, not any operation of the code.) - !----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_for_testing_allow_non_annual_changes = dyn_subgrid_control_inst%for_testing_allow_non_annual_changes - - end function get_for_testing_allow_non_annual_changes - - !----------------------------------------------------------------------- - logical function get_for_testing_zero_dynbal_fluxes() - ! - ! !DESCRIPTION: - ! Return true if the user has requested to set the dynbal water and energy fluxes to - ! zero. This should typically only be true for testing: This is needed in some tests - ! where we have daily rather than annual glacier dynamics: if we allow the true dynbal - ! adjustment fluxes in those tests, we end up with sensible heat fluxes of thousands - ! of W m-2 or more, which causes CAM to blow up. However, note that setting it to - ! true will break water and energy conservation! - ! ----------------------------------------------------------------------- - - SHR_ASSERT(dyn_subgrid_control_inst%initialized, errMsg(sourcefile, __LINE__)) - - get_for_testing_zero_dynbal_fluxes = dyn_subgrid_control_inst%for_testing_zero_dynbal_fluxes - - end function get_for_testing_zero_dynbal_fluxes - -end module dynSubgridControlMod diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 deleted file mode 100644 index 8703fcb2d9..0000000000 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ /dev/null @@ -1,347 +0,0 @@ -module dynSubgridDriverMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! - ! !DESCRIPTION: - ! High-level routines for dynamic subgrid areas (prescribed transient Patches, CNDV, and - ! dynamic landunits). - ! - ! !USES: - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, BOUNDS_LEVEL_CLUMP - use decompMod , only : get_proc_clumps, get_clump_bounds - use dynSubgridControlMod , only : get_flanduse_timeseries - use dynSubgridControlMod , only : get_do_transient_pfts, get_do_transient_crops - use dynSubgridControlMod , only : get_do_harvest - use dynPriorWeightsMod , only : prior_weights_type - use dynPatchStateUpdaterMod , only : patch_state_updater_type - use dynColumnStateUpdaterMod , only : column_state_updater_type - use dynpftFileMod , only : dynpft_init, dynpft_interp - use dyncropFileMod , only : dyncrop_init, dyncrop_interp - use dynHarvestMod , only : dynHarvest_init, dynHarvest_interp - use dynLandunitAreaMod , only : update_landunit_weights - use subgridWeightsMod , only : compute_higher_order_weights, set_subgrid_diagnostic_fields - use reweightMod , only : reweight_wrapup - use glcBehaviorMod , only : glc_behavior_type - use UrbanParamsType , only : urbanparams_type - use CanopyStateType , only : canopystate_type - use CNVegetationFacade , only : cn_vegetation_type - use SoilBiogeochemStateType , only : soilBiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilBiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType, only : soilbiogeochem_carbonstate_type - use SoilBiogeochemNitrogenStateType, only : soilbiogeochem_nitrogenstate_type - use ch4Mod, only : ch4_type - use EnergyFluxType , only : energyflux_type - use PhotosynthesisMod , only : photosyns_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use WaterfluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use TemperatureType , only : temperature_type - use CropType , only : crop_type - use glc2lndMod , only : glc2lnd_type - use filterMod , only : filter, filter_inactive_and_active - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - ! - public :: dynSubgrid_init ! initialize transient land cover - public :: dynSubgrid_driver ! top-level driver for transient land cover - public :: dynSubgrid_wrapup_weight_changes ! reconcile various variables after subgrid weights change - - ! - ! !PRIVATE TYPES: - - ! saved weights from before the subgrid weight updates - type(prior_weights_type), target :: prior_weights - - ! object used to update patch-level states after subgrid weight updates - type(patch_state_updater_type), target :: patch_state_updater - - ! object used to update column-level states after subgrid weight updates - type(column_state_updater_type), target :: column_state_updater - !--------------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) - ! - ! !DESCRIPTION: - ! Initialize objects needed for prescribed transient PFTs, CNDV, and/or dynamic - ! landunits. - ! - ! Also sets initial subgrid weight for aspects prescribed from file (transient PFTs - ! and transient crops). These initial weights will be overwritten in a restart run, - ! or any other run that starts up from initial conditions (except startup runs that - ! use init_interp). - ! - ! This should be called from initialization, after dynSubgridControl is initialized. - ! - ! Note that dynpft_init needs to be called from outside any loops over clumps - so - ! this routine needs to be called from outside any loops over clumps. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds_proc ! processor-level bounds - type(glc_behavior_type) , intent(in) :: glc_behavior - type(crop_type) , intent(inout) :: crop_inst - ! - ! !LOCAL VARIABLES: - integer :: nclumps ! number of clumps on this processor - integer :: nc ! clump index - type(bounds_type) :: bounds_clump ! clump-level bounds - character(len=*), parameter :: subname = 'dynSubgrid_init' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - nclumps = get_proc_clumps() - - prior_weights = prior_weights_type(bounds_proc) - patch_state_updater = patch_state_updater_type(bounds_proc) - column_state_updater = column_state_updater_type(bounds_proc, nclumps) - - ! Initialize stuff for prescribed transient Patches - if (get_do_transient_pfts()) then - call dynpft_init(bounds_proc, dynpft_filename=get_flanduse_timeseries()) - end if - - ! Initialize stuff for prescribed transient crops - if (get_do_transient_crops()) then - call dyncrop_init(bounds_proc, dyncrop_filename=get_flanduse_timeseries()) - end if - - ! Initialize stuff for harvest. Note that, currently, the harvest data are on the - ! flanduse_timeseries file. However, this could theoretically be changed so that the - ! harvest data were separated from the pftdyn data, allowing them to differ in the - ! years over which they apply. - if (get_do_harvest()) then - call dynHarvest_init(bounds_proc, harvest_filename=get_flanduse_timeseries()) - end if - - ! ------------------------------------------------------------------------ - ! Set initial subgrid weights for aspects that are read from file. This is relevant - ! for cold start and use_init_interp-based initialization. - ! ------------------------------------------------------------------------ - - if (get_do_transient_pfts()) then - call dynpft_interp(bounds_proc) - end if - - if (get_do_transient_crops()) then - call dyncrop_interp(bounds_proc, crop_inst) - end if - - ! (We don't bother calling dynHarvest_interp, because the harvest information isn't - ! needed until the run loop. Harvest has nothing to do with subgrid weights, and in - ! some respects doesn't even really belong in this module at all.) - - ! The following is only needed if there were actually weight changes due to the above - ! interp calls, but it doesn't hurt to always run this code: - - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - - call dynSubgrid_wrapup_weight_changes(bounds_clump, glc_behavior) - end do - !$OMP END PARALLEL DO - - end subroutine dynSubgrid_init - - !----------------------------------------------------------------------- - subroutine dynSubgrid_driver(bounds_proc, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst, & - canopystate_inst, photosyns_inst, crop_inst, glc2lnd_inst, bgc_vegetation_inst, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_carbonflux_inst, ch4_inst, & - glc_behavior) - ! - ! !DESCRIPTION: - ! Update subgrid weights for prescribed transient PFTs, CNDV, and/or dynamic - ! landunits. Also do related adjustments (water & energy, carbon & nitrogen). - ! - ! This should be called every time step in CLM's run loop. - ! - ! Note that this routine operates partly at the proc-level (outside an OMP region), - ! and partly at the clump level (inside OMP regions). Thus, this must be called from - ! OUTSIDE any loops over clumps in the driver. - ! - ! !USES: - use clm_varctl , only : use_cn, use_fates - use dynInitColumnsMod , only : initialize_new_columns - use dynConsBiogeophysMod , only : dyn_hwcontent_init, dyn_hwcontent_final - use dynEDMod , only : dyn_ED - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds_proc ! processor-level bounds - type(urbanparams_type) , intent(in) :: urbanparams_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilhydrology_type) , intent(inout) :: soilhydrology_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(temperature_type) , intent(inout) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - type(crop_type) , intent(inout) :: crop_inst - type(glc2lnd_type) , intent(inout) :: glc2lnd_inst - type(cn_vegetation_type) , intent(inout) :: bgc_vegetation_inst - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type), intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type), intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type), intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type), intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(ch4_type) , intent(inout) :: ch4_inst - type(glc_behavior_type) , intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: nclumps ! number of clumps on this processor - integer :: nc ! clump index - type(bounds_type) :: bounds_clump ! clump-level bounds - - character(len=*), parameter :: subname = 'dynSubgrid_driver' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - nclumps = get_proc_clumps() - - ! ========================================================================== - ! Do initialization, prior to land cover change - ! ========================================================================== - - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - - call dyn_hwcontent_init(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_lakec, filter(nc)%lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst) - - call prior_weights%set_prior_weights(bounds_clump) - call patch_state_updater%set_old_weights(bounds_clump) - call column_state_updater%set_old_weights(bounds_clump) - end do - !$OMP END PARALLEL DO - - ! ========================================================================== - ! Do land cover change that requires I/O, and thus must be outside a threaded region - ! ========================================================================== - - if (get_do_transient_pfts()) then - call dynpft_interp(bounds_proc) - end if - - if (get_do_transient_crops()) then - call dyncrop_interp(bounds_proc,crop_inst) - end if - - if (get_do_harvest()) then - call dynHarvest_interp(bounds_proc) - end if - - ! ========================================================================== - ! Do land cover change that does not require I/O - ! ========================================================================== - - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - - call bgc_vegetation_inst%UpdateSubgridWeights(bounds_clump) - - if (use_fates) then - call dyn_ED(bounds_clump) - end if - - call glc2lnd_inst%update_glc2lnd_fracs( & - bounds = bounds_clump) - - ! ======================================================================== - ! Do wrapup stuff after land cover change - ! - ! Everything following this point in this loop only needs to be called if we have - ! actually changed some weights in this time step. However, it doesn't do any harm - ! (other than a small performance hit) to call this stuff all the time, so we do so - ! for simplicity and safety. - ! - ! NOTE(wjs, 2017-02-24) I'm not positive that the above paragraph is 100% true. It - ! is at least *mostly* true, but there may be some subtleties, like resetting of - ! some variables, that are needed even in (some) time steps where we haven't - ! changed weights. - ! ======================================================================== - - call dynSubgrid_wrapup_weight_changes(bounds_clump, glc_behavior) - - call patch_state_updater%set_new_weights(bounds_clump) - call column_state_updater%set_new_weights(bounds_clump, nc) - - call set_subgrid_diagnostic_fields(bounds_clump) - - call initialize_new_columns(bounds_clump, & - prior_weights%cactive(bounds_clump%begc:bounds_clump%endc), & - temperature_inst, waterstate_inst, soilhydrology_inst) - - call dyn_hwcontent_final(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_lakec, filter(nc)%lakec, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst) - - if (use_cn) then - call bgc_vegetation_inst%DynamicAreaConservation(bounds_clump, nc, & - filter_inactive_and_active(nc)%num_soilp, filter_inactive_and_active(nc)%soilp, & - filter_inactive_and_active(nc)%num_soilc, filter_inactive_and_active(nc)%soilc, & - prior_weights, patch_state_updater, column_state_updater, & - canopystate_inst, photosyns_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst, ch4_inst, soilbiogeochem_state_inst) - end if - - end do - !$OMP END PARALLEL DO - - end subroutine dynSubgrid_driver - - !----------------------------------------------------------------------- - subroutine dynSubgrid_wrapup_weight_changes(bounds_clump, glc_behavior) - ! - ! !DESCRIPTION: - ! Reconcile various variables after subgrid weights change - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds_clump ! clump-level bounds - type(glc_behavior_type) , intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'dynSubgrid_wrapup_weight_changes' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds_clump%level == BOUNDS_LEVEL_CLUMP, subname // ': argument must be CLUMP-level bounds') - - call update_landunit_weights(bounds_clump) - - call compute_higher_order_weights(bounds_clump) - - ! Here: filters are re-made - ! - ! This call requires clump-level bounds, which is why we need to ensure that the - ! argument to this routine is clump-level bounds - call reweight_wrapup(bounds_clump, glc_behavior) - - end subroutine dynSubgrid_wrapup_weight_changes - - -end module dynSubgridDriverMod diff --git a/src/dyn_subgrid/dynTimeInfoMod.F90 b/src/dyn_subgrid/dynTimeInfoMod.F90 deleted file mode 100644 index 7a5b6fe014..0000000000 --- a/src/dyn_subgrid/dynTimeInfoMod.F90 +++ /dev/null @@ -1,375 +0,0 @@ -module dynTimeInfoMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains a derived type and associated methods for storing and working with time - ! information for a single dynamic landuse file. The assumption is that there is a - ! single time sample per year. - ! - ! !USES: - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use shr_kind_mod, only: r8 => shr_kind_r8 - ! - implicit none - private - ! - ! !PUBLIC TYPES: - - ! The following provides an enumeration that defines possible values for one of the - ! components of time_info_type. The public instances of the type (defined below) - ! effectively define the enumeration. - type, public :: year_position_type - private - integer :: flag - end type year_position_type - type(year_position_type), parameter, public :: & - YEAR_POSITION_START_OF_TIMESTEP = year_position_type(1), & - YEAR_POSITION_END_OF_TIMESTEP = year_position_type(2) - - type, public :: time_info_type - private - ! Static information about the file: - integer :: nyears ! number of years in the file - integer, allocatable :: years(:) ! all years in this file - - ! Other static information: - type(year_position_type) :: year_position ! how to obtain the model year relative to the current timestep - - ! Information that potentially changes each time step: - integer :: time_index_lower ! lower bound index of the current interval - integer :: time_index_upper ! upper bound index of the current interval - - contains - procedure :: set_current_year ! should be called every time step to update info with the current model year - procedure :: get_time_index_lower ! get lower bound index of current interval - procedure :: get_time_index_upper ! get upper bound index of current interval - procedure :: get_yearfrac ! get the fractional position in the current year - procedure :: get_year ! get the year associated with a given time index - procedure :: is_within_bounds ! return true if we are currently within the bounds of this file - procedure :: is_before_time_series ! returns true if we are currently prior to the bounds of this file - procedure :: is_after_time_series ! returns true if we are currently after the bounds of this file - ! (if the last year of the file is (e.g.) 2005, then this is TRUE if the current year is 2005) - - procedure, private :: set_info_from_year ! given the current model year, sets object data appropriately - procedure, private :: year_in_current_interval ! returns true if the current year is in the current interval - end type time_info_type - - interface time_info_type - module procedure constructor ! initialize a time_info_type object - end interface time_info_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - !----------------------------------------------------------------------- - type(time_info_type) function constructor(my_years, year_position) - ! - ! !DESCRIPTION: - ! Initialize a time_info_type object - ! - ! !ARGUMENTS: - - ! all years in this file: - integer, intent(in) :: my_years(:) - - ! how to obtain the model year relative to the current timestep; must be one of: - ! - YEAR_POSITION_START_OF_TIMESTEP: use the year at the start of the timestep - ! - YEAR_POSITION_END_OF_TIMESTEP: use the year at the end of the timestep - type(year_position_type), intent(in) :: year_position - !----------------------------------------------------------------------- - - constructor%nyears = size(my_years) - allocate(constructor%years(constructor%nyears)) - constructor%years = my_years - constructor%year_position = year_position - - ! Set time_index_lower and time_index_upper arbitrarily; they'll get set correctly by set_current_year - constructor%time_index_lower = 1 - constructor%time_index_upper = 1 - - ! Set time_index_lower and time_index_upper to their correct values - call constructor%set_current_year() - - end function constructor - - - ! ====================================================================== - ! Public methods - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine set_current_year(this) - ! - ! !DESCRIPTION: - ! Update time information (time_index_lower and time_index_upper), based on the - ! current model year. - ! - ! Should be called every time step - ! - ! !USES: - use clm_time_manager , only : get_curr_date, get_prev_date - ! - ! !ARGUMENTS: - class(time_info_type), intent(inout) :: this ! this object - ! - ! !LOCAL VARIABLES: - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - - character(len=*), parameter :: subname = 'set_current_year' - !----------------------------------------------------------------------- - - select case (this%year_position%flag) - case (YEAR_POSITION_START_OF_TIMESTEP%flag) - call get_prev_date(year, mon, day, sec) - case (YEAR_POSITION_END_OF_TIMESTEP%flag) - call get_curr_date(year, mon, day, sec) - case default - write(iulog,*) subname, ': unknown year position: ', this%year_position%flag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - call this%set_info_from_year(year) - - end subroutine set_current_year - - - ! ---------------------------------------------------------------------- - ! Various getter routines - ! ---------------------------------------------------------------------- - - !----------------------------------------------------------------------- - pure integer function get_time_index_lower(this) - ! !DESCRIPTION: Get lower bound index of current interval - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - !----------------------------------------------------------------------- - - get_time_index_lower = this%time_index_lower - end function get_time_index_lower - - !----------------------------------------------------------------------- - pure integer function get_time_index_upper(this) - ! !DESCRIPTION: Get upper bound index of current interval - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - !----------------------------------------------------------------------- - - get_time_index_upper = this%time_index_upper - end function get_time_index_upper - - !----------------------------------------------------------------------- - real(r8) function get_yearfrac(this) - ! - ! !DESCRIPTION: - ! Get the fractional position in the current year (0 at midnight on Jan 1, and 1 at - ! the end of Dec 31). - ! - ! This function uses the year_position metadata of this object to determine whether - ! the fractional position in the year should be determined based on the start or end - ! of the current timestep. - ! - ! !USES: - use clm_time_manager, only : get_curr_yearfrac, get_prev_yearfrac - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_yearfrac' - !----------------------------------------------------------------------- - - select case (this%year_position%flag) - case (YEAR_POSITION_START_OF_TIMESTEP%flag) - get_yearfrac = get_prev_yearfrac() - case (YEAR_POSITION_END_OF_TIMESTEP%flag) - get_yearfrac = get_curr_yearfrac() - case default - write(iulog,*) subname, ': unknown year position: ', this%year_position%flag - call endrun(errMsg(sourcefile, __LINE__)) - end select - - end function get_yearfrac - - - !----------------------------------------------------------------------- - integer function get_year(this, nt) - ! !DESCRIPTION: Get the year associated with time index nt - ! - ! Note this can't be a pure function because of the call to shr_assert - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - integer , intent(in) :: nt ! time index - - character(len=*), parameter :: subname = 'get_year' - !----------------------------------------------------------------------- - - SHR_ASSERT(1 <= nt .and. nt <= this%nyears, subname // ': nt out of bounds') - get_year = this%years(nt) - end function get_year - - !----------------------------------------------------------------------- - pure logical function is_within_bounds(this) - ! !DESCRIPTION: Returns true if we are currently within the bounds of this file - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - !----------------------------------------------------------------------- - - is_within_bounds = ((.not. this%is_before_time_series()) .and. & - (.not. this%is_after_time_series())) - - end function is_within_bounds - - !----------------------------------------------------------------------- - pure logical function is_before_time_series(this) - ! !DESCRIPTION: Returns true if we are currently prior to the bounds of this file - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - !----------------------------------------------------------------------- - - if (this%time_index_upper == 1) then - is_before_time_series = .true. - else - is_before_time_series = .false. - end if - end function is_before_time_series - - !----------------------------------------------------------------------- - pure logical function is_after_time_series(this) - ! !DESCRIPTION: Returns true if we are currently after the bounds of this file - ! - ! If the last year of the file is (e.g.) 2005, then this is TRUE if the current year - ! is 2005 - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this - !----------------------------------------------------------------------- - - if (this%time_index_lower == this%nyears) then - is_after_time_series = .true. - else - is_after_time_series = .false. - end if - end function is_after_time_series - - ! ====================================================================== - ! Private methods - ! ====================================================================== - - !----------------------------------------------------------------------- - pure logical function year_in_current_interval(this, cur_year) - ! !DESCRIPTION: - ! Returns true if the current year is in the current interval - ! - ! !ARGUMENTS: - class(time_info_type), intent(in) :: this ! this object - integer, intent(in) :: cur_year ! current model year - !----------------------------------------------------------------------- - - if (this%years(this%time_index_lower) == cur_year .and. this%years(this%time_index_upper) == (cur_year + 1)) then - ! Normal case: we're within the time series, in the same interval as before - year_in_current_interval = .true. - else if (this%is_before_time_series() .and. cur_year < this%years(1)) then - ! We were and still are before the time series - year_in_current_interval = .true. - else if (this%is_after_time_series() .and. cur_year >= this%years(this%nyears)) then - ! We were and still are after the time series - year_in_current_interval = .true. - else - year_in_current_interval = .false. - end if - - end function year_in_current_interval - - !----------------------------------------------------------------------- - subroutine set_info_from_year(this, cur_year) - ! - ! !DESCRIPTION: - ! Given the current model year, sets time information (time_index_lower and - ! time_index_upper) appropriately. - ! - ! !ARGUMENTS: - class(time_info_type), intent(inout) :: this ! this object - integer, intent(in) :: cur_year ! current model year - ! - ! !LOCAL VARIABLES: - logical :: found ! has the correct interval been found? - integer :: n ! interval index - - character(len=*), parameter :: subname = 'set_info_from_year' - !----------------------------------------------------------------------- - - ! Determine if current date spans the years - ! - ! If current year is less than first timeseries year, then use the first year from - ! dynamic land cover file for both time_index_lower and time_index_upper, forcing constant weights until the - ! model year enters the dynamic land cover dataset timeseries range. - ! - ! If current year is equal to or greater than the last timeseries year, then use the - ! last year for both time_index_lower and time_index_upper, forcing constant weights for the remainder of the - ! simulation. - ! - ! This mechanism permits the introduction of a dynamic pft period in the middle of a - ! simulation, with constant weights before and after the dynamic period. - - associate( & - nyears => this%nyears, & - years => this%years, & - time_index_lower => this%time_index_lower, & - time_index_upper => this%time_index_upper) - - if (year_in_current_interval(this, cur_year)) then - ! DO NOTHING - NT1 AND NT2 ARE ALREADY CORRECT - else - if (cur_year < years(1)) then - ! prior to the first interval - time_index_lower = 1 - time_index_upper = 1 - else if (cur_year >= years(nyears)) then - ! past the last interval - time_index_lower = nyears - time_index_upper = nyears - else - ! within the time bounds of the file - found = .false. - do n = 1, nyears-1 - if (cur_year == years(n)) then - time_index_lower = n - time_index_upper = n + 1 - found = .true. - exit - end if - end do - if (.not. found) then - write(iulog,*) subname//' ERROR: model year not found in pftdyn timeseries' - write(iulog,*)'model year = ',cur_year - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - end if - - SHR_ASSERT(time_index_upper <= nyears, subname // ': time_index_upper should not be greater than nyears') - - end associate - - end subroutine set_info_from_year - -end module dynTimeInfoMod diff --git a/src/dyn_subgrid/dynVarMod.F90.in b/src/dyn_subgrid/dynVarMod.F90.in deleted file mode 100644 index 2cc14e669c..0000000000 --- a/src/dyn_subgrid/dynVarMod.F90.in +++ /dev/null @@ -1,375 +0,0 @@ -module dynVarMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains a derived type and associated methods for working with a single dynamic - ! subgrid variable, which may or may not need time interpolation. - ! - ! This is an abstract type that needs to be extended by a specific derived type - ! (dyn_var_time_uninterp_type or dyn_var_time_interp_type). Besides the lack of - ! definition of some methods, also note that it does NOT define the data - ! themselves. This is because different type extensions have different needs for what - ! data are stored - and particularly whether they need data at just time_index_lower, or data at both - ! time_index_lower and time_index_upper. - ! - ! The use of this class (or its extensions) is: - ! In initialization: - ! - create a new object using the appropriate constructor (a constructor for one of - ! the children of dyn_var_type) - ! - call get_current_data to get the initial data - ! - ! Each time through the run loop: - ! - call get_current_data to get the current value of the data - ! - ! Note that, because of the reads that are done here, the methods of this class should - ! NOT be called from inside threaded regions or loops over clumps - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : iulog - use dynFileMod , only : dyn_file_type - use dynTimeInfoMod , only : time_info_type - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - implicit none - private - ! - ! !PUBLIC TYPES: - - ! maximum number of real dimensions allowed for the underlying variables stored in - ! dyn_var_type - integer, parameter, public :: dyn_var_max_dims = 2 - - public :: dyn_var_type - - ! This is an abstract base class that should be extended. - ! - ! Any type extension needs to define the following methods: - ! - get_current_data_1d - ! - get_current_data_2d - ! - get_current_att - ! - read_data_if_needed - ! - ! In addition, a type extension needs to define the data field(s); these are not defined - ! in the base class because different type extensions have different needs for what data - ! are stored - and particularly whether they need data at just time_index_lower, or data at both time_index_lower - ! and time_index_upper. - ! - ! Although this base class doesn't define the data themselves, note that the - ! implementation here assumes that the data will be stored as a 1-d vector, even if the - ! data are truly 2-d. i.e., the type extension should define its data as: - ! real(r8), allocatable :: data_at_tlower(:) - type, abstract :: dyn_var_type - private - type(dyn_file_type), pointer :: dyn_file ! pointer to the file containing this variable - character(len=256) :: varname ! variable name on file - character(len=256) :: dim1name ! dim1name on file - real(r8) :: conversion_factor ! data are DIVIDED by conversion_factor immediately after reading them - - ! Only relevant for 2-d variables: should we check to make sure that all sums equal 1? - logical :: do_check_sums_equal_1 - - ! Shape of data; max number of dimensions is given by dyn_var_max_dims in dynVarMod. - ! First dimension is the spatial dimension. - ! This is a pointer rather than an allocatable to work around a pgi compiler bug - ! (pgi 13.9) - integer, pointer :: data_shape(:) - - logical :: allow_nodata ! Flag to allow no data on the file or if should die - - logical :: data_on_file ! Flag to indicate if the data is on the file or not - contains - ! Public methods: - - ! The following are public only for the sake of type extensions of this base class; - ! they should not be used outside of these type extensions - procedure :: set_metadata ! Set metadata that are common to all type extensions of this base class - procedure :: get_dyn_file ! Get the dyn_file component - procedure :: get_data_shape ! Get the data_shape component - procedure :: get_att ! Get the variable attribute - procedure :: read_variable ! Wrapper to read a time slice of the variable - - ! The following need to be defined by any type extensions; they need to be public so - ! they can be overridden, but they should not be used outside of type extensions - procedure(get_current_data_1d_interface), deferred :: get_current_data_1d ! Get the current value of the data, for a 1-d variable - procedure(get_current_data_2d_interface), deferred :: get_current_data_2d ! Get the current value of the daat, for a 2-d variable - procedure(read_data_if_needed_interface), deferred :: read_data_if_needed ! Read the next time slice of data, if necessary - - ! Private methods: - procedure, private :: read_variable_1d ! Read a time slice of a 1-d variable - procedure, private :: read_variable_2d ! Read a time slice of a 2-d variable - end type dyn_var_type - - abstract interface - - subroutine read_data_if_needed_interface(this) - ! !DESCRIPTION: - ! Determine if new data need to be read from the file; if so, read them. - ! - ! !USES: - import :: dyn_var_type - ! - ! !ARGUMENTS: - class(dyn_var_type), intent(inout) :: this ! this object - end subroutine read_data_if_needed_interface - - ! DIMS 1,2 - subroutine get_current_data_{DIMS}d_interface(this, cur_data) - ! !DESCRIPTION: - ! Get the current (possibly interpolated) value of the data, in cur_data. cur_data - ! should have the same dimensionality as the underlying data, as given by the - ! data_shape argument that was passed to the constructor. - ! - ! If necessary, new data are read from the file. - ! - ! Should be called once per time step, AFTER calling set_current_year on the - ! underlying dyn_file variable - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - import :: dyn_var_type - ! - ! !ARGUMENTS: - class(dyn_var_type) , intent(inout) :: this ! this object - real(r8) , intent(out) :: cur_data{DIMSTR} ! current value of data - end subroutine get_current_data_{DIMS}d_interface - - end interface - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - -contains - - ! ====================================================================== - ! Public methods - ! - ! The following are public only for the sake of type extensions of this base class. - ! They should not be used outside these type extensions. - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine set_metadata(this, dyn_file, varname, dim1name, conversion_factor, & - do_check_sums_equal_1, data_shape, allow_nodata) - ! - ! !DESCRIPTION: - ! Set metadata that are common to all type extensions of this base class - ! - ! !USES: - ! - ! !ARGUMENTS: - class(dyn_var_type) , intent(inout) :: this ! this object - type(dyn_file_type) , target, intent(in) :: dyn_file ! file containing this variable - character(len=*) , intent(in) :: varname ! variable name on file - character(len=*) , intent(in) :: dim1name ! dim1name on file - real(r8) , intent(in) :: conversion_factor ! data are DIVIDED by conversion_factor immediately after reading them - logical, optional , intent(in) :: allow_nodata ! Flag to indicate if it's allowed to NOT have data on the file - - ! Only relevant for 2-d variables: should we check to make sure that all sums equal 1? - logical, intent(in) :: do_check_sums_equal_1 - - ! Shape of data; max number of dimensions is given by dyn_var_max_dims in dynVarMod. - ! First dimension is the spatial dimension. - integer, intent(in) :: data_shape(:) - - ! - ! !LOCAL VARIABLES: - integer :: ndims ! number of dimensions in data - - character(len=*), parameter :: subname = 'set_metadata' - !----------------------------------------------------------------------- - - ndims = size(data_shape) - - ! Do some error checking on the inputs - SHR_ASSERT(ndims <= dyn_var_max_dims, subname//' ERROR: ndims must be <= dyn_var_max_dims') - if (do_check_sums_equal_1) then - SHR_ASSERT(ndims == 2, subname//' ERROR: do_check_sums_equal_1 only valid for ndims==2') - end if - - ! Set metadata for this variable - this%dyn_file => dyn_file - this%varname = varname - this%dim1name = dim1name - this%conversion_factor = conversion_factor - this%do_check_sums_equal_1 = do_check_sums_equal_1 - allocate(this%data_shape(ndims)) - this%data_shape = data_shape - - if ( present(allow_nodata) )then - this%allow_nodata = allow_nodata - else - this%allow_nodata = .false. - end if - this%data_on_file = .false. - - end subroutine set_metadata - - - !----------------------------------------------------------------------- - function get_dyn_file(this) - ! - ! !DESCRIPTION: - ! Get the dyn_file component of this object - ! - ! !ARGUMENTS: - type(dyn_file_type) , pointer :: get_dyn_file - class(dyn_var_type) , intent(in) :: this ! this object - !----------------------------------------------------------------------- - get_dyn_file => this%dyn_file - end function get_dyn_file - - !----------------------------------------------------------------------- - function get_data_shape(this) - ! - ! !DESCRIPTION: - ! Get the data_shape component of this object - ! - ! !ARGUMENTS: - integer , allocatable :: get_data_shape(:) - class(dyn_var_type) , intent(in) :: this ! this object - !----------------------------------------------------------------------- - allocate(get_data_shape(size(this%data_shape))) - get_data_shape = this%data_shape - end function get_data_shape - - !----------------------------------------------------------------------- - subroutine get_att(this,attname,attvalue) - ! - ! !DESCRIPTION: - ! Get the the value of an attribute on the file - ! - ! !USES: - use ncdio_pio , only : ncd_inqvid, ncd_getatt, var_desc_t - ! !ARGUMENTS: - class(dyn_var_type) , intent(inout):: this ! this object - character(len=*) , intent(in) :: attname ! name of the attribute - character(len=*) , intent(out) :: attvalue ! value of the attribute - ! !LOCAL VARIABLES: - integer :: varid ! variable id - type(var_desc_t) :: vardesc ! variable descriptor - character(len=*), parameter :: subname = 'get_att' - !----------------------------------------------------------------------- - call ncd_inqvid(this%dyn_file, this%varname, varid, vardesc) - call ncd_getatt(this%dyn_file, varid, attname, attvalue) - end subroutine get_att - - !----------------------------------------------------------------------- - subroutine read_variable(this, nt, data) - ! - ! !DESCRIPTION: - ! Wrapper to read a time slice of the variable; result goes in the data argument. - ! - ! !USES: - use spmdMod , only : masterproc - ! - ! !ARGUMENTS: - class(dyn_var_type) , intent(inout) :: this ! this object - integer , intent(in) :: nt ! time index to read - real(r8) , intent(out) :: data(:) ! variable holding data read from file - ! - ! !LOCAL VARIABLES: - integer :: ndims ! number of dimensions of the underlying variable - - character(len=*), parameter :: subname = 'read_variable' - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Get data for variable ', trim(this%varname), ' for year ', & - this%dyn_file%time_info%get_year(nt) - end if - - ndims = size(this%data_shape) - if (ndims == 1) then - call read_variable_1d(this, nt, data) - else if (ndims == 2) then - call read_variable_2d(this, nt, data) - else - call endrun(msg='ERROR: read_variable can only handle 1 or 2 dimensions'//& - errMsg(sourcefile, __LINE__)) - end if - - end subroutine read_variable - - - ! ====================================================================== - ! Private methods - ! ====================================================================== - - ! DIMS 1,2 - !----------------------------------------------------------------------- - subroutine read_variable_{DIMS}d(this, nt, data) - ! - ! !DESCRIPTION: - ! Read a time slice of a {DIMS}-d variable - ! This routine applies the conversion given by conversion_factor. - ! - ! !USES: - use spmdMod , only : masterproc - use ncdio_pio , only : ncd_io - use surfrdUtilsMod , only : check_sums_equal_1 - ! - ! !ARGUMENTS: - class(dyn_var_type) , intent(inout) :: this ! this object (needs to be intent(inout) because this%dynfile is intent(inout) in the ncd_io call) - integer , intent(in) :: nt ! time index to read - ! variable holding data read from file (note that this is 1-d regardless of the - ! dimensionality of the underlying data) - real(r8) , intent(out) :: data(:) - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: arrayl{DIMSTR} ! temporary array to hold data (needs to be a pointer) - logical :: readvar ! whether variable was read - logical :: die_on_error ! Flag if should die on error or just give a warning - - character(len=*), parameter :: subname = 'read_variable_{DIMS}d' - !----------------------------------------------------------------------- - die_on_error = .true. - if ( this%allow_nodata ) then - die_on_error = .false. - end if - - ! The following doesn't seem to be allowed: - ! allocate(arrayl(this%data_shape)) - ! So instead we have to do this in a more ugly way: -#if ({DIMS}==1) - allocate(arrayl(this%data_shape(1))) -#elif ({DIMS}==2) - allocate(arrayl(this%data_shape(1), this%data_shape(2))) -#endif - - call ncd_io(ncid=this%dyn_file, varname=this%varname, flag='read', data=arrayl, & - dim1name=this%dim1name, nt=nt, readvar=readvar) - if (.not. readvar) then - if ( die_on_error ) then - call endrun(msg=' ERROR: ' // trim(this%varname) // ' NOT on file'//& - errMsg(sourcefile, __LINE__)) - else - if ( masterproc ) & - write(iulog,*) ' WARNING: ' // trim(this%varname) // ' NOT on file set to zero' - data = 0.0_r8 - end if - this%data_on_file = .false. - end if - - if ( readvar )then - this%data_on_file = .true. - arrayl = arrayl / this%conversion_factor - - ! The following needs to be in an ifdef because the check_sums_equal_1 interface - ! requires a 2-d array -#if ({DIMS}==2) - if (this%do_check_sums_equal_1) then - call check_sums_equal_1(arrayl, 1, this%varname, subname) - end if -#endif - - data = reshape(arrayl, shape(data)) - end if - - deallocate(arrayl) - end subroutine read_variable_{DIMS}d - -end module dynVarMod diff --git a/src/dyn_subgrid/dynVarTimeInterpMod.F90.in b/src/dyn_subgrid/dynVarTimeInterpMod.F90.in deleted file mode 100644 index 614b3d4d33..0000000000 --- a/src/dyn_subgrid/dynVarTimeInterpMod.F90.in +++ /dev/null @@ -1,219 +0,0 @@ -module dynVarTimeInterpMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains a derived type and associated methods that extend the base class, - ! dyn_var_type. The type defined here is for variables that SHOULD be interpolated in - ! time. For variables of this type, the data have the value given on year Y of the file - ! at midnight on Jan. 1 at the start of year Y. The value then gets linearly - ! interpolated over the year, so that by Dec. 31 of year Y, the value is close to the - ! file's value at year Y+1. Before the start of the time series, the data are fixed at - ! their value from the first year in the file; after the end of the time series, the - ! data are fixed at their value from the last year in the file. If the last year on the - ! file is X, then the data are fixed at this last value (and thus do not vary) - ! throughout year X. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use dynVarMod , only : dyn_var_type - - implicit none - private - ! - ! !PUBLIC TYPES: - public :: dyn_var_time_interp_type - - type, extends(dyn_var_type) :: dyn_var_time_interp_type - private - ! Note that data are stored as 1-d, then converted to the appropriate dimensionality - ! as needed - real(r8), allocatable :: data_at_tlower(:) ! data at time time_index_lower - real(r8), allocatable :: data_at_tupper(:) ! data at time time_index_upper - - integer :: time_index_lower ! current time_index_lower curresponding to data_at_tlower - integer :: time_index_upper ! current time_index_upper curresponding to data_at_tupper - contains - generic :: get_current_data => & ! Get the current value of the data - get_current_data_1d, get_current_data_2d - procedure :: get_current_data_1d ! Get the current value of the data, for a 1-d variable - procedure :: get_current_data_2d ! Get the current value of the data, for a 2-d variable - procedure :: read_data_if_needed ! Read the next time slice of data, if necessary - end type dyn_var_time_interp_type - - interface dyn_var_time_interp_type - module procedure constructor ! initialize a new dyn_var_time_interp object - end interface dyn_var_time_interp_type - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - !----------------------------------------------------------------------- - type(dyn_var_time_interp_type) function constructor( & - dyn_file, varname, dim1name, conversion_factor, & - do_check_sums_equal_1, data_shape) - ! - ! !DESCRIPTION: - ! Creates an object of type dyn_var_time_interp_type. This also reads the first - ! set of data. - ! - ! Assumes that dyn_file has already been initialized. - ! - ! !USES: - use dynFileMod , only : dyn_file_type - use dynTimeInfoMod , only : time_info_type - ! - ! !ARGUMENTS: - type(dyn_file_type), target, intent(in) :: dyn_file ! file containing this variable - character(len=*), intent(in) :: varname ! variable name on file - character(len=*), intent(in) :: dim1name ! dim1name on file - real(r8), intent(in) :: conversion_factor ! data are DIVIDED by conversion_factor immediately after reading them - - ! Only relevant for 2-d variables: should we check to make sure that all sums equal 1? - logical, intent(in) :: do_check_sums_equal_1 - - ! Shape of data; max number of dimensions is given by dyn_var_max_dims in dynVarMod. - ! First dimension is the spatial dimension. - integer, intent(in) :: data_shape(:) - !----------------------------------------------------------------------- - - ! Set metadata common to all dyn_var_type objects - call constructor%set_metadata( & - dyn_file=dyn_file, & - varname=varname, & - dim1name=dim1name, & - conversion_factor=conversion_factor, & - do_check_sums_equal_1=do_check_sums_equal_1, & - data_shape=data_shape) - - ! Allocate space for data - allocate(constructor%data_at_tlower(product(data_shape))) - allocate(constructor%data_at_tupper(product(data_shape))) - - ! Read first set of data - constructor%time_index_lower = dyn_file%time_info%get_time_index_lower() - constructor%time_index_upper = dyn_file%time_info%get_time_index_upper() - call constructor%read_variable(constructor%time_index_lower, constructor%data_at_tlower) - call constructor%read_variable(constructor%time_index_upper, constructor%data_at_tupper) - end function constructor - - ! ====================================================================== - ! Public methods - ! ====================================================================== - - ! The following specific procedures are NOT actually public, but they can be accessed - ! via the generic type-bound procedure, get_current_data - - ! DIMS 1,2 - !----------------------------------------------------------------------- - subroutine get_current_data_{DIMS}d(this, cur_data) - ! - ! !DESCRIPTION: - ! Get the current, interpolated value of the data, in cur_data. cur_data should have - ! the same dimensionality as the underlying data, as given by the data_shape argument - ! that was passed to the constructor. - ! - ! If necessary, new data are read from the file. - ! - ! Should be called once per time step, AFTER calling set_current_year on the - ! underlying dyn_file variable - ! - ! !USES: - use dynFileMod , only : dyn_file_type - ! - ! !ARGUMENTS: - class(dyn_var_time_interp_type) , intent(inout) :: this ! this object - real(r8) , intent(out) :: cur_data{DIMSTR} ! current value of data - ! - ! !LOCAL VARIABLES: - type(dyn_file_type), pointer :: dyn_file ! the dyn_file of this object - integer :: ndims ! ndims of data in 'this' - real(r8) :: wt1 ! weight of time1 (the left-hand time point) - real(r8), allocatable :: cur_data_1d(:) ! 1-d version of data at the current time - character(len=*), parameter :: subname = 'get_current_data_{DIMS}d' - !----------------------------------------------------------------------- - - ! Do some error checking - ndims = size(this%get_data_shape()) - SHR_ASSERT({DIMS} == ndims, subname//' ERROR: # dims of output argument must match ndims') - SHR_ASSERT_ALL((shape(cur_data) == this%get_data_shape()), subname//' ERROR: shape of cur_data must match shape of data') - - ! Get current data, using a temporal weighting of the data at time 1 and the data at - ! time 2 - call this%read_data_if_needed() - allocate(cur_data_1d(size(this%data_at_tlower))) - - dyn_file => this%get_dyn_file() - wt1 = 1.0_r8 - dyn_file%time_info%get_yearfrac() - - cur_data_1d(:) = this%data_at_tupper(:) + wt1*(this%data_at_tlower(:) - this%data_at_tupper(:)) - cur_data = reshape(cur_data_1d, shape(cur_data)) - deallocate(cur_data_1d) - - end subroutine get_current_data_{DIMS}d - - ! ====================================================================== - ! Private methods - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine read_data_if_needed(this) - ! - ! !DESCRIPTION: - ! Determine if new data need to be read from the file; if so, read them. - ! - ! We need to read new data (or at least copy them) if the current time on dyn_file - ! disagrees with the time for which we currently have stored data, for either time time_index_lower - ! or time time_index_upper - ! - ! !USES: - use dynFileMod , only : dyn_file_type - use dynTimeInfoMod , only : time_info_type - ! - ! !ARGUMENTS: - class(dyn_var_time_interp_type), intent(inout) :: this ! this object - ! - ! !LOCAL VARIABLES: - type(dyn_file_type), pointer :: dyn_file ! the dyn_file of this object - integer :: time_index_lower_cur ! current value of time_index_lower on dyn_fileb - integer :: time_index_upper_cur ! current value of time_index_upper on dyn_fileb - - character(len=*), parameter :: subname = 'read_data_if_needed' - !----------------------------------------------------------------------- - - dyn_file => this%get_dyn_file() - time_index_lower_cur = dyn_file%time_info%get_time_index_lower() - time_index_upper_cur = dyn_file%time_info%get_time_index_upper() - - ! If time_index_lower time has changed, get a new set of data for time time_index_lower - if (time_index_lower_cur /= this%time_index_lower) then - - ! The typical case is that we have moved forward by a single time; thus we can - ! avoid an extra read by simply setting the new data at time_index_lower equal to the old data - ! at time_index_upper - if (time_index_lower_cur == this%time_index_upper) then - this%data_at_tlower(:) = this%data_at_tupper(:) - - ! Otherwise, handle the general (but atypical) case where we have not moved - ! forward by a single time - else - call this%read_variable(time_index_lower_cur, this%data_at_tlower) - end if - - this%time_index_lower = time_index_lower_cur - end if - - ! If time_index_upper time has changed, read a new set of data for time time_index_upper - if (time_index_upper_cur /= this%time_index_upper) then - call this%read_variable(time_index_upper_cur, this%data_at_tupper) - this%time_index_upper = time_index_upper_cur - end if - - end subroutine read_data_if_needed - - -end module dynVarTimeInterpMod diff --git a/src/dyn_subgrid/dynVarTimeUninterpMod.F90.in b/src/dyn_subgrid/dynVarTimeUninterpMod.F90.in deleted file mode 100644 index b992fb2955..0000000000 --- a/src/dyn_subgrid/dynVarTimeUninterpMod.F90.in +++ /dev/null @@ -1,181 +0,0 @@ -module dynVarTimeUninterpMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains a derived type and associated methods that extend the base class, - ! dyn_var_type. The type defined here is for variables that should NOT be interpolated - ! in time. For variables of this type, the data will snap to their new value at the - ! beginning of each year, and then stay fixed throughout the year. Before the start of - ! the time series, the data are fixed at their value from the first year in the file; - ! after the end of the time series, the data are fixed at their value from the last year - ! in the file. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use dynVarMod , only : dyn_var_type - - implicit none - private - save - - ! !PUBLIC TYPES: - public :: dyn_var_time_uninterp_type - - type, extends(dyn_var_type) :: dyn_var_time_uninterp_type - private - ! Note that data are stored as 1-d, then converted to the appropriate dimensionality - ! as needed - real(r8), allocatable :: data_at_tlower(:) ! data at time time_index_lower - integer :: time_index_lower ! current time_index_lower corresponding to the data - contains - generic :: get_current_data => & ! Get the current value of the data - get_current_data_1d, get_current_data_2d - procedure :: get_current_data_1d ! Get the current value of the data, for a 1-d variable - procedure :: get_current_data_2d ! Get the current value of the data, for a 2-d variable - procedure :: read_data_if_needed ! Read the next time slice of data, if necessary - end type dyn_var_time_uninterp_type - - interface dyn_var_time_uninterp_type - module procedure constructor ! initialize a new dyn_var_time_uninterp_type object - end interface dyn_var_time_uninterp_type - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - !----------------------------------------------------------------------- - type(dyn_var_time_uninterp_type) function constructor( & - dyn_file, varname, dim1name, conversion_factor, & - do_check_sums_equal_1, data_shape, allow_nodata) - ! - ! !DESCRIPTION: - ! Creates an object of type dyn_var_time_uninterp_type. This also reads the first - ! set of data. - ! - ! Assumes that dyn_file has already been initialized. - ! - ! !USES: - use dynFileMod , only : dyn_file_type - use dynTimeInfoMod , only : time_info_type - ! - ! !ARGUMENTS: - type(dyn_file_type), target, intent(in) :: dyn_file ! file containing this variable - character(len=*), intent(in) :: varname ! variable name on file - character(len=*), intent(in) :: dim1name ! dim1name on file - real(r8), intent(in) :: conversion_factor ! data are DIVIDED by conversion_factor immediately after reading them - logical, optional, intent(in) :: allow_nodata ! Flag to allow there to be no data if the field doesn't exist on the dataset - - ! Only relevant for 2-d variables: should we check to make sure that all sums equal 1? - logical, intent(in) :: do_check_sums_equal_1 - - ! Shape of data; max number of dimensions is given by dyn_var_max_dims in dynVarMod. - ! First dimension is the spatial dimension. - integer, intent(in) :: data_shape(:) - - logical :: lallow_nodata ! Local version of allow_nodata which is by default FALSE - !----------------------------------------------------------------------- - - lallow_nodata = .false. - if ( present(allow_nodata) )then - lallow_nodata = allow_nodata - end if - ! Set metadata common to all dyn_var_type objects - call constructor%set_metadata( & - dyn_file=dyn_file, & - varname=varname, & - dim1name=dim1name, & - conversion_factor=conversion_factor, & - do_check_sums_equal_1=do_check_sums_equal_1, & - data_shape=data_shape, allow_nodata=lallow_nodata) - - ! Allocate space for data - allocate(constructor%data_at_tlower(product(data_shape))) - - ! Read first set of data - constructor%time_index_lower = dyn_file%time_info%get_time_index_lower() - call constructor%read_variable(constructor%time_index_lower, constructor%data_at_tlower) - end function constructor - - ! ====================================================================== - ! Public methods - ! ====================================================================== - - ! The following specific procedures are NOT actually public, but they can be accessed - ! via the generic type-bound procedure, get_current_data - - ! DIMS 1,2 - !----------------------------------------------------------------------- - subroutine get_current_data_{DIMS}d(this, cur_data) - ! - ! !DESCRIPTION: - ! Get the current value of the data, in cur_data. cur_data should have the same - ! dimensionality as the underlying data, as given by the data_shape argument that was - ! passed to the constructor. - ! - ! If necessary, new data are read from the file. - ! - ! Should be called once per time step, AFTER calling set_current_year on the - ! underlying dyn_file variable - ! - ! !ARGUMENTS: - class(dyn_var_time_uninterp_type) , intent(inout) :: this ! this object - real(r8) , intent(out) :: cur_data{DIMSTR} ! current value of data - ! - ! !LOCAL VARIABLES: - integer :: ndims ! ndims of data in 'this' - - character(len=*), parameter :: subname = 'get_current_data_{DIMS}d' - !----------------------------------------------------------------------- - - ! Do some error checking - ndims = size(this%get_data_shape()) - SHR_ASSERT({DIMS} == ndims, subname//' ERROR: # dims of output argument must match ndims') - SHR_ASSERT_ALL((shape(cur_data) == this%get_data_shape()), subname//' ERROR: shape of cur_data must match shape of data') - - ! Get current data - call this%read_data_if_needed() - cur_data = reshape(this%data_at_tlower, shape(cur_data)) - - end subroutine get_current_data_{DIMS}d - - ! ====================================================================== - ! Private methods - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine read_data_if_needed(this) - ! - ! !DESCRIPTION: - ! Determine if new data need to be read from the file; if so, read them. - ! - ! We need to read new data if the current time on dyn_file disagrees with the time - ! for which we currently have stored data. - ! - ! !USES: - use dynFileMod , only : dyn_file_type - use dynTimeInfoMod , only : time_info_type - ! - ! !ARGUMENTS: - class(dyn_var_time_uninterp_type), intent(inout) :: this ! this object - ! - ! !LOCAL VARIABLES: - type(dyn_file_type), pointer :: dyn_file ! the dyn_file of this object - integer :: time_index_lower_cur ! current value of time_index_lower on dyn_file - - character(len=*), parameter :: subname = 'read_data_if_needed' - !----------------------------------------------------------------------- - - dyn_file => this%get_dyn_file() - time_index_lower_cur = dyn_file%time_info%get_time_index_lower() - if (time_index_lower_cur /= this%time_index_lower) then - call this%read_variable(time_index_lower_cur, this%data_at_tlower) - this%time_index_lower = time_index_lower_cur - end if - end subroutine read_data_if_needed - - -end module dynVarTimeUninterpMod diff --git a/src/dyn_subgrid/dyncropFileMod.F90 b/src/dyn_subgrid/dyncropFileMod.F90 deleted file mode 100644 index 9921ab5954..0000000000 --- a/src/dyn_subgrid/dyncropFileMod.F90 +++ /dev/null @@ -1,201 +0,0 @@ -module dyncropFileMod - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle reading of the dataset that specifies transient areas the crop landunit as - ! well as the breakdown of each crop. - ! - ! !USES: -#include "shr_assert.h" - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use dynFileMod , only : dyn_file_type - use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type - use clm_varctl , only : iulog - use clm_varcon , only : grlnd, namec - use abortutils , only : endrun - use spmdMod , only : masterproc, mpicom - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - save - public :: dyncrop_init ! initialize information read from landuse.timeseries dataset - public :: dyncrop_interp ! get crop data for the current time step, if needed - ! - ! ! PRIVATE TYPES - type(dyn_file_type), target :: dyncrop_file ! information for the file containing transient crop data - type(dyn_var_time_uninterp_type) :: wtcrop ! weight of the crop landunit - type(dyn_var_time_uninterp_type) :: wtcft ! weight of each CFT relative to the crop landunit - type(dyn_var_time_uninterp_type) :: fertcft ! fertilizer of each CFT - - ! Names of variables on file - character(len=*), parameter :: crop_varname = 'PCT_CROP' - character(len=*), parameter :: cft_varname = 'PCT_CFT' - character(len=*), parameter :: fert_varname = 'FERTNITRO_CFT' - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !--------------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine dyncrop_init(bounds, dyncrop_filename) - ! - ! !DESCRIPTION: - ! Initialize dataset containing transient crop info (position it to the right time - ! samples that bound the initial model date) - ! - ! !USES: - use clm_varpar , only : cft_size - use ncdio_pio , only : check_dim - use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! proc-level bounds - character(len=*) , intent(in) :: dyncrop_filename ! name of file containing transient crop information - ! - ! !LOCAL VARIABLES: - integer :: num_points ! number of spatial points - integer :: wtcft_shape(2) ! shape of the wtcft data - integer :: fertcft_shape(2) ! shape of the fertcft data - - character(len=*), parameter :: subname = 'dyncrop_init' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - if (masterproc) then - write(iulog,*) 'Attempting to read crop dynamic landuse data .....' - end if - - ! Get the year from the START of the timestep; this way, we'll update crop areas - ! starting after the year boundary. This is consistent with the timing of glacier - ! updates, and will likely be consistent with the timing of crop updates determined - ! prognostically, if crop areas are ever determined prognostically rather than - ! prescribed ahead of time. - dyncrop_file = dyn_file_type(dyncrop_filename, YEAR_POSITION_START_OF_TIMESTEP) - call check_dim(dyncrop_file, 'cft', cft_size) - - ! read data PCT_CROP and PCT_CFT corresponding to correct year - ! - ! Note: if you want to change transient crops so that they are interpolated, rather - ! than jumping to each year's value on Jan 1 of that year, simply change wtcrop and - ! wtcft to be of type dyn_var_time_interp_type (rather than - ! dyn_var_time_uninterp_type), and change the following constructors to construct - ! variables of dyn_var_time_interp_type. That's all you need to do. - num_points = (bounds%endg - bounds%begg + 1) - wtcrop = dyn_var_time_uninterp_type( & - dyn_file = dyncrop_file, varname=crop_varname, & - dim1name=grlnd, conversion_factor=100._r8, & - do_check_sums_equal_1=.false., data_shape=[num_points]) - wtcft_shape = [num_points, cft_size] - wtcft = dyn_var_time_uninterp_type( & - dyn_file = dyncrop_file, varname=cft_varname, & - dim1name=grlnd, conversion_factor=100._r8, & - do_check_sums_equal_1=.true., data_shape=wtcft_shape) - fertcft_shape = [num_points, cft_size] - fertcft = dyn_var_time_uninterp_type( & - dyn_file = dyncrop_file, varname=fert_varname, & - dim1name=grlnd, conversion_factor=1._r8, & - do_check_sums_equal_1=.false., data_shape=fertcft_shape, & - allow_nodata=.true.) - - end subroutine dyncrop_init - - !----------------------------------------------------------------------- - subroutine dyncrop_interp(bounds,crop_inst) - ! - ! !DESCRIPTION: - ! Get crop cover for model time, when needed. - ! - ! Sets col%wtlunit and lun%wtgcell for crop landunits. - ! - ! Note that crop cover currently jumps to its new value at the start of the year. - ! However, as mentioned above, this behavior can be changed to time interpolation - ! simply by making wtcrop and wtcft dyn_var_time_interp_type variables rather than - ! dyn_var_time_uninterp_type. - ! - ! !USES: - use CropType , only : crop_type - use landunit_varcon , only : istcrop - use clm_varpar , only : cft_lb, cft_ub - use surfrdUtilsMod , only : collapse_crop_types - use subgridWeightsMod , only : set_landunit_weight - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! proc-level bounds - type(crop_type), intent(in) :: crop_inst ! crop instance for updating annual fertilizer - ! - ! !LOCAL VARIABLES: - integer :: m,p,c,l,g ! indices - real(r8), allocatable :: wtcrop_cur(:) ! current weight of the crop landunit - real(r8), allocatable :: wtcft_cur(:,:) ! current cft weights - real(r8), allocatable :: fertcft_cur(:,:) ! current cft fertilizer - logical , allocatable :: col_set(:) ! whether we have set the weight for each column - - character(len=*), parameter :: subname = 'dyncrop_interp' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - call dyncrop_file%time_info%set_current_year() - - ! Set new landunit area - allocate(wtcrop_cur(bounds%begg:bounds%endg)) - call wtcrop%get_current_data(wtcrop_cur) - do g = bounds%begg, bounds%endg - call set_landunit_weight(g, istcrop, wtcrop_cur(g)) - end do - deallocate(wtcrop_cur) - - ! Set new CFT weights - ! - ! Assumes that memory has been allocated for all CFTs on the crop landunit, and that - ! each crop is on its own column. - allocate(wtcft_cur(bounds%begg:bounds%endg, cft_lb:cft_ub)) - call wtcft%get_current_data(wtcft_cur) - - allocate(fertcft_cur(bounds%begg:bounds%endg, cft_lb:cft_ub)) - call fertcft%get_current_data(fertcft_cur) - - call collapse_crop_types(wtcft_cur, fertcft_cur, bounds%begg, bounds%endg, verbose = .false.) - - allocate(col_set(bounds%begc:bounds%endc)) - col_set(:) = .false. - - do p = bounds%begp, bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - c = patch%column(p) - - if (lun%itype(l) == istcrop) then - m = patch%itype(p) - - ! The following assumes there is a single CFT on each crop column. The - ! error-check with col_set helps ensure this is the case. - - if (col_set(c)) then - write(iulog,*) subname//' ERROR: attempt to set a column that has already been set.' - write(iulog,*) 'This may happen if there are multiple crops on a single column.' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - - col%wtlunit(c) = wtcft_cur(g,m) - crop_inst%fertnitro_patch(p) = fertcft_cur(g,m) - col_set(c) = .true. - end if - end do - - deallocate(wtcft_cur) - deallocate(fertcft_cur) - deallocate(col_set) - - end subroutine dyncrop_interp - -end module dyncropFileMod diff --git a/src/dyn_subgrid/dynpftFileMod.F90 b/src/dyn_subgrid/dynpftFileMod.F90 deleted file mode 100644 index 9280d70157..0000000000 --- a/src/dyn_subgrid/dynpftFileMod.F90 +++ /dev/null @@ -1,295 +0,0 @@ -module dynpftFileMod - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle reading of the pftdyn dataset, which specifies transient areas of natural Patches - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC - use dynFileMod , only : dyn_file_type - use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type - use clm_varctl , only : iulog - use abortutils , only : endrun - use spmdMod , only : masterproc, mpicom - use clm_varcon , only : grlnd, nameg - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - private - save - public :: dynpft_init ! initialize information read from pftdyn dataset - public :: dynpft_interp ! interpolate pftdyn information to current time step - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: dynpft_check_consistency ! check consistency with surface dataset - private :: dynpft_read_consistency_nl ! read namelist associated with consistency checks - ! - ! ! PRIVATE TYPES - type(dyn_file_type), target :: dynpft_file ! information for the pftdyn file - type(dyn_var_time_uninterp_type) :: wtpatch ! weight of each patch relative to the natural veg landunit - - character(len=*), parameter :: varname = 'PCT_NAT_PFT' ! name of variable on file - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !--------------------------------------------------------------------------- - -contains - - - !----------------------------------------------------------------------- - subroutine dynpft_init(bounds, dynpft_filename) - ! - ! !DESCRIPTION: - ! Initialize dynamic pft dataset (position it to the right time samples - ! that bound the initial model date) - ! - ! !USES: - use clm_varpar , only : numpft, maxpatch_pft, natpft_size - use ncdio_pio - use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! proc-level bounds - character(len=*) , intent(in) :: dynpft_filename ! name of file containing transient pft information - ! - ! !LOCAL VARIABLES: - integer :: wtpatch_shape(2) ! shape of the wtpatch data - - character(len= 32) :: subname='dynpft_init'! subroutine name - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - ! Error check - - if ( maxpatch_pft /= numpft+1 )then - call endrun(msg=' maxpatch_pft does NOT equal numpft+1 -- this is invalid for dynamic PFT case'//& - errMsg(sourcefile, __LINE__) ) - end if - - if (masterproc) then - write(iulog,*) 'Attempting to read pft dynamic landuse data .....' - end if - - ! Get the year from the START of the timestep; this way, we'll update PFT areas - ! starting after the year boundary. This is consistent with the timing of other area - ! updates. - dynpft_file = dyn_file_type(dynpft_filename, YEAR_POSITION_START_OF_TIMESTEP) - - ! Consistency checks - call check_dim(dynpft_file, 'natpft', natpft_size) - call dynpft_check_consistency(bounds) - - ! read data PCT_NAT_PFT corresponding to correct year - ! - ! Note: if you want to change PCT_NAT_PFT so that it is interpolated, rather than - ! jumping to each year's value on Jan 1 of that year, simply change wtpatch to be of type - ! dyn_var_time_interp_type (rather than dyn_var_time_uninterp_type), and change the - ! following constructor to construct a variable of dyn_var_time_interp_type. That's - ! all you need to do. - - wtpatch_shape = [(bounds%endg-bounds%begg+1), natpft_size] - wtpatch = dyn_var_time_uninterp_type( & - dyn_file=dynpft_file, varname=varname, & - dim1name=grlnd, conversion_factor=100._r8, & - do_check_sums_equal_1=.true., data_shape=wtpatch_shape) - - end subroutine dynpft_init - - !----------------------------------------------------------------------- - subroutine dynpft_check_consistency(bounds) - ! - ! !DESCRIPTION: - ! Check consistency between dynpft file and surface dataset. - ! - ! This is done by assuming that PCT_NAT_PFT at time 1 in the pftdyn file agrees with - ! PCT_NAT_PFT on the surface dataset. - ! - ! !USES: - use clm_instur, only : wt_nat_patch - use clm_varpar, only : natpft_size - use ncdio_pio - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! proc-level bounds - ! - ! !LOCAL VARIABLES: - logical :: check_dynpft_consistency ! whether to do the consistency check in this routine - integer :: g ! index - real(r8), pointer :: wtpatch_time1(:,:) ! weight of each pft in each grid cell at first time - logical :: readvar ! whether variable was read - real(r8), parameter :: tol = 1.e-6_r8 ! tolerance for checking equality - - character(len=*), parameter :: subname = 'dynpft_check_consistency' - !----------------------------------------------------------------------- - - call dynpft_read_consistency_nl(check_dynpft_consistency) - - if (check_dynpft_consistency) then - - ! Read first time slice of PCT_NAT_PFT - - allocate(wtpatch_time1(bounds%begg:bounds%endg, natpft_size)) - call ncd_io(ncid=dynpft_file, varname=varname, flag='read', data=wtpatch_time1, & - dim1name=grlnd, nt=1, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: ' // trim(varname) // ' NOT on landuse_timeseries file'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Convert from PCT to weight on grid cell - wtpatch_time1(bounds%begg:bounds%endg,:) = wtpatch_time1(bounds%begg:bounds%endg,:) / 100._r8 - - ! Compare with values read from surface dataset - do g = bounds%begg, bounds%endg - if (any(abs(wtpatch_time1(g,:) - wt_nat_patch(g,:)) > tol)) then - write(iulog,*) subname//' mismatch between PCT_NAT_PFT at initial time and that obtained from surface dataset' - write(iulog,*) 'On landuse_timeseries file: ', wtpatch_time1(g,:) - write(iulog,*) 'On surface dataset: ', wt_nat_patch(g,:) - write(iulog,*) ' ' - write(iulog,*) 'Confirm that the year of your surface dataset' - write(iulog,*) 'corresponds to the first year of your landuse_timeseries file' - write(iulog,*) '(e.g., for a landuse_timeseries file starting at year 1850, which is typical,' - write(iulog,*) 'you should be using an 1850 surface dataset),' - write(iulog,*) 'and that your landuse_timeseries file is compatible with the surface dataset.' - write(iulog,*) ' ' - write(iulog,*) 'If you are confident that you are using the correct landuse_timeseries file' - write(iulog,*) 'and the correct surface dataset, then you can bypass this check by setting:' - write(iulog,*) ' check_dynpft_consistency = .false.' - write(iulog,*) 'in user_nl_clm' - write(iulog,*) ' ' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - deallocate(wtpatch_time1) - - end if - - end subroutine dynpft_check_consistency - - !----------------------------------------------------------------------- - subroutine dynpft_read_consistency_nl(check_dynpft_consistency) - ! - ! !DESCRIPTION: - ! Read namelist settings related to pftdyn consistency checks - ! - ! !USES: - use fileutils , only : getavu, relavu - use clm_nlUtilsMod , only : find_nlgroup_name - use controlMod , only : NLFilename - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - logical, intent(out) :: check_dynpft_consistency ! whether to do the consistency check - ! - ! !LOCAL VARIABLES: - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - - character(len=*), parameter :: subname = 'dynpft_read_consistency_nl' - !----------------------------------------------------------------------- - - namelist /dynpft_consistency_checks/ & - check_dynpft_consistency - - ! Set default namelist values - check_dynpft_consistency = .true. - - ! Read namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'dynpft_consistency_checks', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=dynpft_consistency_checks,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading dynpft_consistency_checks namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding dynpft_consistency_checks namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast (check_dynpft_consistency, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'dynpft_consistency_checks settings:' - write(iulog,nml=dynpft_consistency_checks) - write(iulog,*) ' ' - end if - - end subroutine dynpft_read_consistency_nl - - - - !----------------------------------------------------------------------- - subroutine dynpft_interp(bounds) - ! - ! !DESCRIPTION: - ! Get pft weights for current model time - ! - ! Sets pft%wtcol - ! - ! Note that PFT weights currently jump to their new value at the start of the year. - ! However, as mentioned above, this behavior can be changed to time interpolation - ! simply by making wtpatch a dyn_var_time_interp_type variable rather than - ! dyn_var_time_uninterp_type. - ! - ! !USES: - use landunit_varcon , only : istsoil - use clm_varpar , only : natpft_lb, natpft_ub - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! proc-level bounds - ! - ! !LOCAL VARIABLES: - integer :: m,p,l,g ! indices - real(r8), allocatable :: wtpatch_cur(:,:) ! current pft weights - character(len=32) :: subname='dynpft_interp' ! subroutine name - !----------------------------------------------------------------------- - - ! assumes that maxpatch_pft = numpft + 1, that each landunit has only 1 column, - ! and SCAM and CNDV have not been defined - ! - ! NOTE(wjs, 2014-12-10) I'm not sure if there is still the requirement that SCAM - ! hasn't been defined - - SHR_ASSERT_ALL(bounds%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - ! Get pft weights for this time step - - call dynpft_file%time_info%set_current_year() - - allocate(wtpatch_cur(bounds%begg:bounds%endg, natpft_lb:natpft_ub)) - call wtpatch%get_current_data(wtpatch_cur) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - - if (lun%itype(l) == istsoil) then - m = patch%itype(p) - - ! Note that the following assignment assumes that all Patches share a single column - patch%wtcol(p) = wtpatch_cur(g,m) - end if - - end do - - deallocate(wtpatch_cur) - - end subroutine dynpft_interp - -end module dynpftFileMod diff --git a/src/dyn_subgrid/test/CMakeLists.txt b/src/dyn_subgrid/test/CMakeLists.txt deleted file mode 100644 index 2cb9be01bf..0000000000 --- a/src/dyn_subgrid/test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -add_subdirectory(dynColumnTemplate_test) -add_subdirectory(dynColumnStateUpdater_test) -add_subdirectory(dynPatchStateUpdater_test) -add_subdirectory(dynInitColumns_test) -add_subdirectory(dynLandunitArea_test) -add_subdirectory(dynVar_test) -add_subdirectory(dynTimeInfo_test) diff --git a/src/dyn_subgrid/test/dynColumnStateUpdater_test/CMakeLists.txt b/src/dyn_subgrid/test/dynColumnStateUpdater_test/CMakeLists.txt deleted file mode 100644 index 8384506601..0000000000 --- a/src/dyn_subgrid/test/dynColumnStateUpdater_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(ColumnStateUpdater test_ColumnStateUpdater_exe - "test_column_state_updater.pf" "") - -target_link_libraries(test_ColumnStateUpdater_exe clm csm_share) \ No newline at end of file diff --git a/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf b/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf deleted file mode 100644 index a9c456ab04..0000000000 --- a/src/dyn_subgrid/test/dynColumnStateUpdater_test/test_column_state_updater.pf +++ /dev/null @@ -1,1213 +0,0 @@ -module test_column_state_updater - - ! Tests of dynColumnStateUpdaterMod - - use pfunit_mod - use dynColumnStateUpdaterMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use landunit_varcon, only : istsoil, max_lunit - use pftconMod, only : noveg - use ColumnType - use LandunitType - use subgridWeightsMod, only : compute_higher_order_weights - - implicit none - - @TestCase - type, extends(TestCase) :: TestColumnStateUpdater - ! The following arrays have lower bound 1, rather than bounds%begc - real(r8), allocatable :: cwtgcell_old(:) - real(r8), allocatable :: cwtgcell_new(:) - real(r8), allocatable :: cwtgcell_new_minus_old(:) - contains - procedure :: setUp - procedure :: tearDown - procedure :: setup_gridcell_with_four_vegetated_columns - procedure :: setup_gridcell_with_two_vegetated_columns_and_special - procedure :: setup_three_gridcells_with_two_columns_each - procedure :: setup_grid_end ! do stuff at the end of setting up the grid - procedure :: set_new_cwtlunit - procedure :: set_new_lwtgcell - procedure :: set_new_weights_end ! do stuff at the end of setting new weights - procedure :: do_all_setup_with_four_vegetated_columns - procedure :: do_all_setup_with_two_vegetated_columns_and_special - procedure :: do_all_setup_two_veg_and_special_specialShrinks - procedure :: do_all_setup_two_veg_and_special_specialGrows - procedure :: assertConservation - end type TestColumnStateUpdater - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Helper routines - ! ======================================================================== - - subroutine setUp(this) - class(TestColumnStateUpdater), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestColumnStateUpdater), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine setup_gridcell_with_four_vegetated_columns(this, cwtlunit) - ! Sets up a grid with one gridcell, with a single vegetated landunit, with four - ! vegetated columns (each with one patch) - class(TestColumnStateUpdater), intent(inout) :: this - real(r8), intent(in) :: cwtlunit(:) ! weight of each column on the landunit (must be size 4) - - @assertEqual(4, size(cwtlunit)) - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit(1)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit(2)) - call unittest_add_patch(my_ci=ci, ptype=2, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit(3)) - call unittest_add_patch(my_ci=ci, ptype=3, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit(4)) - call unittest_add_patch(my_ci=ci, ptype=4, wtcol=1.0_r8) - call unittest_subgrid_setup_end() - - call this%setup_grid_end() - end subroutine setup_gridcell_with_four_vegetated_columns - - subroutine setup_gridcell_with_two_vegetated_columns_and_special(this, & - lwtgcell, cwtlunit_veg, special_type) - ! Sets up a grid with one gridcell, with (1) a vegetated landunit with two columns, - ! and (2) a special landunit with one column. (Each column has one patch) - class(TestColumnStateUpdater), intent(inout) :: this - - ! weight of each landunit on the gridcell; must be size 2 - ! index 1: natural veg; index 2: special - real(r8), intent(in) :: lwtgcell(:) - - ! weight of each column on the natural veg landunit; must be size 2 - real(r8), intent(in) :: cwtlunit_veg(:) - - ! landunit type of the special landunit - integer, intent(out) :: special_type - - @assertEqual(2, size(lwtgcell)) - @assertEqual(sum(lwtgcell), 1.0_r8, tolerance=tol) - @assertEqual(2, size(cwtlunit_veg)) - @assertEqual(sum(cwtlunit_veg), 1.0_r8, tolerance=tol) - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=lwtgcell(1)) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_veg(1)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_veg(2)) - call unittest_add_patch(my_ci=ci, ptype=2, wtcol=1.0_r8) - - special_type = get_ltype_special() - call unittest_add_landunit(my_gi=gi, ltype=special_type, wtgcell=lwtgcell(2)) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - call unittest_add_patch(my_ci=ci, ptype=noveg, wtcol=1.0_r8) - - call unittest_subgrid_setup_end() - - call this%setup_grid_end() - end subroutine setup_gridcell_with_two_vegetated_columns_and_special - - subroutine setup_three_gridcells_with_two_columns_each(this, & - cwtlunit_grc1, cwtlunit_grc2, cwtlunit_grc3) - ! Sets up a grid with three grid cells, each with a single vegetated landunit with two - ! vegetated columns (each with one patch) - class(TestColumnStateUpdater), intent(inout) :: this - ! weight of each column on the vegetated landunit, in each grid cell (each must be size 2) - real(r8), intent(in) :: cwtlunit_grc1(:) - real(r8), intent(in) :: cwtlunit_grc2(:) - real(r8), intent(in) :: cwtlunit_grc3(:) - - @assertEqual(2, size(cwtlunit_grc1)) - @assertEqual(2, size(cwtlunit_grc2)) - - call unittest_subgrid_setup_start() - - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc1(1)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc1(2)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc2(1)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc2(2)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc3(1)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=cwtlunit_grc3(2)) - call unittest_add_patch(my_ci=ci, ptype=1, wtcol=1.0_r8) - - call unittest_subgrid_setup_end() - - call this%setup_grid_end() - end subroutine setup_three_gridcells_with_two_columns_each - - subroutine setup_grid_end(this) - ! Does necessary stuff at the end of setting up the subgrid structure - class(TestColumnStateUpdater), intent(inout) :: this - - this%cwtgcell_old = col%wtgcell(bounds%begc:bounds%endc) - end subroutine setup_grid_end - - subroutine set_new_cwtlunit(this, cwtlunit) - ! Sets new subgrid weights based on new cwtlunit values - class(TestColumnStateUpdater), intent(inout) :: this - real(r8), intent(in) :: cwtlunit(bounds%begc:) ! weight of each column on the landunit - - integer :: c - - @assertEqual(bounds%endc, ubound(cwtlunit, 1)) - - do c = bounds%begc, bounds%endc - col%wtlunit(c) = cwtlunit(c) - end do - - call this%set_new_weights_end() - end subroutine set_new_cwtlunit - - subroutine set_new_lwtgcell(this, lwtgcell) - ! Sets new subgrid weights based on new lwtgcell values - class(TestColumnStateUpdater), intent(inout) :: this - real(r8), intent(in) :: lwtgcell(bounds%begl:) ! weight of each landunit on the gridcell - - integer :: l - - @assertEqual(bounds%endl, ubound(lwtgcell, 1)) - - do l = bounds%begl, bounds%endl - lun%wtgcell(l) = lwtgcell(l) - end do - - call this%set_new_weights_end() - end subroutine set_new_lwtgcell - - subroutine set_new_weights_end(this) - ! Does necessary stuff at the end of setting new subgrid weights - class(TestColumnStateUpdater), intent(inout) :: this - - call compute_higher_order_weights(bounds) - this%cwtgcell_new = col%wtgcell(bounds%begc:bounds%endc) - this%cwtgcell_new_minus_old = this%cwtgcell_new - this%cwtgcell_old - end subroutine set_new_weights_end - - subroutine do_all_setup_with_two_vegetated_columns_and_special( & - this, cs_updater, lwtgcell_old, lwtgcell_new, cwtlunit_veg, special_type) - ! Does all setup needed when setting up one grid cell with two vegetated columns and - ! a special landunit - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type), intent(out) :: cs_updater - real(r8), intent(in) :: lwtgcell_old(:) - real(r8), intent(in) :: lwtgcell_new(:) - real(r8), intent(in) :: cwtlunit_veg(:) ! assumed not to change - - integer, intent(out), optional :: special_type ! type of the special landunit - - integer :: l_special_type - - call this%setup_gridcell_with_two_vegetated_columns_and_special( & - lwtgcell = lwtgcell_old, & - cwtlunit_veg = cwtlunit_veg, & - special_type = l_special_type) - if (present(special_type)) then - special_type = l_special_type - end if - cs_updater = column_state_updater_type(bounds, nclumps=1) - call cs_updater%set_old_weights(bounds) - - call this%set_new_lwtgcell(lwtgcell = lwtgcell_new) - call cs_updater%set_new_weights(bounds, clump_index=1) - end subroutine do_all_setup_with_two_vegetated_columns_and_special - - subroutine do_all_setup_two_veg_and_special_specialShrinks( & - this, cs_updater, special_type) - ! Does all setup needed when setting up one grid cell with two vegetated columns and - ! a special landunit, with the special landunit shrinking, and the vegetated landunit - ! growing (with the two vegetated columns growing in equal proportion). - ! - ! There are three columns: the first two are vegetated, the last is special. - ! - ! This hard-codes the old and new weights for convenience. Relevant weights can be - ! accessed via the class's cwtgcell_old and cwtgcell_new variables. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type), intent(out) :: cs_updater - integer, intent(out), optional :: special_type ! type of the special landunit - - ! weight of veg & special landunits - real(r8), parameter :: lwtgcell_old(2) = [0.4_r8, 0.6_r8] - real(r8), parameter :: lwtgcell_new(2) = [0.7_r8, 0.3_r8] - - ! weight of each veg column (constant in time) - real(r8), parameter :: cwtlunit_veg(2) = [0.2_r8, 0.8_r8] - - call this%do_all_setup_with_two_vegetated_columns_and_special( & - cs_updater, & - lwtgcell_old = lwtgcell_old, & - lwtgcell_new = lwtgcell_new, & - cwtlunit_veg = cwtlunit_veg, & - special_type = special_type) - end subroutine do_all_setup_two_veg_and_special_specialShrinks - - subroutine do_all_setup_two_veg_and_special_specialGrows( & - this, cs_updater, special_type) - ! Does all setup needed when setting up one grid cell with two vegetated columns and - ! a special landunit, with the special landunit growing, and the vegetated landunit - ! shrinking (with the two vegetated columns shrinking in equal proportion). - ! - ! There are three columns: the first two are vegetated, the last is special. - ! - ! This hard-codes the old and new weights for convenience. Relevant weights can be - ! accessed via the class's cwtgcell_old and cwtgcell_new variables. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type), intent(out) :: cs_updater - integer, intent(out), optional :: special_type ! type of the special landunit - - ! weight of veg & special landunits - real(r8), parameter :: lwtgcell_old(2) = [0.4_r8, 0.6_r8] - real(r8), parameter :: lwtgcell_new(2) = [0.1_r8, 0.9_r8] - - ! weight of each veg column (constant in time) - real(r8), parameter :: cwtlunit_veg(2) = [0.2_r8, 0.8_r8] - - call this%do_all_setup_with_two_vegetated_columns_and_special( & - cs_updater, & - lwtgcell_old = lwtgcell_old, & - lwtgcell_new = lwtgcell_new, & - cwtlunit_veg = cwtlunit_veg, & - special_type = special_type) - end subroutine do_all_setup_two_veg_and_special_specialGrows - - subroutine do_all_setup_with_four_vegetated_columns( & - this, cs_updater, cwtlunit_old, cwtlunit_new) - ! Does all setup needed when setting up one grid cell with four vegetated columns - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type), intent(out) :: cs_updater - real(r8), intent(in) :: cwtlunit_old(:) - real(r8), intent(in) :: cwtlunit_new(:) - - call this%setup_gridcell_with_four_vegetated_columns(cwtlunit_old) - cs_updater = column_state_updater_type(bounds, nclumps=1) - call cs_updater%set_old_weights(bounds) - - call this%set_new_cwtlunit(cwtlunit_new) - call cs_updater%set_new_weights(bounds, clump_index=1) - end subroutine do_all_setup_with_four_vegetated_columns - - - subroutine assertConservation(this, var_old, var_new, msg, & - begc, endc, non_conserved_mass) - ! Asserts that the transformation for a given grid cell was conservative - class(TestColumnStateUpdater), intent(in) :: this - real(r8), intent(in) :: var_old(:) - real(r8), intent(in) :: var_new(:) - character(len=*), intent(in) :: msg - - ! Provide these optional arguments if you just want to check a subset of columns. - ! - ! This is useful if there are multiple grid cells: in this case, provide the begc & - ! endc of the grid cell of interest. - ! - ! This is also useful if the conservation check should exclude certain columns (e.g., - ! if special columns should be excluded from the conservation check). - ! - ! These assume 1-indexing - i.e., the index of the first column is 1 - integer, intent(in), optional :: begc - integer, intent(in), optional :: endc - - ! Non-conserved mass in this grid cell: we make sure that conservation occurs once - ! you account for this known non-conserved mass - real(r8), intent(in), optional :: non_conserved_mass - - character(len=:), allocatable :: full_msg - integer :: my_begc, my_endc - real(r8) :: sum_old, sum_new - - if (present(begc)) then - my_begc = begc - else - my_begc = 1 - end if - - if (present(endc)) then - my_endc = endc - else - my_endc = bounds%endc - bounds%begc + 1 - end if - - full_msg = trim(msg)//': conservation' - - sum_old = sum(this%cwtgcell_old(my_begc:my_endc) * var_old(my_begc:my_endc)) - sum_new = sum(this%cwtgcell_new(my_begc:my_endc) * var_new(my_begc:my_endc)) - if (present(non_conserved_mass)) then - sum_new = sum_new + non_conserved_mass - end if - @assertEqual(sum_old, sum_new, tolerance=tol, message=full_msg) - end subroutine assertConservation - - ! ======================================================================== - ! Begin actual unit tests - ! ======================================================================== - - @Test - subroutine noSpecialHandling_noAreaChange(this) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8) :: myvar(4) - real(r8) :: expected(4) - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8], & - cwtlunit_new = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8]) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - expected = myvar - - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar) - - @assertEqual(expected, myvar) - end subroutine noSpecialHandling_noAreaChange - - @Test - subroutine noSpecialHandling_oneShrinksOneGrows(this) - ! This tests one column shrinking, one growing, and two staying the same in area - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.05_r8, 0.2_r8, 0.35_r8, 0.4_r8] - real(r8) :: myvar(4), myvar_orig(4), expected(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - expected = myvar - expected(3) = (cwtlunit_old(3)*myvar(3) + this%cwtgcell_new_minus_old(3)*myvar(1)) / & - cwtlunit_new(3) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar) - - ! Verify - ! First make sure that the transformation is conservative; note that this looks at the - ! expected values, rather than the actual result, so this is mainly about making sure - ! that we set things up correctly - but it also confirms that the routine conserves - ! mass as long as the actual result matches the expected result - call this%assertConservation(myvar_orig, expected, 'noSpecialHandling_oneShrinksOneGrows') - ! Now make sure that we got the right answer - @assertEqual(expected, myvar, tolerance=tol) - end subroutine noSpecialHandling_oneShrinksOneGrows - - @Test - subroutine noSpecialHandling_twoShrinkTwoGrow(this) - ! This tests one column shrinking to 0 area, one shrinking to non-zero area, one - ! growing from 0 area, and one growing from non-zero area - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0._r8, 0.7_r8] - real(r8), parameter :: cwtlunit_new(4) = [0._r8 , 0.15_r8, 0.08_r8, 0.77_r8] - real(r8), parameter :: new_minus_old(4) = cwtlunit_new - cwtlunit_old - real(r8) :: mass_gain_per_unit_area - real(r8) :: myvar(4), myvar_orig(4), expected(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - expected(1:2) = myvar(1:2) - mass_gain_per_unit_area = (new_minus_old(1) * myvar(1) + new_minus_old(2) * myvar(2)) / & - (new_minus_old(1) + new_minus_old(2)) - expected(3) = mass_gain_per_unit_area - expected(4) = (cwtlunit_old(4)*myvar(4) + new_minus_old(4)*mass_gain_per_unit_area) / & - cwtlunit_new(4) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar) - - ! Verify - ! First make sure that the transformation is conservative; note that this looks at the - ! expected values, rather than the actual result, so this is mainly about making sure - ! that we set things up correctly - but it also confirms that the routine conserves - ! mass as long as the actual result matches the expected result - call this%assertConservation(myvar_orig, expected, 'noSpecialHandling_twoShrinkTwoGrow') - ! Now make sure that we got the right answer - @assertEqual(expected, myvar, tolerance=tol) - end subroutine noSpecialHandling_twoShrinkTwoGrow - - @Test - subroutine noSpecialHandling_multipleGridCells(this) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - ! Grid cell 1: c1 shrinks, c2 grows - real(r8), parameter :: cwtlunit_grc1_old(2) = [0.4_r8, 0.6_r8] - real(r8), parameter :: cwtlunit_grc1_new(2) = [0.35_r8, 0.65_r8] - ! Grid cell 2: constant areas - real(r8), parameter :: cwtlunit_grc2_old(2) = [0.3_r8, 0.7_r8] - real(r8), parameter :: cwtlunit_grc2_new(2) = cwtlunit_grc2_old - ! Grid cell 3: c1 grows, c2 shrinks - real(r8), parameter :: cwtlunit_grc3_old(2) = [0.2_r8, 0.8_r8] - real(r8), parameter :: cwtlunit_grc3_new(2) = [0.9_r8, 0.1_r8] - - real(r8) :: g1_weight_change, g3_weight_change - real(r8) :: myvar(6), myvar_orig(6), expected(6) - - ! Setup - - call this%setup_three_gridcells_with_two_columns_each( & - cwtlunit_grc1_old, cwtlunit_grc2_old, cwtlunit_grc3_old) - cs_updater = column_state_updater_type(bounds, nclumps=1) - call cs_updater%set_old_weights(bounds) - - call this%set_new_cwtlunit(cwtlunit = & - [cwtlunit_grc1_new, cwtlunit_grc2_new, cwtlunit_grc3_new]) - call cs_updater%set_new_weights(bounds, clump_index=1) - - myvar = [1._r8, 2._r8, 3._r8, 4._r8, 5._r8, 6._r8] - myvar_orig = myvar - expected = myvar - - ! c2 in grid cell 1: - g1_weight_change = cwtlunit_grc1_new(2) - cwtlunit_grc1_old(2) - expected(2) = (cwtlunit_grc1_old(2)*myvar(2) + g1_weight_change*myvar(1)) / & - (cwtlunit_grc1_old(2) + g1_weight_change) - - ! c1 in grid cell 3: - g3_weight_change = cwtlunit_grc3_new(1) - cwtlunit_grc3_old(1) - expected(5) = (cwtlunit_grc3_old(1)*myvar(5) + g3_weight_change*myvar(6)) / & - (cwtlunit_grc3_old(1) + g3_weight_change) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar) - - ! Verify - ! First make sure that the transformation is conservative; note that this looks at the - ! expected values, rather than the actual result, so this is mainly about making sure - ! that we set things up correctly - but it also confirms that the routine conserves - ! mass as long as the actual result matches the expected result - call this%assertConservation(myvar_orig, expected, & - 'noSpecialHandling_multipleGridCells: grc1', begc=1, endc=2) - call this%assertConservation(myvar_orig, expected, & - 'noSpecialHandling_multipleGridCells: grc2', begc=3, endc=4) - call this%assertConservation(myvar_orig, expected, & - 'noSpecialHandling_multipleGridCells: grc3', begc=5, endc=6) - ! Now make sure that we got the right answer - @assertEqual(expected, myvar, tolerance=tol) - end subroutine noSpecialHandling_multipleGridCells - - @Test - subroutine fillSpecialUsingNatveg_specialShrinks(this) - ! This tests a special column shrinking when using the routine that fills special - ! points using natural veg as a template. In order to test that the template is - ! applied correctly, we use two natural veg columns. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - - real(r8) :: input_from_glacier - real(r8) :: myvar(3), myvar_orig(3), expected_var(3) - real(r8) :: expected_non_conserved_mass - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialShrinks(cs_updater) - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - expected_var(3) = myvar(3) - ! glacier uses column 1 as a template: - input_from_glacier = myvar(1) - ! column 1 doesn't change because the glacier input is the same as what's already there: - expected_var(1) = myvar(1) - expected_var(2) = (this%cwtgcell_old(2)*myvar(2) + & - this%cwtgcell_new_minus_old(2)*input_from_glacier) / & - this%cwtgcell_new(2) - expected_non_conserved_mass = this%cwtgcell_new_minus_old(3) * input_from_glacier - - ! Exercise - call cs_updater%update_column_state_fill_special_using_natveg(bounds, clump_index=1, var=myvar, & - non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - @assertEqual(expected_var, myvar, tolerance=tol) - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - call this%assertConservation(myvar_orig, myvar, & - 'fillSpecialUsingNatveg_specialShrinks', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine fillSpecialUsingNatveg_specialShrinks - - @Test - subroutine fillSpecialUsingNatveg_specialGrows(this) - ! This tests a special column growing when using the routine that fills special - ! points using natural veg as a template. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - - real(r8) :: myvar(3), myvar_orig(3), expected_var(3) - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - real(r8) :: expected_non_conserved_mass - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialGrows(cs_updater) - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - ! the growing special point should not accept any mass, so should keep its original - ! value - expected_var = myvar - expected_non_conserved_mass = -1._r8 * & - (myvar(1) * this%cwtgcell_new_minus_old(1) + & - myvar(2) * this%cwtgcell_new_minus_old(2)) - - ! Exercise - call cs_updater%update_column_state_fill_special_using_natveg(bounds, clump_index=1, var=myvar, & - non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - @assertEqual(expected_var, myvar, tolerance=tol) - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - call this%assertConservation(myvar_orig, myvar, & - 'fillSpecialUsingNatveg_specialGrows', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine fillSpecialUsingNatveg_specialGrows - - @Test - subroutine fillSpecialUsingNatveg_nonSpecial(this) - ! This tests non-special columns growing and shrinking when using the routine that - ! fills special points using natural veg as a template. This makes sure that - ! non-special columns are treated normally by this routine. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.05_r8, 0.2_r8, 0.35_r8, 0.4_r8] - real(r8) :: myvar(4), myvar_orig(4), expected(4) - real(r8), parameter :: non_conserved_mass_orig = 2._r8 - real(r8) :: non_conserved_mass_grc(1) = non_conserved_mass_orig - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - expected = myvar - expected(3) = (cwtlunit_old(3)*myvar(3) + this%cwtgcell_new_minus_old(3)*myvar(1)) / & - cwtlunit_new(3) - - ! Exercise - call cs_updater%update_column_state_fill_special_using_natveg(bounds, clump_index=1, var=myvar, & - non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - ! First make sure that the transformation is conservative; note that this looks at the - ! expected values, rather than the actual result, so this is mainly about making sure - ! that we set things up correctly - but it also confirms that the routine conserves - ! mass as long as the actual result matches the expected result - call this%assertConservation(myvar_orig, expected, 'fillSpecialUsingNatveg_nonSpecial') - ! Now make sure that we got the right answer - @assertEqual(expected, myvar, tolerance=tol) - @assertEqual(non_conserved_mass_orig, non_conserved_mass_grc(1)) - end subroutine fillSpecialUsingNatveg_nonSpecial - - @Test - subroutine fillUsingFixedValues_specialShrinks(this) - ! This tests a specially-handled column shrinking when using the routine that fills - ! points using fixed values - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - - integer :: special_type ! landunit type of the special type - real(r8), parameter :: input_from_special = 14._r8 - real(r8) :: landunit_values(max_lunit) - real(r8) :: myvar(3), myvar_orig(3), expected_var(3) - real(r8) :: expected_non_conserved_mass - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - integer :: i - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialShrinks( & - cs_updater, & - special_type = special_type) - - landunit_values(:) = FILLVAL_USE_EXISTING_VALUE - landunit_values(special_type) = input_from_special - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - expected_var(3) = myvar(3) - do i = 1, 2 - expected_var(i) = (this%cwtgcell_old(i)*myvar(i) + & - this%cwtgcell_new_minus_old(i)*input_from_special) / & - this%cwtgcell_new(i) - end do - expected_non_conserved_mass = this%cwtgcell_new_minus_old(3) * input_from_special - - ! Exercise - call cs_updater%update_column_state_fill_using_fixed_values(bounds, clump_index=1, var=myvar, & - landunit_values=landunit_values, non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - @assertEqual(expected_var, myvar, tolerance=tol) - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - call this%assertConservation(myvar_orig, myvar, & - 'fillUsingFixedValues_specialShrinks', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine fillUsingFixedValues_specialShrinks - - @Test - subroutine fillUsingFixedValues_specialGrows(this) - ! This tests a specially-handled column growing when using the routine that fills - ! points using fixed values - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - - integer :: special_type ! landunit type of the special type - real(r8), parameter :: input_from_special = 14._r8 ! irrelevant - real(r8) :: landunit_values(max_lunit) - real(r8) :: myvar(3), myvar_orig(3), expected_var(3) - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - real(r8) :: expected_non_conserved_mass - integer :: i - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialGrows( & - cs_updater, & - special_type = special_type) - - landunit_values(:) = FILLVAL_USE_EXISTING_VALUE - landunit_values(special_type) = input_from_special - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - ! the growing special point should not accept any mass, so should keep its original - ! value - expected_var = myvar - expected_non_conserved_mass = -1._r8 * & - (myvar(1) * this%cwtgcell_new_minus_old(1) + & - myvar(2) * this%cwtgcell_new_minus_old(2)) - - ! Exercise - call cs_updater%update_column_state_fill_using_fixed_values(bounds, clump_index=1, var=myvar, & - landunit_values=landunit_values, non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - @assertEqual(expected_var, myvar, tolerance=tol) - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - call this%assertConservation(myvar_orig, myvar, & - 'fillUsingFixedValues_specialGrows', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine fillUsingFixedValues_specialGrows - - @Test - subroutine fillUsingFixedValues_nonSpecial(this) - ! This tests non-special columns growing and shrinking when using the routine that - ! fills special points using fixed values. This makes sure that non-special columns - ! are treated normally by this routine. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.05_r8, 0.2_r8, 0.35_r8, 0.4_r8] - real(r8) :: landunit_values(max_lunit) - real(r8) :: myvar(4), myvar_orig(4), expected(4) - real(r8), parameter :: non_conserved_mass_orig = 2._r8 - real(r8) :: non_conserved_mass_grc(1) = non_conserved_mass_orig - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - landunit_values(:) = FILLVAL_USE_EXISTING_VALUE - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - expected = myvar - expected(3) = (cwtlunit_old(3)*myvar(3) + this%cwtgcell_new_minus_old(3)*myvar(1)) / & - cwtlunit_new(3) - - ! Exercise - call cs_updater%update_column_state_fill_using_fixed_values(bounds, clump_index=1, var=myvar, & - landunit_values=landunit_values, non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - ! First make sure that the transformation is conservative; note that this looks at the - ! expected values, rather than the actual result, so this is mainly about making sure - ! that we set things up correctly - but it also confirms that the routine conserves - ! mass as long as the actual result matches the expected result - call this%assertConservation(myvar_orig, expected, 'fillUsingFixedValues_nonSpecial') - ! Now make sure that we got the right answer - @assertEqual(expected, myvar, tolerance=tol) - @assertEqual(non_conserved_mass_orig, non_conserved_mass_grc(1)) - end subroutine fillUsingFixedValues_nonSpecial - - @Test - subroutine fillSpecialUsingFixedValue_specialShrinks(this) - ! This tests a specially-handled column shrinking when using the routine that fills - ! all special points using a single fixed value. (No need to have multiple tests of - ! this update_column_state_fill_special_using_fixed_value routine, since it is merely - ! a lightweight wrapper to a different routine.) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - - integer :: special_type ! landunit type of the special type - real(r8), parameter :: input_from_special = 14._r8 - real(r8) :: myvar(3), myvar_orig(3), expected_var(3) - real(r8) :: expected_non_conserved_mass - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - integer :: i - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialShrinks( & - cs_updater, & - special_type = special_type) - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - expected_var(3) = myvar(3) - do i = 1, 2 - expected_var(i) = (this%cwtgcell_old(i)*myvar(i) + & - this%cwtgcell_new_minus_old(i)*input_from_special) / & - this%cwtgcell_new(i) - end do - expected_non_conserved_mass = this%cwtgcell_new_minus_old(3) * input_from_special - - ! Exercise - call cs_updater%update_column_state_fill_special_using_fixed_value(bounds, clump_index=1, var=myvar, & - special_value=input_from_special, non_conserved_mass_grc=non_conserved_mass_grc) - - ! Verify - @assertEqual(expected_var, myvar, tolerance=tol) - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - call this%assertConservation(myvar_orig, myvar, & - 'fillSpecialUsingFixedValue_specialShrinks', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine fillSpecialUsingFixedValue_specialShrinks - - - ! ------------------------------------------------------------------------ - ! Tests with fractional_areas - ! ------------------------------------------------------------------------ - - @Test - subroutine withFractionalAreas_oneShrinksOneGrows(this) - ! This tests the updating of a variable with fractional area terms, with one column - ! shrinking, one growing, and two staying the same in area - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.1_r8, 0.3_r8, 0.2_r8, 0.4_r8] - real(r8), parameter :: fractional_area_old(4) = [0.0_r8, 0.1_r8, 0.7_r8, 0.5_r8] - real(r8) :: myvar(4), myvar_orig(4), expected(4), fractional_area_new(4) - real(r8) :: myvar_orig_weighted(4), myvar_weighted(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 7._r8, 8._r8] - myvar_orig = myvar - expected = myvar - expected(2) = (this%cwtgcell_old(2) * fractional_area_old(2) * myvar(2) + & - this%cwtgcell_new_minus_old(2) * fractional_area_old(3) * myvar(3)) / & - (this%cwtgcell_old(2)*fractional_area_old(2) + & - this%cwtgcell_new_minus_old(2) * fractional_area_old(3)) - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new) - - ! Verify - @assertEqual(expected, myvar, tolerance=tol) - myvar_orig_weighted = myvar_orig*fractional_area_old - myvar_weighted = myvar*fractional_area_new - call this%assertConservation(myvar_orig_weighted, myvar_weighted, 'withFractionalAreas_oneShrinksOneGrows') - end subroutine withFractionalAreas_oneShrinksOneGrows - - @Test - subroutine withFractionalAreas_fraction0_oneShrinksOneGrows(this) - ! This tests the updating of a variable with fractional area terms, with one column - ! shrinking, one growing, and two staying the same in area. Here the growing column - ! has a new fractional area of 0. - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.1_r8, 0.3_r8, 0.2_r8, 0.4_r8] - real(r8), parameter :: fractional_area_old(4) = [0.0_r8, 0.0_r8, 0.0_r8, 0.5_r8] - real(r8) :: myvar(4), myvar_orig(4), expected(4), fractional_area_new(4) - real(r8) :: myvar_orig_weighted(4), myvar_weighted(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 7._r8, 8._r8] - myvar_orig = myvar - ! If the growing column has a new fractional area of 0, then we expect no change in - ! my_var. - expected = myvar - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new) - - ! Verify - @assertEqual(expected, myvar, tolerance=tol) - end subroutine withFractionalAreas_fraction0_oneShrinksOneGrows - - @Test - subroutine withFractionalAreas_twoShrinkTwoGrow(this) - ! This tests the updating of a variable with fractional area terms, with one column - ! shrinking to 0 area, one shrinking to non-zero area, one growing from 0 area, and - ! one growing from non-zero area - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0._r8, 0.7_r8] - real(r8), parameter :: cwtlunit_new(4) = [0._r8 , 0.15_r8, 0.08_r8, 0.77_r8] - real(r8), parameter :: fractional_area_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: new_minus_old(4) = cwtlunit_new - cwtlunit_old - real(r8) :: mass_gain_per_unit_area - real(r8) :: myvar(4), myvar_orig(4), expected(4), fractional_area_new(4) - real(r8) :: myvar_orig_weighted(4), myvar_weighted(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new) - - ! Verify - expected(1:2) = myvar_orig(1:2) - mass_gain_per_unit_area = ( & - new_minus_old(1) * fractional_area_old(1) * myvar_orig(1) + & - new_minus_old(2) * fractional_area_old(2) * myvar_orig(2)) / & - (new_minus_old(1) + new_minus_old(2)) - expected(3) = mass_gain_per_unit_area / fractional_area_new(3) - expected(4) = (cwtlunit_old(4) * fractional_area_old(4) * myvar_orig(4) + & - new_minus_old(4) * mass_gain_per_unit_area) / & - (cwtlunit_new(4) * fractional_area_new(4)) - @assertEqual(expected, myvar, tolerance=tol) - - myvar_orig_weighted = myvar_orig*fractional_area_old - myvar_weighted = myvar*fractional_area_new - call this%assertConservation(myvar_orig_weighted, myvar_weighted, 'withFractionalAreas_twoShrinkTwoGrow') - end subroutine withFractionalAreas_twoShrinkTwoGrow - - @Test - subroutine nonConservedMass_withFractionalAreas_specialShrinks(this) - ! This tests the computation of non_conserved_mass with fractional area terms, when - ! a special column shrinks - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: input_from_special = 11._r8 - real(r8), parameter :: fractional_area_old(3) = [0.1_r8, 0.2_r8, 0.3_r8] - real(r8) :: fractional_area_new(3) - real(r8) :: myvar(3), myvar_orig(3) - real(r8) :: expected_non_conserved_mass - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - real(r8) :: myvar_orig_weighted(3), myvar_weighted(3) - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialShrinks(cs_updater) - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - expected_non_conserved_mass = this%cwtgcell_new_minus_old(3) * fractional_area_old(3) & - * input_from_special - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_fill_special_using_fixed_value(bounds, clump_index=1, var=myvar, & - special_value=input_from_special, non_conserved_mass_grc=non_conserved_mass_grc, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new) - - ! Verify - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - myvar_orig_weighted = myvar_orig * fractional_area_old - myvar_weighted = myvar * fractional_area_new - call this%assertConservation(myvar_orig_weighted, myvar_weighted, & - 'nonConservedMass_withFractionalAreas_specialShrinks', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine nonConservedMass_withFractionalAreas_specialShrinks - - @Test - subroutine nonConservedMass_withFractionalAreas_specialGrows(this) - ! This tests the computation of non_conserved_mass with fractional area terms, when - ! a special column grows - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: input_from_special = 11._r8 ! irrelevant - real(r8), parameter :: fractional_area_old(3) = [0.1_r8, 0.2_r8, 0.3_r8] - real(r8) :: fractional_area_new(3) - real(r8) :: myvar(3), myvar_orig(3) - real(r8) :: expected_non_conserved_mass - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - real(r8) :: myvar_orig_weighted(3), myvar_weighted(3) - - ! Setup - - call this%do_all_setup_two_veg_and_special_specialGrows(cs_updater) - - myvar = [2._r8, 3._r8, 4._r8] - myvar_orig = myvar - expected_non_conserved_mass = -1._r8 * & - (myvar(1) * this%cwtgcell_new_minus_old(1) * fractional_area_old(1) + & - myvar(2) * this%cwtgcell_new_minus_old(2) * fractional_area_old(2)) - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_fill_special_using_fixed_value(bounds, clump_index=1, var=myvar, & - special_value=input_from_special, non_conserved_mass_grc=non_conserved_mass_grc, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new) - - ! Verify - @assertEqual(expected_non_conserved_mass, non_conserved_mass_grc(1), tolerance=tol) - - ! Note that the specially-treated column is excluded from the conservation check: the - ! value in that column is ignored for conservation. - myvar_orig_weighted = myvar_orig * fractional_area_old - myvar_weighted = myvar * fractional_area_new - call this%assertConservation(myvar_orig_weighted, myvar_weighted, & - 'nonConservedMass_withFractionalAreas_specialGrows', & - begc = 1, endc = 2, non_conserved_mass = non_conserved_mass_grc(1)) - - end subroutine nonConservedMass_withFractionalAreas_specialGrows - - ! ------------------------------------------------------------------------ - ! Tests of the optional adjustment output - ! ------------------------------------------------------------------------ - - @Test - subroutine adjustment_withNoAreaChange_isUnchanged(this) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8) :: myvar(4) - real(r8) :: adjustment(4) - real(r8) :: adjustment_expected(4) - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8], & - cwtlunit_new = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8]) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - adjustment = adjustment) - - adjustment_expected(:) = 0._r8 - @assertEqual(adjustment_expected, adjustment) - end subroutine adjustment_withNoAreaChange_isUnchanged - - @Test - subroutine adjustment_withOneShrinksOneGrows(this) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.05_r8, 0.2_r8, 0.35_r8, 0.4_r8] - real(r8) :: myvar(4), myvar_orig(4) - real(r8) :: adjustment(4) - real(r8) :: adjustment_expected(4) - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 4._r8, 5._r8] - myvar_orig = myvar - - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - adjustment = adjustment) - - adjustment_expected(:) = 0._r8 - adjustment_expected(3) = myvar(3) - myvar_orig(3) - @assertEqual(adjustment_expected, adjustment) - end subroutine adjustment_withOneShrinksOneGrows - - @Test - subroutine adjustment_withSpecialGrowing_isUnchanged(this) - ! The 'adjustment' variable shouldn't be changed for a special landunit - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8) :: non_conserved_mass_grc(1) = 0._r8 - real(r8) :: myvar(3) - real(r8) :: adjustment(3) - real(r8) :: adjustment_expected(3) - - call this%do_all_setup_two_veg_and_special_specialGrows(cs_updater) - - myvar = [2._r8, 3._r8, 4._r8] - - call cs_updater%update_column_state_fill_special_using_natveg(bounds, clump_index=1, var=myvar, & - non_conserved_mass_grc = non_conserved_mass_grc, adjustment = adjustment) - - adjustment_expected(:) = 0._r8 - @assertEqual(adjustment_expected, adjustment) - end subroutine adjustment_withSpecialGrowing_isUnchanged - - @Test - subroutine adjustment_withFractionalAreas(this) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.1_r8, 0.3_r8, 0.2_r8, 0.4_r8] - real(r8), parameter :: fractional_area_old(4) = [0.0_r8, 0.1_r8, 0.7_r8, 0.5_r8] - real(r8) :: myvar(4), myvar_orig(4), fractional_area_new(4) - real(r8) :: myvar_orig_weighted(4), myvar_weighted(4) - real(r8) :: adjustment(4) - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 7._r8, 8._r8] - myvar_orig = myvar - adjustment(:) = 0._r8 - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - ! Verify - myvar_orig_weighted = myvar_orig*fractional_area_old - myvar_weighted = myvar*fractional_area_new - @assertEqual(myvar_orig_weighted, myvar_weighted - adjustment) - end subroutine adjustment_withFractionalAreas - - @Test - subroutine adjustment_withFractionalAreas_newFrac0(this) - ! If the new fractional area is 0, then the adjustment should be equal to - ! -(myvar_orig * fractional_area_old) - class(TestColumnStateUpdater), intent(inout) :: this - type(column_state_updater_type) :: cs_updater - ! col #2 grows from 0, taking over some of col #3; col #2's new fractional area - ! should be 0 because col #3 had a fractional area of 0 - real(r8), parameter :: cwtlunit_old(4) = [0.1_r8, 0.0_r8, 0.5_r8, 0.4_r8] - real(r8), parameter :: cwtlunit_new(4) = [0.1_r8, 0.2_r8, 0.3_r8, 0.4_r8] - real(r8), parameter :: fractional_area_old(4) = [0.0_r8, 0.1_r8, 0.0_r8, 0.5_r8] - real(r8) :: myvar(4), myvar_orig(4), fractional_area_new(4) - real(r8) :: myvar_orig_weighted(4), myvar_weighted(4) - real(r8) :: adjustment(4) - real(r8) :: expected_adjustment - - ! Setup - - call this%do_all_setup_with_four_vegetated_columns( & - cs_updater, & - cwtlunit_old = cwtlunit_old, & - cwtlunit_new = cwtlunit_new) - - myvar = [2._r8, 3._r8, 7._r8, 8._r8] - myvar_orig = myvar - adjustment(:) = 0._r8 - - fractional_area_new(:) = fractional_area_old(:) - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=fractional_area_new) - - ! Exercise - call cs_updater%update_column_state_no_special_handling(bounds, clump_index=1, var=myvar, & - fractional_area_old = fractional_area_old, & - fractional_area_new = fractional_area_new, & - adjustment = adjustment) - - ! Verify - expected_adjustment = -1._r8 * (myvar_orig(2) * fractional_area_old(2)) - @assertEqual(expected_adjustment, adjustment(2)) - end subroutine adjustment_withFractionalAreas_newFrac0 - -end module test_column_state_updater diff --git a/src/dyn_subgrid/test/dynColumnTemplate_test/CMakeLists.txt b/src/dyn_subgrid/test/dynColumnTemplate_test/CMakeLists.txt deleted file mode 100644 index 0f6ad1c753..0000000000 --- a/src/dyn_subgrid/test/dynColumnTemplate_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(ColumnTemplate test_ColumnTemplate_exe - "test_column_template.pf" "") - -target_link_libraries(test_ColumnTemplate_exe clm csm_share) \ No newline at end of file diff --git a/src/dyn_subgrid/test/dynColumnTemplate_test/test_column_template.pf b/src/dyn_subgrid/test/dynColumnTemplate_test/test_column_template.pf deleted file mode 100644 index e5ab68fe29..0000000000 --- a/src/dyn_subgrid/test/dynColumnTemplate_test/test_column_template.pf +++ /dev/null @@ -1,179 +0,0 @@ -module test_column_template - - ! Tests of dynColumnTemplateMod - - use pfunit_mod - use dynColumnTemplateMod - use unittestSubgridMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon , only : ispval - use ColumnType , only : col - use LandunitType , only : lun - use GridcellType , only : grc - - implicit none - - @TestCase - type, extends(TestCase) :: TestColumnTemplate - contains - procedure :: setUp - procedure :: tearDown - procedure :: setup_gridcells_with_three_landunits - end type TestColumnTemplate - -contains - - subroutine setUp(this) - class(TestColumnTemplate), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestColumnTemplate), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - ! ------------------------------------------------------------------------ - ! Helper routines - ! ------------------------------------------------------------------------ - - subroutine setup_gridcells_with_three_landunits(this, n_gridcells, c_target) - ! Sets up a grid with n_gridcells grid cells, each with three landunits (types 1, 2 - ! and 3). Each landunit has multiple columns, all active. - ! - ! There is a total of 9 columns on each grid cell. - - class(TestColumnTemplate), intent(inout) :: this - - ! number of gridcells - integer, intent(in) :: n_gridcells - - ! column index of "target column" for some tests, which is the second column on the - ! landunit with ltype = 1, in the first grid cell - integer, intent(out) :: c_target - - integer :: g - - ! The weights (of both landunits and columns) and column types in the following are - ! arbitrary, since they are not important for these tests - - call unittest_subgrid_setup_start() - - do g = 1, n_gridcells - call unittest_add_gridcell() - - call unittest_add_landunit(my_gi=gi, ltype=3, wtgcell=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - - call unittest_add_landunit(my_gi=gi, ltype=1, wtgcell=0.5_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - if (g == 1) then - c_target = ci - end if - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - - call unittest_add_landunit(my_gi=gi, ltype=2, wtgcell=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - end do - - call unittest_subgrid_setup_end() - - col%active(bounds%begc:bounds%endc) = .true. - end subroutine setup_gridcells_with_three_landunits - - - ! ------------------------------------------------------------------------ - ! Begin actual unit tests - ! ------------------------------------------------------------------------ - - @Test - subroutine template_col_with_no_landunit(this) - ! no landunit of the given landunit_type on this grid cell - class(TestColumnTemplate), intent(inout) :: this - integer :: c_target ! column index of "target column": 2nd col on landunit with ltype=1 - integer :: template_col - - call this%setup_gridcells_with_three_landunits(1, c_target) - grc%landunit_indices(2,gi) = ispval - template_col = template_col_from_landunit(bounds, c_target, 2, & - col%active(bounds%begc:bounds%endc)) - @assertEqual(TEMPLATE_NONE_FOUND, template_col) - end subroutine template_col_with_no_landunit - - @Test - subroutine template_col_with_no_active(this) - ! no active columns on the given landunit_type - class(TestColumnTemplate), intent(inout) :: this - integer :: l2 ! landunit index of landunit with ltype = 2 - integer :: c_target ! column index of "target column": 2nd col on landunit with ltype=1 - integer :: template_col - - call this%setup_gridcells_with_three_landunits(1, c_target) - l2 = grc%landunit_indices(2,gi) - col%active(lun%coli(l2):lun%colf(l2)) = .false. - template_col = template_col_from_landunit(bounds, c_target, 2, & - col%active(bounds%begc:bounds%endc)) - @assertEqual(TEMPLATE_NONE_FOUND, template_col) - end subroutine template_col_with_no_active - - @Test - subroutine template_col_with_all_active(this) - ! all active columns on the given landunit type; should take the first - class(TestColumnTemplate), intent(inout) :: this - integer :: l2 ! landunit index of landunit with ltype = 2 - integer :: c_target ! column index of "target column": 2nd col on landunit with ltype=1 - integer :: template_col - - call this%setup_gridcells_with_three_landunits(1, c_target) - template_col = template_col_from_landunit(bounds, c_target, 2, & - col%active(bounds%begc:bounds%endc)) - l2 = grc%landunit_indices(2,gi) - @assertEqual(lun%coli(l2), template_col) - end subroutine template_col_with_all_active - - @Test - subroutine template_col_with_second_active(this) - ! first col on the given landunit is inactive, second is active; should take the - ! second (ignoring the inactive column) - class(TestColumnTemplate), intent(inout) :: this - integer :: l2 ! landunit index of landunit with ltype = 2 - integer :: c_target ! column index of "target column": 2nd col on landunit with ltype=1 - integer :: template_col - - call this%setup_gridcells_with_three_landunits(1, c_target) - l2 = grc%landunit_indices(2,gi) - col%active(lun%coli(l2)) = .false. - template_col = template_col_from_landunit(bounds, c_target, 2, & - col%active(bounds%begc:bounds%endc)) - @assertEqual(lun%coli(l2)+1, template_col) - end subroutine template_col_with_second_active - - @Test - subroutine template_col_from_natveg_array_with_two_gridcells(this) - class(TestColumnTemplate), intent(inout) :: this - integer :: c_target ! ignored for this test - integer :: l1_g1, l1_g2 ! landunit indices of landunit type 1 in grid cell 1 & 2 - integer, allocatable :: c_templates(:) - integer, allocatable :: expected_templates(:) - - call this%setup_gridcells_with_three_landunits(n_gridcells=2, c_target=c_target) - allocate(c_templates(bounds%begc:bounds%endc)) - call template_col_from_natveg_array(bounds, & - col%active(bounds%begc:bounds%endc), & - c_templates) - - allocate(expected_templates(bounds%begc:bounds%endc)) - l1_g1 = grc%landunit_indices(1, bounds%begg) - l1_g2 = grc%landunit_indices(1, bounds%begg+1) - ! In the following, note that there are 9 columns per grid cell - expected_templates(bounds%begc:(bounds%begc+8)) = lun%coli(l1_g1) - expected_templates((bounds%begc+9):(bounds%endc)) = lun%coli(l1_g2) - @assertEqual(expected_templates, c_templates) - end subroutine template_col_from_natveg_array_with_two_gridcells - -end module test_column_template diff --git a/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt b/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt deleted file mode 100644 index 59e6d13bb3..0000000000 --- a/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(dynInitColumns test_dynInitColumns_exe - "test_init_columns.pf" "") - -target_link_libraries(test_dynInitColumns_exe clm csm_share) diff --git a/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf b/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf deleted file mode 100644 index 88e916ffa1..0000000000 --- a/src/dyn_subgrid/test/dynInitColumns_test/test_init_columns.pf +++ /dev/null @@ -1,219 +0,0 @@ -module test_init_columns - - ! Tests of the dynInitColumns module - - use pfunit_mod - use unittestSubgridMod - use dynInitColumnsMod - use ColumnType , only : col - use LandunitType , only : lun - use GridcellType , only : grc - use decompMod , only : bounds_type - use clm_varcon , only : ispval - use clm_varpar , only : nlevsno, nlevgrnd - use shr_kind_mod , only : r8 => shr_kind_r8 - use TemperatureType , only : temperature_type - use WaterstateType , only : waterstate_type - use SoilHydrologyType, only : soilhydrology_type - use dynColumnTemplateMod, only : TEMPLATE_NONE_FOUND - - implicit none - save - - logical, allocatable, private :: cactive_prior(:) - integer :: c_new ! column index of the new column to initialize in some tests - integer :: l1 ! index of the landunit with landunit type 1 - integer :: l2 ! index of the landunit with landunit type 2 - - ! TODO(wjs, 2016-09-01) This test should be changed to use a class, with these being - ! instances of the class. Then the setup and cleanup routines here should be turned - ! into setup & teardown methods of the class. - type(temperature_type) :: temperature_vars - type(waterstate_type) :: waterstate_vars - type(soilhydrology_type) :: soilhydrology_vars - -contains - - subroutine setup() - ! Set up variables needed for tests: various subgrid type variables, along with - ! bounds and cactive_prior. - ! - ! col%active and cactive_prior need to be set by specific tests - integer :: c, lev - - ! Set up subgrid structure - ! The weights (of both landunits and columns) and column types in the following are - ! arbitrary, since they are not important for these tests - - call unittest_subgrid_setup_start() - - call unittest_add_gridcell() - - call unittest_add_landunit(my_gi=gi, ltype=3, wtgcell=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - - call unittest_add_landunit(my_gi=gi, ltype=1, wtgcell=0.5_r8) - l1 = li - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - ! This column (the second column on the landunit with ltype=1) will be the target for - ! some tests of initialization of a new column - c_new = ci - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - - call unittest_add_landunit(my_gi=gi, ltype=2, wtgcell=0.25_r8) - l2 = li - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.25_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=0.5_r8) - - call unittest_subgrid_setup_end() - - col%active(begc:endc) = .false. - allocate(cactive_prior(bounds%begc:bounds%endc), source=.false.) - - nlevgrnd=10 - allocate(temperature_vars%t_soisno_col(bounds%begc:bounds%endc, -nlevsno+1:nlevgrnd)) - allocate(waterstate_vars%h2osoi_liq_col(bounds%begc:bounds%endc, -nlevsno+1:nlevgrnd)) - allocate(waterstate_vars%h2osoi_ice_col(bounds%begc:bounds%endc, -nlevsno+1:nlevgrnd)) - allocate(waterstate_vars%h2osoi_vol_col(bounds%begc:bounds%endc, -nlevsno+1:nlevgrnd)) - allocate(soilhydrology_vars%wa_col(bounds%begc:bounds%endc)) - do lev = -nlevsno+1, nlevgrnd - do c = bounds%begc, bounds%endc - temperature_vars%t_soisno_col(c, lev) = c*1000 + lev - - ! Also need to initialize some waterstate_type variables, but we don't have any - ! assertions on them in this test - waterstate_vars%h2osoi_liq_col(c, lev) = 0._r8 - waterstate_vars%h2osoi_ice_col(c, lev) = 0._r8 - waterstate_vars%h2osoi_vol_col(c, lev) = 0._r8 - end do - end do - - ! Also need to initialize some other variables for which we don't have any assertions - do c = bounds%begc, bounds%endc - soilhydrology_vars%wa_col(c) = 0._r8 - end do - end subroutine setup - - subroutine cleanup() - ! clean up stuff set up in setup() - - call unittest_subgrid_teardown() - - deallocate(cactive_prior) - deallocate(temperature_vars%t_soisno_col) - deallocate(waterstate_vars%h2osoi_liq_col) - deallocate(waterstate_vars%h2osoi_ice_col) - deallocate(waterstate_vars%h2osoi_vol_col) - deallocate(soilhydrology_vars%wa_col) - - end subroutine cleanup - - ! ------------------------------------------------------------------------ - ! Tests of initial_template_col_crop - ! ------------------------------------------------------------------------ - - @Test - subroutine test_crop_active_in_soil_and_crop() - ! there are active columns both on the soil & crop landunits; should take the soil one - call setup() - cactive_prior(:) = .true. - @assertEqual(lun%coli(l1), initial_template_col_crop(bounds, c_new, cactive_prior)) - call cleanup() - end subroutine test_crop_active_in_soil_and_crop - - @Test - subroutine test_crop_no_soil() - ! no soil landunit, should take a crop column - call setup() - cactive_prior(:) = .true. - grc%landunit_indices(1,gi) = ispval - @assertEqual(lun%coli(l2), initial_template_col_crop(bounds, c_new, cactive_prior)) - call cleanup() - end subroutine test_crop_no_soil - - @Test - subroutine test_crop_no_soil_or_crop() - ! no soil or crop landunits, should give TEMPLATE_NONE_FOUND - call setup() - cactive_prior(:) = .true. - grc%landunit_indices(1:2,gi) = ispval - @assertEqual(TEMPLATE_NONE_FOUND, initial_template_col_crop(bounds, c_new, cactive_prior)) - call cleanup() - end subroutine test_crop_no_soil_or_crop - - ! ------------------------------------------------------------------------ - ! Tests of initialize_new_columns - ! - ! Note that, although we don't have any explicit tests of copy_state, its behavior is - ! implicitly tested through these tests - ! ------------------------------------------------------------------------ - - @Test - subroutine test_initialize_new_columns_none() - ! Nothing to initialize - real(r8), allocatable :: t_soisno_expected(:,:) - call setup() - ! col%active and cactive_prior are a mix of true/true, false/false and false/true, so - ! there's nothing to initialize - col%active(:) = .true. - cactive_prior(:) = .true. - col%active(lun%coli(l2)+1) = .false. - cactive_prior(lun%coli(l2)+1) = .false. - col%active(lun%coli(l2)+2) = .false. - t_soisno_expected = temperature_vars%t_soisno_col - call initialize_new_columns(bounds, cactive_prior, & - temperature_vars, waterstate_vars, soilhydrology_vars) - @assertEqual(t_soisno_expected, temperature_vars%t_soisno_col) - call cleanup() - end subroutine test_initialize_new_columns_none - - @Test - subroutine test_initialize_new_columns_TEMPLATE_NONE_FOUND() - ! Something to initialize, but template_col results in TEMPLATE_NONE_FOUND: state should remain - ! the same as before - real(r8), allocatable :: t_soisno_expected(:,:) - call setup() - col%active(:) = .false. - col%active(lun%coli(l2)+1) = .true. - ! all cactive_prior points were false, so there's nothing to use as a template: - cactive_prior(:) = .false. - t_soisno_expected = temperature_vars%t_soisno_col - call initialize_new_columns(bounds, cactive_prior, & - temperature_vars, waterstate_vars, soilhydrology_vars) - @assertEqual(t_soisno_expected, temperature_vars%t_soisno_col) - call cleanup() - end subroutine test_initialize_new_columns_TEMPLATE_NONE_FOUND - - @Test - subroutine test_initialize_new_columns_copy_state() - ! Something to initialize, which results in a state copy - real(r8), allocatable :: t_soisno_expected(:,:) - integer :: source_col, dest_col - - call setup() - - col%active(:) = .false. - dest_col = lun%coli(l2) + 1 - col%active(dest_col) = .true. - - cactive_prior(:) = .false. - source_col = lun%coli(l1) + 1 - cactive_prior(source_col) = .true. - - t_soisno_expected = temperature_vars%t_soisno_col - ! In the following, note that only the belowground portion (starting with level 1) is - ! copied: - t_soisno_expected(dest_col,1:) = temperature_vars%t_soisno_col(source_col,1:) - - call initialize_new_columns(bounds, cactive_prior, & - temperature_vars, waterstate_vars, soilhydrology_vars) - - @assertEqual(t_soisno_expected, temperature_vars%t_soisno_col) - call cleanup() - end subroutine test_initialize_new_columns_copy_state - -end module test_init_columns diff --git a/src/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt b/src/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt deleted file mode 100644 index 2547dc4a17..0000000000 --- a/src/dyn_subgrid/test/dynLandunitArea_test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(pfunit_sources - test_update_landunit_weights_one_gcell.pf - test_update_landunit_weights.pf) - -create_pFUnit_test(dynLandunitArea test_dynLandunitArea_exe - "${pfunit_sources}" "") - -target_link_libraries(test_dynLandunitArea_exe clm csm_share) - diff --git a/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf b/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf deleted file mode 100644 index 4cc250320b..0000000000 --- a/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights.pf +++ /dev/null @@ -1,147 +0,0 @@ -module test_update_landunit_weights - - ! Tests of the update_landunit_weights routine in the dynLandunitArea module - - use pfunit_mod - use unittestSubgridMod - use dynLandunitAreaMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use landunit_varcon , only : istsoil, istcrop, istice_mec, istdlak, istwet - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md - use GridcellType , only : grc - use LandunitType , only : lun - use decompMod , only : bounds_type - - implicit none - save - - real(r8), parameter :: tol = 1.e-14_r8 - -contains - - subroutine setup_start() - call unittest_subgrid_setup_start() - end subroutine setup_start - - subroutine setup_end() - call unittest_subgrid_setup_end() - end subroutine setup_end - - subroutine teardown() - call unittest_subgrid_teardown() - end subroutine teardown - - - @Test - subroutine test_one_gcell_all_lunits() - ! Test update_landunit_weights with a single grid cell, which has all landunits - ! present - - integer :: index_soil, index_crop, index_icemec, index_urbmd - real(r8) :: expected(begl:endl) - - call setup_start() - call unittest_add_gridcell() - ! Add all landunits, deliberately out of order; the weights sum to 1: - call unittest_add_landunit(my_gi=gi, ltype=5, wtgcell=0.16_r8) - call unittest_add_landunit(my_gi=gi, ltype=1, wtgcell=0.14_r8) - call unittest_add_landunit(my_gi=gi, ltype=6, wtgcell=0.08_r8) - call unittest_add_landunit(my_gi=gi, ltype=2, wtgcell=0.25_r8) - call unittest_add_landunit(my_gi=gi, ltype=7, wtgcell=0.06_r8) - call unittest_add_landunit(my_gi=gi, ltype=3, wtgcell=0.05_r8) - call unittest_add_landunit(my_gi=gi, ltype=8, wtgcell=0.04_r8) - call unittest_add_landunit(my_gi=gi, ltype=4, wtgcell=0.20_r8) - call unittest_add_landunit(my_gi=gi, ltype=9, wtgcell=0.02_r8) - call setup_end() - - ! In the following, we assume that the first few elements of decrease_order are: - ! istsoil, istcrop, isturb_md - - ! First increase the area of istice_mec: weights of istice_mec + istsoil + istcrop + 0.01 - index_soil = grc%landunit_indices(istsoil,gi) - index_crop = grc%landunit_indices(istcrop,gi) - index_icemec = grc%landunit_indices(istice_mec,gi) - index_urbmd = grc%landunit_indices(isturb_md,gi) - lun%wtgcell(index_icemec) = lun%wtgcell(index_icemec) + lun%wtgcell(index_soil) + lun%wtgcell(index_crop) + 0.01_r8 - - ! Now set the expected outcome - expected = lun%wtgcell - expected(index_soil) = 0._r8 - expected(index_crop) = 0._r8 - expected(index_urbmd) = expected(index_urbmd) - 0.01_r8 - - call update_landunit_weights(bounds) - @assertEqual(expected(bounds%begl:bounds%endl), lun%wtgcell(bounds%begl:bounds%endl), tolerance=tol) - - call teardown() - end subroutine test_one_gcell_all_lunits - - @Test - subroutine test_one_gcell_some_lunits() - ! Test update_landunit_weights with a single grid cell, which has only some landunits - ! present - - integer :: index_wet, index_icemec, index_crop - real(r8) :: expected(begl:endl) - - call setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istwet, wtgcell=0.3_r8) - index_wet = li - call unittest_add_landunit(my_gi=gi, ltype=istice_mec, wtgcell=0.8_r8) - index_icemec = li - call unittest_add_landunit(my_gi=gi, ltype=istcrop, wtgcell=0.5_r8) - index_crop = li - call setup_end() - - ! In the following, we assume that crop is decreased before wetland: - expected(index_icemec) = 0.8_r8 - expected(index_crop) = 0.0_r8 - expected(index_wet) = 0.2_r8 - - call update_landunit_weights(bounds) - @assertEqual(expected(bounds%begl:bounds%endl), lun%wtgcell(bounds%begl:bounds%endl), tolerance=tol) - - call teardown() - end subroutine test_one_gcell_some_lunits - - @Test - subroutine test_multiple_gcells() - ! Test update_landunit_weights with multiple grid cells - - integer :: g1, g2, g3 - real(r8) :: expected(begl:endl) - - call setup_start() - - call unittest_add_gridcell() - g1 = gi - call unittest_add_gridcell() - g2 = gi - call unittest_add_gridcell() - g3 = gi - - ! Deliberately add landunits out-of-order - call unittest_add_landunit(my_gi=g2, ltype=istice_mec, wtgcell=0.8_r8) - call unittest_add_landunit(my_gi=g3, ltype=istcrop, wtgcell=0.6_r8) - call unittest_add_landunit(my_gi=g1, ltype=isturb_md, wtgcell=0.45_r8) - call unittest_add_landunit(my_gi=g3, ltype=istice_mec, wtgcell=0.4_r8) - call unittest_add_landunit(my_gi=g1, ltype=istcrop, wtgcell=0.7_r8) - call unittest_add_landunit(my_gi=g2, ltype=istsoil, wtgcell=0.1_r8) - - call setup_end() - - ! grid cell 1 needs decrease in crop - ! grid cell 2 needs increase in soil - ! grid cell 3 stays the same - expected = lun%wtgcell - expected(grc%landunit_indices(istcrop,g1)) = 0.55_r8 - expected(grc%landunit_indices(istsoil,g2)) = 0.2_r8 - - call update_landunit_weights(bounds) - @assertEqual(expected(bounds%begl:bounds%endl), lun%wtgcell(bounds%begl:bounds%endl), tolerance=tol) - - call teardown() - end subroutine test_multiple_gcells - -end module test_update_landunit_weights diff --git a/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf b/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf deleted file mode 100644 index f0563130f3..0000000000 --- a/src/dyn_subgrid/test/dynLandunitArea_test/test_update_landunit_weights_one_gcell.pf +++ /dev/null @@ -1,135 +0,0 @@ -module test_update_landunit_weights_one_gcell - - ! Tests of the update_landunit_weights_one_gcell routine in the dynLandunitArea module - - use pfunit_mod - use dynLandunitAreaMod - use landunit_varcon, only : istsoil, istcrop, isturb_md, istice_mec, istdlak, max_lunit - use shr_kind_mod , only : r8 => shr_kind_r8 - - - implicit none - save - - real(r8), parameter :: tol = 1.e-14_r8 - -contains - - function create_landunit_weights() - ! Create default version of the landunit weights - real(r8), dimension(max_lunit), allocatable :: create_landunit_weights(:) - - ! Landunit 3 (previously istice) is currently unused, so set its area to 0. - create_landunit_weights = [.25_r8, .2_r8, 0._r8, .3_r8, .08_r8, .06_r8, .05_r8, .04_r8, .02_r8] - end function create_landunit_weights - - @Test - subroutine test_no_change() - ! Test with no changes needed in landunit areas, because they already add to 100% - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - expected = landunit_weights - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights) - end subroutine test_no_change - - @Test - subroutine test_less_than_1() - ! Test with the input summing to less than 1, which should result in an increase in - ! the natural vegetated area - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - landunit_weights(istice_mec) = landunit_weights(istice_mec) - 0.01_r8 - expected = landunit_weights - expected(istsoil) = landunit_weights(istsoil) + 0.01_r8 - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights, tolerance=tol) - end subroutine test_less_than_1 - - @Test - subroutine test_greater_than_1_one_change() - ! Test with the input summing to greater than 1, resulting in a change in a single - ! landunit - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - landunit_weights(istice_mec) = landunit_weights(istice_mec) + 0.01_r8 - expected = landunit_weights - expected(istsoil) = landunit_weights(istsoil) - 0.01_r8 - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights, tolerance=tol) - end subroutine test_greater_than_1_one_change - - @Test - subroutine test_greater_than_1_multiple_changes() - ! Test with the input summing to greater than 1, resulting in a change in multiple - ! landunits (but not all landunits) - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - - ! In the following, we assume that the first few elements of decrease_order are: - ! istsoil, istcrop, isturb_md - landunit_weights(istice_mec) = landunit_weights(istice_mec) + & - landunit_weights(istsoil) + landunit_weights(istcrop) + 0.01_r8 - expected = landunit_weights - expected(istsoil) = 0._r8 - expected(istcrop) = 0._r8 - expected(isturb_md) = expected(isturb_md) - 0.01_r8 - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights, tolerance=tol) - end subroutine test_greater_than_1_multiple_changes - - @Test - subroutine test_greater_than_1_all_changes() - ! Test with the input summing to greater than 1, resulting in a change in ALL - ! landunits (except istice_mec, which is the one set manually here, and which can - ! never change) - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - landunit_weights(istice_mec) = 0.99_r8 - - ! In the following, we assume that the last element of decrease_order is istdlak - expected(:) = 0._r8 - expected(istice_mec) = 0.99_r8 - expected(istdlak) = 0.01_r8 - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights, tolerance=tol) - end subroutine test_greater_than_1_all_changes - - @Test - subroutine test_greater_than_1_all_changes_to_0() - ! Similar to test_greater_than_1_all_changes, but now all landunits except istice_mec - ! are reduced to 0 - - real(r8) :: landunit_weights(max_lunit) - real(r8) :: expected(max_lunit) - - landunit_weights = create_landunit_weights() - landunit_weights(istice_mec) = 1.0_r8 - expected(:) = 0._r8 - expected(istice_mec) = 1.0_r8 - - call update_landunit_weights_one_gcell(landunit_weights) - @assertEqual(expected, landunit_weights, tolerance=tol) - end subroutine test_greater_than_1_all_changes_to_0 - -end module test_update_landunit_weights_one_gcell diff --git a/src/dyn_subgrid/test/dynPatchStateUpdater_test/CMakeLists.txt b/src/dyn_subgrid/test/dynPatchStateUpdater_test/CMakeLists.txt deleted file mode 100644 index 932fa98ea2..0000000000 --- a/src/dyn_subgrid/test/dynPatchStateUpdater_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(PatchStateUpdater test_PatchStateUpdater_exe - "test_patch_state_updater.pf" "") - -target_link_libraries(test_PatchStateUpdater_exe clm csm_share) \ No newline at end of file diff --git a/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf b/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf deleted file mode 100644 index 6e0cd9fc10..0000000000 --- a/src/dyn_subgrid/test/dynPatchStateUpdater_test/test_patch_state_updater.pf +++ /dev/null @@ -1,510 +0,0 @@ -module test_patch_state_updater - - ! Tests of dynPatchStateUpdaterMod - - use pfunit_mod - use dynPatchStateUpdaterMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestFilterBuilderMod - use PatchType - use LandunitType - use subgridWeightsMod, only : compute_higher_order_weights - use clm_varpar, only : mxpft - use landunit_varcon, only : istwet - - implicit none - - @TestCase - type, extends(TestCase) :: TestPSUpdater - ! filter - integer :: numf - integer, allocatable :: filter(:) - - contains - procedure :: setUp - procedure :: tearDown - procedure :: do_all_setup_with_n_vegetated_patches - end type TestPSUpdater - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Test helpers - ! ======================================================================== - - subroutine setUp(this) - class(TestPSUpdater), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestPSUpdater), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - !----------------------------------------------------------------------- - subroutine do_all_setup_with_n_vegetated_patches(this, ps_updater, & - pwtcol_old, pwtcol_new, pft_types, natveg_weight_old, natveg_weight_new) - ! - ! !DESCRIPTION: - ! Does all setup needed when setting up one grid cell that contains (1) a vegetated - ! column containing n patches, and (2) a wetland landunit with a single column and a - ! single patch. The old weight of the vegetated column is given by natveg_weight_old, - ! if provided; if not provided, it defaults to 0.5. The new weight of the vegetated - ! column is given by natveg_weight_new, if provided; if not provided, it defaults to - ! natveg_weight_old. - ! - ! !ARGUMENTS: - class(TestPSUpdater), intent(inout) :: this - type(patch_state_updater_type), intent(out) :: ps_updater - real(r8), intent(in) :: pwtcol_old(begp:) ! old weights of vegetated patches - real(r8), intent(in) :: pwtcol_new(begp:) ! new weights of vegetated patches - integer, intent(in), optional :: pft_types(:) - real(r8), intent(in), optional :: natveg_weight_old - real(r8), intent(in), optional :: natveg_weight_new - ! - ! !LOCAL VARIABLES: - integer :: p - integer :: li_natveg ! index of natural veg landunit - integer :: li_special ! index of special landunit - real(r8) :: l_natveg_weight_old - real(r8) :: l_natveg_weight_new - - character(len=*), parameter :: subname = 'do_all_setup_with_n_vegetated_patches' - !----------------------------------------------------------------------- - - if (present(natveg_weight_old)) then - l_natveg_weight_old = natveg_weight_old - else - l_natveg_weight_old = 0.5_r8 - end if - - if (present(natveg_weight_new)) then - l_natveg_weight_new = natveg_weight_new - else - l_natveg_weight_new = l_natveg_weight_old - end if - - ! Setup grid - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_vegetated_landunit_n_patches(lweight = l_natveg_weight_old, & - pwtcol = pwtcol_old, pft_types = pft_types) - li_natveg = li - call create_landunit_ncols(ltype = istwet, lweight = (1._r8 - l_natveg_weight_old), & - ctypes = [istwet], cweights = [1._r8]) - li_special = li - call unittest_subgrid_setup_end() - call filter_from_range(bounds%begp, bounds%endp, this%numf, this%filter) - - ! Setup ps_updater - ps_updater = patch_state_updater_type(bounds) - call ps_updater%set_old_weights(bounds) - - ! Change areas - ! Just include the vegetated patches in the loop - so skip the last patch - do p = bounds%begp, (bounds%endp - 1) - patch%wtcol(p) = pwtcol_new(p) - end do - lun%wtgcell(li_natveg) = l_natveg_weight_new - lun%wtgcell(li_special) = 1._r8 - l_natveg_weight_new - call compute_higher_order_weights(bounds) - - call ps_updater%set_new_weights(bounds) - - end subroutine do_all_setup_with_n_vegetated_patches - - - ! ======================================================================== - ! Actual tests - ! - ! Note: in most tests, there are 3 vegetated patches plus a wetland patch; the 2nd patch - ! is the patch of interest - ! ======================================================================== - - @Test - subroutine noAreaChange(this) - ! no area change => no change in value, flux stays the same - class(TestPSUpdater), intent(inout) :: this - real(r8), parameter :: pwtcol_old(3) = [0.25_r8, 0.5_r8, 0.25_r8] - real(r8), parameter :: pwtcol_new(3) = pwtcol_old - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4), expected_var(4) - real(r8) :: flux_col_area(4), expected_flux_col_area(4) - real(r8) :: flux_grc_area(4), expected_flux_grc_area(4) - - ! Setup - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - expected_var = var - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - expected_flux_col_area = flux_col_area - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - expected_flux_grc_area = flux_grc_area - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - @assertEqual(expected_var, var) - @assertEqual(expected_flux_col_area, flux_col_area) - @assertEqual(expected_flux_grc_area, flux_grc_area) - end subroutine noAreaChange - - @Test - subroutine areaIncreases(this) - ! if area increases from non-zero, then value is decreased appropriately; there - ! should be no change in flux - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol_old(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: pwtcol_new(3) = [0.2_r8, 0.3_r8, 0.5_r8] - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: flux_col_area(4) - real(r8) :: flux_grc_area(4) - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - @assertEqual(2._r8, var(2), tolerance=tol) - ! same as starting flux: - @assertEqual(13._r8, flux_col_area(2), tolerance=tol) - @assertEqual(23._r8, flux_grc_area(2), tolerance=tol) - end subroutine areaIncreases - - @Test - subroutine colAreaIncreases(this) - ! Column area increases with no change in pwtcol; value should be decreased - ! appropriately; there should be no change in flux - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: natveg_weight_old = 0.6_r8 - real(r8), parameter :: natveg_weight_new = 0.7_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: flux_col_area(4) - real(r8) :: flux_grc_area(4) - real(r8) :: expected_var2 - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol, & - pwtcol_new = pwtcol, & - natveg_weight_old = natveg_weight_old, & - natveg_weight_new = natveg_weight_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - expected_var2 = var(2) * natveg_weight_old / natveg_weight_new - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - @assertEqual(expected_var2, var(2), tolerance=tol) - ! same as starting flux: - @assertEqual(13._r8, flux_col_area(2), tolerance=tol) - @assertEqual(23._r8, flux_grc_area(2), tolerance=tol) - end subroutine colAreaIncreases - - @Test - subroutine areaIncreasesFromZero(this) - ! if area increases from zero, var should be set to 0 - class(TestPSUpdater), intent(inout) :: this - real(r8), parameter :: pwtcol_old(3) = [0.5_r8, 0.0_r8, 0.5_r8] - real(r8), parameter :: pwtcol_new(3) = [0.4_r8, 0.1_r8, 0.5_r8] - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - - ! Setup - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var) - - ! Verify - @assertEqual(0._r8, var(2)) - end subroutine areaIncreasesFromZero - - @Test - subroutine areaIncreases_withSeed(this) - ! area increases from non-zero with an additional seed amount - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol_old(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: pwtcol_new(3) = [0.2_r8, 0.3_r8, 0.5_r8] - real(r8), parameter :: natveg_weight = 0.5_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: seed(4) - real(r8) :: seed_addition(4) - real(r8) :: expected_seed_addition - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new, & - natveg_weight_old = natveg_weight) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - seed = [0._r8, 9._r8, 0._r8, 0._r8] - seed_addition = [22._r8, 23._r8, 24._r8, 25._r8] - expected_seed_addition = seed_addition(2) + seed(2) * 0.1_r8 * natveg_weight - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - seed = seed, & - seed_addition = seed_addition) - - ! Verify - ! Expected value of var(2) is: - ! 3 * (pwtcol_old(2)/pwtcol_new(2)) + - ! seed(2) * (pwtcol_new(2) - pwtcol_old(2))/pwtcol_new(2) - ! = 3 * 2/3 + 9 * 1/3 - ! = 5 - @assertEqual(5._r8, var(2), tolerance=tol) - @assertEqual(expected_seed_addition, seed_addition(2), tolerance=tol) - end subroutine areaIncreases_withSeed - - @Test - subroutine colAreaIncreases_withSeed(this) - ! Column area increases with no change in pwtcol, with an additional seed amount - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: natveg_weight_old = 0.6_r8 - real(r8), parameter :: natveg_weight_new = 0.7_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: seed(4) - real(r8) :: seed_addition(4) - real(r8) :: expected_var2 - real(r8) :: expected_seed_addition - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol, & - pwtcol_new = pwtcol, & - natveg_weight_old = natveg_weight_old, & - natveg_weight_new = natveg_weight_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - seed = [0._r8, 9._r8, 0._r8, 0._r8] - seed_addition = [22._r8, 23._r8, 24._r8, 25._r8] - ! In the calculation of expected_var2, we don't need pwtcol(2) because it doesn't - ! change. - expected_var2 = var(2) * natveg_weight_old / natveg_weight_new + & - seed(2) * (natveg_weight_new - natveg_weight_old) / natveg_weight_new - expected_seed_addition = seed_addition(2) + & - seed(2) * pwtcol(2) * (natveg_weight_new - natveg_weight_old) - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - seed = seed, & - seed_addition = seed_addition) - - ! Verify - @assertEqual(expected_var2, var(2), tolerance=tol) - @assertEqual(expected_seed_addition, seed_addition(2), tolerance=tol) - end subroutine colAreaIncreases_withSeed - - @Test - subroutine areaDecreases(this) - ! if area decreases, var should stay the same, and there should be a flux out - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol_old(3) = [0.2_r8, 0.3_r8, 0.5_r8] - real(r8), parameter :: pwtcol_new(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: natveg_weight = 0.5_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: flux_col_area(4) - real(r8) :: flux_grc_area(4) - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new, & - natveg_weight_old = natveg_weight) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - ! flux_col_area(2) changes by (pwtcol_new(2) - pwtcol_old(2)) * var(2) - @assertEqual(13._r8 - 0.3_r8, flux_col_area(2), tolerance=tol) - ! flux_grc_area(2) changes by (pwtgcell_new(2) - pwtgcell_old(2)) * var(2) - @assertEqual(23._r8 - 0.15_r8, flux_grc_area(2), tolerance=tol) - ! same as starting state: - @assertEqual(3._r8, var(2)) - end subroutine areaDecreases - - @Test - subroutine colAreaDecreases(this) - ! Column area decreases; var should stay the same, and there should be a flux out - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol(3) = [0.2_r8, 0.3_r8, 0.5_r8] - real(r8), parameter :: natveg_weight_old = 0.9_r8 - real(r8), parameter :: natveg_weight_new = 0.8_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: flux_col_area(4) - real(r8) :: flux_grc_area(4) - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol, & - pwtcol_new = pwtcol, & - natveg_weight_old = natveg_weight_old, & - natveg_weight_new = natveg_weight_new) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - ! flux_grc_area(2) changes by (pwtgcell_new(2) - pwtgcell_old(2)) * var(2) - @assertEqual(23._r8 - 0.09_r8, flux_grc_area(2), tolerance=tol) - ! flux_col_area(2) changes by: - ! ((pwtgcell_new(2) - pwtgcell_old(2)) / cwtgcell_old(2)) * var(2) - @assertEqual(13._r8 - 0.1_r8, flux_col_area(2), tolerance=tol) - ! same as starting state: - @assertEqual(3._r8, var(2)) - end subroutine colAreaDecreases - - @Test - subroutine multiplePatches_increase_zero_decrease(this) - ! Test multiple patches: one that increases, one with zero change, and one that - ! decreases. Make sure that new var and flux are correct in all of them - class(TestPSUpdater), intent(inout) :: this - real(r8), parameter :: pwtcol_old(3) = [0.2_r8, 0.5_r8, 0.3_r8] - real(r8), parameter :: pwtcol_new(3) = [0.3_r8, 0.5_r8, 0.2_r8] - real(r8), parameter :: natveg_weight = 0.5_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4), expected_var(4) - real(r8) :: flux_col_area(4), expected_flux_col_area(4) - real(r8) :: flux_grc_area(4), expected_flux_grc_area(4) - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new, & - natveg_weight_old = natveg_weight) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - expected_var = var - expected_var(1) = 4._r8 / 3._r8 - flux_col_area = [12._r8, 13._r8, 14._r8, 15._r8] - expected_flux_col_area = flux_col_area - expected_flux_col_area(3) = flux_col_area(3) - 0.4_r8 - flux_grc_area = [22._r8, 23._r8, 24._r8, 25._r8] - expected_flux_grc_area = flux_grc_area - ! flux_grc_area(3) changes by (pwtgcell_new(3) - pwtgcell_old(3)) * var(3) - expected_flux_grc_area(3) = flux_grc_area(3) - 0.2_r8 - - ! Exercise - call ps_updater%update_patch_state(bounds, & - this%numf, this%filter, var, & - flux_out_col_area = flux_col_area, & - flux_out_grc_area = flux_grc_area) - - ! Verify - @assertEqual(expected_var, var, tolerance=tol) - @assertEqual(expected_flux_col_area, flux_col_area, tolerance=tol) - @assertEqual(expected_flux_grc_area, flux_grc_area, tolerance=tol) - end subroutine multiplePatches_increase_zero_decrease - - @Test - subroutine areaDecreases_partitionFluxByType(this) - ! Test decrease in area with flux out partitioned into two pieces based on a variable - ! indexed by pft type - class(TestPSUpdater), intent(inout) :: this - ! The second patch is the patch of interest - real(r8), parameter :: pwtcol_old(3) = [0.2_r8, 0.3_r8, 0.5_r8] - real(r8), parameter :: pwtcol_new(3) = [0.3_r8, 0.2_r8, 0.5_r8] - real(r8), parameter :: natveg_weight = 0.5_r8 - integer, parameter :: patch2_type = 4 - integer, parameter :: pft_types(3) = [1, patch2_type, 1] - real(r8) :: flux1_fraction(0:mxpft) - real(r8), parameter :: patch2_flux_fraction = 0.6_r8 - type(patch_state_updater_type) :: ps_updater - real(r8) :: var(4) - real(r8) :: expected_total_flux, expected_flux1, expected_flux2 - real(r8) :: flux1(4), flux2(4) - - call this%do_all_setup_with_n_vegetated_patches(ps_updater, & - pwtcol_old = pwtcol_old, & - pwtcol_new = pwtcol_new, & - natveg_weight_old = natveg_weight, & - pft_types = pft_types) - - var = [2._r8, 3._r8, 4._r8, 5._r8] - flux1 = [12._r8, 13._r8, 14._r8, 15._r8] - flux2 = [22._r8, 23._r8, 24._r8, 25._r8] - - flux1_fraction(:) = 0._r8 - flux1_fraction(patch2_type) = patch2_flux_fraction - - ! Exercise - call ps_updater%update_patch_state_partition_flux_by_type(bounds, & - this%numf, this%filter, flux1_fraction, & - var, flux1, flux2) - - ! Verify - ! Note that fluxes in this routine are expressed as per-unit-area-gridcell - ! (equivalent to flux_grc_area in the main update_patch_state routine), - ! so total flux is (pwtgcell_old(2) - pwtgcell_new(2)) * var(2) - expected_total_flux = -0.15_r8 - expected_flux1 = expected_total_flux * patch2_flux_fraction - expected_flux2 = expected_total_flux * (1._r8 - patch2_flux_fraction) - ! For these assertions, we add the expected new flux to the original value of the flux: - @assertEqual(13._r8 + expected_flux1, flux1(2), tolerance=tol) - @assertEqual(23._r8 + expected_flux2, flux2(2), tolerance=tol) - end subroutine areaDecreases_partitionFluxByType - -end module test_patch_state_updater diff --git a/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt b/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt deleted file mode 100644 index 3e2e20e756..0000000000 --- a/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(dynTimeInfo test_dynTimeInfo_exe - "test_dynTimeInfo.pf" "") - -target_link_libraries(test_dynTimeInfo_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf b/src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf deleted file mode 100644 index cdb1e394ec..0000000000 --- a/src/dyn_subgrid/test/dynTimeInfo_test/test_dynTimeInfo.pf +++ /dev/null @@ -1,559 +0,0 @@ -module test_dynTimeInfo - - ! Tests of the dynTimeInfo class - - use pfunit_mod - use dynTimeInfoMod - use shr_kind_mod, only: r8 => shr_kind_r8 - use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown - use unittestTimeManagerMod, only : set_date => unittest_timemgr_set_curr_date - use unittestTimeManagerMod, only : set_year => unittest_timemgr_set_curr_year - - implicit none - save - - integer, parameter :: dtime = 1800 - - @TestCase - type, extends(TestCase) :: TestDynTimeInfo - contains - procedure :: setUp - procedure :: tearDown - end type TestDynTimeInfo - -contains - - subroutine setUp(this) - class(TestDynTimeInfo), intent(inout) :: this - - call unittest_timemgr_setup(dtime=dtime) - - ! Make sure the date is set to the start of the year (such that the year differs - ! between the start and end of the timestep), to make sure that the appropriate - ! year_position is being used. - call set_date(yr=1, mon=1, day=1, tod=0) - end subroutine setUp - - subroutine tearDown(this) - class(TestDynTimeInfo), intent(inout) :: this - - call unittest_timemgr_teardown() - end subroutine tearDown - - ! ---------------------------------------------------------------------- - ! Tests of the constructor - ! ---------------------------------------------------------------------- - - @Test - subroutine test_constructor_normal_a(this) - ! test constructor in the normal case that cur_year is within the time bounds - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11, 12, 13, 14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(2, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_constructor_normal_a - - @Test - subroutine test_constructor_normal_b(this) - ! another test of the constructor in the normal case that cur_year is within the time - ! bounds; this one tests the last interval - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11, 12, 13, 14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(3, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_constructor_normal_b - - @Test - subroutine test_constructor_early(this) - ! test constructor in the case when cur_year is prior to the first interval - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11, 12, 13], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(1, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_constructor_early - - @Test - subroutine test_constructor_late_a(this) - ! test constructor in the case when cur_year is just barely past the last interval - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11, 12, 13], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(3, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_constructor_late_a - - @Test - subroutine test_constructor_late_b(this) - ! test constructor in the case when cur_year is more than a year past the last interval - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11, 12, 13], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(3, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_constructor_late_b - - @Test - subroutine test_constructor_single_interval(this) - ! test constructor with a single interval (2 years) - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11, 12], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(2, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_constructor_single_interval - - @Test - subroutine test_constructor_single_year(this) - ! test constructor with a single year - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(1, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_constructor_single_year - - - ! ---------------------------------------------------------------------- - ! Tests of get_yearfrac - ! ---------------------------------------------------------------------- - - @Test - subroutine test_getYearfrac_positionEnd_returnsCorrectValue(this) - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_date(yr=11, mon=1, day=1, tod=0) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(0._r8, my_info%get_yearfrac()) - end subroutine test_getYearfrac_positionEnd_returnsCorrectValue - - @Test - subroutine test_getYearfrac_positionStart_returnsCorrectValue(this) - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_date(yr=11, mon=1, day=1, tod=dtime) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_START_OF_TIMESTEP) - - @assertEqual(0._r8, my_info%get_yearfrac()) - end subroutine test_getYearfrac_positionStart_returnsCorrectValue - - ! ---------------------------------------------------------------------- - ! Tests of get_year - ! ---------------------------------------------------------------------- - - @Test - subroutine test_get_year(this) - ! Test the get_year routine - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertEqual(11, my_info%get_year(1)) - @assertEqual(12, my_info%get_year(2)) - @assertEqual(14, my_info%get_year(4)) - end subroutine test_get_year - - - ! ---------------------------------------------------------------------- - ! Tests of is_before_time_series and is_after_time_series - ! ---------------------------------------------------------------------- - - @Test - subroutine test_is_before_after_early(this) - ! Test is_before_time_series and is_after_time_series, when year is before the time - ! series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertTrue(my_info%is_before_time_series()) - @assertFalse(my_info%is_after_time_series()) - end subroutine test_is_before_after_early - - @Test - subroutine test_is_before_after_first(this) - ! Test is_before_time_series and is_after_time_series, when year is the first year in - ! the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertFalse(my_info%is_before_time_series()) - @assertFalse(my_info%is_after_time_series()) - end subroutine test_is_before_after_first - - @Test - subroutine test_is_before_after_mid(this) - ! Test is_before_time_series and is_after_time_series, when year is in the middle of - ! the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(12) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertFalse(my_info%is_before_time_series()) - @assertFalse(my_info%is_after_time_series()) - end subroutine test_is_before_after_mid - - @Test - subroutine test_is_before_after_last(this) - ! Test is_before_time_series and is_after_time_series, when year is in the last - ! interval of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertFalse(my_info%is_before_time_series()) - @assertFalse(my_info%is_after_time_series()) - end subroutine test_is_before_after_last - - @Test - subroutine test_is_before_after_late(this) - ! Test is_before_time_series and is_after_time_series, when year is just past the end - ! of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertFalse(my_info%is_before_time_series()) - @assertTrue(my_info%is_after_time_series()) - end subroutine test_is_before_after_late - - @Test - subroutine test_is_before_after_very_late(this) - ! Test is_before_time_series and is_after_time_series, when year is far past the end - ! of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(15) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - - @assertFalse(my_info%is_before_time_series()) - @assertTrue(my_info%is_after_time_series()) - end subroutine test_is_before_after_very_late - - - - ! ---------------------------------------------------------------------- - ! Tests of set_current_year - typical scenarios - ! ---------------------------------------------------------------------- - - - @Test - subroutine test_update_no_change_early(this) - ! Test an update with no change in years, prior to start of time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call my_info%set_current_year() - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(1, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_no_change_early - - @Test - subroutine test_update_no_change_normal(this) - ! Test a normal update, no change in years - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call my_info%set_current_year() - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(2, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_update_no_change_normal - - @Test - subroutine test_update_no_change_late(this) - ! Test an update with no change in years, just past the end of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_no_change_late - - @Test - subroutine test_update_no_change_very_late(this) - ! Test an update with no change in years, significantly past the end of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(15) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_no_change_very_late - - @Test - subroutine test_update_early(this) - ! Test an update, with a change in years, both before the start of the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(9) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(10) - call my_info%set_current_year() - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(1, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_early - - @Test - subroutine test_update_early_to_normal(this) - ! Test an update, with a change in years, from before the time series to inside it - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(11) - call my_info%set_current_year() - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(2, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_update_early_to_normal - - @Test - subroutine test_update_normal(this) - ! Test an update, with a change in years, both within the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(12) - call my_info%set_current_year() - - @assertEqual(2, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - @assertTrue(my_info%is_within_bounds()) - end subroutine test_update_normal - - @Test - subroutine test_update_normal_to_late(this) - ! Test an update, with a change in years, from within the time series to after it - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(14) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_normal_to_late - - @Test - subroutine test_update_late(this) - ! Test an update, with a change in years, starting just after the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(15) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_late - - @Test - subroutine test_update_very_late(this) - ! Test an update, with a change in years, both significantly after the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(15) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(16) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - @assertFalse(my_info%is_within_bounds()) - end subroutine test_update_very_late - - ! ---------------------------------------------------------------------- - ! Tests of set_current_year - year decreasing - ! ---------------------------------------------------------------------- - - @Test - subroutine test_update_decreasing_early(this) - ! Test an update with decreasing years, starting before the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(9) - call my_info%set_current_year() - - @assertEqual(1, my_info%get_time_index_lower()) - @assertEqual(1, my_info%get_time_index_upper()) - end subroutine test_update_decreasing_early - - @Test - subroutine test_update_decreasing_normal(this) - ! Test an update with decreasing years, starting within the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(12) - call my_info%set_current_year() - - @assertEqual(2, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - end subroutine test_update_decreasing_normal - - @Test - subroutine test_update_decreasing_late(this) - ! Test an update with decreasing years, starting after the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(13) - call my_info%set_current_year() - - @assertEqual(3, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - end subroutine test_update_decreasing_late - - ! ---------------------------------------------------------------------- - ! Tests of set_current_year - year increasing by more than 1 - ! ---------------------------------------------------------------------- - - @Test - subroutine test_update_by2_early(this) - ! Test an update by 2 years, starting before the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(10) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(12) - call my_info%set_current_year() - - @assertEqual(2, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - end subroutine test_update_by2_early - - @Test - subroutine test_update_by2_normal(this) - ! Test an update by 2 years, starting within the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(11) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(13) - call my_info%set_current_year() - - @assertEqual(3, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - end subroutine test_update_by2_normal - - @Test - subroutine test_update_by2_late(this) - ! Test an update by 2 years, starting after the time series - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(14) - my_info = time_info_type([11,12,13,14], YEAR_POSITION_END_OF_TIMESTEP) - call set_year(16) - call my_info%set_current_year() - - @assertEqual(4, my_info%get_time_index_lower()) - @assertEqual(4, my_info%get_time_index_upper()) - end subroutine test_update_by2_late - - ! ---------------------------------------------------------------------- - ! Tests of alternative values of year_position - ! ---------------------------------------------------------------------- - - @Test - subroutine test_year_position_start_of_timestep(this) - ! make sure that, for year_position = YEAR_POSITION_START_OF_TIMESTEP, we truly get - ! the year from the start of the timestep - class(TestDynTimeInfo), intent(inout) :: this - type(time_info_type) :: my_info - - call set_year(13) - my_info = time_info_type([11, 12, 13, 14], YEAR_POSITION_START_OF_TIMESTEP) - - @assertEqual(2, my_info%get_time_index_lower()) - @assertEqual(3, my_info%get_time_index_upper()) - end subroutine test_year_position_start_of_timestep - -end module test_dynTimeInfo diff --git a/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt b/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt deleted file mode 100644 index 2fadf5d844..0000000000 --- a/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -set (pfunit_sources - test_dynVarTimeUninterp.pf - test_dynVarTimeInterp.pf) - -# extra sources used for this test, which are not .pf files -set (extra_sources - test_dynVarShared.F90) - -create_pfUnit_test(dynVar test_dynVar_exe - "${pfunit_sources}" "${extra_sources}") - -target_link_libraries(test_dynVar_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 b/src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 deleted file mode 100644 index be793ee8cb..0000000000 --- a/src/dyn_subgrid/test/dynVar_test/test_dynVarShared.F90 +++ /dev/null @@ -1,49 +0,0 @@ -module test_dynVarShared - ! Shared code to set up tests of dyn_var_type and its extensions - - use shr_kind_mod, only : r8 => shr_kind_r8 - use dynFileMod, only : dyn_file_type - use ncdio_pio, only : ncd_set_var - - implicit none - private - save - - public :: create_dyn_file - -contains - - function create_dyn_file() result(dyn_file) - ! Set up a dyn_file variable for tests. Assumes we're using the mock version of - ! dynFileMod. - ! - ! The years in the mock "file" go from 11 - 14. - - ! The "file" contains two variables: foo_1d, which is a 1-d variable (i.e., just space - ! & time, no level dimension); and foo_2d, which is a 2-d variable (i.e., includes a - ! level dimension) - - type(dyn_file_type) :: dyn_file - - real(r8) :: data1d(3,4) ! space & time only - real(r8) :: data2d(6,4) ! space & level & time; first two dimensions are [2,3] - - dyn_file = dyn_file_type([11,12,13,14]) - - data1d = reshape([1._r8, 2._r8, 3._r8, & ! year 11 - 4._r8, 5._r8, 6._r8, & ! year 12 - 7._r8, 8._r8, 9._r8, & ! year 13 - 10._r8,11._r8,12._r8], & ! year 14 - [3, 4]) - call ncd_set_var(dyn_file, 'foo_1d', data1d, [3]) - - data2d = reshape([ 1._r8, 2._r8, 3._r8, 4._r8, 5._r8, 6._r8, & ! year 11 - 7._r8, 8._r8, 9._r8, 10._r8, 11._r8, 12._r8, & ! year 12 - 13._r8, 14._r8, 15._r8, 16._r8, 17._r8, 18._r8, & ! year 13 - 19._r8, 20._r8, 21._r8, 22._r8, 23._r8, 24._r8],& ! year 14 - [6, 4]) - call ncd_set_var(dyn_file, 'foo_2d', data2d, [2, 3]) - - end function create_dyn_file - -end module test_dynVarShared diff --git a/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf b/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf deleted file mode 100644 index e50acf09a4..0000000000 --- a/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeInterp.pf +++ /dev/null @@ -1,356 +0,0 @@ -module test_dynVarTimeInterp - - ! Tests of dyn_var_time_interp - - use pfunit_mod - use shr_kind_mod, only : r8 => shr_kind_r8 - use dynVarTimeInterpMod, only : dyn_var_time_interp_type - use test_dynVarShared - use dynFileMod, only : dyn_file_type - use ncdio_pio, only : ncd_get_read_times, ncd_reset_read_times - use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown - use unittestTimeManagerMod, only : set_date => unittest_timemgr_set_curr_date - use unittestTimeManagerMod, only : set_year => unittest_timemgr_set_curr_year - - implicit none - save - - real(r8), parameter :: tol = 1.e-13_r8 - - @TestCase - type, extends(TestCase) :: TestDynVarTimeInterp - contains - procedure :: setUp - procedure :: tearDown - end type TestDynVarTimeInterp - -contains - - subroutine setUp(this) - class(TestDynVarTimeInterp), intent(inout) :: this - - ! Set the date to be 3/4 of the way into the year, so that interpolated values will - ! truly need to interpolate between the two years' values (rather than using, say, - ! Jan 1 at 0Z). - integer, parameter :: curr_yr = 1 - integer, parameter :: curr_mon = 10 - integer, parameter :: curr_day = 1 - integer, parameter :: curr_tod = 64800 - - call unittest_timemgr_setup() - call set_date(yr=curr_yr, mon=curr_mon, day=curr_day, tod=curr_tod) - end subroutine setUp - - subroutine tearDown(this) - class(TestDynVarTimeInterp), intent(inout) :: this - - call unittest_timemgr_teardown() - end subroutine tearDown - - @Test - subroutine test_get_current_data_1d_noReads(this) - ! Test get_current_data_1d with no reads after initialization - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - call var%get_current_data(data) - expected = [4.0_r8, 5.0_r8, 6.0_r8]*0.25_r8 + & - [7.0_r8, 8.0_r8, 9.0_r8]*0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call didn't trigger i/o: - @assertFalse(any(ncd_get_read_times(dyn_file, 'foo_1d'))) - - end subroutine test_get_current_data_1d_noReads - - @Test - subroutine test_get_current_data_1d_noReads_update(this) - ! Test get_current_data_1d with no reads after initialization, although it has an - ! set_current_year call that shouldn't do anything - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! make sure that a call to set_current_year with an unchanged year doesn't affect things at all - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - expected = [4.0_r8, 5.0_r8, 6.0_r8]*0.25_r8 + & - [7.0_r8, 8.0_r8, 9.0_r8]*0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call didn't trigger i/o: - @assertFalse(any(ncd_get_read_times(dyn_file, 'foo_1d'))) - - end subroutine test_get_current_data_1d_noReads_update - - - @Test - subroutine test_get_current_data_1d_noReads_conversion(this) - ! Test get_current_data_1d with no reads after initialization, with a conversion - ! factor - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=2.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - call var%get_current_data(data) - expected = [4.0_r8, 5.0_r8, 6.0_r8]*0.25_r8 + & - [7.0_r8, 8.0_r8, 9.0_r8]*0.75_r8 - expected = expected / 2.0_r8 - @assertEqual(expected, data, tolerance=tol) - - end subroutine test_get_current_data_1d_noReads_conversion - - - @Test - subroutine test_get_current_data_1d_yearsIncreaseBy1(this) - ! Test get_current_data_1d, where we move into the next interval so that both year - ! endpoints increase by 1. This should cause a read of new year 2's data, but - ! shouldn't need to read new year's 1 data - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - logical, allocatable :: read_times(:) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! advance to the next year, which should force a read - call set_year(13) - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - expected = [7.0_r8, 8.0_r8, 9.0_r8]*0.25_r8 + & - [10.0_r8, 11.0_r8, 12.0_r8]*0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call DID trigger i/o in this case. - ! However, it should only have triggered i/o for year 4, since year 3 should already - ! have been stored - read_times = ncd_get_read_times(dyn_file, 'foo_1d') - @assertTrue(read_times(4)) - @assertFalse(any(read_times(1:3))) - - end subroutine test_get_current_data_1d_yearsIncreaseBy1 - - @Test - subroutine test_get_current_data_1d_yearsIncreaseBy2(this) - ! Test get_current_data_1d, where we move forward by two intervals, so that both year - ! endpoints increase by 2. This should cause a read for both new end points. - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - logical, allocatable :: read_times(:) - - ! Set up test data - call set_year(11) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! advance by two years, which should force a read - call set_year(13) - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - expected = [7.0_r8, 8.0_r8, 9.0_r8]*0.25_r8 + & - [10.0_r8, 11.0_r8, 12.0_r8]*0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call DID trigger i/o in this case, for - ! both years 3 and 4. - read_times = ncd_get_read_times(dyn_file, 'foo_1d') - @assertTrue(read_times(3)) - @assertTrue(read_times(4)) - @assertFalse(any(read_times(1:2))) - - end subroutine test_get_current_data_1d_yearsIncreaseBy2 - - @Test - subroutine test_get_current_data_1d_year2Changes(this) - ! Test get_current_data_1d, where year 2 changes but not year 1. This would be the - ! case when we start prior to the time series, then enter the time series. In this - ! case, we should read year 2, but not year 1 data. - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - logical, allocatable :: read_times(:) - - ! Set up test data - call set_year(10) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! advance by a year, into the time series - call set_year(11) - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - expected = [1.0_r8, 2.0_r8, 3.0_r8]*0.25_r8 + & - [4.0_r8, 5.0_r8, 6.0_r8]*0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call DID trigger i/o in this case, but - ! just for year 2 - read_times = ncd_get_read_times(dyn_file, 'foo_1d') - @assertFalse(read_times(1)) - @assertTrue(read_times(2)) - @assertFalse(any(read_times(3:4))) - - end subroutine test_get_current_data_1d_year2Changes - - - @Test - subroutine test_get_current_data_1d_year1Changes(this) - ! Test get_current_data_1d, where year 1 changes but not year 2. This would be the - ! case when we start in the last interval of the time series, then exit the time - ! series. - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(3) - real(r8) :: expected(3) - logical, allocatable :: read_times(:) - - ! Set up test data - call set_year(13) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! advance by a year, past the end of the time series - call set_year(14) - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - expected = [10._r8, 11._r8, 12._r8] - @assertEqual(expected, data, tolerance=tol) - - ! Make sure that the above get_current_data call did NOT trigger i/o in this case - ! (year 2 is the same as before; year 1 should have gotten its data from the old year 2) - @assertFalse(any(ncd_get_read_times(dyn_file, 'foo_1d'))) - - end subroutine test_get_current_data_1d_year1Changes - - @Test - subroutine test_get_current_data_2d(this) - ! Test get_current_data_2d - class(TestDynVarTimeInterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_interp_type) :: var - real(r8) :: data(2,3) - real(r8) :: expected_time1(2,3), expected_time2(2,3), expected(2,3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_interp_type( & - dyn_file=dyn_file, & - varname='foo_2d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & ! setting this to false to avoid needing to set up the test data carefully - data_shape = shape(data)) - - call var%get_current_data(data) - expected_time1 = reshape([ 7._r8, 8._r8, 9._r8, 10._r8, 11._r8, 12._r8], [2,3]) - expected_time2 = reshape([13._r8, 14._r8, 15._r8, 16._r8, 17._r8, 18._r8], [2,3]) - expected = expected_time1 * 0.25_r8 + expected_time2 * 0.75_r8 - @assertEqual(expected, data, tolerance=tol) - - end subroutine test_get_current_data_2d - - -end module test_dynVarTimeInterp diff --git a/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf b/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf deleted file mode 100644 index 9f41a8c1ac..0000000000 --- a/src/dyn_subgrid/test/dynVar_test/test_dynVarTimeUninterp.pf +++ /dev/null @@ -1,198 +0,0 @@ -module test_dynVarTimeUninterp - - ! Tests of dyn_var_time_uninterp - - use pfunit_mod - use shr_kind_mod, only : r8 => shr_kind_r8 - use dynVarTimeUninterpMod, only : dyn_var_time_uninterp_type - use test_dynVarShared - use dynFileMod, only : dyn_file_type - use ncdio_pio, only : ncd_get_read_times, ncd_reset_read_times - use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown - use unittestTimeManagerMod, only : set_year => unittest_timemgr_set_curr_year - - implicit none - save - - real(r8), parameter :: tol = 1.e-13_r8 - - @TestCase - type, extends(TestCase) :: TestDynVarTimeUninterp - contains - procedure :: setUp - procedure :: tearDown - end type TestDynVarTimeUninterp - -contains - - subroutine setUp(this) - class(TestDynVarTimeUninterp), intent(inout) :: this - - call unittest_timemgr_setup() - end subroutine setUp - - subroutine tearDown(this) - class(TestDynVarTimeUninterp), intent(inout) :: this - - call unittest_timemgr_teardown() - end subroutine tearDown - - @Test - subroutine test_get_current_data_1d_noReads(this) - ! Test get_current_data_1d with no reads after initialization - class(TestDynVarTimeUninterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_uninterp_type) :: var - real(r8) :: data(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_uninterp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - call var%get_current_data(data) - @assertEqual([4.0_r8, 5.0_r8, 6.0_r8], data) - - ! Make sure that the above get_current_data call didn't trigger i/o: - @assertFalse(any(ncd_get_read_times(dyn_file, 'foo_1d'))) - - end subroutine test_get_current_data_1d_noReads - - - @Test - subroutine test_get_current_data_1d_noReads_update(this) - ! Test get_current_data_1d with no reads after initialization, although it has an - ! set_current_year call that shouldn't do anything - class(TestDynVarTimeUninterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_uninterp_type) :: var - real(r8) :: data(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_uninterp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! make sure that a call to set_current_year with an unchanged year doesn't affect things at all - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - @assertEqual([4.0_r8, 5.0_r8, 6.0_r8], data) - - ! Make sure that the above get_current_data call didn't trigger i/o: - @assertFalse(any(ncd_get_read_times(dyn_file, 'foo_1d'))) - - end subroutine test_get_current_data_1d_noReads_update - - - @Test - subroutine test_get_current_data_1d_noReads_conversion(this) - ! Test get_current_data_1d with no reads after initialization, with a conversion - ! factor - class(TestDynVarTimeUninterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_uninterp_type) :: var - real(r8) :: data(3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_uninterp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=2.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call var%get_current_data(data) - @assertEqual([2.0_r8, 2.5_r8, 3.0_r8], data, tolerance=tol) - - end subroutine test_get_current_data_1d_noReads_conversion - - - @Test - subroutine test_get_current_data_1d_doRead(this) - ! Test get_current_data_1d with an extra read after initialization - class(TestDynVarTimeUninterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_uninterp_type) :: var - real(r8) :: data(3) - logical, allocatable :: read_times(:) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_uninterp_type( & - dyn_file=dyn_file, & - varname='foo_1d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & - data_shape = shape(data)) - - call ncd_reset_read_times(dyn_file, 'foo_1d') - - ! advance to the next year, which should force a read - call set_year(13) - call dyn_file%time_info%set_current_year() - - call var%get_current_data(data) - @assertEqual([7.0_r8, 8.0_r8, 9.0_r8], data) - - ! Make sure that the get_current_data call DID trigger i/o in this case: - read_times = ncd_get_read_times(dyn_file, 'foo_1d') - @assertTrue(read_times(3)) - @assertFalse(any(read_times([1,2,4]))) - - end subroutine test_get_current_data_1d_doRead - - - @Test - subroutine test_get_current_data_2d(this) - ! Test get_current_data_2d - class(TestDynVarTimeUninterp), intent(inout) :: this - - type(dyn_file_type), target :: dyn_file - type(dyn_var_time_uninterp_type) :: var - real(r8) :: data(2,3) - real(r8) :: expected(2,3) - - ! Set up test data - call set_year(12) - dyn_file = create_dyn_file() - var = dyn_var_time_uninterp_type( & - dyn_file=dyn_file, & - varname='foo_2d', & - dim1name='grlnd', & - conversion_factor=1.0_r8, & - do_check_sums_equal_1 = .false., & ! setting this to false to avoid needing to set up the test data carefully - data_shape = shape(data)) - - call var%get_current_data(data) - expected = reshape([7._r8, 8._r8, 9._r8, 10._r8, 11._r8, 12._r8], [2,3]) - @assertEqual(expected, data) - - end subroutine test_get_current_data_2d - -end module test_dynVarTimeUninterp diff --git a/src/init_interp/CMakeLists.txt b/src/init_interp/CMakeLists.txt deleted file mode 100644 index 3baa8a8991..0000000000 --- a/src/init_interp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources - initInterpMindist.F90 - initInterpMultilevelBase.F90 - initInterpMultilevelCopy.F90 - initInterpMultilevelInterp.F90 - initInterpMultilevelSnow.F90 - initInterpMultilevelSplit.F90 - initInterpUtils.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90 deleted file mode 100644 index a5f31584bc..0000000000 --- a/src/init_interp/initInterp.F90 +++ /dev/null @@ -1,1261 +0,0 @@ -module initInterpMod - - !----------------------------------------------------------------------- - ! Interpolate initial conditions file from one resolution and/or landmask - ! to another resolution and/or landmask - !----------------------------------------------------------------------- - -#include "shr_assert.h" - use initInterpBounds, only : interp_bounds_type - use initInterpMindist, only: set_mindist, set_single_match - use initInterpMindist, only: subgrid_type, subgrid_special_indices_type - use initInterp1dData, only : interp_1d_data - use initInterp2dvar, only: interp_2dvar_type - use initInterpMultilevelBase, only : interp_multilevel_type - use initInterpMultilevelContainer, only : interp_multilevel_container_type - use initInterpUtils, only: glc_elevclasses_are_same - use shr_kind_mod , only: r8 => shr_kind_r8, r4 => shr_kind_r4 - use shr_const_mod , only: SHR_CONST_PI, SHR_CONST_REARTH - use shr_sys_mod , only: shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_string_mod , only: shr_string_listGetName - use clm_varctl , only: iulog - use abortutils , only: endrun - use spmdMod , only: masterproc - use restUtilMod , only: iflag_interp, iflag_copy, iflag_skip, iflag_area - use glcBehaviorMod , only: glc_behavior_type - use ncdio_utils , only: find_var_on_file - use ncdio_pio - use pio - - implicit none - private - save - - ! Public methods - - public :: initInterp_readnl ! Read namelist - public :: initInterp - - ! Private methods - - private :: check_dim_subgrid - private :: check_dim_level - private :: skip_var - private :: findMinDist - private :: set_subgrid_info - private :: interp_0d_copy - private :: interp_1d_double - private :: interp_1d_int - private :: interp_2d_double - private :: limit_snlsno - - ! Private data - - character(len=8) :: created_glacier_mec_landunits - - ! Allowable interpolation methods - ! - interp_method_general: The general-purpose method - ! - interp_method_finidat_areas: Take areas and other related fields from the finidat - ! file, rather than maintaining them at the values from the surface dataset. This - ! only works for interpolation from one resolution to the same resolution, and with - ! basically the same configuration. This also triggers different logic for finding - ! matching points, assuring that we find exactly one match in the input for each - ! output point. - integer, parameter :: interp_method_general = 1 - integer, parameter :: interp_method_finidat_areas = 2 - - ! One of the above methods - integer :: interp_method - - ! If true, fill missing types with closest natural veg column (using bare soil for - ! patch-level variables) - logical :: init_interp_fill_missing_with_natveg - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !======================================================================= - - !----------------------------------------------------------------------- - subroutine initInterp_readnl(NLFilename) - ! - ! !DESCRIPTION: - ! Read the namelist for initInterp - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=64) :: init_interp_method - - character(len=*), parameter :: subname = 'initInterp_readnl' - !----------------------------------------------------------------------- - - namelist /clm_initinterp_inparm/ & - init_interp_method, init_interp_fill_missing_with_natveg - - ! Initialize options to default values, in case they are not specified in the namelist - init_interp_method = ' ' - init_interp_fill_missing_with_natveg = .false. - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in clm_initinterp_inparm namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_initinterp_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_initinterp_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading clm_initinterp_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding clm_initinterp_inparm namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (init_interp_method, mpicom) - call shr_mpi_bcast (init_interp_fill_missing_with_natveg, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'initInterp settings:' - write(iulog,nml=clm_initinterp_inparm) - write(iulog,*) ' ' - end if - - call translate_options(init_interp_method) - call check_nl_consistency() - - contains - subroutine translate_options(init_interp_method) - ! Translate string options into integer parameters - character(len=*), intent(in) :: init_interp_method - - select case (init_interp_method) - case ('general') - interp_method = interp_method_general - case ('use_finidat_areas') - interp_method = interp_method_finidat_areas - case default - write(iulog,*) 'Unknown value for init_interp_method: ', trim(init_interp_method) - call endrun('Unknown value for init_interp_method') - end select - end subroutine translate_options - - subroutine check_nl_consistency() - if (interp_method == interp_method_finidat_areas .and. & - init_interp_fill_missing_with_natveg) then - call endrun(msg='init_interp_method = use_finidat_areas is incompatible with init_interp_fill_missing_with_natveg') - end if - end subroutine check_nl_consistency - - end subroutine initInterp_readnl - - - subroutine initInterp (filei, fileo, bounds, glc_behavior) - - !----------------------------------------------------------------------- - ! Read initial data from netCDF instantaneous initial data history file - !----------------------------------------------------------------------- - - use decompMod, only: bounds_type - - ! -------------------------------------------------------------------- - ! arguments - character(len=*) , intent(in) :: filei !input initial dataset - character(len=*) , intent(in) :: fileo !output initial dataset - type(bounds_type) , intent(in) :: bounds - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! local variables - integer :: i,j,k,l,m,n ! loop indices - integer :: begi, endi ! beginning/ending indices - integer :: bego, endo ! beginning/ending indices - type(interp_bounds_type) :: bounds_i ! input file bounds - type(interp_bounds_type) :: bounds_o ! output file bounds - integer :: nlevi,nlevo ! input/output number of levels - type(file_desc_t), target :: ncidi, ncido ! input/output pio fileids - integer :: dimleni,dimleno ! input/output dimension length - integer :: nvars ! number of variables - character(len=256) :: varname ! variable name - character(len=256) :: varname_i_options ! possible variable names on input file - character(len=256) :: varname_i ! variable name on input file - character(len=16) :: vec_dimname ! subgrid dimension name - type(Var_desc_t) :: vardesc ! pio variable descriptor - integer :: xtypeo ! netCDF variable type - integer :: varido ! netCDF variable id - integer :: ndimso ! netCDF number of dimensions - integer :: dimidso(3) = -1 ! netCDF dimension ids - integer :: status ! return code - integer :: iflag_interpinic - real(r8) :: rvalue - integer :: ivalue - integer :: spinup_state_i, spinup_state_o - integer :: decomp_cascade_state_i, decomp_cascade_state_o - integer :: npftsi, ncolsi, nlunsi, ngrcsi - integer :: npftso, ncolso, nlunso, ngrcso - logical :: glc_elevclasses_same - integer , pointer :: pftindx(:) - integer , pointer :: colindx(:) - integer , pointer :: lunindx(:) - integer , pointer :: grcindx(:) - logical , pointer :: pft_activei(:), pft_activeo(:) - logical , pointer :: col_activei(:), col_activeo(:) - logical , pointer :: lun_activei(:), lun_activeo(:) - logical , pointer :: grc_activei(:), grc_activeo(:) - integer , pointer :: sgridindex(:) - type(subgrid_special_indices_type) :: subgrid_special_indices - type(interp_multilevel_container_type) :: interp_multilevel_container - type(interp_2dvar_type) :: var2d_i, var2d_o ! holds metadata for 2-d variables - !-------------------------------------------------------------------- - - if (masterproc) then - write (iulog,*) '**** Mapping clm initial data from input ',trim(filei),& - ' to output ',trim(fileo),' ****' - end if - - ! -------------------------------------------- - ! Open input and output initial conditions files (both just for reading now) - ! -------------------------------------------- - - call ncd_pio_openfile (ncidi, trim(filei) , 0) - call ncd_pio_openfile (ncido, trim(fileo), ncd_write) - - ! -------------------------------------------- - ! Determine dimensions and error checks on dimensions - ! -------------------------------------------- - - call check_dim_subgrid(ncidi, ncido, dimname ='pft' , dimleni=npftsi, dimleno=npftso) - call check_dim_subgrid(ncidi, ncido, dimname ='column' , dimleni=ncolsi, dimleno=ncolso) - call check_dim_subgrid(ncidi, ncido, dimname ='landunit', dimleni=nlunsi, dimleno=nlunso) - call check_dim_subgrid(ncidi, ncido, dimname ='gridcell', dimleni=ngrcsi, dimleno=ngrcso) - - if (masterproc) then - write (iulog,*) 'input gridcells = ',ngrcsi,' output gridcells = ',ngrcso - write (iulog,*) 'input landuntis = ',nlunsi,' output landunits = ',nlunso - write (iulog,*) 'input columns = ',ncolsi,' output columns = ',ncolso - write (iulog,*) 'input pfts = ',npftsi,' output pfts = ',npftso - end if - - ! NOTE(wjs, 2015-10-31) The inclusion of must_be_same in these checks essentially - ! duplicates checks done elsewhere - specifically, if the interpolator for a given - ! level dimension is the copy interpolator, then that will do its own checks to - ! ensure that the dimension sizes match. So we may want to remove the must_be_same - ! argument, and make check_dim_level purely informational, in order to remove this - ! maintenance problem - or maybe even remove check_dim_level entirely. - call check_dim_level(ncidi, ncido, dimname='levsno' , must_be_same=.false.) - call check_dim_level(ncidi, ncido, dimname='levsno1', must_be_same=.false.) - call check_dim_level(ncidi, ncido, dimname='levcan' , must_be_same=.true.) - call check_dim_level(ncidi, ncido, dimname='levlak' , must_be_same=.true.) - call check_dim_level(ncidi, ncido, dimname='levtot' , must_be_same=.false.) - call check_dim_level(ncidi, ncido, dimname='levgrnd', must_be_same=.false.) - call check_dim_level(ncidi, ncido, dimname='numrad' , must_be_same=.true.) - - glc_elevclasses_same = glc_elevclasses_are_same(ncidi, ncido) - if (masterproc) then - write(iulog,*) 'Glacier elevation classes same in input and output?: ', & - glc_elevclasses_same - end if - - ! -------------------------------------------- - ! Determine input file global attributes that are needed - ! -------------------------------------------- - - status = pio_get_att(ncidi, pio_global, & - 'ipft_not_vegetated', & - subgrid_special_indices%ipft_not_vegetated) - status = pio_get_att(ncidi, pio_global, & - 'icol_vegetated_or_bare_soil', & - subgrid_special_indices%icol_vegetated_or_bare_soil) - status = pio_get_att(ncidi, pio_global, & - 'ilun_vegetated_or_bare_soil', & - subgrid_special_indices%ilun_vegetated_or_bare_soil) - status = pio_get_att(ncidi, pio_global, & - 'ilun_crop', & - subgrid_special_indices%ilun_crop) - status = pio_get_att(ncidi, pio_global, & - 'ilun_landice_multiple_elevation_classes', & - subgrid_special_indices%ilun_landice_multiple_elevation_classes) - status = pio_get_att(ncidi, pio_global, & - 'created_glacier_mec_landunits', & - created_glacier_mec_landunits) - - if (masterproc) then - write(iulog,*)'ipft_not_vegetated = ' , & - subgrid_special_indices%ipft_not_vegetated - write(iulog,*)'icol_vegetated_or_bare_soil = ' , & - subgrid_special_indices%icol_vegetated_or_bare_soil - write(iulog,*)'ilun_vegetated_or_bare_soil = ' , & - subgrid_special_indices%ilun_vegetated_or_bare_soil - write(iulog,*)'ilun_crop = ' , & - subgrid_special_indices%ilun_crop - write(iulog,*)'ilun_landice_multiple_elevation_classes = ' , & - subgrid_special_indices%ilun_landice_multiple_elevation_classes - write(iulog,*)'create_glacier_mec_landunits = ', & - trim(created_glacier_mec_landunits) - end if - - ! -------------------------------------------- - ! Find closest values for pfts, cols, landunits, gridcells - ! -------------------------------------------- - - bounds_i = interp_bounds_type( & - begp = 1, endp = npftsi, & - begc = 1, endc = ncolsi, & - begl = 1, endl = nlunsi, & - begg = 1, endg = ngrcsi) - - ! It is important for bounds_o to match the passed-in bounds - i.e., for the - ! decomposition within init_interp to match the model's decomposition. This way we - ! can access other information for the output configuration that is not contained in - ! the restart file. - bounds_o = interp_bounds_type( & - begp = bounds%begp, endp = bounds%endp, & - begc = bounds%begc, endc = bounds%endc, & - begl = bounds%begl, endl = bounds%endl, & - begg = bounds%begg, endg = bounds%endg) - - allocate(pft_activei(bounds_i%get_begp():bounds_i%get_endp())) - allocate(col_activei(bounds_i%get_begc():bounds_i%get_endc())) - allocate(lun_activei(bounds_i%get_begl():bounds_i%get_endl())) - allocate(grc_activei(bounds_i%get_begg():bounds_i%get_endg())) - - allocate(pft_activeo(bounds_o%get_begp():bounds_o%get_endp())) - allocate(col_activeo(bounds_o%get_begc():bounds_o%get_endc())) - allocate(lun_activeo(bounds_o%get_begl():bounds_o%get_endl())) - allocate(grc_activeo(bounds_o%get_begg():bounds_o%get_endg())) - - allocate(pftindx(bounds_o%get_begp():bounds_o%get_endp())) - allocate(colindx(bounds_o%get_begc():bounds_o%get_endc())) - allocate(lunindx(bounds_o%get_begl():bounds_o%get_endl())) - allocate(grcindx(bounds_o%get_begg():bounds_o%get_endg())) - - ! For each output pft, find the input pft, pftindx, that is closest - - if (masterproc) then - write(iulog,*)'finding minimum distance for pfts' - end if - vec_dimname = 'pft' - call findMinDist(vec_dimname, bounds_i%get_begp(), bounds_i%get_endp(), & - bounds_o%get_begp(), bounds_o%get_endp(), ncidi, ncido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - pft_activei, pft_activeo, pftindx ) - - ! For each output column, find the input column, colindx, that is closest - - if (masterproc) then - write(iulog,*)'finding minimum distance for columns' - end if - vec_dimname = 'column' - call findMinDist(vec_dimname, bounds_i%get_begc(), bounds_i%get_endc(), & - bounds_o%get_begc(), bounds_o%get_endc(), ncidi, ncido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - col_activei, col_activeo, colindx ) - - ! For each output landunit, find the input landunit, lunindx, that is closest - - if (masterproc) then - write(iulog,*)'finding minimum distance for landunits' - end if - vec_dimname = 'landunit' - call findMinDist(vec_dimname, bounds_i%get_begl(), bounds_i%get_endl(), & - bounds_o%get_begl(), bounds_o%get_endl(), ncidi, ncido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - lun_activei, lun_activeo, lunindx ) - - ! For each output gridcell, find the input gridcell, grcindx, that is closest - - if (masterproc) then - write(iulog,*)'finding minimum distance for gridcells' - end if - vec_dimname = 'gridcell' - call findMinDist(vec_dimname, bounds_i%get_begg(), bounds_i%get_endg(), & - bounds_o%get_begg(), bounds_o%get_endg(), ncidi, ncido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - grc_activei, grc_activeo, grcindx) - - ! ------------------------------------------------------------------------ - ! Set up interpolators for multi-level variables - ! ------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*)'setting up interpolators for multi-level variables' - end if - interp_multilevel_container = interp_multilevel_container_type( & - ncid_source = ncidi, ncid_dest = ncido, & - bounds_source = bounds_i, bounds_dest = bounds_o, & - pftindex = pftindx, colindex = colindx) - - !------------------------------------------------------------------------ - ! Read input initial data and write output initial data - !------------------------------------------------------------------------ - - ! Only examing the snow interfaces above zi=0 => zisno and zsno have - ! the same level dimension below - - ! Read input initial data and write output initial data - ! Only examing the snow interfaces above zi=0 => zisno and zsno have - ! the same level dimension below - - if (masterproc) then - write(iulog,*)'reading in initial dataset' - end if - ! Get number of output variables and loop over them - status = pio_inquire(ncido, nVariables=nvars) - do varido = 1, nvars - - !--------------------------------------------------- - ! Given varido, get out variable data - !--------------------------------------------------- - - status = pio_inquire_variable(ncido, varid=varido, name=varname, & - xtype=xtypeo, ndims=ndimso, dimids=dimidso) - - !--------------------------------------------------- - ! If variable is zsoi, SKIP this variable - !--------------------------------------------------- - - if ( trim(varname) == 'zsoi' ) then - if (masterproc) then - write(iulog,*) 'Skipping : ',trim(varname) - end if - CYCLE - end if - - !--------------------------------------------------- - ! If interpinic flag is set to skip on output file - ! SKIP this variable - !--------------------------------------------------- - - status = pio_inq_varid (ncido, trim(varname), vardesc) - status = pio_get_att(ncido, vardesc, 'interpinic_flag', iflag_interpinic) - if (skip_var(iflag_interpinic)) then - if (masterproc) then - write (iulog,*) 'Skipping : ', trim(varname) - end if - CYCLE - end if - - !--------------------------------------------------- - ! Read metadata telling us possible variable names on input file; - ! determine which of these is present on the input file - !--------------------------------------------------- - - ! 'varnames_on_old_files' is a colon-delimited list of possible variable names, - ! enabling backwards compatibility with old input files - status = pio_get_att(ncido, vardesc, 'varnames_on_old_files', varname_i_options) - - ! We expect the first name in the list to match the current variable name. If that - ! isn't true, abort. This check is mainly to catch behavior changes in the code to - ! write this attribute in restUtilMod: Significant changes in behavior there need - ! to be matched by corresponding changes in this module. For example, if - ! restUtilMod changes this attribute to exclude the first name (which, after all, - ! is available via the variable name itself), then code in this module should - ! change accordingly. - call shr_string_listGetName(varname_i_options, 1, varname_i) - if (varname_i /= varname) then - if (masterproc) then - write(iulog,*) 'ERROR: expect first element in varnames_on_old_files to match varname' - write(iulog,*) 'varname = ', trim(varname) - write(iulog,*) 'varnames_on_old_files = ', trim(varname_i_options) - write(iulog,*) 'This likely indicates that the code to write the' - write(iulog,*) 'varnames_on_old_files attribute list has changed behavior.' - end if - call endrun(msg='ERROR: expect first element in varnames_on_old_files to match varname'// & - errMsg(sourcefile, __LINE__)) - end if - - ! Find which of the list of possible variables actually exists on the input file. - call find_var_on_file(ncidi, varname_i_options, varname_i) - - ! Note that, if none of the options are found, varname_i will be set to the first - ! variable in the list, in which case the following code will determine that we - ! should skip this variable. - - !--------------------------------------------------- - ! If variable is on output file - but not on input file - ! SKIP this variable - !--------------------------------------------------- - - call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR) - status = pio_inq_varid(ncidi, name=varname_i, vardesc=vardesc) - call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR) - if (status /= PIO_noerr) then - if (masterproc) then - write (iulog,*) 'Skipping : ', trim(varname), ' variable is NOT on input file' - end if - CYCLE - end if - - !--------------------------------------------------- - ! For scalar outut variables - !--------------------------------------------------- - - if ( ndimso == 0 ) then - - if ( trim(varname) .eq. 'spinup_state' ) then - - ! since we are copying soil variables, need to also copy spinup state - ! since otherwise if they are different then it will break the spinup procedure - status = pio_inq_varid(ncidi, trim(varname_i), vardesc) - status = pio_get_var(ncidi, vardesc, spinup_state_i) - status = pio_inq_varid(ncido, trim(varname), vardesc) - status = pio_get_var(ncido, vardesc, spinup_state_o) - if ( spinup_state_i /= spinup_state_o ) then - if (masterproc) then - write (iulog,*) 'Spinup states are different: Copying: ', & - trim(varname_i), ' => ', trim(varname) - end if - status = pio_put_var(ncido, vardesc, spinup_state_i) - else - if (masterproc) then - write (iulog,*) 'Spinup states match: Skipping: ', & - trim(varname_i), ' => ', trim(varname) - end if - endif - - else if ( trim(varname) .eq. 'decomp_cascade_state' ) then - - ! ditto for the decomposition cascade - status = pio_inq_varid(ncidi, trim(varname_i), vardesc) - status = pio_get_var(ncidi, vardesc, decomp_cascade_state_i) - status = pio_inq_varid(ncido, trim(varname), vardesc) - status = pio_get_var(ncido, vardesc, decomp_cascade_state_o) - if ( decomp_cascade_state_i /= decomp_cascade_state_o ) then - call endrun(msg='ERROR: Decomposition cascade states are different'//errMsg(sourcefile, __LINE__)) - else - if (masterproc) then - write (iulog,*) 'Decomposition cascade states match: Skipping: ', & - trim(varname_i), ' => ', trim(varname) - end if - endif - - else if (iflag_interpinic == iflag_copy) then - - call interp_0d_copy(varname, varname_i, xtypeo, ncidi, ncido) - - else if (iflag_interpinic == iflag_skip) then - - if (masterproc) then - write(iulog,*) 'Skipping : ',trim(varname) - end if - - else - - if (masterproc) then - write(iulog,*) 'Bad interpinic flag for scalar variable ', trim(varname), & - ': ', iflag_interpinic - call endrun(msg='Bad interpinic flag for scalar variable'//errMsg(sourcefile, __LINE__)) - end if - - end if - - !--------------------------------------------------- - ! For 1D output variables - !--------------------------------------------------- - - else if ( ndimso == 1 ) then - - status = pio_inq_dimname(ncido, dimidso(1), vec_dimname) - begi = bounds_i%get_beg(vec_dimname) - endi = bounds_i%get_end(vec_dimname) - bego = bounds_o%get_beg(vec_dimname) - endo = bounds_o%get_end(vec_dimname) - if ( vec_dimname == 'pft' )then - sgridindex => pftindx - else if ( vec_dimname == 'column' )then - sgridindex => colindx - else if ( vec_dimname == 'landunit' )then - sgridindex => lunindx - else if ( vec_dimname == 'gridcell' )then - sgridindex => grcindx - else - call endrun(msg='ERROR interpinic: 1D variable '//trim(varname)//& - 'with unknown subgrid dimension: '//trim(vec_dimname)//& - errMsg(sourcefile, __LINE__)) - end if - - if ( xtypeo == pio_int )then - call interp_1d_int ( varname, varname_i, vec_dimname, begi, endi, bego, endo, & - ncidi, ncido, sgridindex ) - else if ( xtypeo == pio_double )then - call interp_1d_double( varname, varname_i, vec_dimname, begi, endi, bego, endo, & - ncidi, ncido, sgridindex ) - else - call endrun(msg='ERROR interpinic: 1D variable with unknown type: '//& - trim(varname)//errMsg(sourcefile, __LINE__)) - end if - - !--------------------------------------------------- - ! For 2D output variables - !--------------------------------------------------- - - else if ( ndimso == 2 )then - - if ( xtypeo /= pio_double )then - call endrun(msg='ERROR interpinic: 2D variable with unknown type: '//& - trim(varname)//errMsg(sourcefile, __LINE__)) - end if - - var2d_i = interp_2dvar_type( & - varname = varname_i, & - ncid = ncidi, & - file_is_dest = .false., & - bounds = bounds_i) - - var2d_o = interp_2dvar_type( & - varname = varname, & - ncid = ncido, & - file_is_dest = .true., & - bounds = bounds_o) - - vec_dimname = var2d_o%get_vec_dimname() - begi = bounds_i%get_beg(vec_dimname) - endi = bounds_i%get_end(vec_dimname) - bego = bounds_o%get_beg(vec_dimname) - endo = bounds_o%get_end(vec_dimname) - if ( vec_dimname == 'pft' )then - sgridindex => pftindx - else if ( vec_dimname == 'column' )then - sgridindex => colindx - else if ( vec_dimname == 'landunit' )then - sgridindex => lunindx - else if ( vec_dimname == 'gridcell' )then - sgridindex => grcindx - else - call endrun(msg='ERROR interpinic: 2D variable with unknown subgrid dimension: '//& - trim(varname)//errMsg(sourcefile, __LINE__)) - end if - call interp_2d_double(var2d_i, var2d_o, & - begi, endi, bego, endo, & - sgridindex, & - interp_multilevel_container) - - else - - call endrun(msg='ERROR interpinic: variable NOT scalar, 1D or 2D: '//& - trim(varname)//errMsg(sourcefile, __LINE__)) - - end if - call shr_sys_flush(iulog) - - end do - ! Close input file - - call pio_closefile(ncidi) - - ! Do some final cleanup of specific variables - ! - ! NOTE(wjs, 2015-10-31) I really don't like having this variable-specific logic here, - ! but I can't see a great way around this. (One alternative would be to do this - ! cleanup when reading the restart file, e.g., in subgridRestMod. But (1) that feels - ! like a hidden way to accomplish this, and (2) that would apply for *any* restart - ! read, as opposed to just restart reads following init_interp, which could mask - ! problems with other restart files.) - - ! Need to first sync the file so the previous writes complete before we try to re-read - ! variables - call pio_syncfile(ncido) - - ! BUG: (EBK, 2016-1-6, bugz: 2261) PIO2 in cime4.3.9 has a bug where you can't do - ! two writes of the same variable to a file. So we have to close and reopen the file. - ! When PIO2 is robust enough to handle that we can remove the following two lines. - call pio_closefile(ncido) - call ncd_pio_openfile (ncido, trim(fileo), ncd_write) - ! ENDBUG: - - if (masterproc) then - write(iulog,*) 'Cleaning up / adjusting variables' - end if - - call limit_snlsno(ncido, bounds_o) - - - ! Close output file - - call pio_closefile(ncido) - - if (masterproc) then - write (iulog,*) ' Successfully created initial condition file mapped from input IC file' - end if - - end subroutine initInterp - - !----------------------------------------------------------------------- - function skip_var(iflag_interpinic) - ! - ! !DESCRIPTION: - ! Logical function saying whether we should skip a given variable given - ! iflag_interpinic and interp_method - ! - ! !ARGUMENTS: - logical :: skip_var ! function result - integer, intent(in) :: iflag_interpinic - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'skip_var' - !----------------------------------------------------------------------- - - if (iflag_interpinic == iflag_skip) then - skip_var = .true. - else if (iflag_interpinic == iflag_area) then - select case (interp_method) - case (interp_method_general) - skip_var = .true. - case (interp_method_finidat_areas) - skip_var = .false. - case default - call endrun(msg='Unhandled interp_method'//errMsg(sourcefile, __LINE__)) - end select - else - skip_var = .false. - end if - - end function skip_var - - - !======================================================================= - - subroutine findMinDist( dimname, begi, endi, bego, endo, ncidi, ncido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - activei, activeo, minindx) - - ! -------------------------------------------------------------------- - ! - ! Find the PATCH distances based on the column distances already calculated - ! - ! arguments - character(len=*) , intent(inout) :: dimname - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - type(glc_behavior_type), intent(in) :: glc_behavior - logical , intent(in) :: glc_elevclasses_same - logical , intent(out) :: activei(begi:endi) - logical , intent(out) :: activeo(bego:endo) - integer , intent(out) :: minindx(bego:endo) - ! - ! local variables - type(subgrid_type) :: subgridi - type(subgrid_type) :: subgrido - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*)'calling set_subgrid_info for ',trim(dimname), ' for input' - end if - call set_subgrid_info(beg=begi, end=endi, dimname=dimname, use_glob=.true., & - ncid=ncidi, active=activei, subgrid=subgridi) - - if (masterproc) then - write(iulog,*)'calling set_subgrid_info for ',trim(dimname), ' for output' - end if - call set_subgrid_info(beg=bego, end=endo, dimname=dimname, use_glob=.false., & - ncid=ncido, active=activeo, subgrid=subgrido) - - select case (interp_method) - case (interp_method_general) - if (masterproc) then - write(iulog,*) 'calling set_mindist for ',trim(dimname) - end if - call set_mindist(begi=begi, endi=endi, bego=bego, endo=endo, & - activei=activei, activeo=activeo, subgridi=subgridi, subgrido=subgrido, & - subgrid_special_indices=subgrid_special_indices, & - glc_behavior=glc_behavior, & - glc_elevclasses_same=glc_elevclasses_same, & - fill_missing_with_natveg=init_interp_fill_missing_with_natveg, & - mindist_index=minindx) - case (interp_method_finidat_areas) - if (masterproc) then - write(iulog,*) 'calling set_single_match for ',trim(dimname) - end if - call set_single_match(begi=begi, endi=endi, bego=bego, endo=endo, & - activeo=activeo, subgridi=subgridi, subgrido=subgrido, & - subgrid_special_indices=subgrid_special_indices, & - glc_behavior=glc_behavior, & - glc_elevclasses_same=glc_elevclasses_same, & - mindist_index=minindx) - case default - write(iulog,*) 'findMinDist: unhandled interp_method: ', interp_method - call endrun('Unhandled interp_method'//errMsg(sourcefile, __LINE__)) - end select - - deallocate(subgridi%lat, subgridi%lon, subgridi%coslat) - deallocate(subgrido%lat, subgrido%lon, subgrido%coslat) - - end subroutine findMinDist - - !======================================================================= - - subroutine set_subgrid_info(beg, end, dimname, use_glob, ncid, active, subgrid) - - ! -------------------------------------------------------------------- - ! arguments - integer , intent(in) :: beg, end - type(file_desc_t) , intent(inout) :: ncid - character(len=*) , intent(in) :: dimname - logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - logical , intent(out) :: active(beg:end) - type(subgrid_type) , intent(inout) :: subgrid - ! - ! local variables - integer :: n - integer, pointer :: itemp(:) - real(r8), parameter :: deg2rad = SHR_CONST_PI/180._r8 - !----------------------------------------------------------------------- - - subgrid%name = dimname - - allocate(itemp(beg:end)) - allocate(subgrid%lat(beg:end), subgrid%lon(beg:end), subgrid%coslat(beg:end)) - if (dimname == 'pft') then - allocate(subgrid%ptype(beg:end), subgrid%ctype(beg:end), subgrid%ltype(beg:end)) - else if (dimname == 'column') then - allocate(subgrid%ctype(beg:end), subgrid%ltype(beg:end)) - else if (dimname == 'landunit') then - allocate(subgrid%ltype(beg:end)) - end if - - ! determine if is_glcmec from global attributes - if (trim(created_glacier_mec_landunits) == 'true') then - if (dimname == 'pft' .or. dimname == 'column') then - allocate(subgrid%topoglc(beg:end)) - end if - end if - - if (dimname == 'pft') then - call read_var_double(ncid=ncid, varname='pfts1d_lon' , data=subgrid%lon , dim1name='pft', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='pfts1d_lat' , data=subgrid%lat , dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_itypveg', data=subgrid%ptype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_itypcol', data=subgrid%ctype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_ityplun', data=subgrid%ltype, dim1name='pft', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='pfts1d_active' , data=itemp , dim1name='pft', use_glob=use_glob) - if (associated(subgrid%topoglc)) then - call read_var_double(ncid=ncid, varname='pfts1d_topoglc', data=subgrid%topoglc, dim1name='pft', use_glob=use_glob) - end if - else if (dimname == 'column') then - call read_var_double(ncid=ncid, varname='cols1d_lon' , data=subgrid%lon , dim1name='column', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='cols1d_lat' , data=subgrid%lat , dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_ityp' , data=subgrid%ctype, dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_ityplun', data=subgrid%ltype, dim1name='column', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='cols1d_active' , data=itemp , dim1name='column', use_glob=use_glob) - if (associated(subgrid%topoglc)) then - call read_var_double(ncid=ncid, varname='cols1d_topoglc', data=subgrid%topoglc, dim1name='column', use_glob=use_glob) - end if - else if (dimname == 'landunit') then - call read_var_double(ncid=ncid, varname='land1d_lon' , data=subgrid%lon , dim1name='landunit', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='land1d_lat' , data=subgrid%lat , dim1name='landunit', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='land1d_ityplun', data=subgrid%ltype, dim1name='landunit', use_glob=use_glob) - call read_var_int(ncid=ncid, varname='land1d_active' , data=itemp , dim1name='landunit', use_glob=use_glob) - else if (dimname == 'gridcell') then - call read_var_double(ncid=ncid, varname='grid1d_lon' , data=subgrid%lon , dim1name='gridcell', use_glob=use_glob) - call read_var_double(ncid=ncid, varname='grid1d_lat' , data=subgrid%lat , dim1name='gridcell', use_glob=use_glob) - - ! All gridcells in the restart file are active - itemp(beg:end) = 1 - end if - - do n = beg,end - if (itemp(n) > 0) then - active(n) = .true. - else - active(n) = .false. - end if - subgrid%lat(n) = subgrid%lat(n)*deg2rad - subgrid%lon(n) = subgrid%lon(n)*deg2rad - subgrid%coslat(n) = cos(subgrid%lat(n)) - end do - - deallocate(itemp) - - contains - - subroutine read_var_double(ncid, varname, data, dim1name, use_glob) - ! Wraps the ncd_io call, providing logic related to whether we're using the 'glob' - ! form of ncd_io - type(file_desc_t) , intent(inout) :: ncid - character(len=*) , intent(in) :: varname - real(r8), pointer , intent(inout) :: data(:) - character(len=*) , intent(in) :: dim1name - logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - - if (use_glob) then - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data) - else - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data, dim1name=dim1name) - end if - end subroutine read_var_double - - subroutine read_var_int(ncid, varname, data, dim1name, use_glob) - ! Wraps the ncd_io call, providing logic related to whether we're using the 'glob' - ! form of ncd_io - type(file_desc_t) , intent(inout) :: ncid - character(len=*) , intent(in) :: varname - integer, pointer , intent(inout) :: data(:) - character(len=*) , intent(in) :: dim1name - logical , intent(in) :: use_glob ! if .true., use the 'glob' form of ncd_io - - if (use_glob) then - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data) - else - call ncd_io(ncid=ncid, varname=varname, flag='read', data=data, dim1name=dim1name) - end if - end subroutine read_var_int - - end subroutine set_subgrid_info - - !======================================================================= - - subroutine interp_0d_copy (varname, varname_i, xtype, ncidi, ncido) - - ! -------------------------------------------------------------------- - ! arguments - character(len=*) , intent(inout) :: varname ! variable name on output file - character(len=*) , intent(in) :: varname_i ! variable name on input file - integer , intent(in) :: xtype - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - ! - ! local variables - integer :: ivalue - real(r8):: rvalue - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Copying : ',trim(varname_i), ' => ', trim(varname) - end if - - if (xtype == pio_int) then - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read' , data=ivalue) - call ncd_io(ncid=ncido, varname=trim(varname), flag='write', data=ivalue) - else if (xtype == pio_double) then - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read' , data=rvalue) - call ncd_io(ncid=ncido, varname=trim(varname), flag='write', data=rvalue) - else - if (masterproc) then - write(iulog,*)'ERROR interpinic: unhandled case for var ',trim(varname),' stopping' - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine interp_0d_copy - - !======================================================================= - - subroutine interp_1d_double (varname, varname_i, dimname, begi, endi, bego, endo, ncidi, ncido, & - sgridindex) - - ! ------------------------ arguments --------------------------------- - character(len=*) , intent(inout) :: varname ! variable name on output file - character(len=*) , intent(in) :: varname_i ! variable name on input file - character(len=*) , intent(inout) :: dimname - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - integer , intent(in) :: sgridindex(bego:endo) - ! -------------------------------------------------------------------- - - ! ------------------------ local variables -------------------------- - real(r8), pointer :: rbufsli(:) ! input array - real(r8), pointer :: rbufslo(:) ! output array - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Interpolating: ',trim(varname_i), ' => ', trim(varname) - end if - - allocate (rbufsli(begi:endi), rbufslo(bego:endo)) - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read', data=rbufsli) - call ncd_io(ncid=ncido, varname=trim(varname), flag='read', data=rbufslo, & - dim1name=dimname) - - call interp_1d_data(begi=begi, endi=endi, bego=bego, endo=endo, & - sgridindex=sgridindex, keep_existing=.true., & - data_in=rbufsli, data_out=rbufslo) - - call ncd_io(ncid=ncido, varname=trim(varname), flag='write', data=rbufslo, & - dim1name=dimname) - - deallocate(rbufsli, rbufslo) - - end subroutine interp_1d_double - - !======================================================================= - - subroutine interp_1d_int (varname, varname_i, dimname, begi, endi, bego, endo, ncidi, ncido, & - sgridindex) - - ! ------------------------ arguments --------------------------------- - character(len=*) , intent(inout) :: varname ! variable name on output file - character(len=*) , intent(in) :: varname_i ! variable name on input file - character(len=*) , intent(inout) :: dimname - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - integer , intent(in) :: sgridindex(bego:endo) - ! -------------------------------------------------------------------- - - ! ------------------------ local variables -------------------------- - integer , pointer :: ibufsli(:) !input array - integer , pointer :: ibufslo(:) !output array - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Interpolating: ',trim(varname_i), ' => ', trim(varname) - end if - - allocate (ibufsli(begi:endi), ibufslo(bego:endo)) - - call ncd_io(ncid=ncidi, varname=trim(varname_i), flag='read', & - data=ibufsli) - call ncd_io(ncid=ncido, varname=trim(varname), flag='read', & - data=ibufslo, dim1name=dimname) - - call interp_1d_data(begi=begi, endi=endi, bego=bego, endo=endo, & - sgridindex=sgridindex, keep_existing=.true., & - data_in=ibufsli, data_out=ibufslo) - - call ncd_io(ncid=ncido, varname=trim(varname), flag='write', & - data=ibufslo, dim1name=dimname) - - deallocate (ibufsli, ibufslo) - - end subroutine interp_1d_int - - !======================================================================= - - subroutine interp_2d_double (var2di, var2do, & - begi, endi, bego, endo, sgridindex, & - interp_multilevel_container) - - ! -------------------------------------------------------------------- - ! arguments - class(interp_2dvar_type), intent(inout) :: var2di ! variable on input file - class(interp_2dvar_type), intent(inout) :: var2do ! variable on output file - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - integer , intent(in) :: sgridindex(bego:) - type(interp_multilevel_container_type), intent(in) :: interp_multilevel_container - ! - ! local variables - class(interp_multilevel_type), pointer :: multilevel_interpolator - integer :: no ! index - integer :: level ! level index - integer :: nlevi ! number of input levels - real(r8), pointer :: rbuf2do(:,:) ! output array - real(r8), pointer :: rbuf1di(:) ! one level of input array - real(r8), pointer :: rbuf2do_levelsi(:,:) ! array on output horiz grid, but input levels - ! -------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(sgridindex) == (/endo/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT(var2di%get_vec_beg() == begi, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(var2di%get_vec_end() == endi, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(var2do%get_vec_beg() == bego, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(var2do%get_vec_end() == endo, errMsg(sourcefile, __LINE__)) - - multilevel_interpolator => interp_multilevel_container%find_interpolator( & - lev_dimname = var2do%get_lev_dimname(), & - vec_dimname = var2do%get_vec_dimname()) - - if (masterproc) then - write(iulog,*) 'Interpolating: ', & - trim(var2di%get_varname()), ' => ', & - trim(var2do%get_varname()), ': ', & - multilevel_interpolator%get_description() - end if - - call multilevel_interpolator%check_npts( & - npts = var2do%get_vec_npts(), & - varname = var2do%get_varname()) - - ! First do a horizontal interpolation. We need to separate the horizontal and vertical - ! interpolation steps to avoid storing all levels of the source grid in memory at - ! once: that is problematic in terms of memory requirements since the full source grid - ! is stored in memory on every processor (in contrast to the destination grid, which - ! is decomposed across processors). - nlevi = var2di%get_nlev() - allocate(rbuf2do_levelsi(bego:endo, nlevi)) - allocate(rbuf1di(begi:endi)) - do level = 1, nlevi - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READLEVEL"'. So we - ! explicitly call the specific routine, rather than calling readlevel. - call var2di%readlevel_double(rbuf1di, level) - call interp_1d_data(begi=begi, endi=endi, bego=bego, endo=endo, & - sgridindex=sgridindex, keep_existing=.false., & - data_in=rbuf1di, data_out=rbuf2do_levelsi(:,level)) - end do - deallocate(rbuf1di) - - ! Now do the vertical interpolation - - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READVAR"'. So we - ! explicitly call the specific routine, rather than calling readvar. - call var2do%readvar_double(rbuf2do) - do no = bego,endo - ! Only do the interpolation for output points that have a corresponding input - ! point. Other output points will remain at their original value. - if (sgridindex(no) > 0) then - call multilevel_interpolator%interp_multilevel( & - data_dest = rbuf2do(no,:), & - data_source = rbuf2do_levelsi(no,:), & - index_dest = no - bego + 1) - end if - end do - - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "WRITEVAR"'. So we - ! explicitly call the specific routine, rather than calling writevar. - call var2do%writevar_double(rbuf2do) - - deallocate(rbuf2do, rbuf2do_levelsi) - - end subroutine interp_2d_double - - !======================================================================= - - subroutine check_dim_subgrid(ncidi, ncido, dimname, dimleni, dimleno) - - ! -------------------------------------------------------------------- - ! arguments - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - character(len=*) , intent(in) :: dimname - integer , intent(out) :: dimleni - integer , intent(out) :: dimleno - ! - ! local variables - integer :: status - integer :: dimid - ! -------------------------------------------------------------------- - - status = pio_inq_dimid (ncidi, dimname, dimid) - status = pio_inq_dimlen(ncidi, dimid , dimleni) - status = pio_inq_dimid (ncido, dimname, dimid) - status = pio_inq_dimlen(ncido, dimid , dimleno) - - end subroutine check_dim_subgrid - - !======================================================================= - - subroutine check_dim_level(ncidi, ncido, dimname, must_be_same) - ! Checks whether dimension size is the same for input and output. If 'must_be_same' - ! is true, aborts if they disagree; otherwise, simply prints an informative message. - - ! -------------------------------------------------------------------- - ! arguments - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - character(len=*) , intent(in) :: dimname - logical , intent(in) :: must_be_same - ! - ! local variables - integer :: status - integer :: dimid - integer :: dimleni, dimleno - ! -------------------------------------------------------------------- - - status = pio_inq_dimid (ncidi, dimname, dimid) - status = pio_inq_dimlen(ncidi, dimid , dimleni) - status = pio_inq_dimid (ncido, dimname, dimid) - status = pio_inq_dimlen(ncido, dimid , dimleno) - - if (dimleni /= dimleno) then - if (must_be_same) then - write (iulog,*) 'ERROR interpinic: input and output ',trim(dimname),' values disagree' - write (iulog,*) 'input dimlen = ',dimleni,' output dimlen = ',dimleno - call endrun(msg=errMsg(sourcefile, __LINE__)) - else - if (masterproc) then - write (iulog,*) 'input and output ',trim(dimname),' values disagree' - write (iulog,*) 'input nlevgrnd = ',dimleni,' output nlevgrnd = ',dimleno - write (iulog,*) 'This is okay: vertical levels will be interpolated' - end if - end if - end if - - end subroutine check_dim_level - - !----------------------------------------------------------------------- - subroutine limit_snlsno(ncido, bounds_o) - ! - ! !DESCRIPTION: - ! Apply a limit to SNLSNO in the output file so that it doesn't exceed the number of - ! snow layers. - ! - ! This is needed if the output file has fewer snow layers than the input file. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(file_desc_t) , intent(inout) :: ncido - type(interp_bounds_type), intent(in) :: bounds_o - ! - ! !LOCAL VARIABLES: - character(len=16) :: vec_dimname - integer :: bego, endo - integer, pointer :: snlsno(:) - integer :: snlsno_dids(1) ! dimension ID - integer :: levsno_dimid - integer :: levsno - integer :: i - integer :: err_code - - character(len=*), parameter :: levsno_dimname = 'levsno' - character(len=*), parameter :: snlsno_varname = 'SNLSNO' - - character(len=*), parameter :: subname = 'limit_snlsno' - !----------------------------------------------------------------------- - - ! Determine levsno size - call ncd_inqdlen(ncid=ncido, dimid=levsno_dimid, len=levsno, name=levsno_dimname) - - ! Read SNLSNO - ! - ! TODO(wjs, 2015-11-01) This is a lot of code for simply reading in a 1-d variable. - ! It would be nice if there was a routine that did all of this for you, similarly to - ! what initInterp2dvar does for 2-d variables. - call ncd_inqvdname(ncid=ncido, varname=snlsno_varname, dimnum=1, dname=vec_dimname, & - err_code=err_code) - if (err_code /= 0) then - call endrun(subname//' ERROR getting vec_dimname') - end if - bego = bounds_o%get_beg(vec_dimname) - endo = bounds_o%get_end(vec_dimname) - allocate(snlsno(bego:endo)) - call ncd_io(ncid=ncido, varname=snlsno_varname, flag='read', data=snlsno, & - dim1name=trim(vec_dimname)) - - ! Limit SNLSNO - do i = bego, endo - ! Note that snlsno is negative - snlsno(i) = max(snlsno(i), -1*levsno) - end do - - ! Write out limited SNLSNO - call ncd_io(ncid=ncido, varname=snlsno_varname, flag='write', data=snlsno, & - dim1name=trim(vec_dimname)) - deallocate(snlsno) - end subroutine limit_snlsno - -end module initInterpMod diff --git a/src/init_interp/initInterp1dData.F90 b/src/init_interp/initInterp1dData.F90 deleted file mode 100644 index 7455ddd01f..0000000000 --- a/src/init_interp/initInterp1dData.F90 +++ /dev/null @@ -1,126 +0,0 @@ -module initInterp1dData - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module contains routines for interpolating 1-d data fields. These routines do - ! not do any i/o. - ! ------------------------------------------------------------------------ - -#include "shr_assert.h" - use shr_log_mod , only: errMsg => shr_log_errMsg - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_infnan_mod , only: shr_infnan_isnan - use clm_varcon , only: spval, ispval - - implicit none - private - save - - ! Public methods - - public :: interp_1d_data - interface interp_1d_data - module procedure interp_1d_data_double - module procedure interp_1d_data_int - end interface interp_1d_data - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine interp_1d_data_double(begi, endi, bego, endo, sgridindex, keep_existing, & - data_in, data_out) - ! - ! !DESCRIPTION: - ! Interpolate a 1-d double field. - ! - ! If keep_existing = .true., then points with sgridindex <= 0 are kept at their - ! original value; if .false., they are set to spval. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer , intent(in) :: begi ! beginning index for input array - integer , intent(in) :: endi ! ending index for input array - integer , intent(in) :: bego ! beginning index for output array - integer , intent(in) :: endo ! ending index for output array - integer , intent(in) :: sgridindex(bego:) ! input index mapping to each outputpoint - logical , intent(in) :: keep_existing ! whether to keep existing values for points with sgridindex <= 0 - real(r8) , intent(in) :: data_in(begi:) ! input data - real(r8) , intent(inout) :: data_out(bego:) ! output data - ! - ! !LOCAL VARIABLES: - integer :: no,ni ! indices - - character(len=*), parameter :: subname = 'interp_1d_data_double' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(sgridindex) == (/endo/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data_in) == (/endi/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data_out) == (/endo/)), errMsg(sourcefile, __LINE__)) - - if (.not. keep_existing) then - data_out(bego:endo) = spval - end if - - do no = bego,endo - ni = sgridindex(no) - if (ni > 0) then - if ( shr_infnan_isnan(data_in(ni)) ) then - data_out(no) = spval - else - data_out(no) = data_in(ni) - end if - end if - end do - - end subroutine interp_1d_data_double - - !----------------------------------------------------------------------- - subroutine interp_1d_data_int(begi, endi, bego, endo, sgridindex, keep_existing, & - data_in, data_out) - ! - ! !DESCRIPTION: - ! Interpolate a 1-d int field - ! - ! If keep_existing = .true., then points with sgridindex <= 0 are kept at their - ! original value; if .false., they are set to ispval. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer , intent(in) :: begi ! beginning index for input array - integer , intent(in) :: endi ! ending index for input array - integer , intent(in) :: bego ! beginning index for output array - integer , intent(in) :: endo ! ending index for output array - integer , intent(in) :: sgridindex(bego:) ! input index mapping to each outputpoint - logical , intent(in) :: keep_existing ! whether to keep existing values for points with sgridindex <= 0 - integer , intent(in) :: data_in(begi:) ! input data - integer , intent(inout) :: data_out(bego:) ! output data - ! - ! !LOCAL VARIABLES: - integer :: no,ni !indices - - character(len=*), parameter :: subname = 'interp_1d_data_int' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(sgridindex) == (/endo/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data_in) == (/endi/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data_out) == (/endo/)), errMsg(sourcefile, __LINE__)) - - if (.not. keep_existing) then - data_out(bego:endo) = ispval - end if - - do no = bego,endo - ni = sgridindex(no) - if (ni > 0) then - data_out(no) = data_in(ni) - end if - end do - - end subroutine interp_1d_data_int - -end module initInterp1dData diff --git a/src/init_interp/initInterp2dvar.F90.in b/src/init_interp/initInterp2dvar.F90.in deleted file mode 100644 index f6e13375f8..0000000000 --- a/src/init_interp/initInterp2dvar.F90.in +++ /dev/null @@ -1,383 +0,0 @@ -module initInterp2dvar - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class that holds information about a 2-d variable, to - ! facilitate reading & writing - ! - ! !USES: -#include "shr_assert.h" - use abortutils , only: endrun - use shr_log_mod , only: errMsg => shr_log_errMsg - use shr_kind_mod , only: r8 => shr_kind_r8, i4=>shr_kind_i4 - use clm_varctl , only: iulog - use ncdio_pio , only: file_desc_t, var_desc_t, ncd_inqvid, ncd_inqvdids - use ncdio_pio , only: ncd_inqdlen, ncd_inqdname, ncd_io, ncd_getatt - use pio , only: pio_inq_varid, pio_get_var - - implicit none - private - save - - ! Public types - - public :: interp_2dvar_type - - type :: interp_2dvar_type - private - character(len=:), allocatable :: varname ! variable name - type(var_desc_t) :: vardesc ! variable descriptor on file - integer :: varid ! variable ID on file - type(file_desc_t), pointer :: ncid ! pointer to netcdf ID corresponding to this variable - logical :: file_is_dest ! true if this is on the dest file, false if on the source file - character(len=16) :: vec_dimname ! dimension name of vector dimension (e.g., 'col') - character(len=16) :: lev_dimname ! dimension name of level dimension - integer :: vec_beg ! beginning index of vector dimension - integer :: vec_end ! ending index of vector dimension - integer :: nlev ! size of level dimension - logical :: switchdim ! true if dimensions are 'switched' for this variable - contains - ! Public routines - generic :: readvar => readvar_int, readvar_double - !TYPE int,double - procedure :: readvar_{TYPE} - - generic :: writevar => writevar_int, writevar_double - !TYPE int,double - procedure :: writevar_{TYPE} - - generic :: readlevel => readlevel_int, readlevel_double ! read one level - !TYPE int,double - procedure :: readlevel_{TYPE} - - procedure :: get_varname ! get variable name - procedure :: get_vec_dimname ! get dimension name of vector dimension (e.g., 'col') - procedure :: get_lev_dimname ! get dimension name of level dimension - procedure :: get_vec_beg ! get beginning index of vector dimension - procedure :: get_vec_end ! get ending index of vector dimension - procedure :: get_vec_npts ! get number of points in vector dimension - procedure :: get_nlev ! get number of levels - - ! Private routines - procedure, private :: set_switchdim - end type interp_2dvar_type - - interface interp_2dvar_type - module procedure constructor - end interface interp_2dvar_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(varname, ncid, file_is_dest, bounds) & - result(this) - ! - ! !DESCRIPTION: - ! Creates an interp_2dvar_type object - ! - ! !USES: - use initInterpBounds, only : interp_bounds_type - ! - ! !ARGUMENTS: - type(interp_2dvar_type) :: this ! function result - character(len=*) , intent(in) :: varname ! variable name - type(file_desc_t) , target, intent(inout) :: ncid ! netcdf id - logical , intent(in) :: file_is_dest ! true if this is the dest file, false if the source file - type(interp_bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: vec_dimnum ! dimension number of the vector dimension (e.g., 'col') - integer :: lev_dimnum ! dimension number of the level dimension - integer :: dimids(2) ! dimension IDs - - character(len=*), parameter :: subname = 'interp_2dvar_type constructor' - !----------------------------------------------------------------------- - - this%varname = varname - this%ncid => ncid - this%file_is_dest = file_is_dest - - call ncd_inqvid(this%ncid, trim(varname), this%varid, this%vardesc) - call this%set_switchdim() - - ! ------------------------------------------------------------------------ - ! Get information related to dimensions - ! ------------------------------------------------------------------------ - - if (this%switchdim) then - lev_dimnum = 1 - vec_dimnum = 2 - else - lev_dimnum = 2 - vec_dimnum = 1 - end if - - call ncd_inqvdids(this%ncid, dimids, this%vardesc) - - ! Get size of level dimension - call ncd_inqdlen(this%ncid, dimids(lev_dimnum), this%nlev) - - ! Get name of level dimension - call ncd_inqdname(this%ncid, dimids(lev_dimnum), this%lev_dimname) - - ! Get name of vector dimension - call ncd_inqdname(this%ncid, dimids(vec_dimnum), this%vec_dimname) - - this%vec_beg = bounds%get_beg(this%vec_dimname) - this%vec_end = bounds%get_end(this%vec_dimname) - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - !TYPE int,double - subroutine readvar_{TYPE}(this, data) - ! - ! !DESCRIPTION: - ! Reads variable from file. - ! - ! The 'data' variable is allocated here, and must be deallocated by the caller. - ! - ! !USES: - ! - ! !ARGUMENTS: - ! 'this' is intent(inout) for the sake of ncid - class(interp_2dvar_type), intent(inout) :: this - {VTYPE}, pointer, intent(out) :: data(:,:) ! [vec, lev] - ! - ! !LOCAL VARIABLES: - {VTYPE}, pointer :: data_transpose(:,:) ! transpose of data array if switchdim is true - - character(len=*), parameter :: subname = 'readvar' - !----------------------------------------------------------------------- - - if (.not. this%file_is_dest) then - ! NOTE(wjs, 2015-11-22) The code is set up to be able to read properly from the - ! source file, and this has been tested. However, for relatively high resolution - ! source files (f09 or higher, and/or higher-than-standard number of vertical - ! levels) it can cause out-of-memory problems on yellowstone that bring the whole - ! system to a temporary stand-still. So, to be safe, we currently abort if this is - ! attempted. - write(iulog,*) subname//' ERROR: Attempt to read all levels at once from source file.' - write(iulog,*) 'Although this is possible in theory, it is generally a bad idea' - write(iulog,*) 'because it can result in extreme memory usage.' - write(iulog,*) 'In some cases, this can cause system hangs that affect all users.' - write(iulog,*) 'If you want to try anyway, you can remove this endrun call.' - call endrun(msg='Attempt to read all levels at once from source file '// & - errMsg(sourcefile, __LINE__)) - end if - - allocate(data(this%vec_beg:this%vec_end, this%nlev)) - - ! The destination file uses the model's decomposition, whereas the source file does - ! not. Thus, we need to handle the reads differently. - if (this%file_is_dest) then - call ncd_io(ncid=this%ncid, varname=trim(this%varname), flag='read', data=data, & - dim1name=trim(this%vec_dimname), switchdim=this%switchdim) - else - if (this%switchdim) then - allocate(data_transpose(this%nlev, this%vec_beg:this%vec_end)) - call ncd_io(ncid=this%ncid, varname=trim(this%varname), flag='read', & - data=data_transpose) - data = transpose(data_transpose) - deallocate(data_transpose) - else - call ncd_io(ncid=this%ncid, varname=trim(this%varname), flag='read', & - data=data) - end if - end if - - end subroutine readvar_{TYPE} - - !----------------------------------------------------------------------- - !TYPE int,double - subroutine writevar_{TYPE}(this, data) - ! - ! !DESCRIPTION: - ! Writes variable to file. - ! - ! Currently only works for the destination file, not the source file. - ! - ! !USES: - ! - ! !ARGUMENTS: - ! 'this' is intent(inout) for the sake of ncid - class(interp_2dvar_type), intent(inout) :: this - {VTYPE}, pointer, intent(in) :: data(:,:) ! [vec, lev] - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'writevar' - !----------------------------------------------------------------------- - - if (this%file_is_dest) then - call ncd_io(ncid=this%ncid, varname=trim(this%varname), flag='write', data=data, & - dim1name=trim(this%vec_dimname), switchdim=this%switchdim) - else - ! NOTE(wjs, 2015-10-13) In principle, we could probably handle writes to the - ! source file the same way as we handle reads. But since this is untested, I'm - ! currently aborting in this case. - call endrun(msg='ERROR: unhandled attempt to write variable to source file '// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine writevar_{TYPE} - - !----------------------------------------------------------------------- - !TYPE int,double - subroutine readlevel_{TYPE}(this, data, level) - ! - ! !DESCRIPTION: - ! Reads one level of variable from file. - ! - ! In contrast to readvar, this routine does NOT allocate the data: it expects data to - ! already be allocated of the correct size. (This is to avoid requiring repeated - ! allocations and deallocations when reading one level at a time.) - ! - ! !USES: - ! - ! !ARGUMENTS: - ! 'this' is intent(inout) for the sake of ncid - class(interp_2dvar_type), intent(inout) :: this - {VTYPE}, pointer :: data(:) - integer, intent(in) :: level ! level index to read - ! - ! !LOCAL VARIABLES: - integer :: status ! netCDF return code - type(Var_desc_t) :: vardesc ! pio variable descriptor - integer :: starts(2) - integer :: counts(2) - - character(len=*), parameter :: subname = 'readlevel' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((lbound(data) == (/this%vec_beg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(data) == (/this%vec_end/)), errMsg(sourcefile, __LINE__)) - - if (this%file_is_dest) then - ! NOTE(wjs, 2015-11-22) As far as I can tell, ncdio_pio currently doesn't provide - ! a robust mechanism for reading in a single level. Since we don't actually need - ! this functionality right now, I am aborting rather than trying to either (a) add - ! the functionality to ncdio_pio, or (b) handle it here with direct calls to pio. - call endrun(msg='ERROR: unhandled attempt to read one level from dest file '//& - errMsg(sourcefile, __LINE__)) - else - ! TODO(wjs, 2015-11-22) I don't like that we're making direct pio calls here. - ! Ideally we'd go through ncdio_pio, but currently that module doesn't provide the - ! necessary functionality. - status = pio_inq_varid(this%ncid, trim(this%varname), vardesc) - if (this%switchdim) then - starts(1) = level - counts(1) = 1 - starts(2) = 1 - counts(2) = this%get_vec_npts() - else - starts(1) = 1 - counts(1) = this%get_vec_npts() - starts(2) = level - counts(2) = 1 - end if - status = pio_get_var(this%ncid, vardesc, starts, counts, data) - end if - - end subroutine readlevel_{TYPE} - - function get_varname(this) result(varname) - ! Get variable name - character(len=:), allocatable :: varname ! function result - class(interp_2dvar_type), intent(in) :: this - - varname = this%varname - end function get_varname - - function get_vec_dimname(this) result(vec_dimname) - ! Get name of vector dimension (e.g., 'col') - character(len=:), allocatable :: vec_dimname ! function result - class(interp_2dvar_type), intent(in) :: this - - vec_dimname = this%vec_dimname - end function get_vec_dimname - - function get_lev_dimname(this) result(lev_dimname) - ! Get name of level dimension - character(len=:), allocatable :: lev_dimname ! function result - class(interp_2dvar_type), intent(in) :: this - - lev_dimname = this%lev_dimname - end function get_lev_dimname - - integer function get_vec_beg(this) - ! Get beginning index of vector dimension - class(interp_2dvar_type), intent(in) :: this - - get_vec_beg = this%vec_beg - end function get_vec_beg - - integer function get_vec_end(this) - ! Get ending index of vector dimension - class(interp_2dvar_type), intent(in) :: this - - get_vec_end = this%vec_end - end function get_vec_end - - integer function get_vec_npts(this) - ! Get number of points in vector dimension - class(interp_2dvar_type), intent(in) :: this - - get_vec_npts = (this%vec_end - this%vec_beg + 1) - end function get_vec_npts - - integer function get_nlev(this) - ! Get number of levels - class(interp_2dvar_type), intent(in) :: this - - get_nlev = this%nlev - end function get_nlev - - ! ======================================================================== - ! Private methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine set_switchdim(this) - ! - ! !DESCRIPTION: - ! Sets the switchdim attribute by reading the appropriate metadata from the file - ! - ! !USES: - use restUtilMod , only: iflag_noswitchdim, iflag_switchdim - ! - ! !ARGUMENTS: - class(interp_2dvar_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - integer :: switchdim_flag - - character(len=*), parameter :: subname = 'set_switchdim' - !----------------------------------------------------------------------- - - call ncd_getatt(this%ncid, this%varid, 'switchdim_flag', switchdim_flag) - select case (switchdim_flag) - case (iflag_switchdim) - this%switchdim = .true. - case (iflag_noswitchdim) - this%switchdim = .false. - case default - write(iulog,*) subname//' ERROR: unknown switchdim_flag: ', switchdim_flag - call endrun('ERROR: unknown switchdim flag '//errMsg(sourcefile, __LINE__)) - end select - - end subroutine set_switchdim - - -end module initInterp2dvar diff --git a/src/init_interp/initInterpBounds.F90 b/src/init_interp/initInterpBounds.F90 deleted file mode 100644 index ff3704e462..0000000000 --- a/src/init_interp/initInterpBounds.F90 +++ /dev/null @@ -1,198 +0,0 @@ -module initInterpBounds - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class for storing and querying bounds information for initInterp - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - - implicit none - private - save - - ! Public types - - public :: interp_bounds_type - - type :: interp_bounds_type - private - integer :: begp ! beginning patch-level index - integer :: endp ! ending patch-level index - integer :: begc ! beginning col-level index - integer :: endc ! ending col-level index - integer :: begl ! beginning landunit-level index - integer :: endl ! ending landunit-level index - integer :: begg ! beginning gridcell-level index - integer :: endg ! ending gridcell-level index - contains - procedure :: get_begp - procedure :: get_endp - procedure :: get_begc - procedure :: get_endc - procedure :: get_begl - procedure :: get_endl - procedure :: get_begg - procedure :: get_endg - procedure :: get_beg ! get beginning index for a given subgrid level - procedure :: get_end ! get ending index for a given subgrid level - end type interp_bounds_type - - interface interp_bounds_type - module procedure constructor - end interface interp_bounds_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(begp, endp, begc, endc, begl, endl, begg, endg) result(this) - ! - ! !DESCRIPTION: - ! Create an interp_bounds_type instance - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_bounds_type) :: this ! function result - integer, intent(in) :: begp, endp - integer, intent(in) :: begc, endc - integer, intent(in) :: begl, endl - integer, intent(in) :: begg, endg - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - this%begp = begp - this%endp = endp - this%begc = begc - this%endc = endc - this%begl = begl - this%endl = endl - this%begg = begg - this%endg = endg - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - integer function get_begp(this) - class(interp_bounds_type), intent(in) :: this - get_begp = this%begp - end function get_begp - - integer function get_endp(this) - class(interp_bounds_type), intent(in) :: this - get_endp = this%endp - end function get_endp - - integer function get_begc(this) - class(interp_bounds_type), intent(in) :: this - get_begc = this%begc - end function get_begc - - integer function get_endc(this) - class(interp_bounds_type), intent(in) :: this - get_endc = this%endc - end function get_endc - - integer function get_begl(this) - class(interp_bounds_type), intent(in) :: this - get_begl = this%begl - end function get_begl - - integer function get_endl(this) - class(interp_bounds_type), intent(in) :: this - get_endl = this%endl - end function get_endl - - integer function get_begg(this) - class(interp_bounds_type), intent(in) :: this - get_begg = this%begg - end function get_begg - - integer function get_endg(this) - class(interp_bounds_type), intent(in) :: this - get_endg = this%endg - end function get_endg - - !----------------------------------------------------------------------- - function get_beg(this, subgrid_level) result(beg_index) - ! - ! !DESCRIPTION: - ! Get beginning index for a given subgrid level - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: beg_index ! function result - class(interp_bounds_type), intent(in) :: this - character(len=*), intent(in) :: subgrid_level ! 'pft', 'column', 'landunit' or 'gridcell' - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_beg' - !----------------------------------------------------------------------- - - select case (subgrid_level) - case('pft') - beg_index = this%begp - case('column') - beg_index = this%begc - case('landunit') - beg_index = this%begl - case('gridcell') - beg_index = this%begg - case default - call endrun(msg=subname//' ERROR: Unknown subgrid level: '//trim(subgrid_level)// & - errMsg(sourcefile, __LINE__)) - end select - - end function get_beg - - !----------------------------------------------------------------------- - function get_end(this, subgrid_level) result(end_index) - ! - ! !DESCRIPTION: - ! Get ending index for a given subgrid level - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: end_index ! function result - class(interp_bounds_type), intent(in) :: this - character(len=*), intent(in) :: subgrid_level ! 'pft', 'column', 'landunit' or 'gridcell' - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_end' - !----------------------------------------------------------------------- - - select case (subgrid_level) - case('pft') - end_index = this%endp - case('column') - end_index = this%endc - case('landunit') - end_index = this%endl - case('gridcell') - end_index = this%endg - case default - call endrun(msg=subname//' ERROR: Unknown subgrid level: '//trim(subgrid_level)// & - errMsg(sourcefile, __LINE__)) - end select - - end function get_end - -end module initInterpBounds diff --git a/src/init_interp/initInterpMindist.F90 b/src/init_interp/initInterpMindist.F90 deleted file mode 100644 index 4f4dba1194..0000000000 --- a/src/init_interp/initInterpMindist.F90 +++ /dev/null @@ -1,699 +0,0 @@ -module initInterpMindist - - ! ------------------------------------------------------------------------ - ! This module contains most of the "interesting" logic of initInterp, in terms of - ! finding the input column (or landunit, patch, etc.) to use as a template for each - ! output column (etc.). - ! - ! This is in a separate module to facilitate unit testing, since the full initInterp - ! involves some awkward dependencies. - ! ------------------------------------------------------------------------ - -#include "shr_assert.h" - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only: iulog - use abortutils , only: endrun - use spmdMod , only: masterproc - use clm_varcon , only: spval, re - use glcBehaviorMod , only: glc_behavior_type - - implicit none - private - save - - ! Public methods - - public :: set_mindist - public :: set_single_match - - ! Public types - - type, public :: subgrid_special_indices_type - integer :: ipft_not_vegetated - integer :: icol_vegetated_or_bare_soil - integer :: ilun_vegetated_or_bare_soil - integer :: ilun_crop - integer :: ilun_landice_multiple_elevation_classes - contains - procedure :: is_vegetated_landunit ! returns true if the given landunit type is natural veg or crop - end type subgrid_special_indices_type - - type, public :: subgrid_type - character(len=16) :: name ! pft, column, landunit, gridcell - integer , pointer :: ptype(:) => null() ! used for patch type - integer , pointer :: ctype(:) => null() ! used for patch or col type - integer , pointer :: ltype(:) => null() ! used for pft, col or lun type - real(r8), pointer :: topoglc(:) => null() - real(r8), pointer :: lat(:) - real(r8), pointer :: lon(:) - real(r8), pointer :: coslat(:) - contains - procedure :: print_point ! print info about one point - end type subgrid_type - - ! Private methods - - private :: set_glcmec_must_be_same_type - private :: set_icemec_adjustable_type - private :: do_fill_missing_with_natveg - private :: is_sametype - private :: is_baresoil - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine print_point(this, index, unit) - ! - ! !DESCRIPTION: - ! Print info about one point in a subgrid_type object - ! - ! !USES: - ! - ! !ARGUMENTS: - class(subgrid_type), intent(in) :: this - integer , intent(in) :: index - integer , intent(in) :: unit ! unit to which we should write the info - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'print_point' - !----------------------------------------------------------------------- - - write(unit,*) 'subgrid level, index = ',& - this%name, index - write(unit,*) 'lat, lon = ', this%lat(index), ', ', this%lon(index) - if (associated(this%ltype)) then - write(unit,*) 'ltype: ', this%ltype(index) - end if - if (associated(this%ctype)) then - write(unit,*) 'ctype: ', this%ctype(index) - end if - if (associated(this%ptype)) then - write(unit,*) 'ptype: ', this%ptype(index) - end if - - end subroutine print_point - - - !======================================================================= - - subroutine set_mindist(begi, endi, bego, endo, activei, activeo, subgridi, subgrido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - fill_missing_with_natveg, mindist_index) - - ! -------------------------------------------------------------------- - ! arguments - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - logical , intent(in) :: activei(begi:endi) - logical , intent(in) :: activeo(bego:endo) - type(subgrid_type) , intent(in) :: subgridi - type(subgrid_type) , intent(in) :: subgrido - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - type(glc_behavior_type), intent(in) :: glc_behavior - - ! True if the number and bounds of glacier elevation classes are the same in the - ! input and output; false otherwise. - logical , intent(in) :: glc_elevclasses_same - - ! If false: if an output type cannot be found in the input, code aborts - ! If true: if an output type cannot be found in the input, fill with closest natural - ! veg column (using bare soil for patch-level variables) - ! - ! NOTE: always treated as true for natural veg and crop landunits/columns/patches in - ! the output - e.g., if we can't find the right column type to fill crop, we always - ! use the closest natural veg column, regardless of the value of this flag. - logical , intent(in) :: fill_missing_with_natveg - - integer , intent(out) :: mindist_index(bego:endo) - ! - ! local variables - real(r8) :: dx,dy - real(r8) :: distmin,dist,hgtdiffmin,hgtdiff - integer :: nsizei, nsizeo - integer :: ni,no,nmin,ier,n,noloc - logical :: topoglc_present - logical :: closest - - ! Whether two glcmec columns/patches must be the same column/patch type to be - ! considered the same type. This is only valid for glcmec points, and is only valid - ! for subgrid name = 'pft' or 'column'. - logical :: glcmec_must_be_same_type_o(bego:endo) - ! -------------------------------------------------------------------- - - if (associated(subgridi%topoglc) .and. associated(subgrido%topoglc)) then - topoglc_present = .true. - else - topoglc_present = .false. - end if - - mindist_index(bego:endo) = 0 - distmin = spval - - call set_glcmec_must_be_same_type(bego=bego, endo=endo, dimname=subgrido%name, & - glc_elevclasses_same = glc_elevclasses_same, glc_behavior=glc_behavior, & - glcmec_must_be_same_type_o=glcmec_must_be_same_type_o) - -!$OMP PARALLEL DO PRIVATE (ni,no,n,nmin,distmin,dx,dy,dist,closest,hgtdiffmin,hgtdiff) - do no = bego,endo - - ! Only interpolate onto active points. Otherwise, the mere act of running - ! init_interp (e.g., of a file onto itself) would lead to changes in a bunch of - ! inactive points - e.g., going from their cold start initial conditions to some - ! spunup initial conditions (from the closest active point of that type). This - ! could potentially lead to different behavior in a transient run, if those points - ! later became active; that's undesirable. - if (activeo(no)) then - nmin = 0 - distmin = spval - hgtdiffmin = spval - do ni = begi,endi - if (activei(ni)) then - if (is_sametype(ni = ni, no = no, & - subgridi = subgridi, subgrido = subgrido, & - subgrid_special_indices = subgrid_special_indices, & - glcmec_must_be_same_type = glcmec_must_be_same_type_o(no), & - veg_patch_just_considers_ptype = .true.)) then - dy = abs(subgrido%lat(no)-subgridi%lat(ni))*re - dx = abs(subgrido%lon(no)-subgridi%lon(ni))*re * & - 0.5_r8*(subgrido%coslat(no)+subgridi%coslat(ni)) - dist = dx*dx + dy*dy - if (topoglc_present) then - hgtdiff = abs(subgridi%topoglc(ni) - subgrido%topoglc(no)) - end if - closest = .false. - if ( dist < distmin ) then - closest = .true. - distmin = dist - nmin = ni - if (topoglc_present) then - hgtdiffmin = hgtdiff - end if - end if - if (.not. closest) then - ! In *some* cases: For glc_mec points, we first find the closest - ! point in lat-lon space, without consideration for column or patch - ! type (above). Then, within that closest point, we find the closest - ! column in topographic space; this second piece is done here. Note - ! that this ordering means that we could choose a column with a very - ! different topographic height from the target column, if it is - ! closer in lat-lon space than any similar-height columns. - if (topoglc_present) then - hgtdiff = abs(subgridi%topoglc(ni) - subgrido%topoglc(no)) - if ((dist == distmin) .and. (hgtdiff < hgtdiffmin)) then - closest = .true. - hgtdiffmin = hgtdiff - distmin = dist - nmin = ni - end if - end if - end if - end if - end if - end do - - ! If output type is not contained in input dataset, then use closest bare soil, - ! if this point is one for which we fill missing with natveg. - if ( distmin == spval .and. & - do_fill_missing_with_natveg( & - fill_missing_with_natveg, no, subgrido, subgrid_special_indices)) then - do ni = begi, endi - if (activei(ni)) then - if ( is_baresoil(ni, subgridi, subgrid_special_indices)) then - dy = abs(subgrido%lat(no)-subgridi%lat(ni))*re - dx = abs(subgrido%lon(no)-subgridi%lon(ni))*re * & - 0.5_r8*(subgrido%coslat(no)+subgridi%coslat(ni)) - dist = dx*dx + dy*dy - if ( dist < distmin )then - distmin = dist - nmin = ni - end if - end if - end if - end do - end if - - ! Error conditions - if ( distmin == spval )then - write(iulog,*) 'ERROR initInterp set_mindist: & - &Cannot find any input points matching output point:' - call subgrido%print_point(no, iulog) - write(iulog,*) ' ' - write(iulog,*) 'Consider rerunning with the following in user_nl_clm:' - write(iulog,*) 'init_interp_fill_missing_with_natveg = .true.' - write(iulog,*) 'However, note that this will fill all missing types in the output' - write(iulog,*) 'with the closest natural veg column in the input' - write(iulog,*) '(using bare soil for patch-level variables).' - write(iulog,*) 'So, you should consider whether that is what you want.' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - mindist_index(no) = nmin - - end if ! end if activeo block - end do -!$OMP END PARALLEL DO - - end subroutine set_mindist - - !----------------------------------------------------------------------- - subroutine set_single_match(begi, endi, bego, endo, activeo, subgridi, subgrido, & - subgrid_special_indices, glc_behavior, glc_elevclasses_same, & - mindist_index) - ! - ! !DESCRIPTION: - ! This is an alternative to set_mindist that can work when there is a single matching - ! input point for each output point (or possibly 0 matching inputs for an inactive - ! output point). In this method, we only look for points that share the same lat/lon - ! as the output point. - ! - ! This method is intended to be used for the case where we want to copy areas from the - ! input file to the output file (rather than maintaining areas from the surface - ! dataset); some of the logic here is set up the way it is in order to support this - ! copying of areas. - ! - ! !ARGUMENTS: - integer , intent(in) :: begi, endi - integer , intent(in) :: bego, endo - logical , intent(in) :: activeo(bego:endo) - type(subgrid_type) , intent(in) :: subgridi - type(subgrid_type) , intent(in) :: subgrido - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - type(glc_behavior_type), intent(in) :: glc_behavior - - ! True if the number and bounds of glacier elevation classes are the same in the - ! input and output; false otherwise. - ! - ! Must be true for this method! (Otherwise we may not be able to find a single unique - ! input point for each output point.) - logical , intent(in) :: glc_elevclasses_same - - integer , intent(out) :: mindist_index(bego:endo) - ! - ! !LOCAL VARIABLES: - integer :: ni, no, ni_match - logical :: found - real(r8) :: dx, dy - logical :: ni_sametype - - ! Whether two glcmec columns/patches must be the same column/patch type to be - ! considered the same type. This is only valid for glcmec points, and is only valid - ! for subgrid name = 'pft' or 'column'. - logical :: glcmec_must_be_same_type_o(bego:endo) - - ! Tolerance in lat/lon for considering a point to be at the same location - real(r8) :: same_point_tol = 1.e-14_r8 - - character(len=*), parameter :: subname = 'set_single_match' - !----------------------------------------------------------------------- - - if (.not. glc_elevclasses_same) then - write(iulog,*) subname// & - ' ERROR: For this init_interp method, the number and bounds of' - write(iulog,*) 'glacier elevation classes must be the same in input and output' - call endrun(msg=subname//' ERROR: glc_elevclasses_same must be true for this method') - end if - - call set_glcmec_must_be_same_type(bego=bego, endo=endo, dimname=subgrido%name, & - glc_elevclasses_same = glc_elevclasses_same, glc_behavior=glc_behavior, & - glcmec_must_be_same_type_o=glcmec_must_be_same_type_o) - -!$OMP PARALLEL DO PRIVATE (ni,no,ni_match,found,dx,dy,ni_sametype) - do no = bego, endo - ni_match = 0 - found = .false. - do ni = begi, endi - dx = abs(subgrido%lon(no)-subgridi%lon(ni)) - dy = abs(subgrido%lat(no)-subgridi%lat(ni)) - if (dx < same_point_tol .and. dy < same_point_tol) then - ni_sametype = is_sametype(ni = ni, no = no, & - subgridi = subgridi, subgrido = subgrido, & - subgrid_special_indices = subgrid_special_indices, & - glcmec_must_be_same_type = glcmec_must_be_same_type_o(no), & - veg_patch_just_considers_ptype = .false.) - if (ni_sametype) then - if (found) then - write(iulog,*) subname// & - ' ERROR: found multiple input points matching output point' - call subgrido%print_point(no, iulog) - write(iulog,*) ' ' - write(iulog,*) 'For this init_interp_method: for a given output point,' - write(iulog,*) 'we expect to find exactly one input point at the same' - write(iulog,*) 'location with the same type.' - write(iulog,*) '(This most likely indicates a problem in CTSM, such as' - write(iulog,*) 'having multiple columns with the same column type on a' - write(iulog,*) 'given gridcell.)' - call endrun(msg=subname// & - ' ERROR: found multiple input points matching output point') - else - found = .true. - ni_match = ni - end if - end if - end if - end do - - if (found) then - mindist_index(no) = ni_match - else - mindist_index(no) = 0 - - if (activeo(no)) then - write(iulog,*) subname// & - ' ERROR: cannot find any input points matching output point' - call subgrido%print_point(no, iulog) - write(iulog,*) ' ' - write(iulog,*) 'For this init_interp_method: for a given active output point,' - write(iulog,*) 'we expect to find exactly one input point at the same' - write(iulog,*) 'location with the same type.' - write(iulog,*) 'Note that this requires the input and output grids to be identical.' - write(iulog,*) '(If you need to interpolate to a different resolution, then' - write(iulog,*) 'you need to use a different init_interp_method.)' - call endrun(msg=subname//' ERROR: cannot find any input points matching output point') - end if - end if - end do -!$OMP END PARALLEL DO - - end subroutine set_single_match - - !----------------------------------------------------------------------- - subroutine set_glcmec_must_be_same_type(bego, endo, dimname, & - glc_elevclasses_same, glc_behavior, & - glcmec_must_be_same_type_o) - ! - ! !DESCRIPTION: - ! Sets the glcmec_must_be_same_type_o array for each output icemec point - ! - ! This array will be set to true for icemec output columns/patches for which the - ! column/patch type must match the input column/patch type to be considered the same - ! type. This is only valid for icemec points, and is only valid for dimname = 'pft' or - ! 'column' - for others, the value is undefined. - ! - ! This assumes that bego and endo match the bounds that are used elsewhere in the - ! model - i.e., for the decomposition within init_interp to match the model's - ! decomposition. - ! - ! !ARGUMENTS: - integer , intent(in) :: bego ! beginning index for output points - integer , intent(in) :: endo ! ending index for output points - character(len=*) , intent(in) :: dimname ! 'pft', 'column', etc. - - ! True if the number and bounds of glacier elevation classes are the same in the - ! input and output; false otherwise. - logical, intent(in) :: glc_elevclasses_same - - type(glc_behavior_type), intent(in) :: glc_behavior - - logical, intent(out) :: glcmec_must_be_same_type_o( bego: ) ! see description above - - ! - ! !LOCAL VARIABLES: - integer :: no - - ! Whether each output icemec point has adjustable column type; only valid for icemec - ! points, and only valid for subgrid name = pft or column - logical :: icemec_adjustable_type_o(bego:endo) - - character(len=*), parameter :: subname = 'set_glcmec_must_be_same_type' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(glcmec_must_be_same_type_o) == (/endo/)), errMsg(sourcefile, __LINE__)) - - if (.not. glc_elevclasses_same) then - ! If the number or bounds of the elevation classes differ between input and - ! output, then we ignore the column and patch types of glcmec points when - ! looking for the same type - instead using closest topographic height as a - ! tie-breaker between equidistant columns/patches. - glcmec_must_be_same_type_o(bego:endo) = .false. - else - call set_icemec_adjustable_type(bego=bego, endo=endo, dimname=dimname, & - glc_behavior=glc_behavior, icemec_adjustable_type_o=icemec_adjustable_type_o) - do no = bego, endo - if (icemec_adjustable_type_o(no)) then - ! If glcmec points in this output cell have adjustable type, then we ignore - ! the column and patch types of glcmec points when looking for the same - ! type: we want to find the closest glcmec point in lat-lon space without - ! regards for column/patch type, because the column/patch types may change - ! at runtime. - glcmec_must_be_same_type_o(no) = .false. - else - ! Otherwise, we require the column and patch types to be the same between - ! input and output for this glcmec output point, as is the case for most - ! other landunits. This is important for a case with interpolation to give - ! bit-for-bit answers with a case without interpolation (since glcmec - ! topographic heights can change after initialization, so we can't always - ! rely on the point with closest topographic height to be the "right" one to - ! pick as the source for interpolation). - glcmec_must_be_same_type_o(no) = .true. - end if - end do - end if - - end subroutine set_glcmec_must_be_same_type - - !----------------------------------------------------------------------- - subroutine set_icemec_adjustable_type(bego, endo, dimname, glc_behavior, & - icemec_adjustable_type_o) - ! - ! !DESCRIPTION: - ! Sets the icemec_adjustable_type_o array for each output icemec point - ! - ! This array will be set to true for icemec points that have adjustable column type - ! and false for icemec points that do not. The value will be undefined for non-icemec - ! points. - ! - ! This can only be called for the output, not the input! - ! - ! The output array is only valid for dimname = pft or column; for others, the output - ! values are undefined. - ! - ! This assumes that bego and endo match the bounds that are used elsewhere in the - ! model - i.e., for the decomposition within init_interp to match the model's - ! decomposition. - ! - ! !ARGUMENTS: - integer , intent(in) :: bego ! beginning index for output points - integer , intent(in) :: endo ! ending index for output points - character(len=*) , intent(in) :: dimname ! 'pft', 'column', etc. - type(glc_behavior_type) , intent(in) :: glc_behavior - logical , intent(out) :: icemec_adjustable_type_o( bego: ) ! see documentation above - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_icemec_adjustable_type' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(icemec_adjustable_type_o) == (/endo/)), errMsg(sourcefile, __LINE__)) - - select case (dimname) - case ('pft') - call glc_behavior%patches_have_dynamic_type_array(bego, endo, & - icemec_adjustable_type_o(bego:endo)) - case ('column') - call glc_behavior%cols_have_dynamic_type_array(bego, endo, & - icemec_adjustable_type_o(bego:endo)) - case ('landunit', 'gridcell') - ! Do nothing: icemec_adjustable_type_o will be left undefined - case default - call endrun(subname//' ERROR: unexpected dimname: '//trim(dimname)//& - errMsg(sourcefile, __LINE__)) - end select - - end subroutine set_icemec_adjustable_type - - !----------------------------------------------------------------------- - function do_fill_missing_with_natveg(fill_missing_with_natveg, & - no, subgrido, subgrid_special_indices) - ! - ! !DESCRIPTION: - ! Returns true if the given output point, if missing, should be filled with the - ! closest natural veg point. - ! - ! !ARGUMENTS: - logical :: do_fill_missing_with_natveg ! function result - - ! whether we should fill ALL missing points with natveg - logical, intent(in) :: fill_missing_with_natveg - - integer , intent(in) :: no - type(subgrid_type), intent(in) :: subgrido - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'do_fill_missing_with_natveg' - !----------------------------------------------------------------------- - - if (subgrido%name == 'gridcell') then - ! It makes no sense to try to fill missing with natveg for gridcell-level values - do_fill_missing_with_natveg = .false. - else if (fill_missing_with_natveg) then - ! User has asked for all missing points to be filled with natveg - do_fill_missing_with_natveg = .true. - else if (subgrid_special_indices%is_vegetated_landunit(subgrido%ltype(no))) then - ! Even if user hasn't asked for it, we fill missing vegetated points (natural veg - ! and crop) with the closest natveg point. This is mainly to support the common - ! use case of interpolating non-crop to crop, but also supports adding a new PFT - ! type. - do_fill_missing_with_natveg = .true. - else - do_fill_missing_with_natveg = .false. - end if - - end function do_fill_missing_with_natveg - - - !======================================================================= - - logical function is_sametype (ni, no, subgridi, subgrido, subgrid_special_indices, & - glcmec_must_be_same_type, veg_patch_just_considers_ptype) - - ! -------------------------------------------------------------------- - ! arguments - integer , intent(in) :: ni - integer , intent(in) :: no - type(subgrid_type), intent(in) :: subgridi - type(subgrid_type), intent(in) :: subgrido - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - - ! Whether two glcmec columns/patches must be the same column/patch type to be - ! considered the same type. This is only valid for glcmec points, and is only valid - ! for subgrid name = 'pft' or 'column'. - logical, intent(in) :: glcmec_must_be_same_type - - ! For vegetated patches (natural veg or crop): if veg_patch_just_considers_ptype is - ! true, then we consider two vegetated patches to be the same type if they have the - ! same ptype, without regard to their column and landunit types (as long as both the - ! input and the output are on either the natural veg or crop landunit). This is - ! needed to handle the generic crop properly when interpolating from non-crop to - ! crop, or vice versa. - ! - ! If false, then they need to have the same column and landunit types, too (as is the - ! general case). - logical, intent(in) :: veg_patch_just_considers_ptype - ! -------------------------------------------------------------------- - - is_sametype = .false. - - if (trim(subgridi%name) == 'pft' .and. trim(subgrido%name) == 'pft') then - if ( .not. glcmec_must_be_same_type .and. & - subgridi%ltype(ni) == subgrid_special_indices%ilun_landice_multiple_elevation_classes .and. & - subgrido%ltype(no) == subgrid_special_indices%ilun_landice_multiple_elevation_classes) then - is_sametype = .true. - else if (veg_patch_just_considers_ptype .and. & - subgrid_special_indices%is_vegetated_landunit(subgrido%ltype(no))) then - ! See comment attached to the declaration of veg_patch_just_considers_ptype for - ! rationale for this logic. - ! - ! TODO(wjs, 2015-09-15) If we ever allow the same PFT to appear on multiple - ! columns within a given grid cell, then this logic will need to be made - ! somewhat more complex: e.g., preferably take something from the same column - ! type, but if we can't find anything from the same column type, then ignore - ! column type. - - if (subgrid_special_indices%is_vegetated_landunit(subgridi%ltype(ni)) .and. & - subgridi%ptype(ni) == subgrido%ptype(no)) then - is_sametype = .true. - end if - else if (subgridi%ptype(ni) == subgrido%ptype(no) .and. & - subgridi%ctype(ni) == subgrido%ctype(no) .and. & - subgridi%ltype(ni) == subgrido%ltype(no)) then - is_sametype = .true. - end if - else if (trim(subgridi%name) == 'column' .and. trim(subgrido%name) == 'column') then - if ( .not. glcmec_must_be_same_type .and. & - subgridi%ltype(ni) == subgrid_special_indices%ilun_landice_multiple_elevation_classes .and. & - subgrido%ltype(no) == subgrid_special_indices%ilun_landice_multiple_elevation_classes ) then - is_sametype = .true. - else if (subgridi%ctype(ni) == subgrido%ctype(no) .and. & - subgridi%ltype(ni) == subgrido%ltype(no)) then - is_sametype = .true. - end if - else if (trim(subgridi%name) == 'landunit' .and. trim(subgrido%name) == 'landunit') then - if (subgridi%ltype(ni) == subgrido%ltype(no)) then - is_sametype = .true. - end if - else if (trim(subgridi%name) == 'gridcell' .and. trim(subgrido%name) == 'gridcell') then - is_sametype = .true. - else - if (masterproc) then - write(iulog,*)'ERROR interpinic: is_sametype check on input and output type not supported' - write(iulog,*)'typei = ',trim(subgridi%name) - write(iulog,*)'typeo = ',trim(subgrido%name) - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end function is_sametype - - !======================================================================= - - logical function is_baresoil (n, subgrid, subgrid_special_indices) - - ! -------------------------------------------------------------------- - ! arguments - integer , intent(in) :: n - type(subgrid_type), intent(in) :: subgrid - type(subgrid_special_indices_type), intent(in) :: subgrid_special_indices - ! -------------------------------------------------------------------- - - is_baresoil = .false. - - if (subgrid%name == 'pft') then - if (subgrid%ptype(n) == subgrid_special_indices%ipft_not_vegetated .and. & - subgrid%ctype(n) == subgrid_special_indices%icol_vegetated_or_bare_soil .and. & - subgrid%ltype(n) == subgrid_special_indices%ilun_vegetated_or_bare_soil) then - is_baresoil = .true. - end if - else if (subgrid%name == 'column') then - if (subgrid%ctype(n) == subgrid_special_indices%icol_vegetated_or_bare_soil .and. & - subgrid%ltype(n) == subgrid_special_indices%ilun_vegetated_or_bare_soil) then - is_baresoil = .true. - end if - else if (subgrid%name == 'landunit') then - if (subgrid%ltype(n) == subgrid_special_indices%ilun_vegetated_or_bare_soil) then - is_baresoil = .true. - end if - else - if (masterproc) then - write(iulog,*)'ERROR interpinic: is_baresoil subgrid type ',subgrid%name,' not supported' - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end function is_baresoil - - !----------------------------------------------------------------------- - function is_vegetated_landunit(this, ltype) - ! - ! !DESCRIPTION: - ! Returns true if the given landunit type is vegetated: either natural veg or crop - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: is_vegetated_landunit ! function result - class(subgrid_special_indices_type), intent(in) :: this - integer, intent(in) :: ltype ! landunit type of interest - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'is_vegetated_landunit' - !----------------------------------------------------------------------- - - if (ltype == this%ilun_vegetated_or_bare_soil .or. & - ltype == this%ilun_crop) then - is_vegetated_landunit = .true. - else - is_vegetated_landunit = .false. - end if - - end function is_vegetated_landunit - - -end module initInterpMindist diff --git a/src/init_interp/initInterpMultilevelBase.F90 b/src/init_interp/initInterpMultilevelBase.F90 deleted file mode 100644 index ae15b263eb..0000000000 --- a/src/init_interp/initInterpMultilevelBase.F90 +++ /dev/null @@ -1,91 +0,0 @@ -module initInterpMultilevelBase - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a base class for handling multi-level fields - ! - ! Usage: For a given variable: - ! - ! First call check_npts with the number of destination points, to ensure that this - ! interpolator is appropriate for this variable. - ! - ! Then call interp_multilevel once for each destination point - ! - ! Note that these interpolators only care about the destination point, not the source - ! point. Any information on the source grid is expected to have already been - ! interpolated to the destination grid. (This is needed for the sake of memory - ! scalability: Information on the source grid is not decomposed across processors, so - ! results in large amounts of memory usage.) - ! - ! !USES: - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_type - - type, abstract :: interp_multilevel_type - contains - procedure(check_npts_interface), deferred :: check_npts - procedure(interp_multilevel_interface), deferred :: interp_multilevel - procedure(get_description_interface), deferred :: get_description ! get text description of interpolator - end type interp_multilevel_type - - abstract interface - - subroutine check_npts_interface(this, npts, varname) - ! !DESCRIPTION: - ! Checks the number of destination points, to ensure that this interpolator is - ! appropriate for this variable. This should be called once for each variable. - ! - ! Aborts if there is a mismatch. - ! - ! !USES: - import:: interp_multilevel_type - ! - ! !ARGUMENTS: - class(interp_multilevel_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - end subroutine check_npts_interface - - subroutine interp_multilevel_interface(this, & - data_dest, data_source, index_dest) - ! !DESCRIPTION: - ! Interpolates a multi-level field from source to dest, for a single point. - ! - ! data_dest and data_source give values for all levels, for one destination or - ! source point. index_dest gives the spatial index (e.g., column index) of the dest - ! point; this is needed for some types of interpolation (to find the appropriate - ! metadata), but is ignored by others. This index should be 1-based (i.e., if the - ! lower bounds in the caller are not 1, they should be adjusted so that the first - ! index is 1). - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - import :: interp_multilevel_type - ! - ! !ARGUMENTS: - class(interp_multilevel_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - end subroutine interp_multilevel_interface - - pure function get_description_interface(this) result(description) - ! !DESCRIPTION - ! Returns a text description of this interpolator - ! - ! !USES: - import :: interp_multilevel_type - ! - ! !ARGUMENTS: - character(len=:), allocatable :: description ! function result - class(interp_multilevel_type), intent(in) :: this - end function get_description_interface - end interface - -end module initInterpMultilevelBase diff --git a/src/init_interp/initInterpMultilevelContainer.F90 b/src/init_interp/initInterpMultilevelContainer.F90 deleted file mode 100644 index 1c16518117..0000000000 --- a/src/init_interp/initInterpMultilevelContainer.F90 +++ /dev/null @@ -1,494 +0,0 @@ -module initInterpMultilevelContainer - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class that contains one instance of each interp_multilevel - ! type. This class is responsible for: - ! - ! (1) Constructing each interp_multilevel object - ! - ! (2) Determining which interp_multilevel object should be used for each multi-level - ! field (based on the field's level dimension) - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use initInterpBounds , only : interp_bounds_type - use initInterpMultilevelBase , only : interp_multilevel_type - use initInterpMultilevelCopy , only : interp_multilevel_copy_type - use initInterpMultilevelInterp , only : interp_multilevel_interp_type - use initInterpMultilevelSnow , only : interp_multilevel_snow_type - use initInterpMultilevelSplit , only : interp_multilevel_split_type, create_interp_multilevel_split_type - use initInterp2dvar , only : interp_2dvar_type - use initInterp1dData , only : interp_1d_data - use ncdio_pio , only : file_desc_t, var_desc_t, check_var, ncd_io - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use array_utils , only : transpose_wrapper - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_container_type - - type :: interp_multilevel_container_type - private - ! Components need to be pointers so that we can return pointers to them. - ! - ! (Components of a derived type cannot have the target attribute, but rather take on - ! the target attribute from their parent object. So the alternative to making these - ! pointers would be to require all instances of this derived type to have the target - ! attribute.) - type(interp_multilevel_copy_type), pointer :: interp_multilevel_copy - type(interp_multilevel_interp_type), pointer :: interp_multilevel_levgrnd_col - type(interp_multilevel_interp_type), pointer :: interp_multilevel_levgrnd_pft - type(interp_multilevel_snow_type), pointer :: interp_multilevel_levsno - type(interp_multilevel_snow_type), pointer :: interp_multilevel_levsno1 - type(interp_multilevel_split_type), pointer :: interp_multilevel_levtot_col - contains - procedure :: find_interpolator - end type interp_multilevel_container_type - - interface interp_multilevel_container_type - module procedure constructor - end interface interp_multilevel_container_type - - ! Private routines - - private :: create_interp_multilevel_levgrnd - private :: interp_levgrnd_check_source_file - private :: create_snow_interpolators - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(ncid_source, ncid_dest, bounds_source, bounds_dest, & - pftindex, colindex) result(this) - ! - ! !DESCRIPTION: - ! Create an interp_multilevel_container_type instance. - ! - ! !USES: - use ncdio_pio, only : file_desc_t - ! - ! !ARGUMENTS: - type(interp_multilevel_container_type) :: this ! function result - type(file_desc_t), target, intent(inout) :: ncid_source ! netcdf ID for source file - type(file_desc_t), target, intent(inout) :: ncid_dest ! netcdf ID for dest file - type(interp_bounds_type), intent(in) :: bounds_source - type(interp_bounds_type), intent(in) :: bounds_dest - - ! The following give mappings from source to dest for pft and col-level variables. - ! e.g., colindex(i) gives source col corresponding to dest col i. - integer, intent(in) :: pftindex(:) - integer, intent(in) :: colindex(:) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - allocate(this%interp_multilevel_copy) - this%interp_multilevel_copy = interp_multilevel_copy_type() - - allocate(this%interp_multilevel_levgrnd_col) - this%interp_multilevel_levgrnd_col = create_interp_multilevel_levgrnd( & - ncid_source = ncid_source, & - ncid_dest = ncid_dest, & - bounds_source = bounds_source, & - bounds_dest = bounds_dest, & - coord_varname = 'COL_Z', & - level_class_varname = 'LEVGRND_CLASS', & - sgridindex = colindex) - - allocate(this%interp_multilevel_levgrnd_pft) - this%interp_multilevel_levgrnd_pft = create_interp_multilevel_levgrnd( & - ncid_source = ncid_source, & - ncid_dest = ncid_dest, & - bounds_source = bounds_source, & - bounds_dest = bounds_dest, & - coord_varname = 'COL_Z_p', & - level_class_varname = 'LEVGRND_CLASS_p', & - sgridindex = pftindex) - - allocate(this%interp_multilevel_levsno) - allocate(this%interp_multilevel_levsno1) - call create_snow_interpolators( & - interp_multilevel_levsno = this%interp_multilevel_levsno, & - interp_multilevel_levsno1 = this%interp_multilevel_levsno1, & - ncid_source = ncid_source, & - bounds_source = bounds_source, & - bounds_dest = bounds_dest, & - colindex = colindex) - - ! levtot is two sets of levels: first snow, then levgrnd - allocate(this%interp_multilevel_levtot_col) - this%interp_multilevel_levtot_col = create_interp_multilevel_split_type( & - interpolator_first_levels = this%find_interpolator('levsno', 'column'), & - interpolator_second_levels = this%interp_multilevel_levgrnd_col, & - num_second_levels_source = this%interp_multilevel_levgrnd_col%get_nlev_source(), & - num_second_levels_dest = this%interp_multilevel_levgrnd_col%get_nlev_dest()) - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - function find_interpolator(this, lev_dimname, vec_dimname) result(interpolator) - ! - ! !DESCRIPTION: - ! Given the name of the level dimension and the vector dimension, return a pointer to - ! an interpolator that is appropriate for this multi-level variable. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_type), pointer :: interpolator ! function result - - class(interp_multilevel_container_type), intent(in) :: this - character(len=*), intent(in) :: lev_dimname ! name of level dimension - character(len=*), intent(in) :: vec_dimname ! name of vector dimension - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'find_interpolator' - !----------------------------------------------------------------------- - - select case (lev_dimname) - case ('levgrnd') - select case (vec_dimname) - case ('column') - interpolator => this%interp_multilevel_levgrnd_col - case ('pft') - interpolator => this%interp_multilevel_levgrnd_pft - case default - call error_not_found(subname, lev_dimname, vec_dimname) - end select - case ('levtot') - select case (vec_dimname) - case ('column') - interpolator => this%interp_multilevel_levtot_col - case default - call error_not_found(subname, lev_dimname, vec_dimname) - end select - case ('levsno') - interpolator => this%interp_multilevel_levsno - case ('levsno1') - interpolator => this%interp_multilevel_levsno1 - case default - interpolator => this%interp_multilevel_copy - end select - - contains - subroutine error_not_found(subname, lev_dimname, vec_dimname) - ! Write an error message and abort - character(len=*), intent(in) :: subname - character(len=*), intent(in) :: lev_dimname - character(len=*), intent(in) :: vec_dimname - - write(iulog,*) subname//' ERROR: no multi-level interpolator found for:' - write(iulog,*) 'lev_dimname = ', trim(lev_dimname) - write(iulog,*) 'vec_dimname = ', trim(vec_dimname) - call endrun(msg='ERROR: no multi-level interpolator found '//errMsg(sourcefile, __LINE__)) - end subroutine error_not_found - - end function find_interpolator - - ! ======================================================================== - ! Private methods and routines - ! ======================================================================== - - !----------------------------------------------------------------------- - function create_interp_multilevel_levgrnd(ncid_source, ncid_dest, & - bounds_source, bounds_dest, & - coord_varname, level_class_varname, & - sgridindex) & - result(interpolator) - ! - ! !DESCRIPTION: - ! Create the interpolator used to interpolate variables dimensioned by levgrnd - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_interp_type) :: interpolator ! function result - type(file_desc_t), target, intent(inout) :: ncid_source - type(file_desc_t), target, intent(inout) :: ncid_dest - type(interp_bounds_type), intent(in) :: bounds_source - type(interp_bounds_type), intent(in) :: bounds_dest - character(len=*), intent(in) :: coord_varname - character(len=*), intent(in) :: level_class_varname - integer, intent(in) :: sgridindex(:) ! mappings from source to dest points for the appropriate subgrid level (e.g., column-level mappings if this interpolator is for column-level data) - ! - ! !LOCAL VARIABLES: - type(interp_2dvar_type) :: coord_source - type(interp_2dvar_type) :: coord_dest - type(interp_2dvar_type) :: level_class_source - type(interp_2dvar_type) :: level_class_dest - real(r8), pointer :: coord_data_source_sgrid_1d(:) ! [vec] On the source grid - real(r8), allocatable :: coord_data_source(:,:) ! [vec, lev] Interpolated to the dest grid, but source vertical grid - real(r8), pointer :: coord_data_dest(:,:) ! [vec, lev] Dest horiz & vertical grid - integer , pointer :: level_class_data_source_sgrid_1d(:) ! [vec] On the source grid - integer , allocatable :: level_class_data_source(:,:) ! [vec, lev] Interpolated to the dest grid, but source vertical grid - integer , pointer :: level_class_data_dest(:,:) ! [vec, lev] Dest horiz & vertical grid - real(r8), allocatable :: coord_data_source_transpose(:,:) ! [lev, vec] - real(r8), allocatable :: coord_data_dest_transpose(:,:) ! [lev, vec] - integer , allocatable :: level_class_data_source_transpose(:,:) ! [lev, vec] - integer , allocatable :: level_class_data_dest_transpose(:,:) ! [lev, vec] - - integer :: beg_dest - integer :: end_dest - integer :: beg_source - integer :: end_source - - integer :: level - integer :: nlev_source - - character(len=*), parameter :: subname = 'create_interp_multilevel_levgrnd' - !----------------------------------------------------------------------- - - ! Set coord_data_dest - coord_dest = interp_2dvar_type( & - varname = coord_varname, & - ncid = ncid_dest, & - file_is_dest = .true., & - bounds = bounds_dest) - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READVAR"'. So we - ! explicitly call the specific routine, rather than calling readvar. - call coord_dest%readvar_double(coord_data_dest) - beg_dest = coord_dest%get_vec_beg() - end_dest = coord_dest%get_vec_end() - - ! Set level_class_data_dest - level_class_dest = interp_2dvar_type( & - varname = level_class_varname, & - ncid = ncid_dest, & - file_is_dest = .true., & - bounds = bounds_dest) - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READVAR"'. So we - ! explicitly call the specific routine, rather than calling readvar. - call level_class_dest%readvar_int(level_class_data_dest) - SHR_ASSERT(level_class_dest%get_vec_beg() == beg_dest, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(level_class_dest%get_vec_end() == end_dest, errMsg(sourcefile, __LINE__)) - - ! NOTE(wjs, 2015-10-18) The following check is helpful while we still have old initial - ! conditions files that do not have the necessary metadata. Once these old initial - ! conditions files have been phased out, we can remove this check. (Without this - ! check, the run will still abort if it can't find the necessary variables - it just - ! won't have a very helpful error message.) - call interp_levgrnd_check_source_file(ncid_source, coord_varname, level_class_varname) - - ! Set coord_data_source - coord_source = interp_2dvar_type( & - varname = coord_varname, & - ncid = ncid_source, & - file_is_dest = .false., & - bounds = bounds_source) - nlev_source = coord_source%get_nlev() - beg_source = coord_source%get_vec_beg() - end_source = coord_source%get_vec_end() - allocate(coord_data_source(beg_dest:end_dest, nlev_source)) - allocate(coord_data_source_sgrid_1d(beg_source:end_source)) - do level = 1, nlev_source - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READLEVEL"'. So we - ! explicitly call the specific routine, rather than calling readlevel. - call coord_source%readlevel_double(coord_data_source_sgrid_1d, level) - call interp_1d_data( & - begi = beg_source, endi = end_source, & - bego = beg_dest, endo = end_dest, & - sgridindex = sgridindex, & - keep_existing = .false., & - data_in = coord_data_source_sgrid_1d, & - data_out = coord_data_source(:,level)) - end do - deallocate(coord_data_source_sgrid_1d) - - ! Set level_class_data_source - level_class_source = interp_2dvar_type( & - varname = level_class_varname, & - ncid = ncid_source, & - file_is_dest = .false., & - bounds = bounds_source) - SHR_ASSERT(level_class_source%get_nlev() == nlev_source, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(level_class_source%get_vec_beg() == beg_source, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(level_class_source%get_vec_end() == end_source, errMsg(sourcefile, __LINE__)) - allocate(level_class_data_source(beg_dest:end_dest, nlev_source)) - allocate(level_class_data_source_sgrid_1d(beg_source:end_source)) - do level = 1, nlev_source - ! COMPILER_BUG(wjs, 2015-11-25, cray8.4.0) The cray compiler has trouble - ! resolving the generic reference here, giving the message: 'No specific - ! match can be found for the generic subprogram call "READLEVEL"'. So we - ! explicitly call the specific routine, rather than calling readlevel. - call level_class_source%readlevel_int(level_class_data_source_sgrid_1d, level) - call interp_1d_data( & - begi = beg_source, endi = end_source, & - bego = beg_dest, endo = end_dest, & - sgridindex = sgridindex, & - keep_existing = .false., & - data_in = level_class_data_source_sgrid_1d, & - data_out = level_class_data_source(:,level)) - end do - deallocate(level_class_data_source_sgrid_1d) - - ! Create interpolator - call transpose_wrapper(coord_data_source_transpose, coord_data_source) - call transpose_wrapper(coord_data_dest_transpose, coord_data_dest) - call transpose_wrapper(level_class_data_source_transpose, level_class_data_source) - call transpose_wrapper(level_class_data_dest_transpose, level_class_data_dest) - interpolator = interp_multilevel_interp_type( & - coordinates_source = coord_data_source_transpose, & - coordinates_dest = coord_data_dest_transpose, & - level_classes_source = level_class_data_source_transpose, & - level_classes_dest = level_class_data_dest_transpose, & - coord_varname = coord_varname) - - ! Deallocate pointers (allocatables are automatically deallocated) - deallocate(coord_data_dest) - deallocate(level_class_data_dest) - - end function create_interp_multilevel_levgrnd - - !----------------------------------------------------------------------- - subroutine interp_levgrnd_check_source_file(ncid_source, coord_varname, level_class_varname) - ! - ! !DESCRIPTION: - ! Ensure that the necessary variables are present on the source file for the levgrnd - ! interpolator. - ! - ! Aborts the run with a useful error message if either variable is missing - ! - ! !USES: - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid_source - character(len=*) , intent(in) :: coord_varname - character(len=*) , intent(in) :: level_class_varname - ! - ! !LOCAL VARIABLES: - logical :: coord_on_source - logical :: level_class_on_source - type(var_desc_t) :: coord_source_vardesc ! unused, but needed for check_var interface - type(var_desc_t) :: level_class_source_vardesc ! unused, but needed for check_var interface - character(len=:), allocatable :: variables_missing - - character(len=*), parameter :: subname = 'interp_levgrnd_check_source_file' - !----------------------------------------------------------------------- - - variables_missing = ' ' - call check_var(ncid_source, coord_varname, coord_source_vardesc, coord_on_source) - if (.not. coord_on_source) then - variables_missing = variables_missing // coord_varname // ' ' - end if - call check_var(ncid_source, level_class_varname, level_class_source_vardesc, level_class_on_source) - if (.not. level_class_on_source) then - variables_missing = variables_missing // level_class_varname // ' ' - end if - if (variables_missing /= ' ') then - if (masterproc) then - write(iulog,*) subname//& - ' ERROR: source file for init_interp is missing the necessary variable(s):' - write(iulog,*) variables_missing - write(iulog,*) 'To solve this problem, run the model for a short time using this tag,' - write(iulog,*) 'with a configuration that matches the source file, using the source' - write(iulog,*) 'file as finidat (with use_init_interp = .false.), in order to' - write(iulog,*) 'produce a new restart file with the necessary metadata.' - write(iulog,*) 'Then use that new file as the finidat file for init_interp.' - write(iulog,*) ' ' - write(iulog,*) 'If that is not possible, then an alternative is to run the model for' - write(iulog,*) 'a short time using this tag, with cold start initial conditions' - write(iulog,*) '(finidat = " "). Then use a tool like ncks to copy the misssing fields' - write(iulog,*) 'onto the original source finidat file. Then use that patched file' - write(iulog,*) 'as the finidat file for init_interp.' - end if - - call endrun(subname//' ERROR: source file for init_interp is missing '// & - variables_missing) - end if - - end subroutine interp_levgrnd_check_source_file - - !----------------------------------------------------------------------- - subroutine create_snow_interpolators(interp_multilevel_levsno, interp_multilevel_levsno1, & - ncid_source, bounds_source, bounds_dest, colindex) - ! - ! !DESCRIPTION: - ! Create multi-level interpolators for snow variables - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_snow_type), intent(out) :: interp_multilevel_levsno - type(interp_multilevel_snow_type), intent(out) :: interp_multilevel_levsno1 - type(file_desc_t), intent(inout) :: ncid_source ! netcdf ID for source file - type(interp_bounds_type), intent(in) :: bounds_source - type(interp_bounds_type), intent(in) :: bounds_dest - integer, intent(in) :: colindex(:) ! mappings from source to dest for column-level arrays - ! - ! !LOCAL VARIABLES: - ! snlsno_source needs to be a pointer to satisfy the interface of ncd_io - integer, pointer :: snlsno_source_sgrid(:) ! snlsno in source, on source grid - integer, allocatable :: snlsno_source(:) ! snlsno_source interpolated to dest - integer, allocatable :: snlsno_source_plus_1(:) ! snlsno_source+1 interpolated to dest - - character(len=*), parameter :: subname = 'create_snow_interpolators' - !----------------------------------------------------------------------- - - ! Read snlsno_source_sgrid - allocate(snlsno_source_sgrid(bounds_source%get_begc() : bounds_source%get_endc())) - call ncd_io(ncid=ncid_source, varname='SNLSNO', flag='read', & - data=snlsno_source_sgrid) - snlsno_source_sgrid(:) = abs(snlsno_source_sgrid(:)) - - ! Interpolate to dest - allocate(snlsno_source(bounds_dest%get_begc() : bounds_dest%get_endc())) - call interp_1d_data( & - begi = bounds_source%get_begc(), endi = bounds_source%get_endc(), & - bego = bounds_dest%get_begc(), endo = bounds_dest%get_endc(), & - sgridindex = colindex, & - keep_existing = .false., & - data_in = snlsno_source_sgrid, data_out = snlsno_source) - deallocate(snlsno_source_sgrid) - - ! Set up interp_multilevel_levsno - interp_multilevel_levsno = interp_multilevel_snow_type( & - num_snow_layers_source = snlsno_source, & - num_layers_name = 'SNLSNO') - - ! Set up interp_multilevel_levsno1 - ! - ! For variables dimensioned (levsno+1), we assume they have (snlsno+1) active layers. - ! Thus, if there are 0 active layers in the source, the bottom layer's value will - ! still get copied for these (levsno+1) variables. - allocate(snlsno_source_plus_1(bounds_dest%get_begc() : bounds_dest%get_endc())) - snlsno_source_plus_1(:) = snlsno_source(:) + 1 - interp_multilevel_levsno1 = interp_multilevel_snow_type( & - num_snow_layers_source = snlsno_source_plus_1, & - num_layers_name = 'SNLSNO+1') - - deallocate(snlsno_source) - deallocate(snlsno_source_plus_1) - - end subroutine create_snow_interpolators - - -end module initInterpMultilevelContainer diff --git a/src/init_interp/initInterpMultilevelCopy.F90 b/src/init_interp/initInterpMultilevelCopy.F90 deleted file mode 100644 index 5cfd47d247..0000000000 --- a/src/init_interp/initInterpMultilevelCopy.F90 +++ /dev/null @@ -1,139 +0,0 @@ -module initInterpMultilevelCopy - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class for handling multi-level fields by simply copying the - ! source to the destination, assuming the same number of levels in each. - ! - ! !USES: -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use initInterpMultilevelBase , only : interp_multilevel_type - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_copy_type - - type, extends(interp_multilevel_type) :: interp_multilevel_copy_type - ! COMPILER_BUG(wjs, 2015-10-20, intel15.0.1) intel has problems creating a pointer to - ! a class without any data components. Thus, including this unused dummy_var to make - ! intel happy. - integer :: dummy_var - contains - procedure :: check_npts - procedure :: interp_multilevel - procedure :: get_description - end type interp_multilevel_copy_type - - interface interp_multilevel_copy_type - module procedure constructor - end interface interp_multilevel_copy_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - type(interp_multilevel_copy_type) function constructor() - ! - ! !DESCRIPTION: - ! Creates a new interp_multilevel_copy_type object - !----------------------------------------------------------------------- - - ! Nothing needs to be done - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine check_npts(this, npts, varname) - ! - ! !DESCRIPTION: - ! Checks the number of destination points, to ensure that this interpolator is - ! appropriate for this variable. This should be called once for each variable. - ! - ! This version accepts any number of points, because it has no point-based metadata. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_copy_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_npts' - !----------------------------------------------------------------------- - - return - - end subroutine check_npts - - - !----------------------------------------------------------------------- - subroutine interp_multilevel(this, data_dest, data_source, index_dest) - ! - ! !DESCRIPTION: - ! Interpolates a multi-level field from source to dest, for a single point. - ! - ! This version requires that data_dest and data_source be the same size, and it simply - ! copies source to dest. - ! - ! !ARGUMENTS: - class(interp_multilevel_copy_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'interp_multilevel' - !----------------------------------------------------------------------- - - SHR_ASSERT((size(data_source) == size(data_dest)), errMsg(sourcefile, __LINE__)) - - ! Note that it's safe to do whole-array assignment here because we never decompose - ! along the level dimension (in contrast to the spatial dimension, where you need to - ! specify explicit bounds). - data_dest(:) = data_source(:) - - end subroutine interp_multilevel - - !----------------------------------------------------------------------- - pure function get_description(this) result(description) - ! - ! !DESCRIPTION: - ! Returns a text description of this interpolator - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=:), allocatable :: description ! function result - class(interp_multilevel_copy_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_description' - !----------------------------------------------------------------------- - - description = 'Copy levels' - - end function get_description - -end module initInterpMultilevelCopy - diff --git a/src/init_interp/initInterpMultilevelInterp.F90 b/src/init_interp/initInterpMultilevelInterp.F90 deleted file mode 100644 index 4057d63e25..0000000000 --- a/src/init_interp/initInterpMultilevelInterp.F90 +++ /dev/null @@ -1,599 +0,0 @@ -module initInterpMultilevelInterp - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class for handling multi-level fields by interpolating based on - ! a coordinate variable. This interpolation scheme also allows different levels to - ! belong to different level_classes; the interpolation for a level belonging to - ! level_class N only considers source levels that also belong to level_class N. - ! - ! - ! ------------------------------------------------------------------------ - ! NOTE(wjs, 2015-10-22) Note about handling of spval (and NaN) values in the source and - ! destination data (i.e., the data themselves, as opposed to the coordinate or - ! level_class arrays): It feels like there are two different possible uses for spval in - ! multi-level arrays; this class assumes the "static" use of spval (#1 below): - ! - ! (1) A "static" spval, e.g., based on depth for a given variable: e.g., "given this - ! vertical discretization, this variable only applies to a depth of 5 m, and so should - ! always remain spval below 5 m". For this case, if the destination is spval, then it - ! should remain spval - because spval is more about the grid (vertical discretization, - ! surface dataset, etc.) than about anything dynamic in time. A spval in the source - ! data should be ignored (rather than being used in the interpolation), so that the - ! destination array gets filled for all levels where it was not originally spval, using - ! extrapolation if necessary (e.g., if the source array had spvals at some levels where - ! the destination array needs valid data). - ! - ! (2) A "dynamic" spval, e.g., signaling that this layer should be treated specially - ! right now, but that may change in time. For this case, an spval in the destination - ! should be treated no differently from any other value: it should be replaced by - ! values from the source grid. An spval in the source would need to be handled - ! specially (e.g.: if both sides of the interpolation are spval then the result is - ! spval; if one side is spval, then use the other point). (We can't simply ignore / - ! exclude source levels with spval in this case, because an spval has true meaning that - ! should be transferred to the nearby levels in the destination array.) - ! - ! These two uses are fundamentally incompatible: Either we keep spvals in the - ! destination array as spval (the "static" case), or we replace spvals in the - ! destination array (the "dynamic" case). The only way we could handle both - ! possibilities is if variables had metadata saying whether they were using a "dynamic" - ! or "static" treatment of spvals - but that feels confusing. - ! - ! Looking through current multi-level variables, it looked like there were a number of - ! uses of "static" spvals, and one use of "dynamic" spvals (in the ch4 code). I have now - ! removed the "dynamic" spval. - ! - ! This class assumes the "static" use of spval - i.e., case (1) above. This is partly to - ! reflect the current usage in the code, and partly because it's easier to detect - ! improper use of a "dynamic" spval when we assume "static" spval (through an LII test) - ! than it is to detect improper use of a "static" spval when we assume "dynamic" spval. - ! (The latter would tend to just show up as a problem when interpolating from one - ! vertical grid to another, and it's hard to confirm correctness of that interpolation - ! in an automated test.) - ! - ! Thus, multi-level arrays (at least those that are potentially interpolated vertically) - ! should NOT use the "dynamic" use of spval (case (2)). That is, spval should only be - ! used in places where that spval will remain spval throughout the run. - ! ------------------------------------------------------------------------ - ! - ! !USES: -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : spval, ispval - use initInterpMultilevelBase , only : interp_multilevel_type - use array_utils , only : pack_wrapper - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_interp_type - - type, extends(interp_multilevel_type) :: interp_multilevel_interp_type - private - character(len=:), allocatable :: coord_varname ! name of coordinate variable (just used for identification purposes) - - ! The following 'source' arrays store information about the source grid, but - ! regridded to the destination grid. e.g., coordinates_source(n,i) gives the - ! coordinate value for level n on the source grid, for the source grid point that - ! maps to destination point i. - real(r8), allocatable :: coordinates_source(:,:) ! coordinate values on source grid [lev, pt] - real(r8), allocatable :: coordinates_dest(:,:) ! coordinate values on dest grid [lev, pt] - integer , allocatable :: level_classes_source(:,:) ! class indices on source grid [lev, pt] - integer , allocatable :: level_classes_dest(:,:) ! class indices on dest grid [lev, pt] - - integer :: npts ! number of spatial points on dest grid - integer :: nlev_source ! number of levels on source grid - integer :: nlev_dest ! number of levels on dest grid - contains - ! Public methods from base class - procedure :: check_npts - procedure :: interp_multilevel - procedure :: get_description - - ! Public methods specific to this class - procedure :: get_nlev_source ! get number of levels on source grid - procedure :: get_nlev_dest ! get number of levels on dest grid - - ! Private methods - procedure, private :: check_coordinate_array - procedure, private, nopass :: confirm_monotonically_increasing - procedure, private, nopass :: interp_onelevel ! do the interpolation for a single dest level - procedure, private, nopass :: is_missing ! true if a value is considered missing - end type interp_multilevel_interp_type - - interface interp_multilevel_interp_type - module procedure constructor_with_levclasses - module procedure constructor_no_levclasses - end interface interp_multilevel_interp_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor_no_levclasses(coordinates_source, coordinates_dest, coord_varname) & - result(this) - ! - ! !DESCRIPTION: - ! Construct an interp_multilevel_interp_type object, where all levels have the same - ! level_class. - ! - ! Coordinates must be monotonically increasing. - ! - ! coordinates_source gives information about the source grid, but regridded to the - ! destination grid. So coordinates_source(n,i) gives the coordinate value for level - ! n on the source grid, for the source grid point that maps to destination point i. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_interp_type) :: this ! function result - real(r8), intent(in) :: coordinates_source(:,:) ! coordinate values on source grid [lev, pt] - real(r8), intent(in) :: coordinates_dest(:,:) ! coordinate values on dest grid [lev, pt] - character(len=*), intent(in) :: coord_varname ! name of coordinate variable (just used for identification purposes) - ! - ! !LOCAL VARIABLES: - integer :: npts - integer :: nlev_source, nlev_dest - integer, allocatable :: level_classes_source(:,:) - integer, allocatable :: level_classes_dest(:,:) - - character(len=*), parameter :: subname = 'constructor_no_levclasses' - !----------------------------------------------------------------------- - - npts = size(coordinates_source, 2) - SHR_ASSERT((size(coordinates_dest, 2) == npts), errMsg(sourcefile, __LINE__)) - - nlev_source = size(coordinates_source, 1) - nlev_dest = size(coordinates_dest, 1) - - allocate(level_classes_source(nlev_source, npts), source = 1) - allocate(level_classes_dest(nlev_dest, npts), source = 1) - - this = interp_multilevel_interp_type( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest, & - coord_varname = coord_varname) - - end function constructor_no_levclasses - - - !----------------------------------------------------------------------- - function constructor_with_levclasses(coordinates_source, coordinates_dest, & - level_classes_source, level_classes_dest, & - coord_varname) & - result(this) - ! - ! !DESCRIPTION: - ! Construct an interp_multilevel_interp_type object, where classes are specified for - ! each level. - ! - ! Coordinates must be monotonically increasing. - ! - ! coordinates_source and level_classes_source give information about the source grid, - ! but regridded to the destination grid. e.g., coordinates_source(n,i) gives the - ! coordinate value for level n on the source grid, for the source grid point that maps - ! to destination point i. - ! - ! For the 'level_classes': The particular values are not important; the important - ! thing is that, for a given column, levels that are fundamentally different should - ! have different values. This ensures that data are not copied from one class of - ! levels to another (e.g., between soil and bedrock). - ! - ! However, a level whose class is ispval is treated specially: This is treated as a - ! non-existent level: In the destination data, its value is left unchanged; in the - ! source data, its value is never used in the interpolation. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_interp_type) :: this ! function result - real(r8), intent(in) :: coordinates_source(:,:) ! coordinate values on source grid [lev, pt] - real(r8), intent(in) :: coordinates_dest(:,:) ! coordinate values on dest grid [lev, pt] - integer , intent(in) :: level_classes_source(:,:) ! class indices on source grid [lev, pt] - integer , intent(in) :: level_classes_dest(:,:) ! class indices on dest grid [lev, pt] - character(len=*), intent(in) :: coord_varname ! name of coordinate variable (just used for identification purposes) - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'constructor_with_levclasses' - !----------------------------------------------------------------------- - - this%coord_varname = trim(coord_varname) - - this%npts = size(coordinates_source, 2) - SHR_ASSERT((size(coordinates_dest, 2) == this%npts), errMsg(sourcefile, __LINE__)) - - this%nlev_source = size(coordinates_source, 1) - this%nlev_dest = size(coordinates_dest, 1) - - SHR_ASSERT_ALL((shape(level_classes_source) == [this%nlev_source, this%npts]), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((shape(level_classes_dest) == [this%nlev_dest, this%npts]), errMsg(sourcefile, __LINE__)) - - do i = 1, this%npts - call this%check_coordinate_array(coordinates_source(:,i), level_classes_source(:,i)) - end do - do i = 1, this%npts - call this%check_coordinate_array(coordinates_dest(:,i), level_classes_dest(:,i)) - end do - - this%coordinates_source = coordinates_source - this%coordinates_dest = coordinates_dest - this%level_classes_source = level_classes_source - this%level_classes_dest = level_classes_dest - - end function constructor_with_levclasses - - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine check_npts(this, npts, varname) - ! - ! !DESCRIPTION: - ! Checks the number of destination points, to ensure that this interpolator is - ! appropriate for this variable. This should be called once for each variable. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_interp_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_npts' - !----------------------------------------------------------------------- - - if (npts /= this%npts) then - write(iulog,*) subname//' ERROR: mismatch in number of dest points for ', & - trim(varname) - write(iulog,*) 'Number of dest points: ', npts - write(iulog,*) 'Expected number of dest points: ', this%npts - call endrun(msg=subname//' ERROR: mismatch in number of points for '//& - trim(varname) // ' ' // errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_npts - - !----------------------------------------------------------------------- - subroutine interp_multilevel(this, data_dest, data_source, index_dest) - ! - ! !DESCRIPTION: - ! Interpolates a multi-level field from source to dest, for a single point. - ! - ! This version does a true interpolation, using a coordinate variable. The coordinate - ! variable (along with the group to which each level belongs) can vary for each - ! spatial point. Thus, index_dest is used in this version, and is must be within the - ! bounds of the metadata. This index should be 1-based. - ! - ! If level_classes were provided for this object (i.e., level_classes_source and - ! level_classes_dest), then: For a given destination level, the interpolation is done - ! only over source levels whose class matches the destination level's class. In - ! addition, if the destination level's class is ispval, then the destination data is - ! left unchanged for that level. - ! - ! Levels whose data value is spval are treated the same as levels whose class is - ! ispval: If the destination data begins as spval, then it is left as spval (with the - ! assumption that this is truly meant to remain as missing data in the destination). - ! And any source level that has data = spval is ignored. NaN values are treated the - ! same as spval in this respect. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_interp_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - ! - ! !LOCAL VARIABLES: - integer :: lev_dest - integer :: level_class_dest - integer :: lev_source - - ! source information for this index_dest - real(r8) :: my_level_classes_source(this%nlev_source) - real(r8) :: my_coordinates_source(this%nlev_source) - - ! whether each source level is in the destination level_class - logical :: source_levels_in_class(this%nlev_source) - - ! data and coordinates packed to just contain levels in the destination level_class: - real(r8), allocatable :: data_source_in_class(:) - real(r8), allocatable :: coordinates_source_in_class(:) - - character(len=*), parameter :: subname = 'interp_multilevel' - !----------------------------------------------------------------------- - - SHR_ASSERT((size(data_dest) == this%nlev_dest), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((size(data_source) == this%nlev_source), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((index_dest >= 1 .and. index_dest <= this%npts), errMsg(sourcefile, __LINE__)) - - my_level_classes_source(:) = this%level_classes_source(:, index_dest) - my_coordinates_source(:) = this%coordinates_source(:, index_dest) - - do lev_dest = 1, this%nlev_dest - level_class_dest = this%level_classes_dest(lev_dest, index_dest) - if (level_class_dest /= ispval) then - if (.not. is_missing(data_dest(lev_dest))) then - do lev_source = 1, this%nlev_source - if (my_level_classes_source(lev_source) /= level_class_dest) then - source_levels_in_class(lev_source) = .false. - else if (is_missing(data_source(lev_source))) then - source_levels_in_class(lev_source) = .false. - else - source_levels_in_class(lev_source) = .true. - end if - end do - call pack_wrapper(data_source_in_class, data_source, source_levels_in_class) - call pack_wrapper(coordinates_source_in_class, my_coordinates_source, source_levels_in_class) - call this%interp_onelevel( & - data_dest = data_dest(lev_dest), & - coordinate_dest = this%coordinates_dest(lev_dest, index_dest), & - data_source = data_source_in_class, & - coordinates_source = coordinates_source_in_class) - end if - end if - end do - - end subroutine interp_multilevel - - !----------------------------------------------------------------------- - pure function get_description(this) result(description) - ! - ! !DESCRIPTION: - ! Returns a text description of this interpolator - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=:), allocatable :: description ! function result - class(interp_multilevel_interp_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_description' - !----------------------------------------------------------------------- - - description = 'Interpolate using '//this%coord_varname - - end function get_description - - !----------------------------------------------------------------------- - pure integer function get_nlev_source(this) - ! Get number of levels on source grid - class(interp_multilevel_interp_type), intent(in) :: this - - get_nlev_source = this%nlev_source - end function get_nlev_source - - !----------------------------------------------------------------------- - pure integer function get_nlev_dest(this) - ! Get number of levels on dest grid - class(interp_multilevel_interp_type), intent(in) :: this - - get_nlev_dest = this%nlev_dest - end function get_nlev_dest - - - ! ======================================================================== - ! Private methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine check_coordinate_array(this, coordinates, level_classes) - ! - ! !DESCRIPTION: - ! Check validity of a coordinate array - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_interp_type), intent(in) :: this - real(r8), intent(in) :: coordinates(:) ! coordinates at all levels, for one point - integer , intent(in) :: level_classes(:) ! classes corresponding to coordinates - ! - ! !LOCAL VARIABLES: - integer :: nlevs - - ! subset of coordinates just in levels that exist (with existence defined based on - ! level_classes) - real(r8), allocatable :: coordinates_in_existing_levels(:) - - character(len=*), parameter :: subname = 'check_coordinate_array' - !----------------------------------------------------------------------- - - nlevs = size(coordinates) - SHR_ASSERT((size(level_classes) == nlevs), errMsg(sourcefile, __LINE__)) - - call pack_wrapper(coordinates_in_existing_levels, coordinates, level_classes /= ispval) - - if (any(is_missing(coordinates_in_existing_levels))) then - ! In principle we could handle spvals in coordinate arrays just like we handle - ! ispval in the level_class or spval in data. However, this likely indicates an - ! error, so for now we look out for that and abort if it is found. - call endrun(msg='spvals or NaNs found in coordinate array where level_class /= ispval; ' // & - 'this is currently unhandled ' // errMsg(sourcefile, __LINE__)) - end if - - call this%confirm_monotonically_increasing(coordinates_in_existing_levels) - - end subroutine check_coordinate_array - - - !----------------------------------------------------------------------- - subroutine confirm_monotonically_increasing(data) - ! - ! !DESCRIPTION: - ! Confirms that an array is monotonically increasing. Dies if not. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), intent(in) :: data(:) - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'confirm_monotonically_increasing' - !----------------------------------------------------------------------- - - do i = 2, size(data) - if (data(i-1) >= data(i)) then - write(iulog,*) subname//' ERROR: array not monotonically increasing: ' - write(iulog,*) data(i-1), data(i) - call endrun(msg=subname//" ERROR: array not monotonically increasing"// & - errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine confirm_monotonically_increasing - - !----------------------------------------------------------------------- - subroutine interp_onelevel(data_dest, coordinate_dest, data_source, coordinates_source) - ! - ! !DESCRIPTION: - ! Do the interpolation for a single destination level - ! - ! !ARGUMENTS: - real(r8), intent(inout) :: data_dest - real(r8), intent(in) :: coordinate_dest - real(r8), intent(in) :: data_source(:) - real(r8), intent(in) :: coordinates_source(:) - ! - ! !LOCAL VARIABLES: - logical :: copylevel - logical :: found - integer :: nlev_source - integer :: lev - integer :: index_lower - - real(r8), parameter :: eps = 1.e-13_r8 - character(len=*), parameter :: subname = 'interp_onelevel' - !----------------------------------------------------------------------- - - nlev_source = size(coordinates_source) - - if (nlev_source == 0) then - ! If there is no source information, then leave the destination data at its - ! original value - return - end if - - ! ------------------------------------------------------------------------ - ! Find level(s) to use for interpolation - ! ------------------------------------------------------------------------ - - found = .false. - - if (coordinate_dest < coordinates_source(1)) then - found = .true. - copylevel = .true. - index_lower = 1 - - else if (coordinate_dest > coordinates_source(nlev_source)) then - found = .true. - copylevel = .true. - index_lower = nlev_source - - else - ! See if coordinate_dest matches one of the source coordinates (within roundoff) - do lev = 1, nlev_source - if ((abs(coordinate_dest - coordinates_source(lev)) < eps)) then - found = .true. - copylevel = .true. - index_lower = lev - exit - end if - end do - - if (.not. found) then - ! Find the interval in which coordinate_dest falls - do lev = 1, nlev_source - if ( (coordinate_dest > coordinates_source(lev)) & - .and. (coordinate_dest < coordinates_source(lev+1)) ) then - found = .true. - copylevel = .false. - index_lower = lev - exit - end if - end do - end if - - end if - - if (.not. found) then - call endrun(subname//' ERROR: Could not find levels to use for interpolation' // & - errMsg(sourcefile, __LINE__)) - end if - - ! ------------------------------------------------------------------------ - ! Do the interpolation - ! ------------------------------------------------------------------------ - - if ( copylevel) then - data_dest = data_source(index_lower) - else - data_dest = & - data_source(index_lower+1) & - * (coordinate_dest - coordinates_source(index_lower)) & - / (coordinates_source(index_lower+1) - coordinates_source(index_lower)) + & - data_source(index_lower) & - * (coordinates_source(index_lower+1) - coordinate_dest ) & - / (coordinates_source(index_lower+1) - coordinates_source(index_lower)) - end if - - end subroutine interp_onelevel - - !----------------------------------------------------------------------- - elemental logical function is_missing(val) - ! - ! !DESCRIPTION: - ! Returns true if the given value is considered missing. - ! - ! spval is treated as missing. NaNs are treated the same as spval. Considering the - ! destination data, the assumption here is that, if a value was uninitialized before - ! (so is NaN), then it shouldn't be set in init_interp. - ! - ! !USES: - use shr_infnan_mod , only : isnan => shr_infnan_isnan - ! - ! !ARGUMENTS: - real(r8), intent(in) :: val - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'is_missing' - !----------------------------------------------------------------------- - - if (isnan(val)) then - is_missing = .true. - else if (val == spval) then - is_missing = .true. - else - is_missing = .false. - end if - - end function is_missing - - -end module initInterpMultilevelInterp diff --git a/src/init_interp/initInterpMultilevelSnow.F90 b/src/init_interp/initInterpMultilevelSnow.F90 deleted file mode 100644 index a41598f988..0000000000 --- a/src/init_interp/initInterpMultilevelSnow.F90 +++ /dev/null @@ -1,227 +0,0 @@ -module initInterpMultilevelSnow - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class for handling multi-level snow fields. - ! - ! !USES: -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use initInterpMultilevelBase , only : interp_multilevel_type - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_snow_type - - type, extends(interp_multilevel_type) :: interp_multilevel_snow_type - private - character(len=:), allocatable :: num_layers_name - - ! Number of active snow layers on the source grid, regridded to the destination grid - ! - ! Thus, num_snow_layers_source(i) gives the number of active snow layers on the source - ! grid for the source grid point that maps to destination point i. - integer, allocatable :: num_snow_layers_source(:) - contains - procedure :: check_npts - procedure :: interp_multilevel - procedure :: get_description - end type interp_multilevel_snow_type - - interface interp_multilevel_snow_type - module procedure constructor - end interface interp_multilevel_snow_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - type(interp_multilevel_snow_type) function constructor(num_snow_layers_source, & - num_layers_name) - ! - ! !DESCRIPTION: - ! Creates a new interp_multilevel_snow_type object - ! - ! !USES: - ! - ! !ARGUMENTS: - - ! Number of active snow layers on the source grid, regridded to the destination grid - ! - ! Thus, num_snow_layers_source(i) gives the number of active snow layers on the source - ! grid for the source grid point that maps to destination point i. - integer, intent(in) :: num_snow_layers_source(:) - - ! name of variable giving number of snow layers (just used for identification purposes) - character(len=*), intent(in) :: num_layers_name - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - ! We do not check validity of num_snow_layers_source here (i.e., confirming that it - ! is >= 0 everywhere) because it's okay for it to be invalid for points that are - ! never invoked. This is the case for destination points with no corresponding source - ! point (e.g., inactive destination points). - - allocate(constructor%num_snow_layers_source(size(num_snow_layers_source))) - constructor%num_snow_layers_source(:) = num_snow_layers_source(:) - - constructor%num_layers_name = trim(num_layers_name) - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine check_npts(this, npts, varname) - ! - ! !DESCRIPTION: - ! Checks the number of destination points, to ensure that this interpolator is - ! appropriate for this variable. This should be called once for each variable. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_snow_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_npts' - !----------------------------------------------------------------------- - - if (npts /= size(this%num_snow_layers_source)) then - write(iulog,*) subname//' ERROR: mismatch in number of dest points for ', & - trim(varname) - write(iulog,*) 'Number of dest points: ', npts - write(iulog,*) 'Expected number of dest points: ', & - size(this%num_snow_layers_source) - call endrun(msg=subname//' ERROR: mismatch in number of points for '//& - trim(varname) // ' ' // errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_npts - - !----------------------------------------------------------------------- - subroutine interp_multilevel(this, data_dest, data_source, index_dest) - ! - ! !DESCRIPTION: - ! Interpolates a multi-level field from source to dest, for a single point. - ! - ! This version does an "interpolation" (really a copy with offsets) appropriate for - ! snow variables. - ! - ! For most snow variables, we only need to copy data from EXISTING snow layers. - ! However, there are a few variables (specifically, absorbed radiation fluxes) where - ! we need to copy data even from non-existing snow layers in order to get bit-for-bit - ! behavior upon interpolation. Thus, to be safe, we copy as many levels as possible. - ! The algorithm is as follows: - ! - ! - If (number of destination levels) >= (number of source levels), then copy all - ! source levels to the destination. If there are more destination levels than - ! source levels, then the lowest-index destination levels will be set to 0. - ! - ! - If (number of destination levels) < (number of source levels), but (number of - ! destination levels) >= (number of EXISTING snow levels in source), then copy all - ! existing snow levels to the destination, plus as many non-existing levels as will - ! fit. - ! - ! - If (number of destination levels) < (number of EXISTING snow levels in source), - ! then copy the top N existing snow levels to the destination, where N is the - ! number of destination levels. - ! - ! index_dest is used in this version, in order to match each point with its number - ! of existing snow layers; index_dest should be 1-based. - ! - ! !ARGUMENTS: - class(interp_multilevel_snow_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - ! - ! !LOCAL VARIABLES: - integer :: num_source ! total number of source layers - integer :: num_dest ! total number of dest layers - integer :: num_snow_layers_source ! number of EXISTING snow layers at this source point - integer :: top_layer_source ! top source layer copied to dest - integer :: top_layer_dest ! top dest layer receiving data from source - integer :: source_layer ! current source layer in copy - integer :: dest_layer ! current dest layer in copy - - character(len=*), parameter :: subname = 'interp_multilevel' - !----------------------------------------------------------------------- - - num_source = size(data_source) - num_dest = size(data_dest) - num_snow_layers_source = this%num_snow_layers_source(index_dest) - SHR_ASSERT(num_snow_layers_source >= 0, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(num_snow_layers_source <= num_source, errMsg(sourcefile, __LINE__)) - - if (num_dest >= num_source) then - ! Copy all source layers to dest (even non-existent snow layers) - top_layer_source = 1 - top_layer_dest = 1 + (num_dest - num_source) - else if (num_dest >= num_snow_layers_source) then - ! Copy all existing source layers to dest, plus as many non-existing layers as will fit - top_layer_dest = 1 - top_layer_source = 1 + (num_source - num_dest) - else - ! num_dest < num_snow_layers_source. Copy as many existing layers from source as - ! will fit in dest, starting at the top of the snow pack. - top_layer_dest = 1 - top_layer_source = num_source - num_snow_layers_source + 1 - end if - - do dest_layer = 1, (top_layer_dest - 1) - data_dest(dest_layer) = 0._r8 - end do - - source_layer = top_layer_source - do dest_layer = top_layer_dest, num_dest - data_dest(dest_layer) = data_source(source_layer) - source_layer = source_layer + 1 - end do - - end subroutine interp_multilevel - - !----------------------------------------------------------------------- - pure function get_description(this) result(description) - ! - ! !DESCRIPTION: - ! Returns a text description of this interpolator - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=:), allocatable :: description ! function result - class(interp_multilevel_snow_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_description' - !----------------------------------------------------------------------- - - description = 'Copy snow-covered levels using '//this%num_layers_name - - end function get_description - -end module initInterpMultilevelSnow diff --git a/src/init_interp/initInterpMultilevelSplit.F90 b/src/init_interp/initInterpMultilevelSplit.F90 deleted file mode 100644 index fa082b85f4..0000000000 --- a/src/init_interp/initInterpMultilevelSplit.F90 +++ /dev/null @@ -1,209 +0,0 @@ -module initInterpMultilevelSplit - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a class for handling multi-level fields by doing two different - ! interpolations: One for some first set of levels, and a different one for some second - ! set of levels. - ! - ! !USES: -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use initInterpMultilevelBase , only : interp_multilevel_type - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_split_type - - type, extends(interp_multilevel_type) :: interp_multilevel_split_type - private - class(interp_multilevel_type), pointer :: interpolator_first_levels => null() - class(interp_multilevel_type), pointer :: interpolator_second_levels => null() - integer :: num_second_levels_source - integer :: num_second_levels_dest - contains - ! Public methods - procedure :: check_npts - procedure :: interp_multilevel - procedure :: get_description - end type interp_multilevel_split_type - - ! Constructor - ! NOTE(wjs, 2015-10-23) This is given a different name from - ! interp_multilevel_split_type because some compilers (in particular intel 15.0.1) had - ! trouble distinguishing between the user-defined constructor and the default structure - ! constructor. I'm not sure if this is a compiler bug or not. - public :: create_interp_multilevel_split_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function create_interp_multilevel_split_type( & - interpolator_first_levels, interpolator_second_levels, & - num_second_levels_source, num_second_levels_dest) & - result(this) - ! - ! !DESCRIPTION: - ! Construct an interp_multilevel_split_type object. - ! - ! interpolator_first_levels gives the interpolator for the first set of levels (1:nsrc - ! and 1:ndst); interpolator_second_levels gives the interpolator for the second set of - ! levels (nsrc+1:msrc and ndst+1:mdst). - ! - ! You must specify the number of levels in the *second* set of levels for the source - ! and dest (i.e., the number of levels that are used by interpolator_second_levels). - ! (In principle, the number of levels in the *first* set of levels can then vary from - ! one call to interp_multilevel to another.) - ! - ! NOTE(wjs, 2015-10-23) This is given a different name from - ! interp_multilevel_split_type because some compilers (in particular intel 15.0.1) had - ! trouble distinguishing between the user-defined constructor and the default structure - ! constructor. I'm not sure if this is a compiler bug or not. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_split_type) :: this ! function result - class(interp_multilevel_type), target, intent(in) :: interpolator_first_levels - class(interp_multilevel_type), target, intent(in) :: interpolator_second_levels - integer, intent(in) :: num_second_levels_source - integer, intent(in) :: num_second_levels_dest - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'create_interp_multilevel_split_type' - !----------------------------------------------------------------------- - - if (num_second_levels_source <= 0) then - write(iulog,*) "For interp_multilevel_split_type, num_second_levels_source must be > 0" - write(iulog,*) "num_second_levels_source = ", num_second_levels_source - call endrun(msg="num_second_levels_source must be > 0 "//errMsg(sourcefile, __LINE__)) - end if - if (num_second_levels_dest <= 0) then - write(iulog,*) "For interp_multilevel_split_type, num_second_levels_dest must be > 0" - write(iulog,*) "num_second_levels_dest = ", num_second_levels_dest - call endrun(msg="num_second_levels_dest must be > 0 "//errMsg(sourcefile, __LINE__)) - end if - - this%interpolator_first_levels => interpolator_first_levels - this%interpolator_second_levels => interpolator_second_levels - this%num_second_levels_source = num_second_levels_source - this%num_second_levels_dest = num_second_levels_dest - - end function create_interp_multilevel_split_type - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine check_npts(this, npts, varname) - ! - ! !DESCRIPTION: - ! Checks the number of destination points, to ensure that this interpolator is - ! appropriate for this variable. This should be called once for each variable. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_split_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_npts' - !----------------------------------------------------------------------- - - call this%interpolator_first_levels%check_npts(npts, varname) - call this%interpolator_second_levels%check_npts(npts, varname) - end subroutine check_npts - - !----------------------------------------------------------------------- - pure function get_description(this) result(description) - ! - ! !DESCRIPTION: - ! Returns a text description of this interpolator - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=:), allocatable :: description ! function result - class(interp_multilevel_split_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_description' - !----------------------------------------------------------------------- - - description = 'Split levels: ' // & - trim(this%interpolator_first_levels%get_description()) // & - ' + ' // & - trim(this%interpolator_second_levels%get_description()) - - end function get_description - - !----------------------------------------------------------------------- - subroutine interp_multilevel(this, data_dest, data_source, index_dest) - ! - ! !DESCRIPTION: - ! Interpolates a multi-level field from source to dest, for a single point. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(interp_multilevel_split_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - ! - ! !LOCAL VARIABLES: - integer :: num_first_levels_dest - integer :: num_first_levels_source - - character(len=*), parameter :: subname = 'interp_multilevel' - !----------------------------------------------------------------------- - - num_first_levels_dest = size(data_dest) - this%num_second_levels_dest - num_first_levels_source = size(data_source) - this%num_second_levels_source - - if (num_first_levels_source <= 0) then - write(iulog,*) "For interp_multilevel_split_type, num_first_levels_source must be > 0" - write(iulog,*) "num_first_levels_source = ", num_first_levels_source - call endrun(msg="num_first_levels_source must be > 0 "//errMsg(sourcefile, __LINE__)) - end if - if (num_first_levels_dest <= 0) then - write(iulog,*) "For interp_multilevel_split_type, num_first_levels_dest must be > 0" - write(iulog,*) "num_first_levels_dest = ", num_first_levels_dest - call endrun(msg="num_first_levels_dest must be > 0 "//errMsg(sourcefile, __LINE__)) - end if - - call this%interpolator_first_levels%interp_multilevel( & - data_dest = data_dest(1:num_first_levels_dest), & - data_source = data_source(1:num_first_levels_source), & - index_dest = index_dest) - - call this%interpolator_second_levels%interp_multilevel( & - data_dest = data_dest((num_first_levels_dest+1):size(data_dest)), & - data_source = data_source((num_first_levels_source+1):size(data_source)), & - index_dest = index_dest) - - end subroutine interp_multilevel - - -end module initInterpMultilevelSplit diff --git a/src/init_interp/initInterpUtils.F90 b/src/init_interp/initInterpUtils.F90 deleted file mode 100644 index 13fa17f28a..0000000000 --- a/src/init_interp/initInterpUtils.F90 +++ /dev/null @@ -1,112 +0,0 @@ -module initInterpUtils - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module contains various utilities used by initInterp - ! - ! !USES: - - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use ncdio_pio , only: file_desc_t, ncd_inqdlen, ncd_inqdid, ncd_io - use abortutils , only: endrun - - implicit none - private - save - - ! Public methods - - public :: glc_elevclasses_are_same ! Function that determines whether the glacier elevation classes are the same in the input and output files - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - logical function glc_elevclasses_are_same(ncidi, ncido) - ! - ! !DESCRIPTION: - ! Determines if the glacier elevation classes are the same in ncidi and ncido - ! - ! Returns .true. if they are the same (i.e., same number and bounds of elevation - ! classes, within roundoff), false if not. - ! - ! !ARGUMENTS: - type(file_desc_t) , intent(inout) :: ncidi - type(file_desc_t) , intent(inout) :: ncido - ! - ! !LOCAL VARIABLES: - integer :: dimid_dummy - logical :: dimexist - integer :: glc_nec_input - integer :: glc_nec_output - logical :: readvar - real(r8), pointer :: elevclass_bounds_input(:) - real(r8), pointer :: elevclass_bounds_output(:) - integer :: elevclass - - real(r8), parameter :: bounds_tol = 1.e-4_r8 ! tolerance for checking equality of elevclass bounds - - character(len=*), parameter :: subname = 'glc_elevclasses_are_same' - !----------------------------------------------------------------------- - - ! BACKWARDS_COMPATIBILITY(wjs, 2018-03-19) Old restart files generated from - ! configurations with istice rather than istice_mec don't have a 'glc_nec' dimension. - ! Users may still be using files generated like that. The value of this function - ! should be irrelevant in that case. We can remove this code once we can rely on all - ! users' finidat files having been generated from configurations with istice_mec. - call ncd_inqdid(ncidi, 'glc_nec', dimid_dummy, dimexist=dimexist) - if (.not. dimexist) then - glc_elevclasses_are_same = .false. - return - end if - - call ncd_inqdlen(ncido, dimid_dummy, glc_nec_output, name='glc_nec') - call ncd_inqdlen(ncidi, dimid_dummy, glc_nec_input, name='glc_nec') - - if (glc_nec_input == glc_nec_output) then - allocate(elevclass_bounds_input(0:glc_nec_input)) - allocate(elevclass_bounds_output(0:glc_nec_output)) - call ncd_io(ncid=ncido, varname='glc_elevclass_bounds', & - data=elevclass_bounds_output, flag='read', readvar=readvar) - if (.not. readvar) then - call endrun('glc_elevclass_bounds not found on output file ' // & - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncidi, varname='glc_elevclass_bounds', & - data=elevclass_bounds_input, flag='read', readvar=readvar) - if (.not. readvar) then - ! BACKWARDS_COMPATIBILITY(wjs, 2018-03-19) Older restart files don't have this - ! variable, but it's safe to assume that any old restart file was generated - ! with the current elevation class bounds, as given below. Once we can rely on - ! old restart files having the glc_elevclass_bounds variable, we should replace - ! this hard-coded setting with a call to endrun, as we have for ncido. - if (glc_nec_input == 10) then - elevclass_bounds_input = [0._r8, 200._r8, 400._r8, 700._r8, 1000._r8, & - 1300._r8, 1600._r8, 2000._r8, 2500._r8, 3000._r8, 10000._r8] - else - call endrun('glc_elevclass_bounds not found on input file ' // & - errMsg(sourcefile, __LINE__)) - end if - end if - - glc_elevclasses_are_same = .true. - do elevclass = 0, glc_nec_input - if (abs(elevclass_bounds_input(elevclass) - elevclass_bounds_output(elevclass)) & - > bounds_tol) then - glc_elevclasses_are_same = .false. - end if - end do - - deallocate(elevclass_bounds_input) - deallocate(elevclass_bounds_output) - - else ! glc_nec_input /= glc_nec_output - glc_elevclasses_are_same = .false. - end if - - end function glc_elevclasses_are_same - -end module initInterpUtils diff --git a/src/init_interp/test/CMakeLists.txt b/src/init_interp/test/CMakeLists.txt deleted file mode 100644 index e7724fadf2..0000000000 --- a/src/init_interp/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(initInterpMindist_test) -add_subdirectory(initInterpMultilevel_test) -add_subdirectory(initInterpUtils_test) diff --git a/src/init_interp/test/initInterpMindist_test/CMakeLists.txt b/src/init_interp/test/initInterpMindist_test/CMakeLists.txt deleted file mode 100644 index 03d669ef34..0000000000 --- a/src/init_interp/test/initInterpMindist_test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set (pfunit_sources - test_set_mindist.pf - test_set_single_match.pf - initInterpMindistTestUtils.pf) - -create_pFUnit_test(initInterpMindist test_initInterpMindist_exe - "${pfunit_sources}" "") - -target_link_libraries(test_initInterpMindist_exe clm csm_share) \ No newline at end of file diff --git a/src/init_interp/test/initInterpMindist_test/initInterpMindistTestUtils.pf b/src/init_interp/test/initInterpMindist_test/initInterpMindistTestUtils.pf deleted file mode 100644 index 009f4438bc..0000000000 --- a/src/init_interp/test/initInterpMindist_test/initInterpMindistTestUtils.pf +++ /dev/null @@ -1,136 +0,0 @@ -module initInterpMindistTestUtils - - ! Utilities to aid the testing of initInterpMindist - - use pfunit_mod - use shr_kind_mod , only : r8 => shr_kind_r8 - use initInterpMindist, only : subgrid_type, subgrid_special_indices_type - use glcBehaviorMod, only: glc_behavior_type - use unittestSubgridMod, only : bounds - use unittestArrayMod, only: grc_array - - implicit none - private - - public :: create_subgrid_info - public :: create_glc_behavior - - type(subgrid_special_indices_type), parameter, public :: subgrid_special_indices = & - subgrid_special_indices_type( & - ipft_not_vegetated = 0, & - icol_vegetated_or_bare_soil = 10, & - ilun_vegetated_or_bare_soil = 3, & - ilun_crop = 4, & - ilun_landice_multiple_elevation_classes = 5) - - ! value we can use for a special landunit; note that this just needs to differ from - ! ilun_vegetated_or_bare_soil and from ilun_crop - integer, parameter, public :: ilun_special = 6 - -contains - - !----------------------------------------------------------------------- - function create_subgrid_info(npts, name, lat, lon, & - beg, ptype, ctype, ltype, topoglc) & - result(subgrid_info) - ! - ! !ARGUMENTS: - type(subgrid_type) :: subgrid_info ! function result - integer, intent(in) :: npts - character(len=*), intent(in) :: name - real(r8), intent(in) :: lat(:) - real(r8), intent(in) :: lon(:) - integer, intent(in), optional :: beg ! beginning index; if not provided, assumed to be 1 (should be provided for output, not needed for input) - integer, intent(in), optional :: ptype(:) - integer, intent(in), optional :: ctype(:) - integer, intent(in), optional :: ltype(:) - real(r8), intent(in), optional :: topoglc(:) - ! - ! !LOCAL VARIABLES: - integer :: l_beg ! local version of beg - integer :: l_end ! ending index - - character(len=*), parameter :: subname = 'create_subgrid_info' - !----------------------------------------------------------------------- - - if (present(beg)) then - l_beg = beg - else - l_beg = 1 - end if - l_end = l_beg + npts - 1 - - ! Check array lengths - @assertEqual(npts, size(lat)) - @assertEqual(npts, size(lon)) - if (present(ptype)) then - @assertEqual(npts, size(ptype)) - end if - if (present(ctype)) then - @assertEqual(npts, size(ctype)) - end if - if (present(ltype)) then - @assertEqual(npts, size(ltype)) - end if - if (present(topoglc)) then - @assertEqual(npts, size(topoglc)) - end if - - ! Set subgrid_info components - - subgrid_info%name = name - - allocate(subgrid_info%lat(l_beg:l_end)) - subgrid_info%lat = lat - allocate(subgrid_info%lon(l_beg:l_end)) - subgrid_info%lon = lon - allocate(subgrid_info%coslat(l_beg:l_end)) - subgrid_info%coslat = cos(subgrid_info%lat) - - if (present(ptype)) then - allocate(subgrid_info%ptype(l_beg:l_end)) - subgrid_info%ptype = ptype - end if - if (present(ctype)) then - allocate(subgrid_info%ctype(l_beg:l_end)) - subgrid_info%ctype = ctype - end if - if (present(ltype)) then - allocate(subgrid_info%ltype(l_beg:l_end)) - subgrid_info%ltype = ltype - end if - if (present(topoglc)) then - allocate(subgrid_info%topoglc(l_beg:l_end)) - subgrid_info%topoglc = topoglc - end if - - end function create_subgrid_info - - !----------------------------------------------------------------------- - function create_glc_behavior(collapse_to_atm_topo) result(glc_behavior) - ! - ! !DESCRIPTION: - ! Creates a glc_behavior instance with the given collapse_to_atm_topo behavior set - ! for all grid cells. - ! - ! Must be called *after* setting up the subgrid structure. - ! - ! Note that collapse_to_atm_topo is the only aspect of glc_behavior that is relevant - ! for the unit tests in this module. - ! - ! !ARGUMENTS: - type(glc_behavior_type) :: glc_behavior ! function result - logical, intent(in) :: collapse_to_atm_topo - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'create_glc_behavior' - !----------------------------------------------------------------------- - - call glc_behavior%InitSetDirectly(bounds%begg, bounds%endg, & - has_virtual_columns = grc_array(.false.), & - collapse_to_atm_topo = grc_array(collapse_to_atm_topo)) - - end function create_glc_behavior - -end module initInterpMindistTestUtils diff --git a/src/init_interp/test/initInterpMindist_test/test_set_mindist.pf b/src/init_interp/test/initInterpMindist_test/test_set_mindist.pf deleted file mode 100644 index 9b291a8994..0000000000 --- a/src/init_interp/test/initInterpMindist_test/test_set_mindist.pf +++ /dev/null @@ -1,849 +0,0 @@ -module test_set_mindist - - ! Tests of initInterpMindist: set_mindist - - use pfunit_mod - use initInterpMindist - use initInterpMindistTestUtils, only : create_subgrid_info, create_glc_behavior - use initInterpMindistTestUtils, only : subgrid_special_indices, ilun_special - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon , only: spval - use unittestSimpleSubgridSetupsMod - use unittestSubgridMod - use glcBehaviorMod, only: glc_behavior_type - - implicit none - - @TestCase - type, extends(TestCase) :: TestSetMindist - contains - procedure :: setUp - procedure :: tearDown - end type TestSetMindist - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Utility routines - ! ======================================================================== - - - subroutine setUp(this) - class(TestSetMindist), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestSetMindist), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine wrap_set_mindist(subgridi, subgrido, mindist_index, activei, activeo, & - glc_behavior, glc_elevclasses_same, fill_missing_with_natveg) - ! Wrap the call to set_mindist. - ! - ! If activei / activeo are not provided, they are assumed to be .true. for all points. - ! - ! If glc_behavior is not present, it is assumed to have collapse_to_atm_topo false - ! for all grid cells. - ! - ! If glc_elevclasses_same is not present, it is assumed to be true. - ! - ! If fill_missing_with_natveg is not provided, it is assumed to be false - - ! Arguments: - type(subgrid_type), intent(in) :: subgridi - type(subgrid_type), intent(in) :: subgrido - integer, intent(out) :: mindist_index(:) - logical, intent(in), optional :: activei(:) - logical, intent(in), optional :: activeo(:) - type(glc_behavior_type), intent(in), optional :: glc_behavior - logical, intent(in), optional :: glc_elevclasses_same - logical, intent(in), optional :: fill_missing_with_natveg - - ! Local variables: - integer :: npts_i, npts_o - integer :: bego, endo - logical, allocatable :: l_activei(:) - logical, allocatable :: l_activeo(:) - type(glc_behavior_type) :: l_glc_behavior - logical :: l_glc_elevclasses_same - logical :: l_fill_missing_with_natveg - - !----------------------------------------------------------------------- - - npts_i = size(subgridi%lon) - npts_o = size(subgrido%lon) - bego = lbound(subgrido%lon, 1) - endo = ubound(subgrido%lon, 1) - - @assertEqual(npts_o, size(mindist_index)) - - if (present(activei)) then - @assertEqual(npts_i, size(activei)) - l_activei = activei - else - allocate(l_activei(npts_i)) - l_activei = .true. - end if - - if (present(activeo)) then - @assertEqual(npts_o, size(activeo)) - l_activeo = activeo - else - allocate(l_activeo(npts_o)) - l_activeo = .true. - end if - - if (present(glc_behavior)) then - l_glc_behavior = glc_behavior - else - l_glc_behavior = create_glc_behavior(collapse_to_atm_topo = .false.) - end if - - if (present(glc_elevclasses_same)) then - l_glc_elevclasses_same = glc_elevclasses_same - else - l_glc_elevclasses_same = .true. - end if - - if (present(fill_missing_with_natveg)) then - l_fill_missing_with_natveg = fill_missing_with_natveg - else - l_fill_missing_with_natveg = .false. - end if - - call set_mindist(begi = 1, endi = npts_i, bego = bego, endo = endo, & - activei = l_activei, activeo = l_activeo, subgridi = subgridi, subgrido = subgrido, & - subgrid_special_indices = subgrid_special_indices, & - glc_behavior = l_glc_behavior, & - glc_elevclasses_same = l_glc_elevclasses_same, & - fill_missing_with_natveg = l_fill_missing_with_natveg, & - mindist_index = mindist_index) - - end subroutine wrap_set_mindist - - !----------------------------------------------------------------------- - subroutine setup_and_run_glcmec(ptype_o, ctype_o, topoglc_o, & - ptype_i, ctype_i, topoglc_i, & - collapse_to_atm_topo, glc_elevclasses_same, & - mindist_index_p, mindist_index_c, & - ltype_diff_i) - ! - ! !DESCRIPTION: - ! Does all the work needed to setup and run wrap_set_mindist for a single glcmec - ! output point. - ! - ! Gives both the mindist patch and column for that output point. - ! - ! Some assumptions: - ! - All input points are from the same gridcell, with the same lat/lon as the output - ! point - ! - There is one patch for each column - ! - ! !ARGUMENTS: - integer, intent(in) :: ptype_o ! patch type of the output point - integer, intent(in) :: ctype_o ! col type of the output point - real(r8), intent(in) :: topoglc_o ! topographic height of the output point - integer, intent(in) :: ptype_i(:) ! patch type of each input point - integer, intent(in) :: ctype_i(:) ! col type of each input point - real(r8), intent(in) :: topoglc_i(:) ! topographic height of each input point - logical, intent(in) :: collapse_to_atm_topo - logical, intent(in) :: glc_elevclasses_same - integer, intent(out) :: mindist_index_p - integer, intent(out) :: mindist_index_c - - ! If present, this gives the difference in ltype from ltype_glcmec for each input - ! point. So, for example, if this is an array [-1, 0, 1] then the input ltypes will - ! be [ltype_glcmec-1, ltype_glcmec, ltype_glcmec+1]. If absent, all input points have - ! type ltype_glcmec. - integer, intent(in), optional :: ltype_diff_i(:) - - ! - ! !LOCAL VARIABLES: - integer, parameter :: ltype_glcmec = subgrid_special_indices%ilun_landice_multiple_elevation_classes - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: num_i - integer, allocatable :: ltype_i(:) - real(r8), allocatable :: lat_i(:) - real(r8), allocatable :: lon_i(:) - type(subgrid_type) :: subgridi_c, subgrido_c, subgridi_p, subgrido_p - type(glc_behavior_type) :: glc_behavior - integer :: mindist_index_p_arr(1) - integer :: mindist_index_c_arr(1) - - character(len=*), parameter :: subname = 'setup_and_run_glcmec' - !----------------------------------------------------------------------- - - ! Note that we assume the same number of patches as columns (i.e., one patch per - ! column) - num_i = size(ptype_i) - @assertEqual(num_i, size(ctype_i)) - @assertEqual(num_i, size(topoglc_i)) - if (present(ltype_diff_i)) then - @assertEqual(num_i, size(ltype_diff_i)) - end if - - call setup_landunit_ncols(ltype=ltype_glcmec, & - ctypes=[ctype_o], & - cweights=[1._r8], & - ptype=ptype_o) - - subgrido_c = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [ctype_o], & - ltype = [ltype_glcmec], & - lat = [my_lat], & - lon = [my_lon], & - topoglc = [topoglc_o]) - subgrido_p = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [ptype_o], & - ctype = [ctype_o], & - ltype = [ltype_glcmec], & - lat = [my_lat], & - lon = [my_lon], & - topoglc = [topoglc_o]) - - allocate(ltype_i(num_i)) - allocate(lat_i(num_i)) - allocate(lon_i(num_i)) - if (present(ltype_diff_i)) then - ltype_i(:) = ltype_glcmec + ltype_diff_i(:) - else - ltype_i(:) = ltype_glcmec - end if - lat_i(:) = my_lat - lon_i(:) = my_lon - - subgridi_c = create_subgrid_info( & - npts = num_i, & - name = 'column', & - ctype = ctype_i, & - ltype = ltype_i, & - lat = lat_i, & - lon = lon_i, & - topoglc = topoglc_i) - subgridi_p = create_subgrid_info( & - npts = num_i, & - name = 'pft', & - ptype = ptype_i, & - ctype = ctype_i, & - ltype = ltype_i, & - lat = lat_i, & - lon = lon_i, & - topoglc = topoglc_i) - - glc_behavior = create_glc_behavior(collapse_to_atm_topo) - - call wrap_set_mindist(subgridi_c, subgrido_c, mindist_index_c_arr, & - glc_behavior = glc_behavior, glc_elevclasses_same = glc_elevclasses_same) - call wrap_set_mindist(subgridi_p, subgrido_p, mindist_index_p_arr, & - glc_behavior = glc_behavior, glc_elevclasses_same = glc_elevclasses_same) - - mindist_index_c = mindist_index_c_arr(1) - mindist_index_p = mindist_index_p_arr(1) - - end subroutine setup_and_run_glcmec - - - ! ======================================================================== - ! Tests - ! ======================================================================== - - - @Test - subroutine multipleTypes_findsSameType(this) - ! If there are multiple types in the input, all equidistant from the target point, - ! then make sure we find the point with the same type. - ! - ! This tests a column-level point - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - call setup_landunit_ncols(ltype=my_ltype, & - ctypes=[my_ctype], & - cweights=[1._r8]) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - ! Input points differ in either column type or landunit type - subgridi = create_subgrid_info( & - npts = 5, & - name = 'column', & - ctype = [my_ctype-1, my_ctype, my_ctype, my_ctype, my_ctype + 1], & - ltype = [my_ltype, my_ltype-1, my_ltype, my_ltype+1, my_ltype], & - lat = [(my_lat, i=1,5)], & - lon = [(my_lon, i=1,5)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index) - - @assertEqual(3, mindist_index(1)) - - end subroutine multipleTypes_findsSameType - - @Test - subroutine glcmec_elevclassesSame_findsSameColType(this) - ! When glc elevation classes are the same between input and output: Choose - ! column/patch from the same column type, even if it isn't the one with the closest - ! topographic height. - ! - ! This tests both column-level and patch-level - class(TestSetMindist), intent(inout) :: this - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ptype = 25 - real(r8), parameter :: my_topo = 1000._r8 - integer :: i - integer :: mindist_index_c, mindist_index_p - - ! Note that: - ! - all input ptypes are the same as output ptype - ! - all input ctypes are different, with one of them matching the output ctype - ! - the matching input ctype has the most different topographic height - call setup_and_run_glcmec( & - ptype_o = my_ptype, & - ctype_o = my_ctype, & - topoglc_o = my_topo, & - ptype_i = [my_ptype, my_ptype, my_ptype, my_ptype], & - ctype_i = [my_ctype-2, my_ctype-1, my_ctype, my_ctype+1], & - topoglc_i = [my_topo - 10._r8, my_topo - 1._r8, my_topo + 100._r8, my_topo], & - collapse_to_atm_topo = .false., & - glc_elevclasses_same = .true., & - mindist_index_p = mindist_index_p, & - mindist_index_c = mindist_index_c) - - @assertEqual(3, mindist_index_c) - @assertEqual(3, mindist_index_p) - end subroutine glcmec_elevclassesSame_findsSameColType - - @Test - subroutine glcmec_elevclassesSame_findsSamePatchType(this) - ! When glc elevation classes are the same between input and output: Choose patch from - ! the same patch type, even if it isn't the one with the closest topographic height. - ! - ! This tests just patch-level - class(TestSetMindist), intent(inout) :: this - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ptype = 25 - real(r8), parameter :: my_topo = 1000._r8 - integer :: i - integer :: mindist_index_c, mindist_index_p - - ! Note that: - ! - all input ptypes are different, with one of them matching the output ptype - ! - all input ctypes are the same as output ctype (this probably shouldn't happen in - ! practice, but is useful for testing the code logic) - ! - the matching input ptype has the most different topographic height - call setup_and_run_glcmec( & - ptype_o = my_ptype, & - ctype_o = my_ctype, & - topoglc_o = my_topo, & - ptype_i = [my_ptype-2, my_ptype-1, my_ptype, my_ptype+1], & - ctype_i = [my_ctype, my_ctype, my_ctype, my_ctype], & - topoglc_i = [my_topo - 10._r8, my_topo - 1._r8, my_topo + 100._r8, my_topo], & - collapse_to_atm_topo = .false., & - glc_elevclasses_same = .true., & - mindist_index_p = mindist_index_p, & - mindist_index_c = mindist_index_c) - - ! Note that we don't assert anything about mindist_index_c in this case: the behavior - ! of mindist_index_c is not defined, since there are multiple input columns with the - ! same type. (We don't expect this situation of having multiple input columns with - ! the same type to arise in practice, so we haven't defined the behavior of this - ! case.) - @assertEqual(3, mindist_index_p) - end subroutine glcmec_elevclassesSame_findsSamePatchType - - @Test - subroutine glcmec_elevclassesDiffer_findsClosestHeight(this) - ! When glc elevation classes differ between input and output: Ignore column and pft - ! types; if there are multiple glc_mec points that are equidistant in space, pick the - ! one with the closest height - ! - ! This tests both column-level and patch-level - class(TestSetMindist), intent(inout) :: this - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ptype = 25 - real(r8), parameter :: my_topo = 1000._r8 - integer :: i - integer :: mindist_index_c, mindist_index_p - - ! Note that we use different ptype and ctype values for the target point: these should - ! be ignored in this case. However, ltype should *not* be ignored (and thus we should - ! *not* pick the third point). - call setup_and_run_glcmec( & - ptype_o = my_ptype, & - ctype_o = my_ctype, & - topoglc_o = my_topo, & - ptype_i = [my_ptype, my_ptype-1, my_ptype, my_ptype], & - ctype_i = [my_ctype, my_ctype-1, my_ctype, my_ctype], & - ltype_diff_i = [0, 0, -1, 0], & - topoglc_i = [my_topo - 10._r8, my_topo - 1._r8, my_topo, my_topo + 100._r8], & - collapse_to_atm_topo = .false., & - glc_elevclasses_same = .false., & - mindist_index_p = mindist_index_p, & - mindist_index_c = mindist_index_c) - - @assertEqual(2, mindist_index_c) - @assertEqual(2, mindist_index_p) - end subroutine glcmec_elevclassesDiffer_findsClosestHeight - - @Test - subroutine glcmec_collapseToAtmTopo_findsClosestHeight(this) - ! For an output glcmec point with the collapse_to_atm_topo behavior: Ignore column and - ! pft types; if there are multiple glc_mec points that are equidistant in space, pick - ! the one with the closest height - ! - ! This tests both column-level and patch-level - class(TestSetMindist), intent(inout) :: this - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ptype = 25 - real(r8), parameter :: my_topo = 1000._r8 - integer :: i - integer :: mindist_index_c, mindist_index_p - - ! Note that we use different ptype and ctype values for the target point: these should - ! be ignored in this case. However, ltype should *not* be ignored (and thus we should - ! *not* pick the third point). - call setup_and_run_glcmec( & - ptype_o = my_ptype, & - ctype_o = my_ctype, & - topoglc_o = my_topo, & - ptype_i = [my_ptype, my_ptype-1, my_ptype, my_ptype], & - ctype_i = [my_ctype, my_ctype-1, my_ctype, my_ctype], & - ltype_diff_i = [0, 0, -1, 0], & - topoglc_i = [my_topo - 10._r8, my_topo - 1._r8, my_topo, my_topo + 100._r8], & - collapse_to_atm_topo = .true., & - glc_elevclasses_same = .true., & - mindist_index_p = mindist_index_p, & - mindist_index_c = mindist_index_c) - - @assertEqual(2, mindist_index_c) - @assertEqual(2, mindist_index_p) - end subroutine glcmec_collapseToAtmTopo_findsClosestHeight - - @Test - subroutine glcmec_elevclassesDiffer_findsClosestLatlon(this) - ! For glc_mec, if we have some points closer in topographic height, but others closer - ! in x-y space, pick the closer point in x-y space - - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - type(glc_behavior_type) :: glc_behavior - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = subgrid_special_indices%ilun_landice_multiple_elevation_classes - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - real(r8), parameter :: my_topo = 1000._r8 - integer :: i - integer :: mindist_index(1) - - call setup_landunit_ncols(ltype=my_ltype, & - ctypes=[my_ctype], & - cweights=[1._r8]) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon], & - topoglc = [my_topo]) - - subgridi = create_subgrid_info( & - npts = 3, & - name = 'column', & - ctype = [my_ctype, my_ctype, my_ctype], & - ltype = [my_ltype, my_ltype, my_ltype], & - lat = [my_lat - 10._r8, my_lat - 1._r8, my_lat + 10._r8], & - lon = [(my_lon, i=1,3)], & - topoglc = [my_topo, my_topo - 100._r8, my_topo]) - - glc_behavior = create_glc_behavior(collapse_to_atm_topo = .false.) - - call wrap_set_mindist(subgridi, subgrido, mindist_index, & - glc_behavior = glc_behavior, glc_elevclasses_same = .false.) - - @assertEqual(2, mindist_index(1)) - end subroutine glcmec_elevclassesDiffer_findsClosestLatlon - - @Test - subroutine noncropToCrop_patchVariable_usesCorrectPft(this) - ! For interpolation from a non-crop case to a crop case, ensure that a patch-level - ! variable takes its input from the correct pft. This simulates what happens to the - ! generic crop type in this case. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ptype = 5 - integer :: my_ctype - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - icol_natveg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_natveg => subgrid_special_indices%ilun_vegetated_or_bare_soil, & - ilun_crop => subgrid_special_indices%ilun_crop & - ) - - my_ctype = icol_natveg + 1 ! arbitrary; we just want this to differ from icol_natveg - - call setup_landunit_ncols(ltype=ilun_crop, & - ctypes=[my_ctype], & - cweights=[1._r8], & - ptype=my_ptype) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [my_ptype], & - ctype = [my_ctype], & - ltype = [ilun_crop], & - lat = [my_lat], & - lon = [my_lon]) - - ! Input point #2 has the same ptype, but a different ctype and ltype. This one should - ! be chosen. Other input points differ in ptype. - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [my_ptype - 1, my_ptype, my_ptype + 1], & - ctype = [icol_natveg, icol_natveg, icol_natveg], & - ltype = [ilun_natveg, ilun_natveg, ilun_natveg], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine noncropToCrop_patchVariable_usesCorrectPft - - @Test - subroutine cropToNoncrop_patchVariable_usesCorrectPft(this) - ! For interpolation from a crop case to a non-crop case, ensure that a patch-level - ! variable takes its input from the correct pft. This simulates what happens to the - ! generic crop type in this case. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ptype = 5 - integer :: input_ctype - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - icol_natveg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_natveg => subgrid_special_indices%ilun_vegetated_or_bare_soil, & - ilun_crop => subgrid_special_indices%ilun_crop & - ) - - call setup_landunit_ncols(ltype=ilun_natveg, & - ctypes=[icol_natveg], & - cweights=[1._r8], & - ptype=my_ptype) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [my_ptype], & - ctype = [icol_natveg], & - ltype = [ilun_natveg], & - lat = [my_lat], & - lon = [my_lon]) - - input_ctype = icol_natveg + 1 ! arbitrary; we just want this to differ from icol_natveg - - ! Input point #2 has the same ptype, but a different ctype and ltype. This one should - ! be chosen. Other input points differ in ptype. - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [my_ptype - 1, my_ptype, my_ptype + 1], & - ctype = [input_ctype, input_ctype, input_ctype], & - ltype = [ilun_crop, ilun_crop, ilun_crop], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine cropToNoncrop_patchVariable_usesCorrectPft - - @Test - subroutine noncropToCrop_specificCropFromNatveg(this) - ! For interpolation from a non-crop case to a crop case, ensure that crop columns - ! take their info from the natural veg column in the input. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer :: my_ctype - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - icol_natveg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_natveg => subgrid_special_indices%ilun_vegetated_or_bare_soil, & - ilun_crop => subgrid_special_indices%ilun_crop & - ) - - my_ctype = icol_natveg + 1 ! arbitrary; we just want this to differ from icol_natveg - - call setup_landunit_ncols(ltype=ilun_crop, & - ctypes=[my_ctype], & - cweights=[1._r8]) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [ilun_crop], & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 3, & - name = 'column', & - ctype = [icol_natveg - 2, icol_natveg, icol_natveg - 1], & - ltype = [ilun_natveg - 2, ilun_natveg, ilun_natveg - 1], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - ! For most landunits, we would need to set fill_missing_with_natveg to accomplish - ! this. However, it should be done for a crop output point even with - ! fill_missing_with_natveg .false. - call wrap_set_mindist(subgridi, subgrido, mindist_index, & - fill_missing_with_natveg = .false.) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine noncropToCrop_specificCropFromNatveg - - @Test - subroutine newveg_usesBaresoil(this) - ! If there's a new vegetation (patch) type, this should take inputs from the closest - ! bare soil point. - ! - ! In terms of code coverage, this is largely redundant with - ! noncropToCrop_specificCropFromNatveg. But I'm keeping it for now since it tests a - ! different use case. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ptype = 5 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - ipft_bare => subgrid_special_indices%ipft_not_vegetated, & - icol_natveg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_natveg => subgrid_special_indices%ilun_vegetated_or_bare_soil & - ) - - call setup_landunit_ncols(ltype=ilun_natveg, & - ctypes=[icol_natveg], & - cweights=[1._r8], & - ptype=my_ptype) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [my_ptype], & - ctype = [icol_natveg], & - ltype = [ilun_natveg], & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [ipft_bare + 1, ipft_bare, ipft_bare + 2], & - ctype = [(icol_natveg, i=1,3)], & - ltype = [(ilun_natveg, i=1,3)], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - ! For most landunits, we would need to set fill_missing_with_natveg to accomplish - ! this. However, it should be done for a natural veg output point even with - ! fill_missing_with_natveg .false. - call wrap_set_mindist(subgridi, subgrido, mindist_index, & - fill_missing_with_natveg = .false.) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine newveg_usesBaresoil - - @Test - subroutine baresoil_ignoresSpecialLandunits(this) - ! This test ensures that, when finding a match for a bare soil patch, we ignore - ! special landunits. This is important because special landunits also have pft type = - ! noveg. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - ipft_bare => subgrid_special_indices%ipft_not_vegetated, & - icol_veg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_veg => subgrid_special_indices%ilun_vegetated_or_bare_soil & - ) - - call setup_landunit_ncols(ltype=ilun_veg, & - ctypes=[icol_veg], & - cweights=[1._r8], & - ptype=ipft_bare) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [ipft_bare], & - ctype = [icol_veg], & - ltype = [ilun_veg], & - lat = [my_lat], & - lon = [my_lon]) - - ! In the inputs, we use icol_veg even for special landunits, to make sure that even a - ! patch whose pft and column type indicate natural veg is ignored if its landunit - ! type is wrong. - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [ipft_bare, ipft_bare, ipft_bare], & - ctype = [icol_veg, icol_veg, icol_veg], & - ltype = [ilun_special, ilun_veg, ilun_special], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine baresoil_ignoresSpecialLandunits - - @Test - subroutine fillMissing_usesNatveg(this) - ! This test ensures that, when using fill_missing_with_natveg, the code finds a point - ! from the natural veg landunit. This is especially important to check for - ! patch-level variables, for which special landunits also use the noveg (0) pft type. - ! So here we just check a patch-level variable. - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ptype = 5 - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = ilun_special - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: i - integer :: mindist_index(1) - - associate( & - ipft_bare => subgrid_special_indices%ipft_not_vegetated, & - icol_veg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_veg => subgrid_special_indices%ilun_vegetated_or_bare_soil & - ) - - call setup_landunit_ncols(ltype=my_ltype, & - ctypes=[my_ctype], & - cweights=[1._r8], & - ptype=my_ptype) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [my_ptype], & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - ! None of the input points match the output (in ptype, ctype or ltype). The 2nd point - ! is a bare ground point, though, and so should be used as the template if we specify - ! fill_missing_with_natveg. - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [ipft_bare, ipft_bare, ipft_bare], & - ctype = [icol_veg, icol_veg, icol_veg], & - ltype = [my_ltype + 1, ilun_veg, my_ltype + 1], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index, fill_missing_with_natveg = .true.) - - @assertEqual(2, mindist_index(1)) - - end associate - end subroutine fillMissing_usesNatveg - - @Test - subroutine gridcell_findsClosestLatlon(this) - ! For gridcell-level variables, should find closest gridcell in lat-lon space - class(TestSetMindist), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer :: i - integer :: mindist_index(1) - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begg, & - name = 'gridcell', & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 3, & - name = 'gridcell', & - lat = [my_lat - 10._r8, my_lat - 1._r8, my_lat + 10._r8], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_mindist(subgridi, subgrido, mindist_index) - - @assertEqual(2, mindist_index(1)) - end subroutine gridcell_findsClosestLatlon - -end module test_set_mindist diff --git a/src/init_interp/test/initInterpMindist_test/test_set_single_match.pf b/src/init_interp/test/initInterpMindist_test/test_set_single_match.pf deleted file mode 100644 index f951a49432..0000000000 --- a/src/init_interp/test/initInterpMindist_test/test_set_single_match.pf +++ /dev/null @@ -1,359 +0,0 @@ -module test_set_single_match - - ! Tests of initInterpMindist: set_single_match - - use pfunit_mod - use initInterpMindist - use initInterpMindistTestUtils, only : create_subgrid_info, create_glc_behavior - use initInterpMindistTestUtils, only : subgrid_special_indices, ilun_special - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSimpleSubgridSetupsMod - use unittestSubgridMod - use unittestUtils, only : endrun_msg - use glcBehaviorMod, only: glc_behavior_type - - implicit none - - @TestCase - type, extends(TestCase) :: TestSetSingleMatch - contains - procedure :: setUp - procedure :: tearDown - end type TestSetSingleMatch - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Utility routines - ! ======================================================================== - - subroutine setUp(this) - class(TestSetSingleMatch), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestSetSingleMatch), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine wrap_set_single_match(subgridi, subgrido, mindist_index, activeo, & - glc_behavior) - ! Wrap the call to set_single_match - ! - ! If activeo is not provided, it is assumed to be .true. for all points - ! - ! If glc_behavior is not present, it is assumed to have collapse_to_atm_topo false - ! for all grid cells. - - ! Arguments: - type(subgrid_type), intent(in) :: subgridi - type(subgrid_type), intent(in) :: subgrido - integer, intent(out) :: mindist_index(:) - logical, intent(in), optional :: activeo(:) - type(glc_behavior_type), intent(in), optional :: glc_behavior - - ! Local variables: - integer :: npts_i, npts_o - integer :: bego, endo - logical, allocatable :: l_activeo(:) - type(glc_behavior_type) :: l_glc_behavior - - !----------------------------------------------------------------------- - - npts_i = size(subgridi%lon) - npts_o = size(subgrido%lon) - bego = lbound(subgrido%lon, 1) - endo = ubound(subgrido%lon, 1) - - @assertEqual(npts_o, size(mindist_index)) - - if (present(activeo)) then - @assertEqual(npts_o, size(activeo)) - l_activeo = activeo - else - allocate(l_activeo(npts_o)) - l_activeo = .true. - end if - - if (present(glc_behavior)) then - l_glc_behavior = glc_behavior - else - l_glc_behavior = create_glc_behavior(collapse_to_atm_topo = .false.) - end if - - call set_single_match(begi = 1, endi = npts_i, bego = bego, endo = endo, & - activeo = l_activeo, subgridi = subgridi, subgrido = subgrido, & - subgrid_special_indices = subgrid_special_indices, & - glc_behavior = l_glc_behavior, & - glc_elevclasses_same = .true., & - mindist_index = mindist_index) - - end subroutine wrap_set_single_match - - ! ======================================================================== - ! Tests - ! ======================================================================== - - @Test - subroutine singleMatch_findsMatch(this) - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - integer :: i - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - ! The target point is point 3. Both before and after the target point there are - ! points with (1) same type but different location, and (2) same location but - ! different type. - subgridi = create_subgrid_info( & - npts = 5, & - name = 'column', & - ctype = [my_ctype-1, my_ctype, my_ctype, my_ctype, my_ctype+1], & - ltype = [(my_ltype, i=1,5)], & - lat = [my_lat, my_lat+1, my_lat, my_lat-1, my_lat], & - lon = [(my_lon, i=1,5)]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index) - - @assertEqual(3, mindist_index(1)) - end subroutine singleMatch_findsMatch - - @Test - subroutine singleMatch_inactive_findsMatch(this) - ! Even if the output point is inactive, it still finds a match for this point. (This - ! is in contrast to set_mindist). - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - integer :: i - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 3, & - name = 'column', & - ctype = [my_ctype-1, my_ctype, my_ctype+1], & - ltype = [(my_ltype, i=1,3)], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index, & - activeo = [.false.]) - - @assertEqual(2, mindist_index(1)) - end subroutine singleMatch_inactive_findsMatch - - @Test - subroutine noMatches_inactive_returns0(this) - ! For an inactive point: it's okay if there are no candidate source points - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 1, & - name = 'column', & - ctype = [my_ctype+1], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index, & - activeo = [.false.]) - - @assertEqual(0, mindist_index(1)) - end subroutine noMatches_inactive_returns0 - - @Test - subroutine twoMatches_aborts(this) - ! If there are two matches for the given output point, aborts - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - integer :: i - character(len=:), allocatable :: expected_msg - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - subgridi = create_subgrid_info( & - npts = 2, & - name = 'column', & - ctype = [(my_ctype, i=1,2)], & - ltype = [(my_ltype, i=1,2)], & - lat = [(my_lat, i=1,2)], & - lon = [(my_lon, i=1,2)]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index) - - expected_msg = endrun_msg( & - 'set_single_match ERROR: found multiple input points matching output point') - @assertExceptionRaised(expected_msg) - end subroutine twoMatches_aborts - - @Test - subroutine noMatches_aborts(this) - ! For an active point: aborts if there are no candidate source points - ! - ! Note for the future: We could probably relax this requirement if we added code that - ! set subgrid areas to zero for any active point in the output for which there are no - ! matching input points. - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ctype = 15 - integer, parameter :: my_ltype = 8 - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - character(len=:), allocatable :: expected_msg - - call setup_single_veg_patch(pft_type=1) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begc, & - name = 'column', & - ctype = [my_ctype], & - ltype = [my_ltype], & - lat = [my_lat], & - lon = [my_lon]) - - ! One point differs in lat, one point differs in lon, one point differs in ctype - subgridi = create_subgrid_info( & - npts = 3, & - name = 'column', & - ctype = [my_ctype, my_ctype, my_ctype+1], & - ltype = [my_ltype, my_ltype, my_ltype], & - lat = [my_lat+1, my_lat , my_lat], & - lon = [my_lon , my_lon+1, my_lon]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index) - - expected_msg = endrun_msg( & - 'set_single_match ERROR: cannot find any input points matching output point') - @assertExceptionRaised(expected_msg) - - end subroutine noMatches_aborts - - @Test - subroutine noncropToCrop_patchVariable_aborts(this) - ! This test provides a contrast with the analogous test of set_mindist, - ! noncropToCrop_patchVariable_usesCorrectPft. For set_single_patch, in contrast to - ! set_mindist, it is an error if we try to go from a non-crop case to a crop case. - ! This is because areas won't add to 1 properly if we try to copy a crop patch from - ! the natural veg column onto a crop patch from its own crop column. - ! - ! This test also covers similar use cases, such as going from a crop case to a - ! non-crop case. - class(TestSetSingleMatch), intent(inout) :: this - type(subgrid_type) :: subgridi, subgrido - integer, parameter :: my_ptype = 5 - integer :: my_ctype - real(r8), parameter :: my_lat = 31._r8 - real(r8), parameter :: my_lon = 41._r8 - integer :: mindist_index(1) - integer :: i - character(len=:), allocatable :: expected_msg - - associate( & - icol_natveg => subgrid_special_indices%icol_vegetated_or_bare_soil, & - ilun_natveg => subgrid_special_indices%ilun_vegetated_or_bare_soil, & - ilun_crop => subgrid_special_indices%ilun_crop & - ) - - my_ctype = icol_natveg + 1 ! arbitrary; we just want this to differ from icol_natveg - - call setup_landunit_ncols(ltype=ilun_crop, & - ctypes=[my_ctype], & - cweights=[1._r8], & - ptype=my_ptype) - - subgrido = create_subgrid_info( & - npts = 1, & - beg = bounds%begp, & - name = 'pft', & - ptype = [my_ptype], & - ctype = [my_ctype], & - ltype = [ilun_crop], & - lat = [my_lat], & - lon = [my_lon]) - - ! Input point #2 has the same ptype, but a different ctype and ltype. Other input - ! points differ in ptype. With set_mindist, we would choose #2, but with - ! set_single_match we should abort. - subgridi = create_subgrid_info( & - npts = 3, & - name = 'pft', & - ptype = [my_ptype - 1, my_ptype, my_ptype + 1], & - ctype = [icol_natveg, icol_natveg, icol_natveg], & - ltype = [ilun_natveg, ilun_natveg, ilun_natveg], & - lat = [(my_lat, i=1,3)], & - lon = [(my_lon, i=1,3)]) - - call wrap_set_single_match(subgridi, subgrido, mindist_index) - - expected_msg = endrun_msg( & - 'set_single_match ERROR: cannot find any input points matching output point') - @assertExceptionRaised(expected_msg) - - end associate - end subroutine noncropToCrop_patchVariable_aborts - -end module test_set_single_match diff --git a/src/init_interp/test/initInterpMultilevel_test/CMakeLists.txt b/src/init_interp/test/initInterpMultilevel_test/CMakeLists.txt deleted file mode 100644 index d87d37529c..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set (pfunit_sources - initInterpMultilevelMock.pf - test_init_interp_multilevel_interp.pf - test_init_interp_multilevel_snow.pf - test_init_interp_multilevel_split.pf) - -# extra sources used for this test, which are not .pf files -set (extra_sources - multilevel_interp_factory.F90) - -create_pFUnit_test(initInterpMultilevel test_initInterpMultilevel_exe - "${pfunit_sources}" "${extra_sources}") - -target_link_libraries(test_initInterpMultilevel_exe clm csm_share) \ No newline at end of file diff --git a/src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf b/src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf deleted file mode 100644 index 34345e445d..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/initInterpMultilevelMock.pf +++ /dev/null @@ -1,112 +0,0 @@ -module initInterpMultilevelMock - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module defines a "mock" interpolator. All it does is assert that the - ! interp_multilevel routine is called correctly. - ! - ! !USES: - use pfunit_mod - use shr_kind_mod , only : r8 => shr_kind_r8 - use initInterpMultilevelBase , only : interp_multilevel_type - - implicit none - private - save - - ! Public types - - public :: interp_multilevel_mock_type - - type, extends(interp_multilevel_type) :: interp_multilevel_mock_type - private - character(len=:), allocatable :: name - - ! Expected arguments to interp_multilevel - real(r8), allocatable :: expected_data_dest(:) ! original values in data_dest - real(r8), allocatable :: expected_data_source(:) - integer :: expected_index_dest - contains - ! Public methods from base class - procedure :: interp_multilevel - procedure :: check_npts - procedure :: get_description - end type interp_multilevel_mock_type - - interface interp_multilevel_mock_type - module procedure constructor - end interface interp_multilevel_mock_type - -contains - - ! ======================================================================== - ! Constructors - ! ======================================================================== - - !----------------------------------------------------------------------- - function constructor(name, expected_data_dest, expected_data_source, & - expected_index_dest) result(this) - ! - ! !DESCRIPTION: - ! Creates an interp_multilevel_mock_type object - ! - ! !USES: - ! - ! !ARGUMENTS: - type(interp_multilevel_mock_type) :: this ! function result - character(len=*), intent(in) :: name ! name of this mock - real(r8) , intent(in) :: expected_data_dest(:) ! original values in data_dest - real(r8) , intent(in) :: expected_data_source(:) - integer , intent(in) :: expected_index_dest - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'constructor' - !----------------------------------------------------------------------- - - this%name = name - allocate(this%expected_data_dest(size(expected_data_dest))) - this%expected_data_dest = expected_data_dest - allocate(this%expected_data_source(size(expected_data_source))) - this%expected_data_source = expected_data_source - this%expected_index_dest = expected_index_dest - - end function constructor - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - subroutine interp_multilevel(this, data_dest, data_source, index_dest) - ! Mock version: Asserts that it is called with correct arguments - class(interp_multilevel_mock_type), intent(in) :: this - real(r8) , intent(inout) :: data_dest(:) ! not modified here, but intent(inout) to match interface - real(r8) , intent(in) :: data_source(:) - integer , intent(in) :: index_dest - - @assertEqual(size(this%expected_data_dest), size(data_dest), message=this%name//': data_dest size') - @assertEqual(this%expected_data_dest, data_dest, message=this%name//': data_dest') - @assertEqual(size(this%expected_data_source), size(data_source), message=this%name//': data_source size') - @assertEqual(this%expected_data_source, data_source, message=this%name//': data_source') - @assertEqual(this%expected_index_dest, index_dest, message=this%name//': index_dest') - - end subroutine interp_multilevel - - subroutine check_npts(this, npts, varname) - ! Stub - class(interp_multilevel_mock_type), intent(in) :: this - integer, intent(in) :: npts ! number of dest points (on this processor) - character(len=*), intent(in) :: varname ! variable name (for diagnostic output) - - ! Do nothing - end subroutine check_npts - - pure function get_description(this) result(description) - ! Stub - character(len=:), allocatable :: description ! function result - class(interp_multilevel_mock_type), intent(in) :: this - - description = ' ' - end function get_description - -end module initInterpMultilevelMock diff --git a/src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 b/src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 deleted file mode 100644 index 718b433fec..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/multilevel_interp_factory.F90 +++ /dev/null @@ -1,179 +0,0 @@ -module multilevel_interp_factory - ! Factory module for creating instances of interp_multilevel_type - - use initInterpMultilevelInterp, only : interp_multilevel_interp_type - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - private - save - - public :: create_multilevel_interp_no_levclasses - public :: create_multilevel_interp_with_levclasses - -contains - - ! ======================================================================== - ! Public routines - ! ======================================================================== - - function create_multilevel_interp_no_levclasses(coordinates_source, coordinates_dest, & - index_dest, npts_dest) & - result(interpolator) - ! Arguments: - type(interp_multilevel_interp_type) :: interpolator ! function result - real(r8), intent(in) :: coordinates_source(:) ! coordinates in source data for index_dest - real(r8), intent(in) :: coordinates_dest(:) ! coordinates in dest data for index_dest - - integer, intent(in) :: index_dest ! dest index of interest in tests - integer, intent(in) :: npts_dest ! total number of points wanted in dest - - ! Local variables: - real(r8), allocatable :: coordinates_source_all(:,:) - real(r8), allocatable :: coordinates_dest_all(:,:) - - character(len=*), parameter :: coord_varname = 'COORD' - !----------------------------------------------------------------------- - - call create_coordinate_arrays( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - coordinates_source_all = coordinates_source_all, & - coordinates_dest_all = coordinates_dest_all, & - index_dest = index_dest, & - npts_dest = npts_dest) - - interpolator = interp_multilevel_interp_type( & - coordinates_source = coordinates_source_all, & - coordinates_dest = coordinates_dest_all, & - coord_varname = coord_varname) - - end function create_multilevel_interp_no_levclasses - - function create_multilevel_interp_with_levclasses(coordinates_source, coordinates_dest, & - level_classes_source, level_classes_dest, & - index_dest, npts_dest) & - result(interpolator) - ! Arguments: - type(interp_multilevel_interp_type) :: interpolator ! function result - real(r8), intent(in) :: coordinates_source(:) ! coordinates in source data for index_dest - real(r8), intent(in) :: coordinates_dest(:) ! coordinates in dest data for index_dest - integer , intent(in) :: level_classes_source(:) ! class indices in source data for index_dest - integer , intent(in) :: level_classes_dest(:) ! class indices in dest data for index_dest - - integer, intent(in) :: index_dest ! dest index of interest in tests - integer, intent(in) :: npts_dest ! total number of points wanted in dest - - ! Local variables: - real(r8), allocatable :: coordinates_source_all(:,:) - real(r8), allocatable :: coordinates_dest_all(:,:) - integer , allocatable :: level_classes_source_all(:,:) - integer , allocatable :: level_classes_dest_all(:,:) - - character(len=*), parameter :: coord_varname = 'COORD' - !----------------------------------------------------------------------- - - call create_coordinate_arrays( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - coordinates_source_all = coordinates_source_all, & - coordinates_dest_all = coordinates_dest_all, & - index_dest = index_dest, & - npts_dest = npts_dest) - - call create_class_arrays( & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest, & - level_classes_source_all = level_classes_source_all, & - level_classes_dest_all = level_classes_dest_all, & - index_dest = index_dest, & - npts_dest = npts_dest) - - interpolator = interp_multilevel_interp_type( & - coordinates_source = coordinates_source_all, & - coordinates_dest = coordinates_dest_all, & - level_classes_source = level_classes_source_all, & - level_classes_dest = level_classes_dest_all, & - coord_varname = coord_varname) - - end function create_multilevel_interp_with_levclasses - - ! ======================================================================== - ! Private routines - ! ======================================================================== - - subroutine create_coordinate_arrays(coordinates_source, coordinates_dest, & - coordinates_source_all, coordinates_dest_all, & - index_dest, npts_dest) - ! Arguments: - real(r8), intent(in) :: coordinates_source(:) ! coordinates in source data for index_dest - real(r8), intent(in) :: coordinates_dest(:) ! coordinates in dest data for index_dest - real(r8), allocatable, intent(out) :: coordinates_source_all(:,:) - real(r8), allocatable, intent(out) :: coordinates_dest_all(:,:) - - integer, intent(in) :: index_dest ! dest index of interest in tests - integer, intent(in) :: npts_dest ! total number of points wanted in dest - - ! Local variables: - integer :: nlevels_source - integer :: nlevels_dest - - integer :: point, level - !----------------------------------------------------------------------- - - nlevels_source = size(coordinates_source) - nlevels_dest = size(coordinates_dest) - - allocate(coordinates_source_all(nlevels_source, npts_dest)) - allocate(coordinates_dest_all(nlevels_dest, npts_dest)) - - ! Fill coordinates with garbage - do point = 1, npts_dest - do level = 1, nlevels_source - coordinates_source_all(level, point) = 1000._r8 * level - end do - end do - - do point = 1, npts_dest - do level = 1, nlevels_dest - coordinates_dest_all(level, point) = 100000._r8 * level - end do - end do - - ! But put the passed-in coordinates in index_dest: - coordinates_source_all(:, index_dest) = coordinates_source(:) - coordinates_dest_all(:, index_dest) = coordinates_dest(:) - - end subroutine create_coordinate_arrays - - subroutine create_class_arrays(level_classes_source, level_classes_dest, & - level_classes_source_all, level_classes_dest_all, & - index_dest, npts_dest) - ! Arguments: - integer, intent(in) :: level_classes_source(:) ! classes in source data for index_dest - integer, intent(in) :: level_classes_dest(:) ! classes in dest data for index_dest - integer, allocatable, intent(out) :: level_classes_source_all(:,:) - integer, allocatable, intent(out) :: level_classes_dest_all(:,:) - - integer, intent(in) :: index_dest ! dest index of interest in tests - integer, intent(in) :: npts_dest ! total number of points wanted in dest - - ! Local variables: - integer :: nlevels_source - integer :: nlevels_dest - - integer, parameter :: default_class = 1 - !----------------------------------------------------------------------- - - nlevels_source = size(level_classes_source) - nlevels_dest = size(level_classes_dest) - - allocate(level_classes_source_all(nlevels_source, npts_dest), source = default_class) - allocate(level_classes_dest_all(nlevels_dest, npts_dest), source = default_class) - - level_classes_source_all(:, index_dest) = level_classes_source(:) - level_classes_dest_all(:, index_dest) = level_classes_dest(:) - - end subroutine create_class_arrays - -end module multilevel_interp_factory diff --git a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf b/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf deleted file mode 100644 index 32404e6d0b..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_interp.pf +++ /dev/null @@ -1,352 +0,0 @@ -module test_init_interp_multilevel_interp - - ! Tests of initInterpMultilevelInterp - - use pfunit_mod - use initInterpMultilevelInterp - use multilevel_interp_factory - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon, only : spval, ispval - - implicit none - - @TestCase - type, extends(TestCase) :: TestInitInterpMultilevelInterp - contains - procedure :: setUp - procedure :: tearDown - end type TestInitInterpMultilevelInterp - - real(r8), parameter :: tol = 1.e-13_r8 - - ! Tests use this destination index. Some other indices get filled with garbage values to - ! make sure we're accessing the correct points. - integer, parameter :: index_dest = 3 - - integer, parameter :: npts_dest = index_dest + 1 - -contains - - ! ------------------------------------------------------------------------ - ! Helper methods - ! ------------------------------------------------------------------------ - - subroutine setUp(this) - class(TestInitInterpMultilevelInterp), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestInitInterpMultilevelInterp), intent(inout) :: this - end subroutine tearDown - - function create_interpolator_no_levclasses(coordinates_source, coordinates_dest) & - result(interpolator) - ! Arguments: - type(interp_multilevel_interp_type) :: interpolator ! function result - real(r8), intent(in) :: coordinates_source(:) ! coordinates in source data for index_dest - real(r8), intent(in) :: coordinates_dest(:) ! coordinates in dest data for index_dest - !----------------------------------------------------------------------- - - interpolator = create_multilevel_interp_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - index_dest = index_dest, & - npts_dest = npts_dest) - - end function create_interpolator_no_levclasses - - function create_interpolator_with_levclasses(coordinates_source, coordinates_dest, & - level_classes_source, level_classes_dest) & - result(interpolator) - ! Arguments: - type(interp_multilevel_interp_type) :: interpolator ! function result - real(r8), intent(in) :: coordinates_source(:) ! coordinates in source data for index_dest - real(r8), intent(in) :: coordinates_dest(:) ! coordinates in dest data for index_dest - integer , intent(in) :: level_classes_source(:) ! class indices in source data for index_dest - integer , intent(in) :: level_classes_dest(:) ! class indices in dest data for index_dest - !----------------------------------------------------------------------- - - interpolator = create_multilevel_interp_with_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest, & - index_dest = index_dest, & - npts_dest = npts_dest) - - end function create_interpolator_with_levclasses - - ! ------------------------------------------------------------------------ - ! Tests: no level classes - ! ------------------------------------------------------------------------ - - @Test - subroutine sameLevels_copies(this) - ! If the destination levels exactly match the source levels, the source data should - ! be copied to the destination data - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(3) = 0._r8 - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates(3) = [1._r8, 2._r8, 3._r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates, & - coordinates_dest = coordinates) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_source, data_dest) - - end subroutine sameLevels_copies - - @Test - subroutine allWithinBounds_interpolates(this) - ! If the destination has different levels, but all levels are within the bounds of - ! the source, the destination data should simply be interpolated from the source data. - ! - ! This tests interpolation to multiple destination levels at once. - - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(3) = 0._r8 - real(r8) :: data_dest_expected(3) - real(r8), parameter :: data_source(5) = [11._r8, 12._r8, 13._r8, 14._r8, 15._r8] - real(r8), parameter :: coordinates_source(5) = [21._r8, 22._r8, 23._r8, 24._r8, 25._r8] - real(r8), parameter :: coordinates_dest(3) = [21.5_r8, 22.75_r8, 24.5_r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected = [11.5_r8, 12.75_r8, 14.5_r8] - - @assertEqual(data_dest_expected, data_dest, tolerance=tol) - - end subroutine allWithinBounds_interpolates - - @Test - subroutine greaterThanLastLevel_copiesLastLevel(this) - ! If the destination level is greater than the last source level, it should copy data - ! from the last source level - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(1) = 0._r8 - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates_source(3) = [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest(1) = [24._r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_source(3), data_dest) - - end subroutine greaterThanLastLevel_copiesLastLevel - - @Test - subroutine lessThanFirstLevel_copiesFirstLevel(this) - ! If the destination level is less than the first source level, it should copy data - ! from the first source level - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(1) = 0._r8 - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates_source(3) = [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest(1) = [20._r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_source(1), data_dest) - - end subroutine lessThanFirstLevel_copiesFirstLevel - - @Test - subroutine noSourceLevels_leavesDestinationUnchanged(this) - ! If there are no source levels, then the destination should be left at its original - ! value - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8), parameter :: data_orig = 17._r8 - real(r8) :: data_dest(1) - real(r8) :: data_source(0) - real(r8) :: coordinates_source(0) - real(r8), parameter :: coordinates_dest(1) = [20._r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - data_dest(1) = data_orig - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_orig, data_dest) - end subroutine noSourceLevels_leavesDestinationUnchanged - - ! ------------------------------------------------------------------------ - ! Tests: with level classes - ! ------------------------------------------------------------------------ - - @Test - subroutine noSourceLevelsInClass_leavesDestinationUnchanged(this) - ! If there are no source levels in the destination's class, then the destination - ! should be left at its original value - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8), parameter :: data_orig = 17._r8 - real(r8) :: data_dest(1) - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates_source(3) = [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest(1) = [22._r8] - integer, parameter :: level_classes_source(3) = [2, 2, 2] - integer, parameter :: level_classes_dest(1) = [1] - - interpolator = create_interpolator_with_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest) - - data_dest(1) = data_orig - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_orig, data_dest) - - end subroutine noSourceLevelsInClass_leavesDestinationUnchanged - - @Test - subroutine destLevelIsSpval_leavesDestinationUnchanged(this) - ! If the destination level class is ispval, then the destination should be left at - ! its original value - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8), parameter :: data_orig = 17._r8 - real(r8) :: data_dest(1) - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates_source(3) = [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest(1) = [22._r8] - ! Note that some source classes are 1, some are ispval (so that there is at least one - ! level whose class is the same as the destination class: both are ispval) - integer, parameter :: level_classes_source(3) = [1, ispval, 1] - integer, parameter :: level_classes_dest(1) = [ispval] - - interpolator = create_interpolator_with_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest) - - data_dest(1) = data_orig - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(data_orig, data_dest) - end subroutine destLevelIsSpval_leavesDestinationUnchanged - - @Test - subroutine dataInDifferentClasses_subsetsSourceLevelsByClass(this) - ! For data points in two different classes: Each data level's interpolation should - ! just consider the source points in that class - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(2) = 0._r8 - real(r8) :: data_dest_expected(2) - real(r8), parameter :: data_source(4) = [11._r8, 62._r8, 13._r8, 64._r8] - real(r8), parameter :: coordinates_source(4) = [21._r8, 22._r8, 23._r8, 24._r8] - integer , parameter :: level_classes_source(4) = [1 , 2 , 1 , 2] - ! The destination points are constructed so that the points fall exactly at one of - ! the source coordinates, but from the wrong class. So, if classes were not - ! considered, the destination data would be equal to the source data from the level - ! matching coordinates_dest; with classes, however, we need to interpolate from the - ! two adjacent points. - real(r8), parameter :: coordinates_dest(2) = [22._r8, 23._r8] - integer , parameter :: level_classes_dest(2) = [1 , 2] - - interpolator = create_interpolator_with_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest, & - level_classes_source = level_classes_source, & - level_classes_dest = level_classes_dest) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected = [12._r8, 63._r8] - - @assertEqual(data_dest_expected, data_dest) - end subroutine dataInDifferentClasses_subsetsSourceLevelsByClass - - @Test - subroutine monotonicCheck_ignoresNonExistentLevels(this) - ! Make sure that the test for monotonicity correctly ignores levels whose class is - ! ispval - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - - ! Exercise - interpolator = create_interpolator_with_levclasses( & - coordinates_source = [1._r8, 2._r8, 1.5_r8, 3._r8], & - coordinates_dest = [1._r8], & - level_classes_source = [1,1,ispval,1], & - level_classes_dest = [1]) - - ! No assertion: The test passes as long as the constructor doesn't abort - end subroutine monotonicCheck_ignoresNonExistentLevels - - ! ------------------------------------------------------------------------ - ! Tests: no level classes, but spval in source and/or destination data - ! ------------------------------------------------------------------------ - - @Test - subroutine destIsSpval_leavesDestinationUnchanged(this) - ! If the destination data is spval, then the destination should be left at spval - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(1) - real(r8), parameter :: data_source(3) = [11._r8, 12._r8, 13._r8] - real(r8), parameter :: coordinates_source(3) = [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest(1) = [22._r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - data_dest(1) = spval - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - @assertEqual(spval, data_dest) - end subroutine destIsSpval_leavesDestinationUnchanged - - @Test - subroutine sourceSpvalPoints_areIgnored(this) - ! If the source contains spval values in data, those levels should be ignored - class(TestInitInterpMultilevelInterp), intent(inout) :: this - type(interp_multilevel_interp_type) :: interpolator - real(r8) :: data_dest(1) = 0._r8 - real(r8) :: data_dest_expected(1) - real(r8), parameter :: data_source(4) = [11._r8, spval, spval, 14._r8] - ! coordinates_source are unevenly spaced to make sure we don't accidentally use - ! coordinates corresponding to the spval points: - real(r8), parameter :: coordinates_source(4) = [21._r8, 22.4_r8, 23.9_r8, 24._r8] - ! Note that the destination level falls in between the two source levels that have - ! spval - these should be ignored and the interpolation should instead use the other - ! points: - real(r8), parameter :: coordinates_dest(1) = [22.5_r8] - - interpolator = create_interpolator_no_levclasses( & - coordinates_source = coordinates_source, & - coordinates_dest = coordinates_dest) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(1) = 12.5_r8 - @assertEqual(data_dest_expected, data_dest, tolerance=tol) - end subroutine sourceSpvalPoints_areIgnored - -end module test_init_interp_multilevel_interp diff --git a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf b/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf deleted file mode 100644 index 439542a3bb..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_snow.pf +++ /dev/null @@ -1,172 +0,0 @@ -module test_init_interp_multilevel_snow - - ! Tests of initInterpMultilevelSnow - - use pfunit_mod - use initInterpMultilevelSnow - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestInitInterpMultilevelSnow - contains - procedure :: setUp - procedure :: tearDown - end type TestInitInterpMultilevelSnow - - real(r8), parameter :: tol = 1.e-13_r8 - - ! Tests use this destination index. Some other indices get filled with garbage values to - ! make sure we're accessing the correct points. - integer, parameter :: index_dest = 3 - - integer, parameter :: npts_dest = index_dest + 1 - -contains - - ! ------------------------------------------------------------------------ - ! Helper methods - ! ------------------------------------------------------------------------ - - subroutine setUp(this) - class(TestInitInterpMultilevelSnow), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestInitInterpMultilevelSnow), intent(inout) :: this - end subroutine tearDown - - function create_interpolator(num_snow_layers_source) result(interpolator) - ! Arguments: - type(interp_multilevel_snow_type) :: interpolator ! function result - integer, intent(in) :: num_snow_layers_source ! number of existing snow layers for index_dest - - ! Local variables: - integer, allocatable :: num_snow_layers_source_all(:) - character(len=*), parameter :: num_layers_name = 'NUM_LAYERS' - !----------------------------------------------------------------------- - - allocate(num_snow_layers_source_all(npts_dest)) - - num_snow_layers_source_all(:) = 0 - num_snow_layers_source_all(index_dest) = num_snow_layers_source - - interpolator = interp_multilevel_snow_type( & - num_snow_layers_source = num_snow_layers_source_all, & - num_layers_name = num_layers_name) - - end function create_interpolator - - ! ------------------------------------------------------------------------ - ! Begin tests - ! ------------------------------------------------------------------------ - - @Test - subroutine moreDestLevels_twoSourceLevels(this) - ! More dest levels than source levels; only some source levels have snow present - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - real(r8) :: data_source(3) = [11._r8, 12._r8, 13._r8] - - interpolator = create_interpolator(num_snow_layers_source = 2) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(1:2) = 0._r8 - data_dest_expected(3:5) = data_source(:) - @assertEqual(data_dest_expected, data_dest) - end subroutine moreDestLevels_twoSourceLevels - - @Test - subroutine sameDestLevels(this) - ! Same number of levels in dest as source; only some source levels have snow present - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - integer :: i - real(r8) :: data_source(5) = [ (i, i=11,15) ] - - interpolator = create_interpolator(num_snow_layers_source = 3) - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(:) = data_source(:) - @assertEqual(data_dest_expected, data_dest) - end subroutine sameDestLevels - - @Test - subroutine fewerDestLevels_moreThanExist(this) - ! Fewer snow levels in dest than source, but dest has more levels than the number of - ! existing snow layers in source - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - integer :: i - real(r8) :: data_source(9) = [ (i, i=11,19) ] - - interpolator = create_interpolator(num_snow_layers_source = 3) - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(:) = data_source(5:9) - @assertEqual(data_dest_expected, data_dest) - end subroutine fewerDestLevels_moreThanExist - - @Test - subroutine fewerDestLevels_sameAsExist(this) - ! Fewer snow levels in dest than source; dest has the same number of levels as the - ! number of existing snow layers in source - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - integer :: i - real(r8) :: data_source(9) = [ (i, i=11,19) ] - - interpolator = create_interpolator(num_snow_layers_source = 5) - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(:) = data_source(5:9) - @assertEqual(data_dest_expected, data_dest) - end subroutine fewerDestLevels_sameAsExist - - @Test - subroutine fewerDestLevels_fewerThanExist(this) - ! Fewer snow levels in dest than source; dest has fewer levels than the number of - ! existing snow layers in source - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - integer :: i - real(r8) :: data_source(9) = [ (i, i=11,19) ] - - interpolator = create_interpolator(num_snow_layers_source = 7) - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - ! Note that the top level of source where snow exists is level 3 - data_dest_expected(:) = data_source(3:7) - @assertEqual(data_dest_expected, data_dest) - end subroutine fewerDestLevels_fewerThanExist - - @Test - subroutine fewerDestLevels_allExist(this) - ! Fewer snow levels in dest than source; all snow levels exist in source - class(TestInitInterpMultilevelSnow), intent(inout) :: this - type(interp_multilevel_snow_type) :: interpolator - real(r8) :: data_dest(5) = 1000._r8 - real(r8) :: data_dest_expected(5) - integer :: i - real(r8) :: data_source(9) = [ (i, i=11,19) ] - - interpolator = create_interpolator(num_snow_layers_source = 9) - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - data_dest_expected(:) = data_source(1:5) - @assertEqual(data_dest_expected, data_dest) - end subroutine fewerDestLevels_allExist - -end module test_init_interp_multilevel_snow diff --git a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf b/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf deleted file mode 100644 index 7932cdb7d6..0000000000 --- a/src/init_interp/test/initInterpMultilevel_test/test_init_interp_multilevel_split.pf +++ /dev/null @@ -1,140 +0,0 @@ -module test_init_interp_multilevel_split - - ! Tests of initInterpMultilevelSplit - - use pfunit_mod - use initInterpMultilevelSplit - use initInterpMultilevelInterp, only : interp_multilevel_interp_type - use initInterpMultilevelCopy, only : interp_multilevel_copy_type - use initInterpMultilevelMock, only : interp_multilevel_mock_type - use multilevel_interp_factory - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestInitInterpMultilevelSplit - contains - procedure :: setUp - procedure :: tearDown - end type TestInitInterpMultilevelSplit - - real(r8), parameter :: tol = 1.e-13_r8 - - ! Tests use this destination index. Some other indices get filled with garbage values to - ! make sure we're accessing the correct points. - integer, parameter :: index_dest = 3 - - integer, parameter :: npts_dest = index_dest + 1 - -contains - - subroutine setUp(this) - class(TestInitInterpMultilevelSplit), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestInitInterpMultilevelSplit), intent(inout) :: this - end subroutine tearDown - - @Test - subroutine interpsCalledCorrectly(this) - ! Test split interpolation with a "mock" to make sure the interpolators are called - ! correctly. - class(TestInitInterpMultilevelSplit), intent(inout) :: this - type(interp_multilevel_split_type) :: interpolator - type(interp_multilevel_mock_type), pointer :: interp_first, interp_second - integer, parameter :: nlev_source_first = 2 - integer, parameter :: nlev_dest_first = 3 - integer, parameter :: start_source_second = nlev_source_first + 1 - integer, parameter :: start_dest_second = nlev_dest_first + 1 - integer, parameter :: nlev_source_second = 5 - integer, parameter :: nlev_dest_second = 7 - real(r8) :: data_source(nlev_source_first + nlev_source_second) - real(r8) :: data_dest(nlev_dest_first + nlev_dest_second) - integer :: i - - do i = 1, size(data_source) - data_source(i) = 100._r8 + i - end do - do i = 1, size(data_dest) - data_dest(i) = 200._r8 + i - end do - - allocate(interp_first) - interp_first = interp_multilevel_mock_type("interp_first", & - expected_data_dest = data_dest(1:nlev_dest_first), & - expected_data_source = data_source(1:nlev_source_first), & - expected_index_dest = index_dest) - - allocate(interp_second) - interp_second = interp_multilevel_mock_type("interp_second", & - expected_data_dest = data_dest(start_dest_second:size(data_dest)), & - expected_data_source = data_source(start_source_second:size(data_source)), & - expected_index_dest = index_dest) - - interpolator = create_interp_multilevel_split_type( & - interpolator_first_levels = interp_first, & - interpolator_second_levels = interp_second, & - num_second_levels_source = nlev_source_second, & - num_second_levels_dest = nlev_dest_second) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - ! No assert section: mocks do the asserts for us - - end subroutine interpsCalledCorrectly - - @Test - subroutine differentInterpolatorTypes(this) - ! Test split interpolation with two different interpolator types, and with different - ! numbers of levels in source and dest. - class(TestInitInterpMultilevelSplit), intent(inout) :: this - type(interp_multilevel_split_type) :: interpolator - type(interp_multilevel_copy_type), pointer :: interp_first - type(interp_multilevel_interp_type), pointer :: interp_second - integer, parameter :: nlev_source_first = 4 - integer, parameter :: nlev_dest_first = 4 - integer, parameter :: nlev_source_second = 3 - integer, parameter :: nlev_dest_second = 2 - - real(r8), parameter :: coordinates_source_second(nlev_source_second) = & - [21._r8, 22._r8, 23._r8] - real(r8), parameter :: coordinates_dest_second(nlev_dest_second) = & - [21.5_r8, 22.5_r8] - - real(r8) :: data_dest(nlev_dest_first + nlev_dest_second) = 0._r8 - real(r8) :: data_dest_expected(nlev_dest_first + nlev_dest_second) = 0._r8 - real(r8), parameter :: data_source(nlev_source_first + nlev_source_second) = & - [11._r8, 12._r8, 13._r8, 14._r8, 15._r8, 16._r8, 17._r8] - - - allocate(interp_first) - allocate(interp_second) - - interp_second = create_multilevel_interp_no_levclasses( & - coordinates_source = coordinates_source_second, & - coordinates_dest = coordinates_dest_second, & - index_dest = index_dest, & - npts_dest = npts_dest) - - interpolator = create_interp_multilevel_split_type( & - interpolator_first_levels = interp_first, & - interpolator_second_levels = interp_second, & - num_second_levels_source = nlev_source_second, & - num_second_levels_dest = nlev_dest_second) - - call interpolator%interp_multilevel(data_dest, data_source, index_dest) - - ! Determine expected result - ! The first set of levels involves a simple copy: - data_dest_expected(1:nlev_dest_first) = data_source(1:nlev_source_first) - ! The second set of levels involves an interpolation: - data_dest_expected((nlev_dest_first+1):(nlev_dest_first+nlev_dest_second)) = & - [15.5_r8, 16.5_r8] - - @assertEqual(data_dest_expected, data_dest) - - end subroutine differentInterpolatorTypes - -end module test_init_interp_multilevel_split diff --git a/src/init_interp/test/initInterpUtils_test/CMakeLists.txt b/src/init_interp/test/initInterpUtils_test/CMakeLists.txt deleted file mode 100644 index 099120472c..0000000000 --- a/src/init_interp/test/initInterpUtils_test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set (pfunit_sources - test_glc_elevclasses_are_same.pf) - -create_pFUnit_test(initInterpUtils test_initInterpUtils_exe - "${pfunit_sources}" "") - -target_link_libraries(test_initInterpUtils_exe clm csm_share) \ No newline at end of file diff --git a/src/init_interp/test/initInterpUtils_test/test_glc_elevclasses_are_same.pf b/src/init_interp/test/initInterpUtils_test/test_glc_elevclasses_are_same.pf deleted file mode 100644 index 987429cf5d..0000000000 --- a/src/init_interp/test/initInterpUtils_test/test_glc_elevclasses_are_same.pf +++ /dev/null @@ -1,103 +0,0 @@ -module test_glc_elevclasses_are_same - - ! Tests of initInterpUtils: glc_elevclasses_are_same - - use pfunit_mod - use initInterpUtils - use shr_kind_mod , only : r8 => shr_kind_r8 - use ncdio_pio, only : file_desc_t, ncd_set_dim, ncd_set_var - - implicit none - - @TestCase - type, extends(TestCase) :: TestGlcECSame - type(file_desc_t) :: ncidi ! input file to use for test - type(file_desc_t) :: ncido ! output file to use for test - contains - procedure :: setUp - procedure :: tearDown - procedure :: createFiles - end type TestGlcECSame - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestGlcECSame), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestGlcECSame), intent(inout) :: this - end subroutine tearDown - - subroutine createFiles(this, ec_bounds_ncidi, ec_bounds_ncido) - ! Creates this%ncidi and this%ncido, filled with correct glc_nec and glc_nec1 - ! dimensions and glc_elevclass_bounds data. - class(TestGlcECSame), intent(inout) :: this - real(r8), intent(in) :: ec_bounds_ncidi(:) - real(r8), intent(in) :: ec_bounds_ncido(:) - - this%ncidi = file_desc_t() - this%ncido = file_desc_t() - - call ncd_set_dim(this%ncidi, 'glc_nec', size(ec_bounds_ncidi)-1) - call ncd_set_dim(this%ncidi, 'glc_nec1', size(ec_bounds_ncidi)) - call ncd_set_var(ncid = this%ncidi, & - varname = 'glc_elevclass_bounds', & - data = reshape(ec_bounds_ncidi, [size(ec_bounds_ncidi), 1]), & - data_shape = [size(ec_bounds_ncidi)]) - - call ncd_set_dim(this%ncido, 'glc_nec', size(ec_bounds_ncido)-1) - call ncd_set_dim(this%ncido, 'glc_nec1', size(ec_bounds_ncido)) - call ncd_set_var(ncid = this%ncido, & - varname = 'glc_elevclass_bounds', & - data = reshape(ec_bounds_ncido, [size(ec_bounds_ncido), 1]), & - data_shape = [size(ec_bounds_ncido)]) - end subroutine createFiles - - @Test - subroutine different_num_ec(this) - class(TestGlcECSame), intent(inout) :: this - logical :: my_result - - call this%createFiles( & - ec_bounds_ncidi = [0._r8, 1._r8, 2._r8], & - ec_bounds_ncido = [0._r8, 1._r8, 2._r8, 3._r8]) - - my_result = glc_elevclasses_are_same(this%ncidi, this%ncido) - - @assertFalse(my_result) - end subroutine different_num_ec - - @Test - subroutine different_bounds(this) - class(TestGlcECSame), intent(inout) :: this - logical :: my_result - - call this%createFiles( & - ec_bounds_ncidi = [0._r8, 1._r8, 2._r8], & - ec_bounds_ncido = [0._r8, 1._r8, 4._r8]) - - my_result = glc_elevclasses_are_same(this%ncidi, this%ncido) - - @assertFalse(my_result) - end subroutine different_bounds - - @Test - subroutine same(this) - class(TestGlcECSame), intent(inout) :: this - real(r8), parameter :: diff = 1.e-12 - logical :: my_result - - ! Should be robust to differences within roundoff - call this%createFiles( & - ec_bounds_ncidi = [0._r8, 1._r8, 2._r8], & - ec_bounds_ncido = [0._r8, 1._r8, 2._r8+diff]) - - my_result = glc_elevclasses_are_same(this%ncidi, this%ncido) - - @assertTrue(my_result) - end subroutine same - -end module test_glc_elevclasses_are_same diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt deleted file mode 100644 index 971b364641..0000000000 --- a/src/main/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources - ColumnType.F90 - pftconMod.F90 - FuncPedotransferMod.F90 - GridcellType.F90 - LandunitType.F90 - PatchType.F90 - TopoMod.F90 - abortutils.F90 - atm2lndMod.F90 - atm2lndType.F90 - accumulMod.F90 - clm_varcon.F90 - clm_varctl.F90 - clm_varpar.F90 - clm_varsur.F90 - column_varcon.F90 - decompMod.F90 - filterColMod.F90 - glc2lndMod.F90 - glcBehaviorMod.F90 - initSubgridMod.F90 - landunit_varcon.F90 - lnd2glcMod.F90 - ncdio_utils.F90 - organicFileMod.F90 - subgridAveMod.F90 - subgridWeightsMod.F90 - surfrdUtilsMod.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/main/ColumnType.F90 b/src/main/ColumnType.F90 deleted file mode 100644 index e7d355a59c..0000000000 --- a/src/main/ColumnType.F90 +++ /dev/null @@ -1,208 +0,0 @@ -module ColumnType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Column data type allocation and initialization - ! -------------------------------------------------------- - ! column types can have values of - ! -------------------------------------------------------- - ! 1 => (istsoil) soil (vegetated or bare soil) - ! 2 => (istcrop) crop (only for crop configuration) - ! 3 => (UNUSED) (formerly non-multiple elevation class land ice; currently unused) - ! 4 => (istice_mec) land ice (multiple elevation classes) - ! 5 => (istdlak) deep lake - ! 6 => (istwet) wetland - ! 71 => (icol_roof) urban roof - ! 72 => (icol_sunwall) urban sunwall - ! 73 => (icol_shadewall) urban shadewall - ! 74 => (icol_road_imperv) urban impervious road - ! 75 => (icol_road_perv) urban pervious road - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - use clm_varcon , only : spval, ispval - use shr_sys_mod , only : shr_sys_abort - use clm_varctl , only : iulog - use column_varcon , only : is_hydrologically_active - use LandunitType , only : lun - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - type, public :: column_type - ! g/l/c/p hierarchy, local g/l/c/p cells only - integer , pointer :: landunit (:) ! index into landunit level quantities - real(r8), pointer :: wtlunit (:) ! weight (relative to landunit) - integer , pointer :: gridcell (:) ! index into gridcell level quantities - real(r8), pointer :: wtgcell (:) ! weight (relative to gridcell) - integer , pointer :: patchi (:) ! beginning patch index for each column - integer , pointer :: patchf (:) ! ending patch index for each column - integer , pointer :: npatches (:) ! number of patches for each column - - ! topological mapping functionality - integer , pointer :: itype (:) ! column type (after init, should only be modified via update_itype routine) - logical , pointer :: active (:) ! true=>do computations on this column - logical , pointer :: type_is_dynamic (:) ! true=>itype can change throughout the run - - ! topography - ! TODO(wjs, 2016-04-05) Probably move these things into topoMod - real(r8), pointer :: micro_sigma (:) ! microtopography pdf sigma (m) - real(r8), pointer :: n_melt (:) ! SCA shape parameter - real(r8), pointer :: topo_slope (:) ! gridcell topographic slope - real(r8), pointer :: topo_std (:) ! gridcell elevation standard deviation - - ! vertical levels - integer , pointer :: snl (:) ! number of snow layers - real(r8), pointer :: dz (:,:) ! layer thickness (m) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: z (:,:) ! layer depth (m) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: zi (:,:) ! interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) - real(r8), pointer :: zii (:) ! convective boundary height [m] - real(r8), pointer :: dz_lake (:,:) ! lake layer thickness (m) (1:nlevlak) - real(r8), pointer :: z_lake (:,:) ! layer depth for lake (m) - real(r8), pointer :: lakedepth (:) ! variable lake depth (m) - integer , pointer :: nbedrock (:) ! variable depth to bedrock index - - ! other column characteristics - logical , pointer :: hydrologically_active(:) ! true if this column is a hydrologically active type - - ! levgrnd_class gives the class in which each layer falls. This is relevant for - ! columns where there are 2 or more fundamentally different layer types. For - ! example, this distinguishes between soil and bedrock layers. The particular value - ! assigned to each class is irrelevant; the important thing is that different - ! classes (e.g., soil vs. bedrock) have different values of levgrnd_class. - ! - ! levgrnd_class = ispval indicates that the given layer is completely unused for - ! this column (i.e., this column doesn't use the full nlevgrnd layers). - integer , pointer :: levgrnd_class (:,:) ! class in which each layer falls (1:nlevgrnd) - contains - - procedure, public :: Init - procedure, public :: Clean - - ! Update the column type for one column. Any updates to col%itype after - ! initialization should be made via this routine. - procedure, public :: update_itype - - end type column_type - - type(column_type), public, target :: col !column data structure (soil/snow/canopy columns) - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, begc, endc) - ! - ! !ARGUMENTS: - class(column_type) :: this - integer, intent(in) :: begc,endc - !------------------------------------------------------------------------ - - ! The following is set in initGridCellsMod - allocate(this%gridcell (begc:endc)) ; this%gridcell (:) = ispval - allocate(this%wtgcell (begc:endc)) ; this%wtgcell (:) = nan - allocate(this%landunit (begc:endc)) ; this%landunit (:) = ispval - allocate(this%wtlunit (begc:endc)) ; this%wtlunit (:) = nan - allocate(this%patchi (begc:endc)) ; this%patchi (:) = ispval - allocate(this%patchf (begc:endc)) ; this%patchf (:) = ispval - allocate(this%npatches (begc:endc)) ; this%npatches (:) = ispval - allocate(this%itype (begc:endc)) ; this%itype (:) = ispval - allocate(this%active (begc:endc)) ; this%active (:) = .false. - allocate(this%type_is_dynamic(begc:endc)) ; this%type_is_dynamic(:) = .false. - - ! The following is set in initVerticalMod - allocate(this%snl (begc:endc)) ; this%snl (:) = ispval !* cannot be averaged up - allocate(this%dz (begc:endc,-nlevsno+1:nlevgrnd)) ; this%dz (:,:) = nan - allocate(this%z (begc:endc,-nlevsno+1:nlevgrnd)) ; this%z (:,:) = nan - allocate(this%zi (begc:endc,-nlevsno+0:nlevgrnd)) ; this%zi (:,:) = nan - allocate(this%zii (begc:endc)) ; this%zii (:) = nan - allocate(this%lakedepth (begc:endc)) ; this%lakedepth (:) = spval - allocate(this%dz_lake (begc:endc,nlevlak)) ; this%dz_lake (:,:) = nan - allocate(this%z_lake (begc:endc,nlevlak)) ; this%z_lake (:,:) = nan - - allocate(this%nbedrock (begc:endc)) ; this%nbedrock (:) = ispval - allocate(this%levgrnd_class(begc:endc,nlevgrnd)) ; this%levgrnd_class(:,:) = ispval - allocate(this%micro_sigma (begc:endc)) ; this%micro_sigma (:) = nan - allocate(this%n_melt (begc:endc)) ; this%n_melt (:) = nan - allocate(this%topo_slope (begc:endc)) ; this%topo_slope (:) = nan - allocate(this%topo_std (begc:endc)) ; this%topo_std (:) = nan - - allocate(this%hydrologically_active(begc:endc)) ; this%hydrologically_active(:) = .false. - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine Clean(this) - ! - ! !ARGUMENTS: - class(column_type) :: this - !------------------------------------------------------------------------ - - deallocate(this%gridcell ) - deallocate(this%wtgcell ) - deallocate(this%landunit ) - deallocate(this%wtlunit ) - deallocate(this%patchi ) - deallocate(this%patchf ) - deallocate(this%npatches ) - deallocate(this%itype ) - deallocate(this%active ) - deallocate(this%type_is_dynamic) - deallocate(this%snl ) - deallocate(this%dz ) - deallocate(this%z ) - deallocate(this%zi ) - deallocate(this%zii ) - deallocate(this%lakedepth ) - deallocate(this%dz_lake ) - deallocate(this%z_lake ) - deallocate(this%micro_sigma) - deallocate(this%n_melt ) - deallocate(this%topo_slope ) - deallocate(this%topo_std ) - deallocate(this%nbedrock ) - deallocate(this%levgrnd_class) - deallocate(this%hydrologically_active) - - end subroutine Clean - - !----------------------------------------------------------------------- - subroutine update_itype(this, c, itype) - ! - ! !DESCRIPTION: - ! Update the column type for one column. Any updates to col%itype after - ! initialization should be made via this routine. - ! - ! !ARGUMENTS: - class(column_type), intent(inout) :: this - integer, intent(in) :: c - integer, intent(in) :: itype - ! - ! !LOCAL VARIABLES: - integer :: l - - character(len=*), parameter :: subname = 'update_itype' - !----------------------------------------------------------------------- - - l = col%landunit(c) - - if (col%type_is_dynamic(c)) then - col%itype(c) = itype - col%hydrologically_active(c) = is_hydrologically_active( & - col_itype = itype, & - lun_itype = lun%itype(l)) - else - write(iulog,*) subname//' ERROR: attempt to update itype when type_is_dynamic is false' - write(iulog,*) 'c, col%itype(c), itype = ', c, col%itype(c), itype - ! Need to use shr_sys_abort rather than endrun, because using endrun would cause - ! circular dependencies - call shr_sys_abort(subname//' ERROR: attempt to update itype when type_is_dynamic is false') - end if - end subroutine update_itype - - - -end module ColumnType diff --git a/src/main/FuncPedotransferMod.F90 b/src/main/FuncPedotransferMod.F90 deleted file mode 100644 index 41e751344e..0000000000 --- a/src/main/FuncPedotransferMod.F90 +++ /dev/null @@ -1,141 +0,0 @@ -module FuncPedotransferMod -! -!DESCRIPTIONS: -!module contains different pedotransfer functions to -!compute the mineral soil hydraulic properties. -!currenty, only the Clapp-Hornberg formulation is used. -!HISTORY: -!created by Jinyun Tang, Mar.1st, 2014 -implicit none - private - public :: pedotransf - public :: get_ipedof - public :: init_pedof - - integer, parameter :: cosby_1984_table5 = 0 !by default uses this form - integer, parameter :: cosby_1984_table4 = 1 - integer, parameter :: noilhan_lacarrere_1995 = 2 - integer :: ipedof0 -contains - - subroutine init_pedof() - ! - !DESCRIPTIONS - !initialize the default pedotransfer function - implicit none - - - ipedof0 = cosby_1984_table5 !the default pedotransfer function - end subroutine init_pedof - - subroutine pedotransf(ipedof, sand, clay, watsat, bsw, sucsat, xksat) - !pedotransfer function to compute hydraulic properties of mineral soil - !based on input soil texture - - use shr_kind_mod , only : r8 => shr_kind_r8 - use abortutils , only : endrun - implicit none - integer, intent(in) :: ipedof !type of pedotransfer function, use the default pedotransfer function - real(r8), intent(in) :: sand !% sand - real(r8), intent(in) :: clay !% clay - real(r8), intent(out):: watsat !v/v saturate moisture - real(r8), intent(out):: bsw !b shape parameter - real(r8), intent(out):: sucsat !mm, soil matric potential - real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity - - character(len=32) :: subname = 'pedotransf' ! subroutine name - select case (ipedof) - case (cosby_1984_table4) - call pedotransf_cosby1984_table4(sand, clay, watsat, bsw, sucsat, xksat) - case (noilhan_lacarrere_1995) - call pedotransf_noilhan_lacarrere1995(sand, clay, watsat, bsw, sucsat, xksat) - case (cosby_1984_table5) - call pedotransf_cosby1984_table5(sand, clay, watsat, bsw, sucsat, xksat) - case default - call endrun(subname // ':: a pedotransfer function must be specified!') - end select - - end subroutine pedotransf - -!------------------------------------------------------------------------------------------ - subroutine pedotransf_cosby1984_table4(sand, clay, watsat, bsw, sucsat, xksat) - ! - !DESCRIPTIONS - !compute hydraulic properties based on functions derived from Table 4 in cosby et al, 1984 - use shr_kind_mod , only : r8 => shr_kind_r8 - implicit none - real(r8), intent(in) :: sand !% sand - real(r8), intent(in) :: clay !% clay - real(r8), intent(out):: watsat !v/v saturate moisture - real(r8), intent(out):: bsw !b shape parameter - real(r8), intent(out):: sucsat !mm, soil matric potential - real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity - - !Cosby et al. Table 4 - watsat = 0.505_r8-0.00142_r8*sand-0.00037*clay - bsw = 3.10+0.157*clay-0.003*sand - sucsat = 10._r8 * ( 10._r8**(1.54_r8-0.0095_r8*sand+0.0063*(100._r8-sand-clay))) - xksat = 0.0070556 *(10.**(-0.60+0.0126*sand-0.0064*clay) ) !mm/s now use table 4. - - end subroutine pedotransf_cosby1984_table4 - -!------------------------------------------------------------------------------------------ - subroutine pedotransf_cosby1984_table5(sand, clay, watsat, bsw, sucsat, xksat) - ! - !DESCRIPTIONS - !compute hydraulic properties based on functions derived from Table 5 in cosby et al, 1984 - - use shr_kind_mod , only : r8 => shr_kind_r8 - implicit none - real(r8), intent(in) :: sand !% sand - real(r8), intent(in) :: clay !% clay - real(r8), intent(out):: watsat !v/v saturate moisture - real(r8), intent(out):: bsw !b shape parameter - real(r8), intent(out):: sucsat !mm, soil matric potential - real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity - - !Cosby et al. Table 5 - watsat = 0.489_r8 - 0.00126_r8*sand - bsw = 2.91 + 0.159*clay - sucsat = 10._r8 * ( 10._r8**(1.88_r8-0.0131_r8*sand) ) - xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s, from table 5 - - end subroutine pedotransf_cosby1984_table5 - -!------------------------------------------------------------------------------------------ - subroutine pedotransf_noilhan_lacarrere1995(sand, clay, watsat, bsw, sucsat, xksat) - ! - !DESCRIPTIONS - !compute hydraulic properties based on functions derived from Noilhan and Lacarrere, 1995 - - use shr_kind_mod , only : r8 => shr_kind_r8 - implicit none - real(r8), intent(in) :: sand !% sand - real(r8), intent(in) :: clay !% clay - real(r8), intent(out):: watsat !v/v saturate moisture - real(r8), intent(out):: bsw !b shape parameter - real(r8), intent(out):: sucsat !mm, soil matric potential - real(r8), intent(out):: xksat !mm/s, saturated hydraulic conductivity - - !Noilhan and Lacarrere, 1995 - watsat = -0.00108*sand+0.494305 - bsw = 0.137*clay + 3.501 - sucsat = 10._r8**(-0.0088*sand+2.85) - xksat = 10._r8**(-0.0582*clay-0.00091*sand+0.000529*clay**2._r8-0.0001203*sand**2._r8-1.38) - end subroutine pedotransf_noilhan_lacarrere1995 -!------------------------------------------------------------------------------------------ - function get_ipedof(soil_order)result(ipedof) - ! - ! DESCRIPTION - ! select the pedotransfer function to be used - implicit none - integer, intent(in) :: soil_order - - integer :: ipedof - - if(soil_order==0)then - ipedof=ipedof0 - endif - - end function get_ipedof -end module FuncpedotransferMod diff --git a/src/main/GetGlobalValuesMod.F90 b/src/main/GetGlobalValuesMod.F90 deleted file mode 100644 index 3cd1f9a306..0000000000 --- a/src/main/GetGlobalValuesMod.F90 +++ /dev/null @@ -1,153 +0,0 @@ -module GetGlobalValuesMod - - !----------------------------------------------------------------------- - ! Obtain and Write Global Index information - !----------------------------------------------------------------------- - implicit none - private - - ! PUBLIC MEMBER FUNCTIONS: - - public :: GetGlobalIndex - public :: GetGlobalWrite - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - integer function GetGlobalIndex(decomp_index, clmlevel) - - !---------------------------------------------------------------- - ! Description - ! Determine global index space value for target point at given clmlevel - ! - ! Uses: - use shr_log_mod, only: errMsg => shr_log_errMsg - use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds - use spmdMod , only: iam - use clm_varcon , only: nameg, namel, namec, namep - use clm_varctl , only: iulog - use mct_mod , only: mct_gsMap, mct_gsMap_orderedPoints - use shr_sys_mod, only: shr_sys_abort - ! - ! Arguments - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - type(bounds_type) :: bounds_proc ! processor bounds - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points - integer :: beg_index ! beginning proc index for clmlevel - !---------------------------------------------------------------- - - call get_proc_bounds(bounds_proc) - - if (trim(clmlevel) == nameg) then - beg_index = bounds_proc%begg - else if (trim(clmlevel) == namel) then - beg_index = bounds_proc%begl - else if (trim(clmlevel) == namec) then - beg_index = bounds_proc%begc - else if (trim(clmlevel) == namep) then - beg_index = bounds_proc%begp - else - call shr_sys_abort('clmlevel of '//trim(clmlevel)//' not supported' // & - errmsg(sourcefile, __LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap) - call mct_gsMap_orderedPoints(gsmap, iam, gsmap_ordered) - GetGlobalIndex = gsmap_ordered(decomp_index - beg_index + 1) - deallocate(gsmap_ordered) - - end function GetGlobalIndex - - !----------------------------------------------------------------------- - subroutine GetGlobalWrite(decomp_index, clmlevel) - - !----------------------------------------------------------------------- - ! Description: - ! Write global index information for input local indices - ! - use shr_sys_mod , only : shr_sys_flush - use shr_sys_mod , only : shr_sys_abort - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog - use clm_varcon , only : nameg, namel, namec, namep - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! Arguments: - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - integer :: igrc, ilun, icol, ipft - !----------------------------------------------------------------------- - - if (trim(clmlevel) == nameg) then - - igrc = decomp_index - write(iulog,*)'local gridcell index = ',igrc - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - - else if (trim(clmlevel) == namel) then - - ilun = decomp_index - igrc = lun%gridcell(ilun) - write(iulog,*)'local landunit index = ',ilun - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'landunit type = ',lun%itype(decomp_index) - - else if (trim(clmlevel) == namec) then - - icol = decomp_index - ilun = col%landunit(icol) - igrc = col%gridcell(icol) - write(iulog,*)'local column index = ',icol - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else if (trim(clmlevel) == namep) then - - ipft = decomp_index - icol = patch%column(ipft) - ilun = patch%landunit(ipft) - igrc = patch%gridcell(ipft) - write(iulog,*)'local patch index = ',ipft - write(iulog,*)'global patch index = ',GetGlobalIndex(decomp_index=ipft, clmlevel=namep) - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'pft type = ',patch%itype(ipft) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else - call shr_sys_abort('clmlevel '//trim(clmlevel)//'not supported '//errmsg(sourcefile, __LINE__)) - - end if - - call shr_sys_flush(iulog) - - end subroutine GetGlobalWrite - -end module GetGlobalValuesMod diff --git a/src/main/GridcellType.F90 b/src/main/GridcellType.F90 deleted file mode 100644 index 30fe988eff..0000000000 --- a/src/main/GridcellType.F90 +++ /dev/null @@ -1,106 +0,0 @@ -module GridcellType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Gridcell data type allocation - ! -------------------------------------------------------- - ! gridcell types can have values of - ! -------------------------------------------------------- - ! 1 => default - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use landunit_varcon, only : max_lunit - use clm_varcon , only : ispval - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - type, public :: gridcell_type - - ! topological mapping functionality, local 1d gdc arrays - integer , pointer :: gindex (:) ! global index - real(r8), pointer :: area (:) ! total land area, gridcell (km^2) - real(r8), pointer :: lat (:) ! latitude (radians) - real(r8), pointer :: lon (:) ! longitude (radians) - real(r8), pointer :: latdeg (:) ! latitude (degrees) - real(r8), pointer :: londeg (:) ! longitude (degrees) - logical , pointer :: active (:) ! just needed for symmetry with other subgrid types - - integer, pointer :: nbedrock (:) ! index of uppermost bedrock layer - - ! Daylength - real(r8) , pointer :: max_dayl (:) ! maximum daylength for this grid cell (s) - real(r8) , pointer :: dayl (:) ! daylength (seconds) - real(r8) , pointer :: prev_dayl (:) ! daylength from previous timestep (seconds) - - ! indices into landunit-level arrays for landunits in this grid cell (ispval implies - ! this landunit doesn't exist on this grid cell) [1:max_lunit, begg:endg] - ! (note that the spatial dimension is last here, in contrast to most 2-d variables; - ! this is for efficiency, since most loops will go over g in the outer loop, and - ! landunit type in the inner loop) - integer , pointer :: landunit_indices (:,:) - - contains - - procedure, public :: Init - procedure, public :: Clean - - end type gridcell_type - type(gridcell_type), public, target :: grc !gridcell data structure - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, begg, endg) - ! - ! !ARGUMENTS: - class(gridcell_type) :: this - integer, intent(in) :: begg, endg - !------------------------------------------------------------------------ - - ! The following is set in InitGridCells - allocate(this%gindex (begg:endg)) ; this%gindex (:) = ispval - allocate(this%area (begg:endg)) ; this%area (:) = nan - allocate(this%lat (begg:endg)) ; this%lat (:) = nan - allocate(this%lon (begg:endg)) ; this%lon (:) = nan - allocate(this%latdeg (begg:endg)) ; this%latdeg (:) = nan - allocate(this%londeg (begg:endg)) ; this%londeg (:) = nan - allocate(this%active (begg:endg)) ; this%active (:) = .true. - allocate(this%nbedrock (begg:endg)) ; this%nbedrock (:) = ispval - - ! This is initiailized in module DayLength - allocate(this%max_dayl (begg:endg)) ; this%max_dayl (:) = nan - allocate(this%dayl (begg:endg)) ; this%dayl (:) = nan - allocate(this%prev_dayl (begg:endg)) ; this%prev_dayl (:) = nan - - allocate(this%landunit_indices(1:max_lunit, begg:endg)); this%landunit_indices(:,:) = ispval - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine Clean(this) - ! - ! !ARGUMENTS: - class(gridcell_type) :: this - !------------------------------------------------------------------------ - - deallocate(this%gindex ) - deallocate(this%area ) - deallocate(this%lat ) - deallocate(this%lon ) - deallocate(this%latdeg ) - deallocate(this%londeg ) - deallocate(this%active ) - deallocate(this%nbedrock ) - deallocate(this%max_dayl ) - deallocate(this%dayl ) - deallocate(this%prev_dayl ) - deallocate(this%landunit_indices ) - - end subroutine Clean - -end module GridcellType diff --git a/src/main/LandunitType.F90 b/src/main/LandunitType.F90 deleted file mode 100644 index 2236ca2780..0000000000 --- a/src/main/LandunitType.F90 +++ /dev/null @@ -1,140 +0,0 @@ -module LandunitType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Landunit data type allocation - ! -------------------------------------------------------- - ! landunits types can have values of (see landunit_varcon.F90) - ! -------------------------------------------------------- - ! 1 => (istsoil) soil (vegetated or bare soil landunit) - ! 2 => (istcrop) crop (only for crop configuration) - ! 3 => (UNUSED) (formerly non-multiple elevation class land ice; currently unused) - ! 4 => (istice_mec) land ice (multiple elevation classes) - ! 5 => (istdlak) deep lake - ! 6 => (istwet) wetland - ! 7 => (isturb_tbd) urban tbd - ! 8 => (isturb_hd) urban hd - ! 9 => (isturb_md) urban md - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varcon , only : ispval - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - type, public :: landunit_type - ! g/l/c/p hierarchy, local g/l/c/p cells only - integer , pointer :: gridcell (:) ! index into gridcell level quantities - real(r8), pointer :: wtgcell (:) ! weight (relative to gridcell) - integer , pointer :: coli (:) ! beginning column index per landunit - integer , pointer :: colf (:) ! ending column index for each landunit - integer , pointer :: ncolumns (:) ! number of columns for each landunit - integer , pointer :: patchi (:) ! beginning patch index for each landunit - integer , pointer :: patchf (:) ! ending patch index for each landunit - integer , pointer :: npatches (:) ! number of patches for each landunit - - ! topological mapping functionality - integer , pointer :: itype (:) ! landunit type - logical , pointer :: ifspecial (:) ! true=>landunit is not vegetated - logical , pointer :: lakpoi (:) ! true=>lake point - logical , pointer :: urbpoi (:) ! true=>urban point - logical , pointer :: glcmecpoi (:) ! true=>glacier_mec point - logical , pointer :: active (:) ! true=>do computations on this landunit - - ! urban properties - real(r8), pointer :: canyon_hwr (:) ! urban landunit canyon height to width ratio (-) - real(r8), pointer :: wtroad_perv (:) ! urban landunit weight of pervious road column to total road (-) - real(r8), pointer :: wtlunit_roof (:) ! weight of roof with respect to urban landunit (-) - real(r8), pointer :: ht_roof (:) ! height of urban roof (m) - real(r8), pointer :: z_0_town (:) ! urban landunit momentum roughness length (m) - real(r8), pointer :: z_d_town (:) ! urban landunit displacement height (m) - - contains - - procedure, public :: Init ! Allocate and initialize - procedure, public :: Clean ! Clean up memory - - end type landunit_type - ! Singleton instance of the landunitType - type(landunit_type), public, target :: lun !geomorphological landunits - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, begl, endl) - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Allocate memory and initialize to signalling NaN to require - ! data be properly initialized somewhere else. - ! - ! !ARGUMENTS: - class(landunit_type) :: this - integer, intent(in) :: begl,endl - !------------------------------------------------------------------------ - - ! The following is set in InitGridCellsMod - allocate(this%gridcell (begl:endl)); this%gridcell (:) = ispval - allocate(this%wtgcell (begl:endl)); this%wtgcell (:) = nan - allocate(this%coli (begl:endl)); this%coli (:) = ispval - allocate(this%colf (begl:endl)); this%colf (:) = ispval - allocate(this%ncolumns (begl:endl)); this%ncolumns (:) = ispval - allocate(this%patchi (begl:endl)); this%patchi (:) = ispval - allocate(this%patchf (begl:endl)); this%patchf (:) = ispval - allocate(this%npatches (begl:endl)); this%npatches (:) = ispval - allocate(this%itype (begl:endl)); this%itype (:) = ispval - allocate(this%ifspecial (begl:endl)); this%ifspecial (:) = .false. - allocate(this%lakpoi (begl:endl)); this%lakpoi (:) = .false. - allocate(this%urbpoi (begl:endl)); this%urbpoi (:) = .false. - allocate(this%glcmecpoi (begl:endl)); this%glcmecpoi (:) = .false. - - ! The following is initialized in routine setActive in module reweightMod - allocate(this%active (begl:endl)) - - ! The following is set in routine urbanparams_inst%Init in module UrbanParamsType - allocate(this%canyon_hwr (begl:endl)); this%canyon_hwr (:) = nan - allocate(this%wtroad_perv (begl:endl)); this%wtroad_perv (:) = nan - allocate(this%ht_roof (begl:endl)); this%ht_roof (:) = nan - allocate(this%wtlunit_roof (begl:endl)); this%wtlunit_roof (:) = nan - allocate(this%z_0_town (begl:endl)); this%z_0_town (:) = nan - allocate(this%z_d_town (begl:endl)); this%z_d_town (:) = nan - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine Clean(this) - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Clean up memory use - ! - ! !ARGUMENTS: - class(landunit_type) :: this - !------------------------------------------------------------------------ - - deallocate(this%gridcell ) - deallocate(this%wtgcell ) - deallocate(this%coli ) - deallocate(this%colf ) - deallocate(this%ncolumns ) - deallocate(this%patchi ) - deallocate(this%patchf ) - deallocate(this%npatches ) - deallocate(this%itype ) - deallocate(this%ifspecial ) - deallocate(this%lakpoi ) - deallocate(this%urbpoi ) - deallocate(this%glcmecpoi ) - deallocate(this%active ) - deallocate(this%canyon_hwr ) - deallocate(this%wtroad_perv ) - deallocate(this%ht_roof ) - deallocate(this%wtlunit_roof ) - deallocate(this%z_0_town ) - deallocate(this%z_d_town ) - - end subroutine Clean - -end module LandunitType diff --git a/src/main/PatchType.F90 b/src/main/PatchType.F90 deleted file mode 100644 index d00f5588b0..0000000000 --- a/src/main/PatchType.F90 +++ /dev/null @@ -1,207 +0,0 @@ -module PatchType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Patch data type allocation - ! -------------------------------------------------------- - ! patch types can have values of - ! -------------------------------------------------------- - ! 0 => not_vegetated - ! 1 => needleleaf_evergreen_temperate_tree - ! 2 => needleleaf_evergreen_boreal_tree - ! 3 => needleleaf_deciduous_boreal_tree - ! 4 => broadleaf_evergreen_tropical_tree - ! 5 => broadleaf_evergreen_temperate_tree - ! 6 => broadleaf_deciduous_tropical_tree - ! 7 => broadleaf_deciduous_temperate_tree - ! 8 => broadleaf_deciduous_boreal_tree - ! 9 => broadleaf_evergreen_shrub - ! 10 => broadleaf_deciduous_temperate_shrub - ! 11 => broadleaf_deciduous_boreal_shrub - ! 12 => c3_arctic_grass - ! 13 => c3_non-arctic_grass - ! 14 => c4_grass - ! 15 => c3_crop - ! 16 => c3_irrigated - ! 17 => temperate_corn - ! 18 => irrigated_temperate_corn - ! 19 => spring_wheat - ! 20 => irrigated_spring_wheat - ! 21 => winter_wheat - ! 22 => irrigated_winter_wheat - ! 23 => temperate_soybean - ! 24 => irrigated_temperate_soybean - ! 25 => barley - ! 26 => irrigated_barley - ! 27 => winter_barley - ! 28 => irrigated_winter_barley - ! 29 => rye - ! 30 => irrigated_rye - ! 31 => winter_rye - ! 32 => irrigated_winter_rye - ! 33 => cassava - ! 34 => irrigated_cassava - ! 35 => citrus - ! 36 => irrigated_citrus - ! 37 => cocoa - ! 38 => irrigated_cocoa - ! 39 => coffee - ! 40 => irrigated_coffee - ! 41 => cotton - ! 42 => irrigated_cotton - ! 43 => datepalm - ! 44 => irrigated_datepalm - ! 45 => foddergrass - ! 46 => irrigated_foddergrass - ! 47 => grapes - ! 48 => irrigated_grapes - ! 49 => groundnuts - ! 50 => irrigated_groundnuts - ! 51 => millet - ! 52 => irrigated_millet - ! 53 => oilpalm - ! 54 => irrigated_oilpalm - ! 55 => potatoes - ! 56 => irrigated_potatoes - ! 57 => pulses - ! 58 => irrigated_pulses - ! 59 => rapeseed - ! 60 => irrigated_rapeseed - ! 61 => rice - ! 62 => irrigated_rice - ! 63 => sorghum - ! 64 => irrigated_sorghum - ! 65 => sugarbeet - ! 66 => irrigated_sugarbeet - ! 67 => sugarcane - ! 68 => irrigated_sugarcane - ! 69 => sunflower - ! 70 => irrigated_sunflower - ! 71 => miscanthus - ! 72 => irrigated_miscanthus - ! 73 => switchgrass - ! 74 => irrigated_switchgrass - ! 75 => tropical_corn - ! 76 => irrigated_tropical_corn - ! 77 => tropical_soybean - ! 78 => irrigated_tropical_soybean - ! -------------------------------------------------------- - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varcon , only : ispval - use clm_varctl , only : use_fates - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - type, public :: patch_type - - ! g/l/c/p hierarchy, local g/l/c/p cells only - integer , pointer :: column (:) ! index into column level quantities - real(r8), pointer :: wtcol (:) ! weight (relative to column) - integer , pointer :: landunit (:) ! index into landunit level quantities - real(r8), pointer :: wtlunit (:) ! weight (relative to landunit) - integer , pointer :: gridcell (:) ! index into gridcell level quantities - real(r8), pointer :: wtgcell (:) ! weight (relative to gridcell) - - ! Non-ED only - integer , pointer :: itype (:) ! patch vegetation - integer , pointer :: mxy (:) ! m index for laixy(i,j,m),etc. (undefined for special landunits) - logical , pointer :: active (:) ! true=>do computations on this patch - - ! fates only - logical , pointer :: is_veg (:) ! This is an ACTIVE fates patch - logical , pointer :: is_bareground (:) - real(r8), pointer :: wt_ed (:) !TODO mv ? can this be removed - - - logical, pointer :: is_fates (:) ! true for patch vector space reserved - ! for FATES. - ! this is static and is true for all - ! patches within fates jurisdiction - ! including patches which are not currently - ! associated with a FATES linked-list patch - - - contains - - procedure, public :: Init - procedure, public :: Clean - - end type patch_type - type(patch_type), public, target :: patch ! patch type data structure - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, begp, endp) - ! - ! !ARGUMENTS: - class(patch_type) :: this - integer, intent(in) :: begp,endp - ! - ! LOCAL VARAIBLES: - !------------------------------------------------------------------------ - - ! The following is set in InitGridCells - - allocate(this%gridcell (begp:endp)); this%gridcell (:) = ispval - allocate(this%wtgcell (begp:endp)); this%wtgcell (:) = nan - - allocate(this%landunit (begp:endp)); this%landunit (:) = ispval - allocate(this%wtlunit (begp:endp)); this%wtlunit (:) = nan - - allocate(this%column (begp:endp)); this%column (:) = ispval - allocate(this%wtcol (begp:endp)); this%wtcol (:) = nan - - allocate(this%mxy (begp:endp)); this%mxy (:) = ispval - allocate(this%active (begp:endp)); this%active (:) = .false. - - ! TODO (MV, 10-17-14): The following must be commented out because - ! currently the logic checking if patch%itype(p) is not equal to noveg - ! is used in RootBiogeophysMod in zeng2001_rootfr- a filter is not used - ! in that routine - which would elimate this problem - - allocate(this%itype (begp:endp)); this%itype (:) = ispval - - allocate(this%is_fates (begp:endp)); this%is_fates (:) = .false. - - if (use_fates) then - allocate(this%is_veg (begp:endp)); this%is_veg (:) = .false. - allocate(this%is_bareground (begp:endp)); this%is_bareground (:) = .false. - allocate(this%wt_ed (begp:endp)); this%wt_ed (:) = nan - end if - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine Clean(this) - ! - ! !ARGUMENTS: - class(patch_type) :: this - !------------------------------------------------------------------------ - - deallocate(this%gridcell) - deallocate(this%wtgcell ) - deallocate(this%landunit) - deallocate(this%wtlunit ) - deallocate(this%column ) - deallocate(this%wtcol ) - deallocate(this%itype ) - deallocate(this%mxy ) - deallocate(this%active ) - deallocate(this%is_fates) - - if (use_fates) then - deallocate(this%is_veg) - deallocate(this%is_bareground) - deallocate(this%wt_ed) - end if - - end subroutine Clean - -end module PatchType diff --git a/src/main/TopoMod.F90 b/src/main/TopoMod.F90 deleted file mode 100644 index 43b935bed0..0000000000 --- a/src/main/TopoMod.F90 +++ /dev/null @@ -1,321 +0,0 @@ -module TopoMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handles topographic height of each column - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use PatchType , only : patch - use ColumnType , only : col - use LandunitType , only : lun - use glc2lndMod , only : glc2lnd_type - use glcBehaviorMod , only : glc_behavior_type - use landunit_varcon, only : istice_mec - use filterColMod , only : filter_col_type, col_filter_from_logical_array_active_only - ! - ! !PUBLIC TYPES: - implicit none - save - private - - type, public :: topo_type - private - - ! Public member data - - real(r8), pointer, public :: topo_col(:) ! surface elevation (m) - - ! Private member data - - logical, pointer :: needs_downscaling_col(:) ! whether a column needs to be downscaled - contains - procedure, public :: Init - procedure, public :: Restart - procedure, public :: Clean - procedure, public :: UpdateTopo ! Update topographic height each time step - procedure, public :: DownscaleFilterc ! Returns column-level filter: which columns need downscaling - - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - end type topo_type - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds) - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - begc = bounds%begc - endc = bounds%endc - - allocate(this%topo_col(begc:endc)) - this%topo_col(:) = nan - - allocate(this%needs_downscaling_col(begc:endc)) - this%needs_downscaling_col(:) = .false. - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! !USES: - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - call hist_addfld1d(fname='TOPO_COL', units='m', & - avgflag='A', long_name='column-level topographic height', & - ptr_col=this%topo_col, default='inactive') - - call hist_addfld1d(fname='TOPO_COL_ICE', units='m', & - avgflag='A', long_name='column-level topographic height (ice landunits only)', & - ptr_col=this%topo_col, l2g_scale_type='ice', default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! !USES: - use column_varcon , only: col_itype_to_icemec_class - use clm_instur, only : topo_glc_mec - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c, l, g - integer :: icemec_class ! current icemec class (1..maxpatch_glcmec) - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - g = col%gridcell(c) - - if (lun%itype(l) == istice_mec) then - ! For ice_mec landunits, initialize topo_col based on surface dataset; this - ! will get overwritten in the run loop by values sent from CISM - icemec_class = col_itype_to_icemec_class(col%itype(c)) - this%topo_col(c) = topo_glc_mec(g, icemec_class) - this%needs_downscaling_col(c) = .true. - else - ! For other landunits, arbitrarily initialize topo_col to 0 m; for landunits - ! where this matters, this will get overwritten in the run loop by values sent - ! from CISM - this%topo_col(c) = 0._r8 - this%needs_downscaling_col(c) = .false. - end if - end do - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! !USES: - use ncdio_pio, only : file_desc_t, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read', 'write' or 'define' - ! - ! !LOCAL VARIABLES: - integer :: p, c - real(r8), pointer :: rparr(:) - logical :: readvar - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - allocate(rparr(bounds%begp:bounds%endp)) - - ! TODO(wjs, 2016-04-05) Rename these restart variables to get rid of 'glc' in their - ! names. However, this will require some changes to init_interp, too. - - ! This one is not actually an area, but has interpinic_flag='area' because we want to - ! interpolate it under the same conditions under which we interpolate areas. - call restartvar(ncid=ncid, flag=flag, varname='cols1d_topoglc', xtype=ncd_double, & - dim1name='column', & - long_name='mean elevation on glacier elevation classes', units='m', & - interpinic_flag='area', readvar=readvar, data=this%topo_col) - - if (flag /= 'read') then - do p=bounds%begp,bounds%endp - c = patch%column(p) - rparr(p) = this%topo_col(c) - enddo - ! This one has interpinic_flag = 'skip' because it isn't read back in - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_topoglc', xtype=ncd_double, & - dim1name='pft', & - long_name='mean elevation on glacier elevation classes', units='m', & - interpinic_flag='skip', readvar=readvar, data=rparr) - end if - - deallocate(rparr) - - end subroutine Restart - - - !----------------------------------------------------------------------- - subroutine UpdateTopo(this, bounds, num_icemecc, filter_icemecc, & - glc2lnd_inst, glc_behavior, atm_topo) - ! - ! !DESCRIPTION: - ! Update topographic heights - ! - ! Should be called each time step. - ! - ! Should be called after glc2lndMod:update_glc2lnd_fracs, and before - ! atm2lndMod:downscale_forcings - ! - ! !ARGUMENTS: - class(topo_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_icemecc ! number of points in filter_icemecc - integer , intent(in) :: filter_icemecc(:) ! col filter for ice_mec - type(glc2lnd_type) , intent(in) :: glc2lnd_inst - type(glc_behavior_type) , intent(in) :: glc_behavior - real(r8) , intent(in) :: atm_topo( bounds%begg: ) ! atmosphere topographic height [m] - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: c, g - - character(len=*), parameter :: subname = 'UpdateTopo' - !----------------------------------------------------------------------- - - begc = bounds%begc - endc = bounds%endc - - ! Reset needs_downscaling_col each time step, because this is potentially - ! time-varying for some columns. It's simplest just to reset it everywhere, rather - ! than trying to figure out where it does and does not need to be reset. - this%needs_downscaling_col(begc:endc) = .false. - - call glc_behavior%icemec_cols_need_downscaling(bounds, num_icemecc, filter_icemecc, & - this%needs_downscaling_col(begc:endc)) - - ! In addition to updating topo_col, this also sets some additional elements of - ! needs_downscaling_col to .true. (but leaves the already-.true. values as is.) - call glc2lnd_inst%update_glc2lnd_topo(bounds, & - this%topo_col(begc:endc), & - this%needs_downscaling_col(begc:endc)) - - ! For any point that isn't downscaled, set its topo value to the atmosphere's - ! topographic height. This shouldn't matter, but is useful if topo_col is written to - ! the history file. - ! - ! This could operate over a filter like 'allc' in order to just operate over active - ! points, but I'm not sure that would speed things up much, and would require passing - ! in this additional filter. - do c = bounds%begc, bounds%endc - if (.not. this%needs_downscaling_col(c)) then - g = col%gridcell(c) - this%topo_col(c) = atm_topo(g) - end if - end do - - call glc_behavior%update_glc_classes(bounds, this%topo_col(begc:endc)) - - end subroutine UpdateTopo - - !----------------------------------------------------------------------- - function DownscaleFilterc(this, bounds) result(filter) - ! - ! !DESCRIPTION: - ! Returns a column-level filter: which columns need downscaling. - ! - ! This filter only contains active points. - ! - ! The main reason it's important to have this filter (as opposed to just doing the - ! downscaling for all columns) is because of downscaled fields that are normalized - ! (like longwave radiation): Consider a gridcell with a glc_mec column and a - ! vegetated column (outside of the icemask, so the vegetated column doesn't have its - ! topographic height explicitly set). If we called the downscaling code for all - ! columns, the longwave radiation would get adjusted over the vegetated column. This - ! is undesirable, because it means that adding a downscaled column in a gridcell can - ! change answers for all other columns in that gridcell. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - class(topo_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'DownscaleFilterc' - !----------------------------------------------------------------------- - - ! Currently this creates the filter on the fly, recreating it every time this function - ! is called. In principle, we should be able to compute and save this filter when - ! UpdateTopo is called, returning the already-computed filter when this function is - ! called. However, the problem with that is the need to have a different filter for - ! each clump (and potentially another filter for calls from outside a clump - ! loop). This will become easier to handle if we rework CLM's threading so that there - ! is a separate instance of each object for each clump: in that case, we'll have - ! multiple instances of topo_type, each corresponding to one clump, each with its own - ! filter. - - filter = col_filter_from_logical_array_active_only(bounds, & - this%needs_downscaling_col(bounds%begc:bounds%endc)) - - end function DownscaleFilterc - - - !----------------------------------------------------------------------- - subroutine Clean(this) - ! !ARGUMENTS: - class(topo_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - deallocate(this%topo_col) - deallocate(this%needs_downscaling_col) - - end subroutine Clean - -end module TopoMod diff --git a/src/main/abortutils.F90 b/src/main/abortutils.F90 deleted file mode 100644 index 9f9ce56272..0000000000 --- a/src/main/abortutils.F90 +++ /dev/null @@ -1,95 +0,0 @@ -module abortutils - - !----------------------------------------------------------------------- - ! !MODULE: abortutils - ! - ! !DESCRIPTION: - ! Abort the model for abnormal termination - !----------------------------------------------------------------------- - - private - save - - public :: endrun - - interface endrun - module procedure endrun_vanilla - module procedure endrun_globalindex - end interface - -CONTAINS - - !----------------------------------------------------------------------- - subroutine endrun_vanilla(msg, additional_msg) - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Abort the model for abnormal termination - ! - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - ! - ! !ARGUMENTS: - implicit none - - ! Generally you want to at least provide msg. The main reason to separate msg from - ! additional_msg is to supported expected-exception unit testing: you can put - ! volatile stuff in additional_msg, as in: - ! call endrun(msg='Informative message', additional_msg=errmsg(__FILE__, __LINE__)) - ! and then just assert against msg. - character(len=*), intent(in), optional :: msg ! string to be passed to shr_sys_abort - character(len=*), intent(in), optional :: additional_msg ! string to be printed, but not passed to shr_sys_abort - !----------------------------------------------------------------------- - - if (present (additional_msg)) then - write(iulog,*)'ENDRUN: ', additional_msg - else - write(iulog,*)'ENDRUN:' - end if - - call shr_sys_abort(msg) - - end subroutine endrun_vanilla - - !----------------------------------------------------------------------- - subroutine endrun_globalindex(decomp_index, clmlevel, msg, additional_msg) - - !----------------------------------------------------------------------- - ! Description: - ! Abort the model for abnormal termination - ! - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - use GetGlobalValuesMod, only: GetGlobalWrite - ! - ! Arguments: - implicit none - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - - ! Generally you want to at least provide msg. The main reason to separate msg from - ! additional_msg is to supported expected-exception unit testing: you can put - ! volatile stuff in additional_msg, as in: - ! call endrun(msg='Informative message', additional_msg=errmsg(__FILE__, __LINE__)) - ! and then just assert against msg. - character(len=*), intent(in), optional :: msg ! string to be passed to shr_sys_abort - character(len=*), intent(in), optional :: additional_msg ! string to be printed, but not passed to shr_sys_abort - ! - ! Local Variables: - integer :: igrc, ilun, icol - !----------------------------------------------------------------------- - - write(6,*)'calling getglobalwrite with decomp_index= ',decomp_index,' and clmlevel= ',trim(clmlevel) - call GetGlobalWrite(decomp_index, clmlevel) - - if (present (additional_msg)) then - write(iulog,*)'ENDRUN: ', additional_msg - else - write(iulog,*)'ENDRUN:' - end if - - call shr_sys_abort(msg) - - end subroutine endrun_globalindex - -end module abortutils diff --git a/src/main/accumulMod.F90 b/src/main/accumulMod.F90 deleted file mode 100644 index 29a52ceb52..0000000000 --- a/src/main/accumulMod.F90 +++ /dev/null @@ -1,827 +0,0 @@ -module accumulMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! This module contains generic subroutines that can be used to - ! define, accumulate and extract user-specified fields over - ! user-defined intervals. Each interval and accumulation type is - ! unique to each field processed. - ! Subroutine [init_accumulator] defines the values of the accumulated - ! field data structure. Subroutine [update_accum_field] does - ! the actual accumulation for a given field. - ! Three types of accumulations are possible: - ! - Average over time interval. Time average fields are only - ! valid at the end of the averaging interval. - ! - Running mean over time interval. Running means are valid once the - ! length of the simulation exceeds the - ! - Running accumulation over time interval. Accumulated fields are - ! continuously accumulated. The trigger value "-99999." resets - ! the accumulation to zero. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_sys_mod , only: shr_sys_abort - use shr_log_mod , only: errMsg => shr_log_errMsg - use abortutils , only: endrun - use clm_varctl , only: iulog, nsrest, nsrStartup - use clm_varcon , only: spval, ispval - use PatchType , only : patch - use ColumnType , only : col - use LandunitType, only : lun - use GridcellType, only : grc - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: accumulRest ! Write/read restart of accumulation fields - public :: init_accum_field ! Initialize an accumulator field - public :: print_accum_fields ! Print info about accumulator fields - public :: extract_accum_field ! Extracts the current value of an accumulator field - public :: update_accum_field ! Update the current value of an accumulator field - public :: clean_accum_fields ! Deallocate space and reset accum fields list - - interface extract_accum_field - module procedure extract_accum_field_sl ! Extract current val of single-level accumulator field - module procedure extract_accum_field_ml ! Extract current val of multi-level accumulator field - end interface - interface update_accum_field ! Updates the current value of an accumulator field - module procedure update_accum_field_sl ! Update single-level accumulator field - module procedure update_accum_field_ml ! Update multi-level accumulator field - end interface - private - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: extract_accum_field_basic ! Extract values for one level of the given field - private :: extract_accum_field_timeavg ! Extract values for one level of the given timeavg field - private :: update_accum_field_timeavg ! Update values for one level of the given timeavg field - private :: update_accum_field_runmean ! Update values for one level of the given runmean field - private :: update_accum_field_runaccum ! Update values for one level of the given runaccum field - private :: find_field ! Find field index given field name - private :: acctype_to_string ! Return a string representation of an ACCTYPE parameter - ! - ! !PRIVATE TYPES: - - type accum_field - character(len= 8) :: name !field name - character(len=128) :: desc !field description - character(len= 8) :: units !field units - integer :: acctype !accumulation type (see ACCTYPE parameters below) - character(len= 8) :: type1d !subgrid type: ["gridcell","landunit","column" or "pft"] - character(len= 8) :: type2d !type2d ('','levsoi','numrad',..etc. ) - integer :: beg1d !subgrid type beginning index - integer :: end1d !subgrid type ending index - integer :: numlev !number of vertical levels in field - logical, pointer :: active(:)!whether each point (patch, column, etc.) is active - real(r8) :: initval !initial value of accumulated field - real(r8), pointer :: val(:,:) !accumulated field - integer :: period !field accumulation period (in model time steps) - - ! In most cases, we could use a 1-d nsteps variable. However, that's awkward within - ! nested loops (with level as the outer loop); also, runaccum can theoretically have - ! different reset points for different levels. - integer, pointer :: nsteps(:,:)!number of steps each point has accumulated, since last reset time - - ! NOTE(wjs, 2017-12-03) We should convert this to fully object-oriented (with - ! inheritance / polymorphism). For now, in the interest of time, I'm going with a - ! semi-object-oriented solution of using procedure pointers. - procedure(extract_accum_field_interface), pointer :: extract_accum_field_func - procedure(update_accum_field_interface) , pointer :: update_accum_field_func - end type accum_field - - abstract interface - subroutine extract_accum_field_interface(this, level, nstep, field) - use shr_kind_mod, only: r8 => shr_kind_r8 - import :: accum_field - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to extract (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(inout) :: field(:) ! field values for current time step - end subroutine extract_accum_field_interface - - subroutine update_accum_field_interface(this, level, nstep, field) - use shr_kind_mod, only: r8 => shr_kind_r8 - import :: accum_field - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to update (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(in) :: field(:) ! field values for current time step - end subroutine update_accum_field_interface - end interface - - real(r8), parameter, public :: accumResetVal = -99999._r8 ! used to do an annual reset ( put in for bug 1858) - - integer, parameter :: ACCTYPE_TIMEAVG = 1 - integer, parameter :: ACCTYPE_RUNMEAN = 2 - integer, parameter :: ACCTYPE_RUNACCUM = 3 - - integer, parameter :: max_accum = 100 !maximum number of accumulated fields - type (accum_field) :: accum(max_accum) !array accumulated fields - integer :: naccflds = 0 !accumulator field counter - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine init_accum_field (name, units, desc, & - accum_type, accum_period, numlev, subgrid_type, init_value, type2d) - ! - ! !DESCRIPTION: - ! Initialize accumulation fields. This subroutine sets: - ! o name of accumulated field - ! o units of accumulated field - ! o accumulation type of accumulated field - ! o description of accumulated fields: accdes - ! o accumulation period for accumulated field (in iterations) - ! o initial value of accumulated field - ! - ! Note about initial value: This must be 0 for a timeavg or runaccum field. For a - ! runmean field, initializing to a non-zero value often won't accomplish anything, but - ! can be used to start with a reasonable value in situations such as: (1) the field is - ! extracted before the first update call; (2) edge case situations such as doing a - ! branch run from a restart file that did not contain this field (though it's - ! possible that init_value doesn't matter even in this case). - ! - ! !USES: - use shr_const_mod, only: SHR_CONST_CDAY - use clm_time_manager, only : get_step_size - use decompMod, only : get_proc_bounds - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - character(len=*), intent(in) :: units !field units - character(len=*), intent(in) :: desc !field description - character(len=*), intent(in) :: accum_type !field type: timeavg, runmean, runaccum - integer , intent(in) :: accum_period !field accumulation period - character(len=*), intent(in) :: subgrid_type !["gridcell","landunit","column" or "patch"] - integer , intent(in) :: numlev !number of vertical levels - real(r8), intent(in) :: init_value !field initial or reset value - character(len=*), intent(in), optional :: type2d !level type (optional) - needed if numlev > 1 - ! - ! !LOCAL VARIABLES: - integer :: nf ! field index - integer :: beg1d,end1d ! beggining and end subgrid indices - integer :: begp, endp ! per-proc beginning and ending patch indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: begCohort, endCohort ! per-proc beg end cohort indices - !------------------------------------------------------------------------ - - ! Determine necessary indices - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort ) - - ! update field index - ! Consistency check that number of accumulated does not exceed maximum. - - naccflds = naccflds + 1 - if (naccflds > max_accum) then - write(iulog,*) 'ACCUMULINIT error: user-defined accumulation fields ', & - 'equal to ',naccflds,' exceeds max_accum' - call shr_sys_abort() - end if - nf = naccflds - - select case (trim(accum_type)) - case ('timeavg') - accum(nf)%acctype = ACCTYPE_TIMEAVG - accum(nf)%extract_accum_field_func => extract_accum_field_timeavg - accum(nf)%update_accum_field_func => update_accum_field_timeavg - case ('runmean') - accum(nf)%acctype = ACCTYPE_RUNMEAN - accum(nf)%extract_accum_field_func => extract_accum_field_basic - accum(nf)%update_accum_field_func => update_accum_field_runmean - case ('runaccum') - accum(nf)%acctype = ACCTYPE_RUNACCUM - accum(nf)%extract_accum_field_func => extract_accum_field_basic - accum(nf)%update_accum_field_func => update_accum_field_runaccum - case default - write(iulog,*) 'init_accum_field ERROR: unknown accum_type ', accum_type - call shr_sys_abort('init_accum_field: unknown accum_type') - end select - - accum(nf)%name = trim(name) - accum(nf)%units = trim(units) - accum(nf)%desc = trim(desc) - accum(nf)%initval = init_value - - ! Note accumulation period must be converted from days - ! to number of iterations - accum(nf)%period = accum_period - if (accum(nf)%period < 0) then - accum(nf)%period = -accum(nf)%period * nint(SHR_CONST_CDAY) / get_step_size() - end if - - select case (trim(subgrid_type)) - case ('gridcell') - beg1d = begg - end1d = endg - accum(nf)%active => grc%active - case ('landunit') - beg1d = begl - end1d = endl - accum(nf)%active => lun%active - case ('column') - beg1d = begc - end1d = endc - accum(nf)%active => col%active - case ('pft') - beg1d = begp - end1d = endp - accum(nf)%active => patch%active - case default - write(iulog,*)'init_accum_field: unknown subgrid type ',subgrid_type - call shr_sys_abort () - end select - - accum(nf)%type1d = trim(subgrid_type) - accum(nf)%beg1d = beg1d - accum(nf)%end1d = end1d - accum(nf)%numlev = numlev - - if (present(type2d)) then - accum(nf)%type2d = type2d - else - accum(nf)%type2d = ' ' - end if - - ! Allocate and initialize accumulation field - - allocate(accum(nf)%val(beg1d:end1d,numlev)) - if (accum(nf)%acctype == ACCTYPE_TIMEAVG .or. & - accum(nf)%acctype == ACCTYPE_RUNACCUM) then - if (init_value /= 0._r8) then - write(iulog,*) 'init_accum_field ERROR: for field ', trim(name) - write(iulog,*) 'init_value must be 0 for timeavg and runaccum fields' - call shr_sys_abort('init_accum_field: init_value must be 0 for timeavg and runaccum fields') - end if - end if - accum(nf)%val(beg1d:end1d,1:numlev) = init_value - - allocate(accum(nf)%nsteps(beg1d:end1d,numlev)) - accum(nf)%nsteps(beg1d:end1d,1:numlev) = 0 - - end subroutine init_accum_field - - !------------------------------------------------------------------------ - subroutine print_accum_fields() - ! - ! !DESCRIPTION: - ! Diagnostic printout of accumulated fields - ! - ! !USES: - use spmdMod, only : masterproc - ! - ! !ARGUMENTS: - implicit none - ! - integer :: i,nf !indices - !------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*) - write(iulog,*) 'Initializing variables for time accumulation .....' - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Accumulated fields' - write(iulog,1002) - write(iulog,'(72a1)') ("_",i=1,71) - do nf = 1, naccflds - if (accum(nf)%period /= huge(1)) then - write(iulog,1003) nf,accum(nf)%name,accum(nf)%units,& - acctype_to_string(accum(nf)%acctype), & - accum(nf)%period, accum(nf)%initval, & - accum(nf)%desc - else - write(iulog,1004) nf,accum(nf)%name,accum(nf)%units,& - acctype_to_string(accum(nf)%acctype), & - accum(nf)%initval, accum(nf)%desc - endif - end do - write(iulog,'(72a1)') ("_",i=1,71) - write(iulog,*) - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Successfully initialized variables for accumulation' - write(iulog,*) - endif - -1002 format(' No',' Name ',' Units ',' Type ','Period',' Inival',' Description') -1003 format((1x,i2),(1x,a8),(1x,a8),(1x,a8), (1x,i5),(1x,f4.0),(1x,a40)) -1004 format((1x,i2),(1x,a8),(1x,a8),(1x,a8),' N.A.',(1x,f4.0),(1x,a40)) - - end subroutine print_accum_fields - - !------------------------------------------------------------------------ - subroutine extract_accum_field_sl (name, field, nstep) - ! - ! !DESCRIPTION: - ! Extract single-level accumulated field. - ! This routine extracts the field values from the multi-level - ! accumulation field. It extracts the current value except if - ! the field type is a time average. In this case, an absurd value - ! is assigned to indicate the time average is not yet valid. - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:) :: field !field values for current time step - integer , intent(in) :: nstep !timestep index - ! - ! !LOCAL VARIABLES: - integer :: nf ! field index - integer :: numlev ! number of vertical levels - - character(len=*), parameter :: subname = 'extract_accum_field_sl' - !------------------------------------------------------------------------ - - call find_field(field_name=name, caller_name=subname, field_index=nf) - - numlev = accum(nf)%numlev - SHR_ASSERT(numlev == 1, errMsg(sourcefile, __LINE__)) - - call accum(nf)%extract_accum_field_func( & - level = 1, & - nstep = nstep, & - field = field) - - end subroutine extract_accum_field_sl - - !------------------------------------------------------------------------ - subroutine extract_accum_field_ml (name, field, nstep) - ! - ! !DESCRIPTION: - ! Extract mutli-level accumulated field. - ! This routine extracts the field values from the multi-level - ! accumulation field. It extracts the current value except if - ! the field type is a time average. In this case, an absurd value - ! is assigned to indicate the time average is not yet valid. - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:,:) :: field !field values for current time step - integer, intent(in) :: nstep !timestep index - ! - ! !LOCAL VARIABLES: - integer :: j,nf !indices - integer :: numlev !number of vertical levels - - character(len=*), parameter :: subname = 'extract_accum_field_ml' - !------------------------------------------------------------------------ - - call find_field(field_name=name, caller_name=subname, field_index=nf) - - numlev = accum(nf)%numlev - SHR_ASSERT((size(field, 2) == numlev), errMsg(sourcefile, __LINE__)) - - do j = 1,numlev - call accum(nf)%extract_accum_field_func( & - level = j, & - nstep = nstep, & - field = field(:,j)) - end do - - end subroutine extract_accum_field_ml - - !----------------------------------------------------------------------- - subroutine extract_accum_field_basic(this, level, nstep, field) - ! !DESCRIPTION: - ! Extract values for one level of the given field - ! - ! !ARGUMENTS: - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to extract (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(inout) :: field(:) ! field values for current time step - ! - ! !LOCAL VARIABLES: - integer :: begi,endi !subgrid beginning,ending indices - integer :: k, kf - - character(len=*), parameter :: subname = 'extract_accum_field_basic' - !----------------------------------------------------------------------- - - begi = this%beg1d - endi = this%end1d - SHR_ASSERT((size(field) == endi-begi+1), errMsg(sourcefile, __LINE__)) - - do k = begi, endi - kf = k - begi + 1 - field(kf) = this%val(k,level) - end do - - end subroutine extract_accum_field_basic - - !----------------------------------------------------------------------- - subroutine extract_accum_field_timeavg(this, level, nstep, field) - ! !DESCRIPTION: - ! Extract values for one level of the given timeavg field - ! - ! !ARGUMENTS: - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to extract (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(inout) :: field(:) ! field values for current time step - ! - ! !LOCAL VARIABLES: - integer :: begi,endi !subgrid beginning,ending indices - integer :: k, kf - - character(len=*), parameter :: subname = 'extract_accum_field_basic' - !----------------------------------------------------------------------- - - begi = this%beg1d - endi = this%end1d - SHR_ASSERT((size(field) == endi-begi+1), errMsg(sourcefile, __LINE__)) - - if (mod(nstep,this%period) == 0) then - do k = begi, endi - kf = k - begi + 1 - field(kf) = this%val(k,level) - end do - else - do k = begi, endi - kf = k - begi + 1 - field(kf) = spval - end do - end if - - end subroutine extract_accum_field_timeavg - - !------------------------------------------------------------------------ - subroutine update_accum_field_sl (name, field, nstep) - ! - ! !DESCRIPTION: - ! Accumulate single level field over specified time interval. - ! The appropriate field is accumulated in the array [accval]. - ! - ! Values of 'field' are ignored in inactive points, so it's safe for 'field' to - ! contain garbage in inactive points. - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:) :: field !field values for current time step - integer , intent(in) :: nstep !time step index - ! - ! !LOCAL VARIABLES: - integer :: nf ! field index - integer :: numlev ! number of vertical levels - - character(len=*), parameter :: subname = 'update_accum_field_sl' - !------------------------------------------------------------------------ - - call find_field(field_name=name, caller_name=subname, field_index=nf) - - numlev = accum(nf)%numlev - SHR_ASSERT(numlev == 1, errMsg(sourcefile, __LINE__)) - - call accum(nf)%update_accum_field_func( & - level = 1, & - nstep = nstep, & - field = field) - - end subroutine update_accum_field_sl - - !------------------------------------------------------------------------ - subroutine update_accum_field_ml (name, field, nstep) - ! - ! !DESCRIPTION: - ! Accumulate multi level field over specified time interval. - ! - ! Values of 'field' are ignored in inactive points, so it's safe for 'field' to - ! contain garbage in inactive points. - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:,:) :: field !field values for current time step - integer , intent(in) :: nstep !time step index - ! - ! !LOCAL VARIABLES: - integer :: j,nf !indices - integer :: numlev !number of vertical levels - - character(len=*), parameter :: subname = 'update_accum_field_ml' - !------------------------------------------------------------------------ - - call find_field(field_name=name, caller_name=subname, field_index=nf) - - numlev = accum(nf)%numlev - SHR_ASSERT((size(field, 2) == numlev), errMsg(sourcefile, __LINE__)) - - do j = 1,numlev - call accum(nf)%update_accum_field_func( & - level = j, & - nstep = nstep, & - field = field(:,j)) - end do - - end subroutine update_accum_field_ml - - !----------------------------------------------------------------------- - subroutine update_accum_field_timeavg(this, level, nstep, field) - ! - ! !DESCRIPTION: - ! Update values for one level of the given timeavg field - ! - ! !ARGUMENTS: - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to update (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(in) :: field(:) ! field values for current time step - ! - ! !LOCAL VARIABLES: - integer :: begi,endi !subgrid beginning,ending indices - integer :: k, kf - - character(len=*), parameter :: subname = 'update_accum_field_timeavg' - !----------------------------------------------------------------------- - - begi = this%beg1d - endi = this%end1d - SHR_ASSERT((size(field) == endi-begi+1), errMsg(sourcefile, __LINE__)) - - ! time average field: reset every accumulation period; normalize at end of - ! accumulation period - - if ((mod(nstep,this%period) == 1 .or. this%period == 1) .and. (nstep /= 0))then - do k = begi,endi - if (this%active(k)) then - this%val(k,level) = 0._r8 - this%nsteps(k,level) = 0 - end if - end do - end if - - do k = begi,endi - if (this%active(k)) then - kf = k - begi + 1 - this%val(k,level) = this%val(k,level) + field(kf) - this%nsteps(k,level) = this%nsteps(k,level) + 1 - end if - end do - - if (mod(nstep,this%period) == 0) then - do k = begi,endi - if (this%active(k)) then - this%val(k,level) = this%val(k,level) / this%nsteps(k,level) - end if - end do - end if - - end subroutine update_accum_field_timeavg - - !----------------------------------------------------------------------- - subroutine update_accum_field_runmean(this, level, nstep, field) - ! - ! !DESCRIPTION: - ! Update values for one level of the given runmean field - ! - ! !ARGUMENTS: - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to update (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(in) :: field(:) ! field values for current time step - ! - ! !LOCAL VARIABLES: - integer :: begi,endi !subgrid beginning,ending indices - integer :: k, kf - integer :: accper ! accumulation period - - character(len=*), parameter :: subname = 'update_accum_field_runmean' - !----------------------------------------------------------------------- - - begi = this%beg1d - endi = this%end1d - SHR_ASSERT((size(field) == endi-begi+1), errMsg(sourcefile, __LINE__)) - - do k = begi,endi - if (this%active(k)) then - kf = k - begi + 1 - this%nsteps(k,level) = this%nsteps(k,level) + 1 - ! Cap nsteps at 'period' - partly to avoid overflow, but also because it doesn't - ! help us to accumulate nsteps beyond a value of 'period' (because nsteps is - ! just used to determine accper, and accper needs to be capped at 'period'). A - ! side-benefit of this capping of nsteps is that accper (the accumulation - ! period) is always equal to nsteps. - this%nsteps(k,level) = min(this%nsteps(k,level), this%period) - accper = this%nsteps(k,level) - this%val(k,level) = & - ((accper-1)*this%val(k,level) + field(kf)) / accper - end if - end do - - end subroutine update_accum_field_runmean - - !----------------------------------------------------------------------- - subroutine update_accum_field_runaccum(this, level, nstep, field) - ! - ! !DESCRIPTION: - ! Update values for one level of the given runaccum field - ! - ! !ARGUMENTS: - class(accum_field), intent(in) :: this - integer, intent(in) :: level ! level index to update (1 for a 1-d field) - integer, intent(in) :: nstep ! timestep index - real(r8), intent(in) :: field(:) ! field values for current time step - ! - ! !LOCAL VARIABLES: - integer :: begi,endi !subgrid beginning,ending indices - integer :: k, kf - - character(len=*), parameter :: subname = 'update_accum_field_runaccum' - !----------------------------------------------------------------------- - - begi = this%beg1d - endi = this%end1d - SHR_ASSERT((size(field) == endi-begi+1), errMsg(sourcefile, __LINE__)) - - !running accumulation field; reset at trigger -99999 - - do k = begi,endi - if (this%active(k)) then - kf = k - begi + 1 - if (nint(field(kf)) == -99999) then - this%val(k,level) = 0._r8 - this%nsteps(k,level) = 0 - else - this%val(k,level) = & - min(max(this%val(k,level) + field(kf), 0._r8), 99999._r8) - this%nsteps(k,level) = this%nsteps(k,level) + 1 - end if - end if - end do - - end subroutine update_accum_field_runaccum - - - !------------------------------------------------------------------------ - subroutine accumulRest( ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write accumulation restart data - ! - ! !USES: - use restUtilMod , only : restartvar - use ncdio_pio , only : file_desc_t, ncd_double, ncd_int - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid !netcdf unit - character(len=*) , intent(in) :: flag !'define','read', or 'write' - ! - ! !LOCAL VARIABLES: - integer :: nf ! indices - logical :: readvar ! determine if variable is on initial file - character(len=128) :: varname ! temporary - character(len= 32) :: subname='AccumRest' ! subroutine name - !------------------------------------------------------------------------ - - do nf = 1,naccflds - - varname = trim(accum(nf)%name) // '_VALUE' - if (accum(nf)%numlev == 1) then - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name=accum(nf)%type1d, & - long_name=accum(nf)%desc, units=accum(nf)%units, & - interpinic_flag='interp', & - data=accum(nf)%val, readvar=readvar) - else - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name=accum(nf)%type1d, dim2name=accum(nf)%type2d, & - long_name=accum(nf)%desc, units=accum(nf)%units, & - interpinic_flag='interp', & - data=accum(nf)%val, readvar=readvar) - end if - - varname = trim(accum(nf)%name) // '_NSTEPS' - if (accum(nf)%numlev == 1) then - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_int, & - dim1name=accum(nf)%type1d, & - long_name='number of accumulated steps for '//trim(accum(nf)%name), & - units='-', & - interpinic_flag='interp', & - data=accum(nf)%nsteps, readvar=readvar) - else - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_int, & - dim1name=accum(nf)%type1d, dim2name=accum(nf)%type2d, & - long_name='number of accumulated steps for '//trim(accum(nf)%name), & - units='-', & - interpinic_flag='interp', & - data=accum(nf)%nsteps, readvar=readvar) - end if - - varname = trim(accum(nf)%name) // '_PERIOD' - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_int, & - long_name='', units='time steps', & - imissing_value=ispval, ifill_value=huge(1), & - interpinic_flag='copy', & - data=accum(nf)%period, readvar=readvar) - - end do - - end subroutine accumulRest - - !----------------------------------------------------------------------- - subroutine clean_accum_fields - ! - ! !DESCRIPTION: - ! Deallocate space and reset accum fields list - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'clean_accum_fields' - !----------------------------------------------------------------------- - - do i = 1, naccflds - if (associated(accum(i)%val)) then - deallocate(accum(i)%val) - end if - if (associated(accum(i)%nsteps)) then - deallocate(accum(i)%nsteps) - end if - end do - - naccflds = 0 - - end subroutine clean_accum_fields - - - !----------------------------------------------------------------------- - subroutine find_field(field_name, caller_name, field_index) - ! - ! !DESCRIPTION: - ! Find field index given field name - ! - ! Aborts if the given field name isn't found - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: field_name ! field name to find - character(len=*), intent(in) :: caller_name ! name of calling routine (for more informative error messages) - integer , intent(out) :: field_index ! index of given field in accum array - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'find_field' - !----------------------------------------------------------------------- - - field_index = 0 - do i = 1, naccflds - if (field_name == accum(i)%name) then - field_index = i - exit - end if - end do - if (field_index == 0) then - write(iulog,*) trim(caller_name), 'ERROR: field name ',trim(field_name),' not found' - call endrun('Accumulation field not found') - end if - - end subroutine find_field - - - !----------------------------------------------------------------------- - pure function acctype_to_string(acctype) result(acctype_str) - ! - ! !DESCRIPTION: - ! Return a string representation of an ACCTYPE parameter - ! - ! !ARGUMENTS: - character(len=32) :: acctype_str ! function result - integer, intent(in) :: acctype - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'acctype_to_string' - !----------------------------------------------------------------------- - - select case (acctype) - case (ACCTYPE_TIMEAVG) - acctype_str = 'timeavg' - case (ACCTYPE_RUNMEAN) - acctype_str = 'runmean' - case (ACCTYPE_RUNACCUM) - acctype_str = 'runaccum' - case default - acctype_str = 'unknown' - end select - - end function acctype_to_string - - -end module accumulMod diff --git a/src/main/atm2lndMod.F90 b/src/main/atm2lndMod.F90 deleted file mode 100644 index c54ddcd12a..0000000000 --- a/src/main/atm2lndMod.F90 +++ /dev/null @@ -1,682 +0,0 @@ -module atm2lndMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle atm2lnd forcing - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. - use clm_varcon , only : rair, grav, cpair, hfus, tfrz, denh2o, spval - use clm_varcon , only : wv_to_dair_weight_ratio - use clm_varctl , only : iulog, use_c13, use_cn, use_lch4, iulog - use abortutils , only : endrun - use decompMod , only : bounds_type - use atm2lndType , only : atm2lnd_type - use TopoMod , only : topo_type - use filterColMod , only : filter_col_type - use LandunitType , only : lun - use ColumnType , only : col - use landunit_varcon, only : istice_mec - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: downscale_forcings ! Downscale atm forcing fields from gridcell to column - - ! The following routines are public for the sake of unit testing; they should not be - ! called by production code outside this module - public :: partition_precip ! Partition precipitation into rain/snow - public :: sens_heat_from_precip_conversion ! Compute sensible heat flux needed to compensate for rain-snow conversion - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: rhos ! calculate atmospheric density - private :: repartition_rain_snow_one_col ! Re-partition precipitation for a single column - private :: downscale_longwave ! Downscale longwave radiation from gridcell to column - private :: build_normalization ! Compute normalization factors so that downscaled fields are conservative - private :: check_downscale_consistency ! Check consistency of downscaling - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine downscale_forcings(bounds, & - topo_inst, atm2lnd_inst, eflx_sh_precip_conversion) - ! - ! !DESCRIPTION: - ! Downscale atmospheric forcing fields from gridcell to column. - ! - ! Downscaling is done based on the difference between each CLM column's elevation and - ! the atmosphere's surface elevation (which is the elevation at which the atmospheric - ! forcings are valid). - ! - ! Note that the downscaling procedure can result in changes in grid cell mean values - ! compared to what was provided by the atmosphere. We conserve fluxes of mass and - ! energy, but allow states such as temperature to differ. - ! - ! For most variables, downscaling is done over columns defined by - ! topo_inst%DownscaleFilterc. But we also do direct copies of gridcell-level forcings - ! into column-level forcings over all other active columns. In addition, precipitation - ! (rain vs. snow partitioning) is adjusted everywhere. - ! - ! !USES: - use clm_varcon , only : rair, cpair, grav - use QsatMod , only : Qsat - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - class(topo_type) , intent(in) :: topo_inst - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst - real(r8) , intent(out) :: eflx_sh_precip_conversion(bounds%begc:) ! sensible heat flux from precipitation conversion (W/m**2) [+ to atm] - ! - ! !LOCAL VARIABLES: - integer :: g, l, c, fc ! indices - integer :: clo, cc - type(filter_col_type) :: downscale_filter_c - - ! temporaries for topo downscaling - real(r8) :: hsurf_g,hsurf_c - real(r8) :: Hbot, zbot - real(r8) :: tbot_g, pbot_g, thbot_g, qbot_g, qs_g, es_g, rhos_g - real(r8) :: tbot_c, pbot_c, thbot_c, qbot_c, qs_c, es_c, rhos_c - real(r8) :: rhos_c_estimate, rhos_g_estimate - real(r8) :: dum1, dum2 - - character(len=*), parameter :: subname = 'downscale_forcings' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(eflx_sh_precip_conversion) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate(& - ! Parameters: - lapse_rate => atm2lnd_inst%params%lapse_rate , & ! Input: [real(r8)] Surface temperature lapse rate (K m-1) - - ! Gridcell-level metadata: - forc_topo_g => atm2lnd_inst%forc_topo_grc , & ! Input: [real(r8) (:)] atmospheric surface height (m) - - ! Column-level metadata: - topo_c => topo_inst%topo_col , & ! Input: [real(r8) (:)] column surface height (m) - - ! Gridcell-level non-downscaled fields: - forc_t_g => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric temperature (Kelvin) - forc_th_g => atm2lnd_inst%forc_th_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric potential temperature (Kelvin) - forc_q_g => atm2lnd_inst%forc_q_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric specific humidity (kg/kg) - forc_pbot_g => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric pressure (Pa) - forc_rho_g => atm2lnd_inst%forc_rho_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric density (kg/m**3) - - ! Column-level downscaled fields: - forc_t_c => atm2lnd_inst%forc_t_downscaled_col , & ! Output: [real(r8) (:)] atmospheric temperature (Kelvin) - forc_th_c => atm2lnd_inst%forc_th_downscaled_col , & ! Output: [real(r8) (:)] atmospheric potential temperature (Kelvin) - forc_q_c => atm2lnd_inst%forc_q_downscaled_col , & ! Output: [real(r8) (:)] atmospheric specific humidity (kg/kg) - forc_pbot_c => atm2lnd_inst%forc_pbot_downscaled_col , & ! Output: [real(r8) (:)] atmospheric pressure (Pa) - forc_rho_c => atm2lnd_inst%forc_rho_downscaled_col & ! Output: [real(r8) (:)] atmospheric density (kg/m**3) - ) - - ! Initialize column forcing (needs to be done for ALL active columns) - do c = bounds%begc,bounds%endc - if (col%active(c)) then - g = col%gridcell(c) - - forc_t_c(c) = forc_t_g(g) - forc_th_c(c) = forc_th_g(g) - forc_q_c(c) = forc_q_g(g) - forc_pbot_c(c) = forc_pbot_g(g) - forc_rho_c(c) = forc_rho_g(g) - end if - end do - - downscale_filter_c = topo_inst%DownscaleFilterc(bounds) - - ! Downscale forc_t, forc_th, forc_q, forc_pbot, and forc_rho to columns. - ! For glacier_mec columns the downscaling is based on surface elevation. - ! For other columns the downscaling is a simple copy (above). - do fc = 1, downscale_filter_c%num - c = downscale_filter_c%indices(fc) - l = col%landunit(c) - g = col%gridcell(c) - - ! This is a simple downscaling procedure - ! Note that forc_hgt, forc_u, and forc_v are not downscaled. - - hsurf_g = forc_topo_g(g) ! gridcell sfc elevation - hsurf_c = topo_c(c) ! column sfc elevation - tbot_g = forc_t_g(g) ! atm sfc temp - thbot_g = forc_th_g(g) ! atm sfc pot temp - qbot_g = forc_q_g(g) ! atm sfc spec humid - pbot_g = forc_pbot_g(g) ! atm sfc pressure - rhos_g = forc_rho_g(g) ! atm density - zbot = atm2lnd_inst%forc_hgt_grc(g) ! atm ref height - tbot_c = tbot_g-lapse_rate*(hsurf_c-hsurf_g) ! sfc temp for column - Hbot = rair*0.5_r8*(tbot_g+tbot_c)/grav ! scale ht at avg temp - pbot_c = pbot_g*exp(-(hsurf_c-hsurf_g)/Hbot) ! column sfc press - - ! Derivation of potential temperature calculation: - ! - ! The textbook definition would be: - ! thbot_c = tbot_c * (p0/pbot_c)^(rair/cpair) - ! - ! Note that pressure is related to scale height as: - ! pbot_c = p0 * exp(-zbot/H) - ! - ! Using Hbot in place of H, we get: - ! pbot_c = p0 * exp(-zbot/Hbot) - ! - ! Plugging this in to the textbook definition, then manipulating, we get: - ! thbot_c = tbot_c * (p0/(p0*exp(-zbot/Hbot)))^(rair/cpair) - ! = tbot_c * (1/exp(-zbot/Hbot))^(rair/cpair) - ! = tbot_c * (exp(zbot/Hbot))^(rair/cpair) - ! = tbot_c * exp((zbot/Hbot) * (rair/cpair)) - ! - ! But we want everything expressed in delta form, resulting in: - ! thbot_c = thbot_g + (tbot_c - tbot_g)*exp((zbot/Hbot)*(rair/cpair)) - - thbot_c= thbot_g + (tbot_c - tbot_g)*exp((zbot/Hbot)*(rair/cpair)) ! pot temp calc - - call Qsat(tbot_g,pbot_g,es_g,dum1,qs_g,dum2) - call Qsat(tbot_c,pbot_c,es_c,dum1,qs_c,dum2) - - qbot_c = qbot_g*(qs_c/qs_g) - - ! For forc_rho_c: We could simply set: - ! - ! rhos_c = rhos(pbot_c, egcm_c, tbot_c) - ! - ! However, we want forc_rho_c to be identical to forc_rho_g when topo_c equals - ! forc_topo_g. So we compute our own version of forc_rho_g using the rhos - ! function, and then multiply forc_rho_g by the ratio of (computed column-level - ! rho) to (computed gridcell-level rho). - rhos_c_estimate = rhos(qbot=qbot_c, pbot=pbot_c, tbot=tbot_c) - rhos_g_estimate = rhos(qbot=qbot_g, pbot=pbot_g, tbot=tbot_g) - rhos_c = rhos_g * (rhos_c_estimate / rhos_g_estimate) - - forc_t_c(c) = tbot_c - forc_th_c(c) = thbot_c - forc_q_c(c) = qbot_c - forc_pbot_c(c) = pbot_c - forc_rho_c(c) = rhos_c - - end do - - call partition_precip(bounds, atm2lnd_inst, & - eflx_sh_precip_conversion(bounds%begc:bounds%endc)) - - call downscale_longwave(bounds, downscale_filter_c, topo_inst, atm2lnd_inst) - - call check_downscale_consistency(bounds, atm2lnd_inst) - - end associate - - end subroutine downscale_forcings - - !----------------------------------------------------------------------- - pure function rhos(qbot, pbot, tbot) - ! - ! !DESCRIPTION: - ! Compute atmospheric density (kg/m**3) - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8) :: rhos ! function result: atmospheric density (kg/m**3) - real(r8), intent(in) :: qbot ! atmospheric specific humidity (kg/kg) - real(r8), intent(in) :: pbot ! atmospheric pressure (Pa) - real(r8), intent(in) :: tbot ! atmospheric temperature (K) - ! - ! !LOCAL VARIABLES: - real(r8) :: egcm - - character(len=*), parameter :: subname = 'rhos' - !----------------------------------------------------------------------- - - egcm = qbot*pbot / & - (wv_to_dair_weight_ratio + (1._r8 - wv_to_dair_weight_ratio)*qbot) - rhos = (pbot - (1._r8 - wv_to_dair_weight_ratio)*egcm) / (rair*tbot) - - end function rhos - - !----------------------------------------------------------------------- - subroutine partition_precip(bounds, atm2lnd_inst, eflx_sh_precip_conversion) - ! - ! !DESCRIPTION: - ! Partition precipitation into rain/snow based on temperature. - ! - ! Note that, unlike the other downscalings done here, this is currently applied over - ! all points - not just those within the downscale filter. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst - real(r8), intent(inout) :: eflx_sh_precip_conversion(bounds%begc:) ! sensible heat flux from precipitation conversion (W/m**2) [+ to atm] - ! - ! !LOCAL VARIABLES: - integer :: c,l,g ! indices - real(r8) :: rain_old ! rain before conversion - real(r8) :: snow_old ! snow before conversion - real(r8) :: all_snow_t ! temperature at which all precip falls as snow (K) - real(r8) :: frac_rain_slope ! slope of the frac_rain vs. temperature relationship - - character(len=*), parameter :: subname = 'partition_precip' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(eflx_sh_precip_conversion) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - associate(& - ! Gridcell-level non-downscaled fields: - forc_rain_g => atm2lnd_inst%forc_rain_not_downscaled_grc , & ! Input: [real(r8) (:)] rain rate [mm/s] - forc_snow_g => atm2lnd_inst%forc_snow_not_downscaled_grc , & ! Input: [real(r8) (:)] snow rate [mm/s] - - ! Column-level downscaled fields: - forc_t_c => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:)] atmospheric temperature (Kelvin) - forc_rain_c => atm2lnd_inst%forc_rain_downscaled_col , & ! Output: [real(r8) (:)] rain rate [mm/s] - forc_snow_c => atm2lnd_inst%forc_snow_downscaled_col & ! Output: [real(r8) (:)] snow rate [mm/s] - ) - - ! Initialize column forcing - do c = bounds%begc,bounds%endc - if (col%active(c)) then - g = col%gridcell(c) - forc_rain_c(c) = forc_rain_g(g) - forc_snow_c(c) = forc_snow_g(g) - eflx_sh_precip_conversion(c) = 0._r8 - end if - end do - - ! Optionally, convert rain to snow or vice versa based on forc_t_c - if (atm2lnd_inst%params%repartition_rain_snow) then - do c = bounds%begc, bounds%endc - if (col%active(c)) then - l = col%landunit(c) - rain_old = forc_rain_c(c) - snow_old = forc_snow_c(c) - if (lun%itype(l) == istice_mec) then - all_snow_t = atm2lnd_inst%params%precip_repartition_glc_all_snow_t - frac_rain_slope = atm2lnd_inst%params%precip_repartition_glc_frac_rain_slope - else - all_snow_t = atm2lnd_inst%params%precip_repartition_nonglc_all_snow_t - frac_rain_slope = atm2lnd_inst%params%precip_repartition_nonglc_frac_rain_slope - end if - call repartition_rain_snow_one_col(& - temperature = forc_t_c(c), & - all_snow_t = all_snow_t, & - frac_rain_slope = frac_rain_slope, & - rain = forc_rain_c(c), & - snow = forc_snow_c(c)) - call sens_heat_from_precip_conversion(& - rain_old = rain_old, & - snow_old = snow_old, & - rain_new = forc_rain_c(c), & - snow_new = forc_snow_c(c), & - sens_heat_flux = eflx_sh_precip_conversion(c)) - end if - end do - end if - - end associate - - end subroutine partition_precip - - !----------------------------------------------------------------------- - subroutine repartition_rain_snow_one_col(temperature, all_snow_t, frac_rain_slope, & - rain, snow) - ! - ! !DESCRIPTION: - ! Re-partition precipitation into rain/snow for a single column. - ! - ! Rain and snow variables should be set initially, and are updated here - ! - ! !ARGUMENTS: - real(r8) , intent(in) :: temperature ! near-surface temperature (K) - real(r8) , intent(in) :: all_snow_t ! temperature at which precip falls entirely as snow (K) - real(r8) , intent(in) :: frac_rain_slope ! slope of the frac_rain vs. T relationship - real(r8) , intent(inout) :: rain ! atm rain rate [mm/s] - real(r8) , intent(inout) :: snow ! atm snow rate [(mm water equivalent)/s] - ! - ! !LOCAL VARIABLES: - real(r8) :: frac_rain ! fraction of precipitation that should become rain - real(r8) :: total_precip - - character(len=*), parameter :: subname = 'repartition_rain_snow_one_col' - !----------------------------------------------------------------------- - - frac_rain = (temperature - all_snow_t) * frac_rain_slope - - ! bound in [0,1] - frac_rain = min(1.0_r8,max(0.0_r8,frac_rain)) - - total_precip = rain + snow - rain = total_precip * frac_rain - snow = total_precip - rain - - end subroutine repartition_rain_snow_one_col - - !----------------------------------------------------------------------- - subroutine sens_heat_from_precip_conversion(rain_old, snow_old, rain_new, snow_new, & - sens_heat_flux) - ! - ! !DESCRIPTION: - ! Given old and new rain and snow amounts, compute the sensible heat flux needed to - ! compensate for the rain-snow conversion. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), intent(in) :: rain_old ! [mm/s] - real(r8), intent(in) :: snow_old ! [(mm water equivalent)/s] - real(r8), intent(in) :: rain_new ! [mm/s] - real(r8), intent(in) :: snow_new ! [(mm water equivalent)/s] - real(r8), intent(out) :: sens_heat_flux ! [W/m^2] - ! - ! !LOCAL VARIABLES: - real(r8) :: total_old - real(r8) :: total_new - real(r8) :: rain_to_snow ! net conversion of rain to snow - - real(r8), parameter :: mm_to_m = 1.e-3_r8 ! multiply by this to convert from mm to m - real(r8), parameter :: tol = 1.e-13_r8 ! relative tolerance for error checks - - character(len=*), parameter :: subname = 'sens_heat_from_precip_conversion' - !----------------------------------------------------------------------- - - total_old = rain_old + snow_old - total_new = rain_new + snow_new - SHR_ASSERT(abs(total_new - total_old) <= (tol * total_old), subname//' ERROR: mismatch between old and new totals') - - ! rain to snow releases energy, so results in a positive heat flux to atm - rain_to_snow = snow_new - snow_old - sens_heat_flux = rain_to_snow * mm_to_m * denh2o * hfus - - end subroutine sens_heat_from_precip_conversion - - - !----------------------------------------------------------------------- - subroutine downscale_longwave(bounds, downscale_filter_c, & - topo_inst, atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Downscale longwave radiation from gridcell to column - ! Must be done AFTER temperature downscaling - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(filter_col_type) , intent(in) :: downscale_filter_c - class(topo_type) , intent(in) :: topo_inst - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst - ! - ! !LOCAL VARIABLES: - integer :: c,l,g,fc ! indices - real(r8) :: hsurf_c ! column-level elevation (m) - real(r8) :: hsurf_g ! gridcell-level elevation (m) - - real(r8), dimension(bounds%begg : bounds%endg) :: sum_lwrad_g ! weighted sum of column-level lwrad - real(r8), dimension(bounds%begg : bounds%endg) :: sum_wts_g ! sum of weights that contribute to sum_lwrad_g - real(r8), dimension(bounds%begg : bounds%endg) :: lwrad_norm_g ! normalization factors - real(r8), dimension(bounds%begg : bounds%endg) :: newsum_lwrad_g ! weighted sum of column-level lwrad after normalization - - character(len=*), parameter :: subname = 'downscale_longwave' - !----------------------------------------------------------------------- - - associate(& - ! Parameters: - lapse_rate_longwave => atm2lnd_inst%params%lapse_rate_longwave , & ! Input: [real(r8)] longwave radiation lapse rate (W m-2 m-1) - longwave_downscaling_limit => atm2lnd_inst%params%longwave_downscaling_limit, & ! Input: [real(r8)] Relative limit for how much longwave downscaling can be done (unitless) - - ! Gridcell-level metadata: - forc_topo_g => atm2lnd_inst%forc_topo_grc , & ! Input: [real(r8) (:)] atmospheric surface height (m) - - ! Column-level metadata: - topo_c => topo_inst%topo_col , & ! Input: [real(r8) (:)] column surface height (m) - - ! Gridcell-level fields: - forc_lwrad_g => atm2lnd_inst%forc_lwrad_not_downscaled_grc, & ! Input: [real(r8) (:)] downward longwave (W/m**2) - - ! Column-level (downscaled) fields: - forc_lwrad_c => atm2lnd_inst%forc_lwrad_downscaled_col & ! Output: [real(r8) (:)] downward longwave (W/m**2) - ) - - ! Initialize column forcing (needs to be done for ALL active columns) - do c = bounds%begc, bounds%endc - if (col%active(c)) then - g = col%gridcell(c) - forc_lwrad_c(c) = forc_lwrad_g(g) - end if - end do - - ! Optionally, downscale the longwave radiation, conserving energy - if (atm2lnd_inst%params%glcmec_downscale_longwave) then - - ! Initialize variables related to normalization - do g = bounds%begg, bounds%endg - sum_lwrad_g(g) = 0._r8 - sum_wts_g(g) = 0._r8 - newsum_lwrad_g(g) = 0._r8 - end do - - ! Do the downscaling - do fc = 1, downscale_filter_c%num - c = downscale_filter_c%indices(fc) - l = col%landunit(c) - g = col%gridcell(c) - - hsurf_g = forc_topo_g(g) - hsurf_c = topo_c(c) - - ! Assume a linear decrease in downwelling longwave radiation with increasing - ! elevation, based on Van Tricht et al. (2016, TC) Figure 6, - ! doi:10.5194/tc-10-2379-2016 - forc_lwrad_c(c) = forc_lwrad_g(g) - lapse_rate_longwave * (hsurf_c-hsurf_g) - ! But ensure that we don't depart too far from the atmospheric forcing value: - ! negative values of lwrad are certainly bad, but small positive values might - ! also be bad. We can especially run into trouble due to the normalization: a - ! small lwrad value in one column can lead to a big normalization factor, - ! leading to huge lwrad values in other columns. - forc_lwrad_c(c) = min(forc_lwrad_c(c), & - forc_lwrad_g(g) * (1._r8 + longwave_downscaling_limit)) - forc_lwrad_c(c) = max(forc_lwrad_c(c), & - forc_lwrad_g(g) * (1._r8 - longwave_downscaling_limit)) - - ! Keep track of the gridcell-level weighted sum for later normalization. - ! - ! This gridcell-level weighted sum just includes points for which we do the - ! downscaling (e.g., glc_mec points). Thus the contributing weights - ! generally do not add to 1. So to do the normalization properly, we also - ! need to keep track of the weights that have contributed to this sum. - sum_lwrad_g(g) = sum_lwrad_g(g) + col%wtgcell(c)*forc_lwrad_c(c) - sum_wts_g(g) = sum_wts_g(g) + col%wtgcell(c) - end do - - - ! Normalize forc_lwrad_c(c) to conserve energy - - call build_normalization(orig_field=forc_lwrad_g(bounds%begg:bounds%endg), & - sum_field=sum_lwrad_g(bounds%begg:bounds%endg), & - sum_wts=sum_wts_g(bounds%begg:bounds%endg), & - norms=lwrad_norm_g(bounds%begg:bounds%endg)) - - do fc = 1, downscale_filter_c%num - c = downscale_filter_c%indices(fc) - l = col%landunit(c) - g = col%gridcell(c) - - forc_lwrad_c(c) = forc_lwrad_c(c) * lwrad_norm_g(g) - newsum_lwrad_g(g) = newsum_lwrad_g(g) + col%wtgcell(c)*forc_lwrad_c(c) - end do - - - ! Make sure that, after normalization, the grid cell mean is conserved - - do g = bounds%begg, bounds%endg - if (sum_wts_g(g) > 0._r8) then - if (abs((newsum_lwrad_g(g) / sum_wts_g(g)) - forc_lwrad_g(g)) > 1.e-8_r8) then - write(iulog,*) 'g, newsum_lwrad_g, sum_wts_g, forc_lwrad_g: ', & - g, newsum_lwrad_g(g), sum_wts_g(g), forc_lwrad_g(g) - call endrun(msg=' ERROR: Energy conservation error downscaling longwave'//& - errMsg(sourcefile, __LINE__)) - end if - end if - end do - - end if ! glcmec_downscale_longwave - - end associate - - end subroutine downscale_longwave - - !----------------------------------------------------------------------- - subroutine build_normalization(orig_field, sum_field, sum_wts, norms) - ! - ! !DESCRIPTION: - ! Build an array of normalization factors that can be applied to a downscaled forcing - ! field, in order to force the mean of the new field to be the same as the mean of - ! the old field (for conservation). - ! - ! This allows for the possibility that only a subset of columns are downscaled. Only - ! the columns that are adjusted should be included in the weighted sum, sum_field; - ! sum_wts gives the sum of contributing weights on the grid cell level. - - ! For example, if a grid cell has an original forcing value of 1.0, and contains 4 - ! columns with the following weights on the gridcell, and the following values after - ! normalization: - ! - ! col #: 1 2 3 4 - ! weight: 0.1 0.2 0.3 0.4 - ! downscaled?: yes yes no no - ! value: 0.9 1.1 1.0 1.0 - ! - ! Then we would have: - ! orig_field(g) = 1.0 - ! sum_field(g) = 0.1*0.9 + 0.2*1.1 = 0.31 - ! sum_wts(g) = 0.1 + 0.2 = 0.3 - ! norms(g) = 1.0 / (0.31 / 0.3) = 0.9677 - ! - ! The field can then be normalized as: - ! forc_lwrad_c(c) = forc_lwrad_c(c) * lwrad_norm_g(g) - ! where lwrad_norm_g is the array of norms computed by this routine - - ! - ! !ARGUMENTS: - real(r8), intent(in) :: orig_field(:) ! the original field, at the grid cell level - real(r8), intent(in) :: sum_field(:) ! the new weighted sum across columns (dimensioned by grid cell) - real(r8), intent(in) :: sum_wts(:) ! sum of the weights used to create sum_field (dimensioned by grid cell) - real(r8), intent(out) :: norms(:) ! computed normalization factors - !----------------------------------------------------------------------- - - SHR_ASSERT((size(orig_field) == size(norms)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((size(sum_field) == size(norms)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT((size(sum_wts) == size(norms)), errMsg(sourcefile, __LINE__)) - - where (sum_wts == 0._r8) - ! Avoid divide by zero; if sum_wts is 0, then the normalization doesn't matter, - ! because the adjusted values won't affect the grid cell mean. - norms = 1.0_r8 - - elsewhere (sum_field == 0._r8) - ! Avoid divide by zero. If this is because both sum_field and orig_field are 0, - ! then the normalization doesn't matter. If sum_field == 0 while orig_field /= 0, - ! then we have a problem: no normalization will allow us to recover the original - ! gridcell mean. We should probably catch this and abort, but for now we're - ! relying on error checking in the caller (checking for conservation) to catch - ! this potential problem. - norms = 1.0_r8 - - elsewhere - ! The standard case - norms = orig_field / (sum_field / sum_wts) - - end where - - end subroutine build_normalization - - - !----------------------------------------------------------------------- - subroutine check_downscale_consistency(bounds, atm2lnd_inst) - ! - ! !DESCRIPTION: - ! Check consistency of downscaling - ! - ! Note that this operates over more than just the filter used for the downscaling, - ! because it checks some things outside that filter. - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type), intent(in) :: atm2lnd_inst - ! - ! !LOCAL VARIABLES: - integer :: g, l, c ! indices - character(len=*), parameter :: subname = 'check_downscale_consistency' - !----------------------------------------------------------------------- - - associate(& - ! Gridcell-level fields: - forc_t_g => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric temperature (Kelvin) - forc_th_g => atm2lnd_inst%forc_th_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric potential temperature (Kelvin) - forc_q_g => atm2lnd_inst%forc_q_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric specific humidity (kg/kg) - forc_pbot_g => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric pressure (Pa) - forc_rho_g => atm2lnd_inst%forc_rho_not_downscaled_grc , & ! Input: [real(r8) (:)] atmospheric density (kg/m**3) - forc_rain_g => atm2lnd_inst%forc_rain_not_downscaled_grc , & ! Input: [real(r8) (:)] rain rate [mm/s] - forc_snow_g => atm2lnd_inst%forc_snow_not_downscaled_grc , & ! Input: [real(r8) (:)] snow rate [mm/s] - forc_lwrad_g => atm2lnd_inst%forc_lwrad_not_downscaled_grc , & ! Input: [real(r8) (:)] downward longwave (W/m**2) - - ! Column-level (downscaled) fields: - forc_t_c => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:)] atmospheric temperature (Kelvin) - forc_th_c => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:)] atmospheric potential temperature (Kelvin) - forc_q_c => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:)] atmospheric specific humidity (kg/kg) - forc_pbot_c => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:)] atmospheric pressure (Pa) - forc_rho_c => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:)] atmospheric density (kg/m**3) - forc_rain_c => atm2lnd_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:)] rain rate [mm/s] - forc_snow_c => atm2lnd_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:)] snow rate [mm/s] - forc_lwrad_c => atm2lnd_inst%forc_lwrad_downscaled_col & ! Input: [real(r8) (:)] downward longwave (W/m**2) - ) - - ! BUG(wjs, 2016-11-15, bugz 2377) - ! - ! Make sure that, for urban points, the column-level forcing fields are identical to - ! the gridcell-level forcing fields. This is needed because the urban-specific code - ! sometimes uses the gridcell-level forcing fields (and it would take a large - ! refactor to change this to use column-level fields). - ! - ! However, do NOT check rain & snow: these ARE downscaled for urban points (as for - ! all other points), and the urban code does not refer to the gridcell-level versions - ! of these fields. - - do c = bounds%begc, bounds%endc - if (col%active(c)) then - l = col%landunit(c) - g = col%gridcell(c) - - if (lun%urbpoi(l)) then - if (forc_t_c(c) /= forc_t_g(g) .or. & - forc_th_c(c) /= forc_th_g(g) .or. & - forc_q_c(c) /= forc_q_g(g) .or. & - forc_pbot_c(c) /= forc_pbot_g(g) .or. & - forc_rho_c(c) /= forc_rho_g(g) .or. & - forc_lwrad_c(c) /= forc_lwrad_g(g)) then - write(iulog,*) subname//' ERROR: column-level forcing differs from gridcell-level forcing for urban point' - write(iulog,*) 'c, g = ', c, g - write(iulog,*) 'forc_t_c, forc_t_g = ', forc_t_c(c), forc_t_g(g) - write(iulog,*) 'forc_th_c, forc_th_g = ', forc_th_c(c), forc_th_g(g) - write(iulog,*) 'forc_q_c, forc_q_g = ', forc_q_c(c), forc_q_g(g) - write(iulog,*) 'forc_pbot_c, forc_pbot_g = ', forc_pbot_c(c), forc_pbot_g(g) - write(iulog,*) 'forc_rho_c, forc_rho_g = ', forc_rho_c(c), forc_rho_g(g) - write(iulog,*) 'forc_lwrad_c, forc_lwrad_g = ', forc_lwrad_c(c), forc_lwrad_g(g) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if ! inequal - end if ! urbpoi - end if ! active - end do - - end associate - - end subroutine check_downscale_consistency - -end module atm2lndMod diff --git a/src/main/atm2lndType.F90 b/src/main/atm2lndType.F90 deleted file mode 100644 index 33452d5b2a..0000000000 --- a/src/main/atm2lndType.F90 +++ /dev/null @@ -1,1304 +0,0 @@ -module atm2lndType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle atm2lnd, lnd2atm mapping - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. - use clm_varcon , only : rair, grav, cpair, hfus, tfrz, spval - use clm_varctl , only : iulog, use_c13, use_cn, use_lch4, use_cndv, use_fates, use_luna - use decompMod , only : bounds_type - use abortutils , only : endrun - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC DATA TYPES: - - type, public :: atm2lnd_params_type - ! true => repartition rain/snow from atm based on temperature - logical :: repartition_rain_snow - - ! true => downscale longwave radiation - logical :: glcmec_downscale_longwave - - ! Surface temperature lapse rate (K m-1) - real(r8) :: lapse_rate - - ! longwave radiation lapse rate (W m-2 m-1) - real(r8) :: lapse_rate_longwave - - ! Relative limit for how much longwave downscaling can be done (unitless) - ! The pre-normalized, downscaled longwave is restricted to be in the range - ! [lwrad*(1-longwave_downscaling_limit), lwrad*(1+longwave_downscaling_limit)] - real(r8) :: longwave_downscaling_limit - - ! Rain-snow ramp for glacier landunits - ! frac_rain = (temp - all_snow_t) * frac_rain_slope - ! (all_snow_t is in K) - real(r8) :: precip_repartition_glc_all_snow_t - real(r8) :: precip_repartition_glc_frac_rain_slope - - ! Rain-snow ramp for non-glacier landunits - ! frac_rain = (temp - all_snow_t) * frac_rain_slope - ! (all_snow_t is in K) - real(r8) :: precip_repartition_nonglc_all_snow_t - real(r8) :: precip_repartition_nonglc_frac_rain_slope - end type atm2lnd_params_type - - !---------------------------------------------------- - ! atmosphere -> land variables structure - ! - ! NOTE: - ! IF there are forcing variables that are downscaled - then the - ! non-downscaled versions SHOULD NOT be used in the code. Currently - ! the non-downscaled versions are only used n a handful of places in - ! the code (and needs to be used in lnd_import_export and the - ! downscaling routines), but in general should NOT be used in new - ! code. Instead use the datatype variables that have a _col suffix - ! which gives the downscaled versions of these fields. - !---------------------------------------------------- - type, public :: atm2lnd_type - type(atm2lnd_params_type) :: params - - ! atm->lnd not downscaled - real(r8), pointer :: forc_u_grc (:) => null() ! atm wind speed, east direction (m/s) - real(r8), pointer :: forc_v_grc (:) => null() ! atm wind speed, north direction (m/s) - real(r8), pointer :: forc_wind_grc (:) => null() ! atmospheric wind speed - real(r8), pointer :: forc_hgt_grc (:) => null() ! atmospheric reference height (m) - real(r8), pointer :: forc_topo_grc (:) => null() ! atmospheric surface height (m) - real(r8), pointer :: forc_hgt_u_grc (:) => null() ! obs height of wind [m] (new) - real(r8), pointer :: forc_hgt_t_grc (:) => null() ! obs height of temperature [m] (new) - real(r8), pointer :: forc_hgt_q_grc (:) => null() ! obs height of humidity [m] (new) - real(r8), pointer :: forc_vp_grc (:) => null() ! atmospheric vapor pressure (Pa) - real(r8), pointer :: forc_rh_grc (:) => null() ! atmospheric relative humidity (%) - real(r8), pointer :: forc_psrf_grc (:) => null() ! surface pressure (Pa) - real(r8), pointer :: forc_pco2_grc (:) => null() ! CO2 partial pressure (Pa) - real(r8), pointer :: forc_pco2_240_patch (:) => null() ! 10-day mean CO2 partial pressure (Pa) - real(r8), pointer :: forc_solad_grc (:,:) => null() ! direct beam radiation (numrad) (vis=forc_sols , nir=forc_soll ) - real(r8), pointer :: forc_solai_grc (:,:) => null() ! diffuse radiation (numrad) (vis=forc_solsd, nir=forc_solld) - real(r8), pointer :: forc_solar_grc (:) => null() ! incident solar radiation - real(r8), pointer :: forc_ndep_grc (:) => null() ! nitrogen deposition rate (gN/m2/s) - real(r8), pointer :: forc_pc13o2_grc (:) => null() ! C13O2 partial pressure (Pa) - real(r8), pointer :: forc_po2_grc (:) => null() ! O2 partial pressure (Pa) - real(r8), pointer :: forc_po2_240_patch (:) => null() ! 10-day mean O2 partial pressure (Pa) - real(r8), pointer :: forc_aer_grc (:,:) => null() ! aerosol deposition array - real(r8), pointer :: forc_pch4_grc (:) => null() ! CH4 partial pressure (Pa) - - real(r8), pointer :: forc_t_not_downscaled_grc (:) => null() ! not downscaled atm temperature (Kelvin) - real(r8), pointer :: forc_th_not_downscaled_grc (:) => null() ! not downscaled atm potential temperature (Kelvin) - real(r8), pointer :: forc_q_not_downscaled_grc (:) => null() ! not downscaled atm specific humidity (kg/kg) - real(r8), pointer :: forc_pbot_not_downscaled_grc (:) => null() ! not downscaled atm pressure (Pa) - real(r8), pointer :: forc_pbot240_downscaled_patch (:) => null() ! 10-day mean downscaled atm pressure (Pa) - real(r8), pointer :: forc_rho_not_downscaled_grc (:) => null() ! not downscaled atm density (kg/m**3) - real(r8), pointer :: forc_rain_not_downscaled_grc (:) => null() ! not downscaled atm rain rate [mm/s] - real(r8), pointer :: forc_snow_not_downscaled_grc (:) => null() ! not downscaled atm snow rate [mm/s] - real(r8), pointer :: forc_lwrad_not_downscaled_grc (:) => null() ! not downscaled atm downwrd IR longwave radiation (W/m**2) - - ! atm->lnd downscaled - real(r8), pointer :: forc_t_downscaled_col (:) => null() ! downscaled atm temperature (Kelvin) - real(r8), pointer :: forc_th_downscaled_col (:) => null() ! downscaled atm potential temperature (Kelvin) - real(r8), pointer :: forc_q_downscaled_col (:) => null() ! downscaled atm specific humidity (kg/kg) - real(r8), pointer :: forc_pbot_downscaled_col (:) => null() ! downscaled atm pressure (Pa) - real(r8), pointer :: forc_rho_downscaled_col (:) => null() ! downscaled atm density (kg/m**3) - real(r8), pointer :: forc_rain_downscaled_col (:) => null() ! downscaled atm rain rate [mm/s] - real(r8), pointer :: forc_snow_downscaled_col (:) => null() ! downscaled atm snow rate [mm/s] - real(r8), pointer :: forc_lwrad_downscaled_col (:) => null() ! downscaled atm downwrd IR longwave radiation (W/m**2) - - ! rof->lnd - real(r8), pointer :: forc_flood_grc (:) => null() ! rof flood (mm/s) - real(r8), pointer :: volr_grc (:) => null() ! rof volr total volume (m3) - real(r8), pointer :: volrmch_grc (:) => null() ! rof volr main channel (m3) - - ! anomaly forcing - real(r8), pointer :: af_precip_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_uwind_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_vwind_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_tbot_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_pbot_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_shum_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_swdn_grc (:) => null() ! anomaly forcing - real(r8), pointer :: af_lwdn_grc (:) => null() ! anomaly forcing - real(r8), pointer :: bc_precip_grc (:) => null() ! anomaly forcing - add bias correction - - ! time averaged quantities - real(r8) , pointer :: fsd24_patch (:) => null() ! patch 24hr average of direct beam radiation - real(r8) , pointer :: fsd240_patch (:) => null() ! patch 240hr average of direct beam radiation - real(r8) , pointer :: fsi24_patch (:) => null() ! patch 24hr average of diffuse beam radiation - real(r8) , pointer :: fsi240_patch (:) => null() ! patch 240hr average of diffuse beam radiation - real(r8) , pointer :: prec365_col (:) => null() ! col 365-day running mean of tot. precipitation (see comment in UpdateAccVars regarding why this is col-level despite other prec accumulators being patch-level) - real(r8) , pointer :: prec60_patch (:) => null() ! patch 60-day running mean of tot. precipitation (mm/s) - real(r8) , pointer :: prec10_patch (:) => null() ! patch 10-day running mean of tot. precipitation (mm/s) - real(r8) , pointer :: rh30_patch (:) => null() ! patch 30-day running mean of relative humidity - real(r8) , pointer :: prec24_patch (:) => null() ! patch 24-hour running mean of tot. precipitation (mm/s) - real(r8) , pointer :: rh24_patch (:) => null() ! patch 24-hour running mean of relative humidity - real(r8) , pointer :: wind24_patch (:) => null() ! patch 24-hour running mean of wind - real(r8) , pointer :: t_mo_patch (:) => null() ! patch 30-day average temperature (Kelvin) - real(r8) , pointer :: t_mo_min_patch (:) => null() ! patch annual min of t_mo (Kelvin) - - contains - - procedure, public :: Init - procedure, public :: InitForTesting ! version of Init meant for unit testing - procedure, private :: ReadNamelist - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, public :: InitAccBuffer - procedure, public :: InitAccVars - procedure, public :: UpdateAccVars - procedure, public :: Restart - procedure, public :: Clean - - end type atm2lnd_type - - interface atm2lnd_params_type - module procedure atm2lnd_params_constructor - end interface atm2lnd_params_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !---------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - function atm2lnd_params_constructor(repartition_rain_snow, glcmec_downscale_longwave, & - lapse_rate, lapse_rate_longwave, longwave_downscaling_limit, & - precip_repartition_glc_all_snow_t, precip_repartition_glc_all_rain_t, & - precip_repartition_nonglc_all_snow_t, precip_repartition_nonglc_all_rain_t) & - result(params) - ! - ! !DESCRIPTION: - ! Creates a new instance of atm2lnd_params_type - ! - ! !USES: - ! - ! !ARGUMENTS: - type(atm2lnd_params_type) :: params ! function result - logical, intent(in) :: repartition_rain_snow - logical, intent(in) :: glcmec_downscale_longwave - - ! Surface temperature lapse rate (K m-1) - real(r8), intent(in) :: lapse_rate - - ! Longwave radiation lapse rate (W m-2 m-1) - ! Must be present if glcmec_downscale_longwave is true; ignored otherwise - real(r8), intent(in), optional :: lapse_rate_longwave - - ! Relative limit for how much longwave downscaling can be done (unitless) - ! Must be present if glcmec_downscale_longwave is true; ignored otherwise - real(r8), intent(in), optional :: longwave_downscaling_limit - - ! End-points of the rain-snow ramp for glacier landunits (degrees C) - ! Must be present if repartition_rain_snow is true; ignored otherwise - real(r8), intent(in), optional :: precip_repartition_glc_all_snow_t - real(r8), intent(in), optional :: precip_repartition_glc_all_rain_t - - ! End-points of the rain-snow ramp for non-glacier landunits (degrees C) - ! Must be present if repartition_rain_snow is true; ignored otherwise - real(r8), intent(in), optional :: precip_repartition_nonglc_all_snow_t - real(r8), intent(in), optional :: precip_repartition_nonglc_all_rain_t - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'atm2lnd_params_constructor' - !----------------------------------------------------------------------- - - params%repartition_rain_snow = repartition_rain_snow - params%glcmec_downscale_longwave = glcmec_downscale_longwave - - params%lapse_rate = lapse_rate - - if (glcmec_downscale_longwave) then - if (.not. present(lapse_rate_longwave)) then - call endrun(subname // & - ' ERROR: For glcmec_downscale_longwave true, lapse_rate_longwave must be provided') - end if - if (.not. present(longwave_downscaling_limit)) then - call endrun(subname // & - ' ERROR: For glcmec_downscale_longwave true, longwave_downscaling_limit must be provided') - end if - - if (longwave_downscaling_limit < 0._r8 .or. & - longwave_downscaling_limit > 1._r8) then - call endrun(subname // & - ' ERROR: longwave_downscaling_limit must be between 0 and 1') - end if - - params%lapse_rate_longwave = lapse_rate_longwave - params%longwave_downscaling_limit = longwave_downscaling_limit - else - params%lapse_rate_longwave = nan - params%longwave_downscaling_limit = nan - end if - - if (repartition_rain_snow) then - - ! Make sure all of the repartitioning-related parameters are present - - if (.not. present(precip_repartition_glc_all_snow_t)) then - call endrun(subname // & - ' ERROR: For repartition_rain_snow true, precip_repartition_glc_all_snow_t must be provided') - end if - if (.not. present(precip_repartition_glc_all_rain_t)) then - call endrun(subname // & - ' ERROR: For repartition_rain_snow true, precip_repartition_glc_all_rain_t must be provided') - end if - if (.not. present(precip_repartition_nonglc_all_snow_t)) then - call endrun(subname // & - ' ERROR: For repartition_rain_snow true, precip_repartition_nonglc_all_snow_t must be provided') - end if - if (.not. present(precip_repartition_nonglc_all_rain_t)) then - call endrun(subname // & - ' ERROR: For repartition_rain_snow true, precip_repartition_nonglc_all_rain_t must be provided') - end if - - ! Do some other error checking - - if (precip_repartition_glc_all_rain_t <= precip_repartition_glc_all_snow_t) then - call endrun(subname // & - ' ERROR: Must have precip_repartition_glc_all_snow_t < precip_repartition_glc_all_rain_t') - end if - - if (precip_repartition_nonglc_all_rain_t <= precip_repartition_nonglc_all_snow_t) then - call endrun(subname // & - ' ERROR: Must have precip_repartition_nonglc_all_snow_t < precip_repartition_nonglc_all_rain_t') - end if - - ! Convert to the form of the parameters we want for the main code - - call compute_ramp_params( & - all_snow_t_c = precip_repartition_glc_all_snow_t, & - all_rain_t_c = precip_repartition_glc_all_rain_t, & - all_snow_t_k = params%precip_repartition_glc_all_snow_t, & - frac_rain_slope = params%precip_repartition_glc_frac_rain_slope) - - call compute_ramp_params( & - all_snow_t_c = precip_repartition_nonglc_all_snow_t, & - all_rain_t_c = precip_repartition_nonglc_all_rain_t, & - all_snow_t_k = params%precip_repartition_nonglc_all_snow_t, & - frac_rain_slope = params%precip_repartition_nonglc_frac_rain_slope) - - else ! .not. repartition_rain_snow - params%precip_repartition_glc_all_snow_t = nan - params%precip_repartition_glc_frac_rain_slope = nan - params%precip_repartition_nonglc_all_snow_t = nan - params%precip_repartition_nonglc_frac_rain_slope = nan - end if - - contains - subroutine compute_ramp_params(all_snow_t_c, all_rain_t_c, & - all_snow_t_k, frac_rain_slope) - real(r8), intent(in) :: all_snow_t_c ! Temperature at which precip falls entirely as rain (deg C) - real(r8), intent(in) :: all_rain_t_c ! Temperature at which precip falls entirely as snow (deg C) - real(r8), intent(out) :: all_snow_t_k ! Temperature at which precip falls entirely as snow (K) - real(r8), intent(out) :: frac_rain_slope ! Slope of the frac_rain vs. T relationship - - frac_rain_slope = 1._r8 / (all_rain_t_c - all_snow_t_c) - all_snow_t_k = all_snow_t_c + tfrz - end subroutine compute_ramp_params - - end function atm2lnd_params_constructor - - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, NLFilename) - - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! namelist filename - - call this%InitAllocate(bounds) - call this%ReadNamelist(NLFilename) - call this%InitHistory(bounds) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitForTesting(this, bounds, params) - ! - ! !DESCRIPTION: - ! Does initialization needed for unit testing. Allows caller to prescribe parameter - ! values (bypassing the namelist read) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - - ! If params isn't provided, we use default values - type(atm2lnd_params_type), intent(in), optional :: params - ! - ! !LOCAL VARIABLES: - type(atm2lnd_params_type) :: l_params - - character(len=*), parameter :: subname = 'InitForTesting' - !----------------------------------------------------------------------- - - if (present(params)) then - l_params = params - else - ! Use arbitrary values - l_params = atm2lnd_params_type( & - repartition_rain_snow = .false., & - glcmec_downscale_longwave = .false., & - lapse_rate = 0.01_r8) - end if - - call this%InitAllocate(bounds) - this%params = l_params - - end subroutine InitForTesting - - - !----------------------------------------------------------------------- - subroutine ReadNamelist(this, NLFilename) - ! - ! !DESCRIPTION: - ! Read the atm2lnd namelist - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - class(atm2lnd_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - ! temporary variables corresponding to the components of atm2lnd_params_type - logical :: repartition_rain_snow - logical :: glcmec_downscale_longwave - real(r8) :: lapse_rate - real(r8) :: lapse_rate_longwave - real(r8) :: longwave_downscaling_limit - real(r8) :: precip_repartition_glc_all_snow_t - real(r8) :: precip_repartition_glc_all_rain_t - real(r8) :: precip_repartition_nonglc_all_snow_t - real(r8) :: precip_repartition_nonglc_all_rain_t - - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=*), parameter :: nmlname = 'atm2lnd_inparm' - - character(len=*), parameter :: subname = 'ReadNamelist' - !----------------------------------------------------------------------- - - namelist /atm2lnd_inparm/ repartition_rain_snow, glcmec_downscale_longwave, & - lapse_rate, lapse_rate_longwave, longwave_downscaling_limit, & - precip_repartition_glc_all_snow_t, precip_repartition_glc_all_rain_t, & - precip_repartition_nonglc_all_snow_t, precip_repartition_nonglc_all_rain_t - - ! Initialize namelist variables to defaults - repartition_rain_snow = .false. - glcmec_downscale_longwave = .false. - lapse_rate = nan - lapse_rate_longwave = nan - longwave_downscaling_limit = nan - precip_repartition_glc_all_snow_t = nan - precip_repartition_glc_all_rain_t = nan - precip_repartition_nonglc_all_snow_t = nan - precip_repartition_nonglc_all_rain_t = nan - - if (masterproc) then - unitn = getavu() - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=atm2lnd_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast(repartition_rain_snow, mpicom) - call shr_mpi_bcast(glcmec_downscale_longwave, mpicom) - call shr_mpi_bcast(lapse_rate, mpicom) - call shr_mpi_bcast(lapse_rate_longwave, mpicom) - call shr_mpi_bcast(longwave_downscaling_limit, mpicom) - call shr_mpi_bcast(precip_repartition_glc_all_snow_t, mpicom) - call shr_mpi_bcast(precip_repartition_glc_all_rain_t, mpicom) - call shr_mpi_bcast(precip_repartition_nonglc_all_snow_t, mpicom) - call shr_mpi_bcast(precip_repartition_nonglc_all_rain_t, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - ! Write settings one-by-one rather than with a nml write because some settings may - ! be NaN if certain options are turned off. - write(iulog,*) 'repartition_rain_snow = ', repartition_rain_snow - write(iulog,*) 'glcmec_downscale_longwave = ', glcmec_downscale_longwave - write(iulog,*) 'lapse_rate = ', lapse_rate - if (glcmec_downscale_longwave) then - write(iulog,*) 'lapse_rate_longwave = ', lapse_rate_longwave - write(iulog,*) 'longwave_downscaling_limit = ', longwave_downscaling_limit - end if - if (repartition_rain_snow) then - write(iulog,*) 'precip_repartition_glc_all_snow_t = ', precip_repartition_glc_all_snow_t - write(iulog,*) 'precip_repartition_glc_all_rain_t = ', precip_repartition_glc_all_rain_t - write(iulog,*) 'precip_repartition_nonglc_all_snow_t = ', precip_repartition_nonglc_all_snow_t - write(iulog,*) 'precip_repartition_nonglc_all_rain_t = ', precip_repartition_nonglc_all_rain_t - end if - write(iulog,*) ' ' - end if - - this%params = atm2lnd_params_type( & - repartition_rain_snow = repartition_rain_snow, & - glcmec_downscale_longwave = glcmec_downscale_longwave, & - lapse_rate = lapse_rate, & - lapse_rate_longwave = lapse_rate_longwave, & - longwave_downscaling_limit = longwave_downscaling_limit, & - precip_repartition_glc_all_snow_t = precip_repartition_glc_all_snow_t, & - precip_repartition_glc_all_rain_t = precip_repartition_glc_all_rain_t, & - precip_repartition_nonglc_all_snow_t = precip_repartition_nonglc_all_snow_t, & - precip_repartition_nonglc_all_rain_t = precip_repartition_nonglc_all_rain_t) - - end subroutine ReadNamelist - - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize atm2lnd derived type - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - real(r8) :: ival = 0.0_r8 ! initial value - integer :: begg, endg - integer :: begc, endc - integer :: begp, endp - !------------------------------------------------------------------------ - - begg = bounds%begg; endg= bounds%endg - begc = bounds%begc; endc= bounds%endc - begp = bounds%begp; endp= bounds%endp - - ! atm->lnd - allocate(this%forc_u_grc (begg:endg)) ; this%forc_u_grc (:) = ival - allocate(this%forc_v_grc (begg:endg)) ; this%forc_v_grc (:) = ival - allocate(this%forc_wind_grc (begg:endg)) ; this%forc_wind_grc (:) = ival - allocate(this%forc_rh_grc (begg:endg)) ; this%forc_rh_grc (:) = ival - allocate(this%forc_hgt_grc (begg:endg)) ; this%forc_hgt_grc (:) = ival - allocate(this%forc_topo_grc (begg:endg)) ; this%forc_topo_grc (:) = ival - allocate(this%forc_hgt_u_grc (begg:endg)) ; this%forc_hgt_u_grc (:) = ival - allocate(this%forc_hgt_t_grc (begg:endg)) ; this%forc_hgt_t_grc (:) = ival - allocate(this%forc_hgt_q_grc (begg:endg)) ; this%forc_hgt_q_grc (:) = ival - allocate(this%forc_vp_grc (begg:endg)) ; this%forc_vp_grc (:) = ival - allocate(this%forc_psrf_grc (begg:endg)) ; this%forc_psrf_grc (:) = ival - allocate(this%forc_pco2_grc (begg:endg)) ; this%forc_pco2_grc (:) = ival - allocate(this%forc_solad_grc (begg:endg,numrad)) ; this%forc_solad_grc (:,:) = ival - allocate(this%forc_solai_grc (begg:endg,numrad)) ; this%forc_solai_grc (:,:) = ival - allocate(this%forc_solar_grc (begg:endg)) ; this%forc_solar_grc (:) = ival - allocate(this%forc_ndep_grc (begg:endg)) ; this%forc_ndep_grc (:) = ival - allocate(this%forc_pc13o2_grc (begg:endg)) ; this%forc_pc13o2_grc (:) = ival - allocate(this%forc_po2_grc (begg:endg)) ; this%forc_po2_grc (:) = ival - allocate(this%forc_aer_grc (begg:endg,14)) ; this%forc_aer_grc (:,:) = ival - allocate(this%forc_pch4_grc (begg:endg)) ; this%forc_pch4_grc (:) = ival - if(use_luna)then - allocate(this%forc_pco2_240_patch (begp:endp)) ; this%forc_pco2_240_patch (:) = ival - allocate(this%forc_po2_240_patch (begp:endp)) ; this%forc_po2_240_patch (:) = ival - allocate(this%forc_pbot240_downscaled_patch(begp:endp)) ; this%forc_pbot240_downscaled_patch (:) = ival - endif - - ! atm->lnd not downscaled - allocate(this%forc_t_not_downscaled_grc (begg:endg)) ; this%forc_t_not_downscaled_grc (:) = ival - allocate(this%forc_q_not_downscaled_grc (begg:endg)) ; this%forc_q_not_downscaled_grc (:) = ival - allocate(this%forc_pbot_not_downscaled_grc (begg:endg)) ; this%forc_pbot_not_downscaled_grc (:) = ival - allocate(this%forc_th_not_downscaled_grc (begg:endg)) ; this%forc_th_not_downscaled_grc (:) = ival - allocate(this%forc_rho_not_downscaled_grc (begg:endg)) ; this%forc_rho_not_downscaled_grc (:) = ival - allocate(this%forc_lwrad_not_downscaled_grc (begg:endg)) ; this%forc_lwrad_not_downscaled_grc (:) = ival - allocate(this%forc_rain_not_downscaled_grc (begg:endg)) ; this%forc_rain_not_downscaled_grc (:) = ival - allocate(this%forc_snow_not_downscaled_grc (begg:endg)) ; this%forc_snow_not_downscaled_grc (:) = ival - - ! atm->lnd downscaled - allocate(this%forc_t_downscaled_col (begc:endc)) ; this%forc_t_downscaled_col (:) = ival - allocate(this%forc_q_downscaled_col (begc:endc)) ; this%forc_q_downscaled_col (:) = ival - allocate(this%forc_pbot_downscaled_col (begc:endc)) ; this%forc_pbot_downscaled_col (:) = ival - allocate(this%forc_th_downscaled_col (begc:endc)) ; this%forc_th_downscaled_col (:) = ival - allocate(this%forc_rho_downscaled_col (begc:endc)) ; this%forc_rho_downscaled_col (:) = ival - allocate(this%forc_lwrad_downscaled_col (begc:endc)) ; this%forc_lwrad_downscaled_col (:) = ival - allocate(this%forc_rain_downscaled_col (begc:endc)) ; this%forc_rain_downscaled_col (:) = ival - allocate(this%forc_snow_downscaled_col (begc:endc)) ; this%forc_snow_downscaled_col (:) = ival - - ! rof->lnd - allocate(this%forc_flood_grc (begg:endg)) ; this%forc_flood_grc (:) = ival - allocate(this%volr_grc (begg:endg)) ; this%volr_grc (:) = ival - allocate(this%volrmch_grc (begg:endg)) ; this%volrmch_grc (:) = ival - - ! anomaly forcing - allocate(this%bc_precip_grc (begg:endg)) ; this%bc_precip_grc (:) = ival - allocate(this%af_precip_grc (begg:endg)) ; this%af_precip_grc (:) = ival - allocate(this%af_uwind_grc (begg:endg)) ; this%af_uwind_grc (:) = ival - allocate(this%af_vwind_grc (begg:endg)) ; this%af_vwind_grc (:) = ival - allocate(this%af_tbot_grc (begg:endg)) ; this%af_tbot_grc (:) = ival - allocate(this%af_pbot_grc (begg:endg)) ; this%af_pbot_grc (:) = ival - allocate(this%af_shum_grc (begg:endg)) ; this%af_shum_grc (:) = ival - allocate(this%af_swdn_grc (begg:endg)) ; this%af_swdn_grc (:) = ival - allocate(this%af_lwdn_grc (begg:endg)) ; this%af_lwdn_grc (:) = ival - - allocate(this%fsd24_patch (begp:endp)) ; this%fsd24_patch (:) = nan - allocate(this%fsd240_patch (begp:endp)) ; this%fsd240_patch (:) = nan - allocate(this%fsi24_patch (begp:endp)) ; this%fsi24_patch (:) = nan - allocate(this%fsi240_patch (begp:endp)) ; this%fsi240_patch (:) = nan - allocate(this%prec10_patch (begp:endp)) ; this%prec10_patch (:) = nan - allocate(this%prec60_patch (begp:endp)) ; this%prec60_patch (:) = nan - allocate(this%rh30_patch (begp:endp)) ; this%rh30_patch (:) = nan - allocate(this%prec365_col (begc:endc)) ; this%prec365_col (:) = nan - if (use_fates) then - allocate(this%prec24_patch (begp:endp)) ; this%prec24_patch (:) = nan - allocate(this%rh24_patch (begp:endp)) ; this%rh24_patch (:) = nan - allocate(this%wind24_patch (begp:endp)) ; this%wind24_patch (:) = nan - end if - allocate(this%t_mo_patch (begp:endp)) ; this%t_mo_patch (:) = nan - allocate(this%t_mo_min_patch (begp:endp)) ; this%t_mo_min_patch (:) = spval ! TODO - initialize this elsewhere - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begg, endg - integer :: begc, endc - integer :: begp, endp - !--------------------------------------------------------------------- - - begg = bounds%begg; endg= bounds%endg - begc = bounds%begc; endc= bounds%endc - begp = bounds%begp; endp= bounds%endp - - this%forc_flood_grc(begg:endg) = spval - call hist_addfld1d (fname='QFLOOD', units='mm/s', & - avgflag='A', long_name='runoff from river flooding', & - ptr_lnd=this%forc_flood_grc) - - this%volr_grc(begg:endg) = spval - call hist_addfld1d (fname='VOLR', units='m3', & - avgflag='A', long_name='river channel total water storage', & - ptr_lnd=this%volr_grc) - - this%volrmch_grc(begg:endg) = spval - call hist_addfld1d (fname='VOLRMCH', units='m3', & - avgflag='A', long_name='river channel main channel water storage', & - ptr_lnd=this%volrmch_grc) - - this%forc_wind_grc(begg:endg) = spval - call hist_addfld1d (fname='WIND', units='m/s', & - avgflag='A', long_name='atmospheric wind velocity magnitude', & - ptr_lnd=this%forc_wind_grc) - ! Rename of WIND for Urban intercomparision project - call hist_addfld1d (fname='Wind', units='m/s', & - avgflag='A', long_name='atmospheric wind velocity magnitude', & - ptr_gcell=this%forc_wind_grc, default = 'inactive') - - this%forc_hgt_grc(begg:endg) = spval - call hist_addfld1d (fname='ZBOT', units='m', & - avgflag='A', long_name='atmospheric reference height', & - ptr_lnd=this%forc_hgt_grc) - - this%forc_topo_grc(begg:endg) = spval - call hist_addfld1d (fname='ATM_TOPO', units='m', & - avgflag='A', long_name='atmospheric surface height', & - ptr_lnd=this%forc_topo_grc) - - this%forc_solar_grc(begg:endg) = spval - call hist_addfld1d (fname='FSDS', units='W/m^2', & - avgflag='A', long_name='atmospheric incident solar radiation', & - ptr_lnd=this%forc_solar_grc) - - this%forc_pco2_grc(begg:endg) = spval - call hist_addfld1d (fname='PCO2', units='Pa', & - avgflag='A', long_name='atmospheric partial pressure of CO2', & - ptr_lnd=this%forc_pco2_grc) - - this%forc_solar_grc(begg:endg) = spval - call hist_addfld1d (fname='SWdown', units='W/m^2', & - avgflag='A', long_name='atmospheric incident solar radiation', & - ptr_gcell=this%forc_solar_grc, default='inactive') - - this%forc_rh_grc(begg:endg) = spval - call hist_addfld1d (fname='RH', units='%', & - avgflag='A', long_name='atmospheric relative humidity', & - ptr_gcell=this%forc_rh_grc, default='inactive') - - if (use_lch4) then - this%forc_pch4_grc(begg:endg) = spval - call hist_addfld1d (fname='PCH4', units='Pa', & - avgflag='A', long_name='atmospheric partial pressure of CH4', & - ptr_lnd=this%forc_pch4_grc) - end if - - this%forc_t_not_downscaled_grc(begg:endg) = spval - call hist_addfld1d (fname='Tair_from_atm', units='K', & - avgflag='A', long_name='atmospheric air temperature received from atmosphere (pre-downscaling)', & - ptr_gcell=this%forc_t_not_downscaled_grc, default='inactive') - - this%forc_t_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='TBOT', units='K', & - avgflag='A', long_name='atmospheric air temperature (downscaled to columns in glacier regions)', & - ptr_col=this%forc_t_downscaled_col) - call hist_addfld1d (fname='Tair', units='K', & - avgflag='A', long_name='atmospheric air temperature (downscaled to columns in glacier regions)', & - ptr_col=this%forc_t_downscaled_col, default='inactive') - - this%forc_pbot_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='PBOT', units='Pa', & - avgflag='A', long_name='atmospheric pressure at surface (downscaled to columns in glacier regions)', & - ptr_col=this%forc_pbot_downscaled_col) - call hist_addfld1d (fname='PSurf', units='Pa', & - avgflag='A', long_name='atmospheric pressure at surface (downscaled to columns in glacier regions)', & - ptr_col=this%forc_pbot_downscaled_col, default='inactive') - - this%forc_lwrad_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='FLDS', units='W/m^2', & - avgflag='A', long_name='atmospheric longwave radiation (downscaled to columns in glacier regions)', & - ptr_col=this%forc_lwrad_downscaled_col) - call hist_addfld1d (fname='LWdown', units='W/m^2', & - avgflag='A', long_name='atmospheric longwave radiation (downscaled to columns in glacier regions)', & - ptr_col=this%forc_lwrad_downscaled_col, default='inactive') - - call hist_addfld1d (fname='FLDS_ICE', units='W/m^2', & - avgflag='A', & - long_name='atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only)', & - ptr_col=this%forc_lwrad_downscaled_col, l2g_scale_type='ice', & - default='inactive') - - this%forc_rain_not_downscaled_grc(begg:endg) = spval - call hist_addfld1d (fname='RAIN_FROM_ATM', units='mm/s', & - avgflag='A', long_name='atmospheric rain received from atmosphere (pre-repartitioning)', & - ptr_lnd=this%forc_rain_not_downscaled_grc) - - this%forc_snow_not_downscaled_grc(begg:endg) = spval - call hist_addfld1d (fname='SNOW_FROM_ATM', units='mm/s', & - avgflag='A', long_name='atmospheric snow received from atmosphere (pre-repartitioning)', & - ptr_lnd=this%forc_snow_not_downscaled_grc) - - this%forc_rain_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='RAIN', units='mm/s', & - avgflag='A', long_name='atmospheric rain, after rain/snow repartitioning based on temperature', & - ptr_col=this%forc_rain_downscaled_col) - call hist_addfld1d (fname='Rainf', units='mm/s', & - avgflag='A', long_name='atmospheric rain, after rain/snow repartitioning based on temperature', & - ptr_col=this%forc_rain_downscaled_col, default='inactive') - - call hist_addfld1d (fname='RAIN_ICE', units='mm/s', & - avgflag='A', & - long_name='atmospheric rain, after rain/snow repartitioning based on temperature (ice landunits only)', & - ptr_col=this%forc_rain_downscaled_col, l2g_scale_type='ice', & - default='inactive') - - this%forc_snow_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='SNOW', units='mm/s', & - avgflag='A', long_name='atmospheric snow, after rain/snow repartitioning based on temperature', & - ptr_col=this%forc_snow_downscaled_col) - - call hist_addfld1d (fname='SNOW_ICE', units='mm/s', & - avgflag='A', & - long_name='atmospheric snow, after rain/snow repartitioning based on temperature (ice landunits only)', & - ptr_col=this%forc_snow_downscaled_col, l2g_scale_type='ice', & - default='inactive') - - this%forc_th_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='THBOT', units='K', & - avgflag='A', long_name='atmospheric air potential temperature (downscaled to columns in glacier regions)', & - ptr_col=this%forc_th_downscaled_col) - - this%forc_q_downscaled_col(begc:endc) = spval - call hist_addfld1d (fname='QBOT', units='kg/kg', & - avgflag='A', long_name='atmospheric specific humidity (downscaled to columns in glacier regions)', & - ptr_col=this%forc_q_downscaled_col) - ! Rename of QBOT for Urban intercomparison project - call hist_addfld1d (fname='Qair', units='kg/kg', & - avgflag='A', long_name='atmospheric specific humidity (downscaled to columns in glacier regions)', & - ptr_col=this%forc_q_downscaled_col, default='inactive') - - ! Time averaged quantities - this%fsi24_patch(begp:endp) = spval - call hist_addfld1d (fname='FSI24', units='K', & - avgflag='A', long_name='indirect radiation (last 24hrs)', & - ptr_patch=this%fsi24_patch, default='inactive') - - this%fsi240_patch(begp:endp) = spval - call hist_addfld1d (fname='FSI240', units='K', & - avgflag='A', long_name='indirect radiation (last 240hrs)', & - ptr_patch=this%fsi240_patch, default='inactive') - - this%fsd24_patch(begp:endp) = spval - call hist_addfld1d (fname='FSD24', units='K', & - avgflag='A', long_name='direct radiation (last 24hrs)', & - ptr_patch=this%fsd24_patch, default='inactive') - - this%fsd240_patch(begp:endp) = spval - call hist_addfld1d (fname='FSD240', units='K', & - avgflag='A', long_name='direct radiation (last 240hrs)', & - ptr_patch=this%fsd240_patch, default='inactive') - - if (use_cn) then - this%rh30_patch(begp:endp) = spval - call hist_addfld1d (fname='RH30', units='%', & - avgflag='A', long_name='30-day running mean of relative humidity', & - ptr_patch=this%rh30_patch, default='inactive') - - this%prec10_patch(begp:endp) = spval - call hist_addfld1d (fname='PREC10', units='MM H2O/S', & - avgflag='A', long_name='10-day running mean of PREC', & - ptr_patch=this%prec10_patch, default='inactive') - - this%prec60_patch(begp:endp) = spval - call hist_addfld1d (fname='PREC60', units='MM H2O/S', & - avgflag='A', long_name='60-day running mean of PREC', & - ptr_patch=this%prec60_patch, default='inactive') - end if - - if (use_cndv) then - call hist_addfld1d (fname='TDA', units='K', & - avgflag='A', long_name='daily average 2-m temperature', & - ptr_patch=this%t_mo_patch) - end if - - if(use_luna)then - this%forc_pco2_240_patch = spval - call hist_addfld1d (fname='PCO2_240', units='Pa', & - avgflag='A', long_name='10 day running mean of CO2 pressure', & - ptr_patch=this%forc_pco2_240_patch, default='inactive') - this%forc_po2_240_patch = spval - call hist_addfld1d (fname='PO2_240', units='Pa', & - avgflag='A', long_name='10 day running mean of O2 pressure', & - ptr_patch=this%forc_po2_240_patch, default='inactive') - this%forc_pbot240_downscaled_patch = spval - call hist_addfld1d (fname='PBOT_240', units='Pa', & - avgflag='A', long_name='10 day running mean of air pressure', & - ptr_patch=this%forc_pbot240_downscaled_patch, default='inactive') - endif - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitAccBuffer (this, bounds) - ! - ! !DESCRIPTION: - ! Initialize accumulation buffer for all required module accumulated fields - ! This routine set defaults values that are then overwritten by the - ! restart file for restart or branch runs - ! - ! !USES - use clm_varcon , only : spval - use accumulMod , only : init_accum_field - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - !--------------------------------------------------------------------- - - this%fsd24_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSD24', units='W/m2', & - desc='24hr average of direct solar radiation', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%fsd240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSD240', units='W/m2', & - desc='240hr average of direct solar radiation', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%fsi24_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSI24', units='W/m2', & - desc='24hr average of diffuse solar radiation', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - this%fsi240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='FSI240', units='W/m2', & - desc='240hr average of diffuse solar radiation', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - if (use_cn) then - call init_accum_field (name='PREC10', units='MM H2O/S', & - desc='10-day running mean of total precipitation', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='PREC60', units='MM H2O/S', & - desc='60-day running mean of total precipitation', accum_type='runmean', accum_period=-60, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='RH30', units='%', & - desc='30-day running mean of relative humidity', accum_type='runmean', accum_period=-30, & - subgrid_type='pft', numlev=1, init_value=100._r8) - end if - - if (use_cndv) then - ! The following is a running mean with the accumulation period is set to -365 for a 365-day running mean. - call init_accum_field (name='PREC365', units='MM H2O/S', & - desc='365-day running mean of total precipitation', accum_type='runmean', accum_period=-365, & - subgrid_type='column', numlev=1, init_value=0._r8) - end if - - if ( use_fates ) then - call init_accum_field (name='PREC24', units='m', & - desc='24hr sum of precipitation', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! Fudge - this neds to be initialized from the restat file eventually. - call init_accum_field (name='RH24', units='m', & - desc='24hr average of RH', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=100._r8) - - call init_accum_field (name='WIND24', units='m', & - desc='24hr average of wind', accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - end if - - if(use_luna) then - this%forc_po2_240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='po2_240', units='Pa', & - desc='10-day running mean of parial O2 pressure', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=21223._r8) - - this%forc_pco2_240_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='pco2_240', units='Pa', & - desc='10-day running mean of parial CO2 pressure', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=28._r8) - - this%forc_pbot240_downscaled_patch(bounds%begp:bounds%endp) = spval - call init_accum_field (name='pbot240', units='Pa', & - desc='10-day running mean of air pressure', accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=101325._r8) - - endif - - end subroutine InitAccBuffer - - !----------------------------------------------------------------------- - subroutine InitAccVars(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module variables that are associated with - ! time accumulated fields. This routine is called for both an initial run - ! and a restart run (and must therefore must be called after the restart file - ! is read in and the accumulation buffer is obtained) - ! - ! !USES - use accumulMod , only : extract_accum_field - use clm_time_manager , only : get_nstep - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - integer :: nstep - integer :: ier - real(r8), pointer :: rbufslp(:) ! temporary - real(r8), pointer :: rbufslc(:) ! temporary - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg="InitAccVars allocation error for rbufslp"//& - errMsg(sourcefile, __LINE__)) - endif - ! Allocate needed dynamic memory for single level col field - allocate(rbufslc(begc:endc), stat=ier) - if (ier/=0) then - write(iulog,*)' in ' - call endrun(msg="InitAccVars allocation error for rbufslc"//& - errMsg(sourcefile, __LINE__)) - endif - - ! Determine time step - nstep = get_nstep() - - call extract_accum_field ('FSD24', rbufslp, nstep) - this%fsd24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('FSD240', rbufslp, nstep) - this%fsd240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('FSI24', rbufslp, nstep) - this%fsi24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('FSI240', rbufslp, nstep) - this%fsi240_patch(begp:endp) = rbufslp(begp:endp) - - if (use_cn) then - call extract_accum_field ('PREC10', rbufslp, nstep) - this%prec10_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('PREC60', rbufslp, nstep) - this%prec60_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('RH30', rbufslp, nstep) - this%rh30_patch(begp:endp) = rbufslp(begp:endp) - end if - - if (use_cndv) then - call extract_accum_field ('PREC365' , rbufslc, nstep) - this%prec365_col(begc:endc) = rbufslc(begc:endc) - - call extract_accum_field ('TDA', rbufslp, nstep) - this%t_mo_patch(begp:endp) = rbufslp(begp:endp) - end if - - if (use_fates) then - call extract_accum_field ('PREC24', rbufslp, nstep) - this%prec24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('RH24', rbufslp, nstep) - this%rh24_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('WIND24', rbufslp, nstep) - this%wind24_patch(begp:endp) = rbufslp(begp:endp) - end if - - if(use_luna) then - call extract_accum_field ('po2_240', rbufslp, nstep) - this%forc_po2_240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('pco2_240', rbufslp, nstep) - this%forc_pco2_240_patch(begp:endp) = rbufslp(begp:endp) - - call extract_accum_field ('pbot240', rbufslp, nstep) - this%forc_pbot240_downscaled_patch(begp:endp) = rbufslp(begp:endp) - - endif - - deallocate(rbufslp) - deallocate(rbufslc) - - end subroutine InitAccVars - - !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) - ! - ! USES - use clm_time_manager, only : get_nstep - use accumulMod , only : update_accum_field, extract_accum_field - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,c,p ! indices - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: ier ! error status - integer :: begp, endp - integer :: begc, endc - real(r8), pointer :: rbufslp(:) ! temporary single level - patch level - real(r8), pointer :: rbufslc(:) ! temporary single level - column level - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - nstep = get_nstep() - - ! Allocate needed dynamic memory for single level patch field - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'UpdateAccVars allocation error for rbufslp' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - ! Allocate needed dynamic memory for single level col field - allocate(rbufslc(begc:endc), stat=ier) - if (ier/=0) then - write(iulog,*)'UpdateAccVars allocation error for rbufslc' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - ! Accumulate and extract forc_solad24 & forc_solad240 - do p = begp,endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_solad_grc(g,1) - end do - call update_accum_field ('FSD240', rbufslp , nstep) - call extract_accum_field ('FSD240', this%fsd240_patch , nstep) - call update_accum_field ('FSD24' , rbufslp , nstep) - call extract_accum_field ('FSD24' , this%fsd24_patch , nstep) - - ! Accumulate and extract forc_solai24 & forc_solai240 - do p = begp,endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_solai_grc(g,1) - end do - call update_accum_field ('FSI24' , rbufslp , nstep) - call extract_accum_field ('FSI24' , this%fsi24_patch , nstep) - call update_accum_field ('FSI240', rbufslp , nstep) - call extract_accum_field ('FSI240', this%fsi240_patch , nstep) - - ! Precipitation accumulators - ! - ! For CNDV, we use a column-level accumulator. We cannot use a patch-level - ! accumulator for CNDV because this is used for establishment, so must be available - ! for inactive patches. In principle, we could/should switch to column-level for the - ! other precip accumulators, too; we'd just need to be careful about backwards - ! compatibility with old restart files. - - do p = begp,endp - c = patch%column(p) - rbufslp(p) = this%forc_rain_downscaled_col(c) + this%forc_snow_downscaled_col(c) - rbufslc(c) = this%forc_rain_downscaled_col(c) + this%forc_snow_downscaled_col(c) - end do - - if (use_cn) then - ! Accumulate and extract PREC60 (accumulates total precipitation as 60-day running mean) - call update_accum_field ('PREC60', rbufslp, nstep) - call extract_accum_field ('PREC60', this%prec60_patch, nstep) - - ! Accumulate and extract PREC10 (accumulates total precipitation as 10-day running mean) - call update_accum_field ('PREC10', rbufslp, nstep) - call extract_accum_field ('PREC10', this%prec10_patch, nstep) - end if - - if (use_cndv) then - ! Accumulate and extract PREC365 (accumulates total precipitation as 365-day running mean) - ! See above comment regarding why this is at the column-level despite other prec - ! accumulators being at the patch level. - call update_accum_field ('PREC365', rbufslc, nstep) - call extract_accum_field ('PREC365', this%prec365_col, nstep) - - ! Accumulate and extract TDA (accumulates TBOT as 30-day average) and - ! also determines t_mo_min - - do p = begp,endp - c = patch%column(p) - rbufslp(p) = this%forc_t_downscaled_col(c) - end do - call update_accum_field ('TDA', rbufslp, nstep) - call extract_accum_field ('TDA', rbufslp, nstep) - do p = begp,endp - this%t_mo_patch(p) = rbufslp(p) - this%t_mo_min_patch(p) = min(this%t_mo_min_patch(p), rbufslp(p)) - end do - - end if - - if (use_fates) then - call update_accum_field ('PREC24', rbufslp, nstep) - call extract_accum_field ('PREC24', this%prec24_patch, nstep) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_wind_grc(g) - end do - call update_accum_field ('WIND24', rbufslp, nstep) - call extract_accum_field ('WIND24', this%wind24_patch, nstep) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_rh_grc(g) - end do - call update_accum_field ('RH24', rbufslp, nstep) - call extract_accum_field ('RH24', this%rh24_patch, nstep) - end if - - if(use_luna) then - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_pco2_grc(g) - enddo - call update_accum_field ('pco2_240', rbufslp, nstep) - call extract_accum_field ('pco2_240', this%forc_pco2_240_patch, nstep) - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_po2_grc(g) - enddo - call update_accum_field ('po2_240', rbufslp, nstep) - call extract_accum_field ('po2_240', this%forc_po2_240_patch, nstep) - - do p = bounds%begp,bounds%endp - c = patch%column(p) - rbufslp(p) = this%forc_pbot_downscaled_col(c) - enddo - call update_accum_field ('pbot240', rbufslp, nstep) - call extract_accum_field ('pbot240', this%forc_pbot240_downscaled_patch, nstep) - - endif - - if (use_cn) then - do p = begp,endp - g = patch%gridcell(p) - rbufslp(p) = this%forc_rh_grc(g) - end do - ! Accumulate and extract RH30 (accumulates RH as 30-day running mean) - call update_accum_field ('RH30', rbufslp, nstep) - call extract_accum_field ('RH30', this%rh30_patch, nstep) - endif - - deallocate(rbufslp) - deallocate(rbufslc) - - end subroutine UpdateAccVars - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class(atm2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - ! - ! !LOCAL VARIABLES: - logical :: readvar - !------------------------------------------------------------------------ - - call restartvar(ncid=ncid, flag=flag, varname='qflx_floodg', xtype=ncd_double, & - dim1name='gridcell', & - long_name='flood water flux', units='mm/s', & - interpinic_flag='skip', readvar=readvar, data=this%forc_flood_grc) - if (flag == 'read' .and. .not. readvar) then - ! initial run, readvar=readvar, not restart: initialize flood to zero - this%forc_flood_grc = 0._r8 - endif - - if (use_cndv) then - call restartvar(ncid=ncid, flag=flag, varname='T_MO_MIN', xtype=ncd_double, & - dim1name='pft', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%t_mo_min_patch) - end if - - if(use_luna)then - call restartvar(ncid=ncid, flag=flag, varname='pco2_240', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean CO2 partial pressure', units='Pa', & - interpinic_flag='interp', readvar=readvar, data=this%forc_pco2_240_patch ) - call restartvar(ncid=ncid, flag=flag, varname='po2_240', xtype=ncd_double, & - dim1name='pft', long_name='10-day mean O2 partial pressure', units='Pa', & - interpinic_flag='interp', readvar=readvar, data=this%forc_po2_240_patch ) - call restartvar(ncid=ncid, flag=flag, varname='pbot240', xtype=ncd_double, & - dim1name='pft', long_name='10 day mean atmospheric pressure(Pa)', units='Pa', & - interpinic_flag='interp', readvar=readvar, data=this%forc_pbot240_downscaled_patch ) - endif - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine Clean(this) - ! - ! !DESCRIPTION: - ! Finalize this instance - ! - ! !USES: - ! - ! !ARGUMENTS: - class(atm2lnd_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - ! atm->lnd - deallocate(this%forc_u_grc) - deallocate(this%forc_v_grc) - deallocate(this%forc_wind_grc) - deallocate(this%forc_rh_grc) - deallocate(this%forc_hgt_grc) - deallocate(this%forc_topo_grc) - deallocate(this%forc_hgt_u_grc) - deallocate(this%forc_hgt_t_grc) - deallocate(this%forc_hgt_q_grc) - deallocate(this%forc_vp_grc) - deallocate(this%forc_psrf_grc) - deallocate(this%forc_pco2_grc) - deallocate(this%forc_solad_grc) - deallocate(this%forc_solai_grc) - deallocate(this%forc_solar_grc) - deallocate(this%forc_ndep_grc) - deallocate(this%forc_pc13o2_grc) - deallocate(this%forc_po2_grc) - deallocate(this%forc_aer_grc) - deallocate(this%forc_pch4_grc) - - ! atm->lnd not downscaled - deallocate(this%forc_t_not_downscaled_grc) - deallocate(this%forc_q_not_downscaled_grc) - deallocate(this%forc_pbot_not_downscaled_grc) - deallocate(this%forc_th_not_downscaled_grc) - deallocate(this%forc_rho_not_downscaled_grc) - deallocate(this%forc_lwrad_not_downscaled_grc) - deallocate(this%forc_rain_not_downscaled_grc) - deallocate(this%forc_snow_not_downscaled_grc) - - ! atm->lnd downscaled - deallocate(this%forc_t_downscaled_col) - deallocate(this%forc_q_downscaled_col) - deallocate(this%forc_pbot_downscaled_col) - deallocate(this%forc_th_downscaled_col) - deallocate(this%forc_rho_downscaled_col) - deallocate(this%forc_lwrad_downscaled_col) - deallocate(this%forc_rain_downscaled_col) - deallocate(this%forc_snow_downscaled_col) - - ! rof->lnd - deallocate(this%forc_flood_grc) - deallocate(this%volr_grc) - deallocate(this%volrmch_grc) - - ! anomaly forcing - deallocate(this%bc_precip_grc) - deallocate(this%af_precip_grc) - deallocate(this%af_uwind_grc) - deallocate(this%af_vwind_grc) - deallocate(this%af_tbot_grc) - deallocate(this%af_pbot_grc) - deallocate(this%af_shum_grc) - deallocate(this%af_swdn_grc) - deallocate(this%af_lwdn_grc) - - deallocate(this%fsd24_patch) - deallocate(this%fsd240_patch) - deallocate(this%fsi24_patch) - deallocate(this%fsi240_patch) - deallocate(this%prec10_patch) - deallocate(this%prec60_patch) - deallocate(this%prec365_col) - if (use_fates) then - deallocate(this%prec24_patch) - deallocate(this%rh24_patch) - deallocate(this%wind24_patch) - end if - deallocate(this%t_mo_patch) - deallocate(this%t_mo_min_patch) - - end subroutine Clean - - -end module atm2lndType diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 deleted file mode 100644 index b1a4a9beb8..0000000000 --- a/src/main/clm_driver.F90 +++ /dev/null @@ -1,1446 +0,0 @@ -module clm_driver - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! This module provides the main CLM driver physics calling sequence. Most - ! computations occurs over ``clumps'' of gridcells (and associated subgrid - ! scale entities) assigned to each MPI process. Computation is further - ! parallelized by looping over clumps on each process using shared memory OpenMP. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : wrtdia, iulog, use_fates - use clm_varctl , only : use_cn, use_lch4, use_noio, use_c13, use_c14 - use clm_varctl , only : use_crop, ndep_from_cpl - use clm_time_manager , only : get_nstep, is_beg_curr_day - use clm_time_manager , only : get_prev_date, is_first_step - use clm_varpar , only : nlevsno, nlevgrnd - use clm_varorb , only : obliqr - use spmdMod , only : masterproc, mpicom - use decompMod , only : get_proc_clumps, get_clump_bounds, get_proc_bounds, bounds_type - use filterMod , only : filter, filter_inactive_and_active - use filterMod , only : setExposedvegpFilter - use histFileMod , only : hist_update_hbuf, hist_htapes_wrapup - use restFileMod , only : restFile_write, restFile_filename - use abortutils , only : endrun - ! - use dynSubgridDriverMod , only : dynSubgrid_driver, dynSubgrid_wrapup_weight_changes - use BalanceCheckMod , only : BeginWaterBalance, BalanceCheck - ! - use CanopyTemperatureMod , only : CanopyTemperature ! (formerly Biogeophysics1Mod) - use UrbanTimeVarType , only : urbantv_type - use SoilTemperatureMod , only : SoilTemperature - use LakeTemperatureMod , only : LakeTemperature - ! - use BareGroundFluxesMod , only : BareGroundFluxes - use CanopyFluxesMod , only : CanopyFluxes - use SoilFluxesMod , only : SoilFluxes ! (formerly Biogeophysics2Mod) - use UrbanFluxesMod , only : UrbanFluxes - use LakeFluxesMod , only : LakeFluxes - ! - use HydrologyNoDrainageMod , only : HydrologyNoDrainage ! (formerly Hydrology2Mod) - use HydrologyDrainageMod , only : HydrologyDrainage ! (formerly Hydrology2Mod) - use CanopyHydrologyMod , only : CanopyHydrology ! (formerly Hydrology1Mod) - use LakeHydrologyMod , only : LakeHydrology - ! - use AerosolMod , only : AerosolMasses - use SnowSnicarMod , only : SnowAge_grain - use SurfaceAlbedoMod , only : SurfaceAlbedo - use UrbanAlbedoMod , only : UrbanAlbedo - ! - use SurfaceRadiationMod , only : SurfaceRadiation, CanopySunShadeFracs - use UrbanRadiationMod , only : UrbanRadiation - ! - use SoilBiogeochemVerticalProfileMod , only : SoilBiogeochemVerticalProfile - use SatellitePhenologyMod , only : SatellitePhenology, interpMonthlyVeg - use ndepStreamMod , only : ndep_interp - use ActiveLayerMod , only : alt_calc - use ch4Mod , only : ch4, ch4_init_balance_check - use DUSTMod , only : DustDryDep, DustEmission - use VOCEmissionMod , only : VOCEmission - ! - use filterMod , only : setFilters - ! - use atm2lndMod , only : downscale_forcings - use lnd2atmMod , only : lnd2atm - use lnd2glcMod , only : lnd2glc_type - ! - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - use DryDepVelocity , only : depvel_compute - ! - use DaylengthMod , only : UpdateDaylength - use perf_mod - ! - use clm_initializeMod , only : nutrient_competition_method - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use clm_instMod - use clm_initializeMod , only : soil_water_retention_curve - use EDBGCDynMod , only : EDBGCDyn, EDBGCDynSummary - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_drv ! Main clm driver - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: clm_drv_patch2col - private :: clm_drv_init ! Initialization of variables needed from previous timestep - private :: write_diagnostic ! Write diagnostic information to log file - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic) - ! - ! !DESCRIPTION: - ! - ! First phase of the clm driver calling the clm physics. An outline of - ! the calling tree is given in the description of this module. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - implicit none - logical , intent(in) :: doalb ! true if time for surface albedo calc - real(r8), intent(in) :: nextsw_cday ! calendar day for nstep+1 - real(r8), intent(in) :: declinp1 ! declination angle for next time step - real(r8), intent(in) :: declin ! declination angle for current time step - logical, intent(in) :: rstwr ! true => write restart file this step - logical, intent(in) :: nlend ! true => end of run on this step - character(len=*),intent(in) :: rdate ! restart file time stamp for name - - ! Whether we're running with a prognostic ROF component. This shouldn't change from - ! timestep to timestep, but we pass it into the driver loop because it isn't available - ! in initialization. - logical, intent(in) :: rof_prognostic ! whether we're running with a prognostic ROF component - ! - ! !LOCAL VARIABLES: - integer :: nstep ! time step number - integer :: nc, c, p, l, g ! indices - integer :: nclumps ! number of clumps on this processor - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - integer :: yr_prev ! year (0, ...) at start of timestep - integer :: mon_prev ! month (1, ..., 12) at start of timestep - integer :: day_prev ! day of month (1, ..., 31) at start of timestep - integer :: sec_prev ! seconds of the day at start of timestep - character(len=256) :: filer ! restart file name - integer :: ier ! error code - logical :: need_glacier_initialization ! true if we need to initialize glacier areas in this time step - type(bounds_type) :: bounds_clump - type(bounds_type) :: bounds_proc - - ! COMPILER_BUG(wjs, 2016-02-24, pgi 15.10) These temporary allocatable arrays are - ! needed to work around pgi compiler bugs, as noted below - real(r8), allocatable :: downreg_patch(:) - real(r8), allocatable :: leafn_patch(:) - real(r8), allocatable :: agnpp_patch(:) - real(r8), allocatable :: bgnpp_patch(:) - real(r8), allocatable :: annsum_npp_patch(:) - real(r8), allocatable :: rr_patch(:) - real(r8), allocatable :: net_carbon_exchange_grc(:) - real(r8), allocatable :: froot_carbon(:) - real(r8), allocatable :: croot_carbon(:) - - ! COMPILER_BUG(wjs, 2014-11-29, pgi 14.7) Workaround for internal compiler error with - ! pgi 14.7 ('normalize_forall_array: non-conformable'), which appears in the call to - ! CalcIrrigationNeeded. Simply declaring this variable makes the ICE go away. - real(r8), allocatable :: dummy1_to_make_pgi_happy(:) - !----------------------------------------------------------------------- - - ! Determine processor bounds and clumps for this processor - - call get_proc_bounds(bounds_proc) - nclumps = get_proc_clumps() - - ! ======================================================================== - ! In the first time step of a startup or hybrid run, we want to update CLM's glacier - ! areas to match those given by GLC. This is because, in initialization, we do not yet - ! know GLC's glacier areas, so CLM's glacier areas are based on the surface dataset - ! (for a cold start or init_interp run) or the initial conditions file (in a - ! non-init_interp, non-cold start run) - which may not match GLC's glacier areas for - ! this configuration. (Coupling fields from GLC aren't received until the run loop.) - ! Thus, CLM will see a potentially large, fictitious glacier area change in the first - ! time step. We don't want this fictitious area change to result in any state or flux - ! adjustments. Thus, we apply this area change here, at the start of the driver loop, - ! so that in dynSubgrid_driver, it will look like there is no glacier area change in - ! the first time step. (See - ! https://github.com/ESCOMP/ctsm/issues/340#issuecomment-410483131 for more - ! discussion on this.) - ! - ! This needs to happen very early in the run loop, before any balance checks are - ! initialized, because - by design - this doesn't conserve mass at the grid cell - ! level. (The whole point of this code block is that we adjust areas without doing - ! the typical state or flux adjustments that need to accompany those area changes for - ! conservation.) - ! - ! This accomplishes approximately the same effect that we would get if we were able to - ! update glacier areas in initialization. The one difference - and minor, theoretical - ! problem - that could arise from this start-of-run-loop update is: If the first time - ! step of the CESM run loop looked like: (1) GLC runs and updates glacier area (i.e., - ! glacier area changes in the first time step compared with what was set in - ! initialization); (2) coupler passes new glacier area to CLM; (3) CLM runs. Then the - ! code here would mean that the true change in glacier area between initialization and - ! the first time step would be ignored as far as state and flux adjustments are - ! concerned. But this is unlikely to be an issue in practice: Currently GLC doesn't - ! update this frequently, and even if it did, the change in glacier area in a single - ! time step would typically be very small. - ! - ! If we are ever able to change the CESM initialization sequence so that GLC fields - ! are passed to CLM in initialization, then this code block can be removed. - ! ======================================================================== - - need_glacier_initialization = is_first_step() - - if (need_glacier_initialization) then - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - - call glc2lnd_inst%update_glc2lnd_fracs( & - bounds = bounds_clump) - - call dynSubgrid_wrapup_weight_changes(bounds_clump, glc_behavior) - - end do - !$OMP END PARALLEL DO - end if - - ! ============================================================================ - ! Specified phenology - ! ============================================================================ - - if (use_cn) then - ! For dry-deposition need to call CLMSP so that mlaidiff is obtained - if ( n_drydep > 0 .and. drydep_method == DD_XLND ) then - call t_startf('interpMonthlyVeg') - call interpMonthlyVeg(bounds_proc, canopystate_inst) - call t_stopf('interpMonthlyVeg') - endif - - else - ! Determine weights for time interpolation of monthly vegetation data. - ! This also determines whether it is time to read new monthly vegetation and - ! obtain updated leaf area index [mlai1,mlai2], stem area index [msai1,msai2], - ! vegetation top [mhvt1,mhvt2] and vegetation bottom [mhvb1,mhvb2]. The - ! weights obtained here are used in subroutine SatellitePhenology to obtain time - ! interpolated values. - if (doalb .or. ( n_drydep > 0 .and. drydep_method == DD_XLND )) then - call t_startf('interpMonthlyVeg') - call interpMonthlyVeg(bounds_proc, canopystate_inst) - call t_stopf('interpMonthlyVeg') - end if - - end if - - ! ================================================================================== - ! Determine decomp vertical profiles - ! - ! These routines (alt_calc & decomp_vertprofiles) need to be called before - ! pftdyn_cnbal, and it appears that they need to be called before pftdyn_interp and - ! the associated filter updates, too (otherwise we get a carbon balance error) - ! ================================================================================== - - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - ! BUG(wjs, 2014-12-15, bugz 2107) Because of the placement of the following - ! routines (alt_calc and SoilBiogeochemVerticalProfile) in the driver sequence - - ! they are called very early in each timestep, before weights are adjusted and - ! filters are updated - it may be necessary for these routines to compute values - ! over inactive as well as active points (since some inactive points may soon - ! become active) - so that's what is done now. Currently, it seems to be okay to do - ! this, because the variables computed here seem to only depend on quantities that - ! are valid over inactive as well as active points. - - call t_startf("decomp_vert") - call alt_calc(filter_inactive_and_active(nc)%num_soilc, filter_inactive_and_active(nc)%soilc, & - temperature_inst, canopystate_inst) - - if (use_cn) then - call SoilBiogeochemVerticalProfile(bounds_clump , & - filter_inactive_and_active(nc)%num_soilc, filter_inactive_and_active(nc)%soilc , & - filter_inactive_and_active(nc)%num_soilp, filter_inactive_and_active(nc)%soilp , & - canopystate_inst, soilstate_inst, soilbiogeochem_state_inst) - end if - - call t_stopf("decomp_vert") - end do - !$OMP END PARALLEL DO - - ! ============================================================================ - ! Initialize the mass balance checks for carbon and nitrogen, and zero fluxes for - ! transient land cover - ! ============================================================================ - - if (use_cn) then - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - call t_startf('cninit') - - call bgc_vegetation_inst%InitEachTimeStep(bounds_clump, & - filter(nc)%num_soilc, filter(nc)%soilc) - - call t_stopf('cninit') - end do - !$OMP END PARALLEL DO - end if - - ! ============================================================================ - ! Update subgrid weights with dynamic landcover (prescribed transient patches, - ! CNDV, and or dynamic landunits), and do related adjustments. Note that this - ! call needs to happen outside loops over nclumps. - ! ============================================================================ - - call t_startf('dyn_subgrid') - call dynSubgrid_driver(bounds_proc, & - urbanparams_inst, soilstate_inst, soilhydrology_inst, & - waterstate_inst, waterflux_inst, temperature_inst, energyflux_inst, & - canopystate_inst, photosyns_inst, crop_inst, glc2lnd_inst, bgc_vegetation_inst, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_carbonflux_inst, ch4_inst, & - glc_behavior) - call t_stopf('dyn_subgrid') - - ! ============================================================================ - ! Initialize the column-level mass balance checks for water, carbon & nitrogen. - ! - ! For water: Currently, I believe this needs to be done after weights are updated for - ! prescribed transient patches or CNDV, because column-level water is not generally - ! conserved when weights change (instead the difference is put in the grid cell-level - ! terms, qflx_liq_dynbal, etc.). In the future, we may want to change the balance - ! checks to ensure that the grid cell-level water is conserved, considering - ! qflx_liq_dynbal; in this case, the call to BeginWaterBalance should be moved to - ! before the weight updates. - ! - ! For carbon & nitrogen: This needs to be done after dynSubgrid_driver, because the - ! changes due to dynamic area adjustments can break column-level conservation - ! ============================================================================ - - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - call t_startf('begwbal') - call BeginWaterBalance(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_lakec, filter(nc)%lakec, & - soilhydrology_inst, waterstate_inst) - - call t_stopf('begwbal') - - call t_startf('begcnbal_col') - if (use_cn) then - call bgc_vegetation_inst%InitColumnBalance(bounds_clump, & - filter(nc)%num_allc, filter(nc)%allc, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenstate_inst) - end if - - if (use_lch4) then - call ch4_init_balance_check(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_lakec, filter(nc)%lakec, & - ch4_inst) - end if - call t_stopf('begcnbal_col') - - end do - !$OMP END PARALLEL DO - - ! ============================================================================ - ! Update dynamic N deposition field, on albedo timestep - ! currently being done outside clumps loop, but no reason why it couldn't be - ! re-written to go inside. - ! ============================================================================ - - if (use_cn) then - call t_startf('bgc_interp') - if (.not. ndep_from_cpl) then - call ndep_interp(bounds_proc, atm2lnd_inst) - end if - call bgc_vegetation_inst%InterpFileInputs(bounds_proc) - call t_stopf('bgc_interp') - end if - - ! Get time varying urban data - call urbantv_inst%urbantv_interp(bounds_proc) - - ! ============================================================================ - ! Initialize variables from previous time step, downscale atm forcings, and - ! Determine canopy interception and precipitation onto ground surface. - ! Determine the fraction of foliage covered by water and the fraction - ! of foliage that is dry and transpiring. Initialize snow layer if the - ! snow accumulation exceeds 10 mm. - ! ============================================================================ - - ! Get time as of beginning of time step - call get_prev_date(yr_prev, mon_prev, day_prev, sec_prev) - - !$OMP PARALLEL DO PRIVATE (nc,l,c, bounds_clump, downreg_patch, leafn_patch, agnpp_patch, bgnpp_patch, annsum_npp_patch, rr_patch, froot_carbon, croot_carbon) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - call t_startf('drvinit') - - call UpdateDaylength(bounds_clump, declin=declin, obliquity=obliqr) - - ! Initialze variables needed for new driver time step - call clm_drv_init(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - filter(nc)%num_soilp , filter(nc)%soilp, & - canopystate_inst, waterstate_inst, waterflux_inst, energyflux_inst) - - call topo_inst%UpdateTopo(bounds_clump, & - filter(nc)%num_icemecc, filter(nc)%icemecc, & - glc2lnd_inst, glc_behavior, & - atm_topo = atm2lnd_inst%forc_topo_grc(bounds_clump%begg:bounds_clump%endg)) - - call downscale_forcings(bounds_clump, & - topo_inst, atm2lnd_inst, & - eflx_sh_precip_conversion = energyflux_inst%eflx_sh_precip_conversion_col(bounds_clump%begc:bounds_clump%endc)) - - ! Update filters that depend on variables set in clm_drv_init - - call setExposedvegpFilter(bounds_clump, & - canopystate_inst%frac_veg_nosno_patch(bounds_clump%begp:bounds_clump%endp)) - - ! Irrigation flux - ! input is main channel storage - call irrigation_inst%ApplyIrrigation(bounds_clump) - call t_stopf('drvinit') - - ! ============================================================================ - ! Canopy Hydrology - ! (1) water storage of intercepted precipitation - ! (2) direct throughfall and canopy drainage of precipitation - ! (3) fraction of foliage covered by water and the fraction is dry and transpiring - ! (4) snow layer initialization if the snow accumulation exceeds 10 mm. - ! ============================================================================ - - call t_startf('canhydro') - call CanopyHydrology(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - atm2lnd_inst, canopystate_inst, temperature_inst, & - aerosol_inst, waterstate_inst, waterflux_inst, & - irrigation_inst) - call t_stopf('canhydro') - - ! ============================================================================ - ! Surface Radiation - ! ============================================================================ - - call t_startf('surfrad') - - ! Surface Radiation primarily for non-urban columns - - ! Most of the surface radiation calculations are agnostic to the forest-model - ! but the calculations of the fractions of sunlit and shaded canopies - ! are specific, calculate them first. - ! The nourbanp filter is set in dySubgrid_driver (earlier in this call) - ! over the patch index range defined by bounds_clump%begp:bounds_proc%endp - - if(use_fates) then - call clm_fates%wrap_sunfrac(nc,atm2lnd_inst, canopystate_inst) - else - call CanopySunShadeFracs(filter(nc)%nourbanp,filter(nc)%num_nourbanp, & - atm2lnd_inst, surfalb_inst, canopystate_inst, & - solarabs_inst) - end if - - - - call SurfaceRadiation(bounds_clump, & - filter(nc)%num_nourbanp, filter(nc)%nourbanp, & - filter(nc)%num_urbanp, filter(nc)%urbanp, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - atm2lnd_inst, waterstate_inst, canopystate_inst, surfalb_inst, & - solarabs_inst, surfrad_inst) - - ! Surface Radiation for only urban columns - - call UrbanRadiation(bounds_clump, & - filter(nc)%num_nourbanl, filter(nc)%nourbanl, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp, & - atm2lnd_inst, waterstate_inst, temperature_inst, urbanparams_inst, & - solarabs_inst, surfalb_inst, energyflux_inst) - - call t_stopf('surfrad') - - ! ============================================================================ - ! Determine leaf temperature and surface fluxes based on ground - ! temperature from previous time step. - ! ============================================================================ - - call t_startf('bgp1') - call CanopyTemperature(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - clm_fates, & - atm2lnd_inst, canopystate_inst, soilstate_inst, frictionvel_inst, & - waterstate_inst, waterflux_inst, energyflux_inst, temperature_inst) - call t_stopf('bgp1') - - ! ============================================================================ - ! Determine fluxes - ! ============================================================================ - - call t_startf('bgflux') - - ! Bareground fluxes for all patches except lakes and urban landunits - - call BareGroundFluxes(bounds_clump, & - filter(nc)%num_noexposedvegp, filter(nc)%noexposedvegp, & - atm2lnd_inst, soilstate_inst, & - frictionvel_inst, ch4_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, photosyns_inst, humanindex_inst) - call t_stopf('bgflux') - - ! non-bareground fluxes for all patches except lakes and urban landunits - ! Calculate canopy temperature, latent and sensible fluxes from the canopy, - ! and leaf water change by evapotranspiration - - call t_startf('canflux') - - ! COMPILER_BUG(wjs, 2016-02-24, pgi 15.10) In principle, we should be able to make - ! these function calls inline in the CanopyFluxes argument list. However, with pgi - ! 15.10, that results in the dummy arguments having the wrong size (I suspect size - ! 0, based on similar pgi compiler bugs that we have run into before). Also note - ! that I don't have explicit bounds on the left-hand-side of these assignments: - ! excluding these explicit bounds seemed to be needed to get around other compiler - ! bugs. - allocate(downreg_patch(bounds_clump%begp:bounds_clump%endp)) - allocate(leafn_patch(bounds_clump%begp:bounds_clump%endp)) - downreg_patch = bgc_vegetation_inst%get_downreg_patch(bounds_clump) - leafn_patch = bgc_vegetation_inst%get_leafn_patch(bounds_clump) - - allocate(froot_carbon(bounds_clump%begp:bounds_clump%endp)) - allocate(croot_carbon(bounds_clump%begp:bounds_clump%endp)) - froot_carbon = bgc_vegetation_inst%get_froot_carbon_patch( & - bounds_clump, canopystate_inst%tlai_patch(bounds_clump%begp:bounds_clump%endp)) - croot_carbon = bgc_vegetation_inst%get_croot_carbon_patch( & - bounds_clump, canopystate_inst%tlai_patch(bounds_clump%begp:bounds_clump%endp)) - - call CanopyFluxes(bounds_clump, & - filter(nc)%num_exposedvegp, filter(nc)%exposedvegp, & - clm_fates,nc, & - atm2lnd_inst, canopystate_inst, & - energyflux_inst, frictionvel_inst, soilstate_inst, solarabs_inst, surfalb_inst, & - temperature_inst, waterflux_inst, waterstate_inst, ch4_inst, ozone_inst, photosyns_inst, & - humanindex_inst, soil_water_retention_curve, & - downreg_patch = downreg_patch(bounds_clump%begp:bounds_clump%endp), & - leafn_patch = leafn_patch(bounds_clump%begp:bounds_clump%endp), & - froot_carbon = froot_carbon(bounds_clump%begp:bounds_clump%endp), & - croot_carbon = croot_carbon(bounds_clump%begp:bounds_clump%endp)) - deallocate(downreg_patch, leafn_patch, froot_carbon, croot_carbon) - call t_stopf('canflux') - - ! Fluxes for all urban landunits - - call t_startf('uflux') - call UrbanFluxes(bounds_clump, & - filter(nc)%num_nourbanl, filter(nc)%nourbanl, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp, & - atm2lnd_inst, urbanparams_inst, soilstate_inst, temperature_inst, & - waterstate_inst, frictionvel_inst, energyflux_inst, waterflux_inst, & - humanindex_inst) - call t_stopf('uflux') - - ! Fluxes for all lake landunits - - call t_startf('bgplake') - call LakeFluxes(bounds_clump, & - filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_lakep, filter(nc)%lakep, & - atm2lnd_inst, solarabs_inst, frictionvel_inst, temperature_inst, & - energyflux_inst, waterstate_inst, waterflux_inst, lakestate_inst,& - humanindex_inst) - call t_stopf('bgplake') - - ! ============================================================================ - ! Determine irrigation needed for future time steps - ! ============================================================================ - - ! NOTE(wjs, 2016-09-08) The placement of this call in the driver is historical: it - ! used to be that it had to come after btran was computed. Now it no longer depends - ! on btran, so it could be moved earlier in the driver loop - possibly even - ! immediately before ApplyIrrigation, which would be a more clear place to put it. - - call t_startf('irrigationneeded') - call irrigation_inst%CalcIrrigationNeeded( & - bounds = bounds_clump, & - num_exposedvegp = filter(nc)%num_exposedvegp, & - filter_exposedvegp = filter(nc)%exposedvegp, & - time_prev = sec_prev, & - elai = canopystate_inst%elai_patch(bounds_clump%begp:bounds_clump%endp), & - t_soisno = temperature_inst%t_soisno_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), & - eff_porosity = soilstate_inst%eff_porosity_col(bounds_clump%begc:bounds_clump%endc, 1:nlevgrnd), & - h2osoi_liq = waterstate_inst%h2osoi_liq_col(bounds_clump%begc:bounds_clump%endc , 1:nlevgrnd), & - volr = atm2lnd_inst%volrmch_grc(bounds_clump%begg:bounds_clump%endg), & - rof_prognostic = rof_prognostic) - call t_stopf('irrigationneeded') - - ! ============================================================================ - ! DUST and VOC emissions - ! ============================================================================ - - call t_startf('bgc') - - ! Dust mobilization (C. Zender's modified codes) - call DustEmission(bounds_clump, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - atm2lnd_inst, soilstate_inst, canopystate_inst, waterstate_inst, & - frictionvel_inst, dust_inst) - - ! Dust dry deposition (C. Zender's modified codes) - call DustDryDep(bounds_clump, & - atm2lnd_inst, frictionvel_inst, dust_inst) - - ! VOC emission (A. Guenther's MEGAN (2006) model) - call VOCEmission(bounds_clump, & - filter(nc)%num_soilp, filter(nc)%soilp, & - atm2lnd_inst, canopystate_inst, photosyns_inst, temperature_inst, & - vocemis_inst) - - call t_stopf('bgc') - - ! ============================================================================ - ! Determine temperatures - ! ============================================================================ - - ! Set lake temperature - - call t_startf('lakeTemp') - call LakeTemperature(bounds_clump, & - filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_lakep, filter(nc)%lakep, & - solarabs_inst, soilstate_inst, waterstate_inst, waterflux_inst, ch4_inst, & - energyflux_inst, temperature_inst, lakestate_inst) - call t_stopf('lakeTemp') - - ! Set soil/snow temperatures including ground temperature - - call t_startf('soiltemperature') - call SoilTemperature(bounds_clump, & - filter(nc)%num_urbanl , filter(nc)%urbanl, & - filter(nc)%num_nolakec , filter(nc)%nolakec, & - atm2lnd_inst, urbanparams_inst, canopystate_inst, waterstate_inst, waterflux_inst, & - solarabs_inst, soilstate_inst, energyflux_inst, temperature_inst, urbantv_inst) - - ! The following is called immediately after SoilTemperature so that melted ice is - ! converted back to solid ice as soon as possible - call glacier_smb_inst%HandleIceMelt(bounds_clump, & - filter(nc)%num_do_smb_c, filter(nc)%do_smb_c, & - waterstate_inst) - call t_stopf('soiltemperature') - - ! ============================================================================ - ! update surface fluxes for new ground temperature. - ! ============================================================================ - - call t_startf('bgp2') - call SoilFluxes(bounds_clump, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanp, filter(nc)%urbanp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - atm2lnd_inst, solarabs_inst, temperature_inst, canopystate_inst, waterstate_inst, & - energyflux_inst, waterflux_inst) - call t_stopf('bgp2') - - ! ============================================================================ - ! Perform averaging from patch level to column level - ! ============================================================================ - - call t_startf('patch2col') - call clm_drv_patch2col(bounds_clump, & - filter(nc)%num_allc, filter(nc)%allc, filter(nc)%num_nolakec, filter(nc)%nolakec, & - energyflux_inst, waterflux_inst) - call t_stopf('patch2col') - - ! ============================================================================ - ! Vertical (column) soil and surface hydrology - ! ============================================================================ - - ! Note that filter_snowc and filter_nosnowc are returned by - ! LakeHydrology after the new snow filter is built - - call t_startf('hydro_without_drainage') - - call HydrologyNoDrainage(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_hydrologyc, filter(nc)%hydrologyc, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_snowc, filter(nc)%snowc, & - filter(nc)%num_nosnowc, filter(nc)%nosnowc, & - clm_fates, & - atm2lnd_inst, soilstate_inst, energyflux_inst, temperature_inst, & - waterflux_inst, waterstate_inst, soilhydrology_inst, aerosol_inst, & - canopystate_inst, soil_water_retention_curve, topo_inst) - - ! The following needs to be done after HydrologyNoDrainage (because it needs - ! waterflux_inst%qflx_snwcp_ice_col), but before HydrologyDrainage (because - ! HydrologyDrainage calls glacier_smb_inst%AdjustRunoffTerms, which depends on - ! ComputeSurfaceMassBalance having already been called). - call glacier_smb_inst%ComputeSurfaceMassBalance(bounds_clump, & - filter(nc)%num_allc, filter(nc)%allc, & - filter(nc)%num_do_smb_c, filter(nc)%do_smb_c, & - glc2lnd_inst, waterstate_inst, waterflux_inst) - - ! Calculate column-integrated aerosol masses, and - ! mass concentrations for radiative calculations and output - ! (based on new snow level state, after SnowFilter is rebuilt. - ! NEEDS TO BE AFTER SnowFiler is rebuilt, otherwise there - ! can be zero snow layers but an active column in filter) - - call AerosolMasses( bounds_clump, & - num_on=filter(nc)%num_snowc, filter_on=filter(nc)%snowc, & - num_off=filter(nc)%num_nosnowc, filter_off=filter(nc)%nosnowc, & - waterflux_inst=waterflux_inst, & - waterstate_inst=waterstate_inst, & - aerosol_inst=aerosol_inst) - - call t_stopf('hydro_without_drainage') - - ! ============================================================================ - ! Lake hydrology - ! ============================================================================ - - ! Note that filter_lakesnowc and filter_lakenosnowc are returned by - ! LakeHydrology after the new snow filter is built - - call t_startf('hylake') - call LakeHydrology(bounds_clump, & - filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_lakep, filter(nc)%lakep, & - filter(nc)%num_lakesnowc, filter(nc)%lakesnowc, & - filter(nc)%num_lakenosnowc, filter(nc)%lakenosnowc, & - atm2lnd_inst, temperature_inst, soilstate_inst, waterstate_inst, waterflux_inst, & - energyflux_inst, aerosol_inst, lakestate_inst, topo_inst) - - ! Calculate column-integrated aerosol masses, and - ! mass concentrations for radiative calculations and output - ! (based on new snow level state, after SnowFilter is rebuilt. - ! NEEDS TO BE AFTER SnowFiler is rebuilt, otherwise there - ! can be zero snow layers but an active column in filter) - - call AerosolMasses(bounds_clump, & - num_on=filter(nc)%num_lakesnowc, filter_on=filter(nc)%lakesnowc, & - num_off=filter(nc)%num_lakenosnowc, filter_off=filter(nc)%lakenosnowc, & - waterflux_inst=waterflux_inst, & - waterstate_inst=waterstate_inst, & - aerosol_inst=aerosol_inst) - - ! Must be done here because must use a snow filter for lake columns - - call SnowAge_grain(bounds_clump, & - filter(nc)%num_lakesnowc, filter(nc)%lakesnowc, & - filter(nc)%num_lakenosnowc, filter(nc)%lakenosnowc, & - waterflux_inst, waterstate_inst, temperature_inst, & - atm2lnd_inst) - - call t_stopf('hylake') - - ! ============================================================================ - ! ! Fraction of soil covered by snow (Z.-L. Yang U. Texas) - ! ============================================================================ - call t_startf('snow_init') - - do c = bounds_clump%begc,bounds_clump%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - ! Urban landunit use Bonan 1996 (LSM Technical Note) - waterstate_inst%frac_sno_col(c) = min( waterstate_inst%snow_depth_col(c)/0.05_r8, 1._r8) - end if - end do - - ! ============================================================================ - ! Snow aging routine based on Flanner and Zender (2006), Linking snowpack - ! microphysics and albedo evolution, JGR, and Brun (1989), Investigation of - ! wet-snow metamorphism in respect of liquid-water content, Ann. Glaciol. - ! ============================================================================ - ! Note the snow filters here do not include lakes - ! TODO: move this up - - call SnowAge_grain(bounds_clump, & - filter(nc)%num_snowc, filter(nc)%snowc, & - filter(nc)%num_nosnowc, filter(nc)%nosnowc, & - waterflux_inst, waterstate_inst, temperature_inst, & - atm2lnd_inst) - call t_stopf('snow_init') - - ! ============================================================================ - ! Ecosystem dynamics: Uses CN, CNDV, or static parameterizations - ! ============================================================================ - - ! FIX(SPM,032414) push these checks into the routines below and/or make this consistent. - - ! fully prognostic canopy structure and C-N biogeochemistry - ! - CNDV defined: prognostic biogeography; else prescribed - ! - crop model: crop algorithms called from within CNDriver - - if (use_cn) then - call t_startf('ecosysdyn') - call bgc_vegetation_inst%EcosystemDynamicsPreDrainage(bounds_clump, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - filter(nc)%num_pcropp, filter(nc)%pcropp, doalb, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst, & - photosyns_inst, soilhydrology_inst, energyflux_inst, & - nutrient_competition_method, fireemis_inst) - - call t_stopf('ecosysdyn') - - end if - - ! Prescribed biogeography - prescribed canopy structure, some prognostic carbon fluxes - - if ((.not. use_cn) .and. (.not. use_fates) .and. (doalb)) then - call t_startf('SatellitePhenology') - call SatellitePhenology(bounds_clump, filter(nc)%num_nolakep, filter(nc)%nolakep, & - waterstate_inst, canopystate_inst) - call t_stopf('SatellitePhenology') - end if - - ! Dry Deposition of chemical tracers (Wesely (1998) parameterizaion) - - call t_startf('depvel') - call depvel_compute(bounds_clump, & - atm2lnd_inst, canopystate_inst, waterstate_inst, frictionvel_inst, & - photosyns_inst, drydepvel_inst) - call t_stopf('depvel') - - ! ============================================================================ - ! Calculate soil/snow hydrology with drainage (subsurface runoff) - ! ============================================================================ - - call t_startf('hydro2_drainage') - - call HydrologyDrainage(bounds_clump, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_hydrologyc, filter(nc)%hydrologyc, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_do_smb_c, filter(nc)%do_smb_c, & - atm2lnd_inst, glc2lnd_inst, temperature_inst, & - soilhydrology_inst, soilstate_inst, waterstate_inst, waterflux_inst, & - irrigation_inst, glacier_smb_inst) - - call t_stopf('hydro2_drainage') - - if (use_cn) then - - call t_startf('EcosysDynPostDrainage') - call bgc_vegetation_inst%EcosystemDynamicsPostDrainage(bounds_clump, & - filter(nc)%num_allc, filter(nc)%allc, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - doalb, crop_inst, & - waterstate_inst, waterflux_inst, frictionvel_inst, canopystate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - call t_stopf('EcosysDynPostDrainage') - - end if - - if ( use_fates .and. is_beg_curr_day() ) then ! run fates at the start of each day - - if ( masterproc ) then - write(iulog,*) 'clm: calling FATES model ', get_nstep() - end if - - call clm_fates%dynamics_driv( nc, bounds_clump, & - atm2lnd_inst, soilstate_inst, temperature_inst, & - waterstate_inst, canopystate_inst, soilbiogeochem_carbonflux_inst,& - frictionvel_inst) - - ! TODO(wjs, 2016-04-01) I think this setFilters call should be replaced by a - ! call to reweight_wrapup, if it's needed at all. - call setFilters( bounds_clump, glc_behavior ) - - end if ! use_fates branch - - - if ( use_fates ) then - - call EDBGCDyn(bounds_clump, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - filter(nc)%num_pcropp, filter(nc)%pcropp, doalb, & - bgc_vegetation_inst%cnveg_carbonflux_inst, & - bgc_vegetation_inst%cnveg_carbonstate_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - soilbiogeochem_state_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst, & - atm2lnd_inst, waterstate_inst, waterflux_inst, & - canopystate_inst, soilstate_inst, temperature_inst, crop_inst, ch4_inst) - - call EDBGCDynSummary(bounds_clump, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_carbonstate_inst, & - c13_soilbiogeochem_carbonflux_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonflux_inst, c14_soilbiogeochem_carbonstate_inst, & - soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst, & - clm_fates, nc) - end if - - - - ! ============================================================================ - ! Check the energy and water balance and also carbon and nitrogen balance - ! ============================================================================ - - call t_startf('balchk') - call BalanceCheck(bounds_clump, & - atm2lnd_inst, solarabs_inst, waterflux_inst, & - waterstate_inst, irrigation_inst, glacier_smb_inst, & - energyflux_inst, canopystate_inst) - call t_stopf('balchk') - - ! ============================================================================ - ! Check the carbon and nitrogen balance - ! ============================================================================ - - if (use_cn) then - call t_startf('cnbalchk') - call bgc_vegetation_inst%BalanceCheck( & - bounds_clump, filter(nc)%num_soilc, filter(nc)%soilc, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenflux_inst) - call t_stopf('cnbalchk') - end if - - ! Calculation of methane fluxes - - if (use_lch4) then - call t_startf('ch4') - ! COMPILER_BUG(wjs, 2016-02-24, pgi 15.10) In principle, we should be able to - ! make these function calls inline in the CanopyFluxes argument list. However, - ! with pgi 15.10, that results in the dummy arguments having the wrong size (I - ! suspect size 0, based on similar pgi compiler bugs that we have run into - ! before). Also note that I don't have explicit bounds on the left-hand-side of - ! these assignments: excluding these explicit bounds seemed to be needed to get - ! around other compiler bugs. - allocate(agnpp_patch(bounds_clump%begp:bounds_clump%endp)) - allocate(bgnpp_patch(bounds_clump%begp:bounds_clump%endp)) - allocate(annsum_npp_patch(bounds_clump%begp:bounds_clump%endp)) - allocate(rr_patch(bounds_clump%begp:bounds_clump%endp)) - agnpp_patch = bgc_vegetation_inst%get_agnpp_patch(bounds_clump) - bgnpp_patch = bgc_vegetation_inst%get_bgnpp_patch(bounds_clump) - annsum_npp_patch = bgc_vegetation_inst%get_annsum_npp_patch(bounds_clump) - rr_patch = bgc_vegetation_inst%get_root_respiration_patch(bounds_clump) - - call ch4 (bounds_clump, & - filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_soilp, filter(nc)%soilp, & - atm2lnd_inst, lakestate_inst, canopystate_inst, soilstate_inst, soilhydrology_inst, & - temperature_inst, energyflux_inst, waterstate_inst, waterflux_inst, & - soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenflux_inst, ch4_inst, lnd2atm_inst, & - agnpp = agnpp_patch(bounds_clump%begp:bounds_clump%endp), & - bgnpp = bgnpp_patch(bounds_clump%begp:bounds_clump%endp), & - annsum_npp = annsum_npp_patch(bounds_clump%begp:bounds_clump%endp), & - rr = rr_patch(bounds_clump%begp:bounds_clump%endp)) - deallocate(agnpp_patch, bgnpp_patch, annsum_npp_patch, rr_patch) - call t_stopf('ch4') - end if - - ! ============================================================================ - ! Determine albedos for next time step - ! ============================================================================ - - if (doalb) then - - ! Albedos for non-urban columns - call t_startf('surfalb') - call SurfaceAlbedo(bounds_clump, & - nc, & - filter_inactive_and_active(nc)%num_nourbanc, & - filter_inactive_and_active(nc)%nourbanc, & - filter_inactive_and_active(nc)%num_nourbanp, & - filter_inactive_and_active(nc)%nourbanp, & - filter_inactive_and_active(nc)%num_urbanc, & - filter_inactive_and_active(nc)%urbanc, & - filter_inactive_and_active(nc)%num_urbanp, & - filter_inactive_and_active(nc)%urbanp, & - nextsw_cday, declinp1, & - clm_fates, & - aerosol_inst, canopystate_inst, waterstate_inst, & - lakestate_inst, temperature_inst, surfalb_inst) - - call t_stopf('surfalb') - - ! Albedos for urban columns - if (filter_inactive_and_active(nc)%num_urbanl > 0) then - call t_startf('urbalb') - call UrbanAlbedo(bounds_clump, & - filter_inactive_and_active(nc)%num_urbanl, & - filter_inactive_and_active(nc)%urbanl, & - filter_inactive_and_active(nc)%num_urbanc, & - filter_inactive_and_active(nc)%urbanc, & - filter_inactive_and_active(nc)%num_urbanp, & - filter_inactive_and_active(nc)%urbanp, & - waterstate_inst, urbanparams_inst, & - solarabs_inst, surfalb_inst) - call t_stopf('urbalb') - end if - - end if - - end do - !$OMP END PARALLEL DO - - ! ============================================================================ - ! Determine gridcell averaged properties to send to atm - ! ============================================================================ - - call t_startf('lnd2atm') - ! COMPILER_BUG(wjs, 2016-02-24, pgi 15.10) In principle, we should be able to make - ! this function call inline in the CanopyFluxes argument list. However, with pgi - ! 15.10, that results in the dummy argument having the wrong size (I suspect size 0, - ! based on similar pgi compiler bugs that we have run into before). Also note that I - ! don't have explicit bounds on the left-hand-side of this assignment: excluding these - ! explicit bounds seemed to be needed to get around other compiler bugs. - allocate(net_carbon_exchange_grc(bounds_proc%begg:bounds_proc%endg)) - net_carbon_exchange_grc = bgc_vegetation_inst%get_net_carbon_exchange_grc(bounds_proc) - - call lnd2atm(bounds_proc, & - atm2lnd_inst, surfalb_inst, temperature_inst, frictionvel_inst, & - waterstate_inst, waterflux_inst, irrigation_inst, energyflux_inst, & - solarabs_inst, drydepvel_inst, & - vocemis_inst, fireemis_inst, dust_inst, ch4_inst, glc_behavior, & - lnd2atm_inst, & - net_carbon_exchange_grc = net_carbon_exchange_grc(bounds_proc%begg:bounds_proc%endg)) - deallocate(net_carbon_exchange_grc) - call t_stopf('lnd2atm') - - ! ============================================================================ - ! Determine gridcell averaged properties to send to glc - ! ============================================================================ - - call t_startf('lnd2glc') - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - call lnd2glc_inst%update_lnd2glc(bounds_clump, & - filter(nc)%num_do_smb_c, filter(nc)%do_smb_c, & - temperature_inst, glacier_smb_inst, topo_inst, & - init=.false.) - end do - !$OMP END PARALLEL DO - call t_stopf('lnd2glc') - - ! ============================================================================ - ! Write global average diagnostics to standard output - ! ============================================================================ - - nstep = get_nstep() - if (wrtdia) call mpi_barrier(mpicom,ier) - call t_startf('wrtdiag') - call write_diagnostic(bounds_proc, wrtdia, nstep, lnd2atm_inst) - call t_stopf('wrtdiag') - - ! ============================================================================ - ! Update accumulators - ! ============================================================================ - - ! FIX(SPM,032414) double check why this isn't called for ED - ! FIX(SPM, 082814) - in the fates branch RF and I commented out the if(.not. - ! use_fates) then statement ... double check if this is required and why - - if (nstep > 0) then - call t_startf('accum') - - call atm2lnd_inst%UpdateAccVars(bounds_proc) - - call temperature_inst%UpdateAccVars(bounds_proc) - - call canopystate_inst%UpdateAccVars(bounds_proc) - - call waterflux_inst%UpdateAccVars(bounds_proc) - - call energyflux_inst%UpdateAccVars(bounds_proc) - - ! COMPILER_BUG(wjs, 2014-11-30, pgi 14.7) For pgi 14.7 to be happy when - ! compiling this threaded, I needed to change the dummy arguments to be - ! pointers, and get rid of the explicit bounds in the subroutine call. - ! call bgc_vegetation_inst%UpdateAccVars(bounds_proc, & - ! t_a10_patch=temperature_inst%t_a10_patch(bounds_proc%begp:bounds_proc%endp), & - ! t_ref2m_patch=temperature_inst%t_ref2m_patch(bounds_proc%begp:bounds_proc%endp)) - call bgc_vegetation_inst%UpdateAccVars(bounds_proc, & - t_a10_patch=temperature_inst%t_a10_patch, & - t_ref2m_patch=temperature_inst%t_ref2m_patch) - - if (use_crop) then - call crop_inst%CropUpdateAccVars(bounds_proc, & - temperature_inst%t_ref2m_patch, temperature_inst%t_soisno_col) - end if - - call t_stopf('accum') - end if - - ! ============================================================================ - ! Update history buffer - ! ============================================================================ - - - call t_startf('hbuf') - call hist_update_hbuf(bounds_proc) - call t_stopf('hbuf') - - ! ============================================================================ - ! Call dv (dynamic vegetation) - ! ============================================================================ - - if (use_cn) then - call t_startf('endTSdynveg') - nclumps = get_proc_clumps() - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - call bgc_vegetation_inst%EndOfTimeStepVegDynamics(bounds_clump, & - filter(nc)%num_natvegp, filter(nc)%natvegp, & - atm2lnd_inst) - end do - !$OMP END PARALLEL DO - call t_stopf('endTSdynveg') - end if - - ! ============================================================================ - ! History/Restart output - ! ============================================================================ - - if (.not. use_noio) then - - call t_startf('clm_drv_io') - - ! Create history and write history tapes if appropriate - call t_startf('clm_drv_io_htapes') - - call hist_htapes_wrapup( rstwr, nlend, bounds_proc, & - soilstate_inst%watsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%sucsat_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%bsw_col(bounds_proc%begc:bounds_proc%endc, 1:), & - soilstate_inst%hksat_col(bounds_proc%begc:bounds_proc%endc, 1:)) - - call t_stopf('clm_drv_io_htapes') - - if (use_cn) then - call bgc_vegetation_inst%WriteHistory(bounds_proc) - end if - - ! Write restart/initial files if appropriate - if (rstwr) then - call t_startf('clm_drv_io_wrest') - filer = restFile_filename(rdate=rdate) - - call restFile_write( bounds_proc, filer, rdate=rdate ) - - call t_stopf('clm_drv_io_wrest') - end if - call t_stopf('clm_drv_io') - - end if - - end subroutine clm_drv - - !----------------------------------------------------------------------- - subroutine clm_drv_init(bounds, & - num_nolakec, filter_nolakec, & - num_nolakep, filter_nolakep, & - num_soilp , filter_soilp, & - canopystate_inst, waterstate_inst, waterflux_inst, energyflux_inst) - ! - ! !DESCRIPTION: - ! Initialization of clm driver variables needed from previous timestep - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : nlevsno - use CanopyStateType , only : canopystate_type - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use EnergyFluxType , only : energyflux_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_nolakec ! number of non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - integer , intent(in) :: num_nolakep ! number of non-lake points in patch filter - integer , intent(in) :: filter_nolakep(:) ! patch filter for non-lake points - integer , intent(in) :: num_soilp ! number of soil points in patch filter - integer , intent(in) :: filter_soilp(:) ! patch filter for soil points - type(canopystate_type), intent(inout) :: canopystate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c, p, f, j ! indices - integer :: fp, fc ! filter indices - !----------------------------------------------------------------------- - - associate( & - snl => col%snl , & ! Input: [integer (:) ] number of snow layers - - h2osno => waterstate_inst%h2osno_col , & ! Input: [real(r8) (:) ] snow water (mm H2O) - h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) - h2osno_old => waterstate_inst%h2osno_old_col , & ! Output: [real(r8) (:) ] snow water (mm H2O) at previous time step - frac_iceold => waterstate_inst%frac_iceold_col , & ! Output: [real(r8) (:,:) ] fraction of ice relative to the tot water - - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - esai => canopystate_inst%esai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index with burying by snow - frac_veg_nosno => canopystate_inst%frac_veg_nosno_patch , & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch , & ! Output: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-] - - eflx_bot => energyflux_inst%eflx_bot_col , & ! Output: [real(r8) (:) ] heat flux from beneath soil/ice column (W/m**2) - - cisun_z => photosyns_inst%cisun_z_patch , & ! Output: [real(r8) (:) ] intracellular sunlit leaf CO2 (Pa) - cisha_z => photosyns_inst%cisha_z_patch & ! Output: [real(r8) (:) ] intracellular shaded leaf CO2 (Pa) - ) - - ! Initialize intracellular CO2 (Pa) parameters each timestep for use in VOCEmission - do p = bounds%begp,bounds%endp - cisun_z(p,:) = -999._r8 - cisha_z(p,:) = -999._r8 - end do - - do c = bounds%begc,bounds%endc - ! Save snow mass at previous time step - h2osno_old(c) = h2osno(c) - - ! Reset flux from beneath soil/ice column - eflx_bot(c) = 0._r8 - end do - - ! Initialize fraction of vegetation not covered by snow - - do p = bounds%begp,bounds%endp - if (patch%active(p)) then - frac_veg_nosno(p) = frac_veg_nosno_alb(p) - else - frac_veg_nosno(p) = 0._r8 - end if - end do - - ! Initialize set of previous time-step variables - ! Ice fraction of snow at previous time step - - do j = -nlevsno+1,0 - do f = 1, num_nolakec - c = filter_nolakec(f) - if (j >= snl(c) + 1) then - frac_iceold(c,j) = h2osoi_ice(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j)) - end if - end do - end do - - end associate - - end subroutine clm_drv_init - - !----------------------------------------------------------------------- - subroutine clm_drv_patch2col (bounds, & - num_allc, filter_allc, num_nolakec, filter_nolakec, & - energyflux_inst, waterflux_inst) - ! - ! !DESCRIPTION: - ! Averages over all patches for variables defined over both soil and lake to provide - ! the column-level averages of flux variables defined at the patch level. - ! - ! !USES: - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use EnergyFluxType , only : energyflux_type - use subgridAveMod , only : p2c - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of column points in allc filter - integer , intent(in) :: filter_allc(:) ! column filter for all active points - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points - type(waterflux_type) , intent(inout) :: waterflux_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c,fc ! indices - ! ----------------------------------------------------------------- - - ! Note: lake points are excluded from many of the following - ! averages. For some fields, this is because the field doesn't - ! apply over lakes. However, for many others, this is because the - ! field is computed in LakeHydrologyMod, which is called after - ! this routine; thus, for lakes, the column-level values of these - ! fields are explicitly set in LakeHydrologyMod. (The fields that - ! are included here for lakes are computed elsewhere, e.g., in - ! LakeFluxesMod.) - - ! Averaging for patch evaporative flux variables - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_ev_snow_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_ev_snow_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_ev_soil_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_ev_soil_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_ev_h2osfc_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_ev_h2osfc_col(bounds%begc:bounds%endc)) - - ! Averaging for patch water flux variables - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_evap_soi_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_evap_soi_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_evap_tot_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_evap_tot_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_rain_grnd_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_rain_grnd_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_snow_grnd_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_snow_grnd_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_tran_veg_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_tran_veg_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_evap_grnd_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_evap_grnd_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_allc, filter_allc, & - waterflux_inst%qflx_evap_soi_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_evap_soi_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_prec_grnd_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_prec_grnd_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_dew_grnd_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_dew_grnd_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_sub_snow_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_sub_snow_col(bounds%begc:bounds%endc)) - - call p2c (bounds, num_nolakec, filter_nolakec, & - waterflux_inst%qflx_dew_snow_patch(bounds%begp:bounds%endp), & - waterflux_inst%qflx_dew_snow_col(bounds%begc:bounds%endc)) - - end subroutine clm_drv_patch2col - - !------------------------------------------------------------------------ - subroutine write_diagnostic (bounds, wrtdia, nstep, lnd2atm_inst) - ! - ! !DESCRIPTION: - ! Write diagnostic surface temperature output each timestep. Written to - ! be fast but not bit-for-bit because order of summations can change each - ! timestep. - ! - ! !USES: - use decompMod , only : get_proc_global - use spmdMod , only : masterproc, npes, MPI_REAL8 - use spmdMod , only : MPI_STATUS_SIZE, mpicom, MPI_SUM - use shr_sys_mod, only : shr_sys_flush - use abortutils , only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - use lnd2atmType, only : lnd2atm_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - logical , intent(in) :: wrtdia !true => write diagnostic - integer , intent(in) :: nstep !model time step - type(lnd2atm_type) , intent(in) :: lnd2atm_inst - ! - ! !REVISION HISTORY: - ! Created by Mariana Vertenstein - ! - ! !LOCAL VARIABLES: - integer :: p ! loop index - integer :: numg ! total number of gridcells across all processors - integer :: ier ! error status - real(r8):: psum ! partial sum of ts - real(r8):: tsum ! sum of ts - real(r8):: tsxyav ! average ts for diagnostic output - integer :: status(MPI_STATUS_SIZE) ! mpi status - !------------------------------------------------------------------------ - - call get_proc_global(ng=numg) - - if (wrtdia) then - - call t_barrierf('sync_write_diag', mpicom) - psum = sum(lnd2atm_inst%t_rad_grc(bounds%begg:bounds%endg)) - call mpi_reduce(psum, tsum, 1, MPI_REAL8, MPI_SUM, 0, mpicom, ier) - if (ier/=0) then - write(iulog,*) 'write_diagnostic: Error in mpi_reduce()' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (masterproc) then - tsxyav = tsum / numg - write(iulog,1000) nstep, tsxyav - call shr_sys_flush(iulog) - end if - - else - - if (masterproc) then - write(iulog,*)'clm: completed timestep ',nstep - call shr_sys_flush(iulog) - end if - - endif - -1000 format (1x,'nstep = ',i10,' TS = ',f21.15) - - end subroutine write_diagnostic - -end module clm_driver diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 deleted file mode 100644 index 42f71ec526..0000000000 --- a/src/main/clm_initializeMod.F90 +++ /dev/null @@ -1,691 +0,0 @@ -module clm_initializeMod - - !----------------------------------------------------------------------- - ! Performs land model initialization - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use decompMod , only : bounds_type, get_proc_bounds, get_proc_clumps, get_clump_bounds - use abortutils , only : endrun - use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch - use clm_varctl , only : is_cold_start, is_interpolated_start - use clm_varctl , only : iulog - use clm_varctl , only : use_lch4, use_cn, use_cndv, use_c13, use_c14, use_fates - use clm_instur , only : wt_lunit, urban_valid, wt_nat_patch, wt_cft, fert_cft, wt_glc_mec, topo_glc_mec - use perf_mod , only : t_startf, t_stopf - use readParamsMod , only : readParameters - use ncdio_pio , only : file_desc_t - use GridcellType , only : grc ! instance - use LandunitType , only : lun ! instance - use ColumnType , only : col ! instance - use PatchType , only : patch ! instance - use reweightMod , only : reweight_wrapup - use filterMod , only : allocFilters, filter - use FatesInterfaceMod, only : set_fates_global_elements - - use clm_instMod - ! - implicit none - public ! By default everything is public - ! - public :: initialize1 ! Phase one initialization - public :: initialize2 ! Phase two initialization - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine initialize1( ) - ! - ! !DESCRIPTION: - ! CLM initialization first phase - ! - ! !USES: - use clm_varpar , only: clm_varpar_init, natpft_lb, natpft_ub, cft_lb, cft_ub, maxpatch_glcmec - use clm_varcon , only: clm_varcon_init - use landunit_varcon , only: landunit_varcon_init, max_lunit - use clm_varctl , only: fsurdat, fatmlndfrc, noland, version - use pftconMod , only: pftcon - use decompInitMod , only: decompInit_lnd, decompInit_clumps, decompInit_glcp - use domainMod , only: domain_check, ldomain, domain_init - use surfrdMod , only: surfrd_get_globmask, surfrd_get_grid, surfrd_get_data - use controlMod , only: control_init, control_print, NLFilename - use ncdio_pio , only: ncd_pio_init - use initGridCellsMod , only: initGridCells - use ch4varcon , only: ch4conrd - use UrbanParamsType , only: UrbanInput, IsSimpleBuildTemp - use dynSubgridControlMod, only: dynSubgridControl_init - ! - ! !LOCAL VARIABLES: - integer :: ier ! error status - integer :: i,j,n,k,c,l,g ! indices - integer :: nl ! gdc and glo lnd indices - integer :: ns, ni, nj ! global grid sizes - integer :: begg, endg ! processor bounds - type(bounds_type) :: bounds_proc - type(bounds_type) :: bounds_clump - integer :: nclumps ! number of clumps on this processor - integer :: nc ! clump index - integer ,pointer :: amask(:) ! global land mask - character(len=32) :: subname = 'initialize1' ! subroutine name - !----------------------------------------------------------------------- - - call t_startf('clm_init1') - - ! ------------------------------------------------------------------------ - ! Initialize run control variables, timestep - ! ------------------------------------------------------------------------ - - if ( masterproc )then - write(iulog,*) trim(version) - write(iulog,*) - write(iulog,*) 'Attempting to initialize the land model .....' - write(iulog,*) - call shr_sys_flush(iulog) - endif - - call control_init() - call clm_varpar_init() - call clm_varcon_init( IsSimpleBuildTemp() ) - call landunit_varcon_init() - call ncd_pio_init() - - if (masterproc) call control_print() - - call dynSubgridControl_init(NLFilename) - - ! ------------------------------------------------------------------------ - ! Read in global land grid and land mask (amask)- needed to set decomposition - ! ------------------------------------------------------------------------ - - ! global memory for amask is allocate in surfrd_get_glomask - must be - ! deallocated below - if (masterproc) then - write(iulog,*) 'Attempting to read global land mask from ',trim(fatmlndfrc) - call shr_sys_flush(iulog) - endif - call surfrd_get_globmask(filename=fatmlndfrc, mask=amask, ni=ni, nj=nj) - - ! Exit early if no valid land points - if ( all(amask == 0) )then - if (masterproc) write(iulog,*) trim(subname)//': no valid land points do NOT run clm' - noland = .true. - return - end if - - ! ------------------------------------------------------------------------ - ! Determine clm gridcell decomposition and processor bounds for gridcells - ! ------------------------------------------------------------------------ - - call decompInit_lnd(ni, nj, amask) - deallocate(amask) - - ! *** Get JUST gridcell processor bounds *** - ! Remaining bounds (landunits, columns, patches) will be determined - ! after the call to decompInit_glcp - so get_proc_bounds is called - ! twice and the gridcell information is just filled in twice - - call get_proc_bounds(begg, endg) - - ! ------------------------------------------------------------------------ - ! Get grid and land fraction (set ldomain) - ! ------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*) 'Attempting to read ldomain from ',trim(fatmlndfrc) - call shr_sys_flush(iulog) - endif - call surfrd_get_grid(begg, endg, ldomain, fatmlndfrc) - if (masterproc) then - call domain_check(ldomain) - endif - ldomain%mask = 1 !!! TODO - is this needed? - - ! Initialize glc behavior - call glc_behavior%Init(begg, endg, NLFilename) - - ! Initialize urban model input (initialize urbinp data structure) - ! This needs to be called BEFORE the call to surfrd_get_data since - ! that will call surfrd_get_special which in turn calls check_urban - - call UrbanInput(begg, endg, mode='initialize') - - ! Allocate surface grid dynamic memory (just gridcell bounds dependent) - - allocate (wt_lunit (begg:endg, max_lunit )) - allocate (urban_valid (begg:endg )) - allocate (wt_nat_patch (begg:endg, natpft_lb:natpft_ub )) - allocate (wt_cft (begg:endg, cft_lb:cft_ub )) - allocate (fert_cft (begg:endg, cft_lb:cft_ub )) - allocate (wt_glc_mec (begg:endg, maxpatch_glcmec)) - allocate (topo_glc_mec(begg:endg, maxpatch_glcmec)) - - ! Read list of Patches and their corresponding parameter values - ! Independent of model resolution, Needs to stay before surfrd_get_data - - call pftcon%Init() - - ! Read surface dataset and set up subgrid weight arrays - - call surfrd_get_data(begg, endg, ldomain, fsurdat) - - ! ------------------------------------------------------------------------ - ! Ask Fates to evaluate its own dimensioning needs. - ! This determines the total amount of space it requires in its largest - ! dimension. We are currently calling that the "cohort" dimension, but - ! it is really a utility dimension that captures the models largest - ! size need. - ! Sets: - ! fates_maxElementsPerPatch - ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) - ! - ! (Note: fates_maxELementsPerSite is the critical variable used by CLM - ! to allocate space) - ! ------------------------------------------------------------------------ - - call set_fates_global_elements(use_fates) - - ! ------------------------------------------------------------------------ - ! Determine decomposition of subgrid scale landunits, columns, patches - ! ------------------------------------------------------------------------ - - call decompInit_clumps(ns, ni, nj, glc_behavior) - - ! *** Get ALL processor bounds - for gridcells, landunit, columns and patches *** - - call get_proc_bounds(bounds_proc) - - ! Allocate memory for subgrid data structures - ! This is needed here BEFORE the following call to initGridcells - ! Note that the assumption is made that none of the subgrid initialization - ! can depend on other elements of the subgrid in the calls below - - call grc%Init (bounds_proc%begg, bounds_proc%endg) - call lun%Init (bounds_proc%begl, bounds_proc%endl) - call col%Init (bounds_proc%begc, bounds_proc%endc) - call patch%Init(bounds_proc%begp, bounds_proc%endp) - - ! Build hierarchy and topological info for derived types - ! This is needed here for the following call to decompInit_glcp - - call initGridCells(glc_behavior) - - ! Set global seg maps for gridcells, landlunits, columns and patches - - call decompInit_glcp(ns, ni, nj, glc_behavior) - - ! Set filters - - call allocFilters() - - nclumps = get_proc_clumps() - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - call reweight_wrapup(bounds_clump, glc_behavior) - end do - !$OMP END PARALLEL DO - - ! ------------------------------------------------------------------------ - ! Remainder of initialization1 - ! ------------------------------------------------------------------------ - - ! Set CH4 Model Parameters from namelist. - ! Need to do before initTimeConst so that it knows whether to - ! look for several optional parameters on surfdata file. - - if (use_lch4) then - call ch4conrd() - end if - - ! Deallocate surface grid dynamic memory for variables that aren't needed elsewhere. - ! Some things are kept until the end of initialize2; urban_valid is kept through the - ! end of the run for error checking. - - deallocate (wt_lunit, wt_cft, wt_glc_mec) - - call t_stopf('clm_init1') - - end subroutine initialize1 - - - !----------------------------------------------------------------------- - subroutine initialize2( ) - ! - ! !DESCRIPTION: - ! CLM initialization - second phase - ! - ! !USES: - use shr_orb_mod , only : shr_orb_decl - use shr_scam_mod , only : shr_scam_getCloseLatLon - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - use accumulMod , only : print_accum_fields - use clm_varpar , only : nlevsno - use clm_varcon , only : spval - use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest, fsurdat - use clm_varctl , only : use_century_decomp, single_column, scmlat, scmlon, use_cn, use_fates - use clm_varctl , only : use_crop, ndep_from_cpl - use clm_varorb , only : eccen, mvelpp, lambm0, obliqr - use clm_time_manager , only : get_step_size, get_curr_calday - use clm_time_manager , only : get_curr_date, get_nstep, advance_timestep - use clm_time_manager , only : timemgr_init, timemgr_restart_io, timemgr_restart, is_restart - use CIsoAtmTimeseriesMod , only : C14_init_BombSpike, use_c14_bombspike, C13_init_TimeSeries, use_c13_timeseries - use DaylengthMod , only : InitDaylength - use dynSubgridDriverMod , only : dynSubgrid_init - use fileutils , only : getfil - use initInterpMod , only : initInterp - use subgridWeightsMod , only : init_subgrid_weights_mod - use histFileMod , only : hist_htapes_build, htapes_fieldlist, hist_printflds - use histFileMod , only : hist_addfld1d, hist_addfld2d, no_snow_normal - use restFileMod , only : restFile_getfile, restFile_open, restFile_close - use restFileMod , only : restFile_read, restFile_write - use ndepStreamMod , only : ndep_init, ndep_interp - use LakeCon , only : LakeConInit - use SatellitePhenologyMod , only : SatellitePhenologyInit, readAnnualVegetation, interpMonthlyVeg - use SnowSnicarMod , only : SnowAge_init, SnowOptics_init - use lnd2atmMod , only : lnd2atm_minimal - use NutrientCompetitionFactoryMod, only : create_nutrient_competition_method - use controlMod , only : NLFilename - use clm_instMod , only : clm_fates - ! - ! !ARGUMENTS - ! - ! !LOCAL VARIABLES: - integer :: c,i,j,k,l,p! indices - integer :: yr ! current year (0, ...) - integer :: mon ! current month (1 -> 12) - integer :: day ! current day (1 -> 31) - integer :: ncsec ! current time of day [seconds] - integer :: nc ! clump index - integer :: nclumps ! number of clumps on this processor - character(len=256) :: fnamer ! name of netcdf restart file - character(len=256) :: pnamer ! full pathname of netcdf restart file - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - real(r8) :: dtime ! time step increment (sec) - integer :: nstep ! model time step - real(r8) :: calday ! calendar day for nstep - real(r8) :: caldaym1 ! calendar day for nstep-1 - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinm1 ! solar declination angle in radians for nstep-1 - real(r8) :: eccf ! earth orbit eccentricity factor - type(bounds_type) :: bounds_proc ! processor bounds - type(bounds_type) :: bounds_clump ! clump bounds - logical :: lexist - integer :: closelatidx,closelonidx - real(r8) :: closelat,closelon - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays - character(len=32) :: subname = 'initialize2' - !---------------------------------------------------------------------- - - call t_startf('clm_init2') - - ! ------------------------------------------------------------------------ - ! Determine processor bounds and clumps for this processor - ! ------------------------------------------------------------------------ - - call get_proc_bounds(bounds_proc) - nclumps = get_proc_clumps() - - ! ------------------------------------------------------------------------ - ! Read in parameters files - ! ------------------------------------------------------------------------ - - call clm_instReadNML( NLFilename ) - allocate(nutrient_competition_method, & - source=create_nutrient_competition_method(bounds_proc)) - - call readParameters(nutrient_competition_method, photosyns_inst) - - ! ------------------------------------------------------------------------ - ! Initialize time manager - ! ------------------------------------------------------------------------ - - if (nsrest == nsrStartup) then - call timemgr_init() - else - call restFile_getfile(file=fnamer, path=pnamer) - call restFile_open( flag='read', file=fnamer, ncid=ncid ) - call timemgr_restart_io( ncid=ncid, flag='read' ) - call restFile_close( ncid=ncid ) - call timemgr_restart() - end if - - ! ------------------------------------------------------------------------ - ! Initialize daylength from the previous time step (needed so prev_dayl can be set correctly) - ! ------------------------------------------------------------------------ - - call t_startf('init_orbd') - - calday = get_curr_calday() - call shr_orb_decl( calday, eccen, mvelpp, lambm0, obliqr, declin, eccf ) - - dtime = get_step_size() - caldaym1 = get_curr_calday(offset=-int(dtime)) - call shr_orb_decl( caldaym1, eccen, mvelpp, lambm0, obliqr, declinm1, eccf ) - - call t_stopf('init_orbd') - - call InitDaylength(bounds_proc, declin=declin, declinm1=declinm1, obliquity=obliqr) - - ! History file variables - - if (use_cn) then - call hist_addfld1d (fname='DAYL', units='s', & - avgflag='A', long_name='daylength', & - ptr_gcell=grc%dayl, default='inactive') - - call hist_addfld1d (fname='PREV_DAYL', units='s', & - avgflag='A', long_name='daylength from previous timestep', & - ptr_gcell=grc%prev_dayl, default='inactive') - end if - - ! ------------------------------------------------------------------------ - ! Initialize component data structures - ! ------------------------------------------------------------------------ - - ! Note: new logic is in place that sets all the history fields to spval so - ! there is no guesswork in the initialization to nans of the allocated variables - - ! First put in history calls for subgrid data structures - these cannot appear in the - ! module for the subgrid data definition due to circular dependencies that are introduced - - data2dptr => col%dz(:,-nlevsno+1:0) - col%dz(bounds_proc%begc:bounds_proc%endc,:) = spval - call hist_addfld2d (fname='SNO_Z', units='m', type2d='levsno', & - avgflag='A', long_name='Snow layer thicknesses', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, default='inactive') - - call hist_addfld2d (fname='SNO_Z_ICE', units='m', type2d='levsno', & - avgflag='A', long_name='Snow layer thicknesses (ice landunits only)', & - ptr_col=data2dptr, no_snow_behavior=no_snow_normal, & - l2g_scale_type='ice', default='inactive') - - col%zii(bounds_proc%begc:bounds_proc%endc) = spval - call hist_addfld1d (fname='ZII', units='m', & - avgflag='A', long_name='convective boundary height', & - ptr_col=col%zii, default='inactive') - - ! If single-column determine closest latitude and longitude - - if (single_column) then - call getfil (fsurdat, locfn, 0) - call shr_scam_getCloseLatLon(locfn, scmlat, scmlon, & - closelat, closelon, closelatidx, closelonidx) - end if - - ! Initialize instances of all derived types as well as time constant variables - - call clm_instInit(bounds_proc) - - ! Initialize SNICAR optical and aging parameters - - call SnowOptics_init( ) ! SNICAR optical parameters: - call SnowAge_init( ) ! SNICAR aging parameters: - - call hist_printflds() - - ! ------------------------------------------------------------------------ - ! Initializate dynamic subgrid weights (for prescribed transient Patches, CNDV - ! and/or dynamic landunits); note that these will be overwritten in a - ! restart run - ! ------------------------------------------------------------------------ - - call t_startf('init_dyn_subgrid') - call init_subgrid_weights_mod(bounds_proc) - call dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) - call t_stopf('init_dyn_subgrid') - - ! ------------------------------------------------------------------------ - ! Initialize modules (after time-manager initialization in most cases) - ! ------------------------------------------------------------------------ - - if (use_cn) then - call bgc_vegetation_inst%Init2(bounds_proc, NLFilename) - - ! NOTE(wjs, 2016-02-23) Maybe the rest of the body of this conditional should also - ! be moved into bgc_vegetation_inst%Init2 - - if (n_drydep > 0 .and. drydep_method == DD_XLND) then - ! Must do this also when drydeposition is used so that estimates of monthly - ! differences in LAI can be computed - call SatellitePhenologyInit(bounds_proc) - end if - - if ( use_c14 .and. use_c14_bombspike ) then - call C14_init_BombSpike() - end if - - if ( use_c13 .and. use_c13_timeseries ) then - call C13_init_TimeSeries() - end if - else - call SatellitePhenologyInit(bounds_proc) - end if - - - - - ! ------------------------------------------------------------------------ - ! On restart only - process the history namelist. - ! ------------------------------------------------------------------------ - - ! Later the namelist from the restart file will be used. This allows basic - ! checking to make sure you didn't try to change the history namelist on restart. - - if (nsrest == nsrContinue ) then - call htapes_fieldlist() - end if - - ! ------------------------------------------------------------------------ - ! Read restart/initial info - ! ------------------------------------------------------------------------ - - is_cold_start = .false. - is_interpolated_start = .false. - - if (nsrest == nsrStartup) then - - if (finidat == ' ') then - if (finidat_interp_source == ' ') then - is_cold_start = .true. - if (masterproc) then - write(iulog,*)'Using cold start initial conditions ' - end if - else - if (masterproc) then - write(iulog,*)'Interpolating initial conditions from ',trim(finidat_interp_source),& - ' and creating new initial conditions ', trim(finidat_interp_dest) - end if - end if - else - if (masterproc) then - write(iulog,*)'Reading initial conditions from ',trim(finidat) - end if - call getfil( finidat, fnamer, 0 ) - call restFile_read(bounds_proc, fnamer, glc_behavior) - end if - - else if ((nsrest == nsrContinue) .or. (nsrest == nsrBranch)) then - - if (masterproc) then - write(iulog,*)'Reading restart file ',trim(fnamer) - end if - call restFile_read(bounds_proc, fnamer, glc_behavior) - - end if - - ! ------------------------------------------------------------------------ - ! If appropriate, create interpolated initial conditions - ! ------------------------------------------------------------------------ - - if (nsrest == nsrStartup .and. finidat_interp_source /= ' ') then - - is_interpolated_start = .true. - - ! Check that finidat is not cold start - abort if it is - if (finidat /= ' ') then - call endrun(msg='ERROR clm_initializeMod: '//& - 'finidat and finidat_interp_source cannot both be non-blank') - end if - - ! Create new template file using cold start - call restFile_write(bounds_proc, finidat_interp_dest) - - ! Interpolate finidat onto new template file - call getfil( finidat_interp_source, fnamer, 0 ) - call initInterp(filei=fnamer, fileo=finidat_interp_dest, bounds=bounds_proc, & - glc_behavior=glc_behavior) - - ! Read new interpolated conditions file back in - call restFile_read(bounds_proc, finidat_interp_dest, glc_behavior) - - ! Reset finidat to now be finidat_interp_dest - ! (to be compatible with routines still using finidat) - finidat = trim(finidat_interp_dest) - - end if - - ! ------------------------------------------------------------------------ - ! Initialize nitrogen deposition - ! ------------------------------------------------------------------------ - - if (use_cn) then - call t_startf('init_ndep') - if (.not. ndep_from_cpl) then - call ndep_init(bounds_proc, NLFilename) - call ndep_interp(bounds_proc, atm2lnd_inst) - end if - call t_stopf('init_ndep') - end if - - ! ------------------------------------------------------------------------ - ! Initialize active history fields. - ! ------------------------------------------------------------------------ - - ! This is only done if not a restart run. If a restart run, then this - ! information has already been obtained from the restart data read above. - ! Note that routine hist_htapes_build needs time manager information, - ! so this call must be made after the restart information has been read. - - if (nsrest /= nsrContinue) then - call hist_htapes_build() - end if - - ! ------------------------------------------------------------------------ - ! Initialize variables that are associated with accumulated fields. - ! ------------------------------------------------------------------------ - - ! The following is called for both initial and restart runs and must - ! must be called after the restart file is read - - call atm2lnd_inst%initAccVars(bounds_proc) - call temperature_inst%initAccVars(bounds_proc) - call waterflux_inst%initAccVars(bounds_proc) - call energyflux_inst%initAccVars(bounds_proc) - call canopystate_inst%initAccVars(bounds_proc) - - call bgc_vegetation_inst%initAccVars(bounds_proc) - - if (use_crop) then - call crop_inst%initAccVars(bounds_proc) - end if - - !------------------------------------------------------------ - ! Read monthly vegetation - !------------------------------------------------------------ - - ! Even if CN is on, and dry-deposition is active, read CLMSP annual vegetation - ! to get estimates of monthly LAI - - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - call readAnnualVegetation(bounds_proc, canopystate_inst) - if (nsrest == nsrStartup .and. finidat /= ' ') then - ! Call interpMonthlyVeg for dry-deposition so that mlaidiff will be calculated - ! This needs to be done even if CN or CNDV is on! - call interpMonthlyVeg(bounds_proc, canopystate_inst) - end if - end if - - !------------------------------------------------------------ - ! Determine gridcell averaged properties to send to atm - !------------------------------------------------------------ - - if (nsrest == nsrStartup) then - call t_startf('init_map2gc') - call lnd2atm_minimal(bounds_proc, & - waterstate_inst, surfalb_inst, energyflux_inst, lnd2atm_inst) - call t_stopf('init_map2gc') - end if - - !------------------------------------------------------------ - ! Initialize sno export state to send to glc - !------------------------------------------------------------ - - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - call t_startf('init_lnd2glc') - call lnd2glc_inst%update_lnd2glc(bounds_clump, & - filter(nc)%num_do_smb_c, filter(nc)%do_smb_c, & - temperature_inst, glacier_smb_inst, topo_inst, & - init=.true.) - call t_stopf('init_lnd2glc') - end do - !$OMP END PARALLEL DO - - !------------------------------------------------------------ - ! Deallocate wt_nat_patch - !------------------------------------------------------------ - - ! wt_nat_patch was allocated in initialize1, but needed to be kept around through - ! initialize2 for some consistency checking; now it can be deallocated - - deallocate(wt_nat_patch) - - ! -------------------------------------------------------------- - ! Initialise the fates model state structure - ! -------------------------------------------------------------- - - if ( use_fates .and. .not.is_restart() .and. finidat == ' ') then - call clm_fates%init_coldstart(waterstate_inst,canopystate_inst,soilstate_inst, frictionvel_inst) - end if - - ! topo_glc_mec was allocated in initialize1, but needed to be kept around through - ! initialize2 because it is used to initialize other variables; now it can be - ! deallocated - - deallocate(topo_glc_mec, fert_cft) - - !------------------------------------------------------------ - ! Write log output for end of initialization - !------------------------------------------------------------ - - call t_startf('init_wlog') - if (masterproc) then - write(iulog,*) 'Successfully initialized the land model' - if (nsrest == nsrStartup) then - write(iulog,*) 'begin initial run at: ' - else - write(iulog,*) 'begin continuation run at:' - end if - call get_curr_date(yr, mon, day, ncsec) - write(iulog,*) ' nstep= ',get_nstep(), ' year= ',yr,' month= ',mon,& - ' day= ',day,' seconds= ',ncsec - write(iulog,*) - write(iulog,'(72a1)') ("*",i=1,60) - write(iulog,*) - endif - call t_stopf('init_wlog') - - call t_stopf('clm_init2') - - end subroutine initialize2 - -end module clm_initializeMod diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 deleted file mode 100644 index 1b1b44adba..0000000000 --- a/src/main/clm_instMod.F90 +++ /dev/null @@ -1,553 +0,0 @@ -module clm_instMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Instances and definitions of all data types - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varpar , only : ndecomp_pools, nlevdecomp_full - use clm_varctl , only : use_cn, use_c13, use_c14, use_lch4, use_cndv, use_fates - use clm_varctl , only : use_century_decomp, use_crop - use clm_varcon , only : bdsno, c13ratio, c14ratio - use landunit_varcon , only : istice_mec, istsoil - use perf_mod , only : t_startf, t_stopf - use controlMod , only : NLFilename - - !----------------------------------------- - ! Constants - !----------------------------------------- - - use UrbanParamsType , only : urbanparams_type ! Constants - use UrbanParamsType , only : IsSimpleBuildTemp, IsProgBuildTemp - use UrbanTimeVarType , only : urbantv_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use CNDVType , only : dgv_ecophyscon ! Constants - - !----------------------------------------- - ! Definition of component types - !----------------------------------------- - - use AerosolMod , only : aerosol_type - use CanopyStateType , only : canopystate_type - use ch4Mod , only : ch4_type - use CNVegetationFacade , only : cn_vegetation_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use CropType , only : crop_type - use DryDepVelocity , only : drydepvel_type - use DUSTMod , only : dust_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use GlacierSurfaceMassBalanceMod , only : glacier_smb_type - use IrrigationMod , only : irrigation_type - use LakeStateType , only : lakestate_type - use OzoneBaseMod , only : ozone_base_type - use OzoneFactoryMod , only : create_and_init_ozone_type - use PhotosynthesisMod , only : photosyns_type - use SoilHydrologyType , only : soilhydrology_type - use SoilStateType , only : soilstate_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceRadiationMod , only : surfrad_type - use SurfaceAlbedoType , only : surfalb_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use WaterStateType , only : waterstate_type - use UrbanParamsType , only : urbanparams_type - use UrbanTimeVarType , only : urbantv_type - use HumanIndexMod , only : humanindex_type - use VOCEmissionMod , only : vocemis_type - use CNFireEmissionsMod , only : fireemis_type - use atm2lndType , only : atm2lnd_type - use lnd2atmType , only : lnd2atm_type - use lnd2glcMod , only : lnd2glc_type - use glc2lndMod , only : glc2lnd_type - use glcBehaviorMod , only : glc_behavior_type - use TopoMod , only : topo_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use CLMFatesInterfaceMod , only : hlm_fates_interface_type - use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use NutrientCompetitionMethodMod , only : nutrient_competition_method_type - ! - use SoilStateInitTimeConstMod , only : SoilStateInitTimeConst - use SoilHydrologyInitTimeConstMod , only : SoilHydrologyInitTimeConst - use SurfaceAlbedoMod , only : SurfaceAlbedoInitTimeConst - use LakeCon , only : LakeConInit - use SoilBiogeochemPrecisionControlMod, only: SoilBiogeochemPrecisionControlInit - ! - implicit none - public ! By default everything is public - ! - !----------------------------------------- - ! Instances of component types - !----------------------------------------- - - ! Physics types - type(aerosol_type) :: aerosol_inst - type(canopystate_type) :: canopystate_inst - type(energyflux_type) :: energyflux_inst - type(frictionvel_type) :: frictionvel_inst - type(glacier_smb_type) :: glacier_smb_inst - type(irrigation_type) :: irrigation_inst - type(lakestate_type) :: lakestate_inst - class(ozone_base_type), allocatable :: ozone_inst - type(photosyns_type) :: photosyns_inst - type(soilstate_type) :: soilstate_inst - type(soilhydrology_type) :: soilhydrology_inst - type(solarabs_type) :: solarabs_inst - type(surfalb_type) :: surfalb_inst - type(surfrad_type) :: surfrad_inst - type(temperature_type) :: temperature_inst - type(urbanparams_type) :: urbanparams_inst - type(urbantv_type) :: urbantv_inst - type(humanindex_type) :: humanindex_inst - type(waterflux_type) :: waterflux_inst - type(waterstate_type) :: waterstate_inst - type(atm2lnd_type) :: atm2lnd_inst - type(glc2lnd_type) :: glc2lnd_inst - type(lnd2atm_type) :: lnd2atm_inst - type(lnd2glc_type) :: lnd2glc_inst - type(glc_behavior_type), target :: glc_behavior - type(topo_type) :: topo_inst - class(soil_water_retention_curve_type) , allocatable :: soil_water_retention_curve - - ! CN vegetation types - ! Eventually bgc_vegetation_inst will be an allocatable instance of an abstract - ! interface - type(cn_vegetation_type) :: bgc_vegetation_inst - - class(nutrient_competition_method_type), allocatable :: nutrient_competition_method - - ! Soil biogeochem types - type(soilbiogeochem_state_type) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonflux_type) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonflux_type) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) :: soilbiogeochem_nitrogenflux_inst - - ! General biogeochem types - type(ch4_type) :: ch4_inst - type(crop_type) :: crop_inst - type(dust_type) :: dust_inst - type(vocemis_type) :: vocemis_inst - type(fireemis_type) :: fireemis_inst - type(drydepvel_type) :: drydepvel_inst - - ! FATES - type(hlm_fates_interface_type) :: clm_fates - - ! - public :: clm_instInit ! Initialize - public :: clm_instReadNML ! Read in namelist - public :: clm_instRest ! Setup restart - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_instReadNML( NLFilename ) - ! - ! !ARGUMENTS - implicit none - character(len=*), intent(IN) :: NLFilename ! Namelist filename - ! Read in any namelists that must be read for any clm object instances that need it - call canopystate_inst%ReadNML( NLFilename ) - call photosyns_inst%ReadNML( NLFilename ) - if (use_cn .or. use_fates) then - call crop_inst%ReadNML( NLFilename ) - end if - - end subroutine clm_instReadNML - - !----------------------------------------------------------------------- - subroutine clm_instInit(bounds) - ! - ! !USES: - use clm_varpar , only : nlevsno, numpft - use controlMod , only : nlfilename, fsurdat - use domainMod , only : ldomain - use SoilBiogeochemDecompCascadeBGCMod , only : init_decompcascade_bgc - use SoilBiogeochemDecompCascadeCNMod , only : init_decompcascade_cn - use SoilBiogeochemDecompCascadeContype , only : init_decomp_cascade_constants - use SoilBiogeochemCompetitionMod , only : SoilBiogeochemCompetitionInit - - use initVerticalMod , only : initVertical - use accumulMod , only : print_accum_fields - use SoilWaterRetentionCurveFactoryMod , only : create_soil_water_retention_curve - use decompMod , only : get_proc_bounds - ! - ! !ARGUMENTS - type(bounds_type), intent(in) :: bounds ! processor bounds - ! - ! !LOCAL VARIABLES: - integer :: c,l,g - integer :: nclumps,nc - integer :: begp, endp - integer :: begc, endc - integer :: begl, endl - type(bounds_type) :: bounds_clump - real(r8), allocatable :: h2osno_col(:) - real(r8), allocatable :: snow_depth_col(:) - - integer :: dummy_to_make_pgi_happy - !---------------------------------------------------------------------- - - ! Note: h2osno_col and snow_depth_col are initialized as local variable - ! since they are needed to initialize vertical data structures - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - begl = bounds%begl; endl = bounds%endl - - allocate (h2osno_col(begc:endc)) - allocate (snow_depth_col(begc:endc)) - - ! snow water - do c = begc,endc - l = col%landunit(c) - g = col%gridcell(c) - - ! In areas that should be snow-covered, it can be problematic to start with 0 snow - ! cover, because this can affect the long-term state through soil heating, albedo - ! feedback, etc. On the other hand, we would introduce hysteresis by putting too - ! much snow in places that are in a net melt regime, because the melt-albedo - ! feedback may not activate on time (or at all). So, as a compromise, we start with - ! a small amount of snow in places that are likely to be snow-covered for much or - ! all of the year. - if (lun%itype(l)==istice_mec) then - h2osno_col(c) = 100._r8 - else if (lun%itype(l)==istsoil .and. abs(grc%latdeg(g)) >= 60._r8) then - h2osno_col(c) = 100._r8 - else - h2osno_col(c) = 0._r8 - endif - snow_depth_col(c) = h2osno_col(c) / bdsno - end do - - ! Initialize urban constants - - call urbanparams_inst%Init(bounds) - call humanindex_inst%Init(bounds) - - ! Initialize urban time varying data - call urbantv_inst%Init(bounds, NLFilename) - - ! Initialize vertical data components - - call initVertical(bounds, & - glc_behavior, & - snow_depth_col(begc:endc), & - urbanparams_inst%thick_wall(begl:endl), & - urbanparams_inst%thick_roof(begl:endl)) - - ! Initialize clm->drv and drv->clm data structures - - call atm2lnd_inst%Init( bounds, NLFilename ) - call lnd2atm_inst%Init( bounds, NLFilename ) - - call glc2lnd_inst%Init( bounds, glc_behavior ) - call lnd2glc_inst%Init( bounds ) - - ! Initialization of public data types - - call temperature_inst%Init(bounds, & - urbanparams_inst%em_roof(begl:endl), & - urbanparams_inst%em_wall(begl:endl), & - urbanparams_inst%em_improad(begl:endl), & - urbanparams_inst%em_perroad(begl:endl), & - IsSimpleBuildTemp(), IsProgBuildTemp() ) - - call canopystate_inst%Init(bounds) - - call soilstate_inst%Init(bounds) - call SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) ! sets hydraulic and thermal soil properties - - call waterstate_inst%Init(bounds, & - h2osno_col(begc:endc), & - snow_depth_col(begc:endc), & - soilstate_inst%watsat_col(begc:endc, 1:), & - temperature_inst%t_soisno_col(begc:endc, -nlevsno+1:) ) - - call waterflux_inst%Init(bounds) - - call glacier_smb_inst%Init(bounds) - - ! COMPILER_BUG(wjs, 2014-11-29, pgi 14.7) Without the following assignment, the - ! assertion in energyflux_inst%Init fails with pgi 14.7 on yellowstone, presumably due - ! to a compiler bug. - dummy_to_make_pgi_happy = ubound(temperature_inst%t_grnd_col, 1) - call energyflux_inst%Init(bounds, temperature_inst%t_grnd_col(begc:endc), & - IsSimpleBuildTemp(), IsProgBuildTemp() ) - - call aerosol_inst%Init(bounds, NLFilename) - - call frictionvel_inst%Init(bounds) - - call lakestate_inst%Init(bounds) - call LakeConInit() - - allocate(ozone_inst, source = create_and_init_ozone_type(bounds)) - - call photosyns_inst%Init(bounds) - - call soilhydrology_inst%Init(bounds, nlfilename) - call SoilHydrologyInitTimeConst(bounds, soilhydrology_inst) ! sets time constant properties - - call solarabs_inst%Init(bounds) - - call surfalb_inst%Init(bounds) - call SurfaceAlbedoInitTimeConst(bounds) - - call surfrad_inst%Init(bounds) - - call dust_inst%Init(bounds) - - ! Once namelist options are added to control the soil water retention curve method, - ! we'll need to either pass the namelist file as an argument to this routine, or pass - ! the namelist value itself (if the namelist is read elsewhere). - - allocate(soil_water_retention_curve, & - source=create_soil_water_retention_curve()) - - call irrigation_inst%init(bounds, nlfilename, soilstate_inst, soil_water_retention_curve) - - call topo_inst%Init(bounds) - - ! Note - always initialize the memory for ch4_inst - call ch4_inst%Init(bounds, soilstate_inst%cellorg_col(begc:endc, 1:), fsurdat, nlfilename) - - call vocemis_inst%Init(bounds) - - call fireemis_inst%Init(bounds) - - call drydepvel_inst%Init(bounds) - - if (use_cn .or. use_fates ) then - - ! Initialize soilbiogeochem_state_inst - - call soilbiogeochem_state_inst%Init(bounds) - - ! Initialize decompcascade constants - ! Note that init_decompcascade_bgc and init_decompcascade_cn need - ! soilbiogeochem_state_inst to be initialized - - call init_decomp_cascade_constants() - if (use_century_decomp) then - call init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, & - soilstate_inst ) - else - call init_decompcascade_cn(bounds, soilbiogeochem_state_inst) - end if - - ! Initalize soilbiogeochem carbon types - - call soilbiogeochem_carbonstate_inst%Init(bounds, carbon_type='c12', ratio=1._r8) - if (use_c13) then - call c13_soilbiogeochem_carbonstate_inst%Init(bounds, carbon_type='c13', ratio=c13ratio, & - c12_soilbiogeochem_carbonstate_inst=soilbiogeochem_carbonstate_inst) - end if - if (use_c14) then - call c14_soilbiogeochem_carbonstate_inst%Init(bounds, carbon_type='c14', ratio=c14ratio, & - c12_soilbiogeochem_carbonstate_inst=soilbiogeochem_carbonstate_inst) - end if - - call soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c12') - if (use_c13) then - call c13_soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c13') - end if - if (use_c14) then - call c14_soilbiogeochem_carbonflux_inst%Init(bounds, carbon_type='c14') - end if - - end if - - if ( use_cn .or. use_fates) then - - ! Initalize soilbiogeochem nitrogen types - - call soilbiogeochem_nitrogenstate_inst%Init(bounds, & - soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & - soilbiogeochem_carbonstate_inst%decomp_cpools_col(begc:endc,1:ndecomp_pools), & - soilbiogeochem_carbonstate_inst%decomp_cpools_1m_col(begc:endc, 1:ndecomp_pools)) - - call soilbiogeochem_nitrogenflux_inst%Init(bounds) - - ! Initialize precision control for soil biogeochemistry - call SoilBiogeochemPrecisionControlInit( soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, soilbiogeochem_nitrogenstate_inst) - - end if ! end of if use_cn - - ! Note - always call Init for bgc_vegetation_inst: some pieces need to be initialized always - call bgc_vegetation_inst%Init(bounds, nlfilename) - - if (use_cn .or. use_fates) then - call crop_inst%Init(bounds) - end if - - - ! Initialize the Functionaly Assembled Terrestrial Ecosystem Simulator (FATES) - ! - if (use_fates) then - call clm_fates%Init(bounds) - end if - - deallocate (h2osno_col) - deallocate (snow_depth_col) - - ! ------------------------------------------------------------------------ - ! Initialize accumulated fields - ! ------------------------------------------------------------------------ - - ! The time manager needs to be initialized before this called is made, since - ! the step size is needed. - - call t_startf('init_accflds') - - call atm2lnd_inst%InitAccBuffer(bounds) - - call temperature_inst%InitAccBuffer(bounds) - - call waterflux_inst%InitAccBuffer(bounds) - - call energyflux_inst%InitAccBuffer(bounds) - - call canopystate_inst%InitAccBuffer(bounds) - - call bgc_vegetation_inst%InitAccBuffer(bounds) - - if (use_crop) then - call crop_inst%InitAccBuffer(bounds) - end if - - call print_accum_fields() - - call t_stopf('init_accflds') - - end subroutine clm_instInit - - !----------------------------------------------------------------------- - subroutine clm_instRest(bounds, ncid, flag) - ! - ! !USES: - use ncdio_pio , only : file_desc_t - use UrbanParamsType , only : IsSimpleBuildTemp, IsProgBuildTemp - use decompMod , only : get_proc_bounds, get_proc_clumps, get_clump_bounds - - ! - ! !DESCRIPTION: - ! Define/write/read CLM restart file. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'define', 'write', 'read' - - ! Local variables - integer :: nc, nclumps - type(bounds_type) :: bounds_clump - - !----------------------------------------------------------------------- - - call atm2lnd_inst%restart (bounds, ncid, flag=flag) - - call canopystate_inst%restart (bounds, ncid, flag=flag) - - call energyflux_inst%restart (bounds, ncid, flag=flag, & - is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp()) - - call frictionvel_inst% restart (bounds, ncid, flag=flag) - - call lakestate_inst%restart (bounds, ncid, flag=flag) - - call ozone_inst%restart (bounds, ncid, flag=flag) - - call photosyns_inst%restart (bounds, ncid, flag=flag) - - call soilhydrology_inst%restart (bounds, ncid, flag=flag) - - call solarabs_inst%restart (bounds, ncid, flag=flag) - - call temperature_inst%restart (bounds, ncid, flag=flag, & - is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp()) - - call soilstate_inst%restart (bounds, ncid, flag=flag) - - call waterflux_inst%restart (bounds, ncid, flag=flag) - - call waterstate_inst%restart (bounds, ncid, flag=flag, & - watsat_col=soilstate_inst%watsat_col(bounds%begc:bounds%endc,:)) - - call irrigation_inst%restart (bounds, ncid, flag=flag) - - call aerosol_inst%restart (bounds, ncid, flag=flag, & - h2osoi_ice_col=waterstate_inst%h2osoi_ice_col(bounds%begc:bounds%endc,:), & - h2osoi_liq_col=waterstate_inst%h2osoi_liq_col(bounds%begc:bounds%endc,:)) - - call surfalb_inst%restart (bounds, ncid, flag=flag, & - tlai_patch=canopystate_inst%tlai_patch(bounds%begp:bounds%endp), & - tsai_patch=canopystate_inst%tsai_patch(bounds%begp:bounds%endp)) - - call topo_inst%restart (bounds, ncid, flag=flag) - - if (use_lch4) then - call ch4_inst%restart(bounds, ncid, flag=flag) - end if - - if ( use_cn ) then - ! Need to do vegetation restart before soil bgc restart to get totvegc_col for purpose - ! of resetting soil carbon at exit spinup when no vegetation is growing. - call bgc_vegetation_inst%restart(bounds, ncid, flag=flag) - - call soilbiogeochem_nitrogenstate_inst%restart(bounds, ncid, flag=flag, & - totvegc_col=bgc_vegetation_inst%get_totvegc_col(bounds)) - call soilbiogeochem_nitrogenflux_inst%restart(bounds, ncid, flag=flag) - - call crop_inst%restart(bounds, ncid, flag=flag) - end if - - if (use_cn .or. use_fates) then - - call soilbiogeochem_state_inst%restart(bounds, ncid, flag=flag) - call soilbiogeochem_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c12', & - totvegc_col=bgc_vegetation_inst%get_totvegc_col(bounds)) - - if (use_c13) then - call c13_soilbiogeochem_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c13', & - totvegc_col=bgc_vegetation_inst%get_totvegc_col(bounds), & - c12_soilbiogeochem_carbonstate_inst=soilbiogeochem_carbonstate_inst) - end if - if (use_c14) then - call c14_soilbiogeochem_carbonstate_inst%restart(bounds, ncid, flag=flag, carbon_type='c14', & - totvegc_col=bgc_vegetation_inst%get_totvegc_col(bounds), & - c12_soilbiogeochem_carbonstate_inst=soilbiogeochem_carbonstate_inst) - end if - call soilbiogeochem_carbonflux_inst%restart(bounds, ncid, flag=flag) - endif - - if (use_fates) then - - call clm_fates%restart(bounds, ncid, flag=flag, & - waterstate_inst=waterstate_inst, & - canopystate_inst=canopystate_inst, & - frictionvel_inst=frictionvel_inst) - - end if - - end subroutine clm_instRest - -end module clm_instMod - diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90 deleted file mode 100644 index d0a2053568..0000000000 --- a/src/main/clm_varcon.F90 +++ /dev/null @@ -1,304 +0,0 @@ -module clm_varcon - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing various model constants. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_G,SHR_CONST_STEBOL,SHR_CONST_KARMAN, & - SHR_CONST_RWV,SHR_CONST_RDAIR,SHR_CONST_CPFW, & - SHR_CONST_CPICE,SHR_CONST_CPDAIR,SHR_CONST_LATVAP, & - SHR_CONST_LATSUB,SHR_CONST_LATICE,SHR_CONST_RHOFW, & - SHR_CONST_RHOICE,SHR_CONST_TKFRZ,SHR_CONST_REARTH, & - SHR_CONST_PDB, SHR_CONST_PI, SHR_CONST_CDAY, & - SHR_CONST_RGAS, SHR_CONST_PSTD, & - SHR_CONST_MWDAIR, SHR_CONST_MWWV - use clm_varpar , only: numrad, nlevgrnd, nlevlak, nlevdecomp_full - use clm_varpar , only: ngases - use clm_varpar , only: nlayer - - ! - ! !PUBLIC TYPES: - implicit none - save - !----------------------------------------------------------------------- - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_varcon_init ! initialize constants in clm_varcon - ! - ! !REVISION HISTORY: - ! Created by Mariana Vertenstein - ! 27 February 2008: Keith Oleson; Add forcing height and aerodynamic parameters - !----------------------------------------------------------------------- - - !------------------------------------------------------------------ - ! Initialize mathmatical constants - !------------------------------------------------------------------ - - real(r8) :: rpi = SHR_CONST_PI - - !------------------------------------------------------------------ - ! Initialize physical constants - !------------------------------------------------------------------ - - real(r8), parameter :: n_melt=0.7 ! fsca shape parameter - real(r8), parameter :: e_ice=6.0 ! soil ice impedance factor - real(r8), parameter :: pc = 0.4 ! threshold probability - real(r8), parameter :: mu = 0.13889 ! connectivity exponent - real(r8), parameter :: secsphr = 3600._r8 ! Seconds in an hour - integer, parameter :: isecsphr = int(secsphr) ! Integer seconds in an hour - integer, parameter :: isecspmin= 60 ! Integer seconds in a minute - real(r8) :: grav = SHR_CONST_G ! gravity constant [m/s2] - real(r8) :: sb = SHR_CONST_STEBOL ! stefan-boltzmann constant [W/m2/K4] - real(r8) :: vkc = SHR_CONST_KARMAN ! von Karman constant [-] - real(r8) :: rwat = SHR_CONST_RWV ! gas constant for water vapor [J/(kg K)] - real(r8) :: rair = SHR_CONST_RDAIR ! gas constant for dry air [J/kg/K] - real(r8) :: roverg = SHR_CONST_RWV/SHR_CONST_G*1000._r8 ! Rw/g constant = (8.3144/0.018)/(9.80616)*1000. mm/K - real(r8) :: cpliq = SHR_CONST_CPFW ! Specific heat of water [J/kg-K] - real(r8) :: cpice = SHR_CONST_CPICE ! Specific heat of ice [J/kg-K] - real(r8) :: cpair = SHR_CONST_CPDAIR ! specific heat of dry air [J/kg/K] - real(r8) :: hvap = SHR_CONST_LATVAP ! Latent heat of evap for water [J/kg] - real(r8) :: hsub = SHR_CONST_LATSUB ! Latent heat of sublimation [J/kg] - real(r8) :: hfus = SHR_CONST_LATICE ! Latent heat of fusion for ice [J/kg] - real(r8) :: denh2o = SHR_CONST_RHOFW ! density of liquid water [kg/m3] - real(r8) :: denice = SHR_CONST_RHOICE ! density of ice [kg/m3] - real(r8) :: rgas = SHR_CONST_RGAS ! universal gas constant [J/K/kmole] - real(r8) :: pstd = SHR_CONST_PSTD ! standard pressure [Pa] - - ! TODO(wjs, 2016-04-08) The following should be used in place of hard-coded constants - ! of 0.622 and 0.378 (which is 1 - 0.622) in various places in the code: - real(r8), parameter :: wv_to_dair_weight_ratio = SHR_CONST_MWWV/SHR_CONST_MWDAIR ! ratio of molecular weight of water vapor to that of dry air [-] - - real(r8) :: tkair = 0.023_r8 ! thermal conductivity of air [W/m/K] - real(r8) :: tkice = 2.290_r8 ! thermal conductivity of ice [W/m/K] - real(r8) :: tkwat = 0.57_r8 ! thermal conductivity of water [W/m/K] - real(r8), parameter :: tfrz = SHR_CONST_TKFRZ ! freezing temperature [K] - real(r8), parameter :: tcrit = 2.5_r8 ! critical temperature to determine rain or snow - real(r8) :: o2_molar_const = 0.209_r8 ! constant atmospheric O2 molar ratio (mol/mol) - real(r8) :: oneatm = 1.01325e5_r8 ! one standard atmospheric pressure [Pa] - real(r8) :: bdsno = 250._r8 ! bulk density snow (kg/m**3) - real(r8) :: alpha_aero = 1.0_r8 ! constant for aerodynamic parameter weighting - real(r8) :: tlsai_crit = 2.0_r8 ! critical value of elai+esai for which aerodynamic parameters are maximum - real(r8) :: watmin = 0.01_r8 ! minimum soil moisture (mm) - - real(r8) :: re = SHR_CONST_REARTH*0.001_r8 ! radius of earth (km) - - real(r8), public, parameter :: degpsec = 15._r8/3600.0_r8 ! Degree's earth rotates per second - real(r8), public, parameter :: secspday= SHR_CONST_CDAY ! Seconds per day - integer, public, parameter :: isecspday= secspday ! Integer seconds per day - - integer, public, parameter :: fun_period = 1 ! A FUN parameter, and probably needs to be changed for testing - real(r8),public, parameter :: smallValue = 1.e-12_r8 ! A small values used by FUN - - ! ------------------------------------------------------------------------ - ! Special value flags - ! ------------------------------------------------------------------------ - - ! NOTE(wjs, 2015-11-23) The presence / absence of spval should be static in time for - ! multi-level fields. i.e., if a given level & column has spval at initialization, it - ! should remain spval throughout the run (e.g., indicating that this level is not valid - ! for this column type); similarly, if it starts as a valid value, it should never - ! become spval. This is needed for init_interp to work correctly on multi-level fields. - ! For more details, see the note near the top of initInterpMultilevelInterp. - real(r8), public, parameter :: spval = 1.e36_r8 ! special value for real data - - ! Keep this negative to avoid conflicts with possible valid values - integer , public, parameter :: ispval = -9999 ! special value for int data - - ! ------------------------------------------------------------------------ - ! These are tunable constants from clm2_3 - ! ------------------------------------------------------------------------ - - real(r8) :: zlnd = 0.01_r8 ! Roughness length for soil [m] - real(r8) :: zsno = 0.0024_r8 ! Roughness length for snow [m] - real(r8) :: csoilc = 0.004_r8 ! Drag coefficient for soil under canopy [-] - real(r8) :: capr = 0.34_r8 ! Tuning factor to turn first layer T into surface T - real(r8) :: cnfac = 0.5_r8 ! Crank Nicholson factor between 0 and 1 - real(r8) :: ssi = 0.033_r8 ! Irreducible water saturation of snow - real(r8) :: wimp = 0.05_r8 ! Water impremeable if porosity less than wimp - real(r8) :: pondmx = 0.0_r8 ! Ponding depth (mm) - real(r8) :: pondmx_urban = 1.0_r8 ! Ponding depth for urban roof and impervious road (mm) - - real(r8) :: thk_bedrock = 3.0_r8 ! thermal conductivity of 'typical' saturated granitic rock - ! (Clauser and Huenges, 1995)(W/m/K) - real(r8) :: csol_bedrock = 2.0e6_r8 ! vol. heat capacity of granite/sandstone J/(m3 K)(Shabbir, 2000) !scs - real(r8), parameter :: zmin_bedrock = 0.4_r8 ! minimum soil depth [m] - - real(r8), parameter :: aquifer_water_baseline = 5000._r8 ! baseline value for water in the unconfined aquifer [mm] - - !!! C13 - real(r8), parameter :: preind_atm_del13c = -6.0 ! preindustrial value for atmospheric del13C - real(r8), parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0 ! 13C/12C - real(r8) :: c13ratio = preind_atm_ratio/(1.0+preind_atm_ratio) ! 13C/(12+13)C preind atmosphere - - ! typical del13C for C3 photosynthesis (permil, relative to PDB) - real(r8), parameter :: c3_del13c = -28._r8 - - ! typical del13C for C4 photosynthesis (permil, relative to PDB) - real(r8), parameter :: c4_del13c = -13._r8 - - ! isotope ratio (13c/12c) for C3 photosynthesis - real(r8), parameter :: c3_r1 = SHR_CONST_PDB + ((c3_del13c*SHR_CONST_PDB)/1000._r8) - - ! isotope ratio (13c/[12c+13c]) for C3 photosynthesis - real(r8), parameter :: c3_r2 = c3_r1/(1._r8 + c3_r1) - - ! isotope ratio (13c/12c) for C4 photosynthesis - real(r8), parameter :: c4_r1 = SHR_CONST_PDB + ((c4_del13c*SHR_CONST_PDB)/1000._r8) - - ! isotope ratio (13c/[12c+13c]) for C4 photosynthesis - real(r8), parameter :: c4_r2 = c4_r1/(1._r8 + c4_r1) - - !!! C14 - real(r8) :: c14ratio = 1.e-12_r8 - ! real(r8) :: c14ratio = 1._r8 ! debug lets set to 1 to try to avoid numerical errors - - !------------------------------------------------------------------ - ! Urban building temperature constants - !------------------------------------------------------------------ - real(r8) :: ht_wasteheat_factor = 0.2_r8 ! wasteheat factor for urban heating (-) - real(r8) :: ac_wasteheat_factor = 0.6_r8 ! wasteheat factor for urban air conditioning (-) - real(r8) :: em_roof_int = 0.9_r8 ! emissivity of interior surface of roof (Bueno et al. 2012, GMD) - real(r8) :: em_sunw_int = 0.9_r8 ! emissivity of interior surface of sunwall (Bueno et al. 2012, GMD) - real(r8) :: em_shdw_int = 0.9_r8 ! emissivity of interior surface of shadewall Bueno et al. 2012, GMD) - real(r8) :: em_floor_int = 0.9_r8 ! emissivity of interior surface of floor (Bueno et al. 2012, GMD) - real(r8) :: hcv_roof = 0.948_r8 ! interior convective heat transfer coefficient for roof (Bueno et al. 2012, GMD) (W m-2 K-1) - real(r8) :: hcv_roof_enhanced = 4.040_r8 ! enhanced (t_roof_int <= t_room) interior convective heat transfer coefficient for roof (Bueno et al. 2012, GMD) !(W m-2 K-1) - real(r8) :: hcv_floor = 0.948_r8 ! interior convective heat transfer coefficient for floor (Bueno et al. 2012, GMD) (W m-2 K-1) - real(r8) :: hcv_floor_enhanced = 4.040_r8 ! enhanced (t_floor_int >= t_room) interior convective heat transfer coefficient for floor (Bueno et al. !2012, GMD) (W m-2 K-1) - real(r8) :: hcv_sunw = 3.076_r8 ! interior convective heat transfer coefficient for sunwall (Bueno et al. 2012, GMD) (W m-2 K-1) - real(r8) :: hcv_shdw = 3.076_r8 ! interior convective heat transfer coefficient for shadewall (Bueno et al. 2012, GMD) (W m-2 K-1) - real(r8) :: dz_floor = 0.1_r8 ! floor thickness - concrete (Salmanca et al. 2010, TAC) (m) - real(r8), parameter :: dens_floor = 2.35e3_r8 ! density of floor - concrete (Salmanca et al. 2010, TAC) (kg m-3) - real(r8), parameter :: sh_floor = 880._r8 ! specific heat of floor - concrete (Salmanca et al. 2010, TAC) (J kg-1 K-1) - real(r8) :: cp_floor = dens_floor*sh_floor ! volumetric heat capacity of floor - concrete (Salmanca et al. 2010, TAC) (J m-3 K-1) - real(r8) :: vent_ach = 0.3 ! ventilation rate (air exchanges per hour) - - real(r8) :: wasteheat_limit = 100._r8 ! limit on wasteheat (W/m2) - - !------------------------------------------------------------------ - - real(r8) :: h2osno_max = -999.0_r8 ! max allowed snow thickness (mm H2O) - real(r8) :: int_snow_max = -999.0_r8 ! limit applied to integrated snowfall when determining changes in snow-covered fraction during melt (mm H2O) - real(r8) :: n_melt_glcmec = -999.0_r8 ! SCA shape parameter for glc_mec columns - - integer, private :: i ! loop index - - !real(r8), parameter :: nitrif_n2o_loss_frac = 0.02_r8 ! fraction of N lost as N2O in nitrification (Parton et al., 2001) - real(r8), parameter :: nitrif_n2o_loss_frac = 6.e-4_r8 ! fraction of N lost as N2O in nitrification (Li et al., 2000) - real(r8), parameter :: frac_minrlztn_to_no3 = 0.2_r8 ! fraction of N mineralized that is dieverted to the nitrification stream (Parton et al., 2001) - - !------------------------------------------------------------------ - ! Set subgrid names - !------------------------------------------------------------------ - - character(len=16), parameter :: grlnd = 'lndgrid' ! name of lndgrid - character(len=16), parameter :: namea = 'gridcellatm' ! name of atmgrid - character(len=16), parameter :: nameg = 'gridcell' ! name of gridcells - character(len=16), parameter :: namel = 'landunit' ! name of landunits - character(len=16), parameter :: namec = 'column' ! name of columns - character(len=16), parameter :: namep = 'pft' ! name of patches - character(len=16), parameter :: nameCohort = 'cohort' ! name of cohorts (ED specific) - - !------------------------------------------------------------------ - ! Initialize miscellaneous radiation constants - !------------------------------------------------------------------ - - real(r8) :: betads = 0.5_r8 ! two-stream parameter betad for snow - real(r8) :: betais = 0.5_r8 ! two-stream parameter betai for snow - real(r8) :: omegas(numrad) ! two-stream parameter omega for snow by band - data (omegas(i),i=1,numrad) /0.8_r8, 0.4_r8/ - - ! Lake Model Constants will be defined in LakeCon. - - !------------------------------------------------------------------ - ! Soil depths are constants for now; lake depths can vary by gridcell - ! zlak and dzlak correspond to the default 50 m lake depth. - ! The values for the following arrays are set in routine iniTimeConst - !------------------------------------------------------------------ - - real(r8), allocatable :: zlak(:) !lake z (layers) - real(r8), allocatable :: dzlak(:) !lake dz (thickness) - real(r8), allocatable :: zsoi(:) !soil z (layers) - real(r8), allocatable :: dzsoi(:) !soil dz (thickness) - real(r8), allocatable :: zisoi(:) !soil zi (interfaces) - real(r8), allocatable :: dzsoi_decomp(:) !soil dz (thickness) - integer , allocatable :: nlvic(:) !number of CLM layers in each VIC layer (#) - real(r8), allocatable :: dzvic(:) !soil dz (thickness) of each VIC layer - real(r8) ,allocatable :: zsoifl(:) !original soil midpoint (used in interpolation of sand and clay) - real(r8) ,allocatable :: zisoifl(:) !original soil interface depth (used in interpolation of sand and clay) - real(r8) ,allocatable :: dzsoifl(:) !original soil thickness (used in interpolation of sand and clay) - - !------------------------------------------------------------------ - ! (Non-tunable) Constants for the CH4 submodel (Tuneable constants in ch4varcon) - !------------------------------------------------------------------ - ! Note some of these constants are also used in CNNitrifDenitrifMod - - real(r8), parameter :: catomw = 12.011_r8 ! molar mass of C atoms (g/mol) - - real(r8) :: s_con(ngases,4) ! Schmidt # calculation constants (spp, #) - data (s_con(1,i),i=1,4) /1898_r8, -110.1_r8, 2.834_r8, -0.02791_r8/ ! CH4 - data (s_con(2,i),i=1,4) /1801_r8, -120.1_r8, 3.7818_r8, -0.047608_r8/ ! O2 - data (s_con(3,i),i=1,4) /1911_r8, -113.7_r8, 2.967_r8, -0.02943_r8/ ! CO2 - - real(r8) :: d_con_w(ngases,3) ! water diffusivity constants (spp, #) (mult. by 10^-4) - data (d_con_w(1,i),i=1,3) /0.9798_r8, 0.02986_r8, 0.0004381_r8/ ! CH4 - data (d_con_w(2,i),i=1,3) /1.172_r8, 0.03443_r8, 0.0005048_r8/ ! O2 - data (d_con_w(3,i),i=1,3) /0.939_r8, 0.02671_r8, 0.0004095_r8/ ! CO2 - - real(r8) :: d_con_g(ngases,2) ! gas diffusivity constants (spp, #) (cm^2/s) (mult. by 10^-9) - data (d_con_g(1,i),i=1,2) /0.1875_r8, 0.0013_r8/ ! CH4 - data (d_con_g(2,i),i=1,2) /0.1759_r8, 0.00117_r8/ ! O2 - data (d_con_g(3,i),i=1,2) /0.1325_r8, 0.0009_r8/ ! CO2 - - real(r8) :: c_h_inv(ngases) ! constant (K) for Henry's law (4.12, Wania) - data c_h_inv(1:3) /1600._r8, 1500._r8, 2400._r8/ ! CH4, O2, CO2 - - real(r8) :: kh_theta(ngases) ! Henry's constant (L.atm/mol) at standard temperature (298K) - data kh_theta(1:3) /714.29_r8, 769.23_r8, 29.4_r8/ ! CH4, O2, CO2 - - real(r8) :: kh_tbase = 298._r8 ! base temperature for calculation of Henry's constant (K) - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------------ - subroutine clm_varcon_init( is_simple_buildtemp ) - ! - ! !DESCRIPTION: - ! This subroutine initializes constant arrays in clm_varcon. - ! MUST be called after clm_varpar_init. - ! - ! !USES: - use clm_varpar, only: nlevgrnd, nlevlak, nlevdecomp_full, nlevsoifl, nlayer - ! - ! !ARGUMENTS: - implicit none - logical, intent(in) :: is_simple_buildtemp ! If simple building temp method is being used - ! - ! !REVISION HISTORY: - ! Created by E. Kluzek -!------------------------------------------------------------------------------ - - allocate( zlak(1:nlevlak )) - allocate( dzlak(1:nlevlak )) - allocate( zsoi(1:nlevgrnd )) - allocate( dzsoi(1:nlevgrnd )) - allocate( zisoi(0:nlevgrnd )) - allocate( dzsoi_decomp(1:nlevdecomp_full )) - allocate( nlvic(1:nlayer )) - allocate( dzvic(1:nlayer )) - allocate( zsoifl(1:nlevsoifl )) - allocate( zisoifl(0:nlevsoifl )) - allocate( dzsoifl(1:nlevsoifl )) - - ! Zero out wastheat factors for simpler building temperature method (introduced in CLM4.5) - if ( is_simple_buildtemp )then - ht_wasteheat_factor = 0.0_r8 - ac_wasteheat_factor = 0.0_r8 - end if - - end subroutine clm_varcon_init - -end module clm_varcon diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 deleted file mode 100644 index 938155c5dd..0000000000 --- a/src/main/clm_varctl.F90 +++ /dev/null @@ -1,394 +0,0 @@ -module clm_varctl - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing run control variables - ! - ! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8, SHR_KIND_CL - use shr_sys_mod , only: shr_sys_abort ! cannot use endrun here due to circular dependency - ! - ! !PUBLIC MEMBER FUNCTIONS: - implicit none - public :: clm_varctl_set ! Set variables - public :: cnallocate_carbon_only_set - public :: cnallocate_carbon_only - ! - private - save - ! - ! !PUBLIC TYPES: - ! - integer , parameter, public :: iundef = -9999999 - real(r8), parameter, public :: rundef = -9999999._r8 - integer , parameter, public :: fname_len = SHR_KIND_CL ! max length of file names in this module - !---------------------------------------------------------- - ! - ! Run control variables - ! - ! case id - character(len=256), public :: caseid = ' ' - - ! case title - character(len=256), public :: ctitle = ' ' - - ! Type of run - integer, public :: nsrest = iundef - logical, public :: is_cold_start = .false. - logical, public :: is_interpolated_start = .false. ! True if we're starting from initial conditions that have been run through init_interp - - ! Startup from initial conditions - integer, public, parameter :: nsrStartup = 0 - - ! Continue from restart files - integer, public, parameter :: nsrContinue = 1 - - ! Branch from restart files - integer, public, parameter :: nsrBranch = 2 - - ! true => allow case name to remain the same for branch run - ! by default this is not allowed - logical, public :: brnch_retain_casename = .false. - - !true => no valid land points -- do NOT run - logical, public :: noland = .false. - - ! Hostname of machine running on - character(len=256), public :: hostname = ' ' - - ! username of user running program - character(len=256), public :: username = ' ' - - ! description of this source - character(len=256), public :: source = "Community Land Model CLM4.0" - - ! version of program - character(len=256), public :: version = " " - - ! dataset conventions - character(len=256), public :: conventions = "CF-1.0" - - !---------------------------------------------------------- - ! Unit Numbers - !---------------------------------------------------------- - ! - integer, public :: iulog = 6 ! "stdout" log file unit number, default is 6 - - !---------------------------------------------------------- - ! Output NetCDF files - !---------------------------------------------------------- - - logical, public :: outnc_large_files = .true. ! large file support for output NetCDF files - - !---------------------------------------------------------- - ! Run input files - !---------------------------------------------------------- - - character(len=fname_len), public :: finidat = ' ' ! initial conditions file name - character(len=fname_len), public :: fsurdat = ' ' ! surface data file name - character(len=fname_len), public :: fatmgrid = ' ' ! atm grid file name - character(len=fname_len), public :: fatmlndfrc = ' ' ! lnd frac file on atm grid - character(len=fname_len), public :: paramfile = ' ' ! ASCII data file with PFT physiological constants - character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run - character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name - character(len=fname_len), public :: fsnowaging = ' ' ! snow aging parameters file name - - !---------------------------------------------------------- - ! Flag to read ndep rather than obtain it from coupler - !---------------------------------------------------------- - - logical, public :: ndep_from_cpl = .false. - - !---------------------------------------------------------- - ! Interpolation of finidat if requested - !---------------------------------------------------------- - - logical, public :: bound_h2osoi = .true. ! for debugging - - ! If finidat_interp_source is non-blank and finidat is blank then interpolation will be - ! done from finidat_interp_source to finidat_interp_dest. Note that - ! finidat_interp_source is not read in directly from the namelist - rather, it is set - ! from finidat if use_init_interp is .true. - - character(len=fname_len), public :: finidat_interp_source = ' ' - character(len=fname_len), public :: finidat_interp_dest = '' - - !---------------------------------------------------------- - ! Crop & Irrigation logic - !---------------------------------------------------------- - - ! If prognostic crops are turned on - logical, public :: use_crop = .false. - - ! true => separate crop landunit is not created by default - logical, public :: create_crop_landunit = .false. - - ! do not irrigate by default - logical, public :: irrigate = .false. - - !---------------------------------------------------------- - ! Other subgrid logic - !---------------------------------------------------------- - - ! true => allocate and run urban landunits everywhere where we have valid urban data - logical, public :: run_zero_weight_urban = .false. - - ! true => make ALL patches, cols & landunits active (even if weight is 0) - logical, public :: all_active = .false. - - !---------------------------------------------------------- - ! BGC logic and datasets - !---------------------------------------------------------- - - ! values of 'prognostic','diagnostic','constant' - character(len=16), public :: co2_type = 'constant' - - ! State of the model for the accelerated decomposition (AD) spinup. - ! 0 (default) = normal model; 1 = AD SPINUP - integer, public :: spinup_state = 0 - - ! true => anoxia is applied to heterotrophic respiration also considered in CH4 model - ! default value reset in controlMod - logical, public :: anoxia = .true. - - ! used to override an error check on reading in restart files - logical, public :: override_bgc_restart_mismatch_dump = .false. - - ! Set in CNAllocationInit (TODO - had to move it here to avoid circular dependency) - logical, private:: carbon_only - - ! Set in CNNDynamicsInit - ! NOTE (mvertens, 2014-9 had to move it here to avoid confusion when carbon data types - ! wehre split - TODO - should move it our of this module) - ! NOTE(bandre, 2013-10) according to Charlie Koven, nfix_timeconst - ! is currently used as a flag and rate constant. - ! Rate constant: time over which to exponentially relax the npp flux for N fixation term - ! (days) time over which to exponentially relax the npp flux for N fixation term - ! flag: (if <= 0. or >= 365; use old annual method). - ! Default value is junk that should always be overwritten by the namelist or init function! - ! - real(r8), public :: nfix_timeconst = -1.2345_r8 - - !---------------------------------------------------------- - ! Physics - !---------------------------------------------------------- - - ! use subgrid fluxes - integer, public :: subgridflag = 1 - - ! true => write global average diagnostics to std out - logical, public :: wrtdia = .false. - - ! atmospheric CO2 molar ratio (by volume) (umol/mol) - real(r8), public :: co2_ppmv = 355._r8 ! - - !---------------------------------------------------------- - ! C isotopes - !---------------------------------------------------------- - - logical, public :: use_c13 = .false. ! true => use C-13 model - logical, public :: use_c14 = .false. ! true => use C-14 model - - !---------------------------------------------------------- - ! FATES switches - !---------------------------------------------------------- - - logical, public :: use_fates = .false. ! true => use fates - - ! These are INTERNAL to the FATES module - logical, public :: use_fates_spitfire = .false. ! true => use spitfire model - logical, public :: use_fates_logging = .false. ! true => turn on logging module - logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro - logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure - logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology - logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory - character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control - - !---------------------------------------------------------- - ! LUNA switches - !---------------------------------------------------------- - - logical, public :: use_luna = .false. ! true => use LUNA - - !---------------------------------------------------------- - ! flexibleCN - !---------------------------------------------------------- - ! TODO(bja, 2015-08) some of these need to be moved into the - ! appropriate module. - logical, public :: use_flexibleCN = .false. - logical, public :: MM_Nuptake_opt = .false. - logical, public :: downreg_opt = .true. - integer, public :: plant_ndemand_opt = 0 - logical, public :: substrate_term_opt = .true. - logical, public :: nscalar_opt = .true. - logical, public :: temp_scalar_opt = .true. - logical, public :: CNratio_floating = .false. - logical, public :: lnc_opt = .false. - logical, public :: reduce_dayl_factor = .false. - integer, public :: vcmax_opt = 0 - integer, public :: CN_residual_opt = 0 - integer, public :: CN_partition_opt = 0 - integer, public :: CN_evergreen_phenology_opt = 0 - integer, public :: carbon_resp_opt = 0 - - !---------------------------------------------------------- - ! lai streams switch for Sat. Phenology - !---------------------------------------------------------- - - logical, public :: use_lai_streams = .false. ! true => use lai streams in SatellitePhenologyMod.F90 - - !---------------------------------------------------------- - ! bedrock / soil depth switch - !---------------------------------------------------------- - - logical, public :: use_bedrock = .false. ! true => use spatially variable soil depth - character(len=16), public :: soil_layerstruct = '10SL_3.5m' - - !---------------------------------------------------------- - ! plant hydraulic stress switch - !---------------------------------------------------------- - - logical, public :: use_hydrstress = .false. ! true => use plant hydraulic stress calculation - - !---------------------------------------------------------- - ! dynamic root switch - !---------------------------------------------------------- - - logical, public :: use_dynroot = .false. ! true => use dynamic root module - - !---------------------------------------------------------- - ! glacier_mec control variables: default values (may be overwritten by namelist) - !---------------------------------------------------------- - - ! true => CLM glacier area & topography changes dynamically - logical , public :: glc_do_dynglacier = .false. - - ! number of days before one considers the perennially snow-covered point 'land ice' - integer , public :: glc_snow_persistence_max_days = 7300 - - ! - !---------------------------------------------------------- - ! single column control variables - !---------------------------------------------------------- - - logical, public :: single_column = .false. ! true => single column mode - real(r8), public :: scmlat = rundef ! single column lat - real(r8), public :: scmlon = rundef ! single column lon - - !---------------------------------------------------------- - ! instance control - !---------------------------------------------------------- - - integer, public :: inst_index - character(len=16), public :: inst_name - character(len=16), public :: inst_suffix - - !---------------------------------------------------------- - ! Decomp control variables - !---------------------------------------------------------- - - ! number of segments per clump for decomp - integer, public :: nsegspc = 20 - - !---------------------------------------------------------- - ! Derived variables (run, history and restart file) - !---------------------------------------------------------- - - ! directory name for local restart pointer file - character(len=256), public :: rpntdir = '.' - - ! file name for local restart pointer file - character(len=256), public :: rpntfil = 'rpointer.lnd' - - ! moved hist_wrtch4diag from histFileMod.F90 to here - caused compiler error with intel - ! namelist: write CH4 extra diagnostic output - logical, public :: hist_wrtch4diag = .false. - - !---------------------------------------------------------- - ! FATES - !---------------------------------------------------------- - character(len=fname_len), public :: fates_paramfile = ' ' - - !---------------------------------------------------------- - ! Migration of CPP variables - !---------------------------------------------------------- - - logical, public :: use_lch4 = .false. - logical, public :: use_nitrif_denitrif = .false. - logical, public :: use_vertsoilc = .false. - logical, public :: use_extralakelayers = .false. - logical, public :: use_vichydro = .false. - logical, public :: use_century_decomp = .false. - logical, public :: use_cn = .false. - logical, public :: use_cndv = .false. - logical, public :: use_grainproduct = .false. - logical, public :: use_fertilizer = .false. - logical, public :: use_ozone = .false. - logical, public :: use_snicar_frc = .false. - logical, public :: use_vancouver = .false. - logical, public :: use_mexicocity = .false. - logical, public :: use_noio = .false. - - logical, public :: use_nguardrail = .false. - - !---------------------------------------------------------- - ! To retrieve namelist - !---------------------------------------------------------- - character(len=SHR_KIND_CL), public :: NLFilename_in ! Namelist filename - ! - logical, private :: clmvarctl_isset = .false. - !----------------------------------------------------------------------- - -contains - - !--------------------------------------------------------------------------- - subroutine clm_varctl_set( caseid_in, ctitle_in, brnch_retain_casename_in, & - single_column_in, scmlat_in, scmlon_in, nsrest_in, & - version_in, hostname_in, username_in) - ! - ! !DESCRIPTION: - ! Set input control variables. - ! - ! !ARGUMENTS: - character(len=256), optional, intent(IN) :: caseid_in ! case id - character(len=256), optional, intent(IN) :: ctitle_in ! case title - logical, optional, intent(IN) :: brnch_retain_casename_in ! true => allow case name to remain the - ! same for branch run - logical, optional, intent(IN) :: single_column_in ! true => single column mode - real(r8), optional, intent(IN) :: scmlat_in ! single column lat - real(r8), optional, intent(IN) :: scmlon_in ! single column lon - integer, optional, intent(IN) :: nsrest_in ! 0: initial run. 1: restart: 3: branch - character(len=256), optional, intent(IN) :: version_in ! model version - character(len=256), optional, intent(IN) :: hostname_in ! hostname running on - character(len=256), optional, intent(IN) :: username_in ! username running job - !----------------------------------------------------------------------- - - if ( clmvarctl_isset )then - call shr_sys_abort(' ERROR:: control variables already set, cannot call this routine') - end if - - if ( present(caseid_in ) ) caseid = caseid_in - if ( present(ctitle_in ) ) ctitle = ctitle_in - if ( present(single_column_in) ) single_column = single_column_in - if ( present(scmlat_in ) ) scmlat = scmlat_in - if ( present(scmlon_in ) ) scmlon = scmlon_in - if ( present(nsrest_in ) ) nsrest = nsrest_in - if ( present(brnch_retain_casename_in) ) brnch_retain_casename = brnch_retain_casename_in - if ( present(version_in ) ) version = version_in - if ( present(username_in ) ) username = username_in - if ( present(hostname_in ) ) hostname = hostname_in - - end subroutine clm_varctl_set - - ! Set module carbon_only flag - subroutine cnallocate_carbon_only_set(carbon_only_in) - logical, intent(in) :: carbon_only_in - carbon_only = carbon_only_in - end subroutine cnallocate_carbon_only_set - - ! Get module carbon_only flag - logical function CNAllocate_Carbon_only() - cnallocate_carbon_only = carbon_only - end function CNAllocate_Carbon_only - -end module clm_varctl diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 deleted file mode 100644 index d2011dcae4..0000000000 --- a/src/main/clm_varpar.F90 +++ /dev/null @@ -1,215 +0,0 @@ -module clm_varpar - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing CLM parameters - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use spmdMod , only: masterproc - use clm_varctl , only: use_extralakelayers, use_vertsoilc - use clm_varctl , only: use_century_decomp, use_c13, use_c14 - use clm_varctl , only: iulog, use_crop, create_crop_landunit, irrigate - use clm_varctl , only: use_vichydro, soil_layerstruct - use clm_varctl , only: use_fates - - ! - ! !PUBLIC TYPES: - implicit none - save - - ! Note - model resolution is read in from the surface dataset - - integer, parameter :: nlev_equalspace = 15 - integer, parameter :: toplev_equalspace = 6 - integer :: nlevsoi ! number of hydrologically active soil layers - integer :: nlevsoifl ! number of soil layers on input file - integer :: nlevgrnd ! number of ground layers - ! (includes lower layers that are hydrologically inactive) - integer :: nlevurb ! number of urban layers - integer :: nlevlak ! number of lake layers - integer :: nlevdecomp ! number of biogeochemically active soil layers - integer :: nlevdecomp_full ! number of biogeochemical layers - ! (includes lower layers that are biogeochemically inactive) - integer :: nlevsno = -1 ! maximum number of snow layers - integer, parameter :: ngases = 3 ! CH4, O2, & CO2 - integer, parameter :: nlevcan = 1 ! number of leaf layers in canopy layer - integer, parameter :: nvegwcs = 4 ! number of vegetation water conductance segments - !ED variables - integer, parameter :: numwat = 5 ! number of water types (soil, ice, 2 lakes, wetland) - integer, parameter :: numrad = 2 ! number of solar radiation bands: vis, nir - integer, parameter :: ivis = 1 ! index for visible band - integer, parameter :: inir = 2 ! index for near-infrared band - integer, parameter :: numsolar = 2 ! number of solar type bands: direct, diffuse - integer, parameter :: ndst = 4 ! number of dust size classes (BGC only) - integer, parameter :: dst_src_nbr = 3 ! number of size distns in src soil (BGC only) - integer, parameter :: sz_nbr = 200 ! number of sub-grid bins in large bin of dust size distribution (BGC only) - integer, parameter :: mxpft = 78 ! maximum number of PFT's for any mode; - ! FIX(RF,032414) might we set some of these automatically from reading pft-physiology? - integer, parameter :: numveg = 16 ! number of veg types (without specific crop) - integer, parameter :: nlayer = 3 ! number of VIC soil layer --Added by AWang - integer :: nlayert ! number of VIC soil layer + 3 lower thermal layers - integer, parameter :: nvariants = 2 ! number of variants of PFT constants - - integer :: numpft = mxpft ! actual # of pfts (without bare) - integer :: numcft = 64 ! actual # of crops (includes unused CFTs that are merged into other CFTs) - integer :: maxpatch_urb= 5 ! max number of urban patches (columns) in urban landunit - - integer :: maxpatch_pft ! max number of plant functional types in naturally vegetated landunit (namelist setting) - - ! constants for decomposition cascade - - integer, parameter :: i_met_lit = 1 - integer, parameter :: i_cel_lit = i_met_lit + 1 - integer, parameter :: i_lig_lit = i_cel_lit + 1 - integer :: i_cwd - - integer :: ndecomp_pools - integer :: ndecomp_cascade_transitions - - ! Indices used in surface file read and set in clm_varpar_init - - integer :: natpft_lb ! In PATCH arrays, lower bound of Patches on the natural veg landunit (i.e., bare ground index) - integer :: natpft_ub ! In PATCH arrays, upper bound of Patches on the natural veg landunit - integer :: natpft_size ! Number of Patches on natural veg landunit (including bare ground) - - ! The following variables pertain to arrays of all PFTs - e.g., those dimensioned (g, - ! pft_index). These include unused CFTs that are merged into other CFTs. Thus, these - ! variables do NOT give the actual number of CFTs on the crop landunit - that number - ! will generally be less because CLM does not simulate all crop types (some crop types - ! are merged into other types). - integer :: cft_lb ! In arrays of PFTs, lower bound of PFTs on the crop landunit - integer :: cft_ub ! In arrays of PFTs, upper bound of PFTs on the crop landunit - integer :: cft_size ! Number of PFTs on crop landunit in arrays of PFTs - - integer :: maxpatch_glcmec ! max number of elevation classes - integer :: max_patch_per_col - ! - ! !PUBLIC MEMBER FUNCTIONS: - public clm_varpar_init ! set parameters - ! - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------------ - subroutine clm_varpar_init() - ! - ! !DESCRIPTION: - ! Initialize module variables - ! - ! !ARGUMENTS: - implicit none - ! - ! !LOCAL VARIABLES: - ! - character(len=32) :: subname = 'clm_varpar_init' ! subroutine name - !------------------------------------------------------------------------------ - - ! Crop settings and consistency checks - - if (use_crop) then - numpft = mxpft ! actual # of patches (without bare) - numcft = 64 ! actual # of crops - else - numpft = numveg ! actual # of patches (without bare) - numcft = 2 ! actual # of crops - end if - - ! For arrays containing all Patches (natural veg & crop), determine lower and upper bounds - ! for (1) Patches on the natural vegetation landunit (includes bare ground, and includes - ! crops if create_crop_landunit=false), and (2) CFTs on the crop landunit (no elements - ! if create_crop_landunit=false) - - if (create_crop_landunit) then - natpft_size = (numpft + 1) - numcft ! note that numpft doesn't include bare ground -- thus we add 1 - cft_size = numcft - else - natpft_size = numpft + 1 ! note that numpft doesn't include bare ground -- thus we add 1 - cft_size = 0 - end if - - natpft_lb = 0 - natpft_ub = natpft_lb + natpft_size - 1 - cft_lb = natpft_ub + 1 - cft_ub = cft_lb + cft_size - 1 - - ! TODO(wjs, 2015-10-04, bugz 2227) Using numcft in this 'max' gives a significant - ! overestimate of max_patch_per_col when use_crop is true. This should be reworked - - ! or, better, removed from the code entirely (because it is a maintenance problem, and - ! I can't imagine that looping idioms that use it help performance that much, and - ! likely they hurt performance.) - max_patch_per_col= max(numpft+1, numcft, maxpatch_urb) - - nlevsoifl = 10 - nlevurb = 5 - if ( masterproc ) write(iulog, *) 'soil_layerstruct varpar ',soil_layerstruct - if ( soil_layerstruct == '10SL_3.5m' ) then - nlevsoi = nlevsoifl - nlevgrnd = 15 - else if ( soil_layerstruct == '23SL_3.5m' ) then - nlevsoi = 8 + nlev_equalspace - nlevgrnd = 15 + nlev_equalspace - else if ( soil_layerstruct == '49SL_10m' ) then - nlevsoi = 49 ! 10x10 + 9x100 + 30x300 = 1e4mm = 10m -! nlevsoi = 29 ! 10x10 + 9x100 + 10x300 = 4e3mm = 4m - nlevgrnd = nlevsoi+5 - else if ( soil_layerstruct == '20SL_8.5m' ) then - nlevsoi = 20 - nlevgrnd = nlevsoi+5 - endif - if ( masterproc ) write(iulog, *) 'soil_layerstruct varpar ',soil_layerstruct,nlevsoi,nlevgrnd - - if (use_vichydro) then - nlayert = nlayer + (nlevgrnd -nlevsoi) - endif - - ! here is a switch to set the number of soil levels for the biogeochemistry calculations. - ! currently it works on either a single level or on nlevsoi and nlevgrnd levels - if (use_vertsoilc) then - nlevdecomp = nlevsoi - nlevdecomp_full = nlevgrnd - else - nlevdecomp = 1 - nlevdecomp_full = 1 - end if - - if (.not. use_extralakelayers) then - nlevlak = 10 ! number of lake layers - else - nlevlak = 25 ! number of lake layers (Yields better results for site simulations) - end if - - if ( masterproc )then - write(iulog, *) 'CLM varpar subsurface discretization levels ' - write(iulog, '(a, i3)') ' nlevsoi = ', nlevsoi - write(iulog, '(a, i3)') ' nlevgrnd = ', nlevgrnd - write(iulog, '(a, i3)') ' nlevdecomp = ', nlevdecomp - write(iulog, '(a, i3)') ' nlevdecomp_full = ', nlevdecomp_full - write(iulog, '(a, i3)') ' nlevlak = ', nlevlak - write(iulog, *) - end if - - if ( use_fates ) then - i_cwd = 0 - if (use_century_decomp) then - ndecomp_pools = 6 - ndecomp_cascade_transitions = 8 - else - ndecomp_pools = 7 - ndecomp_cascade_transitions = 7 - end if - else - i_cwd = 4 - if (use_century_decomp) then - ndecomp_pools = 7 - ndecomp_cascade_transitions = 10 - else - ndecomp_pools = 8 - ndecomp_cascade_transitions = 9 - end if - endif - - end subroutine clm_varpar_init - -end module clm_varpar diff --git a/src/main/clm_varsur.F90 b/src/main/clm_varsur.F90 deleted file mode 100644 index a9b32dab30..0000000000 --- a/src/main/clm_varsur.F90 +++ /dev/null @@ -1,45 +0,0 @@ -module clm_instur - - !----------------------------------------------------------------------- - ! Module containing 2-d surface boundary data information - ! surface boundary data, these are all "gdc" local - ! Note that some of these need to be pointers (as opposed to just allocatable arrays) to - ! match the ncd_io interface; for consistency, we make them all pointers - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! weight of each landunit on the grid cell - real(r8), pointer :: wt_lunit(:,:) - - ! whether we have valid urban data in each grid cell - logical , pointer :: urban_valid(:) - - ! for natural veg landunit, weight of each patch on the landunit (adds to 1.0 on the - ! landunit for all grid cells, even those without any natural pft) - ! (second dimension goes natpft_lb:natpft_ub) - real(r8), pointer :: wt_nat_patch(:,:) - - ! for crop landunit, weight of each cft on the landunit (adds to 1.0 on the - ! landunit for all all grid cells, even those without any crop) - ! (second dimension goes cft_lb:cft_ub) - real(r8), pointer :: wt_cft(:,:) - - ! for each cft on the crop landunit prescribe annual fertilizer - ! landunit for all all grid cells, even those without any crop) - ! (second dimension goes cft_lb:cft_ub) - real(r8), pointer :: fert_cft(:,:) - - ! for glc_mec landunits, weight of glacier in each elevation class (adds to 1.0 on the - ! landunit for all grid cells, even those without any glacier) - real(r8), pointer :: wt_glc_mec(:,:) - - ! subgrid glacier_mec sfc elevation - real(r8), pointer :: topo_glc_mec(:,:) - !----------------------------------------------------------------------- - -end module clm_instur diff --git a/src/main/column_varcon.F90 b/src/main/column_varcon.F90 deleted file mode 100644 index 287df93b72..0000000000 --- a/src/main/column_varcon.F90 +++ /dev/null @@ -1,171 +0,0 @@ -module column_varcon - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing column indices and associated variables and routines. - ! - ! !USES: -#include "shr_assert.h" - use shr_log_mod , only : errMsg => shr_log_errMsg - use landunit_varcon, only : isturb_MIN - ! - ! !PUBLIC TYPES: - implicit none - save - private - - !------------------------------------------------------------------ - ! Initialize column type constants - !------------------------------------------------------------------ - - ! urban column types - - integer, parameter, public :: icol_roof = isturb_MIN*10 + 1 - integer, parameter, public :: icol_sunwall = isturb_MIN*10 + 2 - integer, parameter, public :: icol_shadewall = isturb_MIN*10 + 3 - integer, parameter, public :: icol_road_imperv = isturb_MIN*10 + 4 - integer, parameter, public :: icol_road_perv = isturb_MIN*10 + 5 - - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: is_hydrologically_active ! returns true if the given column type is hydrologically active - public :: icemec_class_to_col_itype ! convert an icemec class (1..maxpatch_glcmec) into col%itype - public :: col_itype_to_icemec_class ! convert col%itype into an icemec class (1..maxpatch_glcmec) - public :: write_coltype_metadata ! write column type metadata to a netcdf file - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - function is_hydrologically_active(col_itype, lun_itype) & - result(hydrologically_active) - ! - ! !DESCRIPTION: - ! Returns a logical value saying whether the given column type is hydrologically - ! active - ! - ! Note that calling this can be bad for performance, because it operates on a single - ! point rather than a loop. So in performance-critical parts of the code (or just - ! about anywhere, really), you should use the pre-set col%hydrologically_active(c). - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop - ! - ! !ARGUMENTS: - logical :: hydrologically_active ! function result - integer, intent(in) :: col_itype ! col%itype value - integer, intent(in) :: lun_itype ! lun%itype value for the landunit on which this column sits - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'is_hydrologically_active' - !----------------------------------------------------------------------- - - ! If we had an easy way to figure out which landunit a column was on based on - ! col_itype (which would be very helpful!), then we wouldn't need lun_itype. - - if (lun_itype == istsoil .or. lun_itype == istcrop) then - hydrologically_active = .true. - else if (col_itype == icol_road_perv) then - hydrologically_active = .true. - else - hydrologically_active = .false. - end if - - end function is_hydrologically_active - - - !----------------------------------------------------------------------- - function icemec_class_to_col_itype(icemec_class) result(col_itype) - ! - ! !DESCRIPTION: - ! Convert an icemec class (1..maxpatch_glcmec) into col%itype - ! - ! !USES: - use clm_varpar, only : maxpatch_glcmec - use landunit_varcon, only : istice_mec - ! - ! !ARGUMENTS: - integer :: col_itype ! function result - integer, intent(in) :: icemec_class ! icemec class, between 1 and maxpatch_glcmec - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'icemec_class_to_col_itype' - !----------------------------------------------------------------------- - - SHR_ASSERT((1 <= icemec_class .and. icemec_class <= maxpatch_glcmec), errMsg(sourcefile, __LINE__)) - - col_itype = istice_mec*100 + icemec_class - - end function icemec_class_to_col_itype - - !----------------------------------------------------------------------- - function col_itype_to_icemec_class(col_itype) result(icemec_class) - ! - ! !DESCRIPTION: - ! Convert a col%itype value (for an icemec landunit) into an icemec class (1..maxpatch_glcmec) - ! - ! !USES: - use clm_varpar, only : maxpatch_glcmec - use landunit_varcon, only : istice_mec - ! - ! !ARGUMENTS: - integer :: icemec_class ! function result - integer, intent(in) :: col_itype ! col%itype value for an icemec landunit - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'col_itype_to_icemec_class' - !----------------------------------------------------------------------- - - icemec_class = col_itype - istice_mec*100 - - ! The following assertion is here to ensure that col_itype is really from an - ! istice_mec landunit - SHR_ASSERT((1 <= icemec_class .and. icemec_class <= maxpatch_glcmec), errMsg(sourcefile, __LINE__)) - - end function col_itype_to_icemec_class - - !----------------------------------------------------------------------- - subroutine write_coltype_metadata(att_prefix, ncid) - ! - ! !DESCRIPTION: - ! Writes column type metadata to a netcdf file. - ! - ! Note that, unlike pft and landunit metadata, this column type metadata is NOT - ! stored in an array. This is because of the trickiness of encoding column values for - ! crop & icemec. So instead, other code must call this routine to do the work of - ! adding the appropriate metadata directly to a netcdf file. - ! - ! !USES: - use ncdio_pio, only : file_desc_t, ncd_global, ncd_putatt - ! - ! !ARGUMENTS: - character(len=*) , intent(in) :: att_prefix ! prefix for attributes (e.g., 'icol_') - type(file_desc_t) , intent(inout) :: ncid ! local file id - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'write_coltype_metadata' - !----------------------------------------------------------------------- - - call ncd_putatt(ncid, ncd_global, att_prefix // 'vegetated_or_bare_soil', 1) - call ncd_putatt(ncid, ncd_global, att_prefix // 'crop' , 2) - call ncd_putatt(ncid, ncd_global, att_prefix // 'crop_noncompete' , '2*100+m, m=cft_lb,cft_ub') - call ncd_putatt(ncid, ncd_global, att_prefix // 'landice' , 3) - call ncd_putatt(ncid, ncd_global, att_prefix // 'landice_multiple_elevation_classes', '4*100+m, m=1,glcnec') - call ncd_putatt(ncid, ncd_global, att_prefix // 'deep_lake' , 5) - call ncd_putatt(ncid, ncd_global, att_prefix // 'wetland' , 6) - call ncd_putatt(ncid, ncd_global, att_prefix // 'urban_roof' , icol_roof) - call ncd_putatt(ncid, ncd_global, att_prefix // 'urban_sunwall' , icol_sunwall) - call ncd_putatt(ncid, ncd_global, att_prefix // 'urban_shadewall' , icol_shadewall) - call ncd_putatt(ncid, ncd_global, att_prefix // 'urban_impervious_road' , icol_road_imperv) - call ncd_putatt(ncid, ncd_global, att_prefix // 'urban_pervious_road' , icol_road_perv) - - end subroutine write_coltype_metadata - - -end module column_varcon diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 deleted file mode 100644 index ae9c2fcafe..0000000000 --- a/src/main/controlMod.F90 +++ /dev/null @@ -1,1019 +0,0 @@ -module controlMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module which initializes run control variables. The following possible - ! namelist variables are set default values and possibly read in on startup - ! - ! Note: For definitions of namelist variables see - ! ../../bld/namelist_files/namelist_definition.xml - ! Display the file in a browser to see it neatly formatted in html. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8, SHR_KIND_CL - use shr_nl_mod , only: shr_nl_find_group_name - use shr_const_mod , only: SHR_CONST_CDAY - use shr_log_mod , only: errMsg => shr_log_errMsg - use abortutils , only: endrun - use spmdMod , only: masterproc, mpicom - use spmdMod , only: MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8 - use decompMod , only: clump_pproc - use clm_varcon , only: h2osno_max, int_snow_max, n_melt_glcmec - use clm_varpar , only: maxpatch_pft, maxpatch_glcmec, numrad, nlevsno - use histFileMod , only: max_tapes, max_namlen - use histFileMod , only: hist_empty_htapes, hist_dov2xy, hist_avgflag_pertape, hist_type1d_pertape - use histFileMod , only: hist_nhtfrq, hist_ndens, hist_mfilt, hist_fincl1, hist_fincl2, hist_fincl3 - use histFileMod , only: hist_fincl4, hist_fincl5, hist_fincl6, hist_fincl7, hist_fincl8 - use histFileMod , only: hist_fincl9, hist_fincl10 - use histFileMod , only: hist_fexcl1, hist_fexcl2, hist_fexcl3, hist_fexcl4, hist_fexcl5, hist_fexcl6 - use histFileMod , only: hist_fexcl7, hist_fexcl8, hist_fexcl9, hist_fexcl10 - use initInterpMod , only: initInterp_readnl - use LakeCon , only: deepmixing_depthcrit, deepmixing_mixfact - use CanopyfluxesMod , only: perchroot, perchroot_alt - use CanopyHydrologyMod , only: CanopyHydrology_readnl - use SurfaceResistanceMod , only: soil_resistance_readNL - use SnowHydrologyMod , only: SnowHydrology_readnl - use SurfaceAlbedoMod , only: albice, lake_melt_icealb - use UrbanParamsType , only: UrbanReadNML - use HumanIndexMod , only: HumanIndexReadNML - use CNPrecisionControlMod , only: CNPrecisionControlReadNML - use CNSharedParamsMod , only: anoxia_wtsat, use_fun - use CIsoAtmTimeseriesMod , only: use_c14_bombspike, atm_c14_filename, use_c13_timeseries, atm_c13_filename - use SoilBiogeochemCompetitionMod , only: suplnitro, suplnNon - use SoilBiogeochemLittVertTranspMod , only: som_adv_flux, max_depth_cryoturb - use SoilBiogeochemVerticalProfileMod , only: surfprof_exp - use SoilBiogeochemNitrifDenitrifMod , only: no_frozen_nitrif_denitrif, nitrifReadNML - use SoilHydrologyMod , only: soilHydReadNML - use CNFireFactoryMod , only: CNFireReadNML - use CanopyFluxesMod , only: CanopyFluxesReadNML - use seq_drydep_mod , only: drydep_method, DD_XLND, n_drydep - use clm_varctl - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: control_setNL ! Set namelist filename - public :: control_init ! initial run control information - public :: control_print ! print run control information - ! - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: apply_use_init_interp ! apply the use_init_interp namelist option, if set - ! - ! !PRIVATE TYPES: - character(len= 7) :: runtyp(4) ! run type - character(len=SHR_KIND_CL) :: NLFilename = 'lnd.stdin' ! Namelist filename - -#if (defined _OPENMP) - integer, external :: omp_get_max_threads ! max number of threads that can execute concurrently in a single parallel region -#endif - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine control_setNL( NLfile ) - ! - ! !DESCRIPTION: - ! Set the namelist filename to use - ! - ! !ARGUMENTS: - character(len=*), intent(IN) :: NLFile ! Namelist filename - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'control_setNL' ! subroutine name - logical :: lexist ! File exists - !------------------------------------------------------------------------ - - ! Error checking... - if ( len_trim(NLFile) == 0 )then - call endrun(msg=' error: nlfilename entered is not set'//errMsg(sourcefile, __LINE__)) - end if - inquire (file = trim(NLFile), exist = lexist) - if ( .not. lexist )then - call endrun(msg=' error: NLfilename entered does NOT exist:'//& - trim(NLFile)//errMsg(sourcefile, __LINE__)) - end if - if ( len_trim(NLFile) > len(NLFilename) )then - call endrun(msg=' error: entered NLFile is too long'//errMsg(sourcefile, __LINE__)) - end if - ! Set the filename - NLFilename = NLFile - NLFilename_in = NLFilename ! For use in external namelists and to avoid creating dependencies on controlMod - end subroutine control_setNL - - !------------------------------------------------------------------------ - subroutine control_init( ) - ! - ! !DESCRIPTION: - ! Initialize CLM run control information - ! - ! !USES: - use clm_time_manager , only : set_timemgr_init - use fileutils , only : getavu, relavu - use CNMRespMod , only : CNMRespReadNML - use LunaMod , only : LunaReadNML - use FrictionVelocityMod , only : FrictionVelReadNML - use CNNDynamicsMod , only : CNNDynamicsReadNML - use SoilBiogeochemDecompCascadeBGCMod, only : DecompCascadeBGCreadNML - use CNPhenologyMod , only : CNPhenologyReadNML - ! - ! !LOCAL VARIABLES: - integer :: i ! loop indices - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - integer :: dtime ! Integer time-step - integer :: override_nsrest ! If want to override the startup type sent from driver - logical :: use_init_interp ! Apply initInterp to the file given by finidat - !------------------------------------------------------------------------ - - ! ---------------------------------------------------------------------- - ! Namelist Variables - ! ---------------------------------------------------------------------- - - ! Time step - namelist / clm_inparm/ & - dtime - - ! CLM namelist settings - - namelist /clm_inparm / & - fatmlndfrc, finidat, nrevsn, & - finidat_interp_dest, & - use_init_interp - - ! Input datasets - - namelist /clm_inparm/ & - fsurdat, & - paramfile, fsnowoptics, fsnowaging - - ! History, restart options - - namelist /clm_inparm/ & - hist_empty_htapes, hist_dov2xy, & - hist_avgflag_pertape, hist_type1d_pertape, & - hist_nhtfrq, hist_ndens, hist_mfilt, & - hist_fincl1, hist_fincl2, hist_fincl3, & - hist_fincl4, hist_fincl5, hist_fincl6, & - hist_fincl7, hist_fincl8, & - hist_fincl9, hist_fincl10, & - hist_fexcl1, hist_fexcl2, hist_fexcl3, & - hist_fexcl4, hist_fexcl5, hist_fexcl6, & - hist_fexcl7, hist_fexcl8, & - hist_fexcl9, hist_fexcl10 - namelist /clm_inparm/ hist_wrtch4diag - - ! BGC info - - namelist /clm_inparm/ & - suplnitro - namelist /clm_inparm/ & - nfix_timeconst - namelist /clm_inparm/ & - spinup_state, override_bgc_restart_mismatch_dump - - namelist /clm_inparm / & - co2_type - - namelist /clm_inparm / & - perchroot, perchroot_alt - - namelist /clm_inparm / & - anoxia, anoxia_wtsat, use_fun - - namelist /clm_inparm / & - deepmixing_depthcrit, deepmixing_mixfact, lake_melt_icealb - ! lake_melt_icealb is of dimension numrad - - ! Glacier_mec info - namelist /clm_inparm/ & - maxpatch_glcmec, glc_do_dynglacier, & - glc_snow_persistence_max_days, & - nlevsno, h2osno_max, int_snow_max, n_melt_glcmec - - ! Other options - - namelist /clm_inparm/ & - clump_pproc, wrtdia, & - create_crop_landunit, nsegspc, co2_ppmv, override_nsrest, & - albice, soil_layerstruct, subgridflag, & - irrigate, run_zero_weight_urban, all_active - - ! vertical soil mixing variables - namelist /clm_inparm/ & - som_adv_flux, max_depth_cryoturb - - ! C and N input vertical profiles - namelist /clm_inparm/ & - surfprof_exp - - namelist /clm_inparm/ no_frozen_nitrif_denitrif - - namelist /clm_inparm/ use_c13, use_c14 - - - ! FATES Flags - namelist /clm_inparm/ fates_paramfile, use_fates, & - use_fates_spitfire, use_fates_logging, & - use_fates_planthydro, use_fates_ed_st3, & - use_fates_ed_prescribed_phys, & - use_fates_inventory_init, & - fates_inventory_ctrl_filename - - - ! CLM 5.0 nitrogen flags - namelist /clm_inparm/ use_flexibleCN, use_luna - - namelist /clm_nitrogen/ MM_Nuptake_opt, downreg_opt, & - plant_ndemand_opt, substrate_term_opt, nscalar_opt, temp_scalar_opt, & - CNratio_floating, lnc_opt, reduce_dayl_factor, vcmax_opt, CN_residual_opt, & - CN_partition_opt, CN_evergreen_phenology_opt, carbon_resp_opt - - namelist /clm_inparm/ use_lai_streams - - namelist /clm_inparm/ use_bedrock - - namelist /clm_inparm/ use_hydrstress - - namelist /clm_inparm/ use_dynroot - - namelist /clm_inparm/ & - use_c14_bombspike, atm_c14_filename, use_c13_timeseries, atm_c13_filename - - ! All old cpp-ifdefs are below and have been converted to namelist variables - - ! max number of plant functional types in naturally vegetated landunit - namelist /clm_inparm/ maxpatch_pft - - namelist /clm_inparm/ & - use_lch4, use_nitrif_denitrif, use_vertsoilc, use_extralakelayers, & - use_vichydro, use_century_decomp, use_cn, use_cndv, use_crop, use_fertilizer, use_ozone, & - use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & - use_nguardrail - - - ! ---------------------------------------------------------------------- - ! Default values - ! ---------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to initialize run control settings .....' - endif - - finidat_interp_dest = 'finidat_interp_dest'//trim(inst_suffix)//'.nc' - runtyp(:) = 'missing' - runtyp(nsrStartup + 1) = 'initial' - runtyp(nsrContinue + 1) = 'restart' - runtyp(nsrBranch + 1) = 'branch ' - - ! Set clumps per procoessor - -#if (defined _OPENMP) - clump_pproc = omp_get_max_threads() -#else - clump_pproc = 1 -#endif - - override_nsrest = nsrest - - use_init_interp = .false. - - if (masterproc) then - - ! ---------------------------------------------------------------------- - ! Read namelist from standard input. - ! ---------------------------------------------------------------------- - - if ( len_trim(NLFilename) == 0 )then - call endrun(msg=' error: nlfilename not set'//errMsg(sourcefile, __LINE__)) - end if - unitn = getavu() - write(iulog,*) 'Read in clm_inparm namelist from: ', trim(NLFilename) - open( unitn, file=trim(NLFilename), status='old' ) - call shr_nl_find_group_name(unitn, 'clm_inparm', status=ierr) - if (ierr == 0) then - read(unitn, clm_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg='ERROR reading clm_inparm namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding clm_inparm namelist'//errMsg(sourcefile, __LINE__)) - end if - call shr_nl_find_group_name(unitn, 'clm_nitrogen', status=ierr) - if (ierr == 0) then - read(unitn, clm_nitrogen, iostat=ierr) - if (ierr /= 0) then - call endrun(msg='ERROR reading clm_nitrogen namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding clm_nitrogen namelist'//errMsg(sourcefile, __LINE__)) - end if - - call relavu( unitn ) - - ! ---------------------------------------------------------------------- - ! Process some namelist variables, and perform consistency checks - ! ---------------------------------------------------------------------- - - call set_timemgr_init( dtime_in=dtime ) - - if (use_init_interp) then - call apply_use_init_interp(finidat, finidat_interp_source) - end if - - ! History and restart files - - do i = 1, max_tapes - if (hist_nhtfrq(i) < 0) then - hist_nhtfrq(i) = nint(-hist_nhtfrq(i)*SHR_CONST_CDAY/(24._r8*dtime)) - endif - end do - - ! Override start-type (can only override to branch (3) and only - ! if the driver is a startup type - if ( override_nsrest /= nsrest )then - if ( override_nsrest /= nsrBranch .and. nsrest /= nsrStartup )then - call endrun(msg= ' ERROR: can ONLY override clm start-type ' // & - 'to branch type and ONLY if driver is a startup type'// & - errMsg(sourcefile, __LINE__)) - end if - call clm_varctl_set( nsrest_in=override_nsrest ) - end if - - if (maxpatch_glcmec <= 0) then - call endrun(msg=' ERROR: maxpatch_glcmec must be at least 1 ' // & - errMsg(sourcefile, __LINE__)) - end if - - if (use_crop .and. .not. create_crop_landunit) then - call endrun(msg=' ERROR: prognostic crop Patches require create_crop_landunit=.true.'//& - errMsg(sourcefile, __LINE__)) - end if - - if (use_lch4 .and. use_vertsoilc) then - anoxia = .true. - else - anoxia = .false. - end if - - ! ---------------------------------------------------------------------- - ! Check compatibility with the FATES model - if ( use_fates ) then - - if ( use_cn) then - call endrun(msg=' ERROR: use_cn and use_fates cannot both be set to true.'//& - errMsg(sourcefile, __LINE__)) - end if - - if ( use_hydrstress) then - call endrun(msg=' ERROR: use_hydrstress and use_fates cannot both be set to true.'//& - errMsg(sourcefile, __LINE__)) - end if - - if ( use_crop ) then - call endrun(msg=' ERROR: use_crop and use_fates cannot both be set to true.'//& - errMsg(sourcefile, __LINE__)) - end if - - if( use_lch4 ) then - call endrun(msg=' ERROR: use_lch4 (methane) and use_fates cannot both be set to true.'//& - errMsg(sourcefile, __LINE__)) - end if - - if ( n_drydep > 0 .and. drydep_method /= DD_XLND ) then - call endrun(msg=' ERROR: dry deposition via ML Welsey is not compatible with FATES.'//& - errMsg(sourcefile, __LINE__)) - end if - - if( use_luna ) then - call endrun(msg=' ERROR: luna is not compatible with FATES.'//& - errMsg(sourcefile, __LINE__)) - end if - - if (use_ozone ) then - call endrun(msg=' ERROR: ozone is not compatible with FATES.'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - ! If nfix_timeconst is equal to the junk default value, then it was not specified - ! by the user namelist and we need to assign it the correct default value. If the - ! user specified it in the namelist, we leave it alone. - - if (nfix_timeconst == -1.2345_r8) then - if (use_nitrif_denitrif) then - nfix_timeconst = 10._r8 - else - nfix_timeconst = 0._r8 - end if - end if - - ! If nlevsno, h2osno_max, int_snow_max or n_melt_glcmec are equal to their junk - ! default value, then they were not specified by the user namelist and we generate - ! an error message. Also check nlevsno for bounds. - if (nlevsno < 3 .or. nlevsno > 12) then - write(iulog,*)'ERROR: nlevsno = ',nlevsno,' is not supported, must be in range 3-12.' - call endrun(msg=' ERROR: invalid value for nlevsno in CLM namelist. '//& - errMsg(sourcefile, __LINE__)) - endif - if (h2osno_max <= 0.0_r8) then - write(iulog,*)'ERROR: h2osno_max = ',h2osno_max,' is not supported, must be greater than 0.0.' - call endrun(msg=' ERROR: invalid value for h2osno_max in CLM namelist. '//& - errMsg(sourcefile, __LINE__)) - endif - if (int_snow_max <= 0.0_r8) then - write(iulog,*)'ERROR: int_snow_max = ',int_snow_max,' is not supported, must be greater than 0.0.' - call endrun(msg=' ERROR: invalid value for int_snow_max in CLM namelist. '//& - errMsg(sourcefile, __LINE__)) - endif - if (n_melt_glcmec <= 0.0_r8) then - write(iulog,*)'ERROR: n_melt_glcmec = ',n_melt_glcmec,' is not supported, must be greater than 0.0.' - call endrun(msg=' ERROR: invalid value for n_melt_glcmec in CLM namelist. '//& - errMsg(sourcefile, __LINE__)) - endif - - endif ! end of if-masterproc if-block - - ! ---------------------------------------------------------------------- - ! Read in other namelists for other modules - ! ---------------------------------------------------------------------- - - call mpi_bcast (use_init_interp, 1, MPI_LOGICAL, 0, mpicom, ierr) - if (use_init_interp) then - call initInterp_readnl( NLFilename ) - end if - - !I call init_hydrology to set up default hydrology sub-module methods. - !For future version, I suggest to put the following two calls inside their - !own modules, which are called from their own initializing methods - call init_hydrology( NLFilename ) - - call soil_resistance_readnl ( NLFilename ) - call CanopyFluxesReadNML ( NLFilename ) - call CanopyHydrology_readnl ( NLFilename ) - call SnowHydrology_readnl ( NLFilename ) - call UrbanReadNML ( NLFilename ) - call HumanIndexReadNML ( NLFilename ) - call LunaReadNML ( NLFilename ) - call FrictionVelReadNML ( NLFilename ) - - ! ---------------------------------------------------------------------- - ! Broadcast all control information if appropriate - ! ---------------------------------------------------------------------- - - call control_spmd() - - ! ---------------------------------------------------------------------- - ! Read in other namelists that are dependent on other namelist setttings - ! ---------------------------------------------------------------------- - - if ( use_fun ) then - call CNMRespReadNML( NLFilename ) - end if - - call soilHydReadNML( NLFilename ) - if ( use_cn ) then - call nitrifReadNML( NLFilename ) - call CNFireReadNML( NLFilename ) - call CNPrecisionControlReadNML( NLFilename ) - call CNNDynamicsReadNML ( NLFilename ) - call CNPhenologyReadNML ( NLFilename ) - end if - if ( use_century_decomp ) then - call DecompCascadeBGCreadNML( NLFilename ) - end if - - ! ---------------------------------------------------------------------- - ! consistency checks - ! ---------------------------------------------------------------------- - - ! Consistency settings for co2 type - if (co2_type /= 'constant' .and. co2_type /= 'prognostic' .and. co2_type /= 'diagnostic') then - write(iulog,*)'co2_type = ',co2_type,' is not supported' - call endrun(msg=' ERROR:: choices are constant, prognostic or diagnostic'//& - errMsg(sourcefile, __LINE__)) - end if - - if ( use_dynroot .and. use_hydrstress ) then - call endrun(msg=' ERROR:: dynroot and hydrstress can NOT be on at the same time'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Check on run type - if (nsrest == iundef) then - call endrun(msg=' ERROR:: must set nsrest'//& - errMsg(sourcefile, __LINE__)) - end if - if (nsrest == nsrBranch .and. nrevsn == ' ') then - call endrun(msg=' ERROR: need to set restart data file name'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Consistency settings for co2_ppvm - if ( (co2_ppmv <= 0.0_r8) .or. (co2_ppmv > 3000.0_r8) ) then - call endrun(msg=' ERROR: co2_ppmv is out of a reasonable range'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Consistency settings for nrevsn - - if (nsrest == nsrStartup ) nrevsn = ' ' - if (nsrest == nsrContinue) nrevsn = 'set by restart pointer file file' - if (nsrest /= nsrStartup .and. nsrest /= nsrContinue .and. nsrest /= nsrBranch ) then - call endrun(msg=' ERROR: nsrest NOT set to a valid value'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Single Column - if ( single_column .and. (scmlat == rundef .or. scmlon == rundef ) ) then - call endrun(msg=' ERROR:: single column mode on -- but scmlat and scmlon are NOT set'//& - errMsg(sourcefile, __LINE__)) - if (.not. use_lch4 .and. anoxia) then - call endrun(msg='ERROR:: anoxia is turned on, but this currently requires turning on the CH4 submodel'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - if (masterproc) then - write(iulog,*) 'Successfully initialized run control settings' - write(iulog,*) - endif - - end subroutine control_init - - !------------------------------------------------------------------------ - subroutine control_spmd() - ! - ! !DESCRIPTION: - ! Distribute namelist data all processors. All program i/o is - ! funnelled through the master processor. Processor 0 either - ! reads restart/history data from the disk and distributes - ! it to all processors, or collects data from - ! all processors and writes it to disk. - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer ier !error code - !----------------------------------------------------------------------- - - ! run control variables - call mpi_bcast (caseid, len(caseid), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (ctitle, len(ctitle), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (version, len(version), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hostname, len(hostname), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (username, len(username), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (nsrest, 1, MPI_INTEGER, 0, mpicom, ier) - - call mpi_bcast (use_lch4, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_nitrif_denitrif, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_vertsoilc, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_extralakelayers, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_vichydro, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_century_decomp, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_cn, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_cndv, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_nguardrail, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_crop, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fertilizer, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_grainproduct, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_ozone, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_snicar_frc, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_vancouver, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_mexicocity, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_noio, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! initial file variables - call mpi_bcast (nrevsn, len(nrevsn), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (finidat, len(finidat), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (finidat_interp_source, len(finidat_interp_source), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (finidat_interp_dest, len(finidat_interp_dest), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsurdat, len(fsurdat), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fatmlndfrc,len(fatmlndfrc),MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (paramfile, len(paramfile) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsnowaging, len(fsnowaging), MPI_CHARACTER, 0, mpicom, ier) - - ! Irrigation - call mpi_bcast(irrigate, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! Landunit generation - call mpi_bcast(create_crop_landunit, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! Other subgrid logic - call mpi_bcast(run_zero_weight_urban, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast(all_active, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! max number of plant functional types in naturally vegetated landunit - call mpi_bcast(maxpatch_pft, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! BGC - call mpi_bcast (co2_type, len(co2_type), MPI_CHARACTER, 0, mpicom, ier) - if (use_cn) then - call mpi_bcast (suplnitro, len(suplnitro), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (nfix_timeconst, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (spinup_state, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (override_bgc_restart_mismatch_dump, 1, MPI_LOGICAL, 0, mpicom, ier) - end if - - ! isotopes - call mpi_bcast (use_c13, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_c14, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_fates, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_fates_spitfire, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fates_logging, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fates_ed_st3, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fates_ed_prescribed_phys, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_fates_inventory_init, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) - - ! flexibleCN nitrogen model - call mpi_bcast (use_flexibleCN, 1, MPI_LOGICAL, 0, mpicom, ier) - ! TODO(bja, 2015-08) need to move some of these into a module with limited scope. - call mpi_bcast (MM_Nuptake_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (downreg_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (plant_ndemand_opt, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (substrate_term_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (nscalar_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (temp_scalar_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (CNratio_floating, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (lnc_opt, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (reduce_dayl_factor, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (vcmax_opt, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (CN_residual_opt, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (CN_partition_opt, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (CN_evergreen_phenology_opt, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (carbon_resp_opt, 1, MPI_INTEGER, 0, mpicom, ier) - - call mpi_bcast (use_luna, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_lai_streams, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_bedrock, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_hydrstress, 1, MPI_LOGICAL, 0, mpicom, ier) - - call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier) - - if (use_cn .and. use_vertsoilc) then - ! vertical soil mixing variables - call mpi_bcast (som_adv_flux, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (max_depth_cryoturb, 1, MPI_REAL8, 0, mpicom, ier) - - ! C and N input vertical profiles - call mpi_bcast (surfprof_exp, 1, MPI_REAL8, 0, mpicom, ier) - end if - - if (use_cn .and. use_nitrif_denitrif) then - call mpi_bcast (no_frozen_nitrif_denitrif, 1, MPI_LOGICAL, 0, mpicom, ier) - end if - - if (use_cn) then - call mpi_bcast (use_c14_bombspike, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (atm_c14_filename, len(atm_c14_filename), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (use_c13_timeseries, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (atm_c13_filename, len(atm_c13_filename), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (use_fun, 1, MPI_LOGICAL, 0, mpicom, ier) - end if - - call mpi_bcast (perchroot, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (perchroot_alt, 1, MPI_LOGICAL, 0, mpicom, ier) - if (use_lch4) then - call mpi_bcast (anoxia, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (anoxia_wtsat, 1, MPI_LOGICAL, 0, mpicom, ier) - end if - - ! lakes - call mpi_bcast (deepmixing_depthcrit, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (deepmixing_mixfact, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (lake_melt_icealb, numrad, MPI_REAL8, 0, mpicom, ier) - - ! physics variables - call mpi_bcast (nsegspc, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (subgridflag , 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (wrtdia, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (single_column,1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (scmlat, 1, MPI_REAL8,0, mpicom, ier) - call mpi_bcast (scmlon, 1, MPI_REAL8,0, mpicom, ier) - call mpi_bcast (co2_ppmv, 1, MPI_REAL8,0, mpicom, ier) - call mpi_bcast (albice, 2, MPI_REAL8,0, mpicom, ier) - call mpi_bcast (soil_layerstruct,len(soil_layerstruct), MPI_CHARACTER, 0, mpicom, ier) - - ! snow pack variables - call mpi_bcast (nlevsno, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (h2osno_max, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (int_snow_max, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (n_melt_glcmec, 1, MPI_REAL8, 0, mpicom, ier) - - ! glacier_mec variables - call mpi_bcast (maxpatch_glcmec, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (glc_do_dynglacier, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (glc_snow_persistence_max_days, 1, MPI_INTEGER, 0, mpicom, ier) - - ! history file variables - call mpi_bcast (hist_empty_htapes, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (hist_dov2xy, size(hist_dov2xy), MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (hist_nhtfrq, size(hist_nhtfrq), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_mfilt, size(hist_mfilt), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_ndens, size(hist_ndens), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_avgflag_pertape, size(hist_avgflag_pertape), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_type1d_pertape, max_namlen*size(hist_type1d_pertape), MPI_CHARACTER, 0, mpicom, ier) - if (use_lch4) then - call mpi_bcast (hist_wrtch4diag, 1, MPI_LOGICAL, 0, mpicom, ier) - end if - call mpi_bcast (hist_fexcl1, max_namlen*size(hist_fexcl1), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl2, max_namlen*size(hist_fexcl2), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl3, max_namlen*size(hist_fexcl3), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl4, max_namlen*size(hist_fexcl4), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl5, max_namlen*size(hist_fexcl5), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl6, max_namlen*size(hist_fexcl6), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl7, max_namlen*size(hist_fexcl7), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl8, max_namlen*size(hist_fexcl8), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl9, max_namlen*size(hist_fexcl9), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl10,max_namlen*size(hist_fexcl10),MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl1, (max_namlen+2)*size(hist_fincl1), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl2, (max_namlen+2)*size(hist_fincl2), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl3, (max_namlen+2)*size(hist_fincl3), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl4, (max_namlen+2)*size(hist_fincl4), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl5, (max_namlen+2)*size(hist_fincl5), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl6, (max_namlen+2)*size(hist_fincl6), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl7, (max_namlen+2)*size(hist_fincl7), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl8, (max_namlen+2)*size(hist_fincl8), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl9, (max_namlen+2)*size(hist_fincl9), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl10,(max_namlen+2)*size(hist_fincl10),MPI_CHARACTER, 0, mpicom, ier) - - ! restart file variables - - call mpi_bcast (rpntfil, len(rpntfil), MPI_CHARACTER, 0, mpicom, ier) - - ! clump decomposition variables - - call mpi_bcast (clump_pproc, 1, MPI_INTEGER, 0, mpicom, ier) - - end subroutine control_spmd - - !------------------------------------------------------------------------ - subroutine control_print () - ! - ! !DESCRIPTION: - ! Write out the clm namelist run control variables - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer i !loop index - !------------------------------------------------------------------------ - - write(iulog,*) 'define run:' - write(iulog,*) ' source = ',trim(source) - write(iulog,*) ' model_version = ',trim(version) - write(iulog,*) ' run type = ',runtyp(nsrest+1) - write(iulog,*) ' case title = ',trim(ctitle) - write(iulog,*) ' username = ',trim(username) - write(iulog,*) ' hostname = ',trim(hostname) - write(iulog,*) 'process control parameters:' - write(iulog,*) ' use_lch4 = ', use_lch4 - write(iulog,*) ' use_nitrif_denitrif = ', use_nitrif_denitrif - write(iulog,*) ' use_vertsoilc = ', use_vertsoilc - write(iulog,*) ' use_extralakelayers = ', use_extralakelayers - write(iulog,*) ' use_vichydro = ', use_vichydro - write(iulog,*) ' use_century_decomp = ', use_century_decomp - write(iulog,*) ' use_cn = ', use_cn - write(iulog,*) ' use_cndv = ', use_cndv - write(iulog,*) ' use_crop = ', use_crop - write(iulog,*) ' use_fertilizer = ', use_fertilizer - write(iulog,*) ' use_grainproduct = ', use_grainproduct - write(iulog,*) ' use_ozone = ', use_ozone - write(iulog,*) ' use_snicar_frc = ', use_snicar_frc - write(iulog,*) ' use_vancouver = ', use_vancouver - write(iulog,*) ' use_mexicocity = ', use_mexicocity - write(iulog,*) ' use_noio = ', use_noio - - write(iulog,*) 'input data files:' - write(iulog,*) ' PFT physiology and parameters file = ',trim(paramfile) - if (fsurdat == ' ') then - write(iulog,*) ' fsurdat, surface dataset not set' - else - write(iulog,*) ' surface data = ',trim(fsurdat) - end if - if (fatmlndfrc == ' ') then - write(iulog,*) ' fatmlndfrc not set, setting frac/mask to 1' - else - write(iulog,*) ' land frac data = ',trim(fatmlndfrc) - end if - if (use_cn) then - if (suplnitro /= suplnNon)then - write(iulog,*) ' Supplemental Nitrogen mode is set to run over Patches: ', & - trim(suplnitro) - end if - - if (nfix_timeconst /= 0._r8) then - write(iulog,*) ' nfix_timeconst, timescale for smoothing npp in N fixation term: ', nfix_timeconst - else - write(iulog,*) ' nfix_timeconst == zero, use standard N fixation scheme. ' - end if - - write(iulog,*) ' spinup_state, (0 = normal mode; 1 = AD spinup; 2 AAD) : ', spinup_state - if ( spinup_state .eq. 0 ) then - write(iulog,*) ' model is currently NOT in AD spinup mode.' - else if ( spinup_state .eq. 1 ) then - write(iulog,*) ' model is currently in AD spinup mode.' - else if ( spinup_state .eq. 2 ) then - write(iulog,*) ' model is currently in accelerated AD spinup mode.' - else - call endrun(msg=' error: spinup_state can only have integer value of 0 or 1 or 2'//& - errMsg(sourcefile, __LINE__)) - end if - - if ( use_fun ) then - write(iulog,*) ' Fixation and Uptake of Nitrogen Model Version 2 (FUN2) is turned on for Nitrogen Competition' - end if - - write(iulog,*) ' override_bgc_restart_mismatch_dump : ', override_bgc_restart_mismatch_dump - end if - - if (use_cn .and. use_vertsoilc) then - write(iulog, *) ' som_adv_flux, the advection term in soil mixing (m/s) : ', som_adv_flux - write(iulog, *) ' max_depth_cryoturb (m) : ', max_depth_cryoturb - write(iulog, *) ' surfprof_exp : ', surfprof_exp - end if - - if (use_cn .and. .not. use_nitrif_denitrif) then - write(iulog, *) ' no_frozen_nitrif_denitrif : ', no_frozen_nitrif_denitrif - end if - - if (use_cn) then - write(iulog, *) ' use_c13 : ', use_c13 - write(iulog, *) ' use_c13_timeseries : ', use_c13_timeseries - write(iulog, *) ' atm_c13_filename : ', atm_c13_filename - write(iulog, *) ' use_c14 : ', use_c14 - write(iulog, *) ' use_c14_bombspike : ', use_c14_bombspike - write(iulog, *) ' atm_c14_filename : ', atm_c14_filename - end if - - if (fsnowoptics == ' ') then - write(iulog,*) ' snow optical properties file NOT set' - else - write(iulog,*) ' snow optical properties file = ',trim(fsnowoptics) - endif - if (fsnowaging == ' ') then - write(iulog,*) ' snow aging parameters file NOT set' - else - write(iulog,*) ' snow aging parameters file = ',trim(fsnowaging) - endif - - write(iulog,*) ' Number of snow layers =', nlevsno - write(iulog,*) ' Max snow depth (mm) =', h2osno_max - write(iulog,*) ' Limit applied to integrated snowfall when determining changes in' - write(iulog,*) ' snow-covered fraction during melt (mm) =', int_snow_max - write(iulog,*) ' SCA shape parameter for glc_mec columns (n_melt_glcmec) =', n_melt_glcmec - - write(iulog,*) ' glc number of elevation classes =', maxpatch_glcmec - if (glc_do_dynglacier) then - write(iulog,*) ' glc CLM glacier areas and topography WILL evolve dynamically' - else - write(iulog,*) ' glc CLM glacier areas and topography will NOT evolve dynamically' - end if - write(iulog,*) ' glc snow persistence max days = ', glc_snow_persistence_max_days - - if (nsrest == nsrStartup) then - if (finidat /= ' ') then - write(iulog,*) ' initial data: ', trim(finidat) - else if (finidat_interp_source /= ' ') then - write(iulog,*) ' initial data interpolated from: ', trim(finidat_interp_source) - else - write(iulog,*) ' initial data created by model (cold start)' - end if - else - write(iulog,*) ' restart data = ',trim(nrevsn) - end if - - write(iulog,*) ' atmospheric forcing data is from cesm atm model' - write(iulog,*) 'Restart parameters:' - write(iulog,*)' restart pointer file directory = ',trim(rpntdir) - write(iulog,*)' restart pointer file name = ',trim(rpntfil) - write(iulog,*) 'model physics parameters:' - - if ( trim(co2_type) == 'constant' )then - write(iulog,*) ' CO2 volume mixing ratio (umol/mol) = ', co2_ppmv - else - write(iulog,*) ' CO2 volume mixing ratio = ', co2_type - end if - - write(iulog,*) ' land-ice albedos (unitless 0-1) = ', albice - write(iulog,*) ' soil layer structure = ', soil_layerstruct - write(iulog,*) ' plant hydraulic stress = ', use_hydrstress - write(iulog,*) ' dynamic roots = ', use_dynroot - if (nsrest == nsrContinue) then - write(iulog,*) 'restart warning:' - write(iulog,*) ' Namelist not checked for agreement with initial run.' - write(iulog,*) ' Namelist should not differ except for ending time step and run type' - end if - if (nsrest == nsrBranch) then - write(iulog,*) 'branch warning:' - write(iulog,*) ' Namelist not checked for agreement with initial run.' - write(iulog,*) ' Surface data set and reference date should not differ from initial run' - end if - write(iulog,*) ' maxpatch_pft = ',maxpatch_pft - write(iulog,*) ' nsegspc = ',nsegspc - ! New fields - write(iulog,*) ' perchroot (plant water stress based on unfrozen layers only) = ',perchroot - write(iulog,*) ' perchroot (plant water stress based on time-integrated active layer only) = ',perchroot - if (use_lch4) then - write(iulog,*) ' anoxia (applied to soil decomposition) = ',anoxia - write(iulog,*) ' anoxia_wtsat (weight anoxia by inundated fraction) = ',anoxia_wtsat - end if - ! Lakes - write(iulog,*) - write(iulog,*) 'Lake Model Namelists:' - write(iulog,*) 'Increased mixing relative to Hostetler wind-driven eddy expression ',& - 'will be used for deep lakes exceeding depth ', deepmixing_depthcrit,& - ' by a factor of ', deepmixing_mixfact, '.' - write(iulog,*) 'Albedo over melting lakes will approach values (visible, NIR):', lake_melt_icealb, & - 'as compared with 0.60, 0.40 for cold frozen lakes with no snow.' - - write(iulog, *) 'plant nitrogen model namelists:' - write(iulog, *) ' use_flexibleCN = ', use_flexibleCN - if (use_flexibleCN) then - write(iulog, *) ' MM_Nuptake_opt = ', MM_Nuptake_opt - write(iulog, *) ' downreg_opt = ', downreg_opt - write(iulog, *) ' plant_ndemand_opt = ', plant_ndemand_opt - write(iulog, *) ' substrate_term_opt = ', substrate_term_opt - write(iulog, *) ' nscalar_opt = ', nscalar_opt - write(iulog, *) ' temp_scalar_opt = ', temp_scalar_opt - write(iulog, *) ' CNratio_floating = ', CNratio_floating - write(iulog, *) ' lnc_opt = ', lnc_opt - write(iulog, *) ' reduce_dayl_factor = ', reduce_dayl_factor - write(iulog, *) ' vcmax_opt = ', vcmax_opt - write(iulog, *) ' CN_residual_opt = ', CN_residual_opt - write(iulog, *) ' CN_partition_opt = ', CN_partition_opt - write(iulog, *) ' CN_evergreen_phenology_opt = ', CN_evergreen_phenology_opt - write(iulog, *) ' carbon_resp_opt = ', carbon_resp_opt - end if - write(iulog, *) ' use_luna = ', use_luna - - write(iulog, *) ' ED/FATES: ' - write(iulog, *) ' use_fates = ', use_fates - if (use_fates) then - write(iulog, *) ' use_fates_spitfire = ', use_fates_spitfire - write(iulog, *) ' use_fates_logging = ', use_fates_logging - write(iulog, *) ' fates_paramfile = ', fates_paramfile - write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro - write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3 - write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys - write(iulog, *) ' use_fates_inventory_init = ',use_fates_inventory_init - write(iulog, *) ' fates_inventory_ctrl_filename = ',fates_inventory_ctrl_filename - end if - end subroutine control_print - - - !----------------------------------------------------------------------- - subroutine apply_use_init_interp(finidat, finidat_interp_source) - ! - ! !DESCRIPTION: - ! Applies the use_init_interp option, setting finidat_interp_source to finidat - ! - ! Should be called if use_init_interp is true. - ! - ! Does error checking to ensure that it is valid to set use_init_interp to true, - ! given the values of finidat and finidat_interp_source. - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=*), intent(inout) :: finidat - character(len=*), intent(inout) :: finidat_interp_source - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'apply_use_init_interp' - !----------------------------------------------------------------------- - - if (finidat == ' ') then - call endrun(msg=' ERROR: Can only set use_init_interp if finidat is set') - end if - - if (finidat_interp_source /= ' ') then - call endrun(msg=' ERROR: Cannot set use_init_interp if finidat_interp_source is & - &already set') - end if - - finidat_interp_source = finidat - finidat = ' ' - - end subroutine apply_use_init_interp - - - -end module controlMod diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90 deleted file mode 100644 index 709c0b5e36..0000000000 --- a/src/main/decompInitMod.F90 +++ /dev/null @@ -1,888 +0,0 @@ -module decompInitMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Module provides a descomposition into a clumped data structure which can - ! be mapped back to atmosphere physics chunks. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc, iam, npes, mpicom, comp_id - use abortutils , only : endrun - use clm_varctl , only : iulog, use_fates - use clm_varcon , only : grlnd - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use glcBehaviorMod , only : glc_behavior_type - use decompMod - use mct_mod , only : mct_gsMap_init, mct_gsMap_ngseg, mct_gsMap_nlseg, mct_gsmap_gsize - use FatesInterfaceMod, only : fates_maxElementsPerSite - ! - ! !PUBLIC TYPES: - implicit none - ! - ! !PUBLIC MEMBER FUNCTIONS: - public decompInit_lnd ! initializes lnd grid decomposition into clumps and processors - public decompInit_clumps ! initializes atm grid decomposition into clumps - public decompInit_glcp ! initializes g,l,c,p decomp info - ! - ! !PRIVATE TYPES: - private - integer, pointer :: lcid(:) ! temporary for setting ldecomp - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------------ - subroutine decompInit_lnd(lni,lnj,amask) - ! - ! !DESCRIPTION: - ! This subroutine initializes the land surface decomposition into a clump - ! data structure. This assumes each pe has the same number of clumps - ! set by clump_pproc - ! - ! !USES: - use clm_varctl, only : nsegspc - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: amask(:) - integer , intent(in) :: lni,lnj ! domain global size - ! - ! !LOCAL VARIABLES: - integer :: lns ! global domain size - integer :: ln,lj ! indices - integer :: ag,an,ai,aj ! indices - integer :: numg ! number of land gridcells - logical :: seglen1 ! is segment length one - real(r8):: seglen ! average segment length - real(r8):: rcid ! real value of cid - integer :: cid,pid ! indices - integer :: n,m,ng ! indices - integer :: ier ! error code - integer :: beg,end,lsize,gsize ! used for gsmap init - integer, pointer :: gindex(:) ! global index for gsmap init - integer, pointer :: clumpcnt(:) ! clump index counter - !------------------------------------------------------------------------------ - - lns = lni * lnj - - !--- set and verify nclumps --- - if (clump_pproc > 0) then - nclumps = clump_pproc * npes - if (nclumps < npes) then - write(iulog,*) 'decompInit_lnd(): Number of gridcell clumps= ',nclumps, & - ' is less than the number of processes = ', npes - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - else - write(iulog,*)'clump_pproc= ',clump_pproc,' must be greater than 0' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! allocate and initialize procinfo and clumps - ! beg and end indices initialized for simple addition of cells later - - allocate(procinfo%cid(clump_pproc), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error for procinfo%cid' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - procinfo%nclumps = clump_pproc - procinfo%cid(:) = -1 - procinfo%ncells = 0 - procinfo%nlunits = 0 - procinfo%ncols = 0 - procinfo%npatches = 0 - procinfo%nCohorts = 0 - procinfo%begg = 1 - procinfo%begl = 1 - procinfo%begc = 1 - procinfo%begp = 1 - procinfo%begCohort = 1 - procinfo%endg = 0 - procinfo%endl = 0 - procinfo%endc = 0 - procinfo%endp = 0 - procinfo%endCohort = 0 - - allocate(clumps(nclumps), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error for clumps' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - clumps(:)%owner = -1 - clumps(:)%ncells = 0 - clumps(:)%nlunits = 0 - clumps(:)%ncols = 0 - clumps(:)%npatches = 0 - clumps(:)%nCohorts = 0 - clumps(:)%begg = 1 - clumps(:)%begl = 1 - clumps(:)%begc = 1 - clumps(:)%begp = 1 - clumps(:)%begCohort = 1 - clumps(:)%endg = 0 - clumps(:)%endl = 0 - clumps(:)%endc = 0 - clumps(:)%endp = 0 - clumps(:)%endCohort = 0 - - ! assign clumps to proc round robin - cid = 0 - do n = 1,nclumps - pid = mod(n-1,npes) - if (pid < 0 .or. pid > npes-1) then - write(iulog,*) 'decompInit_lnd(): round robin pid error ',n,pid,npes - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - clumps(n)%owner = pid - if (iam == pid) then - cid = cid + 1 - if (cid < 1 .or. cid > clump_pproc) then - write(iulog,*) 'decompInit_lnd(): round robin pid error ',n,pid,npes - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - procinfo%cid(cid) = n - endif - enddo - - ! count total land gridcells - numg = 0 - do ln = 1,lns - if (amask(ln) == 1) then - numg = numg + 1 - endif - enddo - - if (npes > numg) then - write(iulog,*) 'decompInit_lnd(): Number of processes exceeds number ', & - 'of land grid cells',npes,numg - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (nclumps > numg) then - write(iulog,*) 'decompInit_lnd(): Number of clumps exceeds number ', & - 'of land grid cells',nclumps,numg - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (float(numg)/float(nclumps) < float(nsegspc)) then - seglen1 = .true. - seglen = 1.0_r8 - else - seglen1 = .false. - seglen = dble(numg)/(dble(nsegspc)*dble(nclumps)) - endif - - if (masterproc) then - write(iulog,*) ' decomp precompute numg,nclumps,seglen1,avg_seglen,nsegspc=', & - numg,nclumps,seglen1,& - sngl(seglen),sngl(dble(numg)/(seglen*dble(nclumps))) - end if - - ! Assign gridcells to clumps (and thus pes) --- - - allocate(lcid(lns)) - lcid(:) = 0 - ng = 0 - do ln = 1,lns - if (amask(ln) == 1) then - ng = ng + 1 - - !--- give to clumps in order based on nsegspc - if (seglen1) then - cid = mod(ng-1,nclumps) + 1 - else - rcid = (dble(ng-1)/dble(numg))*dble(nsegspc)*dble(nclumps) - cid = mod(int(rcid),nclumps) + 1 - endif - lcid(ln) = cid - - !--- give gridcell cell to pe that owns cid --- - !--- this needs to be done to subsequently use function - !--- get_proc_bounds(begg,endg) - if (iam == clumps(cid)%owner) then - procinfo%ncells = procinfo%ncells + 1 - endif - if (iam > clumps(cid)%owner) then - procinfo%begg = procinfo%begg + 1 - endif - if (iam >= clumps(cid)%owner) then - procinfo%endg = procinfo%endg + 1 - endif - - !--- give gridcell to cid --- - !--- increment the beg and end indices --- - clumps(cid)%ncells = clumps(cid)%ncells + 1 - do m = 1,nclumps - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m > cid)) then - clumps(m)%begg = clumps(m)%begg + 1 - endif - - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m >= cid)) then - clumps(m)%endg = clumps(m)%endg + 1 - endif - enddo - - end if - enddo - - ! Set ldecomp - - allocate(ldecomp%gdc2glo(numg), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error1 for ldecomp, etc' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - allocate(clumpcnt(nclumps),stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error1 for clumpcnt' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ldecomp%gdc2glo(:) = 0 - ag = 0 - - ! clumpcnt is the start gdc index of each clump - - clumpcnt = 0 - ag = 1 - do pid = 0,npes-1 - do cid = 1,nclumps - if (clumps(cid)%owner == pid) then - clumpcnt(cid) = ag - ag = ag + clumps(cid)%ncells - endif - enddo - enddo - - ! now go through gridcells one at a time and increment clumpcnt - ! in order to set gdc2glo - - do aj = 1,lnj - do ai = 1,lni - an = (aj-1)*lni + ai - cid = lcid(an) - if (cid > 0) then - ag = clumpcnt(cid) - ldecomp%gdc2glo(ag) = an - clumpcnt(cid) = clumpcnt(cid) + 1 - end if - end do - end do - - deallocate(clumpcnt) - - ! Set gsMap_lnd_gdc2glo (the global index here includes mask=0 or ocean points) - - call get_proc_bounds(beg, end) - allocate(gindex(beg:end)) - do n = beg,end - gindex(n) = ldecomp%gdc2glo(n) - enddo - lsize = end-beg+1 - gsize = lni * lnj - call mct_gsMap_init(gsMap_lnd_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) - deallocate(gindex) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' Surface Grid Characteristics' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' total number of land gridcells = ',numg - write(iulog,*)' Decomposition Characteristics' - write(iulog,*)' clumps per process = ',clump_pproc - write(iulog,*)' gsMap Characteristics' - write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo) - write(iulog,*) - end if - - call shr_sys_flush(iulog) - - end subroutine decompInit_lnd - - !------------------------------------------------------------------------------ - subroutine decompInit_clumps(lns,lni,lnj,glc_behavior) - ! - ! !DESCRIPTION: - ! This subroutine initializes the land surface decomposition into a clump - ! data structure. This assumes each pe has the same number of clumps - ! set by clump_pproc - ! - ! !USES: - use subgridMod, only : subgrid_get_gcellinfo - use spmdMod - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: lns,lni,lnj ! land domain global size - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: ln,an ! indices - integer :: i,g,l,k ! indices - integer :: cid,pid ! indices - integer :: n,m,np ! indices - integer :: anumg ! lnd num gridcells - integer :: icells ! temporary - integer :: begg, endg ! temporary - integer :: ilunits ! temporary - integer :: icols ! temporary - integer :: ipatches ! temporary - integer :: icohorts ! temporary - integer :: ier ! error code - integer, allocatable :: allvecg(:,:) ! temporary vector "global" - integer, allocatable :: allvecl(:,:) ! temporary vector "local" - integer :: ntest - character(len=32), parameter :: subname = 'decompInit_clumps' - !------------------------------------------------------------------------------ - - !--- assign gridcells to clumps (and thus pes) --- - call get_proc_bounds(begg, endg) - - allocate(allvecl(nclumps,5)) ! local clumps [gcells,lunit,cols,patches,coh] - allocate(allvecg(nclumps,5)) ! global clumps [gcells,lunit,cols,patches,coh] - - ! Determine the number of gridcells, landunits, columns, and patches, cohorts - ! on this processor - ! Determine number of landunits, columns and patches for each global - ! gridcell index (an) that is associated with the local gridcell index (ln) - - ilunits=0 - icols=0 - ipatches=0 - icohorts=0 - - allvecg= 0 - allvecl= 0 - do anumg = begg,endg - an = ldecomp%gdc2glo(anumg) - cid = lcid(an) - ln = anumg - call subgrid_get_gcellinfo (ln, nlunits=ilunits, ncols=icols, npatches=ipatches, & - ncohorts=icohorts, glc_behavior=glc_behavior) - allvecl(cid,1) = allvecl(cid,1) + 1 - allvecl(cid,2) = allvecl(cid,2) + ilunits ! number of landunits for local clump cid - allvecl(cid,3) = allvecl(cid,3) + icols ! number of columns for local clump cid - allvecl(cid,4) = allvecl(cid,4) + ipatches ! number of patches for local clump cid - allvecl(cid,5) = allvecl(cid,5) + icohorts ! number of cohorts for local clump cid - enddo - call mpi_allreduce(allvecl,allvecg,size(allvecg),MPI_INTEGER,MPI_SUM,mpicom,ier) - - ! Determine overall total gridcells, landunits, columns and patches and distribute - ! gridcells over clumps - - numg = 0 - numl = 0 - numc = 0 - nump = 0 - numCohort = 0 - - do cid = 1,nclumps - icells = allvecg(cid,1) ! number of all clump cid gridcells (over all processors) - ilunits = allvecg(cid,2) ! number of all clump cid landunits (over all processors) - icols = allvecg(cid,3) ! number of all clump cid columns (over all processors) - ipatches = allvecg(cid,4) ! number of all clump cid patches (over all processors) - icohorts = allvecg(cid,5) ! number of all clump cid cohorts (over all processors) - - !--- overall total --- - numg = numg + icells ! total number of gridcells - numl = numl + ilunits ! total number of landunits - numc = numc + icols ! total number of columns - nump = nump + ipatches ! total number of patches - numCohort = numCohort + icohorts ! total number of cohorts - - !--- give gridcell to cid --- - !--- increment the beg and end indices --- - clumps(cid)%nlunits = clumps(cid)%nlunits + ilunits - clumps(cid)%ncols = clumps(cid)%ncols + icols - clumps(cid)%npatches = clumps(cid)%npatches + ipatches - clumps(cid)%nCohorts = clumps(cid)%nCohorts + icohorts - - do m = 1,nclumps - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m > cid)) then - clumps(m)%begl = clumps(m)%begl + ilunits - clumps(m)%begc = clumps(m)%begc + icols - clumps(m)%begp = clumps(m)%begp + ipatches - clumps(m)%begCohort = clumps(m)%begCohort + icohorts - endif - - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m >= cid)) then - clumps(m)%endl = clumps(m)%endl + ilunits - clumps(m)%endc = clumps(m)%endc + icols - clumps(m)%endp = clumps(m)%endp + ipatches - clumps(m)%endCohort = clumps(m)%endCohort + icohorts - endif - enddo - - !--- give gridcell to the proc that owns the cid --- - !--- increment the beg and end indices --- - if (iam == clumps(cid)%owner) then - procinfo%nlunits = procinfo%nlunits + ilunits - procinfo%ncols = procinfo%ncols + icols - procinfo%npatches = procinfo%npatches + ipatches - procinfo%nCohorts = procinfo%nCohorts + icohorts - endif - - if (iam > clumps(cid)%owner) then - procinfo%begl = procinfo%begl + ilunits - procinfo%begc = procinfo%begc + icols - procinfo%begp = procinfo%begp + ipatches - procinfo%begCohort = procinfo%begCohort + icohorts - endif - - if (iam >= clumps(cid)%owner) then - procinfo%endl = procinfo%endl + ilunits - procinfo%endc = procinfo%endc + icols - procinfo%endp = procinfo%endp + ipatches - procinfo%endCohort = procinfo%endCohort + icohorts - endif - enddo - - do n = 1,nclumps - if (clumps(n)%ncells /= allvecg(n,1) .or. & - clumps(n)%nlunits /= allvecg(n,2) .or. & - clumps(n)%ncols /= allvecg(n,3) .or. & - clumps(n)%npatches /= allvecg(n,4) .or. & - clumps(n)%nCohorts /= allvecg(n,5)) then - - write(iulog ,*) 'decompInit_glcp(): allvecg error ncells ',iam,n,clumps(n)%ncells ,allvecg(n,1) - write(iulog ,*) 'decompInit_glcp(): allvecg error lunits ',iam,n,clumps(n)%nlunits ,allvecg(n,2) - write(iulog ,*) 'decompInit_glcp(): allvecg error ncols ',iam,n,clumps(n)%ncols ,allvecg(n,3) - write(iulog ,*) 'decompInit_glcp(): allvecg error patches',iam,n,clumps(n)%npatches ,allvecg(n,4) - write(iulog ,*) 'decompInit_glcp(): allvecg error cohorts',iam,n,clumps(n)%nCohorts ,allvecg(n,5) - - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - enddo - - deallocate(allvecg,allvecl) - deallocate(lcid) - - end subroutine decompInit_clumps - - !------------------------------------------------------------------------------ - subroutine decompInit_glcp(lns,lni,lnj,glc_behavior) - ! - ! !DESCRIPTION: - ! Determine gsMaps for landunits, columns, patches and cohorts - ! - ! !USES: - use spmdMod - use spmdGathScatMod - use subgridMod, only : subgrid_get_gcellinfo - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: lns,lni,lnj ! land domain global size - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: gi,li,ci,pi,coi ! indices - integer :: i,g,k,l,n,np ! indices - integer :: cid,pid ! indices - integer :: begg,endg ! beg,end gridcells - integer :: begl,endl ! beg,end landunits - integer :: begc,endc ! beg,end columns - integer :: begp,endp ! beg,end patches - integer :: begCohort,endCohort! beg,end cohorts - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of patches across all processors - integer :: numCohort ! fates cohorts - integer :: icells ! temporary - integer :: ilunits ! temporary - integer :: icols ! temporary - integer :: ipatches ! temporary - integer :: icohorts ! temporary - integer :: ier ! error code - integer :: npmin,npmax,npint ! do loop values for printing - integer :: clmin,clmax ! do loop values for printing - integer :: locsize,globsize ! used for gsMap init - integer :: ng ! number of gridcells in gsMap_lnd_gdc2glo - integer :: val1, val2 ! temporaries - integer, pointer :: gindex(:) ! global index for gsMap init - integer, pointer :: arrayglob(:) ! temporaroy - integer, pointer :: gstart(:), gcount(:) - integer, pointer :: lstart(:), lcount(:) - integer, pointer :: cstart(:), ccount(:) - integer, pointer :: pstart(:), pcount(:) - integer, pointer :: coStart(:), coCount(:) - integer, pointer :: ioff(:) - integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max - character(len=32), parameter :: subname = 'decompInit_glcp' - !------------------------------------------------------------------------------ - - !init - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort) - - ! Determine global seg megs - - allocate(gstart(begg:endg)) - gstart(:) = 0 - allocate(gcount(begg:endg)) - gcount(:) = 0 - allocate(lstart(begg:endg)) - lstart(:) = 0 - allocate(lcount(begg:endg)) - lcount(:) = 0 - allocate(cstart(begg:endg)) - cstart(:) = 0 - allocate(ccount(begg:endg)) - ccount(:) = 0 - allocate(pstart(begg:endg)) - pstart(:) = 0 - allocate(pcount(begg:endg)) - pcount(:) = 0 - if ( use_fates ) then - allocate(coStart(begg:endg)) - coStart(:) = 0 - endif - allocate(coCount(begg:endg)) - coCount(:) = 0 - allocate(ioff(begg:endg)) - ioff(:) = 0 - - ! Determine gcount, lcount, ccount and pcount - - do gi = begg,endg - call subgrid_get_gcellinfo (gi, nlunits=ilunits, ncols=icols, npatches=ipatches, & - ncohorts=icohorts, glc_behavior=glc_behavior) - gcount(gi) = 1 ! number of gridcells for local gridcell index gi - lcount(gi) = ilunits ! number of landunits for local gridcell index gi - ccount(gi) = icols ! number of columns for local gridcell index gi - pcount(gi) = ipatches ! number of patches for local gridcell index gi - coCount(gi) = icohorts ! number of fates cohorts for local gricell index gi - enddo - - ! Determine gstart, lstart, cstart, pstart, coStart for the OUTPUT 1d data structures - - ! gather the gdc subgrid counts to masterproc in glo order - ! compute glo ordered start indices from the counts - ! scatter the subgrid start indices back out to the gdc gridcells - ! set the local gindex array for the subgrid from the subgrid start and count arrays - - ng = mct_gsmap_gsize(gsmap_lnd_gdc2glo) - allocate(arrayglob(ng)) - - arrayglob(:) = 0 - call gather_data_to_master(gcount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(gstart, arrayglob, grlnd) - - ! lstart for gridcell (n) is the total number of the landunits - ! over gridcells 1->n-1 - - arrayglob(:) = 0 - call gather_data_to_master(lcount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(lstart, arrayglob, grlnd) - - arrayglob(:) = 0 - call gather_data_to_master(ccount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(cstart, arrayglob, grlnd) - - arrayglob(:) = 0 - call gather_data_to_master(pcount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(pstart, arrayglob, grlnd) - - if ( use_fates ) then - arrayglob(:) = 0 - call gather_data_to_master(coCount, arrayglob, grlnd) - if (masterproc) then - val1 = arrayglob(1) - arrayglob(1) = 1 - do n = 2,ng - val2 = arrayglob(n) - arrayglob(n) = arrayglob(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(coStart, arrayglob, grlnd) - endif - - deallocate(arrayglob) - - ! Gridcell gsmap (compressed, no ocean points) - - allocate(gindex(begg:endg)) - i = begg-1 - do gi = begg,endg - if (gcount(gi) < 1) then - write(iulog,*) 'decompInit_glcp warning count g ',k,iam,g,gcount(g) - endif - do l = 1,gcount(gi) - i = i + 1 - if (i < begg .or. i > endg) then - write(iulog,*) 'decompInit_glcp error i ',i,begg,endg - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - gindex(i) = gstart(gi) + l - 1 - enddo - enddo - if (i /= endg) then - write(iulog,*) 'decompInit_glcp error size ',i,begg,endg - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - locsize = endg-begg+1 - globsize = numg - call mct_gsMap_init(gsmap_gce_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) - - ! Landunit gsmap - - allocate(gindex(begl:endl)) - ioff(:) = 0 - do li = begl,endl - gi = lun%gridcell(li) !===this is determined internally from how landunits are spread out in memory - gindex(li) = lstart(gi) + ioff(gi) !=== the output gindex is ALWAYS the same regardless of how landuntis are spread out in memory - ioff(gi) = ioff(gi) + 1 - ! check that this is less than [lstart(gi) + lcount(gi)] - enddo - locsize = endl-begl+1 - globsize = numl - call mct_gsMap_init(gsmap_lun_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) - - ! Column gsmap - - allocate(gindex(begc:endc)) - ioff(:) = 0 - do ci = begc,endc - gi = col%gridcell(ci) - gindex(ci) = cstart(gi) + ioff(gi) - ioff(gi) = ioff(gi) + 1 - ! check that this is less than [cstart(gi) + ccount(gi)] - enddo - locsize = endc-begc+1 - globsize = numc - call mct_gsMap_init(gsmap_col_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) - - ! PATCH gsmap - - allocate(gindex(begp:endp)) - ioff(:) = 0 - do pi = begp,endp - gi = patch%gridcell(pi) - gindex(pi) = pstart(gi) + ioff(gi) - ioff(gi) = ioff(gi) + 1 - ! check that this is less than [pstart(gi) + pcount(gi)] - enddo - locsize = endp-begp+1 - globsize = nump - call mct_gsMap_init(gsmap_patch_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) - - ! FATES gsmap for the cohort/element vector - - if ( use_fates ) then - allocate(gindex(begCohort:endCohort)) - ioff(:) = 0 - gi = begg - do coi = begCohort,endCohort - gindex(coi) = coStart(gi) + ioff(gi) - ioff(gi) = ioff(gi) + 1 - if ( mod(coi, fates_maxElementsPerSite ) == 0 ) gi = gi + 1 - enddo - locsize = endCohort-begCohort+1 - globsize = numCohort - call mct_gsMap_init(gsMap_cohort_gdc2glo, gindex, mpicom, comp_id, locsize, globsize) - deallocate(gindex) - endif - - ! Deallocate start/count arrays - deallocate(gstart, gcount) - deallocate(lstart, lcount) - deallocate(cstart, ccount) - deallocate(pstart, pcount) - if ( use_fates ) then - deallocate(coStart,coCount) - endif - deallocate(ioff) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' Surface Grid Characteristics' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' total number of gridcells = ',numg - write(iulog,*)' total number of landunits = ',numl - write(iulog,*)' total number of columns = ',numc - write(iulog,*)' total number of patches = ',nump - write(iulog,*)' total number of cohorts = ',numCohort - write(iulog,*)' Decomposition Characteristics' - write(iulog,*)' clumps per process = ',clump_pproc - write(iulog,*)' gsMap Characteristics' - write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo) - write(iulog,*) ' gce gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo) - write(iulog,*) ' lun gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo) - write(iulog,*) ' col gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_col_gdc2glo) - write(iulog,*) ' patch gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_patch_gdc2glo) - write(iulog,*) ' coh gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_cohort_gdc2glo) - write(iulog,*) - end if - - ! Write out clump and proc info, one pe at a time, - ! barrier to control pes overwriting each other on stdout - - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - npmin = 0 - npmax = npes-1 - npint = 1 - if (dbug == 0) then - npmax = 0 - elseif (dbug == 1) then - npmax = min(npes-1,4) - elseif (dbug == 2) then - npint = npes/8 - endif - do np = npmin,npmax,npint - pid = np - if (dbug == 1) then - if (np == 2) pid=npes/2-1 - if (np == 3) pid=npes-2 - if (np == 4) pid=npes-1 - endif - pid = max(pid,0) - pid = min(pid,npes-1) - - if (iam == pid) then - write(iulog,*) - write(iulog,*)'proc= ',pid,& - ' beg gridcell= ',procinfo%begg, & - ' end gridcell= ',procinfo%endg, & - ' total gridcells per proc= ',procinfo%ncells - write(iulog,*)'proc= ',pid,& - ' beg landunit= ',procinfo%begl, & - ' end landunit= ',procinfo%endl, & - ' total landunits per proc= ',procinfo%nlunits - write(iulog,*)'proc= ',pid,& - ' beg column = ',procinfo%begc, & - ' end column = ',procinfo%endc, & - ' total columns per proc = ',procinfo%ncols - write(iulog,*)'proc= ',pid,& - ' beg patch = ',procinfo%begp, & - ' end patch = ',procinfo%endp, & - ' total patches per proc = ',procinfo%npatches - write(iulog,*)'proc= ',pid,& - ' beg coh = ',procinfo%begCohort, & - ' end coh = ',procinfo%endCohort, & - ' total coh per proc = ',procinfo%nCohorts - write(iulog,*)'proc= ',pid,& - ' lnd ngseg = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo), & - ' lnd nlseg = ',mct_gsMap_nlseg(gsMap_lnd_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' gce ngseg = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo), & - ' gce nlseg = ',mct_gsMap_nlseg(gsMap_gce_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' lun ngseg = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo), & - ' lun nlseg = ',mct_gsMap_nlseg(gsMap_lun_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' col ngseg = ',mct_gsMap_ngseg(gsMap_col_gdc2glo), & - ' col nlseg = ',mct_gsMap_nlseg(gsMap_col_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' patch ngseg = ',mct_gsMap_ngseg(gsMap_patch_gdc2glo), & - ' patch nlseg = ',mct_gsMap_nlseg(gsMap_patch_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' coh ngseg = ',mct_gsMap_ngseg(gsMap_cohort_gdc2glo), & - ' coh nlseg = ',mct_gsMap_nlseg(gsMap_cohort_gdc2glo,iam) - write(iulog,*)'proc= ',pid,' nclumps = ',procinfo%nclumps - - clmin = 1 - clmax = procinfo%nclumps - if (dbug == 1) then - clmax = 1 - elseif (dbug == 0) then - clmax = -1 - endif - do n = clmin,clmax - cid = procinfo%cid(n) - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg gridcell= ',clumps(cid)%begg, & - ' end gridcell= ',clumps(cid)%endg, & - ' total gridcells per clump= ',clumps(cid)%ncells - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg landunit= ',clumps(cid)%begl, & - ' end landunit= ',clumps(cid)%endl, & - ' total landunits per clump = ',clumps(cid)%nlunits - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg column = ',clumps(cid)%begc, & - ' end column = ',clumps(cid)%endc, & - ' total columns per clump = ',clumps(cid)%ncols - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg patch = ',clumps(cid)%begp, & - ' end patch = ',clumps(cid)%endp, & - ' total patches per clump = ',clumps(cid)%npatches - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg cohort = ',clumps(cid)%begCohort, & - ' end cohort = ',clumps(cid)%endCohort, & - ' total cohorts per clump = ',clumps(cid)%nCohorts - end do - end if - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - end do - call shr_sys_flush(iulog) - - end subroutine decompInit_glcp - -end module decompInitMod diff --git a/src/main/decompMod.F90 b/src/main/decompMod.F90 deleted file mode 100644 index 13204fabca..0000000000 --- a/src/main/decompMod.F90 +++ /dev/null @@ -1,483 +0,0 @@ -module decompMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Module provides a descomposition into a clumped data structure which can - ! be mapped back to atmosphere physics chunks. - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - ! Must use shr_sys_abort rather than endrun here to avoid circular dependency - use shr_sys_mod , only : shr_sys_abort - use clm_varctl , only : iulog - use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort - use mct_mod , only : mct_gsMap - ! - ! !PUBLIC TYPES: - implicit none - integer, public :: clump_pproc ! number of clumps per MPI process - - ! Define possible bounds subgrid levels - integer, parameter, public :: BOUNDS_SUBGRID_GRIDCELL = 1 - integer, parameter, public :: BOUNDS_SUBGRID_LANDUNIT = 2 - integer, parameter, public :: BOUNDS_SUBGRID_COLUMN = 3 - integer, parameter, public :: BOUNDS_SUBGRID_PATCH = 4 - integer, parameter, public :: BOUNDS_SUBGRID_COHORT = 5 - - ! Define possible bounds levels - integer, parameter, public :: BOUNDS_LEVEL_PROC = 1 - integer, parameter, public :: BOUNDS_LEVEL_CLUMP = 2 - ! - ! !PUBLIC MEMBER FUNCTIONS: - - public get_beg ! get beg bound for a given subgrid level - public get_end ! get end bound for a given subgrid level - public get_proc_clumps ! number of clumps for this processor - public get_proc_total ! total no. of gridcells, landunits, columns and patchs for any processor - public get_proc_global ! total gridcells, landunits, columns, patchs across all processors - public get_clmlevel_gsize ! get global size associated with clmlevel - public get_clmlevel_gsmap ! get gsmap associated with clmlevel - - interface get_clump_bounds - module procedure get_clump_bounds_old - module procedure get_clump_bounds_new - end interface - public get_clump_bounds ! clump beg and end gridcell,landunit,column,patch - - interface get_proc_bounds - module procedure get_proc_bounds_old - module procedure get_proc_bounds_new - end interface - public get_proc_bounds ! this processor beg and end gridcell,landunit,column,patch - - ! !PRIVATE MEMBER FUNCTIONS: - ! - ! !PRIVATE TYPES: - private ! (now mostly public for decompinitmod) - - integer,public :: nclumps ! total number of clumps across all processors - integer,public :: numg ! total number of gridcells on all procs - integer,public :: numl ! total number of landunits on all procs - integer,public :: numc ! total number of columns on all procs - integer,public :: nump ! total number of patchs on all procs - integer,public :: numCohort ! total number of fates cohorts on all procs - - type bounds_type - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending patch index - integer :: begCohort, endCohort ! beginning and ending cohort indices - - integer :: level ! whether defined on the proc or clump level - integer :: clump_index ! if defined on the clump level, this gives the clump index - end type bounds_type - public bounds_type - - !---global information on each pe - type processor_type - integer :: nclumps ! number of clumps for processor_type iam - integer,pointer :: cid(:) ! clump indices - integer :: ncells ! number of gridcells in proc - integer :: nlunits ! number of landunits in proc - integer :: ncols ! number of columns in proc - integer :: npatches ! number of patchs in proc - integer :: nCohorts ! number of cohorts in proc - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending patch index - integer :: begCohort, endCohort ! beginning and ending cohort indices - end type processor_type - public processor_type - type(processor_type),public :: procinfo - - !---global information on each pe - type clump_type - integer :: owner ! process id owning clump - integer :: ncells ! number of gridcells in clump - integer :: nlunits ! number of landunits in clump - integer :: ncols ! number of columns in clump - integer :: npatches ! number of patchs in clump - integer :: nCohorts ! number of cohorts in proc - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending patch index - integer :: begCohort, endCohort ! beginning and ending cohort indices - end type clump_type - public clump_type - type(clump_type),public, allocatable :: clumps(:) - - !---global information on each pe - !--- glo = 1d global sn ordered - !--- gdc = 1d global dc ordered compressed - type decomp_type - integer,pointer :: gdc2glo(:) ! 1d gdc to 1d glo - end type decomp_type - public decomp_type - type(decomp_type),public,target :: ldecomp - - type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_patch_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_cohort_gdc2glo - !------------------------------------------------------------------------------ - -contains - - !----------------------------------------------------------------------- - pure function get_beg(bounds, subgrid_level) result(beg_index) - ! - ! !DESCRIPTION: - ! Get beginning bounds for a given subgrid level - ! - ! subgrid_level should be one of the constants defined in this module: - ! BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_LANDUNIT, etc. - ! - ! Returns -1 for invalid subgrid_level (does not abort in this case, in order to keep - ! this function pure). - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: beg_index ! function result - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: subgrid_level - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_beg' - !----------------------------------------------------------------------- - - select case (subgrid_level) - case (BOUNDS_SUBGRID_GRIDCELL) - beg_index = bounds%begg - case (BOUNDS_SUBGRID_LANDUNIT) - beg_index = bounds%begl - case (BOUNDS_SUBGRID_COLUMN) - beg_index = bounds%begc - case (BOUNDS_SUBGRID_PATCH) - beg_index = bounds%begp - case (BOUNDS_SUBGRID_COHORT) - beg_index = bounds%begCohort - case default - beg_index = -1 - end select - - end function get_beg - - !----------------------------------------------------------------------- - pure function get_end(bounds, subgrid_level) result(end_index) - ! - ! !DESCRIPTION: - ! Get end bounds for a given subgrid level - ! - ! subgrid_level should be one of the constants defined in this module: - ! BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_LANDUNIT, etc. - ! - ! Returns -1 for invalid subgrid_level (does not abort in this case, in order to keep - ! this function pure). - ! - ! !USES: - ! - ! !ARGUMENTS: - integer :: end_index ! function result - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: subgrid_level - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_end' - !----------------------------------------------------------------------- - - select case (subgrid_level) - case (BOUNDS_SUBGRID_GRIDCELL) - end_index = bounds%endg - case (BOUNDS_SUBGRID_LANDUNIT) - end_index = bounds%endl - case (BOUNDS_SUBGRID_COLUMN) - end_index = bounds%endc - case (BOUNDS_SUBGRID_PATCH) - end_index = bounds%endp - case (BOUNDS_SUBGRID_COHORT) - end_index = bounds%endCohort - case default - end_index = -1 - end select - - end function get_end - - !------------------------------------------------------------------------------ - subroutine get_clump_bounds_new (n, bounds) - ! - ! !DESCRIPTION: - ! Determine clump bounds - ! - ! !ARGUMENTS: - integer, intent(in) :: n ! processor clump index - type(bounds_type), intent(out) :: bounds ! clump bounds - ! - ! !LOCAL VARIABLES: - character(len=32), parameter :: subname = 'get_clump_bounds' ! Subroutine name - integer :: cid ! clump id -#ifdef _OPENMP - integer, external :: OMP_GET_MAX_THREADS - integer, external :: OMP_GET_NUM_THREADS - integer, external :: OMP_GET_THREAD_NUM -#endif - !------------------------------------------------------------------------------ - ! Make sure this IS being called from a threaded region -#ifdef _OPENMP - ! FIX(SPM, 090314) - for debugging fates and openMP - !write(iulog,*) 'SPM omp debug decompMod 1 ', & - !OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM() - - if ( OMP_GET_NUM_THREADS() == 1 .and. OMP_GET_MAX_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a non-threaded region)') - end if -#endif - - cid = procinfo%cid(n) - bounds%begp = clumps(cid)%begp - bounds%endp = clumps(cid)%endp - bounds%begc = clumps(cid)%begc - bounds%endc = clumps(cid)%endc - bounds%begl = clumps(cid)%begl - bounds%endl = clumps(cid)%endl - bounds%begg = clumps(cid)%begg - bounds%endg = clumps(cid)%endg - bounds%begCohort = clumps(cid)%begCohort - bounds%endCohort = clumps(cid)%endCohort - - bounds%level = BOUNDS_LEVEL_CLUMP - bounds%clump_index = n - - end subroutine get_clump_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_clump_bounds_old (n, begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - integer, intent(in) :: n ! proc clump index - integer, intent(out) :: begp, endp ! clump beg and end patch indices - integer, intent(out) :: begc, endc ! clump beg and end column indices - integer, intent(out) :: begl, endl ! clump beg and end landunit indices - integer, intent(out) :: begg, endg ! clump beg and end gridcell indices - integer, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices - integer :: cid ! clump id - !------------------------------------------------------------------------------ - - cid = procinfo%cid(n) - begp = clumps(cid)%begp - endp = clumps(cid)%endp - begc = clumps(cid)%begc - endc = clumps(cid)%endc - begl = clumps(cid)%begl - endl = clumps(cid)%endl - begg = clumps(cid)%begg - endg = clumps(cid)%endg - begCohort = clumps(cid)%begCohort - endCohort = clumps(cid)%endCohort - end subroutine get_clump_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_new (bounds) - ! - ! !DESCRIPTION: - ! Retrieve processor bounds - ! - ! !ARGUMENTS: - type(bounds_type), intent(out) :: bounds ! processor bounds bounds - ! - ! !LOCAL VARIABLES: -#ifdef _OPENMP - integer, external :: OMP_GET_NUM_THREADS - integer, external :: OMP_GET_MAX_THREADS - integer, external :: OMP_GET_THREAD_NUM -#endif - character(len=32), parameter :: subname = 'get_proc_bounds' ! Subroutine name - !------------------------------------------------------------------------------ - ! Make sure this is NOT being called from a threaded region -#ifdef _OPENMP - ! FIX(SPM, 090314) - for debugging fates and openMP - !write(*,*) 'SPM omp debug decompMod 2 ', & - !OMP_GET_NUM_THREADS(),OMP_GET_MAX_THREADS(),OMP_GET_THREAD_NUM() - - if ( OMP_GET_NUM_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a threaded region') - end if -#endif - - bounds%begp = procinfo%begp - bounds%endp = procinfo%endp - bounds%begc = procinfo%begc - bounds%endc = procinfo%endc - bounds%begl = procinfo%begl - bounds%endl = procinfo%endl - bounds%begg = procinfo%begg - bounds%endg = procinfo%endg - bounds%begCohort = procinfo%begCohort - bounds%endCohort = procinfo%endCohort - - bounds%level = BOUNDS_LEVEL_PROC - bounds%clump_index = -1 ! irrelevant for proc, so assigned a bogus value - - end subroutine get_proc_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_old (begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - - integer, optional, intent(out) :: begp, endp ! proc beg and end patch indices - integer, optional, intent(out) :: begc, endc ! proc beg and end column indices - integer, optional, intent(out) :: begl, endl ! proc beg and end landunit indices - integer, optional, intent(out) :: begg, endg ! proc beg and end gridcell indices - integer, optional, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices - !------------------------------------------------------------------------------ - - if (present(begp)) begp = procinfo%begp - if (present(endp)) endp = procinfo%endp - if (present(begc)) begc = procinfo%begc - if (present(endc)) endc = procinfo%endc - if (present(begl)) begl = procinfo%begl - if (present(endl)) endl = procinfo%endl - if (present(begg)) begg = procinfo%begg - if (present(endg)) endg = procinfo%endg - if (present(begCohort)) begCohort = procinfo%begCohort - if (present(endCohort)) endCohort = procinfo%endCohort - end subroutine get_proc_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_total(pid, ncells, nlunits, ncols, npatches, nCohorts) - ! - ! !DESCRIPTION: - ! Count up gridcells, landunits, columns, and patchs on process. - ! - ! !ARGUMENTS: - integer, intent(in) :: pid ! proc id - integer, intent(out) :: ncells ! total number of gridcells on the processor - integer, intent(out) :: nlunits ! total number of landunits on the processor - integer, intent(out) :: ncols ! total number of columns on the processor - integer, intent(out) :: npatches ! total number of patchs on the processor - integer, intent(out) :: nCohorts! total number of cohorts on the processor - ! - ! !LOCAL VARIABLES: - integer :: cid ! clump index - !------------------------------------------------------------------------------ - - npatches = 0 - nlunits = 0 - ncols = 0 - ncells = 0 - nCohorts = 0 - do cid = 1,nclumps - if (clumps(cid)%owner == pid) then - ncells = ncells + clumps(cid)%ncells - nlunits = nlunits + clumps(cid)%nlunits - ncols = ncols + clumps(cid)%ncols - npatches = npatches + clumps(cid)%npatches - nCohorts = nCohorts + clumps(cid)%nCohorts - end if - end do - end subroutine get_proc_total - - !------------------------------------------------------------------------------ - subroutine get_proc_global(ng, nl, nc, np, nCohorts) - ! - ! !DESCRIPTION: - ! Return number of gridcells, landunits, columns, and patchs across all processes. - ! - ! !ARGUMENTS: - integer, optional, intent(out) :: ng ! total number of gridcells across all processors - integer, optional, intent(out) :: nl ! total number of landunits across all processors - integer, optional, intent(out) :: nc ! total number of columns across all processors - integer, optional, intent(out) :: np ! total number of patchs across all processors - integer, optional, intent(out) :: nCohorts ! total number fates cohorts - !------------------------------------------------------------------------------ - - if (present(np)) np = nump - if (present(nc)) nc = numc - if (present(nl)) nl = numl - if (present(ng)) ng = numg - if (present(nCohorts)) nCohorts = numCohort - - end subroutine get_proc_global - - !------------------------------------------------------------------------------ - integer function get_proc_clumps() - ! - ! !DESCRIPTION: - ! Return the number of clumps. - !------------------------------------------------------------------------------ - - get_proc_clumps = procinfo%nclumps - - end function get_proc_clumps - - !----------------------------------------------------------------------- - integer function get_clmlevel_gsize (clmlevel) - ! - ! !DESCRIPTION: - ! Determine 1d size from clmlevel - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: clmlevel !type of clm 1d array - !----------------------------------------------------------------------- - - select case (clmlevel) - case(grlnd) - get_clmlevel_gsize = ldomain%ns - case(nameg) - get_clmlevel_gsize = numg - case(namel) - get_clmlevel_gsize = numl - case(namec) - get_clmlevel_gsize = numc - case(namep) - get_clmlevel_gsize = nump - case(nameCohort) - get_clmlevel_gsize = numCohort - case default - write(iulog,*) 'get_clmlevel_gsize does not match clmlevel type: ', trim(clmlevel) - call shr_sys_abort() - end select - - end function get_clmlevel_gsize - - !----------------------------------------------------------------------- - subroutine get_clmlevel_gsmap (clmlevel, gsmap) - ! - ! !DESCRIPTION: - ! Compute arguments for gatherv, scatterv for vectors - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: clmlevel ! type of input data - type(mct_gsmap) , pointer :: gsmap - !---------------------------------------------------------------------- - - select case (clmlevel) - case(grlnd) - gsmap => gsmap_lnd_gdc2glo - case(nameg) - gsmap => gsmap_gce_gdc2glo - case(namel) - gsmap => gsmap_lun_gdc2glo - case(namec) - gsmap => gsmap_col_gdc2glo - case(namep) - gsmap => gsmap_patch_gdc2glo - case(nameCohort) - gsmap => gsMap_cohort_gdc2glo - case default - write(iulog,*) 'get_clmlevel_gsmap: Invalid expansion character: ',trim(clmlevel) - call shr_sys_abort() - end select - - end subroutine get_clmlevel_gsmap - -end module decompMod diff --git a/src/main/dtypes.h b/src/main/dtypes.h deleted file mode 100644 index aa1dc3bd0f..0000000000 --- a/src/main/dtypes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TYPETEXT 100 -#define TYPEREAL 101 -#define TYPEDOUBLE 102 -#define TYPEINT 103 -#define TYPELONG 104 -#define TYPELOGICAL 105 diff --git a/src/main/filterColMod.F90 b/src/main/filterColMod.F90 deleted file mode 100644 index 0c3e63ce85..0000000000 --- a/src/main/filterColMod.F90 +++ /dev/null @@ -1,444 +0,0 @@ -module filterColMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Defines a type to hold column-level filters, along with factory methods to help create - ! a column-level filter - ! - ! To loop over the filter, use code like this: - ! do fc = 1, myfilter%num - ! c = myfilter%indices(fc) - ! ... - ! end do - ! - ! !USES: -#include "shr_assert.h" - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use clm_varcon , only : ispval - use clm_varctl , only : iulog - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: filter_col_type - integer :: num ! number of points in the filter - integer, allocatable :: indices(:) ! column indices included in the filter - contains - procedure :: equals_filter - generic :: operator(==) => equals_filter - end type filter_col_type - - ! !PUBLIC ROUTINES: - - ! Create an empty filter - public :: col_filter_empty - - ! Create a filter from an array of indices. This is mainly useful for unit testing. - public :: col_filter_from_index_array - - ! Create a filter from a column-level logical array - public :: col_filter_from_logical_array - - ! Create a filter from a column-level logical array, but including only active points - public :: col_filter_from_logical_array_active_only - - ! Create a filter that contains one or more landunit type(s) of interest - public :: col_filter_from_ltypes - - ! Create a filter from a landunit-level logical array - public :: col_filter_from_lunflags - - ! Create a filter from a gridcell-level logical array and an array of landunit type(s) - ! of interest - public :: col_filter_from_grcflags_ltypes - - ! Create a filter from another filter subset by a column-level logical array - public :: col_filter_from_filter_and_logical_array - - ! !PRIVATE ROUTINES: - - ! Whether a given column should be included in the filter based on the active flag - private :: include_based_on_active - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! TODO(wjs, 2016-04-07) If repeated reallocation of the indices arrays (every time a - ! filter is recreated - each time through the run loop) is a performance issue, then we - ! could rewrite the creation functions to instead be subroutines that act on an existing - ! filter object: I think this would involve replacing calls to col_filter_empty with - ! something like filter%reset_filter; this would only allocate the indices array if it - ! is not already allocated. - - !----------------------------------------------------------------------- - function col_filter_empty(bounds) result(filter) - ! - ! !DESCRIPTION: - ! Initialize a filter object - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'col_filter_empty' - !----------------------------------------------------------------------- - - filter%num = 0 - allocate(filter%indices(bounds%endc - bounds%begc + 1)) - - end function col_filter_empty - - !----------------------------------------------------------------------- - function col_filter_from_index_array(bounds, indices_col) result(filter) - ! - ! !DESCRIPTION: - ! Create a filter from an array of indices. - ! - ! This is mainly useful for unit testing. - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: indices_col(:) ! column-level array of indices to include in filter - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'col_filter_from_index_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL(indices_col >= bounds%begc, errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL(indices_col <= bounds%endc, errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - filter%num = size(indices_col) - filter%indices(1:filter%num) = indices_col - - end function col_filter_from_index_array - - - !----------------------------------------------------------------------- - function col_filter_from_logical_array(bounds, logical_col) result(filter) - ! - ! !DESCRIPTION: - ! Create a column-level filter from a column-level logical array. - ! - ! This version does not consider whether a column is active: it simply includes any - ! column 'c' for which logical_col(c) is .true. - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - logical, intent(in) :: logical_col(bounds%begc:) ! column-level logical array - ! - ! !LOCAL VARIABLES: - integer :: c - - character(len=*), parameter :: subname = 'col_filter_from_logical_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(logical_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - do c = bounds%begc, bounds%endc - if (logical_col(c)) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end do - - end function col_filter_from_logical_array - - !----------------------------------------------------------------------- - function col_filter_from_logical_array_active_only(bounds, logical_col) result(filter) - ! - ! !DESCRIPTION: - ! Create a column-level filter from a column-level logical array. Only include active - ! points in the filter: even if the logical array is true for a given column, that - ! column is excluded if it is inactive. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - logical, intent(in) :: logical_col(bounds%begc:) ! column-level logical array - ! - ! !LOCAL VARIABLES: - integer :: c - - character(len=*), parameter :: subname = 'col_filter_from_logical_array_active_only' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(logical_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - do c = bounds%begc, bounds%endc - if (col%active(c)) then - if (logical_col(c)) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end if - end do - - end function col_filter_from_logical_array_active_only - - - !----------------------------------------------------------------------- - function col_filter_from_ltypes(bounds, ltypes, include_inactive) & - result(filter) - ! - ! !DESCRIPTION: - ! Create a column-level filter that includes one or more landunit type(s) of interest - ! - ! !USES: - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: ltypes(:) ! landunit type(s) of interest - logical, intent(in) :: include_inactive ! whether inactive points should be included in the filter - ! - ! !LOCAL VARIABLES: - integer :: c - integer :: l - - character(len=*), parameter :: subname = 'col_filter_from_ltypes' - !----------------------------------------------------------------------- - - filter = col_filter_empty(bounds) - - do c = bounds%begc, bounds%endc - if (include_based_on_active(c, include_inactive)) then - l = col%landunit(c) - if (any(ltypes(:) == lun%itype(l))) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end if - end do - - end function col_filter_from_ltypes - - !----------------------------------------------------------------------- - function col_filter_from_lunflags(bounds, lunflags, include_inactive) & - result(filter) - ! - ! !DESCRIPTION: - ! Create a column-level filter from a landunit-level logical array. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - logical, intent(in) :: lunflags(bounds%begl:) ! landunit-level logical array - logical, intent(in) :: include_inactive ! whether inactive points should be included in the filter - ! - ! !LOCAL VARIABLES: - integer :: c - integer :: l - - character(len=*), parameter :: subname = 'col_filter_from_lunflags' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(lunflags) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - do c = bounds%begc, bounds%endc - if (include_based_on_active(c, include_inactive)) then - l = col%landunit(c) - if (lunflags(l)) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end if - end do - - end function col_filter_from_lunflags - - - !----------------------------------------------------------------------- - function col_filter_from_grcflags_ltypes(bounds, grcflags, ltypes, include_inactive) & - result(filter) - ! - ! !DESCRIPTION: - ! Create a column-level filter from a gridcell-level logical array and an array of - ! landunit type(s) of interest. The filter will contain all columns for which (a) - ! grcflags is true for the gridcell containing this column, and (b) the landunit type - ! for the landunit containing this column is one of the types in ltypes. - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - logical, intent(in) :: grcflags(bounds%begg:) ! gridcell-level logical array - integer, intent(in) :: ltypes(:) ! landunit type(s) of interest - logical, intent(in) :: include_inactive ! whether inactive points should be included in the filter - ! - ! !LOCAL VARIABLES: - integer :: g ! gridcell index - integer :: l ! landunit index - integer :: c ! column index - integer :: i ! array index - integer :: ltype ! landunit type - - character(len=*), parameter :: subname = 'col_filter_from_grcflags_ltypes' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(grcflags) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - ! This loops over g then l then c rather than just looping over all columns, because - ! this is likely more efficient for sparse filters (e.g., sparse grcflags or uncommon - ! ltypes). - do g = bounds%begg, bounds%endg - if (grcflags(g)) then - do i = 1, size(ltypes) - ltype = ltypes(i) - l = grc%landunit_indices(ltype, g) - if (l == ispval) then - cycle - end if - - do c = lun%coli(l), lun%colf(l) - if (include_based_on_active(c, include_inactive)) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end do ! c - end do ! i = 1, size(ltypes) - end if ! grcflags(g) - end do ! g - - end function col_filter_from_grcflags_ltypes - - !----------------------------------------------------------------------- - function col_filter_from_filter_and_logical_array(bounds, num_orig, filter_orig, logical_col) & - result(filter) - ! - ! !DESCRIPTION: - ! Create a filter from another filter subset by a column-level logical array - ! - ! !ARGUMENTS: - type(filter_col_type) :: filter ! function result - - ! Accepts separate num & indices arguments rather than a filter of filter_col_type so - ! that this function can be called with old-style filters, where these were stored - ! separately rather than being bundled together. - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num_orig ! number of points in original filter - integer, intent(in) :: filter_orig(:) ! column indices in original filter - logical, intent(in) :: logical_col(bounds%begc:) ! column-level logical array - ! - ! !LOCAL VARIABLES: - integer :: fc, c - - character(len=*), parameter :: subname = 'col_filter_from_filter_and_logical_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(logical_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - filter = col_filter_empty(bounds) - - do fc = 1, num_orig - c = filter_orig(fc) - if (logical_col(c)) then - filter%num = filter%num + 1 - filter%indices(filter%num) = c - end if - end do - - end function col_filter_from_filter_and_logical_array - - - !----------------------------------------------------------------------- - pure function include_based_on_active(c, include_inactive) result(include_point) - ! - ! !DESCRIPTION: - ! Returns true if the given column should be included in a filter based on its active - ! flag - ! - ! !ARGUMENTS: - logical :: include_point ! function result - integer, intent(in) :: c ! column index - logical, intent(in) :: include_inactive ! whether inactive points are included in this filter - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'include_based_on_active' - !----------------------------------------------------------------------- - - ! This code is written to avoid the check of col%active if include_inactive is true. - ! This is needed in the case of filters that are created in initialization, before - ! the active flags are set. - if (include_inactive) then - include_point = .true. - else if (col%active(c)) then - include_point = .true. - else - include_point = .false. - end if - - end function include_based_on_active - - - !----------------------------------------------------------------------- - function equals_filter(this, other) result(equal) - ! - ! !DESCRIPTION: - ! Returns true if the two filters are equal. - ! - ! If they differ, prints some information about how they differ. - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: equal ! function result - class(filter_col_type), intent(in) :: this - class(filter_col_type), intent(in) :: other - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'equals_filter' - !----------------------------------------------------------------------- - - equal = .true. - - if (this%num /= other%num) then - equal = .false. - write(iulog,*) ' ' - write(iulog,'(a, i0, a, i0)') 'equals_filter false: Sizes differ: ', & - this%num, ' /= ', other%num - else - do i = 1, this%num - if (this%indices(i) /= other%indices(i)) then - equal = .false. - write(iulog,*) ' ' - write(iulog,'(a, i0, a, i0, a, i0)') & - 'equals_filter false: Values differ; first difference at ', & - i, ': ', this%indices(i), ' /= ', other%indices(i) - exit - end if - end do - end if - - end function equals_filter - - -end module filterColMod diff --git a/src/main/filterMod.F90 b/src/main/filterMod.F90 deleted file mode 100644 index 1201582af7..0000000000 --- a/src/main/filterMod.F90 +++ /dev/null @@ -1,584 +0,0 @@ -module filterMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module of filters used for processing columns and pfts of particular - ! types, including lake, non-lake, urban, soil, snow, non-snow, and - ! naturally-vegetated patches. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use glcBehaviorMod , only : glc_behavior_type - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - type clumpfilter - integer, pointer :: allc(:) ! all columns - integer :: num_allc ! number of points in allc filter - - integer, pointer :: natvegp(:) ! CNDV nat-vegetated (present) filter (pfts) - integer :: num_natvegp ! number of pfts in nat-vegetated filter - - integer, pointer :: pcropp(:) ! prognostic crop filter (pfts) - integer :: num_pcropp ! number of pfts in prognostic crop filter - integer, pointer :: soilnopcropp(:) ! soil w/o prog. crops (pfts) - integer :: num_soilnopcropp ! number of pfts in soil w/o prog crops - - integer, pointer :: lakep(:) ! lake filter (pfts) - integer :: num_lakep ! number of pfts in lake filter - integer, pointer :: nolakep(:) ! non-lake filter (pfts) - integer :: num_nolakep ! number of pfts in non-lake filter - integer, pointer :: lakec(:) ! lake filter (columns) - integer :: num_lakec ! number of columns in lake filter - integer, pointer :: nolakec(:) ! non-lake filter (columns) - integer :: num_nolakec ! number of columns in non-lake filter - - integer, pointer :: soilc(:) ! soil filter (columns) - integer :: num_soilc ! number of columns in soil filter - integer, pointer :: soilp(:) ! soil filter (pfts) - integer :: num_soilp ! number of pfts in soil filter - - integer, pointer :: snowc(:) ! snow filter (columns) - integer :: num_snowc ! number of columns in snow filter - integer, pointer :: nosnowc(:) ! non-snow filter (columns) - integer :: num_nosnowc ! number of columns in non-snow filter - - integer, pointer :: lakesnowc(:) ! snow filter (columns) - integer :: num_lakesnowc ! number of columns in snow filter - integer, pointer :: lakenosnowc(:) ! non-snow filter (columns) - integer :: num_lakenosnowc ! number of columns in non-snow filter - - integer, pointer :: exposedvegp(:) ! patches where frac_veg_nosno is non-zero - integer :: num_exposedvegp ! number of patches in exposedvegp filter - integer, pointer :: noexposedvegp(:)! patches where frac_veg_nosno is 0 (does NOT include lake or urban) - integer :: num_noexposedvegp ! number of patches in noexposedvegp filter - - integer, pointer :: hydrologyc(:) ! hydrology filter (columns) - integer :: num_hydrologyc ! number of columns in hydrology filter - - integer, pointer :: urbanl(:) ! urban filter (landunits) - integer :: num_urbanl ! number of landunits in urban filter - integer, pointer :: nourbanl(:) ! non-urban filter (landunits) - integer :: num_nourbanl ! number of landunits in non-urban filter - - integer, pointer :: urbanc(:) ! urban filter (columns) - integer :: num_urbanc ! number of columns in urban filter - integer, pointer :: nourbanc(:) ! non-urban filter (columns) - integer :: num_nourbanc ! number of columns in non-urban filter - - integer, pointer :: urbanp(:) ! urban filter (pfts) - integer :: num_urbanp ! number of pfts in urban filter - integer, pointer :: nourbanp(:) ! non-urban filter (pfts) - integer :: num_nourbanp ! number of pfts in non-urban filter - - integer, pointer :: nolakeurbanp(:) ! non-lake, non-urban filter (pfts) - integer :: num_nolakeurbanp ! number of pfts in non-lake, non-urban filter - - integer, pointer :: icemecc(:) ! glacier mec filter (cols) - integer :: num_icemecc ! number of columns in glacier mec filter - - integer, pointer :: do_smb_c(:) ! glacier+bareland SMB calculations-on filter (cols) - integer :: num_do_smb_c ! number of columns in glacier+bareland SMB mec filter - - end type clumpfilter - public clumpfilter - - ! This is the standard set of filters, which should be used in most places in the code. - ! These filters only include 'active' points. - type(clumpfilter), allocatable, public :: filter(:) - - ! --- DO NOT USING THE FOLLOWING VARIABLE UNLESS YOU KNOW WHAT YOU'RE DOING! --- - ! - ! This is a separate set of filters that contains both inactive and active points. It is - ! rarely appropriate to use these, but they are needed in a few places, e.g., where - ! quantities are computed before weights, active flags and filters are updated due to - ! landuse change. Note that, for the handful of filters that are computed outside of - ! setFiltersOneGroup (including the CNDV natvegp filter and the snow filters), these - ! filters are NOT included in this variable - so they can only be used from the main - ! 'filter' variable. - ! - ! Ideally, we would like to restructure the initialization code and driver ordering so - ! that this version of the filters is never needed. At that point, we could remove this - ! filter_inactive_and_active variable, and simplify filterMod to look the way it did - ! before this variable was added (i.e., when there was only a single group of filters). - ! - type(clumpfilter), allocatable, public :: filter_inactive_and_active(:) - ! - public allocFilters ! allocate memory for filters - public setFilters ! set filters - public setExposedvegpFilter ! set the exposedvegp and noexposedvegp filters - - private allocFiltersOneGroup ! allocate memory for one group of filters - private setFiltersOneGroup ! set one group of filters - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - ! - ! !REVISION HISTORY: - ! Created by Mariana Vertenstein - ! 11/13/03, Peter Thornton: Added soilp and num_soilp - ! Jan/08, S. Levis: Added crop-related filters - ! June/13, Bill Sacks: Change main filters to just work over 'active' points; - ! add filter_inactive_and_active - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine allocFilters() - ! - ! !DESCRIPTION: - ! Allocate CLM filters. - ! - ! !REVISION HISTORY: - ! Created by Bill Sacks - !------------------------------------------------------------------------ - - call allocFiltersOneGroup(filter) - call allocFiltersOneGroup(filter_inactive_and_active) - - end subroutine allocFilters - - !------------------------------------------------------------------------ - subroutine allocFiltersOneGroup(this_filter) - ! - ! !DESCRIPTION: - ! Allocate CLM filters, for one group of filters. - ! - ! !USES: - use decompMod , only : get_proc_clumps, get_clump_bounds - ! - ! !ARGUMENTS: - type(clumpfilter), intent(inout), allocatable :: this_filter(:) ! the filter to allocate - ! - ! LOCAL VARAIBLES: - integer :: nc ! clump index - integer :: nclumps ! total number of clumps on this processor - integer :: ier ! error status - type(bounds_type) :: bounds - !------------------------------------------------------------------------ - - ! Determine clump variables for this processor - - nclumps = get_proc_clumps() - - ier = 0 - if( .not. allocated(this_filter)) then - allocate(this_filter(nclumps), stat=ier) - end if - if (ier /= 0) then - write(iulog,*) 'allocFiltersOneGroup(): allocation error for clumpsfilters' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Loop over clumps on this processor - -!$OMP PARALLEL DO PRIVATE (nc,bounds) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds) - - allocate(this_filter(nc)%allc(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%lakep(bounds%endp-bounds%begp+1)) - allocate(this_filter(nc)%nolakep(bounds%endp-bounds%begp+1)) - allocate(this_filter(nc)%nolakeurbanp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%lakec(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%nolakec(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%soilc(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%soilp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%snowc(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%nosnowc(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%lakesnowc(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%lakenosnowc(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%exposedvegp(bounds%endp-bounds%begp+1)) - allocate(this_filter(nc)%noexposedvegp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%natvegp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%hydrologyc(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%urbanp(bounds%endp-bounds%begp+1)) - allocate(this_filter(nc)%nourbanp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%urbanc(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%nourbanc(bounds%endc-bounds%begc+1)) - - allocate(this_filter(nc)%urbanl(bounds%endl-bounds%begl+1)) - allocate(this_filter(nc)%nourbanl(bounds%endl-bounds%begl+1)) - - allocate(this_filter(nc)%pcropp(bounds%endp-bounds%begp+1)) - allocate(this_filter(nc)%soilnopcropp(bounds%endp-bounds%begp+1)) - - allocate(this_filter(nc)%icemecc(bounds%endc-bounds%begc+1)) - allocate(this_filter(nc)%do_smb_c(bounds%endc-bounds%begc+1)) - - end do -!$OMP END PARALLEL DO - - end subroutine allocFiltersOneGroup - - !------------------------------------------------------------------------ - subroutine setFilters(bounds, glc_behavior) - ! - ! !DESCRIPTION: - ! Set CLM filters. - use decompMod , only : BOUNDS_LEVEL_CLUMP - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(glc_behavior_type) , intent(in) :: glc_behavior - !------------------------------------------------------------------------ - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(sourcefile, __LINE__)) - - call setFiltersOneGroup(bounds, & - filter, include_inactive = .false., & - glc_behavior = glc_behavior) - - ! At least as of June, 2013, the 'inactive_and_active' version of the filters is - ! static in time. Thus, we could have some logic saying whether we're in - ! initialization, and if so, skip this call. But this is problematic for two reasons: - ! (1) it requires that the caller of this routine (currently reweight_wrapup) know - ! whether it is in initialization; and (2) it assumes that the filter definitions - ! won't be changed in the future in a way that creates some variability in time. So - ! for now, it seems cleanest and safest to just update these filters whenever the main - ! filters are updated. But if this proves to be a performance problem, we could - ! introduce an argument saying whether we're in initialization, and if so, skip this - ! call. - - call setFiltersOneGroup(bounds, & - filter_inactive_and_active, include_inactive = .true., & - glc_behavior = glc_behavior) - - end subroutine setFilters - - - !------------------------------------------------------------------------ - subroutine setFiltersOneGroup(bounds, this_filter, include_inactive, glc_behavior) - ! - ! !DESCRIPTION: - ! Set CLM filters for one group of filters. - ! - ! "Standard" filters only include active points. However, this routine can be used to set - ! alternative filters that also apply over inactive points, by setting include_inactive = - ! .true. - ! - ! This routine sets filters that are determined by subgrid type, "active" status of - ! patch, col or landunit, and the like. Filters based on model state (e.g., snow - ! cover) should generally be set elsewhere, to ensure that the routine that sets them - ! is called at the right time in the driver loop. - ! - ! !USES: - use decompMod , only : BOUNDS_LEVEL_CLUMP - use pftconMod , only : npcropmin - use landunit_varcon , only : istsoil, istcrop, istice_mec - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(clumpfilter) , intent(inout) :: this_filter(:) ! the group of filters to set - logical , intent(in) :: include_inactive ! whether inactive points should be included in the filters - type(glc_behavior_type) , intent(in) :: glc_behavior - ! - ! LOCAL VARAIBLES: - integer :: nc ! clump index - integer :: c,l,p ! column, landunit, patch indices - integer :: fl ! lake filter index - integer :: fnl,fnlu ! non-lake filter index - integer :: fs ! soil filter index - integer :: f, fn ! general indices - integer :: g !gridcell index - !------------------------------------------------------------------------ - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(sourcefile, __LINE__)) - - nc = bounds%clump_index - - ! Create filter of all columns - fl = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - fl = fl + 1 - this_filter(nc)%allc(fl) = c - end if - end do - this_filter(nc)%num_allc = fl - - ! Create lake and non-lake filters at column-level - - fl = 0 - fnl = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - l =col%landunit(c) - if (lun%lakpoi(l)) then - fl = fl + 1 - this_filter(nc)%lakec(fl) = c - else - fnl = fnl + 1 - this_filter(nc)%nolakec(fnl) = c - end if - end if - end do - this_filter(nc)%num_lakec = fl - this_filter(nc)%num_nolakec = fnl - - ! Create lake and non-lake filters at patch-level - - fl = 0 - fnl = 0 - fnlu = 0 - do p = bounds%begp,bounds%endp - if (patch%active(p) .or. include_inactive) then - l =patch%landunit(p) - if (lun%lakpoi(l) ) then - fl = fl + 1 - this_filter(nc)%lakep(fl) = p - else - fnl = fnl + 1 - this_filter(nc)%nolakep(fnl) = p - if (.not. lun%urbpoi(l)) then - fnlu = fnlu + 1 - this_filter(nc)%nolakeurbanp(fnlu) = p - end if - end if - end if - end do - this_filter(nc)%num_lakep = fl - this_filter(nc)%num_nolakep = fnl - this_filter(nc)%num_nolakeurbanp = fnlu - - ! Create soil filter at column-level - - fs = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - l =col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fs = fs + 1 - this_filter(nc)%soilc(fs) = c - end if - end if - end do - this_filter(nc)%num_soilc = fs - - ! Create soil filter at patch-level - - fs = 0 - do p = bounds%begp,bounds%endp - if (patch%active(p) .or. include_inactive) then - l =patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fs = fs + 1 - this_filter(nc)%soilp(fs) = p - end if - end if - end do - this_filter(nc)%num_soilp = fs - - ! Create column-level hydrology filter (soil and Urban pervious road cols) - - f = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - if (col%hydrologically_active(c)) then - f = f + 1 - this_filter(nc)%hydrologyc(f) = c - end if - end if - end do - this_filter(nc)%num_hydrologyc = f - - ! Create prognostic crop and soil w/o prog. crop filters at patch-level - ! according to where the crop model should be used - - fl = 0 - fnl = 0 - do p = bounds%begp,bounds%endp - if (patch%active(p) .or. include_inactive) then - if (patch%itype(p) >= npcropmin) then !skips 2 generic crop types - fl = fl + 1 - this_filter(nc)%pcropp(fl) = p - else - l =patch%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fnl = fnl + 1 - this_filter(nc)%soilnopcropp(fnl) = p - end if - end if - end if - end do - this_filter(nc)%num_pcropp = fl - this_filter(nc)%num_soilnopcropp = fnl ! This wasn't being set before... - - ! Create landunit-level urban and non-urban filters - - f = 0 - fn = 0 - do l = bounds%begl,bounds%endl - if (lun%active(l) .or. include_inactive) then - if (lun%urbpoi(l)) then - f = f + 1 - this_filter(nc)%urbanl(f) = l - else - fn = fn + 1 - this_filter(nc)%nourbanl(fn) = l - end if - end if - end do - this_filter(nc)%num_urbanl = f - this_filter(nc)%num_nourbanl = fn - - ! Create column-level urban and non-urban filters - - f = 0 - fn = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - l = col%landunit(c) - if (lun%urbpoi(l)) then - f = f + 1 - this_filter(nc)%urbanc(f) = c - else - fn = fn + 1 - this_filter(nc)%nourbanc(fn) = c - end if - end if - end do - this_filter(nc)%num_urbanc = f - this_filter(nc)%num_nourbanc = fn - - ! Create patch-level urban and non-urban filters - - f = 0 - fn = 0 - do p = bounds%begp,bounds%endp - if (patch%active(p) .or. include_inactive) then - l = patch%landunit(p) - if (lun%urbpoi(l)) then - f = f + 1 - this_filter(nc)%urbanp(f) = p - else - fn = fn + 1 - this_filter(nc)%nourbanp(fn) = p - end if - end if - end do - this_filter(nc)%num_urbanp = f - this_filter(nc)%num_nourbanp = fn - - f = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - l = col%landunit(c) - if (lun%itype(l) == istice_mec) then - f = f + 1 - this_filter(nc)%icemecc(f) = c - end if - end if - end do - this_filter(nc)%num_icemecc = f - - f = 0 - do c = bounds%begc,bounds%endc - if (col%active(c) .or. include_inactive) then - l = col%landunit(c) - g = col%gridcell(c) - - ! Only compute SMB in regions where we replace ice melt with new ice: - ! Elsewhere (where ice melt remains in place), we cannot compute a sensible - ! negative SMB. - ! - ! In addition to istice_mec columns, we also compute SMB for any soil column in - ! this region, in order to provide SMB forcing for the bare ground elevation - ! class (elevation class 0). - if ( glc_behavior%melt_replaced_by_ice_grc(g) .and. & - (lun%itype(l) == istice_mec .or. lun%itype(l) == istsoil)) then - f = f + 1 - this_filter(nc)%do_smb_c(f) = c - end if - end if - end do - this_filter(nc)%num_do_smb_c = f - - ! Note: snow filters are reconstructed each time step in - ! LakeHydrology and SnowHydrology - ! Note: CNDV "pft present" filter is reconstructed each time CNDV is run - - end subroutine setFiltersOneGroup - - !----------------------------------------------------------------------- - subroutine setExposedvegpFilter(bounds, frac_veg_nosno) - ! - ! !DESCRIPTION: - ! Sets the exposedvegp and noexposedvegp filters for one clump. - ! - ! The exposedvegp filter includes points for which frac_veg_nosno > 0. noexposedvegp - ! includes points for which frac_veg_nosno <= 0. However, note that neither filter - ! includes urban or lake points! - ! - ! Should be called from within a loop over clumps. - ! - ! Only sets this filter in the main 'filter' variable, NOT in - ! filter_inactive_and_active. - ! - ! Note that this is done separately from the main setFilters routine, because it may - ! need to be called at a different time in the driver loop. - ! - ! !USES: - use decompMod , only : BOUNDS_LEVEL_CLUMP - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: frac_veg_nosno( bounds%begp: ) ! fraction of vegetation not covered by snow [patch] - ! - ! !LOCAL VARIABLES: - integer :: nc ! clump index - integer :: fp ! filter index - integer :: p ! patch index - integer :: fe, fn ! filter counts - - character(len=*), parameter :: subname = 'setExposedvegpFilter' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(frac_veg_nosno) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - - nc = bounds%clump_index - - fe = 0 - fn = 0 - do fp = 1, filter(nc)%num_nolakeurbanp - p = filter(nc)%nolakeurbanp(fp) - if (frac_veg_nosno(p) > 0) then - fe = fe + 1 - filter(nc)%exposedvegp(fe) = p - else - fn = fn + 1 - filter(nc)%noexposedvegp(fn) = p - end if - end do - filter(nc)%num_exposedvegp = fe - filter(nc)%num_noexposedvegp = fn - - end subroutine setExposedvegpFilter - - -end module filterMod diff --git a/src/main/findHistFields.pl b/src/main/findHistFields.pl deleted file mode 100755 index e9952e869d..0000000000 --- a/src/main/findHistFields.pl +++ /dev/null @@ -1,546 +0,0 @@ -#!/usr/bin/env perl -# -# This perl script reads in the histFldsMod.F90 file to find the total list of history -# fields that can be added for this model version, regardless of namelist options, or -# CPP processing. -# -use strict; -#use warnings; -#use diagnostics; - -use Cwd; -use English; -use Getopt::Long; -use IO::File; -use File::Glob ':glob'; - -# Set the directory that contains the CLM configuration scripts. If the command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume -# the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $cmdline = "@ARGV"; # Command line arguments to script -my $cwd = getcwd(); # current working directory -my $cfgdir; # absolute pathname of directory that contains this script -my $nm = "${ProgName}::"; # name to use if script dies -if ($ProgDir) { - $cfgdir = $ProgDir; -} else { - $cfgdir = $cwd; -} -# The namelist definition file contains entries for all namelist variables that -# can be output by build-namelist. -my $nl_definition_file = "$cfgdir/../../bld/namelist_files/namelist_definition_clm4_5.xml"; -(-f "$nl_definition_file") or die <<"EOF"; -** $ProgName - Cannot find namelist definition file \"$nl_definition_file\" ** -EOF -print "Using namelist definition file $nl_definition_file\n"; - -# The Build::NamelistDefinition module provides utilities to get the list of -# megan compounds - -#The root directory to cesm utils Tools -my $cesm_tools = "$cfgdir/../../../../cime/utils/"; - -if ( ! -f "$cesm_tools/perl5lib/Build/NamelistDefinition.pm") { - $cesm_tools = "$cfgdir/../../cime/utils/"; - if ( ! -f "$cesm_tools/perl5lib/Build/NamelistDefinition.pm") { - die <<"EOF"; -** $ProgName - Cannot find perl module \"Build/NamelistDefinition.pm\" in directory - \"$cesm_tools/perl5lib\" ** -EOF - } -} -# Add $cfgdir/perl5lib to the list of paths that Perl searches for modules -my @dirs = ( $cfgdir, "$cesm_tools/perl5lib"); -unshift @INC, @dirs; -require Build::NamelistDefinition; -# Create a namelist definition object. This object provides a method for verifying that -# the -# output namelist variables are in the definition file, and are output in the correct -# namelist groups. -my $definition = Build::NamelistDefinition->new($nl_definition_file); - - -my $mxname = 0; -my $mxlongn = 0; -my %fields; -my $fldnamevar = "fieldname_var"; - -sub matchKeyword { -# -# Match a keyword -# - my $keyword = shift; - my $line = shift; - my $fh = shift; - - my $match = undef; - if ( $line =~ /$keyword/ ) { - if ( $line =~ /$keyword\s*=\s*['"]([^'"]+)(['"&])/ ) { - $match = $1; - if ( $2 eq "&" ) { - $line = <$fh>; - if ( $line =~ /&([^'"]+)['"]/ ) { - $match .= $1; - } - } - } elsif ( $line =~ /$keyword\s*=\s*&\s*$/ ) { - $line = <$fh>; - if ( $line =~ /^\s*['"]([^'"]+)['"]/ ) { - $match = $1; - } else { - die "ERROR: Trouble getting keyword string\n Line: $line"; - } - } else { - if ( $line =~ /fname\s*=\s*fieldname/ ) { - print STDERR "Found variable used for fieldname = $line\n"; - $match = $fldnamevar; - } elsif ( $line =~ /fname\s*=\s*trim\(fname\)/ ) { - $match = undef; - } elsif ( $line =~ /units\s*=\s*units/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*long_name/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*lname/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*longname/ ) { - print STDERR "Found variable used for longname = $line\n"; - $match = "longname_var"; - } else { - die "ERROR: Still have a match on $keyword\n Line: $line"; - } - } - } - return( $match ); -} - -sub getFieldInfo { -# -# Get field Information -# - my $fh = shift; - my $line = shift; - - my $fname = undef; - my $units = undef; - my $longn = undef; - my $endin = undef; - do { - if ( $line =~ /MEG_/ ) { - $line =~ s|'//'_'|_'|g; - $line =~ s|'//trim\(meg_cmp\%name\)|megancmpd'|gi; - if ( $line =~ /meg_cmp\%name/ ) { - die "ERROR: Still have meg_cmp in a line\n"; - } - } - if ( $line =~ /^(.+)this\%species\%hist_fname\(\s*['"]*([^'"]+)['"]\s*[,]*([^\)]*)\)(.*)/ ) { - my $suffix = ""; - my $beg = $1; - my $mid = $2; - my $suf = $3; - my $end = $4; - if ( $suf =~ /suffix\s*=\s*['"]([^'"]+)['"]/ ) { - $suffix=$1; - } - $line = "$beg 'ISO_${mid}ELEM_${suffix}' $end"; - } - $line -~ s|['"]\s*\/\/\s*this\%species\%get_species\(\)\s*\/\/\s*['"]|ELEM_|g; - if ( ! defined($fname) ) { - $fname = &matchKeyword( "fname", $line, $fh ); - } - if ( ! defined($units) ) { - $units = &matchKeyword( "units", $line, $fh ); - } - if ( ! defined($longn) ) { - $longn = &matchKeyword( "long_name", $line, $fh ); - } - if ( $line =~ /\)\s*$/ ) { - $endin = 1; - } - if ( ! defined($endin) ) { $line = <$fh>; } - - } until( (defined($fname) && defined($units) && defined($longn)) || - ! defined($line) || defined($endin) ); - if ( ! defined($fname) ) { - print "fname: $fname units: $units longn: $longn endin: $endin\n"; - die "ERROR: name undefined for field ending with: $line\n"; - } - return( $fname, $longn, $units ); -} - -sub setField { -# -# Set the field -# - my $name = shift; - my $longn = shift; - my $units = shift; - - if ( defined($name) && $name ne $fldnamevar ) { - if ( length($name) > $mxname ) { $mxname = length($name); } - if ( length($longn) > $mxlongn ) { $mxlongn = length($longn); } - my $len; - if ( length($longn) > 90 ) { - $len = 110; - } elsif ( length($longn) > 60 ) { - $len = 90; - } else { - $len = 60; - } - $fields{$name}{'field'} = sprintf( "%-${len}s\t(%s)", $longn, $units ); - $fields{$name}{'longn'} = $longn; - $fields{$name}{'units'} = $units; - } -} - -sub XML_Header { -# -# Write out header to history fields file -# - my $outfh = shift; - my $outfilename = shift; - - print STDERR " Write out header to history fields file to: $outfilename\n"; - my $svnurl = '$URL: https://svn-ccsm-models.cgd.ucar.edu/clm2/trunk_tags/clm4_0_40/models/lnd/clm/src/main/findHistFields.pl $'; - my $svnid = '$Id: findHistFields.pl 34757 2012-02-15 18:38:05Z erik $'; - print $outfh <<"EOF"; - - -\<\?xml-stylesheet type="text\/xsl" href="history_fields.xsl"\?\> - -\<\!-- - List of history file field names, long-names and units for all the fields output - by CLM. - SVN version information: - $svnurl - $svnid ---\> - -\ -EOF -} - -sub XML_Footer { -# -# Write out footer to history fields file -# - my $outfh = shift; - - print STDERR " Write out footer to history fields file\n"; - print $outfh "\n\n"; -} - -my $pwd = `pwd`; -chomp( $pwd ); -my @megcmpds = $definition->get_valid_values( "megan_cmpds", 'noquotes'=>1 ); -my @filenames = glob( "$pwd/*.F90" ); -push( @filenames, glob( "$pwd/../biogeochem/*.F90" ) ); -push( @filenames, glob( "$pwd/../biogeophys/*.F90" ) ); -push( @filenames, glob( "$pwd/../soilbiogeochem/*.F90" ) ); -push( @filenames, glob( "$pwd/../biogeophys/*.F90" ) ); -push( @filenames, glob( "$pwd/../fates/main/*.F90" ) ); - -# -# Loop over all files that have hist_addfld calls in them -# -foreach my $filename ( @filenames ) { - - if ( $filename =~ /histFileMod.F90$/ ) { - next; - } - my $fh = IO::File->new($filename, '<') or die "** $ProgName - can't open history Fields file: $filename\n"; - print( "Filename: $filename\n" ); - # - # Read in the list of fields from the source file - # - while (my $line = <$fh>) { - - # Comments - if ($line =~ /(.*)\!/) { - $line = $1; - } - #if ($line =~ /end subroutine/) { - # last; - #} - my $format = "\n\n"; - if ($line =~ /call\s*hist_addfld/i ) { - (my $name, my $longn, my $units) = &getFieldInfo( $fh, $line ); - if ( $name ne "MEG_megancmpd" && $name =~ /ISO_/ ) { - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } elsif ( $name =~ /ISO_/ ) { - foreach my $iso ( "C12", "C13", "C14", "N" ) { - my $elem = substr( $iso, 0, 1 ); - $name =~ s/ISO_/$iso/g; - $name =~ s/ELEM_/$elem/g; - $longn =~ s/ISO_/$elem/g; - $longn =~ s/ELEM_/$elem/g; - $units =~ s/ISO_/$iso/g; - $units =~ s/ELEM_/$elem/g; - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } - } elsif ( $name eq "MEG_megancmpd" ) { - foreach my $megcmpd ( @megcmpds ) { - my $name = "MEG_${megcmpd}"; - &setField( $name, $longn, $units ); - printf( , $format, $name, $units, $longn ); - } - } - } - } - close( $fh ); -} -print STDERR " mxname = $mxname\n"; -print STDERR " mxlongn = $mxlongn\n"; -my %pool_name = ( - L1=> { hist=>'LITR1', long=>'litter 1' }, - L2=> { hist=>'LITR2', long=>'litter 2' }, - L3=> { hist=>'LITR3', long=>'litter 3' }, - CWD=>{ hist=>'CWD', long=>'coarse woody debris' }, - S1=> { hist=>'SOIL1', long=>'soil 1' }, - S2=> { hist=>'SOIL2', long=>'soil 2' }, - S3=> { hist=>'SOIL3', long=>'soil 3' }, - S4=> { hist=>'SOIL4', long=>'soil 4' }, - atm=>{ hist=>'atmosphere', long=>'atmosphere' }, - ); - -my %vrt_suffix = ( C=>" C", "C_vr"=>" C (vertically resolved)", C_1m=>" C to 1 meter", - C_30cm=>" C to 30 cm", C_activelayer=>" C in active layer", - N=>" C", "N_vr"=>" N (vertically resolved)", N_1m=>" N to 1 meter", - N_30cm=>" N to 30 cm", N_activelayer=>" N in active layer", - ); -my %firelist = ( - C_TO_FIRE=>" C fire loss", C_TO_FIRE_vr=>" C fire loss", - N_TO_FIRE=>" N fire loss", N_TO_FIRE_vr=>" N fire loss", - ); -my %leechlist = ( - C_TO_LEACHING=>" C leaching loss", C_TNDNCY_VERT_TRANSPORT=>" C tendency due to vertical transport", - N_TO_LEACHING=>" N leaching loss", N_TNDNCY_VERT_TRANSPORT=>" N tendency due to vertical transport", - ); -# -# Add fields that are looped over -# -my $name, my $longn, my $units; -foreach my $pool ( keys(%pool_name) ) { - my $fname = $pool_name{$pool}{'hist'}; - foreach my $fld ( keys(%vrt_suffix) ) { - $name = $fname . $fld; - $longn = $pool_name{$pool}{'hist'} . $vrt_suffix{$fld}; - $units; - if ( $fld eq "C_vr" ) { - $units = "gC/m^3"; - } elsif ( $fld eq "N_vr" ) { - $units = "gN/m^3"; - } elsif ( $fld =~ /^N/) { - $units = "gN/m^2"; - } else { - $units = "gC/m^2"; - } - &setField( $name, $longn, $units ); - if ( $fld eq "C" || $fld eq "C_vr" ) { - foreach my $ciso ( "C13", "C14" ) { - $name = $ciso."_".$fname . $fld; - $longn = $ciso." ".$pool_name{$pool}{'long'} . $vrt_suffix{$fld}; - if ( $fld eq "C_vr" ) { - $units = "g${ciso}m^3"; - } else { - $units = "g${ciso}/m^2"; - } - &setField( $name, $longn, $units ); - } - } - if ( $fld =~ "C_1m" || $fld eq "C_30m" || $fld eq "C_activelayer" ) { - foreach my $ciso ( "C14" ) { - $name = $ciso."_".$fname . $fld; - $longn = $ciso." ".$pool_name{$pool}{'long'} . $vrt_suffix{$fld}; - $units = "g${ciso}/m^2"; - &setField( $name, $longn, $units ); - } - } - } - # Fire list - if ( $fname =~ /^CWD/ || $fname =~ /^LIT/ ) { - foreach my $fld ( keys(%firelist) ) { - $name = "M_".$fname . $fld; - $longn = $firelist{$fname}; - $units; - if ( $fld =~ /_vr$/ ) { - $units = "gC/m^3"; - } else { - $units = "gC/m^2"; - } - &setField( $name, $longn, $units ); - # Carbon isotopes (C13/C14) - if ( $fld =~ /^C/ ) { - foreach my $ciso ( "C13", "C14" ) { - $name = "${ciso}_M_".$fname . $fld; - $longn = $ciso.$firelist{$fname}; - if ( $fld =~ /_vr$/ ) { - $units = "g${ciso}/m^3"; - } else { - $units = "g${ciso}/m^2"; - } - &setField( $name, $longn, $units ); - } - } - } - } - # Potential loss coefficient - $name = "K_".$fname; - $longn = $pool_name{$pool}{'long'} . " potential loss coefficient"; - $units = "1/s"; - &setField( $name, $longn, $units ); - # - # Not CWD - # - if ( $fname !~ /^CWD/ ) { - foreach my $fld ( keys(%leechlist) ) { - $name = "M_".$fname . $fld; - $longn = $leechlist{$fname}; - my $elm; - if ( $fld =~ /^N/ ) { - $elm = "N"; - } else { - $elm = "C"; - } - if ( $fld =~ /VERT$/ ) { - $units = "g${elm}/m^3"; - } else { - $units = "g${elm}/m^2"; - } - &setField( $name, $longn, $units ); - } - } -} -my %translist = ( - # CN transitions - L1S1 =>{d=>"L1", r=>"S1"}, L2S2 =>{d=>"L2", r=>"S2"}, - L3S3 =>{d=>"L3", r=>"S3"}, S1S2 =>{d=>"S1", r=>"S2"}, - S2S3 =>{d=>"S2", r=>"S3"}, S3S4 =>{d=>"S3", r=>"S4"}, - S4 =>{d=>"S4", r=>"atm"}, - CWDL2=>{d=>"CWD", r=>"L2"}, CWDL3=>{d=>"CWD", r=>"L3"}, - # CENTURY transitions NOT already given above - L2S1 =>{d=>"L2", r=>"S1"}, L3S2 =>{d=>"L3", r=>"S2"}, - S1S3 =>{d=>"S1", r=>"S3"}, S2S1 =>{d=>"S2", r=>"S1"}, - S3S1 =>{d=>"S3", r=>"S1"}, - ); -# -# Transition list (NOT complete) -# -my $unitsvr; -foreach my $trans ( keys(%translist) ) { - my $donor = $translist{$trans}{'d'}; - my $rcvr = $translist{$trans}{'r'}; - if ( $trans ne "${donor}${rcvr}" && ($rcvr ne "atm" || $trans ne $donor) ) { - die "ERROR: Either bad transition name: $trans or bad donor: $donor or receiver: -$rcvr\n"; - } - # Carbon isotopes - foreach my $ciso ( "", "C13", "C14" ) { - if ( $ciso eq "" ) { - $units = "gC/m^2/s"; - $unitsvr = "gC/m^3/s"; - } else { - $units = "g${ciso}/m^2/s"; - $unitsvr = "g${ciso}/m^3/s"; - } - if ( $donor ne "CWD" ) { - my $ii = 0; - foreach my $trans2 ( keys(%translist) ) { - if ($donor eq $translist{$trans}{'d'} ) { $ii = $ii + 1; } - } - # HR - if ( $ii == 1 ) { - $name = $pool_name{$donor}{'hist'}."_HR"; - } else { - $name = $pool_name{$donor}{'hist'}."_HR_$rcvr"; - } - if ( $ciso ne "" ) { - $name = "${ciso}$name"; - } - $longn = 'Het. Resp. from '.$pool_name{$donor}{'long'}; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved version - &setField( "${name}_vr", $longn, $unitsvr ); - } - if ( $rcvr ne "atm" ) { - # transfer - $name = $pool_name{$donor}{'hist'}. "C_TO_" . - $pool_name{$rcvr}{'hist'}. "C"; - $longn = "decomp of " . $pool_name{$donor}{'long'}. " C to " . - $pool_name{$rcvr}{'long'}. " C"; - if ( $ciso ne "" ) { - $name = "${ciso}$name"; - } - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved version - &setField( "${name}_vr", $longn, $unitsvr ); - } - } - - #-- mineralization/immobilization fluxes (none from CWD) - if ( $donor ne "CWD" ) { - $units = "gN/m^2/s"; - $unitsvr = "gN/m^3/s"; - if ( $rcvr ne "atm" ) { - $name = "SMINN_TO_".$pool_name{$rcvr}{'hist'}. "N_$donor"; - } else { - $name = $pool_name{$donor}{'hist'}. "N_TO_SMINN"; - } - $longn = "mineral N flux for decomp. of " . $pool_name{$donor}{'hist'}; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, $unitsvr ); - # transfer fluxes - if ( $rcvr ne "atm" ) { - $name = $pool_name{$donor}{'hist'}. "N_TO_" . - $pool_name{$rcvr}{'hist'}. "N"; - $longn = "decomp of " . $pool_name{$donor}{'long'}. " N to " . - $pool_name{$rcvr}{'long'}. " N"; - # vertically integrated fluxes - &setField( $name, $longn, $units ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, $unitsvr ); - } - # NITRIF_DENITRIF - $name = "SMINN_TO_DENIT_$trans"; - $longn = "denitrification for decomp. of " . $pool_name{$donor}{'long'} . - "to ". $pool_name{$rcvr}{'hist'}; - &setField( $name, $longn, "gN/m^2" ); - # vertically resolved fluxes - &setField( "${name}_vr", $longn, "gN/m^3" ); - } -} - -# -# List the fields in a neatly ordered list -# And Output to an XML file -# -my $outfilename = "$pwd/../../bld/namelist_files/history_fields_clm4_5.xml"; - -my $outfh = IO::File->new($outfilename, '>') or die "** $ProgName - can't open output history Fields XML file: $outfilename\n"; -&XML_Header( $outfh, $outfilename ); -foreach my $name ( sort(keys(%fields)) ) { - my $len; - if ( length($name) > 20 ) { - $len = 40; - } else { - $len = 20; - } - printf( "%-${len}s = %s\n", $name, $fields{$name}{'field'} ); - printf( $outfh "\n\n", - $name, $fields{$name}{'units'}, $fields{$name}{'longn'} ); -} - -&XML_Footer( $outfh ); -close( $outfh ); diff --git a/src/main/glc2lndMod.F90 b/src/main/glc2lndMod.F90 deleted file mode 100644 index c7e4402ac9..0000000000 --- a/src/main/glc2lndMod.F90 +++ /dev/null @@ -1,674 +0,0 @@ -module glc2lndMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle arrays used for exchanging data from glc to clm. - ! - ! !USES: -#include "shr_assert.h" - use decompMod , only : bounds_type - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : maxpatch_glcmec - use clm_varctl , only : iulog, glc_do_dynglacier - use clm_varcon , only : nameg, spval, ispval - use abortutils , only : endrun - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use landunit_varcon, only : istice_mec - use glcBehaviorMod , only : glc_behavior_type - ! - ! !REVISION HISTORY: - ! Created by William Lipscomb, Dec. 2007, based on clm_atmlnd.F90. - ! - ! !PUBLIC TYPES: - implicit none - private - save - - ! glc -> land variables structure - type, public :: glc2lnd_type - - ! ------------------------------------------------------------------------ - ! Public data - ! ------------------------------------------------------------------------ - - ! Where we should do runoff routing that is appropriate for having a dynamic icesheet underneath. - real(r8), pointer :: glc_dyn_runoff_routing_grc (:) => null() - - ! ------------------------------------------------------------------------ - ! Private data - ! ------------------------------------------------------------------------ - - type(glc_behavior_type), pointer, private :: glc_behavior ! reference to the glc_behavior instance - - real(r8), pointer, private :: frac_grc (:,:) => null() - real(r8), pointer, private :: topo_grc (:,:) => null() - real(r8), pointer, private :: hflx_grc (:,:) => null() - - ! Area in which GLC model can accept surface mass balance, received from glc (0-1) - real(r8), pointer, private :: icemask_grc (:) => null() - - ! icemask_coupled_fluxes_grc is like icemask_grc, but the mask only contains icesheet - ! points that potentially send non-zero fluxes to the coupler. i.e., it does not - ! contain icesheets that are diagnostic only, because for those diagnostic ice sheets - ! (which do not send calving fluxes to the coupler), we need to use the non-dynamic - ! form of runoff routing in CLM in order to conserve water properly. - ! - ! (However, note that this measure of "diagnostic-only" does not necessarily - ! correspond to whether CLM is updating its glacier areas there - for example, we - ! could theoretically have an icesheet whose areas are evolving, and CLM is updating - ! its glacier areas to match, but where we're zeroing out the fluxes sent to the - ! coupler, and so we're using the non-dynamic form of runoff routing in CLM.) - real(r8), pointer, private :: icemask_coupled_fluxes_grc (:) => null() - - contains - - ! ------------------------------------------------------------------------ - ! Public routines - ! ------------------------------------------------------------------------ - - procedure, public :: Init - procedure, public :: Clean - - ! In each timestep, these routines should be called in order (though they don't need - ! to be called all at once): - ! - set_glc2lnd_fields - ! - update_glc2lnd_fracs - ! - update_glc2lnd_topo - procedure, public :: set_glc2lnd_fields ! set coupling fields sent from glc to lnd - procedure, public :: update_glc2lnd_fracs ! update subgrid fractions based on input from GLC - procedure, public :: update_glc2lnd_topo ! update topographic heights - - ! For unit testing only: - procedure, public :: for_test_set_glc2lnd_fields_directly ! set glc2lnd fields directly in a unit testing context - - ! ------------------------------------------------------------------------ - ! Private routines - ! ------------------------------------------------------------------------ - - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - ! sanity-check icemask from GLC - procedure, private :: check_glc2lnd_icemask - - ! sanity-check icemask_coupled_fluxes from GLC - procedure, private :: check_glc2lnd_icemask_coupled_fluxes - - ! update glc_dyn_runoff_routing field based on input from GLC - procedure, private :: update_glc2lnd_dyn_runoff_routing - - end type glc2lnd_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, glc_behavior) - - class(glc2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - type(glc_behavior_type), intent(in), target :: glc_behavior - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - call this%InitCold(bounds, glc_behavior) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize glc variables required by the land - ! - ! !ARGUMENTS: - class (glc2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begg,endg - !------------------------------------------------------------------------ - - begg = bounds%begg; endg = bounds%endg - - allocate(this%frac_grc (begg:endg,0:maxpatch_glcmec)) ; this%frac_grc (:,:) = nan - allocate(this%topo_grc (begg:endg,0:maxpatch_glcmec)) ; this%topo_grc (:,:) = nan - allocate(this%hflx_grc (begg:endg,0:maxpatch_glcmec)) ; this%hflx_grc (:,:) = nan - allocate(this%icemask_grc (begg:endg)) ; this%icemask_grc (:) = nan - allocate(this%icemask_coupled_fluxes_grc (begg:endg)) ; this%icemask_coupled_fluxes_grc (:) = nan - allocate(this%glc_dyn_runoff_routing_grc (begg:endg)) ; this%glc_dyn_runoff_routing_grc (:) = nan - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(glc2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begg, endg - - character(len=*), parameter :: subname = 'InitHistory' - !----------------------------------------------------------------------- - - begg = bounds%begg - endg = bounds%endg - - this%icemask_grc(begg:endg) = spval - call hist_addfld1d (fname='ICE_MODEL_FRACTION', units='unitless', & - avgflag='A', long_name='Ice sheet model fractional coverage', & - ptr_gcell=this%icemask_grc, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, glc_behavior) - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - class(glc2lnd_type) :: this - type(bounds_type), intent(in) :: bounds - type(glc_behavior_type), intent(in), target :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: begg, endg - - character(len=*), parameter :: subname = 'InitCold' - !----------------------------------------------------------------------- - - begg = bounds%begg - endg = bounds%endg - - this%glc_behavior => glc_behavior - - this%frac_grc(begg:endg, :) = 0.0_r8 - this%topo_grc(begg:endg, :) = 0.0_r8 - this%hflx_grc(begg:endg, :) = 0.0_r8 - - ! When running with a stub glc model, it's important that icemask_grc be initialized - ! to 0 everywhere. With an active glc model, icemask_grc will be updated in the first - ! time step, and it isn't needed before then, so it's safe to initialize it to 0. - ! Since icemask is 0, icemask_coupled_fluxes needs to be 0, too (and the latter is - ! safest in case we aren't coupled to CISM, to ensure that we use the uncoupled form - ! of runoff routing). - this%icemask_grc(begg:endg) = 0.0_r8 - this%icemask_coupled_fluxes_grc(begg:endg) = 0.0_r8 - - call this%update_glc2lnd_dyn_runoff_routing(bounds) - - end subroutine InitCold - - - !----------------------------------------------------------------------- - subroutine Clean(this) - ! - ! !DESCRIPTION: - ! Deallocate memory in this object - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - deallocate(this%frac_grc) - deallocate(this%topo_grc) - deallocate(this%hflx_grc) - deallocate(this%icemask_grc) - deallocate(this%icemask_coupled_fluxes_grc) - deallocate(this%glc_dyn_runoff_routing_grc) - - end subroutine Clean - - !----------------------------------------------------------------------- - subroutine set_glc2lnd_fields(this, bounds, glc_present, x2l, & - index_x2l_Sg_ice_covered, index_x2l_Sg_topo, index_x2l_Flgg_hflx, & - index_x2l_Sg_icemask, index_x2l_Sg_icemask_coupled_fluxes) - ! - ! !DESCRIPTION: - ! Set coupling fields sent from glc to lnd - ! - ! If glc_present is true, then the given fields are all assumed to be valid; if - ! glc_present is false, then these fields are ignored. - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - logical , intent(in) :: glc_present ! true if running with a non-stub glc model - real(r8) , intent(in) :: x2l(:, bounds%begg: ) ! driver import state to land model [field, gridcell] - integer , intent(in) :: index_x2l_Sg_ice_covered( 0: ) ! indices of ice-covered field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Sg_topo( 0: ) ! indices of topo field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Flgg_hflx( 0: ) ! indices of heat flux field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Sg_icemask ! index of icemask field in x2l - integer , intent(in) :: index_x2l_Sg_icemask_coupled_fluxes ! index of icemask_coupled_fluxes field in x2l - ! - ! !LOCAL VARIABLES: - integer :: g - integer :: icemec_class - - character(len=*), parameter :: subname = 'set_glc2lnd_fields' - !----------------------------------------------------------------------- - - SHR_ASSERT((ubound(x2l, 2) == bounds%endg), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(index_x2l_Sg_ice_covered) == (/maxpatch_glcmec/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(index_x2l_Sg_topo) == (/maxpatch_glcmec/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(index_x2l_Flgg_hflx) == (/maxpatch_glcmec/)), errMsg(sourcefile, __LINE__)) - - if (glc_present) then - do g = bounds%begg, bounds%endg - do icemec_class = 0, maxpatch_glcmec - this%frac_grc(g,icemec_class) = x2l(index_x2l_Sg_ice_covered(icemec_class),g) - this%topo_grc(g,icemec_class) = x2l(index_x2l_Sg_topo(icemec_class),g) - this%hflx_grc(g,icemec_class) = x2l(index_x2l_Flgg_hflx(icemec_class),g) - end do - this%icemask_grc(g) = x2l(index_x2l_Sg_icemask,g) - this%icemask_coupled_fluxes_grc(g) = x2l(index_x2l_Sg_icemask_coupled_fluxes,g) - end do - - call this%check_glc2lnd_icemask(bounds) - call this%check_glc2lnd_icemask_coupled_fluxes(bounds) - call this%update_glc2lnd_dyn_runoff_routing(bounds) - else - if (glc_do_dynglacier) then - call endrun(' ERROR: With glc_present false (e.g., a stub glc model), glc_do_dynglacier must be false '// & - errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine set_glc2lnd_fields - - !----------------------------------------------------------------------- - subroutine for_test_set_glc2lnd_fields_directly(this, bounds, & - topo, icemask) - ! - ! !DESCRIPTION: - ! Set glc2lnd fields directly in a unit testing context - ! - ! This currently only provides a mechanism to set fields that are actually needed in - ! our unit tests. More could be added later. - ! - ! Also: In contrast to the production version (set_glc2lnd_fields), this does NOT - ! currently update glc2lnd_dyn_runoff_routing (because doing so would require having a - ! sensible glc_behavior, which we may not have; and also, we currently don't need this - ! field in a unit testing context). (Note: If we eventually want/need to update - ! glc2lnd_dyn_runoff_routing, and thus need a fully sensible glc_behavior, then we - ! should extract the self-calls at the end of set_glc2lnd_fields - ! (check_glc2lnd_icemask, check_glc2lnd_icemask_coupled_fluxes, - ! update_glc2lnd_dyn_runoff_routing) into a private routine like - ! set_glc2lnd_fields_wrapup, which could be called by both set_glc2lnd_fields and this - ! routine.) - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - real(r8), intent(in), optional :: topo( bounds%begg: , 0: ) ! topographic height [gridcell, elevclass] - real(r8), intent(in), optional :: icemask( bounds%begg: ) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'for_test_set_glc2lnd_fields_directly' - !----------------------------------------------------------------------- - - if (present(topo)) then - SHR_ASSERT_ALL((ubound(topo) == (/bounds%endg, maxpatch_glcmec/)), errMsg(sourcefile, __LINE__)) - this%topo_grc(bounds%begg:bounds%endg, 0:maxpatch_glcmec) = topo(bounds%begg:bounds%endg, 0:maxpatch_glcmec) - end if - - if (present(icemask)) then - SHR_ASSERT_ALL((ubound(icemask) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - this%icemask_grc(bounds%begg:bounds%endg) = icemask(bounds%begg:bounds%endg) - end if - - end subroutine for_test_set_glc2lnd_fields_directly - - !----------------------------------------------------------------------- - subroutine check_glc2lnd_icemask(this, bounds) - ! - ! !DESCRIPTION: - ! Do a sanity check on the icemask received from CISM via coupler. - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - - character(len=*), parameter :: subname = 'check_glc2lnd_icemask' - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - - if (this%icemask_grc(g) > 0._r8) then - - ! Ensure that icemask is a subset of has_virtual_columns. This is needed because - ! we allocated memory based on has_virtual_columns, so it is a problem if the - ! ice sheet tries to expand beyond the area defined by has_virtual_columns. - if (.not. this%glc_behavior%has_virtual_columns_grc(g)) then - write(iulog,'(a)') subname//' ERROR: icemask must be a subset of has_virtual_columns.' - write(iulog,'(a)') 'Ensure that the glacier_region_behavior namelist item is set correctly.' - write(iulog,'(a)') '(It should specify "virtual" for the region corresponding to the GLC domain.)' - write(iulog,'(a)') 'If glacier_region_behavior is set correctly, then you can fix this problem' - write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' - write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' - write(iulog,'(a)') '- i.e., the region specified as "virtual" in glacier_region_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - ! Ensure that icemask is a subset of melt_replaced_by_ice. This is needed - ! because we only compute SMB in the region given by melt_replaced_by_ice - ! (according to the logic for building the do_smb filter), and we need SMB - ! everywhere inside the icemask. - if (.not. this%glc_behavior%melt_replaced_by_ice_grc(g)) then - write(iulog,'(a)') subname//' ERROR: icemask must be a subset of melt_replaced_by_ice.' - write(iulog,'(a)') 'Ensure that the glacier_region_melt_behavior namelist item is set correctly.' - write(iulog,'(a)') '(It should specify "replaced_by_ice" for the region corresponding to the GLC domain.)' - write(iulog,'(a)') 'If glacier_region_behavior is set correctly, then you can fix this problem' - write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' - write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' - write(iulog,'(a)') '- i.e., the region specified as "replaced_by_ice" in glacier_region_melt_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - end if - end do - - end subroutine check_glc2lnd_icemask - - !----------------------------------------------------------------------- - subroutine check_glc2lnd_icemask_coupled_fluxes(this, bounds) - ! - ! !DESCRIPTION: - ! Do a sanity check on the icemask_coupled_fluxes field received from CISM via coupler. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - - character(len=*), parameter :: subname = 'check_glc2lnd_icemask_coupled_fluxes' - !----------------------------------------------------------------------- - - do g = bounds%begg, bounds%endg - - ! Ensure that icemask_coupled_fluxes is a subset of icemask. Although there - ! currently is no code in CLM that depends on this relationship, it seems helpful - ! to ensure that this intuitive relationship holds, so that code developed in the - ! future can rely on it. - if (this%icemask_coupled_fluxes_grc(g) > 0._r8 .and. this%icemask_grc(g) == 0._r8) then - write(iulog,*) subname//' ERROR: icemask_coupled_fluxes must be a subset of icemask.' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - end do - - end subroutine check_glc2lnd_icemask_coupled_fluxes - - !----------------------------------------------------------------------- - subroutine update_glc2lnd_dyn_runoff_routing(this, bounds) - ! - ! !DESCRIPTION: - ! Update glc_dyn_runoff_routing field based on updated icemask_coupled_fluxes field - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - - character(len=*), parameter :: subname = 'update_glc2lnd_dyn_runoff_routing' - !----------------------------------------------------------------------- - - ! Wherever we have an icesheet that is computing and sending fluxes to the coupler - - ! which particularly means it is computing a calving flux - we will use the - ! "glc_dyn_runoff_routing" scheme, with 0 < glc_dyn_runoff_routing <= 1. - ! In these places, all or part of the snowcap flux goes to CISM rather than the runoff model. - ! In other places - including places where CISM is not running at all, as well as places - ! where CISM is running in diagnostic-only mode and therefore is not sending a calving flux - - ! we have glc_dyn_runoff_routing = 0, and the snowcap flux goes to the runoff model. - ! This is needed to conserve water correctly in the absence of a calving flux. - - do g = bounds%begg, bounds%endg - - ! Set glc_dyn_runoff_routing_grc(g) to a value in the range [0,1]. - ! - ! This value gives the grid cell fraction that is deemed to be coupled to the - ! dynamic ice sheet model. For this fraction of the grid cell, snowcap fluxes are - ! sent to the ice sheet model. The remainder of the grid cell sends snowcap fluxes - ! to the runoff model. - ! - ! Note: The coupler (in prep_glc_mod.F90) assumes that the fraction coupled to the - ! dynamic ice sheet model is min(lfrac, Sg_icemask_l), where lfrac is the - ! "frac" component of fraction_lx, and Sg_icemask_l is obtained by mapping - ! Sg_icemask_g from the glc to the land grid. Here, ldomain%frac is - ! equivalent to lfrac, and this%icemask_grc is equivalent to Sg_icemask_l. - ! However, here we use icemask_coupled_fluxes_grc, so that we route all snow - ! capping to runoff in areas where the ice sheet is not generating calving - ! fluxes. In addition, here we need to divide by lfrac, because the coupler - ! multiplies by it later (and, for example, if lfrac = 0.1 and - ! icemask_coupled_fluxes = 1, we want all snow capping to go to the ice - ! sheet model, not to the runoff model). - ! - ! Note: In regions where CLM overlaps the CISM domain, this%icemask_grc(g) typically - ! is nearly equal to ldomain%frac(g). So an alternative would be to simply set - ! glc_dyn_runoff_routing_grc(g) = icemask_grc(g). - ! The reason to cap glc_dyn_runoff_routing at lfrac is to avoid sending the - ! ice sheet model a greater mass of water (in the form of snowcap fluxes) - ! than is allowed to fall on a CLM grid cell that is part ocean. - - ! TODO(wjs, 2017-05-08) Ideally, we wouldn't have this duplication in logic - ! between the coupler and CLM. The best solution would be to have the coupler - ! itself do the partitioning of the snow capping flux between the ice sheet model - ! and the runoff model. A next-best solution would be to have the coupler send a - ! field to CLM telling it what fraction of snow capping should go to the runoff - ! model in each grid cell. - - if (ldomain%frac(g) == 0._r8) then - ! Avoid divide by 0; note that, in this case, the amount going to runoff isn't - ! important for system-wide conservation, so we could really choose anything we - ! want. - this%glc_dyn_runoff_routing_grc(g) = this%icemask_coupled_fluxes_grc(g) - else - this%glc_dyn_runoff_routing_grc(g) = & - min(ldomain%frac(g), this%icemask_coupled_fluxes_grc(g)) / & - ldomain%frac(g) - end if - - if (this%glc_dyn_runoff_routing_grc(g) > 0.0_r8) then - - ! Ensure that glc_dyn_runoff_routing is a subset of melt_replaced_by_ice. This - ! is needed because glacial melt is only sent to the runoff stream in the region - ! given by melt_replaced_by_ice (because the latter is used to create the do_smb - ! filter, and the do_smb filter controls where glacial melt is computed). - if (.not. this%glc_behavior%melt_replaced_by_ice_grc(g)) then - write(iulog,'(a)') subname//' ERROR: icemask_coupled_fluxes must be a subset of melt_replaced_by_ice.' - write(iulog,'(a)') 'Ensure that the glacier_region_melt_behavior namelist item is set correctly.' - write(iulog,'(a)') '(It should specify "replaced_by_ice" for the region corresponding to the GLC domain.)' - write(iulog,'(a)') 'If glacier_region_behavior is set correctly, then you can fix this problem' - write(iulog,'(a)') 'by modifying GLACIER_REGION on the surface dataset.' - write(iulog,'(a)') '(Expand the region that corresponds to the GLC domain' - write(iulog,'(a)') '- i.e., the region specified as "replaced_by_ice" in glacier_region_melt_behavior.)' - call endrun(decomp_index=g, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - end if - end do - - end subroutine update_glc2lnd_dyn_runoff_routing - - - - !----------------------------------------------------------------------- - subroutine update_glc2lnd_fracs(this, bounds) - ! - ! !DESCRIPTION: - ! Update subgrid fractions based on input from GLC (via the coupler) - ! - ! The weights updated here are some col%wtlunit and lun%wtgcell values - ! - ! If glc_do_dynglacier is false, nothing is changed - ! - ! !USES: - use column_varcon , only : col_itype_to_icemec_class - use subgridWeightsMod , only : set_landunit_weight - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(in) :: this - type(bounds_type) , intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: g,c ! indices - real(r8):: area_ice_mec ! area of the ice_mec landunit - integer :: l_ice_mec ! index of the ice_mec landunit - integer :: icemec_class ! current icemec class (1..maxpatch_glcmec) - logical :: frac_assigned(1:maxpatch_glcmec) ! whether this%frac has been assigned for each elevation class - logical :: error ! if an error was found - - character(len=*), parameter :: subname = 'update_glc2lnd_fracs' - !----------------------------------------------------------------------- - - if (glc_do_dynglacier) then - do g = bounds%begg, bounds%endg - ! Values from GLC are only valid within the icemask, so we only update CLM's areas there - if (this%icemask_grc(g) > 0._r8) then - - ! Set total icemec landunit area - area_ice_mec = sum(this%frac_grc(g, 1:maxpatch_glcmec)) - call set_landunit_weight(g, istice_mec, area_ice_mec) - - ! If new landunit area is greater than 0, then update column areas - ! (If new landunit area is 0, col%wtlunit is arbitrary, so we might as well keep the existing values) - if (area_ice_mec > 0) then - ! Determine index of the glc_mec landunit - l_ice_mec = grc%landunit_indices(istice_mec, g) - if (l_ice_mec == ispval) then - write(iulog,*) subname//' ERROR: no ice_mec landunit found within the icemask, for g = ', g - call endrun() - end if - - frac_assigned(1:maxpatch_glcmec) = .false. - do c = lun%coli(l_ice_mec), lun%colf(l_ice_mec) - icemec_class = col_itype_to_icemec_class(col%itype(c)) - col%wtlunit(c) = this%frac_grc(g, icemec_class) / lun%wtgcell(l_ice_mec) - frac_assigned(icemec_class) = .true. - end do - - ! Confirm that all elevation classes that have non-zero area according to - ! this%frac have been assigned to a column in CLM's data structures - error = .false. - do icemec_class = 1, maxpatch_glcmec - if (this%frac_grc(g, icemec_class) > 0._r8 .and. & - .not. frac_assigned(icemec_class)) then - error = .true. - end if - end do - if (error) then - write(iulog,*) subname//' ERROR: at least one glc_mec column has non-zero area from the coupler,' - write(iulog,*) 'but there was no slot in memory for this column; g = ', g - write(iulog,*) 'this%frac_grc(g, 1:maxpatch_glcmec) = ', & - this%frac_grc(g, 1:maxpatch_glcmec) - write(iulog,*) 'frac_assigned(1:maxpatch_glcmec) = ', & - frac_assigned(1:maxpatch_glcmec) - call endrun() - end if ! error - end if ! area_ice_mec > 0 - end if ! this%icemask_grc(g) > 0 - end do ! g - end if ! glc_do_dynglacier - - end subroutine update_glc2lnd_fracs - - !----------------------------------------------------------------------- - subroutine update_glc2lnd_topo(this, bounds, topo_col, needs_downscaling_col) - ! - ! !DESCRIPTION: - ! Update column-level topographic heights based on input from GLC (via the coupler). - ! - ! Also updates the logical array, needs_downscaling_col: Sets this array to true - ! anywhere where topo_col is updated, because these points will need downscaling. - ! (Leaves other array elements in needs_downscaling_col untouched.) - ! - ! If glc_do_dynglacier is false, then both topographic heights and - ! needs_downscaling_col are left unchanged. - ! - ! !USES: - use landunit_varcon , only : istice_mec - use column_varcon , only : col_itype_to_icemec_class - ! - ! !ARGUMENTS: - class(glc2lnd_type) , intent(in) :: this - type(bounds_type) , intent(in) :: bounds ! bounds - real(r8) , intent(inout) :: topo_col( bounds%begc: ) ! topographic height (m) - logical , intent(inout) :: needs_downscaling_col( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: c, l, g ! indices - integer :: icemec_class ! current icemec class (1..maxpatch_glcmec) - - character(len=*), parameter :: subname = 'update_glc2lnd_topo' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(topo_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(needs_downscaling_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - if (glc_do_dynglacier) then - do c = bounds%begc, bounds%endc - l = col%landunit(c) - g = col%gridcell(c) - - ! Values from GLC are only valid within the icemask, so we only update CLM's topo values there - if (this%icemask_grc(g) > 0._r8) then - if (lun%itype(l) == istice_mec) then - icemec_class = col_itype_to_icemec_class(col%itype(c)) - else - ! If not on a glaciated column, assign topography to the bare-land value determined by GLC. - icemec_class = 0 - end if - - ! Note that we do downscaling over all column types. This is for consistency: - ! interpretation of results would be difficult if some non-glacier column types - ! were downscaled but others were not. - ! - ! BUG(wjs, 2016-11-15, bugz 2377) Actually, do not downscale over urban points: - ! this currently isn't allowed because the urban code references some - ! non-downscaled, gridcell-level atmospheric forcings - if (.not. lun%urbpoi(l)) then - topo_col(c) = this%topo_grc(g, icemec_class) - needs_downscaling_col(c) = .true. - end if - end if - end do - end if - - end subroutine update_glc2lnd_topo - -end module glc2lndMod - diff --git a/src/main/glcBehaviorMod.F90 b/src/main/glcBehaviorMod.F90 deleted file mode 100644 index 6240567937..0000000000 --- a/src/main/glcBehaviorMod.F90 +++ /dev/null @@ -1,1077 +0,0 @@ -module glcBehaviorMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Determines a number of aspects of the behavior of glacier_mec classes in each grid - ! cell. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog - use landunit_varcon, only : istice_mec - use clm_instur , only : wt_lunit, wt_glc_mec - use decompMod , only : bounds_type - use filterColMod , only : filter_col_type - use ColumnType , only : col - use PatchType , only : patch - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: glc_behavior_type - private - - ! ------------------------------------------------------------------------ - ! Public data - ! ------------------------------------------------------------------------ - - ! If has_virtual_columns_grc(g) is true, then grid cell g has virtual columns for - ! all possible glc_mec columns. - ! - ! For the sake of coupling with CISM, this should only be needed within the icemask, - ! where we need virtual columns for the sake of coupling with CISM. This is needed in - ! order to (1) provide SMB in all elevation classes, in case it is being used with - ! 1-way coupling (or to force a later TG run); (2) even with two-way coupling, - ! provide SMB in the elevation classes above and below existing elevation classes, - ! for the sake of vertical interpolation; (3) provide place-holder columns (which are - ! already spun-up) for dynamic landunits; (4) ensure that all glacier columns are - ! given spun-up initial conditions by init_interp. - ! - ! More details on (4) (echoing the similar comment in subgridWeightsMod): We need all - ! glacier and vegetated points to be active in the icemask region for the sake of - ! init_interp - since we only interpolate onto active points, and we don't know which - ! points will have non-zero area until after initialization (as long as we can't send - ! information from glc to clm in initialization). (If we had an inactive glacier - ! point in the icemask region, according to the weights on the surface dataset, and - ! ran init_interp, this point would keep its cold start initialization values. Then, - ! in the first time step of the run loop, it's possible that this point would become - ! active because, according to glc, there is actually > 0% glacier in that grid - ! cell. We don't do any state / flux adjustments in the first time step after - ! init_interp due to glacier area changes, so this glacier column would remain at its - ! cold start initialization values, which would be a Bad Thing. Ensuring that all - ! glacier points within the icemask are active gets around this problem - as well as - ! having other benefits, as noted above.) - ! - ! However, by making this part of the user-modifiable "glc behavior", we make it easy - ! for the user to add virtual columns, if this is desired for diagnostic - ! purposes. One important reason why this may be desired is to produce coupler - ! history forcings to force a later TG run, with SMB forcings outside the original - ! CISM area. (Also, we cannot use icemask for all purposes, because it isn't known at - ! initialization.) - logical, allocatable, public :: has_virtual_columns_grc(:) - - ! If allow_multiple_columns_grc(g) is true, then grid cell g may have multiple - ! glacier columns, for the different elevation classes. If - ! allow_multiple_columns_grc(g) is false, then grid cell g is guaranteed to have at - ! most one glacier column. - logical, allocatable, public :: allow_multiple_columns_grc(:) - - ! If melt_replaced_by_ice_grc(g) is true, then any glacier ice melt in gridcell g - ! runs off and is replaced by ice. Note that SMB cannot be computed in gridcell g if - ! melt_replaced_by_ice_grc(g) is false, since we can't compute a sensible negative - ! smb in that case. - logical, allocatable, public :: melt_replaced_by_ice_grc(:) - - ! If ice_runoff_melted_grc(g) is true, then ice runoff generated by the - ! CLM physics over glacier columns in gridcell g is melted (generating a negative - ! sensible heat flux) and runs off as liquid. If it is false, then ice runoff is - ! sent to the river model as ice (a crude parameterization of iceberg calving). - logical, allocatable, public :: ice_runoff_melted_grc(:) - - ! ------------------------------------------------------------------------ - ! Private data - ! ------------------------------------------------------------------------ - - ! If collapse_to_atm_topo_grc(g) is true, then grid cell g has at most one glc_mec - ! column, whose topographic height exactly matches the atmosphere's topographic - ! height for that grid cell (so that there is no adjustment of atmospheric - ! forcings). - ! - ! Note that has_virtual_columns_grc(g) is guaranteed to be false if - ! collapse_to_atm_topo_grc(g) is true. - logical, allocatable :: collapse_to_atm_topo_grc(:) - - contains - - ! ------------------------------------------------------------------------ - ! Public routines - ! ------------------------------------------------------------------------ - - procedure, public :: Init ! version of Init meant for production use - procedure, public :: InitFromInputs ! version of Init meant for unit testing (and called by other code in this class) - procedure, public :: InitSetDirectly ! version of Init meant for unit testing - - ! get number of subgrid units in glc_mec landunit on one grid cell - procedure, public :: get_num_glc_mec_subgrid - - ! returns true if memory should be allocated for the given glc_mec column, and its - ! weight on the landunit - procedure, public :: glc_mec_col_exists - - ! returns true if glc_mec columns on the given grid cell have dynamic type (type - ! potentially changing at runtime) - procedure, public :: cols_have_dynamic_type - - ! Sets a column-level logical array to true for any ice_mec column that needs - ! downscaling, false for any ice_mec column that does not need downscaling - procedure, public :: icemec_cols_need_downscaling - - ! Sets a column-level logical array to true for any ice_mec column that has - ! dynamic type, false for any ice_mec column that does not have dynamic type - procedure, public :: cols_have_dynamic_type_array - - ! Sets a patch-level logical array to true for any ice_mec column that has - ! dynamic type, false for any ice_mec column that does not have dynamic type - procedure, public :: patches_have_dynamic_type_array - - ! update the column class types of any glc_mec columns that need to be updated - procedure, public :: update_glc_classes - - ! ------------------------------------------------------------------------ - ! Public routines, for unit tests only - ! ------------------------------------------------------------------------ - - ! get the value of collapse_to_atm_topo at a given grid cell - procedure, public :: get_collapse_to_atm_topo - - ! ------------------------------------------------------------------------ - ! Private routines - ! ------------------------------------------------------------------------ - - procedure, private :: InitAllocate - - ! reads GLACIER_REGION field from surface dataset - procedure, private, nopass :: read_surface_dataset - - ! reads local namelist items - procedure, private, nopass :: read_namelist - - ! returns a column-level filter of ice_mec columns with the collapse_to_atm_topo - ! behavior - procedure, private :: collapse_to_atm_topo_icemec_filterc - - ! update class of glc_mec columns in regions where these are collapsed to a single - ! column, given a filter - procedure, private :: update_collapsed_columns_classes - - end type glc_behavior_type - - ! !PRIVATE MEMBER DATA: - - ! Longest name allowed for glacier_region_behavior, glacier_region_melt_behavior and - ! glacier_region_ice_runoff_behavior - integer, parameter :: max_behavior_name_len = 32 - - ! Smallest and largest allowed values for a glacier region ID - integer, parameter :: min_glacier_region_id = 0 - integer, parameter :: max_glacier_region_id = 10 - - ! Value indicating that a namelist item has not been set - character(len=*), parameter :: behavior_str_unset = 'UNSET' - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, begg, endg, NLFilename) - ! - ! !DESCRIPTION: - ! Initialize a glc_behavior_type object. - ! - ! This version of Init is the one intended for production code use. It reads the - ! information it needs from the surface dataset and namelist. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(inout) :: this - integer, intent(in) :: begg ! beginning gridcell index - integer, intent(in) :: endg ! ending gridcell index - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer, allocatable :: glacier_region_map(:) - character(len=max_behavior_name_len) :: glacier_region_behavior(min_glacier_region_id:max_glacier_region_id) - character(len=max_behavior_name_len) :: glacier_region_melt_behavior(min_glacier_region_id:max_glacier_region_id) - character(len=max_behavior_name_len) :: glacier_region_ice_runoff_behavior(min_glacier_region_id:max_glacier_region_id) - - character(len=*), parameter :: subname = 'Init' - !----------------------------------------------------------------------- - - allocate(glacier_region_map(begg:endg)) - call this%read_surface_dataset(begg, endg, glacier_region_map(begg:endg)) - call this%read_namelist(NLFilename, glacier_region_behavior, & - glacier_region_melt_behavior, glacier_region_ice_runoff_behavior) - - call this%InitFromInputs(begg, endg, & - glacier_region_map(begg:endg), glacier_region_behavior, & - glacier_region_melt_behavior, glacier_region_ice_runoff_behavior) - - end subroutine Init - - !----------------------------------------------------------------------- - subroutine InitFromInputs(this, begg, endg, & - glacier_region_map, glacier_region_behavior_str, glacier_region_melt_behavior_str, & - glacier_region_ice_runoff_behavior_str) - ! - ! !DESCRIPTION: - ! Initialize a glc_behavior_type object given a map of glacier region IDs and an - ! array of behavior specifications for each of these IDs. - ! - ! This version should generally only be called directly by tests, but it is also used - ! by the main production Init method. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(inout) :: this - integer, intent(in) :: begg ! beginning gridcell index - integer, intent(in) :: endg ! ending gridcell index - - ! map of glacier region IDs - integer, intent(in) :: glacier_region_map(begg:) - - ! string giving behavior for each glacier region ID - ! allowed values are: - ! - 'multiple': grid cells can potentially have multiple glacier elevation classes, - ! but no virtual columns - ! - 'virtual': grid cells have virtual columns: values are computed for every glacier - ! elevation class, even those with 0 area - ! - 'single_at_atm_topo': glacier landunits in these grid cells have a single column, - ! whose elevation matches the atmosphere's topographic height (so that there is no - ! adjustment due to downscaling) - character(len=*), intent(in) :: glacier_region_behavior_str(min_glacier_region_id:) - - ! string giving treatment of ice melt for each glacier region ID - ! allowed values are: - ! - 'replaced_by_ice' - ! - 'remains_in_place' - character(len=*), intent(in) :: glacier_region_melt_behavior_str(min_glacier_region_id:) - - ! string giving treatment of ice runoff for each glacier region ID - ! allowed values are: - ! - 'remains_ice' - ! - 'melted' - character(len=*), intent(in) :: glacier_region_ice_runoff_behavior_str(min_glacier_region_id:) - - ! - ! !LOCAL VARIABLES: - ! whether each glacier region ID is present in the glacier_region_map - logical :: glacier_region_present(min_glacier_region_id:max_glacier_region_id) - - ! integer codes corresponding to glacier_region_behavior_str - integer :: glacier_region_behavior(min_glacier_region_id:max_glacier_region_id) - - ! integer codes corresponding to glacier_region_melt_behavior_str - integer :: glacier_region_melt_behavior(min_glacier_region_id:max_glacier_region_id) - - ! integer codes corresponding to glacier_region_ice_runoff_behavior_str - integer :: glacier_region_ice_runoff_behavior(min_glacier_region_id:max_glacier_region_id) - - integer :: g - integer :: my_id - integer :: my_behavior - integer :: my_melt_behavior - integer :: my_ice_runoff_behavior - - ! possible glacier_region_behavior codes - integer, parameter :: BEHAVIOR_MULTIPLE = 1 - integer, parameter :: BEHAVIOR_VIRTUAL = 2 - integer, parameter :: BEHAVIOR_SINGLE_AT_ATM_TOPO = 3 - - ! possible glacier_region_melt_behavior codes - integer, parameter :: MELT_BEHAVIOR_REPLACED_BY_ICE = 1 - integer, parameter :: MELT_BEHAVIOR_REMAINS_IN_PLACE = 2 - - ! possible glacier_region_ice_runoff_behavior codes - integer, parameter :: ICE_RUNOFF_BEHAVIOR_REMAINS_ICE = 1 - integer, parameter :: ICE_RUNOFF_BEHAVIOR_MELTED = 2 - - ! value indicating that a behavior code has not been set (for glacier_region_behavior, - ! glacier_region_melt_behavior or glacier_region_ice_runoff_behavior) - integer, parameter :: BEHAVIOR_UNSET = -1 - - character(len=*), parameter :: subname = 'InitFromInputs' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(glacier_region_map) == (/endg/)), errMsg(sourcefile, __LINE__)) - - call check_glacier_region_map - - call determine_region_presence - - call translate_glacier_region_behavior - call translate_glacier_region_melt_behavior - call translate_glacier_region_ice_runoff_behavior - - call this%InitAllocate(begg, endg) - - do g = begg, endg - my_id = glacier_region_map(g) - my_behavior = glacier_region_behavior(my_id) - my_melt_behavior = glacier_region_melt_behavior(my_id) - my_ice_runoff_behavior = glacier_region_ice_runoff_behavior(my_id) - - ! This should only happen due to a programming error, not due to a user input error - SHR_ASSERT(my_behavior /= BEHAVIOR_UNSET, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(my_melt_behavior /= BEHAVIOR_UNSET, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(my_ice_runoff_behavior /= BEHAVIOR_UNSET, errMsg(sourcefile, __LINE__)) - - if (my_behavior == BEHAVIOR_VIRTUAL) then - this%has_virtual_columns_grc(g) = .true. - else - this%has_virtual_columns_grc(g) = .false. - end if - - if (my_melt_behavior == MELT_BEHAVIOR_REMAINS_IN_PLACE) then - this%melt_replaced_by_ice_grc(g) = .false. - else - this%melt_replaced_by_ice_grc(g) = .true. - end if - - if (my_ice_runoff_behavior == ICE_RUNOFF_BEHAVIOR_MELTED) then - this%ice_runoff_melted_grc(g) = .true. - else - this%ice_runoff_melted_grc(g) = .false. - end if - - ! For now, allow_multiple_columns_grc is simply the opposite of - ! collapse_to_atm_topo_grc. However, we maintain the separate - ! allow_multiple_columns_grc so that the public interface can stay the same if we - ! differentiate between the two in the future - e.g., allowing for the possibility - ! of a behavior where we have at most one glacier column, but not forced to the - ! atmosphere's elevation. - if (my_behavior == BEHAVIOR_SINGLE_AT_ATM_TOPO) then - this%collapse_to_atm_topo_grc(g) = .true. - this%allow_multiple_columns_grc(g) = .false. - else - this%collapse_to_atm_topo_grc(g) = .false. - this%allow_multiple_columns_grc(g) = .true. - end if - end do - - contains - subroutine check_glacier_region_map - if (minval(glacier_region_map) < min_glacier_region_id) then - write(iulog,*) subname//' ERROR: Expect GLACIER_REGION to be >= ', min_glacier_region_id - write(iulog,*) 'minval = ', minval(glacier_region_map) - call endrun(msg=' ERROR: GLACIER_REGION smaller than expected'// & - errMsg(sourcefile, __LINE__)) - end if - - if (maxval(glacier_region_map) > max_glacier_region_id) then - write(iulog,*) subname//' ERROR: Max GLACIER_REGION is ', & - maxval(glacier_region_map) - write(iulog,*) 'but max_glacier_region_id is only ', max_glacier_region_id - write(iulog,*) 'Try increasing max_glacier_region_id in ', sourcefile - call endrun(msg=' ERROR: GLACIER_REGION larger than expected'// & - errMsg(sourcefile, __LINE__)) - end if - end subroutine check_glacier_region_map - - subroutine determine_region_presence - integer :: g - integer :: my_id - - glacier_region_present(:) = .false. - do g = begg, endg - my_id = glacier_region_map(g) - glacier_region_present(my_id) = .true. - end do - end subroutine determine_region_presence - - subroutine translate_glacier_region_behavior - integer :: i - - do i = min_glacier_region_id, max_glacier_region_id - glacier_region_behavior(i) = BEHAVIOR_UNSET - - if (glacier_region_present(i)) then - SHR_ASSERT_ALL((ubound(glacier_region_behavior_str) >= (/i/)), errMsg(sourcefile, __LINE__)) - - select case (glacier_region_behavior_str(i)) - case ('multiple') - glacier_region_behavior(i) = BEHAVIOR_MULTIPLE - case ('virtual') - glacier_region_behavior(i) = BEHAVIOR_VIRTUAL - case ('single_at_atm_topo') - glacier_region_behavior(i) = BEHAVIOR_SINGLE_AT_ATM_TOPO - case (behavior_str_unset) - write(iulog,*) ' ERROR: glacier_region_behavior not specified for ID ', i - write(iulog,*) 'You probably need to extend the glacier_region_behavior namelist array' - call endrun(msg=' ERROR: glacier_region_behavior not specified for ID '// & - errMsg(sourcefile, __LINE__)) - case default - write(iulog,*) ' ERROR: Unknown glacier_region_behavior for ID ', i - write(iulog,*) glacier_region_behavior_str(i) - write(iulog,*) 'Allowable values are: multiple, virtual, single_at_atm_topo' - call endrun(msg=' ERROR: Unknown glacier_region_behavior'// & - errMsg(sourcefile, __LINE__)) - end select - - end if - end do - end subroutine translate_glacier_region_behavior - - subroutine translate_glacier_region_melt_behavior - integer :: i - - do i = min_glacier_region_id, max_glacier_region_id - glacier_region_melt_behavior(i) = BEHAVIOR_UNSET - - if (glacier_region_present(i)) then - SHR_ASSERT_ALL((ubound(glacier_region_melt_behavior_str) >= (/i/)), errMsg(sourcefile, __LINE__)) - - select case (glacier_region_melt_behavior_str(i)) - case ('replaced_by_ice') - glacier_region_melt_behavior(i) = MELT_BEHAVIOR_REPLACED_BY_ICE - case ('remains_in_place') - glacier_region_melt_behavior(i) = MELT_BEHAVIOR_REMAINS_IN_PLACE - case (behavior_str_unset) - write(iulog,*) ' ERROR: glacier_region_melt_behavior not specified for ID ', i - write(iulog,*) 'You probably need to extend the glacier_region_melt_behavior namelist array' - call endrun(msg=' ERROR: glacier_region_melt_behavior not specified for ID '// & - errMsg(sourcefile, __LINE__)) - case default - write(iulog,*) ' ERROR: Unknown glacier_region_melt_behavior for ID ', i - write(iulog,*) glacier_region_melt_behavior_str(i) - write(iulog,*) 'Allowable values are: replaced_by_ice, remains_in_place' - call endrun(msg=' ERROR: Unknown glacier_region_melt_behavior'// & - errMsg(sourcefile, __LINE__)) - end select - - end if - end do - end subroutine translate_glacier_region_melt_behavior - - subroutine translate_glacier_region_ice_runoff_behavior - integer :: i - - do i = min_glacier_region_id, max_glacier_region_id - glacier_region_ice_runoff_behavior(i) = BEHAVIOR_UNSET - - if (glacier_region_present(i)) then - SHR_ASSERT_ALL((ubound(glacier_region_ice_runoff_behavior_str) >= (/i/)), errMsg(sourcefile, __LINE__)) - - select case (glacier_region_ice_runoff_behavior_str(i)) - case ('remains_ice') - glacier_region_ice_runoff_behavior(i) = ICE_RUNOFF_BEHAVIOR_REMAINS_ICE - case('melted') - glacier_region_ice_runoff_behavior(i) = ICE_RUNOFF_BEHAVIOR_MELTED - case (behavior_str_unset) - write(iulog,*) ' ERROR: glacier_region_ice_runoff_behavior not specified for ID ', i - write(iulog,*) 'You probably need to extend the glacier_region_ice_runoff_behavior namelist array' - call endrun(msg=' ERROR: glacier_region_ice_runoff_behavior not specified for ID '// & - errMsg(sourcefile, __LINE__)) - case default - write(iulog,*) ' ERROR: Unknown glacier_region_ice_runoff_behavior for ID ', i - write(iulog,*) glacier_region_ice_runoff_behavior_str(i) - write(iulog,*) 'Allowable values are: remains_ice, melted' - call endrun(msg=' ERROR: Unknown glacier_region_ice_runoff_behavior'// & - errMsg(sourcefile, __LINE__)) - end select - end if - end do - end subroutine translate_glacier_region_ice_runoff_behavior - - end subroutine InitFromInputs - - - !----------------------------------------------------------------------- - subroutine InitSetDirectly(this, begg, endg, & - has_virtual_columns, collapse_to_atm_topo) - ! - ! !DESCRIPTION: - ! Initialize a glc_behavior_type object by directly setting has_virtual_columns and - ! collapse_to_atm_topo - ! - ! This version is meant for testing - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(inout) :: this - integer, intent(in) :: begg ! beginning gridcell index - integer, intent(in) :: endg ! ending gridcell index - logical, intent(in) :: has_virtual_columns(begg:) - logical, intent(in) :: collapse_to_atm_topo(begg:) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitForTesting' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(has_virtual_columns) == (/endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(collapse_to_atm_topo) == (/endg/)), errMsg(sourcefile, __LINE__)) - - call this%InitAllocate(begg, endg) - this%has_virtual_columns_grc(:) = has_virtual_columns(:) - this%collapse_to_atm_topo_grc(:) = collapse_to_atm_topo(:) - - end subroutine InitSetDirectly - - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, begg, endg) - ! - ! !DESCRIPTION: - ! Allocate variables in this object - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(inout) :: this - integer, intent(in) :: begg ! beginning gridcell index - integer, intent(in) :: endg ! ending gridcell index - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'InitAllocate' - !----------------------------------------------------------------------- - - allocate(this%has_virtual_columns_grc (begg:endg)); this%has_virtual_columns_grc (:) = .false. - allocate(this%allow_multiple_columns_grc(begg:endg)); this%allow_multiple_columns_grc(:) = .false. - allocate(this%melt_replaced_by_ice_grc(begg:endg)); this%melt_replaced_by_ice_grc(:) = .false. - allocate(this%collapse_to_atm_topo_grc(begg:endg)); this%collapse_to_atm_topo_grc(:) = .false. - allocate(this%ice_runoff_melted_grc(begg:endg)); this%ice_runoff_melted_grc(:) = .false. - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine read_surface_dataset(begg, endg, glacier_region_map) - ! - ! !DESCRIPTION: - ! Reads GLACIER_REGION field from surface dataset, returns it in glacier_region_map - ! - ! !USES: - use clm_varctl , only : fsurdat - use fileutils , only : getfil - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - use spmdMod , only : masterproc - use clm_varcon , only : grlnd - ! - ! !ARGUMENTS: - integer, intent(in) :: begg ! beginning grid cell index - integer, intent(in) :: endg ! ending grid cell index - integer, intent(out) :: glacier_region_map(begg:) - ! - ! !LOCAL VARIABLES: - integer, pointer :: glacier_region_map_ptr(:) ! pointer version needed for ncd_io interface - character(len=256) :: locfn ! local filename - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar - - character(len=*), parameter :: subname = 'read_surface_dataset' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(glacier_region_map) == (/endg/)), errMsg(sourcefile, __LINE__)) - - if (masterproc) then - write(iulog,*) 'Attempting to read GLACIER_REGION...' - end if - call getfil(fsurdat, locfn, 0) - call ncd_pio_openfile(ncid, locfn, 0) - allocate(glacier_region_map_ptr(begg:endg)) - call ncd_io(ncid=ncid, varname='GLACIER_REGION', flag='read', & - data=glacier_region_map_ptr, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: GLACIER_REGION NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile(ncid) - glacier_region_map(begg:endg) = glacier_region_map_ptr(begg:endg) - deallocate(glacier_region_map_ptr) - - end subroutine read_surface_dataset - - !----------------------------------------------------------------------- - subroutine read_namelist(NLFilename, glacier_region_behavior, & - glacier_region_melt_behavior, glacier_region_ice_runoff_behavior) - ! - ! !DESCRIPTION: - ! Read local namelist items - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use clm_nlUtilsMod , only : find_nlgroup_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - character(len=max_behavior_name_len), intent(out) :: & - glacier_region_behavior(min_glacier_region_id:max_glacier_region_id) - character(len=max_behavior_name_len), intent(out) :: & - glacier_region_melt_behavior(min_glacier_region_id:max_glacier_region_id) - character(len=max_behavior_name_len), intent(out) :: & - glacier_region_ice_runoff_behavior(min_glacier_region_id:max_glacier_region_id) - ! - ! !LOCAL VARIABLES: - integer :: unitn ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - - character(len=*), parameter :: subname = 'read_namelist' - !----------------------------------------------------------------------- - - namelist /clm_glacier_behavior/ & - glacier_region_behavior, glacier_region_melt_behavior, & - glacier_region_ice_runoff_behavior - - ! Initialize options to default values - glacier_region_behavior(:) = behavior_str_unset - glacier_region_melt_behavior(:) = behavior_str_unset - glacier_region_ice_runoff_behavior(:) = behavior_str_unset - - if (masterproc) then - unitn = getavu() - call opnfil(NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, 'clm_glacier_behavior', status=nml_error) - if (nml_error == 0) then - read(unitn, nml=clm_glacier_behavior, iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading clm_glacier_behavior namelist'// & - errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding clm_glacier_behavior namelist'// & - errMsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - endif - - call shr_mpi_bcast(glacier_region_behavior, mpicom) - call shr_mpi_bcast(glacier_region_melt_behavior, mpicom) - call shr_mpi_bcast(glacier_region_ice_runoff_behavior, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'clm_glacier_behavior settings:' - write(iulog,nml=clm_glacier_behavior) - write(iulog,*) ' ' - end if - - end subroutine read_namelist - - - !----------------------------------------------------------------------- - subroutine get_num_glc_mec_subgrid(this, gi, atm_topo, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Get number of subgrid units in glc_mec landunit on one grid cell - ! - ! !USES: - use clm_varpar , only : maxpatch_glcmec - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(in) :: this - integer , intent(in) :: gi ! grid cell index - real(r8), intent(in) :: atm_topo ! atmosphere's topographic height for this grid cell (m) - integer , intent(out) :: npatches ! number of glacier_mec patches in this grid cell - integer , intent(out) :: ncols ! number of glacier_mec columns in this grid cell - integer , intent(out) :: nlunits ! number of glacier_mec landunits in this grid cell - ! - ! !LOCAL VARIABLES: - integer :: m ! loop index - logical :: col_exists - real(r8) :: col_wt_lunit - - character(len=*), parameter :: subname = 'get_num_glc_mec_subgrid' - !----------------------------------------------------------------------- - - ncols = 0 - - do m = 1, maxpatch_glcmec - call this%glc_mec_col_exists(gi = gi, elev_class = m, atm_topo = atm_topo, & - exists = col_exists, col_wt_lunit = col_wt_lunit) - if (col_exists) then - ncols = ncols + 1 - end if - end do - - if (this%collapse_to_atm_topo_grc(gi) .and. & - wt_lunit(gi, istice_mec) > 0.0_r8) then - ! For grid cells with the collapse_to_atm_topo behavior, with a non-zero weight - ! ice_mec landunit, we expect exactly one column - SHR_ASSERT(ncols == 1, errMsg(sourcefile, __LINE__)) - end if - - if (ncols > 0) then - npatches = ncols - nlunits = 1 - else - npatches = 0 - nlunits = 0 - end if - - end subroutine get_num_glc_mec_subgrid - - !----------------------------------------------------------------------- - subroutine glc_mec_col_exists(this, gi, elev_class, atm_topo, exists, col_wt_lunit) - ! - ! !DESCRIPTION: - ! For the given glc_mec column, with elevation class index elev_class, in grid cell - ! gi: sets exists to true if memory should be allocated for this column, and sets - ! col_wt_lunit to the column's weight on the icemec landunit. - ! - ! If exists is false, then col_wt_lunit is arbitrary and should be ignored. - ! - ! !USES: - use glc_elevclass_mod, only : glc_get_elevation_class, GLC_ELEVCLASS_ERR_NONE - use glc_elevclass_mod, only : GLC_ELEVCLASS_ERR_TOO_LOW, GLC_ELEVCLASS_ERR_TOO_HIGH - use glc_elevclass_mod, only : glc_errcode_to_string - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(in) :: this - integer, intent(in) :: gi ! grid cell index - integer, intent(in) :: elev_class ! elevation class index - real(r8), intent(in) :: atm_topo ! atmosphere's topographic height for this grid cell (m) - logical, intent(out) :: exists ! whether memory should be allocated for this column - real(r8), intent(out) :: col_wt_lunit ! column's weight on the icemec landunit - ! - ! !LOCAL VARIABLES: - integer :: atm_elev_class ! elevation class corresponding to atmosphere topographic height - integer :: err_code - - character(len=*), parameter :: subname = 'glc_mec_col_exists' - !----------------------------------------------------------------------- - - ! Set default outputs - exists = .false. - col_wt_lunit = wt_glc_mec(gi, elev_class) - - if (this%collapse_to_atm_topo_grc(gi)) then - if (wt_lunit(gi, istice_mec) > 0.0_r8) then - call glc_get_elevation_class(atm_topo, atm_elev_class, err_code) - if ( err_code == GLC_ELEVCLASS_ERR_NONE .or. & - err_code == GLC_ELEVCLASS_ERR_TOO_LOW .or. & - err_code == GLC_ELEVCLASS_ERR_TOO_HIGH) then - ! These are all acceptable "errors" - it is even okay for these purposes if - ! the elevation is lower than the lower bound of elevation class 1, or - ! higher than the upper bound of the top elevation class. - - ! Do nothing - else - write(iulog,*) subname, ': ERROR getting elevation class for topo = ', atm_topo - write(iulog,*) glc_errcode_to_string(err_code) - call endrun(msg=subname//': ERROR getting elevation class') - end if - - if (elev_class == atm_elev_class) then - exists = .true. - col_wt_lunit = 1._r8 - else - exists = .false. - col_wt_lunit = 0._r8 - end if - end if - - else ! collapse_to_atm_topo_grc .false. - if (this%has_virtual_columns_grc(gi)) then - exists = .true. - else if (wt_lunit(gi, istice_mec) > 0.0_r8 .and. & - wt_glc_mec(gi, elev_class) > 0.0_r8) then - ! If the landunit has non-zero weight on the grid cell, and this column has - ! non-zero weight on the landunit... - exists = .true. - end if - end if - - end subroutine glc_mec_col_exists - - !----------------------------------------------------------------------- - function cols_have_dynamic_type(this, gi) - ! - ! !DESCRIPTION: - ! Returns true if glc_mec columns on the given grid cell have dynamic type (i.e., - ! type potentially changing at runtime) - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: cols_have_dynamic_type ! function result - class(glc_behavior_type), intent(in) :: this - integer, intent(in) :: gi ! grid cell index - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'cols_have_dynamic_type' - !----------------------------------------------------------------------- - - if (this%collapse_to_atm_topo_grc(gi)) then - cols_have_dynamic_type = .true. - else - cols_have_dynamic_type = .false. - end if - - end function cols_have_dynamic_type - - !----------------------------------------------------------------------- - subroutine icemec_cols_need_downscaling(this, bounds, num_icemecc, filter_icemecc, & - needs_downscaling_col) - ! - ! !DESCRIPTION: - ! Sets needs_downscaling_col to true for any ice_mec column that needs downscaling, - ! false for any ice_mec column that does not need downscaling. - ! - ! Outside of filter_icemecc, leaves needs_downscaling_col untouched. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc_behavior_type) , intent(in) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_icemecc ! number of points in filter_icemecc - integer , intent(in) :: filter_icemecc(:) ! col filter for ice_mec - logical , intent(inout) :: needs_downscaling_col( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: fc - integer :: c - integer :: g - - character(len=*), parameter :: subname = 'icemec_cols_need_downscaling' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(needs_downscaling_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do fc = 1, num_icemecc - c = filter_icemecc(fc) - g = col%gridcell(c) - - if (this%collapse_to_atm_topo_grc(g)) then - needs_downscaling_col(c) = .false. - else - needs_downscaling_col(c) = .true. - end if - end do - - end subroutine icemec_cols_need_downscaling - - !----------------------------------------------------------------------- - subroutine cols_have_dynamic_type_array(this, begc, endc, has_dynamic_type_col) - ! - ! !DESCRIPTION: - ! Sets a column-level logical array to true for any ice_mec column that has - ! dynamic type, false for any ice_mec column that does not have dynamic type. - ! - ! The value is undefined for non-ice_mec columns. - ! - ! !ARGUMENTS: - class(glc_behavior_type) , intent(in) :: this - integer, intent(in) :: begc ! beginning column index - integer, intent(in) :: endc ! ending column index - logical, intent(inout) :: has_dynamic_type_col( begc: ) - ! - ! !LOCAL VARIABLES: - integer :: c - integer :: g - - character(len=*), parameter :: subname = 'cols_have_dynamic_type_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(has_dynamic_type_col) == (/endc/)), errMsg(sourcefile, __LINE__)) - - do c = begc, endc - g = col%gridcell(c) - ! Users shouldn't rely on the values set for non-ice_mec columns, but it's simpler - ! just to set this for all column types. - if (this%collapse_to_atm_topo_grc(g)) then - has_dynamic_type_col(c) = .true. - else - has_dynamic_type_col(c) = .false. - end if - end do - - end subroutine cols_have_dynamic_type_array - - !----------------------------------------------------------------------- - subroutine patches_have_dynamic_type_array(this, begp, endp, has_dynamic_type_patch) - ! - ! !DESCRIPTION: - ! Sets a patch-level logical array to true for any ice_mec patch that has - ! dynamic type, false for any ice_mec patch that does not have dynamic type. - ! - ! The value is undefined for non-ice_mec patches. - ! - ! !ARGUMENTS: - class(glc_behavior_type) , intent(in) :: this - integer, intent(in) :: begp ! beginning patch index - integer, intent(in) :: endp ! ending patch index - logical, intent(inout) :: has_dynamic_type_patch( begp: ) - ! - ! !LOCAL VARIABLES: - integer :: p - integer :: g - - character(len=*), parameter :: subname = 'patches_have_dynamic_type_array' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(has_dynamic_type_patch) == (/endp/)), errMsg(sourcefile, __LINE__)) - - do p = begp, endp - g = patch%gridcell(p) - ! Users shouldn't rely on the values set for non-ice_mec patches, but it's simpler - ! just to set this for all patch types. - if (this%collapse_to_atm_topo_grc(g)) then - has_dynamic_type_patch(p) = .true. - else - has_dynamic_type_patch(p) = .false. - end if - end do - - end subroutine patches_have_dynamic_type_array - - !----------------------------------------------------------------------- - subroutine update_glc_classes(this, bounds, topo_col) - ! - ! !DESCRIPTION: - ! Update the column class types of any glc_mec columns that need to be updated. - ! - ! Assumes that topo_col has already been set appropriately. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: topo_col( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - type(filter_col_type) :: collapse_filterc - - character(len=*), parameter :: subname = 'update_glc_classes' - !----------------------------------------------------------------------- - - collapse_filterc = this%collapse_to_atm_topo_icemec_filterc(bounds) - call this%update_collapsed_columns_classes(bounds, collapse_filterc, topo_col) - - end subroutine update_glc_classes - - !----------------------------------------------------------------------- - subroutine update_collapsed_columns_classes(this, bounds, collapse_filterc, topo_col) - ! - ! !DESCRIPTION: - ! Update class of glc_mec columns in regions where these are collapsed to a single - ! column, given a filter. - ! - ! Assumes that topo_col has already been updated appropriately for these columns. - ! - ! !USES: - use glc_elevclass_mod, only : glc_get_elevation_class, GLC_ELEVCLASS_ERR_NONE - use glc_elevclass_mod, only : GLC_ELEVCLASS_ERR_TOO_LOW, GLC_ELEVCLASS_ERR_TOO_HIGH - use glc_elevclass_mod, only : glc_errcode_to_string - use column_varcon , only : icemec_class_to_col_itype - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - type(filter_col_type), intent(in) :: collapse_filterc - real(r8), intent(in) :: topo_col( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: fc ! filter index - integer :: c ! column index - integer :: elev_class ! elevation class of the single column on the ice_mec landunit - integer :: err_code - integer :: new_coltype - - character(len=*), parameter :: subname = 'update_collapsed_columns_classes' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(topo_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do fc = 1, collapse_filterc%num - c = collapse_filterc%indices(fc) - - call glc_get_elevation_class(topo_col(c), elev_class, err_code) - if ( err_code == GLC_ELEVCLASS_ERR_NONE .or. & - err_code == GLC_ELEVCLASS_ERR_TOO_LOW .or. & - err_code == GLC_ELEVCLASS_ERR_TOO_HIGH) then - ! These are all acceptable "errors" - it is even okay for these purposes if - ! the elevation is lower than the lower bound of elevation class 1, or - ! higher than the upper bound of the top elevation class. - - ! Do nothing - else - write(iulog,*) subname, ': ERROR getting elevation class for topo = ', & - topo_col(c) - write(iulog,*) glc_errcode_to_string(err_code) - call endrun(msg=subname//': ERROR getting elevation class') - end if - - new_coltype = icemec_class_to_col_itype(elev_class) - if (new_coltype /= col%itype(c)) then - call col%update_itype(c = c, itype = new_coltype) - end if - end do - - end subroutine update_collapsed_columns_classes - - !----------------------------------------------------------------------- - function collapse_to_atm_topo_icemec_filterc(this, bounds) result(filter) - ! - ! !DESCRIPTION: - ! Returns a column-level filter of ice_mec columns with the collapse_to_atm_topo behavior - ! - ! !USES: - use filterColMod, only : filter_col_type, col_filter_from_grcflags_ltypes - ! - ! !ARGUMENTS: - class(glc_behavior_type), intent(in) :: this - type(filter_col_type) :: filter ! function result - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'collapse_to_atm_topo_icemec_filterc' - !----------------------------------------------------------------------- - - ! Currently this creates the filter on the fly, recreating it every time this - ! function is called. Since this is a static filter, we could just compute it once - ! and save it, returning the already-computed filter when this function is called. - ! However, the problem with that is the need to have a different filter for each - ! clump (and potentially another filter for calls from outside a clump loop). This - ! will become easier to handle if we rework CLM's threading so that there is a - ! separate instance of each object for each clump: in that case, we'll have multiple - ! instances of glc_behavior_type, each corresponding to one clump, each with its own - ! filter. - - filter = col_filter_from_grcflags_ltypes( & - bounds = bounds, & - grcflags = this%collapse_to_atm_topo_grc(bounds%begg:bounds%endg), & - ltypes = [istice_mec], & - include_inactive = .true.) - - end function collapse_to_atm_topo_icemec_filterc - - !----------------------------------------------------------------------- - function get_collapse_to_atm_topo(this, gi) result(collapse_to_atm_topo) - ! - ! !DESCRIPTION: - ! Get the value of collapse_to_atm_topo at a given grid cell - ! - ! This function just exists to support unit testing, and should not be called from - ! production code. - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: collapse_to_atm_topo ! function result - class(glc_behavior_type), intent(in) :: this - integer, intent(in) :: gi ! grid cell index - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'get_collapse_to_atm_topo' - !----------------------------------------------------------------------- - - collapse_to_atm_topo = this%collapse_to_atm_topo_grc(gi) - - end function get_collapse_to_atm_topo - -end module glcBehaviorMod diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 deleted file mode 100644 index 8899917c5f..0000000000 --- a/src/main/histFileMod.F90 +++ /dev/null @@ -1,5201 +0,0 @@ -module histFileMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing methods to for CLM history file handling. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_sys_mod , only : shr_sys_flush - use spmdMod , only : masterproc - use abortutils , only : endrun - use clm_varctl , only : iulog, use_vertsoilc, use_fates - use clm_varcon , only : spval, ispval, dzsoi_decomp - use clm_varcon , only : grlnd, nameg, namel, namec, namep, nameCohort - use decompMod , only : get_proc_bounds, get_proc_global, bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use EDTypesMod , only : nclmax - use EDTypesMod , only : nlevleaf - use FatesInterfaceMod , only : nlevsclass, nlevage - use EDTypesMod , only : nfsc, ncwd - use FatesInterfaceMod , only : numpft_ed => numpft - use ncdio_pio - - ! - implicit none - save - private - ! - ! !PUBLIC TYPES: - ! - ! Constants - ! - integer , public, parameter :: max_tapes = 10 ! max number of history tapes - integer , public, parameter :: max_flds = 2500 ! max number of history fields - integer , public, parameter :: max_namlen = 64 ! maximum number of characters for field name - integer , public, parameter :: scale_type_strlen = 32 ! maximum number of characters for scale types - integer , private, parameter :: avgflag_strlen = 3 ! maximum number of characters for avgflag - integer , private, parameter :: hist_dim_name_length = 16 ! lenngth of character strings in dimension names - - ! Possible ways to treat multi-layer snow fields at times when no snow is present in a - ! given layer. Note that the public parameters are the only ones that can be used by - ! calls to hist_addfld2d; the private parameters are just used internally by the - ! histFile implementation. - integer , private, parameter :: no_snow_MIN = 1 ! minimum valid value for this flag - integer , public , parameter :: no_snow_normal = 1 ! normal treatment, which should be used for most fields (use spval when snow layer not present) - integer , public , parameter :: no_snow_zero = 2 ! average in a 0 value for times when the snow layer isn't present - integer , private, parameter :: no_snow_MAX = 2 ! maximum valid value for this flag - integer , private, parameter :: no_snow_unset = no_snow_MIN - 1 ! flag specifying that field is NOT a multi-layer snow field - ! - ! Counters - ! - integer , public :: ntapes = 0 ! index of max history file requested - ! - ! Namelist - ! - integer :: ni ! implicit index below - logical, public :: & - hist_empty_htapes = .false. ! namelist: flag indicates no default history fields - integer, public :: & - hist_ndens(max_tapes) = 2 ! namelist: output density of netcdf history files - integer, public :: & - hist_mfilt(max_tapes) = (/ 1, (30, ni=2, max_tapes)/) ! namelist: number of time samples per tape - logical, public :: & - hist_dov2xy(max_tapes) = (/.true.,(.true.,ni=2,max_tapes)/) ! namelist: true=> do grid averaging - integer, public :: & - hist_nhtfrq(max_tapes) = (/0, (-24, ni=2,max_tapes)/) ! namelist: history write freq(0=monthly) - character(len=avgflag_strlen), public :: & - hist_avgflag_pertape(max_tapes) = (/(' ',ni=1,max_tapes)/) ! namelist: per tape averaging flag - character(len=max_namlen), public :: & - hist_type1d_pertape(max_tapes) = (/(' ',ni=1,max_tapes)/) ! namelist: per tape type1d - - character(len=max_namlen+2), public :: & - fincl(max_flds,max_tapes) ! namelist-equivalence list of fields to add - - character(len=max_namlen+2), public :: & - hist_fincl1(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl2(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl3(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl4(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl5(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl6(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl7(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl8(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl9(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl10(max_flds) = ' ' ! namelist: list of fields to add - - character(len=max_namlen+2), public :: & - fexcl(max_flds,max_tapes) ! namelist-equivalence list of fields to remove - - character(len=max_namlen+2), public :: & - hist_fexcl1(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl2(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl3(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl4(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl5(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl6(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl7(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl8(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl9(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl10(max_flds) = ' ' ! namelist: list of fields to remove - - logical, private :: if_disphist(max_tapes) ! restart, true => save history file - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: hist_addfld1d ! Add a 1d single-level field to the master field list - public :: hist_addfld2d ! Add a 2d multi-level field to the master field list - public :: hist_addfld_decomp ! Add a 2d multi-level field to the master field list - public :: hist_add_subscript ! Add a 2d subscript dimension - public :: hist_printflds ! Print summary of master field list - public :: hist_htapes_build ! Initialize history file handler for initial or continue run - public :: hist_update_hbuf ! Updates history buffer for all fields and tapes - public :: hist_htapes_wrapup ! Write history tape(s) - public :: hist_restart_ncd ! Read/write history file restart data - public :: htapes_fieldlist ! Define the contents of each history file based on namelist - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: is_mapping_upto_subgrid ! Is this field being mapped up to a higher subgrid level? - private :: masterlist_make_active ! Add a field to a history file default "on" list - private :: masterlist_addfld ! Add a field to the master field list - private :: masterlist_change_timeavg ! Override default history tape contents for specific tape - private :: htape_addfld ! Add a field to the active list for a history tape - private :: htape_create ! Define contents of history file t - private :: htape_add_ltype_metadata ! Add global metadata defining landunit types - private :: htape_add_ctype_metadata ! Add global metadata defining column types - private :: htape_add_natpft_metadata ! Add global metadata defining natpft types - private :: htape_add_cft_metadata ! Add global metadata defining cft types - private :: htape_timeconst ! Write time constant values to history tape - private :: htape_timeconst3D ! Write time constant 3D values to primary history tape - private :: hfields_normalize ! Normalize history file fields by number of accumulations - private :: hfields_zero ! Zero out accumulation and hsitory buffers for a tape - private :: hfields_write ! Write a variable to a history tape - private :: hfields_1dinfo ! Define/output 1d subgrid info if appropriate - private :: hist_update_hbuf_field_1d ! Updates history buffer for specific field and tape - private :: hist_update_hbuf_field_2d ! Updates history buffer for specific field and tape - private :: hist_set_snow_field_2d ! Set values in history field dimensioned by levsno - private :: list_index ! Find index of field in exclude list - private :: set_hist_filename ! Determine history dataset filenames - private :: getname ! Retrieve name portion of input "inname" - private :: getflag ! Retrieve flag - private :: pointer_index ! Track data pointer indices - private :: max_nFields ! The max number of fields on any tape - private :: avgflag_valid ! Whether a given avgflag is a valid option - ! - ! !PRIVATE TYPES: - ! Constants - ! - integer, parameter :: max_length_filename = 199 ! max length of a filename. on most linux systems this - ! is 255. But this can't be increased until all hard - ! coded values throughout the i/o stack are updated. - integer, parameter :: max_chars = 199 ! max chars for char variables - integer, parameter :: max_subs = 100 ! max number of subscripts - integer :: num_subs = 0 ! actual number of subscripts - character(len=32) :: subs_name(max_subs) ! name of subscript - integer :: subs_dim(max_subs) ! dimension of subscript - ! - type field_info - character(len=max_namlen) :: name ! field name - character(len=max_chars) :: long_name ! long name - character(len=max_chars) :: units ! units - character(len=hist_dim_name_length) :: type1d ! pointer to first dimension type from data type (nameg, etc) - character(len=hist_dim_name_length) :: type1d_out ! hbuf first dimension type from data type (nameg, etc) - character(len=hist_dim_name_length) :: type2d ! hbuf second dimension type ["levgrnd","levlak","numrad","ltype","natpft","cft","glc_nec","elevclas","subname(n)"] - integer :: beg1d ! on-node 1d clm pointer start index - integer :: end1d ! on-node 1d clm pointer end index - integer :: num1d ! size of clm pointer first dimension (all nodes) - integer :: beg1d_out ! on-node 1d hbuf pointer start index - integer :: end1d_out ! on-node 1d hbuf pointer end index - integer :: num1d_out ! size of hbuf first dimension (all nodes) - integer :: num2d ! size of hbuf second dimension (e.g. number of vertical levels) - integer :: hpindex ! history pointer index - character(len=scale_type_strlen) :: p2c_scale_type ! scale factor when averaging patch to column - character(len=scale_type_strlen) :: c2l_scale_type ! scale factor when averaging column to landunit - character(len=scale_type_strlen) :: l2g_scale_type ! scale factor when averaging landunit to gridcell - integer :: no_snow_behavior ! for multi-layer snow fields, flag saying how to treat times when a given snow layer is absent - end type field_info - - type master_entry - type (field_info) :: field ! field information - logical :: actflag(max_tapes) ! active/inactive flag - character(len=avgflag_strlen) :: avgflag(max_tapes) ! time averaging flag ("X","A","M","I","SUM") - end type master_entry - - type history_entry - type (field_info) :: field ! field information - character(len=avgflag_strlen) :: avgflag ! time averaging flag - real(r8), pointer :: hbuf(:,:) ! history buffer (dimensions: dim1d x num2d) - integer , pointer :: nacs(:,:) ! accumulation counter (dimensions: dim1d x num2d) - end type history_entry - - type history_tape - integer :: nflds ! number of active fields on tape - integer :: ntimes ! current number of time samples on tape - integer :: mfilt ! maximum number of time samples per tape - integer :: nhtfrq ! number of time samples per tape - integer :: ncprec ! netcdf output precision - logical :: dov2xy ! true => do xy average for all fields - logical :: is_endhist ! true => current time step is end of history interval - real(r8) :: begtime ! time at beginning of history averaging interval - type (history_entry) :: hlist(max_flds) ! array of active history tape entries - end type history_tape - - type clmpoint_rs ! Pointer to real scalar data (1D) - real(r8), pointer :: ptr(:) - end type clmpoint_rs - type clmpoint_ra ! Pointer to real array data (2D) - real(r8), pointer :: ptr(:,:) - end type clmpoint_ra - - ! Pointers into datatype arrays - integer, parameter :: max_mapflds = 2500 ! Maximum number of fields to track - type (clmpoint_rs) :: clmptr_rs(max_mapflds) ! Real scalar data (1D) - type (clmpoint_ra) :: clmptr_ra(max_mapflds) ! Real array data (2D) - ! - ! Master list: an array of master_entry entities - ! - type (master_entry) :: masterlist(max_flds) ! master field list - ! - ! History tape: an array of history_tape entities (only active fields) - ! - type (history_tape) :: tape(max_tapes) ! array history tapes - ! - ! Namelist input - ! - ! Counters - ! - integer :: nfmaster = 0 ! number of fields in master field list - ! - ! Other variables - ! - character(len=max_length_filename) :: locfnh(max_tapes) ! local history file names - character(len=max_length_filename) :: locfnhr(max_tapes) ! local history restart file names - logical :: htapes_defined = .false. ! flag indicates history contents have been defined - ! - ! NetCDF Id's - ! - type(file_desc_t), target :: nfid(max_tapes) ! file ids - type(file_desc_t), target :: ncid_hist(max_tapes) ! file ids for history restart files - integer :: time_dimid ! time dimension id - integer :: hist_interval_dimid ! time bounds dimension id - integer :: strlen_dimid ! string dimension id - ! - ! Time Constant variable names and filename - ! - character(len=max_chars) :: TimeConst3DVars_Filename = ' ' - ! - ! time_period_freq variable - ! - character(len=max_chars) :: time_period_freq = ' ' - - character(len=max_chars) :: TimeConst3DVars = ' ' - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine hist_printflds() - ! - ! !DESCRIPTION: - ! Print summary of master field list. - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer nf - character(len=*),parameter :: subname = 'CLM_hist_printflds' - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) trim(subname),' : number of master fields = ',nfmaster - write(iulog,*)' ******* MASTER FIELD LIST *******' - do nf = 1,nfmaster - write(iulog,9000)nf, masterlist(nf)%field%name, masterlist(nf)%field%units -9000 format (i5,1x,a32,1x,a16) - end do - call shr_sys_flush(iulog) - end if - - end subroutine hist_printflds - - !----------------------------------------------------------------------- - subroutine masterlist_addfld (fname, type1d, type1d_out, & - type2d, num2d, units, avgflag, long_name, hpindex, & - p2c_scale_type, c2l_scale_type, l2g_scale_type, & - no_snow_behavior) - ! - ! !DESCRIPTION: - ! Add a field to the master field list. Put input arguments of - ! field name, units, number of levels, averaging flag, and long name - ! into a type entry in the global master field list (masterlist). - ! - ! The optional argument no_snow_behavior should be given when this is a multi-layer - ! snow field, and should be absent otherwise. It should take on one of the no_snow_* - ! parameters defined above - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type1d ! 1d data type - character(len=*), intent(in) :: type1d_out ! 1d output type - character(len=*), intent(in) :: type2d ! 2d output type - integer , intent(in) :: num2d ! size of second dimension (e.g. number of vertical levels) - character(len=*), intent(in) :: units ! units of field - character(len=*), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - integer , intent(in) :: hpindex ! data type index for history buffer output - character(len=*), intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - integer, intent(in), optional :: no_snow_behavior ! if a multi-layer snow field, behavior to use for absent snow layers - ! - ! !LOCAL VARIABLES: - integer :: n ! loop index - integer :: f ! masterlist index - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - type(bounds_type) :: bounds - character(len=*),parameter :: subname = 'masterlist_addfld' - !------------------------------------------------------------------------ - - if (.not. avgflag_valid(avgflag, blank_valid=.true.)) then - write(iulog,*) trim(subname),' ERROR: unknown averaging flag=', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Determine bounds - - call get_proc_bounds(bounds) - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump) - - ! Ensure that new field is not all blanks - - if (fname == ' ') then - write(iulog,*) trim(subname),' ERROR: blank field name not allowed' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Ensure that new field name isn't too long - - if (len_trim(fname) > max_namlen ) then - write(iulog,*) trim(subname),' ERROR: field name too long: ', trim(fname) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - ! Ensure that new field doesn't already exist - - do n = 1,nfmaster - if (masterlist(n)%field%name == fname) then - write(iulog,*) trim(subname),' ERROR:', fname, ' already on list' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - - ! Increase number of fields on master field list - - nfmaster = nfmaster + 1 - f = nfmaster - - ! Check number of fields in master list against maximum number for master list - - if (nfmaster > max_flds) then - write(iulog,*) trim(subname),' ERROR: too many fields for primary history file ', & - '-- max_flds,nfmaster=', max_flds, nfmaster - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Add field to master list - - masterlist(f)%field%name = fname - masterlist(f)%field%long_name = long_name - masterlist(f)%field%units = units - masterlist(f)%field%type1d = type1d - masterlist(f)%field%type1d_out = type1d_out - masterlist(f)%field%type2d = type2d - masterlist(f)%field%num2d = num2d - masterlist(f)%field%hpindex = hpindex - masterlist(f)%field%p2c_scale_type = p2c_scale_type - masterlist(f)%field%c2l_scale_type = c2l_scale_type - masterlist(f)%field%l2g_scale_type = l2g_scale_type - - select case (type1d) - case (grlnd) - masterlist(f)%field%beg1d = bounds%begg - masterlist(f)%field%end1d = bounds%endg - masterlist(f)%field%num1d = numg - case (nameg) - masterlist(f)%field%beg1d = bounds%begg - masterlist(f)%field%end1d = bounds%endg - masterlist(f)%field%num1d = numg - case (namel) - masterlist(f)%field%beg1d = bounds%begl - masterlist(f)%field%end1d = bounds%endl - masterlist(f)%field%num1d = numl - case (namec) - masterlist(f)%field%beg1d = bounds%begc - masterlist(f)%field%end1d = bounds%endc - masterlist(f)%field%num1d = numc - case (namep) - masterlist(f)%field%beg1d = bounds%begp - masterlist(f)%field%end1d = bounds%endp - masterlist(f)%field%num1d = nump - case default - write(iulog,*) trim(subname),' ERROR: unknown 1d output type= ',type1d - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - if (present(no_snow_behavior)) then - masterlist(f)%field%no_snow_behavior = no_snow_behavior - else - masterlist(f)%field%no_snow_behavior = no_snow_unset - end if - - ! The following two fields are used only in master field list, - ! NOT in the runtime active field list - ! ALL FIELDS IN THE MASTER LIST ARE INITIALIZED WITH THE ACTIVE - ! FLAG SET TO FALSE - - masterlist(f)%avgflag(:) = avgflag - masterlist(f)%actflag(:) = .false. - - end subroutine masterlist_addfld - - !----------------------------------------------------------------------- - subroutine hist_htapes_build () - ! - ! !DESCRIPTION: - ! Initialize history file for initial or continuation run. For example, - ! on an initial run, this routine initializes ``ntapes'' history files. - ! On a restart run, this routine only initializes history files declared - ! beyond what existed on the previous run. Files which already existed on - ! the previous run have already been initialized (i.e. named and opened) - ! in routine restart\_history. Loop over tapes and fields per tape setting - ! appropriate variables and calling appropriate routines - ! - ! !USES: - use clm_time_manager, only: get_prev_time - use clm_varcon , only: secspday - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: i ! index - integer :: ier ! error code - integer :: t, f ! tape, field indices - integer :: day, sec ! day and seconds from base date - character(len=*),parameter :: subname = 'hist_htapes_build' - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) trim(subname),' Initializing clm2 history files' - write(iulog,'(72a1)') ("-",i=1,60) - call shr_sys_flush(iulog) - endif - - ! Define field list information for all history files. - ! Update ntapes to reflect number of active history files - ! Note - branch runs can have additional auxiliary history files - ! declared). - - call htapes_fieldlist() - - ! Determine if gridcell (xy) averaging is done for all fields on tape - - do t=1,ntapes - tape(t)%dov2xy = hist_dov2xy(t) - if (masterproc) then - write(iulog,*)trim(subname),' hist tape = ',t,& - ' written with dov2xy= ',tape(t)%dov2xy - end if - end do - - ! Set number of time samples in each history file and - ! Note - the following entries will be overwritten by history restart - ! Note - with netcdf, only 1 (ncd_double) and 2 (ncd_float) are allowed - - do t=1,ntapes - tape(t)%ntimes = 0 - tape(t)%dov2xy = hist_dov2xy(t) - tape(t)%nhtfrq = hist_nhtfrq(t) - tape(t)%mfilt = hist_mfilt(t) - if (hist_ndens(t) == 1) then - tape(t)%ncprec = ncd_double - else - tape(t)%ncprec = ncd_float - endif - end do - - ! Set time of beginning of current averaging interval - ! First etermine elapased time since reference date - - call get_prev_time(day, sec) - do t=1,ntapes - tape(t)%begtime = day + sec/secspday - end do - - if (masterproc) then - write(iulog,*) trim(subname),' Successfully initialized clm2 history files' - write(iulog,'(72a1)') ("-",i=1,60) - call shr_sys_flush(iulog) - endif - - end subroutine hist_htapes_build - - !----------------------------------------------------------------------- - subroutine masterlist_make_active (name, tape_index, avgflag) - ! - ! !DESCRIPTION: - ! Add a field to the default ``on'' list for a given history file. - ! Also change the default time averaging flag if requested. - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: name ! field name - integer, intent(in) :: tape_index ! history tape index - character(len=*), intent(in), optional :: avgflag ! time averaging flag - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - logical :: found ! flag indicates field found in masterlist - character(len=*),parameter :: subname = 'masterlist_make_active' - !----------------------------------------------------------------------- - - ! Check validity of input arguments - - if (tape_index > max_tapes) then - write(iulog,*) trim(subname),' ERROR: tape index=', tape_index, ' is too big' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (present(avgflag)) then - if (.not. avgflag_valid(avgflag, blank_valid=.true.)) then - write(iulog,*) trim(subname),' ERROR: unknown averaging flag=', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - ! Look through master list for input field name. - ! When found, set active flag for that tape to true. - ! Also reset averaging flag if told to use other than default. - - found = .false. - do f = 1,nfmaster - if (trim(name) == trim(masterlist(f)%field%name)) then - masterlist(f)%actflag(tape_index) = .true. - if (present(avgflag)) then - if (avgflag/= ' ') masterlist(f)%avgflag(tape_index) = avgflag - end if - found = .true. - exit - end if - end do - if (.not. found) then - write(iulog,*) trim(subname),' ERROR: field=', name, ' not found' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine masterlist_make_active - - !----------------------------------------------------------------------- - subroutine masterlist_change_timeavg (t) - ! - ! !DESCRIPTION: - ! Override default history tape contents for a specific tape. - ! Copy the flag into the master field list. - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! history tape index - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - character(len=avgflag_strlen) :: avgflag ! local equiv of hist_avgflag_pertape(t) - character(len=*),parameter :: subname = 'masterlist_change_timeavg' - !----------------------------------------------------------------------- - - avgflag = hist_avgflag_pertape(t) - if (.not. avgflag_valid(avgflag, blank_valid = .false.)) then - write(iulog,*) trim(subname),' ERROR: unknown avgflag=',avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - do f = 1,nfmaster - masterlist(f)%avgflag(t) = avgflag - end do - - end subroutine masterlist_change_timeavg - - !----------------------------------------------------------------------- - subroutine htapes_fieldlist() - ! - ! !DESCRIPTION: - ! Define the contents of each history file based on namelist - ! input for initial or branch run, and restart data if a restart run. - ! Use arrays fincl and fexcl to modify default history tape contents. - ! Then sort the result alphanumerically. - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: t, f ! tape, field indices - integer :: ff ! index into include, exclude and fprec list - character(len=max_namlen) :: name ! field name portion of fincl (i.e. no avgflag separator) - character(len=max_namlen) :: mastername ! name from masterlist field - character(len=avgflag_strlen) :: avgflag ! averaging flag - character(len=1) :: prec_acc ! history buffer precision flag - character(len=1) :: prec_wrt ! history buffer write precision flag - type (history_entry) :: tmp ! temporary used for swapping - character(len=*),parameter :: subname = 'htapes_fieldlist' - !----------------------------------------------------------------------- - - ! Override averaging flag for all fields on a particular tape - ! if namelist input so specifies - - do t=1,max_tapes - if (hist_avgflag_pertape(t) /= ' ') then - call masterlist_change_timeavg (t) - end if - end do - - fincl(:,1) = hist_fincl1(:) - fincl(:,2) = hist_fincl2(:) - fincl(:,3) = hist_fincl3(:) - fincl(:,4) = hist_fincl4(:) - fincl(:,5) = hist_fincl5(:) - fincl(:,6) = hist_fincl6(:) - fincl(:,7) = hist_fincl7(:) - fincl(:,8) = hist_fincl8(:) - fincl(:,9) = hist_fincl9(:) - fincl(:,10) = hist_fincl10(:) - - fexcl(:,1) = hist_fexcl1(:) - fexcl(:,2) = hist_fexcl2(:) - fexcl(:,3) = hist_fexcl3(:) - fexcl(:,4) = hist_fexcl4(:) - fexcl(:,5) = hist_fexcl5(:) - fexcl(:,6) = hist_fexcl6(:) - fexcl(:,7) = hist_fexcl7(:) - fexcl(:,8) = hist_fexcl8(:) - fexcl(:,9) = hist_fexcl9(:) - fexcl(:,10) = hist_fexcl10(:) - - - ! First ensure contents of fincl and fexcl are valid names - - do t = 1,max_tapes - f = 1 - do while (f < max_flds .and. fincl(f,t) /= ' ') - name = getname (fincl(f,t)) - do ff = 1,nfmaster - mastername = masterlist(ff)%field%name - if (name == mastername) exit - end do - if (name /= mastername) then - write(iulog,*) trim(subname),' ERROR: ', trim(name), ' in fincl(', f, ') ',& - 'for history tape ',t,' not found' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - f = f + 1 - end do - - f = 1 - do while (f < max_flds .and. fexcl(f,t) /= ' ') - do ff = 1,nfmaster - mastername = masterlist(ff)%field%name - if (fexcl(f,t) == mastername) exit - end do - if (fexcl(f,t) /= mastername) then - write(iulog,*) trim(subname),' ERROR: ', fexcl(f,t), ' in fexcl(', f, ') ', & - 'for history tape ',t,' not found' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - f = f + 1 - end do - end do - - tape(:)%nflds = 0 - do t = 1,max_tapes - - ! Loop through the masterlist set of field names and determine if any of those - ! are in the FINCL or FEXCL arrays - ! The call to list_index determines the index in the FINCL or FEXCL arrays - ! that the masterlist field corresponds to - ! Add the field to the tape if specified via namelist (FINCL[1-max_tapes]), - ! or if it is on by default and was not excluded via namelist (FEXCL[1-max_tapes]). - - do f = 1,nfmaster - mastername = masterlist(f)%field%name - call list_index (fincl(1,t), mastername, ff) - - if (ff > 0) then - - ! if field is in include list, ff > 0 and htape_addfld - ! will not be called for field - - avgflag = getflag (fincl(ff,t)) - call htape_addfld (t, f, avgflag) - - else if (.not. hist_empty_htapes) then - - ! find index of field in exclude list - - call list_index (fexcl(1,t), mastername, ff) - - ! if field is in exclude list, ff > 0 and htape_addfld - ! will not be called for field - ! if field is not in exclude list, ff =0 and htape_addfld - ! will be called for field (note that htape_addfld will be - ! called below only if field is not in exclude list OR in - ! include list - - if (ff == 0 .and. masterlist(f)%actflag(t)) then - call htape_addfld (t, f, ' ') - end if - - end if - end do - - ! Specification of tape contents now complete. - ! Sort each list of active entries - - do f = tape(t)%nflds-1,1,-1 - do ff = 1,f - if (tape(t)%hlist(ff)%field%name > tape(t)%hlist(ff+1)%field%name) then - - tmp = tape(t)%hlist(ff) - tape(t)%hlist(ff ) = tape(t)%hlist(ff+1) - tape(t)%hlist(ff+1) = tmp - - else if (tape(t)%hlist(ff)%field%name == tape(t)%hlist(ff+1)%field%name) then - - write(iulog,*) trim(subname),' ERROR: Duplicate field ', & - tape(t)%hlist(ff)%field%name, & - 't,ff,name=',t,ff,tape(t)%hlist(ff+1)%field%name - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end if - end do - end do - - if (masterproc) then - if (tape(t)%nflds > 0) then - write(iulog,*) trim(subname),' : Included fields tape ',t,'=',tape(t)%nflds - end if - do f = 1,tape(t)%nflds - write(iulog,*) f,' ',tape(t)%hlist(f)%field%name, & - tape(t)%hlist(f)%field%num2d,' ',tape(t)%hlist(f)%avgflag - end do - call shr_sys_flush(iulog) - end if - end do - - ! Determine total number of active history tapes - - ntapes = 0 - do t = max_tapes,1,-1 - if (tape(t)%nflds > 0) then - ntapes = t - exit - end if - end do - - ! Ensure there are no "holes" in tape specification, i.e. empty tapes. - ! Enabling holes should not be difficult if necessary. - - do t = 1,ntapes - if (tape(t)%nflds == 0) then - write(iulog,*) trim(subname),' ERROR: Tape ',t,' is empty' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - - ! Check that the number of history files declared does not exceed - ! the maximum allowed. - - if (ntapes > max_tapes) then - write(iulog,*) trim(subname),' ERROR: Too many history files declared, max_tapes=',max_tapes - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Change 1d output per tape output flag if requested - only for history - ! tapes where 2d xy averaging is not enabled - - do t = 1,ntapes - if (hist_type1d_pertape(t) /= ' ' .and. (.not. hist_dov2xy(t))) then - select case (trim(hist_type1d_pertape(t))) - case ('PFTS','COLS', 'LAND', 'GRID') - if ( masterproc ) & - write(iulog,*)'history tape ',t,' will have 1d output type of ',hist_type1d_pertape(t) - case default - write(iulog,*) trim(subname),' ERROR: unknown namelist type1d per tape=',hist_type1d_pertape(t) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - end if - end do - - if (masterproc) then - write(iulog,*) 'There will be a total of ',ntapes,' history tapes' - do t=1,ntapes - write(iulog,*) - if (hist_nhtfrq(t) == 0) then - write(iulog,*)'History tape ',t,' write frequency is MONTHLY' - else - write(iulog,*)'History tape ',t,' write frequency = ',hist_nhtfrq(t) - endif - if (hist_dov2xy(t)) then - write(iulog,*)'All fields on history tape ',t,' are grid averaged' - else - write(iulog,*)'All fields on history tape ',t,' are not grid averaged' - end if - write(iulog,*)'Number of time samples on history tape ',t,' is ',hist_mfilt(t) - write(iulog,*)'Output precision on history tape ',t,'=',hist_ndens(t) - write(iulog,*) - end do - call shr_sys_flush(iulog) - end if - - ! Set flag indicating h-tape contents are now defined (needed by masterlist_addfld) - - htapes_defined = .true. - - - end subroutine htapes_fieldlist - - !----------------------------------------------------------------------- - logical function is_mapping_upto_subgrid( type1d, type1d_out ) result ( mapping) - ! - ! !DESCRIPTION: - ! - ! Return true if this field will be mapped into a higher subgrid level - ! If false it will be output on it's native grid - ! - ! !ARGUMENTS: - implicit none - character(len=8), intent(in) :: type1d ! clm pointer 1d type - character(len=8), intent(in) :: type1d_out ! history buffer 1d type - ! - mapping = .false. - if (type1d_out == nameg .or. type1d_out == grlnd) then - if (type1d == namep) then - mapping = .true. - else if (type1d == namec) then - mapping = .true. - else if (type1d == namel) then - mapping = .true. - end if - else if (type1d_out == namel ) then - if (type1d == namep) then - mapping = .true. - else if (type1d == namec) then - mapping = .true. - end if - else if (type1d_out == namec ) then - if (type1d == namep) then - mapping = .true. - end if - end if - end function is_mapping_upto_subgrid - - !----------------------------------------------------------------------- - subroutine htape_addfld (t, f, avgflag) - ! - ! !DESCRIPTION: - ! Add a field to the active list for a history tape. Copy the data from - ! the master field list to the active list for the tape. - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! history tape index - integer, intent(in) :: f ! field index from master field list - character(len=*), intent(in) :: avgflag ! time averaging flag - ! - ! !LOCAL VARIABLES: - integer :: n ! field index on defined tape - character(len=hist_dim_name_length) :: type1d ! clm pointer 1d type - character(len=hist_dim_name_length) :: type1d_out ! history buffer 1d type - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: num2d ! size of second dimension (e.g. .number of vertical levels) - integer :: beg1d_out,end1d_out ! history output per-proc 1d beginning and ending indices - integer :: beg1d,end1d ! beginning and ending indices for this field (assume already set) - integer :: num1d_out ! history output 1d size - type(bounds_type) :: bounds - character(len=*),parameter :: subname = 'htape_addfld' - !----------------------------------------------------------------------- - - ! Ensure that it is not to late to add a field to the history tape - - if (htapes_defined) then - write(iulog,*) trim(subname),' ERROR: attempt to add field ', & - masterlist(f)%field%name, ' after history files are set' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - tape(t)%nflds = tape(t)%nflds + 1 - n = tape(t)%nflds - - ! Copy field information - - tape(t)%hlist(n)%field = masterlist(f)%field - - ! Determine bounds - - call get_proc_bounds(bounds) - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump) - - ! Modify type1d_out if necessary - - if (hist_dov2xy(t)) then - - ! If xy output averaging is requested, set output 1d type to grlnd - ! ***NOTE- the following logic is what permits non lat/lon grids to - ! be written to clm history file - - type1d = tape(t)%hlist(n)%field%type1d - - if (type1d == nameg .or. & - type1d == namel .or. & - type1d == namec .or. & - type1d == namep) then - tape(t)%hlist(n)%field%type1d_out = grlnd - end if - if (type1d == grlnd) then - tape(t)%hlist(n)%field%type1d_out = grlnd - end if - - else if (hist_type1d_pertape(t) /= ' ') then - - ! Set output 1d type based on namelist setting of hist_type1d_pertape - ! Only applies to tapes when xy output is not required - - type1d = tape(t)%hlist(n)%field%type1d - - select case (trim(hist_type1d_pertape(t))) - case('GRID') - tape(t)%hlist(n)%field%type1d_out = nameg - case('LAND') - tape(t)%hlist(n)%field%type1d_out = namel - case('COLS') - tape(t)%hlist(n)%field%type1d_out = namec - case ('PFTS') - tape(t)%hlist(n)%field%type1d_out = namep - case default - write(iulog,*) trim(subname),' ERROR: unknown input hist_type1d_pertape= ', hist_type1d_pertape(t) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - endif - - ! Determine output 1d dimensions - - type1d_out = tape(t)%hlist(n)%field%type1d_out - if (type1d_out == grlnd) then - beg1d_out = bounds%begg - end1d_out = bounds%endg - num1d_out = numg - else if (type1d_out == nameg) then - beg1d_out = bounds%begg - end1d_out = bounds%endg - num1d_out = numg - else if (type1d_out == namel) then - beg1d_out = bounds%begl - end1d_out = bounds%endl - num1d_out = numl - else if (type1d_out == namec) then - beg1d_out = bounds%begc - end1d_out = bounds%endc - num1d_out = numc - else if (type1d_out == namep) then - beg1d_out = bounds%begp - end1d_out = bounds%endp - num1d_out = nump - else - write(iulog,*) trim(subname),' ERROR: incorrect value of type1d_out= ',type1d_out - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Output bounds for the field - tape(t)%hlist(n)%field%beg1d_out = beg1d_out - tape(t)%hlist(n)%field%end1d_out = end1d_out - tape(t)%hlist(n)%field%num1d_out = num1d_out - - ! Fields native bounds - beg1d = masterlist(f)%field%beg1d - end1d = masterlist(f)%field%end1d - - ! Alloccate and initialize history buffer and related info - - num2d = tape(t)%hlist(n)%field%num2d - if ( is_mapping_upto_subgrid( type1d, type1d_out ) ) then - allocate (tape(t)%hlist(n)%hbuf(beg1d_out:end1d_out,num2d)) - allocate (tape(t)%hlist(n)%nacs(beg1d_out:end1d_out,num2d)) - else - allocate (tape(t)%hlist(n)%hbuf(beg1d:end1d,num2d)) - allocate (tape(t)%hlist(n)%nacs(beg1d:end1d,num2d)) - end if - tape(t)%hlist(n)%hbuf(:,:) = 0._r8 - tape(t)%hlist(n)%nacs(:,:) = 0 - - ! Set time averaging flag based on masterlist setting or - ! override the default averaging flag with namelist setting - - if (.not. avgflag_valid(avgflag, blank_valid=.true.)) then - write(iulog,*) trim(subname),' ERROR: unknown avgflag=', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (avgflag == ' ') then - tape(t)%hlist(n)%avgflag = masterlist(f)%avgflag(t) - else - tape(t)%hlist(n)%avgflag = avgflag - end if - - end subroutine htape_addfld - - !----------------------------------------------------------------------- - subroutine hist_update_hbuf(bounds) - ! - ! !DESCRIPTION: - ! Accumulate (or take min, max, etc. as appropriate) input field - ! into its history buffer for appropriate tapes. - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: t ! tape index - integer :: f ! field index - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - character(len=*),parameter :: subname = 'hist_update_hbuf' - character(len=hist_dim_name_length) :: type2d ! hbuf second dimension type ["levgrnd","levlak","numrad","ltype","natpft","cft","glc_nec","elevclas","subname(n)"] - !----------------------------------------------------------------------- - - do t = 1,ntapes -!$OMP PARALLEL DO PRIVATE (f, num2d) - do f = 1,tape(t)%nflds - num2d = tape(t)%hlist(f)%field%num2d - if ( num2d == 1) then - call hist_update_hbuf_field_1d (t, f, bounds) - else - call hist_update_hbuf_field_2d (t, f, bounds, num2d) - end if - end do -!$OMP END PARALLEL DO - end do - - end subroutine hist_update_hbuf - - !----------------------------------------------------------------------- - subroutine hist_update_hbuf_field_1d (t, f, bounds) - ! - ! !DESCRIPTION: - ! Accumulate (or take min, max, etc. as appropriate) input field - ! into its history buffer for appropriate tapes. - ! - ! This canNOT be called from within a threaded region (see comment below regarding the - ! call to p2g, and the lack of explicit bounds on its arguments; see also bug 1786) - ! - ! !USES: - use subgridAveMod , only : p2g, c2g, l2g, p2l, c2l, p2c - use decompMod , only : BOUNDS_LEVEL_PROC - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - integer, intent(in) :: f ! field index - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: hpindex ! history pointer index - integer :: k ! gridcell, landunit, column or patch index - integer :: beg1d,end1d ! beginning and ending indices - integer :: beg1d_out,end1d_out ! beginning and ending indices on output grid - logical :: check_active ! true => check 'active' flag of each point (this refers to a point being active, NOT a history field being active) - logical :: valid ! true => history operation is valid - logical :: map2gcell ! true => map clm pointer field to gridcell - character(len=hist_dim_name_length) :: type1d ! 1d clm pointerr type ["gridcell","landunit","column","pft"] - character(len=hist_dim_name_length) :: type1d_out ! 1d history buffer type ["gridcell","landunit","column","pft"] - character(len=avgflag_strlen) :: avgflag ! time averaging flag - character(len=scale_type_strlen) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=scale_type_strlen) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=scale_type_strlen) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - real(r8), pointer :: field(:) ! clm 1d pointer field - logical , pointer :: active(:) ! flag saying whether each point is active (used for type1d = landunit/column/pft) (this refers to a point being active, NOT a history field being active) - real(r8), allocatable :: field_gcell(:) ! gricell level field (used if mapping to gridcell is done) - integer j - character(len=*),parameter :: subname = 'hist_update_hbuf_field_1d' - integer k_offset ! offset for mapping sliced subarray pointers when outputting variables in PFT/col vector form - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, errMsg(sourcefile, __LINE__)) - - avgflag = tape(t)%hlist(f)%avgflag - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - type1d = tape(t)%hlist(f)%field%type1d - type1d_out = tape(t)%hlist(f)%field%type1d_out - p2c_scale_type = tape(t)%hlist(f)%field%p2c_scale_type - c2l_scale_type = tape(t)%hlist(f)%field%c2l_scale_type - l2g_scale_type = tape(t)%hlist(f)%field%l2g_scale_type - hpindex = tape(t)%hlist(f)%field%hpindex - field => clmptr_rs(hpindex)%ptr - - ! set variables to check weights when allocate all pfts - - map2gcell = .false. - if (type1d_out == nameg .or. type1d_out == grlnd) then - SHR_ASSERT(beg1d_out == bounds%begg, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endg, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! bounds (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate( field_gcell(beg1d_out:end1d_out) ) - call p2g(bounds, & - field, & - field_gcell(bounds%begg:bounds%endg), & - p2c_scale_type, c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namec) then - allocate( field_gcell(beg1d_out:end1d_out) ) - call c2g(bounds, & - field, & - field_gcell(bounds%begg:bounds%endg), & - c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namel) then - allocate( field_gcell(beg1d_out:end1d_out) ) - call l2g(bounds, & - field, & - field_gcell(bounds%begg:bounds%endg), & - l2g_scale_type) - map2gcell = .true. - end if - end if - if (type1d_out == namel ) then - SHR_ASSERT(beg1d_out == bounds%begl, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endl, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! bounds (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate( field_gcell(beg1d_out:end1d_out) ) - call p2l(bounds, & - field, & - field_gcell(beg1d_out:end1d_out), & - p2c_scale_type, c2l_scale_type) - map2gcell = .true. - else if (type1d == namec) then - allocate( field_gcell(beg1d_out:end1d_out) ) - call c2l(bounds, & - field, & - field_gcell(beg1d_out:end1d_out), & - c2l_scale_type) - map2gcell = .true. - end if - end if - if (type1d_out == namec ) then - SHR_ASSERT(beg1d_out == bounds%begc, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endc, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! bounds (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate( field_gcell(beg1d_out:end1d_out) ) - call p2c(bounds, & - field, & - field_gcell(beg1d_out:end1d_out), & - p2c_scale_type) - map2gcell = .true. - end if - end if - if ( map2gcell .and. .not. is_mapping_upto_subgrid(type1d, type1d_out) )then - call endrun(msg=trim(subname)//' ERROR: mapping upto subgrid level is inconsistent'//errMsg(sourcefile, __LINE__)) - end if - if ( .not. map2gcell .and. is_mapping_upto_subgrid(type1d, type1d_out) )then - call endrun(msg=trim(subname)//' ERROR: mapping upto subgrid level is inconsistent'//errMsg(sourcefile, __LINE__)) - end if - - if (map2gcell) then ! Map to gridcell - - ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) - case ('I') ! Instantaneous - do k = beg1d_out, end1d_out - if (field_gcell(k) /= spval) then - hbuf(k,1) = field_gcell(k) - else - hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('A', 'SUM') ! Time average / sum - do k = beg1d_out, end1d_out - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 - hbuf(k,1) = hbuf(k,1) + field_gcell(k) - nacs(k,1) = nacs(k,1) + 1 - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - end do - case ('X') ! Maximum over time - do k = beg1d_out, end1d_out - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = -1.e50_r8 - hbuf(k,1) = max( hbuf(k,1), field_gcell(k) ) - else - hbuf(k,1) = spval - endif - nacs(k,1) = 1 - end do - case ('M') ! Minimum over time - do k = beg1d_out, end1d_out - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = +1.e50_r8 - hbuf(k,1) = min( hbuf(k,1), field_gcell(k) ) - else - hbuf(k,1) = spval - endif - nacs(k,1) = 1 - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - deallocate( field_gcell ) - - else ! Do not map to gridcell - - ! For data defined on the pft, col or landunit, we need to check if a point is active - ! to determine whether that point should be assigned spval - if (type1d == namep) then - check_active = .true. - active => patch%active - else if (type1d == namec) then - check_active = .true. - active => col%active - else if (type1d == namel) then - check_active = .true. - active =>lun%active - else - check_active = .false. - end if - - select case (avgflag) - case ('I') ! Instantaneous - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - hbuf(k,1) = field(k) - else - hbuf(k,1) = spval - end if - else - hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('A', 'SUM') ! Time average / sum - ! create mappings for array slice pointers (which go from 1 to size(field) rather than beg1d to end1d) - if ( end1d .eq. ubound(field,1) ) then - k_offset = 0 - else - k_offset = 1 - beg1d - endif - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k+k_offset) /= spval) then ! add k_offset - if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 - hbuf(k,1) = hbuf(k,1) + field(k+k_offset) ! add k_offset - nacs(k,1) = nacs(k,1) + 1 - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - end do - case ('X') ! Maximum over time - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = -1.e50_r8 - hbuf(k,1) = max( hbuf(k,1), field(k) ) - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('M') ! Minimum over time - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = +1.e50_r8 - hbuf(k,1) = min( hbuf(k,1), field(k) ) - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - end if - - end subroutine hist_update_hbuf_field_1d - - !----------------------------------------------------------------------- - subroutine hist_update_hbuf_field_2d (t, f, bounds, num2d) - ! - ! !DESCRIPTION: - ! Accumulate (or take min, max, etc. as appropriate) input field - ! into its history buffer for appropriate tapes. - ! - ! This canNOT be called from within a threaded region (see comment below regarding the - ! call to p2g, and the lack of explicit bounds on its arguments; see also bug 1786) - ! - ! !USES: - use subgridAveMod , only : p2g, c2g, l2g, p2l, c2l, p2c - use decompMod , only : BOUNDS_LEVEL_PROC - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - integer, intent(in) :: f ! field index - type(bounds_type), intent(in) :: bounds - integer, intent(in) :: num2d ! size of second dimension - ! - ! !LOCAL VARIABLES: - integer :: hpindex ! history pointer index - integer :: k ! gridcell, landunit, column or patch index - integer :: j ! level index - integer :: beg1d,end1d ! beginning and ending indices - integer :: beg1d_out,end1d_out ! beginning and ending indices for output level - logical :: check_active ! true => check 'active' flag of each point (this refers to a point being active, NOT a history field being active) - logical :: valid ! true => history operation is valid - logical :: map2gcell ! true => map clm pointer field to gridcell - character(len=hist_dim_name_length) :: type1d ! 1d clm pointerr type ["gridcell","landunit","column","pft"] - character(len=hist_dim_name_length) :: type1d_out ! 1d history buffer type ["gridcell","landunit","column","pft"] - character(len=avgflag_strlen) :: avgflag ! time averaging flag - character(len=scale_type_strlen) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=scale_type_strlen) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=scale_type_strlen) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - integer :: no_snow_behavior ! for multi-layer snow fields, behavior to use when a given layer is absent - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - real(r8), pointer :: field(:,:) ! clm 2d pointer field - logical :: field_allocated! whether 'field' was allocated here - logical , pointer :: active(:) ! flag saying whether each point is active (used for type1d = landunit/column/pft) - !(this refers to a point being active, NOT a history field being active) - real(r8), allocatable :: field_gcell(:,:) ! gridcell level field (used if mapping to gridcell is done) - character(len=*),parameter :: subname = 'hist_update_hbuf_field_2d' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, errMsg(sourcefile, __LINE__)) - - avgflag = tape(t)%hlist(f)%avgflag - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - type1d = tape(t)%hlist(f)%field%type1d - type1d_out = tape(t)%hlist(f)%field%type1d_out - p2c_scale_type = tape(t)%hlist(f)%field%p2c_scale_type - c2l_scale_type = tape(t)%hlist(f)%field%c2l_scale_type - l2g_scale_type = tape(t)%hlist(f)%field%l2g_scale_type - no_snow_behavior = tape(t)%hlist(f)%field%no_snow_behavior - hpindex = tape(t)%hlist(f)%field%hpindex - - if (no_snow_behavior /= no_snow_unset) then - ! For multi-layer snow fields, build a special output variable that handles - ! missing snow layers appropriately - - ! Note, regarding bug 1786: The following allocation is not what we would want if - ! this routine were operating in a threaded region (or, more generally, within a - ! loop over nclumps) - in that case we would want to use the bounds information for - ! this clump. But currently that's not possible because the bounds of some fields - ! have been reset to 1 - see also bug 1786. Similarly, if we wanted to allow - ! operation within a loop over clumps, we would need to pass 'bounds' to - ! hist_set_snow_field_2d rather than relying on beg1d & end1d (which give the proc, - ! bounds not the clump bounds) - - allocate(field(lbound(clmptr_ra(hpindex)%ptr, 1) : ubound(clmptr_ra(hpindex)%ptr, 1), 1:num2d)) - field_allocated = .true. - - call hist_set_snow_field_2d(field, clmptr_ra(hpindex)%ptr, no_snow_behavior, type1d, & - beg1d, end1d) - else - field => clmptr_ra(hpindex)%ptr(:,1:num2d) - field_allocated = .false. - end if - - ! set variables to check weights when allocate all pfts - - map2gcell = .false. - if (type1d_out == nameg .or. type1d_out == grlnd) then - SHR_ASSERT(beg1d_out == bounds%begg, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endg, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate(field_gcell(bounds%begg:bounds%endg,num2d) ) - call p2g(bounds, num2d, & - field, & - field_gcell(bounds%begg:bounds%endg, :), & - p2c_scale_type, c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namec) then - allocate(field_gcell(bounds%begg:bounds%endg,num2d) ) - call c2g(bounds, num2d, & - field, & - field_gcell(bounds%begg:bounds%endg, :), & - c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namel) then - allocate(field_gcell(bounds%begg:bounds%endg,num2d) ) - call l2g(bounds, num2d, & - field, & - field_gcell(bounds%begg:bounds%endg, :), & - l2g_scale_type) - map2gcell = .true. - end if - else if ( type1d_out == namel )then - SHR_ASSERT(beg1d_out == bounds%begl, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endl, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate(field_gcell(beg1d_out:end1d_out,num2d)) - call p2l(bounds, num2d, & - field, & - field_gcell(beg1d_out:end1d_out, :), & - p2c_scale_type, c2l_scale_type) - map2gcell = .true. - else if (type1d == namec) then - allocate(field_gcell(beg1d_out:end1d_out,num2d)) - call c2l(bounds, num2d, & - field, & - field_gcell(beg1d_out:end1d_out, :), & - c2l_scale_type) - map2gcell = .true. - end if - else if ( type1d_out == namec )then - SHR_ASSERT(beg1d_out == bounds%begc, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(end1d_out == bounds%endc, errMsg(sourcefile, __LINE__)) - if (type1d == namep) then - ! In this and the following calls, we do NOT explicitly subset field using - ! (e.g., we do NOT do field(bounds%begp:bounds%endp). This is because, - ! for some fields, the lower bound has been reset to 1 due to taking a pointer - ! to an array slice. Thus, this code will NOT work properly if done within a - ! threaded region! (See also bug 1786) - allocate(field_gcell(beg1d_out:end1d_out,num2d)) - call p2c(bounds, num2d, & - field, & - field_gcell(beg1d_out:end1d_out, :), & - p2c_scale_type) - map2gcell = .true. - end if - end if - if ( map2gcell .and. .not. is_mapping_upto_subgrid(type1d, type1d_out) )then - call endrun(msg=trim(subname)//' ERROR: mapping upto subgrid level is inconsistent'//errMsg(sourcefile, __LINE__)) - end if - if ( .not. map2gcell .and. is_mapping_upto_subgrid(type1d, type1d_out) )then - call endrun(msg=trim(subname)//' ERROR: mapping upto subgrid level is inconsistent'//errMsg(sourcefile, __LINE__)) - end if - - if (map2gcell) then ! Map to gridcell - - ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) - case ('I') ! Instantaneous - do j = 1,num2d - do k = beg1d_out, end1d_out - if (field_gcell(k,j) /= spval) then - hbuf(k,j) = field_gcell(k,j) - else - hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('A', 'SUM') ! Time average / sum - do j = 1,num2d - do k = beg1d_out, end1d_out - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 - hbuf(k,j) = hbuf(k,j) + field_gcell(k,j) - nacs(k,j) = nacs(k,j) + 1 - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - endif - end do - end do - case ('X') ! Maximum over time - do j = 1,num2d - do k = beg1d_out, end1d_out - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = -1.e50_r8 - hbuf(k,j) = max( hbuf(k,j), field_gcell(k,j) ) - else - hbuf(k,j) = spval - endif - nacs(k,j) = 1 - end do - end do - case ('M') ! Minimum over time - do j = 1,num2d - do k = beg1d_out, end1d_out - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = +1.e50_r8 - hbuf(k,j) = min( hbuf(k,j), field_gcell(k,j) ) - else - hbuf(k,j) = spval - endif - nacs(k,j) = 1 - end do - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - deallocate( field_gcell ) - - else ! Do not map to gridcell - - ! For data defined on the pft, col or landunit, we need to check if a point is active - ! to determine whether that point should be assigned spval - if (type1d == namep) then - check_active = .true. - active => patch%active - else if (type1d == namec) then - check_active = .true. - active => col%active - else if (type1d == namel) then - check_active = .true. - active =>lun%active - else - check_active = .false. - end if - - ! Note that since field points to an array section the - ! bounds are field(1:end1d-beg1d+1, num2d) - therefore - ! need to do the shifting below - - select case (avgflag) - case ('I') ! Instantaneous - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - hbuf(k,j) = field(k-beg1d+1,j) - else - hbuf(k,j) = spval - end if - else - hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('A', 'SUM') ! Time average / sum - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 - hbuf(k,j) = hbuf(k,j) + field(k-beg1d+1,j) - nacs(k,j) = nacs(k,j) + 1 - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - end do - end do - case ('X') ! Maximum over time - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = -1.e50_r8 - hbuf(k,j) = max( hbuf(k,j), field(k-beg1d+1,j) ) - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('M') ! Minimum over time - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (check_active) then - if (.not. active(k)) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = +1.e50_r8 - hbuf(k,j) = min( hbuf(k,j), field(k-beg1d+1,j)) - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - end if - - if (field_allocated) then - deallocate(field) - end if - - end subroutine hist_update_hbuf_field_2d - - !----------------------------------------------------------------------- - subroutine hist_set_snow_field_2d (field_out, field_in, no_snow_behavior, type1d, beg1d, end1d) - ! - ! !DESCRIPTION: - ! Set values in history field dimensioned by levsno. - ! - ! This routine handles what to do when a given snow layer doesn't exist for a given - ! point, based on the no_snow_behavior argument. Options are: - ! - ! - no_snow_normal: This is the normal behavior, which applies to most snow fields: - ! Use spval (missing value flag). This means that temporal averages will just - ! consider times when a particular snow layer actually existed - ! - ! - no_snow_zero: Average in a 0 value for times when the snow layer isn't present - ! - ! Input and output fields can be defined at the patch or column level - ! - ! !ARGUMENTS: - integer , intent(in) :: beg1d ! beginning spatial index - integer , intent(in) :: end1d ! ending spatial index - real(r8) , intent(out) :: field_out( beg1d: , 1: ) ! output field [point, lev] - real(r8) , intent(in) :: field_in ( beg1d: , 1: ) ! input field [point, lev] - integer , intent(in) :: no_snow_behavior ! behavior to use when a snow layer is absent - character(len=*), intent(in) :: type1d ! 1d clm pointer type ("column" or "pft") - ! - ! !LOCAL VARIABLES: - integer :: num_levels ! total number of possible snow layers - integer :: point - integer :: level - integer :: num_snow_layers ! number of snow layers that exist at a point - integer :: num_nonexistent_layers - integer :: c ! column index - real(r8):: no_snow_val ! value to use when a snow layer is missing - character(len=*), parameter :: subname = 'hist_set_snow_field_2d' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(field_out, 1) == end1d), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(field_in , 1) == end1d), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(field_out, 2) == ubound(field_in, 2)), errMsg(sourcefile, __LINE__)) - - associate(& - snl => col%snl & ! Input: [integer (:)] number of snow layers (negative) - ) - - num_levels = ubound(field_in, 2) - - ! Determine no_snow_val - select case (no_snow_behavior) - case (no_snow_normal) - no_snow_val = spval - case (no_snow_zero) - no_snow_val = 0._r8 - case default - write(iulog,*) trim(subname), ' ERROR: unrecognized no_snow_behavior: ', & - no_snow_behavior - call endrun() - end select - - do point = beg1d, end1d - - ! Get number of snow layers at this point - - if (type1d == namec) then - c = point - else if (type1d == namep) then - c = patch%column(point) - else - write(iulog,*) trim(subname), ' ERROR: Only implemented for patch and col-level fields' - write(iulog,*) 'type1d = ', trim(type1d) - call endrun() - end if - - num_snow_layers = abs(snl(c)) - num_nonexistent_layers = num_levels - num_snow_layers - - ! Fill output field appropriately for each layer - ! When only a subset of snow layers exist, it is the LAST num_snow_layers that exist - ! Levels are rearranged such that the top snow layer (surface layer) becomes level 1, etc. - - do level = num_levels, (num_levels-num_nonexistent_layers+1), -1 - field_out(point, level) = no_snow_val - end do - do level = (num_levels-num_nonexistent_layers), 1, -1 - field_out(point, level) = field_in(point, level+num_nonexistent_layers) - end do - - end do - - end associate - - end subroutine hist_set_snow_field_2d - - - !----------------------------------------------------------------------- - subroutine hfields_normalize (t) - ! - ! !DESCRIPTION: - ! Normalize fields on a history file by the number of accumulations. - ! Loop over fields on the tape. Need averaging flag and number of - ! accumulations to perform normalization. - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - integer :: k ! 1d index - integer :: j ! 2d index - logical :: aflag ! averaging flag - integer :: beg1d,end1d ! hbuf 1d beginning and ending indices - integer :: num2d ! hbuf size of second dimension (e.g. number of vertical levels) - character(len=avgflag_strlen) :: avgflag ! averaging flag - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - character(len=*),parameter :: subname = 'hfields_normalize' - !----------------------------------------------------------------------- - - ! Normalize by number of accumulations for time averaged case - - do f = 1,tape(t)%nflds - avgflag = tape(t)%hlist(f)%avgflag - if ( is_mapping_upto_subgrid(tape(t)%hlist(f)%field%type1d, tape(t)%hlist(f)%field%type1d_out) )then - beg1d = tape(t)%hlist(f)%field%beg1d_out - end1d = tape(t)%hlist(f)%field%end1d_out - else - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - end if - num2d = tape(t)%hlist(f)%field%num2d - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (avgflag == 'A') then - aflag = .true. - else - aflag = .false. - end if - - do j = 1, num2d - do k = beg1d, end1d - if (aflag .and. nacs(k,j) /= 0) then - hbuf(k,j) = hbuf(k,j) / float(nacs(k,j)) - end if - end do - end do - end do - - end subroutine hfields_normalize - - !----------------------------------------------------------------------- - subroutine hfields_zero (t) - ! - ! !DESCRIPTION: - ! Zero out accumulation and history buffers for a given history tape. - ! Loop through fields on the tape. - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - character(len=*),parameter :: subname = 'hfields_zero' - !----------------------------------------------------------------------- - - do f = 1,tape(t)%nflds - tape(t)%hlist(f)%hbuf(:,:) = 0._r8 - tape(t)%hlist(f)%nacs(:,:) = 0 - end do - - end subroutine hfields_zero - - !----------------------------------------------------------------------- - subroutine htape_create (t, histrest) - ! - ! !DESCRIPTION: - ! Define contents of history file t. Issue the required netcdf - ! wrapper calls to define the history file contents. - ! - ! !USES: - use clm_varpar , only : nlevgrnd, nlevsno, nlevlak, nlevurb, numrad, nlevcan, nvegwcs,nlevsoi - use clm_varpar , only : natpft_size, cft_size, maxpatch_glcmec, nlevdecomp_full - use landunit_varcon , only : max_lunit - use clm_varctl , only : caseid, ctitle, fsurdat, finidat, paramfile - use clm_varctl , only : version, hostname, username, conventions, source - use domainMod , only : ldomain - use fileutils , only : get_filename - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - logical, intent(in), optional :: histrest ! if creating the history restart file - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - integer :: p,c,l,n ! indices - integer :: ier ! error code - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - integer :: dimid ! dimension id temporary - integer :: dim1id(1) ! netCDF dimension id - integer :: dim2id(2) ! netCDF dimension id - integer :: ndims ! dimension counter - integer :: omode ! returned mode from netCDF call - integer :: ncprec ! output netCDF write precision - integer :: ret ! netCDF error status - integer :: nump ! total number of pfts across all processors - integer :: numc ! total number of columns across all processors - integer :: numl ! total number of landunits across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numa ! total number of atm cells across all processors - logical :: avoid_pnetcdf ! whether we should avoid using pnetcdf - logical :: lhistrest ! local history restart flag - type(file_desc_t), pointer :: lnfid ! local file id - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len=256) :: name ! name of attribute - character(len=256) :: units ! units of attribute - character(len=256) :: str ! global attribute string - character(len=*),parameter :: subname = 'htape_create' - !----------------------------------------------------------------------- - - if ( present(histrest) )then - lhistrest = histrest - else - lhistrest = .false. - end if - - ! Determine necessary indices - - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump) - - ! define output write precsion for tape - - ncprec = tape(t)%ncprec - if (lhistrest) then - lnfid => ncid_hist(t) - else - lnfid => nfid(t) - endif - - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - ! - 1-d hist files have problems with pnetcdf. A better workaround in terms of - ! performance is to keep pnetcdf, but set PIO_BUFFER_SIZE_LIMIT=0, but that can't be - ! done on a per-file basis. - if (.not. tape(t)%dov2xy) then - avoid_pnetcdf = .true. - else - avoid_pnetcdf = .false. - end if - - ! Create new netCDF file. It will be in define mode - - if ( .not. lhistrest )then - if (masterproc) then - write(iulog,*) trim(subname),' : Opening netcdf htape ', & - trim(locfnh(t)) - call shr_sys_flush(iulog) - end if - call ncd_pio_createfile(lnfid, trim(locfnh(t)), avoid_pnetcdf=avoid_pnetcdf) - call ncd_putatt(lnfid, ncd_global, 'title', 'CLM History file information' ) - call ncd_putatt(lnfid, ncd_global, 'comment', & - "NOTE: None of the variables are weighted by land fraction!" ) - else - if (masterproc) then - write(iulog,*) trim(subname),' : Opening netcdf rhtape ', & - trim(locfnhr(t)) - call shr_sys_flush(iulog) - end if - call ncd_pio_createfile(lnfid, trim(locfnhr(t)), avoid_pnetcdf=avoid_pnetcdf) - call ncd_putatt(lnfid, ncd_global, 'title', & - 'CLM Restart History information, required to continue a simulation' ) - call ncd_putatt(lnfid, ncd_global, 'comment', & - "This entire file NOT needed for startup or branch simulations") - end if - - ! Create global attributes. Attributes are used to store information - ! about the data set. Global attributes are information about the - ! data set as a whole, as opposed to a single variable - - call ncd_putatt(lnfid, ncd_global, 'Conventions', trim(conventions)) - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(lnfid, ncd_global, 'history' , trim(str)) - call ncd_putatt(lnfid, ncd_global, 'source' , trim(source)) - call ncd_putatt(lnfid, ncd_global, 'hostname', trim(hostname)) - call ncd_putatt(lnfid, ncd_global, 'username', trim(username)) - call ncd_putatt(lnfid, ncd_global, 'version' , trim(version)) - - str = & - '$Id: histFileMod.F90 42903 2012-12-21 15:32:10Z muszala $' - call ncd_putatt(lnfid, ncd_global, 'revision_id', trim(str)) - call ncd_putatt(lnfid, ncd_global, 'case_title', trim(ctitle)) - call ncd_putatt(lnfid, ncd_global, 'case_id', trim(caseid)) - str = get_filename(fsurdat) - call ncd_putatt(lnfid, ncd_global, 'Surface_dataset', trim(str)) - if (finidat == ' ') then - str = 'arbitrary initialization' - else - str = get_filename(finidat) - endif - call ncd_putatt(lnfid, ncd_global, 'Initial_conditions_dataset', trim(str)) - str = get_filename(paramfile) - call ncd_putatt(lnfid, ncd_global, 'PFT_physiological_constants_dataset', trim(str)) - - ! Define dimensions. - ! Time is an unlimited dimension. Character string is treated as an array of characters. - - ! Global uncompressed dimensions (including non-land points) - if (ldomain%isgrid2d) then - call ncd_defdim(lnfid, 'lon' , ldomain%ni, dimid) - call ncd_defdim(lnfid, 'lat' , ldomain%nj, dimid) - else - call ncd_defdim(lnfid, trim(grlnd), ldomain%ns, dimid) - end if - - ! Global compressed dimensions (not including non-land points) - call ncd_defdim(lnfid, trim(nameg), numg, dimid) - call ncd_defdim(lnfid, trim(namel), numl, dimid) - call ncd_defdim(lnfid, trim(namec), numc, dimid) - call ncd_defdim(lnfid, trim(namep), nump, dimid) - - ! "level" dimensions - call ncd_defdim(lnfid, 'levgrnd', nlevgrnd, dimid) - call ncd_defdim(lnfid, 'levsoi', nlevsoi, dimid) - if (nlevurb > 0) then - call ncd_defdim(lnfid, 'levurb' , nlevurb, dimid) - end if - call ncd_defdim(lnfid, 'levlak' , nlevlak, dimid) - call ncd_defdim(lnfid, 'numrad' , numrad , dimid) - call ncd_defdim(lnfid, 'levsno' , nlevsno , dimid) - call ncd_defdim(lnfid, 'ltype', max_lunit, dimid) - call ncd_defdim(lnfid, 'nlevcan',nlevcan, dimid) - call ncd_defdim(lnfid, 'nvegwcs',nvegwcs, dimid) - call htape_add_ltype_metadata(lnfid) - call htape_add_ctype_metadata(lnfid) - call ncd_defdim(lnfid, 'natpft', natpft_size, dimid) - if (cft_size > 0) then - call ncd_defdim(lnfid, 'cft', cft_size, dimid) - call htape_add_cft_metadata(lnfid) - end if - call ncd_defdim(lnfid, 'glc_nec' , maxpatch_glcmec , dimid) - ! elevclas (in contrast to glc_nec) includes elevation class 0 (bare land) - ! (although on the history file it will go 1:(nec+1) rather than 0:nec) - call ncd_defdim(lnfid, 'elevclas' , maxpatch_glcmec + 1, dimid) - - do n = 1,num_subs - call ncd_defdim(lnfid, subs_name(n), subs_dim(n), dimid) - end do - call ncd_defdim(lnfid, 'string_length', hist_dim_name_length, strlen_dimid) - call ncd_defdim(lnfid, 'scale_type_string_length', scale_type_strlen, dimid) - call ncd_defdim( lnfid, 'levdcmp', nlevdecomp_full, dimid) - - if(use_fates)then - call ncd_defdim(lnfid, 'fates_levscag', nlevsclass * nlevage, dimid) - call ncd_defdim(lnfid, 'fates_levscls', nlevsclass, dimid) - call ncd_defdim(lnfid, 'fates_levpft', numpft_ed, dimid) - call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) - call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) - call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) - call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_ed, dimid) - call ncd_defdim(lnfid, 'fates_levcan', nclmax, dimid) - call ncd_defdim(lnfid, 'fates_levcnlf', nlevleaf * nclmax, dimid) - call ncd_defdim(lnfid, 'fates_levcnlfpf', nlevleaf * nclmax * numpft_ed, dimid) - end if - - if ( .not. lhistrest )then - call ncd_defdim(lnfid, 'hist_interval', 2, hist_interval_dimid) - call ncd_defdim(lnfid, 'time', ncd_unlimited, time_dimid) - if (masterproc)then - write(iulog,*) trim(subname), & - ' : Successfully defined netcdf history file ',t - call shr_sys_flush(iulog) - end if - else - if (masterproc)then - write(iulog,*) trim(subname), & - ' : Successfully defined netcdf restart history file ',t - call shr_sys_flush(iulog) - end if - end if - - end subroutine htape_create - - !----------------------------------------------------------------------- - subroutine htape_add_ltype_metadata(lnfid) - ! - ! !DESCRIPTION: - ! Add global metadata defining landunit types - ! - ! !USES: - use landunit_varcon, only : max_lunit, landunit_names, landunit_name_length - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: lnfid ! local file id - ! - ! !LOCAL VARIABLES: - integer :: ltype ! landunit type - character(len=*), parameter :: att_prefix = 'ltype_' ! prefix for attributes - character(len=len(att_prefix)+landunit_name_length) :: attname ! attribute name - - character(len=*), parameter :: subname = 'htape_add_ltype_metadata' - !----------------------------------------------------------------------- - - do ltype = 1, max_lunit - attname = att_prefix // landunit_names(ltype) - call ncd_putatt(lnfid, ncd_global, attname, ltype) - end do - - end subroutine htape_add_ltype_metadata - - !----------------------------------------------------------------------- - subroutine htape_add_ctype_metadata(lnfid) - ! - ! !DESCRIPTION: - ! Add global metadata defining column types - ! - ! !USES: - use column_varcon, only : write_coltype_metadata - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: lnfid ! local file id - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: att_prefix = 'ctype_' ! prefix for attributes - - character(len=*), parameter :: subname = 'htape_add_ctype_metadata' - !----------------------------------------------------------------------- - - call write_coltype_metadata(att_prefix, lnfid) - - end subroutine htape_add_ctype_metadata - - !----------------------------------------------------------------------- - subroutine htape_add_natpft_metadata(lnfid) - ! - ! !DESCRIPTION: - ! Add global metadata defining natpft types - ! - ! !USES: - use clm_varpar, only : natpft_lb, natpft_ub - use pftconMod , only : pftname_len, pftname - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: lnfid ! local file id - ! - ! !LOCAL VARIABLES: - integer :: ptype ! patch type - integer :: ptype_1_indexing ! patch type, translated to 1 indexing - character(len=*), parameter :: att_prefix = 'natpft_' ! prefix for attributes - character(len=len(att_prefix)+pftname_len) :: attname ! attribute name - - character(len=*), parameter :: subname = 'htape_add_natpft_metadata' - !----------------------------------------------------------------------- - - do ptype = natpft_lb, natpft_ub - ptype_1_indexing = ptype + (1 - natpft_lb) - attname = att_prefix // pftname(ptype) - call ncd_putatt(lnfid, ncd_global, attname, ptype_1_indexing) - end do - - end subroutine htape_add_natpft_metadata - - !----------------------------------------------------------------------- - subroutine htape_add_cft_metadata(lnfid) - ! - ! !DESCRIPTION: - ! Add global metadata defining natpft types - ! - ! !USES: - use clm_varpar, only : cft_lb, cft_ub - use pftconMod , only : pftname_len, pftname - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: lnfid ! local file id - ! - ! !LOCAL VARIABLES: - integer :: ptype ! patch type - integer :: ptype_1_indexing ! patch type, translated to 1 indexing - character(len=*), parameter :: att_prefix = 'cft_' ! prefix for attributes - character(len=len(att_prefix)+pftname_len) :: attname ! attribute name - - character(len=*), parameter :: subname = 'htape_add_cft_metadata' - !----------------------------------------------------------------------- - - do ptype = cft_lb, cft_ub - ptype_1_indexing = ptype + (1 - cft_lb) - attname = att_prefix // pftname(ptype) - call ncd_putatt(lnfid, ncd_global, attname, ptype_1_indexing) - end do - - end subroutine htape_add_cft_metadata - - !----------------------------------------------------------------------- - subroutine htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode) - ! - ! !DESCRIPTION: - ! Write time constant 3D variables to history tapes. - ! Only write out when this subroutine is called (normally only for - ! primary history files at very first time-step, nstep=0). - ! Issue the required netcdf wrapper calls to define the history file - ! contents. - ! - ! !USES: - use subgridAveMod , only : c2g - use clm_varpar , only : nlevgrnd ,nlevlak - use shr_string_mod , only : shr_string_listAppend - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - integer , intent(in) :: t ! tape index - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: watsat_col( bounds%begc:,1: ) - real(r8) , intent(in) :: sucsat_col( bounds%begc:,1: ) - real(r8) , intent(in) :: bsw_col( bounds%begc:,1: ) - real(r8) , intent(in) :: hksat_col( bounds%begc:,1: ) - character(len=*) , intent(in) :: mode ! 'define' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: c,l,lev,ifld ! indices - integer :: ier ! error status - character(len=max_chars) :: long_name ! variable long name - character(len=max_namlen):: varname ! variable name - character(len=max_namlen):: units ! variable units - character(len=scale_type_strlen) :: l2g_scale_type ! scale type for subgrid averaging of landunits to grid cells - ! - real(r8), pointer :: histi(:,:) ! temporary - real(r8), pointer :: histo(:,:) ! temporary - integer, parameter :: nflds = 6 ! Number of 3D time-constant fields - character(len=*),parameter :: subname = 'htape_timeconst3D' - character(len=*),parameter :: varnames(nflds) = (/ & - 'ZSOI ', & - 'DZSOI ', & - 'WATSAT', & - 'SUCSAT', & - 'BSW ', & - 'HKSAT ' & - /) - real(r8), pointer :: histil(:,:) ! temporary - real(r8), pointer :: histol(:,:) - integer, parameter :: nfldsl = 2 - character(len=*),parameter :: varnamesl(nfldsl) = (/ & - 'ZLAKE ', & - 'DZLAKE' & - /) - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(watsat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - !------------------------------------------------------------------------------- - !*** Non-time varying 3D fields *** - !*** Only write out when this subroutine is called *** - !*** Normally only called once for primary tapes *** - !------------------------------------------------------------------------------- - - if (mode == 'define') then - - do ifld = 1,nflds - ! Field indices MUST match varnames array order above! - if (ifld == 1) then - long_name='soil depth'; units = 'm' - else if (ifld == 2) then - long_name='soil thickness'; units = 'm' - else if (ifld == 3) then - long_name='saturated soil water content (porosity)'; units = 'mm3/mm3' - else if (ifld == 4) then - long_name='saturated soil matric potential'; units = 'mm' - else if (ifld == 5) then - long_name='slope of soil water retention curve'; units = 'unitless' - else if (ifld == 6) then - long_name='saturated hydraulic conductivity'; units = 'mm s-1' - else - call endrun(msg=' ERROR: bad 3D time-constant field index'//errMsg(sourcefile, __LINE__)) - end if - if (tape(t)%dov2xy) then - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec,& - dim1name='lon', dim2name='lat', dim3name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec, & - dim1name=grlnd, dim2name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec, & - dim1name=namec, dim2name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - call shr_string_listAppend(TimeConst3DVars,varnames(ifld)) - end do - - else if (mode == 'write') then - - allocate(histi(bounds%begc:bounds%endc,nlevgrnd), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histi' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Write time constant fields - - if (tape(t)%dov2xy) then - allocate(histo(bounds%begg:bounds%endg,nlevgrnd), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histo' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - do ifld = 1,nflds - - ! WJS (10-25-11): Note about l2g_scale_type in the following: ZSOI & DZSOI are - ! currently constant in space, except for urban points, so their scale type - ! doesn't matter at the moment as long as it excludes urban points. I am using - ! 'nonurb' so that the values are output everywhere where the fields are - ! constant (i.e., everywhere except urban points). For the other fields, I am - ! using 'veg' to be consistent with the l2g_scale_type that is now used for many - ! of the 3-d time-variant fields; in theory, though, one might want versions of - ! these variables output for different landunits. - - ! Field indices MUST match varnames array order above! - if (ifld == 1) then ! ZSOI - l2g_scale_type = 'nonurb' - else if (ifld == 2) then ! DZSOI - l2g_scale_type = 'nonurb' - else if (ifld == 3) then ! WATSAT - l2g_scale_type = 'veg' - else if (ifld == 4) then ! SUCSAT - l2g_scale_type = 'veg' - else if (ifld == 5) then ! BSW - l2g_scale_type = 'veg' - else if (ifld == 6) then ! HKSAT - l2g_scale_type = 'veg' - end if - - histi(:,:) = spval - do lev = 1,nlevgrnd - do c = bounds%begc,bounds%endc - l = col%landunit(c) - ! Field indices MUST match varnames array order above! - if (ifld ==1) histi(c,lev) = col%z(c,lev) - if (ifld ==2) histi(c,lev) = col%dz(c,lev) - if (ifld ==3) histi(c,lev) = watsat_col(c,lev) - if (ifld ==4) histi(c,lev) = sucsat_col(c,lev) - if (ifld ==5) histi(c,lev) = bsw_col(c,lev) - if (ifld ==6) histi(c,lev) = hksat_col(c,lev) - end do - end do - if (tape(t)%dov2xy) then - histo(:,:) = spval - - call c2g(bounds, nlevgrnd, & - histi(bounds%begc:bounds%endc, :), & - histo(bounds%begg:bounds%endg, :), & - c2l_scale_type='unity', l2g_scale_type=l2g_scale_type) - - if (ldomain%isgrid2d) then - call ncd_io(varname=trim(varnames(ifld)), dim1name=grlnd, & - data=histo, ncid=nfid(t), flag='write') - else - call ncd_io(varname=trim(varnames(ifld)), dim1name=grlnd, & - data=histo, ncid=nfid(t), flag='write') - end if - else - call ncd_io(varname=trim(varnames(ifld)), dim1name=namec, & - data=histi, ncid=nfid(t), flag='write') - end if - end do - - if (tape(t)%dov2xy) deallocate(histo) - deallocate(histi) - - end if ! (define/write mode - - if (mode == 'define') then - do ifld = 1,nfldsl - ! Field indices MUST match varnamesl array order above! - if (ifld == 1) then - long_name='lake layer node depth'; units = 'm' - else if (ifld == 2) then - long_name='lake layer thickness'; units = 'm' - else - call endrun(msg=' ERROR: bad 3D time-constant field index'//errMsg(sourcefile, __LINE__)) - end if - if (tape(t)%dov2xy) then - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=nfid(t), varname=trim(varnamesl(ifld)), xtype=tape(t)%ncprec,& - dim1name='lon', dim2name='lat', dim3name='levlak', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnamesl(ifld)), xtype=tape(t)%ncprec, & - dim1name=grlnd, dim2name='levlak', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnamesl(ifld)), xtype=tape(t)%ncprec, & - dim1name=namec, dim2name='levlak', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - call shr_string_listAppend(TimeConst3DVars,varnamesl(ifld)) - end do - - else if (mode == 'write') then - - allocate(histil(bounds%begc:bounds%endc,nlevlak), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histil' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Write time constant fields - - if (tape(t)%dov2xy) then - allocate(histol(bounds%begg:bounds%endg,nlevlak), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histol' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - do ifld = 1,nfldsl - histil(:,:) = spval - do lev = 1,nlevlak - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%lakpoi(l)) then - ! Field indices MUST match varnamesl array order above! - if (ifld ==1) histil(c,lev) = col%z_lake(c,lev) - if (ifld ==2) histil(c,lev) = col%dz_lake(c,lev) - end if - end do - end do - if (tape(t)%dov2xy) then - histol(:,:) = spval - call c2g(bounds, nlevlak, & - histil(bounds%begc:bounds%endc, :), & - histol(bounds%begg:bounds%endg, :), & - c2l_scale_type='unity', l2g_scale_type='lake') - if (ldomain%isgrid2d) then - call ncd_io(varname=trim(varnamesl(ifld)), dim1name=grlnd, & - data=histol, ncid=nfid(t), flag='write') - else - call ncd_io(varname=trim(varnamesl(ifld)), dim1name=grlnd, & - data=histol, ncid=nfid(t), flag='write') - end if - else - call ncd_io(varname=trim(varnamesl(ifld)), dim1name=namec, & - data=histil, ncid=nfid(t), flag='write') - end if - end do - - if (tape(t)%dov2xy) deallocate(histol) - deallocate(histil) - - end if ! (define/write mode - - end subroutine htape_timeconst3D - - !----------------------------------------------------------------------- - subroutine htape_timeconst(t, mode) - ! - ! !DESCRIPTION: - ! Write time constant values to primary history tape. - use clm_time_manager, only : get_step_size - ! Issue the required netcdf wrapper calls to define the history file - ! contents. - ! - ! !USES: - use clm_varcon , only : zsoi, zlak, secspday, isecspday, isecsphr, isecspmin - use domainMod , only : ldomain, lon1d, lat1d - use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time - use clm_time_manager, only : get_ref_date, get_calendar, NO_LEAP_C, GREGORIAN_C - use FatesInterfaceMod, only : fates_hdim_levsclass - use FatesInterfaceMod, only : fates_hdim_pfmap_levscpf - use FatesInterfaceMod, only : fates_hdim_scmap_levscpf - use FatesInterfaceMod, only : fates_hdim_levage - use FatesInterfaceMod, only : fates_hdim_levpft - use FatesInterfaceMod, only : fates_hdim_scmap_levscag - use FatesInterfaceMod, only : fates_hdim_agmap_levscag - use FatesInterfaceMod, only : fates_hdim_levfuel - use FatesInterfaceMod, only : fates_hdim_levcwdsc - use FatesInterfaceMod, only : fates_hdim_levcan - use FatesInterfaceMod, only : fates_hdim_canmap_levcnlf - use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlf - use FatesInterfaceMod, only : fates_hdim_canmap_levcnlfpf - use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlfpf - use FatesInterfaceMod, only : fates_hdim_pftmap_levcnlfpf - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - integer :: dtime ! timestep size - character(len=*), intent(in) :: mode ! 'define' or 'write' - ! - integer :: sec_hist_nhtfrq ! hist_nhtfrq converted to seconds - ! !LOCAL VARIABLES: - integer :: vid,n,i,j,m ! indices - integer :: nstep ! current step - integer :: mcsec ! seconds of current date - integer :: mdcur ! current day - integer :: mscur ! seconds of current day - integer :: mcdate ! current date - integer :: yr,mon,day,nbsec ! year,month,day,seconds components of a date - integer :: hours,minutes,secs ! hours,minutes,seconds of hh:mm:ss - character(len= 10) :: basedate ! base date (yyyymmdd) - character(len= 8) :: basesec ! base seconds - character(len= 8) :: cdate ! system date - character(len= 8) :: ctime ! system time - real(r8):: time ! current time - real(r8):: timedata(2) ! time interval boundaries - integer :: dim1id(1) ! netCDF dimension id - integer :: dim2id(2) ! netCDF dimension id - integer :: varid ! netCDF variable id - character(len=max_chars) :: long_name ! variable long name - character(len=max_namlen):: varname ! variable name - character(len=max_namlen):: units ! variable units - character(len=max_namlen):: cal ! calendar from the time-manager - character(len=max_namlen):: caldesc ! calendar description to put on file - character(len=256):: str ! global attribute string - real(r8), pointer :: histo(:,:) ! temporary - integer :: status - real(r8) :: zsoi_1d(1) - character(len=*),parameter :: subname = 'htape_timeconst' - !----------------------------------------------------------------------- - - !------------------------------------------------------------------------------- - !*** Time constant grid variables only on first time-sample of file *** - !------------------------------------------------------------------------------- - - if (tape(t)%ntimes == 1) then - if (mode == 'define') then - call ncd_defvar(varname='levgrnd', xtype=tape(t)%ncprec, & - dim1name='levgrnd', & - long_name='coordinate soil levels', units='m', ncid=nfid(t)) - call ncd_defvar(varname='levlak', xtype=tape(t)%ncprec, & - dim1name='levlak', & - long_name='coordinate lake levels', units='m', ncid=nfid(t)) - call ncd_defvar(varname='levdcmp', xtype=tape(t)%ncprec, dim1name='levdcmp', & - long_name='coordinate soil levels', units='m', ncid=nfid(t)) - - if(use_fates)then - - call ncd_defvar(varname='fates_levscls', xtype=tape(t)%ncprec, dim1name='fates_levscls', & - long_name='FATES diameter size class lower bound', units='cm', ncid=nfid(t)) - call ncd_defvar(varname='fates_scmap_levscag', xtype=ncd_int, dim1name='fates_levscag', & - long_name='FATES size-class map into size x patch age', units='-', ncid=nfid(t)) - call ncd_defvar(varname='fates_agmap_levscag', xtype=ncd_int, dim1name='fates_levscag', & - long_name='FATES age-class map into size x patch age', units='-', ncid=nfid(t)) - call ncd_defvar(varname='fates_pftmap_levscpf',xtype=ncd_int, dim1name='fates_levscpf', & - long_name='FATES pft index of the combined pft-size class dimension', units='-', ncid=nfid(t)) - call ncd_defvar(varname='fates_scmap_levscpf',xtype=ncd_int, dim1name='fates_levscpf', & - long_name='FATES size index of the combined pft-size class dimension', units='-', ncid=nfid(t)) - call ncd_defvar(varname='fates_levage',xtype=tape(t)%ncprec, dim1name='fates_levage', & - long_name='FATES patch age (yr)', ncid=nfid(t)) - call ncd_defvar(varname='fates_levpft',xtype=ncd_int, dim1name='fates_levpft', & - long_name='FATES pft number', ncid=nfid(t)) - call ncd_defvar(varname='fates_levfuel',xtype=ncd_int, dim1name='fates_levfuel', & - long_name='FATES fuel index', ncid=nfid(t)) - call ncd_defvar(varname='fates_levcwdsc',xtype=ncd_int, dim1name='fates_levcwdsc', & - long_name='FATES cwd size class', ncid=nfid(t)) - call ncd_defvar(varname='fates_levcan',xtype=ncd_int, dim1name='fates_levcan', & - long_name='FATES canopy level', ncid=nfid(t)) - call ncd_defvar(varname='fates_canmap_levcnlf',xtype=ncd_int, dim1name='fates_levcnlf', & - long_name='FATES canopy level of combined canopy-leaf dimension', ncid=nfid(t)) - call ncd_defvar(varname='fates_lfmap_levcnlf',xtype=ncd_int, dim1name='fates_levcnlf', & - long_name='FATES leaf level of combined canopy-leaf dimension', ncid=nfid(t)) - call ncd_defvar(varname='fates_canmap_levcnlfpf',xtype=ncd_int, dim1name='fates_levcnlfpf', & - long_name='FATES canopy level of combined canopy x leaf x pft dimension', ncid=nfid(t)) - call ncd_defvar(varname='fates_lfmap_levcnlfpf',xtype=ncd_int, dim1name='fates_levcnlfpf', & - long_name='FATES leaf level of combined canopy x leaf x pft dimension', ncid=nfid(t)) - call ncd_defvar(varname='fates_pftmap_levcnlfpf',xtype=ncd_int, dim1name='fates_levcnlfpf', & - long_name='FATES PFT level of combined canopy x leaf x pft dimension', ncid=nfid(t)) - end if - - - elseif (mode == 'write') then - if ( masterproc ) write(iulog, *) ' zsoi:',zsoi - call ncd_io(varname='levgrnd', data=zsoi, ncid=nfid(t), flag='write') - call ncd_io(varname='levlak' , data=zlak, ncid=nfid(t), flag='write') - if (use_vertsoilc) then - call ncd_io(varname='levdcmp', data=zsoi, ncid=nfid(t), flag='write') - else - zsoi_1d(1) = 1._r8 - call ncd_io(varname='levdcmp', data=zsoi_1d, ncid=nfid(t), flag='write') - end if - if(use_fates)then - call ncd_io(varname='fates_scmap_levscag',data=fates_hdim_scmap_levscag, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_agmap_levscag',data=fates_hdim_agmap_levscag, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levscls',data=fates_hdim_levsclass, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_pftmap_levscpf',data=fates_hdim_pfmap_levscpf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_scmap_levscpf',data=fates_hdim_scmap_levscpf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levage',data=fates_hdim_levage, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levpft',data=fates_hdim_levpft, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levfuel',data=fates_hdim_levfuel, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levcwdsc',data=fates_hdim_levcwdsc, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_levcan',data=fates_hdim_levcan, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_canmap_levcnlf',data=fates_hdim_canmap_levcnlf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_lfmap_levcnlf',data=fates_hdim_lfmap_levcnlf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_canmap_levcnlfpf',data=fates_hdim_canmap_levcnlfpf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_lfmap_levcnlfpf',data=fates_hdim_lfmap_levcnlfpf, ncid=nfid(t), flag='write') - call ncd_io(varname='fates_pftmap_levcnlfpf',data=fates_hdim_pftmap_levcnlfpf, ncid=nfid(t), flag='write') - end if - - endif - endif - - !------------------------------------------------------------------------------- - !*** Time definition variables *** - !------------------------------------------------------------------------------- - - ! For define mode -- only do this for first time-sample - if (mode == 'define' .and. tape(t)%ntimes == 1) then - call get_ref_date(yr, mon, day, nbsec) - nstep = get_nstep() - hours = nbsec / 3600 - minutes = (nbsec - hours*3600) / 60 - secs = (nbsec - hours*3600 - minutes*60) - write(basedate,80) yr,mon,day -80 format(i4.4,'-',i2.2,'-',i2.2) - write(basesec ,90) hours, minutes, secs -90 format(i2.2,':',i2.2,':',i2.2) - - dim1id(1) = time_dimid - str = 'days since ' // basedate // " " // basesec - call ncd_defvar(nfid(t), 'time', tape(t)%ncprec, 1, dim1id, varid, & - long_name='time',units=str) - cal = get_calendar() - if ( trim(cal) == NO_LEAP_C )then - caldesc = "noleap" - else if ( trim(cal) == GREGORIAN_C )then - caldesc = "gregorian" - end if - call ncd_putatt(nfid(t), varid, 'calendar', caldesc) - call ncd_putatt(nfid(t), varid, 'bounds', 'time_bounds') - - dim1id(1) = time_dimid - call ncd_defvar(nfid(t) , 'mcdate', ncd_int, 1, dim1id , varid, & - long_name = 'current date (YYYYMMDD)') - ! - ! add global attribute time_period_freq - ! - if (hist_nhtfrq(t) < 0) then !hour need to convert to seconds - sec_hist_nhtfrq = abs(hist_nhtfrq(t))*3600 - else - sec_hist_nhtfrq = hist_nhtfrq(t) - end if - - dtime = get_step_size() - if (sec_hist_nhtfrq == 0) then !month - time_period_freq = 'month_1' - else if (mod(sec_hist_nhtfrq*dtime,isecspday) == 0) then ! day - write(time_period_freq,999) 'day_',sec_hist_nhtfrq*dtime/isecspday - else if (mod(sec_hist_nhtfrq*dtime,isecsphr) == 0) then ! hour - write(time_period_freq,999) 'hour_',(sec_hist_nhtfrq*dtime)/isecsphr - else if (mod(sec_hist_nhtfrq*dtime,isecspmin) == 0) then ! minute - write(time_period_freq,999) 'minute_',(sec_hist_nhtfrq*dtime)/isecspmin - else ! second - write(time_period_freq,999) 'second_',sec_hist_nhtfrq*dtime - end if -999 format(a,i0) - - call ncd_putatt(nfid(t), ncd_global, 'time_period_freq', & - trim(time_period_freq)) - - call ncd_defvar(nfid(t) , 'mcsec' , ncd_int, 1, dim1id , varid, & - long_name = 'current seconds of current date', units='s') - call ncd_defvar(nfid(t) , 'mdcur' , ncd_int, 1, dim1id , varid, & - long_name = 'current day (from base day)') - call ncd_defvar(nfid(t) , 'mscur' , ncd_int, 1, dim1id , varid, & - long_name = 'current seconds of current day') - call ncd_defvar(nfid(t) , 'nstep' , ncd_int, 1, dim1id , varid, & - long_name = 'time step') - - dim2id(1) = hist_interval_dimid; dim2id(2) = time_dimid - call ncd_defvar(nfid(t), 'time_bounds', ncd_double, 2, dim2id, varid, & - long_name = 'history time interval endpoints') - - dim2id(1) = strlen_dimid; dim2id(2) = time_dimid - call ncd_defvar(nfid(t), 'date_written', ncd_char, 2, dim2id, varid) - call ncd_defvar(nfid(t), 'time_written', ncd_char, 2, dim2id, varid) - - if ( len_trim(TimeConst3DVars_Filename) > 0 )then - call ncd_putatt(nfid(t), ncd_global, 'Time_constant_3Dvars_filename', & - trim(TimeConst3DVars_Filename)) - end if - if ( len_trim(TimeConst3DVars) > 0 )then - call ncd_putatt(nfid(t), ncd_global, 'Time_constant_3Dvars', & - trim(TimeConst3DVars)) - end if - - elseif (mode == 'write') then - - call get_curr_time (mdcur, mscur) - call get_curr_date (yr, mon, day, mcsec) - mcdate = yr*10000 + mon*100 + day - nstep = get_nstep() - - call ncd_io('mcdate', mcdate, 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mcsec' , mcsec , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mdcur' , mdcur , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mscur' , mscur , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('nstep' , nstep , 'write', nfid(t), nt=tape(t)%ntimes) - - time = mdcur + mscur/secspday - call ncd_io('time' , time , 'write', nfid(t), nt=tape(t)%ntimes) - - timedata(1) = tape(t)%begtime - timedata(2) = time - call ncd_io('time_bounds', timedata, 'write', nfid(t), nt=tape(t)%ntimes) - - call getdatetime (cdate, ctime) - call ncd_io('date_written', cdate, 'write', nfid(t), nt=tape(t)%ntimes) - - call ncd_io('time_written', ctime, 'write', nfid(t), nt=tape(t)%ntimes) - - endif - - !------------------------------------------------------------------------------- - !*** Grid definition variables *** - !------------------------------------------------------------------------------- - ! For define mode -- only do this for first time-sample - if (mode == 'define' .and. tape(t)%ntimes == 1) then - - if (ldomain%isgrid2d) then - call ncd_defvar(varname='lon', xtype=tape(t)%ncprec, dim1name='lon', & - long_name='coordinate longitude', units='degrees_east', & - ncid=nfid(t), missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='lon', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='coordinate longitude', units='degrees_east', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='lat', xtype=tape(t)%ncprec, dim1name='lat', & - long_name='coordinate latitude', units='degrees_north', & - ncid=nfid(t), missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='lat', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='coordinate latitude', units='degrees_north', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='area', xtype=tape(t)%ncprec, & - dim1name='lon', dim2name='lat',& - long_name='grid cell areas', units='km^2', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='area', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='grid cell areas', units='km^2', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='landfrac', xtype=tape(t)%ncprec, & - dim1name='lon', dim2name='lat', & - long_name='land fraction', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='landfrac', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='land fraction', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='landmask', xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='land/ocean mask (0.=ocean and 1.=land)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - else - call ncd_defvar(varname='landmask', xtype=ncd_int, & - dim1name=grlnd, & - long_name='land/ocean mask (0.=ocean and 1.=land)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='pftmask' , xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='pft real/fake mask (0.=fake and 1.=real)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - else - call ncd_defvar(varname='pftmask' , xtype=ncd_int, & - dim1name=grlnd, & - long_name='pft real/fake mask (0.=fake and 1.=real)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='nbedrock' , xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='index of shallowest bedrock layer', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - else - call ncd_defvar(varname='nbedrock' , xtype=ncd_int, & - dim1name=grlnd, & - long_name='index of shallowest bedrock layer', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - end if - - else if (mode == 'write') then - - ! Most of this is constant and only needs to be done on tape(t)%ntimes=1 - ! But, some may change for dynamic PATCH mode for example - - if (ldomain%isgrid2d) then - call ncd_io(varname='lon', data=lon1d, ncid=nfid(t), flag='write') - call ncd_io(varname='lat', data=lat1d, ncid=nfid(t), flag='write') - else - call ncd_io(varname='lon', data=ldomain%lonc, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='lat', data=ldomain%latc, dim1name=grlnd, ncid=nfid(t), flag='write') - end if - call ncd_io(varname='area' , data=ldomain%area, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='landfrac', data=ldomain%frac, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='landmask', data=ldomain%mask, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='pftmask' , data=ldomain%pftm, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='nbedrock' , data=grc%nbedrock, dim1name=grlnd, ncid=nfid(t), flag='write') - - end if ! (define/write mode - - end subroutine htape_timeconst - - !----------------------------------------------------------------------- - subroutine hfields_write(t, mode) - ! - ! !DESCRIPTION: - ! Write history tape. Issue the call to write the variable. - ! - ! !USES: - use domainMod , only : ldomain - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - integer :: k ! 1d index - integer :: c,l,p ! indices - integer :: beg1d ! on-node 1d field pointer start index - integer :: end1d ! on-node 1d field pointer end index - integer :: beg1d_out ! on-node 1d hbuf pointer start index - integer :: end1d_out ! on-node 1d hbuf pointer end index - integer :: num1d_out ! size of hbuf first dimension (overall all nodes) - integer :: num2d ! hbuf second dimension size - integer :: nt ! time index - integer :: ier ! error status - character(len=avgflag_strlen) :: avgflag ! time averaging flag - character(len=max_chars) :: long_name! long name - character(len=max_chars) :: units ! units - character(len=max_namlen):: varname ! variable name - character(len=32) :: avgstr ! time averaging type - character(len=hist_dim_name_length) :: type1d ! field 1d type - character(len=hist_dim_name_length) :: type1d_out ! history output 1d type - character(len=hist_dim_name_length) :: type2d ! history output 2d type - character(len=32) :: dim1name ! temporary - character(len=32) :: dim2name ! temporary - real(r8), pointer :: histo(:,:) ! temporary - real(r8), pointer :: hist1do(:) ! temporary - character(len=*),parameter :: subname = 'hfields_write' -!----------------------------------------------------------------------- - - ! Write/define 1d topological info - - if (.not. tape(t)%dov2xy) then - if (mode == 'define') then - call hfields_1dinfo(t, mode='define') - else if (mode == 'write') then - call hfields_1dinfo(t, mode='write') - end if - end if - - ! Define time-dependent variables create variables and attributes for field list - - do f = 1,tape(t)%nflds - - ! Set history field variables - - varname = tape(t)%hlist(f)%field%name - long_name = tape(t)%hlist(f)%field%long_name - units = tape(t)%hlist(f)%field%units - avgflag = tape(t)%hlist(f)%avgflag - type1d = tape(t)%hlist(f)%field%type1d - type1d_out = tape(t)%hlist(f)%field%type1d_out - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - num1d_out = tape(t)%hlist(f)%field%num1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - nt = tape(t)%ntimes - - if (mode == 'define') then - - select case (avgflag) - case ('A') - avgstr = 'mean' - case ('I') - avgstr = 'instantaneous' - case ('X') - avgstr = 'maximum' - case ('M') - avgstr = 'minimum' - case ('SUM') - avgstr = 'sum' - case default - write(iulog,*) trim(subname),' ERROR: unknown time averaging flag (avgflag)=',avgflag - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - if (type1d_out == grlnd) then - if (ldomain%isgrid2d) then - dim1name = 'lon' ; dim2name = 'lat' - else - dim1name = trim(grlnd); dim2name = 'undefined' - end if - else - dim1name = type1d_out ; dim2name = 'undefined' - endif - - if (dim2name == 'undefined') then - if (num2d == 1) then - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=type2d, dim3name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - end if - else - if (num2d == 1) then - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=dim2name, dim3name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, dim4name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - end if - endif - - else if (mode == 'write') then - - ! Determine output buffer - - histo => tape(t)%hlist(f)%hbuf - - ! Allocate dynamic memory - - if (num2d == 1) then - allocate(hist1do(beg1d_out:end1d_out), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - hist1do(beg1d_out:end1d_out) = histo(beg1d_out:end1d_out,1) - end if - - ! Write history output. Always output land and ocean runoff on xy grid. - - if (num2d == 1) then - call ncd_io(flag='write', varname=varname, & - dim1name=type1d_out, data=hist1do, ncid=nfid(t), nt=nt) - else - call ncd_io(flag='write', varname=varname, & - dim1name=type1d_out, data=histo, ncid=nfid(t), nt=nt) - end if - - - ! Deallocate dynamic memory - - if (num2d == 1) then - deallocate(hist1do) - end if - - end if - - end do - - end subroutine hfields_write - - !----------------------------------------------------------------------- - subroutine hfields_1dinfo(t, mode) - ! - ! !DESCRIPTION: - ! Write/define 1d info for history tape. - ! - ! !USES: - use decompMod , only : ldecomp - use domainMod , only : ldomain, ldomain - ! - ! !ARGUMENTS: - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: f ! field index - integer :: k ! 1d index - integer :: g,c,l,p ! indices - integer :: ier ! errir status - real(r8), pointer :: rgarr(:) ! temporary - real(r8), pointer :: rcarr(:) ! temporary - real(r8), pointer :: rlarr(:) ! temporary - real(r8), pointer :: rparr(:) ! temporary - integer , pointer :: igarr(:) ! temporary - integer , pointer :: icarr(:) ! temporary - integer , pointer :: ilarr(:) ! temporary - integer , pointer :: iparr(:) ! temporary - type(file_desc_t), pointer :: ncid ! netcdf file - type(bounds_type) :: bounds - character(len=*),parameter :: subname = 'hfields_1dinfo' -!----------------------------------------------------------------------- - - call get_proc_bounds(bounds) - - ncid => nfid(t) - - if (mode == 'define') then - - ! Define gridcell info - - call ncd_defvar(varname='grid1d_lon', xtype=ncd_double, dim1name=nameg, & - long_name='gridcell longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='grid1d_lat', xtype=ncd_double, dim1name=nameg, & - long_name='gridcell latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='grid1d_ixy', xtype=ncd_int, dim1name=nameg, & - long_name='2d longitude index of corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='grid1d_jxy', xtype=ncd_int, dim1name=nameg, & - long_name='2d latitude index of corresponding gridcell', ncid=ncid) - - ! Define landunit info - - call ncd_defvar(varname='land1d_lon', xtype=ncd_double, dim1name=namel, & - long_name='landunit longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='land1d_lat', xtype=ncd_double, dim1name=namel, & - long_name='landunit latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='land1d_ixy', xtype=ncd_int, dim1name=namel, & - long_name='2d longitude index of corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='land1d_jxy', xtype=ncd_int, dim1name=namel, & - long_name='2d latitude index of corresponding landunit', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='land1d_gi', xtype=ncd_int, dim1name='landunit', & - ! long_name='1d grid index of corresponding landunit', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='land1d_wtgcell', xtype=ncd_double, dim1name=namel, & - long_name='landunit weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='land1d_ityplunit', xtype=ncd_int, dim1name=namel, & - long_name='landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - call ncd_defvar(varname='land1d_active', xtype=ncd_log, dim1name=namel, & - long_name='true => do computations on this landunit', ncid=ncid) - - ! Define column info - - call ncd_defvar(varname='cols1d_lon', xtype=ncd_double, dim1name=namec, & - long_name='column longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='cols1d_lat', xtype=ncd_double, dim1name=namec, & - long_name='column latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='cols1d_ixy', xtype=ncd_int, dim1name=namec, & - long_name='2d longitude index of corresponding column', ncid=ncid) - - call ncd_defvar(varname='cols1d_jxy', xtype=ncd_int, dim1name=namec, & - long_name='2d latitude index of corresponding column', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='cols1d_gi', xtype=ncd_int, dim1name='column', & - ! long_name='1d grid index of corresponding column', ncid=ncid) - - !call ncd_defvar(varname='cols1d_li', xtype=ncd_int, dim1name='column', & - ! long_name='1d landunit index of corresponding column', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='cols1d_wtgcell', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='cols1d_wtlunit', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='cols1d_itype_col', xtype=ncd_int, dim1name=namec, & - long_name='column type (see global attributes)', ncid=ncid) - - call ncd_defvar(varname='cols1d_itype_lunit', xtype=ncd_int, dim1name=namec, & - long_name='column landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - call ncd_defvar(varname='cols1d_active', xtype=ncd_log, dim1name=namec, & - long_name='true => do computations on this column', ncid=ncid) - - ! Define patch info - - call ncd_defvar(varname='pfts1d_lon', xtype=ncd_double, dim1name=namep, & - long_name='pft longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='pfts1d_lat', xtype=ncd_double, dim1name=namep, & - long_name='pft latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='pfts1d_ixy', xtype=ncd_int, dim1name=namep, & - long_name='2d longitude index of corresponding pft', ncid=ncid) - - call ncd_defvar(varname='pfts1d_jxy', xtype=ncd_int, dim1name=namep, & - long_name='2d latitude index of corresponding pft', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='pfts1d_gi', xtype=ncd_int, dim1name='pft', & - ! long_name='1d grid index of corresponding pft', ncid=ncid) - - !call ncd_defvar(varname='pfts1d_li', xtype=ncd_int, dim1name='pft', & - ! long_name='1d landunit index of corresponding pft', ncid=ncid) - - !call ncd_defvar(varname='pfts1d_ci', xtype=ncd_int, dim1name='pft', & - ! long_name='1d column index of corresponding pft', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='pfts1d_wtgcell', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtlunit', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtcol', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding column', ncid=ncid) - - call ncd_defvar(varname='pfts1d_itype_veg', xtype=ncd_int, dim1name=namep, & - long_name='pft vegetation type', ncid=ncid) - - call ncd_defvar(varname='pfts1d_itype_col', xtype=ncd_int, dim1name=namep, & - long_name='pft column type (see global attributes)', ncid=ncid) - - call ncd_defvar(varname='pfts1d_itype_lunit', xtype=ncd_int, dim1name=namep, & - long_name='pft landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - call ncd_defvar(varname='pfts1d_active', xtype=ncd_log, dim1name=namep, & - long_name='true => do computations on this pft', ncid=ncid) - - else if (mode == 'write') then - - ! Determine bounds - - allocate(& - rgarr(bounds%begg:bounds%endg),& - rlarr(bounds%begl:bounds%endl),& - rcarr(bounds%begc:bounds%endc),& - rparr(bounds%begp:bounds%endp),& - stat=ier) - if (ier /= 0) then - call endrun(msg=' hfields_1dinfo allocation error of rarrs'//errMsg(sourcefile, __LINE__)) - end if - - allocate(& - igarr(bounds%begg:bounds%endg),& - ilarr(bounds%begl:bounds%endl),& - icarr(bounds%begc:bounds%endc),& - iparr(bounds%begp:bounds%endp),stat=ier) - if (ier /= 0) then - call endrun(msg=' hfields_1dinfo allocation error of iarrs'//errMsg(sourcefile, __LINE__)) - end if - - ! Write gridcell info - - call ncd_io(varname='grid1d_lon', data=grc%londeg, dim1name=nameg, ncid=ncid, flag='write') - call ncd_io(varname='grid1d_lat', data=grc%latdeg, dim1name=nameg, ncid=ncid, flag='write') - do g = bounds%begg,bounds%endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='grid1d_ixy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') - do g = bounds%begg,bounds%endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 - enddo - call ncd_io(varname='grid1d_jxy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') - - ! Write landunit info - - do l = bounds%begl,bounds%endl - rlarr(l) = grc%londeg(lun%gridcell(l)) - enddo - call ncd_io(varname='land1d_lon', data=rlarr, dim1name=namel, ncid=ncid, flag='write') - do l = bounds%begl,bounds%endl - rlarr(l) = grc%latdeg(lun%gridcell(l)) - enddo - call ncd_io(varname='land1d_lat', data=rlarr, dim1name=namel, ncid=ncid, flag='write') - do l= bounds%begl,bounds%endl - ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='land1d_ixy', data=ilarr, dim1name=namel, ncid=ncid, flag='write') - do l = bounds%begl,bounds%endl - ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='land1d_jxy' , data=ilarr , dim1name=namel, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 Bug 1310 - !call ncd_io(varname='land1d_gi' , data=lun%gridcell, dim1name=namel, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='land1d_wtgcell' , data=lun%wtgcell , dim1name=namel, ncid=ncid, flag='write') - call ncd_io(varname='land1d_ityplunit', data=lun%itype , dim1name=namel, ncid=ncid, flag='write') - call ncd_io(varname='land1d_active' , data=lun%active , dim1name=namel, ncid=ncid, flag='write') - - ! Write column info - - do c = bounds%begc,bounds%endc - rcarr(c) = grc%londeg(col%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lon', data=rcarr, dim1name=namec, ncid=ncid, flag='write') - do c = bounds%begc,bounds%endc - rcarr(c) = grc%latdeg(col%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lat', data=rcarr, dim1name=namec, ncid=ncid, flag='write') - do c = bounds%begc,bounds%endc - icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='cols1d_ixy', data=icarr, dim1name=namec, ncid=ncid, flag='write') - do c = bounds%begc,bounds%endc - icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='cols1d_jxy' , data=icarr ,dim1name=namec, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 Bug 1310 - !call ncd_io(varname='cols1d_gi' , data=col%gridcell, dim1name=namec, ncid=ncid, flag='write') - !call ncd_io(varname='cols1d_li' , data=col%landunit, dim1name=namec, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='cols1d_wtgcell', data=col%wtgcell , dim1name=namec, ncid=ncid, flag='write') - call ncd_io(varname='cols1d_wtlunit', data=col%wtlunit , dim1name=namec, ncid=ncid, flag='write') - call ncd_io(varname='cols1d_itype_col', data=col%itype , dim1name=namec, ncid=ncid, flag='write') - - do c = bounds%begc,bounds%endc - icarr(c) = lun%itype(col%landunit(c)) - enddo - call ncd_io(varname='cols1d_itype_lunit', data=icarr , dim1name=namec, ncid=ncid, flag='write') - - call ncd_io(varname='cols1d_active' , data=col%active , dim1name=namec, ncid=ncid, flag='write') - - ! Write patch info - - do p = bounds%begp,bounds%endp - rparr(p) = grc%londeg(patch%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lon', data=rparr, dim1name=namep, ncid=ncid, flag='write') - do p = bounds%begp,bounds%endp - rparr(p) = grc%latdeg(patch%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lat', data=rparr, dim1name=namep, ncid=ncid, flag='write') - do p = bounds%begp,bounds%endp - iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='pfts1d_ixy', data=iparr, dim1name=namep, ncid=ncid, flag='write') - do p = bounds%begp,bounds%endp - iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='pfts1d_jxy' , data=iparr , dim1name=namep, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_io(varname='pfts1d_gi' , data=patch%gridcell, dim1name=namep, ncid=ncid, flag='write') - !call ncd_io(varname='pfts1d_li' , data=patch%landunit, dim1name=namep, ncid=ncid, flag='write') - !call ncd_io(varname='pfts1d_ci' , data=patch%column , dim1name=namep, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='pfts1d_wtgcell' , data=patch%wtgcell , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtlunit' , data=patch%wtlunit , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtcol' , data=patch%wtcol , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_itype_veg', data=patch%itype , dim1name=namep, ncid=ncid, flag='write') - - do p = bounds%begp,bounds%endp - iparr(p) = col%itype(patch%column(p)) - end do - call ncd_io(varname='pfts1d_itype_col', data=iparr , dim1name=namep, ncid=ncid, flag='write') - - do p = bounds%begp,bounds%endp - iparr(p) = lun%itype(patch%landunit(p)) - enddo - call ncd_io(varname='pfts1d_itype_lunit', data=iparr , dim1name=namep, ncid=ncid, flag='write') - - call ncd_io(varname='pfts1d_active' , data=patch%active , dim1name=namep, ncid=ncid, flag='write') - - deallocate(rgarr,rlarr,rcarr,rparr) - deallocate(igarr,ilarr,icarr,iparr) - - end if - - end subroutine hfields_1dinfo - - !----------------------------------------------------------------------- - subroutine hist_htapes_wrapup( rstwr, nlend, bounds, & - watsat_col, sucsat_col, bsw_col, hksat_col) - ! - ! !DESCRIPTION: - ! Write history tape(s) - ! Determine if next time step is beginning of history interval and if so: - ! increment the current time sample counter, open a new history file - ! and if needed (i.e., when ntim = 1), write history data to current - ! history file, reset field accumulation counters to zero. - ! If primary history file is full or at the last time step of the simulation, - ! write restart dataset and close all history fiels. - ! If history file is full or at the last time step of the simulation: - ! close history file - ! and reset time sample counter to zero if file is full. - ! Daily-averaged data for the first day in September are written on - ! date = 00/09/02 with mscur = 0. - ! Daily-averaged data for the first day in month mm are written on - ! date = yyyy/mm/02 with mscur = 0. - ! Daily-averaged data for the 30th day (last day in September) are written - ! on date = 0000/10/01 mscur = 0. - ! Daily-averaged data for the last day in month mm are written on - ! date = yyyy/mm+1/01 with mscur = 0. - ! - ! !USES: - use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time, get_prev_date - use clm_varcon , only : secspday - use perf_mod , only : t_startf, t_stopf - use clm_varpar , only : nlevgrnd - ! - ! !ARGUMENTS: - logical, intent(in) :: rstwr ! true => write restart file this step - logical, intent(in) :: nlend ! true => end of run on this step - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: watsat_col( bounds%begc:,1: ) - real(r8) , intent(in) :: sucsat_col( bounds%begc:,1: ) - real(r8) , intent(in) :: bsw_col( bounds%begc:,1: ) - real(r8) , intent(in) :: hksat_col( bounds%begc:,1: ) - ! - ! !LOCAL VARIABLES: - integer :: t ! tape index - integer :: f ! field index - integer :: ier ! error code - integer :: nstep ! current step - integer :: day ! current day (1 -> 31) - integer :: mon ! current month (1 -> 12) - integer :: yr ! current year (0 -> ...) - integer :: mdcur ! current day - integer :: mscur ! seconds of current day - integer :: mcsec ! current time of day [seconds] - integer :: daym1 ! nstep-1 day (1 -> 31) - integer :: monm1 ! nstep-1 month (1 -> 12) - integer :: yrm1 ! nstep-1 year (0 -> ...) - integer :: mcsecm1 ! nstep-1 time of day [seconds] - real(r8):: time ! current time - character(len=256) :: str ! global attribute string - logical :: if_stop ! true => last time step of run - logical, save :: do_3Dtconst = .true. ! true => write out 3D time-constant data - character(len=*),parameter :: subname = 'hist_htapes_wrapup' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(watsat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sucsat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(bsw_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(hksat_col) == (/bounds%endc, nlevgrnd/)), errMsg(sourcefile, __LINE__)) - - ! get current step - - nstep = get_nstep() - - ! Set calendar for current time step - - call get_curr_date (yr, mon, day, mcsec) - call get_curr_time (mdcur, mscur) - time = mdcur + mscur/secspday - - ! Set calendar for current for previous time step - - call get_prev_date (yrm1, monm1, daym1, mcsecm1) - - ! Loop over active history tapes, create new history files if necessary - ! and write data to history files if end of history interval. - do t = 1, ntapes - - ! Skip nstep=0 if monthly average - - if (nstep==0 .and. tape(t)%nhtfrq==0) cycle - - ! Determine if end of history interval - tape(t)%is_endhist = .false. - if (tape(t)%nhtfrq==0) then !monthly average - if (mon /= monm1) tape(t)%is_endhist = .true. - else - if (mod(nstep,tape(t)%nhtfrq) == 0) tape(t)%is_endhist = .true. - end if - - ! If end of history interval - - if (tape(t)%is_endhist) then - - ! Normalize history buffer if time averaged - - call hfields_normalize(t) - - ! Increment current time sample counter. - - tape(t)%ntimes = tape(t)%ntimes + 1 - - ! Create history file if appropriate and build time comment - - ! If first time sample, generate unique history file name, open file, - ! define dims, vars, etc. - - - if (tape(t)%ntimes == 1) then - call t_startf('hist_htapes_wrapup_define') - locfnh(t) = set_hist_filename (hist_freq=tape(t)%nhtfrq, & - hist_mfilt=tape(t)%mfilt, hist_file=t) - if (masterproc) then - write(iulog,*) trim(subname),' : Creating history file ', trim(locfnh(t)), & - ' at nstep = ',get_nstep() - write(iulog,*)'calling htape_create for file t = ',t - endif - call htape_create (t) - - ! Define time-constant field variables - call htape_timeconst(t, mode='define') - - ! Define 3D time-constant field variables only to first primary tape - if ( do_3Dtconst .and. t == 1 ) then - call htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode='define') - TimeConst3DVars_Filename = trim(locfnh(t)) - end if - - ! Define model field variables - call hfields_write(t, mode='define') - - ! Exit define model - call ncd_enddef(nfid(t)) - call t_stopf('hist_htapes_wrapup_define') - endif - - call t_startf('hist_htapes_wrapup_tconst') - ! Write time constant history variables - call htape_timeconst(t, mode='write') - - ! Write 3D time constant history variables only to first primary tape - if ( do_3Dtconst .and. t == 1 .and. tape(t)%ntimes == 1 )then - call htape_timeconst3D(t, & - bounds, watsat_col, sucsat_col, bsw_col, hksat_col, mode='write') - do_3Dtconst = .false. - end if - - if (masterproc) then - write(iulog,*) - write(iulog,*) trim(subname),' : Writing current time sample to local history file ', & - trim(locfnh(t)),' at nstep = ',get_nstep(), & - ' for history time interval beginning at ', tape(t)%begtime, & - ' and ending at ',time - write(iulog,*) - call shr_sys_flush(iulog) - endif - - ! Update beginning time of next interval - tape(t)%begtime = time - call t_stopf('hist_htapes_wrapup_tconst') - - ! Write history time samples - call t_startf('hist_htapes_wrapup_write') - call hfields_write(t, mode='write') - call t_stopf('hist_htapes_wrapup_write') - - ! Zero necessary history buffers - call hfields_zero(t) - - end if - - end do ! end loop over history tapes - - ! Determine if file needs to be closed - - call hist_do_disp (ntapes, tape(:)%ntimes, tape(:)%mfilt, if_stop, if_disphist, rstwr, nlend) - - ! Close open history file - ! Auxilary files may have been closed and saved off without being full, - ! must reopen the files - - do t = 1, ntapes - if (if_disphist(t)) then - if (tape(t)%ntimes /= 0) then - if (masterproc) then - write(iulog,*) - write(iulog,*) trim(subname),' : Closing local history file ',& - trim(locfnh(t)),' at nstep = ', get_nstep() - write(iulog,*) - endif - - call ncd_pio_closefile(nfid(t)) - - if (.not.if_stop .and. (tape(t)%ntimes/=tape(t)%mfilt)) then - call ncd_pio_openfile (nfid(t), trim(locfnh(t)), ncd_write) - end if - else - if (masterproc) then - write(iulog,*) trim(subname),' : history tape ',t,': no open file to close' - end if - endif - endif - end do - - ! Reset number of time samples to zero if file is full - - do t = 1, ntapes - if (if_disphist(t) .and. tape(t)%ntimes==tape(t)%mfilt) then - tape(t)%ntimes = 0 - end if - end do - - end subroutine hist_htapes_wrapup - - !----------------------------------------------------------------------- - subroutine hist_restart_ncd (bounds, ncid, flag, rdate) - ! - ! !DESCRIPTION: - ! Read/write history file restart data. - ! If the current history file(s) are not full, file(s) are opened - ! so that subsequent time samples are added until the file is full. - ! A new history file is used on a branch run. - ! - ! !USES: - use clm_varctl , only : nsrest, caseid, inst_suffix, nsrStartup, nsrBranch - use fileutils , only : getfil - use domainMod , only : ldomain - use clm_varpar , only : nlevgrnd, nlevlak, numrad, nlevdecomp_full - use clm_time_manager, only : is_restart - use restUtilMod , only : iflag_skip - use pio - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf file - character(len=*) , intent(in) :: flag !'read' or 'write' - character(len=*) , intent(in), optional :: rdate ! restart file time stamp for name - ! - ! !LOCAL VARIABLES: - integer :: max_nflds ! Max number of fields - integer :: num1d,beg1d,end1d ! 1d size, beginning and ending indices - integer :: num1d_out,beg1d_out,end1d_out ! 1d size, beginning and ending indices - integer :: num2d ! 2d size (e.g. number of vertical levels) - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - character(len=max_namlen) :: name ! variable name - character(len=max_namlen) :: name_acc ! accumulator variable name - character(len=max_namlen) :: long_name ! long name of variable - character(len=max_chars) :: long_name_acc ! long name for accumulator - character(len=max_chars) :: units ! units of variable - character(len=max_chars) :: units_acc ! accumulator units - character(len=max_chars) :: fname ! full name of history file - character(len=max_chars) :: locrest(max_tapes) ! local history restart file names - - character(len=max_namlen),allocatable :: tname(:) - character(len=max_chars), allocatable :: tunits(:),tlongname(:) - character(len=hist_dim_name_length), allocatable :: tmpstr(:,:) - character(len=scale_type_strlen), allocatable :: p2c_scale_type(:) - character(len=scale_type_strlen), allocatable :: c2l_scale_type(:) - character(len=scale_type_strlen), allocatable :: l2g_scale_type(:) - character(len=avgflag_strlen), allocatable :: tavgflag(:) - integer :: start(2) - - character(len=1) :: hnum ! history file index - character(len=hist_dim_name_length) :: type1d ! clm pointer 1d type - character(len=hist_dim_name_length) :: type1d_out ! history buffer 1d type - character(len=hist_dim_name_length) :: type2d ! history buffer 2d type - character(len=32) :: dim1name ! temporary - character(len=32) :: dim2name ! temporary - type(var_desc_t) :: name_desc ! variable descriptor for name - type(var_desc_t) :: longname_desc ! variable descriptor for long_name - type(var_desc_t) :: units_desc ! variable descriptor for units - type(var_desc_t) :: type1d_desc ! variable descriptor for type1d - type(var_desc_t) :: type1d_out_desc ! variable descriptor for type1d_out - type(var_desc_t) :: type2d_desc ! variable descriptor for type2d - type(var_desc_t) :: avgflag_desc ! variable descriptor for avgflag - type(var_desc_t) :: p2c_scale_type_desc ! variable descriptor for p2c_scale_type - type(var_desc_t) :: c2l_scale_type_desc ! variable descriptor for c2l_scale_type - type(var_desc_t) :: l2g_scale_type_desc ! variable descriptor for l2g_scale_type - integer :: status ! error status - integer :: dimid ! dimension ID - integer :: k ! 1d index - integer :: ntapes_onfile ! number of history tapes on the restart file - integer :: nflds_onfile ! number of history fields on the restart file - integer :: t ! tape index - integer :: f ! field index - integer :: varid ! variable id - integer, allocatable :: itemp(:) ! temporary - real(r8), pointer :: hbuf(:,:) ! history buffer - real(r8), pointer :: hbuf1d(:) ! 1d history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - integer , pointer :: nacs1d(:) ! 1d accumulation counter - integer :: ier ! error code - type(Var_desc_t) :: vardesc ! netCDF variable description - character(len=*),parameter :: subname = 'hist_restart_ncd' -!------------------------------------------------------------------------ - - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump) - - ! If branch run, initialize file times and return - - if (flag == 'read') then - if (nsrest == nsrBranch) then - do t = 1,ntapes - tape(t)%ntimes = 0 - end do - return - end if - ! If startup run just return - if (nsrest == nsrStartup) then - RETURN - end if - endif - - ! Read history file data only for restart run (not for branch run) - - ! - ! First when writing out and in define mode, create files and define all variables - ! - !================================================ - if (flag == 'define') then - !================================================ - - if (.not. present(rdate)) then - call endrun(msg=' variable rdate must be present for writing restart files'//& - errMsg(sourcefile, __LINE__)) - end if - - ! - ! On master restart file add ntapes/max_chars dimension - ! and then add the history and history restart filenames - ! - call ncd_defdim( ncid, 'ntapes' , ntapes , dimid) - call ncd_defdim( ncid, 'max_chars' , max_chars , dimid) - - call ncd_defvar(ncid=ncid, varname='locfnh', xtype=ncd_char, & - long_name="History filename", & - comment="This variable NOT needed for startup or branch simulations", & - dim1name='max_chars', dim2name="ntapes" ) - ier = PIO_inq_varid(ncid, 'locfnh', vardesc) - ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_skip) - - call ncd_defvar(ncid=ncid, varname='locfnhr', xtype=ncd_char, & - long_name="Restart history filename", & - comment="This variable NOT needed for startup or branch simulations", & - dim1name='max_chars', dim2name="ntapes" ) - ier = PIO_inq_varid(ncid, 'locfnhr', vardesc) - ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_skip) - - ! max_nflds is the maximum number of fields on any tape - ! max_flds is the maximum number possible number of fields - - max_nflds = max_nFields() - - ! Loop over tapes - write out namelist information to each restart-history tape - ! only read/write accumulators and counters if needed - - do t = 1,ntapes - - ! Create the restart history filename and open it - write(hnum,'(i1.1)') t-1 - locfnhr(t) = "./" // trim(caseid) //".clm2"// trim(inst_suffix) & - // ".rh" // hnum //"."// trim(rdate) //".nc" - - call htape_create( t, histrest=.true. ) - - ! Add read/write accumultators and counters if needed - if (.not. tape(t)%is_endhist) then - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - long_name = tape(t)%hlist(f)%field%long_name - units = tape(t)%hlist(f)%field%units - name_acc = trim(name) // "_acc" - units_acc = "unitless positive integer" - long_name_acc = trim(long_name) // " accumulator number of samples" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (type1d_out == grlnd) then - if (ldomain%isgrid2d) then - dim1name = 'lon' ; dim2name = 'lat' - else - dim1name = trim(grlnd); dim2name = 'undefined' - end if - else - dim1name = type1d_out ; dim2name = 'undefined' - endif - - if (dim2name == 'undefined') then - if (num2d == 1) then - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, & - long_name=trim(long_name_acc), units=trim(units_acc)) - else - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=type2d, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=type2d, & - long_name=trim(long_name_acc), units=trim(units_acc)) - end if - else - if (num2d == 1) then - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=dim2name, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=dim2name, & - long_name=trim(long_name_acc), units=trim(units_acc)) - else - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, & - long_name=trim(long_name_acc), units=trim(units_acc)) - end if - endif - end do - endif - - ! - ! Add namelist information to each restart history tape - ! - call ncd_defdim( ncid_hist(t), 'fname_lenp2' , max_namlen+2, dimid) - call ncd_defdim( ncid_hist(t), 'fname_len' , max_namlen , dimid) - call ncd_defdim( ncid_hist(t), 'avgflag_len' , avgflag_strlen, dimid) - call ncd_defdim( ncid_hist(t), 'scalar' , 1 , dimid) - call ncd_defdim( ncid_hist(t), 'max_chars' , max_chars , dimid) - call ncd_defdim( ncid_hist(t), 'max_nflds' , max_nflds , dimid) - call ncd_defdim( ncid_hist(t), 'max_flds' , max_flds , dimid) - - call ncd_defvar(ncid=ncid_hist(t), varname='nhtfrq', xtype=ncd_int, & - long_name="Frequency of history writes", & - comment="Namelist item", & - units="absolute value of negative is in hours, 0=monthly, positive is time-steps", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='mfilt', xtype=ncd_int, & - long_name="Number of history time samples on a file", units="unitless", & - comment="Namelist item", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='ncprec', xtype=ncd_int, & - long_name="Flag for data precision", flag_values=(/1,2/), & - comment="Namelist item", & - nvalid_range=(/1,2/), & - flag_meanings=(/"single-precision", "double-precision"/), & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='dov2xy', xtype=ncd_log, & - long_name="Output on 2D grid format (TRUE) or vector format (FALSE)", & - comment="Namelist item", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='fincl', xtype=ncd_char, & - comment="Namelist item", & - long_name="Fieldnames to include", & - dim1name='fname_lenp2', dim2name='max_flds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='fexcl', xtype=ncd_char, & - comment="Namelist item", & - long_name="Fieldnames to exclude", & - dim1name='fname_lenp2', dim2name='max_flds' ) - - call ncd_defvar(ncid=ncid_hist(t), varname='nflds', xtype=ncd_int, & - long_name="Number of fields on file", units="unitless", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='ntimes', xtype=ncd_int, & - long_name="Number of time steps on file", units="time-step", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='is_endhist', xtype=ncd_log, & - long_name="End of history file", dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='begtime', xtype=ncd_double, & - long_name="Beginning time", units="time units", & - dim1name='scalar') - - call ncd_defvar(ncid=ncid_hist(t), varname='num2d', xtype=ncd_int, & - long_name="Size of second dimension", units="unitless", & - dim1name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='hpindex', xtype=ncd_int, & - long_name="History pointer index", units="unitless", & - dim1name='max_nflds' ) - - call ncd_defvar(ncid=ncid_hist(t), varname='avgflag', xtype=ncd_char, & - long_name="Averaging flag", & - units="A=Average, X=Maximum, M=Minimum, I=Instantaneous, SUM=Sum", & - dim1name='avgflag_len', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='name', xtype=ncd_char, & - long_name="Fieldnames", & - dim1name='fname_len', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='long_name', xtype=ncd_char, & - long_name="Long descriptive names for fields", & - dim1name='max_chars', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='units', xtype=ncd_char, & - long_name="Units for each history field output", & - dim1name='max_chars', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type1d', xtype=ncd_char, & - long_name="1st dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type1d_out', xtype=ncd_char, & - long_name="1st output dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type2d', xtype=ncd_char, & - long_name="2nd dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='p2c_scale_type', xtype=ncd_char, & - long_name="PFT to column scale type", & - dim1name='scale_type_string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='c2l_scale_type', xtype=ncd_char, & - long_name="column to landunit scale type", & - dim1name='scale_type_string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='l2g_scale_type', xtype=ncd_char, & - long_name="landunit to gridpoint scale type", & - dim1name='scale_type_string_length', dim2name='max_nflds' ) - - call ncd_enddef(ncid_hist(t)) - - end do ! end of ntapes loop - - RETURN - - ! - ! First write out namelist information to each restart history file - ! - !================================================ - else if (flag == 'write') then - !================================================ - - ! Add history filenames to master restart file - do t = 1,ntapes - call ncd_io('locfnh', locfnh(t), 'write', ncid, nt=t) - call ncd_io('locfnhr', locfnhr(t), 'write', ncid, nt=t) - end do - - fincl(:,1) = hist_fincl1(:) - fincl(:,2) = hist_fincl2(:) - fincl(:,3) = hist_fincl3(:) - fincl(:,4) = hist_fincl4(:) - fincl(:,5) = hist_fincl5(:) - fincl(:,6) = hist_fincl6(:) - fincl(:,7) = hist_fincl7(:) - fincl(:,8) = hist_fincl8(:) - fincl(:,9) = hist_fincl9(:) - fincl(:,10) = hist_fincl10(:) - - fexcl(:,1) = hist_fexcl1(:) - fexcl(:,2) = hist_fexcl2(:) - fexcl(:,3) = hist_fexcl3(:) - fexcl(:,4) = hist_fexcl4(:) - fexcl(:,5) = hist_fexcl5(:) - fexcl(:,6) = hist_fexcl6(:) - fexcl(:,7) = hist_fexcl7(:) - fexcl(:,8) = hist_fexcl8(:) - fexcl(:,9) = hist_fexcl9(:) - fexcl(:,10) = hist_fexcl10(:) - - max_nflds = max_nFields() - - start(1)=1 - - - ! - ! Add history namelist data to each history restart tape - ! - allocate(itemp(max_nflds)) - - do t = 1,ntapes - call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='is_endhist', data=tape(t)%is_endhist, ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='dov2xy', data=tape(t)%dov2xy, ncid=ncid_hist(t), flag='write') - - itemp(:) = 0 - do f=1,tape(t)%nflds - itemp(f) = tape(t)%hlist(f)%field%num2d - end do - call ncd_io(varname='num2d', data=itemp(:), ncid=ncid_hist(t), flag='write') - - itemp(:) = 0 - do f=1,tape(t)%nflds - itemp(f) = tape(t)%hlist(f)%field%hpindex - end do - call ncd_io(varname='hpindex', data=itemp(:), ncid=ncid_hist(t), flag='write') - - call ncd_io('nflds', tape(t)%nflds, 'write', ncid_hist(t) ) - call ncd_io('ntimes', tape(t)%ntimes, 'write', ncid_hist(t) ) - call ncd_io('nhtfrq', tape(t)%nhtfrq, 'write', ncid_hist(t) ) - call ncd_io('mfilt', tape(t)%mfilt, 'write', ncid_hist(t) ) - call ncd_io('ncprec', tape(t)%ncprec, 'write', ncid_hist(t) ) - call ncd_io('begtime', tape(t)%begtime, 'write', ncid_hist(t) ) - allocate(tmpstr(tape(t)%nflds,3 ),tname(tape(t)%nflds), & - tavgflag(tape(t)%nflds),tunits(tape(t)%nflds),tlongname(tape(t)%nflds), & - p2c_scale_type(tape(t)%nflds), c2l_scale_type(tape(t)%nflds), & - l2g_scale_type(tape(t)%nflds)) - do f=1,tape(t)%nflds - tname(f) = tape(t)%hlist(f)%field%name - tunits(f) = tape(t)%hlist(f)%field%units - tlongname(f) = tape(t)%hlist(f)%field%long_name - tmpstr(f,1) = tape(t)%hlist(f)%field%type1d - tmpstr(f,2) = tape(t)%hlist(f)%field%type1d_out - tmpstr(f,3) = tape(t)%hlist(f)%field%type2d - tavgflag(f) = tape(t)%hlist(f)%avgflag - p2c_scale_type(f) = tape(t)%hlist(f)%field%p2c_scale_type - c2l_scale_type(f) = tape(t)%hlist(f)%field%c2l_scale_type - l2g_scale_type(f) = tape(t)%hlist(f)%field%l2g_scale_type - end do - call ncd_io( 'name', tname, 'write',ncid_hist(t)) - call ncd_io('long_name', tlongname, 'write', ncid_hist(t)) - call ncd_io('units', tunits, 'write',ncid_hist(t)) - call ncd_io('type1d', tmpstr(:,1), 'write', ncid_hist(t)) - call ncd_io('type1d_out', tmpstr(:,2), 'write', ncid_hist(t)) - call ncd_io('type2d', tmpstr(:,3), 'write', ncid_hist(t)) - call ncd_io('avgflag',tavgflag , 'write', ncid_hist(t)) - call ncd_io('p2c_scale_type', p2c_scale_type, 'write', ncid_hist(t)) - call ncd_io('c2l_scale_type', c2l_scale_type, 'write', ncid_hist(t)) - call ncd_io('l2g_scale_type', l2g_scale_type, 'write', ncid_hist(t)) - deallocate(tname,tlongname,tunits,tmpstr,tavgflag) - deallocate(p2c_scale_type, c2l_scale_type, l2g_scale_type) - enddo - deallocate(itemp) - - ! - ! Read in namelist information - ! - !================================================ - else if (flag == 'read') then - !================================================ - - call ncd_inqdlen(ncid,dimid,ntapes_onfile, name='ntapes') - if ( is_restart() .and. ntapes_onfile /= ntapes )then - write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile - call endrun(msg=' ERROR: number of ntapes different than on restart file!,'// & - ' you can NOT change history options on restart!' //& - errMsg(sourcefile, __LINE__)) - end if - if ( is_restart() .and. ntapes > 0 )then - call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid ) - call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid ) - do t = 1,ntapes - call strip_null(locrest(t)) - call strip_null(locfnh(t)) - end do - end if - - ! Determine necessary indices - the following is needed if model decomposition is different on restart - - start(1)=1 - - if ( is_restart() )then - do t = 1,ntapes - - call getfil( locrest(t), locfnhr(t), 0 ) - call ncd_pio_openfile (ncid_hist(t), trim(locfnhr(t)), ncd_nowrite) - - if ( t == 1 )then - - call ncd_inqdlen(ncid_hist(1),dimid,max_nflds,name='max_nflds') - - allocate(itemp(max_nflds)) - end if - - call ncd_inqvid(ncid_hist(t), 'name', varid, name_desc) - call ncd_inqvid(ncid_hist(t), 'long_name', varid, longname_desc) - call ncd_inqvid(ncid_hist(t), 'units', varid, units_desc) - call ncd_inqvid(ncid_hist(t), 'type1d', varid, type1d_desc) - call ncd_inqvid(ncid_hist(t), 'type1d_out', varid, type1d_out_desc) - call ncd_inqvid(ncid_hist(t), 'type2d', varid, type2d_desc) - call ncd_inqvid(ncid_hist(t), 'avgflag', varid, avgflag_desc) - call ncd_inqvid(ncid_hist(t), 'p2c_scale_type', varid, p2c_scale_type_desc) - call ncd_inqvid(ncid_hist(t), 'c2l_scale_type', varid, c2l_scale_type_desc) - call ncd_inqvid(ncid_hist(t), 'l2g_scale_type', varid, l2g_scale_type_desc) - - call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='read') - - call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='read') - - call ncd_io('nflds', nflds_onfile, 'read', ncid_hist(t) ) - if ( nflds_onfile /= tape(t)%nflds )then - write(iulog,*) 'nflds = ', tape(t)%nflds, ' nflds_onfile = ', nflds_onfile - call endrun(msg=' ERROR: number of fields different than on restart file!,'// & - ' you can NOT change history options on restart!' //& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io('ntimes', tape(t)%ntimes, 'read', ncid_hist(t) ) - call ncd_io('nhtfrq', tape(t)%nhtfrq, 'read', ncid_hist(t) ) - call ncd_io('mfilt', tape(t)%mfilt, 'read', ncid_hist(t) ) - call ncd_io('ncprec', tape(t)%ncprec, 'read', ncid_hist(t) ) - call ncd_io('begtime', tape(t)%begtime, 'read', ncid_hist(t) ) - - call ncd_io(varname='is_endhist', data=tape(t)%is_endhist, ncid=ncid_hist(t), flag='read') - call ncd_io(varname='dov2xy', data=tape(t)%dov2xy, ncid=ncid_hist(t), flag='read') - call ncd_io(varname='num2d', data=itemp(:), ncid=ncid_hist(t), flag='read') - do f=1,tape(t)%nflds - tape(t)%hlist(f)%field%num2d = itemp(f) - end do - - call ncd_io(varname='hpindex', data=itemp(:), ncid=ncid_hist(t), flag='read') - do f=1,tape(t)%nflds - tape(t)%hlist(f)%field%hpindex = itemp(f) - end do - - do f=1,tape(t)%nflds - start(2) = f - call ncd_io( name_desc, tape(t)%hlist(f)%field%name, & - 'read', ncid_hist(t), start ) - call ncd_io( longname_desc, tape(t)%hlist(f)%field%long_name, & - 'read', ncid_hist(t), start ) - call ncd_io( units_desc, tape(t)%hlist(f)%field%units, & - 'read', ncid_hist(t), start ) - call ncd_io( type1d_desc, tape(t)%hlist(f)%field%type1d, & - 'read', ncid_hist(t), start ) - call ncd_io( type1d_out_desc, tape(t)%hlist(f)%field%type1d_out, & - 'read', ncid_hist(t), start ) - call ncd_io( type2d_desc, tape(t)%hlist(f)%field%type2d, & - 'read', ncid_hist(t), start ) - call ncd_io( avgflag_desc, tape(t)%hlist(f)%avgflag, & - 'read', ncid_hist(t), start ) - call ncd_io( p2c_scale_type_desc, tape(t)%hlist(f)%field%p2c_scale_type, & - 'read', ncid_hist(t), start ) - call ncd_io( c2l_scale_type_desc, tape(t)%hlist(f)%field%c2l_scale_type, & - 'read', ncid_hist(t), start ) - call ncd_io( l2g_scale_type_desc, tape(t)%hlist(f)%field%l2g_scale_type, & - 'read', ncid_hist(t), start ) - call strip_null(tape(t)%hlist(f)%field%name) - call strip_null(tape(t)%hlist(f)%field%long_name) - call strip_null(tape(t)%hlist(f)%field%units) - call strip_null(tape(t)%hlist(f)%field%type1d) - call strip_null(tape(t)%hlist(f)%field%type1d_out) - call strip_null(tape(t)%hlist(f)%field%type2d) - call strip_null(tape(t)%hlist(f)%field%p2c_scale_type) - call strip_null(tape(t)%hlist(f)%field%c2l_scale_type) - call strip_null(tape(t)%hlist(f)%field%l2g_scale_type) - call strip_null(tape(t)%hlist(f)%avgflag) - - type1d_out = trim(tape(t)%hlist(f)%field%type1d_out) - select case (trim(type1d_out)) - case (grlnd) - num1d_out = numg - beg1d_out = bounds%begg - end1d_out = bounds%endg - case (nameg) - num1d_out = numg - beg1d_out = bounds%begg - end1d_out = bounds%endg - case (namel) - num1d_out = numl - beg1d_out = bounds%begl - end1d_out = bounds%endl - case (namec) - num1d_out = numc - beg1d_out = bounds%begc - end1d_out = bounds%endc - case (namep) - num1d_out = nump - beg1d_out = bounds%begp - end1d_out = bounds%endp - case default - write(iulog,*) trim(subname),' ERROR: read unknown 1d output type=',trim(type1d_out) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - tape(t)%hlist(f)%field%num1d_out = num1d_out - tape(t)%hlist(f)%field%beg1d_out = beg1d_out - tape(t)%hlist(f)%field%end1d_out = end1d_out - - num2d = tape(t)%hlist(f)%field%num2d - allocate (tape(t)%hlist(f)%hbuf(beg1d_out:end1d_out,num2d), & - tape(t)%hlist(f)%nacs(beg1d_out:end1d_out,num2d), & - stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for hbuf,nacs at t,f=',t,f - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - tape(t)%hlist(f)%hbuf(:,:) = 0._r8 - tape(t)%hlist(f)%nacs(:,:) = 0 - - type1d = tape(t)%hlist(f)%field%type1d - select case (type1d) - case (grlnd) - num1d = numg - beg1d = bounds%begg - end1d = bounds%endg - case (nameg) - num1d = numg - beg1d = bounds%begg - end1d = bounds%endg - case (namel) - num1d = numl - beg1d = bounds%begl - end1d = bounds%endl - case (namec) - num1d = numc - beg1d = bounds%begc - end1d = bounds%endc - case (namep) - num1d = nump - beg1d = bounds%begp - end1d = bounds%endp - case default - write(iulog,*) trim(subname),' ERROR: read unknown 1d type=',type1d - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - tape(t)%hlist(f)%field%num1d = num1d - tape(t)%hlist(f)%field%beg1d = beg1d - tape(t)%hlist(f)%field%end1d = end1d - - end do ! end of flds loop - - ! If history file is not full, open it - - if (tape(t)%ntimes /= 0) then - call ncd_pio_openfile (nfid(t), trim(locfnh(t)), ncd_write) - end if - - end do ! end of tapes loop - - hist_fincl1(:) = fincl(:,1) - hist_fincl2(:) = fincl(:,2) - hist_fincl3(:) = fincl(:,3) - hist_fincl4(:) = fincl(:,4) - hist_fincl5(:) = fincl(:,5) - hist_fincl6(:) = fincl(:,6) - hist_fincl7(:) = fincl(:,7) - hist_fincl8(:) = fincl(:,8) - hist_fincl9(:) = fincl(:,9) - hist_fincl10(:) = fincl(:,10) - - hist_fexcl1(:) = fexcl(:,1) - hist_fexcl2(:) = fexcl(:,2) - hist_fexcl3(:) = fexcl(:,3) - hist_fexcl4(:) = fexcl(:,4) - hist_fexcl5(:) = fexcl(:,5) - hist_fexcl6(:) = fexcl(:,6) - hist_fexcl7(:) = fexcl(:,7) - hist_fexcl8(:) = fexcl(:,8) - hist_fexcl9(:) = fexcl(:,9) - hist_fexcl10(:) = fexcl(:,10) - - end if - - if ( allocated(itemp) ) deallocate(itemp) - - end if - - !====================================================================== - ! Read/write history file restart data. - ! If the current history file(s) are not full, file(s) are opened - ! so that subsequent time samples are added until the file is full. - ! A new history file is used on a branch run. - !====================================================================== - - if (flag == 'write') then - - do t = 1,ntapes - if (.not. tape(t)%is_endhist) then - - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - name_acc = trim(name) // "_acc" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (num2d == 1) then - allocate(hbuf1d(beg1d_out:end1d_out), & - nacs1d(beg1d_out:end1d_out), stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - hbuf1d(beg1d_out:end1d_out) = hbuf(beg1d_out:end1d_out,1) - nacs1d(beg1d_out:end1d_out) = nacs(beg1d_out:end1d_out,1) - - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name), & - dim1name=type1d_out, data=hbuf1d) - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs1d) - - deallocate(hbuf1d) - deallocate(nacs1d) - else - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name), & - dim1name=type1d_out, data=hbuf) - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs) - end if - - end do - - end if ! end of is_endhist block - - call ncd_pio_closefile(ncid_hist(t)) - - end do ! end of ntapes loop - - else if (flag == 'read') then - - ! Read history restart information if history files are not full - - do t = 1,ntapes - - if (.not. tape(t)%is_endhist) then - - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - name_acc = trim(name) // "_acc" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (num2d == 1) then - allocate(hbuf1d(beg1d_out:end1d_out), & - nacs1d(beg1d_out:end1d_out), stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf1d) - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs1d) - - hbuf(beg1d_out:end1d_out,1) = hbuf1d(beg1d_out:end1d_out) - nacs(beg1d_out:end1d_out,1) = nacs1d(beg1d_out:end1d_out) - - deallocate(hbuf1d) - deallocate(nacs1d) - else - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf) - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs) - end if - end do - - end if - - call ncd_pio_closefile(ncid_hist(t)) - - end do - - end if - - end subroutine hist_restart_ncd - - !----------------------------------------------------------------------- - integer function max_nFields() - ! - ! !DESCRIPTION: - ! Get the maximum number of fields on all tapes. - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: t ! index - character(len=*),parameter :: subname = 'max_nFields' - !----------------------------------------------------------------------- - - max_nFields = 0 - do t = 1,ntapes - max_nFields = max(max_nFields, tape(t)%nflds) - end do - return - end function max_nFields - - !----------------------------------------------------------------------- - character(len=max_namlen) function getname (inname) - ! - ! !DESCRIPTION: - ! Retrieve name portion of inname. If an averaging flag separater character - ! is present (:) in inname, lop it off. - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: inname - ! - ! !LOCAL VARIABLES: - integer :: length - integer :: i - character(len=*),parameter :: subname = 'getname' - !----------------------------------------------------------------------- - - length = len (inname) - - if (length < max_namlen .or. length > max_namlen+2) then - write(iulog,*) trim(subname),' ERROR: bad length=',length - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - getname = ' ' - do i = 1,max_namlen - if (inname(i:i) == ':') exit - getname(i:i) = inname(i:i) - end do - - end function getname - - !----------------------------------------------------------------------- - character(len=1) function getflag (inname) - ! - ! !DESCRIPTION: - ! Retrieve flag portion of inname. If an averaging flag separater character - ! is present (:) in inname, return the character after it as the flag - ! - ! !ARGUMENTS: - character(len=*) inname ! character string - ! - ! !LOCAL VARIABLES: - integer :: length ! length of inname - integer :: i ! loop index - character(len=*),parameter :: subname = 'getflag' - !----------------------------------------------------------------------- - - length = len (inname) - - if (length < max_namlen .or. length > max_namlen+2) then - write(iulog,*) trim(subname),' ERROR: bad length=',length - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - getflag = ' ' - do i = 1,length - if (inname(i:i) == ':') then - getflag = inname(i+1:i+1) - exit - end if - end do - - end function getflag - - !----------------------------------------------------------------------- - subroutine list_index (list, name, index) - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: list(max_flds) ! input list of names, possibly ":" delimited - character(len=max_namlen), intent(in) :: name ! name to be searched for - integer, intent(out) :: index ! index of "name" in "list" - ! - ! !LOCAL VARIABLES: - !EOP - character(len=max_namlen) :: listname ! input name with ":" stripped off. - integer f ! field index - character(len=*),parameter :: subname = 'list_index' - !----------------------------------------------------------------------- - - ! Only list items - - index = 0 - do f=1,max_flds - listname = getname (list(f)) - if (listname == ' ') exit - if (listname == name) then - index = f - exit - end if - end do - - end subroutine list_index - - !----------------------------------------------------------------------- - character(len=max_length_filename) function set_hist_filename (hist_freq, hist_mfilt, hist_file) - ! - ! !DESCRIPTION: - ! Determine history dataset filenames. - ! - ! !USES: - use clm_varctl, only : caseid, inst_suffix - use clm_time_manager, only : get_curr_date, get_prev_date - ! - ! !ARGUMENTS: - integer, intent(in) :: hist_freq !history file frequency - integer, intent(in) :: hist_mfilt !history file number of time-samples - integer, intent(in) :: hist_file !history file index - ! - ! !LOCAL VARIABLES: - !EOP - character(len=max_chars) :: cdate !date char string - character(len= 1) :: hist_index !p,1 or 2 (currently) - integer :: day !day (1 -> 31) - integer :: mon !month (1 -> 12) - integer :: yr !year (0 -> ...) - integer :: sec !seconds into current day - integer :: filename_length - character(len=*),parameter :: subname = 'set_hist_filename' - !----------------------------------------------------------------------- - - if (hist_freq == 0 .and. hist_mfilt == 1) then !monthly - call get_prev_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2)') yr,mon - else !other - call get_curr_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec - endif - write(hist_index,'(i1.1)') hist_file - 1 - set_hist_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".h"//hist_index//"."//trim(cdate)//".nc" - - ! check to see if the concatenated filename exceeded the - ! length. Simplest way to do this is ensure that the file - ! extension is '.nc'. - filename_length = len_trim(set_hist_filename) - if (set_hist_filename(filename_length-2:filename_length) /= '.nc') then - write(iulog, '(a,a,a,a,a)') 'ERROR: ', subname, & - ' : expected file extension ".nc", received extension "', & - set_hist_filename(filename_length-2:filename_length), '"' - write(iulog, '(a,a,a,a,a)') 'ERROR: ', subname, & - ' : filename : "', set_hist_filename, '"' - write(iulog, '(a,a,a,i3,a,i3)') 'ERROR: ', subname, & - ' Did the constructed filename exceed the maximum length? : filename length = ', & - filename_length, ', max length = ', max_length_filename - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end function set_hist_filename - - !----------------------------------------------------------------------- - subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_patch, ptr_lnd, & - ptr_atm, p2c_scale_type, c2l_scale_type, & - l2g_scale_type, set_lake, set_nolake, set_urb, set_nourb, & - set_noglcmec, set_spec, default) - ! - ! !DESCRIPTION: - ! Initialize a single level history field. The pointer, ptrhist, - ! is a pointer to the data type array that the history buffer will use. - ! The value of type1d passed to masterlist\_add\_fld determines which of the - ! 1d type of the output and the beginning and ending indices the history - ! buffer field). Default history contents for given field on all tapes - ! are set by calling [masterlist\_make\_active] for the appropriate tape. - ! After the masterlist is built, routine [htapes\_build] is called for an - ! initial or branch run to initialize the actual history tapes. - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: units ! units of field - character(len=*), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from data type) - real(r8) , optional, pointer :: ptr_gcell(:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:) ! pointer to patch array - real(r8) , optional, pointer :: ptr_lnd(:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_atm(:) ! pointer to atm array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_nolake ! value to set non-lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_noglcmec ! value to set non-glacier_mec to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g ! indices - integer :: hpindex ! history buffer pointer index - character(len=hist_dim_name_length) :: l_type1d ! 1d data type - character(len=hist_dim_name_length) :: l_type1d_out ! 1d output type - character(len=scale_type_strlen) :: scale_type_p2c ! scale type for subgrid averaging of pfts to column - character(len=scale_type_strlen) :: scale_type_c2l ! scale type for subgrid averaging of columns to landunits - character(len=scale_type_strlen) :: scale_type_l2g ! scale type for subgrid averaging of landunits to gridcells - type(bounds_type):: bounds ! boudns - character(len=16):: l_default ! local version of 'default' - character(len=*),parameter :: subname = 'hist_addfld1d' -!------------------------------------------------------------------------ - - ! Determine processor bounds - - call get_proc_bounds(bounds) - - ! History buffer pointer - - hpindex = pointer_index() - - if (present(ptr_lnd)) then - l_type1d = grlnd - l_type1d_out = grlnd - clmptr_rs(hpindex)%ptr => ptr_lnd - - else if (present(ptr_gcell)) then - l_type1d = nameg - l_type1d_out = nameg - clmptr_rs(hpindex)%ptr => ptr_gcell - - else if (present(ptr_lunit)) then - l_type1d = namel - l_type1d_out = namel - clmptr_rs(hpindex)%ptr => ptr_lunit - if (present(set_lake)) then - do l = bounds%begl,bounds%endl - if (lun%lakpoi(l)) ptr_lunit(l) = set_lake - end do - end if - if (present(set_nolake)) then - do l = bounds%begl,bounds%endl - if (.not.(lun%lakpoi(l))) ptr_lunit(l) = set_nolake - end do - end if - if (present(set_urb)) then - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) ptr_lunit(l) = set_urb - end do - end if - if (present(set_nourb)) then - do l = bounds%begl,bounds%endl - if (.not.(lun%urbpoi(l))) ptr_lunit(l) = set_nourb - end do - end if - if (present(set_spec)) then - do l = bounds%begl,bounds%endl - if (lun%ifspecial(l)) ptr_lunit(l) = set_spec - end do - end if - - else if (present(ptr_col)) then - l_type1d = namec - l_type1d_out = namec - clmptr_rs(hpindex)%ptr => ptr_col - if (present(set_lake)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%lakpoi(l)) ptr_col(c) = set_lake - end do - end if - if (present(set_nolake)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (.not.(lun%lakpoi(l))) ptr_col(c) = set_nolake - end do - end if - if (present(set_urb)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%urbpoi(l)) ptr_col(c) = set_urb - end do - end if - if (present(set_nourb)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (.not.(lun%urbpoi(l))) ptr_col(c) = set_nourb - end do - end if - if (present(set_spec)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%ifspecial(l)) ptr_col(c) = set_spec - end do - end if - if (present(set_noglcmec)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (.not.(lun%glcmecpoi(l))) ptr_col(c) = set_noglcmec - end do - endif - - else if (present(ptr_patch)) then - l_type1d = namep - l_type1d_out = namep - clmptr_rs(hpindex)%ptr => ptr_patch - if (present(set_lake)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%lakpoi(l)) ptr_patch(p) = set_lake - end do - end if - if (present(set_nolake)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (.not.(lun%lakpoi(l))) ptr_patch(p) = set_nolake - end do - end if - if (present(set_urb)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%urbpoi(l)) ptr_patch(p) = set_urb - end do - end if - if (present(set_nourb)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (.not.(lun%urbpoi(l))) ptr_patch(p) = set_nourb - end do - end if - if (present(set_spec)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%ifspecial(l)) ptr_patch(p) = set_spec - end do - end if - if (present(set_noglcmec)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (.not.(lun%glcmecpoi(l))) ptr_patch(p) = set_noglcmec - end do - end if - else - write(iulog,*) trim(subname),' ERROR: must specify a valid pointer index,', & - ' choices are [ptr_atm, ptr_lnd, ptr_gcell, ptr_lunit, ptr_col, ptr_patch] ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end if - - ! Set scaling factor - - scale_type_p2c = 'unity' - scale_type_c2l = 'unity' - scale_type_l2g = 'unity' - - if (present(p2c_scale_type)) scale_type_p2c = p2c_scale_type - if (present(c2l_scale_type)) scale_type_c2l = c2l_scale_type - if (present(l2g_scale_type)) scale_type_l2g = l2g_scale_type - if (present(type1d_out)) l_type1d_out = type1d_out - - ! Add field to masterlist - - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d='unset', num2d=1, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g) - - l_default = 'active' - if (present(default)) then - l_default = default - end if - if (trim(l_default) == 'inactive') then - return - else - call masterlist_make_active (name=trim(fname), tape_index=1) - end if - - end subroutine hist_addfld1d - - !----------------------------------------------------------------------- - subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_patch, ptr_lnd, ptr_atm, & - p2c_scale_type, c2l_scale_type, l2g_scale_type, & - set_lake, set_nolake, set_urb, set_nourb, set_spec, & - no_snow_behavior, default) - ! - ! !DESCRIPTION: - ! Initialize a single level history field. The pointer, ptrhist, - ! is a pointer to the data type array that the history buffer will use. - ! The value of type1d passed to masterlist\_add\_fld determines which of the - ! 1d type of the output and the beginning and ending indices the history - ! buffer field). Default history contents for given field on all tapes - ! are set by calling [masterlist\_make\_active] for the appropriatae tape. - ! After the masterlist is built, routine [htapes\_build] is called for an - ! initial or branch run to initialize the actual history tapes. - ! - ! !USES: - use clm_varpar , only : nlevgrnd, nlevsno, nlevlak, numrad, nlevdecomp_full, nlevcan, nvegwcs,nlevsoi - use clm_varpar , only : natpft_size, cft_size, maxpatch_glcmec - use landunit_varcon , only : max_lunit - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type2d ! 2d output type - character(len=*), intent(in) :: units ! units of field - character(len=*), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from data type) - real(r8) , optional, pointer :: ptr_atm(:,:) ! pointer to atm array - real(r8) , optional, pointer :: ptr_lnd(:,:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_gcell(:,:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:,:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:,:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:,:) ! pointer to patch array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_nolake ! value to set non-lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - integer , optional, intent(in) :: no_snow_behavior ! if a multi-layer snow field, behavior to use for absent snow layers (should be one of the public no_snow_* parameters defined above) - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g ! indices - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - integer :: hpindex ! history buffer index - character(len=hist_dim_name_length) :: l_type1d ! 1d data type - character(len=hist_dim_name_length) :: l_type1d_out ! 1d output type - character(len=scale_type_strlen) :: scale_type_p2c ! scale type for subgrid averaging of pfts to column - character(len=scale_type_strlen) :: scale_type_c2l ! scale type for subgrid averaging of columns to landunits - character(len=scale_type_strlen) :: scale_type_l2g ! scale type for subgrid averaging of landunits to gridcells - type(bounds_type):: bounds - character(len=16):: l_default ! local version of 'default' - character(len=*),parameter :: subname = 'hist_addfld2d' -!------------------------------------------------------------------------ - - call get_proc_bounds(bounds) - - ! Error-check no_snow_behavior optional argument: It should be present if and only if - ! type2d is 'levsno', and its value should be one of the public no_snow_* parameters - ! defined above. - if (present(no_snow_behavior)) then - if (type2d /= 'levsno') then - write(iulog,*) trim(subname), & - ' ERROR: Only specify no_snow_behavior for fields with dimension levsno' - call endrun() - end if - - if (no_snow_behavior < no_snow_MIN .or. no_snow_behavior > no_snow_MAX) then - write(iulog,*) trim(subname), & - ' ERROR: Invalid value for no_snow_behavior: ', no_snow_behavior - call endrun() - end if - - else ! no_snow_behavior is absent - if (type2d == 'levsno') then - write(iulog,*) trim(subname), & - ' ERROR: must specify no_snow_behavior for fields with dimension levsno' - call endrun() - end if - end if - - ! Determine second dimension size - - select case (type2d) - case ('levgrnd') - num2d = nlevgrnd - case ('levsoi') - num2d = nlevsoi - case ('levlak') - num2d = nlevlak - case ('numrad') - num2d = numrad - case ('levdcmp') - num2d = nlevdecomp_full - case ('fates_levscls') - num2d = nlevsclass - case ('fates_levpft') - num2d = numpft_ed - case ('fates_levage') - num2d = nlevage - case ('fates_levfuel') - num2d = nfsc - case ('fates_levcwdsc') - num2d = ncwd - case ('fates_levscpf') - num2d = nlevsclass*numpft_ed - case ('fates_levscag') - num2d = nlevsclass*nlevage - case ('fates_levcan') - num2d = nclmax - case ('fates_levcnlf') - num2d = nlevleaf * nclmax - case ('fates_levcnlfpf') - num2d = nlevleaf * nclmax * numpft_ed - case ('ltype') - num2d = max_lunit - case ('natpft') - num2d = natpft_size - case('cft') - if (cft_size > 0) then - num2d = cft_size - else - write(iulog,*) trim(subname),' ERROR: 2d type =', trim(type2d), & - ' only valid for cft_size > 0' - call endrun() - end if - case ('glc_nec') - num2d = maxpatch_glcmec - case ('elevclas') - ! add one because indexing starts at 0 (elevclas, unlike glc_nec, includes the - ! bare ground "elevation class") - num2d = maxpatch_glcmec + 1 - case ('levsno') - num2d = nlevsno - case ('nlevcan') - num2d = nlevcan - case ('nvegwcs') - num2d = nvegwcs - case default - write(iulog,*) trim(subname),' ERROR: unsupported 2d type ',type2d, & - ' currently supported types for multi level fields are: ', & - '[levgrnd,levsoi,levlak,numrad,levdcmp,levtrc,ltype,natpft,cft,glc_nec,elevclas,levsno,nvegwcs]' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - ! History buffer pointer - - hpindex = pointer_index() - - if (present(ptr_lnd)) then - l_type1d = grlnd - l_type1d_out = grlnd - clmptr_ra(hpindex)%ptr => ptr_lnd - - else if (present(ptr_gcell)) then - l_type1d = nameg - l_type1d_out = nameg - clmptr_ra(hpindex)%ptr => ptr_gcell - - else if (present(ptr_lunit)) then - l_type1d = namel - l_type1d_out = namel - clmptr_ra(hpindex)%ptr => ptr_lunit - if (present(set_lake)) then - do l = bounds%begl,bounds%endl - if (lun%lakpoi(l)) ptr_lunit(l,:) = set_lake - end do - end if - if (present(set_nolake)) then - do l = bounds%begl,bounds%endl - if (.not.(lun%lakpoi(l))) ptr_lunit(l,:) = set_nolake - end do - end if - if (present(set_urb)) then - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) ptr_lunit(l,:) = set_urb - end do - end if - if (present(set_nourb)) then - do l = bounds%begl,bounds%endl - if (.not.(lun%urbpoi(l))) ptr_lunit(l,:) = set_nourb - end do - end if - if (present(set_spec)) then - do l = bounds%begl,bounds%endl - if (lun%ifspecial(l)) ptr_lunit(l,:) = set_spec - end do - end if - - else if (present(ptr_col)) then - l_type1d = namec - l_type1d_out = namec - clmptr_ra(hpindex)%ptr => ptr_col - if (present(set_lake)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%lakpoi(l)) ptr_col(c,:) = set_lake - end do - end if - if (present(set_nolake)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (.not.(lun%lakpoi(l))) ptr_col(c,:) = set_nolake - end do - end if - if (present(set_urb)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%urbpoi(l)) ptr_col(c,:) = set_urb - end do - end if - if (present(set_nourb)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (.not.(lun%urbpoi(l))) ptr_col(c,:) = set_nourb - end do - end if - if (present(set_spec)) then - do c = bounds%begc,bounds%endc - l =col%landunit(c) - if (lun%ifspecial(l)) ptr_col(c,:) = set_spec - end do - end if - - else if (present(ptr_patch)) then - l_type1d = namep - l_type1d_out = namep - clmptr_ra(hpindex)%ptr => ptr_patch - if (present(set_lake)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%lakpoi(l)) ptr_patch(p,:) = set_lake - end do - end if - if (present(set_nolake)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (.not.(lun%lakpoi(l))) ptr_patch(p,:) = set_nolake - end do - end if - if (present(set_urb)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%urbpoi(l)) ptr_patch(p,:) = set_urb - end do - end if - if (present(set_nourb)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (.not.(lun%urbpoi(l))) ptr_patch(p,:) = set_nourb - end do - end if - if (present(set_spec)) then - do p = bounds%begp,bounds%endp - l =patch%landunit(p) - if (lun%ifspecial(l)) ptr_patch(p,:) = set_spec - end do - end if - - else - write(iulog,*) trim(subname),' ERROR: must specify a valid pointer index,', & - ' choices are ptr_atm, ptr_lnd, ptr_gcell, ptr_lunit, ptr_col, ptr_patch' - call endrun(msg=errMsg(sourcefile, __LINE__)) - - end if - - ! Set scaling factor - - scale_type_p2c = 'unity' - scale_type_c2l = 'unity' - scale_type_l2g = 'unity' - - if (present(p2c_scale_type)) scale_type_p2c = p2c_scale_type - if (present(c2l_scale_type)) scale_type_c2l = c2l_scale_type - if (present(l2g_scale_type)) scale_type_l2g = l2g_scale_type - if (present(type1d_out)) l_type1d_out = type1d_out - - ! Add field to masterlist - - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d=type2d, num2d=num2d, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g, & - no_snow_behavior=no_snow_behavior) - - l_default = 'active' - if (present(default)) then - l_default = default - end if - if (trim(l_default) == 'inactive') then - return - else - call masterlist_make_active (name=trim(fname), tape_index=1) - end if - - end subroutine hist_addfld2d - - !----------------------------------------------------------------------- - subroutine hist_addfld_decomp (fname, type2d, units, avgflag, long_name, ptr_col, & - ptr_patch, l2g_scale_type, default) - - ! - ! !USES: - use clm_varpar , only : nlevdecomp_full - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type2d ! 2d output type - character(len=*), intent(in) :: units ! units of field - character(len=*), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - real(r8) , optional, pointer :: ptr_col(:,:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:,:) ! pointer to patch array - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: ptr_1d(:) - !----------------------------------------------------------------------- - - if (present(ptr_col)) then - - ! column-level data - if (present(default)) then - if ( nlevdecomp_full > 1 ) then - call hist_addfld2d (fname=trim(fname), units=units, type2d=type2d, & - avgflag=avgflag, long_name=long_name, & - ptr_col=ptr_col, l2g_scale_type=l2g_scale_type, default=default) - else - ptr_1d => ptr_col(:,1) - call hist_addfld1d (fname=trim(fname), units=units, & - avgflag=avgflag, long_name=long_name, & - ptr_col=ptr_1d, l2g_scale_type=l2g_scale_type, default=default) - endif - else - if ( nlevdecomp_full > 1 ) then - call hist_addfld2d (fname=trim(fname), units=units, type2d=type2d, & - avgflag=avgflag, long_name=long_name, & - ptr_col=ptr_col, l2g_scale_type=l2g_scale_type) - else - ptr_1d => ptr_col(:,1) - call hist_addfld1d (fname=trim(fname), units=units, & - avgflag=avgflag, long_name=long_name, & - ptr_col=ptr_1d, l2g_scale_type=l2g_scale_type) - endif - endif - - else if (present(ptr_patch)) then - - ! patch-level data - if (present(default)) then - if ( nlevdecomp_full > 1 ) then - call hist_addfld2d (fname=trim(fname), units=units, type2d=type2d, & - avgflag=avgflag, long_name=long_name, & - ptr_patch=ptr_patch, l2g_scale_type=l2g_scale_type, default=default) - else - ptr_1d => ptr_patch(:,1) - call hist_addfld1d (fname=trim(fname), units=units, & - avgflag=avgflag, long_name=long_name, & - ptr_patch=ptr_1d, l2g_scale_type=l2g_scale_type, default=default) - endif - else - if ( nlevdecomp_full > 1 ) then - call hist_addfld2d (fname=trim(fname), units=units, type2d=type2d, & - avgflag=avgflag, long_name=long_name, & - ptr_patch=ptr_patch, l2g_scale_type=l2g_scale_type) - else - ptr_1d => ptr_patch(:,1) - call hist_addfld1d (fname=trim(fname), units=units, & - avgflag=avgflag, long_name=long_name, & - ptr_patch=ptr_1d, l2g_scale_type=l2g_scale_type) - endif - endif - - else - write(iulog, *) ' error: hist_addfld_decomp needs either patch or column level pointer' - write(iulog, *) fname - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - end subroutine hist_addfld_decomp - - !----------------------------------------------------------------------- - integer function pointer_index () - ! - ! !DESCRIPTION: - ! Set the current pointer index and increment the value of the index. - ! - ! !ARGUMENTS: - ! - integer, save :: lastindex = 1 - character(len=*),parameter :: subname = 'pointer_index' - !----------------------------------------------------------------------- - - pointer_index = lastindex - lastindex = lastindex + 1 - if (lastindex > max_mapflds) then - write(iulog,*) trim(subname),' ERROR: ',& - ' lastindex = ',lastindex,' greater than max_mapflds= ',max_mapflds - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - - end function pointer_index - - !----------------------------------------------------------------------- - subroutine hist_add_subscript(name, dim) - ! - ! !DESCRIPTION: - ! Add a history variable to the output history tape. - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: name ! name of subscript - integer , intent(in) :: dim ! dimension of subscript - ! - ! !LOCAL VARIABLES: - character(len=*),parameter :: subname = 'hist_add_subscript' - !----------------------------------------------------------------------- - - num_subs = num_subs + 1 - if (num_subs > max_subs) then - write(iulog,*) trim(subname),' ERROR: ',& - ' num_subs = ',num_subs,' greater than max_subs= ',max_subs - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - subs_name(num_subs) = name - subs_dim(num_subs) = dim - - end subroutine hist_add_subscript - - !----------------------------------------------------------------------- - - subroutine strip_null(str) - character(len=*), intent(inout) :: str - integer :: i - do i=1,len(str) - if(ichar(str(i:i))==0) str(i:i)=' ' - end do - end subroutine strip_null - - !------------------------------------------------------------------------ - subroutine hist_do_disp (ntapes, hist_ntimes, hist_mfilt, if_stop, if_disphist, rstwr, nlend) - ! - ! !DESCRIPTION: - ! Determine logic for closeing and/or disposing history file - ! Sets values for if_disphist, if_stop (arguments) - ! Remove history files unless this is end of run or - ! history file is not full. - ! - ! !USES: - use clm_time_manager, only : is_last_step - ! - ! !ARGUMENTS: - integer, intent(in) :: ntapes !actual number of history tapes - integer, intent(in) :: hist_ntimes(ntapes) !current numbers of time samples on history tape - integer, intent(in) :: hist_mfilt(ntapes) !maximum number of time samples per tape - logical, intent(out) :: if_stop !true => last time step of run - logical, intent(out) :: if_disphist(ntapes) !true => save and dispose history file - logical, intent(in) :: rstwr - logical, intent(in) :: nlend - ! - ! !LOCAL VARIABLES: - integer :: t ! history tape index - logical :: rest_now ! temporary - logical :: stop_now ! temporary - !------------------------------------------------------------------------ - - rest_now = .false. - stop_now = .false. - - if (nlend) stop_now = .true. - if (rstwr) rest_now = .true. - - if_stop = stop_now - - if (stop_now) then - ! End of run - dispose all history files - - if_disphist(1:ntapes) = .true. - - else if (rest_now) then - ! Restart - dispose all history files - - do t = 1,ntapes - if_disphist(t) = .true. - end do - else - ! Dispose - - if_disphist(1:ntapes) = .false. - do t = 1,ntapes - if (hist_ntimes(t) == hist_mfilt(t)) then - if_disphist(t) = .true. - endif - end do - endif - - end subroutine hist_do_disp - - !----------------------------------------------------------------------- - function avgflag_valid(avgflag, blank_valid) result(valid) - ! - ! !DESCRIPTION: - ! Returns true if the given avgflag is a valid option, false if not - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: valid ! function result - character(len=*), intent(in) :: avgflag - logical, intent(in) :: blank_valid ! whether ' ' is a valid avgflag in this context - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'avgflag_valid' - !----------------------------------------------------------------------- - - ! This initial check is mainly here to catch the possibility that someone has added a - ! new "valid" avgflag option that exceeds avgflag_strlen - if (len_trim(avgflag) > avgflag_strlen) then - valid = .false. - - else if (avgflag == ' ' .and. blank_valid) then - valid = .true. - else if (avgflag == 'A' .or. avgflag == 'I' .or. & - avgflag == 'X' .or. avgflag == 'M' .or. & - avgflag == 'SUM') then - valid = .true. - else - valid = .false. - end if - - end function avgflag_valid - - -end module histFileMod - diff --git a/src/main/initGridCellsMod.F90 b/src/main/initGridCellsMod.F90 deleted file mode 100644 index e7053130db..0000000000 --- a/src/main/initGridCellsMod.F90 +++ /dev/null @@ -1,600 +0,0 @@ -module initGridCellsMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Initializes sub-grid mapping for each land grid cell. This module handles the high- - ! level logic that determines how the subgrid structure is set up in a CLM run. It - ! makes use of lower-level routines in initSubgridMod. - ! - ! TODO(wjs, 2015-12-08) Much of the logic here duplicates (in some sense) logic in - ! subgridMod. The duplication should probably be extracted into routines shared between - ! these modules (or the two modules should be combined into one). - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc,iam - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varcon , only : namep, namec, namel, nameg - use decompMod , only : bounds_type, ldecomp - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use initSubgridMod , only : clm_ptrs_compdown, clm_ptrs_check - use initSubgridMod , only : add_landunit, add_column, add_patch - use glcBehaviorMod , only : glc_behavior_type - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public initGridcells ! initialize sub-grid gridcell mapping - ! - ! !PRIVATE MEMBER FUNCTIONS: - private set_landunit_veg_compete - private set_landunit_wet_lake - private set_landunit_ice_mec - private set_landunit_crop_noncompete - private set_landunit_urban - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine initGridcells(glc_behavior) - ! - ! !DESCRIPTION: - ! Initialize sub-grid mapping and allocates space for derived type hierarchy. - ! For each land gridcell determine landunit, column and patch properties. - ! - ! !USES - use domainMod , only : ldomain - use decompMod , only : get_proc_bounds, get_clump_bounds, get_proc_clumps - use subgridWeightsMod , only : compute_higher_order_weights - use landunit_varcon , only : istsoil, istwet, istdlak, istice_mec - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md, istcrop - use clm_varctl , only : use_fates - use shr_const_mod , only : SHR_CONST_PI - ! - ! !ARGUMENTS: - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: nc,li,ci,pi,gdc ! indices - integer :: nclumps ! number of clumps on this processor - type(bounds_type) :: bounds_proc - type(bounds_type) :: bounds_clump - !------------------------------------------------------------------------ - - ! Notes about how this routine is arranged, and its implications for the arrangement - ! of 1-d vectors in memory: - ! - ! (1) There is an outer loop over clumps; this results in all of a clump's points (at - ! the gridcell, landunit, column & patch level) being contiguous. This is important - ! for the use of begg:endg, etc., and also for performance. - ! - ! (2) Next, there is a section for each landunit, with the loop over grid cells - ! happening separately for each landunit. This means that, within a given clump, - ! points with the same landunit are grouped together (this is true at the - ! landunit, column and patch levels). Thus, different landunits for a given grid - ! cell are separated in memory. This improves performance in the many parts of - ! the code that operate over a single landunit, or two similar landunits. - ! - ! Example: landunit-level array: For a processor with 2 clumps, each of which has 2 - ! grid cells, each of which has 3 landunits, the layout of a landunit-level array - ! looks like the following: - ! - ! Array index: 1 2 3 4 5 6 7 8 9 10 11 12 - ! ------------------------------------------------------------ - ! Clump index: 1 1 1 1 1 1 2 2 2 2 2 2 - ! Gridcell: 1 2 1 2 1 2 3 4 3 4 3 4 - ! Landunit type: 1 1 2 2 3 3 1 1 2 2 3 3 - ! - ! Example: patch-level array: For a processor with 1 clump, which has 2 grid cells, each - ! of which has 2 landunits, each of which has 3 patchs, the layout of a patch-level array - ! looks like the following: - ! - ! Array index: 1 2 3 4 5 6 7 8 9 10 11 12 - ! ------------------------------------------------------------ - ! Gridcell: 1 1 1 2 2 2 1 1 1 2 2 2 - ! Landunit type: 1 1 1 1 1 1 2 2 2 2 2 2 - ! Patch type: 1 2 3 1 2 3 1 2 3 1 2 3 - ! - ! So note that clump index is most slowly varying, followed by landunit type, - ! followed by gridcell, followed by column and patch type. - ! - ! Cohort layout - ! Array index: 1 2 3 4 5 6 7 8 9 10 11 12 - ! ------------------------------------------------------------ - ! Gridcell: 1 1 1 1 2 2 2 2 3 3 3 3 - ! Column: 1 1 2 2 3 3 4 4 5 5 6 6 - ! Cohort: 1 2 1 2 1 2 1 2 1 2 1 2 - - nclumps = get_proc_clumps() - - ! FIX(SPM,032414) add private vars for cohort and perhaps patch dimension - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump, li, ci, pi, gdc) - do nc = 1, nclumps - - call get_clump_bounds(nc, bounds_clump) - - ! For each land gridcell on global grid determine landunit, column and patch properties - - li = bounds_clump%begl-1 - ci = bounds_clump%begc-1 - pi = bounds_clump%begp-1 - - ! Determine naturally vegetated landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_veg_compete( & - ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Determine crop landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_crop_noncompete( & - ltype=istcrop, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Determine urban tall building district landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_tbd, gi=gdc, li=li, ci=ci, pi=pi) - - end do - - ! Determine urban high density landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_hd, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Determine urban medium density landunit - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_urban( & - ltype=isturb_md, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Determine lake, wetland and glacier landunits - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_wet_lake( & - ltype=istdlak, gi=gdc, li=li, ci=ci, pi=pi) - end do - - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_wet_lake( & - ltype=istwet, gi=gdc, li=li, ci=ci, pi=pi) - end do - - do gdc = bounds_clump%begg,bounds_clump%endg - call set_landunit_ice_mec( & - glc_behavior = glc_behavior, & - ltype=istice_mec, gi=gdc, li=li, ci=ci, pi=pi) - end do - - ! Ensure that we have set the expected number of patchs, cols and landunits for this clump - SHR_ASSERT(li == bounds_clump%endl, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(ci == bounds_clump%endc, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(pi == bounds_clump%endp, errMsg(sourcefile, __LINE__)) - - ! Set some other gridcell-level variables - - do gdc = bounds_clump%begg,bounds_clump%endg - grc%gindex(gdc) = ldecomp%gdc2glo(gdc) - grc%area(gdc) = ldomain%area(gdc) - grc%latdeg(gdc) = ldomain%latc(gdc) - grc%londeg(gdc) = ldomain%lonc(gdc) - grc%lat(gdc) = grc%latdeg(gdc) * SHR_CONST_PI/180._r8 - grc%lon(gdc) = grc%londeg(gdc) * SHR_CONST_PI/180._r8 - enddo - - ! Fill in subgrid datatypes - - call clm_ptrs_compdown(bounds_clump) - - ! By putting this check within the loop over clumps, we ensure that (for example) - ! if a clump is responsible for landunit L, then that same clump is also - ! responsible for all columns and patchs in L. - call clm_ptrs_check(bounds_clump) - - ! Set patch%wtlunit, patch%wtgcell and col%wtgcell - call compute_higher_order_weights(bounds_clump) - - end do - !$OMP END PARALLEL DO - - end subroutine initGridcells - - !------------------------------------------------------------------------ - subroutine set_landunit_veg_compete (ltype, gi, li, ci, pi) - ! - ! !DESCRIPTION: - ! Initialize vegetated landunit with competition - ! - ! !USES - use clm_instur, only : wt_lunit, wt_nat_patch - use subgridMod, only : subgrid_get_info_natveg, natveg_patch_exists - use clm_varpar, only : numpft, maxpatch_pft, natpft_lb, natpft_ub - ! - ! !ARGUMENTS: - integer , intent(in) :: ltype ! landunit type - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! patch index - ! - ! !LOCAL VARIABLES: - integer :: m ! index - integer :: npatches ! number of patches in landunit - integer :: ncols - integer :: nlunits - integer :: npatches_added ! number of patches actually added - integer :: ncols_added ! number of columns actually added - integer :: nlunits_added ! number of landunits actually added - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - !------------------------------------------------------------------------ - - ! Set decomposition properties - - call subgrid_get_info_natveg(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - wtlunit2gcell = wt_lunit(gi, ltype) - - nlunits_added = 0 - ncols_added = 0 - npatches_added = 0 - - if (nlunits > 0) then - call add_landunit(li=li, gi=gi, ltype=ltype, wtgcell=wtlunit2gcell) - nlunits_added = nlunits_added + 1 - - ! Assume one column on the landunit - call add_column(ci=ci, li=li, ctype=1, wtlunit=1.0_r8) - ncols_added = ncols_added + 1 - - do m = natpft_lb,natpft_ub - if (natveg_patch_exists(gi, m)) then - call add_patch(pi=pi, ci=ci, ptype=m, wtcol=wt_nat_patch(gi,m)) - npatches_added = npatches_added + 1 - end if - end do - end if - - SHR_ASSERT(nlunits_added == nlunits, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(ncols_added == ncols, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(npatches_added == npatches, errMsg(sourcefile, __LINE__)) - - end subroutine set_landunit_veg_compete - - !------------------------------------------------------------------------ - subroutine set_landunit_wet_lake (ltype, gi, li, ci, pi) - ! - ! !DESCRIPTION: - ! Initialize wetland and lake landunits - ! - ! !USES - use clm_instur , only : wt_lunit - use landunit_varcon , only : istwet, istdlak - use subgridMod , only : subgrid_get_info_wetland, subgrid_get_info_lake - use pftconMod , only : noveg - - ! - ! !ARGUMENTS: - integer , intent(in) :: ltype ! landunit type - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! patch index - ! - ! !LOCAL VARIABLES: - integer :: npatches ! number of pfts in landunit - integer :: ncols - integer :: nlunits - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - !------------------------------------------------------------------------ - - ! Set decomposition properties - - if (ltype == istwet) then - call subgrid_get_info_wetland(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - else if (ltype == istdlak) then - call subgrid_get_info_lake(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - else - write(iulog,*)' set_landunit_wet_lake: ltype of ',ltype,' not valid' - write(iulog,*)' only istwet and istdlak ltypes are valid' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - wtlunit2gcell = wt_lunit(gi, ltype) - - if (npatches > 0) then - - if (npatches /= 1) then - write(iulog,*)' set_landunit_wet_lake: compete landunit must'// & - ' have one patch ' - write(iulog,*)' current value of npatches=',npatches - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Currently assume that each landunit only has only one column - ! and that each column has its own pft - - call add_landunit(li=li, gi=gi, ltype=ltype, wtgcell=wtlunit2gcell) - call add_column(ci=ci, li=li, ctype=ltype, wtlunit=1.0_r8) - call add_patch(pi=pi, ci=ci, ptype=noveg, wtcol=1.0_r8) - - endif ! npatches > 0 - - end subroutine set_landunit_wet_lake - - !----------------------------------------------------------------------- - subroutine set_landunit_ice_mec(glc_behavior, ltype, gi, li, ci, pi) - ! - ! !DESCRIPTION: - ! Initialize glacier_mec landunits - ! - ! !USES: - use clm_varpar , only : maxpatch_glcmec - use clm_instur , only : wt_lunit, wt_glc_mec - use landunit_varcon , only : istice_mec - use column_varcon , only : icemec_class_to_col_itype - use subgridMod , only : subgrid_get_info_glacier_mec - use pftconMod , only : noveg - ! - ! !ARGUMENTS: - type(glc_behavior_type), intent(in) :: glc_behavior - integer , intent(in) :: ltype ! landunit type - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! patch index - ! - ! !LOCAL VARIABLES: - integer :: m ! index - integer :: npatches ! number of patches in landunit - integer :: ncols - integer :: nlunits - logical :: col_exists - real(r8) :: wtlunit2gcell ! weight relative to gridcell of landunit - real(r8) :: wtcol2lunit ! col weight in landunit - logical :: type_is_dynamic - - ! We don't have a true atm_topo value at the point of this call, so arbitrarily use - ! 0. This will put glc_mec in elevation class 1 in some places where it should - ! actually be in a higher elevation class, but that will be adjusted in the run loop - ! (or upon reading the restart file). - real(r8), parameter :: atm_topo = 0._r8 - - character(len=*), parameter :: subname = 'set_landunit_ice_mec' - !----------------------------------------------------------------------- - - SHR_ASSERT(ltype == istice_mec, errMsg(sourcefile, __LINE__)) - - call subgrid_get_info_glacier_mec(gi, atm_topo, glc_behavior, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - - if (nlunits == 1) then - wtlunit2gcell = wt_lunit(gi, ltype) - call add_landunit(li=li, gi=gi, ltype=ltype, wtgcell=wtlunit2gcell) - - ! Determine column and properties - ! (Each column has its own pft) - ! - ! For grid cells where the glc behavior indicates a need for virtual columns - ! (i.e., zero-weight columns that are nevertheless active), make sure all the - ! elevations classes are populated, even if some have zero fractional area. - ! This ensures that the ice sheet component, glc, will receive a surface mass - ! balance in each elevation class wherever the SMB is needed. - - type_is_dynamic = glc_behavior%cols_have_dynamic_type(gi) - do m = 1, maxpatch_glcmec - call glc_behavior%glc_mec_col_exists(gi = gi, elev_class = m, atm_topo = atm_topo, & - exists = col_exists, col_wt_lunit = wtcol2lunit) - if (col_exists) then - call add_column(ci=ci, li=li, ctype=icemec_class_to_col_itype(m), & - wtlunit=wtcol2lunit, type_is_dynamic=type_is_dynamic) - call add_patch(pi=pi, ci=ci, ptype=noveg, wtcol=1.0_r8) - endif - enddo - - else if (nlunits /= 0) then - call endrun(msg=subname//' ERROR: expect 0 or 1 landunits') - end if - - end subroutine set_landunit_ice_mec - - !------------------------------------------------------------------------ - - subroutine set_landunit_crop_noncompete (ltype, gi, li, ci, pi) - ! - ! !DESCRIPTION: - ! Initialize crop landunit without competition - ! - ! Note about the ltype input argument: This provides the value for this landunit index - ! (i.e., the crop landunit index). This may differ from the landunit's 'itype' value, - ! since itype is istsoil if we are running with create_crop_landunit but for - ! an older surface dataset that - ! - ! !USES - use clm_instur , only : wt_lunit, wt_cft - use landunit_varcon , only : istcrop, istsoil - use subgridMod , only : subgrid_get_info_crop, crop_patch_exists - use clm_varpar , only : maxpatch_pft, cft_lb, cft_ub - use clm_varctl , only : create_crop_landunit - ! - ! !ARGUMENTS: - integer , intent(in) :: ltype ! landunit type - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! patch index - ! - ! !LOCAL VARIABLES: - integer :: my_ltype ! landunit type for crops - integer :: cft ! crop functional type index - integer :: npatches ! number of pfts in landunit - integer :: ncols - integer :: nlunits - integer :: npatches_added ! number of patches actually added - integer :: ncols_added ! number of columns actually added - integer :: nlunits_added ! number of landunits actually added - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - !------------------------------------------------------------------------ - - ! Set decomposition properties - - call subgrid_get_info_crop(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - wtlunit2gcell = wt_lunit(gi, ltype) - - nlunits_added = 0 - ncols_added = 0 - npatches_added = 0 - - if (nlunits > 0) then - - ! Note that we cannot simply use the 'ltype' argument to set itype here, - ! because ltype will always indicate istcrop - if ( create_crop_landunit )then - my_ltype = ltype ! Will always be istcrop - if ( ltype /= istcrop )then - write(iulog,*)' create_crop_landunit on and ltype is not istcrop: ', ltype - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - else - my_ltype = istsoil - end if - - call add_landunit(li=li, gi=gi, ltype=my_ltype, wtgcell=wtlunit2gcell) - nlunits_added = nlunits_added + 1 - - ! Set column and patch properties for this landunit - ! (each column has its own pft) - - do cft = cft_lb, cft_ub - if (crop_patch_exists(gi, cft)) then - call add_column(ci=ci, li=li, ctype=((istcrop*100) + cft), wtlunit=wt_cft(gi,cft)) - ncols_added = ncols_added + 1 - call add_patch(pi=pi, ci=ci, ptype=cft, wtcol=1.0_r8) - npatches_added = npatches_added + 1 - end if - end do - - end if - - SHR_ASSERT(nlunits_added == nlunits, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(ncols_added == ncols, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(npatches_added == npatches, errMsg(sourcefile, __LINE__)) - - end subroutine set_landunit_crop_noncompete - - !------------------------------------------------------------------------------ - - subroutine set_landunit_urban (ltype, gi, li, ci, pi) - ! - ! !DESCRIPTION: - ! Initialize urban landunits - ! - ! !USES - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv, icol_road_imperv - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md, isturb_MIN - use clm_varpar , only : maxpatch_urb - use clm_instur , only : wt_lunit - use subgridMod , only : subgrid_get_info_urban_tbd, subgrid_get_info_urban_hd - use subgridMod , only : subgrid_get_info_urban_md - use UrbanParamsType , only : urbinp - use decompMod , only : ldecomp - use pftconMod , only : noveg - ! - ! !ARGUMENTS: - integer , intent(in) :: ltype ! landunit type - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! patch index - ! - ! !LOCAL VARIABLES: - integer :: m ! index - integer :: n ! urban density type index - integer :: ctype ! column type - integer :: npatches ! number of pfts in landunit - integer :: ncols - integer :: nlunits - real(r8) :: wtlunit2gcell ! weight relative to gridcell of landunit - real(r8) :: wtcol2lunit ! weight of column with respect to landunit - real(r8) :: wtlunit_roof ! weight of roof with respect to landunit - real(r8) :: wtroad_perv ! weight of pervious road column with respect to total road - integer :: ier ! error status - !------------------------------------------------------------------------ - - ! Set decomposition properties, and set variables specific to urban density type - - select case (ltype) - case (isturb_tbd) - call subgrid_get_info_urban_tbd(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - case (isturb_hd) - call subgrid_get_info_urban_hd(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - case (isturb_md) - call subgrid_get_info_urban_md(gi, & - npatches=npatches, ncols=ncols, nlunits=nlunits) - case default - write(iulog,*)' set_landunit_urban: unknown ltype: ', ltype - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - if (npatches > 0) then - - wtlunit2gcell = wt_lunit(gi, ltype) - - n = ltype - isturb_MIN + 1 - wtlunit_roof = urbinp%wtlunit_roof(gi,n) - wtroad_perv = urbinp%wtroad_perv(gi,n) - - call add_landunit(li=li, gi=gi, ltype=ltype, wtgcell=wtlunit2gcell) - - ! Loop through columns for this landunit and set the column and patch properties - ! For the urban landunits it is assumed that each column has its own pft - - do m = 1, maxpatch_urb - - if (m == 1) then - ctype = icol_roof - wtcol2lunit = wtlunit_roof - else if (m == 2) then - ctype = icol_sunwall - wtcol2lunit = (1. - wtlunit_roof)/3 - else if (m == 3) then - ctype = icol_shadewall - wtcol2lunit = (1. - wtlunit_roof)/3 - else if (m == 4) then - ctype = icol_road_imperv - wtcol2lunit = ((1. - wtlunit_roof)/3) * (1.-wtroad_perv) - else if (m == 5) then - ctype = icol_road_perv - wtcol2lunit = ((1. - wtlunit_roof)/3) * (wtroad_perv) - end if - - call add_column(ci=ci, li=li, ctype=ctype, wtlunit=wtcol2lunit) - - call add_patch(pi=pi, ci=ci, ptype=noveg, wtcol=1.0_r8) - - end do ! end of loop through urban columns-pfts - end if - - end subroutine set_landunit_urban - -end module initGridCellsMod diff --git a/src/main/initSubgridMod.F90 b/src/main/initSubgridMod.F90 deleted file mode 100644 index 57384dc461..0000000000 --- a/src/main/initSubgridMod.F90 +++ /dev/null @@ -1,475 +0,0 @@ -module initSubgridMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Lower-level routines for initializing the subgrid structure. This module is shared - ! between both the production code (via initGridCellsMod) and unit testing code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use clm_varctl , only : iulog, use_fates - use clm_varcon , only : namep, namec, namel - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use column_varcon , only : is_hydrologically_active - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_ptrs_compdown ! fill in data pointing down - public :: clm_ptrs_check ! checks and writes out a summary of subgrid data - public :: add_landunit ! add an entry in the landunit-level arrays - public :: add_column ! add an entry in the column-level arrays - public :: add_patch ! add an entry in the patch-level arrays - ! - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------------ - subroutine clm_ptrs_compdown(bounds) - ! - ! !DESCRIPTION: - ! Assumes the part of the subgrid pointing up has been set. Fills - ! in the data pointing down. Up is p_c, p_l, p_g, c_l, c_g, and l_g. - ! - ! This algorithm assumes all indices besides grid cell are monotonically - ! increasing. (Note that grid cell index is NOT monotonically increasing, - ! hence we cannot set initial & final indices at the grid cell level - - ! grc%luni, grc%lunf, etc.) - ! - ! Algorithm works as follows. The p, c, and l loops march through - ! the full arrays (nump, numc, and numl) checking the "up" indexes. - ! As soon as the "up" index of the current (p,c,l) cell changes relative - ! to the previous (p,c,l) cell, the *i array will be set to point down - ! to that cell. The *f array follows the same logic, so it's always the - ! last "up" index from the previous cell when an "up" index changes. - ! - ! For example, a case where p_c(1:4) = 1 and p_c(5:12) = 2. This - ! subroutine will set c_pi(1) = 1, c_pf(1) = 4, c_pi(2) = 5, c_pf(2) = 12. - ! - ! !USES - use clm_varcon, only : ispval - ! - ! !ARGUMENTS - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: l,c,p ! loop counters - integer :: curg,curl,curc,curp ! tracks g,l,c,p indexes in arrays - integer :: ltype ! landunit type - !------------------------------------------------------------------------------ - - !--- Set the current c,l (curc, curl) to zero for initialization, - !--- these indices track the current "up" index. - !--- Take advantage of locality of l/c/p cells - !--- Loop p through full local begp:endp length - !--- Separately check the p_c, p_l, and p_g indexes for a change in - !--- the "up" index. - !--- If there is a change, verify that the current c,l,g is within the - !--- valid range, and set c_pi, l_pi, or g_pi to that current c,l,g - !--- Constantly update the c_pf, l_pf, and g_pf array. When the - !--- g, l, c index changes, the *_pf array will be set correctly - !--- Do the same for cols setting c_li, c_gi, c_lf, c_gf and - !--- lunits setting l_gi, l_gf. - - curc = 0 - curl = 0 - do p = bounds%begp,bounds%endp - if (patch%column(p) /= curc) then - curc = patch%column(p) - if (curc < bounds%begc .or. curc > bounds%endc) then - write(iulog,*) 'clm_ptrs_compdown ERROR: pcolumn ',p,curc,bounds%begc,bounds%endc - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - endif - col%patchi(curc) = p - endif - col%patchf(curc) = p - col%npatches(curc) = col%patchf(curc) - col%patchi(curc) + 1 - if (patch%landunit(p) /= curl) then - curl = patch%landunit(p) - if (curl < bounds%begl .or. curl > bounds%endl) then - write(iulog,*) 'clm_ptrs_compdown ERROR: plandunit ',p,curl,bounds%begl,bounds%endl - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - endif - lun%patchi(curl) = p - endif - lun%patchf(curl) = p - lun%npatches(curl) = lun%patchf(curl) - lun%patchi(curl) + 1 - enddo - - curl = 0 - do c = bounds%begc,bounds%endc - if (col%landunit(c) /= curl) then - curl = col%landunit(c) - if (curl < bounds%begl .or. curl > bounds%endl) then - write(iulog,*) 'clm_ptrs_compdown ERROR: clandunit ',c,curl,bounds%begl,bounds%endl - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - endif - lun%coli(curl) = c - endif - lun%colf(curl) = c - lun%ncolumns(curl) = lun%colf(curl) - lun%coli(curl) + 1 - enddo - - ! Determine landunit_indices: indices into landunit-level arrays for each grid cell. - ! Note that landunits not present in a given grid cell are set to ispval. - grc%landunit_indices(:,bounds%begg:bounds%endg) = ispval - do l = bounds%begl,bounds%endl - ltype = lun%itype(l) - curg = lun%gridcell(l) - if (curg < bounds%begg .or. curg > bounds%endg) then - write(iulog,*) 'clm_ptrs_compdown ERROR: landunit_indices ', l,curg,bounds%begg,bounds%endg - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - - if (grc%landunit_indices(ltype, curg) == ispval) then - grc%landunit_indices(ltype, curg) = l - else - write(iulog,*) 'clm_ptrs_compdown ERROR: This landunit type has already been set for this gridcell' - write(iulog,*) 'l, ltype, curg = ', l, ltype, curg - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine clm_ptrs_compdown - - !------------------------------------------------------------------------------ - subroutine clm_ptrs_check(bounds) - ! - ! !DESCRIPTION: - ! Checks and writes out a summary of subgrid data - ! - ! !USES - use clm_varcon, only : ispval - use landunit_varcon, only : max_lunit - ! - ! !ARGUMENTS - implicit none - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p ! loop counters - integer :: l_prev ! l value of previous point - integer :: ltype ! landunit type - logical :: error ! error flag - !------------------------------------------------------------------------------ - - associate( & - begg => bounds%begg, & - endg => bounds%endg, & - begl => bounds%begl, & - endl => bounds%endl, & - begc => bounds%begc, & - endc => bounds%endc, & - begp => bounds%begp, & - endp => bounds%endp & - ) - - if (masterproc) write(iulog,*) ' ' - if (masterproc) write(iulog,*) '---clm_ptrs_check:' - - !--- check index ranges --- - error = .false. - do g = begg, endg - do ltype = 1, max_lunit - l = grc%landunit_indices(ltype, g) - if (l /= ispval) then - if (l < begl .or. l > endl) error = .true. - end if - end do - end do - if (error) then - write(iulog,*) ' clm_ptrs_check: g index ranges - ERROR' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if (masterproc) write(iulog,*) ' clm_ptrs_check: g index ranges - OK' - - error = .false. - if (minval(lun%gridcell(begl:endl)) < begg .or. maxval(lun%gridcell(begl:endl)) > endg) error=.true. - if (minval(lun%coli(begl:endl)) < begc .or. maxval(lun%coli(begl:endl)) > endc) error=.true. - if (minval(lun%colf(begl:endl)) < begc .or. maxval(lun%colf(begl:endl)) > endc) error=.true. - if (minval(lun%patchi(begl:endl)) < begp .or. maxval(lun%patchi(begl:endl)) > endp) error=.true. - if (minval(lun%patchf(begl:endl)) < begp .or. maxval(lun%patchf(begl:endl)) > endp) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: l index ranges - ERROR' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: l index ranges - OK' - - error = .false. - if (minval(col%gridcell(begc:endc)) < begg .or. maxval(col%gridcell(begc:endc)) > endg) error=.true. - if (minval(col%landunit(begc:endc)) < begl .or. maxval(col%landunit(begc:endc)) > endl) error=.true. - if (minval(col%patchi(begc:endc)) < begp .or. maxval(col%patchi(begc:endc)) > endp) error=.true. - if (minval(col%patchf(begc:endc)) < begp .or. maxval(col%patchf(begc:endc)) > endp) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: c index ranges - ERROR' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: c index ranges - OK' - - error = .false. - if (minval(patch%gridcell(begp:endp)) < begg .or. maxval(patch%gridcell(begp:endp)) > endg) error=.true. - if (minval(patch%landunit(begp:endp)) < begl .or. maxval(patch%landunit(begp:endp)) > endl) error=.true. - if (minval(patch%column(begp:endp)) < begc .or. maxval(patch%column(begp:endp)) > endc) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: p index ranges - ERROR' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: p index ranges - OK' - - !--- check that indices in arrays are monotonically increasing --- - error = .false. - do l=begl+1,endl - if ((lun%itype(l) == lun%itype(l-1)) .and. & - lun%gridcell(l) < lun%gridcell(l-1)) then - ! grid cell indices should be monotonically increasing for a given landunit type - error = .true. - end if - if (lun%coli(l) < lun%coli(l-1)) error = .true. - if (lun%colf(l) < lun%colf(l-1)) error = .true. - if (lun%patchi(l) < lun%patchi(l-1)) error = .true. - if (lun%patchf(l) < lun%patchf(l-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: l mono increasing - ERROR' - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: l mono increasing - OK' - - error = .false. - do c=begc+1,endc - l = col%landunit(c) - l_prev = col%landunit(c-1) - if ((lun%itype(l) == lun%itype(l_prev)) .and. & - col%gridcell(c) < col%gridcell(c-1)) then - ! grid cell indices should be monotonically increasing for a given landunit type - error = .true. - end if - if (col%landunit(c) < col%landunit(c-1)) error = .true. - if (col%patchi(c) < col%patchi(c-1)) error = .true. - if (col%patchf(c) < col%patchf(c-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: c mono increasing - ERROR' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: c mono increasing - OK' - - error = .false. - do p=begp+1,endp - l = patch%landunit(p) - l_prev = patch%landunit(p-1) - if ((lun%itype(l) == lun%itype(l_prev)) .and. & - patch%gridcell(p) < patch%gridcell(p-1)) then - ! grid cell indices should be monotonically increasing for a given landunit type - error = .true. - end if - if (patch%landunit(p) < patch%landunit(p-1)) error = .true. - if (patch%column (p) < patch%column (p-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: p mono increasing - ERROR' - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: p mono increasing - OK' - - !--- check that the tree is internally consistent --- - error = .false. - do g = begg, endg - do ltype = 1, max_lunit - l = grc%landunit_indices(ltype, g) - - ! skip l == ispval, which implies that this landunit type doesn't exist on this grid cell - if (l /= ispval) then - if (lun%itype(l) /= ltype) error = .true. - if (lun%gridcell(l) /= g) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: tree consistent - ERROR' - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - endif - do c = lun%coli(l),lun%colf(l) - if (col%gridcell(c) /= g) error = .true. - if (col%landunit(c) /= l) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: tree consistent - ERROR' - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - endif - do p = col%patchi(c),col%patchf(c) - if (patch%gridcell(p) /= g) error = .true. - if (patch%landunit(p) /= l) error = .true. - if (patch%column(p) /= c) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: tree consistent - ERROR' - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - endif - enddo ! p - enddo ! c - end if ! l /= ispval - enddo ! ltype - enddo ! g - if (masterproc) write(iulog,*) ' clm_ptrs_check: tree consistent - OK' - if (masterproc) write(iulog,*) ' ' - - end associate - - end subroutine clm_ptrs_check - - !----------------------------------------------------------------------- - subroutine add_landunit(li, gi, ltype, wtgcell) - ! - ! !DESCRIPTION: - ! Add an entry in the landunit-level arrays. li gives the index of the last landunit - ! added; the new landunit is added at li+1, and the li argument is incremented - ! accordingly. - ! - ! !USES: - use landunit_varcon , only : istice_mec, istdlak, isturb_MIN, isturb_MAX, landunit_is_special - ! - ! !ARGUMENTS: - integer , intent(inout) :: li ! input value is index of last landunit added; output value is index of this newly-added landunit - integer , intent(in) :: gi ! grid cell index on which this landunit should be placed - integer , intent(in) :: ltype ! landunit type - real(r8) , intent(in) :: wtgcell ! weight of the landunit relative to the grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'add_landunit' - !----------------------------------------------------------------------- - - li = li + 1 - - lun%gridcell(li) = gi - lun%wtgcell(li) = wtgcell - lun%itype(li) = ltype - - lun%ifspecial(li) = landunit_is_special(ltype) - - if (ltype == istice_mec) then - lun%glcmecpoi(li) = .true. - else - lun%glcmecpoi(li) = .false. - end if - - if (ltype == istdlak) then - lun%lakpoi(li) = .true. - else - lun%lakpoi(li) = .false. - end if - - if (ltype >= isturb_MIN .and. ltype <= isturb_MAX) then - lun%urbpoi(li) = .true. - else - lun%urbpoi(li) = .false. - end if - - end subroutine add_landunit - - !----------------------------------------------------------------------- - subroutine add_column(ci, li, ctype, wtlunit, type_is_dynamic) - ! - ! !DESCRIPTION: - ! Add an entry in the column-level arrays. ci gives the index of the last column - ! added; the new column is added at ci+1, and the ci argument is incremented - ! accordingly. - ! - ! !ARGUMENTS: - integer , intent(inout) :: ci ! input value is index of last column added; output value is index of this newly-added column - integer , intent(in) :: li ! landunit index on which this column should be placed (assumes this landunit has already been created) - integer , intent(in) :: ctype ! column type - real(r8) , intent(in) :: wtlunit ! weight of the column relative to the landunit - - ! whether this column's type can change at runtime; if not provided, assumed to be false - logical , intent(in), optional :: type_is_dynamic - ! - ! !LOCAL VARIABLES: - logical :: l_type_is_dynamic ! local version of type_is_dynamic - - character(len=*), parameter :: subname = 'add_column' - !----------------------------------------------------------------------- - - l_type_is_dynamic = .false. - if (present(type_is_dynamic)) then - l_type_is_dynamic = type_is_dynamic - end if - - ci = ci + 1 - - col%landunit(ci) = li - col%gridcell(ci) = lun%gridcell(li) - col%wtlunit(ci) = wtlunit - col%itype(ci) = ctype - col%type_is_dynamic(ci) = l_type_is_dynamic - col%hydrologically_active(ci) = is_hydrologically_active( & - col_itype = ctype, & - lun_itype = lun%itype(li)) - - end subroutine add_column - - !----------------------------------------------------------------------- - subroutine add_patch(pi, ci, ptype, wtcol) - ! - ! !DESCRIPTION: - ! Add an entry in the patch-level arrays. pi gives the index of the last patch added; the - ! new patch is added at pi+1, and the pi argument is incremented accordingly. - ! - ! !USES: - use clm_varcon , only : ispval - use landunit_varcon , only : istsoil, istcrop - use clm_varpar , only : natpft_lb - ! - ! !ARGUMENTS: - integer , intent(inout) :: pi ! input value is index of last patch added; output value is index of this newly-added patch - integer , intent(in) :: ci ! column index on which this patch should be placed (assumes this column has already been created) - integer , intent(in) :: ptype ! patch type - real(r8) , intent(in) :: wtcol ! weight of the patch relative to the column - ! - ! !LOCAL VARIABLES: - integer :: li ! landunit index - integer :: lb_offset ! offset between natpft_lb and 1 - - character(len=*), parameter :: subname = 'add_patch' - !----------------------------------------------------------------------- - - pi = pi + 1 - - patch%column(pi) = ci - li = col%landunit(ci) - patch%landunit(pi) = li - patch%gridcell(pi) = col%gridcell(ci) - - patch%wtcol(pi) = wtcol - - ! TODO (MV, 10-17-14): The following must be commented out because - ! currently patch%itype is used in CanopyTemperatureMod to calculate - ! z0m(p) and displa(p) - and is still called even when fates is on - - !if (.not. use_fates) then - patch%itype(pi) = ptype - !end if - - if (lun%itype(li) == istsoil .or. lun%itype(li) == istcrop) then - lb_offset = 1 - natpft_lb - patch%mxy(pi) = ptype + lb_offset - else - patch%mxy(pi) = ispval - end if - - - end subroutine add_patch - - -end module initSubgridMod diff --git a/src/main/initVerticalMod.F90 b/src/main/initVerticalMod.F90 deleted file mode 100644 index 9ba2f2711c..0000000000 --- a/src/main/initVerticalMod.F90 +++ /dev/null @@ -1,795 +0,0 @@ -module initVerticalMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Initialize vertical components of column datatype - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_sys_mod , only : shr_sys_abort - use decompMod , only : bounds_type - use spmdMod , only : masterproc - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - use clm_varpar , only : toplev_equalspace, nlev_equalspace - use clm_varpar , only : nlevsoi, nlevsoifl, nlevurb - use clm_varctl , only : fsurdat, iulog - use clm_varctl , only : use_vancouver, use_mexicocity, use_vertsoilc, use_extralakelayers - use clm_varctl , only : use_bedrock, soil_layerstruct - use clm_varctl , only : use_fates - use clm_varcon , only : zlak, dzlak, zsoi, dzsoi, zisoi, dzsoi_decomp, spval, ispval, grlnd - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, is_hydrologically_active - use landunit_varcon , only : istdlak, istice_mec - use fileutils , only : getfil - use LandunitType , only : lun - use GridcellType , only : grc - use ColumnType , only : col - use glcBehaviorMod , only : glc_behavior_type - use SnowHydrologyMod , only : InitSnowLayers - use abortUtils , only : endrun - use ncdio_pio - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: initVertical - ! !PRIVATE MEMBER FUNCTIONS: - private :: ReadNL - private :: hasBedrock ! true if the given column type includes bedrock layers - ! - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - ! - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine ReadNL( ) - ! - ! !DESCRIPTION: - ! Read namelist for SoilStateType - ! - ! !USES: - use shr_mpi_mod , only : shr_mpi_bcast - use shr_log_mod , only : errMsg => shr_log_errMsg - use fileutils , only : getavu, relavu, opnfil - use clm_nlUtilsMod , only : find_nlgroup_name - use clm_varctl , only : iulog - use spmdMod , only : mpicom, masterproc - use controlMod , only : NLFilename - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=32) :: subname = 'InitVertical_readnl' ! subroutine name - !----------------------------------------------------------------------- - - character(len=*), parameter :: nl_name = 'clm_inparm' ! Namelist name - - ! MUST agree with name in namelist and read - namelist /clm_inparm/ use_bedrock - - ! preset values - - use_bedrock = .false. - - if ( masterproc )then - - unitn = getavu() - write(iulog,*) 'Read in '//nl_name//' namelist' - call opnfil (NLFilename, unitn, 'F') - call find_nlgroup_name(unitn, nl_name, status=ierr) - if (ierr == 0) then - read(unit=unitn, nml=clm_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading '//nl_name//' namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR finding '//nl_name//' namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - - end if - - call shr_mpi_bcast(use_bedrock, mpicom) - - end subroutine ReadNL - - !------------------------------------------------------------------------ - subroutine initVertical(bounds, glc_behavior, snow_depth, thick_wall, thick_roof) - use clm_varcon, only : zmin_bedrock, n_melt_glcmec - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(glc_behavior_type), intent(in) :: glc_behavior - real(r8) , intent(in) :: snow_depth(bounds%begc:) - real(r8) , intent(in) :: thick_wall(bounds%begl:) - real(r8) , intent(in) :: thick_roof(bounds%begl:) - ! - ! LOCAL VARAIBLES: - integer :: c,l,g,i,j,lev ! indices - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar - integer :: dimid ! dimension id - character(len=256) :: locfn ! local filename - real(r8) ,pointer :: std (:) ! read in - topo_std - real(r8) ,pointer :: tslope (:) ! read in - topo_slope - real(r8) :: slope0 ! temporary - real(r8) :: slopebeta ! temporary - real(r8) :: slopemax ! temporary - integer :: ier ! error status - real(r8) :: scalez = 0.025_r8 ! Soil layer thickness discretization (m) - real(r8) :: thick_equal = 0.2 - real(r8) ,pointer :: zbedrock_in(:) ! read in - z_bedrock - real(r8) ,pointer :: lakedepth_in(:) ! read in - lakedepth - real(r8), allocatable :: zurb_wall(:,:) ! wall (layer node depth) - real(r8), allocatable :: zurb_roof(:,:) ! roof (layer node depth) - real(r8), allocatable :: dzurb_wall(:,:) ! wall (layer thickness) - real(r8), allocatable :: dzurb_roof(:,:) ! roof (layer thickness) - real(r8), allocatable :: ziurb_wall(:,:) ! wall (layer interface) - real(r8), allocatable :: ziurb_roof(:,:) ! roof (layer interface) - real(r8) :: depthratio ! ratio of lake depth to standard deep lake depth - integer :: begc, endc - integer :: begl, endl - integer :: jmin_bedrock - - ! Possible values for levgrnd_class. The important thing is that, for a given column, - ! layers that are fundamentally different (e.g., soil vs bedrock) have different - ! values. This information is used in the vertical interpolation in init_interp. - ! - ! IMPORTANT: These values should not be changed lightly. e.g., try to avoid changing - ! the values assigned to LEVGRND_CLASS_STANDARD, LEVGRND_CLASS_DEEP_BEDROCK, etc. The - ! problem with changing these is that init_interp expects that layers with a value of - ! (e.g.) 1 on the source file correspond to layers with a value of 1 on the - ! destination file. So if you change the values of these constants, you either need to - ! adequately inform users of this change, or build in some translation mechanism in - ! init_interp (such as via adding more metadata to the restart file on the meaning of - ! these different values). - ! - ! The distinction between "shallow" and "deep" bedrock is not made explicitly - ! elsewhere. But, since these classes have somewhat different behavior, they are - ! distinguished explicitly here. - integer, parameter :: LEVGRND_CLASS_STANDARD = 1 - integer, parameter :: LEVGRND_CLASS_DEEP_BEDROCK = 2 - integer, parameter :: LEVGRND_CLASS_SHALLOW_BEDROCK = 3 - !------------------------------------------------------------------------ - - begc = bounds%begc; endc= bounds%endc - begl = bounds%begl; endl= bounds%endl - - SHR_ASSERT_ALL((ubound(snow_depth) == (/endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(thick_wall) == (/endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(thick_roof) == (/endl/)), errMsg(sourcefile, __LINE__)) - - ! Open surface dataset to read in data below - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! -------------------------------------------------------------------- - ! Define layer structure for soil, lakes, urban walls and roof - ! Vertical profile of snow is not initialized here - but below - ! -------------------------------------------------------------------- - - ! Soil layers and interfaces (assumed same for all non-lake patches) - ! "0" refers to soil surface and "nlevsoi" refers to the bottom of model soil - - if ( soil_layerstruct == '10SL_3.5m' ) then - do j = 1, nlevgrnd - zsoi(j) = scalez*(exp(0.5_r8*(j-0.5_r8))-1._r8) !node depths - enddo - - dzsoi(1) = 0.5_r8*(zsoi(1)+zsoi(2)) !thickness b/n two interfaces - do j = 2,nlevgrnd-1 - dzsoi(j)= 0.5_r8*(zsoi(j+1)-zsoi(j-1)) - enddo - dzsoi(nlevgrnd) = zsoi(nlevgrnd)-zsoi(nlevgrnd-1) - - zisoi(0) = 0._r8 - do j = 1, nlevgrnd-1 - zisoi(j) = 0.5_r8*(zsoi(j)+zsoi(j+1)) !interface depths - enddo - zisoi(nlevgrnd) = zsoi(nlevgrnd) + 0.5_r8*dzsoi(nlevgrnd) - - else if ( soil_layerstruct == '23SL_3.5m' )then - ! Soil layer structure that starts with standard exponential - ! and then has several evenly spaced layers, then finishes off exponential. - ! this allows the upper soil to behave as standard, but then continues - ! with higher resolution to a deeper depth, so that, for example, permafrost - ! dynamics are not lost due to an inability to resolve temperature, moisture, - ! and biogeochemical dynamics at the base of the active layer - do j = 1, toplev_equalspace - zsoi(j) = scalez*(exp(0.5_r8*(j-0.5_r8))-1._r8) !node depths - enddo - - do j = toplev_equalspace+1,toplev_equalspace + nlev_equalspace - zsoi(j) = zsoi(j-1) + thick_equal - enddo - - do j = toplev_equalspace + nlev_equalspace +1, nlevgrnd - zsoi(j) = scalez*(exp(0.5_r8*((j - nlev_equalspace)-0.5_r8))-1._r8) + nlev_equalspace * thick_equal - enddo - - dzsoi(1) = 0.5_r8*(zsoi(1)+zsoi(2)) !thickness b/n two interfaces - do j = 2,nlevgrnd-1 - dzsoi(j)= 0.5_r8*(zsoi(j+1)-zsoi(j-1)) - enddo - dzsoi(nlevgrnd) = zsoi(nlevgrnd)-zsoi(nlevgrnd-1) - - zisoi(0) = 0._r8 - do j = 1, nlevgrnd-1 - zisoi(j) = 0.5_r8*(zsoi(j)+zsoi(j+1)) !interface depths - enddo - zisoi(nlevgrnd) = zsoi(nlevgrnd) + 0.5_r8*dzsoi(nlevgrnd) - - else if ( soil_layerstruct == '49SL_10m' ) then - !scs: 10 meter soil column, nlevsoi set to 49 in clm_varpar - do j = 1,10 - dzsoi(j)= 1.e-2_r8 !10mm layers - enddo - do j = 11,19 - dzsoi(j)= 1.e-1_r8 !100 mm layers - enddo - do j = 20,nlevsoi+1 !300 mm layers - dzsoi(j)= 3.e-1_r8 - enddo - do j = nlevsoi+2,nlevgrnd !10 meter bedrock layers - dzsoi(j)= 10._r8 - enddo - - zisoi(0) = 0._r8 - do j = 1,nlevgrnd - zisoi(j)= sum(dzsoi(1:j)) - enddo - - do j = 1, nlevgrnd - zsoi(j) = 0.5*(zisoi(j-1) + zisoi(j)) - enddo - - else if ( soil_layerstruct == '20SL_8.5m' ) then - do j = 1,4 - dzsoi(j)= j*0.02_r8 ! linear increase in layer thickness of 2cm each layer - enddo - do j = 5,13 - dzsoi(j)= dzsoi(4)+(j-4)*0.04_r8 ! linear increase in layer thickness of 2cm each layer - enddo - do j = 14,nlevsoi - dzsoi(j)= dzsoi(13)+(j-13)*0.10_r8 ! linear increase in layer thickness of 2cm each layer - enddo - do j = nlevsoi+1,nlevgrnd !bedrock layers - dzsoi(j)= dzsoi(nlevsoi)+(((j-nlevsoi)*25._r8)**1.5_r8)/100._r8 ! bedrock layers - enddo - - zisoi(0) = 0._r8 - do j = 1,nlevgrnd - zisoi(j)= sum(dzsoi(1:j)) - enddo - - do j = 1, nlevgrnd - zsoi(j) = 0.5*(zisoi(j-1) + zisoi(j)) - enddo - end if - - ! define a vertical grid spacing such that it is the normal dzsoi if - ! nlevdecomp =nlevgrnd, or else 1 meter - if (use_vertsoilc) then - dzsoi_decomp = dzsoi !thickness b/n two interfaces - else - dzsoi_decomp(1) = 1. - end if - - if (masterproc) then - write(iulog, *) 'zsoi', zsoi(:) - write(iulog, *) 'zisoi: ', zisoi(:) - write(iulog, *) 'dzsoi: ', dzsoi(:) - write(iulog, *) 'dzsoi_decomp: ',dzsoi_decomp - end if - - if (nlevurb > 0) then - allocate(zurb_wall(bounds%begl:bounds%endl,nlevurb), & - zurb_roof(bounds%begl:bounds%endl,nlevurb), & - dzurb_wall(bounds%begl:bounds%endl,nlevurb), & - dzurb_roof(bounds%begl:bounds%endl,nlevurb), & - ziurb_wall(bounds%begl:bounds%endl,0:nlevurb), & - ziurb_roof(bounds%begl:bounds%endl,0:nlevurb), & - stat=ier) - if (ier /= 0) then - call shr_sys_abort(' ERROR allocation error for '//& - 'zurb_wall,zurb_roof,dzurb_wall,dzurb_roof,ziurb_wall,ziurb_roof'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - ! Column level initialization for urban wall and roof layers and interfaces - do l = bounds%begl,bounds%endl - - ! "0" refers to urban wall/roof surface and "nlevsoi" refers to urban wall/roof bottom - if (lun%urbpoi(l)) then - if (use_vancouver) then - zurb_wall(l,1) = 0.010_r8/2._r8 - zurb_wall(l,2) = zurb_wall(l,1) + 0.010_r8/2._r8 + 0.020_r8/2._r8 - zurb_wall(l,3) = zurb_wall(l,2) + 0.020_r8/2._r8 + 0.070_r8/2._r8 - zurb_wall(l,4) = zurb_wall(l,3) + 0.070_r8/2._r8 + 0.070_r8/2._r8 - zurb_wall(l,5) = zurb_wall(l,4) + 0.070_r8/2._r8 + 0.030_r8/2._r8 - - zurb_roof(l,1) = 0.010_r8/2._r8 - zurb_roof(l,2) = zurb_roof(l,1) + 0.010_r8/2._r8 + 0.010_r8/2._r8 - zurb_roof(l,3) = zurb_roof(l,2) + 0.010_r8/2._r8 + 0.010_r8/2._r8 - zurb_roof(l,4) = zurb_roof(l,3) + 0.010_r8/2._r8 + 0.010_r8/2._r8 - zurb_roof(l,5) = zurb_roof(l,4) + 0.010_r8/2._r8 + 0.030_r8/2._r8 - - dzurb_wall(l,1) = 0.010_r8 - dzurb_wall(l,2) = 0.020_r8 - dzurb_wall(l,3) = 0.070_r8 - dzurb_wall(l,4) = 0.070_r8 - dzurb_wall(l,5) = 0.030_r8 - write(iulog,*)'Total thickness of wall: ',sum(dzurb_wall(l,:)) - write(iulog,*)'Wall layer thicknesses: ',dzurb_wall(l,:) - - dzurb_roof(l,1) = 0.010_r8 - dzurb_roof(l,2) = 0.010_r8 - dzurb_roof(l,3) = 0.010_r8 - dzurb_roof(l,4) = 0.010_r8 - dzurb_roof(l,5) = 0.030_r8 - write(iulog,*)'Total thickness of roof: ',sum(dzurb_roof(l,:)) - write(iulog,*)'Roof layer thicknesses: ',dzurb_roof(l,:) - - ziurb_wall(l,0) = 0. - ziurb_wall(l,1) = dzurb_wall(l,1) - do j = 2,nlevurb - ziurb_wall(l,j) = sum(dzurb_wall(l,1:j)) - end do - write(iulog,*)'Wall layer interface depths: ',ziurb_wall(l,:) - - ziurb_roof(l,0) = 0. - ziurb_roof(l,1) = dzurb_roof(l,1) - do j = 2,nlevurb - ziurb_roof(l,j) = sum(dzurb_roof(l,1:j)) - end do - write(iulog,*)'Roof layer interface depths: ',ziurb_roof(l,:) - else if (use_mexicocity) then - zurb_wall(l,1) = 0.015_r8/2._r8 - zurb_wall(l,2) = zurb_wall(l,1) + 0.015_r8/2._r8 + 0.120_r8/2._r8 - zurb_wall(l,3) = zurb_wall(l,2) + 0.120_r8/2._r8 + 0.150_r8/2._r8 - zurb_wall(l,4) = zurb_wall(l,3) + 0.150_r8/2._r8 + 0.150_r8/2._r8 - zurb_wall(l,5) = zurb_wall(l,4) + 0.150_r8/2._r8 + 0.015_r8/2._r8 - - zurb_roof(l,1) = 0.010_r8/2._r8 - zurb_roof(l,2) = zurb_roof(l,1) + 0.010_r8/2._r8 + 0.050_r8/2._r8 - zurb_roof(l,3) = zurb_roof(l,2) + 0.050_r8/2._r8 + 0.050_r8/2._r8 - zurb_roof(l,4) = zurb_roof(l,3) + 0.050_r8/2._r8 + 0.050_r8/2._r8 - zurb_roof(l,5) = zurb_roof(l,4) + 0.050_r8/2._r8 + 0.025_r8/2._r8 - - dzurb_wall(l,1) = 0.015_r8 - dzurb_wall(l,2) = 0.120_r8 - dzurb_wall(l,3) = 0.150_r8 - dzurb_wall(l,4) = 0.150_r8 - dzurb_wall(l,5) = 0.015_r8 - write(iulog,*)'Total thickness of wall: ',sum(dzurb_wall(l,:)) - write(iulog,*)'Wall layer thicknesses: ',dzurb_wall(l,:) - - dzurb_roof(l,1) = 0.010_r8 - dzurb_roof(l,2) = 0.050_r8 - dzurb_roof(l,3) = 0.050_r8 - dzurb_roof(l,4) = 0.050_r8 - dzurb_roof(l,5) = 0.025_r8 - write(iulog,*)'Total thickness of roof: ',sum(dzurb_roof(l,:)) - write(iulog,*)'Roof layer thicknesses: ',dzurb_roof(l,:) - - ziurb_wall(l,0) = 0. - ziurb_wall(l,1) = dzurb_wall(l,1) - do j = 2,nlevurb - ziurb_wall(l,j) = sum(dzurb_wall(l,1:j)) - end do - write(iulog,*)'Wall layer interface depths: ',ziurb_wall(l,:) - - ziurb_roof(l,0) = 0. - ziurb_roof(l,1) = dzurb_roof(l,1) - do j = 2,nlevurb - ziurb_roof(l,j) = sum(dzurb_roof(l,1:j)) - end do - write(iulog,*)'Roof layer interface depths: ',ziurb_roof(l,:) - else - do j = 1, nlevurb - zurb_wall(l,j) = (j-0.5)*(thick_wall(l)/float(nlevurb)) !node depths - end do - do j = 1, nlevurb - zurb_roof(l,j) = (j-0.5)*(thick_roof(l)/float(nlevurb)) !node depths - end do - - dzurb_roof(l,1) = 0.5*(zurb_roof(l,1)+zurb_roof(l,2)) !thickness b/n two interfaces - do j = 2,nlevurb-1 - dzurb_roof(l,j)= 0.5*(zurb_roof(l,j+1)-zurb_roof(l,j-1)) - enddo - dzurb_roof(l,nlevurb) = zurb_roof(l,nlevurb)-zurb_roof(l,nlevurb-1) - - dzurb_wall(l,1) = 0.5*(zurb_wall(l,1)+zurb_wall(l,2)) !thickness b/n two interfaces - do j = 2,nlevurb-1 - dzurb_wall(l,j)= 0.5*(zurb_wall(l,j+1)-zurb_wall(l,j-1)) - enddo - dzurb_wall(l,nlevurb) = zurb_wall(l,nlevurb)-zurb_wall(l,nlevurb-1) - - ziurb_wall(l,0) = 0. - do j = 1, nlevurb-1 - ziurb_wall(l,j) = 0.5*(zurb_wall(l,j)+zurb_wall(l,j+1)) !interface depths - enddo - ziurb_wall(l,nlevurb) = zurb_wall(l,nlevurb) + 0.5*dzurb_wall(l,nlevurb) - - ziurb_roof(l,0) = 0. - do j = 1, nlevurb-1 - ziurb_roof(l,j) = 0.5*(zurb_roof(l,j)+zurb_roof(l,j+1)) !interface depths - enddo - ziurb_roof(l,nlevurb) = zurb_roof(l,nlevurb) + 0.5*dzurb_roof(l,nlevurb) - end if - end if - end do - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - - if (lun%urbpoi(l)) then - if (col%itype(c)==icol_sunwall .or. col%itype(c)==icol_shadewall) then - col%z(c,1:nlevurb) = zurb_wall(l,1:nlevurb) - col%zi(c,0:nlevurb) = ziurb_wall(l,0:nlevurb) - col%dz(c,1:nlevurb) = dzurb_wall(l,1:nlevurb) - if (nlevurb < nlevgrnd) then - col%z(c,nlevurb+1:nlevgrnd) = spval - col%zi(c,nlevurb+1:nlevgrnd) = spval - col%dz(c,nlevurb+1:nlevgrnd) = spval - end if - else if (col%itype(c)==icol_roof) then - col%z(c,1:nlevurb) = zurb_roof(l,1:nlevurb) - col%zi(c,0:nlevurb) = ziurb_roof(l,0:nlevurb) - col%dz(c,1:nlevurb) = dzurb_roof(l,1:nlevurb) - if (nlevurb < nlevgrnd) then - col%z(c,nlevurb+1:nlevgrnd) = spval - col%zi(c,nlevurb+1:nlevgrnd) = spval - col%dz(c,nlevurb+1:nlevgrnd) = spval - end if - else - col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) - col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) - col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) - end if - else if (lun%itype(l) /= istdlak) then - col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) - col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) - col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) - end if - end do - - if (nlevurb > 0) then - deallocate(zurb_wall, zurb_roof, dzurb_wall, dzurb_roof, ziurb_wall, ziurb_roof) - end if - - !----------------------------------------------- - ! Set index defining depth to bedrock - !----------------------------------------------- - - allocate(zbedrock_in(bounds%begg:bounds%endg)) - if (use_bedrock) then - call ncd_io(ncid=ncid, varname='zbedrock', flag='read', data=zbedrock_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - if (masterproc) then - call endrun( 'ERROR:: zbedrock not found on surface data set, and use_bedrock is true.'//errmsg(sourcefile, __LINE__) ) - end if - end if - - ! if use_bedrock = false, set zbedrock to lowest layer bottom interface - else - if (masterproc) write(iulog,*) 'not using use_bedrock!!' - zbedrock_in(:) = zisoi(nlevsoi) - endif - - ! determine minimum index of minimum soil depth - jmin_bedrock = 3 - do j = 3,nlevsoi - if (zisoi(j-1) < zmin_bedrock .and. zisoi(j) >= zmin_bedrock) then - jmin_bedrock = j - endif - enddo - - if (masterproc) write(iulog,*) 'jmin_bedrock: ', jmin_bedrock - - ! Determine gridcell bedrock index - do g = bounds%begg,bounds%endg - grc%nbedrock(g) = nlevsoi - do j = jmin_bedrock,nlevsoi - if (zisoi(j-1) < zbedrock_in(g) .and. zisoi(j) >= zbedrock_in(g)) then - grc%nbedrock(g) = j - end if - end do - end do - - ! Set column bedrock index - do c = begc, endc - g = col%gridcell(c) - col%nbedrock(c) = grc%nbedrock(g) - end do - - deallocate(zbedrock_in) - - !----------------------------------------------- - ! Set lake levels and layers (no interfaces) - !----------------------------------------------- - - allocate(lakedepth_in(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='LAKEDEPTH', flag='read', data=lakedepth_in, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - if (masterproc) then - write(iulog,*) 'WARNING:: LAKEDEPTH not found on surface data set. All lake columns will have lake depth', & - ' set equal to default value.' - end if - lakedepth_in(:) = spval - end if - do c = begc, endc - g = col%gridcell(c) - col%lakedepth(c) = lakedepth_in(g) - end do - deallocate(lakedepth_in) - - ! Lake layers - if (.not. use_extralakelayers) then - dzlak(1) = 0.1_r8 - dzlak(2) = 1._r8 - dzlak(3) = 2._r8 - dzlak(4) = 3._r8 - dzlak(5) = 4._r8 - dzlak(6) = 5._r8 - dzlak(7) = 7._r8 - dzlak(8) = 7._r8 - dzlak(9) = 10.45_r8 - dzlak(10)= 10.45_r8 - - zlak(1) = 0.05_r8 - zlak(2) = 0.6_r8 - zlak(3) = 2.1_r8 - zlak(4) = 4.6_r8 - zlak(5) = 8.1_r8 - zlak(6) = 12.6_r8 - zlak(7) = 18.6_r8 - zlak(8) = 25.6_r8 - zlak(9) = 34.325_r8 - zlak(10)= 44.775_r8 - else - dzlak(1) =0.1_r8 - dzlak(2) =0.25_r8 - dzlak(3) =0.25_r8 - dzlak(4) =0.25_r8 - dzlak(5) =0.25_r8 - dzlak(6) =0.5_r8 - dzlak(7) =0.5_r8 - dzlak(8) =0.5_r8 - dzlak(9) =0.5_r8 - dzlak(10) =0.75_r8 - dzlak(11) =0.75_r8 - dzlak(12) =0.75_r8 - dzlak(13) =0.75_r8 - dzlak(14) =2_r8 - dzlak(15) =2_r8 - dzlak(16) =2.5_r8 - dzlak(17) =2.5_r8 - dzlak(18) =3.5_r8 - dzlak(19) =3.5_r8 - dzlak(20) =3.5_r8 - dzlak(21) =3.5_r8 - dzlak(22) =5.225_r8 - dzlak(23) =5.225_r8 - dzlak(24) =5.225_r8 - dzlak(25) =5.225_r8 - - zlak(1) = dzlak(1)/2._r8 - do i=2,nlevlak - zlak(i) = zlak(i-1) + (dzlak(i-1)+dzlak(i))/2._r8 - end do - end if - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - - if (lun%itype(l) == istdlak) then - - if (col%lakedepth(c) == spval) then - col%lakedepth(c) = zlak(nlevlak) + 0.5_r8*dzlak(nlevlak) - col%z_lake(c,1:nlevlak) = zlak(1:nlevlak) - col%dz_lake(c,1:nlevlak) = dzlak(1:nlevlak) - - else if (col%lakedepth(c) > 1._r8 .and. col%lakedepth(c) < 5000._r8) then - - depthratio = col%lakedepth(c) / (zlak(nlevlak) + 0.5_r8*dzlak(nlevlak)) - col%z_lake(c,1) = zlak(1) - col%dz_lake(c,1) = dzlak(1) - col%dz_lake(c,2:nlevlak-1) = dzlak(2:nlevlak-1)*depthratio - col%dz_lake(c,nlevlak) = dzlak(nlevlak)*depthratio - (col%dz_lake(c,1) - dzlak(1)*depthratio) - do lev=2,nlevlak - col%z_lake(c,lev) = col%z_lake(c,lev-1) + (col%dz_lake(c,lev-1)+col%dz_lake(c,lev))/2._r8 - end do - - else if (col%lakedepth(c) > 0._r8 .and. col%lakedepth(c) <= 1._r8) then - - col%dz_lake(c,:) = col%lakedepth(c) / nlevlak; - col%z_lake(c,1) = col%dz_lake(c,1) / 2._r8; - do lev=2,nlevlak - col%z_lake(c,lev) = col%z_lake(c,lev-1) + (col%dz_lake(c,lev-1)+col%dz_lake(c,lev))/2._r8 - end do - - else - - write(iulog,*)'Bad lake depth: lakedepth: ', col%lakedepth(c) - call shr_sys_abort(errmsg(sourcefile, __LINE__)) - - end if - - col%z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) - col%zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) - col%dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) - end if - end do - - ! ------------------------------------------------------------------------ - ! Set classes of layers - ! ------------------------------------------------------------------------ - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (hasBedrock(col_itype=col%itype(c), lun_itype=lun%itype(l))) then - ! NOTE(wjs, 2015-10-17) We are assuming that points with bedrock have both - ! "shallow" and "deep" bedrock. Currently, this is not true for lake columns: - ! lakes do not distinguish between "shallow" bedrock and "normal" soil. - ! However, that was just due to an oversight that is supposed to be corrected - ! soon; so to keep things simple we assume that any point with bedrock - ! potentially has both shallow and deep bedrock. - col%levgrnd_class(c, 1:col%nbedrock(c)) = LEVGRND_CLASS_STANDARD - if (col%nbedrock(c) < nlevsoi) then - col%levgrnd_class(c, (col%nbedrock(c) + 1) : nlevsoi) = LEVGRND_CLASS_SHALLOW_BEDROCK - end if - col%levgrnd_class(c, (nlevsoi + 1) : nlevgrnd) = LEVGRND_CLASS_DEEP_BEDROCK - else - col%levgrnd_class(c, 1:nlevgrnd) = LEVGRND_CLASS_STANDARD - end if - end do - - do j = 1, nlevgrnd - do c = bounds%begc, bounds%endc - if (col%z(c,j) == spval) then - col%levgrnd_class(c,j) = ispval - end if - end do - end do - - !----------------------------------------------- - ! Set cold-start values for snow levels, snow layers and snow interfaces - !----------------------------------------------- - - call InitSnowLayers(bounds, snow_depth(bounds%begc:bounds%endc)) - - !----------------------------------------------- - ! Read in topographic index and slope - !----------------------------------------------- - - allocate(tslope(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='SLOPE', flag='read', data=tslope, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call shr_sys_abort(' ERROR: TOPOGRAPHIC SLOPE NOT on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - do c = begc,endc - g = col%gridcell(c) - ! check for near zero slopes, set minimum value - col%topo_slope(c) = max(tslope(g), 0.2_r8) - end do - deallocate(tslope) - - allocate(std(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='STD_ELEV', flag='read', data=std, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call shr_sys_abort(' ERROR: TOPOGRAPHIC STDdev (STD_ELEV) NOT on surfdata file'//& - errMsg(sourcefile, __LINE__)) - end if - do c = begc,endc - g = col%gridcell(c) - ! Topographic variables - col%topo_std(c) = std(g) - end do - deallocate(std) - - !----------------------------------------------- - ! SCA shape function defined - !----------------------------------------------- - - do c = begc,endc - l = col%landunit(c) - g = col%gridcell(c) - - if (lun%itype(l)==istice_mec .and. glc_behavior%allow_multiple_columns_grc(g)) then - ! ice_mec columns already account for subgrid topographic variability through - ! their use of multiple elevation classes; thus, to avoid double-accounting for - ! topographic variability in these columns, we ignore topo_std and use a fixed - ! value of n_melt. - col%n_melt(c) = n_melt_glcmec - else - col%n_melt(c) = 200.0/max(10.0_r8, col%topo_std(c)) - end if - - ! microtopographic parameter, units are meters (try smooth function of slope) - - slopebeta = 3._r8 - slopemax = 0.4_r8 - slope0 = slopemax**(-1._r8/slopebeta) - col%micro_sigma(c) = (col%topo_slope(c) + slope0)**(-slopebeta) - end do - - call ncd_pio_closefile(ncid) - - end subroutine initVertical - - !----------------------------------------------------------------------- - logical function hasBedrock(col_itype, lun_itype) - ! - ! !DESCRIPTION: - ! Returns true if the given column type has a representation of bedrock - i.e., a set - ! of layers at the bottom of the column that are treated fundamentally differently - ! from the upper layers. - ! - ! !USES: - use landunit_varcon, only : istice_mec, isturb_MIN, isturb_MAX - use column_varcon , only : icol_road_perv - ! - ! !ARGUMENTS: - integer, intent(in) :: col_itype ! col%itype value - integer, intent(in) :: lun_itype ! lun%itype value for the landunit on which this column sits - ! If we had an easy way to figure out which landunit a column was on based on - ! col_itype (which would be very helpful!), then we wouldn't need lun_itype. - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'hasBedrock' - !----------------------------------------------------------------------- - - ! TODO(wjs, 2015-10-17) I don't like that the logic here implicitly duplicates logic - ! elsewhere in the code. For example, if there were a change in the lake code so that - ! it no longer treated the bottom layers as bedrock, then that change would need to be - ! reflected here. One solution would be to set some has_bedrock flag in one central - ! place, and then have the science code use that. But that could get messy in the - ! science code. Another solution would be to decentralize the definition of - ! hasBedrock, so that (for example) the lake code itself sets the value for lun_itype - ! == istdlak - that way, hasBedrock(lake) would be more likely to get updated - ! correctly if the lake logic changes. - - if (lun_itype == istice_mec) then - hasBedrock = .false. - else if (lun_itype >= isturb_MIN .and. lun_itype <= isturb_MAX) then - if (col_itype == icol_road_perv) then - hasBedrock = .true. - else - hasBedrock = .false. - end if - else - hasBedrock = .true. - end if - - ! As an independent check of the above logic, assert that, at the very least, any - ! hydrologically-active column is given hasBedrock = .true. This is to try to catch - ! problems with new column types being added that aren't handled properly by the - ! above logic, since (as noted in the todo note above) there is some implicit - ! duplication of logic between this routine and other parts of the code, which is - ! dangerous. For example, if a new "urban lawn" type is added, then it should have - ! hasBedrock = .true. - and this omission will hopefully be caught by this assertion. - if (is_hydrologically_active(col_itype=col_itype, lun_itype=lun_itype)) then - SHR_ASSERT(hasBedrock, "hasBedrock should be true for all hydrologically-active columns") - end if - - end function hasBedrock - - -end module initVerticalMod diff --git a/src/main/init_hydrology.F90 b/src/main/init_hydrology.F90 deleted file mode 100644 index f03658c71a..0000000000 --- a/src/main/init_hydrology.F90 +++ /dev/null @@ -1,39 +0,0 @@ -subroutine init_hydrology( NLFilename ) -! -!DESCRIPTION -! Initialize implementation methods for different hydrology sub-modules -! This is created for unit-based sensitivity tests -! created by Jinyun Tang, Mar 22, 2014. - - ! !USES: - use spmdMod , only : masterproc, mpicom - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - - use FuncPedotransferMod, only : init_pedof - use RootBiophysMod, only : init_rootprof - use SoilWaterMovementMod, only : init_soilwater_movement - use SoilMoistStressMod, only : init_root_moist_stress -implicit none - - character(len=*), intent(IN) :: NLFilename ! Namelist filename - - !In future versions, a namelist will be created here to - !set up options for different sub-models, the namelist file - !will also be passed into this different initializing methods - !to read in their local parameters, Jinyun Tang, Mar 29, 2014 - - call init_pedof - - call init_rootprof(NLFilename) - - call init_soilwater_movement - - call init_root_moist_stress - -! remove due to circular dependency of nlfilename, read namlist -! in controlmod instead, as is done for canopyhydrology -! call init_soil_resistance - -end subroutine init_hydrology diff --git a/src/main/landunit_varcon.F90 b/src/main/landunit_varcon.F90 deleted file mode 100644 index b6ddc7cf5c..0000000000 --- a/src/main/landunit_varcon.F90 +++ /dev/null @@ -1,133 +0,0 @@ -module landunit_varcon - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing landunit indices and associated variables and routines. - ! - ! !USES: -#include "shr_assert.h" - ! - ! - ! !PUBLIC TYPES: - implicit none - private - - !------------------------------------------------------------------ - ! Initialize landunit type constants - !------------------------------------------------------------------ - - integer, parameter, public :: istsoil = 1 !soil landunit type (natural vegetation) - integer, parameter, public :: istcrop = 2 !crop landunit type - ! Landunit 3 currently unused (used to be non-multiple elevation class glacier type: istice) - integer, parameter, public :: istice_mec = 4 !land ice (multiple elevation classes) landunit type - integer, parameter, public :: istdlak = 5 !deep lake landunit type (now used for all lakes) - integer, parameter, public :: istwet = 6 !wetland landunit type (swamp, marsh, etc.) - - integer, parameter, public :: isturb_MIN = 7 !minimum urban type index - integer, parameter, public :: isturb_tbd = 7 !urban tbd landunit type - integer, parameter, public :: isturb_hd = 8 !urban hd landunit type - integer, parameter, public :: isturb_md = 9 !urban md landunit type - integer, parameter, public :: isturb_MAX = 9 !maximum urban type index - - integer, parameter, public :: max_lunit = 9 !maximum value that lun%itype can have - !(i.e., largest value in the above list) - - integer, parameter, public :: landunit_name_length = 40 ! max length of landunit names - character(len=landunit_name_length), public :: landunit_names(max_lunit) ! name of each landunit type - - ! parameters that depend on the above constants - - integer, parameter, public :: numurbl = isturb_MAX - isturb_MIN + 1 ! number of urban landunits - - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: landunit_varcon_init ! initialize constants in this module - public :: landunit_is_special ! returns true if this is a special landunit - - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: set_landunit_names ! set the landunit_names vector -!----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine landunit_varcon_init() - ! - ! !DESCRIPTION: - ! Initialize constants in landunit_varcon - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'landunit_varcon_init' - !----------------------------------------------------------------------- - - call set_landunit_names() - - end subroutine landunit_varcon_init - - !----------------------------------------------------------------------- - function landunit_is_special(ltype) result(is_special) - ! - ! !DESCRIPTION: - ! Returns true if the landunit type ltype is a special landunit; returns false otherwise - ! - ! !USES: - ! - ! !ARGUMENTS: - logical :: is_special ! function result - integer :: ltype ! landunit type of interest - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'landunit_is_special' - !----------------------------------------------------------------------- - - SHR_ASSERT((ltype >= 1 .and. ltype <= max_lunit), subname//': ltype out of bounds') - - if (ltype == istsoil .or. ltype == istcrop) then - is_special = .false. - else - is_special = .true. - end if - - end function landunit_is_special - - - !----------------------------------------------------------------------- - subroutine set_landunit_names - ! - ! !DESCRIPTION: - ! Set the landunit_names vector - ! - ! !USES: - use shr_sys_mod, only : shr_sys_abort - ! - character(len=*), parameter :: not_set = 'NOT_SET' - character(len=*), parameter :: unused = 'UNUSED' - character(len=*), parameter :: subname = 'set_landunit_names' - !----------------------------------------------------------------------- - - landunit_names(:) = not_set - - landunit_names(istsoil) = 'vegetated_or_bare_soil' - landunit_names(istcrop) = 'crop' - landunit_names(istcrop+1) = unused - landunit_names(istice_mec) = 'landice_multiple_elevation_classes' - landunit_names(istdlak) = 'deep_lake' - landunit_names(istwet) = 'wetland' - landunit_names(isturb_tbd) = 'urban_tbd' - landunit_names(isturb_hd) = 'urban_hd' - landunit_names(isturb_md) = 'urban_md' - - if (any(landunit_names == not_set)) then - call shr_sys_abort(trim(subname)//': Not all landunit names set') - end if - - end subroutine set_landunit_names - -end module landunit_varcon diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 deleted file mode 100644 index 2a4a00d5cd..0000000000 --- a/src/main/lnd2atmMod.F90 +++ /dev/null @@ -1,491 +0,0 @@ -module lnd2atmMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle lnd2atm mapping - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_megan_mod , only : shr_megan_mechcomps_n - use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. - use clm_varcon , only : rair, grav, cpair, hfus, tfrz, spval - use clm_varctl , only : iulog, use_lch4 - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - use decompMod , only : bounds_type - use subgridAveMod , only : p2g, c2g - use lnd2atmType , only : lnd2atm_type - use atm2lndType , only : atm2lnd_type - use ch4Mod , only : ch4_type - use DUSTMod , only : dust_type - use DryDepVelocity , only : drydepvel_type - use VocEmissionMod , only : vocemis_type - use CNFireEmissionsMod , only : fireemis_type - use EnergyFluxType , only : energyflux_type - use FrictionVelocityMod , only : frictionvel_type - use SolarAbsorbedType , only : solarabs_type - use SurfaceAlbedoType , only : surfalb_type - use TemperatureType , only : temperature_type - use WaterFluxType , only : waterflux_type - use WaterstateType , only : waterstate_type - use IrrigationMod , only : irrigation_type - use glcBehaviorMod , only : glc_behavior_type - use glc2lndMod , only : glc2lnd_type - use ColumnType , only : col - use LandunitType , only : lun - use GridcellType , only : grc - use landunit_varcon , only : istice_mec - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: lnd2atm - public :: lnd2atm_minimal - - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: handle_ice_runoff - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine lnd2atm_minimal(bounds, & - waterstate_inst, surfalb_inst, energyflux_inst, lnd2atm_inst) - ! - ! !DESCRIPTION: - ! Compute clm_l2a_inst component of gridcell derived type. This routine computes - ! the bare minimum of components necessary to get the first step of a - ! run started. - ! - ! !USES: - use clm_varcon, only : sb - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(waterstate_type) , intent(in) :: waterstate_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(lnd2atm_type) , intent(inout) :: lnd2atm_inst - ! - ! !LOCAL VARIABLES: - integer :: g ! index - real(r8), parameter :: amC = 12.0_r8 ! Atomic mass number for Carbon - real(r8), parameter :: amO = 16.0_r8 ! Atomic mass number for Oxygen - real(r8), parameter :: amCO2 = amC + 2.0_r8*amO ! Atomic mass number for CO2 - ! The following converts g of C to kg of CO2 - real(r8), parameter :: convertgC2kgCO2 = 1.0e-3_r8 * (amCO2/amC) - !------------------------------------------------------------------------ - - call c2g(bounds, & - waterstate_inst%h2osno_col (bounds%begc:bounds%endc), & - lnd2atm_inst%h2osno_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - do g = bounds%begg,bounds%endg - lnd2atm_inst%h2osno_grc(g) = lnd2atm_inst%h2osno_grc(g)/1000._r8 - end do - - call c2g(bounds, nlevgrnd, & - waterstate_inst%h2osoi_vol_col (bounds%begc:bounds%endc, :), & - lnd2atm_inst%h2osoi_vol_grc (bounds%begg:bounds%endg, :), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(bounds, numrad, & - surfalb_inst%albd_patch (bounds%begp:bounds%endp, :), & - lnd2atm_inst%albd_grc (bounds%begg:bounds%endg, :), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(bounds, numrad, & - surfalb_inst%albi_patch (bounds%begp:bounds%endp, :), & - lnd2atm_inst%albi_grc (bounds%begg:bounds%endg, :), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(bounds, & - energyflux_inst%eflx_lwrad_out_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%eflx_lwrad_out_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - do g = bounds%begg,bounds%endg - lnd2atm_inst%t_rad_grc(g) = sqrt(sqrt(lnd2atm_inst%eflx_lwrad_out_grc(g)/sb)) - end do - - end subroutine lnd2atm_minimal - - !------------------------------------------------------------------------ - subroutine lnd2atm(bounds, & - atm2lnd_inst, surfalb_inst, temperature_inst, frictionvel_inst, & - waterstate_inst, waterflux_inst, irrigation_inst, energyflux_inst, & - solarabs_inst, drydepvel_inst, & - vocemis_inst, fireemis_inst, dust_inst, ch4_inst, glc_behavior, & - lnd2atm_inst, & - net_carbon_exchange_grc) - ! - ! !DESCRIPTION: - ! Compute lnd2atm_inst component of gridcell derived type - ! - ! !USES: - use ch4varcon , only : ch4offline - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(surfalb_type) , intent(in) :: surfalb_inst - type(temperature_type) , intent(in) :: temperature_inst - type(frictionvel_type) , intent(in) :: frictionvel_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(irrigation_type) , intent(in) :: irrigation_inst - type(energyflux_type) , intent(in) :: energyflux_inst - type(solarabs_type) , intent(in) :: solarabs_inst - type(drydepvel_type) , intent(in) :: drydepvel_inst - type(vocemis_type) , intent(in) :: vocemis_inst - type(fireemis_type) , intent(in) :: fireemis_inst - type(dust_type) , intent(in) :: dust_inst - type(ch4_type) , intent(in) :: ch4_inst - type(glc_behavior_type) , intent(in) :: glc_behavior - type(lnd2atm_type) , intent(inout) :: lnd2atm_inst - real(r8) , intent(in) :: net_carbon_exchange_grc( bounds%begg: ) ! net carbon exchange between land and atmosphere, positive for source (gC/m2/s) - ! - ! !LOCAL VARIABLES: - integer :: c, g ! indices - real(r8) :: qflx_ice_runoff_col(bounds%begc:bounds%endc) ! total column-level ice runoff - real(r8) :: eflx_sh_ice_to_liq_grc(bounds%begg:bounds%endg) ! sensible heat flux generated from the ice to liquid conversion, averaged to gridcell - real(r8), parameter :: amC = 12.0_r8 ! Atomic mass number for Carbon - real(r8), parameter :: amO = 16.0_r8 ! Atomic mass number for Oxygen - real(r8), parameter :: amCO2 = amC + 2.0_r8*amO ! Atomic mass number for CO2 - ! The following converts g of C to kg of CO2 - real(r8), parameter :: convertgC2kgCO2 = 1.0e-3_r8 * (amCO2/amC) - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(net_carbon_exchange_grc) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call handle_ice_runoff(bounds, waterflux_inst, glc_behavior, & - melt_non_icesheet_ice_runoff = lnd2atm_inst%params%melt_non_icesheet_ice_runoff, & - qflx_ice_runoff_col = qflx_ice_runoff_col(bounds%begc:bounds%endc), & - qflx_liq_from_ice_col = lnd2atm_inst%qflx_liq_from_ice_col(bounds%begc:bounds%endc), & - eflx_sh_ice_to_liq_col = lnd2atm_inst%eflx_sh_ice_to_liq_col(bounds%begc:bounds%endc)) - - !---------------------------------------------------- - ! lnd -> atm - !---------------------------------------------------- - - ! First, compute the "minimal" set of fields. - call lnd2atm_minimal(bounds, & - waterstate_inst, surfalb_inst, energyflux_inst, lnd2atm_inst) - - call p2g(bounds, & - temperature_inst%t_ref2m_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%t_ref2m_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - waterstate_inst%q_ref2m_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%q_ref2m_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - frictionvel_inst%u10_clm_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%u_ref10m_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - energyflux_inst%taux_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%taux_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - energyflux_inst%tauy_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%tauy_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - waterflux_inst%qflx_evap_tot_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%qflx_evap_tot_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(bounds, & - solarabs_inst%fsa_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%fsa_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(bounds, & - frictionvel_inst%fv_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%fv_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(bounds, & - frictionvel_inst%ram1_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%ram1_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g( bounds, & - energyflux_inst%eflx_sh_tot_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%eflx_sh_tot_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity',c2l_scale_type='urbanf',l2g_scale_type='unity') - call c2g( bounds, & - energyflux_inst%eflx_sh_precip_conversion_col (bounds%begc:bounds%endc), & - lnd2atm_inst%eflx_sh_precip_conversion_grc (bounds%begg:bounds%endg), & - c2l_scale_type='urbanf', l2g_scale_type='unity') - call c2g( bounds, & - lnd2atm_inst%eflx_sh_ice_to_liq_col(bounds%begc:bounds%endc), & - eflx_sh_ice_to_liq_grc(bounds%begg:bounds%endg), & - c2l_scale_type='urbanf', l2g_scale_type='unity') - do g = bounds%begg, bounds%endg - lnd2atm_inst%eflx_sh_tot_grc(g) = lnd2atm_inst%eflx_sh_tot_grc(g) + & - lnd2atm_inst%eflx_sh_precip_conversion_grc(g) + & - eflx_sh_ice_to_liq_grc(g) - & - energyflux_inst%eflx_dynbal_grc(g) - enddo - - call p2g(bounds, & - energyflux_inst%eflx_lh_tot_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%eflx_lh_tot_grc (bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - do g = bounds%begg, bounds%endg - lnd2atm_inst%net_carbon_exchange_grc(g) = & - net_carbon_exchange_grc(g) - end do - if (use_lch4) then - if (.not. ch4offline) then - ! Adjust flux of CO2 by the net conversion of mineralizing C to CH4 - do g = bounds%begg,bounds%endg - ! nem is in g C/m2/sec - lnd2atm_inst%net_carbon_exchange_grc(g) = & - lnd2atm_inst%net_carbon_exchange_grc(g) + lnd2atm_inst%nem_grc(g) - end do - end if - end if - ! Convert from gC/m2/s to kgCO2/m2/s - do g = bounds%begg,bounds%endg - lnd2atm_inst%net_carbon_exchange_grc(g) = & - lnd2atm_inst%net_carbon_exchange_grc(g)*convertgC2kgCO2 - end do - - ! drydepvel - if ( n_drydep > 0 .and. drydep_method == DD_XLND ) then - call p2g(bounds, n_drydep, & - drydepvel_inst%velocity_patch (bounds%begp:bounds%endp, :), & - lnd2atm_inst%ddvel_grc (bounds%begg:bounds%endg, :), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - endif - - ! voc emission flux - if (shr_megan_mechcomps_n>0) then - call p2g(bounds, shr_megan_mechcomps_n, & - vocemis_inst%vocflx_patch(bounds%begp:bounds%endp,:), & - lnd2atm_inst%flxvoc_grc (bounds%begg:bounds%endg,:), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - end if - - ! fire emissions fluxes - if (shr_fire_emis_mechcomps_n>0) then - call p2g(bounds, shr_fire_emis_mechcomps_n, & - -fireemis_inst%fireflx_patch(bounds%begp:bounds%endp,:), & - lnd2atm_inst%fireflx_grc (bounds%begg:bounds%endg,:), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - call p2g(bounds, & - fireemis_inst%ztop_patch (bounds%begp:bounds%endp), & - lnd2atm_inst%fireztop_grc(bounds%begg:bounds%endg), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - endif - - ! dust emission flux - call p2g(bounds, ndst, & - dust_inst%flx_mss_vrt_dst_patch(bounds%begp:bounds%endp, :), & - lnd2atm_inst%flxdst_grc (bounds%begg:bounds%endg, :), & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - - ! ch4 flux - if (use_lch4) then - call c2g( bounds, & - ch4_inst%ch4_surf_flux_tot_col (bounds%begc:bounds%endc), & - lnd2atm_inst%flux_ch4_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'unity', l2g_scale_type='unity' ) - end if - - !---------------------------------------------------- - ! lnd -> rof - !---------------------------------------------------- - - call c2g( bounds, & - waterflux_inst%qflx_surf_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_qsur_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - call c2g( bounds, & - waterflux_inst%qflx_drain_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_qsub_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - do c = bounds%begc, bounds%endc - if (col%active(c)) then - ! It's not entirely appropriate to put qflx_liq_from_ice_col into - ! qflx_qrgwl_col, since this isn't necessarily just glaciers, wetlands and - ! lakes. But since we put the liquid portion of snow capping into - ! qflx_qrgwl_col, it seems reasonable to put qflx_liq_from_ice_col there as - ! well. - waterflux_inst%qflx_qrgwl_col(c) = waterflux_inst%qflx_qrgwl_col(c) + & - lnd2atm_inst%qflx_liq_from_ice_col(c) - - ! qflx_runoff is the sum of a number of terms, including qflx_qrgwl. Since we - ! are adjusting qflx_qrgwl above, we need to adjust qflx_runoff analogously. - waterflux_inst%qflx_runoff_col(c) = waterflux_inst%qflx_runoff_col(c) + & - lnd2atm_inst%qflx_liq_from_ice_col(c) - end if - end do - - call c2g( bounds, & - waterflux_inst%qflx_qrgwl_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_qgwl_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - call c2g( bounds, & - waterflux_inst%qflx_runoff_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - do g = bounds%begg, bounds%endg - lnd2atm_inst%qflx_rofliq_qgwl_grc(g) = lnd2atm_inst%qflx_rofliq_qgwl_grc(g) - waterflux_inst%qflx_liq_dynbal_grc(g) - lnd2atm_inst%qflx_rofliq_grc(g) = lnd2atm_inst%qflx_rofliq_grc(g) - waterflux_inst%qflx_liq_dynbal_grc(g) - enddo - - call c2g( bounds, & - waterflux_inst%qflx_h2osfc_surf_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_h2osfc_grc(bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - call c2g( bounds, & - waterflux_inst%qflx_drain_perched_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofliq_drain_perched_grc(bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - call c2g( bounds, & - irrigation_inst%qflx_irrig_col (bounds%begc:bounds%endc), & - lnd2atm_inst%qirrig_grc(bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - - call c2g( bounds, & - qflx_ice_runoff_col(bounds%begc:bounds%endc), & - lnd2atm_inst%qflx_rofice_grc(bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - do g = bounds%begg, bounds%endg - lnd2atm_inst%qflx_rofice_grc(g) = lnd2atm_inst%qflx_rofice_grc(g) - waterflux_inst%qflx_ice_dynbal_grc(g) - enddo - - ! calculate total water storage for history files - ! first set tws to gridcell total endwb - ! second add river storage as gridcell average depth (1.e-3 converts [m3/km2] to [mm]) - ! TODO - this was in BalanceCheckMod - not sure where it belongs? - - call c2g( bounds, & - waterstate_inst%endwb_col(bounds%begc:bounds%endc), & - waterstate_inst%tws_grc (bounds%begg:bounds%endg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - do g = bounds%begg, bounds%endg - waterstate_inst%tws_grc(g) = waterstate_inst%tws_grc(g) + atm2lnd_inst%volr_grc(g) / grc%area(g) * 1.e-3_r8 - enddo - - end subroutine lnd2atm - - !----------------------------------------------------------------------- - subroutine handle_ice_runoff(bounds, waterflux_inst, glc_behavior, & - melt_non_icesheet_ice_runoff, & - qflx_ice_runoff_col, qflx_liq_from_ice_col, eflx_sh_ice_to_liq_col) - ! - ! !DESCRIPTION: - ! Take column-level ice runoff and divide it between (a) ice runoff, and (b) liquid - ! runoff with a compensating negative sensible heat flux. - ! - ! The rationale here is: Ice runoff is largely meant to represent a crude - ! parameterization of iceberg calving. Iceberg calving is mainly appropriate in - ! regions where an ice sheet terminates at the land-ocean boundary. Elsewhere, in - ! reality, we expect most ice runoff to flow downstream and melt before it reaches the - ! ocean. Furthermore, sending ice runoff directly to the ocean can lead to runaway sea - ! ice growth in some regions (around the Canadian archipelago, and possibly in more - ! wide-spread regions of the Arctic Ocean); melting this ice before it reaches the - ! ocean avoids this problem. - ! - ! If the river model were able to melt ice, then we might not need this routine. - ! - ! Note that this routine does NOT handle ice runoff generated via the dynamic - ! landunits adjustment fluxes (i.e., the fluxes that compensate for a difference in - ! ice content between the pre- and post-dynamic landunit areas). This is partly - ! because those gridcell-level dynamic landunits adjustment fluxes do not fit well - ! with this column-based infrastructure, and partly because either method of handling - ! these fluxes (i.e., sending an ice runoff or sending a liquid runoff with a - ! negative sensible heat flux) seems equally justifiable. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(waterflux_type), intent(in) :: waterflux_inst - type(glc_behavior_type), intent(in) :: glc_behavior - logical, intent(in) :: melt_non_icesheet_ice_runoff - real(r8), intent(out) :: qflx_ice_runoff_col( bounds%begc: ) ! total column-level ice runoff (mm H2O /s) - real(r8), intent(out) :: qflx_liq_from_ice_col( bounds%begc: ) ! liquid runoff from converted ice runoff (mm H2O /s) - real(r8), intent(out) :: eflx_sh_ice_to_liq_col( bounds%begc: ) ! sensible heat flux generated from the ice to liquid conversion (W/m2) (+ to atm) - - ! - ! !LOCAL VARIABLES: - integer :: c, l, g - logical :: do_conversion - - character(len=*), parameter :: subname = 'handle_ice_runoff' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(qflx_ice_runoff_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(qflx_liq_from_ice_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(eflx_sh_ice_to_liq_col) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do c = bounds%begc, bounds%endc - if (col%active(c)) then - qflx_ice_runoff_col(c) = waterflux_inst%qflx_ice_runoff_snwcp_col(c) + & - waterflux_inst%qflx_ice_runoff_xs_col(c) - qflx_liq_from_ice_col(c) = 0._r8 - eflx_sh_ice_to_liq_col(c) = 0._r8 - end if - end do - - if (melt_non_icesheet_ice_runoff) then - do c = bounds%begc, bounds%endc - if (col%active(c)) then - l = col%landunit(c) - g = col%gridcell(c) - do_conversion = .false. - if (lun%itype(l) /= istice_mec) then - do_conversion = .true. - else ! istice_mec - if (glc_behavior%ice_runoff_melted_grc(g)) then - do_conversion = .true. - else - do_conversion = .false. - end if - end if - if (do_conversion) then - ! ice to liquid absorbs energy, so results in a negative heat flux to atm - ! Note that qflx_ice_runoff_col is in mm H2O/s, which is the same as kg - ! m-2 s-1, so we can simply multiply by hfus. - eflx_sh_ice_to_liq_col(c) = -qflx_ice_runoff_col(c) * hfus - qflx_liq_from_ice_col(c) = qflx_ice_runoff_col(c) - qflx_ice_runoff_col(c) = 0._r8 - end if - end if - end do - end if - - end subroutine handle_ice_runoff - - -end module lnd2atmMod diff --git a/src/main/lnd2atmType.F90 b/src/main/lnd2atmType.F90 deleted file mode 100644 index 023608a4a7..0000000000 --- a/src/main/lnd2atmType.F90 +++ /dev/null @@ -1,329 +0,0 @@ -module lnd2atmType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle atm2lnd, lnd2atm mapping - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. - use clm_varcon , only : spval - use clm_varctl , only : iulog, use_lch4 - use shr_megan_mod , only : shr_megan_mechcomps_n - use shr_fire_emis_mod,only : shr_fire_emis_mechcomps_n - use seq_drydep_mod, only : n_drydep, drydep_method, DD_XLND - ! - ! !PUBLIC TYPES: - implicit none - private - - type, public :: lnd2atm_params_type - ! true => ice runoff generated from non-glacier columns and glacier columns outside - ! icesheet regions is converted to liquid, with an appropriate sensible heat flux - logical, public :: melt_non_icesheet_ice_runoff - end type lnd2atm_params_type - - ! ---------------------------------------------------- - ! land -> atmosphere variables structure - !---------------------------------------------------- - type, public :: lnd2atm_type - type(lnd2atm_params_type) :: params - - ! lnd->atm - real(r8), pointer :: t_rad_grc (:) => null() ! radiative temperature (Kelvin) - real(r8), pointer :: t_ref2m_grc (:) => null() ! 2m surface air temperature (Kelvin) - real(r8), pointer :: q_ref2m_grc (:) => null() ! 2m surface specific humidity (kg/kg) - real(r8), pointer :: u_ref10m_grc (:) => null() ! 10m surface wind speed (m/sec) - real(r8), pointer :: h2osno_grc (:) => null() ! snow water (mm H2O) - real(r8), pointer :: h2osoi_vol_grc (:,:) => null() ! volumetric soil water (0~watsat, m3/m3, nlevgrnd) (for dust model) - real(r8), pointer :: albd_grc (:,:) => null() ! (numrad) surface albedo (direct) - real(r8), pointer :: albi_grc (:,:) => null() ! (numrad) surface albedo (diffuse) - real(r8), pointer :: taux_grc (:) => null() ! wind stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy_grc (:) => null() ! wind stress: n-s (kg/m/s**2) - real(r8), pointer :: eflx_lh_tot_grc (:) => null() ! total latent HF (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_grc (:) => null() ! total sensible HF (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_precip_conversion_grc(:) => null() ! sensible HF from precipitation conversion (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_ice_to_liq_col(:) => null() ! sensible HF generated from conversion of ice runoff to liquid (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lwrad_out_grc (:) => null() ! IR (longwave) radiation (W/m**2) - real(r8), pointer :: qflx_evap_tot_grc (:) => null() ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: fsa_grc (:) => null() ! solar rad absorbed (total) (W/m**2) - real(r8), pointer :: net_carbon_exchange_grc(:) => null() ! net CO2 flux (kg CO2/m**2/s) [+ to atm] - real(r8), pointer :: nem_grc (:) => null() ! gridcell average net methane correction to CO2 flux (g C/m^2/s) - real(r8), pointer :: ram1_grc (:) => null() ! aerodynamical resistance (s/m) - real(r8), pointer :: fv_grc (:) => null() ! friction velocity (m/s) (for dust model) - real(r8), pointer :: flxdst_grc (:,:) => null() ! dust flux (size bins) - real(r8), pointer :: ddvel_grc (:,:) => null() ! dry deposition velocities - real(r8), pointer :: flxvoc_grc (:,:) => null() ! VOC flux (size bins) - real(r8), pointer :: fireflx_grc (:,:) => null() ! Wild Fire Emissions - real(r8), pointer :: fireztop_grc (:) => null() ! Wild Fire Emissions vertical distribution top - real(r8), pointer :: flux_ch4_grc (:) => null() ! net CH4 flux (kg C/m**2/s) [+ to atm] - ! lnd->rof - real(r8), pointer :: qflx_rofliq_grc (:) => null() ! rof liq forcing - real(r8), pointer :: qflx_rofliq_qsur_grc (:) => null() ! rof liq -- surface runoff component - real(r8), pointer :: qflx_rofliq_qsub_grc (:) => null() ! rof liq -- subsurface runoff component - real(r8), pointer :: qflx_rofliq_qgwl_grc (:) => null() ! rof liq -- glacier, wetland and lakes water balance residual component - real(r8), pointer :: qflx_rofliq_h2osfc_grc (:) => null() ! rof liq -- surface water runoff component - real(r8), pointer :: qflx_rofliq_drain_perched_grc (:) => null() ! rof liq -- perched water table runoff component - real(r8), pointer :: qflx_rofice_grc (:) => null() ! rof ice forcing - real(r8), pointer :: qflx_liq_from_ice_col(:) => null() ! liquid runoff from converted ice runoff - real(r8), pointer :: qirrig_grc (:) => null() ! irrigation flux - - contains - - procedure, public :: Init - procedure, private :: ReadNamelist - procedure, private :: InitAllocate - procedure, private :: InitHistory - - end type lnd2atm_type - !------------------------------------------------------------------------ - - interface lnd2atm_params_type - module procedure lnd2atm_params_constructor - end interface lnd2atm_params_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !----------------------------------------------------------------------- - function lnd2atm_params_constructor(melt_non_icesheet_ice_runoff) & - result(params) - ! - ! !DESCRIPTION: - ! Creates a new instance of lnd2atm_params_type - ! - ! !ARGUMENTS: - type(lnd2atm_params_type) :: params ! function result - logical, intent(in) :: melt_non_icesheet_ice_runoff - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'lnd2atm_params_type' - !----------------------------------------------------------------------- - - params%melt_non_icesheet_ice_runoff = melt_non_icesheet_ice_runoff - - end function lnd2atm_params_constructor - - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, NLFilename) - - class(lnd2atm_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - - call this%InitAllocate(bounds) - call this%ReadNamelist(NLFilename) - call this%InitHistory(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize lnd2atm derived type - ! - ! !ARGUMENTS: - class (lnd2atm_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - real(r8) :: ival = 0.0_r8 ! initial value - integer :: begc, endc - integer :: begg, endg - !------------------------------------------------------------------------ - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - allocate(this%t_rad_grc (begg:endg)) ; this%t_rad_grc (:) =ival - allocate(this%t_ref2m_grc (begg:endg)) ; this%t_ref2m_grc (:) =ival - allocate(this%q_ref2m_grc (begg:endg)) ; this%q_ref2m_grc (:) =ival - allocate(this%u_ref10m_grc (begg:endg)) ; this%u_ref10m_grc (:) =ival - allocate(this%h2osno_grc (begg:endg)) ; this%h2osno_grc (:) =ival - allocate(this%h2osoi_vol_grc (begg:endg,1:nlevgrnd)) ; this%h2osoi_vol_grc (:,:) =ival - allocate(this%albd_grc (begg:endg,1:numrad)) ; this%albd_grc (:,:) =ival - allocate(this%albi_grc (begg:endg,1:numrad)) ; this%albi_grc (:,:) =ival - allocate(this%taux_grc (begg:endg)) ; this%taux_grc (:) =ival - allocate(this%tauy_grc (begg:endg)) ; this%tauy_grc (:) =ival - allocate(this%eflx_lwrad_out_grc (begg:endg)) ; this%eflx_lwrad_out_grc (:) =ival - allocate(this%eflx_sh_tot_grc (begg:endg)) ; this%eflx_sh_tot_grc (:) =ival - allocate(this%eflx_sh_precip_conversion_grc(begg:endg)) ; this%eflx_sh_precip_conversion_grc(:) = ival - allocate(this%eflx_sh_ice_to_liq_col(begc:endc)) ; this%eflx_sh_ice_to_liq_col(:) = ival - allocate(this%eflx_lh_tot_grc (begg:endg)) ; this%eflx_lh_tot_grc (:) =ival - allocate(this%qflx_evap_tot_grc (begg:endg)) ; this%qflx_evap_tot_grc (:) =ival - allocate(this%fsa_grc (begg:endg)) ; this%fsa_grc (:) =ival - allocate(this%net_carbon_exchange_grc(begg:endg)) ; this%net_carbon_exchange_grc(:) =ival - allocate(this%nem_grc (begg:endg)) ; this%nem_grc (:) =ival - allocate(this%ram1_grc (begg:endg)) ; this%ram1_grc (:) =ival - allocate(this%fv_grc (begg:endg)) ; this%fv_grc (:) =ival - allocate(this%flxdst_grc (begg:endg,1:ndst)) ; this%flxdst_grc (:,:) =ival - allocate(this%flux_ch4_grc (begg:endg)) ; this%flux_ch4_grc (:) =ival - allocate(this%qflx_rofliq_grc (begg:endg)) ; this%qflx_rofliq_grc (:) =ival - allocate(this%qflx_rofliq_qsur_grc (begg:endg)) ; this%qflx_rofliq_qsur_grc (:) =ival - allocate(this%qflx_rofliq_qsub_grc (begg:endg)) ; this%qflx_rofliq_qsub_grc (:) =ival - allocate(this%qflx_rofliq_qgwl_grc (begg:endg)) ; this%qflx_rofliq_qgwl_grc (:) =ival - allocate(this%qflx_rofliq_h2osfc_grc (begg:endg)) ; this%qflx_rofliq_h2osfc_grc (:) =ival - allocate(this%qflx_rofliq_drain_perched_grc (begg:endg)) ; this%qflx_rofliq_drain_perched_grc (:) =ival - allocate(this%qflx_rofice_grc (begg:endg)) ; this%qflx_rofice_grc (:) =ival - allocate(this%qflx_liq_from_ice_col(begc:endc)) ; this%qflx_liq_from_ice_col(:) = ival - allocate(this%qirrig_grc (begg:endg)) ; this%qirrig_grc (:) =ival - - if (shr_megan_mechcomps_n>0) then - allocate(this%flxvoc_grc(begg:endg,1:shr_megan_mechcomps_n)); this%flxvoc_grc(:,:)=ival - endif - if (shr_fire_emis_mechcomps_n>0) then - allocate(this%fireflx_grc(begg:endg,1:shr_fire_emis_mechcomps_n)) - this%fireflx_grc = ival - allocate(this%fireztop_grc(begg:endg)) - this%fireztop_grc = ival - endif - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - allocate(this%ddvel_grc(begg:endg,1:n_drydep)); this%ddvel_grc(:,:)=ival - end if - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine ReadNamelist(this, NLFilename) - ! - ! !DESCRIPTION: - ! Read the lnd2atm namelist - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - class(lnd2atm_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - ! temporary variables corresponding to the components of lnd2atm_params_type - logical :: melt_non_icesheet_ice_runoff - - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - character(len=*), parameter :: nmlname = 'lnd2atm_inparm' - - character(len=*), parameter :: subname = 'ReadNamelist' - !----------------------------------------------------------------------- - - namelist /lnd2atm_inparm/ melt_non_icesheet_ice_runoff - - ! Initialize namelist variables to defaults - melt_non_icesheet_ice_runoff = .false. - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=lnd2atm_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast(melt_non_icesheet_ice_runoff, mpicom) - - if (masterproc) then - write(iulog,*) - write(iulog,*) nmlname, ' settings:' - write(iulog,nml=lnd2atm_inparm) - write(iulog,*) ' ' - end if - - this%params = lnd2atm_params_type( & - melt_non_icesheet_ice_runoff = melt_non_icesheet_ice_runoff) - - end subroutine ReadNamelist - - !----------------------------------------------------------------------- - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(lnd2atm_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begg, endg - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - this%eflx_sh_tot_grc(begg:endg) = 0._r8 - call hist_addfld1d (fname='FSH_TO_COUPLER', units='W/m^2', & - avgflag='A', & - long_name='sensible heat sent to coupler & - &(includes corrections for land use change, rain/snow conversion and conversion of ice runoff to liquid)', & - ptr_lnd=this%eflx_sh_tot_grc) - - this%eflx_sh_ice_to_liq_col(begc:endc) = 0._r8 - call hist_addfld1d (fname='FSH_RUNOFF_ICE_TO_LIQ', units='W/m^2', & - avgflag='A', & - long_name='sensible heat flux generated from conversion of ice runoff to liquid', & - ptr_col=this%eflx_sh_ice_to_liq_col) - - this%qflx_rofliq_grc(begg:endg) = 0._r8 - call hist_addfld1d (fname='QRUNOFF_TO_COUPLER', units='mm/s', & - avgflag='A', & - long_name='total liquid runoff sent to coupler (includes corrections for land use change)', & - ptr_lnd=this%qflx_rofliq_grc) - - this%qflx_rofice_grc(begg:endg) = 0._r8 - call hist_addfld1d (fname='QRUNOFF_ICE_TO_COUPLER', units='mm/s', & - avgflag='A', & - long_name='total ice runoff sent to coupler (includes corrections for land use change)', & - ptr_lnd=this%qflx_rofice_grc) - - this%qflx_liq_from_ice_col(begc:endc) = 0._r8 - call hist_addfld1d (fname='QRUNOFF_ICE_TO_LIQ', units='mm/s', & - avgflag='A', & - long_name='liquid runoff from converted ice runoff', & - ptr_col=this%qflx_liq_from_ice_col, default='inactive') - - this%net_carbon_exchange_grc(begg:endg) = spval - call hist_addfld1d(fname='FCO2', units='kgCO2/m2/s', & - avgflag='A', & - long_name='CO2 flux to atmosphere (+ to atm)', & - ptr_lnd=this%net_carbon_exchange_grc, & - default='inactive') - - if (use_lch4) then - this%flux_ch4_grc(begg:endg) = 0._r8 - call hist_addfld1d (fname='FCH4', units='kgC/m2/s', & - avgflag='A', long_name='Gridcell surface CH4 flux to atmosphere (+ to atm)', & - ptr_lnd=this%flux_ch4_grc) - - this%nem_grc(begg:endg) = spval - call hist_addfld1d (fname='NEM', units='gC/m2/s', & - avgflag='A', long_name='Gridcell net adjustment to net carbon exchange passed to atm. for methane production', & - ptr_lnd=this%nem_grc) - end if - - end subroutine InitHistory - -end module lnd2atmType diff --git a/src/main/lnd2glcMod.F90 b/src/main/lnd2glcMod.F90 deleted file mode 100644 index 9de7eba3f3..0000000000 --- a/src/main/lnd2glcMod.F90 +++ /dev/null @@ -1,304 +0,0 @@ -module lnd2glcMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handle arrays used for exchanging data from land model to glc - ! For now glc datais send and received on the lnd grid and decomposition. - ! - ! The fields sent from the lnd component to the glc component via - ! the coupler are labeled 's2x', or sno to coupler. - ! The fields received by the lnd component from the glc component - ! via the coupler are labeled 'x2s', or coupler to sno. - ! 'Sno' is a misnomer in that the exchanged data are related to - ! the ice beneath the snow, not the snow itself. But by CESM convention, - ! 'ice' refers to sea ice, not land ice. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : get_proc_bounds, bounds_type - use domainMod , only : ldomain - use clm_varpar , only : maxpatch_glcmec - use clm_varctl , only : iulog - use clm_varcon , only : spval, tfrz, namec - use column_varcon , only : col_itype_to_icemec_class - use landunit_varcon , only : istice_mec, istsoil - use abortutils , only : endrun - use GlacierSurfaceMassBalanceMod, only : glacier_smb_type - use TemperatureType , only : temperature_type - use LandunitType , only : lun - use ColumnType , only : col - use TopoMod , only : topo_type - ! - ! !PUBLIC TYPES: - implicit none - private - save - - ! land -> glc variables structure - type, public :: lnd2glc_type - real(r8), pointer :: tsrf_grc(:,:) => null() - real(r8), pointer :: topo_grc(:,:) => null() - real(r8), pointer :: qice_grc(:,:) => null() - - contains - - procedure, public :: Init - procedure, public :: update_lnd2glc - procedure, private :: InitAllocate - procedure, private :: InitHistory - - end type lnd2glc_type - - ! !PUBLIC MEMBER FUNCTIONS: - - ! The following is public simply to support unit testing, and should not generally be - ! called from outside this module. - ! - ! Note that it is not a type-bound procedure, because it doesn't actually involve the - ! lnd2glc_type. This suggests that perhaps it belongs in some other module. - public :: bareland_normalization ! compute normalization factor for fluxes from the bare land portion of the grid cell - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(lnd2glc_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate(bounds) - call this%InitHistory(bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize land variables required by glc - ! - ! !USES: - use clm_varcon , only : spval - use histFileMod, only : hist_addfld1d - ! - ! !ARGUMENTS: - class(lnd2glc_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begg,endg - !------------------------------------------------------------------------ - - begg = bounds%begg; endg = bounds%endg - - allocate(this%tsrf_grc(begg:endg,0:maxpatch_glcmec)) ; this%tsrf_grc(:,:)=0.0_r8 - allocate(this%topo_grc(begg:endg,0:maxpatch_glcmec)) ; this%topo_grc(:,:)=0.0_r8 - allocate(this%qice_grc(begg:endg,0:maxpatch_glcmec)) ; this%qice_grc(:,:)=0.0_r8 - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !USES: - use histFileMod, only : hist_addfld1d,hist_addfld2d - ! - ! !ARGUMENTS: - class(lnd2glc_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: data2dptr(:,:) - integer :: begg, endg - !--------------------------------------------------------------------- - - begg = bounds%begg; endg = bounds%endg - - this%qice_grc(begg:endg,0:maxpatch_glcmec) = spval - ! For this and the following fields, set up a pointer to the field simply for the - ! sake of changing the indexing, so that levels start with an index of 1, as is - ! assumed by histFileMod - so levels go 1:(nec+1) rather than 0:nec - data2dptr => this%qice_grc(:,0:maxpatch_glcmec) - call hist_addfld2d (fname='QICE_FORC', units='mm/s', type2d='elevclas', & - avgflag='A', long_name='qice forcing sent to GLC', & - ptr_lnd=data2dptr, default='inactive') - - this%tsrf_grc(begg:endg,0:maxpatch_glcmec) = spval - data2dptr => this%tsrf_grc(:,0:maxpatch_glcmec) - call hist_addfld2d (fname='TSRF_FORC', units='K', type2d='elevclas', & - avgflag='A', long_name='surface temperature sent to GLC', & - ptr_lnd=data2dptr, default='inactive') - - this%topo_grc(begg:endg,0:maxpatch_glcmec) = spval - data2dptr => this%topo_grc(:,0:maxpatch_glcmec) - call hist_addfld2d (fname='TOPO_FORC', units='m', type2d='elevclas', & - avgflag='A', long_name='topograephic height sent to GLC', & - ptr_lnd=data2dptr, default='inactive') - - end subroutine InitHistory - - - !------------------------------------------------------------------------------ - subroutine update_lnd2glc(this, bounds, num_do_smb_c, filter_do_smb_c, & - temperature_inst, glacier_smb_inst, topo_inst, init) - ! - ! !DESCRIPTION: - ! Assign values to lnd2glc+ - ! - ! !ARGUMENTS: - class(lnd2glc_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_do_smb_c ! number of columns in filter_do_smb_c - integer , intent(in) :: filter_do_smb_c(:) ! column filter: columns where smb calculations are performed - type(temperature_type) , intent(in) :: temperature_inst - type(glacier_smb_type) , intent(in) :: glacier_smb_inst - type(topo_type) , intent(in) :: topo_inst - logical , intent(in) :: init ! if true=>only set a subset of fields - ! - ! !LOCAL VARIABLES: - integer :: c, l, g, n, fc ! indices - logical, allocatable :: fields_assigned(:,:) ! tracks whether fields have already been assigned for each index [begg:endg, 0:maxpatch_glcmec] - real(r8) :: flux_normalization ! factor by which fluxes should be normalized - - character(len=*), parameter :: subname = 'update_lnd2glc' - !------------------------------------------------------------------------------ - - ! Initialize to reasonable defaults - - this%qice_grc(bounds%begg : bounds%endg, :) = 0._r8 - this%tsrf_grc(bounds%begg : bounds%endg, :) = tfrz - this%topo_grc(bounds%begg : bounds%endg, :) = 0._r8 - - ! Fill the lnd->glc data on the clm grid - - allocate(fields_assigned(bounds%begg:bounds%endg, 0:maxpatch_glcmec)) - fields_assigned(:,:) = .false. - - do fc = 1, num_do_smb_c - c = filter_do_smb_c(fc) - l = col%landunit(c) - g = col%gridcell(c) - - ! Set vertical index and a flux normalization, based on whether the column in question is glacier or vegetated. - if (lun%itype(l) == istice_mec) then - n = col_itype_to_icemec_class(col%itype(c)) - flux_normalization = 1.0_r8 - else if (lun%itype(l) == istsoil) then - n = 0 !0-level index (bareland information) - flux_normalization = bareland_normalization(c) - else - ! Other landunit types do not pass information in the lnd2glc fields. - ! Note: for this to be acceptable, we need virtual vegetated columns in any grid - ! cell that is made up solely of glacier plus some other special landunit (e.g., - ! glacier + lake) -- otherwise CISM wouldn't have any information for the non- - ! glaciated portion of the grid cell. - cycle - end if - - ! Make sure we haven't already assigned the coupling fields for this point - ! (this could happen, for example, if there were multiple columns in the - ! istsoil landunit, which we aren't prepared to handle) - if (fields_assigned(g,n)) then - write(iulog,*) subname//' ERROR: attempt to assign coupling fields twice for the same index.' - write(iulog,*) 'One possible cause is having multiple columns in the istsoil landunit,' - write(iulog,*) 'which this routine cannot handle.' - write(iulog,*) 'g, n = ', g, n - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - - ! Send surface temperature, topography, and SMB flux (qice) to coupler. - ! t_soisno and topo_col are valid even in initialization, so tsrf and topo - ! are set here regardless of the value of init. But qflx_glcice is not valid - ! until the run loop; thus, in initialization, we will use the default value - ! for qice, as set above. - fields_assigned(g,n) = .true. - this%tsrf_grc(g,n) = temperature_inst%t_soisno_col(c,1) - this%topo_grc(g,n) = topo_inst%topo_col(c) - if (.not. init) then - this%qice_grc(g,n) = glacier_smb_inst%qflx_glcice_col(c) * flux_normalization - - ! Check for bad values of qice - if ( abs(this%qice_grc(g,n)) > 1.0_r8) then - write(iulog,*) 'WARNING: qice out of bounds: g, n, qice =', g, n, this%qice_grc(g,n) - end if - end if - - end do - - deallocate(fields_assigned) - - end subroutine update_lnd2glc - - !----------------------------------------------------------------------- - real(r8) function bareland_normalization(c) - ! - ! !DESCRIPTION: - ! Compute normalization factor for fluxes from the bare land portion of the grid - ! cell. Fluxes should be multiplied by this factor before being sent to CISM. - ! - ! The point of this is: CISM effectively has two land cover types: glaciated and - ! bare. CLM, on the other hand, subdivides the bare land portion of the grid cell into - ! multiple landunits. However, we currently don't do any sort of averaging of - ! quantities computed in the different "bare land" landunits - instead, we simply send - ! the values computed in the natural vegetated landunit - these fluxes (like SMB) are - ! 0 in the other landunits. To achieve conservation, we need to normalize these - ! natural veg. fluxes by the fraction of the "bare land" area accounted for by the - ! natural veg. landunit. - ! - ! For example, consider a grid cell that is: - ! 60% glacier_mec - ! 30% natural veg - ! 10% lake - ! - ! According to CISM, this grid cell is 60% icesheet, 40% "bare land". Now suppose CLM - ! has an SMB flux of 1m in the natural veg landunit. If we simply sent 1m of ice to - ! CISM, conservation would be broken, since it would also apply 1m of ice to the 10% - ! of the grid cell that CLM says is lake. So, instead, we must multiply the 1m of ice - ! by (0.3/0.4), thus "spreading out" the SMB from the natural veg. landunit, so that - ! 0.75m of ice is grown throughout the bare land portion of CISM. - ! - ! Note: If the non-glaciated area of the grid cell is 0, then we arbitrarily return a - ! normalization factor of 1.0, in order to avoid divide-by-zero errors. - ! - ! Note: We currently aren't careful about how we would handle things if there are - ! multiple columns within the vegetated landunit. If that possibility were introduced, - ! this code - as well as the code in update_clm_s2x - may need to be reworked somewhat. - ! - ! !USES: - use subgridWeightsMod , only : get_landunit_weight - ! - ! !ARGUMENTS: - integer, intent(in) :: c ! column index - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - real(r8) :: area_glacier ! fractional area of the glacier_mec landunit in this grid cell - real(r8) :: area_this_col ! fractional area of column c in the grid cell - - real(r8), parameter :: tol = 1.e-13_r8 ! tolerance for checking subgrid weight equality - character(len=*), parameter :: subname = 'bareland_normalization' - !----------------------------------------------------------------------- - - g = col%gridcell(c) - - area_glacier = get_landunit_weight(g, istice_mec) - - if (abs(area_glacier - 1.0_r8) < tol) then - ! If the whole grid cell is glacier, then the normalization factor is arbitrary; - ! set it to 1 so we don't do any normalization in this case - bareland_normalization = 1.0_r8 - else - area_this_col = col%wtgcell(c) - bareland_normalization = area_this_col / (1.0_r8 - area_glacier) - end if - - end function bareland_normalization - -end module lnd2glcMod - diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in deleted file mode 100644 index 6de8acb363..0000000000 --- a/src/main/ncdio_pio.F90.in +++ /dev/null @@ -1,2419 +0,0 @@ -module ncdio_pio - - !----------------------------------------------------------------------- - !BOP - ! - ! !MODULE: ncdio_pioMod - ! - ! !DESCRIPTION: - ! Generic interfaces to write fields to netcdf files for CLM - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, i4=>shr_kind_i4, shr_kind_cl - use shr_infnan_mod , only : nan => shr_infnan_nan, isnan => shr_infnan_isnan, assignment(=) - use shr_sys_mod , only : shr_sys_abort - use shr_file_mod , only : shr_file_getunit, shr_file_freeunit - use shr_string_mod , only : shr_string_toUpper - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc, mpicom, iam, npes - use spmdMod , only : MPI_REAL8, MPI_INTEGER, MPI_LOGICAL - use clm_varcon , only : spval,ispval, grlnd, nameg, namel, namec, namep - use clm_varctl , only : single_column, iulog - use shr_sys_mod , only : shr_sys_flush - use decompMod , only : get_clmlevel_gsize,get_clmlevel_gsmap - use perf_mod , only : t_startf, t_stopf - use fileutils , only : getavu, relavu - use mct_mod , only : mct_gsMap, mct_gsMap_lsize, mct_gsMap_gsize, mct_gsMap_orderedPoints - use pio , only : file_desc_t, io_desc_t, iosystem_desc_t - use pio , only : pio_bcast_error, pio_char, pio_clobber, pio_closefile, pio_createfile, pio_def_dim - use pio , only : pio_def_var, pio_double, pio_enddef, pio_get_att, pio_get_var, pio_global, pio_initdecomp - use pio , only : pio_inq_att, pio_inq_dimid, pio_inq_dimlen, pio_inq_dimname, pio_inq_vardimid, pio_inq_varid - use pio , only : pio_inq_varname, pio_inq_varndims, pio_inquire, pio_int, pio_internal_error - use pio , only : pio_noclobber, pio_noerr, pio_nofill, pio_nowrite, pio_offset_kind, pio_openfile - use pio , only : pio_put_att, pio_put_var, pio_read_darray, pio_real, pio_seterrorhandling - use pio , only : pio_setframe, pio_unlimited, pio_write, pio_write_darray, var_desc_t - use pio , only : pio_iotask_rank, PIO_REARR_SUBSET, PIO_REARR_BOX - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - ! - public :: check_var ! determine if variable is on netcdf file - public :: check_att ! check if attribute is on file - public :: check_dim ! validity check on dimension - public :: ncd_pio_openfile ! open a file - public :: ncd_pio_createfile ! create a new file - public :: ncd_pio_closefile ! close a file - public :: ncd_pio_init ! called from clm_comp - public :: ncd_enddef ! end define mode - public :: ncd_putatt ! put attribute - public :: ncd_getatt ! get attribute - public :: ncd_defdim ! define dimension - public :: ncd_inqdid ! inquire dimension id - public :: ncd_inqdname ! inquire dimension name - public :: ncd_inqdlen ! inquire dimension length - public :: ncd_inqfdims ! inquire file dimnesions - public :: ncd_defvar ! define variables - public :: ncd_inqvid ! inquire variable id - public :: ncd_inqvname ! inquire variable name - public :: ncd_inqvdims ! inquire variable ndims - public :: ncd_inqvdids ! inquire variable dimids - public :: ncd_inqvdlen ! inquire variable dimension size - public :: ncd_inqvdname ! inquire variable dimension name - public :: ncd_io ! write local data - - integer,parameter,public :: ncd_int = pio_int - integer,parameter,public :: ncd_log =-pio_int - integer,parameter,public :: ncd_float = pio_real - integer,parameter,public :: ncd_double = pio_double - integer,parameter,public :: ncd_char = pio_char - integer,parameter,public :: ncd_global = pio_global - integer,parameter,public :: ncd_write = pio_write - integer,parameter,public :: ncd_nowrite = pio_nowrite - integer,parameter,public :: ncd_clobber = pio_clobber - integer,parameter,public :: ncd_noclobber = pio_noclobber - integer,parameter,public :: ncd_nofill = pio_nofill - integer,parameter,public :: ncd_unlimited = pio_unlimited - - ! PIO types needed for ncdio_pio interface calls - public file_desc_t - public var_desc_t - - ! - ! !PRIVATE MEMBER FUNCTIONS: - ! - interface ncd_defvar - module procedure ncd_defvar_bynf - module procedure ncd_defvar_bygrid - end interface - - interface ncd_putatt - module procedure ncd_putatt_int - module procedure ncd_putatt_real - module procedure ncd_putatt_char - end interface - - interface ncd_getatt - module procedure ncd_getatt_char - module procedure ncd_getatt_int - end interface ncd_getatt - - interface ncd_io - module procedure ncd_io_char_var0_start_glob - - !DIMS 0 - module procedure ncd_io_{DIMS}d_log_glob - - !DIMS 0,1,2,3 - !TYPE int,double - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - !DIMS 0,1,2 - !TYPE text - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - !TYPE int,double - !DIMS 1,2,3 - module procedure ncd_io_{DIMS}d_{TYPE} - - !TYPE logical - !DIMS 1 - module procedure ncd_io_{DIMS}d_{TYPE} - end interface - - interface ncd_inqvdlen - module procedure ncd_inqvdlen_byDesc - module procedure ncd_inqvdlen_byName - end interface - - interface ncd_inqvdname - module procedure ncd_inqvdname_byDesc - module procedure ncd_inqvdname_byName - end interface - - private :: ncd_getiodesc ! obtain iodesc - private :: scam_field_offsets ! get offset to proper lat/lon gridcell for SCAM - - integer,parameter,private :: debug = 0 ! local debug level - - integer , parameter , public :: max_string_len = 256 ! length of strings - real(r8), parameter , public :: fillvalue = 1.e36_r8 ! fill value for netcdf fields - - integer, public :: io_type - integer :: io_netcdf_format - type(iosystem_desc_t), pointer, public :: pio_subsystem - - type iodesc_plus_type - character(len=64) :: name - type(IO_desc_t) :: iodesc - integer :: type - integer :: ndims - integer :: dims(4) - integer :: dimids(4) - end type iodesc_plus_type - integer,parameter ,private :: max_iodesc = 100 - integer ,private :: num_iodesc = 0 - type(iodesc_plus_type) ,private, target :: iodesc_list(max_iodesc) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine ncd_pio_init() - ! - ! !DESCRIPTION: - ! Initial PIO - ! - ! !USES: - use shr_pio_mod , only : shr_pio_getiosys, shr_pio_getiotype, shr_pio_getioformat - use clm_varctl , only : inst_name - !----------------------------------------------------------------------- - - PIO_subsystem => shr_pio_getiosys(inst_name) - io_type = shr_pio_getiotype(inst_name) - io_netcdf_format = shr_pio_getioformat(inst_name) - end subroutine ncd_pio_init - - !----------------------------------------------------------------------- - subroutine ncd_pio_openfile(file, fname, mode) - ! - ! !DESCRIPTION: - ! Open a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: file ! Output PIO file handle - character(len=*) , intent(in) :: fname ! Input filename to open - integer , intent(in) :: mode ! file mode - ! - ! !LOCAL VARIABLES: - integer :: ierr - !----------------------------------------------------------------------- - - ierr = pio_openfile(pio_subsystem, file, io_type, fname, mode) - - if(ierr/= PIO_NOERR) then - call shr_sys_abort('ncd_pio_openfile ERROR: Failed to open file') - else if(pio_iotask_rank(pio_subsystem)==0 .and. masterproc) then - write(iulog,*) 'Opened existing file ', trim(fname), file%fh - end if - - end subroutine ncd_pio_openfile - - !----------------------------------------------------------------------- - subroutine ncd_pio_closefile(file) - ! - ! !DESCRIPTION: - ! Close a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: file ! PIO file handle to close - !----------------------------------------------------------------------- - - call pio_closefile(file) - - end subroutine ncd_pio_closefile - - !----------------------------------------------------------------------- - subroutine ncd_pio_createfile(file, fname, avoid_pnetcdf) - ! - ! !DESCRIPTION: - ! Create a new NetCDF file with PIO - ! - ! !USES: - use pio, only : pio_iotype_pnetcdf, pio_iotype_netcdf,pio_iotask_rank - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: file ! PIO file descriptor - character(len=*) , intent(in) :: fname ! File name to create - - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - logical, intent(in), optional :: avoid_pnetcdf - ! - ! !LOCAL VARIABLES: - logical :: l_avoid_pnetcdf ! local version of avoid_pnetcdf - integer :: my_io_type - integer :: ierr - !----------------------------------------------------------------------- - - l_avoid_pnetcdf = .false. - if (present(avoid_pnetcdf)) then - l_avoid_pnetcdf = avoid_pnetcdf - end if - - my_io_type = io_type - if (l_avoid_pnetcdf) then - if (my_io_type == pio_iotype_pnetcdf) then - my_io_type = pio_iotype_netcdf - if(pio_iotask_rank(pio_subsystem)==0 .and. masterproc) then - write(iulog,*) 'Workaround for bugz 1730: creating' - write(iulog,*) trim(fname) - write(iulog,*) 'with type netcdf instead of pnetcdf' - end if - end if - end if - - ierr = pio_createfile(pio_subsystem, file, my_io_type, fname, ior(PIO_CLOBBER,io_netcdf_format)) - - if(ierr/= PIO_NOERR) then - call shr_sys_abort( ' ncd_pio_createfile ERROR: Failed to open file to write: '//trim(fname)) - else if(pio_iotask_rank(pio_subsystem)==0 .and. masterproc) then - write(iulog,*) 'Opened file ', trim(fname), ' to write', file%fh - end if - - end subroutine ncd_pio_createfile - - !----------------------------------------------------------------------- - subroutine check_var(ncid, varname, vardesc, readvar, print_err ) - ! - ! !DESCRIPTION: - ! Check if variable is on netcdf file - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=*) , intent(in) :: varname ! Varible name to check - type(Var_desc_t) , intent(out) :: vardesc ! Output variable descriptor - logical , intent(out) :: readvar ! If variable exists or not - logical, optional , intent(in) :: print_err ! If should print about error - ! - ! !LOCAL VARIABLES: - integer :: ret ! return value - logical :: log_err ! if should log error - character(len=*),parameter :: subname='check_var' ! subroutine name - !----------------------------------------------------------------------- - - - if ( present(print_err) )then - log_err = print_err - else - log_err = .true. - end if - readvar = .true. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ret = PIO_inq_varid (ncid, varname, vardesc) - if (ret /= PIO_noerr) then - readvar = .false. - if (masterproc .and. log_err) & - write(iulog,*) subname//': variable ',trim(varname),' is not on dataset' - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - end subroutine check_var - - !----------------------------------------------------------------------- - subroutine check_att(ncid, varid, attrib, att_found) - ! - ! !DESCRIPTION: - ! Check if attribute is on file - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - logical ,intent(out) :: att_found ! true if the attribute was found - ! - ! !LOCAL VARIABLES: - integer :: att_type ! attribute type - integer(pio_offset_kind) :: att_len ! attribute length - integer :: status - - character(len=*), parameter :: subname = 'check_att' - !----------------------------------------------------------------------- - - att_found = .true. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - status = PIO_inq_att(ncid, varid, trim(attrib), att_type, att_len) - if (status /= PIO_noerr) then - att_found = .false. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - end subroutine check_att - - !----------------------------------------------------------------------- - subroutine check_dim(ncid, dimname, value, msg) - ! - ! !DESCRIPTION: - ! Validity check on dimension - ! - ! !ARGUMENTS: - class(file_desc_t),intent(in) :: ncid ! PIO file handle - character(len=*) , intent(in) :: dimname ! Dimension name - integer, intent(in) :: value ! Expected dimension size - - character(len=*), intent(in), optional :: msg ! Optional additional message printed upon error - ! - ! !LOCAL VARIABLES: - integer :: dimid, dimlen ! temporaries - integer :: status ! error code - character(len=*),parameter :: subname='check_dim' ! subroutine name - !----------------------------------------------------------------------- - - status = pio_inq_dimid (ncid, trim(dimname), dimid) - status = pio_inq_dimlen (ncid, dimid, dimlen) - if (dimlen /= value) then - write(iulog,*) subname//' ERROR: mismatch of input dimension ',dimlen, & - ' with expected value ',value,' for variable ',trim(dimname) - if (present(msg)) then - write(iulog,'(a)') msg - end if - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_dim - - !----------------------------------------------------------------------- - subroutine ncd_enddef(ncid) - ! - ! !DESCRIPTION: - ! enddef netcdf file - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - ! - ! !LOCAL VARIABLES: - integer :: status ! error status - !----------------------------------------------------------------------- - - status = PIO_enddef(ncid) - - end subroutine ncd_enddef - - !----------------------------------------------------------------------- - subroutine ncd_inqdid(ncid,name,dimid,dimexist) - ! - ! !DESCRIPTION: - ! inquire on a dimension id - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! dimension name - integer , intent(out):: dimid ! dimension id - logical,optional , intent(out):: dimexist ! if this dimension exists or not - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - if ( present(dimexist) )then - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - end if - status = PIO_inq_dimid(ncid,name,dimid) - if ( present(dimexist) )then - if ( status == PIO_NOERR)then - dimexist = .true. - else - dimexist = .false. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - end if - - end subroutine ncd_inqdid - - !----------------------------------------------------------------------- - subroutine ncd_inqdlen(ncid,dimid,len,name) - ! - ! !DESCRIPTION: - ! Gets the length of the given dimension - ! - ! If 'name' is absent, then 'dimid' is used as an input: the dimension id to inquire. - ! If 'name' is present, then it gives the name of the dimension to inquire, and - ! 'dimid' is set to the ID associated with this dimension. - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - integer , intent(inout) :: dimid ! dimension id - integer , intent(out) :: len ! dimension len - character(len=*), optional, intent(in) :: name ! dimension name - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - if ( present(name) )then - call ncd_inqdid(ncid,name,dimid) - end if - len = -1 - status = PIO_inq_dimlen(ncid,dimid,len) - - end subroutine ncd_inqdlen - - !----------------------------------------------------------------------- - subroutine ncd_inqdname(ncid,dimid,dname) - ! - ! !DESCRIPTION: - ! inquire dim name - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(in) :: dimid ! dimension id - character(len=*) , intent(out):: dname ! dimension name - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_inq_dimname(ncid,dimid,dname) - - end subroutine ncd_inqdname - - !----------------------------------------------------------------------- - subroutine ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout):: ncid - logical , intent(out) :: isgrid2d - integer , intent(out) :: ni - integer , intent(out) :: nj - integer , intent(out) :: ns - ! - ! !LOCAL VARIABLES: - integer :: dimid ! netCDF id - integer :: ier ! error status - character(len=32) :: subname = 'ncd_inqfdims' ! subroutine name - !----------------------------------------------------------------------- - - if (single_column) then - ni = 1 - nj = 1 - ns = 1 - isgrid2d = .true. - RETURN - end if - - ni = 0 - nj = 0 - - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ier = pio_inq_dimid (ncid, 'lon', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'lat', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'lsmlon', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'lsmlat', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'ni', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'nj', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'gridcell', dimid) - if (ier == PIO_NOERR) then - ier = pio_inq_dimlen(ncid, dimid, ni) - if (ier == PIO_NOERR) nj = 1 - end if - - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - if (ni == 0 .or. nj == 0) then - write(iulog,*) trim(subname),' ERROR: ni,nj = ',ni,nj,' cannot be zero ' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - - if (nj == 1) then - isgrid2d = .false. - else - isgrid2d = .true. - end if - - ns = ni*nj - - end subroutine ncd_inqfdims - - !----------------------------------------------------------------------- - subroutine ncd_inqvid(ncid,name,varid,vardesc,readvar) - ! - ! !DESCRIPTION: - ! Inquire on a variable ID - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! variable name - integer , intent(out) :: varid ! variable id - type(Var_desc_t) , intent(out) :: vardesc ! variable descriptor - logical, optional , intent(out) :: readvar ! does variable exist - ! - ! !LOCAL VARIABLES: - integer :: ret ! return code - character(len=*),parameter :: subname='ncd_inqvid' ! subroutine name - !----------------------------------------------------------------------- - - if (present(readvar)) then - readvar = .false. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ret = PIO_inq_varid(ncid,name,vardesc) - if (ret /= PIO_noerr) then - if (masterproc) write(iulog,*) subname//': variable ',trim(name),' is not on dataset' - readvar = .false. - else - readvar = .true. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - else - ret = PIO_inq_varid(ncid,name,vardesc) - endif - varid = vardesc%varid - - end subroutine ncd_inqvid - - !----------------------------------------------------------------------- - subroutine ncd_inqvdims(ncid,ndims,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable dimensions - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(out) :: ndims ! variable ndims - type(Var_desc_t) , intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - ndims = -1 - status = PIO_inq_varndims(ncid,vardesc,ndims) - - end subroutine ncd_inqvdims - - !----------------------------------------------------------------------- - subroutine ncd_inqvname(ncid,varid,vname,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable name - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(in) :: varid ! variable id - character(len=*) , intent(out) :: vname ! variable vname - type(Var_desc_t) , intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - vname = '' - status = PIO_inq_varname(ncid,vardesc,vname) - - end subroutine ncd_inqvname - - !----------------------------------------------------------------------- - subroutine ncd_inqvdids(ncid,dids,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable dimension ids - ! - ! !ARGUMENTS: - class(file_desc_t),intent(in) :: ncid ! netcdf file id - integer ,intent(out) :: dids(:) ! variable dids - type(Var_desc_t) ,intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - dids = -1 - status = PIO_inq_vardimid(ncid,vardesc,dids) - - end subroutine ncd_inqvdids - - !----------------------------------------------------------------------- - subroutine ncd_inqvdlen_byDesc(ncid,vardesc,dimnum,dlen,err_code) - ! - ! !DESCRIPTION: - ! inquire size of one of a variable's dimensions, given a vardesc - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this routine - ! returns the size of the dimnum'th dimension. - ! - ! If there is an error condition, dlen will be -1, and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - type(Var_desc_t) ,intent(inout) :: vardesc ! variable descriptor - integer ,intent(in) :: dimnum ! dimension number to query - integer ,intent(out) :: dlen ! length of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - integer :: ndims ! number of dimensions - integer, allocatable :: dimids(:) ! dimension IDs - - integer, parameter :: dlen_invalid = -1 - integer, parameter :: error_none = 0 - integer, parameter :: error_dimnum_out_of_range = 1 - !----------------------------------------------------------------------- - - err_code = error_none - - call ncd_inqvdims(ncid, ndims, vardesc) - - if (dimnum > 0 .and. dimnum <= ndims) then - allocate(dimids(ndims)) - call ncd_inqvdids(ncid, dimids, vardesc) - call ncd_inqdlen(ncid, dimids(dimnum), dlen) - deallocate(dimids) - else - dlen = dlen_invalid - err_code = error_dimnum_out_of_range - end if - - end subroutine ncd_inqvdlen_byDesc - - - !----------------------------------------------------------------------- - subroutine ncd_inqvdlen_byName(ncid,varname,dimnum,dlen,err_code) - ! - ! !DESCRIPTION: - ! inquire size of one of a variable's dimensions, given a variable name - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this routine - ! returns the size of the dimnum'th dimension. - ! - ! If there is an error condition, dlen will be -1, and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! 11: variable not found - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) ,intent(in) :: varname ! variable name - integer ,intent(in) :: dimnum ! dimension number to query - integer ,intent(out) :: dlen ! length of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - type(Var_desc_t) :: vardesc ! variable descriptor - logical :: readvar ! whether the variable was found - integer, parameter :: dlen_invalid = -1 - integer, parameter :: error_variable_not_found = 11 - !----------------------------------------------------------------------- - - call check_var(ncid, varname, vardesc, readvar) - if (readvar) then - call ncd_inqvdlen_byDesc(ncid, vardesc, dimnum, dlen, err_code) - else - dlen = dlen_invalid - err_code = error_variable_not_found - end if - - end subroutine ncd_inqvdlen_byName - - !----------------------------------------------------------------------- - subroutine ncd_inqvdname_byDesc(ncid,vardesc,dimnum,dname,err_code) - ! - ! !DESCRIPTION: - ! Inquire name of one of a variable's dimensions, given a vardesc - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this - ! routine returns the name of the dimnum'th dimension. - ! - ! If there is an error condition, dname will be ' ', and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - type(Var_desc_t) ,intent(inout) :: vardesc ! variable descriptor - integer ,intent(in) :: dimnum ! dimension number to query - character(len=*) ,intent(out) :: dname ! name of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - integer :: ndims ! number of dimensions - integer, allocatable :: dimids(:) ! dimension IDs - - character(len=*), parameter :: dname_invalid = ' ' - integer, parameter :: error_none = 0 - integer, parameter :: error_dimnum_out_of_range = 1 - - character(len=*), parameter :: subname = 'ncd_inqvdname_byDesc' - !----------------------------------------------------------------------- - - err_code = error_none - - call ncd_inqvdims(ncid, ndims, vardesc) - - if (dimnum > 0 .and. dimnum <= ndims) then - allocate(dimids(ndims)) - call ncd_inqvdids(ncid, dimids, vardesc) - call ncd_inqdname(ncid, dimids(dimnum), dname) - deallocate(dimids) - else - dname = dname_invalid - err_code = error_dimnum_out_of_range - end if - - end subroutine ncd_inqvdname_byDesc - - !----------------------------------------------------------------------- - subroutine ncd_inqvdname_byName(ncid,varname,dimnum,dname,err_code) - ! - ! !DESCRIPTION: - ! Inquire name of one of a variable's dimensions, given a variable name - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this - ! routine returns the name of the dimnum'th dimension. - ! - ! If there is an error condition, dname will be ' ', and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! 11: variable not found - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) ,intent(in) :: varname ! variable name - integer ,intent(in) :: dimnum ! dimension number to query - character(len=*) ,intent(out) :: dname ! name of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - type(Var_desc_t) :: vardesc ! variable descriptor - logical :: readvar ! whether the variable was found - character(len=*), parameter :: dname_invalid = ' ' - integer, parameter :: error_variable_not_found = 11 - - character(len=*), parameter :: subname = 'ncd_inqvdname_byName' - !----------------------------------------------------------------------- - - call check_var(ncid, varname, vardesc, readvar) - if (readvar) then - call ncd_inqvdname_byDesc(ncid, vardesc, dimnum, dname, err_code) - else - dname = dname_invalid - err_code = error_variable_not_found - end if - - end subroutine ncd_inqvdname_byName - - - !----------------------------------------------------------------------- - subroutine ncd_putatt_int(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put integer attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - integer ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_put_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_putatt_int - - !----------------------------------------------------------------------- - subroutine ncd_putatt_char(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put character attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_put_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_putatt_char - - !----------------------------------------------------------------------- - subroutine ncd_putatt_real(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put real attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - real(r8) ,intent(in) :: value ! netcdf attrib value - integer ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - real*4 :: value4 - !----------------------------------------------------------------------- - - value4 = value - - if (xtype == pio_double) then - status = PIO_put_att(ncid,varid,trim(attrib),value) - else - status = PIO_put_att(ncid,varid,trim(attrib),value4) - endif - - end subroutine ncd_putatt_real - - !----------------------------------------------------------------------- - subroutine ncd_getatt_char(ncid,varid,attrib,value) - ! - ! !DESCRIPTION: - ! get a character attribute - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(out) :: value ! netcdf attrib value - ! - ! !LOCAL VARIABLES: - integer :: status - - character(len=*), parameter :: subname = 'ncd_getatt_char' - !----------------------------------------------------------------------- - - status = PIO_get_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_getatt_char - - !----------------------------------------------------------------------- - subroutine ncd_getatt_int(ncid,varid,attrib,value) - ! - ! !DESCRIPTION: - ! get an integer attribute - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - integer ,intent(out) :: value ! netcdf attrib value - ! - ! !LOCAL VARIABLES: - integer :: status - - character(len=*), parameter :: subname = 'ncd_getatt_int' - !----------------------------------------------------------------------- - - status = PIO_get_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_getatt_int - - - !----------------------------------------------------------------------- - subroutine ncd_defdim(ncid,attrib,value,dimid) - ! - ! !DESCRIPTION: - ! define dimension - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - character(len=*) , intent(in) :: attrib ! netcdf attrib - integer , intent(in) :: value ! netcdf attrib value - integer , intent(out):: dimid ! netcdf dimension id - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = pio_def_dim(ncid,attrib,value,dimid) - - end subroutine ncd_defdim - - !----------------------------------------------------------------------- - subroutine ncd_defvar_bynf(ncid, varname, xtype, ndims, dimid, varid, & - long_name, units, cell_method, missing_value, fill_value, & - imissing_value, ifill_value, comment, flag_meanings, & - flag_values, nvalid_range ) - ! - ! !DESCRIPTION: - ! Define a netcdf variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! external type - integer , intent(in) :: ndims ! number of dims - integer , intent(inout) :: varid ! returned var id - integer , intent(in), optional :: dimid(:) ! dimids - character(len=*) , intent(in), optional :: long_name ! attribute - character(len=*) , intent(in), optional :: units ! attribute - character(len=*) , intent(in), optional :: cell_method ! attribute - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! !LOCAL VARIABLES: - integer :: n ! indices - integer :: ldimid(4) ! local dimid - integer :: dimid0(1) ! local dimid - integer :: status ! error status - integer :: lxtype ! local external type (in case logical variable) - type(var_desc_t) :: vardesc ! local vardesc - character(len=128) :: dimname ! temporary - character(len=256) :: str ! temporary - character(len=*),parameter :: subname='ncd_defvar_bynf' ! subroutine name - !----------------------------------------------------------------------- - - varid = -1 - - dimid0 = 0 - ldimid = 0 - if (present(dimid)) then - ldimid(1:ndims) = dimid(1:ndims) - else ! ndims must be zero if dimid not present - if (ndims /= 0) then - write(iulog,*) subname//' ERROR: dimid not supplied and ndims ne 0 ',trim(varname),ndims - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - endif - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - if (masterproc .and. debug > 1) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - write(iulog,*) subname//' ',trim(varname),lxtype,ndims,ldimid(1:ndims) - endif - - if (ndims > 0) then - status = pio_inq_dimname(ncid,ldimid(ndims),dimname) - end if - - ! Define variable - if (present(dimid)) then - status = PIO_def_var(ncid,trim(varname),lxtype,dimid(1:ndims),vardesc) - else - status = PIO_def_var(ncid,trim(varname),lxtype,dimid0 ,vardesc) - endif - varid = vardesc%varid - - ! - ! Add attributes - ! - if (present(long_name)) then - call ncd_putatt(ncid, varid, 'long_name', trim(long_name)) - end if - if (present(flag_values)) then - status = PIO_put_att(ncid,varid,'flag_values',flag_values) - if ( .not. present(flag_meanings)) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_values set -- but not flag_meanings"//errMsg(sourcefile, __LINE__)) - end if - end if - if (present(flag_meanings)) then - if ( .not. present(flag_values)) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings set -- but not flag_values"//errMsg(sourcefile, __LINE__) ) - end if - if ( size(flag_values) /= size(flag_meanings) ) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings and flag_values dimension different"//errMsg(sourcefile, __LINE__)) - end if - str = flag_meanings(1) - do n = 1, size(flag_meanings) - if ( index(flag_meanings(n), ' ') /= 0 )then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings has an invalid space in it"//errMsg(sourcefile, __LINE__) ) - end if - if ( n > 1 ) str = trim(str)//" "//flag_meanings(n) - end do - status = PIO_put_att(ncid,varid,'flag_meanings', trim(str) ) - end if - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(cell_method)) then - str = 'time: ' // trim(cell_method) - call ncd_putatt(ncid, varid, 'cell_methods', trim(str)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - end subroutine ncd_defvar_bynf - - !----------------------------------------------------------------------- - subroutine ncd_defvar_bygrid(ncid, varname, xtype, & - dim1name, dim2name, dim3name, dim4name, dim5name, & - long_name, units, cell_method, missing_value, fill_value, & - imissing_value, ifill_value, switchdim, comment, & - flag_meanings, flag_values, nvalid_range ) - ! - ! !DESCRIPTION: - ! Define a netcdf variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! external type - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: dim3name ! dimension name - character(len=*) , intent(in), optional :: dim4name ! dimension name - character(len=*) , intent(in), optional :: dim5name ! dimension name - character(len=*) , intent(in), optional :: long_name ! attribute - character(len=*) , intent(in), optional :: units ! attribute - character(len=*) , intent(in), optional :: cell_method ! attribute - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - logical , intent(in), optional :: switchdim ! true=> permute dim1 and dim2 for output - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! !LOCAL VARIABLES: - integer :: n ! indices - integer :: ndims ! dimension counter - integer :: dimid(5) ! dimension ids - integer :: varid ! variable id - integer :: itmp ! temporary - character(len=256) :: str ! temporary - character(len=*),parameter :: subname='ncd_defvar_bygrid' ! subroutine name - !----------------------------------------------------------------------- - - dimid(:) = 0 - - ! Determine dimension ids for variable - - if (present(dim1name)) call ncd_inqdid(ncid, dim1name, dimid(1)) - if (present(dim2name)) call ncd_inqdid(ncid, dim2name, dimid(2)) - if (present(dim3name)) call ncd_inqdid(ncid, dim3name, dimid(3)) - if (present(dim4name)) call ncd_inqdid(ncid, dim4name, dimid(4)) - if (present(dim5name)) call ncd_inqdid(ncid, dim5name, dimid(5)) - - ! Permute dim1 and dim2 if necessary - - if (present(switchdim)) then - itmp = dimid(2) - dimid(2) = dimid(1) - dimid(1) = itmp - end if - - ! Define variable - - ndims = 0 - if (present(dim1name)) then - do n = 1, size(dimid) - if (dimid(n) /= 0) ndims = ndims + 1 - end do - end if - - call ncd_defvar_bynf(ncid,varname,xtype,ndims,dimid,varid, & - long_name=long_name, units=units, cell_method=cell_method, & - missing_value=missing_value, fill_value=fill_value, & - imissing_value=imissing_value, ifill_value=ifill_value, & - comment=comment, flag_meanings=flag_meanings, & - flag_values=flag_values, nvalid_range=nvalid_range ) - - end subroutine ncd_defvar_bygrid - - !------------------------------------------------------------------------ - subroutine ncd_io_char_var0_start_glob(vardesc, data, flag, ncid, start ) - ! - ! !DESCRIPTION: - ! netcdf I/O of global character array with start indices input - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - type(var_desc_t) , intent(in) :: vardesc ! local vardesc pointer - character(len=*) , intent(inout) :: data ! raw data for this index - integer , intent(in) :: start(:) ! output bounds - ! - ! !LOCAL VARIABLES: - integer :: status ! error code - character(len=*),parameter :: subname='ncd_io_char_var0_start_glob' - !----------------------------------------------------------------------- - - if (flag == 'read') then - - status = pio_get_var(ncid, vardesc, start, data ) - - elseif (flag == 'write') then - - status = pio_put_var(ncid, vardesc, start, data ) - - endif - - end subroutine ncd_io_char_var0_start_glob - - !------------------------------------------------------------------------ - !DIMS 0 - subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global logical variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - logical , intent(inout) :: data{DIMSTR} ! raw data - logical, optional , intent(out) :: readvar ! was var read? - integer, optional , intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: varid ! netCDF variable id - integer :: start(2), count(2) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - integer :: idata - integer, pointer :: idata1d(:) ! Temporary integer data to send to file - character(len=32) :: vname ! variable error checking - type(var_desc_t) :: vardesc ! local vardesc pointer - character(len=*),parameter :: subname='ncd_io_{DIMS}d_log_glob' - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column .and. present(posNOTonfile) ) then - if ( .not. posNOTonfile )then - call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//& - errMsg(sourcefile, __LINE__)) - end if - endif -#if ({DIMS}==0) - status = pio_get_var(ncid, varid, idata) - if ( idata == 0 )then - data = .false. - else if ( idata == 1 )then - data = .true. - else - call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(sourcefile, __LINE__)) - end if -#else - call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') -#endif - endif - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - -#if ({DIMS}==0) - start(1) = 1 ; count(1) = 1 - if (present(nt)) start(1) = nt - call ncd_inqvid (ncid, varname, varid, vardesc) - allocate(idata1d(1)) - if ( data )then - idata1d(1) = 1 - else - idata1d(1) = 0 - end if - status = pio_put_var(ncid, varid, start, count, idata1d) - deallocate(idata1d) -#else - call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0') -#endif - - endif ! flag - - end subroutine ncd_io_{DIMS}d_log_glob - - !------------------------------------------------------------------------ - !DIMS 0,1,2,3 - !TYPE int,double - subroutine ncd_io_{DIMS}d_{TYPE}_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - {VTYPE} , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: m - integer :: varid ! netCDF variable id - integer :: start({DIMS}+1), count({DIMS}+1) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - logical :: found ! if true, found lat/lon dims on file - character(len=32) :: vname ! variable error checking - type(var_desc_t) :: vardesc ! local vardesc pointer - {VTYPE} :: temp(1) - character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob' - integer :: ndims - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) -#if ({DIMS}==0) - if (varpresent) then - status = pio_get_var(ncid, vardesc, data) - if (single_column .and. present(posNOTonfile) ) then - if ( .not. posNOTonfile )then - call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//& - errMsg(sourcefile, __LINE__)) - end if - endif - if ( status /= PIO_NOERR )then - call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' & - // errMsg(sourcefile, __LINE__)) - end if - end if -#else - if (varpresent) then - if (single_column) then - call scam_field_offsets(ncid,'undefined', vardesc,& - start, count, found=found, posNOTonfile=posNOTonfile) - if ( found )then - status = pio_get_var(ncid, varid, start, count, data) - else - status = pio_get_var(ncid, varid, data) - end if - else - status = pio_get_var(ncid, varid, data) - endif - if ( status /= PIO_NOERR )then - call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' & - // errMsg(sourcefile, __LINE__)) - end if - endif -#endif - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - ndims = {DIMS} - if(present(nt)) ndims=ndims+1 - call ncd_inqvid (ncid, varname, varid, vardesc) -#if ({DIMS}==0) - start(1) = 1 ; count(1) = 1 - if (present(nt)) start(1) = nt ; count(1) = 1 - temp(1) = data - status = pio_put_var(ncid, varid, start(1:1), count(1:1), temp) -#elif ({DIMS}==1) - start(1) = 1 ; count(1) = size(data) - start(2) = 1 ; count(2) = 1 - if (present(nt)) start(2) = nt - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) -#elif ({DIMS}==2) - start(1) = 1 ; count(1) = size(data, dim=1) - start(2) = 1 ; count(2) = size(data, dim=2) - start(3) = 1 ; count(3) = 1 - if (present(nt)) start(3) = nt - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) -#elif ({DIMS}==3) - if (present(nt)) then - start(1) = 1 ; count(1) = size(data,dim=1) - start(2) = 1 ; count(2) = size(data,dim=2) - start(3) = 1 ; count(3) = size(data,dim=3) - start(4) = nt ; count(4) = 1 - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) - else - status = pio_put_var(ncid, varid, data) - end if -#endif - - endif - - end subroutine ncd_io_{DIMS}d_{TYPE}_glob - - !------------------------------------------------------------------------ - !DIMS 0,1,2 - !TYPE text - subroutine ncd_io_{DIMS}d_{TYPE}_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - {VTYPE} , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: m - integer :: varid ! netCDF variable id - integer :: start(4), count(4) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - character(len=1) :: tmpString(199) ! temp for manipulating output string - type(var_desc_t) :: vardesc ! local vardesc pointer - character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob' - integer :: ndims - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - - if (varpresent) then - data = ' ' - status = pio_get_var(ncid, varid, data) - end if - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - ndims = {DIMS} - if(present(nt)) ndims=ndims+1 - call ncd_inqvid (ncid, varname, varid, vardesc) - -#if ({DIMS}==0) - if (present(nt)) then - do m = 1,len(data) - tmpString(m:m) = data(m:m) - end do - start(1) = 1 ; count(1) = len(data) - start(2) = nt; count(2) = 1 - if ( count(1) > size(tmpString) )then - call shr_sys_abort( subname//' ERROR: input string size is too large:'//& - errMsg(sourcefile, __LINE__)) - end if - status = pio_put_var(ncid, varid, start, count, ival=tmpString(1:count(1))) - else - status = pio_put_var(ncid, varid, data ) - end if -#elif ({DIMS}==1) - if (present(nt)) then - start(1) = 1 ; count(1) = len(data) - start(2) = 1 ; count(2) = size(data) - start(3) = nt; count(3) = 1 - status = pio_put_var(ncid, varid, start, count, data) - else - status = pio_put_var(ncid, varid, data) - end if -#elif ({DIMS}==2) - if (present(nt)) then - start(1) = 1 ; count(1) = len(data) - start(2) = 1 ; count(2) = size(data,dim=1) - start(3) = 1 ; count(3) = size(data,dim=2) - start(4) = nt ; count(4) = 1 - status = pio_put_var(ncid, varid, start, count, data) - else - status = pio_put_var(ncid, varid, data) - end if -#endif - - endif - - end subroutine ncd_io_{DIMS}d_{TYPE}_glob - - !----------------------------------------------------------------------- - - !TYPE int,double,logical - subroutine ncd_io_1d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! netcdf I/O for 1d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:) ! local decomposition data - character(len=*) , intent(in) :: dim1name ! dimension name - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical , optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - ! - ! Local Variables - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: n ! index - integer :: iodnum ! iodesc num in list - integer :: varid ! varid - integer :: ndims ! ndims for var - integer :: ndims_iod ! ndims iodesc for var - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: start(3) ! netcdf start index - integer :: count(3) ! netcdf count index - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - integer , pointer :: idata(:) ! Temporary integer data to send to file - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_1d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) subname//' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - -#if ({ITYPE}==TYPEDOUBLE) - if ( present(cnvrtnan2fill) )then - if (.not. cnvrtnan2fill) then - call shr_sys_abort(' ERROR: cnvrtnan2fill present but NOT set to true -- MUST set it to TRUE if used'//& - errMsg(sourcefile, __LINE__)) - endif - end if -#endif - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - if (single_column) then - start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid,clmlevel,vardesc,start,count) - if (trim(clmlevel) == grlnd) then - n=2 - if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 - end if - else - n=1 - if (present(nt)) then - n=2 - start(2) = nt ; count(2) = 1 - end if - end if -#if ({ITYPE}==TYPELOGICAL) - allocate(idata(size(data))) - status = pio_get_var(ncid, varid, start(1:n), count(1:n), idata) - data = (idata == 1) - if ( any(idata /= 0 .and. idata /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) - end if - deallocate( idata ) -#else - status = pio_get_var(ncid, varid, start(1:n), count(1:n), data) -#endif - if ( status /= PIO_NOERR )then - call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & - // errMsg(sourcefile, __LINE__)) - end if - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo -#if ({ITYPE}==TYPELOGICAL) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_INT, iodnum) -#else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) -#endif - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if -#if ({ITYPE}==TYPELOGICAL) - allocate(idata(size(data))) - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, idata, status) - data = (idata == 1) - if ( any(idata /= 0 .and. idata /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__)) - end if - deallocate( idata ) -#else - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) -#endif - if ( status /= PIO_NOERR ) then - call shr_sys_abort(' ERROR: reading in variable: '// trim(varname) & - // errMsg(sourcefile, __LINE__)) - end if - end if - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo -#if ({ITYPE}==TYPELOGICAL) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_INT, iodnum) -#else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) -#endif - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if -#if ({ITYPE}==TYPELOGICAL) - allocate( idata(size(data)) ) - where( data ) - idata = 1 - elsewhere - idata = 0 - end where - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, idata, status, fillval=0) - deallocate( idata ) -#elif ({ITYPE}==TYPEINT) - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=ispval) -#elif ({ITYPE}==TYPEDOUBLE) - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=spval) -#endif - else - - if (masterproc) then - write(iulog,*) subname//' ERROR: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - - endif - - end subroutine ncd_io_1d_{TYPE} - - !----------------------------------------------------------------------- - - !TYPE int,double - subroutine ncd_io_2d_{TYPE}(varname, data, dim1name, lowerb2, upperb2, & - flag, ncid, nt, readvar, switchdim, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! Netcdf i/o of 2d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - integer, optional, intent(in) :: lowerb2,upperb2 ! lower and upper bounds of second dimension - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical, optional, intent(in) :: switchdim ! true=> permute dim1 and dim2 for output - logical, optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - ! - ! !LOCAL VARIABLES: -#if ({ITYPE}==TYPEINT) - integer , pointer :: temp(:,:) -#else - real(r8), pointer :: temp(:,:) -#endif - integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: status ! error status - integer :: ndims ! ndims total for var - integer :: ndims_iod ! ndims iodesc for var - integer :: varid ! varid - integer :: n,i,j ! indices - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: iodnum ! iodesc num in list - integer :: start(4) ! netcdf start index - integer :: count(4) ! netcdf count index - logical :: varpresent ! if true, variable is on tape - integer :: lb1,lb2 - integer :: ub1,ub2 - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_2d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - start(:)=0 - count(:)=0 - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - -#if ({ITYPE}==TYPEDOUBLE) - if ( present(cnvrtnan2fill) )then - if (.not. cnvrtnan2fill) then - call shr_sys_abort( ' ERROR: cnvrtnan2fill present but NOT set to true -- MUST set it to TRUE if used'//& - errMsg(sourcefile, __LINE__)) - endif - end if -#endif - - lb1 = lbound(data, dim=1) - ub1 = ubound(data, dim=1) - lb2 = lbound(data, dim=2) - ub2 = ubound(data, dim=2) - - if (present(switchdim)) then - if (present(lowerb2)) lb2 = lowerb2 - if (present(upperb2)) ub2 = upperb2 - allocate(temp(lb2:ub2,lb1:ub1)) - end if - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column) then - start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then - count(3) = size(data,dim=2) - n=3 - if (present(nt)) then - start(4) = nt; count(4) = 1 - n=4 - end if - else - count(2) = size(data,dim=2) - n=2 - if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 - end if - end if - if (present(switchdim)) then - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), temp) - do j = lb2,ub2 - do i = lb1,ub1 - data(i,j) = temp(j,i) - end do - end do - else - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), data) - endif - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid,vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid, dids(ndims), dimname) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum, switchdim=.true.) - else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - end if - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - if (present(switchdim)) then - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status) - do j = lb2,ub2 - do i = lb1,ub1 - data(i,j) = temp(j,i) - end do - end do - else - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - end if - end if -#if ({ITYPE}!=TYPEINT) - if ( present(cnvrtnan2fill) )then - do j = lb2,ub2 - do i = lb1,ub1 - if ( data(i,j) == spval )then - data(i,j) = nan - end if - end do - end do - end if -#endif - end if - if (present(readvar)) readvar = varpresent - - else if (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc , dids(1:ndims)) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum, switchdim=.true.) - else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - end if - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - if (present(switchdim)) then - do j = lb2,ub2 - do i = lb1,ub1 - temp(j,i) = data(i,j) - end do - end do - end if -#if ({ITYPE}==TYPEINT) - if (present(switchdim)) then - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status, fillval=ispval) - else - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=ispval) - end if -#else - if (present(switchdim)) then - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status, fillval=spval) - else - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=spval) - end if - if ( present(cnvrtnan2fill) )then - do j = lb2,ub2 - do i = lb1,ub1 - if ( isnan(data(i,j)) )then - data(i,j) = spval - end if - end do - end do - end if -#endif - - else - - if (masterproc) then - write(iulog,*) subname,' error: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - - endif - - if (present(switchdim)) then - deallocate(temp) - end if - - end subroutine ncd_io_2d_{TYPE} - - !----------------------------------------------------------------------- - - !TYPE int,double - subroutine ncd_io_3d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar) - ! - ! !DESCRIPTION: - ! Netcdf i/o of 3d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:,:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - ! - ! !LOCAL VARIABLES: - integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: status ! error status - integer :: ndims ! ndims total for var - integer :: ndims_iod ! ndims iodesc for var - integer :: varid ! varid - integer :: n ! index - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: iodnum ! iodesc num in list - integer :: start(5) ! netcdf start index - integer :: count(5) ! netcdf count index - logical :: varpresent ! if true, variable is on tape - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column) then - start(:) = 1 - count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then - count(3) = size(data,dim=2); - count(4) = size(data,dim=3) - n=4 - if (present(nt)) then - start(5) = nt - count(5) = 1 - n=5 - end if - else - count(2) = size(data,dim=2) - count(3) = size(data,dim=3) - n=3 - if (present(nt)) then - start(4) = nt - count(4) = 1 - n=4 - end if - end if - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), data) - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid,vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid, dids(ndims), dimname) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - end if - end if - if (present(readvar)) readvar = varpresent - - else if (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc , dids(1:ndims)) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - - else - - if (masterproc) then - write(iulog,*) subname,' error: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - - endif - - end subroutine ncd_io_3d_{TYPE} - - !------------------------------------------------------------------------ - - subroutine scam_field_offsets( ncid, dim1name, vardesc, start, count, & - found, posNOTonfile) - ! - ! !DESCRIPTION: - ! Read/Write initial data from/to netCDF instantaneous initial data file - ! - ! !USES: - use clm_varctl, only: scmlon,scmlat,single_column - use shr_scam_mod, only: shr_scam_getCloseLatLon - use shr_string_mod, only: shr_string_toLower - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: dim1name ! dimension 1 name - type(Var_desc_t) , intent(inout) :: vardesc ! variable descriptor - integer , intent(out) :: start(:) ! start index - integer , intent(out) :: count(:) ! count to retrieve - logical, optional , intent(out) :: found ! if present return true if found - ! dimensions on file else false if NOT present abort if can't find - logical, optional , intent(in) :: posNOTonfile ! Position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: cc,i,ii ! index variable - integer :: data_offset ! offset into land array 1st column - integer :: ndata ! number of column (or pft points to read) - real(r8) , pointer :: cols1dlon(:) ! holds cols1d_ixy var - real(r8) , pointer :: cols1dlat(:) ! holds cols1d_jxy var - real(r8) , pointer :: pfts1dlon(:) ! holds pfts1d_ixy var - real(r8) , pointer :: pfts1dlat(:) ! holds pfts1d_jxy var - real(r8) , pointer :: land1dlon(:) ! holds land1d_ixy var - real(r8) , pointer :: land1dlat(:) ! holds land1d_jxy var - integer, allocatable :: cols(:) ! grid cell columns for scam - integer, allocatable :: pfts(:) ! grid cell pfts for scam - integer, allocatable :: landunits(:) ! grid cell landunits for scam - integer, allocatable :: dids(:) ! dim ids - integer :: varid ! netCDF variable id - integer :: status ! return code - integer :: latidx,lonidx ! latitude/longitude indices - real(r8) :: closelat,closelon ! closest latitude and longitude indices - integer :: ndims,dimlen ! number of dimensions in desired variable - character(len=32) :: dimname ! dimension name - character(len=32) :: subname = 'scam_field_offsets' - !------------------------------------------------------------------------ - - start(:)=1 - count(:)=1 - - if ( present(posNOTonfile) )then - if ( posNOTonfile )then - if ( .not. present(found) )then - call shr_sys_abort('ERROR: Bad subroutine calling structure posNOTonfile sent, but found was NOT!'//& - errMsg(sourcefile, __LINE__)) - end if - found = .false. - return - end if - end if - - ! find closest land grid cell for this point - - if ( present(found) )then - call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx,found) - if ( .not. found ) return - else - call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx) - end if - - call ncd_inqvdims(ncid,ndims,vardesc) - - allocate(dids(ndims)) - status = pio_inq_vardimid(ncid, vardesc, dids) - do i = 1,ndims - status = pio_inq_dimname(ncid,dids(i),dimname) - dimname=shr_string_toLower(dimname) - status = pio_inq_dimlen(ncid,dids(i),dimlen) - if ( trim(dimname)=='nj'.or. trim(dimname)=='lat'.or. trim(dimname)=='lsmlat') then - start(i)=latidx - count(i)=1 - else if ( trim(dimname)=='ni'.or. trim(dimname)=='lon'.or. trim(dimname)=='lsmlon') then - start(i)=lonidx - count(i)=1 - else if ( trim(dimname)=='column') then - - allocate (cols1dlon(dimlen)) - allocate (cols1dlat(dimlen)) - allocate (cols(dimlen)) - - status = pio_inq_varid(ncid, 'cols1d_lon', varid) - status = pio_get_var(ncid, varid, cols1dlon) - status = pio_inq_varid(ncid, 'cols1d_lat', varid) - status = pio_get_var(ncid, varid, cols1dlat) - - cols(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (cols1dlon(cc) == closelon.and.cols1dlat(cc) == closelat) then - cols(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any columns for this latitude ',latidx,' and longitude ',lonidx - call shr_sys_abort('ERROR:: no columns for this position'//errMsg(sourcefile, __LINE__)) - else - data_offset=cols(1) - end if - - deallocate (cols1dlon) - deallocate (cols1dlat) - deallocate (cols) - - start(i) = data_offset - count(i) = ndata - else if ( trim(dimname)=='pft') then - - allocate (pfts1dlon(dimlen)) - allocate (pfts1dlat(dimlen)) - allocate (pfts(dimlen)) - - status = pio_inq_varid(ncid, 'pfts1d_lon', varid) - status = pio_get_var(ncid, varid, pfts1dlon) - - status = pio_inq_varid(ncid, 'pfts1d_lat', varid) - status = pio_get_var(ncid, varid, pfts1dlat) - - pfts(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (pfts1dlon(cc) == closelon.and.pfts1dlat(cc) == closelat) then - pfts(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any pfts for this latitude ',closelat,' and longitude ',closelon - call shr_sys_abort('ERROR:: no PFTs for this position'//errMsg(sourcefile, __LINE__)) - else - data_offset=pfts(1) - end if - - deallocate (pfts1dlon) - deallocate (pfts1dlat) - deallocate (pfts) - - start(i) = data_offset - count(i) = ndata - else if ( trim(dimname)=='landunit') then - - allocate (land1dlon(dimlen)) - allocate (land1dlat(dimlen)) - allocate (landunits(dimlen)) - - status = pio_inq_varid(ncid, 'land1d_lon', varid) - status = pio_get_var(ncid, varid, land1dlon) - - status = pio_inq_varid(ncid, 'land1d_lat', varid) - status = pio_get_var(ncid, varid, land1dlat) - - landunits(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (land1dlon(cc) == closelon.and.land1dlat(cc) == closelat) then - landunits(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any landunits for this latitude ',closelat,' and longitude ',closelon - call shr_sys_abort('ERROR:: no landunits for this position'//errMsg(sourcefile, __LINE__)) - else - data_offset=landunits(1) - end if - - deallocate (land1dlon) - deallocate (land1dlat) - deallocate (landunits) - - start(i) = data_offset - count(i) = ndata - else - start(i)=1 - count(i)=dimlen - end if - enddo - deallocate(dids) - - end subroutine scam_field_offsets - - !------------------------------------------------------------------------ - - subroutine ncd_getiodesc(ncid, clmlevel, ndims, dims, dimids, & - xtype, iodnum, switchdim) - ! - ! !DESCRIPTION: - ! Returns an index to an io descriptor - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=8) , intent(in) :: clmlevel ! clmlevel - integer , intent(in) :: ndims ! ndims for var - integer , intent(in) :: dims(:) ! dim sizes - integer , intent(in) :: dimids(:) ! dim ids - integer , intent(in) :: xtype ! file external type - integer , intent(out) :: iodnum ! iodesc num in list - logical,optional , intent(in) :: switchdim ! switch level dimension and first dim - ! - ! !LOCAL VARIABLES: - integer :: k,m,n,cnt ! indices - integer :: basetype ! pio basetype - integer :: gsmap_lsize ! local size of gsmap - integer :: gsmap_gsize ! global size of gsmap - integer :: fullsize ! size of entire array on cdf - integer :: gsize ! global size of clmlevel - integer :: vsize ! other dimensions - integer :: vsize1, vsize2 ! other dimensions - integer :: status ! error status - logical :: found ! true => found created iodescriptor - integer :: ndims_file ! temporary - character(len=64) dimname_file ! dimension name on file - character(len=64) dimname_iodesc ! dimension name from io descriptor - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmOP ! gsmap ordered points - integer(pio_offset_kind), pointer :: compDOF(:) - character(len=32) :: subname = 'ncd_getiodesc' - !------------------------------------------------------------------------ - - ! Determining if need to create a new io descriptor - n = 1 - found = .false. - do while (n <= num_iodesc .and. .not.found) - if (ndims == iodesc_list(n)%ndims .and. xtype == iodesc_list(n)%type) then - found = .true. - ! First found implies that dimension sizes are the same - do m = 1,ndims - if (dims(m) /= iodesc_list(n)%dims(m)) then - found = .false. - endif - enddo - ! If found - then also check that dimension names are equal - - ! dimension ids in iodescriptor are only used to query dimension - ! names associated with that iodescriptor - if (found) then - status = PIO_inquire(ncid, ndimensions=ndims_file) - do m = 1,ndims - status = PIO_inq_dimname(ncid,dimids(m),dimname_file) - if (iodesc_list(n)%dimids(m) > ndims_file) then - found = .false. - exit - else - status = PIO_inq_dimname(ncid,iodesc_list(n)%dimids(m),dimname_iodesc) - if (trim(dimname_file) /= trim(dimname_iodesc)) then - found = .false. - exit - end if - end if - end do - end if - if (found) then - iodnum = n - if (iodnum > num_iodesc) then - write(iulog,*) trim(subname),' ERROR: iodnum out of range ',iodnum,num_iodesc - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - RETURN - endif - endif - n = n + 1 - enddo - - ! Creating a new io descriptor - - if (ndims > 0) then - num_iodesc = num_iodesc + 1 - if (num_iodesc > max_iodesc) then - write(iulog,*) trim(subname),' ERROR num_iodesc gt max_iodesc ',max_iodesc - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - iodnum = num_iodesc - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' creating iodesc at iodnum,ndims,dims(1:ndims),xtype',& - iodnum,ndims,dims(1:ndims),xtype - endif - end if - - if (xtype == pio_double ) then - basetype = PIO_DOUBLE - else if (xtype == pio_real) then - basetype = PIO_DOUBLE - else if (xtype == pio_int) then - basetype = PIO_INT - else - write(iulog,*) trim(subname),'ERROR: no match for xtype = ',xtype - call shr_sys_abort(errMsg(sourcefile,__LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel,gsmap) - gsize = get_clmlevel_gsize(clmlevel) - gsmap_lsize = mct_gsmap_lsize(gsmap,mpicom) - gsmap_gsize = mct_gsmap_gsize(gsmap) - - call mct_gsMap_orderedPoints(gsmap,iam,gsmOP) - - fullsize = 1 - do n = 1,ndims - fullsize = fullsize*dims(n) - enddo - - vsize = fullsize / gsize - if (mod(fullsize,gsize) /= 0) then - write(iulog,*) subname,' ERROR in vsize ',fullsize,gsize,vsize - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - endif - - allocate(compDOF(gsmap_lsize*vsize)) - - if (present(switchdim)) then - if (switchdim) then - cnt = 0 - do m = 1,gsmap_lsize - do n = 1,vsize - cnt = cnt + 1 - compDOF(cnt) = (gsmOP(m)-1)*vsize + n - enddo - enddo - else - write(iulog,*) subname,' ERROR switch dims present must have switchdim true' - call shr_sys_abort(errMsg(sourcefile, __LINE__)) - end if - else ! currently allow for up to two vertical dimensions - if (vsize /= 1 .and. vsize /= dims(ndims)) then - vsize1 = vsize/dims(ndims) - vsize2 = dims(ndims) - if (vsize1*vsize2 /= vsize) then - write(iulog,*)'vsize1= ',vsize1,' vsize2= ',vsize2,' vsize= ',vsize - call shr_sys_abort('error in vsize1 and vsize2 computation'//errMsg(sourcefile, __LINE__)) - end if - cnt = 0 - do k = 1,vsize2 - do n = 1,vsize1 - do m = 1,gsmap_lsize - cnt = cnt + 1 - compDOF(cnt) = (k-1)*vsize1*gsmap_gsize + (n-1)*gsmap_gsize + gsmOP(m) - enddo - enddo - end do - else - cnt = 0 - do n = 1,vsize - do m = 1,gsmap_lsize - cnt = cnt + 1 - compDOF(cnt) = (n-1)*gsmap_gsize + gsmOP(m) - enddo - enddo - end if - end if - - if (debug > 1) then - do m = 0,npes-1 - if (iam == m) then - write(iulog,*) trim(subname),' sizes1 = ',iam,gsize,gsmap_gsize,gsmap_lsize - write(iulog,*) trim(subname),' sizes2 = ',iam,fullsize,npes,vsize - write(iulog,*) trim(subname),' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF) - call shr_sys_flush(iulog) - endif - call mpi_barrier(mpicom,status) - enddo - endif - - deallocate(gsmOP) - - call pio_initdecomp(pio_subsystem, baseTYPE, dims(1:ndims), compDOF, iodesc_list(iodnum)%iodesc) - - deallocate(compDOF) - - iodesc_list(iodnum)%type = xtype - iodesc_list(iodnum)%ndims = ndims - iodesc_list(iodnum)%dims = 0 - iodesc_list(iodnum)%dims(1:ndims) = dims(1:ndims) - iodesc_list(iodnum)%dimids(1:ndims) = dimids(1:ndims) - - end subroutine ncd_getiodesc - -end module ncdio_pio diff --git a/src/main/ncdio_utils.F90 b/src/main/ncdio_utils.F90 deleted file mode 100644 index 977e10b484..0000000000 --- a/src/main/ncdio_utils.F90 +++ /dev/null @@ -1,70 +0,0 @@ -module ncdio_utils - - !----------------------------------------------------------------------- - ! This module provides higher-level netcdf i/o utilities, which build on ncdio_pio. - ! - ! The main reason for putting these utilities in a separate module (rather than putting - ! them in ncdio_pio) is to enhance testability: These routines can be unit tested with - ! a stub version of ncdio_pio. - use ncdio_pio - ! - implicit none - save - private - - public :: find_var_on_file ! given a list of possible variables, find the one that exists on the file - -contains - - !----------------------------------------------------------------------- - subroutine find_var_on_file(ncid, varname_list, varname_on_file) - ! - ! !DESCRIPTION: - ! Given a colon-delimited list of possible variable names, return the first one that - ! was found on the file. - ! - ! If none are found, arbitrarily return the first variable in the list. (Doing this - ! rather than returning a special flag simplifies the logic elsewhere - allowing the - ! ncd_io call to fail rather than requiring extra error-checking logic.) - ! - ! !USES: - use shr_string_mod, only : shr_string_listGetNum, shr_string_listGetName - ! - ! !ARGUMENTS: - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname_list ! colon-delimited list of possible variable names - character(len=*) , intent(out) :: varname_on_file ! first variable from the list that was found on file - ! - ! !LOCAL VARIABLES: - integer :: num_vars - integer :: n - logical :: found - logical :: readvar - character(len=len(varname_on_file)) :: cur_varname - integer :: varid - type(var_desc_t) :: vardesc - - character(len=*), parameter :: subname = 'find_var_on_file' - !----------------------------------------------------------------------- - - num_vars = shr_string_listGetNum(varname_list) - - found = .false. - n = 1 - do while ((.not. found) .and. (n <= num_vars)) - call shr_string_listGetName(varname_list, n, cur_varname) - call ncd_inqvid(ncid, cur_varname, varid, vardesc, readvar=readvar) - found = readvar - n = n + 1 - end do - - if (found) then - varname_on_file = cur_varname - else - ! If none are found, arbitrarily return the first variable in the list - call shr_string_listGetName(varname_list, 1, varname_on_file) - end if - - end subroutine find_var_on_file - -end module ncdio_utils diff --git a/src/main/ndepStreamMod.F90 b/src/main/ndepStreamMod.F90 deleted file mode 100644 index e4acd648b8..0000000000 --- a/src/main/ndepStreamMod.F90 +++ /dev/null @@ -1,353 +0,0 @@ -module ndepStreamMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in nitrogen deposition data file - ! Also includes functions for dynamic ndep file handling and - ! interpolation. - ! - ! !USES - use shr_kind_mod, only: r8 => shr_kind_r8, CL => shr_kind_cl - use shr_strdata_mod, only: shr_strdata_type, shr_strdata_create - use shr_strdata_mod, only: shr_strdata_print, shr_strdata_advance - use mct_mod , only: mct_ggrid - use spmdMod , only: mpicom, masterproc, comp_id, iam - use clm_varctl , only: iulog - use abortutils , only: endrun - use fileutils , only: getavu, relavu - use decompMod , only: bounds_type, ldecomp, gsmap_lnd_gdc2glo - use domainMod , only: ldomain - - ! !PUBLIC TYPES: - implicit none - private - save - - ! !PUBLIC MEMBER FUNCTIONS: - public :: ndep_init ! position datasets for dynamic ndep - public :: ndep_interp ! interpolates between two years of ndep file data - public :: clm_domain_mct ! Sets up MCT domain for this resolution - - ! !PRIVATE MEMBER FUNCTIONS: - private :: check_units ! Check the units and make sure they can be used - ! ! PRIVATE TYPES - type(shr_strdata_type) :: sdat ! input data stream - integer :: stream_year_first_ndep ! first year in stream to use - integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with - logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine ndep_init(bounds, NLFilename) - ! - ! Initialize data stream information. - ! - ! Uses: - use shr_kind_mod , only : CS => shr_kind_cs - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! arguments - implicit none - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: ndepmapalgo = 'bilinear' - character(len=CS) :: ndep_taxmode = 'extend' - character(len=CL) :: ndep_varlist = 'NDEP_year' - character(*), parameter :: shr_strdata_unset = 'NOT_SET' - character(*), parameter :: subName = "('ndepdyn_init')" - character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, ndep_taxmode, & - ndep_varlist, & - stream_fldFileName_ndep - - ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' - - ! Read ndepdyn_nml namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg=' ERROR reading ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_ndep , mpicom) - call shr_mpi_bcast(stream_year_last_ndep , mpicom) - call shr_mpi_bcast(model_year_align_ndep , mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - call shr_mpi_bcast(ndep_varlist , mpicom) - call shr_mpi_bcast(ndep_taxmode , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'ndepdyn stream settings:' - write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep - write(iulog,*) ' ndep_varList = ',ndep_varList - write(iulog,*) ' ndep_taxmode = ',ndep_taxmode - write(iulog,*) ' ' - endif - ! Read in units - call check_units( stream_fldFileName_ndep, ndep_varList ) - - ! Set domain and create streams - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name="clmndep", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_ndep, & - yearLast=stream_year_last_ndep, & - yearAlign=model_year_align_ndep, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_ndep), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_ndep)/),& - fldListFile=ndep_varlist, & - fldListModel=ndep_varlist, & - fillalgo='none', & - mapalgo=ndepmapalgo, & - calendar=get_calendar(), & - taxmode=ndep_taxmode ) - - - if (masterproc) then - call shr_strdata_print(sdat,'CLMNDEP data') - endif - - end subroutine ndep_init - !================================================================ - - subroutine check_units( stream_fldFileName_ndep, ndep_varList ) - !------------------------------------------------------------------- - ! Check that units are correct on the file and if need any conversion - use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite - use ncdio_pio , only : file_desc_t, var_desc_t - use shr_kind_mod , only : CS => shr_kind_cs - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_string_mod, only : shr_string_listGetName - implicit none - - !----------------------------------------------------------------------- - ! - ! Arguments - character(len=*), intent(IN) :: stream_fldFileName_ndep ! ndep filename - character(len=*), intent(IN) :: ndep_varList ! ndep variable list to examine - ! - ! Local variables - type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file - type(var_desc_t) :: vardesc ! variable descriptor - integer :: varid ! variable index - logical :: readvar ! If variable was read - character(len=CS) :: ndepunits! ndep units - character(len=CS) :: fname ! ndep field name - !----------------------------------------------------------------------- - call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) - call shr_string_listGetName( ndep_varList, 1, fname ) - call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) - if ( readvar ) then - call ncd_getatt( ncid, varid, "units", ndepunits ) - else - call endrun(msg=' ERROR finding variable: '//trim(fname)//" in file: "// & - trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile( ncid ) - - ! Now check to make sure they are correct - if ( trim(ndepunits) == "g(N)/m2/s" )then - divide_by_secs_per_yr = .false. - else if ( trim(ndepunits) == "g(N)/m2/yr" )then - divide_by_secs_per_yr = .true. - else - call endrun(msg=' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_units - - !================================================================ - subroutine ndep_interp(bounds, atm2lnd_inst) - - !----------------------------------------------------------------------- - use clm_time_manager, only : get_curr_date, get_days_per_year - use clm_varcon , only : secspday - use atm2lndType , only : atm2lnd_type - ! - ! Arguments - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type), intent(inout) :: atm2lnd_inst - ! - ! Local variables - integer :: g, ig - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - integer :: dayspyr ! days per year - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ndepdyn') - - if ( divide_by_secs_per_yr )then - ig = 0 - dayspyr = get_days_per_year( ) - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) / (secspday * dayspyr) - end do - else - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) - end do - end if - - end subroutine ndep_interp - - !============================================================================== - subroutine clm_domain_mct(bounds, dom_clm) - - !------------------------------------------------------------------- - ! Set domain data type for internal clm grid - use clm_varcon , only : re - use domainMod , only : ldomain - use seq_flds_mod - use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init - use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr - use mct_mod , only : mct_gGrid_importRAttr - implicit none - ! - ! arguments - type(bounds_type), intent(in) :: bounds - type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model - ! - ! local variables - integer :: g,i,j ! index - integer :: lsize ! land model domain data size - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - lsize = mct_gsMap_lsize(gsmap_lnd_gdc2glo, mpicom) - call mct_gGrid_init( GGrid=dom_clm, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsmap_lnd_gdc2glo, iam, idata) - call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_clm,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_clm,"mask" ,data,lsize) - ! - ! Determine bounds - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_clm,"area",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine clm_domain_mct - -end module ndepStreamMod - diff --git a/src/main/organicFileMod.F90 b/src/main/organicFileMod.F90 deleted file mode 100644 index 3adbd5b6f1..0000000000 --- a/src/main/organicFileMod.F90 +++ /dev/null @@ -1,113 +0,0 @@ -module organicFileMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: organicFileMod -! -! !DESCRIPTION: -! Contains methods for reading in organic matter data file which has -! organic matter density for each grid point and soil level -! -! !USES - use abortutils , only : endrun - use clm_varctl , only : iulog - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon , only : grlnd -! -! !PUBLIC TYPES: - implicit none - private - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: organicrd ! Read organic matter dataset -! -! !REVISION HISTORY: -! Created by David Lawrence, 4 May 2006 -! Revised by David Lawrence, 21 September 2007 -! Revised by David Lawrence, 14 October 2008 -! -!EOP -! -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: organicrd -! -! !INTERFACE: - subroutine organicrd(organic) -! -! !DESCRIPTION: -! Read the organic matter dataset. -! -! !USES: - use clm_varctl , only : fsurdat, single_column - use fileutils , only : getfil - use spmdMod , only : masterproc - use domainMod , only : ldomain - use ncdio_pio -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: organic(:,:) ! organic matter density (kg/m3) -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by David Lawrence, 4 May 2006 -! Revised by David Lawrence, 21 September 2007 -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: ni,nj,ns ! dimension sizes - logical :: isgrid2d ! true => file is 2d - logical :: readvar ! true => variable is on dataset - character(len=32) :: subname = 'organicrd' ! subroutine name -!----------------------------------------------------------------------- - - ! Initialize data to zero - no organic matter dataset - - organic(:,:) = 0._r8 - - ! Read data if file was specified in namelist - - if (fsurdat /= ' ') then - if (masterproc) then - write(iulog,*) 'Attempting to read organic matter data .....' - write(iulog,*) subname,trim(fsurdat) - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun() - end if - - call ncd_io(ncid=ncid, varname='ORGANIC', flag='read', data=organic, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('organicrd: errror reading ORGANIC') - - if ( masterproc )then - write(iulog,*) 'Successfully read organic matter data' - write(iulog,*) - end if - endif - - end subroutine organicrd - -end module organicFileMod diff --git a/src/main/paramUtilMod.F90 b/src/main/paramUtilMod.F90 deleted file mode 100644 index 96c95440e7..0000000000 --- a/src/main/paramUtilMod.F90 +++ /dev/null @@ -1,291 +0,0 @@ -module paramUtilMod - ! - ! module that deals with reading parameter files - ! - use shr_kind_mod , only: r8 => shr_kind_r8 - implicit none - save - private - - interface readNcdio - module procedure readNcdioScalar - module procedure readNcdioArray1d - module procedure readNcdioArray2d - module procedure readNcdioScalarCheckDimensions - module procedure readNcdioArray1dCheckDimensions - module procedure readNcdioArray2dCheckDimensions - end interface - - public :: readNcdioScalar - public :: readNcdioArray1d - public :: readNcdioArray2d - public :: readNcdioScalarCheckDimensions - public :: readNcdioArray1dCheckDimensions - public :: readNcdioArray2dCheckDimensions - - public :: readNcdio - - private :: checkDimensions - -contains - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioScalar(ncid, varName, callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t,ncd_io - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - logical :: readv ! has variable been read in or not - - ! - ! netcdf read here - ! - - call ncd_io(varname=trim(varName),data=retVal, flag='read', ncid=ncid, readvar=readv) - - if ( .not. readv ) then - call endrun(trim(callingName)//trim(subname)//trim(errCode)//trim(varName)) - endif - - end subroutine readNcdioScalar - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioArray1d(ncid, varName, callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t,ncd_io - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal( 1: ) - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - logical :: readv ! has variable been read in or not - - ! - ! netcdf read here - ! - - call ncd_io(varname=trim(varName),data=retVal, flag='read', ncid=ncid, readvar=readv) - - if ( .not. readv ) then - call endrun(trim(callingName)//trim(subname)//trim(errCode)//trim(varName)) - endif - - end subroutine readNcdioArray1d - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioArray2d(ncid, varName, callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t,ncd_io - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal( 1: , :) - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - logical :: readv ! has variable been read in or not - - ! - ! netcdf read here - ! - - call ncd_io(varname=trim(varName),data=retVal, flag='read', ncid=ncid, readvar=readv) - - if ( .not. readv ) then - call endrun(trim(callingName)//trim(subname)//trim(errCode)//trim(varName)) - endif - - end subroutine readNcdioArray2d - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioScalarCheckDimensions(ncid, varName, expected_numDims, expected_dimNames, & - callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - integer, intent(in) :: expected_numDims - character(len=*), intent(in) :: expected_dimNames(:) ! expected dimension name - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - - ! - ! netcdf read here - ! - call checkDimensions(ncid, varName, expected_numDims, expected_dimNames, subname) - call readNcdio(ncid, varName, callingName, retVal) - - end subroutine readNcdioScalarCheckDimensions - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioArray1dCheckDimensions(ncid, varName, expected_numDims, expected_dimNames, & - callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - integer, intent(in) :: expected_numDims - character(len=*), intent(in) :: expected_dimNames(:) ! expected dimension name - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal( 1: ) - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - ! - ! netcdf read here - ! - call checkDimensions(ncid, varName, expected_numDims, expected_dimNames, subname) - call readNcdio(ncid, varName, callingName, retVal) - - end subroutine readNcdioArray1dCheckDimensions - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine readNcdioArray2dCheckDimensions(ncid, varName, expected_numDims, expected_dimNames, & - callingName, retVal) - ! - ! read the netcdf file...generic, could be used for any parameter read - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - integer, intent(in) :: expected_numDims - character(len=*), intent(in) :: expected_dimNames(:) ! expected dimension name - character(len=*), intent(in) :: callingName ! calling routine - real(r8), intent(inout) :: retVal(1:, : ) - - ! local vars - character(len=32) :: subname = 'readNcdio::' - character(len=100) :: errCode = ' - Error reading. Var: ' - ! - ! netcdf read here - ! - call checkDimensions(ncid, varName, expected_numDims, expected_dimNames, subname) - call readNcdio(ncid, varName, callingName, retVal) - - end subroutine readNcdioArray2dCheckDimensions - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! - !----------------------------------------------------------------------- - subroutine checkDimensions(ncid, varName, expected_numDims, expected_dimNames, callingName) - ! - ! Assert that the expected number of dimensions and dimension - ! names for a variable match the actual names on the file. - ! - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, var_desc_t, check_var, ncd_inqvdname, ncd_inqvdims - - implicit none - - ! arguments - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - character(len=*), intent(in) :: varName ! variable we are reading - integer, intent(in) :: expected_numDims ! number of expected dimensions on the variable - character(len=*), intent(in) :: expected_dimNames(:) ! expected dimension names - character(len=*), intent(in) :: callingName ! calling routine - integer :: error_num - - ! local vars - character(len=32) :: subname = 'checkDimensions::' - type(Var_desc_t) :: var_desc ! variable descriptor - logical :: readvar ! whether the variable was found - character(len=100) :: received_dimName - integer :: d, num_dims - character(len=256) :: msg - - call check_var(ncid, varName, var_desc, readvar) - if (readvar) then - call ncd_inqvdims(ncid, num_dims, var_desc) - if (num_dims /= expected_numDims) then - write(msg, *) trim(callingName)//trim(subname)//trim(varname)//":: expected number of dimensions = ", & - expected_numDims, " num dimensions received from file = ", num_dims - call endrun(msg) - end if - do d = 1, num_dims - received_dimName = '' - call ncd_inqvdname(ncid, varname=trim(varName), dimnum=d, dname=received_dimName, err_code=error_num) - if (trim(expected_dimNames(d)) /= trim(received_dimName)) then - write(msg, *) trim(callingName)//trim(subname)//trim(varname)//":: dimension ", d, & - " expected dimension name '"//trim(expected_dimNames(d))//& - "' dimension name received from file '"//trim(received_dimName)//"'." - call endrun(msg) - end if - end do - end if - - end subroutine checkDimensions - !----------------------------------------------------------------------- - -end module paramUtilMod diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 deleted file mode 100644 index 0efa2053eb..0000000000 --- a/src/main/pftconMod.F90 +++ /dev/null @@ -1,1381 +0,0 @@ -module pftconMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing vegetation constants and method to - ! read and initialize vegetation (PFT) constants. - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use clm_varpar , only : mxpft, numrad, ivis, inir, cft_lb, cft_ub - use clm_varctl , only : iulog, use_cndv, use_vertsoilc, use_crop - ! - ! !PUBLIC TYPES: - implicit none - ! - ! Vegetation type constants - ! - integer :: noveg ! value for not vegetated - integer :: ndllf_evr_tmp_tree ! value for Needleleaf evergreen temperate tree - integer :: ndllf_evr_brl_tree ! value for Needleleaf evergreen boreal tree - integer :: ndllf_dcd_brl_tree ! value for Needleleaf deciduous boreal tree - integer :: nbrdlf_evr_trp_tree ! value for Broadleaf evergreen tropical tree - integer :: nbrdlf_evr_tmp_tree ! value for Broadleaf evergreen temperate tree - integer :: nbrdlf_dcd_trp_tree ! value for Broadleaf deciduous tropical tree - integer :: nbrdlf_dcd_tmp_tree ! value for Broadleaf deciduous temperate tree - integer :: nbrdlf_dcd_brl_tree ! value for Broadleaf deciduous boreal tree - integer :: ntree ! value for last type of tree - integer :: nbrdlf_evr_shrub ! value for Broadleaf evergreen shrub - integer :: nbrdlf_dcd_tmp_shrub ! value for Broadleaf deciduous temperate shrub - integer :: nbrdlf_dcd_brl_shrub ! value for Broadleaf deciduous boreal shrub - integer :: nc3_arctic_grass ! value for C3 arctic grass - integer :: nc3_nonarctic_grass ! value for C3 non-arctic grass - integer :: nc4_grass ! value for C4 grass - integer :: npcropmin ! value for first crop - integer :: ntmp_corn ! value for temperate corn, rain fed (rf) - integer :: nirrig_tmp_corn ! value for temperate corn, irrigated (ir) - integer :: nswheat ! value for spring temperate cereal (rf) - integer :: nirrig_swheat ! value for spring temperate cereal (ir) - integer :: nwwheat ! value for winter temperate cereal (rf) - integer :: nirrig_wwheat ! value for winter temperate cereal (ir) - integer :: ntmp_soybean ! value for temperate soybean (rf) - integer :: nirrig_tmp_soybean ! value for temperate soybean (ir) - integer :: nbarley ! value for spring barley (rf) - integer :: nirrig_barley ! value for spring barley (ir) - integer :: nwbarley ! value for winter barley (rf) - integer :: nirrig_wbarley ! value for winter barley (ir) - integer :: nrye ! value for spring rye (rf) - integer :: nirrig_rye ! value for spring rye (ir) - integer :: nwrye ! value for winter rye (rf) - integer :: nirrig_wrye ! value for winter rye (ir) - integer :: ncassava ! ...and so on - integer :: nirrig_cassava - integer :: ncitrus - integer :: nirrig_citrus - integer :: ncocoa - integer :: nirrig_cocoa - integer :: ncoffee - integer :: nirrig_coffee - integer :: ncotton - integer :: nirrig_cotton - integer :: ndatepalm - integer :: nirrig_datepalm - integer :: nfoddergrass - integer :: nirrig_foddergrass - integer :: ngrapes - integer :: nirrig_grapes - integer :: ngroundnuts - integer :: nirrig_groundnuts - integer :: nmillet - integer :: nirrig_millet - integer :: noilpalm - integer :: nirrig_oilpalm - integer :: npotatoes - integer :: nirrig_potatoes - integer :: npulses - integer :: nirrig_pulses - integer :: nrapeseed - integer :: nirrig_rapeseed - integer :: nrice - integer :: nirrig_rice - integer :: nsorghum - integer :: nirrig_sorghum - integer :: nsugarbeet - integer :: nirrig_sugarbeet - integer :: nsugarcane - integer :: nirrig_sugarcane - integer :: nsunflower - integer :: nirrig_sunflower - integer :: nmiscanthus - integer :: nirrig_miscanthus - integer :: nswitchgrass - integer :: nirrig_switchgrass - integer :: ntrp_corn !value for tropical corn (rf) - integer :: nirrig_trp_corn !value for tropical corn (ir) - integer :: ntrp_soybean !value for tropical soybean (rf) - integer :: nirrig_trp_soybean !value for tropical soybean (ir) - integer :: npcropmax ! value for last prognostic crop in list - integer :: nc3crop ! value for generic crop (rf) - integer :: nc3irrig ! value for irrigated generic crop (ir) - - ! Number of crop functional types actually used in the model. This includes each CFT for - ! which is_pft_known_to_model is true. Note that this includes irrigated crops even if - ! irrigation is turned off in this run: it just excludes crop types that aren't handled - ! at all, as given by the mergetoclmpft list. - integer :: num_cfts_known_to_model - - ! !PUBLIC TYPES: - type, public :: pftcon_type - - integer , allocatable :: noveg (:) ! value for not vegetated - integer , allocatable :: tree (:) ! tree or not? - - real(r8), allocatable :: dleaf (:) ! characteristic leaf dimension (m) - real(r8), allocatable :: c3psn (:) ! photosynthetic pathway: 0. = c4, 1. = c3 - real(r8), allocatable :: xl (:) ! leaf/stem orientation index - real(r8), allocatable :: rhol (:,:) ! leaf reflectance: 1=vis, 2=nir - real(r8), allocatable :: rhos (:,:) ! stem reflectance: 1=vis, 2=nir - real(r8), allocatable :: taul (:,:) ! leaf transmittance: 1=vis, 2=nir - real(r8), allocatable :: taus (:,:) ! stem transmittance: 1=vis, 2=nir - real(r8), allocatable :: z0mr (:) ! ratio of momentum roughness length to canopy top height (-) - real(r8), allocatable :: displar (:) ! ratio of displacement height to canopy top height (-) - real(r8), allocatable :: roota_par (:) ! CLM rooting distribution parameter [1/m] - real(r8), allocatable :: rootb_par (:) ! CLM rooting distribution parameter [1/m] - real(r8), allocatable :: crop (:) ! crop pft: 0. = not crop, 1. = crop pft - real(r8), allocatable :: irrigated (:) ! irrigated pft: 0. = not, 1. = irrigated - real(r8), allocatable :: smpso (:) ! soil water potential at full stomatal opening (mm) - real(r8), allocatable :: smpsc (:) ! soil water potential at full stomatal closure (mm) - real(r8), allocatable :: fnitr (:) ! foliage nitrogen limitation factor (-) - - ! CN code - real(r8), allocatable :: dwood (:) ! wood density (gC/m3) - real(r8), allocatable :: slatop (:) ! SLA at top of canopy [m^2/gC] - real(r8), allocatable :: dsladlai (:) ! dSLA/dLAI [m^2/gC] - real(r8), allocatable :: leafcn (:) ! leaf C:N [gC/gN] - real(r8), allocatable :: flnr (:) ! fraction of leaf N in Rubisco [no units] - real(r8), allocatable :: woody (:) ! woody lifeform flag (0 or 1) - real(r8), allocatable :: lflitcn (:) ! leaf litter C:N (gC/gN) - real(r8), allocatable :: frootcn (:) ! fine root C:N (gC/gN) - real(r8), allocatable :: livewdcn (:) ! live wood (phloem and ray parenchyma) C:N (gC/gN) - real(r8), allocatable :: deadwdcn (:) ! dead wood (xylem and heartwood) C:N (gC/gN) - real(r8), allocatable :: grperc (:) ! growth respiration parameter - real(r8), allocatable :: grpnow (:) ! growth respiration parameter - real(r8), allocatable :: rootprof_beta (:,:) ! CLM rooting distribution parameter for C and N inputs [unitless] - real(r8), allocatable :: root_radius (:) ! root radius (m) - real(r8), allocatable :: root_density (:) ! root density (gC/m3) - - ! crop - - ! These arrays give information about the merge of unused crop types to the types CLM - ! knows about. mergetoclmpft(m) gives the crop type that CLM uses to simulate input - ! type m (and mergetoclmpft(m) == m implies that CLM simulates crop type m - ! directly). is_pft_known_to_model(m) is true if CLM simulates crop type m, and false - ! otherwise. Note that these do NOT relate to whether irrigation is on or off in a - ! given simulation - that is handled separately. - integer , allocatable :: mergetoclmpft (:) - logical , allocatable :: is_pft_known_to_model (:) - - real(r8), allocatable :: graincn (:) ! grain C:N (gC/gN) - real(r8), allocatable :: mxtmp (:) ! parameter used in accFlds - real(r8), allocatable :: baset (:) ! parameter used in accFlds - real(r8), allocatable :: declfact (:) ! parameter used in CNAllocation - real(r8), allocatable :: bfact (:) ! parameter used in CNAllocation - real(r8), allocatable :: aleaff (:) ! parameter used in CNAllocation - real(r8), allocatable :: arootf (:) ! parameter used in CNAllocation - real(r8), allocatable :: astemf (:) ! parameter used in CNAllocation - real(r8), allocatable :: arooti (:) ! parameter used in CNAllocation - real(r8), allocatable :: fleafi (:) ! parameter used in CNAllocation - real(r8), allocatable :: allconsl (:) ! parameter used in CNAllocation - real(r8), allocatable :: allconss (:) ! parameter used in CNAllocation - real(r8), allocatable :: ztopmx (:) ! parameter used in CNVegStructUpdate - real(r8), allocatable :: laimx (:) ! parameter used in CNVegStructUpdate - real(r8), allocatable :: gddmin (:) ! parameter used in CNPhenology - real(r8), allocatable :: hybgdd (:) ! parameter used in CNPhenology - real(r8), allocatable :: lfemerg (:) ! parameter used in CNPhenology - real(r8), allocatable :: grnfill (:) ! parameter used in CNPhenology - integer , allocatable :: mxmat (:) ! parameter used in CNPhenology - real(r8), allocatable :: mbbopt (:) ! Ball-Berry equation slope used in Photosynthesis - real(r8), allocatable :: medlynslope (:) ! Medlyn equation slope used in Photosynthesis - real(r8), allocatable :: medlynintercept(:) ! Medlyn equation intercept used in Photosynthesis - integer , allocatable :: mnNHplantdate (:) ! minimum planting date for NorthHemisphere (YYYYMMDD) - integer , allocatable :: mxNHplantdate (:) ! maximum planting date for NorthHemisphere (YYYYMMDD) - integer , allocatable :: mnSHplantdate (:) ! minimum planting date for SouthHemisphere (YYYYMMDD) - integer , allocatable :: mxSHplantdate (:) ! maximum planting date for SouthHemisphere (YYYYMMDD) - real(r8), allocatable :: planttemp (:) ! planting temperature used in CNPhenology (K) - real(r8), allocatable :: minplanttemp (:) ! mininum planting temperature used in CNPhenology (K) - real(r8), allocatable :: froot_leaf (:) ! allocation parameter: new fine root C per new leaf C (gC/gC) - real(r8), allocatable :: stem_leaf (:) ! allocation parameter: new stem c per new leaf C (gC/gC) - real(r8), allocatable :: croot_stem (:) ! allocation parameter: new coarse root C per new stem C (gC/gC) - real(r8), allocatable :: flivewd (:) ! allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - real(r8), allocatable :: fcur (:) ! allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - real(r8), allocatable :: fcurdv (:) ! alternate fcur for use with cndv - real(r8), allocatable :: lf_flab (:) ! leaf litter labile fraction - real(r8), allocatable :: lf_fcel (:) ! leaf litter cellulose fraction - real(r8), allocatable :: lf_flig (:) ! leaf litter lignin fraction - real(r8), allocatable :: fr_flab (:) ! fine root litter labile fraction - real(r8), allocatable :: fr_fcel (:) ! fine root litter cellulose fraction - real(r8), allocatable :: fr_flig (:) ! fine root litter lignin fraction - real(r8), allocatable :: leaf_long (:) ! leaf longevity (yrs) - real(r8), allocatable :: evergreen (:) ! binary flag for evergreen leaf habit (0 or 1) - real(r8), allocatable :: stress_decid (:) ! binary flag for stress-deciduous leaf habit (0 or 1) - real(r8), allocatable :: season_decid (:) ! binary flag for seasonal-deciduous leaf habit (0 or 1) - real(r8), allocatable :: pconv (:) ! proportion of deadstem to conversion flux - real(r8), allocatable :: pprod10 (:) ! proportion of deadstem to 10-yr product pool - real(r8), allocatable :: pprod100 (:) ! proportion of deadstem to 100-yr product pool - real(r8), allocatable :: pprodharv10 (:) ! harvest mortality proportion of deadstem to 10-yr pool - - ! pft paraemeters for fire code - real(r8), allocatable :: cc_leaf (:) - real(r8), allocatable :: cc_lstem (:) - real(r8), allocatable :: cc_dstem (:) - real(r8), allocatable :: cc_other (:) - real(r8), allocatable :: fm_leaf (:) - real(r8), allocatable :: fm_lstem (:) - real(r8), allocatable :: fm_dstem (:) - real(r8), allocatable :: fm_other (:) - real(r8), allocatable :: fm_root (:) - real(r8), allocatable :: fm_lroot (:) - real(r8), allocatable :: fm_droot (:) - real(r8), allocatable :: fsr_pft (:) - real(r8), allocatable :: fd_pft (:) - - ! pft parameters for crop code - real(r8), allocatable :: manunitro (:) ! manure - real(r8), allocatable :: fleafcn (:) ! C:N during grain fill; leaf - real(r8), allocatable :: ffrootcn (:) ! C:N during grain fill; fine root - real(r8), allocatable :: fstemcn (:) ! C:N during grain fill; stem - - real(r8), allocatable :: i_vcad (:) - real(r8), allocatable :: s_vcad (:) - real(r8), allocatable :: i_flnr (:) - real(r8), allocatable :: s_flnr (:) - - ! pft parameters for CNDV code (from LPJ subroutine pftparameters) - real(r8), allocatable :: pftpar20 (:) ! tree maximum crown area (m2) - real(r8), allocatable :: pftpar28 (:) ! min coldest monthly mean temperature - real(r8), allocatable :: pftpar29 (:) ! max coldest monthly mean temperature - real(r8), allocatable :: pftpar30 (:) ! min growing degree days (>= 5 deg C) - real(r8), allocatable :: pftpar31 (:) ! upper limit of temperature of the warmest month (twmax) - - ! pft parameters for FUN - real(r8), allocatable :: a_fix (:) ! A BNF parameter - real(r8), allocatable :: b_fix (:) ! A BNF parameter - real(r8), allocatable :: c_fix (:) ! A BNF parameter - real(r8), allocatable :: s_fix (:) ! A BNF parameter - real(r8), allocatable :: akc_active (:) ! A mycorrhizal uptake parameter - real(r8), allocatable :: akn_active (:) ! A mycorrhizal uptake parameter - real(r8), allocatable :: ekc_active (:) ! A mycorrhizal uptake parameter - real(r8), allocatable :: ekn_active (:) ! A mycorrhizal uptake parameter - real(r8), allocatable :: kc_nonmyc (:) ! A non-mycorrhizal uptake parameter - real(r8), allocatable :: kn_nonmyc (:) ! A non-mycorrhizal uptake parameter - real(r8), allocatable :: kr_resorb (:) ! A retrasnlcation parameter - real(r8), allocatable :: perecm (:) ! The fraction of ECM-associated PFT - real(r8), allocatable :: fun_cn_flex_a (:) ! Parameter a of FUN-flexcn link code (def 5) - real(r8), allocatable :: fun_cn_flex_b (:) ! Parameter b of FUN-flexcn link code (def 200) - real(r8), allocatable :: fun_cn_flex_c (:) ! Parameter b of FUN-flexcn link code (def 80) - real(r8), allocatable :: FUN_fracfixers(:) ! Fraction of C that can be used for fixation. - - - ! pft parameters for dynamic root code - real(r8), allocatable :: root_dmx(:) !maximum root depth - - contains - - procedure, public :: Init - procedure, public :: InitForTesting ! version of Init meant for unit testing - procedure, public :: Clean - procedure, private :: InitAllocate - procedure, private :: InitRead - procedure, private :: set_is_pft_known_to_model ! Set is_pft_known_to_model based on mergetoclmpft - procedure, private :: set_num_cfts_known_to_model ! Set the module-level variable, num_cfts_known_to_model - - end type pftcon_type - - type(pftcon_type), public :: pftcon ! pft type constants structure - - integer, parameter :: pftname_len = 40 ! max length of pftname - character(len=pftname_len) :: pftname(0:mxpft) ! PFT description - - real(r8), parameter :: reinickerp = 1.6_r8 ! parameter in allometric equation - real(r8), parameter :: dwood = 2.5e5_r8 ! cn wood density (gC/m3); lpj:2.0e5 - real(r8), parameter :: allom1 = 100.0_r8 ! parameters in - real(r8), parameter :: allom2 = 40.0_r8 ! ...allometric - real(r8), parameter :: allom3 = 0.5_r8 ! ...equations - real(r8), parameter :: allom1s = 250.0_r8 ! modified for shrubs by - real(r8), parameter :: allom2s = 8.0_r8 ! X.D.Z -! root radius, density from Bonan, GMD, 2014 - real(r8), parameter :: root_density = 0.31e06_r8 !(g biomass / m3 root) - real(r8), parameter :: root_radius = 0.29e-03_r8 !(m) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------ - subroutine Init(this) - - class(pftcon_type) :: this - - call this%InitAllocate() - call this%InitRead() - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitForTesting(this) - ! Version of Init meant for unit testing - ! - ! Allocate arrays, but don't try to read from file. - ! - ! Values can then be set by tests as needed - - class(pftcon_type) :: this - - call this%InitAllocate() - - end subroutine InitForTesting - - !----------------------------------------------------------------------- - subroutine InitAllocate (this) - ! - ! !DESCRIPTION: - ! Read and initialize vegetation (PFT) constants - ! - ! !USES: - use clm_varpar , only: nvariants - implicit none - ! - ! !ARGUMENTS: - class(pftcon_type) :: this - !----------------------------------------------------------------------- - - allocate( this%noveg (0:mxpft)); this%noveg (:) =huge(1) - allocate( this%tree (0:mxpft)); this%tree (:) =huge(1) - - allocate( this%dleaf (0:mxpft) ) - allocate( this%c3psn (0:mxpft) ) - allocate( this%xl (0:mxpft) ) - allocate( this%rhol (0:mxpft,numrad) ) - allocate( this%rhos (0:mxpft,numrad) ) - allocate( this%taul (0:mxpft,numrad) ) - allocate( this%taus (0:mxpft,numrad) ) - allocate( this%z0mr (0:mxpft) ) - allocate( this%displar (0:mxpft) ) - allocate( this%roota_par (0:mxpft) ) - allocate( this%rootb_par (0:mxpft) ) - allocate( this%crop (0:mxpft) ) - allocate( this%mergetoclmpft (0:mxpft) ) - allocate( this%is_pft_known_to_model (0:mxpft) ) - allocate( this%irrigated (0:mxpft) ) - allocate( this%smpso (0:mxpft) ) - allocate( this%smpsc (0:mxpft) ) - allocate( this%fnitr (0:mxpft) ) - allocate( this%slatop (0:mxpft) ) - allocate( this%dsladlai (0:mxpft) ) - allocate( this%leafcn (0:mxpft) ) - allocate( this%flnr (0:mxpft) ) - allocate( this%woody (0:mxpft) ) - allocate( this%lflitcn (0:mxpft) ) - allocate( this%frootcn (0:mxpft) ) - allocate( this%livewdcn (0:mxpft) ) - allocate( this%deadwdcn (0:mxpft) ) - allocate( this%grperc (0:mxpft) ) - allocate( this%grpnow (0:mxpft) ) - allocate( this%rootprof_beta (0:mxpft,nvariants) ) - allocate( this%graincn (0:mxpft) ) - allocate( this%mxtmp (0:mxpft) ) - allocate( this%baset (0:mxpft) ) - allocate( this%declfact (0:mxpft) ) - allocate( this%bfact (0:mxpft) ) - allocate( this%aleaff (0:mxpft) ) - allocate( this%arootf (0:mxpft) ) - allocate( this%astemf (0:mxpft) ) - allocate( this%arooti (0:mxpft) ) - allocate( this%fleafi (0:mxpft) ) - allocate( this%allconsl (0:mxpft) ) - allocate( this%allconss (0:mxpft) ) - allocate( this%ztopmx (0:mxpft) ) - allocate( this%laimx (0:mxpft) ) - allocate( this%gddmin (0:mxpft) ) - allocate( this%hybgdd (0:mxpft) ) - allocate( this%lfemerg (0:mxpft) ) - allocate( this%grnfill (0:mxpft) ) - allocate( this%mbbopt (0:mxpft) ) - allocate( this%medlynslope (0:mxpft) ) - allocate( this%medlynintercept(0:mxpft) ) - allocate( this%mxmat (0:mxpft) ) - allocate( this%mnNHplantdate (0:mxpft) ) - allocate( this%mxNHplantdate (0:mxpft) ) - allocate( this%mnSHplantdate (0:mxpft) ) - allocate( this%mxSHplantdate (0:mxpft) ) - allocate( this%planttemp (0:mxpft) ) - allocate( this%minplanttemp (0:mxpft) ) - allocate( this%froot_leaf (0:mxpft) ) - allocate( this%stem_leaf (0:mxpft) ) - allocate( this%croot_stem (0:mxpft) ) - allocate( this%flivewd (0:mxpft) ) - allocate( this%fcur (0:mxpft) ) - allocate( this%fcurdv (0:mxpft) ) - allocate( this%lf_flab (0:mxpft) ) - allocate( this%lf_fcel (0:mxpft) ) - allocate( this%lf_flig (0:mxpft) ) - allocate( this%fr_flab (0:mxpft) ) - allocate( this%fr_fcel (0:mxpft) ) - allocate( this%fr_flig (0:mxpft) ) - allocate( this%leaf_long (0:mxpft) ) - allocate( this%evergreen (0:mxpft) ) - allocate( this%stress_decid (0:mxpft) ) - allocate( this%season_decid (0:mxpft) ) - allocate( this%dwood (0:mxpft) ) - allocate( this%root_density (0:mxpft) ) - allocate( this%root_radius (0:mxpft) ) - allocate( this%pconv (0:mxpft) ) - allocate( this%pprod10 (0:mxpft) ) - allocate( this%pprod100 (0:mxpft) ) - allocate( this%pprodharv10 (0:mxpft) ) - allocate( this%cc_leaf (0:mxpft) ) - allocate( this%cc_lstem (0:mxpft) ) - allocate( this%cc_dstem (0:mxpft) ) - allocate( this%cc_other (0:mxpft) ) - allocate( this%fm_leaf (0:mxpft) ) - allocate( this%fm_lstem (0:mxpft) ) - allocate( this%fm_dstem (0:mxpft) ) - allocate( this%fm_other (0:mxpft) ) - allocate( this%fm_root (0:mxpft) ) - allocate( this%fm_lroot (0:mxpft) ) - allocate( this%fm_droot (0:mxpft) ) - allocate( this%fsr_pft (0:mxpft) ) - allocate( this%fd_pft (0:mxpft) ) - allocate( this%manunitro (0:mxpft) ) - allocate( this%fleafcn (0:mxpft) ) - allocate( this%ffrootcn (0:mxpft) ) - allocate( this%fstemcn (0:mxpft) ) - allocate( this%i_vcad (0:mxpft) ) - allocate( this%s_vcad (0:mxpft) ) - allocate( this%i_flnr (0:mxpft) ) - allocate( this%s_flnr (0:mxpft) ) - allocate( this%pftpar20 (0:mxpft) ) - allocate( this%pftpar28 (0:mxpft) ) - allocate( this%pftpar29 (0:mxpft) ) - allocate( this%pftpar30 (0:mxpft) ) - allocate( this%pftpar31 (0:mxpft) ) - allocate( this%a_fix (0:mxpft) ) - allocate( this%b_fix (0:mxpft) ) - allocate( this%c_fix (0:mxpft) ) - allocate( this%s_fix (0:mxpft) ) - allocate( this%akc_active (0:mxpft) ) - allocate( this%akn_active (0:mxpft) ) - allocate( this%ekc_active (0:mxpft) ) - allocate( this%ekn_active (0:mxpft) ) - allocate( this%kc_nonmyc (0:mxpft) ) - allocate( this%kn_nonmyc (0:mxpft) ) - allocate( this%kr_resorb (0:mxpft) ) - allocate( this%perecm (0:mxpft) ) - allocate( this%root_dmx (0:mxpft) ) - allocate( this%fun_cn_flex_a (0:mxpft) ) - allocate( this%fun_cn_flex_b (0:mxpft) ) - allocate( this%fun_cn_flex_c (0:mxpft) ) - allocate( this%FUN_fracfixers(0:mxpft) ) - - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine InitRead(this) - ! - ! !DESCRIPTION: - ! Read and initialize vegetation (PFT) constants - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use fileutils , only : getfil - use ncdio_pio , only : ncd_io, ncd_pio_closefile, ncd_pio_openfile, file_desc_t - use ncdio_pio , only : ncd_inqdid, ncd_inqdlen - use clm_varctl , only : paramfile, use_fates, use_flexibleCN, use_dynroot - use spmdMod , only : masterproc - use CLMFatesParamInterfaceMod, only : FatesReadPFTs - ! - ! !ARGUMENTS: - class(pftcon_type) :: this - ! - ! !LOCAL VARIABLES: - character(len=256) :: locfn ! local file name - integer :: i,n,m ! loop indices - integer :: ier ! error code - type(file_desc_t) :: ncid ! pio netCDF file id - integer :: dimid ! netCDF dimension id - integer :: npft ! number of pfts on pft-physiology file - logical :: readv ! read variable in or not - character(len=32) :: subname = 'InitRead' ! subroutine name - character(len=pftname_len) :: expected_pftnames(0:mxpft) - character(len=512) :: msg - !----------------------------------------------------------------------- - ! - ! Expected PFT names: The names expected on the paramfile file and the order they are expected to be in. - ! NOTE: similar types are assumed to be together, first trees (ending with broadleaf_deciduous_boreal_tree - ! then shrubs, ending with broadleaf_deciduous_boreal_shrub, then grasses starting with c3_arctic_grass - ! and finally crops, ending with irrigated_tropical_soybean - ! DO NOT CHANGE THE ORDER -- WITHOUT MODIFYING OTHER PARTS OF THE CODE WHERE THE ORDER MATTERS! - - expected_pftnames( 0) = 'not_vegetated ' - expected_pftnames( 1) = 'needleleaf_evergreen_temperate_tree' - expected_pftnames( 2) = 'needleleaf_evergreen_boreal_tree ' - expected_pftnames( 3) = 'needleleaf_deciduous_boreal_tree ' - expected_pftnames( 4) = 'broadleaf_evergreen_tropical_tree ' - expected_pftnames( 5) = 'broadleaf_evergreen_temperate_tree ' - expected_pftnames( 6) = 'broadleaf_deciduous_tropical_tree ' - expected_pftnames( 7) = 'broadleaf_deciduous_temperate_tree ' - expected_pftnames( 8) = 'broadleaf_deciduous_boreal_tree ' - expected_pftnames( 9) = 'broadleaf_evergreen_shrub ' - expected_pftnames(10) = 'broadleaf_deciduous_temperate_shrub' - expected_pftnames(11) = 'broadleaf_deciduous_boreal_shrub ' - expected_pftnames(12) = 'c3_arctic_grass ' - expected_pftnames(13) = 'c3_non-arctic_grass ' - expected_pftnames(14) = 'c4_grass ' - expected_pftnames(15) = 'c3_crop ' - expected_pftnames(16) = 'c3_irrigated ' - expected_pftnames(17) = 'temperate_corn ' - expected_pftnames(18) = 'irrigated_temperate_corn ' - expected_pftnames(19) = 'spring_wheat ' - expected_pftnames(20) = 'irrigated_spring_wheat ' - expected_pftnames(21) = 'winter_wheat ' - expected_pftnames(22) = 'irrigated_winter_wheat ' - expected_pftnames(23) = 'temperate_soybean ' - expected_pftnames(24) = 'irrigated_temperate_soybean ' - expected_pftnames(25) = 'barley ' - expected_pftnames(26) = 'irrigated_barley ' - expected_pftnames(27) = 'winter_barley ' - expected_pftnames(28) = 'irrigated_winter_barley ' - expected_pftnames(29) = 'rye ' - expected_pftnames(30) = 'irrigated_rye ' - expected_pftnames(31) = 'winter_rye ' - expected_pftnames(32) = 'irrigated_winter_rye ' - expected_pftnames(33) = 'cassava ' - expected_pftnames(34) = 'irrigated_cassava ' - expected_pftnames(35) = 'citrus ' - expected_pftnames(36) = 'irrigated_citrus ' - expected_pftnames(37) = 'cocoa ' - expected_pftnames(38) = 'irrigated_cocoa ' - expected_pftnames(39) = 'coffee ' - expected_pftnames(40) = 'irrigated_coffee ' - expected_pftnames(41) = 'cotton ' - expected_pftnames(42) = 'irrigated_cotton ' - expected_pftnames(43) = 'datepalm ' - expected_pftnames(44) = 'irrigated_datepalm ' - expected_pftnames(45) = 'foddergrass ' - expected_pftnames(46) = 'irrigated_foddergrass ' - expected_pftnames(47) = 'grapes ' - expected_pftnames(48) = 'irrigated_grapes ' - expected_pftnames(49) = 'groundnuts ' - expected_pftnames(50) = 'irrigated_groundnuts ' - expected_pftnames(51) = 'millet ' - expected_pftnames(52) = 'irrigated_millet ' - expected_pftnames(53) = 'oilpalm ' - expected_pftnames(54) = 'irrigated_oilpalm ' - expected_pftnames(55) = 'potatoes ' - expected_pftnames(56) = 'irrigated_potatoes ' - expected_pftnames(57) = 'pulses ' - expected_pftnames(58) = 'irrigated_pulses ' - expected_pftnames(59) = 'rapeseed ' - expected_pftnames(60) = 'irrigated_rapeseed ' - expected_pftnames(61) = 'rice ' - expected_pftnames(62) = 'irrigated_rice ' - expected_pftnames(63) = 'sorghum ' - expected_pftnames(64) = 'irrigated_sorghum ' - expected_pftnames(65) = 'sugarbeet ' - expected_pftnames(66) = 'irrigated_sugarbeet ' - expected_pftnames(67) = 'sugarcane ' - expected_pftnames(68) = 'irrigated_sugarcane ' - expected_pftnames(69) = 'sunflower ' - expected_pftnames(70) = 'irrigated_sunflower ' - expected_pftnames(71) = 'miscanthus ' - expected_pftnames(72) = 'irrigated_miscanthus ' - expected_pftnames(73) = 'switchgrass ' - expected_pftnames(74) = 'irrigated_switchgrass ' - expected_pftnames(75) = 'tropical_corn ' - expected_pftnames(76) = 'irrigated_tropical_corn ' - expected_pftnames(77) = 'tropical_soybean ' - expected_pftnames(78) = 'irrigated_tropical_soybean ' - - ! Set specific vegetation type values - - if (masterproc) then - write(iulog,*) 'Attempting to read PFT physiological data .....' - end if - call getfil (paramfile, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqdid(ncid, 'pft', dimid) - call ncd_inqdlen(ncid, dimid, npft) - - if (npft - 1 /= mxpft) then - ! NOTE(bja, 201503) need to subtract 1 because of indexing. - ! NOTE(bja, 201503) fail early because one of the io libs - ! throws a useless abort error message deep inside the stack - ! instead of returning readv so we can get a useful line - ! number. - write(msg, '(a, i4, a, i4, a)') "ERROR: The number of pfts in the input netcdf file (", & - npft, ") does not equal the expected number of pfts (", mxpft, "). " - call endrun(msg=trim(msg)//errMsg(sourcefile, __LINE__)) - end if - - call ncd_io('pftname',pftname, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('z0mr', this%z0mr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('displar', this%displar, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('dleaf', this%dleaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('c3psn', this%c3psn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rholvis', this%rhol(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rholnir', this%rhol(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rhosvis', this%rhos(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rhosnir', this% rhos(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('taulvis', this%taul(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('taulnir', this%taul(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('tausvis', this%taus(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('tausnir', this%taus(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('xl', this%xl, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('roota_par', this%roota_par, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rootb_par', this%rootb_par, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('slatop', this%slatop, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('dsladlai', this%dsladlai, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('leafcn', this%leafcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('flnr', this%flnr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('smpso', this%smpso, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('smpsc', this%smpsc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fnitr', this%fnitr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('woody', this%woody, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('lflitcn', this%lflitcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('frootcn', this%frootcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('livewdcn', this%livewdcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('deadwdcn', this%deadwdcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('grperc', this%grperc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('grpnow', this%grpnow, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('froot_leaf', this%froot_leaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('stem_leaf', this%stem_leaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('croot_stem', this%croot_stem, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('flivewd', this%flivewd, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fcur', this%fcur, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fcurdv', this%fcurdv, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('lf_flab', this%lf_flab, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('lf_fcel', this%lf_fcel, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('lf_flig', this%lf_flig, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fr_flab', this%fr_flab, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fr_fcel', this%fr_fcel, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fr_flig', this%fr_flig, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('leaf_long', this%leaf_long, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('evergreen', this%evergreen, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('stress_decid', this%stress_decid, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('season_decid', this%season_decid, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pftpar20', this%pftpar20, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pftpar28', this%pftpar28, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pftpar29', this%pftpar29, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pftpar30', this%pftpar30, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pftpar31', this%pftpar31, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('a_fix', this%a_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('b_fix', this%b_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('c_fix', this%c_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('s_fix', this%s_fix, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('akc_active', this%akc_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('akn_active', this%akn_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('ekc_active', this%ekc_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('ekn_active', this%ekn_active, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('kc_nonmyc', this%kc_nonmyc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('kn_nonmyc', this%kn_nonmyc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('kr_resorb', this%kr_resorb, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('perecm', this%perecm, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fun_cn_flex_a', this%fun_cn_flex_a, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fun_cn_flex_b', this%fun_cn_flex_b, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fun_cn_flex_c', this%fun_cn_flex_c, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('FUN_fracfixers', this%FUN_fracfixers, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('manunitro', this%manunitro, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fleafcn', this%fleafcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('ffrootcn', this%ffrootcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fstemcn', this%fstemcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('rootprof_beta', this%rootprof_beta, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pconv', this%pconv, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pprod10', this%pprod10, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pprodharv10', this%pprodharv10, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('pprod100', this%pprod100, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('graincn', this%graincn, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('mxtmp', this%mxtmp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('baset', this%baset, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('declfact', this%declfact, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('bfact', this%bfact, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('aleaff', this%aleaff, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('arootf', this%arootf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('astemf', this%astemf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('arooti', this%arooti, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fleafi', this%fleafi, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('allconsl', this%allconsl, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('allconss', this%allconss, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('crop', this%crop, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('mergetoclmpft', this%mergetoclmpft, 'read', ncid, readvar=readv) - if ( .not. readv ) then - call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - end if - - call ncd_io('irrigated', this%irrigated, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('ztopmx', this%ztopmx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('laimx', this%laimx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('gddmin', this%gddmin, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('hybgdd', this%hybgdd, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('lfemerg', this%lfemerg, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('grnfill', this%grnfill, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('mbbopt', this%mbbopt, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('medlynslope', this%medlynslope, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('cc_leaf', this% cc_leaf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('cc_lstem', this%cc_lstem, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('cc_dstem', this%cc_dstem, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('cc_other', this%cc_other, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_leaf', this% fm_leaf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_lstem', this%fm_lstem, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_dstem', this%fm_dstem, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_other', this%fm_other, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_root', this% fm_root, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_lroot', this%fm_lroot, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fm_droot', this%fm_droot, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fsr_pft', this% fsr_pft, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('fd_pft', this% fd_pft, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('planting_temp', this%planttemp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('min_planting_temp', this%minplanttemp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('min_NH_planting_date', this%mnNHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('min_SH_planting_date', this%mnSHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('max_NH_planting_date', this%mxNHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('max_SH_planting_date', this%mxSHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - ! - ! Constants - ! - !MV (10-08-14) TODO is this right - used to be numpft - is it okay to set it to mxpft? - do m = 0,mxpft - this%dwood(m) = dwood - this%root_radius(m) = root_radius - this%root_density(m) = root_density - - if (m <= ntree) then - this%tree(m) = 1 - else - this%tree(m) = 0 - end if - end do - ! - ! clm 5 nitrogen variables - ! - if (use_flexibleCN) then - call ncd_io('i_vcad', this%i_vcad, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('s_vcad', this%s_vcad, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('i_flnr', this%i_flnr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('s_flnr', this%s_flnr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - end if - - ! - ! Dynamic Root variables for crops - ! - if ( use_crop .and. use_dynroot )then - call ncd_io('root_dmx', this%root_dmx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - end if - - call ncd_pio_closefile(ncid) - - call FatesReadPFTs() - - do i = 0, mxpft - if (.not. use_fates)then - if ( trim(adjustl(pftname(i))) /= trim(expected_pftnames(i)) )then - write(iulog,*)'pftconrd: pftname is NOT what is expected, name = ', & - trim(pftname(i)), ', expected name = ', trim(expected_pftnames(i)) - call endrun(msg='pftconrd: bad name for pft on paramfile dataset'//errMsg(sourcefile, __LINE__)) - end if - end if - - if ( trim(pftname(i)) == 'not_vegetated' ) noveg = i - if ( trim(pftname(i)) == 'needleleaf_evergreen_temperate_tree' ) ndllf_evr_tmp_tree = i - if ( trim(pftname(i)) == 'needleleaf_evergreen_boreal_tree' ) ndllf_evr_brl_tree = i - if ( trim(pftname(i)) == 'needleleaf_deciduous_boreal_tree' ) ndllf_dcd_brl_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_tropical_tree' ) nbrdlf_evr_trp_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_temperate_tree' ) nbrdlf_evr_tmp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_tropical_tree' ) nbrdlf_dcd_trp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_temperate_tree' ) nbrdlf_dcd_tmp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_boreal_tree' ) nbrdlf_dcd_brl_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_shrub' ) nbrdlf_evr_shrub = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_temperate_shrub' ) nbrdlf_dcd_tmp_shrub = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_boreal_shrub' ) nbrdlf_dcd_brl_shrub = i - if ( trim(pftname(i)) == 'c3_arctic_grass' ) nc3_arctic_grass = i - if ( trim(pftname(i)) == 'c3_non-arctic_grass' ) nc3_nonarctic_grass = i - if ( trim(pftname(i)) == 'c4_grass' ) nc4_grass = i - if ( trim(pftname(i)) == 'c3_crop' ) nc3crop = i - if ( trim(pftname(i)) == 'c3_irrigated' ) nc3irrig = i - if ( trim(pftname(i)) == 'temperate_corn' ) ntmp_corn = i - if ( trim(pftname(i)) == 'irrigated_temperate_corn' ) nirrig_tmp_corn = i - if ( trim(pftname(i)) == 'spring_wheat' ) nswheat = i - if ( trim(pftname(i)) == 'irrigated_spring_wheat' ) nirrig_swheat = i - if ( trim(pftname(i)) == 'winter_wheat' ) nwwheat = i - if ( trim(pftname(i)) == 'irrigated_winter_wheat' ) nirrig_wwheat = i - if ( trim(pftname(i)) == 'temperate_soybean' ) ntmp_soybean = i - if ( trim(pftname(i)) == 'irrigated_temperate_soybean' ) nirrig_tmp_soybean = i - if ( trim(pftname(i)) == 'barley' ) nbarley = i - if ( trim(pftname(i)) == 'irrigated_barley' ) nirrig_barley = i - if ( trim(pftname(i)) == 'winter_barley' ) nwbarley = i - if ( trim(pftname(i)) == 'irrigated_winter_barley' ) nirrig_wbarley = i - if ( trim(pftname(i)) == 'rye' ) nrye = i - if ( trim(pftname(i)) == 'irrigated_rye' ) nirrig_rye = i - if ( trim(pftname(i)) == 'winter_rye' ) nwrye = i - if ( trim(pftname(i)) == 'irrigated_winter_rye' ) nirrig_wrye = i - if ( trim(pftname(i)) == 'cassava' ) ncassava = i - if ( trim(pftname(i)) == 'irrigated_cassava' ) nirrig_cassava = i - if ( trim(pftname(i)) == 'citrus' ) ncitrus = i - if ( trim(pftname(i)) == 'irrigated_citrus' ) nirrig_citrus = i - if ( trim(pftname(i)) == 'cocoa' ) ncocoa = i - if ( trim(pftname(i)) == 'irrigated_cocoa' ) nirrig_cocoa = i - if ( trim(pftname(i)) == 'coffee' ) ncoffee = i - if ( trim(pftname(i)) == 'irrigated_coffee' ) nirrig_coffee = i - if ( trim(pftname(i)) == 'cotton' ) ncotton = i - if ( trim(pftname(i)) == 'irrigated_cotton' ) nirrig_cotton = i - if ( trim(pftname(i)) == 'datepalm' ) ndatepalm = i - if ( trim(pftname(i)) == 'irrigated_datepalm' ) nirrig_datepalm = i - if ( trim(pftname(i)) == 'foddergrass' ) nfoddergrass = i - if ( trim(pftname(i)) == 'irrigated_foddergrass' ) nirrig_foddergrass = i - if ( trim(pftname(i)) == 'grapes' ) ngrapes = i - if ( trim(pftname(i)) == 'irrigated_grapes' ) nirrig_grapes = i - if ( trim(pftname(i)) == 'groundnuts' ) ngroundnuts = i - if ( trim(pftname(i)) == 'irrigated_groundnuts' ) nirrig_groundnuts = i - if ( trim(pftname(i)) == 'millet' ) nmillet = i - if ( trim(pftname(i)) == 'irrigated_millet' ) nirrig_millet = i - if ( trim(pftname(i)) == 'oilpalm' ) noilpalm = i - if ( trim(pftname(i)) == 'irrigated_oilpalm' ) nirrig_oilpalm = i - if ( trim(pftname(i)) == 'potatoes' ) npotatoes = i - if ( trim(pftname(i)) == 'irrigated_potatoes' ) nirrig_potatoes = i - if ( trim(pftname(i)) == 'pulses' ) npulses = i - if ( trim(pftname(i)) == 'irrigated_pulses' ) nirrig_pulses = i - if ( trim(pftname(i)) == 'rapeseed' ) nrapeseed = i - if ( trim(pftname(i)) == 'irrigated_rapeseed' ) nirrig_rapeseed = i - if ( trim(pftname(i)) == 'rice' ) nrice = i - if ( trim(pftname(i)) == 'irrigated_rice' ) nirrig_rice = i - if ( trim(pftname(i)) == 'sorghum' ) nsorghum = i - if ( trim(pftname(i)) == 'irrigated_sorghum' ) nirrig_sorghum = i - if ( trim(pftname(i)) == 'sugarbeet' ) nsugarbeet = i - if ( trim(pftname(i)) == 'irrigated_sugarbeet' ) nirrig_sugarbeet = i - if ( trim(pftname(i)) == 'sugarcane' ) nsugarcane = i - if ( trim(pftname(i)) == 'irrigated_sugarcane' ) nirrig_sugarcane = i - if ( trim(pftname(i)) == 'sunflower' ) nsunflower = i - if ( trim(pftname(i)) == 'irrigated_sunflower' ) nirrig_sunflower = i - if ( trim(pftname(i)) == 'miscanthus' ) nmiscanthus = i - if ( trim(pftname(i)) == 'irrigated_miscanthus' ) nirrig_miscanthus = i - if ( trim(pftname(i)) == 'switchgrass' ) nswitchgrass = i - if ( trim(pftname(i)) == 'irrigated_switchgrass' ) nirrig_switchgrass = i - if ( trim(pftname(i)) == 'tropical_corn' ) ntrp_corn = i - if ( trim(pftname(i)) == 'irrigated_tropical_corn' ) nirrig_trp_corn = i - if ( trim(pftname(i)) == 'tropical_soybean' ) ntrp_soybean = i - if ( trim(pftname(i)) == 'irrigated_tropical_soybean' ) nirrig_trp_soybean = i - end do - - ntree = nbrdlf_dcd_brl_tree ! value for last type of tree - npcropmin = ntmp_corn ! first prognostic crop - npcropmax = mxpft ! last prognostic crop in list - - call this%set_is_pft_known_to_model() - call this%set_num_cfts_known_to_model() - - if (use_cndv) then - this%fcur(:) = this%fcurdv(:) - end if - ! - ! Do some error checking, but not if fates is on. - ! - ! FIX(SPM,032414) double check if some of these should be on... - - if( .not. use_fates ) then - if ( npcropmax /= mxpft )then - call endrun(msg=' ERROR: npcropmax is NOT the last value'//errMsg(sourcefile, __LINE__)) - end if - do i = 0, mxpft - if ( this%irrigated(i) == 1.0_r8 .and. & - (i == nc3irrig .or. & - i == nirrig_tmp_corn .or. & - i == nirrig_swheat .or. i == nirrig_wwheat .or. & - i == nirrig_tmp_soybean .or. & - i == nirrig_barley .or. i == nirrig_wbarley .or. & - i == nirrig_rye .or. i == nirrig_wrye .or. & - i == nirrig_cassava .or. & - i == nirrig_citrus .or. & - i == nirrig_cocoa .or. i == nirrig_coffee .or. & - i == nirrig_cotton .or. & - i == nirrig_datepalm .or. & - i == nirrig_foddergrass .or. & - i == nirrig_grapes .or. i == nirrig_groundnuts .or. & - i == nirrig_millet .or. & - i == nirrig_oilpalm .or. & - i == nirrig_potatoes .or. i == nirrig_pulses .or. & - i == nirrig_rapeseed .or. i == nirrig_rice .or. & - i == nirrig_sorghum .or. & - i == nirrig_sugarbeet .or. i == nirrig_sugarcane .or. & - i == nirrig_sunflower .or. & - i == nirrig_miscanthus .or. i == nirrig_switchgrass .or. & - i == nirrig_trp_corn .or. & - i == nirrig_trp_soybean) )then - ! correct - else if ( this%irrigated(i) == 0.0_r8 )then - ! correct - else - call endrun(msg=' ERROR: irrigated has wrong values'//errMsg(sourcefile, __LINE__)) - end if - if ( this%crop(i) == 1.0_r8 .and. (i >= nc3crop .and. i <= npcropmax) )then - ! correct - else if ( this%crop(i) == 0.0_r8 )then - ! correct - else - call endrun(msg=' ERROR: crop has wrong values'//errMsg(sourcefile, __LINE__)) - end if - if ( (i /= noveg) .and. (i < npcropmin) .and. & - abs(this%pconv(i) + this%pprod10(i) + this%pprod100(i) - 1.0_r8) > 1.e-7_r8 )then - call endrun(msg=' ERROR: pconv+pprod10+pprod100 do NOT sum to one.'//errMsg(sourcefile, __LINE__)) - end if - if ( this%pprodharv10(i) > 1.0_r8 .or. this%pprodharv10(i) < 0.0_r8 )then - call endrun(msg=' ERROR: pprodharv10 outside of range.'//errMsg(sourcefile, __LINE__)) - end if - end do - end if - - if (masterproc) then - write(iulog,*) 'Successfully read PFT physiological data' - write(iulog,*) - end if - - end subroutine InitRead - - !----------------------------------------------------------------------- - subroutine set_is_pft_known_to_model(this) - ! - ! !DESCRIPTION: - ! Set is_pft_known_to_model based on mergetoclmpft - ! - ! !USES: - ! - ! !ARGUMENTS: - class(pftcon_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - integer :: m, merge_type - - character(len=*), parameter :: subname = 'set_is_pft_known_to_model' - !----------------------------------------------------------------------- - - this%is_pft_known_to_model(:) = .false. - - ! NOTE(wjs, 2015-10-04) Currently, type 0 has mergetoclmpft = _FillValue in the file, - ! so we can't handle it in the general loop below. But CLM always uses type 0, so - ! handle it specially here. - this%is_pft_known_to_model(0) = .true. - - ! NOTE(wjs, 2015-10-04) Currently, mergetoclmpft is only used for crop types. - ! However, we handle it more generally here (treating ALL pft types), in case its use - ! is ever extended to work with non-crop types as well. - do m = 1, mxpft - merge_type = this%mergetoclmpft(m) - this%is_pft_known_to_model(merge_type) = .true. - end do - - end subroutine set_is_pft_known_to_model - - !----------------------------------------------------------------------- - subroutine set_num_cfts_known_to_model(this) - ! - ! !DESCRIPTION: - ! Set the module-level variable, num_cfts_known_to_model - ! - ! !USES: - ! - ! !ARGUMENTS: - class(pftcon_type), intent(in) :: this - ! - ! !LOCAL VARIABLES: - integer :: m - - character(len=*), parameter :: subname = 'set_num_cfts_known_to_model' - !----------------------------------------------------------------------- - - num_cfts_known_to_model = 0 - do m = cft_lb, cft_ub - if (this%is_pft_known_to_model(m)) then - num_cfts_known_to_model = num_cfts_known_to_model + 1 - end if - end do - - end subroutine set_num_cfts_known_to_model - - !----------------------------------------------------------------------- - subroutine Clean(this) - ! - ! !DESCRIPTION: - ! Deallocate memory - ! - ! !USES: - ! - ! !ARGUMENTS: - class(pftcon_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - deallocate( this%noveg) - deallocate( this%tree) - - deallocate( this%dleaf) - deallocate( this%c3psn) - deallocate( this%xl) - deallocate( this%rhol) - deallocate( this%rhos) - deallocate( this%taul) - deallocate( this%taus) - deallocate( this%z0mr) - deallocate( this%displar) - deallocate( this%roota_par) - deallocate( this%rootb_par) - deallocate( this%crop) - deallocate( this%mergetoclmpft) - deallocate( this%is_pft_known_to_model) - deallocate( this%irrigated) - deallocate( this%smpso) - deallocate( this%smpsc) - deallocate( this%fnitr) - deallocate( this%slatop) - deallocate( this%dsladlai) - deallocate( this%leafcn) - deallocate( this%flnr) - deallocate( this%woody) - deallocate( this%lflitcn) - deallocate( this%frootcn) - deallocate( this%livewdcn) - deallocate( this%deadwdcn) - deallocate( this%grperc) - deallocate( this%grpnow) - deallocate( this%rootprof_beta) - deallocate( this%graincn) - deallocate( this%mxtmp) - deallocate( this%baset) - deallocate( this%declfact) - deallocate( this%bfact) - deallocate( this%aleaff) - deallocate( this%arootf) - deallocate( this%astemf) - deallocate( this%arooti) - deallocate( this%fleafi) - deallocate( this%allconsl) - deallocate( this%allconss) - deallocate( this%ztopmx) - deallocate( this%laimx) - deallocate( this%gddmin) - deallocate( this%hybgdd) - deallocate( this%lfemerg) - deallocate( this%grnfill) - deallocate( this%mbbopt) - deallocate( this%medlynslope) - deallocate( this%medlynintercept) - deallocate( this%mxmat) - deallocate( this%mnNHplantdate) - deallocate( this%mxNHplantdate) - deallocate( this%mnSHplantdate) - deallocate( this%mxSHplantdate) - deallocate( this%planttemp) - deallocate( this%minplanttemp) - deallocate( this%froot_leaf) - deallocate( this%stem_leaf) - deallocate( this%croot_stem) - deallocate( this%flivewd) - deallocate( this%fcur) - deallocate( this%fcurdv) - deallocate( this%lf_flab) - deallocate( this%lf_fcel) - deallocate( this%lf_flig) - deallocate( this%fr_flab) - deallocate( this%fr_fcel) - deallocate( this%fr_flig) - deallocate( this%leaf_long) - deallocate( this%evergreen) - deallocate( this%stress_decid) - deallocate( this%season_decid) - deallocate( this%dwood) - deallocate( this%root_density) - deallocate( this%root_radius) - deallocate( this%pconv) - deallocate( this%pprod10) - deallocate( this%pprod100) - deallocate( this%pprodharv10) - deallocate( this%cc_leaf) - deallocate( this%cc_lstem) - deallocate( this%cc_dstem) - deallocate( this%cc_other) - deallocate( this%fm_leaf) - deallocate( this%fm_lstem) - deallocate( this%fm_dstem) - deallocate( this%fm_other) - deallocate( this%fm_root) - deallocate( this%fm_lroot) - deallocate( this%fm_droot) - deallocate( this%fsr_pft) - deallocate( this%fd_pft) - deallocate( this%manunitro) - deallocate( this%fleafcn) - deallocate( this%ffrootcn) - deallocate( this%fstemcn) - deallocate( this%i_vcad) - deallocate( this%s_vcad) - deallocate( this%i_flnr) - deallocate( this%s_flnr) - deallocate( this%pftpar20) - deallocate( this%pftpar28) - deallocate( this%pftpar29) - deallocate( this%pftpar30) - deallocate( this%pftpar31) - deallocate( this%a_fix) - deallocate( this%b_fix) - deallocate( this%c_fix) - deallocate( this%s_fix) - deallocate( this%akc_active) - deallocate( this%akn_active) - deallocate( this%ekc_active) - deallocate( this%ekn_active) - deallocate( this%kc_nonmyc) - deallocate( this%kn_nonmyc) - deallocate( this%kr_resorb) - deallocate( this%perecm) - deallocate( this%root_dmx) - deallocate( this%fun_cn_flex_a) - deallocate( this%fun_cn_flex_b) - deallocate( this%fun_cn_flex_c) - deallocate( this%FUN_fracfixers) - - end subroutine Clean - -end module pftconMod - diff --git a/src/main/readParamsMod.F90 b/src/main/readParamsMod.F90 deleted file mode 100644 index 7fbea89531..0000000000 --- a/src/main/readParamsMod.F90 +++ /dev/null @@ -1,107 +0,0 @@ -module readParamsMod - - !----------------------------------------------------------------------- - ! - ! Read parameters - ! module used to read parameters for individual modules and/or for some - ! well defined functionality (eg. ED). - ! - ! ! USES: - use clm_varctl , only : paramfile, iulog, use_fates, use_cn - use spmdMod , only : masterproc - use fileutils , only : getfil - use ncdio_pio , only : ncd_pio_closefile, ncd_pio_openfile - use ncdio_pio , only : file_desc_t , ncd_inqdid, ncd_inqdlen - - implicit none - private - ! - public :: readParameters - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParameters (nutrient_competition_method, photosyns_inst) - ! - ! ! USES: - use CNSharedParamsMod , only : CNParamsReadShared - use CNGapMortalityMod , only : readCNGapMortParams => readParams - use CNMRespMod , only : readCNMRespParams => readParams - use CNFUNMod , only : readCNFUNParams => readParams - use CNPhenologyMod , only : readCNPhenolParams => readParams - use SoilBiogeochemCompetitionMod , only : readSoilBiogeochemCompetitionParams => readParams - use SoilBiogeochemNLeachingMod , only : readSoilBiogeochemNLeachingParams => readParams - use SoilBiogeochemNitrifDenitrifMod , only : readSoilBiogeochemNitrifDenitrifParams => readParams - use SoilBiogeochemLittVertTranspMod , only : readSoilBiogeochemLittVertTranspParams => readParams - use SoilBiogeochemPotentialMod , only : readSoilBiogeochemPotentialParams => readParams - use SoilBiogeochemDecompMod , only : readSoilBiogeochemDecompParams => readParams - use SoilBiogeochemDecompCascadeBGCMod , only : readSoilBiogeochemDecompBgcParams => readParams - use SoilBiogeochemDecompCascadeCNMod , only : readSoilBiogeochemDecompCnParams => readParams - use ch4Mod , only : readCH4Params => readParams - use NutrientCompetitionMethodMod , only : nutrient_competition_method_type - use clm_varctl, only : NLFilename_in - use PhotosynthesisMod , only : photosyns_type - ! - ! !ARGUMENTS: - type(photosyns_type) , intent(in) :: photosyns_inst - class(nutrient_competition_method_type), intent(in) :: nutrient_competition_method - ! - ! !LOCAL VARIABLES: - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! pio netCDF file id - integer :: dimid ! netCDF dimension id - integer :: npft ! number of pfts on pft-physiology file - character(len=32) :: subname = 'readParameters' - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'paramMod.F90::'//trim(subname)//' :: reading CLM '//' parameters ' - end if - - call getfil (paramfile, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqdid(ncid,'pft',dimid) - call ncd_inqdlen(ncid,dimid,npft) - - ! - ! Above ground biogeochemistry... - ! - if (use_cn) then - call nutrient_competition_method%readParams(ncid) - call readCNGapMortParams(ncid) - call readCNMRespParams(ncid) - call readCNFUNParams(ncid) - call readCNPhenolParams(ncid) - end if - - ! - ! Soil biogeochemistry... - ! - if (use_cn .or. use_fates) then - call readSoilBiogeochemCompetitionParams(ncid) - call readSoilBiogeochemDecompBgcParams(ncid) - call readSoilBiogeochemDecompCnParams(ncid) - call readSoilBiogeochemDecompParams(ncid) - call readSoilBiogeochemLittVertTranspParams(ncid) - call readSoilBiogeochemNitrifDenitrifParams(ncid) - call readSoilBiogeochemNLeachingParams(ncid) - call readSoilBiogeochemPotentialParams(ncid) - call CNParamsReadShared(ncid, NLFilename_in) ! this is called CN params but really is for the soil biogeochem parameters - - call readCH4Params (ncid) - end if - - ! - ! Biogeophysics - ! - call photosyns_inst%ReadParams( ncid ) - - - ! - call ncd_pio_closefile(ncid) - - end subroutine readParameters - -end module readParamsMod diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 deleted file mode 100644 index c352572d02..0000000000 --- a/src/main/restFileMod.F90 +++ /dev/null @@ -1,933 +0,0 @@ -module restFileMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Reads from or writes to/ the CLM restart file. - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, get_proc_clumps, get_clump_bounds - use decompMod , only : BOUNDS_LEVEL_PROC - use spmdMod , only : masterproc, mpicom - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_time_manager , only : timemgr_restart_io, get_nstep - use subgridRestMod , only : subgridRestWrite, subgridRestRead, subgridRest_read_cleanup - use accumulMod , only : accumulRest - use clm_instMod , only : clm_instRest - use histFileMod , only : hist_restart_ncd - use clm_varctl , only : iulog, use_fates, use_hydrstress - use clm_varctl , only : create_crop_landunit, irrigate - use clm_varcon , only : nameg, namel, namec, namep, nameCohort - use ncdio_pio , only : file_desc_t, ncd_pio_createfile, ncd_pio_openfile, ncd_global - use ncdio_pio , only : ncd_pio_closefile, ncd_defdim, ncd_putatt, ncd_enddef, check_dim - use ncdio_pio , only : check_att, ncd_getatt - use glcBehaviorMod , only : glc_behavior_type - use reweightMod , only : reweight_wrapup - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: restFile_read - public :: restFile_write - public :: restFile_open - public :: restFile_close - public :: restFile_getfile - public :: restFile_filename ! Sets restart filename - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: restFile_set_derived ! On a read, set variables derived from others - private :: restFile_read_pfile - private :: restFile_write_pfile ! Writes restart pointer file - private :: restFile_closeRestart ! Close restart file and write restart pointer file - private :: restFile_dimset - private :: restFile_add_flag_metadata ! Add global metadata for some logical flag - private :: restFile_add_ilun_metadata ! Add global metadata defining landunit types - private :: restFile_add_icol_metadata ! Add global metadata defining column types - private :: restFile_add_ipft_metadata ! Add global metadata defining patch types - private :: restFile_dimcheck - private :: restFile_enddef - private :: restFile_check_consistency ! Perform consistency checks on the restart file - private :: restFile_read_consistency_nl ! Read namelist associated with consistency checks - private :: restFile_check_year ! Check consistency of year on the restart file - ! - ! !PRIVATE TYPES: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine restFile_write( bounds, file, rdate, noptr) - ! - ! !DESCRIPTION: - ! Define/write CLM restart file. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: file ! output netcdf restart file - character(len=*) , intent(in), optional :: rdate ! restart file time stamp for name - logical , intent(in), optional :: noptr ! if should NOT write to the restart pointer file - ! - ! !LOCAL VARIABLES: - type(file_desc_t) :: ncid ! netcdf id - integer :: i ! index - logical :: ptrfile ! write out the restart pointer file - !----------------------------------------------------------------------- - - if ( present(noptr) )then - ptrfile = .not. noptr - else - ptrfile = .true. - end if - - ! Open file - - call restFile_open( flag='write', file=file, ncid=ncid ) - - ! Define dimensions and variables - - call restFile_dimset ( ncid ) - - call timemgr_restart_io(ncid, flag='define') - - call subgridRestWrite(bounds, ncid, flag='define' ) - - call accumulRest( ncid, flag='define' ) - - call clm_instRest(bounds, ncid, flag='define') - - if (present(rdate)) then - call hist_restart_ncd (bounds, ncid, flag='define', rdate=rdate ) - end if - - call restFile_enddef( ncid ) - - ! Write variables - - call timemgr_restart_io( ncid, flag='write' ) - - call subgridRestWrite(bounds, ncid, flag='write' ) - - call accumulRest( ncid, flag='write' ) - - call clm_instRest(bounds, ncid, flag='write') - - call hist_restart_ncd (bounds, ncid, flag='write' ) - - ! Close file - - call restFile_close( ncid ) - call restFile_closeRestart( file ) - - ! Write restart pointer file - - if ( ptrfile ) call restFile_write_pfile( file ) - - ! Write out diagnostic info - - if (masterproc) then - write(iulog,*) 'Successfully wrote out restart data at nstep = ',get_nstep() - write(iulog,'(72a1)') ("-",i=1,60) - end if - - end subroutine restFile_write - - !----------------------------------------------------------------------- - subroutine restFile_read( bounds_proc, file, glc_behavior ) - ! - ! !DESCRIPTION: - ! Read a CLM restart file. - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds_proc ! processor-level bounds - character(len=*) , intent(in) :: file ! output netcdf restart file - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - type(file_desc_t) :: ncid ! netcdf id - integer :: i ! index - integer :: nclumps ! number of clumps on this processor - integer :: nc ! clump index - type(bounds_type) :: bounds_clump - - character(len=*), parameter :: subname = 'restFile_read' - !----------------------------------------------------------------------- - - ! The provided bounds need to be proc-level bounds. This is in part because of logic - ! below that divides this into clump-level bounds for the sake of reweight_wrapup. - ! But it *MAY* also be necessary to have proc-level bounds for these i/o routines. - SHR_ASSERT(bounds_proc%level == BOUNDS_LEVEL_PROC, subname // ': argument must be PROC-level bounds') - - ! Open file - - call restFile_open( flag='read', file=file, ncid=ncid ) - - ! Read file - - call restFile_dimcheck( ncid ) - - call subgridRestRead(bounds_proc, ncid) - - ! Now that we have updated subgrid information, update the filters, active flags, - ! etc. accordingly. We do these updates as soon as possible so that the updated - ! filters and active flags are available to other restart routines - e.g., for the - ! sake of subgridAveMod calls like c2g. - ! - ! The reweight_wrapup call needs to be done inside a clump loop, so we set that up - ! here. - nclumps = get_proc_clumps() - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1, nclumps - call get_clump_bounds(nc, bounds_clump) - call reweight_wrapup(bounds_clump, glc_behavior) - end do - !$OMP END PARALLEL DO - - call accumulRest( ncid, flag='read' ) - - call clm_instRest( bounds_proc, ncid, flag='read' ) - - call restFile_set_derived(bounds_proc, glc_behavior) - - call hist_restart_ncd (bounds_proc, ncid, flag='read' ) - - ! Do error checking on file - - call restFile_check_consistency(bounds_proc, ncid) - - ! Close file - - call subgridRest_read_cleanup - call restFile_close( ncid ) - - ! Write out diagnostic info - - if (masterproc) then - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Successfully read restart data for restart run' - write(iulog,*) - end if - - end subroutine restFile_read - - !----------------------------------------------------------------------- - subroutine restFile_getfile( file, path ) - ! - ! !DESCRIPTION: - ! Determine and obtain netcdf restart file - ! - ! !USES: - use clm_varctl, only : caseid, nrevsn, nsrest, brnch_retain_casename - use clm_varctl, only : nsrContinue, nsrBranch - use fileutils , only : getfil - ! - ! !ARGUMENTS: - character(len=*), intent(out) :: file ! name of netcdf restart file - character(len=*), intent(out) :: path ! full pathname of netcdf restart file - ! - ! !LOCAL VARIABLES: - integer :: status ! return status - integer :: length ! temporary - character(len=256) :: ftest,ctest ! temporaries - !----------------------------------------------------------------------- - - ! Continue run: - ! Restart file pathname is read restart pointer file - - if (nsrest==nsrContinue) then - call restFile_read_pfile( path ) - call getfil( path, file, 0 ) - end if - - ! Branch run: - ! Restart file pathname is obtained from namelist "nrevsn" - ! Check case name consistency (case name must be different for branch run, - ! unless namelist specification states otherwise) - - if (nsrest==nsrBranch) then - length = len_trim(nrevsn) - if (nrevsn(length-2:length) == '.nc') then - path = trim(nrevsn) - else - path = trim(nrevsn) // '.nc' - end if - call getfil( path, file, 0 ) - - ! tcraig, adding xx. and .clm2 makes this more robust - ctest = 'xx.'//trim(caseid)//'.clm2' - ftest = 'xx.'//trim(file) - status = index(trim(ftest),trim(ctest)) - if (status /= 0 .and. .not.(brnch_retain_casename)) then - if (masterproc) then - write(iulog,*) 'Must change case name on branch run if ',& - 'brnch_retain_casename namelist is not set' - write(iulog,*) 'previous case filename= ',trim(file),& - ' current case = ',trim(caseid), & - ' ctest = ',trim(ctest), & - ' ftest = ',trim(ftest) - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine restFile_getfile - - !----------------------------------------------------------------------- - subroutine restFile_set_derived(bounds, glc_behavior) - ! - ! !DESCRIPTION: - ! Upon a restart read, set variables that are not on the restart file, but can be - ! derived from variables that are on the restart file. - ! - ! This should be called after variables are read from the restart file. - ! - ! !USES: - ! - ! NOTE(wjs, 2016-04-05) Is it an architectural violation to use topo_inst directly - ! here? I can't see a good way around it. - use clm_instMod, only : topo_inst - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'restFile_set_derived' - !----------------------------------------------------------------------- - - call glc_behavior%update_glc_classes(bounds, topo_inst%topo_col(bounds%begc:bounds%endc)) - - end subroutine restFile_set_derived - - !----------------------------------------------------------------------- - subroutine restFile_read_pfile( pnamer ) - ! - ! !DESCRIPTION: - ! Setup restart file and perform necessary consistency checks - ! - ! !USES: - use fileutils , only : opnfil, getavu, relavu - use clm_varctl, only : rpntfil, rpntdir, inst_suffix - ! - ! !ARGUMENTS: - character(len=*), intent(out) :: pnamer ! full path of restart file - ! - ! !LOCAL VARIABLES: - !EOP - integer :: i ! indices - integer :: nio ! restart unit - integer :: status ! substring check status - character(len=256) :: locfn ! Restart pointer file name - !----------------------------------------------------------------------- - - ! Obtain the restart file from the restart pointer file. - ! For restart runs, the restart pointer file contains the full pathname - ! of the restart file. For branch runs, the namelist variable - ! [nrevsn] contains the full pathname of the restart file. - ! New history files are always created for branch runs. - - if (masterproc) then - write(iulog,*) 'Reading restart pointer file....' - endif - - nio = getavu() - locfn = trim(rpntdir) //'/'// trim(rpntfil)//trim(inst_suffix) - call opnfil (locfn, nio, 'f') - read (nio,'(a256)') pnamer - call relavu (nio) - - if (masterproc) then - write(iulog,*) 'Reading restart data.....' - write(iulog,'(72a1)') ("-",i=1,60) - end if - - end subroutine restFile_read_pfile - - !----------------------------------------------------------------------- - subroutine restFile_closeRestart( file ) - ! - ! !DESCRIPTION: - ! Close restart file and write restart pointer file if - ! in write mode, otherwise just close restart file if in read mode - ! - ! !USES: - use clm_time_manager, only : is_last_step - ! - ! !ARGUMENTS: - character(len=*) , intent(in) :: file ! local output filename - ! - ! !CALLED FROM: - ! subroutine restart in this module - ! - ! !REVISION HISTORY: - ! Author: Mariana Vertenstein - ! - ! - ! !LOCAL VARIABLES: - !EOP - integer :: i !index - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Successfully wrote local restart file ',trim(file) - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) - end if - - end subroutine restFile_closeRestart - - !----------------------------------------------------------------------- - subroutine restFile_write_pfile( fnamer ) - ! - ! !DESCRIPTION: - ! Open restart pointer file. Write names of current netcdf restart file. - ! - ! !USES: - use clm_varctl, only : rpntdir, rpntfil, inst_suffix - use fileutils , only : relavu - use fileutils , only : getavu, opnfil - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fnamer - ! - ! !LOCAL VARIABLES: - integer :: m ! index - integer :: nio ! restart pointer file - character(len=256) :: filename ! local file name - !----------------------------------------------------------------------- - - if (masterproc) then - nio = getavu() - filename= trim(rpntdir) //'/'// trim(rpntfil)//trim(inst_suffix) - call opnfil( filename, nio, 'f' ) - - write(nio,'(a)') fnamer - call relavu( nio ) - write(iulog,*)'Successfully wrote local restart pointer file' - end if - - end subroutine restFile_write_pfile - - !----------------------------------------------------------------------- - subroutine restFile_open( flag, file, ncid ) - - use clm_time_manager, only : get_nstep - - character(len=*), intent(in) :: flag ! flag to specify read or write - character(len=*), intent(in) :: file ! filename - type(file_desc_t), intent(out):: ncid ! netcdf id - - integer :: omode ! netCDF dummy variable - character(len= 32) :: subname='restFile_open' ! subroutine name - - if (flag == 'write') then - - ! Create new netCDF file (in define mode) and set fill mode - ! to "no fill" to optimize performance - - if (masterproc) then - write(iulog,*) - write(iulog,*)'restFile_open: writing restart dataset at ',& - trim(file), ' at nstep = ',get_nstep() - write(iulog,*) - end if - call ncd_pio_createfile(ncid, trim(file)) - - else if (flag == 'read') then - - ! Open netcdf restart file - - if (masterproc) then - write(iulog,*) 'Reading restart dataset' - end if - call ncd_pio_openfile (ncid, trim(file), 0) - - end if - - end subroutine restFile_open - - !----------------------------------------------------------------------- - character(len=256) function restFile_filename( rdate ) - ! - ! !DESCRIPTION: - ! - ! !USES: - use clm_varctl, only : caseid, inst_suffix - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: rdate ! input date for restart file name - !----------------------------------------------------------------------- - - restFile_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".r."//trim(rdate)//".nc" - if (masterproc) then - write(iulog,*)'writing restart file ',trim(restFile_filename),' for model date = ',rdate - end if - - end function restFile_filename - - !------------------------------------------------------------------------ - subroutine restFile_dimset( ncid ) - ! - ! !DESCRIPTION: - ! Read/Write initial data from/to netCDF instantaneous initial data file - ! - ! !USES: - use clm_time_manager , only : get_nstep - use clm_varctl , only : caseid, ctitle, version, username, hostname, fsurdat - use clm_varctl , only : conventions, source - use dynSubgridControlMod , only : get_flanduse_timeseries - use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd, nlevurb, nlevcan - use clm_varpar , only : maxpatch_glcmec, nvegwcs - use decompMod , only : get_proc_global - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid - ! - ! !LOCAL VARIABLES: - integer :: dimid ! netCDF dimension id - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: numCohort ! total number of cohorts across all processors - integer :: ier ! error status - integer :: strlen_dimid ! string dimension id - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len=256) :: str - character(len= 32) :: subname='restFile_dimset' ! subroutine name - !------------------------------------------------------------------------ - - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort) - - ! Define dimensions - - call ncd_defdim(ncid , nameg , numg , dimid) - call ncd_defdim(ncid , namel , numl , dimid) - call ncd_defdim(ncid , namec , numc , dimid) - call ncd_defdim(ncid , namep , nump , dimid) - call ncd_defdim(ncid , nameCohort , numCohort , dimid) - - call ncd_defdim(ncid , 'levgrnd' , nlevgrnd , dimid) - call ncd_defdim(ncid , 'levurb' , nlevurb , dimid) - call ncd_defdim(ncid , 'levlak' , nlevlak , dimid) - call ncd_defdim(ncid , 'levsno' , nlevsno , dimid) - call ncd_defdim(ncid , 'levsno1' , nlevsno+1 , dimid) - call ncd_defdim(ncid , 'levtot' , nlevsno+nlevgrnd, dimid) - call ncd_defdim(ncid , 'numrad' , numrad , dimid) - call ncd_defdim(ncid , 'levcan' , nlevcan , dimid) - if ( use_hydrstress ) then - call ncd_defdim(ncid , 'vegwcs' , nvegwcs , dimid) - end if - call ncd_defdim(ncid , 'string_length', 64 , dimid) - call ncd_defdim(ncid , 'glc_nec', maxpatch_glcmec, dimid) - call ncd_defdim(ncid , 'glc_nec1', maxpatch_glcmec+1, dimid) - - ! Define global attributes - - call ncd_putatt(ncid, NCD_GLOBAL, 'Conventions', trim(conventions)) - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(ncid, NCD_GLOBAL, 'history' , trim(str)) - call ncd_putatt(ncid, NCD_GLOBAL, 'username', trim(username)) - call ncd_putatt(ncid, NCD_GLOBAL, 'host' , trim(hostname)) - call ncd_putatt(ncid, NCD_GLOBAL, 'version' , trim(version)) - call ncd_putatt(ncid, NCD_GLOBAL, 'source' , trim(source)) - str = '$Id: restFileMod.F90 41292 2012-10-26 13:51:45Z erik $' - call ncd_putatt(ncid, NCD_GLOBAL, 'revision_id' , trim(str)) - call ncd_putatt(ncid, NCD_GLOBAL, 'case_title' , trim(ctitle)) - call ncd_putatt(ncid, NCD_GLOBAL, 'case_id' , trim(caseid)) - call ncd_putatt(ncid, NCD_GLOBAL, 'surface_dataset', trim(fsurdat)) - call ncd_putatt(ncid, NCD_GLOBAL, 'flanduse_timeseries', trim(get_flanduse_timeseries())) - call ncd_putatt(ncid, NCD_GLOBAL, 'title', 'CLM Restart information') - - call restFile_add_flag_metadata(ncid, create_crop_landunit, 'create_crop_landunit') - call restFile_add_flag_metadata(ncid, irrigate, 'irrigate') - ! BACKWARDS_COMPATIBILITY(wjs, 2017-12-13) created_glacier_mec_landunits is always - ! true now. However, we can't remove the read of this field from init_interp until we - ! can reliably assume that all initial conditions files that might be used in - ! init_interp have this flag .true. So until then, we write the flag with a - ! hard-coded .true. value. - call restFile_add_flag_metadata(ncid, .true., 'created_glacier_mec_landunits') - - call restFile_add_ipft_metadata(ncid) - call restFile_add_icol_metadata(ncid) - call restFile_add_ilun_metadata(ncid) - - end subroutine restFile_dimset - - !----------------------------------------------------------------------- - subroutine restFile_add_flag_metadata(ncid, flag, flag_name) - ! - ! !DESCRIPTION: - ! Add global metadata for some logical flag - ! - ! !USES: - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid ! local file id - logical , intent(in) :: flag ! logical flag - character(len=*) , intent(in) :: flag_name ! name of netcdf attribute - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'restFile_add_flag_metadata' - !----------------------------------------------------------------------- - - if (flag) then - call ncd_putatt(ncid, ncd_global, flag_name, 'true') - else - call ncd_putatt(ncid, ncd_global, flag_name, 'false') - end if - - end subroutine restFile_add_flag_metadata - - - !----------------------------------------------------------------------- - subroutine restFile_add_ilun_metadata(ncid) - ! - ! !DESCRIPTION: - ! Add global metadata defining landunit types - ! - ! !USES: - use landunit_varcon, only : max_lunit, landunit_names, landunit_name_length - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid ! local file id - ! - ! !LOCAL VARIABLES: - integer :: ltype ! landunit type - character(len=*), parameter :: att_prefix = 'ilun_' ! prefix for attributes - character(len=len(att_prefix)+landunit_name_length) :: attname ! attribute name - - character(len=*), parameter :: subname = 'restFile_add_ilun_metadata' - !----------------------------------------------------------------------- - - do ltype = 1, max_lunit - attname = att_prefix // landunit_names(ltype) - call ncd_putatt(ncid, ncd_global, attname, ltype) - end do - - end subroutine restFile_add_ilun_metadata - - !----------------------------------------------------------------------- - subroutine restFile_add_icol_metadata(ncid) - ! - ! !DESCRIPTION: - ! Add global metadata defining column types - ! - ! !USES: - use column_varcon, only : write_coltype_metadata - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid ! local file id - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: att_prefix = 'icol_' ! prefix for attributes - - character(len=*), parameter :: subname = 'restFile_add_icol_metadata' - !----------------------------------------------------------------------- - - call write_coltype_metadata(att_prefix, ncid) - - end subroutine restFile_add_icol_metadata - - !----------------------------------------------------------------------- - subroutine restFile_add_ipft_metadata(ncid) - ! - ! !DESCRIPTION: - ! Add global metadata defining patch types - ! - ! !USES: - use clm_varpar, only : natpft_lb, mxpft, cft_lb, cft_ub - use pftconMod , only : pftname_len, pftname - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid ! local file id - ! - ! !LOCAL VARIABLES: - integer :: ptype ! patch type - character(len=*), parameter :: att_prefix = 'ipft_' ! prefix for attributes - character(len=len(att_prefix)+pftname_len) :: attname ! attribute name - - character(len=*), parameter :: subname = 'restFile_add_ipft_metadata' - !----------------------------------------------------------------------- - - do ptype = natpft_lb, mxpft - attname = att_prefix // pftname(ptype) - call ncd_putatt(ncid, ncd_global, attname, ptype) - end do - - call ncd_putatt(ncid, ncd_global, 'cft_lb', cft_lb) - call ncd_putatt(ncid, ncd_global, 'cft_ub', cft_ub) - - end subroutine restFile_add_ipft_metadata - - !----------------------------------------------------------------------- - subroutine restFile_dimcheck( ncid ) - ! - ! !DESCRIPTION: - ! Check dimensions of restart file - ! - ! !USES: - use decompMod, only : get_proc_global - use clm_varpar, only : nlevsno, nlevlak, nlevgrnd, nlevurb - use clm_varctl, only : single_column, nsrest, nsrStartup - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid - ! - ! !LOCAL VARIABLES: - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: numCohort ! total number of cohorts across all processors - character(len=:), allocatable :: msg ! diagnostic message - character(len=32) :: subname='restFile_dimcheck' ! subroutine name - !----------------------------------------------------------------------- - - ! Get relevant sizes - - if ( .not. single_column .or. nsrest /= nsrStartup )then - call get_proc_global(ng=numg, nl=numl, nc=numc, np=nump, nCohorts=numCohort) - msg = 'Did you mean to set use_init_interp = .true. in user_nl_clm?' // & - new_line('x') // & - '(Setting use_init_interp = .true. is needed when doing a' // & - new_line('x') // & - 'transient run using an initial conditions file from a non-transient run,' // & - new_line('x') // & - 'or a non-transient run using an initial conditions file from a transient run,' // & - new_line('x') // & - 'or when running a resolution or configuration that differs from the initial conditions.)' - call check_dim(ncid, nameg, numg, msg=msg) - call check_dim(ncid, namel, numl, msg=msg) - call check_dim(ncid, namec, numc, msg=msg) - call check_dim(ncid, namep, nump, msg=msg) - if ( use_fates ) call check_dim(ncid, nameCohort , numCohort, msg=msg) - end if - msg = 'You can deal with this mismatch by rerunning with ' // & - 'use_init_interp = .true. in user_nl_clm' - call check_dim(ncid, 'levsno' , nlevsno, msg=msg) - call check_dim(ncid, 'levgrnd' , nlevgrnd, msg=msg) - call check_dim(ncid, 'levurb' , nlevurb) - call check_dim(ncid, 'levlak' , nlevlak) - - end subroutine restFile_dimcheck - - !----------------------------------------------------------------------- - subroutine restFile_enddef( ncid ) - ! - ! !DESCRIPTION: - ! Read a CLM restart file. - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid - !----------------------------------------------------------------------- - - call ncd_enddef(ncid) - - end subroutine restFile_enddef - - !----------------------------------------------------------------------- - subroutine restFile_close( ncid ) - ! - ! !DESCRIPTION: - ! Read a CLM restart file. - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname='restFile_close' ! subroutine name - !----------------------------------------------------------------------- - - call ncd_pio_closefile(ncid) - - end subroutine restFile_close - - !----------------------------------------------------------------------- - subroutine restFile_check_consistency(bounds, ncid) - ! - ! !DESCRIPTION: - ! Perform some consistency checks on the restart file - ! - ! !USES: - use subgridRestMod, only : subgridRest_check_consistency - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - ! - ! !LOCAL VARIABLES: - logical :: check_finidat_year_consistency ! whether to check consistency between year on finidat file and current year - logical :: check_finidat_pct_consistency ! whether to check consistency between pct_pft on finidat file and surface dataset - - character(len=*), parameter :: subname = 'restFile_check_consistency' - !----------------------------------------------------------------------- - - call restFile_read_consistency_nl( & - check_finidat_year_consistency, & - check_finidat_pct_consistency) - - if (check_finidat_year_consistency) then - call restFile_check_year(ncid) - end if - - if (check_finidat_pct_consistency) then - call subgridRest_check_consistency(bounds) - end if - - end subroutine restFile_check_consistency - - !----------------------------------------------------------------------- - subroutine restFile_read_consistency_nl( & - check_finidat_year_consistency, & - check_finidat_pct_consistency) - - ! - ! !DESCRIPTION: - ! Read namelist settings related to finidat consistency checks - ! - ! !USES: - use fileutils , only : getavu, relavu - use clm_nlUtilsMod , only : find_nlgroup_name - use controlMod , only : NLFilename - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! !ARGUMENTS: - logical, intent(out) :: check_finidat_year_consistency - logical, intent(out) :: check_finidat_pct_consistency - ! - ! !LOCAL VARIABLES: - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - - character(len=*), parameter :: subname = 'restFile_read_consistency_nl' - !----------------------------------------------------------------------- - - namelist /finidat_consistency_checks/ & - check_finidat_year_consistency, & - check_finidat_pct_consistency - - ! Set default namelist values - check_finidat_year_consistency = .true. - check_finidat_pct_consistency = .true. - - ! Read namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'finidat_consistency_checks', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=finidat_consistency_checks,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading finidat_consistency_checks namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg='ERROR finding finidat_consistency_checks namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast (check_finidat_year_consistency, mpicom) - call shr_mpi_bcast (check_finidat_pct_consistency, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'finidat_consistency_checks settings:' - write(iulog,nml=finidat_consistency_checks) - write(iulog,*) ' ' - end if - - end subroutine restFile_read_consistency_nl - - !----------------------------------------------------------------------- - subroutine restFile_check_year(ncid) - ! - ! !DESCRIPTION: - ! Make sure year on the restart file is consistent with the current model year - ! - ! !USES: - use clm_time_manager , only : get_curr_date, get_rest_date - use clm_varctl , only : fname_len - use dynSubgridControlMod , only : get_flanduse_timeseries - ! - ! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid ! netcdf id - ! - ! !LOCAL VARIABLES: - logical :: att_found ! whether the attribute was found on the netcdf file - character(len=fname_len) :: flanduse_timeseries_rest ! flanduse_timeseries from the restart file - integer :: year ! current model year - integer :: mon ! current model month - integer :: day ! current model day of month - integer :: tod ! current model time of day - integer :: rest_year ! year from restart file - - character(len=*), parameter :: subname = 'restFile_check_year' - !----------------------------------------------------------------------- - - ! Only do this check for a transient run - if (get_flanduse_timeseries() /= ' ') then - ! Determine if the restart file was generated from a transient run; if so, we will - ! do this consistency check. For backwards compatibility, we allow for the - ! possibility that the flanduse_timeseries attribute was not on the restart file; - ! in that case, we act as if the restart file was generated from a non-transient - ! run, thus skipping this check. - call check_att(ncid, NCD_GLOBAL, 'flanduse_timeseries', att_found) - if (att_found) then - call ncd_getatt(ncid, NCD_GLOBAL, 'flanduse_timeseries', flanduse_timeseries_rest) - else - write(iulog,*) ' ' - write(iulog,*) subname//' WARNING: flanduse_timeseries attribute not found on restart file' - write(iulog,*) 'Assuming that the restart file was generated from a non-transient run,' - write(iulog,*) 'and thus skipping the year check' - write(iulog,*) ' ' - - flanduse_timeseries_rest = ' ' - end if - - ! If the restart file was generated from a transient run, then confirm that the - ! year of the restart file matches the current model year. - if (flanduse_timeseries_rest /= ' ') then - call get_curr_date(year, mon, day, tod) - call get_rest_date(ncid, rest_year) - if (year /= rest_year) then - if (masterproc) then - write(iulog,*) 'ERROR: Current model year does not match year on initial conditions file (finidat)' - write(iulog,*) 'Current year: ', year - write(iulog,*) 'Year on initial conditions file: ', rest_year - write(iulog,*) ' ' - write(iulog,*) 'This match is a requirement when both:' - write(iulog,*) '(a) The current run is a transient run, and' - write(iulog,*) '(b) The initial conditions file was generated from a transient run' - write(iulog,*) ' ' - write(iulog,*) 'Possible solutions to this problem:' - write(iulog,*) '(1) Make sure RUN_STARTDATE is set correctly' - write(iulog,*) '(2) Make sure you are using the correct initial conditions file (finidat)' - write(iulog,*) '(3) If you are confident that you are using the correct start date and initial conditions file,' - write(iulog,*) ' yet are still experiencing this error, then you can bypass this check by setting:' - write(iulog,*) ' check_finidat_year_consistency = .false.' - write(iulog,*) ' in user_nl_clm' - write(iulog,*) ' ' - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if ! year /= rest_year - end if ! flanduse_timeseries_rest /= ' ' - end if ! fpftdyn /= ' ' - - end subroutine restFile_check_year - -end module restFileMod - - - diff --git a/src/main/reweightMod.F90 b/src/main/reweightMod.F90 deleted file mode 100644 index 5816fa1d1b..0000000000 --- a/src/main/reweightMod.F90 +++ /dev/null @@ -1,61 +0,0 @@ -module reweightMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Top level driver for things that happen when subgrid weights are changed. This is in - ! a separate module from subgridWeightsMod in order to keep subgridWeightsMod lower- - ! level - and particularly to break its dependency on filterMod. - ! - ! - ! !USES: -#include "shr_assert.h" - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - ! - ! PUBLIC TYPES: - implicit none - save - - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: reweight_wrapup ! do modifications and error-checks after modifying subgrid weights - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine reweight_wrapup(bounds, glc_behavior) - ! - ! !DESCRIPTION: - ! Do additional modifications and error-checks that should be done after modifying subgrid - ! weights - ! - ! This should be called whenever any weights change (e.g., patch weights on the column, - ! landunit weights on the grid cell, etc.). - ! - ! !USES: - use filterMod , only : setFilters - use subgridWeightsMod , only : set_active, check_weights - use decompMod , only : bounds_type, BOUNDS_LEVEL_CLUMP - use glcBehaviorMod , only : glc_behavior_type - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! clump bounds - type(glc_behavior_type), intent(in) :: glc_behavior - !------------------------------------------------------------------------ - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_CLUMP, errMsg(sourcefile, __LINE__)) - - call set_active(bounds, glc_behavior) - call check_weights(bounds, active_only=.false.) - call check_weights(bounds, active_only=.true.) - call setFilters(bounds, glc_behavior) - - end subroutine reweight_wrapup - -end module reweightMod diff --git a/src/main/subgridAveMod.F90 b/src/main/subgridAveMod.F90 deleted file mode 100644 index 3375add2e8..0000000000 --- a/src/main/subgridAveMod.F90 +++ /dev/null @@ -1,1347 +0,0 @@ -module subgridAveMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Utilities to perfrom subgrid averaging - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall - use column_varcon , only : icol_road_perv , icol_road_imperv - use clm_varcon , only : grlnd, nameg, namel, namec, namep,spval - use clm_varctl , only : iulog - use abortutils , only : endrun - use decompMod , only : bounds_type - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: p2c ! Perform an average patches to columns - public :: p2l ! Perform an average patches to landunits - public :: p2g ! Perform an average patches to gridcells - public :: c2l ! Perform an average columns to landunits - public :: c2g ! Perform an average columns to gridcells - public :: l2g ! Perform an average landunits to gridcells - - interface p2c - module procedure p2c_1d - module procedure p2c_2d - module procedure p2c_1d_filter - module procedure p2c_2d_filter - end interface - interface p2l - module procedure p2l_1d - module procedure p2l_2d - end interface - interface p2g - module procedure p2g_1d - module procedure p2g_2d - end interface - interface c2l - module procedure c2l_1d - module procedure c2l_2d - end interface - interface c2g - module procedure c2g_1d - module procedure c2g_2d - end interface - interface l2g - module procedure l2g_1d - module procedure l2g_2d - end interface - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: build_scale_l2g - private :: create_scale_l2g_lookup - - ! Note about the urban scaling types used for c2l_scale_type (urbanf / urbans), from - ! Bill Sacks and Keith Oleson: These names originally meant to distinguish between - ! fluxes and states. However, that isn't the right distinction. In general, urbanf - ! should be used for variables that are expressed as something-per-m^2 ('extensive' - ! state or flux variables), whereas urbans should be used for variables that are not - ! expressed as per-m^2 ('intensive' state variables; an example is temperature). The - ! urbanf scaling converts from per-m^2 of vertical wall area to per-m^2 of ground area. - ! One way to think about this is: In the extreme case of a near-infinite canyon_hwr due - ! to massively tall walls, do you want a near-infinite multiplier for the walls for the - ! variable in question? If so, you want urbanf; if not, you want urbans. - ! - ! However, there may be some special cases, including some hydrology variables that - ! don't apply for urban walls. - - ! WJS (10-14-11): TODO: - ! - ! - I believe that scale_p2c, scale_c2l and scale_l2g should be included in the sumwt - ! accumulations (e.g., sumwt = sumwt + wtgcell * scale_p2c * scale_c2l * scale_l2g), but - ! that requires some more thought to (1) make sure that is correct, and (2) make sure it - ! doesn't break the urban scaling. (See also my notes in create_scale_l2g_lookup.) - ! - Once that is done, you could use a scale of 0, avoiding the need for the use of - ! spval and the special checks that requires. - ! - ! - Currently, there is a lot of repeated code to calculate scale_c2l. This should be - ! cleaned up. - ! - At a minimum, should collect the repeated code into a subroutine to eliminate this - ! repitition - ! - The best thing might be to use a lookup array, as is done for scale_l2g - - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - ! ----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine p2c_1d (bounds, parr, carr, p2c_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from patches to columns. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: parr( bounds%begp: ) ! patch array - real(r8), intent(out) :: carr( bounds%begc: ) ! column array - character(len=*), intent(in) :: p2c_scale_type ! scale type - ! - ! !LOCAL VARIABLES: - integer :: p,c,index ! indices - real(r8) :: scale_p2c(bounds%begp:bounds%endp) ! scale factor for column->landunit mapping - logical :: found ! temporary for error check - real(r8) :: sumwt(bounds%begc:bounds%endc) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2c_1d error: scale type ',p2c_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - carr(bounds%begc:bounds%endc) = spval - sumwt(bounds%begc:bounds%endc) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtcol(p) /= 0._r8) then - if (parr(p) /= spval) then - c = patch%column(p) - if (sumwt(c) == 0._r8) carr(c) = 0._r8 - carr(c) = carr(c) + parr(p) * scale_p2c(p) * patch%wtcol(p) - sumwt(c) = sumwt(c) + patch%wtcol(p) - end if - end if - end do - found = .false. - do c = bounds%begc,bounds%endc - if (sumwt(c) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = c - else if (sumwt(c) /= 0._r8) then - carr(c) = carr(c)/sumwt(c) - end if - end do - if (found) then - write(iulog,*)'p2c_1d error: sumwt is greater than 1.0' - call endrun(decomp_index=index, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine p2c_1d - - !----------------------------------------------------------------------- - subroutine p2c_2d (bounds, num2d, parr, carr, p2c_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from landunits to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8) , intent(in) :: parr( bounds%begp: , 1: ) ! patch array - real(r8) , intent(out) :: carr( bounds%begc: , 1: ) ! column array - character(len=*) , intent(in) :: p2c_scale_type ! scale type - ! - ! !LOCAL VARIABLES: - integer :: j,p,c,index ! indices - real(r8) :: scale_p2c(bounds%begp:bounds%endp) ! scale factor for column->landunit mapping - logical :: found ! temporary for error check - real(r8) :: sumwt(bounds%begc:bounds%endc) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc, num2d/)), errMsg(sourcefile, __LINE__)) - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2c_2d error: scale type ',p2c_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - carr(bounds%begc : bounds%endc, :) = spval - do j = 1,num2d - sumwt(bounds%begc : bounds%endc) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtcol(p) /= 0._r8) then - if (parr(p,j) /= spval) then - c = patch%column(p) - if (sumwt(c) == 0._r8) carr(c,j) = 0._r8 - carr(c,j) = carr(c,j) + parr(p,j) * scale_p2c(p) * patch%wtcol(p) - sumwt(c) = sumwt(c) + patch%wtcol(p) - end if - end if - end do - found = .false. - do c = bounds%begc,bounds%endc - if (sumwt(c) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = c - else if (sumwt(c) /= 0._r8) then - carr(c,j) = carr(c,j)/sumwt(c) - end if - end do - if (found) then - write(iulog,*)'p2c_2d error: sumwt is greater than 1.0 at c= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - end do - end subroutine p2c_2d - - !----------------------------------------------------------------------- - subroutine p2c_1d_filter (bounds, numfc, filterc, patcharr, colarr) - ! - ! !DESCRIPTION: - ! perform patch to column averaging for single level patch arrays - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: numfc - integer , intent(in) :: filterc(numfc) - real(r8), intent(in) :: patcharr( bounds%begp: ) - real(r8), intent(out) :: colarr( bounds%begc: ) - ! - ! !LOCAL VARIABLES: - integer :: fc,c,p ! indices - !----------------------------------------------------------------------- - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(patcharr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(colarr) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - - do fc = 1,numfc - c = filterc(fc) - colarr(c) = 0._r8 - do p = col%patchi(c), col%patchf(c) - if (patch%active(p)) colarr(c) = colarr(c) + patcharr(p) * patch%wtcol(p) - end do - end do - - end subroutine p2c_1d_filter - - !----------------------------------------------------------------------- - subroutine p2c_2d_filter (lev, numfc, filterc, patcharr, colarr) - ! - ! !DESCRIPTION: - ! perform patch to column averaging for multi level patch arrays - ! - ! !ARGUMENTS: - integer , intent(in) :: lev - integer , intent(in) :: numfc - integer , intent(in) :: filterc(numfc) - real(r8), pointer :: patcharr(:,:) - real(r8), pointer :: colarr(:,:) - ! - ! !LOCAL VARIABLES: - integer :: fc,c,p,j ! indices - !----------------------------------------------------------------------- - - do j = 1,lev - do fc = 1,numfc - c = filterc(fc) - colarr(c,j) = 0._r8 - do p = col%patchi(c), col%patchf(c) - if (patch%active(p)) colarr(c,j) = colarr(c,j) + patcharr(p,j) * patch%wtcol(p) - end do - end do - end do - - end subroutine p2c_2d_filter - - !----------------------------------------------------------------------- - subroutine p2l_1d (bounds, parr, larr, p2c_scale_type, c2l_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from patches to landunits - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: parr( bounds%begp: ) ! input column array - real(r8), intent(out) :: larr( bounds%begl: ) ! output landunit array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights - real(r8) :: scale_p2c(bounds%begp:bounds%endp) ! scale factor for patch->column mapping - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor for column->landunit mapping - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2l_1d error: scale type ',p2c_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - larr(bounds%begl : bounds%endl) = spval - sumwt(bounds%begl : bounds%endl) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtlunit(p) /= 0._r8) then - c = patch%column(p) - if (parr(p) /= spval .and. scale_c2l(c) /= spval) then - l = patch%landunit(p) - if (sumwt(l) == 0._r8) larr(l) = 0._r8 - larr(l) = larr(l) + parr(p) * scale_p2c(p) * scale_c2l(c) * patch%wtlunit(p) - sumwt(l) = sumwt(l) + patch%wtlunit(p) - end if - end if - end do - found = .false. - do l = bounds%begl,bounds%endl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l) = larr(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'p2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine p2l_1d - - !----------------------------------------------------------------------- - subroutine p2l_2d(bounds, num2d, parr, larr, p2c_scale_type, c2l_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from patches to landunits - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: parr( bounds%begp: , 1: ) ! input patch array - real(r8), intent(out) :: larr( bounds%begl: , 1: ) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - ! - ! !LOCAL VARIABLES: - integer :: j,p,c,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights - real(r8) :: scale_p2c(bounds%begc:bounds%endc) ! scale factor for patch->column mapping - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor for column->landunit mapping - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl, num2d/)), errMsg(sourcefile, __LINE__)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2l_2d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2l_2d error: scale type ',p2c_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - larr(bounds%begl : bounds%endl, :) = spval - do j = 1,num2d - sumwt(bounds%begl : bounds%endl) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtlunit(p) /= 0._r8) then - c = patch%column(p) - if (parr(p,j) /= spval .and. scale_c2l(c) /= spval) then - l = patch%landunit(p) - if (sumwt(l) == 0._r8) larr(l,j) = 0._r8 - larr(l,j) = larr(l,j) + parr(p,j) * scale_p2c(p) * scale_c2l(c) * patch%wtlunit(p) - sumwt(l) = sumwt(l) + patch%wtlunit(p) - end if - end if - end do - found = .false. - do l = bounds%begl,bounds%endl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l,j) = larr(l,j)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'p2l_2d error: sumwt is greater than 1.0 at l= ',index,' j= ',j - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine p2l_2d - - !----------------------------------------------------------------------- - subroutine p2g_1d(bounds, parr, garr, p2c_scale_type, c2l_scale_type, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from patches to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: parr( bounds%begp: ) ! input patch array - real(r8), intent(out) :: garr( bounds%begg: ) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_p2c(bounds%begp:bounds%endp) ! scale factor - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2g_1d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2g_1d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - garr(bounds%begg : bounds%endg) = spval - sumwt(bounds%begg : bounds%endg) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtgcell(p) /= 0._r8) then - c = patch%column(p) - l = patch%landunit(p) - if (parr(p) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = patch%gridcell(p) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + parr(p) * scale_p2c(p) * scale_c2l(c) * scale_l2g(l) * patch%wtgcell(p) - sumwt(g) = sumwt(g) + patch%wtgcell(p) - end if - end if - end do - found = .false. - do g = bounds%begg, bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'p2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine p2g_1d - - !----------------------------------------------------------------------- - subroutine p2g_2d(bounds, num2d, parr, garr, p2c_scale_type, c2l_scale_type, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from patches to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: parr( bounds%begp: , 1: ) ! input patch array - real(r8), intent(out) :: garr( bounds%begg: , 1: ) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: j,p,c,l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_p2c(bounds%begp:bounds%endp) ! scale factor - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(parr) == (/bounds%endp, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg, num2d/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - if (p2c_scale_type == 'unity') then - do p = bounds%begp,bounds%endp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - garr(bounds%begg : bounds%endg, :) = spval - do j = 1,num2d - sumwt(bounds%begg : bounds%endg) = 0._r8 - do p = bounds%begp,bounds%endp - if (patch%active(p) .and. patch%wtgcell(p) /= 0._r8) then - c = patch%column(p) - l = patch%landunit(p) - if (parr(p,j) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = patch%gridcell(p) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + parr(p,j) * scale_p2c(p) * scale_c2l(c) * scale_l2g(l) * patch%wtgcell(p) - sumwt(g) = sumwt(g) + patch%wtgcell(p) - end if - end if - end do - found = .false. - do g = bounds%begg, bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'p2g_2d error: sumwt gt 1.0 at g/sumwt = ',index,sumwt(index) - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine p2g_2d - - !----------------------------------------------------------------------- - subroutine c2l_1d (bounds, carr, larr, c2l_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from columns to landunits - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: carr( bounds%begc: ) ! input column array - real(r8), intent(out) :: larr( bounds%begl: ) ! output landunit array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - ! - ! !LOCAL VARIABLES: - integer :: c,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor for column->landunit mapping - real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - larr(bounds%begl : bounds%endl) = spval - sumwt(bounds%begl : bounds%endl) = 0._r8 - do c = bounds%begc,bounds%endc - if (col%active(c) .and. col%wtlunit(c) /= 0._r8) then - if (carr(c) /= spval .and. scale_c2l(c) /= spval) then - l = col%landunit(c) - if (sumwt(l) == 0._r8) larr(l) = 0._r8 - larr(l) = larr(l) + carr(c) * scale_c2l(c) * col%wtlunit(c) - sumwt(l) = sumwt(l) + col%wtlunit(c) - end if - end if - end do - found = .false. - do l = bounds%begl,bounds%endl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l) = larr(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'c2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine c2l_1d - - !----------------------------------------------------------------------- - subroutine c2l_2d (bounds, num2d, carr, larr, c2l_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from columns to landunits - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: carr( bounds%begc: , 1: ) ! input column array - real(r8), intent(out) :: larr( bounds%begl: , 1: ) ! output landunit array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - ! - ! !LOCAL VARIABLES: - integer :: j,l,c,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor for column->landunit mapping - real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl, num2d/)), errMsg(sourcefile, __LINE__)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_2d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - larr(bounds%begl : bounds%endl, :) = spval - do j = 1,num2d - sumwt(bounds%begl : bounds%endl) = 0._r8 - do c = bounds%begc,bounds%endc - if (col%active(c) .and. col%wtlunit(c) /= 0._r8) then - if (carr(c,j) /= spval .and. scale_c2l(c) /= spval) then - l = col%landunit(c) - if (sumwt(l) == 0._r8) larr(l,j) = 0._r8 - larr(l,j) = larr(l,j) + carr(c,j) * scale_c2l(c) * col%wtlunit(c) - sumwt(l) = sumwt(l) + col%wtlunit(c) - end if - end if - end do - found = .false. - do l = bounds%begl,bounds%endl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l,j) = larr(l,j)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'c2l_2d error: sumwt is greater than 1.0 at l= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine c2l_2d - - !----------------------------------------------------------------------- - subroutine c2g_1d(bounds, carr, garr, c2l_scale_type, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from columns to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: carr( bounds%begc: ) ! input column array - real(r8), intent(out) :: garr( bounds%begg: ) ! output gridcell array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: c,l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - garr(bounds%begg : bounds%endg) = spval - sumwt(bounds%begg : bounds%endg) = 0._r8 - do c = bounds%begc,bounds%endc - if (col%active(c) .and. col%wtgcell(c) /= 0._r8) then - l = col%landunit(c) - if (carr(c) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = col%gridcell(c) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + carr(c) * scale_c2l(c) * scale_l2g(l) * col%wtgcell(c) - sumwt(g) = sumwt(g) + col%wtgcell(c) - end if - end if - end do - found = .false. - do g = bounds%begg, bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'c2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine c2g_1d - - !----------------------------------------------------------------------- - subroutine c2g_2d(bounds, num2d, carr, garr, c2l_scale_type, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from columns to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: carr( bounds%begc: , 1: ) ! input column array - real(r8), intent(out) :: garr( bounds%begg: , 1: ) ! output gridcell array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging (see note at top of module) - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: j,c,g,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_c2l(bounds%begc:bounds%endc) ! scale factor - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(carr) == (/bounds%endc, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg, num2d/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - if (c2l_scale_type == 'unity') then - do c = bounds%begc,bounds%endc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * lun%canyon_hwr(l) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = bounds%begc,bounds%endc - l = col%landunit(c) - if (lun%urbpoi(l)) then - if (col%itype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * lun%canyon_hwr(l)) / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_road_perv .or. col%itype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*lun%canyon_hwr(l) + 1.) - else if (col%itype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - garr(bounds%begg : bounds%endg,:) = spval - do j = 1,num2d - sumwt(bounds%begg : bounds%endg) = 0._r8 - do c = bounds%begc,bounds%endc - if (col%active(c) .and. col%wtgcell(c) /= 0._r8) then - l = col%landunit(c) - if (carr(c,j) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = col%gridcell(c) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + carr(c,j) * scale_c2l(c) * scale_l2g(l) * col%wtgcell(c) - sumwt(g) = sumwt(g) + col%wtgcell(c) - end if - end if - end do - found = .false. - do g = bounds%begg, bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'c2g_2d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine c2g_2d - - !----------------------------------------------------------------------- - subroutine l2g_1d(bounds, larr, garr, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from landunits to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: larr( bounds%begl: ) ! input landunit array - real(r8), intent(out) :: garr( bounds%begg: ) ! output gridcell array - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - garr(bounds%begg : bounds%endg) = spval - sumwt(bounds%begg : bounds%endg) = 0._r8 - do l = bounds%begl,bounds%endl - if (lun%active(l) .and. lun%wtgcell(l) /= 0._r8) then - if (larr(l) /= spval .and. scale_l2g(l) /= spval) then - g = lun%gridcell(l) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + larr(l) * scale_l2g(l) * lun%wtgcell(l) - sumwt(g) = sumwt(g) + lun%wtgcell(l) - end if - end if - end do - found = .false. - do g = bounds%begg, bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'l2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine l2g_1d - - !----------------------------------------------------------------------- - subroutine l2g_2d(bounds, num2d, larr, garr, l2g_scale_type) - ! - ! !DESCRIPTION: - ! Perfrom subgrid-average from landunits to gridcells. - ! Averaging is only done for points that are not equal to "spval". - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: larr( bounds%begl: , 1: ) ! input landunit array - real(r8), intent(out) :: garr( bounds%begg: , 1: ) ! output gridcell array - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - ! - ! !LOCAL VARIABLES: - integer :: j,g,l,index ! indices - integer :: max_lu_per_gcell ! max landunits per gridcell; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_l2g(bounds%begl:bounds%endl) ! scale factor - real(r8) :: sumwt(bounds%begg:bounds%endg) ! sum of weights - !------------------------------------------------------------------------ - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(larr) == (/bounds%endl, num2d/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(garr) == (/bounds%endg, num2d/)), errMsg(sourcefile, __LINE__)) - - call build_scale_l2g(bounds, l2g_scale_type, & - scale_l2g(bounds%begl:bounds%endl)) - - garr(bounds%begg : bounds%endg, :) = spval - do j = 1,num2d - sumwt(bounds%begg : bounds%endg) = 0._r8 - do l = bounds%begl,bounds%endl - if (lun%active(l) .and. lun%wtgcell(l) /= 0._r8) then - if (larr(l,j) /= spval .and. scale_l2g(l) /= spval) then - g = lun%gridcell(l) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + larr(l,j) * scale_l2g(l) * lun%wtgcell(l) - sumwt(g) = sumwt(g) + lun%wtgcell(l) - end if - end if - end do - found = .false. - do g = bounds%begg,bounds%endg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index= g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'l2g_2d error: sumwt is greater than 1.0 at g= ',index,' lev= ',j - call endrun(decomp_index=index, clmlevel=nameg, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine l2g_2d - - !----------------------------------------------------------------------- - subroutine build_scale_l2g(bounds, l2g_scale_type, scale_l2g) - ! - ! !DESCRIPTION: - ! Fill the scale_l2g(bounds%begl:bounds%endl) array with appropriate values for the given l2g_scale_type. - ! This array can later be used to scale each landunit in forming grid cell averages. - ! - ! !USES: - use landunit_varcon, only : max_lunit - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - real(r8) , intent(out) :: scale_l2g( bounds%begl: ) ! scale factor - ! - ! !LOCAL VARIABLES: - real(r8) :: scale_lookup(max_lunit) ! scale factor for each landunit type - integer :: l ! index - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(scale_l2g) == (/bounds%endl/)), errMsg(sourcefile, __LINE__)) - - ! TODO(wjs, 2017-03-09) If this routine is a performance problem (which it may be, - ! because I think it's called a lot), then a simple optimization would be to treat - ! l2g_scale_type = 'unity' specially, rather than using the more general-purpose code - ! for this special case. - - call create_scale_l2g_lookup(l2g_scale_type, scale_lookup) - - do l = bounds%begl,bounds%endl - scale_l2g(l) = scale_lookup(lun%itype(l)) - end do - - end subroutine build_scale_l2g - - !----------------------------------------------------------------------- - subroutine create_scale_l2g_lookup(l2g_scale_type, scale_lookup) - ! - ! DESCRIPTION: - ! Create a lookup array, scale_lookup(1..max_lunit), which gives the scale factor for - ! each landunit type depending on l2g_scale_type - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop, istice_mec, istdlak - use landunit_varcon, only : isturb_MIN, isturb_MAX, max_lunit - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - real(r8) , intent(out) :: scale_lookup(max_lunit) ! scale factor for each landunit type - !----------------------------------------------------------------------- - - ! ------------ WJS (10-14-11): IMPORTANT GENERAL NOTES ------------ - ! - ! Since scale_l2g is not currently included in the sumwt accumulations, you need to - ! be careful about the scale values you use. Values of 1 and spval are safe - ! (including having multiple landunits with value 1), but only use other values if - ! you know what you are doing! For example, using a value of 0 is NOT the correct way - ! to exclude a landunit from the average, because the normalization will be done - ! incorrectly in this case: instead, use spval to exclude a landunit from the - ! average. Similarly, using a value of 2 is NOT the correct way to give a landunit - ! double relative weight in general, because the normalization won't be done - ! correctly in this case, either. - ! - ! In the longer-term, I believe that the correct solution to this problem is to - ! include scale_l2g (and the other scale factors) in the sumwt accumulations - ! (e.g., sumwt = sumwt + wtgcell * scale_p2c * scale_c2l * scale_l2g), but that - ! requires some more thought to (1) make sure that is correct, and (2) make sure it - ! doesn't break the urban scaling. - ! - ! ----------------------------------------------------------------- - - - ! Initialize scale_lookup to spval for all landunits. Thus, any landunit that keeps - ! the default value will be excluded from grid cell averages. - scale_lookup(:) = spval - - if (l2g_scale_type == 'unity') then - scale_lookup(:) = 1.0_r8 - else if (l2g_scale_type == 'natveg') then - scale_lookup(istsoil) = 1.0_r8 - else if (l2g_scale_type == 'veg') then - scale_lookup(istsoil) = 1.0_r8 - scale_lookup(istcrop) = 1.0_r8 - else if (l2g_scale_type == 'ice') then - scale_lookup(istice_mec) = 1.0_r8 - else if (l2g_scale_type == 'nonurb') then - scale_lookup(:) = 1.0_r8 - scale_lookup(isturb_MIN:isturb_MAX) = spval - else if (l2g_scale_type == 'lake') then - scale_lookup(istdlak) = 1.0_r8 - else if (l2g_scale_type == 'veg_plus_lake') then - scale_lookup(istsoil) = 1.0_r8 - scale_lookup(istcrop) = 1.0_r8 - scale_lookup(istdlak) = 1.0_r8 - else - write(iulog,*)'scale_l2g_lookup_array error: scale type ',l2g_scale_type,' not supported' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine create_scale_l2g_lookup - -end module subgridAveMod diff --git a/src/main/subgridMod.F90 b/src/main/subgridMod.F90 deleted file mode 100644 index 6358e90b5e..0000000000 --- a/src/main/subgridMod.F90 +++ /dev/null @@ -1,564 +0,0 @@ -module subgridMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! sub-grid data and mapping types and modules - ! - ! TODO(wjs, 2015-12-08) Much of the logic here duplicates (in some sense) logic in - ! initGridCellsMod. The duplication should probably be extracted into routines shared - ! between these modules (or the two modules should be combined into one). - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_instur , only : wt_lunit, wt_nat_patch, urban_valid, wt_cft - use landunit_varcon, only : istcrop, istdlak, istwet, isturb_tbd, isturb_hd, isturb_md - use glcBehaviorMod , only : glc_behavior_type - use FatesInterfaceMod, only : fates_maxElementsPerSite - - implicit none - private - save - - ! !PUBLIC MEMBER FUNCTIONS: - public :: subgrid_get_gcellinfo ! Obtain gridcell properties, summed across all landunits - - ! Routines to get info for each landunit: - public :: subgrid_get_info_natveg - public :: natveg_patch_exists ! returns true if the given natural veg patch should be created in memory - public :: subgrid_get_info_cohort - public :: subgrid_get_info_urban_tbd - public :: subgrid_get_info_urban_hd - public :: subgrid_get_info_urban_md - public :: subgrid_get_info_lake - public :: subgrid_get_info_wetland - public :: subgrid_get_info_glacier_mec - public :: subgrid_get_info_crop - public :: crop_patch_exists ! returns true if the given crop patch should be created in memory - - ! !PRIVATE MEMBER FUNCTIONS: - private :: subgrid_get_info_urban - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !------------------------------------------------------------------------------ - subroutine subgrid_get_gcellinfo (gi, glc_behavior, & - nlunits, ncols, npatches, ncohorts) - ! - ! !DESCRIPTION: - ! Obtain gridcell properties, aggregated across all landunits - ! - ! !ARGUMENTS - integer , intent(in) :: gi ! grid cell index - type(glc_behavior_type), intent(in) :: glc_behavior - integer , intent(out) :: nlunits ! number of landunits - integer , intent(out) :: ncols ! number of columns - integer , intent(out) :: npatches ! number of patchs - integer , intent(out) :: ncohorts ! number of cohorts - ! - ! !LOCAL VARIABLES: - ! Counts from a single landunit: - integer :: ncohorts_temp - integer :: npatches_temp - integer :: ncols_temp - integer :: nlunits_temp - - ! atm_topo is arbitrary for the sake of getting these counts. We don't have a true - ! atm_topo value at the point of this call, so use 0. - real(r8), parameter :: atm_topo = 0._r8 - !------------------------------------------------------------------------------ - - npatches = 0 - ncols = 0 - nlunits = 0 - ncohorts = 0 - - call subgrid_get_info_natveg(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_urban_tbd(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_urban_hd(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_urban_md(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_lake(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_wetland(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_glacier_mec(gi, atm_topo, glc_behavior, & - npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_crop(gi, npatches_temp, ncols_temp, nlunits_temp) - call accumulate_counters() - - call subgrid_get_info_cohort(gi,ncohorts) - - contains - subroutine accumulate_counters - ! Accumulate running sums of patches, columns and landunits. - ! - ! This uses local variables in the parent subroutine as both inputs and outputs - - npatches = npatches + npatches_temp - ncols = ncols + ncols_temp - nlunits = nlunits + nlunits_temp - - end subroutine accumulate_counters - - end subroutine subgrid_get_gcellinfo - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for natural vegetated landunit in this grid cell - ! - ! !USES - use clm_varpar, only : natpft_lb, natpft_ub - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of nat veg patches in this grid cell - integer, intent(out) :: ncols ! number of nat veg columns in this grid cell - integer, intent(out) :: nlunits ! number of nat veg landunits in this grid cell - ! - ! !LOCAL VARIABLES: - integer :: pft ! plant functional type index - - character(len=*), parameter :: subname = 'subgrid_get_info_natveg' - !----------------------------------------------------------------------- - - npatches = 0 - - do pft = natpft_lb, natpft_ub - if (natveg_patch_exists(gi, pft)) then - npatches = npatches + 1 - end if - end do - - if (npatches > 0) then - ! Assume that the vegetated landunit has one column - ncols = 1 - nlunits = 1 - else - ! As noted in natveg_patch_exists, we expect a naturally vegetated landunit in - ! every grid cell. This means that npatches should be at least 1 in every grid - ! cell. If we find that isn't true, abort. - write(iulog,*) 'Expect at least one natural veg patch in every grid cell' - write(iulog,*) 'Found 0 for gi = ', gi - call endrun(subname//' ERROR: Expect at least one natural veg patch in every grid cell') - end if - - end subroutine subgrid_get_info_natveg - - !----------------------------------------------------------------------- - function natveg_patch_exists(gi, pft) result(exists) - ! - ! !DESCRIPTION: - ! Returns true if a patch should be created in memory for the given natural veg PFT - ! in this grid cell. - ! - ! !USES: - use clm_varpar, only : natpft_lb, natpft_ub - use clm_varctl, only : use_cndv, use_fates - use dynSubgridControlMod, only : get_do_transient_pfts - ! - ! !ARGUMENTS: - logical :: exists ! function result - integer, intent(in) :: gi ! grid cell index - integer, intent(in) :: pft ! plant functional type - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'natveg_patch_exists' - !----------------------------------------------------------------------- - - SHR_ASSERT(pft >= natpft_lb, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(pft <= natpft_ub, errMsg(sourcefile, __LINE__)) - - if (get_do_transient_pfts() .or. use_cndv .or. use_fates) then - ! To support transient PFTS and dynamic vegetation cases, we have all possible PFTs - ! in every grid cell, because they might need to come into existence even if their - ! weight is 0 at the start of the run. (Similarly for FATES, but there patches do - ! not correspond to PFTs.) - exists = .true. - - else - ! For a non-transient PFT/dynamic-veg run: We still have a naturally vegetated - ! landunit in every grid cell, because this is needed to support any aspect of - ! dynamic landunits, as well as to provide forcings for a GLC model. So we don't - ! take into account the landunit's weight on the gridcell in determining whether to - ! allocate memory. However, we only allocate memory for patches that actually exist - ! on this landunit. (This will require running init_interp when changing between a - ! transient run and a non-transient run.) - if (wt_nat_patch(gi, pft) > 0.0_r8) then - exists = .true. - else - exists = .false. - end if - end if - - end function natveg_patch_exists - - - ! ----------------------------------------------------------------------------- - - subroutine subgrid_get_info_cohort(gi, ncohorts) - ! - ! !DESCRIPTION: - ! Obtain cohort counts per each gridcell. - ! - ! !USES - use clm_varpar, only : natpft_size - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: ncohorts ! number of cohorts in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_cohort' - !----------------------------------------------------------------------- - - ! ------------------------------------------------------------------------- - ! Number of cohorts is set here - ! FATES cohorts populate all natural vegetation columns. - ! There is only one natural vegetation column per grid-cell. So allocations - ! are mapped to the gridcell. In the future we may have more than one site - ! per gridcell, and we just multiply that factor here. - ! It is possible that there may be gridcells that don't have a naturally - ! vegetated column. That case should be fine, as the cohort - ! restart vector will just be a little sparse. - ! ------------------------------------------------------------------------- - - ncohorts = fates_maxElementsPerSite - - end subroutine subgrid_get_info_cohort - - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_urban_tbd(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for urban tbd landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of urban tbd patches in this grid cell - integer, intent(out) :: ncols ! number of urban tbd columns in this grid cell - integer, intent(out) :: nlunits ! number of urban tbd landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_urban_tbd' - !----------------------------------------------------------------------- - - call subgrid_get_info_urban(gi, isturb_tbd, npatches, ncols, nlunits) - - end subroutine subgrid_get_info_urban_tbd - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_urban_hd(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for urban hd landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of urban hd patches in this grid cell - integer, intent(out) :: ncols ! number of urban hd columns in this grid cell - integer, intent(out) :: nlunits ! number of urban hd landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_urban_hd' - !----------------------------------------------------------------------- - - call subgrid_get_info_urban(gi, isturb_hd, npatches, ncols, nlunits) - - end subroutine subgrid_get_info_urban_hd - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_urban_md(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for urban md landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of urban md patches in this grid cell - integer, intent(out) :: ncols ! number of urban md columns in this grid cell - integer, intent(out) :: nlunits ! number of urban md landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_urban_md' - !----------------------------------------------------------------------- - - call subgrid_get_info_urban(gi, isturb_md, npatches, ncols, nlunits) - - end subroutine subgrid_get_info_urban_md - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_urban(gi, ltype, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for one of the urban landunits in this grid cell - ! - ! This is shared for all urban landunits, because currently they are all treated the same. - ! - ! !USES - use clm_varpar, only : maxpatch_urb - use clm_varctl, only : run_zero_weight_urban - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(in) :: ltype ! landunit type (isturb_tbd, etc.) - integer, intent(out) :: npatches ! number of urban patches in this grid cell, for one urban landunit - integer, intent(out) :: ncols ! number of urban columns in this grid cell, for one urban landunit - integer, intent(out) :: nlunits ! number of urban landunits in this grid cell, for one urban landunit - ! - ! !LOCAL VARIABLES: - logical :: this_landunit_exists - - character(len=*), parameter :: subname = 'subgrid_get_info_urban' - !----------------------------------------------------------------------- - - ! In general, only allocate memory for urban landunits that have non-zero weight. - ! - ! However, if run_zero_weight_urban is .true., then allocate memory for all urban landunits in - ! every grid cell that has valid urban parameters. (This is useful if you want to - ! know urban behavior for all potential urban areas, or - in the future - to support - ! transient urban areas via dynamic landunits.) - ! - ! In either case, for simplicity, we always allocate space for all columns on any - ! allocated urban landunits. - - if (run_zero_weight_urban) then - if (urban_valid(gi)) then - this_landunit_exists = .true. - else - this_landunit_exists = .false. - end if - else - if (wt_lunit(gi, ltype) > 0.0_r8) then - this_landunit_exists = .true. - else - this_landunit_exists = .false. - end if - end if - - if (this_landunit_exists) then - npatches = maxpatch_urb - ncols = npatches - nlunits = 1 - else - npatches = 0 - ncols = 0 - nlunits = 0 - end if - - - end subroutine subgrid_get_info_urban - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_lake(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for lake landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of lake patches in this grid cell - integer, intent(out) :: ncols ! number of lake columns in this grid cell - integer, intent(out) :: nlunits ! number of lake landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_lake' - !----------------------------------------------------------------------- - - ! We currently do NOT allow the lake landunit to expand via dynamic landunits, so we - ! only need to allocate space for it where its weight is currently non-zero. - - if (wt_lunit(gi, istdlak) > 0.0_r8) then - npatches = 1 - ncols = 1 - nlunits = 1 - else - npatches = 0 - ncols = 0 - nlunits = 0 - end if - - end subroutine subgrid_get_info_lake - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_wetland(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for wetland landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of wetland patches in this grid cell - integer, intent(out) :: ncols ! number of wetland columns in this grid cell - integer, intent(out) :: nlunits ! number of wetland landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_wetland' - !----------------------------------------------------------------------- - - ! We currently do NOT allow the wetland landunit to expand via dynamic landunits, so we - ! only need to allocate space for it where its weight is currently non-zero. - - if (wt_lunit(gi, istwet) > 0.0_r8) then - npatches = 1 - ncols = 1 - nlunits = 1 - else - npatches = 0 - ncols = 0 - nlunits = 0 - end if - - end subroutine subgrid_get_info_wetland - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_glacier_mec(gi, atm_topo, glc_behavior, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for glacier_mec landunit in this grid cell - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - real(r8), intent(in) :: atm_topo ! atmosphere's topographic height for this grid cell (m) - type(glc_behavior_type), intent(in) :: glc_behavior - integer, intent(out) :: npatches ! number of glacier_mec patches in this grid cell - integer, intent(out) :: ncols ! number of glacier_mec columns in this grid cell - integer, intent(out) :: nlunits ! number of glacier_mec landunits in this grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgrid_get_info_glacier_mec' - !----------------------------------------------------------------------- - - call glc_behavior%get_num_glc_mec_subgrid(gi, atm_topo, npatches, ncols, nlunits) - - end subroutine subgrid_get_info_glacier_mec - - !----------------------------------------------------------------------- - subroutine subgrid_get_info_crop(gi, npatches, ncols, nlunits) - ! - ! !DESCRIPTION: - ! Obtain properties for crop landunit in this grid cell - ! - ! !USES: - use clm_varpar, only : cft_lb, cft_ub - ! - ! !ARGUMENTS: - integer, intent(in) :: gi ! grid cell index - integer, intent(out) :: npatches ! number of nat veg patches in this grid cell - integer, intent(out) :: ncols ! number of nat veg columns in this grid cell - integer, intent(out) :: nlunits ! number of nat veg landunits in this grid cell - ! - ! !LOCAL VARIABLES: - integer :: cft ! crop functional type index - - character(len=*), parameter :: subname = 'subgrid_get_info_crop' - !----------------------------------------------------------------------- - - npatches = 0 - - do cft = cft_lb, cft_ub - if (crop_patch_exists(gi, cft)) then - npatches = npatches + 1 - end if - end do - - if (npatches > 0) then - ncols = npatches - nlunits = 1 - else - ncols = 0 - nlunits = 0 - end if - - end subroutine subgrid_get_info_crop - - !----------------------------------------------------------------------- - function crop_patch_exists(gi, cft) result(exists) - ! - ! !DESCRIPTION: - ! Returns true if a patch should be created in memory for the given crop functional - ! type in this grid cell. - ! - ! This just applies to the crop landunit: it always returns .false. if - ! create_crop_landunit is .false. - ! - ! !USES: - use clm_varpar , only : cft_lb, cft_ub - use clm_varctl , only : create_crop_landunit - use pftconmod , only : pftcon - use dynSubgridControlMod , only : get_do_transient_crops - ! - ! !ARGUMENTS: - logical :: exists ! function result - integer, intent(in) :: gi ! grid cell index - integer, intent(in) :: cft ! crop functional type - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'crop_patch_exists' - !----------------------------------------------------------------------- - - if (create_crop_landunit) then - SHR_ASSERT(cft >= cft_lb, errMsg(sourcefile, __LINE__)) - SHR_ASSERT(cft <= cft_ub, errMsg(sourcefile, __LINE__)) - - if (get_do_transient_crops()) then - ! To support dynamic landunits, we have all possible crop columns in every grid - ! cell, because they might need to come into existence even if their weight is 0 at - ! the start of the run. - if (pftcon%is_pft_known_to_model(cft)) then - exists = .true. - else - exists = .false. - end if - - else - ! For a run without transient crops, only allocate memory for crops that are - ! actually present in this run. (This will require running init_interp when - ! changing between a transient crop run and a non-transient run.) - if (wt_lunit(gi, istcrop) > 0.0_r8 .and. wt_cft(gi, cft) > 0.0_r8) then - exists = .true. - else - exists = .false. - end if - end if - - else ! create_crop_landunit false - exists = .false. - end if - - end function crop_patch_exists - - - -end module subgridMod diff --git a/src/main/subgridRestMod.F90 b/src/main/subgridRestMod.F90 deleted file mode 100644 index 6237061393..0000000000 --- a/src/main/subgridRestMod.F90 +++ /dev/null @@ -1,733 +0,0 @@ -module subgridRestMod - -#include "shr_assert.h" - - !------------------------------------------------------------------------ - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use glc_elevclass_mod , only : glc_get_num_elevation_classes, glc_get_elevclass_bounds - use abortutils , only : endrun - use decompMod , only : bounds_type, BOUNDS_LEVEL_PROC, ldecomp - use domainMod , only : ldomain - use clm_time_manager , only : get_curr_date - use clm_varcon , only : nameg, namel, namec, namep - use clm_varpar , only : nlevsno, nlevgrnd - use pio , only : file_desc_t - use ncdio_pio , only : ncd_int, ncd_double - use GetGlobalValuesMod , only : GetGlobalIndex - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use restUtilMod - ! - ! !PUBLIC TYPES: - implicit none - save - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: subgridRestWrite ! handle restart writes of subgrid variables - public :: subgridRestRead ! handle restart reads of subgrid variables - public :: subgridRest_check_consistency ! check consistency of variables read by subgridRest - public :: subgridRest_read_cleanup ! do cleanup of variables allocated when reading the restart file; should be called after subgridRest and subgridRest_check_consistency are complete - - ! !PRIVATE MEMBER FUNCTIONS: - private :: subgridRest_write_only ! handle restart of subgrid variables that only need to be written, not read - private :: subgridRest_write_and_read ! handle restart of subgrid variables that need to be read as well as written - private :: save_old_weights - - ! !PRIVATE TYPES: - real(r8), allocatable :: pft_wtlunit_before_rest_read(:) ! patch%wtlunit weights - saved values from before the restart read - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !----------------------------------------------------------------------- - subroutine subgridRestWrite(bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Handle restart writes (and defines) of subgrid variables - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - type(file_desc_t), intent(inout) :: ncid ! netCDF dataset id - character(len=*) , intent(in) :: flag ! flag to determine if define or write data - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgridRestWrite' - !----------------------------------------------------------------------- - - call subgridRest_write_only(bounds, ncid, flag) - call subgridRest_write_and_read(bounds, ncid, flag) - - end subroutine subgridRestWrite - - - !------------------------------------------------------------------------ - subroutine subgridRestRead(bounds, ncid) - ! - ! !DESCRIPTION: - ! Handle restart reads of subgrid variables - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - type(file_desc_t), intent(inout) :: ncid ! netCDF dataset id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname='subgridRestRead' ! subroutine name - !------------------------------------------------------------------------ - - call subgridRest_write_and_read(bounds, ncid, 'read') - - end subroutine subgridRestRead - - !----------------------------------------------------------------------- - subroutine subgridRest_write_only(bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! Handle restart for variables that only need to be written, not read. This applies - ! to variables that are time-constant and are only put on the restart file for the - ! sake of having some additional metadata there. - ! - ! Note that 'active' flags appear in this routine: they don't need to be read because - ! they can be computed using other info on the restart file (particularly subgrid - ! weights). - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - type(file_desc_t), intent(inout) :: ncid ! netCDF dataset id - character(len=*) , intent(in) :: flag ! flag to determine if define, write or read data - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p,i ! indices - logical :: readvar ! temporary - real(r8), pointer :: rgarr(:) ! temporary - real(r8), pointer :: rlarr(:) ! temporary - real(r8), pointer :: rcarr(:) ! temporary - real(r8), pointer :: rparr(:) ! temporary - integer , pointer :: igarr(:) ! temporary - integer , pointer :: ilarr(:) ! temporary - integer , pointer :: icarr(:) ! temporary - integer , pointer :: iparr(:) ! temporary - - real(r8), pointer :: elevclass_bounds(:) - - real(r8), pointer :: temp2d_r(:,:) ! temporary for multi-level variables - integer , pointer :: temp2d_i(:,:) ! temporary for multi-level variables - - character(len=*), parameter :: subname = 'subgridRest_write_only' - !----------------------------------------------------------------------- - - !------------------------------------------------------------------ - ! Write gridcell info - !------------------------------------------------------------------ - - allocate(rgarr(bounds%begg:bounds%endg), igarr(bounds%begg:bounds%endg)) - - call restartvar(ncid=ncid, flag=flag, varname='grid1d_lon', xtype=ncd_double, & - dim1name='gridcell', & - long_name='gridcell longitude', units='degrees_east', & - interpinic_flag='skip', readvar=readvar, data=grc%londeg) - - call restartvar(ncid=ncid, flag=flag, varname='grid1d_lat', xtype=ncd_double, & - dim1name='gridcell', & - long_name='gridcell latitude', units='degrees_north', & - interpinic_flag='skip', readvar=readvar, data=grc%latdeg) - - do g=bounds%begg,bounds%endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='grid1d_ixy', xtype=ncd_int, & - dim1name='gridcell', & - long_name='2d longitude index of corresponding gridcell', & - interpinic_flag='skip', readvar=readvar, data=igarr) - - do g=bounds%begg,bounds%endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='grid1d_jxy', xtype=ncd_int, & - dim1name='gridcell', & - long_name='2d latitude index of corresponding gridcell', & - interpinic_flag='skip', readvar=readvar, data=igarr) - - deallocate(rgarr,igarr) - - !------------------------------------------------------------------ - ! Write landunit info - !------------------------------------------------------------------ - - allocate(rlarr(bounds%begl:bounds%endl), ilarr(bounds%begl:bounds%endl)) - - do l=bounds%begl,bounds%endl - rlarr(l) = grc%londeg(lun%gridcell(l)) - enddo - - call restartvar(ncid=ncid, flag=flag, varname='land1d_lon', xtype=ncd_double, & - dim1name='landunit', & - long_name='landunit longitude', units='degrees_east', & - interpinic_flag='skip', readvar=readvar, data=rlarr) - - do l=bounds%begl,bounds%endl - rlarr(l) = grc%latdeg(lun%gridcell(l)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='land1d_lat', xtype=ncd_double, & - dim1name='landunit', & - long_name='landunit latitude', units='degrees_north', & - interpinic_flag='skip', readvar=readvar, data=rlarr) - - do l=bounds%begl,bounds%endl - ilarr(l) = mod(ldecomp%gdc2glo(lun%gridcell(l))-1,ldomain%ni) + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='land1d_ixy', xtype=ncd_int, & - dim1name='landunit', & - long_name='2d longitude index of corresponding landunit', & - interpinic_flag='skip', readvar=readvar, data=ilarr) - - do l=bounds%begl,bounds%endl - ilarr(l) = (ldecomp%gdc2glo(lun%gridcell(l))-1)/ldomain%ni + 1 - end do - call restartvar(ncid=ncid, flag=flag, varname='land1d_jxy', xtype=ncd_int, & - dim1name='landunit', & - long_name='2d latitude index of corresponding landunit', & - interpinic_flag='skip', readvar=readvar, data=ilarr) - - do l=bounds%begl,bounds%endl - ilarr(l) = GetGlobalIndex(decomp_index=lun%gridcell(l), clmlevel=nameg) - end do - call restartvar(ncid=ncid, flag=flag, varname='land1d_gridcell_index', xtype=ncd_int, & - dim1name='landunit', & - long_name='gridcell index of corresponding landunit', & - interpinic_flag='skip', readvar=readvar, data=ilarr) - - call restartvar(ncid=ncid, flag=flag, varname='land1d_ityplun', xtype=ncd_int, & - dim1name='landunit', & - long_name='landunit type (see global attributes)', units=' ', & - interpinic_flag='skip', readvar=readvar, data=lun%itype) - - do l=bounds%begl,bounds%endl - if (lun%active(l)) then - ilarr(l) = 1 - else - ilarr(l) = 0 - end if - enddo - call restartvar(ncid=ncid, flag=flag, varname='land1d_active', xtype=ncd_int, & - dim1name='landunit', & - long_name='landunit active flag (1=active, 0=inactive)', & - interpinic_flag='skip', readvar=readvar, data=ilarr) - - deallocate(rlarr, ilarr) - - !------------------------------------------------------------------ - ! Write column info - !------------------------------------------------------------------ - - allocate(rcarr(bounds%begc:bounds%endc), icarr(bounds%begc:bounds%endc)) - - do c= bounds%begc, bounds%endc - rcarr(c) = grc%londeg(col%gridcell(c)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='cols1d_lon', xtype=ncd_double, & - dim1name='column', & - long_name='column longitude', units='degrees_east', & - interpinic_flag='skip', readvar=readvar, data=rcarr) - - do c= bounds%begc, bounds%endc - rcarr(c) = grc%latdeg(col%gridcell(c)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='cols1d_lat', xtype=ncd_double, & - dim1name='column', & - long_name='column latitude', units='degrees_north', & - interpinic_flag='skip', readvar=readvar, data=rcarr) - - do c= bounds%begc, bounds%endc - icarr(c) = mod(ldecomp%gdc2glo(col%gridcell(c))-1,ldomain%ni) + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='cols1d_ixy', xtype=ncd_int, & - dim1name='column', & - long_name='2d longitude index of corresponding column', units=' ', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - do c= bounds%begc, bounds%endc - icarr(c) = (ldecomp%gdc2glo(col%gridcell(c))-1)/ldomain%ni + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='cols1d_jxy', xtype=ncd_int, & - dim1name='column', & - long_name='2d latitude index of corresponding column', units=' ', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - do c= bounds%begc, bounds%endc - icarr(c) = GetGlobalIndex(decomp_index=col%gridcell(c), clmlevel=nameg) - end do - call restartvar(ncid=ncid, flag=flag, varname='cols1d_gridcell_index', xtype=ncd_int, & - dim1name='column', & - long_name='gridcell index of corresponding column', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - do c= bounds%begc, bounds%endc - icarr(c) = GetGlobalIndex(decomp_index=col%landunit(c), clmlevel=namel) - end do - call restartvar(ncid=ncid, flag=flag, varname='cols1d_landunit_index', xtype=ncd_int, & - dim1name='column', & - long_name='landunit index of corresponding column', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - do c= bounds%begc, bounds%endc - icarr(c) = lun%itype(col%landunit(c)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='cols1d_ityplun', xtype=ncd_int, & - dim1name='column', & - long_name='column landunit type (see global attributes)', units=' ', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - call restartvar(ncid=ncid, flag=flag, varname='cols1d_ityp', xtype=ncd_int, & - dim1name='column', & - long_name='column type (see global attributes)', units=' ', & - interpinic_flag='skip', readvar=readvar, data=col%itype) - - do c=bounds%begc,bounds%endc - if (col%active(c)) then - icarr(c) = 1 - else - icarr(c) = 0 - end if - end do - call restartvar(ncid=ncid, flag=flag, varname='cols1d_active', xtype=ncd_int, & - dim1name='column', & - long_name='column active flag (1=active, 0=inactive)', units=' ', & - interpinic_flag='skip', readvar=readvar, data=icarr) - - call restartvar(ncid=ncid, flag=flag, varname='LEVGRND_CLASS', xtype=ncd_int, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='class in which each layer falls', units=' ', & - interpinic_flag='skip', readvar=readvar, data=col%levgrnd_class) - - allocate(temp2d_r(bounds%begc:bounds%endc, 1:nlevgrnd)) - temp2d_r(bounds%begc:bounds%endc, 1:nlevgrnd) = col%z(bounds%begc:bounds%endc, 1:nlevgrnd) - call restartvar(ncid=ncid, flag=flag, varname='COL_Z', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='layer depth, excluding snow layers', units='m', & - interpinic_flag='skip', readvar=readvar, data=temp2d_r) - deallocate(temp2d_r) - - deallocate(rcarr, icarr) - - !------------------------------------------------------------------ - ! Write patch info - !------------------------------------------------------------------ - - allocate(rparr(bounds%begp:bounds%endp), iparr(bounds%begp:bounds%endp)) - - do p=bounds%begp,bounds%endp - rparr(p) = grc%londeg(patch%gridcell(p)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_lon', xtype=ncd_double, & - dim1name='pft', & - long_name='pft longitude', units='degrees_east', & - interpinic_flag='skip', readvar=readvar, data=rparr) - - do p=bounds%begp,bounds%endp - rparr(p) = grc%latdeg(patch%gridcell(p)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_lat', xtype=ncd_double, & - dim1name='pft', & - long_name='pft latitude', units='degrees_north', & - interpinic_flag='skip', readvar=readvar, data=rparr) - - do p=bounds%begp,bounds%endp - iparr(p) = mod(ldecomp%gdc2glo(patch%gridcell(p))-1,ldomain%ni) + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_ixy', xtype=ncd_int, & - dim1name='pft', & - long_name='2d longitude index of corresponding pft', units='', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - iparr(p) = (ldecomp%gdc2glo(patch%gridcell(p))-1)/ldomain%ni + 1 - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_jxy', xtype=ncd_int, & - dim1name='pft', & - long_name='2d latitude index of corresponding pft', units='', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - iparr(p) = GetGlobalIndex(decomp_index=patch%gridcell(p), clmlevel=nameg) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_gridcell_index', xtype=ncd_int, & - dim1name='pft', & - long_name='gridcell index of corresponding pft', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - iparr(p) = GetGlobalIndex(decomp_index=patch%landunit(p), clmlevel=namel) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_landunit_index', xtype=ncd_int, & - dim1name='pft', & - long_name='landunit index of corresponding pft', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - iparr(p) = GetGlobalIndex(decomp_index=patch%column(p), clmlevel=namec) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_column_index', xtype=ncd_int, & - dim1name='pft', & - long_name='column index of corresponding pft', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_itypveg', xtype=ncd_int, & - dim1name='pft', & - long_name='pft vegetation type', units='', & - interpinic_flag='skip', readvar=readvar, data=patch%itype) - - do p=bounds%begp,bounds%endp - iparr(p) = col%itype(patch%column(p)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_itypcol', xtype=ncd_int, & - dim1name='pft', & - long_name='pft column type (see global attributes)', units='', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - iparr(p) = lun%itype(patch%landunit(p)) - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_ityplun', xtype=ncd_int, & - dim1name='pft', & - long_name='pft landunit type (see global attributes)', units='', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - do p=bounds%begp,bounds%endp - if (patch%active(p)) then - iparr(p) = 1 - else - iparr(p) = 0 - end if - enddo - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_active', xtype=ncd_int, & - dim1name='pft', & - long_name='pft active flag (1=active, 0=inactive)', units='', & - interpinic_flag='skip', readvar=readvar, data=iparr) - - allocate(temp2d_i(bounds%begp:bounds%endp, 1:nlevgrnd)) - do p=bounds%begp,bounds%endp - c = patch%column(p) - temp2d_i(p, 1:nlevgrnd) = col%levgrnd_class(c, 1:nlevgrnd) - end do - call restartvar(ncid=ncid, flag=flag, varname='LEVGRND_CLASS_p', xtype=ncd_int, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & - long_name='class in which each layer falls, patch-level', units=' ', & - interpinic_flag='skip', readvar=readvar, data=temp2d_i) - deallocate(temp2d_i) - - allocate(temp2d_r(bounds%begp:bounds%endp, 1:nlevgrnd)) - do p=bounds%begp,bounds%endp - c = patch%column(p) - temp2d_r(p, 1:nlevgrnd) = col%z(c, 1:nlevgrnd) - end do - call restartvar(ncid=ncid, flag=flag, varname='COL_Z_p', xtype=ncd_double, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & - long_name='layer depth, excluding snow layers, patch-level', units='m', & - interpinic_flag='skip', readvar=readvar, data=temp2d_r) - deallocate(temp2d_r) - - deallocate(rparr, iparr) - - ! ------------------------------------------------------------------------ - ! Write other subgrid-related metadata - ! ------------------------------------------------------------------------ - - allocate(elevclass_bounds(0:glc_get_num_elevation_classes())) - elevclass_bounds = glc_get_elevclass_bounds() - call restartvar(ncid=ncid, flag=flag, varname='glc_elevclass_bounds', xtype=ncd_double, & - dim1name='glc_nec1', is_spatial = .false., & - long_name='glacier elevation class bounds', units='m', & - interpinic_flag='skip', readvar=readvar, data=elevclass_bounds) - deallocate(elevclass_bounds) - - end subroutine subgridRest_write_only - - !----------------------------------------------------------------------- - subroutine subgridRest_write_and_read(bounds, ncid, flag) - ! - ! !DESCRIPTION: - ! - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - type(file_desc_t), intent(inout) :: ncid ! netCDF dataset id - character(len=*) , intent(in) :: flag ! flag to determine if define, write or read data - ! - ! !LOCAL VARIABLES: - logical :: readvar ! temporary - real(r8), pointer :: temp2d(:,:) ! temporary for sno column variables - - character(len=*), parameter :: subname = 'subgridRest_write_and_read' - !----------------------------------------------------------------------- - - if (flag == 'read') then - call save_old_weights(bounds) - end if - - call restartvar(ncid=ncid, flag=flag, varname='land1d_wtxy', xtype=ncd_double, & - dim1name='landunit', & - long_name='landunit weight relative to corresponding gridcell', & - interpinic_flag='area', readvar=readvar, data=lun%wtgcell) - - call restartvar(ncid=ncid, flag=flag, varname='cols1d_wtxy', xtype=ncd_double, & - dim1name='column', & - long_name='column weight relative to corresponding gridcell', units=' ', & - interpinic_flag='area', readvar=readvar, data=col%wtgcell) - - call restartvar(ncid=ncid, flag=flag, varname='cols1d_wtlnd', xtype=ncd_double, & - dim1name='column', & - long_name='column weight relative to corresponding landunit', units=' ', & - interpinic_flag='area', readvar=readvar, data=col%wtlunit) - - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_wtxy', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding gridcell', units='', & - interpinic_flag='area', readvar=readvar, data=patch%wtgcell) - - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_wtlnd', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding landunit', units='', & - interpinic_flag='area', readvar=readvar, data=patch%wtlunit) - - call restartvar(ncid=ncid, flag=flag, varname='pfts1d_wtcol', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding column', units='', & - interpinic_flag='area', readvar=readvar, data=patch%wtcol) - - ! Snow column variables - - call restartvar(ncid=ncid, flag=flag, varname='SNLSNO', xtype=ncd_int, & - dim1name='column', & - long_name='negative number of snow layers', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=col%snl) - - allocate(temp2d(bounds%begc:bounds%endc,-nlevsno+1:0)) - if (flag == 'write') then - temp2d(bounds%begc:bounds%endc,-nlevsno+1:0) = col%dz(bounds%begc:bounds%endc,-nlevsno+1:0) - end if - call restartvar(ncid=ncid, flag=flag, varname='DZSNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer thickness', units='m', & - interpinic_flag='interp', readvar=readvar, data=temp2d) - if (flag == 'read') then - col%dz(bounds%begc:bounds%endc,-nlevsno+1:0) = temp2d(bounds%begc:bounds%endc,-nlevsno+1:0) - end if - deallocate(temp2d) - - allocate(temp2d(bounds%begc:bounds%endc,-nlevsno+1:0)) - if (flag == 'write') then - temp2d(bounds%begc:bounds%endc,-nlevsno+1:0) = col%z(bounds%begc:bounds%endc,-nlevsno+1:0) - end if - call restartvar(ncid=ncid, flag=flag, varname='ZSNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno+1, upperb2=0, & - long_name='snow layer depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=temp2d) - if (flag == 'read') then - col%z(bounds%begc:bounds%endc,-nlevsno+1:0) = temp2d(bounds%begc:bounds%endc,-nlevsno+1:0) - end if - deallocate(temp2d) - - allocate(temp2d(bounds%begc:bounds%endc,-nlevsno:-1)) - if (flag == 'write') then - temp2d(bounds%begc:bounds%endc,-nlevsno:-1) = col%zi(bounds%begc:bounds%endc,-nlevsno:-1) - end if - call restartvar(ncid=ncid, flag=flag, varname='ZISNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., lowerb2=-nlevsno, upperb2=-1, & - long_name='snow interface depth', units='m', & - interpinic_flag='interp', readvar=readvar, data=temp2d) - if (flag == 'read') then - col%zi(bounds%begc:bounds%endc,-nlevsno:-1) = temp2d(bounds%begc:bounds%endc,-nlevsno:-1) - end if - deallocate(temp2d) - - end subroutine subgridRest_write_and_read - - !----------------------------------------------------------------------- - subroutine save_old_weights(bounds) - ! - ! !DESCRIPTION: - ! Save old weights, from before the restart read, for later consistency checks. - ! - ! !USES: - type(bounds_type), intent(in) :: bounds ! bounds (expected to be proc-level) - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'save_old_weights' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, subname//' ERROR: expect proc-level bounds') - - allocate(pft_wtlunit_before_rest_read(bounds%begp:bounds%endp)) - pft_wtlunit_before_rest_read(bounds%begp:bounds%endp) = patch%wtlunit(bounds%begp:bounds%endp) - - end subroutine save_old_weights - - - !----------------------------------------------------------------------- - subroutine subgridRest_check_consistency(bounds) - ! - ! !DESCRIPTION: - ! Check consistency of variables read by subgridRest. - ! - ! This should be called AFTER subgridRest is called to read the restart file. - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgridRest_check_consistency' - !----------------------------------------------------------------------- - - if (do_check_weights()) then - call check_weights(bounds) - end if - - contains - - !----------------------------------------------------------------------- - logical function do_check_weights() - ! - ! !DESCRIPTION: - ! Return true if we should check weights - ! - ! !USES: - use clm_varctl, only : nsrest, nsrContinue, use_cndv, use_fates - use dynSubgridControlMod, only : get_do_transient_pfts - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'do_check_weights' - !----------------------------------------------------------------------- - - if (get_do_transient_pfts()) then - ! Don't check weights for a transient PATCH case, because it's harder to come up with the - ! correct weights to check against - do_check_weights = .false. - else if (nsrest == nsrContinue) then - ! Don't check weights for a restart run - ! - ! WJS (3-25-14): I'm not sure why we don't do the check in this case, but I'm - ! maintaining the logic that used to be in BiogeophysRestMod regarding these - ! weight checks - do_check_weights = .false. - else if (use_cndv) then - ! Don't check weights for a cndv case, because the weights will almost certainly - ! differ from the surface dataset in this case - do_check_weights = .false. - else if (use_fates) then - ! Don't check weights for a fates case, because the weights will almost certainly - ! differ from the surface dataset in this case - do_check_weights = .false. - else - do_check_weights = .true. - end if - - end function do_check_weights - - !----------------------------------------------------------------------- - subroutine check_weights(bounds) - ! - ! !DESCRIPTION: - ! Make sure that patch weights on the landunit agree with the weights read from the - ! surface dataset, for the natural veg landunit. - ! - ! Note that we do NOT do a more general check of all subgrid weights, because it's - ! possible that some other subgrid weights have changed relative to the surface - ! dataset, e.g., due to dynamic landunits. It would probably be possible to do more - ! checking than is done here, but the check here should be sufficient to catch major - ! inconsistencies between the restart file and the surface dataset. - ! - ! !USES: - use landunit_varcon, only : istsoil - use clm_varctl, only : iulog - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: p, l ! indices - real(r8) :: diff ! difference in weights - - real(r8), parameter :: tol = 5.e-3 ! tolerance for checking weights - - character(len=*), parameter :: subname = 'check_weights' - !----------------------------------------------------------------------- - - do p = bounds%begp, bounds%endp - l = patch%landunit(p) - if (lun%itype(l) == istsoil) then - diff = abs(patch%wtlunit(p) - pft_wtlunit_before_rest_read(p)) - if (diff > tol .and. patch%wtgcell(p) > 1.0e-16_r8) then - write(iulog,*) 'ERROR: PATCH weights are SIGNIFICANTLY different between :' - write(iulog,*) 'the restart (finidat) file : ', patch%wtlunit(p) - write(iulog,*) 'and the surface dataset (fsurdat): ', pft_wtlunit_before_rest_read(p) - write(iulog,*) 'weight gridcell: ', patch%wtgcell(p) - write(iulog,*) - write(iulog,*) 'Maximum allowed difference: ', tol - write(iulog,*) 'Difference found: ', diff - write(iulog,*) 'This match is a requirement for non-transient runs' - write(iulog,*) - write(iulog,*) 'Possible solutions to this problem:' - write(iulog,*) '(1) Make sure you are using the intended finidat and fsurdat files' - write(iulog,*) '(2) If you are running a present-day simulation, then make sure that your' - write(iulog,*) ' initial conditions file is from the END of a 20th century transient run' - write(iulog,*) '(3) If you are confident that you are using the correct finidat and fsurdat files,' - write(iulog,*) ' yet are still experiencing this error, then you can bypass this check by setting:' - write(iulog,*) ' check_finidat_pct_consistency = .false.' - write(iulog,*) ' in user_nl_clm' - write(iulog,*) ' In this case, CLM will take the weights from the initial conditions file.' - write(iulog,*) ' ' - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - end if - end if - end do - - end subroutine check_weights - - end subroutine subgridRest_check_consistency - - - !----------------------------------------------------------------------- - subroutine subgridRest_read_cleanup - ! - ! !DESCRIPTION: - ! Do cleanup of variables allocated when reading the restart file - ! - ! Should be called after subgridRest and subgridRest_check_consistency are complete. - ! Note that this must be called after subgridRest is called to read the restart file, - ! in order to avoid a memory leak. - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'subgridRest_read_cleanup' - !----------------------------------------------------------------------- - - deallocate(pft_wtlunit_before_rest_read) - - end subroutine subgridRest_read_cleanup - - -end module subgridRestMod diff --git a/src/main/subgridWeightsMod.F90 b/src/main/subgridWeightsMod.F90 deleted file mode 100644 index b2c882a478..0000000000 --- a/src/main/subgridWeightsMod.F90 +++ /dev/null @@ -1,872 +0,0 @@ -module subgridWeightsMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Handles modifications, error-checks and diagnostics related to changing subgrid weights - ! - ! ----- Requirements for subgrid weights that are enforced here ----- - ! - ! (These requirements are checked in check_weights/weights_okay) - ! - ! Note: in the following, 'active' refers to a pft, column, landunit or grid cell over - ! which computations are performed, and 'inactive' refers to a pft, column or landunit - ! where computations are NOT performed (grid cells are always active). - ! - ! (1) For all columns, landunits and grid cells, the sum of all subgrid weights of its - ! children (or grandchildren, etc.) is equal to 1. For example: - ! - For all columns, the sum of all patch weights on the column equals 1 - ! - For all landunits, the sum of all col weights on the landunit equals 1 - ! - For all grid cells, the sum of all patch weights on the grid cell equals 1 - ! - etc. - ! - ! (2) For all ACTIVE columns, landunits and grid cells, the sum of all subgrid weights of - ! its ACTIVE children (or grandchildren, etc.) is equal to 1. For example: - ! - For all active columns, the sum of all patch weights on the column equals 1 when - ! just considering active pfts - ! - For all active landunits, the sum of all col weights on the landunit equals 1 when - ! just considering active cols - ! - For ALL grid cells, the sum of all patch weights on the grid cell equals 1 when - ! just considering active pfts -- note that all grid cells are considered active! - ! - etc. - ! - ! (3) For all INACTIVE columns, landunits and grid cells, the sum of all subgrid weights of - ! its ACTIVE children, grandchildren, etc. are equal to either 0 or 1. For example: - ! - For all inactive columns, the sum of all patch weights on the column equals either 0 - ! or 1 when just considering active pfts - ! - For all inactive landunits, the sum of all col weights on the landunit equals - ! either 0 or 1 when just considering active cols - ! - etc. - ! - ! Another way of stating (2) and (3) is that the sum of weights of all ACTIVE pfts, cols - ! or landunits on their parent/grandparent/etc. is always equal to either 0 or 1 -- and - ! must be equal to 1 if this parent/grandparent, etc. is itself active. - ! - ! Note that, together, conditions (1) and (2) imply that any pft, col or landunit whose - ! weight on the grid cell is non-zero must be active. In addition, these conditions imply - ! that any patch whose weight on the column is non-zero must be active if the column is - ! active (and similarly for any patch on an active landunit, and any col on an active - ! landunit). - ! - ! - ! ----- Implications of these requirements for computing subgrid averages ----- - ! - ! The preferred way to average from, say, patch to col is: - ! colval(c) = 0 - ! do p = pfti(c), pftf(c) - ! if (active(p)) colval(c) = colval(c) + pftval(p) * wtcol(p) - ! (where wtcol(p) is the weight of the patch on the column) - ! If column c is active, then the above conditions guarantee that the pwtcol values - ! included in the above sum will sum to 1. If column c is inactive, then the above - ! conditions guarantee that the pwtcol values included in the above sum will sum to - ! either 1 or 0; if they sum to 0, then colval(c) will remain 0. - ! - ! Another acceptable method is the following; this method accommodates some unknown - ! fraction of pftval's being set to spval, and leaves colval set at spval if there are no - ! valid patch values: - ! colval(c) = spval - ! sumwt(c) = 0 - ! do p = pfti(c), pftf(c) - ! if (active(p) .and. wtcol(p) /= 0) then - ! if (pftval(p) /= spval) then - ! if (sumwt(c) == 0) colval(c) = 0 - ! colval(c) = colval(c) + pftval(p) * wtcol(p) - ! sumwt(c) = sumwt(c) + wtcol(p) - ! end if - ! end if - ! end do - ! if (sumwt(c) /= 0) then - ! colval(c) = colval(c) / sumwt(c) - ! end if - ! Note that here we check the condition (active(p) .and. wtcol(p) /= 0). We need to - ! include a check for wtcol(p) /= 0 because we don't want to set colval(c) = 0 for zero- - ! weight pfts in this line: - ! if (sumwt(c) == 0) colval(c) = 0 - ! And we include a check for active(p) because we don't want to assume that pftval(p) has - ! been set to spval for inactive pfts -- we want to allow for the possibility that - ! pftval(p) will be NaN for inactive pfts. - ! - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varctl , only : iulog, all_active, run_zero_weight_urban, use_fates - use clm_varcon , only : nameg, namel, namec, namep - use decompMod , only : bounds_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - use glcBehaviorMod , only : glc_behavior_type - ! - ! PUBLIC TYPES: - implicit none - save - - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: init_subgrid_weights_mod ! initialize stuff in this module - public :: compute_higher_order_weights ! given p2c, c2l and l2g weights, compute other weights - public :: set_active ! set 'active' flags at pft, column & landunit level - public :: check_weights ! check subgrid weights - public :: get_landunit_weight ! get the weight of a given landunit on a single grid cell - public :: set_landunit_weight ! set the weight of a given landunit on a single grid cell - public :: is_gcell_all_ltypeX ! determine whether a grid cell is 100% covered by the given landunit type - public :: set_subgrid_diagnostic_fields ! set all subgrid weights diagnostic fields - ! - ! !REVISION HISTORY: - ! Created by Bill Sacks - ! - ! !PRIVATE TYPES: - type subgrid_weights_diagnostics_type - ! This type contains diagnostics on subgrid weights, for output to the history file - real(r8), pointer :: pct_landunit(:,:) ! % of each landunit on the grid cell [begg:endg, 1:max_lunit] - real(r8), pointer :: pct_nat_pft(:,:) ! % of each pft, as % of landunit [begg:endg, natpft_lb:natpft_ub] - real(r8), pointer :: pct_cft(:,:) ! % of each crop functional type, as % of landunit [begg:endg, cft_lb:cft_ub] - real(r8), pointer :: pct_glc_mec(:,:) ! % of each glacier elevation class, as % of landunit [begg:endg, 1:maxpatch_glcmec] - end type subgrid_weights_diagnostics_type - - type(subgrid_weights_diagnostics_type) :: subgrid_weights_diagnostics - - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: is_active_l ! determine whether the given landunit is active - private :: is_active_c ! determine whether the given column is active - private :: is_active_p ! determine whether the given patch is active - private :: weights_okay ! determine if sum of weights satisfies requirements laid out above - private :: set_pct_landunit_diagnostics ! set pct_landunit diagnostic field - private :: set_pct_glc_mec_diagnostics ! set pct_glc_mec diagnostic field - private :: set_pct_pft_diagnostics ! set pct_nat_pft & pct_cft diagnostic fields - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine init_subgrid_weights_mod(bounds) - ! - ! !DESCRIPTION: - ! Initialize stuff in this module - ! - ! !USES: - use landunit_varcon, only : max_lunit - use clm_varpar , only : maxpatch_glcmec, natpft_size, cft_size - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : BOUNDS_LEVEL_PROC - use histFileMod , only : hist_addfld2d - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! proc bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'init_subgrid_weights_mod' - !----------------------------------------------------------------------- - - SHR_ASSERT(bounds%level == BOUNDS_LEVEL_PROC, errMsg(sourcefile, __LINE__)) - - ! ------------------------------------------------------------------------ - ! Allocate variables in subgrid_weights_diagnostics - ! ------------------------------------------------------------------------ - - ! Note that, because these variables are output to the history file, it appears that - ! their lower bounds need to start at 1 (e.g., 1:natpft_size rather than - ! natpft_lb:natpft_ub) - allocate(subgrid_weights_diagnostics%pct_landunit(bounds%begg:bounds%endg, 1:max_lunit)) - subgrid_weights_diagnostics%pct_landunit(:,:) = nan - allocate(subgrid_weights_diagnostics%pct_nat_pft(bounds%begg:bounds%endg, 1:natpft_size)) - subgrid_weights_diagnostics%pct_nat_pft(:,:) = nan - allocate(subgrid_weights_diagnostics%pct_cft(bounds%begg:bounds%endg, 1:cft_size)) - subgrid_weights_diagnostics%pct_cft(:,:) = nan - allocate(subgrid_weights_diagnostics%pct_glc_mec(bounds%begg:bounds%endg, 1:maxpatch_glcmec)) - subgrid_weights_diagnostics%pct_glc_mec(:,:) = nan - - ! ------------------------------------------------------------------------ - ! Add history fields - ! ------------------------------------------------------------------------ - - call hist_addfld2d (fname='PCT_LANDUNIT', units='%', type2d='ltype', & - avgflag='A', long_name='% of each landunit on grid cell', & - ptr_lnd=subgrid_weights_diagnostics%pct_landunit) - - if(.not.use_fates) then - call hist_addfld2d (fname='PCT_NAT_PFT', units='%', type2d='natpft', & - avgflag='A', long_name='% of each PFT on the natural vegetation (i.e., soil) landunit', & - ptr_lnd=subgrid_weights_diagnostics%pct_nat_pft) - end if - - if (cft_size > 0) then - call hist_addfld2d (fname='PCT_CFT', units='%', type2d='cft', & - avgflag='A', long_name='% of each crop on the crop landunit', & - ptr_lnd=subgrid_weights_diagnostics%pct_cft) - end if - - call hist_addfld2d (fname='PCT_GLC_MEC', units='%', type2d='glc_nec', & - avgflag='A', long_name='% of each GLC elevation class on the glc_mec landunit', & - ptr_lnd=subgrid_weights_diagnostics%pct_glc_mec) - - end subroutine init_subgrid_weights_mod - - - !----------------------------------------------------------------------- - subroutine compute_higher_order_weights(bounds) - ! - ! !DESCRIPTION: - ! Assuming patch%wtcol, col%wtlunit and lun%wtgcell have already been computed, compute - ! the "higher-order" weights: patch%wtlunit, patch%wtgcell and col%wtgcell, for all p and c - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! clump bounds - ! - ! !LOCAL VARIABLES: - integer :: p, c, l ! indices for pft, col & landunit - !------------------------------------------------------------------------ - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - col%wtgcell(c) = col%wtlunit(c) * lun%wtgcell(l) - end do - - do p = bounds%begp, bounds%endp - c = patch%column(p) - patch%wtlunit(p) = patch%wtcol(p) * col%wtlunit(c) - patch%wtgcell(p) = patch%wtcol(p) * col%wtgcell(c) - end do - end subroutine compute_higher_order_weights - - !----------------------------------------------------------------------- - subroutine set_active(bounds, glc_behavior) - ! - ! !DESCRIPTION: - ! Set 'active' flags at the pft, column and landunit level - ! (note that grid cells are always active) - ! - ! This should be called whenever any weights change (e.g., patch weights on the column, - ! landunit weights on the grid cell, etc.). - ! - ! Ensures that we don't have any active patch on an inactive column, or an active column on an - ! inactive landunit (since these conditions could lead to garbage data) - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: l,c,p ! loop counters - - character(len=*), parameter :: subname = 'set_active' - !------------------------------------------------------------------------ - - do l = bounds%begl,bounds%endl - lun%active(l) = is_active_l(l, glc_behavior) - end do - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - col%active(c) = is_active_c(c, glc_behavior) - if (col%active(c) .and. .not. lun%active(l)) then - write(iulog,*) trim(subname),' ERROR: active column found on inactive landunit', & - 'at c = ', c, ', l = ', l - call endrun(decomp_index=c, clmlevel=namec, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - do p = bounds%begp,bounds%endp - c = patch%column(p) - patch%active(p) = is_active_p(p) - if (patch%active(p) .and. .not. col%active(c)) then - write(iulog,*) trim(subname),' ERROR: active patch found on inactive column', & - 'at p = ', p, ', c = ', c - call endrun(decomp_index=p, clmlevel=namep, msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine set_active - - !----------------------------------------------------------------------- - logical function is_active_l(l, glc_behavior) - ! - ! !DESCRIPTION: - ! Determine whether the given landunit is active - ! - ! !USES: - use landunit_varcon, only : istsoil, istice_mec, isturb_MIN, isturb_MAX - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: l ! landunit index - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: g ! grid cell index - !------------------------------------------------------------------------ - - if (all_active) then - is_active_l = .true. - - else - g =lun%gridcell(l) - - is_active_l = .false. - - ! ------------------------------------------------------------------------ - ! General conditions under which is_active_l NEEDS to be true in order to satisfy - ! the requirements laid out at the top of this module: - ! ------------------------------------------------------------------------ - if (lun%wtgcell(l) > 0) is_active_l = .true. - - ! ------------------------------------------------------------------------ - ! Conditions under which is_active_p is set to true because we want extra virtual landunits: - ! ------------------------------------------------------------------------ - - if (lun%itype(l) == istice_mec .and. & - glc_behavior%has_virtual_columns_grc(g)) then - is_active_l = .true. - end if - - if ((lun%itype(l) >= isturb_MIN .and. lun%itype(l) <= isturb_MAX) .and. & - run_zero_weight_urban) then - is_active_l = .true. - end if - - ! In general, include a virtual natural vegetation landunit. This aids - ! initialization of a new landunit; and for runs that are coupled to CISM, this - ! provides bare land SMB forcing even if there is no vegetated area. - ! - ! Also (echoing the similar comment in glcBehaviorMod): We need all glacier and - ! vegetated points to be active in the icemask region for the sake of init_interp - - ! since we only interpolate onto active points, and we don't know which points will - ! have non-zero area until after initialization (as long as we can't send - ! information from glc to clm in initialization). (If we had an inactive vegetated - ! point in the icemask region, according to the weights on the surface dataset, and - ! ran init_interp, this point would keep its cold start initialization - ! values. Then, in the first time step of the run loop, it's possible that this - ! point would become active because, according to glc, there is actually > 0% bare - ! ground in that grid cell. We don't do any state / flux adjustments in the first - ! time step after init_interp due to glacier area changes, so this vegetated column - ! would remain at its cold start initialization values, which would be a Bad - ! Thing. Ensuring that all vegetated points within the icemask are active gets - ! around this problem - as well as having other benefits, as noted above.) - if (lun%itype(l) == istsoil) then - is_active_l = .true. - end if - - end if - - end function is_active_l - - !----------------------------------------------------------------------- - logical function is_active_c(c, glc_behavior) - ! - ! !DESCRIPTION: - ! Determine whether the given column is active - ! - ! !USES: - use landunit_varcon, only : istice_mec, isturb_MIN, isturb_MAX - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: c ! column index - type(glc_behavior_type), intent(in) :: glc_behavior - ! - ! !LOCAL VARIABLES: - integer :: l ! landunit index - integer :: g ! grid cell index - !------------------------------------------------------------------------ - - if (all_active) then - is_active_c = .true. - - else - l =col%landunit(c) - g =col%gridcell(c) - - is_active_c = .false. - - ! ------------------------------------------------------------------------ - ! General conditions under which is_active_c NEEDS to be true in order to satisfy - ! the requirements laid out at the top of this module: - ! ------------------------------------------------------------------------ - if (lun%active(l) .and. col%wtlunit(c) > 0._r8) is_active_c = .true. - - ! ------------------------------------------------------------------------ - ! Conditions under which is_active_c is set to true because we want extra virtual columns: - ! ------------------------------------------------------------------------ - - if (lun%itype(l) == istice_mec .and. & - glc_behavior%has_virtual_columns_grc(g)) then - is_active_c = .true. - end if - - ! We don't really need to run over 0-weight urban columns. But because of some - ! messiness in the urban code (many loops are over the landunit filter, then drill - ! down to columns - so we would need to add 'col%active(c)' conditionals in many - ! places) it keeps the code cleaner to run over 0-weight urban columns. This generally - ! shouldn't add much computation time, since in most places, all urban columns are - ! non-zero weight if the landunit is non-zero weight. - if (lun%active(l) .and. (lun%itype(l) >= isturb_MIN .and. lun%itype(l) <= isturb_MAX)) then - is_active_c = .true. - end if - end if - - end function is_active_c - - !----------------------------------------------------------------------- - logical function is_active_p(p) - ! - ! !DESCRIPTION: - ! Determine whether the given patch is active - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: p ! patch index - ! - ! !LOCAL VARIABLES: - integer :: c ! column index - !------------------------------------------------------------------------ - - if (all_active) then - is_active_p = .true. - - else - c =patch%column(p) - - is_active_p = .false. - - ! ------------------------------------------------------------------------ - ! General conditions under which is_active_p NEEDS to be true in order to satisfy - ! the requirements laid out at the top of this module: - ! ------------------------------------------------------------------------ - if (col%active(c) .and. patch%wtcol(p) > 0._r8) is_active_p = .true. - - end if - - end function is_active_p - - !----------------------------------------------------------------------- - function get_landunit_weight(g, ltype) result(weight) - ! - ! !DESCRIPTION: - ! Get the subgrid weight of a given landunit type on a single grid cell - ! - ! !USES: - use clm_varcon, only : ispval - ! - ! !ARGUMENTS: - real(r8) :: weight ! function result - integer , intent(in) :: g ! grid cell index - integer , intent(in) :: ltype ! landunit type of interest - ! - ! !LOCAL VARIABLES: - integer :: l ! landunit index - - character(len=*), parameter :: subname = 'get_landunit_weight' - !----------------------------------------------------------------------- - - l = grc%landunit_indices(ltype, g) - if (l == ispval) then - weight = 0._r8 - else - weight = lun%wtgcell(l) - end if - - end function get_landunit_weight - - !----------------------------------------------------------------------- - subroutine set_landunit_weight(g, ltype, weight) - ! - ! !DESCRIPTION: - ! Set the subgrid weight of a given landunit type on a single grid cell - ! - ! !USES: - use clm_varcon, only : ispval - ! - ! !ARGUMENTS: - integer , intent(in) :: g ! grid cell index - integer , intent(in) :: ltype ! landunit type of interest - real(r8), intent(in) :: weight ! new weight of this landunit - ! - ! !LOCAL VARIABLES: - integer :: l ! landunit index - - character(len=*), parameter :: subname = 'set_landunit_weight' - !----------------------------------------------------------------------- - - l = grc%landunit_indices(ltype, g) - if (l /= ispval) then - lun%wtgcell(l) = weight - else if (weight > 0._r8) then - write(iulog,*) subname//' ERROR: Attempt to assign non-zero weight to a non-existent landunit' - write(iulog,*) 'g, l, ltype, weight = ', g, l, ltype, weight - call endrun(decomp_index=l, clmlevel=namel, msg=errMsg(sourcefile, __LINE__)) - end if - - end subroutine set_landunit_weight - - - !----------------------------------------------------------------------- - function is_gcell_all_ltypeX(g, ltype) result(all_ltypeX) - ! - ! !DESCRIPTION: - ! Determine if the given grid cell is 100% covered by the landunit type given by ltype - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - logical :: all_ltypeX ! function result - integer, intent(in) :: g ! grid cell index - integer, intent(in) :: ltype ! landunit type of interest - ! - ! !LOCAL VARIABLES: - real(r8) :: wt_lunit ! subgrid weight of the given landunit - - real(r8), parameter :: tolerance = 1.e-13_r8 ! tolerance for checking whether landunit's weight is 1 - character(len=*), parameter :: subname = 'is_gcell_all_ltypeX' - !------------------------------------------------------------------------------ - - wt_lunit = get_landunit_weight(g, ltype) - if (wt_lunit >= (1._r8 - tolerance)) then - all_ltypeX = .true. - else - all_ltypeX = .false. - end if - - end function is_gcell_all_ltypeX - - !------------------------------------------------------------------------------ - subroutine check_weights (bounds, active_only) - ! - ! !DESCRIPTION: - ! Check subgrid weights. - ! - ! This routine operates in two different modes, depending on the value of active_only. If - ! active_only is true, then we check the sum of weights of the ACTIVE children, - ! grandchildren, etc. of a given point. If active_only is false, then we check the sum of - ! weights of ALL children, grandchildren, etc. of a given point. - ! - ! Normally this routine will be called twice: once with active_only=false, and once with - ! active_only=true. - ! - ! !USES - ! - ! !ARGUMENTS - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - logical, intent(in) :: active_only ! true => check sum of weights just of ACTIVE children, grandchildren, etc. - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p ! loop counters - real(r8), allocatable :: sumwtcol(:), sumwtlunit(:), sumwtgcell(:) - logical :: error_found ! true if we find an error - character(len=*), parameter :: subname = 'check_weights' - !------------------------------------------------------------------------------ - - allocate(sumwtcol(bounds%begc:bounds%endc)) - allocate(sumwtlunit(bounds%begl:bounds%endl)) - allocate(sumwtgcell(bounds%begg:bounds%endg)) - - error_found = .false. - - ! Check patch-level weights - sumwtcol(bounds%begc : bounds%endc) = 0._r8 - sumwtlunit(bounds%begl : bounds%endl) = 0._r8 - sumwtgcell(bounds%begg : bounds%endg) = 0._r8 - - do p = bounds%begp,bounds%endp - c = patch%column(p) - l = patch%landunit(p) - g = patch%gridcell(p) - - if ((active_only .and. patch%active(p)) .or. .not. active_only) then - sumwtcol(c) = sumwtcol(c) + patch%wtcol(p) - sumwtlunit(l) = sumwtlunit(l) + patch%wtlunit(p) - sumwtgcell(g) = sumwtgcell(g) + patch%wtgcell(p) - end if - end do - - do c = bounds%begc,bounds%endc - if (.not. weights_okay(sumwtcol(c), active_only, col%active(c))) then - write(iulog,*) trim(subname),' ERROR: at c = ',c,'total PFT weight is ',sumwtcol(c), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - do l = bounds%begl,bounds%endl - if (.not. weights_okay(sumwtlunit(l), active_only, lun%active(l))) then - write(iulog,*) trim(subname),' ERROR: at l = ',l,'total PFT weight is ',sumwtlunit(l), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - do g = bounds%begg,bounds%endg - if (.not. weights_okay(sumwtgcell(g), active_only, i_am_active=.true.)) then - write(iulog,*) trim(subname),' ERROR: at g = ',g,'total PFT weight is ',sumwtgcell(g), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - ! Check col-level weights - sumwtlunit(bounds%begl : bounds%endl) = 0._r8 - sumwtgcell(bounds%begg : bounds%endg) = 0._r8 - - do c = bounds%begc,bounds%endc - l = col%landunit(c) - g = col%gridcell(c) - - if ((active_only .and. col%active(c)) .or. .not. active_only) then - sumwtlunit(l) = sumwtlunit(l) + col%wtlunit(c) - sumwtgcell(g) = sumwtgcell(g) + col%wtgcell(c) - end if - end do - - do l = bounds%begl,bounds%endl - if (.not. weights_okay(sumwtlunit(l), active_only, lun%active(l))) then - write(iulog,*) trim(subname),' ERROR: at l = ',l,'total col weight is ',sumwtlunit(l), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - do g = bounds%begg,bounds%endg - if (.not. weights_okay(sumwtgcell(g), active_only, i_am_active=.true.)) then - write(iulog,*) trim(subname),' ERROR: at g = ',g,'total col weight is ',sumwtgcell(g), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - ! Check landunit-level weights - sumwtgcell(bounds%begg : bounds%endg) = 0._r8 - - do l = bounds%begl,bounds%endl - g = lun%gridcell(l) - if ((active_only .and. lun%active(l)) .or. .not. active_only) then - sumwtgcell(g) = sumwtgcell(g) + lun%wtgcell(l) - end if - end do - - do g = bounds%begg,bounds%endg - if (.not. weights_okay(sumwtgcell(g), active_only, i_am_active=.true.)) then - write(iulog,*) trim(subname),' ERROR: at g = ',g,'total lunit weight is ',sumwtgcell(g), & - 'active_only = ', active_only - error_found = .true. - end if - end do - - deallocate(sumwtcol, sumwtlunit, sumwtgcell) - - if (error_found) then - write(iulog,*) ' ' - write(iulog,*) 'If you are seeing this message at the beginning of a run with' - write(iulog,*) 'use_init_interp = .true. and init_interp_method = "use_finidat_areas",' - write(iulog,*) 'and you are seeing weights less than 1, then a likely cause is:' - write(iulog,*) 'For the above-mentioned grid cell(s):' - write(iulog,*) 'The matching input grid cell had some non-zero-weight subgrid type' - write(iulog,*) 'that is not present in memory in the new run.' - write(iulog,*) ' ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Success - - end subroutine check_weights - - !----------------------------------------------------------------------- - logical function weights_okay(sumwts, active_weights_only, i_am_active) - ! - ! !DESCRIPTION: - ! Determine if sumwts (the sum of weights of children, grandchildren or - ! great-grandchildren of a column, landunit or grid cell) satisfies the requirements laid - ! out above. - ! - ! The way this is determined depends on the values of two other variables: - ! - active_weights_only: does sumwts just include weights of active children, - ! grandchildren or great-grandchilden? (alternative is that it includes weights of ALL - ! children, grandchildren or great-grandchildren) - ! - i_am_active: true if the column, landunit or grid cell of interest is active - ! - ! !ARGUMENTS: - implicit none - real(r8), intent(in) :: sumwts ! sum of weights of children, grandchildren or great-grandchildren - logical , intent(in) :: active_weights_only ! true if sumwts just includes active children, etc. - logical , intent(in) :: i_am_active ! true if the current point is active - ! - ! !LOCAL VARIABLES: - logical :: weights_equal_1 - real(r8), parameter :: tolerance = 1.e-12_r8 ! tolerance for checking whether weights sum to 1 - !------------------------------------------------------------------------ - - weights_equal_1 = (abs(sumwts - 1._r8) <= tolerance) - - if (active_weights_only) then - if (i_am_active) then ! condition (2) above - weights_okay = weights_equal_1 - else ! condition (3) above - weights_okay = (sumwts == 0._r8 .or. weights_equal_1) - end if - else ! condition (1) above - ! (note that i_am_active is irrelevant in this case) - weights_okay = weights_equal_1 - end if - - end function weights_okay - - !----------------------------------------------------------------------- - subroutine set_subgrid_diagnostic_fields(bounds) - ! - ! !DESCRIPTION: - ! Set history fields giving diagnostics about subgrid weights - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_subgrid_diagnostic_fields' - !----------------------------------------------------------------------- - - call set_pct_landunit_diagnostics(bounds) - - ! Note: (MV, 10-17-14): The following has an use_fates if-block around it since - ! the pct_pft_diagnostics referens to patch%itype(p) which is not used by ED - ! Note: (SPM, 10-20-15): If this isn't set then debug mode with intel and - ! yellowstone will fail when trying to write pct_nat_pft since it contains - ! all NaN's. - call set_pct_pft_diagnostics(bounds) - - call set_pct_glc_mec_diagnostics(bounds) - - end subroutine set_subgrid_diagnostic_fields - - !----------------------------------------------------------------------- - subroutine set_pct_landunit_diagnostics(bounds) - ! - ! !DESCRIPTION: - ! Set pct_landunit diagnostic field: % of each landunit on the grid cell - ! - ! !USES: - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, l ! grid cell & landunit indices - integer :: ltype ! landunit type - - character(len=*), parameter :: subname = 'set_pct_landunit_diagnostics' - !----------------------------------------------------------------------- - - subgrid_weights_diagnostics%pct_landunit(bounds%begg:bounds%endg, :) = 0._r8 - - do l = bounds%begl, bounds%endl - g = lun%gridcell(l) - ltype = lun%itype(l) - subgrid_weights_diagnostics%pct_landunit(g, ltype) = lun%wtgcell(l) * 100._r8 - end do - - end subroutine set_pct_landunit_diagnostics - - !----------------------------------------------------------------------- - subroutine set_pct_glc_mec_diagnostics(bounds) - ! - ! !DESCRIPTION: - ! Set pct_glc_mec diagnostic field: % of each glc_mec column on the glc_mec landunit - ! - ! Note: it's safe to call this even if we're not running with glc_mec, but in that - ! case it won't do anything. - ! - ! Note that pct_glc_mec will be 0 for all elevation classes in a grid cell that does - ! not have a glc_mec landunit. However, it will still sum to 100% for a grid cell - ! that has a 0-weight (i.e., virtual) glc_mec landunit. - ! - ! !USES: - use landunit_varcon, only : istice_mec - use column_varcon, only : col_itype_to_icemec_class - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,l,g ! indices - integer :: icemec_class ! icemec class (1..maxpatch_glcmec) - - character(len=*), parameter :: subname = 'set_pct_glc_mec_diagnostics' - !----------------------------------------------------------------------- - - subgrid_weights_diagnostics%pct_glc_mec(bounds%begg:bounds%endg, :) = 0._r8 - - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - l = col%landunit(c) - if (lun%itype(l) == istice_mec) then - icemec_class = col_itype_to_icemec_class(col%itype(c)) - subgrid_weights_diagnostics%pct_glc_mec(g, icemec_class) = col%wtlunit(c) * 100._r8 - end if - end do - - end subroutine set_pct_glc_mec_diagnostics - - !----------------------------------------------------------------------- - subroutine set_pct_pft_diagnostics(bounds) - ! - ! !DESCRIPTION: - ! Set pct_nat_pft & pct_cft diagnostic fields: % of PFTs on their landunit - ! - ! !USES: - use landunit_varcon, only : istsoil, istcrop - use clm_varpar, only : natpft_lb, cft_lb - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: p,l,g ! indices - integer :: ptype ! patch itype - integer :: ptype_1indexing ! patch itype, translated into 1-indexing for the given landunit type - - character(len=*), parameter :: subname = 'set_pct_pft_diagnostics' - !----------------------------------------------------------------------- - - subgrid_weights_diagnostics%pct_nat_pft(bounds%begg:bounds%endg, :) = 0._r8 - - ! Note that pct_cft will be 0-size if cft_size is 0 (which can happen if we don't - ! have a crop landunit). But it doesn't hurt to have this line setting all elements - ! to 0, and doing this always allows us to avoid extra logic which could be a - ! maintenance problem. - subgrid_weights_diagnostics%pct_cft(bounds%begg:bounds%endg, :) = 0._r8 - - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - ptype = patch%itype(p) - if (lun%itype(l) == istsoil .and. (.not.use_fates) ) then - ptype_1indexing = ptype + (1 - natpft_lb) - subgrid_weights_diagnostics%pct_nat_pft(g, ptype_1indexing) = patch%wtlunit(p) * 100._r8 - else if (lun%itype(l) == istcrop) then - ptype_1indexing = ptype + (1 - cft_lb) - subgrid_weights_diagnostics%pct_cft(g, ptype_1indexing) = patch%wtlunit(p) * 100._r8 - end if - end do - - end subroutine set_pct_pft_diagnostics - -end module subgridWeightsMod diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 deleted file mode 100644 index ef593b1a6e..0000000000 --- a/src/main/surfrdMod.F90 +++ /dev/null @@ -1,819 +0,0 @@ -module surfrdMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in surface data file and determining - ! subgrid weights - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use clm_varpar , only : nlevsoifl, numpft - use landunit_varcon , only : numurbl - use clm_varcon , only : grlnd - use clm_varctl , only : iulog, scmlat, scmlon, single_column - use clm_varctl , only : use_cndv, use_crop - use surfrdUtilsMod , only : check_sums_equal_1, collapse_crop_types - use ncdio_pio , only : file_desc_t, var_desc_t, ncd_pio_openfile, ncd_pio_closefile - use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim, ncd_inqdid - use pio - use spmdMod - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) - public :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) - public :: surfrd_get_data ! Read surface dataset and determine subgrid weights - ! - ! !PRIVATE MEMBER FUNCTIONS: - private :: surfrd_special ! Read the special landunits - private :: surfrd_veg_all ! Read all of the vegetated landunits - private :: surfrd_veg_dgvm ! Read vegetated landunits for DGVM mode - private :: surfrd_pftformat ! Read crop pfts in file format where they are part of the vegetated land unit - private :: surfrd_cftformat ! Read crop pfts in file format where they are on their own landunit - ! - ! !PRIVATE DATA MEMBERS: - ! default multiplication factor for epsilon for error checks - real(r8), private, parameter :: eps_fact = 2._r8 - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine surfrd_get_globmask(filename, mask, ni, nj) - ! - ! !DESCRIPTION: - ! Read the surface dataset grid related information: - ! This is the first routine called by clm_initialize - ! NO DOMAIN DECOMPOSITION HAS BEEN SET YET - ! - ! !USES: - use fileutils , only : getfil - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: filename ! grid filename - integer , pointer :: mask(:) ! grid mask - integer , intent(out) :: ni, nj ! global grid sizes - ! - ! !LOCAL VARIABLES: - logical :: isgrid2d - integer :: dimid,varid ! netCDF id's - integer :: ns ! size of grid on file - integer :: n,i,j ! index - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - type(var_desc_t) :: vardesc ! variable descriptor - character(len=256) :: varname ! variable name - character(len=256) :: locfn ! local file name - logical :: readvar ! read variable in or not - integer , allocatable :: idata2d(:,:) - character(len=32) :: subname = 'surfrd_get_globmask' ! subroutine name - !----------------------------------------------------------------------- - - if (filename == ' ') then - mask(:) = 1 - RETURN - end if - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions and if grid file is 2d or 1d - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - if (masterproc) then - write(iulog,*)'lat/lon grid flag (isgrid2d) is ',isgrid2d - end if - - allocate(mask(ns)) - mask(:) = 1 - - if (isgrid2d) then - allocate(idata2d(ni,nj)) - idata2d(:,:) = 1 - call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) - end if - if (readvar) then - do j = 1,nj - do i = 1,ni - n = (j-1)*ni + i - mask(n) = idata2d(i,j) - enddo - enddo - end if - deallocate(idata2d) - else - call ncd_io(ncid=ncid, varname='LANDMASK', data=mask, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=mask, flag='read', readvar=readvar) - end if - end if - if (.not. readvar) call endrun( msg=' ERROR: landmask not on fatmlndfrc file'//errMsg(sourcefile, __LINE__)) - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_globmask - - !----------------------------------------------------------------------- - subroutine surfrd_get_grid(begg, endg, ldomain, filename, glcfilename) - ! - ! !DESCRIPTION: - ! THIS IS CALLED AFTER THE DOMAIN DECOMPOSITION HAS BEEN CREATED - ! Read the surface dataset grid related information: - ! o real latitude of grid cell (degrees) - ! o real longitude of grid cell (degrees) - ! - ! !USES: - use clm_varcon, only : spval, re - use domainMod , only : domain_type, domain_init, domain_clean, lon1d, lat1d - use fileutils , only : getfil - ! - ! !ARGUMENTS: - integer ,intent(in) :: begg, endg - type(domain_type),intent(inout) :: ldomain ! domain to init - character(len=*) ,intent(in) :: filename ! grid filename - character(len=*) ,optional, intent(in) :: glcfilename ! glc mask filename - ! - ! !LOCAL VARIABLES: - type(file_desc_t) :: ncid ! netcdf id - type(var_desc_t) :: vardesc ! variable descriptor - integer :: beg ! local beg index - integer :: end ! local end index - integer :: ni,nj,ns ! size of grid on file - integer :: dimid,varid ! netCDF id's - integer :: start(1), count(1) ! 1d lat/lon array sections - integer :: ier,ret ! error status - logical :: readvar ! true => variable is on input file - logical :: isgrid2d ! true => file is 2d lat/lon - logical :: istype_domain ! true => input file is of type domain - real(r8), allocatable :: rdata2d(:,:) ! temporary - character(len=16) :: vname ! temporary - character(len=256):: locfn ! local file name - integer :: n ! indices - real(r8):: eps = 1.0e-12_r8 ! lat/lon error tolerance - character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name -!----------------------------------------------------------------------- - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - - ! Determine isgrid2d flag for domain - call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=begg, nend=endg) - - ! Determine type of file - old style grid file or new style domain file - call check_var(ncid=ncid, varname='LONGXY', vardesc=vardesc, readvar=readvar) - if (readvar) istype_domain = .false. - - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) - if (readvar) istype_domain = .true. - - ! Read in area, lon, lat - - if (istype_domain) then - call ncd_io(ncid=ncid, varname= 'area', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - ! convert from radians**2 to km**2 - ldomain%area = ldomain%area * (re**2) - if (.not. readvar) call endrun( msg=' ERROR: area NOT on file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: xc NOT on file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: yc NOT on file'//errMsg(sourcefile, __LINE__)) - else - call ncd_io(ncid=ncid, varname= 'AREA', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: AREA NOT on file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname= 'LONGXY', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: LONGXY NOT on file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname= 'LATIXY', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: LATIXY NOT on file'//errMsg(sourcefile, __LINE__)) - end if - - if (isgrid2d) then - allocate(rdata2d(ni,nj), lon1d(ni), lat1d(nj)) - if (istype_domain) then - vname = 'xc' - else - vname = 'LONGXY' - end if - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lon1d(:) = rdata2d(:,1) - if (istype_domain) then - vname = 'yc' - else - vname = 'LATIXY' - end if - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lat1d(:) = rdata2d(1,:) - deallocate(rdata2d) - end if - - ! Check lat limited to -90,90 - - if (minval(ldomain%latc) < -90.0_r8 .or. & - maxval(ldomain%latc) > 90.0_r8) then - write(iulog,*) trim(subname),' WARNING: lat/lon min/max is ', & - minval(ldomain%latc),maxval(ldomain%latc) - ! call endrun( msg=' ERROR: lat is outside [-90,90]'//errMsg(sourcefile, __LINE__)) - ! write(iulog,*) trim(subname),' Limiting lat/lon to [-90/90] from ', & - ! minval(domain%latc),maxval(domain%latc) - ! where (ldomain%latc < -90.0_r8) ldomain%latc = -90.0_r8 - ! where (ldomain%latc > 90.0_r8) ldomain%latc = 90.0_r8 - endif - - call ncd_io(ncid=ncid, varname='LANDMASK', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDMASK NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - end if - - call ncd_io(ncid=ncid, varname='LANDFRAC', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='frac', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDFRAC NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - end if - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_grid - - !----------------------------------------------------------------------- - subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat) - ! - ! !DESCRIPTION: - ! Read the surface dataset and create subgrid weights. - ! The model's surface dataset recognizes 6 basic land cover types within a grid - ! cell: lake, wetland, urban, glacier, glacier_mec and vegetated. The vegetated - ! portion of the grid cell is comprised of up to [maxpatch_pft] patches. These - ! subgrid patches are read in explicitly for each grid cell. This is in - ! contrast to LSMv1, where the patches were built implicitly from biome types. - ! o real latitude of grid cell (degrees) - ! o real longitude of grid cell (degrees) - ! o integer surface type: 0 = ocean or 1 = land - ! o integer soil color (1 to 20) for use with soil albedos - ! o real soil texture, %sand, for thermal and hydraulic properties - ! o real soil texture, %clay, for thermal and hydraulic properties - ! o real % of cell covered by lake for use as subgrid patch - ! o real % of cell covered by wetland for use as subgrid patch - ! o real % of cell that is urban for use as subgrid patch - ! o real % of cell that is glacier for use as subgrid patch - ! o real % of cell that is glacier_mec for use as subgrid patch - ! o integer PFTs - ! o real % abundance PFTs (as a percent of vegetated area) - ! - ! !USES: - use clm_varctl , only : create_crop_landunit - use fileutils , only : getfil - use domainMod , only : domain_type, domain_init, domain_clean - use clm_instur , only : wt_lunit, topo_glc_mec - ! - ! !ARGUMENTS: - integer, intent(in) :: begg, endg - type(domain_type),intent(in) :: ldomain ! land domain - character(len=*), intent(in) :: lfsurdat ! surface dataset filename - ! - ! !LOCAL VARIABLES: - type(var_desc_t) :: vardesc ! pio variable descriptor - type(domain_type) :: surfdata_domain ! local domain associated with surface dataset - character(len=256):: locfn ! local file name - integer :: n ! loop indices - integer :: ni,nj,ns ! domain sizes - character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset - logical :: readvar ! true => variable is on dataset - real(r8) :: rmaxlon,rmaxlat ! local min/max vars - type(file_desc_t) :: ncid ! netcdf id - logical :: istype_domain ! true => input file is of type domain - logical :: isgrid2d ! true => intut grid is 2d - character(len=32) :: subname = 'surfrd_get_data' ! subroutine name - !----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to read surface boundary data .....' - if (lfsurdat == ' ') then - write(iulog,*)'lfsurdat must be specified' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - endif - - wt_lunit(:,:) = 0._r8 - topo_glc_mec(:,:) = 0._r8 - - ! Read surface data - - call getfil( lfsurdat, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Read in patch mask - this variable is only on the surface dataset - but not - ! on the domain dataset - - call ncd_io(ncid=ncid, varname= 'PFTDATA_MASK', flag='read', data=ldomain%pftm, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: pftm NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - ! Check if fsurdat grid is "close" to fatmlndfrc grid, exit if lats/lon > 0.001 - - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) - if (readvar) then - istype_domain = .true. - else - call check_var(ncid=ncid, varname='LONGXY', vardesc=vardesc, readvar=readvar) - if (readvar) then - istype_domain = .false. - else - call endrun( msg=' ERROR: unknown domain type'//errMsg(sourcefile, __LINE__)) - end if - end if - if (istype_domain) then - lon_var = 'xc' - lat_var = 'yc' - else - lon_var = 'LONGXY' - lat_var = 'LATIXY' - end if - if ( masterproc )then - write(iulog,*) trim(subname),' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) - end if - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, clmlevel=grlnd) - - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - rmaxlon = 0.0_r8 - rmaxlat = 0.0_r8 - do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) - else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) - endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) - enddo - if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then - write(iulog,*)' ERROR: surfdata/fatmgrid lon/lat mismatch error', rmaxlon,rmaxlat - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - !~! TODO(SPM, 022015) - if we deallocate and clean ldomain here, then you - !~! get errors in htape_timeconst where the information is needed to write - !~! the *.h0* file - !~!call domain_clean(surfdata_domain) - - ! Obtain special landunit info - - call surfrd_special(begg, endg, ncid, ldomain%ns) - - ! Obtain vegetated landunit info - - call surfrd_veg_all(begg, endg, ncid, ldomain%ns) - - if (use_cndv) then - call surfrd_veg_dgvm(begg, endg) - end if - - call ncd_pio_closefile(ncid) - - call check_sums_equal_1(wt_lunit, begg, 'wt_lunit', subname) - - if ( masterproc )then - write(iulog,*) 'Successfully read surface boundary data' - write(iulog,*) - end if - - end subroutine surfrd_get_data - -!----------------------------------------------------------------------- - subroutine surfrd_special(begg, endg, ncid, ns) - ! - ! !DESCRIPTION: - ! Determine weight with respect to gridcell of all special "patches" as well - ! as soil color and percent sand and clay - ! - ! !USES: - use clm_varpar , only : maxpatch_glcmec, nlevurb - use landunit_varcon , only : isturb_MIN, isturb_MAX, istdlak, istwet, istice_mec - use clm_instur , only : wt_lunit, urban_valid, wt_glc_mec, topo_glc_mec - use UrbanParamsType , only : CheckUrban - ! - ! !ARGUMENTS: - integer , intent(in) :: begg, endg - type(file_desc_t), intent(inout) :: ncid ! netcdf id - integer , intent(in) :: ns ! domain size - ! - ! !LOCAL VARIABLES: - integer :: n,nl,nurb,g ! indices - integer :: dimid,varid ! netCDF id's - real(r8) :: nlevsoidata(nlevsoifl) - logical :: found ! temporary for error check - integer :: nindx ! temporary for error check - integer :: ier ! error status - logical :: readvar - real(r8),pointer :: pctgla(:) ! percent of grid cell is glacier - real(r8),pointer :: pctlak(:) ! percent of grid cell is lake - real(r8),pointer :: pctwet(:) ! percent of grid cell is wetland - real(r8),pointer :: pcturb(:,:) ! percent of grid cell is urbanized - integer ,pointer :: urban_region_id(:) - real(r8),pointer :: pcturb_tot(:) ! percent of grid cell is urban (sum over density classes) - real(r8),pointer :: pctspec(:) ! percent of spec lunits wrt gcell - integer :: dens_index ! urban density index - character(len=32) :: subname = 'surfrd_special' ! subroutine name - real(r8) closelat,closelon - integer, parameter :: urban_invalid_region = 0 ! urban_region_id indicating invalid point -!----------------------------------------------------------------------- - - allocate(pctgla(begg:endg)) - allocate(pctlak(begg:endg)) - allocate(pctwet(begg:endg)) - allocate(pcturb(begg:endg,numurbl)) - allocate(pcturb_tot(begg:endg)) - allocate(urban_region_id(begg:endg)) - allocate(pctspec(begg:endg)) - - call check_dim(ncid, 'nlevsoi', nlevsoifl) - - ! Obtain non-grid surface properties of surface dataset other than percent patch - - call ncd_io(ncid=ncid, varname='PCT_WETLAND', flag='read', data=pctwet, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_WETLAND NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='PCT_LAKE' , flag='read', data=pctlak, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_LAKE NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='PCT_GLACIER', flag='read', data=pctgla, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_GLACIER NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - ! Read urban info - if (nlevurb == 0) then - ! If PCT_URBAN is not multi-density then set pcturb to zero - pcturb = 0._r8 - urban_valid(begg:endg) = .false. - write(iulog,*)'PCT_URBAN is not multi-density, pcturb set to 0' - else - call ncd_io(ncid=ncid, varname='PCT_URBAN' , flag='read', data=pcturb, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_URBAN NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname='URBAN_REGION_ID', flag='read', data=urban_region_id, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg= ' ERROR: URBAN_REGION_ID NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - where (urban_region_id == urban_invalid_region) - urban_valid = .false. - elsewhere - urban_valid = .true. - end where - end if - if ( nlevurb == 0 )then - if ( any(pcturb > 0.0_r8) ) then - call endrun( msg=' ERROR: PCT_URBAN MUST be zero when nlevurb=0'//errMsg(sourcefile, __LINE__)) - end if - end if - - pcturb_tot(:) = 0._r8 - do n = 1, numurbl - do nl = begg,endg - pcturb_tot(nl) = pcturb_tot(nl) + pcturb(nl,n) - enddo - enddo - - ! Read glacier info - - call check_dim(ncid, 'nglcec', maxpatch_glcmec ) - call check_dim(ncid, 'nglcecp1', maxpatch_glcmec+1 ) - - call ncd_io(ncid=ncid, varname='PCT_GLC_MEC', flag='read', data=wt_glc_mec, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_GLC_MEC NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - wt_glc_mec(:,:) = wt_glc_mec(:,:) / 100._r8 - call check_sums_equal_1(wt_glc_mec, begg, 'wt_glc_mec', subname) - - call ncd_io(ncid=ncid, varname='TOPO_GLC_MEC', flag='read', data=topo_glc_mec, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: TOPO_GLC_MEC NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - topo_glc_mec(:,:) = max(topo_glc_mec(:,:), 0._r8) - - pctspec = pctwet + pctlak + pcturb_tot + pctgla - - ! Error check: glacier, lake, wetland, urban sum must be less than 100 - - found = .false. - do nl = begg,endg - if (pctspec(nl) > 100._r8+1.e-04_r8) then - found = .true. - nindx = nl - exit - end if - if (found) exit - end do - if ( found ) then - write(iulog,*)'surfrd error: patch cover>100 for nl=',nindx - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ! Determine wt_lunit for special landunits - - do nl = begg,endg - - wt_lunit(nl,istdlak) = pctlak(nl)/100._r8 - - wt_lunit(nl,istwet) = pctwet(nl)/100._r8 - - wt_lunit(nl,istice_mec) = pctgla(nl)/100._r8 - - do n = isturb_MIN, isturb_MAX - dens_index = n - isturb_MIN + 1 - wt_lunit(nl,n) = pcturb(nl,dens_index) / 100._r8 - end do - - end do - - call CheckUrban(begg, endg, pcturb(begg:endg,:), subname) - - deallocate(pctgla,pctlak,pctwet,pcturb,pcturb_tot,urban_region_id,pctspec) - - end subroutine surfrd_special - -!----------------------------------------------------------------------- - subroutine surfrd_cftformat( ncid, begg, endg, wt_cft, cftsize, natpft_size ) - ! - ! !DESCRIPTION: - ! Handle generic crop types for file format where they are on their own - ! crop landunit and read in as Crop Function Types. - ! !USES: - use clm_instur , only : fert_cft, wt_nat_patch - use clm_varpar , only : cft_size, cft_lb, natpft_lb - ! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netcdf id - integer , intent(in) :: begg, endg - integer , intent(in) :: cftsize ! CFT size - real(r8), pointer, intent(inout) :: wt_cft(:,:) ! CFT weights - integer , intent(in) :: natpft_size ! natural PFT size - ! - ! !LOCAL VARIABLES: - logical :: readvar ! is variable on dataset - real(r8),pointer :: array2D(:,:) ! local array - character(len=32) :: subname = 'surfrd_cftformat'! subroutine name -!----------------------------------------------------------------------- - SHR_ASSERT_ALL((lbound(wt_cft) == (/begg, cft_lb/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wt_cft, dim=1) == (/endg/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wt_cft, dim=2) >= (/cftsize+1-cft_lb/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wt_nat_patch) >= (/endg,natpft_size-1+natpft_lb/)), errMsg(sourcefile, __LINE__)) - - call check_dim(ncid, 'cft', cftsize) - call check_dim(ncid, 'natpft', natpft_size) - - call ncd_io(ncid=ncid, varname='PCT_CFT', flag='read', data=wt_cft, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_CFT NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - if ( cft_size > 0 )then - call ncd_io(ncid=ncid, varname='CONST_FERTNITRO_CFT', flag='read', data=fert_cft, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - if ( masterproc ) & - write(iulog,*) ' WARNING: CONST_FERTNITRO_CFT NOT on surfdata file zero out' - fert_cft = 0.0_r8 - end if - else - fert_cft = 0.0_r8 - end if - - allocate( array2D(begg:endg,1:natpft_size) ) - call ncd_io(ncid=ncid, varname='PCT_NAT_PFT', flag='read', data=array2D, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_NAT_PFT NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - wt_nat_patch(begg:,natpft_lb:natpft_size-1+natpft_lb) = array2D(begg:,:) - deallocate( array2D ) - - end subroutine surfrd_cftformat - -!----------------------------------------------------------------------- - subroutine surfrd_pftformat( begg, endg, ncid ) - ! - ! !DESCRIPTION: - ! Handle generic crop types for file format where they are part of the - ! natural vegetation landunit. - ! !USES: - use clm_instur , only : fert_cft, wt_nat_patch - use clm_varpar , only : natpft_size, cft_size, natpft_lb - ! !ARGUMENTS: - implicit none - integer, intent(in) :: begg, endg - type(file_desc_t), intent(inout) :: ncid ! netcdf id - ! - ! !LOCAL VARIABLES: - logical :: cft_dim_exists ! does the dimension 'cft' exist on the dataset? - integer :: dimid ! netCDF id's - logical :: readvar ! is variable on dataset - character(len=32) :: subname = 'surfrd_pftformat'! subroutine name -!----------------------------------------------------------------------- - SHR_ASSERT_ALL((ubound(wt_nat_patch) == (/endg, natpft_size-1+natpft_lb/)), errMsg(sourcefile, __LINE__)) - - call check_dim(ncid, 'natpft', natpft_size) - ! If cft_size == 0, then we expect to be running with a surface dataset - ! that does - ! NOT have a PCT_CFT array (or CONST_FERTNITRO_CFT array), and thus does not have a 'cft' dimension. - ! Make sure - ! that's the case. - call ncd_inqdid(ncid, 'cft', dimid, cft_dim_exists) - if (cft_dim_exists) then - call endrun( msg= ' ERROR: unexpectedly found cft dimension on dataset when cft_size=0'// & - ' (if the surface dataset has a separate crop landunit, then the code'// & - ' must also have a separate crop landunit, and vice versa)'//& - errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='CONST_FERTNITRO_CFT', flag='read', data=fert_cft, & - dim1name=grlnd, readvar=readvar) - if (readvar) then - call endrun( msg= ' ERROR: unexpectedly found CONST_FERTNITRO_CFT on dataset when cft_size=0'// & - ' (if the surface dataset has a separate crop landunit, then the code'// & - ' must also have a separate crop landunit, and vice versa)'//& - errMsg(sourcefile, __LINE__)) - end if - fert_cft = 0.0_r8 - - call ncd_io(ncid=ncid, varname='PCT_NAT_PFT', flag='read', data=wt_nat_patch, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_NAT_PFT NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - - end subroutine surfrd_pftformat - -!----------------------------------------------------------------------- - subroutine surfrd_veg_all(begg, endg, ncid, ns) - ! - ! !DESCRIPTION: - ! Determine weight arrays for non-dynamic landuse mode - ! - ! !USES: - use clm_varctl , only : create_crop_landunit, use_fates - use clm_varpar , only : natpft_lb, natpft_ub, natpft_size, cft_size, cft_lb - use clm_instur , only : wt_lunit, wt_nat_patch, wt_cft, fert_cft - use landunit_varcon , only : istsoil, istcrop - use surfrdUtilsMod , only : convert_cft_to_pft - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: begg, endg - type(file_desc_t),intent(inout) :: ncid ! netcdf id - integer ,intent(in) :: ns ! domain size - ! - ! !LOCAL VARIABLES: - integer :: dimid ! netCDF id's - integer :: cftsize ! size of CFT's - logical :: readvar ! is variable on dataset - logical :: cft_dim_exists ! does the dimension 'cft' exist on the dataset? - real(r8),pointer :: arrayl(:) ! local array - real(r8),pointer :: array2D(:,:) ! local 2D array - character(len=32) :: subname = 'surfrd_veg_all' ! subroutine name -!----------------------------------------------------------------------- - ! - ! Read in variables that are handled the same for all formats - ! - ! Check dimension size - call check_dim(ncid, 'lsmpft', numpft+1) - - ! This temporary array is needed because ncd_io expects a pointer, so we can't - ! directly pass wt_lunit(begg:endg,istsoil) - allocate(arrayl(begg:endg)) - - call ncd_io(ncid=ncid, varname='PCT_NATVEG', flag='read', data=arrayl, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_NATVEG NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - wt_lunit(begg:endg,istsoil) = arrayl(begg:endg) - - call ncd_io(ncid=ncid, varname='PCT_CROP', flag='read', data=arrayl, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: PCT_CROP NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - wt_lunit(begg:endg,istcrop) = arrayl(begg:endg) - - deallocate(arrayl) - - ! Check the file format for CFT's and handle accordingly - call ncd_inqdid(ncid, 'cft', dimid, cft_dim_exists) - if ( cft_dim_exists .and. create_crop_landunit )then - call surfrd_cftformat( ncid, begg, endg, wt_cft, cft_size, natpft_size ) ! Format where CFT's is read in a seperate landunit - else if ( (.not. cft_dim_exists) .and. (.not. create_crop_landunit) )then - if ( masterproc ) write(iulog,*) "WARNING: The PFT format is an unsupported format that will be removed in th future!" - call surfrd_pftformat( begg, endg, ncid ) ! Format where crop is part of the natural veg. landunit - else if ( cft_dim_exists .and. .not. create_crop_landunit )then - if ( masterproc ) write(iulog,*) "WARNING: New CFT-based format surface datasets should be run with create_crop_landunit=T" - if ( use_fates ) then - if ( masterproc ) write(iulog,*) "WARNING: When fates is on we allow new CFT based surface datasets ", & - "to be used with create_crop_land FALSE" - cftsize = 2 - allocate(array2D(begg:endg,cft_lb:cftsize-1+cft_lb)) - call surfrd_cftformat( ncid, begg, endg, array2D, cftsize, natpft_size-cftsize ) ! Read crops in as CFT's - call convert_cft_to_pft( begg, endg, cftsize, array2D ) ! Convert from CFT to natural veg. landunit - deallocate(array2D) - else - call endrun( msg=' ERROR: New format surface datasets require create_crop_landunit TRUE'//errMsg(sourcefile, __LINE__)) - end if - end if - - ! Do some checking - - if ( (cft_size == 0) .and. any(wt_lunit(begg:endg,istcrop) > 0._r8) ) then - call endrun( msg=' ERROR: if PCT_CROP > 0 anywhere, then cft_size must be > 0'// & - ' (if the surface dataset has a separate crop landunit, then the code'// & - ' must also have a separate crop landunit, and vice versa)'//& - errMsg(sourcefile, __LINE__)) - end if - ! Convert from percent to fraction, check sums of nat vegetation add to 1 - if ( cft_size > 0 )then - wt_cft(begg:endg,:) = wt_cft(begg:endg,:) / 100._r8 - call check_sums_equal_1(wt_cft, begg, 'wt_cft', subname) - end if - wt_lunit(begg:endg,istsoil) = wt_lunit(begg:endg,istsoil) / 100._r8 - wt_lunit(begg:endg,istcrop) = wt_lunit(begg:endg,istcrop) / 100._r8 - wt_nat_patch(begg:endg,:) = wt_nat_patch(begg:endg,:) / 100._r8 - call check_sums_equal_1(wt_nat_patch, begg, 'wt_nat_patch', subname) - - ! Collapse crop landunits down when prognostic crops are on - if (use_crop) then - call collapse_crop_types(wt_cft(begg:endg, :), fert_cft(begg:endg, :), begg, endg, verbose=.true.) - end if - - end subroutine surfrd_veg_all - - !----------------------------------------------------------------------- - subroutine surfrd_veg_dgvm(begg, endg) - ! - ! !DESCRIPTION: - ! Determine weights for CNDV mode. - ! - ! !USES: - use pftconMod , only : noveg - use clm_instur, only : wt_nat_patch - ! - ! !ARGUMENTS: - integer, intent(in) :: begg, endg - ! - ! !LOCAL VARIABLES: - character(len=*), parameter :: subname = 'surfrd_veg_dgvm' - !----------------------------------------------------------------------- - - ! Bare ground gets 100% weight; all other natural patches are zeroed out - wt_nat_patch(begg:endg, :) = 0._r8 - wt_nat_patch(begg:endg, noveg) = 1._r8 - - call check_sums_equal_1(wt_nat_patch, begg, 'wt_nat_patch', subname) - - end subroutine surfrd_veg_dgvm - -end module surfrdMod diff --git a/src/main/surfrdUtilsMod.F90 b/src/main/surfrdUtilsMod.F90 deleted file mode 100644 index 45fbf9ebe1..0000000000 --- a/src/main/surfrdUtilsMod.F90 +++ /dev/null @@ -1,243 +0,0 @@ -module surfrdUtilsMod - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains utility methods that can be used when reading surface datasets or similar - ! datasets (such as the landuse_timeseries dataset) - ! - ! !USES: -#include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: check_sums_equal_1 ! Confirm that sum(arr(n,:)) == 1 for all n - public :: renormalize ! Renormalize an array - public :: convert_cft_to_pft ! Conversion of crop CFT to natural veg PFT:w - public :: collapse_crop_types ! Collapse unused crop types into types used in this run - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine check_sums_equal_1(arr, lb, name, caller, ier) - ! - ! !DESCRIPTION: - ! Confirm that sum(arr(n,:)) == 1 for all n. If this isn't true for any n, abort with a message. - ! - ! !ARGUMENTS: - integer , intent(in) :: lb ! lower bound of the first dimension of arr - real(r8) , intent(in) :: arr(lb:,:) ! array to check - character(len=*), intent(in) :: name ! name of array - character(len=*), intent(in) :: caller ! identifier of caller, for more meaningful error messages - integer, optional, intent(out):: ier ! Return an error code rather than abort - ! - ! !LOCAL VARIABLES: - logical :: found - integer :: nl - integer :: nindx - real(r8), parameter :: eps = 1.e-13_r8 - !----------------------------------------------------------------------- - - if( present(ier) ) ier = 0 - found = .false. - - do nl = lbound(arr, 1), ubound(arr, 1) - if (abs(sum(arr(nl,:)) - 1._r8) > eps) then - found = .true. - nindx = nl - exit - end if - end do - - if (found) then - write(iulog,*) trim(caller), ' ERROR: sum of ', trim(name), ' not 1.0 at nl=', nindx - write(iulog,*) 'sum is: ', sum(arr(nindx,:)) - if( present(ier) ) then - ier = -10 - else - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine check_sums_equal_1 - - !----------------------------------------------------------------------- - subroutine renormalize(arr, lb, normal) - ! - ! !DESCRIPTION: - ! Re normalize an array so that it sums to the input value - ! - ! !ARGUMENTS: - integer , intent(in) :: lb ! lower bound of the first dimension of arr - real(r8) , intent(inout) :: arr(lb:,:) ! array to check - real(r8) , intent(in) :: normal ! normal to sum to - ! - ! !LOCAL VARIABLES: - integer :: nl ! Array index - real(r8) :: arr_sum ! sum of array - real(r8) :: ratio ! ratio to multiply by - !----------------------------------------------------------------------- - - do nl = lbound(arr, 1), ubound(arr, 1) - arr_sum = sum(arr(nl,:)) - if ( arr_sum /= 0.0_r8 )then - ratio = normal / arr_sum - arr(nl,:) = arr(nl,:) * ratio - end if - end do - - end subroutine renormalize - -!----------------------------------------------------------------------- - subroutine convert_cft_to_pft( begg, endg, cftsize, wt_cft ) - ! - ! !DESCRIPTION: - ! Convert generic crop types that were read in as seperate CFT's on - ! a crop landunit, and put them on the vegetated landunit. - ! !USES: - use clm_instur , only : wt_lunit, wt_nat_patch, fert_cft - use clm_varpar , only : cft_size, natpft_size - use pftconMod , only : nc3crop - use landunit_varcon , only : istsoil, istcrop - ! !ARGUMENTS: - implicit none - integer , intent(in) :: begg, endg - integer , intent(in) :: cftsize ! CFT size - real(r8) , intent(inout) :: wt_cft(begg:,:) ! CFT weights - ! - ! !LOCAL VARIABLES: - integer :: g ! index -!----------------------------------------------------------------------- - SHR_ASSERT_ALL((ubound(wt_cft) == (/endg, cftsize/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(wt_nat_patch) == (/endg, nc3crop+cftsize-1/)), errMsg(sourcefile, __LINE__)) - - do g = begg, endg - if ( wt_lunit(g,istcrop) > 0.0_r8 )then - ! Move CFT over to PFT and do weighted average of the crop and soil parts - wt_nat_patch(g,:) = wt_nat_patch(g,:) * wt_lunit(g,istsoil) - wt_cft(g,:) = wt_cft(g,:) * wt_lunit(g,istcrop) - wt_nat_patch(g,nc3crop:) = wt_cft(g,:) ! Add crop CFT's to end of natural veg PFT's - wt_lunit(g,istsoil) = (wt_lunit(g,istsoil) + wt_lunit(g,istcrop)) ! Add crop landunit to soil landunit - wt_nat_patch(g,:) = wt_nat_patch(g,:) / wt_lunit(g,istsoil) - wt_lunit(g,istcrop) = 0.0_r8 ! Zero out crop CFT's - else - wt_nat_patch(g,nc3crop:) = 0.0_r8 ! Make sure generic crops are zeroed out - end if - end do - - end subroutine convert_cft_to_pft - - !----------------------------------------------------------------------- - subroutine collapse_crop_types(wt_cft, fert_cft, begg, endg, verbose) - ! - ! !DESCRIPTION: - ! Collapse unused crop types into types used in this run. - ! - ! Should only be called if using prognostic crops - otherwise, wt_cft is meaningless - ! - ! !USES: - use clm_varctl , only : irrigate - use clm_varpar , only : cft_lb, cft_ub, cft_size - use pftconMod , only : nc3crop, nc3irrig, npcropmax, pftcon - ! - ! !ARGUMENTS: - - ! Note that we use begg and endg rather than 'bounds', because bounds may not be - ! available yet when this is called - integer, intent(in) :: begg ! Beginning grid cell index - integer, intent(in) :: endg ! Ending grid cell index - - ! Weight and fertilizer of each CFT in each grid cell; dimensioned [g, cft_lb:cft_ub] - ! This array is modified in-place - real(r8), intent(inout) :: wt_cft(begg:, cft_lb:) - real(r8), intent(inout) :: fert_cft(begg:, cft_lb:) - - logical, intent(in) :: verbose ! If true, print some extra information - ! - ! !LOCAL VARIABLES: - integer :: g - integer :: m - real(r8) :: wt_cft_to - real(r8) :: wt_cft_from - real(r8) :: wt_cft_merge - - character(len=*), parameter :: subname = 'collapse_crop_types' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(wt_cft) == (/endg, cft_ub/)), errMsg(sourcefile, __LINE__)) - - if (cft_size <= 0) then - call endrun(msg = subname//' can only be called if cft_size > 0' // & - errMsg(sourcefile, __LINE__)) - end if - - ! ------------------------------------------------------------------------ - ! If not using irrigation, merge irrigated CFTs into rainfed CFTs - ! ------------------------------------------------------------------------ - - if (.not. irrigate) then - if (verbose .and. masterproc) then - write(iulog,*) trim(subname)//' crop=.T. and irrigate=.F., so merging irrigated pfts with rainfed' - end if - - do g = begg, endg - ! Left Hand Side: merged rainfed+irrigated crop pfts from nc3crop to - ! npcropmax-1, stride 2 - ! Right Hand Side: rainfed crop pfts from nc3crop to npcropmax-1, - ! stride 2 - ! plus irrigated crop pfts from nc3irrig to npcropmax, - ! stride 2 - ! where stride 2 means "every other" - wt_cft(g, nc3crop:npcropmax-1:2) = & - wt_cft(g, nc3crop:npcropmax-1:2) + wt_cft(g, nc3irrig:npcropmax:2) - wt_cft(g, nc3irrig:npcropmax:2) = 0._r8 - end do - - call check_sums_equal_1(wt_cft, begg, 'wt_cft', subname//': irrigation') - end if - - ! ------------------------------------------------------------------------ - ! Merge CFTs into the list of crops that CLM knows how to model - ! ------------------------------------------------------------------------ - - if (verbose .and. masterproc) then - write(iulog, *) trim(subname) // ' merging wheat, barley, and rye into temperate cereals' - write(iulog, *) trim(subname) // ' clm knows how to model corn, temperate cereals, and soybean' - write(iulog, *) trim(subname) // ' all other crops are lumped with the generic crop pft' - end if - - do g = begg, endg - do m = 1, npcropmax - if (m /= pftcon%mergetoclmpft(m)) then - wt_cft_to = wt_cft(g, pftcon%mergetoclmpft(m)) - wt_cft_from = wt_cft(g, m) - wt_cft_merge = wt_cft_to + wt_cft_from - wt_cft(g, pftcon%mergetoclmpft(m)) = wt_cft_merge - wt_cft(g, m) = 0._r8 - if (wt_cft_merge > 0._r8) then - fert_cft(g,pftcon%mergetoclmpft(m)) = (wt_cft_to * fert_cft(g,pftcon%mergetoclmpft(m)) + & - wt_cft_from * fert_cft(g,m)) / wt_cft_merge - end if - end if - end do - - end do - - call check_sums_equal_1(wt_cft, begg, 'wt_cft', subname//': mergetoclmpft') - - end subroutine collapse_crop_types - - -end module surfrdUtilsMod diff --git a/src/main/test/CMakeLists.txt b/src/main/test/CMakeLists.txt deleted file mode 100644 index 2aa80fd5d7..0000000000 --- a/src/main/test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_subdirectory(subgridWeights_test) -add_subdirectory(accumul_test) -add_subdirectory(surfrdUtils_test) -add_subdirectory(atm2lnd_test) -add_subdirectory(clm_glclnd_test) -add_subdirectory(glcBehavior_test) -add_subdirectory(filter_test) -add_subdirectory(ncdio_utils_test) -add_subdirectory(topo_test) diff --git a/src/main/test/accumul_test/CMakeLists.txt b/src/main/test/accumul_test/CMakeLists.txt deleted file mode 100644 index 105ef0dac1..0000000000 --- a/src/main/test/accumul_test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -set(pfunit_sources - test_accumul.pf) - -create_pFUnit_test(accumul test_accumul_exe - "${pfunit_sources}" "") - -target_link_libraries(test_accumul_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/main/test/accumul_test/test_accumul.pf b/src/main/test/accumul_test/test_accumul.pf deleted file mode 100644 index 8e08cff77d..0000000000 --- a/src/main/test/accumul_test/test_accumul.pf +++ /dev/null @@ -1,720 +0,0 @@ -module test_accumul - - ! Tests of accumulMod - - use pfunit_mod - use accumulMod - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon, only : spval - use PatchType, only : patch - - implicit none - - @TestCase - type, extends(TestCase) :: TestAccumul - contains - procedure :: setUp - procedure :: tearDown - procedure :: init_sl_patch_field - procedure :: init_ml_patch_field - procedure :: update_and_extract_sl_patch_field - procedure :: update_and_extract_ml_patch_field - end type TestAccumul - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Helper routines - ! ======================================================================== - - subroutine setUp(this) - class(TestAccumul), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestAccumul), intent(inout) :: this - - call clean_accum_fields - end subroutine tearDown - - subroutine init_sl_patch_field(this, name, accum_type, accum_period, init_value) - ! Call init_accum_field for a single-level patch field - class(TestAccumul), intent(in) :: this - character(len=*), intent(in) :: name - character(len=*), intent(in) :: accum_type ! timeavg, runmean, runaccum - integer, intent(in) :: accum_period - real(r8), intent(in), optional :: init_value ! if absent, use 0 - - real(r8) :: l_init_value - - if (present(init_value)) then - l_init_value = init_value - else - l_init_value = 0._r8 - end if - - call init_accum_field(& - name = name, & - units = 'none', & - desc = 'no desc', & - accum_type = accum_type, & - accum_period = accum_period, & - numlev = 1, & - subgrid_type = 'pft', & - init_value = l_init_value) - end subroutine init_sl_patch_field - - subroutine init_ml_patch_field(this, name, accum_type, accum_period, nlev, init_value) - ! Call init_accum_field for a multi-level patch field - class(TestAccumul), intent(in) :: this - character(len=*), intent(in) :: name - character(len=*), intent(in) :: accum_type ! timeavg, runmean, runaccum - integer, intent(in) :: accum_period - integer, intent(in) :: nlev - real(r8), intent(in), optional :: init_value ! if absent, use 0 - - real(r8) :: l_init_value - - if (present(init_value)) then - l_init_value = init_value - else - l_init_value = 0._r8 - end if - - call init_accum_field(& - name = name, & - units = 'none', & - desc = 'no desc', & - accum_type = accum_type, & - accum_period = accum_period, & - numlev = nlev, & - subgrid_type = 'pft', & - init_value = l_init_value, & - type2d = 'irrelevant') ! type2d just needed for restart - end subroutine init_ml_patch_field - - subroutine update_and_extract_sl_patch_field(this, fieldname, values, val_output, & - pactive, timestep_start) - ! Calls update_accum_field once for each value in 'values', assuming that the values - ! come once per timestep. For the first call, all input values are set equal to - ! values(1); for the second call, all input values are set equal to values(2); etc. - ! - ! After all update calls are done, calls extract_accum_field to extract the final - ! value from bounds%begp into val_output. This assumes the timestep at extraction is - ! size(values) (or size(values)+(timestep_start-1), if timestep_start is present). - ! - ! If pactive is present, then it should be an array of the same size as 'values', - ! specifying whether the patch at bounds%begp is active in each time step. If this is - ! absent, then this patch is assumed to be active for all time steps. - ! - ! This version is for a single-level (1-d) field. - class(TestAccumul), intent(inout) :: this - character(len=*), intent(in) :: fieldname - real(r8), intent(in) :: values(:) - real(r8), intent(out) :: val_output - logical, optional, intent(in) :: pactive(:) - - ! If present, this specifies the starting nstep value. If absent, we start with 1. - integer, optional, intent(in) :: timestep_start - - integer :: n_timesteps - integer :: timestep - integer :: timestep_offset - real(r8), pointer :: vals_input(:) - real(r8), pointer :: vals_output(:) - logical, allocatable :: l_pactive(:) ! local version of pactive - - n_timesteps = size(values) - if (present(pactive)) then - @assertEqual(n_timesteps, size(pactive)) - end if - - allocate(l_pactive(n_timesteps)) - if (present(pactive)) then - l_pactive(:) = pactive(:) - else - l_pactive(:) = .true. - end if - - if (present(timestep_start)) then - timestep_offset = timestep_start - 1 - else - timestep_offset = 0 - end if - - allocate(vals_input(bounds%begp:bounds%endp)) - allocate(vals_output(bounds%begp:bounds%endp)) - do timestep = 1, n_timesteps - vals_input(:) = values(timestep) - patch%active(bounds%begp) = l_pactive(timestep) - call update_accum_field(fieldname, vals_input, timestep+timestep_offset) - end do - call extract_accum_field(fieldname, vals_output, n_timesteps+timestep_offset) - val_output = vals_output(bounds%begp) - - deallocate(vals_input) - deallocate(vals_output) - - end subroutine update_and_extract_sl_patch_field - - subroutine update_and_extract_ml_patch_field(this, fieldname, values, val_output, pactive) - ! Calls update_accum_field once for each value in 'values', assuming that the values - ! come once per timestep. For the first call, the input values in all patches are set - ! equal to values(:,1); for the second call, the input values in all patches are set - ! equal to values(:,2); etc. Thus, 'values' specifies different values for each level - ! and time, but assumes the same values in each patch (if there is more than one - ! patch). - ! - ! After all update calls are done, calls extract_accum_field to extract the final - ! value from bounds%begp into this%vals_output. This assumes the timestep at - ! extraction is size(values,2). - ! - ! If pactive is present, then it should be an array of the same size as the second - ! dimension of 'values', specifying whether the patch at bounds%begp is active in each - ! time step. If this is absent, then this patch is assumed to be active for all time - ! steps. - ! - ! This version is for a multi-level (2-d) field. - class(TestAccumul), intent(inout) :: this - character(len=*), intent(in) :: fieldname - real(r8), intent(in) :: values(:,:) ! [level, time] - real(r8), intent(out) :: val_output(:) ! [level] - logical, optional, intent(in) :: pactive(:) - - integer :: n_timesteps - integer :: timestep - integer :: n_levels - integer :: level - real(r8), pointer :: vals_input(:,:) - real(r8), pointer :: vals_output(:,:) - logical, allocatable :: l_pactive(:) ! local version of pactive - - n_levels = size(values,1) - n_timesteps = size(values,2) - - @assertEqual(n_levels, size(val_output)) - if (present(pactive)) then - @assertEqual(n_timesteps, size(pactive)) - end if - - allocate(l_pactive(n_timesteps)) - if (present(pactive)) then - l_pactive(:) = pactive(:) - else - l_pactive(:) = .true. - end if - - allocate(vals_input(bounds%begp:bounds%endp, n_levels)) - allocate(vals_output(bounds%begp:bounds%endp, n_levels)) - do timestep = 1, n_timesteps - do level = 1, n_levels - vals_input(:,level) = values(level,timestep) - end do - patch%active(bounds%begp) = l_pactive(timestep) - call update_accum_field(fieldname, vals_input, timestep) - end do - call extract_accum_field(fieldname, vals_output, n_timesteps) - val_output(:) = vals_output(bounds%begp,:) - - deallocate(vals_input) - deallocate(vals_output) - - end subroutine update_and_extract_ml_patch_field - - ! ======================================================================== - ! Begin tests - ! ======================================================================== - - ! ------------------------------------------------------------------------ - ! Tests of timeavg - ! ------------------------------------------------------------------------ - - @Test - subroutine timeavg_basic(this) - ! Test basic operation of timeavg field - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(accum_period) = [11._r8, 12._r8, 13._r8] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected = sum(values)/accum_period - @assertEqual(expected, val_output, tolerance=tol) - end subroutine timeavg_basic - - @Test - subroutine timeavg_wrongTime(this) - ! Test a timeavg field when it's the wrong time for producing an average - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(2) = [11._r8, 12._r8] - real(r8) :: val_output - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - @assertEqual(spval, val_output) - end subroutine timeavg_wrongTime - - @Test - subroutine timeavg_onlyLatestPeriod(this) - ! If we go through multiple periods, the values from earlier periods should have no - ! impact on the final result. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(accum_period*2) = & - [11._r8, 12._r8, 13._r8, 21._r8, 22._r8, 23._r8] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected = sum(values(accum_period+1:2*accum_period))/accum_period - @assertEqual(expected, val_output, tolerance=tol) - end subroutine timeavg_onlyLatestPeriod - - @Test - subroutine timeavg_newlyActive(this) - ! For timeavg: If a point becomes active in the middle of a period, then it should - ! give the average value just over the time steps when it was active. - ! - ! This may or may not be the ideal behavior; we can change this if some other - ! behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(accum_period*2) = & - [11._r8, 12._r8, 13._r8, 21._r8, 22._r8, 23._r8] - logical, parameter :: pactive(accum_period*2) = & - [.false., .false., .false., .false., .true., .true.] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected = sum(values(5:6))/2._r8 - @assertEqual(expected, val_output, tolerance=tol) - end subroutine timeavg_newlyActive - - @Test - subroutine timeavg_veryNewlyActive(this) - ! For timeavg: If a point just became active in this time step, and this is the time - ! when we'd usually get time averages, then the time average for this point should - ! just be this time step's value. - ! - ! This may or may not be the ideal behavior; we can change this if some other - ! behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(accum_period) = [11._r8, 12._r8, 13._r8] - logical, parameter :: pactive(accum_period) = [.false., .false., .true.] - real(r8) :: val_output - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - @assertEqual(values(accum_period), val_output, tolerance=tol) - end subroutine timeavg_veryNewlyActive - - @Test - subroutine timeavg_activeInactiveActive(this) - ! Test timeavg with a point that starts active, becomes inactive, then later becomes - ! active again. Test spans two periods. The point is inactive during the reset time - ! step. The final average should be the average of the time steps when it was active. - ! In particular, it should not be reset. - ! - ! This may or may not be the ideal behavior; we can change this if some other - ! behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(accum_period*2) = & - [11._r8, 102._r8, 193._r8, 210._r8, 272._r8, 234._r8] - logical, parameter :: pactive(accum_period*2) = & - [.true., .true., .false., .false., .true., .true.] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected = (values(1) + values(2) + values(5) + values(6))/4._r8 - @assertEqual(expected, val_output, tolerance=tol) - end subroutine timeavg_activeInactiveActive - - @Test - subroutine timeavg_multiLevel(this) - ! Make sure that multi-level timeavg works right - ! - ! Note that we currently do not have multi-level tests of the other accum types. - ! Because of the way the code is structured, this is okay: the same multi-level code - ! is used regardless of the accum method. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values_lev1(accum_period*2) = & - [11._r8, 12._r8, 13._r8, 21._r8, 22._r8, 23._r8] - real(r8), parameter :: values_lev2(accum_period*2) = & - [111._r8, 112._r8, 113._r8, 121._r8, 122._r8, 123._r8] - real(r8) :: values(2, accum_period*2) - real(r8) :: val_output(2) - real(r8) :: expected_lev1, expected_lev2 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_ml_patch_field(name=fieldname, accum_type='timeavg', & - accum_period = accum_period, nlev=2) - values(1,:) = values_lev1 - values(2,:) = values_lev2 - - ! Exercise - call this%update_and_extract_ml_patch_field(fieldname, values, val_output) - - ! Verify - expected_lev1 = sum(values_lev1(4:6))/accum_period - expected_lev2 = sum(values_lev2(4:6))/accum_period - @assertEqual(expected_lev1, val_output(1), tolerance=tol) - @assertEqual(expected_lev2, val_output(2), tolerance=tol) - end subroutine timeavg_multiLevel - - ! ------------------------------------------------------------------------ - ! Tests of runmean - ! ------------------------------------------------------------------------ - - @Test - subroutine runmean_oneStep(this) - ! For runmean, after one time step, value should be equal to the value in that time - ! step. The initial value should be irrelevant. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: my_value = 11._r8 - real(r8) :: val_output - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runmean', & - accum_period = accum_period, init_value = 1000._r8) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, [my_value], val_output) - - ! Verify - @assertEqual(my_value, val_output, tolerance=tol) - end subroutine runmean_oneStep - - @Test - subroutine runmean_beforePeriod(this) - ! Test runmean accumulation before accum_period is reached - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 4 - real(r8), parameter :: values(3) = [11._r8, 22._r8, 43._r8] - real(r8) :: val_output - real(r8) :: expected_ts1, expected_ts2, expected_ts3 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runmean', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected_ts1 = values(1) - expected_ts2 = (expected_ts1 + values(2))/2._r8 - expected_ts3 = (2._r8 * expected_ts2 + values(3)) / 3._r8 - @assertEqual(expected_ts3, val_output, tolerance=tol) - end subroutine runmean_beforePeriod - - @Test - subroutine runmean_afterPeriod(this) - ! Test runmean accumulation after accum_period is reached - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(5) = [11._r8, 22._r8, 43._r8, 110._r8, 17._r8] - real(r8) :: val_output - real(r8) :: expected_ts1, expected_ts2, expected_ts3, expected_ts4, expected_ts5 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runmean', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected_ts1 = values(1) - expected_ts2 = (expected_ts1 + values(2))/2._r8 - expected_ts3 = (2._r8 * expected_ts2 + values(3)) / 3._r8 - expected_ts4 = (2._r8 * expected_ts3 + values(4)) / 3._r8 - expected_ts5 = (2._r8 * expected_ts4 + values(5)) / 3._r8 - @assertEqual(expected_ts5, val_output, tolerance=tol) - end subroutine runmean_afterPeriod - - @Test - subroutine runmean_newlyActive(this) - ! For runmean: If a point recently became active, its running mean should only - ! consider values from when it was active. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(7) = [1._r8, 2._r8, 11._r8, 22._r8, 43._r8, 110._r8, 17._r8] - logical, parameter :: pactive(7) = [.false., .false., .true., .true., .true., .true., .true.] - real(r8) :: val_output - real(r8) :: expected_ts3, expected_ts4, expected_ts5, expected_ts6, expected_ts7 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runmean', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected_ts3 = values(3) - expected_ts4 = (expected_ts3 + values(4))/2._r8 - expected_ts5 = (2._r8 * expected_ts4 + values(5)) / 3._r8 - expected_ts6 = (2._r8 * expected_ts5 + values(6)) / 3._r8 - expected_ts7 = (2._r8 * expected_ts6 + values(7)) / 3._r8 - @assertEqual(expected_ts7, val_output, tolerance=tol) - end subroutine runmean_newlyActive - - @Test - subroutine runmean_activeInactiveActive(this) - ! Test runmean with a point that starts active, becomes inactive, then later becomes - ! active again. Should ignore values in the inactive steps. Also, should continue - ! where it left off - i.e., including the values accumulated when it was first - ! active. This may or may not be the ideal behavior; we can change this if some other - ! behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 - real(r8), parameter :: values(7) = [1._r8, 2._r8, 11._r8, 22._r8, 43._r8, 110._r8, 17._r8] - logical, parameter :: pactive(7) = [.true., .true., .false., .false., .true., .true., .true.] - real(r8) :: val_output - real(r8) :: expected_ts1, expected_ts2, expected_ts5, expected_ts6, expected_ts7 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runmean', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected_ts1 = values(1) - expected_ts2 = (expected_ts1 + values(2))/2._r8 - expected_ts5 = (2._r8 * expected_ts2 + values(5)) / 3._r8 - expected_ts6 = (2._r8 * expected_ts5 + values(6)) / 3._r8 - expected_ts7 = (2._r8 * expected_ts6 + values(7)) / 3._r8 - @assertEqual(expected_ts7, val_output, tolerance=tol) - end subroutine runmean_activeInactiveActive - - ! ------------------------------------------------------------------------ - ! Tests of runaccum - ! ------------------------------------------------------------------------ - - @Test - subroutine runaccum_basic(this) - ! Test basic operation of runaccum field - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 ! irrelevant for this type - real(r8), parameter :: values(4) = [11._r8, 12._r8, 13._r8, 24._r8] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runaccum', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected = sum(values) - @assertEqual(expected, val_output, tolerance=tol) - end subroutine runaccum_basic - - @Test - subroutine runaccum_reset(this) - ! Test resetting of runaccum field - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 ! irrelevant for this type - real(r8), parameter :: values(5) = [11._r8, 12._r8, accumResetVal, 13._r8, 24._r8] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runaccum', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output) - - ! Verify - expected = sum(values(4:5)) - @assertEqual(expected, val_output, tolerance=tol) - end subroutine runaccum_reset - - @Test - subroutine runaccum_newlyActive(this) - ! For runaccum: If a point becomes active between accumulation resets, then it should - ! just give the accumulated amount since it became active. - ! - ! This may or may not be the ideal behavior; we can change this if some other - ! behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 ! irrelevant for this type - real(r8), parameter :: values(5) = [11._r8, accumResetVal, 12._r8, 13._r8, 24._r8] - logical, parameter :: pactive(5) = [.false., .false., .false., .true., .true.] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runaccum', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected = sum(values(4:5)) - @assertEqual(expected, val_output, tolerance=tol) - end subroutine runaccum_newlyActive - - @Test - subroutine runaccum_activeInactiveActive(this) - ! Test runaccum with a point that starts active, becomes inactive, then later becomes - ! active again. - ! - ! Should ignore values and accumResetVal in the inactive steps. - ! - ! Also, should continue where it left off - i.e., including the values accumulated - ! when it was first active. This may or may not be the ideal behavior; we can change - ! this if some other behavior would be better in this situation. - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname = 'foo' - integer, parameter :: accum_period = 3 ! irrelevant for this type - real(r8), parameter :: values(5) = [11._r8, accumResetVal, 12._r8, 17._r8, 24._r8] - logical, parameter :: pactive(5) = [.true., .false., .false., .true., .true.] - real(r8) :: val_output - real(r8) :: expected - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname, accum_type='runaccum', & - accum_period = accum_period) - - ! Exercise - call this%update_and_extract_sl_patch_field(fieldname, values, val_output, pactive=pactive) - - ! Verify - expected = values(1) + values(4) + values(5) - @assertEqual(expected, val_output, tolerance=tol) - end subroutine runaccum_activeInactiveActive - - ! ------------------------------------------------------------------------ - ! Tests of multiple fields - ! ------------------------------------------------------------------------ - - @Test - subroutine multipleFields(this) - class(TestAccumul), intent(inout) :: this - character(len=*), parameter :: fieldname1 = 'foo' - character(len=*), parameter :: fieldname2 = 'bar' - integer, parameter :: accum_period = 2 ! same for both, for simplicity - real(r8), parameter :: values1(2) = [11._r8, 12._r8] - real(r8), parameter :: values2(2) = [111._r8, 112._r8] - integer :: timestep - real(r8) :: val_output1, val_output2 - real(r8) :: expected1, expected2 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%init_sl_patch_field(name=fieldname1, accum_type='timeavg', & - accum_period = accum_period) - call this%init_sl_patch_field(name=fieldname2, accum_type='runaccum', & - accum_period = accum_period) - - ! Exercise - ! - ! In order to possibly catch more bugs, and to more closely replicate the structure of - ! the production code: rather than doing a single update and extract for each field, - ! we first do an update and extract for time1, then do an update and extract for - ! time2. - do timestep = 1, 2 - call this%update_and_extract_sl_patch_field(fieldname1, values1(timestep:timestep), val_output1, & - timestep_start=timestep) - call this%update_and_extract_sl_patch_field(fieldname2, values2(timestep:timestep), val_output2, & - timestep_start=timestep) - end do - - ! Verify - expected1 = sum(values1)/2._r8 - expected2 = sum(values2) - @assertEqual(expected1, val_output1, tolerance=tol) - @assertEqual(expected2, val_output2, tolerance=tol) - end subroutine multipleFields - -end module test_accumul diff --git a/src/main/test/atm2lnd_test/CMakeLists.txt b/src/main/test/atm2lnd_test/CMakeLists.txt deleted file mode 100644 index 018b875a27..0000000000 --- a/src/main/test/atm2lnd_test/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -set(pfunit_sources - test_downscale_forcings.pf - test_partition_precip.pf - test_sens_heat_from_precip_conversion.pf) - -create_pFUnit_test(atm2lnd test_atm2lnd_exe - "${pfunit_sources}" "") - -target_link_libraries(test_atm2lnd_exe clm csm_share esmf_wrf_timemgr) \ No newline at end of file diff --git a/src/main/test/atm2lnd_test/test_downscale_forcings.pf b/src/main/test/atm2lnd_test/test_downscale_forcings.pf deleted file mode 100644 index 4fe5621c7b..0000000000 --- a/src/main/test/atm2lnd_test/test_downscale_forcings.pf +++ /dev/null @@ -1,460 +0,0 @@ -module test_downscale_forcings - - ! Tests of atm2lndMod: downscale_forcings - - use pfunit_mod - use atm2lndMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestArrayMod - use atm2lndType, only : atm2lnd_type, atm2lnd_params_type - use TopoMod, only : topo_type - use decompMod, only : bounds_type - use filterColMod - - implicit none - - type, extends(topo_type) :: topo_type_always_downscale - contains - procedure, public :: DownscaleFilterc - end type topo_type_always_downscale - - @TestCase - type, extends(TestCase) :: TestDownscaleForcings - type(atm2lnd_type) :: atm2lnd_inst - type(topo_type_always_downscale) :: topo_inst - real(r8), allocatable :: eflx_sh_precip_conversion(:) - contains - procedure :: setUp - procedure :: tearDown - procedure :: create_atm2lnd - procedure :: create_topo - procedure :: call_downscale_forcings - end type TestDownscaleForcings - - real(r8), parameter :: lapse_rate = 0.006_r8 - real(r8), parameter :: lapse_rate_longwave = 0.03_r8 - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Methods on topo_type_always_downscale - ! ======================================================================== - - function DownscaleFilterc(this, bounds) result(filter) - ! Override topo_type's DownscaleFilterc - type(filter_col_type) :: filter ! function result - class(topo_type_always_downscale), intent(in) :: this - type(bounds_type), intent(in) :: bounds - - filter = col_filter_from_logical_array(bounds, & - col_array(.true.)) - end function DownscaleFilterc - - ! ======================================================================== - ! Test helper methods - ! ======================================================================== - - subroutine setUp(this) - class(TestDownscaleForcings), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestDownscaleForcings), intent(inout) :: this - - call this%atm2lnd_inst%Clean() - call this%topo_inst%Clean() - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine create_atm2lnd(this, forc_topo, forc_t, forc_th, forc_q, forc_pbot, forc_rho, & - forc_lwrad, forc_rain, forc_snow, glcmec_downscale_longwave, longwave_downscaling_limit) - ! Initializes this%atm2lnd_inst and sets gridcell-level, non-downscaled forcing - ! fields based on inputs. Excluded inputs are given a default value - class(TestDownscaleForcings), intent(inout) :: this - real(r8), intent(in) :: forc_topo(:) - real(r8), intent(in), optional :: forc_t(:) - real(r8), intent(in), optional :: forc_th(:) - real(r8), intent(in), optional :: forc_q(:) - real(r8), intent(in), optional :: forc_pbot(:) - real(r8), intent(in), optional :: forc_rho(:) - real(r8), intent(in), optional :: forc_lwrad(:) - real(r8), intent(in), optional :: forc_rain(:) - real(r8), intent(in), optional :: forc_snow(:) - - ! If not provided, assumed to be true - logical, intent(in), optional :: glcmec_downscale_longwave - - ! If not provided, assumed to be longwave_downscaling_limit_default - real(r8), intent(in), optional :: longwave_downscaling_limit - - real(r8), parameter :: forc_t_default = 301._r8 - real(r8), parameter :: forc_th_default = 302._r8 - real(r8), parameter :: forc_q_default = 0.01_r8 - real(r8), parameter :: forc_pbot_default = 100000._r8 - real(r8), parameter :: forc_rho_default = 1.1_r8 - real(r8), parameter :: forc_lwrad_default = 101._r8 - real(r8), parameter :: forc_rain_default = 21._r8 - real(r8), parameter :: forc_snow_default = 22._r8 - - real(r8), parameter :: longwave_downscaling_limit_default = 1._r8 - - real(r8), parameter :: forc_hgt = 2._r8 - - logical :: l_glcmec_downscale_longwave - real(r8) :: l_longwave_downscaling_limit - type(atm2lnd_params_type) :: atm2lnd_params - - ! ------------------------------------------------------------------------ - - if (present(glcmec_downscale_longwave)) then - l_glcmec_downscale_longwave = glcmec_downscale_longwave - else - l_glcmec_downscale_longwave = .true. - end if - - if (present(longwave_downscaling_limit)) then - l_longwave_downscaling_limit = longwave_downscaling_limit - else - l_longwave_downscaling_limit = longwave_downscaling_limit_default - end if - - atm2lnd_params = atm2lnd_params_type( & - repartition_rain_snow = .false., & - glcmec_downscale_longwave = l_glcmec_downscale_longwave, & - lapse_rate = lapse_rate, & - lapse_rate_longwave = lapse_rate_longwave, & - longwave_downscaling_limit = l_longwave_downscaling_limit) - call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) - this%atm2lnd_inst%forc_topo_grc(bounds%begg:bounds%endg) = forc_topo(:) - - if (present(forc_t)) then - this%atm2lnd_inst%forc_t_not_downscaled_grc(bounds%begg:bounds%endg) = forc_t(:) - else - this%atm2lnd_inst%forc_t_not_downscaled_grc(bounds%begg:bounds%endg) = forc_t_default - end if - - if (present(forc_th)) then - this%atm2lnd_inst%forc_th_not_downscaled_grc(bounds%begg:bounds%endg) = forc_th(:) - else - this%atm2lnd_inst%forc_th_not_downscaled_grc(bounds%begg:bounds%endg) = forc_th_default - end if - - if (present(forc_q)) then - this%atm2lnd_inst%forc_q_not_downscaled_grc(bounds%begg:bounds%endg) = forc_q(:) - else - this%atm2lnd_inst%forc_q_not_downscaled_grc(bounds%begg:bounds%endg) = forc_q_default - end if - - if (present(forc_pbot)) then - this%atm2lnd_inst%forc_pbot_not_downscaled_grc(bounds%begg:bounds%endg) = forc_pbot(:) - else - this%atm2lnd_inst%forc_pbot_not_downscaled_grc(bounds%begg:bounds%endg) = forc_pbot_default - end if - - if (present(forc_rho)) then - this%atm2lnd_inst%forc_rho_not_downscaled_grc(bounds%begg:bounds%endg) = forc_rho(:) - else - this%atm2lnd_inst%forc_rho_not_downscaled_grc(bounds%begg:bounds%endg) = forc_rho_default - end if - - if (present(forc_lwrad)) then - this%atm2lnd_inst%forc_lwrad_not_downscaled_grc(bounds%begg:bounds%endg) = forc_lwrad(:) - else - this%atm2lnd_inst%forc_lwrad_not_downscaled_grc(bounds%begg:bounds%endg) = forc_lwrad_default - end if - - if (present(forc_rain)) then - this%atm2lnd_inst%forc_rain_not_downscaled_grc(bounds%begg:bounds%endg) = forc_rain(:) - else - this%atm2lnd_inst%forc_rain_not_downscaled_grc(bounds%begg:bounds%endg) = forc_rain_default - end if - - if (present(forc_snow)) then - this%atm2lnd_inst%forc_snow_not_downscaled_grc(bounds%begg:bounds%endg) = forc_snow(:) - else - this%atm2lnd_inst%forc_snow_not_downscaled_grc(bounds%begg:bounds%endg) = forc_snow_default - end if - - this%atm2lnd_inst%forc_hgt_grc(bounds%begg:bounds%endg) = forc_hgt - end subroutine create_atm2lnd - - subroutine create_topo(this, topo_col) - ! Initializes this%topo_inst, and sets topo_col - class(TestDownscaleForcings), intent(inout) :: this - real(r8), intent(in) :: topo_col(:) - - call this%topo_inst%Init(bounds) - this%topo_inst%topo_col(bounds%begc:bounds%endc) = topo_col(:) - end subroutine create_topo - - subroutine call_downscale_forcings(this) - ! Wraps the call to downscale_forcings - ! - ! Modifies this%atm2lnd_inst and this%eflx_sh_precip_conversion - class(TestDownscaleForcings), intent(inout) :: this - - this%eflx_sh_precip_conversion = col_array() - call downscale_forcings(bounds, this%topo_inst, this%atm2lnd_inst, & - this%eflx_sh_precip_conversion) - end subroutine call_downscale_forcings - - ! ======================================================================== - ! Begin actual tests - ! ======================================================================== - - ! ------------------------------------------------------------------------ - ! Basic sanity tests - ! ------------------------------------------------------------------------ - - @Test - subroutine topo_greaterThan_atmTopo_gives_colder_forc_t(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: atm_topo = 17._r8 - real(r8), parameter :: forc_t = 301._r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [atm_topo], & - forc_t = [forc_t]) - call this%create_topo(topo_col = [atm_topo + 10._r8]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertGreaterThan(forc_t, this%atm2lnd_inst%forc_t_downscaled_col(begc)) - end subroutine topo_greaterThan_atmTopo_gives_colder_forc_t - - ! ------------------------------------------------------------------------ - ! Tests involving longwave normalization - ! ------------------------------------------------------------------------ - - @Test - subroutine twoTopos_at_atmTopo_give_nearlyIdentical_forc_lwrad(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_lwrad = 101._r8 - - ! Setup - call setup_landunit_ncols(ltype = 1, & - ctypes = [0, 1], cweights = [0.7_r8, 0.3_r8]) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_lwrad = [forc_lwrad]) - call this%create_topo(topo_col = [topo, topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - associate(lwrad_col => this%atm2lnd_inst%forc_lwrad_downscaled_col) - ! We expect a small difference due to normalization, so supply a tolerance - @assertEqual([forc_lwrad, forc_lwrad], lwrad_col(bounds%begc:bounds%endc), tolerance=tol) - end associate - end subroutine twoTopos_at_atmTopo_give_nearlyIdentical_forc_lwrad - - @Test - subroutine lwrad_adjusted_correctly(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: atm_topo = 17._r8 - real(r8), parameter :: topo_diff = 10._r8 - real(r8), parameter :: forc_lwrad = 101._r8 - real(r8) :: expected(3) - - ! Setup - ! The columns of interest are the first and third. However, note that they have 0 - ! weight, in order to avoid needing to take normalization into account. We construct - ! the grid so that the normalization factor will be 1 by putting the 100% area column - ! at the atmosphere's topographic height. - call setup_landunit_ncols(ltype = 1, & - ctypes = [0, 1, 2], cweights = [0.0_r8, 1.0_r8, 0.0_r8]) - call this%create_atm2lnd( & - forc_topo = [atm_topo], & - forc_lwrad = [forc_lwrad]) - call this%create_topo(topo_col = [atm_topo - topo_diff, atm_topo, atm_topo + topo_diff]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - associate(lwrad_col => this%atm2lnd_inst%forc_lwrad_downscaled_col) - expected(1) = forc_lwrad + lapse_rate_longwave * topo_diff - expected(2) = forc_lwrad - expected(3) = forc_lwrad - lapse_rate_longwave * topo_diff - @assertEqual(expected, lwrad_col(bounds%begc:bounds%endc), tolerance=tol) - end associate - end subroutine lwrad_adjusted_correctly - - @Test - subroutine lwrad_downscaling_limited(this) - ! Make sure that the downscaling of lwrad obeys the specified bounds - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: atm_topo = 5000._r8 - real(r8), parameter :: forc_lwrad = 100._r8 - ! Use a very big topo_diff in order to trigger the limit: - real(r8), parameter :: topo_diff = 4000._r8 - real(r8), parameter :: longwave_downscaling_limit = 0.4_r8 - real(r8) :: expected(3) - - ! Setup - ! The columns of interest are the first and third. However, note that they have 0 - ! weight, in order to avoid needing to take normalization into account. We construct - ! the grid so that the normalization factor will be 1 by putting the 100% area column - ! at the atmosphere's topographic height. - call setup_landunit_ncols(ltype = 1, & - ctypes = [0, 1, 2], cweights = [0.0_r8, 1.0_r8, 0.0_r8]) - call this%create_atm2lnd( & - forc_topo = [atm_topo], & - forc_lwrad = [forc_lwrad], & - longwave_downscaling_limit = longwave_downscaling_limit) - call this%create_topo(topo_col = [atm_topo - topo_diff, atm_topo, atm_topo + topo_diff]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - associate(lwrad_col => this%atm2lnd_inst%forc_lwrad_downscaled_col) - expected(1) = forc_lwrad * (1._r8 + longwave_downscaling_limit) - expected(2) = forc_lwrad - expected(3) = forc_lwrad * (1._r8 - longwave_downscaling_limit) - @assertEqual(expected, lwrad_col(bounds%begc:bounds%endc), tolerance=tol) - end associate - end subroutine lwrad_downscaling_limited - - ! ------------------------------------------------------------------------ - ! Tests with topo at atmosphere topo: downscaled forcing should be identical to - ! atmospheric forcing - ! ------------------------------------------------------------------------ - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_t(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_t = 301._r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_t = [forc_t]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_t, this%atm2lnd_inst%forc_t_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_t - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_th(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_th = 302._r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_th = [forc_th]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_th, this%atm2lnd_inst%forc_th_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_th - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_q(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_q = 0.01_r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_q = [forc_q]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_q, this%atm2lnd_inst%forc_q_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_q - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_pbot(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_pbot = 100000._r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_pbot = [forc_pbot]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_pbot, this%atm2lnd_inst%forc_pbot_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_pbot - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_rho(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_rho = 1.1_r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_rho = [forc_rho]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_rho, this%atm2lnd_inst%forc_rho_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_rho - - @Test - subroutine topo_at_atmTopo_gives_identical_forc_lwrad(this) - class(TestDownscaleForcings), intent(inout) :: this - real(r8), parameter :: topo = 17._r8 - real(r8), parameter :: forc_lwrad = 101._r8 - - ! Setup - call setup_single_veg_patch(pft_type=1) - call this%create_atm2lnd( & - forc_topo = [topo], & - forc_lwrad = [forc_lwrad]) - call this%create_topo(topo_col = [topo]) - - ! Exercise - call this%call_downscale_forcings() - - ! Verify - @assertEqual(forc_lwrad, this%atm2lnd_inst%forc_lwrad_downscaled_col(begc)) - - end subroutine topo_at_atmTopo_gives_identical_forc_lwrad - -end module test_downscale_forcings diff --git a/src/main/test/atm2lnd_test/test_partition_precip.pf b/src/main/test/atm2lnd_test/test_partition_precip.pf deleted file mode 100644 index 4e996988d0..0000000000 --- a/src/main/test/atm2lnd_test/test_partition_precip.pf +++ /dev/null @@ -1,271 +0,0 @@ -module test_partition_precip - - ! Tests of atm2lndMod: partition_precip - - use pfunit_mod - use atm2lndMod - use atm2lndType - use shr_kind_mod, only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestArrayMod - use landunit_varcon, only : istice_mec - use clm_varcon, only : hfus ! latent heat of fusion for ice [J/kg] - use clm_varcon, only : denh2o ! density of liquid water [kg/m3] - use shr_const_mod, only : SHR_CONST_TKFRZ - - implicit none - - @TestCase - type, extends(TestCase) :: TestPartitionPrecip - type(atm2lnd_type) :: atm2lnd_inst - real(r8), allocatable :: sh_from_conversion(:) - contains - procedure :: setUp - procedure :: tearDown - procedure :: set_inputs - end type TestPartitionPrecip - - real(r8), parameter :: tol = 1.e-13 - real(r8), parameter :: mm_to_m = 1.e-3_r8 ! multiply by this to convert from mm to m - - ! Temperatures in degrees C - real(r8), parameter :: precip_repartition_glc_all_snow_t = -6._r8 - real(r8), parameter :: precip_repartition_glc_all_rain_t = -2._r8 - real(r8), parameter :: precip_repartition_nonglc_all_snow_t = 0._r8 - real(r8), parameter :: precip_repartition_nonglc_all_rain_t = 2._r8 - -contains - - subroutine setUp(this) - class(TestPartitionPrecip), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestPartitionPrecip), intent(inout) :: this - - call this%atm2lnd_inst%Clean() - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine set_inputs(this, rain, snow, temperature, repartition_rain_snow) - ! set necessary input variables - class(TestPartitionPrecip), intent(inout) :: this - real(r8), intent(in) :: rain(:) - real(r8), intent(in) :: snow(:) - real(r8), intent(in) :: temperature(:) - - ! If not provided, set to true - logical, intent(in), optional :: repartition_rain_snow - - logical :: l_repartition_rain_snow - type(atm2lnd_params_type) :: atm2lnd_params - - if (present(repartition_rain_snow)) then - l_repartition_rain_snow = repartition_rain_snow - else - l_repartition_rain_snow = .true. - end if - - atm2lnd_params = atm2lnd_params_type( & - repartition_rain_snow = l_repartition_rain_snow, & - glcmec_downscale_longwave = .false., & - lapse_rate = 0.01_r8, & ! arbitrary (this is unused for these tests) - precip_repartition_glc_all_snow_t = precip_repartition_glc_all_snow_t, & - precip_repartition_glc_all_rain_t = precip_repartition_glc_all_rain_t, & - precip_repartition_nonglc_all_snow_t = precip_repartition_nonglc_all_snow_t, & - precip_repartition_nonglc_all_rain_t = precip_repartition_nonglc_all_rain_t) - - ! Allocate necessary variables - call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) - this%sh_from_conversion = col_array() - - ! set input variables - this%atm2lnd_inst%forc_rain_not_downscaled_grc(bounds%begg:bounds%endg) = rain(:) - this%atm2lnd_inst%forc_snow_not_downscaled_grc(bounds%begg:bounds%endg) = snow(:) - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = temperature(:) - end subroutine set_inputs - - @Test - subroutine lowTemp_resultsInCorrectPartitioning(this) - class(TestPartitionPrecip), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[270._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(0._r8, rain_col(begc), tolerance=tol) - @assertEqual(3._r8, snow_col(begc), tolerance=tol) - end associate - end subroutine lowTemp_resultsInCorrectPartitioning - - @Test - subroutine highTemp_resultsInCorrectPartitioning(this) - class(TestPartitionPrecip), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[276._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(3._r8, rain_col(begc), tolerance=tol) - @assertEqual(0._r8, snow_col(begc), tolerance=tol) - end associate - end subroutine highTemp_resultsInCorrectPartitioning - - @Test - subroutine intermediateTemp_resultsInCorrectPartitioning(this) - class(TestPartitionPrecip), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[SHR_CONST_TKFRZ + 1.5_r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(3._r8 * 0.75_r8, rain_col(begc), tolerance=tol) - @assertEqual(3._r8 * 0.25_r8, snow_col(begc), tolerance=tol) - end associate - end subroutine intermediateTemp_resultsInCorrectPartitioning - - @Test - subroutine intermediateTemp_glacier_resultsInCorrectPartitioning(this) - class(TestPartitionPrecip), intent(inout) :: this - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype = istice_mec, lweight = 1._r8, & - ctypes = [1], cweights = [1._r8]) - call unittest_subgrid_setup_end() - - ! Choose a temperature 3/4 of the way from all-snow to all-rain - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[SHR_CONST_TKFRZ - 3._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(3._r8 * 0.75_r8, rain_col(begc), tolerance=tol) - @assertEqual(3._r8 * 0.25_r8, snow_col(begc), tolerance=tol) - end associate - end subroutine intermediateTemp_glacier_resultsInCorrectPartitioning - - @Test - subroutine noConversion_resultsInNoHeatFlux(this) - class(TestPartitionPrecip), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[5._r8], snow=[0._r8], temperature=[290._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - @assertEqual([0._r8], this%sh_from_conversion) - end subroutine noConversion_resultsInNoHeatFlux - - @Test - subroutine snowToRain_resultsInCorrectHeatFlux(this) - class(TestPartitionPrecip), intent(inout) :: this - real(r8), parameter :: snow_old = 3._r8 ! [mm] - real(r8) :: expected - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[2._r8], snow=[snow_old], temperature=[290._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - ! Snow to rain extracts energy, so results in a negative heat flux to atm - expected = -1._r8 * snow_old * mm_to_m * denh2o * hfus - @assertEqual([expected], this%sh_from_conversion, tolerance=tol) - end subroutine snowToRain_resultsInCorrectHeatFlux - - @Test - subroutine rainToSnow_resultsInCorrectHeatFlux(this) - class(TestPartitionPrecip), intent(inout) :: this - real(r8), parameter :: rain_old = 2._r8 ! [mm] - real(r8) :: expected - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[rain_old], snow=[3._r8], temperature=[250._r8]) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - ! Rain to snow releases energy, so results in a positive heat flux to atm - expected = rain_old * mm_to_m * denh2o * hfus - @assertEqual([expected], this%sh_from_conversion, tolerance=tol) - end subroutine rainToSnow_resultsInCorrectHeatFlux - - @Test - subroutine repartitionFlagFalse_resultsInNoChange(this) - class(TestPartitionPrecip), intent(inout) :: this - - call setup_single_veg_patch(pft_type=1) - call this%set_inputs(rain=[1._r8], snow=[2._r8], temperature=[250._r8], & - repartition_rain_snow = .false.) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual([1._r8], rain_col) - @assertEqual([2._r8], snow_col) - @assertEqual([0._r8], this%sh_from_conversion) - end associate - end subroutine repartitionFlagFalse_resultsInNoChange - - @Test - subroutine multiPoint_resultsInCorrectPartitioning(this) - class(TestPartitionPrecip), intent(inout) :: this - real(r8), parameter :: rain(2) = [1._r8, 3._r8] - real(r8), parameter :: snow(2) = [2._r8, 4._r8] - real(r8), parameter :: temp(2) = [290._r8, 250._r8] - real(r8), parameter :: rain_expected(2) = [3._r8, 0._r8] - real(r8), parameter :: snow_expected(2) = [0._r8, 7._r8] - - call setup_ncells_single_veg_patch(ncells=2, pft_type=1) - call this%set_inputs(rain=rain, snow=snow, temperature=temp) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - associate(& - rain_col => this%atm2lnd_inst%forc_rain_downscaled_col, & - snow_col => this%atm2lnd_inst%forc_snow_downscaled_col) - @assertEqual(rain_expected, rain_col, tolerance=tol) - @assertEqual(snow_expected, snow_col, tolerance=tol) - end associate - - end subroutine multiPoint_resultsInCorrectPartitioning - - @Test - subroutine multiPoint_resultsInCorrectHeatFlux(this) - class(TestPartitionPrecip), intent(inout) :: this - real(r8), parameter :: rain(2) = [1._r8, 3._r8] - real(r8), parameter :: snow(2) = [2._r8, 4._r8] - real(r8), parameter :: temp(2) = [290._r8, 250._r8] - real(r8) :: sens_heat_expected(2) - - call setup_ncells_single_veg_patch(ncells=2, pft_type=1) - call this%set_inputs(rain=rain, snow=snow, temperature=temp) - - call partition_precip(bounds, this%atm2lnd_inst, this%sh_from_conversion) - - ! grid cell 1: converts snow to rain - sens_heat_expected(1) = -1._r8 * snow(1) * mm_to_m * denh2o * hfus - ! grid cell 2: converts rain to snow - sens_heat_expected(2) = rain(2) * mm_to_m * denh2o * hfus - - @assertEqual(sens_heat_expected, this%sh_from_conversion, tolerance=tol) - - end subroutine multiPoint_resultsInCorrectHeatFlux - -end module test_partition_precip diff --git a/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf b/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf deleted file mode 100644 index 44ca36b9ec..0000000000 --- a/src/main/test/atm2lnd_test/test_sens_heat_from_precip_conversion.pf +++ /dev/null @@ -1,43 +0,0 @@ -module test_sens_heat_from_precip_conversion - - ! Tests of atm2lndMod: sens_heat_from_precip_conversion - ! This module just tests edge cases that would be difficult to test from the - ! multi-point wrapper. - - use pfunit_mod - use atm2lndMod - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varcon, only : hfus ! latent heat of fusion for ice [J/kg] - use clm_varcon, only : denh2o ! density of liquid water [kg/m3] - - implicit none - - real(r8), parameter :: tol = 1.e-13_r8 - real(r8), parameter :: mm_to_m = 1.e-3_r8 ! multiply by this to convert from mm to m - -contains - - @Test - subroutine partialConversion_resultsInCorrectHeatFlux() - real(r8), parameter :: rain_old = 2._r8 ! [mm] - real(r8), parameter :: snow_old = 5._r8 ! [mm] - real(r8), parameter :: rain_new = 6._r8 ! [mm] - real(r8), parameter :: snow_new = 1._r8 ! [mm] - real(r8) :: sens_heat_flux ! [W/m2 to atm] - real(r8) :: expected - - call sens_heat_from_precip_conversion( & - rain_old = rain_old, & - snow_old = snow_old, & - rain_new = rain_new, & - snow_new = snow_new, & - sens_heat_flux = sens_heat_flux) - - ! Snow to rain extracts energy, so results in a negative heat flux to atm - expected = -4._r8 * mm_to_m * denh2o * hfus - @assertEqual(expected, sens_heat_flux, tolerance=tol) - - end subroutine partialConversion_resultsInCorrectHeatFlux - -end module test_sens_heat_from_precip_conversion - diff --git a/src/main/test/clm_glclnd_test/CMakeLists.txt b/src/main/test/clm_glclnd_test/CMakeLists.txt deleted file mode 100644 index f7ac27caf5..0000000000 --- a/src/main/test/clm_glclnd_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(clm_glclnd test_clm_glclnd_exe - "test_clm_glclnd.pf" "") - -target_link_libraries(test_clm_glclnd_exe clm csm_share) \ No newline at end of file diff --git a/src/main/test/clm_glclnd_test/test_clm_glclnd.pf b/src/main/test/clm_glclnd_test/test_clm_glclnd.pf deleted file mode 100644 index 03d60684af..0000000000 --- a/src/main/test/clm_glclnd_test/test_clm_glclnd.pf +++ /dev/null @@ -1,76 +0,0 @@ -module test_clm_glclnd - - ! Tests of clm_glclnd - - use pfunit_mod - use unittestSubgridMod - use shr_kind_mod, only : r8 => shr_kind_r8 - use lnd2glcMod - use landunit_varcon, only : istsoil, istice_mec - - implicit none - save - - real(r8), parameter :: tol = 1.e-14_r8 - -contains - - ! ------------------------------------------------------------------------ - ! Tests of bareland_normalization - ! ------------------------------------------------------------------------ - - @Test - subroutine test_bareland_normalization_glacier100() - ! glacier 100% of grid cell - integer :: c_soil ! column index of soil column - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=0.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - c_soil = ci - call unittest_add_landunit(my_gi=gi, ltype=istice_mec, wtgcell=1.0_r8) - call unittest_subgrid_setup_end() - - @assertEqual(1.0_r8, bareland_normalization(c_soil)) - - call unittest_subgrid_teardown() - end subroutine test_bareland_normalization_glacier100 - - @Test - subroutine test_bareland_normalization_not1() - ! glacier < 100% of grid cell, natural veg < 100% of the remainder - integer :: c_soil ! column index of soil column - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=0.3_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - c_soil = ci - call unittest_add_landunit(my_gi=gi, ltype=istice_mec, wtgcell=0.6_r8) - call unittest_subgrid_setup_end() - - @assertEqual(0.75_r8, bareland_normalization(c_soil), tolerance=tol) - - call unittest_subgrid_teardown() - end subroutine test_bareland_normalization_not1 - - @Test - subroutine test_bareland_normalization_1() - ! glacier < 100% of grid cell, natural veg 100% of the remainder - integer :: c_soil ! column index of soil column - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=0.4_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - c_soil = ci - call unittest_add_landunit(my_gi=gi, ltype=istice_mec, wtgcell=0.6_r8) - call unittest_subgrid_setup_end() - - @assertEqual(1.0_r8, bareland_normalization(c_soil)) - - call unittest_subgrid_teardown() - end subroutine test_bareland_normalization_1 - -end module test_clm_glclnd diff --git a/src/main/test/filter_test/CMakeLists.txt b/src/main/test/filter_test/CMakeLists.txt deleted file mode 100644 index c5cd2b3eb4..0000000000 --- a/src/main/test/filter_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(filter test_filter_exe - "test_filter_col.pf" "") - -target_link_libraries(test_filter_exe clm csm_share) \ No newline at end of file diff --git a/src/main/test/filter_test/test_filter_col.pf b/src/main/test/filter_test/test_filter_col.pf deleted file mode 100644 index 55c11c4fb6..0000000000 --- a/src/main/test/filter_test/test_filter_col.pf +++ /dev/null @@ -1,474 +0,0 @@ -module test_filter_col - - ! Tests of filterColMod - - use pfunit_mod - use filterColMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestArrayMod - use ColumnType, only : col - use landunit_varcon, only : istsoil - - implicit none - - @TestCase - type, extends(TestCase) :: TestFilterCol - contains - procedure :: setUp - procedure :: tearDown - end type TestFilterCol - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestFilterCol), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestFilterCol), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - ! ------------------------------------------------------------------------ - ! Tests of equals method - ! ------------------------------------------------------------------------ - - @Test - subroutine equals_true(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter1, filter2 - - call setup_ncells_single_veg_patch(ncells = 4, pft_type = 1) - filter1 = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+2]) - filter2 = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+2]) - - @assertTrue(filter1 == filter2) - - end subroutine equals_true - - @Test - subroutine equals_different_size(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter1, filter2 - - call setup_ncells_single_veg_patch(ncells = 4, pft_type = 1) - filter1 = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+2]) - filter2 = col_filter_from_index_array(bounds, [bounds%begc]) - - @assertFalse(filter1 == filter2) - - end subroutine equals_different_size - - @Test - subroutine equals_different_points(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter1, filter2 - - call setup_ncells_single_veg_patch(ncells = 4, pft_type = 1) - filter1 = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+2]) - filter2 = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+1]) - - @assertFalse(filter1 == filter2) - end subroutine equals_different_points - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_logical_array - ! ------------------------------------------------------------------------ - - @Test - subroutine logicalArray_true(this) - ! Test col_filter_from_logical_array with logical true - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - logical, parameter :: logical_col(1) = [.true.] - - call setup_single_veg_patch(pft_type = 1) - expected = col_filter_from_index_array(bounds, [ci]) - - filter = col_filter_from_logical_array(bounds, logical_col) - - @assertTrue(filter == expected) - end subroutine logicalArray_true - - @Test - subroutine logicalArray_false(this) - ! Test col_filter_from_logical_array with logical false - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - logical, parameter :: logical_col(1) = [.false.] - - call setup_single_veg_patch(pft_type = 1) - expected = col_filter_empty(bounds) - - filter = col_filter_from_logical_array(bounds, logical_col) - - @assertTrue(filter == expected) - end subroutine logicalArray_false - - @Test - subroutine logicalArray_includes_inactive(this) - ! Test col_filter_from_logical_array with an inactive point: this function should - ! ignore the 'active' status of each column - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - logical, parameter :: logical_col(1) = [.true.] - - call setup_single_veg_patch(pft_type = 1) - expected = col_filter_from_index_array(bounds, [ci]) - col%active(ci) = .false. - - filter = col_filter_from_logical_array(bounds, logical_col) - - @assertTrue(filter == expected) - end subroutine logicalArray_includes_inactive - - @Test - subroutine logicalArray_multiple_points(this) - ! Test col_filter_from_logical_array with multiple points, some in and some out of - ! the filter - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - logical, parameter :: logical_col(4) = [.true., .false., .true., .false.] - - call setup_ncells_single_veg_patch(ncells = 4, pft_type = 1) - expected = col_filter_from_index_array(bounds, [bounds%begc, bounds%begc+2]) - - filter = col_filter_from_logical_array(bounds, logical_col) - - @assertTrue(filter == expected) - end subroutine logicalArray_multiple_points - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_logical_array_active_only - ! ------------------------------------------------------------------------ - - @Test - subroutine logicalArrayActiveOnly_multiple_points(this) - ! Test col_filter_from_logical_array_active_only with multiple points, some in and - ! some out of the filter (either because the logical array is false or because - ! 'active' is false - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - logical, parameter :: logical_col(3) = [.true., .true., .false.] - logical, parameter :: active_col(3) = [.false., .true., .true.] - - call setup_ncells_single_veg_patch(ncells = 3, pft_type = 1) - col%active(bounds%begc:bounds%endc) = active_col(:) - expected = col_filter_from_index_array(bounds, [bounds%begc+1]) - - filter = col_filter_from_logical_array_active_only(bounds, logical_col) - - @assertTrue(filter == expected) - end subroutine logicalArrayActiveOnly_multiple_points - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_ltypes - ! ------------------------------------------------------------------------ - - @Test - subroutine ltypes_multipleTargetLandunits(this) - ! Tests col_filter_from_ltypes with multiple target landunits and multiple landunits - ! present on a gridcell - some of which are in the list of target landunits and some - ! of which are not. - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - integer, allocatable :: expected_indices(:) - integer, parameter :: target_ltype1 = 2 - integer, parameter :: target_ltype2 = 3 - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call my_add_landunit(target_ltype1 - 1) - call my_add_landunit(target_ltype1) - expected_indices = [ci - 1, ci] - call my_add_landunit(target_ltype2) - expected_indices = [expected_indices, ci - 1, ci] - call my_add_landunit(target_ltype2 + 1) - call unittest_subgrid_setup_end() - expected = col_filter_from_index_array(bounds, expected_indices) - - filter = col_filter_from_ltypes(bounds = bounds, & - ltypes = [target_ltype1, target_ltype2], & - include_inactive = .false.) - - @assertTrue(filter == expected) - - contains - subroutine my_add_landunit(ltype) - integer, intent(in) :: ltype - - call create_landunit_ncols(ltype = ltype, lweight = 0.25_r8, & - ctypes = [1, 2], cweights = [0.5_r8, 0.5_r8]) - end subroutine my_add_landunit - - end subroutine ltypes_multipleTargetLandunits - - @Test - subroutine ltypes_excludes_inactive(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call setup_single_veg_patch(pft_type = 1) - col%active(bounds%begc) = .false. - expected = col_filter_empty(bounds) - - filter = col_filter_from_ltypes(bounds = bounds, & - ltypes = [istsoil], & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine ltypes_excludes_inactive - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_lunflags - ! ------------------------------------------------------------------------ - - @Test - subroutine lunflags_multipleLandunits(this) - ! Multiple landunits, with two columns on each: some landunits have flag true, some - ! have flag false - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - integer, allocatable :: expected_indices(:) - logical :: lunflags(3) - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype = 1, lweight = 0.25_r8, & - ctypes = [1, 2], cweights = [0.5_8, 0.5_r8]) - call create_landunit_ncols(ltype = 2, lweight = 0.25_r8, & - ctypes = [1, 2], cweights = [0.5_8, 0.5_r8]) - call create_landunit_ncols(ltype = 3, lweight = 0.5_r8, & - ctypes = [1, 2], cweights = [0.5_8, 0.5_r8]) - call unittest_subgrid_setup_end() - - lunflags = [.false., .true., .false.] - expected_indices = [begc + 2, begc + 3] - expected = col_filter_from_index_array(bounds, expected_indices) - - filter = col_filter_from_lunflags(bounds = bounds, & - lunflags = lunflags, & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine lunflags_multipleLandunits - - @Test - subroutine lunflags_excludes_inactive(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call setup_single_veg_patch(pft_type = 1) - col%active(bounds%begc) = .false. - expected = col_filter_empty(bounds) - - filter = col_filter_from_lunflags(bounds = bounds, & - lunflags = [.true.], & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine lunflags_excludes_inactive - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_grcflags_ltypes - ! ------------------------------------------------------------------------ - - @Test - subroutine grcflagsLtypes_includes_point(this) - ! Basic test of col_filter_from_grcflags_ltypes, with an included point - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call setup_single_veg_patch(pft_type = 1) - expected = col_filter_from_index_array(bounds, [bounds%begc]) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grc_array(.true.), ltypes = [istsoil], & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine grcflagsLtypes_includes_point - - @Test - subroutine grcflagsLtypes_excludes_inactive(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call setup_single_veg_patch(pft_type = 1) - col%active(bounds%begc) = .false. - expected = col_filter_empty(bounds) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grc_array(.true.), ltypes = [istsoil], & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine grcflagsLtypes_excludes_inactive - - @Test - subroutine grcflagsLtypes_includeInactive_includes_inactive(this) - class(TestFilterCol), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call setup_single_veg_patch(pft_type = 1) - col%active(bounds%begc) = .false. - expected = col_filter_from_index_array(bounds, [bounds%begc]) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grc_array(.true.), ltypes = [istsoil], & - include_inactive = .true.) - - @assertTrue(filter == expected) - end subroutine grcflagsLtypes_includeInactive_includes_inactive - - - @Test - subroutine grcflagsLtypes_multipleGridcells(this) - ! Test col_filter_from_grcflags_ltypes with multiple grid cells, some with flag true - ! and some with flag false - class(TestFilterCol), intent(inout) :: this - integer, parameter :: target_ltype = 3 - logical, parameter :: grcflags(3) = [.false., .true., .false.] - integer, allocatable :: expected_indices(:) - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call unittest_subgrid_setup_start() - call my_add_gridcell() - call my_add_gridcell() - expected_indices = [ci - 1, ci] - call my_add_gridcell() - call unittest_subgrid_setup_end() - expected = col_filter_from_index_array(bounds, expected_indices) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grcflags, ltypes = [target_ltype], & - include_inactive = .false.) - - @assertTrue(filter == expected) - contains - subroutine my_add_gridcell - call unittest_add_gridcell() - call create_landunit_ncols(ltype = target_ltype, lweight = 1._r8, & - ctypes = [1, 2], cweights = [0.5_r8, 0.5_r8]) - end subroutine my_add_gridcell - - end subroutine grcflagsLtypes_multipleGridcells - - @Test - subroutine grcflagsLtypes_multipleLandunits(this) - ! Test col_filter_from_grcflags_ltypes with multiple landunits, some in the landunit - ! type array and some not - class(TestFilterCol), intent(inout) :: this - integer, parameter :: target_ltype1 = 2 - integer, parameter :: target_ltype2 = 3 - logical, parameter :: grcflags(1) = [.true.] - integer, allocatable :: expected_indices(:) - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call my_add_landunit(target_ltype1 - 1) - call my_add_landunit(target_ltype1) - expected_indices = [ci - 1, ci] - call my_add_landunit(target_ltype2) - expected_indices = [expected_indices, ci - 1, ci] - call my_add_landunit(target_ltype2 + 1) - call unittest_subgrid_setup_end() - expected = col_filter_from_index_array(bounds, expected_indices) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grcflags, ltypes = [target_ltype1, target_ltype2], & - include_inactive = .false.) - - @assertTrue(filter == expected) - - contains - subroutine my_add_landunit(ltype) - integer, intent(in) :: ltype - - call create_landunit_ncols(ltype = ltype, lweight = 0.25_r8, & - ctypes = [1, 2], cweights = [0.5_r8, 0.5_r8]) - end subroutine my_add_landunit - - end subroutine grcflagsLtypes_multipleLandunits - - @Test - subroutine grcflagsLtypes_ltypeNotPresent(this) - ! Test col_filter_from_grcflags_ltypes with a landunit type not present. It should - ! skip over that absent landunit type, but still include the present landunit type - ! that comes later. - class(TestFilterCol), intent(inout) :: this - integer, parameter :: target_ltype_not_present = 1 - integer, parameter :: target_ltype_present = 2 - logical, parameter :: grcflags(1) = [.true.] - integer, allocatable :: expected_indices(:) - type(filter_col_type) :: filter - type(filter_col_type) :: expected - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype = target_ltype_present, lweight = 1._r8, & - ctypes = [1, 2], cweights = [0.5_r8, 0.5_r8]) - expected_indices = [ci - 1, ci] - call unittest_subgrid_setup_end() - expected = col_filter_from_index_array(bounds, expected_indices) - - filter = col_filter_from_grcflags_ltypes(bounds = bounds, & - grcflags = grcflags, ltypes = [target_ltype_not_present, target_ltype_present], & - include_inactive = .false.) - - @assertTrue(filter == expected) - end subroutine grcflagsLtypes_ltypeNotPresent - - ! ------------------------------------------------------------------------ - ! Tests of col_filter_from_filter_and_logical_array - ! ------------------------------------------------------------------------ - - @Test - subroutine filterAndLogicalArray_multiple_points(this) - ! Test col_filter_from_filter_and_logical_array with multiple points, with various - ! combinations of inside and outside the filter, and inside and outside the logical - ! array - class(TestFilterCol), intent(inout) :: this - - ! Final filter should be set where both of the following are true: - logical, parameter :: logical_orig(6) = [.false., .true., .false., .true., .false., .true.] - logical, parameter :: logical_new (6) = [.false., .false., .false., .true., .true., .true.] - - type(filter_col_type) :: filter_orig - type(filter_col_type) :: filter_new - type(filter_col_type) :: expected - - call setup_ncells_single_veg_patch(ncells = 6, pft_type = 1) - filter_orig = col_filter_from_logical_array(bounds, logical_orig) - expected = col_filter_from_index_array(bounds, [bounds%begc+3, bounds%begc+5]) - - filter_new = col_filter_from_filter_and_logical_array(& - bounds = bounds, & - num_orig = filter_orig%num, & - filter_orig = filter_orig%indices, & - logical_col = logical_new) - - @assertTrue(filter_new == expected) - end subroutine filterAndLogicalArray_multiple_points - -end module test_filter_col diff --git a/src/main/test/glcBehavior_test/CMakeLists.txt b/src/main/test/glcBehavior_test/CMakeLists.txt deleted file mode 100644 index caf52f4439..0000000000 --- a/src/main/test/glcBehavior_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(glcBehavior test_glcBehavior_exe - "test_glcBehavior.pf" "") - -target_link_libraries(test_glcBehavior_exe clm csm_share) \ No newline at end of file diff --git a/src/main/test/glcBehavior_test/test_glcBehavior.pf b/src/main/test/glcBehavior_test/test_glcBehavior.pf deleted file mode 100644 index 90f12013a9..0000000000 --- a/src/main/test/glcBehavior_test/test_glcBehavior.pf +++ /dev/null @@ -1,318 +0,0 @@ -module test_glcBehavior - - ! Tests of glcBehaviorMod - - use pfunit_mod - use glcBehaviorMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestArrayMod - use column_varcon, only : col_itype_to_icemec_class, icemec_class_to_col_itype - use landunit_varcon, only : istice_mec - use glcBehaviorMod, only : glc_behavior_type - use ColumnType, only : col - use unittestGlcMec - - implicit none - - @TestCase - type, extends(TestCase) :: TestGlcBehavior - contains - procedure :: setUp - procedure :: tearDown - end type TestGlcBehavior - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - subroutine setUp(this) - class(TestGlcBehavior), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestGlcBehavior), intent(inout) :: this - - call unittest_subgrid_teardown() - call teardown_elevation_classes() - end subroutine tearDown - - function create_glc_behavior_all_collapse() result(glc_behavior) - ! Create a glc_behavior object where all grid cells get collapsed to a single column - type(glc_behavior_type) :: glc_behavior - - call glc_behavior%InitSetDirectly(bounds%begg, bounds%endg, & - has_virtual_columns = grc_array(.false.), & - collapse_to_atm_topo = grc_array(.true.)) - end function create_glc_behavior_all_collapse - - ! ------------------------------------------------------------------------ - ! Tests of setup / initialization - ! ------------------------------------------------------------------------ - - @Test - subroutine init_multiple_behaviorIsCorrect(this) - ! Make sure behavior is correct for 'multiple' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['multiple'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertFalse(glc_behavior%has_virtual_columns_grc(bounds%begg)) - @assertFalse(glc_behavior%get_collapse_to_atm_topo(bounds%begg)) - @assertTrue(glc_behavior%allow_multiple_columns_grc(bounds%begg)) - end subroutine init_multiple_behaviorIsCorrect - - @Test - subroutine init_virtual_behaviorIsCorrect(this) - ! Make sure behavior is correct for 'virtual' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['virtual'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertTrue(glc_behavior%has_virtual_columns_grc(bounds%begg)) - @assertFalse(glc_behavior%get_collapse_to_atm_topo(bounds%begg)) - @assertTrue(glc_behavior%allow_multiple_columns_grc(bounds%begg)) - end subroutine init_virtual_behaviorIsCorrect - - @Test - subroutine init_single_behaviorIsCorrect(this) - ! Make sure behavior is correct for 'single_at_atm_topo' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertFalse(glc_behavior%has_virtual_columns_grc(bounds%begg)) - @assertTrue(glc_behavior%get_collapse_to_atm_topo(bounds%begg)) - @assertFalse(glc_behavior%allow_multiple_columns_grc(bounds%begg)) - end subroutine init_single_behaviorIsCorrect - - @Test - subroutine init_replaced_behaviorIsCorrect(this) - ! Make sure melt behavior is correct for 'replaced_by_ice' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertTrue(glc_behavior%melt_replaced_by_ice_grc(bounds%begg)) - end subroutine init_replaced_behaviorIsCorrect - - @Test - subroutine init_remains_behaviorIsCorrect(this) - ! Make sure melt behavior is correct for 'remains_in_place' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['remains_in_place'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertFalse(glc_behavior%melt_replaced_by_ice_grc(bounds%begg)) - end subroutine init_remains_behaviorIsCorrect - - @Test - subroutine init_remainsIce_behaviorIsCorrect(this) - ! Make sure ice runoff behavior is correct for 'remains_ice' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice']) - - @assertFalse(glc_behavior%ice_runoff_melted_grc(bounds%begg)) - end subroutine init_remainsIce_behaviorIsCorrect - - @Test - subroutine init_melted_behaviorIsCorrect(this) - ! Make sure ice runoff behavior is correct for 'melted' - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_single_veg_patch(0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0], & - glacier_region_behavior_str = ['single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['replaced_by_ice'], & - glacier_region_ice_runoff_behavior_str = ['melted']) - - @assertTrue(glc_behavior%ice_runoff_melted_grc(bounds%begg)) - end subroutine init_melted_behaviorIsCorrect - - @Test - subroutine init_multipleGridCells(this) - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - - call setup_ncells_single_veg_patch(ncells = 3, pft_type = 0) - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0, 1, 0], & - glacier_region_behavior_str = ['multiple', 'virtual '], & - glacier_region_melt_behavior_str = ['replaced_by_ice ', 'remains_in_place'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice', 'melted ']) - - @assertFalse(glc_behavior%has_virtual_columns_grc(bounds%begg)) - @assertTrue(glc_behavior%has_virtual_columns_grc(bounds%begg + 1)) - @assertFalse(glc_behavior%has_virtual_columns_grc(bounds%begg + 2)) - - @assertTrue(glc_behavior%melt_replaced_by_ice_grc(bounds%begg)) - @assertFalse(glc_behavior%melt_replaced_by_ice_grc(bounds%begg + 1)) - @assertTrue(glc_behavior%melt_replaced_by_ice_grc(bounds%begg + 2)) - - @assertFalse(glc_behavior%ice_runoff_melted_grc(bounds%begg)) - @assertTrue(glc_behavior%ice_runoff_melted_grc(bounds%begg + 1)) - @assertFalse(glc_behavior%ice_runoff_melted_grc(bounds%begg + 2)) - end subroutine init_multipleGridCells - - ! ------------------------------------------------------------------------ - ! Tests of update_glc_classes - ! ------------------------------------------------------------------------ - - @Test - subroutine update_glc_classes_basic(this) - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - integer, parameter :: glc_nec = 3 - real(r8), parameter :: topomax(0:glc_nec) = [0._r8, 10._r8, 20._r8, 30._r8] - real(r8), parameter :: new_topo = 15._r8 - integer, parameter :: new_elev_class = 2 - real(r8), allocatable :: topo_col(:) - - call setup_elevation_classes(glc_nec, topomax) - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_collapse() - col%type_is_dynamic(:) = .true. - - topo_col = col_array(new_topo) - call glc_behavior%update_glc_classes(bounds, topo_col) - - @assertEqual(new_elev_class, col_itype_to_icemec_class(col%itype(bounds%begc))) - end subroutine update_glc_classes_basic - - @Test - subroutine update_glc_classes_non_icemec(this) - ! A column that is not ice_mec should remain unchanged - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - real(r8), parameter :: new_topo = 15._r8 - integer :: coltype_orig - real(r8), allocatable :: topo_col(:) - - call setup_elevation_classes(3, [0._r8, 1._r8, 2._r8, 3._r8]) - call setup_single_veg_patch(pft_type=1) - glc_behavior = create_glc_behavior_all_collapse() - coltype_orig = col%itype(bounds%begc) - - topo_col = col_array(new_topo) - call glc_behavior%update_glc_classes(bounds, topo_col) - - @assertEqual(coltype_orig, col%itype(bounds%begc)) - end subroutine update_glc_classes_non_icemec - - @Test - subroutine have_dynamic_type(this) - ! Tests cols_have_dynamic_type_array and patches_have_dynamic_type_array - class(TestGlcBehavior), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - logical, allocatable :: has_dynamic_type_col(:) - logical, allocatable :: has_dynamic_type_patch(:) - logical, allocatable :: has_dynamic_type_col_expected(:) - logical, allocatable :: has_dynamic_type_patch_expected(:) - - ! Setup - - call setup_elevation_classes(3, [0._r8, 1._r8, 2._r8, 3._r8]) - - ! Create 3 grid cells, all with one landunit of type istice_mec. The first and third - ! will have multiple elevation classes; the second will have a single elevation class - ! at the atmosphere's topographic height. All columns have 2 patches (which is not - ! typical for istice_mec, but tests the code better). - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype = istice_mec, lweight = 1._r8, & - ctypes = [icemec_class_to_col_itype(1), icemec_class_to_col_itype(2)], & - cweights = [0.5_r8, 0.5_r8], & - npatches = 2) - call unittest_add_gridcell() - call create_landunit_ncols(ltype = istice_mec, lweight = 1._r8, & - ctypes = [icemec_class_to_col_itype(2)], & - cweights = [1._r8], & - npatches = 2) - call unittest_add_gridcell() - call create_landunit_ncols(ltype = istice_mec, lweight = 1._r8, & - ctypes = [icemec_class_to_col_itype(1), icemec_class_to_col_itype(2)], & - cweights = [0.5_r8, 0.5_r8], & - npatches = 2) - call unittest_subgrid_setup_end() - - call glc_behavior%InitFromInputs(bounds%begg, bounds%endg, & - glacier_region_map = [0, 1, 0], & - glacier_region_behavior_str = ['multiple ', 'single_at_atm_topo'], & - glacier_region_melt_behavior_str = ['remains_in_place', 'remains_in_place'], & - glacier_region_ice_runoff_behavior_str = ['remains_ice', 'remains_ice']) - - ! Exercise - - has_dynamic_type_col = col_array(.false.) - has_dynamic_type_patch = patch_array(.false.) - call glc_behavior%cols_have_dynamic_type_array(bounds%begc, bounds%endc, & - has_dynamic_type_col) - call glc_behavior%patches_have_dynamic_type_array(bounds%begp, bounds%endp, & - has_dynamic_type_patch) - - ! Verify - - has_dynamic_type_col_expected = col_array(.false.) - has_dynamic_type_patch_expected = patch_array(.false.) - has_dynamic_type_col_expected = [ & - .false., .false., & - .true., & - .false., .false.] - has_dynamic_type_patch_expected = [ & - .false., .false., .false., .false., & - .true., .true., & - .false., .false., .false., .false.] - - @assertEqual(logical_array_to_int(has_dynamic_type_col_expected), logical_array_to_int(has_dynamic_type_col)) - @assertEqual(logical_array_to_int(has_dynamic_type_patch_expected), logical_array_to_int(has_dynamic_type_patch)) - end subroutine have_dynamic_type - -end module test_glcBehavior diff --git a/src/main/test/ncdio_utils_test/CMakeLists.txt b/src/main/test/ncdio_utils_test/CMakeLists.txt deleted file mode 100644 index 95ff84ac1c..0000000000 --- a/src/main/test/ncdio_utils_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(ncdio_utils test_ncdio_utils_exe - "test_ncdio_utils.pf" "") - -target_link_libraries(test_ncdio_utils_exe clm csm_share) diff --git a/src/main/test/ncdio_utils_test/test_ncdio_utils.pf b/src/main/test/ncdio_utils_test/test_ncdio_utils.pf deleted file mode 100644 index e8cbeb37db..0000000000 --- a/src/main/test/ncdio_utils_test/test_ncdio_utils.pf +++ /dev/null @@ -1,131 +0,0 @@ -module test_ncdio_utils - - ! Tests of ncdio_utils - - use pfunit_mod - use ncdio_utils - use ncdio_pio ! use the fake version of this module - use shr_kind_mod, only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestNcdioUtils - contains - procedure :: setUp - procedure :: tearDown - end type TestNcdioUtils - -contains - - subroutine setUp(this) - class(TestNcdioUtils), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestNcdioUtils), intent(inout) :: this - end subroutine tearDown - - ! ======================================================================== - ! Test helpers - ! ======================================================================== - - subroutine add_vars_to_file(ncid, varnames) - ! Add one or more variables to the file, with irrelevant data - type(file_desc_t), intent(inout) :: ncid - character(len=*), intent(in) :: varnames(:) - - integer :: n - - do n = 1, size(varnames) - call ncd_set_var(ncid, varnames(n), reshape([1._r8], [1,1]), [1,1]) - end do - end subroutine add_vars_to_file - - ! ------------------------------------------------------------------------ - ! Tests of find_var_on_file - ! ------------------------------------------------------------------------ - - @Test - subroutine test_find_var_on_file_oneElement_found(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - call add_vars_to_file(ncid, ['foo']) - - call find_var_on_file(ncid, 'foo', actual) - - @assertEqual('foo', actual) - end subroutine test_find_var_on_file_oneElement_found - - @Test - subroutine test_find_var_on_file_oneElement_notFound(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - - call find_var_on_file(ncid, 'foo', actual) - - @assertEqual('foo', actual) - end subroutine test_find_var_on_file_oneElement_notFound - - @Test - subroutine test_find_var_on_file_3Elements_first(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - call add_vars_to_file(ncid, ['foo', 'bar', 'baz']) - - call find_var_on_file(ncid, 'foo:bar:baz', actual) - - @assertEqual('foo', actual) - end subroutine test_find_var_on_file_3Elements_first - - @Test - subroutine test_find_var_on_file_3Elements_second(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - call add_vars_to_file(ncid, ['bar', 'baz']) - - call find_var_on_file(ncid, 'foo:bar:baz', actual) - - @assertEqual('bar', actual) - end subroutine test_find_var_on_file_3Elements_second - - @Test - subroutine test_find_var_on_file_3Elements_third(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - call add_vars_to_file(ncid, ['baz']) - - call find_var_on_file(ncid, 'foo:bar:baz', actual) - - @assertEqual('baz', actual) - end subroutine test_find_var_on_file_3Elements_third - - @Test - subroutine test_find_var_on_file_3Elements_noneFound(this) - class(TestNcdioUtils), intent(inout) :: this - character(len=256) :: actual - type(file_desc_t) :: ncid - - ncid = file_desc_t() - - call find_var_on_file(ncid, 'foo:bar:baz', actual) - - @assertEqual('foo', actual) - end subroutine test_find_var_on_file_3Elements_noneFound - -end module test_ncdio_utils diff --git a/src/main/test/subgridWeights_test/CMakeLists.txt b/src/main/test/subgridWeights_test/CMakeLists.txt deleted file mode 100644 index 45b4d53b01..0000000000 --- a/src/main/test/subgridWeights_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(subgridWeights test_subgridWeights_exe - "test_subgridWeights.pf" "") - -target_link_libraries(test_subgridWeights_exe clm csm_share) \ No newline at end of file diff --git a/src/main/test/subgridWeights_test/test_subgridWeights.pf b/src/main/test/subgridWeights_test/test_subgridWeights.pf deleted file mode 100644 index 7d29ef0510..0000000000 --- a/src/main/test/subgridWeights_test/test_subgridWeights.pf +++ /dev/null @@ -1,86 +0,0 @@ -module test_subgridWeights - - ! Tests of subgridWeightsMod - - use pfunit_mod - use unittestSubgridMod - use subgridWeightsMod - use shr_kind_mod, only : r8 => shr_kind_r8 - - implicit none - save - - real(r8), parameter :: tol = 1.e-14_r8 - -contains - - subroutine setup() - call unittest_subgrid_setup_start() - - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=1, wtgcell=0.25_r8) - call unittest_add_landunit(my_gi=gi, ltype=3, wtgcell=0.75_r8) - - call unittest_subgrid_setup_end() - end subroutine setup - - subroutine teardown() - call unittest_subgrid_teardown() - end subroutine teardown - - ! ------------------------------------------------------------------------ - ! Tests of get_landunit_weight - ! ------------------------------------------------------------------------ - - @Test - subroutine test_get_landunit_weight_no_landunit() - ! no landunit of the given type - call setup() - @assertEqual(0._r8, get_landunit_weight(gi, 2)) - call teardown() - end subroutine test_get_landunit_weight_no_landunit - - @Test - subroutine test_get_landunit_weight_normal() - ! normal case, with a landunit of the given type - call setup() - @assertEqual(0.75_r8, get_landunit_weight(gi, 3), tolerance=tol) - call teardown() - end subroutine test_get_landunit_weight_normal - - ! ------------------------------------------------------------------------ - ! Tests of set_landunit_weight - ! ------------------------------------------------------------------------ - - @Test - subroutine test_set_landunit_weight() - call setup() - call set_landunit_weight(gi, 3, 0.42_r8) - @assertEqual(0.42_r8, get_landunit_weight(gi, 3), tolerance=tol) - call teardown() - end subroutine test_set_landunit_weight - - ! ------------------------------------------------------------------------ - ! Tests of is_gcell_all_ltypeX - ! ------------------------------------------------------------------------ - - @Test - subroutine test_is_gcell_all_ltypeX_false() - ! test with no landunit being 100% - call setup() - @assertFalse(is_gcell_all_ltypeX(gi, 3)) - call teardown() - end subroutine test_is_gcell_all_ltypeX_false - - @Test - subroutine test_is_gcell_all_ltypeX_true() - ! test with a landunit being 100% - call setup() - call set_landunit_weight(gi, 1, 0.0_r8) - call set_landunit_weight(gi, 3, 1.0_r8) - @assertFalse(is_gcell_all_ltypeX(gi, 1)) - @assertTrue(is_gcell_all_ltypeX(gi, 3)) - call teardown() - end subroutine test_is_gcell_all_ltypeX_true - -end module test_subgridWeights diff --git a/src/main/test/surfrdUtils_test/CMakeLists.txt b/src/main/test/surfrdUtils_test/CMakeLists.txt deleted file mode 100644 index 4139bf6faa..0000000000 --- a/src/main/test/surfrdUtils_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(surfrdUtils test_surfrdUtils_exe - "test_surfrdUtils.pf" "") - -target_link_libraries(test_surfrdUtils_exe clm csm_share) diff --git a/src/main/test/surfrdUtils_test/test_surfrdUtils.pf b/src/main/test/surfrdUtils_test/test_surfrdUtils.pf deleted file mode 100644 index ba9d5cced1..0000000000 --- a/src/main/test/surfrdUtils_test/test_surfrdUtils.pf +++ /dev/null @@ -1,217 +0,0 @@ -module test_surfrdUtils - - ! Tests of surfrdUtilsMod - - use pfunit_mod - use surfrdUtilsMod - use shr_kind_mod, only : r8 => shr_kind_r8 - - implicit none - save - - real(r8), parameter :: tol = 1.e-14_r8 - -contains - - @Test - subroutine test_convert_cft_to_pft_with_zerocft() - use clm_instur , only : wt_lunit, wt_nat_patch, fert_cft - use pftconMod , only : pftcon, nc3crop, ndllf_evr_tmp_tree, nc3irrig - use pftconMod , only : nbrdlf_evr_shrub, nc4_grass, noveg - use landunit_varcon , only : istsoil, istcrop, max_lunit - use clm_varpar , only : natpft_size, cft_size, numveg - implicit none - integer, parameter :: begg = 2, endg = 3, cftsize = 2 - real(r8) :: wt_cft(begg:endg,cftsize) - real(r8), allocatable :: wtpft(:,:) - - ! Set relevant pftcon values to defaults; these should be overridden by individual - ! tests where they matter - call pftcon%InitForTesting() - wt_cft(begg:,1) = 0.0_r8 - wt_cft(begg:,2) = 0.0_r8 - allocate( wt_lunit(begg:endg,max_lunit) ) - wt_lunit(begg:,:) = 0.00_r8 - wt_lunit(begg:,istsoil) = 100.00_r8 - wt_lunit(begg:,istcrop) = 0.00_r8 - call check_sums_equal_1( (wt_lunit/100.0_r8), begg, "test_check_sums_add_to_1", & - "should not trigger an error") - natpft_size = numveg - cft_size = 0 - noveg = 0 - nc3crop = 15 - nc3irrig = nc3crop + 1 - ndllf_evr_tmp_tree = 1 - nbrdlf_evr_shrub = 9 - nc4_grass = 14 - allocate( wt_nat_patch(begg:endg,0:natpft_size) ) - allocate( wtpft (begg:endg,0:natpft_size) ) - wt_nat_patch(begg:,:) = 0.00_r8 - wt_nat_patch(begg:,noveg) = 5.00_r8 - wt_nat_patch(begg:,ndllf_evr_tmp_tree) = 70.00_r8 - wt_nat_patch(begg:,nbrdlf_evr_shrub) = 20.00_r8 - wt_nat_patch(begg:,nc4_grass) = 5.00_r8 - wtpft = wt_nat_patch/100.0_r8 - call check_sums_equal_1( wtpft, begg, "test_check_sums_add_to_1", & - "should not trigger an error") - wt_nat_patch(begg:,nc3crop:) = -100000.00_r8 ! set crop PFT's to junk, make sure can handle it - ! Convert - call convert_cft_to_pft( begg, endg, cftsize, wt_cft ) - wt_nat_patch(begg:,:) = wt_nat_patch(begg:,:) / 100.00_r8 - wt_lunit(begg:,:) = wt_lunit(begg:,:) / 100.00_r8 - ! Now check that are correct now - call check_sums_equal_1( wt_lunit, begg, "test_check_sums_add_to_1", & - "should not trigger an error") - call check_sums_equal_1( wt_nat_patch, begg, "test_check_sums_add_to_1", & - "should not trigger an error") - @assertEqual(wtpft,wt_nat_patch) - @assertEqual(wt_lunit(begg:,istsoil),(/1.00_r8,1.00_r8/)) - deallocate( wt_nat_patch ) - deallocate( wtpft ) - - call pftcon%clean() - end subroutine test_convert_cft_to_pft_with_zerocft - - @Test - subroutine test_convert_cft_to_pft() - use clm_instur , only : wt_lunit, wt_nat_patch, fert_cft - use pftconMod , only : pftcon, nc3crop, ndllf_evr_tmp_tree, nc3irrig - use landunit_varcon , only : istsoil, istcrop, max_lunit - use clm_varpar , only : natpft_size, cft_size, numveg - - implicit none - integer, parameter :: begg = 2, endg = 3, cftsize = 2 - real(r8) :: wt_cft(begg:endg,cftsize) - - ! Set relevant pftcon values to defaults; these should be overridden by individual - ! tests where they matter - call pftcon%InitForTesting() - wt_cft(begg:,1) = 25.0_r8 - wt_cft(begg:,2) = 75.0_r8 - call check_sums_equal_1( (wt_cft/100.0_r8), begg, "test_check_sums_add_to_1", & - "should not trigger an error") - allocate( wt_lunit(begg:endg,max_lunit) ) - wt_lunit(begg:,:) = 00.00_r8 - wt_lunit(begg:,istsoil) = 25.00_r8 - wt_lunit(begg:,istcrop) = 75.00_r8 - call check_sums_equal_1( (wt_lunit/100.0_r8), begg, "test_check_sums_add_to_1", & - "should not trigger an error") - natpft_size = numveg - cft_size = 0 - nc3crop = 15 - nc3irrig = nc3crop + 1 - ndllf_evr_tmp_tree = 1 - allocate( wt_nat_patch(begg:endg,0:natpft_size) ) - wt_nat_patch(begg:,:) = 0.00_r8 - wt_nat_patch(begg:,ndllf_evr_tmp_tree) = 100.00_r8 - call check_sums_equal_1( (wt_nat_patch/100.0_r8), begg, "test_check_sums_add_to_1", & - "should not trigger an error") - ! Convert - wt_nat_patch(begg:,nc3crop:) = -100000.00_r8 ! set crop PFT's to junk, make sure can handle it - call convert_cft_to_pft( begg, endg, cftsize, wt_cft ) - wt_nat_patch(begg:,:) = wt_nat_patch(begg:,:) / 100.00_r8 - wt_lunit(begg:,:) = wt_lunit(begg:,:) / 100.00_r8 - ! Now check that are correct now - call check_sums_equal_1( wt_lunit, begg, "test_check_sums_add_to_1", & - "should not trigger an error") - call check_sums_equal_1( wt_nat_patch, begg, "test_check_sums_add_to_1", & - "should not trigger an error") - @assertEqual(wt_lunit(begg:,istsoil), (/1.00_r8,1.00_r8/)) - @assertEqual(wt_nat_patch(begg:,ndllf_evr_tmp_tree),(/0.25_r8,0.25_r8/)) - @assertEqual(wt_nat_patch(begg:,nc3crop), (/0.1875_r8,0.1875_r8/)) - @assertEqual(wt_nat_patch(begg:,nc3irrig), (/0.5625_r8,0.5625_r8/)) - - call pftcon%clean() - end subroutine test_convert_cft_to_pft - - @Test - subroutine test_check_sums_add_to_1() - implicit none - integer, parameter :: lb = 10, ub = 12, lb2 = 1, ub2 = 3 - real(r8) :: array(lb:ub,lb2:ub2) - - ! Create an array that sums to one, then copy it twice and - ! make one element off by less than tol and one off by more than tol - ! they should all work this way - array(lb,lb2) = 0.75d00 - array(lb,lb2+1) = 0.20d00 - array(lb,lb2+2) = 0.05d00 - array(lb+1,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) - tol - array(lb+2,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) + tol - call check_sums_equal_1( array, lb, "test_check_sums_add_to_1", & - "should not trigger an error") - end subroutine test_check_sums_add_to_1 - - @Test - subroutine test_check_sums_add_to_1_fail() - implicit none - integer, parameter :: lb = 10, ub = 12, lb2 = 1, ub2 = 3 - real(r8) :: array(lb:ub,lb2:ub2) - real(r8), parameter :: eps = 2.e-13 - integer :: ier - - ! Create an array that sums to one, then copy it twice and - ! then make the last element of the last one off by small - ! value that should trigger an error - array(lb,lb2) = 0.75d00 - array(lb,lb2+1) = 0.20d00 - array(lb,lb2+2) = 0.05d00 - array(lb+1,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) - tol - array(lb+2,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) + eps - call check_sums_equal_1( array, lb, "test_check_sums_add_to_1_fail", & - "should trigger an error", ier) - @assertEqual(ier,-10) - end subroutine test_check_sums_add_to_1_fail - @Test - subroutine test_renormalize - implicit none - integer, parameter :: lb = 10, ub = 12, lb2 = 1, ub2 = 3 - real(r8) :: array(lb:ub,lb2:ub2) - real(r8) :: expected(lb:ub,lb2:ub2) - integer :: ier - - ! Start with an array that sums to 1 within the tolerance - array(lb,lb2) = 0.75d00 - array(lb,lb2+1) = 0.20d00 - array(lb,lb2+2) = 0.05d00 - array(lb+1,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) - tol - array(lb+2,:) = array(lb,:) - array(lb+1,lb2+2) = array(lb+1,lb2+2) + tol - ! Add to the first element of each column a 1 which means the expected - ! result is half of the starting array - array(:,lb2) = array(:,lb2) + 1.0d00 - expected(:,:) = array(:,:) / 2.0d00 - ! Make the normalized result 100, so multiply the expected result by 100 - expected(:,:) = expected(:,:)*100.0d00 - call renormalize(array, lb, 100.0d00) - @assertEqual(array, expected, tolerance=tol) - ! divide by 100 and should add to one - array = array / 100.0d00 - call check_sums_equal_1( array, lb, "test_check_sums_add_to_1", & - "should not trigger an error") - ! Call again returning error code, make sure error code is zero - call check_sums_equal_1( array, lb, "test_check_sums_add_to_1", & - "should not trigger an error", ier) - @assertEqual(ier,0) - end subroutine test_renormalize - - @Test - subroutine test_renormalize_zero - implicit none - integer, parameter :: lb = 10, ub = 12, lb2 = 1, ub2 = 3 - real(r8) :: array(lb:ub,lb2:ub2) - real(r8) :: expected(lb:ub,lb2:ub2) - - ! An array that sums to zero will remain zeroed out - array(:,:) = 0.0d00 - expected(:,:) = array - call renormalize(array, lb, 100.0d00) - @assertEqual(array, expected, tolerance=tol) - end subroutine test_renormalize_zero - -end module test_surfrdUtils diff --git a/src/main/test/topo_test/CMakeLists.txt b/src/main/test/topo_test/CMakeLists.txt deleted file mode 100644 index c01625994a..0000000000 --- a/src/main/test/topo_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(topo test_topo_exe - "test_topo.pf" "") - -target_link_libraries(test_topo_exe clm csm_share) \ No newline at end of file diff --git a/src/main/test/topo_test/test_topo.pf b/src/main/test/topo_test/test_topo.pf deleted file mode 100644 index b89ee72db8..0000000000 --- a/src/main/test/topo_test/test_topo.pf +++ /dev/null @@ -1,389 +0,0 @@ -module test_topo - - ! Tests of TopoMod - - use pfunit_mod - use TopoMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestGlcMec - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestArrayMod - use filterColMod - use clm_instur, only : topo_glc_mec - use clm_varpar, only : maxpatch_glcmec - use clm_varctl, only : glc_do_dynglacier - use landunit_varcon, only : istice_mec - use glc2lndMod, only : glc2lnd_type - use glcBehaviorMod, only : glc_behavior_type - use unittestFilterBuilderMod - use ColumnType, only : col - use column_varcon, only : col_itype_to_icemec_class - use domainMod, only : ldomain - - implicit none - - @TestCase - type, extends(TestCase) :: TestTopo - logical :: topo_glc_mec_allocated = .false. - logical :: glc2lnd_allocated = .false. - logical :: ldomain_frac_allocated = .false. - - ! These are in TestTopo so they can be cleaned - type(glc2lnd_type) :: glc2lnd_inst - type(topo_type) :: topo - contains - procedure :: setUp - procedure :: tearDown - procedure :: setup_glc_mec - procedure :: init_glc2lnd - procedure :: do_UpdateTopo ! wrap the call to this%topo%UpdateTopo - end type TestTopo - - real(r8), parameter :: tol = 1.e-13_r8 - -contains - - ! ======================================================================== - ! Helper routines - ! ======================================================================== - - subroutine setUp(this) - class(TestTopo), intent(inout) :: this - - glc_do_dynglacier = .true. - call this%setup_glc_mec() - end subroutine setUp - - subroutine tearDown(this) - class(TestTopo), intent(inout) :: this - - call unittest_subgrid_teardown() - if (this%ldomain_frac_allocated) then - deallocate(ldomain%frac) - end if - call teardown_elevation_classes() - call this%topo%Clean() - if (this%topo_glc_mec_allocated) then - deallocate(topo_glc_mec) - this%topo_glc_mec_allocated = .false. - end if - if (this%glc2lnd_allocated) then - call this%glc2lnd_inst%Clean() - this%glc2lnd_allocated = .false. - end if - end subroutine tearDown - - subroutine setup_glc_mec(this) - ! Does some initial setup needed to run the tests here with glc_mec. - ! - ! Creates 3 elevation classes, with boundaries every 10 m. - ! - ! Sets topo_glc_mec (which is typically on the surface dataset) such that it is at - ! the midpoint of each elevation class for every gridcell. - class(TestTopo), intent(inout) :: this - - integer, parameter :: glc_nec = 3 - real(r8), parameter :: topomax(0:glc_nec) = [0._r8, 10._r8, 20._r8, 30._r8] - - integer :: ec - real(r8) :: topo_mid - - call setup_elevation_classes(glc_nec, topomax) - - ! Note that we allocate this to be the max possible size - which might exceed actual - ! bounds - because bounds may not be set up at this point - allocate(topo_glc_mec(begg:endg, glc_nec)) - do ec = 1, glc_nec - topo_mid = (topomax(ec - 1) + topomax(ec)) / 2._r8 - topo_glc_mec(:, ec) = topo_mid - end do - - this%topo_glc_mec_allocated = .true. - end subroutine setup_glc_mec - - subroutine init_glc2lnd(this, glc_behavior, topo_grc, icemask_grc) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type), intent(in) :: glc_behavior - real(r8), intent(in) :: topo_grc(:, 0: ) ! [gridcell, elevclass] array of topo values - real(r8), intent(in) :: icemask_grc(:) ! gridcell-level array of icemask values - - call this%glc2lnd_inst%Init(bounds, glc_behavior) - this%glc2lnd_allocated = .true. - call this%glc2lnd_inst%for_test_set_glc2lnd_fields_directly(bounds, & - topo = topo_grc, icemask = icemask_grc) - end subroutine init_glc2lnd - - subroutine do_UpdateTopo(this, glc_behavior, icemask_grc, atm_topo_grc, glc_topo) - ! Wrap the call to this%topo%UpdateTopo - class(TestTopo), intent(inout) :: this - type(glc_behavior_type), intent(in) :: glc_behavior - real(r8), intent(in) :: icemask_grc(:) ! gridcell-level array of icemask values - - ! gridcell-level array of atm_topo values; if not provided, will use default given - ! below - real(r8), intent(in), optional :: atm_topo_grc(:) - - ! topo value applied to ALL indices of glc2lnd_inst%topo_grc; if not provided, will - ! use default given below - real(r8), intent(in), optional :: glc_topo - - ! if atm_topo_grc isn't given, then atm_topo will have this value everywhere - real(r8), parameter :: atm_topo_default = 25._r8 - - ! if glc_topo isn't given, then glc2lnd_inst%topo_grc will have this value everywhere - real(r8), parameter :: glc_topo_default = 17._r8 - - real(r8), allocatable :: glc_topo_grc(:,:) ! [gridcell, elevclass] - - real(r8), allocatable :: atm_topo(:) - type(filter_col_type) :: filter_icemecc - - allocate(ldomain%frac(bounds%begg:bounds%endg)) - this%ldomain_frac_allocated = .true. - ldomain%frac(bounds%begg:bounds%endg) = 1._r8 - - allocate(glc_topo_grc(bounds%begg:bounds%endg, 0:maxpatch_glcmec)) - if (present(glc_topo)) then - glc_topo_grc(:,:) = glc_topo - else - glc_topo_grc(:,:) = glc_topo_default - end if - call this%init_glc2lnd( & - glc_behavior=glc_behavior, & - topo_grc = glc_topo_grc, & - icemask_grc=icemask_grc) - - filter_icemecc = col_filter_from_ltypes(bounds, [istice_mec], include_inactive = .false.) - - if (present(atm_topo_grc)) then - atm_topo = atm_topo_grc - else - atm_topo = grc_array(atm_topo_default) - end if - - call this%topo%UpdateTopo(bounds, filter_icemecc%num, filter_icemecc%indices, & - this%glc2lnd_inst, glc_behavior, atm_topo = atm_topo) - end subroutine do_UpdateTopo - - function create_glc_behavior_all_collapse() result(glc_behavior) - ! Create a glc_behavior object where all grid cells get collapsed to a single column - type(glc_behavior_type) :: glc_behavior - - call glc_behavior%InitSetDirectly(bounds%begg, bounds%endg, & - has_virtual_columns = grc_array(.false.), & - collapse_to_atm_topo = grc_array(.true.)) - - ! It may not be correct to set this to true for ALL columns (e.g., if there are some - ! non-glc_mec columns), but doing so is convenient, and shouldn't cause any problems - ! (though it might prevent some error checking). - col%type_is_dynamic(:) = .true. - end function create_glc_behavior_all_collapse - - function create_glc_behavior_all_multiple() result(glc_behavior) - ! Create a glc_behavior object where all grid cells have behavior 'multiple' - type(glc_behavior_type) :: glc_behavior - - call glc_behavior%InitSetDirectly(bounds%begg, bounds%endg, & - has_virtual_columns = grc_array(.false.), & - collapse_to_atm_topo = grc_array(.false.)) - end function create_glc_behavior_all_multiple - - function create_glc_behavior_all_virtual() result(glc_behavior) - ! Create a glc_behavior object where all grid cells have behavior 'virtual' - type(glc_behavior_type) :: glc_behavior - - call glc_behavior%InitSetDirectly(bounds%begg, bounds%endg, & - has_virtual_columns = grc_array(.true.), & - collapse_to_atm_topo = grc_array(.false.)) - end function create_glc_behavior_all_virtual - - ! ======================================================================== - ! Begin actual tests - ! - ! Note that many of these tests test the combined effect of multiple modules: TopoMod's - ! UpdateTopo plus the various things it calls. (So in that respect, they aren't strict - ! unit tests.) - ! ======================================================================== - - @Test - subroutine downscaleFilter_beforeUpdate_contains_glcmec(this) - class(TestTopo), intent(inout) :: this - type(filter_col_type) :: filter - type(filter_col_type) :: expected_filter - - call setup_single_icemec_column(elev_class = 1) - expected_filter = col_filter_from_index_array(bounds, [bounds%begc]) - - call this%topo%Init(bounds) - filter = this%topo%DownscaleFilterc(bounds) - - @assertTrue(filter == expected_filter) - end subroutine downscaleFilter_beforeUpdate_contains_glcmec - - @Test - subroutine downscaleFilter_afterUpdate_contains_glcmecOutsideIcemask(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - type(filter_col_type) :: filter - type(filter_col_type) :: expected_filter - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_multiple() - expected_filter = col_filter_from_index_array(bounds, [bounds%begc]) - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8)) - filter = this%topo%DownscaleFilterc(bounds) - - @assertTrue(filter == expected_filter) - end subroutine downscaleFilter_afterUpdate_contains_glcmecOutsideIcemask - - @Test - subroutine downscaleFilter_afterUpdate_doesNotContain_singleAtAtmTopo(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - type(filter_col_type) :: filter - type(filter_col_type) :: expected_filter - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_collapse() - expected_filter = col_filter_empty(bounds) - - call this%topo%Init(bounds) - ! Need icemask 0, because we can't have single_at_atm_topo inside the icemask - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8)) - filter = this%topo%DownscaleFilterc(bounds) - - @assertTrue(filter == expected_filter) - end subroutine downscaleFilter_afterUpdate_doesNotContain_singleAtAtmTopo - - @Test - subroutine downscaleFilter_afterUpdate_doesNotContain_vegOutsideIcemask(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - type(filter_col_type) :: filter - type(filter_col_type) :: expected_filter - - call setup_single_veg_patch(pft_type = 1) - ! Use 'virtual' behavior, to make sure that we're not accidentally trying to - ! downscale vegetation over virtual columns. - glc_behavior = create_glc_behavior_all_virtual() - expected_filter = col_filter_empty(bounds) - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8)) - filter = this%topo%DownscaleFilterc(bounds) - - @assertTrue(filter == expected_filter) - end subroutine downscaleFilter_afterUpdate_doesNotContain_vegOutsideIcemask - - @Test - subroutine downscaleFilter_afterUpdate_contains_vegInsideIcemask(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - type(filter_col_type) :: filter - type(filter_col_type) :: expected_filter - - call setup_single_veg_patch(pft_type = 1) - glc_behavior = create_glc_behavior_all_multiple() - expected_filter = col_filter_from_index_array(bounds, [bounds%begc]) - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(1._r8)) - filter = this%topo%DownscaleFilterc(bounds) - - @assertTrue(filter == expected_filter) - end subroutine downscaleFilter_afterUpdate_contains_vegInsideIcemask - - @Test - subroutine topo_noChange_for_glcmecOutsideIcemask(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - real(r8), parameter :: topo_orig = 7._r8 - - ! our column should NOT get set to either of these: - real(r8), parameter :: atm_topo = 23._r8 - real(r8), parameter :: glc_topo = 27._r8 - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_virtual() - topo_glc_mec(:,:) = topo_orig - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8), & - atm_topo_grc = grc_array(atm_topo), & - glc_topo = glc_topo) - - @assertEqual(topo_orig, this%topo%topo_col(bounds%begc)) - end subroutine topo_noChange_for_glcmecOutsideIcemask - - @Test - subroutine topo_changes_for_glcmecInsideIcemask(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - real(r8), parameter :: topo_orig = 7._r8 - real(r8), parameter :: atm_topo = 23._r8 - - ! our column should get set to this: - real(r8), parameter :: glc_topo = 27._r8 - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_virtual() - topo_glc_mec(:,:) = topo_orig - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(1._r8), & - atm_topo_grc = grc_array(atm_topo), & - glc_topo = glc_topo) - - @assertEqual(glc_topo, this%topo%topo_col(bounds%begc)) - end subroutine topo_changes_for_glcmecInsideIcemask - - @Test - subroutine topo_changes_for_singleAtAtmTopo(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - real(r8), parameter :: topo_orig = 7._r8 - real(r8), parameter :: glc_topo = 27._r8 - - ! our column should get set to this: - real(r8), parameter :: atm_topo = 23._r8 - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_collapse() - topo_glc_mec(:,:) = topo_orig - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8), & - atm_topo_grc = grc_array(atm_topo), & - glc_topo = glc_topo) - - @assertEqual(atm_topo, this%topo%topo_col(bounds%begc)) - end subroutine topo_changes_for_singleAtAtmTopo - - @Test - subroutine elevClass_changes_for_singleAtAtmTopo(this) - class(TestTopo), intent(inout) :: this - type(glc_behavior_type) :: glc_behavior - integer :: new_elev_class - real(r8), parameter :: topo_orig = 7._r8 - real(r8), parameter :: glc_topo = 27._r8 - - ! our column should get set to this: - real(r8), parameter :: atm_topo = 23._r8 - - call setup_single_icemec_column(elev_class = 1) - glc_behavior = create_glc_behavior_all_collapse() - topo_glc_mec(:,:) = topo_orig - - call this%topo%Init(bounds) - call this%do_UpdateTopo(glc_behavior, icemask_grc = grc_array(0._r8), & - atm_topo_grc = grc_array(atm_topo), & - glc_topo = glc_topo) - - new_elev_class = col_itype_to_icemec_class(col%itype(bounds%begc)) - @assertEqual(3, new_elev_class) - end subroutine elevClass_changes_for_singleAtAtmTopo - -end module test_topo diff --git a/src/soilbiogeochem/CMakeLists.txt b/src/soilbiogeochem/CMakeLists.txt deleted file mode 100644 index 380582f236..0000000000 --- a/src/soilbiogeochem/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources - SoilBiogeochemStateType.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 deleted file mode 100644 index 5d169527c5..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 +++ /dev/null @@ -1,828 +0,0 @@ -module SoilBiogeochemCarbonFluxType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan - use clm_varpar , only : nlevdecomp_full, nlevgrnd, nlevdecomp, nlevsoi - use clm_varcon , only : spval, ispval, dzsoi_decomp - use landunit_varcon , only : istsoil, istcrop, istdlak - use ch4varcon , only : allowlakeprod - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use ColumnType , only : col - use LandunitType , only : lun - use clm_varctl , only : use_fates - - ! - ! !PUBLIC TYPES: - implicit none - private - ! - type, public :: soilbiogeochem_carbonflux_type - - ! fire fluxes - real(r8), pointer :: somc_fire_col (:) ! (gC/m2/s) carbon emissions due to peat burning - - ! decomposition fluxes - real(r8), pointer :: decomp_cpools_sourcesink_col (:,:,:) ! change in decomposing c pools. Used to update concentrations concurrently with vertical transport (gC/m3/timestep) - real(r8), pointer :: decomp_cascade_hr_vr_col (:,:,:) ! vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - real(r8), pointer :: decomp_cascade_hr_col (:,:) ! vertically-integrated (diagnostic) het. resp. from decomposing C pools (gC/m2/s) - real(r8), pointer :: decomp_cascade_ctransfer_vr_col (:,:,:) ! vertically-resolved C transferred along deomposition cascade (gC/m3/s) - real(r8), pointer :: decomp_cascade_ctransfer_col (:,:) ! vertically-integrated (diagnostic) C transferred along decomposition cascade (gC/m2/s) - real(r8), pointer :: decomp_k_col (:,:,:) ! rate constant for decomposition (1./sec) - real(r8), pointer :: hr_vr_col (:,:) ! (gC/m3/s) total vertically-resolved het. resp. from decomposing C pools - real(r8), pointer :: o_scalar_col (:,:) ! fraction by which decomposition is limited by anoxia - real(r8), pointer :: w_scalar_col (:,:) ! fraction by which decomposition is limited by moisture availability - real(r8), pointer :: t_scalar_col (:,:) ! fraction by which decomposition is limited by temperature - real(r8), pointer :: som_c_leached_col (:) ! (gC/m^2/s) total SOM C loss from vertical transport - real(r8), pointer :: decomp_cpools_leached_col (:,:) ! (gC/m^2/s) C loss from vertical transport from each decomposing C pool - real(r8), pointer :: decomp_cpools_transport_tendency_col (:,:,:) ! (gC/m^3/s) C tendency due to vertical transport in decomposing C pools - - ! nitrif_denitrif - real(r8), pointer :: phr_vr_col (:,:) ! (gC/m3/s) potential hr (not N-limited) - real(r8), pointer :: fphr_col (:,:) ! fraction of potential heterotrophic respiration - - real(r8), pointer :: hr_col (:) ! (gC/m2/s) total heterotrophic respiration - real(r8), pointer :: lithr_col (:) ! (gC/m2/s) litter heterotrophic respiration - real(r8), pointer :: somhr_col (:) ! (gC/m2/s) soil organic matter heterotrophic res - real(r8), pointer :: soilc_change_col (:) ! (gC/m2/s) FUN used soil C - - ! fluxes to receive carbon inputs from FATES - real(r8), pointer :: FATES_c_to_litr_lab_c_col (:,:) ! total labile litter coming from ED. gC/m3/s - real(r8), pointer :: FATES_c_to_litr_cel_c_col (:,:) ! total cellulose litter coming from ED. gC/m3/s - real(r8), pointer :: FATES_c_to_litr_lig_c_col (:,:) ! total lignin litter coming from ED. gC/m3/s - - contains - - procedure , public :: Init - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - procedure , public :: Restart - procedure , public :: SetValues - procedure , public :: Summary - - end type soilbiogeochem_carbonflux_type - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type) - - class(soilbiogeochem_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - - call this%InitAllocate ( bounds) - call this%InitHistory ( bounds, carbon_type ) - call this%InitCold (bounds ) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp,endp - integer :: begc,endc - !------------------------------------------------------------------------ - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - allocate(this%t_scalar_col (begc:endc,1:nlevdecomp_full)); this%t_scalar_col (:,:) =spval - allocate(this%w_scalar_col (begc:endc,1:nlevdecomp_full)); this%w_scalar_col (:,:) =spval - allocate(this%o_scalar_col (begc:endc,1:nlevdecomp_full)); this%o_scalar_col (:,:) =spval - allocate(this%phr_vr_col (begc:endc,1:nlevdecomp_full)); this%phr_vr_col (:,:) =nan - allocate(this%fphr_col (begc:endc,1:nlevgrnd)) ; this%fphr_col (:,:) =nan - allocate(this%som_c_leached_col (begc:endc)) ; this%som_c_leached_col (:) =nan - allocate(this%somc_fire_col (begc:endc)) ; this%somc_fire_col (:) =nan - allocate(this%hr_vr_col (begc:endc,1:nlevdecomp_full)); this%hr_vr_col (:,:) =nan - - allocate(this%decomp_cpools_sourcesink_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%decomp_cpools_sourcesink_col(:,:,:)= nan - - allocate(this%decomp_cascade_hr_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions)) - this%decomp_cascade_hr_vr_col(:,:,:)= spval - - allocate(this%decomp_cascade_hr_col(begc:endc,1:ndecomp_cascade_transitions)) - this%decomp_cascade_hr_col(:,:)= nan - - allocate(this%decomp_cascade_ctransfer_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions)) - this%decomp_cascade_ctransfer_vr_col(:,:,:)= nan - - allocate(this%decomp_cascade_ctransfer_col(begc:endc,1:ndecomp_cascade_transitions)) - this%decomp_cascade_ctransfer_col(:,:)= nan - - allocate(this%decomp_k_col(begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions)) - this%decomp_k_col(:,:,:)= spval - - allocate(this%decomp_cpools_leached_col(begc:endc,1:ndecomp_pools)) - this%decomp_cpools_leached_col(:,:)= nan - - allocate(this%decomp_cpools_transport_tendency_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%decomp_cpools_transport_tendency_col(:,:,:)= nan - - allocate(this%hr_col (begc:endc)) ; this%hr_col (:) = nan - allocate(this%lithr_col (begc:endc)) ; this%lithr_col (:) = nan - allocate(this%somhr_col (begc:endc)) ; this%somhr_col (:) = nan - allocate(this%soilc_change_col (begc:endc)) ; this%soilc_change_col (:) = nan - - if ( use_fates ) then - ! initialize these variables to be zero rather than a bad number since they are not zeroed every timestep (due to a need for them to persist) - - allocate(this%FATES_c_to_litr_lab_c_col(begc:endc,1:nlevdecomp_full)) - this%FATES_c_to_litr_lab_c_col(begc:endc,1:nlevdecomp_full) = 0._r8 - - allocate(this%FATES_c_to_litr_cel_c_col(begc:endc,1:nlevdecomp_full)) - this%FATES_c_to_litr_cel_c_col(begc:endc,1:nlevdecomp_full) = 0._r8 - - allocate(this%FATES_c_to_litr_lig_c_col(begc:endc,1:nlevdecomp_full)) - this%FATES_c_to_litr_lig_c_col(begc:endc,1:nlevdecomp_full) = 0._r8 - - endif - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, carbon_type) - ! - ! !DESCRIPTION: - ! add history fields for all CN variables, always set as default='inactive' - ! - ! !USES: - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : nlevdecomp, nlevdecomp_full - use clm_varctl , only : hist_wrtch4diag - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type ! one of ['c12', c13','c14'] - ! - ! !LOCAL VARIABLES: - integer :: k,l,ii,jj,c - character(8) :: vr_suffix - character(10) :: active - integer :: begp,endp - integer :: begc,endc - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - real(r8), pointer :: data2dptr(:,:) ! temp. pointer for slicing larger arrays - !--------------------------------------------------------------------- - - begp = bounds%begp; endp = bounds%endp - begc = bounds%begc; endc = bounds%endc - - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - !------------------------------- - ! C flux variables - native to column - !------------------------------- - - ! add history fields for all CLAMP CN variables - - if (carbon_type == 'c12') then - - this%hr_col(begc:endc) = spval - call hist_addfld1d (fname='HR', units='gC/m^2/s', & - avgflag='A', long_name='total heterotrophic respiration', & - ptr_col=this%hr_col) - - this%lithr_col(begc:endc) = spval - call hist_addfld1d (fname='LITTERC_HR', units='gC/m^2/s', & - avgflag='A', long_name='litter C heterotrophic respiration', & - ptr_col=this%lithr_col) - - this%somhr_col(begc:endc) = spval - call hist_addfld1d (fname='SOILC_HR', units='gC/m^2/s', & - avgflag='A', long_name='soil C heterotrophic respiration', & - ptr_col=this%somhr_col) - - if (hist_wrtch4diag) then - this%fphr_col(begc:endc,1:nlevgrnd) = spval - call hist_addfld_decomp (fname='FPHR'//trim(vr_suffix), units='unitless', type2d='levdcmp', & - avgflag='A', long_name='fraction of potential HR due to N limitation', & - ptr_col=this%fphr_col) - end if - - this%somc_fire_col(begc:endc) = spval - call hist_addfld1d (fname='SOMC_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='C loss due to peat burning', & - ptr_col=this%somc_fire_col) - - do k = 1, ndecomp_pools - ! decomposition k - data2dptr => this%decomp_k_col(:,:,k) - fieldname = 'K_'//trim(decomp_cascade_con%decomp_pool_name_history(k)) - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' potential loss coefficient' - call hist_addfld_decomp (fname=fieldname, units='1/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - end do - - this%decomp_cascade_hr_col(begc:endc,:) = spval - this%decomp_cascade_hr_vr_col(begc:endc,:,:) = spval - this%decomp_cascade_ctransfer_col(begc:endc,:) = spval - this%decomp_cascade_ctransfer_vr_col(begc:endc,:,:) = spval - do l = 1, ndecomp_cascade_transitions - - ! output the vertically integrated fluxes only as default - !-- HR fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - data1dptr => this%decomp_cascade_hr_col(:,l) - ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file - ii = 0 - do jj = 1, ndecomp_cascade_transitions - if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1 - end do - if ( ii == 1 ) then - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR' - else - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l))) - endif - longname = 'Het. Resp. from '//& - trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l))) - call hist_addfld1d (fname=fieldname, units='gC/m^2/s', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - endif - - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - data1dptr => this%decomp_cascade_ctransfer_col(:,l) - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'C_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'C' - longname = 'decomp. of '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - ' C to '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' C' - call hist_addfld1d (fname=fieldname, units='gC/m^2/s', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - endif - - ! output the vertically resolved fluxes - if ( nlevdecomp_full > 1 ) then - !-- HR fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - data2dptr => this%decomp_cascade_hr_vr_col(:,:,l) - ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file - ii = 0 - do jj = 1, ndecomp_cascade_transitions - if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1 - end do - if ( ii == 1 ) then - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'_HR'//trim(vr_suffix) - else - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'_HR_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))& - //trim(vr_suffix) - endif - longname = 'Het. Resp. from '//& - trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l))) - call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - data2dptr => this%decomp_cascade_ctransfer_vr_col(:,:,l) - fieldname = & - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'C_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))& - //'C'//trim(vr_suffix) - longname = 'decomp. of '//& - trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - ' C to '//& - trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' C' - call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - end if - - end do - - if ( nlevdecomp_full > 1 ) then - data2dptr => this%t_scalar_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='T_SCALAR', units='unitless', type2d='levsoi', & - avgflag='A', long_name='temperature inhibition of decomposition', & - ptr_col=data2dptr) - - data2dptr => this%w_scalar_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='W_SCALAR', units='unitless', type2d='levsoi', & - avgflag='A', long_name='Moisture (dryness) inhibition of decomposition', & - ptr_col=data2dptr) - - data2dptr => this%o_scalar_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='O_SCALAR', units='unitless', type2d='levsoi', & - avgflag='A', long_name='fraction by which decomposition is reduced due to anoxia', & - ptr_col=data2dptr) - end if - - this%som_c_leached_col(begc:endc) = spval - call hist_addfld1d (fname='SOM_C_LEACHED', units='gC/m^2/s', & - avgflag='A', long_name='total flux of C from SOM pools due to leaching', & - ptr_col=this%som_c_leached_col)!, default='inactive') - - this%decomp_cpools_leached_col(begc:endc,:) = spval - this%decomp_cpools_transport_tendency_col(begc:endc,:,:) = spval - do k = 1, ndecomp_pools - if ( .not. decomp_cascade_con%is_cwd(k) ) then - data1dptr => this%decomp_cpools_leached_col(:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TO_LEACHING' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' C leaching loss' - call hist_addfld1d (fname=fieldname, units='gC/m^2/s', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - data2dptr => this%decomp_cpools_transport_tendency_col(:,:,k) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(k))//'C_TNDNCY_VERT_TRANSPORT' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' C tendency due to vertical transport' - call hist_addfld_decomp (fname=fieldname, units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - end do - - if ( nlevdecomp_full > 1 ) then - data2dptr => this%hr_vr_col(begc:endc,1:nlevsoi) - call hist_addfld2d (fname='HR_vr', units='gC/m^3/s', type2d='levsoi', & - avgflag='A', long_name='total vertically resolved heterotrophic respiration', & - ptr_col=data2dptr) - endif - - end if - - !------------------------------- - ! C13 flux variables - native to column - !------------------------------- - - if ( carbon_type == 'c13' ) then - - this%hr_col(begc:endc) = spval - call hist_addfld1d (fname='C13_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total heterotrophic respiration', & - ptr_col=this%hr_col) - - this%lithr_col(begc:endc) = spval - call hist_addfld1d (fname='C13_LITTERC_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall to litter 3 C', & - ptr_col=this%lithr_col) - - this%somhr_col(begc:endc) = spval - call hist_addfld1d (fname='C13_SOILC_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 soil organic matter heterotrophic respiration', & - ptr_col=this%somhr_col) - - - this%decomp_cascade_hr_col(begc:endc,:) = spval - this%decomp_cascade_hr_vr_col(begc:endc,:,:) = spval - this%decomp_cascade_ctransfer_col(begc:endc,:) = spval - this%decomp_cascade_ctransfer_vr_col(begc:endc,:,:) = spval - do l = 1, ndecomp_cascade_transitions - !-- HR fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - data2dptr => this%decomp_cascade_hr_vr_col(:,:,l) - ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file - ii = 0 - do jj = 1, ndecomp_cascade_transitions - if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1 - end do - if ( ii == 1 ) then - fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'_HR'//trim(vr_suffix) - else - fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'_HR_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))//& - trim(vr_suffix) - endif - longname = 'C13 Het. Resp. from '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l))) - call hist_addfld_decomp (fname=fieldname, units='gC13/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - data2dptr => this%decomp_cascade_ctransfer_vr_col(:,:,l) - fieldname = 'C13_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'C_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))& - //'C'//trim(vr_suffix) - longname = 'C13 decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))& - //' C to '//& - trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' C' - call hist_addfld_decomp (fname=fieldname, units='gC13/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - end do - - end if - - !------------------------------- - ! C14 flux variables - native to column - !------------------------------- - - if (carbon_type == 'c14') then - - this%hr_col(begc:endc) = spval - call hist_addfld1d (fname='C14_HR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 total heterotrophic respiration', & - ptr_col=this%hr_col) - - this%lithr_col(begc:endc) = spval - call hist_addfld1d (fname='C14_LITTERC_HR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 litter carbon heterotrophic respiration', & - ptr_col=this%lithr_col) - - this%somhr_col(begc:endc) = spval - call hist_addfld1d (fname='C14_SOILC_HR', units='gC14/m^2/s', & - avgflag='A', long_name='C14 soil organic matter heterotrophic respiration', & - ptr_col=this%somhr_col) - - this%decomp_cascade_hr_col(begc:endc,:) = spval - this%decomp_cascade_hr_vr_col(begc:endc,:,:) = spval - this%decomp_cascade_ctransfer_col(begc:endc,:) = spval - this%decomp_cascade_ctransfer_vr_col(begc:endc,:,:) = spval - - do l = 1, ndecomp_cascade_transitions - !-- HR fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - data2dptr => this%decomp_cascade_hr_vr_col(:,:,l) - - ! check to see if there are multiple pathways that include respiration, and if so, note that in the history file - ii = 0 - do jj = 1, ndecomp_cascade_transitions - if ( decomp_cascade_con%cascade_donor_pool(jj) == decomp_cascade_con%cascade_donor_pool(l) ) ii = ii+1 - end do - if ( ii == 1 ) then - fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'_HR'//trim(vr_suffix) - else - fieldname = 'C14_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'_HR_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_receiver_pool(l)))& - //trim(vr_suffix) - endif - longname = 'C14 Het. Resp. from '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l))) - call hist_addfld_decomp (fname=fieldname, units='gC14/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - data2dptr => this%decomp_cascade_ctransfer_vr_col(:,:,l) - - fieldname = 'C14_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'C_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))& - //'C'//trim(vr_suffix) - longname = 'C14 decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - ' C to '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' C' - call hist_addfld_decomp (fname=fieldname, units='gC14/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - end do - - end if - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - this%fphr_col(c,nlevdecomp+1:nlevgrnd) = 0._r8 !used to be in ch4Mod - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%fphr_col(c,nlevdecomp+1:nlevgrnd) = 0._r8 - else if (lun%itype(l) == istdlak .and. allowlakeprod) then - this%fphr_col(c,:) = spval - else ! Inactive CH4 columns - this%fphr_col(c,:) = spval - end if - - end do - - if ( use_fates ) then - - call hist_addfld_decomp(fname='FATES_c_to_litr_lab_c', units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='litter labile carbon flux from FATES to BGC', & - ptr_col=this%FATES_c_to_litr_lab_c_col) - - call hist_addfld_decomp(fname='FATES_c_to_litr_cel_c', units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='litter celluluse carbon flux from FATES to BGC', & - ptr_col=this%FATES_c_to_litr_cel_c_col) - - call hist_addfld_decomp(fname='FATES_c_to_litr_lig_c', units='gC/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='litter lignin carbon flux from FATES to BGC', & - ptr_col=this%FATES_c_to_litr_lig_c_col) - - endif - - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,l - integer :: num_special_col ! number of good values in special_col filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - !----------------------------------------------------------------------- - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - ! initialize fields for special filters - - call this%SetValues (num_column=num_special_col, filter_column=special_col, & - value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use restUtilMod - use ncdio_pio - use clm_varctl, only : use_vertsoilc - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read', 'write', 'define' - ! - ! local vars - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - logical :: readvar - !----------------------------------------------------------------------- - - ! - ! if FATES is enabled, need to restart the variables used to transfer from FATES to CLM as they - ! are persistent between daily FATES dynamics calls and half-hourly CLM timesteps - ! - if ( use_fates ) then - - if (use_vertsoilc) then - ptr2d => this%FATES_c_to_litr_lab_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lab_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - - ptr2d => this%FATES_c_to_litr_cel_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_cel_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - - ptr2d => this%FATES_c_to_litr_lig_c_col - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lig_c_col', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - - else - ptr1d => this%FATES_c_to_litr_lab_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lab_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - ptr1d => this%FATES_c_to_litr_cel_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_cel_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - ptr1d => this%FATES_c_to_litr_lig_c_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='FATES_c_to_litr_lig_c_col', xtype=ncd_double, & - dim1name='column', long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - - end if - - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set carbon fluxes - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonflux_type) :: this - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i ! loop index - integer :: j,k,l ! indices - !------------------------------------------------------------------------ - - do l = 1, ndecomp_cascade_transitions - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cascade_hr_col(i,l) = value_column - this%decomp_cascade_hr_vr_col(i,j,l) = value_column - this%decomp_cascade_ctransfer_col(i,l) = value_column - this%decomp_cascade_ctransfer_vr_col(i,j,l) = value_column - this%decomp_k_col(i,j,l) = value_column - end do - end do - end do - - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cpools_leached_col(i,k) = value_column - end do - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cpools_transport_tendency_col(i,j,k) = value_column - this%decomp_cpools_sourcesink_col(i,j,k) = value_column - end do - end do - end do - - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%hr_vr_col(i,j) = value_column - end do - end do - - do fi = 1,num_column - i = filter_column(fi) - this%hr_col(i) = value_column - this%somc_fire_col(i) = value_column - this%som_c_leached_col(i) = value_column - this%somhr_col(i) = value_column - this%lithr_col(i) = value_column - this%soilc_change_col(i) = value_column - end do - - ! NOTE: do not zero the fates to BGC C flux variables since they need to persist from the daily fates timestep s to the half-hourly BGC timesteps. I.e. FATES_c_to_litr_lab_c_col, FATES_c_to_litr_cel_c_col, FATES_c_to_litr_lig_c_col - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine Summary(this, bounds, num_soilc, filter_soilc) - ! - ! !DESCRIPTION: - ! On the radiation time step, column-level carbon summary calculations - ! - ! !USES: - ! !ARGUMENTS: - class(soilbiogeochem_carbonflux_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l - integer :: fc - !----------------------------------------------------------------------- - - do fc = 1,num_soilc - c = filter_soilc(fc) - this%som_c_leached_col(c) = 0._r8 - end do - - ! vertically integrate HR and decomposition cascade fluxes - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%decomp_cascade_hr_col(c,k) = & - this%decomp_cascade_hr_col(c,k) + & - this%decomp_cascade_hr_vr_col(c,j,k) * dzsoi_decomp(j) - - this%decomp_cascade_ctransfer_col(c,k) = & - this%decomp_cascade_ctransfer_col(c,k) + & - this%decomp_cascade_ctransfer_vr_col(c,j,k) * dzsoi_decomp(j) - end do - end do - end do - - ! total heterotrophic respiration, vertically resolved (HR) - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%hr_vr_col(c,j) = 0._r8 - end do - end do - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%hr_vr_col(c,j) = & - this%hr_vr_col(c,j) + & - this%decomp_cascade_hr_vr_col(c,j,k) - end do - end do - end do - - ! add up all vertical transport tendency terms and calculate total som leaching loss as the sum of these - do l = 1, ndecomp_pools - do fc = 1,num_soilc - c = filter_soilc(fc) - this%decomp_cpools_leached_col(c,l) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%decomp_cpools_leached_col(c,l) = this%decomp_cpools_leached_col(c,l) + & - this%decomp_cpools_transport_tendency_col(c,j,l) * dzsoi_decomp(j) - end do - end do - do fc = 1,num_soilc - c = filter_soilc(fc) - this%som_c_leached_col(c) = this%som_c_leached_col(c) + this%decomp_cpools_leached_col(c,l) - end do - end do - - ! soil organic matter heterotrophic respiration - associate(is_soil => decomp_cascade_con%is_soil) ! TRUE => pool is a soil pool - do k = 1, ndecomp_cascade_transitions - if ( is_soil(decomp_cascade_con%cascade_donor_pool(k)) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%somhr_col(c) = this%somhr_col(c) + this%decomp_cascade_hr_col(c,k) - end do - end if - end do - end associate - - ! litter heterotrophic respiration (LITHR) - associate(is_litter => decomp_cascade_con%is_litter) ! TRUE => pool is a litter pool - do k = 1, ndecomp_cascade_transitions - if ( is_litter(decomp_cascade_con%cascade_donor_pool(k)) ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - this%lithr_col(c) = this%lithr_col(c) + this%decomp_cascade_hr_col(c,k) - end do - end if - end do - end associate - - ! total heterotrophic respiration (HR) - do fc = 1,num_soilc - c = filter_soilc(fc) - - this%hr_col(c) = & - this%lithr_col(c) + & - this%somhr_col(c) - - end do - - end subroutine Summary - -end module SoilBiogeochemCarbonFluxType - - diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 deleted file mode 100644 index 78be5efd44..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 +++ /dev/null @@ -1,1004 +0,0 @@ -module SoilBiogeochemCarbonStateType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan - use clm_varpar , only : nlevdecomp_full, nlevdecomp, nlevsoi - use clm_varcon , only : spval, ispval, dzsoi_decomp, zisoi, zsoi, c3_r2 - use clm_varctl , only : iulog, use_vertsoilc, spinup_state, use_fates - use landunit_varcon , only : istcrop, istsoil - use abortutils , only : endrun - use spmdMod , only : masterproc - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use LandunitType , only : lun - use ColumnType , only : col - use GridcellType , only : grc - use SoilBiogeochemStateType , only : get_spinup_latitude_term - ! - ! !PUBLIC TYPES: - implicit none - private - ! - type, public :: soilbiogeochem_carbonstate_type - - ! all c pools involved in decomposition - real(r8), pointer :: decomp_cpools_vr_col (:,:,:) ! (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - real(r8), pointer :: ctrunc_vr_col (:,:) ! (gC/m3) vertically-resolved column-level sink for C truncation - - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: ctrunc_col (:) ! (gC/m2) column-level sink for C truncation - real(r8), pointer :: totlitc_col (:) ! (gC/m2) total litter carbon - real(r8), pointer :: totlitc_1m_col (:) ! (gC/m2) total litter carbon to 1 meter - real(r8), pointer :: totsomc_col (:) ! (gC/m2) total soil organic matter carbon - real(r8), pointer :: totsomc_1m_col (:) ! (gC/m2) total soil organic matter carbon to 1 meter - real(r8), pointer :: cwdc_col (:) ! (gC/m2) coarse woody debris C (diagnostic) - real(r8), pointer :: decomp_cpools_1m_col (:,:) ! (gC/m2) Diagnostic: decomposing (litter, cwd, soil) c pools to 1 meter - real(r8), pointer :: decomp_cpools_col (:,:) ! (gC/m2) decomposing (litter, cwd, soil) c pools - real(r8), pointer :: dyn_cbal_adjustments_col (:) ! (gC/m2) adjustments to each column made in this timestep via dynamic column area adjustments (note: this variable only makes sense at the column-level: it is meaningless if averaged to the gridcell-level) - integer :: restart_file_spinup_state ! spinup state as read from restart file, for determining whether to enter or exit spinup mode. - real(r8) :: totvegcthresh ! threshold for total vegetation carbon to zero out decomposition pools - - contains - - procedure , public :: Init - procedure , public :: SetValues - procedure , public :: Restart - procedure , public :: Summary - procedure , public :: SetTotVgCThresh - procedure , public :: DynamicColumnAdjustments ! adjust state variables when column areas change - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - - - end type soilbiogeochem_carbonstate_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, carbon_type, ratio, c12_soilbiogeochem_carbonstate_inst) - - class(soilbiogeochem_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type - real(r8) , intent(in) :: ratio - type(soilbiogeochem_carbonstate_type) , intent(in), optional :: c12_soilbiogeochem_carbonstate_inst - - this%totvegcthresh = nan - call this%InitAllocate ( bounds) - call this%InitHistory ( bounds, carbon_type ) - if (present(c12_soilbiogeochem_carbonstate_inst)) then - call this%InitCold ( bounds, ratio, c12_soilbiogeochem_carbonstate_inst ) - else - call this%InitCold ( bounds, ratio) - end if - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonstate_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc,endc - !------------------------------------------------------------------------ - - begc = bounds%begc; endc = bounds%endc - - allocate( this%decomp_cpools_col (begc :endc,1:ndecomp_pools)) ; this%decomp_cpools_col (:,:) = nan - allocate( this%decomp_cpools_1m_col (begc :endc,1:ndecomp_pools)) ; this%decomp_cpools_1m_col (:,:) = nan - - allocate( this%ctrunc_vr_col(begc :endc,1:nlevdecomp_full)) ; - this%ctrunc_vr_col (:,:) = nan - - allocate(this%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%decomp_cpools_vr_col(:,:,:)= nan - - allocate(this%ctrunc_col (begc :endc)) ; this%ctrunc_col (:) = nan - if ( .not. use_fates ) then - allocate(this%cwdc_col (begc :endc)) ; this%cwdc_col (:) = nan - endif - allocate(this%totlitc_col (begc :endc)) ; this%totlitc_col (:) = nan - allocate(this%totsomc_col (begc :endc)) ; this%totsomc_col (:) = nan - allocate(this%totlitc_1m_col (begc :endc)) ; this%totlitc_1m_col (:) = nan - allocate(this%totsomc_1m_col (begc :endc)) ; this%totsomc_1m_col (:) = nan - allocate(this%dyn_cbal_adjustments_col (begc:endc)) ; this%dyn_cbal_adjustments_col (:) = nan - - this%restart_file_spinup_state = huge(1) - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds, carbon_type) - ! - ! !USES: - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=3) , intent(in) :: carbon_type - ! - ! !LOCAL VARIABLES: - integer :: l - integer :: begc ,endc - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - real(r8), pointer :: data2dptr(:,:) ! temp. pointer for slicing larger arrays - !------------------------------------------------------------------------ - - begc = bounds%begc; endc = bounds%endc - - !------------------------------- - ! C12 state variables - column - !------------------------------- - - if (carbon_type == 'c12') then - - this%decomp_cpools_col(begc:endc,:) = spval - do l = 1, ndecomp_pools - if ( nlevdecomp_full > 1 ) then - data2dptr => this%decomp_cpools_vr_col(:,1:nlevsoi,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'C_vr' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' C (vertically resolved)' - call hist_addfld2d (fname=fieldname, units='gC/m^3', type2d='levsoi', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr) - endif - - data1dptr => this%decomp_cpools_col(:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'C' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' C' - call hist_addfld1d (fname=fieldname, units='gC/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr) - - if ( nlevdecomp_full > 1 ) then - data1dptr => this%decomp_cpools_1m_col(:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'C_1m' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' C to 1 meter' - call hist_addfld1d (fname=fieldname, units='gC/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - endif - end do - - this%totlitc_col(begc:endc) = spval - call hist_addfld1d (fname='TOTLITC', units='gC/m^2', & - avgflag='A', long_name='total litter carbon', & - ptr_col=this%totlitc_col) - - this%totsomc_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOMC', units='gC/m^2', & - avgflag='A', long_name='total soil organic matter carbon', & - ptr_col=this%totsomc_col) - - if ( nlevdecomp_full > 1 ) then - this%totlitc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='TOTLITC_1m', units='gC/m^2', & - avgflag='A', long_name='total litter carbon to 1 meter depth', & - ptr_col=this%totlitc_1m_col) - end if - - if ( nlevdecomp_full > 1 ) then - this%totsomc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOMC_1m', units='gC/m^2', & - avgflag='A', long_name='total soil organic matter carbon to 1 meter depth', & - ptr_col=this%totsomc_1m_col) - end if - - this%ctrunc_col(begc:endc) = spval - call hist_addfld1d (fname='COL_CTRUNC', units='gC/m^2', & - avgflag='A', long_name='column-level sink for C truncation', & - ptr_col=this%ctrunc_col, default='inactive') - - this%dyn_cbal_adjustments_col(begc:endc) = spval - call hist_addfld1d (fname='DYN_COL_SOIL_ADJUSTMENTS_C', units='gC/m^2', & - avgflag='SUM', & - long_name='Adjustments in soil carbon due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_cbal_adjustments_col, default='inactive') - - end if - - !------------------------------- - ! C13 state variables - column - !------------------------------- - - if ( carbon_type == 'c13' ) then - - this%decomp_cpools_vr_col(begc:endc,:,:) = spval - do l = 1, ndecomp_pools - if ( nlevdecomp_full > 1 ) then - data2dptr => this%decomp_cpools_vr_col(:,1:nlevsoi,l) - fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C_vr' - longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C (vertically resolved)' - call hist_addfld2d (fname=fieldname, units='gC13/m^3', type2d='levsoi', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - - data1dptr => this%decomp_cpools_col(:,l) - fieldname = 'C13_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C' - longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C' - call hist_addfld1d (fname=fieldname, units='gC13/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr) - end do - - this%totlitc_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTLITC', units='gC13/m^2', & - avgflag='A', long_name='C13 total litter carbon', & - ptr_col=this%totlitc_col) - - this%totsomc_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTSOMC', units='gC13/m^2', & - avgflag='A', long_name='C13 total soil organic matter carbon', & - ptr_col=this%totsomc_col) - - if ( nlevdecomp_full > 1 ) then - this%totlitc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTLITC_1m', units='gC13/m^2', & - avgflag='A', long_name='C13 total litter carbon to 1 meter', & - ptr_col=this%totlitc_1m_col) - end if - - if ( nlevdecomp_full > 1 ) then - this%totsomc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='C13_TOTSOMC_1m', units='gC13/m^2', & - avgflag='A', long_name='C13 total soil organic matter carbon to 1 meter', & - ptr_col=this%totsomc_1m_col) - endif - - this%ctrunc_col(begc:endc) = spval - call hist_addfld1d (fname='C13_COL_CTRUNC', units='gC13/m^2', & - avgflag='A', long_name='C13 column-level sink for C truncation', & - ptr_col=this%ctrunc_col, default='inactive') - - this%dyn_cbal_adjustments_col(begc:endc) = spval - call hist_addfld1d (fname='C13_DYN_COL_SOIL_ADJUSTMENTS_C', units='gC13/m^2', & - avgflag='SUM', & - long_name='C13 adjustments in soil carbon due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_cbal_adjustments_col, default='inactive') - endif - - !------------------------------- - ! C14 state variables - column - !------------------------------- - - if ( carbon_type == 'c14' ) then - - this%decomp_cpools_vr_col(begc:endc,:,:) = spval - do l = 1, ndecomp_pools - if ( nlevdecomp_full > 1 ) then - data2dptr => this%decomp_cpools_vr_col(:,1:nlevsoi,l) - fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C_vr' - longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C (vertically resolved)' - call hist_addfld2d (fname=fieldname, units='gC14/m^3', type2d='levsoi', & - avgflag='A', long_name=longname, ptr_col=data2dptr, default='inactive') - endif - - data1dptr => this%decomp_cpools_col(:,l) - fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C' - longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C' - call hist_addfld1d (fname=fieldname, units='gC14/m^2', & - avgflag='A', long_name=longname, ptr_col=data1dptr) - - if ( nlevdecomp_full > 1 ) then - data1dptr => this%decomp_cpools_1m_col(:,l) - fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C_1m' - longname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C to 1 meter' - call hist_addfld1d (fname=fieldname, units='gC/m^2', & - avgflag='A', long_name=longname, ptr_col=data1dptr, default='inactive') - endif - end do - - this%totlitc_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTLITC', units='gC14/m^2', & - avgflag='A', long_name='C14 total litter carbon', & - ptr_col=this%totlitc_col) - - this%totsomc_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTSOMC', units='gC14/m^2', & - avgflag='A', long_name='C14 total soil organic matter carbon', & - ptr_col=this%totsomc_col) - - if ( nlevdecomp_full > 1 ) then - this%totlitc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTLITC_1m', units='gC14/m^2', & - avgflag='A', long_name='C14 total litter carbon to 1 meter', & - ptr_col=this%totlitc_1m_col) - - this%totsomc_1m_col(begc:endc) = spval - call hist_addfld1d (fname='C14_TOTSOMC_1m', units='gC14/m^2', & - avgflag='A', long_name='C14 total soil organic matter carbon to 1 meter', & - ptr_col=this%totsomc_1m_col) - endif - - this%ctrunc_col(begc:endc) = spval - call hist_addfld1d (fname='C14_COL_CTRUNC', units='gC14/m^2', & - avgflag='A', long_name='C14 column-level sink for C truncation', & - ptr_col=this%ctrunc_col, default='inactive') - - this%dyn_cbal_adjustments_col(begc:endc) = spval - call hist_addfld1d (fname='C14_DYN_COL_SOIL_ADJUSTMENTS_C', units='gC14/m^2', & - avgflag='SUM', & - long_name='C14 adjustments in soil carbon due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_cbal_adjustments_col, default='inactive') - endif - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, ratio, c12_soilbiogeochem_carbonstate_inst) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - ! !USES: - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: ratio - type(soilbiogeochem_carbonstate_type), intent(in), optional :: c12_soilbiogeochem_carbonstate_inst - ! - ! !LOCAL VARIABLES: - integer :: p,c,l,j,k - integer :: fc ! filter index - integer :: num_special_col ! number of good values in special_col filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - !----------------------------------------------------------------------- - - ! initialize column-level variables - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (.not. present(c12_soilbiogeochem_carbonstate_inst)) then !c12 - - do j = 1, nlevdecomp - do k = 1, ndecomp_pools - if (zsoi(j) < decomp_cascade_con%initial_stock_soildepth ) then !! only initialize upper soil column - this%decomp_cpools_vr_col(c,j,k) = decomp_cascade_con%initial_stock(k) - else - this%decomp_cpools_vr_col(c,j,k) = 0._r8 - endif - end do - this%ctrunc_vr_col(c,j) = 0._r8 - end do - if ( nlevdecomp > 1 ) then - do j = nlevdecomp+1, nlevdecomp_full - do k = 1, ndecomp_pools - this%decomp_cpools_vr_col(c,j,k) = 0._r8 - end do - this%ctrunc_vr_col(c,j) = 0._r8 - end do - end if - this%decomp_cpools_col(c,1:ndecomp_pools) = decomp_cascade_con%initial_stock(1:ndecomp_pools) - this%decomp_cpools_1m_col(c,1:ndecomp_pools) = decomp_cascade_con%initial_stock(1:ndecomp_pools) - - else - - do j = 1, nlevdecomp - do k = 1, ndecomp_pools - this%decomp_cpools_vr_col(c,j,k) = c12_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(c,j,k) * ratio - end do - this%ctrunc_vr_col(c,j) = c12_soilbiogeochem_carbonstate_inst%ctrunc_vr_col(c,j) * ratio - end do - if ( nlevdecomp > 1 ) then - do j = nlevdecomp+1, nlevdecomp_full - do k = 1, ndecomp_pools - this%decomp_cpools_vr_col(c,j,k) = 0._r8 - end do - this%ctrunc_vr_col(c,j) = 0._r8 - end do - end if - do k = 1, ndecomp_pools - this%decomp_cpools_col(c,k) = c12_soilbiogeochem_carbonstate_inst%decomp_cpools_col(c,k) * ratio - this%decomp_cpools_1m_col(c,k) = c12_soilbiogeochem_carbonstate_inst%decomp_cpools_1m_col(c,k) * ratio - end do - - endif - end if - - if ( .not. use_fates ) then - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (present(c12_soilbiogeochem_carbonstate_inst)) then - this%cwdc_col(c) = c12_soilbiogeochem_carbonstate_inst%cwdc_col(c) * ratio - else - this%cwdc_col(c) = 0._r8 - end if - this%ctrunc_col(c) = 0._r8 - this%totlitc_col(c) = 0._r8 - this%totsomc_col(c) = 0._r8 - this%totlitc_1m_col(c) = 0._r8 - this%totsomc_1m_col(c) = 0._r8 - end if - end if - end do - - ! now loop through special filters and explicitly set the variables that - ! have to be in place for biogeophysics - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - ! initialize fields for special filters - - call this%SetValues (num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart ( this, bounds, ncid, flag, carbon_type, totvegc_col, c12_soilbiogeochem_carbonstate_inst ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon state - ! - ! !USES: - use shr_infnan_mod , only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - use clm_time_manager , only : is_restart, get_nstep - use shr_const_mod , only : SHR_CONST_PDB - use clm_varcon , only : c14ratio - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - character(len=3) , intent(in) :: carbon_type ! 'c12' or 'c13' or 'c14' - real(r8) , intent(in) :: totvegc_col(bounds%begc:bounds%endc) ! (gC/m2) total - ! vegetation carbon - type(soilbiogeochem_carbonstate_type) , intent(in), optional :: c12_soilbiogeochem_carbonstate_inst - - ! - ! !LOCAL VARIABLES: - integer :: i,j,k,l,c - real(r8) :: m ! multiplier for the exit_spinup code - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - character(len=128) :: varname ! temporary - logical :: readvar - integer :: idata - logical :: exit_spinup = .false. - logical :: enter_spinup = .false. - ! flags for comparing the model and restart decomposition cascades - integer :: decomp_cascade_state, restart_file_decomp_cascade_state - !------------------------------------------------------------------------ - - if (carbon_type == 'c12') then - - do k = 1, ndecomp_pools - varname=trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& - errMsg(sourcefile, __LINE__)) - end if - end do - - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname='col_ctrunc_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname='col_ctrunc', xtype=ncd_double, & - dim1name='column', long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& - errMsg(sourcefile, __LINE__)) - end if - - end if - - !-------------------------------- - ! C13 column carbon state variables - !-------------------------------- - - if ( carbon_type == 'c13' ) then - - do k = 1, ndecomp_pools - varname = trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c_13' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - write(iulog,*) 'initializing soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col' & - // ' with atmospheric c13 value for: '//trim(varname) - do i = bounds%begc,bounds%endc - do j = 1, nlevdecomp - if (this%decomp_cpools_vr_col(i,j,k) /= spval .and. .not. isnan(this%decomp_cpools_vr_col(i,j,k)) ) then - this%decomp_cpools_vr_col(i,j,k) = c12_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(i,j,k) * c3_r2 - endif - end do - end do - end if - end do - - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c13_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c13", xtype=ncd_double, & - dim1name='column', long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - end if - - !-------------------------------- - ! C14 column carbon state variables - !-------------------------------- - - if ( carbon_type == 'c14' ) then - - do k = 1, ndecomp_pools - varname = trim(decomp_cascade_con%decomp_pool_name_restart(k))//'c_14' - if (use_vertsoilc) then - ptr2d => this%decomp_cpools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_cpools_vr_col(:,1,k) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - write(iulog,*) 'initializing soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col with atmospheric c14 value for: '//& - trim(varname) - do i = bounds%begc,bounds%endc - do j = 1, nlevdecomp - if (this%decomp_cpools_vr_col(i,j,k) /= spval .and. .not. isnan(this%decomp_cpools_vr_col(i,j,k)) ) then - this%decomp_cpools_vr_col(i,j,k) = c12_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(i,j,k) * c3_r2 - endif - end do - end do - end if - end do - - if (use_vertsoilc) then - ptr2d => this%ctrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c14_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ctrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ctrunc_c14", xtype=ncd_double, & - dim1name='column', long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - - end if - - !-------------------------------- - ! Spinup state - !-------------------------------- - - - if (carbon_type == 'c12') then - if (flag == 'write') idata = spinup_state - call restartvar(ncid=ncid, flag=flag, varname='spinup_state', xtype=ncd_int, & - long_name='Spinup state of the model that wrote this restart file: ' & - // ' 0 = normal model mode, 1 = AD spinup', units='', & - interpinic_flag='copy', readvar=readvar, data=idata) - if (flag == 'read') then - if (readvar) then - this%restart_file_spinup_state = idata - else - call endrun(msg=' CNRest: spinup_state was not on the restart file and is required' // & - errMsg(sourcefile, __LINE__)) - end if - end if - else - this%restart_file_spinup_state = c12_soilbiogeochem_carbonstate_inst%restart_file_spinup_state - endif - - ! now compare the model and restart file spinup states, and either take the - ! model into spinup mode or out of it if they are not identical - ! taking model out of spinup mode requires multiplying each decomposing pool - ! by the associated AD factor. - ! putting model into spinup mode requires dividing each decomposing pool - ! by the associated AD factor. - ! only allow this to occur on first timestep of model run. - - if (flag == 'read' .and. spinup_state /= this%restart_file_spinup_state ) then - if (spinup_state == 0 .and. this%restart_file_spinup_state >= 1 ) then - if ( masterproc ) write(iulog,*) ' CNRest: taking ',carbon_type,' SOM pools out of AD spinup mode' - exit_spinup = .true. - else if (spinup_state >= 1 .and. this%restart_file_spinup_state == 0 ) then - if ( masterproc ) write(iulog,*) ' CNRest: taking ',carbon_type,' SOM pools into AD spinup mode' - enter_spinup = .true. - else - call endrun(msg=' CNRest: error in entering/exiting spinup. spinup_state ' & - // ' != restart_file_spinup_state, but do not know what to do'//& - errMsg(sourcefile, __LINE__)) - end if - if (get_nstep() >= 2) then - call endrun(msg=' CNRest: error in entering/exiting spinup - should occur only when nstep = 1'//& - errMsg(sourcefile, __LINE__)) - endif - if ( exit_spinup .and. isnan(this%totvegcthresh) )then - call endrun(msg=' CNRest: error in exit spinup - totvegcthresh was not set with SetTotVgCThresh'//& - errMsg(sourcefile, __LINE__)) - end if - do k = 1, ndecomp_pools - if ( exit_spinup ) then - m = decomp_cascade_con%spinup_factor(k) - else if ( enter_spinup ) then - m = 1. / decomp_cascade_con%spinup_factor(k) - end if - do c = bounds%begc, bounds%endc - l = col%landunit(c) - do j = 1, nlevdecomp_full - if ( abs(m - 1._r8) .gt. 0.000001_r8 .and. exit_spinup) then - this%decomp_cpools_vr_col(c,j,k) = this%decomp_cpools_vr_col(c,j,k) * m * & - get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - ! If there is no vegetation carbon, implying that all vegetation has died, then - ! reset decomp pools to near zero during exit_spinup to avoid very - ! large and inert soil carbon stocks; note that only pools with spinup factor > 1 - ! will be affected, which means that total SOMC and LITC pools will not be set to 0. - if (totvegc_col(c) <= this%totvegcthresh .and. lun%itype(l) /= istcrop) then - this%decomp_cpools_vr_col(c,j,k) = 0.0_r8 - endif - elseif ( abs(m - 1._r8) .gt. 0.000001_r8 .and. enter_spinup) then - this%decomp_cpools_vr_col(c,j,k) = this%decomp_cpools_vr_col(c,j,k) * m / & - get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - this%decomp_cpools_vr_col(c,j,k) = this%decomp_cpools_vr_col(c,j,k) * m - endif - end do - end do - end do - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set carbon state variables - ! - ! !ARGUMENTS: - class (soilbiogeochem_carbonstate_type) :: this - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i,j,k,l ! loop index - !------------------------------------------------------------------------ - - do fi = 1,num_column - i = filter_column(fi) - if ( .not. use_fates ) then - this%cwdc_col(i) = value_column - end if - this%ctrunc_col(i) = value_column - this%totlitc_col(i) = value_column - this%totlitc_1m_col(i) = value_column - this%totsomc_col(i) = value_column - this%totsomc_1m_col(i) = value_column - end do - - do j = 1,nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%ctrunc_vr_col(i,j) = value_column - end do - end do - - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cpools_col(i,k) = value_column - this%decomp_cpools_1m_col(i,k) = value_column - end do - end do - - do j = 1,nlevdecomp_full - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cpools_vr_col(i,j,k) = value_column - end do - end do - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine Summary(this, bounds, num_allc, filter_allc) - ! - ! !DESCRIPTION: - ! Perform column-level carbon summary calculations - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonstate_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l ! indices - integer :: fc ! filter indices - real(r8) :: maxdepth ! depth to integrate soil variables - !----------------------------------------------------------------------- - - ! vertically integrate each of the decomposing C pools - do l = 1, ndecomp_pools - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_cpools_col(c,l) = 0._r8 - end do - end do - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_cpools_col(c,l) = & - this%decomp_cpools_col(c,l) + & - this%decomp_cpools_vr_col(c,j,l) * dzsoi_decomp(j) - end do - end do - end do - - if ( nlevdecomp > 1) then - - ! vertically integrate each of the decomposing C pools to 1 meter - maxdepth = 1._r8 - do l = 1, ndecomp_pools - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_cpools_1m_col(c,l) = 0._r8 - end do - end do - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - if ( zisoi(j) <= maxdepth ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_cpools_1m_col(c,l) = & - this%decomp_cpools_1m_col(c,l) + & - this%decomp_cpools_vr_col(c,j,l) * dzsoi_decomp(j) - end do - elseif ( zisoi(j-1) < maxdepth ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_cpools_1m_col(c,l) = & - this%decomp_cpools_1m_col(c,l) + & - this%decomp_cpools_vr_col(c,j,l) * (maxdepth - zisoi(j-1)) - end do - endif - end do - end do - - endif - - ! truncation carbon - do fc = 1,num_allc - c = filter_allc(fc) - this%ctrunc_col(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%ctrunc_col(c) = & - this%ctrunc_col(c) + & - this%ctrunc_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - ! total litter carbon in the top meter (TOTLITC_1m) - if ( nlevdecomp > 1) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitc_1m_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitc_1m_col(c) = this%totlitc_1m_col(c) + & - this%decomp_cpools_1m_col(c,l) - end do - endif - end do - end if - - ! total soil organic matter carbon in the top meter (TOTSOMC_1m) - if ( nlevdecomp > 1) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomc_1m_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_soil(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomc_1m_col(c) = this%totsomc_1m_col(c) + this%decomp_cpools_1m_col(c,l) - end do - end if - end do - end if - - ! total litter carbon (TOTLITC) - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitc_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitc_col(c) = this%totlitc_col(c) + this%decomp_cpools_col(c,l) - end do - endif - end do - - ! total soil organic matter carbon (TOTSOMC) - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomc_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_soil(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomc_col(c) = this%totsomc_col(c) + this%decomp_cpools_col(c,l) - end do - end if - end do - - ! coarse woody debris carbon - if (.not. use_fates ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%cwdc_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_cwd(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%cwdc_col(c) = this%cwdc_col(c) + this%decomp_cpools_col(c,l) - end do - end if - end do - - end if - - end subroutine Summary - - !------------------------------------------------------------------------ - subroutine SetTotVgCThresh(this, totvegcthresh) - - class(soilbiogeochem_carbonstate_type) :: this - real(r8) , intent(in) :: totvegcthresh - - if ( totvegcthresh <= 0.0_r8 )then - call endrun(msg=' ERROR totvegcthresh is zero or negative and should be > 0'//& - errMsg(sourcefile, __LINE__)) - end if - this%totvegcthresh = totvegcthresh - - end subroutine SetTotVgCThresh - - - !----------------------------------------------------------------------- - subroutine DynamicColumnAdjustments(this, bounds, clump_index, column_state_updater) - ! - ! !DESCRIPTION: - ! Adjust state variables when column areas change due to dynamic landuse - ! - ! !USES: - use dynColumnStateUpdaterMod, only : column_state_updater_type - ! - ! !ARGUMENTS: - class(soilbiogeochem_carbonstate_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - type(column_state_updater_type) , intent(in) :: column_state_updater - ! - ! !LOCAL VARIABLES: - integer :: j ! level - integer :: l ! decomp pool - real(r8) :: adjustment_one_level(bounds%begc:bounds%endc) - integer :: begc, endc - - character(len=*), parameter :: subname = 'DynamicColumnAdjustments' - !----------------------------------------------------------------------- - - begc = bounds%begc - endc = bounds%endc - - this%dyn_cbal_adjustments_col(begc:endc) = 0._r8 - - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%decomp_cpools_vr_col(begc:endc, j, l), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_cbal_adjustments_col(begc:endc) = & - this%dyn_cbal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - end do - end do - - do j = 1, nlevdecomp - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%ctrunc_vr_col(begc:endc, j), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_cbal_adjustments_col(begc:endc) = & - this%dyn_cbal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - end do - - end subroutine DynamicColumnAdjustments - - -end module SoilBiogeochemCarbonStateType diff --git a/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 b/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 deleted file mode 100644 index 8faa259e34..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 +++ /dev/null @@ -1,948 +0,0 @@ -module SoilBiogeochemCompetitionMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Resolve plant/heterotroph competition for mineral N - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : dzsoi_decomp - use clm_varctl , only : use_nitrif_denitrif - use abortutils , only : endrun - use decompMod , only : bounds_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemNitrogenUptakeMod , only : SoilBiogeochemNitrogenUptake - use ColumnType , only : col - use CNVegstateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use CNVegnitrogenfluxType , only : cnveg_nitrogenflux_type - !use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use WaterStateType , only : waterstate_type - use WaterfluxType , only : waterflux_type - use TemperatureType , only : temperature_type - use SoilStateType , only : soilstate_type - use CanopyStateType , only : CanopyState_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: SoilBiogeochemCompetitionInit ! Initialization - public :: SoilBiogeochemCompetition ! run method - - type :: params_type - real(r8) :: bdnr ! bulk denitrification rate (1/s) - real(r8) :: compet_plant_no3 ! (unitless) relative compettiveness of plants for NO3 - real(r8) :: compet_plant_nh4 ! (unitless) relative compettiveness of plants for NH4 - real(r8) :: compet_decomp_no3 ! (unitless) relative competitiveness of immobilizers for NO3 - real(r8) :: compet_decomp_nh4 ! (unitless) relative competitiveness of immobilizers for NH4 - real(r8) :: compet_denit ! (unitless) relative competitiveness of denitrifiers for NO3 - real(r8) :: compet_nit ! (unitless) relative competitiveness of nitrifiers for NH4 - end type params_type - ! - type(params_type), private :: params_inst ! params_inst is populated in readParamsMod - ! - ! !PUBLIC DATA MEMBERS: - character(len=* ), public, parameter :: suplnAll='ALL' ! Supplemental Nitrogen for all PFT's - character(len=* ), public, parameter :: suplnNon='NONE' ! No supplemental Nitrogen - character(len=15), public :: suplnitro = suplnNon ! Supplemental Nitrogen mode - ! - ! !PRIVATE DATA MEMBERS: - real(r8) :: dt ! decomp timestep (seconds) - real(r8) :: bdnr ! bulk denitrification rate (1/s) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNAllocParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - ! read in parameters - - tString='bdnr' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%bdnr=tempr - - tString='compet_plant_no3' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_plant_no3=tempr - - tString='compet_plant_nh4' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_plant_nh4=tempr - - tString='compet_decomp_no3' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_decomp_no3=tempr - - tString='compet_decomp_nh4' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_decomp_nh4=tempr - - tString='compet_denit' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_denit=tempr - - tString='compet_nit' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%compet_nit=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemCompetitionInit ( bounds) - ! - ! !DESCRIPTION: - ! - ! !USES: - use clm_varcon , only: secspday - use clm_time_manager, only: get_step_size - use clm_varctl , only: iulog, cnallocate_carbon_only_set - use shr_infnan_mod , only: nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'SoilBiogeochemCompetitionInit' - logical :: carbon_only - !----------------------------------------------------------------------- - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! set space-and-time parameters from parameter file - bdnr = params_inst%bdnr * (dt/secspday) - - ! Change namelist settings into private logical variables - select case(suplnitro) - case(suplnNon) - carbon_only = .false. - case(suplnAll) - carbon_only = .true. - case default - write(iulog,*) 'Supplemental Nitrogen flag (suplnitro) can only be: ', & - suplnNon, ' or ', suplnAll - call endrun(msg='ERROR: supplemental Nitrogen flag is not correct'//& - errMsg(sourcefile, __LINE__)) - end select - - call cnallocate_carbon_only_set(carbon_only) - - end subroutine SoilBiogeochemCompetitionInit - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemCompetition (bounds, num_soilc, filter_soilc,num_soilp, filter_soilp, waterstate_inst, & - waterflux_inst, temperature_inst,soilstate_inst, & - cnveg_state_inst,cnveg_carbonstate_inst, & - cnveg_carbonflux_inst,cnveg_nitrogenstate_inst,cnveg_nitrogenflux_inst, & - soilbiogeochem_carbonflux_inst, & - soilbiogeochem_state_inst, soilbiogeochem_nitrogenstate_inst, & - soilbiogeochem_nitrogenflux_inst,canopystate_inst) - ! - ! !USES: - use clm_varctl , only: cnallocate_carbon_only, iulog - use clm_varpar , only: nlevdecomp, ndecomp_cascade_transitions - use clm_varcon , only: nitrif_n2o_loss_frac - use CNSharedParamsMod, only: use_fun - use CNFUNMod , only: CNFUN - use subgridAveMod , only: p2c_2d - use perf_mod , only : t_startf, t_stopf - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(temperature_type) , intent(in) :: temperature_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(cnveg_state_type) , intent(inout) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(inout) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst - type(cnveg_nitrogenflux_type) , intent(inout) :: cnveg_nitrogenflux_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(canopystate_type) , intent(inout) :: canopystate_inst -! - ! - ! !LOCAL VARIABLES: - integer :: c,p,l,pi,j ! indices - integer :: fc ! filter column index - logical :: local_use_fun ! local version of use_fun - real(r8) :: compet_plant_no3 ! (unitless) relative compettiveness of plants for NO3 - real(r8) :: compet_plant_nh4 ! (unitless) relative compettiveness of plants for NH4 - real(r8) :: compet_decomp_no3 ! (unitless) relative competitiveness of immobilizers for NO3 - real(r8) :: compet_decomp_nh4 ! (unitless) relative competitiveness of immobilizers for NH4 - real(r8) :: compet_denit ! (unitless) relative competitiveness of denitrifiers for NO3 - real(r8) :: compet_nit ! (unitless) relative competitiveness of nitrifiers for NH4 - real(r8) :: fpi_no3_vr(bounds%begc:bounds%endc,1:nlevdecomp) ! fraction of potential immobilization supplied by no3(no units) - real(r8) :: fpi_nh4_vr(bounds%begc:bounds%endc,1:nlevdecomp) ! fraction of potential immobilization supplied by nh4 (no units) - real(r8) :: sum_nh4_demand(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: sum_nh4_demand_scaled(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: sum_no3_demand(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: sum_no3_demand_scaled(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: sum_ndemand_vr(bounds%begc:bounds%endc, 1:nlevdecomp) !total column N demand (gN/m3/s) at a given level - real(r8) :: nuptake_prof(bounds%begc:bounds%endc, 1:nlevdecomp) - real(r8) :: sminn_tot(bounds%begc:bounds%endc) - integer :: nlimit(bounds%begc:bounds%endc,0:nlevdecomp) !flag for N limitation - integer :: nlimit_no3(bounds%begc:bounds%endc,0:nlevdecomp) !flag for NO3 limitation - integer :: nlimit_nh4(bounds%begc:bounds%endc,0:nlevdecomp) !flag for NH4 limitation - real(r8) :: residual_sminn_vr(bounds%begc:bounds%endc, 1:nlevdecomp) - real(r8) :: residual_sminn(bounds%begc:bounds%endc) - real(r8) :: residual_smin_nh4_vr(bounds%begc:bounds%endc, 1:nlevdecomp) - real(r8) :: residual_smin_no3_vr(bounds%begc:bounds%endc, 1:nlevdecomp) - real(r8) :: residual_smin_nh4(bounds%begc:bounds%endc) - real(r8) :: residual_smin_no3(bounds%begc:bounds%endc) - real(r8) :: residual_plant_ndemand(bounds%begc:bounds%endc) - real(r8) :: sminn_to_plant_new(bounds%begc:bounds%endc) - !----------------------------------------------------------------------- - - associate( & - fpg => soilbiogeochem_state_inst%fpg_col , & ! Output: [real(r8) (:) ] fraction of potential gpp (no units) - fpi => soilbiogeochem_state_inst%fpi_col , & ! Output: [real(r8) (:) ] fraction of potential immobilization (no units) - fpi_vr => soilbiogeochem_state_inst%fpi_vr_col , & ! Output: [real(r8) (:,:) ] fraction of potential immobilization (no units) - nfixation_prof => soilbiogeochem_state_inst%nfixation_prof_col , & ! Output: [real(r8) (:,:) ] - plant_ndemand => soilbiogeochem_state_inst%plant_ndemand_col , & ! Input: [real(r8) (:) ] column-level plant N demand - - sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N - smin_nh4_vr => soilbiogeochem_nitrogenstate_inst%smin_nh4_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral NH4 - smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral NO3 - - pot_f_nit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_nit_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3/s) potential soil nitrification flux - pot_f_denit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_denit_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3/s) potential soil denitrification flux - f_nit_vr => soilbiogeochem_nitrogenflux_inst%f_nit_vr_col , & ! Output: [real(r8) (:,:) ] (gN/m3/s) soil nitrification flux - f_denit_vr => soilbiogeochem_nitrogenflux_inst%f_denit_vr_col , & ! Output: [real(r8) (:,:) ] (gN/m3/s) soil denitrification flux - potential_immob => soilbiogeochem_nitrogenflux_inst%potential_immob_col , & ! Output: [real(r8) (:) ] - actual_immob => soilbiogeochem_nitrogenflux_inst%actual_immob_col , & ! Output: [real(r8) (:) ] - sminn_to_plant => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_col , & ! Output: [real(r8) (:) ] - sminn_to_denit_excess_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_denit_excess_vr_col , & ! Output: [real(r8) (:,:) ] - actual_immob_no3_vr => soilbiogeochem_nitrogenflux_inst%actual_immob_no3_vr_col , & ! Output: [real(r8) (:,:) ] - actual_immob_nh4_vr => soilbiogeochem_nitrogenflux_inst%actual_immob_nh4_vr_col , & ! Output: [real(r8) (:,:) ] - smin_no3_to_plant_vr => soilbiogeochem_nitrogenflux_inst%smin_no3_to_plant_vr_col , & ! Output: [real(r8) (:,:) ] - smin_nh4_to_plant_vr => soilbiogeochem_nitrogenflux_inst%smin_nh4_to_plant_vr_col , & ! Output: [real(r8) (:,:) ] - n2_n2o_ratio_denit_vr => soilbiogeochem_nitrogenflux_inst%n2_n2o_ratio_denit_vr_col , & ! Output: [real(r8) (:,:) ] ratio of N2 to N2O production by denitrification [gN/gN] - f_n2o_denit_vr => soilbiogeochem_nitrogenflux_inst%f_n2o_denit_vr_col , & ! Output: [real(r8) (:,:) ] flux of N2O from denitrification [gN/m3/s] - f_n2o_nit_vr => soilbiogeochem_nitrogenflux_inst%f_n2o_nit_vr_col , & ! Output: [real(r8) (:,:) ] flux of N2O from nitrification [gN/m3/s] - supplement_to_sminn_vr => soilbiogeochem_nitrogenflux_inst%supplement_to_sminn_vr_col , & ! Output: [real(r8) (:,:) ] - sminn_to_plant_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_vr_col , & ! Output: [real(r8) (:,:) ] - potential_immob_vr => soilbiogeochem_nitrogenflux_inst%potential_immob_vr_col , & ! Input: [real(r8) (:,:) ] - actual_immob_vr => soilbiogeochem_nitrogenflux_inst%actual_immob_vr_col , & ! Output: [real(r8) (:,:) ] - sminn_to_plant_fun_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_vr_col , & ! Iutput: [real(r8) (:) ] Total layer soil N uptake of FUN (gN/m2/s) - sminn_to_plant_fun_no3_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_no3_vr_col, & ! Iutput: [real(r8) (:) ] Total layer no3 uptake of FUN (gN/m2/s) - sminn_to_plant_fun_nh4_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_nh4_vr_col & ! Iutput: [real(r8) (:) ] Total layer nh4 uptake of FUN (gN/m2/s) - ) - - ! calcualte nitrogen uptake profile - ! nuptake_prof(:,:) = nan - ! call SoilBiogelchemNitrogenUptakeProfile(bounds, & - ! nlevdecomp, num_soilc, filter_soilc, & - ! sminn_vr, dzsoi_decomp, nfixation_prof, nuptake_prof) - - ! column loops to resolve plant/heterotroph competition for mineral N - - sminn_to_plant_new(bounds%begc:bounds%endc) = 0._r8 - - local_use_fun = use_fun - - if (.not. use_nitrif_denitrif) then - - ! init sminn_tot - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = 0. - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = sminn_tot(c) + sminn_vr(c,j) * dzsoi_decomp(j) - end do - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (sminn_tot(c) > 0.) then - nuptake_prof(c,j) = sminn_vr(c,j) / sminn_tot(c) - else - nuptake_prof(c,j) = nfixation_prof(c,j) - endif - end do - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sum_ndemand_vr(c,j) = plant_ndemand(c) * nuptake_prof(c,j) + potential_immob_vr(c,j) - end do - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - l = col%landunit(c) - if (sum_ndemand_vr(c,j)*dt < sminn_vr(c,j)) then - - ! N availability is not limiting immobilization or plant - ! uptake, and both can proceed at their potential rates - nlimit(c,j) = 0 - fpi_vr(c,j) = 1.0_r8 - actual_immob_vr(c,j) = potential_immob_vr(c,j) - sminn_to_plant_vr(c,j) = plant_ndemand(c) * nuptake_prof(c,j) - else if ( cnallocate_carbon_only()) then !.or. & - ! this code block controls the addition of N to sminn pool - ! to eliminate any N limitation, when Carbon_Only is set. This lets the - ! model behave essentially as a carbon-only model, but with the - ! benefit of keeping track of the N additions needed to - ! eliminate N limitations, so there is still a diagnostic quantity - ! that describes the degree of N limitation at steady-state. - - nlimit(c,j) = 1 - fpi_vr(c,j) = 1.0_r8 - actual_immob_vr(c,j) = potential_immob_vr(c,j) - sminn_to_plant_vr(c,j) = plant_ndemand(c) * nuptake_prof(c,j) - supplement_to_sminn_vr(c,j) = sum_ndemand_vr(c,j) - (sminn_vr(c,j)/dt) - else - ! N availability can not satisfy the sum of immobilization and - ! plant growth demands, so these two demands compete for available - ! soil mineral N resource. - - nlimit(c,j) = 1 - if (sum_ndemand_vr(c,j) > 0.0_r8) then - actual_immob_vr(c,j) = (sminn_vr(c,j)/dt)*(potential_immob_vr(c,j) / sum_ndemand_vr(c,j)) - else - actual_immob_vr(c,j) = 0.0_r8 - end if - - if (potential_immob_vr(c,j) > 0.0_r8) then - fpi_vr(c,j) = actual_immob_vr(c,j) / potential_immob_vr(c,j) - else - fpi_vr(c,j) = 0.0_r8 - end if - - sminn_to_plant_vr(c,j) = (sminn_vr(c,j)/dt) - actual_immob_vr(c,j) - end if - end do - end do - - if ( local_use_fun ) then - call t_startf( 'CNFUN' ) - call CNFUN(bounds,num_soilc,filter_soilc,num_soilp,filter_soilp,waterstate_inst ,& - waterflux_inst,temperature_inst,soilstate_inst,cnveg_state_inst,cnveg_carbonstate_inst,& - cnveg_carbonflux_inst,cnveg_nitrogenstate_inst,cnveg_nitrogenflux_inst ,& - soilbiogeochem_nitrogenflux_inst,soilbiogeochem_carbonflux_inst,canopystate_inst, & - soilbiogeochem_nitrogenstate_inst) - call p2c_2d(bounds, nlevdecomp, & - cnveg_nitrogenflux_inst%sminn_to_plant_fun_vr_patch(bounds%begp:bounds%endp,1:nlevdecomp),& - soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_vr_col(bounds%begc:bounds%endc,1:nlevdecomp), & - 'unity') - call t_stopf( 'CNFUN' ) - end if - - ! sum up N fluxes to plant - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = sminn_to_plant(c) + sminn_to_plant_vr(c,j) * dzsoi_decomp(j) - if ( local_use_fun ) then - if (sminn_to_plant_fun_vr(c,j).gt.sminn_to_plant_vr(c,j)) then - sminn_to_plant_fun_vr(c,j) = sminn_to_plant_vr(c,j) - end if - end if - end do - end do - - ! give plants a second pass to see if there is any mineral N left over with which to satisfy residual N demand. - do fc=1,num_soilc - c = filter_soilc(fc) - residual_sminn(c) = 0._r8 - end do - - ! sum up total N left over after initial plant and immobilization fluxes - do fc=1,num_soilc - c = filter_soilc(fc) - residual_plant_ndemand(c) = plant_ndemand(c) - sminn_to_plant(c) - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (residual_plant_ndemand(c) > 0._r8 ) then - if (nlimit(c,j) .eq. 0) then - residual_sminn_vr(c,j) = max(sminn_vr(c,j) - (actual_immob_vr(c,j) + sminn_to_plant_vr(c,j) ) * dt, 0._r8) - residual_sminn(c) = residual_sminn(c) + residual_sminn_vr(c,j) * dzsoi_decomp(j) - else - residual_sminn_vr(c,j) = 0._r8 - endif - endif - end do - end do - - ! distribute residual N to plants - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if ( residual_plant_ndemand(c) > 0._r8 .and. residual_sminn(c) > 0._r8 .and. nlimit(c,j) .eq. 0) then - sminn_to_plant_vr(c,j) = sminn_to_plant_vr(c,j) + residual_sminn_vr(c,j) * & - min(( residual_plant_ndemand(c) * dt ) / residual_sminn(c), 1._r8) / dt - endif - end do - end do - - ! re-sum up N fluxes to plant - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = sminn_to_plant(c) + sminn_to_plant_vr(c,j) * dzsoi_decomp(j) - if ( .not. local_use_fun ) then - sum_ndemand_vr(c,j) = potential_immob_vr(c,j) + sminn_to_plant_vr(c,j) - else - sminn_to_plant_new(c) = sminn_to_plant_new(c) + sminn_to_plant_fun_vr(c,j) * dzsoi_decomp(j) - sum_ndemand_vr(c,j) = potential_immob_vr(c,j) + sminn_to_plant_fun_vr(c,j) - end if - end do - end do - - ! under conditions of excess N, some proportion is assumed to - ! be lost to denitrification, in addition to the constant - ! proportion lost in the decomposition pathways - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if ( .not. local_use_fun ) then - if ((sminn_to_plant_vr(c,j) + actual_immob_vr(c,j))*dt < sminn_vr(c,j)) then - sminn_to_denit_excess_vr(c,j) = max(bdnr*((sminn_vr(c,j)/dt) - sum_ndemand_vr(c,j)),0._r8) - else - sminn_to_denit_excess_vr(c,j) = 0._r8 - endif - else - if ((sminn_to_plant_fun_vr(c,j) + actual_immob_vr(c,j))*dt < sminn_vr(c,j)) then - sminn_to_denit_excess_vr(c,j) = max(bdnr*((sminn_vr(c,j)/dt) - sum_ndemand_vr(c,j)),0._r8) - else - sminn_to_denit_excess_vr(c,j) = 0._r8 - endif - end if - end do - end do - - ! sum up N fluxes to immobilization - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - actual_immob(c) = actual_immob(c) + actual_immob_vr(c,j) * dzsoi_decomp(j) - potential_immob(c) = potential_immob(c) + potential_immob_vr(c,j) * dzsoi_decomp(j) - end do - end do - - do fc=1,num_soilc - c = filter_soilc(fc) - ! calculate the fraction of potential growth that can be - ! acheived with the N available to plants - if (plant_ndemand(c) > 0.0_r8) then - if ( .not. local_use_fun ) then - fpg(c) = sminn_to_plant(c) / plant_ndemand(c) - else - fpg(c) = sminn_to_plant_new(c) / plant_ndemand(c) - end if - else - fpg(c) = 1.0_r8 - end if - - ! calculate the fraction of immobilization realized (for diagnostic purposes) - if (potential_immob(c) > 0.0_r8) then - fpi(c) = actual_immob(c) / potential_immob(c) - else - fpi(c) = 1.0_r8 - end if - end do - - else !----------NITRIF_DENITRIF-------------! - - ! column loops to resolve plant/heterotroph/nitrifier/denitrifier competition for mineral N - !read constants from external netcdf file - compet_plant_no3 = params_inst%compet_plant_no3 - compet_plant_nh4 = params_inst%compet_plant_nh4 - compet_decomp_no3 = params_inst%compet_decomp_no3 - compet_decomp_nh4 = params_inst%compet_decomp_nh4 - compet_denit = params_inst%compet_denit - compet_nit = params_inst%compet_nit - - ! init total mineral N pools - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = 0. - end do - - ! sum up total mineral N pools - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = sminn_tot(c) + (smin_no3_vr(c,j) + smin_nh4_vr(c,j)) * dzsoi_decomp(j) - end do - end do - - ! define N uptake profile for initial vertical distribution of plant N uptake, assuming plant seeks N from where it is most abundant - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (sminn_tot(c) > 0.) then - nuptake_prof(c,j) = sminn_vr(c,j) / sminn_tot(c) - else - nuptake_prof(c,j) = nfixation_prof(c,j) - endif - end do - end do - - ! main column/vertical loop - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - l = col%landunit(c) - - ! first compete for nh4 - sum_nh4_demand(c,j) = plant_ndemand(c) * nuptake_prof(c,j) + potential_immob_vr(c,j) + pot_f_nit_vr(c,j) - sum_nh4_demand_scaled(c,j) = plant_ndemand(c)* nuptake_prof(c,j) * compet_plant_nh4 + & - potential_immob_vr(c,j)*compet_decomp_nh4 + pot_f_nit_vr(c,j)*compet_nit - - if (sum_nh4_demand(c,j)*dt < smin_nh4_vr(c,j)) then - - ! NH4 availability is not limiting immobilization or plant - ! uptake, and all can proceed at their potential rates - nlimit_nh4(c,j) = 0 - fpi_nh4_vr(c,j) = 1.0_r8 - actual_immob_nh4_vr(c,j) = potential_immob_vr(c,j) - !RF added new term. - - f_nit_vr(c,j) = pot_f_nit_vr(c,j) - - if ( .not. local_use_fun ) then - smin_nh4_to_plant_vr(c,j) = plant_ndemand(c) * nuptake_prof(c,j) - else - smin_nh4_to_plant_vr(c,j) = smin_nh4_vr(c,j)/dt - actual_immob_nh4_vr(c,j) - f_nit_vr(c,j) - end if - - else - - ! NH4 availability can not satisfy the sum of immobilization, nitrification, and - ! plant growth demands, so these three demands compete for available - ! soil mineral NH4 resource. - nlimit_nh4(c,j) = 1 - if (sum_nh4_demand(c,j) > 0.0_r8) then - ! RF microbes compete based on the hypothesised plant demand. - actual_immob_nh4_vr(c,j) = min((smin_nh4_vr(c,j)/dt)*(potential_immob_vr(c,j)* & - compet_decomp_nh4 / sum_nh4_demand_scaled(c,j)), potential_immob_vr(c,j)) - - f_nit_vr(c,j) = min((smin_nh4_vr(c,j)/dt)*(pot_f_nit_vr(c,j)*compet_nit / & - sum_nh4_demand_scaled(c,j)), pot_f_nit_vr(c,j)) - - if ( .not. local_use_fun ) then - smin_nh4_to_plant_vr(c,j) = min((smin_nh4_vr(c,j)/dt)*(plant_ndemand(c)* & - nuptake_prof(c,j)*compet_plant_nh4 / sum_nh4_demand_scaled(c,j)), plant_ndemand(c)*nuptake_prof(c,j)) - - else - ! RF added new term. send rest of N to plant - which decides whether it should pay or not? - smin_nh4_to_plant_vr(c,j) = smin_nh4_vr(c,j)/dt - actual_immob_nh4_vr(c,j) - f_nit_vr(c,j) - end if - - else - actual_immob_nh4_vr(c,j) = 0.0_r8 - smin_nh4_to_plant_vr(c,j) = 0.0_r8 - f_nit_vr(c,j) = 0.0_r8 - end if - - if (potential_immob_vr(c,j) > 0.0_r8) then - fpi_nh4_vr(c,j) = actual_immob_nh4_vr(c,j) / potential_immob_vr(c,j) - else - fpi_nh4_vr(c,j) = 0.0_r8 - end if - - end if - - - - if(.not.local_use_fun)then - sum_no3_demand(c,j) = (plant_ndemand(c)*nuptake_prof(c,j)-smin_nh4_to_plant_vr(c,j)) + & - (potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j)) + pot_f_denit_vr(c,j) - sum_no3_demand_scaled(c,j) = (plant_ndemand(c)*nuptake_prof(c,j) & - -smin_nh4_to_plant_vr(c,j))*compet_plant_no3 + & - (potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j))*compet_decomp_no3 + pot_f_denit_vr(c,j)*compet_denit - else - sum_no3_demand(c,j) = plant_ndemand(c)*nuptake_prof(c,j) + & - (potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j)) + pot_f_denit_vr(c,j) - sum_no3_demand_scaled(c,j) = (plant_ndemand(c)*nuptake_prof(c,j))*compet_plant_no3 + & - (potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j))*compet_decomp_no3 + pot_f_denit_vr(c,j)*compet_denit - endif - - - - if (sum_no3_demand(c,j)*dt < smin_no3_vr(c,j)) then - - ! NO3 availability is not limiting immobilization or plant - ! uptake, and all can proceed at their potential rates - nlimit_no3(c,j) = 0 - fpi_no3_vr(c,j) = 1.0_r8 - fpi_nh4_vr(c,j) - actual_immob_no3_vr(c,j) = (potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j)) - - f_denit_vr(c,j) = pot_f_denit_vr(c,j) - - if(.not.local_use_fun)then - smin_no3_to_plant_vr(c,j) = (plant_ndemand(c)*nuptake_prof(c,j)-smin_nh4_to_plant_vr(c,j)) - else - ! This restricts the N uptake of a single layer to the value determined from the total demands and the - ! hypothetical uptake profile above. Which is a strange thing to do, since that is independent of FUN - ! do we need this at all? - smin_no3_to_plant_vr(c,j) = plant_ndemand(c)*nuptake_prof(c,j) - ! RF added new term. send rest of N to plant - which decides whether it should pay or not? - if ( local_use_fun ) then - smin_no3_to_plant_vr(c,j) = smin_no3_vr(c,j)/dt - actual_immob_no3_vr(c,j) - f_denit_vr(c,j) - end if - endif - - else - - ! NO3 availability can not satisfy the sum of immobilization, denitrification, and - ! plant growth demands, so these three demands compete for available - ! soil mineral NO3 resource. - nlimit_no3(c,j) = 1 - - if (sum_no3_demand(c,j) > 0.0_r8) then - if(.not.local_use_fun)then - actual_immob_no3_vr(c,j) = min((smin_no3_vr(c,j)/dt)*((potential_immob_vr(c,j)- & - actual_immob_nh4_vr(c,j))*compet_decomp_no3 / sum_no3_demand_scaled(c,j)), & - potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j)) - - smin_no3_to_plant_vr(c,j) = min((smin_no3_vr(c,j)/dt)*((plant_ndemand(c)* & - nuptake_prof(c,j)-smin_nh4_to_plant_vr(c,j))*compet_plant_no3 / sum_no3_demand_scaled(c,j)), & - plant_ndemand(c)*nuptake_prof(c,j)-smin_nh4_to_plant_vr(c,j)) - - f_denit_vr(c,j) = min((smin_no3_vr(c,j)/dt)*(pot_f_denit_vr(c,j)*compet_denit / & - sum_no3_demand_scaled(c,j)), pot_f_denit_vr(c,j)) - else - actual_immob_no3_vr(c,j) = min((smin_no3_vr(c,j)/dt)*((potential_immob_vr(c,j)- & - actual_immob_nh4_vr(c,j))*compet_decomp_no3 / sum_no3_demand_scaled(c,j)), & - potential_immob_vr(c,j)-actual_immob_nh4_vr(c,j)) - - f_denit_vr(c,j) = min((smin_no3_vr(c,j)/dt)*(pot_f_denit_vr(c,j)*compet_denit / & - sum_no3_demand_scaled(c,j)), pot_f_denit_vr(c,j)) - - smin_no3_to_plant_vr(c,j) = (smin_no3_vr(c,j)/dt)*((plant_ndemand(c)* & - nuptake_prof(c,j)-smin_nh4_to_plant_vr(c,j))*compet_plant_no3 / sum_no3_demand_scaled(c,j)) - - ! RF added new term. send rest of N to plant - which decides whether it should pay or not? - smin_no3_to_plant_vr(c,j) = (smin_no3_vr(c,j) / dt) - actual_immob_no3_vr(c,j) - f_denit_vr(c,j) - - - end if ! use_fun - - else ! no no3 demand. no uptake fluxes. - actual_immob_no3_vr(c,j) = 0.0_r8 - smin_no3_to_plant_vr(c,j) = 0.0_r8 - f_denit_vr(c,j) = 0.0_r8 - - end if !any no3 demand? - - - - - if (potential_immob_vr(c,j) > 0.0_r8) then - fpi_no3_vr(c,j) = actual_immob_no3_vr(c,j) / potential_immob_vr(c,j) - else - fpi_no3_vr(c,j) = 0.0_r8 - end if - - end if - - - - - ! n2o emissions: n2o from nitr is const fraction, n2o from denitr is calculated in nitrif_denitrif - f_n2o_nit_vr(c,j) = f_nit_vr(c,j) * nitrif_n2o_loss_frac - f_n2o_denit_vr(c,j) = f_denit_vr(c,j) / (1._r8 + n2_n2o_ratio_denit_vr(c,j)) - - - ! this code block controls the addition of N to sminn pool - ! to eliminate any N limitation, when Carbon_Only is set. This lets the - ! model behave essentially as a carbon-only model, but with the - ! benefit of keeping track of the N additions needed to - ! eliminate N limitations, so there is still a diagnostic quantity - ! that describes the degree of N limitation at steady-state. - - if ( cnallocate_carbon_only()) then !.or. & - if ( fpi_no3_vr(c,j) + fpi_nh4_vr(c,j) < 1._r8 ) then - fpi_nh4_vr(c,j) = 1.0_r8 - fpi_no3_vr(c,j) - supplement_to_sminn_vr(c,j) = (potential_immob_vr(c,j) & - - actual_immob_no3_vr(c,j)) - actual_immob_nh4_vr(c,j) - ! update to new values that satisfy demand - actual_immob_nh4_vr(c,j) = potential_immob_vr(c,j) - actual_immob_no3_vr(c,j) - end if - if ( smin_no3_to_plant_vr(c,j) + smin_nh4_to_plant_vr(c,j) < plant_ndemand(c)*nuptake_prof(c,j) ) then - supplement_to_sminn_vr(c,j) = supplement_to_sminn_vr(c,j) + & - (plant_ndemand(c)*nuptake_prof(c,j) - smin_no3_to_plant_vr(c,j)) - smin_nh4_to_plant_vr(c,j) ! use old values - smin_nh4_to_plant_vr(c,j) = plant_ndemand(c)*nuptake_prof(c,j) - smin_no3_to_plant_vr(c,j) - end if - sminn_to_plant_vr(c,j) = smin_no3_to_plant_vr(c,j) + smin_nh4_to_plant_vr(c,j) - end if - - ! sum up no3 and nh4 fluxes - fpi_vr(c,j) = fpi_no3_vr(c,j) + fpi_nh4_vr(c,j) - sminn_to_plant_vr(c,j) = smin_no3_to_plant_vr(c,j) + smin_nh4_to_plant_vr(c,j) - actual_immob_vr(c,j) = actual_immob_no3_vr(c,j) + actual_immob_nh4_vr(c,j) - end do - end do - - if ( local_use_fun ) then - call t_startf( 'CNFUN' ) - call CNFUN(bounds,num_soilc,filter_soilc,num_soilp,filter_soilp,waterstate_inst ,& - waterflux_inst,temperature_inst,soilstate_inst,cnveg_state_inst,cnveg_carbonstate_inst,& - cnveg_carbonflux_inst,cnveg_nitrogenstate_inst,cnveg_nitrogenflux_inst ,& - soilbiogeochem_nitrogenflux_inst,soilbiogeochem_carbonflux_inst,canopystate_inst, & - soilbiogeochem_nitrogenstate_inst) - - ! sminn_to_plant_fun is output of actual N uptake from FUN - call p2c_2d(bounds,nlevdecomp, & - cnveg_nitrogenflux_inst%sminn_to_plant_fun_no3_vr_patch(bounds%begp:bounds%endp,1:nlevdecomp),& - soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_no3_vr_col(bounds%begc:bounds%endc,1:nlevdecomp),& - 'unity') - - call p2c_2d(bounds,nlevdecomp, & - cnveg_nitrogenflux_inst%sminn_to_plant_fun_nh4_vr_patch(bounds%begp:bounds%endp,1:nlevdecomp),& - soilbiogeochem_nitrogenflux_inst%sminn_to_plant_fun_nh4_vr_col(bounds%begc:bounds%endc,1:nlevdecomp),& - 'unity') - call t_stopf( 'CNFUN' ) - end if - - - - if(.not.local_use_fun)then - do fc=1,num_soilc - c = filter_soilc(fc) - ! sum up N fluxes to plant after initial competition - sminn_to_plant(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = sminn_to_plant(c) + sminn_to_plant_vr(c,j) * dzsoi_decomp(j) - end do - end do - else - do fc=1,num_soilc - c = filter_soilc(fc) - ! sum up N fluxes to plant after initial competition - sminn_to_plant(c) = 0._r8 !this isn't use in fun. - do j = 1, nlevdecomp - if ((sminn_to_plant_fun_no3_vr(c,j)-smin_no3_to_plant_vr(c,j)).gt.0.0000000000001_r8) then - write(iulog,*) 'problem with limitations on no3 uptake', & - sminn_to_plant_fun_no3_vr(c,j),smin_no3_to_plant_vr(c,j) - call endrun("too much NO3 uptake predicted by FUN") - end if -!KO if ((sminn_to_plant_fun_nh4_vr(c,j)-smin_nh4_to_plant_vr(c,j)).gt.0.0000000000001_r8) then -!KO - if ((sminn_to_plant_fun_nh4_vr(c,j)-smin_nh4_to_plant_vr(c,j)).gt.0.0000001_r8) then -!KO - write(iulog,*) 'problem with limitations on nh4 uptake', & - sminn_to_plant_fun_nh4_vr(c,j),smin_nh4_to_plant_vr(c,j) - call endrun("too much NH4 uptake predicted by FUN") - end if - end do - end do - - end if - - if(.not.local_use_fun)then - ! give plants a second pass to see if there is any mineral N left over with which to satisfy residual N demand. - ! first take frm nh4 pool; then take from no3 pool - do fc=1,num_soilc - c = filter_soilc(fc) - residual_plant_ndemand(c) = plant_ndemand(c) - sminn_to_plant(c) - residual_smin_nh4(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (residual_plant_ndemand(c) > 0._r8 ) then - if (nlimit_nh4(c,j) .eq. 0) then - residual_smin_nh4_vr(c,j) = max(smin_nh4_vr(c,j) - (actual_immob_nh4_vr(c,j) + & - smin_nh4_to_plant_vr(c,j) + f_nit_vr(c,j) ) * dt, 0._r8) - - residual_smin_nh4(c) = residual_smin_nh4(c) + residual_smin_nh4_vr(c,j) * dzsoi_decomp(j) - else - residual_smin_nh4_vr(c,j) = 0._r8 - endif - - if ( residual_smin_nh4(c) > 0._r8 .and. nlimit_nh4(c,j) .eq. 0 ) then - smin_nh4_to_plant_vr(c,j) = smin_nh4_to_plant_vr(c,j) + residual_smin_nh4_vr(c,j) * & - min(( residual_plant_ndemand(c) * dt ) / residual_smin_nh4(c), 1._r8) / dt - endif - end if - end do - end do - - ! re-sum up N fluxes to plant after second pass for nh4 - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant_vr(c,j) = smin_nh4_to_plant_vr(c,j) + smin_no3_to_plant_vr(c,j) - sminn_to_plant(c) = sminn_to_plant(c) + (sminn_to_plant_vr(c,j)) * dzsoi_decomp(j) - end do - end do - - ! - ! and now do second pass for no3 - do fc=1,num_soilc - c = filter_soilc(fc) - residual_plant_ndemand(c) = plant_ndemand(c) - sminn_to_plant(c) - residual_smin_no3(c) = 0._r8 - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (residual_plant_ndemand(c) > 0._r8 ) then - if (nlimit_no3(c,j) .eq. 0) then - residual_smin_no3_vr(c,j) = max(smin_no3_vr(c,j) - (actual_immob_no3_vr(c,j) + & - smin_no3_to_plant_vr(c,j) + f_denit_vr(c,j) ) * dt, 0._r8) - residual_smin_no3(c) = residual_smin_no3(c) + residual_smin_no3_vr(c,j) * dzsoi_decomp(j) - else - residual_smin_no3_vr(c,j) = 0._r8 - endif - - if ( residual_smin_no3(c) > 0._r8 .and. nlimit_no3(c,j) .eq. 0) then - smin_no3_to_plant_vr(c,j) = smin_no3_to_plant_vr(c,j) + residual_smin_no3_vr(c,j) * & - min(( residual_plant_ndemand(c) * dt ) / residual_smin_no3(c), 1._r8) / dt - endif - endif - end do - end do - - ! re-sum up N fluxes to plant after second passes of both no3 and nh4 - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant_vr(c,j) = smin_nh4_to_plant_vr(c,j) + smin_no3_to_plant_vr(c,j) - sminn_to_plant(c) = sminn_to_plant(c) + (sminn_to_plant_vr(c,j)) * dzsoi_decomp(j) - end do - end do - - else !use_fun - !calculate maximum N available to plants. - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant_vr(c,j) = smin_nh4_to_plant_vr(c,j) + smin_no3_to_plant_vr(c,j) - sminn_to_plant(c) = sminn_to_plant(c) + (sminn_to_plant_vr(c,j)) * dzsoi_decomp(j) - end do - end do - - - ! add up fun fluxes from SMINN to plant. - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_to_plant_new(c) = sminn_to_plant_new(c) + & - (sminn_to_plant_fun_no3_vr(c,j) + sminn_to_plant_fun_nh4_vr(c,j)) * dzsoi_decomp(j) - - end do - end do - - - end if !use_f - ! sum up N fluxes to immobilization - do fc=1,num_soilc - c = filter_soilc(fc) - actual_immob(c) = 0._r8 - potential_immob(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - actual_immob(c) = actual_immob(c) + actual_immob_vr(c,j) * dzsoi_decomp(j) - potential_immob(c) = potential_immob(c) + potential_immob_vr(c,j) * dzsoi_decomp(j) - end do - end do - - - - - do fc=1,num_soilc - c = filter_soilc(fc) - ! calculate the fraction of potential growth that can be - ! acheived with the N available to plants - ! calculate the fraction of immobilization realized (for diagnostic purposes) - if(.not.local_use_fun)then !FUN has no concept of FPG. - - if (plant_ndemand(c) > 0.0_r8) then - fpg(c) = sminn_to_plant(c) / plant_ndemand(c) - else - fpg(c) = 1._r8 - end if - end if - - if (potential_immob(c) > 0.0_r8) then - fpi(c) = actual_immob(c) / potential_immob(c) - else - fpi(c) = 1._r8 - end if - end do ! end of column loops - - end if !end of if_not_use_nitrif_denitrif - - end associate - - end subroutine SoilBiogeochemCompetition - -end module SoilBiogeochemCompetitionMod diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 deleted file mode 100644 index 6098e9d120..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 +++ /dev/null @@ -1,1120 +0,0 @@ -module SoilBiogeochemDecompCascadeBGCMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Sets the coeffiecients used in the decomposition cascade submodel. - ! This uses the CENTURY/BGC parameters - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates - use clm_varcon , only : zsoi - use decompMod , only : bounds_type - use spmdMod , only : masterproc - use abortutils , only : endrun - use CNSharedParamsMod , only : CNParamsShareInst, anoxia_wtsat, nlev_soildecomp_standard - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilStateType , only : soilstate_type - use CanopyStateType , only : canopystate_type - use TemperatureType , only : temperature_type - use ch4Mod , only : ch4_type - use ColumnType , only : col - use GridcellType , only : grc - use SoilBiogeochemStateType , only : get_spinup_latitude_term - - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: DecompCascadeBGCreadNML ! Read in namelist - public :: readParams ! Read in parameters from params file - public :: init_decompcascade_bgc ! Initialization - public :: decomp_rate_constants_bgc ! Figure out decomposition rates - ! - ! !PUBLIC DATA MEMBERS - logical , public :: normalize_q10_to_century_tfunc = .true.! do we normalize the century decomp. rates so that they match the CLM Q10 at a given tep? - logical , public :: use_century_tfunc = .false. - real(r8), public :: normalization_tref = 15._r8 ! reference temperature for normalizaion (degrees C) - ! - ! !PRIVATE DATA MEMBERS - - integer, private :: i_soil1 = -9 ! Soil Organic Matter (SOM) first pool - integer, private :: i_soil2 = -9 ! SOM second pool - integer, private :: i_soil3 = -9 ! SOM third pool - integer, private, parameter :: nsompools = 3 ! Number of SOM pools - integer, private, parameter :: i_litr1 = i_met_lit ! First litter pool, metobolic - integer, private, parameter :: i_litr2 = i_cel_lit ! Second litter pool, cellulose - integer, private, parameter :: i_litr3 = i_lig_lit ! Third litter pool, lignin - - type, private :: params_type - real(r8):: cn_s1_bgc !C:N for SOM 1 - real(r8):: cn_s2_bgc !C:N for SOM 2 - real(r8):: cn_s3_bgc !C:N for SOM 3 - - real(r8):: rf_l1s1_bgc !respiration fraction litter 1 -> SOM 1 - real(r8):: rf_l2s1_bgc - real(r8):: rf_l3s2_bgc - - real(r8):: rf_s2s1_bgc - real(r8):: rf_s2s3_bgc - real(r8):: rf_s3s1_bgc - - real(r8):: rf_cwdl2_bgc - real(r8):: rf_cwdl3_bgc - - real(r8):: tau_l1_bgc ! turnover time of litter 1 (yr) - real(r8):: tau_l2_l3_bgc ! turnover time of litter 2 and litter 3 (yr) - real(r8):: tau_s1_bgc ! turnover time of SOM 1 (yr) - real(r8):: tau_s2_bgc ! turnover time of SOM 2 (yr) - real(r8):: tau_s3_bgc ! turnover time of SOM 3 (yr) - real(r8):: tau_cwd_bgc ! corrected fragmentation rate constant CWD - - real(r8) :: cwd_fcel_bgc !cellulose fraction for CWD - real(r8) :: cwd_flig_bgc ! - - real(r8) :: k_frag_bgc !fragmentation rate for CWD - real(r8) :: minpsi_bgc !minimum soil water potential for heterotrophic resp - real(r8) :: maxpsi_bgc !maximum soil water potential for heterotrophic resp - - real(r8) :: initial_Cstocks(nsompools) ! Initial Carbon stocks for a cold-start - real(r8) :: initial_Cstocks_depth ! Soil depth for initial Carbon stocks for a cold-start - - end type params_type - ! - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine DecompCascadeBGCreadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for soil BGC Decomposition Cascade - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'DecompCascadeBGCreadNML' - character(len=*), parameter :: nmlname = 'CENTURY_soilBGCDecompCascade' - !----------------------------------------------------------------------- - real(r8) :: initial_Cstocks(nsompools), initial_Cstocks_depth - namelist /CENTURY_soilBGCDecompCascade/ initial_Cstocks, initial_Cstocks_depth - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - initial_Cstocks(:) = 200._r8 - initial_Cstocks_depth = 0.3 - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=CENTURY_soilBGCDecompCascade, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (initial_Cstocks , mpicom) - call shr_mpi_bcast (initial_Cstocks_depth, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=CENTURY_soilBGCDecompCascade) - write(iulog,*) ' ' - end if - - params_inst%initial_Cstocks(:) = initial_Cstocks(:) - params_inst%initial_Cstocks_depth = initial_Cstocks_depth - - end subroutine DecompCascadeBGCreadNML - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! - ! !USES: - use ncdio_pio , only: file_desc_t,ncd_io - ! - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNDecompBgcParamsType' - character(len=100) :: errCode = 'Error reading in CN const file ' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - ! Read off of netcdf file - tString='tau_l1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_l1_bgc=tempr - - tString='tau_l2_l3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_l2_l3_bgc=tempr - - tString='tau_s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_s1_bgc=tempr - - tString='tau_s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_s2_bgc=tempr - - tString='tau_s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_s3_bgc=tempr - - tString='tau_cwd' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%tau_cwd_bgc=tempr - - tString='cn_s1_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s1_bgc=tempr - - tString='cn_s2_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s2_bgc=tempr - - tString='cn_s3_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s3_bgc=tempr - - tString='rf_l1s1_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l1s1_bgc=tempr - - tString='rf_l2s1_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l2s1_bgc=tempr - - tString='rf_l3s2_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l3s2_bgc=tempr - - tString='rf_s2s1_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s2s1_bgc=tempr - - tString='rf_s2s3_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s2s3_bgc=tempr - - tString='rf_s3s1_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s3s1_bgc=tempr - - tString='rf_cwdl2_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_cwdl2_bgc=tempr - - tString='rf_cwdl3_bgc' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_cwdl3_bgc=tempr - - tString='cwd_fcel' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_fcel_bgc=tempr - - tString='k_frag' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_frag_bgc=tempr - - tString='minpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%minpsi_bgc=tempr - - tString='maxpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%maxpsi_bgc=tempr - - tString='cwd_flig' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_flig_bgc=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine init_decompcascade_bgc(bounds, soilbiogeochem_state_inst, soilstate_inst ) - ! - ! !DESCRIPTION: - ! initialize rate constants and decomposition pathways following the decomposition cascade of the BGC model. - ! written by C. Koven - ! - ! !USES: - use clm_time_manager , only : get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilstate_type) , intent(in) :: soilstate_inst - ! - ! !LOCAL VARIABLES - !-- properties of each decomposing pool - real(r8) :: rf_l1s1 - real(r8) :: rf_l2s1 - real(r8) :: rf_l3s2 - !real(r8) :: rf_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) - !real(r8) :: rf_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8), allocatable :: rf_s1s2(:,:) - real(r8), allocatable :: rf_s1s3(:,:) - real(r8) :: rf_s2s1 - real(r8) :: rf_s2s3 - real(r8) :: rf_s3s1 - real(r8) :: rf_cwdl2 - real(r8) :: rf_cwdl3 - real(r8) :: cwd_fcel - real(r8) :: cwd_flig - real(r8) :: cn_s1 - real(r8) :: cn_s2 - real(r8) :: cn_s3 - !real(r8) :: f_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) - !real(r8) :: f_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8), allocatable :: f_s1s2(:,:) - real(r8), allocatable :: f_s1s3(:,:) - real(r8) :: f_s2s1 - real(r8) :: f_s2s3 - - integer :: i_l1s1 - integer :: i_l2s1 - integer :: i_l3s2 - integer :: i_s1s2 - integer :: i_s1s3 - integer :: i_s2s1 - integer :: i_s2s3 - integer :: i_s3s1 - integer :: i_cwdl2 - integer :: i_cwdl3 - real(r8):: speedup_fac ! acceleration factor, higher when vertsoilc = .true. - - integer :: c, j ! indices - real(r8) :: t ! temporary variable - !----------------------------------------------------------------------- - - associate( & - rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac) - pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac) - - cellsand => soilstate_inst%cellsand_col , & ! Input: [real(r8) (:,:) ] column 3D sand - - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Output: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Output: [integer (:) ] which pool is C added to for a given decomposition step - floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Output: [logical (:) ] TRUE => pool has fixed C:N ratio - is_litter => decomp_cascade_con%is_litter , & ! Output: [logical (:) ] TRUE => pool is a litter pool - is_soil => decomp_cascade_con%is_soil , & ! Output: [logical (:) ] TRUE => pool is a soil pool - is_cwd => decomp_cascade_con%is_cwd , & ! Output: [logical (:) ] TRUE => pool is a cwd pool - initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Output: [real(r8) (:) ] c:n ratio for initialization of pools - initial_stock => decomp_cascade_con%initial_stock , & ! Output: [real(r8) (:) ] initial concentration for seeding at spinup - initial_stock_soildepth => decomp_cascade_con%initial_stock_soildepth , & ! Output: [real(r8) (:) ] soil depth for initial concentration for seeding at spinup - is_metabolic => decomp_cascade_con%is_metabolic , & ! Output: [logical (:) ] TRUE => pool is metabolic material - is_cellulose => decomp_cascade_con%is_cellulose , & ! Output: [logical (:) ] TRUE => pool is cellulose - is_lignin => decomp_cascade_con%is_lignin , & ! Output: [logical (:) ] TRUE => pool is lignin - spinup_factor => decomp_cascade_con%spinup_factor & ! Output: [real(r8) (:) ] factor for AD spinup associated with each pool - - ) - - allocate(rf_s1s2(bounds%begc:bounds%endc,1:nlevdecomp)) - allocate(rf_s1s3(bounds%begc:bounds%endc,1:nlevdecomp)) - allocate(f_s1s2(bounds%begc:bounds%endc,1:nlevdecomp)) - allocate(f_s1s3(bounds%begc:bounds%endc,1:nlevdecomp)) - - !------- time-constant coefficients ---------- ! - ! set soil organic matter compartment C:N ratios - cn_s1 = params_inst%cn_s1_bgc - cn_s2 = params_inst%cn_s2_bgc - cn_s3 = params_inst%cn_s3_bgc - - ! set respiration fractions for fluxes between compartments - rf_l1s1 = params_inst%rf_l1s1_bgc - rf_l2s1 = params_inst%rf_l2s1_bgc - rf_l3s2 = params_inst%rf_l3s2_bgc - rf_s2s1 = params_inst%rf_s2s1_bgc - rf_s2s3 = params_inst%rf_s2s3_bgc - rf_s3s1 = params_inst%rf_s3s1_bgc - - rf_cwdl2 = params_inst%rf_cwdl2_bgc - rf_cwdl3 = params_inst%rf_cwdl3_bgc - - ! set the cellulose and lignin fractions for coarse woody debris - cwd_fcel = params_inst%cwd_fcel_bgc - cwd_flig = params_inst%cwd_flig_bgc - - ! set path fractions - f_s2s1 = 0.42_r8/(0.45_r8) - f_s2s3 = 0.03_r8/(0.45_r8) - - ! some of these are dependent on the soil texture properties - do c = bounds%begc, bounds%endc - do j = 1, nlevdecomp - t = 0.85_r8 - 0.68_r8 * 0.01_r8 * (100._r8 - cellsand(c,j)) - f_s1s2(c,j) = 1._r8 - .004_r8 / (1._r8 - t) - f_s1s3(c,j) = .004_r8 / (1._r8 - t) - rf_s1s2(c,j) = t - rf_s1s3(c,j) = t - end do - end do - initial_stock_soildepth = params_inst%initial_Cstocks_depth - - !------------------- list of pools and their attributes ------------ - floating_cn_ratio_decomp_pools(i_litr1) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr1) = 'litr1' - decomp_cascade_con%decomp_pool_name_history(i_litr1) = 'LITR1' - decomp_cascade_con%decomp_pool_name_long(i_litr1) = 'litter 1' - decomp_cascade_con%decomp_pool_name_short(i_litr1) = 'L1' - is_litter(i_litr1) = .true. - is_soil(i_litr1) = .false. - is_cwd(i_litr1) = .false. - initial_cn_ratio(i_litr1) = 90._r8 - initial_stock(i_litr1) = 0._r8 - is_metabolic(i_litr1) = .true. - is_cellulose(i_litr1) = .false. - is_lignin(i_litr1) = .false. - - floating_cn_ratio_decomp_pools(i_litr2) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr2) = 'litr2' - decomp_cascade_con%decomp_pool_name_history(i_litr2) = 'LITR2' - decomp_cascade_con%decomp_pool_name_long(i_litr2) = 'litter 2' - decomp_cascade_con%decomp_pool_name_short(i_litr2) = 'L2' - is_litter(i_litr2) = .true. - is_soil(i_litr2) = .false. - is_cwd(i_litr2) = .false. - initial_cn_ratio(i_litr2) = 90._r8 - initial_stock(i_litr2) = 0._r8 - is_metabolic(i_litr2) = .false. - is_cellulose(i_litr2) = .true. - is_lignin(i_litr2) = .false. - - floating_cn_ratio_decomp_pools(i_litr3) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr3) = 'litr3' - decomp_cascade_con%decomp_pool_name_history(i_litr3) = 'LITR3' - decomp_cascade_con%decomp_pool_name_long(i_litr3) = 'litter 3' - decomp_cascade_con%decomp_pool_name_short(i_litr3) = 'L3' - is_litter(i_litr3) = .true. - is_soil(i_litr3) = .false. - is_cwd(i_litr3) = .false. - initial_cn_ratio(i_litr3) = 90._r8 - initial_stock(i_litr3) = 0._r8 - is_metabolic(i_litr3) = .false. - is_cellulose(i_litr3) = .false. - is_lignin(i_litr3) = .true. - - if (.not. use_fates) then - ! CWD - floating_cn_ratio_decomp_pools(i_cwd) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd' - decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD' - decomp_cascade_con%decomp_pool_name_long(i_cwd) = 'coarse woody debris' - decomp_cascade_con%decomp_pool_name_short(i_cwd) = 'CWD' - is_litter(i_cwd) = .false. - is_soil(i_cwd) = .false. - is_cwd(i_cwd) = .true. - initial_cn_ratio(i_cwd) = 90._r8 - initial_stock(i_cwd) = 0._r8 - is_metabolic(i_cwd) = .false. - is_cellulose(i_cwd) = .false. - is_lignin(i_cwd) = .false. - endif - - if (.not. use_fates) then - i_soil1 = 5 - else - i_soil1 = 4 - endif - floating_cn_ratio_decomp_pools(i_soil1) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil1) = 'soil1' - decomp_cascade_con%decomp_pool_name_history(i_soil1) = 'SOIL1' - decomp_cascade_con%decomp_pool_name_long(i_soil1) = 'soil 1' - decomp_cascade_con%decomp_pool_name_short(i_soil1) = 'S1' - is_litter(i_soil1) = .false. - is_soil(i_soil1) = .true. - is_cwd(i_soil1) = .false. - initial_cn_ratio(i_soil1) = cn_s1 - initial_stock(i_soil1) = params_inst%initial_Cstocks(1) - is_metabolic(i_soil1) = .false. - is_cellulose(i_soil1) = .false. - is_lignin(i_soil1) = .false. - - if (.not. use_fates) then - i_soil2 = 6 - else - i_soil2 = 5 - endif - floating_cn_ratio_decomp_pools(i_soil2) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil2) = 'soil2' - decomp_cascade_con%decomp_pool_name_history(i_soil2) = 'SOIL2' - decomp_cascade_con%decomp_pool_name_long(i_soil2) = 'soil 2' - decomp_cascade_con%decomp_pool_name_short(i_soil2) = 'S2' - is_litter(i_soil2) = .false. - is_soil(i_soil2) = .true. - is_cwd(i_soil2) = .false. - initial_cn_ratio(i_soil2) = cn_s2 - initial_stock(i_soil2) = params_inst%initial_Cstocks(2) - is_metabolic(i_soil2) = .false. - is_cellulose(i_soil2) = .false. - is_lignin(i_soil2) = .false. - - if (.not. use_fates) then - i_soil3 = 7 - else - i_soil3 = 6 - endif - floating_cn_ratio_decomp_pools(i_soil3) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil3) = 'soil3' - decomp_cascade_con%decomp_pool_name_history(i_soil3) = 'SOIL3' - decomp_cascade_con%decomp_pool_name_long(i_soil3) = 'soil 3' - decomp_cascade_con%decomp_pool_name_short(i_soil3) = 'S3' - is_litter(i_soil3) = .false. - is_soil(i_soil3) = .true. - is_cwd(i_soil3) = .false. - initial_cn_ratio(i_soil3) = cn_s3 - initial_stock(i_soil3) = params_inst%initial_Cstocks(3) - is_metabolic(i_soil3) = .false. - is_cellulose(i_soil3) = .false. - is_lignin(i_soil3) = .false. - - - speedup_fac = 1._r8 - - !lit1 - spinup_factor(i_litr1) = 1._r8 - !lit2,3 - spinup_factor(i_litr2) = 1._r8 - spinup_factor(i_litr3) = 1._r8 - !CWD - if (.not. use_fates) then - spinup_factor(i_cwd) = max(1._r8, (speedup_fac * params_inst%tau_cwd_bgc / 2._r8 )) - end if - !som1 - spinup_factor(i_soil1) = 1._r8 - !som2,3 - spinup_factor(i_soil2) = max(1._r8, (speedup_fac * params_inst%tau_s2_bgc)) - spinup_factor(i_soil3) = max(1._r8, (speedup_fac * params_inst%tau_s3_bgc)) - - if ( masterproc ) then - write(iulog,*) 'Spinup_state ',spinup_state - write(iulog,*) 'Spinup factors ',spinup_factor - end if - - !---------------- list of transitions and their time-independent coefficients ---------------! - i_l1s1 = 1 - decomp_cascade_con%cascade_step_name(i_l1s1) = 'L1S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = rf_l1s1 - cascade_donor_pool(i_l1s1) = i_litr1 - cascade_receiver_pool(i_l1s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = 1.0_r8 - - i_l2s1 = 2 - decomp_cascade_con%cascade_step_name(i_l2s1) = 'L2S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1) = rf_l2s1 - cascade_donor_pool(i_l2s1) = i_litr2 - cascade_receiver_pool(i_l2s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s1)= 1.0_r8 - - i_l3s2 = 3 - decomp_cascade_con%cascade_step_name(i_l3s2) = 'L3S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = rf_l3s2 - cascade_donor_pool(i_l3s2) = i_litr3 - cascade_receiver_pool(i_l3s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s2) = 1.0_r8 - - i_s1s2 = 4 - decomp_cascade_con%cascade_step_name(i_s1s2) = 'S1S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = rf_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) - cascade_donor_pool(i_s1s2) = i_soil1 - cascade_receiver_pool(i_s1s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = f_s1s2(bounds%begc:bounds%endc,1:nlevdecomp) - - i_s1s3 = 5 - decomp_cascade_con%cascade_step_name(i_s1s3) = 'S1S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = rf_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) - cascade_donor_pool(i_s1s3) = i_soil1 - cascade_receiver_pool(i_s1s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s3) = f_s1s3(bounds%begc:bounds%endc,1:nlevdecomp) - - i_s2s1 = 6 - decomp_cascade_con%cascade_step_name(i_s2s1) = 'S2S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = rf_s2s1 - cascade_donor_pool(i_s2s1) = i_soil2 - cascade_receiver_pool(i_s2s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s1) = f_s2s1 - - i_s2s3 = 7 - decomp_cascade_con%cascade_step_name(i_s2s3) = 'S2S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = rf_s2s3 - cascade_donor_pool(i_s2s3) = i_soil2 - cascade_receiver_pool(i_s2s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = f_s2s3 - - i_s3s1 = 8 - decomp_cascade_con%cascade_step_name(i_s3s1) = 'S3S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = rf_s3s1 - cascade_donor_pool(i_s3s1) = i_soil3 - cascade_receiver_pool(i_s3s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s1) = 1.0_r8 - - if (.not. use_fates) then - i_cwdl2 = 9 - decomp_cascade_con%cascade_step_name(i_cwdl2) = 'CWDL2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = rf_cwdl2 - cascade_donor_pool(i_cwdl2) = i_cwd - cascade_receiver_pool(i_cwdl2) = i_litr2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = cwd_fcel - - i_cwdl3 = 10 - decomp_cascade_con%cascade_step_name(i_cwdl3) = 'CWDL3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = rf_cwdl3 - cascade_donor_pool(i_cwdl3) = i_cwd - cascade_receiver_pool(i_cwdl3) = i_litr3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = cwd_flig - end if - - deallocate(rf_s1s2) - deallocate(rf_s1s3) - deallocate(f_s1s2) - deallocate(f_s1s3) - - end associate - - end subroutine init_decompcascade_bgc - - !----------------------------------------------------------------------- - subroutine decomp_rate_constants_bgc(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - ! - ! !DESCRIPTION: - ! calculate rate constants and decomposition pathways for the CENTURY decomposition cascade model - ! written by C. Koven based on original CLM4 decomposition cascade - ! - ! !USES: - use clm_time_manager , only : get_days_per_year - use shr_const_mod , only : SHR_CONST_PI - use clm_varcon , only : secspday - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(ch4_type) , intent(in) :: ch4_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - ! - ! !LOCAL VARIABLES: - real(r8):: frw(bounds%begc:bounds%endc) ! rooting fraction weight - real(r8), allocatable:: fr(:,:) ! column-level rooting fraction by soil depth - real(r8):: psi ! temporary soilpsi for water scalar - real(r8):: rate_scalar ! combined rate scalar for decomp - real(r8):: k_l1 ! decomposition rate constant litter 1 (1/sec) - real(r8):: k_l2_l3 ! decomposition rate constant litter 2 and litter 3 (1/sec) - real(r8):: k_s1 ! decomposition rate constant SOM 1 (1/sec) - real(r8):: k_s2 ! decomposition rate constant SOM 2 (1/sec) - real(r8):: k_s3 ! decomposition rate constant SOM 3 (1/sec) - real(r8):: k_frag ! fragmentation rate constant CWD (1/sec) - real(r8):: tau_l1 ! turnover time of litter 1 (yr) - real(r8):: tau_l2_l3 ! turnover time of litter 2 and litter 3 (yr) - real(r8):: tau_l3 ! turnover time of litter 3 (yr) - real(r8):: tau_s1 ! turnover time of SOM 1 (yr) - real(r8):: tau_s2 ! turnover time of SOM 2 (yr) - real(r8):: tau_s3 ! turnover time of SOM 3 (yr) - real(r8):: tau_cwd ! corrected fragmentation rate constant CWD - real(r8):: cwdc_loss ! fragmentation rate for CWD carbon (gC/m2/s) - real(r8):: cwdn_loss ! fragmentation rate for CWD nitrogen (gN/m2/s) - real(r8):: Q10 ! temperature dependence - real(r8):: froz_q10 ! separate q10 for frozen soil respiration rates. default to same as above zero rates - real(r8):: decomp_depth_efolding ! (meters) e-folding depth for reduction in decomposition [ - integer :: c, fc, j, k, l - real(r8):: catanf ! hyperbolic temperature function from CENTURY - real(r8):: catanf_30 ! reference rate at 30C - real(r8):: t1 ! temperature argument - real(r8):: normalization_factor ! factor by which to offset the decomposition rates frm century to a q10 formulation - real(r8):: days_per_year ! days per year - real(r8):: depth_scalar(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8):: mino2lim !minimum anaerobic decomposition rate - real(r8):: spinup_geogterm_l1(bounds%begc:bounds%endc) ! geographically-varying spinup term for l1 - real(r8):: spinup_geogterm_l23(bounds%begc:bounds%endc) ! geographically-varying spinup term for l2 and l3 - real(r8):: spinup_geogterm_cwd(bounds%begc:bounds%endc) ! geographically-varying spinup term for cwd - real(r8):: spinup_geogterm_s1(bounds%begc:bounds%endc) ! geographically-varying spinup term for s1 - real(r8):: spinup_geogterm_s2(bounds%begc:bounds%endc) ! geographically-varying spinup term for s2 - real(r8):: spinup_geogterm_s3(bounds%begc:bounds%endc) ! geographically-varying spinup term for s3 - - !----------------------------------------------------------------------- - - !----- CENTURY T response function - catanf(t1) = 11.75_r8 +(29.7_r8 / SHR_CONST_PI) * atan( SHR_CONST_PI * 0.031_r8 * ( t1 - 15.4_r8 )) - - associate( & - minpsi => params_inst%minpsi_bgc , & ! Input: [real(r8) ] minimum soil suction (mm) - maxpsi => params_inst%maxpsi_bgc , & ! Input: [real(r8) ] maximum soil suction (mm) - soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - - alt_indx => canopystate_inst%alt_indx_col , & ! Input: [integer (:) ] current depth of thaw - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - o2stress_sat => ch4_inst%o2stress_sat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - o2stress_unsat => ch4_inst%o2stress_unsat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area - - t_scalar => soilbiogeochem_carbonflux_inst%t_scalar_col , & ! Output: [real(r8) (:,:) ] soil temperature scalar for decomp - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Output: [real(r8) (:,:) ] soil water scalar for decomp - o_scalar => soilbiogeochem_carbonflux_inst%o_scalar_col , & ! Output: [real(r8) (:,:) ] fraction by which decomposition is limited by anoxia - decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) - spinup_factor => decomp_cascade_con%spinup_factor & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool - ) - - mino2lim = CNParamsShareInst%mino2lim - - if ( use_century_tfunc .and. normalize_q10_to_century_tfunc ) then - call endrun(msg='ERROR: cannot have both use_century_tfunc and normalize_q10_to_century_tfunc set as true'//& - errMsg(sourcefile, __LINE__)) - endif - - days_per_year = get_days_per_year() - - ! the belowground parameters from century - tau_l1 = 1./18.5 - tau_l2_l3 = 1./4.9 - tau_s1 = 1./7.3 - tau_s2 = 1./0.2 - tau_s3 = 1./.0045 - - ! century leaves wood decomposition rates open, within range of 0 - 0.5 yr^-1 - tau_cwd = 1./0.3 - - ! Todo: FIX(SPM,032414) - the explicit divide gives different results than when that - ! value is placed in the parameters netcdf file. To get bfb, keep the - ! divide in source. - - !tau_l1 = params_inst%tau_l1_bgc - !tau_l2_l3 = params_inst%tau_l2_l3_bgc - !tau_s1 = params_inst%tau_s1_bgc - !tau_s2 = params_inst%tau_s2_bgc - !tau_s3 = params_inst%tau_s3_bgc - - !set turnover rate of coarse woody debris - !tau_cwd = params_inst%tau_cwd_bgc - - ! set "Q10" parameter - Q10 = CNParamsShareInst%Q10 - - ! set "froz_q10" parameter - froz_q10 = CNParamsShareInst%froz_q10 - - ! Set "decomp_depth_efolding" parameter - decomp_depth_efolding = CNParamsShareInst%decomp_depth_efolding - - ! translate to per-second time constant - k_l1 = 1._r8 / (secspday * days_per_year * tau_l1) - k_l2_l3 = 1._r8 / (secspday * days_per_year * tau_l2_l3) - k_s1 = 1._r8 / (secspday * days_per_year * tau_s1) - k_s2 = 1._r8 / (secspday * days_per_year * tau_s2) - k_s3 = 1._r8 / (secspday * days_per_year * tau_s3) - k_frag = 1._r8 / (secspday * days_per_year * tau_cwd) - - ! calc ref rate - catanf_30 = catanf(30._r8) - - if ( spinup_state >= 1 ) then - do fc = 1,num_soilc - c = filter_soilc(fc) - ! - if ( abs(spinup_factor(i_litr1) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_l1(c) = spinup_factor(i_litr1) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_l1(c) = 1._r8 - endif - ! - if ( abs(spinup_factor(i_litr2) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_l23(c) = spinup_factor(i_litr2) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_l23(c) = 1._r8 - endif - ! - if ( .not. use_fates ) then - if ( abs(spinup_factor(i_cwd) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_cwd(c) = spinup_factor(i_cwd) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_cwd(c) = 1._r8 - endif - endif - ! - if ( abs(spinup_factor(i_soil1) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s1(c) = spinup_factor(i_soil1) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_s1(c) = 1._r8 - endif - ! - if ( abs(spinup_factor(i_soil2) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s2(c) = spinup_factor(i_soil2) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_s2(c) = 1._r8 - endif - ! - if ( abs(spinup_factor(i_soil3) - 1._r8) .gt. .000001_r8) then - spinup_geogterm_s3(c) = spinup_factor(i_soil3) * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - spinup_geogterm_s3(c) = 1._r8 - endif - ! - end do - else - do fc = 1,num_soilc - c = filter_soilc(fc) - spinup_geogterm_l1(c) = 1._r8 - spinup_geogterm_l23(c) = 1._r8 - spinup_geogterm_cwd(c) = 1._r8 - spinup_geogterm_s1(c) = 1._r8 - spinup_geogterm_s2(c) = 1._r8 - spinup_geogterm_s3(c) = 1._r8 - end do - endif - - !--- time dependent coefficients-----! - if ( nlevdecomp .eq. 1 ) then - - ! calculate function to weight the temperature and water potential scalars - ! for decomposition control. - - - ! the following normalizes values in fr so that they - ! sum to 1.0 across top nlevdecomp levels on a column - frw(bounds%begc:bounds%endc) = 0._r8 - nlev_soildecomp_standard=5 - allocate(fr(bounds%begc:bounds%endc,nlev_soildecomp_standard)) - do j=1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - frw(c) = frw(c) + col%dz(c,j) - end do - end do - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (frw(c) /= 0._r8) then - fr(c,j) = col%dz(c,j) / frw(c) - else - fr(c,j) = 0._r8 - end if - end do - end do - - if ( .not. use_century_tfunc ) then - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) t_scalar(c,:) = 0._r8 - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - else - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8))*fr(c,j) - endif - end do - end do - - else - ! original century uses an arctangent function to calculate the temperature dependence of decomposition - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) t_scalar(c,:) = 0._r8 - - t_scalar(c,1)=t_scalar(c,1) +max(catanf(t_soisno(c,j)-SHR_CONST_TKFRZ)/catanf_30*fr(c,j),0.01_r8) - end do - end do - - endif - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) w_scalar(c,:) = 0._r8 - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,1) = w_scalar(c,1) + (log(minpsi/psi)/log(minpsi/maxpsi))*fr(c,j) - end if - end do - end do - - if (use_lch4) then - if (anoxia_wtsat) then ! Adjust for saturated fraction if unfrozen - do fc = 1,num_soilc - c = filter_soilc(fc) - if (alt_indx(c) >= nlev_soildecomp_standard .and. t_soisno(c,1) > SHR_CONST_TKFRZ) then - w_scalar(c,1) = w_scalar(c,1)*(1._r8 - finundated(c)) + finundated(c) - end if - end do - end if - end if - - if (use_lch4) then - ! Calculate ANOXIA - if (anoxia) then - ! Check for anoxia w/o LCH4 now done in controlMod. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (j==1) o_scalar(c,:) = 0._r8 - - if (.not. anoxia_wtsat) then - o_scalar(c,1) = o_scalar(c,1) + fr(c,j) * max(o2stress_unsat(c,j), mino2lim) - else - o_scalar(c,1) = o_scalar(c,1) + fr(c,j) * & - (max(o2stress_unsat(c,j), mino2lim)*(1._r8 - finundated(c)) + & - max(o2stress_sat(c,j), mino2lim)*finundated(c) ) - end if - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - deallocate(fr) - - else - - if ( .not. use_century_tfunc ) then - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,j)= (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8)) - else - t_scalar(c,j)= (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8)) - endif - end do - end do - - else - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - t_scalar(c,j)= max(catanf(t_soisno(c,j)-SHR_CONST_TKFRZ)/catanf_30, 0.01_r8) - end do - end do - - endif - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,j) = (log(minpsi/psi)/log(minpsi/maxpsi)) - else - w_scalar(c,j) = 0._r8 - end if - if (use_lch4) then - if (anoxia_wtsat .and. t_soisno(c,j) > SHR_CONST_TKFRZ) then ! wet area will have w_scalar of 1 if unfrozen - w_scalar(c,j) = w_scalar(c,j)*(1._r8 - finundated(c)) + finundated(c) - end if - end if - end do - end do - - if (use_lch4) then - ! Calculate ANOXIA - ! Check for anoxia w/o LCH4 now done in controlMod. - - if (anoxia) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (.not. anoxia_wtsat) then - o_scalar(c,j) = max(o2stress_unsat(c,j), mino2lim) - else - o_scalar(c,j) = max(o2stress_unsat(c,j), mino2lim) * (1._r8 - finundated(c)) + & - max(o2stress_sat(c,j), mino2lim) * finundated(c) - end if - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - end if - - if ( normalize_q10_to_century_tfunc ) then - ! scale all decomposition rates by a constant to compensate for offset between original CENTURY temp func and Q10 - normalization_factor = (catanf(normalization_tref)/catanf_30) / (q10**((normalization_tref-25._r8)/10._r8)) - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - t_scalar(c,j) = t_scalar(c,j) * normalization_factor - end do - end do - endif - - if (use_vertsoilc) then - ! add a term to reduce decomposition rate at depth - ! for now used a fixed e-folding depth - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - depth_scalar(c,j) = exp(-zsoi(j)/decomp_depth_efolding) - end do - end do - end if - - ! calculate rate constants for all litter and som pools - if (use_vertsoilc) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_l1(c) - decomp_k(c,j,i_litr2) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_l23(c) - decomp_k(c,j,i_litr3) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_l23(c) - decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_s1(c) - decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_s2(c) - decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) & - * spinup_geogterm_s3(c) - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l1(c) - decomp_k(c,j,i_litr2) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) - decomp_k(c,j,i_litr3) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) - decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s1(c) - decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s2(c) - decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s3(c) - end do - end do - end if - - ! do the same for cwd, but only if fates is not enabled, because fates handles CWD on its own structure - if (.not. use_fates) then - if (use_vertsoilc) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * & - o_scalar(c,j) * spinup_geogterm_cwd(c) - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * & - o_scalar(c,j) * spinup_geogterm_cwd(c) - end do - end do - end if - end if - - end associate - - end subroutine decomp_rate_constants_bgc - -end module SoilBiogeochemDecompCascadeBGCMod diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 deleted file mode 100644 index 4ae36155f2..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeCNMod.F90 +++ /dev/null @@ -1,952 +0,0 @@ -module SoilBiogeochemDecompCascadeCNMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Sets the coeffiecients used in the decomposition cascade submodel. - ! This uses the CN parameters as in CLMCN 4.0 - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevsoi, nlevgrnd, nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use clm_varctl , only : iulog, spinup_state, anoxia, use_lch4, use_vertsoilc, use_fates - use clm_varcon , only : zsoi - use decompMod , only : bounds_type - use abortutils , only : endrun - use CNSharedParamsMod , only : CNParamsShareInst, anoxia_wtsat, nlev_soildecomp_standard - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilStateType , only : soilstate_type - use CanopyStateType , only : canopystate_type - use TemperatureType , only : temperature_type - use ch4Mod , only : ch4_type - use ColumnType , only : col - - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: init_decompcascade_cn - public :: decomp_rate_constants_cn - - type, private :: params_type - real(r8):: cn_s1_cn !C:N for SOM 1 - real(r8):: cn_s2_cn !C:N for SOM 2 - real(r8):: cn_s3_cn !C:N for SOM 3 - real(r8):: cn_s4_cn !C:N for SOM 4 - - real(r8):: rf_l1s1_cn !respiration fraction litter 1 -> SOM 1 - real(r8):: rf_l2s2_cn !respiration fraction litter 2 -> SOM 2 - real(r8):: rf_l3s3_cn !respiration fraction litter 3 -> SOM 3 - real(r8):: rf_s1s2_cn !respiration fraction SOM 1 -> SOM 2 - real(r8):: rf_s2s3_cn !respiration fraction SOM 2 -> SOM 3 - real(r8):: rf_s3s4_cn !respiration fraction SOM 3 -> SOM 4 - - real(r8) :: cwd_fcel_cn !cellulose fraction for CWD - real(r8) :: cwd_flig_cn ! - - real(r8) :: k_l1_cn !decomposition rate for litter 1 - real(r8) :: k_l2_cn !decomposition rate for litter 2 - real(r8) :: k_l3_cn !decomposition rate for litter 3 - real(r8) :: k_s1_cn !decomposition rate for SOM 1 - real(r8) :: k_s2_cn !decomposition rate for SOM 2 - real(r8) :: k_s3_cn !decomposition rate for SOM 3 - real(r8) :: k_s4_cn !decomposition rate for SOM 4 - - real(r8) :: k_frag_cn !fragmentation rate for CWD - real(r8) :: minpsi_cn !minimum soil water potential for heterotrophic resp - real(r8) :: maxpsi_cn !maximum soil water potential for heterotrophic resp - - integer :: nsompools = 4 - real(r8), allocatable :: spinup_vector(:) ! multipliers for soil decomp during accelerated spinup - - end type params_type - ! - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !CALLED FROM: readParamsMod.F90::CNParamsReadFile - ! - ! !REVISION HISTORY: - ! Dec 3 2012 : Created by S. Muszala - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'SoilBiogeochemDecompCnParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - - !EOP - !----------------------------------------------------------------------- - - ! These are not read off of netcdf file - allocate(params_inst%spinup_vector(params_inst%nsompools)) - params_inst%spinup_vector(:) = (/ 1.0_r8, 1.0_r8, 5.0_r8, 70.0_r8 /) - - ! Read off of netcdf file - tString='cn_s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s1_cn=tempr - - tString='cn_s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s2_cn=tempr - - tString='cn_s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s3_cn=tempr - - tString='cn_s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cn_s4_cn=tempr - - tString='rf_l1s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l1s1_cn=tempr - - tString='rf_l2s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l2s2_cn=tempr - - tString='rf_l3s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_l3s3_cn=tempr - - tString='rf_s1s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s1s2_cn=tempr - - tString='rf_s2s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s2s3_cn=tempr - - tString='rf_s3s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rf_s3s4_cn=tempr - - tString='cwd_fcel' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_fcel_cn=tempr - - tString='k_l1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l1_cn=tempr - - tString='k_l2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l2_cn=tempr - - tString='k_l3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_l3_cn=tempr - - tString='k_s1' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s1_cn=tempr - - tString='k_s2' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s2_cn=tempr - - tString='k_s3' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s3_cn=tempr - - tString='k_s4' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_s4_cn=tempr - - tString='k_frag' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_frag_cn=tempr - - tString='minpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%minpsi_cn=tempr - - tString='maxpsi_hr' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%maxpsi_cn=tempr - - tString='cwd_flig' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%cwd_flig_cn=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine init_decompcascade_cn(bounds, soilbiogeochem_state_inst) - ! - ! !DESCRIPTION: - ! initialize rate constants and decomposition pathways for the BGC model originally implemented in CLM-CN - ! written by C. Koven based on original CLM4 decomposition cascade by P. Thornton - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - ! - !-- properties of each pathway along decomposition cascade - !-- properties of each decomposing pool - real(r8) :: rf_l1s1 !respiration fraction litter 1 -> SOM 1 - real(r8) :: rf_l2s2 !respiration fraction litter 2 -> SOM 2 - real(r8) :: rf_l3s3 !respiration fraction litter 3 -> SOM 3 - real(r8) :: rf_s1s2 !respiration fraction SOM 1 -> SOM 2 - real(r8) :: rf_s2s3 !respiration fraction SOM 2 -> SOM 3 - real(r8) :: rf_s3s4 !respiration fraction SOM 3 -> SOM 4 - real(r8) :: cwd_fcel - real(r8) :: cwd_flig - real(r8) :: cn_s1 - real(r8) :: cn_s2 - real(r8) :: cn_s3 - real(r8) :: cn_s4 - - integer :: i_litr1 - integer :: i_litr2 - integer :: i_litr3 - integer :: i_soil1 - integer :: i_soil2 - integer :: i_soil3 - integer :: i_soil4 - integer :: i_atm - integer :: i_l1s1 - integer :: i_l2s2 - integer :: i_l3s3 - integer :: i_s1s2 - integer :: i_s2s3 - integer :: i_s3s4 - integer :: i_s4atm - integer :: i_cwdl2 - integer :: i_cwdl3 - !----------------------------------------------------------------------- - - associate( & - rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Output: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac) - pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Output: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac) - - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Output: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Output: [integer (:) ] which pool is C added to for a given decomposition step - floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Output: [logical (:) ] TRUE => pool has fixed C:N ratio - is_litter => decomp_cascade_con%is_litter , & ! Output: [logical (:) ] TRUE => pool is a litter pool - is_soil => decomp_cascade_con%is_soil , & ! Output: [logical (:) ] TRUE => pool is a soil pool - is_cwd => decomp_cascade_con%is_cwd , & ! Output: [logical (:) ] TRUE => pool is a cwd pool - initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Output: [real(r8) (:) ] c:n ratio for initialization of pools - initial_stock => decomp_cascade_con%initial_stock , & ! Output: [real(r8) (:) ] initial concentration for seeding at spinup - is_metabolic => decomp_cascade_con%is_metabolic , & ! Output: [logical (:) ] TRUE => pool is metabolic material - is_cellulose => decomp_cascade_con%is_cellulose , & ! Output: [logical (:) ] TRUE => pool is cellulose - is_lignin => decomp_cascade_con%is_lignin , & ! Output: [logical (:) ] TRUE => pool is lignin - spinup_factor => decomp_cascade_con%spinup_factor & ! Output: [real(r8) (:) ] factor for AD spinup associated with each pool - ) - - !------- time-constant coefficients ---------- ! - ! set soil organic matter compartment C:N ratios (from Biome-BGC v4.2.0) - cn_s1=params_inst%cn_s1_cn - cn_s2=params_inst%cn_s2_cn - cn_s3=params_inst%cn_s3_cn - cn_s4=params_inst%cn_s4_cn - - ! set respiration fractions for fluxes between compartments - ! (from Biome-BGC v4.2.0) - rf_l1s1=params_inst%rf_l1s1_cn - rf_l2s2=params_inst%rf_l2s2_cn - rf_l3s3=params_inst%rf_l3s3_cn - rf_s1s2=params_inst%rf_s1s2_cn - rf_s2s3=params_inst%rf_s2s3_cn - rf_s3s4=params_inst%rf_s3s4_cn - - ! set the cellulose and lignin fractions for coarse woody debris - cwd_fcel=params_inst%cwd_fcel_cn - cwd_flig=params_inst%cwd_flig_cn - - !------------------- list of pools and their attributes ------------ - - i_litr1 = i_met_lit - floating_cn_ratio_decomp_pools(i_litr1) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr1) = 'litr1' - decomp_cascade_con%decomp_pool_name_history(i_litr1) = 'LITR1' - decomp_cascade_con%decomp_pool_name_long(i_litr1) = 'litter 1' - decomp_cascade_con%decomp_pool_name_short(i_litr1) = 'L1' - is_litter(i_litr1) = .true. - is_soil(i_litr1) = .false. - is_cwd(i_litr1) = .false. - initial_cn_ratio(i_litr1) = 90._r8 - initial_stock(i_litr1) = 0._r8 - is_metabolic(i_litr1) = .true. - is_cellulose(i_litr1) = .false. - is_lignin(i_litr1) = .false. - - i_litr2 = i_cel_lit - floating_cn_ratio_decomp_pools(i_litr2) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr2) = 'litr2' - decomp_cascade_con%decomp_pool_name_history(i_litr2) = 'LITR2' - decomp_cascade_con%decomp_pool_name_long(i_litr2) = 'litter 2' - decomp_cascade_con%decomp_pool_name_short(i_litr2) = 'L2' - is_litter(i_litr2) = .true. - is_soil(i_litr2) = .false. - is_cwd(i_litr2) = .false. - initial_cn_ratio(i_litr2) = 90._r8 - initial_stock(i_litr2) = 0._r8 - is_metabolic(i_litr2) = .false. - is_cellulose(i_litr2) = .true. - is_lignin(i_litr2) = .false. - - i_litr3 = i_lig_lit - floating_cn_ratio_decomp_pools(i_litr3) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_litr3) = 'litr3' - decomp_cascade_con%decomp_pool_name_history(i_litr3) = 'LITR3' - decomp_cascade_con%decomp_pool_name_long(i_litr3) = 'litter 3' - decomp_cascade_con%decomp_pool_name_short(i_litr3) = 'L3' - is_litter(i_litr3) = .true. - is_soil(i_litr3) = .false. - is_cwd(i_litr3) = .false. - initial_cn_ratio(i_litr3) = 90._r8 - initial_stock(i_litr3) = 0._r8 - is_metabolic(i_litr3) = .false. - is_cellulose(i_litr3) = .false. - is_lignin(i_litr3) = .true. - - if (.not. use_fates) then - floating_cn_ratio_decomp_pools(i_cwd) = .true. - decomp_cascade_con%decomp_pool_name_restart(i_cwd) = 'cwd' - decomp_cascade_con%decomp_pool_name_history(i_cwd) = 'CWD' - decomp_cascade_con%decomp_pool_name_long(i_cwd) = 'coarse woody debris' - decomp_cascade_con%decomp_pool_name_short(i_cwd) = 'CWD' - is_litter(i_cwd) = .false. - is_soil(i_cwd) = .false. - is_cwd(i_cwd) = .true. - initial_cn_ratio(i_cwd) = 500._r8 - initial_stock(i_cwd) = 0._r8 - is_metabolic(i_cwd) = .false. - is_cellulose(i_cwd) = .false. - is_lignin(i_cwd) = .false. - end if - - if ( .not. use_fates ) then - i_soil1 = 5 - else - i_soil1 = 4 - endif - floating_cn_ratio_decomp_pools(i_soil1) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil1) = 'soil1' - decomp_cascade_con%decomp_pool_name_history(i_soil1) = 'SOIL1' - decomp_cascade_con%decomp_pool_name_long(i_soil1) = 'soil 1' - decomp_cascade_con%decomp_pool_name_short(i_soil1) = 'S1' - is_litter(i_soil1) = .false. - is_soil(i_soil1) = .true. - is_cwd(i_soil1) = .false. - initial_cn_ratio(i_soil1) = cn_s1 - initial_stock(i_soil1) = 0._r8 - is_metabolic(i_soil1) = .false. - is_cellulose(i_soil1) = .false. - is_lignin(i_soil1) = .false. - - if ( .not. use_fates ) then - i_soil2 = 6 - else - i_soil2 = 5 - endif - floating_cn_ratio_decomp_pools(i_soil2) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil2) = 'soil2' - decomp_cascade_con%decomp_pool_name_history(i_soil2) = 'SOIL2' - decomp_cascade_con%decomp_pool_name_long(i_soil2) = 'soil 2' - decomp_cascade_con%decomp_pool_name_short(i_soil2) = 'S2' - is_litter(i_soil2) = .false. - is_soil(i_soil2) = .true. - is_cwd(i_soil2) = .false. - initial_cn_ratio(i_soil2) = cn_s2 - initial_stock(i_soil2) = 0._r8 - is_metabolic(i_soil2) = .false. - is_cellulose(i_soil2) = .false. - is_lignin(i_soil2) = .false. - - if ( .not. use_fates ) then - i_soil3 = 7 - else - i_soil3 = 6 - endif - floating_cn_ratio_decomp_pools(i_soil3) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil3) = 'soil3' - decomp_cascade_con%decomp_pool_name_history(i_soil3) = 'SOIL3' - decomp_cascade_con%decomp_pool_name_long(i_soil3) = 'soil 3' - decomp_cascade_con%decomp_pool_name_short(i_soil3) = 'S3' - is_litter(i_soil3) = .false. - is_soil(i_soil3) = .true. - is_cwd(i_soil3) = .false. - initial_cn_ratio(i_soil3) = cn_s3 - initial_stock(i_soil3) = 0._r8 - is_metabolic(i_soil3) = .false. - is_cellulose(i_soil3) = .false. - is_lignin(i_soil3) = .false. - - if ( .not. use_fates ) then - i_soil4 = 8 - else - i_soil4 = 7 - endif - floating_cn_ratio_decomp_pools(i_soil4) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_soil4) = 'soil4' - decomp_cascade_con%decomp_pool_name_history(i_soil4) = 'SOIL4' - decomp_cascade_con%decomp_pool_name_long(i_soil4) = 'soil 4' - decomp_cascade_con%decomp_pool_name_short(i_soil4) = 'S4' - is_litter(i_soil4) = .false. - is_soil(i_soil4) = .true. - is_cwd(i_soil4) = .false. - initial_cn_ratio(i_soil4) = cn_s4 - initial_stock(i_soil4) = 10._r8 - is_metabolic(i_soil4) = .false. - is_cellulose(i_soil4) = .false. - is_lignin(i_soil4) = .false. - - i_atm = 0 !! for terminal pools (i.e. 100% respiration) - floating_cn_ratio_decomp_pools(i_atm) = .false. - decomp_cascade_con%decomp_pool_name_restart(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_history(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_long(i_atm) = 'atmosphere' - decomp_cascade_con%decomp_pool_name_short(i_atm) = '' - is_litter(i_atm) = .true. - is_soil(i_atm) = .false. - is_cwd(i_atm) = .false. - initial_cn_ratio(i_atm) = 0._r8 - initial_stock(i_atm) = 0._r8 - is_metabolic(i_atm) = .false. - is_cellulose(i_atm) = .false. - is_lignin(i_atm) = .false. - - - spinup_factor(i_litr1) = 1._r8 - spinup_factor(i_litr2) = 1._r8 - spinup_factor(i_litr3) = 1._r8 - if (.not. use_fates) then - spinup_factor(i_cwd) = 1._r8 - end if - spinup_factor(i_soil1) = params_inst%spinup_vector(1) - spinup_factor(i_soil2) = params_inst%spinup_vector(2) - spinup_factor(i_soil3) = params_inst%spinup_vector(3) - spinup_factor(i_soil4) = params_inst%spinup_vector(4) - - - !---------------- list of transitions and their time-independent coefficients ---------------! - i_l1s1 = 1 - decomp_cascade_con%cascade_step_name(i_l1s1) = 'L1S1' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = rf_l1s1 - cascade_donor_pool(i_l1s1) = i_litr1 - cascade_receiver_pool(i_l1s1) = i_soil1 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l1s1) = 1.0_r8 - - i_l2s2 = 2 - decomp_cascade_con%cascade_step_name(i_l2s2) = 'L2S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s2) = rf_l2s2 - cascade_donor_pool(i_l2s2) = i_litr2 - cascade_receiver_pool(i_l2s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l2s2) = 1.0_r8 - - i_l3s3 = 3 - decomp_cascade_con%cascade_step_name(i_l3s3) = 'L3S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s3) = rf_l3s3 - cascade_donor_pool(i_l3s3) = i_litr3 - cascade_receiver_pool(i_l3s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_l3s3) = 1.0_r8 - - i_s1s2 = 4 - decomp_cascade_con%cascade_step_name(i_s1s2) = 'S1S2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = rf_s1s2 - cascade_donor_pool(i_s1s2) = i_soil1 - cascade_receiver_pool(i_s1s2) = i_soil2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s1s2) = 1.0_r8 - - i_s2s3 = 5 - decomp_cascade_con%cascade_step_name(i_s2s3) = 'S2S3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = rf_s2s3 - cascade_donor_pool(i_s2s3) = i_soil2 - cascade_receiver_pool(i_s2s3) = i_soil3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s2s3) = 1.0_r8 - - i_s3s4 = 6 - decomp_cascade_con%cascade_step_name(i_s3s4) = 'S3S4' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = rf_s3s4 - cascade_donor_pool(i_s3s4) = i_soil3 - cascade_receiver_pool(i_s3s4) = i_soil4 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s3s4) = 1.0_r8 - - i_s4atm = 7 - decomp_cascade_con%cascade_step_name(i_s4atm) = 'S4' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s4atm) = 1. - cascade_donor_pool(i_s4atm) = i_soil4 - cascade_receiver_pool(i_s4atm) = i_atm - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_s4atm) = 1.0_r8 - - if (.not. use_fates) then - i_cwdl2 = 8 - decomp_cascade_con%cascade_step_name(i_cwdl2) = 'CWDL2' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = 0._r8 - cascade_donor_pool(i_cwdl2) = i_cwd - cascade_receiver_pool(i_cwdl2) = i_litr2 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl2) = cwd_fcel - - i_cwdl3 = 9 - decomp_cascade_con%cascade_step_name(i_cwdl3) = 'CWDL3' - rf_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = 0._r8 - cascade_donor_pool(i_cwdl3) = i_cwd - cascade_receiver_pool(i_cwdl3) = i_litr3 - pathfrac_decomp_cascade(bounds%begc:bounds%endc,1:nlevdecomp,i_cwdl3) = cwd_flig - end if - - end associate - - end subroutine init_decompcascade_cn - - !----------------------------------------------------------------------- - subroutine decomp_rate_constants_cn(bounds, & - num_soilc, filter_soilc, & - canopystate_inst, soilstate_inst, temperature_inst, ch4_inst, soilbiogeochem_carbonflux_inst) - ! - ! !DESCRIPTION: - ! calculate rate constants and decomposition pathways for the BGC model - ! originally implemented in CLM-CN - ! written by C. Koven based on original CLM4 decomposition cascade by P. Thornton - ! - ! !USES: - use clm_time_manager, only : get_step_size - use clm_varcon , only : secspday - use clm_varpar , only : i_cwd - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(ch4_type) , intent(in) :: ch4_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - ! - ! !LOCAL VARIABLES: - real(r8):: dt ! decomp timestep (seconds) - real(r8):: dtd ! decomp timestep (days) - real(r8):: frw(bounds%begc:bounds%endc) ! rooting fraction weight - real(r8), allocatable:: fr(:,:) ! column-level rooting fraction by soil depth - real(r8):: minpsi, maxpsi ! limits for soil water scalar for decomp - real(r8):: psi ! temporary soilpsi for water scalar - real(r8):: rate_scalar ! combined rate scalar for decomp - real(r8):: k_l1 ! decomposition rate constant litter 1 - real(r8):: k_l2 ! decomposition rate constant litter 2 - real(r8):: k_l3 ! decomposition rate constant litter 3 - real(r8):: k_s1 ! decomposition rate constant SOM 1 - real(r8):: k_s2 ! decomposition rate constant SOM 2 - real(r8):: k_s3 ! decomposition rate constant SOM 3 - real(r8):: k_s4 ! decomposition rate constant SOM 4 - real(r8):: k_frag ! fragmentation rate constant CWD - real(r8):: ck_l1 ! corrected decomposition rate constant litter 1 - real(r8):: ck_l2 ! corrected decomposition rate constant litter 2 - real(r8):: ck_l3 ! corrected decomposition rate constant litter 3 - real(r8):: ck_s1 ! corrected decomposition rate constant SOM 1 - real(r8):: ck_s2 ! corrected decomposition rate constant SOM 2 - real(r8):: ck_s3 ! corrected decomposition rate constant SOM 3 - real(r8):: ck_s4 ! corrected decomposition rate constant SOM 4 - real(r8):: ck_frag ! corrected fragmentation rate constant CWD - real(r8):: cwdc_loss ! fragmentation rate for CWD carbon (gC/m2/s) - real(r8):: cwdn_loss ! fragmentation rate for CWD nitrogen (gN/m2/s) - integer :: i_litr1 - integer :: i_litr2 - integer :: i_litr3 - integer :: i_soil1 - integer :: i_soil2 - integer :: i_soil3 - integer :: i_soil4 - integer :: c, fc, j, k, l - real(r8):: Q10 ! temperature dependence - real(r8):: froz_q10 ! separate q10 for frozen soil respiration rates. default to same as above zero rates - real(r8):: decomp_depth_efolding ! (meters) e-folding depth for reduction in decomposition [ - real(r8):: depth_scalar(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: mino2lim ! minimum anaerobic decomposition rate as a - ! fraction of potential aerobic rate - !----------------------------------------------------------------------- - - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] soil layer thickness (m) - - soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - - alt_indx => canopystate_inst%alt_indx_col , & ! Input: [integer (:) ] current depth of thaw - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - o2stress_sat => ch4_inst%o2stress_sat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - o2stress_unsat => ch4_inst%o2stress_unsat_col , & ! Input: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area (excluding dedicated wetland columns) - - t_scalar => soilbiogeochem_carbonflux_inst%t_scalar_col , & ! Output: [real(r8) (:,:) ] soil temperature scalar for decomp - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Output: [real(r8) (:,:) ] soil water scalar for decomp - o_scalar => soilbiogeochem_carbonflux_inst%o_scalar_col , & ! Output: [real(r8) (:,:) ] fraction by which decomposition is limited by anoxia - decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) - ) - - mino2lim = CNParamsShareInst%mino2lim - - ! set time steps - dt = real( get_step_size(), r8 ) - dtd = dt/secspday - - ! set initial base rates for decomposition mass loss (1/day) - ! (from Biome-BGC v4.2.0, using three SOM pools) - ! Value inside log function is the discrete-time values for a - ! daily time step model, and the result of the log function is - ! the corresponding continuous-time decay rate (1/day), following - ! Olson, 1963. - k_l1=params_inst%k_l1_cn - k_l2=params_inst%k_l2_cn - k_l3=params_inst%k_l3_cn - - k_s1=params_inst%k_s1_cn - k_s2=params_inst%k_s2_cn - k_s3=params_inst%k_s3_cn - k_s4=params_inst%k_s4_cn - - k_frag=params_inst%k_frag_cn - - ! calculate the new discrete-time decay rate for model timestep - k_l1 = 1.0_r8-exp(-k_l1*dtd) - k_l2 = 1.0_r8-exp(-k_l2*dtd) - k_l3 = 1.0_r8-exp(-k_l3*dtd) - - k_s1 = 1.0_r8-exp(-k_s1*dtd) - k_s2 = 1.0_r8-exp(-k_s2*dtd) - k_s3 = 1.0_r8-exp(-k_s3*dtd) - k_s4 = 1.0_r8-exp(-k_s4*dtd) - - k_frag = 1.0_r8-exp(-k_frag*dtd) - - minpsi = params_inst%minpsi_cn - maxpsi = params_inst%maxpsi_cn - - Q10 = CNParamsShareInst%Q10 - - ! set "froz_q10" parameter - froz_q10 = CNParamsShareInst%froz_q10 - - if (use_vertsoilc) then - ! Set "decomp_depth_efolding" parameter - decomp_depth_efolding = CNParamsShareInst%decomp_depth_efolding - end if - - ! The following code implements the acceleration part of the AD spinup - ! algorithm, by multiplying all of the SOM decomposition base rates by 10.0. - - if ( spinup_state .eq. 1 ) then - k_s1 = k_s1 * params_inst%spinup_vector(1) - k_s2 = k_s2 * params_inst%spinup_vector(2) - k_s3 = k_s3 * params_inst%spinup_vector(3) - k_s4 = k_s4 * params_inst%spinup_vector(4) - endif - - i_litr1 = 1 - i_litr2 = 2 - i_litr3 = 3 - if (use_fates) then - i_soil1 = 4 - i_soil2 = 5 - i_soil3 = 6 - i_soil4 = 7 - else - i_soil1 = 5 - i_soil2 = 6 - i_soil3 = 7 - i_soil4 = 8 - endif - - !--- time dependent coefficients-----! - if ( nlevdecomp .eq. 1 ) then - - ! calculate function to weight the temperature and water potential scalars - ! for decomposition control. - - - ! the following normalizes values in fr so that they - ! sum to 1.0 across top nlevdecomp levels on a column - frw(bounds%begc:bounds%endc) = 0._r8 - nlev_soildecomp_standard=5 - allocate(fr(bounds%begc:bounds%endc,nlev_soildecomp_standard)) - do j=1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - frw(c) = frw(c) + dz(c,j) - end do - end do - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (frw(c) /= 0._r8) then - fr(c,j) = dz(c,j) / frw(c) - else - fr(c,j) = 0._r8 - end if - end do - end do - - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) t_scalar(c,:) = 0._r8 - !! use separate (possibly equal) t funcs above and below freezing point - !! t_scalar(c,1)=t_scalar(c,1) + (1.5**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - else - t_scalar(c,1)=t_scalar(c,1) + & - (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8))*fr(c,j) - endif - end do - end do - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - if (j==1) w_scalar(c,:) = 0._r8 - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,1) = w_scalar(c,1) + (log(minpsi/psi)/log(minpsi/maxpsi))*fr(c,j) - end if - end do - end do - - if (use_lch4) then - if (anoxia_wtsat) then ! Adjust for saturated fraction if unfrozen. - do fc = 1,num_soilc - c = filter_soilc(fc) - if (alt_indx(c) >= nlev_soildecomp_standard .and. t_soisno(c,1) > SHR_CONST_TKFRZ) then - w_scalar(c,1) = w_scalar(c,1)*(1._r8 - finundated(c)) + finundated(c) - end if - end do - end if - end if - - if (use_lch4) then - ! Calculate ANOXIA - if (anoxia) then - ! Check for anoxia w/o LCH4 now done in controlMod. - - do j = 1,nlev_soildecomp_standard - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (j==1) o_scalar(c,:) = 0._r8 - - if (.not. anoxia_wtsat) then - o_scalar(c,1) = o_scalar(c,1) + fr(c,j) * max(o2stress_unsat(c,j), mino2lim) - else - o_scalar(c,1) = o_scalar(c,1) + fr(c,j) * & - (max(o2stress_unsat(c,j), mino2lim)*(1._r8 - finundated(c)) + & - max(o2stress_sat(c,j), mino2lim)*finundated(c) ) - end if - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - deallocate(fr) - - else - - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - !! use separate (possibly equal) t funcs above and below freezing point - !! t_scalar(c,j)= (1.5**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8)) - if (t_soisno(c,j) >= SHR_CONST_TKFRZ) then - t_scalar(c,j)= (Q10**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8)) - else - t_scalar(c,j)= (Q10**(-25._r8/10._r8))*(froz_q10**((t_soisno(c,j)-SHR_CONST_TKFRZ)/10._r8)) - endif - end do - end do - - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c,j) = (log(minpsi/psi)/log(minpsi/maxpsi)) - else - w_scalar(c,j) = 0._r8 - end if - if (use_lch4) then - if (anoxia_wtsat .and. t_soisno(c,j) > SHR_CONST_TKFRZ) then ! wet area will have w_scalar of 1 if unfrozen - w_scalar(c,j) = w_scalar(c,j)*(1._r8 - finundated(c)) + finundated(c) - end if - end if - end do - end do - - end if - - if (use_lch4) then - ! Calculate ANOXIA - ! Check for anoxia w/o LCH4 now done in controlMod. - - if (anoxia) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (.not. anoxia_wtsat) then - o_scalar(c,j) = max(o2stress_unsat(c,j), mino2lim) - else - o_scalar(c,j) = max(o2stress_unsat(c,j), mino2lim) * (1._r8 - finundated(c)) + & - max(o2stress_sat(c,j), mino2lim) * finundated(c) - end if - end do - end do - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - else - o_scalar(bounds%begc:bounds%endc,1:nlevdecomp) = 1._r8 - end if - - if (use_vertsoilc) then - ! add a term to reduce decomposition rate at depth - ! for now used a fixed e-folding depth - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - depth_scalar(c,j) = exp(-zsoi(j)/decomp_depth_efolding) - end do - end do - end if - - ! calculate rate constants for all litter and som pools - if (use_vertsoilc) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_litr1) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr2) = k_l2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_litr3) = k_l3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil1) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil2) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil3) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - decomp_k(c,j,i_soil4) = k_s4 * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - end do - end do - end if - - ! do the same for cwd, but only if fates is not enabled (because fates handles CWD on its own structure - if (.not. use_fates) then - if (use_vertsoilc) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * o_scalar(c,j) / dt - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - decomp_k(c,j,i_cwd) = k_frag * t_scalar(c,j) * w_scalar(c,j) * o_scalar(c,j) / dt - end do - end do - end if - end if - - end associate - - end subroutine decomp_rate_constants_cn - - end module SoilBiogeochemDecompCascadeCNMod diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 deleted file mode 100644 index 8a8e2f8dfa..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeConType.F90 +++ /dev/null @@ -1,104 +0,0 @@ -module SoilBiogeochemDecompCascadeConType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Decomposition Cascade Type - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: init_decomp_cascade_constants - ! - type, public :: decomp_cascade_type - !-- properties of each pathway along decomposition cascade - character(len=8) , pointer :: cascade_step_name(:) ! name of transition - integer , pointer :: cascade_donor_pool(:) ! which pool is C taken from for a given decomposition step - integer , pointer :: cascade_receiver_pool(:) ! which pool is C added to for a given decomposition step - - !-- properties of each decomposing pool - logical , pointer :: floating_cn_ratio_decomp_pools(:) ! TRUE => pool has fixed C:N ratio - character(len=8) , pointer :: decomp_pool_name_restart(:) ! name of pool for restart files - character(len=8) , pointer :: decomp_pool_name_history(:) ! name of pool for history files - character(len=20) , pointer :: decomp_pool_name_long(:) ! name of pool for netcdf long names - character(len=8) , pointer :: decomp_pool_name_short(:) ! name of pool for netcdf short names - logical , pointer :: is_litter(:) ! TRUE => pool is a litter pool - logical , pointer :: is_soil(:) ! TRUE => pool is a soil pool - logical , pointer :: is_cwd(:) ! TRUE => pool is a cwd pool - real(r8) , pointer :: initial_cn_ratio(:) ! c:n ratio for initialization of pools - real(r8) , pointer :: initial_stock(:) ! initial concentration for seeding at spinup - real(r8) :: initial_stock_soildepth ! soil depth for initial concentration for seeding at spinup - logical , pointer :: is_metabolic(:) ! TRUE => pool is metabolic material - logical , pointer :: is_cellulose(:) ! TRUE => pool is cellulose - logical , pointer :: is_lignin(:) ! TRUE => pool is lignin - real(r8) , pointer :: spinup_factor(:) ! factor by which to scale AD and relevant processes by - end type decomp_cascade_type - - type(decomp_cascade_type), public :: decomp_cascade_con - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine init_decomp_cascade_constants() - ! - ! !DESCRIPTION: - ! Initialize decomposition cascade state - !------------------------------------------------------------------------ - - !-- properties of each pathway along decomposition cascade - allocate(decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions)) - allocate(decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions)) - allocate(decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions)) - - ! NOTE(bja, 2015-10) according to Dave Lawrence and Charlie Koven, - ! the indexing of decomposing pools from 0:ndecomp_pools is a - ! bug. The lower bound should be 1. The index zero data shouldn't - ! be used. - - !-- properties of each decomposing pool - allocate(decomp_cascade_con%floating_cn_ratio_decomp_pools(0:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_restart(0:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_history(0:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_long(0:ndecomp_pools)) - allocate(decomp_cascade_con%decomp_pool_name_short(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_litter(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_soil(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_cwd(0:ndecomp_pools)) - allocate(decomp_cascade_con%initial_cn_ratio(0:ndecomp_pools)) - allocate(decomp_cascade_con%initial_stock(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_metabolic(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_cellulose(0:ndecomp_pools)) - allocate(decomp_cascade_con%is_lignin(0:ndecomp_pools)) - allocate(decomp_cascade_con%spinup_factor(1:ndecomp_pools)) - - !-- properties of each pathway along decomposition cascade - decomp_cascade_con%cascade_step_name(1:ndecomp_cascade_transitions) = '' - decomp_cascade_con%cascade_donor_pool(1:ndecomp_cascade_transitions) = 0 - decomp_cascade_con%cascade_receiver_pool(1:ndecomp_cascade_transitions) = 0 - - !-- first initialization of properties of each decomposing pool - decomp_cascade_con%floating_cn_ratio_decomp_pools(0:ndecomp_pools) = .false. - decomp_cascade_con%decomp_pool_name_history(0:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_restart(0:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_long(0:ndecomp_pools) = '' - decomp_cascade_con%decomp_pool_name_short(0:ndecomp_pools) = '' - decomp_cascade_con%is_litter(0:ndecomp_pools) = .false. - decomp_cascade_con%is_soil(0:ndecomp_pools) = .false. - decomp_cascade_con%is_cwd(0:ndecomp_pools) = .false. - decomp_cascade_con%initial_cn_ratio(0:ndecomp_pools) = nan - decomp_cascade_con%initial_stock(0:ndecomp_pools) = nan - decomp_cascade_con%initial_stock_soildepth = 0.3 - decomp_cascade_con%is_metabolic(0:ndecomp_pools) = .false. - decomp_cascade_con%is_cellulose(0:ndecomp_pools) = .false. - decomp_cascade_con%is_lignin(0:ndecomp_pools) = .false. - decomp_cascade_con%spinup_factor(1:ndecomp_pools) = nan - - end subroutine init_decomp_cascade_constants - -end module SoilBiogeochemDecompCascadeConType diff --git a/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 deleted file mode 100644 index 413647bf1c..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemDecompMod.F90 +++ /dev/null @@ -1,277 +0,0 @@ -module SoilBiogeochemDecompMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module holding routines used in litter and soil decomposition model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use clm_varpar , only : nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use clm_varctl , only : use_nitrif_denitrif, use_lch4, use_fates - use clm_varcon , only : dzsoi_decomp - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: SoilBiogeochemDecomp - ! - type, private :: params_type - real(r8) :: dnp !denitrification proportion - end type params_type - ! - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! Read parameters - ! - ! !USES: - use ncdio_pio , only: file_desc_t,ncd_io - use abortutils , only: endrun - ! - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - tString='dnp' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%dnp=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemDecomp (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools, p_decomp_cpool_loss, pmnf_decomp_cascade) - ! - ! !USES: - ! - ! !ARGUMENT: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - real(r8) , intent(inout) :: cn_decomp_pools(bounds%begc:,1:,1:) ! c:n ratios of applicable pools - real(r8) , intent(inout) :: p_decomp_cpool_loss(bounds%begc:,1:,1:) ! potential C loss from one pool to another - real(r8) , intent(inout) :: pmnf_decomp_cascade(bounds%begc:,1:,1:) ! potential mineral N flux from one pool to another - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l,m ! indices - integer :: fc ! lake filter column index - integer :: begc,endc ! bounds - integer, parameter :: i_atm = 0 !TODO - this appears in two places - move it to 1 - ! For methane code - real(r8):: hrsum(bounds%begc:bounds%endc,1:nlevdecomp) ! sum of HR (gC/m2/s) - !----------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - SHR_ASSERT_ALL((ubound(cn_decomp_pools) == (/endc,nlevdecomp,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(p_decomp_cpool_loss) == (/endc,nlevdecomp,ndecomp_cascade_transitions/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(pmnf_decomp_cascade) == (/endc,nlevdecomp,ndecomp_cascade_transitions/)) , errMsg(sourcefile, __LINE__)) - - associate( & - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step - floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Input: [logical (:) ] TRUE => pool has fixed C:N ratio - initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Input: [real(r8) (:) ] c:n ratio for initialization of pools - - fpi_vr => soilbiogeochem_state_inst%fpi_vr_col , & ! Input: [real(r8) (:,:) ] fraction of potential immobilization (no units) - rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac) - pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac) - - decomp_npools_vr => soilbiogeochem_nitrogenstate_inst%decomp_npools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) N pools - decomp_cpools_vr => soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - - decomp_cascade_ntransfer_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_ntransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res transfer of N from donor to receiver pool along decomp. cascade (gN/m3/s) - decomp_cascade_sminn_flux_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_sminn_flux_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res mineral N flux for transition along decomposition cascade (gN/m3/s) - potential_immob_vr => soilbiogeochem_nitrogenflux_inst%potential_immob_vr_col , & ! Output: [real(r8) (:,:) ] - sminn_to_denit_decomp_cascade_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_denit_decomp_cascade_vr_col , & ! Output: [real(r8) (:,:,:) ] - gross_nmin_vr => soilbiogeochem_nitrogenflux_inst%gross_nmin_vr_col , & ! Output: [real(r8) (:,:) ] - net_nmin_vr => soilbiogeochem_nitrogenflux_inst%net_nmin_vr_col , & ! Output: [real(r8) (:,:) ] - gross_nmin => soilbiogeochem_nitrogenflux_inst%gross_nmin_col , & ! Output: [real(r8) (:) ] gross rate of N mineralization (gN/m2/s) - net_nmin => soilbiogeochem_nitrogenflux_inst%net_nmin_col , & ! Output: [real(r8) (:) ] net rate of N mineralization (gN/m2/s) - - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by moisture availability - decomp_cascade_hr_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_hr_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - decomp_cascade_ctransfer_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) - phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col , & ! Input: [real(r8) (:,:) ] potential HR (gC/m3/s) - fphr => soilbiogeochem_carbonflux_inst%fphr_col & ! Output: [real(r8) (:,:) ] fraction of potential SOM + LITTER heterotrophic - ) - - ! column loop to calculate actual immobilization and decomp rates, following - ! resolution of plant/heterotroph competition for mineral N - - if ( .not. use_fates) then - ! calculate c:n ratios of applicable pools - do l = 1, ndecomp_pools - if ( floating_cn_ratio_decomp_pools(l) ) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if ( decomp_npools_vr(c,j,l) > 0._r8 ) then - cn_decomp_pools(c,j,l) = decomp_cpools_vr(c,j,l) / decomp_npools_vr(c,j,l) - end if - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - cn_decomp_pools(c,j,l) = initial_cn_ratio(l) - end do - end do - end if - end do - - ! column loop to calculate actual immobilization and decomp rates, following - ! resolution of plant/heterotroph competition for mineral N - - ! upon return from SoilBiogeochemCompetition, the fraction of potential immobilization - ! has been set (soilbiogeochem_state_inst%fpi_vr_col). now finish the decomp calculations. - ! Only the immobilization steps are limited by fpi_vr (pmnf > 0) - ! Also calculate denitrification losses as a simple proportion - ! of mineralization flux. - - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (decomp_cpools_vr(c,j,cascade_donor_pool(k)) > 0._r8) then - if ( pmnf_decomp_cascade(c,j,k) > 0._r8 ) then - p_decomp_cpool_loss(c,j,k) = p_decomp_cpool_loss(c,j,k) * fpi_vr(c,j) - pmnf_decomp_cascade(c,j,k) = pmnf_decomp_cascade(c,j,k) * fpi_vr(c,j) - if (.not. use_nitrif_denitrif) then - sminn_to_denit_decomp_cascade_vr(c,j,k) = 0._r8 - end if - else - if (.not. use_nitrif_denitrif) then - sminn_to_denit_decomp_cascade_vr(c,j,k) = -params_inst%dnp * pmnf_decomp_cascade(c,j,k) - end if - end if - decomp_cascade_hr_vr(c,j,k) = rf_decomp_cascade(c,j,k) * p_decomp_cpool_loss(c,j,k) - decomp_cascade_ctransfer_vr(c,j,k) = (1._r8 - rf_decomp_cascade(c,j,k)) * p_decomp_cpool_loss(c,j,k) - if (decomp_npools_vr(c,j,cascade_donor_pool(k)) > 0._r8 .and. cascade_receiver_pool(k) /= i_atm) then - decomp_cascade_ntransfer_vr(c,j,k) = p_decomp_cpool_loss(c,j,k) / cn_decomp_pools(c,j,cascade_donor_pool(k)) - else - decomp_cascade_ntransfer_vr(c,j,k) = 0._r8 - endif - if ( cascade_receiver_pool(k) /= 0 ) then - decomp_cascade_sminn_flux_vr(c,j,k) = pmnf_decomp_cascade(c,j,k) - else ! keep sign convention negative for terminal pools - decomp_cascade_sminn_flux_vr(c,j,k) = - pmnf_decomp_cascade(c,j,k) - endif - net_nmin_vr(c,j) = net_nmin_vr(c,j) - pmnf_decomp_cascade(c,j,k) - else - decomp_cascade_ntransfer_vr(c,j,k) = 0._r8 - if (.not. use_nitrif_denitrif) then - sminn_to_denit_decomp_cascade_vr(c,j,k) = 0._r8 - end if - decomp_cascade_sminn_flux_vr(c,j,k) = 0._r8 - end if - - end do - end do - end do - else - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! - decomp_cascade_hr_vr(c,j,k) = rf_decomp_cascade(c,j,k) * p_decomp_cpool_loss(c,j,k) - ! - decomp_cascade_ctransfer_vr(c,j,k) = (1._r8 - rf_decomp_cascade(c,j,k)) * p_decomp_cpool_loss(c,j,k) - ! - end do - end do - end do - end if - - if (use_lch4) then - ! Calculate total fraction of potential HR, for methane code - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - hrsum(c,j) = 0._r8 - end do - end do - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - hrsum(c,j) = hrsum(c,j) + rf_decomp_cascade(c,j,k) * p_decomp_cpool_loss(c,j,k) - end do - end do - end do - - - ! Nitrogen limitation / (low)-moisture limitation - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if (phr_vr(c,j) > 0._r8) then - fphr(c,j) = hrsum(c,j) / phr_vr(c,j) * w_scalar(c,j) - fphr(c,j) = max(fphr(c,j), 0.01_r8) ! Prevent overflow errors for 0 respiration - else - fphr(c,j) = 1._r8 - end if - end do - end do - end if - - - ! vertically integrate net and gross mineralization fluxes for diagnostic output - - do fc = 1,num_soilc - c = filter_soilc(fc) - do j = 1,nlevdecomp - if(.not.use_fates)then - net_nmin(c) = net_nmin(c) + net_nmin_vr(c,j) * dzsoi_decomp(j) - gross_nmin(c) = gross_nmin(c) + gross_nmin_vr(c,j) * dzsoi_decomp(j) - ! else - ! net_nmin(c) = 0.0_r8 - ! gross_nmin(c) = 0.0_r8 - endif - end do - end do - - end associate - - end subroutine SoilBiogeochemDecomp - -end module SoilBiogeochemDecompMod diff --git a/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 b/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 deleted file mode 100644 index a82ce9c469..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemLittVertTranspMod.F90 +++ /dev/null @@ -1,516 +0,0 @@ -module SoilBiogeochemLittVertTranspMod - - !----------------------------------------------------------------------- - ! calculate vertical mixing of all decomposing C and N pools - ! - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, use_c13, use_c14, spinup_state, use_vertsoilc, use_fates, use_cn - use clm_varcon , only : secspday - use decompMod , only : bounds_type - use abortutils , only : endrun - use CanopyStateType , only : canopystate_type - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use ColumnType , only : col - use GridcellType , only : grc - use SoilBiogeochemStateType , only : get_spinup_latitude_term - ! - implicit none - private - ! - public :: readParams - public :: SoilBiogeochemLittVertTransp - - type, private :: params_type - real(r8) :: som_diffus ! Soil organic matter diffusion - real(r8) :: cryoturb_diffusion_k ! The cryoturbation diffusive constant cryoturbation to the active layer thickness - real(r8) :: max_altdepth_cryoturbation ! (m) maximum active layer thickness for cryoturbation to occur - end type params_type - - type(params_type), private :: params_inst - ! - real(r8), public :: som_adv_flux = 0._r8 - real(r8), public :: max_depth_cryoturb = 3._r8 ! (m) this is the maximum depth of cryoturbation - real(r8) :: som_diffus ! [m^2/sec] = 1 cm^2 / yr - real(r8) :: cryoturb_diffusion_k ! [m^2/sec] = 5 cm^2 / yr = 1m^2 / 200 yr - real(r8) :: max_altdepth_cryoturbation ! (m) maximum active layer thickness for cryoturbation to occur - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - use ncdio_pio , only : file_desc_t,ncd_io - ! - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - character(len=32) :: subname = 'SoilBiogeochemLittVertTranspType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - ! - ! read in parameters - ! - - tString='som_diffus' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - !soilbiogeochem_litt_verttransp_params_inst%som_diffus=tempr - ! FIX(SPM,032414) - can't be pulled out since division makes things not bfb - params_inst%som_diffus = 1e-4_r8 / (secspday * 365._r8) - - tString='cryoturb_diffusion_k' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - !soilbiogeochem_litt_verttransp_params_inst%cryoturb_diffusion_k=tempr - !FIX(SPM,032414) Todo. This constant cannot be on file since the divide makes things - !SPM Todo. This constant cannot be on file since the divide makes things - !not bfb - params_inst%cryoturb_diffusion_k = 5e-4_r8 / (secspday * 365._r8) ! [m^2/sec] = 5 cm^2 / yr = 1m^2 / 200 yr - - tString='max_altdepth_cryoturbation' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%max_altdepth_cryoturbation=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemLittVertTransp(bounds, num_soilc, filter_soilc, & - canopystate_inst, soilbiogeochem_state_inst, & - soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst, & - c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! Calculate vertical mixing of soil and litter pools. Also reconcile sources and sinks of these pools - ! calculated in the CStateUpdate1 and NStateUpdate1 subroutines. - ! Advection-diffusion code based on algorithm in Patankar (1980) - ! Initial code by C. Koven and W. Riley - ! - ! !USES: - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevdecomp, ndecomp_pools, nlevdecomp_full - use clm_varcon , only : zsoi, dzsoi_decomp, zisoi - use TridiagonalMod , only : Tridiagonal - use ColumnType , only : col - use clm_varctl , only : use_bedrock - - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c13_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: c14_soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: diffus (bounds%begc:bounds%endc,1:nlevdecomp+1) ! diffusivity (m2/s) (includes spinup correction, if any) - real(r8) :: adv_flux(bounds%begc:bounds%endc,1:nlevdecomp+1) ! advective flux (m/s) (includes spinup correction, if any) - real(r8) :: aaa ! "A" function in Patankar - real(r8) :: pe ! Pe for "A" function in Patankar - real(r8) :: w_m1, w_p1 ! Weights for calculating harmonic mean of diffusivity - real(r8) :: d_m1, d_p1 ! Harmonic mean of diffusivity - real(r8) :: a_tri(bounds%begc:bounds%endc,0:nlevdecomp+1) ! "a" vector for tridiagonal matrix - real(r8) :: b_tri(bounds%begc:bounds%endc,0:nlevdecomp+1) ! "b" vector for tridiagonal matrix - real(r8) :: c_tri(bounds%begc:bounds%endc,0:nlevdecomp+1) ! "c" vector for tridiagonal matrix - real(r8) :: r_tri(bounds%begc:bounds%endc,0:nlevdecomp+1) ! "r" vector for tridiagonal solution - real(r8) :: d_p1_zp1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! diffusivity/delta_z for next j (set to zero for no diffusion) - real(r8) :: d_m1_zm1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! diffusivity/delta_z for previous j (set to zero for no diffusion) - real(r8) :: f_p1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! water flux for next j - real(r8) :: f_m1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! water flux for previous j - real(r8) :: pe_p1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! Peclet # for next j - real(r8) :: pe_m1(bounds%begc:bounds%endc,1:nlevdecomp+1) ! Peclet # for previous j - real(r8) :: dz_node(1:nlevdecomp+1) ! difference between nodes - real(r8) :: epsilon_t (bounds%begc:bounds%endc,1:nlevdecomp+1,1:ndecomp_pools) ! - real(r8) :: conc_trcr(bounds%begc:bounds%endc,0:nlevdecomp+1) ! - real(r8) :: a_p_0 - real(r8) :: deficit - integer :: ntype - integer :: i_type,s,fc,c,j,l ! indices - integer :: jtop(bounds%begc:bounds%endc) ! top level at each column - real(r8) :: dtime ! land model time step (sec) - integer :: zerolev_diffus - real(r8) :: spinup_term ! spinup accelerated decomposition factor, used to accelerate transport as well - real(r8) :: epsilon ! small number - real(r8), pointer :: conc_ptr(:,:,:) ! pointer, concentration state variable being transported - real(r8), pointer :: source(:,:,:) ! pointer, source term - real(r8), pointer :: trcr_tendency_ptr(:,:,:) ! poiner, store the vertical tendency (gain/loss due to vertical transport) - !----------------------------------------------------------------------- - - ! Set statement functions - aaa (pe) = max (0._r8, (1._r8 - 0.1_r8 * abs(pe))**5) ! A function from Patankar, Table 5.2, pg 95 - - associate( & - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] spinup accelerated decomposition factor, used to accelerate transport as well - - altmax => canopystate_inst%altmax_col , & ! Input: [real(r8) (:) ] maximum annual depth of thaw - altmax_lastyear => canopystate_inst%altmax_lastyear_col , & ! Input: [real(r8) (:) ] prior year maximum annual depth of thaw - - som_adv_coef => soilbiogeochem_state_inst%som_adv_coef_col , & ! Output: [real(r8) (:,:) ] SOM advective flux (m/s) - som_diffus_coef => soilbiogeochem_state_inst%som_diffus_coef_col & ! Output: [real(r8) (:,:) ] SOM diffusivity due to bio/cryo-turbation (m2/s) - ) - - !Set parameters of vertical mixing of SOM - som_diffus = params_inst%som_diffus - cryoturb_diffusion_k = params_inst%cryoturb_diffusion_k - max_altdepth_cryoturbation = params_inst%max_altdepth_cryoturbation - - dtime = get_step_size() - - ntype = 2 - if ( use_c13 ) then - ntype = ntype+1 - endif - if ( use_c14 ) then - ntype = ntype+1 - endif - if ( use_fates ) then - ntype = 1 - endif - spinup_term = 1._r8 - epsilon = 1.e-30 - - if (use_vertsoilc) then - !------ first get diffusivity / advection terms -------! - ! use different mixing rates for bioturbation and cryoturbation, with fixed bioturbation and cryoturbation set to a maximum depth - do fc = 1, num_soilc - c = filter_soilc (fc) - if (( max(altmax(c), altmax_lastyear(c)) <= max_altdepth_cryoturbation ) .and. & - ( max(altmax(c), altmax_lastyear(c)) > 0._r8) ) then - ! use mixing profile modified slightly from Koven et al. (2009): constant through active layer, linear decrease from base of active layer to zero at a fixed depth - do j = 1,nlevdecomp+1 - if ( j <= col%nbedrock(c)+1 ) then - if ( zisoi(j) < max(altmax(c), altmax_lastyear(c)) ) then - som_diffus_coef(c,j) = cryoturb_diffusion_k - som_adv_coef(c,j) = 0._r8 - else - som_diffus_coef(c,j) = max(cryoturb_diffusion_k * & - ( 1._r8 - ( zisoi(j) - max(altmax(c), altmax_lastyear(c)) ) / & - ( min(max_depth_cryoturb, zisoi(col%nbedrock(c)+1)) - max(altmax(c), altmax_lastyear(c)) ) ), 0._r8) ! go linearly to zero between ALT and max_depth_cryoturb - som_adv_coef(c,j) = 0._r8 - endif - else - som_adv_coef(c,j) = 0._r8 - som_diffus_coef(c,j) = 0._r8 - endif - end do - elseif ( max(altmax(c), altmax_lastyear(c)) > 0._r8 ) then - ! constant advection, constant diffusion - do j = 1,nlevdecomp+1 - if ( j <= col%nbedrock(c)+1 ) then - som_adv_coef(c,j) = som_adv_flux - som_diffus_coef(c,j) = som_diffus - else - som_adv_coef(c,j) = 0._r8 - som_diffus_coef(c,j) = 0._r8 - endif - end do - else - ! completely frozen soils--no mixing - do j = 1,nlevdecomp+1 - som_adv_coef(c,j) = 0._r8 - som_diffus_coef(c,j) = 0._r8 - end do - endif - end do - - ! Set the distance between the node and the one ABOVE it - dz_node(1) = zsoi(1) - do j = 2,nlevdecomp+1 - dz_node(j)= zsoi(j) - zsoi(j-1) - enddo - - endif - - !------ loop over litter/som types - do i_type = 1, ntype - - select case (i_type) - case (1) ! C - conc_ptr => soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col - source => soilbiogeochem_carbonflux_inst%decomp_cpools_sourcesink_col - trcr_tendency_ptr => soilbiogeochem_carbonflux_inst%decomp_cpools_transport_tendency_col - case (2) ! N - if (use_cn ) then - conc_ptr => soilbiogeochem_nitrogenstate_inst%decomp_npools_vr_col - source => soilbiogeochem_nitrogenflux_inst%decomp_npools_sourcesink_col - trcr_tendency_ptr => soilbiogeochem_nitrogenflux_inst%decomp_npools_transport_tendency_col - endif - case (3) - if ( use_c13 ) then - ! C13 - conc_ptr => c13_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col - source => c13_soilbiogeochem_carbonflux_inst%decomp_cpools_sourcesink_col - trcr_tendency_ptr => c13_soilbiogeochem_carbonflux_inst%decomp_cpools_transport_tendency_col - else - ! C14 - conc_ptr => c14_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col - source => c14_soilbiogeochem_carbonflux_inst%decomp_cpools_sourcesink_col - trcr_tendency_ptr => c14_soilbiogeochem_carbonflux_inst%decomp_cpools_transport_tendency_col - endif - case (4) - if ( use_c14 .and. use_c13 ) then - ! C14 - conc_ptr => c14_soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col - source => c14_soilbiogeochem_carbonflux_inst%decomp_cpools_sourcesink_col - trcr_tendency_ptr => c14_soilbiogeochem_carbonflux_inst%decomp_cpools_transport_tendency_col - else - write(iulog,*) 'error. ncase = 4, but c13 and c14 not both enabled.' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end select - - if (use_vertsoilc) then - - do s = 1, ndecomp_pools - - if ( .not. is_cwd(s) ) then - - do j = 1,nlevdecomp+1 - do fc = 1, num_soilc - c = filter_soilc (fc) - ! - if ( spinup_state >= 1 ) then - ! increase transport (both advection and diffusion) by the same factor as accelerated decomposition for a given pool - spinup_term = spinup_factor(s) - else - spinup_term = 1._r8 - endif - - if (abs(spinup_term - 1._r8) > .000001_r8 ) then - spinup_term = spinup_term * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - endif - - if ( abs(som_adv_coef(c,j)) * spinup_term < epsilon ) then - adv_flux(c,j) = epsilon - else - adv_flux(c,j) = som_adv_coef(c,j) * spinup_term - endif - ! - if ( abs(som_diffus_coef(c,j)) * spinup_term < epsilon ) then - diffus(c,j) = epsilon - else - diffus(c,j) = som_diffus_coef(c,j) * spinup_term - endif - ! - end do - end do - - ! Set Pe (Peclet #) and D/dz throughout column - - do fc = 1, num_soilc ! dummy terms here - c = filter_soilc (fc) - conc_trcr(c,0) = 0._r8 - conc_trcr(c,col%nbedrock(c)+1:nlevdecomp+1) = 0._r8 - end do - - - do j = 1,nlevdecomp+1 - do fc = 1, num_soilc - c = filter_soilc (fc) - - conc_trcr(c,j) = conc_ptr(c,j,s) - - ! dz_tracer below is the difference between gridcell edges (dzsoi_decomp) - ! dz_node_tracer is difference between cell centers - - ! Calculate the D and F terms in the Patankar algorithm - if (j == 1) then - d_m1_zm1(c,j) = 0._r8 - w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) - if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus - else - d_p1 = 0._r8 - endif - d_p1_zp1(c,j) = d_p1 / dz_node(j+1) - f_m1(c,j) = adv_flux(c,j) ! Include infiltration here - f_p1(c,j) = adv_flux(c,j+1) - pe_m1(c,j) = 0._r8 - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # - elseif (j >= col%nbedrock(c)+1) then - ! At the bottom, assume no gradient in d_z (i.e., they're the same) - w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) - if ( diffus(c,j) > 0._r8 .and. diffus(c,j-1) > 0._r8) then - d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus - else - d_m1 = 0._r8 - endif - d_m1_zm1(c,j) = d_m1 / dz_node(j) - d_p1_zp1(c,j) = d_m1_zm1(c,j) ! Set to be the same - f_m1(c,j) = adv_flux(c,j) - !f_p1(c,j) = adv_flux(c,j+1) - f_p1(c,j) = 0._r8 - pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # - else - ! Use distance from j-1 node to interface with j divided by distance between nodes - w_m1 = (zisoi(j-1) - zsoi(j-1)) / dz_node(j) - if ( diffus(c,j-1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_m1 = 1._r8 / ((1._r8 - w_m1) / diffus(c,j) + w_m1 / diffus(c,j-1)) ! Harmonic mean of diffus - else - d_m1 = 0._r8 - endif - w_p1 = (zsoi(j+1) - zisoi(j)) / dz_node(j+1) - if ( diffus(c,j+1) > 0._r8 .and. diffus(c,j) > 0._r8) then - d_p1 = 1._r8 / ((1._r8 - w_p1) / diffus(c,j) + w_p1 / diffus(c,j+1)) ! Harmonic mean of diffus - else - d_p1 = (1._r8 - w_m1) * diffus(c,j) + w_p1 * diffus(c,j+1) ! Arithmetic mean of diffus - endif - d_m1_zm1(c,j) = d_m1 / dz_node(j) - d_p1_zp1(c,j) = d_p1 / dz_node(j+1) - f_m1(c,j) = adv_flux(c,j) - f_p1(c,j) = adv_flux(c,j+1) - pe_m1(c,j) = f_m1(c,j) / d_m1_zm1(c,j) ! Peclet # - pe_p1(c,j) = f_p1(c,j) / d_p1_zp1(c,j) ! Peclet # - end if - enddo ! fc - enddo ! j; nlevdecomp - - - ! Calculate the tridiagonal coefficients - do j = 0,nlevdecomp +1 - do fc = 1, num_soilc - c = filter_soilc (fc) - ! g = cgridcell(c) - - if (j > 0 .and. j < nlevdecomp+1) then - a_p_0 = dzsoi_decomp(j) / dtime - endif - - if (j == 0) then ! top layer (atmosphere) - a_tri(c,j) = 0._r8 - b_tri(c,j) = 1._r8 - c_tri(c,j) = -1._r8 - r_tri(c,j) = 0._r8 - elseif (j == 1) then - a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar - c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) - b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 - r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + (a_p_0 - adv_flux(c,j)) * conc_trcr(c,j) - elseif (j < nlevdecomp+1) then - a_tri(c,j) = -(d_m1_zm1(c,j) * aaa(pe_m1(c,j)) + max( f_m1(c,j), 0._r8)) ! Eqn 5.47 Patankar - c_tri(c,j) = -(d_p1_zp1(c,j) * aaa(pe_p1(c,j)) + max(-f_p1(c,j), 0._r8)) - b_tri(c,j) = -a_tri(c,j) - c_tri(c,j) + a_p_0 - r_tri(c,j) = source(c,j,s) * dzsoi_decomp(j) /dtime + a_p_0 * conc_trcr(c,j) - else ! j==nlevdecomp+1; 0 concentration gradient at bottom - a_tri(c,j) = -1._r8 - b_tri(c,j) = 1._r8 - c_tri(c,j) = 0._r8 - r_tri(c,j) = 0._r8 - endif - enddo ! fc; column - enddo ! j; nlevdecomp - - do fc = 1, num_soilc - c = filter_soilc (fc) - jtop(c) = 0 - enddo - - ! subtract initial concentration and source terms for tendency calculation - do fc = 1, num_soilc - c = filter_soilc (fc) - do j = 1, nlevdecomp - trcr_tendency_ptr(c,j,s) = 0.-(conc_trcr(c,j) + source(c,j,s)) - end do - end do - - ! Solve for the concentration profile for this time step - call Tridiagonal(bounds, 0, nlevdecomp+1, & - jtop(bounds%begc:bounds%endc), & - num_soilc, filter_soilc, & - a_tri(bounds%begc:bounds%endc, :), & - b_tri(bounds%begc:bounds%endc, :), & - c_tri(bounds%begc:bounds%endc, :), & - r_tri(bounds%begc:bounds%endc, :), & - conc_trcr(bounds%begc:bounds%endc,0:nlevdecomp+1)) - - ! add post-transport concentration to calculate tendency term - do fc = 1, num_soilc - c = filter_soilc (fc) - do j = 1, nlevdecomp - trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) + conc_trcr(c,j) - trcr_tendency_ptr(c,j,s) = trcr_tendency_ptr(c,j,s) / dtime - end do - end do - - else - ! for CWD pools, just add - do j = 1,nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - conc_trcr(c,j) = conc_ptr(c,j,s) + source(c,j,s) - if (j > col%nbedrock(c) .and. source(c,j,s) > 0._r8) then - write(iulog,*) 'source >0',c,j,s,source(c,j,s) - end if - if (j > col%nbedrock(c) .and. conc_ptr(c,j,s) > 0._r8) then - write(iulog,*) 'conc_ptr >0',c,j,s,conc_ptr(c,j,s) - end if - - end do - end do - - end if ! not CWD - - do j = 1,nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - conc_ptr(c,j,s) = conc_trcr(c,j) - ! Correct for small amounts of carbon that leak into bedrock - if (j > col%nbedrock(c)) then - conc_ptr(c,col%nbedrock(c),s) = conc_ptr(c,col%nbedrock(c),s) + & - conc_trcr(c,j) * (dzsoi_decomp(j) / dzsoi_decomp(col%nbedrock(c))) - conc_ptr(c,j,s) = 0._r8 - end if - end do - end do - - end do ! s (pool loop) - - else - - !! for single level case, no transport; just update the fluxes calculated in the StateUpdate1 subroutines - do l = 1, ndecomp_pools - do j = 1,nlevdecomp - do fc = 1, num_soilc - c = filter_soilc (fc) - - conc_ptr(c,j,l) = conc_ptr(c,j,l) + source(c,j,l) - - trcr_tendency_ptr(c,j,l) = 0._r8 - - end do - end do - end do - - endif - - end do ! i_type - - end associate - - end subroutine SoilBiogeochemLittVertTransp - -end module SoilBiogeochemLittVertTranspMod diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 deleted file mode 100644 index 3a0cb0c91b..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ /dev/null @@ -1,289 +0,0 @@ -module SoilBiogeochemNLeachingMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for mineral nitrogen dynamics (deposition, fixation, leaching) - ! for coupled carbon-nitrogen code. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varcon , only : dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use ColumnType , only : col - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: SoilBiogeochemNLeaching - ! - ! !PRIVATE DATA: - type, private :: params_type - real(r8):: sf ! soluble fraction of mineral N (unitless) - real(r8):: sf_no3 ! soluble fraction of NO3 (unitless) - end type params_type - - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! Read in parameters - ! - ! !USES: - use ncdio_pio , only : file_desc_t,ncd_io - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNNDynamicsParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - tString='sf_minn' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%sf=tempr - - tString='sf_no3' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%sf_no3=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, & - waterstate_inst, waterflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update the nitrogen leaching rate - ! as a function of soluble mineral N and total soil water outflow. - ! - ! !USES: - use clm_varpar , only : nlevdecomp, nlevsoi - use clm_time_manager , only : get_step_size - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(waterstate_type) , intent(in) :: waterstate_inst - type(waterflux_type) , intent(in) :: waterflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: j,c,fc ! indices - real(r8) :: dt ! radiation time step (seconds) - real(r8) :: sf ! soluble fraction of mineral N (unitless) - real(r8) :: sf_no3 ! soluble fraction of NO3 (unitless) - real(r8) :: disn_conc ! dissolved mineral N concentration (gN/kg water) - real(r8) :: tot_water(bounds%begc:bounds%endc) ! total column liquid water (kg water/m2) - real(r8) :: surface_water(bounds%begc:bounds%endc) ! liquid water to shallow surface depth (kg water/m2) - real(r8) :: drain_tot(bounds%begc:bounds%endc) ! total drainage flux (mm H2O /s) - real(r8), parameter :: depth_runoff_Nloss = 0.05 ! (m) depth over which runoff mixes with soil water for N loss to runoff - !----------------------------------------------------------------------- - - associate( & - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - - qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s) - qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] surface runoff (mm H2O /s) - - sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N - smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] - - sminn_leached_vr => soilbiogeochem_nitrogenflux_inst%sminn_leached_vr_col , & ! Output: [real(r8) (:,:) ] rate of mineral N leaching (gN/m3/s) - smin_no3_leached_vr => soilbiogeochem_nitrogenflux_inst%smin_no3_leached_vr_col , & ! Output: [real(r8) (:,:) ] rate of mineral NO3 leaching (gN/m3/s) - smin_no3_runoff_vr => soilbiogeochem_nitrogenflux_inst%smin_no3_runoff_vr_col & ! Output: [real(r8) (:,:) ] rate of mineral NO3 loss with runoff (gN/m3/s) - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - if (.not. use_nitrif_denitrif) then - ! set constant sf - sf = params_inst%sf - else - ! Assume that 100% of the soil NO3 is in a soluble form - sf_no3 = params_inst%sf_no3 - end if - - ! calculate the total soil water - tot_water(bounds%begc:bounds%endc) = 0._r8 - do j = 1,nlevsoi - do fc = 1,num_soilc - c = filter_soilc(fc) - tot_water(c) = tot_water(c) + h2osoi_liq(c,j) - end do - end do - - ! for runoff calculation; calculate total water to a given depth - surface_water(bounds%begc:bounds%endc) = 0._r8 - do j = 1,nlevsoi - if ( zisoi(j) <= depth_runoff_Nloss) then - do fc = 1,num_soilc - c = filter_soilc(fc) - surface_water(c) = surface_water(c) + h2osoi_liq(c,j) - end do - elseif ( zisoi(j-1) < depth_runoff_Nloss) then - do fc = 1,num_soilc - c = filter_soilc(fc) - surface_water(c) = surface_water(c) + h2osoi_liq(c,j) * ( (depth_runoff_Nloss - zisoi(j-1)) / col%dz(c,j)) - end do - endif - end do - - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - drain_tot(c) = qflx_drain(c) - end do - - - if (.not. use_nitrif_denitrif) then - - !---------------------------------------- - ! --------- NITRIF_NITRIF OFF------------ - !---------------------------------------- - - do j = 1,nlevdecomp - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (.not. use_vertsoilc) then - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (tot_water(c) > 0._r8) then - disn_conc = (sf * sminn_vr(c,j) ) / tot_water(c) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - sminn_leached_vr(c,j) = disn_conc * drain_tot(c) - else - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (h2osoi_liq(c,j) > 0._r8) then - disn_conc = (sf * sminn_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - sminn_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) - - end if - - ! limit the flux based on current sminn state - ! only let at most the assumed soluble fraction - ! of sminn be leached on any given timestep - sminn_leached_vr(c,j) = min(sminn_leached_vr(c,j), (sf * sminn_vr(c,j))/dt) - - ! limit the flux to a positive value - sminn_leached_vr(c,j) = max(sminn_leached_vr(c,j), 0._r8) - - end do - end do - - else - - !---------------------------------------- - ! --------- NITRIF_NITRIF ON------------- - !---------------------------------------- - - do j = 1,nlevdecomp - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (.not. use_vertsoilc) then - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (tot_water(c) > 0._r8) then - disn_conc = (sf_no3 * smin_no3_vr(c,j) )/tot_water(c) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - smin_no3_leached_vr(c,j) = disn_conc * drain_tot(c) - else - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (h2osoi_liq(c,j) > 0._r8) then - disn_conc = (sf_no3 * smin_no3_vr(c,j) * col%dz(c,j) )/(h2osoi_liq(c,j) ) - end if - ! - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - smin_no3_leached_vr(c,j) = disn_conc * drain_tot(c) * h2osoi_liq(c,j) / ( tot_water(c) * col%dz(c,j) ) - ! - ! ensure that leaching rate isn't larger than soil N pool - smin_no3_leached_vr(c,j) = min(smin_no3_leached_vr(c,j), smin_no3_vr(c,j) / dt ) - ! - ! limit the leaching flux to a positive value - smin_no3_leached_vr(c,j) = max(smin_no3_leached_vr(c,j), 0._r8) - ! - ! - ! calculate the N loss from surface runoff, assuming a shallow mixing of surface waters into soil and removal based on runoff - if ( zisoi(j) <= depth_runoff_Nloss ) then - smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & - h2osoi_liq(c,j) / ( surface_water(c) * col%dz(c,j) ) - elseif ( zisoi(j-1) < depth_runoff_Nloss ) then - smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & - h2osoi_liq(c,j) * ((depth_runoff_Nloss - zisoi(j-1)) / & - col%dz(c,j)) / ( surface_water(c) * (depth_runoff_Nloss-zisoi(j-1) )) - else - smin_no3_runoff_vr(c,j) = 0._r8 - endif - ! - ! ensure that runoff rate isn't larger than soil N pool - smin_no3_runoff_vr(c,j) = min(smin_no3_runoff_vr(c,j), smin_no3_vr(c,j) / dt - smin_no3_leached_vr(c,j)) - ! - ! limit the flux to a positive value - smin_no3_runoff_vr(c,j) = max(smin_no3_runoff_vr(c,j), 0._r8) - - - endif - ! limit the flux based on current smin_no3 state - ! only let at most the assumed soluble fraction - ! of smin_no3 be leached on any given timestep - smin_no3_leached_vr(c,j) = min(smin_no3_leached_vr(c,j), (sf_no3 * smin_no3_vr(c,j))/dt) - - ! limit the flux to a positive value - smin_no3_leached_vr(c,j) = max(smin_no3_leached_vr(c,j), 0._r8) - - end do - end do - endif - - end associate - - end subroutine SoilBiogeochemNLeaching - -end module SoilBiogeochemNLeachingMod diff --git a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 b/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 deleted file mode 100644 index 5fde16787c..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 +++ /dev/null @@ -1,267 +0,0 @@ -module SoilBiogeochemNStateUpdate1Mod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module for nitrogen state variable updates, non-mortality fluxes. - ! - ! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevdecomp, ndecomp_pools, ndecomp_cascade_transitions - use clm_varpar , only : i_met_lit, i_cel_lit, i_lig_lit, i_cwd - use clm_varctl , only : iulog, use_nitrif_denitrif, use_crop - use clm_varcon , only : nitrif_n2o_loss_frac, dzsoi_decomp - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenfluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use CNSharedParamsMod , only : use_fun - use ColumnType , only : col - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: SoilBiogeochemNStateUpdate1 - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemNStateUpdate1(num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_nitrogenflux_inst, soilbiogeochem_nitrogenstate_inst) - ! - ! !DESCRIPTION: - ! On the radiation time step, update all the prognostic nitrogen state - ! variables (except for gap-phase mortality and fire fluxes) - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_state_type) , intent(in) :: soilbiogeochem_state_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,p,j,l,k ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - - !----------------------------------------------------------------------- - - associate( & - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step - - ndep_prof => soilbiogeochem_state_inst%ndep_prof_col , & ! Input: [real(r8) (:,:) ] profile over which N deposition is distributed through column (1/m) - nfixation_prof => soilbiogeochem_state_inst%nfixation_prof_col , & ! Input: [real(r8) (:,:) ] profile over which N fixation is distributed through column (1/m) - - nf => soilbiogeochem_nitrogenflux_inst , & ! Output: - ns => soilbiogeochem_nitrogenstate_inst & ! Output: - ) - - ! set time steps - dt = real( get_step_size(), r8 ) - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if(use_fun)then !RF in FUN logic, the fixed N goes straight into the plant, and not into the SMINN pool. - ! N deposition and fixation (put all into NH4 pool) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%ndep_to_sminn_col(c)*dt * ndep_prof(c,j) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%ffix_to_sminn_col(c)*dt * nfixation_prof(c,j) - else - if (.not. use_nitrif_denitrif) then - - ! N deposition and fixation - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) + nf%ndep_to_sminn_col(c)*dt * ndep_prof(c,j) - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) + nf%nfix_to_sminn_col(c)*dt * nfixation_prof(c,j) - - else - - ! N deposition and fixation (put all into NH4 pool) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%ndep_to_sminn_col(c)*dt * ndep_prof(c,j) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%nfix_to_sminn_col(c)*dt * nfixation_prof(c,j) - - end if - end if - - end do - - end do - - ! repeating N dep and fixation for crops - if ( use_crop )then - do j = 1, nlevdecomp - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - if (.not. use_nitrif_denitrif) then - - ! N deposition and fixation - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) & - + nf%fert_to_sminn_col(c)*dt * ndep_prof(c,j) - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) & - + nf%soyfixn_to_sminn_col(c)*dt * nfixation_prof(c,j) - - else - - ! N deposition and fixation (put all into NH4 pool) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) & - + nf%fert_to_sminn_col(c)*dt * ndep_prof(c,j) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) & - + nf%soyfixn_to_sminn_col(c)*dt * nfixation_prof(c,j) - - end if - end do - end do - end if - - ! decomposition fluxes - do k = 1, ndecomp_cascade_transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) - & - nf%decomp_cascade_ntransfer_vr_col(c,j,k) * dt - end do - end do - end do - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) + & - (nf%decomp_cascade_ntransfer_vr_col(c,j,k) + & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k)) * dt - end do - end do - else ! terminal transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) - & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k) * dt - end do - end do - end if - end do - - if (.not. use_nitrif_denitrif) then - - !-------------------------------------------------------- - !------------- NITRIF_DENITRIF OFF ------------------- - !-------------------------------------------------------- - - ! immobilization/mineralization in litter-to-SOM and SOM-to-SOM fluxes and denitrification fluxes - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) - & - (nf%sminn_to_denit_decomp_cascade_vr_col(c,j,k) + & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k))* dt - end do - end do - else - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) - & - nf%sminn_to_denit_decomp_cascade_vr_col(c,j,k)* dt - - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) + & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k)* dt - - end do - end do - endif - end do - - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - ! "bulk denitrification" - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) - nf%sminn_to_denit_excess_vr_col(c,j) * dt - - ! total plant uptake from mineral N - if ( .not. use_fun ) then - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) - nf%sminn_to_plant_vr_col(c,j)*dt - else - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) - nf%sminn_to_plant_fun_vr_col(c,j)*dt - end if - ! flux that prevents N limitation (when Carbon_only is set) - ns%sminn_vr_col(c,j) = ns%sminn_vr_col(c,j) + nf%supplement_to_sminn_vr_col(c,j)*dt - end do - end do - - else - - !-------------------------------------------------------- - !------------- NITRIF_DENITRIF ON -------------------- - !-------------------------------------------------------- - - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! mineralization fluxes (divert a fraction of this stream to nitrification flux, add the rest to NH4 pool) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%gross_nmin_vr_col(c,j)*dt - - ! immobilization fluxes - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) - nf%actual_immob_nh4_vr_col(c,j)*dt - - ns%smin_no3_vr_col(c,j) = ns%smin_no3_vr_col(c,j) - nf%actual_immob_no3_vr_col(c,j)*dt - - ! plant uptake fluxes - if ( .not. use_fun )then - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) - nf%smin_nh4_to_plant_vr_col(c,j)*dt - - ns%smin_no3_vr_col(c,j) = ns%smin_no3_vr_col(c,j) - nf%smin_no3_to_plant_vr_col(c,j)*dt - else - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) - nf%sminn_to_plant_fun_nh4_vr_col(c,j)*dt - - ns%smin_no3_vr_col(c,j) = ns%smin_no3_vr_col(c,j) - nf%sminn_to_plant_fun_no3_vr_col(c,j)*dt - end if - - - ! Account for nitrification fluxes - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) - nf%f_nit_vr_col(c,j) * dt - - ns%smin_no3_vr_col(c,j) = ns%smin_no3_vr_col(c,j) + nf%f_nit_vr_col(c,j) * dt & - * (1._r8 - nitrif_n2o_loss_frac) - - ! Account for denitrification fluxes - ns%smin_no3_vr_col(c,j) = ns%smin_no3_vr_col(c,j) - nf%f_denit_vr_col(c,j) * dt - - ! flux that prevents N limitation (when Carbon_only is set; put all into NH4) - ns%smin_nh4_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + nf%supplement_to_sminn_vr_col(c,j)*dt - - ! update diagnostic total - ns%sminn_vr_col(c,j) = ns%smin_nh4_vr_col(c,j) + ns%smin_no3_vr_col(c,j) - - end do ! end of column loop - end do - - end if - - end associate - - end subroutine SoilBiogeochemNStateUpdate1 - -end module SoilBiogeochemNStateUpdate1Mod diff --git a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 b/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 deleted file mode 100644 index 4286b14c4a..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNitrifDenitrifMod.F90 +++ /dev/null @@ -1,469 +0,0 @@ -module SoilBiogeochemNitrifDenitrifMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate nitrification and denitrification rates - ! - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod , only : SHR_CONST_TKFRZ - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : nlevdecomp - use clm_varcon , only : rpi, grav - use clm_varcon , only : d_con_g, d_con_w, secspday - use clm_varctl , only : use_lch4 - use abortutils , only : endrun - use decompMod , only : bounds_type - use SoilStatetype , only : soilstate_type - use WaterStateType , only : waterstate_type - use TemperatureType , only : temperature_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use ch4Mod , only : ch4_type - use ColumnType , only : col - ! - implicit none - private - ! - public :: readParams ! Read in parameters from params file - public :: nitrifReadNML ! Read in namelist - public :: SoilBiogeochemNitrifDenitrif ! Calculate nitrification and - ! - type, private :: params_type - real(r8) :: k_nitr_max ! maximum nitrification rate constant (1/s) - real(r8) :: surface_tension_water ! surface tension of water(J/m^2), Arah an and Vinten 1995 - real(r8) :: rij_kro_a ! Arah and Vinten 1995) - real(r8) :: rij_kro_alpha ! parameter to calculate anoxic fraction of soil (Arah and Vinten 1995) - real(r8) :: rij_kro_beta ! (Arah and Vinten 1995) - real(r8) :: rij_kro_gamma ! (Arah and Vinten 1995) - real(r8) :: rij_kro_delta ! (Arah and Vinten 1995) - real(r8) :: denitrif_respiration_coefficient ! Multiplier for heterotrophic respiration for max denitrif rates - real(r8) :: denitrif_respiration_exponent ! Exponents for heterotrophic respiration for max denitrif rates - real(r8) :: denitrif_nitrateconc_coefficient ! Multiplier for nitrate concentration for max denitrif rates - real(r8) :: denitrif_nitrateconc_exponent ! Exponent for nitrate concentration for max denitrif rates - end type params_type - - type(params_type), private :: params_inst - - logical, public :: no_frozen_nitrif_denitrif = .false. ! stop nitrification and denitrification in frozen soils - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - use ncdio_pio, only: file_desc_t,ncd_io - ! - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNNitrifDenitrifParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - ! - ! read in constants - ! - tString='surface_tension_water' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%surface_tension_water=tempr - - tString='rij_kro_a' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rij_kro_a=tempr - - tString='rij_kro_alpha' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rij_kro_alpha=tempr - - tString='rij_kro_beta' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rij_kro_beta=tempr - - tString='rij_kro_gamma' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rij_kro_gamma=tempr - - tString='rij_kro_delta' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rij_kro_delta=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine nitrifReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for nitrification/denitrification - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'ReadNML' - character(len=*), parameter :: nmlname = 'nitrif_inparm' - !----------------------------------------------------------------------- - real(r8) :: k_nitr_max_perday, denitrif_respiration_coefficient, & - denitrif_respiration_exponent, denitrif_nitrateconc_coefficient, & - denitrif_nitrateconc_exponent - - namelist /nitrif_inparm/ k_nitr_max_perday, denitrif_respiration_coefficient, & - denitrif_respiration_exponent, denitrif_nitrateconc_coefficient, & - denitrif_nitrateconc_exponent - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - denitrif_respiration_coefficient = 0.1_r8 - denitrif_respiration_exponent = 1.3_r8 - denitrif_nitrateconc_coefficient = 1.15_r8 - denitrif_nitrateconc_exponent = 0.57_r8 - - k_nitr_max_perday = 0.1_r8 - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=nitrif_inparm, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(sourcefile, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (k_nitr_max_perday , mpicom) - call shr_mpi_bcast (denitrif_respiration_coefficient , mpicom) - call shr_mpi_bcast (denitrif_respiration_exponent , mpicom) - call shr_mpi_bcast (denitrif_nitrateconc_coefficient , mpicom) - call shr_mpi_bcast (denitrif_nitrateconc_exponent , mpicom) - - params_inst%k_nitr_max = k_nitr_max_perday / secspday ! Change units to per second - params_inst%denitrif_respiration_coefficient = denitrif_respiration_coefficient - params_inst%denitrif_respiration_exponent = denitrif_respiration_exponent - params_inst%denitrif_nitrateconc_coefficient = denitrif_nitrateconc_coefficient - params_inst%denitrif_nitrateconc_exponent = denitrif_nitrateconc_exponent - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=nitrif_inparm) - write(iulog,*) ' ' - end if - - end subroutine nitrifReadNML - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemNitrifDenitrif(bounds, num_soilc, filter_soilc, & - soilstate_inst, waterstate_inst, temperature_inst, ch4_inst, & - soilbiogeochem_carbonflux_inst, soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) - ! - ! !DESCRIPTION: - ! calculate nitrification and denitrification rates - ! - ! !USES: - use clm_time_manager , only : get_curr_date, get_step_size - use CNSharedParamsMod , only : anoxia_wtsat, CNParamsShareInst - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(ch4_type) , intent(in) :: ch4_inst - type(soilbiogeochem_carbonflux_type) , intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - ! - ! !LOCAL VARIABLES: - integer :: c, fc, reflev, j - real(r8) :: soil_hr_vr(bounds%begc:bounds%endc,1:nlevdecomp) ! total soil respiration rate (g C / m3 / s) - real(r8) :: g_per_m3__to__ug_per_gsoil - real(r8) :: g_per_m3_sec__to__ug_per_gsoil_day - real(r8) :: mu, sigma - real(r8) :: t - real(r8) :: pH(bounds%begc:bounds%endc) - !debug-- put these type structure for outing to hist files - real(r8) :: co2diff_con(2) ! diffusion constants for CO2 - real(r8) :: eps - real(r8) :: f_a - real(r8) :: surface_tension_water ! (J/m^2), Arah and Vinten 1995 - real(r8) :: rij_kro_a ! Arah and Vinten 1995 - real(r8) :: rij_kro_alpha ! Arah and Vinten 1995 - real(r8) :: rij_kro_beta ! Arah and Vinten 1995 - real(r8) :: rij_kro_gamma ! Arah and Vinten 1995 - real(r8) :: rij_kro_delta ! Arah and Vinten 1995 - real(r8) :: rho_w = 1.e3_r8 ! (kg/m3) - real(r8) :: r_max - real(r8) :: r_min(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: ratio_diffusivity_water_gas(bounds%begc:bounds%endc,1:nlevdecomp) - real(r8) :: om_frac - real(r8) :: anaerobic_frac_sat, r_psi_sat, r_min_sat ! scalar values in sat portion for averaging - real(r8) :: organic_max ! organic matter content (kg/m3) where - ! soil is assumed to act like peat - character(len=32) :: subname='nitrif_denitrif' ! subroutine name - !----------------------------------------------------------------------- - - associate( & - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) (nlevgrnd) - watfc => soilstate_inst%watfc_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at field capacity (nlevsoi) - bd => soilstate_inst%bd_col , & ! Input: [real(r8) (:,:) ] bulk density of dry soil material [kg/m3] - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) - cellorg => soilstate_inst%cellorg_col , & ! Input: [real(r8) (:,:) ] column 3D org (kg/m3 organic matter) (nlevgrnd) - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) - - h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) - h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - - o2_decomp_depth_unsat => ch4_inst%o2_decomp_depth_unsat_col , & ! Input: [real(r8) (:,:) ] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_o2_unsat => ch4_inst%conc_o2_unsat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - o2_decomp_depth_sat => ch4_inst%o2_decomp_depth_sat_col , & ! Input: [real(r8) (:,:) ] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) - - smin_nh4_vr => soilbiogeochem_nitrogenstate_inst%smin_nh4_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral NH4 pool - smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral NO3 pool - - phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col , & ! Input: [real(r8) (:,:) ] potential hr (not N-limited) - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Input: [real(r8) (:,:) ] soil water scalar for decomp - t_scalar => soilbiogeochem_carbonflux_inst%t_scalar_col , & ! Input: [real(r8) (:,:) ] temperature scalar for decomp - denit_resp_coef => params_inst%denitrif_respiration_coefficient , & ! Input: [real(r8) ] coefficient for max denitrification rate based on respiration - denit_resp_exp => params_inst%denitrif_respiration_exponent , & ! Input: [real(r8) ] exponent for max denitrification rate based on respiration - denit_nitrate_coef => params_inst%denitrif_nitrateconc_coefficient , & ! Input: [real(r8) ] coefficient for max denitrification rate based on nitrate concentration - denit_nitrate_exp => params_inst%denitrif_nitrateconc_exponent , & ! Input: [real(r8) ] exponent for max denitrification rate based on nitrate concentration - k_nitr_max => params_inst%k_nitr_max , & ! Input: - - r_psi => soilbiogeochem_nitrogenflux_inst%r_psi_col , & ! Output: [real(r8) (:,:) ] - anaerobic_frac => soilbiogeochem_nitrogenflux_inst%anaerobic_frac_col , & ! Output: [real(r8) (:,:) ] - ! ! subsets of the n flux calcs (for diagnostic/debugging purposes) - smin_no3_massdens_vr => soilbiogeochem_nitrogenflux_inst%smin_no3_massdens_vr_col , & ! Output: [real(r8) (:,:) ] (ugN / g soil) soil nitrate concentration - k_nitr_t_vr => soilbiogeochem_nitrogenflux_inst%k_nitr_t_vr_col , & ! Output: [real(r8) (:,:) ] - k_nitr_ph_vr => soilbiogeochem_nitrogenflux_inst%k_nitr_ph_vr_col , & ! Output: [real(r8) (:,:) ] - k_nitr_h2o_vr => soilbiogeochem_nitrogenflux_inst%k_nitr_h2o_vr_col , & ! Output: [real(r8) (:,:) ] - k_nitr_vr => soilbiogeochem_nitrogenflux_inst%k_nitr_vr_col , & ! Output: [real(r8) (:,:) ] - wfps_vr => soilbiogeochem_nitrogenflux_inst%wfps_vr_col , & ! Output: [real(r8) (:,:) ] - fmax_denit_carbonsubstrate_vr => soilbiogeochem_nitrogenflux_inst%fmax_denit_carbonsubstrate_vr_col , & ! Output: [real(r8) (:,:) ] - fmax_denit_nitrate_vr => soilbiogeochem_nitrogenflux_inst%fmax_denit_nitrate_vr_col , & ! Output: [real(r8) (:,:) ] - f_denit_base_vr => soilbiogeochem_nitrogenflux_inst%f_denit_base_vr_col , & ! Output: [real(r8) (:,:) ] - diffus => soilbiogeochem_nitrogenflux_inst%diffus_col , & ! Output: [real(r8) (:,:) ] diffusivity (unitless fraction of total diffusivity) - ratio_k1 => soilbiogeochem_nitrogenflux_inst%ratio_k1_col , & ! Output: [real(r8) (:,:) ] - ratio_no3_co2 => soilbiogeochem_nitrogenflux_inst%ratio_no3_co2_col , & ! Output: [real(r8) (:,:) ] - soil_co2_prod => soilbiogeochem_nitrogenflux_inst%soil_co2_prod_col , & ! Output: [real(r8) (:,:) ] (ug C / g soil / day) - fr_WFPS => soilbiogeochem_nitrogenflux_inst%fr_WFPS_col , & ! Output: [real(r8) (:,:) ] - soil_bulkdensity => soilbiogeochem_nitrogenflux_inst%soil_bulkdensity_col , & ! Output: [real(r8) (:,:) ] (kg soil / m3) bulk density of soil (including water) - pot_f_nit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_nit_vr_col , & ! Output: [real(r8) (:,:) ] (gN/m3/s) potential soil nitrification flux - - pot_f_denit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_denit_vr_col , & ! Output: [real(r8) (:,:) ] (gN/m3/s) potential soil denitrification flux - n2_n2o_ratio_denit_vr => soilbiogeochem_nitrogenflux_inst%n2_n2o_ratio_denit_vr_col & ! Output: [real(r8) (:,:) ] ratio of N2 to N2O production by denitrification [gN/gN] - ) - - surface_tension_water = params_inst%surface_tension_water - - ! Set parameters from simple-structure model to calculate anoxic fratction (Arah and Vinten 1995) - rij_kro_a = params_inst%rij_kro_a - rij_kro_alpha = params_inst%rij_kro_alpha - rij_kro_beta = params_inst%rij_kro_beta - rij_kro_gamma = params_inst%rij_kro_gamma - rij_kro_delta = params_inst%rij_kro_delta - - organic_max = CNParamsShareInst%organic_max - - pH(bounds%begc:bounds%endc) = 6.5 !!! set all soils with the same pH as placeholder here - co2diff_con(1) = 0.1325_r8 - co2diff_con(2) = 0.0009_r8 - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - !---------------- calculate soil anoxia state - ! calculate gas diffusivity of soil at field capacity here - ! use expression from methane code, but neglect OM for now - f_a = 1._r8 - watfc(c,j) / watsat(c,j) - eps = watsat(c,j)-watfc(c,j) ! Air-filled fraction of total soil volume - - ! use diffusivity calculation including peat - if (use_lch4) then - - if (organic_max > 0._r8) then - om_frac = min(cellorg(c,j)/organic_max, 1._r8) - ! Use first power, not square as in iniTimeConst - else - om_frac = 1._r8 - end if - diffus (c,j) = (d_con_g(2,1) + d_con_g(2,2)*t_soisno(c,j)) * 1.e-4_r8 * & - (om_frac * f_a**(10._r8/3._r8) / watsat(c,j)**2 + & - (1._r8-om_frac) * eps**2 * f_a**(3._r8 / bsw(c,j)) ) - - ! calculate anoxic fraction of soils - ! use rijtema and kroess model after Riley et al., 2000 - ! caclulated r_psi as a function of psi - r_min(c,j) = 2 * surface_tension_water / (rho_w * grav * abs(soilpsi(c,j))) - r_max = 2 * surface_tension_water / (rho_w * grav * 0.1_r8) - r_psi(c,j) = sqrt(r_min(c,j) * r_max) - ratio_diffusivity_water_gas(c,j) = (d_con_g(2,1) + d_con_g(2,2)*t_soisno(c,j) ) * 1.e-4_r8 / & - ((d_con_w(2,1) + d_con_w(2,2)*t_soisno(c,j) + d_con_w(2,3)*t_soisno(c,j)**2) * 1.e-9_r8) - - if (o2_decomp_depth_unsat(c,j) > 0._r8) then - anaerobic_frac(c,j) = exp(-rij_kro_a * r_psi(c,j)**(-rij_kro_alpha) * & - o2_decomp_depth_unsat(c,j)**(-rij_kro_beta) * & - conc_o2_unsat(c,j)**rij_kro_gamma * (h2osoi_vol(c,j) + ratio_diffusivity_water_gas(c,j) * & - watsat(c,j))**rij_kro_delta) - else - anaerobic_frac(c,j) = 0._r8 - endif - - if (anoxia_wtsat) then ! Average saturated fraction values into anaerobic_frac(c,j). - r_min_sat = 2._r8 * surface_tension_water / (rho_w * grav * abs(grav * 1.e-6_r8 * sucsat(c,j))) - r_psi_sat = sqrt(r_min_sat * r_max) - if (o2_decomp_depth_sat(c,j) > 0._r8) then - anaerobic_frac_sat = exp(-rij_kro_a * r_psi_sat**(-rij_kro_alpha) * & - o2_decomp_depth_sat(c,j)**(-rij_kro_beta) * & - conc_o2_sat(c,j)**rij_kro_gamma * (watsat(c,j) + ratio_diffusivity_water_gas(c,j) * & - watsat(c,j))**rij_kro_delta) - else - anaerobic_frac_sat = 0._r8 - endif - anaerobic_frac(c,j) = (1._r8 - finundated(c))*anaerobic_frac(c,j) + finundated(c)*anaerobic_frac_sat - end if - - else - ! NITRIF_DENITRIF requires Methane model to be active, - ! otherwise diffusivity will be zeroed out here. EBK CDK 10/18/2011 - anaerobic_frac(c,j) = 0._r8 - diffus (c,j) = 0._r8 - !call endrun(msg=' ERROR: NITRIF_DENITRIF requires Methane model to be active'//errMsg(sourcefile, __LINE__) ) - end if - - - !---------------- nitrification - ! follows CENTURY nitrification scheme (Parton et al., (2001, 1996)) - - ! assume nitrification temp function equal to the HR scalar - k_nitr_t_vr(c,j) = min(t_scalar(c,j), 1._r8) - - ! ph function from Parton et al., (2001, 1996) - k_nitr_ph_vr(c,j) = 0.56 + atan(rpi * 0.45 * (-5.+ pH(c)))/rpi - - ! moisture function-- assume the same moisture function as limits heterotrophic respiration - ! Parton et al. base their nitrification- soil moisture rate constants based on heterotrophic rates-- can we do the same? - k_nitr_h2o_vr(c,j) = w_scalar(c,j) - - ! nitrification constant is a set scalar * temp, moisture, and ph scalars - k_nitr_vr(c,j) = k_nitr_max * k_nitr_t_vr(c,j) * k_nitr_h2o_vr(c,j) * k_nitr_ph_vr(c,j) - - ! first-order decay of ammonium pool with scalar defined above - pot_f_nit_vr(c,j) = max(smin_nh4_vr(c,j) * k_nitr_vr(c,j), 0._r8) - - ! limit to oxic fraction of soils - pot_f_nit_vr(c,j) = pot_f_nit_vr(c,j) * (1._r8 - anaerobic_frac(c,j)) - - ! limit to non-frozen soil layers - if ( t_soisno(c,j) <= SHR_CONST_TKFRZ .and. no_frozen_nitrif_denitrif) then - pot_f_nit_vr(c,j) = 0._r8 - endif - - - !---------------- denitrification - ! first some input variables an unit conversions - soil_hr_vr(c,j) = phr_vr(c,j) - - ! CENTURY papers give denitrification in units of per gram soil; need to convert from volumetric to mass-based units here - soil_bulkdensity(c,j) = bd(c,j) + h2osoi_liq(c,j)/col%dz(c,j) - - g_per_m3__to__ug_per_gsoil = 1.e3_r8 / soil_bulkdensity(c,j) - - g_per_m3_sec__to__ug_per_gsoil_day = g_per_m3__to__ug_per_gsoil * secspday - - smin_no3_massdens_vr(c,j) = max(smin_no3_vr(c,j), 0._r8) * g_per_m3__to__ug_per_gsoil - - soil_co2_prod(c,j) = (soil_hr_vr(c,j) * (g_per_m3_sec__to__ug_per_gsoil_day)) - - !! maximum potential denitrification rates based on heterotrophic respiration rates or nitrate concentrations, - !! from (del Grosso et al., 2000) - fmax_denit_carbonsubstrate_vr(c,j) = (denit_resp_coef * (soil_co2_prod(c,j)**denit_resp_exp)) & - / g_per_m3_sec__to__ug_per_gsoil_day - ! - fmax_denit_nitrate_vr(c,j) = (denit_nitrate_coef * smin_no3_massdens_vr(c,j)**denit_nitrate_exp) & - / g_per_m3_sec__to__ug_per_gsoil_day - - ! find limiting denitrification rate - f_denit_base_vr(c,j) = max(min(fmax_denit_carbonsubstrate_vr(c,j), fmax_denit_nitrate_vr(c,j)),0._r8) - - ! limit to non-frozen soil layers - if ( t_soisno(c,j) <= SHR_CONST_TKFRZ .and. no_frozen_nitrif_denitrif ) then - f_denit_base_vr(c,j) = 0._r8 - endif - - ! limit to anoxic fraction of soils - pot_f_denit_vr(c,j) = f_denit_base_vr(c,j) * anaerobic_frac(c,j) - - ! now calculate the ratio of N2O to N2 from denitrifictaion, following Del Grosso et al., 2000 - ! diffusivity constant (figure 6b) - ratio_k1(c,j) = max(1.7_r8, 38.4_r8 - 350._r8 * diffus(c,j)) - - ! ratio function (figure 7c) - if ( soil_co2_prod(c,j) > 1.0e-9_r8 ) then - ratio_no3_co2(c,j) = smin_no3_massdens_vr(c,j) / soil_co2_prod(c,j) - else - ! fucntion saturates at large no3/co2 ratios, so set as some nominally large number - ratio_no3_co2(c,j) = 100._r8 - endif - - ! total water limitation function (Del Grosso et al., 2000, figure 7a) - wfps_vr(c,j) = max(min(h2osoi_vol(c,j)/watsat(c, j), 1._r8), 0._r8) * 100._r8 - fr_WFPS(c,j) = max(0.1_r8, 0.015_r8 * wfps_vr(c,j) - 0.32_r8) - if (use_lch4) then - if (anoxia_wtsat) then - fr_WFPS(c,j) = fr_WFPS(c,j)*(1._r8 - finundated(c)) + finundated(c)*1.18_r8 - end if - end if - - ! final ratio expression - n2_n2o_ratio_denit_vr(c,j) = max(0.16*ratio_k1(c,j), ratio_k1(c,j)*exp(-0.8 * ratio_no3_co2(c,j))) * fr_WFPS(c,j) - - end do - - end do - - end associate - - end subroutine SoilBiogeochemNitrifDenitrif - -end module SoilBiogeochemNitrifDenitrifMod diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 deleted file mode 100644 index 49371a8c9d..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenFluxType.F90 +++ /dev/null @@ -1,1279 +0,0 @@ -module SoilBiogeochemNitrogenFluxType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : nlevdecomp_full, nlevdecomp - use clm_varcon , only : spval, ispval, dzsoi_decomp - use decompMod , only : bounds_type - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_crop - use CNSharedParamsMod , only : use_fun - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use abortutils , only : endrun - use LandunitType , only : lun - use ColumnType , only : col - ! - ! !PUBLIC TYPES: - implicit none - private - ! - type, public :: SoilBiogeochem_nitrogenflux_type - - ! deposition fluxes - real(r8), pointer :: ndep_to_sminn_col (:) ! col atmospheric N deposition to soil mineral N (gN/m2/s) - real(r8), pointer :: nfix_to_sminn_col (:) ! col symbiotic/asymbiotic N fixation to soil mineral N (gN/m2/s) - real(r8), pointer :: ffix_to_sminn_col (:) ! col free living N fixation to soil mineral N (gN/m2/s) - real(r8), pointer :: fert_to_sminn_col (:) ! col fertilizer N to soil mineral N (gN/m2/s) - real(r8), pointer :: soyfixn_to_sminn_col (:) ! col soybean fixation to soil mineral N (gN/m2/s) - - ! decomposition fluxes - real(r8), pointer :: decomp_cascade_ntransfer_vr_col (:,:,:) ! col vert-res transfer of N from donor to receiver pool along decomp. cascade (gN/m3/s) - real(r8), pointer :: decomp_cascade_ntransfer_col (:,:) ! col vert-int (diagnostic) transfer of N from donor to receiver pool along decomp. cascade (gN/m2/s) - real(r8), pointer :: decomp_cascade_sminn_flux_vr_col (:,:,:) ! col vert-res mineral N flux for transition along decomposition cascade (gN/m3/s) - real(r8), pointer :: decomp_cascade_sminn_flux_col (:,:) ! col vert-int (diagnostic) mineral N flux for transition along decomposition cascade (gN/m2/s) - - ! Used to update concentrations concurrently with vertical transport - ! vertically-resolved immobilization fluxes - real(r8), pointer :: potential_immob_vr_col (:,:) ! col vertically-resolved potential N immobilization (gN/m3/s) at each level - real(r8), pointer :: potential_immob_col (:) ! col vert-int (diagnostic) potential N immobilization (gN/m2/s) - real(r8), pointer :: actual_immob_vr_col (:,:) ! col vertically-resolved actual N immobilization (gN/m3/s) at each level - real(r8), pointer :: actual_immob_col (:) ! col vert-int (diagnostic) actual N immobilization (gN/m2/s) - real(r8), pointer :: sminn_to_plant_vr_col (:,:) ! col vertically-resolved plant uptake of soil mineral N (gN/m3/s) - real(r8), pointer :: sminn_to_plant_col (:) ! col vert-int (diagnostic) plant uptake of soil mineral N (gN/m2/s) - real(r8), pointer :: supplement_to_sminn_vr_col (:,:) ! col vertically-resolved supplemental N supply (gN/m3/s) - real(r8), pointer :: supplement_to_sminn_col (:) ! col vert-int (diagnostic) supplemental N supply (gN/m2/s) - real(r8), pointer :: gross_nmin_vr_col (:,:) ! col vertically-resolved gross rate of N mineralization (gN/m3/s) - real(r8), pointer :: gross_nmin_col (:) ! col vert-int (diagnostic) gross rate of N mineralization (gN/m2/s) - real(r8), pointer :: net_nmin_vr_col (:,:) ! col vertically-resolved net rate of N mineralization (gN/m3/s) - real(r8), pointer :: net_nmin_col (:) ! col vert-int (diagnostic) net rate of N mineralization (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_col (:) ! col total soil N uptake of FUN (gN/m2/s) - ! ---------- NITRIF_DENITRIF --------------------- - - ! nitrification / denitrification fluxes - real(r8), pointer :: f_nit_vr_col (:,:) ! col (gN/m3/s) soil nitrification flux - real(r8), pointer :: f_denit_vr_col (:,:) ! col (gN/m3/s) soil denitrification flux - real(r8), pointer :: f_nit_col (:) ! col (gN/m2/s) soil nitrification flux - real(r8), pointer :: f_denit_col (:) ! col (gN/m2/s) soil denitrification flux - - real(r8), pointer :: pot_f_nit_vr_col (:,:) ! col (gN/m3/s) potential soil nitrification flux - real(r8), pointer :: pot_f_denit_vr_col (:,:) ! col (gN/m3/s) potential soil denitrification flux - real(r8), pointer :: pot_f_nit_col (:) ! col (gN/m2/s) potential soil nitrification flux - real(r8), pointer :: pot_f_denit_col (:) ! col (gN/m2/s) potential soil denitrification flux - real(r8), pointer :: n2_n2o_ratio_denit_vr_col (:,:) ! col ratio of N2 to N2O production by denitrification [gN/gN] - real(r8), pointer :: f_n2o_denit_vr_col (:,:) ! col flux of N2o from denitrification [gN/m^3/s] - real(r8), pointer :: f_n2o_denit_col (:) ! col flux of N2o from denitrification [gN/m^2/s] - real(r8), pointer :: f_n2o_nit_vr_col (:,:) ! col flux of N2o from nitrification [gN/m^3/s] - real(r8), pointer :: f_n2o_nit_col (:) ! col flux of N2o from nitrification [gN/m^2/s] - - ! immobilization / uptake fluxes - real(r8), pointer :: actual_immob_no3_vr_col (:,:) ! col vertically-resolved actual immobilization of NO3 (gN/m3/s) - real(r8), pointer :: actual_immob_nh4_vr_col (:,:) ! col vertically-resolved actual immobilization of NH4 (gN/m3/s) - real(r8), pointer :: smin_no3_to_plant_vr_col (:,:) ! col vertically-resolved plant uptake of soil NO3 (gN/m3/s) - real(r8), pointer :: smin_nh4_to_plant_vr_col (:,:) ! col vertically-resolved plant uptake of soil NH4 (gN/m3/s) - real(r8), pointer :: actual_immob_no3_col (:) ! col actual immobilization of NO3 (gN/m2/s) - real(r8), pointer :: actual_immob_nh4_col (:) ! col actual immobilization of NH4 (gN/m2/s) - real(r8), pointer :: smin_no3_to_plant_col (:) ! col plant uptake of soil NO3 (gN/m2/s) - real(r8), pointer :: smin_nh4_to_plant_col (:) ! col plant uptake of soil Nh4 (gN/m2/s) - - ! leaching fluxes - real(r8), pointer :: smin_no3_leached_vr_col (:,:) ! col vertically-resolved soil mineral NO3 loss to leaching (gN/m3/s) - real(r8), pointer :: smin_no3_leached_col (:) ! col soil mineral NO3 pool loss to leaching (gN/m2/s) - real(r8), pointer :: smin_no3_runoff_vr_col (:,:) ! col vertically-resolved rate of mineral NO3 loss with runoff (gN/m3/s) - real(r8), pointer :: smin_no3_runoff_col (:) ! col soil mineral NO3 pool loss to runoff (gN/m2/s) - - ! nitrification /denitrification diagnostic quantities - real(r8), pointer :: smin_no3_massdens_vr_col (:,:) ! col (ugN / g soil) soil nitrate concentration - real(r8), pointer :: soil_bulkdensity_col (:,:) ! col (kg soil / m3) bulk density of soil - real(r8), pointer :: k_nitr_t_vr_col (:,:) - real(r8), pointer :: k_nitr_ph_vr_col (:,:) - real(r8), pointer :: k_nitr_h2o_vr_col (:,:) - real(r8), pointer :: k_nitr_vr_col (:,:) - real(r8), pointer :: wfps_vr_col (:,:) - real(r8), pointer :: fmax_denit_carbonsubstrate_vr_col (:,:) - real(r8), pointer :: fmax_denit_nitrate_vr_col (:,:) - real(r8), pointer :: f_denit_base_vr_col (:,:) ! col nitrification and denitrification fluxes - real(r8), pointer :: diffus_col (:,:) ! col diffusivity (m2/s) - real(r8), pointer :: ratio_k1_col (:,:) - real(r8), pointer :: ratio_no3_co2_col (:,:) - real(r8), pointer :: soil_co2_prod_col (:,:) - real(r8), pointer :: fr_WFPS_col (:,:) - - real(r8), pointer :: r_psi_col (:,:) - real(r8), pointer :: anaerobic_frac_col (:,:) - real(r8), pointer :: sminn_to_plant_fun_no3_vr_col (:,:) ! col total layer no3 uptake of FUN (gN/m2/s) - real(r8), pointer :: sminn_to_plant_fun_nh4_vr_col (:,:) ! col total layer nh4 uptake of FUN (gN/m2/s) - !----------- no NITRIF_DENITRIF-------------- - - ! denitrification fluxes - real(r8), pointer :: sminn_to_denit_decomp_cascade_vr_col (:,:,:) ! col vertically-resolved denitrification along decomp cascade (gN/m3/s) - real(r8), pointer :: sminn_to_denit_decomp_cascade_col (:,:) ! col vertically-integrated (diagnostic) denitrification along decomp cascade (gN/m2/s) - real(r8), pointer :: sminn_to_denit_excess_vr_col (:,:) ! col vertically-resolved denitrification from excess mineral N pool (gN/m3/s) - real(r8), pointer :: sminn_to_denit_excess_col (:) ! col vertically-integrated (diagnostic) denitrification from excess mineral N pool (gN/m2/s) - - ! leaching fluxes - real(r8), pointer :: sminn_leached_vr_col (:,:) ! col vertically-resolved soil mineral N pool loss to leaching (gN/m3/s) - real(r8), pointer :: sminn_leached_col (:) ! col soil mineral N pool loss to leaching (gN/m2/s) - - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: denit_col (:) ! col total rate of denitrification (gN/m2/s) - real(r8), pointer :: ninputs_col (:) ! col column-level N inputs (gN/m2/s) - real(r8), pointer :: noutputs_col (:) ! col column-level N outputs (gN/m2/s) - real(r8), pointer :: som_n_leached_col (:) ! col total SOM N loss from vertical transport (gN/m^2/s) - real(r8), pointer :: decomp_npools_leached_col (:,:) ! col N loss from vertical transport from each decomposing N pool (gN/m^2/s) - real(r8), pointer :: decomp_npools_transport_tendency_col (:,:,:) ! col N tendency due to vertical transport in decomposing N pools (gN/m^3/s) - - ! all n pools involved in decomposition - real(r8), pointer :: decomp_npools_sourcesink_col (:,:,:) ! col (gN/m3) change in decomposing n pools - ! (sum of all additions and subtractions from stateupdate1). - real(r8), pointer :: sminn_to_plant_fun_vr_col (:,:) ! col total layer soil N uptake of FUN (gN/m2/s) - contains - - procedure , public :: Init - procedure , public :: Restart - procedure , public :: SetValues - procedure , public :: Summary - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - - end type SoilBiogeochem_nitrogenflux_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate (bounds) - call this%InitHistory (bounds) - call this%InitCold (bounds) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize nitrogen flux - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc,endc -! integer :: begp,endp - !------------------------------------------------------------------------ - - begc = bounds%begc; endc = bounds%endc -! begp = bounds%begp; endp = bounds%endp - allocate(this%ndep_to_sminn_col (begc:endc)) ; this%ndep_to_sminn_col (:) = nan - allocate(this%nfix_to_sminn_col (begc:endc)) ; this%nfix_to_sminn_col (:) = nan - allocate(this%ffix_to_sminn_col (begc:endc)) ; this%ffix_to_sminn_col (:) = nan - allocate(this%fert_to_sminn_col (begc:endc)) ; this%fert_to_sminn_col (:) = nan - allocate(this%soyfixn_to_sminn_col (begc:endc)) ; this%soyfixn_to_sminn_col (:) = nan - allocate(this%sminn_to_plant_col (begc:endc)) ; this%sminn_to_plant_col (:) = nan - allocate(this%potential_immob_col (begc:endc)) ; this%potential_immob_col (:) = nan - allocate(this%actual_immob_col (begc:endc)) ; this%actual_immob_col (:) = nan - allocate(this%gross_nmin_col (begc:endc)) ; this%gross_nmin_col (:) = nan - allocate(this%net_nmin_col (begc:endc)) ; this%net_nmin_col (:) = nan - allocate(this%denit_col (begc:endc)) ; this%denit_col (:) = nan - allocate(this%supplement_to_sminn_col (begc:endc)) ; this%supplement_to_sminn_col (:) = nan - allocate(this%ninputs_col (begc:endc)) ; this%ninputs_col (:) = nan - allocate(this%noutputs_col (begc:endc)) ; this%noutputs_col (:) = nan - allocate(this%som_n_leached_col (begc:endc)) ; this%som_n_leached_col (:) = nan - - allocate(this%r_psi_col (begc:endc,1:nlevdecomp_full)) ; this%r_psi_col (:,:) = spval - allocate(this%anaerobic_frac_col (begc:endc,1:nlevdecomp_full)) ; this%anaerobic_frac_col (:,:) = spval - allocate(this%potential_immob_vr_col (begc:endc,1:nlevdecomp_full)) ; this%potential_immob_vr_col (:,:) = nan - allocate(this%actual_immob_vr_col (begc:endc,1:nlevdecomp_full)) ; this%actual_immob_vr_col (:,:) = nan - allocate(this%sminn_to_plant_vr_col (begc:endc,1:nlevdecomp_full)) ; this%sminn_to_plant_vr_col (:,:) = nan - allocate(this%supplement_to_sminn_vr_col (begc:endc,1:nlevdecomp_full)) ; this%supplement_to_sminn_vr_col (:,:) = nan - allocate(this%gross_nmin_vr_col (begc:endc,1:nlevdecomp_full)) ; this%gross_nmin_vr_col (:,:) = nan - allocate(this%net_nmin_vr_col (begc:endc,1:nlevdecomp_full)) ; this%net_nmin_vr_col (:,:) = nan - allocate(this%sminn_to_plant_fun_col (begc:endc)) ; this%sminn_to_plant_fun_col (:) = nan - allocate(this%sminn_to_plant_fun_vr_col (begc:endc,1:nlevdecomp_full)) ; this%sminn_to_plant_fun_vr_col (:,:) = nan - allocate(this%sminn_to_plant_fun_no3_vr_col (begc:endc,1:nlevdecomp_full)) ; this%sminn_to_plant_fun_no3_vr_col(:,:) = nan - allocate(this%sminn_to_plant_fun_nh4_vr_col (begc:endc,1:nlevdecomp_full)) ; this%sminn_to_plant_fun_nh4_vr_col(:,:) = nan - allocate(this%f_nit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%f_nit_vr_col (:,:) = nan - allocate(this%f_denit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%f_denit_vr_col (:,:) = nan - allocate(this%smin_no3_leached_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_no3_leached_vr_col (:,:) = nan - allocate(this%smin_no3_leached_col (begc:endc)) ; this%smin_no3_leached_col (:) = nan - allocate(this%smin_no3_runoff_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_no3_runoff_vr_col (:,:) = nan - allocate(this%smin_no3_runoff_col (begc:endc)) ; this%smin_no3_runoff_col (:) = nan - allocate(this%pot_f_nit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%pot_f_nit_vr_col (:,:) = nan - allocate(this%pot_f_nit_col (begc:endc)) ; this%pot_f_nit_col (:) = nan - allocate(this%pot_f_denit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%pot_f_denit_vr_col (:,:) = nan - allocate(this%pot_f_denit_col (begc:endc)) ; this%pot_f_denit_col (:) = nan - allocate(this%actual_immob_no3_vr_col (begc:endc,1:nlevdecomp_full)) ; this%actual_immob_no3_vr_col (:,:) = nan - allocate(this%actual_immob_nh4_vr_col (begc:endc,1:nlevdecomp_full)) ; this%actual_immob_nh4_vr_col (:,:) = nan - allocate(this%smin_no3_to_plant_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_no3_to_plant_vr_col (:,:) = nan - allocate(this%smin_nh4_to_plant_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_nh4_to_plant_vr_col (:,:) = nan - allocate(this%f_nit_col (begc:endc)) ; this%f_nit_col (:) = nan - allocate(this%f_denit_col (begc:endc)) ; this%f_denit_col (:) = nan - allocate(this%n2_n2o_ratio_denit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%n2_n2o_ratio_denit_vr_col (:,:) = nan - allocate(this%f_n2o_denit_col (begc:endc)) ; this%f_n2o_denit_col (:) = nan - allocate(this%f_n2o_denit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%f_n2o_denit_vr_col (:,:) = nan - allocate(this%f_n2o_nit_col (begc:endc)) ; this%f_n2o_nit_col (:) = nan - allocate(this%f_n2o_nit_vr_col (begc:endc,1:nlevdecomp_full)) ; this%f_n2o_nit_vr_col (:,:) = nan - - allocate(this%smin_no3_massdens_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_no3_massdens_vr_col (:,:) = nan - allocate(this%soil_bulkdensity_col (begc:endc,1:nlevdecomp_full)) ; this%soil_bulkdensity_col (:,:) = nan - allocate(this%k_nitr_t_vr_col (begc:endc,1:nlevdecomp_full)) ; this%k_nitr_t_vr_col (:,:) = nan - allocate(this%k_nitr_ph_vr_col (begc:endc,1:nlevdecomp_full)) ; this%k_nitr_ph_vr_col (:,:) = nan - allocate(this%k_nitr_h2o_vr_col (begc:endc,1:nlevdecomp_full)) ; this%k_nitr_h2o_vr_col (:,:) = nan - allocate(this%k_nitr_vr_col (begc:endc,1:nlevdecomp_full)) ; this%k_nitr_vr_col (:,:) = nan - allocate(this%wfps_vr_col (begc:endc,1:nlevdecomp_full)) ; this%wfps_vr_col (:,:) = nan - allocate(this%f_denit_base_vr_col (begc:endc,1:nlevdecomp_full)) ; this%f_denit_base_vr_col (:,:) = nan - allocate(this%diffus_col (begc:endc,1:nlevdecomp_full)) ; this%diffus_col (:,:) = spval - allocate(this%ratio_k1_col (begc:endc,1:nlevdecomp_full)) ; this%ratio_k1_col (:,:) = nan - allocate(this%ratio_no3_co2_col (begc:endc,1:nlevdecomp_full)) ; this%ratio_no3_co2_col (:,:) = spval - allocate(this%soil_co2_prod_col (begc:endc,1:nlevdecomp_full)) ; this%soil_co2_prod_col (:,:) = nan - allocate(this%fr_WFPS_col (begc:endc,1:nlevdecomp_full)) ; this%fr_WFPS_col (:,:) = spval - - allocate(this%fmax_denit_carbonsubstrate_vr_col (begc:endc,1:nlevdecomp_full)) ; - this%fmax_denit_carbonsubstrate_vr_col (:,:) = nan - allocate(this%fmax_denit_nitrate_vr_col (begc:endc,1:nlevdecomp_full)) ; - this%fmax_denit_nitrate_vr_col (:,:) = nan - - allocate(this%decomp_cascade_ntransfer_vr_col (begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions )) - allocate(this%decomp_cascade_sminn_flux_vr_col (begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions )) - allocate(this%decomp_cascade_ntransfer_col (begc:endc,1:ndecomp_cascade_transitions )) - allocate(this%decomp_cascade_sminn_flux_col (begc:endc,1:ndecomp_cascade_transitions )) - - this%decomp_cascade_ntransfer_vr_col (:,:,:) = nan - this%decomp_cascade_sminn_flux_vr_col (:,:,:) = nan - this%decomp_cascade_ntransfer_col (:,:) = nan - this%decomp_cascade_sminn_flux_col (:,:) = nan - - allocate(this%sminn_to_denit_decomp_cascade_vr_col (begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions )) - allocate(this%sminn_to_denit_decomp_cascade_col (begc:endc,1:ndecomp_cascade_transitions )) - allocate(this%sminn_to_denit_excess_vr_col (begc:endc,1:nlevdecomp_full )) - allocate(this%sminn_to_denit_excess_col (begc:endc )) - allocate(this%sminn_leached_vr_col (begc:endc,1:nlevdecomp_full )) - allocate(this%sminn_leached_col (begc:endc )) - allocate(this%decomp_npools_leached_col (begc:endc,1:ndecomp_pools )) - allocate(this%decomp_npools_transport_tendency_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools )) - - this%sminn_to_denit_decomp_cascade_vr_col (:,:,:) = nan - this%sminn_to_denit_decomp_cascade_col (:,:) = nan - this%sminn_to_denit_excess_vr_col (:,:) = nan - this%sminn_to_denit_excess_col (:) = nan - this%sminn_leached_vr_col (:,:) = nan - this%sminn_leached_col (:) = nan - this%decomp_npools_leached_col (:,:) = nan - this%decomp_npools_transport_tendency_col (:,:,:) = nan - - allocate(this%decomp_npools_sourcesink_col (begc:endc,1:nlevdecomp_full,1:ndecomp_pools)) - this%decomp_npools_sourcesink_col (:,:,:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use histFileMod , only : hist_addfld1d, hist_addfld_decomp - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: k,l - integer :: begc, endc - character(24) :: fieldname - character(100) :: longname - character(8) :: vr_suffix,default - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begc = bounds%begc; endc= bounds%endc - - ! add suffix if number of soil decomposition depths is greater than 1 - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - !------------------------------- - ! N flux variables - native to column - !------------------------------- - - this%ndep_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='NDEP_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='atmospheric N deposition to soil mineral N', & - ptr_col=this%ndep_to_sminn_col) - - if (use_fun) then - default = 'inactive' - else - default = 'active' - end if - this%nfix_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=this%nfix_to_sminn_col, default=default) - - this%ffix_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='FFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='free living N fixation to soil mineral N', & - ptr_col=this%ffix_to_sminn_col, default=default) - - do l = 1, ndecomp_cascade_transitions - ! vertically integrated fluxes - !-- mineralization/immobilization fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - this%decomp_cascade_sminn_flux_col(begc:endc,l) = spval - data1dptr => this%decomp_cascade_sminn_flux_col(:,l) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - fieldname = 'SMINN_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l))) - longname = 'mineral N flux for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//& - 'to '//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l))) - else - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'N_TO_SMINN' - longname = 'mineral N flux for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l))) - endif - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - end if - - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - this%decomp_cascade_ntransfer_col(begc:endc,l) = spval - data1dptr => this%decomp_cascade_ntransfer_col(:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'N_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N' - longname = 'decomp. of '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - ' N to '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' N' - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - end if - - ! vertically resolved fluxes - if ( nlevdecomp_full > 1 ) then - !-- mineralization/immobilization fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - this%decomp_cascade_sminn_flux_vr_col(begc:endc,:,l) = spval - data2dptr => this%decomp_cascade_sminn_flux_vr_col(:,:,l) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - fieldname = 'SMINN_TO_'& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))//'N_'//& - trim(decomp_cascade_con%decomp_pool_name_short(decomp_cascade_con%cascade_donor_pool(l)))//trim(vr_suffix) - longname = 'mineral N flux for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//& - 'to '//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l))) - else - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))& - //'N_TO_SMINN'//trim(vr_suffix) - longname = 'mineral N flux for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l))) - endif - call hist_addfld_decomp (fname=fieldname, units='gN/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - - !-- transfer fluxes (none from terminal pool, if present) - if ( decomp_cascade_con%cascade_receiver_pool(l) /= 0 ) then - this%decomp_cascade_ntransfer_vr_col(begc:endc,:,l) = spval - data2dptr => this%decomp_cascade_ntransfer_vr_col(:,:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_donor_pool(l)))//'N_TO_'//& - trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l)))& - //'N'//trim(vr_suffix) - longname = 'decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - ' N to '//trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_receiver_pool(l)))//' N' - call hist_addfld_decomp (fname=fieldname, units='gN/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - - endif - end do - - this%denit_col(begc:endc) = spval - call hist_addfld1d (fname='DENIT', units='gN/m^2/s', & - avgflag='A', long_name='total rate of denitrification', & - ptr_col=this%denit_col) - - this%som_n_leached_col(begc:endc) = spval - call hist_addfld1d (fname='SOM_N_LEACHED', units='gN/m^2/s', & - avgflag='A', long_name='total flux of N from SOM pools due to leaching', & - ptr_col=this%som_n_leached_col, default='inactive') - - do k = 1, ndecomp_pools - if ( .not. decomp_cascade_con%is_cwd(k) ) then - this%decomp_npools_leached_col(begc:endc,k) = spval - data1dptr => this%decomp_npools_leached_col(:,k) - fieldname = 'M_'//trim(decomp_cascade_con%decomp_pool_name_history(k))//'N_TO_LEACHING' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' N leaching loss' - call hist_addfld1d (fname=fieldname, units='gN/m^2/s', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - - this%decomp_npools_transport_tendency_col(begc:endc,:,k) = spval - data2dptr => this%decomp_npools_transport_tendency_col(:,:,k) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(k))//'N_TNDNCY_VERT_TRANSPORT' - longname = trim(decomp_cascade_con%decomp_pool_name_long(k))//' N tendency due to vertical transport' - call hist_addfld_decomp (fname=fieldname, units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - end if - end do - - if (.not. use_nitrif_denitrif) then - do l = 1, ndecomp_cascade_transitions - !-- denitrification fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - this%sminn_to_denit_decomp_cascade_col(begc:endc,l) = spval - data1dptr => this%sminn_to_denit_decomp_cascade_col(:,l) - fieldname = 'SMINN_TO_DENIT_'//trim(decomp_cascade_con%cascade_step_name(l)) - longname = 'denitrification for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - 'to '//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l))) - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default='inactive') - endif - - if ( nlevdecomp_full > 1 ) then - !-- denitrification fluxes (none from CWD) - if ( .not. decomp_cascade_con%is_cwd(decomp_cascade_con%cascade_donor_pool(l)) ) then - this%sminn_to_denit_decomp_cascade_vr_col(begc:endc,:,l) = spval - data2dptr => this%sminn_to_denit_decomp_cascade_vr_col(:,:,l) - fieldname = 'SMINN_TO_DENIT_'//trim(decomp_cascade_con%cascade_step_name(l))//trim(vr_suffix) - longname = 'denitrification for decomp. of '& - //trim(decomp_cascade_con%decomp_pool_name_long(decomp_cascade_con%cascade_donor_pool(l)))//& - 'to '//trim(decomp_cascade_con%decomp_pool_name_history(decomp_cascade_con%cascade_receiver_pool(l))) - call hist_addfld_decomp (fname=fieldname, units='gN/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr, default='inactive') - endif - endif - end do - end if - - if (.not. use_nitrif_denitrif) then - this%sminn_to_denit_excess_col(begc:endc) = spval - call hist_addfld1d (fname='SMINN_TO_DENIT_EXCESS', units='gN/m^2/s', & - avgflag='A', long_name='denitrification from excess mineral N pool', & - ptr_col=this%sminn_to_denit_excess_col, default='inactive') - end if - - if (.not. use_nitrif_denitrif) then - this%sminn_leached_col(begc:endc) = spval - call hist_addfld1d (fname='SMINN_LEACHED', units='gN/m^2/s', & - avgflag='A', long_name='soil mineral N pool loss to leaching', & - ptr_col=this%sminn_leached_col) - end if - - if (.not. use_nitrif_denitrif) then - if ( nlevdecomp_full > 1 ) then - this%sminn_to_denit_excess_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMINN_TO_DENIT_EXCESS'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='denitrification from excess mineral N pool', & - ptr_col=this%sminn_to_denit_excess_vr_col, default='inactive') - - this%sminn_leached_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMINN_LEACHED'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='soil mineral N pool loss to leaching', & - ptr_col=this%sminn_leached_vr_col, default='inactive') - endif - end if - - if (use_nitrif_denitrif) then - this%f_nit_col(begc:endc) = spval - call hist_addfld1d (fname='F_NIT', units='gN/m^2/s', & - avgflag='A', long_name='nitrification flux', & - ptr_col=this%f_nit_col) - end if - - if (use_nitrif_denitrif) then - this%f_denit_col(begc:endc) = spval - call hist_addfld1d (fname='F_DENIT', units='gN/m^2/s', & - avgflag='A', long_name='denitrification flux', & - ptr_col=this%f_denit_col) - end if - - if (use_nitrif_denitrif) then - this%pot_f_nit_col(begc:endc) = spval - call hist_addfld1d (fname='POT_F_NIT', units='gN/m^2/s', & - avgflag='A', long_name='potential nitrification flux', & - ptr_col=this%pot_f_nit_col) - end if - - if (use_nitrif_denitrif) then - this%pot_f_denit_col(begc:endc) = spval - call hist_addfld1d (fname='POT_F_DENIT', units='gN/m^2/s', & - avgflag='A', long_name='potential denitrification flux', & - ptr_col=this%pot_f_denit_col) - end if - - if (use_nitrif_denitrif) then - this%smin_no3_leached_col(begc:endc) = spval - call hist_addfld1d (fname='SMIN_NO3_LEACHED', units='gN/m^2/s', & - avgflag='A', long_name='soil NO3 pool loss to leaching', & - ptr_col=this%smin_no3_leached_col) - end if - - if (use_nitrif_denitrif) then - this%smin_no3_runoff_col(begc:endc) = spval - call hist_addfld1d (fname='SMIN_NO3_RUNOFF', units='gN/m^2/s', & - avgflag='A', long_name='soil NO3 pool loss to runoff', & - ptr_col=this%smin_no3_runoff_col) - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%f_nit_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='F_NIT'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='nitrification flux', & - ptr_col=this%f_nit_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%f_denit_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='F_DENIT'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='denitrification flux', & - ptr_col=this%f_denit_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%pot_f_nit_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='POT_F_NIT'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='potential nitrification flux', & - ptr_col=this%pot_f_nit_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%pot_f_denit_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='POT_F_DENIT'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='potential denitrification flux', & - ptr_col=this%pot_f_denit_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%smin_no3_leached_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMIN_NO3_LEACHED'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='soil NO3 pool loss to leaching', & - ptr_col=this%smin_no3_leached_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%smin_no3_runoff_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMIN_NO3_RUNOFF'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='soil NO3 pool loss to runoff', & - ptr_col=this%smin_no3_runoff_vr_col, default='inactive') - endif - - if (use_nitrif_denitrif) then - this%n2_n2o_ratio_denit_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='n2_n2o_ratio_denit', units='gN/gN', type2d='levdcmp', & - avgflag='A', long_name='n2_n2o_ratio_denit', & - ptr_col=this%n2_n2o_ratio_denit_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%actual_immob_no3_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='ACTUAL_IMMOB_NO3', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='immobilization of NO3', & - ptr_col=this%actual_immob_no3_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%actual_immob_nh4_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='ACTUAL_IMMOB_NH4', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='immobilization of NH4', & - ptr_col=this%actual_immob_nh4_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%smin_no3_to_plant_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMIN_NO3_TO_PLANT', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='plant uptake of NO3', & - ptr_col=this%smin_no3_to_plant_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%smin_nh4_to_plant_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMIN_NH4_TO_PLANT', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='plant uptake of NH4', & - ptr_col=this%smin_nh4_to_plant_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%smin_no3_massdens_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMIN_NO3_MASSDENS', units='ugN/cm^3 soil', type2d='levdcmp', & - avgflag='A', long_name='SMIN_NO3_MASSDENS', & - ptr_col=this%smin_no3_massdens_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%k_nitr_t_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='K_NITR_T', units='unitless', type2d='levdcmp', & - avgflag='A', long_name='K_NITR_T', & - ptr_col=this%k_nitr_t_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%k_nitr_ph_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='K_NITR_PH', units='unitless', type2d='levdcmp', & - avgflag='A', long_name='K_NITR_PH', & - ptr_col=this%k_nitr_ph_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%k_nitr_h2o_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='K_NITR_H2O', units='unitless', type2d='levdcmp', & - avgflag='A', long_name='K_NITR_H2O', & - ptr_col=this%k_nitr_h2o_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%k_nitr_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='K_NITR', units='1/s', type2d='levdcmp', & - avgflag='A', long_name='K_NITR', & - ptr_col=this%k_nitr_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%wfps_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='WFPS', units='percent', type2d='levdcmp', & - avgflag='A', long_name='WFPS', & - ptr_col=this%wfps_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%fmax_denit_carbonsubstrate_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='FMAX_DENIT_CARBONSUBSTRATE', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='FMAX_DENIT_CARBONSUBSTRATE', & - ptr_col=this%fmax_denit_carbonsubstrate_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%fmax_denit_nitrate_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='FMAX_DENIT_NITRATE', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='FMAX_DENIT_NITRATE', & - ptr_col=this%fmax_denit_nitrate_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%f_denit_base_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='F_DENIT_BASE', units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='F_DENIT_BASE', & - ptr_col=this%f_denit_base_vr_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%diffus_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='diffus', units='m^2/s', type2d='levdcmp', & - avgflag='A', long_name='diffusivity', & - ptr_col=this%diffus_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%ratio_k1_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='ratio_k1', units='none', type2d='levdcmp', & - avgflag='A', long_name='ratio_k1', & - ptr_col=this%ratio_k1_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%ratio_no3_co2_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='ratio_no3_co2', units='ratio', type2d='levdcmp', & - avgflag='A', long_name='ratio_no3_co2', & - ptr_col=this%ratio_no3_co2_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%soil_co2_prod_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='soil_co2_prod', units='ug C / g soil / day', type2d='levdcmp', & - avgflag='A', long_name='soil_co2_prod', & - ptr_col=this%soil_co2_prod_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%fr_WFPS_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='fr_WFPS', units='fraction', type2d='levdcmp', & - avgflag='A', long_name='fr_WFPS', & - ptr_col=this%fr_WFPS_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%soil_bulkdensity_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='soil_bulkdensity', units='kg/m3', type2d='levdcmp', & - avgflag='A', long_name='soil_bulkdensity', & - ptr_col=this%soil_bulkdensity_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%anaerobic_frac_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='anaerobic_frac', units='m3/m3', type2d='levdcmp', & - avgflag='A', long_name='anaerobic_frac', & - ptr_col=this%anaerobic_frac_col, default='inactive') - end if - - if (use_nitrif_denitrif) then - this%r_psi_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='r_psi', units='m', type2d='levdcmp', & - avgflag='A', long_name='r_psi', & - ptr_col=this%r_psi_col, default='inactive') - end if - - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%potential_immob_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='POTENTIAL_IMMOB'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='potential N immobilization', & - ptr_col=this%potential_immob_vr_col, default='inactive') - end if - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%actual_immob_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='ACTUAL_IMMOB'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='actual N immobilization', & - ptr_col=this%actual_immob_vr_col, default='inactive') - end if - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%sminn_to_plant_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SMINN_TO_PLANT'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='plant uptake of soil mineral N', & - ptr_col=this%sminn_to_plant_vr_col, default='inactive') - end if - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%supplement_to_sminn_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SUPPLEMENT_TO_SMINN'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='supplemental N supply', & - ptr_col=this%supplement_to_sminn_vr_col, default='inactive') - end if - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%gross_nmin_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='GROSS_NMIN'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='gross rate of N mineralization', & - ptr_col=this%gross_nmin_vr_col, default='inactive') - end if - - if ( use_nitrif_denitrif .and. nlevdecomp_full > 1 ) then - this%net_nmin_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='NET_NMIN'//trim(vr_suffix), units='gN/m^3/s', type2d='levdcmp', & - avgflag='A', long_name='net rate of N mineralization', & - ptr_col=this%net_nmin_vr_col, default='inactive') - end if - - this%potential_immob_col(begc:endc) = spval - call hist_addfld1d (fname='POTENTIAL_IMMOB', units='gN/m^2/s', & - avgflag='A', long_name='potential N immobilization', & - ptr_col=this%potential_immob_col) - - this%actual_immob_col(begc:endc) = spval - call hist_addfld1d (fname='ACTUAL_IMMOB', units='gN/m^2/s', & - avgflag='A', long_name='actual N immobilization', & - ptr_col=this%actual_immob_col) - - this%sminn_to_plant_col(begc:endc) = spval - call hist_addfld1d (fname='SMINN_TO_PLANT', units='gN/m^2/s', & - avgflag='A', long_name='plant uptake of soil mineral N', & - ptr_col=this%sminn_to_plant_col) - - this%supplement_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='SUPPLEMENT_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='supplemental N supply', & - ptr_col=this%supplement_to_sminn_col) - - this%gross_nmin_col(begc:endc) = spval - call hist_addfld1d (fname='GROSS_NMIN', units='gN/m^2/s', & - avgflag='A', long_name='gross rate of N mineralization', & - ptr_col=this%gross_nmin_col) - - this%net_nmin_col(begc:endc) = spval - call hist_addfld1d (fname='NET_NMIN', units='gN/m^2/s', & - avgflag='A', long_name='net rate of N mineralization', & - ptr_col=this%net_nmin_col) - - if (use_nitrif_denitrif) then - this%f_n2o_nit_col(begc:endc) = spval - call hist_addfld1d (fname='F_N2O_NIT', units='gN/m^2/s', & - avgflag='A', long_name='nitrification N2O flux', & - ptr_col=this%f_n2o_nit_col) - - this%f_n2o_denit_col(begc:endc) = spval - call hist_addfld1d (fname='F_N2O_DENIT', units='gN/m^2/s', & - avgflag='A', long_name='denitrification N2O flux', & - ptr_col=this%f_n2o_denit_col) - end if - - if (use_crop) then - this%fert_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='FERT_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='fertilizer to soil mineral N', & - ptr_col=this%fert_to_sminn_col, default='inactive') - end if - - if (use_crop .and. .not. use_fun) then - this%soyfixn_to_sminn_col(begc:endc) = spval - call hist_addfld1d (fname='SOYFIXN_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='Soybean fixation to soil mineral N', & - ptr_col=this%soyfixn_to_sminn_col, default='inactive') - end if - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - ! !USES: - use landunit_varcon , only : istsoil, istcrop - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: c,l - integer :: num_special_col ! number of good values in special_col filter - integer :: special_col(bounds%endc-bounds%begc+1) ! special landunit filter - columns - !--------------------------------------------------------------------- - - ! Set column filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - !----------------------------------------------- - ! initialize nitrogen flux variables - !----------------------------------------------- - - call this%SetValues (& - num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart (this, bounds, ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for carbon state - ! - ! !USES: - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag !'read' or 'write' - ! - ! !LOCAL VARIABLES: - integer :: j,c ! indices - logical :: readvar ! determine if variable is on initial file - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - if (use_nitrif_denitrif) then - ! pot_f_nit_vr - if (use_vertsoilc) then - ptr2d => this%pot_f_nit_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='pot_f_nit_vr_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='potential soil nitrification flux', units='gN/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%pot_f_nit_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='pot_f_nit_vr', xtype=ncd_double, & - dim1name='column', & - long_name='soil nitrification flux', units='gN/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg= 'ERROR:: pot_f_nit_vr'//' is required on an initialization dataset' ) - end if - end if - - if (use_nitrif_denitrif) then - ! f_nit_vr - if (use_vertsoilc) then - ptr2d => this%f_nit_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='f_nit_vr_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='soil nitrification flux', units='gN/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%f_nit_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='f_nit_vr', xtype=ncd_double, & - dim1name='column', & - long_name='soil nitrification flux', units='gN/m3/s', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg='ERROR:: f_nit_vr'//' is required on an initialization dataset'//& - errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, & - num_column, filter_column, value_column) - ! - ! !DESCRIPTION: - ! Set nitrogen flux variables - ! - ! !ARGUMENTS: - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenflux_type) :: this - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i,j,k,l ! loop index - !------------------------------------------------------------------------ - - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - - if (.not. use_nitrif_denitrif) then - this%sminn_to_denit_excess_vr_col(i,j) = value_column - this%sminn_leached_vr_col(i,j) = value_column - this%sminn_to_plant_fun_vr_col(i,j) = value_column - else - this%f_nit_vr_col(i,j) = value_column - this%f_denit_vr_col(i,j) = value_column - this%smin_no3_leached_vr_col(i,j) = value_column - this%smin_no3_runoff_vr_col(i,j) = value_column - this%n2_n2o_ratio_denit_vr_col(i,j) = value_column - this%pot_f_nit_vr_col(i,j) = value_column - this%pot_f_denit_vr_col(i,j) = value_column - this%actual_immob_no3_vr_col(i,j) = value_column - this%actual_immob_nh4_vr_col(i,j) = value_column - this%smin_no3_to_plant_vr_col(i,j) = value_column - this%smin_nh4_to_plant_vr_col(i,j) = value_column - this%f_n2o_denit_vr_col(i,j) = value_column - this%f_n2o_nit_vr_col(i,j) = value_column - - this%smin_no3_massdens_vr_col(i,j) = value_column - this%k_nitr_t_vr_col(i,j) = value_column - this%k_nitr_ph_vr_col(i,j) = value_column - this%k_nitr_h2o_vr_col(i,j) = value_column - this%k_nitr_vr_col(i,j) = value_column - this%wfps_vr_col(i,j) = value_column - this%fmax_denit_carbonsubstrate_vr_col(i,j) = value_column - this%fmax_denit_nitrate_vr_col(i,j) = value_column - this%f_denit_base_vr_col(i,j) = value_column - - this%diffus_col(i,j) = value_column - this%ratio_k1_col(i,j) = value_column - this%ratio_no3_co2_col(i,j) = value_column - this%soil_co2_prod_col(i,j) = value_column - this%fr_WFPS_col(i,j) = value_column - this%soil_bulkdensity_col(i,j) = value_column - - this%r_psi_col(i,j) = value_column - this%anaerobic_frac_col(i,j) = value_column - end if - this%potential_immob_vr_col(i,j) = value_column - this%actual_immob_vr_col(i,j) = value_column - this%sminn_to_plant_vr_col(i,j) = value_column - this%supplement_to_sminn_vr_col(i,j) = value_column - this%gross_nmin_vr_col(i,j) = value_column - this%net_nmin_vr_col(i,j) = value_column - this%sminn_to_plant_fun_no3_vr_col(i,j) = value_column - this%sminn_to_plant_fun_nh4_vr_col(i,j) = value_column - end do - end do - - do fi = 1,num_column - i = filter_column(fi) - - this%ndep_to_sminn_col(i) = value_column - this%nfix_to_sminn_col(i) = value_column - this%ffix_to_sminn_col(i) = value_column - this%fert_to_sminn_col(i) = value_column - this%soyfixn_to_sminn_col(i) = value_column - this%potential_immob_col(i) = value_column - this%actual_immob_col(i) = value_column - this%sminn_to_plant_col(i) = value_column - this%supplement_to_sminn_col(i) = value_column - this%gross_nmin_col(i) = value_column - this%net_nmin_col(i) = value_column - this%denit_col(i) = value_column - this%sminn_to_plant_fun_col(i) = value_column - if (use_nitrif_denitrif) then - this%f_nit_col(i) = value_column - this%pot_f_nit_col(i) = value_column - this%f_denit_col(i) = value_column - this%pot_f_denit_col(i) = value_column - this%f_n2o_denit_col(i) = value_column - this%f_n2o_nit_col(i) = value_column - this%smin_no3_leached_col(i) = value_column - this%smin_no3_runoff_col(i) = value_column - else - this%sminn_to_denit_excess_col(i) = value_column - this%sminn_leached_col(i) = value_column - end if - this%ninputs_col(i) = value_column - this%noutputs_col(i) = value_column - this%som_n_leached_col(i) = value_column - end do - - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_npools_leached_col(i,k) = value_column - end do - end do - - do k = 1, ndecomp_pools - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%decomp_npools_transport_tendency_col(i,j,k) = value_column - end do - end do - end do - - do l = 1, ndecomp_cascade_transitions - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cascade_ntransfer_col(i,l) = value_column - this%decomp_cascade_sminn_flux_col(i,l) = value_column - if (.not. use_nitrif_denitrif) then - this%sminn_to_denit_decomp_cascade_col(i,l) = value_column - end if - end do - end do - - do l = 1, ndecomp_cascade_transitions - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%decomp_cascade_ntransfer_vr_col(i,j,l) = value_column - this%decomp_cascade_sminn_flux_vr_col(i,j,l) = value_column - if (.not. use_nitrif_denitrif) then - this%sminn_to_denit_decomp_cascade_vr_col(i,j,l) = value_column - end if - end do - end do - end do - - do k = 1, ndecomp_pools - do j = 1, nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%decomp_npools_sourcesink_col(i,j,k) = value_column - end do - end do - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine Summary(this, bounds, num_soilc, filter_soilc) - ! - ! !USES: - use clm_varpar , only: nlevdecomp, ndecomp_cascade_transitions,ndecomp_pools - use clm_varctl , only: use_nitrif_denitrif - ! - ! !ARGUMENTS: - class (soilbiogeochem_nitrogenflux_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l ! indices - integer :: fc ! filter indices - !----------------------------------------------------------------------- - - do fc = 1,num_soilc - c = filter_soilc(fc) - this%denit_col(c) = 0._r8 - this%supplement_to_sminn_col(c) = 0._r8 - this%som_n_leached_col(c) = 0._r8 - end do - - ! vertically integrate decomposing N cascade fluxes and soil mineral N fluxes associated with decomposition cascade - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - this%decomp_cascade_ntransfer_col(c,k) = & - this%decomp_cascade_ntransfer_col(c,k) + & - this%decomp_cascade_ntransfer_vr_col(c,j,k) * dzsoi_decomp(j) - - this%decomp_cascade_sminn_flux_col(c,k) = & - this%decomp_cascade_sminn_flux_col(c,k) + & - this%decomp_cascade_sminn_flux_vr_col(c,j,k) * dzsoi_decomp(j) - end do - end do - end do - - if (.not. use_nitrif_denitrif) then - - ! vertically integrate each denitrification flux - do l = 1, ndecomp_cascade_transitions - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%sminn_to_denit_decomp_cascade_col(c,l) = & - this%sminn_to_denit_decomp_cascade_col(c,l) + & - this%sminn_to_denit_decomp_cascade_vr_col(c,j,l) * dzsoi_decomp(j) - end do - end do - end do - - ! vertically integrate bulk denitrification and leaching flux - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%sminn_to_denit_excess_col(c) = & - this%sminn_to_denit_excess_col(c) + & - this%sminn_to_denit_excess_vr_col(c,j) * dzsoi_decomp(j) - - this%sminn_leached_col(c) = & - this%sminn_leached_col(c) + & - this%sminn_leached_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - ! total N denitrification (DENIT) - do l = 1, ndecomp_cascade_transitions - do fc = 1,num_soilc - c = filter_soilc(fc) - this%denit_col(c) = & - this%denit_col(c) + & - this%sminn_to_denit_decomp_cascade_col(c,l) - end do - end do - - do fc = 1,num_soilc - c = filter_soilc(fc) - this%denit_col(c) = & - this%denit_col(c) + & - this%sminn_to_denit_excess_col(c) - end do - - else - - ! vertically integrate NO3 NH4 N2O fluxes and pools - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! nitrification and denitrification fluxes - this%f_nit_col(c) = & - this%f_nit_col(c) + & - this%f_nit_vr_col(c,j) * dzsoi_decomp(j) - - this%f_denit_col(c) = & - this%f_denit_col(c) + & - this%f_denit_vr_col(c,j) * dzsoi_decomp(j) - - this%pot_f_nit_col(c) = & - this%pot_f_nit_col(c) + & - this%pot_f_nit_vr_col(c,j) * dzsoi_decomp(j) - - this%pot_f_denit_col(c) = & - this%pot_f_denit_col(c) + & - this%pot_f_denit_vr_col(c,j) * dzsoi_decomp(j) - - this%f_n2o_nit_col(c) = & - this%f_n2o_nit_col(c) + & - this%f_n2o_nit_vr_col(c,j) * dzsoi_decomp(j) - - this%f_n2o_denit_col(c) = & - this%f_n2o_denit_col(c) + & - this%f_n2o_denit_vr_col(c,j) * dzsoi_decomp(j) - - ! leaching/runoff flux - this%smin_no3_leached_col(c) = & - this%smin_no3_leached_col(c) + & - this%smin_no3_leached_vr_col(c,j) * dzsoi_decomp(j) - - this%smin_no3_runoff_col(c) = & - this%smin_no3_runoff_col(c) + & - this%smin_no3_runoff_vr_col(c,j) * dzsoi_decomp(j) - - end do - end do - - do fc = 1,num_soilc - c = filter_soilc(fc) - this%denit_col(c) = this%f_denit_col(c) - end do - - end if - - ! supplementary N supplement_to_sminn - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%supplement_to_sminn_col(c) = & - this%supplement_to_sminn_col(c) + & - this%supplement_to_sminn_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - ! add up all vertical transport tendency terms and calculate total som leaching loss as the sum of these - do l = 1, ndecomp_pools - do fc = 1,num_soilc - c = filter_soilc(fc) - this%decomp_npools_leached_col(c,l) = 0._r8 - end do - - do j = 1, nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - this%decomp_npools_leached_col(c,l) = & - this%decomp_npools_leached_col(c,l) + & - this%decomp_npools_transport_tendency_col(c,j,l) * dzsoi_decomp(j) - end do - end do - - do fc = 1,num_soilc - c = filter_soilc(fc) - this%som_n_leached_col(c) = & - this%som_n_leached_col(c) + & - this%decomp_npools_leached_col(c,l) - end do - end do - - end subroutine Summary - -end module soilbiogeochemNitrogenFluxType - diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 deleted file mode 100644 index ca09e63624..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 +++ /dev/null @@ -1,1023 +0,0 @@ -module SoilBiogeochemNitrogenStateType - -#include "shr_assert.h" - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use spmdMod , only : masterproc - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools, nlevcan - use clm_varpar , only : nlevdecomp_full, nlevdecomp, nlevsoi - use clm_varcon , only : spval, dzsoi_decomp, zisoi - use clm_varctl , only : use_nitrif_denitrif, use_vertsoilc, use_century_decomp - use clm_varctl , only : iulog, override_bgc_restart_mismatch_dump, spinup_state - use landunit_varcon , only : istcrop, istsoil - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use LandunitType , only : lun - use ColumnType , only : col - use GridcellType , only : grc - use SoilBiogeochemStateType , only : get_spinup_latitude_term - ! - ! !PUBLIC TYPES: - implicit none - private - - type, public :: soilbiogeochem_nitrogenstate_type - - real(r8), pointer :: decomp_npools_vr_col (:,:,:) ! col (gN/m3) vertically-resolved decomposing (litter, cwd, soil) N pools - real(r8), pointer :: sminn_vr_col (:,:) ! col (gN/m3) vertically-resolved soil mineral N - real(r8), pointer :: ntrunc_vr_col (:,:) ! col (gN/m3) vertically-resolved column-level sink for N truncation - - ! nitrif_denitrif - real(r8), pointer :: smin_no3_vr_col (:,:) ! col (gN/m3) vertically-resolved soil mineral NO3 - real(r8), pointer :: smin_no3_col (:) ! col (gN/m2) soil mineral NO3 pool - real(r8), pointer :: smin_nh4_vr_col (:,:) ! col (gN/m3) vertically-resolved soil mineral NH4 - real(r8), pointer :: smin_nh4_col (:) ! col (gN/m2) soil mineral NH4 pool - - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: decomp_npools_col (:,:) ! col (gN/m2) decomposing (litter, cwd, soil) N pools - real(r8), pointer :: decomp_npools_1m_col (:,:) ! col (gN/m2) diagnostic: decomposing (litter, cwd, soil) N pools to 1 meter - real(r8), pointer :: sminn_col (:) ! col (gN/m2) soil mineral N - real(r8), pointer :: ntrunc_col (:) ! col (gN/m2) column-level sink for N truncation - real(r8), pointer :: cwdn_col (:) ! col (gN/m2) Diagnostic: coarse woody debris N - real(r8), pointer :: totlitn_col (:) ! col (gN/m2) total litter nitrogen - real(r8), pointer :: totsomn_col (:) ! col (gN/m2) total soil organic matter nitrogen - real(r8), pointer :: totlitn_1m_col (:) ! col (gN/m2) total litter nitrogen to 1 meter - real(r8), pointer :: totsomn_1m_col (:) ! col (gN/m2) total soil organic matter nitrogen to 1 meter - real(r8), pointer :: dyn_nbal_adjustments_col (:) ! (gN/m2) adjustments to each column made in this timestep via dynamic column adjustments (note: this variable only makes sense at the column-level: it is meaningless if averaged to the gridcell-level) - - ! Track adjustments to no3 and nh4 pools separately, since those aren't included in - ! the N balance check - real(r8), pointer :: dyn_no3bal_adjustments_col (:) ! (gN/m2) NO3 adjustments to each column made in this timestep via dynamic column area adjustments (only makes sense at the column-level: meaningless if averaged to the gridcell-level) - real(r8), pointer :: dyn_nh4bal_adjustments_col (:) ! (gN/m2) NH4 adjustments to each column made in this timestep via dynamic column adjustments (only makes sense at the column-level: meaningless if averaged to the gridcell-level) - real(r8) :: totvegcthresh ! threshold for total vegetation carbon to zero out decomposition pools - - contains - - procedure , public :: Init - procedure , public :: Restart - procedure , public :: SetValues - procedure , public :: Summary - procedure , public :: DynamicColumnAdjustments ! adjust state variables when column areas change - procedure , public :: SetTotVgCThresh ! Set value for totvegcthresh needed in Restart - procedure , private :: InitAllocate - procedure , private :: InitHistory - procedure , private :: InitCold - - end type soilbiogeochem_nitrogenstate_type - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds, & - decomp_cpools_vr_col, decomp_cpools_col, decomp_cpools_1m_col) - - class(soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: decomp_cpools_vr_col (bounds%begc:, 1:, 1:) - real(r8) , intent(in) :: decomp_cpools_col (bounds%begc:, 1:) - real(r8) , intent(in) :: decomp_cpools_1m_col (bounds%begc:, 1:) - - this%totvegcthresh = nan - call this%InitAllocate (bounds ) - - call this%InitHistory (bounds) - - call this%InitCold ( bounds, & - decomp_cpools_vr_col, decomp_cpools_col, decomp_cpools_1m_col) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !ARGUMENTS: - class (soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc,endc - !------------------------------------------------------------------------ - - begc = bounds%begc; endc = bounds%endc - - allocate(this%sminn_vr_col (begc:endc,1:nlevdecomp_full)) ; this%sminn_vr_col (:,:) = nan - allocate(this%ntrunc_vr_col (begc:endc,1:nlevdecomp_full)) ; this%ntrunc_vr_col (:,:) = nan - allocate(this%smin_no3_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_no3_vr_col (:,:) = nan - allocate(this%smin_nh4_vr_col (begc:endc,1:nlevdecomp_full)) ; this%smin_nh4_vr_col (:,:) = nan - allocate(this%smin_no3_col (begc:endc)) ; this%smin_no3_col (:) = nan - allocate(this%smin_nh4_col (begc:endc)) ; this%smin_nh4_col (:) = nan - allocate(this%cwdn_col (begc:endc)) ; this%cwdn_col (:) = nan - allocate(this%sminn_col (begc:endc)) ; this%sminn_col (:) = nan - allocate(this%ntrunc_col (begc:endc)) ; this%ntrunc_col (:) = nan - allocate(this%totlitn_col (begc:endc)) ; this%totlitn_col (:) = nan - allocate(this%totsomn_col (begc:endc)) ; this%totsomn_col (:) = nan - allocate(this%totlitn_1m_col (begc:endc)) ; this%totlitn_1m_col (:) = nan - allocate(this%totsomn_1m_col (begc:endc)) ; this%totsomn_1m_col (:) = nan - allocate(this%dyn_nbal_adjustments_col (begc:endc)) ; this%dyn_nbal_adjustments_col (:) = nan - allocate(this%dyn_no3bal_adjustments_col (begc:endc)) ; this%dyn_no3bal_adjustments_col (:) = nan - allocate(this%dyn_nh4bal_adjustments_col (begc:endc)) ; this%dyn_nh4bal_adjustments_col (:) = nan - allocate(this%decomp_npools_col (begc:endc,1:ndecomp_pools)) ; this%decomp_npools_col (:,:) = nan - allocate(this%decomp_npools_1m_col (begc:endc,1:ndecomp_pools)) ; this%decomp_npools_1m_col (:,:) = nan - - allocate(this%decomp_npools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools)); - this%decomp_npools_vr_col(:,:,:)= nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! add history fields for all CN variables, always set as default='inactive' - ! - ! !USES: - use clm_varpar , only : ndecomp_cascade_transitions, ndecomp_pools - use clm_varpar , only : nlevdecomp, nlevdecomp_full, nlevgrnd - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: k,l,ii,jj - character(10) :: active - character(8) :: vr_suffix - integer :: begc,endc - character(24) :: fieldname - character(100) :: longname - real(r8), pointer :: data1dptr(:) ! temp. pointer for slicing larger arrays - real(r8), pointer :: data2dptr(:,:) ! temp. pointer for slicing larger arrays - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - if ( nlevdecomp_full > 1 ) then - this%decomp_npools_vr_col(begc:endc,:,:) = spval - this%decomp_npools_1m_col(begc:endc,:) = spval - end if - this%decomp_npools_col(begc:endc,:) = spval - do l = 1, ndecomp_pools - if ( nlevdecomp_full > 1 ) then - data2dptr => this%decomp_npools_vr_col(:,:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'N_vr' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' N (vertically resolved)' - call hist_addfld2d (fname=fieldname, units='gN/m^3', type2d='levdcmp', & - avgflag='A', long_name=longname, & - ptr_col=data2dptr) - endif - - data1dptr => this%decomp_npools_col(:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'N' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' N' - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr) - - if ( nlevdecomp_full > 1 ) then - data1dptr => this%decomp_npools_1m_col(:,l) - fieldname = trim(decomp_cascade_con%decomp_pool_name_history(l))//'N_1m' - longname = trim(decomp_cascade_con%decomp_pool_name_history(l))//' N to 1 meter' - call hist_addfld1d (fname=fieldname, units='gN/m^2', & - avgflag='A', long_name=longname, & - ptr_col=data1dptr, default = 'inactive') - endif - end do - - - if ( nlevdecomp_full > 1 ) then - - this%sminn_col(begc:endc) = spval - call hist_addfld1d (fname='SMINN', units='gN/m^2', & - avgflag='A', long_name='soil mineral N', & - ptr_col=this%sminn_col) - - this%totlitn_1m_col(begc:endc) = spval - call hist_addfld1d (fname='TOTLITN_1m', units='gN/m^2', & - avgflag='A', long_name='total litter N to 1 meter', & - ptr_col=this%totlitn_1m_col) - - this%totsomn_1m_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOMN_1m', units='gN/m^2', & - avgflag='A', long_name='total soil organic matter N to 1 meter', & - ptr_col=this%totsomn_1m_col) - endif - - this%ntrunc_col(begc:endc) = spval - call hist_addfld1d (fname='COL_NTRUNC', units='gN/m^2', & - avgflag='A', long_name='column-level sink for N truncation', & - ptr_col=this%ntrunc_col, default='inactive') - - ! add suffix if number of soil decomposition depths is greater than 1 - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - - if (use_nitrif_denitrif) then - if ( nlevdecomp_full > 1 ) then - data2dptr => this%smin_no3_vr_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='SMIN_NO3'//trim(vr_suffix), units='gN/m^3', type2d='levsoi', & - avgflag='A', long_name='soil mineral NO3 (vert. res.)', & - ptr_col=data2dptr) - - data2dptr => this%smin_nh4_vr_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='SMIN_NH4'//trim(vr_suffix), units='gN/m^3', type2d='levsoi', & - avgflag='A', long_name='soil mineral NH4 (vert. res.)', & - ptr_col=data2dptr) - - data2dptr => this%sminn_vr_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='SMINN'//trim(vr_suffix), units='gN/m^3', type2d='levsoi', & - avgflag='A', long_name='soil mineral N', & - ptr_col=data2dptr) - - this%smin_no3_col(begc:endc) = spval - call hist_addfld1d (fname='SMIN_NO3', units='gN/m^2', & - avgflag='A', long_name='soil mineral NO3', & - ptr_col=this%smin_no3_col) - - this%smin_nh4_col(begc:endc) = spval - call hist_addfld1d (fname='SMIN_NH4', units='gN/m^2', & - avgflag='A', long_name='soil mineral NH4', & - ptr_col=this%smin_nh4_col) - endif - else - if ( nlevdecomp_full > 1 ) then - data2dptr => this%sminn_vr_col(begc:endc,1:nlevsoi) - call hist_addfld_decomp (fname='SMINN'//trim(vr_suffix), units='gN/m^3', type2d='levsoi', & - avgflag='A', long_name='soil mineral N', & - ptr_col=data2dptr) - end if - - end if - - this%totlitn_col(begc:endc) = spval - call hist_addfld1d (fname='TOTLITN', units='gN/m^2', & - avgflag='A', long_name='total litter N', & - ptr_col=this%totlitn_col) - - this%totsomn_col(begc:endc) = spval - call hist_addfld1d (fname='TOTSOMN', units='gN/m^2', & - avgflag='A', long_name='total soil organic matter N', & - ptr_col=this%totsomn_col) - - this%dyn_nbal_adjustments_col(begc:endc) = spval - call hist_addfld1d (fname='DYN_COL_SOIL_ADJUSTMENTS_N', units='gN/m^2', & - avgflag='SUM', & - long_name='Adjustments in soil nitrogen due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_nbal_adjustments_col, default='inactive') - - if (use_nitrif_denitrif) then - call hist_addfld1d (fname='DYN_COL_SOIL_ADJUSTMENTS_NO3', units='gN/m^2', & - avgflag='SUM', & - long_name='Adjustments in soil NO3 due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_no3bal_adjustments_col, default='inactive') - - call hist_addfld1d (fname='DYN_COL_SOIL_ADJUSTMENTS_NH4', units='gN/m^2', & - avgflag='SUM', & - long_name='Adjustments in soil NH4 due to dynamic column areas; & - &only makes sense at the column level: should not be averaged to gridcell', & - ptr_col=this%dyn_nh4bal_adjustments_col, default='inactive') - end if - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine InitCold(this, bounds, & - decomp_cpools_vr_col, decomp_cpools_col, decomp_cpools_1m_col) - ! - ! !DESCRIPTION: - ! Initializes time varying variables used only in coupled carbon-nitrogen mode (CN): - ! - ! !USES: - use decompMod , only : bounds_type - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,:,:) - real(r8) , intent(in) :: decomp_cpools_col(bounds%begc:,:) - real(r8) , intent(in) :: decomp_cpools_1m_col(bounds%begc:,:) - ! - ! !LOCAL VARIABLES: - integer :: fc,g,l,c,j,k ! indices - integer :: num_special_col ! number of good values in special_col filter - integer :: special_col (bounds%endc-bounds%begc+1) ! special landunit filter - columns - !------------------------------------------------------------------------ - - SHR_ASSERT_ALL((ubound(decomp_cpools_col) == (/bounds%endc,ndecomp_pools/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_1m_col) == (/bounds%endc,ndecomp_pools/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), errMsg(sourcefile, __LINE__)) - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - - ! column nitrogen state variables - this%ntrunc_col(c) = 0._r8 - this%sminn_col(c) = 0._r8 - do j = 1, nlevdecomp - do k = 1, ndecomp_pools - this%decomp_npools_vr_col(c,j,k) = decomp_cpools_vr_col(c,j,k) / decomp_cascade_con%initial_cn_ratio(k) - end do - this%sminn_vr_col(c,j) = 0._r8 - this%ntrunc_vr_col(c,j) = 0._r8 - end do - if ( nlevdecomp > 1 ) then - do j = nlevdecomp+1, nlevdecomp_full - do k = 1, ndecomp_pools - this%decomp_npools_vr_col(c,j,k) = 0._r8 - end do - this%sminn_vr_col(c,j) = 0._r8 - this%ntrunc_vr_col(c,j) = 0._r8 - end do - end if - do k = 1, ndecomp_pools - this%decomp_npools_col(c,k) = decomp_cpools_col(c,k) / decomp_cascade_con%initial_cn_ratio(k) - this%decomp_npools_1m_col(c,k) = decomp_cpools_1m_col(c,k) / decomp_cascade_con%initial_cn_ratio(k) - end do - - if (use_nitrif_denitrif) then - do j = 1, nlevdecomp_full - this%smin_nh4_vr_col(c,j) = 0._r8 - this%smin_no3_vr_col(c,j) = 0._r8 - end do - this%smin_nh4_col(c) = 0._r8 - this%smin_no3_col(c) = 0._r8 - end if - this%totlitn_col(c) = 0._r8 - this%totsomn_col(c) = 0._r8 - this%totlitn_1m_col(c) = 0._r8 - this%totsomn_1m_col(c) = 0._r8 - this%cwdn_col(c) = 0._r8 - - end if - end do - - ! initialize fields for special filters - - num_special_col = 0 - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - num_special_col = num_special_col + 1 - special_col(num_special_col) = c - end if - end do - - call this%SetValues (num_column=num_special_col, filter_column=special_col, value_column=0._r8) - - end subroutine InitCold - - !----------------------------------------------------------------------- - subroutine Restart ( this, bounds, ncid, flag, totvegc_col ) - ! - ! !DESCRIPTION: - ! Read/write CN restart data for nitrogen state - ! - ! !USES: - use shr_infnan_mod , only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - use clm_time_manager , only : is_restart, get_nstep - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class (soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid - character(len=*) , intent(in) :: flag !'read' or 'write' or 'define' - real(r8) , intent(in) :: totvegc_col(bounds%begc:bounds%endc) ! (gC/m2) total vegetation carbon - - ! - ! !LOCAL VARIABLES: - integer :: i,j,k,l,c - logical :: readvar - integer :: idata - logical :: exit_spinup = .false. - logical :: enter_spinup = .false. - real(r8) :: m ! multiplier for the exit_spinup code - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - character(len=128) :: varname ! temporary - integer :: itemp ! temporary - integer , pointer :: iptemp(:) ! pointer to memory to be allocated - ! spinup state as read from restart file, for determining whether to enter or exit spinup mode. - integer :: restart_file_spinup_state - ! flags for comparing the model and restart decomposition cascades - integer :: decomp_cascade_state, restart_file_decomp_cascade_state - !------------------------------------------------------------------------ - - ! sminn - if (use_vertsoilc) then - ptr2d => this%sminn_vr_col - call restartvar(ncid=ncid, flag=flag, varname="sminn_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%sminn_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="sminn", xtype=ncd_double, & - dim1name='column', & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg='ERROR::'//trim(varname)//' is required on an initialization dataset'//& - errMsg(sourcefile, __LINE__)) - end if - - ! decomposing N pools - do k = 1, ndecomp_pools - varname=trim(decomp_cascade_con%decomp_pool_name_restart(k))//'n' - if (use_vertsoilc) then - ptr2d => this%decomp_npools_vr_col(:,:,k) - call restartvar(ncid=ncid, flag=flag, varname=trim(varname)//"_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%decomp_npools_vr_col(:,1,k) - call restartvar(ncid=ncid, flag=flag, varname=varname, xtype=ncd_double, & - dim1name='column', & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg='ERROR:: '//trim(varname)//' is required on an initialization dataset'//& - errMsg(sourcefile, __LINE__)) - end if - end do - - if (use_vertsoilc) then - ptr2d => this%ntrunc_vr_col - call restartvar(ncid=ncid, flag=flag, varname="col_ntrunc_vr", xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%ntrunc_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname="col_ntrunc", xtype=ncd_double, & - dim1name='column', & - long_name='', units='', fill_value=spval, & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - - if (use_nitrif_denitrif) then - ! smin_no3_vr - if (use_vertsoilc) then - ptr2d => this%smin_no3_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='smin_no3_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%smin_no3_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='smin_no3', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg= 'ERROR:: smin_no3_vr'//' is required on an initialization dataset' ) - end if - end if - - if (use_nitrif_denitrif) then - ! smin_nh4 - if (use_vertsoilc) then - ptr2d => this%smin_nh4_vr_col(:,:) - call restartvar(ncid=ncid, flag=flag, varname='smin_nh4_vr', xtype=ncd_double, & - dim1name='column', dim2name='levgrnd', switchdim=.true., & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%smin_nh4_vr_col(:,1) - call restartvar(ncid=ncid, flag=flag, varname='smin_nh4', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=ptr1d) - end if - if (flag=='read' .and. .not. readvar) then - call endrun(msg= 'ERROR:: smin_nh4_vr'//' is required on an initialization dataset' ) - end if - end if - - ! decomp_cascade_state - the purpose of this is to check to make sure the bgc used - ! matches what the restart file was generated with. - ! add info about the SOM decomposition cascade - - if (use_century_decomp) then - decomp_cascade_state = 1 - else - decomp_cascade_state = 0 - end if - ! add info about the nitrification / denitrification state - if (use_nitrif_denitrif) then - decomp_cascade_state = decomp_cascade_state + 10 - end if - if (flag == 'write') itemp = decomp_cascade_state - call restartvar(ncid=ncid, flag=flag, varname='decomp_cascade_state', xtype=ncd_int, & - long_name='BGC of the model that wrote this restart file:' & - // ' 1s column: 0 = CLM-CN cascade, 1 = Century cascade;' & - // ' 10s column: 0 = CLM-CN denitrification, 10 = Century denitrification', units='', & - interpinic_flag='skip', readvar=readvar, data=itemp) - if (flag=='read') then - if (.not. readvar) then - ! assume, for sake of backwards compatibility, that if decomp_cascade_state - ! is not in the restart file, then the current model state is the same as - ! the prior model state - restart_file_decomp_cascade_state = decomp_cascade_state - if ( masterproc ) write(iulog,*) ' CNRest: WARNING! Restart file does not ' & - // ' contain info on decomp_cascade_state used to generate the restart file. ' - if ( masterproc ) write(iulog,*) ' Assuming the same as current setting: ', decomp_cascade_state - else - restart_file_decomp_cascade_state = itemp - if (decomp_cascade_state /= restart_file_decomp_cascade_state ) then - if ( masterproc ) then - write(iulog,*) 'CNRest: ERROR--the decomposition cascade differs between the current ' & - // ' model state and the model that wrote the restart file. ' - write(iulog,*) 'The model will be horribly out of equilibrium until after a lengthy spinup. ' - write(iulog,*) 'Stopping here since this is probably an error in configuring the run. ' - write(iulog,*) 'If you really wish to proceed, then override by setting ' - write(iulog,*) 'override_bgc_restart_mismatch_dump to .true. in the namelist' - if ( .not. override_bgc_restart_mismatch_dump ) then - call endrun(msg= ' CNRest: Stopping. Decomposition cascade mismatch error.'//& - errMsg(sourcefile, __LINE__)) - endif - endif - endif - end if - end if - - !-------------------------------- - ! Spinup state - !-------------------------------- - - ! Do nothing for write - ! Note that the call to write spinup_state out was done in soilbiogeochem_carbonstate_inst and - ! cannot be called again because it will try to define the variable twice - ! when the flag below is set to define - if (flag == 'read') then - call restartvar(ncid=ncid, flag=flag, varname='spinup_state', xtype=ncd_int, & - long_name='Spinup state of the model that wrote this restart file: ' & - // ' 0 = normal model mode, 1 = AD spinup', units='', & - interpinic_flag='copy', readvar=readvar, data=idata) - if (readvar) then - restart_file_spinup_state = idata - else - ! assume, for sake of backwards compatibility, that if spinup_state is not in - ! the restart file then current model state is the same as prior model state - restart_file_spinup_state = spinup_state - if ( masterproc ) then - write(iulog,*) ' WARNING! Restart file does not contain info ' & - // ' on spinup state used to generate the restart file. ' - write(iulog,*) ' Assuming the same as current setting: ', spinup_state - end if - end if - end if - - ! now compare the model and restart file spinup states, and either take the - ! model into spinup mode or out of it if they are not identical - ! taking model out of spinup mode requires multiplying each decomposing pool - ! by the associated AD factor. - ! putting model into spinup mode requires dividing each decomposing pool - ! by the associated AD factor. - ! only allow this to occur on first timestep of model run. - - if (flag == 'read' .and. spinup_state /= restart_file_spinup_state ) then - if (spinup_state == 0 .and. restart_file_spinup_state >= 1 ) then - if ( masterproc ) write(iulog,*) ' NitrogenStateType Restart: taking SOM pools out of AD spinup mode' - exit_spinup = .true. - else if (spinup_state >= 1 .and. restart_file_spinup_state == 0 ) then - if ( masterproc ) write(iulog,*) ' NitrogenStateType Restart: taking SOM pools into AD spinup mode' - enter_spinup = .true. - else - call endrun(msg=' Error in entering/exiting spinup. spinup_state ' & - // ' != restart_file_spinup_state, but do not know what to do'//& - errMsg(sourcefile, __LINE__)) - end if - if (get_nstep() >= 2) then - call endrun(msg=' Error in entering/exiting spinup - should occur only when nstep = 1'//& - errMsg(sourcefile, __LINE__)) - endif - if ( exit_spinup .and. isnan(this%totvegcthresh) )then - call endrun(msg=' Error in exit spinup - totvegcthresh was not set with SetTotVgCThresh'//& - errMsg(sourcefile, __LINE__)) - end if - do k = 1, ndecomp_pools - if ( exit_spinup ) then - m = decomp_cascade_con%spinup_factor(k) - else if ( enter_spinup ) then - m = 1. / decomp_cascade_con%spinup_factor(k) - end if - do c = bounds%begc, bounds%endc - l = col%landunit(c) - do j = 1, nlevdecomp - if ( abs(m - 1._r8) .gt. 0.000001_r8 .and. exit_spinup) then - this%decomp_npools_vr_col(c,j,k) = this%decomp_npools_vr_col(c,j,k) * m * & - get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - ! If there is no vegetation nitrogen, - ! implying that all vegetation has - ! died, then - ! reset decomp pools to near zero during exit_spinup to - ! avoid very - ! large and inert soil carbon stocks; note that only - ! pools with spinup factor > 1 - ! will be affected, which means that total SOMN and LITN - ! pools will not be set to 0. - if (totvegc_col(c) <= this%totvegcthresh .and. lun%itype(l) /= istcrop) then - this%decomp_npools_vr_col(c,j,k) = 0._r8 - endif - elseif ( abs(m - 1._r8) .gt. 0.000001_r8 .and. enter_spinup) then - this%decomp_npools_vr_col(c,j,k) = this%decomp_npools_vr_col(c,j,k) * m / & - get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) - else - this%decomp_npools_vr_col(c,j,k) = this%decomp_npools_vr_col(c,j,k) * m - endif - end do - end do - end do - end if - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine SetValues ( this, num_column, filter_column, value_column ) - ! - ! !DESCRIPTION: - ! Set nitrogen state variables - ! - ! !ARGUMENTS: - class (soilbiogeochem_nitrogenstate_type) :: this - integer , intent(in) :: num_column - integer , intent(in) :: filter_column(:) - real(r8), intent(in) :: value_column - ! - ! !LOCAL VARIABLES: - integer :: fi,i ! loop index - integer :: j,k ! indices - !------------------------------------------------------------------------ - - do fi = 1,num_column - i = filter_column(fi) - - this%sminn_col(i) = value_column - this%ntrunc_col(i) = value_column - this%cwdn_col(i) = value_column - if (use_nitrif_denitrif) then - this%smin_no3_col(i) = value_column - this%smin_nh4_col(i) = value_column - end if - this%totlitn_col(i) = value_column - this%totsomn_col(i) = value_column - this%totsomn_1m_col(i) = value_column - this%totlitn_1m_col(i) = value_column - end do - - do j = 1,nlevdecomp_full - do fi = 1,num_column - i = filter_column(fi) - this%sminn_vr_col(i,j) = value_column - this%ntrunc_vr_col(i,j) = value_column - if (use_nitrif_denitrif) then - this%smin_no3_vr_col(i,j) = value_column - this%smin_nh4_vr_col(i,j) = value_column - end if - end do - end do - - ! column and decomp_pools - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_npools_col(i,k) = value_column - this%decomp_npools_1m_col(i,k) = value_column - end do - end do - - ! column levdecomp, and decomp_pools - do j = 1,nlevdecomp_full - do k = 1, ndecomp_pools - do fi = 1,num_column - i = filter_column(fi) - this%decomp_npools_vr_col(i,j,k) = value_column - end do - end do - end do - - end subroutine SetValues - - !----------------------------------------------------------------------- - subroutine Summary(this, bounds, num_allc, filter_allc) - ! - ! !ARGUMENTS: - class (soilbiogeochem_nitrogenstate_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_allc ! number of columns in allc filter - integer , intent(in) :: filter_allc(:) ! filter for all active columns - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l ! indices - integer :: fc ! lake filter indices - real(r8) :: maxdepth ! depth to integrate soil variables - !----------------------------------------------------------------------- - - ! vertically integrate NO3 NH4 N2O pools - if (use_nitrif_denitrif) then - do fc = 1,num_allc - c = filter_allc(fc) - this%smin_no3_col(c) = 0._r8 - this%smin_nh4_col(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%smin_no3_col(c) = & - this%smin_no3_col(c) + & - this%smin_no3_vr_col(c,j) * dzsoi_decomp(j) - - this%smin_nh4_col(c) = & - this%smin_nh4_col(c) + & - this%smin_nh4_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - end if - - ! vertically integrate each of the decomposing N pools - do l = 1, ndecomp_pools - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_npools_col(c,l) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_npools_col(c,l) = & - this%decomp_npools_col(c,l) + & - this%decomp_npools_vr_col(c,j,l) * dzsoi_decomp(j) - end do - end do - end do - - ! for vertically-resolved soil biogeochemistry, calculate some diagnostics of carbon pools to a given depth - if ( nlevdecomp > 1) then - - do l = 1, ndecomp_pools - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_npools_1m_col(c,l) = 0._r8 - end do - end do - - ! vertically integrate each of the decomposing n pools to 1 meter - maxdepth = 1._r8 - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - if ( zisoi(j) <= maxdepth ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_npools_1m_col(c,l) = & - this%decomp_npools_1m_col(c,l) + & - this%decomp_npools_vr_col(c,j,l) * dzsoi_decomp(j) - end do - elseif ( zisoi(j-1) < maxdepth ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%decomp_npools_1m_col(c,l) = & - this%decomp_npools_1m_col(c,l) + & - this%decomp_npools_vr_col(c,j,l) * (maxdepth - zisoi(j-1)) - end do - endif - end do - end do - - ! total litter nitrogen to 1 meter (TOTLITN_1m) - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitn_1m_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitn_1m_col(c) = & - this%totlitn_1m_col(c) + & - this%decomp_npools_1m_col(c,l) - end do - end if - end do - - ! total soil organic matter nitrogen to 1 meter (TOTSOMN_1m) - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomn_1m_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_soil(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomn_1m_col(c) = this%totsomn_1m_col(c) + & - this%decomp_npools_1m_col(c,l) - end do - end if - end do - - endif - - ! total litter nitrogen (TOTLITN) - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitn_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_litter(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totlitn_col(c) = & - this%totlitn_col(c) + & - this%decomp_npools_col(c,l) - end do - end if - end do - - ! total soil organic matter nitrogen (TOTSOMN) - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomn_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_soil(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%totsomn_col(c) = this%totsomn_col(c) + & - this%decomp_npools_col(c,l) - end do - end if - end do - - ! total cwdn - do fc = 1,num_allc - c = filter_allc(fc) - this%cwdn_col(c) = 0._r8 - end do - do l = 1, ndecomp_pools - if ( decomp_cascade_con%is_cwd(l) ) then - do fc = 1,num_allc - c = filter_allc(fc) - this%cwdn_col(c) = this%cwdn_col(c) + & - this%decomp_npools_col(c,l) - end do - end if - end do - - ! total sminn - do fc = 1,num_allc - c = filter_allc(fc) - this%sminn_col(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%sminn_col(c) = this%sminn_col(c) + & - this%sminn_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - ! total col_ntrunc - do fc = 1,num_allc - c = filter_allc(fc) - this%ntrunc_col(c) = 0._r8 - end do - do j = 1, nlevdecomp - do fc = 1,num_allc - c = filter_allc(fc) - this%ntrunc_col(c) = this%ntrunc_col(c) + & - this%ntrunc_vr_col(c,j) * dzsoi_decomp(j) - end do - end do - - end subroutine Summary - - !----------------------------------------------------------------------- - subroutine DynamicColumnAdjustments(this, bounds, clump_index, column_state_updater) - ! - ! !DESCRIPTION: - ! Adjust state variables when column areas change due to dynamic landuse - ! - ! !USES: - use dynColumnStateUpdaterMod, only : column_state_updater_type - ! - ! !ARGUMENTS: - class(soilbiogeochem_nitrogenstate_type) , intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - - ! Index of clump on which we're currently operating. Note that this implies that this - ! routine must be called from within a clump loop. - integer , intent(in) :: clump_index - - type(column_state_updater_type) , intent(in) :: column_state_updater - ! - ! !LOCAL VARIABLES: - integer :: j ! level - integer :: l ! decomp pool - real(r8) :: adjustment_one_level(bounds%begc:bounds%endc) - integer :: begc, endc - - character(len=*), parameter :: subname = 'DynamicColumnAdjustments' - !----------------------------------------------------------------------- - - begc = bounds%begc - endc = bounds%endc - - this%dyn_nbal_adjustments_col(begc:endc) = 0._r8 - - do l = 1, ndecomp_pools - do j = 1, nlevdecomp - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%decomp_npools_vr_col(begc:endc, j, l), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_nbal_adjustments_col(begc:endc) = & - this%dyn_nbal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - end do - end do - - do j = 1, nlevdecomp - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%ntrunc_vr_col(begc:endc, j), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_nbal_adjustments_col(begc:endc) = & - this%dyn_nbal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%sminn_vr_col(begc:endc, j), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_nbal_adjustments_col(begc:endc) = & - this%dyn_nbal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - end do - - if (use_nitrif_denitrif) then - - do j = 1, nlevdecomp - ! Separately track adjustments made to no3 and nh4 pools, since those aren't included - ! in the overall N balance (totn) - this%dyn_no3bal_adjustments_col(begc:endc) = 0._r8 - this%dyn_nh4bal_adjustments_col(begc:endc) = 0._r8 - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%smin_no3_vr_col(begc:endc, j), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_no3bal_adjustments_col(begc:endc) = & - this%dyn_no3bal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - - call column_state_updater%update_column_state_no_special_handling( & - bounds = bounds, & - clump_index = clump_index, & - var = this%smin_nh4_vr_col(begc:endc, j), & - adjustment = adjustment_one_level(begc:endc)) - this%dyn_nh4bal_adjustments_col(begc:endc) = & - this%dyn_nh4bal_adjustments_col(begc:endc) + & - adjustment_one_level(begc:endc) * dzsoi_decomp(j) - end do - - end if - - end subroutine DynamicColumnAdjustments - - !------------------------------------------------------------------------ - subroutine SetTotVgCThresh(this, totvegcthresh) - - class(soilbiogeochem_nitrogenstate_type) :: this - real(r8) , intent(in) :: totvegcthresh - - if ( totvegcthresh <= 0.0_r8 )then - call endrun(msg=' Error totvegcthresh is zero or negative and should be > 0'//& - errMsg(sourcefile, __LINE__)) - end if - this%totvegcthresh = totvegcthresh - - end subroutine SetTotVgCThresh - -end module SoilBiogeochemNitrogenStateType diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 deleted file mode 100644 index 578367de97..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenUptakeMod.F90 +++ /dev/null @@ -1,81 +0,0 @@ -module SoilBiogeochemNitrogenUptakeMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate the nitrogen uptake profile - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: SoilBiogeochemNitrogenUptake - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemNitrogenUptake(bounds, nlevdecomp, num_soilc, filter_soilc, & - sminn_vr, dzsoi_decomp, nfixation_prof, nuptake_prof) - ! - ! DESCRIPTION - ! Calculate the nitrogen uptake profile - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: nlevdecomp ! number of vertical layers - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - real(r8) , intent(in) :: sminn_vr(bounds%begc: , 1: ) ! soil mineral nitrogen profile - real(r8) , intent(in) :: dzsoi_decomp(1: ) ! layer thickness - real(r8) , intent(in) :: nfixation_prof(bounds%begc: , 1: ) ! nitrogen fixation profile - real(r8) , intent(inout) :: nuptake_prof(bounds%begc:bounds%endc, 1:nlevdecomp) ! nitrogen uptake profile - ! - ! !LOCAL VARIABLES: - integer :: fc, j, c ! indices - real(r8):: sminn_tot(bounds%begc:bounds%endc) !vertically integrated mineral nitrogen - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(dzsoi_decomp) == (/nlevdecomp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(sminn_vr) == (/bounds%endc, nlevdecomp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(nfixation_prof) == (/bounds%endc, nlevdecomp/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(nuptake_prof) == (/bounds%endc, nlevdecomp/)) , errMsg(sourcefile, __LINE__)) - - ! init sminn_tot - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = 0. - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - sminn_tot(c) = sminn_tot(c) + sminn_vr(c,j) * dzsoi_decomp(j) - end do - end do - - do j = 1, nlevdecomp - do fc=1,num_soilc - c = filter_soilc(fc) - if (sminn_tot(c) > 0.) then - nuptake_prof(c,j) = sminn_vr(c,j) / sminn_tot(c) - else - nuptake_prof(c,j) = nfixation_prof(c,j) - endif - - end do - end do - - end subroutine SoilBiogeochemNitrogenUptake - -end module SoilBiogeochemNitrogenUptakeMod diff --git a/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 b/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 deleted file mode 100644 index 2349a63fd4..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemPotentialMod.F90 +++ /dev/null @@ -1,266 +0,0 @@ -module SoilBiogeochemPotentialMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate potential decomp rates and total immobilization demand. - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use clm_varpar , only : nlevdecomp, ndecomp_cascade_transitions, ndecomp_pools - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use clm_varctl , only : use_fates, iulog - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: readParams - public :: SoilBiogeochemPotential - ! - type, private :: params_type - real(r8) :: dnp !denitrification proportion - end type Params_type - ! - type(params_type), private :: params_inst - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine readParams ( ncid ) - ! - ! !DESCRIPTION: - ! Read parameters - ! - ! !USES: - use ncdio_pio , only: file_desc_t,ncd_io - use abortutils , only: endrun - use shr_log_mod , only: errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id - ! - ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNDecompParamsType' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: tempr ! temporary to read in constant - character(len=100) :: tString ! temp. var for reading - !----------------------------------------------------------------------- - - tString='dnp' - call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%dnp=tempr - - end subroutine readParams - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemPotential (bounds, num_soilc, filter_soilc, & - soilbiogeochem_state_inst, soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst, & - cn_decomp_pools, p_decomp_cpool_loss, pmnf_decomp_cascade) - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - ! - ! !ARGUMENT: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - type(soilbiogeochem_carbonstate_type) , intent(in) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst - real(r8) , intent(out) :: cn_decomp_pools(bounds%begc:,1:,1:) ! c:n ratios of applicable pools - real(r8) , intent(out) :: p_decomp_cpool_loss(bounds%begc:,1:,1:) ! potential C loss from one pool to another - real(r8) , intent(out) :: pmnf_decomp_cascade(bounds%begc:,1:,1:) ! potential mineral N flux, from one pool to another - ! - ! !LOCAL VARIABLES: - integer :: c,j,k,l,m !indices - integer :: fc !filter column index - integer :: begc,endc !bounds - real(r8):: immob(bounds%begc:bounds%endc,1:nlevdecomp) !potential N immobilization - real(r8):: ratio !temporary variable - integer, parameter :: i_atm = 0 !TODO - this appears in two places - move it to 1 - !----------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - - SHR_ASSERT_ALL((ubound(cn_decomp_pools) == (/endc,nlevdecomp,ndecomp_pools/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(p_decomp_cpool_loss) == (/endc,nlevdecomp,ndecomp_cascade_transitions/)) , errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(pmnf_decomp_cascade) == (/endc,nlevdecomp,ndecomp_cascade_transitions/)) , errMsg(sourcefile, __LINE__)) - - associate( & - cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step - cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step - floating_cn_ratio_decomp_pools => decomp_cascade_con%floating_cn_ratio_decomp_pools , & ! Input: [logical (:) ] TRUE => pool has fixed C:N ratio - initial_cn_ratio => decomp_cascade_con%initial_cn_ratio , & ! Input: [real(r8) (:) ] c:n ratio for initialization of pools - - fpi_vr => soilbiogeochem_state_inst%fpi_vr_col , & ! Input: [real(r8) (:,:) ] fraction of potential immobilization (no units) - rf_decomp_cascade => soilbiogeochem_state_inst%rf_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] respired fraction in decomposition step (frac) - pathfrac_decomp_cascade => soilbiogeochem_state_inst%pathfrac_decomp_cascade_col , & ! Input: [real(r8) (:,:,:) ] what fraction of C leaving a given pool passes through a given transition (frac) - - decomp_npools_vr => soilbiogeochem_nitrogenstate_inst%decomp_npools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) N pools - - decomp_cpools_vr => soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - - decomp_cascade_ntransfer_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_ntransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res transfer of N from donor to receiver pool along decomp. cascade (gN/m3/s) - decomp_cascade_sminn_flux_vr => soilbiogeochem_nitrogenflux_inst%decomp_cascade_sminn_flux_vr_col , & ! Output: [real(r8) (:,:,:) ] vert-res mineral N flux for transition along decomposition cascade (gN/m3/s) - potential_immob_vr => soilbiogeochem_nitrogenflux_inst%potential_immob_vr_col , & ! Output: [real(r8) (:,:) ] - sminn_to_denit_decomp_cascade_vr => soilbiogeochem_nitrogenflux_inst%sminn_to_denit_decomp_cascade_vr_col , & ! Output: [real(r8) (:,:,:) ] - gross_nmin_vr => soilbiogeochem_nitrogenflux_inst%gross_nmin_vr_col , & ! Output: [real(r8) (:,:) ] - net_nmin_vr => soilbiogeochem_nitrogenflux_inst%net_nmin_vr_col , & ! Output: [real(r8) (:,:) ] - gross_nmin => soilbiogeochem_nitrogenflux_inst%gross_nmin_col , & ! Output: [real(r8) (:) ] gross rate of N mineralization (gN/m2/s) - net_nmin => soilbiogeochem_nitrogenflux_inst%net_nmin_col , & ! Output: [real(r8) (:) ] net rate of N mineralization (gN/m2/s) - - w_scalar => soilbiogeochem_carbonflux_inst%w_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by moisture availability - decomp_cascade_hr_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_hr_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - decomp_cascade_ctransfer_vr => soilbiogeochem_carbonflux_inst%decomp_cascade_ctransfer_vr_col , & ! Output: [real(r8) (:,:,:) ] vertically-resolved het. resp. from decomposing C pools (gC/m3/s) - decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) - phr_vr => soilbiogeochem_carbonflux_inst%phr_vr_col , & ! Output: [real(r8) (:,:) ] potential HR (gC/m3/s) - fphr => soilbiogeochem_carbonflux_inst%fphr_col & ! Output: [real(r8) (:,:) ] fraction of potential SOM + LITTER heterotrophic - ) - - if ( .not. use_fates ) then - ! set initial values for potential C and N fluxes - p_decomp_cpool_loss(begc:endc, :, :) = 0._r8 - pmnf_decomp_cascade(begc:endc, :, :) = 0._r8 - - ! column loop to calculate potential decomp rates and total immobilization demand - - !! calculate c:n ratios of applicable pools - do l = 1, ndecomp_pools - if ( floating_cn_ratio_decomp_pools(l) ) then - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if ( decomp_npools_vr(c,j,l) > 0._r8 ) then - cn_decomp_pools(c,j,l) = decomp_cpools_vr(c,j,l) / decomp_npools_vr(c,j,l) - end if - end do - end do - else - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - cn_decomp_pools(c,j,l) = initial_cn_ratio(l) - end do - end do - end if - end do - - ! calculate the non-nitrogen-limited fluxes - ! these fluxes include the "/ dt" term to put them on a - ! per second basis, since the rate constants have been - ! calculated on a per timestep basis. - - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (decomp_cpools_vr(c,j,cascade_donor_pool(k)) > 0._r8 .and. & - decomp_k(c,j,cascade_donor_pool(k)) > 0._r8 ) then - p_decomp_cpool_loss(c,j,k) = decomp_cpools_vr(c,j,cascade_donor_pool(k)) & - * decomp_k(c,j,cascade_donor_pool(k)) * pathfrac_decomp_cascade(c,j,k) - if ( .not. floating_cn_ratio_decomp_pools(cascade_receiver_pool(k)) ) then !! not transition of cwd to litter - - if (cascade_receiver_pool(k) /= i_atm ) then ! not 100% respiration - ratio = 0._r8 - - if (decomp_npools_vr(c,j,cascade_donor_pool(k)) > 0._r8) then - ratio = cn_decomp_pools(c,j,cascade_receiver_pool(k))/cn_decomp_pools(c,j,cascade_donor_pool(k)) - endif - - pmnf_decomp_cascade(c,j,k) = (p_decomp_cpool_loss(c,j,k) * (1.0_r8 - rf_decomp_cascade(c,j,k) - ratio) & - / cn_decomp_pools(c,j,cascade_receiver_pool(k)) ) - - else ! 100% respiration - pmnf_decomp_cascade(c,j,k) = - p_decomp_cpool_loss(c,j,k) / cn_decomp_pools(c,j,cascade_donor_pool(k)) - endif - - else ! CWD -> litter - pmnf_decomp_cascade(c,j,k) = 0._r8 - end if - end if - end do - - end do - end do - - ! Sum up all the potential immobilization fluxes (positive pmnf flux) - ! and all the mineralization fluxes (negative pmnf flux) - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - immob(c,j) = 0._r8 - end do - end do - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pmnf_decomp_cascade(c,j,k) > 0._r8) then - immob(c,j) = immob(c,j) + pmnf_decomp_cascade(c,j,k) - else - gross_nmin_vr(c,j) = gross_nmin_vr(c,j) - pmnf_decomp_cascade(c,j,k) - end if - end do - end do - end do - - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - potential_immob_vr(c,j) = immob(c,j) - end do - end do - else ! use_fates - ! As a first step we are making this a C-only model, so no N downregulation of fluxes. - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! - p_decomp_cpool_loss(c,j,k) = decomp_cpools_vr(c,j,cascade_donor_pool(k)) & - * decomp_k(c,j,cascade_donor_pool(k)) * pathfrac_decomp_cascade(c,j,k) - ! - end do - end do - end do - end if - - ! Add up potential hr for methane calculations - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - phr_vr(c,j) = 0._r8 - end do - end do - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - phr_vr(c,j) = phr_vr(c,j) + rf_decomp_cascade(c,j,k) * p_decomp_cpool_loss(c,j,k) - end do - end do - end do - - end associate - - end subroutine SoilBiogeochemPotential - -end module SoilBiogeochemPotentialMod diff --git a/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 b/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 deleted file mode 100644 index 2bd92d2d41..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemPrecisionControlMod.F90 +++ /dev/null @@ -1,196 +0,0 @@ -module SoilBiogeochemPrecisionControlMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! controls on very low values in critical state variables - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varpar , only : ndecomp_pools - use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use ColumnType , only : col - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: SoilBiogeochemPrecisionControlInit ! Initialization - public:: SoilBiogeochemPrecisionControl ! Apply precision control to soil biogeochemistry carbon and nitrogen states - - ! !PUBLIC DATA: - real(r8), public :: ccrit ! critical carbon state value for truncation (gC/m2) - real(r8), public :: ncrit ! critical nitrogen state value for truncation (gN/m2) - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemPrecisionControlInit( soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, soilbiogeochem_nitrogenstate_inst) - - ! - ! !DESCRIPTION: - ! Initialization of soil biogeochemistry precision control - ! - ! !USES: - use clm_varctl , only : use_c13, use_c14 - ! - ! !ARGUMENTS: - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - real(r8), parameter :: totvegcthresh = 0.1_r8 ! Total vegetation carbon threshold to zero out decomposition pools - !----------------------------------------------------------------------- - ccrit = 1.e-8_r8 ! critical carbon state value for truncation (gC/m2) - ncrit = 1.e-8_r8 ! critical nitrogen state value for truncation (gN/m2) - - call soilbiogeochem_carbonstate_inst%setTotVgCThresh( totvegcthresh ) - if ( use_c13 )then - call c13_soilbiogeochem_carbonstate_inst%setTotVgCThresh( totvegcthresh ) - end if - if ( use_c14 )then - call c14_soilbiogeochem_carbonstate_inst%setTotVgCThresh( totvegcthresh ) - end if - call soilbiogeochem_nitrogenstate_inst%setTotVgCThresh( totvegcthresh ) - - end subroutine SoilBiogeochemPrecisionControlInit - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemPrecisionControl(num_soilc, filter_soilc, & - soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst, & - c14_soilbiogeochem_carbonstate_inst, soilbiogeochem_nitrogenstate_inst) - - ! - ! !DESCRIPTION: - ! On the radiation time step, force leaf and deadstem c and n to 0 if - ! they get too small. - ! - ! !USES: - use clm_varctl , only : iulog, use_c13, use_c14, use_nitrif_denitrif, use_cn - use clm_varpar , only : nlevdecomp - use CNSharedParamsMod, only: use_fun - ! - ! !ARGUMENTS: - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c13_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_carbonstate_type) , intent(inout) :: c14_soilbiogeochem_carbonstate_inst - type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst - ! - ! !LOCAL VARIABLES: - integer :: c,j,k ! indices - integer :: fc ! filter indices - real(r8):: cc,cn ! truncation terms for column-level corrections - real(r8):: cc13 ! truncation terms for column-level corrections - real(r8):: cc14 ! truncation terms for column-level corrections - !----------------------------------------------------------------------- - - ! soilbiogeochem_carbonstate_inst%ctrunc_vr_col Output: [real(r8) (:,:) ] (gC/m3) column-level sink for C truncation - ! soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col Output: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools - - ! soilbiogeochem_nitrogenstate_inst%ntrunc_vr_col Output: [real(r8) (:,:) ] (gN/m3) column-level sink for N truncation - ! soilbiogeochem_nitrogenstate_inst%decomp_npools_vr_col Output: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) N pools - ! soilbiogeochem_nitrogenstate_inst%smin_nh4_vr_col Output: [real(r8) (:,:) ] (gN/m3) soil mineral NH4 - ! soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col Output: [real(r8) (:,:) ] (gN/m3) soil mineral NO3 - - associate(& - cs => soilbiogeochem_carbonstate_inst , & - ns => soilbiogeochem_nitrogenstate_inst , & - c13cs => c13_soilbiogeochem_carbonstate_inst , & - c14cs => c14_soilbiogeochem_carbonstate_inst & - ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - do j = 1,nlevdecomp - ! initialize the column-level C and N truncation terms - cc = 0._r8 - if ( use_c13 ) cc13 = 0._r8 - if ( use_c14 ) cc14 = 0._r8 - cn = 0._r8 - - ! do tests on state variables for precision control - ! for linked C-N state variables, perform precision test on - ! the C component, but truncate both C and N components - - - ! all decomposing pools C and N - do k = 1, ndecomp_pools - - if (abs(cs%decomp_cpools_vr_col(c,j,k)) < ccrit) then - cc = cc + cs%decomp_cpools_vr_col(c,j,k) - cs%decomp_cpools_vr_col(c,j,k) = 0._r8 - - if (use_cn) then - cn = cn + ns%decomp_npools_vr_col(c,j,k) - ns%decomp_npools_vr_col(c,j,k) = 0._r8 - endif - - if ( use_c13 ) then - cc13 = cc13 + c13cs%decomp_cpools_vr_col(c,j,k) - c13cs%decomp_cpools_vr_col(c,j,k) = 0._r8 - endif - if ( use_c14 ) then - cc14 = cc14 + c14cs%decomp_cpools_vr_col(c,j,k) - c14cs%decomp_cpools_vr_col(c,j,k) = 0._r8 - endif - end if - - end do - - ! not doing precision control on soil mineral N, since it will - ! be getting the N truncation flux anyway. - - cs%ctrunc_vr_col(c,j) = cs%ctrunc_vr_col(c,j) + cc - - if (use_cn) then - ns%ntrunc_vr_col(c,j) = ns%ntrunc_vr_col(c,j) + cn - endif - if ( use_c13 ) then - c13cs%ctrunc_vr_col(c,j) = c13cs%ctrunc_vr_col(c,j) + cc13 - endif - if ( use_c14 ) then - c14cs%ctrunc_vr_col(c,j) = c14cs%ctrunc_vr_col(c,j) + cc14 - endif - end do - - end do ! end of column loop - - if(.not.use_fun)then - if (use_nitrif_denitrif) then - ! remove small negative perturbations for stability purposes, if any should arise. - - do fc = 1,num_soilc - c = filter_soilc(fc) - do j = 1,nlevdecomp - if (abs(ns%smin_no3_vr_col(c,j)) < ncrit/1e4_r8) then - if ( ns%smin_no3_vr_col(c,j) < 0._r8 ) then - !write(iulog, *) '-10^-12 < smin_no3 < 0. resetting to zero.' - !write(iulog, *) 'smin_no3_vr_col(c,j), c, j: ', ns%smin_no3_vr_col(c,j), c, j - ns%smin_no3_vr_col(c,j) = 0._r8 - endif - end if - if (abs(ns%smin_nh4_vr_col(c,j)) < ncrit/1e4_r8) then - if ( ns%smin_nh4_vr_col(c,j) < 0._r8 ) then - !write(iulog, *) '-10^-12 < smin_nh4 < 0. resetting to zero.' - !write(iulog, *) 'smin_nh4_vr_col(c,j), c, j: ', ns%smin_nh4_vr_col(c,j), c, j - ns%smin_nh4_vr_col(c,j) = 0._r8 - endif - end if - end do - end do - endif - endif - - end associate - - end subroutine SoilBiogeochemPrecisionControl - -end module SoilBiogeochemPrecisionControlMod diff --git a/src/soilbiogeochem/SoilBiogeochemStateType.F90 b/src/soilbiogeochem/SoilBiogeochemStateType.F90 deleted file mode 100644 index 45cf6e27dd..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemStateType.F90 +++ /dev/null @@ -1,336 +0,0 @@ -module SoilBiogeochemStateType - - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use decompMod , only : bounds_type - use abortutils , only : endrun - use spmdMod , only : masterproc - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevsoifl, nlevsoi - use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, nlevdecomp_full - use clm_varcon , only : spval, ispval, c14ratio, grlnd - use landunit_varcon, only : istsoil, istcrop - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak - use clm_varctl , only : use_vertsoilc, use_cn - use clm_varctl , only : iulog - use LandunitType , only : lun - use ColumnType , only : col - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: get_spinup_latitude_term - ! - ! !PUBLIC TYPES: - type, public :: soilbiogeochem_state_type - - real(r8) , pointer :: leaf_prof_patch (:,:) ! (1/m) profile of leaves (vertical profiles for calculating fluxes) - real(r8) , pointer :: froot_prof_patch (:,:) ! (1/m) profile of fine roots (vertical profiles for calculating fluxes) - real(r8) , pointer :: croot_prof_patch (:,:) ! (1/m) profile of coarse roots (vertical profiles for calculating fluxes) - real(r8) , pointer :: stem_prof_patch (:,:) ! (1/m) profile of stems (vertical profiles for calculating fluxes) - real(r8) , pointer :: fpi_vr_col (:,:) ! (no units) fraction of potential immobilization - real(r8) , pointer :: fpi_col (:) ! (no units) fraction of potential immobilization - real(r8), pointer :: fpg_col (:) ! (no units) fraction of potential gpp - real(r8) , pointer :: rf_decomp_cascade_col (:,:,:) ! (frac) respired fraction in decomposition step - real(r8) , pointer :: pathfrac_decomp_cascade_col (:,:,:) ! (frac) what fraction of C leaving a given pool passes through a given transition - real(r8) , pointer :: nfixation_prof_col (:,:) ! (1/m) profile for N fixation additions - real(r8) , pointer :: ndep_prof_col (:,:) ! (1/m) profile for N fixation additions - real(r8) , pointer :: som_adv_coef_col (:,:) ! (m2/s) SOM advective flux - real(r8) , pointer :: som_diffus_coef_col (:,:) ! (m2/s) SOM diffusivity due to bio/cryo-turbation - real(r8) , pointer :: plant_ndemand_col (:) ! column-level plant N demand - - contains - - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - - end type soilbiogeochem_state_type - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine Init(this, bounds) - - class(soilbiogeochem_state_type) :: this - type(bounds_type), intent(in) :: bounds - - call this%InitAllocate ( bounds ) - if (use_cn) then - call this%InitHistory ( bounds ) - end if - call this%InitCold ( bounds ) - - end subroutine Init - - !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(soilbiogeochem_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - allocate(this%leaf_prof_patch (begp:endp,1:nlevdecomp_full)) ; this%leaf_prof_patch (:,:) = spval - allocate(this%froot_prof_patch (begp:endp,1:nlevdecomp_full)) ; this%froot_prof_patch (:,:) = spval - allocate(this%croot_prof_patch (begp:endp,1:nlevdecomp_full)) ; this%croot_prof_patch (:,:) = spval - allocate(this%stem_prof_patch (begp:endp,1:nlevdecomp_full)) ; this%stem_prof_patch (:,:) = spval - allocate(this%fpi_vr_col (begc:endc,1:nlevdecomp_full)) ; this%fpi_vr_col (:,:) = nan - allocate(this%fpi_col (begc:endc)) ; this%fpi_col (:) = nan - allocate(this%fpg_col (begc:endc)) ; this%fpg_col (:) = nan - allocate(this%nfixation_prof_col (begc:endc,1:nlevdecomp_full)) ; this%nfixation_prof_col (:,:) = spval - allocate(this%ndep_prof_col (begc:endc,1:nlevdecomp_full)) ; this%ndep_prof_col (:,:) = spval - allocate(this%som_adv_coef_col (begc:endc,1:nlevdecomp_full)) ; this%som_adv_coef_col (:,:) = spval - allocate(this%som_diffus_coef_col (begc:endc,1:nlevdecomp_full)) ; this%som_diffus_coef_col (:,:) = spval - allocate(this%plant_ndemand_col (begc:endc)) ; this%plant_ndemand_col (:) = nan - - allocate(this%rf_decomp_cascade_col(begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions)); - this%rf_decomp_cascade_col(:,:,:) = nan - - allocate(this%pathfrac_decomp_cascade_col(begc:endc,1:nlevdecomp_full,1:ndecomp_cascade_transitions)); - this%pathfrac_decomp_cascade_col(:,:,:) = nan - - end subroutine InitAllocate - - !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) - ! - ! !DESCRIPTION: - ! Initialize module data structure - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use histFileMod , only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp, no_snow_normal - use CNSharedParamsMod , only : use_fun - ! - ! !ARGUMENTS: - class(soilbiogeochem_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begp, endp - integer :: begc, endc - character(8) :: vr_suffix - character(10) :: active - real(r8), pointer :: data2dptr(:,:), data1dptr(:) ! temp. pointers for slicing larger arrays - !------------------------------------------------------------------------ - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - this%croot_prof_patch(begp:endp,:) = spval - call hist_addfld_decomp (fname='CROOT_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for litter C and N inputs from coarse roots', & - ptr_patch=this%croot_prof_patch, default='inactive') - - this%froot_prof_patch(begp:endp,:) = spval - call hist_addfld_decomp (fname='FROOT_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for litter C and N inputs from fine roots', & - ptr_patch=this%froot_prof_patch, default='inactive') - - this%leaf_prof_patch(begp:endp,:) = spval - call hist_addfld_decomp (fname='LEAF_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for litter C and N inputs from leaves', & - ptr_patch=this%leaf_prof_patch, default='inactive') - - this%stem_prof_patch(begp:endp,:) = spval - call hist_addfld_decomp (fname='STEM_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for litter C and N inputs from stems', & - ptr_patch=this%stem_prof_patch, default='inactive') - - this%nfixation_prof_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='NFIXATION_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for biological N fixation', & - ptr_col=this%nfixation_prof_col, default='inactive') - - this%ndep_prof_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='NDEP_PROF', units='1/m', type2d='levdcmp', & - avgflag='A', long_name='profile for atmospheric N deposition', & - ptr_col=this%ndep_prof_col, default='inactive') - - this%som_adv_coef_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SOM_ADV_COEF', units='m/s', type2d='levdcmp', & - avgflag='A', long_name='advection term for vertical SOM translocation', & - ptr_col=this%som_adv_coef_col, default='inactive') - - this%som_diffus_coef_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='SOM_DIFFUS_COEF', units='m^2/s', type2d='levdcmp', & - avgflag='A', long_name='diffusion coefficient for vertical SOM translocation', & - ptr_col=this%som_diffus_coef_col, default='inactive') - - if ( nlevdecomp_full > 1 ) then - this%fpi_col(begc:endc) = spval - call hist_addfld1d (fname='FPI', units='proportion', & - avgflag='A', long_name='fraction of potential immobilization', & - ptr_col=this%fpi_col) - endif - - if (.not. use_fun) then - this%fpg_col(begc:endc) = spval - call hist_addfld1d (fname='FPG', units='proportion', & - avgflag='A', long_name='fraction of potential gpp', & - ptr_col=this%fpg_col) - end if - - if (nlevdecomp > 1) then - vr_suffix = "_vr" - else - vr_suffix = "" - endif - this%fpi_vr_col(begc:endc,:) = spval - call hist_addfld_decomp (fname='FPI'//trim(vr_suffix), units='proportion', type2d='levdcmp', & - avgflag='A', long_name='fraction of potential immobilization', & - ptr_col=this%fpi_vr_col, default='inactive') - - end subroutine InitHistory - - !----------------------------------------------------------------------- - subroutine initCold(this, bounds) - ! - ! !USES: - use spmdMod , only : masterproc - use fileutils , only : getfil - use ncdio_pio - ! - ! !ARGUMENTS: - class(soilbiogeochem_state_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,l,c,p,n,j,m ! indices - integer :: dimid ! dimension id - integer :: ier ! error status - logical :: readvar - integer :: begc, endc - !----------------------------------------------------------------------- - - begc = bounds%begc; endc= bounds%endc - - ! -------------------------------------------------------------------- - ! Initialize terms needed for dust model - ! -------------------------------------------------------------------- - - do c = bounds%begc, bounds%endc - l = col%landunit(c) - if (lun%ifspecial(l)) then - this%fpi_col (c) = spval - this%fpg_col (c) = spval - do j = 1,nlevdecomp_full - this%fpi_vr_col(c,j) = spval - end do - end if - - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - ! initialize fpi_vr so that levels below nlevsoi are not nans - this%fpi_vr_col(c,1:nlevdecomp_full) = 0._r8 - this%som_adv_coef_col(c,1:nlevdecomp_full) = 0._r8 - this%som_diffus_coef_col(c,1:nlevdecomp_full) = 0._r8 - - ! initialize the profiles for converting to vertically resolved carbon pools - this%nfixation_prof_col(c,1:nlevdecomp_full) = 0._r8 - this%ndep_prof_col(c,1:nlevdecomp_full) = 0._r8 - end if - end do - - end subroutine initCold - - !------------------------------------------------------------------------ - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use shr_log_mod, only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc - use abortutils , only : endrun - use restUtilMod - use ncdio_pio - ! - ! !ARGUMENTS: - class(soilbiogeochem_state_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag - ! - ! !LOCAL VARIABLES: - integer, pointer :: temp1d(:) ! temporary - integer :: p,j,c,i ! indices - logical :: readvar ! determine if variable is on initial file - real(r8), pointer :: ptr2d(:,:) ! temp. pointers for slicing larger arrays - real(r8), pointer :: ptr1d(:) ! temp. pointers for slicing larger arrays - !----------------------------------------------------------------------- - - if (use_vertsoilc) then - ptr2d => this%fpi_vr_col - call restartvar(ncid=ncid, flag=flag, varname='fpi_vr', xtype=ncd_double, & - dim1name='column',dim2name='levgrnd', switchdim=.true., & - long_name='fraction of potential immobilization', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - else - ptr1d => this%fpi_vr_col(:,1) ! nlevdecomp = 1; so treat as 1D variable - call restartvar(ncid=ncid, flag=flag, varname='fpi', xtype=ncd_double, & - dim1name='column', & - long_name='fraction of potential immobilization', units='unitless', & - interpinic_flag='interp' , readvar=readvar, data=ptr1d) - end if - - if (use_vertsoilc) then - ptr2d => this%som_adv_coef_col - call restartvar(ncid=ncid, flag=flag, varname='som_adv_coef_vr', xtype=ncd_double, & - dim1name='column',dim2name='levgrnd', switchdim=.true., & - long_name='SOM advective flux', units='m/s', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - end if - - if (use_vertsoilc) then - ptr2d => this%som_diffus_coef_col - call restartvar(ncid=ncid, flag=flag, varname='som_diffus_coef_vr', xtype=ncd_double, & - dim1name='column',dim2name='levgrnd', switchdim=.true., & - long_name='SOM diffusivity due to bio/cryo-turbation', units='m^2/s', fill_value=spval, & - interpinic_flag='interp', readvar=readvar, data=ptr2d) - end if - - call restartvar(ncid=ncid, flag=flag, varname='fpg', xtype=ncd_double, & - dim1name='column', & - long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%fpg_col) - - end subroutine Restart - - - function get_spinup_latitude_term(latitude) result(ans) - - !!DESCRIPTION: - ! calculate a logistic function to scale spinup factors so that spinup is more accelerated in high latitude regions - ! - ! !REVISION HISTORY - ! charlie koven, nov. 2015 - ! - ! !ARGUMENTS: - real(r8), intent(in) :: latitude - ! - ! !LOCAL VARIABLES: - real(r8) :: ans - - ans = 1._r8 + 50._r8 / ( 1._r8 + exp(-0.15_r8 * (abs(latitude) - 60._r8) ) ) - - return - end function get_spinup_latitude_term - -end module SoilBiogeochemStateType diff --git a/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 b/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 deleted file mode 100644 index 94c8c55d6a..0000000000 --- a/src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90 +++ /dev/null @@ -1,277 +0,0 @@ -module SoilBiogeochemVerticalProfileMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Calculate vertical profiles for distributing soil and litter C and N - ! - ! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - ! - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public:: SoilBiogeochemVerticalProfile - ! - real(r8), public :: surfprof_exp = 10. ! how steep profile is for surface components (1/ e_folding depth) (1/m) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine SoilBiogeochemVerticalProfile(bounds, num_soilc,filter_soilc,num_soilp,filter_soilp, & - canopystate_inst, soilstate_inst, soilbiogeochem_state_inst) - ! - ! !DESCRIPTION: - ! calculate vertical profiles for distributing soil and litter C and N - ! - ! BUG(wjs, 2014-12-15, bugz 2107) - ! Because of this routine's placement in the driver sequence (it is - ! called very early in each timestep, before weights are adjusted and filters are - ! updated), it may be necessary for this routine to compute values over inactive as well - ! as active points (since some inactive points may soon become active) - so that's what - ! is done now. Currently, it seems to be okay to do this, because the variables computed - ! here seem to only depend on quantities that are valid over inactive as well as active - ! points. However, note that this routine is (mistakenly) called from two places - ! currently - the above note applies to its call from the driver, but its call from - ! CNDecompMod uses the standard filters that just apply over active points - ! - ! !USES: - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varcon , only : zsoi, dzsoi, zisoi, dzsoi_decomp, zmin_bedrock - use clm_varpar , only : nlevdecomp, nlevgrnd, nlevdecomp_full, maxpatch_pft - use clm_varctl , only : use_vertsoilc, iulog, use_bedrock - use pftconMod , only : noveg, pftcon - use SoilBiogeochemStateType , only : soilbiogeochem_state_type - use CanopyStateType , only : canopystate_type - use SoilStateType , only : soilstate_type - use ColumnType , only : col - use PatchType , only : patch - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of soil columns in filter - integer , intent(in) :: filter_soilc(:) ! filter for soil columns - integer , intent(in) :: num_soilp ! number of soil patches in filter - integer , intent(in) :: filter_soilp(:) ! filter for soil patches - type(canopystate_type) , intent(in) :: canopystate_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(soilbiogeochem_state_type) , intent(inout) :: soilbiogeochem_state_inst - ! - ! !LOCAL VARIABLES: - real(r8) :: surface_prof(1:nlevdecomp) - real(r8) :: surface_prof_tot - real(r8) :: rootfr_tot - real(r8) :: cinput_rootfr(bounds%begp:bounds%endp, 1:nlevdecomp_full) ! pft-native root fraction used for calculating inputs - real(r8) :: col_cinput_rootfr(bounds%begc:bounds%endc, 1:nlevdecomp_full) ! col-native root fraction used for calculating inputs - integer :: c, j, fc, p, fp, pi - integer :: alt_ind - ! debugging temp variables - real(r8) :: froot_prof_sum - real(r8) :: croot_prof_sum - real(r8) :: leaf_prof_sum - real(r8) :: stem_prof_sum - real(r8) :: ndep_prof_sum - real(r8) :: nfixation_prof_sum - real(r8) :: delta = 1.e-10 - integer :: begp, endp - integer :: begc, endc - character(len=32) :: subname = 'SoilBiogeochemVerticalProfile' - !----------------------------------------------------------------------- - - begp = bounds%begp; endp= bounds%endp - begc = bounds%begc; endc= bounds%endc - - associate( & - altmax_lastyear_indx => canopystate_inst%altmax_lastyear_indx_col , & ! Input: [integer (:) ] frost table depth (m) - - crootfr => soilstate_inst%crootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) - - nfixation_prof => soilbiogeochem_state_inst%nfixation_prof_col , & ! Input : [real(r8) (:,:) ] (1/m) profile for N fixation additions - ndep_prof => soilbiogeochem_state_inst%ndep_prof_col , & ! Input : [real(r8) (:,:) ] (1/m) profile for N fixation additions - leaf_prof => soilbiogeochem_state_inst%leaf_prof_patch , & ! Output : [real(r8) (:,:) ] (1/m) profile of leaves - froot_prof => soilbiogeochem_state_inst%froot_prof_patch , & ! Output : [real(r8) (:,:) ] (1/m) profile of fine roots - croot_prof => soilbiogeochem_state_inst%croot_prof_patch , & ! Output : [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => soilbiogeochem_state_inst%stem_prof_patch & ! Output : [real(r8) (:,:) ] (1/m) profile of stems - ) - - if (use_vertsoilc) then - - ! define a single shallow surface profile for surface additions (leaves, stems, and N deposition) - surface_prof(:) = 0._r8 - do j = 1, nlevdecomp - surface_prof(j) = exp(-surfprof_exp * zsoi(j)) / dzsoi_decomp(j) - if (use_bedrock) then - if (zsoi(j) > zmin_bedrock) then - surface_prof(j) = 0._r8 - end if - end if - end do - - ! initialize profiles to zero - leaf_prof(begp:endp, :) = 0._r8 - froot_prof(begp:endp, :) = 0._r8 - croot_prof(begp:endp, :) = 0._r8 - stem_prof(begp:endp, :) = 0._r8 - nfixation_prof(begc:endc, :) = 0._r8 - ndep_prof(begc:endc, :) = 0._r8 - - cinput_rootfr(begp:endp, :) = 0._r8 - col_cinput_rootfr(begc:endc, :) = 0._r8 - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - if (patch%itype(p) /= noveg) then - do j = 1, nlevdecomp - cinput_rootfr(p,j) = crootfr(p,j) / dzsoi_decomp(j) - end do - - else - cinput_rootfr(p,1) = 0. - endif - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = patch%column(p) - ! integrate rootfr over active layer of soil column - rootfr_tot = 0._r8 - surface_prof_tot = 0._r8 - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - rootfr_tot = rootfr_tot + cinput_rootfr(p,j) * dzsoi_decomp(j) - surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) - end do - if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then - ! where there is not permafrost extending to the surface, integrate the profiles over the active layer - ! this is equivalnet to integrating over all soil layers outside of permafrost regions - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - froot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot - croot_prof(p,j) = cinput_rootfr(p,j) / rootfr_tot - - if (j > col%nbedrock(c) .and. cinput_rootfr(p,j) > 0._r8) then - write(iulog,*) 'cinput_rootfr > 0 in bedrock' - end if - ! set all surface processes to shallower profile - leaf_prof(p,j) = surface_prof(j)/ surface_prof_tot - stem_prof(p,j) = surface_prof(j)/ surface_prof_tot - end do - else - ! if fully frozen, or no roots, put everything in the top layer - froot_prof(p,1) = 1./dzsoi_decomp(1) - croot_prof(p,1) = 1./dzsoi_decomp(1) - leaf_prof(p,1) = 1./dzsoi_decomp(1) - stem_prof(p,1) = 1./dzsoi_decomp(1) - endif - - end do - - !! aggregate root profile to column - ! call p2c (decomp, nlevdecomp_full, & - ! cinput_rootfr(bounds%begp:bounds%endp, :), & - ! col_cinput_rootfr(bounds%begc:bounds%endc, :), & - ! 'unity') - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= col%npatches(c)) then - p = col%patchi(c) + pi - 1 - do j = 1,nlevdecomp - col_cinput_rootfr(c,j) = col_cinput_rootfr(c,j) + cinput_rootfr(p,j) * patch%wtcol(p) - end do - end if - end do - end do - - ! repeat for column-native profiles: Ndep and Nfix - do fc = 1,num_soilc - c = filter_soilc(fc) - rootfr_tot = 0._r8 - surface_prof_tot = 0._r8 - ! redo column ntegration over active layer for column-native profiles - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - rootfr_tot = rootfr_tot + col_cinput_rootfr(c,j) * dzsoi_decomp(j) - surface_prof_tot = surface_prof_tot + surface_prof(j) * dzsoi_decomp(j) - end do - if ( (altmax_lastyear_indx(c) > 0) .and. (rootfr_tot > 0._r8) .and. (surface_prof_tot > 0._r8) ) then - do j = 1, min(max(altmax_lastyear_indx(c), 1), nlevdecomp) - nfixation_prof(c,j) = col_cinput_rootfr(c,j) / rootfr_tot - ndep_prof(c,j) = surface_prof(j)/ surface_prof_tot - end do - else - nfixation_prof(c,1) = 1./dzsoi_decomp(1) - ndep_prof(c,1) = 1./dzsoi_decomp(1) - endif - end do - - else - - ! for one layer decomposition model, set profiles to unity - leaf_prof(begp:endp, :) = 1._r8 - froot_prof(begp:endp, :) = 1._r8 - croot_prof(begp:endp, :) = 1._r8 - stem_prof(begp:endp, :) = 1._r8 - nfixation_prof(begc:endc, :) = 1._r8 - ndep_prof(begc:endc, :) = 1._r8 - - end if - - - ! check to make sure integral of all profiles = 1. - do fc = 1,num_soilc - c = filter_soilc(fc) - ndep_prof_sum = 0. - nfixation_prof_sum = 0. - do j = 1, nlevdecomp - ndep_prof_sum = ndep_prof_sum + ndep_prof(c,j) * dzsoi_decomp(j) - nfixation_prof_sum = nfixation_prof_sum + nfixation_prof(c,j) * dzsoi_decomp(j) - end do - if ( ( abs(ndep_prof_sum - 1._r8) > delta ) .or. ( abs(nfixation_prof_sum - 1._r8) > delta ) ) then - write(iulog, *) 'profile sums: ', ndep_prof_sum, nfixation_prof_sum - write(iulog, *) 'c: ', c - write(iulog, *) 'altmax_lastyear_indx: ', altmax_lastyear_indx(c) - write(iulog, *) 'nfixation_prof: ', nfixation_prof(c,:) - write(iulog, *) 'ndep_prof: ', ndep_prof(c,:) - write(iulog, *) 'cinput_rootfr: ', cinput_rootfr(c,:) - write(iulog, *) 'dzsoi_decomp: ', dzsoi_decomp(:) - write(iulog, *) 'surface_prof: ', surface_prof(:) - write(iulog, *) 'npfts(c): ', col%npatches(c) - do p = col%patchi(c), col%patchi(c) + col%npatches(c) -1 - write(iulog, *) 'p, itype(p), wtcol(p): ', p, patch%itype(p), patch%wtcol(p) - write(iulog, *) 'cinput_rootfr(p,:): ', cinput_rootfr(p,:) - end do - call endrun(msg=" ERROR: _prof_sum-1>delta"//errMsg(sourcefile, __LINE__)) - endif - end do - - do fp = 1,num_soilp - p = filter_soilp(fp) - froot_prof_sum = 0. - croot_prof_sum = 0. - leaf_prof_sum = 0. - stem_prof_sum = 0. - do j = 1, nlevdecomp - froot_prof_sum = froot_prof_sum + froot_prof(p,j) * dzsoi_decomp(j) - croot_prof_sum = croot_prof_sum + croot_prof(p,j) * dzsoi_decomp(j) - leaf_prof_sum = leaf_prof_sum + leaf_prof(p,j) * dzsoi_decomp(j) - stem_prof_sum = stem_prof_sum + stem_prof(p,j) * dzsoi_decomp(j) - end do - if ( ( abs(froot_prof_sum - 1._r8) > delta ) .or. ( abs(croot_prof_sum - 1._r8) > delta ) .or. & - ( abs(stem_prof_sum - 1._r8) > delta ) .or. ( abs(leaf_prof_sum - 1._r8) > delta ) ) then - write(iulog, *) 'profile sums: ', froot_prof_sum, croot_prof_sum, leaf_prof_sum, stem_prof_sum - call endrun(msg=' ERROR: sum-1 > delta'//errMsg(sourcefile, __LINE__)) - endif - end do - - end associate - - end subroutine SoilBiogeochemVerticalProfile - -end module SoilBiogeochemVerticalProfileMod diff --git a/src/soilbiogeochem/test/ACSpinup_test/CMakeLists.txt b/src/soilbiogeochem/test/ACSpinup_test/CMakeLists.txt deleted file mode 100644 index 17f01d6d22..0000000000 --- a/src/soilbiogeochem/test/ACSpinup_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(acspinup test_acspinup_exe - "test_acspinup.pf" "") - -target_link_libraries(test_acspinup_exe clm csm_share) diff --git a/src/soilbiogeochem/test/ACSpinup_test/test_acspinup.pf b/src/soilbiogeochem/test/ACSpinup_test/test_acspinup.pf deleted file mode 100644 index df9c4f80fb..0000000000 --- a/src/soilbiogeochem/test/ACSpinup_test/test_acspinup.pf +++ /dev/null @@ -1,46 +0,0 @@ -module test_acspinup - - ! Tests of the acspinup functions in SoilBiogeochemStateType - - use pfunit_mod - - use shr_kind_mod , only : r8 => shr_kind_r8 - use SoilBiogeochemStateType, only : get_spinup_latitude_term - - implicit none - save - - real(r8), parameter :: tol = 1.e-8_r8 - -contains - - @Test - subroutine test_spinup_lat_term() - real(r8) :: previous, current - real(r8) :: dx, lat - integer :: ilat - - @assertEqual( 50.450652868_r8, get_spinup_latitude_term( 90.0_r8 ), tolerance=tol) - @assertEqual( 50.450652868_r8, get_spinup_latitude_term( -90.0_r8 ), tolerance=tol) - @assertEqual( 1.006169729_r8, get_spinup_latitude_term( 0.0_r8 ), tolerance=tol) - @assertEqual( 26.000000000_r8, get_spinup_latitude_term( 60.0_r8 ), tolerance=tol) - @assertEqual( 26.000000000_r8, get_spinup_latitude_term( -60.0_r8 ), tolerance=tol) - - ! Check that montone increasing - lat = 0.0_r8 - @assertEqual( lat, 0.0_r8 ) - previous = get_spinup_latitude_term( lat ) - dx = 0.01_r8 - do ilat = 1, nint(90.0_r8/dx) - lat = real(ilat,r8)*dx - current = get_spinup_latitude_term( lat ) - @assertGreaterThan( current, previous ) - ! Check that negative latitude gives the same answer as positive - @assertEqual( current, get_spinup_latitude_term( -lat ) ) - end do - @assertEqual( lat, 90.0_r8, tolerance=tol ) - - end subroutine test_spinup_lat_term - - -end module test_acspinup diff --git a/src/soilbiogeochem/test/CMakeLists.txt b/src/soilbiogeochem/test/CMakeLists.txt deleted file mode 100644 index 988cb531b5..0000000000 --- a/src/soilbiogeochem/test/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(ACSpinup_test) diff --git a/src/unit_test_shr/CMakeLists.txt b/src/unit_test_shr/CMakeLists.txt deleted file mode 100644 index 8e3494f8c7..0000000000 --- a/src/unit_test_shr/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(genf90_files - unittestArrayMod.F90.in - ) - -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) - -sourcelist_to_parent(clm_genf90_sources) - -list(APPEND clm_sources "${clm_genf90_sources}") - -list(APPEND clm_sources - unittestTimeManagerMod.F90 - unittestSubgridMod.F90 - unittestSimpleSubgridSetupsMod.F90 - unittestFilterBuilderMod.F90 - unittestGlcMec.F90 - unittestUtils.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/unit_test_shr/test/CMakeLists.txt b/src/unit_test_shr/test/CMakeLists.txt deleted file mode 100644 index ef8ee66acb..0000000000 --- a/src/unit_test_shr/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(unittestArray_test) -add_subdirectory(unittestSubgrid_test) -add_subdirectory(unittestFilterBuilder_test) diff --git a/src/unit_test_shr/test/unittestArray_test/CMakeLists.txt b/src/unit_test_shr/test/unittestArray_test/CMakeLists.txt deleted file mode 100644 index 9a18380545..0000000000 --- a/src/unit_test_shr/test/unittestArray_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(unittestArray test_unittestArray_exe - "test_unittestArray.pf" "") - -target_link_libraries(test_unittestArray_exe clm csm_share) \ No newline at end of file diff --git a/src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf b/src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf deleted file mode 100644 index b11d62e612..0000000000 --- a/src/unit_test_shr/test/unittestArray_test/test_unittestArray.pf +++ /dev/null @@ -1,86 +0,0 @@ -module test_unittestArray - - ! Tests of unittestArrayMod - - use pfunit_mod - use unittestArrayMod - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestUnittestArray - contains - procedure :: setUp - procedure :: tearDown - end type TestUnittestArray - -contains - - subroutine setUp(this) - class(TestUnittestArray), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestUnittestArray), intent(inout) :: this - - call unittest_subgrid_teardown() - end subroutine tearDown - - @Test - subroutine col_array_returnsColArray(this) - class(TestUnittestArray), intent(inout) :: this - real(r8), allocatable :: arr(:) - - call unittest_subgrid_setup_start() - call create_gridcell_single_veg_patch(1) - call create_gridcell_single_veg_patch(2) - call unittest_subgrid_setup_end() - - arr = col_array() - - @assertEqual((bounds%endc-bounds%begc+1), size(arr)) - - end subroutine col_array_returnsColArray - - @Test - subroutine col_array_setsVal(this) - class(TestUnittestArray), intent(inout) :: this - real(r8), allocatable :: arr(:) - - call unittest_subgrid_setup_start() - call create_gridcell_single_veg_patch(1) - call create_gridcell_single_veg_patch(2) - call unittest_subgrid_setup_end() - - arr = col_array(17._r8) - - @assertEqual([17._r8, 17._r8], arr) - end subroutine col_array_setsVal - - @Test - subroutine col_array_uninit(this) - class(TestUnittestArray), intent(inout) :: this - real(r8), allocatable :: arr(:) - - call unittest_subgrid_setup_start() - call create_gridcell_single_veg_patch(1) - call create_gridcell_single_veg_patch(2) - call unittest_subgrid_setup_end() - - arr = col_array() - - @assertIsNan(arr(1)) - @assertIsNan(arr(2)) - end subroutine col_array_uninit - - @Test - subroutine test_logical_array_to_int(this) - class(TestUnittestArray), intent(inout) :: this - - @assertEqual([1, 0, 1], logical_array_to_int([.true., .false., .true.])) - end subroutine test_logical_array_to_int - -end module test_unittestArray diff --git a/src/unit_test_shr/test/unittestFilterBuilder_test/CMakeLists.txt b/src/unit_test_shr/test/unittestFilterBuilder_test/CMakeLists.txt deleted file mode 100644 index c767479aee..0000000000 --- a/src/unit_test_shr/test/unittestFilterBuilder_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(unittestFilterBuilder test_filterBuilder_exe - "test_filterBuilder.pf" "") - -target_link_libraries(test_filterBuilder_exe clm csm_share) \ No newline at end of file diff --git a/src/unit_test_shr/test/unittestFilterBuilder_test/test_filterBuilder.pf b/src/unit_test_shr/test/unittestFilterBuilder_test/test_filterBuilder.pf deleted file mode 100644 index 58674110a9..0000000000 --- a/src/unit_test_shr/test/unittestFilterBuilder_test/test_filterBuilder.pf +++ /dev/null @@ -1,46 +0,0 @@ -module test_filterBuilder - - ! Tests of unittestFilterBuilder - - use pfunit_mod - use unittestFilterBuilderMod - - implicit none - save - -contains - - ! ======================================================================== - ! Tests of filter_from_range - ! ======================================================================== - - @Test - subroutine test_filter_from_range_multipoint() - integer :: numf - integer, allocatable :: filter(:) - - call filter_from_range(start=3, end=5, numf=numf, filter=filter) - @assertEqual(3, numf) - @assertEqual([3,4,5], filter) - end subroutine test_filter_from_range_multipoint - - @Test - subroutine test_filter_from_range_onepoint() - integer :: numf - integer, allocatable :: filter(:) - - call filter_from_range(start=3, end=3, numf=numf, filter=filter) - @assertEqual(1, numf) - @assertEqual([3], filter) - end subroutine test_filter_from_range_onepoint - - @Test - subroutine test_filter_from_range_nopoints() - integer :: numf - integer, allocatable :: filter(:) - - call filter_from_range(start=3, end=1, numf=numf, filter=filter) - @assertEqual(0, numf) - end subroutine test_filter_from_range_nopoints - -end module test_filterBuilder diff --git a/src/unit_test_shr/test/unittestSubgrid_test/CMakeLists.txt b/src/unit_test_shr/test/unittestSubgrid_test/CMakeLists.txt deleted file mode 100644 index 2e0bc4f03e..0000000000 --- a/src/unit_test_shr/test/unittestSubgrid_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(unittestSubgrid test_unittestSubgrid_exe - "test_unittestSubgrid.pf" "") - -target_link_libraries(test_unittestSubgrid_exe clm csm_share) \ No newline at end of file diff --git a/src/unit_test_shr/test/unittestSubgrid_test/test_unittestSubgrid.pf b/src/unit_test_shr/test/unittestSubgrid_test/test_unittestSubgrid.pf deleted file mode 100644 index a0bea34dc4..0000000000 --- a/src/unit_test_shr/test/unittestSubgrid_test/test_unittestSubgrid.pf +++ /dev/null @@ -1,39 +0,0 @@ -module test_unittestSubgrid - - ! Tests of unittestSubgridMod - - use pfunit_mod - use unittestSubgridMod - use shr_kind_mod , only : r8 => shr_kind_r8 - - implicit none - - @TestCase - type, extends(TestCase) :: TestUnittestSubgrid - contains - procedure :: setUp - procedure :: tearDown - end type TestUnittestSubgrid - -contains - - subroutine setUp(this) - class(TestUnittestSubgrid), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestUnittestSubgrid), intent(inout) :: this - end subroutine tearDown - - @Test - subroutine get_ltype_special_returnsSpecialLandunit(this) - use landunit_varcon, only : landunit_is_special - class(TestUnittestSubgrid), intent(inout) :: this - integer :: ltype - - ltype = get_ltype_special() - - @assertTrue(landunit_is_special(ltype)) - end subroutine get_ltype_special_returnsSpecialLandunit - -end module test_unittestSubgrid diff --git a/src/unit_test_shr/unittestArrayMod.F90.in b/src/unit_test_shr/unittestArrayMod.F90.in deleted file mode 100644 index 2d82892063..0000000000 --- a/src/unit_test_shr/unittestArrayMod.F90.in +++ /dev/null @@ -1,220 +0,0 @@ -module unittestArrayMod - - ! Provides utility functions for working with array inputs to (or outputs from) - ! subroutines. - ! - ! The routines here assume that the subgrid structure has been set up via - ! unittestSubgridMod. - - use shr_kind_mod, only : r8 => shr_kind_r8, i4 => shr_kind_i4 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use unittestSubgridMod, only : bounds - - implicit none - private - save - - ! Create a gridcell-level array filled with a single value; the type of the array is the - ! same as the type of the input value. If no value is given, an r8 array is returned, - ! filled with NaNs. - public :: grc_array - - ! Create a column-level array filled with a single value; the type of the array is the - ! same as the type of the input value. If no value is given, an r8 array is returned, - ! filled with NaNs. - public :: col_array - - ! Create a patch-level array filled with a single value; the type of the array is the - ! same as the type of the input value. If no value is given, an r8 array is returned, - ! filled with NaNs. - public :: patch_array - - ! Converts an array of logicals to a same-size array of integers: false => 0, true => 1 - public :: logical_array_to_int - - interface grc_array - module procedure grc_array_uninit - - !TYPE logical,int,double - module procedure grc_array_{TYPE} - end interface grc_array - - interface col_array - module procedure col_array_uninit - - !TYPE logical,int,double - module procedure col_array_{TYPE} - end interface col_array - - interface patch_array - module procedure patch_array_uninit - - !TYPE logical,int,double - module procedure patch_array_{TYPE} - end interface patch_array - -contains - - !----------------------------------------------------------------------- - pure function grc_array_uninit() result(grc_array) - ! - ! !DESCRIPTION: - ! Creates a gridcell-level array of r8 values. All elements are set to NaN. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), allocatable :: grc_array(:) ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'grc_array_uninit' - !----------------------------------------------------------------------- - - allocate(grc_array(bounds%begg:bounds%endg)) - grc_array(:) = nan - - end function grc_array_uninit - - !----------------------------------------------------------------------- - !TYPE logical,int,double - pure function grc_array_{TYPE}(val) result(grc_array) - ! - ! !DESCRIPTION: - ! Creates a gridcell-level array with the same type as val. All elements are set to val. - ! - ! !USES: - ! - ! !ARGUMENTS: - {VTYPE}, allocatable :: grc_array(:) ! function result - {VTYPE}, intent(in) :: val ! all elements in grc_array are set to val - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'grc_array_{TYPE}' - !----------------------------------------------------------------------- - - allocate(grc_array(bounds%begg:bounds%endg)) - grc_array(:) = val - - end function grc_array_{TYPE} - - - !----------------------------------------------------------------------- - pure function col_array_uninit() result(col_array) - ! - ! !DESCRIPTION: - ! Creates a column-level array of r8 values. All elements are set to NaN. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), allocatable :: col_array(:) ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'col_array_uninit' - !----------------------------------------------------------------------- - - allocate(col_array(bounds%begc:bounds%endc)) - col_array(:) = nan - - end function col_array_uninit - - - !----------------------------------------------------------------------- - !TYPE logical,int,double - pure function col_array_{TYPE}(val) result(col_array) - ! - ! !DESCRIPTION: - ! Creates a column-level array with the same type as val. All elements are set to val. - ! - ! !USES: - ! - ! !ARGUMENTS: - {VTYPE}, allocatable :: col_array(:) ! function result - {VTYPE}, intent(in) :: val ! all elements in col_array are set to val - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'col_array_{TYPE}' - !----------------------------------------------------------------------- - - allocate(col_array(bounds%begc:bounds%endc)) - col_array(:) = val - - end function col_array_{TYPE} - - - !----------------------------------------------------------------------- - pure function patch_array_uninit() result(patch_array) - ! - ! !DESCRIPTION: - ! Creates a patch-level array of r8 values. All elements are set to NaN. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), allocatable :: patch_array(:) ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'patch_array_uninit' - !----------------------------------------------------------------------- - - allocate(patch_array(bounds%begp:bounds%endp)) - patch_array(:) = nan - - end function patch_array_uninit - - - !----------------------------------------------------------------------- - !TYPE logical,int,double - pure function patch_array_{TYPE}(val) result(patch_array) - ! - ! !DESCRIPTION: - ! Creates a patch-level array with the same type as val. All elements are set to val. - ! - ! !USES: - ! - ! !ARGUMENTS: - {VTYPE}, allocatable :: patch_array(:) ! function result - {VTYPE}, intent(in) :: val ! all elements in patch_array are set to val - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'patch_array_{TYPE}' - !----------------------------------------------------------------------- - - allocate(patch_array(bounds%begp:bounds%endp)) - patch_array(:) = val - - end function patch_array_{TYPE} - - !----------------------------------------------------------------------- - function logical_array_to_int(logical_array) result(int_array) - ! - ! !DESCRIPTION: - ! Converts an array of logicals to a same-size array of integers: false => 0, true => 1 - ! - ! This can be useful for doing assertions on arrays, since pFUnit doesn't support - ! assertions of equality of logical arrays. - ! - ! !ARGUMENTS: - logical, intent(in) :: logical_array(:) - integer :: int_array(size(logical_array)) ! function result - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'logical_array_to_int' - !----------------------------------------------------------------------- - - where (logical_array) - int_array = 1 - elsewhere - int_array = 0 - end where - - end function logical_array_to_int - -end module unittestArrayMod diff --git a/src/unit_test_shr/unittestFilterBuilderMod.F90 b/src/unit_test_shr/unittestFilterBuilderMod.F90 deleted file mode 100644 index 3ed61eb9a2..0000000000 --- a/src/unit_test_shr/unittestFilterBuilderMod.F90 +++ /dev/null @@ -1,71 +0,0 @@ -module unittestFilterBuilderMod - - ! This module builds simple filters that can be used as inputs to routines that require - ! a filter. - - implicit none - private - save - - public :: filter_empty ! build a filter that doesn't contain any points - - public :: filter_from_range ! build a filter that includes all points between a start and end index - -contains - - !----------------------------------------------------------------------- - subroutine filter_empty(numf, filter) - ! - ! !DESCRIPTION: - ! Build a filter that doesn't contain any points - ! - ! Allocates the 'filter' argument - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(out) :: numf ! number of points in the filter - integer, allocatable, intent(out) :: filter(:) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'filter_empty' - !----------------------------------------------------------------------- - - numf = 0 - allocate(filter(0)) - - end subroutine filter_empty - - - !----------------------------------------------------------------------- - subroutine filter_from_range(start, end, numf, filter) - ! - ! !DESCRIPTION: - ! Build a filter that includes all points between a start and end index - ! - ! Allocates the 'filter' argument - ! - ! !ARGUMENTS: - integer, intent(in) :: start ! start index to include - integer, intent(in) :: end ! end index to include - integer, intent(out) :: numf ! number of points in the filter - integer, allocatable, intent(out) :: filter(:) - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'filter_from_list' - !----------------------------------------------------------------------- - - numf = end - start + 1 - numf = max(numf, 0) - - allocate(filter(numf)) - do i = 1, numf - filter(i) = start + i - 1 - end do - - end subroutine filter_from_range - -end module unittestFilterBuilderMod diff --git a/src/unit_test_shr/unittestGlcMec.F90 b/src/unit_test_shr/unittestGlcMec.F90 deleted file mode 100644 index 4ed1c497f9..0000000000 --- a/src/unit_test_shr/unittestGlcMec.F90 +++ /dev/null @@ -1,68 +0,0 @@ -module unittestGlcMec - - ! This module contains routines that assist unit tests working with glc_mec - ! (istice_mec) landunits. - - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use landunit_varcon, only : istice_mec - use column_varcon, only : icemec_class_to_col_itype - use glc_elevclass_mod, only : glc_elevclass_init, glc_elevclass_clean - use clm_varpar, only : maxpatch_glcmec - - implicit none - private - save - - ! Sets up modules to have the given elevation classes. This should be called early in - ! the setup of each unit test. - public :: setup_elevation_classes - - ! Do teardown mirroring what was done in setup_elevation_classes. This should be called - ! at the end of any unit test that called setup_elevation_classes. - public :: teardown_elevation_classes - - ! Do all subgrid setup needed for setting up a grid with one grid cell with a single - ! icemec column. - public :: setup_single_icemec_column - -contains - - subroutine setup_elevation_classes(glc_nec, topomax) - ! Sets up modules to have the given elevation classes. - ! - ! This should be called early in the setup of each unit test. - integer, intent(in) :: glc_nec ! number of elevation classes - real(r8), intent(in) :: topomax(:) ! should be size glc_nec+1 - - call glc_elevclass_init(glc_nec, topomax) - maxpatch_glcmec = glc_nec - end subroutine setup_elevation_classes - - subroutine teardown_elevation_classes() - ! Do teardown mirroring what was done in setup_elevation_classes. - - ! This should be called at the end of any unit test that called - ! setup_elevation_classes. - - call glc_elevclass_clean() - maxpatch_glcmec = 0 - end subroutine teardown_elevation_classes - - subroutine setup_single_icemec_column(elev_class) - ! Create a grid cell with a single icemec column. - ! - ! setup_elevation_classes must already have been called. - integer, intent(in) :: elev_class - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype=istice_mec, lweight=1.0_r8, & - ctypes=[icemec_class_to_col_itype(elev_class)], cweights=[1.0_r8]) - call unittest_subgrid_setup_end() - - end subroutine setup_single_icemec_column - - -end module unittestGlcMec diff --git a/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 b/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 deleted file mode 100644 index d9a4aac403..0000000000 --- a/src/unit_test_shr/unittestSimpleSubgridSetupsMod.F90 +++ /dev/null @@ -1,313 +0,0 @@ -module unittestSimpleSubgridSetupsMod - - ! This module provides wrappers to unittestSubgridMod, which give you a variety of - ! simple subgrid setups. -#include "shr_assert.h" - use unittestSubgridMod - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_kind_mod , only : r8 => shr_kind_r8 - use landunit_varcon, only : istsoil - use pftconMod, only : noveg - - implicit none - private - save - - ! ------------------------------------------------------------------------ - ! Routines that do everything needed with the subgrid setup, including the begin & end - ! call. Once you call these routines, you cannot add any more gridcells, landunits, etc. - ! ------------------------------------------------------------------------ - - ! Create a grid that has a single gridcell with a single vegetated patch - public :: setup_single_veg_patch - - ! Create a grid that has a single gridcell with N vegetated patches - public :: setup_n_veg_patches - - ! Create a grid that has a single gridcell with one landunit of a given type with N - ! columns, each with a single patch of a given type (default patch type = noveg) - public :: setup_landunit_ncols - - ! Create a grid that has N grid cells, each with a single vegetated patch - public :: setup_ncells_single_veg_patch - - ! ------------------------------------------------------------------------ - ! Routines that create a single grid cell with certain properties. You can do other - ! subgrid setup (creating other grid cells) before and after this. - ! ------------------------------------------------------------------------ - - ! Create a grid cell that is 100% natural veg, with a single patch - public :: create_gridcell_single_veg_patch - - ! ------------------------------------------------------------------------ - ! Routines that create a single landunit with certain properties. You can do other - ! subgrid setup (creating other landunits, gridcells, etc.) before and after this. - ! These assume that unittest_add_gridcell has already been called. - ! ------------------------------------------------------------------------ - - ! Create a landunit of a given type with N columns, each with M patches (default=1) of - ! a given type (default=noveg) - public :: create_landunit_ncols - - ! Create a vegetated landunit with N patches - public :: create_vegetated_landunit_n_patches - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Routines that do everything needed with the subgrid setup, including the begin & end - ! call. Once you call these routines, you cannot add any more gridcells, landunits, etc. - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine setup_single_veg_patch(pft_type) - ! - ! !DESCRIPTION: - ! Create a grid that has a single gridcell with a single vegetated patch, with veg - ! type given by the pft_type argument - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: pft_type ! the type of the single vegetated patch - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'setup_single_veg_patch' - !----------------------------------------------------------------------- - - call setup_ncells_single_veg_patch(ncells=1, pft_type=pft_type) - - end subroutine setup_single_veg_patch - - !----------------------------------------------------------------------- - subroutine setup_n_veg_patches(pwtcol, pft_types) - ! - ! !DESCRIPTION: - ! Create a grid that has a single gridcell with N vegetated patches on one column. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), intent(in) :: pwtcol(:) - - ! If given, this gives the pft type for each patch. If not given, pft types go 1..N. - integer, optional, intent(in) :: pft_types(:) - - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'setup_n_veg_patches' - !----------------------------------------------------------------------- - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_vegetated_landunit_n_patches(lweight = 1._r8, & - pwtcol = pwtcol, pft_types = pft_types) - call unittest_subgrid_setup_end() - - end subroutine setup_n_veg_patches - - !----------------------------------------------------------------------- - subroutine setup_landunit_ncols(ltype, ctypes, cweights, ptype) - ! - ! !DESCRIPTION: - ! Create a grid that has a single gridcell with one landunit of a given type with N - ! columns, each with a single patch of type ptype (or noveg if ptype is not given) - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: ltype ! landunit type - integer, intent(in) :: ctypes(:) ! array of column types; one column is created for each element in the array - real(r8), intent(in) :: cweights(:) ! array of column weights on the landunit - integer, intent(in), optional :: ptype ! patch type (if not given, defaults to noveg) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'setup_landunit_ncols' - !----------------------------------------------------------------------- - - call unittest_subgrid_setup_start() - call unittest_add_gridcell() - call create_landunit_ncols(ltype = ltype, lweight = 1._r8, & - ctypes = ctypes, cweights = cweights, ptype = ptype) - call unittest_subgrid_setup_end() - - end subroutine setup_landunit_ncols - - - !----------------------------------------------------------------------- - subroutine setup_ncells_single_veg_patch(ncells, pft_type) - ! - ! !DESCRIPTION: - ! Create a grid that has ncells grid cells, each with a single vegetated patch. All - ! vegetated patches have the same type, given by pft_type. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: ncells ! number of grid cells - integer, intent(in) :: pft_type ! pft type - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'setup_ncells_single_veg_patch' - !----------------------------------------------------------------------- - - call unittest_subgrid_setup_start() - do i = 1, ncells - call create_gridcell_single_veg_patch(pft_type = pft_type) - end do - call unittest_subgrid_setup_end() - - end subroutine setup_ncells_single_veg_patch - - - ! ======================================================================== - ! Routines that create a single grid cell with certain properties. You can do other - ! subgrid setup (creating other grid cells) before and after this. - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine create_gridcell_single_veg_patch(pft_type) - ! - ! !DESCRIPTION: - ! Create a grid cell that is 100% natural veg, with a single patch - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: pft_type ! the type of the single vegetated patch - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'create_gridcell_single_veg_patch' - !----------------------------------------------------------------------- - - call unittest_add_gridcell() - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=1.0_r8) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - call unittest_add_patch(my_ci=ci, ptype=pft_type, wtcol=1.0_r8) - - end subroutine create_gridcell_single_veg_patch - - ! ======================================================================== - ! Routines that create a single landunit with certain properties. You can do other - ! subgrid setup (creating other landunits, gridcells, etc.) before and after this. - ! These assume that unittest_add_gridcell has already been called. - ! ======================================================================== - - - !----------------------------------------------------------------------- - subroutine create_landunit_ncols(ltype, lweight, ctypes, cweights, npatches, ptype) - ! - ! !DESCRIPTION: - ! Create a landunit of a given type with N columns, each with M patches (default=1) of - ! type noveg. - ! - ! Assumes that unittest_add_gridcell has already been called. - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: ltype ! landunit type - real(r8), intent(in) :: lweight ! landunit weight on the grid cell - integer, intent(in) :: ctypes(:) ! array of column types; one column is created for each element in the array - real(r8), intent(in) :: cweights(:) ! array of column weights on the landunit - - ! If npatches is provided, it gives the number of patches on each column. Each patch - ! has equal weight, and is of the same type (ptype). If not provided, the default is 1 - ! patch per column. - integer, intent(in), optional :: npatches - - ! If ptype is provided, it gives the pft type of every patch. If not provided, the - ! default is noveg. - integer, intent(in), optional :: ptype - ! - ! !LOCAL VARIABLES: - integer :: ncols - integer :: l_npatches ! local version of npatches - integer :: l_ptype ! local version of ptype - integer :: c, p - - character(len=*), parameter :: subname = 'create_landunit_ncols' - !----------------------------------------------------------------------- - - ncols = size(ctypes) - SHR_ASSERT((size(cweights) == ncols), errMsg(sourcefile, __LINE__)) - SHR_ASSERT(gi >= begg, 'must call unittest_add_gridcell first: ' // errMsg(sourcefile, __LINE__)) - - if (present(npatches)) then - l_npatches = npatches - else - l_npatches = 1 - end if - - if (present(ptype)) then - l_ptype = ptype - else - l_ptype = noveg - end if - - call unittest_add_landunit(my_gi=gi, ltype=ltype, wtgcell=lweight) - do c = 1, ncols - call unittest_add_column(my_li=li, ctype=ctypes(c), wtlunit=cweights(c)) - do p = 1, l_npatches - call unittest_add_patch(my_ci=ci, ptype=l_ptype, wtcol=1.0_r8/l_npatches) - end do - end do - - end subroutine create_landunit_ncols - - !----------------------------------------------------------------------- - subroutine create_vegetated_landunit_n_patches(lweight, pwtcol, pft_types) - ! - ! !DESCRIPTION: - ! Create a vegetated landunit with N patches on one column - ! - ! Assumes that unittest_add_gridcell has already been called - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), intent(in) :: lweight ! landunit weight on the gridcell - real(r8), intent(in) :: pwtcol(:) ! patch weights on the column - - ! If given, this gives the pft type for each patch. If not given, pft types go 1..N. - integer, optional, intent(in) :: pft_types(:) - ! - ! !LOCAL VARIABLES: - integer :: npatches - integer :: p - integer, allocatable :: l_pft_types(:) - - character(len=*), parameter :: subname = 'create_vegetated_landunit_n_patches' - !----------------------------------------------------------------------- - - npatches = size(pwtcol) - allocate(l_pft_types(npatches)) - if (present(pft_types)) then - SHR_ASSERT((size(pft_types) == npatches), errMsg(sourcefile, __LINE__)) - l_pft_types = pft_types - else - do p = 1, npatches - l_pft_types(p) = p - end do - end if - - call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=lweight) - call unittest_add_column(my_li=li, ctype=1, wtlunit=1._r8) - do p = 1, npatches - call unittest_add_patch(my_ci=ci, ptype=l_pft_types(p), wtcol=pwtcol(p)) - end do - - end subroutine create_vegetated_landunit_n_patches - - - -end module unittestSimpleSubgridSetupsMod diff --git a/src/unit_test_shr/unittestSubgridMod.F90 b/src/unit_test_shr/unittestSubgridMod.F90 deleted file mode 100644 index 486957b655..0000000000 --- a/src/unit_test_shr/unittestSubgridMod.F90 +++ /dev/null @@ -1,483 +0,0 @@ -module unittestSubgridMod - - ! Provides routines to aid with the setup of subgrid structure for unit tests that need - ! it. - ! - ! In the setup for a test, the following should be done: - ! - ! (1) call unittest_subgrid_setup_start - ! Note: if explicitly setting nlevsno, that must be done *before* the call to - ! unittest_subgrid_setup_start - ! (2) add grid cells, landunits, columns & pfts as desired, using the routines defined in - ! this module (i.e., using unittest_add_landunit, etc. - NOT directly via add_landunit, etc.) - ! (3) call unittest_subgrid_setup_end - ! - ! Example: To add a single grid cell, with two landunits (nat. veg. and icemec), with a - ! single column on the nat veg landunit, the following can be done: - ! - ! call unittest_subgrid_setup_start() - ! call unittest_add_gridcell() - ! call unittest_add_landunit(my_gi=gi, ltype=istsoil, wtgcell=0.4_r8) - ! call unittest_add_column(my_li=li, ctype=1, wtlunit=1.0_r8) - ! c_soil = ci - ! call unittest_add_landunit(my_gi=gi, ltype=istice_mec, wtgcell=0.6_r8) - ! call unittest_subgrid_setup_end() - ! - ! A few things to note about this example: - ! (1) Note the use of gi, li and ci to get the index of the most recently-added grid - ! cell / landunit / column - ! (2) Note that not all subgrid information has been filled in: no patches were added - ! to the soil landunit, and no columns or patches were added to the icemec - ! landunit. This is because this extra level of detail wasn't needed for this - ! particular unit test. This omission is perfectly acceptable. - ! - ! In the teardown for a test, the following should be done: - ! - ! (1) call unittest_subgrid_teardown - ! - ! Note: This can safely be done even if subgrid stuff was never set up for some - ! tests (it will only do anything if the subgrid setup was done). - - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, procinfo, get_proc_bounds - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - - implicit none - private - save - - ! ------------------------------------------------------------------------ - ! Public entities - ! ------------------------------------------------------------------------ - - ! Public routines - public :: unittest_subgrid_setup_start ! do the initial setup of subgrid stuff needed for unit testing - public :: unittest_subgrid_setup_end ! do the last part of setup - public :: unittest_subgrid_teardown ! do any teardown needed for the subgrid stuff - public :: unittest_add_gridcell ! add a grid cell - public :: unittest_add_landunit ! add a landunit - public :: unittest_add_column ! add a column - public :: unittest_add_patch ! add a patch - public :: get_ltype_special ! get a landunit type corresponding to a special landunit - - ! bounds info, which can be passed to routines that need it - ! Note that the end indices here (endg, endl, endc, endp) will be the final indices in - ! use, in contrast to the module-level endg, endl, etc., which give the final indices - ! of the allocated arrays. - type(bounds_type), public, protected :: bounds - - ! Indices of last grid cell / landunit / column / patch added - integer, public, protected :: gi - integer, public, protected :: li - integer, public, protected :: ci - integer, public, protected :: pi - - ! Maximum array sizes at each level - integer, parameter, public :: numg = 6 - integer, parameter, public :: numl = 30 - integer, parameter, public :: numc = 50 - integer, parameter, public :: nump = 100 - - ! Indices of initial grid cell / landunit / column / patch - ! - ! Note that we do NOT start at 1, in order to catch any code that assumes indices start - ! at 1. - integer, parameter, public :: begg = 11 - integer, parameter, public :: begl = 21 - integer, parameter, public :: begc = 31 - integer, parameter, public :: begp = 41 - - ! Indices of final grid cell / landunit / column / patch - ! Note that these are the final indices of the allocated arrays, which may be greater - ! than the final index that is actually used for a given test. - integer, parameter, public :: endg = begg + numg - 1 - integer, parameter, public :: endl = begl + numl - 1 - integer, parameter, public :: endc = begc + numc - 1 - integer, parameter, public :: endp = begp + nump - 1 - - ! ------------------------------------------------------------------------ - ! Private entities - ! ------------------------------------------------------------------------ - - integer, private :: nlevsno_orig ! original value of nlevsno, saved so we can restore it later - logical, private :: nlevsno_set ! whether we set nlevsno here - logical, private :: unittest_subgrid_needs_teardown = .false. ! whether subgrid stuff has been initialized - -contains - - !----------------------------------------------------------------------- - subroutine unittest_subgrid_setup_start - ! - ! !DESCRIPTION: - ! Do the initial setup of subgrid stuff needed for unit testing. This should be - ! called for each test. - ! - ! !USES: - use clm_varpar, only : natpft_lb - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_subgrid_setup_start' - !----------------------------------------------------------------------- - - call initialize_arrays - - ! Initialize local module variables - - gi = begg - 1 - li = begl - 1 - ci = begc - 1 - pi = begp - 1 - - ! Initialize other variables needed for the subgrid setup - - natpft_lb = 0 - - unittest_subgrid_needs_teardown = .true. - - end subroutine unittest_subgrid_setup_start - - !----------------------------------------------------------------------- - subroutine unittest_subgrid_setup_end - ! - ! !DESCRIPTION: - ! Do the last part of setup. This should be called after adding all of the landunits, - ! columns, pfts, etc. for the test. - ! - ! !USES: - use initSubgridMod, only : clm_ptrs_compdown - use subgridWeightsMod, only : compute_higher_order_weights - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_subgrid_setup_end' - !----------------------------------------------------------------------- - - call set_decomp_info - call create_bounds_object - call clm_ptrs_compdown(bounds) - call compute_higher_order_weights(bounds) - - end subroutine unittest_subgrid_setup_end - - !----------------------------------------------------------------------- - subroutine set_decomp_info - ! - ! !DESCRIPTION: - ! Set up decomp info in decompMod. - ! - ! We need to do this (in addition to just making sure that the bounds derived type - ! object is set up correctly) for the sake of callers of get_proc_bounds. - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_decomp_info' - !----------------------------------------------------------------------- - - ! For now, not setting up clump info, because it isn't needed in any unit tests. We - ! may have to fix this in the future. - procinfo%nclumps = 1 - allocate(procinfo%cid(procinfo%nclumps)) - procinfo%cid(:) = -1 - - procinfo%begg = begg - procinfo%endg = gi - procinfo%begl = begl - procinfo%endl = li - procinfo%begc = begc - procinfo%endc = ci - procinfo%begp = begp - procinfo%endp = pi - - procinfo%ncells = procinfo%endg - procinfo%begg + 1 - procinfo%nlunits = procinfo%endl - procinfo%begl + 1 - procinfo%ncols = procinfo%endc - procinfo%begc + 1 - procinfo%npatches = procinfo%endp - procinfo%begp + 1 - - ! Currently leaving cohort info unset because it isn't needed in any unit tests. We - ! may have to fix this in the future. - - end subroutine set_decomp_info - - !----------------------------------------------------------------------- - subroutine create_bounds_object - ! - ! !DESCRIPTION: - ! Create the bounds derived type object - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_bounds' - !----------------------------------------------------------------------- - - ! Some routines want a proc-level bounds. So for now, just making bounds be - ! proc-level. In the future, we may need both a proc-level and clumps-level bounds - ! object (if other routines want a clump-level bounds). (For the sake of unit - ! testing, proc-level and clump-level bounds objects can probably be the same except - ! for bounds%level and bounds%clump_index.) - call get_proc_bounds(bounds) - - end subroutine create_bounds_object - - - - !----------------------------------------------------------------------- - subroutine initialize_arrays - ! - ! !DESCRIPTION: - ! Allocate subgrid arrays, and initialize them to default values. - ! - ! !USES: - use landunit_varcon , only : max_lunit - use clm_varcon , only : ispval - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'initialize_arrays' - !----------------------------------------------------------------------- - - ! column initialization depends on the nlevsno runtime parameter, so we first need to - ! set that - call init_nlevsno() - - call grc%Init(begg, endg) - call lun%Init(begl, endl) - call col%Init(begc, endc) - call patch%init(begp, endp) - - end subroutine initialize_arrays - - !----------------------------------------------------------------------- - subroutine unittest_subgrid_teardown - ! - ! !DESCRIPTION: - ! Do any teardown needed for the subgrid stuff - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_subgrid_teardown' - !----------------------------------------------------------------------- - - if (unittest_subgrid_needs_teardown) then - call grc%clean - call lun%clean - call col%clean - call patch%clean - - call reset_nlevsno() - - unittest_subgrid_needs_teardown = .false. - end if - - end subroutine unittest_subgrid_teardown - - !----------------------------------------------------------------------- - subroutine unittest_add_gridcell() - ! - ! !DESCRIPTION: - ! Add a grid cell. The index of the just-added grid cell can be obtained from the - ! module-level variable, gi. - ! - ! Unlike add_landunit, add_column and add_patch, this is specific to the unit test - ! code, because no such routine is needed in the production code - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_add_gridcell' - !----------------------------------------------------------------------- - - gi = gi + 1 - - end subroutine unittest_add_gridcell - - !----------------------------------------------------------------------- - subroutine unittest_add_landunit(my_gi, ltype, wtgcell) - ! - ! !DESCRIPTION: - ! Add a landunit, and make it active. The index of the just-added landunit can be - ! obtained from the module-level variable, li. - ! - ! This is simply a wrapper to the routine in initSubgridMod. We provide this for two - ! reasons: - ! - ! (1) To allow the module-level li variable to be protected - ! - ! (2) To insulate most of the unit test code from any changes in the interface to - ! add_landunit - ! - ! !USES: - use initSubgridMod, only : add_landunit - ! - ! !ARGUMENTS: - integer , intent(in) :: my_gi ! grid cell index on which this landunit should be placed - integer , intent(in) :: ltype ! landunit type - real(r8) , intent(in) :: wtgcell ! weight of the landunit relative to the grid cell - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_add_landunit' - !----------------------------------------------------------------------- - - call add_landunit(li=li, gi=my_gi, ltype=ltype, wtgcell=wtgcell) - lun%active(li) = .true. - - end subroutine unittest_add_landunit - - !----------------------------------------------------------------------- - subroutine unittest_add_column(my_li, ctype, wtlunit) - ! - ! !DESCRIPTION: - ! Add a column, and make it active. The index of the just-added column can be obtained - ! from the module-level variable, ci. - ! - ! This is simply a wrapper to the routine in initSubgridMod. We provide this for two - ! reasons: - ! - ! (1) To allow the module-level ci variable to be protected - ! - ! (2) To insulate most of the unit test code from any changes in the interface to - ! add_column - ! - ! !USES: - use initSubgridMod, only : add_column - ! - ! !ARGUMENTS: - integer , intent(in) :: my_li ! landunit index on which this column should be placed - integer , intent(in) :: ctype ! column type - real(r8) , intent(in) :: wtlunit ! weight of the column relative to the land unit - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_add_column' - !----------------------------------------------------------------------- - - call add_column(ci=ci, li=my_li, ctype=ctype, wtlunit=wtlunit) - col%active(ci) = .true. - - end subroutine unittest_add_column - - !----------------------------------------------------------------------- - subroutine unittest_add_patch(my_ci, ptype, wtcol) - ! - ! !DESCRIPTION: - ! Add a patch, and make it active. The index of the just-added patch can be obtained - ! from the module-level variable, pi. - ! - ! This is simply a wrapper to the routine in initSubgridMod. We provide this for two - ! reasons: - ! - ! (1) To allow the module-level pi variable to be protected - ! - ! (2) To insulate most of the unit test code from any changes in the interface to - ! add_patch - ! - ! !USES: - use initSubgridMod, only : add_patch - ! - ! !ARGUMENTS: - integer , intent(in) :: my_ci ! column index on which this patch should be placed - integer , intent(in) :: ptype ! patch type - real(r8) , intent(in) :: wtcol ! weight of the patch relative to the column - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_add_patch' - !----------------------------------------------------------------------- - - call add_patch(pi=pi, ci=my_ci, ptype=ptype, wtcol=wtcol) - patch%active(pi) = .true. - - end subroutine unittest_add_patch - - !----------------------------------------------------------------------- - function get_ltype_special() result(ltype) - ! - ! !DESCRIPTION: - ! Returns a landunit type corresponding to a special landunit - ! - ! !USES: - use landunit_varcon, only : max_lunit, landunit_is_special - ! - ! !ARGUMENTS: - integer :: ltype ! function result - ! - ! !LOCAL VARIABLES: - integer :: ltype_test - logical :: found - - character(len=*), parameter :: subname = 'get_ltype_special' - !----------------------------------------------------------------------- - - found = .false. - ltype_test = 1 - do while (ltype_test <= max_lunit .and. .not. found) - if (landunit_is_special(ltype_test)) then - ltype = ltype_test - found = .true. - else - ltype_test = ltype_test + 1 - end if - end do - - if (.not. found) then - print *, subname//' ERROR: cannot find a special landunit' - stop - end if - - end function get_ltype_special - - - subroutine init_nlevsno() - ! Initialize nlevsno to a reasonable value, if it is not already set - - use clm_varpar, only : nlevsno - - if (nlevsno <= 0) then - nlevsno_orig = nlevsno - nlevsno = 5 - nlevsno_set = .true. - else - nlevsno_set = .false. - end if - end subroutine init_nlevsno - - subroutine reset_nlevsno - ! If we set nlevsno in init_nlevsno, then reset it to its original value - - use clm_varpar, only : nlevsno - - if (nlevsno_set) then - nlevsno = nlevsno_orig - end if - end subroutine reset_nlevsno - -end module unittestSubgridMod diff --git a/src/unit_test_shr/unittestTimeManagerMod.F90 b/src/unit_test_shr/unittestTimeManagerMod.F90 deleted file mode 100644 index 72ff57b9b9..0000000000 --- a/src/unit_test_shr/unittestTimeManagerMod.F90 +++ /dev/null @@ -1,222 +0,0 @@ -module unittestTimeManagerMod - - ! This module provides wrappers to the clm_time_manager, which facilitate configuring - ! the time manager as desired for each unit test. - ! - ! In the setup for a test, the following should be done: - ! - ! (1) call unittest_timemgr_setup - ! - ! (2) optionally (if the unit test needs a specific date/time): call - ! unittest_timemgr_set_curr_date - ! - ! (3) optionally (if the unit test needs a specific time step number): call - ! unittest_timemgr_set_nstep - ! - ! In the teardown for any test that called unittest_timemgr_init, the following should - ! be done: - ! - ! (1) call unittest_timemgr_teardown - ! - ! - ! Note that there are still some test-specific routines in clm_time_manager. Those - ! include (a) routines that have info that is closely tied to info already in - ! clm_time_manager (e.g., timemgr_reset, which needs to reset all module data - ! defined in clm_time_manager), and/or (b) routines that modify data that are private to - ! clm_time_manager. The routines in this unittest-specific file, in contrast, tend to be - ! higher-level wrappers. - - implicit none - private - save - - ! Public routines - public :: unittest_timemgr_setup ! do the initial setup of the time manager - public :: unittest_timemgr_set_curr_date ! set the current date - public :: unittest_timemgr_teardown ! tear down the time manager at the end of a test - public :: unittest_timemgr_set_curr_year ! set the current year, keeping other date components unchanged - public :: unittest_timemgr_set_nstep ! set the time step number - -contains - - !----------------------------------------------------------------------- - subroutine unittest_timemgr_setup(dtime) - ! - ! !DESCRIPTION: - ! Set up the time manager for each unit test. - ! - ! Should be called once for every test that uses the time manager. - ! - ! !USES: - use ESMF, only : ESMF_Initialize, ESMF_SUCCESS - use clm_time_manager, only : set_timemgr_init, timemgr_init, NO_LEAP_C - ! - ! !ARGUMENTS: - integer, intent(in), optional :: dtime ! time step (seconds) - ! - ! !LOCAL VARIABLES: - integer :: l_dtime ! local version of dtime - integer :: rc ! return code - - integer, parameter :: dtime_default = 1800 ! time step (seconds) - - ! Set ymd values to be year N, month 1, day 1 - integer, parameter :: start_ymd = 10101 - integer, parameter :: ref_ymd = start_ymd - integer, parameter :: stop_ymd = 20101 - integer, parameter :: perpetual_ymd = start_ymd - - ! Set current time to be at the start of year 1 - integer, parameter :: curr_yr = 1 - integer, parameter :: curr_mon = 1 - integer, parameter :: curr_day = 1 - integer, parameter :: curr_tod = 0 - - character(len=*), parameter :: subname = 'unittest_timemgr_setup' - !----------------------------------------------------------------------- - - if (present(dtime)) then - l_dtime = dtime - else - l_dtime = dtime_default - end if - - call ESMF_Initialize(rc=rc) - if (rc /= ESMF_SUCCESS) then - stop 'Error in ESMF_Initialize' - end if - - call set_timemgr_init( & - calendar_in = NO_LEAP_C, & - start_ymd_in = start_ymd, & - start_tod_in = 0, & - ref_ymd_in = ref_ymd, & - ref_tod_in = 0, & - stop_ymd_in = stop_ymd, & - stop_tod_in = 0, & - perpetual_run_in = .false., & - perpetual_ymd_in = perpetual_ymd, & - nelapse_in = 1, & - dtime_in = l_dtime) - - call timemgr_init() - - call unittest_timemgr_set_curr_date( & - yr = curr_yr, & - mon = curr_mon, & - day = curr_day, & - tod = curr_tod) - - end subroutine unittest_timemgr_setup - - !----------------------------------------------------------------------- - subroutine unittest_timemgr_set_curr_date(yr, mon, day, tod) - ! - ! !DESCRIPTION: - ! Set the current model date in the time manager. This is the time at the END of the - ! time step. - ! - ! !USES: - use clm_time_manager, only : for_test_set_curr_date - ! - ! !ARGUMENTS: - integer, intent(in) :: yr ! year - integer, intent(in) :: mon ! month - integer, intent(in) :: day ! day of month - integer, intent(in) :: tod ! time of day (seconds past 0Z) - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'unittest_timemgr_set_curr_date' - !----------------------------------------------------------------------- - - call for_test_set_curr_date(yr, mon, day, tod) - - end subroutine unittest_timemgr_set_curr_date - - !----------------------------------------------------------------------- - subroutine unittest_timemgr_set_curr_year(yr) - ! - ! !DESCRIPTION: - ! Set the current model year, keeping other date components unchanged - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - integer, intent(in) :: yr ! new year - ! - ! !LOCAL VARIABLES: - integer :: curr_yr - integer :: curr_mon - integer :: curr_day - integer :: curr_tod - - character(len=*), parameter :: subname = 'unittest_timemgr_set_curr_year' - !----------------------------------------------------------------------- - - call get_curr_date(curr_yr, curr_mon, curr_day, curr_tod) - call unittest_timemgr_set_curr_date(yr, curr_mon, curr_day, curr_tod) - - end subroutine unittest_timemgr_set_curr_year - - !----------------------------------------------------------------------- - subroutine unittest_timemgr_set_nstep(nstep) - ! - ! !DESCRIPTION: - ! Set the time step number - ! - ! Note that the starting time step number is 0, so calling this with nstep = 1 - ! advances the time step beyond the starting time step. - ! - ! !USES: - use clm_time_manager, only : advance_timestep - ! - ! !ARGUMENTS: - integer, intent(in) :: nstep - ! - ! !LOCAL VARIABLES: - integer :: n - - character(len=*), parameter :: subname = 'unittest_timemgr_set_nstep' - !----------------------------------------------------------------------- - - do n = 1, nstep - call advance_timestep() - end do - - end subroutine unittest_timemgr_set_nstep - - - - !----------------------------------------------------------------------- - subroutine unittest_timemgr_teardown - ! - ! !DESCRIPTION: - ! Tear down the time manager from each unit test. - ! - ! Should be called once at the end of every test that set up the time manager. - ! - ! !USES: - use ESMF, only : ESMF_Finalize, ESMF_SUCCESS - use clm_time_manager, only : timemgr_reset - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: rc ! return code - - character(len=*), parameter :: subname = 'unittest_timemgr_teardown' - !----------------------------------------------------------------------- - - call timemgr_reset() - - call ESMF_Finalize(rc=rc) - if (rc /= ESMF_SUCCESS) then - stop 'Error in ESMF_Finalize' - end if - - end subroutine unittest_timemgr_teardown - - -end module unittestTimeManagerMod diff --git a/src/unit_test_shr/unittestUtils.F90 b/src/unit_test_shr/unittestUtils.F90 deleted file mode 100644 index 9121a2e9eb..0000000000 --- a/src/unit_test_shr/unittestUtils.F90 +++ /dev/null @@ -1,33 +0,0 @@ -module unittestUtils - - ! Miscellaneous utilities to aid unit testing - - implicit none - private - - public :: endrun_msg ! Gives the message thrown by shr_abort_abort, given a call to endrun(msg) - -contains - - !----------------------------------------------------------------------- - function endrun_msg(msg) - ! - ! !DESCRIPTION: - ! Gives the message thrown by shr_abort_abort, given a call to endrun(msg) - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=:), allocatable :: endrun_msg ! function result - character(len=*), intent(in) :: msg - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'endrun_msg' - !----------------------------------------------------------------------- - - endrun_msg = 'ABORTED: '//trim(msg) - - end function endrun_msg - -end module unittestUtils diff --git a/src/unit_test_stubs/CMakeLists.txt b/src/unit_test_stubs/CMakeLists.txt deleted file mode 100644 index 38abfb1633..0000000000 --- a/src/unit_test_stubs/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_subdirectory(csm_share) -add_subdirectory(dyn_subgrid) -add_subdirectory(main) -add_subdirectory(utils) - -sourcelist_to_parent(clm_sources) -sourcelist_to_parent(clm_genf90_sources) -sourcelist_to_parent(share_sources) diff --git a/src/unit_test_stubs/csm_share/CMakeLists.txt b/src/unit_test_stubs/csm_share/CMakeLists.txt deleted file mode 100644 index f1c6f12ded..0000000000 --- a/src/unit_test_stubs/csm_share/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -list(APPEND share_sources - mct_mod_stub.F90 - seq_comm_mct.F90 - shr_mpi_mod_stub.F90 - ) - -sourcelist_to_parent(share_sources) diff --git a/src/unit_test_stubs/csm_share/mct_mod_stub.F90 b/src/unit_test_stubs/csm_share/mct_mod_stub.F90 deleted file mode 100644 index 832b8847d7..0000000000 --- a/src/unit_test_stubs/csm_share/mct_mod_stub.F90 +++ /dev/null @@ -1,30 +0,0 @@ -module mct_mod - - ! This is a stub of mct_mod, which only includes the bare minimum needed to build CLM - ! unit tests - - implicit none - - public :: mct_gsMap - public :: mct_gsMap_orderedPoints - - type mct_gsMap - ! Empty, dummy type - end type mct_gsMap - -contains - - subroutine mct_gsMap_orderedPoints(GSMap, PEno, Points) - ! Stub routine that simply matches the signature of mct_gsMap_orderedPoints - ! this routine allocates the Points array, to match the documented behavior of the - ! real routine. This is needed so that a later deallocate will succeed. But note that - ! it is just allocated to be of size 1, so it cannot be used for any real - ! calculations. - type(mct_gsMap), intent(in) :: GSMap - integer, intent(in) :: PEno - integer,dimension(:),pointer :: Points - - allocate(Points(1)) - end subroutine mct_gsMap_orderedPoints - -end module mct_mod diff --git a/src/unit_test_stubs/csm_share/seq_comm_mct.F90 b/src/unit_test_stubs/csm_share/seq_comm_mct.F90 deleted file mode 100644 index f8201284ba..0000000000 --- a/src/unit_test_stubs/csm_share/seq_comm_mct.F90 +++ /dev/null @@ -1,10 +0,0 @@ -module seq_comm_mct - ! Stub of seq_comm_mct, containing just what's needed for CLM modules. - ! - ! Note that the true seq_comm_mct is in cime/scr/drivers/mct/shr - - implicit none - save - - integer, public :: logunit = 6 -end module seq_comm_mct diff --git a/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 b/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 deleted file mode 100644 index 7a51d56ed9..0000000000 --- a/src/unit_test_stubs/csm_share/shr_mpi_mod_stub.F90 +++ /dev/null @@ -1,469 +0,0 @@ -!=============================================================================== -! SVN $Id: shr_mpi_mod.F90 59033 2014-04-11 01:55:15Z santos@ucar.edu $ -! SVN $URL: https://svn-ccsm-models.cgd.ucar.edu/csm_share/trunk_tags/share3_140723/shr/shr_mpi_mod.F90 $ -!=============================================================================== - -Module shr_mpi_mod - -!------------------------------------------------------------------------------- -! PURPOSE: general layer on MPI functions -!------------------------------------------------------------------------------- - - use shr_kind_mod - use shr_log_mod, only: s_loglev => shr_log_Level - use shr_log_mod, only: s_logunit => shr_log_Unit - - implicit none - private - -! PUBLIC: Public interfaces - - public :: shr_mpi_chkerr - public :: shr_mpi_bcast - public :: shr_mpi_commsize - public :: shr_mpi_commrank - public :: shr_mpi_initialized - public :: shr_mpi_abort - public :: shr_mpi_barrier - public :: shr_mpi_init - public :: shr_mpi_finalize - - interface shr_mpi_bcast ; module procedure & - shr_mpi_bcastc0, & - shr_mpi_bcastc1, & - shr_mpi_bcastl0, & - shr_mpi_bcastl1, & - shr_mpi_bcasti0, & - shr_mpi_bcasti1, & - shr_mpi_bcasti2, & - shr_mpi_bcastr0, & - shr_mpi_bcastr1, & - shr_mpi_bcastr2, & - shr_mpi_bcastr3 - end interface - -!=============================================================================== -CONTAINS -!=============================================================================== - -SUBROUTINE shr_mpi_chkerr(rcode,string) - - IMPLICIT none - - !----- arguments --- - integer(SHR_KIND_IN), intent(in) :: rcode ! input MPI error code - character(*), intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_chkerr) ' - -!------------------------------------------------------------------------------- -! PURPOSE: layer on MPI error checking -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_chkerr - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcasti0(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - integer(SHR_KIND_IN), intent(inout):: vec ! vector of 1 - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcasti0) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast an integer -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcasti0 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastl0(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - logical, intent(inout):: vec ! vector of 1 - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastl0) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a logical -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastl0 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastc0(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - character(len=*), intent(inout) :: vec ! vector of 1 - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastc0) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a character string -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastc0 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastc1(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - character(len=*), intent(inout) :: vec(:) ! 1D vector - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastc1) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a character string -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastc1 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastr0(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - real(SHR_KIND_R8), intent(inout):: vec ! vector of 1 - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastr0) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a real -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastr0 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcasti1(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - integer(SHR_KIND_IN), intent(inout):: vec(:) ! vector - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcasti1) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a vector of integers -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcasti1 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastl1(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - logical, intent(inout):: vec(:) ! vector of 1 - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastl1) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a logical -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastl1 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastr1(vec,comm,string,pebcast) - - IMPLICIT none - - !----- arguments --- - real(SHR_KIND_R8), intent(inout):: vec(:) ! vector - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_bcastr1) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a vector of reals -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastr1 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastr2(arr,comm,string,pebcast) - - IMPLICIT none - - !----- arguments ----- - real(SHR_KIND_R8), intent(inout):: arr(:,:) ! array, 2d - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local ----- - - !----- formats ----- - character(*),parameter :: subName = '(shr_mpi_bcastr2) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a 2d array of reals -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastr2 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcasti2(arr,comm,string,pebcast) - - IMPLICIT none - - !----- arguments ----- - integer, intent(inout):: arr(:,:) ! array, 2d - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local ----- - character(*),parameter :: subName = '(shr_mpi_bcasti2) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a 2d array of integers -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcasti2 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_bcastr3(arr,comm,string,pebcast) - - IMPLICIT none - - !----- arguments ----- - real(SHR_KIND_R8), intent(inout):: arr(:,:,:) ! array, 3d - integer(SHR_KIND_IN), intent(in) :: comm ! mpi communicator - character(*),optional,intent(in) :: string ! message - integer(SHR_KIND_IN), optional, intent(in) :: pebcast ! bcast pe (otherwise zero) - - !----- local ----- - character(*),parameter :: subName = '(shr_mpi_bcastr3) ' - -!------------------------------------------------------------------------------- -! PURPOSE: Broadcast a 3d array of reals -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_bcastr3 - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_commsize(comm,size,string) - - IMPLICIT none - - !----- arguments --- - integer,intent(in) :: comm - integer,intent(out) :: size - character(*),optional,intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_commsize) ' - -!------------------------------------------------------------------------------- -! PURPOSE: MPI commsize -!------------------------------------------------------------------------------- - size = 1 - -END SUBROUTINE shr_mpi_commsize - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_commrank(comm,rank,string) - - IMPLICIT none - - !----- arguments --- - integer,intent(in) :: comm - integer,intent(out) :: rank - character(*),optional,intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_commrank) ' - -!------------------------------------------------------------------------------- -! PURPOSE: MPI commrank -!------------------------------------------------------------------------------- - rank = 0 - -END SUBROUTINE shr_mpi_commrank - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_initialized(flag,string) - - IMPLICIT none - - !----- arguments --- - logical,intent(out) :: flag - character(*),optional,intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_initialized) ' - -!------------------------------------------------------------------------------- -! PURPOSE: MPI initialized -!------------------------------------------------------------------------------- - flag = .true. - -END SUBROUTINE shr_mpi_initialized - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_abort(string,rcode) - - IMPLICIT none - - !----- arguments --- - character(*),optional,intent(in) :: string ! message - integer,optional,intent(in) :: rcode ! optional code - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_abort) ' - integer :: rc ! return code - -!------------------------------------------------------------------------------- -! PURPOSE: MPI abort -!------------------------------------------------------------------------------- - - if ( present(string) .and. present(rcode) ) then - write(s_logunit,*) trim(subName),":",trim(string),rcode - endif - if ( present(rcode) )then - rc = rcode - else - rc = 1001 - end if - stop - -END SUBROUTINE shr_mpi_abort - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_barrier(comm,string) - - IMPLICIT none - - !----- arguments --- - integer,intent(in) :: comm - character(*),optional,intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_barrier) ' - -!------------------------------------------------------------------------------- -! PURPOSE: MPI barrier -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_barrier - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_init(string) - - IMPLICIT none - - !----- arguments --- - character(*),optional,intent(in) :: string ! message - - !----- local --- - character(*),parameter :: subName = '(shr_mpi_init) ' - -!------------------------------------------------------------------------------- -! PURPOSE: MPI init -!------------------------------------------------------------------------------- - -END SUBROUTINE shr_mpi_init - -!=============================================================================== -!=============================================================================== - -SUBROUTINE shr_mpi_finalize(string) - - IMPLICIT none - - !----- arguments --- - character(*),optional,intent(in) :: string ! message - - !----- local --- - -!------------------------------------------------------------------------------- -! PURPOSE: MPI finalize -!------------------------------------------------------------------------------- - if ( present(string) ) & - write(s_logunit,*) trim(string) - call shr_mpi_abort("MPI Finalize") - -END SUBROUTINE shr_mpi_finalize - -!=============================================================================== -!=============================================================================== - -END MODULE shr_mpi_mod diff --git a/src/unit_test_stubs/dyn_subgrid/CMakeLists.txt b/src/unit_test_stubs/dyn_subgrid/CMakeLists.txt deleted file mode 100644 index af20f4bbd0..0000000000 --- a/src/unit_test_stubs/dyn_subgrid/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -list(APPEND clm_sources - dynFileMod_stub.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 b/src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 deleted file mode 100644 index a07c8eec13..0000000000 --- a/src/unit_test_stubs/dyn_subgrid/dynFileMod_stub.F90 +++ /dev/null @@ -1,47 +0,0 @@ -module dynFileMod - - ! This is a stub replacement for dynFileMod. It bypasses all of the netcdf-related - ! stuff, instead allowing direct specification of the possible set of years and the - ! current year. Thus, it is essentially just a wrapper to a dyn_time_info variable. - - use dynTimeInfoMod, only : time_info_type, YEAR_POSITION_END_OF_TIMESTEP - use ncdio_pio, only : file_desc_t - implicit none - save - private - - public :: dyn_file_type - - ! Note that this is intended to be used with the fake form of file_desc_t, defined in - ! ncdio_pio_fake.F90 - type, extends(file_desc_t) :: dyn_file_type - type(time_info_type) :: time_info - end type dyn_file_type - - interface dyn_file_type - module procedure constructor ! initialize a new dyn_file_type object - end interface dyn_file_type - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - type(dyn_file_type) function constructor(my_years) - ! Note that this should be used with the fake form of file_desc_t, defined in - ! ncdio_pio_fake.F90 - ! - ! The time_info object is created assuming we want to use - ! year_position=YEAR_POSITION_END_OF_TIMESTEP - - integer, intent(in) :: my_years(:) ! all years desired for the time_info variable - - ! The following only works if we're using the fake form of file_desc_t, defined in - ! ncdio_pio_fake.F90 - constructor%file_desc_t = file_desc_t() - - constructor%time_info = time_info_type(my_years, YEAR_POSITION_END_OF_TIMESTEP) - end function constructor - -end module dynFileMod diff --git a/src/unit_test_stubs/main/CMakeLists.txt b/src/unit_test_stubs/main/CMakeLists.txt deleted file mode 100644 index b98156b5d0..0000000000 --- a/src/unit_test_stubs/main/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -set(genf90_files - ncdio_pio_fake.F90.in - ncdio_var.F90.in - ) - -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) - -sourcelist_to_parent(clm_genf90_sources) - -list(APPEND clm_sources "${clm_genf90_sources}") - -list(APPEND clm_sources - GetGlobalValuesMod_stub.F90 - histFileMod_stub.F90 - ncdio_dim.F90 - ncdio_pio_fake.F90 - ncdio_var.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 b/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 deleted file mode 100644 index 1e61fc17be..0000000000 --- a/src/unit_test_stubs/main/GetGlobalValuesMod_stub.F90 +++ /dev/null @@ -1,19 +0,0 @@ -module GetGlobalValuesMod - - ! Stub of GetGlobalValuesMod, which satisfies routine signatures with minimal - ! dependencies - - implicit none - - public :: GetGlobalWrite - -contains - - subroutine GetGlobalWrite(decomp_index, clmlevel) - integer, intent(in) :: decomp_index - character(len=*), intent(in) :: clmlevel - - ! do nothing - end subroutine GetGlobalWrite - -end module GetGlobalValuesMod diff --git a/src/unit_test_stubs/main/histFileMod_stub.F90 b/src/unit_test_stubs/main/histFileMod_stub.F90 deleted file mode 100644 index 0b261dc55e..0000000000 --- a/src/unit_test_stubs/main/histFileMod_stub.F90 +++ /dev/null @@ -1,111 +0,0 @@ -module histFileMod - - ! This is a stub for histFileMod. Currently all it does is provide empty - ! implementations for hist_addfld calls, to satisfy the interface that is expected - ! throughout the CLM code. - - use shr_kind_mod, only : r8 => shr_kind_r8 - - implicit none - private - save - - integer , public , parameter :: no_snow_normal = 1 ! normal treatment, which should be used for most fields (use spval when snow layer not present) - integer , public , parameter :: no_snow_zero = 2 ! average in a 0 value for times when the snow layer isn't present - - public :: hist_addfld1d - public :: hist_addfld2d - public :: hist_addfld_decomp - -contains - - subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_patch, ptr_lnd, & - ptr_atm, p2c_scale_type, c2l_scale_type, & - l2g_scale_type, set_lake, set_nolake, set_urb, set_nourb, & - set_noglcmec, set_spec, default) - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from clmtype) - real(r8) , optional, pointer :: ptr_gcell(:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:) ! pointer to pft array - real(r8) , optional, pointer :: ptr_lnd(:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_atm(:) ! pointer to atm array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_nolake ! value to set non-lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_noglcmec ! value to set non-glacier_mec to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - - ! Do nothing - - end subroutine hist_addfld1d - - - subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_patch, ptr_lnd, ptr_atm, & - p2c_scale_type, c2l_scale_type, l2g_scale_type, & - set_lake, set_nolake, set_urb, set_nourb, set_spec, & - no_snow_behavior, default) - - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type2d ! 2d output type - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from clmtype) - real(r8) , optional, pointer :: ptr_atm(:,:) ! pointer to atm array - real(r8) , optional, pointer :: ptr_lnd(:,:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_gcell(:,:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:,:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:,:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:,:) ! pointer to pft array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_nolake ! value to set non-lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - integer , optional, intent(in) :: no_snow_behavior ! if a multi-layer snow field, behavior to use for absent snow layers (should be one of the public no_snow_* parameters defined above) - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - - ! Do nothing - - end subroutine hist_addfld2d - - subroutine hist_addfld_decomp (fname, type2d, units, avgflag, long_name, ptr_col, ptr_patch, default) - - ! - ! !USES: - use clm_varpar , only : nlevdecomp_full - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type2d ! 2d output type - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - real(r8) , optional, pointer :: ptr_col(:,:) ! pointer to column array - real(r8) , optional, pointer :: ptr_patch(:,:) ! pointer to pft array - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape - - ! Do nothing - - end subroutine hist_addfld_decomp - -end module histFileMod diff --git a/src/unit_test_stubs/main/ncdio_dim.F90 b/src/unit_test_stubs/main/ncdio_dim.F90 deleted file mode 100644 index 42c490b868..0000000000 --- a/src/unit_test_stubs/main/ncdio_dim.F90 +++ /dev/null @@ -1,58 +0,0 @@ -module ncdio_dim - ! This module is specific to using the ncdio_pio_fake version of ncdio_pio. This - ! provides a derived type for holding a single dimension from a fake netcdf file, and - ! associated methods for working with this derived type. - - implicit none - private - save - - public :: ncdio_dim_type - - integer, parameter, public :: max_name = 256 ! max length for a dimension name - - ! This type store a single dimension in a fake file - type :: ncdio_dim_type - private - character(len=max_name) :: dimname ! dimension name - integer :: dimlen ! dimension length - - contains - procedure :: get_dimname ! get the dimension name - procedure :: get_dimlen ! get the dimension length - end type ncdio_dim_type - - interface ncdio_dim_type - module procedure constructor - end interface ncdio_dim_type - -contains - - !----------------------------------------------------------------------- - type(ncdio_dim_type) function constructor(dimname, dimlen) - ! Create a new object of type ncdio_dim_type - - character(len=*) , intent(in) :: dimname ! dimension name - integer , intent(in) :: dimlen ! dimension length - - constructor%dimname = dimname - constructor%dimlen = dimlen - end function constructor - - !----------------------------------------------------------------------- - character(len=max_name) function get_dimname(this) - ! Get the name associated with this dimension - class(ncdio_dim_type), intent(in) :: this - - get_dimname = this%dimname - end function get_dimname - - !----------------------------------------------------------------------- - integer function get_dimlen(this) - ! Get the length associated with this dimension - class(ncdio_dim_type), intent(in) :: this - - get_dimlen = this%dimlen - end function get_dimlen - -end module ncdio_dim diff --git a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in b/src/unit_test_stubs/main/ncdio_pio_fake.F90.in deleted file mode 100644 index 0d88830b88..0000000000 --- a/src/unit_test_stubs/main/ncdio_pio_fake.F90.in +++ /dev/null @@ -1,822 +0,0 @@ -module ncdio_pio - - ! This is a fake replacement for ncdio_pio. It does not interact with external files - ! (or pio for that matter) at all! Instead it essentially provides setters and getters - ! for module-level variables, in order to fake i/o. - - ! Currently it just contains 'read' functionality - - use shr_kind_mod, only : r8 => shr_kind_r8, i4=>shr_kind_i4 - use shr_assert_mod , only : shr_assert - use ncdio_var, only : ncdio_var_type - use ncdio_dim, only : ncdio_dim_type - - ! !PUBLIC TYPES: - implicit none - save - private - - public :: file_desc_t - public :: var_desc_t - - ! Fake replacement for file_desc_t. Instead of relating to a netcdf file, this fake - ! object contains the data faking the file. - type :: file_desc_t - private - ! all of the variables in the file (a linked list would be a more efficient - ! implementation, but I'm going for simplicity over efficiency here) - type(ncdio_var_type), allocatable :: vars(:) - - ! all of the dimensions in the file - type(ncdio_dim_type), allocatable :: dims(:) - end type file_desc_t - - ! Stub replacement for var_desc_t, to satisfy interfaces that need it - type :: var_desc_t - end type var_desc_t - - integer, parameter, public :: ncd_double = 1 - integer, parameter, public :: ncd_int = 2 - integer, parameter, public :: ncd_log = 3 - - integer, parameter, public :: ncd_global = 1 - - ! - ! !PUBLIC MEMBER FUNCTIONS: - - public :: ncd_io ! do fake i/o (currently only set up to read) - public :: ncd_inqvid ! inquire on a variable id - public :: ncd_set_var ! set data on "file" for one variable - public :: ncd_set_dim ! set a single dimension on a "file" - public :: ncd_reset_read_times ! reset the "read_times" sensor variable for a given variable - public :: ncd_get_read_times ! get the value of the "read_times" sensor variable for a given variable - public :: ncd_pio_openfile ! stub: open file - public :: ncd_pio_closefile ! stub: close file - public :: ncd_inqdid ! stub: inquire dimension id - public :: ncd_inqvdlen ! stub: inquire size of a dimension - public :: ncd_inqdlen ! stub: inquire size of a dimension - public :: ncd_inqfdims ! stub: inquire file dimensions - public :: ncd_getatt ! stub: get attribute - public :: ncd_putatt ! stub: put attribute - - interface file_desc_t - module procedure constructor ! initialize a new file_desc_t object - end interface file_desc_t - - ! - ! !PRIVATE TYPES: - - integer, parameter :: var_not_found = -1 ! flag indicating variable wasn't found on file - - ! - ! !PRIVATE MEMBER FUNCTIONS: - - private :: ncd_get_variable_index ! return the index of a given variable - - interface ncd_io - module procedure ncd_io_1d_double - module procedure ncd_io_2d_double - module procedure ncd_io_1d_int - module procedure ncd_io_2d_int - module procedure ncd_io_3d_double - module procedure ncd_io_3d_int - module procedure ncd_io_1d_logical - - !DIMS 0,1,2,3 - !TYPE int,double - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - !DIMS 0,1,2 - !TYPE text - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - end interface ncd_io - - interface ncd_getatt - module procedure ncd_getatt_char - module procedure ncd_getatt_int - end interface ncd_getatt - - interface ncd_putatt - module procedure ncd_putatt_int - module procedure ncd_putatt_real - module procedure ncd_putatt_char - end interface ncd_putatt - -contains - - ! ====================================================================== - ! Constructors - ! ====================================================================== - - !----------------------------------------------------------------------- - type(file_desc_t) function constructor() - ! - ! !DESCRIPTION: - ! Create a new file_desc_t object - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'file_desc_t constructor' - !----------------------------------------------------------------------- - - allocate(constructor%vars(0)) - allocate(constructor%dims(0)) - - end function constructor - - - ! ====================================================================== - ! Fakes for the actual ncdio_pio functionality - ! ====================================================================== - - !----------------------------------------------------------------------- - ! DIMS 1,2 - subroutine ncd_io_{DIMS}d_double(varname, data, dim1name, flag, ncid, nt, readvar) - ! - ! !DESCRIPTION: - ! Fake for the non-glob form of ncd_io_{DIMS}d_double. - ! - ! Note that this assumes we are working with a single time slice (I'm not sure - ! whether the true ncd_io routines carry that assumption) - ! - ! !ARGUMENTS: - character(len=*) , intent(in) :: varname ! variable name - real(r8) , pointer :: data{DIMSTR} ! local decomposition data (no time dimension) - character(len=*) , intent(in) :: dim1name ! dimension name (unused for the fake) - character(len=*) , intent(in) :: flag ! 'read' or 'write' (currently only 'read' is supported) - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - integer, optional , intent(in) :: nt ! time sample index - logical, optional , intent(out) :: readvar ! true => variable is on dataset (read only) - ! - ! !LOCAL VARIABLES: - integer :: varindex ! index of variable of interest - - character(len=*), parameter :: subname = 'ncd_io_{DIMS}d_double' - !----------------------------------------------------------------------- - - call shr_assert(flag == 'read', subname//' ERROR: currently only the "read" flag is supported') - - ! nt is optional so code can build, but any code that is actually run in a unit - ! test should be providing nt - call shr_assert(present(nt), subname//' ERROR: currently, the nt optional argument must be present') - - varindex = ncd_get_variable_index(ncid, varname) - - if (varindex /= var_not_found) then - call ncid%vars(varindex)%get_data(nt, data) - if (present(readvar)) then - readvar = .true. - end if - else ! varindex == var_not_found - if (present(readvar)) then - readvar = .false. - end if - end if - - end subroutine ncd_io_{DIMS}d_double - - !----------------------------------------------------------------------- - ! DIMS 1,2 - subroutine ncd_io_{DIMS}d_double_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! Fake for the glob (global) form of ncd_io_{DIMS}d_double. - ! - ! If nt isn't provided, it is assumed to be 1. Note that this fake implementation of - ! ncdio_pio gives all variables a time dimension. For variables that are not really - ! supposed to have a time dimension (as is the case for many global variables), it is - ! appropriate to call this routine with nt absent. - ! - ! !ARGUMENTS: - character(len=*) , intent(in) :: varname ! variable name - real(r8) , intent(inout) :: data{DIMSTR} ! read-in data (no time dimension) - character(len=*) , intent(in) :: flag ! 'read' or 'write' (currently only 'read' is supported) - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - logical, optional , intent(out) :: readvar ! true => variable is on dataset (read only) - integer, optional , intent(in) :: nt ! time sample index (if not present, assumed to be 1) - logical, optional , intent(in) :: posNOTonfile ! position is NOT on this file (ignored) - ! - ! !LOCAL VARIABLES: - integer :: l_nt ! local version of nt - integer :: varindex ! index of variable of interest - - character(len=*), parameter :: subname = 'ncd_io_{DIMS}d_double' - !----------------------------------------------------------------------- - - call shr_assert(flag == 'read', subname//' ERROR: currently only the "read" flag is supported') - - if (present(nt)) then - l_nt = nt - else - l_nt = 1 - end if - - varindex = ncd_get_variable_index(ncid, varname) - - if (varindex /= var_not_found) then - call ncid%vars(varindex)%get_data(l_nt, data) - if (present(readvar)) then - readvar = .true. - end if - else ! varindex == var_not_found - if (present(readvar)) then - readvar = .false. - end if - end if - - end subroutine ncd_io_{DIMS}d_double_glob - - - !----------------------------------------------------------------------- - subroutine ncd_inqvid(ncid, name, varid, vardesc, readvar) - ! Fake to inquire on a variable ID - ! - ! Unlike the true implementation, this one never aborts. It is meant to be called - ! with readvar present (in which case the true implementation doesn't abort, either.) - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! variable name - integer , intent(out) :: varid ! variable id - type(Var_desc_t) , intent(out) :: vardesc ! variable descriptor (not set in this implementation) - logical, optional , intent(out) :: readvar ! does variable exist - !----------------------------------------------------------------------- - - varid = ncd_get_variable_index(ncid, name) - - if (present(readvar)) then - if (varid /= var_not_found) then - readvar = .true. - else - readvar = .false. - end if - end if - end subroutine ncd_inqvid - - !----------------------------------------------------------------------- - subroutine ncd_inqdid(ncid, name, dimid, dimexist) - ! - ! !DESCRIPTION: - ! Fake to inquire on a dimension ID - ! - ! Unlike the true implementation, this one never aborts. It is meant to be called - ! with dimexist present (in which case the true implementation doesn't abort, either.) - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! dimension name - integer , intent(out):: dimid ! dimension id - logical,optional , intent(out):: dimexist ! if this dimension exists or not - - dimid = ncd_get_dimension_index(ncid, name) - - if (present(dimexist)) then - if (dimid /= var_not_found) then - dimexist = .true. - else - dimexist = .false. - end if - end if - - end subroutine ncd_inqdid - - !----------------------------------------------------------------------- - subroutine ncd_inqdlen(ncid, dimid, len, name) - ! - ! !DESCRIPTION: - ! Fake to inquire on a dimension length. - ! - ! Returns -1 if the given dimension isn't found. (This differs from the behavior of - ! the true ncd_inqdlen, which I think aborts if the given dimension isn't found.) - ! - ! As in the real implementation: If 'name' is absent, then 'dimid' is used as an - ! input: the dimension id to inquire. If 'name' is present, then it gives the name of - ! the dimension to inquire, and 'dimid' is set to the ID associated with this - ! dimension. - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - integer , intent(inout) :: dimid ! dimension id - integer , intent(out) :: len ! dimension len - character(len=*), optional, intent(in) :: name ! dimension name - ! - ! !LOCAL VARIABLES: - logical :: dimexist - !----------------------------------------------------------------------- - - len = -1 - - if (present(name)) then - call ncd_inqdid(ncid, name, dimid, dimexist = dimexist) - if (.not. dimexist) then - return - end if - end if - - if (dimid >= 1 .and. dimid <= size(ncid%dims)) then - len = ncid%dims(dimid)%get_dimlen() - end if - - end subroutine ncd_inqdlen - - ! ====================================================================== - ! Stubs for the actual ncdio_pio functionality (do nothing) - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine ncd_pio_openfile(file, fname, mode) - ! - ! !DESCRIPTION: - ! Stub replacement: Open a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: file ! Output PIO file handle - character(len=*) , intent(in) :: fname ! Input filename to open - integer , intent(in) :: mode ! file mode - - end subroutine ncd_pio_openfile - - !----------------------------------------------------------------------- - subroutine ncd_pio_closefile(file) - ! - ! !DESCRIPTION: - ! Stub replacement: Close a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: file ! PIO file handle to close - - end subroutine ncd_pio_closefile - - !TYPE int,logical - subroutine ncd_io_1d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! Stub replacement: netcdf I/O for 1d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:) ! local decomposition data - character(len=*) , intent(in) :: dim1name ! dimension name - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical , optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - - if (present(readvar)) then - readvar = .false. - end if - - end subroutine ncd_io_1d_{TYPE} - - subroutine ncd_io_2d_int(varname, data, dim1name, lowerb2, upperb2, & - flag, ncid, nt, readvar, switchdim, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! Stub replacement: netcdf I/O for 2d int - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , pointer :: data(:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - integer, optional, intent(in) :: lowerb2,upperb2 ! lower and upper bounds of second dimension - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical, optional, intent(in) :: switchdim ! true=> permute dim1 and dim2 for output - logical, optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - - if (present(readvar)) then - readvar = .false. - end if - end subroutine ncd_io_2d_int - - !TYPE int,double - subroutine ncd_io_3d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar) - ! - ! !DESCRIPTION: - ! Stub: Netcdf i/o of 3d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:,:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - - if (present(readvar)) then - readvar = .false. - end if - end subroutine ncd_io_3d_{TYPE} - - !------------------------------------------------------------------------ - !DIMS 0,1,2,3 - subroutine ncd_io_{DIMS}d_int_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! Stub replacement: netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - integer , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - - if (present(readvar)) then - readvar = .false. - end if - - end subroutine ncd_io_{DIMS}d_int_glob - - !------------------------------------------------------------------------ - !DIMS 0,3 - subroutine ncd_io_{DIMS}d_double_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! Stub replacement: netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - real(r8) , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - - if (present(readvar)) then - readvar = .false. - end if - - end subroutine ncd_io_{DIMS}d_double_glob - - !------------------------------------------------------------------------ - !DIMS 0,1,2 - !TYPE text - subroutine ncd_io_{DIMS}d_{TYPE}_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! Stub replacement: netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - {VTYPE} , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - - if (present(readvar)) then - readvar = .false. - end if - end subroutine ncd_io_{DIMS}d_{TYPE}_glob - - !----------------------------------------------------------------------- - subroutine ncd_inqvdlen(ncid,varname,dimnum,dlen,err_code) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_inqvdlen_byName (note that we currently do not support - ! ncd_inqvdlen_byDesc). This does nothing, but just satisfies the interface for - ! ncd_inqvdlen. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) ,intent(in) :: varname ! variable name - integer ,intent(in) :: dimnum ! dimension number to query - integer ,intent(out) :: dlen ! length of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - - dlen = 0 - err_code = 0 - - end subroutine ncd_inqvdlen - - !----------------------------------------------------------------------- - subroutine ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_inqfdims. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout):: ncid - logical , intent(out) :: isgrid2d - integer , intent(out) :: ni - integer , intent(out) :: nj - integer , intent(out) :: ns - - isgrid2d = .true. - ni = 1 - nj = 1 - ns = 1 - end subroutine ncd_inqfdims - - !----------------------------------------------------------------------- - subroutine ncd_getatt_char(ncid,varid,attrib,value) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_getatt_char. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(out) :: value ! netcdf attrib value - !----------------------------------------------------------------------- - - ! Do nothing - end subroutine ncd_getatt_char - - !----------------------------------------------------------------------- - subroutine ncd_getatt_int(ncid,varid,attrib,value) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_getatt_int. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - integer ,intent(out) :: value ! netcdf attrib value - !----------------------------------------------------------------------- - - ! Do nothing - end subroutine ncd_getatt_int - - - !----------------------------------------------------------------------- - subroutine ncd_putatt_int(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_putatt_int. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - integer ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - ! Do nothing - end subroutine ncd_putatt_int - - !----------------------------------------------------------------------- - subroutine ncd_putatt_char(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_putatt_char. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - ! Do nothing - end subroutine ncd_putatt_char - - !----------------------------------------------------------------------- - subroutine ncd_putatt_real(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! Stub replacement for ncd_putatt_real. This does nothing, but just satisfies the - ! interface. - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - real(r8) ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - ! Do nothing - end subroutine ncd_putatt_real - - - ! ====================================================================== - ! Public routines to aid unit testing, specific to this fake replacement - ! ====================================================================== - - !----------------------------------------------------------------------- - subroutine ncd_set_var(ncid, varname, data, data_shape) - ! - ! !DESCRIPTION: - ! Set values for a single variable on this netcdf 'file'. - ! - ! Regardless of the true dimensionality of the undelying data, this should be called - ! with a 2-d data variable. The 2nd dim is time, 1st is everything else compressed - ! into a single dimension. 'data_shape' then gives the true shape of the underlying - ! data, WITHOUT the underlying time dimension - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf 'file' into which we should add this variable - character(len=*) , intent(in) :: varname ! variable name - real(r8) , intent(in) :: data(:,:) ! the data (see notes above) - integer , intent(in) :: data_shape(:) ! true shape of the underlying data, WITHOUT the time dimension - ! - ! !LOCAL VARIABLES: - type(ncdio_var_type) :: newvar ! the new variable - type(ncdio_var_type), allocatable :: new_var_list(:) - - character(len=*), parameter :: subname = 'ncd_set_var' - !----------------------------------------------------------------------- - - ! If a variable with this name is already on the file, stop with an error message - call shr_assert(ncd_get_variable_index(ncid, varname) == var_not_found, & - subname//' ERROR: cannot set a variable already on file - '//trim(varname)) - - newvar = ncdio_var_type(varname, data, data_shape) - - ! Add newvar to the list. - ! - ! In theory, I think I should be able to do this, but it isn't working, at least with - ! the intel compiler v. 13 on yellowstone: - ! ncid%vars = [ncid%vars, newvar] - ! - ! Update: the above also doesn't work with intel v. 15 on hobart or intel v. 17 on - ! cheyenne. - ! - ! So I'm using an inefficient method, but that's okay for these purposes - allocate(new_var_list(size(ncid%vars) + 1)) - new_var_list(1:size(ncid%vars)) = ncid%vars(:) - new_var_list(size(ncid%vars)+1) = newvar - call move_alloc(new_var_list, ncid%vars) - - end subroutine ncd_set_var - - !----------------------------------------------------------------------- - subroutine ncd_set_dim(ncid, dimname, dimlen) - ! - ! !DESCRIPTION: - ! Set a single dimension on this netcdf 'file'. - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf 'file' into which we should add this dimension - character(len=*) , intent(in) :: dimname ! dimension name - integer , intent(in) :: dimlen ! dimension length - ! - ! !LOCAL VARIABLES: - type(ncdio_dim_type) :: newdim ! the new dimension - type(ncdio_dim_type), allocatable :: new_dim_list(:) - - character(len=*), parameter :: subname = 'ncd_set_dim' - !----------------------------------------------------------------------- - - ! If a dimension with this name is already on the file, stop with an error message - call shr_assert(ncd_get_dimension_index(ncid, dimname) == var_not_found, & - subname//' ERROR: cannot set a dimension already on file - '//trim(dimname)) - - newdim = ncdio_dim_type(dimname, dimlen) - - ! Add newdim to the list. - ! - ! See comment in ncd_set_var for why we use this more complex method. - allocate(new_dim_list(size(ncid%dims) + 1)) - new_dim_list(1:size(ncid%dims)) = ncid%dims(:) - new_dim_list(size(ncid%dims)+1) = newdim - call move_alloc(new_dim_list, ncid%dims) - - end subroutine ncd_set_dim - - - !----------------------------------------------------------------------- - subroutine ncd_reset_read_times(ncid, varname) - ! - ! !DESCRIPTION: - ! Reset the 'read_times' flag for a given variable. This provides a starting point - ! for a future call to ncd_get_read_times - i.e., if ncd_get_read_times were called - ! immediately after ncd_reset_read_times, it would always be false. - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf 'file' to operate on - character(len=*) , intent(in) :: varname ! variable name - ! - ! !LOCAL VARIABLES: - integer :: varindex ! index of variable of interest - - character(len=*), parameter :: subname = 'ncd_reset_read_times' - !----------------------------------------------------------------------- - - varindex = ncd_get_variable_index(ncid, varname) - - call shr_assert(varindex /= var_not_found, subname//' ERROR: could not find variable '//trim(varname)) - - call ncid%vars(varindex)%reset_read_times() - - end subroutine ncd_reset_read_times - - - !----------------------------------------------------------------------- - function ncd_get_read_times(ncid, varname) - ! - ! !DESCRIPTION: - ! Return the value of 'read_times' for all times. This tells you whether this variable - ! has been 'read' for each time index since the last call to reset_read_times (or - ! since initialization, if reset_read_times hasn't been called). - ! - ! !ARGUMENTS: - logical, allocatable :: ncd_get_read_times(:) ! function result - class(file_desc_t) , intent(in) :: ncid ! netcdf 'file' to operate on - character(len=*) , intent(in) :: varname ! variable name - ! - ! !LOCAL VARIABLES: - integer :: varindex ! index of variable of interest - - character(len=*), parameter :: subname = 'ncd_get_read_times' - !----------------------------------------------------------------------- - - varindex = ncd_get_variable_index(ncid, varname) - - call shr_assert(varindex /= var_not_found, subname//' ERROR: could not find variable '//trim(varname)) - - ncd_get_read_times = ncid%vars(varindex)%get_read_times() - - end function ncd_get_read_times - - - ! ====================================================================== - ! Private routines - ! ====================================================================== - - !----------------------------------------------------------------------- - integer function ncd_get_variable_index(ncid, varname) - ! Return the index of the variable whose name is 'varname' in the ncid structure. If - ! varname is not present, return var_not_found - class(file_desc_t), intent(in) :: ncid - character(len=*), intent(in) :: varname ! variable name to find - - integer :: index - logical :: found - - found = .false. - index = 0 - do while((index < size(ncid%vars)) .and. (.not. found)) - index = index + 1 - if (ncid%vars(index)%get_varname() == varname) then - found = .true. - end if - end do - - if (found) then - ncd_get_variable_index = index - else - ncd_get_variable_index = var_not_found - end if - end function ncd_get_variable_index - - !----------------------------------------------------------------------- - integer function ncd_get_dimension_index(ncid, dimname) - ! Return the index of the dimension whose name is 'dimname' in the ncid structure. If - ! dimname is not present, return var_not_found - class(file_desc_t), intent(in) :: ncid - character(len=*), intent(in) :: dimname ! dimension name to find - - integer :: index - logical :: found - - found = .false. - index = 0 - do while((index < size(ncid%dims)) .and. (.not. found)) - index = index + 1 - if (ncid%dims(index)%get_dimname() == dimname) then - found = .true. - end if - end do - - if (found) then - ncd_get_dimension_index = index - else - ncd_get_dimension_index = var_not_found - end if - end function ncd_get_dimension_index - -end module ncdio_pio diff --git a/src/unit_test_stubs/main/ncdio_var.F90.in b/src/unit_test_stubs/main/ncdio_var.F90.in deleted file mode 100644 index 31a509d724..0000000000 --- a/src/unit_test_stubs/main/ncdio_var.F90.in +++ /dev/null @@ -1,141 +0,0 @@ -module ncdio_var - ! This module is specific to using the ncdio_pio_fake version of ncdio_pio. This - ! provides a derived type for holding a single variable from a fake netcdf file, and - ! associated methods for working with this derived type. - - use shr_kind_mod, only : r8 => shr_kind_r8 - - ! Note that we use shr_assert directly rather than using the macros. This is so we don't - ! have to worry about whether or not NDEBUG is defined (we ALWAYS want to do these - ! assertions here). - use shr_assert_mod , only : shr_assert, shr_assert_all - - implicit none - private - save - - public :: ncdio_var_type - - integer, parameter, public :: max_name = 256 ! max length for a variable name - - ! This type stores a single variable in a fake file - type :: ncdio_var_type - private - - character(len=max_name) :: varname ! variable name - - integer :: ntimes ! number of time samples for this variable (length of second dimension) - - ! Second dimension is time, first is everything else. Regardless of the true - ! dimensionality of the underlying data, we compress all dimensions except time into - ! a single dimension, and then reshape it as needed. - real(r8), allocatable :: data(:,:) - - ! True shape of a single time slice of the data. This will have a single element if - ! the data are just spatial, two elements if the data have a space dimension plus a - ! single level dimension, etc. - integer, allocatable :: data_shape(:) - - ! This is a sensing variable, telling you which time indices have been "read" since - ! the last call to reset_read_times - logical, allocatable :: read_times(:) - - contains - generic, public :: get_data => & ! get the value of data for a single time - get_data_1d, get_data_2d - procedure :: get_varname ! get the variable name - procedure :: reset_read_times ! reset the "read_times" sensor variable - procedure :: get_read_times ! return the value of "read_times" for all times - - procedure, private :: get_data_1d - procedure, private :: get_data_2d - end type ncdio_var_type - - interface ncdio_var_type - module procedure constructor - end interface ncdio_var_type - -contains - - !----------------------------------------------------------------------- - type(ncdio_var_type) function constructor(varname, data, data_shape) - ! Create a new object of type ncdio_var_type - - character(len=*), intent(in) :: varname ! variable name - real(r8), intent(in) :: data(:,:) ! the data; 2nd dim is time, 1st is everything else compressed into a single dimension - integer, intent(in) :: data_shape(:) ! true shape of the underlying data, WITHOUT the time dimension - - character(len=*), parameter :: subname = 'ncdio_var_type constructor' - - call shr_assert(product(data_shape) == size(data, 1), subname//' product of data_shape must match length of 1st dim of data') - - constructor%varname = varname - - allocate(constructor%data(size(data,1), size(data,2))) - constructor%data = data - - allocate(constructor%data_shape(size(data_shape))) - constructor%data_shape = data_shape - - constructor%ntimes = size(data, 2) - - allocate(constructor%read_times(constructor%ntimes)) - call constructor%reset_read_times() - end function constructor - - !----------------------------------------------------------------------- - character(len=max_name) function get_varname(this) - ! Get the name associated with this variable - class(ncdio_var_type), intent(in) :: this - - get_varname = this%varname - end function get_varname - - - !----------------------------------------------------------------------- - subroutine reset_read_times(this) - ! Reset the 'read_times' variable. Any call to get_read_time will tell you whether a - ! given time slice has been read since the last call to reset_read_times - class(ncdio_var_type), intent(inout) :: this - - this%read_times(:) = .false. - end subroutine reset_read_times - - !----------------------------------------------------------------------- - function get_read_times(this) - ! Return the value of 'read_times' for all times. This tells you whether this variable - ! has been 'read' for each time index since the last call to reset_read_times (or - ! since initialization, if reset_read_times hasn't been called). - logical, allocatable :: get_read_times(:) - class(ncdio_var_type), intent(in) :: this - - character(len=*), parameter :: subname = 'get_read_times' - - get_read_times = this%read_times - end function get_read_times - - ! DIMS 1,2 - !----------------------------------------------------------------------- - subroutine get_data_{DIMS}d(this, nt, data) - ! Return the value of data at the given time. The output variable ('data') should - ! have the shape of true, underlying data (i.e., multi-dimensional if applicable) but - ! it should NOT have a time dimension because this subroutine returns the data for a - ! single time index - class(ncdio_var_type), intent(inout) :: this - integer, intent(in) :: nt ! time index of interest - real(r8), intent(out) :: data{DIMSTR} - - character(len=*), parameter :: subname = 'get_data_{DIMS}d' - - call shr_assert_all((shape(data) == this%data_shape), subname//' incorrect shape for data') - call shr_assert(1 <= nt .and. nt <= this%ntimes, subname//' nt out of bounds') - - data = reshape(this%data(:,nt), this%data_shape(1:{DIMS})) - - this%read_times(nt) = .true. - - end subroutine get_data_{DIMS}d - -end module ncdio_var - - diff --git a/src/unit_test_stubs/utils/CMakeLists.txt b/src/unit_test_stubs/utils/CMakeLists.txt deleted file mode 100644 index dc48aa9225..0000000000 --- a/src/unit_test_stubs/utils/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -set(genf90_files - restUtilMod_stub.F90.in - ) - -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) - -sourcelist_to_parent(clm_genf90_sources) - -list(APPEND clm_sources "${clm_genf90_sources}") - -list(APPEND clm_sources - restUtilMod_stub.F90 - spmdMod_stub.F90 - clmfates_paraminterfaceMod_stub.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/unit_test_stubs/utils/clmfates_paraminterfaceMod_stub.F90 b/src/unit_test_stubs/utils/clmfates_paraminterfaceMod_stub.F90 deleted file mode 100644 index 4dd580a986..0000000000 --- a/src/unit_test_stubs/utils/clmfates_paraminterfaceMod_stub.F90 +++ /dev/null @@ -1,11 +0,0 @@ -module CLMFatesParamInterfaceMod - - implicit none - - public :: FatesReadPfts - -contains - subroutine FatesReadPFTs() - implicit none - end subroutine FatesReadPFTs -end module CLMFatesParamInterfaceMod diff --git a/src/unit_test_stubs/utils/restUtilMod_stub.F90.in b/src/unit_test_stubs/utils/restUtilMod_stub.F90.in deleted file mode 100644 index ef3ec7e739..0000000000 --- a/src/unit_test_stubs/utils/restUtilMod_stub.F90.in +++ /dev/null @@ -1,150 +0,0 @@ -module restUtilMod - - ! This is a stub for restUtilMod. Currently all it does is provide empty - ! implementations for restartvar, to satisfy the interface that is expected throughout - ! the CLM code - - use shr_kind_mod, only: r8=>shr_kind_r8, r4 => shr_kind_r4, i4=>shr_kind_i4 - use ncdio_pio, only : file_desc_t - - implicit none - private - save - - interface restartvar - !DIMS 0,1,2 - !TYPE text,int,double - module procedure restartvar_{DIMS}d_{TYPE} - module procedure restartvar_2d_double_bounds - end interface restartvar - - public :: restartvar - - public :: set_missing_from_template - -contains - - !----------------------------------------------------------------------- - !DIMS 0 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - {VTYPE} , intent(inout) :: data{DIMSTR} - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - - readvar = .false. - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - !DIMS 1,2 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - {VTYPE} , pointer :: data{DIMSTR} - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - - subroutine restartvar_2d_double_bounds(ncid, flag, varname, xtype, & - dim1name, dim2name, switchdim, lowerb2, upperb2, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: dim1name ! dimension name - character(len=*) , intent(in) :: dim2name ! dimension name - logical , intent(in) :: switchdim - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , pointer :: data(:,:) ! raw data - logical , intent(out) :: readvar ! was var read? - integer , intent(in), optional :: lowerb2 - integer , intent(in), optional :: upperb2 - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - - readvar = .false. - - end subroutine restartvar_2d_double_bounds - - !----------------------------------------------------------------------- - subroutine set_missing_from_template(my_var, template_var, multiplier) - ! - ! !DESCRIPTION: - ! Set values of a missing restart field from a template field, with some constant - ! multiplier - ! - ! !USES: - use shr_infnan_mod, only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - real(r8), intent(out) :: my_var(:) - real(r8), intent(in) :: template_var(:) - real(r8), intent(in) :: multiplier - - my_var(:) = template_var(:) * multiplier - - end subroutine set_missing_from_template - -end module restUtilMod diff --git a/src/unit_test_stubs/utils/spmdMod_stub.F90 b/src/unit_test_stubs/utils/spmdMod_stub.F90 deleted file mode 100644 index c68862913d..0000000000 --- a/src/unit_test_stubs/utils/spmdMod_stub.F90 +++ /dev/null @@ -1,15 +0,0 @@ -module spmdMod - ! Stub of spmdMod - - implicit none - save - private - - logical, parameter, public :: masterproc = .true. - integer, parameter, public :: iam = 0 - integer, parameter, public :: mpicom = 0 - integer, parameter, public :: mpi_integer = 0 - integer, parameter, public :: mpi_logical = 0 - integer, parameter, public :: MPI_REAL8 = 1275070505 - -end module spmdMod diff --git a/src/utils/AnnualFluxDribbler.F90 b/src/utils/AnnualFluxDribbler.F90 deleted file mode 100644 index 600d9e5eb5..0000000000 --- a/src/utils/AnnualFluxDribbler.F90 +++ /dev/null @@ -1,615 +0,0 @@ -module AnnualFluxDribbler - -#include "shr_assert.h" - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! - ! Defines a class for handling fluxes that are generated once per year (e.g., due to - ! transient landcover changes that happen at the year boundary), but are meant to be - ! dribbled in evenly throughout the year. - ! - ! This assumes that the once-per-year fluxes are generated on the first timestep of the - ! year. Any flux given on the first timestep of the year is dribbled evenly for every - ! timestep of the coming year. Any flux given on other timesteps is applied entirely in - ! the current timestep. (Note that, if there is a combination of an annual flux and an - ! every-time-step flux, with both combined in the same delta term, then, on the first - ! timestep of the year, the every-time-step flux generated on that timestep will be - ! dribbled over the year rather than applied in that timestep.) - ! - ! NOTE(wjs, 2016-08-30) If we change the glc coupling time to be more frequent, then - ! we'll need to make this more dynamic: e.g., for coupling every 73 days (5 times per - ! year), we'd need to dribble fluxes over the next 73 days. - ! - ! Typical usage: - ! - ! - call mydribbler%set_curr_delta every time step - ! - ! This must be called every timestep, even if the delta is currently zero, in order - ! to zero out any existing stored delta. This can (and generally should) even be - ! called when it isn't the first timestep of the year. For deltas that are non-zero - ! at times other than the first timestep of the year, they will simply be passed on - ! to the output flux in get_curr_flux, making for easier handling by the client. - ! - ! - call mydribbler%get_curr_flux every time step, AFTER set_curr_delta - ! - ! This will get the current flux for this timestep, which is the sum of (1) the - ! dribbled flux from the last start-of-year timestep, and (2) the current timestep's - ! flux, based on the delta passed in to set_curr_delta in this timestep, if this is - ! not the start-of-year timestep. - ! - ! Alternatively, you can call mydribbler%get_dribbled_delta, if you need the result as - ! a delta over the time step rather than as a per-second flux. - ! - ! And, for the sake of checking conservation: - ! - ! - To get gridcell water (or whatever) content at the start of the time step: - ! - ! call mydribbler%get_amount_left_to_dribble_beg - ! - ! - To get gridcell water (or whatever) content at the end of the time step: - ! - ! call mydribbler%get_amount_left_to_dribble_end - ! - ! These both return the pseudo-state representing how much of the original delta - ! still needs to be dribbled. The 'beg' version includes the amount left to dribble - ! in the current time step; the 'end' version does not. - ! - ! - ! !USES: - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type, get_beg, get_end - use decompMod , only : BOUNDS_SUBGRID_GRIDCELL, BOUNDS_SUBGRID_PATCH - use clm_varcon , only : secspday, nameg, namep - use clm_time_manager , only : get_days_per_year, get_step_size_real, is_beg_curr_year - use clm_time_manager , only : get_curr_yearfrac, get_prev_yearfrac, get_prev_date - use clm_time_manager , only : is_first_step - ! - implicit none - private - - ! Compiler support for allocatable characters isn't fully robust (particularly for - ! pgi), so using a max lengths for now - ! - ! (If we used allocatable characters, these max lengths could be removed - integer, parameter :: name_maxlen = 128 - integer, parameter :: units_maxlen = 64 - integer, parameter :: subgrid_maxlen = 64 - - ! !PUBLIC TYPES: - - type, public :: annual_flux_dribbler_type - private - ! Metadata - character(len=name_maxlen) :: name - character(len=units_maxlen) :: units - - ! Whether this dribbler allows non-zero deltas on time steps other than the first - ! time step of the year - logical :: allows_non_annual_delta - - ! Which subgrid level this dribbler is operating at, stored in various ways - character(len=subgrid_maxlen) :: dim1name - character(len=subgrid_maxlen) :: name_subgrid - integer :: bounds_subgrid_level - - ! Annual amount to dribble in over the year - real(r8), pointer :: amount_to_dribble(:) - - ! Amount from the current timestep to pass through to the flux, if this isn't the - ! first timestep of the year - real(r8), pointer :: amount_from_this_timestep(:) - contains - ! Public infrastructure methods - procedure, public :: Restart - procedure, public :: Clean - - ! Public science methods - procedure, public :: set_curr_delta ! Set the delta state for this time step - procedure, public :: get_curr_flux ! Get the current flux for this time step - procedure, public :: get_dribbled_delta ! Similar to get_curr_flux, but gets result as a delta rather than a per-second flux - procedure, public :: get_amount_left_to_dribble_beg ! Get the pseudo-state representing the amount that still needs to be dribbled in this and future time steps - procedure, public :: get_amount_left_to_dribble_end ! Get the pseudo-state representing the amount that still needs to be dribbled in just future time steps - - ! Private methods - procedure, private :: allocate_and_initialize_data - procedure, private :: set_metadata - procedure, private :: get_amount_left_to_dribble - end type annual_flux_dribbler_type - - public :: annual_flux_dribbler_gridcell ! Creates an annual_flux_dribbler_type object at the gridcell-level - public :: annual_flux_dribbler_patch ! Creates an annual_flux_dribbler_type object at the patch-level - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ======================================================================== - ! Factory methods - ! - ! For now, there are only factory methods for gridcell-level and patch-level. But - ! adding the ability to work at other levels is as easy as adding another factory - ! method like this (along with some variables in the 'only' clauses of the 'use' - ! statements). - ! ======================================================================== - - !----------------------------------------------------------------------- - function annual_flux_dribbler_gridcell(bounds, name, units, allows_non_annual_delta) & - result(this) - ! - ! !DESCRIPTION: - ! Creates an annual_flux_dribbler_type object at the gridcell-level - ! - ! !USES: - ! - ! !ARGUMENTS: - type(annual_flux_dribbler_type) :: this ! function result - type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: name ! name of this object, used for i/o - character(len=*) , intent(in) :: units ! units metadata - should be state units, not flux (i.e., NOT per-second) - - ! If allows_non_annual_delta is .false., then an error check is performed for each - ! call to set_curr_delta, ensuring that the delta is 0 at all times other than the - ! first time step of the year. This is just provided as a convenient sanity check - - ! to ensure that the code is behaving as expected. (However, non-zero deltas are - ! always allowed on the first step of the run.) - ! - ! If allows_non_annual_delta is not provided, it is assumed to be .true. - logical, intent(in), optional :: allows_non_annual_delta - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'annual_flux_dribbler_gridcell' - !----------------------------------------------------------------------- - - this%dim1name = 'gridcell' - this%name_subgrid = nameg - this%bounds_subgrid_level = BOUNDS_SUBGRID_GRIDCELL - - call this%allocate_and_initialize_data(bounds) - call this%set_metadata(name, units, allows_non_annual_delta) - - end function annual_flux_dribbler_gridcell - - !----------------------------------------------------------------------- - function annual_flux_dribbler_patch(bounds, name, units, allows_non_annual_delta) & - result(this) - ! - ! !DESCRIPTION: - ! Creates an annual_flux_dribbler_type object at the patch-level - ! - ! !USES: - ! - ! !ARGUMENTS: - type(annual_flux_dribbler_type) :: this ! function result - type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: name ! name of this object, used for i/o - character(len=*) , intent(in) :: units ! units metadata - should be state units, not flux (i.e., NOT per-second) - - ! If allows_non_annual_delta is .false., then an error check is performed for each - ! call to set_curr_delta, ensuring that the delta is 0 at all times other than the - ! first time step of the year. This is just provided as a convenient sanity check - - ! to ensure that the code is behaving as expected. - ! - ! If allows_non_annual_delta is not provided, it is assumed to be .true. - logical, intent(in), optional :: allows_non_annual_delta - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'annual_flux_dribbler_patch' - !----------------------------------------------------------------------- - - this%dim1name = 'pft' - this%name_subgrid = namep - this%bounds_subgrid_level = BOUNDS_SUBGRID_PATCH - - call this%allocate_and_initialize_data(bounds) - call this%set_metadata(name, units, allows_non_annual_delta) - - end function annual_flux_dribbler_patch - - ! ======================================================================== - ! Public methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine set_curr_delta(this, bounds, delta) - ! - ! !DESCRIPTION: - ! Sets the delta state for this time step. Note that the delta is specified just as - ! the change in state - NOT as a flux (per-second) quantity. - ! - ! This must be called every timestep, even if the deltas are currently 0, in order to - ! zero out any existing stored delta. This can (and generally should) even be called - ! when it isn't the first timestep of the year. For deltas that are non-zero at times - ! other than the first timestep of the year, they will simply be passed on to the - ! output flux in get_curr_flux, making for easier handling by the client. (i.e., this - ! class handles the addition of the dribbled flux and the current flux for you.) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: delta( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - integer :: beg_index, end_index - integer :: i - integer :: yr, mon, day, tod - - character(len=*), parameter :: subname = 'set_curr_delta' - !----------------------------------------------------------------------- - - beg_index = lbound(delta, 1) - end_index = get_end(bounds, this%bounds_subgrid_level) - SHR_ASSERT_ALL((ubound(delta) == (/end_index/)), errMsg(sourcefile, __LINE__)) - - if (is_beg_curr_year()) then - do i = beg_index, end_index - this%amount_to_dribble(i) = delta(i) - - ! On the first timestep of the year, we don't have any pass-through flux. Need - ! to zero out any previously-set amount_from_this_timestep. - this%amount_from_this_timestep(i) = 0._r8 - end do - else - do i = beg_index, end_index - this%amount_from_this_timestep(i) = delta(i) - end do - if (.not. this%allows_non_annual_delta .and. .not. is_first_step()) then - do i = beg_index, end_index - if (this%amount_from_this_timestep(i) /= 0._r8) then - write(iulog,*) subname//' ERROR: found unexpected non-zero delta mid-year' - write(iulog,*) 'Dribbler name: ', trim(this%name) - write(iulog,*) 'i, delta = ', i, this%amount_from_this_timestep(i) - call get_prev_date(yr, mon, day, tod) - write(iulog,*) 'Start of time step date (yr, mon, day, tod) = ', & - yr, mon, day, tod - write(iulog,*) 'This indicates that some non-zero flux was generated at a time step' - write(iulog,*) 'other than the first time step of the year, which this dribbler was told not to expect.' - write(iulog,*) 'If this non-zero mid-year delta is expected, then you can suppress this error' - write(iulog,*) 'by setting allows_non_annual_delta to .true. when constructing this dribbler.' - call endrun(decomp_index=i, clmlevel=this%name_subgrid, & - msg=subname//': found unexpected non-zero delta mid-year: ' // & - errMsg(sourcefile, __LINE__)) - end if - end do - end if - end if - - end subroutine set_curr_delta - - !----------------------------------------------------------------------- - subroutine get_curr_flux(this, bounds, flux) - ! - ! !DESCRIPTION: - ! Gets the current flux for this timestep, and stores it in the flux argument. - ! - ! This should be called AFTER set_curr_delta is called for the given timestep. - ! - ! This will get the current flux for this timestep, which is the sum of (1) the - ! dribbled flux from the last start-of-year timestep, and (2) the current timestep's - ! flux, based on the delta passed in to set_curr_delta in this timestep, if this is - ! not the start-of-year timestep. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(out) :: flux( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - integer :: beg_index, end_index - integer :: i - real(r8) :: secs_per_year - real(r8) :: dtime - real(r8) :: flux_from_dribbling - real(r8) :: flux_from_this_timestep - - character(len=*), parameter :: subname = 'get_curr_flux' - !----------------------------------------------------------------------- - - beg_index = lbound(flux, 1) - end_index = get_end(bounds, this%bounds_subgrid_level) - SHR_ASSERT_ALL((ubound(flux) == (/end_index/)), errMsg(sourcefile, __LINE__)) - - secs_per_year = get_days_per_year() * secspday - dtime = get_step_size_real() - - do i = beg_index, end_index - flux_from_dribbling = this%amount_to_dribble(i) / secs_per_year - flux_from_this_timestep = this%amount_from_this_timestep(i) / dtime - flux(i) = flux_from_dribbling + flux_from_this_timestep - end do - - end subroutine get_curr_flux - - !----------------------------------------------------------------------- - subroutine get_dribbled_delta(this, bounds, delta) - ! - ! !DESCRIPTION: - ! Gets the current delta for this timestep, and stores it in the delta argument. - ! - ! This is similar to get_curr_flux, but returns the total, dribbled delta over this - ! timestep, rather than a per-second flux. See documentation in get_curr_flux for - ! more usage details. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(out) :: delta( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - integer :: beg_index, end_index - integer :: i - real(r8) :: dtime - real(r8), allocatable :: flux(:) - - character(len=*), parameter :: subname = 'get_dribbled_delta' - !----------------------------------------------------------------------- - - beg_index = lbound(delta, 1) - end_index = get_end(bounds, this%bounds_subgrid_level) - SHR_ASSERT_ALL((ubound(delta) == (/end_index/)), errMsg(sourcefile, __LINE__)) - - allocate(flux(beg_index:end_index)) - - call this%get_curr_flux(bounds, flux(beg_index:end_index)) - - dtime = get_step_size_real() - do i = beg_index, end_index - delta(i) = flux(i) * dtime - end do - - end subroutine get_dribbled_delta - - - !----------------------------------------------------------------------- - subroutine get_amount_left_to_dribble_beg(this, bounds, amount_left_to_dribble) - ! - ! !DESCRIPTION: - ! Get the pseudo-state representing the amount that still needs to be dribbled in - ! this and future time steps. This represents the pseudo-state before this time - ! step's dribbling flux has been removed. (This behavior is regardless of whether - ! get_curr_flux has been called already this time step.) - ! - ! As a special case, this returns 0 in the first time step of the year, because we - ! haven't created this year's dribbling pool as of the beginning of this time step. - ! - ! i.e., if we imagined that the total amount to dribble was added to a state - ! variable, and then this state variable was updated each time step as the flux - ! dribbles out, then this subroutine gives the amount left in that state. (However, - ! the actual implementation doesn't explicitly track this state, which is why we - ! refer to it as a pseudo-state.) - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(out) :: amount_left_to_dribble( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - real(r8) :: yearfrac - - character(len=*), parameter :: subname = 'get_amount_left_to_dribble_beg' - !----------------------------------------------------------------------- - - yearfrac = get_prev_yearfrac() - call this%get_amount_left_to_dribble(bounds, yearfrac, amount_left_to_dribble) - - end subroutine get_amount_left_to_dribble_beg - - - !----------------------------------------------------------------------- - subroutine get_amount_left_to_dribble_end(this, bounds, amount_left_to_dribble) - ! - ! !DESCRIPTION: - ! Gets the pseudo-state representing the amount that still needs to be dribbled in - ! future time steps. This represents the pseudo-state after this time step's dribbling - ! flux has been removed. i.e., this includes the amount that will be dribbled starting - ! with the *next* time step, through the end of this year. So this will return 0 on - ! the last time step of the year. (This behavior is regardless of whether - ! get_curr_flux has been called already this time step.) - ! - ! See documentation of get_amount_left_to_dribble_beg for more details. - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(out) :: amount_left_to_dribble( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - real(r8) :: yearfrac - - character(len=*), parameter :: subname = 'get_amount_left_to_dribble_end' - !----------------------------------------------------------------------- - - yearfrac = get_curr_yearfrac() - call this%get_amount_left_to_dribble(bounds, yearfrac, amount_left_to_dribble) - - end subroutine get_amount_left_to_dribble_end - - - !----------------------------------------------------------------------- - subroutine Restart(this, bounds, ncid, flag) - ! - ! !USES: - use ncdio_pio, only : file_desc_t, ncd_double - use restUtilMod - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - ! - ! !LOCAL VARIABLES: - character(len=:), allocatable :: restname ! name of field on restart file - logical :: readvar - - character(len=*), parameter :: subname = 'Restart' - !----------------------------------------------------------------------- - - restname = trim(this%name) // '_amt_to_dribble' - call restartvar(ncid=ncid, flag=flag, varname=restname, xtype=ncd_double, & - dim1name = this%dim1name, & - long_name = 'total amount to dribble over the year for ' // trim(this%name), & - units = trim(this%units), & - interpinic_flag = 'interp', & - readvar = readvar, & - data = this%amount_to_dribble) - - end subroutine Restart - - !----------------------------------------------------------------------- - subroutine Clean(this) - ! - ! !DESCRIPTION: - ! Deallocate memory associated with this object - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(inout) :: this - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'Clean' - !----------------------------------------------------------------------- - - deallocate(this%amount_to_dribble) - deallocate(this%amount_from_this_timestep) - - end subroutine Clean - - ! ======================================================================== - ! Private methods - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine allocate_and_initialize_data(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate arrays in this object and set them to initial values - ! - ! Assumes this%bounds_subgrid_level is already set - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: beg_index, end_index - - character(len=*), parameter :: subname = 'allocate_and_initialize_data' - !----------------------------------------------------------------------- - - beg_index = get_beg(bounds, this%bounds_subgrid_level) - end_index = get_end(bounds, this%bounds_subgrid_level) - - allocate(this%amount_to_dribble(beg_index:end_index)) - this%amount_to_dribble(beg_index:end_index) = 0._r8 - - allocate(this%amount_from_this_timestep(beg_index:end_index)) - this%amount_from_this_timestep(beg_index:end_index) = 0._r8 - - end subroutine allocate_and_initialize_data - - !----------------------------------------------------------------------- - subroutine set_metadata(this, name, units, allows_non_annual_delta) - ! - ! !DESCRIPTION: - ! Set metadata in this object - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(inout) :: this - character(len=*) , intent(in) :: name ! name of this object, used for i/o - character(len=*) , intent(in) :: units ! units metadata - should be state units, not flux (i.e., NOT per-second) - - ! If allows_non_annual_delta is .false., then an error check is performed for each - ! call to set_curr_delta, ensuring that the delta is 0 at all times other than the - ! first time step of the year. This is just provided as a convenient sanity check - - ! to ensure that the code is behaving as expected. - ! - ! If allows_non_annual_delta is not provided, it is assumed to be .true. - logical, intent(in), optional :: allows_non_annual_delta - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_metadata' - !----------------------------------------------------------------------- - - if (len_trim(name) > name_maxlen) then - write(iulog,*) subname // ': name too long' - write(iulog,*) trim(name) // ' exceeds max length: ', name_maxlen - call endrun(msg=subname // ': name too long: ' // & - errMsg(sourcefile, __LINE__)) - end if - this%name = trim(name) - - if (len_trim(units) > units_maxlen) then - write(iulog,*) subname // ': units too long' - write(iulog,*) trim(units) // ' exceeds max length: ', units_maxlen - call endrun(msg=subname // ': units too long: ' // & - errMsg(sourcefile, __LINE__)) - end if - this%units = trim(units) - - if (present(allows_non_annual_delta)) then - this%allows_non_annual_delta = allows_non_annual_delta - else - this%allows_non_annual_delta = .true. - end if - - end subroutine set_metadata - - !----------------------------------------------------------------------- - subroutine get_amount_left_to_dribble(this, bounds, yearfrac, amount_left_to_dribble) - ! - ! !DESCRIPTION: - ! Helper method shared by get_amount_left_to_dribble_beg and - ! get_amount_left_to_dribble_end. Returns amount left to dribble as of a given - ! yearfrac. - ! - ! !USES: - ! - ! !ARGUMENTS: - class(annual_flux_dribbler_type), intent(in) :: this - type(bounds_type), intent(in) :: bounds - real(r8), intent(in) :: yearfrac - real(r8), intent(out) :: amount_left_to_dribble( get_beg(bounds, this%bounds_subgrid_level) : ) - ! - ! !LOCAL VARIABLES: - integer :: beg_index, end_index - integer :: i - - character(len=*), parameter :: subname = 'get_amount_left_to_dribble' - !----------------------------------------------------------------------- - - beg_index = lbound(amount_left_to_dribble, 1) - end_index = get_end(bounds, this%bounds_subgrid_level) - SHR_ASSERT_ALL((ubound(amount_left_to_dribble) == (/end_index/)), errMsg(sourcefile, __LINE__)) - - do i = beg_index, end_index - if (yearfrac < 1.e-15_r8) then - ! last time step of year; we'd like this to be given a yearfrac of 1 rather than - ! 0 in this case; since it's given as 0, we need to handle it specially - amount_left_to_dribble(i) = 0._r8 - else - amount_left_to_dribble(i) = this%amount_to_dribble(i) * (1._r8 - yearfrac) - end if - end do - - end subroutine get_amount_left_to_dribble - - -end module AnnualFluxDribbler diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt deleted file mode 100644 index a1b8b61d72..0000000000 --- a/src/utils/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -set(genf90_files - array_utils.F90.in - ) - -process_genf90_source_list("${genf90_files}" ${CMAKE_CURRENT_SOURCE_DIR} clm_genf90_sources) - -sourcelist_to_parent(clm_genf90_sources) - -list(APPEND clm_sources "${clm_genf90_sources}") - -list(APPEND clm_sources - AnnualFluxDribbler.F90 - domainMod.F90 - clm_nlUtilsMod.F90 - clm_time_manager.F90 - quadraticMod.F90 - fileutils.F90 - ) - -sourcelist_to_parent(clm_sources) diff --git a/src/utils/SimpleMathMod.F90 b/src/utils/SimpleMathMod.F90 deleted file mode 100644 index 0727057845..0000000000 --- a/src/utils/SimpleMathMod.F90 +++ /dev/null @@ -1,230 +0,0 @@ -module SimpleMathMod - -#include "shr_assert.h" - !------------------------------------------------------------------------------ - ! - ! DESCRIPTIONS: - ! module contains simple mathematical functions for arrays - ! Created by Jinyun Tang, Feb., 2014 - -implicit none - - interface array_normalization - module procedure array_normalization_2d, array_normalization_2d_filter - end interface array_normalization - - interface array_div_vector - module procedure array_div_vector_filter, array_div_vector_nofilter - end interface array_div_vector - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains -!-------------------------------------------------------------------------------- - subroutine array_normalization_2d(which_dim, arr2d_inout) - ! - !DESCRIPTIONS - !do normalization for the input array along dimension which_dim - ! - !USES - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - - integer, intent(in) :: which_dim !do normalization along which dimension? - real(r8), intent(inout) :: arr2d_inout(:,:) !input 2d array - - - !local variables - integer :: sz1, sz2 !array size - integer :: j1, j2 !indices - real(r8) :: arr_sum - - sz1 = size(arr2d_inout,1) - sz2 = size(arr2d_inout,2) - - if(which_dim==1)then - !normalize along dimension 1, so loop along dimension 2 - do j2 = 1, sz2 - !obtain the total - arr_sum=0._r8 - do j1 = 1, sz1 - arr_sum=arr_sum+arr2d_inout(j1,j2) - enddo - !normalize with the total if arr_sum is non-zero - if(arr_sum/=0._r8)then - do j1 = 1, sz1 - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr_sum - enddo - endif - enddo - elseif(which_dim==2)then - !normalize along dimension 2, so loop along dimension 1 - do j1 = 1, sz1 - !obtain the total - arr_sum=0._r8 - do j2 = 1, sz2 - arr_sum=arr_sum+arr2d_inout(j1,j2) - enddo - !normalize with the total if arr_sum is non-zero - !I think there should be a safer mask for this to screen off spval values - !Jinyun Tang, May 30, 2014 - if(arr_sum>0._r8 .or. arr_sum < 0._r8)then - do j2 = 1, sz2 - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr_sum - enddo - endif - enddo - endif - return - end subroutine array_normalization_2d - -!-------------------------------------------------------------------------------- - subroutine array_normalization_2d_filter(lbj1, ubj1, lbj2, ubj2, numf, filter, arr2d_inout) - ! - !DESCRIPTIONS - !do normalization with filter for the input array along dimension 2 - - ! - !USES - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - integer, intent(in) :: lbj1 !left bound of dim 1 - integer, intent(in) :: lbj2 !left bound of dim 2 - integer, intent(in) :: ubj1 !right bound of dim 1 - integer, intent(in) :: ubj2 !right bound of dim 2 - integer, intent(in) :: numf !filter size - integer, intent(in) :: filter(:) !filter - real(r8), intent(inout) :: arr2d_inout(lbj1: , lbj2: ) !input 2d array - - - !local variables - integer :: sz1, sz2 !array size - integer :: j2 !indices - integer :: f, p !indices - real(r8) :: arr_sum(lbj1:ubj1) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(arr2d_inout) == (/ubj1, ubj2/)), errMsg(sourcefile, __LINE__)) - - - arr_sum(:) = 0._r8 - do j2 = lbj2, ubj2 - do f = 1, numf - p = filter(f) - !obtain the total - arr_sum(p)=arr_sum(p)+arr2d_inout(p,j2) - enddo - enddo - - !normalize with the total if arr_sum is non-zero - do j2 = lbj2, ubj2 - do f = 1, numf - p = filter(f) - !I found I have to ensure >0._r8 because of some unknown reason, jyt May 23, 2014 - !I will test this later with arr_sum(p)/=0._r8 - if(arr_sum(p)>0._r8 .or. arr_sum(p)<0._r8)then - arr2d_inout(p,j2) = arr2d_inout(p,j2)/arr_sum(p) - endif - enddo - enddo - return - end subroutine array_normalization_2d_filter -!-------------------------------------------------------------------------------- - - subroutine array_div_vector_filter(lbj1, ubj1, lbj2, ubj2, & - arr1d_in, fn, filter, arr2d_inout) - ! - !DESCRIPTIONS - !array divided by a vector, arr2d_in is divided by one - !element in arr1d_in - !It always assumes the filter is along with dimenion 1 - ! - ! USES - ! - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - integer, intent(in) :: lbj1 !left bound of dim 1 - integer, intent(in) :: lbj2 !left bound of dim 2 - integer, intent(in) :: ubj1 !right bound of dim 1 - integer, intent(in) :: ubj2 !right bound of dim 2 - real(r8), intent(in) :: arr1d_in(lbj1: ) !1d scaling factor - integer , intent(in) :: fn - integer , intent(in) :: filter(:) !filter - real(r8), intent(inout) :: arr2d_inout(lbj1: ,lbj2: ) !2d array to be scaled - - integer :: sz - integer :: j, f, p - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(arr2d_inout) == (/ubj1, ubj2/)), errMsg(sourcefile, __LINE__)) - SHR_ASSERT_ALL((ubound(arr1d_in) == (/ubj1/)), errMsg(sourcefile, __LINE__)) - - - do j = lbj2, ubj2 - do f = 1, fn - p = filter(f) - if (arr1d_in(p) > 0._r8 .or. arr1d_in(p) < 0._r8) then - arr2d_inout(p,j) = arr2d_inout(p,j)/arr1d_in(p) - else - arr2d_inout(p,j) = 0._r8 - end if - end do - end do - return - end subroutine array_div_vector_filter - -!-------------------------------------------------------------------------------- - - subroutine array_div_vector_nofilter(arr1d_in, which_dim, arr2d_inout) - ! - !DESCRIPTIONS - !array divided by a vector, each row in arr2d_in is divided by one - !element in arr1d_in - ! - !USES - ! - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - real(r8), intent(in) :: arr1d_in(:) !scaling factor - integer, intent(in) :: which_dim !which dimension is scaled - real(r8), intent(inout) :: arr2d_inout(:,:) !2d array to be scaled - - integer :: sz1, sz2 - integer :: j1, j2 - - sz1=size(arr2d_inout,1) - sz2=size(arr2d_inout,2) - - if(which_dim==1)then - ! Enforce expected array sizes - call shr_assert(sz1 == size(arr1d_in), errMsg(sourcefile, __LINE__)) - - do j2 = 1, sz2 - do j1 = 1, sz1 - if(arr1d_in(j1)>0._r8)then - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr1d_in(j1) - endif - enddo - enddo - else - ! Enforce expected array sizes - call shr_assert(sz2 == size(arr1d_in), errMsg(sourcefile, __LINE__)) - - do j2 = 1, sz2 - do j1 = 1, sz1 - if(arr1d_in(j2)>0._r8 .or. arr1d_in(j2)<0._r8)then - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr1d_in(j2) - endif - enddo - enddo - - endif - return - end subroutine array_div_vector_nofilter - -end module SimpleMathMod diff --git a/src/utils/array_utils.F90.in b/src/utils/array_utils.F90.in deleted file mode 100644 index 78a237aaae..0000000000 --- a/src/utils/array_utils.F90.in +++ /dev/null @@ -1,99 +0,0 @@ -module array_utils - - ! ------------------------------------------------------------------------ - ! !DESCRIPTION: - ! This module contains routines for working with arrays. - ! - ! NOTE(wjs, 2015-10-21) These routines could be moved to csm_share. However, I'm not - ! sure if these routines will stick around for long, since they are just here to work - ! around the fact that we don't specify -Mallocatable=03 with pgi (which in turn is - ! because that flag led to bugs with pgi14). - ! - ! !USES: - - use shr_kind_mod, only : r8 => shr_kind_r8, i4=>shr_kind_i4 - - implicit none - private - save - - ! Public routines - - public :: transpose_wrapper ! wrap the intrinsic transpose function, first allocating the destination array - public :: pack_wrapper ! wrap the intrinsic pack function, first allocating the destination array - - interface transpose_wrapper - !TYPE int,double - module procedure transpose_wrapper_{TYPE} - end interface transpose_wrapper - -contains - - !----------------------------------------------------------------------- - !TYPE int,double - subroutine transpose_wrapper_{TYPE}(arr_out, arr_in) - ! - ! !DESCRIPTION: - ! Wrap the intrinsic transpose function, doing the necessary allocation of the - ! destination array - ! - ! NOTE(wjs, 2015-10-21) This is supposed to be handled for you in Fortran2003. Within - ! CESM, it currently appears to be handled for all compilers except pgi: It is - ! handled with intel through the use of '-assume realloc_lhs'. It could be handled - ! with pgi through the use of '-Mallocatable=03', but we currently don't use that - ! flag, because it triggered bugs with pgi14. - ! - ! !USES: - ! - ! !ARGUMENTS: - {VTYPE}, allocatable, intent(out) :: arr_out(:,:) - {VTYPE}, intent(in) :: arr_in(:,:) - ! - ! !LOCAL VARIABLES: - integer :: size1, size2 - - character(len=*), parameter :: subname = 'transpose_wrapper_{TYPE}' - !----------------------------------------------------------------------- - - size1 = size(arr_in, 1) - size2 = size(arr_in, 2) - allocate(arr_out(size2, size1)) - - arr_out = transpose(arr_in) - - end subroutine transpose_wrapper_{TYPE} - - !----------------------------------------------------------------------- - subroutine pack_wrapper(arr_packed, arr, mask) - ! - ! !DESCRIPTION: - ! Wrap the intrinsic pack function, doing the necessary allocation of the destination - ! array. - ! - ! NOTE(wjs, 2015-10-21) This is supposed to be handled for you in Fortran2003. Within - ! CESM, it currently appears to be handled for all compilers except pgi: It is - ! handled with intel through the use of '-assume realloc_lhs'. It could be handled - ! with pgi through the use of '-Mallocatable=03', but we currently don't use that - ! flag, because it triggered bugs with pgi14. - ! - ! !USES: - ! - ! !ARGUMENTS: - real(r8), allocatable, intent(out) :: arr_packed(:) - real(r8), intent(in) :: arr(:) - logical , intent(in) :: mask(:) - ! - ! !LOCAL VARIABLES: - integer :: packed_size - - character(len=*), parameter :: subname = 'pack_wrapper' - !----------------------------------------------------------------------- - - packed_size = count(mask) - allocate(arr_packed(packed_size)) - arr_packed = pack(arr, mask) - - end subroutine pack_wrapper - -end module array_utils - diff --git a/src/utils/clm_nlUtilsMod.F90 b/src/utils/clm_nlUtilsMod.F90 deleted file mode 100644 index 68536bd1fb..0000000000 --- a/src/utils/clm_nlUtilsMod.F90 +++ /dev/null @@ -1,116 +0,0 @@ -module clm_nlUtilsMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_nltUtilsMod -! -! !DESCRIPTION: -! Utilities to handle namelists. -! -! !USES: - -! !PUBLIC TYPES: - implicit none - save - - private ! By default everything is private - -! !PUBLIC MEMBER FUNCTIONS: - public :: find_nlgroup_name ! find a specified namelist group in a file -! -! !REVISION HISTORY: -! Created by B. Eaton -! Move to CLM by E. Kluzek -! -! !PRIVATE MEMBER FUNCTIONS: None -!----------------------------------------------------------------------- -! !PRIVATE DATA MEMBERS: None - -!EOP -!----------------------------------------------------------------------- -contains - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: find_nlgroup_name -! -! !INTERFACE: - subroutine find_nlgroup_name(unit, group, status) -! -! !DESCRIPTION: -! Search a file that contains namelist input for the specified namelist group name. -! Leave the file positioned so that the current record is the first record of the -! input for the specified group. -! -! METHOD: -! Read the file line by line. Each line is searched for an '&' which may only -! be preceded by blanks, immediately followed by the group name which is case -! insensitive. If found then backspace the file so the current record is the -! one containing the group name and return success. Otherwise return -1. -! -! !USES: - use shr_kind_mod , only : CS => shr_kind_cs - use shr_string_mod, only : shr_string_toLower -! -! !ARGUMENTS: - integer, intent(in) :: unit ! fortran unit attached to file - character(len=*), intent(in) :: group ! namelist group name - integer, intent(out) :: status ! 0 for success, -1 if group name not found -! -! !REVISION HISTORY: -! Created by B. Eaton, August 2007 -! Move to CLM E. Kluzek, August 2012 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: len_grp ! length of the groupname - integer :: ios ! io status - character(len=CS) :: inrec ! first shr_kind_CS characters of input record - character(len=CS) :: inrec2 ! left adjusted input record - character(len=len(group)) :: lc_group ! lower-case group name - character(len=32) :: subname = 'find_nlgroup_name' ! subroutine name -!----------------------------------------------------------------------- - len_grp = len_trim(group) - lc_group = shr_string_toLower(group) - - ios = 0 - do while (ios <= 0) - - read(unit, '(a)', iostat=ios, end=100) inrec - - if (ios <= 0) then ! ios < 0 indicates an end of record condition - - ! look for group name in this record - - ! remove leading blanks - inrec2 = adjustl(inrec) - - ! check for leading '&' - if (inrec2(1:1) == '&') then - - ! check for case insensitive group name - if (trim(lc_group) == shr_string_toLower(inrec2(2:len_grp+1))) then - - ! found group name. backspace to leave file position at this record - backspace(unit) - status = 0 - return - - end if - end if - end if - - end do - - 100 continue ! end of file processing - status = -1 - -end subroutine find_nlgroup_name - -!----------------------------------------------------------------------- - -end module clm_nlUtilsMod diff --git a/src/utils/clm_time_manager.F90 b/src/utils/clm_time_manager.F90 deleted file mode 100644 index ec62c9f071..0000000000 --- a/src/utils/clm_time_manager.F90 +++ /dev/null @@ -1,1956 +0,0 @@ -module clm_time_manager - - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_sys_mod , only: shr_sys_abort - use spmdMod , only: masterproc - use clm_varctl , only: iulog - use clm_varcon , only: isecspday - use ESMF - - implicit none - private - - ! Public methods - - public ::& - get_timemgr_defaults, &! get startup default values - set_timemgr_init, &! setup startup values - timemgr_init, &! time manager initialization - timemgr_restart_io, &! read/write time manager restart info and restart time manager - timemgr_restart, &! restart the time manager using info from timemgr_restart - timemgr_datediff, &! calculate difference between two time instants - advance_timestep, &! increment timestep number - get_clock, &! get the clock from the time-manager - get_curr_ESMF_Time, &! get current time in terms of the ESMF_Time - get_step_size, &! return step size in seconds - get_step_size_real, &! return step size in seconds, real-valued - get_rad_step_size, &! return radiation step size in seconds - get_nstep, &! return timestep number - get_nstep_since_startup_or_lastDA_restart_or_pause, &! return number of timesteps since restart was modified - get_curr_date, &! return date components at end of current timestep - get_prev_date, &! return date components at beginning of current timestep - get_start_date, &! return components of the start date - get_driver_start_ymd, &! return year/month/day (as integer in YYYYMMDD format) of driver start date - get_ref_date, &! return components of the reference date - get_perp_date, &! return components of the perpetual date, and current time of day - get_curr_time, &! return components of elapsed time since reference date at end of current timestep - get_prev_time, &! return components of elapsed time since reference date at beg of current timestep - get_curr_calday, &! return calendar day at end of current timestep - get_calday, &! return calendar day from input date - get_calendar, &! return calendar - get_days_per_year, &! return the days per year for current year - get_curr_yearfrac, &! return the fractional position in the current year, as of the end of the current timestep - get_prev_yearfrac, &! return the fractional position in the current year, as of the beginning of the current timestep - get_rest_date, &! return the date from the restart file - set_nextsw_cday, &! set the next radiation calendar day - is_first_step, &! return true on first step of initial run - is_first_restart_step, &! return true on first step of restart or branch run - is_first_step_of_this_run_segment, &! return true on first step of any run segment (initial, restart or branch run) - is_beg_curr_day, &! return true on first timestep in current day - is_end_curr_day, &! return true on last timestep in current day - is_end_curr_month, &! return true on last timestep in current month - is_beg_curr_year, &! return true on first timestep in current year - is_end_curr_year, &! return true on last timestep in current year - is_last_step, &! return true on last timestep - is_perpetual, &! return true if perpetual calendar is in use - is_restart, &! return true if this is a restart run - update_rad_dtime, &! track radiation interval via nstep - update_DA_nstep, &! update the Data Assimulation time step - timemgr_reset ! reset values to their defaults, and free memory - - ! Public methods, but just to support unit testing: - public :: for_test_set_curr_date ! set the current date and time - - ! Public parameter data - character(len=*), public, parameter :: NO_LEAP_C = 'NO_LEAP' - character(len=*), public, parameter :: GREGORIAN_C = 'GREGORIAN' - - ! Private module data - - ! Private data for input - - character(len=ESMF_MAXSTR), save ::& - calendar = NO_LEAP_C ! Calendar to use in date calculations. - integer, parameter :: uninit_int = -999999999 - real(r8), parameter :: uninit_r8 = -999999999.0 - - ! Input - integer, save ::& - dtime = uninit_int, &! timestep in seconds - dtime_rad = uninit_int, &! radiation interval in seconds - nstep_rad_prev = uninit_int ! radiation interval in seconds - - ! Input from CESM driver - integer, save ::& - nelapse = uninit_int, &! number of timesteps (or days if negative) to extend a run - start_ymd = uninit_int, &! starting date for run in yearmmdd format - start_tod = 0, &! starting time of day for run in seconds - stop_ymd = uninit_int, &! stopping date for run in yearmmdd format - stop_tod = 0, &! stopping time of day for run in seconds - ref_ymd = uninit_int, &! reference date for time coordinate in yearmmdd format - ref_tod = 0 ! reference time of day for time coordinate in seconds - type(ESMF_Calendar), target, save :: tm_cal ! calendar - type(ESMF_Clock), save :: tm_clock ! model clock - type(ESMF_Time), save :: tm_perp_date ! perpetual date - - ! Data required to restart time manager: - integer, save :: rst_step_sec = uninit_int ! timestep size seconds - integer, save :: rst_start_ymd = uninit_int ! start date - integer, save :: rst_start_tod = uninit_int ! start time of day - integer, save :: rst_ref_ymd = uninit_int ! reference date - integer, save :: rst_ref_tod = uninit_int ! reference time of day - integer, save :: rst_curr_ymd = uninit_int ! current date - integer, save :: rst_curr_tod = uninit_int ! current time of day - - integer, save :: rst_nstep_rad_prev ! nstep of previous radiation call - integer, save :: perpetual_ymd = uninit_int ! Perpetual calendar date (YYYYMMDD) - logical, save :: tm_first_restart_step = .false. ! true for first step of a restart or branch run - logical, save :: tm_perp_calendar = .false. ! true when using perpetual calendar - logical, save :: timemgr_set = .false. ! true when timemgr initialized - integer, save :: nestep = uninit_int ! ending time-step - ! - ! Next short-wave radiation calendar day - ! - real(r8) :: nextsw_cday = uninit_r8 ! calday from clock of next radiation computation - - ! - ! The time-step number of startup or last Data Assimulation (DA) restart or pause - integer, save :: DA_nstep = 0 ! Last step number that state was modified externally (by DA) - - ! Private module methods - - private :: timemgr_spmdbcast - private :: init_calendar - private :: init_clock - private :: calc_nestep - private :: timemgr_print - private :: TimeGetymd - private :: check_timemgr_initialized - - !========================================================================================= -contains - !========================================================================================= - - subroutine get_timemgr_defaults( calendar_out, start_ymd_out, start_tod_out, ref_ymd_out, & - ref_tod_out, stop_ymd_out, stop_tod_out, nelapse_out, & - dtime_out ) - - !--------------------------------------------------------------------------------- - ! get time manager startup default values - ! - ! Arguments - character(len=*), optional, intent(OUT) :: calendar_out ! Calendar type - integer , optional, intent(OUT) :: nelapse_out ! Number of step (or days) to advance - integer , optional, intent(OUT) :: start_ymd_out ! Start date (YYYYMMDD) - integer , optional, intent(OUT) :: start_tod_out ! Start time of day (sec) - integer , optional, intent(OUT) :: ref_ymd_out ! Reference date (YYYYMMDD) - integer , optional, intent(OUT) :: ref_tod_out ! Reference time of day (sec) - integer , optional, intent(OUT) :: stop_ymd_out ! Stop date (YYYYMMDD) - integer , optional, intent(OUT) :: stop_tod_out ! Stop time of day (sec) - integer , optional, intent(OUT) :: dtime_out ! Time-step (sec) - ! - character(len=*), parameter :: sub = 'clm::get_timemgr_defaults' - - if ( timemgr_set ) call shr_sys_abort( sub//":: timemgr_init or timemgr_restart already called" ) - if (present(calendar_out) ) calendar_out = trim(calendar) - if (present(start_ymd_out) ) start_ymd_out = start_ymd - if (present(start_tod_out) ) start_tod_out = start_tod - if (present(ref_ymd_out) ) ref_ymd_out = ref_ymd - if (present(ref_tod_out) ) ref_tod_out = ref_tod - if (present(stop_ymd_out) ) stop_ymd_out = stop_ymd - if (present(stop_tod_out) ) stop_tod_out = stop_tod - if (present(nelapse_out) ) nelapse_out = nelapse - if (present(dtime_out) ) dtime_out = dtime - - end subroutine get_timemgr_defaults - - !========================================================================================= - - subroutine set_timemgr_init( calendar_in, start_ymd_in, start_tod_in, ref_ymd_in, & - ref_tod_in, stop_ymd_in, stop_tod_in, perpetual_run_in, & - perpetual_ymd_in, nelapse_in, dtime_in ) - - !--------------------------------------------------------------------------------- - ! set time manager startup values - ! - ! Arguments - character(len=*), optional, intent(IN) :: calendar_in ! Calendar type - integer , optional, intent(IN) :: nelapse_in ! Number of step (or days) to advance - integer , optional, intent(IN) :: start_ymd_in ! Start date (YYYYMMDD) - integer , optional, intent(IN) :: start_tod_in ! Start time of day (sec) - integer , optional, intent(IN) :: ref_ymd_in ! Reference date (YYYYMMDD) - integer , optional, intent(IN) :: ref_tod_in ! Reference time of day (sec) - integer , optional, intent(IN) :: stop_ymd_in ! Stop date (YYYYMMDD) - integer , optional, intent(IN) :: stop_tod_in ! Stop time of day (sec) - logical , optional, intent(IN) :: perpetual_run_in ! If in perpetual mode or not - integer , optional, intent(IN) :: perpetual_ymd_in ! Perpetual date (YYYYMMDD) - integer , optional, intent(IN) :: dtime_in ! Time-step (sec) - ! - character(len=*), parameter :: sub = 'clm::set_timemgr_init' - - if ( timemgr_set ) call shr_sys_abort( sub//":: timemgr_init or timemgr_restart already called" ) - if (present(calendar_in) ) calendar = trim(calendar_in) - if (present(start_ymd_in) ) start_ymd = start_ymd_in - if (present(start_tod_in) ) start_tod = start_tod_in - if (present(ref_ymd_in) ) ref_ymd = ref_ymd_in - if (present(ref_tod_in) ) ref_tod = ref_tod_in - if (present(stop_ymd_in) ) stop_ymd = stop_ymd_in - if (present(stop_tod_in) ) stop_tod = stop_tod_in - if (present(perpetual_run_in) )then - tm_perp_calendar = perpetual_run_in - if ( tm_perp_calendar ) then - if ( .not. present(perpetual_ymd_in) .or. perpetual_ymd == uninit_int) & - call shr_sys_abort( sub//":: perpetual_run set but NOT perpetual_ymd" ) - perpetual_ymd = perpetual_ymd_in - end if - end if - if (present(nelapse_in) ) nelapse = nelapse_in - if (present(dtime_in) ) dtime = dtime_in - - end subroutine set_timemgr_init - - !========================================================================================= - - subroutine timemgr_init( ) - - !--------------------------------------------------------------------------------- - ! Initialize the ESMF time manager from the sync clock - ! - ! Arguments - ! - character(len=*), parameter :: sub = 'clm::timemgr_init' - integer :: rc ! return code - integer :: yr, mon, day, tod ! Year, month, day, and second as integers - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: curr_date ! temporary date used in logic - type(ESMF_Time) :: ref_date ! reference date for time coordinate - logical :: run_length_specified = .false. - type(ESMF_Time) :: current ! current date (from clock) - type(ESMF_TimeInterval) :: day_step_size ! day step size - type(ESMF_TimeInterval) :: step_size ! timestep size - !--------------------------------------------------------------------------------- - call timemgr_spmdbcast( ) - - ! Initalize calendar - - call init_calendar() - - ! Initalize start date. - - if ( start_ymd == uninit_int ) then - write(iulog,*)sub,': start_ymd must be specified ' - call shr_sys_abort - end if - if ( start_tod == uninit_int ) then - write(iulog,*)sub,': start_tod must be specified ' - call shr_sys_abort - end if - start_date = TimeSetymd( start_ymd, start_tod, "start_date" ) - - ! Initialize current date - - curr_date = start_date - - ! Initalize stop date. - - stop_date = TimeSetymd( 99991231, stop_tod, "stop_date" ) - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - call ESMF_TimeIntervalSet( day_step_size, d=1, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting day_step_size') - - if ( stop_ymd /= uninit_int ) then - current = TimeSetymd( stop_ymd, stop_tod, "stop_date" ) - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( nelapse /= uninit_int ) then - if ( nelapse >= 0 ) then - current = curr_date + step_size*nelapse - else - current = curr_date - day_step_size*nelapse - end if - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( .not. run_length_specified ) then - call shr_sys_abort (sub//': Must specify stop_ymd or nelapse') - end if - - ! Error check - - if ( stop_date <= start_date ) then - write(iulog,*)sub, ': stop date must be specified later than start date: ' - call ESMF_TimeGet( start_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Start date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - if ( curr_date >= stop_date ) then - write(iulog,*)sub, ': stop date must be specified later than current date: ' - call ESMF_TimeGet( curr_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Current date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - - ! Initalize reference date for time coordinate. - - if ( ref_ymd /= uninit_int ) then - ref_date = TimeSetymd( ref_ymd, ref_tod, "ref_date" ) - else - ref_date = start_date - end if - - ! Initialize clock - - call init_clock( start_date, ref_date, curr_date, stop_date ) - - ! Initialize date used for perpetual calendar day calculation. - - if (tm_perp_calendar) then - tm_perp_date = TimeSetymd( perpetual_ymd, 0, "tm_perp_date" ) - end if - - ! Print configuration summary to log file (stdout). - - if (masterproc) call timemgr_print() - - timemgr_set = .true. - - end subroutine timemgr_init - - !========================================================================================= - - subroutine init_clock( start_date, ref_date, curr_date, stop_date ) - - !--------------------------------------------------------------------------------- - ! Purpose: Initialize the clock based on the start_date, ref_date, and curr_date - ! as well as the settings from the namelist specifying the time to stop - ! - type(ESMF_Time), intent(in) :: start_date ! start date for run - type(ESMF_Time), intent(in) :: ref_date ! reference date for time coordinate - type(ESMF_Time), intent(in) :: curr_date ! current date (equal to start_date) - type(ESMF_Time), intent(in) :: stop_date ! stop date for run - ! - character(len=*), parameter :: sub = 'clm::init_clock' - type(ESMF_TimeInterval) :: step_size ! timestep size - type(ESMF_Time) :: current ! current date (from clock) - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - ! Initialize the clock - - tm_clock = ESMF_ClockCreate(name="CLM Time-manager clock", timeStep=step_size, startTime=start_date, & - stopTime=stop_date, refTime=ref_date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockSetup') - - ! Advance clock to the current time (in case of a restart) - - call ESMF_ClockGet(tm_clock, currTime=current, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - do while( curr_date > current ) - call ESMF_ClockAdvance( tm_clock, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockAdvance') - call ESMF_ClockGet(tm_clock, currTime=current ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - end do - end subroutine init_clock - - !========================================================================================= - - function TimeSetymd( ymd, tod, desc ) - !--------------------------------------------------------------------------------- - ! - ! Set the time by an integer as YYYYMMDD and integer seconds in the day - ! - integer, intent(in) :: ymd ! Year, month, day YYYYMMDD - integer, intent(in) :: tod ! Time of day in seconds - character(len=*), intent(in) :: desc ! Description of time to set - - type(ESMF_Time) :: TimeSetymd ! Return value - - character(len=*), parameter :: sub = 'clm::TimeSetymd' - integer :: yr, mon, day ! Year, month, day as integers - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - if ( (ymd < 0) .or. (tod < 0) .or. (tod > isecspday) )then - write(iulog,*) sub//': error yymmdd is a negative number or time-of-day out of bounds', & - ymd, tod - call shr_sys_abort - end if - yr = ymd / 10000 - mon = (ymd - yr*10000) / 100 - day = ymd - yr*10000 - mon*100 - call ESMF_TimeSet( TimeSetymd, yy=yr, mm=mon, dd=day, s=tod, & - calendar=tm_cal, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeSet: setting '//trim(desc)) - end function TimeSetymd - - !========================================================================================= - - integer function TimeGetymd( date, tod ) - ! - ! Get the date and time of day in ymd from ESMF Time. - ! - type(ESMF_Time), intent(inout) :: date ! Input date to convert to ymd - integer, intent(out), optional :: tod ! Time of day in seconds - - character(len=*), parameter :: sub = 'clm::TimeGetymd' - integer :: yr, mon, day - integer :: rc ! return code - - call ESMF_TimeGet( date, yy=yr, mm=mon, dd=day, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - TimeGetymd = yr*10000 + mon*100 + day - if ( present( tod ) )then - call ESMF_TimeGet( date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - end if - if ( yr < 0 )then - write(iulog,*) sub//': error year is less than zero', yr - call shr_sys_abort - end if - end function TimeGetymd - - !========================================================================================= - - subroutine timemgr_restart_io( ncid, flag ) - - !--------------------------------------------------------------------------------- - ! Read/Write information needed on restart to a netcdf file. - use ncdio_pio, only: ncd_int, file_desc_t - use restUtilMod - ! - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*), intent(in) :: flag ! 'read' or 'write' - ! - ! Local variables - character(len=*), parameter :: sub = 'clm::timemgr_restart' - integer :: rc ! return code - logical :: readvar ! determine if variable is on initial file - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: ref_date ! reference date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - integer :: rst_caltype ! calendar type - integer, parameter :: noleap = 1 - integer, parameter :: gregorian = 2 - character(len=len(calendar)) :: cal - !--------------------------------------------------------------------------------- - - if (flag == 'write') then - rst_nstep_rad_prev = nstep_rad_prev - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_nstep_rad_prev', xtype=ncd_int, & - long_name='previous_radiation_nstep', units='unitless positive integer', & - ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_nstep_rad_prev) - if (flag == 'read') then - nstep_rad_prev = rst_nstep_rad_prev - end if - - if (flag == 'write') then - cal = to_upper(calendar) - if ( trim(cal) == NO_LEAP_C ) then - rst_caltype = noleap - else if ( trim(cal) == GREGORIAN_C ) then - rst_caltype = gregorian - else - call shr_sys_abort(sub//'ERROR: unrecognized calendar specified= '//trim(calendar)) - end if - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_type', xtype=ncd_int, & - long_name='calendar type', units='unitless', flag_meanings=(/ "NO_LEAP_C", "GREGORIAN" /), & - flag_values=(/ noleap, gregorian /), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_caltype) - if (flag == 'read') then - if ( rst_caltype == noleap ) then - calendar = NO_LEAP_C - else if ( rst_caltype == gregorian ) then - calendar = GREGORIAN_C - else - write(iulog,*)sub,': unrecognized calendar type in restart file: ',rst_caltype - call shr_sys_abort( sub//'ERROR: bad calendar type in restart file') - end if - end if - - if (flag == 'write') then - call ESMF_ClockGet( tm_clock, startTime=start_date, currTime=curr_date, refTime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - rst_step_sec = dtime - rst_start_ymd = TimeGetymd( start_date, tod=rst_start_tod ) - rst_ref_ymd = TimeGetymd( ref_date, tod=rst_ref_tod ) - rst_curr_ymd = TimeGetymd( curr_date, tod=rst_curr_tod ) - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_step_sec', xtype=ncd_int, & - long_name='seconds component of timestep size', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_step_sec) - if ((flag == 'read') .and. ( rst_step_sec < 0 .or. rst_step_sec > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_step_sec out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_start_ymd', xtype=ncd_int, & - long_name='start date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_start_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_start_tod', xtype=ncd_int, & - long_name='start time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_start_tod) - if ((flag == 'read') .and. ( rst_start_tod < 0 .or. rst_start_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_strart_tod out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_ref_ymd', xtype=ncd_int, & - long_name='reference date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_ref_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_ref_tod', xtype=ncd_int, & - long_name='reference time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_ref_tod) - if ((flag == 'read') .and. ( rst_start_tod < 0 .or. rst_start_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_ref_tod out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_curr_ymd', xtype=ncd_int, & - long_name='current date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_curr_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_curr_tod', xtype=ncd_int, & - long_name='current time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_curr_tod) - if ((flag == 'read') .and. ( rst_curr_tod < 0 .or. rst_curr_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_ref_ymd out of range') - end if - - end subroutine timemgr_restart_io - - !========================================================================================= - - subroutine timemgr_restart( ) - - !--------------------------------------------------------------------------------- - ! Restart the ESMF time manager using the synclock for ending date. - ! - character(len=*), parameter :: sub = 'clm::timemgr_restart' - integer :: rc ! return code - integer :: yr, mon, day, tod ! Year, month, day, and second as integers - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: ref_date ! reference date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: current ! current date (from clock) - type(ESMF_TimeInterval) :: day_step_size ! day step size - type(ESMF_TimeInterval) :: step_size ! timestep size - logical :: run_length_specified = .false. - !--------------------------------------------------------------------------------- - call timemgr_spmdbcast( ) - - ! Initialize calendar from restart info - - call init_calendar() - - ! Initialize the timestep from restart info - - dtime = rst_step_sec - - ! Initialize start date from restart info - - start_date = TimeSetymd( rst_start_ymd, rst_start_tod, "start_date" ) - - ! Initialize current date from restart info - - curr_date = TimeSetymd( rst_curr_ymd, rst_curr_tod, "curr_date" ) - - ! Initialize stop date from sync clock or namelist input - - stop_date = TimeSetymd( 99991231, stop_tod, "stop_date" ) - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - call ESMF_TimeIntervalSet( day_step_size, d=1, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting day_step_size') - - if ( stop_ymd /= uninit_int ) then - current = TimeSetymd( stop_ymd, stop_tod, "stop_date" ) - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - else if ( nelapse /= uninit_int ) then - if ( nelapse >= 0 ) then - current = curr_date + step_size*nelapse - else - current = curr_date - day_step_size*nelapse - end if - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( .not. run_length_specified ) then - call shr_sys_abort (sub//': Must specify stop_ymd or nelapse') - end if - - ! Error check - - if ( stop_date <= start_date ) then - write(iulog,*)sub, ': stop date must be specified later than start date: ' - call ESMF_TimeGet( start_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Start date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - if ( curr_date >= stop_date ) then - write(iulog,*)sub, ': stop date must be specified later than current date: ' - call ESMF_TimeGet( curr_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Current date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - - ! Initialize nstep_rad_prev from restart info - - nstep_rad_prev = rst_nstep_rad_prev - - ! Initialize ref date from restart info - - ref_date = TimeSetymd( rst_ref_ymd, rst_ref_tod, "ref_date" ) - - ! Initialize clock - - call init_clock( start_date, ref_date, curr_date, stop_date ) - - ! Advance the timestep. - ! Data from the restart file corresponds to the last timestep of the previous run. - - call advance_timestep() - - ! Set flag that this is the first timestep of the restart run. - - tm_first_restart_step = .true. - - ! Calculate ending time step - - call calc_nestep( ) - - ! Print configuration summary to log file (stdout). - - if (masterproc) call timemgr_print() - - timemgr_set = .true. - - end subroutine timemgr_restart - - !========================================================================================= - - subroutine calc_nestep() - !--------------------------------------------------------------------------------- - ! - ! Calculate ending timestep number - ! Calculation of ending timestep number (nestep) assumes a constant stepsize. - ! - character(len=*), parameter :: sub = 'clm::calc_nestep' - integer :: ntspday ! Number of time-steps per day - type(ESMF_TimeInterval) :: diff ! - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - integer :: ndays, nsecs ! Number of days, seconds to ending time - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, stopTime=stop_date, startTime=start_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - ntspday = isecspday/dtime - diff = stop_date - start_date - call ESMF_TimeIntervalGet( diff, d=ndays, s=nsecs, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet calculating nestep') - nestep = ntspday*ndays + nsecs/dtime - if ( mod(nsecs,dtime) /= 0 ) nestep = nestep + 1 - end subroutine calc_nestep - - !========================================================================================= - - subroutine init_calendar( ) - - !--------------------------------------------------------------------------------- - ! Initialize calendar - ! - ! Local variables - ! - character(len=*), parameter :: sub = 'clm::init_calendar' - type(ESMF_CalKind_Flag) :: cal_type ! calendar type - character(len=len(calendar)) :: caltmp - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - caltmp = to_upper(calendar) - if ( trim(caltmp) == NO_LEAP_C ) then - cal_type = ESMF_CALKIND_NOLEAP - else if ( trim(caltmp) == GREGORIAN_C ) then - cal_type = ESMF_CALKIND_GREGORIAN - else - write(iulog,*)sub,': unrecognized calendar specified: ',calendar - call shr_sys_abort - end if - tm_cal = ESMF_CalendarCreate( name=caltmp, calkindflag=cal_type, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_CalendarSet') - end subroutine init_calendar - - !========================================================================================= - - subroutine timemgr_print() - - !--------------------------------------------------------------------------------- - character(len=*), parameter :: sub = 'clm::timemgr_print' - integer :: rc - integer :: yr, mon, day - integer :: & ! Data required to restart time manager: - nstep = uninit_int, &! current step number - step_sec = uninit_int, &! timestep size seconds - start_yr = uninit_int, &! start year - start_mon = uninit_int, &! start month - start_day = uninit_int, &! start day of month - start_tod = uninit_int, &! start time of day - stop_yr = uninit_int, &! stop year - stop_mon = uninit_int, &! stop month - stop_day = uninit_int, &! stop day of month - stop_tod = uninit_int, &! stop time of day - ref_yr = uninit_int, &! reference year - ref_mon = uninit_int, &! reference month - ref_day = uninit_int, &! reference day of month - ref_tod = uninit_int, &! reference time of day - curr_yr = uninit_int, &! current year - curr_mon = uninit_int, &! current month - curr_day = uninit_int, &! current day of month - curr_tod = uninit_int ! current time of day - integer(ESMF_KIND_I8) :: step_no - type(ESMF_Time) :: start_date! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - type(ESMF_Time) :: ref_date ! reference date - type(ESMF_TimeInterval) :: step ! Time-step - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, startTime=start_date, currTime=curr_date, & - refTime=ref_date, stopTime=stop_date, timeStep=step, & - advanceCount=step_no, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - nstep = step_no - - write(iulog,*)' ******** CLM Time Manager Configuration ********' - - call ESMF_TimeIntervalGet( step, s=step_sec, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - - call ESMF_TimeGet( start_date, yy=start_yr, mm=start_mon, dd=start_day, & - s=start_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( stop_date, yy=stop_yr, mm=stop_mon, dd=stop_day, & - s=stop_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( ref_date, yy=ref_yr, mm=ref_mon, dd=ref_day, s=ref_tod, & - rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( curr_date, yy=curr_yr, mm=curr_mon, dd=curr_day, & - s=curr_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - write(iulog,*)' Calendar type: ',trim(calendar) - write(iulog,*)' Timestep size (seconds): ', step_sec - write(iulog,*)' Start date (yr mon day tod): ', start_yr, start_mon, & - start_day, start_tod - write(iulog,*)' Stop date (yr mon day tod): ', stop_yr, stop_mon, & - stop_day, stop_tod - write(iulog,*)' Reference date (yr mon day tod): ', ref_yr, ref_mon, & - ref_day, ref_tod - write(iulog,*)' Current step number: ', nstep - write(iulog,*)' Ending step number: ', nestep - write(iulog,*)' Current date (yr mon day tod): ', curr_yr, curr_mon, & - curr_day, curr_tod - - if ( tm_perp_calendar ) then - call ESMF_TimeGet( tm_perp_date, yy=yr, mm=mon, dd=day, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - write(iulog,*)' Use perpetual diurnal cycle date (yr mon day): ', & - yr, mon, day - end if - - write(iulog,*)' ************************************************' - - end subroutine timemgr_print - - !========================================================================================= - - subroutine advance_timestep() - - ! Increment the timestep number. - - character(len=*), parameter :: sub = 'clm::advance_timestep' - integer :: rc - - call ESMF_ClockAdvance( tm_clock, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockAdvance') - - tm_first_restart_step = .false. - - end subroutine advance_timestep - - !========================================================================================= - - subroutine get_clock( clock ) - - ! Return the ESMF clock - - type(ESMF_Clock), intent(inout) :: clock - - character(len=*), parameter :: sub = 'clm::get_clock' - type(ESMF_TimeInterval) :: step_size - type(ESMF_Time) :: start_date, stop_date, ref_date - integer :: rc - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, timeStep=step_size, startTime=start_date, & - stoptime=stop_date, reftime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - call ESMF_ClockSet(clock, timeStep=step_size, startTime=start_date, & - stoptime=stop_date, reftime=ref_date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockSet') - - end subroutine get_clock - - !========================================================================================= - - function get_curr_ESMF_Time( ) - - ! Return the current time as ESMF_Time - - type(ESMF_Time) :: get_curr_ESMF_Time - character(len=*), parameter :: sub = 'clm::get_curr_ESMF_Time' - integer :: rc - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, currTime=get_curr_ESMF_Time, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - end function get_curr_ESMF_Time - - !========================================================================================= - - integer function get_step_size() - - ! Return the step size in seconds. - - character(len=*), parameter :: sub = 'clm::get_step_size' - type(ESMF_TimeInterval) :: step_size ! timestep size - integer :: rc - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, timeStep=step_size, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeIntervalGet(step_size, s=get_step_size, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockTimeIntervalGet') - - end function get_step_size - - !========================================================================================= - - real(r8) function get_step_size_real() - - ! Return the step size in seconds, as a real value - - get_step_size_real = real(get_step_size(), r8) - - end function get_step_size_real - - !========================================================================================= - - subroutine update_DA_nstep() - ! Update the Data Assimulation time-step to the current time step, since DA has been done - DA_nstep = get_nstep() - end subroutine update_DA_nstep - - !========================================================================================= - - subroutine update_rad_dtime(doalb) - !--------------------------------------------------------------------------------- - ! called only on doalb timesteps to save off radiation nsteps - ! - ! Local Arguments - logical,intent(in) :: doalb - integer :: dtime,nstep - - if (doalb) then - - dtime=get_step_size() - nstep = get_nstep() - - if (nstep_rad_prev == uninit_int ) then - dtime_rad = dtime - nstep_rad_prev = nstep - else - dtime_rad = (nstep - nstep_rad_prev) * dtime - nstep_rad_prev = nstep - endif - end if - end subroutine update_rad_dtime - - !========================================================================================= - - integer function get_rad_step_size() - - character(len=*), parameter :: sub = 'clm::get_rad_step_size' - - call check_timemgr_initialized(sub) - - if (nstep_rad_prev == uninit_int ) then - get_rad_step_size=get_step_size() - else - get_rad_step_size=dtime_rad - end if - - end function get_rad_step_size - - !========================================================================================= - - integer function get_nstep() - - ! Return the timestep number. - - character(len=*), parameter :: sub = 'clm::get_nstep' - integer :: rc - integer(ESMF_KIND_I8) :: step_no - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, advanceCount=step_no, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - get_nstep = step_no - - end function get_nstep - - !========================================================================================= - - integer function get_nstep_since_startup_or_lastDA_restart_or_pause() - - ! Return the number of time-steps since the restart file was modified - - character(len=*), parameter :: sub = 'clm::get_nstep_since_rest_mod' - - get_nstep_since_startup_or_lastDA_restart_or_pause = get_nstep() - DA_nstep - - end function get_nstep_since_startup_or_lastDA_restart_or_pause - - !========================================================================================= - - subroutine get_curr_date(yr, mon, day, tod, offset) - - !----------------------------------------------------------------------------------------- - ! Return date components valid at end of current timestep with an optional - ! offset (positive or negative) in seconds. - - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_curr_date' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: off - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - if (present(offset)) then - if (offset > 0) then - call ESMF_TimeIntervalSet( off, s=offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + off - else if (offset < 0) then - call ESMF_TimeIntervalSet( off, s=-offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date - off - end if - end if - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_curr_date - - !========================================================================================= - - subroutine get_perp_date(yr, mon, day, tod, offset) - - !----------------------------------------------------------------------------------------- - ! Return time of day valid at end of current timestep and the components - ! of the perpetual date (with an optional offset (positive or negative) in seconds. - - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_perp_date' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: DelTime - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - ! Get time of day add it to perpetual date - ! Get year, month, day so that seconds are time-of-day rather than since start time - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeIntervalSet(DelTime, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = tm_perp_date + DelTime - if ( present(offset) )then - call ESMF_TimeIntervalSet(DelTime, s=offset, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + DelTime - end if - ! Get time of day from the result - ! Get year, month, day so that seconds are time-of-day rather than since start time - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - - ! Get the date from the fixed perpetual date (in case it overflows to next day) - call ESMF_TimeGet(tm_perp_date, yy=yr, mm=mon, dd=day, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_perp_date - - !========================================================================================= - - subroutine get_prev_date(yr, mon, day, tod) - - ! Return date components valid at beginning of current timestep. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_prev_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, prevTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_prev_date - - !========================================================================================= - - subroutine get_start_date(yr, mon, day, tod) - - ! Return date components valid at beginning of initial run. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_start_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, startTime=date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_start_date - - !========================================================================================= - - integer function get_driver_start_ymd( tod ) - - ! Return date of start of simulation from driver (i.e. NOT from restart file) - ! Note: get_start_date gets you the date from the beginning of the simulation - ! on the restart file. - - ! Arguments - integer, optional, intent(out) ::& - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_driver_start_ymd' - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - if ( start_ymd == uninit_int )then - call shr_sys_abort( sub//': error driver start date is NOT set yet' ) - end if - if ( start_ymd < 101 .or. start_ymd > 99991231 )then - call shr_sys_abort( sub//': error driver start date is invalid' ) - end if - if ( present(tod) )then - tod = start_tod - if ( (tod < 0) .or. (tod > isecspday) )then - call shr_sys_abort( sub//': error driver start tod is invalid' ) - end if - end if - get_driver_start_ymd = start_ymd - - end function get_driver_start_ymd - - !========================================================================================= - - subroutine get_ref_date(yr, mon, day, tod) - - ! Return date components of the reference date. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_ref_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, refTime=date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_ref_date - - !========================================================================================= - - subroutine get_curr_time(days, seconds) - - ! Return time components valid at end of current timestep. - ! Current time is the time interval between the current date and the reference date. - - ! Arguments - integer, intent(out) ::& - days, &! number of whole days in time interval - seconds ! remaining seconds in time interval - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_curr_time' - integer :: rc - type(ESMF_Time) :: cdate, rdate - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, currTime=cdate, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_ClockGet( tm_clock, refTime=rdate, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - diff = cdate - rdate - - call ESMF_TimeIntervalGet(diff, d=days, s=seconds, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - - end subroutine get_curr_time - - !========================================================================================= - - subroutine get_prev_time(days, seconds) - - ! Return time components valid at beg of current timestep. - ! prev time is the time interval between the prev date and the reference date. - - ! Arguments - integer, intent(out) ::& - days, &! number of whole days in time interval - seconds ! remaining seconds in time interval - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_prev_time' - integer :: rc - type(ESMF_Time) :: date, ref_date - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet(tm_clock, prevTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet for prevTime') - call ESMF_ClockGet(tm_clock, refTime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet for refTime') - diff = date - ref_date - call ESMF_TimeIntervalGet( diff, d=days, s=seconds, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeintervalGet') - - end subroutine get_prev_time - - !========================================================================================= - - function get_curr_calday(offset) - - ! Return calendar day at end of current timestep with optional offset. - ! Calendar day 1.0 = 0Z on Jan 1. - - ! Arguments - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - ! Return value - real(r8) :: get_curr_calday - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_curr_calday' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: off, diurnal - integer :: year, month, day, tod - !----------------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - if (present(offset)) then - if (offset > 0) then - call ESMF_TimeIntervalSet( off, s=offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + off - else if (offset < 0) then - call ESMF_TimeIntervalSet( off, s=-offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date - off - end if - end if - - if ( tm_perp_calendar ) then - call ESMF_TimeGet(date, yy=year, mm=month, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeIntervalSet( diurnal, s=tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = tm_perp_date + diurnal - end if - - call ESMF_TimeGet( date, dayOfYear_r8=get_curr_calday, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - !----------------------------------------------------------------------------------------! - !!!!!!!!!!!!!! WARNING HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!! - !!!! The following hack fakes day 366 by reusing day 365. This is just because the !!!!!! - !!!! current shr_orb_decl calculation can't handle days > 366. !!!!!! - !!!! Dani Bundy-Coleman and Erik Kluzek Aug/2008 !!!!!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if ( (get_curr_calday > 366.0) .and. (get_curr_calday <= 367.0) .and. & - (trim(calendar) == GREGORIAN_C) )then - get_curr_calday = get_curr_calday - 1.0_r8 - end if - !!!!!!!!!!!!!! END HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!!!!!! - !----------------------------------------------------------------------------------------! - if ( (get_curr_calday < 1.0) .or. (get_curr_calday > 366.0) )then - write(iulog,*) sub, ' = ', get_curr_calday - if ( present(offset) ) write(iulog,*) 'offset = ', offset - call shr_sys_abort( sub//': error get_curr_calday out of bounds' ) - end if - - end function get_curr_calday - - !========================================================================================= - - function get_calday(ymd, tod) - - ! Return calendar day corresponding to specified time instant. - ! Calendar day 1.0 = 0Z on Jan 1. - - ! Arguments - integer, intent(in) :: & - ymd, &! date in yearmmdd format - tod ! time of day (seconds past 0Z) - - ! Return value - real(r8) :: get_calday - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_calday' - integer :: rc ! return code - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - date = TimeSetymd( ymd, tod, "get_calday" ) - call ESMF_TimeGet( date, dayOfYear_r8=get_calday, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - !----------------------------------------------------------------------------------------! -!!!!!!!!!!!!!! WARNING HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!! -!!!! The following hack fakes day 366 by reusing day 365. This is just because the !!!!!! -!!!! current shr_orb_decl calculation can't handle days > 366. !!!!!! -!!!! Dani Bundy-Coleman and Erik Kluzek Aug/2008 !!!!!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if ( (get_calday > 366.0) .and. (get_calday <= 367.0) .and. & - (trim(calendar) == GREGORIAN_C) )then - get_calday = get_calday - 1.0_r8 - end if -!!!!!!!!!!!!!! END HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!!!!!! - !----------------------------------------------------------------------------------------! - if ( (get_calday < 1.0) .or. (get_calday > 366.0) )then - write(iulog,*) sub, ' = ', get_calday - call shr_sys_abort( sub//': error calday out of range' ) - end if - - end function get_calday - - !========================================================================================= - - function get_calendar() - - ! Return calendar - - ! Return value - character(len=ESMF_MAXSTR) :: get_calendar - - get_calendar = calendar - - end function get_calendar - - !========================================================================================= - - integer function get_days_per_year( offset ) - - !--------------------------------------------------------------------------------- - ! Get the number of days per year for currrent year - - ! - ! Arguments - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_days_per_year' - integer :: yr, mon, day, tod ! current date year, month, day and time-of-day - type(ESMF_Time) :: eDate ! ESMF date - integer :: rc ! ESMF return code - !--------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - if ( present(offset) )then - call get_curr_date(yr, mon, day, tod, offset ) - else - call get_curr_date(yr, mon, day, tod ) - end if - eDate = TimeSetymd( ymd=yr*10000+1231, tod=0, desc="end of year" ) - call ESMF_TimeGet( eDate, dayOfYear=get_days_per_year, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end function get_days_per_year - - !========================================================================================= - - function get_curr_yearfrac( offset ) - - !--------------------------------------------------------------------------------- - ! Get the fractional position in the current year, as of the end of the current - ! timestep. This is 0 at midnight on Jan 1, and 1 at the end of Dec 31. - - ! - ! Arguments - real(r8) :: get_curr_yearfrac ! function result - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_curr_yearfrac' - real(r8) :: cday ! current calendar day (1.0 = 0Z on Jan 1) - real(r8) :: days_per_year ! days per year - - call check_timemgr_initialized(sub) - - cday = get_curr_calday(offset=offset) - days_per_year = get_days_per_year() - - get_curr_yearfrac = (cday - 1._r8)/days_per_year - - end function get_curr_yearfrac - - !========================================================================================= - - function get_prev_yearfrac() - - !--------------------------------------------------------------------------------- - ! Get the fractional position in the current year, as of the beginning of the current - ! timestep. This is 0 at midnight on Jan 1, and 1 at the end of Dec 31. - - ! - ! Arguments - real(r8) :: get_prev_yearfrac ! function result - - character(len=*), parameter :: sub = 'clm::get_curr_yearfrac' - - call check_timemgr_initialized(sub) - - get_prev_yearfrac = get_curr_yearfrac(offset = -dtime) - - end function get_prev_yearfrac - - - !========================================================================================= - - subroutine get_rest_date(ncid, yr) - - !--------------------------------------------------------------------------------- - ! Get the date from the restart file. - ! - ! Currently just returns the year (because the month & day are harder to extract, and - ! currently aren't needed). - use ncdio_pio, only: ncd_io, file_desc_t - ! - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf id for the restart file - integer , intent(out) :: yr ! year from restart file - - integer :: ymd ! yyyymmdd from the restart file - logical :: readvar ! whether the variable was read from the file - - integer, parameter :: year_mask = 10000 ! divide by this to get year from ymd - - character(len=*), parameter :: subname = 'get_rest_date' - !----------------------------------------------------------------------- - - ! Get the date (yyyymmdd) from restart file. - ! Note that we cannot simply use the rst_curr_ymd module variable, because that isn't - ! set under some circumstances - call ncd_io(varname='timemgr_rst_curr_ymd', data=ymd, & - ncid=ncid, flag='read', readvar=readvar) - if (.not. readvar) then - call shr_sys_abort(subname//' ERROR: timemgr_rst_curr_ymd not found on restart file') - end if - - ! Extract the year - yr = ymd / year_mask - end subroutine get_rest_date - - !========================================================================================= - - subroutine set_nextsw_cday( nextsw_cday_in ) - - ! Set the next radiation calendar day, so that radiation step can be calculated - ! - ! Arguments - real(r8), intent(IN) :: nextsw_cday_in ! input calday of next radiation computation - - character(len=*), parameter :: sub = 'clm::set_nextsw_cday' - - nextsw_cday = nextsw_cday_in - - end subroutine set_nextsw_cday - - !========================================================================================= - - function is_beg_curr_day() - - ! Return true if current timestep is first timestep in current day. - - ! Return value - logical :: is_beg_curr_day - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - character(len=*), parameter :: sub = 'clm::is_beg_curr_day' - - call check_timemgr_initialized(sub) - - call get_curr_date(yr, mon, day, tod) - is_beg_curr_day = ( tod == dtime ) - - end function is_beg_curr_day - - !========================================================================================= - - function is_end_curr_day() - - !--------------------------------------------------------------------------------- - ! Return true if current timestep is last timestep in current day. - - ! Return value - logical :: is_end_curr_day - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - character(len=*), parameter :: sub = 'clm::is_end_curr_day' - !--------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call get_curr_date(yr, mon, day, tod) - is_end_curr_day = (tod == 0) - - end function is_end_curr_day - - !========================================================================================= - - logical function is_end_curr_month() - - !--------------------------------------------------------------------------------- - ! Return true if current timestep is last timestep in current month. - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - character(len=*), parameter :: sub = 'clm::is_end_curr_month' - !--------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call get_curr_date(yr, mon, day, tod) - is_end_curr_month = (day == 1 .and. tod == 0) - - end function is_end_curr_month - - !----------------------------------------------------------------------- - logical function is_beg_curr_year() - ! - ! !DESCRIPTION: - ! Return true if current timestep is first timestep in current year. - ! - ! !LOCAL VARIABLES: - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - character(len=*), parameter :: subname = 'is_beg_curr_year' - !----------------------------------------------------------------------- - - call check_timemgr_initialized(subname) - - call get_curr_date(yr, mon, day, tod) - is_beg_curr_year = (mon == 1 .and. day == 1 .and. tod == dtime) - - end function is_beg_curr_year - - !----------------------------------------------------------------------- - logical function is_end_curr_year() - ! - ! !DESCRIPTION: - ! Return true if current timestep is last timestep in current year. - ! - ! !LOCAL VARIABLES: - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - character(len=*), parameter :: subname = 'is_end_curr_year' - !----------------------------------------------------------------------- - - call check_timemgr_initialized(subname) - - call get_curr_date(yr, mon, day, tod) - is_end_curr_year = (mon == 1 .and. day == 1 .and. tod == 0) - - end function is_end_curr_year - - - !========================================================================================= - - logical function is_first_step() - - !--------------------------------------------------------------------------------- - ! Return true on first step of initial run only. - - ! Local variables - character(len=*), parameter :: sub = 'clm::is_first_step' - integer :: rc - integer :: nstep - integer(ESMF_KIND_I8) :: step_no - !--------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, advanceCount=step_no, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - nstep = step_no - is_first_step = (nstep == 0) - - end function is_first_step - !========================================================================================= - - logical function is_first_restart_step() - - ! Return true on first step of restart or branch run only. - character(len=*), parameter :: sub = 'clm::is_first_restart_step' - - call check_timemgr_initialized(sub) - - is_first_restart_step = tm_first_restart_step - - end function is_first_restart_step - - !========================================================================================= - - logical function is_first_step_of_this_run_segment() - - ! Return true if this is the first step of this run segment. This will be true for - ! the first step of a startup, restart or branch run. - character(len=*), parameter :: sub = 'clm::is_first_step_of_this_run_segment' - - call check_timemgr_initialized(sub) - - is_first_step_of_this_run_segment = (is_first_step() .or. is_first_restart_step()) - - end function is_first_step_of_this_run_segment - - !========================================================================================= - - logical function is_last_step() - - !--------------------------------------------------------------------------------- - ! Return true on last timestep. - - ! Local variables - character(len=*), parameter :: sub = 'clm::is_last_step' - type(ESMF_Time) :: stop_date - type(ESMF_Time) :: curr_date - type(ESMF_TimeInterval) :: time_step - integer :: rc - !--------------------------------------------------------------------------------- - - call check_timemgr_initialized(sub) - - call ESMF_ClockGet( tm_clock, stopTime=stop_date, & - currTime=curr_date, TimeStep=time_step, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - if ( curr_date+time_step > stop_date ) then - is_last_step = .true. - else - is_last_step = .false. - end if - - end function is_last_step - - !========================================================================================= - - logical function is_perpetual() - - ! Return true on last timestep. - character(len=*), parameter :: sub = 'clm::is_perpetual' - - call check_timemgr_initialized(sub) - - is_perpetual = tm_perp_calendar - - end function is_perpetual - - !========================================================================================= - - subroutine timemgr_datediff(ymd1, tod1, ymd2, tod2, days) - - ! Calculate the difference (ymd2,tod2) - (ymd1,tod1) and return the result in days. - ! Arguments - integer, intent(in) ::& - ymd1, &! date1 in yyyymmdd format - tod1, &! time of day relative to date1 (seconds past 0Z) - ymd2, &! date2 in yyyymmdd format - tod2 ! time of day relative to date2 (seconds past 0Z) - - real(r8) :: days ! (ymd2,tod2)-(ymd1,tod1) in days - - ! Local variables - character(len=*), parameter :: sub = 'clm::timemgr_datediff' - integer :: rc ! return code - - type(ESMF_Time) :: date1 - type(ESMF_Time) :: date2 - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - date1 = TimeSetymd( ymd1, tod1, "date1" ) - date2 = TimeSetymd( ymd2, tod2, "date2" ) - diff = date2 - date1 - call ESMF_TimeIntervalGet( diff, d_r8=days, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - days = days + 1.0_r8 - - end subroutine timemgr_datediff - - !========================================================================================= - - subroutine chkrc(rc, mes) - integer, intent(in) :: rc ! return code from time management library - character(len=*), intent(in) :: mes ! error message - if ( rc == ESMF_SUCCESS ) return - write(iulog,*) mes - call shr_sys_abort ('CHKRC') - end subroutine chkrc - - !========================================================================================= - - function to_upper(str) - - !--------------------------------------------------------------------------------- - ! Convert character string to upper case. Use achar and iachar intrinsics - ! to ensure use of ascii collating sequence. - ! - ! !INPUT PARAMETERS: - character(len=*), intent(in) :: str ! String to convert to upper case - ! !RETURN VALUE: - character(len=len(str)) :: to_upper - ! !LOCAL VARIABLES: - integer :: i ! Index - integer :: aseq ! ascii collating sequence - character(len=1) :: ctmp ! Character temporary - !--------------------------------------------------------------------------------- - - do i = 1, len(str) - ctmp = str(i:i) - aseq = iachar(ctmp) - if ( aseq >= 97 .and. aseq <= 122 ) ctmp = achar(aseq - 32) - to_upper(i:i) = ctmp - end do - - end function to_upper - - !========================================================================================= - - logical function is_restart( ) - ! Determine if restart run - use clm_varctl, only : nsrest, nsrContinue - if (nsrest == nsrContinue) then - is_restart = .true. - else - is_restart = .false. - end if - end function is_restart - - !========================================================================================= - - subroutine timemgr_spmdbcast( ) - - use spmdMod , only : mpicom, MPI_INTEGER - use shr_mpi_mod, only : shr_mpi_bcast - - integer :: ier - - call shr_mpi_bcast (dtime, mpicom) - - end subroutine timemgr_spmdbcast - - !========================================================================================= - - subroutine check_timemgr_initialized(caller) - ! - ! !DESCRIPTION: - ! Checks if the time manager has been initialized. If not, aborts with an error - ! message. - ! - ! !USES: - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: caller ! name of calling routine - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'check_timemgr_initialized' - !----------------------------------------------------------------------- - - if (.not. timemgr_set) then - call shr_sys_abort(trim(caller)//":: Time manager has not been initialized") - end if - - end subroutine check_timemgr_initialized - - !----------------------------------------------------------------------- - subroutine timemgr_reset() - ! - ! !DESCRIPTION: - ! Reset time manager module data to default values. - ! - ! All unit tests that modify the time manager should call this routine in their - ! teardown section. - ! - ! Note: we could probably get away with doing much less resetting than is currently - ! done here. For example, we could simply set timemgr_set = .false., and deallocate - ! anything that needs deallocation. That would provide the benefit of less - ! maintenance, at the cost of slightly less robustness (in case some variable isn't - ! set in the initialization of a unit test, either because the unit test forgets to - ! call the time manager initialization method, or because the initialization method - ! does not explicitly initialize all variables). - ! - ! !USES: - ! - ! !ARGUMENTS: - ! - ! !LOCAL VARIABLES: - integer :: rc ! return code - - character(len=*), parameter :: sub = 'timemgr_reset' - !----------------------------------------------------------------------- - - ! ------------------------------------------------------------------------ - ! The values in the following section should match the initialization values given in - ! the variable declarations at the top of the module. - ! - ! Note: it would be easier to ensure this match if we introduced a time manager - ! derived type, which had default initialization of its components. Then this routine - ! could simply set to time manager instance to a new instance of the derived type. - ! ------------------------------------------------------------------------ - - calendar = NO_LEAP_C - - dtime = uninit_int - dtime_rad = uninit_int - nstep_rad_prev = uninit_int - - nelapse = uninit_int - start_ymd = uninit_int - start_tod = 0 - stop_ymd = uninit_int - stop_tod = 0 - ref_ymd = uninit_int - ref_tod = 0 - - rst_step_sec = uninit_int - rst_start_ymd = uninit_int - rst_start_tod = uninit_int - rst_ref_ymd = uninit_int - rst_ref_tod = uninit_int - rst_curr_ymd = uninit_int - rst_curr_tod = uninit_int - - ! note that rst_nstep_rad_prev is NOT initialized in its declaration - rst_nstep_rad_prev = uninit_int - perpetual_ymd = uninit_int - tm_first_restart_step = .false. - tm_perp_calendar = .false. - timemgr_set = .false. - nestep = uninit_int - - nextsw_cday = uninit_r8 - - ! ------------------------------------------------------------------------ - ! Reset other module-level variables to some reasonable default, to ensure that they - ! don't carry over any state from one unit test to the next. - ! ------------------------------------------------------------------------ - - ! Reset tm_cal - call init_calendar() - - ! Reset portions of the clock. Note that this does not fully reset the clock, and so - ! there is still the potential for information in the clock to carry over to the next - ! unit test if the next test does not properly initialize things. - call ESMF_ClockDestroy(tm_clock, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockDestroy') - - ! Note that we do NOT currently reset tm_perp_date, because it's unclear what that - ! should be reset to. Thus, there is potential for its information to carry over to - ! the next unit test if the next test does not properly initialize things. - - end subroutine timemgr_reset - - ! ======================================================================== - ! The following routines are meant to be used just in unit tests - ! ======================================================================== - - !----------------------------------------------------------------------- - subroutine for_test_set_curr_date(yr, mon, day, tod) - ! - ! !DESCRIPTION: - ! Sets the current date - i.e., the date at the end of the time step - ! - ! *** Should only be used in unit tests!!! *** - ! - ! !USES: - ! - ! !ARGUMENTS: - integer, intent(in) :: yr ! year - integer, intent(in) :: mon ! month - integer, intent(in) :: day ! day of month - integer, intent(in) :: tod ! time of day (seconds past 0Z) - ! - ! !LOCAL VARIABLES: - type(ESMF_Time) :: my_time ! ESMF Time corresponding to the inputs - integer :: rc ! return code - - character(len=*), parameter :: sub = 'for_test_set_curr_date' - !----------------------------------------------------------------------- - - call ESMF_TimeSet(my_time, yy=yr, mm=mon, dd=day, s=tod, & - calendar=tm_cal, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeSet') - - call ESMF_ClockSet(tm_clock, CurrTime=my_time, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockSet') - - end subroutine for_test_set_curr_date - - -end module clm_time_manager diff --git a/src/utils/clm_varorb.F90 b/src/utils/clm_varorb.F90 deleted file mode 100644 index 47bf51e576..0000000000 --- a/src/utils/clm_varorb.F90 +++ /dev/null @@ -1,17 +0,0 @@ - -module clm_varorb - - use shr_kind_mod , only: r8 => shr_kind_r8 - implicit none - - ! Orbital information needed as input to orbit_parms - - real(r8) :: eccen ! Earth's eccentricity factor (unitless) (typically 0 to 0.1) - - ! Orbital information after processed by orbit_params - - real(r8) :: obliqr ! Earth's obliquity in radians - real(r8) :: lambm0 ! Mean longitude of perihelion at the vernal equinox (radians) - real(r8) :: mvelpp ! Earth's moving vernal equinox longitude of perihelion plus pi (radians) - -end module clm_varorb diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 deleted file mode 100644 index fbbfbf99ea..0000000000 --- a/src/utils/clmfates_interfaceMod.F90 +++ /dev/null @@ -1,2379 +0,0 @@ -module CLMFatesInterfaceMod - - ! ------------------------------------------------------------------------------------- - ! This module contains various functions and definitions to aid in the - ! coupling of the FATES library/API with the CLM/ALM/ATS/etc model driver. - ! All connections between the two models should occur in this file alone. - ! - ! This is also the only location where CLM code is allowed to see FATES memory - ! structures. - ! The routines here, that call FATES library routines, will not pass any types defined - ! by the driving land model (HLM). - ! - ! either native type arrays (int,real,log, etc) or packed into fates boundary condition - ! structures. - ! - ! Note that CLM/ALM does use Shared Memory Parallelism (SMP), where processes such as - ! the update of state variables are forked. However, IO is not assumed to be - ! threadsafe and therefore memory spaces reserved for IO must be continuous vectors, - ! and moreover they must be pushed/pulled from history IO for each individual - ! bounds_proc memory space as a unit. - ! - ! Therefore, the state variables in the clm_fates communicator is vectorized by - ! threadcount, and the IO communication arrays are not. - ! - ! - ! Conventions: - ! keep line widths within 90 spaces - ! HLM acronym = Host Land Model - ! - ! ------------------------------------------------------------------------------------- - - ! use ed_driver_interface, only: - - ! Used CLM Modules - use PatchType , only : patch - use shr_kind_mod , only : r8 => shr_kind_r8 - use decompMod , only : bounds_type - use WaterStateType , only : waterstate_type - use WaterFluxType , only : waterflux_type - use CanopyStateType , only : canopystate_type - use TemperatureType , only : temperature_type - use EnergyFluxType , only : energyflux_type - - use SoilStateType , only : soilstate_type - use clm_varctl , only : iulog - use clm_varctl , only : use_vertsoilc - use clm_varctl , only : use_fates_spitfire - use clm_varctl , only : use_fates_planthydro - use clm_varctl , only : use_fates_ed_st3 - use clm_varctl , only : use_fates_ed_prescribed_phys - use clm_varctl , only : use_fates_logging - use clm_varctl , only : use_fates_inventory_init - use clm_varctl , only : fates_inventory_ctrl_filename - - use clm_varcon , only : tfrz - use clm_varcon , only : spval - use clm_varcon , only : denice - use clm_varcon , only : ispval - - use clm_varpar , only : natpft_size - use clm_varpar , only : numrad - use clm_varpar , only : ivis - use clm_varpar , only : inir - use clm_varpar , only : nlevgrnd - use clm_varpar , only : nlevsoi - use clm_varpar , only : nlevdecomp - use clm_varpar , only : nlevdecomp_full - use PhotosynthesisMod , only : photosyns_type - use atm2lndType , only : atm2lnd_type - use SurfaceAlbedoType , only : surfalb_type - use SolarAbsorbedType , only : solarabs_type - use SoilBiogeochemCarbonFluxType, only : soilbiogeochem_carbonflux_type - use SoilBiogeochemCarbonStateType, only : soilbiogeochem_carbonstate_type - use FrictionVelocityMod , only : frictionvel_type - use clm_time_manager , only : is_restart - use ncdio_pio , only : file_desc_t, ncd_int, ncd_double - use restUtilMod, only : restartvar - use clm_time_manager , only : get_days_per_year, & - get_curr_date, & - get_ref_date, & - timemgr_datediff, & - is_beg_curr_day, & - get_step_size, & - get_nstep - use spmdMod , only : masterproc - use decompMod , only : get_proc_bounds, & - get_proc_clumps, & - get_clump_bounds - use GridCellType , only : grc - use ColumnType , only : col - use LandunitType , only : lun - use landunit_varcon , only : istsoil - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varcon , only : dzsoi_decomp - use FuncPedotransferMod, only: get_ipedof -! use SoilWaterPlantSinkMod, only : Compute_EffecRootFrac_And_VertTranSink_Default - - ! Used FATES Modules - use FatesInterfaceMod , only : fates_interface_type - use FatesInterfaceMod , only : allocate_bcin - use FatesInterfaceMod , only : allocate_bcout - use FatesInterfaceMod , only : SetFatesTime - use FatesInterfaceMod , only : set_fates_ctrlparms - - use FatesHistoryInterfaceMod, only : fates_history_interface_type - use FatesRestartInterfaceMod, only : fates_restart_interface_type - - use ChecksBalancesMod , only : SummarizeNetFluxes, FATES_BGC_Carbon_BalanceCheck - use EDTypesMod , only : ed_patch_type - use FatesHydraulicsMemMod , only : nlevsoi_hyd - use FatesInterfaceMod , only : hlm_numlevgrnd, hlm_numlevsoil, hlm_numlevdecomp_full - use EDMainMod , only : ed_ecosystem_dynamics - use EDMainMod , only : ed_update_site - use EDInitMod , only : zero_site - use EDInitMod , only : init_site_vars - use EDInitMod , only : init_patches - use EDInitMod , only : set_site_properties - use EDPftVarcon , only : EDpftvarcon_inst - use EDSurfaceRadiationMod , only : ED_SunShadeFracs, ED_Norman_Radiation - use EDBtranMod , only : btran_ed, & - get_active_suction_layers - use EDCanopyStructureMod , only : canopy_summarization, update_hlm_dynamics - use FatesPlantRespPhotosynthMod, only : FatesPlantRespPhotosynthDrive - use EDAccumulateFluxesMod , only : AccumulateFluxes_ED - use EDPhysiologyMod , only : flux_into_litter_pools - use FatesPlantHydraulicsMod, only : hydraulics_drive - use FatesPlantHydraulicsMod, only : HydrSiteColdStart - use FatesPlantHydraulicsMod, only : InitHydrSites - use FatesPlantHydraulicsMod, only : UpdateH2OVeg - - implicit none - - type, public :: f2hmap_type - - ! This is the associated column index of each FATES site - integer, allocatable :: fcolumn (:) - - ! This is the associated site index of any HLM columns - ! This vector may be sparse, and non-sites have index 0 - integer, allocatable :: hsites (:) - - end type f2hmap_type - - - type, public :: hlm_fates_interface_type - - ! private - - - ! See above for descriptions of the sub-types populated - ! by thread. This type is somewhat self-explanatory, in that it simply - ! breaks up memory and process by thread. Each thread will have its - ! own list of sites, and boundary conditions for those sites - - type(fates_interface_type), allocatable :: fates (:) - - - ! This memory structure is used to map fates sites - ! into the host model. Currently, the FATES site - ! and its column number matching are its only members - - type(f2hmap_type), allocatable :: f2hmap(:) - - ! fates_hist is the interface class for the history output - type(fates_history_interface_type) :: fates_hist - - ! fates_restart is the inteface calss for restarting the model - type(fates_restart_interface_type) :: fates_restart - - contains - - procedure, public :: init - procedure, public :: check_hlm_active - procedure, public :: restart - procedure, public :: init_coldstart - procedure, public :: dynamics_driv - procedure, public :: wrap_sunfrac - procedure, public :: wrap_btran - procedure, public :: wrap_photosynthesis - procedure, public :: wrap_accumulatefluxes - procedure, public :: prep_canopyfluxes - procedure, public :: wrap_canopy_radiation - procedure, public :: wrap_bgc_summary - procedure, public :: TransferZ0mDisp - procedure, private :: init_history_io - procedure, private :: wrap_update_hlmfates_dyn - procedure, private :: init_soil_depths - procedure, public :: ComputeRootSoilFlux - procedure, public :: wrap_hydraulics_drive - - end type hlm_fates_interface_type - - ! hlm_bounds_to_fates_bounds is not currently called outside the interface. - ! Although there may be good reasons to, I privatized it so that the next - ! developer will at least question its usage (RGK) - private :: hlm_bounds_to_fates_bounds - - logical :: DEBUG = .false. - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - ! ==================================================================================== - - subroutine init(this, bounds_proc ) - - ! --------------------------------------------------------------------------------- - ! This initializes the hlm_fates_interface_type - ! - ! sites is the root of the fates state hierarchy (instantaneous info on - ! the state of the ecosystem). As such, it governs the connection points between - ! the host (which also dictates its allocation) and its patch structures. - ! - ! sites may associate with different scales in different models. In - ! CLM, it is being designed to relate to column scale. - ! - ! This global may become relegated to this module. - ! - ! Note: CLM/ALM currently wants sites to be allocated even if ed - ! is not turned on - ! --------------------------------------------------------------------------------- - - use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters - use FatesInterfaceMod, only : numpft_ed => numpft - use FatesParameterDerivedMod, only : param_derived - - implicit none - - ! Input Arguments - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_proc - - ! local variables - integer :: nclumps ! Number of threads - logical :: verbose_output - integer :: pass_masterproc - integer :: pass_vertsoilc - integer :: pass_spitfire - integer :: pass_ed_st3 - integer :: pass_ed_prescribed_phys - integer :: pass_logging - integer :: pass_planthydro - integer :: pass_inventory_init - integer :: pass_is_restart - integer :: nc ! thread index - integer :: s ! FATES site index - integer :: c ! HLM column index - integer :: l ! HLM LU index - integer :: g ! HLM grid index - integer :: pi,pf - integer, allocatable :: collist (:) - type(bounds_type) :: bounds_clump - integer :: nmaxcol - - ! Initialize the FATES communicators with the HLM - ! This involves to stages - ! 1) allocate the vectors - ! 2) add the history variables defined in clm_inst to the history machinery - - - ! Parameter Routines - call param_derived%Init( numpft_ed ) - - - verbose_output = .false. - call FatesInterfaceInit(iulog, verbose_output) - - nclumps = get_proc_clumps() - allocate(this%fates(nclumps)) - allocate(this%f2hmap(nclumps)) - - ! --------------------------------------------------------------------------------- - ! Send dimensions and other model controling parameters to FATES. These - ! are obviously only those parameters that are dictated by the host - ! --------------------------------------------------------------------------------- - - ! Force FATES parameters that are recieve type, to the unset value - call set_fates_ctrlparms('flush_to_unset') - - ! Send parameters individually - call set_fates_ctrlparms('num_sw_bbands',ival=numrad) - call set_fates_ctrlparms('vis_sw_index',ival=ivis) - call set_fates_ctrlparms('nir_sw_index',ival=inir) - - call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) - call set_fates_ctrlparms('num_lev_soil',ival=nlevsoi) - call set_fates_ctrlparms('num_levdecomp',ival=nlevdecomp) - call set_fates_ctrlparms('num_levdecomp_full',ival=nlevdecomp_full) - call set_fates_ctrlparms('hlm_name',cval='CLM') - call set_fates_ctrlparms('hio_ignore_val',rval=spval) - call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) - call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES - ! AND DOESNT TOUCH - ! THE BARE SOIL PATCH - - if(is_restart()) then - pass_is_restart = 1 - else - pass_is_restart = 0 - end if - call set_fates_ctrlparms('is_restart',ival=pass_is_restart) - - if(use_vertsoilc) then - pass_vertsoilc = 1 - else - pass_vertsoilc = 0 - end if - call set_fates_ctrlparms('use_vertsoilc',ival=pass_vertsoilc) - - if(use_fates_spitfire) then - pass_spitfire = 1 - else - pass_spitfire = 0 - end if - call set_fates_ctrlparms('use_spitfire',ival=pass_spitfire) - - if(use_fates_ed_st3) then - pass_ed_st3 = 1 - else - pass_ed_st3 = 0 - end if - call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) - - if(use_fates_ed_prescribed_phys) then - pass_ed_prescribed_phys = 1 - else - pass_ed_prescribed_phys = 0 - end if - call set_fates_ctrlparms('use_ed_prescribed_phys',ival=pass_ed_prescribed_phys) - - if(use_fates_planthydro) then - pass_planthydro = 1 - else - pass_planthydro = 0 - end if - call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) - - if(use_fates_logging) then - pass_logging = 1 - else - pass_logging = 0 - end if - call set_fates_ctrlparms('use_logging',ival=pass_logging) - - if(use_fates_inventory_init) then - pass_inventory_init = 1 - else - pass_inventory_init = 0 - end if - call set_fates_ctrlparms('use_inventory_init',ival=pass_inventory_init) - - call set_fates_ctrlparms('inventory_ctrl_file',cval=fates_inventory_ctrl_filename) - - - if(masterproc)then - pass_masterproc = 1 - else - pass_masterproc = 0 - end if - call set_fates_ctrlparms('masterproc',ival=pass_masterproc) - - ! Check through FATES parameters to see if all have been set - call set_fates_ctrlparms('check_allset') - - if(DEBUG)then - write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads' - end if - - - nclumps = get_proc_clumps() - - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,nmaxcol,s,c,l,g,collist,pi,pf) - do nc = 1,nclumps - - call get_clump_bounds(nc, bounds_clump) - nmaxcol = bounds_clump%endc - bounds_clump%begc + 1 - - allocate(collist(1:nmaxcol)) - - ! Allocate the mapping that points columns to FATES sites, 0 is NA - allocate(this%f2hmap(nc)%hsites(bounds_clump%begc:bounds_clump%endc)) - - ! Initialize all columns with a zero index, which indicates no FATES site - this%f2hmap(nc)%hsites(:) = 0 - - s = 0 - do c = bounds_clump%begc,bounds_clump%endc - l = col%landunit(c) - - ! These are the key constraints that determine if this column - ! will have a FATES site associated with it - - ! INTERF-TODO: WE HAVE NOT FILTERED OUT FATES SITES ON INACTIVE COLUMNS.. YET - ! NEED A RUN-TIME ROUTINE THAT CLEARS AND REWRITES THE SITE LIST - - if (lun%itype(l) == istsoil ) then - s = s + 1 - collist(s) = c - this%f2hmap(nc)%hsites(c) = s - if(DEBUG)then - write(iulog,*) 'clm_fates%init(): thread',nc,': found column',c,'with lu',l - write(iulog,*) 'LU type:', lun%itype(l) - end if - endif - - enddo - - if(DEBUG)then - write(iulog,*) 'clm_fates%init(): thread',nc,': allocated ',s,' sites' - end if - - ! Allocate vectors that match FATES sites with HLM columns - ! RGK: Sites and fcolumns are forced as args during clm_driv() as of 6/4/2016 - ! We may have to give these a dummy allocation of 1, which should - ! not be a problem since we always iterate on nsites. - - allocate(this%f2hmap(nc)%fcolumn(s)) - - ! Assign the h2hmap indexing - this%f2hmap(nc)%fcolumn(1:s) = collist(1:s) - - ! Deallocate the temporary arrays - deallocate(collist) - - ! Set the number of FATES sites - this%fates(nc)%nsites = s - - ! Allocate the FATES sites - allocate (this%fates(nc)%sites(this%fates(nc)%nsites)) - - ! Allocate the FATES boundary arrays (in) - allocate(this%fates(nc)%bc_in(this%fates(nc)%nsites)) - - ! Allocate the FATES boundary arrays (out) - allocate(this%fates(nc)%bc_out(this%fates(nc)%nsites)) - - ! Allocate and Initialize the Boundary Condition Arrays - ! These are staticaly allocated at maximums, so - ! No information about the patch or cohort structure is needed at this step - - do s = 1, this%fates(nc)%nsites - call allocate_bcin(this%fates(nc)%bc_in(s)) - call allocate_bcout(this%fates(nc)%bc_out(s)) - call this%fates(nc)%zero_bcs(s) - - ! Pass any grid-cell derived attributes to the site - ! --------------------------------------------------------------------------- - c = this%f2hmap(nc)%fcolumn(s) - g = col%gridcell(c) - this%fates(nc)%sites(s)%lat = grc%latdeg(g) - this%fates(nc)%sites(s)%lon = grc%londeg(g) - - end do - - - ! Initialize site-level static quantities dictated by the HLM - ! currently ground layering depth - - call this%init_soil_depths(nc) - - if (use_fates_planthydro) call InitHydrSites(this%fates(nc)%sites) - - - if( this%fates(nc)%nsites == 0 ) then - write(iulog,*) 'Clump ',nc,' had no valid FATES sites' - write(iulog,*) 'This will likely cause problems until code is improved' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - - ! Set patch itypes on natural veg columns to nonsense - ! This will force a crash if the model outside of FATES tries to think - ! of the patch as a PFT. - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - pi = col%patchi(c)+1 - pf = col%patchf(c) -! patch%itype(pi:pf) = ispval - patch%is_fates(pi:pf) = .true. - end do - - end do - !$OMP END PARALLEL DO - - - call this%init_history_io(bounds_proc) - - ! Report Fates Parameters (debug flag in lower level routines) - call FatesReportParameters(masterproc) - - end subroutine init - - ! =================================================================================== - - subroutine check_hlm_active(this, nc, bounds_clump) - - ! --------------------------------------------------------------------------------- - ! This subroutine is not currently used. It is just a utility that may come - ! in handy when we have dynamic sites in FATES - ! --------------------------------------------------------------------------------- - - implicit none - class(hlm_fates_interface_type), intent(inout) :: this - integer :: nc - type(bounds_type),intent(in) :: bounds_clump - - ! local variables - integer :: c - - do c = bounds_clump%begc,bounds_clump%endc - - ! FATES ACTIVE BUT HLM IS NOT - if(this%f2hmap(nc)%hsites(c)>0 .and. .not.col%active(c)) then - - write(iulog,*) 'INACTIVE COLUMN WITH ACTIVE FATES SITE' - write(iulog,*) 'c = ',c - call endrun(msg=errMsg(sourcefile, __LINE__)) - - elseif (this%f2hmap(nc)%hsites(c)==0 .and. col%active(c)) then - - write(iulog,*) 'ACTIVE COLUMN WITH INACTIVE FATES SITE' - write(iulog,*) 'c = ',c - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - - end subroutine check_hlm_active - - ! ------------------------------------------------------------------------------------ - - subroutine dynamics_driv(this, nc, bounds_clump, & - atm2lnd_inst, soilstate_inst, temperature_inst, & - waterstate_inst, canopystate_inst, soilbiogeochem_carbonflux_inst, & - frictionvel_inst ) - - ! This wrapper is called daily from clm_driver - ! This wrapper calls ed_driver, which is the daily dynamics component of FATES - ! ed_driver is not a hlm_fates_inst_type procedure because we need an extra step - ! to process array bounding information - - implicit none - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_clump - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(soilstate_type) , intent(in) :: soilstate_inst - type(temperature_type) , intent(in) :: temperature_inst - integer , intent(in) :: nc - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilbiogeochem_carbonflux_type), intent(inout) :: soilbiogeochem_carbonflux_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - ! !LOCAL VARIABLES: - integer :: s ! site index - integer :: c ! column index (HLM) - integer :: ifp ! patch index - integer :: p ! HLM patch index - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - integer :: current_year - integer :: current_month - integer :: current_day - integer :: current_tod - integer :: current_date - integer :: jan01_curr_year - integer :: reference_date - integer :: days_per_year - real(r8) :: model_day - real(r8) :: day_of_year - !----------------------------------------------------------------------- - - ! --------------------------------------------------------------------------------- - ! Part I. - ! Prepare input boundary conditions for FATES dynamics - ! Note that timing information is the same across all sites, this may - ! seem redundant, but it is possible that we may have asynchronous site simulations - ! one day. The cost of holding site level boundary conditions is minimal - ! and it keeps all the boundaries in one location - ! --------------------------------------------------------------------------------- - - days_per_year = get_days_per_year() - call get_curr_date(current_year,current_month,current_day,current_tod) - current_date = current_year*10000 + current_month*100 + current_day - jan01_curr_year = current_year*10000 + 100 + 1 - - call get_ref_date(yr, mon, day, sec) - reference_date = yr*10000 + mon*100 + day - - call timemgr_datediff(reference_date, sec, current_date, current_tod, model_day) - - call timemgr_datediff(jan01_curr_year,0,current_date,sec,day_of_year) - - call SetFatesTime(current_year, current_month, & - current_day, current_tod, & - current_date, reference_date, & - model_day, floor(day_of_year), & - days_per_year, 1.0_r8/dble(days_per_year)) - - - do s=1,this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(1:nlevsoi) = & - waterstate_inst%h2osoi_vol_col(c,1:nlevsoi) - - ! TO-DO: SHOULD THIS BE LIQVOL OR IS VOL OK? (RGK-02-2017) - - this%fates(nc)%bc_in(s)%t_veg24_si = & - temperature_inst%t_veg24_patch(col%patchi(c)) - - this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = canopystate_inst%altmax_lastyear_indx_col(c) - - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%t_veg24_pa(ifp) = & - temperature_inst%t_veg24_patch(p) - - this%fates(nc)%bc_in(s)%precip24_pa(ifp) = & - atm2lnd_inst%prec24_patch(p) - - this%fates(nc)%bc_in(s)%relhumid24_pa(ifp) = & - atm2lnd_inst%rh24_patch(p) - - this%fates(nc)%bc_in(s)%wind24_pa(ifp) = & - atm2lnd_inst%wind24_patch(p) - - end do - - - if(use_fates_planthydro)then - this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoi) = soilstate_inst%hksat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = soilstate_inst%watsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = soilstate_inst%watres_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = soilstate_inst%sucsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = soilstate_inst%bsw_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) - end if - - - end do - - ! --------------------------------------------------------------------------------- - ! Part II: Call the FATES model now that input boundary conditions have been - ! provided. - ! --------------------------------------------------------------------------------- - - do s = 1,this%fates(nc)%nsites - - call ed_ecosystem_dynamics(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s)) - - call ed_update_site(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s)) - - enddo - - ! call subroutine to aggregate fates litter output fluxes and - ! package them for handing across interface - call flux_into_litter_pools(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out) - - - ! --------------------------------------------------------------------------------- - ! Part III: Process FATES output into the dimensions and structures that are part - ! of the HLMs API. (column, depth, and litter fractions) - ! --------------------------------------------------------------------------------- - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lab_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lab_c_col(:) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_cel_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_cel_c_col(:) - soilbiogeochem_carbonflux_inst%FATES_c_to_litr_lig_c_col(c,:) = & - this%fates(nc)%bc_out(s)%FATES_c_to_litr_lig_c_col(:) - end do - - - ! --------------------------------------------------------------------------------- - ! Part III.2 (continued). - ! Update diagnostics of the FATES ecosystem structure that are used in the HLM. - ! --------------------------------------------------------------------------------- - call this%wrap_update_hlmfates_dyn(nc, & - bounds_clump, & - waterstate_inst, & - canopystate_inst, & - frictionvel_inst) - - ! --------------------------------------------------------------------------------- - ! Part IV: - ! Update history IO fields that depend on ecosystem dynamics - ! --------------------------------------------------------------------------------- - call this%fates_hist%update_history_dyn( nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) - - if (masterproc) then - write(iulog, *) 'clm: leaving fates model', bounds_clump%begg, & - bounds_clump%endg - end if - - - return - end subroutine dynamics_driv - - ! ------------------------------------------------------------------------------------ - - subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & - waterstate_inst, canopystate_inst, frictionvel_inst ) - - ! --------------------------------------------------------------------------------- - ! This routine handles the updating of vegetation canopy diagnostics, (such as lai) - ! that either requires HLM boundary conditions (like snow accumulation) or - ! provides boundary conditions (such as vegetation fractional coverage) - ! --------------------------------------------------------------------------------- - - implicit none - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_clump - integer , intent(in) :: nc - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - integer :: npatch ! number of patches in each site - integer :: ifp ! index FATES patch - integer :: p ! HLM patch index - integer :: s ! site index - integer :: c ! column index - - associate( & - tlai => canopystate_inst%tlai_patch , & - elai => canopystate_inst%elai_patch , & - tsai => canopystate_inst%tsai_patch , & - esai => canopystate_inst%esai_patch , & - htop => canopystate_inst%htop_patch , & - hbot => canopystate_inst%hbot_patch , & - z0m => frictionvel_inst%z0m_patch , & ! Output: [real(r8) (:) ] momentum roughness length (m) - displa => canopystate_inst%displa_patch, & - dleaf_patch => canopystate_inst%dleaf_patch, & - snow_depth => waterstate_inst%snow_depth_col, & - frac_sno_eff => waterstate_inst%frac_sno_eff_col, & - frac_veg_nosno_alb => canopystate_inst%frac_veg_nosno_alb_patch) - - - ! Process input boundary conditions to FATES - ! -------------------------------------------------------------------------------- - do s=1,this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%snow_depth_si = snow_depth(c) - this%fates(nc)%bc_in(s)%frac_sno_eff_si = frac_sno_eff(c) - end do - - ! Canopy diagnostics for FATES - call canopy_summarization(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in) - - ! Canopy diagnostic outputs for HLM - call update_hlm_dynamics(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%f2hmap(nc)%fcolumn, & - this%fates(nc)%bc_out ) - - !--------------------------------------------------------------------------------- - ! CHANGING STORED WATER DURING PLANT DYNAMICS IS NOT FULLY IMPLEMENTED - ! LEAVING AS A PLACE-HOLDER FOR NOW. - ! ! Diagnose water storage in canopy if hydraulics is on - ! ! This updates the internal value and the bc_out value. - ! ! If hydraulics is off, it returns 0 storage - ! if ( use_fates_planthydro ) then - ! call UpdateH2OVeg(this%fates(nc)%nsites, & - ! this%fates(nc)%sites, & - ! this%fates(nc)%bc_out) - ! - ! do s = 1, this%fates(nc)%nsites - ! c = this%f2hmap(nc)%fcolumn(s) - ! waterstate_inst%total_plant_stored_h2o_col(c) = & - ! this%fates(nc)%bc_out(s)%plant_stored_h2o_si - ! end do - ! end if - !--------------------------------------------------------------------------------- - - ! Convert FATES dynamics into HLM usable information - ! Initialize weighting variables (note FATES is the only HLM module - ! that uses "is_veg" and "is_bareground". The entire purpose of these - ! variables is to inform patch%wtcol(p). wt_ed is imposed on wtcol, - ! but only for FATES columns. - - patch%is_veg(bounds_clump%begp:bounds_clump%endp) = .false. - patch%is_bareground(bounds_clump%begp:bounds_clump%endp) = .false. - patch%wt_ed(bounds_clump%begp:bounds_clump%endp) = 0.0_r8 - - do s = 1,this%fates(nc)%nsites - - c = this%f2hmap(nc)%fcolumn(s) - - ! Other modules may have AI's we only flush values - ! that are on the naturally vegetated columns - elai(col%patchi(c):col%patchf(c)) = 0.0_r8 - tlai(col%patchi(c):col%patchf(c)) = 0.0_r8 - esai(col%patchi(c):col%patchf(c)) = 0.0_r8 - tsai(col%patchi(c):col%patchf(c)) = 0.0_r8 - htop(col%patchi(c):col%patchf(c)) = 0.0_r8 - hbot(col%patchi(c):col%patchf(c)) = 0.0_r8 - - ! FATES does not dictate bare-ground so turbulent - ! variables are not over-written. - z0m(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - displa(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - dleaf_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - - frac_veg_nosno_alb(col%patchi(c):col%patchf(c)) = 0.0_r8 - - ! Set the bareground patch indicator - patch%is_bareground(col%patchi(c)) = .true. - npatch = this%fates(nc)%sites(s)%youngest_patch%patchno - patch%wt_ed(col%patchi(c)) = 1.0-sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch)) - - if(sum(this%fates(nc)%bc_out(s)%canopy_fraction_pa(1:npatch))>1.0_r8)then - write(iulog,*)'Projected Canopy Area of all FATES patches' - write(iulog,*)'cannot exceed 1.0' - !end_run() - end if - - do ifp = 1, npatch - - p = ifp+col%patchi(c) - - ! bc_out(s)%canopy_fraction_pa(ifp) is the area fraction - ! the site's total ground area that is occupied by the - ! area footprint of the current patch's vegetation canopy - - patch%is_veg(p) = .true. - patch%wt_ed(p) = this%fates(nc)%bc_out(s)%canopy_fraction_pa(ifp) - elai(p) = this%fates(nc)%bc_out(s)%elai_pa(ifp) - tlai(p) = this%fates(nc)%bc_out(s)%tlai_pa(ifp) - esai(p) = this%fates(nc)%bc_out(s)%esai_pa(ifp) - tsai(p) = this%fates(nc)%bc_out(s)%tsai_pa(ifp) - hbot(p) = this%fates(nc)%bc_out(s)%hbot_pa(ifp) - htop(p) = this%fates(nc)%bc_out(s)%htop_pa(ifp) - frac_veg_nosno_alb(p) = this%fates(nc)%bc_out(s)%frac_veg_nosno_alb_pa(ifp) - - ! Note that while we pass the following values at this point - ! we have to send the same values after each time-step because - ! the HLM keeps changing the value and re-setting, so we - ! re-send instead of re-set. See clm_fates%TransferZ0mDisp() - z0m(p) = this%fates(nc)%bc_out(s)%z0m_pa(ifp) - displa(p) = this%fates(nc)%bc_out(s)%displa_pa(ifp) - dleaf_patch(p) = this%fates(nc)%bc_out(s)%dleaf_pa(ifp) - - - end do - - end do - end associate - end subroutine wrap_update_hlmfates_dyn - - ! ==================================================================================== - - subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & - canopystate_inst, frictionvel_inst ) - - ! --------------------------------------------------------------------------------- - ! The ability to restart the model is handled through three different types of calls - ! "Define" the variables in the restart file, we "read" those variables into memory - ! or "write" data into the file from memory. This subroutine accomodates all three - ! of those modes through the "flag" argument. FATES as an external model also - ! requires an initialization step, where we set-up the dimensions, allocate and - ! flush the memory space that is used to transfer data in and out of the file. This - ! Only occurs once, where as the define step occurs every time a file is opened. - ! - ! Note: waterstate_inst and canopystate_inst are arguments only because following - ! the reading of variables, it is necessary to update diagnostics of the canopy - ! throug the interface call clm_fates%wrap_update_hlmfates_dyn() which requires - ! this information from the HLM. - ! --------------------------------------------------------------------------------- - - - use FatesConstantsMod, only : fates_long_string_length - use FatesIODimensionsMod, only: fates_bounds_type - use FatesIOVariableKindMod, only : site_r8, site_int, cohort_r8, cohort_int - use EDMainMod, only : ed_update_site - use FatesInterfaceMod, only: fates_maxElementsPerSite - - implicit none - - ! Arguments - - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds_proc - type(file_desc_t) , intent(inout) :: ncid ! netcdf id - character(len=*) , intent(in) :: flag - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - ! Locals - type(bounds_type) :: bounds_clump - integer :: nc - integer :: nclumps - type(fates_bounds_type) :: fates_bounds - type(fates_bounds_type) :: fates_clump - integer :: c ! HLM column index - integer :: s ! Fates site index - integer :: g ! grid-cell index - integer :: dk_index - character(len=fates_long_string_length) :: ioname - integer :: nvar - integer :: ivar - logical :: readvar - - logical, save :: initialized = .false. - - - nclumps = get_proc_clumps() - - ! --------------------------------------------------------------------------------- - ! note (rgk: 11-2016) The history and restart intialization process assumes - ! that the number of site/columns active is a static entity. Thus - ! we only allocate the mapping tables for the column/sites we start with. - ! If/when we start having dynamic column/sites (for reasons uknown as of yet) - ! we will need to re-evaluate the allocation of the mapping tables so they - ! can be unallocated,reallocated and set every time a new column/site is spawned - ! --------------------------------------------------------------------------------- - - ! --------------------------------------------------------------------------------- - ! Only initialize the FATES restart structures the first time it is called - ! Note that the allocations involved with initialization are static. - ! This is because the array spaces for IO span the entire column, patch and cohort - ! range on the proc. - ! With DYNAMIC LANDUNITS or SPAWNING NEW OR CULLING OLD SITES: - ! we will in that case have to de-allocate, reallocate and then re-set the mapping - ! tables: this%fates_restart%restart_map(nc) - ! I think that is it... - ! --------------------------------------------------------------------------------- - - if(.not.initialized) then - - initialized=.true. - - ! ------------------------------------------------------------------------------ - ! PART I: Set FATES DIMENSIONING INFORMATION - ! ------------------------------------------------------------------------------ - - call hlm_bounds_to_fates_bounds(bounds_proc, fates_bounds) - - call this%fates_restart%Init(nclumps, fates_bounds) - - ! Define the bounds on the first dimension for each thread - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,fates_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - - ! thread bounds for patch - call hlm_bounds_to_fates_bounds(bounds_clump, fates_clump) - call this%fates_restart%SetThreadBoundsEach(nc, fates_clump) - end do - !$OMP END PARALLEL DO - - !$OMP PARALLEL DO PRIVATE (nc,s,c,g,bounds_clump) - do nc = 1,nclumps - - call get_clump_bounds(nc, bounds_clump) - allocate(this%fates_restart%restart_map(nc)%site_index(this%fates(nc)%nsites)) - allocate(this%fates_restart%restart_map(nc)%cohort1_index(this%fates(nc)%nsites)) - do s=1,this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates_restart%restart_map(nc)%site_index(s) = c - g = col%gridcell(c) - this%fates_restart%restart_map(nc)%cohort1_index(s) = (g-1)*fates_maxElementsPerSite + 1 - end do - - end do - !$OMP END PARALLEL DO - - ! ------------------------------------------------------------------------------------ - ! PART II: USE THE JUST DEFINED DIMENSIONS TO ASSEMBLE THE VALID IO TYPES - ! INTERF-TODO: THESE CAN ALL BE EMBEDDED INTO A SUBROUTINE IN HISTORYIOMOD - ! ------------------------------------------------------------------------------------ - call this%fates_restart%assemble_restart_output_types() - - - ! ------------------------------------------------------------------------------------ - ! PART III: DEFINE THE LIST OF OUTPUT VARIABLE OBJECTS, AND REGISTER THEM WITH THE - ! HLM ACCORDING TO THEIR TYPES - ! ------------------------------------------------------------------------------------ - call this%fates_restart%initialize_restart_vars() - - end if - - ! --------------------------------------------------------------------------------- - ! If we are writing, we must loop through our linked list structures and transfer the - ! information in the linked lists (FATES state memory) to the output vectors. - ! --------------------------------------------------------------------------------- - - if(flag=='write')then - !$OMP PARALLEL DO PRIVATE (nc) - do nc = 1, nclumps - if (this%fates(nc)%nsites>0) then - call this%fates_restart%set_restart_vectors(nc,this%fates(nc)%nsites, & - this%fates(nc)%sites) - end if - end do - !$OMP END PARALLEL DO - end if - - ! --------------------------------------------------------------------------------- - ! In all cases, iterate through the list of variable objects - ! and either define, write or read to the NC buffer - ! This seems strange, but keep in mind that the call to restartvar() - ! has a different function in all three cases. - ! --------------------------------------------------------------------------------- - - nvar = this%fates_restart%num_restart_vars() - do ivar = 1, nvar - - associate( vname => this%fates_restart%rvars(ivar)%vname, & - vunits => this%fates_restart%rvars(ivar)%units, & - vlong => this%fates_restart%rvars(ivar)%long ) - - dk_index = this%fates_restart%rvars(ivar)%dim_kinds_index - ioname = trim(this%fates_restart%dim_kinds(dk_index)%name) - - select case(trim(ioname)) - case(cohort_r8) - - call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & - xtype=ncd_double,dim1name=trim('cohort'),long_name=trim(vlong), & - units=trim(vunits),interpinic_flag='interp', & - data=this%fates_restart%rvars(ivar)%r81d,readvar=readvar) - - case(site_r8) - - call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & - xtype=ncd_double,dim1name=trim('column'),long_name=trim(vlong), & - units=trim(vunits),interpinic_flag='interp', & - data=this%fates_restart%rvars(ivar)%r81d,readvar=readvar) - - case(cohort_int) - - call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & - xtype=ncd_int,dim1name=trim('cohort'),long_name=trim(vlong), & - units=trim(vunits),interpinic_flag='interp', & - data=this%fates_restart%rvars(ivar)%int1d,readvar=readvar) - - case(site_int) - - call restartvar(ncid=ncid, flag=flag, varname=trim(vname), & - xtype=ncd_int,dim1name=trim('column'),long_name=trim(vlong), & - units=trim(vunits),interpinic_flag='interp', & - data=this%fates_restart%rvars(ivar)%int1d,readvar=readvar) - - case default - write(iulog,*) 'A FATES iotype was created that was not registerred' - write(iulog,*) 'in CLM.:',trim(ioname) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - end associate - end do - - ! --------------------------------------------------------------------------------- - ! If we are in a read mode, then we have just populated the sparse vectors - ! in the IO object list. The data in these vectors needs to be transferred - ! to the linked lists to populate the state memory. - ! --------------------------------------------------------------------------------- - - if(flag=='read')then - - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s) - do nc = 1, nclumps - if (this%fates(nc)%nsites>0) then - - call get_clump_bounds(nc, bounds_clump) - - ! ------------------------------------------------------------------------ - ! Convert newly read-in vectors into the FATES namelist state variables - ! ------------------------------------------------------------------------ - call this%fates_restart%create_patchcohort_structure(nc, & - this%fates(nc)%nsites, this%fates(nc)%sites, this%fates(nc)%bc_in) - - call this%fates_restart%get_restart_vectors(nc, this%fates(nc)%nsites, & - this%fates(nc)%sites ) - - ! I think ed_update_site and update_hlmfates_dyn are doing some similar - ! update type stuff, should consolidate (rgk 11-2016) - do s = 1,this%fates(nc)%nsites - call ed_update_site( this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s) ) - end do - - ! ------------------------------------------------------------------------ - ! Update diagnostics of FATES ecosystem structure used in HLM. - ! ------------------------------------------------------------------------ - call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & - waterstate_inst,canopystate_inst,frictionvel_inst) - - ! ------------------------------------------------------------------------ - ! Update history IO fields that depend on ecosystem dynamics - ! ------------------------------------------------------------------------ - call this%fates_hist%update_history_dyn( nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) - - - end if - end do - !$OMP END PARALLEL DO - - end if - - return - end subroutine restart - - !===================================================================================== - - subroutine init_coldstart(this, waterstate_inst, canopystate_inst, soilstate_inst, frictionvel_inst) - - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - type(waterstate_type) , intent(inout) :: waterstate_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - ! locals - integer :: nclumps - integer :: nc - type(bounds_type) :: bounds_clump - ! locals - real(r8) :: vol_ice - real(r8) :: eff_porosity - integer :: j - integer :: s - integer :: c - - nclumps = get_proc_clumps() - - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,s,c,j,vol_ice,eff_porosity) - do nc = 1, nclumps - - if ( this%fates(nc)%nsites>0 ) then - - call get_clump_bounds(nc, bounds_clump) - - do s = 1,this%fates(nc)%nsites - call init_site_vars(this%fates(nc)%sites(s)) - call zero_site(this%fates(nc)%sites(s)) - end do - - call set_site_properties(this%fates(nc)%nsites, this%fates(nc)%sites) - - ! ---------------------------------------------------------------------------- - ! Initialize Hydraulics Code if turned on - ! Called prior to init_patches(). Site level rhizosphere shells must - ! be set prior to cohort initialization. - ! ---------------------------------------------------------------------------- - if (use_fates_planthydro) then - - do s = 1,this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = & - soilstate_inst%watsat_col(c,1:nlevsoi) - - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = & - soilstate_inst%watres_col(c,1:nlevsoi) - - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = & - soilstate_inst%sucsat_col(c,1:nlevsoi) - - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = & - soilstate_inst%bsw_col(c,1:nlevsoi) - - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = & - waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) - - this%fates(nc)%bc_in(s)%hksat_sisl(1:nlevsoi) = & - soilstate_inst%hksat_col(c,1:nlevsoi) - - do j = 1, nlevsoi - vol_ice = min(soilstate_inst%watsat_col(c,j), & - waterstate_inst%h2osoi_ice_col(c,j)/(col%dz(c,j)*denice)) - eff_porosity = max(0.01_r8,soilstate_inst%watsat_col(c,j)-vol_ice) - this%fates(nc)%bc_in(s)%eff_porosity_gl(j) = eff_porosity - end do - - end do - - if (use_fates_planthydro) call HydrSiteColdStart(this%fates(nc)%sites,this%fates(nc)%bc_in) - end if - - call init_patches(this%fates(nc)%nsites, this%fates(nc)%sites, & - this%fates(nc)%bc_in) - - do s = 1,this%fates(nc)%nsites - call ed_update_site(this%fates(nc)%sites(s), & - this%fates(nc)%bc_in(s)) - end do - - ! ------------------------------------------------------------------------ - ! Update diagnostics of FATES ecosystem structure used in HLM. - ! ------------------------------------------------------------------------ - call this%wrap_update_hlmfates_dyn(nc,bounds_clump, & - waterstate_inst,canopystate_inst,frictionvel_inst) - - ! ------------------------------------------------------------------------ - ! Update history IO fields that depend on ecosystem dynamics - ! ------------------------------------------------------------------------ - call this%fates_hist%update_history_dyn( nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) - - - - end if - end do - !$OMP END PARALLEL DO - - end subroutine init_coldstart - - ! ====================================================================================== - - subroutine wrap_sunfrac(this,nc,atm2lnd_inst,canopystate_inst) - - ! --------------------------------------------------------------------------------- - ! This interface function is a wrapper call on ED_SunShadeFracs. The only - ! returned variable is a patch vector, fsun_patch, which describes the fraction - ! of the canopy that is exposed to sun. - ! --------------------------------------------------------------------------------- - - implicit none - - ! Input Arguments - class(hlm_fates_interface_type), intent(inout) :: this - - integer, intent(in) :: nc - - ! direct and diffuse downwelling radiation (W/m2) - type(atm2lnd_type),intent(in) :: atm2lnd_inst - - ! Input/Output Arguments to CLM - type(canopystate_type),intent(inout) :: canopystate_inst - - ! Local Variables - integer :: p ! global index of the host patch - integer :: g ! global index of the host gridcell - integer :: c ! global index of the host column - - integer :: s ! FATES site index - integer :: ifp ! FATEs patch index - ! this is the order increment of patch - ! on the site - - type(ed_patch_type), pointer :: cpatch ! c"urrent" patch INTERF-TODO: SHOULD - ! BE HIDDEN AS A FATES PRIVATE - - associate( forc_solad => atm2lnd_inst%forc_solad_grc, & - forc_solai => atm2lnd_inst%forc_solai_grc, & - fsun => canopystate_inst%fsun_patch, & - laisun => canopystate_inst%laisun_patch, & - laisha => canopystate_inst%laisha_patch ) - - ! ------------------------------------------------------------------------------- - ! Convert input BC's - ! The sun-shade calculations are performed only on FATES patches - ! ------------------------------------------------------------------------------- - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - g = col%gridcell(c) - - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - !do ifp = 1, this%fates(nc)%bc_in(s)%npatches - - p = ifp+col%patchi(c) - - this%fates(nc)%bc_in(s)%solad_parb(ifp,:) = forc_solad(g,:) - this%fates(nc)%bc_in(s)%solai_parb(ifp,:) = forc_solai(g,:) - - end do - end do - - ! ------------------------------------------------------------------------------- - ! Call FATES public function to calculate internal sun/shade structures - ! as well as total patch sun/shade fraction output boundary condition - ! ------------------------------------------------------------------------------- - - call ED_SunShadeFracs(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out) - - ! ------------------------------------------------------------------------------- - ! Transfer the FATES output boundary condition for canopy sun/shade fraction - ! to the HLM - ! ------------------------------------------------------------------------------- - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - fsun(p) = this%fates(nc)%bc_out(s)%fsun_pa(ifp) - laisun(p) = this%fates(nc)%bc_out(s)%laisun_pa(ifp) - laisha(p) = this%fates(nc)%bc_out(s)%laisha_pa(ifp) - end do - end do - - end associate - - end subroutine wrap_sunfrac - - ! =================================================================================== - - subroutine prep_canopyfluxes(this, nc, fn, filterp, photosyns_inst) - - ! ---------------------------------------------------------------------- - ! the main function for calculating photosynthesis is called within a - ! loop based on convergence. Some intitializations, including - ! canopy resistance must be intitialized before the loop - ! ---------------------------------------------------------------------- - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - integer, intent(in) :: nc - integer, intent(in) :: fn - integer, intent(in) :: filterp(fn) - type(photosyns_type),intent(inout) :: photosyns_inst - ! locals - integer :: f,p,c,s - ! parameters - integer,parameter :: rsmax0 = 2.e4_r8 - - do s = 1, this%fates(nc)%nsites - ! filter flag == 1 means that this patch has not been called for photosynthesis - this%fates(nc)%bc_in(s)%filter_photo_pa(:) = 1 - end do - end subroutine prep_canopyfluxes - - ! ==================================================================================== - - subroutine wrap_btran(this,nc,fn,filterc,soilstate_inst, waterstate_inst, & - temperature_inst, energyflux_inst, & - soil_water_retention_curve) - - ! --------------------------------------------------------------------------------- - ! This subroutine calculates btran for FATES, this will be an input boundary - ! condition for FATES photosynthesis/transpiration. - ! - ! This subroutine also calculates rootr - ! - ! --------------------------------------------------------------------------------- - - use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type - - implicit none - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - integer , intent(in) :: nc - integer , intent(in) :: fn - integer , intent(in) :: filterc(fn) ! This is a list of - ! columns with exposed veg - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterstate_type) , intent(in) :: waterstate_inst - type(temperature_type) , intent(in) :: temperature_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve - - ! local variables - real(r8) :: smp_node ! Soil suction potential, negative, [mm] - real(r8) :: s_node - integer :: s - integer :: c - integer :: j - integer :: ifp - integer :: p - - associate(& - sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" - eff_porosity => soilstate_inst%eff_porosity_col , & ! Input: [real(r8) (:,:) ] effective porosity = porosity - vol_ice - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) - h2osoi_liqvol => waterstate_inst%h2osoi_liqvol_col , & ! Input: [real(r8) (:,:) ] liquid volumetric moisture, will be used for BeTR - btran => energyflux_inst%btran_patch , & ! Output: [real(r8) (:) ] transpiration wetness factor (0 to 1) - btran2 => energyflux_inst%btran2_patch , & ! Output: [real(r8) (:) ] - rresis => energyflux_inst%rresis_patch , & ! Output: [real(r8) (:,:) ] root resistance by layer (0-1) (nlevgrnd) - rootr => soilstate_inst%rootr_patch & ! Output: [real(r8) (:,:) ] Fraction of water uptake in each layer - ) - - ! ------------------------------------------------------------------------------- - ! Convert input BC's - ! Critical step: a filter is being passed in that dictates which columns have - ! exposed vegetation (above snow). This is necessary, because various hydrologic - ! variables like h2osoi_liqvol are not calculated and will have uninitialized - ! values outside this list. - ! - ! bc_in(s)%filter_btran (this is in, but is also used in this subroutine) - ! - ! We also filter a second time within this list by determining which soil layers - ! have conditions for active uptake based on soil moisture and temperature. This - ! must be determined by FATES (science stuff). But the list of layers and patches - ! needs to be passed back to the interface, because it then needs to request - ! suction on these layers via CLM/ALM functions. We cannot wide-swath calculate - ! this on all layers, because values with no moisture or low temps will generate - ! unstable values and cause sigtraps. - ! ------------------------------------------------------------------------------- - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - - ! Check to see if this column is in the exposed veg filter - if( any(filterc==c) )then - - this%fates(nc)%bc_in(s)%filter_btran = .true. - do j = 1,nlevgrnd - this%fates(nc)%bc_in(s)%tempk_gl(j) = t_soisno(c,j) - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(j) = h2osoi_liqvol(c,j) - this%fates(nc)%bc_in(s)%eff_porosity_gl(j) = eff_porosity(c,j) - this%fates(nc)%bc_in(s)%watsat_gl(j) = watsat(c,j) - end do - - else - this%fates(nc)%bc_in(s)%filter_btran = .false. - this%fates(nc)%bc_in(s)%tempk_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%h2o_liqvol_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%eff_porosity_gl(:) = -999._r8 - this%fates(nc)%bc_in(s)%watsat_gl(:) = -999._r8 - end if - - end do - - ! ------------------------------------------------------------------------------- - ! This function evaluates the ground layer to determine if - ! root water uptake can happen, and soil suction should even - ! be calculated. We ask FATES for a boundary condition output - ! logical because we don't want science calculations in the interface - ! yet... hydrology (suction calculation) is provided by the host - ! so we need fates to tell us where to calculate suction - ! but not calculate it itself. Yeah, complicated, but thats life. - ! ------------------------------------------------------------------------------- - call get_active_suction_layers(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out) - - ! Now that the active layers of water uptake have been decided by fates - ! Calculate the suction that is passed back to fates - ! Note that the filter_btran is unioned with active_suction_gl - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - do j = 1,nlevgrnd - if(this%fates(nc)%bc_out(s)%active_suction_gl(j)) then - s_node = max(h2osoi_liqvol(c,j)/eff_porosity(c,j),0.01_r8) - call soil_water_retention_curve%soil_suction(c,j,s_node, soilstate_inst, smp_node) - this%fates(nc)%bc_in(s)%smp_gl(j) = smp_node - end if - end do - end do - - ! ------------------------------------------------------------------------------- - ! Suction and active uptake layers calculated, lets calculate uptake (btran) - ! This will calculate internals, as well as output boundary conditions: - ! btran, rootr - ! ------------------------------------------------------------------------------- - - call btran_ed(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out) - - ! ------------------------------------------------------------------------------- - ! Convert output BC's - ! For CLM/ALM this wrapper provides return variables that should - ! be similar to that of calc_root_moist_stress(). However, - ! CLM/ALM-FATES simulations will no make use of rresis, btran or btran2 - ! outside of FATES. We do not have code in place to calculate btran2 or - ! rresis right now, so we force to bad. We have btran calculated so we - ! pass it in case people want diagnostics. rootr is actually the only - ! variable that will be used, as it is needed to help distribute the - ! the transpiration sink to the appropriate layers. (RGK) - ! ------------------------------------------------------------------------------- - - do s = 1, this%fates(nc)%nsites - - c = this%f2hmap(nc)%fcolumn(s) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - - p = ifp+col%patchi(c) - - do j = 1,nlevgrnd - - rresis(p,j) = -999.9 ! We do not calculate this correctly - ! it should not thought of as valid output until we decide to. - rootr(p,j) = this%fates(nc)%bc_out(s)%rootr_pagl(ifp,j) - btran(p) = this%fates(nc)%bc_out(s)%btran_pa(ifp) - btran2(p) = -999.9 ! Not available, force to nonsense - - end do - end do - end do - end associate - - end subroutine wrap_btran - - ! ==================================================================================== - - subroutine wrap_photosynthesis(this, nc, bounds, fn, filterp, & - esat_tv, eair, oair, cair, rb, dayl_factor, & - atm2lnd_inst, temperature_inst, canopystate_inst, photosyns_inst) - - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type - use clm_varcon , only : rgas, tfrz, namep - use clm_varpar , only : nlevsoi - use clm_varctl , only : iulog - use pftconMod , only : pftcon - use perf_mod , only : t_startf, t_stopf - use PatchType , only : patch - use quadraticMod , only : quadratic - use EDTypesMod , only : dinc_ed - use EDtypesMod , only : ed_patch_type, ed_cohort_type, ed_site_type - - ! - ! !ARGUMENTS: - class(hlm_fates_interface_type), intent(inout) :: this - integer , intent(in) :: nc ! clump index - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - real(r8) , intent(in) :: esat_tv(bounds%begp: ) ! saturation vapor pressure at t_veg (Pa) - real(r8) , intent(in) :: eair( bounds%begp: ) ! vapor pressure of canopy air (Pa) - real(r8) , intent(in) :: oair( bounds%begp: ) ! Atmospheric O2 partial pressure (Pa) - real(r8) , intent(in) :: cair( bounds%begp: ) ! Atmospheric CO2 partial pressure (Pa) - real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m) - real(r8) , intent(in) :: dayl_factor( bounds%begp: ) ! scalar (0-1) for daylength - type(atm2lnd_type) , intent(in) :: atm2lnd_inst - type(temperature_type) , intent(in) :: temperature_inst - type(canopystate_type) , intent(inout) :: canopystate_inst - type(photosyns_type) , intent(inout) :: photosyns_inst - - integer :: s,c,p,ifp,j,icp - real(r8) :: dtime - - call t_startf('edpsn') - associate(& - t_soisno => temperature_inst%t_soisno_col , & - t_veg => temperature_inst%t_veg_patch , & - tgcm => temperature_inst%thm_patch , & - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col, & - rssun => photosyns_inst%rssun_patch , & - rssha => photosyns_inst%rssha_patch, & - psnsun => photosyns_inst%psnsun_patch, & - psnsha => photosyns_inst%psnsha_patch) - - do s = 1, this%fates(nc)%nsites - - c = this%f2hmap(nc)%fcolumn(s) - - do j = 1,nlevsoi - this%fates(nc)%bc_in(s)%t_soisno_gl(j) = t_soisno(c,j) ! soil temperature (Kelvin) - end do - this%fates(nc)%bc_in(s)%forc_pbot = forc_pbot(c) ! atmospheric pressure (Pa) - - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - - p = ifp+col%patchi(c) - - ! Check to see if this patch is in the filter - ! Note that this filter is most likely changing size, and getting smaller - ! and smaller as more patch have converged on solution - if( any(filterp==p) )then - - ! This filter is flushed to 1 before the canopyflux stability iterator - ! It is set to status 2 if it is an active patch within the iterative loop - ! After photosynthesis is called, it is upgraded to 3 if it was called. - ! After all iterations we can evaluate which patches have a final flag - ! of 3 to check if we missed any. - - this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) = 2 - this%fates(nc)%bc_in(s)%dayl_factor_pa(ifp) = dayl_factor(p) ! scalar (0-1) for daylength - this%fates(nc)%bc_in(s)%esat_tv_pa(ifp) = esat_tv(p) ! saturation vapor pressure at t_veg (Pa) - this%fates(nc)%bc_in(s)%eair_pa(ifp) = eair(p) ! vapor pressure of canopy air (Pa) - this%fates(nc)%bc_in(s)%oair_pa(ifp) = oair(p) ! Atmospheric O2 partial pressure (Pa) - this%fates(nc)%bc_in(s)%cair_pa(ifp) = cair(p) ! Atmospheric CO2 partial pressure (Pa) - this%fates(nc)%bc_in(s)%rb_pa(ifp) = rb(p) ! boundary layer resistance (s/m) - this%fates(nc)%bc_in(s)%t_veg_pa(ifp) = t_veg(p) ! vegetation temperature (Kelvin) - this%fates(nc)%bc_in(s)%tgcm_pa(ifp) = tgcm(p) ! air temperature at agcm reference height (kelvin) - end if - end do - end do - - dtime = get_step_size() - - ! Call photosynthesis - - call FatesPlantRespPhotosynthDrive (this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out, & - dtime) - - ! Perform a double check to see if all patches on naturally vegetated columns - ! were activated for photosynthesis - ! --------------------------------------------------------------------------------- - do icp = 1,fn - p = filterp(icp) - c = patch%column(p) - s = this%f2hmap(nc)%hsites(c) - ! do if structure here and only pass natveg columns - ifp = p-col%patchi(c) - if(this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) /= 2)then - write(iulog,*) 'Not all patches on the natveg column in the photosynthesis' - write(iulog,*) 'filter ran photosynthesis' - call endrun(msg=errMsg(sourcefile, __LINE__)) - else - this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) = 3 - rssun(p) = this%fates(nc)%bc_out(s)%rssun_pa(ifp) - rssha(p) = this%fates(nc)%bc_out(s)%rssha_pa(ifp) - - ! These fields are marked with a bad-value flag - photosyns_inst%psnsun_patch(p) = spval - photosyns_inst%psnsha_patch(p) = spval - end if - end do - - end associate - call t_stopf('edpsn') - - end subroutine wrap_photosynthesis - - ! ====================================================================================== - - subroutine wrap_accumulatefluxes(this, nc, fn, filterp) - - ! !ARGUMENTS: - class(hlm_fates_interface_type), intent(inout) :: this - integer , intent(in) :: nc ! clump index - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - - integer :: s,c,p,ifp,icp - real(r8) :: dtime - - - ! Run a check on the filter - do icp = 1,fn - p = filterp(icp) - c = patch%column(p) - s = this%f2hmap(nc)%hsites(c) - ifp = p-col%patchi(c) - if(this%fates(nc)%bc_in(s)%filter_photo_pa(ifp) /= 3)then - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - end do - - - dtime = get_step_size() - call AccumulateFluxes_ED(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out, & - dtime) - - - call this%fates_hist%update_history_prod(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites, & - dtime) - - end subroutine wrap_accumulatefluxes - - ! ====================================================================================== - - subroutine wrap_canopy_radiation(this, bounds_clump, nc, & - num_vegsol, filter_vegsol, coszen, surfalb_inst) - - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type), intent(in) :: bounds_clump - ! filter for vegetated pfts with coszen>0 - integer , intent(in) :: nc ! clump index - integer , intent(in) :: num_vegsol - integer , intent(in) :: filter_vegsol(num_vegsol) - ! cosine solar zenith angle for next time step - real(r8) , intent(in) :: coszen( bounds_clump%begp: ) - type(surfalb_type) , intent(inout) :: surfalb_inst - - ! locals - integer :: s,c,p,ifp,icp - - associate(& - albgrd_col => surfalb_inst%albgrd_col , & !in - albgri_col => surfalb_inst%albgri_col , & !in - albd => surfalb_inst%albd_patch , & !out - albi => surfalb_inst%albi_patch , & !out - fabd => surfalb_inst%fabd_patch , & !out - fabi => surfalb_inst%fabi_patch , & !out - ftdd => surfalb_inst%ftdd_patch , & !out - ftid => surfalb_inst%ftid_patch , & !out - ftii => surfalb_inst%ftii_patch) !out - - do s = 1, this%fates(nc)%nsites - - c = this%f2hmap(nc)%fcolumn(s) - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - - p = ifp+col%patchi(c) - - if( any(filter_vegsol==p) )then - - this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) = .true. - this%fates(nc)%bc_in(s)%coszen_pa(ifp) = coszen(p) - this%fates(nc)%bc_in(s)%albgr_dir_rb(:) = albgrd_col(c,:) - this%fates(nc)%bc_in(s)%albgr_dif_rb(:) = albgri_col(c,:) - - else - - this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) = .false. - - end if - - end do - end do - - call ED_Norman_Radiation(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out) - - ! Pass FATES BC's back to HLM - ! ----------------------------------------------------------------------------------- - do icp = 1,num_vegsol - p = filter_vegsol(icp) - c = patch%column(p) - s = this%f2hmap(nc)%hsites(c) - ! do if structure here and only pass natveg columns - ifp = p-col%patchi(c) - - if(.not.this%fates(nc)%bc_in(s)%filter_vegzen_pa(ifp) )then - write(iulog,*) 'Not all patches on the natveg column were passed to canrad' - call endrun(msg=errMsg(sourcefile, __LINE__)) - else - albd(p,:) = this%fates(nc)%bc_out(s)%albd_parb(ifp,:) - albi(p,:) = this%fates(nc)%bc_out(s)%albi_parb(ifp,:) - fabd(p,:) = this%fates(nc)%bc_out(s)%fabd_parb(ifp,:) - fabi(p,:) = this%fates(nc)%bc_out(s)%fabi_parb(ifp,:) - ftdd(p,:) = this%fates(nc)%bc_out(s)%ftdd_parb(ifp,:) - ftid(p,:) = this%fates(nc)%bc_out(s)%ftid_parb(ifp,:) - ftii(p,:) = this%fates(nc)%bc_out(s)%ftii_parb(ifp,:) - end if - end do - - end associate - - end subroutine wrap_canopy_radiation - - ! ====================================================================================== - - subroutine wrap_bgc_summary(this, nc, soilbiogeochem_carbonflux_inst, & - soilbiogeochem_carbonstate_inst) - - - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - integer , intent(in) :: nc - type(soilbiogeochem_carbonflux_type), intent(in) :: soilbiogeochem_carbonflux_inst - type(soilbiogeochem_carbonstate_type), intent(in) :: soilbiogeochem_carbonstate_inst - - ! locals - real(r8) :: dtime - integer :: nstep - logical :: is_beg_day - integer :: s,c - - associate(& - hr => soilbiogeochem_carbonflux_inst%hr_col, & ! (gC/m2/s) total heterotrophic respiration - totsomc => soilbiogeochem_carbonstate_inst%totsomc_col, & ! (gC/m2) total soil organic matter carbon - totlitc => soilbiogeochem_carbonstate_inst%totlitc_col) ! (gC/m2) total litter carbon in BGC pools - - ! Summarize Net Fluxes - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%tot_het_resp = hr(c) - this%fates(nc)%bc_in(s)%tot_somc = totsomc(c) - this%fates(nc)%bc_in(s)%tot_litc = totlitc(c) - end do - - is_beg_day = is_beg_curr_day() - dtime = get_step_size() - nstep = get_nstep() - - call SummarizeNetFluxes(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day) - - - call FATES_BGC_Carbon_Balancecheck(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - is_beg_day, & - dtime, nstep) - - - ! Update history variables that track these variables - call this%fates_hist%update_history_cbal(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites) - - - end associate - end subroutine wrap_bgc_summary - - ! ====================================================================================== - - - subroutine TransferZ0mDisp(this,bounds_clump,frictionvel_inst,canopystate_inst) - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_clump - type(canopystate_type) , intent(inout) :: canopystate_inst - type(frictionvel_type) , intent(inout) :: frictionvel_inst - - ! Locals - integer :: ci ! Current clump index - integer :: s ! Site index - integer :: c ! Column index - integer :: ifp ! Fates patch index - integer :: p ! CLM patch index - - ci = bounds_clump%clump_index - - do s = 1, this%fates(ci)%nsites - c = this%f2hmap(ci)%fcolumn(s) - - frictionvel_inst%z0m_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - canopystate_inst%displa_patch(col%patchi(c)+1:col%patchf(c)) = 0.0_r8 - - do ifp = 1, this%fates(ci)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - frictionvel_inst%z0m_patch(p) = this%fates(ci)%bc_out(s)%z0m_pa(ifp) - canopystate_inst%displa_patch(p) = this%fates(ci)%bc_out(s)%displa_pa(ifp) - end do - end do - - return - end subroutine TransferZ0mDisp - - ! ====================================================================================== - - subroutine init_history_io(this,bounds_proc) - - use histFileMod, only : hist_addfld1d, hist_addfld2d, hist_addfld_decomp - - use FatesConstantsMod, only : fates_short_string_length, fates_long_string_length - use FatesIOVariableKindMod, only : patch_r8, patch_ground_r8, patch_size_pft_r8 - use FatesIOVariableKindMod, only : site_r8, site_ground_r8, site_size_pft_r8 - use FatesIOVariableKindMod, only : site_size_r8, site_pft_r8, site_age_r8 - use FatesIOVariableKindMod, only : site_fuel_r8, site_cwdsc_r8, site_scag_r8 - use FatesIOVariableKindMod, only : site_can_r8, site_cnlf_r8, site_cnlfpft_r8 - use FatesIODimensionsMod, only : fates_bounds_type - - - ! Arguments - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_proc ! Currently "proc" - - - ! Locals - type(bounds_type) :: bounds_clump - integer :: nvar ! number of IO variables found - integer :: ivar ! variable index 1:nvar - integer :: nc ! thread counter 1:nclumps - integer :: nclumps ! number of threads on this proc - integer :: s ! FATES site index - integer :: c ! ALM/CLM column index - character(len=fates_short_string_length) :: dim2name - character(len=fates_long_string_length) :: ioname - integer :: d_index, dk_index - - type(fates_bounds_type) :: fates_bounds - type(fates_bounds_type) :: fates_clump - - ! This routine initializes the types of output variables - ! not the variables themselves, just the types - ! --------------------------------------------------------------------------------- - - nclumps = get_proc_clumps() - - ! ------------------------------------------------------------------------------------ - ! PART I: Set FATES DIMENSIONING INFORMATION - ! - ! ------------------------------------------------------------------------------- - ! Those who wish add variables that require new dimensions, please - ! see FATES: FatesHistoryInterfaceMod.F90. Dimension types are defined at the top of the - ! module, and a new explicitly named instance of that type should be created. - ! With this new dimension, a new output type/kind can contain that dimension. - ! A new type/kind can be added to the dim_kinds structure, which defines its members - ! in created in init_dim_kinds_maps(). Make sure to increase the size of fates_num_dim_kinds. - ! A type/kind of output is defined by the data type (ie r8,int,..) - ! and the dimensions. Keep in mind that 3D variables (or 4D if you include time) - ! are not really supported in CLM/ALM right now. There are ways around this - ! limitations by creating combined dimensions, for instance the size+pft dimension - ! "scpf" - ! ------------------------------------------------------------------------------------ - - call hlm_bounds_to_fates_bounds(bounds_proc, fates_bounds) - - call this%fates_hist%Init(nclumps, fates_bounds) - - ! Define the bounds on the first dimension for each thread - !$OMP PARALLEL DO PRIVATE (nc,bounds_clump,fates_clump) - do nc = 1,nclumps - - call get_clump_bounds(nc, bounds_clump) - - ! thread bounds for patch - call hlm_bounds_to_fates_bounds(bounds_clump, fates_clump) - call this%fates_hist%SetThreadBoundsEach(nc, fates_clump) - end do - !$OMP END PARALLEL DO - - ! ------------------------------------------------------------------------------------ - ! PART I.5: SET SOME INDEX MAPPINGS SPECIFICALLY FOR SITE<->COLUMN AND PATCH - ! ------------------------------------------------------------------------------------ - - !$OMP PARALLEL DO PRIVATE (nc,s,c) - do nc = 1,nclumps - - allocate(this%fates_hist%iovar_map(nc)%site_index(this%fates(nc)%nsites)) - allocate(this%fates_hist%iovar_map(nc)%patch1_index(this%fates(nc)%nsites)) - - do s=1,this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates_hist%iovar_map(nc)%site_index(s) = c - this%fates_hist%iovar_map(nc)%patch1_index(s) = col%patchi(c)+1 - end do - - end do - !$OMP END PARALLEL DO - - ! ------------------------------------------------------------------------------------ - ! PART II: USE THE JUST DEFINED DIMENSIONS TO ASSEMBLE THE VALID IO TYPES - ! INTERF-TODO: THESE CAN ALL BE EMBEDDED INTO A SUBROUTINE IN HISTORYIOMOD - ! ------------------------------------------------------------------------------------ - call this%fates_hist%assemble_history_output_types() - - ! ------------------------------------------------------------------------------------ - ! PART III: DEFINE THE LIST OF OUTPUT VARIABLE OBJECTS, AND REGISTER THEM WITH THE - ! HLM ACCORDING TO THEIR TYPES - ! ------------------------------------------------------------------------------------ - call this%fates_hist%initialize_history_vars() - nvar = this%fates_hist%num_history_vars() - - do ivar = 1, nvar - - associate( vname => this%fates_hist%hvars(ivar)%vname, & - vunits => this%fates_hist%hvars(ivar)%units, & - vlong => this%fates_hist%hvars(ivar)%long, & - vdefault => this%fates_hist%hvars(ivar)%use_default, & - vavgflag => this%fates_hist%hvars(ivar)%avgflag) - - dk_index = this%fates_hist%hvars(ivar)%dim_kinds_index - ioname = trim(this%fates_hist%dim_kinds(dk_index)%name) - - select case(trim(ioname)) - case(patch_r8) - call hist_addfld1d(fname=trim(vname),units=trim(vunits), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=this%fates_hist%hvars(ivar)%r81d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - - case(site_r8) - call hist_addfld1d(fname=trim(vname),units=trim(vunits), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r81d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - - case(patch_ground_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & ! <--- addfld2d - type2d=trim(dim2name), & ! <--- type2d - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - - case(patch_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_patch=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_ground_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_size_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_pft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_age_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_fuel_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cwdsc_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_can_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlf_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_cnlfpft_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - case(site_scag_r8) - d_index = this%fates_hist%dim_kinds(dk_index)%dim2_index - dim2name = this%fates_hist%dim_bounds(d_index)%name - call hist_addfld2d(fname=trim(vname),units=trim(vunits), & - type2d=trim(dim2name), & - avgflag=trim(vavgflag),long_name=trim(vlong), & - ptr_col=this%fates_hist%hvars(ivar)%r82d, & - default=trim(vdefault), & - set_lake=0._r8,set_urb=0._r8) - - - case default - write(iulog,*) 'A FATES iotype was created that was not registerred' - write(iulog,*) 'in CLM.:',trim(ioname) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end select - - end associate - end do - end subroutine init_history_io - - ! ====================================================================================== - - subroutine init_soil_depths(this, nc) - - ! Input Arguments - class(hlm_fates_interface_type), intent(inout) :: this - integer,intent(in) :: nc ! Clump - - ! Locals - integer :: s ! site index - integer :: c ! column index - integer :: j ! Depth index - - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%zi_sisl(0:hlm_numlevsoil) = col%zi(c,0:hlm_numlevsoil) - this%fates(nc)%bc_in(s)%dz_sisl(1:hlm_numlevsoil) = col%dz(c,1:hlm_numlevsoil) - this%fates(nc)%bc_in(s)%z_sisl(1:hlm_numlevsoil) = col%z(c,1:hlm_numlevsoil) - this%fates(nc)%bc_in(s)%dz_decomp_sisl(1:hlm_numlevdecomp_full) = & - dzsoi_decomp(1:hlm_numlevdecomp_full) - end do - - return - end subroutine init_soil_depths - - ! ====================================================================================== - - subroutine ComputeRootSoilFlux(this, bounds_clump, num_filterc, filterc, & - soilstate_inst, waterflux_inst) - - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_clump - integer,intent(in) :: num_filterc - integer,intent(in) :: filterc(num_filterc) - type(soilstate_type), intent(inout) :: soilstate_inst - type(waterflux_type), intent(inout) :: waterflux_inst - - ! locals - integer :: s - integer :: c - integer :: l - integer :: nc - integer :: num_filter_fates - - - if( .not. use_fates_planthydro ) return - - nc = bounds_clump%clump_index - - ! Perform a check that the number of columns submitted to fates for - ! root water sink is the same that was expected in the hydrology filter - num_filter_fates = 0 - do s = 1,num_filterc - l = col%landunit(filterc(s)) - if (lun%itype(l) == istsoil ) then - num_filter_fates = num_filter_fates + 1 - end if - end do - - if(num_filter_fates .ne. this%fates(nc)%nsites )then - write(iulog,*) 'The HLM list of natural veg columns during root water transfer' - write(iulog,*) 'is not the same size as the fates site list?' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - waterflux_inst%qflx_rootsoi_col(c,:) = this%fates(nc)%bc_out(s)%qflx_soil2root_sisl(:) - end do - - end subroutine ComputeRootSoilFlux - - ! ====================================================================================== -! -! THIS WAS MOVED TO WRAP_HYDRAULICS_DRIVE() -! -! subroutine TransferPlantWaterStorage(this, bounds_clump, nc, waterstate_inst) -! -! implicit none -! class(hlm_fates_interface_type), intent(inout) :: this -! type(bounds_type),intent(in) :: bounds_clump -! integer,intent(in) :: nc -! type(waterstate_type) , intent(inout) :: waterstate_inst -! -! ! locals -! integer :: s -! integer :: c -! -! if (.not. (use_fates .and. use_fates_planthydro) ) return -! -! do s = 1, this%fates(nc)%nsites -! c = this%f2hmap(nc)%fcolumn(s) -! waterstate_inst%total_plant_stored_h2o_col(c) = & -! this%fates(nc)%bc_out(s)%plant_stored_h2o_si -! end do -! return -!end subroutine TransferPlantWaterStorage - - - - - ! ====================================================================================== - - subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & - soilstate_inst, waterstate_inst, waterflux_inst, & - solarabs_inst, energyflux_inst) - - - implicit none - class(hlm_fates_interface_type), intent(inout) :: this - type(bounds_type),intent(in) :: bounds_clump - integer,intent(in) :: nc - type(soilstate_type) , intent(inout) :: soilstate_inst - type(waterstate_type) , intent(inout) :: waterstate_inst - type(waterflux_type) , intent(inout) :: waterflux_inst - type(solarabs_type) , intent(inout) :: solarabs_inst - type(energyflux_type) , intent(inout) :: energyflux_inst - - ! locals - integer :: s - integer :: c - integer :: j - integer :: ifp - integer :: p - real(r8) :: dtime - - - if ( .not.use_fates_planthydro ) return - - - dtime = get_step_size() - - ! Prepare Input Boundary Conditions - ! ------------------------------------------------------------------------------------ - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - this%fates(nc)%bc_in(s)%smpmin_si = & - soilstate_inst%smpmin_col(c) - this%fates(nc)%bc_in(s)%watsat_sisl(1:nlevsoi) = & - soilstate_inst%watsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%watres_sisl(1:nlevsoi) = & - soilstate_inst%watres_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%sucsat_sisl(1:nlevsoi) = & - soilstate_inst%sucsat_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%bsw_sisl(1:nlevsoi) = & - soilstate_inst%bsw_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoi) = & - waterstate_inst%h2osoi_liq_col(c,1:nlevsoi) - this%fates(nc)%bc_in(s)%eff_porosity_gl(1:nlevsoi) = & - soilstate_inst%eff_porosity_col(c,1:nlevsoi) - - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp+col%patchi(c) - this%fates(nc)%bc_in(s)%swrad_net_pa(ifp) = solarabs_inst%fsa_patch(p) - this%fates(nc)%bc_in(s)%lwrad_net_pa(ifp) = energyflux_inst%eflx_lwrad_net_patch(p) - this%fates(nc)%bc_in(s)%qflx_transp_pa(ifp) = waterflux_inst%qflx_tran_veg_patch(p) - end do - end do - - ! Call Fates Hydraulics - ! ------------------------------------------------------------------------------------ - - - call hydraulics_drive(this%fates(nc)%nsites, & - this%fates(nc)%sites, & - this%fates(nc)%bc_in, & - this%fates(nc)%bc_out, & - dtime) - - ! Prepare Output Boundary Conditions - ! ------------------------------------------------------------------------------------ - - do s = 1, this%fates(nc)%nsites - c = this%f2hmap(nc)%fcolumn(s) - waterstate_inst%total_plant_stored_h2o_col(c) = & - this%fates(nc)%bc_out(s)%plant_stored_h2o_si - end do - - - ! Update History Buffers that need to be updated after hydraulics calls - - call this%fates_hist%update_history_hydraulics(nc, & - this%fates(nc)%nsites, & - this%fates(nc)%sites, & - dtime) - - - return - end subroutine wrap_hydraulics_drive - - ! ====================================================================================== - - subroutine hlm_bounds_to_fates_bounds(hlm, fates) - - use FatesIODimensionsMod, only : fates_bounds_type - use FatesInterfaceMod, only : nlevsclass, nlevage - use EDtypesMod, only : nfsc, ncwd - use EDtypesMod, only : nlevleaf, nclmax - use FatesInterfaceMod, only : numpft_ed => numpft - use clm_varpar, only : nlevgrnd - - implicit none - - type(bounds_type), intent(in) :: hlm - type(fates_bounds_type), intent(out) :: fates - - fates%cohort_begin = hlm%begcohort - fates%cohort_end = hlm%endcohort - - fates%patch_begin = hlm%begp - fates%patch_end = hlm%endp - - fates%column_begin = hlm%begc - fates%column_end = hlm%endc - - fates%ground_begin = 1 - fates%ground_end = nlevgrnd - - fates%sizepft_class_begin = 1 - fates%sizepft_class_end = nlevsclass * numpft_ed - - fates%size_class_begin = 1 - fates%size_class_end = nlevsclass - - fates%pft_class_begin = 1 - fates%pft_class_end = numpft_ed - - fates%age_class_begin = 1 - fates%age_class_end = nlevage - - fates%sizeage_class_begin = 1 - fates%sizeage_class_end = nlevsclass * nlevage - - fates%fuel_begin = 1 - fates%fuel_end = nfsc - - fates%cwdsc_begin = 1 - fates%cwdsc_end = ncwd - - fates%can_begin = 1 - fates%can_end = nclmax - - fates%cnlf_begin = 1 - fates%cnlf_end = nlevleaf * nclmax - - fates%cnlfpft_begin = 1 - fates%cnlfpft_end = nlevleaf * nclmax * numpft_ed - - end subroutine hlm_bounds_to_fates_bounds - -end module CLMFatesInterfaceMod diff --git a/src/utils/clmfates_paraminterfaceMod.F90 b/src/utils/clmfates_paraminterfaceMod.F90 deleted file mode 100644 index 4fc12fdc31..0000000000 --- a/src/utils/clmfates_paraminterfaceMod.F90 +++ /dev/null @@ -1,240 +0,0 @@ -module CLMFatesParamInterfaceMod - ! NOTE(bja, 2017-01) this code can not go into the main clm-fates - ! interface module because of circular dependancies with pftvarcon. - - use FatesGlobals, only : fates_log - - implicit none - - ! NOTE(bja, 2017-01) these methods can NOT be part of the clmi-fates - ! nterface type because they are called before the instance is - ! initialized. - public :: FatesReadParameters - public :: FatesReadPFTs - private :: ParametersFromNetCDF - private :: SetParameterDimensions - private :: GetUsedDimensionSizes - - logical :: DEBUG = .false. - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine FatesReadParameters() - - use clm_varctl, only : use_fates, paramfile, fates_paramfile - use spmdMod, only : masterproc - - use FatesParametersInterface, only : fates_parameters_type - - use EDParamsMod, only : FatesRegisterParams, FatesReceiveParams - use SFParamsMod, only : SpitFireRegisterParams, SpitFireReceiveParams - use FatesSynchronizedParamsMod, only : FatesSynchronizedParamsInst - - implicit none - - character(len=32) :: subname = 'FatesReadParameters' - class(fates_parameters_type), allocatable :: fates_params - logical :: is_host_file - - if (use_fates) then - if (masterproc) then - write(fates_log(), *) 'clmfates_interfaceMod.F90::'//trim(subname)//' :: CLM reading ED/FATES '//' parameters ' - end if - - allocate(fates_params) - call fates_params%Init() - call FatesRegisterParams(fates_params) - call SpitFireRegisterParams(fates_params) - call FatesSynchronizedParamsInst%RegisterParams(fates_params) - - is_host_file = .false. - call ParametersFromNetCDF(fates_paramfile, is_host_file, fates_params) - - is_host_file = .true. - call ParametersFromNetCDF(paramfile, is_host_file, fates_params) - - call FatesReceiveParams(fates_params) - call SpitFireReceiveParams(fates_params) - call FatesSynchronizedParamsInst%ReceiveParams(fates_params) - - call fates_params%Destroy() - deallocate(fates_params) - end if - - end subroutine FatesReadParameters - - !----------------------------------------------------------------------- - subroutine FatesReadPFTs() - - use clm_varctl, only : use_fates, paramfile, fates_paramfile - use spmdMod, only : masterproc - - use FatesParametersInterface, only : fates_parameters_type - use EDPftvarcon , only : EDPftvarcon_inst - - use fileutils , only : getfil - use ncdio_pio , only : file_desc_t, ncd_pio_closefile, ncd_pio_openfile - - implicit none - - character(len=32) :: subname = 'FatesReadPFTs' - class(fates_parameters_type), allocatable :: fates_params - logical :: is_host_file - - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! pio netCDF file id - - if (use_fates) then - if (masterproc) then - write(fates_log(), *) 'clmfates_interfaceMod.F90::'//trim(subname)//' :: CLM reading ED/FATES '//' PFTs ' - end if - - allocate(fates_params) - call fates_params%Init() - call EDPftvarcon_inst%Init() - - call EDPftvarcon_inst%Register(fates_params) - - is_host_file = .false. - call ParametersFromNetCDF(fates_paramfile, is_host_file, fates_params) - - is_host_file = .true. - call ParametersFromNetCDF(paramfile, is_host_file, fates_params) - - call EDPftvarcon_inst%Receive(fates_params) - - call fates_params%Destroy() - deallocate(fates_params) - end if - - end subroutine FatesReadPFTs - - !----------------------------------------------------------------------- - subroutine SetParameterDimensions(ncid, is_host_file, fates_params) - ! Get the list of dimensions used by the fates parameters, - ! retreive them from the parameter file, then give the information - ! back to fates. - use FatesParametersInterface, only : fates_parameters_type, param_string_length, max_dimensions, max_used_dimensions - use ncdio_pio , only : file_desc_t - - implicit none - - type(file_desc_t), intent(inout) :: ncid - logical, intent(in) :: is_host_file - class(fates_parameters_type), intent(inout) :: fates_params - - integer :: num_used_dimensions - character(len=param_string_length) :: used_dimension_names(max_used_dimensions) - integer :: used_dimension_sizes(max_used_dimensions) - - call fates_params%GetUsedDimensions(is_host_file, num_used_dimensions, used_dimension_names) - - call GetUsedDimensionSizes(ncid, num_used_dimensions, used_dimension_names, used_dimension_sizes) - - call fates_params%SetDimensionSizes(is_host_file, num_used_dimensions, used_dimension_names, used_dimension_sizes) - - end subroutine SetParameterDimensions - - !----------------------------------------------------------------------- - subroutine GetUsedDimensionSizes(ncid, num_used_dimensions, dimension_names, dimension_sizes) - - use ncdio_pio , only : ncd_inqdid, ncd_inqdlen - use FatesParametersInterface, only : param_string_length - use ncdio_pio, only : file_desc_t - - - implicit none - - type(file_desc_t), intent(inout) :: ncid - integer, intent(in) :: num_used_dimensions - character(len=param_string_length), intent(in) :: dimension_names(:) - integer, intent(out) :: dimension_sizes(:) - - integer :: d, max_dim_size, num_dims - integer :: dim_len, dim_id - - dimension_sizes(:) = 0 - max_dim_size = 0 - - do d = 1, num_used_dimensions - call ncd_inqdid(ncid, dimension_names(d), dim_id) - call ncd_inqdlen(ncid, dim_id, dim_len) - dimension_sizes(d) = dim_len - !write(*, *) '--> ', trim(dimension_names(d)), ' setting size ', dimension_sizes(d) - end do - - end subroutine GetUsedDimensionSizes - - !----------------------------------------------------------------------- - subroutine ParametersFromNetCDF(filename, is_host_file, fates_params) - - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils, only : endrun - use fileutils , only : getfil - use ncdio_pio , only : file_desc_t, ncd_pio_closefile, ncd_pio_openfile - use paramUtilMod, only : readNcdio - - use FatesParametersInterface, only : fates_parameters_type - use FatesParametersInterface, only : param_string_length, max_dimensions, max_used_dimensions - use FatesParametersInterface, only : dimension_shape_scalar, dimension_shape_1d, dimension_shape_2d - - implicit none - - character(len=*), intent(in) :: filename - logical, intent(in) :: is_host_file - class(fates_parameters_type), intent(inout) :: fates_params - - character(len=32) :: subname = 'clmfates_interface::ReadParameters' - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! pio netCDF file id - integer :: dimid ! netCDF dimension id - integer :: i, num_params, dimension_shape - integer :: max_dim_size - real(r8), allocatable :: data(:, :) - character(len=param_string_length) :: name - integer :: dimension_sizes(max_dimensions) - character(len=param_string_length) :: dimension_names(max_dimensions) - integer :: size_dim_1, size_dim_2 - logical :: is_host_param - - call getfil (filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call SetParameterDimensions(ncid, is_host_file, fates_params) - max_dim_size = fates_params%GetMaxDimensionSize() - allocate(data(max_dim_size, max_dim_size)) - - num_params = fates_params%num_params() - do i = 1, num_params - call fates_params%GetMetaData(i, name, dimension_shape, dimension_sizes, dimension_names, is_host_param) - if (is_host_file .eqv. is_host_param) then - select case(dimension_shape) - case(dimension_shape_scalar) - size_dim_1 = 1 - size_dim_2 = 1 - case(dimension_shape_1d) - size_dim_1 = dimension_sizes(1) - size_dim_2 = 1 - case(dimension_shape_2d) - size_dim_1 = dimension_sizes(1) - size_dim_2 = dimension_sizes(2) - case default - write(fates_log(),*) 'dimension shape:',dimension_shape - call endrun(msg='unsupported number of dimensions reading parameters.') - - end select - write(fates_log(), *) 'clmfates_interfaceMod.F90:: reading '//trim(name) - call readNcdio(ncid, name, dimension_shape, dimension_names, subname, data(1:size_dim_1, 1:size_dim_2)) - call fates_params%SetData(i, data(1:size_dim_1, 1:size_dim_2)) - end if - end do - deallocate(data) - call ncd_pio_closefile(ncid) - end subroutine ParametersFromNetCDF - !----------------------------------------------------------------------- - -end module CLMFatesParamInterfaceMod diff --git a/src/utils/domainMod.F90 b/src/utils/domainMod.F90 deleted file mode 100644 index 7cdd62b41f..0000000000 --- a/src/utils/domainMod.F90 +++ /dev/null @@ -1,233 +0,0 @@ -module domainMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: domainMod -! -! !DESCRIPTION: -! Module containing 2-d global surface boundary data information -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_abort - use spmdMod , only : masterproc - use clm_varctl , only : iulog -! -! !PUBLIC TYPES: - implicit none - private -! - public :: domain_type - - !--- this typically contains local domain info with arrays dim begg:endg --- - type domain_type - integer :: ns ! global size of domain - integer :: ni,nj ! global axis if 2d (nj=1 if unstructured) - logical :: isgrid2d ! true => global grid is lat/lon - integer :: nbeg,nend ! local beg/end indices - character(len=8) :: clmlevel ! grid type - integer ,pointer :: mask(:) ! land mask: 1 = land, 0 = ocean - real(r8),pointer :: frac(:) ! fractional land - real(r8),pointer :: latc(:) ! latitude of grid cell (deg) - real(r8),pointer :: lonc(:) ! longitude of grid cell (deg) - real(r8),pointer :: area(:) ! grid cell area (km**2) - integer ,pointer :: pftm(:) ! pft mask: 1=real, 0=fake, -1=notset - character*16 :: set ! flag to check if domain is set - logical :: decomped ! decomposed locally or global copy - end type domain_type - - type(domain_type) , public :: ldomain - real(r8), allocatable, public :: lon1d(:), lat1d(:) ! 1d lat/lons for 2d grids -! -! !PUBLIC MEMBER FUNCTIONS: - public domain_init ! allocates/nans domain types - public domain_clean ! deallocates domain types - public domain_check ! write out domain info -! -! !REVISION HISTORY: -! Originally clm_varsur by Mariana Vertenstein -! Migrated from clm_varsur to domainMod by T Craig -! - character*16,parameter :: set = 'domain_set ' - character*16,parameter :: unset = 'NOdomain_unsetNO' -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_init -! -! !INTERFACE: - subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,clmlevel) - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) -! -! !DESCRIPTION: -! This subroutine allocates and nans the domain type -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(domain_type) :: domain ! domain datatype - logical, intent(in) :: isgrid2d ! true => global grid is lat/lon - integer, intent(in) :: ni,nj ! grid size, 2d - integer , intent(in), optional :: nbeg,nend ! beg/end indices - character(len=*), intent(in), optional :: clmlevel ! grid type -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer ier - integer nb,ne -! -!------------------------------------------------------------------------------ - - nb = 1 - ne = ni*nj - if (present(nbeg)) then - if (present(nend)) then - nb = nbeg - ne = nend - endif - endif - - if (domain%set == set) then - call domain_clean(domain) - endif - allocate(domain%mask(nb:ne),domain%frac(nb:ne),domain%latc(nb:ne), & - domain%pftm(nb:ne),domain%area(nb:ne),domain%lonc(nb:ne), & - stat=ier) - if (ier /= 0) then - call shr_sys_abort('domain_init ERROR: allocate mask, frac, lat, lon, area ') - endif - - if (present(clmlevel)) then - domain%clmlevel = clmlevel - endif - - domain%isgrid2d = isgrid2d - domain%ns = ni*nj - domain%ni = ni - domain%nj = nj - domain%nbeg = nb - domain%nend = ne - domain%mask = -9999 - domain%frac = -1.0e36 - domain%latc = nan - domain%lonc = nan - domain%area = nan - - domain%set = set - if (domain%nbeg == 1 .and. domain%nend == domain%ns) then - domain%decomped = .false. - else - domain%decomped = .true. - endif - - domain%pftm = -9999 - -end subroutine domain_init -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_clean -! -! !INTERFACE: - subroutine domain_clean(domain) -! -! !DESCRIPTION: -! This subroutine deallocates the domain type -! -! !ARGUMENTS: - implicit none - type(domain_type) :: domain ! domain datatype -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer ier -! -!------------------------------------------------------------------------------ - if (domain%set == set) then - if (masterproc) then - write(iulog,*) 'domain_clean: cleaning ',domain%ni,domain%nj - endif - deallocate(domain%mask,domain%frac,domain%latc, & - domain%lonc,domain%area,domain%pftm, & - stat=ier) - if (ier /= 0) then - call shr_sys_abort('domain_clean ERROR: deallocate mask, frac, lat, lon, area ') - endif - else - if (masterproc) then - write(iulog,*) 'domain_clean WARN: clean domain unecessary ' - endif - endif - - domain%clmlevel = unset - domain%ns = huge(1) - domain%ni = huge(1) - domain%nj = huge(1) - domain%nbeg = huge(1) - domain%nend = huge(1) - domain%set = unset - domain%decomped = .true. - -end subroutine domain_clean -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_check -! -! !INTERFACE: - subroutine domain_check(domain) -! -! !DESCRIPTION: -! This subroutine write domain info -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(domain_type),intent(in) :: domain ! domain datatype -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -! -!EOP -!------------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*) ' domain_check set = ',trim(domain%set) - write(iulog,*) ' domain_check decomped = ',domain%decomped - write(iulog,*) ' domain_check ns = ',domain%ns - write(iulog,*) ' domain_check ni,nj = ',domain%ni,domain%nj - write(iulog,*) ' domain_check clmlevel = ',trim(domain%clmlevel) - write(iulog,*) ' domain_check nbeg,nend = ',domain%nbeg,domain%nend - write(iulog,*) ' domain_check lonc = ',minval(domain%lonc),maxval(domain%lonc) - write(iulog,*) ' domain_check latc = ',minval(domain%latc),maxval(domain%latc) - write(iulog,*) ' domain_check mask = ',minval(domain%mask),maxval(domain%mask) - write(iulog,*) ' domain_check frac = ',minval(domain%frac),maxval(domain%frac) - write(iulog,*) ' domain_check area = ',minval(domain%area),maxval(domain%area) - write(iulog,*) ' domain_check pftm = ',minval(domain%pftm),maxval(domain%pftm) - write(iulog,*) ' ' - endif - -end subroutine domain_check - -!------------------------------------------------------------------------------ - -end module domainMod diff --git a/src/utils/dtypes.h b/src/utils/dtypes.h deleted file mode 100644 index 977e95ad75..0000000000 --- a/src/utils/dtypes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TYPEDOUBLE 102 -#define TYPEINT 103 -#define TYPETEXT 100 -#define TYPELONG 104 -#define TYPEREAL 101 -#define TYPELOGICAL 105 diff --git a/src/utils/fileutils.F90 b/src/utils/fileutils.F90 deleted file mode 100644 index b74af42426..0000000000 --- a/src/utils/fileutils.F90 +++ /dev/null @@ -1,179 +0,0 @@ -module fileutils - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing file I/O utilities - ! - ! !USES: - use shr_sys_mod , only : shr_sys_abort - use clm_varctl , only : iulog - use spmdMod , only : masterproc - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: get_filename !Returns filename given full pathname - public :: opnfil !Open local unformatted or formatted file - public :: getfil !Obtain local copy of file - public :: relavu !Close and release Fortran unit no longer in use - public :: getavu !Get next available Fortran unit number - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - character(len=256) function get_filename (fulpath) - ! - ! !DESCRIPTION: - ! Returns filename given full pathname - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fulpath !full pathname - ! - ! !LOCAL VARIABLES: - integer i !loop index - integer klen !length of fulpath character string - !------------------------------------------------------------------------ - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i) == '/') go to 10 - end do - i = 0 -10 get_filename = fulpath(i+1:klen) - - return - end function get_filename - - !------------------------------------------------------------------------ - subroutine getfil (fulpath, locfn, iflag) - ! - ! !DESCRIPTION: - ! Obtain local copy of file - ! First check current working directory - ! Next check full pathname[fulpath] on disk - ! - ! !USES: - use shr_file_mod, only: shr_file_get - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fulpath !Archival or permanent disk full pathname - character(len=*), intent(out) :: locfn !output local file name - integer, intent(in) :: iflag !0=>abort if file not found 1=>do not abort - ! - ! !LOCAL VARIABLES: - integer i !loop index - integer klen !length of fulpath character string - logical lexist !true if local file exists - !------------------------------------------------------------------------ - - ! get local file name from full name - - locfn = get_filename( fulpath ) - if (len_trim(locfn) == 0) then - if (masterproc) write(iulog,*)'(GETFIL): local filename has zero length' - call shr_sys_abort - else - if (masterproc) write(iulog,*)'(GETFIL): attempting to find local file ', & - trim(locfn) - endif - - ! first check if file is in current working directory. - - inquire (file=locfn,exist=lexist) - if (lexist) then - if (masterproc) write(iulog,*) '(GETFIL): using ',trim(locfn), & - ' in current working directory' - RETURN - endif - - ! second check for full pathname on disk - locfn = fulpath - - inquire (file=fulpath,exist=lexist) - if (lexist) then - if (masterproc) write(iulog,*) '(GETFIL): using ',trim(fulpath) - RETURN - else - if (masterproc) write(iulog,*)'(GETFIL): failed getting file from full path: ', fulpath - if (iflag==0) then - call shr_sys_abort ('GETFIL: FAILED to get '//trim(fulpath)) - else - RETURN - endif - endif - - end subroutine getfil - - !------------------------------------------------------------------------ - subroutine opnfil (locfn, iun, form) - ! - ! !DESCRIPTION: - ! Open file locfn in unformatted or formatted form on unit iun - ! - ! !ARGUMENTS: - character(len=*), intent(in):: locfn !file name - integer, intent(in):: iun !fortran unit number - character(len=1), intent(in):: form !file format: u = unformatted, f = formatted - ! - ! !LOCAL VARIABLES: - integer ioe !error return from fortran open - character(len=11) ft !format type: formatted. unformatted - !------------------------------------------------------------------------ - - if (len_trim(locfn) == 0) then - write(iulog,*)'(OPNFIL): local filename has zero length' - call shr_sys_abort - endif - if (form=='u' .or. form=='U') then - ft = 'unformatted' - else - ft = 'formatted ' - end if - open (unit=iun,file=locfn,status='unknown',form=ft,iostat=ioe) - if (ioe /= 0) then - write(iulog,*)'(OPNFIL): failed to open file ',trim(locfn), & - & ' on unit ',iun,' ierr=',ioe - call shr_sys_abort - else if ( masterproc )then - write(iulog,*)'(OPNFIL): Successfully opened file ',trim(locfn), & - & ' on unit= ',iun - end if - - end subroutine opnfil - - !------------------------------------------------------------------------ - integer function getavu() - ! - ! !DESCRIPTION: - ! Get next available Fortran unit number. - ! - ! !USES: - use shr_file_mod, only : shr_file_getUnit - !------------------------------------------------------------------------ - - getavu = shr_file_getunit() - - end function getavu - - !------------------------------------------------------------------------ - subroutine relavu (iunit) - ! - ! !DESCRIPTION: - ! Close and release Fortran unit no longer in use! - ! - ! !USES: - use shr_file_mod, only : shr_file_freeUnit - ! - ! !ARGUMENTS: - integer, intent(in) :: iunit !Fortran unit number - !------------------------------------------------------------------------ - - close(iunit) - call shr_file_freeUnit(iunit) - - end subroutine relavu - -end module fileutils diff --git a/src/utils/getdatetime.F90 b/src/utils/getdatetime.F90 deleted file mode 100644 index 4126d807e4..0000000000 --- a/src/utils/getdatetime.F90 +++ /dev/null @@ -1,53 +0,0 @@ -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: getdatetime -! -! !INTERFACE: -subroutine getdatetime (cdate, ctime) -! -! !DESCRIPTION: -! A generic Date and Time routine -! -! !USES: - use spmdMod , only : mpicom, masterproc, MPI_CHARACTER -! !ARGUMENTS: - implicit none - character(len=8), intent(out) :: cdate !current date - character(len=8), intent(out) :: ctime !current time -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=8) :: date !current date - character(len=10) :: time !current time - character(len=5) :: zone !zone - integer, dimension(8) :: values !temporary - integer :: ier !MPI error code -!----------------------------------------------------------------------- - if (masterproc) then - - call date_and_time (date, time, zone, values) - - cdate(1:2) = date(5:6) - cdate(3:3) = '/' - cdate(4:5) = date(7:8) - cdate(6:6) = '/' - cdate(7:8) = date(3:4) - - ctime(1:2) = time(1:2) - ctime(3:3) = ':' - ctime(4:5) = time(3:4) - ctime(6:6) = ':' - ctime(7:8) = time(5:6) - - endif - - call mpi_bcast (cdate,len(cdate),MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (ctime,len(ctime),MPI_CHARACTER, 0, mpicom, ier) - - return -end subroutine getdatetime diff --git a/src/utils/quadraticMod.F90 b/src/utils/quadraticMod.F90 deleted file mode 100644 index 87bb250945..0000000000 --- a/src/utils/quadraticMod.F90 +++ /dev/null @@ -1,76 +0,0 @@ -module quadraticMod - - use abortutils , only: endrun - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only: errMsg => shr_log_errMsg - use clm_varctl , only: iulog - - implicit none - - public :: quadratic - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - subroutine quadratic (a, b, c, r1, r2) - ! - ! !DESCRIPTION: - !==============================================================================! - !----------------- Solve quadratic equation for its two roots -----------------! - !==============================================================================! - ! Solution from Press et al (1986) Numerical Recipes: The Art of Scientific - ! Computing (Cambridge University Press, Cambridge), pp. 145. - ! - ! !REVISION HISTORY: - ! 4/5/10: Adapted from /home/bonan/ecm/psn/An_gs_iterative.f90 by Keith Oleson - ! - ! !USES: - implicit none - ! - ! !ARGUMENTS: - real(r8), intent(in) :: a,b,c ! Terms for quadratic equation - real(r8), intent(out) :: r1,r2 ! Roots of quadratic equation - ! - ! !LOCAL VARIABLES: - real(r8) :: q ! Temporary term for quadratic solution - real(r8) :: root ! Term that will have a square root taken - character(len=*), parameter :: subname = 'quadratic' - !------------------------------------------------------------------------------ - - if (a == 0._r8) then - write (iulog,*) subname//' ERROR: Quadratic solution error: a = ',a - write (iulog,*) errmsg(sourcefile, __LINE__) - call endrun(msg=subname//' ERROR: Quadratic solution error' ) - return - end if - - root = b*b - 4._r8*a*c - if ( root < 0.0 )then - if ( -root < 3.0_r8*epsilon(b) )then - root = 0.0_r8 - else - write (iulog,*) subname//' ERROR: Quadratic solution error: b^2 - 4ac is negative = ', root - write (iulog,*) errmsg(sourcefile, __LINE__) - call endrun( msg=subname//' ERROR: Quadratic solution error: b^2 - 4ac is negative' ) - return - end if - end if - - if (b >= 0._r8) then - q = -0.5_r8 * (b + sqrt(root)) - else - q = -0.5_r8 * (b - sqrt(root)) - end if - - r1 = q / a - if (q /= 0._r8) then - r2 = c / q - else - r2 = 1.e36_r8 - end if - - end subroutine quadratic - -end module quadraticMod diff --git a/src/utils/restUtilMod.F90.in b/src/utils/restUtilMod.F90.in deleted file mode 100644 index c3e8bafc9c..0000000000 --- a/src/utils/restUtilMod.F90.in +++ /dev/null @@ -1,701 +0,0 @@ -module restUtilMod - - !----------------------------------------------------------------------- - ! provies generic routines and types for use with restart files - ! -#include "shr_assert.h" - use shr_log_mod , only: errMsg => shr_log_errMsg - use shr_kind_mod, only: r8=>shr_kind_r8, r4 => shr_kind_r4, i4=>shr_kind_i4 - use shr_sys_mod, only: shr_sys_abort - use spmdMod, only: masterproc - use clm_varctl, only: iulog, nsrest, nsrContinue, nsrBranch - use clm_varcon, only: spval, ispval - use decompMod, only: bounds_type - use abortutils, only: endrun - use ncdio_pio - use pio - use ncdio_utils, only: find_var_on_file - use shr_string_mod, only: shr_string_listGetName - ! - implicit none - save - private - ! save - ! - !----------------------------------------------------------------------- - - interface restartvar - !DIMS 0,1,2 - !TYPE text,int,double - module procedure restartvar_{DIMS}d_{TYPE} - !TYPE int,double - module procedure restartvar_2d_{TYPE}_bounds - end interface restartvar - - ! iflag_interp => interpolate variable - ! iflag_copy => copy variable - ! iflag_skip => skip variable: maintain at cold start value on output file - ! iflag_area => area-related variable: skip if we're taking areas from the surface - ! dataset, interp if we're taking areas from the input finidat file. (The latter only - ! works if we're running at the same resolution with a similar configuration.) This - ! can apply to variables that are not actually areas, but for which we want this same - ! conditional behavior. - integer,parameter, public :: iflag_interp = 1 - integer,parameter, public :: iflag_copy = 2 - integer,parameter, public :: iflag_skip = 3 - integer,parameter, public :: iflag_area = 4 - - integer,parameter, public :: iflag_noswitchdim = 0 - integer,parameter, public :: iflag_switchdim = 1 - - public :: restartvar - - ! Set values of a missing restart field from a template field, with some constant - ! multiplier - public :: set_missing_from_template - - ! Set a gridcell-level field from a column-level field - public :: set_grc_field_from_col_field - - ! Set any NaN or spval entries in a field to some constant value - interface set_missing_vals_to_constant - !DIMS 1,2 - module procedure set_missing_vals_to_constant_{DIMS}d - end interface set_missing_vals_to_constant - public :: set_missing_vals_to_constant - - private :: missing_field_possibly_abort - private :: write_interpinic_flag - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - !DIMS 0 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - ! Note that varname can be a colon-delimited list of possible variable names (with no - ! spaces around the colons). In this case, when flag = 'read', the input file is - ! searched for each possible variable name in order, starting with the first, until - ! one is found. This mechanism supports backwards compatibility with old restart - ! files, in case variables have been renamed. For example, if variable 'foo' was - ! recently renamed to 'bar', then varname should be 'bar:foo'. For flag = 'write', - ! the first name in the list is used. - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name (or colon-delimited list: see above) - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic ('interp', 'copy', 'skip' or 'area': see iflag meanings defined at the top of this module) - {VTYPE} , intent(inout) :: data{DIMSTR} - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - character(len=len(varname)) :: primary_varname ! first name in the varname list - character(len=len(varname)) :: my_varname ! actual varname to read/write - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - call shr_string_listGetName(varname, 1, primary_varname) - if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) - if ((my_varname /= primary_varname) .and. masterproc) then - write(iulog,*) 'Restart file backwards compatibility: Translating: ', & - trim(my_varname), ' => ', trim(primary_varname) - end if - else - my_varname = primary_varname - end if - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - - status = PIO_inq_varid(ncid, trim(my_varname), vardesc) - varid = vardesc%varid - - call write_interpinic_flag(ncid=ncid, varid=varid, varname=varname, & - interpinic_flag=interpinic_flag) - - ! This attribute is written in order to communicate this metadata to initInterp - call ncd_putatt(ncid, varid, 'varnames_on_old_files', trim(varname)) - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if ({ITYPE}!=TYPETEXT) - call ncd_io(varname=trim(my_varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) -#endif - end if - - if (flag == 'read') then - if (.not. readvar) then - call missing_field_possibly_abort(my_varname) - end if - end if - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - !DIMS 1,2 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range, is_spatial ) - - ! Note that varname can be a colon-delimited list of possible variable names (with no - ! spaces around the colons). In this case, when flag = 'read', the input file is - ! searched for each possible variable name in order, starting with the first, until - ! one is found. This mechanism supports backwards compatibility with old restart - ! files, in case variables have been renamed. For example, if variable 'foo' was - ! recently renamed to 'bar', then varname should be 'bar:foo'. For flag = 'write', - ! the first name in the list is used. - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name (or colon-delimited list: see above) - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic ('interp', 'copy', 'skip' or 'area': see iflag meanings defined at the top of this module) - {VTYPE} , pointer :: data{DIMSTR} - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - logical , intent(in), optional :: is_spatial ! is this a spatial variable (with a dimension of gridcell, column, etc.)? If not present, assumed true. - ! - ! Local variables - character(len=len(varname)) :: primary_varname ! first name in the varname list - character(len=len(varname)) :: my_varname ! actual varname to read/write - logical :: l_is_spatial ! local version of is_spatial - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (present(is_spatial)) then - l_is_spatial = is_spatial - else - l_is_spatial = .true. - end if - - call shr_string_listGetName(varname, 1, primary_varname) - if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) - if ((my_varname /= primary_varname) .and. masterproc) then - write(iulog,*) 'Restart file backwards compatibility: Translating: ', & - trim(my_varname), ' => ', trim(primary_varname) - end if - else - my_varname = primary_varname - end if - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(my_varname), vardesc) - varid = vardesc%varid - - call write_interpinic_flag(ncid=ncid, varid=varid, varname=varname, & - interpinic_flag=interpinic_flag) - - ! This attribute is written in order to communicate this metadata to initInterp - call ncd_putatt(ncid, varid, 'varnames_on_old_files', trim(varname)) - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if ({ITYPE}!=TYPETEXT) - if (.not. present(dim1name) .or. .not. l_is_spatial) then - call ncd_io(varname=trim(my_varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(my_varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar) then - call missing_field_possibly_abort(my_varname) - end if - end if - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - !TYPE int,double - subroutine restartvar_2d_{TYPE}_bounds(ncid, flag, varname, xtype, & - dim1name, dim2name, switchdim, lowerb2, upperb2, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - ! Note that varname can be a colon-delimited list of possible variable names (with no - ! spaces around the colons). In this case, when flag = 'read', the input file is - ! searched for each possible variable name in order, starting with the first, until - ! one is found. This mechanism supports backwards compatibility with old restart - ! files, in case variables have been renamed. For example, if variable 'foo' was - ! recently renamed to 'bar', then varname should be 'bar:foo'. For flag = 'write', - ! the first name in the list is used. - - !---------------------------------------------------- - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name (or colon-delimited list: see above) - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: dim1name ! dimension name - character(len=*) , intent(in) :: dim2name ! dimension name - logical , intent(in) :: switchdim - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic ('interp', 'copy', 'skip' or 'area': see iflag meanings defined at the top of this module) - {VTYPE} , pointer :: data(:,:) ! raw data - logical , intent(out) :: readvar ! was var read? - integer , intent(in), optional :: lowerb2 - integer , intent(in), optional :: upperb2 - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - character(len=len(varname)) :: primary_varname ! first name in the varname list - character(len=len(varname)) :: my_varname ! actual varname to read/write - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid ! returned var id - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - call shr_string_listGetName(varname, 1, primary_varname) - if (flag == 'read') then - call find_var_on_file(ncid, varname, my_varname) - if ((my_varname /= primary_varname) .and. masterproc) then - write(iulog,*) 'Restart file backwards compatibility: Translating: ', & - trim(my_varname), ' => ', trim(primary_varname) - end if - else - my_varname = primary_varname - end if - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (switchdim) then - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - dim1name=trim(dim2name), dim2name=trim(dim1name), & - long_name=trim(long_name), units=units) - else - call ncd_defvar(ncid=ncid, varname=trim(my_varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - status = PIO_inq_varid(ncid, trim(my_varname), vardesc) - - varid = vardesc%varid - - call write_interpinic_flag(ncid=ncid, varid=varid, varname=varname, & - interpinic_flag=interpinic_flag) - - ! This attribute is written in order to communicate this metadata to initInterp - call ncd_putatt(ncid, varid, 'varnames_on_old_files', trim(varname)) - - if (switchdim) then - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 1) - else - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 0) - end if - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_values', (/0,1/)) - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_0', & - "1st and 2nd dims are same as model representation") - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_1', & - "1st and 2nd dims are switched from model representation") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else - - if (present(lowerb2) .and. present(upperb2)) then - call ncd_io(varname=trim(my_varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - lowerb2=lowerb2, upperb2=upperb2, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(my_varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - ncid=ncid, flag=flag, readvar=readvar) - end if - - end if - - if (flag == 'read') then - if (.not. readvar) then - call missing_field_possibly_abort(my_varname) - end if - end if - - end subroutine restartvar_2d_{TYPE}_bounds - - !----------------------------------------------------------------------- - subroutine set_missing_from_template(my_var, template_var, multiplier) - ! - ! !DESCRIPTION: - ! Set values of a missing restart field from a template field, with some constant - ! multiplier - ! - ! !USES: - use shr_infnan_mod, only : isnan => shr_infnan_isnan, nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - real(r8), intent(out) :: my_var(:) - real(r8), intent(in) :: template_var(:) - real(r8), intent(in) :: multiplier - ! - ! !LOCAL VARIABLES: - integer :: i - - character(len=*), parameter :: subname = 'set_missing_from_template' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(template_var) == ubound(my_var)), errMsg(sourcefile, __LINE__)) - - do i = 1, size(my_var) - if (isnan(template_var(i))) then - my_var(i) = nan - else if (template_var(i) == spval) then - my_var(i) = spval - else - my_var(i) = template_var(i) * multiplier - end if - end do - - end subroutine set_missing_from_template - - !----------------------------------------------------------------------- - subroutine set_grc_field_from_col_field(bounds, ncid, varname, data_grc, readvar) - ! - ! !DESCRIPTION: - ! Set a gridcell-level field from a column-level field on the restart file. - ! - ! If the column-level field isn't found, then 'data' remains unchanged, and readvar - ! is set to .false. - ! - ! This can be useful for backwards compatibility: If a field that was previously on - ! the column level has been moved to the gridcell-level, then this routine can be - ! used to read the old column-level field and then average it to the gridcell-level. - ! - ! We may want to make this more general, so that a single routine can set a - ! gridcell-level field from a patch-, column- or landunit-level field - and maybe - ! also set a column-level field from a patch-level field, etc. - ! - ! !USES: - use subgridAveMod, only : c2g - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname ! variable name - real(r8) , intent(inout) :: data_grc( bounds%begg: ) ! gridcell-level data to set - logical , intent(out) :: readvar ! was var read? - ! - ! !LOCAL VARIABLES: - real(r8), pointer :: data_col(:) - - character(len=*), parameter :: subname = 'set_grc_field_from_col_field' - !----------------------------------------------------------------------- - - SHR_ASSERT_ALL((ubound(data_grc) == (/bounds%endg/)), errMsg(sourcefile, __LINE__)) - - allocate(data_col(bounds%begc:bounds%endc)) - call ncd_io(varname=trim(varname), data=data_col, & - dim1name='column', & - ncid=ncid, flag='read', readvar=readvar) - - if (readvar) then - call c2g(bounds, data_col, data_grc, & - c2l_scale_type = 'unity', & - l2g_scale_type = 'unity') - end if - - deallocate(data_col) - end subroutine set_grc_field_from_col_field - - !----------------------------------------------------------------------- - ! DIMS 1,2 - subroutine set_missing_vals_to_constant_{DIMS}d(data, val) - ! - ! !DESCRIPTION: - ! Set missing values (NaN or spval) of a restart field to some constant value - ! - ! !USES: - use shr_infnan_mod, only : isnan => shr_infnan_isnan - ! - ! !ARGUMENTS: - real(r8), intent(inout) :: data{DIMSTR} ! variable to modify - real(r8), intent(in) :: val ! value to replace any NaNs or spvals - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'set_missing_vals_to_constant_{DIMS}d' - !----------------------------------------------------------------------- - - where (isnan(data)) - data = val - elsewhere (data == spval) - data = val - end where - - end subroutine set_missing_vals_to_constant_{DIMS}d - - !----------------------------------------------------------------------- - subroutine missing_field_possibly_abort(varname) - ! - ! !DESCRIPTION: - ! This should be called if a field is missing from the restart file. It aborts with a - ! helpful error message if this run is one where a missing field is treated as an - ! error (e.g., a restart run). - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: varname ! name of variable that triggered the error - ! - ! !LOCAL VARIABLES: - - character(len=*), parameter :: subname = 'missing_field_possibly_abort' - !----------------------------------------------------------------------- - - if (nsrest == nsrContinue .or. & - nsrest == nsrBranch) then - if (masterproc) then - write(iulog,*) 'ERROR: Field missing from restart file: ', trim(varname) - write(iulog,*) 'Missing fields are not allowed in branch or continue (restart) runs.' - write(iulog,*) ' ' - write(iulog,*) 'This can happen when the restart file is from a different' - write(iulog,*) 'model configuration or different code base, which did not' - write(iulog,*) 'contain all of the restart fields needed for the current' - write(iulog,*) 'code base and configuration.' - write(iulog,*) ' ' - write(iulog,*) 'You can get around this problem by doing a startup or hybrid run' - write(iulog,*) 'that points to this initial condition file, instead of attempting' - write(iulog,*) 'a branch or continue run. However, note that, in many cases,' - write(iulog,*) 'this will result in the missing fields being filled in with' - write(iulog,*) 'their cold start initialization values, which may or may not' - write(iulog,*) 'be what you want.' - end if - call shr_sys_abort('Field missing from restart file.') - end if - end subroutine missing_field_possibly_abort - - !----------------------------------------------------------------------- - subroutine write_interpinic_flag(ncid, varid, varname, interpinic_flag) - ! - ! !DESCRIPTION: - ! Write interpinic_flag metadata for the given variable - ! - ! !ARGUMENTS: - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - integer , intent(in) :: varid ! variable id - character(len=*) , intent(in) :: varname ! variable name (just used for output on error) - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic ('interp', 'copy', 'skip' or 'area': see iflag meanings defined at the top of this module) - ! - ! !LOCAL VARIABLES: - integer :: status ! return error code - - character(len=*), parameter :: subname = 'write_interpinic_flag' - !----------------------------------------------------------------------- - - if (interpinic_flag == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (interpinic_flag == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (interpinic_flag == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - else if (interpinic_flag == 'area') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_area) - else - write(iulog,*) 'ERROR in restartvar for ', trim(varname) - write(iulog,*) 'Unknown interpinic_flag: ', trim(interpinic_flag) - write(iulog,*) 'Allowed values are: interp, copy, skip, area' - call endrun(msg='Unknown interpinic_flag') - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip, 4=area") - - end subroutine write_interpinic_flag - - -end module restUtilMod diff --git a/src/utils/spmdGathScatMod.F90 b/src/utils/spmdGathScatMod.F90 deleted file mode 100644 index b3314d2da6..0000000000 --- a/src/utils/spmdGathScatMod.F90 +++ /dev/null @@ -1,540 +0,0 @@ -module spmdGathScatMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: spmdGathScatMod -! -! !DESCRIPTION: -! Perform SPMD gather and scatter operations. -! -! !USES: - use clm_varcon, only: spval, ispval - use decompMod, only : get_clmlevel_gsmap - use shr_kind_mod, only: r8 => shr_kind_r8 - use spmdMod , only : masterproc, mpicom - use mct_mod , only : mct_aVect, mct_gsMap - use mct_mod , only : mct_aVect_init, mct_aVect_importIattr, mct_aVect_scatter - use mct_mod , only : mct_aVect_gather, mct_aVect_exportIattr, mct_aVect_clean - use mct_mod , only : mct_aVect_exportRattr, mct_aVect_importRattr - use abortutils, only : endrun - use clm_varctl, only : iulog - use perf_mod , only : t_startf, t_stopf -! -! !PUBLIC TYPES: - implicit none - private -! -! !PUBLIC MEMBER FUNCTIONS: - public scatter_data_from_master, gather_data_to_master - - interface scatter_data_from_master - module procedure scatter_1darray_int - module procedure scatter_1darray_real - end interface - - interface gather_data_to_master - module procedure gather_1darray_int - module procedure gather_1darray_real - end interface -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -! - integer,private,parameter :: debug = 0 - -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_int -! -! !INTERFACE: - subroutine scatter_1darray_int (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_int -! -! !INTERFACE: - subroutine gather_1darray_int (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - integer ,optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_real -! -! !INTERFACE: - subroutine scatter_1darray_real (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_real - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_real -! -! !INTERFACE: - subroutine gather_1darray_real (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - real(r8),optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_real - -end module spmdGathScatMod diff --git a/src/utils/spmdMod.F90 b/src/utils/spmdMod.F90 deleted file mode 100644 index 6983b96281..0000000000 --- a/src/utils/spmdMod.F90 +++ /dev/null @@ -1,142 +0,0 @@ - -module spmdMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: spmdMod -! -! !DESCRIPTION: -! SPMD initialization -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varctl , only: iulog - implicit none - - private - -#include - - save - - ! Default settings valid even if there is no spmd - - logical, public :: masterproc ! proc 0 logical for printing msgs - integer, public :: iam ! processor number - integer, public :: npes ! number of processors for clm - integer, public :: mpicom ! communicator group for clm - integer, public :: comp_id ! component id - - ! - ! Public methods - ! - public :: spmd_init ! Initialization - - ! - ! Values from mpif.h that can be used - ! - public :: MPI_INTEGER - public :: MPI_REAL8 - public :: MPI_LOGICAL - public :: MPI_SUM - public :: MPI_MIN - public :: MPI_MAX - public :: MPI_LOR - public :: MPI_STATUS_SIZE - public :: MPI_ANY_SOURCE - public :: MPI_CHARACTER - public :: MPI_COMM_WORLD - public :: MPI_MAX_PROCESSOR_NAME - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: spmd_init( clm_mpicom ) -! -! !INTERFACE: - subroutine spmd_init( clm_mpicom, LNDID ) -! -! !DESCRIPTION: -! MPI initialization (number of cpus, processes, tids, etc) -! -! !USES -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: clm_mpicom - integer, intent(in) :: LNDID -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i,j ! indices - integer :: ier ! return error status - integer :: mylength ! my processor length - logical :: mpi_running ! temporary - integer, allocatable :: length(:) - integer, allocatable :: displ(:) - character*(MPI_MAX_PROCESSOR_NAME), allocatable :: procname(:) - character*(MPI_MAX_PROCESSOR_NAME) :: myprocname -!----------------------------------------------------------------------- - - ! Initialize mpi communicator group - - mpicom = clm_mpicom - - comp_id = LNDID - - ! Get my processor id - - call mpi_comm_rank(mpicom, iam, ier) - if (iam==0) then - masterproc = .true. - else - masterproc = .false. - end if - - ! Get number of processors - - call mpi_comm_size(mpicom, npes, ier) - - ! Get my processor names - - allocate (length(0:npes-1), displ(0:npes-1), procname(0:npes-1)) - - call mpi_get_processor_name (myprocname, mylength, ier) - call mpi_allgather(mylength,1,MPI_INTEGER,length,1,MPI_INTEGER,mpicom,ier) - - do i = 0,npes-1 - displ(i)=i*MPI_MAX_PROCESSOR_NAME - end do - call mpi_gatherv (myprocname,mylength,MPI_CHARACTER, & - procname,length,displ,MPI_CHARACTER,0,mpicom,ier) - if (masterproc) then - write(iulog,100)npes - write(iulog,200) - write(iulog,220) - do i=0,npes-1 - write(iulog,250)i,(procname((i))(j:j),j=1,length(i)) - end do - endif - - deallocate (length, displ, procname) - -100 format(//,i3," pes participating in computation for CLM") -200 format(/,35('-')) -220 format(/,"NODE#",2x,"NAME") -250 format("(",i5,")",2x,100a1,//) - - end subroutine spmd_init - -end module spmdMod diff --git a/src/utils/test/CMakeLists.txt b/src/utils/test/CMakeLists.txt deleted file mode 100644 index 53a211e89c..0000000000 --- a/src/utils/test/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_subdirectory(clm_time_manager_test) -add_subdirectory(annual_flux_dribbler_test) -add_subdirectory(quadratic_test) diff --git a/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt b/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt deleted file mode 100644 index 74923ce9a7..0000000000 --- a/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(annual_flux_dribbler test_annual_flux_dribbler_exe - "test_annual_flux_dribbler.pf" "") - -target_link_libraries(test_annual_flux_dribbler_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf b/src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf deleted file mode 100644 index bd9f8e489a..0000000000 --- a/src/utils/test/annual_flux_dribbler_test/test_annual_flux_dribbler.pf +++ /dev/null @@ -1,300 +0,0 @@ -module test_annual_flux_dribbler - - ! Tests of AnnualFluxDribbler - - use pfunit_mod - use AnnualFluxDribbler - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestSubgridMod - use unittestSimpleSubgridSetupsMod - use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown - use unittestTimeManagerMod, only : & - set_date => unittest_timemgr_set_curr_date - - implicit none - - @TestCase - type, extends(TestCase) :: TestDribbler - ! Put the dribbler object in the TestDribbler class so we can call Clean in teardown - type(annual_flux_dribbler_type) :: dribbler - contains - procedure :: setUp - procedure :: tearDown - end type TestDribbler - - real(r8), parameter :: tol = 1.e-13_r8 - - ! Some tests need a larger tolerance, since we're dealing with values with large - ! magnitudes - real(r8), parameter :: tol_large = 1.e-6_r8 - - ! Deliberately choosing a dtime different from the standard 1800, to make sure it's - ! handled correctly - integer, parameter :: dtime = 3600 - - real(r8), parameter :: secs_in_year = 365._r8 * 86400._r8 - -contains - - subroutine setUp(this) - class(TestDribbler), intent(inout) :: this - - call unittest_timemgr_setup(dtime=dtime) - end subroutine setUp - - subroutine tearDown(this) - class(TestDribbler), intent(inout) :: this - - call this%dribbler%Clean() - call unittest_timemgr_teardown() - call unittest_subgrid_teardown() - end subroutine tearDown - - subroutine set_date_first_timestep_of_year() - ! Sets the time manager's date so that it's the first timestep of the year, in year 2 - call set_date(yr=2, mon=1, day=1, tod=dtime) - end subroutine set_date_first_timestep_of_year - - @Test - subroutine firstTimestepOfYear_fluxDribbled(this) - ! Add a delta on the first time step of the year; make sure this flux gets divided by - ! the proper amount to create a flux in that time step - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(1) = [1.e9_r8] - real(r8) :: flux(1) - real(r8) :: amount_left_to_dribble(1) - real(r8) :: amount_dribbled_in_this_timestep - real(r8) :: tot_amount_to_dribble - real(r8) :: expected_flux - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - call set_date_first_timestep_of_year() - - call this%dribbler%set_curr_delta(bounds, delta) - call this%dribbler%get_curr_flux(bounds, flux) - call this%dribbler%get_amount_left_to_dribble_end(bounds, amount_left_to_dribble) - - expected_flux = delta(1) / secs_in_year - @assertEqual(expected_flux, flux(1), tolerance=tol) - - ! Also make sure that flux*dtime + amount_left_to_dribble = delta - i.e., if you add - ! the amount dribbled in this timestep to the reported amount left to dribble, you - ! get the original delta - amount_dribbled_in_this_timestep = flux(1) * dtime - tot_amount_to_dribble = amount_dribbled_in_this_timestep + amount_left_to_dribble(1) - @assertEqual(delta(1), tot_amount_to_dribble, tolerance=tol) - end subroutine firstTimestepOfYear_fluxDribbled - - @Test - subroutine firstTimestepOfYear_patch_fluxDribbled(this) - ! For a patch-level variable: Add a delta on the first time step of the year; make - ! sure this flux gets divided by the proper amount to create a flux in that time step - ! - ! The point of this unit test is to make sure that the flux dribbler infrastructure - ! works for patch level variables - so here we exercise the main routines that have - ! code that works generically for the different subgrid levels. - ! - ! Note that this also exercises the code for multiple points. - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(2) = [1.e9_r8, 2.e9_r8] - real(r8) :: flux(2) - real(r8) :: expected_flux(2) - real(r8) :: amount_left_to_dribble(2) - real(r8) :: amount_dribbled_in_this_timestep(2) - real(r8) :: tot_amount_to_dribble(2) - - call setup_n_veg_patches(pwtcol = [0.4_r8, 0.6_r8], pft_types = [1, 2]) - this%dribbler = annual_flux_dribbler_patch(bounds, & - name = 'foo', units = '-') - call set_date_first_timestep_of_year() - - call this%dribbler%set_curr_delta(bounds, delta) - call this%dribbler%get_curr_flux(bounds, flux) - call this%dribbler%get_amount_left_to_dribble_end(bounds, amount_left_to_dribble) - - expected_flux(:) = delta(:) / secs_in_year - @assertEqual(expected_flux, flux, tolerance=tol) - - ! Also make sure that flux*dtime + amount_left_to_dribble = delta - i.e., if you add - ! the amount dribbled in this timestep to the reported amount left to dribble, you - ! get the original delta - amount_dribbled_in_this_timestep(:) = flux(:) * dtime - tot_amount_to_dribble(:) = amount_dribbled_in_this_timestep(:) + amount_left_to_dribble(:) - @assertEqual(delta, tot_amount_to_dribble, tolerance=tol) - end subroutine firstTimestepOfYear_patch_fluxDribbled - - @Test - subroutine deltaAddedMidyear_ignoredInLaterTimesteps(this) - ! Make sure that a delta added mid-year is ignored on all later time steps - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta_first_timestep(1) = [1.e9_r8] - real(r8), parameter :: delta_should_be_ignored(1) = [3.e6_r8] - real(r8) :: flux(1) - real(r8) :: expected_flux - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - - ! Add some delta at the beginning of the year, which will go into the dribbling flux - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta_first_timestep) - - ! Add some delta that should be ignored - call set_date(yr=2, mon=1, day=2, tod=dtime) - call this%dribbler%set_curr_delta(bounds, delta_should_be_ignored) - - ! Advance time; in this time step, the delta is 0 - call set_date(yr=2, mon=1, day=3, tod=dtime) - call this%dribbler%set_curr_delta(bounds, [0._r8]) - - call this%dribbler%get_curr_flux(bounds, flux) - - expected_flux = delta_first_timestep(1) / secs_in_year - @assertEqual(expected_flux, flux(1), tolerance=tol) - end subroutine deltaAddedMidyear_ignoredInLaterTimesteps - - @Test - subroutine secondTimestep_fluxAdded(this) - ! Add a delta on the first time step of the year. Then change to the second time step - ! and add some other delta. Make sure that the flux in that later time step is the sum - ! of the dribbled flux and the new flux. - ! - ! Also checks get_dribbled_delta (this is a good test to check that in, because it involves - ! two different deltas). - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta_first_timestep(1) = [1.e9_r8] - real(r8), parameter :: delta_second_timestep(1) = [5000._r8] - real(r8) :: flux(1) - real(r8) :: delta(1) - real(r8) :: amount_left_to_dribble(1) - real(r8) :: amount_dribbled_so_far, tot_amount_to_dribble - real(r8) :: expected_dribbled, expected_from_this_timestep, expected_flux, expected_delta - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - - ! Add some delta at the beginning of the year, which will go into the dribbling flux - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta_first_timestep) - - ! Add some delta in the current timestep - call set_date(yr=2, mon=1, day=1, tod=dtime*2) - call this%dribbler%set_curr_delta(bounds, delta_second_timestep) - - call this%dribbler%get_curr_flux(bounds, flux) - call this%dribbler%get_dribbled_delta(bounds, delta) - call this%dribbler%get_amount_left_to_dribble_end(bounds, amount_left_to_dribble) - - expected_dribbled = delta_first_timestep(1) / secs_in_year - expected_from_this_timestep = delta_second_timestep(1) / dtime - expected_flux = expected_dribbled + expected_from_this_timestep - expected_delta = expected_flux * dtime - @assertEqual(expected_flux, flux(1), tolerance=tol) - @assertEqual(expected_delta, delta(1), tolerance=tol) - - ! Also make sure that (dribbled flux)*dtime*2 + amount_left_to_dribble = delta - i.e., - ! if you add the amount dribbled in this timestep and the first timestep to the - ! reported amount left to dribble, you get the original delta - amount_dribbled_so_far = expected_dribbled * dtime * 2 - tot_amount_to_dribble = amount_dribbled_so_far + amount_left_to_dribble(1) - @assertEqual(delta_first_timestep(1), tot_amount_to_dribble, tolerance=tol) - end subroutine secondTimestep_fluxAdded - - @Test - subroutine allowsNonAnnualFalse(this) - ! Make sure that operation is correct when allows_non_annual_delta is .false. - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(1) = [1.e9_r8] - real(r8) :: flux(1) - real(r8) :: expected_flux - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-', allows_non_annual_delta = .false.) - - ! Add some delta at the beginning of the year, which will go into the dribbling flux - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta) - - ! Add some delta in the current timestep - call set_date(yr=2, mon=1, day=1, tod=dtime*2) - call this%dribbler%set_curr_delta(bounds, [0._r8]) - - call this%dribbler%get_curr_flux(bounds, flux) - - expected_flux = delta(1) / secs_in_year - @assertEqual(expected_flux, flux(1), tolerance=tol) - end subroutine allowsNonAnnualFalse - - @Test - subroutine secondToLastTimestep_amountLeft(this) - ! Check amount left to dribble on the second to last time step in the year. This - ! checks both get_amount_left_to_dribble_beg and get_amount_left_to_dribble_end - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(1) = [1.e9_r8] - real(r8) :: amount_left_to_dribble_beg(1) - real(r8) :: amount_left_to_dribble_end(1) - real(r8) :: dribbled_flux - real(r8) :: dribbled_amount_per_timestep - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta) - - call set_date(yr=2, mon=12, day=31, tod=86400-dtime) - call this%dribbler%get_amount_left_to_dribble_beg(bounds, amount_left_to_dribble_beg) - call this%dribbler%get_amount_left_to_dribble_end(bounds, amount_left_to_dribble_end) - - dribbled_flux = delta(1) / secs_in_year - dribbled_amount_per_timestep = dribbled_flux * dtime - @assertEqual(2._r8*dribbled_amount_per_timestep, amount_left_to_dribble_beg(1), tolerance=tol_large) - @assertEqual(dribbled_amount_per_timestep, amount_left_to_dribble_end(1), tolerance=tol_large) - end subroutine secondToLastTimestep_amountLeft - - @Test - subroutine lastTimestep_amountLeftEnd_is0(this) - ! On the last timestep of the year, the amount returned by - ! get_amount_left_to_dribble_end should be 0 - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(1) = [1.e9_r8] - real(r8) :: amount_left_to_dribble(1) - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta) - - ! Set date to the last time step of the year (this looks like the start of the next - ! year since date is given at the end of the time step) - call set_date(yr=3, mon=1, day=1, tod=0) - call this%dribbler%get_amount_left_to_dribble_end(bounds, amount_left_to_dribble) - - @assertEqual(0._r8, amount_left_to_dribble(1)) - end subroutine lastTimestep_amountLeftEnd_is0 - - @Test - subroutine firstTimestep_amountLeftBeg_is0(this) - ! On the first timestep of the year, get_amount_left_to_dribble_beg should give 0 - class(TestDribbler), intent(inout) :: this - real(r8), parameter :: delta(1) = [1.e9_r8] - real(r8) :: amount_left_to_dribble(1) - - call setup_single_veg_patch(pft_type=1) - this%dribbler = annual_flux_dribbler_gridcell(bounds, & - name = 'foo', units = '-') - call set_date_first_timestep_of_year() - call this%dribbler%set_curr_delta(bounds, delta) - - call this%dribbler%get_amount_left_to_dribble_beg(bounds, amount_left_to_dribble) - - @assertEqual(0._r8, amount_left_to_dribble(1)) - end subroutine firstTimestep_amountLeftBeg_is0 - -end module test_annual_flux_dribbler diff --git a/src/utils/test/clm_time_manager_test/CMakeLists.txt b/src/utils/test/clm_time_manager_test/CMakeLists.txt deleted file mode 100644 index 3651eaf984..0000000000 --- a/src/utils/test/clm_time_manager_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(clm_time_manager test_clm_time_manager_exe - "test_clm_time_manager.pf" "") - -target_link_libraries(test_clm_time_manager_exe clm csm_share esmf_wrf_timemgr) diff --git a/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf b/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf deleted file mode 100644 index b27a16f912..0000000000 --- a/src/utils/test/clm_time_manager_test/test_clm_time_manager.pf +++ /dev/null @@ -1,223 +0,0 @@ -module test_clm_time_manager - - ! Tests of clm_time_manager - - use pfunit_mod - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_time_manager - use unittestTimeManagerMod, only : unittest_timemgr_setup, unittest_timemgr_teardown - use unittestTimeManagerMod, only : & - set_date => unittest_timemgr_set_curr_date, & - set_nstep => unittest_timemgr_set_nstep - - implicit none - save - - real(r8), parameter :: tol = 1.e-13_r8 - integer, parameter :: dtime = 1800 - - @TestCase - type, extends(TestCase) :: TestTimeManager - contains - procedure :: setUp - procedure :: tearDown - end type TestTimeManager - -contains - - subroutine setUp(this) - class(TestTimeManager), intent(inout) :: this - - call unittest_timemgr_setup(dtime=dtime) - end subroutine setUp - - subroutine tearDown(this) - class(TestTimeManager), intent(inout) :: this - - call unittest_timemgr_teardown() - end subroutine tearDown - - @Test - subroutine getStepSize_returnsCorrectValue(this) - class(TestTimeManager), intent(inout) :: this - integer :: step_size - - step_size = get_step_size() - - @assertEqual(dtime, step_size) - end subroutine getStepSize_returnsCorrectValue - - @Test - subroutine getCurrYearfrac_atYearBoundary_returns0(this) - class(TestTimeManager), intent(inout) :: this - real(r8) :: yearfrac - - call set_date(yr=2, mon=1, day=1, tod=0) - - yearfrac = get_curr_yearfrac() - - @assertEqual(0._r8, yearfrac) - end subroutine getCurrYearfrac_atYearBoundary_returns0 - - @Test - subroutine getCurrYearfrac_inMiddleOfYear_returnsCorrectValue(this) - class(TestTimeManager), intent(inout) :: this - real(r8) :: yearfrac - real(r8) :: yearfrac_expected - - call set_date(yr=2, mon=3, day=1, tod=43200) - - yearfrac = get_curr_yearfrac() - - yearfrac_expected = 59.5_r8 / 365._r8 - @assertEqual(yearfrac_expected, yearfrac) - end subroutine getCurrYearfrac_inMiddleOfYear_returnsCorrectValue - - @Test - subroutine getPrevYearfrac_atYearBoundary_returnsLargeValue(this) - class(TestTimeManager), intent(inout) :: this - real(r8) :: yearfrac - integer, parameter :: secs_in_day = 86400 - real(r8) :: yearfrac_expected - - call set_date(yr=2, mon=1, day=1, tod=0) - - yearfrac = get_prev_yearfrac() - - yearfrac_expected = (365._r8 - real(dtime, r8) / real(secs_in_day, r8)) / 365._r8 - @assertEqual(yearfrac_expected, yearfrac) - end subroutine getPrevYearfrac_atYearBoundary_returnsLargeValue - - @Test - subroutine getPrevYearfrac_inMiddleOfYear_returnsCorrectValue(this) - class(TestTimeManager), intent(inout) :: this - real(r8) :: yearfrac - integer, parameter :: secs_in_day = 86400 - real(r8) :: yearfrac_expected - - call set_date(yr=2, mon=3, day=1, tod=43200) - - yearfrac = get_prev_yearfrac() - - yearfrac_expected = (59.5_r8 - real(dtime, r8) / real(secs_in_day, r8)) / 365._r8 - @assertEqual(yearfrac_expected, yearfrac) - end subroutine getPrevYearfrac_inMiddleOfYear_returnsCorrectValue - - @Test - subroutine getNstep_step0(this) - class(TestTimeManager), intent(inout) :: this - integer :: nstep - - nstep = get_nstep() - - @assertEqual(0, nstep) - end subroutine getNstep_step0 - - @Test - subroutine getNstep_step3(this) - class(TestTimeManager), intent(inout) :: this - integer, parameter :: expected_nstep = 3 - integer :: nstep - - call set_nstep(expected_nstep) - - nstep = get_nstep() - - @assertEqual(expected_nstep, nstep) - end subroutine getNstep_step3 - - @Test - subroutine isBegCurrYear_atBeg(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_beg - - call set_date(yr=2, mon=1, day=1, tod=dtime) - - is_beg = is_beg_curr_year() - - @assertTrue(is_beg) - end subroutine isBegCurrYear_atBeg - - @Test - subroutine isBegCurrYear_notAtBeg(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_beg - - call set_date(yr=2, mon=1, day=2, tod=dtime) - - is_beg = is_beg_curr_year() - - @assertFalse(is_beg) - end subroutine isBegCurrYear_notAtBeg - - @Test - subroutine isEndCurrYear_atEnd(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_end - - call set_date(yr=2, mon=1, day=1, tod=0) - - is_end = is_end_curr_year() - - @assertTrue(is_end) - end subroutine isEndCurrYear_atEnd - - @Test - subroutine isEndCurrYear_notAtEnd(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_end - - call set_date(yr=2, mon=1, day=2, tod=0) - - is_end = is_end_curr_year() - - @assertFalse(is_end) - end subroutine isEndCurrYear_notAtEnd - - @Test - subroutine isFirstStep_atFirstStep(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_first - - is_first = is_first_step() - - @assertTrue(is_first) - end subroutine isFirstStep_atFirstStep - - @Test - subroutine isFirstStep_notAtFirstStep(this) - class(TestTimeManager), intent(inout) :: this - logical :: is_first - - call set_nstep(1) - - is_first = is_first_step() - - @assertFalse(is_first) - end subroutine isFirstStep_notAtFirstStep - - @Test - subroutine check_DA_nstep(this) - class(TestTimeManager), intent(inout) :: this - integer :: nstep - - nstep = 100 - call set_nstep(nstep) - - @assertEqual( nstep, get_nstep() ) - @assertEqual( nstep, get_nstep_since_startup_or_lastDA_restart_or_pause() ) - - ! Now update DA nstep, and nstep should be the same, but DA step should be zero - call update_DA_nstep() - @assertEqual( nstep, get_nstep() ) - @assertEqual( 0, get_nstep_since_startup_or_lastDA_restart_or_pause() ) - - ! Advance time step and should be one more step out - call advance_timestep() - - @assertEqual( nstep+1, get_nstep() ) - @assertEqual( 1, get_nstep_since_startup_or_lastDA_restart_or_pause() ) - - end subroutine check_DA_nstep - -end module test_clm_time_manager diff --git a/src/utils/test/quadratic_test/CMakeLists.txt b/src/utils/test/quadratic_test/CMakeLists.txt deleted file mode 100644 index 50d6c92f1a..0000000000 --- a/src/utils/test/quadratic_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -create_pFUnit_test(quadratic test_quadratic_exe - "test_quadratic.pf" "") - -target_link_libraries(test_quadratic_exe clm csm_share) diff --git a/src/utils/test/quadratic_test/test_quadratic.pf b/src/utils/test/quadratic_test/test_quadratic.pf deleted file mode 100644 index 34ecc12eb7..0000000000 --- a/src/utils/test/quadratic_test/test_quadratic.pf +++ /dev/null @@ -1,187 +0,0 @@ -module test_quadratic - - ! Tests of quadratic - - use pfunit_mod - use quadraticMod - use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestUtils, only : endrun_msg - - implicit none - - @TestCase - type, extends(TestCase) :: TestQuadratic - contains - procedure :: setUp - procedure :: tearDown - end type TestQuadratic - - real(r8), parameter :: tol = 1.e-15_r8 - real(r8), parameter :: tol_big = 1.e-6_r8 - -contains - - subroutine setUp(this) - class(TestQuadratic), intent(inout) :: this - end subroutine setUp - - subroutine tearDown(this) - class(TestQuadratic), intent(inout) :: this - - end subroutine tearDown - - subroutine check_root(a,b,c,root) - real(r8), intent(IN):: a, b, c, root - real(r8) :: result - - result = a*root*root + b*root + c - if ( abs(result) > 1.e-12 )then - print *, 'result = ', result - print *, 'a, b, c = ', a, b, c - end if - @AssertEqual( result, 0.0_r8, tolerance=tol) - - end subroutine check_root - - ! ------------------------------------------------------------------------ - ! Tests of zero roots - ! ------------------------------------------------------------------------ - - @Test - subroutine zero_root(this) - class(TestQuadratic), intent(inout) :: this - real(r8) :: b, c, r1, r2 - real(r8) :: a(3) - integer :: i - - a = (/ 1000.0_r8, 5.12345678_r8, -31.415927465859_r8 /) - b = 0.0_r8 - c = 0.0_r8 - do i = 1, size(a) - call quadratic (a(i), b, c, r1, r2) - call check_root(a(i), b, c, r1) - @assertEqual(0.0_r8, r1, tolerance=tol) - @assertEqual(1.e+36_r8, r2, tolerance=tol) - end do - - end subroutine zero_root - - ! ------------------------------------------------------------------------ - ! Tests of simple roots - ! ------------------------------------------------------------------------ - - @Test - subroutine simple_roots(this) - class(TestQuadratic), intent(inout) :: this - real(r8) :: r1, r2 - real(r8) :: a(2), b(2), c(2) - real(r8) :: expectedr1(2), expectedr2(2) - integer :: i - - a = (/ 1.0_r8, 1.0_r8 /) - b = (/ 3.0_r8, 0.0_r8 /) - c = (/ 2.0_r8, -4.0_r8 /) - expectedr1 = (/ -2.0_r8, -2.0_r8 /) - expectedr2 = (/ -1.0_r8, +2.0_r8 /) - do i = 1, size(a) - call quadratic (a(i), b(i), c(i), r1, r2) - call check_root(a(i), b(i), c(i), r1) - call check_root(a(i), b(i), c(i), r2) - @assertEqual(expectedr1(i), r1, tolerance=tol) - @assertEqual(expectedr2(i), r2, tolerance=tol) - end do - - end subroutine simple_roots - - ! ------------------------------------------------------------------------ - ! Tests of near_zero_sqrts - ! ------------------------------------------------------------------------ - - @Test - subroutine near_zero_sqrts(this) - class(TestQuadratic), intent(inout) :: this - real(r8) :: r1, r2 - real(r8) :: a(1), b(1), c(1), c_coef - real(r8) :: pert(3) - real(r8) :: expectedr1(1) - integer :: i, j - - a = (/ 1.0_r8 /) - b = (/ 4.0_r8 /) - c = (/ 4.0_r8 /) - expectedr1 = (/ -2.0_r8 /) - do i = 1, size(a) - pert = (/ 0.0_r8, 0.5_r8*epsilon(b(i)), 2.0_r8*epsilon(b(i)) /) - ! Check that b2 - 4ac is zero, which is what this test is about - @assertEqual( 0.0_r8, b*b - 4.0_r8*a(i)*c(i) ) - do j = 1, size(pert) - c_coef = c(i)+pert(j) - print *, 'a, b, c_ = ', a(i), b(i), c_coef - call quadratic (a(i), b(i), c_coef, r1, r2) - call check_root(a(i), b(i), c_coef, r1) - call check_root(a(i), b(i), c_coef, r2) - @assertEqual(expectedr1(i), r1, tolerance=tol_big) - @assertEqual(r1, r2, tolerance=tol_big ) - end do - end do - - end subroutine near_zero_sqrts - - ! ------------------------------------------------------------------------ - ! Tests of error conditions - ! ------------------------------------------------------------------------ - - @Test - subroutine check_errorcondsazero(this) - class(TestQuadratic), intent(inout) :: this - - character(len=:), allocatable :: expected_msg - real(r8) :: r1, r2 - real(r8) :: a, b, c - - a = 0.0_r8 - b = a - c = a - call quadratic (a, b, c, r1, r2) - expected_msg = endrun_msg( & - 'quadratic ERROR: Quadratic solution error') - @assertExceptionRaised(expected_msg) - end subroutine check_errorcondsazero - - @Test - subroutine check_errorcondsimaginary(this) - class(TestQuadratic), intent(inout) :: this - - character(len=:), allocatable :: expected_msg - real(r8) :: r1, r2 - real(r8) :: a, b, c - - a = 1.0_r8 - b = 2.0_r8 - c = 5.0_r8 - call quadratic (a, b, c, r1, r2) - expected_msg = endrun_msg( & - 'quadratic ERROR: Quadratic solution error: b^2 - 4ac is negative') - @assertExceptionRaised(expected_msg) - end subroutine check_errorcondsimaginary - - @Test - subroutine check_errorcondsbarelyimaginary(this) - class(TestQuadratic), intent(inout) :: this - - character(len=:), allocatable :: expected_msg - real(r8) :: r1, r2 - real(r8) :: a, b, c - a = 1.0_r8 - b = 4.0_r8 - c = 4.0_r8 + 100.0_r8*epsilon(b) - call quadratic (a, b, c, r1, r2) - call check_root(a, b, c, r1) - call check_root(a, b, c, r2) - expected_msg = endrun_msg( & - 'quadratic ERROR: Quadratic solution error: b^2 - 4ac is negative') - @assertExceptionRaised(expected_msg) - - end subroutine check_errorcondsbarelyimaginary - -end module test_quadratic diff --git a/src_clm40/biogeochem/C13SummaryMod.F90 b/src_clm40/biogeochem/C13SummaryMod.F90 deleted file mode 100644 index 79d926e6bd..0000000000 --- a/src_clm40/biogeochem/C13SummaryMod.F90 +++ /dev/null @@ -1,820 +0,0 @@ -module C13SummaryMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: C13SummaryMod -! -! !DESCRIPTION: -! Module for isotope carbon summary calculations -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: C13Summary -! -! !REVISION HISTORY: -! 7/13/2005: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13Summary -! -! !INTERFACE: -subroutine C13Summary(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, perform pft and column-level carbon -! summary calculations -! -! !USES: - use clmtype - use pft2colMod, only: p2c - use clm_varctl, only: iulog, use_c13 - use shr_sys_mod, only: shr_sys_flush -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 12/9/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - real(r8), pointer :: col_fire_closs(:) ! (gC/m2/s) total column-level fire C loss - real(r8), pointer :: er(:) ! (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - real(r8), pointer :: hr(:) ! (gC/m2/s) total heterotrophic respiration - real(r8), pointer :: litfire(:) ! (gC/m2/s) litter fire losses - real(r8), pointer :: lithr(:) ! (gC/m2/s) litter heterotrophic respiration - real(r8), pointer :: litr1_hr(:) - real(r8), pointer :: litr2_hr(:) - real(r8), pointer :: litr3_hr(:) - real(r8), pointer :: m_cwdc_to_fire(:) - real(r8), pointer :: m_litr1c_to_fire(:) - real(r8), pointer :: m_litr2c_to_fire(:) - real(r8), pointer :: m_litr3c_to_fire(:) - real(r8), pointer :: nee(:) ! (gC/m2/s) net ecosystem exchange of carbon, includes fire, land-use, and wood products flux, positive for source - real(r8), pointer :: nbp(:) ! (gC/m2/s) net biome production, includes fire, land-use, and wood products flux, positive for sink - real(r8), pointer :: nep(:) ! (gC/m2/s) net ecosystem production, excludes fire, land-use, and wood products flux, positive for sink - real(r8), pointer :: col_ar(:) ! (gC/m2/s) autotrophic respiration (MR + GR) - real(r8), pointer :: col_gpp(:) !GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: col_npp(:) ! (gC/m2/s) net primary production - real(r8), pointer :: col_pft_fire_closs(:) ! (gC/m2/s) total pft-level fire C loss - real(r8), pointer :: col_rr(:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: col_vegfire(:) ! (gC/m2/s) pft-level fire loss (obsolete, mark for removal) - real(r8), pointer :: col_wood_harvestc(:) - real(r8), pointer :: soil1_hr(:) - real(r8), pointer :: soil2_hr(:) - real(r8), pointer :: soil3_hr(:) - real(r8), pointer :: soil4_hr(:) - real(r8), pointer :: somfire(:) ! (gC/m2/s) soil organic matter fire losses - real(r8), pointer :: somhr(:) ! (gC/m2/s) soil organic matter heterotrophic respiration - real(r8), pointer :: sr(:) ! (gC/m2/s) total soil respiration (HR + root resp) - real(r8), pointer :: totfire(:) ! (gC/m2/s) total ecosystem fire losses - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: col_totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: col_totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool - real(r8), pointer :: totecosysc(:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - real(r8), pointer :: totlitc(:) ! (gC/m2) total litter carbon - real(r8), pointer :: totsomc(:) ! (gC/m2) total soil organic matter carbon - real(r8), pointer :: agnpp(:) ! (gC/m2/s) aboveground NPP - real(r8), pointer :: ar(:) ! (gC/m2/s) autotrophic respiration (MR + GR) - real(r8), pointer :: bgnpp(:) ! (gC/m2/s) belowground NPP - real(r8), pointer :: cpool_deadcroot_gr(:) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) - real(r8), pointer :: cpool_deadstem_gr(:) - real(r8), pointer :: cpool_deadstem_storage_gr(:) - real(r8), pointer :: cpool_froot_gr(:) - real(r8), pointer :: cpool_froot_storage_gr(:) - real(r8), pointer :: cpool_leaf_gr(:) - real(r8), pointer :: cpool_leaf_storage_gr(:) - real(r8), pointer :: cpool_livecroot_gr(:) - real(r8), pointer :: cpool_livecroot_storage_gr(:) - real(r8), pointer :: cpool_livestem_gr(:) - real(r8), pointer :: cpool_livestem_storage_gr(:) - real(r8), pointer :: cpool_to_deadcrootc(:) - real(r8), pointer :: cpool_to_deadstemc(:) - real(r8), pointer :: cpool_to_frootc(:) - real(r8), pointer :: cpool_to_leafc(:) - real(r8), pointer :: cpool_to_livecrootc(:) - real(r8), pointer :: cpool_to_livestemc(:) - real(r8), pointer :: current_gr(:) ! (gC/m2/s) growth resp for new growth displayed in this timestep - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: froot_curmr(:) - real(r8), pointer :: froot_xsmr(:) - real(r8), pointer :: gpp(:) !GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: gr(:) ! (gC/m2/s) total growth respiration - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: leaf_curmr(:) - real(r8), pointer :: leaf_xsmr(:) - real(r8), pointer :: litfall(:) ! (gC/m2/s) litterfall (leaves and fine roots) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: livecroot_mr(:) - real(r8), pointer :: livecroot_curmr(:) - real(r8), pointer :: livecroot_xsmr(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: livestem_curmr(:) - real(r8), pointer :: livestem_xsmr(:) - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_to_fire(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_fire(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_frootc_to_fire(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_fire(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_fire(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_fire(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_fire(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_leafc_to_fire(:) - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_fire(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_to_fire(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_fire(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_to_fire(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) - real(r8), pointer :: mr(:) ! (gC/m2/s) maintenance respiration - real(r8), pointer :: npp(:) ! (gC/m2/s) net primary production - real(r8), pointer :: pft_fire_closs(:) ! (gC/m2/s) total pft-level fire C loss - real(r8), pointer :: psnshade_to_cpool(:) - real(r8), pointer :: psnsun_to_cpool(:) - real(r8), pointer :: rr(:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: storage_gr(:) ! (gC/m2/s) growth resp for growth sent to storage for later display - real(r8), pointer :: transfer_deadcroot_gr(:) - real(r8), pointer :: transfer_deadstem_gr(:) - real(r8), pointer :: transfer_froot_gr(:) - real(r8), pointer :: transfer_gr(:) ! (gC/m2/s) growth resp for transfer growth displayed in this timestep - real(r8), pointer :: transfer_leaf_gr(:) - real(r8), pointer :: transfer_livecroot_gr(:) - real(r8), pointer :: transfer_livestem_gr(:) - real(r8), pointer :: wood_harvestc(:) ! (gC/m2/s) pft-level wood harvest (to product pools) - real(r8), pointer :: vegfire(:) ! (gC/m2/s) pft-level fire loss (obsolete, mark for removal) - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) !(gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: dispvegc(:) ! (gC/m2) displayed veg carbon, excluding storage and cpool - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) !(gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: storvegc(:) ! (gC/m2) stored vegetation carbon, excluding cpool - real(r8), pointer :: totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - ! for landcover change - real(r8), pointer :: dwt_closs(:) ! (gC/m2/s) total carbon loss from product pools and conversion - real(r8), pointer :: dwt_conv_cflux(:) ! (gC/m2/s) conversion C flux (immediate loss to atm) - real(r8), pointer :: prod10c_loss(:) ! (gC/m2/s) loss from 10-yr wood product pool - real(r8), pointer :: prod100c_loss(:) ! (gC/m2/s) loss from 100-yr wood product pool - real(r8), pointer :: product_closs(:) ! (gC/m2/s) total wood product carbon loss - real(r8), pointer :: prod10c(:) ! (gC/m2) wood product C pool, 10-year lifespan - real(r8), pointer :: prod100c(:) ! (gC/m2) wood product C pool, 100-year lifespan - real(r8), pointer :: totprodc(:) ! (gC/m2) total wood product C -! -! -! local pointers to implicit in/out scalars -! -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - -!EOP -!----------------------------------------------------------------------- - - if (.not. use_c13) then - RETURN - end if - - ! assign local pointers - col_fire_closs => cc13f%col_fire_closs - er => cc13f%er - hr => cc13f%hr - litfire => cc13f%litfire - lithr => cc13f%lithr - litr1_hr => cc13f%litr1_hr - litr2_hr => cc13f%litr2_hr - litr3_hr => cc13f%litr3_hr - m_cwdc_to_fire => cc13f%m_cwdc_to_fire - m_litr1c_to_fire => cc13f%m_litr1c_to_fire - m_litr2c_to_fire => cc13f%m_litr2c_to_fire - m_litr3c_to_fire => cc13f%m_litr3c_to_fire - nee => cc13f%nee - nep => cc13f%nep - nbp => cc13f%nbp - col_ar => pc13f_a%ar - col_gpp => pc13f_a%gpp - col_npp => pc13f_a%npp - col_pft_fire_closs => pc13f_a%pft_fire_closs - col_rr => pc13f_a%rr - col_vegfire => pc13f_a%vegfire - col_wood_harvestc => pc13f_a%wood_harvestc - soil1_hr => cc13f%soil1_hr - soil2_hr => cc13f%soil2_hr - soil3_hr => cc13f%soil3_hr - soil4_hr => cc13f%soil4_hr - somfire => cc13f%somfire - somhr => cc13f%somhr - sr => cc13f%sr - totfire => cc13f%totfire - - ! dynamic landcover pointers - dwt_closs => cc13f%dwt_closs - dwt_conv_cflux => cc13f%dwt_conv_cflux - - ! wood product pointers - prod10c_loss => cc13f%prod10c_loss - prod100c_loss => cc13f%prod100c_loss - product_closs => cc13f%product_closs - prod10c => cc13s%prod10c - prod100c => cc13s%prod100c - totprodc => cc13s%totprodc - - cwdc => cc13s%cwdc - litr1c => cc13s%litr1c - litr2c => cc13s%litr2c - litr3c => cc13s%litr3c - col_totpftc => pc13s_a%totpftc - col_totvegc => pc13s_a%totvegc - soil1c => cc13s%soil1c - soil2c => cc13s%soil2c - soil3c => cc13s%soil3c - soil4c => cc13s%soil4c - totcolc => cc13s%totcolc - totecosysc => cc13s%totecosysc - totlitc => cc13s%totlitc - totsomc => cc13s%totsomc - agnpp => pc13f%agnpp - ar => pc13f%ar - bgnpp => pc13f%bgnpp - cpool_deadcroot_gr => pc13f%cpool_deadcroot_gr - cpool_deadcroot_storage_gr => pc13f%cpool_deadcroot_storage_gr - cpool_deadstem_gr => pc13f%cpool_deadstem_gr - cpool_deadstem_storage_gr => pc13f%cpool_deadstem_storage_gr - cpool_froot_gr => pc13f%cpool_froot_gr - cpool_froot_storage_gr => pc13f%cpool_froot_storage_gr - cpool_leaf_gr => pc13f%cpool_leaf_gr - cpool_leaf_storage_gr => pc13f%cpool_leaf_storage_gr - cpool_livecroot_gr => pc13f%cpool_livecroot_gr - cpool_livecroot_storage_gr => pc13f%cpool_livecroot_storage_gr - cpool_livestem_gr => pc13f%cpool_livestem_gr - cpool_livestem_storage_gr => pc13f%cpool_livestem_storage_gr - cpool_to_deadcrootc => pc13f%cpool_to_deadcrootc - cpool_to_deadstemc => pc13f%cpool_to_deadstemc - cpool_to_frootc => pc13f%cpool_to_frootc - cpool_to_leafc => pc13f%cpool_to_leafc - cpool_to_livecrootc => pc13f%cpool_to_livecrootc - cpool_to_livestemc => pc13f%cpool_to_livestemc - current_gr => pc13f%current_gr - deadcrootc_xfer_to_deadcrootc => pc13f%deadcrootc_xfer_to_deadcrootc - deadstemc_xfer_to_deadstemc => pc13f%deadstemc_xfer_to_deadstemc - frootc_to_litter => pc13f%frootc_to_litter - frootc_xfer_to_frootc => pc13f%frootc_xfer_to_frootc - froot_mr => pc13f%froot_mr - froot_curmr => pc13f%froot_curmr - froot_xsmr => pc13f%froot_xsmr - gpp => pc13f%gpp - gr => pc13f%gr - leafc_to_litter => pc13f%leafc_to_litter - leafc_xfer_to_leafc => pc13f%leafc_xfer_to_leafc - leaf_mr => pc13f%leaf_mr - leaf_curmr => pc13f%leaf_curmr - leaf_xsmr => pc13f%leaf_xsmr - litfall => pc13f%litfall - livecrootc_xfer_to_livecrootc => pc13f%livecrootc_xfer_to_livecrootc - livecroot_mr => pc13f%livecroot_mr - livecroot_curmr => pc13f%livecroot_curmr - livecroot_xsmr => pc13f%livecroot_xsmr - livestemc_xfer_to_livestemc => pc13f%livestemc_xfer_to_livestemc - livestem_mr => pc13f%livestem_mr - livestem_curmr => pc13f%livestem_curmr - livestem_xsmr => pc13f%livestem_xsmr - m_deadcrootc_storage_to_fire => pc13f%m_deadcrootc_storage_to_fire - m_deadcrootc_storage_to_litter => pc13f%m_deadcrootc_storage_to_litter - m_deadcrootc_to_fire => pc13f%m_deadcrootc_to_fire - m_deadcrootc_to_litter => pc13f%m_deadcrootc_to_litter - m_deadcrootc_to_litter_fire => pc13f%m_deadcrootc_to_litter_fire - m_deadcrootc_xfer_to_fire => pc13f%m_deadcrootc_xfer_to_fire - m_deadcrootc_xfer_to_litter => pc13f%m_deadcrootc_xfer_to_litter - m_deadstemc_storage_to_fire => pc13f%m_deadstemc_storage_to_fire - m_deadstemc_storage_to_litter => pc13f%m_deadstemc_storage_to_litter - m_deadstemc_to_fire => pc13f%m_deadstemc_to_fire - m_deadstemc_to_litter => pc13f%m_deadstemc_to_litter - m_deadstemc_to_litter_fire => pc13f%m_deadstemc_to_litter_fire - m_deadstemc_xfer_to_fire => pc13f%m_deadstemc_xfer_to_fire - m_deadstemc_xfer_to_litter => pc13f%m_deadstemc_xfer_to_litter - m_frootc_storage_to_fire => pc13f%m_frootc_storage_to_fire - m_frootc_storage_to_litter => pc13f%m_frootc_storage_to_litter - m_frootc_to_fire => pc13f%m_frootc_to_fire - m_frootc_to_litter => pc13f%m_frootc_to_litter - m_frootc_xfer_to_fire => pc13f%m_frootc_xfer_to_fire - m_frootc_xfer_to_litter => pc13f%m_frootc_xfer_to_litter - m_gresp_storage_to_fire => pc13f%m_gresp_storage_to_fire - m_gresp_storage_to_litter => pc13f%m_gresp_storage_to_litter - m_gresp_xfer_to_fire => pc13f%m_gresp_xfer_to_fire - m_gresp_xfer_to_litter => pc13f%m_gresp_xfer_to_litter - m_leafc_storage_to_fire => pc13f%m_leafc_storage_to_fire - m_leafc_storage_to_litter => pc13f%m_leafc_storage_to_litter - m_leafc_to_fire => pc13f%m_leafc_to_fire - m_leafc_to_litter => pc13f%m_leafc_to_litter - m_leafc_xfer_to_fire => pc13f%m_leafc_xfer_to_fire - m_leafc_xfer_to_litter => pc13f%m_leafc_xfer_to_litter - m_livecrootc_storage_to_fire => pc13f%m_livecrootc_storage_to_fire - m_livecrootc_storage_to_litter => pc13f%m_livecrootc_storage_to_litter - m_livecrootc_to_fire => pc13f%m_livecrootc_to_fire - m_livecrootc_to_litter => pc13f%m_livecrootc_to_litter - m_livecrootc_xfer_to_fire => pc13f%m_livecrootc_xfer_to_fire - m_livecrootc_xfer_to_litter => pc13f%m_livecrootc_xfer_to_litter - m_livestemc_storage_to_fire => pc13f%m_livestemc_storage_to_fire - m_livestemc_storage_to_litter => pc13f%m_livestemc_storage_to_litter - m_livestemc_to_fire => pc13f%m_livestemc_to_fire - m_livestemc_to_litter => pc13f%m_livestemc_to_litter - m_livestemc_xfer_to_fire => pc13f%m_livestemc_xfer_to_fire - m_livestemc_xfer_to_litter => pc13f%m_livestemc_xfer_to_litter - hrv_leafc_to_litter => pc13f%hrv_leafc_to_litter - hrv_leafc_storage_to_litter => pc13f%hrv_leafc_storage_to_litter - hrv_leafc_xfer_to_litter => pc13f%hrv_leafc_xfer_to_litter - hrv_frootc_to_litter => pc13f%hrv_frootc_to_litter - hrv_frootc_storage_to_litter => pc13f%hrv_frootc_storage_to_litter - hrv_frootc_xfer_to_litter => pc13f%hrv_frootc_xfer_to_litter - hrv_livestemc_to_litter => pc13f%hrv_livestemc_to_litter - hrv_livestemc_storage_to_litter => pc13f%hrv_livestemc_storage_to_litter - hrv_livestemc_xfer_to_litter => pc13f%hrv_livestemc_xfer_to_litter - hrv_deadstemc_to_prod10c => pc13f%hrv_deadstemc_to_prod10c - hrv_deadstemc_to_prod100c => pc13f%hrv_deadstemc_to_prod100c - hrv_deadstemc_storage_to_litter => pc13f%hrv_deadstemc_storage_to_litter - hrv_deadstemc_xfer_to_litter => pc13f%hrv_deadstemc_xfer_to_litter - hrv_livecrootc_to_litter => pc13f%hrv_livecrootc_to_litter - hrv_livecrootc_storage_to_litter => pc13f%hrv_livecrootc_storage_to_litter - hrv_livecrootc_xfer_to_litter => pc13f%hrv_livecrootc_xfer_to_litter - hrv_deadcrootc_to_litter => pc13f%hrv_deadcrootc_to_litter - hrv_deadcrootc_storage_to_litter => pc13f%hrv_deadcrootc_storage_to_litter - hrv_deadcrootc_xfer_to_litter => pc13f%hrv_deadcrootc_xfer_to_litter - hrv_gresp_storage_to_litter => pc13f%hrv_gresp_storage_to_litter - hrv_gresp_xfer_to_litter => pc13f%hrv_gresp_xfer_to_litter - hrv_xsmrpool_to_atm => pc13f%hrv_xsmrpool_to_atm - mr => pc13f%mr - npp => pc13f%npp - pft_fire_closs => pc13f%pft_fire_closs - psnshade_to_cpool => pc13f%psnshade_to_cpool - psnsun_to_cpool => pc13f%psnsun_to_cpool - rr => pc13f%rr - storage_gr => pc13f%storage_gr - transfer_deadcroot_gr => pc13f%transfer_deadcroot_gr - transfer_deadstem_gr => pc13f%transfer_deadstem_gr - transfer_froot_gr => pc13f%transfer_froot_gr - transfer_gr => pc13f%transfer_gr - transfer_leaf_gr => pc13f%transfer_leaf_gr - transfer_livecroot_gr => pc13f%transfer_livecroot_gr - transfer_livestem_gr => pc13f%transfer_livestem_gr - vegfire => pc13f%vegfire - wood_harvestc => pc13f%wood_harvestc - cpool => pc13s%cpool - xsmrpool => pc13s%xsmrpool - deadcrootc => pc13s%deadcrootc - deadcrootc_storage => pc13s%deadcrootc_storage - deadcrootc_xfer => pc13s%deadcrootc_xfer - deadstemc => pc13s%deadstemc - deadstemc_storage => pc13s%deadstemc_storage - deadstemc_xfer => pc13s%deadstemc_xfer - dispvegc => pc13s%dispvegc - frootc => pc13s%frootc - frootc_storage => pc13s%frootc_storage - frootc_xfer => pc13s%frootc_xfer - gresp_storage => pc13s%gresp_storage - gresp_xfer => pc13s%gresp_xfer - leafc => pc13s%leafc - leafc_storage => pc13s%leafc_storage - leafc_xfer => pc13s%leafc_xfer - livecrootc => pc13s%livecrootc - livecrootc_storage => pc13s%livecrootc_storage - livecrootc_xfer => pc13s%livecrootc_xfer - livestemc => pc13s%livestemc - livestemc_storage => pc13s%livestemc_storage - livestemc_xfer => pc13s%livestemc_xfer - storvegc => pc13s%storvegc - totpftc => pc13s%totpftc - totvegc => pc13s%totvegc - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! calculate pft-level summary carbon fluxes and states - - ! gross primary production (GPP) - gpp(p) = & - psnsun_to_cpool(p) + & - psnshade_to_cpool(p) - - ! maintenance respiration (MR) - - leaf_mr(p) = leaf_curmr(p) + leaf_xsmr(p) - froot_mr(p) = froot_curmr(p) + froot_xsmr(p) - livestem_mr(p) = livestem_curmr(p) + livestem_xsmr(p) - livecroot_mr(p) = livecroot_curmr(p) + livecroot_xsmr(p) - - mr(p) = & - leaf_mr(p) + & - froot_mr(p) + & - livestem_mr(p) + & - livecroot_mr(p) - ! growth respiration (GR) - ! current GR is respired this time step for new growth displayed in this timestep - current_gr(p) = & - cpool_leaf_gr(p) + & - cpool_froot_gr(p) + & - cpool_livestem_gr(p) + & - cpool_deadstem_gr(p) + & - cpool_livecroot_gr(p) + & - cpool_deadcroot_gr(p) - - ! transfer GR is respired this time step for transfer growth displayed in this timestep - transfer_gr(p) = & - transfer_leaf_gr(p) + & - transfer_froot_gr(p) + & - transfer_livestem_gr(p) + & - transfer_deadstem_gr(p) + & - transfer_livecroot_gr(p) + & - transfer_deadcroot_gr(p) - - ! storage GR is respired this time step for growth sent to storage for later display - storage_gr(p) = & - cpool_leaf_storage_gr(p) + & - cpool_froot_storage_gr(p) + & - cpool_livestem_storage_gr(p) + & - cpool_deadstem_storage_gr(p) + & - cpool_livecroot_storage_gr(p) + & - cpool_deadcroot_storage_gr(p) - - ! GR is the sum of current + transfer + storage GR - gr(p) = & - current_gr(p) + & - transfer_gr(p) + & - storage_gr(p) - - ! autotrophic respiration (AR) - ar(p) = mr(p) + gr(p) - - ! root respiration (RR) - rr(p) = & - froot_mr(p) + & - cpool_froot_gr(p) + & - cpool_livecroot_gr(p) + & - cpool_deadcroot_gr(p) + & - transfer_froot_gr(p) + & - transfer_livecroot_gr(p) + & - transfer_deadcroot_gr(p) + & - cpool_froot_storage_gr(p) + & - cpool_livecroot_storage_gr(p) + & - cpool_deadcroot_storage_gr(p) - - ! net primary production (NPP) - npp(p) = gpp(p) - ar(p) - - ! aboveground NPP: leaf, live stem, dead stem (AGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of AGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - agnpp(p) = & - cpool_to_leafc(p) + & - leafc_xfer_to_leafc(p) + & - cpool_to_livestemc(p) + & - livestemc_xfer_to_livestemc(p) + & - cpool_to_deadstemc(p) + & - deadstemc_xfer_to_deadstemc(p) - - ! belowground NPP: fine root, live coarse root, dead coarse root (BGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of BGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - bgnpp(p) = & - cpool_to_frootc(p) + & - frootc_xfer_to_frootc(p) + & - cpool_to_livecrootc(p) + & - livecrootc_xfer_to_livecrootc(p) + & - cpool_to_deadcrootc(p) + & - deadcrootc_xfer_to_deadcrootc(p) - - ! litterfall (LITFALL) - litfall(p) = & - leafc_to_litter(p) + & - frootc_to_litter(p) + & - m_leafc_to_litter(p) + & - m_leafc_storage_to_litter(p) + & - m_leafc_xfer_to_litter(p) + & - m_frootc_to_litter(p) + & - m_frootc_storage_to_litter(p) + & - m_frootc_xfer_to_litter(p) + & - m_livestemc_to_litter(p) + & - m_livestemc_storage_to_litter(p) + & - m_livestemc_xfer_to_litter(p) + & - m_deadstemc_to_litter(p) + & - m_deadstemc_storage_to_litter(p) + & - m_deadstemc_xfer_to_litter(p) + & - m_livecrootc_to_litter(p) + & - m_livecrootc_storage_to_litter(p) + & - m_livecrootc_xfer_to_litter(p) + & - m_deadcrootc_to_litter(p) + & - m_deadcrootc_storage_to_litter(p) + & - m_deadcrootc_xfer_to_litter(p) + & - m_gresp_storage_to_litter(p) + & - m_gresp_xfer_to_litter(p) + & - m_deadstemc_to_litter_fire(p) + & - m_deadcrootc_to_litter_fire(p) + & - hrv_leafc_to_litter(p) + & - hrv_leafc_storage_to_litter(p) + & - hrv_leafc_xfer_to_litter(p) + & - hrv_frootc_to_litter(p) + & - hrv_frootc_storage_to_litter(p) + & - hrv_frootc_xfer_to_litter(p) + & - hrv_livestemc_to_litter(p) + & - hrv_livestemc_storage_to_litter(p) + & - hrv_livestemc_xfer_to_litter(p) + & - hrv_deadstemc_storage_to_litter(p) + & - hrv_deadstemc_xfer_to_litter(p) + & - hrv_livecrootc_to_litter(p) + & - hrv_livecrootc_storage_to_litter(p)+ & - hrv_livecrootc_xfer_to_litter(p) + & - hrv_deadcrootc_to_litter(p) + & - hrv_deadcrootc_storage_to_litter(p)+ & - hrv_deadcrootc_xfer_to_litter(p) + & - hrv_gresp_storage_to_litter(p) + & - hrv_gresp_xfer_to_litter(p) - - ! pft-level fire losses (VEGFIRE) - vegfire(p) = 0._r8 - - ! pft-level wood harvest - wood_harvestc(p) = & - hrv_deadstemc_to_prod10c(p) + & - hrv_deadstemc_to_prod100c(p) - - ! pft-level carbon losses to fire - pft_fire_closs(p) = & - m_leafc_to_fire(p) + & - m_leafc_storage_to_fire(p) + & - m_leafc_xfer_to_fire(p) + & - m_frootc_to_fire(p) + & - m_frootc_storage_to_fire(p) + & - m_frootc_xfer_to_fire(p) + & - m_livestemc_to_fire(p) + & - m_livestemc_storage_to_fire(p) + & - m_livestemc_xfer_to_fire(p) + & - m_deadstemc_to_fire(p) + & - m_deadstemc_storage_to_fire(p) + & - m_deadstemc_xfer_to_fire(p) + & - m_livecrootc_to_fire(p) + & - m_livecrootc_storage_to_fire(p) + & - m_livecrootc_xfer_to_fire(p) + & - m_deadcrootc_to_fire(p) + & - m_deadcrootc_storage_to_fire(p) + & - m_deadcrootc_xfer_to_fire(p) + & - m_gresp_storage_to_fire(p) + & - m_gresp_xfer_to_fire(p) - - ! displayed vegetation carbon, excluding storage and cpool (DISPVEGC) - dispvegc(p) = & - leafc(p) + & - frootc(p) + & - livestemc(p) + & - deadstemc(p) + & - livecrootc(p) + & - deadcrootc(p) - - ! stored vegetation carbon, excluding cpool (STORVEGC) - storvegc(p) = & - cpool(p) + & - leafc_storage(p) + & - frootc_storage(p) + & - livestemc_storage(p) + & - deadstemc_storage(p) + & - livecrootc_storage(p) + & - deadcrootc_storage(p) + & - leafc_xfer(p) + & - frootc_xfer(p) + & - livestemc_xfer(p) + & - deadstemc_xfer(p) + & - livecrootc_xfer(p) + & - deadcrootc_xfer(p) + & - gresp_storage(p) + & - gresp_xfer(p) - - ! total vegetation carbon, excluding cpool (TOTVEGC) - totvegc(p) = dispvegc(p) + storvegc(p) - - ! total pft-level carbon, including cpool (TOTPFTC) - totpftc(p) = totvegc(p) + xsmrpool(p) - - end do ! end of pfts loop - - ! use p2c routine to get selected column-average pft-level fluxes and states - call p2c(num_soilc, filter_soilc, gpp, col_gpp) - call p2c(num_soilc, filter_soilc, ar, col_ar) - call p2c(num_soilc, filter_soilc, rr, col_rr) - call p2c(num_soilc, filter_soilc, npp, col_npp) - call p2c(num_soilc, filter_soilc, vegfire, col_vegfire) - call p2c(num_soilc, filter_soilc, wood_harvestc, col_wood_harvestc) - call p2c(num_soilc, filter_soilc, totvegc, col_totvegc) - call p2c(num_soilc, filter_soilc, totpftc, col_totpftc) - call p2c(num_soilc, filter_soilc, pft_fire_closs, col_pft_fire_closs) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! litter heterotrophic respiration (LITHR) - lithr(c) = & - litr1_hr(c) + & - litr2_hr(c) + & - litr3_hr(c) - - ! soil organic matter heterotrophic respiration (SOMHR) - somhr(c) = & - soil1_hr(c) + & - soil2_hr(c) + & - soil3_hr(c) + & - soil4_hr(c) - - ! total heterotrophic respiration (HR) - hr(c) = lithr(c) + somhr(c) - - ! total soil respiration, heterotrophic + root respiration (SR) - sr(c) = col_rr(c) + hr(c) - - ! total ecosystem respiration, autotrophic + heterotrophic (ER) - er(c) = col_ar(c) + hr(c) - - ! litter fire losses (LITFIRE) - litfire(c) = 0._r8 - - ! total wood product loss - product_closs(c) = & - prod10c_loss(c) + & - prod100c_loss(c) - - ! soil organic matter fire losses (SOMFIRE) - somfire(c) = 0._r8 - - ! total ecosystem fire losses (TOTFIRE) - totfire(c) = & - litfire(c) + & - somfire(c) + & - col_vegfire(c) - - ! column-level carbon losses to fire, including pft losses - col_fire_closs(c) = & - m_litr1c_to_fire(c) + & - m_litr2c_to_fire(c) + & - m_litr3c_to_fire(c) + & - m_cwdc_to_fire(c) + & - col_pft_fire_closs(c) - - ! column-level carbon losses due to landcover change - dwt_closs(c) = & - dwt_conv_cflux(c) - - ! net ecosystem production, excludes fire flux, positive for sink (NEP) - nep(c) = col_gpp(c) - er(c) - - ! net ecosystem exchange of carbon, includes fire flux, positive for source (NBP) - nbp(c) = nep(c) - col_fire_closs(c) - dwt_closs(c) - product_closs(c) - - ! net ecosystem exchange of carbon, includes fire flux, positive for source (NEE) - nee(c) = -nep(c) + col_fire_closs(c) + dwt_closs(c) + product_closs(c) - - ! total litter carbon (TOTLITC) - totlitc(c) = & - litr1c(c) + & - litr2c(c) + & - litr3c(c) - - ! total soil organic matter carbon (TOTSOMC) - totsomc(c) = & - soil1c(c) + & - soil2c(c) + & - soil3c(c) + & - soil4c(c) - - ! total wood product carbon - totprodc(c) = & - prod10c(c) + & - prod100c(c) - - ! total ecosystem carbon, including veg but excluding cpool (TOTECOSYSC) - totecosysc(c) = & - cwdc(c) + & - totlitc(c) + & - totsomc(c) + & - totprodc(c) + & - col_totvegc(c) - - ! total column carbon, including veg and cpool (TOTCOLC) - totcolc(c) = & - cwdc(c) + & - totlitc(c) + & - totsomc(c) + & - totprodc(c) + & - col_totpftc(c) - - end do ! end of columns loop - - -end subroutine C13Summary -!----------------------------------------------------------------------- - -end module C13SummaryMod diff --git a/src_clm40/biogeochem/CNAllocationMod.F90 b/src_clm40/biogeochem/CNAllocationMod.F90 deleted file mode 100644 index 5a760a0bc7..0000000000 --- a/src_clm40/biogeochem/CNAllocationMod.F90 +++ /dev/null @@ -1,902 +0,0 @@ -module CNAllocationMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNAllocationMod -! -! !DESCRIPTION: -! Module holding routines used in allocation model for coupled carbon -! nitrogen code. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils , only: endrun - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNAllocationInit ! Initialization - public :: CNAllocation ! run method - -! !PUBLIC DATA MEMBERS: - character(len=*), parameter, public :: suplnAll=& ! Supplemental Nitrogen for all PFT's - 'ALL' - character(len=*), parameter, public :: suplnCrp=& ! Supplemental Nitrogen for prognostic Crop - 'PROG_CROP_ONLY' - character(len=*), parameter, public :: suplnNon=& ! No supplemental Nitrogen - 'NONE' - character(len=15), public :: suplnitro = suplnNon ! Supplemental Nitrogen mode -! !PRIVATE DATA MEMBERS: - real(r8):: dt !decomp timestep (seconds) - real(r8):: bdnr !bulk denitrification rate (1/s) - real(r8):: dayscrecover !number of days to recover negative cpool - real(r8), pointer :: arepr(:) !reproduction allocation coefficient - real(r8), pointer :: aroot(:) !root allocation coefficient - real(r8), pointer:: col_plant_ndemand(:) !column-level plant N demand - logical :: Carbon_only = .false. ! Carbon only mode - ! (Nitrogen is prescribed NOT prognostic) - logical :: crop_supln = .false. ! Prognostic crop receives supplemental Nitrogen -! -! !REVISION HISTORY: -! 8/5/03: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNAllocationInit -! -! !INTERFACE: -subroutine CNAllocationInit ( lbc, ubc, lbp, ubp ) -! -! !DESCRIPTION: -! -! !USES: - use clm_varcon , only: secspday - use clm_time_manager, only: get_step_size - use surfrdMod , only: crop_prog - use clm_varctl , only: iulog, use_c13 - use shr_infnan_mod , only: nan => shr_infnan_nan, assignment(=) -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 4/6/11: Created by Erik Kluzek -! -! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNAllocationInit' -!EOP -!----------------------------------------------------------------------- - if ( crop_prog )then - allocate(arepr(lbp:ubp)) - allocate(aroot(lbp:ubp)) - arepr(:) = nan - aroot(:) = nan - end if - allocate(col_plant_ndemand(lbc:ubc)) - col_plant_ndemand(:) = nan - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! set some space-and-time constant parameters - bdnr = 0.5_r8 * (dt/secspday) - dayscrecover = 30.0_r8 - - ! Change namelist settings into private logical variables - select case(suplnitro) - case(suplnNon) - Carbon_only = .false. - crop_supln = .false. - case(suplnCrp) - Carbon_only = .false. - crop_supln = .true. - if ( .not. crop_prog )then - call endrun( trim(subname)//'ERROR: '//trim(suplnCrp)// & - ' can NOT be on when crop is NOT' ) - end if - case(suplnAll) - Carbon_only = .true. - crop_supln = .false. - case default - write(iulog,*) 'Supplemental Nitrogen flag (suplnitro) can only be: ', & - suplnNon, ",", suplnCrp, ', or ', suplnAll - call endrun( trim(subname)//'ERROR: supplemental Nitrogen flag is not correct' ) - end select - -end subroutine CNAllocationInit - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNAllocation -! -! !INTERFACE: -subroutine CNAllocation (lbp, ubp, lbc, ubc, & - num_soilc, filter_soilc, num_soilp, filter_soilp, & - num_pcropp ) -! -! !DESCRIPTION: -! -! !USES: - use clmtype - use clm_varctl, only: iulog, use_c13 - use shr_sys_mod, only: shr_sys_flush - use pft2colMod, only: p2c - use pftvarcon , only: npcropmin, declfact, bfact, aleaff, arootf, astemf, & - arooti, fleafi, allconsl, allconss, grperc, grpnow - use clm_varcon, only: secspday, istsoil, istcrop - use clm_varpar, only: max_pft_per_col -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - integer, intent(in) :: num_pcropp ! number of pfts in prognostic crop filter -! -! !CALLED FROM: -! subroutine CNdecompAlloc in module CNdecompMod.F90 -! -! !REVISION HISTORY: -! 8/5/03: Created by Peter Thornton -! 10/23/03, Peter Thornton: migrated to vector data structures -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays -! - ! pft level - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pfti(:) ! initial pft index in landunit - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] - real(r8), pointer :: xsmrpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: psnsun(:) ! sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) ! shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - - real(r8), pointer :: c13_psnsun(:) ! C13 sunlit leaf-level photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: c13_psnsha(:) ! C13 shaded leaf-level photosynthesis (umol CO2 /m**2/ s) - - real(r8), pointer :: laisun(:) ! sunlit projected leaf area index - real(r8), pointer :: laisha(:) ! shaded projected leaf area index - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: livecroot_mr(:) - real(r8), pointer :: leaf_curmr(:) - real(r8), pointer :: froot_curmr(:) - real(r8), pointer :: livestem_curmr(:) - real(r8), pointer :: livecroot_curmr(:) - real(r8), pointer :: leaf_xsmr(:) - real(r8), pointer :: froot_xsmr(:) - real(r8), pointer :: livestem_xsmr(:) - real(r8), pointer :: livecroot_xsmr(:) - ! column level - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - ! ecophysiological constants - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: froot_leaf(:) ! allocation parameter: new fine root C per new leaf C (gC/gC) - real(r8), pointer :: croot_stem(:) ! allocation parameter: new coarse root C per new stem C (gC/gC) - real(r8), pointer :: stem_leaf(:) ! allocation parameter: new stem c per new leaf C (gC/gC) - real(r8), pointer :: flivewd(:) ! allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) - real(r8), pointer :: frootcn(:) ! fine root C:N (gC/gN) - real(r8), pointer :: livewdcn(:) ! live wood (phloem and ray parenchyma) C:N (gC/gN) - real(r8), pointer :: deadwdcn(:) ! dead wood (xylem and heartwood) C:N (gC/gN) - real(r8), pointer :: fcur2(:) ! allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - integer, pointer :: plandunit(:) ! index into landunit level quantities - integer, pointer :: clandunit(:) ! index into landunit level quantities - integer , pointer :: itypelun(:) ! landunit type - logical , pointer :: croplive(:) ! flag, true if planted, not harvested - integer , pointer :: peaklai(:) ! 1: max allowed lai; 0: not at max - real(r8), pointer :: gddmaturity(:)! gdd needed to harvest - real(r8), pointer :: huileaf(:) ! heat unit index needed from planting to leaf emergence - real(r8), pointer :: huigrain(:) ! same to reach vegetative maturity - real(r8), pointer :: hui(:) ! =gdd since planting (gddplant) - real(r8), pointer :: leafout(:) ! =gdd from top soil layer temperature - real(r8), pointer :: aleafi(:) ! saved allocation coefficient from phase 2 - real(r8), pointer :: astemi(:) ! saved allocation coefficient from phase 2 - real(r8), pointer :: aleaf(:) ! leaf allocation coefficient - real(r8), pointer :: astem(:) ! stem allocation coefficient - real(r8), pointer :: graincn(:) ! grain C:N (gC/gN) -! -! local pointers to implicit in/out arrays -! - ! pft level - real(r8), pointer :: gpp(:) ! GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: availc(:) ! C flux available for allocation (gC/m2/s) - real(r8), pointer :: xsmrpool_recover(:) ! C flux assigned to recovery of negative cpool (gC/m2/s) - real(r8), pointer :: c_allometry(:) ! C allocation index (DIM) - real(r8), pointer :: n_allometry(:) ! N allocation index (DIM) - real(r8), pointer :: plant_ndemand(:) ! N flux required to support initial GPP (gN/m2/s) - real(r8), pointer :: tempsum_potential_gpp(:) ! temporary annual sum of potential GPP - real(r8), pointer :: tempmax_retransn(:) ! temporary annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: annsum_potential_gpp(:) ! annual sum of potential GPP - real(r8), pointer :: avail_retransn(:) ! N flux available from retranslocation pool (gN/m2/s) - real(r8), pointer :: annmax_retransn(:) ! annual max of retranslocated N pool - real(r8), pointer :: plant_nalloc(:) ! total allocated N flux (gN/m2/s) - real(r8), pointer :: plant_calloc(:) ! total allocated C flux (gC/m2/s) - real(r8), pointer :: excess_cflux(:) ! C flux not allocated due to downregulation (gC/m2/s) - real(r8), pointer :: downreg(:) ! fractional reduction in GPP due to N limitation (DIM) - real(r8), pointer :: annsum_npp(:) ! annual sum of NPP, for wood allocation - real(r8), pointer :: cpool_to_xsmrpool(:) - real(r8), pointer :: psnsun_to_cpool(:) - real(r8), pointer :: psnshade_to_cpool(:) - - real(r8), pointer :: c13_psnsun_to_cpool(:) - real(r8), pointer :: c13_psnshade_to_cpool(:) - - real(r8), pointer :: cpool_to_leafc(:) - real(r8), pointer :: cpool_to_leafc_storage(:) - real(r8), pointer :: cpool_to_frootc(:) - real(r8), pointer :: cpool_to_frootc_storage(:) - real(r8), pointer :: cpool_to_livestemc(:) - real(r8), pointer :: cpool_to_livestemc_storage(:) - real(r8), pointer :: cpool_to_deadstemc(:) - real(r8), pointer :: cpool_to_deadstemc_storage(:) - real(r8), pointer :: cpool_to_livecrootc(:) - real(r8), pointer :: cpool_to_livecrootc_storage(:) - real(r8), pointer :: cpool_to_deadcrootc(:) - real(r8), pointer :: cpool_to_deadcrootc_storage(:) - real(r8), pointer :: cpool_to_gresp_storage(:) ! allocation to growth respiration storage (gC/m2/s) - real(r8), pointer :: retransn_to_npool(:) ! deployment of retranslocated N (gN/m2/s) - real(r8), pointer :: sminn_to_npool(:) ! deployment of soil mineral N uptake (gN/m2/s) - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C (gC/m2/s) - real(r8), pointer :: cpool_to_grainc_storage(:) ! allocation to grain C storage (gC/m2/s) - real(r8), pointer :: npool_to_grainn(:) ! allocation to grain N (gN/m2/s) - real(r8), pointer :: npool_to_grainn_storage(:) ! allocation to grain N storage (gN/m2/s) - real(r8), pointer :: npool_to_leafn(:) ! allocation to leaf N (gN/m2/s) - real(r8), pointer :: npool_to_leafn_storage(:) ! allocation to leaf N storage (gN/m2/s) - real(r8), pointer :: npool_to_frootn(:) ! allocation to fine root N (gN/m2/s) - real(r8), pointer :: npool_to_frootn_storage(:) ! allocation to fine root N storage (gN/m2/s) - real(r8), pointer :: npool_to_livestemn(:) - real(r8), pointer :: npool_to_livestemn_storage(:) - real(r8), pointer :: npool_to_deadstemn(:) - real(r8), pointer :: npool_to_deadstemn_storage(:) - real(r8), pointer :: npool_to_livecrootn(:) - real(r8), pointer :: npool_to_livecrootn_storage(:) - real(r8), pointer :: npool_to_deadcrootn(:) - real(r8), pointer :: npool_to_deadcrootn_storage(:) - ! column level - real(r8), pointer :: fpi(:) ! fraction of potential immobilization (no units) - real(r8), pointer :: fpg(:) ! fraction of potential gpp (no units) - real(r8), pointer :: potential_immob(:) - real(r8), pointer :: actual_immob(:) - real(r8), pointer :: sminn_to_plant(:) - real(r8), pointer :: sminn_to_denit_excess(:) - real(r8), pointer :: supplement_to_sminn(:) -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p,l,pi !indices - integer :: fp !lake filter pft index - integer :: fc !lake filter column index - integer :: nlimit !flag for N limitation - real(r8):: mr !maintenance respiration (gC/m2/s) - real(r8):: f1,f2,f3,f4,g1,g2 !allocation parameters - real(r8):: cnl,cnfr,cnlw,cndw !C:N ratios for leaf, fine root, and wood - real(r8):: fcur !fraction of current psn displayed as growth - real(r8):: sum_ndemand !total column N demand (gN/m2/s) - real(r8):: gresp_storage !temporary variable for growth resp to storage - real(r8):: nlc !temporary variable for total new leaf carbon allocation - real(r8):: curmr, curmr_ratio !xsmrpool temporary variables - real(r8) f5 !grain allocation parameter - real(r8) cng !C:N ratio for grain (= cnlw for now; slevis) - real(r8) fleaf !fraction allocated to leaf - - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - ivt => pft%itype - pcolumn => pft%column - plandunit => pft%landunit - clandunit => col%landunit - pfti => col%pfti - itypelun => lun%itype - lgsf => pepv%lgsf - xsmrpool => pcs%xsmrpool - retransn => pns%retransn - psnsun => pcf%psnsun - psnsha => pcf%psnsha - - c13_psnsun => pc13f%psnsun - c13_psnsha => pc13f%psnsha - - laisun => pps%laisun - laisha => pps%laisha - leaf_mr => pcf%leaf_mr - froot_mr => pcf%froot_mr - livestem_mr => pcf%livestem_mr - livecroot_mr => pcf%livecroot_mr - leaf_curmr => pcf%leaf_curmr - froot_curmr => pcf%froot_curmr - livestem_curmr => pcf%livestem_curmr - livecroot_curmr => pcf%livecroot_curmr - leaf_xsmr => pcf%leaf_xsmr - froot_xsmr => pcf%froot_xsmr - livestem_xsmr => pcf%livestem_xsmr - livecroot_xsmr => pcf%livecroot_xsmr - sminn => cns%sminn - woody => pftcon%woody - froot_leaf => pftcon%froot_leaf - croot_stem => pftcon%croot_stem - stem_leaf => pftcon%stem_leaf - flivewd => pftcon%flivewd - leafcn => pftcon%leafcn - frootcn => pftcon%frootcn - livewdcn => pftcon%livewdcn - deadwdcn => pftcon%deadwdcn - fcur2 => pftcon%fcur - gddmaturity => pps%gddmaturity - huileaf => pps%huileaf - huigrain => pps%huigrain - hui => pps%gddplant - leafout => pps%gddtsoi - croplive => pps%croplive - peaklai => pps%peaklai - graincn => pftcon%graincn - ! Assign local pointers to derived type arrays (out) - gpp => pepv%gpp - availc => pepv%availc - xsmrpool_recover => pepv%xsmrpool_recover - c_allometry => pepv%c_allometry - n_allometry => pepv%n_allometry - plant_ndemand => pepv%plant_ndemand - tempsum_potential_gpp => pepv%tempsum_potential_gpp - tempmax_retransn => pepv%tempmax_retransn - annsum_potential_gpp => pepv%annsum_potential_gpp - avail_retransn => pepv%avail_retransn - annmax_retransn => pepv%annmax_retransn - plant_nalloc => pepv%plant_nalloc - plant_calloc => pepv%plant_calloc - excess_cflux => pepv%excess_cflux - downreg => pepv%downreg - annsum_npp => pepv%annsum_npp - cpool_to_xsmrpool => pcf%cpool_to_xsmrpool - psnsun_to_cpool => pcf%psnsun_to_cpool - psnshade_to_cpool => pcf%psnshade_to_cpool - - c13_psnsun_to_cpool => pc13f%psnsun_to_cpool - c13_psnshade_to_cpool => pc13f%psnshade_to_cpool - - cpool_to_leafc => pcf%cpool_to_leafc - cpool_to_leafc_storage => pcf%cpool_to_leafc_storage - cpool_to_frootc => pcf%cpool_to_frootc - cpool_to_frootc_storage => pcf%cpool_to_frootc_storage - cpool_to_livestemc => pcf%cpool_to_livestemc - cpool_to_livestemc_storage => pcf%cpool_to_livestemc_storage - cpool_to_deadstemc => pcf%cpool_to_deadstemc - cpool_to_deadstemc_storage => pcf%cpool_to_deadstemc_storage - cpool_to_livecrootc => pcf%cpool_to_livecrootc - cpool_to_livecrootc_storage => pcf%cpool_to_livecrootc_storage - cpool_to_deadcrootc => pcf%cpool_to_deadcrootc - cpool_to_deadcrootc_storage => pcf%cpool_to_deadcrootc_storage - cpool_to_gresp_storage => pcf%cpool_to_gresp_storage - cpool_to_grainc => pcf%cpool_to_grainc - cpool_to_grainc_storage => pcf%cpool_to_grainc_storage - npool_to_grainn => pnf%npool_to_grainn - npool_to_grainn_storage => pnf%npool_to_grainn_storage - retransn_to_npool => pnf%retransn_to_npool - sminn_to_npool => pnf%sminn_to_npool - npool_to_leafn => pnf%npool_to_leafn - npool_to_leafn_storage => pnf%npool_to_leafn_storage - npool_to_frootn => pnf%npool_to_frootn - npool_to_frootn_storage => pnf%npool_to_frootn_storage - npool_to_livestemn => pnf%npool_to_livestemn - npool_to_livestemn_storage => pnf%npool_to_livestemn_storage - npool_to_deadstemn => pnf%npool_to_deadstemn - npool_to_deadstemn_storage => pnf%npool_to_deadstemn_storage - npool_to_livecrootn => pnf%npool_to_livecrootn - npool_to_livecrootn_storage => pnf%npool_to_livecrootn_storage - npool_to_deadcrootn => pnf%npool_to_deadcrootn - npool_to_deadcrootn_storage => pnf%npool_to_deadcrootn_storage - fpi => cps%fpi - fpg => cps%fpg - potential_immob => cnf%potential_immob - actual_immob => cnf%actual_immob - sminn_to_plant => cnf%sminn_to_plant - sminn_to_denit_excess => cnf%sminn_to_denit_excess - supplement_to_sminn => cnf%supplement_to_sminn - aleafi => pps%aleafi - astemi => pps%astemi - aleaf => pps%aleaf - astem => pps%astem - - ! loop over pfts to assess the total plant N demand - do fp=1,num_soilp - p = filter_soilp(fp) - - ! get the time step total gross photosynthesis - ! this is coming from the canopy fluxes code, and is the - ! gpp that is used to control stomatal conductance. - ! For the nitrogen downregulation code, this is assumed - ! to be the potential gpp, and the actual gpp will be - ! reduced due to N limitation. - - ! Convert psn from umol/m2/s -> gC/m2/s - - ! The input psn (psnsun and psnsha) are expressed per unit LAI - ! in the sunlit and shaded canopy, respectively. These need to be - ! scaled by laisun and laisha to get the total gpp for allocation - - psnsun_to_cpool(p) = psnsun(p) * laisun(p) * 12.011e-6_r8 - psnshade_to_cpool(p) = psnsha(p) * laisha(p) * 12.011e-6_r8 - if (use_c13) then - c13_psnsun_to_cpool(p) = c13_psnsun(p) * laisun(p) * 12.011e-6_r8 - c13_psnshade_to_cpool(p) = c13_psnsha(p) * laisha(p) * 12.011e-6_r8 - endif - - gpp(p) = psnsun_to_cpool(p) + psnshade_to_cpool(p) - - ! get the time step total maintenance respiration - ! These fluxes should already be in gC/m2/s - - mr = leaf_mr(p) + froot_mr(p) - if (woody(ivt(p)) == 1.0_r8) then - mr = mr + livestem_mr(p) + livecroot_mr(p) - else if (ivt(p) >= npcropmin)then - if (croplive(p)) mr = mr + livestem_mr(p) - end if - - ! carbon flux available for allocation - availc(p) = gpp(p) - mr - - ! new code added for isotope calculations, 7/1/05, PET - ! If mr > gpp, then some mr comes from gpp, the rest comes from - ! cpool (xsmr) - if (mr > 0._r8 .and. availc(p) < 0._r8) then - curmr = gpp(p) - curmr_ratio = curmr / mr - else - curmr_ratio = 1._r8 - end if - leaf_curmr(p) = leaf_mr(p) * curmr_ratio - leaf_xsmr(p) = leaf_mr(p) - leaf_curmr(p) - froot_curmr(p) = froot_mr(p) * curmr_ratio - froot_xsmr(p) = froot_mr(p) - froot_curmr(p) - livestem_curmr(p) = livestem_mr(p) * curmr_ratio - livestem_xsmr(p) = livestem_mr(p) - livestem_curmr(p) - livecroot_curmr(p) = livecroot_mr(p) * curmr_ratio - livecroot_xsmr(p) = livecroot_mr(p) - livecroot_curmr(p) - - ! no allocation when available c is negative - availc(p) = max(availc(p),0.0_r8) - - ! test for an xsmrpool deficit - if (xsmrpool(p) < 0.0_r8) then - ! Running a deficit in the xsmrpool, so the first priority is to let - ! some availc from this timestep accumulate in xsmrpool. - ! Determine rate of recovery for xsmrpool deficit - - xsmrpool_recover(p) = -xsmrpool(p)/(dayscrecover*secspday) - if (xsmrpool_recover(p) < availc(p)) then - ! available carbon reduced by amount for xsmrpool recovery - availc(p) = availc(p) - xsmrpool_recover(p) - else - ! all of the available carbon goes to xsmrpool recovery - xsmrpool_recover(p) = availc(p) - availc(p) = 0.0_r8 - end if - cpool_to_xsmrpool(p) = xsmrpool_recover(p) - end if - - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiology file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - - ! calculate f1 to f5 for prog crops following AgroIBIS subr phenocrop - - f5 = 0._r8 ! continued intializations from above - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - - if (croplive(p)) then - ! same phases appear in subroutine CropPhenology - - ! Phase 1 completed: - ! ================== - ! if hui is less than the number of gdd needed for filling of grain - ! leaf emergence also has to have taken place for lai changes to occur - ! and carbon assimilation - ! Next phase: leaf emergence to start of leaf decline - - if (leafout(p) >= huileaf(p) .and. hui(p) < huigrain(p)) then - - ! allocation rules for crops based on maturity and linear decrease - ! of amount allocated to roots over course of the growing season - - if (peaklai(p) == 1) then ! lai at maximum allowed - arepr(p) = 0._r8 - aleaf(p) = 1.e-5_r8 - astem(p) = 0._r8 - aroot(p) = 1._r8 - arepr(p) - aleaf(p) - astem(p) - else - arepr(p) = 0._r8 - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * & - min(1._r8, hui(p)/gddmaturity(p)))) - fleaf = fleafi(ivt(p)) * (exp(-bfact(ivt(p))) - & - exp(-bfact(ivt(p))*hui(p)/huigrain(p))) / & - (exp(-bfact(ivt(p)))-1) ! fraction alloc to leaf (from J Norman alloc curve) - aleaf(p) = max(1.e-5_r8, (1._r8 - aroot(p)) * fleaf) - astem(p) = 1._r8 - arepr(p) - aleaf(p) - aroot(p) - end if - - ! AgroIBIS included here an immediate adjustment to aleaf & astem if the - ! predicted lai from the above allocation coefficients exceeded laimx. - ! We have decided to live with lais slightly higher than laimx by - ! enforcing the cap in the following tstep through the peaklai logic above. - - astemi(p) = astem(p) ! save for use by equations after shift - aleafi(p) = aleaf(p) ! to reproductive phenology stage begins - - ! Phase 2 completed: - ! ================== - ! shift allocation either when enough gdd are accumulated or maximum number - ! of days has elapsed since planting - - else if (hui(p) >= huigrain(p)) then - - aroot(p) = max(0._r8, min(1._r8, arooti(ivt(p)) - & - (arooti(ivt(p)) - arootf(ivt(p))) * min(1._r8, hui(p)/gddmaturity(p)))) - if (astemi(p) > astemf(ivt(p))) then - astem(p) = max(0._r8, max(astemf(ivt(p)), astem(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconss(ivt(p)) ))) - end if - if (aleafi(p) > aleaff(ivt(p))) then - aleaf(p) = max(1.e-5_r8, max(aleaff(ivt(p)), aleaf(p) * & - (1._r8 - min((hui(p)- & - huigrain(p))/((gddmaturity(p)*declfact(ivt(p)))- & - huigrain(p)),1._r8)**allconsl(ivt(p)) ))) - end if - arepr(p) = 1._r8 - aroot(p) - astem(p) - aleaf(p) - astem(p) = astem(p)+arepr(p) - arepr(p) = 0._r8 - - else ! pre emergence - aleaf(p) = 1.e-5_r8 ! allocation coefficients should be irrelevant - astem(p) = 0._r8 ! because crops have no live carbon pools; - aroot(p) = 0._r8 ! this applies to this "else" and to the "else" - arepr(p) = 0._r8 ! a few lines down - end if - - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - - else ! .not croplive - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - ! based on available C, use constant allometric relationships to - ! determine N requirements - if (woody(ivt(p)) == 1.0_r8) then - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else if (ivt(p) >= npcropmin) then ! skip generic crops - c_allometry(p) = (1._r8+g1)*(1._r8+f1+f3*(1._r8+f2)) - n_allometry(p) = 1._r8/cnl + f1/cnfr + (f3*f4*(1._r8+f2))/cnlw + & - (f3*(1._r8-f4)*(1._r8+f2))/cndw - else - c_allometry(p) = 1._r8+g1+f1+f1*g1 - n_allometry(p) = 1._r8/cnl + f1/cnfr - end if - plant_ndemand(p) = availc(p)*(n_allometry(p)/c_allometry(p)) - - ! retranslocated N deployment depends on seasonal cycle of potential GPP - ! (requires one year run to accumulate demand) - - tempsum_potential_gpp(p) = tempsum_potential_gpp(p) + gpp(p) - - ! Adding the following line to carry max retransn info to CN Annual Update - tempmax_retransn(p) = max(tempmax_retransn(p),retransn(p)) - - if (annsum_potential_gpp(p) > 0.0_r8) then - avail_retransn(p) = (annmax_retransn(p)/2.0)*(gpp(p)/annsum_potential_gpp(p))/dt - else - avail_retransn(p) = 0.0_r8 - end if - - ! make sure available retrans N doesn't exceed storage - avail_retransn(p) = min(avail_retransn(p), retransn(p)/dt) - - ! modify plant N demand according to the availability of - ! retranslocated N - ! take from retransn pool at most the flux required to meet - ! plant ndemand - - if (plant_ndemand(p) > avail_retransn(p)) then - retransn_to_npool(p) = avail_retransn(p) - else - retransn_to_npool(p) = plant_ndemand(p) - end if - plant_ndemand(p) = plant_ndemand(p) - retransn_to_npool(p) - - end do ! end pft loop - - ! now use the p2c routine to get the column-averaged plant_ndemand - call p2c(num_soilc,filter_soilc,plant_ndemand,col_plant_ndemand) - - ! column loop to resolve plant/heterotroph competition for mineral N - do fc=1,num_soilc - c = filter_soilc(fc) - l = clandunit(c) - - sum_ndemand = col_plant_ndemand(c) + potential_immob(c) - - if (sum_ndemand*dt < sminn(c)) then - ! N availability is not limiting immobilization of plant - ! uptake, and both can proceed at their potential rates - - nlimit = 0 - fpi(c) = 1.0_r8 - actual_immob(c) = potential_immob(c) - sminn_to_plant(c) = col_plant_ndemand(c) - - ! under conditions of excess N, some proportion is assumed to - ! be lost to denitrification, in addition to the constant - ! proportion lost in the decomposition pathways - - sminn_to_denit_excess(c) = bdnr*((sminn(c)/dt) - sum_ndemand) - else if ( ((.not. Carbon_only) .and. (.not. crop_supln)) .or. & - (crop_supln .and. ( (itypelun(l) /= istcrop) .or. & - ((itypelun(l) == istcrop) .and. (ivt(pfti(c)) < npcropmin) )) ) )then - - ! N availability can not satisfy the sum of immobilization and - ! plant growth demands, so these two demands compete for available - ! soil mineral N resource. - - nlimit = 1 - if (sum_ndemand > 0.0_r8) then - actual_immob(c) = (sminn(c)/dt)*(potential_immob(c) / sum_ndemand) - else - actual_immob(c) = 0.0_r8 - end if - - if (potential_immob(c) > 0.0_r8) then - fpi(c) = actual_immob(c) / potential_immob(c) - else - fpi(c) = 0.0_r8 - end if - - sminn_to_plant(c) = (sminn(c)/dt) - actual_immob(c) - else if ( Carbon_only .or. & - (crop_supln .and. (itypelun(l) == istcrop) .and. & - (ivt(pfti(c)) >= npcropmin)) )then - ! this code block controls the addition of N to sminn pool - ! to eliminate any N limitation, when Carbon_Only is set. This lets the - ! model behave essentially as a carbon-only model, but with the - ! benefit of keeping track of the N additions needed to - ! eliminate N limitations, so there is still a diagnostic quantity - ! that describes the degree of N limitation at steady-state. - - nlimit = 1 - fpi(c) = 1.0_r8 - actual_immob(c) = potential_immob(c) - sminn_to_plant(c) = col_plant_ndemand(c) - supplement_to_sminn(c) = sum_ndemand - (sminn(c)/dt) - else - call endrun( 'This else should NOT be able to happen' ) - end if - - ! calculate the fraction of potential growth that can be - ! acheived with the N available to plants - - if (col_plant_ndemand(c) > 0.0_r8) then - fpg(c) = sminn_to_plant(c) / col_plant_ndemand(c) - else - fpg(c) = 1.0_r8 - end if - - end do ! end of column loop - - ! start new pft loop to distribute the available N between the - ! competing pfts on the basis of relative demand, and allocate C and N to - ! new growth and storage - - do fp=1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - - ! set some local allocation variables - f1 = froot_leaf(ivt(p)) - f2 = croot_stem(ivt(p)) - - ! modified wood allocation to be 2.2 at npp=800 gC/m2/yr, 0.2 at npp=0, - ! constrained so that it does not go lower than 0.2 (under negative annsum_npp) - ! There was an error in this formula in previous version, where the coefficient - ! was 0.004 instead of 0.0025. - ! This variable allocation is only for trees. Shrubs have a constant - ! allocation as specified in the pft-physiology file. The value is also used - ! as a trigger here: -1.0 means to use the dynamic allocation (trees). - if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 - else - f3 = stem_leaf(ivt(p)) - end if - - f4 = flivewd(ivt(p)) - g1 = grperc(ivt(p)) - g2 = grpnow(ivt(p)) - cnl = leafcn(ivt(p)) - cnfr = frootcn(ivt(p)) - cnlw = livewdcn(ivt(p)) - cndw = deadwdcn(ivt(p)) - fcur = fcur2(ivt(p)) - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - if (croplive(p)) then - f1 = aroot(p) / aleaf(p) - f3 = astem(p) / aleaf(p) - f5 = arepr(p) / aleaf(p) - g1 = 0.25_r8 - else - f1 = 0._r8 - f3 = 0._r8 - f5 = 0._r8 - g1 = 0.25_r8 - end if - end if - - ! increase fcur linearly with ndays_active, until fcur reaches 1.0 at - ! ndays_active = days/year. This prevents the continued storage of C and N. - ! turning off this correction (PET, 12/11/03), instead using bgtr in - ! phenology algorithm. - !fcur = fcur + (1._r8 - fcur)*lgsf(p) - - sminn_to_npool(p) = plant_ndemand(p) * fpg(c) - plant_nalloc(p) = sminn_to_npool(p) + retransn_to_npool(p) - - ! calculate the associated carbon allocation, and the excess - ! carbon flux that must be accounted for through downregulation - - plant_calloc(p) = plant_nalloc(p) * (c_allometry(p)/n_allometry(p)) - excess_cflux(p) = availc(p) - plant_calloc(p) - - ! reduce gpp fluxes due to N limitation - if (gpp(p) > 0.0_r8) then - downreg(p) = excess_cflux(p)/gpp(p) - psnsun_to_cpool(p) = psnsun_to_cpool(p)*(1._r8 - downreg(p)) - psnshade_to_cpool(p) = psnshade_to_cpool(p)*(1._r8 - downreg(p)) - if (use_c13) then - c13_psnsun_to_cpool(p) = c13_psnsun_to_cpool(p)*(1._r8 - downreg(p)) - c13_psnshade_to_cpool(p) = c13_psnshade_to_cpool(p)*(1._r8 - downreg(p)) - endif - end if - - ! calculate the amount of new leaf C dictated by these allocation - ! decisions, and calculate the daily fluxes of C and N to current - ! growth and storage pools - - ! fcur is the proportion of this day's growth that is displayed now, - ! the remainder going into storage for display next year through the - ! transfer pools - - nlc = plant_calloc(p) / c_allometry(p) - cpool_to_leafc(p) = nlc * fcur - cpool_to_leafc_storage(p) = nlc * (1._r8 - fcur) - cpool_to_frootc(p) = nlc * f1 * fcur - cpool_to_frootc_storage(p) = nlc * f1 * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool_to_livestemc(p) = nlc * f3 * f4 * fcur - cpool_to_livestemc_storage(p) = nlc * f3 * f4 * (1._r8 - fcur) - cpool_to_deadstemc(p) = nlc * f3 * (1._r8 - f4) * fcur - cpool_to_deadstemc_storage(p) = nlc * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_livecrootc(p) = nlc * f2 * f3 * f4 * fcur - cpool_to_livecrootc_storage(p) = nlc * f2 * f3 * f4 * (1._r8 - fcur) - cpool_to_deadcrootc(p) = nlc * f2 * f3 * (1._r8 - f4) * fcur - cpool_to_deadcrootc_storage(p) = nlc * f2 * f3 * (1._r8 - f4) * (1._r8 - fcur) - cpool_to_grainc(p) = nlc * f5 * fcur - cpool_to_grainc_storage(p) = nlc * f5 * (1._r8 -fcur) - end if - - ! corresponding N fluxes - npool_to_leafn(p) = (nlc / cnl) * fcur - npool_to_leafn_storage(p) = (nlc / cnl) * (1._r8 - fcur) - npool_to_frootn(p) = (nlc * f1 / cnfr) * fcur - npool_to_frootn_storage(p) = (nlc * f1 / cnfr) * (1._r8 - fcur) - if (woody(ivt(p)) == 1._r8) then - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cng = graincn(ivt(p)) - npool_to_livestemn(p) = (nlc * f3 * f4 / cnlw) * fcur - npool_to_livestemn_storage(p) = (nlc * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadstemn(p) = (nlc * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadstemn_storage(p) = (nlc * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_livecrootn(p) = (nlc * f2 * f3 * f4 / cnlw) * fcur - npool_to_livecrootn_storage(p) = (nlc * f2 * f3 * f4 / cnlw) * (1._r8 - fcur) - npool_to_deadcrootn(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * fcur - npool_to_deadcrootn_storage(p) = (nlc * f2 * f3 * (1._r8 - f4) / cndw) * (1._r8 - fcur) - npool_to_grainn(p) = (nlc * f5 / cng) * fcur - npool_to_grainn_storage(p) = (nlc * f5 / cng) * (1._r8 -fcur) - end if - - ! Calculate the amount of carbon that needs to go into growth - ! respiration storage to satisfy all of the storage growth demands. - ! Allows for the fraction of growth respiration that is released at the - ! time of fixation, versus the remaining fraction that is stored for - ! release at the time of display. Note that all the growth respiration - ! fluxes that get released on a given timestep are calculated in growth_resp(), - ! but that the storage of C for growth resp during display of transferred - ! growth is assigned here. - - gresp_storage = cpool_to_leafc_storage(p) + cpool_to_frootc_storage(p) - if (woody(ivt(p)) == 1._r8) then - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadstemc_storage(p) - gresp_storage = gresp_storage + cpool_to_livecrootc_storage(p) - gresp_storage = gresp_storage + cpool_to_deadcrootc_storage(p) - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - gresp_storage = gresp_storage + cpool_to_livestemc_storage(p) - gresp_storage = gresp_storage + cpool_to_grainc_storage(p) - end if - cpool_to_gresp_storage(p) = gresp_storage * g1 * (1._r8 - g2) - - end do ! end pft loop - -end subroutine CNAllocation - -end module CNAllocationMod diff --git a/src_clm40/biogeochem/CNAnnualUpdateMod.F90 b/src_clm40/biogeochem/CNAnnualUpdateMod.F90 deleted file mode 100644 index 101d171fb5..0000000000 --- a/src_clm40/biogeochem/CNAnnualUpdateMod.F90 +++ /dev/null @@ -1,195 +0,0 @@ -module CNAnnualUpdateMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNAnnualUpdateMod -! -! !DESCRIPTION: -! Module for updating annual summation variables -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CNAnnualUpdate -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNAnnualUpdate -! -! !INTERFACE: -subroutine CNAnnualUpdate(lbc, ubc, lbp, ubp, num_soilc, filter_soilc, & - num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update annual summation variables -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size, get_days_per_year - use clm_varcon , only: secspday - use pft2colMod , only: p2c - use clm_varctl , only: use_cn, use_cndv, use_crop -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(ubp-lbp+1) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 10/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: pcolumn(:) ! index into column level - ! quantities -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: annsum_counter(:) ! seconds since last annual accumulator turnover - real(r8), pointer :: tempsum_potential_gpp(:) ! temporary annual sum of potential GPP - real(r8), pointer :: annsum_potential_gpp(:) ! annual sum of potential GPP - real(r8), pointer :: tempmax_retransn(:) ! temporary annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: annmax_retransn(:) ! annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: tempavg_t2m(:) ! temporary average 2m air temperature (K) - real(r8), pointer :: annavg_t2m(:) ! annual average 2m air temperature (K) - real(r8), pointer :: tempsum_npp(:) ! temporary sum NPP (gC/m2/yr) - real(r8), pointer :: annsum_npp(:) ! annual sum NPP (gC/m2/yr) - real(r8), pointer :: cannsum_npp(:) ! column annual sum NPP (gC/m2/yr) - real(r8), pointer :: cannavg_t2m(:) !annual average of 2m air temperature, averaged from pft-level (K) - real(r8), pointer :: tempsum_litfall(:) ! temporary sum litfall (gC/m2/yr) - real(r8), pointer :: annsum_litfall(:) ! annual sum litfall (gC/m2/yr) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays - annsum_counter => cps%annsum_counter - tempsum_potential_gpp => pepv%tempsum_potential_gpp - annsum_potential_gpp => pepv%annsum_potential_gpp - tempmax_retransn => pepv%tempmax_retransn - annmax_retransn => pepv%annmax_retransn - tempavg_t2m => pepv%tempavg_t2m - annavg_t2m => pepv%annavg_t2m - tempsum_npp => pepv%tempsum_npp - annsum_npp => pepv%annsum_npp - cannsum_npp => cps%cannsum_npp - cannavg_t2m => cps%cannavg_t2m - tempsum_litfall => pepv%tempsum_litfall - annsum_litfall => pepv%annsum_litfall - pcolumn => pft%column - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - annsum_counter(c) = annsum_counter(c) + dt - end do - - ! In the future -- ONLY use the top if-block and remove the second - which is the same - ! except the ordering of the if/do blocks - - if (use_cndv .or. use_crop) then - if (annsum_counter(filter_soilc(1)) >= get_days_per_year() * secspday) then ! new (slevis) - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! update annual plant ndemand accumulator - annsum_potential_gpp(p) = tempsum_potential_gpp(p) - tempsum_potential_gpp(p) = 0._r8 - - ! update annual total N retranslocation accumulator - annmax_retransn(p) = tempmax_retransn(p) - tempmax_retransn(p) = 0._r8 - - ! update annual average 2m air temperature accumulator - annavg_t2m(p) = tempavg_t2m(p) - tempavg_t2m(p) = 0._r8 - - ! update annual NPP accumulator, convert to annual total - annsum_npp(p) = tempsum_npp(p) * dt - tempsum_npp(p) = 0._r8 - - if (use_cndv) then - ! update annual litfall accumulator, convert to annual total - annsum_litfall(p) = tempsum_litfall(p) * dt - tempsum_litfall(p) = 0._r8 - end if - end do - ! use p2c routine to get selected column-average pft-level fluxes and states - call p2c(num_soilc, filter_soilc, annsum_npp, cannsum_npp) - call p2c(num_soilc, filter_soilc, annavg_t2m, cannavg_t2m) - end if - else - do fp = 1,num_soilp - p = filter_soilp(fp) - ! In the future -- REMOVE this code and use the equivalent code above always - c = pcolumn(p) ! old (slevis) - if (annsum_counter(c) >= get_days_per_year() * secspday) then ! old (slevis) - ! update annual plant ndemand accumulator - annsum_potential_gpp(p) = tempsum_potential_gpp(p) - tempsum_potential_gpp(p) = 0._r8 - - ! update annual total N retranslocation accumulator - annmax_retransn(p) = tempmax_retransn(p) - tempmax_retransn(p) = 0._r8 - - ! update annual average 2m air temperature accumulator - annavg_t2m(p) = tempavg_t2m(p) - tempavg_t2m(p) = 0._r8 - - ! update annual NPP accumulator, convert to annual total - annsum_npp(p) = tempsum_npp(p) * dt - tempsum_npp(p) = 0._r8 - - if (use_cndv) then - ! update annual litfall accumulator, convert to annual total - annsum_litfall(p) = tempsum_litfall(p) * dt - tempsum_litfall(p) = 0._r8 - end if - end if ! old (slevis) - end do - ! use p2c routine to get selected column-average pft-level fluxes and states - call p2c(num_soilc, filter_soilc, annsum_npp, cannsum_npp) - call p2c(num_soilc, filter_soilc, annavg_t2m, cannavg_t2m) - end if - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - if (annsum_counter(c) >= get_days_per_year() * secspday) annsum_counter(c) = 0._r8 - end do - -end subroutine CNAnnualUpdate -!----------------------------------------------------------------------- - -end module CNAnnualUpdateMod diff --git a/src_clm40/biogeochem/CNBalanceCheckMod.F90 b/src_clm40/biogeochem/CNBalanceCheckMod.F90 deleted file mode 100644 index 09c66dd156..0000000000 --- a/src_clm40/biogeochem/CNBalanceCheckMod.F90 +++ /dev/null @@ -1,396 +0,0 @@ -module CNBalanceCheckMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNBalanceCheckMod -! -! !DESCRIPTION: -! Module for carbon mass balance checking. -! -! !USES: - use abortutils , only: endrun - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varctl , only: iulog - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: BeginCBalance - public :: BeginNBalance - public :: CBalanceCheck - public :: NBalanceCheck -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BeginCBalance -! -! !INTERFACE: -subroutine BeginCBalance(lbc, ubc, num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, calculate the beginning carbon balance for mass -! conservation checks. -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 2/4/05: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool -! -! local pointers to implicit out arrays - real(r8), pointer :: col_begcb(:) ! carbon mass, beginning of time step (gC/m**2) -! -! !OTHER LOCAL VARIABLES: - integer :: c ! indices - integer :: fc ! lake filter indices -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - col_begcb => ccbal%begcb - totcolc => ccs%totcolc - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate beginning column-level carbon balance, - ! for mass conservation check - - col_begcb(c) = totcolc(c) - - end do ! end of columns loop - - -end subroutine BeginCBalance -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BeginNBalance -! -! !INTERFACE: -subroutine BeginNBalance(lbc, ubc, num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, calculate the beginning nitrogen balance for mass -! conservation checks. -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 2/4/05: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: totcoln(:) ! (gN/m2) total column nitrogen, incl veg -! -! local pointers to implicit out arrays - real(r8), pointer :: col_begnb(:) ! nitrogen mass, beginning of time step (gN/m**2) -! -! !OTHER LOCAL VARIABLES: - integer :: c ! indices - integer :: fc ! lake filter indices -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - col_begnb => cnbal%begnb - totcoln => cns%totcoln - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate beginning column-level nitrogen balance, - ! for mass conservation check - - col_begnb(c) = totcoln(c) - - end do ! end of columns loop - -end subroutine BeginNBalance -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CBalanceCheck -! -! !INTERFACE: -subroutine CBalanceCheck(lbc, ubc, num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, perform carbon mass conservation check for column and pft -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 12/9/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arrays - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool - real(r8), pointer :: gpp(:) ! (gC/m2/s) gross primary production - real(r8), pointer :: er(:) ! (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - real(r8), pointer :: col_fire_closs(:) ! (gC/m2/s) total column-level fire C loss - real(r8), pointer :: col_hrv_xsmrpool_to_atm(:) ! excess MR pool harvest mortality (gC/m2/s) - real(r8), pointer :: dwt_closs(:) ! (gC/m2/s) total carbon loss from product pools and conversion - real(r8), pointer :: product_closs(:) ! (gC/m2/s) total wood product carbon loss -! -! local pointers to implicit out arrays - real(r8), pointer :: col_cinputs(:) ! (gC/m2/s) total column-level carbon inputs (for balance check) - real(r8), pointer :: col_coutputs(:) ! (gC/m2/s) total column-level carbon outputs (for balance check) - real(r8), pointer :: col_begcb(:) ! carbon mass, beginning of time step (gC/m**2) - real(r8), pointer :: col_endcb(:) ! carbon mass, end of time step (gC/m**2) - real(r8), pointer :: col_errcb(:) ! carbon balance error for the timestep (gC/m**2) -! -! !OTHER LOCAL VARIABLES: - integer :: c,err_index ! indices - integer :: fc ! lake filter indices - logical :: err_found ! error flag - real(r8):: dt ! radiation time step (seconds) -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers to column-level arrays - totcolc => ccs%totcolc - gpp => pcf_a%gpp - er => ccf%er - col_fire_closs => ccf%col_fire_closs - col_hrv_xsmrpool_to_atm => pcf_a%hrv_xsmrpool_to_atm - dwt_closs => ccf%dwt_closs - product_closs => ccf%product_closs - - col_cinputs => ccf%col_cinputs - col_coutputs => ccf%col_coutputs - col_begcb => ccbal%begcb - col_endcb => ccbal%endcb - col_errcb => ccbal%errcb - - ! set time steps - dt = real( get_step_size(), r8 ) - - err_found = .false. - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate the total column-level carbon storage, for mass conservation check - - col_endcb(c) = totcolc(c) - - ! calculate total column-level inputs - - col_cinputs(c) = gpp(c) - - ! calculate total column-level outputs - ! er = ar + hr, col_fire_closs includes pft-level fire losses - - col_coutputs(c) = er(c) + col_fire_closs(c) + dwt_closs(c) + product_closs(c) + col_hrv_xsmrpool_to_atm(c) - - ! calculate the total column-level carbon balance error for this time step - - col_errcb(c) = (col_cinputs(c) - col_coutputs(c))*dt - & - (col_endcb(c) - col_begcb(c)) - - ! check for significant errors - if (abs(col_errcb(c)) > 1e-8_r8) then - err_found = .true. - err_index = c - end if - - end do ! end of columns loop - - if (err_found) then - c = err_index - write(iulog,*)'column cbalance error = ', col_errcb(c), c - write(iulog,*)'begcb = ',col_begcb(c) - write(iulog,*)'endcb = ',col_endcb(c) - write(iulog,*)'delta store = ',col_endcb(c)-col_begcb(c) - write(iulog,*)'input mass = ',col_cinputs(c)*dt - write(iulog,*)'output mass = ',col_coutputs(c)*dt - write(iulog,*)'net flux = ',(col_cinputs(c)-col_coutputs(c))*dt - write(iulog,*)'nee = ',ccf%nee(c) * dt - write(iulog,*)'gpp = ',gpp(c) * dt - write(iulog,*)'er = ',er(c) * dt - write(iulog,*)'col_fire_closs = ',col_fire_closs(c) * dt - write(iulog,*)'col_hrv_xsmrpool_to_atm = ',col_hrv_xsmrpool_to_atm(c) * dt - write(iulog,*)'dwt_closs = ',dwt_closs(c) * dt - write(iulog,*)'product_closs = ',product_closs(c) * dt - call endrun - end if - - -end subroutine CBalanceCheck -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NBalanceCheck -! -! !INTERFACE: -subroutine NBalanceCheck(lbc, ubc, num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, perform nitrogen mass conservation check -! for column and pft -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 12/9/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arrays - real(r8), pointer :: totcoln(:) ! (gN/m2) total column nitrogen, incl veg - real(r8), pointer :: ndep_to_sminn(:) ! atmospheric N deposition to soil mineral N (gN/m2/s) - real(r8), pointer :: nfix_to_sminn(:) ! symbiotic/asymbiotic N fixation to soil mineral N (gN/m2/s) - real(r8), pointer :: supplement_to_sminn(:) ! supplemental N supply (gN/m2/s) - real(r8), pointer :: denit(:) ! total rate of denitrification (gN/m2/s) - real(r8), pointer :: sminn_leached(:) ! soil mineral N pool loss to leaching (gN/m2/s) - real(r8), pointer :: col_fire_nloss(:) ! total column-level fire N loss (gN/m2/s) - real(r8), pointer :: dwt_nloss(:) ! (gN/m2/s) total nitrogen loss from product pools and conversion - real(r8), pointer :: product_nloss(:) ! (gN/m2/s) total wood product nitrogen loss -! -! local pointers to implicit in/out arrays -! -! local pointers to implicit out arrays - real(r8), pointer :: col_ninputs(:) ! column-level N inputs (gN/m2/s) - real(r8), pointer :: col_noutputs(:) ! column-level N outputs (gN/m2/s) - real(r8), pointer :: col_begnb(:) ! nitrogen mass, beginning of time step (gN/m**2) - real(r8), pointer :: col_endnb(:) ! nitrogen mass, end of time step (gN/m**2) - real(r8), pointer :: col_errnb(:) ! nitrogen balance error for the timestep (gN/m**2) -! -! !OTHER LOCAL VARIABLES: - integer :: c,err_index ! indices - integer :: fc ! lake filter indices - logical :: err_found ! error flag - real(r8):: dt ! radiation time step (seconds) -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to column-level arrays - - totcoln => cns%totcoln - ndep_to_sminn => cnf%ndep_to_sminn - nfix_to_sminn => cnf%nfix_to_sminn - supplement_to_sminn => cnf%supplement_to_sminn - denit => cnf%denit - sminn_leached => cnf%sminn_leached - col_fire_nloss => cnf%col_fire_nloss - dwt_nloss => cnf%dwt_nloss - product_nloss => cnf%product_nloss - - col_ninputs => cnf%col_ninputs - col_noutputs => cnf%col_noutputs - col_begnb => cnbal%begnb - col_endnb => cnbal%endnb - col_errnb => cnbal%errnb - - ! set time steps - dt = real( get_step_size(), r8 ) - - err_found = .false. - ! column loop - do fc = 1,num_soilc - c=filter_soilc(fc) - - ! calculate the total column-level nitrogen storage, for mass conservation check - - col_endnb(c) = totcoln(c) - - ! calculate total column-level inputs - - col_ninputs(c) = ndep_to_sminn(c) + nfix_to_sminn(c) + supplement_to_sminn(c) - - ! calculate total column-level outputs - - col_noutputs(c) = denit(c) + sminn_leached(c) + col_fire_nloss(c) + dwt_nloss(c) + product_nloss(c) - - ! calculate the total column-level nitrogen balance error for this time step - - col_errnb(c) = (col_ninputs(c) - col_noutputs(c))*dt - & - (col_endnb(c) - col_begnb(c)) - - if (abs(col_errnb(c)) > 1e-8_r8) then - err_found = .true. - err_index = c - end if - - end do ! end of columns loop - - if (err_found) then - c = err_index - write(iulog,*)'column nbalance error = ', col_errnb(c), c - write(iulog,*)'begnb = ',col_begnb(c) - write(iulog,*)'endnb = ',col_endnb(c) - write(iulog,*)'delta store = ',col_endnb(c)-col_begnb(c) - write(iulog,*)'input mass = ',col_ninputs(c)*dt - write(iulog,*)'output mass = ',col_noutputs(c)*dt - write(iulog,*)'net flux = ',(col_ninputs(c)-col_noutputs(c))*dt - call endrun - end if - -end subroutine NBalanceCheck -!----------------------------------------------------------------------- - -end module CNBalanceCheckMod diff --git a/src_clm40/biogeochem/CNC13FluxMod.F90 b/src_clm40/biogeochem/CNC13FluxMod.F90 deleted file mode 100644 index be20383408..0000000000 --- a/src_clm40/biogeochem/CNC13FluxMod.F90 +++ /dev/null @@ -1,1448 +0,0 @@ -module CNC13FluxMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: C13FluxMod -! -! !DESCRIPTION: -! Module for 13-carbon flux variable update, non-mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! -! !PUBLIC MEMBER FUNCTIONS: - public:: C13Flux1 - public:: C13Flux2 - public:: C13Flux2h - public:: C13Flux3 - private:: CNC13LitterToColumn - private:: CNC13GapPftToColumn - private:: CNC13HarvestPftToColumn - private:: C13FluxCalc -! -! !REVISION HISTORY: -! 4/21/2005: Created by Peter Thornton and Neil Suits -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13Flux1 -! -! !INTERFACE: -subroutine C13Flux1(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, set the 13-carbon flux -! variables (except for gap-phase mortality and fire fluxes) -! -! !USES: - use clmtype - use clm_varctl, only : use_c13 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! -! !LOCAL VARIABLES: -! !OTHER LOCAL VARIABLES: - type(pft_type), pointer :: p - type(column_type), pointer :: c - integer :: fp,pi -! -!EOP -!----------------------------------------------------------------------- - - if (.not. use_c13) then - RETURN - end if - - ! set local pointers - p => pft - c => col - - ! pft-level non-mortality fluxes - - call C13FluxCalc(pc13f%leafc_xfer_to_leafc, pcf%leafc_xfer_to_leafc, & - pc13s%leafc_xfer, pcs%leafc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%frootc_xfer_to_frootc, pcf%frootc_xfer_to_frootc, & - pc13s%frootc_xfer, pcs%frootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livestemc_xfer_to_livestemc, pcf%livestemc_xfer_to_livestemc, & - pc13s%livestemc_xfer, pcs%livestemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%deadstemc_xfer_to_deadstemc, pcf%deadstemc_xfer_to_deadstemc, & - pc13s%deadstemc_xfer, pcs%deadstemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livecrootc_xfer_to_livecrootc, pcf%livecrootc_xfer_to_livecrootc, & - pc13s%livecrootc_xfer, pcs%livecrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%deadcrootc_xfer_to_deadcrootc, pcf%deadcrootc_xfer_to_deadcrootc, & - pc13s%deadcrootc_xfer, pcs%deadcrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%leafc_to_litter, pcf%leafc_to_litter, & - pc13s%leafc, pcs%leafc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%frootc_to_litter, pcf%frootc_to_litter, & - pc13s%frootc, pcs%frootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livestemc_to_deadstemc, pcf%livestemc_to_deadstemc, & - pc13s%livestemc, pcs%livestemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livecrootc_to_deadcrootc, pcf%livecrootc_to_deadcrootc, & - pc13s%livecrootc, pcs%livecrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%leaf_curmr, pcf%leaf_curmr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%froot_curmr, pcf%froot_curmr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livestem_curmr, pcf%livestem_curmr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livecroot_curmr, pcf%livecroot_curmr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%leaf_xsmr, pcf%leaf_xsmr, & - pc13s%totvegc, pcs%totvegc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%froot_xsmr, pcf%froot_xsmr, & - pc13s%totvegc, pcs%totvegc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livestem_xsmr, pcf%livestem_xsmr, & - pc13s%totvegc, pcs%totvegc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livecroot_xsmr, pcf%livecroot_xsmr, & - pc13s%totvegc, pcs%totvegc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_xsmrpool, pcf%cpool_to_xsmrpool, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_leafc, pcf%cpool_to_leafc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_leafc_storage, pcf%cpool_to_leafc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_frootc, pcf%cpool_to_frootc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_frootc_storage, pcf%cpool_to_frootc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_livestemc, pcf%cpool_to_livestemc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_livestemc_storage, pcf%cpool_to_livestemc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_deadstemc, pcf%cpool_to_deadstemc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_deadstemc_storage, pcf%cpool_to_deadstemc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_livecrootc, pcf%cpool_to_livecrootc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_livecrootc_storage, pcf%cpool_to_livecrootc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_deadcrootc, pcf%cpool_to_deadcrootc, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_deadcrootc_storage, pcf%cpool_to_deadcrootc_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_leaf_gr, pcf%cpool_leaf_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_froot_gr, pcf%cpool_froot_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_livestem_gr, pcf%cpool_livestem_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_deadstem_gr, pcf%cpool_deadstem_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_livecroot_gr, pcf%cpool_livecroot_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_deadcroot_gr, pcf%cpool_deadcroot_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_leaf_storage_gr, pcf%cpool_leaf_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_froot_storage_gr, pcf%cpool_froot_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_livestem_storage_gr, pcf%cpool_livestem_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_deadstem_storage_gr, pcf%cpool_deadstem_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_livecroot_storage_gr, pcf%cpool_livecroot_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_deadcroot_storage_gr, pcf%cpool_deadcroot_storage_gr, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%cpool_to_gresp_storage, pcf%cpool_to_gresp_storage, & - pc13s%cpool, pcs%cpool, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_leaf_gr, pcf%transfer_leaf_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_froot_gr, pcf%transfer_froot_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_livestem_gr, pcf%transfer_livestem_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_deadstem_gr, pcf%transfer_deadstem_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_livecroot_gr, pcf%transfer_livecroot_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%transfer_deadcroot_gr, pcf%transfer_deadcroot_gr, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%leafc_storage_to_xfer, pcf%leafc_storage_to_xfer, & - pc13s%leafc_storage, pcs%leafc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%frootc_storage_to_xfer, pcf%frootc_storage_to_xfer, & - pc13s%frootc_storage, pcs%frootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livestemc_storage_to_xfer, pcf%livestemc_storage_to_xfer, & - pc13s%livestemc_storage, pcs%livestemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%deadstemc_storage_to_xfer, pcf%deadstemc_storage_to_xfer, & - pc13s%deadstemc_storage, pcs%deadstemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%livecrootc_storage_to_xfer, pcf%livecrootc_storage_to_xfer, & - pc13s%livecrootc_storage, pcs%livecrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%deadcrootc_storage_to_xfer, pcf%deadcrootc_storage_to_xfer, & - pc13s%deadcrootc_storage, pcs%deadcrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%gresp_storage_to_xfer, pcf%gresp_storage_to_xfer, & - pc13s%gresp_storage, pcs%gresp_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - ! call routine to shift pft-level litterfall fluxes to column, for isotopes - ! the non-isotope version of this routine is called in CNPhenologyMod.F90 - ! For later clean-up, it would be possible to generalize this function to operate on a single - ! pft-to-column flux. - - call CNC13LitterToColumn(num_soilc, filter_soilc) - - ! column-level non-mortality fluxes - - call C13FluxCalc(cc13f%cwdc_to_litr2c, ccf%cwdc_to_litr2c, & - cc13s%cwdc, ccs%cwdc, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%cwdc_to_litr3c, ccf%cwdc_to_litr3c, & - cc13s%cwdc, ccs%cwdc, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr1_hr, ccf%litr1_hr, & - cc13s%litr1c, ccs%litr1c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr1c_to_soil1c, ccf%litr1c_to_soil1c, & - cc13s%litr1c, ccs%litr1c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr2_hr, ccf%litr2_hr, & - cc13s%litr2c, ccs%litr2c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr2c_to_soil2c, ccf%litr2c_to_soil2c, & - cc13s%litr2c, ccs%litr2c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr3_hr, ccf%litr3_hr, & - cc13s%litr3c, ccs%litr3c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%litr3c_to_soil3c, ccf%litr3c_to_soil3c, & - cc13s%litr3c, ccs%litr3c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil1_hr, ccf%soil1_hr, & - cc13s%soil1c, ccs%soil1c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil1c_to_soil2c, ccf%soil1c_to_soil2c, & - cc13s%soil1c, ccs%soil1c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil2_hr, ccf%soil2_hr, & - cc13s%soil2c, ccs%soil2c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil2c_to_soil3c, ccf%soil2c_to_soil3c, & - cc13s%soil2c, ccs%soil2c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil3_hr, ccf%soil3_hr, & - cc13s%soil3c, ccs%soil3c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil3c_to_soil4c, ccf%soil3c_to_soil4c, & - cc13s%soil3c, ccs%soil3c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%soil4_hr, ccf%soil4_hr, & - cc13s%soil4c, ccs%soil4c, & - num_soilc, filter_soilc, 1._r8, 0) - - -! call C13FluxCalc(pc13f%fx, pcf%fx, & -! pc13s%sx, pcs%sx, & -! num_soilp, filter_soilp, 1._r8, 0) - -end subroutine C13Flux1 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13Flux2 -! -! !INTERFACE: -subroutine C13Flux2(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, set the 13-carbon fluxes for gap mortality -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! -! !LOCAL VARIABLES: -! !OTHER LOCAL VARIABLES: - type(pft_type), pointer :: p - type(column_type), pointer :: c - integer :: fp,pi -! -!EOP -!----------------------------------------------------------------------- - ! set local pointers - p => pft - c => col - - ! pft-level gap mortality fluxes - - call C13FluxCalc(pc13f%m_leafc_to_litter, pcf%m_leafc_to_litter, & - pc13s%leafc, pcs%leafc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_leafc_storage_to_litter, pcf%m_leafc_storage_to_litter, & - pc13s%leafc_storage, pcs%leafc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_leafc_xfer_to_litter, pcf%m_leafc_xfer_to_litter, & - pc13s%leafc_xfer, pcs%leafc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_to_litter, pcf%m_frootc_to_litter, & - pc13s%frootc, pcs%frootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_storage_to_litter, pcf%m_frootc_storage_to_litter, & - pc13s%frootc_storage, pcs%frootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_xfer_to_litter, pcf%m_frootc_xfer_to_litter, & - pc13s%frootc_xfer, pcs%frootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_to_litter, pcf%m_livestemc_to_litter, & - pc13s%livestemc, pcs%livestemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_storage_to_litter, pcf%m_livestemc_storage_to_litter, & - pc13s%livestemc_storage, pcs%livestemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_xfer_to_litter, pcf%m_livestemc_xfer_to_litter, & - pc13s%livestemc_xfer, pcs%livestemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_to_litter, pcf%m_deadstemc_to_litter, & - pc13s%deadstemc, pcs%deadstemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_storage_to_litter, pcf%m_deadstemc_storage_to_litter, & - pc13s%deadstemc_storage, pcs%deadstemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_xfer_to_litter, pcf%m_deadstemc_xfer_to_litter, & - pc13s%deadstemc_xfer, pcs%deadstemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_to_litter, pcf%m_livecrootc_to_litter, & - pc13s%livecrootc, pcs%livecrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_storage_to_litter, pcf%m_livecrootc_storage_to_litter, & - pc13s%livecrootc_storage, pcs%livecrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_xfer_to_litter, pcf%m_livecrootc_xfer_to_litter, & - pc13s%livecrootc_xfer, pcs%livecrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_to_litter, pcf%m_deadcrootc_to_litter, & - pc13s%deadcrootc, pcs%deadcrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_storage_to_litter, pcf%m_deadcrootc_storage_to_litter, & - pc13s%deadcrootc_storage, pcs%deadcrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_xfer_to_litter, pcf%m_deadcrootc_xfer_to_litter, & - pc13s%deadcrootc_xfer, pcs%deadcrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_gresp_storage_to_litter, pcf%m_gresp_storage_to_litter, & - pc13s%gresp_storage, pcs%gresp_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_gresp_xfer_to_litter, pcf%m_gresp_xfer_to_litter, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - ! call routine to shift pft-level gap mortality fluxes to column, for isotopes - ! the non-isotope version of this routine is in CNGapMortalityMod.F90. - - call CNC13GapPftToColumn(num_soilc, filter_soilc) - -end subroutine C13Flux2 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13Flux2h -! -! !INTERFACE: -subroutine C13Flux2h(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! set the 13-carbon fluxes for harvest mortality -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! -! !LOCAL VARIABLES: -! !OTHER LOCAL VARIABLES: - type(pft_type), pointer :: p - type(column_type), pointer :: c - integer :: fp,pi -! -!EOP -!----------------------------------------------------------------------- - ! set local pointers - p => pft - c => col - - ! pft-level gap mortality fluxes - - call C13FluxCalc(pc13f%hrv_leafc_to_litter, pcf%hrv_leafc_to_litter, & - pc13s%leafc, pcs%leafc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_leafc_storage_to_litter, pcf%hrv_leafc_storage_to_litter, & - pc13s%leafc_storage, pcs%leafc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_leafc_xfer_to_litter, pcf%hrv_leafc_xfer_to_litter, & - pc13s%leafc_xfer, pcs%leafc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_frootc_to_litter, pcf%hrv_frootc_to_litter, & - pc13s%frootc, pcs%frootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_frootc_storage_to_litter, pcf%hrv_frootc_storage_to_litter, & - pc13s%frootc_storage, pcs%frootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_frootc_xfer_to_litter, pcf%hrv_frootc_xfer_to_litter, & - pc13s%frootc_xfer, pcs%frootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livestemc_to_litter, pcf%hrv_livestemc_to_litter, & - pc13s%livestemc, pcs%livestemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livestemc_storage_to_litter, pcf%hrv_livestemc_storage_to_litter, & - pc13s%livestemc_storage, pcs%livestemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livestemc_xfer_to_litter, pcf%hrv_livestemc_xfer_to_litter, & - pc13s%livestemc_xfer, pcs%livestemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadstemc_to_prod10c, pcf%hrv_deadstemc_to_prod10c, & - pc13s%deadstemc, pcs%deadstemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadstemc_to_prod100c, pcf%hrv_deadstemc_to_prod100c, & - pc13s%deadstemc, pcs%deadstemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadstemc_storage_to_litter, pcf%hrv_deadstemc_storage_to_litter, & - pc13s%deadstemc_storage, pcs%deadstemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadstemc_xfer_to_litter, pcf%hrv_deadstemc_xfer_to_litter, & - pc13s%deadstemc_xfer, pcs%deadstemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livecrootc_to_litter, pcf%hrv_livecrootc_to_litter, & - pc13s%livecrootc, pcs%livecrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livecrootc_storage_to_litter, pcf%hrv_livecrootc_storage_to_litter, & - pc13s%livecrootc_storage, pcs%livecrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_livecrootc_xfer_to_litter, pcf%hrv_livecrootc_xfer_to_litter, & - pc13s%livecrootc_xfer, pcs%livecrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadcrootc_to_litter, pcf%hrv_deadcrootc_to_litter, & - pc13s%deadcrootc, pcs%deadcrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadcrootc_storage_to_litter, pcf%hrv_deadcrootc_storage_to_litter, & - pc13s%deadcrootc_storage, pcs%deadcrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_deadcrootc_xfer_to_litter, pcf%hrv_deadcrootc_xfer_to_litter, & - pc13s%deadcrootc_xfer, pcs%deadcrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_gresp_storage_to_litter, pcf%hrv_gresp_storage_to_litter, & - pc13s%gresp_storage, pcs%gresp_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_gresp_xfer_to_litter, pcf%hrv_gresp_xfer_to_litter, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%hrv_xsmrpool_to_atm, pcf%hrv_xsmrpool_to_atm, & - pc13s%totvegc, pcs%totvegc, & - num_soilp, filter_soilp, 1._r8, 0) - - ! call routine to shift pft-level gap mortality fluxes to column, for isotopes - ! the non-isotope version of this routine is in CNGapMortalityMod.F90. - - call CNC13HarvestPftToColumn(num_soilc, filter_soilc) - -end subroutine C13Flux2h -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13Flux3 -! -! !INTERFACE: -subroutine C13Flux3(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, set the 13-carbon fluxes for fire mortality -! -! !USES: - use clmtype - use pft2colMod, only: p2c -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! -! !LOCAL VARIABLES: -! !OTHER LOCAL VARIABLES: - type(pft_type), pointer :: p - type(column_type), pointer :: c - integer :: fp,pi - real(r8), pointer :: ptrp(:) ! pointer to input pft array - real(r8), pointer :: ptrc(:) ! pointer to output column array -! -!EOP -!----------------------------------------------------------------------- - ! set local pointers - p => pft - c => col - - ! pft-level fire mortality fluxes - - call C13FluxCalc(pc13f%m_leafc_to_fire, pcf%m_leafc_to_fire, & - pc13s%leafc, pcs%leafc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_leafc_storage_to_fire, pcf%m_leafc_storage_to_fire, & - pc13s%leafc_storage, pcs%leafc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_leafc_xfer_to_fire, pcf%m_leafc_xfer_to_fire, & - pc13s%leafc_xfer, pcs%leafc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_to_fire, pcf%m_frootc_to_fire, & - pc13s%frootc, pcs%frootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_storage_to_fire, pcf%m_frootc_storage_to_fire, & - pc13s%frootc_storage, pcs%frootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_frootc_xfer_to_fire, pcf%m_frootc_xfer_to_fire, & - pc13s%frootc_xfer, pcs%frootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_to_fire, pcf%m_livestemc_to_fire, & - pc13s%livestemc, pcs%livestemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_storage_to_fire, pcf%m_livestemc_storage_to_fire, & - pc13s%livestemc_storage, pcs%livestemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livestemc_xfer_to_fire, pcf%m_livestemc_xfer_to_fire, & - pc13s%livestemc_xfer, pcs%livestemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_to_fire, pcf%m_deadstemc_to_fire, & - pc13s%deadstemc, pcs%deadstemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_to_litter_fire, pcf%m_deadstemc_to_litter_fire, & - pc13s%deadstemc, pcs%deadstemc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_storage_to_fire, pcf%m_deadstemc_storage_to_fire, & - pc13s%deadstemc_storage, pcs%deadstemc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadstemc_xfer_to_fire, pcf%m_deadstemc_xfer_to_fire, & - pc13s%deadstemc_xfer, pcs%deadstemc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_to_fire, pcf%m_livecrootc_to_fire, & - pc13s%livecrootc, pcs%livecrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_storage_to_fire, pcf%m_livecrootc_storage_to_fire, & - pc13s%livecrootc_storage, pcs%livecrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_livecrootc_xfer_to_fire, pcf%m_livecrootc_xfer_to_fire, & - pc13s%livecrootc_xfer, pcs%livecrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_to_fire, pcf%m_deadcrootc_to_fire, & - pc13s%deadcrootc, pcs%deadcrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_to_litter_fire, pcf%m_deadcrootc_to_litter_fire, & - pc13s%deadcrootc, pcs%deadcrootc, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_storage_to_fire, pcf%m_deadcrootc_storage_to_fire, & - pc13s%deadcrootc_storage, pcs%deadcrootc_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_deadcrootc_xfer_to_fire, pcf%m_deadcrootc_xfer_to_fire, & - pc13s%deadcrootc_xfer, pcs%deadcrootc_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_gresp_storage_to_fire, pcf%m_gresp_storage_to_fire, & - pc13s%gresp_storage, pcs%gresp_storage, & - num_soilp, filter_soilp, 1._r8, 0) - - call C13FluxCalc(pc13f%m_gresp_xfer_to_fire, pcf%m_gresp_xfer_to_fire, & - pc13s%gresp_xfer, pcs%gresp_xfer, & - num_soilp, filter_soilp, 1._r8, 0) - - ! use routine p2c to calculate the column-level flux of deadstem and deadcrootc to - ! cwdc as the result of fire mortality. - call p2c(num_soilc, filter_soilc, pc13f%m_deadstemc_to_litter_fire, cc13f%m_deadstemc_to_cwdc_fire) - call p2c(num_soilc, filter_soilc, pc13f%m_deadcrootc_to_litter_fire, cc13f%m_deadcrootc_to_cwdc_fire) - - call C13FluxCalc(cc13f%m_litr1c_to_fire, ccf%m_litr1c_to_fire, & - cc13s%litr1c, ccs%litr1c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%m_litr2c_to_fire, ccf%m_litr2c_to_fire, & - cc13s%litr2c, ccs%litr2c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%m_litr3c_to_fire, ccf%m_litr3c_to_fire, & - cc13s%litr3c, ccs%litr3c, & - num_soilc, filter_soilc, 1._r8, 0) - - call C13FluxCalc(cc13f%m_cwdc_to_fire, ccf%m_cwdc_to_fire, & - cc13s%cwdc, ccs%cwdc, & - num_soilc, filter_soilc, 1._r8, 0) - -! call C13FluxCalc(pc13f%fx, pcf%fx, & -! pc13s%sx, pcs%sx, & -! num_soilc, filter_soilc, 1._r8, 0) - -end subroutine C13Flux3 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNC13LitterToColumn -! -! !INTERFACE: -subroutine CNC13LitterToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! called at the end of cn_phenology to gather all pft-level litterfall fluxes -! to the column level and assign them to the three litter pools -! -! !USES: - use clmtype - use clm_varpar, only : max_pft_per_col -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! weight (relative to column) for this pft (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: leafc_to_litr1c(:) - real(r8), pointer :: leafc_to_litr2c(:) - real(r8), pointer :: leafc_to_litr3c(:) - real(r8), pointer :: frootc_to_litr1c(:) - real(r8), pointer :: frootc_to_litr2c(:) - real(r8), pointer :: frootc_to_litr3c(:) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - leafc_to_litter => pc13f%leafc_to_litter - frootc_to_litter => pc13f%frootc_to_litter - npfts => col%npfts - pfti => col%pfti - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to derived type arrays (out) - leafc_to_litr1c => cc13f%leafc_to_litr1c - leafc_to_litr2c => cc13f%leafc_to_litr2c - leafc_to_litr3c => cc13f%leafc_to_litr3c - frootc_to_litr1c => cc13f%frootc_to_litr1c - frootc_to_litr2c => cc13f%frootc_to_litr2c - frootc_to_litr3c => cc13f%frootc_to_litr3c - - do pi = 1,max_pft_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - - if ( pi <= npfts(c) ) then - p = pfti(c) + pi - 1 - if (pwtgcell(p)>0._r8) then - - ! leaf litter carbon fluxes - leafc_to_litr1c(c) = leafc_to_litr1c(c) + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - leafc_to_litr2c(c) = leafc_to_litr2c(c) + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - leafc_to_litr3c(c) = leafc_to_litr3c(c) + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root litter carbon fluxes - frootc_to_litr1c(c) = frootc_to_litr1c(c) + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - frootc_to_litr2c(c) = frootc_to_litr2c(c) + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - frootc_to_litr3c(c) = frootc_to_litr3c(c) + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - end if - end if - - end do - - end do - -end subroutine CNC13LitterToColumn -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNC13GapPftToColumn -! -! !INTERFACE: -subroutine CNC13GapPftToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! gather all pft-level gap mortality fluxes -! to the column level and assign them to the three litter pools (+ cwd pool) -! -! !USES: - use clmtype - use clm_varpar, only : max_pft_per_col, maxpatch_pft -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! soil column filter -! -! !CALLED FROM: -! subroutine CNphenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! pft weight relative to column (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: m_leafc_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr2c(:) - real(r8), pointer :: m_leafc_to_litr3c(:) - real(r8), pointer :: m_frootc_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr2c(:) - real(r8), pointer :: m_frootc_to_litr3c(:) - real(r8), pointer :: m_livestemc_to_cwdc(:) - real(r8), pointer :: m_deadstemc_to_cwdc(:) - real(r8), pointer :: m_livecrootc_to_cwdc(:) - real(r8), pointer :: m_deadcrootc_to_cwdc(:) - real(r8), pointer :: m_leafc_storage_to_litr1c(:) - real(r8), pointer :: m_frootc_storage_to_litr1c(:) - real(r8), pointer :: m_livestemc_storage_to_litr1c(:) - real(r8), pointer :: m_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: m_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: m_gresp_storage_to_litr1c(:) - real(r8), pointer :: m_leafc_xfer_to_litr1c(:) - real(r8), pointer :: m_frootc_xfer_to_litr1c(:) - real(r8), pointer :: m_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: m_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_gresp_xfer_to_litr1c(:) -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p ! indices -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to column-level arrays - npfts => col%npfts - pfti => col%pfti - m_leafc_to_litr1c => cc13f%m_leafc_to_litr1c - m_leafc_to_litr2c => cc13f%m_leafc_to_litr2c - m_leafc_to_litr3c => cc13f%m_leafc_to_litr3c - m_frootc_to_litr1c => cc13f%m_frootc_to_litr1c - m_frootc_to_litr2c => cc13f%m_frootc_to_litr2c - m_frootc_to_litr3c => cc13f%m_frootc_to_litr3c - m_livestemc_to_cwdc => cc13f%m_livestemc_to_cwdc - m_deadstemc_to_cwdc => cc13f%m_deadstemc_to_cwdc - m_livecrootc_to_cwdc => cc13f%m_livecrootc_to_cwdc - m_deadcrootc_to_cwdc => cc13f%m_deadcrootc_to_cwdc - m_leafc_storage_to_litr1c => cc13f%m_leafc_storage_to_litr1c - m_frootc_storage_to_litr1c => cc13f%m_frootc_storage_to_litr1c - m_livestemc_storage_to_litr1c => cc13f%m_livestemc_storage_to_litr1c - m_deadstemc_storage_to_litr1c => cc13f%m_deadstemc_storage_to_litr1c - m_livecrootc_storage_to_litr1c => cc13f%m_livecrootc_storage_to_litr1c - m_deadcrootc_storage_to_litr1c => cc13f%m_deadcrootc_storage_to_litr1c - m_gresp_storage_to_litr1c => cc13f%m_gresp_storage_to_litr1c - m_leafc_xfer_to_litr1c => cc13f%m_leafc_xfer_to_litr1c - m_frootc_xfer_to_litr1c => cc13f%m_frootc_xfer_to_litr1c - m_livestemc_xfer_to_litr1c => cc13f%m_livestemc_xfer_to_litr1c - m_deadstemc_xfer_to_litr1c => cc13f%m_deadstemc_xfer_to_litr1c - m_livecrootc_xfer_to_litr1c => cc13f%m_livecrootc_xfer_to_litr1c - m_deadcrootc_xfer_to_litr1c => cc13f%m_deadcrootc_xfer_to_litr1c - m_gresp_xfer_to_litr1c => cc13f%m_gresp_xfer_to_litr1c - - ! assign local pointers to pft-level arrays - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - m_leafc_to_litter => pc13f%m_leafc_to_litter - m_frootc_to_litter => pc13f%m_frootc_to_litter - m_livestemc_to_litter => pc13f%m_livestemc_to_litter - m_deadstemc_to_litter => pc13f%m_deadstemc_to_litter - m_livecrootc_to_litter => pc13f%m_livecrootc_to_litter - m_deadcrootc_to_litter => pc13f%m_deadcrootc_to_litter - m_leafc_storage_to_litter => pc13f%m_leafc_storage_to_litter - m_frootc_storage_to_litter => pc13f%m_frootc_storage_to_litter - m_livestemc_storage_to_litter => pc13f%m_livestemc_storage_to_litter - m_deadstemc_storage_to_litter => pc13f%m_deadstemc_storage_to_litter - m_livecrootc_storage_to_litter => pc13f%m_livecrootc_storage_to_litter - m_deadcrootc_storage_to_litter => pc13f%m_deadcrootc_storage_to_litter - m_gresp_storage_to_litter => pc13f%m_gresp_storage_to_litter - m_leafc_xfer_to_litter => pc13f%m_leafc_xfer_to_litter - m_frootc_xfer_to_litter => pc13f%m_frootc_xfer_to_litter - m_livestemc_xfer_to_litter => pc13f%m_livestemc_xfer_to_litter - m_deadstemc_xfer_to_litter => pc13f%m_deadstemc_xfer_to_litter - m_livecrootc_xfer_to_litter => pc13f%m_livecrootc_xfer_to_litter - m_deadcrootc_xfer_to_litter => pc13f%m_deadcrootc_xfer_to_litter - m_gresp_xfer_to_litter => pc13f%m_gresp_xfer_to_litter - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - - if (pwtgcell(p)>0._r8) then - - ! leaf gap mortality carbon fluxes - m_leafc_to_litr1c(c) = m_leafc_to_litr1c(c) + & - m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - m_leafc_to_litr2c(c) = m_leafc_to_litr2c(c) + & - m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - m_leafc_to_litr3c(c) = m_leafc_to_litr3c(c) + & - m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root gap mortality carbon fluxes - m_frootc_to_litr1c(c) = m_frootc_to_litr1c(c) + & - m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - m_frootc_to_litr2c(c) = m_frootc_to_litr2c(c) + & - m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - m_frootc_to_litr3c(c) = m_frootc_to_litr3c(c) + & - m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood gap mortality carbon fluxes - m_livestemc_to_cwdc(c) = m_livestemc_to_cwdc(c) + & - m_livestemc_to_litter(p) * wtcol(p) - m_deadstemc_to_cwdc(c) = m_deadstemc_to_cwdc(c) + & - m_deadstemc_to_litter(p) * wtcol(p) - m_livecrootc_to_cwdc(c) = m_livecrootc_to_cwdc(c) + & - m_livecrootc_to_litter(p) * wtcol(p) - m_deadcrootc_to_cwdc(c) = m_deadcrootc_to_cwdc(c) + & - m_deadcrootc_to_litter(p) * wtcol(p) - - ! storage gap mortality carbon fluxes - m_leafc_storage_to_litr1c(c) = m_leafc_storage_to_litr1c(c) + & - m_leafc_storage_to_litter(p) * wtcol(p) - m_frootc_storage_to_litr1c(c) = m_frootc_storage_to_litr1c(c) + & - m_frootc_storage_to_litter(p) * wtcol(p) - m_livestemc_storage_to_litr1c(c) = m_livestemc_storage_to_litr1c(c) + & - m_livestemc_storage_to_litter(p) * wtcol(p) - m_deadstemc_storage_to_litr1c(c) = m_deadstemc_storage_to_litr1c(c) + & - m_deadstemc_storage_to_litter(p) * wtcol(p) - m_livecrootc_storage_to_litr1c(c) = m_livecrootc_storage_to_litr1c(c) + & - m_livecrootc_storage_to_litter(p) * wtcol(p) - m_deadcrootc_storage_to_litr1c(c) = m_deadcrootc_storage_to_litr1c(c) + & - m_deadcrootc_storage_to_litter(p) * wtcol(p) - m_gresp_storage_to_litr1c(c) = m_gresp_storage_to_litr1c(c) + & - m_gresp_storage_to_litter(p) * wtcol(p) - - ! transfer gap mortality carbon fluxes - m_leafc_xfer_to_litr1c(c) = m_leafc_xfer_to_litr1c(c) + & - m_leafc_xfer_to_litter(p) * wtcol(p) - m_frootc_xfer_to_litr1c(c) = m_frootc_xfer_to_litr1c(c) + & - m_frootc_xfer_to_litter(p) * wtcol(p) - m_livestemc_xfer_to_litr1c(c) = m_livestemc_xfer_to_litr1c(c) + & - m_livestemc_xfer_to_litter(p) * wtcol(p) - m_deadstemc_xfer_to_litr1c(c) = m_deadstemc_xfer_to_litr1c(c) + & - m_deadstemc_xfer_to_litter(p) * wtcol(p) - m_livecrootc_xfer_to_litr1c(c) = m_livecrootc_xfer_to_litr1c(c) + & - m_livecrootc_xfer_to_litter(p) * wtcol(p) - m_deadcrootc_xfer_to_litr1c(c) = m_deadcrootc_xfer_to_litr1c(c) + & - m_deadcrootc_xfer_to_litter(p) * wtcol(p) - m_gresp_xfer_to_litr1c(c) = m_gresp_xfer_to_litr1c(c) + & - m_gresp_xfer_to_litter(p) * wtcol(p) - - end if - end if - - end do - - end do - -end subroutine CNC13GapPftToColumn -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNC13HarvestPftToColumn -! -! !INTERFACE: -subroutine CNC13HarvestPftToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! gather all pft-level harvest mortality fluxes -! to the column level and assign them to the litter, cwd, and wood product pools -! -! !USES: - use clmtype - use clm_varpar, only : max_pft_per_col, maxpatch_pft -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! soil column filter -! -! !CALLED FROM: -! subroutine CNphenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! pft weight relative to column (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: phrv_deadstemc_to_prod10c(:) - real(r8), pointer :: phrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: hrv_leafc_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr2c(:) - real(r8), pointer :: hrv_leafc_to_litr3c(:) - real(r8), pointer :: hrv_frootc_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr2c(:) - real(r8), pointer :: hrv_frootc_to_litr3c(:) - real(r8), pointer :: hrv_livestemc_to_cwdc(:) - real(r8), pointer :: chrv_deadstemc_to_prod10c(:) - real(r8), pointer :: chrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_livecrootc_to_cwdc(:) - real(r8), pointer :: hrv_deadcrootc_to_cwdc(:) - real(r8), pointer :: hrv_leafc_storage_to_litr1c(:) - real(r8), pointer :: hrv_frootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_gresp_storage_to_litr1c(:) - real(r8), pointer :: hrv_leafc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_frootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_gresp_xfer_to_litr1c(:) -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p ! indices -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to column-level arrays - npfts => col%npfts - pfti => col%pfti - hrv_leafc_to_litr1c => cc13f%hrv_leafc_to_litr1c - hrv_leafc_to_litr2c => cc13f%hrv_leafc_to_litr2c - hrv_leafc_to_litr3c => cc13f%hrv_leafc_to_litr3c - hrv_frootc_to_litr1c => cc13f%hrv_frootc_to_litr1c - hrv_frootc_to_litr2c => cc13f%hrv_frootc_to_litr2c - hrv_frootc_to_litr3c => cc13f%hrv_frootc_to_litr3c - hrv_livestemc_to_cwdc => cc13f%hrv_livestemc_to_cwdc - chrv_deadstemc_to_prod10c => cc13f%hrv_deadstemc_to_prod10c - chrv_deadstemc_to_prod100c => cc13f%hrv_deadstemc_to_prod100c - hrv_livecrootc_to_cwdc => cc13f%hrv_livecrootc_to_cwdc - hrv_deadcrootc_to_cwdc => cc13f%hrv_deadcrootc_to_cwdc - hrv_leafc_storage_to_litr1c => cc13f%hrv_leafc_storage_to_litr1c - hrv_frootc_storage_to_litr1c => cc13f%hrv_frootc_storage_to_litr1c - hrv_livestemc_storage_to_litr1c => cc13f%hrv_livestemc_storage_to_litr1c - hrv_deadstemc_storage_to_litr1c => cc13f%hrv_deadstemc_storage_to_litr1c - hrv_livecrootc_storage_to_litr1c => cc13f%hrv_livecrootc_storage_to_litr1c - hrv_deadcrootc_storage_to_litr1c => cc13f%hrv_deadcrootc_storage_to_litr1c - hrv_gresp_storage_to_litr1c => cc13f%hrv_gresp_storage_to_litr1c - hrv_leafc_xfer_to_litr1c => cc13f%hrv_leafc_xfer_to_litr1c - hrv_frootc_xfer_to_litr1c => cc13f%hrv_frootc_xfer_to_litr1c - hrv_livestemc_xfer_to_litr1c => cc13f%hrv_livestemc_xfer_to_litr1c - hrv_deadstemc_xfer_to_litr1c => cc13f%hrv_deadstemc_xfer_to_litr1c - hrv_livecrootc_xfer_to_litr1c => cc13f%hrv_livecrootc_xfer_to_litr1c - hrv_deadcrootc_xfer_to_litr1c => cc13f%hrv_deadcrootc_xfer_to_litr1c - hrv_gresp_xfer_to_litr1c => cc13f%hrv_gresp_xfer_to_litr1c - - ! assign local pointers to pft-level arrays - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - hrv_leafc_to_litter => pc13f%hrv_leafc_to_litter - hrv_frootc_to_litter => pc13f%hrv_frootc_to_litter - hrv_livestemc_to_litter => pc13f%hrv_livestemc_to_litter - phrv_deadstemc_to_prod10c => pc13f%hrv_deadstemc_to_prod10c - phrv_deadstemc_to_prod100c => pc13f%hrv_deadstemc_to_prod100c - hrv_livecrootc_to_litter => pc13f%hrv_livecrootc_to_litter - hrv_deadcrootc_to_litter => pc13f%hrv_deadcrootc_to_litter - hrv_leafc_storage_to_litter => pc13f%hrv_leafc_storage_to_litter - hrv_frootc_storage_to_litter => pc13f%hrv_frootc_storage_to_litter - hrv_livestemc_storage_to_litter => pc13f%hrv_livestemc_storage_to_litter - hrv_deadstemc_storage_to_litter => pc13f%hrv_deadstemc_storage_to_litter - hrv_livecrootc_storage_to_litter => pc13f%hrv_livecrootc_storage_to_litter - hrv_deadcrootc_storage_to_litter => pc13f%hrv_deadcrootc_storage_to_litter - hrv_gresp_storage_to_litter => pc13f%hrv_gresp_storage_to_litter - hrv_leafc_xfer_to_litter => pc13f%hrv_leafc_xfer_to_litter - hrv_frootc_xfer_to_litter => pc13f%hrv_frootc_xfer_to_litter - hrv_livestemc_xfer_to_litter => pc13f%hrv_livestemc_xfer_to_litter - hrv_deadstemc_xfer_to_litter => pc13f%hrv_deadstemc_xfer_to_litter - hrv_livecrootc_xfer_to_litter => pc13f%hrv_livecrootc_xfer_to_litter - hrv_deadcrootc_xfer_to_litter => pc13f%hrv_deadcrootc_xfer_to_litter - hrv_gresp_xfer_to_litter => pc13f%hrv_gresp_xfer_to_litter - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - - if (pwtgcell(p)>0._r8) then - - ! leaf harvest mortality carbon fluxes - hrv_leafc_to_litr1c(c) = hrv_leafc_to_litr1c(c) + & - hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - hrv_leafc_to_litr2c(c) = hrv_leafc_to_litr2c(c) + & - hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - hrv_leafc_to_litr3c(c) = hrv_leafc_to_litr3c(c) + & - hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root harvest mortality carbon fluxes - hrv_frootc_to_litr1c(c) = hrv_frootc_to_litr1c(c) + & - hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - hrv_frootc_to_litr2c(c) = hrv_frootc_to_litr2c(c) + & - hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - hrv_frootc_to_litr3c(c) = hrv_frootc_to_litr3c(c) + & - hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood harvest mortality carbon fluxes - hrv_livestemc_to_cwdc(c) = hrv_livestemc_to_cwdc(c) + & - hrv_livestemc_to_litter(p) * wtcol(p) - chrv_deadstemc_to_prod10c(c) = chrv_deadstemc_to_prod10c(c) + & - phrv_deadstemc_to_prod10c(p) * wtcol(p) - chrv_deadstemc_to_prod100c(c) = chrv_deadstemc_to_prod100c(c) + & - phrv_deadstemc_to_prod100c(p) * wtcol(p) - hrv_livecrootc_to_cwdc(c) = hrv_livecrootc_to_cwdc(c) + & - hrv_livecrootc_to_litter(p) * wtcol(p) - hrv_deadcrootc_to_cwdc(c) = hrv_deadcrootc_to_cwdc(c) + & - hrv_deadcrootc_to_litter(p) * wtcol(p) - - ! storage harvest mortality carbon fluxes - hrv_leafc_storage_to_litr1c(c) = hrv_leafc_storage_to_litr1c(c) + & - hrv_leafc_storage_to_litter(p) * wtcol(p) - hrv_frootc_storage_to_litr1c(c) = hrv_frootc_storage_to_litr1c(c) + & - hrv_frootc_storage_to_litter(p) * wtcol(p) - hrv_livestemc_storage_to_litr1c(c) = hrv_livestemc_storage_to_litr1c(c) + & - hrv_livestemc_storage_to_litter(p) * wtcol(p) - hrv_deadstemc_storage_to_litr1c(c) = hrv_deadstemc_storage_to_litr1c(c) + & - hrv_deadstemc_storage_to_litter(p) * wtcol(p) - hrv_livecrootc_storage_to_litr1c(c) = hrv_livecrootc_storage_to_litr1c(c) + & - hrv_livecrootc_storage_to_litter(p) * wtcol(p) - hrv_deadcrootc_storage_to_litr1c(c) = hrv_deadcrootc_storage_to_litr1c(c) + & - hrv_deadcrootc_storage_to_litter(p) * wtcol(p) - hrv_gresp_storage_to_litr1c(c) = hrv_gresp_storage_to_litr1c(c) + & - hrv_gresp_storage_to_litter(p) * wtcol(p) - - ! transfer harvest mortality carbon fluxes - hrv_leafc_xfer_to_litr1c(c) = hrv_leafc_xfer_to_litr1c(c) + & - hrv_leafc_xfer_to_litter(p) * wtcol(p) - hrv_frootc_xfer_to_litr1c(c) = hrv_frootc_xfer_to_litr1c(c) + & - hrv_frootc_xfer_to_litter(p) * wtcol(p) - hrv_livestemc_xfer_to_litr1c(c) = hrv_livestemc_xfer_to_litr1c(c) + & - hrv_livestemc_xfer_to_litter(p) * wtcol(p) - hrv_deadstemc_xfer_to_litr1c(c) = hrv_deadstemc_xfer_to_litr1c(c) + & - hrv_deadstemc_xfer_to_litter(p) * wtcol(p) - hrv_livecrootc_xfer_to_litr1c(c) = hrv_livecrootc_xfer_to_litr1c(c) + & - hrv_livecrootc_xfer_to_litter(p) * wtcol(p) - hrv_deadcrootc_xfer_to_litr1c(c) = hrv_deadcrootc_xfer_to_litr1c(c) + & - hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) - hrv_gresp_xfer_to_litr1c(c) = hrv_gresp_xfer_to_litr1c(c) + & - hrv_gresp_xfer_to_litter(p) * wtcol(p) - - end if - end if - - end do - - end do - -end subroutine CNC13HarvestPftToColumn -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13FluxCalc -! -! !INTERFACE: -subroutine C13FluxCalc(c13_flux, ctot_flux, c13_state, ctot_state, & - num, filter, frax, diag) -! -! !DESCRIPTION: -! On the radiation time step, set the 13-carbon flux -! variables (except for gap-phase mortality and fire fluxes) -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: c13_flux(:) !OUTPUT 13C flux - real(r8), pointer :: ctot_flux(:) !INPUT totC flux - real(r8), pointer :: c13_state(:) !INPUT 13C state, upstream pool - real(r8), pointer :: ctot_state(:) !INPUT totC state, upstream pool - real(r8), intent(in):: frax !fractionation factor (1 = no fractionation) - integer, intent(in) :: num ! number of filter members - integer, intent(in) :: filter(:) ! filter indices - integer, intent(in) :: diag !0=no diagnostics, 1=print diagnostics -! -! !CALLED FROM: -! subroutine C13Flux1 -! -! !REVISION HISTORY: -! -! !OTHER LOCAL VARIABLES: - integer :: i,f ! indices - real(r8) :: temp -! - ! loop over the supplied filter - do f = 1,num - i = filter(f) - if (ctot_state(i) /= 0._r8) then - c13_flux(i) = ctot_flux(i) * (c13_state(i)/ctot_state(i)) * frax - else - c13_flux(i) = 0._r8 - end if - - if (diag == 1) then - ! put diagnostic print statements here for 13C flux calculations - end if - end do -end subroutine C13FluxCalc -!----------------------------------------------------------------------- - -end module CNC13FluxMod - diff --git a/src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 b/src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 deleted file mode 100644 index c63a1ef17c..0000000000 --- a/src_clm40/biogeochem/CNC13StateUpdate1Mod.F90 +++ /dev/null @@ -1,591 +0,0 @@ -module CNC13StateUpdate1Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: C13StateUpdate1Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, non-mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! -! !PUBLIC MEMBER FUNCTIONS: - public:: C13StateUpdate1,C13StateUpdate0 -! -! !REVISION HISTORY: -! 4/21/2005: Created by Peter Thornton and Neil Suits - copied from -! CNCStateUpdate1 for C13 state variables. -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13StateUpdate0 -! -! !INTERFACE: -subroutine C13StateUpdate0(num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update cpool carbon state -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use clm_varctl, only : use_c13 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 7/1/05: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: psnshade_to_cpool(:) - real(r8), pointer :: psnsun_to_cpool(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - - if (.not. use_c13) then - RETURN - end if - - ! assign local pointers at the pft level - cpool => pc13s%cpool - psnshade_to_cpool => pc13f%psnshade_to_cpool - psnsun_to_cpool => pc13f%psnsun_to_cpool - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - ! gross photosynthesis fluxes - cpool(p) = cpool(p) + psnsun_to_cpool(p)*dt - cpool(p) = cpool(p) + psnshade_to_cpool(p)*dt - end do - -end subroutine C13StateUpdate0 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13StateUpdate1 -! -! !INTERFACE: -subroutine C13StateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables (except for gap-phase mortality and fire fluxes) -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! 12/5/03, Peter Thornton: Added livewood turnover fluxes -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays -! - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: cwdc_to_litr2c(:) - real(r8), pointer :: cwdc_to_litr3c(:) - real(r8), pointer :: frootc_to_litr1c(:) - real(r8), pointer :: frootc_to_litr2c(:) - real(r8), pointer :: frootc_to_litr3c(:) - real(r8), pointer :: leafc_to_litr1c(:) - real(r8), pointer :: leafc_to_litr2c(:) - real(r8), pointer :: leafc_to_litr3c(:) - real(r8), pointer :: litr1_hr(:) - real(r8), pointer :: litr1c_to_soil1c(:) - real(r8), pointer :: litr2_hr(:) - real(r8), pointer :: litr2c_to_soil2c(:) - real(r8), pointer :: litr3_hr(:) - real(r8), pointer :: litr3c_to_soil3c(:) - real(r8), pointer :: soil1_hr(:) - real(r8), pointer :: soil1c_to_soil2c(:) - real(r8), pointer :: soil2_hr(:) - real(r8), pointer :: soil2c_to_soil3c(:) - real(r8), pointer :: soil3_hr(:) - real(r8), pointer :: soil3c_to_soil4c(:) - real(r8), pointer :: soil4_hr(:) - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: cpool_to_xsmrpool(:) - real(r8), pointer :: cpool_to_deadcrootc(:) - real(r8), pointer :: cpool_to_deadcrootc_storage(:) - real(r8), pointer :: cpool_to_deadstemc(:) - real(r8), pointer :: cpool_to_deadstemc_storage(:) - real(r8), pointer :: cpool_to_frootc(:) - real(r8), pointer :: cpool_to_frootc_storage(:) - real(r8), pointer :: cpool_to_gresp_storage(:) - real(r8), pointer :: cpool_to_leafc(:) - real(r8), pointer :: cpool_to_leafc_storage(:) - real(r8), pointer :: cpool_to_livecrootc(:) - real(r8), pointer :: cpool_to_livecrootc_storage(:) - real(r8), pointer :: cpool_to_livestemc(:) - real(r8), pointer :: cpool_to_livestemc_storage(:) - real(r8), pointer :: deadcrootc_storage_to_xfer(:) - real(r8), pointer :: deadstemc_storage_to_xfer(:) - real(r8), pointer :: frootc_storage_to_xfer(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: gresp_storage_to_xfer(:) - real(r8), pointer :: leafc_storage_to_xfer(:) - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: livecrootc_storage_to_xfer(:) - real(r8), pointer :: livecrootc_to_deadcrootc(:) - real(r8), pointer :: livestemc_storage_to_xfer(:) - real(r8), pointer :: livestemc_to_deadstemc(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: livecroot_mr(:) - real(r8), pointer :: livestem_curmr(:) - real(r8), pointer :: froot_curmr(:) - real(r8), pointer :: leaf_curmr(:) - real(r8), pointer :: livecroot_curmr(:) - real(r8), pointer :: livestem_xsmr(:) - real(r8), pointer :: froot_xsmr(:) - real(r8), pointer :: leaf_xsmr(:) - real(r8), pointer :: livecroot_xsmr(:) - real(r8), pointer :: cpool_deadcroot_gr(:) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) - real(r8), pointer :: cpool_deadstem_gr(:) - real(r8), pointer :: cpool_deadstem_storage_gr(:) - real(r8), pointer :: cpool_froot_gr(:) - real(r8), pointer :: cpool_froot_storage_gr(:) - real(r8), pointer :: cpool_leaf_gr(:) - real(r8), pointer :: cpool_leaf_storage_gr(:) - real(r8), pointer :: cpool_livecroot_gr(:) - real(r8), pointer :: cpool_livecroot_storage_gr(:) - real(r8), pointer :: cpool_livestem_gr(:) - real(r8), pointer :: cpool_livestem_storage_gr(:) - real(r8), pointer :: transfer_deadcroot_gr(:) - real(r8), pointer :: transfer_deadstem_gr(:) - real(r8), pointer :: transfer_froot_gr(:) - real(r8), pointer :: transfer_leaf_gr(:) - real(r8), pointer :: transfer_livecroot_gr(:) - real(r8), pointer :: transfer_livestem_gr(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) execss maint resp C pool - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - -! local pointers for dynamic landcover fluxes and states - real(r8), pointer :: dwt_seedc_to_leaf(:) - real(r8), pointer :: dwt_seedc_to_deadstem(:) - real(r8), pointer :: dwt_frootc_to_litr1c(:) - real(r8), pointer :: dwt_frootc_to_litr2c(:) - real(r8), pointer :: dwt_frootc_to_litr3c(:) - real(r8), pointer :: dwt_livecrootc_to_cwdc(:) - real(r8), pointer :: dwt_deadcrootc_to_cwdc(:) - real(r8), pointer :: seedc(:) -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers - woody => pftcon%woody - - ! assign local pointers at the column level - cwdc_to_litr2c => cc13f%cwdc_to_litr2c - cwdc_to_litr3c => cc13f%cwdc_to_litr3c - frootc_to_litr1c => cc13f%frootc_to_litr1c - frootc_to_litr2c => cc13f%frootc_to_litr2c - frootc_to_litr3c => cc13f%frootc_to_litr3c - leafc_to_litr1c => cc13f%leafc_to_litr1c - leafc_to_litr2c => cc13f%leafc_to_litr2c - leafc_to_litr3c => cc13f%leafc_to_litr3c - litr1_hr => cc13f%litr1_hr - litr1c_to_soil1c => cc13f%litr1c_to_soil1c - litr2_hr => cc13f%litr2_hr - litr2c_to_soil2c => cc13f%litr2c_to_soil2c - litr3_hr => cc13f%litr3_hr - litr3c_to_soil3c => cc13f%litr3c_to_soil3c - soil1_hr => cc13f%soil1_hr - soil1c_to_soil2c => cc13f%soil1c_to_soil2c - soil2_hr => cc13f%soil2_hr - soil2c_to_soil3c => cc13f%soil2c_to_soil3c - soil3_hr => cc13f%soil3_hr - soil3c_to_soil4c => cc13f%soil3c_to_soil4c - soil4_hr => cc13f%soil4_hr - col_ctrunc => cc13s%col_ctrunc - cwdc => cc13s%cwdc - litr1c => cc13s%litr1c - litr2c => cc13s%litr2c - litr3c => cc13s%litr3c - soil1c => cc13s%soil1c - soil2c => cc13s%soil2c - soil3c => cc13s%soil3c - soil4c => cc13s%soil4c - ! new pointers for dynamic landcover - dwt_seedc_to_leaf => cc13f%dwt_seedc_to_leaf - dwt_seedc_to_deadstem => cc13f%dwt_seedc_to_deadstem - dwt_frootc_to_litr1c => cc13f%dwt_frootc_to_litr1c - dwt_frootc_to_litr2c => cc13f%dwt_frootc_to_litr2c - dwt_frootc_to_litr3c => cc13f%dwt_frootc_to_litr3c - dwt_livecrootc_to_cwdc => cc13f%dwt_livecrootc_to_cwdc - dwt_deadcrootc_to_cwdc => cc13f%dwt_deadcrootc_to_cwdc - seedc => cc13s%seedc - - ! assign local pointers at the pft level - ivt => pft%itype - cpool_deadcroot_gr => pc13f%cpool_deadcroot_gr - cpool_deadcroot_storage_gr => pc13f%cpool_deadcroot_storage_gr - cpool_deadstem_gr => pc13f%cpool_deadstem_gr - cpool_deadstem_storage_gr => pc13f%cpool_deadstem_storage_gr - cpool_froot_gr => pc13f%cpool_froot_gr - cpool_froot_storage_gr => pc13f%cpool_froot_storage_gr - cpool_leaf_gr => pc13f%cpool_leaf_gr - cpool_leaf_storage_gr => pc13f%cpool_leaf_storage_gr - cpool_livecroot_gr => pc13f%cpool_livecroot_gr - cpool_livecroot_storage_gr => pc13f%cpool_livecroot_storage_gr - cpool_livestem_gr => pc13f%cpool_livestem_gr - cpool_livestem_storage_gr => pc13f%cpool_livestem_storage_gr - cpool_to_xsmrpool => pc13f%cpool_to_xsmrpool - cpool_to_deadcrootc => pc13f%cpool_to_deadcrootc - cpool_to_deadcrootc_storage => pc13f%cpool_to_deadcrootc_storage - cpool_to_deadstemc => pc13f%cpool_to_deadstemc - cpool_to_deadstemc_storage => pc13f%cpool_to_deadstemc_storage - cpool_to_frootc => pc13f%cpool_to_frootc - cpool_to_frootc_storage => pc13f%cpool_to_frootc_storage - cpool_to_gresp_storage => pc13f%cpool_to_gresp_storage - cpool_to_leafc => pc13f%cpool_to_leafc - cpool_to_leafc_storage => pc13f%cpool_to_leafc_storage - cpool_to_livecrootc => pc13f%cpool_to_livecrootc - cpool_to_livecrootc_storage => pc13f%cpool_to_livecrootc_storage - cpool_to_livestemc => pc13f%cpool_to_livestemc - cpool_to_livestemc_storage => pc13f%cpool_to_livestemc_storage - deadcrootc_storage_to_xfer => pc13f%deadcrootc_storage_to_xfer - deadcrootc_xfer_to_deadcrootc => pc13f%deadcrootc_xfer_to_deadcrootc - deadstemc_storage_to_xfer => pc13f%deadstemc_storage_to_xfer - deadstemc_xfer_to_deadstemc => pc13f%deadstemc_xfer_to_deadstemc - froot_mr => pc13f%froot_mr - froot_curmr => pc13f%froot_curmr - froot_xsmr => pc13f%froot_xsmr - frootc_storage_to_xfer => pc13f%frootc_storage_to_xfer - frootc_to_litter => pc13f%frootc_to_litter - frootc_xfer_to_frootc => pc13f%frootc_xfer_to_frootc - gresp_storage_to_xfer => pc13f%gresp_storage_to_xfer - leaf_mr => pc13f%leaf_mr - leaf_curmr => pc13f%leaf_curmr - leaf_xsmr => pc13f%leaf_xsmr - leafc_storage_to_xfer => pc13f%leafc_storage_to_xfer - leafc_to_litter => pc13f%leafc_to_litter - leafc_xfer_to_leafc => pc13f%leafc_xfer_to_leafc - livecroot_mr => pc13f%livecroot_mr - livecroot_curmr => pc13f%livecroot_curmr - livecroot_xsmr => pc13f%livecroot_xsmr - livecrootc_storage_to_xfer => pc13f%livecrootc_storage_to_xfer - livecrootc_to_deadcrootc => pc13f%livecrootc_to_deadcrootc - livecrootc_xfer_to_livecrootc => pc13f%livecrootc_xfer_to_livecrootc - livestem_mr => pc13f%livestem_mr - livestem_curmr => pc13f%livestem_curmr - livestem_xsmr => pc13f%livestem_xsmr - livestemc_storage_to_xfer => pc13f%livestemc_storage_to_xfer - livestemc_to_deadstemc => pc13f%livestemc_to_deadstemc - livestemc_xfer_to_livestemc => pc13f%livestemc_xfer_to_livestemc - transfer_deadcroot_gr => pc13f%transfer_deadcroot_gr - transfer_deadstem_gr => pc13f%transfer_deadstem_gr - transfer_froot_gr => pc13f%transfer_froot_gr - transfer_leaf_gr => pc13f%transfer_leaf_gr - transfer_livecroot_gr => pc13f%transfer_livecroot_gr - transfer_livestem_gr => pc13f%transfer_livestem_gr - cpool => pc13s%cpool - xsmrpool => pc13s%xsmrpool - deadcrootc => pc13s%deadcrootc - deadcrootc_storage => pc13s%deadcrootc_storage - deadcrootc_xfer => pc13s%deadcrootc_xfer - deadstemc => pc13s%deadstemc - deadstemc_storage => pc13s%deadstemc_storage - deadstemc_xfer => pc13s%deadstemc_xfer - frootc => pc13s%frootc - frootc_storage => pc13s%frootc_storage - frootc_xfer => pc13s%frootc_xfer - gresp_storage => pc13s%gresp_storage - gresp_xfer => pc13s%gresp_xfer - leafc => pc13s%leafc - leafc_storage => pc13s%leafc_storage - leafc_xfer => pc13s%leafc_xfer - livecrootc => pc13s%livecrootc - livecrootc_storage => pc13s%livecrootc_storage - livecrootc_xfer => pc13s%livecrootc_xfer - livestemc => pc13s%livestemc - livestemc_storage => pc13s%livestemc_storage - livestemc_xfer => pc13s%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level fluxes - - ! plant to litter fluxes - ! leaf litter - litr1c(c) = litr1c(c) + leafc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + leafc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + leafc_to_litr3c(c)*dt - ! fine root litter - litr1c(c) = litr1c(c) + frootc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + frootc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + frootc_to_litr3c(c)*dt - - ! seeding fluxes, from dynamic landcover - seedc(c) = seedc(c) - dwt_seedc_to_leaf(c) * dt - seedc(c) = seedc(c) - dwt_seedc_to_deadstem(c) * dt - - ! fluxes into litter and CWD, from dynamic landcover - litr1c(c) = litr1c(c) + dwt_frootc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + dwt_frootc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + dwt_frootc_to_litr3c(c)*dt - cwdc(c) = cwdc(c) + dwt_livecrootc_to_cwdc(c)*dt - cwdc(c) = cwdc(c) + dwt_deadcrootc_to_cwdc(c)*dt - - ! litter and SOM HR fluxes - litr1c(c) = litr1c(c) - litr1_hr(c)*dt - litr2c(c) = litr2c(c) - litr2_hr(c)*dt - litr3c(c) = litr3c(c) - litr3_hr(c)*dt - soil1c(c) = soil1c(c) - soil1_hr(c)*dt - soil2c(c) = soil2c(c) - soil2_hr(c)*dt - soil3c(c) = soil3c(c) - soil3_hr(c)*dt - soil4c(c) = soil4c(c) - soil4_hr(c)*dt - - ! CWD to litter fluxes - cwdc(c) = cwdc(c) - cwdc_to_litr2c(c)*dt - litr2c(c) = litr2c(c) + cwdc_to_litr2c(c)*dt - cwdc(c) = cwdc(c) - cwdc_to_litr3c(c)*dt - litr3c(c) = litr3c(c) + cwdc_to_litr3c(c)*dt - - ! litter to SOM fluxes - litr1c(c) = litr1c(c) - litr1c_to_soil1c(c)*dt - soil1c(c) = soil1c(c) + litr1c_to_soil1c(c)*dt - litr2c(c) = litr2c(c) - litr2c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) + litr2c_to_soil2c(c)*dt - litr3c(c) = litr3c(c) - litr3c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) + litr3c_to_soil3c(c)*dt - - ! SOM to SOM fluxes - soil1c(c) = soil1c(c) - soil1c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) + soil1c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) - soil2c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) + soil2c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) - soil3c_to_soil4c(c)*dt - soil4c(c) = soil4c(c) + soil3c_to_soil4c(c)*dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! phenology: transfer growth fluxes - leafc(p) = leafc(p) + leafc_xfer_to_leafc(p)*dt - leafc_xfer(p) = leafc_xfer(p) - leafc_xfer_to_leafc(p)*dt - frootc(p) = frootc(p) + frootc_xfer_to_frootc(p)*dt - frootc_xfer(p) = frootc_xfer(p) - frootc_xfer_to_frootc(p)*dt - if (woody(ivt(p)) == 1._r8) then - livestemc(p) = livestemc(p) + livestemc_xfer_to_livestemc(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) - livestemc_xfer_to_livestemc(p)*dt - deadstemc(p) = deadstemc(p) + deadstemc_xfer_to_deadstemc(p)*dt - deadstemc_xfer(p) = deadstemc_xfer(p) - deadstemc_xfer_to_deadstemc(p)*dt - livecrootc(p) = livecrootc(p) + livecrootc_xfer_to_livecrootc(p)*dt - livecrootc_xfer(p) = livecrootc_xfer(p) - livecrootc_xfer_to_livecrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + deadcrootc_xfer_to_deadcrootc(p)*dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - deadcrootc_xfer_to_deadcrootc(p)*dt - end if - - ! phenology: litterfall fluxes - leafc(p) = leafc(p) - leafc_to_litter(p)*dt - frootc(p) = frootc(p) - frootc_to_litter(p)*dt - - ! livewood turnover fluxes - if (woody(ivt(p)) == 1._r8) then - livestemc(p) = livestemc(p) - livestemc_to_deadstemc(p)*dt - deadstemc(p) = deadstemc(p) + livestemc_to_deadstemc(p)*dt - livecrootc(p) = livecrootc(p) - livecrootc_to_deadcrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + livecrootc_to_deadcrootc(p)*dt - end if - - ! maintenance respiration fluxes - cpool(p) = cpool(p) - cpool_to_xsmrpool(p)*dt - cpool(p) = cpool(p) - leaf_curmr(p)*dt - cpool(p) = cpool(p) - froot_curmr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - livestem_curmr(p)*dt - cpool(p) = cpool(p) - livecroot_curmr(p)*dt - end if - - ! maintenance respiration fluxes - xsmrpool(p) = xsmrpool(p) + cpool_to_xsmrpool(p)*dt - xsmrpool(p) = xsmrpool(p) - leaf_xsmr(p)*dt - xsmrpool(p) = xsmrpool(p) - froot_xsmr(p)*dt - if (woody(ivt(p)) == 1._r8) then - xsmrpool(p) = xsmrpool(p) - livestem_xsmr(p)*dt - xsmrpool(p) = xsmrpool(p) - livecroot_xsmr(p)*dt - end if - - ! allocation fluxes - cpool(p) = cpool(p) - cpool_to_leafc(p)*dt - leafc(p) = leafc(p) + cpool_to_leafc(p)*dt - cpool(p) = cpool(p) - cpool_to_leafc_storage(p)*dt - leafc_storage(p) = leafc_storage(p) + cpool_to_leafc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_frootc(p)*dt - frootc(p) = frootc(p) + cpool_to_frootc(p)*dt - cpool(p) = cpool(p) - cpool_to_frootc_storage(p)*dt - frootc_storage(p) = frootc_storage(p) + cpool_to_frootc_storage(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_to_livestemc(p)*dt - livestemc(p) = livestemc(p) + cpool_to_livestemc(p)*dt - cpool(p) = cpool(p) - cpool_to_livestemc_storage(p)*dt - livestemc_storage(p) = livestemc_storage(p) + cpool_to_livestemc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_deadstemc(p)*dt - deadstemc(p) = deadstemc(p) + cpool_to_deadstemc(p)*dt - cpool(p) = cpool(p) - cpool_to_deadstemc_storage(p)*dt - deadstemc_storage(p) = deadstemc_storage(p) + cpool_to_deadstemc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_livecrootc(p)*dt - livecrootc(p) = livecrootc(p) + cpool_to_livecrootc(p)*dt - cpool(p) = cpool(p) - cpool_to_livecrootc_storage(p)*dt - livecrootc_storage(p) = livecrootc_storage(p) + cpool_to_livecrootc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_deadcrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + cpool_to_deadcrootc(p)*dt - cpool(p) = cpool(p) - cpool_to_deadcrootc_storage(p)*dt - deadcrootc_storage(p) = deadcrootc_storage(p) + cpool_to_deadcrootc_storage(p)*dt - end if - - ! growth respiration fluxes for current growth - cpool(p) = cpool(p) - cpool_leaf_gr(p)*dt - cpool(p) = cpool(p) - cpool_froot_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_livestem_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadstem_gr(p)*dt - cpool(p) = cpool(p) - cpool_livecroot_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadcroot_gr(p)*dt - end if - - ! growth respiration for transfer growth - gresp_xfer(p) = gresp_xfer(p) - transfer_leaf_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_froot_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - gresp_xfer(p) = gresp_xfer(p) - transfer_livestem_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_deadstem_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_livecroot_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_deadcroot_gr(p)*dt - end if - - ! growth respiration at time of storage - cpool(p) = cpool(p) - cpool_leaf_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_froot_storage_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_livestem_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadstem_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_livecroot_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadcroot_storage_gr(p)*dt - end if - - ! growth respiration stored for release during transfer growth - cpool(p) = cpool(p) - cpool_to_gresp_storage(p)*dt - gresp_storage(p) = gresp_storage(p) + cpool_to_gresp_storage(p)*dt - - ! move storage pools into transfer pools - leafc_storage(p) = leafc_storage(p) - leafc_storage_to_xfer(p)*dt - leafc_xfer(p) = leafc_xfer(p) + leafc_storage_to_xfer(p)*dt - frootc_storage(p) = frootc_storage(p) - frootc_storage_to_xfer(p)*dt - frootc_xfer(p) = frootc_xfer(p) + frootc_storage_to_xfer(p)*dt - if (woody(ivt(p)) == 1._r8) then - livestemc_storage(p) = livestemc_storage(p) - livestemc_storage_to_xfer(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) + livestemc_storage_to_xfer(p)*dt - deadstemc_storage(p) = deadstemc_storage(p) - deadstemc_storage_to_xfer(p)*dt - deadstemc_xfer(p) = deadstemc_xfer(p) + deadstemc_storage_to_xfer(p)*dt - livecrootc_storage(p) = livecrootc_storage(p) - livecrootc_storage_to_xfer(p)*dt - livecrootc_xfer(p) = livecrootc_xfer(p) + livecrootc_storage_to_xfer(p)*dt - deadcrootc_storage(p) = deadcrootc_storage(p) - deadcrootc_storage_to_xfer(p)*dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) + deadcrootc_storage_to_xfer(p)*dt - gresp_storage(p) = gresp_storage(p) - gresp_storage_to_xfer(p)*dt - gresp_xfer(p) = gresp_xfer(p) + gresp_storage_to_xfer(p)*dt - end if - - end do ! end of pft loop - -end subroutine C13StateUpdate1 -!----------------------------------------------------------------------- - -end module CNC13StateUpdate1Mod diff --git a/src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 b/src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 deleted file mode 100644 index 0ded060270..0000000000 --- a/src_clm40/biogeochem/CNC13StateUpdate2Mod.F90 +++ /dev/null @@ -1,576 +0,0 @@ -module CNC13StateUpdate2Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: C13StateUpdate2Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: C13StateUpdate2 - public:: C13StateUpdate2h -! -! !REVISION HISTORY: -! 4/21/2005: Created by Peter Thornton and Neil Suits - copied from -! CNCStateUpdate2 for C13 state variables. -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13StateUpdate2 -! -! !INTERFACE: -subroutine C13StateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables affected by gap-phase mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use clm_varctl, only : use_c13 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: m_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_to_cwdc(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: m_deadstemc_to_cwdc(:) - real(r8), pointer :: m_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: m_frootc_storage_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr2c(:) - real(r8), pointer :: m_frootc_to_litr3c(:) - real(r8), pointer :: m_frootc_xfer_to_litr1c(:) - real(r8), pointer :: m_gresp_storage_to_litr1c(:) - real(r8), pointer :: m_gresp_xfer_to_litr1c(:) - real(r8), pointer :: m_leafc_storage_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr2c(:) - real(r8), pointer :: m_leafc_to_litr3c(:) - real(r8), pointer :: m_leafc_xfer_to_litr1c(:) - real(r8), pointer :: m_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: m_livecrootc_to_cwdc(:) - real(r8), pointer :: m_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_livestemc_storage_to_litr1c(:) - real(r8), pointer :: m_livestemc_to_cwdc(:) - real(r8), pointer :: m_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) !(gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) !(gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer -! -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - - if (.not. use_c13) then - RETURN - end if - - ! assign local pointers at the column level - m_deadcrootc_storage_to_litr1c => cc13f%m_deadcrootc_storage_to_litr1c - m_deadcrootc_to_cwdc => cc13f%m_deadcrootc_to_cwdc - m_deadcrootc_xfer_to_litr1c => cc13f%m_deadcrootc_xfer_to_litr1c - m_deadstemc_storage_to_litr1c => cc13f%m_deadstemc_storage_to_litr1c - m_deadstemc_to_cwdc => cc13f%m_deadstemc_to_cwdc - m_deadstemc_xfer_to_litr1c => cc13f%m_deadstemc_xfer_to_litr1c - m_frootc_storage_to_litr1c => cc13f%m_frootc_storage_to_litr1c - m_frootc_to_litr1c => cc13f%m_frootc_to_litr1c - m_frootc_to_litr2c => cc13f%m_frootc_to_litr2c - m_frootc_to_litr3c => cc13f%m_frootc_to_litr3c - m_frootc_xfer_to_litr1c => cc13f%m_frootc_xfer_to_litr1c - m_gresp_storage_to_litr1c => cc13f%m_gresp_storage_to_litr1c - m_gresp_xfer_to_litr1c => cc13f%m_gresp_xfer_to_litr1c - m_leafc_storage_to_litr1c => cc13f%m_leafc_storage_to_litr1c - m_leafc_to_litr1c => cc13f%m_leafc_to_litr1c - m_leafc_to_litr2c => cc13f%m_leafc_to_litr2c - m_leafc_to_litr3c => cc13f%m_leafc_to_litr3c - m_leafc_xfer_to_litr1c => cc13f%m_leafc_xfer_to_litr1c - m_livecrootc_storage_to_litr1c => cc13f%m_livecrootc_storage_to_litr1c - m_livecrootc_to_cwdc => cc13f%m_livecrootc_to_cwdc - m_livecrootc_xfer_to_litr1c => cc13f%m_livecrootc_xfer_to_litr1c - m_livestemc_storage_to_litr1c => cc13f%m_livestemc_storage_to_litr1c - m_livestemc_to_cwdc => cc13f%m_livestemc_to_cwdc - m_livestemc_xfer_to_litr1c => cc13f%m_livestemc_xfer_to_litr1c - cwdc => cc13s%cwdc - litr1c => cc13s%litr1c - litr2c => cc13s%litr2c - litr3c => cc13s%litr3c - - ! assign local pointers at the pft level - m_deadcrootc_storage_to_litter => pc13f%m_deadcrootc_storage_to_litter - m_deadcrootc_to_litter => pc13f%m_deadcrootc_to_litter - m_deadcrootc_xfer_to_litter => pc13f%m_deadcrootc_xfer_to_litter - m_deadstemc_storage_to_litter => pc13f%m_deadstemc_storage_to_litter - m_deadstemc_to_litter => pc13f%m_deadstemc_to_litter - m_deadstemc_xfer_to_litter => pc13f%m_deadstemc_xfer_to_litter - m_frootc_storage_to_litter => pc13f%m_frootc_storage_to_litter - m_frootc_to_litter => pc13f%m_frootc_to_litter - m_frootc_xfer_to_litter => pc13f%m_frootc_xfer_to_litter - m_gresp_storage_to_litter => pc13f%m_gresp_storage_to_litter - m_gresp_xfer_to_litter => pc13f%m_gresp_xfer_to_litter - m_leafc_storage_to_litter => pc13f%m_leafc_storage_to_litter - m_leafc_to_litter => pc13f%m_leafc_to_litter - m_leafc_xfer_to_litter => pc13f%m_leafc_xfer_to_litter - m_livecrootc_storage_to_litter => pc13f%m_livecrootc_storage_to_litter - m_livecrootc_to_litter => pc13f%m_livecrootc_to_litter - m_livecrootc_xfer_to_litter => pc13f%m_livecrootc_xfer_to_litter - m_livestemc_storage_to_litter => pc13f%m_livestemc_storage_to_litter - m_livestemc_to_litter => pc13f%m_livestemc_to_litter - m_livestemc_xfer_to_litter => pc13f%m_livestemc_xfer_to_litter - deadcrootc => pc13s%deadcrootc - deadcrootc_storage => pc13s%deadcrootc_storage - deadcrootc_xfer => pc13s%deadcrootc_xfer - deadstemc => pc13s%deadstemc - deadstemc_storage => pc13s%deadstemc_storage - deadstemc_xfer => pc13s%deadstemc_xfer - frootc => pc13s%frootc - frootc_storage => pc13s%frootc_storage - frootc_xfer => pc13s%frootc_xfer - gresp_storage => pc13s%gresp_storage - gresp_xfer => pc13s%gresp_xfer - leafc => pc13s%leafc - leafc_storage => pc13s%leafc_storage - leafc_xfer => pc13s%leafc_xfer - livecrootc => pc13s%livecrootc - livecrootc_storage => pc13s%livecrootc_storage - livecrootc_xfer => pc13s%livecrootc_xfer - livestemc => pc13s%livestemc - livestemc_storage => pc13s%livestemc_storage - livestemc_xfer => pc13s%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from gap-phase mortality - - ! leaf to litter - litr1c(c) = litr1c(c) + m_leafc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + m_leafc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + m_leafc_to_litr3c(c) * dt - - ! fine root to litter - litr1c(c) = litr1c(c) + m_frootc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + m_frootc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + m_frootc_to_litr3c(c) * dt - - ! wood to CWD - cwdc(c) = cwdc(c) + m_livestemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_deadstemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_livecrootc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_deadcrootc_to_cwdc(c) * dt - - ! storage pools to litter - litr1c(c) = litr1c(c) + m_leafc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_frootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livestemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadstemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livecrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadcrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_gresp_storage_to_litr1c(c) * dt - - ! transfer pools to litter - litr1c(c) = litr1c(c) + m_leafc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_frootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livestemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadstemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livecrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadcrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_gresp_xfer_to_litr1c(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from gap-phase mortality - ! displayed pools - leafc(p) = leafc(p) - m_leafc_to_litter(p) * dt - frootc(p) = frootc(p) - m_frootc_to_litter(p) * dt - livestemc(p) = livestemc(p) - m_livestemc_to_litter(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_litter(p) * dt - livecrootc(p) = livecrootc(p) - m_livecrootc_to_litter(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_litter(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - m_leafc_storage_to_litter(p) * dt - frootc_storage(p) = frootc_storage(p) - m_frootc_storage_to_litter(p) * dt - livestemc_storage(p) = livestemc_storage(p) - m_livestemc_storage_to_litter(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - m_deadstemc_storage_to_litter(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - m_livecrootc_storage_to_litter(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - m_deadcrootc_storage_to_litter(p) * dt - gresp_storage(p) = gresp_storage(p) - m_gresp_storage_to_litter(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - m_leafc_xfer_to_litter(p) * dt - frootc_xfer(p) = frootc_xfer(p) - m_frootc_xfer_to_litter(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - m_livestemc_xfer_to_litter(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - m_deadstemc_xfer_to_litter(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - m_livecrootc_xfer_to_litter(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - m_deadcrootc_xfer_to_litter(p) * dt - gresp_xfer(p) = gresp_xfer(p) - m_gresp_xfer_to_litter(p) * dt - - end do ! end of pft loop - -end subroutine C13StateUpdate2 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13StateUpdate2h -! -! !INTERFACE: -subroutine C13StateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Update all the prognostic carbon state -! variables affected by harvest mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 5/20/09: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: hrv_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_to_cwdc(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_frootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr2c(:) - real(r8), pointer :: hrv_frootc_to_litr3c(:) - real(r8), pointer :: hrv_frootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_gresp_storage_to_litr1c(:) - real(r8), pointer :: hrv_gresp_xfer_to_litr1c(:) - real(r8), pointer :: hrv_leafc_storage_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr2c(:) - real(r8), pointer :: hrv_leafc_to_litr3c(:) - real(r8), pointer :: hrv_leafc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_to_cwdc(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_to_cwdc(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: xsmrpool(:) ! (gC/m2) abstract C pool to meet excess MR demand -! -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - hrv_deadcrootc_storage_to_litr1c => cc13f%hrv_deadcrootc_storage_to_litr1c - hrv_deadcrootc_to_cwdc => cc13f%hrv_deadcrootc_to_cwdc - hrv_deadcrootc_xfer_to_litr1c => cc13f%hrv_deadcrootc_xfer_to_litr1c - hrv_deadstemc_storage_to_litr1c => cc13f%hrv_deadstemc_storage_to_litr1c - hrv_deadstemc_xfer_to_litr1c => cc13f%hrv_deadstemc_xfer_to_litr1c - hrv_frootc_storage_to_litr1c => cc13f%hrv_frootc_storage_to_litr1c - hrv_frootc_to_litr1c => cc13f%hrv_frootc_to_litr1c - hrv_frootc_to_litr2c => cc13f%hrv_frootc_to_litr2c - hrv_frootc_to_litr3c => cc13f%hrv_frootc_to_litr3c - hrv_frootc_xfer_to_litr1c => cc13f%hrv_frootc_xfer_to_litr1c - hrv_gresp_storage_to_litr1c => cc13f%hrv_gresp_storage_to_litr1c - hrv_gresp_xfer_to_litr1c => cc13f%hrv_gresp_xfer_to_litr1c - hrv_leafc_storage_to_litr1c => cc13f%hrv_leafc_storage_to_litr1c - hrv_leafc_to_litr1c => cc13f%hrv_leafc_to_litr1c - hrv_leafc_to_litr2c => cc13f%hrv_leafc_to_litr2c - hrv_leafc_to_litr3c => cc13f%hrv_leafc_to_litr3c - hrv_leafc_xfer_to_litr1c => cc13f%hrv_leafc_xfer_to_litr1c - hrv_livecrootc_storage_to_litr1c => cc13f%hrv_livecrootc_storage_to_litr1c - hrv_livecrootc_to_cwdc => cc13f%hrv_livecrootc_to_cwdc - hrv_livecrootc_xfer_to_litr1c => cc13f%hrv_livecrootc_xfer_to_litr1c - hrv_livestemc_storage_to_litr1c => cc13f%hrv_livestemc_storage_to_litr1c - hrv_livestemc_to_cwdc => cc13f%hrv_livestemc_to_cwdc - hrv_livestemc_xfer_to_litr1c => cc13f%hrv_livestemc_xfer_to_litr1c - cwdc => cc13s%cwdc - litr1c => cc13s%litr1c - litr2c => cc13s%litr2c - litr3c => cc13s%litr3c - - ! assign local pointers at the pft level - hrv_deadcrootc_storage_to_litter => pc13f%hrv_deadcrootc_storage_to_litter - hrv_deadcrootc_to_litter => pc13f%hrv_deadcrootc_to_litter - hrv_deadcrootc_xfer_to_litter => pc13f%hrv_deadcrootc_xfer_to_litter - hrv_deadstemc_storage_to_litter => pc13f%hrv_deadstemc_storage_to_litter - hrv_deadstemc_to_prod10c => pc13f%hrv_deadstemc_to_prod10c - hrv_deadstemc_to_prod100c => pc13f%hrv_deadstemc_to_prod100c - hrv_deadstemc_xfer_to_litter => pc13f%hrv_deadstemc_xfer_to_litter - hrv_frootc_storage_to_litter => pc13f%hrv_frootc_storage_to_litter - hrv_frootc_to_litter => pc13f%hrv_frootc_to_litter - hrv_frootc_xfer_to_litter => pc13f%hrv_frootc_xfer_to_litter - hrv_gresp_storage_to_litter => pc13f%hrv_gresp_storage_to_litter - hrv_gresp_xfer_to_litter => pc13f%hrv_gresp_xfer_to_litter - hrv_leafc_storage_to_litter => pc13f%hrv_leafc_storage_to_litter - hrv_leafc_to_litter => pc13f%hrv_leafc_to_litter - hrv_leafc_xfer_to_litter => pc13f%hrv_leafc_xfer_to_litter - hrv_livecrootc_storage_to_litter => pc13f%hrv_livecrootc_storage_to_litter - hrv_livecrootc_to_litter => pc13f%hrv_livecrootc_to_litter - hrv_livecrootc_xfer_to_litter => pc13f%hrv_livecrootc_xfer_to_litter - hrv_livestemc_storage_to_litter => pc13f%hrv_livestemc_storage_to_litter - hrv_livestemc_to_litter => pc13f%hrv_livestemc_to_litter - hrv_livestemc_xfer_to_litter => pc13f%hrv_livestemc_xfer_to_litter - hrv_xsmrpool_to_atm => pc13f%hrv_xsmrpool_to_atm - deadcrootc => pc13s%deadcrootc - deadcrootc_storage => pc13s%deadcrootc_storage - deadcrootc_xfer => pc13s%deadcrootc_xfer - deadstemc => pc13s%deadstemc - deadstemc_storage => pc13s%deadstemc_storage - deadstemc_xfer => pc13s%deadstemc_xfer - frootc => pc13s%frootc - frootc_storage => pc13s%frootc_storage - frootc_xfer => pc13s%frootc_xfer - gresp_storage => pc13s%gresp_storage - gresp_xfer => pc13s%gresp_xfer - leafc => pc13s%leafc - leafc_storage => pc13s%leafc_storage - leafc_xfer => pc13s%leafc_xfer - livecrootc => pc13s%livecrootc - livecrootc_storage => pc13s%livecrootc_storage - livecrootc_xfer => pc13s%livecrootc_xfer - livestemc => pc13s%livestemc - livestemc_storage => pc13s%livestemc_storage - livestemc_xfer => pc13s%livestemc_xfer - xsmrpool => pc13s%xsmrpool - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from harvest mortality - - ! leaf to litter - litr1c(c) = litr1c(c) + hrv_leafc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + hrv_leafc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + hrv_leafc_to_litr3c(c) * dt - - ! fine root to litter - litr1c(c) = litr1c(c) + hrv_frootc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + hrv_frootc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + hrv_frootc_to_litr3c(c) * dt - - ! wood to CWD - cwdc(c) = cwdc(c) + hrv_livestemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + hrv_livecrootc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + hrv_deadcrootc_to_cwdc(c) * dt - - ! wood to product pools - states updated in CNWoodProducts() - - ! storage pools to litter - litr1c(c) = litr1c(c) + hrv_leafc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_frootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livestemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadstemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livecrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadcrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_gresp_storage_to_litr1c(c) * dt - - ! transfer pools to litter - litr1c(c) = litr1c(c) + hrv_leafc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_frootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livestemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadstemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livecrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadcrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_gresp_xfer_to_litr1c(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from harvest mortality - ! displayed pools - leafc(p) = leafc(p) - hrv_leafc_to_litter(p) * dt - frootc(p) = frootc(p) - hrv_frootc_to_litter(p) * dt - livestemc(p) = livestemc(p) - hrv_livestemc_to_litter(p) * dt - deadstemc(p) = deadstemc(p) - hrv_deadstemc_to_prod10c(p) * dt - deadstemc(p) = deadstemc(p) - hrv_deadstemc_to_prod100c(p) * dt - livecrootc(p) = livecrootc(p) - hrv_livecrootc_to_litter(p) * dt - deadcrootc(p) = deadcrootc(p) - hrv_deadcrootc_to_litter(p) * dt - - ! xsmrpool - xsmrpool(p) = xsmrpool(p) - hrv_xsmrpool_to_atm(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - hrv_leafc_storage_to_litter(p) * dt - frootc_storage(p) = frootc_storage(p) - hrv_frootc_storage_to_litter(p) * dt - livestemc_storage(p) = livestemc_storage(p) - hrv_livestemc_storage_to_litter(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - hrv_deadstemc_storage_to_litter(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - hrv_livecrootc_storage_to_litter(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - hrv_deadcrootc_storage_to_litter(p) * dt - gresp_storage(p) = gresp_storage(p) - hrv_gresp_storage_to_litter(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - hrv_leafc_xfer_to_litter(p) * dt - frootc_xfer(p) = frootc_xfer(p) - hrv_frootc_xfer_to_litter(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - hrv_livestemc_xfer_to_litter(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - hrv_deadstemc_xfer_to_litter(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - hrv_livecrootc_xfer_to_litter(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - hrv_deadcrootc_xfer_to_litter(p) * dt - gresp_xfer(p) = gresp_xfer(p) - hrv_gresp_xfer_to_litter(p) * dt - - end do ! end of pft loop - -end subroutine C13StateUpdate2h -!----------------------------------------------------------------------- - -end module CNC13StateUpdate2Mod diff --git a/src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 b/src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 deleted file mode 100644 index da8cc85a0d..0000000000 --- a/src_clm40/biogeochem/CNC13StateUpdate3Mod.F90 +++ /dev/null @@ -1,244 +0,0 @@ -module CNC13StateUpdate3Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: C13StateUpdate3Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: C13StateUpdate3 -! -! !REVISION HISTORY: -! 4/21/2005: Created by Peter Thornton and Neil Suits - copied from -! CNCStateUpdate3 for C13 state variables. -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: C13StateUpdate3 -! -! !INTERFACE: -subroutine C13StateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables affected by fire fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use clm_varctl, only : use_c13 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: m_cwdc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_cwdc_fire(:) - real(r8), pointer :: m_deadstemc_to_cwdc_fire(:) - real(r8), pointer :: m_litr1c_to_fire(:) - real(r8), pointer :: m_litr2c_to_fire(:) - real(r8), pointer :: m_litr3c_to_fire(:) - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) - real(r8), pointer :: m_deadstemc_to_fire(:) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) - real(r8), pointer :: m_frootc_storage_to_fire(:) - real(r8), pointer :: m_frootc_to_fire(:) - real(r8), pointer :: m_frootc_xfer_to_fire(:) - real(r8), pointer :: m_gresp_storage_to_fire(:) - real(r8), pointer :: m_gresp_xfer_to_fire(:) - real(r8), pointer :: m_leafc_storage_to_fire(:) - real(r8), pointer :: m_leafc_to_fire(:) - real(r8), pointer :: m_leafc_xfer_to_fire(:) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) - real(r8), pointer :: m_livecrootc_to_fire(:) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) - real(r8), pointer :: m_livestemc_storage_to_fire(:) - real(r8), pointer :: m_livestemc_to_fire(:) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer -! -! local pointers to implicit out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - - if (.not. use_c13) then - RETURN - end if - - ! assign local pointers at the column level - m_cwdc_to_fire => cc13f%m_cwdc_to_fire - m_deadcrootc_to_cwdc_fire => cc13f%m_deadcrootc_to_cwdc_fire - m_deadstemc_to_cwdc_fire => cc13f%m_deadstemc_to_cwdc_fire - m_litr1c_to_fire => cc13f%m_litr1c_to_fire - m_litr2c_to_fire => cc13f%m_litr2c_to_fire - m_litr3c_to_fire => cc13f%m_litr3c_to_fire - cwdc => cc13s%cwdc - litr1c => cc13s%litr1c - litr2c => cc13s%litr2c - litr3c => cc13s%litr3c - - ! assign local pointers at the column level - m_deadcrootc_storage_to_fire => pc13f%m_deadcrootc_storage_to_fire - m_deadcrootc_to_fire => pc13f%m_deadcrootc_to_fire - m_deadcrootc_to_litter_fire => pc13f%m_deadcrootc_to_litter_fire - m_deadcrootc_xfer_to_fire => pc13f%m_deadcrootc_xfer_to_fire - m_deadstemc_storage_to_fire => pc13f%m_deadstemc_storage_to_fire - m_deadstemc_to_fire => pc13f%m_deadstemc_to_fire - m_deadstemc_to_litter_fire => pc13f%m_deadstemc_to_litter_fire - m_deadstemc_xfer_to_fire => pc13f%m_deadstemc_xfer_to_fire - m_frootc_storage_to_fire => pc13f%m_frootc_storage_to_fire - m_frootc_to_fire => pc13f%m_frootc_to_fire - m_frootc_xfer_to_fire => pc13f%m_frootc_xfer_to_fire - m_gresp_storage_to_fire => pc13f%m_gresp_storage_to_fire - m_gresp_xfer_to_fire => pc13f%m_gresp_xfer_to_fire - m_leafc_storage_to_fire => pc13f%m_leafc_storage_to_fire - m_leafc_to_fire => pc13f%m_leafc_to_fire - m_leafc_xfer_to_fire => pc13f%m_leafc_xfer_to_fire - m_livecrootc_storage_to_fire => pc13f%m_livecrootc_storage_to_fire - m_livecrootc_to_fire => pc13f%m_livecrootc_to_fire - m_livecrootc_xfer_to_fire => pc13f%m_livecrootc_xfer_to_fire - m_livestemc_storage_to_fire => pc13f%m_livestemc_storage_to_fire - m_livestemc_to_fire => pc13f%m_livestemc_to_fire - m_livestemc_xfer_to_fire => pc13f%m_livestemc_xfer_to_fire - deadcrootc => pc13s%deadcrootc - deadcrootc_storage => pc13s%deadcrootc_storage - deadcrootc_xfer => pc13s%deadcrootc_xfer - deadstemc => pc13s%deadstemc - deadstemc_storage => pc13s%deadstemc_storage - deadstemc_xfer => pc13s%deadstemc_xfer - frootc => pc13s%frootc - frootc_storage => pc13s%frootc_storage - frootc_xfer => pc13s%frootc_xfer - gresp_storage => pc13s%gresp_storage - gresp_xfer => pc13s%gresp_xfer - leafc => pc13s%leafc - leafc_storage => pc13s%leafc_storage - leafc_xfer => pc13s%leafc_xfer - livecrootc => pc13s%livecrootc - livecrootc_storage => pc13s%livecrootc_storage - livecrootc_xfer => pc13s%livecrootc_xfer - livestemc => pc13s%livestemc - livestemc_storage => pc13s%livestemc_storage - livestemc_xfer => pc13s%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from fire - - ! pft-level wood to column-level CWD (uncombusted wood) - cwdc(c) = cwdc(c) + m_deadstemc_to_cwdc_fire(c) * dt - cwdc(c) = cwdc(c) + m_deadcrootc_to_cwdc_fire(c) * dt - - ! litter and CWD losses to fire - litr1c(c) = litr1c(c) - m_litr1c_to_fire(c) * dt - litr2c(c) = litr2c(c) - m_litr2c_to_fire(c) * dt - litr3c(c) = litr3c(c) - m_litr3c_to_fire(c) * dt - cwdc(c) = cwdc(c) - m_cwdc_to_fire(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from fire - ! displayed pools - leafc(p) = leafc(p) - m_leafc_to_fire(p) * dt - frootc(p) = frootc(p) - m_frootc_to_fire(p) * dt - livestemc(p) = livestemc(p) - m_livestemc_to_fire(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_fire(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_litter_fire(p) * dt - livecrootc(p) = livecrootc(p) - m_livecrootc_to_fire(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_fire(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_litter_fire(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - m_leafc_storage_to_fire(p) * dt - frootc_storage(p) = frootc_storage(p) - m_frootc_storage_to_fire(p) * dt - livestemc_storage(p) = livestemc_storage(p) - m_livestemc_storage_to_fire(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - m_deadstemc_storage_to_fire(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - m_livecrootc_storage_to_fire(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - m_deadcrootc_storage_to_fire(p) * dt - gresp_storage(p) = gresp_storage(p) - m_gresp_storage_to_fire(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - m_leafc_xfer_to_fire(p) * dt - frootc_xfer(p) = frootc_xfer(p) - m_frootc_xfer_to_fire(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - m_livestemc_xfer_to_fire(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - m_deadstemc_xfer_to_fire(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - m_livecrootc_xfer_to_fire(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - m_deadcrootc_xfer_to_fire(p) * dt - gresp_xfer(p) = gresp_xfer(p) - m_gresp_xfer_to_fire(p) * dt - - end do ! end of pft loop - -end subroutine C13StateUpdate3 -!----------------------------------------------------------------------- - -end module CNC13StateUpdate3Mod diff --git a/src_clm40/biogeochem/CNCStateUpdate1Mod.F90 b/src_clm40/biogeochem/CNCStateUpdate1Mod.F90 deleted file mode 100644 index 881397d3ad..0000000000 --- a/src_clm40/biogeochem/CNCStateUpdate1Mod.F90 +++ /dev/null @@ -1,688 +0,0 @@ -module CNCStateUpdate1Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CStateUpdate1Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, non-mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! -! !PUBLIC MEMBER FUNCTIONS: - public:: CStateUpdate1 - public:: CStateUpdate0 -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CStateUpdate0 -! -! !INTERFACE: -subroutine CStateUpdate0(num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update cpool carbon state -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 7/1/05: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: psnshade_to_cpool(:) - real(r8), pointer :: psnsun_to_cpool(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the pft level - cpool => pcs%cpool - psnshade_to_cpool => pcf%psnshade_to_cpool - psnsun_to_cpool => pcf%psnsun_to_cpool - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - ! gross photosynthesis fluxes - cpool(p) = cpool(p) + psnsun_to_cpool(p)*dt - cpool(p) = cpool(p) + psnshade_to_cpool(p)*dt - end do - -end subroutine CStateUpdate0 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CStateUpdate1 -! -! !INTERFACE: -subroutine CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables (except for gap-phase mortality and fire fluxes) -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use pftvarcon , only: npcropmin, nc3crop - use surfrdMod , only: crop_prog -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! 12/5/03, Peter Thornton: Added livewood turnover fluxes -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays -! - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: cwdc_to_litr2c(:) ! decomp. of coarse woody debris C to litter 2 C (gC/m2/s) - real(r8), pointer :: cwdc_to_litr3c(:) ! decomp. of coarse woody debris C to litter 3 C (gC/m2/s) - integer , pointer :: harvdate(:) ! harvest date - real(r8), pointer :: xsmrpool_to_atm(:) ! excess MR pool harvest mortality (gC/m2/s) - real(r8), pointer :: grainc_to_litr1c(:) ! grain C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr2c(:) ! grain C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr3c(:) ! grain C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr1c(:) ! livestem C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr2c(:) ! livestem C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr3c(:) ! livestem C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr1c(:) ! fine root C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr2c(:) ! fine root C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr3c(:) ! fine root C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr1c(:) ! leaf C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr2c(:) ! leaf C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr3c(:) ! leaf C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: litr1_hr(:) ! het. resp. from litter 1 C (gC/m2/s) - real(r8), pointer :: litr1c_to_soil1c(:) ! decomp. of litter 1 C to SOM 1 C (gC/m2/s) - real(r8), pointer :: litr2_hr(:) ! het. resp. from litter 2 C (gC/m2/s) - real(r8), pointer :: litr2c_to_soil2c(:) ! decomp. of litter 2 C to SOM 2 C (gC/m2/s) - real(r8), pointer :: litr3_hr(:) ! het. resp. from litter 3 C (gC/m2/s) - real(r8), pointer :: litr3c_to_soil3c(:) ! decomp. of litter 3 C to SOM 3 C (gC/m2/s) - real(r8), pointer :: soil1_hr(:) ! het. resp. from SOM 1 C (gC/m2/s) - real(r8), pointer :: soil1c_to_soil2c(:) ! decomp. of SOM 1 C to SOM 2 C (gC/m2/s) - real(r8), pointer :: soil2_hr(:) ! het. resp. from SOM 2 C (gC/m2/s) - real(r8), pointer :: soil2c_to_soil3c(:) ! decomp. of SOM 2 C to SOM 3 C (gC/m2/s) - real(r8), pointer :: soil3_hr(:) ! het. resp. from SOM 3 C (gC/m2/s) - real(r8), pointer :: soil3c_to_soil4c(:) ! decomp. of SOM 3 C to SOM 4 C (gC/m2/s) - real(r8), pointer :: soil4_hr(:) ! het. resp. from SOM 4 C (gC/m2/s) - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: cpool_to_xsmrpool(:) - real(r8), pointer :: cpool_to_deadcrootc(:) - real(r8), pointer :: cpool_to_deadcrootc_storage(:) - real(r8), pointer :: cpool_to_deadstemc(:) - real(r8), pointer :: cpool_to_deadstemc_storage(:) - real(r8), pointer :: cpool_to_frootc(:) - real(r8), pointer :: cpool_to_frootc_storage(:) - real(r8), pointer :: cpool_to_gresp_storage(:) - real(r8), pointer :: cpool_to_leafc(:) - real(r8), pointer :: cpool_to_leafc_storage(:) - real(r8), pointer :: cpool_to_livecrootc(:) - real(r8), pointer :: cpool_to_livecrootc_storage(:) - real(r8), pointer :: cpool_to_livestemc(:) - real(r8), pointer :: cpool_to_livestemc_storage(:) - real(r8), pointer :: deadcrootc_storage_to_xfer(:) - real(r8), pointer :: deadstemc_storage_to_xfer(:) - real(r8), pointer :: frootc_storage_to_xfer(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: gresp_storage_to_xfer(:) - real(r8), pointer :: leafc_storage_to_xfer(:) - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: livecrootc_storage_to_xfer(:) - real(r8), pointer :: livecrootc_to_deadcrootc(:) - real(r8), pointer :: livestemc_storage_to_xfer(:) - real(r8), pointer :: livestemc_to_deadstemc(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: livecroot_mr(:) - real(r8), pointer :: livestem_curmr(:) - real(r8), pointer :: froot_curmr(:) - real(r8), pointer :: leaf_curmr(:) - real(r8), pointer :: livecroot_curmr(:) - real(r8), pointer :: livestem_xsmr(:) - real(r8), pointer :: froot_xsmr(:) - real(r8), pointer :: leaf_xsmr(:) - real(r8), pointer :: livecroot_xsmr(:) - real(r8), pointer :: cpool_deadcroot_gr(:) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) - real(r8), pointer :: cpool_deadstem_gr(:) - real(r8), pointer :: cpool_deadstem_storage_gr(:) - real(r8), pointer :: cpool_froot_gr(:) - real(r8), pointer :: cpool_froot_storage_gr(:) - real(r8), pointer :: cpool_leaf_gr(:) - real(r8), pointer :: cpool_leaf_storage_gr(:) - real(r8), pointer :: cpool_livecroot_gr(:) - real(r8), pointer :: cpool_livecroot_storage_gr(:) - real(r8), pointer :: cpool_livestem_gr(:) ! live stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livestem_storage_gr(:) ! live stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_deadcroot_gr(:) ! dead coarse root growth respiration from storage (gC/m2/s) - real(r8), pointer :: transfer_deadstem_gr(:) ! dead stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: transfer_froot_gr(:) ! fine root growth respiration from storage (gC/m2/s) - real(r8), pointer :: transfer_leaf_gr(:) ! leaf growth respiration from storage (gC/m2/s) - real(r8), pointer :: transfer_livecroot_gr(:) ! live coarse root growth respiration from storage (gC/m2/s) - real(r8), pointer :: transfer_livestem_gr(:) ! live stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C (gC/m2/s) - real(r8), pointer :: cpool_to_grainc_storage(:) ! allocation to grain C storage (gC/m2/s) - real(r8), pointer :: grainc_storage_to_xfer(:) ! grain C shift storage to transfer (gC/m2/s) - real(r8), pointer :: livestemc_to_litter(:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc_to_food(:) ! grain C to food (gC/m2/s) - real(r8), pointer :: grainc_xfer_to_grainc(:) ! grain C growth from storage (gC/m2/s) - real(r8), pointer :: cpool_grain_gr(:) ! grain growth respiration (gC/m2/s) - real(r8), pointer :: cpool_grain_storage_gr(:) ! grain growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_grain_gr(:) ! grain growth respiration from storage (gC/m2/s) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: grainc(:) ! grain C:N (gC/gN) - real(r8), pointer :: grainc_storage(:) ! (gC/m2) grain C storage - real(r8), pointer :: grainc_xfer(:) ! (gC/m2) grain C transfer - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) execss maint resp C pool - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - -! local pointers for dynamic landcover fluxes and states - real(r8), pointer :: dwt_seedc_to_leaf(:) - real(r8), pointer :: dwt_seedc_to_deadstem(:) - real(r8), pointer :: dwt_frootc_to_litr1c(:) - real(r8), pointer :: dwt_frootc_to_litr2c(:) - real(r8), pointer :: dwt_frootc_to_litr3c(:) - real(r8), pointer :: dwt_livecrootc_to_cwdc(:) - real(r8), pointer :: dwt_deadcrootc_to_cwdc(:) - real(r8), pointer :: seedc(:) - -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers - woody => pftcon%woody - - ! assign local pointers at the column level - cwdc_to_litr2c => ccf%cwdc_to_litr2c - cwdc_to_litr3c => ccf%cwdc_to_litr3c - frootc_to_litr1c => ccf%frootc_to_litr1c - frootc_to_litr2c => ccf%frootc_to_litr2c - frootc_to_litr3c => ccf%frootc_to_litr3c - leafc_to_litr1c => ccf%leafc_to_litr1c - leafc_to_litr2c => ccf%leafc_to_litr2c - leafc_to_litr3c => ccf%leafc_to_litr3c - grainc_to_litr1c => ccf%grainc_to_litr1c - grainc_to_litr2c => ccf%grainc_to_litr2c - grainc_to_litr3c => ccf%grainc_to_litr3c - livestemc_to_litr1c => ccf%livestemc_to_litr1c - livestemc_to_litr2c => ccf%livestemc_to_litr2c - livestemc_to_litr3c => ccf%livestemc_to_litr3c - litr1_hr => ccf%litr1_hr - litr1c_to_soil1c => ccf%litr1c_to_soil1c - litr2_hr => ccf%litr2_hr - litr2c_to_soil2c => ccf%litr2c_to_soil2c - litr3_hr => ccf%litr3_hr - litr3c_to_soil3c => ccf%litr3c_to_soil3c - soil1_hr => ccf%soil1_hr - soil1c_to_soil2c => ccf%soil1c_to_soil2c - soil2_hr => ccf%soil2_hr - soil2c_to_soil3c => ccf%soil2c_to_soil3c - soil3_hr => ccf%soil3_hr - soil3c_to_soil4c => ccf%soil3c_to_soil4c - soil4_hr => ccf%soil4_hr - col_ctrunc => ccs%col_ctrunc - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - soil1c => ccs%soil1c - soil2c => ccs%soil2c - soil3c => ccs%soil3c - soil4c => ccs%soil4c - ! new pointers for dynamic landcover - dwt_seedc_to_leaf => ccf%dwt_seedc_to_leaf - dwt_seedc_to_deadstem => ccf%dwt_seedc_to_deadstem - dwt_frootc_to_litr1c => ccf%dwt_frootc_to_litr1c - dwt_frootc_to_litr2c => ccf%dwt_frootc_to_litr2c - dwt_frootc_to_litr3c => ccf%dwt_frootc_to_litr3c - dwt_livecrootc_to_cwdc => ccf%dwt_livecrootc_to_cwdc - dwt_deadcrootc_to_cwdc => ccf%dwt_deadcrootc_to_cwdc - seedc => ccs%seedc - - ! assign local pointers at the pft level - ivt => pft%itype - cpool_deadcroot_gr => pcf%cpool_deadcroot_gr - cpool_deadcroot_storage_gr => pcf%cpool_deadcroot_storage_gr - cpool_deadstem_gr => pcf%cpool_deadstem_gr - cpool_deadstem_storage_gr => pcf%cpool_deadstem_storage_gr - cpool_froot_gr => pcf%cpool_froot_gr - cpool_froot_storage_gr => pcf%cpool_froot_storage_gr - cpool_leaf_gr => pcf%cpool_leaf_gr - cpool_leaf_storage_gr => pcf%cpool_leaf_storage_gr - cpool_livecroot_gr => pcf%cpool_livecroot_gr - cpool_livecroot_storage_gr => pcf%cpool_livecroot_storage_gr - cpool_livestem_gr => pcf%cpool_livestem_gr - cpool_livestem_storage_gr => pcf%cpool_livestem_storage_gr - cpool_to_xsmrpool => pcf%cpool_to_xsmrpool - cpool_to_deadcrootc => pcf%cpool_to_deadcrootc - cpool_to_deadcrootc_storage => pcf%cpool_to_deadcrootc_storage - cpool_to_deadstemc => pcf%cpool_to_deadstemc - cpool_to_deadstemc_storage => pcf%cpool_to_deadstemc_storage - cpool_to_frootc => pcf%cpool_to_frootc - cpool_to_frootc_storage => pcf%cpool_to_frootc_storage - cpool_to_gresp_storage => pcf%cpool_to_gresp_storage - cpool_to_leafc => pcf%cpool_to_leafc - cpool_to_leafc_storage => pcf%cpool_to_leafc_storage - cpool_to_livecrootc => pcf%cpool_to_livecrootc - cpool_to_livecrootc_storage => pcf%cpool_to_livecrootc_storage - cpool_to_livestemc => pcf%cpool_to_livestemc - cpool_to_livestemc_storage => pcf%cpool_to_livestemc_storage - deadcrootc_storage_to_xfer => pcf%deadcrootc_storage_to_xfer - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - deadstemc_storage_to_xfer => pcf%deadstemc_storage_to_xfer - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - froot_mr => pcf%froot_mr - froot_curmr => pcf%froot_curmr - froot_xsmr => pcf%froot_xsmr - frootc_storage_to_xfer => pcf%frootc_storage_to_xfer - frootc_to_litter => pcf%frootc_to_litter - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - gresp_storage_to_xfer => pcf%gresp_storage_to_xfer - leaf_mr => pcf%leaf_mr - leaf_curmr => pcf%leaf_curmr - leaf_xsmr => pcf%leaf_xsmr - leafc_storage_to_xfer => pcf%leafc_storage_to_xfer - leafc_to_litter => pcf%leafc_to_litter - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - livecroot_mr => pcf%livecroot_mr - livecroot_curmr => pcf%livecroot_curmr - livecroot_xsmr => pcf%livecroot_xsmr - livecrootc_storage_to_xfer => pcf%livecrootc_storage_to_xfer - livecrootc_to_deadcrootc => pcf%livecrootc_to_deadcrootc - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - livestem_mr => pcf%livestem_mr - livestem_curmr => pcf%livestem_curmr - livestem_xsmr => pcf%livestem_xsmr - livestemc_storage_to_xfer => pcf%livestemc_storage_to_xfer - livestemc_to_deadstemc => pcf%livestemc_to_deadstemc - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - transfer_deadcroot_gr => pcf%transfer_deadcroot_gr - transfer_deadstem_gr => pcf%transfer_deadstem_gr - transfer_froot_gr => pcf%transfer_froot_gr - transfer_leaf_gr => pcf%transfer_leaf_gr - transfer_livecroot_gr => pcf%transfer_livecroot_gr - transfer_livestem_gr => pcf%transfer_livestem_gr - harvdate => pps%harvdate - xsmrpool_to_atm => pcf%xsmrpool_to_atm - cpool_grain_gr => pcf%cpool_grain_gr - cpool_grain_storage_gr => pcf%cpool_grain_storage_gr - cpool_to_grainc => pcf%cpool_to_grainc - cpool_to_grainc_storage => pcf%cpool_to_grainc_storage - livestemc_to_litter => pcf%livestemc_to_litter - grainc_storage_to_xfer => pcf%grainc_storage_to_xfer - grainc_to_food => pcf%grainc_to_food - grainc_xfer_to_grainc => pcf%grainc_xfer_to_grainc - transfer_grain_gr => pcf%transfer_grain_gr - grainc => pcs%grainc - grainc_storage => pcs%grainc_storage - grainc_xfer => pcs%grainc_xfer - cpool => pcs%cpool - xsmrpool => pcs%xsmrpool - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level fluxes - - ! plant to litter fluxes - ! leaf litter - litr1c(c) = litr1c(c) + leafc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + leafc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + leafc_to_litr3c(c)*dt - ! fine root litter - litr1c(c) = litr1c(c) + frootc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + frootc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + frootc_to_litr3c(c)*dt - if ( crop_prog )then - ! livestem litter - litr1c(c) = litr1c(c) + livestemc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + livestemc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + livestemc_to_litr3c(c)*dt - ! grain litter - litr1c(c) = litr1c(c) + grainc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + grainc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + grainc_to_litr3c(c)*dt - end if - - ! seeding fluxes, from dynamic landcover - seedc(c) = seedc(c) - dwt_seedc_to_leaf(c) * dt - seedc(c) = seedc(c) - dwt_seedc_to_deadstem(c) * dt - - ! fluxes into litter and CWD, from dynamic landcover - litr1c(c) = litr1c(c) + dwt_frootc_to_litr1c(c)*dt - litr2c(c) = litr2c(c) + dwt_frootc_to_litr2c(c)*dt - litr3c(c) = litr3c(c) + dwt_frootc_to_litr3c(c)*dt - cwdc(c) = cwdc(c) + dwt_livecrootc_to_cwdc(c)*dt - cwdc(c) = cwdc(c) + dwt_deadcrootc_to_cwdc(c)*dt - - ! litter and SOM HR fluxes - litr1c(c) = litr1c(c) - litr1_hr(c)*dt - litr2c(c) = litr2c(c) - litr2_hr(c)*dt - litr3c(c) = litr3c(c) - litr3_hr(c)*dt - soil1c(c) = soil1c(c) - soil1_hr(c)*dt - soil2c(c) = soil2c(c) - soil2_hr(c)*dt - soil3c(c) = soil3c(c) - soil3_hr(c)*dt - soil4c(c) = soil4c(c) - soil4_hr(c)*dt - - ! CWD to litter fluxes - cwdc(c) = cwdc(c) - cwdc_to_litr2c(c)*dt - litr2c(c) = litr2c(c) + cwdc_to_litr2c(c)*dt - cwdc(c) = cwdc(c) - cwdc_to_litr3c(c)*dt - litr3c(c) = litr3c(c) + cwdc_to_litr3c(c)*dt - - ! litter to SOM fluxes - litr1c(c) = litr1c(c) - litr1c_to_soil1c(c)*dt - soil1c(c) = soil1c(c) + litr1c_to_soil1c(c)*dt - litr2c(c) = litr2c(c) - litr2c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) + litr2c_to_soil2c(c)*dt - litr3c(c) = litr3c(c) - litr3c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) + litr3c_to_soil3c(c)*dt - - ! SOM to SOM fluxes - soil1c(c) = soil1c(c) - soil1c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) + soil1c_to_soil2c(c)*dt - soil2c(c) = soil2c(c) - soil2c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) + soil2c_to_soil3c(c)*dt - soil3c(c) = soil3c(c) - soil3c_to_soil4c(c)*dt - soil4c(c) = soil4c(c) + soil3c_to_soil4c(c)*dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! phenology: transfer growth fluxes - leafc(p) = leafc(p) + leafc_xfer_to_leafc(p)*dt - leafc_xfer(p) = leafc_xfer(p) - leafc_xfer_to_leafc(p)*dt - frootc(p) = frootc(p) + frootc_xfer_to_frootc(p)*dt - frootc_xfer(p) = frootc_xfer(p) - frootc_xfer_to_frootc(p)*dt - if (woody(ivt(p)) == 1._r8) then - livestemc(p) = livestemc(p) + livestemc_xfer_to_livestemc(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) - livestemc_xfer_to_livestemc(p)*dt - deadstemc(p) = deadstemc(p) + deadstemc_xfer_to_deadstemc(p)*dt - deadstemc_xfer(p) = deadstemc_xfer(p) - deadstemc_xfer_to_deadstemc(p)*dt - livecrootc(p) = livecrootc(p) + livecrootc_xfer_to_livecrootc(p)*dt - livecrootc_xfer(p) = livecrootc_xfer(p) - livecrootc_xfer_to_livecrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + deadcrootc_xfer_to_deadcrootc(p)*dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - deadcrootc_xfer_to_deadcrootc(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - livestemc(p) = livestemc(p) + livestemc_xfer_to_livestemc(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) - livestemc_xfer_to_livestemc(p)*dt - grainc(p) = grainc(p) + grainc_xfer_to_grainc(p)*dt - grainc_xfer(p) = grainc_xfer(p) - grainc_xfer_to_grainc(p)*dt - end if - - ! phenology: litterfall fluxes - leafc(p) = leafc(p) - leafc_to_litter(p)*dt - frootc(p) = frootc(p) - frootc_to_litter(p)*dt - - ! livewood turnover fluxes - if (woody(ivt(p)) == 1._r8) then - livestemc(p) = livestemc(p) - livestemc_to_deadstemc(p)*dt - deadstemc(p) = deadstemc(p) + livestemc_to_deadstemc(p)*dt - livecrootc(p) = livecrootc(p) - livecrootc_to_deadcrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + livecrootc_to_deadcrootc(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - livestemc(p) = livestemc(p) - livestemc_to_litter(p)*dt - grainc(p) = grainc(p) - grainc_to_food(p)*dt - end if - - ! maintenance respiration fluxes from cpool - cpool(p) = cpool(p) - cpool_to_xsmrpool(p)*dt - cpool(p) = cpool(p) - leaf_curmr(p)*dt - cpool(p) = cpool(p) - froot_curmr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - livestem_curmr(p)*dt - cpool(p) = cpool(p) - livecroot_curmr(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool(p) = cpool(p) - livestem_curmr(p)*dt - end if - - ! maintenance respiration fluxes from xsmrpool - xsmrpool(p) = xsmrpool(p) + cpool_to_xsmrpool(p)*dt - xsmrpool(p) = xsmrpool(p) - leaf_xsmr(p)*dt - xsmrpool(p) = xsmrpool(p) - froot_xsmr(p)*dt - if (woody(ivt(p)) == 1._r8) then - xsmrpool(p) = xsmrpool(p) - livestem_xsmr(p)*dt - xsmrpool(p) = xsmrpool(p) - livecroot_xsmr(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - xsmrpool(p) = xsmrpool(p) - livestem_xsmr(p)*dt - if (harvdate(p) < 999) then ! beginning at harvest, send to atm - xsmrpool_to_atm(p) = xsmrpool_to_atm(p) + xsmrpool(p)/dt - xsmrpool(p) = xsmrpool(p) - xsmrpool_to_atm(p)*dt - end if - end if - - ! allocation fluxes - cpool(p) = cpool(p) - cpool_to_leafc(p)*dt - leafc(p) = leafc(p) + cpool_to_leafc(p)*dt - cpool(p) = cpool(p) - cpool_to_leafc_storage(p)*dt - leafc_storage(p) = leafc_storage(p) + cpool_to_leafc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_frootc(p)*dt - frootc(p) = frootc(p) + cpool_to_frootc(p)*dt - cpool(p) = cpool(p) - cpool_to_frootc_storage(p)*dt - frootc_storage(p) = frootc_storage(p) + cpool_to_frootc_storage(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_to_livestemc(p)*dt - livestemc(p) = livestemc(p) + cpool_to_livestemc(p)*dt - cpool(p) = cpool(p) - cpool_to_livestemc_storage(p)*dt - livestemc_storage(p) = livestemc_storage(p) + cpool_to_livestemc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_deadstemc(p)*dt - deadstemc(p) = deadstemc(p) + cpool_to_deadstemc(p)*dt - cpool(p) = cpool(p) - cpool_to_deadstemc_storage(p)*dt - deadstemc_storage(p) = deadstemc_storage(p) + cpool_to_deadstemc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_livecrootc(p)*dt - livecrootc(p) = livecrootc(p) + cpool_to_livecrootc(p)*dt - cpool(p) = cpool(p) - cpool_to_livecrootc_storage(p)*dt - livecrootc_storage(p) = livecrootc_storage(p) + cpool_to_livecrootc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_deadcrootc(p)*dt - deadcrootc(p) = deadcrootc(p) + cpool_to_deadcrootc(p)*dt - cpool(p) = cpool(p) - cpool_to_deadcrootc_storage(p)*dt - deadcrootc_storage(p) = deadcrootc_storage(p) + cpool_to_deadcrootc_storage(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool(p) = cpool(p) - cpool_to_livestemc(p)*dt - livestemc(p) = livestemc(p) + cpool_to_livestemc(p)*dt - cpool(p) = cpool(p) - cpool_to_livestemc_storage(p)*dt - livestemc_storage(p) = livestemc_storage(p) + cpool_to_livestemc_storage(p)*dt - cpool(p) = cpool(p) - cpool_to_grainc(p)*dt - grainc(p) = grainc(p) + cpool_to_grainc(p)*dt - cpool(p) = cpool(p) - cpool_to_grainc_storage(p)*dt - grainc_storage(p) = grainc_storage(p) + cpool_to_grainc_storage(p)*dt - end if - - ! growth respiration fluxes for current growth - cpool(p) = cpool(p) - cpool_leaf_gr(p)*dt - cpool(p) = cpool(p) - cpool_froot_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_livestem_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadstem_gr(p)*dt - cpool(p) = cpool(p) - cpool_livecroot_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadcroot_gr(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool(p) = cpool(p) - cpool_livestem_gr(p)*dt - cpool(p) = cpool(p) - cpool_grain_gr(p)*dt - end if - - ! growth respiration for transfer growth - gresp_xfer(p) = gresp_xfer(p) - transfer_leaf_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_froot_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - gresp_xfer(p) = gresp_xfer(p) - transfer_livestem_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_deadstem_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_livecroot_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_deadcroot_gr(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - gresp_xfer(p) = gresp_xfer(p) - transfer_livestem_gr(p)*dt - gresp_xfer(p) = gresp_xfer(p) - transfer_grain_gr(p)*dt - end if - - ! growth respiration at time of storage - cpool(p) = cpool(p) - cpool_leaf_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_froot_storage_gr(p)*dt - if (woody(ivt(p)) == 1._r8) then - cpool(p) = cpool(p) - cpool_livestem_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadstem_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_livecroot_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_deadcroot_storage_gr(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool(p) = cpool(p) - cpool_livestem_storage_gr(p)*dt - cpool(p) = cpool(p) - cpool_grain_storage_gr(p)*dt - end if - - ! growth respiration stored for release during transfer growth - cpool(p) = cpool(p) - cpool_to_gresp_storage(p)*dt - gresp_storage(p) = gresp_storage(p) + cpool_to_gresp_storage(p)*dt - - ! move storage pools into transfer pools - leafc_storage(p) = leafc_storage(p) - leafc_storage_to_xfer(p)*dt - leafc_xfer(p) = leafc_xfer(p) + leafc_storage_to_xfer(p)*dt - frootc_storage(p) = frootc_storage(p) - frootc_storage_to_xfer(p)*dt - frootc_xfer(p) = frootc_xfer(p) + frootc_storage_to_xfer(p)*dt - if (woody(ivt(p)) == 1._r8) then - livestemc_storage(p) = livestemc_storage(p) - livestemc_storage_to_xfer(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) + livestemc_storage_to_xfer(p)*dt - deadstemc_storage(p) = deadstemc_storage(p) - deadstemc_storage_to_xfer(p)*dt - deadstemc_xfer(p) = deadstemc_xfer(p) + deadstemc_storage_to_xfer(p)*dt - livecrootc_storage(p) = livecrootc_storage(p) - livecrootc_storage_to_xfer(p)*dt - livecrootc_xfer(p) = livecrootc_xfer(p) + livecrootc_storage_to_xfer(p)*dt - deadcrootc_storage(p) = deadcrootc_storage(p) - deadcrootc_storage_to_xfer(p)*dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) + deadcrootc_storage_to_xfer(p)*dt - gresp_storage(p) = gresp_storage(p) - gresp_storage_to_xfer(p)*dt - gresp_xfer(p) = gresp_xfer(p) + gresp_storage_to_xfer(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - livestemc_storage(p) = livestemc_storage(p) - livestemc_storage_to_xfer(p)*dt - livestemc_xfer(p) = livestemc_xfer(p) + livestemc_storage_to_xfer(p)*dt - grainc_storage(p) = grainc_storage(p) - grainc_storage_to_xfer(p)*dt - grainc_xfer(p) = grainc_xfer(p) + grainc_storage_to_xfer(p)*dt - end if - - end do ! end of pft loop - -end subroutine CStateUpdate1 -!----------------------------------------------------------------------- - -end module CNCStateUpdate1Mod diff --git a/src_clm40/biogeochem/CNCStateUpdate2Mod.F90 b/src_clm40/biogeochem/CNCStateUpdate2Mod.F90 deleted file mode 100644 index 93fcb20e20..0000000000 --- a/src_clm40/biogeochem/CNCStateUpdate2Mod.F90 +++ /dev/null @@ -1,569 +0,0 @@ -module CNCStateUpdate2Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CStateUpdate2Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CStateUpdate2 - public:: CStateUpdate2h -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CStateUpdate2 -! -! !INTERFACE: -subroutine CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables affected by gap-phase mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: m_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_to_cwdc(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: m_deadstemc_to_cwdc(:) - real(r8), pointer :: m_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: m_frootc_storage_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr2c(:) - real(r8), pointer :: m_frootc_to_litr3c(:) - real(r8), pointer :: m_frootc_xfer_to_litr1c(:) - real(r8), pointer :: m_gresp_storage_to_litr1c(:) - real(r8), pointer :: m_gresp_xfer_to_litr1c(:) - real(r8), pointer :: m_leafc_storage_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr2c(:) - real(r8), pointer :: m_leafc_to_litr3c(:) - real(r8), pointer :: m_leafc_xfer_to_litr1c(:) - real(r8), pointer :: m_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: m_livecrootc_to_cwdc(:) - real(r8), pointer :: m_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_livestemc_storage_to_litr1c(:) - real(r8), pointer :: m_livestemc_to_cwdc(:) - real(r8), pointer :: m_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) !(gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) !(gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer -! -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - m_deadcrootc_storage_to_litr1c => ccf%m_deadcrootc_storage_to_litr1c - m_deadcrootc_to_cwdc => ccf%m_deadcrootc_to_cwdc - m_deadcrootc_xfer_to_litr1c => ccf%m_deadcrootc_xfer_to_litr1c - m_deadstemc_storage_to_litr1c => ccf%m_deadstemc_storage_to_litr1c - m_deadstemc_to_cwdc => ccf%m_deadstemc_to_cwdc - m_deadstemc_xfer_to_litr1c => ccf%m_deadstemc_xfer_to_litr1c - m_frootc_storage_to_litr1c => ccf%m_frootc_storage_to_litr1c - m_frootc_to_litr1c => ccf%m_frootc_to_litr1c - m_frootc_to_litr2c => ccf%m_frootc_to_litr2c - m_frootc_to_litr3c => ccf%m_frootc_to_litr3c - m_frootc_xfer_to_litr1c => ccf%m_frootc_xfer_to_litr1c - m_gresp_storage_to_litr1c => ccf%m_gresp_storage_to_litr1c - m_gresp_xfer_to_litr1c => ccf%m_gresp_xfer_to_litr1c - m_leafc_storage_to_litr1c => ccf%m_leafc_storage_to_litr1c - m_leafc_to_litr1c => ccf%m_leafc_to_litr1c - m_leafc_to_litr2c => ccf%m_leafc_to_litr2c - m_leafc_to_litr3c => ccf%m_leafc_to_litr3c - m_leafc_xfer_to_litr1c => ccf%m_leafc_xfer_to_litr1c - m_livecrootc_storage_to_litr1c => ccf%m_livecrootc_storage_to_litr1c - m_livecrootc_to_cwdc => ccf%m_livecrootc_to_cwdc - m_livecrootc_xfer_to_litr1c => ccf%m_livecrootc_xfer_to_litr1c - m_livestemc_storage_to_litr1c => ccf%m_livestemc_storage_to_litr1c - m_livestemc_to_cwdc => ccf%m_livestemc_to_cwdc - m_livestemc_xfer_to_litr1c => ccf%m_livestemc_xfer_to_litr1c - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - - ! assign local pointers at the pft level - m_deadcrootc_storage_to_litter => pcf%m_deadcrootc_storage_to_litter - m_deadcrootc_to_litter => pcf%m_deadcrootc_to_litter - m_deadcrootc_xfer_to_litter => pcf%m_deadcrootc_xfer_to_litter - m_deadstemc_storage_to_litter => pcf%m_deadstemc_storage_to_litter - m_deadstemc_to_litter => pcf%m_deadstemc_to_litter - m_deadstemc_xfer_to_litter => pcf%m_deadstemc_xfer_to_litter - m_frootc_storage_to_litter => pcf%m_frootc_storage_to_litter - m_frootc_to_litter => pcf%m_frootc_to_litter - m_frootc_xfer_to_litter => pcf%m_frootc_xfer_to_litter - m_gresp_storage_to_litter => pcf%m_gresp_storage_to_litter - m_gresp_xfer_to_litter => pcf%m_gresp_xfer_to_litter - m_leafc_storage_to_litter => pcf%m_leafc_storage_to_litter - m_leafc_to_litter => pcf%m_leafc_to_litter - m_leafc_xfer_to_litter => pcf%m_leafc_xfer_to_litter - m_livecrootc_storage_to_litter => pcf%m_livecrootc_storage_to_litter - m_livecrootc_to_litter => pcf%m_livecrootc_to_litter - m_livecrootc_xfer_to_litter => pcf%m_livecrootc_xfer_to_litter - m_livestemc_storage_to_litter => pcf%m_livestemc_storage_to_litter - m_livestemc_to_litter => pcf%m_livestemc_to_litter - m_livestemc_xfer_to_litter => pcf%m_livestemc_xfer_to_litter - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from gap-phase mortality - - ! leaf to litter - litr1c(c) = litr1c(c) + m_leafc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + m_leafc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + m_leafc_to_litr3c(c) * dt - - ! fine root to litter - litr1c(c) = litr1c(c) + m_frootc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + m_frootc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + m_frootc_to_litr3c(c) * dt - - ! wood to CWD - cwdc(c) = cwdc(c) + m_livestemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_deadstemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_livecrootc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + m_deadcrootc_to_cwdc(c) * dt - - ! storage pools to litter - litr1c(c) = litr1c(c) + m_leafc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_frootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livestemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadstemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livecrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadcrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_gresp_storage_to_litr1c(c) * dt - - ! transfer pools to litter - litr1c(c) = litr1c(c) + m_leafc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_frootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livestemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadstemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_livecrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_deadcrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + m_gresp_xfer_to_litr1c(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from gap-phase mortality - ! displayed pools - leafc(p) = leafc(p) - m_leafc_to_litter(p) * dt - frootc(p) = frootc(p) - m_frootc_to_litter(p) * dt - livestemc(p) = livestemc(p) - m_livestemc_to_litter(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_litter(p) * dt - livecrootc(p) = livecrootc(p) - m_livecrootc_to_litter(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_litter(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - m_leafc_storage_to_litter(p) * dt - frootc_storage(p) = frootc_storage(p) - m_frootc_storage_to_litter(p) * dt - livestemc_storage(p) = livestemc_storage(p) - m_livestemc_storage_to_litter(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - m_deadstemc_storage_to_litter(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - m_livecrootc_storage_to_litter(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - m_deadcrootc_storage_to_litter(p) * dt - gresp_storage(p) = gresp_storage(p) - m_gresp_storage_to_litter(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - m_leafc_xfer_to_litter(p) * dt - frootc_xfer(p) = frootc_xfer(p) - m_frootc_xfer_to_litter(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - m_livestemc_xfer_to_litter(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - m_deadstemc_xfer_to_litter(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - m_livecrootc_xfer_to_litter(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - m_deadcrootc_xfer_to_litter(p) * dt - gresp_xfer(p) = gresp_xfer(p) - m_gresp_xfer_to_litter(p) * dt - - end do ! end of pft loop - -end subroutine CStateUpdate2 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CStateUpdate2h -! -! !INTERFACE: -subroutine CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Update all the prognostic carbon state -! variables affected by harvest mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 5/20/09: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: hrv_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_to_cwdc(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_frootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr2c(:) - real(r8), pointer :: hrv_frootc_to_litr3c(:) - real(r8), pointer :: hrv_frootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_gresp_storage_to_litr1c(:) - real(r8), pointer :: hrv_gresp_xfer_to_litr1c(:) - real(r8), pointer :: hrv_leafc_storage_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr2c(:) - real(r8), pointer :: hrv_leafc_to_litr3c(:) - real(r8), pointer :: hrv_leafc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_to_cwdc(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_to_cwdc(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: xsmrpool(:) ! (gC/m2) abstract C pool to meet excess MR demand -! -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) -! -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - hrv_deadcrootc_storage_to_litr1c => ccf%hrv_deadcrootc_storage_to_litr1c - hrv_deadcrootc_to_cwdc => ccf%hrv_deadcrootc_to_cwdc - hrv_deadcrootc_xfer_to_litr1c => ccf%hrv_deadcrootc_xfer_to_litr1c - hrv_deadstemc_storage_to_litr1c => ccf%hrv_deadstemc_storage_to_litr1c - hrv_deadstemc_xfer_to_litr1c => ccf%hrv_deadstemc_xfer_to_litr1c - hrv_frootc_storage_to_litr1c => ccf%hrv_frootc_storage_to_litr1c - hrv_frootc_to_litr1c => ccf%hrv_frootc_to_litr1c - hrv_frootc_to_litr2c => ccf%hrv_frootc_to_litr2c - hrv_frootc_to_litr3c => ccf%hrv_frootc_to_litr3c - hrv_frootc_xfer_to_litr1c => ccf%hrv_frootc_xfer_to_litr1c - hrv_gresp_storage_to_litr1c => ccf%hrv_gresp_storage_to_litr1c - hrv_gresp_xfer_to_litr1c => ccf%hrv_gresp_xfer_to_litr1c - hrv_leafc_storage_to_litr1c => ccf%hrv_leafc_storage_to_litr1c - hrv_leafc_to_litr1c => ccf%hrv_leafc_to_litr1c - hrv_leafc_to_litr2c => ccf%hrv_leafc_to_litr2c - hrv_leafc_to_litr3c => ccf%hrv_leafc_to_litr3c - hrv_leafc_xfer_to_litr1c => ccf%hrv_leafc_xfer_to_litr1c - hrv_livecrootc_storage_to_litr1c => ccf%hrv_livecrootc_storage_to_litr1c - hrv_livecrootc_to_cwdc => ccf%hrv_livecrootc_to_cwdc - hrv_livecrootc_xfer_to_litr1c => ccf%hrv_livecrootc_xfer_to_litr1c - hrv_livestemc_storage_to_litr1c => ccf%hrv_livestemc_storage_to_litr1c - hrv_livestemc_to_cwdc => ccf%hrv_livestemc_to_cwdc - hrv_livestemc_xfer_to_litr1c => ccf%hrv_livestemc_xfer_to_litr1c - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - - ! assign local pointers at the pft level - hrv_deadcrootc_storage_to_litter => pcf%hrv_deadcrootc_storage_to_litter - hrv_deadcrootc_to_litter => pcf%hrv_deadcrootc_to_litter - hrv_deadcrootc_xfer_to_litter => pcf%hrv_deadcrootc_xfer_to_litter - hrv_deadstemc_storage_to_litter => pcf%hrv_deadstemc_storage_to_litter - hrv_deadstemc_to_prod10c => pcf%hrv_deadstemc_to_prod10c - hrv_deadstemc_to_prod100c => pcf%hrv_deadstemc_to_prod100c - hrv_deadstemc_xfer_to_litter => pcf%hrv_deadstemc_xfer_to_litter - hrv_frootc_storage_to_litter => pcf%hrv_frootc_storage_to_litter - hrv_frootc_to_litter => pcf%hrv_frootc_to_litter - hrv_frootc_xfer_to_litter => pcf%hrv_frootc_xfer_to_litter - hrv_gresp_storage_to_litter => pcf%hrv_gresp_storage_to_litter - hrv_gresp_xfer_to_litter => pcf%hrv_gresp_xfer_to_litter - hrv_leafc_storage_to_litter => pcf%hrv_leafc_storage_to_litter - hrv_leafc_to_litter => pcf%hrv_leafc_to_litter - hrv_leafc_xfer_to_litter => pcf%hrv_leafc_xfer_to_litter - hrv_livecrootc_storage_to_litter => pcf%hrv_livecrootc_storage_to_litter - hrv_livecrootc_to_litter => pcf%hrv_livecrootc_to_litter - hrv_livecrootc_xfer_to_litter => pcf%hrv_livecrootc_xfer_to_litter - hrv_livestemc_storage_to_litter => pcf%hrv_livestemc_storage_to_litter - hrv_livestemc_to_litter => pcf%hrv_livestemc_to_litter - hrv_livestemc_xfer_to_litter => pcf%hrv_livestemc_xfer_to_litter - hrv_xsmrpool_to_atm => pcf%hrv_xsmrpool_to_atm - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - xsmrpool => pcs%xsmrpool - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from harvest mortality - - ! leaf to litter - litr1c(c) = litr1c(c) + hrv_leafc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + hrv_leafc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + hrv_leafc_to_litr3c(c) * dt - - ! fine root to litter - litr1c(c) = litr1c(c) + hrv_frootc_to_litr1c(c) * dt - litr2c(c) = litr2c(c) + hrv_frootc_to_litr2c(c) * dt - litr3c(c) = litr3c(c) + hrv_frootc_to_litr3c(c) * dt - - ! wood to CWD - cwdc(c) = cwdc(c) + hrv_livestemc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + hrv_livecrootc_to_cwdc(c) * dt - cwdc(c) = cwdc(c) + hrv_deadcrootc_to_cwdc(c) * dt - - ! wood to product pools - states updated in CNWoodProducts() - - ! storage pools to litter - litr1c(c) = litr1c(c) + hrv_leafc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_frootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livestemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadstemc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livecrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadcrootc_storage_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_gresp_storage_to_litr1c(c) * dt - - ! transfer pools to litter - litr1c(c) = litr1c(c) + hrv_leafc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_frootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livestemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadstemc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_livecrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_deadcrootc_xfer_to_litr1c(c) * dt - litr1c(c) = litr1c(c) + hrv_gresp_xfer_to_litr1c(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from harvest mortality - ! displayed pools - leafc(p) = leafc(p) - hrv_leafc_to_litter(p) * dt - frootc(p) = frootc(p) - hrv_frootc_to_litter(p) * dt - livestemc(p) = livestemc(p) - hrv_livestemc_to_litter(p) * dt - deadstemc(p) = deadstemc(p) - hrv_deadstemc_to_prod10c(p) * dt - deadstemc(p) = deadstemc(p) - hrv_deadstemc_to_prod100c(p) * dt - livecrootc(p) = livecrootc(p) - hrv_livecrootc_to_litter(p) * dt - deadcrootc(p) = deadcrootc(p) - hrv_deadcrootc_to_litter(p) * dt - - ! xsmrpool - xsmrpool(p) = xsmrpool(p) - hrv_xsmrpool_to_atm(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - hrv_leafc_storage_to_litter(p) * dt - frootc_storage(p) = frootc_storage(p) - hrv_frootc_storage_to_litter(p) * dt - livestemc_storage(p) = livestemc_storage(p) - hrv_livestemc_storage_to_litter(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - hrv_deadstemc_storage_to_litter(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - hrv_livecrootc_storage_to_litter(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - hrv_deadcrootc_storage_to_litter(p) * dt - gresp_storage(p) = gresp_storage(p) - hrv_gresp_storage_to_litter(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - hrv_leafc_xfer_to_litter(p) * dt - frootc_xfer(p) = frootc_xfer(p) - hrv_frootc_xfer_to_litter(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - hrv_livestemc_xfer_to_litter(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - hrv_deadstemc_xfer_to_litter(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - hrv_livecrootc_xfer_to_litter(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - hrv_deadcrootc_xfer_to_litter(p) * dt - gresp_xfer(p) = gresp_xfer(p) - hrv_gresp_xfer_to_litter(p) * dt - - end do ! end of pft loop - -end subroutine CStateUpdate2h -!----------------------------------------------------------------------- - -end module CNCStateUpdate2Mod diff --git a/src_clm40/biogeochem/CNCStateUpdate3Mod.F90 b/src_clm40/biogeochem/CNCStateUpdate3Mod.F90 deleted file mode 100644 index 7499b90f79..0000000000 --- a/src_clm40/biogeochem/CNCStateUpdate3Mod.F90 +++ /dev/null @@ -1,238 +0,0 @@ -module CNCStateUpdate3Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CStateUpdate3Mod -! -! !DESCRIPTION: -! Module for carbon state variable update, mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CStateUpdate3 -! -! !REVISION HISTORY: -! 7/27/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CStateUpdate3 -! -! !INTERFACE: -subroutine CStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables affected by fire fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays - real(r8), pointer :: m_cwdc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_cwdc_fire(:) - real(r8), pointer :: m_deadstemc_to_cwdc_fire(:) - real(r8), pointer :: m_litr1c_to_fire(:) - real(r8), pointer :: m_litr2c_to_fire(:) - real(r8), pointer :: m_litr3c_to_fire(:) - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) - real(r8), pointer :: m_deadstemc_to_fire(:) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) - real(r8), pointer :: m_frootc_storage_to_fire(:) - real(r8), pointer :: m_frootc_to_fire(:) - real(r8), pointer :: m_frootc_xfer_to_fire(:) - real(r8), pointer :: m_gresp_storage_to_fire(:) - real(r8), pointer :: m_gresp_xfer_to_fire(:) - real(r8), pointer :: m_leafc_storage_to_fire(:) - real(r8), pointer :: m_leafc_to_fire(:) - real(r8), pointer :: m_leafc_xfer_to_fire(:) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) - real(r8), pointer :: m_livecrootc_to_fire(:) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) - real(r8), pointer :: m_livestemc_storage_to_fire(:) - real(r8), pointer :: m_livestemc_to_fire(:) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer -! -! local pointers to implicit out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers at the column level - m_cwdc_to_fire => ccf%m_cwdc_to_fire - m_deadcrootc_to_cwdc_fire => ccf%m_deadcrootc_to_cwdc_fire - m_deadstemc_to_cwdc_fire => ccf%m_deadstemc_to_cwdc_fire - m_litr1c_to_fire => ccf%m_litr1c_to_fire - m_litr2c_to_fire => ccf%m_litr2c_to_fire - m_litr3c_to_fire => ccf%m_litr3c_to_fire - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - - ! assign local pointers at the column level - m_deadcrootc_storage_to_fire => pcf%m_deadcrootc_storage_to_fire - m_deadcrootc_to_fire => pcf%m_deadcrootc_to_fire - m_deadcrootc_to_litter_fire => pcf%m_deadcrootc_to_litter_fire - m_deadcrootc_xfer_to_fire => pcf%m_deadcrootc_xfer_to_fire - m_deadstemc_storage_to_fire => pcf%m_deadstemc_storage_to_fire - m_deadstemc_to_fire => pcf%m_deadstemc_to_fire - m_deadstemc_to_litter_fire => pcf%m_deadstemc_to_litter_fire - m_deadstemc_xfer_to_fire => pcf%m_deadstemc_xfer_to_fire - m_frootc_storage_to_fire => pcf%m_frootc_storage_to_fire - m_frootc_to_fire => pcf%m_frootc_to_fire - m_frootc_xfer_to_fire => pcf%m_frootc_xfer_to_fire - m_gresp_storage_to_fire => pcf%m_gresp_storage_to_fire - m_gresp_xfer_to_fire => pcf%m_gresp_xfer_to_fire - m_leafc_storage_to_fire => pcf%m_leafc_storage_to_fire - m_leafc_to_fire => pcf%m_leafc_to_fire - m_leafc_xfer_to_fire => pcf%m_leafc_xfer_to_fire - m_livecrootc_storage_to_fire => pcf%m_livecrootc_storage_to_fire - m_livecrootc_to_fire => pcf%m_livecrootc_to_fire - m_livecrootc_xfer_to_fire => pcf%m_livecrootc_xfer_to_fire - m_livestemc_storage_to_fire => pcf%m_livestemc_storage_to_fire - m_livestemc_to_fire => pcf%m_livestemc_to_fire - m_livestemc_xfer_to_fire => pcf%m_livestemc_xfer_to_fire - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column level carbon fluxes from fire - - ! pft-level wood to column-level CWD (uncombusted wood) - cwdc(c) = cwdc(c) + m_deadstemc_to_cwdc_fire(c) * dt - cwdc(c) = cwdc(c) + m_deadcrootc_to_cwdc_fire(c) * dt - - ! litter and CWD losses to fire - litr1c(c) = litr1c(c) - m_litr1c_to_fire(c) * dt - litr2c(c) = litr2c(c) - m_litr2c_to_fire(c) * dt - litr3c(c) = litr3c(c) - m_litr3c_to_fire(c) * dt - cwdc(c) = cwdc(c) - m_cwdc_to_fire(c) * dt - - end do ! end of columns loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level carbon fluxes from fire - ! displayed pools - leafc(p) = leafc(p) - m_leafc_to_fire(p) * dt - frootc(p) = frootc(p) - m_frootc_to_fire(p) * dt - livestemc(p) = livestemc(p) - m_livestemc_to_fire(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_fire(p) * dt - deadstemc(p) = deadstemc(p) - m_deadstemc_to_litter_fire(p) * dt - livecrootc(p) = livecrootc(p) - m_livecrootc_to_fire(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_fire(p) * dt - deadcrootc(p) = deadcrootc(p) - m_deadcrootc_to_litter_fire(p) * dt - - ! storage pools - leafc_storage(p) = leafc_storage(p) - m_leafc_storage_to_fire(p) * dt - frootc_storage(p) = frootc_storage(p) - m_frootc_storage_to_fire(p) * dt - livestemc_storage(p) = livestemc_storage(p) - m_livestemc_storage_to_fire(p) * dt - deadstemc_storage(p) = deadstemc_storage(p) - m_deadstemc_storage_to_fire(p) * dt - livecrootc_storage(p) = livecrootc_storage(p) - m_livecrootc_storage_to_fire(p) * dt - deadcrootc_storage(p) = deadcrootc_storage(p) - m_deadcrootc_storage_to_fire(p) * dt - gresp_storage(p) = gresp_storage(p) - m_gresp_storage_to_fire(p) * dt - - ! transfer pools - leafc_xfer(p) = leafc_xfer(p) - m_leafc_xfer_to_fire(p) * dt - frootc_xfer(p) = frootc_xfer(p) - m_frootc_xfer_to_fire(p) * dt - livestemc_xfer(p) = livestemc_xfer(p) - m_livestemc_xfer_to_fire(p) * dt - deadstemc_xfer(p) = deadstemc_xfer(p) - m_deadstemc_xfer_to_fire(p) * dt - livecrootc_xfer(p) = livecrootc_xfer(p) - m_livecrootc_xfer_to_fire(p) * dt - deadcrootc_xfer(p) = deadcrootc_xfer(p) - m_deadcrootc_xfer_to_fire(p) * dt - gresp_xfer(p) = gresp_xfer(p) - m_gresp_xfer_to_fire(p) * dt - - end do ! end of pft loop - -end subroutine CStateUpdate3 -!----------------------------------------------------------------------- - -end module CNCStateUpdate3Mod diff --git a/src_clm40/biogeochem/CNDVEcosystemDynIniMod.F90 b/src_clm40/biogeochem/CNDVEcosystemDynIniMod.F90 deleted file mode 100644 index 405b43b7ae..0000000000 --- a/src_clm40/biogeochem/CNDVEcosystemDynIniMod.F90 +++ /dev/null @@ -1,93 +0,0 @@ -module CNDVEcosystemDyniniMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNDVEcosystemDyniniMod -! -! !DESCRIPTION: -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: CNDVEcosystemDynini ! CNDV related initializations -! -! !REVISION HISTORY: -! Created by Sam Levis following DGVMEcosystemDynMod by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNDVEcosystemDynini -! -! !INTERFACE: - subroutine CNDVEcosystemDynini() -! -! !DESCRIPTION: -! CNDV related initializations -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use decompMod , only : get_proc_bounds, get_proc_global - use shr_const_mod, only : SHR_CONST_PI, SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Author: Sam Levis (adapted from LPJ initialization subroutines) -! Sam Levis (adapted for CNDV coupling; eliminated redunant parameters) -! -!EOP -! -! !LOCAL VARIABLES: - integer :: g,p,n ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! " column indices - integer :: begl, endl ! " landunit indices - integer :: begg, endg ! " gridcell indices - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - gptr => grc - pptr => pft - - ! --------------------------------------------------------------- - ! Some of the following came from LPJ subroutine initgrid - ! --------------------------------------------------------------- - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - do p = begp,endp - pdgvs%present(p) = .false. - pdgvs%crownarea(p) = 0._r8 - pdgvs%nind(p) = 0._r8 - pcs%leafcmax(p) = 0._r8 - pdgvs%t_mo_min(p) = 1.0e+36_r8 - end do - - do g = begg,endg - gdgvs%agdd20(g) = 0._r8 - gdgvs%tmomin20(g) = SHR_CONST_TKFRZ - 5._r8 !initialize this way for Phenology code - end do - - end subroutine CNDVEcosystemDynini - -end module CNDVEcosystemDyniniMod diff --git a/src_clm40/biogeochem/CNDVEstablishmentMod.F90 b/src_clm40/biogeochem/CNDVEstablishmentMod.F90 deleted file mode 100644 index 1a445d7ce6..0000000000 --- a/src_clm40/biogeochem/CNDVEstablishmentMod.F90 +++ /dev/null @@ -1,518 +0,0 @@ -module CNDVEstablishmentMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNDVEstablishmentMod -! -! !DESCRIPTION: -! Calculates establishment of new pfts -! Called once per year -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils , only: endrun -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Establishment -! -! !REVISION HISTORY: -! Module created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Establishment -! -! !INTERFACE: - subroutine Establishment(lbg, ubg, lbp, ubp) -! -! !DESCRIPTION: -! Calculates establishment of new pfts -! Called once per year -! -! !USES: - use clmtype - use clm_varpar , only : numpft - use clm_varcon , only : istsoil - use clm_varctl , only : iulog - use pftvarcon , only : noveg, nc3_arctic_grass - use shr_const_mod, only : SHR_CONST_CDAY, SHR_CONST_PI, SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbg, ubg ! gridcell bounds - integer , intent(in) :: lbp, ubp ! pft bounds -! -! !CALLED FROM: -! subroutine dv in module CNDVMod -! -! !REVISION HISTORY: -! Author: Sam Levis (adapted from Stephen Sitch's LPJ subr. establishment) -! 3/4/02, Peter Thornton: Migrated to new data structures. -! 10/05 , Sam Levis: adapted to work with CN -! 09/07 , Sam Levis: as 10/05 but with current CN -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - logical , pointer :: pftmayexist(:) ! exclude seasonal decid pfts from tropics [1=true, 0=false] - integer , pointer :: plandunit(:) ! landunit of corresponding pft - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: ltype(:) ! landunit type for corresponding pft - real(r8), pointer :: tmomin20(:) ! 20-yr running mean of tmomin - real(r8), pointer :: agdd20(:) ! 20-yr running mean of agdd - real(r8), pointer :: agddtw(:) ! accumulated growing degree days above twmax - real(r8), pointer :: prec365(:) ! 365-day running mean of tot. precipitation - real(r8), pointer :: slatop(:) !specific leaf area at top of canopy, projected area basis [m^2/gC] - real(r8), pointer :: dsladlai(:) !dSLA/dLAI, projected area basis [m^2/gC] - real(r8), pointer :: woody(:) ! ecophys const - woody pft or not - real(r8), pointer :: crownarea_max(:) ! ecophys const - tree maximum crown area [m2] - real(r8), pointer :: twmax(:) ! ecophys const - upper limit of temperature of the warmest month - real(r8), pointer :: reinickerp(:) ! ecophys const - parameter in allometric equation - real(r8), pointer :: dwood(:) ! ecophys const - wood density (gC/m3) - real(r8), pointer :: allom1(:) ! ecophys const - parameter in allometric - real(r8), pointer :: tcmin(:) ! ecophys const - minimum coldest monthly mean temperature - real(r8), pointer :: tcmax(:) ! ecophys const - maximum coldest monthly mean temperature - real(r8), pointer :: gddmin(:) ! ecophys const - minimum growing degree days (at or above 5 C) - real(r8), pointer :: leafcmax(:) ! (gC/m2) ann max leaf C - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: annsum_npp(:) ! annual sum NPP (gC/m2/yr) - real(r8), pointer :: annsum_litfall(:) ! annual sum litfall (gC/m2/yr) -! -! local pointers to implicit in/out arguments -! - integer , pointer :: ivt(:) ! vegetation type for this pft - logical , pointer :: present(:) ! true=> PFT present in patch - real(r8), pointer :: nind(:) ! number of individuals (#/m**2) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: fpcgrid(:) ! foliar projective cover on gridcell (fraction) - real(r8), pointer :: crownarea(:) ! area that each individual tree takes up (m^2) - real(r8), pointer :: greffic(:) ! lpj's growth efficiency - real(r8), pointer :: heatstress(:) -! -!EOP -! -! !OTHER LOCAL VARIABLES: -! - integer :: g,l,p,m ! indices - integer :: fn, filterg(ubg-lbg+1) ! local gridcell filter for error check -! -! gridcell level variables -! - integer :: ngrass(lbg:ubg) ! counter - integer :: npft_estab(lbg:ubg) ! counter - real(r8) :: fpc_tree_total(lbg:ubg) ! total fractional cover of trees in vegetated portion of gridcell - real(r8) :: fpc_total(lbg:ubg) ! old-total fractional vegetated portion of gridcell (without bare ground) - real(r8) :: fpc_total_new(lbg:ubg) ! new-total fractional vegetated portion of gridcell (without bare ground) -! -! pft level variables -! - logical :: survive(lbp:ubp) ! true=>pft survives - logical :: estab(lbp:ubp) ! true=>pft is established - real(r8) :: dstemc(lbp:ubp) ! local copy of deadstemc -! -! local and temporary variables or parameters -! - real(r8) :: taper ! ratio of height:radius_breast_height (tree allometry) - real(r8) :: estab_rate !establishment rate - real(r8) :: estab_grid !establishment rate on grid cell - real(r8) :: fpcgridtemp ! temporary - real(r8) :: stemdiam ! stem diameter - real(r8) :: stocking ! #stems / ha (stocking density) - real(r8) :: lai_ind ! LAI per individual - real(r8) :: lm_ind !leaf carbon (gC/ind) - real(r8) :: fpc_ind !individual foliage projective cover - real(r8):: bm_delta - - real(r8), parameter :: ramp_agddtw = 300.0 - -! minimum individual density for persistence of PFT (indiv/m2) -! - real(r8), parameter :: nind_min = 1.0e-10_r8 -! -! minimum precip. for establishment (mm/s) -! - real(r8), parameter :: prec_min_estab = 100._r8/(365._r8*SHR_CONST_CDAY) -! -! maximum sapling establishment rate (indiv/m2) -! - real(r8), parameter :: estab_max = 0.24_r8 -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (gridcell-level) - - agdd20 => gdgvs%agdd20 - tmomin20 => gdgvs%tmomin20 - - ! Assign local pointers to derived type members (landunit-level) - - ltype => lun%itype - - ! Assign local pointers to derived type members (pft-level) - - ivt => pft%itype - pgridcell => pft%gridcell - plandunit => pft%landunit - present => pdgvs%present - nind => pdgvs%nind - fpcgrid => pdgvs%fpcgrid - crownarea => pdgvs%crownarea - greffic => pdgvs%greffic - heatstress => pdgvs%heatstress - annsum_npp => pepv%annsum_npp - annsum_litfall => pepv%annsum_litfall - prec365 => pdgvs%prec365 - agddtw => pdgvs%agddtw - pftmayexist => pdgvs%pftmayexist - - ! Assign local pointers to derived type members (vegetation types) - - crownarea_max => dgv_pftcon%crownarea_max - twmax => dgv_pftcon%twmax - reinickerp => dgv_pftcon%reinickerp - allom1 => dgv_pftcon%allom1 - tcmax => dgv_pftcon%tcmax - tcmin => dgv_pftcon%tcmin - gddmin => dgv_pftcon%gddmin - leafcmax => pcs%leafcmax - deadstemc => pcs%deadstemc - slatop => pftcon%slatop - dsladlai => pftcon%dsladlai - dwood => pftcon%dwood - woody => pftcon%woody - - ! ********************************************************************** - ! Slevis version of LPJ's subr. bioclim - ! Limits based on 20-year running averages of coldest-month mean - ! temperature and growing degree days (5 degree base). - ! For SURVIVAL, coldest month temperature and GDD should be - ! at least as high as PFT-specific limits. - ! For REGENERATION, PFT must be able to survive AND coldest month - ! temperature should be no higher than a PFT-specific limit. - ! ********************************************************************** - - taper = 200._r8 ! make a global constant as with dwood (lpj's wooddens) - - ! Initialize gridcell-level metrics - - do g = lbg, ubg - ngrass(g) = 0 - npft_estab(g) = 0 - fpc_tree_total(g) = 0._r8 - fpc_total(g) = 0._r8 - fpc_total_new(g) = 0._r8 - end do - - do p = lbp, ubp - g = pgridcell(p) - - ! Set the presence of pft for this gridcell - - if (nind(p) == 0._r8) present(p) = .false. - if (.not. present(p)) then - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - survive(p) = .false. - estab(p) = .false. - dstemc(p) = deadstemc(p) - end do - - ! Must go thru all 16 pfts and decide which can/cannot establish or survive - ! Determine present, survive, estab. Note: Even if tmomin20>tcmax, crops - ! and 2nd boreal summergreen tree cannot exist (see - ! EcosystemDynini) because this model cannot simulate such pfts, yet. - ! Note - agddtw is only defined at the pft level and has now been moved - ! to an if-statement below to determine establishment of boreal trees - - do p = lbp, ubp - g = pgridcell(p) - if (tmomin20(g) >= tcmin(ivt(p)) + SHR_CONST_TKFRZ ) then - if (tmomin20(g) <= tcmax(ivt(p)) + SHR_CONST_TKFRZ .and. agdd20(g) >= gddmin(ivt(p))) then - estab(p) = .true. - end if - survive(p) = .true. - ! seasonal decid. pfts that would have occurred in regions without - ! short winter day lengths (see CNPhenology) - if (.not. pftmayexist(p)) then - survive(p) = .false. - estab(p) = .false. - pftmayexist(p) = .true. - end if - end if - end do - - do p = lbp, ubp - g = pgridcell(p) - l = plandunit(p) - - ! Case 1 -- pft ceases to exist -kill pfts not adapted to current climate - - if (present(p) .and. (.not. survive(p) .or. nind(p)= prec_min_estab .and. estab(p)) then - if (twmax(ivt(p)) > 999._r8 .or. agddtw(p) == 0._r8) then - - present(p) = .true. - nind(p) = 0._r8 - ! lpj starts with fpcgrid=0 and calculates - ! seed fpcgrid from the carbon of saplings; - ! with CN we need the seed fpcgrid up front - ! to scale seed leafc to lm_ind to get fpcgrid; - ! sounds circular; also seed fpcgrid depends on sla, - ! so theoretically need diff value for each pft;slevis - fpcgrid(p) = 0.000844_r8 - if (woody(ivt(p)) < 1._r8) then - fpcgrid(p) = 0.05_r8 - end if - - ! Seed carbon for newly established pfts - ! Equiv. to pleaf=1 & pstor=1 set in subr pftwt_cnbal (slevis) - ! ***Dangerous*** to hardwire leafcmax here; find alternative! - ! Consider just assigning nind and fpcgrid for newly - ! established pfts instead of entering the circular procedure - ! outlined in the paragraph above - leafcmax(p) = 1._r8 - if (dstemc(p) <= 0._r8) dstemc(p) = 0.1_r8 - - end if ! conditions required for establishment - end if ! conditions required for establishment - end if ! if soil - - ! Case 3 -- some pfts continue to exist (no change) and some pfts - ! continue to not exist (no change). Do nothing for this case. - - end do - - ! Sapling and grass establishment - ! Calculate total woody FPC, FPC increment and grass cover (= crown area) - ! Calculate total woody FPC and number of woody PFTs present and able to establish - - do p = lbp, ubp - g = pgridcell(p) - if (present(p)) then - if (woody(ivt(p)) == 1._r8) then - fpc_tree_total(g) = fpc_tree_total(g) + fpcgrid(p) - if (estab(p)) npft_estab(g) = npft_estab(g) + 1 - else if (woody(ivt(p)) < 1._r8 .and. ivt(p) > noveg) then !grass - ngrass(g) = ngrass(g) + 1 - end if - end if - end do - - ! Above grid-level establishment counters are required for the next steps. - - do p = lbp, ubp - g = pgridcell(p) - - if (present(p) .and. woody(ivt(p)) == 1._r8 .and. estab(p)) then - - ! Calculate establishment rate over available space, per tree PFT - ! Max establishment rate reduced by shading as tree FPC approaches 1 - ! Total establishment rate partitioned equally among regenerating woody PFTs - - estab_rate = estab_max * (1._r8-exp(5._r8*(fpc_tree_total(g)-1._r8))) / real(npft_estab(g)) - - ! Calculate grid-level establishment rate per woody PFT - ! Space available for woody PFT establishment is fraction of grid cell - ! not currently occupied by woody PFTs - - estab_grid = estab_rate * (1._r8-fpc_tree_total(g)) - - ! Add new saplings to current population - - nind(p) = nind(p) + estab_grid - - !slevis: lpj's lm_ind was the max leaf mass for the year; - !now lm_ind is the max leaf mass for the year calculated in CNFire - !except when a pft is newly established (nind==0); then lm_ind - !is assigned a leafcmax above - - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) ! nind>0 for sure - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 pft area - ! stemdiam derived here from cn's formula for htop found in - ! CNVegStructUpdate and cn's assumption stemdiam=2*htop/taper - ! this derivation neglects upper htop limit enforced elsewhere - stemdiam = (24._r8 * dstemc(p) / (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) - else - stemdiam = 0._r8 - end if - ! Eqn D (now also in Light; need here for 1st yr when pfts haven't established, yet) - crownarea(p) = min(crownarea_max(ivt(p)), allom1(ivt(p))*stemdiam**reinickerp(ivt(p))) - - ! Update LAI and FPC - - if (crownarea(p) > 0._r8) then - if (dsladlai(ivt(p)) > 0._r8) then - ! make lai_ind >= 0.001 to avoid killing plants at this stage - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else ! currently redundant because dsladlai=0 for grasses only - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) ! lpj's formula - end if - else - lai_ind = 0._r8 - end if - - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - - end if ! add new saplings block - if (present(p) .and. woody(ivt(p)) == 1._r8) then - fpc_total_new(g) = fpc_total_new(g) + fpcgrid(p) - end if - end do ! close loop to update fpc_total_new - - ! Adjustments- don't allow trees to exceed 95% of vegetated landunit - - do p = lbp, ubp - g = pgridcell(p) - if (fpc_total_new(g) > 0.95_r8) then - if (woody(ivt(p)) == 1._r8 .and. present(p)) then - nind(p) = nind(p) * 0.95_r8 / fpc_total_new(g) - fpcgrid(p) = fpcgrid(p) * 0.95_r8 / fpc_total_new(g) - end if - fpc_total(g) = 0.95_r8 - - else - fpc_total(g) = fpc_total_new(g) - end if - end do - - ! Section for grasses. Grasses can establish in non-vegetated areas - - do p = lbp, ubp - g = pgridcell(p) - if (present(p) .and. woody(ivt(p)) < 1._r8) then - if (leafcmax(p) <= 0._r8 .or. fpcgrid(p) <= 0._r8 ) then - present(p) = .false. - nind(p) = 0._r8 - else - nind(p) = 1._r8 ! in case these grasses just established - crownarea(p) = 1._r8 - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - if (dsladlai(ivt(p)) > 0._r8) then - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else ! 'if' is currently redundant b/c dsladlai=0 for grasses only - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) - end if - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - fpc_total(g) = fpc_total(g) + fpcgrid(p) - end if - end if - end do ! end of pft-loop - - ! Adjustment of fpc_total > 1 due to grasses (ivt >= nc3_arctic_grass) - - do p = lbp, ubp - g = pgridcell(p) - - if (fpc_total(g) > 1._r8) then - if (ivt(p) >= nc3_arctic_grass .and. fpcgrid(p) > 0._r8) then - fpcgridtemp = fpcgrid(p) - fpcgrid(p) = max(0._r8, fpcgrid(p) - (fpc_total(g)-1._r8)) - fpc_total(g) = fpc_total(g) - fpcgridtemp + fpcgrid(p) - end if - end if - - ! Remove tiny fpcgrid amounts - - if (fpcgrid(p) < 1.e-15_r8) then - fpc_total(g) = fpc_total(g) - fpcgrid(p) - fpcgrid(p) = 0._r8 - present(p) = .false. - nind(p) = 0._r8 - end if - - ! Set the fpcgrid for bare ground if there is bare ground in - ! vegetated landunit and pft is bare ground so that everything - ! can add up to one. - - if (fpc_total(g) < 1._r8 .and. ivt(p) == noveg) then - fpcgrid(p) = 1._r8 - fpc_total(g) - fpc_total(g) = fpc_total(g) + fpcgrid(p) - end if - - end do - - ! Annual calculations used hourly in GapMortality - ! Ultimately may wish to place in separate subroutine... - - do p = lbp, ubp - g = pgridcell(p) - - ! Stress mortality from lpj's subr Mortality - - if (woody(ivt(p)) == 1._r8 .and. nind(p) > 0._r8 .and. & - leafcmax(p) > 0._r8 .and. fpcgrid(p) > 0._r8) then - - if (twmax(ivt(p)) < 999._r8) then - heatstress(p) = max(0._r8, min(1._r8, agddtw(p) / ramp_agddtw)) - else - heatstress(p) = 0._r8 - end if - - ! Net individual living biomass increment - ! NB: lpj's turnover not exactly same as cn's litfall: - ! lpj's sap->heartwood turnover not included in litfall (slevis) - - bm_delta = max(0._r8, annsum_npp(p) - annsum_litfall(p)) - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - - ! Growth efficiency (net biomass increment per unit leaf area) - - if (dsladlai(ivt(p)) > 0._r8) then - greffic(p) = bm_delta / (max(0.001_r8, & - ( ( exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) & - - slatop(ivt(p)) ) / dsladlai(ivt(p)) ))) - else ! currently redundant because dsladlai=0 for grasses only - greffic(p) = bm_delta / (lm_ind * slatop(ivt(p))) - end if - else - greffic(p) = 0. - heatstress(p) = 0. - end if - - end do - - ! Check for error in establishment - fn = 0 - do g = lbg, ubg - if (abs(fpc_total(g) - 1._r8) > 1.e-6) then - fn = fn + 1 - filterg(fn) = g - end if - end do - ! Just print out the first error - if (fn > 0) then - g = filterg(1) - write(iulog,*) 'Error in Establishment: fpc_total =',fpc_total(g), ' at gridcell ',g - call endrun - end if - - end subroutine Establishment - -end module CNDVEstablishmentMod diff --git a/src_clm40/biogeochem/CNDVLightMod.F90 b/src_clm40/biogeochem/CNDVLightMod.F90 deleted file mode 100644 index 734e49cd8a..0000000000 --- a/src_clm40/biogeochem/CNDVLightMod.F90 +++ /dev/null @@ -1,273 +0,0 @@ -module CNDVLightMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: LightMod -! -! !DESCRIPTION: -! Calculate light competition -! Update fpc for establishment routine -! Called once per year -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_const_mod, only : SHR_CONST_PI -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Light -! -! !REVISION HISTORY: -! Module created by Sam Levis following DGVMLightMod by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Light -! -! !INTERFACE: - subroutine Light(lbg, ubg, lbp, ubp, num_natvegp, filter_natvegp) -! -! !DESCRIPTION: -! Calculate light competition -! Update fpc for establishment routine -! Called once per year -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbg, ubg ! gridcell bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_natvegp ! number of naturally-vegetated pfts in filter - integer, intent(in) :: filter_natvegp(ubp-lbp+1) ! pft filter for naturally-vegetated points -! -! !CALLED FROM: -! subroutine dv in module CNDVMod -! -! !REVISION HISTORY: -! Author: Sam Levis (adapted from Stephen Sitch's LPJ subroutine light) -! 3/4/02, Peter Thornton: Migrated to new data structures. -! 2005.10: Sam Levis updated to work with CN -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pgridcell(:) ! gridcell index of corresponding pft - integer , pointer :: tree(:) ! ecophys const - tree pft or not - real(r8), pointer :: slatop(:) !specific leaf area at top of canopy, projected area basis [m^2/gC] - real(r8), pointer :: dsladlai(:) !dSLA/dLAI, projected area basis [m^2/gC] - real(r8), pointer :: woody(:) ! ecophys const - woody pft or not - real(r8), pointer :: leafcmax(:) ! (gC/m2) leaf C storage - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: dwood(:) ! ecophys const - wood density (gC/m3) - real(r8), pointer :: reinickerp(:) ! ecophys const - parameter in allomet - real(r8), pointer :: crownarea_max(:) ! ecophys const - tree maximum crown a - real(r8), pointer :: allom1(:) ! ecophys const - parameter in allomet - -! local pointers to implicit inout arguments -! - real(r8), pointer :: crownarea(:) ! area that each individual tree takes up (m^2) - real(r8), pointer :: fpcgrid(:) ! foliar projective cover on gridcell (fraction) - real(r8), pointer :: nind(:) ! number of individuals -! -!EOP -! -! !OTHER LOCAL VARIABLES: - real(r8), parameter :: fpc_tree_max = 0.95_r8 !maximum total tree FPC - integer :: p,fp, g ! indices - real(r8) :: fpc_tree_total(lbg:ubg) - real(r8) :: fpc_inc_tree(lbg:ubg) - real(r8) :: fpc_inc(lbp:ubp) ! foliar projective cover increment (fraction) - real(r8) :: fpc_grass_total(lbg:ubg) - real(r8) :: fpc_shrub_total(lbg:ubg) - real(r8) :: fpc_grass_max(lbg:ubg) - real(r8) :: fpc_shrub_max(lbg:ubg) - integer :: numtrees(lbg:ubg) - real(r8) :: excess - real(r8) :: nind_kill - real(r8) :: lai_ind - real(r8) :: fpc_ind - real(r8) :: fpcgrid_old - real(r8) :: lm_ind !leaf carbon (gC/individual) - real(r8) :: stemdiam ! stem diameter - real(r8) :: stocking ! #stems / ha (stocking density) - real(r8) :: taper ! ratio of height:radius_breast_height (tree allometry) - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type scalar members - - ivt => pft%itype - pgridcell => pft%gridcell - nind => pdgvs%nind - fpcgrid => pdgvs%fpcgrid - leafcmax => pcs%leafcmax - deadstemc => pcs%deadstemc - crownarea => pdgvs%crownarea - crownarea_max => dgv_pftcon%crownarea_max - reinickerp => dgv_pftcon%reinickerp - allom1 => dgv_pftcon%allom1 - dwood => pftcon%dwood - slatop => pftcon%slatop - dsladlai => pftcon%dsladlai - woody => pftcon%woody - tree => pftcon%tree - - taper = 200._r8 ! make a global constant; used in Establishment + ? - - ! Initialize gridcell-level metrics - - do g = lbg, ubg - fpc_tree_total(g) = 0._r8 - fpc_inc_tree(g) = 0._r8 - fpc_grass_total(g) = 0._r8 - fpc_shrub_total(g) = 0._r8 - numtrees(g) = 0 - end do - - do fp = 1,num_natvegp - p = filter_natvegp(fp) - g = pgridcell(p) - - ! Update LAI and FPC as in the last lines of DGVMAllocation - - if (woody(ivt(p))==1._r8) then - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 pft area - ! stemdiam derived here from cn's formula for htop found in - ! CNVegStructUpdate and cn's assumption stemdiam=2*htop/taper - ! this derivation neglects upper htop limit enforced elsewhere - stemdiam = (24._r8 * deadstemc(p) / (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) - else - stemdiam = 0._r8 - end if - crownarea(p) = min(crownarea_max(ivt(p)), allom1(ivt(p))*stemdiam**reinickerp(ivt(p))) ! Eqn D (from Establishment) -! else ! crownarea is 1 and does not need updating - end if - - if (crownarea(p) > 0._r8 .and. nind(p) > 0._r8) then - lm_ind = leafcmax(p) * fpcgrid(p) / nind(p) - if (dsladlai(ivt(p)) > 0._r8) then - lai_ind = max(0.001_r8,((exp(lm_ind*dsladlai(ivt(p)) + log(slatop(ivt(p)))) - & - slatop(ivt(p)))/dsladlai(ivt(p))) / crownarea(p)) - else - lai_ind = lm_ind * slatop(ivt(p)) / crownarea(p) - end if - else - lai_ind = 0._r8 - end if - - fpc_ind = 1._r8 - exp(-0.5_r8*lai_ind) - fpcgrid_old = fpcgrid(p) - fpcgrid(p) = crownarea(p) * nind(p) * fpc_ind - fpc_inc(p) = max(0._r8, fpcgrid(p) - fpcgrid_old) - - if (woody(ivt(p)) == 1._r8) then - if (tree(ivt(p)) == 1) then - numtrees(g) = numtrees(g) + 1 - fpc_tree_total(g) = fpc_tree_total(g) + fpcgrid(p) - fpc_inc_tree(g) = fpc_inc_tree(g) + fpc_inc(p) - else ! if shrubs - fpc_shrub_total(g) = fpc_shrub_total(g) + fpcgrid(p) - end if - else ! if grass - fpc_grass_total(g) = fpc_grass_total(g) + fpcgrid(p) - end if - end do - - do g = lbg, ubg - fpc_grass_max(g) = 1._r8 - min(fpc_tree_total(g), fpc_tree_max) - fpc_shrub_max(g) = max(0._r8, fpc_grass_max(g) - fpc_grass_total(g)) - end do - - ! The gridcell level metrics are now in place; continue... - ! slevis replaced the previous code that updated pfpcgrid - ! with a simpler way of doing so: - ! fpcgrid(p) = fpcgrid(p) - excess - ! Later we may wish to update this subroutine - ! according to Strassmann's recommendations (see relevant pdf) - - do fp = 1,num_natvegp - p = filter_natvegp(fp) - g = pgridcell(p) - - ! light competition - - if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==1._r8) then - - if (fpc_tree_total(g) > fpc_tree_max) then - - if (fpc_inc_tree(g) > 0._r8) then - excess = (fpc_tree_total(g) - fpc_tree_max) * & - fpc_inc(p) / fpc_inc_tree(g) - else - excess = (fpc_tree_total(g) - fpc_tree_max) / & - real(numtrees(g)) - end if - - ! Reduce individual density (and thereby gridcell-level biomass) - ! so that total tree FPC reduced to 'fpc_tree_max' - - if (fpcgrid(p) > 0._r8) then - nind_kill = nind(p) * excess / fpcgrid(p) - nind(p) = max(0._r8, nind(p) - nind_kill) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - else - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - - ! Transfer lost biomass to litter - - end if ! if tree cover exceeds max allowed - else if (woody(ivt(p))==0._r8) then ! grass - - if (fpc_grass_total(g) > fpc_grass_max(g)) then - - ! grass competes with itself if total fpc exceeds 1 - - excess = (fpc_grass_total(g) - fpc_grass_max(g)) * fpcgrid(p) / fpc_grass_total(g) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - - end if - - else if (woody(ivt(p))==1._r8 .and. tree(ivt(p))==0._r8) then ! shrub - - if (fpc_shrub_total(g) > fpc_shrub_max(g)) then - - excess = 1._r8 - fpc_shrub_max(g) / fpc_shrub_total(g) - - ! Reduce individual density (and thereby gridcell-level biomass) - ! so that total shrub FPC reduced to fpc_shrub_max(g) - - if (fpcgrid(p) > 0._r8) then - nind_kill = nind(p) * excess / fpcgrid(p) - nind(p) = max(0._r8, nind(p) - nind_kill) - fpcgrid(p) = max(0._r8, fpcgrid(p) - excess) - else - nind(p) = 0._r8 - fpcgrid(p) = 0._r8 - end if - - end if - - end if ! end of if-tree - - end do - - end subroutine Light - -end module CNDVLightMod diff --git a/src_clm40/biogeochem/CNDVMod.F90 b/src_clm40/biogeochem/CNDVMod.F90 deleted file mode 100644 index 9db9dd3f18..0000000000 --- a/src_clm40/biogeochem/CNDVMod.F90 +++ /dev/null @@ -1,558 +0,0 @@ -module CNDVMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNDVMod -! -! !DESCRIPTION: -! Module containing routines to drive the annual dynamic vegetation -! that works with CN, reset related variables, -! and initialize/reset time invariant variables -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use abortutils , only : endrun - use CNVegStructUpdateMod, only : CNVegStructUpdate -! -! !PUBLIC TYPES: - implicit none - private - save -! -! !PUBLIC MEMBER FUNCTIONS: - public dv ! Drives the annual dynamic vegetation that - ! works with CN - public histCNDV ! Output CNDV history file -! -! !REVISION HISTORY: -! Module modified by Sam Levis from similar module DGVMMod -! created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: dv -! -! !INTERFACE: - subroutine dv(lbg, ubg, lbp, ubp, num_natvegp, filter_natvegp, kyr) -! -! !DESCRIPTION: -! Drives the annual dynamic vegetation that works with CN -! -! !USES: - use clmtype - use CNDVLightMod , only : Light - use CNDVEstablishmentMod, only : Establishment -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbg, ubg ! gridcell bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(inout) :: num_natvegp ! number of naturally-vegetated - ! pfts in filter - integer, intent(inout) :: filter_natvegp(ubp-lbp+1) ! filter for - ! naturally-vegetated pfts - integer, intent(in) :: kyr ! used in routine climate20 below -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Sam Levis -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: mxy(:) ! pft m index (for laixy(i,j,m),etc.) - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - real(r8), pointer :: fpcgrid(:) ! foliar projective cover on gridcell (fraction) - real(r8), pointer :: agdd(:) ! accumulated growing degree days above 5 - real(r8), pointer :: t_mo_min(:) ! annual min of t_mo (Kelvin) -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: tmomin20(:) ! 20-yr running mean of tmomin - real(r8), pointer :: agdd20(:) ! 20-yr running mean of agdd -! -!EOP -! -! !LOCAL VARIABLES: - integer :: g,p ! indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (gridcell-level) - - agdd20 => gdgvs%agdd20 - tmomin20 => gdgvs%tmomin20 - - ! Assign local pointers to derived type members (pft-level) - - mxy => pft%mxy - pgridcell => pft%gridcell - fpcgrid => pdgvs%fpcgrid - t_mo_min => pdgvs%t_mo_min - agdd => pdgvs%agdd - - ! ************************************************************************* - ! S. Levis version of LPJ's routine climate20: 'Returns' tmomin20 & agdd20 - ! for use in routine bioclim, which I have placed in routine Establishment - ! Instead of 20-yr running mean of coldest monthly temperature, - ! use 20-yr running mean of minimum 10-day running mean - ! ************************************************************************* - - do p = lbp,ubp - g = pgridcell(p) - if (kyr == 2) then ! slevis: add ".and. start_type==arb_ic" here? - tmomin20(g) = t_mo_min(p) ! NO, b/c want to be able to start dgvm - agdd20(g) = agdd(p) ! w/ clmi file from non-dgvm simulation - end if - tmomin20(g) = (19._r8 * tmomin20(g) + t_mo_min(p)) / 20._r8 - agdd20(g) = (19._r8 * agdd20(g) + agdd(p) ) / 20._r8 - end do - - ! Rebuild filter of present natually-vegetated pfts after Kill() - - call BuildNatVegFilter(lbp, ubp, num_natvegp, filter_natvegp) - - ! Returns fpcgrid and nind - - call Light(lbg, ubg, lbp, ubp, num_natvegp, filter_natvegp) - - ! Returns updated fpcgrid, nind, crownarea, and present. Due to updated - ! present, we do not use the natveg filter in this subroutine. - - call Establishment(lbg, ubg, lbp, ubp) - - ! Reset dgvm variables needed in next yr (too few to keep subr. dvreset) - - do p = lbp,ubp - pcs%leafcmax(p) = 0._r8 - pdgvs%t_mo_min(p) = 1.0e+36_r8 - end do - end subroutine dv - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: histCNDV -! -! !INTERFACE: - subroutine histCNDV() -! -! !DESCRIPTION: -! Create CNDV history file -! -! !USES: - use clmtype - use decompMod , only : get_proc_bounds, get_proc_global - use clm_varpar , only : maxpatch_pft - use domainMod , only : ldomain - use clm_varctl , only : caseid, ctitle, finidat, fsurdat, fpftcon, iulog - use clm_varcon , only : spval - use clm_time_manager, only : get_ref_date, get_nstep, get_curr_date, get_curr_time - use fileutils , only : get_filename - use shr_sys_mod , only : shr_sys_getenv - use spmdMod , only : masterproc - use shr_const_mod , only : SHR_CONST_CDAY - use ncdio_pio -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Sam Levis -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - logical , pointer :: ifspecial(:) ! true=>landunit is not vegetated (landunit-level) - integer , pointer :: pgridcell(:) ! gridcell index of corresponding pft (pft-level) - integer , pointer :: plandunit(:) ! landunit index of corresponding pft (pft-level) - integer , pointer :: mxy(:) ! pft m index (for laixy(i,j,m),etc.) - real(r8), pointer :: fpcgrid(:) ! foliar projective cover on gridcell (fraction) - real(r8), pointer :: nind(:) ! number of individuals (#/m**2) -! -!EOP -! -! !LOCAL VARIABLES: - character(len=256) :: dgvm_fn ! dgvm history filename - type(file_desc_t) :: ncid ! netcdf file id - integer :: ncprec ! output precision - integer :: g,p,l ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: ier ! error status - integer :: mdcur, mscur, mcdate ! outputs from get_curr_time - integer :: yr,mon,day,mcsec ! outputs from get_curr_date - integer :: hours,minutes,secs ! hours,minutes,seconds of hh:mm:ss - integer :: nstep ! time step - integer :: nbsec ! seconds components of a date - integer :: dimid ! dimension, variable id - real(r8):: time ! current time - character(len=256) :: str ! temporary string - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len= 10) :: basedate ! base date (yyyymmdd) - character(len= 8) :: basesec ! base seconds - real(r8), pointer :: rbuf2dg(:,:) ! temporary - character(len=32) :: subname='histCNDV' -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (gridcell-level) - - ! NONE - - ! Assign local pointers to derived type members (landunit-level) - - ifspecial => lun%ifspecial - - ! Assign local pointers to derived subtypes components (pft-level) - - mxy => pft%mxy - pgridcell => pft%gridcell - plandunit => pft%landunit - fpcgrid => pdgvs%fpcgrid - nind => pdgvs%nind - - ! Determine subgrid bounds for this processor and allocate dynamic memory - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - allocate(rbuf2dg(begg:endg,maxpatch_pft), stat=ier) - if (ier /= 0) call endrun('histCNDV: allocation error for rbuf2dg') - - ! Set output precision - - ncprec = ncd_double - - ! ----------------------------------------------------------------------- - ! Create new netCDF file. File will be in define mode - ! ----------------------------------------------------------------------- - - dgvm_fn = set_dgvm_filename() - call ncd_pio_createfile(ncid, trim(dgvm_fn)) - - ! ----------------------------------------------------------------------- - ! Create global attributes. - ! ----------------------------------------------------------------------- - - str = 'CF1.0' - call ncd_putatt (ncid, ncd_global, 'conventions', trim(str)) - - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(ncid, ncd_global,'history', trim(str)) - - call shr_sys_getenv('LOGNAME', str, ier) - if (ier /= 0) call endrun('error: LOGNAME environment variable not defined') - - call ncd_putatt (ncid, ncd_global, 'logname', trim(str)) - - call shr_sys_getenv('HOST', str, ier) - call ncd_putatt (ncid, ncd_global, 'host', trim(str)) - - str = 'Community Land Model: CLM3' - call ncd_putatt (ncid, ncd_global, 'source', trim(str)) - - str = '$Name$' - call ncd_putatt (ncid, ncd_global, 'version', trim(str)) - - str = '$Id$' - call ncd_putatt (ncid, ncd_global, 'revision_id', trim(str)) - - str = ctitle - call ncd_putatt (ncid, ncd_global, 'case_title', trim(str)) - - str = caseid - call ncd_putatt (ncid, ncd_global, 'case_id', trim(str)) - - str = get_filename(fsurdat) - call ncd_putatt(ncid, ncd_global, 'Surface_dataset', trim(str)) - - str = 'arbitrary initialization' - if (finidat /= ' ') str = get_filename(finidat) - call ncd_putatt(ncid, ncd_global, 'Initial_conditions_dataset', trim(str)) - - str = get_filename(fpftcon) - call ncd_putatt(ncid, ncd_global, 'PFT_physiological_constants_dataset', trim(str)) - - ! ----------------------------------------------------------------------- - ! Define dimensions. - ! ----------------------------------------------------------------------- - - if (ldomain%isgrid2d) then - call ncd_defdim (ncid, 'lon' ,ldomain%ni, dimid) - call ncd_defdim (ncid, 'lat' ,ldomain%nj, dimid) - else - call ncd_defdim (ncid, 'gridcell', ldomain%ns, dimid) - end if - call ncd_defdim (ncid, 'pft' , maxpatch_pft , dimid) - call ncd_defdim (ncid, 'time', ncd_unlimited, dimid) - call ncd_defdim (ncid, 'string_length', 80 , dimid) - - ! ----------------------------------------------------------------------- - ! Define variables - ! ----------------------------------------------------------------------- - - ! Define coordinate variables (including time) - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='lon', xtype=ncprec, dim1name='lon', & - long_name='coordinate longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='lat', xtype=ncprec, dim1name='lat', & - long_name='coordinate latitude', units='degrees_north') - end if - - call get_curr_time(mdcur, mscur) - call get_ref_date(yr, mon, day, nbsec) - hours = nbsec / 3600 - minutes = (nbsec - hours*3600) / 60 - secs = (nbsec - hours*3600 - minutes*60) - write(basedate,80) yr,mon,day -80 format(i4.4,'-',i2.2,'-',i2.2) - write(basesec ,90) hours, minutes, secs -90 format(i2.2,':',i2.2,':',i2.2) - str = 'days since ' // basedate // " " // basesec - time = mdcur + mscur/SHR_CONST_CDAY - - call ncd_defvar(ncid=ncid, varname='time', xtype=ncd_double, dim1name='time', & - long_name='time', units=str) - - ! Define surface grid (coordinate variables, latitude, longitude, surface type). - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='longxy', xtype=ncprec, & - dim1name='lon', dim2name='lat', & - long_name='longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='latixy', xtype=ncprec, & - dim1name='lon', dim2name='lat', & - long_name='latitude', units='degrees_north') - - call ncd_defvar(ncid=ncid, varname='landmask', xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='land/ocean mask (0.=ocean and 1.=land)') - else - call ncd_defvar(ncid=ncid, varname='longxy', xtype=ncprec, & - dim1name='gridcell',& - long_name='longitude', units='degrees_east') - - call ncd_defvar(ncid=ncid, varname='latixy', xtype=ncprec, & - dim1name='gridcell',& - long_name='latitude', units='degrees_north') - - call ncd_defvar(ncid=ncid, varname='landmask', xtype=ncd_int, & - dim1name='gridcell', & - long_name='land/ocean mask (0.=ocean and 1.=land)') - end if - - ! Define time information - - call ncd_defvar(ncid=ncid, varname='mcdate', xtype=ncd_int, dim1name='time',& - long_name='current date (YYYYMMDD)') - - call ncd_defvar(ncid=ncid, varname='mcsec', xtype=ncd_int, dim1name='time',& - long_name='current seconds of current date', units='s') - - call ncd_defvar(ncid=ncid, varname='mdcur', xtype=ncd_int, dim1name='time',& - long_name='current day (from base day)') - - call ncd_defvar(ncid=ncid, varname='mscur', xtype=ncd_int, dim1name='time',& - long_name='current seconds of current day', units='s') - - call ncd_defvar(ncid=ncid, varname='nstep', xtype=ncd_int, dim1name='time',& - long_name='time step', units='s') - - ! Define time dependent variables - - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=ncid, varname='FPCGRID', xtype=ncprec, & - dim1name='lon', dim2name='lat', dim3name='pft', dim4name='time', & - long_name='plant functional type cover', units='fraction of vegetated area', & - missing_value=spval, fill_value=spval) - - call ncd_defvar(ncid=ncid, varname='NIND', xtype=ncprec, & - dim1name='lon', dim2name='lat', dim3name='pft', dim4name='time', & - long_name='number of individuals', units='individuals/m2 vegetated land', & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=ncid, varname='FPCGRID', xtype=ncprec, & - dim1name='gridcell', dim2name='pft', dim3name='time', & - long_name='plant functional type cover', units='fraction of vegetated area', & - missing_value=spval, fill_value=spval) - - call ncd_defvar(ncid=ncid, varname='NIND', xtype=ncprec, & - dim1name='gridcell', dim2name='pft', dim3name='time', & - long_name='number of individuals', units='individuals/m2 vegetated land', & - missing_value=spval, fill_value=spval) - end if - - call ncd_enddef(ncid) - - ! ----------------------------------------------------------------------- - ! Write variables - ! ----------------------------------------------------------------------- - - ! Write surface grid (coordinate variables, latitude, longitude, surface type). - - call ncd_io(ncid=ncid, varname='longxy' , data=ldomain%lonc, flag='write', & - dim1name=grlnd) - call ncd_io(ncid=ncid, varname='latixy' , data=ldomain%latc, flag='write', & - dim1name=grlnd) - call ncd_io(ncid=ncid, varname='landmask', data=ldomain%mask, flag='write', & - dim1name=grlnd) - - ! Write current date, current seconds, current day, current nstep - - call get_curr_date(yr, mon, day, mcsec) - mcdate = yr*10000 + mon*100 + day - nstep = get_nstep() - - call ncd_io(ncid=ncid, varname='mcdate', data=mcdate, nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mcsec' , data=mcsec , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mdcur' , data=mdcur , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='mscur' , data=mcsec , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='nstep' , data=nstep , nt=1, flag='write') - call ncd_io(ncid=ncid, varname='time' , data=time , nt=1, flag='write') - - ! Write time dependent variables to CNDV history file - - ! The if .not. ifspecial statment below guarantees that the m index will - ! always lie between 1 and maxpatch_pft - - rbuf2dg(:,:) = 0._r8 - do p = begp,endp - g = pgridcell(p) - l = plandunit(p) - if (.not. ifspecial(l)) rbuf2dg(g,mxy(p)) = fpcgrid(p)*100._r8 - end do - call ncd_io(ncid=ncid, varname='FPCGRID', dim1name=grlnd, data=rbuf2dg, & - nt=1, flag='write') - - rbuf2dg(:,:) = 0._r8 - do p = begp,endp - g = pgridcell(p) - l = plandunit(p) - if (.not. ifspecial(l)) rbuf2dg(g,mxy(p)) = nind(p) - end do - call ncd_io(ncid=ncid, varname='NIND', dim1name=grlnd, data=rbuf2dg, & - nt=1, flag='write') - - ! Deallocate dynamic memory - - deallocate(rbuf2dg) - - !------------------------------------------------------------------ - ! Close and archive netcdf CNDV history file - !------------------------------------------------------------------ - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*)'(histCNDV): Finished writing CNDV history dataset ',& - trim(dgvm_fn), 'at nstep = ',get_nstep() - end if - - end subroutine histCNDV - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: set_dgvm_filename -! -! !INTERFACE: - character(len=256) function set_dgvm_filename () -! -! !DESCRIPTION: -! Determine initial dataset filenames -! -! !USES: - use clm_varctl , only : caseid, inst_suffix - use clm_time_manager , only : get_curr_date -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -! -! !LOCAL VARIABLES: - character(len=256) :: cdate !date char string - integer :: day !day (1 -> 31) - integer :: mon !month (1 -> 12) - integer :: yr !year (0 -> ...) - integer :: sec !seconds into current day -!----------------------------------------------------------------------- - - call get_curr_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec - set_dgvm_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".hv."//trim(cdate)//".nc" - - end function set_dgvm_filename - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BuildNatVegFilter -! -! !INTERFACE: - subroutine BuildNatVegFilter(lbp, ubp, num_natvegp, filter_natvegp) -! -! !DESCRIPTION: -! Reconstruct a filter of naturally-vegetated PFTs for use in DGVM -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(out) :: num_natvegp ! number of pfts in naturally-vegetated filter - integer, intent(out) :: filter_natvegp(ubp-lbp+1) ! pft filter for naturally-vegetated points -! -! !CALLED FROM: -! subroutine lpj in this module -! -! !REVISION HISTORY: -! Author: Forrest Hoffman -! -! !LOCAL VARIABLES: -! local pointers to implicit in arguments - logical , pointer :: present(:) ! whether this pft present in patch -!EOP -! -! !LOCAL VARIABLES: - integer :: p -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (pft-level) - present => pdgvs%present - - num_natvegp = 0 - do p = lbp,ubp - if (present(p)) then - num_natvegp = num_natvegp + 1 - filter_natvegp(num_natvegp) = p - end if - end do - - end subroutine BuildNatVegFilter - -end module CNDVMod diff --git a/src_clm40/biogeochem/CNDecompMod.F90 b/src_clm40/biogeochem/CNDecompMod.F90 deleted file mode 100644 index 8ae328bb13..0000000000 --- a/src_clm40/biogeochem/CNDecompMod.F90 +++ /dev/null @@ -1,674 +0,0 @@ -module CNDecompMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNDecompMod -! -! !DESCRIPTION: -! Module holding routines used in litter and soil decomposition model -! for coupled carbon-nitrogen code. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CNDecompAlloc -! -! !REVISION HISTORY: -! 8/15/03: Created by Peter Thornton -! 10/23/03, Peter Thornton: migrated to vector data structures -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNDecompAlloc -! -! !INTERFACE: -subroutine CNDecompAlloc (lbp, ubp, lbc, ubc, num_soilc, filter_soilc, & - num_soilp, filter_soilp, num_pcropp) -! -! !DESCRIPTION: -! -! !USES: - use clmtype - use CNAllocationMod , only: CNAllocation - use clm_time_manager, only: get_step_size - use pft2colMod , only: p2c - use clm_varcon , only: secspday - use clm_varctl , only: use_ad_spinup -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - integer, intent(in) :: num_pcropp ! number of pfts in prognostic crop filter -! -! !CALLED FROM: -! subroutine CNEcosystemDyn in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 8/15/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - ! column level - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: psisat(:,:) ! soil water potential at saturation for CN code (MPa) - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) - real(r8), pointer :: dz(:,:) ! soil layer thickness (m) - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - integer, pointer :: clandunit(:) ! index into landunit level quantities - integer , pointer :: itypelun(:) ! landunit type - ! pft level - real(r8), pointer :: rootfr(:,:) ! fraction of roots in each soil layer (nlevgrnd) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: fpi(:) ! fraction of potential immobilization (no units) - real(r8), pointer :: cwdc_to_litr2c(:) - real(r8), pointer :: cwdc_to_litr3c(:) - real(r8), pointer :: litr1_hr(:) - real(r8), pointer :: litr1c_to_soil1c(:) - real(r8), pointer :: litr2_hr(:) - real(r8), pointer :: litr2c_to_soil2c(:) - real(r8), pointer :: litr3_hr(:) - real(r8), pointer :: litr3c_to_soil3c(:) - real(r8), pointer :: soil1_hr(:) - real(r8), pointer :: soil1c_to_soil2c(:) - real(r8), pointer :: soil2_hr(:) - real(r8), pointer :: soil2c_to_soil3c(:) - real(r8), pointer :: soil3_hr(:) - real(r8), pointer :: soil3c_to_soil4c(:) - real(r8), pointer :: soil4_hr(:) - real(r8), pointer :: cwdn_to_litr2n(:) - real(r8), pointer :: cwdn_to_litr3n(:) - real(r8), pointer :: potential_immob(:) - real(r8), pointer :: litr1n_to_soil1n(:) - real(r8), pointer :: sminn_to_soil1n_l1(:) - real(r8), pointer :: litr2n_to_soil2n(:) - real(r8), pointer :: sminn_to_soil2n_l2(:) - real(r8), pointer :: litr3n_to_soil3n(:) - real(r8), pointer :: sminn_to_soil3n_l3(:) - real(r8), pointer :: soil1n_to_soil2n(:) - real(r8), pointer :: sminn_to_soil2n_s1(:) - real(r8), pointer :: soil2n_to_soil3n(:) - real(r8), pointer :: sminn_to_soil3n_s2(:) - real(r8), pointer :: soil3n_to_soil4n(:) - real(r8), pointer :: sminn_to_soil4n_s3(:) - real(r8), pointer :: soil4n_to_sminn(:) - real(r8), pointer :: sminn_to_denit_l1s1(:) - real(r8), pointer :: sminn_to_denit_l2s2(:) - real(r8), pointer :: sminn_to_denit_l3s3(:) - real(r8), pointer :: sminn_to_denit_s1s2(:) - real(r8), pointer :: sminn_to_denit_s2s3(:) - real(r8), pointer :: sminn_to_denit_s3s4(:) - real(r8), pointer :: sminn_to_denit_s4(:) - real(r8), pointer :: sminn_to_denit_excess(:) - real(r8), pointer :: gross_nmin(:) - real(r8), pointer :: net_nmin(:) -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: c,j !indices - integer :: fc !lake filter column index - real(r8):: dt !decomp timestep (seconds) - real(r8):: dtd !decomp timestep (days) - real(r8), pointer:: fr(:,:) !column-level rooting fraction by soil depth - real(r8):: frw(lbc:ubc) !rooting fraction weight - real(r8):: t_scalar(lbc:ubc) !soil temperature scalar for decomp - real(r8):: minpsi, maxpsi !limits for soil water scalar for decomp - real(r8):: psi !temporary soilpsi for water scalar - real(r8):: w_scalar(lbc:ubc) !soil water scalar for decomp - real(r8):: rate_scalar !combined rate scalar for decomp - real(r8):: cn_l1(lbc:ubc) !C:N for litter 1 - real(r8):: cn_l2(lbc:ubc) !C:N for litter 2 - real(r8):: cn_l3(lbc:ubc) !C:N for litter 3 - real(r8):: cn_s1 !C:N for SOM 1 - real(r8):: cn_s2 !C:N for SOM 2 - real(r8):: cn_s3 !C:N for SOM 3 - real(r8):: cn_s4 !C:N for SOM 4 - real(r8):: rf_l1s1 !respiration fraction litter 1 -> SOM 1 - real(r8):: rf_l2s2 !respiration fraction litter 2 -> SOM 2 - real(r8):: rf_l3s3 !respiration fraction litter 3 -> SOM 3 - real(r8):: rf_s1s2 !respiration fraction SOM 1 -> SOM 2 - real(r8):: rf_s2s3 !respiration fraction SOM 2 -> SOM 3 - real(r8):: rf_s3s4 !respiration fraction SOM 3 -> SOM 4 - real(r8):: k_l1 !decomposition rate constant litter 1 - real(r8):: k_l2 !decomposition rate constant litter 2 - real(r8):: k_l3 !decomposition rate constant litter 3 - real(r8):: k_s1 !decomposition rate constant SOM 1 - real(r8):: k_s2 !decomposition rate constant SOM 2 - real(r8):: k_s3 !decomposition rate constant SOM 3 - real(r8):: k_s4 !decomposition rate constant SOM 3 - real(r8):: k_frag !fragmentation rate constant CWD - real(r8):: ck_l1 !corrected decomposition rate constant litter 1 - real(r8):: ck_l2 !corrected decomposition rate constant litter 2 - real(r8):: ck_l3 !corrected decomposition rate constant litter 3 - real(r8):: ck_s1 !corrected decomposition rate constant SOM 1 - real(r8):: ck_s2 !corrected decomposition rate constant SOM 2 - real(r8):: ck_s3 !corrected decomposition rate constant SOM 3 - real(r8):: ck_s4 !corrected decomposition rate constant SOM 3 - real(r8):: ck_frag !corrected fragmentation rate constant CWD - real(r8):: cwd_fcel !cellulose fraction of coarse woody debris - real(r8):: cwd_flig !lignin fraction of coarse woody debris - real(r8):: cwdc_loss !fragmentation rate for CWD carbon (gC/m2/s) - real(r8):: cwdn_loss !fragmentation rate for CWD nitrogen (gN/m2/s) - real(r8):: plitr1c_loss(lbc:ubc) !potential C loss from litter 1 - real(r8):: plitr2c_loss(lbc:ubc) !potential C loss from litter 2 - real(r8):: plitr3c_loss(lbc:ubc) !potential C loss from litter 3 - real(r8):: psoil1c_loss(lbc:ubc) !potential C loss from SOM 1 - real(r8):: psoil2c_loss(lbc:ubc) !potential C loss from SOM 2 - real(r8):: psoil3c_loss(lbc:ubc) !potential C loss from SOM 3 - real(r8):: psoil4c_loss(lbc:ubc) !potential C loss from SOM 4 - real(r8):: pmnf_l1s1(lbc:ubc) !potential mineral N flux, litter 1 -> SOM 1 - real(r8):: pmnf_l2s2(lbc:ubc) !potential mineral N flux, litter 2 -> SOM 2 - real(r8):: pmnf_l3s3(lbc:ubc) !potential mineral N flux, litter 3 -> SOM 3 - real(r8):: pmnf_s1s2(lbc:ubc) !potential mineral N flux, SOM 1 -> SOM 2 - real(r8):: pmnf_s2s3(lbc:ubc) !potential mineral N flux, SOM 2 -> SOM 3 - real(r8):: pmnf_s3s4(lbc:ubc) !potential mineral N flux, SOM 3 -> SOM 4 - real(r8):: pmnf_s4(lbc:ubc) !potential mineral N flux, SOM 4 - real(r8):: immob(lbc:ubc) !potential N immobilization - real(r8):: ratio !temporary variable - real(r8):: dnp !denitrification proportion - integer :: nlevdecomp ! bottom layer to consider for decomp controls - real(r8):: spinup_scalar !multiplier for AD_SPINUP algorithm -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays - t_soisno => ces%t_soisno - psisat => cps%psisat - soilpsi => cps%soilpsi - dz => cps%dz - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - soil1c => ccs%soil1c - soil2c => ccs%soil2c - soil3c => ccs%soil3c - soil4c => ccs%soil4c - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - fpi => cps%fpi - cwdc_to_litr2c => ccf%cwdc_to_litr2c - cwdc_to_litr3c => ccf%cwdc_to_litr3c - litr1_hr => ccf%litr1_hr - litr1c_to_soil1c => ccf%litr1c_to_soil1c - litr2_hr => ccf%litr2_hr - litr2c_to_soil2c => ccf%litr2c_to_soil2c - litr3_hr => ccf%litr3_hr - litr3c_to_soil3c => ccf%litr3c_to_soil3c - soil1_hr => ccf%soil1_hr - soil1c_to_soil2c => ccf%soil1c_to_soil2c - soil2_hr => ccf%soil2_hr - soil2c_to_soil3c => ccf%soil2c_to_soil3c - soil3_hr => ccf%soil3_hr - soil3c_to_soil4c => ccf%soil3c_to_soil4c - soil4_hr => ccf%soil4_hr - cwdn_to_litr2n => cnf%cwdn_to_litr2n - cwdn_to_litr3n => cnf%cwdn_to_litr3n - potential_immob => cnf%potential_immob - litr1n_to_soil1n => cnf%litr1n_to_soil1n - sminn_to_soil1n_l1 => cnf%sminn_to_soil1n_l1 - litr2n_to_soil2n => cnf%litr2n_to_soil2n - sminn_to_soil2n_l2 => cnf%sminn_to_soil2n_l2 - litr3n_to_soil3n => cnf%litr3n_to_soil3n - sminn_to_soil3n_l3 => cnf%sminn_to_soil3n_l3 - soil1n_to_soil2n => cnf%soil1n_to_soil2n - sminn_to_soil2n_s1 => cnf%sminn_to_soil2n_s1 - soil2n_to_soil3n => cnf%soil2n_to_soil3n - sminn_to_soil3n_s2 => cnf%sminn_to_soil3n_s2 - soil3n_to_soil4n => cnf%soil3n_to_soil4n - sminn_to_soil4n_s3 => cnf%sminn_to_soil4n_s3 - soil4n_to_sminn => cnf%soil4n_to_sminn - sminn_to_denit_l1s1 => cnf%sminn_to_denit_l1s1 - sminn_to_denit_l2s2 => cnf%sminn_to_denit_l2s2 - sminn_to_denit_l3s3 => cnf%sminn_to_denit_l3s3 - sminn_to_denit_s1s2 => cnf%sminn_to_denit_s1s2 - sminn_to_denit_s2s3 => cnf%sminn_to_denit_s2s3 - sminn_to_denit_s3s4 => cnf%sminn_to_denit_s3s4 - sminn_to_denit_s4 => cnf%sminn_to_denit_s4 - sminn_to_denit_excess => cnf%sminn_to_denit_excess - gross_nmin => cnf%gross_nmin - net_nmin => cnf%net_nmin - rootfr => pps%rootfr - clandunit => col%landunit - itypelun => lun%itype - - ! set time steps - dt = real( get_step_size(), r8 ) - dtd = dt/secspday - - ! set soil organic matter compartment C:N ratios (from Biome-BGC v4.2.0) - cn_s1 = 12.0_r8 - cn_s2 = 12.0_r8 - cn_s3 = 10.0_r8 - cn_s4 = 10.0_r8 - - ! set respiration fractions for fluxes between compartments - ! (from Biome-BGC v4.2.0) - rf_l1s1 = 0.39_r8 - rf_l2s2 = 0.55_r8 - rf_l3s3 = 0.29_r8 - rf_s1s2 = 0.28_r8 - rf_s2s3 = 0.46_r8 - rf_s3s4 = 0.55 - - ! set the cellulose and lignin fractions for coarse woody debris - cwd_fcel = 0.76_r8 - cwd_flig = 0.24_r8 - - ! set initial base rates for decomposition mass loss (1/day) - ! (from Biome-BGC v4.2.0, using three SOM pools) - ! Value inside log function is the discrete-time values for a - ! daily time step model, and the result of the log function is - ! the corresponding continuous-time decay rate (1/day), following - ! Olson, 1963. - k_l1 = -log(1.0_r8-0.7_r8) - k_l2 = -log(1.0_r8-0.07_r8) - k_l3 = -log(1.0_r8-0.014_r8) - k_s1 = -log(1.0_r8-0.07_r8) - k_s2 = -log(1.0_r8-0.014_r8) - k_s3 = -log(1.0_r8-0.0014_r8) - k_s4 = -log(1.0_r8-0.0001_r8) - k_frag = -log(1.0_r8-0.001_r8) - - ! calculate the new discrete-time decay rate for model timestep - k_l1 = 1.0_r8-exp(-k_l1*dtd) - k_l2 = 1.0_r8-exp(-k_l2*dtd) - k_l3 = 1.0_r8-exp(-k_l3*dtd) - k_s1 = 1.0_r8-exp(-k_s1*dtd) - k_s2 = 1.0_r8-exp(-k_s2*dtd) - k_s3 = 1.0_r8-exp(-k_s3*dtd) - k_s4 = 1.0_r8-exp(-k_s4*dtd) - k_frag = 1.0_r8-exp(-k_frag*dtd) - - ! The following code implements the acceleration part of the AD spinup - ! algorithm, by multiplying all of the SOM decomposition base rates by 10.0. - - if (use_ad_spinup) then - spinup_scalar = 20._r8 - k_s1 = k_s1 * spinup_scalar - k_s2 = k_s2 * spinup_scalar - k_s3 = k_s3 * spinup_scalar - k_s4 = k_s4 * spinup_scalar - end if - - ! calculate function to weight the temperature and water potential scalars - ! for decomposition control. - - - ! the following normalizes values in fr so that they - ! sum to 1.0 across top nlevdecomp levels on a column - frw(lbc:ubc) = 0._r8 - nlevdecomp=5 - allocate(fr(lbc:ubc,nlevdecomp)) - do j=1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - frw(c) = frw(c) + dz(c,j) - end do - end do - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if (frw(c) /= 0._r8) then - fr(c,j) = dz(c,j) / frw(c) - else - fr(c,j) = 0._r8 - end if - end do - end do - - ! calculate rate constant scalar for soil temperature - ! assuming that the base rate constants are assigned for non-moisture - ! limiting conditions at 25 C. - ! Peter Thornton: 3/13/09 - ! Replaced the Lloyd and Taylor function with a Q10 formula, with Q10 = 1.5 - ! as part of the modifications made to improve the seasonal cycle of - ! atmospheric CO2 concentration in global simulations. This does not impact - ! the base rates at 25 C, which are calibrated from microcosm studies. - t_scalar(:) = 0._r8 - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - t_scalar(c)=t_scalar(c) + (1.5**((t_soisno(c,j)-(SHR_CONST_TKFRZ+25._r8))/10._r8))*fr(c,j) - end do - end do - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - minpsi = -10.0_r8; - w_scalar(:) = 0._r8 - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - maxpsi = psisat(c,j) - psi = min(soilpsi(c,j),maxpsi) - ! decomp only if soilpsi is higher than minpsi - if (psi > minpsi) then - w_scalar(c) = w_scalar(c) + (log(minpsi/psi)/log(minpsi/maxpsi))*fr(c,j) - end if - end do - end do - - ! set initial values for potential C and N fluxes - plitr1c_loss(:) = 0._r8 - plitr2c_loss(:) = 0._r8 - plitr3c_loss(:) = 0._r8 - psoil1c_loss(:) = 0._r8 - psoil2c_loss(:) = 0._r8 - psoil3c_loss(:) = 0._r8 - psoil4c_loss(:) = 0._r8 - pmnf_l1s1(:) = 0._r8 - pmnf_l2s2(:) = 0._r8 - pmnf_l3s3(:) = 0._r8 - pmnf_s1s2(:) = 0._r8 - pmnf_s2s3(:) = 0._r8 - pmnf_s3s4(:) = 0._r8 - pmnf_s4(:) = 0._r8 - - ! column loop to calculate potential decomp rates and total immobilization - ! demand. - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate litter compartment C:N ratios - if (litr1n(c) > 0._r8) cn_l1(c) = litr1c(c)/litr1n(c) - if (litr2n(c) > 0._r8) cn_l2(c) = litr2c(c)/litr2n(c) - if (litr3n(c) > 0._r8) cn_l3(c) = litr3c(c)/litr3n(c) - - ! calculate the final rate scalar as the product of temperature and water - ! rate scalars, and correct the base decomp rates - - rate_scalar = t_scalar(c) * w_scalar(c) - ck_l1 = k_l1 * rate_scalar - ck_l2 = k_l2 * rate_scalar - ck_l3 = k_l3 * rate_scalar - ck_s1 = k_s1 * rate_scalar - ck_s2 = k_s2 * rate_scalar - ck_s3 = k_s3 * rate_scalar - ck_s4 = k_s4 * rate_scalar - ck_frag = k_frag * rate_scalar - - ! calculate the non-nitrogen-limited fluxes - ! these fluxes include the "/ dt" term to put them on a - ! per second basis, since the rate constants have been - ! calculated on a per timestep basis. - - ! CWD fragmentation -> litter pools - cwdc_loss = cwdc(c) * ck_frag / dt - cwdc_to_litr2c(c) = cwdc_loss * cwd_fcel - cwdc_to_litr3c(c) = cwdc_loss * cwd_flig - cwdn_loss = cwdn(c) * ck_frag / dt - cwdn_to_litr2n(c) = cwdn_loss * cwd_fcel - cwdn_to_litr3n(c) = cwdn_loss * cwd_flig - - ! litter 1 -> SOM 1 - if (litr1c(c) > 0._r8) then - plitr1c_loss(c) = litr1c(c) * ck_l1 / dt - ratio = 0._r8 - if (litr1n(c) > 0._r8) ratio = cn_s1/cn_l1(c) - pmnf_l1s1(c) = (plitr1c_loss(c) * (1.0_r8 - rf_l1s1 - ratio))/cn_s1 - end if - - ! litter 2 -> SOM 2 - if (litr2c(c) > 0._r8) then - plitr2c_loss(c) = litr2c(c) * ck_l2 / dt - ratio = 0._r8 - if (litr2n(c) > 0._r8) ratio = cn_s2/cn_l2(c) - pmnf_l2s2(c) = (plitr2c_loss(c) * (1.0_r8 - rf_l2s2 - ratio))/cn_s2 - end if - - ! litter 3 -> SOM 3 - if (litr3c(c) > 0._r8) then - plitr3c_loss(c) = litr3c(c) * ck_l3 / dt - ratio = 0._r8 - if (litr3n(c) > 0._r8) ratio = cn_s3/cn_l3(c) - pmnf_l3s3(c) = (plitr3c_loss(c) * (1.0_r8 - rf_l3s3 - ratio))/cn_s3 - end if - - ! SOM 1 -> SOM 2 - if (soil1c(c) > 0._r8) then - psoil1c_loss(c) = soil1c(c) * ck_s1 / dt - pmnf_s1s2(c) = (psoil1c_loss(c) * (1.0_r8 - rf_s1s2 - (cn_s2/cn_s1)))/cn_s2 - end if - - ! SOM 2 -> SOM 3 - if (soil2c(c) > 0._r8) then - psoil2c_loss(c) = soil2c(c) * ck_s2 / dt - pmnf_s2s3(c) = (psoil2c_loss(c) * (1.0_r8 - rf_s2s3 - (cn_s3/cn_s2)))/cn_s3 - end if - - ! SOM 3 -> SOM 4 - if (soil3c(c) > 0._r8) then - psoil3c_loss(c) = soil3c(c) * ck_s3 / dt - pmnf_s3s4(c) = (psoil3c_loss(c) * (1.0_r8 - rf_s3s4 - (cn_s4/cn_s3)))/cn_s4 - end if - - ! Loss from SOM 4 is entirely respiration (no downstream pool) - if (soil4c(c) > 0._r8) then - psoil4c_loss(c) = soil4c(c) * ck_s4 / dt - pmnf_s4(c) = -psoil4c_loss(c)/cn_s4 - end if - - ! Sum up all the potential immobilization fluxes (positive pmnf flux) - ! and all the mineralization fluxes (negative pmnf flux) - - immob(c) = 0._r8 - ! litter 1 -> SOM 1 - if (pmnf_l1s1(c) > 0._r8) then - immob(c) = immob(c) + pmnf_l1s1(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_l1s1(c) - end if - - ! litter 2 -> SOM 2 - if (pmnf_l2s2(c) > 0._r8) then - immob(c) = immob(c) + pmnf_l2s2(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_l2s2(c) - end if - - ! litter 3 -> SOM 3 - if (pmnf_l3s3(c) > 0._r8) then - immob(c) = immob(c) + pmnf_l3s3(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_l3s3(c) - end if - - ! SOM 1 -> SOM 2 - if (pmnf_s1s2(c) > 0._r8) then - immob(c) = immob(c) + pmnf_s1s2(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_s1s2(c) - end if - - ! SOM 2 -> SOM 3 - if (pmnf_s2s3(c) > 0._r8) then - immob(c) = immob(c) + pmnf_s2s3(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_s2s3(c) - end if - - ! SOM 3 -> SOM 4 - if (pmnf_s3s4(c) > 0._r8) then - immob(c) = immob(c) + pmnf_s3s4(c) - else - gross_nmin(c) = gross_nmin(c) - pmnf_s3s4(c) - end if - - ! SOM 4 - gross_nmin(c) = gross_nmin(c) - pmnf_s4(c) - - potential_immob(c) = immob(c) - - end do ! end column loop - - ! now that potential N immobilization is known, call allocation - ! to resolve the competition between plants and soil heterotrophs - ! for available soil mineral N resource. - - call CNAllocation(lbp, ubp, lbc,ubc,num_soilc,filter_soilc,num_soilp, & - filter_soilp, num_pcropp) - - ! column loop to calculate actual immobilization and decomp rates, following - ! resolution of plant/heterotroph competition for mineral N - - dnp = 0.01_r8 - - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! upon return from CNAllocation, the fraction of potential immobilization - ! has been set (cps%fpi). now finish the decomp calculations. - ! Only the immobilization steps are limited by fpi (pmnf > 0) - ! Also calculate denitrification losses as a simple proportion - ! of mineralization flux. - - ! litter 1 fluxes (labile pool) - if (litr1c(c) > 0._r8) then - if (pmnf_l1s1(c) > 0._r8) then - plitr1c_loss(c) = plitr1c_loss(c) * fpi(c) - pmnf_l1s1(c) = pmnf_l1s1(c) * fpi(c) - sminn_to_denit_l1s1(c) = 0._r8 - else - sminn_to_denit_l1s1(c) = -dnp * pmnf_l1s1(c) - end if - litr1_hr(c) = rf_l1s1 * plitr1c_loss(c) - litr1c_to_soil1c(c) = (1._r8 - rf_l1s1) * plitr1c_loss(c) - if (litr1n(c) > 0._r8) litr1n_to_soil1n(c) = plitr1c_loss(c) / cn_l1(c) - sminn_to_soil1n_l1(c) = pmnf_l1s1(c) - net_nmin(c) = net_nmin(c) - pmnf_l1s1(c) - end if - - ! litter 2 fluxes (cellulose pool) - if (litr2c(c) > 0._r8) then - if (pmnf_l2s2(c) > 0._r8) then - plitr2c_loss(c) = plitr2c_loss(c) * fpi(c) - pmnf_l2s2(c) = pmnf_l2s2(c) * fpi(c) - sminn_to_denit_l2s2(c) = 0._r8 - else - sminn_to_denit_l2s2(c) = -dnp * pmnf_l2s2(c) - end if - litr2_hr(c) = rf_l2s2 * plitr2c_loss(c) - litr2c_to_soil2c(c) = (1._r8 - rf_l2s2) * plitr2c_loss(c) - if (litr2n(c) > 0._r8) litr2n_to_soil2n(c) = plitr2c_loss(c) / cn_l2(c) - sminn_to_soil2n_l2(c) = pmnf_l2s2(c) - net_nmin(c) = net_nmin(c) - pmnf_l2s2(c) - end if - - ! litter 3 fluxes (lignin pool) - if (litr3c(c) > 0._r8) then - if (pmnf_l3s3(c) > 0._r8) then - plitr3c_loss(c) = plitr3c_loss(c) * fpi(c) - pmnf_l3s3(c) = pmnf_l3s3(c) * fpi(c) - sminn_to_denit_l3s3(c) = 0._r8 - else - sminn_to_denit_l3s3(c) = -dnp * pmnf_l3s3(c) - end if - litr3_hr(c) = rf_l3s3 * plitr3c_loss(c) - litr3c_to_soil3c(c) = (1._r8 - rf_l3s3) * plitr3c_loss(c) - if (litr3n(c) > 0._r8) litr3n_to_soil3n(c) = plitr3c_loss(c) / cn_l3(c) - sminn_to_soil3n_l3(c) = pmnf_l3s3(c) - net_nmin(c) = net_nmin(c) - pmnf_l3s3(c) - end if - - ! SOM 1 fluxes (fast rate soil organic matter pool) - if (soil1c(c) > 0._r8) then - if (pmnf_s1s2(c) > 0._r8) then - psoil1c_loss(c) = psoil1c_loss(c) * fpi(c) - pmnf_s1s2(c) = pmnf_s1s2(c) * fpi(c) - sminn_to_denit_s1s2(c) = 0._r8 - else - sminn_to_denit_s1s2(c) = -dnp * pmnf_s1s2(c) - end if - soil1_hr(c) = rf_s1s2 * psoil1c_loss(c) - soil1c_to_soil2c(c) = (1._r8 - rf_s1s2) * psoil1c_loss(c) - soil1n_to_soil2n(c) = psoil1c_loss(c) / cn_s1 - sminn_to_soil2n_s1(c) = pmnf_s1s2(c) - net_nmin(c) = net_nmin(c) - pmnf_s1s2(c) - end if - - ! SOM 2 fluxes (medium rate soil organic matter pool) - if (soil2c(c) > 0._r8) then - if (pmnf_s2s3(c) > 0._r8) then - psoil2c_loss(c) = psoil2c_loss(c) * fpi(c) - pmnf_s2s3(c) = pmnf_s2s3(c) * fpi(c) - sminn_to_denit_s2s3(c) = 0._r8 - else - sminn_to_denit_s2s3(c) = -dnp * pmnf_s2s3(c) - end if - soil2_hr(c) = rf_s2s3 * psoil2c_loss(c) - soil2c_to_soil3c(c) = (1._r8 - rf_s2s3) * psoil2c_loss(c) - soil2n_to_soil3n(c) = psoil2c_loss(c) / cn_s2 - sminn_to_soil3n_s2(c) = pmnf_s2s3(c) - net_nmin(c) = net_nmin(c) - pmnf_s2s3(c) - end if - - ! SOM 3 fluxes (slow rate soil organic matter pool) - if (soil3c(c) > 0._r8) then - if (pmnf_s3s4(c) > 0._r8) then - psoil3c_loss(c) = psoil3c_loss(c) * fpi(c) - pmnf_s3s4(c) = pmnf_s3s4(c) * fpi(c) - sminn_to_denit_s3s4(c) = 0._r8 - else - sminn_to_denit_s3s4(c) = -dnp * pmnf_s3s4(c) - end if - soil3_hr(c) = rf_s3s4 * psoil3c_loss(c) - soil3c_to_soil4c(c) = (1._r8 - rf_s3s4) * psoil3c_loss(c) - soil3n_to_soil4n(c) = psoil3c_loss(c) / cn_s3 - sminn_to_soil4n_s3(c) = pmnf_s3s4(c) - net_nmin(c) = net_nmin(c) - pmnf_s3s4(c) - end if - - ! SOM 4 fluxes (slowest rate soil organic matter pool) - if (soil4c(c) > 0._r8) then - soil4_hr(c) = psoil4c_loss(c) - soil4n_to_sminn(c) = psoil4c_loss(c) / cn_s4 - sminn_to_denit_s4(c) = -dnp * pmnf_s4(c) - net_nmin(c) = net_nmin(c) - pmnf_s4(c) - end if - - end do - - deallocate(fr) - -end subroutine CNDecompAlloc -!----------------------------------------------------------------------- - -end module CNDecompMod diff --git a/src_clm40/biogeochem/CNEcosystemDynMod.F90 b/src_clm40/biogeochem/CNEcosystemDynMod.F90 deleted file mode 100644 index 62bcc2ca90..0000000000 --- a/src_clm40/biogeochem/CNEcosystemDynMod.F90 +++ /dev/null @@ -1,259 +0,0 @@ -module CNEcosystemDynMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNEcosystemDynMod -! -! !DESCRIPTION: -! Ecosystem dynamics: phenology, vegetation -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varctl , only: flanduse_timeseries, use_c13 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: CNEcosystemDynInit ! Ecosystem dynamics initialization - public :: CNEcosystemDyn ! Ecosystem dynamics: phenology, vegetation -! -! !REVISION HISTORY: -! Created by Peter Thornton -! 19 May 2009: PET - modified to include call to harvest routine -! -! -! !PRIVATE MEMBER FUNCTIONS: -! -! !PRIVATE TYPES: -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNEcosystemDynInit -! -! !INTERFACE: - subroutine CNEcosystemDynInit(lbc, ubc, lbp, ubp ) -! -! !DESCRIPTION: -! Initialzation of the CN Ecosystem dynamics. -! -! !USES: - use CNAllocationMod, only : CNAllocationInit - use CNPhenologyMod , only : CNPhenologyInit -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbp, ubp ! pft bounds -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 04/05/11, Erik Kluzek creation -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - call CNAllocationInit ( lbc, ubc, lbp, ubp ) - call CNPhenologyInit ( lbp, ubp ) - - end subroutine CNEcosystemDynInit - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNEcosystemDyn -! -! !INTERFACE: - subroutine CNEcosystemDyn(lbc, ubc, lbp, ubp, num_soilc, filter_soilc, & - num_soilp, filter_soilp, num_pcropp, filter_pcropp, doalb) -! -! !DESCRIPTION: -! The core CN code is executed here. Calculates fluxes for maintenance -! respiration, decomposition, allocation, phenology, and growth respiration. -! These routines happen on the radiation time step so that canopy structure -! stays synchronized with albedo calculations. -! -! !USES: - use clmtype - use spmdMod , only: masterproc - use CNSetValueMod , only: CNZeroFluxes - use CNNDynamicsMod , only: CNNDeposition,CNNFixation, CNNLeaching - use CNMRespMod , only: CNMResp - use CNDecompMod , only: CNDecompAlloc - use CNPhenologyMod , only: CNPhenology - use CNGRespMod , only: CNGResp - use CNCStateUpdate1Mod , only: CStateUpdate1,CStateUpdate0 - use CNNStateUpdate1Mod , only: NStateUpdate1 - use CNGapMortalityMod , only: CNGapMortality - use CNCStateUpdate2Mod , only: CStateUpdate2, CStateUpdate2h - use CNNStateUpdate2Mod , only: NStateUpdate2, NStateUpdate2h - use CNFireMod , only: CNFireArea, CNFireFluxes - use CNCStateUpdate3Mod , only: CStateUpdate3 - use CNNStateUpdate3Mod , only: NStateUpdate3 - use CNBalanceCheckMod , only: CBalanceCheck, NBalanceCheck - use CNPrecisionControlMod, only: CNPrecisionControl - use CNVegStructUpdateMod , only: CNVegStructUpdate - use CNAnnualUpdateMod , only: CNAnnualUpdate - use CNSummaryMod , only: CSummary, NSummary - - use CNC13StateUpdate1Mod , only: C13StateUpdate1,C13StateUpdate0 - use CNC13StateUpdate2Mod , only: C13StateUpdate2, C13StateUpdate2h - use CNC13StateUpdate3Mod , only: C13StateUpdate3 - use CNC13FluxMod , only: C13Flux1, C13Flux2, C13Flux2h, C13Flux3 - use C13SummaryMod , only: C13Summary - - use pftdynMod , only: CNHarvest - use CNWoodProductsMod , only: CNWoodProducts -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(ubc-lbc+1) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(ubp-lbp+1) ! filter for soil pfts - integer, intent(in) :: num_pcropp ! number of prog. crop pfts in filter - integer, intent(in) :: filter_pcropp(:)! filter for prognostic crop pfts - logical, intent(in) :: doalb ! true = surface albedo calculation time step -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 10/22/03, Peter Thornton: created from EcosystemDyn during migration to -! new vector code. -! 11/3/03, Peter Thornton: removed update of elai, esai, frac_veg_nosno_alb. -! These are now done in CNVegStructUpdate(), which is called -! prior to SurfaceAlbedo(). -! 11/13/03, Peter Thornton: switched from nolake to soil filtering. -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! -! local pointers to implicit out arguments -! -! !OTHER LOCAL VARIABLES: -! -!EOP -!----------------------------------------------------------------------- - - ! if (doalb) then - - ! Call the main CN routines - call CNZeroFluxes(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNNDeposition(lbc, ubc) - - call CNNFixation(num_soilc,filter_soilc) - - call CNMResp(lbc, ubc, num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNDecompAlloc(lbp, ubp, lbc, ubc, num_soilc, filter_soilc, & - num_soilp, filter_soilp, num_pcropp) - - ! CNphenology needs to be called after CNdecompAlloc, because it - ! depends on current time-step fluxes to new growth on the last - ! litterfall timestep in deciduous systems - - call CNPhenology(num_soilc, filter_soilc, num_soilp, filter_soilp, & - num_pcropp, filter_pcropp, doalb) - - call CNGResp(num_soilp, filter_soilp) - - call CStateUpdate0(num_soilp, filter_soilp) - - if (use_c13) then - call C13StateUpdate0(num_soilp, filter_soilp) - - call C13Flux1(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call CStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13StateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNGapMortality(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13Flux2(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call CStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13StateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (flanduse_timeseries /= ' ') then - call CNHarvest(num_soilc, filter_soilc, num_soilp, filter_soilp) - end if - - if (use_c13) then - call C13Flux2h(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call CStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13StateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNWoodProducts(num_soilc, filter_soilc) - - call CNFireArea(num_soilc, filter_soilc) - - call CNFireFluxes(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNNLeaching(lbc, ubc, num_soilc, filter_soilc) - - if (use_c13) then - call C13Flux3(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call CStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13StateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call NStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CNPrecisionControl(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (doalb) then - call CNVegStructUpdate(num_soilp, filter_soilp) - end if - -! call CNAnnualUpdate(num_soilc, filter_soilc, num_soilp, filter_soilp) - - call CSummary(num_soilc, filter_soilc, num_soilp, filter_soilp) - - if (use_c13) then - call C13Summary(num_soilc, filter_soilc, num_soilp, filter_soilp) - endif - - call NSummary(num_soilc, filter_soilc, num_soilp, filter_soilp) - -! end if !end of if-doalb block - - end subroutine CNEcosystemDyn - -!----------------------------------------------------------------------- -end module CNEcosystemDynMod diff --git a/src_clm40/biogeochem/CNFireMod.F90 b/src_clm40/biogeochem/CNFireMod.F90 deleted file mode 100644 index c703adf9bd..0000000000 --- a/src_clm40/biogeochem/CNFireMod.F90 +++ /dev/null @@ -1,668 +0,0 @@ -module CNFireMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNFireMod -! -! !DESCRIPTION: -! Module holding routines fire mod -! nitrogen code. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_PI,SHR_CONST_TKFRZ - use pft2colMod , only: p2c - use clm_varctl , only: iulog, use_cn, use_cndv - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNFireArea - public :: CNFireFluxes -! -! !REVISION HISTORY: -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNFireArea -! -! !INTERFACE: -subroutine CNFireArea (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! Computes column-level area affected by fire in each timestep -! based on statistical fire model in Thonicke et al. 2001. -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size, get_nstep, get_days_per_year - use clm_varpar , only: max_pft_per_col - use clm_varcon , only: secspday - use clm_varctl , only: use_nofire -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNEcosystemDyn in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - ! pft-level - real(r8), pointer :: wtcol(:) ! pft weight on the column - integer , pointer :: ivt(:) ! vegetation type for this pft - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - ! column-level - integer , pointer :: npfts(:) ! number of pfts on the column - integer , pointer :: pfti(:) ! pft index array - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: wf(:) ! soil water as frac. of whc for top 0.5 m - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: totlitc(:) ! (gC/m2) total litter C (not including cwdc) - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - ! PET 5/20/08, test to increase fire area - real(r8), pointer :: totvegc(:) ! (gC/m2) total veg C (column-level mean) - ! pointers for column averaging -! -! local pointers to implicit in/out scalars -! - ! column-level - real(r8), pointer :: me(:) ! column-level moisture of extinction (proportion) - real(r8), pointer :: fire_prob(:) ! daily fire probability (0-1) - real(r8), pointer :: mean_fire_prob(:) ! e-folding mean of daily fire probability (0-1) - real(r8), pointer :: fireseasonl(:) ! annual fire season length (days, <= days/year) - real(r8), pointer :: farea_burned(:) ! fractional area burned in this timestep (proportion) - real(r8), pointer :: ann_farea_burned(:) ! annual total fractional area burned (proportion) -! -! !OTHER LOCAL VARIABLES: -! real(r8), parameter:: minfuel = 200.0_r8 ! dead fuel threshold to carry a fire (gC/m2) -! PET, 5/30/08: changed from 200 to 100 gC/m2, since the original paper didn't specify -! the units as carbon, I am assuming that they were in dry biomass, so carbon would be ~50% - real(r8), parameter:: minfuel = 100.0_r8 ! dead fuel threshold to carry a fire (gC/m2) - real(r8), parameter:: me_woody = 0.3_r8 ! moisture of extinction for woody PFTs (proportion) - real(r8), parameter:: me_herb = 0.2_r8 ! moisture of extinction for herbaceous PFTs (proportion) - real(r8), parameter:: ef_time = 1.0_r8 ! e-folding time constant (years) - integer :: fc,c,pi,p ! index variables - real(r8):: dt ! time step variable (s) - real(r8):: fuelc ! temporary column-level litter + cwd C (gC/m2) - integer :: nef ! number of e-folding timesteps - real(r8):: ef_nsteps ! number of e-folding timesteps (real) - integer :: nstep ! current timestep number - real(r8):: m ! top-layer soil moisture (proportion) - real(r8):: mep ! pft-level moisture of extinction [proportion] - real(r8):: s2 ! (mean_fire_prob - 1.0) - real(r8):: dayspyr ! days per year -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type members (pft-level) - wtcol => pft%wtcol - ivt => pft%itype - pwtgcell => pft%wtgcell - woody => pftcon%woody - - ! assign local pointers to derived type members (column-level) - npfts => col%npfts - pfti => col%pfti - wf => cps%wf - me => cps%me - fire_prob => cps%fire_prob - mean_fire_prob => cps%mean_fire_prob - fireseasonl => cps%fireseasonl - farea_burned => cps%farea_burned - ann_farea_burned => cps%ann_farea_burned - t_grnd => ces%t_grnd - totlitc => ccs%totlitc - cwdc => ccs%cwdc - ! PET 5/20/08, test to increase fire area - totvegc => pcs_a%totvegc - - ! pft to column average for moisture of extinction - do fc = 1,num_soilc - c = filter_soilc(fc) - me(c) = 0._r8 - end do - mep = me_woody - do pi = 1,max_pft_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - if (pwtgcell(p)>0._r8) then - if (woody(ivt(p)) == 1) then - mep = me_woody - else - mep = me_herb - end if - end if - me(c) = me(c) + mep*wtcol(p) - end if - end do - end do - - ! Get model step size - dt = real( get_step_size(), r8 ) - - ! Set the number of timesteps for e-folding. - ! When the simulation has run fewer than this number of steps, - ! re-scale the e-folding time to get a stable early estimate. - nstep = get_nstep() - dayspyr = get_days_per_year() - nef = (ef_time*dayspyr*secspday)/dt - ef_nsteps = max(1,min(nstep,nef)) - - ! test code, added 6/6/05, PET - ! setting ef_nsteps to full count regardless of nstep, to see if this - ! gets rid of transient in fire stats for initial run from spunup - ! initial conditions - ef_nsteps = nef - - ! begin column loop to calculate fractional area affected by fire - - do fc = 1, num_soilc - c = filter_soilc(fc) - - ! dead fuel C (total litter + CWD) - fuelc = totlitc(c) + cwdc(c) - ! PET 5/20/08, test to increase fire area - ! PET, 5/30/08. going back to original treatment using dead fuel only - ! fuelc = fuelc + totvegc(c) - - ! m is the fractional soil mositure in the top layer (taken here - ! as the top 0.5 m) - ! PET 5/30/08 - note that this has been changed in Hydrology to use top 5 cm. - m = max(0._r8,wf(c)) - - - ! Calculate the probability of at least one fire in a day - ! in the gridcell. minfuel is the limit for dead fuels below which - ! fire is assumed unable to spread. - - if (t_grnd(c)>SHR_CONST_TKFRZ .and. fuelc>minfuel .and. me(c)>0._r8 .and. m<=me(c)) then - fire_prob(c) = exp(-SHR_CONST_PI * (m/me(c))**2) - else - fire_prob(c) = 0._r8 - end if - - ! Use e-folding to keep a running mean of daily fire probability, - ! which is then used to calculate annual fractional area burned. - ! mean_fire_prob corresponds to the variable s from Thonicke. - ! fireseasonl corresponds to the variable N from Thonicke. - ! ann_farea_burned corresponds to the variable A from Thonicke. - - mean_fire_prob(c) = (mean_fire_prob(c)*(ef_nsteps-1._r8) + fire_prob(c))/ef_nsteps - fireseasonl(c) = mean_fire_prob(c) * dayspyr - s2 = mean_fire_prob(c)-1._r8 - ann_farea_burned(c) = mean_fire_prob(c)*exp(s2/(0.45_r8*(s2**3) + 2.83_r8*(s2**2) + 2.96_r8*s2 + 1.04_r8)) - - ! Estimate the fractional area of the column affected by fire in this time step. - ! Over a year this should sum to a value near the annual - ! fractional area burned from equations above. - - if (fireseasonl(c) > 0._r8) then - farea_burned(c) = (fire_prob(c)/fireseasonl(c)) * ann_farea_burned(c) * (dt/secspday) - else - farea_burned(c) = 0._r8 - end if - - if (use_nofire) then - ! set the fire area 0 if NOFIRE flag is on - farea_burned(c) = 0._r8 - end if - - end do ! end of column loop - -end subroutine CNFireArea -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNFireFluxes -! -! !INTERFACE: -subroutine CNFireFluxes (num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Fire effects routine for coupled carbon-nitrogen code (CN). -! Relies primarily on estimate of fractional area burned in this -! timestep, from CNFireArea(). -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn() -! -! !REVISION HISTORY: -! 7/23/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: nind(:) ! number of individuals (#/m2) - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: resist(:) ! resistance to fire (no units) - integer , pointer :: pcolumn(:) ! pft's column index - real(r8), pointer :: farea_burned(:) ! timestep fractional area burned (proportion) - real(r8), pointer :: m_cwdc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_cwdc_fire(:) - real(r8), pointer :: m_deadstemc_to_cwdc_fire(:) - real(r8), pointer :: m_litr1c_to_fire(:) - real(r8), pointer :: m_litr2c_to_fire(:) - real(r8), pointer :: m_litr3c_to_fire(:) - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: m_cwdn_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_cwdn_fire(:) - real(r8), pointer :: m_deadstemn_to_cwdn_fire(:) - real(r8), pointer :: m_litr1n_to_fire(:) - real(r8), pointer :: m_litr2n_to_fire(:) - real(r8), pointer :: m_litr3n_to_fire(:) - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) - real(r8), pointer :: m_deadstemc_to_fire(:) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) - real(r8), pointer :: m_frootc_storage_to_fire(:) - real(r8), pointer :: m_frootc_to_fire(:) - real(r8), pointer :: m_frootc_xfer_to_fire(:) - real(r8), pointer :: m_gresp_storage_to_fire(:) - real(r8), pointer :: m_gresp_xfer_to_fire(:) - real(r8), pointer :: m_leafc_storage_to_fire(:) - real(r8), pointer :: m_leafc_to_fire(:) - real(r8), pointer :: m_leafc_xfer_to_fire(:) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) - real(r8), pointer :: m_livecrootc_to_fire(:) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) - real(r8), pointer :: m_livestemc_storage_to_fire(:) - real(r8), pointer :: m_livestemc_to_fire(:) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) !(gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafcmax(:) ! (gC/m2) ann max leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) !(gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: m_deadcrootn_storage_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_litter_fire(:) - real(r8), pointer :: m_deadcrootn_xfer_to_fire(:) - real(r8), pointer :: m_deadstemn_storage_to_fire(:) - real(r8), pointer :: m_deadstemn_to_fire(:) - real(r8), pointer :: m_deadstemn_to_litter_fire(:) - real(r8), pointer :: m_deadstemn_xfer_to_fire(:) - real(r8), pointer :: m_frootn_storage_to_fire(:) - real(r8), pointer :: m_frootn_to_fire(:) - real(r8), pointer :: m_frootn_xfer_to_fire(:) - real(r8), pointer :: m_leafn_storage_to_fire(:) - real(r8), pointer :: m_leafn_to_fire(:) - real(r8), pointer :: m_leafn_xfer_to_fire(:) - real(r8), pointer :: m_livecrootn_storage_to_fire(:) - real(r8), pointer :: m_livecrootn_to_fire(:) - real(r8), pointer :: m_livecrootn_xfer_to_fire(:) - real(r8), pointer :: m_livestemn_storage_to_fire(:) - real(r8), pointer :: m_livestemn_to_fire(:) - real(r8), pointer :: m_livestemn_xfer_to_fire(:) - real(r8), pointer :: m_retransn_to_fire(:) - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N -! -! !OTHER LOCAL VARIABLES: - !real(r8), parameter:: wcf = 0.2_r8 ! wood combustion fraction - real(r8), parameter:: wcf = 0.4_r8 ! wood combustion fraction - integer :: c,p ! indices - integer :: fp,fc ! filter indices - real(r8):: f ! rate for fire effects (1/s) - real(r8):: dt ! time step variable (s) -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - - nind => pdgvs%nind - ivt => pft%itype - pcolumn => pft%column - woody => pftcon%woody - resist => pftcon%resist - farea_burned => cps%farea_burned - m_cwdc_to_fire => ccf%m_cwdc_to_fire - m_deadcrootc_to_cwdc_fire => ccf%m_deadcrootc_to_cwdc_fire - m_deadstemc_to_cwdc_fire => ccf%m_deadstemc_to_cwdc_fire - m_litr1c_to_fire => ccf%m_litr1c_to_fire - m_litr2c_to_fire => ccf%m_litr2c_to_fire - m_litr3c_to_fire => ccf%m_litr3c_to_fire - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - m_cwdn_to_fire => cnf%m_cwdn_to_fire - m_deadcrootn_to_cwdn_fire => cnf%m_deadcrootn_to_cwdn_fire - m_deadstemn_to_cwdn_fire => cnf%m_deadstemn_to_cwdn_fire - m_litr1n_to_fire => cnf%m_litr1n_to_fire - m_litr2n_to_fire => cnf%m_litr2n_to_fire - m_litr3n_to_fire => cnf%m_litr3n_to_fire - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - m_deadcrootc_storage_to_fire => pcf%m_deadcrootc_storage_to_fire - m_deadcrootc_to_fire => pcf%m_deadcrootc_to_fire - m_deadcrootc_to_litter_fire => pcf%m_deadcrootc_to_litter_fire - m_deadcrootc_xfer_to_fire => pcf%m_deadcrootc_xfer_to_fire - m_deadstemc_storage_to_fire => pcf%m_deadstemc_storage_to_fire - m_deadstemc_to_fire => pcf%m_deadstemc_to_fire - m_deadstemc_to_litter_fire => pcf%m_deadstemc_to_litter_fire - m_deadstemc_to_litter => pcf%m_deadstemc_to_litter - m_livestemc_to_litter => pcf%m_livestemc_to_litter - m_deadcrootc_to_litter => pcf%m_deadcrootc_to_litter - m_livecrootc_to_litter => pcf%m_livecrootc_to_litter - m_deadstemc_xfer_to_fire => pcf%m_deadstemc_xfer_to_fire - m_frootc_storage_to_fire => pcf%m_frootc_storage_to_fire - m_frootc_to_fire => pcf%m_frootc_to_fire - m_frootc_xfer_to_fire => pcf%m_frootc_xfer_to_fire - m_gresp_storage_to_fire => pcf%m_gresp_storage_to_fire - m_gresp_xfer_to_fire => pcf%m_gresp_xfer_to_fire - m_leafc_storage_to_fire => pcf%m_leafc_storage_to_fire - m_leafc_to_fire => pcf%m_leafc_to_fire - m_leafc_xfer_to_fire => pcf%m_leafc_xfer_to_fire - m_livecrootc_storage_to_fire => pcf%m_livecrootc_storage_to_fire - m_livecrootc_to_fire => pcf%m_livecrootc_to_fire - m_livecrootc_xfer_to_fire => pcf%m_livecrootc_xfer_to_fire - m_livestemc_storage_to_fire => pcf%m_livestemc_storage_to_fire - m_livestemc_to_fire => pcf%m_livestemc_to_fire - m_livestemc_xfer_to_fire => pcf%m_livestemc_xfer_to_fire - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafcmax => pcs%leafcmax - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - m_deadcrootn_storage_to_fire => pnf%m_deadcrootn_storage_to_fire - m_deadcrootn_to_fire => pnf%m_deadcrootn_to_fire - m_deadcrootn_to_litter_fire => pnf%m_deadcrootn_to_litter_fire - m_deadcrootn_xfer_to_fire => pnf%m_deadcrootn_xfer_to_fire - m_deadstemn_storage_to_fire => pnf%m_deadstemn_storage_to_fire - m_deadstemn_to_fire => pnf%m_deadstemn_to_fire - m_deadstemn_to_litter_fire => pnf%m_deadstemn_to_litter_fire - m_deadstemn_xfer_to_fire => pnf%m_deadstemn_xfer_to_fire - m_frootn_storage_to_fire => pnf%m_frootn_storage_to_fire - m_frootn_to_fire => pnf%m_frootn_to_fire - m_frootn_xfer_to_fire => pnf%m_frootn_xfer_to_fire - m_leafn_storage_to_fire => pnf%m_leafn_storage_to_fire - m_leafn_to_fire => pnf%m_leafn_to_fire - m_leafn_xfer_to_fire => pnf%m_leafn_xfer_to_fire - m_livecrootn_storage_to_fire => pnf%m_livecrootn_storage_to_fire - m_livecrootn_to_fire => pnf%m_livecrootn_to_fire - m_livecrootn_xfer_to_fire => pnf%m_livecrootn_xfer_to_fire - m_livestemn_storage_to_fire => pnf%m_livestemn_storage_to_fire - m_livestemn_to_fire => pnf%m_livestemn_to_fire - m_livestemn_xfer_to_fire => pnf%m_livestemn_xfer_to_fire - m_retransn_to_fire => pnf%m_retransn_to_fire - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - retransn => pns%retransn - - - ! Get model step size - - dt = real( get_step_size(), r8 ) - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - - ! get the column-level fractional area burned for this timestep - ! and convert to a rate per second, then scale by the pft-level - ! fire resistance - f = (farea_burned(c) / dt) * (1._r8 - resist(ivt(p))) - - ! apply this rate to the pft state variables to get flux rates - - ! NOTE: the deadstem and deadcroot pools are only partly consumed - ! by fire, and the remaining affected fraction goes to the column-level - ! as litter (coarse woody debris). This is controlled by wcf, the woody - ! combustion fraction. - - ! carbon fluxes - m_leafc_to_fire(p) = leafc(p) * f - m_leafc_storage_to_fire(p) = leafc_storage(p) * f - m_leafc_xfer_to_fire(p) = leafc_xfer(p) * f - m_frootc_to_fire(p) = frootc(p) * f - m_frootc_storage_to_fire(p) = frootc_storage(p) * f - m_frootc_xfer_to_fire(p) = frootc_xfer(p) * f - m_livestemc_to_fire(p) = livestemc(p) * f - m_livestemc_storage_to_fire(p) = livestemc_storage(p) * f - m_livestemc_xfer_to_fire(p) = livestemc_xfer(p) * f - m_deadstemc_to_fire(p) = deadstemc(p) * f*wcf - m_deadstemc_to_litter_fire(p) = deadstemc(p) * f*(1._r8 - wcf) - m_deadstemc_storage_to_fire(p) = deadstemc_storage(p) * f - m_deadstemc_xfer_to_fire(p) = deadstemc_xfer(p) * f - m_livecrootc_to_fire(p) = livecrootc(p) * f - m_livecrootc_storage_to_fire(p) = livecrootc_storage(p) * f - m_livecrootc_xfer_to_fire(p) = livecrootc_xfer(p) * f - m_deadcrootc_to_fire(p) = deadcrootc(p) * f*wcf - m_deadcrootc_to_litter_fire(p) = deadcrootc(p) * f*(1._r8 - wcf) - m_deadcrootc_storage_to_fire(p) = deadcrootc_storage(p) * f - m_deadcrootc_xfer_to_fire(p) = deadcrootc_xfer(p) * f - m_gresp_storage_to_fire(p) = gresp_storage(p) * f - m_gresp_xfer_to_fire(p) = gresp_xfer(p) * f - - ! nitrogen fluxes - m_leafn_to_fire(p) = leafn(p) * f - m_leafn_storage_to_fire(p) = leafn_storage(p) * f - m_leafn_xfer_to_fire(p) = leafn_xfer(p) * f - m_frootn_to_fire(p) = frootn(p) * f - m_frootn_storage_to_fire(p) = frootn_storage(p) * f - m_frootn_xfer_to_fire(p) = frootn_xfer(p) * f - m_livestemn_to_fire(p) = livestemn(p) * f - m_livestemn_storage_to_fire(p) = livestemn_storage(p) * f - m_livestemn_xfer_to_fire(p) = livestemn_xfer(p) * f - m_deadstemn_to_fire(p) = deadstemn(p) * f*wcf - m_deadstemn_to_litter_fire(p) = deadstemn(p) * f*(1._r8 - wcf) - m_deadstemn_storage_to_fire(p) = deadstemn_storage(p) * f - m_deadstemn_xfer_to_fire(p) = deadstemn_xfer(p) * f - m_livecrootn_to_fire(p) = livecrootn(p) * f - m_livecrootn_storage_to_fire(p) = livecrootn_storage(p) * f - m_livecrootn_xfer_to_fire(p) = livecrootn_xfer(p) * f - m_deadcrootn_to_fire(p) = deadcrootn(p) * f*wcf - m_deadcrootn_to_litter_fire(p) = deadcrootn(p) * f*(1._r8 - wcf) - m_deadcrootn_storage_to_fire(p) = deadcrootn_storage(p) * f - m_deadcrootn_xfer_to_fire(p) = deadcrootn_xfer(p) * f - m_retransn_to_fire(p) = retransn(p) * f - - if (use_cndv) then - ! Carbon per individual (c) remains constant in gap mortality & fire - ! but individuals are removed from the population P (#/m2 naturally - ! vegetated area), so - ! - ! c = Cnew*FPC/Pnew = Cold*FPC/Pold - ! - ! where C = carbon/m2 pft area & FPC = pft area/naturally vegetated area. - ! FPC does not change from mortality or fire. FPC changes from Light and - ! Establishment at the end of the year. So... - ! - ! Pnew = Pold * Cnew / Cold - ! - ! where "new" refers to after mortality & fire, while "old" refers to - ! before mortality & fire. For C I use total wood. (slevis) - ! - ! nind calculation placed here for convenience; nind could be updated - ! once per year instead if we saved Cold for that calculation; - ! as is, nind slowly decreases through the year, while fpcgrid remains - ! unchanged; this affects the htop calculation in CNVegStructUpdate - - if (woody(ivt(p)) == 1._r8) then - if (livestemc(p)+deadstemc(p)+m_livestemc_to_litter(p)*dt+ & - m_deadstemc_to_litter(p)*dt > 0._r8) then - nind(p) = nind(p) * (livestemc(p) + deadstemc(p) + & - livecrootc(p) + deadcrootc(p) - dt * & - (m_livestemc_to_fire(p) + & - m_livecrootc_to_fire(p) + & - m_deadstemc_to_fire(p) + & - m_deadcrootc_to_fire(p) + & - m_deadcrootc_to_litter_fire(p) + & - m_deadstemc_to_litter_fire(p))) / & - (livestemc(p) + deadstemc(p) + & - livecrootc(p) + deadcrootc(p) + dt * & - (m_livestemc_to_litter(p) + & - m_livecrootc_to_litter(p) + & - m_deadcrootc_to_litter(p) + & - m_deadstemc_to_litter(p))) - else - nind(p) = 0._r8 - end if - end if - - ! annual dgvm calculations use lm_ind = leafcmax * fpcgrid / nind - ! leafcmax is reset to 0 once per yr - ! could calculate leafcmax in CSummary instead; if so, should remove - ! subtraction of m_leafc_to_fire(p)*dt from the calculation (slevis) - - leafcmax(p) = max(leafc(p)-m_leafc_to_fire(p)*dt, leafcmax(p)) - if (ivt(p) == 0) leafcmax(p) = 0._r8 - end if - - end do ! end of pfts loop - - ! send the fire affected but uncombusted woody fraction to the column-level cwd fluxes - ! use p2c for weighted averaging from pft to column - call p2c(num_soilc, filter_soilc, m_deadstemc_to_litter_fire, m_deadstemc_to_cwdc_fire) - call p2c(num_soilc, filter_soilc, m_deadcrootc_to_litter_fire, m_deadcrootc_to_cwdc_fire) - call p2c(num_soilc, filter_soilc, m_deadstemn_to_litter_fire, m_deadstemn_to_cwdn_fire) - call p2c(num_soilc, filter_soilc, m_deadcrootn_to_litter_fire, m_deadcrootn_to_cwdn_fire) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! get the column-level fractional area burned for this timestep - ! and convert to a rate per second, then scale by the pft-level - ! fire resistance - - f = farea_burned(c) / dt - - ! apply this rate to the column state variables to get flux rates - - ! NOTE: the coarse woody debris pools are only partly consumed - ! by fire. This is controlled by wcf, the woody - ! combustion fraction. For now using the same fraction for standing - ! wood (deadstem and deadcroot pools) and woody litter (cwd pools). - ! May be a good idea later to modify this to use different fractions - ! for different woody pools, or make the combustion fraction a dynamic - ! variable. - - ! carbon fluxes - m_litr1c_to_fire(c) = litr1c(c) * f - m_litr2c_to_fire(c) = litr2c(c) * f - m_litr3c_to_fire(c) = litr3c(c) * f - m_cwdc_to_fire(c) = cwdc(c) * f*wcf - - ! nitrogen fluxes - m_litr1n_to_fire(c) = litr1n(c) * f - m_litr2n_to_fire(c) = litr2n(c) * f - m_litr3n_to_fire(c) = litr3n(c) * f - m_cwdn_to_fire(c) = cwdn(c) * f*wcf - - end do ! end of column loop - -end subroutine CNFireFluxes -!----------------------------------------------------------------------- - -end module CNFireMod diff --git a/src_clm40/biogeochem/CNGRespMod.F90 b/src_clm40/biogeochem/CNGRespMod.F90 deleted file mode 100644 index efadd86e98..0000000000 --- a/src_clm40/biogeochem/CNGRespMod.F90 +++ /dev/null @@ -1,221 +0,0 @@ -module CNGRespMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNGRespMod -! -! !DESCRIPTION: -! Module for growth respiration fluxes, -! for coupled carbon-nitrogen code. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNGResp -! -! !REVISION HISTORY: -! 9/12/03: Created by Peter Thornton -! 10/27/03, Peter Thornton: migrated to vector data structures -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNGResp -! -! !INTERFACE: -subroutine CNGResp(num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic carbon state -! variables -! -! !USES: - use clmtype - use pftvarcon, only : npcropmin, grperc, grpnow -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn, in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: cpool_to_leafc(:) - real(r8), pointer :: cpool_to_leafc_storage(:) - real(r8), pointer :: cpool_to_frootc(:) - real(r8), pointer :: cpool_to_frootc_storage(:) - real(r8), pointer :: cpool_to_livestemc(:) - real(r8), pointer :: cpool_to_livestemc_storage(:) - real(r8), pointer :: cpool_to_deadstemc(:) - real(r8), pointer :: cpool_to_deadstemc_storage(:) - real(r8), pointer :: cpool_to_livecrootc(:) - real(r8), pointer :: cpool_to_livecrootc_storage(:) - real(r8), pointer :: cpool_to_deadcrootc(:) ! allocation to dead coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc_storage(:) ! allocation to dead coarse root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C (gC/m2/s) - real(r8), pointer :: cpool_to_grainc_storage(:) ! allocation to grain C storage (gC/m2/s) - real(r8), pointer :: grainc_xfer_to_grainc(:) ! grain C growth from storage (gC/m2/s) - real(r8), pointer :: leafc_xfer_to_leafc(:) ! leaf C growth from storage (gC/m2/s) - real(r8), pointer :: frootc_xfer_to_frootc(:) ! fine root C growth from storage (gC/m2/s) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) ! live stem C growth from storage (gC/m2/s) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) ! dead stem C growth from storage (gC/m2/s) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) ! live coarse root C growth from storage (gC/m2/s) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) ! dead coarse root C growth from storage (gC/m2/s) - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: cpool_grain_gr(:) - real(r8), pointer :: cpool_grain_storage_gr(:) - real(r8), pointer :: transfer_grain_gr(:) - real(r8), pointer :: cpool_leaf_gr(:) - real(r8), pointer :: cpool_leaf_storage_gr(:) - real(r8), pointer :: transfer_leaf_gr(:) - real(r8), pointer :: cpool_froot_gr(:) - real(r8), pointer :: cpool_froot_storage_gr(:) - real(r8), pointer :: transfer_froot_gr(:) - real(r8), pointer :: cpool_livestem_gr(:) - real(r8), pointer :: cpool_livestem_storage_gr(:) - real(r8), pointer :: transfer_livestem_gr(:) - real(r8), pointer :: cpool_deadstem_gr(:) - real(r8), pointer :: cpool_deadstem_storage_gr(:) - real(r8), pointer :: transfer_deadstem_gr(:) - real(r8), pointer :: cpool_livecroot_gr(:) - real(r8), pointer :: cpool_livecroot_storage_gr(:) - real(r8), pointer :: transfer_livecroot_gr(:) - real(r8), pointer :: cpool_deadcroot_gr(:) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) - real(r8), pointer :: transfer_deadcroot_gr(:) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter pft index - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - ivt => pft%itype - cpool_to_leafc => pcf%cpool_to_leafc - cpool_to_leafc_storage => pcf%cpool_to_leafc_storage - cpool_to_frootc => pcf%cpool_to_frootc - cpool_to_frootc_storage => pcf%cpool_to_frootc_storage - cpool_to_livestemc => pcf%cpool_to_livestemc - cpool_to_livestemc_storage => pcf%cpool_to_livestemc_storage - cpool_to_deadstemc => pcf%cpool_to_deadstemc - cpool_to_deadstemc_storage => pcf%cpool_to_deadstemc_storage - cpool_to_livecrootc => pcf%cpool_to_livecrootc - cpool_to_livecrootc_storage => pcf%cpool_to_livecrootc_storage - cpool_to_deadcrootc => pcf%cpool_to_deadcrootc - cpool_to_deadcrootc_storage => pcf%cpool_to_deadcrootc_storage - cpool_to_grainc => pcf%cpool_to_grainc - cpool_to_grainc_storage => pcf%cpool_to_grainc_storage - grainc_xfer_to_grainc => pcf%grainc_xfer_to_grainc - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - woody => pftcon%woody - - ! Assign local pointers to derived type arrays (out) - cpool_grain_gr => pcf%cpool_grain_gr - cpool_grain_storage_gr => pcf%cpool_grain_storage_gr - transfer_grain_gr => pcf%transfer_grain_gr - cpool_leaf_gr => pcf%cpool_leaf_gr - cpool_leaf_storage_gr => pcf%cpool_leaf_storage_gr - transfer_leaf_gr => pcf%transfer_leaf_gr - cpool_froot_gr => pcf%cpool_froot_gr - cpool_froot_storage_gr => pcf%cpool_froot_storage_gr - transfer_froot_gr => pcf%transfer_froot_gr - cpool_livestem_gr => pcf%cpool_livestem_gr - cpool_livestem_storage_gr => pcf%cpool_livestem_storage_gr - transfer_livestem_gr => pcf%transfer_livestem_gr - cpool_deadstem_gr => pcf%cpool_deadstem_gr - cpool_deadstem_storage_gr => pcf%cpool_deadstem_storage_gr - transfer_deadstem_gr => pcf%transfer_deadstem_gr - cpool_livecroot_gr => pcf%cpool_livecroot_gr - cpool_livecroot_storage_gr => pcf%cpool_livecroot_storage_gr - transfer_livecroot_gr => pcf%transfer_livecroot_gr - cpool_deadcroot_gr => pcf%cpool_deadcroot_gr - cpool_deadcroot_storage_gr => pcf%cpool_deadcroot_storage_gr - transfer_deadcroot_gr => pcf%transfer_deadcroot_gr - - ! Loop through pfts - ! start pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) - cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * & - grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - cpool_grain_gr(p) = cpool_to_grainc(p) * grperc(ivt(p)) - cpool_grain_storage_gr(p) = cpool_to_grainc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_grain_gr(p) = grainc_xfer_to_grainc(p) * grperc(ivt(p)) & - * (1._r8 - grpnow(ivt(p))) - end if - - ! leaf and fine root growth respiration - cpool_leaf_gr(p) = cpool_to_leafc(p) * grperc(ivt(p)) - cpool_leaf_storage_gr(p) = cpool_to_leafc_storage(p) * grperc(ivt(p)) * & - grpnow(ivt(p)) - transfer_leaf_gr(p) = leafc_xfer_to_leafc(p) * grperc(ivt(p)) * & - (1._r8 - grpnow(ivt(p))) - cpool_froot_gr(p) = cpool_to_frootc(p) * grperc(ivt(p)) - cpool_froot_storage_gr(p) = cpool_to_frootc_storage(p) * grperc(ivt(p)) * & - grpnow(ivt(p)) - transfer_froot_gr(p) = frootc_xfer_to_frootc(p) * grperc(ivt(p)) * & - (1._r8 - grpnow(ivt(p))) - - if (woody(ivt(p)) == 1._r8) then - cpool_livestem_gr(p) = cpool_to_livestemc(p) * grperc(ivt(p)) - cpool_livestem_storage_gr(p) = cpool_to_livestemc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_livestem_gr(p) = livestemc_xfer_to_livestemc(p) * & - grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - cpool_deadstem_gr(p) = cpool_to_deadstemc(p) * grperc(ivt(p)) - cpool_deadstem_storage_gr(p) = cpool_to_deadstemc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_deadstem_gr(p) = deadstemc_xfer_to_deadstemc(p) * & - grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - cpool_livecroot_gr(p) = cpool_to_livecrootc(p) * grperc(ivt(p)) - cpool_livecroot_storage_gr(p) = cpool_to_livecrootc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_livecroot_gr(p) = livecrootc_xfer_to_livecrootc(p) * & - grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - cpool_deadcroot_gr(p) = cpool_to_deadcrootc(p) * grperc(ivt(p)) - cpool_deadcroot_storage_gr(p) = cpool_to_deadcrootc_storage(p) * & - grperc(ivt(p)) * grpnow(ivt(p)) - transfer_deadcroot_gr(p) = deadcrootc_xfer_to_deadcrootc(p) * & - grperc(ivt(p)) * (1._r8 - grpnow(ivt(p))) - end if - - end do - -end subroutine CNGResp - -end module CNGRespMod diff --git a/src_clm40/biogeochem/CNGapMortalityMod.F90 b/src_clm40/biogeochem/CNGapMortalityMod.F90 deleted file mode 100644 index 368f796170..0000000000 --- a/src_clm40/biogeochem/CNGapMortalityMod.F90 +++ /dev/null @@ -1,717 +0,0 @@ -module CNGapMortalityMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNGapMortalityMod -! -! !DESCRIPTION: -! Module holding routines used in gap mortality for coupled carbon -! nitrogen code. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNGapMortality -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNGapMortality -! -! !INTERFACE: -subroutine CNGapMortality (num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Gap-phase mortality routine for coupled carbon-nitrogen code (CN) -! -! !USES: - use clmtype - use clm_time_manager, only: get_days_per_year - use clm_varcon , only: secspday - use clm_varctl , only: use_cndv -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! column filter for soil points - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! pft filter for soil points -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arrays - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: woody(:) ! binary flag for woody lifeform - ! (1=woody, 0=not woody) - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: greffic(:) - real(r8), pointer :: heatstress(:) -! -! local pointers to implicit in/out arrays -! -! local pointers to implicit out arrays - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafn_to_litter(:) - real(r8), pointer :: m_frootn_to_litter(:) - real(r8), pointer :: m_livestemn_to_litter(:) - real(r8), pointer :: m_deadstemn_to_litter(:) - real(r8), pointer :: m_livecrootn_to_litter(:) - real(r8), pointer :: m_deadcrootn_to_litter(:) - real(r8), pointer :: m_retransn_to_litter(:) - real(r8), pointer :: m_leafn_storage_to_litter(:) - real(r8), pointer :: m_frootn_storage_to_litter(:) - real(r8), pointer :: m_livestemn_storage_to_litter(:) - real(r8), pointer :: m_deadstemn_storage_to_litter(:) - real(r8), pointer :: m_livecrootn_storage_to_litter(:) - real(r8), pointer :: m_deadcrootn_storage_to_litter(:) - real(r8), pointer :: m_leafn_xfer_to_litter(:) - real(r8), pointer :: m_frootn_xfer_to_litter(:) - real(r8), pointer :: m_livestemn_xfer_to_litter(:) - real(r8), pointer :: m_deadstemn_xfer_to_litter(:) - real(r8), pointer :: m_livecrootn_xfer_to_litter(:) - real(r8), pointer :: m_deadcrootn_xfer_to_litter(:) -! -! !OTHER LOCAL VARIABLES: - integer :: p ! pft index - integer :: fp ! pft filter index - real(r8):: am ! rate for fractional mortality (1/yr) - real(r8):: m ! rate for fractional mortality (1/s) - real(r8):: mort_max ! asymptotic max mortality rate (/yr) - real(r8), parameter :: k_mort = 0.3 !coeff of growth efficiency in mortality equation -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - woody => pftcon%woody - - ! assign local pointers to pft-level arrays - ivt => pft%itype - leafc => pcs%leafc - frootc => pcs%frootc - livestemc => pcs%livestemc - deadstemc => pcs%deadstemc - livecrootc => pcs%livecrootc - deadcrootc => pcs%deadcrootc - leafc_storage => pcs%leafc_storage - frootc_storage => pcs%frootc_storage - livestemc_storage => pcs%livestemc_storage - deadstemc_storage => pcs%deadstemc_storage - livecrootc_storage => pcs%livecrootc_storage - deadcrootc_storage => pcs%deadcrootc_storage - gresp_storage => pcs%gresp_storage - leafc_xfer => pcs%leafc_xfer - frootc_xfer => pcs%frootc_xfer - livestemc_xfer => pcs%livestemc_xfer - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc_xfer => pcs%deadcrootc_xfer - gresp_xfer => pcs%gresp_xfer - leafn => pns%leafn - frootn => pns%frootn - livestemn => pns%livestemn - deadstemn => pns%deadstemn - livecrootn => pns%livecrootn - deadcrootn => pns%deadcrootn - retransn => pns%retransn - leafn_storage => pns%leafn_storage - frootn_storage => pns%frootn_storage - livestemn_storage => pns%livestemn_storage - deadstemn_storage => pns%deadstemn_storage - livecrootn_storage => pns%livecrootn_storage - deadcrootn_storage => pns%deadcrootn_storage - leafn_xfer => pns%leafn_xfer - frootn_xfer => pns%frootn_xfer - livestemn_xfer => pns%livestemn_xfer - deadstemn_xfer => pns%deadstemn_xfer - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn_xfer => pns%deadcrootn_xfer - m_leafc_to_litter => pcf%m_leafc_to_litter - m_frootc_to_litter => pcf%m_frootc_to_litter - m_livestemc_to_litter => pcf%m_livestemc_to_litter - m_deadstemc_to_litter => pcf%m_deadstemc_to_litter - m_livecrootc_to_litter => pcf%m_livecrootc_to_litter - m_deadcrootc_to_litter => pcf%m_deadcrootc_to_litter - m_leafc_storage_to_litter => pcf%m_leafc_storage_to_litter - m_frootc_storage_to_litter => pcf%m_frootc_storage_to_litter - m_livestemc_storage_to_litter => pcf%m_livestemc_storage_to_litter - m_deadstemc_storage_to_litter => pcf%m_deadstemc_storage_to_litter - m_livecrootc_storage_to_litter => pcf%m_livecrootc_storage_to_litter - m_deadcrootc_storage_to_litter => pcf%m_deadcrootc_storage_to_litter - m_gresp_storage_to_litter => pcf%m_gresp_storage_to_litter - m_leafc_xfer_to_litter => pcf%m_leafc_xfer_to_litter - m_frootc_xfer_to_litter => pcf%m_frootc_xfer_to_litter - m_livestemc_xfer_to_litter => pcf%m_livestemc_xfer_to_litter - m_deadstemc_xfer_to_litter => pcf%m_deadstemc_xfer_to_litter - m_livecrootc_xfer_to_litter => pcf%m_livecrootc_xfer_to_litter - m_deadcrootc_xfer_to_litter => pcf%m_deadcrootc_xfer_to_litter - m_gresp_xfer_to_litter => pcf%m_gresp_xfer_to_litter - m_leafn_to_litter => pnf%m_leafn_to_litter - m_frootn_to_litter => pnf%m_frootn_to_litter - m_livestemn_to_litter => pnf%m_livestemn_to_litter - m_deadstemn_to_litter => pnf%m_deadstemn_to_litter - m_livecrootn_to_litter => pnf%m_livecrootn_to_litter - m_deadcrootn_to_litter => pnf%m_deadcrootn_to_litter - m_retransn_to_litter => pnf%m_retransn_to_litter - m_leafn_storage_to_litter => pnf%m_leafn_storage_to_litter - m_frootn_storage_to_litter => pnf%m_frootn_storage_to_litter - m_livestemn_storage_to_litter => pnf%m_livestemn_storage_to_litter - m_deadstemn_storage_to_litter => pnf%m_deadstemn_storage_to_litter - m_livecrootn_storage_to_litter => pnf%m_livecrootn_storage_to_litter - m_deadcrootn_storage_to_litter => pnf%m_deadcrootn_storage_to_litter - m_leafn_xfer_to_litter => pnf%m_leafn_xfer_to_litter - m_frootn_xfer_to_litter => pnf%m_frootn_xfer_to_litter - m_livestemn_xfer_to_litter => pnf%m_livestemn_xfer_to_litter - m_deadstemn_xfer_to_litter => pnf%m_deadstemn_xfer_to_litter - m_livecrootn_xfer_to_litter => pnf%m_livecrootn_xfer_to_litter - m_deadcrootn_xfer_to_litter => pnf%m_deadcrootn_xfer_to_litter - greffic => pdgvs%greffic - heatstress => pdgvs%heatstress - - ! set the mortality rate based on annual rate - am = 0.02_r8 - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - if (use_cndv) then - ! Stress mortality from lpj's subr Mortality. - - if (woody(ivt(p)) == 1._r8) then - - if (ivt(p) == 8) then - mort_max = 0.03_r8 ! BDT boreal - else - mort_max = 0.01_r8 ! original value for all pfts - end if - - ! heatstress and greffic calculated in Establishment once/yr - - ! Mortality rate inversely related to growth efficiency - ! (Prentice et al 1993) - am = mort_max / (1._r8 + k_mort * greffic(p)) - - am = min(1._r8, am + heatstress(p)) - else ! lpj didn't set this for grasses; cn does - ! set the mortality rate based on annual rate - am = 0.02_r8 - end if - end if - - m = am/(get_days_per_year() * secspday) - - ! pft-level gap mortality carbon fluxes - ! displayed pools - m_leafc_to_litter(p) = leafc(p) * m - m_frootc_to_litter(p) = frootc(p) * m - m_livestemc_to_litter(p) = livestemc(p) * m - m_deadstemc_to_litter(p) = deadstemc(p) * m - m_livecrootc_to_litter(p) = livecrootc(p) * m - m_deadcrootc_to_litter(p) = deadcrootc(p) * m - - ! storage pools - m_leafc_storage_to_litter(p) = leafc_storage(p) * m - m_frootc_storage_to_litter(p) = frootc_storage(p) * m - m_livestemc_storage_to_litter(p) = livestemc_storage(p) * m - m_deadstemc_storage_to_litter(p) = deadstemc_storage(p) * m - m_livecrootc_storage_to_litter(p) = livecrootc_storage(p) * m - m_deadcrootc_storage_to_litter(p) = deadcrootc_storage(p) * m - m_gresp_storage_to_litter(p) = gresp_storage(p) * m - - ! transfer pools - m_leafc_xfer_to_litter(p) = leafc_xfer(p) * m - m_frootc_xfer_to_litter(p) = frootc_xfer(p) * m - m_livestemc_xfer_to_litter(p) = livestemc_xfer(p) * m - m_deadstemc_xfer_to_litter(p) = deadstemc_xfer(p) * m - m_livecrootc_xfer_to_litter(p) = livecrootc_xfer(p) * m - m_deadcrootc_xfer_to_litter(p) = deadcrootc_xfer(p) * m - m_gresp_xfer_to_litter(p) = gresp_xfer(p) * m - - ! pft-level gap mortality nitrogen fluxes - ! displayed pools - m_leafn_to_litter(p) = leafn(p) * m - m_frootn_to_litter(p) = frootn(p) * m - m_livestemn_to_litter(p) = livestemn(p) * m - m_deadstemn_to_litter(p) = deadstemn(p) * m - m_livecrootn_to_litter(p) = livecrootn(p) * m - m_deadcrootn_to_litter(p) = deadcrootn(p) * m - m_retransn_to_litter(p) = retransn(p) * m - - ! storage pools - m_leafn_storage_to_litter(p) = leafn_storage(p) * m - m_frootn_storage_to_litter(p) = frootn_storage(p) * m - m_livestemn_storage_to_litter(p) = livestemn_storage(p) * m - m_deadstemn_storage_to_litter(p) = deadstemn_storage(p) * m - m_livecrootn_storage_to_litter(p) = livecrootn_storage(p) * m - m_deadcrootn_storage_to_litter(p) = deadcrootn_storage(p) * m - - ! transfer pools - m_leafn_xfer_to_litter(p) = leafn_xfer(p) * m - m_frootn_xfer_to_litter(p) = frootn_xfer(p) * m - m_livestemn_xfer_to_litter(p) = livestemn_xfer(p) * m - m_deadstemn_xfer_to_litter(p) = deadstemn_xfer(p) * m - m_livecrootn_xfer_to_litter(p) = livecrootn_xfer(p) * m - m_deadcrootn_xfer_to_litter(p) = deadcrootn_xfer(p) * m - - end do ! end of pft loop - - ! gather all pft-level litterfall fluxes to the column - ! for litter C and N inputs - - call CNGapPftToColumn(num_soilc, filter_soilc) - -end subroutine CNGapMortality -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNGapPftToColumn -! -! !INTERFACE: -subroutine CNGapPftToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! called in the middle of CNGapMoratlity to gather all pft-level gap mortality fluxes -! to the column level and assign them to the three litter pools -! -! !USES: - use clmtype - use clm_varpar, only : maxpatch_pft -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! soil column filter -! -! !CALLED FROM: -! subroutine CNphenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! pft weight relative to column (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafn_to_litter(:) - real(r8), pointer :: m_frootn_to_litter(:) - real(r8), pointer :: m_livestemn_to_litter(:) - real(r8), pointer :: m_deadstemn_to_litter(:) - real(r8), pointer :: m_livecrootn_to_litter(:) - real(r8), pointer :: m_deadcrootn_to_litter(:) - real(r8), pointer :: m_retransn_to_litter(:) - real(r8), pointer :: m_leafn_storage_to_litter(:) - real(r8), pointer :: m_frootn_storage_to_litter(:) - real(r8), pointer :: m_livestemn_storage_to_litter(:) - real(r8), pointer :: m_deadstemn_storage_to_litter(:) - real(r8), pointer :: m_livecrootn_storage_to_litter(:) - real(r8), pointer :: m_deadcrootn_storage_to_litter(:) - real(r8), pointer :: m_leafn_xfer_to_litter(:) - real(r8), pointer :: m_frootn_xfer_to_litter(:) - real(r8), pointer :: m_livestemn_xfer_to_litter(:) - real(r8), pointer :: m_deadstemn_xfer_to_litter(:) - real(r8), pointer :: m_livecrootn_xfer_to_litter(:) - real(r8), pointer :: m_deadcrootn_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: m_leafc_to_litr1c(:) - real(r8), pointer :: m_leafc_to_litr2c(:) - real(r8), pointer :: m_leafc_to_litr3c(:) - real(r8), pointer :: m_frootc_to_litr1c(:) - real(r8), pointer :: m_frootc_to_litr2c(:) - real(r8), pointer :: m_frootc_to_litr3c(:) - real(r8), pointer :: m_livestemc_to_cwdc(:) - real(r8), pointer :: m_deadstemc_to_cwdc(:) - real(r8), pointer :: m_livecrootc_to_cwdc(:) - real(r8), pointer :: m_deadcrootc_to_cwdc(:) - real(r8), pointer :: m_leafc_storage_to_litr1c(:) - real(r8), pointer :: m_frootc_storage_to_litr1c(:) - real(r8), pointer :: m_livestemc_storage_to_litr1c(:) - real(r8), pointer :: m_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: m_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: m_gresp_storage_to_litr1c(:) - real(r8), pointer :: m_leafc_xfer_to_litr1c(:) - real(r8), pointer :: m_frootc_xfer_to_litr1c(:) - real(r8), pointer :: m_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: m_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: m_gresp_xfer_to_litr1c(:) - real(r8), pointer :: m_leafn_to_litr1n(:) - real(r8), pointer :: m_leafn_to_litr2n(:) - real(r8), pointer :: m_leafn_to_litr3n(:) - real(r8), pointer :: m_frootn_to_litr1n(:) - real(r8), pointer :: m_frootn_to_litr2n(:) - real(r8), pointer :: m_frootn_to_litr3n(:) - real(r8), pointer :: m_livestemn_to_cwdn(:) - real(r8), pointer :: m_deadstemn_to_cwdn(:) - real(r8), pointer :: m_livecrootn_to_cwdn(:) - real(r8), pointer :: m_deadcrootn_to_cwdn(:) - real(r8), pointer :: m_retransn_to_litr1n(:) - real(r8), pointer :: m_leafn_storage_to_litr1n(:) - real(r8), pointer :: m_frootn_storage_to_litr1n(:) - real(r8), pointer :: m_livestemn_storage_to_litr1n(:) - real(r8), pointer :: m_deadstemn_storage_to_litr1n(:) - real(r8), pointer :: m_livecrootn_storage_to_litr1n(:) - real(r8), pointer :: m_deadcrootn_storage_to_litr1n(:) - real(r8), pointer :: m_leafn_xfer_to_litr1n(:) - real(r8), pointer :: m_frootn_xfer_to_litr1n(:) - real(r8), pointer :: m_livestemn_xfer_to_litr1n(:) - real(r8), pointer :: m_deadstemn_xfer_to_litr1n(:) - real(r8), pointer :: m_livecrootn_xfer_to_litr1n(:) - real(r8), pointer :: m_deadcrootn_xfer_to_litr1n(:) -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p ! indices -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to column-level arrays - npfts => col%npfts - pfti => col%pfti - m_leafc_to_litr1c => ccf%m_leafc_to_litr1c - m_leafc_to_litr2c => ccf%m_leafc_to_litr2c - m_leafc_to_litr3c => ccf%m_leafc_to_litr3c - m_frootc_to_litr1c => ccf%m_frootc_to_litr1c - m_frootc_to_litr2c => ccf%m_frootc_to_litr2c - m_frootc_to_litr3c => ccf%m_frootc_to_litr3c - m_livestemc_to_cwdc => ccf%m_livestemc_to_cwdc - m_deadstemc_to_cwdc => ccf%m_deadstemc_to_cwdc - m_livecrootc_to_cwdc => ccf%m_livecrootc_to_cwdc - m_deadcrootc_to_cwdc => ccf%m_deadcrootc_to_cwdc - m_leafc_storage_to_litr1c => ccf%m_leafc_storage_to_litr1c - m_frootc_storage_to_litr1c => ccf%m_frootc_storage_to_litr1c - m_livestemc_storage_to_litr1c => ccf%m_livestemc_storage_to_litr1c - m_deadstemc_storage_to_litr1c => ccf%m_deadstemc_storage_to_litr1c - m_livecrootc_storage_to_litr1c => ccf%m_livecrootc_storage_to_litr1c - m_deadcrootc_storage_to_litr1c => ccf%m_deadcrootc_storage_to_litr1c - m_gresp_storage_to_litr1c => ccf%m_gresp_storage_to_litr1c - m_leafc_xfer_to_litr1c => ccf%m_leafc_xfer_to_litr1c - m_frootc_xfer_to_litr1c => ccf%m_frootc_xfer_to_litr1c - m_livestemc_xfer_to_litr1c => ccf%m_livestemc_xfer_to_litr1c - m_deadstemc_xfer_to_litr1c => ccf%m_deadstemc_xfer_to_litr1c - m_livecrootc_xfer_to_litr1c => ccf%m_livecrootc_xfer_to_litr1c - m_deadcrootc_xfer_to_litr1c => ccf%m_deadcrootc_xfer_to_litr1c - m_gresp_xfer_to_litr1c => ccf%m_gresp_xfer_to_litr1c - m_leafn_to_litr1n => cnf%m_leafn_to_litr1n - m_leafn_to_litr2n => cnf%m_leafn_to_litr2n - m_leafn_to_litr3n => cnf%m_leafn_to_litr3n - m_frootn_to_litr1n => cnf%m_frootn_to_litr1n - m_frootn_to_litr2n => cnf%m_frootn_to_litr2n - m_frootn_to_litr3n => cnf%m_frootn_to_litr3n - m_livestemn_to_cwdn => cnf%m_livestemn_to_cwdn - m_deadstemn_to_cwdn => cnf%m_deadstemn_to_cwdn - m_livecrootn_to_cwdn => cnf%m_livecrootn_to_cwdn - m_deadcrootn_to_cwdn => cnf%m_deadcrootn_to_cwdn - m_retransn_to_litr1n => cnf%m_retransn_to_litr1n - m_leafn_storage_to_litr1n => cnf%m_leafn_storage_to_litr1n - m_frootn_storage_to_litr1n => cnf%m_frootn_storage_to_litr1n - m_livestemn_storage_to_litr1n => cnf%m_livestemn_storage_to_litr1n - m_deadstemn_storage_to_litr1n => cnf%m_deadstemn_storage_to_litr1n - m_livecrootn_storage_to_litr1n => cnf%m_livecrootn_storage_to_litr1n - m_deadcrootn_storage_to_litr1n => cnf%m_deadcrootn_storage_to_litr1n - m_leafn_xfer_to_litr1n => cnf%m_leafn_xfer_to_litr1n - m_frootn_xfer_to_litr1n => cnf%m_frootn_xfer_to_litr1n - m_livestemn_xfer_to_litr1n => cnf%m_livestemn_xfer_to_litr1n - m_deadstemn_xfer_to_litr1n => cnf%m_deadstemn_xfer_to_litr1n - m_livecrootn_xfer_to_litr1n => cnf%m_livecrootn_xfer_to_litr1n - m_deadcrootn_xfer_to_litr1n => cnf%m_deadcrootn_xfer_to_litr1n - - ! assign local pointers to pft-level arrays - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - m_leafc_to_litter => pcf%m_leafc_to_litter - m_frootc_to_litter => pcf%m_frootc_to_litter - m_livestemc_to_litter => pcf%m_livestemc_to_litter - m_deadstemc_to_litter => pcf%m_deadstemc_to_litter - m_livecrootc_to_litter => pcf%m_livecrootc_to_litter - m_deadcrootc_to_litter => pcf%m_deadcrootc_to_litter - m_leafc_storage_to_litter => pcf%m_leafc_storage_to_litter - m_frootc_storage_to_litter => pcf%m_frootc_storage_to_litter - m_livestemc_storage_to_litter => pcf%m_livestemc_storage_to_litter - m_deadstemc_storage_to_litter => pcf%m_deadstemc_storage_to_litter - m_livecrootc_storage_to_litter => pcf%m_livecrootc_storage_to_litter - m_deadcrootc_storage_to_litter => pcf%m_deadcrootc_storage_to_litter - m_gresp_storage_to_litter => pcf%m_gresp_storage_to_litter - m_leafc_xfer_to_litter => pcf%m_leafc_xfer_to_litter - m_frootc_xfer_to_litter => pcf%m_frootc_xfer_to_litter - m_livestemc_xfer_to_litter => pcf%m_livestemc_xfer_to_litter - m_deadstemc_xfer_to_litter => pcf%m_deadstemc_xfer_to_litter - m_livecrootc_xfer_to_litter => pcf%m_livecrootc_xfer_to_litter - m_deadcrootc_xfer_to_litter => pcf%m_deadcrootc_xfer_to_litter - m_gresp_xfer_to_litter => pcf%m_gresp_xfer_to_litter - m_leafn_to_litter => pnf%m_leafn_to_litter - m_frootn_to_litter => pnf%m_frootn_to_litter - m_livestemn_to_litter => pnf%m_livestemn_to_litter - m_deadstemn_to_litter => pnf%m_deadstemn_to_litter - m_livecrootn_to_litter => pnf%m_livecrootn_to_litter - m_deadcrootn_to_litter => pnf%m_deadcrootn_to_litter - m_retransn_to_litter => pnf%m_retransn_to_litter - m_leafn_storage_to_litter => pnf%m_leafn_storage_to_litter - m_frootn_storage_to_litter => pnf%m_frootn_storage_to_litter - m_livestemn_storage_to_litter => pnf%m_livestemn_storage_to_litter - m_deadstemn_storage_to_litter => pnf%m_deadstemn_storage_to_litter - m_livecrootn_storage_to_litter => pnf%m_livecrootn_storage_to_litter - m_deadcrootn_storage_to_litter => pnf%m_deadcrootn_storage_to_litter - m_leafn_xfer_to_litter => pnf%m_leafn_xfer_to_litter - m_frootn_xfer_to_litter => pnf%m_frootn_xfer_to_litter - m_livestemn_xfer_to_litter => pnf%m_livestemn_xfer_to_litter - m_deadstemn_xfer_to_litter => pnf%m_deadstemn_xfer_to_litter - m_livecrootn_xfer_to_litter => pnf%m_livecrootn_xfer_to_litter - m_deadcrootn_xfer_to_litter => pnf%m_deadcrootn_xfer_to_litter - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - - if (pwtgcell(p)>0._r8) then - - ! leaf gap mortality carbon fluxes - m_leafc_to_litr1c(c) = m_leafc_to_litr1c(c) + & - m_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - m_leafc_to_litr2c(c) = m_leafc_to_litr2c(c) + & - m_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - m_leafc_to_litr3c(c) = m_leafc_to_litr3c(c) + & - m_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root gap mortality carbon fluxes - m_frootc_to_litr1c(c) = m_frootc_to_litr1c(c) + & - m_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - m_frootc_to_litr2c(c) = m_frootc_to_litr2c(c) + & - m_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - m_frootc_to_litr3c(c) = m_frootc_to_litr3c(c) + & - m_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood gap mortality carbon fluxes - m_livestemc_to_cwdc(c) = m_livestemc_to_cwdc(c) + & - m_livestemc_to_litter(p) * wtcol(p) - m_deadstemc_to_cwdc(c) = m_deadstemc_to_cwdc(c) + & - m_deadstemc_to_litter(p) * wtcol(p) - m_livecrootc_to_cwdc(c) = m_livecrootc_to_cwdc(c) + & - m_livecrootc_to_litter(p) * wtcol(p) - m_deadcrootc_to_cwdc(c) = m_deadcrootc_to_cwdc(c) + & - m_deadcrootc_to_litter(p) * wtcol(p) - - ! storage gap mortality carbon fluxes - m_leafc_storage_to_litr1c(c) = m_leafc_storage_to_litr1c(c) + & - m_leafc_storage_to_litter(p) * wtcol(p) - m_frootc_storage_to_litr1c(c) = m_frootc_storage_to_litr1c(c) + & - m_frootc_storage_to_litter(p) * wtcol(p) - m_livestemc_storage_to_litr1c(c) = m_livestemc_storage_to_litr1c(c) + & - m_livestemc_storage_to_litter(p) * wtcol(p) - m_deadstemc_storage_to_litr1c(c) = m_deadstemc_storage_to_litr1c(c) + & - m_deadstemc_storage_to_litter(p) * wtcol(p) - m_livecrootc_storage_to_litr1c(c) = m_livecrootc_storage_to_litr1c(c) + & - m_livecrootc_storage_to_litter(p) * wtcol(p) - m_deadcrootc_storage_to_litr1c(c) = m_deadcrootc_storage_to_litr1c(c) + & - m_deadcrootc_storage_to_litter(p) * wtcol(p) - m_gresp_storage_to_litr1c(c) = m_gresp_storage_to_litr1c(c) + & - m_gresp_storage_to_litter(p) * wtcol(p) - - ! transfer gap mortality carbon fluxes - m_leafc_xfer_to_litr1c(c) = m_leafc_xfer_to_litr1c(c) + & - m_leafc_xfer_to_litter(p) * wtcol(p) - m_frootc_xfer_to_litr1c(c) = m_frootc_xfer_to_litr1c(c) + & - m_frootc_xfer_to_litter(p) * wtcol(p) - m_livestemc_xfer_to_litr1c(c) = m_livestemc_xfer_to_litr1c(c) + & - m_livestemc_xfer_to_litter(p) * wtcol(p) - m_deadstemc_xfer_to_litr1c(c) = m_deadstemc_xfer_to_litr1c(c) + & - m_deadstemc_xfer_to_litter(p) * wtcol(p) - m_livecrootc_xfer_to_litr1c(c) = m_livecrootc_xfer_to_litr1c(c) + & - m_livecrootc_xfer_to_litter(p) * wtcol(p) - m_deadcrootc_xfer_to_litr1c(c) = m_deadcrootc_xfer_to_litr1c(c) + & - m_deadcrootc_xfer_to_litter(p) * wtcol(p) - m_gresp_xfer_to_litr1c(c) = m_gresp_xfer_to_litr1c(c) + & - m_gresp_xfer_to_litter(p) * wtcol(p) - - ! leaf gap mortality nitrogen fluxes - m_leafn_to_litr1n(c) = m_leafn_to_litr1n(c) + & - m_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - m_leafn_to_litr2n(c) = m_leafn_to_litr2n(c) + & - m_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - m_leafn_to_litr3n(c) = m_leafn_to_litr3n(c) + & - m_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root litter nitrogen fluxes - m_frootn_to_litr1n(c) = m_frootn_to_litr1n(c) + & - m_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - m_frootn_to_litr2n(c) = m_frootn_to_litr2n(c) + & - m_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - m_frootn_to_litr3n(c) = m_frootn_to_litr3n(c) + & - m_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood gap mortality nitrogen fluxes - m_livestemn_to_cwdn(c) = m_livestemn_to_cwdn(c) + & - m_livestemn_to_litter(p) * wtcol(p) - m_deadstemn_to_cwdn(c) = m_deadstemn_to_cwdn(c) + & - m_deadstemn_to_litter(p) * wtcol(p) - m_livecrootn_to_cwdn(c) = m_livecrootn_to_cwdn(c) + & - m_livecrootn_to_litter(p) * wtcol(p) - m_deadcrootn_to_cwdn(c) = m_deadcrootn_to_cwdn(c) + & - m_deadcrootn_to_litter(p) * wtcol(p) - - ! retranslocated N pool gap mortality fluxes - m_retransn_to_litr1n(c) = m_retransn_to_litr1n(c) + & - m_retransn_to_litter(p) * wtcol(p) - - ! storage gap mortality nitrogen fluxes - m_leafn_storage_to_litr1n(c) = m_leafn_storage_to_litr1n(c) + & - m_leafn_storage_to_litter(p) * wtcol(p) - m_frootn_storage_to_litr1n(c) = m_frootn_storage_to_litr1n(c) + & - m_frootn_storage_to_litter(p) * wtcol(p) - m_livestemn_storage_to_litr1n(c) = m_livestemn_storage_to_litr1n(c) + & - m_livestemn_storage_to_litter(p) * wtcol(p) - m_deadstemn_storage_to_litr1n(c) = m_deadstemn_storage_to_litr1n(c) + & - m_deadstemn_storage_to_litter(p) * wtcol(p) - m_livecrootn_storage_to_litr1n(c) = m_livecrootn_storage_to_litr1n(c) + & - m_livecrootn_storage_to_litter(p) * wtcol(p) - m_deadcrootn_storage_to_litr1n(c) = m_deadcrootn_storage_to_litr1n(c) + & - m_deadcrootn_storage_to_litter(p) * wtcol(p) - - ! transfer gap mortality nitrogen fluxes - m_leafn_xfer_to_litr1n(c) = m_leafn_xfer_to_litr1n(c) + & - m_leafn_xfer_to_litter(p) * wtcol(p) - m_frootn_xfer_to_litr1n(c) = m_frootn_xfer_to_litr1n(c) + & - m_frootn_xfer_to_litter(p) * wtcol(p) - m_livestemn_xfer_to_litr1n(c) = m_livestemn_xfer_to_litr1n(c) + & - m_livestemn_xfer_to_litter(p) * wtcol(p) - m_deadstemn_xfer_to_litr1n(c) = m_deadstemn_xfer_to_litr1n(c) + & - m_deadstemn_xfer_to_litter(p) * wtcol(p) - m_livecrootn_xfer_to_litr1n(c) = m_livecrootn_xfer_to_litr1n(c) + & - m_livecrootn_xfer_to_litter(p) * wtcol(p) - m_deadcrootn_xfer_to_litr1n(c) = m_deadcrootn_xfer_to_litr1n(c) + & - m_deadcrootn_xfer_to_litter(p) * wtcol(p) - - end if - end if - - end do - - end do - -end subroutine CNGapPftToColumn -!----------------------------------------------------------------------- - -end module CNGapMortalityMod diff --git a/src_clm40/biogeochem/CNMRespMod.F90 b/src_clm40/biogeochem/CNMRespMod.F90 deleted file mode 100644 index bf2a1b6f15..0000000000 --- a/src_clm40/biogeochem/CNMRespMod.F90 +++ /dev/null @@ -1,180 +0,0 @@ -module CNMRespMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNMRespMod -! -! !DESCRIPTION: -! Module holding maintenance respiration routines for coupled carbon -! nitrogen code. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use clm_varpar , only: nlevgrnd - use shr_const_mod, only: SHR_CONST_TKFRZ - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNMResp -! -! !REVISION HISTORY: -! 8/14/03: Created by Peter Thornton -! 10/23/03, Peter Thornton: Migrated all subroutines to vector data structures. -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNMResp -! -! !INTERFACE: -subroutine CNMResp(lbc, ubc, num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! -! !USES: - use clmtype - use pftvarcon , only : npcropmin -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: num_soilc ! number of soil points in column filter - integer, intent(in) :: filter_soilc(:) ! column filter for soil points - integer, intent(in) :: num_soilp ! number of soil points in pft filter - integer, intent(in) :: filter_soilp(:) ! pft filter for soil points -! -! !CALLED FROM: -! subroutine CNEcosystemDyn in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 8/14/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in arrays -! - ! column level - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - ! pft level - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: rootfr(:,:) ! fraction of roots in each soil layer (nlevgrnd) - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! index into column level quantities - integer , pointer :: plandunit(:) ! index into landunit level quantities - integer , pointer :: clandunit(:) ! index into landunit level quantities - integer , pointer :: itypelun(:) ! landunit type - ! ecophysiological constants - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - logical , pointer :: croplive(:) ! Flag, true if planted, not harvested -! -! local pointers to implicit in/out arrays -! - ! pft level - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: livecroot_mr(:) -! -! !OTHER LOCAL VARIABLES: - integer :: c,p,j ! indices - integer :: fp ! soil filter pft index - integer :: fc ! soil filter column index - real(r8):: mr ! maintenance respiration (gC/m2/s) - real(r8):: br ! base rate (gC/gN/s) - real(r8):: q10 ! temperature dependence - real(r8):: tc ! temperature correction, 2m air temp (unitless) - real(r8):: tcsoi(lbc:ubc,nlevgrnd) ! temperature correction by soil layer (unitless) -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays - t_soisno => ces%t_soisno - t_ref2m => pes%t_ref2m - leafn => pns%leafn - frootn => pns%frootn - livestemn => pns%livestemn - livecrootn => pns%livecrootn - rootfr => pps%rootfr - leaf_mr => pcf%leaf_mr - froot_mr => pcf%froot_mr - livestem_mr => pcf%livestem_mr - livecroot_mr => pcf%livecroot_mr - ivt => pft%itype - pcolumn => pft%column - plandunit => pft%landunit - clandunit => col%landunit - itypelun => lun%itype - woody => pftcon%woody - croplive => pps%croplive - - ! base rate for maintenance respiration is from: - ! M. Ryan, 1991. Effects of climate change on plant respiration. - ! Ecological Applications, 1(2), 157-167. - ! Original expression is br = 0.0106 molC/(molN h) - ! Conversion by molecular weights of C and N gives 2.525e-6 gC/(gN s) - br = 2.525e-6_r8 - ! Peter Thornton: 3/13/09 - ! Q10 was originally set to 2.0, an arbitrary choice, but reduced to 1.5 as part of the tuning - ! to improve seasonal cycle of atmospheric CO2 concentration in global - ! simulatoins - q10 = 1.5_r8 - - ! column loop to calculate temperature factors in each soil layer - do j=1,nlevgrnd - do fc = 1, num_soilc - c = filter_soilc(fc) - - ! calculate temperature corrections for each soil layer, for use in - ! estimating fine root maintenance respiration with depth - - tcsoi(c,j) = q10**((t_soisno(c,j)-SHR_CONST_TKFRZ - 20.0_r8)/10.0_r8) - end do - end do - - ! pft loop for leaves and live wood - do fp = 1, num_soilp - p = filter_soilp(fp) - - ! calculate maintenance respiration fluxes in - ! gC/m2/s for each of the live plant tissues. - ! Leaf and live wood MR - - tc = q10**((t_ref2m(p)-SHR_CONST_TKFRZ - 20.0_r8)/10.0_r8) - leaf_mr(p) = leafn(p)*br*tc - if (woody(ivt(p)) == 1) then - livestem_mr(p) = livestemn(p)*br*tc - livecroot_mr(p) = livecrootn(p)*br*tc - else if (ivt(p) >= npcropmin) then - livestem_mr(p) = livestemn(p)*br*tc - end if - end do - - ! soil and pft loop for fine root - do j = 1,nlevgrnd - do fp = 1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - - ! Fine root MR - ! rootfr(j) sums to 1.0 over all soil layers, and - ! describes the fraction of root mass that is in each - ! layer. This is used with the layer temperature correction - ! to estimate the total fine root maintenance respiration as a - ! function of temperature and N content. - - froot_mr(p) = froot_mr(p) + frootn(p)*br*tcsoi(c,j)*rootfr(p,j) - end do - end do - -end subroutine CNMResp - -end module CNMRespMod diff --git a/src_clm40/biogeochem/CNNDynamicsMod.F90 b/src_clm40/biogeochem/CNNDynamicsMod.F90 deleted file mode 100644 index 756ababeb8..0000000000 --- a/src_clm40/biogeochem/CNNDynamicsMod.F90 +++ /dev/null @@ -1,268 +0,0 @@ -module CNNDynamicsMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNNDynamicsMod -! -! !DESCRIPTION: -! Module for mineral nitrogen dynamics (deposition, fixation, leaching) -! for coupled carbon-nitrogen code. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNNDeposition - public :: CNNFixation - public :: CNNLeaching -! -! !REVISION HISTORY: -! 6/1/04: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNNDeposition -! -! !INTERFACE: -subroutine CNNDeposition( lbc, ubc ) -! -! !DESCRIPTION: -! On the radiation time step, update the nitrogen deposition rate -! from atmospheric forcing. For now it is assumed that all the atmospheric -! N deposition goes to the soil mineral N pool. -! This could be updated later to divide the inputs between mineral N absorbed -! directly into the canopy and mineral N entering the soil pool. -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds -! -! !CALLED FROM: -! subroutine CNEcosystemDyn, in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 6/1/04: Created by Peter Thornton -! 11/06/09: Copy to all columns NOT just over soil. S. Levis -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: forc_ndep(:) ! nitrogen deposition rate (gN/m2/s) - integer , pointer :: gridcell(:) ! index into gridcell level quantities -! -! local pointers to implicit out scalars -! - real(r8), pointer :: ndep_to_sminn(:) -! -! !OTHER LOCAL VARIABLES: - integer :: g,c ! indices - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - forc_ndep => clm_a2l%forc_ndep - gridcell => col%gridcell - - ! Assign local pointers to derived type arrays (out) - ndep_to_sminn => cnf%ndep_to_sminn - - ! Loop through columns - do c = lbc, ubc - g = gridcell(c) - - ndep_to_sminn(c) = forc_ndep(g) - - end do - -end subroutine CNNDeposition - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNNFixation -! -! !INTERFACE: -subroutine CNNFixation(num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, update the nitrogen fixation rate -! as a function of annual total NPP. This rate gets updated once per year. -! All N fixation goes to the soil mineral N pool. -! -! !USES: - use clmtype - use clm_varctl , only: iulog - use clm_time_manager, only: get_days_per_year - use shr_sys_mod , only: shr_sys_flush - use clm_varcon , only: secspday -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNEcosystemDyn, in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 6/1/04: Created by Peter Thornton -! 2/14/05, PET: After looking at a number of point simulations, -! it looks like a constant Nfix might be more efficient and -! maybe more realistic - setting to constant 0.4 gN/m2/yr. -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: cannsum_npp(:) ! nitrogen deposition rate (gN/m2/s) -! -! local pointers to implicit out scalars -! - real(r8), pointer :: nfix_to_sminn(:) -! -! !OTHER LOCAL VARIABLES: - integer :: c,fc ! indices - real(r8) :: t ! temporary - real(r8) :: dayspyr ! days per year - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - cannsum_npp => cps%cannsum_npp - - ! Assign local pointers to derived type arrays (out) - nfix_to_sminn => cnf%nfix_to_sminn - - dayspyr = get_days_per_year() - - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! the value 0.001666 is set to give 100 TgN/yr when global - ! NPP = 60 PgC/yr. (Cleveland et al., 1999) - ! Convert from gN/m2/yr -> gN/m2/s - !t = cannsum_npp(c) * 0.001666_r8 / (secspday * dayspyr) - t = (1.8_r8 * (1._r8 - exp(-0.003_r8 * cannsum_npp(c))))/(secspday * dayspyr) - nfix_to_sminn(c) = max(0._r8,t) - ! PET 2/14/05: commenting out the dependence on NPP, and - ! forcing Nfix to global constant = 0.4 gN/m2/yr - !nfix_to_sminn(c) = 0.4 / (secspday*dayspyr) - - end do - -end subroutine CNNFixation - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNNLeaching -! -! !INTERFACE: -subroutine CNNLeaching(lbc, ubc, num_soilc, filter_soilc) -! -! !DESCRIPTION: -! On the radiation time step, update the nitrogen leaching rate -! as a function of soluble mineral N and total soil water outflow. -! -! !USES: - use clmtype - use clm_varpar , only : nlevsoi - use clm_time_manager , only : get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 6/9/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: qflx_drain(:) ! sub-surface runoff (mm H2O /s) - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N -! -! local pointers to implicit out scalars -! - real(r8), pointer :: sminn_leached(:) ! rate of mineral N leaching (gN/m2/s) -! -! !OTHER LOCAL VARIABLES: - integer :: j,c,fc ! indices - real(r8) :: dt ! radiation time step (seconds) - real(r8) :: tot_water(lbc:ubc) ! total column liquid water (kg water/m2) - real(r8) :: sf ! soluble fraction of mineral N (unitless) - real(r8) :: disn_conc ! dissolved mineral N concentration - ! (gN/kg water) - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - h2osoi_liq => cws%h2osoi_liq - qflx_drain => cwf%qflx_drain - sminn => cns%sminn - - ! Assign local pointers to derived type arrays (out) - sminn_leached => cnf%sminn_leached - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! Assume that 10% of the soil mineral N is in a soluble form - sf = 0.1_r8 - - ! calculate the total soil water - tot_water(lbc:ubc) = 0._r8 - do j = 1,nlevsoi - do fc = 1,num_soilc - c = filter_soilc(fc) - tot_water(c) = tot_water(c) + h2osoi_liq(c,j) - end do - end do - - ! Loop through columns - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate the dissolved mineral N concentration (gN/kg water) - ! assumes that 10% of mineral nitrogen is soluble - disn_conc = 0._r8 - if (tot_water(c) > 0._r8) then - disn_conc = (sf * sminn(c))/tot_water(c) - end if - - ! calculate the N leaching flux as a function of the dissolved - ! concentration and the sub-surface drainage flux - sminn_leached(c) = disn_conc * qflx_drain(c) - - ! limit the flux based on current sminn state - ! only let at most the assumed soluble fraction - ! of sminn be leached on any given timestep - sminn_leached(c) = min(sminn_leached(c), (sf * sminn(c))/dt) - - ! limit the flux to a positive value - sminn_leached(c) = max(sminn_leached(c), 0._r8) - - end do - -end subroutine CNNLeaching - -end module CNNDynamicsMod diff --git a/src_clm40/biogeochem/CNNStateUpdate1Mod.F90 b/src_clm40/biogeochem/CNNStateUpdate1Mod.F90 deleted file mode 100644 index a6518f3a75..0000000000 --- a/src_clm40/biogeochem/CNNStateUpdate1Mod.F90 +++ /dev/null @@ -1,537 +0,0 @@ -module CNNStateUpdate1Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: NStateUpdate1Mod -! -! !DESCRIPTION: -! Module for nitrogen state variable updates, non-mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: NStateUpdate1 -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NStateUpdate1 -! -! !INTERFACE: -subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic nitrogen state -! variables (except for gap-phase mortality and fire fluxes) -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use pftvarcon , only: npcropmin, nc3crop - use surfrdMod , only: crop_prog -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: cwdn_to_litr2n(:) ! decomp. of coarse woody debris N to litter 2 N (gN/m2/s) - real(r8), pointer :: cwdn_to_litr3n(:) ! decomp. of coarse woody debris N to litter 3 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr1n(:) ! grain N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr2n(:) ! grain N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr3n(:) ! grain N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr1n(:) ! livestem N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr2n(:) ! livestem N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr3n(:) ! livestem N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr1n(:) ! fine root N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr2n(:) ! fine root N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr3n(:) ! fine root N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr1n(:) ! leaf N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr2n(:) ! leaf N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr3n(:) ! leaf N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: litr1n_to_soil1n(:) - real(r8), pointer :: litr2n_to_soil2n(:) - real(r8), pointer :: litr3n_to_soil3n(:) - real(r8), pointer :: ndep_to_sminn(:) - real(r8), pointer :: nfix_to_sminn(:) ! symbiotic/asymbiotic N fixation to soil mineral N (gN/m2/s) - real(r8), pointer :: sminn_to_denit_excess(:) - real(r8), pointer :: sminn_to_denit_l1s1(:) - real(r8), pointer :: sminn_to_denit_l2s2(:) - real(r8), pointer :: sminn_to_denit_l3s3(:) - real(r8), pointer :: sminn_to_denit_s1s2(:) - real(r8), pointer :: sminn_to_denit_s2s3(:) - real(r8), pointer :: sminn_to_denit_s3s4(:) - real(r8), pointer :: sminn_to_denit_s4(:) - real(r8), pointer :: sminn_to_plant(:) - real(r8), pointer :: sminn_to_soil1n_l1(:) - real(r8), pointer :: sminn_to_soil2n_l2(:) - real(r8), pointer :: sminn_to_soil2n_s1(:) - real(r8), pointer :: sminn_to_soil3n_l3(:) - real(r8), pointer :: sminn_to_soil3n_s2(:) - real(r8), pointer :: sminn_to_soil4n_s3(:) - real(r8), pointer :: soil1n_to_soil2n(:) - real(r8), pointer :: soil2n_to_soil3n(:) - real(r8), pointer :: soil3n_to_soil4n(:) - real(r8), pointer :: soil4n_to_sminn(:) - real(r8), pointer :: supplement_to_sminn(:) - real(r8), pointer :: deadcrootn_storage_to_xfer(:) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn(:) - real(r8), pointer :: deadstemn_storage_to_xfer(:) - real(r8), pointer :: deadstemn_xfer_to_deadstemn(:) - real(r8), pointer :: frootn_storage_to_xfer(:) - real(r8), pointer :: frootn_to_litter(:) - real(r8), pointer :: frootn_xfer_to_frootn(:) - real(r8), pointer :: leafn_storage_to_xfer(:) - real(r8), pointer :: leafn_to_litter(:) - real(r8), pointer :: leafn_to_retransn(:) - real(r8), pointer :: leafn_xfer_to_leafn(:) - real(r8), pointer :: livecrootn_storage_to_xfer(:) - real(r8), pointer :: livecrootn_to_deadcrootn(:) - real(r8), pointer :: livecrootn_to_retransn(:) - real(r8), pointer :: livecrootn_xfer_to_livecrootn(:) - real(r8), pointer :: livestemn_storage_to_xfer(:) - real(r8), pointer :: livestemn_to_deadstemn(:) - real(r8), pointer :: livestemn_to_retransn(:) - real(r8), pointer :: livestemn_xfer_to_livestemn(:) - real(r8), pointer :: npool_to_deadcrootn(:) - real(r8), pointer :: npool_to_deadcrootn_storage(:) - real(r8), pointer :: npool_to_deadstemn(:) - real(r8), pointer :: npool_to_deadstemn_storage(:) - real(r8), pointer :: npool_to_frootn(:) - real(r8), pointer :: npool_to_frootn_storage(:) - real(r8), pointer :: npool_to_leafn(:) - real(r8), pointer :: npool_to_leafn_storage(:) - real(r8), pointer :: npool_to_livecrootn(:) - real(r8), pointer :: npool_to_livecrootn_storage(:) - real(r8), pointer :: npool_to_livestemn(:) ! allocation to live stem N (gN/m2/s) - real(r8), pointer :: npool_to_livestemn_storage(:) ! allocation to live stem N storage (gN/m2/s) - real(r8), pointer :: retransn_to_npool(:) ! deployment of retranslocated N (gN/m2/s) - real(r8), pointer :: sminn_to_npool(:) ! deployment of soil mineral N uptake (gN/m2/s) - real(r8), pointer :: grainn_storage_to_xfer(:) ! grain N shift storage to transfer (gN/m2/s) - real(r8), pointer :: grainn_to_food(:) ! grain N to food (gN/m2/s) - real(r8), pointer :: grainn_xfer_to_grainn(:) ! grain N growth from storage (gN/m2/s) - real(r8), pointer :: livestemn_to_litter(:) ! livestem N to litter (gN/m2/s) - real(r8), pointer :: npool_to_grainn(:) ! allocation to grain N (gN/m2/s) - real(r8), pointer :: npool_to_grainn_storage(:) ! allocation to grain N storage (gN/m2/s) -! -! local pointers to implicit in/out scalars - real(r8), pointer :: grainn(:) ! (gN/m2) grain N - real(r8), pointer :: grainn_storage(:) ! (gN/m2) grain N storage - real(r8), pointer :: grainn_xfer(:) ! (gN/m2) grain N transfer - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - real(r8), pointer :: soil1n(:) ! (gN/m2) soil organic matter N (fast pool) - real(r8), pointer :: soil2n(:) ! (gN/m2) soil organic matter N (medium pool) - real(r8), pointer :: soil3n(:) ! (gN/m2) soil orgainc matter N (slow pool) - real(r8), pointer :: soil4n(:) ! (gN/m2) soil orgainc matter N (slowest pool) - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: npool(:) ! (gN/m2) temporary plant N pool - -! local pointers for dynamic landcover fluxes and states - real(r8), pointer :: dwt_seedn_to_leaf(:) - real(r8), pointer :: dwt_seedn_to_deadstem(:) - real(r8), pointer :: dwt_frootn_to_litr1n(:) - real(r8), pointer :: dwt_frootn_to_litr2n(:) - real(r8), pointer :: dwt_frootn_to_litr3n(:) - real(r8), pointer :: dwt_livecrootn_to_cwdn(:) - real(r8), pointer :: dwt_deadcrootn_to_cwdn(:) - real(r8), pointer :: seedn(:) -! -! local pointers to implicit out scalars - real(r8), pointer :: col_begnb(:) ! nitrogen mass, beginning of time step (gN/m**2) - real(r8), pointer :: pft_begnb(:) ! nitrogen mass, beginning of time step (gN/m**2) -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers - woody => pftcon%woody - - ! assign local pointers at the column level - cwdn_to_litr2n => cnf%cwdn_to_litr2n - cwdn_to_litr3n => cnf%cwdn_to_litr3n - livestemn_to_litr1n => cnf%livestemn_to_litr1n - livestemn_to_litr2n => cnf%livestemn_to_litr2n - livestemn_to_litr3n => cnf%livestemn_to_litr3n - grainn_to_litr1n => cnf%grainn_to_litr1n - grainn_to_litr2n => cnf%grainn_to_litr2n - grainn_to_litr3n => cnf%grainn_to_litr3n - frootn_to_litr1n => cnf%frootn_to_litr1n - frootn_to_litr2n => cnf%frootn_to_litr2n - frootn_to_litr3n => cnf%frootn_to_litr3n - leafn_to_litr1n => cnf%leafn_to_litr1n - leafn_to_litr2n => cnf%leafn_to_litr2n - leafn_to_litr3n => cnf%leafn_to_litr3n - litr1n_to_soil1n => cnf%litr1n_to_soil1n - litr2n_to_soil2n => cnf%litr2n_to_soil2n - litr3n_to_soil3n => cnf%litr3n_to_soil3n - ndep_to_sminn => cnf%ndep_to_sminn - nfix_to_sminn => cnf%nfix_to_sminn - sminn_to_denit_excess => cnf%sminn_to_denit_excess - sminn_to_denit_l1s1 => cnf%sminn_to_denit_l1s1 - sminn_to_denit_l2s2 => cnf%sminn_to_denit_l2s2 - sminn_to_denit_l3s3 => cnf%sminn_to_denit_l3s3 - sminn_to_denit_s1s2 => cnf%sminn_to_denit_s1s2 - sminn_to_denit_s2s3 => cnf%sminn_to_denit_s2s3 - sminn_to_denit_s3s4 => cnf%sminn_to_denit_s3s4 - sminn_to_denit_s4 => cnf%sminn_to_denit_s4 - sminn_to_plant => cnf%sminn_to_plant - sminn_to_soil1n_l1 => cnf%sminn_to_soil1n_l1 - sminn_to_soil2n_l2 => cnf%sminn_to_soil2n_l2 - sminn_to_soil2n_s1 => cnf%sminn_to_soil2n_s1 - sminn_to_soil3n_l3 => cnf%sminn_to_soil3n_l3 - sminn_to_soil3n_s2 => cnf%sminn_to_soil3n_s2 - sminn_to_soil4n_s3 => cnf%sminn_to_soil4n_s3 - soil1n_to_soil2n => cnf%soil1n_to_soil2n - soil2n_to_soil3n => cnf%soil2n_to_soil3n - soil3n_to_soil4n => cnf%soil3n_to_soil4n - soil4n_to_sminn => cnf%soil4n_to_sminn - supplement_to_sminn => cnf%supplement_to_sminn - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - sminn => cns%sminn - soil1n => cns%soil1n - soil2n => cns%soil2n - soil3n => cns%soil3n - soil4n => cns%soil4n - ! new pointers for dynamic landcover - dwt_seedn_to_leaf => cnf%dwt_seedn_to_leaf - dwt_seedn_to_deadstem => cnf%dwt_seedn_to_deadstem - dwt_frootn_to_litr1n => cnf%dwt_frootn_to_litr1n - dwt_frootn_to_litr2n => cnf%dwt_frootn_to_litr2n - dwt_frootn_to_litr3n => cnf%dwt_frootn_to_litr3n - dwt_livecrootn_to_cwdn => cnf%dwt_livecrootn_to_cwdn - dwt_deadcrootn_to_cwdn => cnf%dwt_deadcrootn_to_cwdn - seedn => cns%seedn - - ! assign local pointers at the pft level - ivt => pft%itype - deadcrootn_storage_to_xfer => pnf%deadcrootn_storage_to_xfer - deadcrootn_xfer_to_deadcrootn => pnf%deadcrootn_xfer_to_deadcrootn - deadstemn_storage_to_xfer => pnf%deadstemn_storage_to_xfer - deadstemn_xfer_to_deadstemn => pnf%deadstemn_xfer_to_deadstemn - frootn_storage_to_xfer => pnf%frootn_storage_to_xfer - frootn_to_litter => pnf%frootn_to_litter - frootn_xfer_to_frootn => pnf%frootn_xfer_to_frootn - leafn_storage_to_xfer => pnf%leafn_storage_to_xfer - leafn_to_litter => pnf%leafn_to_litter - leafn_to_retransn => pnf%leafn_to_retransn - leafn_xfer_to_leafn => pnf%leafn_xfer_to_leafn - livecrootn_storage_to_xfer => pnf%livecrootn_storage_to_xfer - livecrootn_to_deadcrootn => pnf%livecrootn_to_deadcrootn - livecrootn_to_retransn => pnf%livecrootn_to_retransn - livecrootn_xfer_to_livecrootn => pnf%livecrootn_xfer_to_livecrootn - livestemn_storage_to_xfer => pnf%livestemn_storage_to_xfer - livestemn_to_deadstemn => pnf%livestemn_to_deadstemn - livestemn_to_retransn => pnf%livestemn_to_retransn - livestemn_xfer_to_livestemn => pnf%livestemn_xfer_to_livestemn - npool_to_deadcrootn => pnf%npool_to_deadcrootn - npool_to_deadcrootn_storage => pnf%npool_to_deadcrootn_storage - npool_to_deadstemn => pnf%npool_to_deadstemn - npool_to_deadstemn_storage => pnf%npool_to_deadstemn_storage - npool_to_frootn => pnf%npool_to_frootn - npool_to_frootn_storage => pnf%npool_to_frootn_storage - npool_to_leafn => pnf%npool_to_leafn - npool_to_leafn_storage => pnf%npool_to_leafn_storage - npool_to_livecrootn => pnf%npool_to_livecrootn - npool_to_livecrootn_storage => pnf%npool_to_livecrootn_storage - npool_to_livestemn => pnf%npool_to_livestemn - npool_to_livestemn_storage => pnf%npool_to_livestemn_storage - retransn_to_npool => pnf%retransn_to_npool - sminn_to_npool => pnf%sminn_to_npool - grainn_storage_to_xfer => pnf%grainn_storage_to_xfer - grainn_to_food => pnf%grainn_to_food - grainn_xfer_to_grainn => pnf%grainn_xfer_to_grainn - livestemn_to_litter => pnf%livestemn_to_litter - npool_to_grainn => pnf%npool_to_grainn - npool_to_grainn_storage => pnf%npool_to_grainn_storage - grainn => pns%grainn - grainn_storage => pns%grainn_storage - grainn_xfer => pns%grainn_xfer - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - npool => pns%npool - retransn => pns%retransn - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column-level fluxes - - ! N deposition and fixation - sminn(c) = sminn(c) + ndep_to_sminn(c)*dt - sminn(c) = sminn(c) + nfix_to_sminn(c)*dt - - ! plant to litter fluxes - ! leaf litter - litr1n(c) = litr1n(c) + leafn_to_litr1n(c)*dt - litr2n(c) = litr2n(c) + leafn_to_litr2n(c)*dt - litr3n(c) = litr3n(c) + leafn_to_litr3n(c)*dt - ! fine root litter - litr1n(c) = litr1n(c) + frootn_to_litr1n(c)*dt - litr2n(c) = litr2n(c) + frootn_to_litr2n(c)*dt - litr3n(c) = litr3n(c) + frootn_to_litr3n(c)*dt - if ( crop_prog )then - ! livestem litter - litr1n(c) = litr1n(c) + livestemn_to_litr1n(c)*dt - litr2n(c) = litr2n(c) + livestemn_to_litr2n(c)*dt - litr3n(c) = litr3n(c) + livestemn_to_litr3n(c)*dt - ! grain litter - litr1n(c) = litr1n(c) + grainn_to_litr1n(c)*dt - litr2n(c) = litr2n(c) + grainn_to_litr2n(c)*dt - litr3n(c) = litr3n(c) + grainn_to_litr3n(c)*dt - end if - - ! seeding fluxes, from dynamic landcover - seedn(c) = seedn(c) - dwt_seedn_to_leaf(c) * dt - seedn(c) = seedn(c) - dwt_seedn_to_deadstem(c) * dt - - ! fluxes into litter and CWD, from dynamic landcover - litr1n(c) = litr1n(c) + dwt_frootn_to_litr1n(c)*dt - litr2n(c) = litr2n(c) + dwt_frootn_to_litr2n(c)*dt - litr3n(c) = litr3n(c) + dwt_frootn_to_litr3n(c)*dt - cwdn(c) = cwdn(c) + dwt_livecrootn_to_cwdn(c)*dt - cwdn(c) = cwdn(c) + dwt_deadcrootn_to_cwdn(c)*dt - - ! CWD to litter fluxes - cwdn(c) = cwdn(c) - cwdn_to_litr2n(c)*dt - litr2n(c) = litr2n(c) + cwdn_to_litr2n(c)*dt - cwdn(c) = cwdn(c) - cwdn_to_litr3n(c)*dt - litr3n(c) = litr3n(c) + cwdn_to_litr3n(c)*dt - - ! update litter states - litr1n(c) = litr1n(c) - litr1n_to_soil1n(c)*dt - litr2n(c) = litr2n(c) - litr2n_to_soil2n(c)*dt - litr3n(c) = litr3n(c) - litr3n_to_soil3n(c)*dt - - ! update SOM states - soil1n(c) = soil1n(c) + & - (litr1n_to_soil1n(c) + sminn_to_soil1n_l1(c) - soil1n_to_soil2n(c))*dt - soil2n(c) = soil2n(c) + & - (litr2n_to_soil2n(c) + sminn_to_soil2n_l2(c) + & - soil1n_to_soil2n(c) + sminn_to_soil2n_s1(c) - soil2n_to_soil3n(c))*dt - soil3n(c) = soil3n(c) + & - (litr3n_to_soil3n(c) + sminn_to_soil3n_l3(c) + & - soil2n_to_soil3n(c) + sminn_to_soil3n_s2(c) - soil3n_to_soil4n(c))*dt - soil4n(c) = soil4n(c) + & - (soil3n_to_soil4n(c) + sminn_to_soil4n_s3(c) - soil4n_to_sminn(c))*dt - - ! immobilization/mineralization in litter-to-SOM and SOM-to-SOM fluxes - sminn(c) = sminn(c) - & - (sminn_to_soil1n_l1(c) + sminn_to_soil2n_l2(c) + & - sminn_to_soil3n_l3(c) + sminn_to_soil2n_s1(c) + & - sminn_to_soil3n_s2(c) + sminn_to_soil4n_s3(c) - & - soil4n_to_sminn(c))*dt - - ! denitrification fluxes - sminn(c) = sminn(c) - & - (sminn_to_denit_l1s1(c) + sminn_to_denit_l2s2(c) + & - sminn_to_denit_l3s3(c) + sminn_to_denit_s1s2(c) + & - sminn_to_denit_s2s3(c) + sminn_to_denit_s3s4(c) + & - sminn_to_denit_s4(c) + sminn_to_denit_excess(c))*dt - - ! total plant uptake from mineral N - sminn(c) = sminn(c) - sminn_to_plant(c)*dt - - ! flux that prevents N limitation (when Carbon_only is set) - sminn(c) = sminn(c) + supplement_to_sminn(c)*dt - - end do ! end of column loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! phenology: transfer growth fluxes - leafn(p) = leafn(p) + leafn_xfer_to_leafn(p)*dt - leafn_xfer(p) = leafn_xfer(p) - leafn_xfer_to_leafn(p)*dt - frootn(p) = frootn(p) + frootn_xfer_to_frootn(p)*dt - frootn_xfer(p) = frootn_xfer(p) - frootn_xfer_to_frootn(p)*dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn(p) = livestemn(p) + livestemn_xfer_to_livestemn(p)*dt - livestemn_xfer(p) = livestemn_xfer(p) - livestemn_xfer_to_livestemn(p)*dt - deadstemn(p) = deadstemn(p) + deadstemn_xfer_to_deadstemn(p)*dt - deadstemn_xfer(p) = deadstemn_xfer(p) - deadstemn_xfer_to_deadstemn(p)*dt - livecrootn(p) = livecrootn(p) + livecrootn_xfer_to_livecrootn(p)*dt - livecrootn_xfer(p) = livecrootn_xfer(p) - livecrootn_xfer_to_livecrootn(p)*dt - deadcrootn(p) = deadcrootn(p) + deadcrootn_xfer_to_deadcrootn(p)*dt - deadcrootn_xfer(p) = deadcrootn_xfer(p) - deadcrootn_xfer_to_deadcrootn(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - livestemn(p) = livestemn(p) + livestemn_xfer_to_livestemn(p)*dt - livestemn_xfer(p) = livestemn_xfer(p) - livestemn_xfer_to_livestemn(p)*dt - grainn(p) = grainn(p) + grainn_xfer_to_grainn(p)*dt - grainn_xfer(p) = grainn_xfer(p) - grainn_xfer_to_grainn(p)*dt - end if - - ! phenology: litterfall and retranslocation fluxes - leafn(p) = leafn(p) - leafn_to_litter(p)*dt - frootn(p) = frootn(p) - frootn_to_litter(p)*dt - leafn(p) = leafn(p) - leafn_to_retransn(p)*dt - retransn(p) = retransn(p) + leafn_to_retransn(p)*dt - - ! live wood turnover and retranslocation fluxes - if (woody(ivt(p)) == 1._r8) then - livestemn(p) = livestemn(p) - livestemn_to_deadstemn(p)*dt - deadstemn(p) = deadstemn(p) + livestemn_to_deadstemn(p)*dt - livestemn(p) = livestemn(p) - livestemn_to_retransn(p)*dt - retransn(p) = retransn(p) + livestemn_to_retransn(p)*dt - livecrootn(p) = livecrootn(p) - livecrootn_to_deadcrootn(p)*dt - deadcrootn(p) = deadcrootn(p) + livecrootn_to_deadcrootn(p)*dt - livecrootn(p) = livecrootn(p) - livecrootn_to_retransn(p)*dt - retransn(p) = retransn(p) + livecrootn_to_retransn(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - livestemn(p) = livestemn(p) - livestemn_to_litter(p)*dt - livestemn(p) = livestemn(p) - livestemn_to_retransn(p)*dt - retransn(p) = retransn(p) + livestemn_to_retransn(p)*dt - grainn(p) = grainn(p) - grainn_to_food(p)*dt - end if - - ! uptake from soil mineral N pool - npool(p) = npool(p) + sminn_to_npool(p)*dt - - ! deployment from retranslocation pool - npool(p) = npool(p) + retransn_to_npool(p)*dt - retransn(p) = retransn(p) - retransn_to_npool(p)*dt - - ! allocation fluxes - npool(p) = npool(p) - npool_to_leafn(p)*dt - leafn(p) = leafn(p) + npool_to_leafn(p)*dt - npool(p) = npool(p) - npool_to_leafn_storage(p)*dt - leafn_storage(p) = leafn_storage(p) + npool_to_leafn_storage(p)*dt - npool(p) = npool(p) - npool_to_frootn(p)*dt - frootn(p) = frootn(p) + npool_to_frootn(p)*dt - npool(p) = npool(p) - npool_to_frootn_storage(p)*dt - frootn_storage(p) = frootn_storage(p) + npool_to_frootn_storage(p)*dt - if (woody(ivt(p)) == 1._r8) then - npool(p) = npool(p) - npool_to_livestemn(p)*dt - livestemn(p) = livestemn(p) + npool_to_livestemn(p)*dt - npool(p) = npool(p) - npool_to_livestemn_storage(p)*dt - livestemn_storage(p) = livestemn_storage(p) + npool_to_livestemn_storage(p)*dt - npool(p) = npool(p) - npool_to_deadstemn(p)*dt - deadstemn(p) = deadstemn(p) + npool_to_deadstemn(p)*dt - npool(p) = npool(p) - npool_to_deadstemn_storage(p)*dt - deadstemn_storage(p) = deadstemn_storage(p) + npool_to_deadstemn_storage(p)*dt - npool(p) = npool(p) - npool_to_livecrootn(p)*dt - livecrootn(p) = livecrootn(p) + npool_to_livecrootn(p)*dt - npool(p) = npool(p) - npool_to_livecrootn_storage(p)*dt - livecrootn_storage(p) = livecrootn_storage(p) + npool_to_livecrootn_storage(p)*dt - npool(p) = npool(p) - npool_to_deadcrootn(p)*dt - deadcrootn(p) = deadcrootn(p) + npool_to_deadcrootn(p)*dt - npool(p) = npool(p) - npool_to_deadcrootn_storage(p)*dt - deadcrootn_storage(p) = deadcrootn_storage(p) + npool_to_deadcrootn_storage(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - npool(p) = npool(p) - npool_to_livestemn(p)*dt - livestemn(p) = livestemn(p) + npool_to_livestemn(p)*dt - npool(p) = npool(p) - npool_to_livestemn_storage(p)*dt - livestemn_storage(p) = livestemn_storage(p) + npool_to_livestemn_storage(p)*dt - npool(p) = npool(p) - npool_to_grainn(p)*dt - grainn(p) = grainn(p) + npool_to_grainn(p)*dt - npool(p) = npool(p) - npool_to_grainn_storage(p)*dt - grainn_storage(p) = grainn_storage(p) + npool_to_grainn_storage(p)*dt - end if - - ! move storage pools into transfer pools - leafn_storage(p) = leafn_storage(p) - leafn_storage_to_xfer(p)*dt - leafn_xfer(p) = leafn_xfer(p) + leafn_storage_to_xfer(p)*dt - frootn_storage(p) = frootn_storage(p) - frootn_storage_to_xfer(p)*dt - frootn_xfer(p) = frootn_xfer(p) + frootn_storage_to_xfer(p)*dt - if (woody(ivt(p)) == 1._r8) then - livestemn_storage(p) = livestemn_storage(p) - livestemn_storage_to_xfer(p)*dt - livestemn_xfer(p) = livestemn_xfer(p) + livestemn_storage_to_xfer(p)*dt - deadstemn_storage(p) = deadstemn_storage(p) - deadstemn_storage_to_xfer(p)*dt - deadstemn_xfer(p) = deadstemn_xfer(p) + deadstemn_storage_to_xfer(p)*dt - livecrootn_storage(p) = livecrootn_storage(p) - livecrootn_storage_to_xfer(p)*dt - livecrootn_xfer(p) = livecrootn_xfer(p) + livecrootn_storage_to_xfer(p)*dt - deadcrootn_storage(p) = deadcrootn_storage(p) - deadcrootn_storage_to_xfer(p)*dt - deadcrootn_xfer(p) = deadcrootn_xfer(p) + deadcrootn_storage_to_xfer(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops - ! lines here for consistency; the transfer terms are zero - livestemn_storage(p) = livestemn_storage(p) - livestemn_storage_to_xfer(p)*dt - livestemn_xfer(p) = livestemn_xfer(p) + livestemn_storage_to_xfer(p)*dt - grainn_storage(p) = grainn_storage(p) - grainn_storage_to_xfer(p)*dt - grainn_xfer(p) = grainn_xfer(p) + grainn_storage_to_xfer(p)*dt - end if - - end do - -end subroutine NStateUpdate1 -!----------------------------------------------------------------------- - -end module CNNStateUpdate1Mod diff --git a/src_clm40/biogeochem/CNNStateUpdate2Mod.F90 b/src_clm40/biogeochem/CNNStateUpdate2Mod.F90 deleted file mode 100644 index a26e4c87cc..0000000000 --- a/src_clm40/biogeochem/CNNStateUpdate2Mod.F90 +++ /dev/null @@ -1,550 +0,0 @@ -module CNNStateUpdate2Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: NStateUpdate2Mod -! -! !DESCRIPTION: -! Module for nitrogen state variable update, mortality fluxes. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: NStateUpdate2 - public:: NStateUpdate2h -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NStateUpdate2 -! -! !INTERFACE: -subroutine NStateUpdate2(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic nitrogen state -! variables affected by gap-phase mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: m_deadcrootn_storage_to_litr1n(:) - real(r8), pointer :: m_deadcrootn_to_cwdn(:) - real(r8), pointer :: m_deadcrootn_xfer_to_litr1n(:) - real(r8), pointer :: m_deadstemn_storage_to_litr1n(:) - real(r8), pointer :: m_deadstemn_to_cwdn(:) - real(r8), pointer :: m_deadstemn_xfer_to_litr1n(:) - real(r8), pointer :: m_frootn_storage_to_litr1n(:) - real(r8), pointer :: m_frootn_to_litr1n(:) - real(r8), pointer :: m_frootn_to_litr2n(:) - real(r8), pointer :: m_frootn_to_litr3n(:) - real(r8), pointer :: m_frootn_xfer_to_litr1n(:) - real(r8), pointer :: m_leafn_storage_to_litr1n(:) - real(r8), pointer :: m_leafn_to_litr1n(:) - real(r8), pointer :: m_leafn_to_litr2n(:) - real(r8), pointer :: m_leafn_to_litr3n(:) - real(r8), pointer :: m_leafn_xfer_to_litr1n(:) - real(r8), pointer :: m_livecrootn_storage_to_litr1n(:) - real(r8), pointer :: m_livecrootn_to_cwdn(:) - real(r8), pointer :: m_livecrootn_xfer_to_litr1n(:) - real(r8), pointer :: m_livestemn_storage_to_litr1n(:) - real(r8), pointer :: m_livestemn_to_cwdn(:) - real(r8), pointer :: m_livestemn_xfer_to_litr1n(:) - real(r8), pointer :: m_retransn_to_litr1n(:) - real(r8), pointer :: m_deadcrootn_storage_to_litter(:) - real(r8), pointer :: m_deadcrootn_to_litter(:) - real(r8), pointer :: m_deadcrootn_xfer_to_litter(:) - real(r8), pointer :: m_deadstemn_storage_to_litter(:) - real(r8), pointer :: m_deadstemn_to_litter(:) - real(r8), pointer :: m_deadstemn_xfer_to_litter(:) - real(r8), pointer :: m_frootn_storage_to_litter(:) - real(r8), pointer :: m_frootn_to_litter(:) - real(r8), pointer :: m_frootn_xfer_to_litter(:) - real(r8), pointer :: m_leafn_storage_to_litter(:) - real(r8), pointer :: m_leafn_to_litter(:) - real(r8), pointer :: m_leafn_xfer_to_litter(:) - real(r8), pointer :: m_livecrootn_storage_to_litter(:) - real(r8), pointer :: m_livecrootn_to_litter(:) - real(r8), pointer :: m_livecrootn_xfer_to_litter(:) - real(r8), pointer :: m_livestemn_storage_to_litter(:) - real(r8), pointer :: m_livestemn_to_litter(:) - real(r8), pointer :: m_livestemn_xfer_to_litter(:) - real(r8), pointer :: m_retransn_to_litter(:) -! -! local pointers to implicit in/out scalars - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - m_deadcrootn_storage_to_litr1n => cnf%m_deadcrootn_storage_to_litr1n - m_deadcrootn_to_cwdn => cnf%m_deadcrootn_to_cwdn - m_deadcrootn_xfer_to_litr1n => cnf%m_deadcrootn_xfer_to_litr1n - m_deadstemn_storage_to_litr1n => cnf%m_deadstemn_storage_to_litr1n - m_deadstemn_to_cwdn => cnf%m_deadstemn_to_cwdn - m_deadstemn_xfer_to_litr1n => cnf%m_deadstemn_xfer_to_litr1n - m_frootn_storage_to_litr1n => cnf%m_frootn_storage_to_litr1n - m_frootn_to_litr1n => cnf%m_frootn_to_litr1n - m_frootn_to_litr2n => cnf%m_frootn_to_litr2n - m_frootn_to_litr3n => cnf%m_frootn_to_litr3n - m_frootn_xfer_to_litr1n => cnf%m_frootn_xfer_to_litr1n - m_leafn_storage_to_litr1n => cnf%m_leafn_storage_to_litr1n - m_leafn_to_litr1n => cnf%m_leafn_to_litr1n - m_leafn_to_litr2n => cnf%m_leafn_to_litr2n - m_leafn_to_litr3n => cnf%m_leafn_to_litr3n - m_leafn_xfer_to_litr1n => cnf%m_leafn_xfer_to_litr1n - m_livecrootn_storage_to_litr1n => cnf%m_livecrootn_storage_to_litr1n - m_livecrootn_to_cwdn => cnf%m_livecrootn_to_cwdn - m_livecrootn_xfer_to_litr1n => cnf%m_livecrootn_xfer_to_litr1n - m_livestemn_storage_to_litr1n => cnf%m_livestemn_storage_to_litr1n - m_livestemn_to_cwdn => cnf%m_livestemn_to_cwdn - m_livestemn_xfer_to_litr1n => cnf%m_livestemn_xfer_to_litr1n - m_retransn_to_litr1n => cnf%m_retransn_to_litr1n - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - - ! assign local pointers at the pft level - m_deadcrootn_storage_to_litter => pnf%m_deadcrootn_storage_to_litter - m_deadcrootn_to_litter => pnf%m_deadcrootn_to_litter - m_deadcrootn_xfer_to_litter => pnf%m_deadcrootn_xfer_to_litter - m_deadstemn_storage_to_litter => pnf%m_deadstemn_storage_to_litter - m_deadstemn_to_litter => pnf%m_deadstemn_to_litter - m_deadstemn_xfer_to_litter => pnf%m_deadstemn_xfer_to_litter - m_frootn_storage_to_litter => pnf%m_frootn_storage_to_litter - m_frootn_to_litter => pnf%m_frootn_to_litter - m_frootn_xfer_to_litter => pnf%m_frootn_xfer_to_litter - m_leafn_storage_to_litter => pnf%m_leafn_storage_to_litter - m_leafn_to_litter => pnf%m_leafn_to_litter - m_leafn_xfer_to_litter => pnf%m_leafn_xfer_to_litter - m_livecrootn_storage_to_litter => pnf%m_livecrootn_storage_to_litter - m_livecrootn_to_litter => pnf%m_livecrootn_to_litter - m_livecrootn_xfer_to_litter => pnf%m_livecrootn_xfer_to_litter - m_livestemn_storage_to_litter => pnf%m_livestemn_storage_to_litter - m_livestemn_to_litter => pnf%m_livestemn_to_litter - m_livestemn_xfer_to_litter => pnf%m_livestemn_xfer_to_litter - m_retransn_to_litter => pnf%m_retransn_to_litter - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - retransn => pns%retransn - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column-level nitrogen fluxes from gap-phase mortality - - ! leaf to litter - litr1n(c) = litr1n(c) + m_leafn_to_litr1n(c) * dt - litr2n(c) = litr2n(c) + m_leafn_to_litr2n(c) * dt - litr3n(c) = litr3n(c) + m_leafn_to_litr3n(c) * dt - - ! fine root to litter - litr1n(c) = litr1n(c) + m_frootn_to_litr1n(c) * dt - litr2n(c) = litr2n(c) + m_frootn_to_litr2n(c) * dt - litr3n(c) = litr3n(c) + m_frootn_to_litr3n(c) * dt - - ! wood to CWD - cwdn(c) = cwdn(c) + m_livestemn_to_cwdn(c) * dt - cwdn(c) = cwdn(c) + m_deadstemn_to_cwdn(c) * dt - cwdn(c) = cwdn(c) + m_livecrootn_to_cwdn(c) * dt - cwdn(c) = cwdn(c) + m_deadcrootn_to_cwdn(c) * dt - - ! retranslocated N pool to litter - litr1n(c) = litr1n(c) + m_retransn_to_litr1n(c) * dt - - ! storage pools to litter - litr1n(c) = litr1n(c) + m_leafn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_frootn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_livestemn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_deadstemn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_livecrootn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_deadcrootn_storage_to_litr1n(c) * dt - - ! transfer pools to litter - litr1n(c) = litr1n(c) + m_leafn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_frootn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_livestemn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_deadstemn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_livecrootn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + m_deadcrootn_xfer_to_litr1n(c) * dt - - end do ! end of column loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level nitrogen fluxes from gap-phase mortality - ! displayed pools - leafn(p) = leafn(p) - m_leafn_to_litter(p) * dt - frootn(p) = frootn(p) - m_frootn_to_litter(p) * dt - livestemn(p) = livestemn(p) - m_livestemn_to_litter(p) * dt - deadstemn(p) = deadstemn(p) - m_deadstemn_to_litter(p) * dt - livecrootn(p) = livecrootn(p) - m_livecrootn_to_litter(p) * dt - deadcrootn(p) = deadcrootn(p) - m_deadcrootn_to_litter(p) * dt - retransn(p) = retransn(p) - m_retransn_to_litter(p) * dt - - ! storage pools - leafn_storage(p) = leafn_storage(p) - m_leafn_storage_to_litter(p) * dt - frootn_storage(p) = frootn_storage(p) - m_frootn_storage_to_litter(p) * dt - livestemn_storage(p) = livestemn_storage(p) - m_livestemn_storage_to_litter(p) * dt - deadstemn_storage(p) = deadstemn_storage(p) - m_deadstemn_storage_to_litter(p) * dt - livecrootn_storage(p) = livecrootn_storage(p) - m_livecrootn_storage_to_litter(p) * dt - deadcrootn_storage(p) = deadcrootn_storage(p) - m_deadcrootn_storage_to_litter(p) * dt - - ! transfer pools - leafn_xfer(p) = leafn_xfer(p) - m_leafn_xfer_to_litter(p) * dt - frootn_xfer(p) = frootn_xfer(p) - m_frootn_xfer_to_litter(p) * dt - livestemn_xfer(p) = livestemn_xfer(p) - m_livestemn_xfer_to_litter(p) * dt - deadstemn_xfer(p) = deadstemn_xfer(p) - m_deadstemn_xfer_to_litter(p) * dt - livecrootn_xfer(p) = livecrootn_xfer(p) - m_livecrootn_xfer_to_litter(p) * dt - deadcrootn_xfer(p) = deadcrootn_xfer(p) - m_deadcrootn_xfer_to_litter(p) * dt - - end do - -end subroutine NStateUpdate2 -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NStateUpdate2h -! -! !INTERFACE: -subroutine NStateUpdate2h(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Update all the prognostic nitrogen state -! variables affected by harvest mortality fluxes -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: hrv_deadcrootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_deadcrootn_to_cwdn(:) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_deadstemn_storage_to_litr1n(:) - real(r8), pointer :: hrv_deadstemn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_frootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_frootn_to_litr1n(:) - real(r8), pointer :: hrv_frootn_to_litr2n(:) - real(r8), pointer :: hrv_frootn_to_litr3n(:) - real(r8), pointer :: hrv_frootn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_leafn_storage_to_litr1n(:) - real(r8), pointer :: hrv_leafn_to_litr1n(:) - real(r8), pointer :: hrv_leafn_to_litr2n(:) - real(r8), pointer :: hrv_leafn_to_litr3n(:) - real(r8), pointer :: hrv_leafn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_livecrootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_livecrootn_to_cwdn(:) - real(r8), pointer :: hrv_livecrootn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_livestemn_storage_to_litr1n(:) - real(r8), pointer :: hrv_livestemn_to_cwdn(:) - real(r8), pointer :: hrv_livestemn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_retransn_to_litr1n(:) - real(r8), pointer :: hrv_deadcrootn_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemn_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemn_to_prod10n(:) - real(r8), pointer :: hrv_deadstemn_to_prod100n(:) - real(r8), pointer :: hrv_deadstemn_xfer_to_litter(:) - real(r8), pointer :: hrv_frootn_storage_to_litter(:) - real(r8), pointer :: hrv_frootn_to_litter(:) - real(r8), pointer :: hrv_frootn_xfer_to_litter(:) - real(r8), pointer :: hrv_leafn_storage_to_litter(:) - real(r8), pointer :: hrv_leafn_to_litter(:) - real(r8), pointer :: hrv_leafn_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootn_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootn_to_litter(:) - real(r8), pointer :: hrv_livecrootn_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemn_storage_to_litter(:) - real(r8), pointer :: hrv_livestemn_to_litter(:) - real(r8), pointer :: hrv_livestemn_xfer_to_litter(:) - real(r8), pointer :: hrv_retransn_to_litter(:) -! -! local pointers to implicit in/out scalars - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - hrv_deadcrootn_storage_to_litr1n => cnf%hrv_deadcrootn_storage_to_litr1n - hrv_deadcrootn_to_cwdn => cnf%hrv_deadcrootn_to_cwdn - hrv_deadcrootn_xfer_to_litr1n => cnf%hrv_deadcrootn_xfer_to_litr1n - hrv_deadstemn_storage_to_litr1n => cnf%hrv_deadstemn_storage_to_litr1n - hrv_deadstemn_xfer_to_litr1n => cnf%hrv_deadstemn_xfer_to_litr1n - hrv_frootn_storage_to_litr1n => cnf%hrv_frootn_storage_to_litr1n - hrv_frootn_to_litr1n => cnf%hrv_frootn_to_litr1n - hrv_frootn_to_litr2n => cnf%hrv_frootn_to_litr2n - hrv_frootn_to_litr3n => cnf%hrv_frootn_to_litr3n - hrv_frootn_xfer_to_litr1n => cnf%hrv_frootn_xfer_to_litr1n - hrv_leafn_storage_to_litr1n => cnf%hrv_leafn_storage_to_litr1n - hrv_leafn_to_litr1n => cnf%hrv_leafn_to_litr1n - hrv_leafn_to_litr2n => cnf%hrv_leafn_to_litr2n - hrv_leafn_to_litr3n => cnf%hrv_leafn_to_litr3n - hrv_leafn_xfer_to_litr1n => cnf%hrv_leafn_xfer_to_litr1n - hrv_livecrootn_storage_to_litr1n => cnf%hrv_livecrootn_storage_to_litr1n - hrv_livecrootn_to_cwdn => cnf%hrv_livecrootn_to_cwdn - hrv_livecrootn_xfer_to_litr1n => cnf%hrv_livecrootn_xfer_to_litr1n - hrv_livestemn_storage_to_litr1n => cnf%hrv_livestemn_storage_to_litr1n - hrv_livestemn_to_cwdn => cnf%hrv_livestemn_to_cwdn - hrv_livestemn_xfer_to_litr1n => cnf%hrv_livestemn_xfer_to_litr1n - hrv_retransn_to_litr1n => cnf%hrv_retransn_to_litr1n - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - - ! assign local pointers at the pft level - hrv_deadcrootn_storage_to_litter => pnf%hrv_deadcrootn_storage_to_litter - hrv_deadcrootn_to_litter => pnf%hrv_deadcrootn_to_litter - hrv_deadcrootn_xfer_to_litter => pnf%hrv_deadcrootn_xfer_to_litter - hrv_deadstemn_storage_to_litter => pnf%hrv_deadstemn_storage_to_litter - hrv_deadstemn_to_prod10n => pnf%hrv_deadstemn_to_prod10n - hrv_deadstemn_to_prod100n => pnf%hrv_deadstemn_to_prod100n - hrv_deadstemn_xfer_to_litter => pnf%hrv_deadstemn_xfer_to_litter - hrv_frootn_storage_to_litter => pnf%hrv_frootn_storage_to_litter - hrv_frootn_to_litter => pnf%hrv_frootn_to_litter - hrv_frootn_xfer_to_litter => pnf%hrv_frootn_xfer_to_litter - hrv_leafn_storage_to_litter => pnf%hrv_leafn_storage_to_litter - hrv_leafn_to_litter => pnf%hrv_leafn_to_litter - hrv_leafn_xfer_to_litter => pnf%hrv_leafn_xfer_to_litter - hrv_livecrootn_storage_to_litter => pnf%hrv_livecrootn_storage_to_litter - hrv_livecrootn_to_litter => pnf%hrv_livecrootn_to_litter - hrv_livecrootn_xfer_to_litter => pnf%hrv_livecrootn_xfer_to_litter - hrv_livestemn_storage_to_litter => pnf%hrv_livestemn_storage_to_litter - hrv_livestemn_to_litter => pnf%hrv_livestemn_to_litter - hrv_livestemn_xfer_to_litter => pnf%hrv_livestemn_xfer_to_litter - hrv_retransn_to_litter => pnf%hrv_retransn_to_litter - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - retransn => pns%retransn - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column-level nitrogen fluxes from harvest mortality - - ! leaf to litter - litr1n(c) = litr1n(c) + hrv_leafn_to_litr1n(c) * dt - litr2n(c) = litr2n(c) + hrv_leafn_to_litr2n(c) * dt - litr3n(c) = litr3n(c) + hrv_leafn_to_litr3n(c) * dt - - ! fine root to litter - litr1n(c) = litr1n(c) + hrv_frootn_to_litr1n(c) * dt - litr2n(c) = litr2n(c) + hrv_frootn_to_litr2n(c) * dt - litr3n(c) = litr3n(c) + hrv_frootn_to_litr3n(c) * dt - - ! wood to CWD - cwdn(c) = cwdn(c) + hrv_livestemn_to_cwdn(c) * dt - cwdn(c) = cwdn(c) + hrv_livecrootn_to_cwdn(c) * dt - cwdn(c) = cwdn(c) + hrv_deadcrootn_to_cwdn(c) * dt - - ! wood to product pools - updates done in CNWoodProducts() - - ! retranslocated N pool to litter - litr1n(c) = litr1n(c) + hrv_retransn_to_litr1n(c) * dt - - ! storage pools to litter - litr1n(c) = litr1n(c) + hrv_leafn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_frootn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_livestemn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_deadstemn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_livecrootn_storage_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_deadcrootn_storage_to_litr1n(c) * dt - - ! transfer pools to litter - litr1n(c) = litr1n(c) + hrv_leafn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_frootn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_livestemn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_deadstemn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_livecrootn_xfer_to_litr1n(c) * dt - litr1n(c) = litr1n(c) + hrv_deadcrootn_xfer_to_litr1n(c) * dt - - end do ! end of column loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level nitrogen fluxes from harvest mortality - ! displayed pools - leafn(p) = leafn(p) - hrv_leafn_to_litter(p) * dt - frootn(p) = frootn(p) - hrv_frootn_to_litter(p) * dt - livestemn(p) = livestemn(p) - hrv_livestemn_to_litter(p) * dt - deadstemn(p) = deadstemn(p) - hrv_deadstemn_to_prod10n(p) * dt - deadstemn(p) = deadstemn(p) - hrv_deadstemn_to_prod100n(p)* dt - livecrootn(p) = livecrootn(p) - hrv_livecrootn_to_litter(p) * dt - deadcrootn(p) = deadcrootn(p) - hrv_deadcrootn_to_litter(p) * dt - retransn(p) = retransn(p) - hrv_retransn_to_litter(p) * dt - - ! storage pools - leafn_storage(p) = leafn_storage(p) - hrv_leafn_storage_to_litter(p) * dt - frootn_storage(p) = frootn_storage(p) - hrv_frootn_storage_to_litter(p) * dt - livestemn_storage(p) = livestemn_storage(p) - hrv_livestemn_storage_to_litter(p) * dt - deadstemn_storage(p) = deadstemn_storage(p) - hrv_deadstemn_storage_to_litter(p) * dt - livecrootn_storage(p) = livecrootn_storage(p) - hrv_livecrootn_storage_to_litter(p) * dt - deadcrootn_storage(p) = deadcrootn_storage(p) - hrv_deadcrootn_storage_to_litter(p) * dt - - ! transfer pools - leafn_xfer(p) = leafn_xfer(p) - hrv_leafn_xfer_to_litter(p) * dt - frootn_xfer(p) = frootn_xfer(p) - hrv_frootn_xfer_to_litter(p) * dt - livestemn_xfer(p) = livestemn_xfer(p) - hrv_livestemn_xfer_to_litter(p) * dt - deadstemn_xfer(p) = deadstemn_xfer(p) - hrv_deadstemn_xfer_to_litter(p) * dt - livecrootn_xfer(p) = livecrootn_xfer(p) - hrv_livecrootn_xfer_to_litter(p) * dt - deadcrootn_xfer(p) = deadcrootn_xfer(p) - hrv_deadcrootn_xfer_to_litter(p) * dt - - end do - -end subroutine NStateUpdate2h -!----------------------------------------------------------------------- - -end module CNNStateUpdate2Mod diff --git a/src_clm40/biogeochem/CNNStateUpdate3Mod.F90 b/src_clm40/biogeochem/CNNStateUpdate3Mod.F90 deleted file mode 100644 index 839d988e99..0000000000 --- a/src_clm40/biogeochem/CNNStateUpdate3Mod.F90 +++ /dev/null @@ -1,243 +0,0 @@ -module CNNStateUpdate3Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: NStateUpdate3Mod -! -! !DESCRIPTION: -! Module for nitrogen state variable update, mortality fluxes. -! Also, sminn leaching flux. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: NStateUpdate3 -! -! !REVISION HISTORY: -! 7/27/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NStateUpdate3 -! -! !INTERFACE: -subroutine NStateUpdate3(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, update all the prognostic nitrogen state -! variables affected by gap-phase mortality fluxes. Also the Sminn leaching flux. -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - real(r8), pointer :: sminn_leached(:) - real(r8), pointer :: m_cwdn_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_cwdn_fire(:) - real(r8), pointer :: m_deadstemn_to_cwdn_fire(:) - real(r8), pointer :: m_litr1n_to_fire(:) - real(r8), pointer :: m_litr2n_to_fire(:) - real(r8), pointer :: m_litr3n_to_fire(:) - real(r8), pointer :: m_deadcrootn_storage_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_litter_fire(:) - real(r8), pointer :: m_deadcrootn_xfer_to_fire(:) - real(r8), pointer :: m_deadstemn_storage_to_fire(:) - real(r8), pointer :: m_deadstemn_to_fire(:) - real(r8), pointer :: m_deadstemn_to_litter_fire(:) - real(r8), pointer :: m_deadstemn_xfer_to_fire(:) - real(r8), pointer :: m_frootn_storage_to_fire(:) - real(r8), pointer :: m_frootn_to_fire(:) - real(r8), pointer :: m_frootn_xfer_to_fire(:) - real(r8), pointer :: m_leafn_storage_to_fire(:) - real(r8), pointer :: m_leafn_to_fire(:) - real(r8), pointer :: m_leafn_xfer_to_fire(:) - real(r8), pointer :: m_livecrootn_storage_to_fire(:) - real(r8), pointer :: m_livecrootn_to_fire(:) - real(r8), pointer :: m_livecrootn_xfer_to_fire(:) - real(r8), pointer :: m_livestemn_storage_to_fire(:) - real(r8), pointer :: m_livestemn_to_fire(:) - real(r8), pointer :: m_livestemn_xfer_to_fire(:) - real(r8), pointer :: m_retransn_to_fire(:) -! -! local pointers to implicit in/out scalars - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: dt ! radiation time step (seconds) - -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers at the column level - sminn_leached => cnf%sminn_leached - m_cwdn_to_fire => cnf%m_cwdn_to_fire - m_deadcrootn_to_cwdn_fire => cnf%m_deadcrootn_to_cwdn_fire - m_deadstemn_to_cwdn_fire => cnf%m_deadstemn_to_cwdn_fire - m_litr1n_to_fire => cnf%m_litr1n_to_fire - m_litr2n_to_fire => cnf%m_litr2n_to_fire - m_litr3n_to_fire => cnf%m_litr3n_to_fire - sminn => cns%sminn - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - - ! assign local pointers at the pft level - m_deadcrootn_storage_to_fire => pnf%m_deadcrootn_storage_to_fire - m_deadcrootn_to_fire => pnf%m_deadcrootn_to_fire - m_deadcrootn_to_litter_fire => pnf%m_deadcrootn_to_litter_fire - m_deadcrootn_xfer_to_fire => pnf%m_deadcrootn_xfer_to_fire - m_deadstemn_storage_to_fire => pnf%m_deadstemn_storage_to_fire - m_deadstemn_to_fire => pnf%m_deadstemn_to_fire - m_deadstemn_to_litter_fire => pnf%m_deadstemn_to_litter_fire - m_deadstemn_xfer_to_fire => pnf%m_deadstemn_xfer_to_fire - m_frootn_storage_to_fire => pnf%m_frootn_storage_to_fire - m_frootn_to_fire => pnf%m_frootn_to_fire - m_frootn_xfer_to_fire => pnf%m_frootn_xfer_to_fire - m_leafn_storage_to_fire => pnf%m_leafn_storage_to_fire - m_leafn_to_fire => pnf%m_leafn_to_fire - m_leafn_xfer_to_fire => pnf%m_leafn_xfer_to_fire - m_livecrootn_storage_to_fire => pnf%m_livecrootn_storage_to_fire - m_livecrootn_to_fire => pnf%m_livecrootn_to_fire - m_livecrootn_xfer_to_fire => pnf%m_livecrootn_xfer_to_fire - m_livestemn_storage_to_fire => pnf%m_livestemn_storage_to_fire - m_livestemn_to_fire => pnf%m_livestemn_to_fire - m_livestemn_xfer_to_fire => pnf%m_livestemn_xfer_to_fire - m_retransn_to_fire => pnf%m_retransn_to_fire - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - retransn => pns%retransn - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! mineral N loss due to leaching - sminn(c) = sminn(c) - sminn_leached(c) * dt - - ! column level nitrogen fluxes from fire - - ! pft-level wood to column-level CWD (uncombusted wood) - cwdn(c) = cwdn(c) + m_deadstemn_to_cwdn_fire(c) * dt - cwdn(c) = cwdn(c) + m_deadcrootn_to_cwdn_fire(c) * dt - - ! litter and CWD losses to fire - litr1n(c) = litr1n(c) - m_litr1n_to_fire(c) * dt - litr2n(c) = litr2n(c) - m_litr2n_to_fire(c) * dt - litr3n(c) = litr3n(c) - m_litr3n_to_fire(c) * dt - cwdn(c) = cwdn(c) - m_cwdn_to_fire(c) * dt - - end do ! end of column loop - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! pft-level nitrogen fluxes from fire - ! displayed pools - leafn(p) = leafn(p) - m_leafn_to_fire(p) * dt - frootn(p) = frootn(p) - m_frootn_to_fire(p) * dt - livestemn(p) = livestemn(p) - m_livestemn_to_fire(p) * dt - deadstemn(p) = deadstemn(p) - m_deadstemn_to_fire(p) * dt - deadstemn(p) = deadstemn(p) - m_deadstemn_to_litter_fire(p) * dt - livecrootn(p) = livecrootn(p) - m_livecrootn_to_fire(p) * dt - deadcrootn(p) = deadcrootn(p) - m_deadcrootn_to_fire(p) * dt - deadcrootn(p) = deadcrootn(p) - m_deadcrootn_to_litter_fire(p) * dt - - ! storage pools - leafn_storage(p) = leafn_storage(p) - m_leafn_storage_to_fire(p) * dt - frootn_storage(p) = frootn_storage(p) - m_frootn_storage_to_fire(p) * dt - livestemn_storage(p) = livestemn_storage(p) - m_livestemn_storage_to_fire(p) * dt - deadstemn_storage(p) = deadstemn_storage(p) - m_deadstemn_storage_to_fire(p) * dt - livecrootn_storage(p) = livecrootn_storage(p) - m_livecrootn_storage_to_fire(p) * dt - deadcrootn_storage(p) = deadcrootn_storage(p) - m_deadcrootn_storage_to_fire(p) * dt - - ! transfer pools - leafn_xfer(p) = leafn_xfer(p) - m_leafn_xfer_to_fire(p) * dt - frootn_xfer(p) = frootn_xfer(p) - m_frootn_xfer_to_fire(p) * dt - livestemn_xfer(p) = livestemn_xfer(p) - m_livestemn_xfer_to_fire(p) * dt - deadstemn_xfer(p) = deadstemn_xfer(p) - m_deadstemn_xfer_to_fire(p) * dt - livecrootn_xfer(p) = livecrootn_xfer(p) - m_livecrootn_xfer_to_fire(p) * dt - deadcrootn_xfer(p) = deadcrootn_xfer(p) - m_deadcrootn_xfer_to_fire(p) * dt - - ! retranslocated N pool - retransn(p) = retransn(p) - m_retransn_to_fire(p) * dt - - end do - -end subroutine NStateUpdate3 -!----------------------------------------------------------------------- - -end module CNNStateUpdate3Mod diff --git a/src_clm40/biogeochem/CNPhenologyMod.F90 b/src_clm40/biogeochem/CNPhenologyMod.F90 deleted file mode 100644 index 2266684fd5..0000000000 --- a/src_clm40/biogeochem/CNPhenologyMod.F90 +++ /dev/null @@ -1,2750 +0,0 @@ -module CNPhenologyMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNPhenologyMod -! -! !DESCRIPTION: -! Module holding routines used in phenology model for coupled carbon -! nitrogen code. -! -! !USES: - use clmtype - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varcon , only: tfrz - use clm_varctl , only: iulog, use_cndv - use clm_varpar , only: numpft - use shr_sys_mod , only: shr_sys_flush - use abortutils , only: endrun - implicit none - save - private - -! !PUBLIC MEMBER FUNCTIONS: - public :: CNPhenologyInit ! Initialization - public :: CNPhenology ! Update -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! 10/23/03, Peter Thornton: migrated all routines to vector data structures -! 2/4/08, slevis: adding crop phenology from AgroIBIS - -! !PRIVATE DATA MEMBERS: - - real(r8) :: dt ! radiation time step delta t (seconds) - real(r8) :: fracday ! dtime as a fraction of day - real(r8) :: crit_dayl ! critical daylength for offset (seconds) - real(r8) :: ndays_on ! number of days to complete onset - real(r8) :: ndays_off ! number of days to complete offset - real(r8) :: fstor2tran ! fraction of storage to move to transfer on each onset - real(r8) :: crit_onset_fdd ! critical number of freezing days - real(r8) :: crit_onset_swi ! water stress days for offset trigger - real(r8) :: soilpsi_on ! water potential for onset trigger (MPa) - real(r8) :: crit_offset_fdd ! critical number of freezing degree days - ! to trigger offset - real(r8) :: crit_offset_swi ! water stress days for offset trigger - real(r8) :: soilpsi_off ! water potential for offset trigger (MPa) - real(r8) :: lwtop ! live wood turnover proportion (annual fraction) - ! - ! CropPhenology variables and constants - ! - real(r8) :: p1d, p1v ! photoperiod factor constants for crop vernalization - real(r8) :: hti ! cold hardening index threshold for vernalization - real(r8) :: tbase ! base temperature for vernalization - integer, parameter :: NOT_Planted = 999 ! If not planted yet in year - integer, parameter :: NOT_Harvested = 999 ! If not harvested yet in year - integer, parameter :: inNH = 1 ! Northern Hemisphere - integer, parameter :: inSH = 2 ! Southern Hemisphere - integer, pointer :: inhemi(:) ! Hemisphere that pft is in - integer :: minplantjday(0:numpft,inSH) ! minimum planting julian day - integer :: maxplantjday(0:numpft,inSH) ! maximum planting julian day - integer :: jdayyrstart(inSH) ! julian day of start of year - -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNPhenology -! -! !INTERFACE: -subroutine CNPhenology (num_soilc, filter_soilc, num_soilp, filter_soilp, & - num_pcropp, filter_pcropp, doalb) -! -! !DESCRIPTION: -! Dynamic phenology routine for coupled carbon-nitrogen code (CN) -! 1. grass phenology -! -! !USES: -! -! !ARGUMENTS: - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - integer, intent(in) :: num_pcropp ! number of prog. crop pfts in filter - integer, intent(in) :: filter_pcropp(:)! filter for prognostic crop pfts - logical, intent(in) :: doalb ! true if time for sfc albedo calc -! -! !CALLED FROM: -! subroutine CNEcosystemDyn in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 7/28/03: Created by Peter Thornton -! 9/05/03, Peter Thornton: moved from call with (p) to call with (c) -! 10/3/03, Peter Thornton: added subroutine calls for different phenology types -! 11/7/03, Peter Thornton: moved phenology type tests into phenology type -! routines, and moved onset, offset, background litfall routines into -! main phenology call. -! !LOCAL VARIABLES: -! local pointers to implicit in arrays -! -! local pointers to implicit in/out scalars -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - - ! each of the following phenology type routines includes a filter - ! to operate only on the relevant pfts - - call CNPhenologyClimate(num_soilp, filter_soilp, num_pcropp, filter_pcropp) - - call CNEvergreenPhenology(num_soilp, filter_soilp) - - call CNSeasonDecidPhenology(num_soilp, filter_soilp) - - call CNStressDecidPhenology(num_soilp, filter_soilp) - - if (doalb .and. num_pcropp > 0 ) call CropPhenology(num_pcropp, filter_pcropp) - - ! the same onset and offset routines are called regardless of - ! phenology type - they depend only on onset_flag, offset_flag, bglfr, and bgtr - - call CNOnsetGrowth(num_soilp, filter_soilp) - - call CNOffsetLitterfall(num_soilp, filter_soilp) - - call CNBackgroundLitterfall(num_soilp, filter_soilp) - - call CNLivewoodTurnover(num_soilp, filter_soilp) - - ! gather all pft-level litterfall fluxes to the column - ! for litter C and N inputs - - call CNLitterToColumn(num_soilc, filter_soilc) - -end subroutine CNPhenology - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNPhenologyInit -! -! !INTERFACE: -subroutine CNPhenologyInit( begp, endp ) -! -! !DESCRIPTION: -! Initialization of CNPhenology. Must be called after time-manager is -! initialized, and after pftcon file is read in. -! -! !USES: - use clm_time_manager, only: get_step_size - use surfrdMod , only: crop_prog - use clm_varcon , only: secspday -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begp, endp ! Beginning and ending PFT index -! !CALLED FROM: -! subroutine initialize2 in module clm_initializeMod.F90 -! -! !REVISION HISTORY: -! 3/28/11: Created by Erik Kluzek -! -! !LOCAL VARIABLES: -!EOP -!------------------------------------------------------------------------ - - ! - ! Get time-step and what fraction of a day it is - ! - dt = real( get_step_size(), r8 ) - fracday = dt/secspday - - ! set some local parameters - these will be moved into - ! parameter file after testing - - ! ----------------------------------------- - ! Constants for CNSeasonDecidPhenology - ! ----------------------------------------- - ! - ! critical daylength from Biome-BGC, v4.1.2 - crit_dayl = 39300._r8 - - ! ----------------------------------------- - ! Constants for CNSeasonDecidPhenology and CNStressDecidPhenology - ! ----------------------------------------- - ndays_on = 30._r8 - ndays_off = 15._r8 - - ! transfer parameters - fstor2tran = 0.5_r8 - ! ----------------------------------------- - ! Constants for CNStressDecidPhenology - ! ----------------------------------------- - - ! onset parameters - crit_onset_fdd = 15.0_r8 - ! critical onset gdd now being calculated as a function of annual - ! average 2m temp. - ! crit_onset_gdd = 150.0 ! c3 grass value - ! crit_onset_gdd = 1000.0 ! c4 grass value - crit_onset_swi = 15.0_r8 - soilpsi_on = -2.0_r8 - - ! offset parameters - crit_offset_fdd = 15.0_r8 - crit_offset_swi = 15.0_r8 - soilpsi_off = -2.0_r8 - - ! ----------------------------------------- - ! Constants for CNLivewoodTurnover - ! ----------------------------------------- - - ! set the global parameter for livewood turnover rate - ! define as an annual fraction (0.7), and convert to fraction per second - lwtop = 0.7_r8 / 31536000.0_r8 - - ! ----------------------------------------- - ! Call any subroutine specific initialization routines - ! ----------------------------------------- - - if ( crop_prog ) call CropPhenologyInit( begp, endp ) - -end subroutine CNPhenologyInit -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNPhenologyClimate -! -! !INTERFACE: -subroutine CNPhenologyClimate (num_soilp, filter_soilp, num_pcropp, filter_pcropp) -! -! !DESCRIPTION: -! For coupled carbon-nitrogen code (CN). -! -! !USES: - use clm_time_manager, only: get_days_per_year - use clm_time_manager, only: get_curr_date, is_first_step - use CropRestMod , only: CropRestYear -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - integer, intent(in) :: num_pcropp ! number of prognostic crops in filter - integer, intent(in) :: filter_pcropp(:)! filter for prognostic crop pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 3/13/07: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - ! ecophysiological constants - real(r8), pointer :: t_ref2m(:) ! 2m air temperature (K) - real(r8), pointer :: tempavg_t2m(:) ! temp. avg 2m air temperature (K) - real(r8), pointer :: gdd0(:) ! growing deg. days base 0 deg C (ddays) - real(r8), pointer :: gdd8(:) ! " " " " 8 " " " - real(r8), pointer :: gdd10(:) ! " " " " 10 " " " - real(r8), pointer :: gdd020(:) ! 20-yr mean of gdd0 (ddays) - real(r8), pointer :: gdd820(:) ! 20-yr mean of gdd8 (ddays) - real(r8), pointer :: gdd1020(:) ! 20-yr mean of gdd10 (ddays) - integer , pointer :: pgridcell(:) ! pft's gridcell index -! -! local pointers to implicit in/out scalars -! -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter pft index - integer :: nyrs ! number of years prognostic crop has run - real(r8):: dayspyr ! days per year (days) - integer kyr ! current year - integer kmo ! month of year (1, ..., 12) - integer kda ! day of month (1, ..., 31) - integer mcsec ! seconds of day (0, ..., seconds/day) - real(r8), parameter :: yravg = 20.0_r8 ! length of years to average for gdd - real(r8), parameter :: yravgm1 = yravg-1.0_r8 ! minus 1 of above -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers to derived type arrays - ivt => pft%itype - t_ref2m => pes%t_ref2m - tempavg_t2m => pepv%tempavg_t2m - - gdd0 => pps%gdd0 - gdd8 => pps%gdd8 - gdd10 => pps%gdd10 - gdd020 => pps%gdd020 - gdd820 => pps%gdd820 - gdd1020 => pps%gdd1020 - pgridcell => pft%gridcell - - ! set time steps - - dayspyr = get_days_per_year() - - do fp = 1,num_soilp - p = filter_soilp(fp) - tempavg_t2m(p) = tempavg_t2m(p) + t_ref2m(p) * (fracday/dayspyr) - end do - - ! - ! The following crop related steps are done here rather than CropPhenology - ! so that they will be completed each time-step rather than with doalb. - ! - ! The following lines come from ibis's climate.f + stats.f - ! gdd SUMMATIONS ARE RELATIVE TO THE PLANTING DATE (see subr. updateAccFlds) - - if (num_pcropp > 0) then - ! get time-related info - call get_curr_date(kyr, kmo, kda, mcsec) - nyrs = CropRestYear() - end if - - do fp = 1,num_pcropp - p = filter_pcropp(fp) - if (kmo == 1 .and. kda == 1 .and. nyrs == 0) then ! YR 1: - gdd020(p) = 0._r8 ! set gdd..20 variables to 0 - gdd820(p) = 0._r8 ! and crops will not be planted - gdd1020(p) = 0._r8 - end if - if (kmo == 1 .and. kda == 1 .and. mcsec == 0) then ! <-- END of EVERY YR: - if (nyrs == 1) then ! <-- END of YR 1 - gdd020(p) = gdd0(p) ! <-- END of YR 1 - gdd820(p) = gdd8(p) ! <-- END of YR 1 - gdd1020(p) = gdd10(p) ! <-- END of YR 1 - end if ! <-- END of YR 1 - gdd020(p) = (yravgm1* gdd020(p) + gdd0(p)) / yravg ! gdd..20 must be long term avgs - gdd820(p) = (yravgm1* gdd820(p) + gdd8(p)) / yravg ! so ignore results for yrs 1 & 2 - gdd1020(p) = (yravgm1* gdd1020(p) + gdd10(p)) / yravg - end if - end do - -end subroutine CNPhenologyClimate -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNEvergreenPhenology -! -! !INTERFACE: -subroutine CNEvergreenPhenology (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! For coupled carbon-nitrogen code (CN). -! -! !USES: - use clm_varcon , only: secspday - use clm_time_manager, only: get_days_per_year -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/2/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - ! ecophysiological constants - real(r8), pointer :: evergreen(:) ! binary flag for evergreen leaf habit (0 or 1) - real(r8), pointer :: leaf_long(:) ! leaf longevity (yrs) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: bgtr(:) ! background transfer growth rate (1/s) - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - real(r8):: dayspyr ! Days per year - integer :: p ! indices - integer :: fp ! lake filter pft index -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers to derived type arrays - ivt => pft%itype - evergreen => pftcon%evergreen - leaf_long => pftcon%leaf_long - bglfr => pepv%bglfr - bgtr => pepv%bgtr - lgsf => pepv%lgsf - dayspyr = get_days_per_year() - - do fp = 1,num_soilp - p = filter_soilp(fp) - if (evergreen(ivt(p)) == 1._r8) then - bglfr(p) = 1._r8/(leaf_long(ivt(p))*dayspyr*secspday) - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - end if - end do - -end subroutine CNEvergreenPhenology -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSeasonDecidPhenology -! -! !INTERFACE: -subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! For coupled carbon-nitrogen code (CN). -! This routine handles the seasonal deciduous phenology code (temperate -! deciduous vegetation that has only one growing season per year). -! -! !USES: - use shr_const_mod , only: SHR_CONST_TKFRZ, SHR_CONST_PI - use clm_varcon , only: secspday -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/6/03: Created by Peter Thornton -! 10/24/03, Peter Thornton: migrated to vector data structures -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: latdeg(:) ! latitude (radians) - real(r8), pointer :: decl(:) ! solar declination (radians) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - ! ecophysiological constants - real(r8), pointer :: season_decid(:) ! binary flag for seasonal-deciduous leaf habit (0 or 1) - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) -! -! local pointers to implicit in/out scalars - real(r8), pointer :: dormant_flag(:) ! dormancy flag - real(r8), pointer :: days_active(:) ! number of days since last dormancy - real(r8), pointer :: onset_flag(:) ! onset flag - real(r8), pointer :: onset_counter(:) ! onset counter (seconds) - real(r8), pointer :: onset_gddflag(:) ! onset freeze flag - real(r8), pointer :: onset_gdd(:) ! onset growing degree days - real(r8), pointer :: offset_flag(:) ! offset flag - real(r8), pointer :: offset_counter(:) ! offset counter (seconds) - real(r8), pointer :: dayl(:) ! daylength (seconds) - real(r8), pointer :: prev_dayl(:) ! daylength from previous albedo timestep (seconds) - real(r8), pointer :: annavg_t2m(:) ! annual average 2m air temperature (K) - real(r8), pointer :: prev_leafc_to_litter(:) ! previous timestep leaf C litterfall flux (gC/m2/s) - real(r8), pointer :: prev_frootc_to_litter(:) ! previous timestep froot C litterfall flux (gC/m2/s) - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: bgtr(:) ! background transfer growth rate (1/s) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: leafn_xfer_to_leafn(:) - real(r8), pointer :: frootn_xfer_to_frootn(:) - real(r8), pointer :: livestemn_xfer_to_livestemn(:) - real(r8), pointer :: deadstemn_xfer_to_deadstemn(:) - real(r8), pointer :: livecrootn_xfer_to_livecrootn(:) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn(:) - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: leafc_storage_to_xfer(:) - real(r8), pointer :: frootc_storage_to_xfer(:) - real(r8), pointer :: livestemc_storage_to_xfer(:) - real(r8), pointer :: deadstemc_storage_to_xfer(:) - real(r8), pointer :: livecrootc_storage_to_xfer(:) - real(r8), pointer :: deadcrootc_storage_to_xfer(:) - real(r8), pointer :: gresp_storage_to_xfer(:) - real(r8), pointer :: leafn_storage_to_xfer(:) - real(r8), pointer :: frootn_storage_to_xfer(:) - real(r8), pointer :: livestemn_storage_to_xfer(:) - real(r8), pointer :: deadstemn_storage_to_xfer(:) - real(r8), pointer :: livecrootn_storage_to_xfer(:) - real(r8), pointer :: deadcrootn_storage_to_xfer(:) - logical , pointer :: pftmayexist(:) ! exclude seasonal decid pfts from tropics -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: c,p !indices - integer :: fp !lake filter pft index - real(r8):: ws_flag !winter-summer solstice flag (0 or 1) - real(r8):: crit_onset_gdd !critical onset growing degree-day sum - real(r8):: soilt - real(r8):: lat !latitude (radians) - real(r8):: temp !temporary variable for daylength calculation - -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - ivt => pft%itype - pcolumn => pft%column - pgridcell => pft%gridcell - latdeg => grc%latdeg - decl => cps%decl - t_soisno => ces%t_soisno - leafc_storage => pcs%leafc_storage - frootc_storage => pcs%frootc_storage - livestemc_storage => pcs%livestemc_storage - deadstemc_storage => pcs%deadstemc_storage - livecrootc_storage => pcs%livecrootc_storage - deadcrootc_storage => pcs%deadcrootc_storage - gresp_storage => pcs%gresp_storage - leafn_storage => pns%leafn_storage - frootn_storage => pns%frootn_storage - livestemn_storage => pns%livestemn_storage - deadstemn_storage => pns%deadstemn_storage - livecrootn_storage => pns%livecrootn_storage - deadcrootn_storage => pns%deadcrootn_storage - season_decid => pftcon%season_decid - woody => pftcon%woody - - ! Assign local pointers to derived type arrays (out) - dormant_flag => pepv%dormant_flag - days_active => pepv%days_active - onset_flag => pepv%onset_flag - onset_counter => pepv%onset_counter - onset_gddflag => pepv%onset_gddflag - onset_gdd => pepv%onset_gdd - offset_flag => pepv%offset_flag - offset_counter => pepv%offset_counter - dayl => pepv%dayl - prev_dayl => pepv%prev_dayl - annavg_t2m => pepv%annavg_t2m - prev_leafc_to_litter => pepv%prev_leafc_to_litter - prev_frootc_to_litter => pepv%prev_frootc_to_litter - bglfr => pepv%bglfr - bgtr => pepv%bgtr - lgsf => pepv%lgsf - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - leafn_xfer_to_leafn => pnf%leafn_xfer_to_leafn - frootn_xfer_to_frootn => pnf%frootn_xfer_to_frootn - livestemn_xfer_to_livestemn => pnf%livestemn_xfer_to_livestemn - deadstemn_xfer_to_deadstemn => pnf%deadstemn_xfer_to_deadstemn - livecrootn_xfer_to_livecrootn => pnf%livecrootn_xfer_to_livecrootn - deadcrootn_xfer_to_deadcrootn => pnf%deadcrootn_xfer_to_deadcrootn - leafc_xfer => pcs%leafc_xfer - frootc_xfer => pcs%frootc_xfer - livestemc_xfer => pcs%livestemc_xfer - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc_xfer => pcs%deadcrootc_xfer - leafn_xfer => pns%leafn_xfer - frootn_xfer => pns%frootn_xfer - livestemn_xfer => pns%livestemn_xfer - deadstemn_xfer => pns%deadstemn_xfer - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn_xfer => pns%deadcrootn_xfer - leafc_storage_to_xfer => pcf%leafc_storage_to_xfer - frootc_storage_to_xfer => pcf%frootc_storage_to_xfer - livestemc_storage_to_xfer => pcf%livestemc_storage_to_xfer - deadstemc_storage_to_xfer => pcf%deadstemc_storage_to_xfer - livecrootc_storage_to_xfer => pcf%livecrootc_storage_to_xfer - deadcrootc_storage_to_xfer => pcf%deadcrootc_storage_to_xfer - gresp_storage_to_xfer => pcf%gresp_storage_to_xfer - leafn_storage_to_xfer => pnf%leafn_storage_to_xfer - frootn_storage_to_xfer => pnf%frootn_storage_to_xfer - livestemn_storage_to_xfer => pnf%livestemn_storage_to_xfer - deadstemn_storage_to_xfer => pnf%deadstemn_storage_to_xfer - livecrootn_storage_to_xfer => pnf%livecrootn_storage_to_xfer - deadcrootn_storage_to_xfer => pnf%deadcrootn_storage_to_xfer - pftmayexist => pdgvs%pftmayexist - - ! start pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - - if (season_decid(ivt(p)) == 1._r8) then - - ! set background litterfall rate, background transfer rate, and - ! long growing season factor to 0 for seasonal deciduous types - bglfr(p) = 0._r8 - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - - ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) - - ! use solar declination information stored during Surface Albedo() - ! and latitude from gps to calcluate daylength (convert latitude from degrees to radians) - ! the constant 13750.9871 is the number of seconds per radian of hour-angle - - prev_dayl(p) = dayl(p) - lat = (SHR_CONST_PI/180._r8)*latdeg(pgridcell(p)) - temp = -(sin(lat)*sin(decl(c)))/(cos(lat) * cos(decl(c))) - temp = min(1._r8,max(-1._r8,temp)) - dayl(p) = 2.0_r8 * 13750.9871_r8 * acos(temp) - - ! set flag for solstice period (winter->summer = 1, summer->winter = 0) - if (dayl(p) >= prev_dayl(p)) then - ws_flag = 1._r8 - else - ws_flag = 0._r8 - end if - - ! update offset_counter and test for the end of the offset period - if (offset_flag(p) == 1.0_r8) then - ! decrement counter for offset period - offset_counter(p) = offset_counter(p) - dt - - ! if this is the end of the offset_period, reset phenology - ! flags and indices - if (offset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_offset_cleanup(p) - ! inlined during vectorization - - offset_flag(p) = 0._r8 - offset_counter(p) = 0._r8 - dormant_flag(p) = 1._r8 - days_active(p) = 0._r8 - if (use_cndv) then - pftmayexist(p) = .true. - end if - - ! reset the previous timestep litterfall flux memory - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! update onset_counter and test for the end of the onset period - if (onset_flag(p) == 1.0_r8) then - ! decrement counter for onset period - onset_counter(p) = onset_counter(p) - dt - - ! if this is the end of the onset period, reset phenology - ! flags and indices - if (onset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_onset_cleanup(p) - ! inlined during vectorization - - onset_flag(p) = 0.0_r8 - onset_counter(p) = 0.0_r8 - ! set all transfer growth rates to 0.0 - leafc_xfer_to_leafc(p) = 0.0_r8 - frootc_xfer_to_frootc(p) = 0.0_r8 - leafn_xfer_to_leafn(p) = 0.0_r8 - frootn_xfer_to_frootn(p) = 0.0_r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = 0.0_r8 - deadstemc_xfer_to_deadstemc(p) = 0.0_r8 - livecrootc_xfer_to_livecrootc(p) = 0.0_r8 - deadcrootc_xfer_to_deadcrootc(p) = 0.0_r8 - livestemn_xfer_to_livestemn(p) = 0.0_r8 - deadstemn_xfer_to_deadstemn(p) = 0.0_r8 - livecrootn_xfer_to_livecrootn(p) = 0.0_r8 - deadcrootn_xfer_to_deadcrootn(p) = 0.0_r8 - end if - ! set transfer pools to 0.0 - leafc_xfer(p) = 0.0_r8 - leafn_xfer(p) = 0.0_r8 - frootc_xfer(p) = 0.0_r8 - frootn_xfer(p) = 0.0_r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer(p) = 0.0_r8 - livestemn_xfer(p) = 0.0_r8 - deadstemc_xfer(p) = 0.0_r8 - deadstemn_xfer(p) = 0.0_r8 - livecrootc_xfer(p) = 0.0_r8 - livecrootn_xfer(p) = 0.0_r8 - deadcrootc_xfer(p) = 0.0_r8 - deadcrootn_xfer(p) = 0.0_r8 - end if - end if - end if - - ! test for switching from dormant period to growth period - if (dormant_flag(p) == 1.0_r8) then - - ! Test to turn on growing degree-day sum, if off. - ! switch on the growing degree day sum on the winter solstice - - if (onset_gddflag(p) == 0._r8 .and. ws_flag == 1._r8) then - onset_gddflag(p) = 1._r8 - onset_gdd(p) = 0._r8 - end if - - ! Test to turn off growing degree-day sum, if on. - ! This test resets the growing degree day sum if it gets past - ! the summer solstice without reaching the threshold value. - ! In that case, it will take until the next winter solstice - ! before the growing degree-day summation starts again. - - if (onset_gddflag(p) == 1._r8 .and. ws_flag == 0._r8) then - onset_gddflag(p) = 0._r8 - onset_gdd(p) = 0._r8 - end if - - ! if the gdd flag is set, and if the soil is above freezing - ! then accumulate growing degree days for onset trigger - - soilt = t_soisno(c,3) - if (onset_gddflag(p) == 1.0_r8 .and. soilt > SHR_CONST_TKFRZ) then - onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday - end if - - ! set onset_flag if critical growing degree-day sum is exceeded - if (onset_gdd(p) > crit_onset_gdd) then - onset_flag(p) = 1.0_r8 - dormant_flag(p) = 0.0_r8 - onset_gddflag(p) = 0.0_r8 - onset_gdd(p) = 0.0_r8 - onset_counter(p) = ndays_on * secspday - - ! move all the storage pools into transfer pools, - ! where they will be transfered to displayed growth over the onset period. - ! this code was originally handled with call cn_storage_to_xfer(p) - ! inlined during vectorization - - ! set carbon fluxes for shifting storage pools to transfer pools - leafc_storage_to_xfer(p) = fstor2tran * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = fstor2tran * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = fstor2tran * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = fstor2tran * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = fstor2tran * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = fstor2tran * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = fstor2tran * gresp_storage(p)/dt - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = fstor2tran * leafn_storage(p)/dt - frootn_storage_to_xfer(p) = fstor2tran * frootn_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = fstor2tran * livestemn_storage(p)/dt - deadstemn_storage_to_xfer(p) = fstor2tran * deadstemn_storage(p)/dt - livecrootn_storage_to_xfer(p) = fstor2tran * livecrootn_storage(p)/dt - deadcrootn_storage_to_xfer(p) = fstor2tran * deadcrootn_storage(p)/dt - end if - end if - - ! test for switching from growth period to offset period - else if (offset_flag(p) == 0.0_r8) then - if (use_cndv) then - ! If days_active > 355, then remove pft in - ! CNDVEstablishment at the end of the year. - ! days_active > 355 is a symptom of seasonal decid. pfts occurring in - ! gridcells where dayl never drops below crit_dayl. - ! This results in TLAI>1e4 in a few gridcells. - days_active(p) = days_active(p) + fracday - if (days_active(p) > 355._r8) pftmayexist(p) = .false. - end if - - ! only begin to test for offset daylength once past the summer sol - if (ws_flag == 0._r8 .and. dayl(p) < crit_dayl) then - offset_flag(p) = 1._r8 - offset_counter(p) = ndays_off * secspday - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - end if ! end if seasonal deciduous - - end do ! end of pft loop - -end subroutine CNSeasonDecidPhenology -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNStressDecidPhenology -! -! !INTERFACE: -subroutine CNStressDecidPhenology (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! This routine handles phenology for vegetation types, such as grasses and -! tropical drought deciduous trees, that respond to cold and drought stress -! signals and that can have multiple growing seasons in a given year. -! This routine allows for the possibility that leaves might persist year-round -! in the absence of a suitable stress trigger, by switching to an essentially -! evergreen habit, but maintaining a deciduous leaf longevity, while waiting -! for the next stress trigger. This is in contrast to the seasonal deciduous -! algorithm (for temperate deciduous trees) that forces a single growing season -! per year. -! -! !USES: - use clm_time_manager, only: get_days_per_year - use clm_varcon , only: secspday - use shr_const_mod , only: SHR_CONST_TKFRZ, SHR_CONST_PI -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/27/03: Created by Peter Thornton -! 01/29/04: Made onset_gdd critical sum a function of temperature, as in -! seasonal deciduous algorithm. -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: latdeg(:) ! latitude (radians) - real(r8), pointer :: decl(:) ! solar declination (radians) - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) - real(r8), pointer :: leaf_long(:) ! leaf longevity (yrs) - real(r8), pointer :: stress_decid(:) ! binary flag for stress-deciduous leaf habit (0 or 1) - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: dormant_flag(:) ! dormancy flag - real(r8), pointer :: days_active(:) ! number of days since last dormancy - real(r8), pointer :: onset_flag(:) ! onset flag - real(r8), pointer :: onset_counter(:) ! onset counter (seconds) - real(r8), pointer :: onset_gddflag(:) ! onset freeze flag - real(r8), pointer :: onset_fdd(:) ! onset freezing degree days counter - real(r8), pointer :: onset_gdd(:) ! onset growing degree days - real(r8), pointer :: onset_swi(:) ! onset soil water index - real(r8), pointer :: offset_flag(:) ! offset flag - real(r8), pointer :: offset_counter(:) ! offset counter (seconds) - real(r8), pointer :: dayl(:) ! daylength (seconds) - real(r8), pointer :: offset_fdd(:) ! offset freezing degree days counter - real(r8), pointer :: offset_swi(:) ! offset soil water index - real(r8), pointer :: annavg_t2m(:) ! annual average 2m air temperature (K) - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: bgtr(:) ! background transfer growth rate (1/s) - real(r8), pointer :: prev_leafc_to_litter(:) ! previous timestep leaf C litterfall flux (gC/m2/s) - real(r8), pointer :: prev_frootc_to_litter(:) ! previous timestep froot C litterfall flux (gC/m2/s) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: leafn_xfer_to_leafn(:) - real(r8), pointer :: frootn_xfer_to_frootn(:) - real(r8), pointer :: livestemn_xfer_to_livestemn(:) - real(r8), pointer :: deadstemn_xfer_to_deadstemn(:) - real(r8), pointer :: livecrootn_xfer_to_livecrootn(:) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn(:) - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: leafc_storage_to_xfer(:) - real(r8), pointer :: frootc_storage_to_xfer(:) - real(r8), pointer :: livestemc_storage_to_xfer(:) - real(r8), pointer :: deadstemc_storage_to_xfer(:) - real(r8), pointer :: livecrootc_storage_to_xfer(:) - real(r8), pointer :: deadcrootc_storage_to_xfer(:) - real(r8), pointer :: gresp_storage_to_xfer(:) - real(r8), pointer :: leafn_storage_to_xfer(:) - real(r8), pointer :: frootn_storage_to_xfer(:) - real(r8), pointer :: livestemn_storage_to_xfer(:) - real(r8), pointer :: deadstemn_storage_to_xfer(:) - real(r8), pointer :: livecrootn_storage_to_xfer(:) - real(r8), pointer :: deadcrootn_storage_to_xfer(:) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - real(r8),parameter :: secspqtrday = secspday / 4 ! seconds per quarter day - integer :: c,p ! indices - integer :: fp ! lake filter pft index - real(r8):: dayspyr ! days per year - real(r8):: crit_onset_gdd ! degree days for onset trigger - real(r8):: soilt ! temperature of top soil layer - real(r8):: psi ! water stress of top soil layer - real(r8):: lat !latitude (radians) - real(r8):: temp !temporary variable for daylength calculation -!EOP -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - ivt => pft%itype - pcolumn => pft%column - pgridcell => pft%gridcell - latdeg => grc%latdeg - decl => cps%decl - leafc_storage => pcs%leafc_storage - frootc_storage => pcs%frootc_storage - livestemc_storage => pcs%livestemc_storage - deadstemc_storage => pcs%deadstemc_storage - livecrootc_storage => pcs%livecrootc_storage - deadcrootc_storage => pcs%deadcrootc_storage - gresp_storage => pcs%gresp_storage - leafn_storage => pns%leafn_storage - frootn_storage => pns%frootn_storage - livestemn_storage => pns%livestemn_storage - deadstemn_storage => pns%deadstemn_storage - livecrootn_storage => pns%livecrootn_storage - deadcrootn_storage => pns%deadcrootn_storage - soilpsi => cps%soilpsi - t_soisno => ces%t_soisno - leaf_long => pftcon%leaf_long - woody => pftcon%woody - stress_decid => pftcon%stress_decid - - ! Assign local pointers to derived type arrays (out) - dormant_flag => pepv%dormant_flag - days_active => pepv%days_active - onset_flag => pepv%onset_flag - onset_counter => pepv%onset_counter - onset_gddflag => pepv%onset_gddflag - onset_fdd => pepv%onset_fdd - onset_gdd => pepv%onset_gdd - onset_swi => pepv%onset_swi - offset_flag => pepv%offset_flag - offset_counter => pepv%offset_counter - dayl => pepv%dayl - offset_fdd => pepv%offset_fdd - offset_swi => pepv%offset_swi - annavg_t2m => pepv%annavg_t2m - prev_leafc_to_litter => pepv%prev_leafc_to_litter - prev_frootc_to_litter => pepv%prev_frootc_to_litter - lgsf => pepv%lgsf - bglfr => pepv%bglfr - bgtr => pepv%bgtr - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - leafn_xfer_to_leafn => pnf%leafn_xfer_to_leafn - frootn_xfer_to_frootn => pnf%frootn_xfer_to_frootn - livestemn_xfer_to_livestemn => pnf%livestemn_xfer_to_livestemn - deadstemn_xfer_to_deadstemn => pnf%deadstemn_xfer_to_deadstemn - livecrootn_xfer_to_livecrootn => pnf%livecrootn_xfer_to_livecrootn - deadcrootn_xfer_to_deadcrootn => pnf%deadcrootn_xfer_to_deadcrootn - leafc_xfer => pcs%leafc_xfer - frootc_xfer => pcs%frootc_xfer - livestemc_xfer => pcs%livestemc_xfer - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc_xfer => pcs%deadcrootc_xfer - leafn_xfer => pns%leafn_xfer - frootn_xfer => pns%frootn_xfer - livestemn_xfer => pns%livestemn_xfer - deadstemn_xfer => pns%deadstemn_xfer - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn_xfer => pns%deadcrootn_xfer - leafc_storage_to_xfer => pcf%leafc_storage_to_xfer - frootc_storage_to_xfer => pcf%frootc_storage_to_xfer - livestemc_storage_to_xfer => pcf%livestemc_storage_to_xfer - deadstemc_storage_to_xfer => pcf%deadstemc_storage_to_xfer - livecrootc_storage_to_xfer => pcf%livecrootc_storage_to_xfer - deadcrootc_storage_to_xfer => pcf%deadcrootc_storage_to_xfer - gresp_storage_to_xfer => pcf%gresp_storage_to_xfer - leafn_storage_to_xfer => pnf%leafn_storage_to_xfer - frootn_storage_to_xfer => pnf%frootn_storage_to_xfer - livestemn_storage_to_xfer => pnf%livestemn_storage_to_xfer - deadstemn_storage_to_xfer => pnf%deadstemn_storage_to_xfer - livecrootn_storage_to_xfer => pnf%livecrootn_storage_to_xfer - deadcrootn_storage_to_xfer => pnf%deadcrootn_storage_to_xfer - - ! set time steps - dayspyr = get_days_per_year() - - do fp = 1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - - if (stress_decid(ivt(p)) == 1._r8) then - soilt = t_soisno(c,3) - psi = soilpsi(c,3) - - ! use solar declination information stored during Surface Albedo() - ! and latitude from gps to calcluate daylength (convert latitude from degrees to radians) - ! the constant 13750.9871 is the number of seconds per radian of hour-angle - - lat = (SHR_CONST_PI/180._r8)*latdeg(pgridcell(p)) - temp = -(sin(lat)*sin(decl(c)))/(cos(lat) * cos(decl(c))) - temp = min(1._r8,max(-1._r8,temp)) - dayl(p) = 2.0_r8 * 13750.9871_r8 * acos(temp) - - ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) - - - ! update offset_counter and test for the end of the offset period - if (offset_flag(p) == 1._r8) then - ! decrement counter for offset period - offset_counter(p) = offset_counter(p) - dt - - ! if this is the end of the offset_period, reset phenology - ! flags and indices - if (offset_counter(p) == 0._r8) then - ! this code block was originally handled by call cn_offset_cleanup(p) - ! inlined during vectorization - offset_flag(p) = 0._r8 - offset_counter(p) = 0._r8 - dormant_flag(p) = 1._r8 - days_active(p) = 0._r8 - - ! reset the previous timestep litterfall flux memory - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! update onset_counter and test for the end of the onset period - if (onset_flag(p) == 1.0_r8) then - ! decrement counter for onset period - onset_counter(p) = onset_counter(p) - dt - - ! if this is the end of the onset period, reset phenology - ! flags and indices - if (onset_counter(p) == 0.0_r8) then - ! this code block was originally handled by call cn_onset_cleanup(p) - ! inlined during vectorization - onset_flag(p) = 0._r8 - onset_counter(p) = 0._r8 - ! set all transfer growth rates to 0.0 - leafc_xfer_to_leafc(p) = 0._r8 - frootc_xfer_to_frootc(p) = 0._r8 - leafn_xfer_to_leafn(p) = 0._r8 - frootn_xfer_to_frootn(p) = 0._r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = 0._r8 - deadstemc_xfer_to_deadstemc(p) = 0._r8 - livecrootc_xfer_to_livecrootc(p) = 0._r8 - deadcrootc_xfer_to_deadcrootc(p) = 0._r8 - livestemn_xfer_to_livestemn(p) = 0._r8 - deadstemn_xfer_to_deadstemn(p) = 0._r8 - livecrootn_xfer_to_livecrootn(p) = 0._r8 - deadcrootn_xfer_to_deadcrootn(p) = 0._r8 - end if - ! set transfer pools to 0.0 - leafc_xfer(p) = 0._r8 - leafn_xfer(p) = 0._r8 - frootc_xfer(p) = 0._r8 - frootn_xfer(p) = 0._r8 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer(p) = 0._r8 - livestemn_xfer(p) = 0._r8 - deadstemc_xfer(p) = 0._r8 - deadstemn_xfer(p) = 0._r8 - livecrootc_xfer(p) = 0._r8 - livecrootn_xfer(p) = 0._r8 - deadcrootc_xfer(p) = 0._r8 - deadcrootn_xfer(p) = 0._r8 - end if - end if - end if - - ! test for switching from dormant period to growth period - if (dormant_flag(p) == 1._r8) then - - ! keep track of the number of freezing degree days in this - ! dormancy period (only if the freeze flag has not previously been set - ! for this dormancy period - - if (onset_gddflag(p) == 0._r8 .and. soilt < SHR_CONST_TKFRZ) onset_fdd(p) = onset_fdd(p) + fracday - - ! if the number of freezing degree days exceeds a critical value, - ! then onset will require both wet soils and a critical soil - ! temperature sum. If this case is triggered, reset any previously - ! accumulated value in onset_swi, so that onset now depends on - ! the accumulated soil water index following the freeze trigger - - if (onset_fdd(p) > crit_onset_fdd) then - onset_gddflag(p) = 1._r8 - onset_fdd(p) = 0._r8 - onset_swi(p) = 0._r8 - end if - - ! if the freeze flag is set, and if the soil is above freezing - ! then accumulate growing degree days for onset trigger - - if (onset_gddflag(p) == 1._r8 .and. soilt > SHR_CONST_TKFRZ) then - onset_gdd(p) = onset_gdd(p) + (soilt-SHR_CONST_TKFRZ)*fracday - end if - - ! if soils are wet, accumulate soil water index for onset trigger - if (psi >= soilpsi_on) onset_swi(p) = onset_swi(p) + fracday - - ! if critical soil water index is exceeded, set onset_flag, and - ! then test for soil temperature criteria - - if (onset_swi(p) > crit_onset_swi) then - onset_flag(p) = 1._r8 - - ! only check soil temperature criteria if freeze flag set since - ! beginning of last dormancy. If freeze flag set and growing - ! degree day sum (since freeze trigger) is lower than critical - ! value, then override the onset_flag set from soil water. - - if (onset_gddflag(p) == 1._r8 .and. onset_gdd(p) < crit_onset_gdd) onset_flag(p) = 0._r8 - end if - - ! only allow onset if dayl > 6hrs - if (onset_flag(p) == 1._r8 .and. dayl(p) <= secspqtrday) then - onset_flag(p) = 0._r8 - end if - - ! if this is the beginning of the onset period - ! then reset the phenology flags and indices - - if (onset_flag(p) == 1._r8) then - dormant_flag(p) = 0._r8 - days_active(p) = 0._r8 - onset_gddflag(p) = 0._r8 - onset_fdd(p) = 0._r8 - onset_gdd(p) = 0._r8 - onset_swi(p) = 0._r8 - onset_counter(p) = ndays_on * secspday - - ! call subroutine to move all the storage pools into transfer pools, - ! where they will be transfered to displayed growth over the onset period. - ! this code was originally handled with call cn_storage_to_xfer(p) - ! inlined during vectorization - - ! set carbon fluxes for shifting storage pools to transfer pools - leafc_storage_to_xfer(p) = fstor2tran * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = fstor2tran * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = fstor2tran * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = fstor2tran * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = fstor2tran * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = fstor2tran * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = fstor2tran * gresp_storage(p)/dt - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = fstor2tran * leafn_storage(p)/dt - frootn_storage_to_xfer(p) = fstor2tran * frootn_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = fstor2tran * livestemn_storage(p)/dt - deadstemn_storage_to_xfer(p) = fstor2tran * deadstemn_storage(p)/dt - livecrootn_storage_to_xfer(p) = fstor2tran * livecrootn_storage(p)/dt - deadcrootn_storage_to_xfer(p) = fstor2tran * deadcrootn_storage(p)/dt - end if - end if - - ! test for switching from growth period to offset period - else if (offset_flag(p) == 0._r8) then - - ! if soil water potential lower than critical value, accumulate - ! as stress in offset soil water index - - if (psi <= soilpsi_off) then - offset_swi(p) = offset_swi(p) + fracday - - ! if the offset soil water index exceeds critical value, and - ! if this is not the middle of a previously initiated onset period, - ! then set flag to start the offset period and reset index variables - - if (offset_swi(p) >= crit_offset_swi .and. onset_flag(p) == 0._r8) offset_flag(p) = 1._r8 - - ! if soil water potential higher than critical value, reduce the - ! offset water stress index. By this mechanism, there must be a - ! sustained period of water stress to initiate offset. - - else if (psi >= soilpsi_on) then - offset_swi(p) = offset_swi(p) - fracday - offset_swi(p) = max(offset_swi(p),0._r8) - end if - - ! decrease freezing day accumulator for warm soil - if (offset_fdd(p) > 0._r8 .and. soilt > SHR_CONST_TKFRZ) then - offset_fdd(p) = offset_fdd(p) - fracday - offset_fdd(p) = max(0._r8, offset_fdd(p)) - end if - - ! increase freezing day accumulator for cold soil - if (soilt <= SHR_CONST_TKFRZ) then - offset_fdd(p) = offset_fdd(p) + fracday - - ! if freezing degree day sum is greater than critical value, initiate offset - if (offset_fdd(p) > crit_offset_fdd .and. onset_flag(p) == 0._r8) offset_flag(p) = 1._r8 - end if - - ! force offset if daylength is < 6 hrs - if (dayl(p) <= secspqtrday) then - offset_flag(p) = 1._r8 - end if - - ! if this is the beginning of the offset period - ! then reset flags and indices - if (offset_flag(p) == 1._r8) then - offset_fdd(p) = 0._r8 - offset_swi(p) = 0._r8 - offset_counter(p) = ndays_off * secspday - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - end if - end if - - ! keep track of number of days since last dormancy for control on - ! fraction of new growth to send to storage for next growing season - - if (dormant_flag(p) == 0.0_r8) then - days_active(p) = days_active(p) + fracday - end if - - ! calculate long growing season factor (lgsf) - ! only begin to calculate a lgsf greater than 0.0 once the number - ! of days active exceeds days/year. - lgsf(p) = max(min((days_active(p)-dayspyr)/dayspyr, 1._r8),0._r8) - - ! set background litterfall rate, when not in the phenological offset period - if (offset_flag(p) == 1._r8) then - bglfr(p) = 0._r8 - else - ! calculate the background litterfall rate (bglfr) - ! in units 1/s, based on leaf longevity (yrs) and correction for long growing season - - bglfr(p) = (1._r8/(leaf_long(ivt(p))*dayspyr*secspday))*lgsf(p) - end if - - ! set background transfer rate when active but not in the phenological onset period - if (onset_flag(p) == 1._r8) then - bgtr(p) = 0._r8 - else - ! the background transfer rate is calculated as the rate that would result - ! in complete turnover of the storage pools in one year at steady state, - ! once lgsf has reached 1.0 (after 730 days active). - - bgtr(p) = (1._r8/(dayspyr*secspday))*lgsf(p) - - ! set carbon fluxes for shifting storage pools to transfer pools - - leafc_storage_to_xfer(p) = leafc_storage(p) * bgtr(p) - frootc_storage_to_xfer(p) = frootc_storage(p) * bgtr(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = livestemc_storage(p) * bgtr(p) - deadstemc_storage_to_xfer(p) = deadstemc_storage(p) * bgtr(p) - livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * bgtr(p) - deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * bgtr(p) - gresp_storage_to_xfer(p) = gresp_storage(p) * bgtr(p) - end if - - ! set nitrogen fluxes for shifting storage pools to transfer pools - leafn_storage_to_xfer(p) = leafn_storage(p) * bgtr(p) - frootn_storage_to_xfer(p) = frootn_storage(p) * bgtr(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemn_storage_to_xfer(p) = livestemn_storage(p) * bgtr(p) - deadstemn_storage_to_xfer(p) = deadstemn_storage(p) * bgtr(p) - livecrootn_storage_to_xfer(p) = livecrootn_storage(p) * bgtr(p) - deadcrootn_storage_to_xfer(p) = deadcrootn_storage(p) * bgtr(p) - end if - end if - - end if ! end if stress deciduous - - end do ! end of pft loop - -end subroutine CNStressDecidPhenology -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CropPhenology -! -! !INTERFACE: -subroutine CropPhenology(num_pcropp, filter_pcropp) - -! !DESCRIPTION: -! Code from AgroIBIS to determine crop phenology and code from CN to -! handle CN fluxes during the phenological onset & offset periods. - -! !USES: - use clm_time_manager, only : get_curr_date, get_curr_calday, get_days_per_year - use pftvarcon , only : ncorn, nscereal, nwcereal, nsoybean, gddmin, hybgdd, & - lfemerg, grnfill, mxmat, minplanttemp, planttemp - use clm_varcon , only : spval, secspday - -! !ARGUMENTS: - integer, intent(in) :: num_pcropp ! number of prog crop pfts in filter - integer, intent(in) :: filter_pcropp(:) ! filter for prognostic crop pfts - -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 2/5/08: slevis created according to AgroIBIS subroutines of Kucharik et al. -! 7/14/08: slevis adapted crop cycles to southern hemisphere -! 3/29/11: ekluzek simply logic using pftvarcon arrays - -!EOP - -! LOCAL VARAIBLES: - integer kyr ! current year - integer kmo ! month of year (1, ..., 12) - integer kda ! day of month (1, ..., 31) - integer mcsec ! seconds of day (0, ..., seconds/day) - integer jday ! julian day of the year - integer fp,p ! pft indices - integer c ! column indices - integer g ! gridcell indices - integer h ! hemisphere indices - integer idpp ! number of days past planting - integer pmmin ! earliest month to plant winter temperate cereal - integer pdmin ! earliest day in earliest month to plant - integer pmmax ! latest possible month (month) and - integer pdmax ! latest day in latest month to plant - real(r8) dayspyr ! days per year - real(r8) crmcorn ! comparitive relative maturity for corn - -! local pointers to implicit in scalars - - integer , pointer :: pgridcell(:)! pft's gridcell index - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: ivt(:) ! pft - real(r8), pointer :: hui(:) ! =gdd since planting (gddplant) - real(r8), pointer :: leafout(:) ! =gdd from top soil layer temperature - real(r8), pointer :: tlai(:) ! one-sided leaf area index, no burying by snow - real(r8), pointer :: gdd020(:) ! 20 yr mean of gdd0 - real(r8), pointer :: gdd820(:) ! 20 yr mean of gdd8 - real(r8), pointer :: gdd1020(:) ! 20 yr mean of gdd10 - real(r8), pointer :: a5tmin(:) ! 5-day running mean of min 2-m temperature - real(r8), pointer :: a10tmin(:) ! 10-day running mean of min 2-m temperature - real(r8), pointer :: t10(:) ! 10-day running mean of the 2 m temperature (K) - real(r8), pointer :: t_ref2m_min(:) !daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: bgtr(:) ! background transfer growth rate (1/s) - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] - real(r8), pointer :: offset_flag(:) ! offset flag - real(r8), pointer :: offset_counter(:) ! offset counter - real(r8), pointer :: leaf_long(:) ! leaf longevity (yrs) - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) -! local pointers to implicit out scalars - integer , pointer :: idop(:) ! date of planting - integer , pointer :: harvdate(:) ! harvest date - logical , pointer :: croplive(:) ! Flag, true if planted, not harvested - logical , pointer :: cropplant(:) ! Flag, true if crop may be planted - real(r8), pointer :: cumvd(:) ! cumulative vernalization d?ependence? - real(r8), pointer :: hdidx(:) ! cold hardening index? - real(r8), pointer :: vf(:) ! vernalization factor - real(r8), pointer :: gddmaturity(:) ! gdd needed to harvest - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: huileaf(:) ! heat unit index needed from planting to leaf emergence - real(r8), pointer :: huigrain(:) ! same to reach vegetative maturity - real(r8), pointer :: onset_flag(:) ! onset flag - real(r8), pointer :: onset_counter(:) ! onset counter - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: dwt_seedc_to_leaf(:) ! (gC/m2/s) seed source to PFT-level - real(r8), pointer :: dwt_seedn_to_leaf(:) ! (gN/m2/s) seed source to PFT-level -!------------------------------------------------------------------------ - - pgridcell => pft%gridcell - pcolumn => pft%column - ivt => pft%itype - idop => pps%idop - harvdate => pps%harvdate - croplive => pps%croplive - cropplant => pps%cropplant - gddmaturity => pps%gddmaturity - huileaf => pps%huileaf - huigrain => pps%huigrain - hui => pps%gddplant - leafout => pps%gddtsoi - tlai => pps%tlai - gdd020 => pps%gdd020 - gdd820 => pps%gdd820 - gdd1020 => pps%gdd1020 - a5tmin => pes%a5tmin - a10tmin => pes%a10tmin - t10 => pes%t10 - cumvd => pps%cumvd - hdidx => pps%hdidx - vf => pps%vf - t_ref2m_min => pes%t_ref2m_min - bglfr => pepv%bglfr - bgtr => pepv%bgtr - lgsf => pepv%lgsf - onset_flag => pepv%onset_flag - offset_flag => pepv%offset_flag - onset_counter => pepv%onset_counter - offset_counter => pepv%offset_counter - leafc_xfer => pcs%leafc_xfer - leafn_xfer => pns%leafn_xfer - leaf_long => pftcon%leaf_long - leafcn => pftcon%leafcn - dwt_seedc_to_leaf => ccf%dwt_seedc_to_leaf - dwt_seedn_to_leaf => cnf%dwt_seedn_to_leaf -! --------------------------------------- - - ! get time info - dayspyr = get_days_per_year() - jday = get_curr_calday() - call get_curr_date(kyr, kmo, kda, mcsec) - - do fp = 1, num_pcropp - p = filter_pcropp(fp) - c = pcolumn(p) - g = pgridcell(p) - h = inhemi(p) - - ! background litterfall and transfer rates; long growing season factor - - bglfr(p) = 0._r8 ! this value changes later in a crop's life cycle - bgtr(p) = 0._r8 - lgsf(p) = 0._r8 - - ! --------------------------------- - ! from AgroIBIS subroutine planting - ! --------------------------------- - - ! in order to allow a crop to be planted only once each year - ! initialize cropplant = .false., but hold it = .true. through the end of the year - - ! initialize other variables that are calculated for crops - ! on an annual basis in cropresidue subroutine - - if ( jday == jdayyrstart(h) .and. mcsec == 0 )then - - ! make sure variables aren't changed at beginning of the year - ! for a crop that is currently planted (e.g. winter temperate cereal) - - if (.not. croplive(p)) then - cropplant(p) = .false. - idop(p) = NOT_Planted - - ! keep next for continuous, annual winter temperate cereal type crop; - ! if we removed elseif, - ! winter cereal grown continuously would amount to a cereal/fallow - ! rotation because cereal would only be planted every other year - - else if (croplive(p) .and. ivt(p) == nwcereal) then - cropplant(p) = .false. -! else ! not possible to have croplive and ivt==cornORsoy? (slevis) - end if - - end if - - if ( (.not. croplive(p)) .and. (.not. cropplant(p)) ) then - - ! gdd needed for * chosen crop and a likely hybrid (for that region) * - ! to reach full physiological maturity - - ! based on accumulated seasonal average growing degree days from - ! April 1 - Sept 30 (inclusive) - ! for corn and soybeans in the United States - - ! decided upon by what the typical average growing season length is - ! and the gdd needed to reach maturity in those regions - - ! first choice is used for spring temperate cereal and/or soybeans and maize - - ! slevis: ibis reads xinpdate in io.f from control.crops.nc variable name 'plantdate' - ! According to Chris Kucharik, the dataset of - ! xinpdate was generated from a previous model run at 0.5 deg resolution - - ! winter temperate cereal : use gdd0 as a limit to plant winter cereal - - if (ivt(p) == nwcereal) then - - ! add check to only plant winter cereal after other crops (soybean, maize) - ! have been harvested - - ! *** remember order of planting is crucial - in terms of which crops you want - ! to be grown in what order *** - - ! in this case, corn or soybeans are assumed to be planted before - ! cereal would be in any particular year that both pfts are allowed - ! to grow in the same grid cell (e.g., double-cropping) - - ! slevis: harvdate below needs cropplant(p) above to be cropplant(p,ivt(p)) - ! where ivt(p) has rotated to winter cereal because - ! cropplant through the end of the year for a harvested crop. - ! Also harvdate(p) should be harvdate(p,ivt(p)) and should be - ! updated on Jan 1st instead of at harvest (slevis) - if (a5tmin(p) /= spval .and. & - a5tmin(p) <= minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - (gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p)))) then - - cumvd(p) = 0._r8 - hdidx(p) = 0._r8 - vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = 1._r8 ! initial seed at planting to appear - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - dwt_seedc_to_leaf(c) = dwt_seedc_to_leaf(c) + leafc_xfer(p)/dt - dwt_seedn_to_leaf(c) = dwt_seedn_to_leaf(c) + leafn_xfer(p)/dt - - ! latest possible date to plant winter cereal and after all other - ! crops were harvested for that year - - else if (jday >= maxplantjday(ivt(p),h) .and. & - gdd020(p) /= spval .and. & - gdd020(p) >= gddmin(ivt(p))) then - - cumvd(p) = 0._r8 - hdidx(p) = 0._r8 - vf(p) = 0._r8 - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - gddmaturity(p) = hybgdd(ivt(p)) - leafc_xfer(p) = 1._r8 ! initial seed at planting to appear - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - dwt_seedc_to_leaf(c) = dwt_seedc_to_leaf(c) + leafc_xfer(p)/dt - dwt_seedn_to_leaf(c) = dwt_seedn_to_leaf(c) + leafn_xfer(p)/dt - else - gddmaturity(p) = 0._r8 - end if - - else ! not winter cereal... slevis: added distinction between NH and SH - ! slevis: The idea is that jday will equal idop sooner or later in the year - ! while the gdd part is either true or false for the year. - if (t10(p) /= spval.and. a10tmin(p) /= spval .and. & - t10(p) > planttemp(ivt(p)) .and. & - a10tmin(p) > minplanttemp(ivt(p)) .and. & - jday >= minplantjday(ivt(p),h) .and. & - jday <= maxplantjday(ivt(p),h) .and. & - t10(p) /= spval .and. a10tmin(p) /= spval .and. & - gdd820(p) /= spval .and. & - gdd820(p) >= gddmin(ivt(p))) then - - ! impose limit on growing season length needed - ! for crop maturity - for cold weather constraints - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - - ! go a specified amount of time before/after - ! climatological date - if (ivt(p)==nsoybean) gddmaturity(p)=min(gdd1020(p),hybgdd(ivt(p))) - if (ivt(p)==ncorn) then - gddmaturity(p)=max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) - gddmaturity(p)=max(950._r8, min(gddmaturity(p)+150._r8,1850._r8)) - end if - if (ivt(p)==nscereal) gddmaturity(p)=min(gdd020(p),hybgdd(ivt(p))) - - leafc_xfer(p) = 1._r8 ! initial seed at planting to appear - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - dwt_seedc_to_leaf(c) = dwt_seedc_to_leaf(c) + leafc_xfer(p)/dt - dwt_seedn_to_leaf(c) = dwt_seedn_to_leaf(c) + leafn_xfer(p)/dt - - ! If hit the max planting julian day -- go ahead and plant - else if (jday == maxplantjday(ivt(p),h) .and. gdd820(p) > 0._r8 .and. & - gdd820(p) /= spval ) then - croplive(p) = .true. - cropplant(p) = .true. - idop(p) = jday - harvdate(p) = NOT_Harvested - - if (ivt(p)==nsoybean) gddmaturity(p)=min(gdd1020(p),hybgdd(ivt(p))) - if (ivt(p)==ncorn) gddmaturity(p)=max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) - if (ivt(p)==nscereal) gddmaturity(p)=min(gdd020(p),hybgdd(ivt(p))) - - leafc_xfer(p) = 1._r8 ! initial seed at planting to appear - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) ! with onset - dwt_seedc_to_leaf(c) = dwt_seedc_to_leaf(c) + leafc_xfer(p)/dt - dwt_seedn_to_leaf(c) = dwt_seedn_to_leaf(c) + leafn_xfer(p)/dt - - else - gddmaturity(p) = 0._r8 - end if - end if ! crop pft distinction - - ! crop phenology (gdd thresholds) controlled by gdd needed for - ! maturity (physiological) which is based on the average gdd - ! accumulation and hybrids in United States from April 1 - Sept 30 - - ! calculate threshold from phase 1 to phase 2: - ! threshold for attaining leaf emergence (based on fraction of - ! gdd(i) -- climatological average) - ! Hayhoe and Dwyer, 1990, Can. J. Soil Sci 70:493-497 - ! Carlson and Gage, 1989, Agric. For. Met., 45: 313-324 - ! J.T. Ritchie, 1991: Modeling Plant and Soil systems - - huileaf(p) = lfemerg(ivt(p)) * gddmaturity(p) ! 3-7% in cereal - - ! calculate threshhold from phase 2 to phase 3: - ! from leaf emergence to beginning of grain-fill period - ! this hypothetically occurs at the end of tassling, not the beginning - ! tassel initiation typically begins at 0.5-0.55 * gddmaturity - - ! calculate linear relationship between huigrain fraction and relative - ! maturity rating for maize - - if (ivt(p) == ncorn) then - ! the following estimation of crmcorn from gddmaturity is based on a linear - ! regression using data from Pioneer-brand corn hybrids (Kucharik, 2003, - ! Earth Interactions 7:1-33: fig. 2) - crmcorn = max(73._r8, min(135._r8, (gddmaturity(p)+ 53.683_r8)/13.882_r8)) - - ! the following adjustment of grnfill based on crmcorn is based on a tuning - ! of Agro-IBIS to give reasonable results for max LAI and the seasonal - ! progression of LAI growth (pers. comm. C. Kucharik June 10, 2010) - huigrain(p) = -0.002_r8 * (crmcorn - 73._r8) + grnfill(ivt(p)) - - huigrain(p) = min(max(huigrain(p), grnfill(ivt(p))-0.1_r8), grnfill(ivt(p))) - huigrain(p) = huigrain(p) * gddmaturity(p) ! Cabelguenne et - else - huigrain(p) = grnfill(ivt(p)) * gddmaturity(p) ! al. 1999 - end if - - end if ! crop not live nor planted - - ! ---------------------------------- - ! from AgroIBIS subroutine phenocrop - ! ---------------------------------- - - ! all of the phenology changes are based on the total number of gdd needed - ! to change to the next phase - based on fractions of the total gdd typical - ! for that region based on the April 1 - Sept 30 window of development - - ! crop phenology (gdd thresholds) controlled by gdd needed for - ! maturity (physiological) which is based on the average gdd - ! accumulation and hybrids in United States from April 1 - Sept 30 - - ! Phase 1: Planting to leaf emergence (now in CNAllocation) - ! Phase 2: Leaf emergence to beginning of grain fill (general LAI accumulation) - ! Phase 3: Grain fill to physiological maturity and harvest (LAI decline) - ! Harvest: if gdd past grain fill initiation exceeds limit - ! or number of days past planting reaches a maximum, the crop has - ! reached physiological maturity and plant is harvested; - ! crop could be live or dead at this stage - these limits - ! could lead to reaching physiological maturity or determining - ! a harvest date for a crop killed by an early frost (see next comments) - ! --- --- --- - ! keeping comments without the code (slevis): - ! if minimum temperature, t_ref2m_min <= freeze kill threshold, tkill - ! for 3 consecutive days and lai is above a minimum, - ! plant will be damaged/killed. This function is more for spring freeze events - ! or for early fall freeze events - - ! spring temperate cereal is affected by this, winter cereal kill function - ! is determined in crops.f - is a more elaborate function of - ! cold hardening of the plant - - ! currently simulates too many grid cells killed by freezing temperatures - - ! removed on March 12 2002 - C. Kucharik - ! until it can be a bit more refined, or used at a smaller scale. - ! we really have no way of validating this routine - ! too difficult to implement on 0.5 degree scale grid cells - ! --- --- --- - - onset_flag(p) = 0._r8 ! CN terminology to trigger certain - offset_flag(p) = 0._r8 ! carbon and nitrogen transfers - - if (croplive(p)) then - - ! call vernalization if winter temperate cereal planted, living, and the - ! vernalization factor is not 1; - ! vf affects the calculation of gddtsoi & gddplant - - if (t_ref2m_min(p) < 1.e30_r8 .and. vf(p) /= 1._r8 .and. ivt(p) == nwcereal) then - call vernalization(p) - end if - - ! days past planting may determine harvest - - if (jday >= idop(p)) then - idpp = jday - idop(p) - else - idpp = int(dayspyr) + jday - idop(p) - end if - - ! onset_counter initialized to zero when .not. croplive - ! offset_counter relevant only at time step of harvest - - onset_counter(p) = onset_counter(p) - dt - - ! enter phase 2 onset for one time step: - ! transfer seed carbon to leaf emergence - - if (leafout(p) >= huileaf(p) .and. hui(p) < huigrain(p) .and. idpp < mxmat(ivt(p))) then - if (abs(onset_counter(p)) > 1.e-6_r8) then - onset_flag(p) = 1._r8 - onset_counter(p) = dt - else - onset_counter(p) = dt ! ensure no re-entry to onset of phase2 - end if - - ! enter harvest for one time step: - ! - transfer live biomass to litter and to crop yield - ! - send xsmrpool to the atmosphere - ! if onset and harvest needed to last longer than one timestep - ! the onset_counter would change from dt and you'd need to make - ! changes to the offset subroutine below - - else if (hui(p) >= gddmaturity(p) .or. idpp >= mxmat(ivt(p))) then - if (harvdate(p) >= NOT_Harvested) harvdate(p) = jday - croplive(p) = .false. ! no re-entry in greater if-block - if (tlai(p) > 0._r8) then ! plant had emerged before harvest - offset_flag(p) = 1._r8 - offset_counter(p) = dt - else ! plant never emerged from the ground - dwt_seedc_to_leaf(c) = dwt_seedc_to_leaf(c) - leafc_xfer(p)/dt - dwt_seedn_to_leaf(c) = dwt_seedn_to_leaf(c) - leafn_xfer(p)/dt - leafc_xfer(p) = 0._r8 ! revert planting transfers - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) - end if - - ! enter phase 3 while previous criteria fail and next is true; - ! in terms of order, phase 3 occurs before harvest, but when - ! harvest *can* occur, we want it to have first priority. - ! AgroIBIS uses a complex formula for lai decline. - ! Use CN's simple formula at least as a place holder (slevis) - - else if (hui(p) >= huigrain(p)) then - bglfr(p) = 1._r8/(leaf_long(ivt(p))*dayspyr*secspday) - end if - - else ! crop not live - onset_counter(p) = 0._r8 - leafc_xfer(p) = 0._r8 - leafn_xfer(p) = leafc_xfer(p) / leafcn(ivt(p)) - end if ! croplive - - end do ! prognostic crops loop - -end subroutine CropPhenology -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CropPhenologyInit -! -! !INTERFACE: -subroutine CropPhenologyInit( begp, endp ) - -! !DESCRIPTION: -! Initialization of CropPhenology. Must be called after time-manager is -! initialized, and after pftcon file is read in. -! -! !USES: - use pftvarcon , only: nwcereal, nsoybean, ncorn, nscereal, & - npcropmin, npcropmax, mnNHplantdate, & - mnSHplantdate, mxNHplantdate, & - mxSHplantdate - use clm_time_manager, only: get_calday -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begp, endp ! Beginning and ending PFT index -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -!EOP - -! LOCAL VARAIBLES: - real(r8), pointer :: latdeg(:) ! latitude (radians) - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer :: p,g,n,i ! indices -!------------------------------------------------------------------------ - latdeg => grc%latdeg - pgridcell => pft%gridcell - - allocate( inhemi(begp:endp) ) - - ! Julian day for the start of the year (mid-winter) - jdayyrstart(inNH) = 1 - jdayyrstart(inSH) = 182 - - ! Convert planting dates into julian day - minplantjday(:,:) = huge(1) - maxplantjday(:,:) = huge(1) - do n = npcropmin, npcropmax - minplantjday(n,inNH) = int( get_calday( mnNHplantdate(n), 0 ) ) - maxplantjday(n,inNH) = int( get_calday( mxNHplantdate(n), 0 ) ) - end do - do n = npcropmin, npcropmax - minplantjday(n,inSH) = int( get_calday( mnSHplantdate(n), 0 ) ) - maxplantjday(n,inSH) = int( get_calday( mxSHplantdate(n), 0 ) ) - end do - - ! Figure out what hemisphere each PFT is in - do p = begp, endp - g = pgridcell(p) - ! Northern hemisphere - if ( latdeg(g) > 0.0_r8 )then - inhemi(p) = inNH - else - inhemi(p) = inSH - end if - end do - - ! - ! Constants for Crop vernalization - ! - - ! photoperiod factor calculation - ! genetic constant - can be modified - - p1d = 0.004_r8 ! average for genotypes from Ritchey, 1991. - ! Modeling plant & soil systems: Wheat phasic developmt - p1v = 0.003_r8 ! average for genotypes from Ritchey, 1991. - - hti = 1._r8 - tbase = 0._r8 - -end subroutine CropPhenologyInit - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: vernalization -! -! !INTERFACE: - subroutine vernalization(p) -! -! !DESCRIPTION: -! -! * * * only call for winter temperate cereal * * * -! -! subroutine calculates vernalization and photoperiod effects on -! gdd accumulation in winter temperate cereal varieties. Thermal time accumulation -! is reduced in 1st period until plant is fully vernalized. During this -! time of emergence to spikelet formation, photoperiod can also have a -! drastic effect on plant development. -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: p ! PFT index running over -! -! !REVISION HISTORY: -! Created by Sam Levis from AGROIBIS -! -!EOP - -! LOCAL VARAIBLES: - real(r8) tcrown ! ? - real(r8) vd, vd1, vd2 ! vernalization dependence - real(r8) tkil ! Freeze kill threshold - integer c,g ! indices -! local pointers to implicit in scalars - integer , pointer :: pcolumn(:) ! pft's column index - logical , pointer :: croplive(:) ! Flag, true if planted, not harvested - real(r8), pointer :: tlai(:) ! one-sided leaf area index, no burying by snow - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min(:) !daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max(:) !daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: snowdp(:) ! snow height (m) -! local pointers to implicit out scalars - real(r8), pointer :: vf(:) ! vernalization factor for cereal - real(r8), pointer :: cumvd(:) ! cumulative vernalization d?ependence? - real(r8), pointer :: gddmaturity(:) ! gdd needed to harvest - real(r8), pointer :: huigrain(:) ! heat unit index needed to reach vegetative maturity - real(r8), pointer :: hdidx(:) ! cold hardening index? -!------------------------------------------------------------------------ - - pcolumn => pft%column - croplive => pps%croplive - hdidx => pps%hdidx - cumvd => pps%cumvd - vf => pps%vf - gddmaturity => pps%gddmaturity - huigrain => pps%huigrain - tlai => pps%tlai - t_ref2m => pes%t_ref2m - t_ref2m_min => pes%t_ref2m_min - t_ref2m_max => pes%t_ref2m_max - snowdp => cps%snowdp - - c = pcolumn(p) - - ! for all equations - temperatures must be in degrees (C) - ! calculate temperature of crown of crop (e.g., 3 cm soil temperature) - ! snow depth in centimeters - - if (t_ref2m(p) < tfrz) then !slevis: t_ref2m inst of td=daily avg (K) - tcrown = 2._r8 + (t_ref2m(p) - tfrz) * (0.4_r8 + 0.0018_r8 * & - (min(snowdp(c)*100._r8, 15._r8) - 15._r8)**2) - else !slevis: snowdp inst of adsnod=daily average (m) - tcrown = t_ref2m(p) - tfrz - end if - - ! vernalization factor calculation - ! if vf(p) = 1. then plant is fully vernalized - and thermal time - ! accumulation in phase 1 will be unaffected - ! refers to gddtsoi & gddplant, defined in the accumulation routines (slevis) - ! reset vf, cumvd, and hdidx to 0 at planting of crop (slevis) - - if (t_ref2m_max(p) > tfrz) then - if (t_ref2m_min(p) <= tfrz+15._r8) then - vd1 = 1.4_r8 - 0.0778_r8 * tcrown - vd2 = 0.5_r8 + 13.44_r8 / ((t_ref2m_max(p)-t_ref2m_min(p)+3._r8)**2) * tcrown - vd = max(0._r8, min(1._r8, vd1, vd2)) - cumvd(p) = cumvd(p) + vd - end if - - if (cumvd(p) < 10._r8 .and. t_ref2m_max(p) > tfrz+30._r8) then - cumvd(p) = cumvd(p) - 0.5_r8 * (t_ref2m_max(p) - tfrz - 30._r8) - end if - cumvd(p) = max(0._r8, cumvd(p)) ! must be > 0 - - vf(p) = 1._r8 - p1v * (50._r8 - cumvd(p)) - vf(p) = max(0._r8, min(vf(p), 1._r8)) ! must be between 0 - 1 - end if - - ! calculate cold hardening of plant - ! determines for winter cereal varieties whether the plant has completed - ! a period of cold hardening to protect it from freezing temperatures. If - ! not, then exposure could result in death or killing of plants. - - ! there are two distinct phases of hardening - - if (t_ref2m_min(p) <= tfrz-3._r8 .or. hdidx(p) /= 0._r8) then - if (hdidx(p) >= hti) then ! done with phase 1 - hdidx(p) = hdidx(p) + 0.083_r8 - hdidx(p) = min(hdidx(p), hti*2._r8) - end if - - if (t_ref2m_max(p) >= tbase + tfrz + 10._r8) then - hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - if (hdidx(p) > hti) hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - hdidx(p) = max(0._r8, hdidx(p)) - end if - - else if (tcrown >= tbase-1._r8) then - if (tcrown <= tbase+8._r8) then - hdidx(p) = hdidx(p) + 0.1_r8 - (tcrown-tbase+3.5_r8)**2 / 506._r8 - if (hdidx(p) >= hti .and. tcrown <= tbase + 0._r8) then - hdidx(p) = hdidx(p) + 0.083_r8 - hdidx(p) = min(hdidx(p), hti*2._r8) - end if - end if - - if (t_ref2m_max(p) >= tbase + tfrz + 10._r8) then - hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - if (hdidx(p) > hti) hdidx(p) = hdidx(p) - 0.02_r8 * (t_ref2m_max(p)-tbase-tfrz-10._r8) - hdidx(p) = max(0._r8, hdidx(p)) - end if - end if - - ! calculate what the cereal killing temperature - ! there is a linear inverse relationship between - ! hardening of the plant and the killing temperature or - ! threshold that the plant can withstand - ! when plant is fully-hardened (hdidx = 2), the killing threshold is -18 C - - ! will have to develop some type of relationship that reduces LAI and - ! biomass pools in response to cold damaged crop - - if (t_ref2m_min(p) <= tfrz - 6._r8) then - tkil = (tbase - 6._r8) - 6._r8 * hdidx(p) - if (tkil >= tcrown) then - if ((0.95_r8 - 0.02_r8 * (tcrown - tkil)**2) >= 0.02_r8) then - write (iulog,*) 'crop damaged by cold temperatures at p,c =', p,c - else if (tlai(p) > 0._r8) then ! slevis: kill if past phase1 - gddmaturity(p) = 0._r8 ! by forcing through - huigrain(p) = 0._r8 ! harvest - write (iulog,*) '95% of crop killed by cold temperatures at p,c =', p,c - end if - end if - end if - - end subroutine vernalization - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNOnsetGrowth -! -! !INTERFACE: -subroutine CNOnsetGrowth (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Determines the flux of stored C and N from transfer pools to display -! pools during the phenological onset period. -! -! !USES: -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/27/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: onset_flag(:) ! onset flag - real(r8), pointer :: onset_counter(:) ! onset days counter - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: bgtr(:) ! background transfer growth rate (1/s) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: leafn_xfer_to_leafn(:) - real(r8), pointer :: frootn_xfer_to_frootn(:) - real(r8), pointer :: livestemn_xfer_to_livestemn(:) - real(r8), pointer :: deadstemn_xfer_to_deadstemn(:) - real(r8), pointer :: livecrootn_xfer_to_livecrootn(:) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn(:) -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter pft index - real(r8):: t1 ! temporary variable - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - onset_flag => pepv%onset_flag - onset_counter => pepv%onset_counter - leafc_xfer => pcs%leafc_xfer - frootc_xfer => pcs%frootc_xfer - livestemc_xfer => pcs%livestemc_xfer - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc_xfer => pcs%deadcrootc_xfer - leafn_xfer => pns%leafn_xfer - frootn_xfer => pns%frootn_xfer - livestemn_xfer => pns%livestemn_xfer - deadstemn_xfer => pns%deadstemn_xfer - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn_xfer => pns%deadcrootn_xfer - bgtr => pepv%bgtr - woody => pftcon%woody - - ! assign local pointers to derived type arrays (out) - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - leafn_xfer_to_leafn => pnf%leafn_xfer_to_leafn - frootn_xfer_to_frootn => pnf%frootn_xfer_to_frootn - livestemn_xfer_to_livestemn => pnf%livestemn_xfer_to_livestemn - deadstemn_xfer_to_deadstemn => pnf%deadstemn_xfer_to_deadstemn - livecrootn_xfer_to_livecrootn => pnf%livecrootn_xfer_to_livecrootn - deadcrootn_xfer_to_deadcrootn => pnf%deadcrootn_xfer_to_deadcrootn - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes during onset period - if (onset_flag(p) == 1._r8) then - - ! The transfer rate is a linearly decreasing function of time, - ! going to zero on the last timestep of the onset period - - if (onset_counter(p) == dt) then - t1 = 1.0_r8 / dt - else - t1 = 2.0_r8 / (onset_counter(p)) - end if - leafc_xfer_to_leafc(p) = t1 * leafc_xfer(p) - frootc_xfer_to_frootc(p) = t1 * frootc_xfer(p) - leafn_xfer_to_leafn(p) = t1 * leafn_xfer(p) - frootn_xfer_to_frootn(p) = t1 * frootn_xfer(p) - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = t1 * livestemc_xfer(p) - deadstemc_xfer_to_deadstemc(p) = t1 * deadstemc_xfer(p) - livecrootc_xfer_to_livecrootc(p) = t1 * livecrootc_xfer(p) - deadcrootc_xfer_to_deadcrootc(p) = t1 * deadcrootc_xfer(p) - livestemn_xfer_to_livestemn(p) = t1 * livestemn_xfer(p) - deadstemn_xfer_to_deadstemn(p) = t1 * deadstemn_xfer(p) - livecrootn_xfer_to_livecrootn(p) = t1 * livecrootn_xfer(p) - deadcrootn_xfer_to_deadcrootn(p) = t1 * deadcrootn_xfer(p) - end if - - end if ! end if onset period - - ! calculate the background rate of transfer growth (used for stress - ! deciduous algorithm). In this case, all of the mass in the transfer - ! pools should be moved to displayed growth in each timestep. - - if (bgtr(p) > 0._r8) then - leafc_xfer_to_leafc(p) = leafc_xfer(p) / dt - frootc_xfer_to_frootc(p) = frootc_xfer(p) / dt - leafn_xfer_to_leafn(p) = leafn_xfer(p) / dt - frootn_xfer_to_frootn(p) = frootn_xfer(p) / dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = livestemc_xfer(p) / dt - deadstemc_xfer_to_deadstemc(p) = deadstemc_xfer(p) / dt - livecrootc_xfer_to_livecrootc(p) = livecrootc_xfer(p) / dt - deadcrootc_xfer_to_deadcrootc(p) = deadcrootc_xfer(p) / dt - livestemn_xfer_to_livestemn(p) = livestemn_xfer(p) / dt - deadstemn_xfer_to_deadstemn(p) = deadstemn_xfer(p) / dt - livecrootn_xfer_to_livecrootn(p) = livecrootn_xfer(p) / dt - deadcrootn_xfer_to_deadcrootn(p) = deadcrootn_xfer(p) / dt - end if - end if ! end if bgtr - - end do ! end pft loop - -end subroutine CNOnsetGrowth -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNOffsetLitterfall -! -! !INTERFACE: -subroutine CNOffsetLitterfall (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Determines the flux of C and N from displayed pools to litter -! pools during the phenological offset period. -! -! !USES: - use pftvarcon , only: npcropmin -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/27/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: offset_flag(:) ! offset flag - real(r8), pointer :: offset_counter(:) ! offset days counter - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: cpool_to_leafc(:) ! allocation to leaf C (gC/m2/s) - real(r8), pointer :: cpool_to_frootc(:) ! allocation to fine root C (gC/m2/s) -! integer , pointer :: pcolumn(:) ! pft's column index - real(r8), pointer :: grainc(:) ! (gC/m2) grain C - real(r8), pointer :: livestemc(:) ! (gC/m2) livestem C - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc(:) ! allocation to live stem C (gC/m2/s) - real(r8), pointer :: livewdcn(:) ! live wood C:N (gC/gN) - real(r8), pointer :: graincn(:) ! grain C:N (gC/gN) - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) - real(r8), pointer :: lflitcn(:) ! leaf litter C:N (gC/gN) - real(r8), pointer :: frootcn(:) ! fine root C:N (gC/gN) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: prev_leafc_to_litter(:) ! previous timestep leaf C litterfall flux (gC/m2/s) - real(r8), pointer :: prev_frootc_to_litter(:) ! previous timestep froot C litterfall flux (gC/m2/s) - real(r8), pointer :: leafc_to_litter(:) ! leaf C litterfall (gC/m2/s) - real(r8), pointer :: frootc_to_litter(:) ! fine root C litterfall (gC/m2/s) - real(r8), pointer :: leafn_to_litter(:) ! leaf N litterfall (gN/m2/s) - real(r8), pointer :: leafn_to_retransn(:) ! leaf N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: frootn_to_litter(:) ! fine root N litterfall (gN/m2/s) - real(r8), pointer :: livestemc_to_litter(:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc_to_food(:) ! grain C to food (gC/m2/s) - real(r8), pointer :: livestemn_to_litter(:) ! livestem N to litter (gN/m2/s) - real(r8), pointer :: grainn_to_food(:) ! grain N to food (gN/m2/s) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: p, c ! indices - integer :: fp ! lake filter pft index - real(r8):: t1 ! temporary variable - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - offset_flag => pepv%offset_flag - offset_counter => pepv%offset_counter - leafc => pcs%leafc - frootc => pcs%frootc - grainc => pcs%grainc - livestemc => pcs%livestemc - cpool_to_grainc => pcf%cpool_to_grainc - cpool_to_livestemc => pcf%cpool_to_livestemc - cpool_to_leafc => pcf%cpool_to_leafc - cpool_to_frootc => pcf%cpool_to_frootc - leafcn => pftcon%leafcn - lflitcn => pftcon%lflitcn - frootcn => pftcon%frootcn - livewdcn => pftcon%livewdcn - graincn => pftcon%graincn - - ! assign local pointers to derived type arrays (out) - prev_leafc_to_litter => pepv%prev_leafc_to_litter - prev_frootc_to_litter => pepv%prev_frootc_to_litter - leafc_to_litter => pcf%leafc_to_litter - frootc_to_litter => pcf%frootc_to_litter - livestemc_to_litter => pcf%livestemc_to_litter - grainc_to_food => pcf%grainc_to_food - livestemn_to_litter => pnf%livestemn_to_litter - grainn_to_food => pnf%grainn_to_food - leafn_to_litter => pnf%leafn_to_litter - leafn_to_retransn => pnf%leafn_to_retransn - frootn_to_litter => pnf%frootn_to_litter - - ! The litterfall transfer rate starts at 0.0 and increases linearly - ! over time, with displayed growth going to 0.0 on the last day of litterfall - - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate fluxes during offset period - if (offset_flag(p) == 1._r8) then - - if (offset_counter(p) == dt) then - t1 = 1.0_r8 / dt - leafc_to_litter(p) = t1 * leafc(p) + cpool_to_leafc(p) - frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) - ! this assumes that offset_counter == dt for crops - ! if this were ever changed, we'd need to add code to the "else" - if (ivt(p) >= npcropmin) then - grainc_to_food(p) = t1 * grainc(p) + cpool_to_grainc(p) - livestemc_to_litter(p) = t1 * livestemc(p) + cpool_to_livestemc(p) - end if - else - t1 = dt * 2.0_r8 / (offset_counter(p) * offset_counter(p)) - leafc_to_litter(p) = prev_leafc_to_litter(p) + t1*(leafc(p) - prev_leafc_to_litter(p)*offset_counter(p)) - frootc_to_litter(p) = prev_frootc_to_litter(p) + t1*(frootc(p) - prev_frootc_to_litter(p)*offset_counter(p)) - end if - - ! calculate the leaf N litterfall and retranslocation - leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) - leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) - - ! calculate fine root N litterfall (no retranslocation of fine root N) - frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - - if (ivt(p) >= npcropmin) then - livestemn_to_litter(p) = livestemc_to_litter(p) / livewdcn(ivt(p)) - grainn_to_food(p) = grainc_to_food(p) / graincn(ivt(p)) - end if - - ! save the current litterfall fluxes - prev_leafc_to_litter(p) = leafc_to_litter(p) - prev_frootc_to_litter(p) = frootc_to_litter(p) - - end if ! end if offset period - - end do ! end pft loop - -end subroutine CNOffsetLitterfall -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNBackgroundLitterfall -! -! !INTERFACE: -subroutine CNBackgroundLitterfall (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Determines the flux of C and N from displayed pools to litter -! pools as the result of background litter fall. -! -! !USES: -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 10/2/03: Created by Peter Thornton -! 10/24/03, Peter Thornton: migrated to vector data structures -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - ! pft level - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - ! ecophysiological constants - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) - real(r8), pointer :: lflitcn(:) ! leaf litter C:N (gC/gN) - real(r8), pointer :: frootcn(:) ! fine root C:N (gC/gN) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: leafn_to_litter(:) - real(r8), pointer :: leafn_to_retransn(:) - real(r8), pointer :: frootn_to_litter(:) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter pft index - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - bglfr => pepv%bglfr - leafc => pcs%leafc - frootc => pcs%frootc - leafcn => pftcon%leafcn - lflitcn => pftcon%lflitcn - frootcn => pftcon%frootcn - - ! assign local pointers to derived type arrays (out) - leafc_to_litter => pcf%leafc_to_litter - frootc_to_litter => pcf%frootc_to_litter - leafn_to_litter => pnf%leafn_to_litter - leafn_to_retransn => pnf%leafn_to_retransn - frootn_to_litter => pnf%frootn_to_litter - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes if the background litterfall rate is non-zero - if (bglfr(p) > 0._r8) then - ! units for bglfr are already 1/s - leafc_to_litter(p) = bglfr(p) * leafc(p) - frootc_to_litter(p) = bglfr(p) * frootc(p) - - ! calculate the leaf N litterfall and retranslocation - leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) - leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) - - ! calculate fine root N litterfall (no retranslocation of fine root N) - frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - - end if - - end do - -end subroutine CNBackgroundLitterfall -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNLivewoodTurnover -! -! !INTERFACE: -subroutine CNLivewoodTurnover (num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Determines the flux of C and N from live wood to -! dead wood pools, for stem and coarse root. -! -! !USES: -! -! !ARGUMENTS: - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 12/5/03: created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - ! pft level - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - ! ecophysiological constants - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: livewdcn(:) ! live wood (phloem and ray parenchyma) C:N (gC/gN) - real(r8), pointer :: deadwdcn(:) ! dead wood (xylem and heartwood) C:N (gC/gN) -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: livestemc_to_deadstemc(:) - real(r8), pointer :: livecrootc_to_deadcrootc(:) - real(r8), pointer :: livestemn_to_deadstemn(:) - real(r8), pointer :: livestemn_to_retransn(:) - real(r8), pointer :: livecrootn_to_deadcrootn(:) - real(r8), pointer :: livecrootn_to_retransn(:) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: p ! indices - integer :: fp ! lake filter pft index - real(r8):: ctovr ! temporary variable for carbon turnover - real(r8):: ntovr ! temporary variable for nitrogen turnover - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - livestemc => pcs%livestemc - livecrootc => pcs%livecrootc - livestemn => pns%livestemn - livecrootn => pns%livecrootn - woody => pftcon%woody - livewdcn => pftcon%livewdcn - deadwdcn => pftcon%deadwdcn - - ! assign local pointers to derived type arrays (out) - livestemc_to_deadstemc => pcf%livestemc_to_deadstemc - livecrootc_to_deadcrootc => pcf%livecrootc_to_deadcrootc - livestemn_to_deadstemn => pnf%livestemn_to_deadstemn - livestemn_to_retransn => pnf%livestemn_to_retransn - livecrootn_to_deadcrootn => pnf%livecrootn_to_deadcrootn - livecrootn_to_retransn => pnf%livecrootn_to_retransn - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! only calculate these fluxes for woody types - if (woody(ivt(p)) > 0._r8) then - - ! live stem to dead stem turnover - - ctovr = livestemc(p) * lwtop - ntovr = ctovr / livewdcn(ivt(p)) - livestemc_to_deadstemc(p) = ctovr - livestemn_to_deadstemn(p) = ctovr / deadwdcn(ivt(p)) - livestemn_to_retransn(p) = ntovr - livestemn_to_deadstemn(p) - - ! live coarse root to dead coarse root turnover - - ctovr = livecrootc(p) * lwtop - ntovr = ctovr / livewdcn(ivt(p)) - livecrootc_to_deadcrootc(p) = ctovr - livecrootn_to_deadcrootn(p) = ctovr / deadwdcn(ivt(p)) - livecrootn_to_retransn(p) = ntovr - livecrootn_to_deadcrootn(p) - - end if - - end do - -end subroutine CNLivewoodTurnover -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNLitterToColumn -! -! !INTERFACE: -subroutine CNLitterToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! called at the end of cn_phenology to gather all pft-level litterfall fluxes -! to the column level and assign them to the three litter pools -! -! !USES: - use clm_varpar, only : max_pft_per_col - use pftvarcon , only : npcropmin -! -! !ARGUMENTS: - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNPhenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! weight (relative to column) for this pft (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: leafc_to_litter(:) ! leaf C litterfall (gC/m2/s) - real(r8), pointer :: frootc_to_litter(:) ! fine root N litterfall (gN/m2/s) - real(r8), pointer :: livestemc_to_litter(:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc_to_food(:) ! grain C to food (gC/m2/s) - real(r8), pointer :: livestemn_to_litter(:) ! livestem N to litter (gN/m2/s) - real(r8), pointer :: grainn_to_food(:) ! grain N to food (gN/m2/s) - real(r8), pointer :: leafn_to_litter(:) ! leaf N litterfall (gN/m2/s) - real(r8), pointer :: frootn_to_litter(:) ! fine root N litterfall (gN/m2/s) - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column -! -! local pointers to implicit in/out scalars -! - real(r8), pointer :: leafc_to_litr1c(:) ! leaf C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr2c(:) ! leaf C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr3c(:) ! leaf C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr1c(:) ! fine root C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr2c(:) ! fine root C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr3c(:) ! fine root C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr1c(:) ! livestem C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr2c(:) ! livestem C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr3c(:) ! livestem C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: livestemn_to_litr1n(:) ! livestem N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr2n(:) ! livestem N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr3n(:) ! livestem N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: grainc_to_litr1c(:) ! grain C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr2c(:) ! grain C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr3c(:) ! grain C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: grainn_to_litr1n(:) ! grain N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr2n(:) ! grain N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr3n(:) ! grain N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr1n(:) ! leaf N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr2n(:) ! leaf N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr3n(:) ! leaf N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr1n(:) ! fine root N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr2n(:) ! fine root N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr3n(:) ! fine root N litterfall to litter 3 N (gN/m2/s) -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p ! indices -!EOP -!----------------------------------------------------------------------- - ! assign local pointers to derived type arrays (in) - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - leafc_to_litter => pcf%leafc_to_litter - frootc_to_litter => pcf%frootc_to_litter - livestemc_to_litter => pcf%livestemc_to_litter - grainc_to_food => pcf%grainc_to_food - livestemn_to_litter => pnf%livestemn_to_litter - grainn_to_food => pnf%grainn_to_food - leafn_to_litter => pnf%leafn_to_litter - frootn_to_litter => pnf%frootn_to_litter - npfts => col%npfts - pfti => col%pfti - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to derived type arrays (out) - leafc_to_litr1c => ccf%leafc_to_litr1c - leafc_to_litr2c => ccf%leafc_to_litr2c - leafc_to_litr3c => ccf%leafc_to_litr3c - frootc_to_litr1c => ccf%frootc_to_litr1c - frootc_to_litr2c => ccf%frootc_to_litr2c - frootc_to_litr3c => ccf%frootc_to_litr3c - grainc_to_litr1c => ccf%grainc_to_litr1c - grainc_to_litr2c => ccf%grainc_to_litr2c - grainc_to_litr3c => ccf%grainc_to_litr3c - livestemc_to_litr1c => ccf%livestemc_to_litr1c - livestemc_to_litr2c => ccf%livestemc_to_litr2c - livestemc_to_litr3c => ccf%livestemc_to_litr3c - livestemn_to_litr1n => cnf%livestemn_to_litr1n - livestemn_to_litr2n => cnf%livestemn_to_litr2n - livestemn_to_litr3n => cnf%livestemn_to_litr3n - grainn_to_litr1n => cnf%grainn_to_litr1n - grainn_to_litr2n => cnf%grainn_to_litr2n - grainn_to_litr3n => cnf%grainn_to_litr3n - leafn_to_litr1n => cnf%leafn_to_litr1n - leafn_to_litr2n => cnf%leafn_to_litr2n - leafn_to_litr3n => cnf%leafn_to_litr3n - frootn_to_litr1n => cnf%frootn_to_litr1n - frootn_to_litr2n => cnf%frootn_to_litr2n - frootn_to_litr3n => cnf%frootn_to_litr3n - - do pi = 1,max_pft_per_col - do fc = 1,num_soilc - c = filter_soilc(fc) - - if ( pi <= npfts(c) ) then - p = pfti(c) + pi - 1 - if (pwtgcell(p)>0._r8) then - - ! leaf litter carbon fluxes - leafc_to_litr1c(c) = leafc_to_litr1c(c) + leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - leafc_to_litr2c(c) = leafc_to_litr2c(c) + leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - leafc_to_litr3c(c) = leafc_to_litr3c(c) + leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! leaf litter nitrogen fluxes - leafn_to_litr1n(c) = leafn_to_litr1n(c) + leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - leafn_to_litr2n(c) = leafn_to_litr2n(c) + leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - leafn_to_litr3n(c) = leafn_to_litr3n(c) + leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root litter carbon fluxes - frootc_to_litr1c(c) = frootc_to_litr1c(c) + frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - frootc_to_litr2c(c) = frootc_to_litr2c(c) + frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - frootc_to_litr3c(c) = frootc_to_litr3c(c) + frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! fine root litter nitrogen fluxes - frootn_to_litr1n(c) = frootn_to_litr1n(c) + frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - frootn_to_litr2n(c) = frootn_to_litr2n(c) + frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - frootn_to_litr3n(c) = frootn_to_litr3n(c) + frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - - ! agroibis puts crop stem litter together with leaf litter - ! so I've used the leaf lf_f* parameters instead of making - ! new ones for now (slevis) - ! also for simplicity I've put "food" into the litter pools - if (ivt(p) >= npcropmin) then ! add livestemc to litter - ! stem litter carbon fluxes - livestemc_to_litr1c(c) = livestemc_to_litr1c(c) + livestemc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - livestemc_to_litr2c(c) = livestemc_to_litr2c(c) + livestemc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - livestemc_to_litr3c(c) = livestemc_to_litr3c(c) + livestemc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! stem litter nitrogen fluxes - livestemn_to_litr1n(c) = livestemn_to_litr1n(c) + livestemn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - livestemn_to_litr2n(c) = livestemn_to_litr2n(c) + livestemn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - livestemn_to_litr3n(c) = livestemn_to_litr3n(c) + livestemn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! grain litter carbon fluxes - grainc_to_litr1c(c) = grainc_to_litr1c(c) + grainc_to_food(p) * lf_flab(ivt(p)) * wtcol(p) - grainc_to_litr2c(c) = grainc_to_litr2c(c) + grainc_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) - grainc_to_litr3c(c) = grainc_to_litr3c(c) + grainc_to_food(p) * lf_flig(ivt(p)) * wtcol(p) - - ! grain litter nitrogen fluxes - grainn_to_litr1n(c) = grainn_to_litr1n(c) + grainn_to_food(p) * lf_flab(ivt(p)) * wtcol(p) - grainn_to_litr2n(c) = grainn_to_litr2n(c) + grainn_to_food(p) * lf_fcel(ivt(p)) * wtcol(p) - grainn_to_litr3n(c) = grainn_to_litr3n(c) + grainn_to_food(p) * lf_flig(ivt(p)) * wtcol(p) - end if - end if - end if - - end do - - end do - -end subroutine CNLitterToColumn -!----------------------------------------------------------------------- - -end module CNPhenologyMod diff --git a/src_clm40/biogeochem/CNPrecisionControlMod.F90 b/src_clm40/biogeochem/CNPrecisionControlMod.F90 deleted file mode 100644 index 9acac12aca..0000000000 --- a/src_clm40/biogeochem/CNPrecisionControlMod.F90 +++ /dev/null @@ -1,737 +0,0 @@ -module CNPrecisionControlMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNPrecisionControlMod -! -! !DESCRIPTION: -! controls on very low values in critical state variables -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CNPrecisionControl -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNPrecisionControl -! -! !INTERFACE: -subroutine CNPrecisionControl(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, force leaf and deadstem c and n to 0 if -! they get too small. -! -! !USES: - use clmtype - use abortutils, only: endrun - use clm_varctl, only: iulog, use_c13 - use pftvarcon, only: nc3crop - use surfrdMod, only: crop_prog -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 8/1/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - - real(r8), pointer :: c13_col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - real(r8), pointer :: c13_cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: c13_litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: c13_litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: c13_litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: c13_soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: c13_soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: c13_soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: c13_soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - - real(r8), pointer :: col_ntrunc(:) ! (gN/m2) column-level sink for N truncation - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: soil1n(:) ! (gN/m2) soil organic matter N (fast pool) - real(r8), pointer :: soil2n(:) ! (gN/m2) soil organic matter N (medium pool) - real(r8), pointer :: soil3n(:) ! (gN/m2) soil orgainc matter N (slow pool) - real(r8), pointer :: soil4n(:) ! (gN/m2) soil orgainc matter N (slowest pool) - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: pft_ctrunc(:) ! (gC/m2) pft-level sink for C truncation - real(r8), pointer :: xsmrpool(:) ! (gC/m2) execss maint resp C pool - real(r8), pointer :: grainc(:) ! (gC/m2) grain C - real(r8), pointer :: grainc_storage(:) ! (gC/m2) grain C storage - real(r8), pointer :: grainc_xfer(:) ! (gC/m2) grain C transfer - - real(r8), pointer :: c13_cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: c13_deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: c13_deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: c13_deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: c13_deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: c13_deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: c13_deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: c13_frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: c13_frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: c13_frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: c13_gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: c13_gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: c13_leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: c13_leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: c13_leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: c13_livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: c13_livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: c13_livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: c13_livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: c13_livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: c13_livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: c13_pft_ctrunc(:) ! (gC/m2) pft-level sink for C truncation - - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: grainn(:) ! (gC/m2) grain N - real(r8), pointer :: grainn_storage(:) ! (gC/m2) grain N storage - real(r8), pointer :: grainn_xfer(:) ! (gC/m2) grain N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: npool(:) ! (gN/m2) temporary plant N pool - real(r8), pointer :: pft_ntrunc(:) ! (gN/m2) pft-level sink for N truncation - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - integer , pointer :: ivt(:) ! pft vegetation type -! -! local pointers to implicit in/out scalars -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - real(r8):: pc,pn ! truncation terms for pft-level corrections - real(r8):: cc,cn ! truncation terms for column-level corrections - - real(r8):: pc13 ! truncation terms for pft-level corrections - real(r8):: cc13 ! truncation terms for column-level corrections - - real(r8):: ccrit ! critical carbon state value for truncation - real(r8):: ncrit ! critical nitrogen state value for truncation - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers at the column level - col_ctrunc => ccs%col_ctrunc - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - soil1c => ccs%soil1c - soil2c => ccs%soil2c - soil3c => ccs%soil3c - soil4c => ccs%soil4c - - c13_col_ctrunc => cc13s%col_ctrunc - c13_cwdc => cc13s%cwdc - c13_litr1c => cc13s%litr1c - c13_litr2c => cc13s%litr2c - c13_litr3c => cc13s%litr3c - c13_soil1c => cc13s%soil1c - c13_soil2c => cc13s%soil2c - c13_soil3c => cc13s%soil3c - c13_soil4c => cc13s%soil4c - - col_ntrunc => cns%col_ntrunc - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - soil1n => cns%soil1n - soil2n => cns%soil2n - soil3n => cns%soil3n - soil4n => cns%soil4n - - ! assign local pointers at the pft level - ivt => pft%itype - cpool => pcs%cpool - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - pft_ctrunc => pcs%pft_ctrunc - xsmrpool => pcs%xsmrpool - grainc => pcs%grainc - grainc_storage => pcs%grainc_storage - grainc_xfer => pcs%grainc_xfer - - c13_cpool => pc13s%cpool - c13_deadcrootc => pc13s%deadcrootc - c13_deadcrootc_storage => pc13s%deadcrootc_storage - c13_deadcrootc_xfer => pc13s%deadcrootc_xfer - c13_deadstemc => pc13s%deadstemc - c13_deadstemc_storage => pc13s%deadstemc_storage - c13_deadstemc_xfer => pc13s%deadstemc_xfer - c13_frootc => pc13s%frootc - c13_frootc_storage => pc13s%frootc_storage - c13_frootc_xfer => pc13s%frootc_xfer - c13_gresp_storage => pc13s%gresp_storage - c13_gresp_xfer => pc13s%gresp_xfer - c13_leafc => pc13s%leafc - c13_leafc_storage => pc13s%leafc_storage - c13_leafc_xfer => pc13s%leafc_xfer - c13_livecrootc => pc13s%livecrootc - c13_livecrootc_storage => pc13s%livecrootc_storage - c13_livecrootc_xfer => pc13s%livecrootc_xfer - c13_livestemc => pc13s%livestemc - c13_livestemc_storage => pc13s%livestemc_storage - c13_livestemc_xfer => pc13s%livestemc_xfer - c13_pft_ctrunc => pc13s%pft_ctrunc - - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - grainn => pns%grainn - grainn_storage => pns%grainn_storage - grainn_xfer => pns%grainn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - npool => pns%npool - pft_ntrunc => pns%pft_ntrunc - retransn => pns%retransn - - ! set the critical carbon state value for truncation (gC/m2) - ccrit = 1.e-8_r8 - ! set the critical nitrogen state value for truncation (gN/m2) - ncrit = 1.e-8_r8 - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! initialize the pft-level C and N truncation terms - pc = 0._r8 - if (use_c13) then - pc13 = 0._r8 - end if - pn = 0._r8 - - ! do tests on state variables for precision control - ! for linked C-N state variables, perform precision test on - ! the C component, but truncate C, C13, and N components - - ! leaf C and N - if (abs(leafc(p)) < ccrit) then - pc = pc + leafc(p) - leafc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_leafc(p) - c13_leafc(p) = 0._r8 - endif - pn = pn + leafn(p) - leafn(p) = 0._r8 - end if - - ! leaf storage C and N - if (abs(leafc_storage(p)) < ccrit) then - pc = pc + leafc_storage(p) - leafc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_leafc_storage(p) - c13_leafc_storage(p) = 0._r8 - endif - pn = pn + leafn_storage(p) - leafn_storage(p) = 0._r8 - end if - - ! leaf transfer C and N - if (abs(leafc_xfer(p)) < ccrit) then - pc = pc + leafc_xfer(p) - leafc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_leafc_xfer(p) - c13_leafc_xfer(p) = 0._r8 - endif - pn = pn + leafn_xfer(p) - leafn_xfer(p) = 0._r8 - end if - - ! froot C and N - if (abs(frootc(p)) < ccrit) then - pc = pc + frootc(p) - frootc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_frootc(p) - c13_frootc(p) = 0._r8 - endif - pn = pn + frootn(p) - frootn(p) = 0._r8 - end if - - ! froot storage C and N - if (abs(frootc_storage(p)) < ccrit) then - pc = pc + frootc_storage(p) - frootc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_frootc_storage(p) - c13_frootc_storage(p) = 0._r8 - endif - pn = pn + frootn_storage(p) - frootn_storage(p) = 0._r8 - end if - - ! froot transfer C and N - if (abs(frootc_xfer(p)) < ccrit) then - pc = pc + frootc_xfer(p) - frootc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_frootc_xfer(p) - c13_frootc_xfer(p) = 0._r8 - endif - pn = pn + frootn_xfer(p) - frootn_xfer(p) = 0._r8 - end if - - if ( crop_prog .and. ivt(p) >= nc3crop )then - ! grain C and N - if (abs(grainc(p)) < ccrit) then - pc = pc + grainc(p) - grainc(p) = 0._r8 - pn = pn + grainn(p) - grainn(p) = 0._r8 - end if - - ! grain storage C and N - if (abs(grainc_storage(p)) < ccrit) then - pc = pc + grainc_storage(p) - grainc_storage(p) = 0._r8 - pn = pn + grainn_storage(p) - grainn_storage(p) = 0._r8 - end if - - ! grain transfer C and N - if (abs(grainc_xfer(p)) < ccrit) then - pc = pc + grainc_xfer(p) - grainc_xfer(p) = 0._r8 - pn = pn + grainn_xfer(p) - grainn_xfer(p) = 0._r8 - end if - end if - - ! livestem C and N - if (abs(livestemc(p)) < ccrit) then - pc = pc + livestemc(p) - livestemc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livestemc(p) - c13_livestemc(p) = 0._r8 - endif - pn = pn + livestemn(p) - livestemn(p) = 0._r8 - end if - - ! livestem storage C and N - if (abs(livestemc_storage(p)) < ccrit) then - pc = pc + livestemc_storage(p) - livestemc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livestemc_storage(p) - c13_livestemc_storage(p) = 0._r8 - endif - pn = pn + livestemn_storage(p) - livestemn_storage(p) = 0._r8 - end if - - ! livestem transfer C and N - if (abs(livestemc_xfer(p)) < ccrit) then - pc = pc + livestemc_xfer(p) - livestemc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livestemc_xfer(p) - c13_livestemc_xfer(p) = 0._r8 - endif - pn = pn + livestemn_xfer(p) - livestemn_xfer(p) = 0._r8 - end if - - ! deadstem C and N - if (abs(deadstemc(p)) < ccrit) then - pc = pc + deadstemc(p) - deadstemc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadstemc(p) - c13_deadstemc(p) = 0._r8 - endif - pn = pn + deadstemn(p) - deadstemn(p) = 0._r8 - end if - - ! deadstem storage C and N - if (abs(deadstemc_storage(p)) < ccrit) then - pc = pc + deadstemc_storage(p) - deadstemc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadstemc_storage(p) - c13_deadstemc_storage(p) = 0._r8 - endif - pn = pn + deadstemn_storage(p) - deadstemn_storage(p) = 0._r8 - end if - - ! deadstem transfer C and N - if (abs(deadstemc_xfer(p)) < ccrit) then - pc = pc + deadstemc_xfer(p) - deadstemc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadstemc_xfer(p) - c13_deadstemc_xfer(p) = 0._r8 - endif - pn = pn + deadstemn_xfer(p) - deadstemn_xfer(p) = 0._r8 - end if - - ! livecroot C and N - if (abs(livecrootc(p)) < ccrit) then - pc = pc + livecrootc(p) - livecrootc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livecrootc(p) - c13_livecrootc(p) = 0._r8 - endif - pn = pn + livecrootn(p) - livecrootn(p) = 0._r8 - end if - - ! livecroot storage C and N - if (abs(livecrootc_storage(p)) < ccrit) then - pc = pc + livecrootc_storage(p) - livecrootc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livecrootc_storage(p) - c13_livecrootc_storage(p) = 0._r8 - endif - pn = pn + livecrootn_storage(p) - livecrootn_storage(p) = 0._r8 - end if - - ! livecroot transfer C and N - if (abs(livecrootc_xfer(p)) < ccrit) then - pc = pc + livecrootc_xfer(p) - livecrootc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_livecrootc_xfer(p) - c13_livecrootc_xfer(p) = 0._r8 - endif - pn = pn + livecrootn_xfer(p) - livecrootn_xfer(p) = 0._r8 - end if - - ! deadcroot C and N - if (abs(deadcrootc(p)) < ccrit) then - pc = pc + deadcrootc(p) - deadcrootc(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadcrootc(p) - c13_deadcrootc(p) = 0._r8 - endif - pn = pn + deadcrootn(p) - deadcrootn(p) = 0._r8 - end if - - ! deadcroot storage C and N - if (abs(deadcrootc_storage(p)) < ccrit) then - pc = pc + deadcrootc_storage(p) - deadcrootc_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadcrootc_storage(p) - c13_deadcrootc_storage(p) = 0._r8 - endif - pn = pn + deadcrootn_storage(p) - deadcrootn_storage(p) = 0._r8 - end if - - ! deadcroot transfer C and N - if (abs(deadcrootc_xfer(p)) < ccrit) then - pc = pc + deadcrootc_xfer(p) - deadcrootc_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_deadcrootc_xfer(p) - c13_deadcrootc_xfer(p) = 0._r8 - endif - pn = pn + deadcrootn_xfer(p) - deadcrootn_xfer(p) = 0._r8 - end if - - ! gresp_storage (C only) - if (abs(gresp_storage(p)) < ccrit) then - pc = pc + gresp_storage(p) - gresp_storage(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_gresp_storage(p) - c13_gresp_storage(p) = 0._r8 - endif - end if - - ! gresp_xfer (C only) - if (abs(gresp_xfer(p)) < ccrit) then - pc = pc + gresp_xfer(p) - gresp_xfer(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_gresp_xfer(p) - c13_gresp_xfer(p) = 0._r8 - endif - end if - - ! cpool (C only) - if (abs(cpool(p)) < ccrit) then - pc = pc + cpool(p) - cpool(p) = 0._r8 - if (use_c13) then - pc13 = pc13 + c13_cpool(p) - c13_cpool(p) = 0._r8 - endif - end if - - if ( crop_prog .and. ivt(p) >= nc3crop )then - ! xsmrpool (C only) - if (abs(xsmrpool(p)) < ccrit) then - pc = pc + xsmrpool(p) - xsmrpool(p) = 0._r8 - end if - end if - - ! retransn (N only) - if (abs(retransn(p)) < ncrit) then - pn = pn + retransn(p) - retransn(p) = 0._r8 - end if - - ! npool (N only) - if (abs(npool(p)) < ncrit) then - pn = pn + npool(p) - npool(p) = 0._r8 - end if - - pft_ctrunc(p) = pft_ctrunc(p) + pc - if (use_c13) then - c13_pft_ctrunc(p) = c13_pft_ctrunc(p) + pc13 - endif - pft_ntrunc(p) = pft_ntrunc(p) + pn - - end do ! end of pft loop - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! initialize the column-level C and N truncation terms - cc = 0._r8 - if (use_c13) then - cc13 = 0._r8 - endif - cn = 0._r8 - - ! do tests on state variables for precision control - ! for linked C-N state variables, perform precision test on - ! the C component, but truncate both C and N components - - ! coarse woody debris C and N - if (abs(cwdc(c)) < ccrit) then - cc = cc + cwdc(c) - cwdc(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_cwdc(c) - c13_cwdc(c) = 0._r8 - endif - cn = cn + cwdn(c) - cwdn(c) = 0._r8 - end if - - ! litr1 C and N - if (abs(litr1c(c)) < ccrit) then - cc = cc + litr1c(c) - litr1c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_litr1c(c) - c13_litr1c(c) = 0._r8 - endif - cn = cn + litr1n(c) - litr1n(c) = 0._r8 - end if - - ! litr2 C and N - if (abs(litr2c(c)) < ccrit) then - cc = cc + litr2c(c) - litr2c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_litr2c(c) - c13_litr2c(c) = 0._r8 - endif - cn = cn + litr2n(c) - litr2n(c) = 0._r8 - end if - - ! litr3 C and N - if (abs(litr3c(c)) < ccrit) then - cc = cc + litr3c(c) - litr3c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_litr3c(c) - c13_litr3c(c) = 0._r8 - endif - cn = cn + litr3n(c) - litr3n(c) = 0._r8 - end if - - ! soil1 C and N - if (abs(soil1c(c)) < ccrit) then - cc = cc + soil1c(c) - soil1c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_soil1c(c) - c13_soil1c(c) = 0._r8 - endif - cn = cn + soil1n(c) - soil1n(c) = 0._r8 - end if - - ! soil2 C and N - if (abs(soil2c(c)) < ccrit) then - cc = cc + soil2c(c) - soil2c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_soil2c(c) - c13_soil2c(c) = 0._r8 - endif - cn = cn + soil2n(c) - soil2n(c) = 0._r8 - end if - - ! soil3 C and N - if (abs(soil3c(c)) < ccrit) then - cc = cc + soil3c(c) - soil3c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_soil3c(c) - c13_soil3c(c) = 0._r8 - endif - cn = cn + soil3n(c) - soil3n(c) = 0._r8 - end if - - ! soil4 C and N - if (abs(soil4c(c)) < ccrit) then - cc = cc + soil4c(c) - soil4c(c) = 0._r8 - if (use_c13) then - cc13 = cc13 + c13_soil4c(c) - c13_soil4c(c) = 0._r8 - endif - cn = cn + soil4n(c) - soil4n(c) = 0._r8 - end if - - ! not doing precision control on soil mineral N, since it will - ! be getting the N truncation flux anyway. - - col_ctrunc(c) = col_ctrunc(c) + cc - if (use_c13) then - c13_col_ctrunc(c) = c13_col_ctrunc(c) + cc13 - endif - col_ntrunc(c) = col_ntrunc(c) + cn - - end do ! end of column loop - -end subroutine CNPrecisionControl -!----------------------------------------------------------------------- - -end module CNPrecisionControlMod diff --git a/src_clm40/biogeochem/CNSetValueMod.F90 b/src_clm40/biogeochem/CNSetValueMod.F90 deleted file mode 100644 index bcb8700e18..0000000000 --- a/src_clm40/biogeochem/CNSetValueMod.F90 +++ /dev/null @@ -1,1280 +0,0 @@ -module CNSetValueMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNSetValueMod -! -! !DESCRIPTION: -! contains code to set all CN variables to specified value -! Used for both initialization of special landunit values, and -! setting fluxes to 0.0 at the beginning of each time step -! 3/23/09, Peter Thornton: Added new subroutine, CNZeroFluxes_dwt(), -! which initialize flux variables used in the pftdyn -! routines. This is called from clm_driver1, as -! these variables need to be initialized outside of the clumps loop. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varpar , only: nlevgrnd - use clm_varctl , only: iulog, use_c13, use_cn, use_cndv - use clmtype - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNZeroFluxes - public :: CNZeroFluxes_dwt - public :: CNSetPps - public :: CNSetPepv - public :: CNSetPcs - public :: CNSetPns - public :: CNSetPcf - public :: CNSetPnf - public :: CNSetCps - public :: CNSetCcs - public :: CNSetCns - public :: CNSetCcf - public :: CNSetCnf -! !PRIVATE MEMBER FUNCTIONS: -! -! !REVISION HISTORY: -! 9/04/03: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNZeroFluxes -! -! !INTERFACE: -subroutine CNZeroFluxes(num_filterc, filterc, num_filterp, filterp) -! -! !DESCRIPTION: -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_filterc ! number of good values in filterc - integer, intent(in) :: filterc(:) ! column filter - integer, intent(in) :: num_filterp ! number of good values in filterp - integer, intent(in) :: filterp(:) ! pft filter -! -! !CALLED FROM: -! subroutine CNEcosystemDyn in module CNEcosystemDynMod.F90 -! -! !REVISION HISTORY: -! 9/04/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! -! -! local pointers to implicit in/out scalars -! -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - - ! zero the column-level C and N fluxes - call CNSetCcf(num_filterc, filterc, 0._r8, ccf) - if (use_c13) then - call CNSetCcf(num_filterc, filterc, 0._r8, cc13f) - end if - call CNSetCnf(num_filterc, filterc, 0._r8, cnf) - - ! zero the column-average pft-level C and N fluxes - call CNSetPcf(num_filterc, filterc, 0._r8, pcf_a) - call CNSetPnf(num_filterc, filterc, 0._r8, pnf_a) - - ! zero the pft-level C and N fluxes - call CNSetPcf(num_filterp, filterp, 0._r8, pcf) - if (use_c13) then - call CNSetPcf(num_filterp, filterp, 0._r8, pc13f) - end if - call CNSetPnf(num_filterp, filterp, 0._r8, pnf) - -end subroutine CNZeroFluxes -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNZeroFluxes_dwt -! -! !INTERFACE: -subroutine CNZeroFluxes_dwt( begc, endc, begp, endp ) -! -! !DESCRIPTION: -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begc, endc ! proc beginning and ending column indices - integer, intent(IN) :: begp, endp ! proc beginning and ending pft indices -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 3/23/09: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! -! -! local pointers to implicit in/out scalars -! -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c, p ! indices - type(column_type), pointer :: cptr ! pointer to column derived subtype -!EOP -!----------------------------------------------------------------------- - - cptr => col - ! set column-level conversion and product pool fluxes - ! to 0 at the beginning of every timestep - - do c = begc,endc - ! C fluxes - ccf%dwt_seedc_to_leaf(c) = 0._r8 - ccf%dwt_seedc_to_deadstem(c) = 0._r8 - ccf%dwt_conv_cflux(c) = 0._r8 - ccf%dwt_prod10c_gain(c) = 0._r8 - ccf%dwt_prod100c_gain(c) = 0._r8 - ccf%dwt_frootc_to_litr1c(c) = 0._r8 - ccf%dwt_frootc_to_litr2c(c) = 0._r8 - ccf%dwt_frootc_to_litr3c(c) = 0._r8 - ccf%dwt_livecrootc_to_cwdc(c) = 0._r8 - ccf%dwt_deadcrootc_to_cwdc(c) = 0._r8 - if (use_c13) then - ! C13 fluxes - cc13f%dwt_seedc_to_leaf(c) = 0._r8 - cc13f%dwt_seedc_to_deadstem(c) = 0._r8 - cc13f%dwt_conv_cflux(c) = 0._r8 - cc13f%dwt_prod10c_gain(c) = 0._r8 - cc13f%dwt_prod100c_gain(c) = 0._r8 - cc13f%dwt_frootc_to_litr1c(c) = 0._r8 - cc13f%dwt_frootc_to_litr2c(c) = 0._r8 - cc13f%dwt_frootc_to_litr3c(c) = 0._r8 - cc13f%dwt_livecrootc_to_cwdc(c) = 0._r8 - cc13f%dwt_deadcrootc_to_cwdc(c) = 0._r8 - end if - ! N fluxes - cnf%dwt_seedn_to_leaf(c) = 0._r8 - cnf%dwt_seedn_to_deadstem(c) = 0._r8 - cnf%dwt_conv_nflux(c) = 0._r8 - cnf%dwt_prod10n_gain(c) = 0._r8 - cnf%dwt_prod100n_gain(c) = 0._r8 - cnf%dwt_frootn_to_litr1n(c) = 0._r8 - cnf%dwt_frootn_to_litr2n(c) = 0._r8 - cnf%dwt_frootn_to_litr3n(c) = 0._r8 - cnf%dwt_livecrootn_to_cwdn(c) = 0._r8 - cnf%dwt_deadcrootn_to_cwdn(c) = 0._r8 - end do - if (use_cn) then - do p = begp,endp - pcs%dispvegc(p) = 0._r8 - pcs%storvegc(p) = 0._r8 - pcs%totpftc(p) = 0._r8 - if (use_c13) then - pc13s%dispvegc(p) = 0._r8 - pc13s%storvegc(p) = 0._r8 - pc13s%totpftc(p) = 0._r8 - end if - pns%dispvegn(p) = 0._r8 - pns%storvegn(p) = 0._r8 - pns%totvegn(p) = 0._r8 - pns%totpftn(p) = 0._r8 - end do - end if - -end subroutine CNZeroFluxes_dwt -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPps -! -! !INTERFACE: -subroutine CNSetPps(num, filter, val, pps) -! -! !DESCRIPTION: -! Set pft physical state variables -! !USES: - use clm_varpar , only : numrad -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_pstate_type), intent(inout) :: pps -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i,j ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - pps%slasun(i) = val - pps%slasha(i) = val - pps%lncsun(i) = val - pps%lncsha(i) = val - pps%vcmxsun(i) = val - pps%vcmxsha(i) = val - pps%gdir(i) = val - end do - - do j = 1,numrad - do fi = 1,num - i = filter(fi) - pps%omega(i,j) = val - pps%eff_kid(i,j) = val - pps%eff_kii(i,j) = val - pps%sun_faid(i,j) = val - pps%sun_faii(i,j) = val - pps%sha_faid(i,j) = val - pps%sha_faii(i,j) = val - end do - end do - -end subroutine CNSetPps -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPepv -! -! !INTERFACE: -subroutine CNSetPepv (num, filter, val, pepv) -! -! !DESCRIPTION: -! Set pft ecophysiological variables -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_epv_type), intent(inout) :: pepv -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - pepv%dormant_flag(i) = val - pepv%days_active(i) = val - pepv%onset_flag(i) = val - pepv%onset_counter(i) = val - pepv%onset_gddflag(i) = val - pepv%onset_fdd(i) = val - pepv%onset_gdd(i) = val - pepv%onset_swi(i) = val - pepv%offset_flag(i) = val - pepv%offset_counter(i) = val - pepv%offset_fdd(i) = val - pepv%offset_swi(i) = val - pepv%lgsf(i) = val - pepv%bglfr(i) = val - pepv%bgtr(i) = val - pepv%dayl(i) = val - pepv%prev_dayl(i) = val - pepv%annavg_t2m(i) = val - pepv%tempavg_t2m(i) = val - pepv%gpp(i) = val - pepv%availc(i) = val - pepv%xsmrpool_recover(i) = val - if (use_c13) then - pepv%xsmrpool_c13ratio(i) = val - end if - pepv%alloc_pnow(i) = val - pepv%c_allometry(i) = val - pepv%n_allometry(i) = val - pepv%plant_ndemand(i) = val - pepv%tempsum_potential_gpp(i) = val - pepv%annsum_potential_gpp(i) = val - pepv%tempmax_retransn(i) = val - pepv%annmax_retransn(i) = val - pepv%avail_retransn(i) = val - pepv%plant_nalloc(i) = val - pepv%plant_calloc(i) = val - pepv%excess_cflux(i) = val - pepv%downreg(i) = val - pepv%prev_leafc_to_litter(i) = val - pepv%prev_frootc_to_litter(i) = val - pepv%tempsum_npp(i) = val - pepv%annsum_npp(i) = val - if (use_cndv) then - pepv%tempsum_litfall(i) = val - pepv%annsum_litfall(i) = val - end if - end do - -end subroutine CNSetPepv -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPcs -! -! !INTERFACE: -subroutine CNSetPcs (num, filter, val, pcs) -! -! !DESCRIPTION: -! Set pft carbon state variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_cstate_type), intent(inout) :: pcs -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - pcs%leafc(i) = val - pcs%leafc_storage(i) = val - pcs%leafc_xfer(i) = val - pcs%frootc(i) = val - pcs%frootc_storage(i) = val - pcs%frootc_xfer(i) = val - pcs%livestemc(i) = val - pcs%livestemc_storage(i) = val - pcs%livestemc_xfer(i) = val - pcs%deadstemc(i) = val - pcs%deadstemc_storage(i) = val - pcs%deadstemc_xfer(i) = val - pcs%livecrootc(i) = val - pcs%livecrootc_storage(i) = val - pcs%livecrootc_xfer(i) = val - pcs%deadcrootc(i) = val - pcs%deadcrootc_storage(i) = val - pcs%deadcrootc_xfer(i) = val - pcs%gresp_storage(i) = val - pcs%gresp_xfer(i) = val - pcs%cpool(i) = val - pcs%xsmrpool(i) = val - pcs%pft_ctrunc(i) = val - pcs%dispvegc(i) = val - pcs%storvegc(i) = val - pcs%totvegc(i) = val - pcs%totpftc(i) = val - pcs%woodc(i) = val - - if ( crop_prog )then - pcs%grainc(i) = val - pcs%grainc_storage(i) = val - pcs%grainc_xfer(i) = val - end if - end do - -end subroutine CNSetPcs -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPns -! -! !INTERFACE: -subroutine CNSetPns(num, filter, val, pns) -! -! !DESCRIPTION: -! Set pft nitrogen state variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_nstate_type), intent(inout) :: pns -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - pns%leafn(i) = val - pns%leafn_storage(i) = val - pns%leafn_xfer(i) = val - pns%frootn(i) = val - pns%frootn_storage(i) = val - pns%frootn_xfer(i) = val - pns%livestemn(i) = val - pns%livestemn_storage(i) = val - pns%livestemn_xfer(i) = val - pns%deadstemn(i) = val - pns%deadstemn_storage(i) = val - pns%deadstemn_xfer(i) = val - pns%livecrootn(i) = val - pns%livecrootn_storage(i) = val - pns%livecrootn_xfer(i) = val - pns%deadcrootn(i) = val - pns%deadcrootn_storage(i) = val - pns%deadcrootn_xfer(i) = val - pns%retransn(i) = val - pns%npool(i) = val - pns%pft_ntrunc(i) = val - pns%dispvegn(i) = val - pns%storvegn(i) = val - pns%totvegn(i) = val - pns%totpftn(i) = val - if ( crop_prog )then - pns%grainn(i) = val - pns%grainn_storage(i) = val - pns%grainn_xfer(i) = val - end if - end do - -end subroutine CNSetPns -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPcf -! -! !INTERFACE: -subroutine CNSetPcf(num, filter, val, pcf) -! -! !DESCRIPTION: -! Set pft carbon flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_cflux_type), intent(inout) :: pcf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - pcf%m_leafc_to_litter(i) = val - pcf%m_frootc_to_litter(i) = val - pcf%m_leafc_storage_to_litter(i) = val - pcf%m_frootc_storage_to_litter(i) = val - pcf%m_livestemc_storage_to_litter(i) = val - pcf%m_deadstemc_storage_to_litter(i) = val - pcf%m_livecrootc_storage_to_litter(i) = val - pcf%m_deadcrootc_storage_to_litter(i) = val - pcf%m_leafc_xfer_to_litter(i) = val - pcf%m_frootc_xfer_to_litter(i) = val - pcf%m_livestemc_xfer_to_litter(i) = val - pcf%m_deadstemc_xfer_to_litter(i) = val - pcf%m_livecrootc_xfer_to_litter(i) = val - pcf%m_deadcrootc_xfer_to_litter(i) = val - pcf%m_livestemc_to_litter(i) = val - pcf%m_deadstemc_to_litter(i) = val - pcf%m_livecrootc_to_litter(i) = val - pcf%m_deadcrootc_to_litter(i) = val - pcf%m_gresp_storage_to_litter(i) = val - pcf%m_gresp_xfer_to_litter(i) = val - pcf%hrv_leafc_to_litter(i) = val - pcf%hrv_leafc_storage_to_litter(i) = val - pcf%hrv_leafc_xfer_to_litter(i) = val - pcf%hrv_frootc_to_litter(i) = val - pcf%hrv_frootc_storage_to_litter(i) = val - pcf%hrv_frootc_xfer_to_litter(i) = val - pcf%hrv_livestemc_to_litter(i) = val - pcf%hrv_livestemc_storage_to_litter(i) = val - pcf%hrv_livestemc_xfer_to_litter(i) = val - pcf%hrv_deadstemc_to_prod10c(i) = val - pcf%hrv_deadstemc_to_prod100c(i) = val - pcf%hrv_deadstemc_storage_to_litter(i) = val - pcf%hrv_deadstemc_xfer_to_litter(i) = val - pcf%hrv_livecrootc_to_litter(i) = val - pcf%hrv_livecrootc_storage_to_litter(i) = val - pcf%hrv_livecrootc_xfer_to_litter(i) = val - pcf%hrv_deadcrootc_to_litter(i) = val - pcf%hrv_deadcrootc_storage_to_litter(i) = val - pcf%hrv_deadcrootc_xfer_to_litter(i) = val - pcf%hrv_gresp_storage_to_litter(i) = val - pcf%hrv_gresp_xfer_to_litter(i) = val - pcf%hrv_xsmrpool_to_atm(i) = val - pcf%m_leafc_to_fire(i) = val - pcf%m_frootc_to_fire(i) = val - pcf%m_leafc_storage_to_fire(i) = val - pcf%m_frootc_storage_to_fire(i) = val - pcf%m_livestemc_storage_to_fire(i) = val - pcf%m_deadstemc_storage_to_fire(i) = val - pcf%m_livecrootc_storage_to_fire(i) = val - pcf%m_deadcrootc_storage_to_fire(i) = val - pcf%m_leafc_xfer_to_fire(i) = val - pcf%m_frootc_xfer_to_fire(i) = val - pcf%m_livestemc_xfer_to_fire(i) = val - pcf%m_deadstemc_xfer_to_fire(i) = val - pcf%m_livecrootc_xfer_to_fire(i) = val - pcf%m_deadcrootc_xfer_to_fire(i) = val - pcf%m_livestemc_to_fire(i) = val - pcf%m_deadstemc_to_fire(i) = val - pcf%m_deadstemc_to_litter_fire(i) = val - pcf%m_livecrootc_to_fire(i) = val - pcf%m_deadcrootc_to_fire(i) = val - pcf%m_deadcrootc_to_litter_fire(i) = val - pcf%m_gresp_storage_to_fire(i) = val - pcf%m_gresp_xfer_to_fire(i) = val - pcf%leafc_xfer_to_leafc(i) = val - pcf%frootc_xfer_to_frootc(i) = val - pcf%livestemc_xfer_to_livestemc(i) = val - pcf%deadstemc_xfer_to_deadstemc(i) = val - pcf%livecrootc_xfer_to_livecrootc(i) = val - pcf%deadcrootc_xfer_to_deadcrootc(i) = val - pcf%leafc_to_litter(i) = val - pcf%frootc_to_litter(i) = val - pcf%leaf_mr(i) = val - pcf%froot_mr(i) = val - pcf%livestem_mr(i) = val - pcf%livecroot_mr(i) = val - pcf%leaf_curmr(i) = val - pcf%froot_curmr(i) = val - pcf%livestem_curmr(i) = val - pcf%livecroot_curmr(i) = val - pcf%leaf_xsmr(i) = val - pcf%froot_xsmr(i) = val - pcf%livestem_xsmr(i) = val - pcf%livecroot_xsmr(i) = val - pcf%psnsun_to_cpool(i) = val - pcf%psnshade_to_cpool(i) = val - pcf%cpool_to_xsmrpool(i) = val - pcf%cpool_to_leafc(i) = val - pcf%cpool_to_leafc_storage(i) = val - pcf%cpool_to_frootc(i) = val - pcf%cpool_to_frootc_storage(i) = val - pcf%cpool_to_livestemc(i) = val - pcf%cpool_to_livestemc_storage(i) = val - pcf%cpool_to_deadstemc(i) = val - pcf%cpool_to_deadstemc_storage(i) = val - pcf%cpool_to_livecrootc(i) = val - pcf%cpool_to_livecrootc_storage(i) = val - pcf%cpool_to_deadcrootc(i) = val - pcf%cpool_to_deadcrootc_storage(i) = val - pcf%cpool_to_gresp_storage(i) = val - pcf%cpool_leaf_gr(i) = val - pcf%cpool_leaf_storage_gr(i) = val - pcf%transfer_leaf_gr(i) = val - pcf%cpool_froot_gr(i) = val - pcf%cpool_froot_storage_gr(i) = val - pcf%transfer_froot_gr(i) = val - pcf%cpool_livestem_gr(i) = val - pcf%cpool_livestem_storage_gr(i) = val - pcf%transfer_livestem_gr(i) = val - pcf%cpool_deadstem_gr(i) = val - pcf%cpool_deadstem_storage_gr(i) = val - pcf%transfer_deadstem_gr(i) = val - pcf%cpool_livecroot_gr(i) = val - pcf%cpool_livecroot_storage_gr(i) = val - pcf%transfer_livecroot_gr(i) = val - pcf%cpool_deadcroot_gr(i) = val - pcf%cpool_deadcroot_storage_gr(i) = val - pcf%transfer_deadcroot_gr(i) = val - pcf%leafc_storage_to_xfer(i) = val - pcf%frootc_storage_to_xfer(i) = val - pcf%livestemc_storage_to_xfer(i) = val - pcf%deadstemc_storage_to_xfer(i) = val - pcf%livecrootc_storage_to_xfer(i) = val - pcf%deadcrootc_storage_to_xfer(i) = val - pcf%gresp_storage_to_xfer(i) = val - pcf%livestemc_to_deadstemc(i) = val - pcf%livecrootc_to_deadcrootc(i) = val - pcf%gpp(i) = val - pcf%mr(i) = val - pcf%current_gr(i) = val - pcf%transfer_gr(i) = val - pcf%storage_gr(i) = val - pcf%gr(i) = val - pcf%ar(i) = val - pcf%rr(i) = val - pcf%npp(i) = val - pcf%agnpp(i) = val - pcf%bgnpp(i) = val - pcf%litfall(i) = val - pcf%vegfire(i) = val - pcf%wood_harvestc(i) = val - pcf%pft_cinputs(i) = val - pcf%pft_coutputs(i) = val - pcf%pft_fire_closs(i) = val - pcf%frootc_alloc(i) = val - pcf%frootc_loss(i) = val - pcf%leafc_alloc(i) = val - pcf%leafc_loss(i) = val - pcf%woodc_alloc(i) = val - pcf%woodc_loss(i) = val - if ( crop_prog )then - pcf%xsmrpool_to_atm(i) = val - pcf%livestemc_to_litter(i) = val - pcf%grainc_to_food(i) = val - pcf%grainc_xfer_to_grainc(i) = val - pcf%cpool_to_grainc(i) = val - pcf%cpool_to_grainc_storage(i) = val - pcf%cpool_grain_gr(i) = val - pcf%cpool_grain_storage_gr(i) = val - pcf%transfer_grain_gr(i) = val - pcf%grainc_storage_to_xfer(i) = val - end if - end do - -end subroutine CNSetPcf -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetPnf -! -! !INTERFACE: -subroutine CNSetPnf(num, filter, val, pnf) -! -! !DESCRIPTION: -! Set pft nitrogen flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (pft_nflux_type), intent(inout) :: pnf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i=filter(fi) - pnf%m_leafn_to_litter(i) = val - pnf%m_frootn_to_litter(i) = val - pnf%m_leafn_storage_to_litter(i) = val - pnf%m_frootn_storage_to_litter(i) = val - pnf%m_livestemn_storage_to_litter(i) = val - pnf%m_deadstemn_storage_to_litter(i) = val - pnf%m_livecrootn_storage_to_litter(i) = val - pnf%m_deadcrootn_storage_to_litter(i) = val - pnf%m_leafn_xfer_to_litter(i) = val - pnf%m_frootn_xfer_to_litter(i) = val - pnf%m_livestemn_xfer_to_litter(i) = val - pnf%m_deadstemn_xfer_to_litter(i) = val - pnf%m_livecrootn_xfer_to_litter(i) = val - pnf%m_deadcrootn_xfer_to_litter(i) = val - pnf%m_livestemn_to_litter(i) = val - pnf%m_deadstemn_to_litter(i) = val - pnf%m_livecrootn_to_litter(i) = val - pnf%m_deadcrootn_to_litter(i) = val - pnf%m_retransn_to_litter(i) = val - pnf%hrv_leafn_to_litter(i) = val - pnf%hrv_frootn_to_litter(i) = val - pnf%hrv_leafn_storage_to_litter(i) = val - pnf%hrv_frootn_storage_to_litter(i) = val - pnf%hrv_livestemn_storage_to_litter(i) = val - pnf%hrv_deadstemn_storage_to_litter(i) = val - pnf%hrv_livecrootn_storage_to_litter(i) = val - pnf%hrv_deadcrootn_storage_to_litter(i) = val - pnf%hrv_leafn_xfer_to_litter(i) = val - pnf%hrv_frootn_xfer_to_litter(i) = val - pnf%hrv_livestemn_xfer_to_litter(i) = val - pnf%hrv_deadstemn_xfer_to_litter(i) = val - pnf%hrv_livecrootn_xfer_to_litter(i) = val - pnf%hrv_deadcrootn_xfer_to_litter(i) = val - pnf%hrv_livestemn_to_litter(i) = val - pnf%hrv_deadstemn_to_prod10n(i) = val - pnf%hrv_deadstemn_to_prod100n(i) = val - pnf%hrv_livecrootn_to_litter(i) = val - pnf%hrv_deadcrootn_to_litter(i) = val - pnf%hrv_retransn_to_litter(i) = val - pnf%m_leafn_to_fire(i) = val - pnf%m_frootn_to_fire(i) = val - pnf%m_leafn_storage_to_fire(i) = val - pnf%m_frootn_storage_to_fire(i) = val - pnf%m_livestemn_storage_to_fire(i) = val - pnf%m_deadstemn_storage_to_fire(i) = val - pnf%m_livecrootn_storage_to_fire(i) = val - pnf%m_deadcrootn_storage_to_fire(i) = val - pnf%m_leafn_xfer_to_fire(i) = val - pnf%m_frootn_xfer_to_fire(i) = val - pnf%m_livestemn_xfer_to_fire(i) = val - pnf%m_deadstemn_xfer_to_fire(i) = val - pnf%m_livecrootn_xfer_to_fire(i) = val - pnf%m_deadcrootn_xfer_to_fire(i) = val - pnf%m_livestemn_to_fire(i) = val - pnf%m_deadstemn_to_fire(i) = val - pnf%m_deadstemn_to_litter_fire(i) = val - pnf%m_livecrootn_to_fire(i) = val - pnf%m_deadcrootn_to_fire(i) = val - pnf%m_deadcrootn_to_litter_fire(i) = val - pnf%m_retransn_to_fire(i) = val - pnf%leafn_xfer_to_leafn(i) = val - pnf%frootn_xfer_to_frootn(i) = val - pnf%livestemn_xfer_to_livestemn(i) = val - pnf%deadstemn_xfer_to_deadstemn(i) = val - pnf%livecrootn_xfer_to_livecrootn(i) = val - pnf%deadcrootn_xfer_to_deadcrootn(i) = val - pnf%leafn_to_litter(i) = val - pnf%leafn_to_retransn(i) = val - pnf%frootn_to_litter(i) = val - pnf%retransn_to_npool(i) = val - pnf%sminn_to_npool(i) = val - pnf%npool_to_leafn(i) = val - pnf%npool_to_leafn_storage(i) = val - pnf%npool_to_frootn(i) = val - pnf%npool_to_frootn_storage(i) = val - pnf%npool_to_livestemn(i) = val - pnf%npool_to_livestemn_storage(i) = val - pnf%npool_to_deadstemn(i) = val - pnf%npool_to_deadstemn_storage(i) = val - pnf%npool_to_livecrootn(i) = val - pnf%npool_to_livecrootn_storage(i) = val - pnf%npool_to_deadcrootn(i) = val - pnf%npool_to_deadcrootn_storage(i) = val - pnf%leafn_storage_to_xfer(i) = val - pnf%frootn_storage_to_xfer(i) = val - pnf%livestemn_storage_to_xfer(i) = val - pnf%deadstemn_storage_to_xfer(i) = val - pnf%livecrootn_storage_to_xfer(i) = val - pnf%deadcrootn_storage_to_xfer(i) = val - pnf%livestemn_to_deadstemn(i) = val - pnf%livestemn_to_retransn(i) = val - pnf%livecrootn_to_deadcrootn(i) = val - pnf%livecrootn_to_retransn(i) = val - pnf%ndeploy(i) = val - pnf%pft_ninputs(i) = val - pnf%pft_noutputs(i) = val - pnf%wood_harvestn(i) = val - pnf%pft_fire_nloss(i) = val - if ( crop_prog )then - pnf%livestemn_to_litter(i) = val - pnf%grainn_to_food(i) = val - pnf%grainn_xfer_to_grainn(i) = val - pnf%npool_to_grainn(i) = val - pnf%npool_to_grainn_storage(i) = val - pnf%grainn_storage_to_xfer(i) = val - end if - end do - -end subroutine CNSetPnf -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetCps -! -! !INTERFACE: -subroutine CNSetCps(num, filter, val, cps) -! -! !DESCRIPTION: -! Set column physical state variables -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (column_pstate_type), intent(inout) :: cps -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i,j ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - cps%decl(i) = val - cps%coszen(i) = val - cps%fpi(i) = val - cps%fpg(i) = val - cps%annsum_counter(i) = val - cps%cannsum_npp(i) = val - cps%cannavg_t2m(i) = val - cps%wf(i) = val - cps%me(i) = val - cps%fire_prob(i) = val - cps%mean_fire_prob(i) = val - cps%fireseasonl(i) = val - cps%farea_burned(i) = val - cps%ann_farea_burned(i) = val - end do - - do j = 1,nlevgrnd - do fi = 1,num - i = filter(fi) - cps%bsw2(i,j) = val - cps%psisat(i,j) = val - cps%vwcsat(i,j) = val - cps%soilpsi(i,j) = val - end do - end do - -end subroutine CNSetCps -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetCcs -! -! !INTERFACE: -subroutine CNSetCcs(num, filter, val, ccs) -! -! !DESCRIPTION: -! Set column carbon state variables -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (column_cstate_type), intent(inout) :: ccs -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - ccs%cwdc(i) = val - ccs%litr1c(i) = val - ccs%litr2c(i) = val - ccs%litr3c(i) = val - ccs%soil1c(i) = val - ccs%soil2c(i) = val - ccs%soil3c(i) = val - ccs%soil4c(i) = val - ccs%col_ctrunc(i) = val - ccs%totlitc(i) = val - ccs%totsomc(i) = val - ccs%totecosysc(i) = val - ccs%totcolc(i) = val - - end do - -end subroutine CNSetCcs -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetCns -! -! !INTERFACE: -subroutine CNSetCns(num, filter, val, cns) -! -! !DESCRIPTION: -! Set column nitrogen state variables -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (column_nstate_type), intent(inout) :: cns -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - cns%cwdn(i) = val - cns%litr1n(i) = val - cns%litr2n(i) = val - cns%litr3n(i) = val - cns%soil1n(i) = val - cns%soil2n(i) = val - cns%soil3n(i) = val - cns%soil4n(i) = val - cns%sminn(i) = val - cns%col_ntrunc(i) = val - cns%totlitn(i) = val - cns%totsomn(i) = val - cns%totecosysn(i) = val - cns%totcoln(i) = val - end do - -end subroutine CNSetCns -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetCcf -! -! !INTERFACE: -subroutine CNSetCcf(num, filter, val, ccf) -! -! !DESCRIPTION: -! Set column carbon flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (column_cflux_type), intent(inout) :: ccf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - ccf%m_leafc_to_litr1c(i) = val - ccf%m_leafc_to_litr2c(i) = val - ccf%m_leafc_to_litr3c(i) = val - ccf%m_frootc_to_litr1c(i) = val - ccf%m_frootc_to_litr2c(i) = val - ccf%m_frootc_to_litr3c(i) = val - ccf%m_leafc_storage_to_litr1c(i) = val - ccf%m_frootc_storage_to_litr1c(i) = val - ccf%m_livestemc_storage_to_litr1c(i) = val - ccf%m_deadstemc_storage_to_litr1c(i) = val - ccf%m_livecrootc_storage_to_litr1c(i) = val - ccf%m_deadcrootc_storage_to_litr1c(i) = val - ccf%m_leafc_xfer_to_litr1c(i) = val - ccf%m_frootc_xfer_to_litr1c(i) = val - ccf%m_livestemc_xfer_to_litr1c(i) = val - ccf%m_deadstemc_xfer_to_litr1c(i) = val - ccf%m_livecrootc_xfer_to_litr1c(i) = val - ccf%m_deadcrootc_xfer_to_litr1c(i) = val - ccf%m_livestemc_to_cwdc(i) = val - ccf%m_deadstemc_to_cwdc(i) = val - ccf%m_livecrootc_to_cwdc(i) = val - ccf%m_deadcrootc_to_cwdc(i) = val - ccf%m_gresp_storage_to_litr1c(i) = val - ccf%m_gresp_xfer_to_litr1c(i) = val - ccf%hrv_leafc_to_litr1c(i) = val - ccf%hrv_leafc_to_litr2c(i) = val - ccf%hrv_leafc_to_litr3c(i) = val - ccf%hrv_frootc_to_litr1c(i) = val - ccf%hrv_frootc_to_litr2c(i) = val - ccf%hrv_frootc_to_litr3c(i) = val - ccf%hrv_livestemc_to_cwdc(i) = val - ccf%hrv_deadstemc_to_prod10c(i) = val - ccf%hrv_deadstemc_to_prod100c(i) = val - ccf%hrv_livecrootc_to_cwdc(i) = val - ccf%hrv_deadcrootc_to_cwdc(i) = val - ccf%hrv_leafc_storage_to_litr1c(i) = val - ccf%hrv_frootc_storage_to_litr1c(i) = val - ccf%hrv_livestemc_storage_to_litr1c(i) = val - ccf%hrv_deadstemc_storage_to_litr1c(i) = val - ccf%hrv_livecrootc_storage_to_litr1c(i) = val - ccf%hrv_deadcrootc_storage_to_litr1c(i) = val - if ( crop_prog )then - ccf%livestemc_to_litr1c(i) = val - ccf%livestemc_to_litr2c(i) = val - ccf%livestemc_to_litr3c(i) = val - ccf%grainc_to_litr1c(i) = val - ccf%grainc_to_litr2c(i) = val - ccf%grainc_to_litr3c(i) = val - end if - ccf%hrv_gresp_storage_to_litr1c(i) = val - ccf%hrv_leafc_xfer_to_litr1c(i) = val - ccf%hrv_frootc_xfer_to_litr1c(i) = val - ccf%hrv_livestemc_xfer_to_litr1c(i) = val - ccf%hrv_deadstemc_xfer_to_litr1c(i) = val - ccf%hrv_livecrootc_xfer_to_litr1c(i) = val - ccf%hrv_deadcrootc_xfer_to_litr1c(i) = val - ccf%hrv_gresp_xfer_to_litr1c(i) = val - ccf%m_deadstemc_to_cwdc_fire(i) = val - ccf%m_deadcrootc_to_cwdc_fire(i) = val - ccf%m_litr1c_to_fire(i) = val - ccf%m_litr2c_to_fire(i) = val - ccf%m_litr3c_to_fire(i) = val - ccf%m_cwdc_to_fire(i) = val - ccf%prod10c_loss(i) = val - ccf%prod100c_loss(i) = val - ccf%product_closs(i) = val - ccf%leafc_to_litr1c(i) = val - ccf%leafc_to_litr2c(i) = val - ccf%leafc_to_litr3c(i) = val - ccf%frootc_to_litr1c(i) = val - ccf%frootc_to_litr2c(i) = val - ccf%frootc_to_litr3c(i) = val - ccf%cwdc_to_litr2c(i) = val - ccf%cwdc_to_litr3c(i) = val - ccf%litr1_hr(i) = val - ccf%litr1c_to_soil1c(i) = val - ccf%litr2_hr(i) = val - ccf%litr2c_to_soil2c(i) = val - ccf%litr3_hr(i) = val - ccf%litr3c_to_soil3c(i) = val - ccf%soil1_hr(i) = val - ccf%soil1c_to_soil2c(i) = val - ccf%soil2_hr(i) = val - ccf%soil2c_to_soil3c(i) = val - ccf%soil3_hr(i) = val - ccf%soil3c_to_soil4c(i) = val - ccf%soil4_hr(i) = val - ccf%lithr(i) = val - ccf%somhr(i) = val - ccf%hr(i) = val - ccf%sr(i) = val - ccf%er(i) = val - ccf%litfire(i) = val - ccf%somfire(i) = val - ccf%totfire(i) = val - ccf%nep(i) = val - ccf%nbp(i) = val - ccf%nee(i) = val - ccf%col_cinputs(i) = val - ccf%col_coutputs(i) = val - ccf%col_fire_closs(i) = val - ccf%cwdc_hr(i) = val - ccf%cwdc_loss(i) = val - ccf%litterc_loss(i) = val - - end do - -end subroutine CNSetCcf -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNSetCnf -! -! !INTERFACE: -subroutine CNSetCnf(num, filter, val, cnf) -! -! !DESCRIPTION: -! Set column nitrogen flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer , intent(in) :: num - integer , intent(in) :: filter(:) - real(r8), intent(in) :: val - type (column_nflux_type), intent(inout) :: cnf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in/out arrays -! -! !OTHER LOCAL VARIABLES: - integer :: fi,i ! loop index -!EOP -!------------------------------------------------------------------------ - - do fi = 1,num - i = filter(fi) - cnf%ndep_to_sminn(i) = val - cnf%nfix_to_sminn(i) = val - cnf%m_leafn_to_litr1n(i) = val - cnf%m_leafn_to_litr2n(i) = val - cnf%m_leafn_to_litr3n(i) = val - cnf%m_frootn_to_litr1n(i) = val - cnf%m_frootn_to_litr2n(i) = val - cnf%m_frootn_to_litr3n(i) = val - cnf%m_leafn_storage_to_litr1n(i) = val - cnf%m_frootn_storage_to_litr1n(i) = val - cnf%m_livestemn_storage_to_litr1n(i) = val - cnf%m_deadstemn_storage_to_litr1n(i) = val - cnf%m_livecrootn_storage_to_litr1n(i) = val - cnf%m_deadcrootn_storage_to_litr1n(i) = val - cnf%m_leafn_xfer_to_litr1n(i) = val - cnf%m_frootn_xfer_to_litr1n(i) = val - cnf%m_livestemn_xfer_to_litr1n(i) = val - cnf%m_deadstemn_xfer_to_litr1n(i) = val - cnf%m_livecrootn_xfer_to_litr1n(i) = val - cnf%m_deadcrootn_xfer_to_litr1n(i) = val - cnf%m_livestemn_to_cwdn(i) = val - cnf%m_deadstemn_to_cwdn(i) = val - cnf%m_livecrootn_to_cwdn(i) = val - cnf%m_deadcrootn_to_cwdn(i) = val - cnf%m_retransn_to_litr1n(i) = val - cnf%hrv_leafn_to_litr1n(i) = val - cnf%hrv_leafn_to_litr2n(i) = val - cnf%hrv_leafn_to_litr3n(i) = val - cnf%hrv_frootn_to_litr1n(i) = val - cnf%hrv_frootn_to_litr2n(i) = val - cnf%hrv_frootn_to_litr3n(i) = val - cnf%hrv_livestemn_to_cwdn(i) = val - cnf%hrv_deadstemn_to_prod10n(i) = val - cnf%hrv_deadstemn_to_prod100n(i) = val - cnf%hrv_livecrootn_to_cwdn(i) = val - cnf%hrv_deadcrootn_to_cwdn(i) = val - cnf%hrv_retransn_to_litr1n(i) = val - cnf%hrv_leafn_storage_to_litr1n(i) = val - cnf%hrv_frootn_storage_to_litr1n(i) = val - cnf%hrv_livestemn_storage_to_litr1n(i) = val - cnf%hrv_deadstemn_storage_to_litr1n(i) = val - cnf%hrv_livecrootn_storage_to_litr1n(i) = val - cnf%hrv_deadcrootn_storage_to_litr1n(i) = val - cnf%hrv_leafn_xfer_to_litr1n(i) = val - cnf%hrv_frootn_xfer_to_litr1n(i) = val - cnf%hrv_livestemn_xfer_to_litr1n(i) = val - cnf%hrv_deadstemn_xfer_to_litr1n(i) = val - cnf%hrv_livecrootn_xfer_to_litr1n(i) = val - cnf%hrv_deadcrootn_xfer_to_litr1n(i) = val - cnf%m_deadstemn_to_cwdn_fire(i) = val - cnf%m_deadcrootn_to_cwdn_fire(i) = val - cnf%m_litr1n_to_fire(i) = val - cnf%m_litr2n_to_fire(i) = val - cnf%m_litr3n_to_fire(i) = val - cnf%m_cwdn_to_fire(i) = val - cnf%prod10n_loss(i) = val - cnf%prod100n_loss(i) = val - cnf%product_nloss(i) = val - if ( crop_prog )then - cnf%grainn_to_litr1n(i) = val - cnf%grainn_to_litr2n(i) = val - cnf%grainn_to_litr3n(i) = val - cnf%livestemn_to_litr1n(i) = val - cnf%livestemn_to_litr2n(i) = val - cnf%livestemn_to_litr3n(i) = val - end if - cnf%leafn_to_litr1n(i) = val - cnf%leafn_to_litr2n(i) = val - cnf%leafn_to_litr3n(i) = val - cnf%frootn_to_litr1n(i) = val - cnf%frootn_to_litr2n(i) = val - cnf%frootn_to_litr3n(i) = val - cnf%cwdn_to_litr2n(i) = val - cnf%cwdn_to_litr3n(i) = val - cnf%litr1n_to_soil1n(i) = val - cnf%sminn_to_soil1n_l1(i) = val - cnf%litr2n_to_soil2n(i) = val - cnf%sminn_to_soil2n_l2(i) = val - cnf%litr3n_to_soil3n(i) = val - cnf%sminn_to_soil3n_l3(i) = val - cnf%soil1n_to_soil2n(i) = val - cnf%sminn_to_soil2n_s1(i) = val - cnf%soil2n_to_soil3n(i) = val - cnf%sminn_to_soil3n_s2(i) = val - cnf%soil3n_to_soil4n(i) = val - cnf%sminn_to_soil4n_s3(i) = val - cnf%soil4n_to_sminn(i) = val - cnf%sminn_to_denit_l1s1(i) = val - cnf%sminn_to_denit_l2s2(i) = val - cnf%sminn_to_denit_l3s3(i) = val - cnf%sminn_to_denit_s1s2(i) = val - cnf%sminn_to_denit_s2s3(i) = val - cnf%sminn_to_denit_s3s4(i) = val - cnf%sminn_to_denit_s4(i) = val - cnf%sminn_to_denit_excess(i) = val - cnf%sminn_leached(i) = val - cnf%potential_immob(i) = val - cnf%actual_immob(i) = val - cnf%sminn_to_plant(i) = val - cnf%supplement_to_sminn(i) = val - cnf%gross_nmin(i) = val - cnf%net_nmin(i) = val - cnf%denit(i) = val - cnf%col_ninputs(i) = val - cnf%col_noutputs(i) = val - cnf%col_fire_nloss(i) = val - end do - -end subroutine CNSetCnf -!----------------------------------------------------------------------- - -end module CNSetValueMod diff --git a/src_clm40/biogeochem/CNSummaryMod.F90 b/src_clm40/biogeochem/CNSummaryMod.F90 deleted file mode 100644 index 2a1f08a51e..0000000000 --- a/src_clm40/biogeochem/CNSummaryMod.F90 +++ /dev/null @@ -1,1402 +0,0 @@ -module CNSummaryMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNSummaryMod -! -! !DESCRIPTION: -! Module for carbon and nitrogen summary calculations -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use pftvarcon , only: npcropmin, nc3crop - use surfrdMod , only: crop_prog - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CSummary - public :: NSummary -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CSummary -! -! !INTERFACE: -subroutine CSummary(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, perform pft and column-level carbon -! summary calculations -! -! !USES: - use clmtype - use pft2colMod, only: p2c - use clm_varctl, only: iulog, use_cndv - use shr_sys_mod, only: shr_sys_flush -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 12/9/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: col_fire_closs(:) ! (gC/m2/s) total column-level fire C loss - real(r8), pointer :: er(:) ! (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - real(r8), pointer :: hr(:) ! (gC/m2/s) total heterotrophic respiration - real(r8), pointer :: litfire(:) ! (gC/m2/s) litter fire losses - real(r8), pointer :: lithr(:) ! (gC/m2/s) litter heterotrophic respiration - real(r8), pointer :: litr1_hr(:) - real(r8), pointer :: litr2_hr(:) - real(r8), pointer :: litr3_hr(:) - real(r8), pointer :: m_cwdc_to_fire(:) - real(r8), pointer :: m_litr1c_to_fire(:) - real(r8), pointer :: m_litr2c_to_fire(:) - real(r8), pointer :: m_litr3c_to_fire(:) - real(r8), pointer :: nee(:) ! (gC/m2/s) net ecosystem exchange of carbon, includes fire, land-use, harvest, and hrv_xsmrpool flux, positive for source - real(r8), pointer :: nep(:) ! (gC/m2/s) net ecosystem production, excludes fire, land-use, and harvest flux, positive for sink - real(r8), pointer :: nbp(:) ! (gC/m2/s) net biome production, includes fire, land-use, and harvest flux, positive for sink - real(r8), pointer :: col_ar(:) ! (gC/m2/s) autotrophic respiration (MR + GR) - real(r8), pointer :: col_gpp(:) ! GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: col_npp(:) ! (gC/m2/s) net primary production - real(r8), pointer :: col_pft_fire_closs(:) ! (gC/m2/s) total pft-level fire C loss - real(r8), pointer :: col_litfall(:) ! (gC/m2/s) total pft-level litterfall C loss - real(r8), pointer :: col_rr(:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: col_vegfire(:) ! (gC/m2/s) pft-level fire loss (obsolete, mark for removal) - real(r8), pointer :: col_wood_harvestc(:) - real(r8), pointer :: soil1_hr(:) - real(r8), pointer :: soil2_hr(:) - real(r8), pointer :: soil3_hr(:) - real(r8), pointer :: soil4_hr(:) - real(r8), pointer :: somfire(:) ! (gC/m2/s) soil organic matter fire losses - real(r8), pointer :: somhr(:) ! (gC/m2/s) soil organic matter heterotrophic respiration - real(r8), pointer :: sr(:) ! (gC/m2/s) total soil respiration (HR + root resp) - real(r8), pointer :: totfire(:) ! (gC/m2/s) total ecosystem fire losses - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: col_totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: col_totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool - real(r8), pointer :: totecosysc(:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - real(r8), pointer :: totlitc(:) ! (gC/m2) total litter carbon - real(r8), pointer :: totsomc(:) ! (gC/m2) total soil organic matter carbon - real(r8), pointer :: agnpp(:) ! (gC/m2/s) aboveground NPP - real(r8), pointer :: ar(:) ! (gC/m2/s) autotrophic respiration (MR + GR) - real(r8), pointer :: bgnpp(:) ! (gC/m2/s) belowground NPP - real(r8), pointer :: xsmrpool_to_atm(:) ! excess MR pool harvest mortality (gC/m2/s) - real(r8), pointer :: cpool_grain_gr(:) ! grain growth respiration (gC/m2/s) - real(r8), pointer :: cpool_grain_storage_gr(:) ! grain growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C storage (gC/m2/s) - real(r8), pointer :: grainc_xfer_to_grainc(:) ! grain C growth from storage (gC/m2/s) - real(r8), pointer :: transfer_grain_gr(:) ! grain growth respiration from storage (gC/m2/s) - real(r8), pointer :: grainc_to_food(:) ! grain C to food (gC/m2/s) - real(r8), pointer :: livestemc_to_litter(:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc(:) ! (gC/m2) grain C - real(r8), pointer :: grainc_storage(:) ! (gC/m2) grain C storage - real(r8), pointer :: grainc_xfer(:) ! (gC/m2) grain C transfer - real(r8), pointer :: cpool_deadcroot_gr(:) ! dead coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) ! dead coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_deadstem_gr(:) ! dead stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadstem_storage_gr(:) ! dead stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_froot_gr(:) ! fine root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_froot_storage_gr(:) ! fine root growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_leaf_gr(:) ! leaf growth respiration (gC/m2/s) - real(r8), pointer :: cpool_leaf_storage_gr(:) ! leaf growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_livecroot_gr(:) ! live coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livecroot_storage_gr(:) ! live coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_livestem_gr(:) ! live stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livestem_storage_gr(:) ! live stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc(:) ! allocation to dead coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_deadstemc(:) ! allocation to dead stem C (gC/m2/s) - real(r8), pointer :: cpool_to_frootc(:) ! allocation to fine root C (gC/m2/s) - real(r8), pointer :: cpool_to_leafc(:) ! allocation to leaf C (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc(:) ! allocation to live coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc(:) ! allocation to live stem C (gC/m2/s) - real(r8), pointer :: current_gr(:) ! (gC/m2/s) growth resp for new growth displayed in this timestep - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) - real(r8), pointer :: frootc_to_litter(:) - real(r8), pointer :: frootc_xfer_to_frootc(:) - real(r8), pointer :: froot_mr(:) - real(r8), pointer :: gpp(:) !GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: gr(:) ! (gC/m2/s) total growth respiration - real(r8), pointer :: leafc_to_litter(:) - real(r8), pointer :: leafc_xfer_to_leafc(:) - real(r8), pointer :: leaf_mr(:) - real(r8), pointer :: litfall(:) ! (gC/m2/s) litterfall (leaves and fine roots) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) - real(r8), pointer :: livecroot_mr(:) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) - real(r8), pointer :: livestem_mr(:) - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_fire(:) - real(r8), pointer :: m_deadcrootc_to_litter(:) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) - real(r8), pointer :: m_deadstemc_to_fire(:) - real(r8), pointer :: m_deadstemc_to_litter(:) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) - real(r8), pointer :: m_frootc_storage_to_fire(:) - real(r8), pointer :: m_frootc_storage_to_litter(:) - real(r8), pointer :: m_frootc_to_fire(:) - real(r8), pointer :: m_frootc_to_litter(:) - real(r8), pointer :: m_frootc_xfer_to_fire(:) - real(r8), pointer :: m_frootc_xfer_to_litter(:) - real(r8), pointer :: m_gresp_storage_to_fire(:) - real(r8), pointer :: m_gresp_storage_to_litter(:) - real(r8), pointer :: m_gresp_xfer_to_fire(:) - real(r8), pointer :: m_gresp_xfer_to_litter(:) - real(r8), pointer :: m_leafc_storage_to_fire(:) - real(r8), pointer :: m_leafc_storage_to_litter(:) - real(r8), pointer :: m_leafc_to_fire(:) - real(r8), pointer :: m_leafc_to_litter(:) - real(r8), pointer :: m_leafc_xfer_to_fire(:) - real(r8), pointer :: m_leafc_xfer_to_litter(:) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) - real(r8), pointer :: m_livecrootc_to_fire(:) - real(r8), pointer :: m_livecrootc_to_litter(:) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) - real(r8), pointer :: m_livestemc_storage_to_fire(:) - real(r8), pointer :: m_livestemc_storage_to_litter(:) - real(r8), pointer :: m_livestemc_to_fire(:) - real(r8), pointer :: m_livestemc_to_litter(:) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) - real(r8), pointer :: col_hrv_xsmrpool_to_atm(:) - real(r8), pointer :: mr(:) ! (gC/m2/s) maintenance respiration - real(r8), pointer :: npp(:) ! (gC/m2/s) net primary production - real(r8), pointer :: pft_fire_closs(:) ! (gC/m2/s) total pft-level fire C loss - real(r8), pointer :: psnshade_to_cpool(:) - real(r8), pointer :: psnsun_to_cpool(:) - real(r8), pointer :: rr(:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: storage_gr(:) ! (gC/m2/s) growth resp for growth sent to storage for later display - real(r8), pointer :: transfer_deadcroot_gr(:) - real(r8), pointer :: transfer_deadstem_gr(:) - real(r8), pointer :: transfer_froot_gr(:) - real(r8), pointer :: transfer_gr(:) ! (gC/m2/s) growth resp for transfer growth displayed in this timestep - real(r8), pointer :: transfer_leaf_gr(:) - real(r8), pointer :: transfer_livecroot_gr(:) - real(r8), pointer :: transfer_livestem_gr(:) - real(r8), pointer :: wood_harvestc(:) ! (gC/m2/s) pft-level wood harvest (to product pools) - real(r8), pointer :: vegfire(:) ! (gC/m2/s) pft-level fire loss (obsolete, mark for removal) - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: pft_ctrunc(:) ! (gC/m2) pft-level sink for C truncation - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: dispvegc(:) ! (gC/m2) displayed veg carbon, excluding storage and cpool - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: storvegc(:) ! (gC/m2) stored vegetation carbon, excluding cpool - real(r8), pointer :: totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: tempsum_npp(:) ! temporary annual sum of NPP (gC/m2/yr) - real(r8), pointer :: tempsum_litfall(:) !temporary annual sum of litfall (gC/m2/yr) - - ! for landcover change - real(r8), pointer :: landuseflux(:) ! (gC/m2/s) dwt_closs+product_closs - real(r8), pointer :: landuptake(:) ! (gC/m2/s) nee-landuseflux - real(r8), pointer :: dwt_closs(:) ! (gC/m2/s) total carbon loss from land cover conversion - real(r8), pointer :: dwt_conv_cflux(:) ! (gC/m2/s) conversion C flux (immediate loss to atm) - real(r8), pointer :: prod10c_loss(:) ! (gC/m2/s) loss from 10-yr wood product pool - real(r8), pointer :: prod100c_loss(:) ! (gC/m2/s) loss from 100-yr wood product pool - real(r8), pointer :: product_closs(:) ! (gC/m2/s) total wood product carbon loss - real(r8), pointer :: seedc(:) ! (gC/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10c(:) ! (gC/m2) wood product C pool, 10-year lifespan - real(r8), pointer :: prod100c(:) ! (gC/m2) wood product C pool, 100-year lifespan - real(r8), pointer :: totprodc(:) ! (gC/m2) total wood product C - - real(r8), pointer :: frootc_alloc(:) ! fine root C allocation (gC/m2/s) - real(r8), pointer :: frootc_loss(:) ! fine root C loss (gC/m2/s) - real(r8), pointer :: leafc_alloc(:) ! leaf C allocation (gC/m2/s) - real(r8), pointer :: leafc_loss(:) ! leaf C loss (gC/m2/s) - real(r8), pointer :: woodc(:) ! wood C (gC/m2) - real(r8), pointer :: woodc_alloc(:) ! wood C allocation (gC/m2/s) - real(r8), pointer :: woodc_loss(:) ! wood C loss (gC/m2/s) - real(r8), pointer :: cwdc_hr(:) ! coarse woody debris C heterotrophic respiration (gC/m2/s) - real(r8), pointer :: cwdc_loss(:) ! coarse woody debris C loss (gC/m2/s) - real(r8), pointer :: litterc_loss(:) ! litter C loss (gC/m2/s) - real(r8), pointer :: litr1c_to_soil1c(:) ! litter1 C loss to soil1 (gC/m2/s) - real(r8), pointer :: litr2c_to_soil2c(:) ! litter2 C loss to soil2 (gC/m2/s) - real(r8), pointer :: litr3c_to_soil3c(:) ! litter3 C loss to soil3 (gC/m2/s) - real(r8), pointer :: cwdc_to_litr2c(:) ! cwdc C to soil2 (gC/m2/s) - real(r8), pointer :: cwdc_to_litr3c(:) ! cwdc C to soil3 (gC/m2/s) -! -! -! local pointers to implicit in/out scalars -! -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers - ivt => pft%itype - col_fire_closs => ccf%col_fire_closs - er => ccf%er - hr => ccf%hr - litfire => ccf%litfire - lithr => ccf%lithr - litr1_hr => ccf%litr1_hr - litr2_hr => ccf%litr2_hr - litr3_hr => ccf%litr3_hr - m_cwdc_to_fire => ccf%m_cwdc_to_fire - m_litr1c_to_fire => ccf%m_litr1c_to_fire - m_litr2c_to_fire => ccf%m_litr2c_to_fire - m_litr3c_to_fire => ccf%m_litr3c_to_fire - cwdc_to_litr2c => ccf%cwdc_to_litr2c - cwdc_to_litr3c => ccf%cwdc_to_litr3c - litr1c_to_soil1c => ccf%litr1c_to_soil1c - litr2c_to_soil2c => ccf%litr2c_to_soil2c - litr3c_to_soil3c => ccf%litr3c_to_soil3c - nee => ccf%nee - nep => ccf%nep - nbp => ccf%nbp - col_ar => pcf_a%ar - col_gpp => pcf_a%gpp - col_npp => pcf_a%npp - col_pft_fire_closs => pcf_a%pft_fire_closs - col_litfall => pcf_a%litfall - col_rr => pcf_a%rr - col_vegfire => pcf_a%vegfire - col_wood_harvestc => pcf_a%wood_harvestc - soil1_hr => ccf%soil1_hr - soil2_hr => ccf%soil2_hr - soil3_hr => ccf%soil3_hr - soil4_hr => ccf%soil4_hr - somfire => ccf%somfire - somhr => ccf%somhr - sr => ccf%sr - totfire => ccf%totfire - cwdc_hr => ccf%cwdc_hr - cwdc_loss => ccf%cwdc_loss - litterc_loss => ccf%litterc_loss - ! dynamic landcover pointers - dwt_closs => ccf%dwt_closs - landuseflux => ccf%landuseflux - landuptake => ccf%landuptake - dwt_conv_cflux => ccf%dwt_conv_cflux - seedc => ccs%seedc - - ! wood product pointers - prod10c_loss => ccf%prod10c_loss - prod100c_loss => ccf%prod100c_loss - product_closs => ccf%product_closs - prod10c => ccs%prod10c - prod100c => ccs%prod100c - totprodc => ccs%totprodc - - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - col_totpftc => pcs_a%totpftc - col_totvegc => pcs_a%totvegc - soil1c => ccs%soil1c - soil2c => ccs%soil2c - soil3c => ccs%soil3c - soil4c => ccs%soil4c - col_ctrunc => ccs%col_ctrunc - totcolc => ccs%totcolc - totecosysc => ccs%totecosysc - totlitc => ccs%totlitc - totsomc => ccs%totsomc - agnpp => pcf%agnpp - ar => pcf%ar - bgnpp => pcf%bgnpp - xsmrpool_to_atm => pcf%xsmrpool_to_atm - cpool_grain_gr => pcf%cpool_grain_gr - cpool_grain_storage_gr => pcf%cpool_grain_storage_gr - cpool_to_grainc => pcf%cpool_to_grainc - grainc_xfer_to_grainc => pcf%grainc_xfer_to_grainc - transfer_grain_gr => pcf%transfer_grain_gr - grainc_to_food => pcf%grainc_to_food - livestemc_to_litter => pcf%livestemc_to_litter - grainc => pcs%grainc - grainc_storage => pcs%grainc_storage - grainc_xfer => pcs%grainc_xfer - cpool_deadcroot_gr => pcf%cpool_deadcroot_gr - cpool_deadcroot_storage_gr => pcf%cpool_deadcroot_storage_gr - cpool_deadstem_gr => pcf%cpool_deadstem_gr - cpool_deadstem_storage_gr => pcf%cpool_deadstem_storage_gr - cpool_froot_gr => pcf%cpool_froot_gr - cpool_froot_storage_gr => pcf%cpool_froot_storage_gr - cpool_leaf_gr => pcf%cpool_leaf_gr - cpool_leaf_storage_gr => pcf%cpool_leaf_storage_gr - cpool_livecroot_gr => pcf%cpool_livecroot_gr - cpool_livecroot_storage_gr => pcf%cpool_livecroot_storage_gr - cpool_livestem_gr => pcf%cpool_livestem_gr - cpool_livestem_storage_gr => pcf%cpool_livestem_storage_gr - cpool_to_deadcrootc => pcf%cpool_to_deadcrootc - cpool_to_deadstemc => pcf%cpool_to_deadstemc - cpool_to_frootc => pcf%cpool_to_frootc - cpool_to_leafc => pcf%cpool_to_leafc - cpool_to_livecrootc => pcf%cpool_to_livecrootc - cpool_to_livestemc => pcf%cpool_to_livestemc - current_gr => pcf%current_gr - deadcrootc_xfer_to_deadcrootc => pcf%deadcrootc_xfer_to_deadcrootc - deadstemc_xfer_to_deadstemc => pcf%deadstemc_xfer_to_deadstemc - frootc_to_litter => pcf%frootc_to_litter - frootc_xfer_to_frootc => pcf%frootc_xfer_to_frootc - froot_mr => pcf%froot_mr - gpp => pcf%gpp - gr => pcf%gr - leafc_to_litter => pcf%leafc_to_litter - leafc_xfer_to_leafc => pcf%leafc_xfer_to_leafc - leaf_mr => pcf%leaf_mr - litfall => pcf%litfall - livecrootc_xfer_to_livecrootc => pcf%livecrootc_xfer_to_livecrootc - livecroot_mr => pcf%livecroot_mr - livestemc_xfer_to_livestemc => pcf%livestemc_xfer_to_livestemc - livestem_mr => pcf%livestem_mr - m_deadcrootc_storage_to_fire => pcf%m_deadcrootc_storage_to_fire - m_deadcrootc_storage_to_litter => pcf%m_deadcrootc_storage_to_litter - m_deadcrootc_to_fire => pcf%m_deadcrootc_to_fire - m_deadcrootc_to_litter => pcf%m_deadcrootc_to_litter - m_deadcrootc_to_litter_fire => pcf%m_deadcrootc_to_litter_fire - m_deadcrootc_xfer_to_fire => pcf%m_deadcrootc_xfer_to_fire - m_deadcrootc_xfer_to_litter => pcf%m_deadcrootc_xfer_to_litter - m_deadstemc_storage_to_fire => pcf%m_deadstemc_storage_to_fire - m_deadstemc_storage_to_litter => pcf%m_deadstemc_storage_to_litter - m_deadstemc_to_fire => pcf%m_deadstemc_to_fire - m_deadstemc_to_litter => pcf%m_deadstemc_to_litter - m_deadstemc_to_litter_fire => pcf%m_deadstemc_to_litter_fire - m_deadstemc_xfer_to_fire => pcf%m_deadstemc_xfer_to_fire - m_deadstemc_xfer_to_litter => pcf%m_deadstemc_xfer_to_litter - m_frootc_storage_to_fire => pcf%m_frootc_storage_to_fire - m_frootc_storage_to_litter => pcf%m_frootc_storage_to_litter - m_frootc_to_fire => pcf%m_frootc_to_fire - m_frootc_to_litter => pcf%m_frootc_to_litter - m_frootc_xfer_to_fire => pcf%m_frootc_xfer_to_fire - m_frootc_xfer_to_litter => pcf%m_frootc_xfer_to_litter - m_gresp_storage_to_fire => pcf%m_gresp_storage_to_fire - m_gresp_storage_to_litter => pcf%m_gresp_storage_to_litter - m_gresp_xfer_to_fire => pcf%m_gresp_xfer_to_fire - m_gresp_xfer_to_litter => pcf%m_gresp_xfer_to_litter - m_leafc_storage_to_fire => pcf%m_leafc_storage_to_fire - m_leafc_storage_to_litter => pcf%m_leafc_storage_to_litter - m_leafc_to_fire => pcf%m_leafc_to_fire - m_leafc_to_litter => pcf%m_leafc_to_litter - m_leafc_xfer_to_fire => pcf%m_leafc_xfer_to_fire - m_leafc_xfer_to_litter => pcf%m_leafc_xfer_to_litter - m_livecrootc_storage_to_fire => pcf%m_livecrootc_storage_to_fire - m_livecrootc_storage_to_litter => pcf%m_livecrootc_storage_to_litter - m_livecrootc_to_fire => pcf%m_livecrootc_to_fire - m_livecrootc_to_litter => pcf%m_livecrootc_to_litter - m_livecrootc_xfer_to_fire => pcf%m_livecrootc_xfer_to_fire - m_livecrootc_xfer_to_litter => pcf%m_livecrootc_xfer_to_litter - m_livestemc_storage_to_fire => pcf%m_livestemc_storage_to_fire - m_livestemc_storage_to_litter => pcf%m_livestemc_storage_to_litter - m_livestemc_to_fire => pcf%m_livestemc_to_fire - m_livestemc_to_litter => pcf%m_livestemc_to_litter - m_livestemc_xfer_to_fire => pcf%m_livestemc_xfer_to_fire - m_livestemc_xfer_to_litter => pcf%m_livestemc_xfer_to_litter - hrv_leafc_to_litter => pcf%hrv_leafc_to_litter - hrv_leafc_storage_to_litter => pcf%hrv_leafc_storage_to_litter - hrv_leafc_xfer_to_litter => pcf%hrv_leafc_xfer_to_litter - hrv_frootc_to_litter => pcf%hrv_frootc_to_litter - hrv_frootc_storage_to_litter => pcf%hrv_frootc_storage_to_litter - hrv_frootc_xfer_to_litter => pcf%hrv_frootc_xfer_to_litter - hrv_livestemc_to_litter => pcf%hrv_livestemc_to_litter - hrv_livestemc_storage_to_litter => pcf%hrv_livestemc_storage_to_litter - hrv_livestemc_xfer_to_litter => pcf%hrv_livestemc_xfer_to_litter - hrv_deadstemc_to_prod10c => pcf%hrv_deadstemc_to_prod10c - hrv_deadstemc_to_prod100c => pcf%hrv_deadstemc_to_prod100c - hrv_deadstemc_storage_to_litter => pcf%hrv_deadstemc_storage_to_litter - hrv_deadstemc_xfer_to_litter => pcf%hrv_deadstemc_xfer_to_litter - hrv_livecrootc_to_litter => pcf%hrv_livecrootc_to_litter - hrv_livecrootc_storage_to_litter => pcf%hrv_livecrootc_storage_to_litter - hrv_livecrootc_xfer_to_litter => pcf%hrv_livecrootc_xfer_to_litter - hrv_deadcrootc_to_litter => pcf%hrv_deadcrootc_to_litter - hrv_deadcrootc_storage_to_litter => pcf%hrv_deadcrootc_storage_to_litter - hrv_deadcrootc_xfer_to_litter => pcf%hrv_deadcrootc_xfer_to_litter - hrv_gresp_storage_to_litter => pcf%hrv_gresp_storage_to_litter - hrv_gresp_xfer_to_litter => pcf%hrv_gresp_xfer_to_litter - hrv_xsmrpool_to_atm => pcf%hrv_xsmrpool_to_atm - col_hrv_xsmrpool_to_atm => pcf_a%hrv_xsmrpool_to_atm - mr => pcf%mr - npp => pcf%npp - pft_fire_closs => pcf%pft_fire_closs - psnshade_to_cpool => pcf%psnshade_to_cpool - psnsun_to_cpool => pcf%psnsun_to_cpool - rr => pcf%rr - storage_gr => pcf%storage_gr - transfer_deadcroot_gr => pcf%transfer_deadcroot_gr - transfer_deadstem_gr => pcf%transfer_deadstem_gr - transfer_froot_gr => pcf%transfer_froot_gr - transfer_gr => pcf%transfer_gr - transfer_leaf_gr => pcf%transfer_leaf_gr - transfer_livecroot_gr => pcf%transfer_livecroot_gr - transfer_livestem_gr => pcf%transfer_livestem_gr - vegfire => pcf%vegfire - wood_harvestc => pcf%wood_harvestc - frootc_alloc => pcf%frootc_alloc - frootc_loss => pcf%frootc_loss - leafc_alloc => pcf%leafc_alloc - leafc_loss => pcf%leafc_loss - woodc_alloc => pcf%woodc_alloc - woodc_loss => pcf%woodc_loss - cpool => pcs%cpool - xsmrpool => pcs%xsmrpool - pft_ctrunc => pcs%pft_ctrunc - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - dispvegc => pcs%dispvegc - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - storvegc => pcs%storvegc - totpftc => pcs%totpftc - totvegc => pcs%totvegc - woodc => pcs%woodc - tempsum_npp => pepv%tempsum_npp - tempsum_litfall => pepv%tempsum_litfall - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! calculate pft-level summary carbon fluxes and states - - ! gross primary production (GPP) - gpp(p) = & - psnsun_to_cpool(p) + & - psnshade_to_cpool(p) - - ! maintenance respiration (MR) - mr(p) = & - leaf_mr(p) + & - froot_mr(p) + & - livestem_mr(p) + & - livecroot_mr(p) - - ! growth respiration (GR) - ! current GR is respired this time step for new growth displayed in this timestep - current_gr(p) = & - cpool_leaf_gr(p) + & - cpool_froot_gr(p) + & - cpool_livestem_gr(p) + & - cpool_deadstem_gr(p) + & - cpool_livecroot_gr(p) + & - cpool_deadcroot_gr(p) - - ! transfer GR is respired this time step for transfer growth displayed in this timestep - transfer_gr(p) = & - transfer_leaf_gr(p) + & - transfer_froot_gr(p) + & - transfer_livestem_gr(p) + & - transfer_deadstem_gr(p) + & - transfer_livecroot_gr(p) + & - transfer_deadcroot_gr(p) - - ! storage GR is respired this time step for growth sent to storage for later display - storage_gr(p) = & - cpool_leaf_storage_gr(p) + & - cpool_froot_storage_gr(p) + & - cpool_livestem_storage_gr(p) + & - cpool_deadstem_storage_gr(p) + & - cpool_livecroot_storage_gr(p) + & - cpool_deadcroot_storage_gr(p) - - ! GR is the sum of current + transfer + storage GR - gr(p) = & - current_gr(p) + & - transfer_gr(p) + & - storage_gr(p) - - ! autotrophic respiration (AR) - if ( ivt(p) >= npcropmin )then - ar(p) = mr(p) + gr(p) + xsmrpool_to_atm(p) ! xsmr... is -ve (slevis) - else - ar(p) = mr(p) + gr(p) - end if - - ! root respiration (RR) - rr(p) = & - froot_mr(p) + & - cpool_froot_gr(p) + & - cpool_livecroot_gr(p) + & - cpool_deadcroot_gr(p) + & - transfer_froot_gr(p) + & - transfer_livecroot_gr(p) + & - transfer_deadcroot_gr(p) + & - cpool_froot_storage_gr(p) + & - cpool_livecroot_storage_gr(p) + & - cpool_deadcroot_storage_gr(p) - - ! net primary production (NPP) - npp(p) = gpp(p) - ar(p) - - ! update the annual NPP accumulator, for use in allocation code - tempsum_npp(p) = tempsum_npp(p) + npp(p) - - ! aboveground NPP: leaf, live stem, dead stem (AGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of AGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - agnpp(p) = & - cpool_to_leafc(p) + & - leafc_xfer_to_leafc(p) + & - cpool_to_livestemc(p) + & - livestemc_xfer_to_livestemc(p) + & - cpool_to_deadstemc(p) + & - deadstemc_xfer_to_deadstemc(p) - - ! belowground NPP: fine root, live coarse root, dead coarse root (BGNPP) - ! This is supposed to correspond as closely as possible to - ! field measurements of BGNPP, so it ignores the storage pools - ! and only treats the fluxes into displayed pools. - bgnpp(p) = & - cpool_to_frootc(p) + & - frootc_xfer_to_frootc(p) + & - cpool_to_livecrootc(p) + & - livecrootc_xfer_to_livecrootc(p) + & - cpool_to_deadcrootc(p) + & - deadcrootc_xfer_to_deadcrootc(p) - - ! litterfall (LITFALL) - litfall(p) = & - leafc_to_litter(p) + & - frootc_to_litter(p) + & - m_leafc_to_litter(p) + & - m_leafc_storage_to_litter(p) + & - m_leafc_xfer_to_litter(p) + & - m_frootc_to_litter(p) + & - m_frootc_storage_to_litter(p) + & - m_frootc_xfer_to_litter(p) + & - m_livestemc_to_litter(p) + & - m_livestemc_storage_to_litter(p) + & - m_livestemc_xfer_to_litter(p) + & - m_deadstemc_to_litter(p) + & - m_deadstemc_storage_to_litter(p) + & - m_deadstemc_xfer_to_litter(p) + & - m_livecrootc_to_litter(p) + & - m_livecrootc_storage_to_litter(p) + & - m_livecrootc_xfer_to_litter(p) + & - m_deadcrootc_to_litter(p) + & - m_deadcrootc_storage_to_litter(p) + & - m_deadcrootc_xfer_to_litter(p) + & - m_gresp_storage_to_litter(p) + & - m_gresp_xfer_to_litter(p) + & - m_deadstemc_to_litter_fire(p) + & - m_deadcrootc_to_litter_fire(p) + & - hrv_leafc_to_litter(p) + & - hrv_leafc_storage_to_litter(p) + & - hrv_leafc_xfer_to_litter(p) + & - hrv_frootc_to_litter(p) + & - hrv_frootc_storage_to_litter(p) + & - hrv_frootc_xfer_to_litter(p) + & - hrv_livestemc_to_litter(p) + & - hrv_livestemc_storage_to_litter(p) + & - hrv_livestemc_xfer_to_litter(p) + & - hrv_deadstemc_storage_to_litter(p) + & - hrv_deadstemc_xfer_to_litter(p) + & - hrv_livecrootc_to_litter(p) + & - hrv_livecrootc_storage_to_litter(p)+ & - hrv_livecrootc_xfer_to_litter(p) + & - hrv_deadcrootc_to_litter(p) + & - hrv_deadcrootc_storage_to_litter(p)+ & - hrv_deadcrootc_xfer_to_litter(p) + & - hrv_gresp_storage_to_litter(p) + & - hrv_gresp_xfer_to_litter(p) - - if (use_cndv) then - ! update the annual litfall accumulator, for use in mortality code - tempsum_litfall(p) = tempsum_litfall(p) + leafc_to_litter(p) + frootc_to_litter(p) - end if - - ! pft-level fire losses (VEGFIRE) - vegfire(p) = 0._r8 - - ! pft-level wood harvest - wood_harvestc(p) = & - hrv_deadstemc_to_prod10c(p) + & - hrv_deadstemc_to_prod100c(p) - - ! pft-level carbon losses to fire - pft_fire_closs(p) = & - m_leafc_to_fire(p) + & - m_leafc_storage_to_fire(p) + & - m_leafc_xfer_to_fire(p) + & - m_frootc_to_fire(p) + & - m_frootc_storage_to_fire(p) + & - m_frootc_xfer_to_fire(p) + & - m_livestemc_to_fire(p) + & - m_livestemc_storage_to_fire(p) + & - m_livestemc_xfer_to_fire(p) + & - m_deadstemc_to_fire(p) + & - m_deadstemc_storage_to_fire(p) + & - m_deadstemc_xfer_to_fire(p) + & - m_livecrootc_to_fire(p) + & - m_livecrootc_storage_to_fire(p) + & - m_livecrootc_xfer_to_fire(p) + & - m_deadcrootc_to_fire(p) + & - m_deadcrootc_storage_to_fire(p) + & - m_deadcrootc_xfer_to_fire(p) + & - m_gresp_storage_to_fire(p) + & - m_gresp_xfer_to_fire(p) - - ! displayed vegetation carbon, excluding storage and cpool (DISPVEGC) - dispvegc(p) = & - leafc(p) + & - frootc(p) + & - livestemc(p) + & - deadstemc(p) + & - livecrootc(p) + & - deadcrootc(p) - - ! stored vegetation carbon, excluding cpool (STORVEGC) - storvegc(p) = & - cpool(p) + & - leafc_storage(p) + & - frootc_storage(p) + & - livestemc_storage(p) + & - deadstemc_storage(p) + & - livecrootc_storage(p) + & - deadcrootc_storage(p) + & - leafc_xfer(p) + & - frootc_xfer(p) + & - livestemc_xfer(p) + & - deadstemc_xfer(p) + & - livecrootc_xfer(p) + & - deadcrootc_xfer(p) + & - gresp_storage(p) + & - gresp_xfer(p) - - if ( crop_prog .and. ivt(p) >= nc3crop )then - current_gr(p) = current_gr(p) + & - cpool_grain_gr(p) - storvegc(p) = storvegc(p) + & - grainc_storage(p) + & - grainc_xfer(p) - transfer_gr(p) = transfer_gr(p) + & - transfer_grain_gr(p) - storage_gr(p) = storage_gr(p) + & - cpool_grain_storage_gr(p) - agnpp(p) = agnpp(p) + & - cpool_to_grainc(p) + & - grainc_xfer_to_grainc(p) - litfall(p) = litfall(p) + & - livestemc_to_litter(p) + & - grainc_to_food(p) - dispvegc(p) = dispvegc(p) + & - grainc(p) - end if - - ! total vegetation carbon, excluding cpool (TOTVEGC) - totvegc(p) = dispvegc(p) + storvegc(p) - - ! total pft-level carbon, including xsmrpool, ctrunc - totpftc(p) = totvegc(p) + xsmrpool(p) + pft_ctrunc(p) - - ! new summary variables for CLAMP - - ! (FROOTC_ALLOC) - fine root C allocation - frootc_alloc(p) = & - frootc_xfer_to_frootc(p) + & - cpool_to_frootc(p) - - ! (FROOTC_LOSS) - fine root C loss - frootc_loss(p) = & - m_frootc_to_litter(p) + & - m_frootc_to_fire(p) + & - hrv_frootc_to_litter(p) + & - frootc_to_litter(p) - - ! (LEAFC_ALLOC) - leaf C allocation - leafc_alloc(p) = & - leafc_xfer_to_leafc(p) + & - cpool_to_leafc(p) - - ! (LEAFC_LOSS) - leaf C loss - leafc_loss(p) = & - m_leafc_to_litter(p) + & - m_leafc_to_fire(p) + & - hrv_leafc_to_litter(p) + & - leafc_to_litter(p) - - ! (WOODC) - wood C - woodc(p) = & - deadstemc(p) + & - livestemc(p) + & - deadcrootc(p) + & - livecrootc(p) - - ! (WOODC_ALLOC) - wood C allocation - woodc_alloc(p) = & - livestemc_xfer_to_livestemc(p) + & - deadstemc_xfer_to_deadstemc(p) + & - livecrootc_xfer_to_livecrootc(p) + & - deadcrootc_xfer_to_deadcrootc(p) + & - cpool_to_livestemc(p) + & - cpool_to_deadstemc(p) + & - cpool_to_livecrootc(p) + & - cpool_to_deadcrootc(p) - - ! (WOODC_LOSS) - wood C loss - woodc_loss(p) = & - m_livestemc_to_litter(p) + & - m_deadstemc_to_litter(p) + & - m_livecrootc_to_litter(p) + & - m_deadcrootc_to_litter(p) + & - m_livestemc_to_fire(p) + & - m_deadstemc_to_fire(p) + & - m_livecrootc_to_fire(p) + & - m_deadcrootc_to_fire(p) + & - hrv_livestemc_to_litter(p) + & - hrv_livestemc_storage_to_litter(p) + & - hrv_livestemc_xfer_to_litter(p) + & - hrv_deadstemc_to_prod10c(p) + & - hrv_deadstemc_to_prod100c(p) + & - hrv_deadstemc_storage_to_litter(p) + & - hrv_deadstemc_xfer_to_litter(p) + & - hrv_livecrootc_to_litter(p) + & - hrv_livecrootc_storage_to_litter(p)+ & - hrv_livecrootc_xfer_to_litter(p) + & - hrv_deadcrootc_to_litter(p) + & - hrv_deadcrootc_storage_to_litter(p)+ & - hrv_deadcrootc_xfer_to_litter(p) - - end do ! end of pfts loop - - ! use p2c routine to get selected column-average pft-level fluxes and states - call p2c(num_soilc, filter_soilc, gpp, col_gpp) - call p2c(num_soilc, filter_soilc, ar, col_ar) - call p2c(num_soilc, filter_soilc, rr, col_rr) - call p2c(num_soilc, filter_soilc, npp, col_npp) - call p2c(num_soilc, filter_soilc, vegfire, col_vegfire) - call p2c(num_soilc, filter_soilc, wood_harvestc, col_wood_harvestc) - call p2c(num_soilc, filter_soilc, totvegc, col_totvegc) - call p2c(num_soilc, filter_soilc, totpftc, col_totpftc) - call p2c(num_soilc, filter_soilc, pft_fire_closs, col_pft_fire_closs) - call p2c(num_soilc, filter_soilc, litfall, col_litfall) - call p2c(num_soilc, filter_soilc, hrv_xsmrpool_to_atm, col_hrv_xsmrpool_to_atm) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! litter heterotrophic respiration (LITHR) - lithr(c) = & - litr1_hr(c) + & - litr2_hr(c) + & - litr3_hr(c) - - ! soil organic matter heterotrophic respiration (SOMHR) - somhr(c) = & - soil1_hr(c) + & - soil2_hr(c) + & - soil3_hr(c) + & - soil4_hr(c) - - ! total heterotrophic respiration (HR) - hr(c) = lithr(c) + somhr(c) - - ! total soil respiration, heterotrophic + root respiration (SR) - sr(c) = col_rr(c) + hr(c) - - ! total ecosystem respiration, autotrophic + heterotrophic (ER) - er(c) = col_ar(c) + hr(c) - - ! litter fire losses (LITFIRE) - litfire(c) = 0._r8 - - ! total wood product loss - product_closs(c) = & - prod10c_loss(c) + & - prod100c_loss(c) - - ! soil organic matter fire losses (SOMFIRE) - somfire(c) = 0._r8 - - ! total ecosystem fire losses (TOTFIRE) - totfire(c) = & - litfire(c) + & - somfire(c) + & - col_vegfire(c) - - ! column-level carbon losses to fire, including pft losses - col_fire_closs(c) = & - m_litr1c_to_fire(c) + & - m_litr2c_to_fire(c) + & - m_litr3c_to_fire(c) + & - m_cwdc_to_fire(c) + & - col_pft_fire_closs(c) - - ! column-level carbon losses due to landcover change - dwt_closs(c) = & - dwt_conv_cflux(c) - - ! net ecosystem production, excludes fire flux, landcover change, and loss from wood products, positive for sink (NEP) - nep(c) = col_gpp(c) - er(c) - - ! net biome production of carbon, includes depletion from: fire flux, landcover change flux, and loss - ! from wood products pools, positive for sink (NBP) - nbp(c) = nep(c) - col_fire_closs(c) - dwt_closs(c) - product_closs(c) - - ! net ecosystem exchange of carbon, includes fire flux, landcover change flux, loss - ! from wood products pools, and hrv_xsmrpool flux, positive for source (NEE) - nee(c) = -nep(c) + col_fire_closs(c) + dwt_closs(c) + product_closs(c) + col_hrv_xsmrpool_to_atm(c) - ! land use flux and land uptake - landuseflux(c) = dwt_closs(c) + product_closs(c) - landuptake(c) = nee(c) - landuseflux(c) - - ! total litter carbon (TOTLITC) - totlitc(c) = & - litr1c(c) + & - litr2c(c) + & - litr3c(c) - - ! total soil organic matter carbon (TOTSOMC) - totsomc(c) = & - soil1c(c) + & - soil2c(c) + & - soil3c(c) + & - soil4c(c) - - ! total wood product carbon - totprodc(c) = & - prod10c(c) + & - prod100c(c) - - ! total ecosystem carbon, including veg but excluding cpool (TOTECOSYSC) - totecosysc(c) = & - cwdc(c) + & - totlitc(c) + & - totsomc(c) + & - totprodc(c) + & - col_totvegc(c) - - ! total column carbon, including veg and cpool (TOTCOLC) - ! adding col_ctrunc, seedc - totcolc(c) = & - col_totpftc(c) + & - cwdc(c) + & - totlitc(c) + & - totsomc(c) + & - totprodc(c) + & - seedc(c) + & - col_ctrunc(c) - - ! new summary variables for CLAMP - - ! (CWDC_HR) - coarse woody debris heterotrophic respiration - cwdc_hr(c) = 0._r8 - - ! (CWDC_LOSS) - coarse woody debris C loss - cwdc_loss(c) = & - m_cwdc_to_fire(c) + & - cwdc_to_litr2c(c) + & - cwdc_to_litr3c(c) - - ! (LITTERC_LOSS) - litter C loss - litterc_loss(c) = & - lithr(c) + & - m_litr1c_to_fire(c) + & - m_litr2c_to_fire(c) + & - m_litr3c_to_fire(c) + & - litr1c_to_soil1c(c) + & - litr2c_to_soil2c(c) + & - litr3c_to_soil3c(c) - - end do ! end of columns loop - - -end subroutine CSummary -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: NSummary -! -! !INTERFACE: -subroutine NSummary(num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, perform pft and column-level nitrogen -! summary calculations -! -! !USES: - use clmtype - use pft2colMod, only: p2c -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 6/28/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: col_fire_nloss(:) ! (gN/m2/s) total column-level fire N loss - real(r8), pointer :: col_wood_harvestn(:) - real(r8), pointer :: denit(:) - real(r8), pointer :: m_cwdn_to_fire(:) - real(r8), pointer :: m_litr1n_to_fire(:) - real(r8), pointer :: m_litr2n_to_fire(:) - real(r8), pointer :: m_litr3n_to_fire(:) - real(r8), pointer :: col_pft_fire_nloss(:) ! (gN/m2/s) total pft-level fire C loss - real(r8), pointer :: sminn_to_denit_excess(:) - real(r8), pointer :: sminn_to_denit_l1s1(:) - real(r8), pointer :: sminn_to_denit_l2s2(:) - real(r8), pointer :: sminn_to_denit_l3s3(:) - real(r8), pointer :: sminn_to_denit_s1s2(:) - real(r8), pointer :: sminn_to_denit_s2s3(:) - real(r8), pointer :: sminn_to_denit_s3s4(:) - real(r8), pointer :: sminn_to_denit_s4(:) - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: col_totpftn(:) ! (gN/m2) total pft-level nitrogen - real(r8), pointer :: col_totvegn(:) ! (gN/m2) total vegetation nitrogen - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - real(r8), pointer :: soil1n(:) ! (gN/m2) soil organic matter N (fast pool) - real(r8), pointer :: soil2n(:) ! (gN/m2) soil organic matter N (medium pool) - real(r8), pointer :: soil3n(:) ! (gN/m2) soil orgainc matter N (slow pool) - real(r8), pointer :: soil4n(:) ! (gN/m2) soil orgainc matter N (slowest pool) - real(r8), pointer :: col_ntrunc(:) ! (gN/m2) column-level sink for N truncation - real(r8), pointer :: totcoln(:) ! (gN/m2) total column nitrogen, incl veg - real(r8), pointer :: totecosysn(:) ! (gN/m2) total ecosystem nitrogen, incl veg - real(r8), pointer :: totlitn(:) ! (gN/m2) total litter nitrogen - real(r8), pointer :: totsomn(:) ! (gN/m2) total soil organic matter nitrogen - real(r8), pointer :: m_deadcrootn_storage_to_fire(:) - real(r8), pointer :: m_deadcrootn_to_fire(:) - real(r8), pointer :: m_deadcrootn_xfer_to_fire(:) - real(r8), pointer :: m_deadstemn_storage_to_fire(:) - real(r8), pointer :: m_deadstemn_to_fire(:) - real(r8), pointer :: m_deadstemn_xfer_to_fire(:) - real(r8), pointer :: m_frootn_storage_to_fire(:) - real(r8), pointer :: m_frootn_to_fire(:) - real(r8), pointer :: m_frootn_xfer_to_fire(:) - real(r8), pointer :: m_leafn_storage_to_fire(:) - real(r8), pointer :: m_leafn_to_fire(:) - real(r8), pointer :: m_leafn_xfer_to_fire(:) - real(r8), pointer :: m_livecrootn_storage_to_fire(:) - real(r8), pointer :: m_livecrootn_to_fire(:) - real(r8), pointer :: m_livecrootn_xfer_to_fire(:) - real(r8), pointer :: m_livestemn_storage_to_fire(:) - real(r8), pointer :: m_livestemn_to_fire(:) - real(r8), pointer :: m_livestemn_xfer_to_fire(:) - real(r8), pointer :: m_retransn_to_fire(:) - real(r8), pointer :: hrv_deadstemn_to_prod10n(:) - real(r8), pointer :: hrv_deadstemn_to_prod100n(:) - real(r8), pointer :: ndeploy(:) - real(r8), pointer :: pft_fire_nloss(:) ! (gN/m2/s) total pft-level fire C loss - real(r8), pointer :: retransn_to_npool(:) - real(r8), pointer :: sminn_to_npool(:) - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: dispvegn(:) ! (gN/m2) displayed veg nitrogen, excluding storage - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: grainn(:) ! (gN/m2) grain N - real(r8), pointer :: grainn_storage(:) ! (gN/m2) grain N storage - real(r8), pointer :: grainn_xfer(:) ! (gN/m2) grain N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: npool(:) ! (gN/m2) temporary plant N pool - real(r8), pointer :: pft_ntrunc(:) ! (gN/m2) pft-level sink for N truncation - real(r8), pointer :: storvegn(:) ! (gN/m2) stored vegetation nitrogen - real(r8), pointer :: totpftn(:) ! (gN/m2) total pft-level nitrogen - real(r8), pointer :: totvegn(:) ! (gN/m2) total vegetation nitrogen - ! for landcover change - real(r8), pointer :: wood_harvestn(:) ! total N losses to wood product pools (gN/m2/s) - real(r8), pointer :: dwt_nloss(:) ! (gN/m2/s) total nitrogen loss from product pools and conversion - real(r8), pointer :: dwt_conv_nflux(:) ! (gN/m2/s) conversion N flux (immediate loss to atm) - real(r8), pointer :: seedn(:) ! (gN/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10n_loss(:) ! (gN/m2/s) loss from 10-yr wood product pool - real(r8), pointer :: prod100n_loss(:) ! (gN/m2/s) loss from 100-yr wood product pool - real(r8), pointer :: product_nloss(:) ! (gN/m2/s) total wood product nitrogen loss - real(r8), pointer :: prod10n(:) ! (gN/m2) wood product N pool, 10-year lifespan - real(r8), pointer :: prod100n(:) ! (gN/m2) wood product N pool, 100-year lifespan - real(r8), pointer :: totprodn(:) ! (gN/m2) total wood product N -! -! local pointers to implicit in/out scalars -! -! local pointers to implicit out scalars -! -! !OTHER LOCAL VARIABLES: - integer :: c,p ! indices - integer :: fp,fc ! lake filter indices - -!EOP -!----------------------------------------------------------------------- - ! assign local pointers - ivt => pft%itype - col_fire_nloss => cnf%col_fire_nloss - denit => cnf%denit - m_cwdn_to_fire => cnf%m_cwdn_to_fire - m_litr1n_to_fire => cnf%m_litr1n_to_fire - m_litr2n_to_fire => cnf%m_litr2n_to_fire - m_litr3n_to_fire => cnf%m_litr3n_to_fire - col_pft_fire_nloss => pnf_a%pft_fire_nloss - sminn_to_denit_excess => cnf%sminn_to_denit_excess - sminn_to_denit_l1s1 => cnf%sminn_to_denit_l1s1 - sminn_to_denit_l2s2 => cnf%sminn_to_denit_l2s2 - sminn_to_denit_l3s3 => cnf%sminn_to_denit_l3s3 - sminn_to_denit_s1s2 => cnf%sminn_to_denit_s1s2 - sminn_to_denit_s2s3 => cnf%sminn_to_denit_s2s3 - sminn_to_denit_s3s4 => cnf%sminn_to_denit_s3s4 - sminn_to_denit_s4 => cnf%sminn_to_denit_s4 - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - col_totpftn => pns_a%totpftn - col_totvegn => pns_a%totvegn - sminn => cns%sminn - col_ntrunc => cns%col_ntrunc - soil1n => cns%soil1n - soil2n => cns%soil2n - soil3n => cns%soil3n - soil4n => cns%soil4n - totcoln => cns%totcoln - totecosysn => cns%totecosysn - totlitn => cns%totlitn - totsomn => cns%totsomn - m_deadcrootn_storage_to_fire => pnf%m_deadcrootn_storage_to_fire - m_deadcrootn_to_fire => pnf%m_deadcrootn_to_fire - m_deadcrootn_xfer_to_fire => pnf%m_deadcrootn_xfer_to_fire - m_deadstemn_storage_to_fire => pnf%m_deadstemn_storage_to_fire - m_deadstemn_to_fire => pnf%m_deadstemn_to_fire - m_deadstemn_xfer_to_fire => pnf%m_deadstemn_xfer_to_fire - m_frootn_storage_to_fire => pnf%m_frootn_storage_to_fire - m_frootn_to_fire => pnf%m_frootn_to_fire - m_frootn_xfer_to_fire => pnf%m_frootn_xfer_to_fire - m_leafn_storage_to_fire => pnf%m_leafn_storage_to_fire - m_leafn_to_fire => pnf%m_leafn_to_fire - m_leafn_xfer_to_fire => pnf%m_leafn_xfer_to_fire - m_livecrootn_storage_to_fire => pnf%m_livecrootn_storage_to_fire - m_livecrootn_to_fire => pnf%m_livecrootn_to_fire - m_livecrootn_xfer_to_fire => pnf%m_livecrootn_xfer_to_fire - m_livestemn_storage_to_fire => pnf%m_livestemn_storage_to_fire - m_livestemn_to_fire => pnf%m_livestemn_to_fire - m_livestemn_xfer_to_fire => pnf%m_livestemn_xfer_to_fire - m_retransn_to_fire => pnf%m_retransn_to_fire - hrv_deadstemn_to_prod10n => pnf%hrv_deadstemn_to_prod10n - hrv_deadstemn_to_prod100n => pnf%hrv_deadstemn_to_prod100n - ndeploy => pnf%ndeploy - pft_fire_nloss => pnf%pft_fire_nloss - retransn_to_npool => pnf%retransn_to_npool - sminn_to_npool => pnf%sminn_to_npool - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - dispvegn => pns%dispvegn - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - grainn => pns%grainn - grainn_storage => pns%grainn_storage - grainn_xfer => pns%grainn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - retransn => pns%retransn - npool => pns%npool - pft_ntrunc => pns%pft_ntrunc - storvegn => pns%storvegn - totpftn => pns%totpftn - totvegn => pns%totvegn - ! dynamic landcover pointers - wood_harvestn => pnf%wood_harvestn - col_wood_harvestn => pnf_a%wood_harvestn - dwt_nloss => cnf%dwt_nloss - dwt_conv_nflux => cnf%dwt_conv_nflux - prod10n_loss => cnf%prod10n_loss - prod100n_loss => cnf%prod100n_loss - product_nloss => cnf%product_nloss - seedn => cns%seedn - prod10n => cns%prod10n - prod100n => cns%prod100n - totprodn => cns%totprodn - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - - ! calculate pft-level summary nitrogen fluxes and states - - ! total N deployment (from sminn and retranslocated N pool) (NDEPLOY) - ndeploy(p) = & - sminn_to_npool(p) + & - retransn_to_npool(p) - - ! pft-level wood harvest - wood_harvestn(p) = & - hrv_deadstemn_to_prod10n(p) + & - hrv_deadstemn_to_prod100n(p) - - ! total pft-level fire N losses - pft_fire_nloss(p) = & - m_leafn_to_fire(p) + & - m_leafn_storage_to_fire(p) + & - m_leafn_xfer_to_fire(p) + & - m_frootn_to_fire(p) + & - m_frootn_storage_to_fire(p) + & - m_frootn_xfer_to_fire(p) + & - m_livestemn_to_fire(p) + & - m_livestemn_storage_to_fire(p) + & - m_livestemn_xfer_to_fire(p) + & - m_deadstemn_to_fire(p) + & - m_deadstemn_storage_to_fire(p) + & - m_deadstemn_xfer_to_fire(p) + & - m_livecrootn_to_fire(p) + & - m_livecrootn_storage_to_fire(p) + & - m_livecrootn_xfer_to_fire(p) + & - m_deadcrootn_to_fire(p) + & - m_deadcrootn_storage_to_fire(p) + & - m_deadcrootn_xfer_to_fire(p) + & - m_retransn_to_fire(p) - - ! displayed vegetation nitrogen, excluding storage (DISPVEGN) - dispvegn(p) = & - leafn(p) + & - frootn(p) + & - livestemn(p) + & - deadstemn(p) + & - livecrootn(p) + & - deadcrootn(p) - - ! stored vegetation nitrogen, including retranslocated N pool (STORVEGN) - storvegn(p) = & - leafn_storage(p) + & - frootn_storage(p) + & - livestemn_storage(p) + & - deadstemn_storage(p) + & - livecrootn_storage(p) + & - deadcrootn_storage(p) + & - leafn_xfer(p) + & - frootn_xfer(p) + & - livestemn_xfer(p) + & - deadstemn_xfer(p) + & - livecrootn_xfer(p) + & - deadcrootn_xfer(p) + & - npool(p) + & - retransn(p) - - if ( crop_prog .and. ivt(p) >= nc3crop )then - dispvegn(p) = dispvegn(p) + & - grainn(p) - storvegn(p) = storvegn(p) + & - grainn_storage(p) + & - grainn_xfer(p) - end if - - ! total vegetation nitrogen (TOTVEGN) - totvegn(p) = dispvegn(p) + storvegn(p) - - ! total pft-level carbon (add pft_ntrunc) - totpftn(p) = totvegn(p) + pft_ntrunc(p) - - - end do ! end of pfts loop - - ! use p2c routine to get selected column-average pft-level fluxes and states - call p2c(num_soilc, filter_soilc, pft_fire_nloss, col_pft_fire_nloss) - call p2c(num_soilc, filter_soilc, wood_harvestn, col_wood_harvestn) - call p2c(num_soilc, filter_soilc, totvegn, col_totvegn) - call p2c(num_soilc, filter_soilc, totpftn, col_totpftn) - - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! total N denitrification (DENIT) - denit(c) = & - sminn_to_denit_l1s1(c) + & - sminn_to_denit_l2s2(c) + & - sminn_to_denit_l3s3(c) + & - sminn_to_denit_s1s2(c) + & - sminn_to_denit_s2s3(c) + & - sminn_to_denit_s3s4(c) + & - sminn_to_denit_s4(c) + & - sminn_to_denit_excess(c) - - ! total column-level fire N losses - col_fire_nloss(c) = & - m_litr1n_to_fire(c) + & - m_litr2n_to_fire(c) + & - m_litr3n_to_fire(c) + & - m_cwdn_to_fire(c) + & - col_pft_fire_nloss(c) - - ! column-level N losses due to landcover change - dwt_nloss(c) = & - dwt_conv_nflux(c) - - ! total wood product N loss - product_nloss(c) = & - prod10n_loss(c) + & - prod100n_loss(c) - - ! total litter nitrogen (TOTLITN) - totlitn(c) = & - litr1n(c) + & - litr2n(c) + & - litr3n(c) - - ! total soil organic matter nitrogen (TOTSOMN) - totsomn(c) = & - soil1n(c) + & - soil2n(c) + & - soil3n(c) + & - soil4n(c) - - ! total wood product nitrogen - totprodn(c) = & - prod10n(c) + & - prod100n(c) - - ! total ecosystem nitrogen, including veg (TOTECOSYSN) - totecosysn(c) = & - cwdn(c) + & - totlitn(c) + & - totsomn(c) + & - sminn(c) + & - totprodn(c) + & - col_totvegn(c) - - ! total column nitrogen, including pft (TOTCOLN) - totcoln(c) = & - col_totpftn(c) + & - cwdn(c) + & - totlitn(c) + & - totsomn(c) + & - sminn(c) + & - totprodn(c) + & - seedn(c) + & - col_ntrunc(c) - - end do ! end of columns loop - - -end subroutine NSummary -!----------------------------------------------------------------------- - -end module CNSummaryMod diff --git a/src_clm40/biogeochem/CNVegStructUpdateMod.F90 b/src_clm40/biogeochem/CNVegStructUpdateMod.F90 deleted file mode 100644 index 955f76ef7e..0000000000 --- a/src_clm40/biogeochem/CNVegStructUpdateMod.F90 +++ /dev/null @@ -1,317 +0,0 @@ -module CNVegStructUpdateMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNVegStructUpdateMod -! -! !DESCRIPTION: -! Module for vegetation structure updates (LAI, SAI, htop, hbot) -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public :: CNVegStructUpdate -! -! !REVISION HISTORY: -! 4/23/2004: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNVegStructUpdate -! -! !INTERFACE: -subroutine CNVegStructUpdate(num_soilp, filter_soilp) -! -! !DESCRIPTION: -! On the radiation time step, use C state variables and epc to diagnose -! vegetation structure (LAI, SAI, height) -! -! !USES: - use clmtype - use clm_atmlnd , only: clm_a2l - use pftvarcon , only: noveg, nc3crop, nirrig, nbrdlf_evr_shrub, nbrdlf_dcd_brl_shrub - use pftvarcon , only: ncorn, npcropmin, ztopmx, laimx - use clm_varctl , only: iulog, use_cndv - use shr_sys_mod , only: shr_sys_flush - use shr_const_mod, only: SHR_CONST_PI - use clm_time_manager , only : get_rad_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilp ! number of column soil points in pft filter - integer, intent(in) :: filter_soilp(:) ! pft filter for soil points -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 10/28/03: Created by Peter Thornton -! 2/29/08, David Lawrence: revised snow burial fraction for short vegetation -! -! !LOCAL VARIABLES: -! local pointers to implicit in scalars -! - real(r8), pointer :: allom2(:) ! ecophys const - real(r8), pointer :: allom3(:) ! ecophys const - real(r8), pointer :: nind(:) ! number of individuals (#/m**2) - real(r8), pointer :: fpcgrid(:) ! fractional area of pft (pft area/nat veg area) - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! column index associated with each pft - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: woody(:) !binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: slatop(:) !specific leaf area at top of canopy, projected area basis [m^2/gC] - real(r8), pointer :: dsladlai(:) !dSLA/dLAI, projected area basis [m^2/gC] - real(r8), pointer :: z0mr(:) !ratio of momentum roughness length to canopy top height (-) - real(r8), pointer :: displar(:) !ratio of displacement height to canopy top height (-) - real(r8), pointer :: forc_hgt_u_pft(:) ! observational height of wind at pft-level [m] - real(r8), pointer :: dwood(:) ! density of wood (gC/m^3) -! -! local pointers to implicit in/out scalars -! - integer , pointer :: frac_veg_nosno_alb(:) ! frac of vegetation not covered by snow [-] - real(r8), pointer :: tlai(:) !one-sided leaf area index, no burying by snow - real(r8), pointer :: tsai(:) !one-sided stem area index, no burying by snow - real(r8), pointer :: htop(:) !canopy top (m) - real(r8), pointer :: hbot(:) !canopy bottom (m) - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: htmx(:) ! max hgt attained by a crop during yr (m) - integer , pointer :: peaklai(:) ! 1: max allowed lai; 0: not at max - integer , pointer :: harvdate(:) ! harvest date -! -! local pointers to implicit out scalars -! -! -! !OTHER LOCAL VARIABLES: - integer :: p,c,g !indices - integer :: fp !lake filter indices - real(r8):: taper ! ratio of height:radius_breast_height (tree allometry) - real(r8):: stocking ! #stems / ha (stocking density) - real(r8):: ol ! thickness of canopy layer covered by snow (m) - real(r8):: fb ! fraction of canopy layer covered by snow - real(r8) :: tlai_old ! for use in Zeng tsai formula - real(r8) :: tsai_old ! for use in Zeng tsai formula - real(r8) :: tsai_min ! PFT derived minimum tsai - real(r8) :: tsai_alpha ! monthly decay rate of tsai - real(r8) dt ! radiation time step (sec) - - real(r8), parameter :: dtsmonth = 2592000._r8 ! number of seconds in a 30 day month (60x60x24x30) -!EOP -!----------------------------------------------------------------------- -! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835 -! -! tsai(p) = max( tsai_alpha(ivt(p))*tsai_old + max(tlai_old-tlai(p),0_r8), tsai_min(ivt(p)) ) -! notes: -! * RHS tsai & tlai are from previous timestep -! * should create tsai_alpha(ivt(p)) & tsai_min(ivt(p)) in pftvarcon.F90 - slevis -! * all non-crop pfts use same values: -! crop tsai_alpha,tsai_min = 0.0,0.1 -! noncrop tsai_alpha,tsai_min = 0.5,1.0 (includes bare soil and urban) -!------------------------------------------------------------------------------- - - ! assign local pointers to derived type arrays (in) - allom2 => dgv_pftcon%allom2 - allom3 => dgv_pftcon%allom3 - nind => pdgvs%nind - fpcgrid => pdgvs%fpcgrid - ivt => pft%itype - pcolumn => pft%column - pgridcell => pft%gridcell - leafc => pcs%leafc - deadstemc => pcs%deadstemc - snowdp => cps%snowdp - woody => pftcon%woody - slatop => pftcon%slatop - dsladlai => pftcon%dsladlai - z0mr => pftcon%z0mr - displar => pftcon%displar - dwood => pftcon%dwood - - ! assign local pointers to derived type arrays (out) - tlai => pps%tlai - tsai => pps%tsai - htop => pps%htop - hbot => pps%hbot - elai => pps%elai - esai => pps%esai - frac_veg_nosno_alb => pps%frac_veg_nosno_alb - htmx => pps%htmx - peaklai => pps%peaklai - harvdate => pps%harvdate - forc_hgt_u_pft => pps%forc_hgt_u_pft - - dt = real( get_rad_step_size(), r8 ) - - ! constant allometric parameters - taper = 200._r8 - stocking = 1000._r8 - - ! convert from stems/ha -> stems/m^2 - stocking = stocking / 10000._r8 - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - c = pcolumn(p) - g = pgridcell(p) - - if (ivt(p) /= noveg) then - - tlai_old = tlai(p) ! n-1 value - tsai_old = tsai(p) ! n-1 value - - ! update the leaf area index based on leafC and SLA - ! Eq 3 from Thornton and Zimmerman, 2007, J Clim, 20, 3902-3923. - if (dsladlai(ivt(p)) > 0._r8) then - tlai(p) = (slatop(ivt(p))*(exp(leafc(p)*dsladlai(ivt(p))) - 1._r8))/dsladlai(ivt(p)) - else - tlai(p) = slatop(ivt(p)) * leafc(p) - end if - tlai(p) = max(0._r8, tlai(p)) - - ! update the stem area index and height based on LAI, stem mass, and veg type. - ! With the exception of htop for woody vegetation, this follows the DGVM logic. - - ! tsai formula from Zeng et. al. 2002, Journal of Climate, p1835 (see notes) - ! Assumes doalb time step .eq. CLM time step, SAI min and monthly decay factor - ! alpha are set by PFT, and alpha is scaled to CLM time step by multiplying by - ! dt and dividing by dtsmonth (seconds in average 30 day month) - ! tsai_min scaled by 0.5 to match MODIS satellite derived values - if (ivt(p) == nc3crop .or. ivt(p) == nirrig) then ! generic crops - - tsai_alpha = 1.0_r8-1.0_r8*dt/dtsmonth - tsai_min = 0.1_r8 - else - tsai_alpha = 1.0_r8-0.5_r8*dt/dtsmonth - tsai_min = 1.0_r8 - end if - tsai_min = tsai_min * 0.5_r8 - tsai(p) = max(tsai_alpha*tsai_old+max(tlai_old-tlai(p),0._r8),tsai_min) - - if (woody(ivt(p)) == 1._r8) then - - ! trees and shrubs - - ! if shrubs have a squat taper - if (ivt(p) >= nbrdlf_evr_shrub .and. ivt(p) <= nbrdlf_dcd_brl_shrub) then - taper = 10._r8 - ! otherwise have a tall taper - else - taper = 200._r8 - end if - - ! trees and shrubs for now have a very simple allometry, with hard-wired - ! stem taper (height:radius) and hard-wired stocking density (#individuals/area) - if (use_cndv) then - if (fpcgrid(p) > 0._r8 .and. nind(p) > 0._r8) then - stocking = nind(p)/fpcgrid(p) !#ind/m2 nat veg area -> #ind/m2 pft area - ! lpj's htop w/ cn's stemdiam - htop(p) = allom2(ivt(p)) * ( (24._r8 * deadstemc(p) / & - (SHR_CONST_PI * stocking * dwood(ivt(p)) * taper))**(1._r8/3._r8) )**allom3(ivt(p)) - else - htop(p) = 0._r8 - end if - else - htop(p) = ((3._r8 * deadstemc(p) * taper * taper)/ & - (SHR_CONST_PI * stocking * dwood(ivt(p))))**(1._r8/3._r8) - end if - - ! Peter Thornton, 5/3/2004 - ! Adding test to keep htop from getting too close to forcing height for windspeed - ! Also added for grass, below, although it is not likely to ever be an issue. - htop(p) = min(htop(p),(forc_hgt_u_pft(p)/(displar(ivt(p))+z0mr(ivt(p))))-3._r8) - - ! Peter Thornton, 8/11/2004 - ! Adding constraint to keep htop from going to 0.0. - ! This becomes an issue when fire mortality is pushing deadstemc - ! to 0.0. - htop(p) = max(htop(p), 0.01_r8) - - hbot(p) = max(0._r8, min(3._r8, htop(p)-1._r8)) - - else if (ivt(p) >= npcropmin) then ! prognostic crops - - if (tlai(p) >= laimx(ivt(p))) peaklai(p) = 1 ! used in CNAllocation - - if (ivt(p) == ncorn) then - tsai(p) = 0.1_r8 * tlai(p) - else - tsai(p) = 0.2_r8 * tlai(p) - end if - - ! "stubble" after harvest - if (harvdate(p) < 999 .and. tlai(p) == 0._r8) then - tsai(p) = 0.25_r8 - htmx(p) = 0._r8 - peaklai(p) = 0 - end if - !if (harvdate(p) < 999 .and. tlai(p) > 0._r8) write(iulog,*) 'CNVegStructUpdate: tlai>0 after harvest!' ! remove after initial debugging? - - ! canopy top and bottom heights - htop(p) = ztopmx(ivt(p)) * (min(tlai(p)/(laimx(ivt(p))-1._r8),1._r8))**2 - htmx(p) = max(htmx(p), htop(p)) - htop(p) = max(0.05_r8, max(htmx(p),htop(p))) - hbot(p) = 0.02_r8 - else ! generic crops and ... - ! grasses - - ! height for grasses depends only on LAI - htop(p) = max(0.25_r8, tlai(p) * 0.25_r8) - - htop(p) = min(htop(p),(forc_hgt_u_pft(p)/(displar(ivt(p))+z0mr(ivt(p))))-3._r8) - - ! Peter Thornton, 8/11/2004 - ! Adding constraint to keep htop from going to 0.0. - htop(p) = max(htop(p), 0.01_r8) - - hbot(p) = max(0.0_r8, min(0.05_r8, htop(p)-0.20_r8)) - end if - - else - tlai(p) = 0._r8 - tsai(p) = 0._r8 - htop(p) = 0._r8 - hbot(p) = 0._r8 - end if - - ! adjust lai and sai for burying by snow. - - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. - if (ivt(p) > noveg .and. ivt(p) <= nbrdlf_dcd_brl_shrub ) then - ol = min( max(snowdp(c)-hbot(p), 0._r8), htop(p)-hbot(p)) - fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) - else - fb = 1._r8 - max(min(snowdp(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed - !depth of snow required for complete burial of grasses - endif - - elai(p) = max(tlai(p)*fb, 0.0_r8) - esai(p) = max(tsai(p)*fb, 0.0_r8) - - ! Fraction of vegetation free of snow - if ((elai(p) + esai(p)) > 0._r8) then - frac_veg_nosno_alb(p) = 1 - else - frac_veg_nosno_alb(p) = 0 - end if - - end do - -end subroutine CNVegStructUpdate -!----------------------------------------------------------------------- - -end module CNVegStructUpdateMod diff --git a/src_clm40/biogeochem/CNWoodProductsMod.F90 b/src_clm40/biogeochem/CNWoodProductsMod.F90 deleted file mode 100644 index 7bcc54b24d..0000000000 --- a/src_clm40/biogeochem/CNWoodProductsMod.F90 +++ /dev/null @@ -1,138 +0,0 @@ -module CNWoodProductsMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNWoodProductsMod -! -! !DESCRIPTION: -! Calculate loss fluxes from wood products pools, and update product pool state variables -! -! !USES: - use decompMod , only : get_proc_bounds - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varcon , only: istsoil - use spmdMod , only: masterproc - implicit none - save - private -! !PUBLIC MEMBER FUNCTIONS: - public:: CNWoodProducts -! -! !REVISION HISTORY: -! 5/20/2009: Created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNWoodProducts -! -! !INTERFACE: -subroutine CNWoodProducts(num_soilc, filter_soilc) -! -! !DESCRIPTION: -! Update all loss fluxes from wood product pools, and update product pool state variables -! for both loss and gain terms. Gain terms are calculated in pftdyn_cnbal() for gains associated -! with changes in landcover, and in CNHarvest(), for gains associated with wood harvest. -! -! !USES: - use clmtype - use clm_time_manager, only: get_step_size - use clm_varctl, only : use_c13 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! filter for soil columns -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 5/21/09: Created by Peter Thornton -! -! !LOCAL VARIABLES: - - integer :: fc ! lake filter indices - integer :: c ! indices - real(r8):: dt ! time step (seconds) - type(column_type), pointer :: cptr ! pointer to column derived subtype - real(r8) :: kprod10 ! decay constant for 10-year product pool - real(r8) :: kprod100 ! decay constant for 100-year product pool - -!EOP -!----------------------------------------------------------------------- - - cptr => col - - ! calculate column-level losses from product pools - ! the following (1/s) rate constants result in ~90% loss of initial state over 10 and 100 years, - ! respectively, using a discrete-time fractional decay algorithm. - kprod10 = 7.2e-9 - kprod100 = 7.2e-10 - - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! calculate fluxes (1/sec) - ccf%prod10c_loss(c) = ccs%prod10c(c) * kprod10 - ccf%prod100c_loss(c) = ccs%prod100c(c) * kprod100 - if (use_c13) then - cc13f%prod10c_loss(c) = cc13s%prod10c(c) * kprod10 - cc13f%prod100c_loss(c) = cc13s%prod100c(c) * kprod100 - end if - cnf%prod10n_loss(c) = cns%prod10n(c) * kprod10 - cnf%prod100n_loss(c) = cns%prod100n(c) * kprod100 - end do - - ! set time steps - dt = real( get_step_size(), r8 ) - - ! update wood product state variables - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - ! column-level fluxes - - ! fluxes into wood product pools, from landcover change - ccs%prod10c(c) = ccs%prod10c(c) + ccf%dwt_prod10c_gain(c)*dt - ccs%prod100c(c) = ccs%prod100c(c) + ccf%dwt_prod100c_gain(c)*dt - if (use_c13) then - cc13s%prod10c(c) = cc13s%prod10c(c) + cc13f%dwt_prod10c_gain(c)*dt - cc13s%prod100c(c) = cc13s%prod100c(c) + cc13f%dwt_prod100c_gain(c)*dt - end if - cns%prod10n(c) = cns%prod10n(c) + cnf%dwt_prod10n_gain(c)*dt - cns%prod100n(c) = cns%prod100n(c) + cnf%dwt_prod100n_gain(c)*dt - - ! fluxes into wood product pools, from harvest - ccs%prod10c(c) = ccs%prod10c(c) + ccf%hrv_deadstemc_to_prod10c(c)*dt - ccs%prod100c(c) = ccs%prod100c(c) + ccf%hrv_deadstemc_to_prod100c(c)*dt - if (use_c13) then - cc13s%prod10c(c) = cc13s%prod10c(c) + cc13f%hrv_deadstemc_to_prod10c(c)*dt - cc13s%prod100c(c) = cc13s%prod100c(c) + cc13f%hrv_deadstemc_to_prod100c(c)*dt - end if - cns%prod10n(c) = cns%prod10n(c) + cnf%hrv_deadstemn_to_prod10n(c)*dt - cns%prod100n(c) = cns%prod100n(c) + cnf%hrv_deadstemn_to_prod100n(c)*dt - - ! fluxes out of wood product pools, from decomposition - ccs%prod10c(c) = ccs%prod10c(c) - ccf%prod10c_loss(c)*dt - ccs%prod100c(c) = ccs%prod100c(c) - ccf%prod100c_loss(c)*dt - if (use_c13) then - cc13s%prod10c(c) = cc13s%prod10c(c) - cc13f%prod10c_loss(c)*dt - cc13s%prod100c(c) = cc13s%prod100c(c) - cc13f%prod100c_loss(c)*dt - end if - cns%prod10n(c) = cns%prod10n(c) - cnf%prod10n_loss(c)*dt - cns%prod100n(c) = cns%prod100n(c) - cnf%prod100n_loss(c)*dt - - end do ! end of column loop - -end subroutine CNWoodProducts -!----------------------------------------------------------------------- - -end module CNWoodProductsMod diff --git a/src_clm40/biogeochem/CNrestMod.F90 b/src_clm40/biogeochem/CNrestMod.F90 deleted file mode 100644 index c22e5b48cd..0000000000 --- a/src_clm40/biogeochem/CNrestMod.F90 +++ /dev/null @@ -1,2339 +0,0 @@ -module CNrestMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CNrestMod -! -! !DESCRIPTION: -! Read/Write to/from CN info to CLM restart file. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use abortutils , only : endrun -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: CNrest -! -! !REVISION HISTORY: -! 11/05/03: Module created by Peter Thornton -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNRest -! -! !INTERFACE: - subroutine CNRest ( ncid, flag ) -! -! !DESCRIPTION: -! Read/write CN restart data -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varpar , only : numrad - use clm_varctl , only : use_c13, use_cndv, use_exit_spinup - use decompMod , only : get_proc_bounds - use clm_time_manager, only : is_restart - use ncdio_pio -! -! !ARGUMENTS: - implicit none - type(file_desc_t) :: ncid ! netcdf id - character(len=*), intent(in) :: flag !'read' or 'write' -! -! !CALLED FROM: -! subroutine restart in module restFileMod -! -! !REVISION HISTORY: -! Author: Peter Thornton -! -! -! !LOCAL VARIABLES: -!EOP - integer :: c,p,j ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - real(r8):: m ! multiplier for the exit_spinup code - logical :: readvar ! determine if variable is on initial file - character(len=128) :: varname ! temporary - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - integer , pointer :: iptemp(:) ! pointer to memory to be allocated - integer :: ier ! error status -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ! Determine necessary subgrid bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - !-------------------------------- - ! pft ecophysiological variables - !-------------------------------- - - ! dormant_flag - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='dormant_flag', xtype=ncd_double, & - dim1name='pft',long_name='dormancy flag',units='unitless' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='dormant_flag', data=pepv%dormant_flag, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! days_active - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='days_active', xtype=ncd_double, & - dim1name='pft',long_name='number of days since last dormancy',units='days' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='days_active', data=pepv%days_active, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_flag - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_flag', xtype=ncd_double, & - dim1name='pft',long_name='flag if critical growing degree-day sum is exceeded',units='unitless' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_flag', data=pepv%onset_flag, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_counter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_counter', xtype=ncd_double, & - dim1name='pft',long_name='onset days counter',units='sec' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_counter', data=pepv%onset_counter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_gddflag - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_gddflag', xtype=ncd_double, & - dim1name='pft',long_name='onset flag for growing degree day sum',units='' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_gddflag', data=pepv%onset_gddflag, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_fdd - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_fdd', xtype=ncd_double, & - dim1name='pft',long_name='onset freezing degree days counter',units='days' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_fdd', data=pepv%onset_fdd, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_gdd - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_gdd', xtype=ncd_double, & - dim1name='pft',long_name='onset growing degree days',units='days' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_gdd', data=pepv%onset_gdd, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! onset_swi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='onset_swi', xtype=ncd_double, & - dim1name='pft',long_name='onset soil water index',units='days' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='onset_swi', data=pepv%onset_swi, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! offset_flag - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='offset_flag', xtype=ncd_double, & - dim1name='pft',long_name='offset flag',units='unitless' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='offset_flag', data=pepv%offset_flag, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! offset_counter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='offset_counter', xtype=ncd_double, & - dim1name='pft',long_name='offset days counter',units='sec' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='offset_counter', data=pepv%offset_counter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! offset_fdd - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='offset_fdd', xtype=ncd_double, & - dim1name='pft',long_name='offset freezing degree days counter',units='days' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='offset_fdd', data=pepv%offset_fdd, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! offset_swi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='offset_swi', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='offset_swi', data=pepv%offset_swi, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! lgsf - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='lgsf', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='lgsf', data=pepv%lgsf, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! bglfr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='bglfr', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='bglfr', data=pepv%bglfr, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! bgtr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='bgtr', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='bgtr', data=pepv%bgtr, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! dayl - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='dayl', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='dayl', data=pepv%dayl, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prev_dayl - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prev_dayl', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prev_dayl', data=pepv%prev_dayl, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! annavg_t2m - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annavg_t2m', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annavg_t2m', data=pepv%annavg_t2m, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! tempavg_t2m - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tempavg_t2m', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tempavg_t2m', data=pepv%tempavg_t2m, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gpp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gpp_pepv', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gpp_pepv', data=pepv%gpp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! availc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='availc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='availc', data=pepv%availc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! xsmrpool_recover - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='xsmrpool_recover', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='xsmrpool_recover', data=pepv%xsmrpool_recover, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - - if (use_c13) then - ! xsmrpool_c13ratio - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='xsmrpool_c13ratio', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='xsmrpool_c13ratio', data=pepv%xsmrpool_c13ratio, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - end if - - ! alloc_pnow - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='alloc_pnow', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='alloc_pnow', data=pepv%alloc_pnow, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! c_allometry - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='c_allometry', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='c_allometry', data=pepv%c_allometry, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! n_allometry - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='n_allometry', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='n_allometry', data=pepv%n_allometry, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! plant_ndemand - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='plant_ndemand', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='plant_ndemand', data=pepv%plant_ndemand, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! tempsum_potential_gpp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tempsum_potential_gpp', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tempsum_potential_gpp', data=pepv%tempsum_potential_gpp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !annsum_potential_gpp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annsum_potential_gpp', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annsum_potential_gpp', data=pepv%annsum_potential_gpp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! tempmax_retransn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tempmax_retransn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tempmax_retransn', data=pepv%tempmax_retransn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! annmax_retransn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annmax_retransn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annmax_retransn', data=pepv%annmax_retransn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! avail_retransn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='avail_retransn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='avail_retransn', data=pepv%avail_retransn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! plant_nalloc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='plant_nalloc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='plant_nalloc', data=pepv%plant_nalloc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! plant_calloc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='plant_calloc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='plant_calloc', data=pepv%plant_calloc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! excess_cflux - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='excess_cflux', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='excess_cflux', data=pepv%excess_cflux, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! downreg - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='downreg', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='downreg', data=pepv%downreg, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prev_leafc_to_litter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prev_leafc_to_litter', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prev_leafc_to_litter', data=pepv%prev_leafc_to_litter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prev_frootc_to_litter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prev_frootc_to_litter', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prev_frootc_to_litter', data=pepv%prev_frootc_to_litter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! tempsum_npp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tempsum_npp', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tempsum_npp', data=pepv%tempsum_npp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! annsum_npp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annsum_npp', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annsum_npp', data=pepv%annsum_npp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - if (use_c13) then - ! rc13_canair - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='rc13_canair', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='rc13_canair', data=pepv%rc13_canair, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! rc13_psnsun - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='rc13_psnsun', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='rc13_psnsun', data=pepv%rc13_psnsun, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! rc13_psnsha - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='rc13_psnsha', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='rc13_psnsha', data=pepv%rc13_psnsha, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - end if - - !-------------------------------- - ! pft carbon state variables - !-------------------------------- - - ! leafc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc', data=pcs%leafc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc_storage', data=pcs%leafc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc_xfer', data=pcs%leafc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc', data=pcs%frootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc_storage', data=pcs%frootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !frootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc_xfer', data=pcs%frootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc', data=pcs%livestemc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_storage', data=pcs%livestemc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_xfer', data=pcs%livestemc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc', data=pcs%deadstemc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc_storage', data=pcs%deadstemc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc_xfer', data=pcs%deadstemc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc', data=pcs%livecrootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc_storage', data=pcs%livecrootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc_xfer', data=pcs%livecrootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc', data=pcs%deadcrootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc_storage', data=pcs%deadcrootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc_xfer', data=pcs%deadcrootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gresp_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gresp_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gresp_storage', data=pcs%gresp_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gresp_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gresp_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gresp_xfer', data=pcs%gresp_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool', data=pcs%cpool, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! xsmrpool - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='xsmrpool', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='xsmrpool', data=pcs%xsmrpool, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! pft_ctrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='pft_ctrunc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='pft_ctrunc', data=pcs%pft_ctrunc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totvegc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totvegc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totvegc', data=pcs%totvegc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - if (use_c13) then - !-------------------------------- - ! C13 pft carbon state variables - !-------------------------------- - - ! leafc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc_13', data=pc13s%leafc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc_storage_13', data=pc13s%leafc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafc_xfer_13', data=pc13s%leafc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc_13', data=pc13s%frootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc_storage_13', data=pc13s%frootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !frootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootc_xfer_13', data=pc13s%frootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_13', data=pc13s%livestemc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_storage_13', data=pc13s%livestemc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_xfer_13', data=pc13s%livestemc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc_13', data=pc13s%deadstemc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc_storage_13', data=pc13s%deadstemc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemc_xfer_13', data=pc13s%deadstemc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc_13', data=pc13s%livecrootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc_storage_13', data=pc13s%livecrootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootc_xfer_13', data=pc13s%livecrootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc_13', data=pc13s%deadcrootc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc_storage_13', data=pc13s%deadcrootc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootc_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootc_xfer_13', data=pc13s%deadcrootc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gresp_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gresp_storage_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gresp_storage_13', data=pc13s%gresp_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gresp_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gresp_xfer_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gresp_xfer_13', data=pc13s%gresp_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool_13', data=pc13s%cpool, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! xsmrpool - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='xsmrpool_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='xsmrpool_13', data=pc13s%xsmrpool, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! pft_ctrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='pft_ctrunc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='pft_ctrunc_13', data=pc13s%pft_ctrunc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totvegc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totvegc_13', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totvegc_13', data=pc13s%totvegc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - end if - - !-------------------------------- - ! pft nitrogen state variables - !-------------------------------- - - ! leafn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafn', data=pns%leafn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafn_storage', data=pns%leafn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! leafn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafn_xfer', data=pns%leafn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootn', data=pns%frootn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootn_storage', data=pns%frootn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! frootn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frootn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frootn_xfer', data=pns%frootn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemn', data=pns%livestemn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemn_storage', data=pns%livestemn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemn_xfer', data=pns%livestemn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadstemn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemn', data=pns%deadstemn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !deadstemn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemn_storage', data=pns%deadstemn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !deadstemn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadstemn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadstemn_xfer', data=pns%deadstemn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootn', data=pns%livecrootn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livecrootn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootn_storage', data=pns%livecrootn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !livecrootn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livecrootn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livecrootn_xfer', data=pns%livecrootn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootn', data=pns%deadcrootn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootn_storage', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootn_storage', data=pns%deadcrootn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! deadcrootn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='deadcrootn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='deadcrootn_xfer', data=pns%deadcrootn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !retransn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='retransn', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='retransn', data=pns%retransn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! npool - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='npool', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='npool', data=pns%npool, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! pft_ntrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='pft_ntrunc', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='pft_ntrunc', data=pns%pft_ntrunc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !-------------------------------- - ! column physical state variables - !-------------------------------- - - ! decl - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='decl', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='decl', data=cps%decl, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fpi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fpi', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fpi', data=cps%fpi, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fpg - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fpg', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fpg', data=cps%fpg, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! annsum_counter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annsum_counter', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annsum_counter', data=cps%annsum_counter, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cannsum_npp - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cannsum_npp', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cannsum_npp', data=cps%cannsum_npp, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cannavg_t2m - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cannavg_t2m', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cannavg_t2m', data=cps%cannavg_t2m, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! wf - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='wf', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='wf', data=cps%wf, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! me - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='me', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='me', data=cps%me, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fire_prob - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fire_prob', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fire_prob', data=cps%fire_prob, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! mean_fire_prob - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mean_fire_prob', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mean_fire_prob', data=cps%mean_fire_prob, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fireseasonl - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fireseasonl', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fireseasonl', data=cps%fireseasonl, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! farea_burned - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='farea_burned', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='farea_burned', data=cps%farea_burned, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! ann_farea_burned - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ann_farea_burned', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='ann_farea_burned', data=cps%ann_farea_burned, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !-------------------------------- - ! column carbon state variables - !-------------------------------- - - ! cwdc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cwdc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cwdc', data=ccs%cwdc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr1c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr1c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr1c', data=ccs%litr1c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !litr2c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr2c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr2c', data=ccs%litr2c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr3c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr3c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr3c', data=ccs%litr3c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !soil1c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil1c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil1c', data=ccs%soil1c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil2c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil2c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil2c', data=ccs%soil2c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil3c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil3c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil3c', data=ccs%soil3c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil4c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil4c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil4c', data=ccs%soil4c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! seedc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='seedc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='seedc', data=ccs%seedc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! col_ctrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='col_ctrunc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='col_ctrunc', data=ccs%col_ctrunc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totlitc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totlitc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totlitc', data=ccs%totlitc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totcolc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totcolc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totcolc', data=ccs%totcolc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod10c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod10c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod10c', data=ccs%prod10c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod100c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod100c', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod100c', data=ccs%prod100c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - if (use_c13) then - !-------------------------------- - ! C13 column carbon state variables - !-------------------------------- - - ! cwdc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cwdc_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cwdc_13', data=cc13s%cwdc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr1c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr1c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr1c_13', data=cc13s%litr1c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !litr2c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr2c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr2c_13', data=cc13s%litr2c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr3c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr3c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr3c_13', data=cc13s%litr3c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !soil1c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil1c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil1c_13', data=cc13s%soil1c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil2c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil2c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil2c_13', data=cc13s%soil2c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil3c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil3c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil3c_13', data=cc13s%soil3c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil4c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil4c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil4c_13', data=cc13s%soil4c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! seedc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='seedc_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='seedc_13', data=cc13s%seedc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! col_ctrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='col_ctrunc_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='col_ctrunc_13', data=cc13s%col_ctrunc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totlitc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totlitc_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totlitc_13', data=cc13s%totlitc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totcolc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totcolc_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totcolc_13', data=cc13s%totcolc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod10c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod10c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod10c_13', data=cc13s%prod10c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod100c - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod100c_13', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod100c_13', data=cc13s%prod100c, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - end if - - !-------------------------------- - ! column nitrogen state variables - !-------------------------------- - - ! cwdn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cwdn', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cwdn', data=cns%cwdn, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - !litr1n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr1n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr1n', data=cns%litr1n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr2n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr2n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr2n', data=cns%litr2n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! litr3n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='litr3n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='litr3n', data=cns%litr3n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil1n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil1n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil1n', data=cns%soil1n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil2n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil2n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil2n', data=cns%soil2n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil3n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil3n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil3n', data=cns%soil3n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! soil4n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='soil4n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='soil4n', data=cns%soil4n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! sminn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sminn', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sminn', data=cns%sminn, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! col_ntrunc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='col_ntrunc', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='col_ntrunc', data=cns%col_ntrunc, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! totcoln - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='totcoln', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='totcoln', data=cns%totcoln, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! seedn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='seedn', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='seedn', data=cns%seedn, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod10n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod10n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod10n', data=cns%prod10n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! prod100n - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='prod100n', xtype=ncd_double, & - dim1name='column',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='prod100n', data=cns%prod100n, & - dim1name=namec, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - if (use_exit_spinup) then - if (flag == 'read') then - m = 20._r8 - do c = begc, endc - ccs%soil1c(c) = ccs%soil1c(c) * m - ccs%soil2c(c) = ccs%soil2c(c) * m - ccs%soil3c(c) = ccs%soil3c(c) * m - ccs%soil4c(c) = ccs%soil4c(c) * m - if (use_c13) then - ! adding code for 13C, 12/25/05, PET - cc13s%soil1c(c) = cc13s%soil1c(c) * m - cc13s%soil2c(c) = cc13s%soil2c(c) * m - cc13s%soil3c(c) = cc13s%soil3c(c) * m - cc13s%soil4c(c) = cc13s%soil4c(c) * m - end if - cns%soil1n(c) = cns%soil1n(c) * m - cns%soil2n(c) = cns%soil2n(c) * m - cns%soil3n(c) = cns%soil3n(c) * m - cns%soil4n(c) = cns%soil4n(c) * m - end do - end if - end if - - if (use_cndv) then - ! pft type dgvm physical state - crownarea - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='CROWNAREA', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='CROWNAREA', data=pdgvs%crownarea, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! tempsum_litfall - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tempsum_litfall', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tempsum_litfall', data=pepv%tempsum_litfall, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! annsum_litfall - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='annsum_litfall', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='annsum_litfall', data=pepv%annsum_litfall, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! nind - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='nind', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='nind', data=pdgvs%nind, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fpcgrid - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fpcgrid', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fpcgrid', data=pdgvs%fpcgrid, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! fpcgridold - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fpcgridold', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fpcgridold', data=pdgvs%fpcgridold, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gridcell type dgvm physical state - tmomin20 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='TMOMIN20', xtype=ncd_double, & - dim1name='gridcell',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='TMOMIN20', data=gdgvs%tmomin20, & - dim1name=nameg, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gridcell type dgvm physical state - agdd20 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='AGDD20', xtype=ncd_double, & - dim1name='gridcell',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='AGDD20', data=gdgvs%agdd20, & - dim1name=nameg, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! pft type dgvm physical state - t_mo_min - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_MO_MIN', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_MO_MIN', data=pdgvs%t_mo_min, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! present - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='present', xtype=ncd_int, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - allocate (iptemp(begp:endp), stat=ier) - if (ier /= 0) then - call endrun('CNrest: allocation error ') - end if - if (flag == 'write') then - do p = begp,endp - iptemp(p) = 0 - if (pdgvs%present(p)) iptemp(p) = 1 - end do - end if - call ncd_io(varname='present', data=iptemp, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read') then - if (.not. readvar) then - if (is_restart()) call endrun - else - do p = begp,endp - pdgvs%present(p) = .false. - if (iptemp(p) == 1) pdgvs%present(p) = .true. - end do - end if - end if - deallocate (iptemp) - end if - - ! leafcmax - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='leafcmax', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='leafcmax', data=pcs%leafcmax, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! heatstress - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='heatstress', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='heatstress', data=pdgvs%heatstress, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! greffic - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='greffic', xtype=ncd_double, & - dim1name='pft',long_name='',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='greffic', data=pdgvs%greffic, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - end if - - end subroutine CNRest - -end module CNrestMod - diff --git a/src_clm40/biogeochem/CropRestMod.F90 b/src_clm40/biogeochem/CropRestMod.F90 deleted file mode 100644 index d9a5df20cd..0000000000 --- a/src_clm40/biogeochem/CropRestMod.F90 +++ /dev/null @@ -1,744 +0,0 @@ -module CropRestMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: CropRestMod -! -! !DESCRIPTION: -! Read/Write to/from Crop info to CLM restart file. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use abortutils , only : endrun -! -! !PUBLIC TYPES: - implicit none - private - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: CropRest ! Restart prognostic crop model - public :: CropRestYear ! Get the number of years crop has spunup - public :: CropRestIncYear ! Increment the crop spinup years -! -! !REVISION HISTORY: -! Module created by slevis following CNRestMod by Peter Thornton -! - -! !PRIVATE DATA MEMBERS: - integer :: restyear = 0 ! Restart year from the initial conditions file, incremented as time elapses - -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CropRest -! -! !INTERFACE: - subroutine CropRest ( ncid, flag ) -! -! !DESCRIPTION: -! Read/write Crop restart data -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varpar , only : numrad - use decompMod , only : get_proc_bounds - use clm_time_manager, only : is_restart - use ncdio_pio -! -! !ARGUMENTS: - implicit none - type(file_desc_t) :: ncid ! netcdf id - character(len=*), intent(in) :: flag !'read' or 'write' -! -! !CALLED FROM: -! subroutine restart in module restFileMod -! -! !REVISION HISTORY: -! Author: slevis -! -!EOP -! -! !LOCAL VARIABLES: - integer :: c,p,j ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - real(r8):: m ! multiplier for the exit_spinup code - logical :: readvar ! determine if variable is on initial file - character(len=128) :: varname ! temporary - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - integer , pointer :: iptemp(:) ! pointer to memory to be allocated - integer :: ier ! error status -!----------------------------------------------------------------------- - - ! Prognostic crop restart year - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='restyear', xtype=ncd_int, & - long_name='Number of years prognostic crop ran', units="years") - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='restyear', data=restyear, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' )then - if ( readvar ) then - call checkDates( ) - else - if ( is_restart()) call endrun - end if - end if - end if - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ! Determine necessary subgrid bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - !-------------------------------- - ! pft physical state variables - !-------------------------------- - - ! peaklai - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='peaklai', xtype=ncd_int, & - dim1name='pft',long_name='Flag if at max allowed LAI or not', & - flag_values=(/0,1/), nvalid_range=(/0,1/), & - flag_meanings=(/'NOT-at-peak', 'AT_peak-LAI' /) ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='peaklai', data=pps%peaklai, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! idop - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='idop', xtype=ncd_int, & - dim1name='pft',long_name='Date of planting',units='jday', & - nvalid_range=(/1,366/) ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='idop', data=pps%idop, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! aleaf - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='aleaf', xtype=ncd_double, & - dim1name='pft',long_name='leaf allocation coefficient',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='aleaf', data=pps%aleaf, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! aleafi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='aleafi', xtype=ncd_double, & - dim1name='pft',long_name='Saved leaf allocation coefficient from phase 2', & - units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='aleafi', data=pps%aleafi, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! astem - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='astem', xtype=ncd_double, & - dim1name='pft',long_name='stem allocation coefficient',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='astem', data=pps%astem, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! astemi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='astemi', xtype=ncd_double, & - dim1name='pft',long_name='Saved stem allocation coefficient from phase 2',& - units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='astemi', data=pps%astemi, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! htmx - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='htmx', xtype=ncd_double, & - dim1name='pft',long_name='max height attained by a crop during year',& - units='m') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='htmx', data=pps%htmx, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! hdidx - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='hdidx', xtype=ncd_double, & - dim1name='pft',long_name='cold hardening index',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='hdidx', data=pps%hdidx, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! vf - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf', xtype=ncd_double, & - dim1name='pft',long_name='vernalization factor',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf', data=pps%vf, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cumvd - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cumvd', xtype=ncd_double, & - dim1name='pft',long_name='cumulative vernalization d',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cumvd', data=pps%cumvd, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! croplive - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='croplive', xtype=ncd_log, & - dim1name='pft',long_name='Flag that crop is alive, but not harvested') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='croplive', data=pps%croplive, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cropplant - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cropplant', xtype=ncd_log, & - dim1name='pft',long_name='Flag that crop is planted, but not harvested' ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cropplant', data=pps%cropplant, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! harvdate - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='harvdate', xtype=ncd_int, & - dim1name='pft',long_name='harvest date',units='jday', & - nvalid_range=(/1,366/) ) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='harvdate', data=pps%harvdate, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gdd1020 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gdd1020', xtype=ncd_double, & - dim1name='pft', & - long_name='20 year average of growing degree-days base 10C from planting', & - units='ddays') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gdd1020', data=pps%gdd1020, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gdd820 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gdd820', xtype=ncd_double, & - dim1name='pft', & - long_name='20 year average of growing degree-days base 8C from planting', & - units='ddays') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gdd820', data=pps%gdd820, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gdd020 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gdd020', xtype=ncd_double, & - dim1name='pft', & - long_name='20 year average of growing degree-days base 0C from planting', & - units='ddays') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gdd020', data=pps%gdd020, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! gddmaturity - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gddmaturity', xtype=ncd_double, & - dim1name='pft',long_name='Growing degree days needed to harvest',units='ddays') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gddmaturity', data=pps%gddmaturity, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! huileaf - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='huileaf', xtype=ncd_double, & - dim1name='pft', & - long_name='heat unit index needed from planting to leaf emergence',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='huileaf', data=pps%huileaf, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! huigrain - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='huigrain', xtype=ncd_double, & - dim1name='pft',long_name='heat unit index needed to reach vegetative maturity', & - units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='huigrain', data=pps%huigrain, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc', xtype=ncd_double, & - dim1name='pft',long_name='grain C',units='gC/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc', data=pcs%grainc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc_storage', xtype=ncd_double, & - dim1name='pft',long_name='grain C storage',units='gC/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc_storage', data=pcs%grainc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc_xfer', xtype=ncd_double, & - dim1name='pft',long_name='grain C transfer',units='gC/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc_xfer', data=pcs%grainc_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn', xtype=ncd_double, & - dim1name='pft',long_name='grain N',units='gN/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn', data=pns%grainn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn_storage', xtype=ncd_double, & - dim1name='pft',long_name='grain N storage',units='gN/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn_storage', data=pns%grainn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn_xfer', xtype=ncd_double, & - dim1name='pft',long_name='grain N transfer',units='gN/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn_xfer', data=pns%grainn_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc_xfer_to_grainc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc_xfer_to_grainc', xtype=ncd_double, & - dim1name='pft',long_name='grain C growth from storage',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc_xfer_to_grainc', data=pcf%grainc_xfer_to_grainc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemc_to_litter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemc_to_litter', xtype=ncd_double, & - dim1name='pft',long_name='live stem C litterfall',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemc_to_litter', data=pcf%livestemc_to_litter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc_to_food - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc_to_food', xtype=ncd_double, & - dim1name='pft',long_name='grain C to food',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc_to_food', data=pcf%grainc_to_food, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn_xfer_to_grainn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn_xfer_to_grainn', xtype=ncd_double, & - dim1name='pft',long_name='grain N growth from storage',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn_xfer_to_grainn', data=pnf%grainn_xfer_to_grainn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! livestemn_to_litter - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='livestemn_to_litter', xtype=ncd_double, & - dim1name='pft',long_name='livestem N to litter',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='livestemn_to_litter', data=pnf%livestemn_to_litter, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn_to_food - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn_to_food', xtype=ncd_double, & - dim1name='pft',long_name='grain N to food',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn_to_food', data=pnf%grainn_to_food, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool_to_grainc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool_to_grainc', xtype=ncd_double, & - dim1name='pft',long_name='allocation to grain C',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool_to_grainc', data=pcf%cpool_to_grainc, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool_to_grainc_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool_to_grainc_storage', xtype=ncd_double, & - dim1name='pft',long_name='allocation to grain C storage',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool_to_grainc_storage', data=pcf%cpool_to_grainc_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! npool_to_grainn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='npool_to_grainn', xtype=ncd_double, & - dim1name='pft',long_name='allocation to grain N',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='npool_to_grainn', data=pnf%npool_to_grainn, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! npool_to_grainn_storage - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='npool_to_grainn_storage', xtype=ncd_double, & - dim1name='pft',long_name='allocation to grain N storage',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='npool_to_grainn_storage', data=pnf%npool_to_grainn_storage, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool_grain_gr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool_grain_gr', xtype=ncd_double, & - dim1name='pft',long_name='grain growth respiration',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool_grain_gr', data=pcf%cpool_grain_gr, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! cpool_grain_storage_gr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cpool_grain_storage_gr', xtype=ncd_double, & - dim1name='pft',long_name='grain growth respiration to storage',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='cpool_grain_storage_gr', data=pcf%cpool_grain_storage_gr, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! transfer_grain_gr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='transfer_grain_gr', xtype=ncd_double, & - dim1name='pft',long_name='grain growth respiration from storage',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='transfer_grain_gr', data=pcf%transfer_grain_gr, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainc_storage_to_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainc_storage_to_xfer', xtype=ncd_double, & - dim1name='pft',long_name='grain C shift storage to transfer',units='gC/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainc_storage_to_xfer', data=pcf%grainc_storage_to_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - ! grainn_storage_to_xfer - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grainn_storage_to_xfer', xtype=ncd_double, & - dim1name='pft',long_name='grain N shift storage to transfer',units='gN/m2/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='grainn_storage_to_xfer', data=pnf%grainn_storage_to_xfer, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun - end if - end if - - end subroutine CropRest - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CropRestYear -! -! !INTERFACE: - integer function CropRestYear ( ) -! -! !DESCRIPTION: -! Return the restart year for prognostic crop -! -! !USES: -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Author: Erik Kluzek -! -!EOP -! -! !LOCAL VARIABLES: - CropRestYear = restyear - end function CropRestYear - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CropRestIncYear -! -! !INTERFACE: - subroutine CropRestIncYear () -! -! !DESCRIPTION: -! Increment the crop restart year, if appropriate -! -! This routine should be called every time step, but only once per clump (to avoid -! inadvertently updating nyrs multiple times) -! -! !USES: - use surfrdMod , only : crop_prog - use clm_time_manager , only : get_curr_date, is_first_step - implicit none -! -! !LOCAL VARIABLES: - integer kyr ! current year - integer kmo ! month of year (1, ..., 12) - integer kda ! day of month (1, ..., 31) - integer mcsec ! seconds of day (0, ..., seconds/day) -!----------------------------------------------------------------------- - - ! Update restyear only when running with prognostic crop - if ( crop_prog )then - ! Update restyear when it's the start of a new year - but don't do that at the - ! very start of the run - call get_curr_date ( kyr, kmo, kda, mcsec) - if ((kmo == 1 .and. kda == 1 .and. mcsec == 0) .and. .not. is_first_step()) then - restyear = restyear + 1 - end if - end if - - end subroutine CropRestIncYear - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: checkDates -! -! !INTERFACE: - subroutine checkDates( ) -! -! !DESCRIPTION: -! Make sure the dates are compatible. The date given to startup the model -! and the date on the restart file must be the same although years can be -! different. The dates need to be checked when the restart file is being -! read in for a startup or branch case (they are NOT allowed to be different -! for a restart case). -! -! For the prognostic crop model the date of planting is tracked and growing -! degree days is tracked (with a 20 year mean) -- so shifting the start dates -! messes up these bits of saved information. -! -! !USES: -! -! !ARGUMENTS: - use clm_time_manager, only : get_driver_start_ymd, get_start_date - use clm_varctl , only : iulog - use clm_varctl , only : nsrest, nsrBranch, nsrStartup -! -! !REVISION HISTORY: -! Author: Erik Kluzek -! -!EOP -! -! !LOCAL VARIABLES: - integer :: stymd ! Start date YYYYMMDD from driver - integer :: styr ! Start year from driver - integer :: stmon_day ! Start date MMDD from driver - integer :: rsmon_day ! Restart date MMDD from restart file - integer :: rsyr ! Restart year from restart file - integer :: rsmon ! Restart month from restart file - integer :: rsday ! Restart day from restart file - integer :: tod ! Restart time of day from restart file - character(len=*), parameter :: formDate = '(A,i4.4,"/",i2.2,"/",i2.2)' ! log output format - character(len=32) :: subname = 'CropRest::checkDates' - ! - ! If branch or startup make sure the startdate is compatible with the date - ! on the restart file. - ! - if ( nsrest == nsrBranch .or. nsrest == nsrStartup )then - stymd = get_driver_start_ymd() - styr = stymd / 10000 - stmon_day = stymd - styr*10000 - call get_start_date( rsyr, rsmon, rsday, tod ) - rsmon_day = rsmon*100 + rsday - if ( masterproc ) & - write(iulog,formDate) 'Date on the restart file is: ', rsyr, rsmon, rsday - if ( stmon_day /= rsmon_day )then - write(iulog,formDate) 'Start date is: ', styr, stmon_day/100, & - (stmon_day - stmon_day/100) - call endrun( trim(subname)// & - ' ERROR: For prognostic crop to work correctly, the start date (month and day)'// & - ' and the date on the restart file needs to match (years can be different)' ) - end if - end if - - end subroutine checkDates - -end module CropRestMod - diff --git a/src_clm40/biogeochem/DUSTMod.F90 b/src_clm40/biogeochem/DUSTMod.F90 deleted file mode 100644 index f41be79105..0000000000 --- a/src_clm40/biogeochem/DUSTMod.F90 +++ /dev/null @@ -1,900 +0,0 @@ -module DUSTMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: DUSTMod -! -! !DESCRIPTION: -! Routines in this module calculate Dust mobilization and dry deposition for dust. -! Simulates dust mobilization due to wind from the surface into the -! lowest atmospheric layer. On output flx_mss_vrt_dst(ndst) is the surface dust -! emission (kg/m**2/s) [ + = to atm]. -! Calculates the turbulent component of dust dry deposition, (the turbulent deposition -! velocity through the lowest atmospheric layer). CAM will calculate the settling -! velocity through the whole atmospheric column. The two calculations will determine -! the dust dry deposition flux to the surface. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_varpar , only : dst_src_nbr, ndst, sz_nbr - use clm_varcon , only : grav, istsoil - use clm_varcon , only : istcrop, istice_mec - use clm_varctl , only : iulog - use abortutils , only : endrun - use subgridAveMod, only: p2l_1d - use clm_varcon, only: spval -! -! !PUBLIC TYPES - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: -! - public Dustini ! Initialize variables used in subroutine Dust - public DustEmission ! Dust mobilization - public DustDryDep ! Turbulent dry deposition for dust -! -! !REVISION HISTORY -! Created by Sam Levis, updated to clm2.1 by Mariana Vertenstein -! Source: C. Zender's dust model -! -!EOP -! -! Data private to this module -! - private - real(r8) ovr_src_snk_mss(dst_src_nbr,ndst) - real(r8) tmp1 !Factor in saltation computation (named as in Charlie's code) - real(r8) dmt_vwr(ndst) ![m] Mass-weighted mean diameter resolved - real(r8) stk_crc(ndst) ![frc] Correction to Stokes settling velocity - real(r8) dns_aer ![kg m-3] Aerosol density -!------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: DustEmission -! -! !INTERFACE: - subroutine DustEmission (lbp, ubp, lbc,ubc,lbl,ubl,num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! Dust mobilization. This code simulates dust mobilization due to wind -! from the surface into the lowest atmospheric layer -! On output flx_mss_vrt_dst(ndst) is the surface dust emission -! (kg/m**2/s) [ + = to atm] -! Source: C. Zender's dust model -! -! !USES - use clm_atmlnd , only : clm_a2l - use shr_const_mod, only : SHR_CONST_RHOFW -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp,lbc,ubc,ubl,lbl ! pft bounds - integer, intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_nolakep(num_nolakep) ! pft filter for non-lake points -! -! !LOCAL VARIABLES -! -! local pointers to implicit in arguments -! - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: ityplun(:) ! landunit type - real(r8), pointer :: tlai(:) ! one-sided leaf area index, no burying by snow - real(r8), pointer :: tsai(:) ! one-sided stem area index, no burying by snow - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: gwc_thr(:) ! threshold gravimetric soil moisture based on clay content - real(r8), pointer :: forc_rho(:) ! density (kg/m**3) - real(r8), pointer :: fv(:) ! friction velocity (m/s) (for dust model) - real(r8), pointer :: u10(:) ! 10-m wind (m/s) (created for dust model) - real(r8), pointer :: mbl_bsn_fct(:) ! basin factor - real(r8), pointer :: mss_frc_cly_vld(:) ! [frc] Mass fraction clay limited to 0.20 - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid soil water (kg/m2) - real(r8), pointer :: h2osoi_ice(:,:) ! frozen soil water (kg/m2) - real(r8), pointer :: watsat(:,:) ! saturated volumetric soil water - -! local pointers to implicit out arguments -! - real(r8), pointer :: flx_mss_vrt_dst(:,:) ! surface dust emission (kg/m**2/s) - real(r8), pointer :: flx_mss_vrt_dst_tot(:) ! total dust flux into atmosphere - -! !REVISION HISTORY -! Created by Sam Levis -! Migrated to new data structures by Peter Thornton and Mariana Vertenstein -! !Created by Peter Thornton and Mariana Vertenstein -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: fp,p,c,l,g,m,n ! indices - real(r8) :: liqfrac ! fraction of total water that is liquid - real(r8) :: wnd_frc_rat ! [frc] Wind friction threshold over wind friction - real(r8) :: wnd_frc_slt_dlt ! [m s-1] Friction velocity increase from saltatn - real(r8) :: wnd_rfr_dlt ! [m s-1] Reference windspeed excess over threshld - real(r8) :: dst_slt_flx_rat_ttl - real(r8) :: flx_mss_hrz_slt_ttl - real(r8) :: flx_mss_vrt_dst_ttl(lbp:ubp) - real(r8) :: frc_thr_wet_fct - real(r8) :: frc_thr_rgh_fct - real(r8) :: wnd_frc_thr_slt - real(r8) :: wnd_rfr_thr_slt - real(r8) :: wnd_frc_slt - real(r8) :: lnd_frc_mbl(lbp:ubp) - real(r8) :: bd - real(r8) :: gwc_sfc - real(r8) :: ttlai(lbp:ubp) - real(r8) :: tlai_lu(lbl:ubl) -! -! constants -! - real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant - real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization - real(r8), pointer :: wtlunit(:) ! weight of pft relative to landunit - real(r8) :: sumwt(lbl:ubl) ! sum of weights - logical :: found ! temporary for error check - integer :: index - -!------------------------------------------------------------------------ - - ! Assign local pointers to derived type scalar members (gridcell-level) - - forc_rho => clm_a2l%forc_rho - - ! Assign local pointers to derived type scalar members (landunit-level) - - ityplun => lun%itype - - ! Assign local pointers to derived type scalar members (column-level) - - frac_sno => cps%frac_sno - gwc_thr => cps%gwc_thr - mbl_bsn_fct => cps%mbl_bsn_fct - mss_frc_cly_vld => cps%mss_frc_cly_vld - h2osoi_vol => cws%h2osoi_vol - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - watsat => cps%watsat - - ! Assign local pointers to derived type scalar members (pft-level) - - pgridcell => pft%gridcell - plandunit => pft%landunit - pcolumn => pft%column - tlai => pps%tlai - tsai => pps%tsai - fv => pps%fv - u10 => pps%u10 - flx_mss_vrt_dst => pdf%flx_mss_vrt_dst - flx_mss_vrt_dst_tot => pdf%flx_mss_vrt_dst_tot - !local pointers from subgridAveMod/p2l_1d - wtlunit => pft%wtlunit - - ttlai(:) = 0._r8 -! make lai average at landunit level - do fp = 1,num_nolakep - p = filter_nolakep(fp) - ttlai(p) = tlai(p)+tsai(p) - enddo - - tlai_lu(:) = spval - sumwt(:) = 0._r8 - do p = lbp,ubp - if (ttlai(p) /= spval .and. wtlunit(p) /= 0._r8) then - c = pcolumn(p) - l = plandunit(p) - if (sumwt(l) == 0._r8) tlai_lu(l) = 0._r8 - tlai_lu(l) = tlai_lu(l) + ttlai(p) * wtlunit(p) - sumwt(l) = sumwt(l) + wtlunit(p) - end if - end do - found = .false. - do l = lbl,ubl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - exit - else if (sumwt(l) /= 0._r8) then - tlai_lu(l) = tlai_lu(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*) 'p2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun() - end if - -! Loop through pfts - -! initialize variables which get passed to the atmosphere - flx_mss_vrt_dst(lbp:ubp,:)=0._r8 - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - l = plandunit(p) - - ! the following code from subr. lnd_frc_mbl_get was adapted for lsm use - ! purpose: return fraction of each gridcell suitable for dust mobilization - - ! the "bare ground" fraction of the current sub-gridscale cell decreases - ! linearly from 1 to 0 as VAI(=tlai+tsai) increases from 0 to vai_mbl_thr - ! if ice sheet, wetland, or lake, no dust allowed - - if (ityplun(l) == istsoil .or. ityplun(l) == istcrop) then - if (tlai_lu(l) < vai_mbl_thr) then - lnd_frc_mbl(p) = 1.0_r8 - (tlai_lu(l))/vai_mbl_thr - else - lnd_frc_mbl(p) = 0.0_r8 - endif - lnd_frc_mbl(p) = lnd_frc_mbl(p) * (1.0_r8 - frac_sno(c)) - else - lnd_frc_mbl(p) = 0.0_r8 - end if - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p)>1.0_r8 .or. lnd_frc_mbl(p)<0.0_r8) then - write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) - call endrun - end if - end do - - ! reset history output variables before next if-statement to avoid output = inf - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - flx_mss_vrt_dst_tot(p) = 0.0_r8 - end do - do n = 1, ndst - do fp = 1,num_nolakep - p = filter_nolakep(fp) - flx_mss_vrt_dst(p,n) = 0.0_r8 - end do - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - l = plandunit(p) - g = pgridcell(p) - - ! only perform the following calculations if lnd_frc_mbl is non-zero - - if (lnd_frc_mbl(p) > 0.0_r8) then - - ! the following comes from subr. frc_thr_rgh_fct_get - ! purpose: compute factor by which surface roughness increases threshold - ! friction velocity (currently a constant) - - frc_thr_rgh_fct = 1.0_r8 - - ! the following comes from subr. frc_thr_wet_fct_get - ! purpose: compute factor by which soil moisture increases threshold friction velocity - ! adjust threshold velocity for inhibition by moisture - ! modified 4/5/2002 (slevis) to use gravimetric instead of volumetric - ! water content - - bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil - gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont - if (gwc_sfc > gwc_thr(c)) then - frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) - else - frc_thr_wet_fct = 1.0_r8 - end if - - ! slevis: adding liqfrac here, because related to effects from soil water - - liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) - - ! the following lines come from subr. dst_mbl - ! purpose: adjust threshold friction velocity to acct for moisture and - ! roughness. The ratio tmp1 / sqrt(forc_rho) comes from - ! subr. wnd_frc_thr_slt_get which computes dry threshold - ! friction velocity for saltation - - wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(g)) * frc_thr_wet_fct * frc_thr_rgh_fct - - ! reset these variables which will be updated in the following if-block - - wnd_frc_slt = fv(p) - flx_mss_hrz_slt_ttl = 0.0_r8 - flx_mss_vrt_dst_ttl(p) = 0.0_r8 - - ! the following line comes from subr. dst_mbl - ! purpose: threshold saltation wind speed - - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) - - ! the following if-block comes from subr. wnd_frc_slt_get - ! purpose: compute the saltating friction velocity - ! theory: saltation roughens the boundary layer, AKA "Owen's effect" - - if (u10(p) >= wnd_rfr_thr_slt) then - wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - wnd_frc_slt = fv(p) + wnd_frc_slt_dlt - end if - - ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get - ! purpose: compute vertically integrated streamwise mass flux of particles - - if (wnd_frc_slt > wnd_frc_thr_slt) then - wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt - flx_mss_hrz_slt_ttl = cst_slt * forc_rho(g) * (wnd_frc_slt**3.0_r8) * & - (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav - - ! the following loop originates from subr. dst_mbl - ! purpose: apply land sfc and veg limitations and global tuning factor - ! slevis: multiply flx_mss_hrz_slt_ttl by liqfrac to incude the effect - ! of frozen soil - - flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & - flx_mss_fdg_fct * liqfrac - end if - - ! the following comes from subr. flx_mss_vrt_dst_ttl_MaB95_get - ! purpose: diagnose total vertical mass flux of dust from vertically - ! integrated streamwise mass flux - - dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) - flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl - - end if ! lnd_frc_mbl > 0.0 - - end do - - ! the following comes from subr. flx_mss_vrt_dst_prt in C. Zender's code - ! purpose: partition total vertical mass flux of dust into transport bins - - do n = 1, ndst - do m = 1, dst_src_nbr - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p) > 0.0_r8) then - flx_mss_vrt_dst(p,n) = flx_mss_vrt_dst(p,n) + ovr_src_snk_mss(m,n) * flx_mss_vrt_dst_ttl(p) - end if - end do - end do - end do - - do n = 1, ndst - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (lnd_frc_mbl(p) > 0.0_r8) then - flx_mss_vrt_dst_tot(p) = flx_mss_vrt_dst_tot(p) + flx_mss_vrt_dst(p,n) - end if - end do - end do - - end subroutine DustEmission - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: subroutine DustDryDep -! -! !INTERFACE: -! - subroutine DustDryDep (lbp, ubp) -! -! !DESCRIPTION: -! -! Determine Turbulent dry deposition for dust. Calculate the turbulent -! component of dust dry deposition, (the turbulent deposition velocity -! through the lowest atmospheric layer. CAM will calculate the settling -! velocity through the whole atmospheric column. The two calculations -! will determine the dust dry deposition flux to the surface. -! Note: Same process should occur over oceans. For the coupled CESM, -! we may find it more efficient to let CAM calculate the turbulent dep -! velocity over all surfaces. This would require passing the -! aerodynamic resistance, ram(1), and the friction velocity, fv, from -! the land to the atmosphere component. In that case, dustini need not -! calculate particle diamter (dmt_vwr) and particle density (dns_aer). -! Source: C. Zender's dry deposition code -! -! !USES -! - use shr_const_mod, only : SHR_CONST_PI, SHR_CONST_RDAIR, SHR_CONST_BOLTZ - use clm_atmlnd , only : clm_a2l -! -! !ARGUMENTS: -! - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds -! -! !LOCAL VARIABLES -! -! local pointers to implicit in arguments -! - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: ityplun(:) ! landunit type - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: forc_t(:) ! atm temperature (K) - real(r8), pointer :: forc_pbot(:) ! atm pressure (Pa) - real(r8), pointer :: forc_rho(:) ! atm density (kg/m**3) - real(r8), pointer :: fv(:) ! friction velocity (m/s) - real(r8), pointer :: ram1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: vlc_trb(:,:) ! Turbulent deposn velocity (m/s) - real(r8), pointer :: vlc_trb_1(:) ! Turbulent deposition velocity 1 - real(r8), pointer :: vlc_trb_2(:) ! Turbulent deposition velocity 2 - real(r8), pointer :: vlc_trb_3(:) ! Turbulent deposition velocity 3 - real(r8), pointer :: vlc_trb_4(:) ! Turbulent deposition velocity 4 -! -! !REVISION HISTORY -! Created by Sam Levis -! -! -! !LOCAL VARIABLES -!EOP -! - integer :: p,l,g,m,n ! indices - real(r8) :: vsc_dyn_atm(lbp:ubp) ! [kg m-1 s-1] Dynamic viscosity of air - real(r8) :: vsc_knm_atm(lbp:ubp) ! [m2 s-1] Kinematic viscosity of atmosphere - real(r8) :: shm_nbr_xpn ! [frc] Sfc-dep exponent for aerosol-diffusion dependence on Schmidt number - real(r8) :: shm_nbr ! [frc] Schmidt number - real(r8) :: stk_nbr ! [frc] Stokes number - real(r8) :: mfp_atm ! [m] Mean free path of air - real(r8) :: dff_aer ! [m2 s-1] Brownian diffusivity of particle - real(r8) :: rss_trb ! [s m-1] Resistance to turbulent deposition - real(r8) :: slp_crc(lbp:ubp,ndst) ! [frc] Slip correction factor - real(r8) :: vlc_grv(lbp:ubp,ndst) ! [m s-1] Settling velocity - real(r8) :: rss_lmn(lbp:ubp,ndst) ! [s m-1] Quasi-laminar layer resistance - real(r8) :: tmp ! temporary - -! constants - - real(r8),parameter::shm_nbr_xpn_lnd=-2._r8/3._r8 ![frc] shm_nbr_xpn over land -!------------------------------------------------------------------------ - - ! Assign local pointers to derived type members (gridcell-level) - - forc_pbot => clm_a2l%forc_pbot - forc_rho => clm_a2l%forc_rho - forc_t => clm_a2l%forc_t - - ! Assign local pointers to derived type members (landunit-level) - - ityplun => lun%itype - - ! Assign local pointers to derived type members (pft-level) - - plandunit => pft%landunit - pgridcell => pft%gridcell - pwtgcell => pft%wtgcell - fv => pps%fv - ram1 => pps%ram1 - vlc_trb => pdf%vlc_trb - vlc_trb_1 => pdf%vlc_trb_1 - vlc_trb_2 => pdf%vlc_trb_2 - vlc_trb_3 => pdf%vlc_trb_3 - vlc_trb_4 => pdf%vlc_trb_4 - - do p = lbp,ubp - l = plandunit(p) - ! Note: some glacier_mec pfts may have zero weight - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - g = pgridcell(p) - - ! from subroutine dst_dps_dry (consider adding sanity checks from line 212) - ! when code asks to use midlayer density, pressure, temperature, - ! I use the data coming in from the atmosphere, ie forc_t, forc_pbot, forc_rho - - ! Quasi-laminar layer resistance: call rss_lmn_get - ! Size-independent thermokinetic properties - - vsc_dyn_atm(p) = 1.72e-5_r8 * ((forc_t(g)/273.0_r8)**1.5_r8) * 393.0_r8 / & - (forc_t(g)+120.0_r8) ![kg m-1 s-1] RoY94 p. 102 - mfp_atm = 2.0_r8 * vsc_dyn_atm(p) / & ![m] SeP97 p. 455 - (forc_pbot(g)*sqrt(8.0_r8/(SHR_CONST_PI*SHR_CONST_RDAIR*forc_t(g)))) - vsc_knm_atm(p) = vsc_dyn_atm(p) / forc_rho(g) ![m2 s-1] Kinematic viscosity of air - - do m = 1, ndst - slp_crc(p,m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ![frc] Slip correction factor SeP97 p. 464 - vlc_grv(p,m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & - grav * slp_crc(p,m) / vsc_dyn_atm(p) ![m s-1] Stokes' settling velocity SeP97 p. 466 - vlc_grv(p,m) = vlc_grv(p,m) * stk_crc(m) ![m s-1] Correction to Stokes settling velocity - end do - end if - end do - - do m = 1, ndst - do p = lbp,ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - g = pgridcell(p) - - stk_nbr = vlc_grv(p,m) * fv(p) * fv(p) / (grav * vsc_knm_atm(p)) ![frc] SeP97 p.965 - dff_aer = SHR_CONST_BOLTZ * forc_t(g) * slp_crc(p,m) / & ![m2 s-1] - (3.0_r8*SHR_CONST_PI * vsc_dyn_atm(p) * dmt_vwr(m)) !SeP97 p.474 - shm_nbr = vsc_knm_atm(p) / dff_aer ![frc] SeP97 p.972 - shm_nbr_xpn = shm_nbr_xpn_lnd ![frc] - - ! fxm: Turning this on dramatically reduces - ! deposition velocity in low wind regimes - ! Schmidt number exponent is -2/3 over solid surfaces and - ! -1/2 over liquid surfaces SlS80 p. 1014 - ! if (oro(i)==0.0) shm_nbr_xpn=shm_nbr_xpn_ocn else shm_nbr_xpn=shm_nbr_xpn_lnd - ! [frc] Surface-dependent exponent for aerosol-diffusion dependence on Schmidt # - - tmp = shm_nbr**shm_nbr_xpn + 10.0_r8**(-3.0_r8/stk_nbr) - rss_lmn(p,m) = 1.0_r8 / (tmp * fv(p)) ![s m-1] SeP97 p.972,965 - end if - end do - end do - - ! Lowest layer: Turbulent deposition (CAM will calc. gravitational dep) - - do m = 1, ndst - do p = lbp,ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - rss_trb = ram1(p) + rss_lmn(p,m) + ram1(p) * rss_lmn(p,m) * vlc_grv(p,m) ![s m-1] - vlc_trb(p,m) = 1.0_r8 / rss_trb ![m s-1] - end if - end do - end do - - do p = lbp,ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - vlc_trb_1(p) = vlc_trb(p,1) - vlc_trb_2(p) = vlc_trb(p,2) - vlc_trb_3(p) = vlc_trb(p,3) - vlc_trb_4(p) = vlc_trb(p,4) - end if - end do - - end subroutine DustDryDep - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: subroutine Dustini -! -! !INTERFACE: -! - subroutine Dustini() -! -! !DESCRIPTION: -! -! Compute source efficiency factor from topography -! Initialize other variables used in subroutine Dust: -! ovr_src_snk_mss(m,n) and tmp1. -! Define particle diameter and density needed by atm model -! as well as by dry dep model -! Source: Paul Ginoux (for source efficiency factor) -! Modifications by C. Zender and later by S. Levis -! Rest of subroutine from C. Zender's dust model -! -! !USES - use shr_const_mod, only: SHR_CONST_PI, SHR_CONST_RDAIR - use decompMod, only : get_proc_bounds - use shr_spfn_mod, only: erf => shr_spfn_erf -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY -! Created by Samual Levis -! -! !LOCAL VARIABLES -! -! local pointers to implicit in arguments -! - real(r8), pointer :: mbl_bsn_fct(:) !basin factor -! -! -! !LOCAL VARIABLES -!EOP -! - integer :: fc,c,l,m,n ! indices - real(r8) :: ovr_src_snk_frc - real(r8) :: sqrt2lngsdi ! [frc] Factor in erf argument - real(r8) :: lndmaxjovrdmdni ! [frc] Factor in erf argument - real(r8) :: lndminjovrdmdni ! [frc] Factor in erf argument - real(r8) :: ryn_nbr_frc_thr_prx_opt ! [frc] Threshold friction Reynolds number approximation for optimal size - real(r8) :: ryn_nbr_frc_thr_opt_fnc ! [frc] Threshold friction Reynolds factor for saltation calculation - real(r8) :: icf_fct ! Interpartical cohesive forces factor for saltation calc - real(r8) :: dns_fct ! Density ratio factor for saltation calculation - real(r8) :: dmt_min(ndst) ! [m] Size grid minimum - real(r8) :: dmt_max(ndst) ! [m] Size grid maximum - real(r8) :: dmt_ctr(ndst) ! [m] Diameter at bin center - real(r8) :: dmt_dlt(ndst) ! [m] Width of size bin - real(r8) :: slp_crc(ndst) ! [frc] Slip correction factor - real(r8) :: vlm_rsl(ndst) ! [m3 m-3] Volume concentration resolved - real(r8) :: vlc_stk(ndst) ! [m s-1] Stokes settling velocity - real(r8) :: vlc_grv(ndst) ! [m s-1] Settling velocity - real(r8) :: ryn_nbr_grv(ndst) ! [frc] Reynolds number at terminal velocity - real(r8) :: cff_drg_grv(ndst) ! [frc] Drag coefficient at terminal velocity - real(r8) :: tmp ! temporary - real(r8) :: ln_gsd ! [frc] ln(gsd) - real(r8) :: gsd_anl ! [frc] Geometric standard deviation - real(r8) :: dmt_vma ! [m] Mass median diameter analytic She84 p.75 Tabl.1 - real(r8) :: dmt_nma ! [m] Number median particle diameter - real(r8) :: lgn_dst ! Lognormal distribution at sz_ctr - real(r8) :: eps_max ! [frc] Relative accuracy for convergence - real(r8) :: eps_crr ! [frc] Current relative accuracy - real(r8) :: itr_idx ! [idx] Counting index - real(r8) :: dns_mdp ! [kg m-3] Midlayer density - real(r8) :: mfp_atm ! [m] Mean free path of air - real(r8) :: vsc_dyn_atm ! [kg m-1 s-1] Dynamic viscosity of air - real(r8) :: vsc_knm_atm ! [kg m-1 s-1] Kinematic viscosity of air - real(r8) :: vlc_grv_old ! [m s-1] Previous gravitational settling velocity - real(r8) :: series_ratio ! Factor for logarithmic grid - real(r8) :: lngsdsqrttwopi_rcp ! Factor in lognormal distribution - real(r8) :: sz_min(sz_nbr) ! [m] Size Bin minima - real(r8) :: sz_max(sz_nbr) ! [m] Size Bin maxima - real(r8) :: sz_ctr(sz_nbr) ! [m] Size Bin centers - real(r8) :: sz_dlt(sz_nbr) ! [m] Size Bin widths - - ! constants - real(r8) :: dmt_vma_src(dst_src_nbr) = & ! [m] Mass median diameter - (/ 0.832e-6_r8 , 4.82e-6_r8 , 19.38e-6_r8 /) ! BSM96 p. 73 Table 2 - real(r8) :: gsd_anl_src(dst_src_nbr) = & ! [frc] Geometric std deviation - (/ 2.10_r8 , 1.90_r8 , 1.60_r8 /) ! BSM96 p. 73 Table 2 - real(r8) :: mss_frc_src(dst_src_nbr) = & ! [frc] Mass fraction - (/ 0.036_r8, 0.957_r8, 0.007_r8 /) ! BSM96 p. 73 Table 2 - real(r8) :: dmt_grd(5) = & ! [m] Particle diameter grid - (/ 0.1e-6_r8, 1.0e-6_r8, 2.5e-6_r8, 5.0e-6_r8, 10.0e-6_r8 /) - real(r8), parameter :: dmt_slt_opt = 75.0e-6_r8 ! [m] Optim diam for saltation - real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles - - ! declare erf intrinsic function - real(r8) :: dum ! dummy variable for erf test - - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices -!------------------------------------------------------------------------ - - ! Assign local pointers to derived type scalar members (column-level) - - mbl_bsn_fct => cps%mbl_bsn_fct - - ! the following comes from (1) szdstlgn.F subroutine ovr_src_snk_frc_get - ! and (2) dstszdst.F subroutine dst_szdst_ini - ! purpose(1): given one set (the "source") of lognormal distributions, - ! and one set of bin boundaries (the "sink"), compute and return - ! the overlap factors between the source and sink distributions - ! purpose(2): set important statistics of size distributions - - do m = 1, dst_src_nbr - sqrt2lngsdi = sqrt(2.0_r8) * log(gsd_anl_src(m)) - do n = 1, ndst - lndmaxjovrdmdni = log(dmt_grd(n+1)/dmt_vma_src(m)) - lndminjovrdmdni = log(dmt_grd(n )/dmt_vma_src(m)) - ovr_src_snk_frc = 0.5_r8 * (erf(lndmaxjovrdmdni/sqrt2lngsdi) - & - erf(lndminjovrdmdni/sqrt2lngsdi)) - ovr_src_snk_mss(m,n) = ovr_src_snk_frc * mss_frc_src(m) - end do - end do - - ! The following code from subroutine wnd_frc_thr_slt_get was placed - ! here because tmp1 needs to be defined just once - - ryn_nbr_frc_thr_prx_opt = 0.38_r8 + 1331.0_r8 * (100.0_r8*dmt_slt_opt)**1.56_r8 - - if (ryn_nbr_frc_thr_prx_opt < 0.03_r8) then - write(iulog,*) 'dstmbl: ryn_nbr_frc_thr_prx_opt < 0.03' - call endrun - else if (ryn_nbr_frc_thr_prx_opt < 10.0_r8) then - ryn_nbr_frc_thr_opt_fnc = -1.0_r8 + 1.928_r8 * (ryn_nbr_frc_thr_prx_opt**0.0922_r8) - ryn_nbr_frc_thr_opt_fnc = 0.1291_r8 * 0.1291_r8 / ryn_nbr_frc_thr_opt_fnc - else - ryn_nbr_frc_thr_opt_fnc = 1.0_r8 - 0.0858_r8 * exp(-0.0617_r8*(ryn_nbr_frc_thr_prx_opt-10.0_r8)) - ryn_nbr_frc_thr_opt_fnc = 0.120_r8 * 0.120_r8 * ryn_nbr_frc_thr_opt_fnc * ryn_nbr_frc_thr_opt_fnc - end if - - icf_fct = 1.0_r8 + 6.0e-07_r8 / (dns_slt * grav * (dmt_slt_opt**2.5_r8)) - dns_fct = dns_slt * grav * dmt_slt_opt - tmp1 = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) - - ! Set basin factor to 1 for now - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - do c = begc, endc - l = col%landunit(c) - if (.not. lun%lakpoi(l)) then - mbl_bsn_fct(c) = 1.0_r8 - end if - end do - - ! Introducing particle diameter. Needed by atm model and by dry dep model. - ! Taken from Charlie Zender's subroutines dst_psd_ini, dst_sz_rsl, - ! grd_mk (dstpsd.F90) and subroutine lgn_evl (psdlgn.F90) - - ! Charlie allows logarithmic or linear option for size distribution - ! however, he hardwires the distribution to logarithmic in his code - ! therefore, I take his logarithmic code only - ! furthermore, if dst_nbr == 4, he overrides the automatic grid calculation - ! he currently works with dst_nbr = 4, so I only take the relevant code - ! if ndst ever becomes different from 4, must add call grd_mk (dstpsd.F90) - ! as done in subroutine dst_psd_ini - ! note that here ndst = dst_nbr - - ! Override automatic grid with preset grid if available - - if (ndst == 4) then - do n = 1, ndst - dmt_min(n) = dmt_grd(n) ![m] Max diameter in bin - dmt_max(n) = dmt_grd(n+1) ![m] Min diameter in bin - dmt_ctr(n) = 0.5_r8 * (dmt_min(n)+dmt_max(n)) ![m] Diameter at bin ctr - dmt_dlt(n) = dmt_max(n)-dmt_min(n) ![m] Width of size bin - end do - else - write(iulog,*) 'Dustini error: ndst must equal to 4 with current code' - call endrun !see more comments above - end if !end if ndst == 4 - - ! Bin physical properties - - gsd_anl = 2.0_r8 ! [frc] Geometric std dev PaG77 p. 2080 Table1 - ln_gsd = log(gsd_anl) - dns_aer = 2.5e+3_r8 ! [kg m-3] Aerosol density - - ! Set a fundamental statistic for each bin - - dmt_vma = 3.5000e-6_r8 ! [m] Mass median diameter analytic She84 p.75 Table1 - - ! Compute analytic size statistics - ! Convert mass median diameter to number median diameter (call vma2nma) - - dmt_nma = dmt_vma * exp(-3.0_r8*ln_gsd*ln_gsd) ! [m] - - ! Compute resolved size statistics for each size distribution - ! In C. Zender's code call dst_sz_rsl - - do n = 1, ndst - - series_ratio = (dmt_max(n)/dmt_min(n))**(1.0_r8/sz_nbr) - sz_min(1) = dmt_min(n) - do m = 2, sz_nbr ! Loop starts at 2 - sz_min(m) = sz_min(m-1) * series_ratio - end do - - ! Derived grid values - do m = 1, sz_nbr-1 ! Loop ends at sz_nbr-1 - sz_max(m) = sz_min(m+1) ! [m] - end do - sz_max(sz_nbr) = dmt_max(n) ! [m] - - ! Final derived grid values - do m = 1, sz_nbr - sz_ctr(m) = 0.5_r8 * (sz_min(m)+sz_max(m)) - sz_dlt(m) = sz_max(m)-sz_min(m) - end do - - lngsdsqrttwopi_rcp = 1.0_r8 / (ln_gsd*sqrt(2.0_r8*SHR_CONST_PI)) - dmt_vwr(n) = 0.0_r8 ! [m] Mass wgted diameter resolved - vlm_rsl(n) = 0.0_r8 ! [m3 m-3] Volume concentration resolved - - do m = 1, sz_nbr - - ! Evaluate lognormal distribution for these sizes (call lgn_evl) - tmp = log(sz_ctr(m)/dmt_nma) / ln_gsd - lgn_dst = lngsdsqrttwopi_rcp * exp(-0.5_r8*tmp*tmp) / sz_ctr(m) - - ! Integrate moments of size distribution - dmt_vwr(n) = dmt_vwr(n) + sz_ctr(m) * & - SHR_CONST_PI / 6.0_r8 * (sz_ctr(m)**3.0_r8) * & ![m3] Volume - lgn_dst * sz_dlt(m) ![# m-3] Number concentrn - vlm_rsl(n) = vlm_rsl(n) + & - SHR_CONST_PI / 6.0_r8 * (sz_ctr(m)**3.0_r8) * & ![m3] Volume - lgn_dst * sz_dlt(m) ![# m-3] Number concentrn - - end do - - dmt_vwr(n) = dmt_vwr(n) / vlm_rsl(n) ![m] Mass weighted diameter resolved - - end do - - ! calculate correction to Stokes' settling velocity (subroutine stk_crc_get) - - eps_max = 1.0e-4_r8 - dns_mdp = 100000._r8 / (295.0_r8*SHR_CONST_RDAIR) ![kg m-3] const prs_mdp & tpt_vrt - - ! Size-independent thermokinetic properties - - vsc_dyn_atm = 1.72e-5_r8 * ((295.0_r8/273.0_r8)**1.5_r8) * 393.0_r8 / & - (295.0_r8+120.0_r8) ![kg m-1 s-1] RoY94 p.102 tpt_mdp=295.0 - mfp_atm = 2.0_r8 * vsc_dyn_atm / & !SeP97 p. 455 constant prs_mdp, tpt_mdp - (100000._r8*sqrt(8.0_r8/(SHR_CONST_PI*SHR_CONST_RDAIR*295.0_r8))) - vsc_knm_atm = vsc_dyn_atm / dns_mdp ![m2 s-1] Kinematic viscosity of air - - do m = 1, ndst - slp_crc(m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ! [frc] Slip correction factor SeP97 p.464 - vlc_stk(m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & - grav * slp_crc(m) / vsc_dyn_atm ! [m s-1] SeP97 p.466 - end do - - ! For Reynolds number flows Re < 0.1 Stokes' velocity is valid for - ! vlc_grv SeP97 p. 466 (8.42). For larger Re, inertial effects become - ! important and empirical drag coefficients must be employed - ! Implicit equation for Re, Cd, and Vt is SeP97 p. 467 (8.44) - ! Using Stokes' velocity rather than iterative solution with empirical - ! drag coefficient causes 60% errors for D = 200 um SeP97 p. 468 - - ! Iterative solution for drag coefficient, Reynolds number, and terminal veloc - do m = 1, ndst - - ! Initialize accuracy and counter - eps_crr = eps_max + 1.0_r8 ![frc] Current relative accuracy - itr_idx = 0 ![idx] Counting index - - ! Initial guess for vlc_grv is exact for Re < 0.1 - vlc_grv(m) = vlc_stk(m) ![m s-1] - - do while(eps_crr > eps_max) - - ! Save terminal velocity for convergence test - vlc_grv_old = vlc_grv(m) ![m s-1] - ryn_nbr_grv(m) = vlc_grv(m) * dmt_vwr(m) / vsc_knm_atm !SeP97 p.460 - - ! Update drag coefficient based on new Reynolds number - if (ryn_nbr_grv(m) < 0.1_r8) then - cff_drg_grv(m) = 24.0_r8 / ryn_nbr_grv(m) !Stokes' law Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 2.0_r8) then - cff_drg_grv(m) = (24.0_r8/ryn_nbr_grv(m)) * & - (1.0_r8 + 3.0_r8*ryn_nbr_grv(m)/16.0_r8 + & - 9.0_r8*ryn_nbr_grv(m)*ryn_nbr_grv(m)* & - log(2.0_r8*ryn_nbr_grv(m))/160.0_r8) !Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 500.0_r8) then - cff_drg_grv(m) = (24.0_r8/ryn_nbr_grv(m)) * & - (1.0_r8 + 0.15_r8*ryn_nbr_grv(m)**0.687_r8) !Sep97 p.463 (8.32) - else if (ryn_nbr_grv(m) < 2.0e5_r8) then - cff_drg_grv(m) = 0.44_r8 !Sep97 p.463 (8.32) - else - write(iulog,'(a,es9.2)') "ryn_nbr_grv(m) = ",ryn_nbr_grv(m) - write(iulog,*)'Dustini error: Reynolds number too large in stk_crc_get()' - call endrun - end if - - ! Update terminal velocity based on new Reynolds number and drag coeff - ! [m s-1] Terminal veloc SeP97 p.467 (8.44) - - vlc_grv(m) = sqrt(4.0_r8 * grav * dmt_vwr(m) * slp_crc(m) * dns_aer / & - (3.0_r8*cff_drg_grv(m)*dns_mdp)) - eps_crr = abs((vlc_grv(m)-vlc_grv_old)/vlc_grv(m)) !Relative convergence - if (itr_idx == 12) then - ! Numerical pingpong may occur when Re = 0.1, 2.0, or 500.0 - ! due to discontinuities in derivative of drag coefficient - vlc_grv(m) = 0.5_r8 * (vlc_grv(m)+vlc_grv_old) ! [m s-1] - end if - if (itr_idx > 20) then - write(iulog,*) 'Dustini error: Terminal velocity not converging ',& - ' in stk_crc_get(), breaking loop...' - goto 100 !to next iteration - end if - itr_idx = itr_idx + 1 - - end do !end while - -100 continue !Label to jump to when iteration does not converge - end do !end loop over size - - ! Compute factors to convert Stokes' settling velocities to - ! actual settling velocities - - do m = 1, ndst - stk_crc(m) = vlc_grv(m) / vlc_stk(m) - end do - - end subroutine Dustini - -end module DUSTMod diff --git a/src_clm40/biogeochem/DryDepVelocity.F90 b/src_clm40/biogeochem/DryDepVelocity.F90 deleted file mode 100644 index deb64f3dc1..0000000000 --- a/src_clm40/biogeochem/DryDepVelocity.F90 +++ /dev/null @@ -1,608 +0,0 @@ -Module DryDepVelocity - - !----------------------------------------------------------------------- - ! - ! Purpose: - ! Deposition velocity (m/s) - ! - ! Method: - ! This code simulates dry deposition velocities using the Wesely scheme. - ! Details of this method can be found in: - ! - ! M.L Wesely. Parameterization of surface resistances to gaseous dry deposition - ! in regional-scale numericl models. 1989. Atmospheric Environment vol.23 No.6 - ! pp. 1293-1304. - ! - ! In Wesely (1998) "the magnitude of the dry deposition velocity can be found - ! as: - ! - ! |vd|=(ra+rb+rc)^-1 - ! - ! where ra is the aerodynamic resistance (common to all gases) between a - ! specific height and the surface, rb is the quasilaminar sublayer resistance - ! (whose only dependence on the porperties of the gas of interest is its - ! molecular diffusivity in air), and rc is the bulk surface resistance". - ! - ! In this subroutine both ra and rb are calculated elsewhere in CLM. Thus ra - ! and rb were "globalized" in order to gain access to them for the calculation. - ! "ram1" is the CLM variable used for ra. ram1 was globalized in the following - ! subroutines; BareGroundFluxes.F90, Biogeophysics_lake.F90, CanopyFluxes.F90, - ! and clmtype.F90. - ! - ! "rb" is the CLM variable used for rb in the Wesely equation above. rb was - ! globalized in the following subroutines; clmtype.F90 - ! - ! In Wesely (1989) rc is estimated for five seasonal categories and 11 landuse - ! types. For each season and landuse type, Wesely compiled data into a - ! look-up-table for several parameters used to calculate rc. In this subroutine - ! the same values are used as found in wesely's look-up-tables, the only - ! difference is that this subroutine uses a CLM generated LAI to select values - ! from the look-up-table instead of seasonality. Inaddition, Wesely(1989) - ! land use types are "mapped" into CLM plant function types (PFT). - ! - ! Subroutine written to operate at the patch level. - ! - ! Output: - ! - ! vd(n_species) !Dry deposition velocity [m s-1] for each molecule or species - ! - ! Author: Beth Holland and James Sulzman - ! - ! Modified: Francis Vitt -- 30 Mar 2007 - ! Modified: Maria Val Martin -- 15 Jan 2014 - ! Corrected major bugs in the leaf and stomatal resitances. The code is now - ! coupled to LAI and Rs uses the Ball-Berry Scheme. Also, corrected minor - ! bugs in rlu and rcl calculations. Added - ! no vegetation removal for CO. See README for details and - ! Val Martin et al., 2014 GRL for major corrections - ! - !********* !!! IMPORTANT !!! ************ - ! STOMATAL RESISTANCE IS OPTIMIZED TO MATCH UP OBSERVATIONS - !----------------------------------------------------------------------- - - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use abortutils, only : endrun - use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time - use clm_atmlnd, only : clm_a2l - use spmdMod, only : masterproc - use seq_drydep_mod, only : n_drydep, drydep_list - use seq_drydep_mod, only : drydep_method, DD_XLND - use seq_drydep_mod, only : index_o3=>o3_ndx, index_o3a=>o3a_ndx, index_so2=>so2_ndx, index_h2=>h2_ndx, & - index_co=>co_ndx, index_ch4=>ch4_ndx, index_pan=>pan_ndx, & - index_xpan=>xpan_ndx - implicit none - save - - private - - public :: depvel_compute - -CONTAINS - - !----------------------------------------------------------------------- - ! computes the dry deposition velocity of tracers - !----------------------------------------------------------------------- - subroutine depvel_compute( lbp , ubp ) - use shr_const_mod , only : tmelt => shr_const_tkfrz - use seq_drydep_mod , only : seq_drydep_setHCoeff, mapping, drat, foxd, & - rcls, h2_a, h2_b, h2_c, ri, rac, rclo, rlu, & - rgss, rgso - use clm_varcon , only : istsoil, istice, istice_mec, istslak, istdlak, istwet, isturb - use clm_varctl , only : iulog - use pftvarcon , only : noveg, ndllf_evr_tmp_tree, ndllf_evr_brl_tree, & - ndllf_dcd_brl_tree, nbrdlf_evr_trp_tree, & - nbrdlf_evr_tmp_tree, nbrdlf_dcd_trp_tree, & - nbrdlf_dcd_tmp_tree, nbrdlf_dcd_brl_tree, & - nbrdlf_evr_shrub, nbrdlf_dcd_tmp_shrub, & - nbrdlf_dcd_brl_shrub, nc3_arctic_grass, & - nc3_nonarctic_grass, nc4_grass, nc3crop, & - nirrig, npcropmin, npcropmax - - implicit none - - !----Arguments----------------------------------------------------- - - integer, intent(in) :: lbp, ubp ! pft bounds - - ! ------------------------ local variables ------------------------ - ! local pointers to implicit in arguments - integer , pointer :: plandunit(:) !pft's landunit index - integer , pointer :: ivt(:) !landunit type - integer , pointer :: itypveg(:) !vegetation type for current pft - integer , pointer :: pgridcell(:) !pft's gridcell index - real(r8), pointer :: pwtgcell(:) !weight of pft relative to corresponding gridcell - real(r8), pointer :: elai(:) !one-sided leaf area index with burying by snow - real(r8), pointer :: forc_t(:) !atmospheric temperature (Kelvin) - real(r8), pointer :: forc_q(:) !atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_psrf(:) !surface pressure (Pa) - real(r8), pointer :: latdeg(:) !latitude (degrees) - real(r8), pointer :: londeg(:) !longitude (degrees) - real(r8), pointer :: forc_rain(:) !rain rate [mm/s] - real(r8), pointer :: forc_snow(:) !snow rate [mm/s] - real(r8), pointer :: forc_lwrad(:) !direct beam radiation (visible only) - real(r8), pointer :: forc_solad(:,:) !direct beam radiation (visible only) - real(r8), pointer :: forc_solai(:,:) !direct beam radiation (visible only) - real(r8), pointer :: ram1(:) !aerodynamical resistance - real(r8), pointer :: vds(:) !aerodynamical resistance - real(r8), pointer :: rssun(:) !stomatal resistance - real(r8), pointer :: rssha(:) !shaded stomatal resistance (s/m) - real(r8), pointer :: fsun(:) !sunlit fraction of canopy - real(r8), pointer :: rb1(:) !leaf boundary layer resistance [s/m] - real(r8), pointer :: annlai(:,:) !12 months of monthly lai from input data set - real(r8), pointer :: mlaidiff(:) !difference in lai between month one and month two - real(r8), pointer :: velocity(:,:) - real(r8), pointer :: snowdp(:) ! snow height (m) - - integer, pointer :: pcolumn(:) ! column index associated with each pft - integer :: c - integer , pointer :: itypelun(:) ! landunit type - - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) - real(r8) :: soilw, var_soilw, fact_h2, dv_soil_h2 - - ! new local variables - integer :: pi,g, l - integer :: ispec - integer :: length - integer :: wesveg !wesely vegegation index - integer :: clmveg !clm veg index from ivegtype - integer :: i - integer :: index_season !seasonal index based on LAI. This indexs wesely data tables - integer :: nstep !current step - integer :: indexp - - real(r8) :: pg ! surface pressure - real(r8) :: tc ! temperature in celsius - real(r8) :: rs ! constant for calculating rsmx - real(r8) :: es ! saturation vapor pressur - real(r8) :: ws ! saturation mixing ratio - real(r8) :: rmx ! resistance by vegetation - real(r8) :: qs ! saturation specific humidity - real(r8) :: dewm ! multiplier for rs when dew occurs - real(r8) :: crs ! multiplier to calculate crs - real(r8) :: rdc ! part of lower canopy resistance - real(r8) :: rain ! rain fall - real(r8) :: spec_hum ! specific humidity - real(r8) :: solar_flux ! solar radiation(direct beam) W/m2 - real(r8) :: lat ! latitude in degrees - real(r8) :: lon ! longitude in degrees - real(r8) :: sfc_temp ! surface temp - real(r8) :: minlai ! minimum of monthly lai - real(r8) :: maxlai ! maximum of monthly lai - real(r8) :: rds ! resistance for aerosols - - !mvm 11/30/2013 - real(r8) :: rlu_lai ! constant to calculate rlu over bulk canopy - real(r8) :: rs_factor ! constant to optimize stomatal resistance - - logical :: has_dew - logical :: has_rain - real(r8), parameter :: rain_threshold = 1.e-7_r8 ! of the order of 1cm/day expressed in m/s - - ! local arrays: dependent on species only - ! - - real(r8), dimension(n_drydep) :: rsmx !vegetative resistance (plant mesophyll) - real(r8), dimension(n_drydep) :: rclx !lower canopy resistance - real(r8), dimension(n_drydep) :: rlux !vegetative resistance (upper canopy) - real(r8), dimension(n_drydep) :: rgsx !gournd resistance - real(r8), dimension(n_drydep) :: heff - real(r8) :: rc !combined surface resistance - real(r8) :: cts !correction to flu rcl and rgs for frost - real(r8) :: rlux_o3 !to calculate O3 leaf resistance in dew/rain conditions - - ! constants - real(r8), parameter :: slope = 0._r8 ! Used to calculate rdc in (lower canopy resistance) - integer, parameter :: wveg_unset = -1 ! Unset Wesley vegetation type - - character(len=32), parameter :: subname = "depvel_compute" - - !------------------------------------------------------------------------------------- - ! jfl : mods for PAN - !------------------------------------------------------------------------------------- - real(r8) :: dv_pan - real(r8) :: c0_pan(11) = (/ 0.000_r8, 0.006_r8, 0.002_r8, 0.009_r8, 0.015_r8, & - 0.006_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.002_r8, 0.002_r8 /) - real(r8) :: k_pan (11) = (/ 0.000_r8, 0.010_r8, 0.005_r8, 0.004_r8, 0.003_r8, & - 0.005_r8, 0.000_r8, 0.000_r8, 0.000_r8, 0.075_r8, 0.002_r8 /) - !----------------------------------------------------------------------- - if ( n_drydep == 0 .or. drydep_method /= DD_XLND ) return - - ! local pointers to original implicit out arrays - - ! Assign local pointers to derived subtypes components (column-level) - forc_t => clm_a2l%forc_t - forc_q => clm_a2l%forc_q - forc_psrf => clm_a2l%forc_pbot - forc_rain => clm_a2l%forc_rain - - latdeg => grc%latdeg - londeg => grc%londeg - ivt => pft%itype - elai => pps%elai - ram1 => pps%ram1 - vds => pps%vds - fsun => pps%fsun - rssun => pps%rssun - rssha => pps%rssha - rb1 => pps%rb1 - mlaidiff => pps%mlaidiff - annlai => pps%annlai - - forc_solai => clm_a2l%forc_solai - forc_solad => clm_a2l%forc_solad - - pwtgcell => pft%wtgcell - pgridcell => pft%gridcell - plandunit => pft%landunit - - pcolumn => pft%column - itypelun => lun%itype - - h2osoi_vol => cws%h2osoi_vol - - velocity => pdd%drydepvel ! cm/sec - - snowdp => cps%snowdp - - ! Assign local pointers to original implicit out arrays - !_________________________________________________________________ - ! - ! Begin loop through pfts - pft_loop: do pi = lbp,ubp - l = plandunit(pi) - - ! Note: some glacier_mec pfts may have zero weight - gcell_wght: if (pwtgcell(pi)>0._r8 .or. itypelun(l)==istice_mec) then - - c = pcolumn(pi) - g = pgridcell(pi) - pg = forc_psrf(g) - spec_hum = forc_q(g) - rain = forc_rain(g) - sfc_temp = forc_t(g) - lat = latdeg(g) - lon = londeg(g) - solar_flux = forc_solad(g,1) - clmveg = ivt(pi) - soilw = h2osoi_vol(c,1) - - !map CLM veg type into Wesely veg type - wesveg = wveg_unset - if (clmveg == noveg ) wesveg = 8 - if (clmveg == ndllf_evr_tmp_tree ) wesveg = 5 - if (clmveg == ndllf_evr_brl_tree ) wesveg = 5 - if (clmveg == ndllf_dcd_brl_tree ) wesveg = 5 - if (clmveg == nbrdlf_evr_trp_tree ) wesveg = 4 - if (clmveg == nbrdlf_evr_tmp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_trp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_tmp_tree ) wesveg = 4 - if (clmveg == nbrdlf_dcd_brl_tree ) wesveg = 4 - if (clmveg == nbrdlf_evr_shrub ) wesveg = 11 - if (clmveg == nbrdlf_dcd_tmp_shrub ) wesveg = 11 - if (clmveg == nbrdlf_dcd_brl_shrub ) wesveg = 11 - if (clmveg == nc3_arctic_grass ) wesveg = 3 - if (clmveg == nc3_nonarctic_grass ) wesveg = 3 - if (clmveg == nc4_grass ) wesveg = 3 - if (clmveg == nc3crop ) wesveg = 2 - if (clmveg == nirrig ) wesveg = 2 - if (clmveg >= npcropmin .and. clmveg <= npcropmax ) wesveg = 2 - if (wesveg == wveg_unset )then - write(iulog,*) 'clmveg = ', clmveg, 'itypelun = ', itypelun(l) - call endrun( subname//': Not able to determine Wesley vegetation type') - end if - - ! create seasonality index used to index wesely data tables from LAI, Bascially - !if elai is between max lai from input data and half that max the index_season=1 - - - !mail1j and mlai2j are the two monthly lai values pulled from a CLM input data set - !/fs/cgd/csm/inputdata/lnd/clm2/rawdata/mksrf_lai.nc. lai for dates in the middle - !of the month are interpolated using using these values and stored in the variable - !elai (done elsewhere). If the difference between mlai1j and mlai2j is greater - !than zero it is assumed to be fall and less than zero it is assumed to be spring. - - !wesely seasonal "index_season" - ! 1 - midsummer with lush vegetation - ! 2 - Autumn with unharvested cropland - ! 3 - Late autumn after frost, no snow - ! 4 - Winter, snow on ground and subfreezing - ! 5 - Transitional spring with partially green short annuals - - - !mlaidiff=jan-feb - minlai=minval(annlai(:,pi)) - maxlai=maxval(annlai(:,pi)) - - index_season = -1 - - if ( itypelun(l) /= istsoil )then - if ( itypelun(l) == istice .or. itypelun(l) == istice_mec ) then - wesveg = 8 - index_season = 4 - elseif ( itypelun(l) == istdlak .or. itypelun(l) == istslak ) then - wesveg = 7 - index_season = 4 - elseif ( itypelun(l) == istwet ) then - wesveg = 9 - index_season = 2 - elseif ( itypelun(l) == isturb ) then - wesveg = 1 - index_season = 2 - end if - else if ( snowdp(c) > 0 ) then - index_season = 4 - else if(elai(pi).gt.0.5_r8*maxlai) then - index_season = 1 - endif - - if (index_season<0) then - if (elai(pi).lt.(minlai+0.05*(maxlai-minlai))) then - index_season = 3 - endif - endif - - if (index_season<0) then - if (mlaidiff(pi).gt.0.0_r8) then - index_season = 2 - elseif (mlaidiff(pi).lt.0.0_r8) then - index_season = 5 - elseif (mlaidiff(pi).eq.0.0_r8) then - index_season = 3 - endif - endif - - if (index_season<0) then - call endrun( subname//': not able to determine season') - endif - - ! saturation specific humidity - ! - es = 611_r8*exp(5414.77_r8*((1._r8/tmelt)-(1._r8/sfc_temp))) - ws = .622_r8*es/(pg-es) - qs = ws/(1._r8+ws) - - has_dew = .false. - if( qs <= spec_hum ) then - has_dew = .true. - end if - if( sfc_temp < tmelt ) then - has_dew = .false. - end if - - has_rain = rain > rain_threshold - - if ( has_dew .or. has_rain ) then - dewm = 3._r8 - else - dewm = 1._r8 - end if - - !Define tc - tc = sfc_temp - tmelt - - ! - ! rdc (lower canopy res) - ! - rdc=100._r8*(1._r8+1000._r8/(solar_flux+10._r8))/(1._r8+1000._r8*slope) - - ! surface resistance : depends on both land type and species - ! land types are computed seperately, then resistance is computed as average of values - ! following wesely rc=(1/(rs+rm) + 1/rlu +1/(rdc+rcl) + 1/(rac+rgs))**-1 - - !******************************************************* - call seq_drydep_setHCoeff( sfc_temp, heff(:n_drydep) ) - !********************************************************* - - species_loop1: do ispec=1, n_drydep - if(mapping(ispec).le.0) cycle - - if(ispec.eq.index_o3.or.ispec.eq.index_o3a.or.ispec.eq.index_so2) then - rmx=0._r8 - else - rmx=1._r8/((heff(ispec)/3000._r8)+(100._r8*foxd(ispec))) - endif - - ! correction for frost - cts = 1000._r8*exp( -tc - 4._r8 ) - - !ground resistance - rgsx(ispec) = 1._r8/((heff(ispec)/(1.e5_r8*(rgss(index_season,wesveg)+cts))) + & - (foxd(ispec)/(rgso(index_season,wesveg)+cts))) - - !------------------------------------------------------------------------------------- - ! special case for H2 and CO;; CH4 is set ot a fraction of dv(H2) - !------------------------------------------------------------------------------------- - if( ispec == index_h2 .or. ispec == index_co .or. ispec == index_ch4 ) then - - if( ispec == index_co ) then - fact_h2 = 1.0_r8 - elseif ( ispec == index_h2 ) then - fact_h2 = 0.5_r8 - elseif ( ispec == index_ch4 ) then - fact_h2 = 50.0_r8 - end if - - !------------------------------------------------------------------------------------- - ! no deposition on snow, ice, desert, and water - !------------------------------------------------------------------------------------- - if( wesveg == 1 .or. wesveg == 7 .or. wesveg == 8 .or. index_season == 4 ) then - rgsx(ispec) = 1.e36_r8 - else - var_soilw = max( .1_r8,min( soilw,.3_r8 ) ) - if( wesveg == 3 ) then - var_soilw = log( var_soilw ) - end if - dv_soil_h2 = h2_c(wesveg) + var_soilw*(h2_b(wesveg) + var_soilw*h2_a(wesveg)) - if( dv_soil_h2 > 0._r8 ) then - rgsx(ispec) = fact_h2/(dv_soil_h2*1.e-4_r8) - end if - end if - end if - - !------------------------------------------------------------------------------------- - ! no deposition on water or no vegetation or snow (elai<=0) - !------------------------------------------------------------------------------------- - - no_dep: if( wesveg == 7 .or. elai(pi).le.0_r8 ) then !mvm 11/26/2013 - rclx(ispec)=1.e36_r8 - rsmx(ispec)=1.e36_r8 - rlux(ispec)=1.e36_r8 - else - - !Stomatal resistance - !MVM: adjusted rs to calculate stomata conductance over bulk canopy (CLM report pag 161) - rs=(fsun(pi)*rssun(pi)/elai(pi))+((rssha(pi)/elai(pi))*(1.-fsun(pi))) - - !MVM: rs_factor=0.2 to match up Rs observations (Padro et al, 1996) - rs_factor = 0.2_r8 - rsmx(ispec) = rs_factor*rs*drat(ispec)+rmx - - ! Leaf resistance - !MVM: adjusted rlu by LAI to get leaf resistance over bulk canopy (gao and wesely, 1995) - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec) = rlu_lai/(1.e-5_r8*heff(ispec)+foxd(ispec)) - - !Lower canopy resistance - rclx(ispec) = 1._r8/((heff(ispec)/(1.e5_r8*(rcls(index_season,wesveg)+cts))) + & - (foxd(ispec)/(rclo(index_season,wesveg)+cts))) - - !----------------------------------- - !mvm 11/30/2013: special case for CO - !Dry deposition of CO and hydrocarbons is negligibly - !small in vegetation [Mueller and Brasseur, 1995]. - !------------------------------------ - if( ispec == index_co ) then - rclx(ispec)=1.e36_r8 - rsmx(ispec)=1.e36_r8 - rlux(ispec)=1.e36_r8 - endif - - !-------------------------------------------- - ! jfl : special case for PAN - !-------------------------------------------- - if( ispec == index_pan ) then - dv_pan = c0_pan(wesveg) * (1._r8 - exp(-k_pan(wesveg)*(rs*drat(ispec))*1.e-2_r8 )) - - if( dv_pan > 0._r8 .and. index_season /= 4 ) then - rsmx(ispec) = ( 1._r8/dv_pan ) - end if - end if - - endif no_dep - - end do species_loop1 - - - !---------------------------------------------- - !Adjustment for dew and rain in leaf resitances - !--------------------------------------------- - ! no effect over water - no_water: if( wesveg.ne.7 ) then - !MVM: effect only on vegetated areas (elai> 0) - with_LAI: if (elai(pi).gt.0._r8) then - - ! - ! no effect if sfc_temp < O C - ! - non_freezing: if(sfc_temp.gt.tmelt) then - if( has_dew ) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux_o3 = 1._r8/((1._r8/3000._r8)+(1._r8/(3._r8*rlu_lai))) - - if (index_o3 > 0) then - rlux(index_o3) = rlux_o3 - endif - if (index_o3a > 0) then - rlux(index_o3a) = rlux_o3 - endif - endif - - if(has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux_o3 = 1._r8/((1._r8/1000._r8)+(1._r8/(3._r8*rlu_lai))) - - if (index_o3 > 0) then - rlux(index_o3) = rlux_o3 - endif - if (index_o3a > 0) then - rlux(index_o3a) = rlux_o3 - endif - endif - - species_loop2: do ispec=1,n_drydep - if(mapping(ispec).le.0) cycle - if(ispec.ne.index_o3.and.ispec.ne.index_o3a.and.ispec.ne.index_so2) then - - if( has_dew .or. has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec)=1._r8/((1._r8/(3._r8*rlu_lai))+ & - (1.e-7_r8*heff(ispec))+(foxd(ispec)/rlux_o3)) - endif - - elseif(ispec.eq.index_so2) then - - if( has_dew ) then - rlux(ispec) = 100._r8 - endif - - if(has_rain) then - rlu_lai=cts+rlu(index_season,wesveg)/elai(pi) - rlux(ispec) = 1._r8/((1._r8/5000._r8)+(1._r8/(3._r8*rlu_lai))) - endif - - if( has_dew .or. has_rain ) then - !MVM:rlux=50 for SO2 in dew or rain only for *urban land* type surfaces. - if (wesveg.eq.1) then - rlux(ispec)=50._r8 - endif - endif - end if - !mvm 11/30/2013: special case for CO - if( ispec.eq.index_co ) then - rlux(ispec)=1.e36_r8 - endif - end do species_loop2 - endif non_freezing - endif with_LAI - endif no_water - - ! resistance for aerosols - rds = 1._r8/vds(pi) - - species_loop3: do ispec=1,n_drydep - if(mapping(ispec).le.0) cycle - - ! - ! compute rc - ! - rc = 1._r8/((1._r8/rsmx(ispec))+(1._r8/rlux(ispec)) + & - (1._r8/(rdc+rclx(ispec)))+(1._r8/(rac(index_season,wesveg)+rgsx(ispec)))) - rc = max( 10._r8, rc) - ! - ! assume no surface resistance for SO2 over water - ! - if ( drydep_list(ispec) == 'SO2' .and. wesveg == 7 ) then - rc = 0._r8 - end if - - select case( drydep_list(ispec) ) - case ( 'SO4' ) - velocity(pi,ispec) = (1._r8/(ram1(pi)+rds))*100._r8 - case ( 'NH4','NH4NO3','XNH4NO3' ) - velocity(pi,ispec) = (1._r8/(ram1(pi)+0.5_r8*rds))*100._r8 - case ( 'Pb' ) - velocity(pi,ispec) = 0.2_r8 - case ( 'CB1', 'CB2', 'OC1', 'OC2', 'SOAM', 'SOAI', 'SOAT', 'SOAB', 'SOAX' ) - velocity(pi,ispec) = 0.10_r8 - case default - velocity(pi,ispec) = (1._r8/(ram1(pi)+rb1(pi)+rc))*100._r8 - end select - end do species_loop3 - endif gcell_wght - end do pft_loop - - end subroutine depvel_compute - -end module DryDepVelocity diff --git a/src_clm40/biogeochem/MEGANFactorsMod.F90 b/src_clm40/biogeochem/MEGANFactorsMod.F90 deleted file mode 100644 index 2d045d9e53..0000000000 --- a/src_clm40/biogeochem/MEGANFactorsMod.F90 +++ /dev/null @@ -1,319 +0,0 @@ -module MEGANFactorsMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: MEGANFactorsMod -! -! !DESCRIPTION: -! Manages input of MEGAN emissions factors from netCDF file -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : iulog -! - implicit none - private - save -! -! !PUBLIC MEMBERS: - public :: megan_factors_init - public :: megan_factors_get - public :: comp_names -! -! !PUBLIC DATA: - real(r8), public, allocatable :: LDF(:) ! light dependent fraction - real(r8), public, allocatable :: Agro(:) ! growing leaf age factor - real(r8), public, allocatable :: Amat(:) ! mature leaf age factor - real(r8), public, allocatable :: Anew(:) ! new leaf age factor - real(r8), public, allocatable :: Aold(:) ! old leaf age factor - real(r8), public, allocatable :: betaT(:)! temperature factor - real(r8), public, allocatable :: ct1(:) ! temperature coefficient 1 - real(r8), public, allocatable :: ct2(:) ! temperature coefficient 2 - real(r8), public, allocatable :: Ceo(:) ! Eopt coefficient -! -! !PRIVATE MEMBERS: - integer :: npfts ! number of plant function types -! - type emis_eff_t - real(r8), pointer :: eff(:) ! emissions efficiency factor - real(r8) :: wght ! molecular weight - integer :: class_num ! MEGAN class number - endtype emis_eff_t -! - type(emis_eff_t), pointer :: comp_factors_table(:) ! hash table of MEGAN factors (points to an array of pointers) - integer, pointer :: hash_table_indices(:) ! pointer to hash table indices - integer, parameter :: tbl_hash_sz = 2**16 ! hash table size -! - character(len=32), allocatable :: comp_names(:) ! MEGAN compound names - real(r8), allocatable :: comp_molecwghts(:)! MEGAN compound molecular weights -! -! !REVISION HISTORY: -! 28 Oct 2011: Created by Francis Vitt -! -!EOP -!----------------------------------------------------------------------- -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: megan_factors_get -! -! !INTERFACE: - subroutine megan_factors_get( comp_name, factors, class_n, molecwght ) -! -! !DESCRIPTION: -! Method for getting MEGAN information for a named compound -! -! !ARGUMENTS: - character(len=*),intent(in) :: comp_name ! MEGAN compound name - real(r8), intent(out) :: factors(npfts) ! vegitation type factors for the compound of intrest - integer, intent(out) :: class_n ! MEGAN class number for the compound of intrest - real(r8), intent(out) :: molecwght ! molecular weight of the compound of intrest -! -!EOP -!----------------------------------------------------------------------- -! local vars: - integer :: hashkey, ndx - character(len=120) :: errmes - - hashkey = gen_hashkey(comp_name) - ndx = hash_table_indices(hashkey) - - if (ndx<1) then - errmes = 'megan_factors_get: '//trim(comp_name)//' compound not found in MEGAN table' - write(iulog,*) trim(errmes) - call endrun(errmes) - endif - - factors(:) = comp_factors_table( ndx )%eff(:) - class_n = comp_factors_table( ndx )%class_num - molecwght = comp_factors_table( ndx )%wght - - end subroutine megan_factors_get -!----------------------------------------------------------------------- -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: megan_factors_init -! -! !INTERFACE: - subroutine megan_factors_init( filename ) -! -! !DESCRIPTION: -! Initializes the MEGAN factors using data from input file -! -! !USES: - use ncdio_pio, only : ncd_pio_openfile,ncd_inqdlen - use pio, only : pio_inq_varid,pio_get_var,file_desc_t,pio_closefile - use fileutils , only : getfil -! -! !ARGUMENTS: - character(len=*),intent(in) :: filename ! MEGAN factors input file - -!EOP -!----------------------------------------------------------------------- -! - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - - integer :: start(2), count(2) - - integer :: ierr, i, vid - integer :: dimid, n_comps, n_classes, n_pfts - integer :: class_ef_vid,comp_ef_vid,comp_name_vid,class_num_vid - integer :: comp_mw_vid - integer, allocatable :: class_nums(:) - - real(r8),allocatable :: factors(:) - real(r8),allocatable :: comp_factors(:) - real(r8),allocatable :: class_factors(:) - - allocate(comp_factors_table(150)) - allocate(hash_table_indices(tbl_hash_sz)) - - - call getfil(filename, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - call ncd_inqdlen( ncid, dimid, n_comps, name='Comp_Num') - call ncd_inqdlen( ncid, dimid, n_classes, name='Class_Num') - call ncd_inqdlen( ncid, dimid, n_pfts, name='PFT_Num') - - npfts = n_pfts - - ierr = pio_inq_varid(ncid,'Class_EF', class_ef_vid) - ierr = pio_inq_varid(ncid,'Comp_EF', comp_ef_vid) - ierr = pio_inq_varid(ncid,'Comp_Name',comp_name_vid) - ierr = pio_inq_varid(ncid,'Class_Num',class_num_vid) - ierr = pio_inq_varid(ncid,'Comp_MW', comp_mw_vid) - - allocate( factors(n_pfts) ) - allocate( comp_factors(n_pfts) ) - allocate( class_factors(n_pfts) ) - - allocate( comp_names(n_comps) ) - allocate( comp_molecwghts(n_comps) ) - allocate( class_nums(n_comps) ) - - ierr = pio_get_var( ncid, comp_name_vid, comp_names ) - ierr = pio_get_var( ncid, comp_mw_vid, comp_molecwghts ) - ierr = pio_get_var( ncid, class_num_vid, class_nums ) - - ! set up hash table where data is stored - call bld_hash_table_indices( comp_names ) - do i=1,n_comps - start=(/i,1/) - count=(/1,16/) - ierr = pio_get_var( ncid, comp_ef_vid, start, count, comp_factors ) - start=(/class_nums(i),1/) - ierr = pio_get_var( ncid, class_ef_vid, start, count, class_factors ) - factors(:) = comp_factors(:)*class_factors(:) - call enter_hash_data( trim(comp_names(i)), factors, class_nums(i), comp_molecwghts(i) ) - enddo - - allocate( LDF(n_classes) ) - allocate( Agro(n_classes) ) - allocate( Amat(n_classes) ) - allocate( Anew(n_classes) ) - allocate( Aold(n_classes) ) - allocate( betaT(n_classes) ) - allocate( ct1(n_classes) ) - allocate( ct2(n_classes) ) - allocate( Ceo(n_classes) ) - - ierr = pio_inq_varid(ncid,'LDF', vid) - ierr = pio_get_var( ncid, vid, LDF ) - - ierr = pio_inq_varid(ncid,'Agro', vid) - ierr = pio_get_var( ncid, vid, Agro ) - - ierr = pio_inq_varid(ncid,'Amat', vid) - ierr = pio_get_var( ncid, vid, Amat ) - - ierr = pio_inq_varid(ncid,'Anew', vid) - ierr = pio_get_var( ncid, vid, Anew ) - - ierr = pio_inq_varid(ncid,'Aold', vid) - ierr = pio_get_var( ncid, vid, Aold ) - - ierr = pio_inq_varid(ncid,'betaT', vid) - ierr = pio_get_var( ncid, vid, betaT ) - - ierr = pio_inq_varid(ncid,'ct1', vid) - ierr = pio_get_var( ncid, vid, ct1 ) - - ierr = pio_inq_varid(ncid,'ct2', vid) - ierr = pio_get_var( ncid, vid, ct2 ) - - ierr = pio_inq_varid(ncid,'Ceo', vid) - ierr = pio_get_var( ncid, vid, Ceo ) - - call pio_closefile(ncid) - - deallocate( class_nums, comp_factors,class_factors,factors ) - - endsubroutine megan_factors_init -!----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - ! Private methods... - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine bld_hash_table_indices( names ) - character(len=*),intent(in) :: names(:) - - integer :: n, i, hashkey - - hash_table_indices(:) = 0 - - n = size(names) - do i=1,n - hashkey = gen_hashkey(names(i)) - hash_table_indices(hashkey) = i - enddo - - endsubroutine bld_hash_table_indices - - !----------------------------------------------------------------------- - !----------------------------------------------------------------------- - subroutine enter_hash_data( name, data, class_n, molec_wght ) - character(len=*), intent(in) :: name - real(r8), intent(in) :: data(:) - integer, intent(in) :: class_n - real(r8), intent(in) :: molec_wght - - integer :: hashkey, ndx - integer :: nfactors - - hashkey = gen_hashkey(name) - nfactors = size(data) - - ndx = hash_table_indices(hashkey) - - allocate (comp_factors_table(ndx)%eff(nfactors)) - - comp_factors_table(ndx)%eff(:) = data(:) - comp_factors_table(ndx)%class_num = class_n - comp_factors_table(ndx)%wght = molec_wght - - end subroutine enter_hash_data - - !----------------------------------------------------------------------- - !from cam_history - ! - ! Purpose: Generate a hash key on the interval [0 .. tbl_hash_sz-1] - ! given a character string. - ! - ! Algorithm is a variant of perl's internal hashing function. - ! - !----------------------------------------------------------------------- - integer function gen_hashkey(string) - - implicit none - ! - ! Arguments: - ! - character(len=*), intent(in) :: string - ! - ! Local vars - ! - integer :: hash - integer :: i - - integer, parameter :: tbl_max_idx = 15 ! 2**N - 1 - integer, parameter :: gen_hash_key_offset = z'000053db' - integer, dimension(0:tbl_max_idx) :: tbl_gen_hash_key = (/61,59,53,47,43,41,37,31,29,23,17,13,11,7,3,1/) - - hash = gen_hash_key_offset - - if ( len_trim(string) /= 19 ) then - ! - ! Process arbitrary string length. - ! - do i = 1, len_trim(string) - hash = ieor(hash , (ichar(string(i:i)) * tbl_gen_hash_key(iand(i-1,tbl_max_idx)))) - end do - else - ! - ! Special case string length = 19 - ! - do i = 1, tbl_max_idx+1 - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-1)) - end do - do i = tbl_max_idx+2, len_trim(string) - hash = ieor(hash , ichar(string(i:i)) * tbl_gen_hash_key(i-tbl_max_idx-2)) - end do - end if - - gen_hashkey = iand(hash, tbl_hash_sz-1) - - return - - end function gen_hashkey - -end module MEGANFactorsMod - - diff --git a/src_clm40/biogeochem/STATICEcosysDynMod.F90 b/src_clm40/biogeochem/STATICEcosysDynMod.F90 deleted file mode 100644 index c7039c7942..0000000000 --- a/src_clm40/biogeochem/STATICEcosysDynMod.F90 +++ /dev/null @@ -1,549 +0,0 @@ -module STATICEcosysdynMOD - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: STATICEcosysDynMod -! -! !DESCRIPTION: -! Static Ecosystem dynamics: phenology, vegetation. This is for the CLM Satelitte Phenology -! model (CLMSP). Allow some subroutines to be used by the CLM Carbon Nitrogen model (CLMCN) -! so that DryDeposition code can get estimates of LAI differences between months. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : scmlat,scmlon,single_column - use clm_varctl, only : iulog - use perf_mod, only : t_startf, t_stopf - use spmdMod, only : masterproc - use ncdio_pio -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: EcosystemDyn ! CLMSP Ecosystem dynamics: phenology, vegetation - public :: EcosystemDynini ! Dynamically allocate memory - public :: interpMonthlyVeg ! interpolate monthly vegetation data - public :: readAnnualVegetation ! Read in annual vegetation (needed for Dry-deposition) -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE MEMBER FUNCTIONS: - private :: readMonthlyVegetation ! read monthly vegetation data for two months -! -! !PRIVATE TYPES: - integer , private :: InterpMonths1 ! saved month index - real(r8), private :: timwt(2) ! time weights for month 1 and month 2 - real(r8), private, allocatable :: mlai2t(:,:) ! lai for interpolation (2 months) - real(r8), private, allocatable :: msai2t(:,:) ! sai for interpolation (2 months) - real(r8), private, allocatable :: mhvt2t(:,:) ! top vegetation height for interpolation (2 months) - real(r8), private, allocatable :: mhvb2t(:,:) ! bottom vegetation height for interpolation(2 months) -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: EcosystemDynini -! -! !INTERFACE: - subroutine EcosystemDynini () -! -! !DESCRIPTION: -! Dynamically allocate memory and set to signaling NaN. -! -! !USES: - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use decompMod, only : get_proc_bounds -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! -! -! !LOCAL VARIABLES: -!EOP - integer :: ier ! error code - integer :: begp,endp ! local beg and end p index -!----------------------------------------------------------------------- - - InterpMonths1 = -999 ! saved month index - call get_proc_bounds(begp=begp,endp=endp) - - ier = 0 - if(.not.allocated(mlai2t))allocate (mlai2t(begp:endp,2), & - msai2t(begp:endp,2), & - mhvt2t(begp:endp,2), & - mhvb2t(begp:endp,2), stat=ier) - if (ier /= 0) then - write(iulog,*) 'EcosystemDynini allocation error' - call endrun - end if - - mlai2t(:,:) = nan - msai2t(:,:) = nan - mhvt2t(:,:) = nan - mhvb2t(:,:) = nan - - end subroutine EcosystemDynini - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: EcosystemDyn -! -! !INTERFACE: - subroutine EcosystemDyn(lbp, ubp, num_nolakep, filter_nolakep, doalb) -! -! !DESCRIPTION: -! Ecosystem dynamics: phenology, vegetation -! Calculates leaf areas (tlai, elai), stem areas (tsai, esai) and -! height (htop). -! -! !USES: - use clmtype - use pftvarcon, only : noveg, nc3crop, nbrdlf_dcd_brl_shrub -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points - logical, intent(in) :: doalb ! true = surface albedo calculation time step -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 2/1/02, Peter Thornton: Migrated to new data structure. -! 2/29/08, David Lawrence: revised snow burial fraction for short vegetation -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pcolumn(:) ! column index associated with each pft - real(r8), pointer :: snowdp(:) ! snow height (m) - integer , pointer :: ivt(:) ! pft vegetation type -! -! local pointers to implicit out arguments -! - real(r8), pointer :: tlai(:) ! one-sided leaf area index, no burying by snow - real(r8), pointer :: tsai(:) ! one-sided stem area index, no burying by snow - real(r8), pointer :: htop(:) ! canopy top (m) - real(r8), pointer :: hbot(:) ! canopy bottom (m) - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - integer , pointer :: frac_veg_nosno_alb(:) ! frac of vegetation not covered by snow [-] -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: fp,p,c ! indices - real(r8) :: ol ! thickness of canopy layer covered by snow (m) - real(r8) :: fb ! fraction of canopy layer covered by snow -!----------------------------------------------------------------------- - - if (doalb) then - - ! Assign local pointers to derived type scalar members (column-level) - - snowdp => cps%snowdp - - ! Assign local pointers to derived type scalar members (pftlevel) - - pcolumn => pft%column - tlai => pps%tlai - tsai => pps%tsai - elai => pps%elai - esai => pps%esai - htop => pps%htop - hbot => pps%hbot - frac_veg_nosno_alb => pps%frac_veg_nosno_alb - ivt => pft%itype - - do fp = 1, num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - - ! need to update elai and esai only every albedo time step so do not - ! have any inconsistency in lai and sai between SurfaceAlbedo calls (i.e., - ! if albedos are not done every time step). - ! leaf phenology - ! Set leaf and stem areas based on day of year - ! Interpolate leaf area index, stem area index, and vegetation heights - ! between two monthly - ! The weights below (timwt(1) and timwt(2)) were obtained by a call to - ! routine InterpMonthlyVeg in subroutine NCARlsm. - ! Field Monthly Values - ! ------------------------- - ! leaf area index LAI <- mlai1 and mlai2 - ! leaf area index SAI <- msai1 and msai2 - ! top height HTOP <- mhvt1 and mhvt2 - ! bottom height HBOT <- mhvb1 and mhvb2 - - tlai(p) = timwt(1)*mlai2t(p,1) + timwt(2)*mlai2t(p,2) - tsai(p) = timwt(1)*msai2t(p,1) + timwt(2)*msai2t(p,2) - htop(p) = timwt(1)*mhvt2t(p,1) + timwt(2)*mhvt2t(p,2) - hbot(p) = timwt(1)*mhvb2t(p,1) + timwt(2)*mhvb2t(p,2) - - ! adjust lai and sai for burying by snow. if exposed lai and sai - ! are less than 0.05, set equal to zero to prevent numerical - ! problems associated with very small lai and sai. - - ! snow burial fraction for short vegetation (e.g. grasses) as in - ! Wang and Zeng, 2007. - - if (ivt(p) > noveg .and. ivt(p) <= nbrdlf_dcd_brl_shrub ) then - ol = min( max(snowdp(c)-hbot(p), 0._r8), htop(p)-hbot(p)) - fb = 1._r8 - ol / max(1.e-06_r8, htop(p)-hbot(p)) - else - fb = 1._r8 - max(min(snowdp(c),0.2_r8),0._r8)/0.2_r8 ! 0.2m is assumed - !depth of snow required for complete burial of grasses - endif - - elai(p) = max(tlai(p)*fb, 0.0_r8) - esai(p) = max(tsai(p)*fb, 0.0_r8) - if (elai(p) < 0.05_r8) elai(p) = 0._r8 - if (esai(p) < 0.05_r8) esai(p) = 0._r8 - - ! Fraction of vegetation free of snow - - if ((elai(p) + esai(p)) >= 0.05_r8) then - frac_veg_nosno_alb(p) = 1 - else - frac_veg_nosno_alb(p) = 0 - end if - - end do ! end of pft loop - - end if !end of if-doalb block - - end subroutine EcosystemDyn - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: interpMonthlyVeg -! -! !INTERFACE: - subroutine interpMonthlyVeg () -! -! !DESCRIPTION: -! Determine if 2 new months of data are to be read. -! -! !USES: - use clm_varctl , only : fsurdat - use clm_time_manager, only : get_curr_date, get_step_size, & - get_perp_date, is_perpetual, get_nstep -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: kyr ! year (0, ...) for nstep+1 - integer :: kmo ! month (1, ..., 12) - integer :: kda ! day of month (1, ..., 31) - integer :: ksec ! seconds into current date for nstep+1 - real(r8):: dtime ! land model time step (sec) - real(r8):: t ! a fraction: kda/ndaypm - integer :: it(2) ! month 1 and month 2 (step 1) - integer :: months(2) ! months to be interpolated (1 to 12) - integer, dimension(12) :: ndaypm= & - (/31,28,31,30,31,30,31,31,30,31,30,31/) !days per month -!----------------------------------------------------------------------- - - dtime = get_step_size() - - if ( is_perpetual() ) then - call get_perp_date(kyr, kmo, kda, ksec, offset=int(dtime)) - else - call get_curr_date(kyr, kmo, kda, ksec, offset=int(dtime)) - end if - - t = (kda-0.5_r8) / ndaypm(kmo) - it(1) = t + 0.5_r8 - it(2) = it(1) + 1 - months(1) = kmo + it(1) - 1 - months(2) = kmo + it(2) - 1 - if (months(1) < 1) months(1) = 12 - if (months(2) > 12) months(2) = 1 - timwt(1) = (it(1)+0.5_r8) - t - timwt(2) = 1._r8-timwt(1) - - if (InterpMonths1 /= months(1)) then - if (masterproc) then - write(iulog,*) 'Attempting to read monthly vegetation data .....' - write(iulog,*) 'nstep = ',get_nstep(),' month = ',kmo,' day = ',kda - end if - call t_startf('readMonthlyVeg') - call readMonthlyVegetation (fsurdat, months) - InterpMonths1 = months(1) - call t_stopf('readMonthlyVeg') - end if - - end subroutine interpMonthlyVeg - -!----------------------------------------------------------------------- -! read 12 months of veg data for dry deposition -!----------------------------------------------------------------------- - - subroutine readAnnualVegetation ( ) - - use clmtype - use clm_varpar , only : numpft - use pftvarcon , only : noveg - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use fileutils , only : getfil - use clm_varctl , only : fsurdat - use shr_scam_mod, only : shr_scam_getCloseLatLon - - implicit none - - ! local vars - - type(file_desc_t) :: ncid ! netcdf id - real(r8), pointer :: annlai(:,:) ! 12 months of monthly lai from input data set - real(r8), pointer :: mlai(:,:) ! lai read from input files - integer :: ier ! error code - character(len=256) :: locfn ! local file name - integer :: g,k,l,m,n,p,ivt ! indices - integer :: ni,nj,ns ! indices - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: nlon_i ! number of input data longitudes - integer :: nlat_i ! number of input data latitudes - integer :: npft_i ! number of input data pft types - integer :: begp,endp ! beg and end local p index - integer :: begg,endg ! beg and end local g index - integer :: closelatidx,closelonidx ! single column vars - real(r8):: closelat,closelon ! single column vars - logical :: isgrid2d ! true => file is 2d - character(len=32) :: subname = 'readAnnualVegetation' - - annlai => pps%annlai - - ! Determine necessary indices - - call get_proc_bounds(begg=begg,endg=endg,begp=begp,endp=endp) - - allocate(mlai(begg:endg,0:numpft), stat=ier) - if (ier /= 0) then - write(iulog,*)subname, 'allocation error '; call endrun() - end if - - if (masterproc) then - write (iulog,*) 'Attempting to read annual vegetation data .....' - end if - - call getfil(fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun() - end if - call check_dim(ncid, 'lsmpft', numpft+1) - - if (single_column) then - call shr_scam_getCloseLatLon(locfn, scmlat, scmlon, & - closelat, closelon, closelatidx, closelonidx) - endif - - do k=1,12 !! loop over months and read vegetated data - - call ncd_io(ncid=ncid, varname='MONTHLY_LAI', flag='read', data=mlai, & - dim1name=grlnd, nt=k) - - !! store data directly in clmtype structure - !! only vegetated pfts have nonzero values - !! Assign lai/sai/hgtt/hgtb to the top [maxpatch_pft] pfts - !! as determined in subroutine surfrd - - do p = begp,endp - g = pft%gridcell(p) - ivt = pft%itype(p) - if (ivt /= noveg) then !! vegetated pft - do l = 0, numpft - if (l == ivt) then - annlai(k,p) = mlai(g,l) - end if - end do - else !! non-vegetated pft - annlai(k,p) = 0._r8 - end if - end do ! end of loop over pfts - - enddo ! months loop - - call ncd_pio_closefile(ncid) - - deallocate(mlai) - - endsubroutine readAnnualVegetation - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: readMonthlyVegetation -! -! !INTERFACE: - subroutine readMonthlyVegetation (fveg, months) -! -! !DESCRIPTION: -! Read monthly vegetation data for two consec. months. -! -! !USES: - use clmtype - use decompMod , only : get_proc_bounds - use clm_varpar , only : numpft - use pftvarcon , only : noveg - use fileutils , only : getfil - use spmdMod , only : masterproc, mpicom, MPI_REAL8, MPI_INTEGER - use shr_scam_mod, only : shr_scam_getCloseLatLon - use clm_time_manager, only : get_nstep - use netcdf -! -! !ARGUMENTS: - implicit none - - character(len=*), intent(in) :: fveg ! file with monthly vegetation data - integer, intent(in) :: months(2) ! months to be interpolated (1 to 12) -! -! !REVISION HISTORY: -! Created by Sam Levis -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: g,n,k,l,m,p,ivt,ni,nj,ns ! indices - integer :: dimid,varid ! input netCDF id's - integer :: ntim ! number of input data time samples - integer :: nlon_i ! number of input data longitudes - integer :: nlat_i ! number of input data latitudes - integer :: npft_i ! number of input data pft types - integer :: begp,endp ! beg and end local p index - integer :: begg,endg ! beg and end local g index - integer :: ier ! error code - integer :: closelatidx,closelonidx - real(r8):: closelat,closelon - logical :: readvar - real(r8), pointer :: mlai(:,:) ! lai read from input files - real(r8), pointer :: msai(:,:) ! sai read from input files - real(r8), pointer :: mhgtt(:,:) ! top vegetation height - real(r8), pointer :: mhgtb(:,:) ! bottom vegetation height - real(r8), pointer :: mlaidiff(:) ! difference between lai month one and month two - character(len=32) :: subname = 'readMonthlyVegetation' -!----------------------------------------------------------------------- - - ! Determine necessary indices - - call get_proc_bounds(begg=begg,endg=endg,begp=begp,endp=endp) - - allocate(mlai(begg:endg,0:numpft), & - msai(begg:endg,0:numpft), & - mhgtt(begg:endg,0:numpft), & - mhgtb(begg:endg,0:numpft), & - stat=ier) - if (ier /= 0) then - write(iulog,*)subname, 'allocation big error '; call endrun() - end if - - ! ---------------------------------------------------------------------- - ! Open monthly vegetation file - ! Read data and convert from gridcell to pft data - ! ---------------------------------------------------------------------- - - call getfil(fveg, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - if (single_column) then - call shr_scam_getCloseLatLon (ncid, scmlat, scmlon, closelat, closelon,& - closelatidx, closelonidx) - endif - - do k=1,2 !loop over months and read vegetated data - - call ncd_io(ncid=ncid, varname='MONTHLY_LAI', flag='read', data=mlai, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: MONTHLY_LAI NOT on fveg file' ) - - call ncd_io(ncid=ncid, varname='MONTHLY_SAI', flag='read', data=msai, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: MONTHLY_SAI NOT on fveg file' ) - - call ncd_io(ncid=ncid, varname='MONTHLY_HEIGHT_TOP', flag='read', data=mhgtt, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: MONTHLY_HEIGHT_TOP NOT on fveg file' ) - - call ncd_io(ncid=ncid, varname='MONTHLY_HEIGHT_BOT', flag='read', data=mhgtb, dim1name=grlnd, & - nt=months(k), readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: MONTHLY_HEIGHT_TOP NOT on fveg file' ) - - ! Store data directly in clmtype structure - ! only vegetated pfts have nonzero values - ! Assign lai/sai/hgtt/hgtb to the top [maxpatch_pft] pfts - ! as determined in subroutine surfrd - - do p = begp,endp - g = pft%gridcell(p) - ivt = pft%itype(p) - if (ivt /= noveg) then ! vegetated pft - do l = 0, numpft - if (l == ivt) then - mlai2t(p,k) = mlai(g,l) - msai2t(p,k) = msai(g,l) - mhvt2t(p,k) = mhgtt(g,l) - mhvb2t(p,k) = mhgtb(g,l) - end if - end do - else ! non-vegetated pft - mlai2t(p,k) = 0._r8 - msai2t(p,k) = 0._r8 - mhvt2t(p,k) = 0._r8 - mhvb2t(p,k) = 0._r8 - end if - end do ! end of loop over pfts - - end do ! end of loop over months - - call ncd_pio_closefile(ncid) - - if (masterproc) then - k = 2 - write(iulog,*) 'Successfully read monthly vegetation data for' - write(iulog,*) 'month ', months(k) - write(iulog,*) - end if - - deallocate(mlai, msai, mhgtt, mhgtb) - - mlaidiff => pps%mlaidiff - do p = begp,endp - mlaidiff(p)=mlai2t(p,1)-mlai2t(p,2) - enddo - - end subroutine readMonthlyVegetation - -end module STATICEcosysDynMod diff --git a/src_clm40/biogeochem/VOCEmissionMod.F90 b/src_clm40/biogeochem/VOCEmissionMod.F90 deleted file mode 100644 index c225a36d0f..0000000000 --- a/src_clm40/biogeochem/VOCEmissionMod.F90 +++ /dev/null @@ -1,1023 +0,0 @@ -module VOCEmissionMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: VOCEmissionMod -! -! !DESCRIPTION: -! Volatile organic compound emission -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varctl, only : iulog - use abortutils, only : endrun - use clm_varpar, only : numpft - use pftvarcon , only : ndllf_evr_tmp_tree, ndllf_evr_brl_tree, & - ndllf_dcd_brl_tree, nbrdlf_evr_trp_tree, & - nbrdlf_evr_tmp_tree, nbrdlf_dcd_brl_shrub, & - nbrdlf_dcd_trp_tree, nbrdlf_dcd_tmp_tree, & - nbrdlf_dcd_brl_tree, nbrdlf_evr_shrub, & - nc3_arctic_grass, nc3crop, & - nc4_grass, noveg - - use shr_megan_mod, only : shr_megan_megcomps_n, shr_megan_megcomp_t, shr_megan_linkedlist - use shr_megan_mod, only : shr_megan_mechcomps_n, shr_megan_mechcomps, shr_megan_mapped_emisfctrs - use MEGANFactorsMod,only : Agro, Amat, Anew, Aold, betaT, ct1, ct2, LDF, Ceo - -! -! !PUBLIC TYPES: - implicit none - save - - logical, parameter :: debug = .false. - -! -! -! !PUBLIC MEMBER FUNCTIONS: - public :: VOCEmission - public :: VOCEmission_init -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: VOCEmission -! -! !INTERFACE: - subroutine VOCEmission (lbp, ubp, num_soilp, filter_soilp ) -! -! ! NEW DESCRIPTION -! Volatile organic compound emission -! This code simulates volatile organic compound emissions following -! MEGAN (Model of Emissions of Gases and Aerosols from Nature) v2.1 -! for 20 compound classes. The original description of this -! algorithm (for isoprene only) can be found in Guenther et al., 2006 -! (we follow equations 2-9, 16-17, 20 for explicit canopy). -! The model scheme came be described as: -! E= epsilon * gamma * rho -! VOC flux (E) [ug m-2 h-1] is calculated from baseline emission -! factors (epsilon) [ug m-2 h-1] which are specified for each of the 16 -! CLM PFTs (in input file) OR in the case of isoprene, from -! mapped EFs for each PFT which reflect species divergence of emissions, -! particularly in North America. -! The emission activity factor (gamma) [unitless] for includes -! dependence on PPFT, temperature, LAI, leaf age and soil moisture. -! For isoprene only we also include the effect of CO2 inhibition as -! described by Heald et al., 2009. -! The canopy environment constant was calculated offline for CLM+CAM at -! standard conditions. -! We assume that the escape efficiency (rho) here is unity following -! Guenther et al., 2006. -! A manuscript describing MEGAN 2.1 and the implementation in CLM is -! in preparation: Guenther, Heald et al., 2012 -! Subroutine written to operate at the patch level. -! -! Input: to be read in with EFs and some parameters. -! Currently these are set in procedure init_EF_params -! Output: vocflx(shr_megan_mechcomps_n) !VOC flux [moles/m2/sec] -! -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_atmlnd , only : clm_a2l - use clmtype - use domainMod, only : ldomain - use clm_varcon , only : spval -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_soilp ! number of columns in soil pft filter - integer, intent(in) :: filter_soilp(num_soilp) ! pft filter for soil -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Sam Levis -! 2/1/02: Peter Thornton: migration to new data structure -! 4/15/06: Colette L. Heald: modify for updated MEGAN model (Guenther et al., 2006) -! 4/29/11: Colette L. Heald: expand MEGAN to 20 compound classes -! 7 Feb 2012: Francis Vitt: Implemented capability to specify MEGAN emissions in namelist -! and read in MEGAN factors from file. -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pgridcell(:) ! gridcell index of corresponding pft - integer , pointer :: pcolumn(:) ! column index of corresponding pft - integer , pointer :: ivt(:) ! pft vegetation type for current - real(r8), pointer :: t_veg(:) ! pft vegetation temperature (Kelvin) - real(r8), pointer :: fsun(:) ! sunlit fraction of canopy - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: clayfrac(:) ! fraction of soil that is clay - real(r8), pointer :: sandfrac(:) ! fraction of soil that is sand - real(r8), pointer :: forc_solad(:,:) ! direct beam radiation (visible only) - real(r8), pointer :: forc_solai(:,:) ! diffuse radiation (visible only) - real(r8), pointer :: elai_p(:) ! one-sided leaf area index from previous timestep - real(r8), pointer :: t_veg24(:) ! avg pft vegetation temperature for last 24 hrs - real(r8), pointer :: t_veg240(:) ! avg pft vegetation temperature for last 240 hrs - real(r8), pointer :: fsun24(:) ! sunlit fraction of canopy last 24 hrs - real(r8), pointer :: fsun240(:) ! sunlit fraction of canopy last 240 hrs - real(r8), pointer :: forc_solad24(:) ! direct beam radiation last 24hrs (visible only) - real(r8), pointer :: forc_solai24(:) ! diffuse radiation last 24hrs (visible only) - real(r8), pointer :: forc_solad240(:) ! direct beam radiation last 240hrs (visible only) - real(r8), pointer :: forc_solai240(:) ! diffuse radiation last 240hrs (visible only) - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (m3/m3) - real(r8), pointer :: h2osoi_ice(:,:) ! ice soil content (kg/m3) - real(r8), pointer :: dz(:,:) ! depth of layer (m) - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" (nlevgrnd) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) (nlevgrnd) - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) (nlevgrnd) - real(r8), pointer :: cisun(:) ! sunlit intracellular CO2 (Pa) - real(r8), pointer :: cisha(:) ! shaded intracellular CO2 (Pa) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: forc_pco2(:) ! CO2 partial pressure -! -! local pointers to original implicit out arrays -! - real(r8), pointer :: vocflx(:,:) ! VOC flux [moles/m2/sec] - real(r8), pointer :: vocflx_tot(:) ! VOC flux [moles/m2/sec] - - type(megan_out_type), pointer :: meg_out(:) ! fluxes for CLM history - - real(r8), pointer :: gamma_out(:) - real(r8), pointer :: gammaT_out(:) - real(r8), pointer :: gammaP_out(:) - real(r8), pointer :: gammaL_out(:) - real(r8), pointer :: gammaA_out(:) - real(r8), pointer :: gammaS_out(:) - real(r8), pointer :: gammaC_out(:) - - real(r8), pointer :: Eopt_out(:) - real(r8), pointer :: topt_out(:) - real(r8), pointer :: alpha_out(:) - real(r8), pointer :: cp_out(:) - real(r8), pointer :: paru_out(:) - real(r8), pointer :: par24u_out(:) - real(r8), pointer :: par240u_out(:) - real(r8), pointer :: para_out(:) - real(r8), pointer :: par24a_out(:) - real(r8), pointer :: par240a_out(:) - -! -! -! !OTHER LOCAL VARIABLES: -! - integer :: fp,p,g,c ! indices - real(r8) :: epsilon ! emission factor [ug m-2 h-1] - real(r8) :: par_sun ! temporary - real(r8) :: par24_sun ! temporary - real(r8) :: par240_sun ! temporary - real(r8) :: par_sha ! temporary - real(r8) :: par24_sha ! temporary - real(r8) :: par240_sha ! temporary - real(r8) :: gamma ! activity factor (accounting for light, T, age, LAI conditions) - real(r8) :: gamma_p ! activity factor for PPFD - real(r8) :: gamma_l ! activity factor for PPFD & LAI - real(r8) :: gamma_t ! activity factor for temperature - real(r8) :: gamma_a ! activity factor for leaf age - real(r8) :: gamma_sm ! activity factor for soil moisture - real(r8) :: gamma_c ! activity factor for CO2 (only isoprene) - - integer :: class_num, n_meg_comps, imech, imeg, ii - character(len=16) :: mech_name - - real(r8) :: vocflx_meg(shr_megan_megcomps_n) - type(shr_megan_megcomp_t), pointer :: meg_cmp - - real(r8) :: cp, alpha, Eopt, topt ! for history output - real(r8) :: co2_ppmv - - ! factor used convert MEGAN units [micro-grams/m2/hr] to CAM srf emis units [g/m2/sec] - real(r8), parameter :: megemis_units_factor = 1._r8/3600._r8/1.e6_r8 - -! real(r8) :: root_depth(0:numpft) ! Root depth [m] -! -!!----------------------------------------------------------------------- -! -! ! root depth (m) (defined based on Zeng et al., 2001, cf Guenther 2006) -! root_depth(noveg) = 0._r8 ! bare-soil -! root_depth(ndllf_evr_tmp_tree:ndllf_evr_brl_tree) = 1.8_r8 ! evergreen tree -! root_depth(ndllf_dcd_brl_tree) = 2.0_r8 ! needleleaf deciduous boreal tree -! root_depth(nbrdlf_evr_trp_tree:nbrdlf_evr_tmp_tree) = 3.0_r8 ! broadleaf evergreen tree -! root_depth(nbrdlf_dcd_trp_tree:nbrdlf_dcd_brl_tree) = 2.0_r8 ! broadleaf deciduous tree -! root_depth(nbrdlf_evr_shrub:nbrdlf_dcd_brl_shrub) = 2.5_r8 ! shrub -! root_depth(nc3_arctic_grass:numpft) = 1.5_r8 ! grass/crop -! -!----------------------------------------------------------------------- - if ( shr_megan_mechcomps_n < 1) return - - ! Assign local pointers to derived type members (gridcell-level) - forc_solad => clm_a2l%forc_solad - forc_solai => clm_a2l%forc_solai - forc_pbot => clm_a2l%forc_pbot - forc_pco2 => clm_a2l%forc_pco2 - - ! Assign local pointers to derived subtypes components (column-level) - h2osoi_vol => cws%h2osoi_vol - h2osoi_ice => cws%h2osoi_ice - dz => cps%dz - bsw => cps%bsw - watsat => cps%watsat - sucsat => cps%sucsat - - ! Assign local pointers to derived subtypes components (pft-level) - - pgridcell => pft%gridcell - pcolumn => pft%column - ivt => pft%itype - t_veg => pes%t_veg - fsun => pps%fsun - elai => pps%elai - clayfrac => pps%clayfrac - sandfrac => pps%sandfrac - - cisun => pps%cisun - cisha => pps%cisha - - vocflx => pvf%vocflx - vocflx_tot => pvf%vocflx_tot - meg_out => pvf%meg - - gammaL_out => pvf%gammaL_out - gammaT_out => pvf%gammaT_out - gammaP_out => pvf%gammaP_out - gammaA_out => pvf%gammaA_out - gammaS_out => pvf%gammaS_out - gammaC_out => pvf%gammaC_out - gamma_out => pvf%gamma_out - - Eopt_out => pvf%Eopt_out - topt_out => pvf%topt_out - alpha_out => pvf%alpha_out - cp_out => pvf%cp_out - paru_out => pvf%paru_out - par24u_out => pvf%par24u_out - par240u_out => pvf%par240u_out - para_out => pvf%para_out - par24a_out => pvf%par24a_out - par240a_out => pvf%par240a_out - - t_veg24 => pvs%t_veg24 - t_veg240 => pvs%t_veg240 - forc_solad24 => pvs%fsd24 - forc_solad240 => pvs%fsd240 - forc_solai24 => pvs%fsi24 - forc_solai240 => pvs%fsi240 - fsun24 => pvs%fsun24 - fsun240 => pvs%fsun240 - elai_p => pvs%elai_p - - ! initialize variables which get passed to the atmosphere - vocflx(lbp:ubp,:) = 0._r8 - vocflx_tot(lbp:ubp) = 0._r8 - - do imeg=1,shr_megan_megcomps_n - meg_out(imeg)%flux_out(lbp:ubp) = 0._r8 - enddo - - gamma_out(lbp:ubp) = spval - gammaP_out(lbp:ubp) = spval - gammaT_out(lbp:ubp) = spval - gammaA_out(lbp:ubp) = spval - gammaS_out(lbp:ubp) = spval - gammaL_out(lbp:ubp) = spval - gammaC_out(lbp:ubp) = spval - - paru_out(lbp:ubp) = spval - par24u_out(lbp:ubp) = spval - par240u_out(lbp:ubp) = spval - - para_out(lbp:ubp) = spval - par24a_out(lbp:ubp) = spval - par240a_out(lbp:ubp) = spval - - alpha_out(lbp:ubp) = spval - cp_out(lbp:ubp) = spval - - topt_out(lbp:ubp) = spval - Eopt_out(lbp:ubp) = spval - - ! Begin loop over points - !_______________________________________________________________________________ - do fp = 1,num_soilp - p = filter_soilp(fp) - g = pgridcell(p) - c = pcolumn(p) - - ! initialize EF - epsilon=0._r8 - - ! initalize to zero since this might not alway get set - ! this needs to be within the fp loop ... - vocflx_meg(:) = 0._r8 - - ! calculate VOC emissions for non-bare ground PFTs - if (ivt(p) > 0) then - gamma=0._r8 - - ! Calculate PAR: multiply w/m2 by 4.6 to get umol/m2/s for par (added 8/14/02) - !------------------------ - ! SUN: - par_sun = (forc_solad(g,1) + fsun(p) * forc_solai(g,1)) * 4.6_r8 - par24_sun = (forc_solad24(p) + fsun24(p) * forc_solai24(p)) * 4.6_r8 - par240_sun = (forc_solad240(p) + fsun240(p) * forc_solai240(p)) * 4.6_r8 - ! SHADE: - par_sha = ((1._r8 - fsun(p)) * forc_solai(g,1)) * 4.6_r8 - par24_sha = ((1._r8 - fsun24(p)) * forc_solai24(p)) * 4.6_r8 - par240_sha = ((1._r8 - fsun240(p)) * forc_solai240(p)) * 4.6_r8 - - ! Activity factor for LAI (Guenther et al., 2006): all species - gamma_l = get_gamma_L(fsun240(p), elai(p)) - - ! Activity factor for soil moisture: all species (commented out for now) -! gamma_sm = get_gamma_SM(clayfrac(p), sandfrac(p), h2osoi_vol(c,:), h2osoi_ice(c,:), & -! dz(c,:), bsw(c,:), watsat(c,:), sucsat(c,:), root_depth(ivt(p))) - gamma_sm = 1.0_r8 - - ! Loop through VOCs for light, temperature and leaf age activity factor & apply - ! all final activity factors to baseline emission factors - !_______________________________________________________________________________ - - ! loop over megan compounds - meg_cmp => shr_megan_linkedlist - meg_cmp_loop: do while(associated(meg_cmp)) - imeg = meg_cmp%index - - ! set emis factor - ! if specified, set EF for isoprene with mapped values - if ( trim(meg_cmp%name) == 'isoprene' .and. shr_megan_mapped_emisfctrs) then - epsilon = get_map_EF(ivt(p),g) - else - epsilon = meg_cmp%emis_factors(ivt(p)) - end if - - class_num = meg_cmp%class_number - - ! Activity factor for PPFD - gamma_p = get_gamma_P(par_sun, par24_sun, par240_sun, par_sha, par24_sha, par240_sha, & - fsun(p), fsun240(p), forc_solad240(p),forc_solai240(p), LDF(class_num), cp, alpha) - - ! Activity factor for T - gamma_t = get_gamma_T(t_veg240(p), t_veg24(p),t_veg(p), ct1(class_num), ct2(class_num),& - betaT(class_num),LDF(class_num), Ceo(class_num), Eopt, topt) - - ! Activity factor for Leaf Age - gamma_a = get_gamma_A(ivt(p), elai_p(p),elai(p),class_num) - - ! Activity factor for CO2 (only for isoprene) - if (trim(meg_cmp%name) == 'isoprene') then - co2_ppmv = 1.e6*forc_pco2(g)/forc_pbot(g) - gamma_c = get_gamma_C(cisun(p),cisha(p),forc_pbot(g),fsun(p), co2_ppmv) - else - gamma_c = 1._r8 - end if - - ! Calculate total scaling factor - gamma = gamma_l * gamma_sm * gamma_a * gamma_p * gamma_T * gamma_c - - if ( (gamma >=0.0_r8) .and. (gamma< 100._r8) ) then - - vocflx_meg(imeg) = epsilon * gamma * megemis_units_factor / meg_cmp%molec_weight ! moles/m2/sec - - ! assign to arrays for history file output (not weighted by landfrac) - meg_out(imeg)%flux_out(p) = meg_out(imeg)%flux_out(p) & - + epsilon * gamma * megemis_units_factor*1.e-3_r8 ! Kg/m2/sec - - if (imeg==1) then - ! - gamma_out(p)=gamma - gammaP_out(p)=gamma_p - gammaT_out(p)=gamma_t - gammaA_out(p)=gamma_a - gammaS_out(p)=gamma_sm - gammaL_out(p)=gamma_l - gammaC_out(p)=gamma_c - - paru_out(p)=par_sun - par24u_out(p)=par24_sun - par240u_out(p)=par240_sun - - para_out(p)=par_sha - par24a_out(p)=par24_sha - par240a_out(p)=par240_sha - - alpha_out(p)=alpha - cp_out(p)=cp - - topt_out(p)=topt - Eopt_out(p)=Eopt - - end if - endif - - if (debug .and. gamma > 0.0_r8) then - write(iulog,*) 'MEGAN: n, megan name, epsilon, gamma, vocflx: ', & - imeg, meg_cmp%name, epsilon, gamma, vocflx_meg(imeg), gamma_p,gamma_t,gamma_a,gamma_sm,gamma_l - endif - - meg_cmp => meg_cmp%next_megcomp - enddo meg_cmp_loop - - ! sum up the megan compound fluxes for the fluxes of chem mechanism compounds - do imech = 1,shr_megan_mechcomps_n - n_meg_comps = shr_megan_mechcomps(imech)%n_megan_comps - do imeg = 1,n_meg_comps ! loop over number of megan compounds that make up the nth mechanism compoud - ii = shr_megan_mechcomps(imech)%megan_comps(imeg)%ptr%index - vocflx(p,imech) = vocflx(p,imech) + vocflx_meg(ii) - enddo - vocflx_tot(p) = vocflx_tot(p) + vocflx(p,imech) ! moles/m2/sec - enddo - - end if ! ivt(1:15 only) - - enddo ! fp - - end subroutine VOCEmission -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! !IROUTINE: init_EF_params -! -! !INTERFACE: - subroutine VOCEmission_init( ) - ! Interface to set all input parameters for 20 VOC compound classes. - ! including EFs for 16(+1 bare ground) PFTs. - ! For now set all specified values, in future to be replaced with values read in from file. - ! (heald, 04/27/11) - - use shr_megan_mod, only : shr_megan_factors_file - use MEGANFactorsMod, only : megan_factors_init, megan_factors_get - -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! -! !USES -! -! !ARGUMENTS: - implicit none - -! character(len=*),intent(in) :: filename -! -! !LOCAL VARIABLES: -!----------------------------------------------------------------------- - - integer :: nmech, nmeg - type(shr_megan_megcomp_t), pointer :: meg_cmp - - integer :: class_num - real(r8) :: factors(numpft) - real(r8) :: molec_wght - - if ( shr_megan_mechcomps_n < 1) return - - call megan_factors_init( shr_megan_factors_file ) - - meg_cmp => shr_megan_linkedlist - do while(associated(meg_cmp)) - allocate(meg_cmp%emis_factors(numpft)) - call megan_factors_get( trim(meg_cmp%name), factors, class_num, molec_wght ) - meg_cmp%emis_factors = factors - meg_cmp%class_number = class_num - meg_cmp%molec_weight = molec_wght - meg_cmp => meg_cmp%next_megcomp - enddo - - end subroutine VOCEmission_init -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_map_EF -! -! !INTERFACE: -function get_map_EF(ivt_in,g_in) -! -! Get mapped EF for isoprene -! Use gridded values for 6 PFTs specified by MEGAN following -! Guenther et al. (2006). Map the numpft CLM PFTs to these 6. -! Units: [ug m-2 h-1] -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! - -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: - - ! varibles in - integer, intent(in) :: ivt_in - integer, intent(in) :: g_in - real(r8) :: get_map_EF - - real(r8), pointer :: efisop(:,:) ! emission factors for isoprene for each pft [ug m-2 h-1] - - ! assign local pointer - efisop => gve%efisop -!----------------------------------------------------------------------- - get_map_EF = 0._r8 - - if ( ivt_in == ndllf_evr_tmp_tree & - .or. ivt_in == ndllf_evr_brl_tree) then !fineleaf evergreen - get_map_EF = efisop(2,g_in) - else if (ivt_in == ndllf_dcd_brl_tree) then !fineleaf deciduous - get_map_EF = efisop(3,g_in) - else if (ivt_in >= nbrdlf_evr_trp_tree & - .and. ivt_in <= nbrdlf_dcd_brl_tree) then !broadleaf trees - get_map_EF = efisop(1,g_in) - else if (ivt_in >= nbrdlf_evr_shrub & - .and. ivt_in <= nbrdlf_dcd_brl_shrub) then !shrubs - get_map_EF = efisop(4,g_in) - else if (ivt_in >= nc3_arctic_grass & - .and. ivt_in <= nc4_grass) then !grass - get_map_EF = efisop(5,g_in) - else if (ivt_in >= nc3crop) then !crops - get_map_EF =efisop(6,g_in) - end if - -end function get_map_EF -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_P -! -! !INTERFACE: - function get_gamma_P(par_sun_in, par24_sun_in, par240_sun_in, par_sha_in, par24_sha_in, par240_sha_in, & - fsun_in, fsun240_in, forc_solad240_in,forc_solai240_in, LDF_in, cp, alpha) - -! Activity factor for PPFD (Guenther et al., 2006): all light dependent species -!------------------------- -! With distinction between sunlit and shaded leafs, weight scalings by -! fsun and fshade -! Scale total incident par by fraction of sunlit leaves (added on 1/2002) - -! fvitt -- forc_solad240, forc_solai240 can be zero when CLM finidat is specified -! which will cause par240 to be zero and produce NaNs via log(par240) -! dml -- fsun240 can be equal to or greater than one before 10 day averages are -! set on startup or if a new pft comes online during land cover change. -! Avoid this problem by only doing calculations with fsun240 when fsun240 is -! between 0 and 1 -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: par_sun_in - real(r8),intent(in) :: par24_sun_in - real(r8),intent(in) :: par240_sun_in - real(r8),intent(in) :: par_sha_in - real(r8),intent(in) :: par24_sha_in - real(r8),intent(in) :: par240_sha_in - real(r8),intent(in) :: fsun_in - real(r8),intent(in) :: fsun240_in - real(r8),intent(in) :: forc_solad240_in - real(r8),intent(in) :: forc_solai240_in - real(r8),intent(in) :: LDF_in - - real(r8),intent(out) :: cp ! temporary - real(r8),intent(out) :: alpha ! temporary - real(r8) :: gamma_p_LDF ! activity factor for PPFD - real(r8) :: get_gamma_P ! return value - - real(r8), parameter :: ca1 = 0.004_r8 ! empirical coefficent for alpha - real(r8), parameter :: ca2 = 0.0005_r8 ! empirical coefficent for alpha - real(r8), parameter :: ca3 = 0.0468_r8 ! empirical coefficent for cp - real(r8), parameter :: par0_sun = 200._r8 ! std conditions for past 24 hrs [umol/m2/s] - real(r8), parameter :: par0_shade = 50._r8 ! std conditions for past 24 hrs [umol/m2/s] - real(r8), parameter :: alpha_fix = 0.001_r8 ! empirical coefficient - real(r8), parameter :: cp_fix = 1.21_r8 ! empirical coefficient -! -! local pointers to implicit in arguments -! -!----------------------------------------------------------------------- - - if ( (fsun240_in > 0._r8) .and. (fsun240_in < 1._r8) .and. (forc_solad240_in > 0._r8) & - .and. (forc_solai240_in > 0._r8)) then - ! With alpha and cp calculated based on eq 6 and 7: - ! Note indexing for accumulated variables is all at pft level - ! SUN: - alpha = ca1 - ca2 * log(par240_sun_in) - cp = ca3 * exp(ca2 * (par24_sun_in-par0_sun))*par240_sun_in**(0.6_r8) - gamma_p_LDF = fsun_in * ( cp * alpha * par_sun_in * (1._r8 + alpha*alpha*par_sun_in*par_sun_in)**(-0.5_r8) ) - ! SHADE: - alpha = ca1 - ca2 * log(par240_sha_in) - cp = ca3 * exp(ca2 * (par_sha_in-par0_shade))*par240_sha_in**(0.6_r8) - gamma_p_LDF = gamma_p_LDF + (1._r8-fsun_in) * (cp*alpha*par_sha_in*(1._r8 + alpha*alpha*par_sha_in*par_sha_in)**(-0.5_r8)) - else - ! With fixed alpha and cp (from MEGAN User's Guide): - ! SUN: direct + diffuse - alpha = alpha_fix - cp = cp_fix - gamma_p_LDF = fsun_in * ( cp * alpha*par_sun_in * (1._r8 + alpha*alpha*par_sun_in*par_sun_in)**(-0.5_r8) ) - ! SHADE: diffuse - gamma_p_LDF = gamma_p_LDF + (1._r8-fsun_in) * (cp*alpha*par_sha_in*(1._r8 + alpha*alpha*par_sha_in*par_sha_in)**(-0.5_r8)) - end if - - ! Calculate total activity factor for PPFD accounting for light-dependent fraction - get_gamma_P = (1._r8 - LDF_in) + LDF_in * gamma_p_LDF - -end function get_gamma_P -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_L -! -! !INTERFACE: -function get_gamma_L(fsun240_in,elai_in) -! -! Activity factor for LAI (Guenther et al., 2006): all species -! Guenther et al., 2006 eq 3 -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! - -! !USES: - use clm_varcon , only : denice - use clm_varpar , only : nlevsoi -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: fsun240_in - real(r8),intent(in) :: elai_in - real(r8) :: get_gamma_L ! return value - - - ! parameters - real(r8), parameter :: cce = 0.30_r8 ! factor to set emissions to unity @ std - real(r8), parameter :: cce1 = 0.24_r8 ! same as Cce but for non-accumulated vars -!----------------------------------------------------------------------- - if ( (fsun240_in > 0.0_r8) .and. (fsun240_in < 1.e30_r8) ) then - get_gamma_L = cce * elai_in - else - get_gamma_L = cce1 * elai_in - end if - -end function get_gamma_L -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_SM -! -! !INTERFACE: -function get_gamma_SM(clayfrac_in, sandfrac_in, h2osoi_vol_in, h2osoi_ice_in, dz_in, & - bsw_in, watsat_in, sucsat_in, root_depth_in) -! -! Activity factor for soil moisture (Guenther et al., 2006): all species -!---------------------------------- -! Calculate the mean scaling factor throughout the root depth. -! wilting point potential is in units of matric potential (mm) -! (1 J/Kg = 0.001 MPa, approx = 0.1 m) -! convert to volumetric soil water using equation 7.118 of the CLM4 Technical Note -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! - -! !USES: - use clm_varcon , only : denice - use clm_varpar , only : nlevsoi -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: clayfrac_in - real(r8),intent(in) :: sandfrac_in - real(r8),intent(in) :: h2osoi_vol_in(nlevsoi) - real(r8),intent(in) :: h2osoi_ice_in(nlevsoi) - real(r8),intent(in) :: dz_in(nlevsoi) - real(r8),intent(in) :: bsw_in(nlevsoi) - real(r8),intent(in) :: watsat_in(nlevsoi) - real(r8),intent(in) :: sucsat_in(nlevsoi) - real(r8),intent(in) :: root_depth_in - - real(r8) :: get_gamma_SM - - ! local variables - integer :: j - real(r8) :: nl ! temporary number of soil levels - real(r8) :: theta_ice ! water content in ice in m3/m3 - real(r8) :: wilt ! wilting point in m3/m3 - real(r8) :: theta1 ! temporary - - ! parameters - real(r8), parameter :: deltheta1=0.06_r8 ! empirical coefficient - real(r8), parameter :: smpmax = 2.57e5_r8 ! maximum soil matrix potential - - if ((clayfrac_in > 0) .and. (sandfrac_in > 0)) then - get_gamma_SM = 0._r8 - nl=0._r8 - - do j = 1,nlevsoi - if (sum(dz_in(1:j)) < root_depth_in) then - theta_ice = h2osoi_ice_in(j)/(dz_in(j)*denice) - wilt = ((smpmax/sucsat_in(j))**(-1._r8/bsw_in(j))) * (watsat_in(j) - theta_ice) - theta1 = wilt + deltheta1 - if (h2osoi_vol_in(j) >= theta1) then - get_gamma_SM = get_gamma_SM + 1._r8 - else if ( (h2osoi_vol_in(j) > wilt) .and. (h2osoi_vol_in(j) < theta1) ) then - get_gamma_SM = get_gamma_SM + ( h2osoi_vol_in(j) - wilt ) / deltheta1 - else - get_gamma_SM = get_gamma_SM + 0._r8 - end if - nl=nl+1._r8 - end if - end do - - if (nl > 0._r8) then - get_gamma_SM = get_gamma_SM/nl - endif - - if (get_gamma_SM > 1.0_r8) then - write(iulog,*) 'healdSM > 1: gamma_SM, nl', get_gamma_SM, nl - get_gamma_SM=1.0_r8 - endif - - else - get_gamma_SM = 1.0_r8 - end if - - -end function get_gamma_SM -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_T -! -! !INTERFACE: -function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, LDF_in, Ceo_in, Eopt, topt) - -! Activity factor for temperature -!-------------------------------- -! Calculate both a light-dependent fraction as in Guenther et al., 2006 for isoprene -! of a max saturation type form. Also caculate a light-independent fraction of the -! form of an exponential. Final activity factor depends on light dependent fraction -! of compound type. -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: t_veg240_in - real(r8),intent(in) :: t_veg24_in - real(r8),intent(in) :: t_veg_in - real(r8),intent(in) :: ct1_in - real(r8),intent(in) :: ct2_in - real(r8),intent(in) :: betaT_in - real(r8),intent(in) :: LDF_in - real(r8),intent(in) :: Ceo_in - real(r8),intent(out) :: Eopt ! temporary - real(r8),intent(out) :: topt ! temporary - - ! local variables - real(r8) :: get_gamma_T - real(r8) :: gamma_t_LDF ! activity factor for temperature - real(r8) :: gamma_t_LIF ! activity factor for temperature - real(r8) :: x ! temporary - - ! parameters - real(r8), parameter :: co1 = 313._r8 ! empirical coefficient - real(r8), parameter :: co2 = 0.6_r8 ! empirical coefficient - real(r8), parameter :: co4 = 0.05_r8 ! empirical coefficient - real(r8), parameter :: tstd0 = 297_r8 ! std temperature [K] - real(r8), parameter :: topt_fix = 317._r8 ! std temperature [K] - real(r8), parameter :: Eopt_fix = 2.26_r8 ! empirical coefficient - real(r8), parameter :: ct3 = 0.00831_r8 ! empirical coefficient (0.0083 in User's Guide) - real(r8), parameter :: tstd = 303.15_r8 ! std temperature [K] - real(r8), parameter :: bet = 0.09_r8 ! beta empirical coefficient [K-1] -!----------------------------------------------------------------------- - - ! Light dependent fraction (Guenther et al., 2006) - if ( (t_veg240_in > 0.0_r8) .and. (t_veg240_in < 1.e30_r8) ) then - ! topt and Eopt from eq 8 and 9: - topt = co1 + (co2 * (t_veg240_in-tstd0)) - Eopt = Ceo_in * exp (co4 * (t_veg24_in-tstd0)) * exp(co4 * (t_veg240_in -tstd0)) - else - topt = topt_fix - Eopt = Eopt_fix - endif - x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 - gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x)/(ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) - - - ! Light independent fraction (of exp(beta T) form) - gamma_t_LIF = exp(betaT_in * (t_veg_in - tstd)) - - ! Calculate total activity factor for light as a function of light-dependent fraction - !-------------------------------- - get_gamma_T = (1-LDF_in)*gamma_T_LIF + LDF_in*gamma_T_LDF - -end function get_gamma_T -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_A -! -! !INTERFACE: -function get_gamma_A(ivt_in, elai_p_in,elai_in,nclass_in) - -! Activity factor for leaf age (Guenther et al., 2006) -!----------------------------- -! If not CNDV elai is constant therefore gamma_a=1.0 -! gamma_a set to unity for evergreens (PFTs 1, 2, 4, 5) -! Note that we assume here that the time step is shorter than the number of -!days after budbreak required to induce isoprene emissions (ti=12 days) and -! the number of days after budbreak to reach peak emission (tm=28 days) -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (4/27/11) -! -! !ARGUMENTS: - implicit none -! !LOCAL VARIABLES: - - ! varibles in - integer,intent(in) :: ivt_in - integer,intent(in) :: nclass_in - real(r8),intent(in) :: elai_p_in - real(r8),intent(in) :: elai_in - - real(r8) :: get_gamma_A - - ! local variables - real(r8) :: elai_prev ! lai for previous timestep - real(r8) :: fnew, fgro, fmat, fold ! fractions of leaves at different phenological stages - !----------------------------------------------------------------------- - if ( (ivt_in == ndllf_dcd_brl_tree) .or. (ivt_in >= nbrdlf_dcd_trp_tree) ) then ! non-evergreen - - if ( (elai_p_in > 0.0_r8) .and. (elai_p_in < 1.e30_r8) )then - elai_prev = 2._r8*elai_p_in-elai_in ! have accumulated average lai over last timestep - if (elai_prev == elai_in) then - fnew = 0.0_r8 - fgro = 0.0_r8 - fmat = 1.0_r8 - fold = 0.0_r8 - else if (elai_prev > elai_in) then - fnew = 0.0_r8 - fgro = 0.0_r8 - fmat = 1.0_r8 - (elai_prev - elai_in)/elai_prev - fold = (elai_prev - elai_in)/elai_prev - else if (elai_prev < elai_in) then - fnew = 1 - (elai_prev / elai_in) - fgro = 0.0_r8 - fmat = (elai_prev / elai_in) - fold = 0.0_r8 - end if - - get_gamma_A = fnew*Anew(nclass_in) + fgro*Agro(nclass_in) + fmat*Amat(nclass_in) + fold*Aold(nclass_in) - - else - get_gamma_A = 1.0_r8 - end if - - else - get_gamma_A = 1.0_r8 - end if - - - end function get_gamma_A -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -! FUNCTION: get_gamma_C -! -! !INTERFACE: - function get_gamma_C(cisun_in,cisha_in,forc_pbot_in,fsun_in, co2_ppmv) - -! Activity factor for instantaneous CO2 changes (Heald et al., 2009) -!------------------------- -! With distinction between sunlit and shaded leaves, weight scalings by -! fsun and fshade -! -! !CALLED FROM: VOCEmission -! -! !REVISION HISTORY: -! Author: Colette L. Heald (11/30/11) -! Louisa K. Emmons (16/03/2015) - implement Colette's intended code -! and use atmosphere CO2 (not nml setting) -! -! !USES: -! use clm_varctl, only : co2_ppmv ! corresponds to CCSM_CO2_PPMV set in env_conf.xml -! -! !ARGUMENTS: - implicit none -! !LOCAL VARIABLES: - - ! varibles in - real(r8),intent(in) :: cisun_in - real(r8),intent(in) :: cisha_in - real(r8),intent(in) :: forc_pbot_in - real(r8),intent(in) :: fsun_in - real(r8),intent(in) :: co2_ppmv - - real(r8) :: get_gamma_C - - ! local variables - real(r8) :: Ismax ! empirical coeff for CO2 - real(r8) :: h ! empirical coeff for CO2 - real(r8) :: Cstar ! empirical coeff for CO2 - real(r8) :: fint ! interpolation fraction for CO2 - real(r8) :: ci ! temporary sunlight/shade weighted cisun & cisha (umolCO2/mol) - real(r8) :: gamma_ci ! short-term exposure gamma - real(r8) :: gamma_ca ! long-term exposure gamma - !----------------------------------------------------------------------- - - - ! LONG-TERM EXPOSURE (based on ambient CO2, Ca) - !----------------------------------------------------------------------------- - gamma_ca = 1.344_r8 - ( (1.344_r8*(0.7_r8*co2_ppmv)**1.4614_r8)/(585._r8**1.4614_r8+(0.7_r8*co2_ppmv)**1.4614_r8) ) - - - ! SHORT-TERM EXPOSURE (based on intercellular CO2, Ci) - !----------------------------------------------------------------------------- - ! Determine long-term CO2 growth environment (ie. ambient CO2) and interpolate - ! parameters - if ( co2_ppmv < 400._r8 ) then - Ismax = 1.072_r8 - h = 1.70_r8 - Cstar = 1218._r8 - else if ( (co2_ppmv > 400._r8) .and. (co2_ppmv < 600._r8) ) then - fint = (co2_ppmv - 400._r8)/200._r8 - Ismax = fint*1.036_r8 + (1.- fint)*1.072_r8 - h = fint*2.0125_r8 + (1.- fint)*1.70_r8 - Cstar = fint*1150._r8 + (1.- fint)*1218._r8 - else if ( (co2_ppmv > 600._r8) .and. (co2_ppmv < 800._r8) ) then - fint = (co2_ppmv - 600._r8)/200._r8 - Ismax = fint*1.046_r8 + (1.- fint)*1.036_r8 - h = fint*1.5380_r8 + (1.- fint)*2.0125_r8 - Cstar = fint*2025._r8 + (1.- fint)*1150._r8 - else if ( co2_ppmv > 800._r8 ) then - Ismax = 1.014_r8 - h = 2.861_r8 - Cstar = 1525._r8 - end if - - ! Intercellular CO2 concentrations (ci) given in Pa, divide by atmos - ! pressure to get mixing ratio (umolCO2/mol) - if ( (cisun_in .gt. 0._r8) .and. (cisha_in .gt. 0._r8) .and. & - (cisun_in .eq. cisun_in) .and. (cisha_in .eq. cisha_in) .and. (forc_pbot_in > 0._r8) .and. (fsun_in > 0._r8) ) then - ci = ( fsun_in*cisun_in + (1._r8-fsun_in)*cisha_in )/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else if ( (cisun_in > 0.0_r8) .and. (cisun_in < 1.e30_r8) .and. (forc_pbot_in > 0._r8) .and. (fsun_in .eq. 1._r8) ) then - ci = cisun_in/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else if ( (cisha_in > 0.0_r8) .and. (cisha_in < 1.e30_r8) .and. (forc_pbot_in > 0._r8) .and. (fsun_in .eq. 0._r8) ) then - ci = cisha_in/forc_pbot_in * 1.e6_r8 - gamma_ci = Ismax - ( (Ismax*ci**h)/(Cstar**h+ci**h) ) - else - gamma_ci = 1._r8 - end if - - get_gamma_C = gamma_ci * gamma_ca - - end function get_gamma_C -!----------------------------------------------------------------------- - -end module VOCEmissionMod - - diff --git a/src_clm40/biogeophys/BalanceCheckMod.F90 b/src_clm40/biogeophys/BalanceCheckMod.F90 deleted file mode 100644 index 980690ff0c..0000000000 --- a/src_clm40/biogeophys/BalanceCheckMod.F90 +++ /dev/null @@ -1,735 +0,0 @@ -module BalanceCheckMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: BalanceCheckMod -! -! !DESCRIPTION: -! Water and energy balance check. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils, only: endrun - use clm_varctl, only: iulog -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: BeginWaterBalance ! Initialize water balance check - public :: BalanceCheck ! Water and energy balance check -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BeginWaterBalance -! -! !INTERFACE: - subroutine BeginWaterBalance(lbc, ubc, lbp, ubp, & - num_nolakec, filter_nolakec, num_lakec, filter_lakec, & - num_hydrologyc, filter_hydrologyc) -! -! !DESCRIPTION: -! Initialize column-level water balance at beginning of time step -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_varpar , only : nlevgrnd, nlevsoi - use subgridAveMod, only : p2c - use clm_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, & - icol_road_imperv -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_lakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_lakec(ubc-lbc+1) ! column filter for non-lake points - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(ubc-lbc+1) ! column filter for soil points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in variables -! - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: h2ocan_pft(:) ! canopy water (mm H2O) (pft-level) - real(r8), pointer :: wa(:) ! water in the unconfined aquifer (mm) - integer , pointer :: ctype(:) ! column type - real(r8), pointer :: zwt(:) ! water table depth (m) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) -! -! local pointers to original implicit out variables -! - real(r8), pointer :: h2ocan_col(:) ! canopy water (mm H2O) (column level) - real(r8), pointer :: begwb(:) ! water mass begining of the time step -! -! !OTHER LOCAL VARIABLES: -! - integer :: c, p, f, j, fc ! indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (column-level) - - h2osno => cws%h2osno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - begwb => cwbal%begwb - h2ocan_col => pws_a%h2ocan - wa => cws%wa - ctype => col%itype - zwt => cws%zwt - zi => cps%zi - - ! Assign local pointers to derived type members (pft-level) - - h2ocan_pft => pws%h2ocan - - ! Determine beginning water balance for time step - ! pft-level canopy water averaged to column - call p2c(num_nolakec, filter_nolakec, h2ocan_pft, h2ocan_col) - - do f = 1, num_hydrologyc - c = filter_hydrologyc(f) - if(zwt(c) <= zi(c,nlevsoi)) then - wa(c) = 5000._r8 - end if - end do - - do f = 1, num_nolakec - c = filter_nolakec(f) - if (ctype(c) == icol_roof .or. ctype(c) == icol_sunwall & - .or. ctype(c) == icol_shadewall .or. ctype(c) == icol_road_imperv) then - begwb(c) = h2ocan_col(c) + h2osno(c) - else - begwb(c) = h2ocan_col(c) + h2osno(c) + wa(c) - end if - end do - do j = 1, nlevgrnd - do f = 1, num_nolakec - c = filter_nolakec(f) - begwb(c) = begwb(c) + h2osoi_ice(c,j) + h2osoi_liq(c,j) - end do - end do - - do f = 1, num_lakec - c = filter_lakec(f) - begwb(c) = h2osno(c) - end do - - end subroutine BeginWaterBalance -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BalanceCheck -! -! !INTERFACE: - subroutine BalanceCheck(lbp, ubp, lbc, ubc, lbl, ubl, lbg, ubg) -! -! !DESCRIPTION: -! This subroutine accumulates the numerical truncation errors of the water -! and energy balance calculation. It is helpful to see the performance of -! the process of integration. -! -! The error for energy balance: -! -! error = abs(Net radiation - change of internal energy - Sensible heat -! - Latent heat) -! -! The error for water balance: -! -! error = abs(precipitation - change of water storage - evaporation - runoff) -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use subgridAveMod - use clm_time_manager , only : get_step_size, get_nstep - use clm_varcon , only : isturb, icol_roof, icol_sunwall, icol_shadewall, & - spval, icol_road_perv, icol_road_imperv, istice_mec, & - istdlak, istslak, istwet, istcrop, istsoil - use clm_varctl , only : glc_dyntopo -! -! !ARGUMENTS: - implicit none - integer :: lbp, ubp ! pft-index bounds - integer :: lbc, ubc ! column-index bounds - integer :: lbl, ubl ! landunit-index bounds - integer :: lbg, ubg ! grid-index bounds -! -! !CALLED FROM: -! subroutine clm_driver -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 10 November 2000: Mariana Vertenstein -! Migrated to new data structures by Mariana Vertenstein and -! Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - logical , pointer :: do_capsnow(:) ! true => do snow capping - real(r8), pointer :: qflx_floodc(:) ! total runoff due to flooding - real(r8), pointer :: qflx_snow_melt(:) ! snow melt (net) - real(r8), pointer :: qflx_rain_grnd_col(:) ! rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd_col(:) ! snow on ground after interception (mm H2O/s) [+] - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: cgridcell(:) ! column's gridcell index - integer , pointer :: clandunit(:) ! column's landunit index - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: ctype(:) ! column type - real(r8), pointer :: pwtgcell(:) ! pft's weight relative to corresponding gridcell - real(r8), pointer :: cwtgcell(:) ! column's weight relative to corresponding gridcell - real(r8), pointer :: forc_rain(:) ! rain rate [mm/s] - real(r8), pointer :: forc_snow(:) ! snow rate [mm/s] - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - real(r8), pointer :: endwb(:) ! water mass end of the time step - real(r8), pointer :: begwb(:) ! water mass begining of the time step - real(r8), pointer :: fsa(:) ! solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsr(:) ! solar radiation reflected (W/m**2) - real(r8), pointer :: eflx_lwrad_out(:) ! emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net(:) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: sabv(:) ! solar radiation absorbed by vegetation (W/m**2) - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: eflx_sh_tot(:) ! total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_totg(:) ! total sensible heat flux at grid level (W/m**2) [+ to atm] - real(r8), pointer :: eflx_dynbal(:) ! energy conversion flux due to dynamic land cover change(W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot(:) ! total latent heat flux (W/m8*2) [+ to atm] - real(r8), pointer :: eflx_soil_grnd(:) ! soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: qflx_irrig(:) ! irrigation flux (mm H2O /s) - real(r8), pointer :: qflx_surf(:) ! surface runoff (mm H2O /s) - real(r8), pointer :: qflx_qrgwl(:) ! qflx_surf at glaciers, wetlands, lakes - real(r8), pointer :: qflx_drain(:) ! sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_runoff(:) ! total runoff (mm H2O /s) - real(r8), pointer :: qflx_runoffg(:) ! total runoff at gridcell level inc land cover change flux (mm H2O /s) - real(r8), pointer :: qflx_liq_dynbal(:) ! liq runoff due to dynamic land cover change (mm H2O /s) - real(r8), pointer :: qflx_snwcp_ice(:) ! excess snowfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: qflx_glcice(:) ! flux of new glacier ice (mm H2O /s) [+ if ice grows] - real(r8), pointer :: qflx_glcice_frz(:) ! ice growth (mm H2O/s) [+] - real(r8), pointer :: qflx_snwcp_iceg(:) ! excess snowfall due to snow cap inc land cover change flux (mm H20/s) - real(r8), pointer :: qflx_ice_dynbal(:) ! ice runoff due to dynamic land cover change (mm H2O /s) - real(r8), pointer :: forc_solad(:,:) ! direct beam radiation (vis=forc_sols , nir=forc_soll ) - real(r8), pointer :: forc_solai(:,:) ! diffuse radiation (vis=forc_solsd, nir=forc_solld) - real(r8), pointer :: eflx_traffic_pft(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat_pft(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width - real(r8), pointer :: eflx_heat_from_ac_pft(:) !sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: h2osno_old(:) ! snow water (mm H2O) at previous time step - real(r8), pointer :: qflx_dew_snow(:) ! surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_sub_snow(:) ! sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_top_soil(:) ! net water input into soil from top (mm/s) - real(r8), pointer :: qflx_dew_grnd(:) ! ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: qflx_evap_grnd(:) ! ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_prec_grnd(:) ! water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_snwcp_liq(:) ! excess liquid water due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: qflx_sl_top_soil(:) ! liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) - integer , pointer :: snl(:) ! number of snow layers -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: errh2o(:) ! water conservation error (mm H2O) - real(r8), pointer :: errsol(:) ! solar radiation conservation error (W/m**2) - real(r8), pointer :: errlon(:) ! longwave radiation conservation error (W/m**2) - real(r8), pointer :: errseb(:) ! surface energy conservation error (W/m**2) - real(r8), pointer :: netrad(:) ! net radiation (positive downward) (W/m**2) - real(r8), pointer :: errsoi_col(:) ! column-level soil/lake energy conservation error (W/m**2) - real(r8), pointer :: snow_sources(:) ! snow sources (mm H2O /s) - real(r8), pointer :: snow_sinks(:) ! snow sinks (mm H2O /s) - real(r8), pointer :: errh2osno(:) ! error in h2osno (kg m-2) -! -!EOP -! -! !OTHER LOCAL VARIABLES: - integer :: p,c,l,g ! indices - real(r8) :: dtime ! land model time step (sec) - integer :: nstep ! time step number - logical :: found ! flag in search loop - integer :: indexp,indexc,indexl,indexg ! index of first found in search loop - real(r8) :: forc_rain_col(lbc:ubc) ! column level rain rate [mm/s] - real(r8) :: forc_snow_col(lbc:ubc) ! column level snow rate [mm/s] - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type scalar members (gridcell-level) - - do_capsnow => cps%do_capsnow - qflx_floodc => cwf%qflx_floodc - qflx_snow_melt => cwf%qflx_snow_melt - qflx_rain_grnd_col => pwf_a%qflx_rain_grnd - qflx_snow_grnd_col => pwf_a%qflx_snow_grnd - clandunit => col%landunit - forc_rain => clm_a2l%forc_rain - forc_snow => clm_a2l%forc_snow - forc_lwrad => clm_a2l%forc_lwrad - forc_solad => clm_a2l%forc_solad - forc_solai => clm_a2l%forc_solai - - ! Assign local pointers to derived type scalar members (landunit-level) - - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - - ! Assign local pointers to derived type scalar members (column-level) - - ctype => col%itype - cgridcell => col%gridcell - cwtgcell => col%wtgcell - endwb => cwbal%endwb - begwb => cwbal%begwb - qflx_irrig => cwf%qflx_irrig - qflx_surf => cwf%qflx_surf - qflx_qrgwl => cwf%qflx_qrgwl - qflx_drain => cwf%qflx_drain - qflx_runoff => cwf%qflx_runoff - qflx_snwcp_ice => pwf_a%qflx_snwcp_ice - qflx_evap_tot => pwf_a%qflx_evap_tot - qflx_glcice => cwf%qflx_glcice - qflx_glcice_frz => cwf%qflx_glcice_frz - errh2o => cwbal%errh2o - errsoi_col => cebal%errsoi - h2osno => cws%h2osno - h2osno_old => cws%h2osno_old - qflx_dew_snow => pwf_a%qflx_dew_snow - qflx_sub_snow => pwf_a%qflx_sub_snow - qflx_top_soil => cwf%qflx_top_soil - qflx_evap_grnd => pwf_a%qflx_evap_grnd - qflx_dew_grnd => pwf_a%qflx_dew_grnd - qflx_prec_grnd => pwf_a%qflx_prec_grnd - qflx_snwcp_liq => pwf_a%qflx_snwcp_liq - qflx_sl_top_soil => cwf%qflx_sl_top_soil - snow_sources => cws%snow_sources - snow_sinks => cws%snow_sinks - errh2osno => cws%errh2osno - snl => cps%snl - - ! Assign local pointers to derived type scalar members (pft-level) - - pgridcell => pft%gridcell - plandunit => pft%landunit - pwtgcell => pft%wtgcell - fsa => pef%fsa - fsr => pef%fsr - eflx_lwrad_out => pef%eflx_lwrad_out - eflx_lwrad_net => pef%eflx_lwrad_net - sabv => pef%sabv - sabg => pef%sabg - eflx_sh_tot => pef%eflx_sh_tot - eflx_lh_tot => pef%eflx_lh_tot - eflx_soil_grnd => pef%eflx_soil_grnd - errsol => pebal%errsol - errseb => pebal%errseb - errlon => pebal%errlon - netrad => pef%netrad - eflx_wasteheat_pft => pef%eflx_wasteheat_pft - eflx_heat_from_ac_pft => pef%eflx_heat_from_ac_pft - eflx_traffic_pft => pef%eflx_traffic_pft - - ! Assign local pointers to derived type scalar members (gridcell-level) - - qflx_runoffg => gwf%qflx_runoffg - qflx_liq_dynbal => gwf%qflx_liq_dynbal - qflx_snwcp_iceg => gwf%qflx_snwcp_iceg - qflx_ice_dynbal => gwf%qflx_ice_dynbal - eflx_sh_totg => gef%eflx_sh_totg - eflx_dynbal => gef%eflx_dynbal - - ! Get step size and time step - - nstep = get_nstep() - dtime = get_step_size() - - ! Determine column level incoming snow and rain - ! Assume no incident precipitation on urban wall columns (as in Hydrology1Mod.F90). - - do c = lbc,ubc - g = cgridcell(c) - if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall) then - forc_rain_col(c) = 0. - forc_snow_col(c) = 0. - else - forc_rain_col(c) = forc_rain(g) - forc_snow_col(c) = forc_snow(g) - end if - end do - - ! Water balance check - - do c = lbc, ubc - g = cgridcell(c) - l = clandunit(c) - - ! Note: Some glacier_mec cols may have zero weight - if (cwtgcell(c) > 0._r8 .or. ltype(l)==istice_mec)then - errh2o(c) = endwb(c) - begwb(c) & - - (forc_rain_col(c) + forc_snow_col(c) + qflx_irrig(c) + qflx_floodc(c) & - - qflx_evap_tot(c) - qflx_surf(c) & - - qflx_qrgwl(c) - qflx_drain(c) - qflx_snwcp_ice(c)) * dtime - - ! Suppose glc_dyntopo = T: - ! (1) We have qflx_snwcp_ice = 0, and excess snow has been incorporated in qflx_glcice. - ! This flux must be included here to complete the water balance. - ! (2) Meltwater from ice is allowed to run off and is included in qflx_qrgwl, - ! but the water content of the ice column has not changed (at least for now) because - ! an equivalent ice mass has been "borrowed" from the base of the column. That - ! meltwater is included in qflx_glcice. - ! - ! Note that qflx_glcice is only valid over ice_mec landunits; elsewhere it is spval - - if (glc_dyntopo .and. ltype(l)==istice_mec) then - errh2o(c) = errh2o(c) + qflx_glcice(c)*dtime - end if - - else - - errh2o(c) = 0.0_r8 - - end if - - end do - - found = .false. - do c = lbc, ubc - if (abs(errh2o(c)) > 1e-7_r8) then - found = .true. - indexc = c - end if - end do - if ( found ) then - write(iulog,*)'WARNING: water balance error ',& - ' nstep = ',nstep,' indexc= ',indexc,' errh2o= ',errh2o(indexc),' landunit type= ',ltype(clandunit(indexc)) - if ((ctype(indexc) .eq. icol_roof .or. ctype(indexc) .eq. icol_road_imperv .or. & - ctype(indexc) .eq. icol_road_perv) .and. abs(errh2o(indexc)) > 1.e-1 .and. (nstep > 2) ) then - write(iulog,*)'clm urban model is stopping - error is greater than 1.e-1' - write(iulog,*)'nstep = ',nstep,' indexc= ',indexc,' errh2o= ',errh2o(indexc) - write(iulog,*)'ctype(indexc): ',ctype(indexc) - write(iulog,*)'forc_rain = ',forc_rain_col(indexc) - write(iulog,*)'forc_snow = ',forc_snow_col(indexc) - write(iulog,*)'endwb = ',endwb(indexc) - write(iulog,*)'begwb = ',begwb(indexc) - write(iulog,*)'qflx_evap_tot= ',qflx_evap_tot(indexc) - write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc) - write(iulog,*)'qflx_surf = ',qflx_surf(indexc) - write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc) - write(iulog,*)'qflx_drain = ',qflx_drain(indexc) - write(iulog,*)'qflx_flood = ',qflx_floodc(indexc) - write(iulog,*)'qflx_snwcp_ice = ',qflx_snwcp_ice(indexc) - write(iulog,*)'clm model is stopping' - call endrun() - else if (abs(errh2o(indexc)) > .10_r8 .and. (nstep > 2) ) then - write(iulog,*)'clm model is stopping - error is greater than .10' - write(iulog,*)'nstep = ',nstep,' indexc= ',indexc,' errh2o= ',errh2o(indexc) - write(iulog,*)'ctype(indexc): ',ctype(indexc) - write(iulog,*)'forc_rain = ',forc_rain_col(indexc) - write(iulog,*)'forc_snow = ',forc_snow_col(indexc) - write(iulog,*)'endwb = ',endwb(indexc) - write(iulog,*)'begwb = ',begwb(indexc) - write(iulog,*)'qflx_evap_tot= ',qflx_evap_tot(indexc) - write(iulog,*)'qflx_irrig = ',qflx_irrig(indexc) - write(iulog,*)'qflx_surf = ',qflx_surf(indexc) - write(iulog,*)'qflx_qrgwl = ',qflx_qrgwl(indexc) - write(iulog,*)'qflx_drain = ',qflx_drain(indexc) - write(iulog,*)'qflx_flood = ',qflx_floodc(indexc) - write(iulog,*)'qflx_snwcp_ice = ',qflx_snwcp_ice(indexc) - write(iulog,*)'clm model is stopping' - call endrun() - end if - end if - - ! Snow balance check - do c = lbc, ubc - g = cgridcell(c) - l = clandunit(c) - ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at - ! any given time step but only if there is at least one snow layer. h2osno - ! also includes snow that is part of the soil column (an initial snow layer is - ! only created if h2osno > 10mm). - - ! --------------------------------------------------------------------- ! - ! SPM - brought in qflx_snow_melt to get snow - ! balance working after the flooding modifications were in place. - ! This new check is based on a perfrostsims branch of S. Swenson. - ! --------------------------------------------------------------------- ! - - if (snl(c) .lt. 0) then - snow_sources(c) = qflx_prec_grnd(c) + qflx_dew_snow(c) + qflx_dew_grnd(c) - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) + qflx_snow_melt(c) & - + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) + qflx_sl_top_soil(c) - - if (ltype(l) == istdlak) then - if ( do_capsnow(c) ) then - snow_sources(c) = qflx_snow_grnd_col(c) & - + qflx_dew_snow(c) + qflx_dew_grnd(c) - - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) & - + (qflx_snwcp_ice(c) + qflx_snwcp_liq(c) - qflx_prec_grnd(c)) & - + qflx_snow_melt(c) + qflx_sl_top_soil(c) - else - snow_sources(c) = qflx_snow_grnd_col(c) & - + qflx_rain_grnd_col(c) & - + qflx_dew_snow(c) + qflx_dew_grnd(c) - - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) & - + qflx_snow_melt(c) + qflx_sl_top_soil(c) - endif - endif - - if (ltype(l) == istsoil .or. ltype(l) == istcrop .or. ltype(l) == istwet ) then - if ( do_capsnow(c) ) then - snow_sources(c) = qflx_dew_snow(c) + qflx_dew_grnd(c) & - + qflx_prec_grnd(c) - - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) & - + qflx_snwcp_ice(c) + qflx_snwcp_liq(c) & - + qflx_snow_melt(c) + qflx_sl_top_soil(c) - else - snow_sources(c) = qflx_snow_grnd_col(c) & - + qflx_rain_grnd_col(c) & - + qflx_dew_snow(c) + qflx_dew_grnd(c) - - snow_sinks(c) = qflx_sub_snow(c) + qflx_evap_grnd(c) & - + qflx_snow_melt(c) + qflx_sl_top_soil(c) - endif - endif - - if (ltype(l) == istice_mec .and. glc_dyntopo) then - snow_sinks(c) = snow_sinks(c) + qflx_glcice_frz(c) - end if - - errh2osno(c) = (h2osno(c) - h2osno_old(c)) - (snow_sources(c) - snow_sinks(c)) * dtime - else - snow_sources(c) = 0._r8 - snow_sinks(c) = 0._r8 - errh2osno(c) = 0._r8 - end if - end do - - found = .false. - do c = lbc, ubc - if (cwtgcell(c) > 0._r8 .and. abs(errh2osno(c)) > 1.0e-7_r8) then - found = .true. - indexc = c - end if - end do - - if ( found ) then - write(iulog,*)'WARNING: snow balance error ',& - ' nstep = ',nstep,' indexc= ',indexc,' errh2osno= ',errh2osno(indexc) - if (abs(errh2osno(indexc)) > 0.1_r8 .and. (nstep > 2) ) then - write(iulog,*)'clm model is stopping - error is greater than .10' - write(iulog,*)'nstep = ',nstep,' indexc= ',indexc,' errh2osno= ',errh2osno(indexc) - write(iulog,*)'ltype: ', ltype(clandunit(indexc)) - write(iulog,*)'ctype(indexc): ',ctype(indexc) - write(iulog,*)'snl: ',snl(indexc) - write(iulog,*)'h2osno: ',h2osno(indexc) - write(iulog,*)'h2osno_old: ',h2osno_old(indexc) - write(iulog,*)'snow_sources: ', snow_sources(indexc) - write(iulog,*)'snow_sinks: ', snow_sinks(indexc) - write(iulog,*)'qflx_prec_grnd: ',qflx_prec_grnd(indexc)*dtime - write(iulog,*)'qflx_sub_snow: ',qflx_sub_snow(indexc)*dtime - write(iulog,*)'qflx_evap_grnd: ',qflx_evap_grnd(indexc)*dtime - write(iulog,*)'qflx_top_soil: ',qflx_top_soil(indexc)*dtime - write(iulog,*)'qflx_dew_snow: ',qflx_dew_snow(indexc)*dtime - write(iulog,*)'qflx_dew_grnd: ',qflx_dew_grnd(indexc)*dtime - write(iulog,*)'qflx_snwcp_ice: ',qflx_snwcp_ice(indexc)*dtime - write(iulog,*)'qflx_snow_melt: ',qflx_snow_melt(indexc)*dtime - write(iulog,*)'qflx_snwcp_liq: ',qflx_snwcp_liq(indexc)*dtime - write(iulog,*)'qflx_sl_top_soil: ',qflx_sl_top_soil(indexc)*dtime - write(iulog,*)'qflx_glcice_frz: ',qflx_glcice_frz(indexc)*dtime - write(iulog,*)'clm model is stopping' - call endrun() - end if - end if - - ! Energy balance checks - - do p = lbp, ubp - l = plandunit(p) - ! Note: Some glacier_mec pfts may have zero weight - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - g = pgridcell(p) - - ! Solar radiation energy balance - ! Do not do this check for an urban pft since it will not balance on a per-column - ! level because of interactions between columns and since a separate check is done - ! in the urban radiation module - if (ltype(l) /= isturb) then - errsol(p) = fsa(p) + fsr(p) & - - (forc_solad(g,1) + forc_solad(g,2) + forc_solai(g,1) + forc_solai(g,2)) - else - errsol(p) = spval - end if - - ! Longwave radiation energy balance - ! Do not do this check for an urban pft since it will not balance on a per-column - ! level because of interactions between columns and since a separate check is done - ! in the urban radiation module - if (ltype(l) /= isturb) then - errlon(p) = eflx_lwrad_out(p) - eflx_lwrad_net(p) - forc_lwrad(g) - else - errlon(p) = spval - end if - - ! Surface energy balance - ! Changed to using (eflx_lwrad_net) here instead of (forc_lwrad - eflx_lwrad_out) because - ! there are longwave interactions between urban columns (and therefore pfts). - ! For surfaces other than urban, (eflx_lwrad_net) equals (forc_lwrad - eflx_lwrad_out), - ! and a separate check is done above for these terms. - - if (ltype(l) /= isturb) then - errseb(p) = sabv(p) + sabg(p) + forc_lwrad(g) - eflx_lwrad_out(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) - else - errseb(p) = sabv(p) + sabg(p) & - - eflx_lwrad_net(p) & - - eflx_sh_tot(p) - eflx_lh_tot(p) - eflx_soil_grnd(p) & - + eflx_wasteheat_pft(p) + eflx_heat_from_ac_pft(p) + eflx_traffic_pft(p) - end if - netrad(p) = fsa(p) - eflx_lwrad_net(p) - end if - end do - - ! Solar radiation energy balance check - - found = .false. - do p = lbp, ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > .10_r8) ) then - found = .true. - indexp = p - indexg = pgridcell(p) - end if - end if - end do - if ( found .and. (nstep > 2) ) then - write(iulog,100)'BalanceCheck: solar radiation balance error', nstep, indexp, errsol(indexp) - write(iulog,*)'fsa = ',fsa(indexp) - write(iulog,*)'fsr = ',fsr(indexp) - write(iulog,*)'forc_solad(1)= ',forc_solad(indexg,1) - write(iulog,*)'forc_solad(2)= ',forc_solad(indexg,2) - write(iulog,*)'forc_solai(1)= ',forc_solai(indexg,1) - write(iulog,*)'forc_solai(2)= ',forc_solai(indexg,2) - write(iulog,*)'forc_tot = ',forc_solad(indexg,1)+forc_solad(indexg,2)& - +forc_solai(indexg,1)+forc_solai(indexg,2) - write(iulog,*)'clm model is stopping' - call endrun() - end if - - ! Longwave radiation energy balance check - - found = .false. - do p = lbp, ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - if ( (errlon(p) /= spval) .and. (abs(errlon(p)) > .10_r8) ) then - found = .true. - indexp = p - end if - end if - end do - if ( found .and. (nstep > 2) ) then - write(iulog,100)'BalanceCheck: longwave enery balance error',nstep,indexp,errlon(indexp) - write(iulog,*)'clm model is stopping' - call endrun() - end if - - ! Surface energy balance check - - found = .false. - do p = lbp, ubp - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - if (abs(errseb(p)) > .10_r8 ) then - found = .true. - indexp = p - end if - end if - end do - if ( found .and. (nstep > 2) ) then - write(iulog,100)'BalanceCheck: surface flux energy balance error',nstep,indexp,errseb(indexp) - write(iulog,*)' sabv = ',sabv(indexp) - write(iulog,*)' sabg = ',sabg(indexp) - write(iulog,*)' eflx_lwrad_net = ',eflx_lwrad_net(indexp) - write(iulog,*)' eflx_sh_tot = ',eflx_sh_tot(indexp) - write(iulog,*)' eflx_lh_tot = ',eflx_lh_tot(indexp) - write(iulog,*)' eflx_soil_grnd = ',eflx_soil_grnd(indexp) - write(iulog,*)'clm model is stopping' - call endrun() - end if - - ! Soil energy balance check - - found = .false. - do c = lbc, ubc - if (abs(errsoi_col(c)) > 1.0e-7_r8 ) then - found = .true. - indexc = c - end if - end do - if ( found ) then - write(iulog,100)'BalanceCheck: soil balance error',nstep,indexc,errsoi_col(indexc) - if (abs(errsoi_col(indexc)) > .10_r8 .and. (nstep > 2) ) then - write(iulog,*)'clm model is stopping' - call endrun() - end if - end if - - ! Update SH and RUNOFF for dynamic land cover change energy and water fluxes - call c2g( lbc, ubc, lbl, ubl, lbg, ubg, & - qflx_runoff(lbc:ubc), qflx_runoffg(lbg:ubg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - do g = lbg, ubg - qflx_runoffg(g) = qflx_runoffg(g) - qflx_liq_dynbal(g) - enddo - - call c2g( lbc, ubc, lbl, ubl, lbg, ubg, & - qflx_snwcp_ice(lbc:ubc), qflx_snwcp_iceg(lbg:ubg), & - c2l_scale_type= 'urbanf', l2g_scale_type='unity' ) - do g = lbg, ubg - qflx_snwcp_iceg(g) = qflx_snwcp_iceg(g) - qflx_ice_dynbal(g) - enddo - - call p2g( lbp, ubp, lbc, ubc, lbl, ubl, lbg, ubg, & - eflx_sh_tot(lbp:ubp), eflx_sh_totg(lbg:ubg), & - p2c_scale_type='unity',c2l_scale_type='urbanf',l2g_scale_type='unity') - do g = lbg, ubg - eflx_sh_totg(g) = eflx_sh_totg(g) - eflx_dynbal(g) - enddo - -100 format (1x,a,' nstep =',i10,' point =',i6,' imbalance =',f12.6,' W/m2') -200 format (1x,a,' nstep =',i10,' point =',i6,' imbalance =',f12.6,' mm') - - end subroutine BalanceCheck - -end module BalanceCheckMod diff --git a/src_clm40/biogeophys/BareGroundFluxesMod.F90 b/src_clm40/biogeophys/BareGroundFluxesMod.F90 deleted file mode 100644 index 3e7ea8c815..0000000000 --- a/src_clm40/biogeophys/BareGroundFluxesMod.F90 +++ /dev/null @@ -1,441 +0,0 @@ -module BareGroundFluxesMod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: BareGroundFluxesMod -! -! !DESCRIPTION: -! Compute sensible and latent fluxes and their derivatives with respect -! to ground temperature using ground temperatures from previous time step. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: BareGroundFluxes ! Calculate sensible and latent heat fluxes -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: BareGroundFluxes -! -! !INTERFACE: - subroutine BareGroundFluxes(lbp, ubp, num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! Compute sensible and latent fluxes and their derivatives with respect -! to ground temperature using ground temperatures from previous time step. -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varpar , only : nlevgrnd - use clm_varcon , only : cpair, vkc, grav, denice, denh2o, istsoil - use clm_varcon , only : istcrop - use clm_varctl , only : use_c13 - use shr_const_mod , only : SHR_CONST_RGAS - use FrictionVelocityMod, only : FrictionVelocity, MoninObukIni - use QSatMod , only : QSat - -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_nolakep ! number of pft non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine Biogeophysics1 in module Biogeophysics1Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 12/19/01, Peter Thornton -! This routine originally had a long list of parameters, and also a reference to -! the entire clm derived type. For consistency, only the derived type reference -! is passed (now pointing to the current column and pft), and the other original -! parameters are initialized locally. Using t_grnd instead of tg (tg eliminated -! as redundant). -! 1/23/02, PET: Added pft reference as parameter. All outputs will be written -! to the pft data structures, and averaged to the column level outside of -! this routine. -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: frac_veg_nosno(:) ! fraction of vegetation not covered by snow (0 OR 1) [-] - real(r8), pointer :: t_grnd(:) ! ground surface temperature [K] - real(r8), pointer :: thm(:) ! intermediate variable (forc_t+0.0098*forc_hgt_t_pft) - real(r8), pointer :: qg(:) ! specific humidity at ground surface [kg/kg] - real(r8), pointer :: thv(:) ! virtual potential temperature (kelvin) - real(r8), pointer :: dqgdT(:) ! temperature derivative of "qg" - real(r8), pointer :: htvp(:) ! latent heat of evaporation (/sublimation) [J/kg] - real(r8), pointer :: beta(:) ! coefficient of conective velocity [-] - real(r8), pointer :: zii(:) ! convective boundary height [m] - real(r8), pointer :: forc_u(:) ! atmospheric wind speed in east direction (m/s) - real(r8), pointer :: forc_v(:) ! atmospheric wind speed in north direction (m/s) - real(r8), pointer :: forc_t(:) ! atmospheric temperature (Kelvin) - real(r8), pointer :: forc_th(:) ! atmospheric potential temperature (Kelvin) - real(r8), pointer :: forc_q(:) ! atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_rho(:) ! density (kg/m**3) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: forc_hgt_u_pft(:) ! observational height of wind at pft level [m] - real(r8), pointer :: psnsun(:) ! sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) ! shaded leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: z0mg_col(:) ! roughness length, momentum [m] - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: soilbeta(:) ! soil wetness relative to field capacity -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: z0hg_col(:) ! roughness length, sensible heat [m] - real(r8), pointer :: z0qg_col(:) ! roughness length, latent heat [m] -! -! local pointers to implicit out arguments -! - real(r8), pointer :: dlrad(:) ! downward longwave radiation below the canopy [W/m2] - real(r8), pointer :: ulrad(:) ! upward longwave radiation above the canopy [W/m2] - real(r8), pointer :: cgrnds(:) ! deriv, of soil sensible heat flux wrt soil temp [w/m2/k] - real(r8), pointer :: cgrndl(:) ! deriv of soil latent heat flux wrt soil temp [w/m**2/k] - real(r8), pointer :: cgrnd(:) ! deriv. of soil energy flux wrt to soil temp [w/m2/k] - real(r8), pointer :: taux(:) ! wind (shear) stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy(:) ! wind (shear) stress: n-s (kg/m/s**2) - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot(:) ! total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: q_ref2m(:) ! 2 m height surface specific humidity (kg/kg) - real(r8), pointer :: t_ref2m_r(:) ! Rural 2 m height surface air temperature (Kelvin) - real(r8), pointer :: rh_ref2m_r(:) ! Rural 2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m(:) ! 2 m height surface relative humidity (%) - real(r8), pointer :: t_veg(:) ! vegetation temperature (Kelvin) - real(r8), pointer :: btran(:) ! transpiration wetness factor (0 to 1) - real(r8), pointer :: rssun(:) ! sunlit stomatal resistance (s/m) - real(r8), pointer :: rssha(:) ! shaded stomatal resistance (s/m) - real(r8), pointer :: ram1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: fpsn(:) ! photosynthesis (umol CO2 /m**2 /s) - real(r8), pointer :: rootr(:,:) ! effective fraction of roots in each soil layer - real(r8), pointer :: rresis(:,:) ! root resistance by layer (0-1) (nlevgrnd) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer, parameter :: niters = 3 ! maximum number of iterations for surface temperature - integer :: p,c,g,f,j,l ! indices - integer :: filterp(ubp-lbp+1) ! pft filter for vegetated pfts - integer :: fn ! number of values in local pft filter - integer :: fp ! lake filter pft index - integer :: iter ! iteration index - real(r8) :: zldis(lbp:ubp) ! reference height "minus" zero displacement height [m] - real(r8) :: displa(lbp:ubp) ! displacement height [m] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: dth(lbp:ubp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dqh(lbp:ubp) ! diff of humidity between ref. height and surface - real(r8) :: obu(lbp:ubp) ! Monin-Obukhov length (m) - real(r8) :: ur(lbp:ubp) ! wind speed at reference height [m/s] - real(r8) :: um(lbp:ubp) ! wind speed including the stablity effect [m/s] - real(r8) :: temp1(lbp:ubp) ! relation for potential temperature profile - real(r8) :: temp12m(lbp:ubp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(lbp:ubp) ! relation for specific humidity profile - real(r8) :: temp22m(lbp:ubp) ! relation for specific humidity profile applied at 2-m - real(r8) :: ustar(lbp:ubp) ! friction velocity [m/s] - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: cf ! heat transfer coefficient from leaves [-] - real(r8) :: ram ! aerodynamical resistance [s/m] - real(r8) :: rah ! thermal resistance [s/m] - real(r8) :: raw ! moisture resistance [s/m] - real(r8) :: raih ! temporary variable [kg/m2/s] - real(r8) :: raiw ! temporary variable [kg/m2/s] - real(r8) :: fm(lbp:ubp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: z0mg_pft(lbp:ubp) - real(r8) :: z0hg_pft(lbp:ubp) - real(r8) :: z0qg_pft(lbp:ubp) - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - real(r8) :: www ! surface soil wetness [-] -!------------------------------------------------------------------------------ - - ! Assign local pointers to derived type members (gridcell-level) - - forc_u => clm_a2l%forc_u - forc_v => clm_a2l%forc_v - - ! Assign local pointers to derived type members (landunit-level) - - ltype => lun%itype - - ! Assign local pointers to derived type members (column-level) - - forc_th => ces%forc_th - forc_t => ces%forc_t - forc_pbot => cps%forc_pbot - forc_rho => cps%forc_rho - forc_q => cws%forc_q - pcolumn => pft%column - pgridcell => pft%gridcell - frac_veg_nosno => pps%frac_veg_nosno - dlrad => pef%dlrad - ulrad => pef%ulrad - t_grnd => ces%t_grnd - qg => cws%qg - z0mg_col => cps%z0mg - z0hg_col => cps%z0hg - z0qg_col => cps%z0qg - thv => ces%thv - beta => cps%beta - zii => cps%zii - ram1 => pps%ram1 - cgrnds => pef%cgrnds - cgrndl => pef%cgrndl - cgrnd => pef%cgrnd - dqgdT => cws%dqgdT - htvp => cps%htvp - watsat => cps%watsat - h2osoi_ice => cws%h2osoi_ice - dz => cps%dz - h2osoi_liq => cws%h2osoi_liq - frac_sno => cps%frac_sno - soilbeta => cws%soilbeta - - ! Assign local pointers to derived type members (pft-level) - - taux => pmf%taux - tauy => pmf%tauy - eflx_sh_grnd => pef%eflx_sh_grnd - eflx_sh_tot => pef%eflx_sh_tot - qflx_evap_soi => pwf%qflx_evap_soi - qflx_evap_tot => pwf%qflx_evap_tot - t_ref2m => pes%t_ref2m - q_ref2m => pes%q_ref2m - t_ref2m_r => pes%t_ref2m_r - rh_ref2m_r => pes%rh_ref2m_r - plandunit => pft%landunit - rh_ref2m => pes%rh_ref2m - t_veg => pes%t_veg - thm => pes%thm - btran => pps%btran - rssun => pps%rssun - rssha => pps%rssha - rootr => pps%rootr - rresis => pps%rresis - psnsun => pcf%psnsun - psnsha => pcf%psnsha - fpsn => pcf%fpsn - forc_hgt_u_pft => pps%forc_hgt_u_pft - - ! Filter pfts where frac_veg_nosno is zero - - fn = 0 - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (frac_veg_nosno(p) == 0) then - fn = fn + 1 - filterp(fn) = p - end if - end do - - ! Compute sensible and latent fluxes and their derivatives with respect - ! to ground temperature using ground temperatures from previous time step - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - ! Initialization variables - - displa(p) = 0._r8 - dlrad(p) = 0._r8 - ulrad(p) = 0._r8 - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-t_grnd(c) - dqh(p) = forc_q(c) - qg(c) - dthv = dth(p)*(1._r8+0.61_r8*forc_q(c))+0.61_r8*forc_th(c)*dqh(p) - zldis(p) = forc_hgt_u_pft(p) - - ! Copy column roughness to local pft-level arrays - - z0mg_pft(p) = z0mg_col(c) - z0hg_pft(p) = z0hg_col(c) - z0qg_pft(p) = z0qg_col(c) - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv, zldis(p), z0mg_pft(p), um(p), obu(p)) - - end do - - ! Perform stability iteration - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - do iter = 1, niters - - call FrictionVelocity(lbp, ubp, fn, filterp, & - displa, z0mg_pft, z0hg_pft, z0qg_pft, & - obu, iter, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm) - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - z0hg_pft(p) = z0mg_pft(p)/exp(0.13_r8 * (ustar(p)*z0mg_pft(p)/1.5e-5_r8)**0.45_r8) - z0qg_pft(p) = z0hg_pft(p) - thvstar = tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar - zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(2._r8,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta(c)*(-grav*ustar(p)*thvstar*zii(c)/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p) + wc*wc) - end if - obu(p) = zldis(p)/zeta - end do - - end do ! end stability iteration - - do j = 1, nlevgrnd - do f = 1, fn - p = filterp(f) - rootr(p,j) = 0._r8 - rresis(p,j) = 0._r8 - end do - end do - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - l = plandunit(p) - - ! Determine aerodynamic resistances - - ram = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah = 1._r8/(temp1(p)*ustar(p)) - raw = 1._r8/(temp2(p)*ustar(p)) - raih = forc_rho(c)*cpair/rah - - ! Soil evaporation resistance - www = (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice)/dz(c,1)/watsat(c,1) - www = min(max(www,0.0_r8),1._r8) - - !changed by K.Sakaguchi. Soilbeta is used for evaporation - if (dqh(p) .gt. 0._r8) then !dew (beta is not applied, just like rsoil used to be) - raiw = forc_rho(c)/(raw) - else - ! Lee and Pielke 1992 beta is applied - raiw = soilbeta(c)*forc_rho(c)/(raw) - end if - - ram1(p) = ram !pass value to global variable - - ! Output to pft-level data structures - ! Derivative of fluxes with respect to ground temperature - - cgrnds(p) = raih - cgrndl(p) = raiw*dqgdT(c) - cgrnd(p) = cgrnds(p) + htvp(c)*cgrndl(p) - - ! Surface fluxes of momentum, sensible and latent heat - ! using ground temperatures from previous time step - - taux(p) = -forc_rho(c)*forc_u(g)/ram - tauy(p) = -forc_rho(c)*forc_v(g)/ram - eflx_sh_grnd(p) = -raih*dth(p) - eflx_sh_tot(p) = eflx_sh_grnd(p) - qflx_evap_soi(p) = -raiw*dqh(p) - qflx_evap_tot(p) = qflx_evap_soi(p) - - ! 2 m height air temperature - - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - - ! 2 m height specific humidity - - q_ref2m(p) = forc_q(c) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(c), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - rh_ref2m_r(p) = rh_ref2m(p) - t_ref2m_r(p) = t_ref2m(p) - end if - - ! Variables needed by history tape - - t_veg(p) = forc_t(c) - btran(p) = 0._r8 - cf = forc_pbot(c)/(SHR_CONST_RGAS*0.001_r8*thm(p))*1.e06_r8 - rssun(p) = 1._r8/1.e15_r8 * cf - rssha(p) = 1._r8/1.e15_r8 * cf - - ! Add the following to avoid NaN - - psnsun(p) = 0._r8 - psnsha(p) = 0._r8 - fpsn(p) = 0._r8 - pps%lncsun(p) = 0._r8 - pps%lncsha(p) = 0._r8 - pps%vcmxsun(p) = 0._r8 - pps%vcmxsha(p) = 0._r8 - ! adding code for isotopes, 8/17/05, PET - pps%cisun(p) = 0._r8 - pps%cisha(p) = 0._r8 - if (use_c13) then - pps%alphapsnsun(p) = 0._r8 - pps%alphapsnsha(p) = 0._r8 - pepv%rc13_canair(p) = 0._r8 - pepv%rc13_psnsun(p) = 0._r8 - pepv%rc13_psnsha(p) = 0._r8 - pc13f%psnsun(p) = 0._r8 - pc13f%psnsha(p) = 0._r8 - pc13f%fpsn(p) = 0._r8 - end if - - end do - - end subroutine BareGroundFluxes - -end module BareGroundFluxesMod diff --git a/src_clm40/biogeophys/BiogeophysRestMod.F90 b/src_clm40/biogeophys/BiogeophysRestMod.F90 deleted file mode 100644 index 811f727c0b..0000000000 --- a/src_clm40/biogeophys/BiogeophysRestMod.F90 +++ /dev/null @@ -1,2137 +0,0 @@ -module BiogeophysRestMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: BiogeophysRestMod -! -! !DESCRIPTION: -! Reads from or biogeophysics restart/initial data -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use spmdMod , only : masterproc -! -! !PUBLIC TYPES: - implicit none - - private -! save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: BiogeophysRest -! -! !REVISION HISTORY: -! 2005-06-12: Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - - private :: weights_exactly_the_same - private :: weights_within_roundoff_different - private :: weights_tooDifferent - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BiogeophysRest -! -! !INTERFACE: - subroutine BiogeophysRest( ncid, flag ) -! -! !DESCRIPTION: -! Read/Write biogeophysics information to/from restart file. -! -! !USES: - use ncdio_pio , only : file_desc_t, ncd_defvar, ncd_io, ncd_double, ncd_int - use clmtype - use decompMod , only : get_proc_bounds - use clm_varpar , only : nlevgrnd, nlevsno, nlevlak, nlevurb - use clm_varcon , only : istcrop - use clm_varcon , only : denice, denh2o, istdlak, istslak, isturb, & - istsoil, pondmx, watmin, spval - use clm_varctl , only : allocate_all_vegpfts, nsrest, flanduse_timeseries, & - iulog, nsrContinue, nsrStartup, nsrBranch, & - use_cndv, use_cn, use_snicar_frc - use initSurfAlbMod , only : do_initsurfalb - use clm_time_manager, only : is_first_step - use SNICARMod , only : snw_rds_min - use shr_infnan_mod , only : shr_infnan_isnan - use clm_time_manager, only : is_restart -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*), intent(in) :: flag ! 'read' or 'write' -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! 12/11/2003, Peter Thornton: Added cps%coszen, pps%gdir, and pps%omega -! for new sunlit/shaded canopy algorithm (in SUNSHA ifdef block) -! 4/25/2005, Peter Thornton: Removed the SUNSHA ifdefs, since this is now the -! default code behavior. -! 6/12/2005, Moved to netcdf format and renamed file -! -! -! !LOCAL VARIABLES: -!EOP -! -! local pointers to implicit in arguments -! - real(r8) :: maxwatsat !maximum porosity - real(r8) :: excess !excess volumetric soil water - real(r8) :: totwat !total soil water (mm) - real(r8) :: maxdiff !maximum difference in PFT weights - real(r8), pointer :: wtgcell(:) ! Grid cell weights for PFT - real(r8), pointer :: wtlunit(:) ! Land-unit weights for PFT - real(r8), pointer :: wtcol(:) ! Column weights for PFT - integer :: p,c,l,g,j ! indices - integer :: nlevs ! number of layers - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - logical :: readvar ! determine if variable is on initial file - character(len=128) :: varname ! temporary - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ltype(:) ! landunit type - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - real(r8), pointer :: temp2d(:,:) ! temporary for zisno - real(r8), parameter :: adiff = 5.e-04_r8 ! tolerance of acceptible difference - character(len=7) :: filetypes(0:3) - character(len=32) :: fileusing - character(len=*), parameter :: sub="BiogeophysRest" -!----------------------------------------------------------------------- - filetypes(:) = "missing" - filetypes(nsrStartup) = "finidat" - filetypes(nsrContinue) = "restart" - filetypes(nsrBranch) = "nrevsn" - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - ltype => lptr%itype - clandunit => cptr%landunit - clandunit => cptr%landunit - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! - ! Read in weights if allocating all vegetation types - ! - - if (allocate_all_vegpfts) then - - ! pft weight wrt gridcell - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='PFT_WTGCELL', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding gridcell', units='') - else if (flag == 'read' .or. flag == 'write') then - ! Copy weights calculated from fsurdat/flanduse_timeseries to temp array for comparision - ! Don't read directly into temp array -- so that answers are identical with clm3.6.58. EBK 1/9/2010 - if (flag == 'read' )then - allocate( wtgcell(begp:endp) ) - wtgcell(:) = pptr%wtgcell(:) - end if - call ncd_io(varname='PFT_WTGCELL', data=pptr%wtgcell, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft weight wrt landunit - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='PFT_WTLUNIT', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding landunit', units='') - else if (flag == 'read' .or. flag == 'write') then - ! Copy weights calculated from fsurdat/flanduse_timeseries to temp array for comparision - ! Don't read directly into temp array -- so that answers are identical with clm3.6.58. EBK 1/9/2010 - if (flag == 'read' )then - allocate( wtlunit(begp:endp) ) - wtlunit(:) = pptr%wtlunit(:) - end if - call ncd_io(varname='PFT_WTLUNIT', data=pptr%wtlunit, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft weight wrt column - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='PFT_WTCOL', xtype=ncd_double, & - dim1name='pft', & - long_name='pft weight relative to corresponding column', units='') - else if (flag == 'read' .or. flag == 'write') then - ! Copy weights calculated from fsurdat/flanduse_timeseries to temp array for comparision - ! Don't read directly into temp array -- so that answers are identical with clm3.6.58. EBK 1/9/2010 - if (flag == 'read' )then - allocate( wtcol(begp:endp) ) - wtcol(:) = pptr%wtcol(:) - end if - call ncd_io(varname='PFT_WTCOL', data=pptr%wtcol, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - if (flag == 'read' )then - - if ( flanduse_timeseries /= ' ' )then - fileusing = "fsurdat/flanduse_timeseries" - else - fileusing = "fsurdat" - end if - ! - ! Note: Do not compare weights if restart or if dynamic-pft branch - ! - if ( nsrest == nsrContinue .or. flanduse_timeseries /= ' ' )then - ! Do NOT do any testing for restart or a pftdyn case - ! - ! Otherwise test and make sure weights agree to reasonable tolerence - ! - else if ( .not.weights_exactly_the_same( pptr, wtgcell, wtlunit, wtcol ) )then - if (.not. use_cndv) then - if ( weights_within_roundoff_different( pptr, wtgcell, wtlunit, wtcol ) )then - write(iulog,*) sub//"::NOTE, PFT weights from ", filetypes(nsrest), & - " file and ", trim(fileusing), " file(s) are different to roundoff -- using ", & - trim(fileusing), " values." - else if ( weights_tooDifferent( begp, endp, pptr, wtgcell, adiff, maxdiff ) )then - write(iulog,*) "ERROR:: PFT weights are SIGNIFICANTLY different from the input ", & - filetypes(nsrest), " file and ", trim(fileusing), " file(s)." - write(iulog,*) "ERROR:: maximum difference is ", maxdiff, " max allowed = ", adiff - write(iulog,*) "ERROR:: Run interpinic on your initial condition file to interpolate to the new surface dataset" - call endrun( sub//"::ERROR:: Weights between initial condition file and surface dataset are too different" ) - else - write(iulog,*) sub//"::NOTE, PFT weights from ", filetypes(nsrest), & - " file and ", trim(fileusing), " file(s) are different to < ", & - adiff, " -- using ", trim(fileusing), " values." - end if - write(iulog,*) sub//"::WARNING, weights different between ", filetypes(nsrest), & - " file and ", trim(fileusing), " file(s), but close enough -- using ", & - trim(fileusing), " values." - ! Copy weights from fsurdat file back in -- they are only off by roundoff to 1% or so... - pptr%wtgcell(:) = wtgcell(:) - pptr%wtlunit(:) = wtlunit(:) - pptr%wtcol(:) = wtcol(:) - end if - end if - - deallocate( wtgcell ) - deallocate( wtlunit ) - deallocate( wtcol ) - - end if - - end if - - ! Note - for the snow interfaces, are only examing the snow interfaces - ! above zi=0 which is why zisno and zsno have the same level dimension below - ! (Note - for zisno, zi(0) is set to 0 in routine iniTimeConst) - - ! pft energy flux - eflx_lwrad_out - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='EFLX_LWRAD_OUT', xtype=ncd_double, & - dim1name='pft', & - long_name='emitted infrared (longwave) radiation', units='watt/m^2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='EFLX_LWRAD_OUT', data=pef%eflx_lwrad_out, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - snow levels - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='SNLSNO', xtype=ncd_int, & - dim1name='column', & - long_name='number of snow layers', units='unitless') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='SNLSNO', data=cps%snl, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - snowdp - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='SNOWDP', xtype=ncd_double, & - dim1name='column', & - long_name='snow depth', units='m') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='SNOWDP', data=cps%snowdp, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - wa - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='WA', xtype=ncd_double, & - dim1name='column', & - long_name='water in the unconfined aquifer', units='mm') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='WA', data=cws%wa, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - wt - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='WT', xtype=ncd_double, & - dim1name='column', & - long_name='total water storage', units='mm') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='WT', data=cws%wt, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - zwt - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ZWT', xtype=ncd_double, & - dim1name='column', & - long_name='water table depth', units='m') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='ZWT', data=cws%zwt, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type physical state variable - frac_sno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='frac_sno', xtype=ncd_double, & - dim1name='column',& - long_name='fraction of ground covered by snow (0 to 1)',units='unitless') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='frac_sno', data=cps%frac_sno, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type physical state variable - dzsno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='DZSNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer thickness', units='m') - else if (flag == 'read' .or. flag == 'write') then - allocate(temp2d(begc:endc,-nlevsno+1:0)) - if (flag == 'write') then - temp2d(begc:endc,-nlevsno+1:0) = cps%dz(begc:endc,-nlevsno+1:0) - end if - call ncd_io(varname='DZSNO', data=temp2d, & - dim1name=namec, switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - if (flag == 'read') then - cps%dz(begc:endc,-nlevsno+1:0) = temp2d(begc:endc,-nlevsno+1:0) - end if - deallocate(temp2d) - end if - - ! column type physical state variable - zsno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ZSNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer depth', units='m') - else if (flag == 'read' .or. flag == 'write') then - allocate(temp2d(begc:endc,-nlevsno+1:0)) - if (flag == 'write') then - temp2d(begc:endc,-nlevsno+1:0) = cps%z(begc:endc,-nlevsno+1:0) - end if - call ncd_io(varname='ZSNO', data=temp2d, & - dim1name=namec, switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - if (flag == 'read') then - cps%z(begc:endc,-nlevsno+1:0) = temp2d(begc:endc,-nlevsno+1:0) - end if - deallocate(temp2d) - end if - - ! column type physical state variable - zisno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ZISNO', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow interface depth', units='m') - else if (flag == 'read' .or. flag == 'write') then - allocate(temp2d(begc:endc,-nlevsno:-1)) - if (flag == 'write') then - temp2d(begc:endc,-nlevsno:-1) = cps%zi(begc:endc,-nlevsno:-1) - end if - call ncd_io(varname='ZISNO', data=temp2d, & - dim1name=namec, switchdim=.true., & - lowerb2=-nlevsno, upperb2=-1, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - if (flag == 'read') then - cps%zi(begc:endc,-nlevsno:-1) = temp2d(begc:endc,-nlevsno:-1) - end if - deallocate(temp2d) - end if - - ! column type physical state variable - coszen - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='coszen', xtype=ncd_double, & - dim1name='column', & - long_name='cosine of solar zenith angle', units='unitless') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='coszen', data=cps%coszen, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - gdir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='gdir', xtype=ncd_double, & - dim1name='pft', & - long_name='leaf projection in solar direction (0 to 1)', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='gdir', data=pps%gdir, & - dim1name=namep, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - omega - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='omega', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='fraction of intercepted radiation that is scattered (0 to 1)', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='omega', data=pps%omega, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_roof_dir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_roof_dir', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by roof per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_roof_dir', data=lps%sabs_roof_dir, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_roof_dif - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_roof_dif', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by roof per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_roof_dif', data=lps%sabs_roof_dif, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_sunwall_dir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_sunwall_dir', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by sunwall per unit wall area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_sunwall_dir', data=lps%sabs_sunwall_dir, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_sunwall_dif - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_sunwall_dif', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by sunwall per unit wall area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_sunwall_dif', data=lps%sabs_sunwall_dif, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_shadewall_dir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_shadewall_dir', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by shadewall per unit wall area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_shadewall_dir', data=lps%sabs_shadewall_dir, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_shadewall_dif - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_shadewall_dif', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by shadewall per unit wall area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_shadewall_dif', data=lps%sabs_shadewall_dif, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_improad_dir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_improad_dir', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by impervious road per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_improad_dir', data=lps%sabs_improad_dir, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_improad_dif - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_improad_dif', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by impervious road per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_improad_dif', data=lps%sabs_improad_dif, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_perroad_dir - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_perroad_dir', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='direct solar absorbed by pervious road per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_perroad_dir', data=lps%sabs_perroad_dir, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - sabs_perroad_dif - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='sabs_perroad_dif', xtype=ncd_double, & - dim1name='landunit', dim2name='numrad', switchdim=.true., & - long_name='diffuse solar absorbed by pervious road per unit ground area per unit incident flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='sabs_perroad_dif', data=lps%sabs_perroad_dif, & - dim1name=namel, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - vf_sr - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf_sr', xtype=ncd_double, & - dim1name='landunit', & - long_name='view factor of sky for road',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf_sr', data=lps%vf_sr, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - vf_wr - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf_wr', xtype=ncd_double, & - dim1name='landunit', & - long_name='view factor of one wall for road',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf_wr', data=lps%vf_wr, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - vf_sw - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf_sw', xtype=ncd_double, & - dim1name='landunit', & - long_name='view factor of sky for one wall',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf_sw', data=lps%vf_sw, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - vf_rw - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf_rw', xtype=ncd_double, & - dim1name='landunit', & - long_name='view factor of road for one wall',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf_rw', data=lps%vf_rw, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - vf_ww - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='vf_ww', xtype=ncd_double, & - dim1name='landunit', & - long_name='view factor of opposing wall for one wall',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='vf_ww', data=lps%vf_ww, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - taf - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='taf', xtype=ncd_double, & - dim1name='landunit', & - long_name='urban canopy air temperature',units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='taf', data=lps%taf, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! landunit type physical state variable - qaf - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='qaf', xtype=ncd_double, & - dim1name='landunit', & - long_name='urban canopy specific humidity',units='kg/kg') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='qaf', data=lps%qaf, & - dim1name=namel, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - albd - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='surface albedo (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albd', data=pps%albd, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - end if - - ! pft type physical state variable - albi - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albi', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='surface albedo (diffuse) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albi', data=pps%albi, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - end if - - ! column type physical state variable - albgrd - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgrd', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgrd', data=cps%albgrd, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type physical state variable - albgri - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgri', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo (indirect) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgri', data=cps%albgri, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - if (use_snicar_frc) then - ! column type physical state variable - albgrd_bc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgrd_bc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without BC (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgrd_bc', data=cps%albgrd_bc, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_bc in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgrd_bc to albgrd" - do c=begc,endc - cps%albgrd_bc(c,:) = cps%albgrd(c,:) - enddo - end if - end if - ! column type physical state variable - albgri_bc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgri_bc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without BC (diffuse) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgri_bc', data=cps%albgri_bc, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_bc in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgri_bc to albgri" - do c=begc,endc - cps%albgri_bc(c,:) = cps%albgri(c,:) - enddo - end if - end if - ! column type physical state variable - albgrd_pur - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgrd_pur', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='pure snow ground albedo (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgrd_pur', data=cps%albgrd_pur, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_pur in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgrd_pur to albgrd" - do c=begc,endc - cps%albgrd_pur(c,:) = cps%albgrd(c,:) - enddo - end if - end if - ! column type physical state variable - albgri_pur - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgri_pur', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='pure snow ground albedo (diffuse) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgri_pur', data=cps%albgri_pur, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_pur in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgri_pur to albgri" - do c=begc,endc - cps%albgri_pur(c,:) = cps%albgri(c,:) - enddo - end if - end if - ! column type physical state variable - albgrd_oc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgrd_oc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without OC (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgrd_oc', data=cps%albgrd_oc, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_oc in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgrd_oc to albgrd" - do c=begc,endc - cps%albgrd_oc(c,:) = cps%albgrd(c,:) - enddo - end if - end if - ! column type physical state variable - albgri_oc - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgri_oc', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without OC (diffuse) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgri_oc', data=cps%albgri_oc, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_oc in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgri_oc to albgri" - do c=begc,endc - cps%albgri_oc(c,:) = cps%albgri(c,:) - enddo - end if - end if - ! column type physical state variable - albgrd_dst - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgrd_dst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without dust (direct) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgrd_dst', data=cps%albgrd_dst, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgrd_dst in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgrd_dst to albgrd" - do c=begc,endc - cps%albgrd_dst(c,:) = cps%albgrd(c,:) - enddo - end if - end if - ! column type physical state variable - albgri_dst - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albgri_dst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='ground albedo without dust (diffuse) (0 to 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albgri_dst', data=cps%albgri_dst, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find albgri_dst in restart (or initial) file..." - if (masterproc) write(iulog,*) "Initialize albgri_dst to albgri" - do c=begc,endc - cps%albgri_dst(c,:) = cps%albgri(c,:) - enddo - end if - end if - end if !end of if use_snicar_frc - - ! column water state variable - h2osno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='H2OSNO', xtype=ncd_double, & - dim1name='column', & - long_name='snow water', units='kg/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='H2OSNO', data=cws%h2osno, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - h2osoi_liq - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='H2OSOI_LIQ', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='liquid water', units='kg/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='H2OSOI_LIQ', data=cws%h2osoi_liq, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column water state variable - h2osoi_ice - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='H2OSOI_ICE', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='ice lens', units='kg/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='H2OSOI_ICE', data=cws%h2osoi_ice, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column energy state variable - t_grnd - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_GRND', xtype=ncd_double, & - dim1name='column', & - long_name='ground temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_GRND', data=ces%t_grnd, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column urban energy state variable - eflx_urban_ac - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='URBAN_AC', xtype=ncd_double, & - dim1name='column', & - long_name='urban air conditioning flux', units='watt/m^2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='URBAN_AC', data=cef%eflx_urban_ac, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column urban energy state variable - eflx_urban_heat - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='URBAN_HEAT', xtype=ncd_double, & - dim1name='column', & - long_name='urban heating flux', units='watt/m^2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='URBAN_HEAT', data=cef%eflx_urban_heat, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft energy state variable - t_ref2m_min - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN', xtype=ncd_double, & - dim1name='pft', & - long_name='daily minimum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN', data=pes%t_ref2m_min, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX', xtype=ncd_double, & - dim1name='pft', & - long_name='daily maximum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX', data=pes%t_ref2m_max, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_min_inst - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN_INST', xtype=ncd_double, & - dim1name='pft', & - long_name='instantaneous daily min of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN_INST', data=pes%t_ref2m_min_inst, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max_inst - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX_INST', xtype=ncd_double, & - dim1name='pft', & - long_name='instantaneous daily max of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX_INST', data=pes%t_ref2m_max_inst, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname="T_REF2M_U", xtype=ncd_double, & - dim1name='pft', & - long_name='Urban 2m height surface air temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname="T_REF2M_U", data=pes%t_ref2m_u, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column energy state variable - t_grnd_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_GRND_U', xtype=ncd_double, & - dim1name='column', & - long_name='urban ground temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_GRND_U', data=ces%t_grnd_u, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft energy state variable - t_ref2m_min_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN_U', xtype=ncd_double, & - dim1name='pft', & - long_name='urban daily minimum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN_U', data=pes%t_ref2m_min_u, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX_U', xtype=ncd_double, & - dim1name='pft', & - long_name='urban daily maximum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX_U', data=pes%t_ref2m_max_u, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_min_inst_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN_INST_U', xtype=ncd_double, & - dim1name='pft', & - long_name='urban instantaneous daily min of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN_INST_U', data=pes%t_ref2m_min_inst_u, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max_inst_u - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX_INST_U', xtype=ncd_double, & - dim1name='pft', & - long_name='urban instantaneous daily max of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX_INST_U', data=pes%t_ref2m_max_inst_u, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname="T_REF2M_R", xtype=ncd_double, & - dim1name='pft', & - long_name='Rural 2m height surface air temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname="T_REF2M_R", data=pes%t_ref2m_r, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column energy state variable - t_grnd_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_GRND_R', xtype=ncd_double, & - dim1name='column', & - long_name='rural ground temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_GRND_R', data=ces%t_grnd_r, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft energy state variable - t_ref2m_min_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural daily minimum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN_R', data=pes%t_ref2m_min_r, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural daily maximum of average 2 m height surface air temperature (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX_R', data=pes%t_ref2m_max_r, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_min_inst_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MIN_INST_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural instantaneous daily min of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MIN_INST_R', data=pes%t_ref2m_min_inst_r, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! pft energy state variable - t_ref2m_max_inst_r - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_REF2M_MAX_INST_R', xtype=ncd_double, & - dim1name='pft', & - long_name='rural instantaneous daily max of average 2 m height surface air temp (K)', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_REF2M_MAX_INST_R', data=pes%t_ref2m_max_inst_r, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - endif - - ! column energy state variable - t_soisno - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_SOISNO', xtype=ncd_double, & - dim1name='column', dim2name='levtot', switchdim=.true., & - long_name='soil-snow temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_SOISNO', data=ces%t_soisno, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type energy state variable - t_lake - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_LAKE', xtype=ncd_double, & - dim1name='column', dim2name='levlak', switchdim=.true., & - long_name='lake temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_LAKE', data=ces%t_lake, & - dim1name=namec, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft physical state variable - frac_veg_nosno_alb - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='FRAC_VEG_NOSNO_ALB', xtype=ncd_int, & - dim1name='pft',& - long_name='fraction of vegetation not covered by snow (0 or 1)',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='FRAC_VEG_NOSNO_ALB', data=pps%frac_veg_nosno_alb, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - fwet - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='FWET', xtype=ncd_double, & - dim1name='pft', & - long_name='fraction of canopy that is wet (0 to 1)', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='FWET', data=pps%fwet, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - tlai - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tlai', xtype=ncd_double, & - dim1name='pft', & - long_name='one-sided leaf area index, no burying by snow', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tlai', data=pps%tlai, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - tsai - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='tsai', xtype=ncd_double, & - dim1name='pft', & - long_name='one-sided stem area index, no burying by snow', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='tsai', data=pps%tsai, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mlaidiff', xtype=ncd_double, & - dim1name='pft',& - long_name='difference between lai month one and month two',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mlaidiff', data=pps%mlaidiff, & - dim1name='pft', & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - elai - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='elai', xtype=ncd_double, & - dim1name='pft', & - long_name='one-sided leaf area index, with burying by snow', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='elai', data=pps%elai, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - esai - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='esai', xtype=ncd_double, & - dim1name='pft', & - long_name='one-sided stem area index, with burying by snow', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='esai', data=pps%esai, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - fsun - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fsun', xtype=ncd_double, & - dim1name='pft', & - long_name='sunlit fraction of canopy', units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fsun', data=pps%fsun, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' )then - if ( .not. readvar) then - if (is_restart()) call endrun() - else - do p = begp, endp - if ( shr_infnan_isnan( pps%fsun(p) ) )then - pps%fsun(p) = spval - end if - end do - end if - end if - end if - - ! pft type physical state variable - htop - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='htop', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy top', units='m') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='htop', data=pps%htop, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - hbot - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='hbot', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy botton', units='m') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='hbot', data=pps%hbot, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - fabd - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fabd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by veg per unit direct flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fabd', data=pps%fabd, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - fabi - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='fabi', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='flux absorbed by veg per unit diffuse flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='fabi', data=pps%fabi, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - ftdd - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ftdd', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down direct flux below veg per unit direct flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='ftdd', data=pps%ftdd, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - ftid - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ftid', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down diffuse flux below veg per unit direct flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='ftid', data=pps%ftid, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft type physical state variable - ftii - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='ftii', xtype=ncd_double, & - dim1name='pft', dim2name='numrad', switchdim=.true., & - long_name='down diffuse flux below veg per unit diffuse flux',units='') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='ftii', data=pps%ftii, & - dim1name=namep, switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft energy state variable - t_veg - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='T_VEG', xtype=ncd_double, & - dim1name='pft', & - long_name='vegetation temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='T_VEG', data=pes%t_veg, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! pft energy state variable - t_ref2m - - varname = 'T_REF2M' - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname=varname, xtype=ncd_double, & - dim1name='pft', & - long_name='2m height surface air temperature', units='K') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname=varname, data=pes%t_ref2m, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (allocate_all_vegpfts) then - call endrun() - else - if (is_restart()) call endrun() - end if - end if - end if - - ! pft type water state variable - h2ocan - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='H2OCAN', xtype=ncd_double, & - dim1name='pft', & - long_name='canopy water', units='kg/m2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='H2OCAN', data=pws%h2ocan, & - dim1name=namep, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column irrigation variable - n_irrig_steps_left - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='n_irrig_steps_left', xtype=ncd_int, & - dim1name='column', & - long_name='number of irrigation time steps left', units='#') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='n_irrig_steps_left', data=cps%n_irrig_steps_left, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - cps%n_irrig_steps_left = 0 - end if - end if - - ! column irrigation variable - irrig_rate - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='irrig_rate', xtype=ncd_double, & - dim1name='column', & - long_name='irrigation rate', units='mm/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='irrig_rate', data=cps%irrig_rate, & - dim1name=namec, & - ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - cps%irrig_rate = 0.0_r8 - end if - end if - - ! ------------------------------------------------------------ - ! Determine volumetric soil water (for read only) - ! ------------------------------------------------------------ - - if (flag == 'read' ) then - do c = begc,endc - l = clandunit(c) - if ( ltype(l) == istdlak .or. ltype(l) == istslak )then - nlevs = nlevlak - else if ( ltype(l) == isturb )then - nlevs = nlevurb - else - nlevs = nlevgrnd - end if - ! NOTE: THIS IS A MEMORY INEFFICIENT COPY - do j = 1,nlevs - cws%h2osoi_vol(c,j) = cws%h2osoi_liq(c,j)/(cps%dz(c,j)*denh2o) & - + cws%h2osoi_ice(c,j)/(cps%dz(c,j)*denice) - end do - end do - - - ! ------------------------------------------------------------ - ! If initial run -- ensure that water is properly bounded - ! ------------------------------------------------------------ - - if ( is_first_step() )then - do c = begc,endc - l = clandunit(c) - if ( ltype(l) == istdlak .or. ltype(l) == istslak )then - nlevs = nlevlak - else if ( ltype(l) == isturb )then - nlevs = nlevurb - else - nlevs = nlevgrnd - end if - do j = 1,nlevs - l = clandunit(c) - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - cws%h2osoi_liq(c,j) = max(0._r8,cws%h2osoi_liq(c,j)) - cws%h2osoi_ice(c,j) = max(0._r8,cws%h2osoi_ice(c,j)) - cws%h2osoi_vol(c,j) = cws%h2osoi_liq(c,j)/(cps%dz(c,j)*denh2o) & - + cws%h2osoi_ice(c,j)/(cps%dz(c,j)*denice) - if (j == 1) then - maxwatsat = (cps%watsat(c,j)*cps%dz(c,j)*1000.0_r8 + pondmx) / & - (cps%dz(c,j)*1000.0_r8) - else - maxwatsat = cps%watsat(c,j) - end if - if (cws%h2osoi_vol(c,j) > maxwatsat) then - excess = (cws%h2osoi_vol(c,j) - maxwatsat)*cps%dz(c,j)*1000.0_r8 - totwat = cws%h2osoi_liq(c,j) + cws%h2osoi_ice(c,j) - cws%h2osoi_liq(c,j) = cws%h2osoi_liq(c,j) - & - (cws%h2osoi_liq(c,j)/totwat) * excess - cws%h2osoi_ice(c,j) = cws%h2osoi_ice(c,j) - & - (cws%h2osoi_ice(c,j)/totwat) * excess - end if - cws%h2osoi_liq(c,j) = max(watmin,cws%h2osoi_liq(c,j)) - cws%h2osoi_ice(c,j) = max(watmin,cws%h2osoi_ice(c,j)) - cws%h2osoi_vol(c,j) = cws%h2osoi_liq(c,j)/(cps%dz(c,j)*denh2o) & - + cws%h2osoi_ice(c,j)/(cps%dz(c,j)*denice) - end if - end do - end do - end if - endif - ! - ! variables needed for SNICAR - ! - ! column type physical state variable - snw_rds - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='snw_rds', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer effective radius', units='um') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='snw_rds', data=cps%snw_rds, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (masterproc) write(iulog,*) "SNICAR: can't find snw_rds in restart (or initial) file..." - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize snw_rds - if (masterproc) then - write(iulog,*) "SNICAR: This is an initial run (not a restart), and grain size/aerosol " // & - "mass data are not defined in initial condition file. Initialize snow " // & - "effective radius to fresh snow value, and snow/aerosol masses to zero." - endif - do c=begc,endc - if (cps%snl(c) < 0) then - cps%snw_rds(c,cps%snl(c)+1:0) = snw_rds_min - cps%snw_rds(c,-nlevsno+1:cps%snl(c)) = 0._r8 - cps%snw_rds_top(c) = snw_rds_min - cps%sno_liq_top(c) = cws%h2osoi_liq(c,cps%snl(c)+1) / & - (cws%h2osoi_liq(c,cps%snl(c)+1)+cws%h2osoi_ice(c,cps%snl(c)+1)) - elseif (cws%h2osno(c) > 0._r8) then - cps%snw_rds(c,0) = snw_rds_min - cps%snw_rds(c,-nlevsno+1:-1) = 0._r8 - cps%snw_rds_top(c) = spval - cps%sno_liq_top(c) = spval - else - cps%snw_rds(c,:) = 0._r8 - cps%snw_rds_top(c) = spval - cps%sno_liq_top(c) = spval - endif - enddo - endif - end if - end if - - ! column type physical state variable - mss_bcpho - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_bcpho', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer hydrophobic black carbon mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_bcpho', data=cps%mss_bcpho, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_bcpho to zero - do c=begc,endc - cps%mss_bcpho(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_bcphi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_bcphi', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer hydrophilic black carbon mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_bcphi', data=cps%mss_bcphi, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_bcphi to zero - do c=begc,endc - cps%mss_bcphi(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_ocpho - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_ocpho', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer hydrophobic organic carbon mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_ocpho', data=cps%mss_ocpho, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_ocpho to zero - do c=begc,endc - cps%mss_ocpho(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_ocphi - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_ocphi', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer hydrophilic organic carbon mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_ocphi', data=cps%mss_ocphi, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_ocphi to zero - do c=begc,endc - cps%mss_ocphi(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_dst1 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_dst1', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer dust species 1 mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_dst1', data=cps%mss_dst1, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_dst1 to zero - do c=begc,endc - cps%mss_dst1(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_dst2 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_dst2', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer dust species 2 mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_dst2', data=cps%mss_dst2, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_dst2 to zero - do c=begc,endc - cps%mss_dst2(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_dst3 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_dst3', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer dust species 3 mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_dst3', data=cps%mss_dst3, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_dst3 to zero - do c=begc,endc - cps%mss_dst3(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - mss_dst4 - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mss_dst4', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer dust species 4 mass', units='kg m-2') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='mss_dst4', data=cps%mss_dst4, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize mss_dst4 to zero - do c=begc,endc - cps%mss_dst4(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type physical state variable - flx_absdv - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='flx_absdv', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., & - long_name='snow layer flux absorption factors (direct, VIS)', units='fraction') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='flx_absdv', data=cps%flx_absdv, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=1, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - ! SNICAR, via SurfaceAlbedo, will define the needed flux absorption factors - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - - ! column type physical state variable - flx_absdn - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='flx_absdn', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., & - long_name='snow layer flux absorption factors (direct, NIR)', units='fraction') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='flx_absdn', data=cps%flx_absdn, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=1, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - ! SNICAR, via SurfaceAlbedo, will define the needed flux absorption factors - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - - ! column type physical state variable - flx_absiv - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='flx_absiv', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., & - long_name='snow layer flux absorption factors (diffuse, VIS)', units='fraction') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='flx_absiv', data=cps%flx_absiv, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=1, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - ! SNICAR, via SurfaceAlbedo, will define the needed flux absorption factors - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - - ! column type physical state variable - flx_absin - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='flx_absin', xtype=ncd_double, & - dim1name='column', dim2name='levsno1', switchdim=.true., & - long_name='snow layer flux absorption factors (diffuse, NIR)', units='fraction') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='flx_absin', data=cps%flx_absin, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=1, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) call endrun() - ! SNICAR, via SurfaceAlbedo, will define the needed flux absorption factors - if (nsrest == nsrStartup) do_initsurfalb = .true. - end if - end if - - ! column type physical state variable - albsnd_hst - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albsnd_hst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='snow albedo (direct) (0 to 1)',units='proportion') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albsnd_hst', data=cps%albsnd_hst, & - dim1name='column', switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type physical state variable - albsni_hst - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='albsni_hst', xtype=ncd_double, & - dim1name='column', dim2name='numrad', switchdim=.true., & - long_name='snow albedo (diffuse) (0 to 1)',units='proportion') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='albsni_hst', data=cps%albsni_hst, & - dim1name='column', switchdim=.true., ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call endrun() - end if - end if - - ! column type water flux variable - qflx_snofrz_lyr - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='qflx_snofrz_lyr', xtype=ncd_double, & - dim1name='column', dim2name='levsno', switchdim=.true., & - long_name='snow layer ice freezing rate', units='kg m-2 s-1') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='qflx_snofrz_lyr', data=cwf%qflx_snofrz_lyr, & - dim1name='column', switchdim=.true., & - lowerb2=-nlevsno+1, upperb2=0, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize qflx_snofrz_lyr to zero - do c=begc,endc - cwf%qflx_snofrz_lyr(c,-nlevsno+1:0) = 0._r8 - enddo - endif - end if - end if - - ! column type water flux variable - qflx_snow_melt - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='qflx_snow_melt', xtype=ncd_double, & - dim1name='column', long_name='net snow melt', units='mm/s') - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname='qflx_snow_melt', data=cwf%qflx_snow_melt, & - dim1name='column', ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. .not. readvar) then - if (is_restart()) then - call endrun() - else - ! initial run, not restart: initialize qflx_snow_melt to zero - cwf%qflx_snow_melt = 0._r8 - endif - end if - end if - - ! initialize other variables that are derived from those - ! stored in the restart buffer. (there may be a more appropriate - ! place to do this, but functionally this works) - if (flag == 'read' ) then - do j = -nlevsno+1,0 - do c = begc,endc - ! mass concentrations of aerosols in snow - if (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j) > 0._r8) then - cps%mss_cnc_bcpho(c,j) = cps%mss_bcpho(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_bcphi(c,j) = cps%mss_bcphi(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_ocpho(c,j) = cps%mss_ocpho(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_ocphi(c,j) = cps%mss_ocphi(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - - cps%mss_cnc_dst1(c,j) = cps%mss_dst1(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_dst2(c,j) = cps%mss_dst2(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_dst3(c,j) = cps%mss_dst3(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - cps%mss_cnc_dst4(c,j) = cps%mss_dst4(c,j) / (cws%h2osoi_ice(c,j)+cws%h2osoi_liq(c,j)) - else - cps%mss_cnc_bcpho(c,j) = 0._r8 - cps%mss_cnc_bcphi(c,j) = 0._r8 - cps%mss_cnc_ocpho(c,j) = 0._r8 - cps%mss_cnc_ocphi(c,j) = 0._r8 - - cps%mss_cnc_dst1(c,j) = 0._r8 - cps%mss_cnc_dst2(c,j) = 0._r8 - cps%mss_cnc_dst3(c,j) = 0._r8 - cps%mss_cnc_dst4(c,j) = 0._r8 - endif - enddo - enddo - endif - !-- SNICAR variables - - - end subroutine BiogeophysRest - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: weights_exactly_the_same -! -! !INTERFACE: - logical function weights_exactly_the_same( pptr, wtgcell, wtlunit, wtcol ) -! -! !DESCRIPTION: -! Determine if the weights read in are exactly the same as those from surface dataset -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - type(pft_type), pointer :: pptr ! pointer to pft derived subtype - real(r8), intent(IN) :: wtgcell(:) ! grid cell weights for each PFT - real(r8), intent(IN) :: wtlunit(:) ! land-unit weights for each PFT - real(r8), intent(IN) :: wtcol(:) ! column weights for each PFT -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -!EOP -!----------------------------------------------------------------------- - - ! Check that weights are identical for all PFT's and all weight types - if ( all( pptr%wtgcell(:) == wtgcell ) .and. all( pptr%wtlunit(:) == wtlunit ) & - .and. all( pptr%wtcol(:) == wtcol ) )then - weights_exactly_the_same = .true. - else - weights_exactly_the_same = .false. - end if - - end function weights_exactly_the_same - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: weights_within_roundoff_different -! -! !INTERFACE: - logical function weights_within_roundoff_different( pptr, wtgcell, wtlunit, wtcol ) -! -! !DESCRIPTION: -! Determine if the weights are within roundoff different from each other -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - type(pft_type), pointer :: pptr ! pointer to pft derived subtype - real(r8), intent(IN) :: wtgcell(:) ! grid cell weights for each PFT - real(r8), intent(IN) :: wtlunit(:) ! land-unit weights for each PFT - real(r8), intent(IN) :: wtcol(:) ! column weights for each PFT -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -!EOP -!----------------------------------------------------------------------- - real(r8), parameter :: rndVal = 1.e-13_r8 - - ! If differences between all weights for each PFT and each weight type is - ! less than or equal to double precision roundoff level -- weights are close - if ( all( abs(pptr%wtgcell(:) - wtgcell) <= rndVal ) & - .and. all( abs(pptr%wtlunit(:) - wtlunit) <= rndVal ) & - .and. all( abs(pptr%wtcol(:) - wtcol ) <= rndVal ) )then - weights_within_roundoff_different = .true. - else - weights_within_roundoff_different = .false. - end if - - end function weights_within_roundoff_different - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: weights_tooDifferent -! -! !INTERFACE: - logical function weights_tooDifferent( begp, endp, pptr, wtgcell, adiff, maxdiff ) -! -! !DESCRIPTION: -! Determine if the weights read in are too different and should flag an error -! -! !USES: - use clmtype - implicit none -! -! !ARGUMENTS: - integer, intent(IN) :: begp, endp ! per-proc beginning and ending pft indices - type(pft_type), pointer :: pptr ! pointer to pft derived subtype - real(r8), intent(IN) :: wtgcell(begp:endp) ! grid cell weights for each PFT - real(r8), intent(IN) :: adiff ! tolerance of acceptible difference - real(r8), intent(OUT) :: maxdiff ! maximum difference found -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -!EOP -!----------------------------------------------------------------------- - integer :: p ! PFT index - real(r8) :: diff ! difference in weights - - ! Assume weights are NOT different and only change if find weights too different - weights_tooDifferent = .false. - maxdiff = 0.0_r8 - do p = begp, endp - - diff = abs(pptr%wtgcell(p) - wtgcell(p)) - if ( diff > maxdiff ) maxdiff = diff - if ( diff > adiff ) weights_tooDifferent = .true. - end do - - end function weights_tooDifferent - - -end module BiogeophysRestMod diff --git a/src_clm40/biogeophys/Biogeophysics1Mod.F90 b/src_clm40/biogeophys/Biogeophysics1Mod.F90 deleted file mode 100644 index 142d454e28..0000000000 --- a/src_clm40/biogeophys/Biogeophysics1Mod.F90 +++ /dev/null @@ -1,544 +0,0 @@ -module Biogeophysics1Mod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: Biogeophysics1Mod -! -! !DESCRIPTION: -! Performs calculation of leaf temperature and surface fluxes. -! Biogeophysics2.F90 then determines soil/snow and ground -! temperatures and updates the surface fluxes for the new ground -! temperature. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Biogeophysics1 ! Calculate leaf temperature and surface fluxes -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: Biogeophysics1 -! -! !INTERFACE: - subroutine Biogeophysics1(lbg, ubg, lbc, ubc, lbp, ubp, & - num_nolakec, filter_nolakec, num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! This is the main subroutine to execute the calculation of leaf temperature -! and surface fluxes. Biogeophysics2.F90 then determines soil/snow and ground -! temperatures and updates the surface fluxes for the new ground -! temperature. -! -! Calling sequence is: -! Biogeophysics1: surface biogeophysics driver -! -> QSat: saturated vapor pressure, specific humidity, and -! derivatives at ground surface and derivatives at -! leaf surface using updated leaf temperature -! Leaf temperature -! Foliage energy conservation is given by the foliage energy budget -! equation: -! Rnet - Hf - LEf = 0 -! The equation is solved by Newton-Raphson iteration, in which this -! iteration includes the calculation of the photosynthesis and -! stomatal resistance, and the integration of turbulent flux profiles. -! The sensible and latent heat transfer between foliage and atmosphere -! and ground is linked by the equations: -! Ha = Hf + Hg and Ea = Ef + Eg -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varcon , only : denh2o, denice, roverg, hvap, hsub, & - istice, istice_mec, istwet, istsoil, isturb, istdlak, & - zlnd, zsno, tfrz, & - icol_roof, icol_sunwall, icol_shadewall, & - icol_road_imperv, icol_road_perv, tfrz, spval, istdlak - use clm_varcon , only : istcrop - use clm_varpar , only : nlevgrnd, nlevurb, nlevsno, max_pft_per_gcell, nlevsoi - use QSatMod , only : QSat - use shr_const_mod , only : SHR_CONST_PI -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbg, ubg ! gridcell-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! Migrated to clm2.0 by Keith Oleson and Mariana Vertenstein -! Migrated to clm2.1 new data structures by Peter Thornton and M. Vertenstein -! 27 February 2008: Keith Oleson; weighted soil/snow emissivity -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: ivt(:) !pft vegetation type - integer , pointer :: ityplun(:) !landunit type - integer , pointer :: clandunit(:) !column's landunit index - integer , pointer :: cgridcell(:) !column's gridcell index - real(r8), pointer :: pwtgcell(:) !weight relative to gridcell for each pft - integer , pointer :: ctype(:) !column type - real(r8), pointer :: forc_pbot(:) !atmospheric pressure (Pa) - real(r8), pointer :: forc_q(:) !atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_t(:) !atmospheric temperature (Kelvin) - real(r8), pointer :: forc_hgt_t(:) !observational height of temperature [m] - real(r8), pointer :: forc_hgt_u(:) !observational height of wind [m] - real(r8), pointer :: forc_hgt_q(:) !observational height of specific humidity [m] - integer , pointer :: npfts(:) !number of pfts on gridcell - integer , pointer :: pfti(:) !initial pft on gridcell - integer , pointer :: plandunit(:) !pft's landunit index - real(r8), pointer :: forc_hgt_u_pft(:) !observational height of wind at pft level [m] - real(r8), pointer :: forc_hgt_t_pft(:) !observational height of temperature at pft level [m] - real(r8), pointer :: forc_hgt_q_pft(:) !observational height of specific humidity at pft level [m] - integer , pointer :: frac_veg_nosno(:) !fraction of vegetation not covered by snow (0 OR 1) [-] - integer , pointer :: pgridcell(:) !pft's gridcell index - integer , pointer :: pcolumn(:) !pft's column index - real(r8), pointer :: z_0_town(:) !momentum roughness length of urban landunit (m) - real(r8), pointer :: z_d_town(:) !displacement height of urban landunit (m) - real(r8), pointer :: forc_th(:) !atmospheric potential temperature (Kelvin) - real(r8), pointer :: forc_u(:) !atmospheric wind speed in east direction (m/s) - real(r8), pointer :: forc_v(:) !atmospheric wind speed in north direction (m/s) - real(r8), pointer :: smpmin(:) !restriction for min of soil potential (mm) - integer , pointer :: snl(:) !number of snow layers - real(r8), pointer :: frac_sno(:) !fraction of ground covered by snow (0 to 1) - real(r8), pointer :: h2osno(:) !snow water (mm H2O) - real(r8), pointer :: elai(:) !one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) !one-sided stem area index with burying by snow - real(r8), pointer :: z0mr(:) !ratio of momentum roughness length to canopy top height (-) - real(r8), pointer :: displar(:) !ratio of displacement height to canopy top height (-) - real(r8), pointer :: htop(:) !canopy top (m) - real(r8), pointer :: dz(:,:) !layer depth (m) - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: watsat(:,:) !volumetric soil water at saturation (porosity) - real(r8), pointer :: sucsat(:,:) !minimum soil suction (mm) - real(r8), pointer :: bsw(:,:) !Clapp and Hornberger "b" - real(r8), pointer :: watfc(:,:) !volumetric soil water at field capacity - real(r8), pointer :: watopt(:,:) !volumetric soil moisture corresponding to no restriction on ET from urban pervious surface - real(r8), pointer :: watdry(:,:) !volumetric soil moisture corresponding to no restriction on ET from urban pervious surface - real(r8), pointer :: rootfr_road_perv(:,:) !fraction of roots in each soil layer for urban pervious road - real(r8), pointer :: rootr_road_perv(:,:) !effective fraction of roots in each soil layer for urban pervious road -! -! local pointers to implicit out arguments -! - real(r8), pointer :: t_grnd(:) !ground temperature (Kelvin) - real(r8), pointer :: qg(:) !ground specific humidity [kg/kg] - real(r8), pointer :: dqgdT(:) !d(qg)/dT - real(r8), pointer :: emg(:) !ground emissivity - real(r8), pointer :: htvp(:) !latent heat of vapor of water (or sublimation) [j/kg] - real(r8), pointer :: beta(:) !coefficient of convective velocity [-] - real(r8), pointer :: zii(:) !convective boundary height [m] - real(r8), pointer :: thm(:) !intermediate variable (forc_t+0.0098*forc_hgt_t_pft) - real(r8), pointer :: thv(:) !virtual potential temperature (kelvin) - real(r8), pointer :: z0mg(:) !roughness length over ground, momentum [m] - real(r8), pointer :: z0hg(:) !roughness length over ground, sensible heat [m] - real(r8), pointer :: z0qg(:) !roughness length over ground, latent heat [m] - real(r8), pointer :: emv(:) !vegetation emissivity - real(r8), pointer :: z0m(:) !momentum roughness length (m) - real(r8), pointer :: displa(:) !displacement height (m) - real(r8), pointer :: z0mv(:) !roughness length over vegetation, momentum [m] - real(r8), pointer :: z0hv(:) !roughness length over vegetation, sensible heat [m] - real(r8), pointer :: z0qv(:) !roughness length over vegetation, latent heat [m] - real(r8), pointer :: eflx_sh_tot(:) !total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_u(:) !urban total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_r(:) !rural total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot(:) !total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_u(:) !urban total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_r(:) !rural total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_veg(:) !sensible heat flux from leaves (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_tot(:) !qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: qflx_evap_veg(:) !vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg(:) !vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: cgrnd(:) !deriv. of soil energy flux wrt to soil temp [w/m2/k] - real(r8), pointer :: cgrnds(:) !deriv. of soil sensible heat flux wrt soil temp [w/m2/k] - real(r8), pointer :: cgrndl(:) !deriv. of soil latent heat flux wrt soil temp [w/m**2/k] - real(r8) ,pointer :: tssbef(:,:) !soil/snow temperature before update - real(r8) ,pointer :: soilalpha(:) !factor that reduces ground saturated specific humidity (-) - real(r8) ,pointer :: soilbeta(:) !factor that reduces ground evaporation - real(r8) ,pointer :: soilalpha_u(:) !Urban factor that reduces ground saturated specific humidity (-) - -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: g,l,c,p !indices - integer :: j !soil/snow level index - integer :: fp !lake filter pft index - integer :: fc !lake filter column index - real(r8) :: qred !soil surface relative humidity - real(r8) :: avmuir !ir inverse optical depth per unit leaf area - real(r8) :: eg !water vapor pressure at temperature T [pa] - real(r8) :: qsatg !saturated humidity [kg/kg] - real(r8) :: degdT !d(eg)/dT - real(r8) :: qsatgdT !d(qsatg)/dT - real(r8) :: fac !soil wetness of surface layer - real(r8) :: psit !negative potential of soil - real(r8) :: hr !relative humidity - real(r8) :: hr_road_perv !relative humidity for urban pervious road - real(r8) :: wx !partial volume of ice and water of surface layer - real(r8) :: fac_fc !soil wetness of surface layer relative to field capacity - real(r8) :: eff_porosity ! effective porosity in layer - real(r8) :: vol_ice ! partial volume of ice lens in layer - real(r8) :: vol_liq ! partial volume of liquid water in layer - integer :: pi !index -!------------------------------------------------------------------------------ - - ! Assign local pointers to derived type members (gridcell-level) - - forc_hgt_t => clm_a2l%forc_hgt_t - forc_u => clm_a2l%forc_u - forc_v => clm_a2l%forc_v - forc_hgt_u => clm_a2l%forc_hgt_u - forc_hgt_q => clm_a2l%forc_hgt_q - npfts => grc%npfts - pfti => grc%pfti - - ! Assign local pointers to derived type members (landunit-level) - - ityplun => lun%itype - z_0_town => lun%z_0_town - z_d_town => lun%z_d_town - - ! Assign local pointers to derived type members (column-level) - - forc_pbot => cps%forc_pbot - forc_q => cws%forc_q - forc_t => ces%forc_t - forc_th => ces%forc_th - - cgridcell => col%gridcell - clandunit => col%landunit - ctype => col%itype - beta => cps%beta - dqgdT => cws%dqgdT - emg => cps%emg - frac_sno => cps%frac_sno - h2osno => cws%h2osno - htvp => cps%htvp - qg => cws%qg - smpmin => cps%smpmin - snl => cps%snl - t_grnd => ces%t_grnd - thv => ces%thv - z0hg => cps%z0hg - z0mg => cps%z0mg - z0qg => cps%z0qg - zii => cps%zii - bsw => cps%bsw - dz => cps%dz - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - soilalpha => cws%soilalpha - soilbeta => cws%soilbeta - soilalpha_u => cws%soilalpha_u - sucsat => cps%sucsat - t_soisno => ces%t_soisno - tssbef => ces%tssbef - watsat => cps%watsat - watfc => cps%watfc - watdry => cps%watdry - watopt => cps%watopt - rootfr_road_perv => cps%rootfr_road_perv - rootr_road_perv => cps%rootr_road_perv - - ! Assign local pointers to derived type members (pft-level) - - ivt => pft%itype - elai => pps%elai - esai => pps%esai - htop => pps%htop - emv => pps%emv - z0m => pps%z0m - displa => pps%displa - z0mv => pps%z0mv - z0hv => pps%z0hv - z0qv => pps%z0qv - eflx_sh_tot => pef%eflx_sh_tot - eflx_sh_tot_u => pef%eflx_sh_tot_u - eflx_sh_tot_r => pef%eflx_sh_tot_r - eflx_lh_tot => pef%eflx_lh_tot - eflx_lh_tot_u => pef%eflx_lh_tot_u - eflx_lh_tot_r => pef%eflx_lh_tot_r - eflx_sh_veg => pef%eflx_sh_veg - qflx_evap_tot => pwf%qflx_evap_tot - qflx_evap_veg => pwf%qflx_evap_veg - qflx_tran_veg => pwf%qflx_tran_veg - cgrnd => pef%cgrnd - cgrnds => pef%cgrnds - cgrndl => pef%cgrndl - forc_hgt_u_pft => pps%forc_hgt_u_pft - forc_hgt_t_pft => pps%forc_hgt_t_pft - forc_hgt_q_pft => pps%forc_hgt_q_pft - plandunit => pft%landunit - frac_veg_nosno => pps%frac_veg_nosno - thm => pes%thm - pgridcell => pft%gridcell - pcolumn => pft%column - pwtgcell => pft%wtgcell - - ! Assign local pointers to derived type members (ecophysiological) - - z0mr => pftcon%z0mr - displar => pftcon%displar - - do j = -nlevsno+1, nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - tssbef(c,j) = t_soisno(c,j) - end do - end do - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - - if (ctype(c) == icol_road_perv) then - hr_road_perv = 0._r8 - end if - - ! begin calculations that relate only to the column level - ! Ground and soil temperatures from previous time step - - t_grnd(c) = t_soisno(c,snl(c)+1) - - ! Saturated vapor pressure, specific humidity and their derivatives - ! at ground surface - - qred = 1._r8 - if (ityplun(l)/=istwet .AND. ityplun(l)/=istice & - .AND. ityplun(l)/=istice_mec) then - if (ityplun(l) == istsoil .or. ityplun(l) == istcrop) then - wx = (h2osoi_liq(c,1)/denh2o+h2osoi_ice(c,1)/denice)/dz(c,1) - fac = min(1._r8, wx/watsat(c,1)) - fac = max( fac, 0.01_r8 ) - psit = -sucsat(c,1) * fac ** (-bsw(c,1)) - psit = max(smpmin(c), psit) - hr = exp(psit/roverg/t_grnd(c)) - qred = (1.-frac_sno(c))*hr + frac_sno(c) - - !! Lee and Pielke 1992 beta, added by K.Sakaguchi - if (wx < watfc(c,1) ) then !when water content of ths top layer is less than that at F.C. - fac_fc = min(1._r8, wx/watfc(c,1)) !eqn5.66 but divided by theta at field capacity - fac_fc = max( fac_fc, 0.01_r8 ) - ! modifiy soil beta by snow cover. soilbeta for snow surface is one - soilbeta(c) = (1._r8-frac_sno(c))*0.25_r8*(1._r8 - cos(SHR_CONST_PI*fac_fc))**2._r8 & - + frac_sno(c) - else !when water content of ths top layer is more than that at F.C. - soilbeta(c) = 1._r8 - end if - - soilalpha(c) = qred - ! Pervious road depends on water in total soil column - else if (ctype(c) == icol_road_perv) then - do j = 1, nlevsoi - if (t_soisno(c,j) >= tfrz) then - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity = watsat(c,j)-vol_ice - vol_liq = min(eff_porosity, h2osoi_liq(c,j)/(dz(c,j)*denh2o)) - fac = min( max(vol_liq-watdry(c,j),0._r8) / (watopt(c,j)-watdry(c,j)), 1._r8 ) - else - fac = 0._r8 - end if - rootr_road_perv(c,j) = rootfr_road_perv(c,j)*fac - hr_road_perv = hr_road_perv + rootr_road_perv(c,j) - end do - ! Allows for sublimation of snow or dew on snow - qred = (1.-frac_sno(c))*hr_road_perv + frac_sno(c) - - ! Normalize root resistances to get layer contribution to total ET - if (hr_road_perv .gt. 0._r8) then - do j = 1, nlevsoi - rootr_road_perv(c,j) = rootr_road_perv(c,j)/hr_road_perv - end do - end if - soilalpha_u(c) = qred - soilbeta(c) = 0._r8 - else if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall) then - qred = 0._r8 - soilbeta(c) = 0._r8 - soilalpha_u(c) = spval - else if (ctype(c) == icol_roof .or. ctype(c) == icol_road_imperv) then - qred = 1._r8 - soilbeta(c) = 0._r8 - soilalpha_u(c) = spval - end if - else - soilalpha(c) = spval - soilbeta(c) = 1._r8 - end if - - call QSat(t_grnd(c), forc_pbot(c), eg, degdT, qsatg, qsatgdT) - - qg(c) = qred*qsatg - dqgdT(c) = qred*qsatgdT - - if (qsatg > forc_q(c) .and. forc_q(c) > qred*qsatg) then - qg(c) = forc_q(c) - dqgdT(c) = 0._r8 - end if - - ! Ground emissivity - only calculate for non-urban landunits - ! Urban emissivities are currently read in from data file - - if (ityplun(l) /= isturb) then - if (ityplun(l)==istice .or. ityplun(l)==istice_mec) then - emg(c) = 0.97_r8 - else - emg(c) = (1._r8-frac_sno(c))*0.96_r8 + frac_sno(c)*0.97_r8 - end if - end if - - ! Latent heat. We arbitrarily assume that the sublimation occurs - ! only as h2osoi_liq = 0 - - htvp(c) = hvap - if (h2osoi_liq(c,snl(c)+1) <= 0._r8 .and. h2osoi_ice(c,snl(c)+1) > 0._r8) htvp(c) = hsub - - ! Ground roughness lengths over non-lake columns (includes bare ground, ground - ! underneath canopy, wetlands, etc.) - - if (frac_sno(c) > 0._r8) then - z0mg(c) = zsno - else - z0mg(c) = zlnd - end if - z0hg(c) = z0mg(c) ! initial set only - z0qg(c) = z0mg(c) ! initial set only - - ! Potential, virtual potential temperature, and wind speed at the - ! reference height - - beta(c) = 1._r8 - zii(c) = 1000._r8 - thv(c) = forc_th(c)*(1._r8+0.61_r8*forc_q(c)) - - end do ! (end of columns loop) - - ! Initialization - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - - ! Initial set (needed for history tape fields) - - eflx_sh_tot(p) = 0._r8 - l = plandunit(p) - if (ityplun(l) == isturb) then - eflx_sh_tot_u(p) = 0._r8 - else if (ityplun(l) == istsoil .or. ityplun(l) == istcrop) then - eflx_sh_tot_r(p) = 0._r8 - end if - eflx_lh_tot(p) = 0._r8 - if (ityplun(l) == isturb) then - eflx_lh_tot_u(p) = 0._r8 - else if (ityplun(l) == istsoil .or. ityplun(l) == istcrop) then - eflx_lh_tot_r(p) = 0._r8 - end if - eflx_sh_veg(p) = 0._r8 - qflx_evap_tot(p) = 0._r8 - qflx_evap_veg(p) = 0._r8 - qflx_tran_veg(p) = 0._r8 - - ! Initial set for calculation - - cgrnd(p) = 0._r8 - cgrnds(p) = 0._r8 - cgrndl(p) = 0._r8 - - ! Vegetation Emissivity - - avmuir = 1._r8 - emv(p) = 1._r8-exp(-(elai(p)+esai(p))/avmuir) - - ! Roughness lengths over vegetation - - z0m(p) = z0mr(ivt(p)) * htop(p) - displa(p) = displar(ivt(p)) * htop(p) - - z0mv(p) = z0m(p) - z0hv(p) = z0mv(p) - z0qv(p) = z0mv(p) - end do - - ! Make forcing height a pft-level quantity that is the atmospheric forcing - ! height plus each pft's z0m+displa - do pi = 1,max_pft_per_gcell - do g = lbg, ubg - if (pi <= npfts(g)) then - p = pfti(g) + pi - 1 - l = plandunit(p) - ! Note: Some glacier_mec pfts may have zero weight - if (pwtgcell(p) > 0._r8 .or. ityplun(l)==istice_mec) then - c = pcolumn(p) - if (ityplun(l) == istsoil .or. ityplun(l) == istcrop) then - if (frac_veg_nosno(p) == 0) then - forc_hgt_u_pft(p) = forc_hgt_u(g) + z0mg(c) + displa(p) - forc_hgt_t_pft(p) = forc_hgt_t(g) + z0mg(c) + displa(p) - forc_hgt_q_pft(p) = forc_hgt_q(g) + z0mg(c) + displa(p) - else - forc_hgt_u_pft(p) = forc_hgt_u(g) + z0m(p) + displa(p) - forc_hgt_t_pft(p) = forc_hgt_t(g) + z0m(p) + displa(p) - forc_hgt_q_pft(p) = forc_hgt_q(g) + z0m(p) + displa(p) - end if - else if (ityplun(l) == istwet .or. ityplun(l) == istice & - .or. ityplun(l) == istice_mec) then - forc_hgt_u_pft(p) = forc_hgt_u(g) + z0mg(c) - forc_hgt_t_pft(p) = forc_hgt_t(g) + z0mg(c) - forc_hgt_q_pft(p) = forc_hgt_q(g) + z0mg(c) - else if (ityplun(l) == istdlak) then - ! Should change the roughness lengths to shared constants - if (t_grnd(c) >= tfrz) then - forc_hgt_u_pft(p) = forc_hgt_u(g) + 0.01_r8 - forc_hgt_t_pft(p) = forc_hgt_t(g) + 0.01_r8 - forc_hgt_q_pft(p) = forc_hgt_q(g) + 0.01_r8 - else - forc_hgt_u_pft(p) = forc_hgt_u(g) + 0.04_r8 - forc_hgt_t_pft(p) = forc_hgt_t(g) + 0.04_r8 - forc_hgt_q_pft(p) = forc_hgt_q(g) + 0.04_r8 - end if - else if (ityplun(l) == isturb) then - forc_hgt_u_pft(p) = forc_hgt_u(g) + z_0_town(l) + z_d_town(l) - forc_hgt_t_pft(p) = forc_hgt_t(g) + z_0_town(l) + z_d_town(l) - forc_hgt_q_pft(p) = forc_hgt_q(g) + z_0_town(l) + z_d_town(l) - end if - end if - end if - end do - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - thm(p) = forc_t(c) + 0.0098_r8*forc_hgt_t_pft(p) - end do - - end subroutine Biogeophysics1 - -end module Biogeophysics1Mod diff --git a/src_clm40/biogeophys/Biogeophysics2Mod.F90 b/src_clm40/biogeophys/Biogeophysics2Mod.F90 deleted file mode 100644 index 94ff9169b3..0000000000 --- a/src_clm40/biogeophys/Biogeophysics2Mod.F90 +++ /dev/null @@ -1,509 +0,0 @@ -module Biogeophysics2Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: Biogeophysics2Mod -! -! !DESCRIPTION: -! Performs the calculation of soil/snow and ground temperatures -! and updates surface fluxes based on the new ground temperature. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Biogeophysics2 ! Calculate soil/snow and ground temperatures -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Biogeophysics2 -! -! !INTERFACE: - subroutine Biogeophysics2 (lbl, ubl, lbc, ubc, lbp, ubp, & - num_urbanl, filter_urbanl, num_nolakec, filter_nolakec, & - num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! This is the main subroutine to execute the calculation of soil/snow and -! ground temperatures and update surface fluxes based on the new ground -! temperature -! -! Calling sequence is: -! Biogeophysics2: surface biogeophysics driver -! -> SoilTemperature: soil/snow and ground temperatures -! -> SoilTermProp thermal conductivities and heat capacities -! -> Tridiagonal tridiagonal matrix solution -! -> PhaseChange phase change of liquid/ice contents -! -! (1) Snow and soil temperatures -! o The volumetric heat capacity is calculated as a linear combination -! in terms of the volumetric fraction of the constituent phases. -! o The thermal conductivity of soil is computed from -! the algorithm of Johansen (as reported by Farouki 1981), and the -! conductivity of snow is from the formulation used in -! SNTHERM (Jordan 1991). -! o Boundary conditions: -! F = Rnet - Hg - LEg (top), F= 0 (base of the soil column). -! o Soil / snow temperature is predicted from heat conduction -! in 10 soil layers and up to 5 snow layers. -! The thermal conductivities at the interfaces between two -! neighboring layers (j, j+1) are derived from an assumption that -! the flux across the interface is equal to that from the node j -! to the interface and the flux from the interface to the node j+1. -! The equation is solved using the Crank-Nicholson method and -! results in a tridiagonal system equation. -! -! (2) Phase change (see PhaseChange.F90) -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_time_manager , only : get_step_size - use clm_varcon , only : hvap, cpair, grav, vkc, tfrz, sb, & - isturb, icol_roof, icol_sunwall, icol_shadewall, istsoil, & - istice_mec - use clm_varcon , only : istcrop - use clm_varpar , only : nlevsno, nlevgrnd, max_pft_per_col - use SoilTemperatureMod, only : SoilTemperature - use subgridAveMod , only : p2c -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbl, ubl ! landunit bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_urbanl ! number of urban landunits in clump - integer, intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - integer, intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! Migrated to clm2.0 by Keith Oleson and Mariana Vertenstein -! Migrated to clm2.1 new data structures by Peter Thornton and M. Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: ctype(:) ! column type - integer , pointer :: clandunit(:) ! column's landunit index - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: pwtgcell(:) ! pft's weight relative to corresponding column - integer , pointer :: npfts(:) ! column's number of pfts - integer , pointer :: pfti(:) ! column's beginning pft index - integer , pointer :: snl(:) ! number of snow layers - logical , pointer :: do_capsnow(:) ! true => do snow capping - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - real(r8), pointer :: emg(:) ! ground emissivity - real(r8), pointer :: htvp(:) ! latent heat of vapor of water (or sublimation) [j/kg] - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - integer , pointer :: frac_veg_nosno(:) ! fraction of vegetation not covered by snow (0 OR 1 now) [-] - real(r8), pointer :: cgrnds(:) ! deriv, of soil sensible heat flux wrt soil temp [w/m2/k] - real(r8), pointer :: cgrndl(:) ! deriv of soil latent heat flux wrt soil temp [w/m**2/k] - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: dlrad(:) ! downward longwave radiation below the canopy [W/m2] - real(r8), pointer :: ulrad(:) ! upward longwave radiation above the canopy [W/m2] - real(r8), pointer :: eflx_sh_veg(:) ! sensible heat flux from leaves (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_veg(:) ! vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_can(:) ! evaporation from leaves and stems (mm H2O/s) (+ = to atm) - real(r8), pointer :: wtcol(:) ! pft weight relative to column - real(r8), pointer :: tssbef(:,:) ! soil/snow temperature before update - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) (new) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) (new) - real(r8), pointer :: eflx_building_heat(:) ! heat flux from urban building interior to walls, roof - real(r8), pointer :: eflx_traffic_pft(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat_pft(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_pft(:) ! sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width (-) - -! local pointers to implicit inout arguments -! - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_snwcp_liq(:) ! excess rainfall due to snow capping (mm H2O /s) - real(r8), pointer :: qflx_snwcp_ice(:) ! excess snowfall due to snow capping (mm H2O /s) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: dt_grnd(:) ! change in t_grnd, last iteration (Kelvin) - real(r8), pointer :: eflx_soil_grnd(:) ! soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_u(:)! urban soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_r(:)! rural soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_sh_tot(:) ! total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_u(:) ! urban total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_r(:) ! rural total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: eflx_lh_tot(:) ! total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_u(:) ! urban total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_r(:) ! rural total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_grnd(:) ! ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_sub_snow(:) ! sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow(:) ! surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd(:) ! ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: eflx_lwrad_out(:) ! emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net(:) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_u(:) ! urban net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_r(:) ! rural net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lh_vege(:) ! veg evaporation heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_vegt(:) ! veg transpiration heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_grnd(:) ! ground evaporation heat flux (W/m**2) [+ to atm] - real(r8), pointer :: errsoi_pft(:) ! pft-level soil/lake energy conservation error (W/m**2) - real(r8), pointer :: errsoi_col(:) ! column-level soil/lake energy conservation error (W/m**2) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: p,c,g,j,pi,l ! indices - integer :: fc,fp ! lake filtered column and pft indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: egsmax(lbc:ubc) ! max. evaporation which soil can provide at one time step - real(r8) :: egirat(lbc:ubc) ! ratio of topsoil_evap_tot : egsmax - real(r8) :: tinc(lbc:ubc) ! temperature difference of two time step - real(r8) :: xmf(lbc:ubc) ! total latent heat of phase change of ground water - real(r8) :: sumwt(lbc:ubc) ! temporary - real(r8) :: evaprat(lbp:ubp) ! ratio of qflx_evap_soi/topsoil_evap_tot - real(r8) :: save_qflx_evap_soi ! temporary storage for qflx_evap_soi - real(r8) :: topsoil_evap_tot(lbc:ubc) ! column-level total evaporation from top soil layer - real(r8) :: fact(lbc:ubc, -nlevsno+1:nlevgrnd) ! used in computing tridiagonal matrix - real(r8) :: eflx_lwrad_del(lbp:ubp) ! update due to eflx_lwrad -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (gridcell-level) - - forc_lwrad => clm_a2l%forc_lwrad - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - clandunit => col%landunit - npfts => col%npfts - pfti => col%pfti - snl => cps%snl - do_capsnow => cps%do_capsnow - htvp => cps%htvp - emg => cps%emg - t_grnd => ces%t_grnd - dt_grnd => ces%dt_grnd - t_soisno => ces%t_soisno - tssbef => ces%tssbef - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - errsoi_col => cebal%errsoi - eflx_building_heat => cef%eflx_building_heat - - ! Assign local pointers to derived subtypes components (pft-level) - - pcolumn => pft%column - plandunit => pft%landunit - pgridcell => pft%gridcell - pwtgcell => pft%wtgcell - frac_veg_nosno => pps%frac_veg_nosno - sabg => pef%sabg - dlrad => pef%dlrad - ulrad => pef%ulrad - eflx_sh_grnd => pef%eflx_sh_grnd - eflx_sh_veg => pef%eflx_sh_veg - qflx_evap_soi => pwf%qflx_evap_soi - qflx_evap_veg => pwf%qflx_evap_veg - qflx_tran_veg => pwf%qflx_tran_veg - qflx_evap_can => pwf%qflx_evap_can - qflx_snwcp_liq => pwf%qflx_snwcp_liq - qflx_snwcp_ice => pwf%qflx_snwcp_ice - qflx_evap_tot => pwf%qflx_evap_tot - qflx_evap_grnd => pwf%qflx_evap_grnd - qflx_sub_snow => pwf%qflx_sub_snow - qflx_dew_snow => pwf%qflx_dew_snow - qflx_dew_grnd => pwf%qflx_dew_grnd - eflx_soil_grnd => pef%eflx_soil_grnd - eflx_soil_grnd_u => pef%eflx_soil_grnd_u - eflx_soil_grnd_r => pef%eflx_soil_grnd_r - eflx_sh_tot => pef%eflx_sh_tot - eflx_sh_tot_u => pef%eflx_sh_tot_u - eflx_sh_tot_r => pef%eflx_sh_tot_r - eflx_lh_tot => pef%eflx_lh_tot - eflx_lh_tot_u => pef%eflx_lh_tot_u - eflx_lh_tot_r => pef%eflx_lh_tot_r - eflx_lwrad_out => pef%eflx_lwrad_out - eflx_lwrad_net => pef%eflx_lwrad_net - eflx_lwrad_net_u => pef%eflx_lwrad_net_u - eflx_lwrad_net_r => pef%eflx_lwrad_net_r - eflx_lh_vege => pef%eflx_lh_vege - eflx_lh_vegt => pef%eflx_lh_vegt - eflx_lh_grnd => pef%eflx_lh_grnd - cgrnds => pef%cgrnds - cgrndl => pef%cgrndl - eflx_sh_grnd => pef%eflx_sh_grnd - qflx_evap_soi => pwf%qflx_evap_soi - errsoi_pft => pebal%errsoi - wtcol => pft%wtcol - eflx_wasteheat_pft => pef%eflx_wasteheat_pft - eflx_heat_from_ac_pft => pef%eflx_heat_from_ac_pft - eflx_traffic_pft => pef%eflx_traffic_pft - - ! Get step size - - dtime = get_step_size() - - ! Determine soil temperatures including surface soil temperature - - call SoilTemperature(lbl, ubl, lbc, ubc, num_urbanl, filter_urbanl, & - num_nolakec, filter_nolakec, xmf , fact) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - j = snl(c)+1 - - ! Calculate difference in soil temperature from last time step, for - ! flux corrections - - tinc(c) = t_soisno(c,j) - tssbef(c,j) - - ! Determine ratio of topsoil_evap_tot - - egsmax(c) = (h2osoi_ice(c,j)+h2osoi_liq(c,j)) / dtime - - ! added to trap very small negative soil water,ice - - if (egsmax(c) < 0._r8) then - egsmax(c) = 0._r8 - end if - end do - - ! A preliminary pft loop to determine if corrections are required for - ! excess evaporation from the top soil layer... Includes new logic - ! to distribute the corrections between pfts on the basis of their - ! evaporative demands. - ! egirat holds the ratio of demand to availability if demand is - ! greater than availability, or 1.0 otherwise. - ! Correct fluxes to present soil temperature - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - eflx_sh_grnd(p) = eflx_sh_grnd(p) + tinc(c)*cgrnds(p) - qflx_evap_soi(p) = qflx_evap_soi(p) + tinc(c)*cgrndl(p) - end do - - ! Set the column-average qflx_evap_soi as the weighted average over all pfts - ! but only count the pfts that are evaporating - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - topsoil_evap_tot(c) = 0._r8 - sumwt(c) = 0._r8 - end do - - do pi = 1,max_pft_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if ( pi <= npfts(c) ) then - p = pfti(c) + pi - 1 - ! Note: some glacier_mec pfts may have zero weight - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - topsoil_evap_tot(c) = topsoil_evap_tot(c) + qflx_evap_soi(p) * wtcol(p) - end if - end if - end do - end do - - ! Calculate ratio for rescaling pft-level fluxes to meet availability - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (topsoil_evap_tot(c) > egsmax(c)) then - egirat(c) = (egsmax(c)/topsoil_evap_tot(c)) - else - egirat(c) = 1.0_r8 - end if - end do - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - l = plandunit(p) - g = pgridcell(p) - j = snl(c)+1 - - ! Correct soil fluxes for possible evaporation in excess of top layer water - ! excess energy is added to the sensible heat flux from soil - - if (egirat(c) < 1.0_r8) then - save_qflx_evap_soi = qflx_evap_soi(p) - qflx_evap_soi(p) = qflx_evap_soi(p) * egirat(c) - eflx_sh_grnd(p) = eflx_sh_grnd(p) + (save_qflx_evap_soi - qflx_evap_soi(p))*htvp(c) - end if - - ! Ground heat flux - - if (ltype(l) /= isturb) then - eflx_soil_grnd(p) = sabg(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(g) & - - emg(c)*sb*tssbef(c,j)**3*(tssbef(c,j) + 4._r8*tinc(c)) & - - (eflx_sh_grnd(p) + qflx_evap_soi(p)*htvp(c)) - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - eflx_soil_grnd_r(p) = eflx_soil_grnd(p) - end if - else - ! For all urban columns we use the net longwave radiation (eflx_lwrad_net) since - ! the term (emg*sb*tssbef(snl+1)**4) is not the upward longwave flux because of - ! interactions between urban columns. - - eflx_lwrad_del(p) = 4._r8*emg(c)*sb*tssbef(c,j)**3*tinc(c) - ! Include transpiration term because needed for pervious road - ! and wasteheat and traffic flux - eflx_soil_grnd(p) = sabg(p) + dlrad(p) & - - eflx_lwrad_net(p) - eflx_lwrad_del(p) & - - (eflx_sh_grnd(p) + qflx_evap_soi(p)*htvp(c) + qflx_tran_veg(p)*hvap) & - + eflx_wasteheat_pft(p) + eflx_heat_from_ac_pft(p) + eflx_traffic_pft(p) - eflx_soil_grnd_u(p) = eflx_soil_grnd(p) - end if - - ! Total fluxes (vegetation + ground) - - eflx_sh_tot(p) = eflx_sh_veg(p) + eflx_sh_grnd(p) - qflx_evap_tot(p) = qflx_evap_veg(p) + qflx_evap_soi(p) - eflx_lh_tot(p)= hvap*qflx_evap_veg(p) + htvp(c)*qflx_evap_soi(p) - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - eflx_lh_tot_r(p)= eflx_lh_tot(p) - eflx_sh_tot_r(p)= eflx_sh_tot(p) - else if (ltype(l) == isturb) then - eflx_lh_tot_u(p)= eflx_lh_tot(p) - eflx_sh_tot_u(p)= eflx_sh_tot(p) - end if - - ! Assign ground evaporation to sublimation from soil ice or to dew - ! on snow or ground - - qflx_evap_grnd(p) = 0._r8 - qflx_sub_snow(p) = 0._r8 - qflx_dew_snow(p) = 0._r8 - qflx_dew_grnd(p) = 0._r8 - - if (qflx_evap_soi(p) >= 0._r8) then - ! for evaporation partitioning between liquid evap and ice sublimation, - ! use the ratio of liquid to (liquid+ice) in the top layer to determine split - if ((h2osoi_liq(c,j)+h2osoi_ice(c,j)) > 0.) then - qflx_evap_grnd(p) = max(qflx_evap_soi(p)*(h2osoi_liq(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j))), 0._r8) - else - qflx_evap_grnd(p) = 0. - end if - qflx_sub_snow(p) = qflx_evap_soi(p) - qflx_evap_grnd(p) - else - if (t_grnd(c) < tfrz) then - qflx_dew_snow(p) = abs(qflx_evap_soi(p)) - else - qflx_dew_grnd(p) = abs(qflx_evap_soi(p)) - end if - end if - - ! Update the pft-level qflx_snwcp - ! This was moved in from Hydrology2 to keep all pft-level - ! calculations out of Hydrology2 - - if (snl(c) < 0 .and. do_capsnow(c)) then - qflx_snwcp_liq(p) = qflx_snwcp_liq(p) + qflx_dew_grnd(p) - qflx_snwcp_ice(p) = qflx_snwcp_ice(p) + qflx_dew_snow(p) - end if - - ! Variables needed by history tape - - qflx_evap_can(p) = qflx_evap_veg(p) - qflx_tran_veg(p) - eflx_lh_vege(p) = (qflx_evap_veg(p) - qflx_tran_veg(p)) * hvap - eflx_lh_vegt(p) = qflx_tran_veg(p) * hvap - eflx_lh_grnd(p) = qflx_evap_soi(p) * htvp(c) - - end do - - ! Soil Energy balance check - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - errsoi_pft(p) = eflx_soil_grnd(p) - xmf(c) - - ! For urban sunwall, shadewall, and roof columns, the "soil" energy balance check - ! must include the heat flux from the interior of the building. - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall .or. ctype(c)==icol_roof) then - errsoi_pft(p) = errsoi_pft(p) + eflx_building_heat(c) - end if - end do - do j = -nlevsno+1,nlevgrnd - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - if (j >= snl(c)+1) then - errsoi_pft(p) = errsoi_pft(p) - (t_soisno(c,j)-tssbef(c,j))/fact(c,j) - end if - end do - end do - - ! Outgoing long-wave radiation from vegetation + ground - ! For conservation we put the increase of ground longwave to outgoing - ! For urban pfts, ulrad=0 and (1-fracveg_nosno)=1, and eflx_lwrad_out and eflx_lwrad_net - ! are calculated in UrbanRadiation. The increase of ground longwave is added directly - ! to the outgoing longwave and the net longwave. - - do fp = 1,num_nolakep - p = filter_nolakep(fp) - c = pcolumn(p) - l = plandunit(p) - g = pgridcell(p) - j = snl(c)+1 - - if (ltype(l) /= isturb) then - eflx_lwrad_out(p) = ulrad(p) & - + (1-frac_veg_nosno(p))*(1.-emg(c))*forc_lwrad(g) & - + (1-frac_veg_nosno(p))*emg(c)*sb*tssbef(c,j)**4 & - + 4.*emg(c)*sb*tssbef(c,j)**3*tinc(c) - eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(g) - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - eflx_lwrad_net_r(p) = eflx_lwrad_out(p) - forc_lwrad(g) - end if - else - eflx_lwrad_out(p) = eflx_lwrad_out(p) + eflx_lwrad_del(p) - eflx_lwrad_net(p) = eflx_lwrad_net(p) + eflx_lwrad_del(p) - eflx_lwrad_net_u(p) = eflx_lwrad_net_u(p) + eflx_lwrad_del(p) - end if - end do - - ! lake balance for errsoi is not over pft - ! therefore obtain column-level radiative temperature - - call p2c(num_nolakec, filter_nolakec, errsoi_pft, errsoi_col) - - end subroutine Biogeophysics2 - -end module Biogeophysics2Mod diff --git a/src_clm40/biogeophys/BiogeophysicsLakeMod.F90 b/src_clm40/biogeophys/BiogeophysicsLakeMod.F90 deleted file mode 100644 index d902720ea9..0000000000 --- a/src_clm40/biogeophys/BiogeophysicsLakeMod.F90 +++ /dev/null @@ -1,764 +0,0 @@ -module BiogeophysicsLakeMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: BiogeophysicsLakeMod -! -! !DESCRIPTION: -! Calculates lake temperatures and surface fluxes. -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: BiogeophysicsLake - -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BiogeophysicsLake -! -! !INTERFACE: - subroutine BiogeophysicsLake(lbc, ubc, lbp, ubp, num_lakec, filter_lakec, & - num_lakep, filter_lakep) -! -! !DESCRIPTION: -! Calculates lake temperatures and surface fluxes. -! Lake temperatures are determined from a one-dimensional thermal -! stratification model based on eddy diffusion concepts to -! represent vertical mixing of heat. -! -! d ts d d ts 1 ds -! ---- = -- [(km + ke) ----] + -- -- -! dt dz dz cw dz -! -! where: ts = temperature (kelvin) -! t = time (s) -! z = depth (m) -! km = molecular diffusion coefficient (m**2/s) -! ke = eddy diffusion coefficient (m**2/s) -! cw = heat capacity (j/m**3/kelvin) -! s = heat source term (w/m**2) -! -! There are two types of lakes: -! Deep lakes are 50 m. -! Shallow lakes are 10 m deep. -! -! For unfrozen deep lakes: ke > 0 and convective mixing -! For unfrozen shallow lakes: ke = 0 and no convective mixing -! -! Use the Crank-Nicholson method to set up tridiagonal system of equations to -! solve for ts at time n+1, where the temperature equation for layer i is -! r_i = a_i [ts_i-1] n+1 + b_i [ts_i] n+1 + c_i [ts_i+1] n+1 -! -! The solution conserves energy as: -! -! cw*([ts( 1)] n+1 - [ts( 1)] n)*dz( 1)/dt + ... + -! cw*([ts(nlevlak)] n+1 - [ts(nlevlak)] n)*dz(nlevlak)/dt = fin -! -! where: -! [ts] n = old temperature (kelvin) -! [ts] n+1 = new temperature (kelvin) -! fin = heat flux into lake (w/m**2) -! = beta*sabg + forc_lwrad - eflx_lwrad_out - eflx_sh_tot - eflx_lh_tot -! - hm + phi(1) + ... + phi(nlevlak) -! -! WARNING: This subroutine assumes lake columns have one and only one pft. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_time_manager , only : get_step_size - use clm_varpar , only : nlevlak - use clm_varcon , only : hvap, hsub, hfus, cpair, cpliq, cpice, tkwat, tkice, & - sb, vkc, grav, denh2o, tfrz, spval - use QSatMod , only : QSat - use FrictionVelocityMod, only : FrictionVelocity, MoninObukIni - use TridiagonalMod , only : Tridiagonal -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: num_lakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_lakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_lakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_lakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! Migrated to clm2.1 new data structures by Peter Thornton and M. Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: cgridcell(:) ! column's gridcell index - real(r8), pointer :: forc_t(:) ! atmospheric temperature (Kelvin) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: forc_hgt_u_pft(:) ! observational height of wind at pft level [m] - real(r8), pointer :: forc_hgt_t_pft(:) ! observational height of temperature at pft level [m] - real(r8), pointer :: forc_hgt_q_pft(:) ! observational height of specific humidity at pft level [m] - real(r8), pointer :: forc_th(:) ! atmospheric potential temperature (Kelvin) - real(r8), pointer :: forc_q(:) ! atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_u(:) ! atmospheric wind speed in east direction (m/s) - real(r8), pointer :: forc_v(:) ! atmospheric wind speed in north direction (m/s) - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - real(r8), pointer :: forc_rho(:) ! density (kg/m**3) - real(r8), pointer :: forc_snow(:) ! snow rate [mm/s] - real(r8), pointer :: forc_rain(:) ! rain rate [mm/s] - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: hc_soisno(:) ! soil plus snow plus lake heat content (MJ/m2) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: lat(:) ! latitude (radians) - real(r8), pointer :: dz(:,:) ! layer thickness (m) - real(r8), pointer :: z(:,:) ! layer depth (m) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: qflx_prec_grnd(:) ! water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: qflx_snwcp_liq(:) ! excess rainfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: qflx_snwcp_ice(:) ! excess snowfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lwrad_out(:) ! emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net(:) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_soil_grnd(:) ! soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_sh_tot(:) ! total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot(:) ! total latent heat flux (W/m8*2) [+ to atm] - real(r8), pointer :: eflx_lh_grnd(:) ! ground evaporation heat flux (W/m**2) [+ to atm] - real(r8), pointer :: t_veg(:) ! vegetation temperature (Kelvin) - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: q_ref2m(:) ! 2 m height surface specific humidity (kg/kg) - real(r8), pointer :: rh_ref2m(:) ! 2 m height surface relative humidity (%) - real(r8), pointer :: taux(:) ! wind (shear) stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy(:) ! wind (shear) stress: n-s (kg/m/s**2) - real(r8), pointer :: qmelt(:) ! snow melt [mm/s] - real(r8), pointer :: ram1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: errsoi(:) ! soil/lake energy conservation error (W/m**2) - real(r8), pointer :: t_lake(:,:) ! lake temperature (Kelvin) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer , parameter :: idlak = 1 ! index of lake, 1 = deep lake, 2 = shallow lake - integer , parameter :: niters = 3 ! maximum number of iterations for surface temperature - real(r8), parameter :: beta1 = 1._r8 ! coefficient of connective velocity (in computing W_*) [-] - real(r8), parameter :: emg = 0.97_r8 ! ground emissivity (0.97 for snow) - real(r8), parameter :: zii = 1000._r8 ! convective boundary height [m] - real(r8), parameter :: p0 = 1._r8 ! neutral value of turbulent prandtl number - integer :: i,j,fc,fp,g,c,p ! do loop or array index - integer :: fncopy ! number of values in pft filter copy - integer :: fnold ! previous number of pft filter values - integer :: fpcopy(num_lakep) ! pft filter copy for iteration loop - integer :: num_unfrzc ! number of values in unfrozen column filter - integer :: filter_unfrzc(ubc-lbc+1)! unfrozen column filter - integer :: iter ! iteration index - integer :: nmozsgn(lbp:ubp) ! number of times moz changes sign - integer :: jtop(lbc:ubc) ! number of levels for each column (all 1) - real(r8) :: dtime ! land model time step (sec) - real(r8) :: ax ! - real(r8) :: bx ! - real(r8) :: degdT ! d(eg)/dT - real(r8) :: dqh(lbp:ubp) ! diff of humidity between ref. height and surface - real(r8) :: dth(lbp:ubp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dzsur(lbc:ubc) ! - real(r8) :: eg ! water vapor pressure at temperature T [pa] - real(r8) :: hm ! energy residual [W/m2] - real(r8) :: htvp(lbc:ubc) ! latent heat of vapor of water (or sublimation) [j/kg] - real(r8) :: obu(lbp:ubp) ! monin-obukhov length (m) - real(r8) :: obuold(lbp:ubp) ! monin-obukhov length of previous iteration - real(r8) :: qsatg(lbc:ubc) ! saturated humidity [kg/kg] - real(r8) :: qsatgdT(lbc:ubc) ! d(qsatg)/dT - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: ram(lbp:ubp) ! aerodynamical resistance [s/m] - real(r8) :: rah(lbp:ubp) ! thermal resistance [s/m] - real(r8) :: raw(lbp:ubp) ! moisture resistance [s/m] - real(r8) :: stftg3(lbp:ubp) ! derivative of fluxes w.r.t ground temperature - real(r8) :: temp1(lbp:ubp) ! relation for potential temperature profile - real(r8) :: temp12m(lbp:ubp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(lbp:ubp) ! relation for specific humidity profile - real(r8) :: temp22m(lbp:ubp) ! relation for specific humidity profile applied at 2-m - real(r8) :: tgbef(lbc:ubc) ! initial ground temperature - real(r8) :: thm(lbp:ubp) ! intermediate variable (forc_t+0.0098*forc_hgt_t_pft) - real(r8) :: thv(lbc:ubc) ! virtual potential temperature (kelvin) - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: tksur ! thermal conductivity of snow/soil (w/m/kelvin) - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: um(lbp:ubp) ! wind speed including the stablity effect [m/s] - real(r8) :: ur(lbp:ubp) ! wind speed at reference height [m/s] - real(r8) :: ustar(lbp:ubp) ! friction velocity [m/s] - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: zldis(lbp:ubp) ! reference height "minus" zero displacement height [m] - real(r8) :: displa(lbp:ubp) ! displacement (always zero) [m] - real(r8) :: z0mg(lbp:ubp) ! roughness length over ground, momentum [m] - real(r8) :: z0hg(lbp:ubp) ! roughness length over ground, sensible heat [m] - real(r8) :: z0qg(lbp:ubp) ! roughness length over ground, latent heat [m] - real(r8) :: beta(2) ! fraction solar rad absorbed at surface: depends on lake type - real(r8) :: za(2) ! base of surface absorption layer (m): depends on lake type - real(r8) :: eta(2) ! light extinction coefficient (/m): depends on lake type - real(r8) :: a(lbc:ubc,nlevlak) ! "a" vector for tridiagonal matrix - real(r8) :: b(lbc:ubc,nlevlak) ! "b" vector for tridiagonal matrix - real(r8) :: c1(lbc:ubc,nlevlak) ! "c" vector for tridiagonal matrix - real(r8) :: r(lbc:ubc,nlevlak) ! "r" vector for tridiagonal solution - real(r8) :: rhow(lbc:ubc,nlevlak) ! density of water (kg/m**3) - real(r8) :: phi(lbc:ubc,nlevlak) ! solar radiation absorbed by layer (w/m**2) - real(r8) :: kme(lbc:ubc,nlevlak) ! molecular + eddy diffusion coefficient (m**2/s) - real(r8) :: cwat ! specific heat capacity of water (j/m**3/kelvin) - real(r8) :: ws(lbc:ubc) ! surface friction velocity (m/s) - real(r8) :: ks(lbc:ubc) ! coefficient - real(r8) :: in ! relative flux of solar radiation into layer - real(r8) :: out ! relative flux of solar radiation out of layer - real(r8) :: ri ! richardson number - real(r8) :: fin(lbc:ubc) ! heat flux into lake - flux out of lake (w/m**2) - real(r8) :: ocvts(lbc:ubc) ! (cwat*(t_lake[n ])*dz - real(r8) :: ncvts(lbc:ubc) ! (cwat*(t_lake[n+1])*dz - real(r8) :: m1 ! intermediate variable for calculating r, a, b, c - real(r8) :: m2 ! intermediate variable for calculating r, a, b, c - real(r8) :: m3 ! intermediate variable for calculating r, a, b, c - real(r8) :: ke ! eddy diffusion coefficient (m**2/s) - real(r8) :: km ! molecular diffusion coefficient (m**2/s) - real(r8) :: zin ! depth at top of layer (m) - real(r8) :: zout ! depth at bottom of layer (m) - real(r8) :: drhodz ! d [rhow] /dz (kg/m**4) - real(r8) :: n2 ! brunt-vaisala frequency (/s**2) - real(r8) :: num ! used in calculating ri - real(r8) :: den ! used in calculating ri - real(r8) :: tav(lbc:ubc) ! used in aver temp for convectively mixed layers - real(r8) :: nav(lbc:ubc) ! used in aver temp for convectively mixed layers - real(r8) :: phidum ! temporary value of phi - real(r8) :: u2m ! 2 m wind speed (m/s) - real(r8) :: fm(lbp:ubp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m -! -! Constants for lake temperature model -! - data beta/0.4_r8, 0.4_r8/ ! (deep lake, shallow lake) - data za /0.6_r8, 0.5_r8/ - data eta /0.1_r8, 0.5_r8/ -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (gridcell-level) - - forc_t => clm_a2l%forc_t - forc_pbot => clm_a2l%forc_pbot - forc_th => clm_a2l%forc_th - forc_q => clm_a2l%forc_q - forc_u => clm_a2l%forc_u - forc_v => clm_a2l%forc_v - forc_rho => clm_a2l%forc_rho - forc_lwrad => clm_a2l%forc_lwrad - forc_snow => clm_a2l%forc_snow - forc_rain => clm_a2l%forc_rain - lat => grc%lat - - ! Assign local pointers to derived type members (column-level) - - cgridcell => col%gridcell - dz => cps%dz - z => cps%z - t_lake => ces%t_lake - h2osno => cws%h2osno - snowdp => cps%snowdp - t_grnd => ces%t_grnd - hc_soisno => ces%hc_soisno - errsoi => cebal%errsoi - qmelt => cwf%qmelt - - ! Assign local pointers to derived type members (pft-level) - - pcolumn => pft%column - pgridcell => pft%gridcell - sabg => pef%sabg - t_ref2m => pes%t_ref2m - q_ref2m => pes%q_ref2m - rh_ref2m => pes%rh_ref2m - t_veg => pes%t_veg - eflx_lwrad_out => pef%eflx_lwrad_out - eflx_lwrad_net => pef%eflx_lwrad_net - eflx_soil_grnd => pef%eflx_soil_grnd - eflx_lh_tot => pef%eflx_lh_tot - eflx_lh_grnd => pef%eflx_lh_grnd - eflx_sh_grnd => pef%eflx_sh_grnd - eflx_sh_tot => pef%eflx_sh_tot - ram1 => pps%ram1 - taux => pmf%taux - tauy => pmf%tauy - qflx_prec_grnd => pwf%qflx_prec_grnd - qflx_evap_soi => pwf%qflx_evap_soi - qflx_evap_tot => pwf%qflx_evap_tot - forc_hgt_u_pft => pps%forc_hgt_u_pft - forc_hgt_t_pft => pps%forc_hgt_t_pft - forc_hgt_q_pft => pps%forc_hgt_q_pft - qflx_snwcp_ice => pwf%qflx_snwcp_ice - qflx_snwcp_liq => pwf%qflx_snwcp_liq - - ! Determine step size - - dtime = get_step_size() - - ! Begin calculations - - do fc = 1, num_lakec - c = filter_lakec(fc) - g = cgridcell(c) - - ! Initialize quantities computed below - - ocvts(c) = 0._r8 - ncvts(c) = 0._r8 - hc_soisno(c) = 0._r8 - - ! Surface temperature and fluxes - - dzsur(c) = dz(c,1) + snowdp(c) - - ! Saturated vapor pressure, specific humidity and their derivatives - ! at lake surface - - call QSat(t_grnd(c), forc_pbot(g), eg, degdT, qsatg(c), qsatgdT(c)) - - ! Potential, virtual potential temperature, and wind speed at the - ! reference height - - !zii = 1000. ! m (pbl height) - thv(c) = forc_th(g)*(1._r8+0.61_r8*forc_q(g)) ! virtual potential T - end do - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - g = pgridcell(p) - - nmozsgn(p) = 0 - obuold(p) = 0._r8 - displa(p) = 0._r8 - thm(p) = forc_t(g) + 0.0098_r8*forc_hgt_t_pft(p) ! intermediate variable - - ! Roughness lengths - - if (t_grnd(c) >= tfrz) then ! for unfrozen lake - z0mg(p) = 0.01_r8 - else ! for frozen lake - z0mg(p) = 0.04_r8 - end if - z0hg(p) = z0mg(p) - z0qg(p) = z0mg(p) - - ! Latent heat - - if (forc_t(g) > tfrz) then - htvp(c) = hvap - else - htvp(c) = hsub - end if - - ! Initialize stability variables - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-t_grnd(c) - dqh(p) = forc_q(g)-qsatg(c) - dthv = dth(p)*(1._r8+0.61_r8*forc_q(g))+0.61_r8*forc_th(g)*dqh(p) - zldis(p) = forc_hgt_u_pft(p) - 0._r8 - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv, zldis(p), z0mg(p), um(p), obu(p)) - - end do - - iter = 1 - fncopy = num_lakep - fpcopy(1:num_lakep) = filter_lakep(1:num_lakep) - - ! Begin stability iteration - - ITERATION : do while (iter <= niters .and. fncopy > 0) - - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - call FrictionVelocity(lbp, ubp, fncopy, fpcopy, & - displa, z0mg, z0hg, z0qg, & - obu, iter, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm) - - do fp = 1, fncopy - p = fpcopy(fp) - c = pcolumn(p) - g = pgridcell(p) - - tgbef(c) = t_grnd(c) - if (t_grnd(c) > tfrz) then - tksur = tkwat - else - tksur = tkice - end if - - ! Determine aerodynamic resistances - - ram(p) = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah(p) = 1._r8/(temp1(p)*ustar(p)) - raw(p) = 1._r8/(temp2(p)*ustar(p)) - ram1(p) = ram(p) !pass value to global variable - - ! Get derivative of fluxes with respect to ground temperature - - stftg3(p) = emg*sb*tgbef(c)*tgbef(c)*tgbef(c) - - ax = sabg(p) + emg*forc_lwrad(g) + 3._r8*stftg3(p)*tgbef(c) & - + forc_rho(g)*cpair/rah(p)*thm(p) & - - htvp(c)*forc_rho(g)/raw(p)*(qsatg(c)-qsatgdT(c)*tgbef(c) - forc_q(g)) & - + tksur*t_lake(c,1)/dzsur(c) - - bx = 4._r8*stftg3(p) + forc_rho(g)*cpair/rah(p) & - + htvp(c)*forc_rho(g)/raw(p)*qsatgdT(c) + tksur/dzsur(c) - - t_grnd(c) = ax/bx - - ! Surface fluxes of momentum, sensible and latent heat - ! using ground temperatures from previous time step - - eflx_sh_grnd(p) = forc_rho(g)*cpair*(t_grnd(c)-thm(p))/rah(p) - qflx_evap_soi(p) = forc_rho(g)*(qsatg(c)+qsatgdT(c)*(t_grnd(c)-tgbef(c))-forc_q(g))/raw(p) - - ! Re-calculate saturated vapor pressure, specific humidity and their - ! derivatives at lake surface - - call QSat(t_grnd(c), forc_pbot(g), eg, degdT, qsatg(c), qsatgdT(c)) - - dth(p)=thm(p)-t_grnd(c) - dqh(p)=forc_q(g)-qsatg(c) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - - !not used - !dthv=dth(p)*(1.+0.61*forc_q(g))+0.61*forc_th(g)*dqh(p) - thvstar=tstar*(1._r8+0.61_r8*forc_q(g)) + 0.61_r8*forc_th(g)*qstar - zeta=zldis(p)*vkc * grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(2._r8,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta1*(-grav*ustar(p)*thvstar*zii/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p)+wc*wc) - end if - obu(p) = zldis(p)/zeta - - if (obuold(p)*obu(p) < 0._r8) nmozsgn(p) = nmozsgn(p)+1 - - obuold(p) = obu(p) - - end do ! end of filtered pft loop - - iter = iter + 1 - if (iter <= niters ) then - ! Rebuild copy of pft filter for next pass through the ITERATION loop - - fnold = fncopy - fncopy = 0 - do fp = 1, fnold - p = fpcopy(fp) - if (nmozsgn(p) < 3) then - fncopy = fncopy + 1 - fpcopy(fncopy) = p - end if - end do ! end of filtered pft loop - end if - - end do ITERATION ! end of stability iteration - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - g = pgridcell(p) - - ! initialize snow cap terms to zero for lake columns - qflx_snwcp_ice(p) = 0._r8 - qflx_snwcp_liq(p) = 0._r8 - - ! If there is snow on the ground and t_grnd > tfrz: reset t_grnd = tfrz. - ! Re-evaluate ground fluxes. Energy imbalance used to melt snow. - ! h2osno > 0.5 prevents spurious fluxes. - ! note that qsatg and qsatgdT should be f(tgbef) (PET: not sure what this - ! comment means) - - if (h2osno(c) > 0.5_r8 .AND. t_grnd(c) > tfrz) then - t_grnd(c) = tfrz - eflx_sh_grnd(p) = forc_rho(g)*cpair*(t_grnd(c)-thm(p))/rah(p) - qflx_evap_soi(p) = forc_rho(g)*(qsatg(c)+qsatgdT(c)*(t_grnd(c)-tgbef(c)) - forc_q(g))/raw(p) - end if - - ! Net longwave from ground to atmosphere - - eflx_lwrad_out(p) = (1._r8-emg)*forc_lwrad(g) + stftg3(p)*(-3._r8*tgbef(c)+4._r8*t_grnd(c)) - - ! Ground heat flux - - eflx_soil_grnd(p) = sabg(p) + forc_lwrad(g) - eflx_lwrad_out(p) - & - eflx_sh_grnd(p) - htvp(c)*qflx_evap_soi(p) - - taux(p) = -forc_rho(g)*forc_u(g)/ram(p) - tauy(p) = -forc_rho(g)*forc_v(g)/ram(p) - - eflx_sh_tot(p) = eflx_sh_grnd(p) - qflx_evap_tot(p) = qflx_evap_soi(p) - eflx_lh_tot(p) = htvp(c)*qflx_evap_soi(p) - eflx_lh_grnd(p) = htvp(c)*qflx_evap_soi(p) - - ! 2 m height air temperature - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - - ! 2 m height specific humidity - q_ref2m(p) = forc_q(g) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(g), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - - ! Energy residual used for melting snow - if (h2osno(c) > 0._r8 .AND. t_grnd(c) >= tfrz) then - hm = min(h2osno(c)*hfus/dtime, max(eflx_soil_grnd(p),0._r8)) - else - hm = 0._r8 - end if - qmelt(c) = hm/hfus ! snow melt (mm/s) - - ! Prepare for lake layer temperature calculations below - - fin(c) = beta(idlak) * sabg(p) + forc_lwrad(g) - (eflx_lwrad_out(p) + & - eflx_sh_tot(p) + eflx_lh_tot(p) + hm) - u2m = max(1.0_r8,ustar(p)/vkc*log(2._r8/z0mg(p))) - - ws(c) = 1.2e-03_r8 * u2m - ks(c) = 6.6_r8*sqrt(abs(sin(lat(g))))*(u2m**(-1.84_r8)) - - end do - - ! Eddy diffusion + molecular diffusion coefficient (constants): - ! eddy diffusion coefficient used for unfrozen deep lakes only - - cwat = cpliq*denh2o ! a constant - km = tkwat/cwat ! a constant - - ! Lake density - - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - rhow(c,j) = 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,j)-277._r8))**1.68_r8 ) - end do - end do - - do j = 1, nlevlak-1 - do fc = 1, num_lakec - c = filter_lakec(fc) - drhodz = (rhow(c,j+1)-rhow(c,j)) / (z(c,j+1)-z(c,j)) - n2 = -grav / rhow(c,j) * drhodz - num = 40._r8 * n2 * (vkc*z(c,j))**2 - den = max( (ws(c)**2) * exp(-2._r8*ks(c)*z(c,j)), 1.e-10_r8 ) - ri = ( -1._r8 + sqrt( max(1._r8+num/den, 0._r8) ) ) / 20._r8 - if (t_grnd(c) > tfrz) then - ! valid for deep lake only (idlak == 1) - ke = vkc*ws(c)*z(c,j)/p0 * exp(-ks(c)*z(c,j)) / (1._r8+37._r8*ri*ri) - else - ke = 0._r8 - end if - kme(c,j) = km + ke - end do - end do - - do fc = 1, num_lakec - c = filter_lakec(fc) - kme(c,nlevlak) = kme(c,nlevlak-1) - ! set number of column levels for use by Tridiagonal below - jtop(c) = 1 - end do - - ! Heat source term: unfrozen lakes only - - do j = 1, nlevlak - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - - zin = z(c,j) - 0.5_r8*dz(c,j) - zout = z(c,j) + 0.5_r8*dz(c,j) - in = exp( -eta(idlak)*max( zin-za(idlak),0._r8 ) ) - out = exp( -eta(idlak)*max( zout-za(idlak),0._r8 ) ) - - ! Assume solar absorption is only in the considered depth - if (j == nlevlak) out = 0._r8 - if (t_grnd(c) > tfrz) then - phidum = (in-out) * sabg(p) * (1._r8-beta(idlak)) - else if (j == 1) then - phidum = sabg(p) * (1._r8-beta(idlak)) - else - phidum = 0._r8 - end if - phi(c,j) = phidum - end do - end do - - ! Sum cwat*t_lake*dz for energy check - - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - - ocvts(c) = ocvts(c) + cwat*t_lake(c,j)*dz(c,j) - end do - end do - - ! Set up vector r and vectors a, b, c that define tridiagonal matrix - - do fc = 1, num_lakec - c = filter_lakec(fc) - - j = 1 - m2 = dz(c,j)/kme(c,j) + dz(c,j+1)/kme(c,j+1) - m3 = dtime/dz(c,j) - r(c,j) = t_lake(c,j) + (fin(c)+phi(c,j))*m3/cwat - (t_lake(c,j)-t_lake(c,j+1))*m3/m2 - a(c,j) = 0._r8 - b(c,j) = 1._r8 + m3/m2 - c1(c,j) = -m3/m2 - - j = nlevlak - m1 = dz(c,j-1)/kme(c,j-1) + dz(c,j)/kme(c,j) - m3 = dtime/dz(c,j) - r(c,j) = t_lake(c,j) + phi(c,j)*m3/cwat + (t_lake(c,j-1)-t_lake(c,j))*m3/m1 - a(c,j) = -m3/m1 - b(c,j) = 1._r8 + m3/m1 - c1(c,j) = 0._r8 - end do - - do j = 2, nlevlak-1 - do fc = 1, num_lakec - c = filter_lakec(fc) - - m1 = dz(c,j-1)/kme(c,j-1) + dz(c,j )/kme(c,j ) - m2 = dz(c,j )/kme(c,j ) + dz(c,j+1)/kme(c,j+1) - m3 = dtime/dz(c,j) - r(c,j) = t_lake(c,j) + phi(c,j)*m3/cwat + & - (t_lake(c,j-1) - t_lake(c,j ))*m3/m1 - & - (t_lake(c,j ) - t_lake(c,j+1))*m3/m2 - - a(c,j) = -m3/m1 - b(c,j) = 1._r8 + m3/m1 + m3/m2 - c1(c,j) = -m3/m2 - end do - end do - - ! Solve for t_lake: a, b, c, r, u - - call Tridiagonal(lbc, ubc, 1, nlevlak, jtop, num_lakec, filter_lakec, & - a, b, c1, r, t_lake(lbc:ubc,1:nlevlak)) - - ! Convective mixing: make sure cwat*dz*ts is conserved. Valid only for - ! deep lakes (idlak == 1). - - num_unfrzc = 0 - do fc = 1, num_lakec - c = filter_lakec(fc) - if (t_grnd(c) > tfrz) then - num_unfrzc = num_unfrzc + 1 - filter_unfrzc(num_unfrzc) = c - end if - end do - - do j = 1, nlevlak-1 - do fc = 1, num_unfrzc - c = filter_unfrzc(fc) - tav(c) = 0._r8 - nav(c) = 0._r8 - end do - - do i = 1, j+1 - do fc = 1, num_unfrzc - c = filter_unfrzc(fc) - if (rhow(c,j) > rhow(c,j+1)) then - tav(c) = tav(c) + t_lake(c,i)*dz(c,i) - nav(c) = nav(c) + dz(c,i) - end if - end do - end do - - do fc = 1, num_unfrzc - c = filter_unfrzc(fc) - if (rhow(c,j) > rhow(c,j+1)) then - tav(c) = tav(c)/nav(c) - end if - end do - - do i = 1, j+1 - do fc = 1, num_unfrzc - c = filter_unfrzc(fc) - if (nav(c) > 0._r8) then - t_lake(c,i) = tav(c) - rhow(c,i) = 1000._r8*( 1.0_r8 - 1.9549e-05_r8*(abs(t_lake(c,i)-277._r8))**1.68_r8 ) - end if - end do - end do - end do - - ! Sum cwat*t_lake*dz and total energy into lake for energy check - - do j = 1, nlevlak - do fc = 1, num_lakec - c = filter_lakec(fc) - ncvts(c) = ncvts(c) + cwat*t_lake(c,j)*dz(c,j) - hc_soisno(c) = hc_soisno(c) + cwat*t_lake(c,j)*dz(c,j) /1.e6_r8 - if (j == nlevlak) then - hc_soisno(c) = hc_soisno(c) + & - cpice*h2osno(c)*t_grnd(c)*snowdp(c) /1.e6_r8 - endif - fin(c) = fin(c) + phi(c,j) - end do - end do - - ! The following are needed for global average on history tape. - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - g = pgridcell(p) - errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c) - t_veg(p) = forc_t(g) - eflx_lwrad_net(p) = eflx_lwrad_out(p) - forc_lwrad(g) - qflx_prec_grnd(p) = forc_rain(g) + forc_snow(g) - end do - - end subroutine BiogeophysicsLake - -end module BiogeophysicsLakeMod diff --git a/src_clm40/biogeophys/CanopyFluxesMod.F90 b/src_clm40/biogeophys/CanopyFluxesMod.F90 deleted file mode 100644 index 4ddf095a0c..0000000000 --- a/src_clm40/biogeophys/CanopyFluxesMod.F90 +++ /dev/null @@ -1,1434 +0,0 @@ -module CanopyFluxesMod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: CanopyFluxesMod -! -! !DESCRIPTION: -! Calculates the leaf temperature and the leaf fluxes, -! transpiration, photosynthesis and updates the dew -! accumulation due to evaporation. -! -! !USES: - use abortutils, only: endrun - use clm_varctl, only: iulog, use_c13, use_cn, use_cndv - use shr_sys_mod, only: shr_sys_flush -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: CanopyFluxes !Calculates the leaf temperature and leaf fluxes -! -! !PRIVATE MEMBER FUNCTIONS: - private :: Stomata !Leaf stomatal resistance and leaf photosynthesis -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 4/25/05, Peter Thornton: replaced old Stomata subroutine with what -! used to be called StomataCN, as part of migration to new sun/shade -! algorithms. -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: CanopyFluxes -! -! !INTERFACE: - subroutine CanopyFluxes(lbg, ubg, lbc, ubc, lbp, ubp, & - num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! 1. Calculates the leaf temperature: -! 2. Calculates the leaf fluxes, transpiration, photosynthesis and -! updates the dew accumulation due to evaporation. -! -! Method: -! Use the Newton-Raphson iteration to solve for the foliage -! temperature that balances the surface energy budget: -! -! f(t_veg) = Net radiation - Sensible - Latent = 0 -! f(t_veg) + d(f)/d(t_veg) * dt_veg = 0 (*) -! -! Note: -! (1) In solving for t_veg, t_grnd is given from the previous timestep. -! (2) The partial derivatives of aerodynamical resistances, which cannot -! be determined analytically, are ignored for d(H)/dT and d(LE)/dT -! (3) The weighted stomatal resistance of sunlit and shaded foliage is used -! (4) Canopy air temperature and humidity are derived from => Hc + Hg = Ha -! => Ec + Eg = Ea -! (5) Energy loss is due to: numerical truncation of energy budget equation -! (*); and "ecidif" (see the code) which is dropped into the sensible -! heat -! (6) The convergence criteria: the difference, del = t_veg(n+1)-t_veg(n) -! and del2 = t_veg(n)-t_veg(n-1) less than 0.01 K, and the difference -! of water flux from the leaf between the iteration step (n+1) and (n) -! less than 0.1 W/m2; or the iterative steps over 40. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_time_manager , only : get_step_size, get_prev_date - use clm_varpar , only : nlevgrnd, nlevsno - use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice, & - denh2o, tfrz, csoilc, tlsai_crit, alpha_aero, & - isecspday, degpsec - use shr_const_mod , only : SHR_CONST_TKFRZ - use pftvarcon , only : nirrig - use QSatMod , only : QSat - use FrictionVelocityMod, only : FrictionVelocity, MoninObukIni - use spmdMod , only : masterproc -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbg, ubg ! gridcell bounds - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_nolakep ! number of column non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine Biogeophysics1 in module Biogeophysics1Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 12/19/01, Peter Thornton -! Changed tg to t_grnd for consistency with other routines -! 1/29/02, Peter Thornton -! Migrate to new data structures, new calling protocol. For now co2 and -! o2 partial pressures are hardwired, but they should be coming in from -! forc_pco2 and forc_po2. Keeping the same hardwired values as in CLM2 to -! assure bit-for-bit results in the first comparisons. -! 27 February 2008: Keith Oleson; Sparse/dense aerodynamic parameters from -! X. Zeng -! 6 March 2009: Peter Thornton; Daylength control on Vcmax, from Bill Bauerle -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in variables -! - integer , pointer :: frac_veg_nosno(:) ! frac of veg not covered by snow (0 OR 1 now) [-] - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: forc_th(:) ! atmospheric potential temperature (Kelvin) - real(r8), pointer :: t_grnd(:) ! ground surface temperature [K] - real(r8), pointer :: thm(:) ! intermediate variable (forc_t+0.0098*forc_hgt_t_pft) - real(r8), pointer :: qg(:) ! specific humidity at ground surface [kg/kg] - real(r8), pointer :: thv(:) ! virtual potential temperature (kelvin) - real(r8), pointer :: z0mv(:) ! roughness length over vegetation, momentum [m] - real(r8), pointer :: z0hv(:) ! roughness length over vegetation, sensible heat [m] - real(r8), pointer :: z0qv(:) ! roughness length over vegetation, latent heat [m] - real(r8), pointer :: z0mg(:) ! roughness length of ground, momentum [m] - real(r8), pointer :: dqgdT(:) ! temperature derivative of "qg" - real(r8), pointer :: htvp(:) ! latent heat of evaporation (/sublimation) [J/kg] - real(r8), pointer :: emv(:) ! ground emissivity - real(r8), pointer :: emg(:) ! vegetation emissivity - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: forc_pco2(:) ! partial pressure co2 (Pa) - - ! 4/14/05: PET - ! Adding isotope code - real(r8), pointer :: forc_pc13o2(:) ! partial pressure c13o2 (Pa) - - real(r8), pointer :: forc_po2(:) ! partial pressure o2 (Pa) - real(r8), pointer :: forc_q(:) ! atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_u(:) ! atmospheric wind speed in east direction (m/s) - real(r8), pointer :: forc_v(:) ! atmospheric wind speed in north direction (m/s) - real(r8), pointer :: forc_hgt_u_pft(:) !observational height of wind at pft level [m] - real(r8), pointer :: forc_rho(:) ! density (kg/m**3) - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - real(r8), pointer :: displa(:) ! displacement height (m) - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: fdry(:) ! fraction of foliage that is green and dry [-] - real(r8), pointer :: fwet(:) ! fraction of canopy that is wet (0 to 1) - real(r8), pointer :: laisun(:) ! sunlit leaf area - real(r8), pointer :: laisha(:) ! shaded leaf area - real(r8), pointer :: sabv(:) ! solar radiation absorbed by vegetation (W/m**2) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: watdry(:,:) ! btran parameter for btran=0 - real(r8), pointer :: watopt(:,:) ! btran parameter for btran = 1 - real(r8), pointer :: h2osoi_ice(:,:)! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:)! liquid water (kg/m2) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" - real(r8), pointer :: rootfr(:,:) ! fraction of roots in each soil layer - real(r8), pointer :: dleaf(:) ! characteristic leaf dimension (m) - real(r8), pointer :: smpso(:) ! soil water potential at full stomatal opening (mm) - real(r8), pointer :: smpsc(:) ! soil water potential at full stomatal closure (mm) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: htop(:) ! canopy top(m) - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: soilbeta(:) ! soil wetness relative to field capacity - real(r8), pointer :: lat(:) ! latitude (radians) - real(r8), pointer :: decl(:) ! declination angle (radians) - real(r8), pointer :: max_dayl(:) !maximum daylength for this column (s) - real(r8), pointer :: londeg(:) ! longitude (degrees) (for calculation of local time) - -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: cgrnds(:) ! deriv. of soil sensible heat flux wrt soil temp [w/m2/k] - real(r8), pointer :: cgrndl(:) ! deriv. of soil latent heat flux wrt soil temp [w/m**2/k] - real(r8), pointer :: t_veg(:) ! vegetation temperature (Kelvin) - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: q_ref2m(:) ! 2 m height surface specific humidity (kg/kg) - real(r8), pointer :: t_ref2m_r(:) ! Rural 2 m height surface air temperature (Kelvin) - real(r8), pointer :: rh_ref2m(:) ! 2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m_r(:) ! Rural 2 m height surface relative humidity (%) - real(r8), pointer :: h2ocan(:) ! canopy water (mm H2O) - real(r8), pointer :: cisun(:) !sunlit intracellular CO2 (Pa) - real(r8), pointer :: cisha(:) !shaded intracellular CO2 (Pa) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: rb1(:) ! boundary layer resistance (s/m) - real(r8), pointer :: cgrnd(:) ! deriv. of soil energy flux wrt to soil temp [w/m2/k] - real(r8), pointer :: dlrad(:) ! downward longwave radiation below the canopy [W/m2] - real(r8), pointer :: ulrad(:) ! upward longwave radiation above the canopy [W/m2] - real(r8), pointer :: ram1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: btran(:) ! transpiration wetness factor (0 to 1) - real(r8), pointer :: rssun(:) ! sunlit stomatal resistance (s/m) - real(r8), pointer :: rssha(:) ! shaded stomatal resistance (s/m) - real(r8), pointer :: psnsun(:) ! sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) ! shaded leaf photosynthesis (umol CO2 /m**2/ s) - - ! 4/14/05: PET - ! Adding isotope code - real(r8), pointer :: c13_psnsun(:) ! sunlit leaf photosynthesis (umol 13CO2 /m**2/ s) - real(r8), pointer :: c13_psnsha(:) ! shaded leaf photosynthesis (umol 13CO2 /m**2/ s) - ! 4/21/05: PET - ! Adding isotope code - real(r8), pointer :: rc13_canair(:) !C13O2/C12O2 in canopy air - real(r8), pointer :: rc13_psnsun(:) !C13O2/C12O2 in sunlit canopy psn flux - real(r8), pointer :: rc13_psnsha(:) !C13O2/C12O2 in shaded canopy psn flux - real(r8), pointer :: alphapsnsun(:) !fractionation factor in sunlit canopy psn flux - real(r8), pointer :: alphapsnsha(:) !fractionation factor in shaded canopy psn flux - - real(r8), pointer :: qflx_tran_veg(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: dt_veg(:) ! change in t_veg, last iteration (Kelvin) - real(r8), pointer :: qflx_evap_veg(:) ! vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: eflx_sh_veg(:) ! sensible heat flux from leaves (W/m**2) [+ to atm] - real(r8), pointer :: taux(:) ! wind (shear) stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy(:) ! wind (shear) stress: n-s (kg/m/s**2) - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: fpsn(:) ! photosynthesis (umol CO2 /m**2 /s) - real(r8), pointer :: rootr(:,:) ! effective fraction of roots in each soil layer - real(r8), pointer :: rresis(:,:) ! root resistance by layer (0-1) (nlevgrnd) - real(r8), pointer :: irrig_rate(:) ! current irrigation rate [mm/s] - integer, pointer :: n_irrig_steps_left(:) ! # of time steps for which we still need to irrigate today -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - real(r8), parameter :: btran0 = 0.0_r8 ! initial value - real(r8), parameter :: zii = 1000.0_r8 ! convective boundary layer height [m] - real(r8), parameter :: beta = 1.0_r8 ! coefficient of conective velocity [-] - real(r8), parameter :: delmax = 1.0_r8 ! maxchange in leaf temperature [K] - real(r8), parameter :: dlemin = 0.1_r8 ! max limit for energy flux convergence [w/m2] - real(r8), parameter :: dtmin = 0.01_r8 ! max limit for temperature convergence [K] - integer , parameter :: itmax = 40 ! maximum number of iteration [-] - integer , parameter :: itmin = 2 ! minimum number of iteration [-] - real(r8), parameter :: irrig_min_lai = 0.0_r8 ! Minimum LAI for irrigation - real(r8), parameter :: irrig_btran_thresh = 0.999999_r8 ! Irrigate when btran falls below 0.999999 rather than 1 to allow for round-off error - integer , parameter :: irrig_start_time = isecspday/4 ! Time of day to check whether we need irrigation, seconds (0 = midnight). - ! We start applying the irrigation in the time step FOLLOWING this time, - ! since we won't begin irrigating until the next call to Hydrology1 - integer , parameter :: irrig_length = isecspday/6 ! Desired amount of time to irrigate per day (sec). Actual time may - ! differ if this is not a multiple of dtime. Irrigation won't work properly - ! if dtime > secsperday - real(r8), parameter :: irrig_factor = 0.7_r8 ! Determines target soil moisture level for irrigation. If h2osoi_liq_so - ! is the soil moisture level at which stomata are fully open and - ! h2osoi_liq_sat is the soil moisture level at saturation (eff_porosity), - ! then the target soil moisture level is - ! (h2osoi_liq_so + irrig_factor*(h2osoi_liq_sat - h2osoi_liq_so)). - ! A value of 0 means that the target soil moisture level is h2osoi_liq_so. - ! A value of 1 means that the target soil moisture level is h2osoi_liq_sat - - !added by K.Sakaguchi for litter resistance - real(r8), parameter :: lai_dl = 0.5_r8 ! placeholder for (dry) plant litter area index (m2/m2) - real(r8), parameter :: z_dl = 0.05_r8 ! placeholder for (dry) litter layer thickness (m) - !added by K.Sakaguchi for stability formulation - real(r8), parameter :: ria = 0.5_r8 ! free parameter for stable formulation (currently = 0.5, "gamma" in Sakaguchi&Zeng,2008) - real(r8) :: dtime ! land model time step (sec) - real(r8) :: zldis(lbp:ubp) ! reference height "minus" zero displacement height [m] - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: dth(lbp:ubp) ! diff of virtual temp. between ref. height and surface - real(r8) :: dthv(lbp:ubp) ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: dqh(lbp:ubp) ! diff of humidity between ref. height and surface - real(r8) :: obu(lbp:ubp) ! Monin-Obukhov length (m) - real(r8) :: um(lbp:ubp) ! wind speed including the stablity effect [m/s] - real(r8) :: ur(lbp:ubp) ! wind speed at reference height [m/s] - real(r8) :: uaf(lbp:ubp) ! velocity of air within foliage [m/s] - real(r8) :: temp1(lbp:ubp) ! relation for potential temperature profile - real(r8) :: temp12m(lbp:ubp) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(lbp:ubp) ! relation for specific humidity profile - real(r8) :: temp22m(lbp:ubp) ! relation for specific humidity profile applied at 2-m - real(r8) :: ustar(lbp:ubp) ! friction velocity [m/s] - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: taf(lbp:ubp) ! air temperature within canopy space [K] - real(r8) :: qaf(lbp:ubp) ! humidity of canopy air [kg/kg] - real(r8) :: rpp ! fraction of potential evaporation from leaf [-] - real(r8) :: rppdry ! fraction of potential evaporation through transp [-] - real(r8) :: cf ! heat transfer coefficient from leaves [-] - real(r8) :: rb(lbp:ubp) ! leaf boundary layer resistance [s/m] - real(r8) :: rah(lbp:ubp,2) ! thermal resistance [s/m] - real(r8) :: raw(lbp:ubp,2) ! moisture resistance [s/m] - real(r8) :: wta ! heat conductance for air [m/s] - real(r8) :: wtg(lbp:ubp) ! heat conductance for ground [m/s] - real(r8) :: wtl ! heat conductance for leaf [m/s] - real(r8) :: wta0(lbp:ubp) ! normalized heat conductance for air [-] - real(r8) :: wtl0(lbp:ubp) ! normalized heat conductance for leaf [-] - real(r8) :: wtg0 ! normalized heat conductance for ground [-] - real(r8) :: wtal(lbp:ubp) ! normalized heat conductance for air and leaf [-] - real(r8) :: wtga ! normalized heat cond. for air and ground [-] - real(r8) :: wtaq ! latent heat conductance for air [m/s] - real(r8) :: wtlq ! latent heat conductance for leaf [m/s] - real(r8) :: wtgq(lbp:ubp) ! latent heat conductance for ground [m/s] - real(r8) :: wtaq0(lbp:ubp) ! normalized latent heat conductance for air [-] - real(r8) :: wtlq0(lbp:ubp) ! normalized latent heat conductance for leaf [-] - real(r8) :: wtgq0 ! normalized heat conductance for ground [-] - real(r8) :: wtalq(lbp:ubp) ! normalized latent heat cond. for air and leaf [-] - real(r8) :: wtgaq ! normalized latent heat cond. for air and ground [-] - real(r8) :: el(lbp:ubp) ! vapor pressure on leaf surface [pa] - real(r8) :: deldT ! derivative of "el" on "t_veg" [pa/K] - real(r8) :: qsatl(lbp:ubp) ! leaf specific humidity [kg/kg] - real(r8) :: qsatldT(lbp:ubp) ! derivative of "qsatl" on "t_veg" - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - real(r8) :: air(lbp:ubp),bir(lbp:ubp),cir(lbp:ubp) ! atmos. radiation temporay set - real(r8) :: dc1,dc2 ! derivative of energy flux [W/m2/K] - real(r8) :: delt ! temporary - real(r8) :: delq(lbp:ubp) ! temporary - real(r8) :: del(lbp:ubp) ! absolute change in leaf temp in current iteration [K] - real(r8) :: del2(lbp:ubp) ! change in leaf temperature in previous iteration [K] - real(r8) :: dele(lbp:ubp) ! change in latent heat flux from leaf [K] - real(r8) :: dels ! change in leaf temperature in current iteration [K] - real(r8) :: det(lbp:ubp) ! maximum leaf temp. change in two consecutive iter [K] - real(r8) :: efeb(lbp:ubp) ! latent heat flux from leaf (previous iter) [mm/s] - real(r8) :: efeold ! latent heat flux from leaf (previous iter) [mm/s] - real(r8) :: efpot ! potential latent energy flux [kg/m2/s] - real(r8) :: efe(lbp:ubp) ! water flux from leaf [mm/s] - real(r8) :: efsh ! sensible heat from leaf [mm/s] - real(r8) :: obuold(lbp:ubp) ! monin-obukhov length from previous iteration - real(r8) :: tlbef(lbp:ubp) ! leaf temperature from previous iteration [K] - real(r8) :: ecidif ! excess energies [W/m2] - real(r8) :: err(lbp:ubp) ! balance error - real(r8) :: erre ! balance error - real(r8) :: co2(lbp:ubp) ! atmospheric co2 partial pressure (pa) - - ! 4/14/05: PET - ! Adding isotope code - real(r8) :: c13o2(lbp:ubp) ! atmospheric c13o2 partial pressure (pa) - - real(r8) :: o2(lbp:ubp) ! atmospheric o2 partial pressure (pa) - real(r8) :: svpts(lbp:ubp) ! saturation vapor pressure at t_veg (pa) - real(r8) :: eah(lbp:ubp) ! canopy air vapor pressure (pa) - real(r8) :: s_node ! vol_liq/eff_porosity - real(r8) :: smp_node ! matrix potential - real(r8) :: vol_ice ! partial volume of ice lens in layer - real(r8) :: eff_porosity ! effective porosity in layer - real(r8) :: vol_liq ! partial volume of liquid water in layer - integer :: itlef ! counter for leaf temperature iteration [-] - integer :: nmozsgn(lbp:ubp) ! number of times stability changes sign - real(r8) :: w ! exp(-LSAI) - real(r8) :: csoilcn ! interpolated csoilc for less than dense canopies - real(r8) :: fm(lbp:ubp) ! needed for BGC only to diagnose 10m wind speed - real(r8) :: wtshi ! sensible heat resistance for air, grnd and leaf [-] - real(r8) :: wtsqi ! latent heat resistance for air, grnd and leaf [-] - integer :: j ! soil/snow level index - integer :: p ! pft index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! gridcell index - integer :: fp ! lake filter pft index - integer :: fn ! number of values in pft filter - integer :: fnorig ! number of values in pft filter copy - integer :: fnold ! temporary copy of pft count - integer :: f ! filter index - integer :: filterp(ubp-lbp+1) ! temporary filter - integer :: fporig(ubp-lbp+1) ! temporary filter - real(r8) :: displa_loc(lbp:ubp) ! temporary copy - real(r8) :: z0mv_loc(lbp:ubp) ! temporary copy - real(r8) :: z0hv_loc(lbp:ubp) ! temporary copy - real(r8) :: z0qv_loc(lbp:ubp) ! temporary copy - logical :: found ! error flag for canopy above forcing hgt - integer :: index ! pft index for error - real(r8) :: egvf ! effective green vegetation fraction - real(r8) :: lt ! elai+esai - real(r8) :: ri ! stability parameter for under canopy air (unitless) - real(r8) :: csoilb ! turbulent transfer coefficient over bare soil (unitless) - real(r8) :: ricsoilc ! modified transfer coefficient under dense canopy (unitless) - real(r8) :: snowdp_c ! critical snow depth to cover plant litter (m) - real(r8) :: rdl ! dry litter layer resistance for water vapor (s/m) - real(r8) :: elai_dl ! exposed (dry) plant litter area index - real(r8) :: fsno_dl ! effective snow cover over plant litter - real(r8) :: dayl ! daylength (s) - real(r8) :: temp ! temporary, for daylength calculation - real(r8) :: dayl_factor(lbp:ubp) ! scalar (0-1) for daylength effect on Vcmax - integer :: yr ! year at start of time step - integer :: mon ! month at start of time step - integer :: day ! day at start of time step - integer :: time ! time at start of time step (seconds after 0Z) - integer :: local_time ! local time at start of time step (seconds after solar midnight) - integer :: irrig_nsteps_per_day ! number of time steps per day in which we irrigate - logical :: check_for_irrig(lbp:ubp) ! where do we need to check soil moisture to see if we need to irrigate? - logical :: frozen_soil(lbc:ubc) ! set to true if we have encountered a frozen soil layer - real(r8) :: vol_liq_so ! partial volume of liquid water in layer for which smp_node = smpso - real(r8) :: h2osoi_liq_so ! liquid water corresponding to vol_liq_so for this layer [kg/m2] - real(r8) :: h2osoi_liq_sat ! liquid water corresponding to eff_porosity for this layer [kg/m2] - real(r8) :: deficit ! difference between desired soil moisture level for this layer and current soil moisture level [kg/m2] -!------------------------------------------------------------------------------ - - ! Assign local pointers to derived type members (gridcell-level) - - forc_lwrad => clm_a2l%forc_lwrad - forc_pco2 => clm_a2l%forc_pco2 - - forc_pc13o2 => clm_a2l%forc_pc13o2 - - forc_po2 => clm_a2l%forc_po2 - forc_q => clm_a2l%forc_q - forc_pbot => clm_a2l%forc_pbot - forc_u => clm_a2l%forc_u - forc_v => clm_a2l%forc_v - forc_th => clm_a2l%forc_th - forc_rho => clm_a2l%forc_rho - lat => grc%lat - londeg => grc%londeg - - ! Assign local pointers to derived type members (column-level) - - t_soisno => ces%t_soisno - watsat => cps%watsat - watdry => cps%watdry - watopt => cps%watopt - h2osoi_ice => cws%h2osoi_ice - dz => cps%dz - h2osoi_liq => cws%h2osoi_liq - sucsat => cps%sucsat - bsw => cps%bsw - emg => cps%emg - t_grnd => ces%t_grnd - qg => cws%qg - thv => ces%thv - dqgdT => cws%dqgdT - htvp => cps%htvp - z0mg => cps%z0mg - frac_sno => cps%frac_sno - snowdp => cps%snowdp - soilbeta => cws%soilbeta - decl => cps%decl - max_dayl => cps%max_dayl - - ! Assign local pointers to derived type members (pft-level) - - rb1 => pps%rb1 - ivt => pft%itype - pcolumn => pft%column - plandunit => pft%landunit - pgridcell => pft%gridcell - frac_veg_nosno => pps%frac_veg_nosno - btran => pps%btran - rootfr => pps%rootfr - rootr => pps%rootr - rresis => pps%rresis - emv => pps%emv - t_veg => pes%t_veg - displa => pps%displa - z0mv => pps%z0mv - z0hv => pps%z0hv - z0qv => pps%z0qv - ram1 => pps%ram1 - htop => pps%htop - rssun => pps%rssun - rssha => pps%rssha - cisun => pps%cisun - cisha => pps%cisha - psnsun => pcf%psnsun - psnsha => pcf%psnsha - - ! 4/14/05: PET - ! Adding isotope code - c13_psnsun => pc13f%psnsun - c13_psnsha => pc13f%psnsha - ! 4/21/05: PET - ! Adding isotope code - rc13_canair => pepv%rc13_canair - rc13_psnsun => pepv%rc13_psnsun - rc13_psnsha => pepv%rc13_psnsha - alphapsnsun => pps%alphapsnsun - alphapsnsha => pps%alphapsnsha - - elai => pps%elai - esai => pps%esai - fdry => pps%fdry - laisun => pps%laisun - laisha => pps%laisha - qflx_tran_veg => pwf%qflx_tran_veg - fwet => pps%fwet - h2ocan => pws%h2ocan - dt_veg => pps%dt_veg - sabv => pef%sabv - qflx_evap_veg => pwf%qflx_evap_veg - eflx_sh_veg => pef%eflx_sh_veg - taux => pmf%taux - tauy => pmf%tauy - eflx_sh_grnd => pef%eflx_sh_grnd - qflx_evap_soi => pwf%qflx_evap_soi - t_ref2m => pes%t_ref2m - q_ref2m => pes%q_ref2m - t_ref2m_r => pes%t_ref2m_r - rh_ref2m_r => pes%rh_ref2m_r - rh_ref2m => pes%rh_ref2m - dlrad => pef%dlrad - ulrad => pef%ulrad - cgrnds => pef%cgrnds - cgrndl => pef%cgrndl - cgrnd => pef%cgrnd - fpsn => pcf%fpsn - forc_hgt_u_pft => pps%forc_hgt_u_pft - thm => pes%thm - irrig_rate => cps%irrig_rate - n_irrig_steps_left => cps%n_irrig_steps_left - - ! Assign local pointers to derived type members (ecophysiological) - - dleaf => pftcon%dleaf - smpso => pftcon%smpso - smpsc => pftcon%smpsc - - ! Determine step size - - dtime = get_step_size() - irrig_nsteps_per_day = ((irrig_length + (dtime - 1))/dtime) ! round up - - ! Filter pfts where frac_veg_nosno is non-zero - - fn = 0 - do fp = 1,num_nolakep - p = filter_nolakep(fp) - if (frac_veg_nosno(p) /= 0) then - fn = fn + 1 - filterp(fn) = p - end if - end do - - ! Initialize - - do f = 1, fn - p = filterp(f) - del(p) = 0._r8 ! change in leaf temperature from previous iteration - efeb(p) = 0._r8 ! latent head flux from leaf for previous iteration - wtlq0(p) = 0._r8 - wtalq(p) = 0._r8 - wtgq(p) = 0._r8 - wtaq0(p) = 0._r8 - obuold(p) = 0._r8 - btran(p) = btran0 - end do - - ! calculate daylength control for Vcmax - do f = 1, fn - p=filterp(f) - c=pcolumn(p) - g=pgridcell(p) - ! calculate daylength - temp = -(sin(lat(g))*sin(decl(c)))/(cos(lat(g)) * cos(decl(c))) - temp = min(1._r8,max(-1._r8,temp)) - dayl = 2.0_r8 * 13750.9871_r8 * acos(temp) - ! calculate dayl_factor as the ratio of (current:max dayl)^2 - ! set a minimum of 0.01 (1%) for the dayl_factor - dayl_factor(p)=min(1._r8,max(0.01_r8,(dayl*dayl)/(max_dayl(c)*max_dayl(c)))) - end do - - rb1(lbp:ubp) = 0._r8 - - ! Effective porosity of soil, partial volume of ice and liquid (needed for btran) - ! and root resistance factors - - do j = 1,nlevgrnd - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - l = plandunit(p) - - ! Root resistance factors - - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity = watsat(c,j)-vol_ice - vol_liq = min(eff_porosity, h2osoi_liq(c,j)/(dz(c,j)*denh2o)) - if (vol_liq .le. 0._r8 .or. t_soisno(c,j) .le. tfrz-2._r8) then - rootr(p,j) = 0._r8 - else - s_node = max(vol_liq/eff_porosity,0.01_r8) - smp_node = max(smpsc(ivt(p)), -sucsat(c,j)*s_node**(-bsw(c,j))) - - rresis(p,j) = min( (eff_porosity/watsat(c,j))* & - (smp_node - smpsc(ivt(p))) / (smpso(ivt(p)) - smpsc(ivt(p))), 1._r8) - rootr(p,j) = rootfr(p,j)*rresis(p,j) - btran(p) = btran(p) + rootr(p,j) - endif - end do - end do - - ! Normalize root resistances to get layer contribution to ET - - do j = 1,nlevgrnd - do f = 1, fn - p = filterp(f) - if (btran(p) .gt. btran0) then - rootr(p,j) = rootr(p,j)/btran(p) - else - rootr(p,j) = 0._r8 - end if - end do - end do - - ! Determine if irrigation is needed (over irrigated soil columns) - - ! First, determine in what grid cells we need to bother 'measuring' soil water, to see if we need irrigation - ! Also set n_irrig_steps_left for these grid cells - ! n_irrig_steps_left(p) > 0 is ok even if irrig_rate(p) ends up = 0 - ! in this case, we'll irrigate by 0 for the given number of time steps - call get_prev_date(yr, mon, day, time) ! get time as of beginning of time step - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - if (ivt(p) == nirrig .and. elai(p) > irrig_min_lai .and. btran(p) < irrig_btran_thresh) then - ! see if it's the right time of day to start irrigating: - local_time = modulo(time + nint(londeg(g)/degpsec), isecspday) - if (modulo(local_time - irrig_start_time, isecspday) < dtime) then - ! it's time to start irrigating - check_for_irrig(p) = .true. - n_irrig_steps_left(c) = irrig_nsteps_per_day - irrig_rate(c) = 0._r8 ! reset; we'll add to this later - else - check_for_irrig(p) = .false. - end if - else ! non-irrig pft or elai<=irrig_min_lai or btran>irrig_btran_thresh - check_for_irrig(p) = .false. - end if - - end do - - - ! Now 'measure' soil water for the grid cells identified above and see if the soil is dry enough to warrant irrigation - frozen_soil(:) = .false. - do j = 1,nlevgrnd - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - if (check_for_irrig(p) .and. .not. frozen_soil(c)) then - ! if level L was frozen, then we don't look at any levels below L - if (t_soisno(c,j) <= SHR_CONST_TKFRZ) then - frozen_soil(c) = .true. - else if (rootfr(p,j) > 0._r8) then - ! determine soil water deficit in this layer: - - ! Calculate vol_liq_so - i.e., vol_liq at which smp_node = smpso - by inverting the above equations - ! for the root resistance factors - vol_ice = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) ! this duplicates the above equation for vol_ice - eff_porosity = watsat(c,j)-vol_ice ! this duplicates the above equation for eff_porosity - vol_liq_so = eff_porosity * (-smpso(ivt(p))/sucsat(c,j))**(-1/bsw(c,j)) - - ! Translate vol_liq_so and eff_porosity into h2osoi_liq_so and h2osoi_liq_sat and calculate deficit - h2osoi_liq_so = vol_liq_so * denh2o * dz(c,j) - h2osoi_liq_sat = eff_porosity * denh2o * dz(c,j) - deficit = max((h2osoi_liq_so + irrig_factor*(h2osoi_liq_sat - h2osoi_liq_so)) - h2osoi_liq(c,j), 0._r8) - - ! Add deficit to irrig_rate, converting units from mm to mm/sec - irrig_rate(c) = irrig_rate(c) + deficit/(dtime*irrig_nsteps_per_day) - - end if ! else if (rootfr(p,j) .gt. 0) - end if ! if (check_for_irrig(p) .and. .not. frozen_soil(c)) - end do ! do f - end do ! do j - - ! Modify aerodynamic parameters for sparse/dense canopy (X. Zeng) - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - - lt = min(elai(p)+esai(p), tlsai_crit) - egvf =(1._r8 - alpha_aero * exp(-lt)) / (1._r8 - alpha_aero * exp(-tlsai_crit)) - displa(p) = egvf * displa(p) - z0mv(p) = exp(egvf * log(z0mv(p)) + (1._r8 - egvf) * log(z0mg(c))) - z0hv(p) = z0mv(p) - z0qv(p) = z0mv(p) - - end do - - found = .false. - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - ! Net absorbed longwave radiation by canopy and ground - ! =air+bir*t_veg**4+cir*t_grnd(c)**4 - - air(p) = emv(p) * (1._r8+(1._r8-emv(p))*(1._r8-emg(c))) * forc_lwrad(g) - bir(p) = - (2._r8-emv(p)*(1._r8-emg(c))) * emv(p) * sb - cir(p) = emv(p)*emg(c)*sb - - ! Saturated vapor pressure, specific humidity, and their derivatives - ! at the leaf surface - - call QSat (t_veg(p), forc_pbot(g), el(p), deldT, qsatl(p), qsatldT(p)) - - ! Determine atmospheric co2 and o2 - - co2(p) = forc_pco2(g) - o2(p) = forc_po2(g) - - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - c13o2(p) = forc_pc13o2(g) - end if - - ! Initialize flux profile - - nmozsgn(p) = 0 - - taf(p) = (t_grnd(c) + thm(p))/2._r8 - qaf(p) = (forc_q(g)+qg(c))/2._r8 - - ur(p) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - dth(p) = thm(p)-taf(p) - dqh(p) = forc_q(g)-qaf(p) - delq(p) = qg(c) - qaf(p) - dthv(p) = dth(p)*(1._r8+0.61_r8*forc_q(g))+0.61_r8*forc_th(g)*dqh(p) - zldis(p) = forc_hgt_u_pft(p) - displa(p) - - ! Check to see if the forcing height is below the canopy height - if (zldis(p) < 0._r8) then - found = .true. - index = p - end if - - end do - - if (found) then - write(iulog,*)'Error: Forcing height is below canopy height for pft index ',index - call endrun() - end if - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - - ! Initialize Monin-Obukhov length and wind speed - - call MoninObukIni(ur(p), thv(c), dthv(p), zldis(p), z0mv(p), um(p), obu(p)) - - end do - - ! Set counter for leaf temperature iteration (itlef) - - itlef = 0 - fnorig = fn - fporig(1:fn) = filterp(1:fn) - - ! Make copies so that array sections are not passed in function calls to friction velocity - - do f = 1, fn - p = filterp(f) - displa_loc(p) = displa(p) - z0mv_loc(p) = z0mv(p) - z0hv_loc(p) = z0hv(p) - z0qv_loc(p) = z0qv(p) - end do - - ! Begin stability iteration - - ITERATION : do while (itlef <= itmax .and. fn > 0) - - ! Determine friction velocity, and potential temperature and humidity - ! profiles of the surface boundary layer - - call FrictionVelocity (lbp, ubp, fn, filterp, & - displa_loc, z0mv_loc, z0hv_loc, z0qv_loc, & - obu, itlef+1, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm) - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - tlbef(p) = t_veg(p) - del2(p) = del(p) - - ! Determine aerodynamic resistances - - ram1(p) = 1._r8/(ustar(p)*ustar(p)/um(p)) - rah(p,1) = 1._r8/(temp1(p)*ustar(p)) - raw(p,1) = 1._r8/(temp2(p)*ustar(p)) - - ! Bulk boundary layer resistance of leaves - - uaf(p) = um(p)*sqrt( 1._r8/(ram1(p)*um(p)) ) - cf = 0.01_r8/(sqrt(uaf(p))*sqrt(dleaf(ivt(p)))) - rb(p) = 1._r8/(cf*uaf(p)) - rb1(p) = rb(p) - - ! Parameterization for variation of csoilc with canopy density from - ! X. Zeng, University of Arizona - - w = exp(-(elai(p)+esai(p))) - - ! changed by K.Sakaguchi from here - ! transfer coefficient over bare soil is changed to a local variable - ! just for readability of the code (from line 680) - csoilb = (vkc/(0.13_r8*(z0mg(c)*uaf(p)/1.5e-5_r8)**0.45_r8)) - - !compute the stability parameter for ricsoilc ("S" in Sakaguchi&Zeng,2008) - - ri = ( grav*htop(p) * (taf(p) - t_grnd(c)) ) / (taf(p) * uaf(p) **2.00_r8) - - !! modify csoilc value (0.004) if the under-canopy is in stable condition - - if ( (taf(p) - t_grnd(c) ) > 0._r8) then - ! decrease the value of csoilc by dividing it with (1+gamma*min(S, 10.0)) - ! ria ("gmanna" in Sakaguchi&Zeng, 2008) is a constant (=0.5) - ricsoilc = csoilc / (1.00_r8 + ria*min( ri, 10.0_r8) ) - csoilcn = csoilb*w + ricsoilc*(1._r8-w) - else - csoilcn = csoilb*w + csoilc*(1._r8-w) - end if - - !! Sakaguchi changes for stability formulation ends here - - rah(p,2) = 1._r8/(csoilcn*uaf(p)) - raw(p,2) = rah(p,2) - - ! Stomatal resistances for sunlit and shaded fractions of canopy. - ! Done each iteration to account for differences in eah, tv. - - svpts(p) = el(p) ! pa - eah(p) = forc_pbot(g) * qaf(p) / 0.622_r8 ! pa - end do - - ! 4/25/05, PET: Now calling the sun/shade version of Stomata by default - call Stomata (fn, filterp, lbp, ubp, svpts, eah, o2, co2, rb, dayl_factor, phase='sun') - call Stomata (fn, filterp, lbp, ubp, svpts, eah, o2, co2, rb, dayl_factor, phase='sha') - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - ! Sensible heat conductance for air, leaf and ground - ! Moved the original subroutine in-line... - - wta = 1._r8/rah(p,1) ! air - wtl = (elai(p)+esai(p))/rb(p) ! leaf - wtg(p) = 1._r8/rah(p,2) ! ground - wtshi = 1._r8/(wta+wtl+wtg(p)) - - wtl0(p) = wtl*wtshi ! leaf - wtg0 = wtg(p)*wtshi ! ground - wta0(p) = wta*wtshi ! air - - wtga = wta0(p)+wtg0 ! ground + air - wtal(p) = wta0(p)+wtl0(p) ! air + leaf - - ! Fraction of potential evaporation from leaf - - if (fdry(p) .gt. 0._r8) then - rppdry = fdry(p)*rb(p)*(laisun(p)/(rb(p)+rssun(p)) + & - laisha(p)/(rb(p)+rssha(p)))/elai(p) - else - rppdry = 0._r8 - end if - efpot = forc_rho(g)*wtl*(qsatl(p)-qaf(p)) - - if (efpot > 0._r8) then - if (btran(p) > btran0) then - qflx_tran_veg(p) = efpot*rppdry - rpp = rppdry + fwet(p) - else - !No transpiration if btran below 1.e-10 - rpp = fwet(p) - qflx_tran_veg(p) = 0._r8 - end if - !Check total evapotranspiration from leaves - rpp = min(rpp, (qflx_tran_veg(p)+h2ocan(p)/dtime)/efpot) - else - !No transpiration if potential evaporation less than zero - rpp = 1._r8 - qflx_tran_veg(p) = 0._r8 - end if - - ! Update conductances for changes in rpp - ! Latent heat conductances for ground and leaf. - ! Air has same conductance for both sensible and latent heat. - ! Moved the original subroutine in-line... - - wtaq = frac_veg_nosno(p)/raw(p,1) ! air - wtlq = frac_veg_nosno(p)*(elai(p)+esai(p))/rb(p) * rpp ! leaf - - !Litter layer resistance. Added by K.Sakaguchi - snowdp_c = z_dl ! critical depth for 100% litter burial by snow (=litter thickness) - fsno_dl = snowdp(c)/snowdp_c ! effective snow cover for (dry)plant litter - elai_dl = lai_dl*(1._r8 - min(fsno_dl,1._r8)) ! exposed (dry)litter area index - rdl = ( 1._r8 - exp(-elai_dl) ) / ( 0.004_r8*uaf(p)) ! dry litter layer resistance - - ! add litter resistance and Lee and Pielke 1992 beta - if (delq(p) .lt. 0._r8) then !dew. Do not apply beta for negative flux (follow old rsoil) - wtgq(p) = frac_veg_nosno(p)/(raw(p,2)+rdl) - else - wtgq(p) = soilbeta(c)*frac_veg_nosno(p)/(raw(p,2)+rdl) - end if - - wtsqi = 1._r8/(wtaq+wtlq+wtgq(p)) - - wtgq0 = wtgq(p)*wtsqi ! ground - wtlq0(p) = wtlq*wtsqi ! leaf - wtaq0(p) = wtaq*wtsqi ! air - - wtgaq = wtaq0(p)+wtgq0 ! air + ground - wtalq(p) = wtaq0(p)+wtlq0(p) ! air + leaf - - dc1 = forc_rho(g)*cpair*wtl - dc2 = hvap*forc_rho(g)*wtlq - - efsh = dc1*(wtga*t_veg(p)-wtg0*t_grnd(c)-wta0(p)*thm(p)) - efe(p) = dc2*(wtgaq*qsatl(p)-wtgq0*qg(c)-wtaq0(p)*forc_q(g)) - - ! Evaporation flux from foliage - - erre = 0._r8 - if (efe(p)*efeb(p) < 0._r8) then - efeold = efe(p) - efe(p) = 0.1_r8*efeold - erre = efe(p) - efeold - end if - dt_veg(p) = (sabv(p) + air(p) + bir(p)*t_veg(p)**4 + & - cir(p)*t_grnd(c)**4 - efsh - efe(p)) / & - (- 4._r8*bir(p)*t_veg(p)**3 +dc1*wtga +dc2*wtgaq*qsatldT(p)) - t_veg(p) = tlbef(p) + dt_veg(p) - dels = dt_veg(p) - del(p) = abs(dels) - err(p) = 0._r8 - if (del(p) > delmax) then - dt_veg(p) = delmax*dels/del(p) - t_veg(p) = tlbef(p) + dt_veg(p) - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + cir(p)*t_grnd(c)**4 - & - (efsh + dc1*wtga*dt_veg(p)) - (efe(p) + & - dc2*wtgaq*qsatldT(p)*dt_veg(p)) - end if - - ! Fluxes from leaves to canopy space - ! "efe" was limited as its sign changes frequently. This limit may - ! result in an imbalance in "hvap*qflx_evap_veg" and - ! "efe + dc2*wtgaq*qsatdt_veg" - - efpot = forc_rho(g)*wtl*(wtgaq*(qsatl(p)+qsatldT(p)*dt_veg(p)) & - -wtgq0*qg(c)-wtaq0(p)*forc_q(g)) - qflx_evap_veg(p) = rpp*efpot - - ! Calculation of evaporative potentials (efpot) and - ! interception losses; flux in kg m**-2 s-1. ecidif - ! holds the excess energy if all intercepted water is evaporated - ! during the timestep. This energy is later added to the - ! sensible heat flux. - - ecidif = 0._r8 - if (efpot > 0._r8 .and. btran(p) > btran0) then - qflx_tran_veg(p) = efpot*rppdry - else - qflx_tran_veg(p) = 0._r8 - end if - ecidif = max(0._r8, qflx_evap_veg(p)-qflx_tran_veg(p)-h2ocan(p)/dtime) - qflx_evap_veg(p) = min(qflx_evap_veg(p),qflx_tran_veg(p)+h2ocan(p)/dtime) - - ! The energy loss due to above two limits is added to - ! the sensible heat flux. - - eflx_sh_veg(p) = efsh + dc1*wtga*dt_veg(p) + err(p) + erre + hvap*ecidif - - ! Re-calculate saturated vapor pressure, specific humidity, and their - ! derivatives at the leaf surface - - call QSat(t_veg(p), forc_pbot(g), el(p), deldT, qsatl(p), qsatldT(p)) - - ! Update vegetation/ground surface temperature, canopy air - ! temperature, canopy vapor pressure, aerodynamic temperature, and - ! Monin-Obukhov stability parameter for next iteration. - - taf(p) = wtg0*t_grnd(c) + wta0(p)*thm(p) + wtl0(p)*t_veg(p) - qaf(p) = wtlq0(p)*qsatl(p) + wtgq0*qg(c) + forc_q(g)*wtaq0(p) - - ! Update Monin-Obukhov length and wind speed including the - ! stability effect - - dth(p) = thm(p)-taf(p) - dqh(p) = forc_q(g)-qaf(p) - delq(p) = wtalq(p)*qg(c)-wtlq0(p)*qsatl(p)-wtaq0(p)*forc_q(g) - - tstar = temp1(p)*dth(p) - qstar = temp2(p)*dqh(p) - - thvstar = tstar*(1._r8+0.61_r8*forc_q(g)) + 0.61_r8*forc_th(g)*qstar - zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c)) - - if (zeta >= 0._r8) then !stable - zeta = min(2._r8,max(zeta,0.01_r8)) - um(p) = max(ur(p),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta*(-grav*ustar(p)*thvstar*zii/thv(c))**0.333_r8 - um(p) = sqrt(ur(p)*ur(p)+wc*wc) - end if - obu(p) = zldis(p)/zeta - - if (obuold(p)*obu(p) < 0._r8) nmozsgn(p) = nmozsgn(p)+1 - if (nmozsgn(p) >= 4) obu(p) = zldis(p)/(-0.01_r8) - obuold(p) = obu(p) - - end do ! end of filtered pft loop - - ! Test for convergence - - itlef = itlef+1 - if (itlef > itmin) then - do f = 1, fn - p = filterp(f) - dele(p) = abs(efe(p)-efeb(p)) - efeb(p) = efe(p) - det(p) = max(del(p),del2(p)) - end do - fnold = fn - fn = 0 - do f = 1, fnold - p = filterp(f) - if (.not. (det(p) < dtmin .and. dele(p) < dlemin)) then - fn = fn + 1 - filterp(fn) = p - end if - end do - end if - - end do ITERATION ! End stability iteration - - fn = fnorig - filterp(1:fn) = fporig(1:fn) - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - ! Energy balance check in canopy - - err(p) = sabv(p) + air(p) + bir(p)*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) & - + cir(p)*t_grnd(c)**4 - eflx_sh_veg(p) - hvap*qflx_evap_veg(p) - - ! Fluxes from ground to canopy space - - delt = wtal(p)*t_grnd(c)-wtl0(p)*t_veg(p)-wta0(p)*thm(p) - taux(p) = -forc_rho(g)*forc_u(g)/ram1(p) - tauy(p) = -forc_rho(g)*forc_v(g)/ram1(p) - eflx_sh_grnd(p) = cpair*forc_rho(g)*wtg(p)*delt - qflx_evap_soi(p) = forc_rho(g)*wtgq(p)*delq(p) - - ! 2 m height air temperature - - t_ref2m(p) = thm(p) + temp1(p)*dth(p)*(1._r8/temp12m(p) - 1._r8/temp1(p)) - t_ref2m_r(p) = t_ref2m(p) - - ! 2 m height specific humidity - - q_ref2m(p) = forc_q(g) + temp2(p)*dqh(p)*(1._r8/temp22m(p) - 1._r8/temp2(p)) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(g), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - rh_ref2m_r(p) = rh_ref2m(p) - - ! Downward longwave radiation below the canopy - - dlrad(p) = (1._r8-emv(p))*emg(c)*forc_lwrad(g) + & - emv(p)*emg(c)*sb*tlbef(p)**3*(tlbef(p) + 4._r8*dt_veg(p)) - - ! Upward longwave radiation above the canopy - - ulrad(p) = ((1._r8-emg(c))*(1._r8-emv(p))*(1._r8-emv(p))*forc_lwrad(g) & - + emv(p)*(1._r8+(1._r8-emg(c))*(1._r8-emv(p)))*sb*tlbef(p)**3*(tlbef(p) + & - 4._r8*dt_veg(p)) + emg(c)*(1._r8-emv(p))*sb*t_grnd(c)**4) - - ! Derivative of soil energy flux with respect to soil temperature - - cgrnds(p) = cgrnds(p) + cpair*forc_rho(g)*wtg(p)*wtal(p) - cgrndl(p) = cgrndl(p) + forc_rho(g)*wtgq(p)*wtalq(p)*dqgdT(c) - cgrnd(p) = cgrnds(p) + cgrndl(p)*htvp(c) - - ! Update dew accumulation (kg/m2) - - h2ocan(p) = max(0._r8,h2ocan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime) - - ! total photosynthesis - - fpsn(p) = psnsun(p)*laisun(p) + psnsha(p)*laisha(p) - - if (use_cn) then - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - rc13_canair(p) = c13o2(p)/(co2(p)-c13o2(p)) - rc13_psnsun(p) = rc13_canair(p)/alphapsnsun(p) - rc13_psnsha(p) = rc13_canair(p)/alphapsnsha(p) - c13_psnsun(p) = psnsun(p) * (rc13_psnsun(p)/(1._r8+rc13_psnsun(p))) - c13_psnsha(p) = psnsha(p) * (rc13_psnsha(p)/(1._r8+rc13_psnsha(p))) - !write(iulog,*) p,ivt(p),btran(p),psnsun(p),psnsha(p),alphapsnsun(p),alphapsnsha(p) - end if - end if - - end do - - ! Filter out pfts which have small energy balance errors; report others - - fnold = fn - fn = 0 - do f = 1, fnold - p = filterp(f) - if (abs(err(p)) > 0.1_r8) then - fn = fn + 1 - filterp(fn) = p - end if - end do - - do f = 1, fn - p = filterp(f) - write(iulog,*) 'energy balance in canopy ',p,', err=',err(p) - end do - - end subroutine CanopyFluxes - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: Stomata -! -! !INTERFACE: - subroutine Stomata (fn, filterp, lbp, ubp, ei, ea, o2, co2, rb, dayl_factor, phase) -! -! !DESCRIPTION: -! Leaf stomatal resistance and leaf photosynthesis. Modifications for CN code. - -! !REVISION HISTORY: -! 22 January 2004: Created by Peter Thornton -! 4/14/05: Peter Thornton: Converted Ci from local variable to pps struct member -! now returns cisun or cisha per pft as implicit output argument. -! Also sets alphapsnsun and alphapsnsha. -! 4/25/05, Peter Thornton: Adopted as the default code for CLM, together with -! modifications for sun/shade canopy. Renamed from StomataCN to Stomata, -! and eliminating the older Stomata subroutine -! 3/6/09: Peter Thornton; added dayl_factor control on Vcmax, from Bill Bauerle - -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_const_mod, only : SHR_CONST_TKFRZ, SHR_CONST_RGAS - use clmtype - use clm_atmlnd , only : clm_a2l - use spmdMod , only: masterproc - use pftvarcon , only : nbrdlf_dcd_tmp_shrub - use pftvarcon , only : nsoybean, npcropmin -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: fn ! size of pft filter - integer , intent(in) :: filterp(fn) ! pft filter - integer , intent(in) :: lbp, ubp ! pft bounds - real(r8), intent(in) :: ei(lbp:ubp) ! vapor pressure inside leaf (sat vapor press at tl) (pa) - real(r8), intent(in) :: ea(lbp:ubp) ! vapor pressure of canopy air (pa) - real(r8), intent(in) :: o2(lbp:ubp) ! atmospheric o2 concentration (pa) - real(r8), intent(in) :: co2(lbp:ubp) ! atmospheric co2 concentration (pa) - real(r8), intent(inout) :: rb(lbp:ubp) ! boundary layer resistance (s/m) - real(r8), intent(in) :: dayl_factor(lbp:ubp) ! scalar (0-1) for daylength - character(len=*), intent(in) :: phase ! 'sun' or 'sha' -! -! !CALLED FROM: -! subroutine CanopyFluxes in this module -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in variables -! new ecophys variables (leafcn, flnr) added 1/26/04 -! - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: qe25(:) ! quantum efficiency at 25C (umol CO2 / umol photon) - real(r8), pointer :: c3psn(:) ! photosynthetic pathway: 0. = c4, 1. = c3 - real(r8), pointer :: mp(:) ! slope of conductance-to-photosynthesis relationship - real(r8), pointer :: tgcm(:) ! air temperature at agcm reference height (kelvin) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: tl(:) ! leaf temperature (Kelvin) - real(r8), pointer :: btran(:) ! soil water transpiration factor (0 to 1) - real(r8), pointer :: apar(:) ! par absorbed per unit lai (w/m**2) - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) - real(r8), pointer :: flnr(:) ! fraction of leaf N in the Rubisco enzyme (gN Rubisco / gN leaf) - real(r8), pointer :: sla(:) ! specific leaf area, projected area basis (m^2/gC) - real(r8), pointer :: fnitr(:) ! foliage nitrogen limitation factor (-) -! -! local pointers to implicit inout variables -! - real(r8), pointer :: rs(:) ! leaf stomatal resistance (s/m) - real(r8), pointer :: psn(:) ! foliage photosynthesis (umol co2 /m**2/ s) [always +] - real(r8), pointer :: ci(:) ! intracellular leaf CO2 (Pa) - real(r8), pointer :: alphapsn(:) ! 13C fractionation factor for PSN () -! -! local pointers to implicit out variables -! - real(r8), pointer :: lnc(:) ! leaf N concentration per unit projected LAI (gN leaf/m^2) - real(r8), pointer :: vcmx(:) ! maximum rate of carboxylation (umol co2/m**2/s) -! -! -! !LOCAL VARIABLES: -!EOP -! - real(r8), parameter :: mpe = 1.e-6_r8 ! prevents overflow error if division by zero - integer , parameter :: niter = 3 ! number of iterations - integer :: f,p,c,g ! indices - integer :: iter ! iteration index - real(r8) :: ab ! used in statement functions - real(r8) :: bc ! used in statement functions - real(r8) :: f1 ! generic temperature response (statement function) - real(r8) :: f2 ! generic temperature inhibition (statement function) - real(r8) :: tc ! leaf temperature (degree celsius) - real(r8) :: cs ! co2 concentration at leaf surface (pa) - real(r8) :: kc ! co2 michaelis-menten constant (pa) - real(r8) :: ko ! o2 michaelis-menten constant (pa) - real(r8) :: atmp ! intermediate calculations for rs - real(r8) :: btmp ! intermediate calculations for rs - real(r8) :: ctmp ! intermediate calculations for rs - real(r8) :: q ! intermediate calculations for rs - real(r8) :: r1,r2 ! roots for rs - real(r8) :: ppf ! absorb photosynthetic photon flux (umol photons/m**2/s) - real(r8) :: wc ! rubisco limited photosynthesis (umol co2/m**2/s) - real(r8) :: wj ! light limited photosynthesis (umol co2/m**2/s) - real(r8) :: we ! export limited photosynthesis (umol co2/m**2/s) - real(r8) :: cp ! co2 compensation point (pa) - real(r8) :: awc ! intermediate calcuation for wc - real(r8) :: j ! electron transport (umol co2/m**2/s) - real(r8) :: cea ! constrain ea or else model blows up - real(r8) :: cf ! s m**2/umol -> s/m - real(r8) :: rsmax0 ! maximum stomatal resistance [s/m] - real(r8) :: kc25 ! co2 michaelis-menten constant at 25c (pa) - real(r8) :: akc ! q10 for kc25 - real(r8) :: ko25 ! o2 michaelis-menten constant at 25c (pa) - real(r8) :: ako ! q10 for ko25 - real(r8) :: bp ! minimum leaf conductance (umol/m**2/s) - ! additional variables for new treatment of Vcmax, Peter Thornton, 1/26/04 - real(r8) :: act25 ! (umol/mgRubisco/min) Rubisco activity at 25 C - real(r8) :: act ! (umol/mgRubisco/min) Rubisco activity - real(r8) :: q10act ! (DIM) Q_10 for Rubisco activity - real(r8) :: fnr ! (gRubisco/gN in Rubisco) -!------------------------------------------------------------------------------ - - ! Set statement functions - - f1(ab,bc) = ab**((bc-25._r8)/10._r8) - f2(ab) = 1._r8 + exp((-2.2e05_r8+710._r8*(ab+SHR_CONST_TKFRZ))/(SHR_CONST_RGAS*0.001_r8*(ab+SHR_CONST_TKFRZ))) - - ! Assign local pointers to derived type members (pft-level) - - pcolumn => pft%column - pgridcell => pft%gridcell - ivt => pft%itype - tl => pes%t_veg - btran => pps%btran - if (phase == 'sun') then - apar => pef%parsun - rs => pps%rssun - psn => pcf%psnsun - ci => pps%cisun - - alphapsn => pps%alphapsnsun - - sla => pps%slasun - lnc => pps%lncsun - vcmx => pps%vcmxsun - else if (phase == 'sha') then - apar => pef%parsha - rs => pps%rssha - psn => pcf%psnsha - ci => pps%cisha - sla => pps%slasha - - alphapsn => pps%alphapsnsha - - lnc => pps%lncsha - vcmx => pps%vcmxsha - end if - - ! Assign local pointers to derived type members (gridcell-level) - - forc_pbot => clm_a2l%forc_pbot - - ! Assign local pointers to derived type members (column-level) - - tgcm => pes%thm - - ! Assign local pointers to pft constants - ! new ecophys constants added 1/26/04 - - qe25 => pftcon%qe25 - c3psn => pftcon%c3psn - mp => pftcon%mp - leafcn => pftcon%leafcn - flnr => pftcon%flnr - fnitr => pftcon%fnitr - - ! Set constant values - - kc25 = 30._r8 - akc = 2.1_r8 - ko25 = 30000._r8 - ako = 1.2_r8 - bp = 2000._r8 - - ! New constants for CN code, added 1/26/04 - - act25 = 3.6_r8 - q10act = 2.4_r8 - fnr = 7.16_r8 - - ! Convert rubisco activity units from umol/mgRubisco/min -> umol/gRubisco/s - - act25 = act25 * 1000.0_r8 / 60.0_r8 - - do f = 1, fn - p = filterp(f) - c = pcolumn(p) - g = pgridcell(p) - - ! Initialize rs=rsmax and psn=0 because calculations are performed only - ! when apar > 0, in which case rs <= rsmax and psn >= 0 - ! Set constants - - rsmax0 = 2.e4_r8 - cf = forc_pbot(g)/(SHR_CONST_RGAS*0.001_r8*tgcm(p))*1.e06_r8 - if (apar(p) <= 0._r8) then ! night time - rs(p) = min(rsmax0, 1._r8/bp * cf) - psn(p) = 0._r8 - lnc(p) = 0._r8 - vcmx(p) = 0._r8 - if (use_c13) then - alphapsn(p) = 1._r8 - end if - else ! day time - tc = tl(p) - SHR_CONST_TKFRZ - ppf = 4.6_r8 * apar(p) - j = ppf * qe25(ivt(p)) - kc = kc25 * f1(akc,tc) - ko = ko25 * f1(ako,tc) - awc = kc * (1._r8+o2(p)/ko) - cp = 0.5_r8*kc/ko*o2(p)*0.21_r8 - - ! Modification for shrubs proposed by X.D.Z - ! Why does he prefer this line here instead of in subr. - ! CanopyFluxes? (slevis) - ! Equivalent modification for soy following AgroIBIS - if (use_cndv) then - if (ivt(p) == nbrdlf_dcd_tmp_shrub) btran(p) = min(1._r8, btran(p) * 3.33_r8) - end if - if (ivt(p) == nsoybean) btran(p) = min(1._r8, btran(p) * 1.25_r8) - - ! new calculations for vcmax, 1/26/04 - lnc(p) = 1._r8 / (sla(p) * leafcn(ivt(p))) - act = act25 * f1(q10act,tc) - if (use_cn) then - if ( ivt(p) < npcropmin )then - vcmx(p) = lnc(p) * flnr(ivt(p)) * fnr * act / f2(tc) * btran(p) * & - dayl_factor(p) - else - vcmx(p) = 101._r8 * f1(q10act,tc) / f2(tc) * btran(p) * dayl_factor(p) - end if - else - vcmx(p) = lnc(p) * flnr(ivt(p)) * fnr * act / f2(tc) * btran(p) * & - dayl_factor(p) * fnitr(ivt(p)) - end if - - ! First guess ci - - ci(p) = 0.7_r8*co2(p)*c3psn(ivt(p)) + 0.4_r8*co2(p)*(1._r8-c3psn(ivt(p))) - - ! rb: s/m -> s m**2 / umol - - rb(p) = rb(p)/cf - - ! Constrain ea - - cea = max(0.25_r8*ei(p)*c3psn(ivt(p))+0.40_r8*ei(p)*(1._r8-c3psn(ivt(p))), min(ea(p),ei(p)) ) - - ! ci iteration for 'actual' photosynthesis - - do iter = 1, niter - wj = max(ci(p)-cp,0._r8)*j/(ci(p)+2._r8*cp)*c3psn(ivt(p)) + j*(1._r8-c3psn(ivt(p))) - wc = max(ci(p)-cp,0._r8)*vcmx(p)/(ci(p)+awc)*c3psn(ivt(p)) + vcmx(p)*(1._r8-c3psn(ivt(p))) - we = 0.5_r8*vcmx(p)*c3psn(ivt(p)) + 4000._r8*vcmx(p)*ci(p)/forc_pbot(g)*(1._r8-c3psn(ivt(p))) - psn(p) = min(wj,wc,we) - cs = max( co2(p)-1.37_r8*rb(p)*forc_pbot(g)*psn(p), mpe ) - atmp = mp(ivt(p))*psn(p)*forc_pbot(g)*cea / (cs*ei(p)) + bp - btmp = ( mp(ivt(p))*psn(p)*forc_pbot(g)/cs + bp ) * rb(p) - 1._r8 - ctmp = -rb(p) - if (btmp >= 0._r8) then - q = -0.5_r8*( btmp + sqrt(btmp*btmp-4._r8*atmp*ctmp) ) - else - q = -0.5_r8*( btmp - sqrt(btmp*btmp-4._r8*atmp*ctmp) ) - end if - r1 = q/atmp - r2 = ctmp/q - rs(p) = max(r1,r2) - ci(p) = max( cs-psn(p)*forc_pbot(g)*1.65_r8*rs(p), 0._r8 ) - end do - - ! rs, rb: s m**2 / umol -> s/m - - rs(p) = min(rsmax0, rs(p)*cf) - rb(p) = rb(p) * cf - - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - alphapsn(p) = 1._r8 + (((c3psn(ivt(p)) * (4.4_r8 + (22.6_r8*(ci(p)/co2(p))))) + & - ((1._r8 - c3psn(ivt(p))) * 4.4_r8))/1000._r8) - !alphapsn(p) = 1._r8 - !write(iulog,*) 'in StomataCN ',p,ivt(p),c3psn(ivt(p)),ci(p),co2(p),alphapsn(p) - end if - - end if - - end do - - end subroutine Stomata - -end module CanopyFluxesMod diff --git a/src_clm40/biogeophys/FracWetMod.F90 b/src_clm40/biogeophys/FracWetMod.F90 deleted file mode 100644 index f4bd6b9b80..0000000000 --- a/src_clm40/biogeophys/FracWetMod.F90 +++ /dev/null @@ -1,115 +0,0 @@ -module FracWetMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: FracWetMod -! -! !DESCRIPTION: -! Determine fraction of vegetated surfaces which are wet and -! fraction of elai which is dry. -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: FracWet -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: FracWet -! -! !INTERFACE: - subroutine FracWet(numf, filter) -! -! !DESCRIPTION: -! Determine fraction of vegetated surfaces which are wet and -! fraction of elai which is dry. The variable ``fwet'' is the -! fraction of all vegetation surfaces which are wet including -! stem area which contribute to evaporation. The variable ``fdry'' -! is the fraction of elai which is dry because only leaves -! can transpire. Adjusted for stem area which does not transpire. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: numf ! number of filter non-lake points - integer, intent(in) :: filter(numf) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine Hydrology1 in module Hydrology1Mod -! -! !REVISION HISTORY: -! Created by Keith Oleson and M. Vertenstein -! 03/08/29 Mariana Vertenstein : Migrated to vectorized code -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: frac_veg_nosno(:) ! fraction of veg not covered by snow (0/1 now) [-] - real(r8), pointer :: dewmx(:) ! Maximum allowed dew [mm] - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: h2ocan(:) ! total canopy water (mm H2O) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: fwet(:) ! fraction of canopy that is wet (0 to 1) - real(r8), pointer :: fdry(:) ! fraction of foliage that is green and dry [-] (new) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: fp,p ! indices - real(r8) :: vegt ! frac_veg_nosno*lsai - real(r8) :: dewmxi ! inverse of maximum allowed dew [1/mm] -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (pft-level) - - frac_veg_nosno => pps%frac_veg_nosno - dewmx => pps%dewmx - elai => pps%elai - esai => pps%esai - h2ocan => pws%h2ocan - fwet => pps%fwet - fdry => pps%fdry - - ! Compute fraction of canopy that is wet and dry - - do fp = 1,numf - p = filter(fp) - if (frac_veg_nosno(p) == 1) then - if (h2ocan(p) > 0._r8) then - vegt = frac_veg_nosno(p)*(elai(p) + esai(p)) - dewmxi = 1.0_r8/dewmx(p) - fwet(p) = ((dewmxi/vegt)*h2ocan(p))**0.666666666666_r8 - fwet(p) = min (fwet(p),1.0_r8) ! Check for maximum limit of fwet - else - fwet(p) = 0._r8 - end if - fdry(p) = (1._r8-fwet(p))*elai(p)/(elai(p)+esai(p)) - else - fwet(p) = 0._r8 - fdry(p) = 0._r8 - end if - end do - - end subroutine FracWet - -end module FracWetMod diff --git a/src_clm40/biogeophys/FrictionVelocityMod.F90 b/src_clm40/biogeophys/FrictionVelocityMod.F90 deleted file mode 100644 index 0f3eaa3a52..0000000000 --- a/src_clm40/biogeophys/FrictionVelocityMod.F90 +++ /dev/null @@ -1,572 +0,0 @@ -module FrictionVelocityMod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: FrictionVelocityMod -! -! !DESCRIPTION: -! Calculation of the friction velocity, relation for potential -! temperature and humidity profiles of surface boundary layer. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: FrictionVelocity ! Calculate friction velocity - public :: MoninObukIni ! Initialization of the Monin-Obukhov length -! -! !PRIVATE MEMBER FUNCTIONS: - private :: StabilityFunc1 ! Stability function for rib < 0. - private :: StabilityFunc2 ! Stability function for rib < 0. -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: FrictionVelocity -! -! !INTERFACE: - subroutine FrictionVelocity(lbn, ubn, fn, filtern, & - displa, z0m, z0h, z0q, & - obu, iter, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm, landunit_index) -! -! !DESCRIPTION: -! Calculation of the friction velocity, relation for potential -! temperature and humidity profiles of surface boundary layer. -! The scheme is based on the work of Zeng et al. (1998): -! Intercomparison of bulk aerodynamic algorithms for the computation -! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, -! Vol. 11, 2628-2644. -! -! !USES: - use clmtype - use clm_atmlnd, only : clm_a2l - use clm_varcon, only : vkc - use clm_varctl, only : iulog -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbn, ubn ! pft/landunit array bounds - integer , intent(in) :: fn ! number of filtered pft/landunit elements - integer , intent(in) :: filtern(fn) ! pft/landunit filter - real(r8), intent(in) :: displa(lbn:ubn) ! displacement height (m) - real(r8), intent(in) :: z0m(lbn:ubn) ! roughness length over vegetation, momentum [m] - real(r8), intent(in) :: z0h(lbn:ubn) ! roughness length over vegetation, sensible heat [m] - real(r8), intent(in) :: z0q(lbn:ubn) ! roughness length over vegetation, latent heat [m] - real(r8), intent(in) :: obu(lbn:ubn) ! monin-obukhov length (m) - integer, intent(in) :: iter ! iteration number - real(r8), intent(in) :: ur(lbn:ubn) ! wind speed at reference height [m/s] - real(r8), intent(in) :: um(lbn:ubn) ! wind speed including the stablity effect [m/s] - logical, optional, intent(in) :: landunit_index ! optional argument that defines landunit or pft level - real(r8), intent(out) :: ustar(lbn:ubn) ! friction velocity [m/s] - real(r8), intent(out) :: temp1(lbn:ubn) ! relation for potential temperature profile - real(r8), intent(out) :: temp12m(lbn:ubn) ! relation for potential temperature profile applied at 2-m - real(r8), intent(out) :: temp2(lbn:ubn) ! relation for specific humidity profile - real(r8), intent(out) :: temp22m(lbn:ubn) ! relation for specific humidity profile applied at 2-m - real(r8), intent(inout) :: fm(lbn:ubn) ! diagnose 10m wind (DUST only) -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 12/19/01, Peter Thornton -! Added arguments to eliminate passing clm derived type into this function. -! Created by Mariana Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: ngridcell(:) !pft/landunit gridcell index - real(r8), pointer :: forc_hgt_u_pft(:) !observational height of wind at pft level [m] - real(r8), pointer :: forc_hgt_t_pft(:) !observational height of temperature at pft level [m] - real(r8), pointer :: forc_hgt_q_pft(:) !observational height of specific humidity at pft level [m] - integer , pointer :: pfti(:) !beginning pfti index for landunit - integer , pointer :: pftf(:) !final pft index for landunit -! -! local pointers to implicit out arguments -! - real(r8), pointer :: u10(:) ! 10-m wind (m/s) (for dust model) - real(r8), pointer :: fv(:) ! friction velocity (m/s) (for dust model) - real(r8), pointer :: vds(:) ! dry deposition velocity term (m/s) (for SO4 NH4NO3) - real(r8), pointer :: u10_clm(:) ! 10-m wind (m/s) - real(r8), pointer :: va(:) ! atmospheric wind speed plus convective velocity (m/s) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - real(r8), parameter :: zetam = 1.574_r8 ! transition point of flux-gradient relation (wind profile) - real(r8), parameter :: zetat = 0.465_r8 ! transition point of flux-gradient relation (temp. profile) - integer :: f ! pft/landunit filter index - integer :: n ! pft/landunit index - integer :: g ! gridcell index - integer :: pp ! pfti,pftf index - real(r8):: zldis(lbn:ubn) ! reference height "minus" zero displacement heght [m] - real(r8):: zeta(lbn:ubn) ! dimensionless height used in Monin-Obukhov theory - real(r8) :: tmp1,tmp2,tmp3,tmp4 ! Used to diagnose the 10 meter wind - real(r8) :: fmnew ! Used to diagnose the 10 meter wind - real(r8) :: fm10 ! Used to diagnose the 10 meter wind - real(r8) :: zeta10 ! Used to diagnose the 10 meter wind - real(r8) :: vds_tmp ! Temporary for dry deposition velocity -!------------------------------------------------------------------------------ - - ! Assign local pointers to derived type members (gridcell-level) - - if (present(landunit_index)) then - ngridcell => lun%gridcell - else - ngridcell => pft%gridcell - end if - - vds => pps%vds - u10 => pps%u10 - u10_clm => pps%u10_clm - va => pps%va - fv => pps%fv - - ! Assign local pointers to derived type members (pft or landunit-level) - - pfti => lun%pfti - pftf => lun%pftf - - ! Assign local pointers to derived type members (pft-level) - - forc_hgt_u_pft => pps%forc_hgt_u_pft - forc_hgt_t_pft => pps%forc_hgt_t_pft - forc_hgt_q_pft => pps%forc_hgt_q_pft - - ! Adjustment factors for unstable (moz < 0) or stable (moz > 0) conditions. - - do f = 1, fn - n = filtern(f) - g = ngridcell(n) - - ! Wind profile - - if (present(landunit_index)) then - zldis(n) = forc_hgt_u_pft(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_u_pft(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetam) then - ustar(n) = vkc*um(n)/(log(-zetam*obu(n)/z0m(n))& - - StabilityFunc1(-zetam) & - + StabilityFunc1(z0m(n)/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) - else if (zeta(n) < 0._r8) then - ustar(n) = vkc*um(n)/(log(zldis(n)/z0m(n))& - - StabilityFunc1(zeta(n))& - + StabilityFunc1(z0m(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - ustar(n) = vkc*um(n)/(log(zldis(n)/z0m(n)) + 5._r8*zeta(n) -5._r8*z0m(n)/obu(n)) - else - ustar(n) = vkc*um(n)/(log(obu(n)/z0m(n))+5._r8-5._r8*z0m(n)/obu(n) & - +(5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - if (zeta(n) < 0._r8) then - vds_tmp = 2.e-3_r8*ustar(n) * ( 1._r8 + (300._r8/(-obu(n)))**0.666_r8) - else - vds_tmp = 2.e-3_r8*ustar(n) - endif - - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - vds(pp) = vds_tmp - end do - else - vds(n) = vds_tmp - end if - -! Calculate a 10-m wind (10m + z0m + d) -! For now, this will not be the same as the 10-m wind calculated for the dust -! model because the CLM stability functions are used here, not the LSM stability -! functions used in the dust model. We will eventually change the dust model to be -! consistent with the following formulation. -! Note that the 10-m wind calculated this way could actually be larger than the -! atmospheric forcing wind because 1) this includes the convective velocity, 2) -! this includes the 1 m/s minimum wind threshold - -! If forcing height is less than or equal to 10m, then set 10-m wind to um - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - if (zldis(n)-z0m(n) .le. 10._r8) then - u10_clm(pp) = um(n) - else - if (zeta(n) < -zetam) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(-zetam*obu(n)/(10._r8+z0m(n))) & - - StabilityFunc1(-zetam) & - + StabilityFunc1((10._r8+z0m(n))/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) ) - else if (zeta(n) < 0._r8) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - - StabilityFunc1(zeta(n)) & - + StabilityFunc1((10._r8+z0m(n))/obu(n))) ) - else if (zeta(n) <= 1._r8) then - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - + 5._r8*zeta(n) - 5._r8*(10._r8+z0m(n))/obu(n)) ) - else - u10_clm(pp) = um(n) - ( ustar(n)/vkc*(log(obu(n)/(10._r8+z0m(n))) & - + 5._r8 - 5._r8*(10._r8+z0m(n))/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) ) - - end if - end if - va(pp) = um(n) - end do - else - if (zldis(n)-z0m(n) .le. 10._r8) then - u10_clm(n) = um(n) - else - if (zeta(n) < -zetam) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(-zetam*obu(n)/(10._r8+z0m(n))) & - - StabilityFunc1(-zetam) & - + StabilityFunc1((10._r8+z0m(n))/obu(n)) & - + 1.14_r8*((-zeta(n))**0.333_r8-(zetam)**0.333_r8)) ) - else if (zeta(n) < 0._r8) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - - StabilityFunc1(zeta(n)) & - + StabilityFunc1((10._r8+z0m(n))/obu(n))) ) - else if (zeta(n) <= 1._r8) then - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(zldis(n)/(10._r8+z0m(n))) & - + 5._r8*zeta(n) - 5._r8*(10._r8+z0m(n))/obu(n)) ) - else - u10_clm(n) = um(n) - ( ustar(n)/vkc*(log(obu(n)/(10._r8+z0m(n))) & - + 5._r8 - 5._r8*(10._r8+z0m(n))/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) ) - end if - end if - va(n) = um(n) - end if - - ! Temperature profile - - if (present(landunit_index)) then - zldis(n) = forc_hgt_t_pft(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_t_pft(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp1(n) = vkc/(log(-zetat*obu(n)/z0h(n))& - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0h(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp1(n) = vkc/(log(zldis(n)/z0h(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0h(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp1(n) = vkc/(log(zldis(n)/z0h(n)) + 5._r8*zeta(n) - 5._r8*z0h(n)/obu(n)) - else - temp1(n) = vkc/(log(obu(n)/z0h(n)) + 5._r8 - 5._r8*z0h(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - ! Humidity profile - - if (present(landunit_index)) then - if (forc_hgt_q_pft(pfti(n)) == forc_hgt_t_pft(pfti(n)) .and. z0q(n) == z0h(n)) then - temp2(n) = temp1(n) - else - zldis(n) = forc_hgt_q_pft(pfti(n))-displa(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) & - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp2(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - end if - else - if (forc_hgt_q_pft(n) == forc_hgt_t_pft(n) .and. z0q(n) == z0h(n)) then - temp2(n) = temp1(n) - else - zldis(n) = forc_hgt_q_pft(n)-displa(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) & - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp2(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp2(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - endif - endif - - ! Temperature profile applied at 2-m - - zldis(n) = 2.0_r8 + z0h(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp12m(n) = vkc/(log(-zetat*obu(n)/z0h(n))& - - StabilityFunc2(-zetat) & - + StabilityFunc2(z0h(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp12m(n) = vkc/(log(zldis(n)/z0h(n)) & - - StabilityFunc2(zeta(n)) & - + StabilityFunc2(z0h(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp12m(n) = vkc/(log(zldis(n)/z0h(n)) + 5._r8*zeta(n) - 5._r8*z0h(n)/obu(n)) - else - temp12m(n) = vkc/(log(obu(n)/z0h(n)) + 5._r8 - 5._r8*z0h(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - - ! Humidity profile applied at 2-m - - if (z0q(n) == z0h(n)) then - temp22m(n) = temp12m(n) - else - zldis(n) = 2.0_r8 + z0q(n) - zeta(n) = zldis(n)/obu(n) - if (zeta(n) < -zetat) then - temp22m(n) = vkc/(log(-zetat*obu(n)/z0q(n)) - & - StabilityFunc2(-zetat) + StabilityFunc2(z0q(n)/obu(n)) & - + 0.8_r8*((zetat)**(-0.333_r8)-(-zeta(n))**(-0.333_r8))) - else if (zeta(n) < 0._r8) then - temp22m(n) = vkc/(log(zldis(n)/z0q(n)) - & - StabilityFunc2(zeta(n))+StabilityFunc2(z0q(n)/obu(n))) - else if (zeta(n) <= 1._r8) then - temp22m(n) = vkc/(log(zldis(n)/z0q(n)) + 5._r8*zeta(n)-5._r8*z0q(n)/obu(n)) - else - temp22m(n) = vkc/(log(obu(n)/z0q(n)) + 5._r8 - 5._r8*z0q(n)/obu(n) & - + (5._r8*log(zeta(n))+zeta(n)-1._r8)) - end if - end if - - ! diagnose 10-m wind for dust model (dstmbl.F) - ! Notes from C. Zender's dst.F: - ! According to Bon96 p. 62, the displacement height d (here displa) is - ! 0.0 <= d <= 0.34 m in dust source regions (i.e., regions w/o trees). - ! Therefore d <= 0.034*z1 and may safely be neglected. - ! Code from LSM routine SurfaceTemperature was used to obtain u10 - - if (present(landunit_index)) then - zldis(n) = forc_hgt_u_pft(pfti(n))-displa(n) - else - zldis(n) = forc_hgt_u_pft(n)-displa(n) - end if - zeta(n) = zldis(n)/obu(n) - if (min(zeta(n), 1._r8) < 0._r8) then - tmp1 = (1._r8 - 16._r8*min(zeta(n),1._r8))**0.25_r8 - tmp2 = log((1._r8+tmp1*tmp1)/2._r8) - tmp3 = log((1._r8+tmp1)/2._r8) - fmnew = 2._r8*tmp3 + tmp2 - 2._r8*atan(tmp1) + 1.5707963_r8 - else - fmnew = -5._r8*min(zeta(n),1._r8) - endif - if (iter == 1) then - fm(n) = fmnew - else - fm(n) = 0.5_r8 * (fm(n)+fmnew) - end if - zeta10 = min(10._r8/obu(n), 1._r8) - if (zeta(n) == 0._r8) zeta10 = 0._r8 - if (zeta10 < 0._r8) then - tmp1 = (1.0_r8 - 16.0_r8 * zeta10)**0.25_r8 - tmp2 = log((1.0_r8 + tmp1*tmp1)/2.0_r8) - tmp3 = log((1.0_r8 + tmp1)/2.0_r8) - fm10 = 2.0_r8*tmp3 + tmp2 - 2.0_r8*atan(tmp1) + 1.5707963_r8 - else ! not stable - fm10 = -5.0_r8 * zeta10 - end if - if (present(landunit_index)) then - tmp4 = log( max( 1.0_r8, forc_hgt_u_pft(pfti(n)) / 10._r8) ) - else - tmp4 = log( max( 1.0_r8, forc_hgt_u_pft(n) / 10._r8) ) - end if - if (present(landunit_index)) then - do pp = pfti(n),pftf(n) - u10(pp) = ur(n) - ustar(n)/vkc * (tmp4 - fm(n) + fm10) - fv(pp) = ustar(n) - end do - else - u10(n) = ur(n) - ustar(n)/vkc * (tmp4 - fm(n) + fm10) - fv(n) = ustar(n) - end if - - end do - - end subroutine FrictionVelocity - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: StabilityFunc -! -! !INTERFACE: - real(r8) function StabilityFunc1(zeta) -! -! !DESCRIPTION: -! Stability function for rib < 0. -! -! !USES: - use shr_const_mod, only: SHR_CONST_PI -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory -! -! !CALLED FROM: -! subroutine FrictionVelocity in this module -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: chik, chik2 -!------------------------------------------------------------------------------ - - chik2 = sqrt(1._r8-16._r8*zeta) - chik = sqrt(chik2) - StabilityFunc1 = 2._r8*log((1._r8+chik)*0.5_r8) & - + log((1._r8+chik2)*0.5_r8)-2._r8*atan(chik)+SHR_CONST_PI*0.5_r8 - - end function StabilityFunc1 - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: StabilityFunc2 -! -! !INTERFACE: - real(r8) function StabilityFunc2(zeta) -! -! !DESCRIPTION: -! Stability function for rib < 0. -! -! !USES: - use shr_const_mod, only: SHR_CONST_PI -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory -! -! !CALLED FROM: -! subroutine FrictionVelocity in this module -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: chik2 -!------------------------------------------------------------------------------ - - chik2 = sqrt(1._r8-16._r8*zeta) - StabilityFunc2 = 2._r8*log((1._r8+chik2)*0.5_r8) - - end function StabilityFunc2 - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: MoninObukIni -! -! !INTERFACE: - subroutine MoninObukIni (ur, thv, dthv, zldis, z0m, um, obu) -! -! !DESCRIPTION: -! Initialization of the Monin-Obukhov length. -! The scheme is based on the work of Zeng et al. (1998): -! Intercomparison of bulk aerodynamic algorithms for the computation -! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, -! Vol. 11, 2628-2644. -! -! !USES: - use clm_varcon, only : grav -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: ur ! wind speed at reference height [m/s] - real(r8), intent(in) :: thv ! virtual potential temperature (kelvin) - real(r8), intent(in) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8), intent(in) :: zldis ! reference height "minus" zero displacement heght [m] - real(r8), intent(in) :: z0m ! roughness length, momentum [m] - real(r8), intent(out) :: um ! wind speed including the stability effect [m/s] - real(r8), intent(out) :: obu ! monin-obukhov length (m) -! -! !CALLED FROM: -! subroutine BareGroundFluxes in module BareGroundFluxesMod.F90 -! subroutine BiogeophysicsLake in module BiogeophysicsLakeMod.F90 -! subroutine CanopyFluxes in module CanopyFluxesMod.F90 -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: wc ! convective velocity [m/s] - real(r8) :: rib ! bulk Richardson number - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: ustar ! friction velocity [m/s] -!----------------------------------------------------------------------- - - ! Initial values of u* and convective velocity - - ustar=0.06_r8 - wc=0.5_r8 - if (dthv >= 0._r8) then - um=max(ur,0.1_r8) - else - um=sqrt(ur*ur+wc*wc) - endif - - rib=grav*zldis*dthv/(thv*um*um) - - if (rib >= 0._r8) then ! neutral or stable - zeta = rib*log(zldis/z0m)/(1._r8-5._r8*min(rib,0.19_r8)) - zeta = min(2._r8,max(zeta,0.01_r8 )) - else ! unstable - zeta=rib*log(zldis/z0m) - zeta = max(-100._r8,min(zeta,-0.01_r8 )) - endif - - obu=zldis/zeta - - end subroutine MoninObukIni - -end module FrictionVelocityMod diff --git a/src_clm40/biogeophys/Hydrology1Mod.F90 b/src_clm40/biogeophys/Hydrology1Mod.F90 deleted file mode 100644 index 915c0969ac..0000000000 --- a/src_clm40/biogeophys/Hydrology1Mod.F90 +++ /dev/null @@ -1,499 +0,0 @@ -module Hydrology1Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: Hydrology1Mod -! -! !DESCRIPTION: -! Calculation of -! (1) water storage of intercepted precipitation -! (2) direct throughfall and canopy drainage of precipitation -! (3) the fraction of foliage covered by water and the fraction -! of foliage that is dry and transpiring. -! (4) snow layer initialization if the snow accumulation exceeds 10 mm. -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Hydrology1 -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Hydrology1 -! -! !INTERFACE: - subroutine Hydrology1(lbc, ubc, lbp, ubp, num_nolakec, filter_nolakec, & - num_nolakep, filter_nolakep) -! -! !DESCRIPTION: -! Calculation of -! (1) water storage of intercepted precipitation -! (2) direct throughfall and canopy drainage of precipitation -! (3) the fraction of foliage covered by water and the fraction -! of foliage that is dry and transpiring. -! (4) snow layer initialization if the snow accumulation exceeds 10 mm. -! Note: The evaporation loss is taken off after the calculation of leaf -! temperature in the subroutine clm\_leaftem.f90, not in this subroutine. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varcon , only : tfrz, istice, istwet, istsoil, istice_mec, isturb, & - icol_roof, icol_sunwall, icol_shadewall - use clm_varcon , only : istcrop - use FracWetMod , only : FracWet - use clm_time_manager , only : get_step_size - use subgridAveMod, only : p2c - use SNICARMod , only : snw_rds_min - -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_nolakep ! number of pft non-lake points in pft filter - integer, intent(in) :: filter_nolakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/15/02, Peter Thornton: Migrated to new data structures. Required -! adding a PFT loop. -! 4/26/05, Peter Thornton: Made the canopy interception factor fpi max=0.25 -! the default behavior -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arrays -! - real(r8), pointer :: qflx_floodg(:) ! gridcell flux of flood water from RTM - real(r8), pointer :: qflx_floodc(:) ! column flux of flood water from RTM - integer , pointer :: cgridcell(:) ! columns's gridcell - integer , pointer :: clandunit(:) ! columns's landunit - integer , pointer :: pgridcell(:) ! pft's gridcell - integer , pointer :: plandunit(:) ! pft's landunit - integer , pointer :: pcolumn(:) ! pft's column - integer , pointer :: npfts(:) ! number of pfts in column - integer , pointer :: pfti(:) ! column's beginning pft index - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: ctype(:) ! column type - real(r8), pointer :: forc_rain(:) ! rain rate [mm/s] - real(r8), pointer :: forc_snow(:) ! snow rate [mm/s] - real(r8), pointer :: forc_t(:) ! atmospheric temperature (Kelvin) - logical , pointer :: do_capsnow(:) ! true => do snow capping - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: dewmx(:) ! Maximum allowed dew [mm] - integer , pointer :: frac_veg_nosno(:) ! fraction of veg not covered by snow (0/1 now) [-] - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: h2ocan_loss(:) ! canopy water mass balance term (column) - real(r8), pointer :: irrig_rate(:) ! current irrigation rate (applied if n_irrig_steps_left > 0) [mm/s] -! -! local pointers to original implicit inout arrays -! - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: h2ocan(:) ! total canopy water (mm H2O) - real(r8), pointer :: qflx_irrig(:) ! irrigation amount (mm/s) - integer, pointer :: n_irrig_steps_left(:) ! number of time steps for which we still need to irrigate today -! -! local pointers to original implicit out arrays -! - real(r8), pointer :: qflx_prec_intr(:) ! interception of precipitation [mm/s] - real(r8), pointer :: qflx_prec_grnd(:) ! water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_snwcp_liq(:) ! excess rainfall due to snow capping (mm H2O /s) [+] - real(r8), pointer :: qflx_snwcp_ice(:) ! excess snowfall due to snow capping (mm H2O /s) [+] - real(r8), pointer :: qflx_snow_grnd_pft(:) ! snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd_col(:) ! snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_rain_grnd(:) ! rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: fwet(:) ! fraction of canopy that is wet (0 to 1) - real(r8), pointer :: fdry(:) ! fraction of foliage that is green and dry [-] (new) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: z(:,:) ! layer thickness (m) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: frac_iceold(:,:) ! fraction of ice relative to the tot water - real(r8), pointer :: snw_rds(:,:) ! effective snow grain radius (col,lyr) [microns, m^-6] - real(r8), pointer :: mss_bcpho(:,:) ! mass of hydrophobic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcphi(:,:) ! mass of hydrophilic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bctot(:,:) ! total mass of BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bc_col(:) ! total column mass of BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bc_top(:) ! total top-layer mass of BC (col,lyr) [kg] - real(r8), pointer :: mss_ocpho(:,:) ! mass of hydrophobic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! mass of hydrophilic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_octot(:,:) ! total mass of OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_oc_col(:) ! total column mass of OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_oc_top(:) ! total top-layer mass of OC (col,lyr) [kg] - real(r8), pointer :: mss_dst1(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dsttot(:,:) ! total mass of dust in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst_col(:) ! total column mass of dust in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst_top(:) ! total top-layer mass of dust in snow (col,lyr) [kg] -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: f ! filter index - integer :: pi ! pft index - integer :: p ! pft index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! gridcell index - integer :: newnode ! flag when new snow node is set, (1=yes, 0=no) - real(r8) :: dtime ! land model time step (sec) - real(r8) :: h2ocanmx ! maximum allowed water on canopy [mm] - real(r8) :: fpi ! coefficient of interception - real(r8) :: xrun ! excess water that exceeds the leaf capacity [mm/s] - real(r8) :: dz_snowf ! layer thickness rate change due to precipitation [mm/s] - real(r8) :: bifall ! bulk density of newly fallen dry snow [kg/m3] - real(r8) :: fracsnow(lbp:ubp) ! frac of precipitation that is snow - real(r8) :: fracrain(lbp:ubp) ! frac of precipitation that is rain - real(r8) :: qflx_candrip(lbp:ubp) ! rate of canopy runoff and snow falling off canopy [mm/s] - real(r8) :: qflx_through_rain(lbp:ubp) ! direct rain throughfall [mm/s] - real(r8) :: qflx_through_snow(lbp:ubp) ! direct snow throughfall [mm/s] - real(r8) :: qflx_prec_grnd_snow(lbp:ubp) ! snow precipitation incident on ground [mm/s] - real(r8) :: qflx_prec_grnd_rain(lbp:ubp) ! rain precipitation incident on ground [mm/s] -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (gridcell-level) - - pgridcell => pft%gridcell - forc_rain => clm_a2l%forc_rain - forc_snow => clm_a2l%forc_snow - - ! Assign local pointers to derived type members (landunit-level) - - ltype => lun%itype - - ! Assign local pointers to derived type members (column-level) - - qflx_floodg => clm_a2l%forc_flood - qflx_floodc => cwf%qflx_floodc - cgridcell => col%gridcell - clandunit => col%landunit - ctype => col%itype - pfti => col%pfti - npfts => col%npfts - do_capsnow => cps%do_capsnow - forc_t => ces%forc_t - t_grnd => ces%t_grnd - snl => cps%snl - snowdp => cps%snowdp - h2osno => cws%h2osno - zi => cps%zi - dz => cps%dz - z => cps%z - frac_iceold => cps%frac_iceold - t_soisno => ces%t_soisno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - qflx_snow_grnd_col => pwf_a%qflx_snow_grnd - h2ocan_loss => cwf%h2ocan_loss - snw_rds => cps%snw_rds - mss_bcpho => cps%mss_bcpho - mss_bcphi => cps%mss_bcphi - mss_bctot => cps%mss_bctot - mss_bc_col => cps%mss_bc_col - mss_bc_top => cps%mss_bc_top - mss_ocpho => cps%mss_ocpho - mss_ocphi => cps%mss_ocphi - mss_octot => cps%mss_octot - mss_oc_col => cps%mss_oc_col - mss_oc_top => cps%mss_oc_top - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - mss_dsttot => cps%mss_dsttot - mss_dst_col => cps%mss_dst_col - mss_dst_top => cps%mss_dst_top - - ! Assign local pointers to derived type members (pft-level) - - plandunit => pft%landunit - pcolumn => pft%column - dewmx => pps%dewmx - frac_veg_nosno => pps%frac_veg_nosno - elai => pps%elai - esai => pps%esai - h2ocan => pws%h2ocan - qflx_prec_intr => pwf%qflx_prec_intr - qflx_prec_grnd => pwf%qflx_prec_grnd - qflx_snwcp_liq => pwf%qflx_snwcp_liq - qflx_snwcp_ice => pwf%qflx_snwcp_ice - qflx_snow_grnd_pft => pwf%qflx_snow_grnd - qflx_rain_grnd => pwf%qflx_rain_grnd - fwet => pps%fwet - fdry => pps%fdry - irrig_rate => cps%irrig_rate - n_irrig_steps_left => cps%n_irrig_steps_left - qflx_irrig => cwf%qflx_irrig - - ! Compute time step - - dtime = get_step_size() - - ! Start pft loop - - do f = 1, num_nolakep - p = filter_nolakep(f) - g = pgridcell(p) - l = plandunit(p) - c = pcolumn(p) - - ! Canopy interception and precipitation onto ground surface - ! Add precipitation to leaf water - - if (ltype(l)==istsoil .or. ltype(l)==istwet .or. ltype(l)==isturb .or. & - ltype(l)==istcrop) then - qflx_candrip(p) = 0._r8 ! rate of canopy runoff - qflx_through_snow(p) = 0._r8 ! rain precipitation direct through canopy - qflx_through_rain(p) = 0._r8 ! snow precipitation direct through canopy - qflx_prec_intr(p) = 0._r8 ! total intercepted precipitation - fracsnow(p) = 0._r8 ! fraction of input precip that is snow - fracrain(p) = 0._r8 ! fraction of input precip that is rain - - if (ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall) then - if (frac_veg_nosno(p) == 1 .and. (forc_rain(g) + forc_snow(g)) > 0._r8) then - - ! determine fraction of input precipitation that is snow and rain - - fracsnow(p) = forc_snow(g)/(forc_snow(g) + forc_rain(g)) - fracrain(p) = forc_rain(g)/(forc_snow(g) + forc_rain(g)) - - ! The leaf water capacities for solid and liquid are different, - ! generally double for snow, but these are of somewhat less - ! significance for the water budget because of lower evap. rate at - ! lower temperature. Hence, it is reasonable to assume that - ! vegetation storage of solid water is the same as liquid water. - h2ocanmx = dewmx(p) * (elai(p) + esai(p)) - - ! Coefficient of interception - ! set fraction of potential interception to max 0.25 - fpi = 0.25_r8*(1._r8 - exp(-0.5_r8*(elai(p) + esai(p)))) - - ! Direct throughfall - qflx_through_snow(p) = forc_snow(g) * (1._r8-fpi) - qflx_through_rain(p) = forc_rain(g) * (1._r8-fpi) - - ! Intercepted precipitation [mm/s] - qflx_prec_intr(p) = (forc_snow(g) + forc_rain(g)) * fpi - - ! Water storage of intercepted precipitation and dew - h2ocan(p) = max(0._r8, h2ocan(p) + dtime*qflx_prec_intr(p)) - - ! Initialize rate of canopy runoff and snow falling off canopy - qflx_candrip(p) = 0._r8 - - ! Excess water that exceeds the leaf capacity - xrun = (h2ocan(p) - h2ocanmx)/dtime - - ! Test on maximum dew on leaf - ! Note if xrun > 0 then h2ocan must be at least h2ocanmx - if (xrun > 0._r8) then - qflx_candrip(p) = xrun - h2ocan(p) = h2ocanmx - end if - - end if - end if - - else if (ltype(l)==istice .or. ltype(l)==istice_mec) then - - h2ocan(p) = 0._r8 - qflx_candrip(p) = 0._r8 - qflx_through_snow(p) = 0._r8 - qflx_through_rain(p) = 0._r8 - qflx_prec_intr(p) = 0._r8 - fracsnow(p) = 0._r8 - fracrain(p) = 0._r8 - - end if - - ! Precipitation onto ground (kg/(m2 s)) - ! PET, 1/18/2005: Added new terms for mass balance correction - ! due to dynamic pft weight shifting (column-level h2ocan_loss) - ! Because the fractionation between rain and snow is indeterminate if - ! rain + snow = 0, I am adding this very small flux only to the rain - ! components. - - if (ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall) then - if (frac_veg_nosno(p) == 0) then - qflx_prec_grnd_snow(p) = forc_snow(g) - qflx_prec_grnd_rain(p) = forc_rain(g) + h2ocan_loss(c) - else - qflx_prec_grnd_snow(p) = qflx_through_snow(p) + (qflx_candrip(p) * fracsnow(p)) - qflx_prec_grnd_rain(p) = qflx_through_rain(p) + (qflx_candrip(p) * fracrain(p)) + h2ocan_loss(c) - end if - ! Urban sunwall and shadewall have no intercepted precipitation - else - qflx_prec_grnd_snow(p) = 0. - qflx_prec_grnd_rain(p) = 0. - end if - - ! Determine whether we're irrigating here; set qflx_irrig appropriately - if (n_irrig_steps_left(c) > 0) then - qflx_irrig(c) = irrig_rate(c) - n_irrig_steps_left(c) = n_irrig_steps_left(c) - 1 - else - qflx_irrig(c) = 0._r8 - end if - - ! Add irrigation water directly onto ground (bypassing canopy interception) - ! Note that it's still possible that (some of) this irrigation water will runoff (as runoff is computed later) - qflx_prec_grnd_rain(p) = qflx_prec_grnd_rain(p) + qflx_irrig(c) - - ! Done irrigation - - qflx_prec_grnd(p) = qflx_prec_grnd_snow(p) + qflx_prec_grnd_rain(p) - - if (do_capsnow(c)) then - qflx_snwcp_liq(p) = qflx_prec_grnd_rain(p) - qflx_snwcp_ice(p) = qflx_prec_grnd_snow(p) - - qflx_snow_grnd_pft(p) = 0._r8 - qflx_rain_grnd(p) = 0._r8 - else - qflx_snwcp_liq(p) = 0._r8 - qflx_snwcp_ice(p) = 0._r8 - qflx_snow_grnd_pft(p) = qflx_prec_grnd_snow(p) ! ice onto ground (mm/s) - qflx_rain_grnd(p) = qflx_prec_grnd_rain(p) ! liquid water onto ground (mm/s) - end if - - end do ! (end pft loop) - - ! Determine the fraction of foliage covered by water and the - ! fraction of foliage that is dry and transpiring. - - call FracWet(num_nolakep, filter_nolakep) - - ! Update column level state variables for snow. - - call p2c(num_nolakec, filter_nolakec, qflx_snow_grnd_pft, qflx_snow_grnd_col) - -!rtm_flood: apply gridcell flood water flux to non-lake columns -! no inputs to urban wall columns, as above with atm inputs -!dir$ concurrent -!cdir nodep - do f = 1, num_nolakec - c = filter_nolakec(f) - g = cgridcell(c) - if (ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall) then - qflx_floodc(c) = qflx_floodg(g) - else - qflx_floodc(c) = 0._r8 - endif - enddo -!rtm_flood - - ! Determine snow height and snow water - - do f = 1, num_nolakec - c = filter_nolakec(f) - l = clandunit(c) - g = cgridcell(c) - - ! Use Alta relationship, Anderson(1976); LaChapelle(1961), - ! U.S.Department of Agriculture Forest Service, Project F, - ! Progress Rep. 1, Alta Avalanche Study Center:Snow Layer Densification. - - if (do_capsnow(c)) then - dz_snowf = 0._r8 - else - if (forc_t(c) > tfrz + 2._r8) then - bifall=50._r8 + 1.7_r8*(17.0_r8)**1.5_r8 - else if (forc_t(c) > tfrz - 15._r8) then - bifall=50._r8 + 1.7_r8*(forc_t(c) - tfrz + 15._r8)**1.5_r8 - else - bifall=50._r8 - end if - dz_snowf = qflx_snow_grnd_col(c)/bifall - snowdp(c) = snowdp(c) + dz_snowf*dtime - h2osno(c) = h2osno(c) + qflx_snow_grnd_col(c)*dtime ! snow water equivalent (mm) - - end if - - if (ltype(l)==istwet .and. t_grnd(c)>tfrz) then - h2osno(c)=0._r8 - snowdp(c)=0._r8 - end if - - ! When the snow accumulation exceeds 10 mm, initialize snow layer - ! Currently, the water temperature for the precipitation is simply set - ! as the surface air temperature - - newnode = 0 ! flag for when snow node will be initialized - if (snl(c) == 0 .and. qflx_snow_grnd_col(c) > 0.0_r8 .and. snowdp(c) >= 0.01_r8) then - newnode = 1 - snl(c) = -1 - dz(c,0) = snowdp(c) ! meter - z(c,0) = -0.5_r8*dz(c,0) - zi(c,-1) = -dz(c,0) - t_soisno(c,0) = min(tfrz, forc_t(c)) ! K - h2osoi_ice(c,0) = h2osno(c) ! kg/m2 - h2osoi_liq(c,0) = 0._r8 ! kg/m2 - frac_iceold(c,0) = 1._r8 - - - ! intitialize SNICAR variables for fresh snow: - snw_rds(c,0) = snw_rds_min - - mss_bcpho(c,:) = 0._r8 - mss_bcphi(c,:) = 0._r8 - mss_bctot(c,:) = 0._r8 - mss_bc_col(c) = 0._r8 - mss_bc_top(c) = 0._r8 - - mss_ocpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_octot(c,:) = 0._r8 - mss_oc_col(c) = 0._r8 - mss_oc_top(c) = 0._r8 - - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - mss_dsttot(c,:) = 0._r8 - mss_dst_col(c) = 0._r8 - mss_dst_top(c) = 0._r8 - end if - - ! The change of ice partial density of surface node due to precipitation. - ! Only ice part of snowfall is added here, the liquid part will be added - ! later. - - if (snl(c) < 0 .and. newnode == 0) then - h2osoi_ice(c,snl(c)+1) = h2osoi_ice(c,snl(c)+1)+dtime*qflx_snow_grnd_col(c) - dz(c,snl(c)+1) = dz(c,snl(c)+1)+dz_snowf*dtime - end if - - end do - - end subroutine Hydrology1 - -end module Hydrology1Mod diff --git a/src_clm40/biogeophys/Hydrology2Mod.F90 b/src_clm40/biogeophys/Hydrology2Mod.F90 deleted file mode 100644 index 759e9d3657..0000000000 --- a/src_clm40/biogeophys/Hydrology2Mod.F90 +++ /dev/null @@ -1,757 +0,0 @@ -module Hydrology2Mod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: Hydrology2Mod -! -! !DESCRIPTION: -! Calculation of soil/snow hydrology. -! -! !USES: - use clm_varctl, only : iulog, use_cn - use abortutils, only : endrun -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Hydrology2 ! Calculates soil/snow hydrology -! -! !REVISION HISTORY: -! 2/28/02 Peter Thornton: Migrated to new data structures. -! 7/12/03 Forrest Hoffman ,Mariana Vertenstein : Migrated to vector code -! 11/05/03 Peter Thornton: Added calculation of soil water potential -! for use in CN phenology code. -! 04/25/07 Keith Oleson: CLM3.5 Hydrology -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Hydrology2 -! -! !INTERFACE: - subroutine Hydrology2(lbc, ubc, lbp, ubp, & - num_nolakec, filter_nolakec, & - num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - num_snowc, filter_snowc, & - num_nosnowc, filter_nosnowc) -! -! !DESCRIPTION: -! This is the main subroutine to execute the calculation of soil/snow -! hydrology -! Calling sequence is: -! Hydrology2: surface hydrology driver -! -> SnowWater: change of snow mass and snow water onto soil -! -> SurfaceRunoff: surface runoff -! -> Infiltration: infiltration into surface soil layer -! -> SoilWater: soil water movement between layers -! -> Tridiagonal tridiagonal matrix solution -! -> Drainage: subsurface runoff -! -> SnowCompaction: compaction of snow layers -! -> CombineSnowLayers: combine snow layers that are thinner than minimum -! -> DivideSnowLayers: subdivide snow layers that are thicker than maximum -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varcon , only : denh2o, denice, spval, & - istice, istwet, istsoil, isturb, istice_mec, & - icol_roof, icol_road_imperv, icol_road_perv, icol_sunwall, & - icol_shadewall - use clm_varcon , only : istcrop - use clm_varctl , only : glc_dyntopo - use clm_varpar , only : nlevgrnd, nlevsno, nlevsoi - use SnowHydrologyMod, only : SnowCompaction, CombineSnowLayers, DivideSnowLayers, & - SnowWater, BuildSnowFilter - use SoilHydrologyMod, only : Infiltration, SoilWater, Drainage, SurfaceRunoff - use clm_time_manager, only : get_step_size, get_nstep, is_perpetual - -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: lbp, ubp ! pft bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(ubc-lbc+1)! column filter for soil points - integer, intent(in) :: num_urbanc ! number of column urban points in column filter - integer, intent(in) :: filter_urbanc(ubc-lbc+1) ! column filter for urban points - integer :: num_snowc ! number of column snow points - integer :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer :: num_nosnowc ! number of column non-snow points - integer :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! -!rtm_flood - real(r8), pointer :: qflx_floodg(:) ! gridcell flux of flood water from RTM -!rtm_flood - integer , pointer :: cgridcell(:) ! column's gridcell - integer , pointer :: clandunit(:) ! column's landunit - integer , pointer :: ityplun(:) ! landunit type - integer , pointer :: ctype(:) ! column type - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: h2ocan(:) ! canopy water (mm H2O) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" - real(r8), pointer :: z(:,:) ! layer depth (m) - real(r8), pointer :: forc_rain(:) ! rain rate [mm/s] - real(r8), pointer :: forc_snow(:) ! snow rate [mm/s] - real(r8), pointer :: begwb(:) ! water mass begining of the time step - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: bsw2(:,:) ! Clapp and Hornberger "b" for CN code - real(r8), pointer :: psisat(:,:) ! soil water potential at saturation for CN code (MPa) - real(r8), pointer :: vwcsat(:,:) ! volumetric water content at saturation for CN code (m3/m3) -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) - real(r8), pointer :: zi(:,:) ! interface depth (m) - real(r8), pointer :: zwt(:) ! water table depth (m) - real(r8), pointer :: fcov(:) ! fractional impermeable area - real(r8), pointer :: fsat(:) ! fractional area with water table at surface - real(r8), pointer :: wa(:) ! water in the unconfined aquifer (mm) - real(r8), pointer :: qcharge(:) ! aquifer recharge rate (mm/s) - real(r8), pointer :: smp_l(:,:) ! soil matrix potential [mm] - real(r8), pointer :: hk_l(:,:) ! hydraulic conductivity (mm/s) - real(r8), pointer :: qflx_rsub_sat(:) ! soil saturation excess [mm h2o/s] -! -! local pointers to implicit out arguments -! - real(r8), pointer :: endwb(:) ! water mass end of the time step - real(r8), pointer :: wf(:) ! soil water as frac. of whc for top 0.5 m - real(r8), pointer :: snowice(:) ! average snow ice lens - real(r8), pointer :: snowliq(:) ! average snow liquid water - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: t_soi_10cm(:) ! soil temperature in top 10cm of soil (Kelvin) - real(r8), pointer :: h2osoi_liqice_10cm(:) ! liquid water + ice lens in top 10cm of soil (kg/m2) - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), pointer :: qflx_drain(:) ! sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_surf(:) ! surface runoff (mm H2O /s) - real(r8), pointer :: qflx_infl(:) ! infiltration (mm H2O /s) - real(r8), pointer :: qflx_qrgwl(:) ! qflx_surf at glaciers, wetlands, lakes - real(r8), pointer :: qflx_irrig(:) ! irrigation flux (mm H2O /s) - real(r8), pointer :: qflx_runoff(:) ! total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qflx_runoff_u(:) ! Urban total runoff (qflx_drain+qflx_surf) (mm H2O /s) - real(r8), pointer :: qflx_runoff_r(:) ! Rural total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: t_grnd_u(:) ! Urban ground temperature (Kelvin) - real(r8), pointer :: t_grnd_r(:) ! Rural ground temperature (Kelvin) - real(r8), pointer :: qflx_snwcp_ice(:)! excess snowfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) - - real(r8), pointer :: snot_top(:) ! snow temperature in top layer (col) [K] - real(r8), pointer :: dTdz_top(:) ! temperature gradient in top layer (col) [K m-1] - real(r8), pointer :: snw_rds(:,:) ! effective snow grain radius (col,lyr) [microns, m^-6] - real(r8), pointer :: snw_rds_top(:) ! effective snow grain size, top layer(col) [microns] - real(r8), pointer :: sno_liq_top(:) ! liquid water fraction in top snow layer (col) [frc] - real(r8), pointer :: frac_sno(:) ! snow cover fraction (col) [frc] - real(r8), pointer :: h2osno_top(:) ! mass of snow in top layer (col) [kg] - - real(r8), pointer :: mss_bcpho(:,:) ! mass of hydrophobic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcphi(:,:) ! mass of hydrophillic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bctot(:,:) ! total mass of BC (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_bc_col(:) ! total mass of BC in snow column (col) [kg] - real(r8), pointer :: mss_bc_top(:) ! total mass of BC in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_bcphi(:,:) ! mass concentration of BC species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_bcpho(:,:) ! mass concentration of BC species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_ocpho(:,:) ! mass of hydrophobic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! mass of hydrophillic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_octot(:,:) ! total mass of OC (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_oc_col(:) ! total mass of OC in snow column (col) [kg] - real(r8), pointer :: mss_oc_top(:) ! total mass of OC in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_ocphi(:,:) ! mass concentration of OC species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocpho(:,:) ! mass concentration of OC species 2 (col,lyr) [kg/kg] - - real(r8), pointer :: mss_dst1(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dsttot(:,:) ! total mass of dust in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst_col(:) ! total mass of dust in snow column (col) [kg] - real(r8), pointer :: mss_dst_top(:) ! total mass of dust in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_dst1(:,:) ! mass concentration of dust species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst2(:,:) ! mass concentration of dust species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst3(:,:) ! mass concentration of dust species 3 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst4(:,:) ! mass concentration of dust species 4 (col,lyr) [kg/kg] - logical , pointer :: do_capsnow(:) ! true => do snow capping - real(r8), pointer :: qflx_glcice(:) ! flux of new glacier ice (mm H2O /s) - real(r8), pointer :: qflx_glcice_frz(:) ! ice growth (positive definite) (mm H2O/s) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: g,l,c,j,fc ! indices - integer :: nstep ! time step number - real(r8) :: dtime ! land model time step (sec) - real(r8) :: vol_liq(lbc:ubc,1:nlevgrnd)! partial volume of liquid water in layer - real(r8) :: icefrac(lbc:ubc,1:nlevgrnd)! ice fraction in layer - real(r8) :: dwat(lbc:ubc,1:nlevgrnd) ! change in soil water - real(r8) :: hk(lbc:ubc,1:nlevgrnd) ! hydraulic conductivity (mm h2o/s) - real(r8) :: dhkdw(lbc:ubc,1:nlevgrnd) ! d(hk)/d(vol_liq) - real(r8) :: psi,vwc,fsattmp ! temporary variables for soilpsi calculation - real(r8) :: watdry ! temporary - real(r8) :: rwat(lbc:ubc) ! soil water wgted by depth to maximum depth of 0.5 m - real(r8) :: swat(lbc:ubc) ! same as rwat but at saturation - real(r8) :: rz(lbc:ubc) ! thickness of soil layers contributing to rwat (m) - real(r8) :: tsw ! volumetric soil water to 0.5 m - real(r8) :: stsw ! volumetric soil water to 0.5 m at saturation - real(r8) :: snowmass ! liquid+ice snow mass in a layer [kg/m2] - real(r8) :: snowcap_scl_fct ! temporary factor used to correct for snow capping - real(r8) :: fracl ! fraction of soil layer contributing to 10cm total soil water - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (gridcell-level) - - forc_rain => clm_a2l%forc_rain - forc_snow => clm_a2l%forc_snow - - ! Assign local pointers to derived subtypes components (landunit-level) - - ityplun => lun%itype - - ! Assign local pointers to derived subtypes components (column-level) - -!rtm_flood - qflx_floodg => clm_a2l%forc_flood -!rtm_flood - cgridcell => col%gridcell - clandunit => col%landunit - ctype => col%itype - snl => cps%snl - t_grnd => ces%t_grnd - h2ocan => pws_a%h2ocan - h2osno => cws%h2osno - wf => cps%wf - snowice => cws%snowice - snowliq => cws%snowliq - zwt => cws%zwt - fcov => cws%fcov - fsat => cws%fsat - wa => cws%wa - qcharge => cws%qcharge - watsat => cps%watsat - sucsat => cps%sucsat - bsw => cps%bsw - z => cps%z - dz => cps%dz - zi => cps%zi - t_soisno => ces%t_soisno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - h2osoi_vol => cws%h2osoi_vol - t_soi_10cm => ces%t_soi_10cm - h2osoi_liqice_10cm => cws%h2osoi_liqice_10cm - qflx_evap_tot => pwf_a%qflx_evap_tot - qflx_drain => cwf%qflx_drain - qflx_surf => cwf%qflx_surf - qflx_infl => cwf%qflx_infl - qflx_qrgwl => cwf%qflx_qrgwl - qflx_irrig => cwf%qflx_irrig - endwb => cwbal%endwb - begwb => cwbal%begwb - bsw2 => cps%bsw2 - psisat => cps%psisat - vwcsat => cps%vwcsat - soilpsi => cps%soilpsi - smp_l => cws%smp_l - hk_l => cws%hk_l - qflx_rsub_sat => cwf%qflx_rsub_sat - qflx_runoff => cwf%qflx_runoff - qflx_runoff_u => cwf%qflx_runoff_u - qflx_runoff_r => cwf%qflx_runoff_r - t_grnd_u => ces%t_grnd_u - t_grnd_r => ces%t_grnd_r - snot_top => cps%snot_top - dTdz_top => cps%dTdz_top - snw_rds => cps%snw_rds - snw_rds_top => cps%snw_rds_top - sno_liq_top => cps%sno_liq_top - frac_sno => cps%frac_sno - h2osno_top => cps%h2osno_top - mss_bcpho => cps%mss_bcpho - mss_bcphi => cps%mss_bcphi - mss_bctot => cps%mss_bctot - mss_bc_col => cps%mss_bc_col - mss_bc_top => cps%mss_bc_top - mss_cnc_bcphi => cps%mss_cnc_bcphi - mss_cnc_bcpho => cps%mss_cnc_bcpho - mss_ocpho => cps%mss_ocpho - mss_ocphi => cps%mss_ocphi - mss_octot => cps%mss_octot - mss_oc_col => cps%mss_oc_col - mss_oc_top => cps%mss_oc_top - mss_cnc_ocphi => cps%mss_cnc_ocphi - mss_cnc_ocpho => cps%mss_cnc_ocpho - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - mss_dsttot => cps%mss_dsttot - mss_dst_col => cps%mss_dst_col - mss_dst_top => cps%mss_dst_top - mss_cnc_dst1 => cps%mss_cnc_dst1 - mss_cnc_dst2 => cps%mss_cnc_dst2 - mss_cnc_dst3 => cps%mss_cnc_dst3 - mss_cnc_dst4 => cps%mss_cnc_dst4 - do_capsnow => cps%do_capsnow - qflx_snwcp_ice => pwf_a%qflx_snwcp_ice - qflx_glcice => cwf%qflx_glcice - qflx_glcice_frz => cwf%qflx_glcice_frz - - ! Determine time step and step size - - nstep = get_nstep() - dtime = get_step_size() - - ! Determine initial snow/no-snow filters (will be modified possibly by - ! routines CombineSnowLayers and DivideSnowLayers below - - call BuildSnowFilter(lbc, ubc, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - - ! Determine the change of snow mass and the snow water onto soil - - call SnowWater(lbc, ubc, num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - - ! Determine soil hydrology - - call SurfaceRunoff(lbc, ubc, lbp, ubp, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - vol_liq, icefrac ) - - call Infiltration(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc) - - call SoilWater(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - vol_liq, dwat, hk, dhkdw) - - call Drainage(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - vol_liq, hk, icefrac) - - if (.not. is_perpetual()) then - - ! Natural compaction and metamorphosis. - - call SnowCompaction(lbc, ubc, num_snowc, filter_snowc) - - ! Combine thin snow elements - - call CombineSnowLayers(lbc, ubc, num_snowc, filter_snowc) - - ! Divide thick snow elements - - call DivideSnowLayers(lbc, ubc, num_snowc, filter_snowc) - - else - - do fc = 1, num_snowc - c = filter_snowc(fc) - h2osno(c) = 0._r8 - end do - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - h2osno(c) = h2osno(c) + h2osoi_ice(c,j) + h2osoi_liq(c,j) - end if - end do - end do - - end if - - ! Set empty snow layers to zero - - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j <= snl(c) .and. snl(c) > -nlevsno) then - h2osoi_ice(c,j) = 0._r8 - h2osoi_liq(c,j) = 0._r8 - t_soisno(c,j) = 0._r8 - dz(c,j) = 0._r8 - z(c,j) = 0._r8 - zi(c,j-1) = 0._r8 - end if - end do - end do - - ! Build new snow filter - - call BuildSnowFilter(lbc, ubc, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - - ! Vertically average t_soisno and sum of h2osoi_liq and h2osoi_ice - ! over all snow layers for history output - - do fc = 1, num_nolakec - c = filter_nolakec(fc) - snowice(c) = 0._r8 - snowliq(c) = 0._r8 - end do - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - snowice(c) = snowice(c) + h2osoi_ice(c,j) - snowliq(c) = snowliq(c) + h2osoi_liq(c,j) - end if - end do - end do - - ! Determine ground temperature, ending water balance and volumetric soil water - ! Calculate soil temperature and total water (liq+ice) in top 10cm of soil - do fc = 1, num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (ityplun(l) /= isturb) then - t_soi_10cm(c) = 0._r8 - h2osoi_liqice_10cm(c) = 0._r8 - end if - end do - do j = 1, nlevsoi - do fc = 1, num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (ityplun(l) /= isturb) then - if (zi(c,j) <= 0.1_r8) then - fracl = 1._r8 - t_soi_10cm(c) = t_soi_10cm(c) + t_soisno(c,j)*dz(c,j)*fracl - h2osoi_liqice_10cm(c) = h2osoi_liqice_10cm(c) + (h2osoi_liq(c,j)+h2osoi_ice(c,j))* & - fracl - else - if (zi(c,j) > 0.1_r8 .and. zi(c,j-1) .lt. 0.1_r8) then - fracl = (0.1_r8 - zi(c,j-1))/dz(c,j) - t_soi_10cm(c) = t_soi_10cm(c) + t_soisno(c,j)*dz(c,j)*fracl - h2osoi_liqice_10cm(c) = h2osoi_liqice_10cm(c) + (h2osoi_liq(c,j)+h2osoi_ice(c,j))* & - fracl - end if - end if - end if - end do - end do - - do fc = 1, num_nolakec - - c = filter_nolakec(fc) - l = clandunit(c) - - t_grnd(c) = t_soisno(c,snl(c)+1) - if (ityplun(l) /= isturb) then - t_soi_10cm(c) = t_soi_10cm(c)/0.1_r8 - end if - if (ityplun(l)==isturb) then - t_grnd_u(c) = t_soisno(c,snl(c)+1) - end if - if (ityplun(l)==istsoil .or. ityplun(l)==istcrop) then - t_grnd_r(c) = t_soisno(c,snl(c)+1) - end if - if (ctype(c) == icol_roof .or. ctype(c) == icol_sunwall & - .or. ctype(c) == icol_shadewall .or. ctype(c) == icol_road_imperv) then - endwb(c) = h2ocan(c) + h2osno(c) - else - endwb(c) = h2ocan(c) + h2osno(c) + wa(c) - end if - end do - - do j = 1, nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - endwb(c) = endwb(c) + h2osoi_ice(c,j) + h2osoi_liq(c,j) - h2osoi_vol(c,j) = h2osoi_liq(c,j)/(dz(c,j)*denh2o) + h2osoi_ice(c,j)/(dz(c,j)*denice) - end do - end do - - ! Determine wetland and land ice hydrology (must be placed here - ! since need snow updated from CombineSnowLayers) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - g = cgridcell(c) - if (ityplun(l)==istwet .or. ityplun(l)==istice & - .or. ityplun(l)==istice_mec) then - qflx_drain(c) = 0._r8 - qflx_irrig(c) = 0._r8 - qflx_surf(c) = 0._r8 - qflx_infl(c) = 0._r8 - -!rtm_flood: add flood water flux to runoff for wetlands/glaciers - qflx_qrgwl(c) = forc_rain(g) + forc_snow(g) + qflx_floodg(g) - qflx_evap_tot(c) - qflx_snwcp_ice(c) - & -!rtm_flood - (endwb(c)-begwb(c))/dtime - ! For dynamic topography, add meltwater from glacier_mec ice to the runoff. - ! (Negative qflx_glcice => positive contribution to runoff) - ! Note: The meltwater contribution is computed in PhaseChanges (part of Biogeophysics2). - ! This code will not work if Hydrology2 is called before Biogeophysics2, or if - ! qflx_snwcp_ice has alread been included in qflx_glcice. - ! (The snwcp flux is added to qflx_glcice later in this subroutine.) - - if (glc_dyntopo .and. ityplun(l)==istice_mec) then - qflx_qrgwl(c) = qflx_qrgwl(c) - qflx_glcice(c) ! meltwater from melted ice - endif - fcov(c) = spval - fsat(c) = spval - qcharge(c) = spval - qflx_rsub_sat(c) = spval - else if (ityplun(l) == isturb .and. ctype(c) /= icol_road_perv) then - fcov(c) = spval - fsat(c) = spval - qcharge(c) = spval - qflx_rsub_sat(c) = spval - end if - - ! If snow exceeds the thickness limit in glacier_mec columns, convert to an ice flux. - ! For dynamic glacier topography, remove qflx_snwcp_ice from the runoff. - ! Note that qflx_glcice can also have a negative component from melting of bare ice, - ! as computed in SoilTemperatureMod.F90 - - if (ityplun(l)==istice_mec) then - - qflx_glcice_frz(c) = qflx_snwcp_ice(c) - qflx_glcice(c) = qflx_glcice(c) + qflx_glcice_frz(c) - - ! For dynamic topography, set qflx_snwcp_ice = 0 so that this ice mass does not run off. - ! For static topography, qflx_glc_ice is passed to the ice sheet model, but the - ! CLM runoff terms are not changed. - - if (glc_dyntopo) qflx_snwcp_ice(c) = 0._r8 - - endif ! istice_mec - - qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_qrgwl(c) - if (ityplun(l)==istsoil .and. col%wtgcell(c) > 0.0_r8 ) then - qflx_runoff(c) = qflx_runoff(c) - qflx_irrig(c) - end if - if (ityplun(l)==isturb) then - qflx_runoff_u(c) = qflx_runoff(c) - else if (ityplun(l)==istsoil .or. ityplun(l)==istcrop) then - qflx_runoff_r(c) = qflx_runoff(c) - end if - - end do - - if (use_cn) then - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - if (h2osoi_liq(c,j) > 0._r8) then - vwc = h2osoi_liq(c,j)/(dz(c,j)*denh2o) - - ! the following limit set to catch very small values of - ! fractional saturation that can crash the calculation of psi - - fsattmp = max(vwc/vwcsat(c,j), 0.001_r8) - psi = psisat(c,j) * (fsattmp)**bsw2(c,j) - soilpsi(c,j) = min(max(psi,-15.0_r8),0._r8) - else - soilpsi(c,j) = -15.0_r8 - end if - end do - end do - end if - - if (use_cn) then - ! Available soil water up to a depth of 0.5 m. - ! Potentially available soil water (=whc) up to a depth of 0.5 m. - ! Water content as fraction of whc up to a depth of 0.5 m. - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - rwat(c) = 0._r8 - swat(c) = 0._r8 - rz(c) = 0._r8 - end do - - do j = 1, nlevgrnd - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - !if (z(c,j)+0.5_r8*dz(c,j) <= 0.5_r8) then - if (z(c,j)+0.5_r8*dz(c,j) <= 0.05_r8) then - watdry = watsat(c,j) * (316230._r8/sucsat(c,j)) ** (-1._r8/bsw(c,j)) - rwat(c) = rwat(c) + (h2osoi_vol(c,j)-watdry) * dz(c,j) - swat(c) = swat(c) + (watsat(c,j) -watdry) * dz(c,j) - rz(c) = rz(c) + dz(c,j) - end if - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (rz(c) /= 0._r8) then - tsw = rwat(c)/rz(c) - stsw = swat(c)/rz(c) - else - watdry = watsat(c,1) * (316230._r8/sucsat(c,1)) ** (-1._r8/bsw(c,1)) - tsw = h2osoi_vol(c,1) - watdry - stsw = watsat(c,1) - watdry - end if - wf(c) = tsw/stsw - end do - end if - - - ! Calculate column-integrated aerosol masses, and - ! mass concentrations for radiative calculations and output - ! (based on new snow level state, after SnowFilter is rebuilt. - ! NEEDS TO BE AFTER SnowFiler is rebuilt, otherwise there - ! can be zero snow layers but an active column in filter) - - do fc = 1, num_snowc - c = filter_snowc(fc) - - ! Zero column-integrated aerosol mass before summation - mss_bc_col(c) = 0._r8 - mss_oc_col(c) = 0._r8 - mss_dst_col(c) = 0._r8 - - do j = -nlevsno+1, 0 - - ! layer mass of snow: - snowmass = h2osoi_ice(c,j)+h2osoi_liq(c,j) - - ! Correct the top layer aerosol mass to account for snow capping. - ! This approach conserves the aerosol mass concentration - ! (but not the aerosol amss) when snow-capping is invoked - - if (j == snl(c)+1) then - if (do_capsnow(c)) then - snowcap_scl_fct = snowmass / (snowmass+(qflx_snwcp_ice(c)*dtime)) - - mss_bcpho(c,j) = mss_bcpho(c,j)*snowcap_scl_fct - mss_bcphi(c,j) = mss_bcphi(c,j)*snowcap_scl_fct - mss_ocpho(c,j) = mss_ocpho(c,j)*snowcap_scl_fct - mss_ocphi(c,j) = mss_ocphi(c,j)*snowcap_scl_fct - - mss_dst1(c,j) = mss_dst1(c,j)*snowcap_scl_fct - mss_dst2(c,j) = mss_dst2(c,j)*snowcap_scl_fct - mss_dst3(c,j) = mss_dst3(c,j)*snowcap_scl_fct - mss_dst4(c,j) = mss_dst4(c,j)*snowcap_scl_fct - endif - endif - - if (j >= snl(c)+1) then - mss_bctot(c,j) = mss_bcpho(c,j) + mss_bcphi(c,j) - mss_bc_col(c) = mss_bc_col(c) + mss_bctot(c,j) - mss_cnc_bcphi(c,j) = mss_bcphi(c,j) / snowmass - mss_cnc_bcpho(c,j) = mss_bcpho(c,j) / snowmass - - mss_octot(c,j) = mss_ocpho(c,j) + mss_ocphi(c,j) - mss_oc_col(c) = mss_oc_col(c) + mss_octot(c,j) - mss_cnc_ocphi(c,j) = mss_ocphi(c,j) / snowmass - mss_cnc_ocpho(c,j) = mss_ocpho(c,j) / snowmass - - mss_dsttot(c,j) = mss_dst1(c,j) + mss_dst2(c,j) + mss_dst3(c,j) + mss_dst4(c,j) - mss_dst_col(c) = mss_dst_col(c) + mss_dsttot(c,j) - mss_cnc_dst1(c,j) = mss_dst1(c,j) / snowmass - mss_cnc_dst2(c,j) = mss_dst2(c,j) / snowmass - mss_cnc_dst3(c,j) = mss_dst3(c,j) / snowmass - mss_cnc_dst4(c,j) = mss_dst4(c,j) / snowmass - - else - !set variables of empty snow layers to zero - snw_rds(c,j) = 0._r8 - - mss_bcpho(c,j) = 0._r8 - mss_bcphi(c,j) = 0._r8 - mss_bctot(c,j) = 0._r8 - mss_cnc_bcphi(c,j) = 0._r8 - mss_cnc_bcpho(c,j) = 0._r8 - - mss_ocpho(c,j) = 0._r8 - mss_ocphi(c,j) = 0._r8 - mss_octot(c,j) = 0._r8 - mss_cnc_ocphi(c,j) = 0._r8 - mss_cnc_ocpho(c,j) = 0._r8 - - mss_dst1(c,j) = 0._r8 - mss_dst2(c,j) = 0._r8 - mss_dst3(c,j) = 0._r8 - mss_dst4(c,j) = 0._r8 - mss_dsttot(c,j) = 0._r8 - mss_cnc_dst1(c,j) = 0._r8 - mss_cnc_dst2(c,j) = 0._r8 - mss_cnc_dst3(c,j) = 0._r8 - mss_cnc_dst4(c,j) = 0._r8 - endif - enddo - - ! top-layer diagnostics - h2osno_top(c) = h2osoi_ice(c,snl(c)+1) + h2osoi_liq(c,snl(c)+1) - mss_bc_top(c) = mss_bctot(c,snl(c)+1) - mss_oc_top(c) = mss_octot(c,snl(c)+1) - mss_dst_top(c) = mss_dsttot(c,snl(c)+1) - enddo - - ! Zero mass variables in columns without snow - do fc = 1, num_nosnowc - c = filter_nosnowc(fc) - - h2osno_top(c) = 0._r8 - snw_rds(c,:) = 0._r8 - - mss_bc_top(c) = 0._r8 - mss_bc_col(c) = 0._r8 - mss_bcpho(c,:) = 0._r8 - mss_bcphi(c,:) = 0._r8 - mss_bctot(c,:) = 0._r8 - mss_cnc_bcphi(c,:) = 0._r8 - mss_cnc_bcpho(c,:) = 0._r8 - - mss_oc_top(c) = 0._r8 - mss_oc_col(c) = 0._r8 - mss_ocpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_octot(c,:) = 0._r8 - mss_cnc_ocphi(c,:) = 0._r8 - mss_cnc_ocpho(c,:) = 0._r8 - - mss_dst_top(c) = 0._r8 - mss_dst_col(c) = 0._r8 - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - mss_dsttot(c,:) = 0._r8 - mss_cnc_dst1(c,:) = 0._r8 - mss_cnc_dst2(c,:) = 0._r8 - mss_cnc_dst3(c,:) = 0._r8 - mss_cnc_dst4(c,:) = 0._r8 - - ! top-layer diagnostics (spval is not averaged when computing history fields) - snot_top(c) = spval - dTdz_top(c) = spval - snw_rds_top(c) = spval - sno_liq_top(c) = spval - enddo - - end subroutine Hydrology2 - -end module Hydrology2Mod diff --git a/src_clm40/biogeophys/HydrologyLakeMod.F90 b/src_clm40/biogeophys/HydrologyLakeMod.F90 deleted file mode 100644 index 09207e6e35..0000000000 --- a/src_clm40/biogeophys/HydrologyLakeMod.F90 +++ /dev/null @@ -1,322 +0,0 @@ -module HydrologyLakeMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: HydrologyLakeMod -! -! !DESCRIPTION: -! Calculate lake hydrology -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: HydrologyLake -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: HydrologyLake -! -! !INTERFACE: - subroutine HydrologyLake(lbp, ubp, num_lakep, filter_lakep) -! -! !DESCRIPTION: -! Calculate lake hydrology -! -! WARNING: This subroutine assumes lake columns have one and only one pft. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_time_manager, only : get_step_size - use clm_varcon , only : hfus, tfrz, spval -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: num_lakep ! number of pft non-lake points in pft filter - integer, intent(in) :: filter_lakep(ubp-lbp+1) ! pft filter for non-lake points -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 3/4/02: Peter Thornton; Migrated to new data structures. -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arrays -! - integer , pointer :: pcolumn(:) !pft's column index - integer , pointer :: pgridcell(:) !pft's gridcell index - real(r8), pointer :: begwb(:) !water mass begining of the time step - real(r8), pointer :: forc_snow(:) !snow rate [mm/s] - real(r8), pointer :: forc_rain(:) !rain rate [mm/s] - logical , pointer :: do_capsnow(:) !true => do snow capping - real(r8), pointer :: t_grnd(:) !ground temperature (Kelvin) - real(r8), pointer :: qmelt(:) !snow melt [mm/s] - real(r8), pointer :: qflx_evap_soi(:) !soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot(:) !qflx_evap_soi + qflx_evap_can + qflx_tran_veg -! -! local pointers to implicit inout arrays -! - real(r8), pointer :: h2osno(:) !snow water (mm H2O) -! -! local pointers to implicit out arrays -! -!rtm_flood - real(r8), pointer :: qflx_floodg(:) ! gridcell flux of flood water from RTM - real(r8), pointer :: qflx_floodc(:) ! column flux of flood water from RTM -!rtm_flood - real(r8), pointer :: endwb(:) !water mass end of the time step - real(r8), pointer :: snowdp(:) !snow height (m) - real(r8), pointer :: snowice(:) !average snow ice lens - real(r8), pointer :: snowliq(:) !average snow liquid water - real(r8), pointer :: qflx_rain_grnd(:)!rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_rain_grnd_col(:)!rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd(:)!snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd_col(:)!snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: eflx_snomelt(:) !snow melt heat flux (W/m**2) - real(r8), pointer :: qflx_infl(:) !infiltration (mm H2O /s) - real(r8), pointer :: qflx_snomelt(:) !snow melt (mm H2O /s) - real(r8), pointer :: qflx_surf(:) !surface runoff (mm H2O /s) - real(r8), pointer :: qflx_drain(:) !sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_irrig(:) !irrigation flux (mm H2O /s) - real(r8), pointer :: qflx_qrgwl(:) !qflx_surf at glaciers, wetlands, lakes - real(r8), pointer :: qflx_runoff(:) !total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qflx_snwcp_ice(:)!excess snowfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: qflx_snwcp_ice_col(:)!excess snowfall due to snow capping (mm H2O /s) [+]` - real(r8), pointer :: qflx_evap_tot_col(:) !pft quantity averaged to the column (assuming one pft) - real(r8), pointer :: qflx_evap_grnd(:)! ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_evap_grnd_col(:)! ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_sub_snow(:) ! sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_sub_snow_col(:) ! sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow(:) ! surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow_col(:) ! surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd(:) ! ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd_col(:) ! ground surface dew formation (mm H2O /s) [+] - real(r8) ,pointer :: soilalpha(:) !factor that reduces ground saturated specific humidity (-) - real(r8), pointer :: zwt(:) !water table depth - real(r8), pointer :: fcov(:) !fractional impermeable area - real(r8), pointer :: fsat(:) !fractional area with water table at surface - real(r8), pointer :: qcharge(:) !aquifer recharge rate (mm/s) - real(r8), pointer :: qflx_top_soil(:) ! net water input into soil from top (mm/s) - real(r8), pointer :: qflx_prec_grnd(:) ! water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_prec_grnd_col(:) ! water onto ground including canopy runoff [kg/(m2 s)] -! -! local pointers to implicit out multi-level arrays -! - real(r8), pointer :: rootr_column(:,:) !effective fraction of roots in each soil layer - real(r8), pointer :: h2osoi_vol(:,:) !volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) - real(r8), pointer :: qflx_snofrz_col(:)!column-integrated snow freezing rate (kg m-2 s-1) [+] -! -! -! !OTHER LOCAL VARIABLES: -!EOP - real(r8), parameter :: snow_bd = 250._r8 !constant snow bulk density - integer :: fp, p, c, g ! indices - real(r8) :: dtime ! land model time step (sec) -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type gridcell members - - forc_snow => clm_a2l%forc_snow - forc_rain => clm_a2l%forc_rain - - ! Assign local pointers to derived type column members - -!rtm_flood: add flooding terms - qflx_floodg => clm_a2l%forc_flood - qflx_floodc => cwf%qflx_floodc -!rtm_flood - begwb => cwbal%begwb - endwb => cwbal%endwb - do_capsnow => cps%do_capsnow - snowdp => cps%snowdp - t_grnd => ces%t_grnd - h2osno => cws%h2osno - snowice => cws%snowice - snowliq => cws%snowliq - eflx_snomelt => cef%eflx_snomelt - qmelt => cwf%qmelt - qflx_snomelt => cwf%qflx_snomelt - qflx_surf => cwf%qflx_surf - qflx_qrgwl => cwf%qflx_qrgwl - qflx_runoff => cwf%qflx_runoff - qflx_snwcp_ice_col => pwf_a%qflx_snwcp_ice - qflx_drain => cwf%qflx_drain - qflx_irrig => cwf%qflx_irrig - qflx_infl => cwf%qflx_infl - rootr_column => cps%rootr_column - h2osoi_vol => cws%h2osoi_vol - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - qflx_evap_tot_col => pwf_a%qflx_evap_tot - soilalpha => cws%soilalpha - zwt => cws%zwt - fcov => cws%fcov - fsat => cws%fsat - qcharge => cws%qcharge - qflx_snofrz_col => cwf%qflx_snofrz_col - qflx_top_soil => cwf%qflx_top_soil - qflx_prec_grnd_col => pwf_a%qflx_prec_grnd - qflx_evap_grnd_col => pwf_a%qflx_evap_grnd - qflx_dew_grnd_col => pwf_a%qflx_dew_grnd - qflx_dew_snow_col => pwf_a%qflx_dew_snow - qflx_sub_snow_col => pwf_a%qflx_sub_snow - qflx_rain_grnd_col => pwf_a%qflx_rain_grnd - qflx_snow_grnd_col => pwf_a%qflx_snow_grnd - - ! Assign local pointers to derived type pft members - - pcolumn => pft%column - pgridcell => pft%gridcell - qflx_evap_soi => pwf%qflx_evap_soi - qflx_evap_tot => pwf%qflx_evap_tot - qflx_evap_grnd => pwf%qflx_evap_grnd - qflx_sub_snow => pwf%qflx_sub_snow - qflx_dew_snow => pwf%qflx_dew_snow - qflx_dew_grnd => pwf%qflx_dew_grnd - qflx_rain_grnd => pwf%qflx_rain_grnd - qflx_snow_grnd => pwf%qflx_snow_grnd - qflx_prec_grnd => pwf%qflx_prec_grnd - qflx_snwcp_ice => pwf%qflx_snwcp_ice - - ! Determine step size - - dtime = get_step_size() - - do fp = 1, num_lakep - p = filter_lakep(fp) - c = pcolumn(p) - g = pgridcell(p) - - ! Snow on the lake ice - - qflx_evap_grnd(p) = 0._r8 - qflx_sub_snow(p) = 0._r8 - qflx_dew_snow(p) = 0._r8 - qflx_dew_grnd(p) = 0._r8 - - if (qflx_evap_soi(p) >= 0._r8) then - - ! Sublimation: do not allow for more sublimation than there is snow - ! after melt. Remaining surface evaporation used for infiltration. - - qflx_sub_snow(p) = min(qflx_evap_soi(p), h2osno(c)/dtime-qmelt(c)) - ! Liquid water evaporation from snow or "ground" is implicitly treated as a term in qrgwl - qflx_evap_grnd(p) = 0._r8 - - else - - if (t_grnd(c) < tfrz-0.1_r8) then - qflx_dew_snow(p) = abs(qflx_evap_soi(p)) - else - ! Liquid dew on snow or "ground" is implicitly treated as a term in qrgwl - qflx_dew_grnd(p) = 0._r8 - end if - - end if - - ! Update snow pack - - ! WJS (8-26-11): For consistency with non-lake columns, I am setting the values of - ! qflx_rain_grnd and qflx_snow_grnd dependent on do_capsnow. For qflx_snow_grnd, - ! this makes sense: as with non-lake columns, this gives the amount of snowfall - ! that is added to the snowpack as opposed to running off due to snow capping. For - ! qflx_rain_grnd, the definition over lakes is less well defined, since (I believe) - ! all rain runs off over lakes (and qflx_snwcp_liq is always 0 over - ! lakes). Nevertheless, I am trying to be consistent with the definition of - ! qflx_rain_grnd elsewhere, which is: the amount of rainfall reaching the ground, - ! but 0 if there is snow capping. - - if (do_capsnow(c)) then - qflx_rain_grnd(p) = 0._r8 - qflx_snow_grnd(p) = 0._r8 - h2osno(c) = h2osno(c) - (qmelt(c) + qflx_sub_snow(p))*dtime - qflx_snwcp_ice(p) = forc_snow(g) + qflx_dew_snow(p) - else - qflx_rain_grnd(p) = forc_rain(g) - qflx_snow_grnd(p) = forc_snow(g) - h2osno(c) = h2osno(c) + (forc_snow(g)-qmelt(c)-qflx_sub_snow(p)+qflx_dew_snow(p))*dtime - qflx_snwcp_ice(p) = 0._r8 - end if - h2osno(c) = max(h2osno(c), 0._r8) - - ! No snow if lake unfrozen - - if (t_grnd(c) > tfrz) h2osno(c) = 0._r8 - - ! Snow depth - - snowdp(c) = h2osno(c)/snow_bd !Assume a constant snow bulk density = 250. - - ! Determine ending water balance - - endwb(c) = h2osno(c) - - ! The following are needed for global average on history tape. - ! Note that components that are not displayed over lake on history tape - ! must be set to spval here - - eflx_snomelt(c) = qmelt(c)*hfus - qflx_infl(c) = 0._r8 - qflx_snomelt(c) = qmelt(c) - qflx_surf(c) = 0._r8 - qflx_drain(c) = 0._r8 - qflx_irrig(c) = 0._r8 - rootr_column(c,:) = spval - snowice(c) = spval - snowliq(c) = spval - soilalpha(c) = spval - zwt(c) = spval - fcov(c) = spval - fsat(c) = spval - qcharge(c) = spval - h2osoi_vol(c,:) = spval - h2osoi_ice(c,:) = spval - h2osoi_liq(c,:) = spval - qflx_snofrz_col(c) = spval - qflx_qrgwl(c) = forc_rain(g) + forc_snow(g) + qflx_floodg(g) - qflx_evap_tot(p) - qflx_snwcp_ice(p) - & - (endwb(c)-begwb(c))/dtime - qflx_floodc(c) = qflx_floodg(g) - qflx_runoff(c) = qflx_drain(c) + qflx_surf(c) + qflx_qrgwl(c) - qflx_top_soil(c) = forc_rain(g) + qflx_snomelt(c) - qflx_prec_grnd(p) = forc_rain(g) + forc_snow(g) - - ! pft averages must be done here for output to history tape and other uses - ! (note that pft2col is called before HydrologyLake, so we can't use that routine - ! to do these column -> pft averages) - - qflx_evap_tot_col(c) = qflx_evap_tot(p) - qflx_prec_grnd_col(c) = qflx_prec_grnd(p) - qflx_evap_grnd_col(c) = qflx_evap_grnd(p) - qflx_dew_grnd_col(c) = qflx_dew_grnd(p) - qflx_dew_snow_col(c) = qflx_dew_snow(p) - qflx_sub_snow_col(c) = qflx_sub_snow(p) - qflx_rain_grnd_col(c) = qflx_rain_grnd(p) - qflx_snow_grnd_col(c) = qflx_snow_grnd(p) - qflx_snwcp_ice_col(c) = qflx_snwcp_ice(p) - - end do - - end subroutine HydrologyLake - -end module HydrologyLakeMod diff --git a/src_clm40/biogeophys/QSatMod.F90 b/src_clm40/biogeophys/QSatMod.F90 deleted file mode 100644 index 8a9fa0829b..0000000000 --- a/src_clm40/biogeophys/QSatMod.F90 +++ /dev/null @@ -1,149 +0,0 @@ - -module QSatMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: QSatMod -! -! !DESCRIPTION: -! Computes saturation mixing ratio and the change in saturation -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: QSat -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: QSat -! -! !INTERFACE: - subroutine QSat (T, p, es, esdT, qs, qsdT) -! -! !DESCRIPTION: -! Computes saturation mixing ratio and the change in saturation -! mixing ratio with respect to temperature. -! Reference: Polynomial approximations from: -! Piotr J. Flatau, et al.,1992: Polynomial fits to saturation -! vapor pressure. Journal of Applied Meteorology, 31, 1507-1513. -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: T ! temperature (K) - real(r8), intent(in) :: p ! surface atmospheric pressure (pa) - real(r8), intent(out) :: es ! vapor pressure (pa) - real(r8), intent(out) :: esdT ! d(es)/d(T) - real(r8), intent(out) :: qs ! humidity (kg/kg) - real(r8), intent(out) :: qsdT ! d(qs)/d(T) -! -! !CALLED FROM: -! subroutine Biogeophysics1 in module Biogeophysics1Mod -! subroutine BiogeophysicsLake in module BiogeophysicsLakeMod -! subroutine CanopyFluxesMod CanopyFluxesMod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: T_limit - real(r8) :: td,vp,vp1,vp2 -! -! For water vapor (temperature range 0C-100C) -! - real(r8), parameter :: a0 = 6.11213476_r8 - real(r8), parameter :: a1 = 0.444007856_r8 - real(r8), parameter :: a2 = 0.143064234e-01_r8 - real(r8), parameter :: a3 = 0.264461437e-03_r8 - real(r8), parameter :: a4 = 0.305903558e-05_r8 - real(r8), parameter :: a5 = 0.196237241e-07_r8 - real(r8), parameter :: a6 = 0.892344772e-10_r8 - real(r8), parameter :: a7 = -0.373208410e-12_r8 - real(r8), parameter :: a8 = 0.209339997e-15_r8 -! -! For derivative:water vapor -! - real(r8), parameter :: b0 = 0.444017302_r8 - real(r8), parameter :: b1 = 0.286064092e-01_r8 - real(r8), parameter :: b2 = 0.794683137e-03_r8 - real(r8), parameter :: b3 = 0.121211669e-04_r8 - real(r8), parameter :: b4 = 0.103354611e-06_r8 - real(r8), parameter :: b5 = 0.404125005e-09_r8 - real(r8), parameter :: b6 = -0.788037859e-12_r8 - real(r8), parameter :: b7 = -0.114596802e-13_r8 - real(r8), parameter :: b8 = 0.381294516e-16_r8 -! -! For ice (temperature range -75C-0C) -! - real(r8), parameter :: c0 = 6.11123516_r8 - real(r8), parameter :: c1 = 0.503109514_r8 - real(r8), parameter :: c2 = 0.188369801e-01_r8 - real(r8), parameter :: c3 = 0.420547422e-03_r8 - real(r8), parameter :: c4 = 0.614396778e-05_r8 - real(r8), parameter :: c5 = 0.602780717e-07_r8 - real(r8), parameter :: c6 = 0.387940929e-09_r8 - real(r8), parameter :: c7 = 0.149436277e-11_r8 - real(r8), parameter :: c8 = 0.262655803e-14_r8 -! -! For derivative:ice -! - real(r8), parameter :: d0 = 0.503277922_r8 - real(r8), parameter :: d1 = 0.377289173e-01_r8 - real(r8), parameter :: d2 = 0.126801703e-02_r8 - real(r8), parameter :: d3 = 0.249468427e-04_r8 - real(r8), parameter :: d4 = 0.313703411e-06_r8 - real(r8), parameter :: d5 = 0.257180651e-08_r8 - real(r8), parameter :: d6 = 0.133268878e-10_r8 - real(r8), parameter :: d7 = 0.394116744e-13_r8 - real(r8), parameter :: d8 = 0.498070196e-16_r8 -!----------------------------------------------------------------------- - - T_limit = T - SHR_CONST_TKFRZ - if (T_limit > 100.0_r8) T_limit=100.0_r8 - if (T_limit < -75.0_r8) T_limit=-75.0_r8 - - td = T_limit - if (td >= 0.0_r8) then - es = a0 + td*(a1 + td*(a2 + td*(a3 + td*(a4 & - + td*(a5 + td*(a6 + td*(a7 + td*a8))))))) - esdT = b0 + td*(b1 + td*(b2 + td*(b3 + td*(b4 & - + td*(b5 + td*(b6 + td*(b7 + td*b8))))))) - else - es = c0 + td*(c1 + td*(c2 + td*(c3 + td*(c4 & - + td*(c5 + td*(c6 + td*(c7 + td*c8))))))) - esdT = d0 + td*(d1 + td*(d2 + td*(d3 + td*(d4 & - + td*(d5 + td*(d6 + td*(d7 + td*d8))))))) - endif - - es = es * 100._r8 ! pa - esdT = esdT * 100._r8 ! pa/K - - vp = 1.0_r8 / (p - 0.378_r8*es) - vp1 = 0.622_r8 * vp - vp2 = vp1 * vp - - qs = es * vp1 ! kg/kg - qsdT = esdT * vp2 * p ! 1 / K - - end subroutine QSat - -end module QSatMod diff --git a/src_clm40/biogeophys/SNICARMod.F90 b/src_clm40/biogeophys/SNICARMod.F90 deleted file mode 100644 index 3febfe7160..0000000000 --- a/src_clm40/biogeophys/SNICARMod.F90 +++ /dev/null @@ -1,1494 +0,0 @@ -module SNICARMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: SNICARMod -! -! !DESCRIPTION: -! Calculate albedo of snow containing impurities -! and the evolution of snow effective radius -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use clm_varctl , only : iulog - use shr_const_mod , only : SHR_CONST_RHOICE - use abortutils , only : endrun - - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SNICAR_RT ! Snow albedo and vertically-resolved solar absorption - public :: SnowAge_grain ! Snow effective grain size evolution - public :: SnowAge_init ! Initial read in of snow-aging file - public :: SnowOptics_init ! Initial read in of snow-optics file -! -! !PUBLIC DATA MEMBERS: - - real(r8), public, parameter :: snw_rds_min = 54.526_r8 ! minimum allowed snow effective radius - ! (also "fresh snow" value) [microns] - integer, public, parameter :: sno_nbr_aer = 8 ! number of aerosol species in snowpack - ! (indices described above) [nbr] - logical, public, parameter :: DO_SNO_OC = .false. ! parameter to include organic carbon (OC) - ! in snowpack radiative calculations - logical, public, parameter :: DO_SNO_AER = .true. ! parameter to include aerosols in snowpack radiative calculations - - real(r8), public, parameter :: scvng_fct_mlt_bcphi = 0.20_r8 ! scavenging factor for hydrophillic BC inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_bcpho = 0.03_r8 ! scavenging factor for hydrophobic BC inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_ocphi = 0.20_r8 ! scavenging factor for hydrophillic OC inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_ocpho = 0.03_r8 ! scavenging factor for hydrophobic OC inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst1 = 0.02_r8 ! scavenging factor for dust species 1 inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst2 = 0.02_r8 ! scavenging factor for dust species 2 inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst3 = 0.01_r8 ! scavenging factor for dust species 3 inclusion in meltwater - ! [frc] - real(r8), public, parameter :: scvng_fct_mlt_dst4 = 0.01_r8 ! scavenging factor for dust species 4 inclusion in meltwater - ! [frc] - -! !PRIVATE MEMBER FUNCTIONS: - -! -! !PRIVATE DATA MEMBERS: - ! Aerosol species indices: - ! 1= hydrophillic black carbon - ! 2= hydrophobic black carbon - ! 3= hydrophilic organic carbon - ! 4= hydrophobic organic carbon - ! 5= dust species 1 - ! 6= dust species 2 - ! 7= dust species 3 - ! 8= dust species 4 - integer, parameter :: numrad_snw = 5 ! number of spectral bands used in snow model [nbr] - integer, parameter :: nir_bnd_bgn = 2 ! first band index in near-IR spectrum [idx] - integer, parameter :: nir_bnd_end = 5 ! ending near-IR band index [idx] - - integer, parameter :: idx_Mie_snw_mx = 1471 ! number of effective radius indices used in Mie lookup table [idx] - integer, parameter :: idx_T_max = 11 ! maxiumum temperature index used in aging lookup table [idx] - integer, parameter :: idx_T_min = 1 ! minimum temperature index used in aging lookup table [idx] - integer, parameter :: idx_Tgrd_max = 31 ! maxiumum temperature gradient index used in aging lookup table [idx] - integer, parameter :: idx_Tgrd_min = 1 ! minimum temperature gradient index used in aging lookup table [idx] - integer, parameter :: idx_rhos_max = 8 ! maxiumum snow density index used in aging lookup table [idx] - integer, parameter :: idx_rhos_min = 1 ! minimum snow density index used in aging lookup table [idx] - - integer, parameter :: snw_rds_max_tbl = 1500 ! maximum effective radius defined in Mie lookup table [microns] - integer, parameter :: snw_rds_min_tbl = 30 ! minimium effective radius defined in Mie lookup table [microns] - real(r8), parameter :: snw_rds_max = 1500._r8 ! maximum allowed snow effective radius [microns] - real(r8), parameter :: snw_rds_refrz = 1000._r8 ! effective radius of re-frozen snow [microns] - - real(r8), parameter :: min_snw = 1.0E-30_r8 ! minimum snow mass required for SNICAR RT calculation [kg m-2] - - !real(r8), parameter :: C1_liq_Brun89 = 1.28E-17_r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89 - real(r8), parameter :: C1_liq_Brun89 = 0._r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89: zeroed to accomodate dry snow aging - real(r8), parameter :: C2_liq_Brun89 = 4.22E-13_r8 ! constant for liquid water grain growth [m3 s-1], - ! from Brun89: corrected for LWC in units of percent - - real(r8), parameter :: tim_cns_bc_rmv = 2.2E-8_r8 ! time constant for removal of BC in snow on sea-ice - ! [s-1] (50% mass removal/year) - real(r8), parameter :: tim_cns_oc_rmv = 2.2E-8_r8 ! time constant for removal of OC in snow on sea-ice - ! [s-1] (50% mass removal/year) - real(r8), parameter :: tim_cns_dst_rmv = 2.2E-8_r8 ! time constant for removal of dust in snow on sea-ice - ! [s-1] (50% mass removal/year) - - ! scaling of the snow aging rate (tuning option): - logical :: flg_snoage_scl = .false. ! flag for scaling the snow aging rate by some arbitrary factor - real(r8), parameter :: xdrdt = 1.0_r8 ! arbitrary factor applied to snow aging rate - - ! snow and aerosol Mie parameters: - ! (arrays declared here, but are set in iniTimeConst) - ! (idx_Mie_snw_mx is number of snow radii with defined parameters (i.e. from 30um to 1500um)) - - ! direct-beam weighted ice optical properties - real(r8) :: ss_alb_snw_drc(idx_Mie_snw_mx,numrad_snw) - real(r8) :: asm_prm_snw_drc(idx_Mie_snw_mx,numrad_snw) - real(r8) :: ext_cff_mss_snw_drc(idx_Mie_snw_mx,numrad_snw) - - ! diffuse radiation weighted ice optical properties - real(r8) :: ss_alb_snw_dfs(idx_Mie_snw_mx,numrad_snw) - real(r8) :: asm_prm_snw_dfs(idx_Mie_snw_mx,numrad_snw) - real(r8) :: ext_cff_mss_snw_dfs(idx_Mie_snw_mx,numrad_snw) - - ! hydrophiliic BC - real(r8) :: ss_alb_bc1(numrad_snw) - real(r8) :: asm_prm_bc1(numrad_snw) - real(r8) :: ext_cff_mss_bc1(numrad_snw) - - ! hydrophobic BC - real(r8) :: ss_alb_bc2(numrad_snw) - real(r8) :: asm_prm_bc2(numrad_snw) - real(r8) :: ext_cff_mss_bc2(numrad_snw) - - ! hydrophobic OC - real(r8) :: ss_alb_oc1(numrad_snw) - real(r8) :: asm_prm_oc1(numrad_snw) - real(r8) :: ext_cff_mss_oc1(numrad_snw) - - ! hydrophilic OC - real(r8) :: ss_alb_oc2(numrad_snw) - real(r8) :: asm_prm_oc2(numrad_snw) - real(r8) :: ext_cff_mss_oc2(numrad_snw) - - ! dust species 1: - real(r8) :: ss_alb_dst1(numrad_snw) - real(r8) :: asm_prm_dst1(numrad_snw) - real(r8) :: ext_cff_mss_dst1(numrad_snw) - - ! dust species 2: - real(r8) :: ss_alb_dst2(numrad_snw) - real(r8) :: asm_prm_dst2(numrad_snw) - real(r8) :: ext_cff_mss_dst2(numrad_snw) - - ! dust species 3: - real(r8) :: ss_alb_dst3(numrad_snw) - real(r8) :: asm_prm_dst3(numrad_snw) - real(r8) :: ext_cff_mss_dst3(numrad_snw) - - ! dust species 4: - real(r8) :: ss_alb_dst4(numrad_snw) - real(r8) :: asm_prm_dst4(numrad_snw) - real(r8) :: ext_cff_mss_dst4(numrad_snw) - - ! best-fit parameters for snow aging defined over: - ! 11 temperatures from 225 to 273 K - ! 31 temperature gradients from 0 to 300 K/m - ! 8 snow densities from 0 to 350 kg/m3 - ! (arrays declared here, but are set in iniTimeConst) - real(r8), pointer :: snowage_tau(:,:,:) ! (idx_rhos_max,idx_Tgrd_max,idx_T_max) - real(r8), pointer :: snowage_kappa(:,:,:) ! (idx_rhos_max,idx_Tgrd_max,idx_T_max) - real(r8), pointer :: snowage_drdt0(:,:,:) ! idx_rhos_max,idx_Tgrd_max,idx_T_max) - -! -! !REVISION HISTORY: -! Created by Mark Flanner -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SNICAR_RT -! -! -! !CALLED FROM: -! subroutine SurfaceAlbedo in module SurfaceAlbedoMod (CLM) -! subroutine albice (CSIM) -! -! !REVISION HISTORY: -! Author: Mark Flanner -! -! !INTERFACE: - - subroutine SNICAR_RT (flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen, flg_slr_in, h2osno_liq, h2osno_ice, snw_rds, & - mss_cnc_aer_in, albsfc, albout, flx_abs) - - ! - ! !DESCRIPTION: - ! Determine reflectance of, and vertically-resolved solar absorption in, - ! snow with impurities. - ! - ! Original references on physical models of snow reflectance include: - ! Wiscombe and Warren [1980] and Warren and Wiscombe [1980], - ! Journal of Atmospheric Sciences, 37, - ! - ! The multi-layer solution for multiple-scattering used here is from: - ! Toon et al. [1989], Rapid calculation of radiative heating rates - ! and photodissociation rates in inhomogeneous multiple scattering atmospheres, - ! J. Geophys. Res., 94, D13, 16287-16301 - ! - ! The implementation of the SNICAR model in CLM/CSIM is described in: - ! Flanner, M., C. Zender, J. Randerson, and P. Rasch [2007], - ! Present-day climate forcing and response from black carbon in snow, - ! J. Geophys. Res., 112, D11202, doi: 10.1029/2006JD008003 - - - ! !USES: - use clmtype - use clm_varpar , only : nlevsno, numrad - use clm_time_manager , only : get_nstep - use shr_const_mod , only : SHR_CONST_PI - - - ! - ! !ARGUMENTS: - implicit none - integer , intent(in) :: flg_snw_ice ! flag: =1 when called from CLM, =2 when called from CSIM - integer , intent(in) :: lbc, ubc ! column index bounds [unitless] - integer , intent(in) :: num_nourbanc ! number of columns in non-urban filter - integer , intent(in) :: filter_nourbanc(ubc-lbc+1) ! column filter for non-urban points - real(r8), intent(in) :: coszen(lbc:ubc) ! cosine of solar zenith angle for next time step - ! (col) [unitless] - integer , intent(in) :: flg_slr_in ! flag: =1 for direct-beam incident flux, - ! =2 for diffuse incident flux - real(r8), intent(in) :: h2osno_liq(lbc:ubc,-nlevsno+1:0) ! liquid water content (col,lyr) [kg/m2] - real(r8), intent(in) :: h2osno_ice(lbc:ubc,-nlevsno+1:0) ! ice content (col,lyr) [kg/m2] - integer, intent(in) :: snw_rds(lbc:ubc,-nlevsno+1:0) ! snow effective radius (col,lyr) [microns, m^-6] - real(r8), intent(in) :: mss_cnc_aer_in(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of all aerosol species - ! (col,lyr,aer) [kg/kg] - real(r8), intent(in) :: albsfc(lbc:ubc,numrad) ! albedo of surface underlying snow - ! (col,bnd) [frc] - real(r8), intent(out) :: albout(lbc:ubc,numrad) ! snow albedo, averaged into 2 bands - ! (=0 if no sun or no snow) (col,bnd) [frc] - real(r8), intent(out) :: flx_abs(lbc:ubc,-nlevsno+1:1,numrad) ! absorbed flux in each layer per unit flux incident - ! on top of snowpack (col,lyr,bnd) [frc] - - ! - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit in arguments - ! - integer, pointer :: snl(:) ! negative number of snow layers (col) [nbr] - real(r8), pointer :: h2osno(:) ! snow liquid water equivalent (col) [kg/m2] - integer, pointer :: clandunit(:) ! corresponding landunit of column (col) [idx] (debugging only) - integer, pointer :: cgridcell(:) ! columns's gridcell index (col) [idx] (debugging only) - integer, pointer :: ltype(:) ! landunit type (lnd) (debugging only) - real(r8), pointer :: londeg(:) ! longitude (degrees) (debugging only) - real(r8), pointer :: latdeg(:) ! latitude (degrees) (debugging only) -! -! !OTHER LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - ! - ! variables for snow radiative transfer calculations - - ! Local variables representing single-column values of arrays: - integer :: snl_lcl ! negative number of snow layers [nbr] - integer :: snw_rds_lcl(-nlevsno+1:0) ! snow effective radius [m^-6] - real(r8):: flx_slrd_lcl(1:numrad_snw) ! direct beam incident irradiance [W/m2] (set to 1) - real(r8):: flx_slri_lcl(1:numrad_snw) ! diffuse incident irradiance [W/m2] (set to 1) - real(r8):: mss_cnc_aer_lcl(-nlevsno+1:0,1:sno_nbr_aer) ! aerosol mass concentration (lyr,aer_nbr) [kg/kg] - real(r8):: h2osno_lcl ! total column snow mass [kg/m2] - real(r8):: h2osno_liq_lcl(-nlevsno+1:0) ! liquid water mass [kg/m2] - real(r8):: h2osno_ice_lcl(-nlevsno+1:0) ! ice mass [kg/m2] - real(r8):: albsfc_lcl(1:numrad_snw) ! albedo of underlying surface [frc] - real(r8):: ss_alb_snw_lcl(-nlevsno+1:0) ! single-scatter albedo of ice grains (lyr) [frc] - real(r8):: asm_prm_snw_lcl(-nlevsno+1:0) ! asymmetry parameter of ice grains (lyr) [frc] - real(r8):: ext_cff_mss_snw_lcl(-nlevsno+1:0) ! mass extinction coefficient of ice grains (lyr) [m2/kg] - real(r8):: ss_alb_aer_lcl(sno_nbr_aer) ! single-scatter albedo of aerosol species (aer_nbr) [frc] - real(r8):: asm_prm_aer_lcl(sno_nbr_aer) ! asymmetry parameter of aerosol species (aer_nbr) [frc] - real(r8):: ext_cff_mss_aer_lcl(sno_nbr_aer) ! mass extinction coefficient of aerosol species (aer_nbr) [m2/kg] - - - ! Other local variables - integer :: APRX_TYP ! two-stream approximation type - ! (1=Eddington, 2=Quadrature, 3=Hemispheric Mean) [nbr] - integer :: DELTA ! flag to use Delta approximation (Joseph, 1976) - ! (1= use, 0= don't use) - real(r8):: flx_wgt(1:numrad_snw) ! weights applied to spectral bands, - ! specific to direct and diffuse cases (bnd) [frc] - - integer :: flg_nosnl ! flag: =1 if there is snow, but zero snow layers, - ! =0 if at least 1 snow layer [flg] - integer :: trip ! flag: =1 to redo RT calculation if result is unrealistic - integer :: flg_dover ! defines conditions for RT redo (explained below) - - real(r8):: albedo ! temporary snow albedo [frc] - real(r8):: flx_sum ! temporary summation variable for NIR weighting - real(r8):: albout_lcl(numrad_snw) ! snow albedo by band [frc] - real(r8):: flx_abs_lcl(-nlevsno+1:1,numrad_snw)! absorbed flux per unit incident flux at top of snowpack (lyr,bnd) [frc] - - real(r8):: L_snw(-nlevsno+1:0) ! h2o mass (liquid+solid) in snow layer (lyr) [kg/m2] - real(r8):: tau_snw(-nlevsno+1:0) ! snow optical depth (lyr) [unitless] - real(r8):: L_aer(-nlevsno+1:0,sno_nbr_aer) ! aerosol mass in snow layer (lyr,nbr_aer) [kg/m2] - real(r8):: tau_aer(-nlevsno+1:0,sno_nbr_aer) ! aerosol optical depth (lyr,nbr_aer) [unitless] - real(r8):: tau_sum ! cumulative (snow+aerosol) optical depth [unitless] - real(r8):: tau_clm(-nlevsno+1:0) ! column optical depth from layer bottom to snowpack top (lyr) [unitless] - real(r8):: omega_sum ! temporary summation of single-scatter albedo of all aerosols [frc] - real(r8):: g_sum ! temporary summation of asymmetry parameter of all aerosols [frc] - - real(r8):: tau(-nlevsno+1:0) ! weighted optical depth of snow+aerosol layer (lyr) [unitless] - real(r8):: omega(-nlevsno+1:0) ! weighted single-scatter albedo of snow+aerosol layer (lyr) [frc] - real(r8):: g(-nlevsno+1:0) ! weighted asymmetry parameter of snow+aerosol layer (lyr) [frc] - real(r8):: tau_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) optical depth of snow+aerosol layer - ! (lyr) [unitless] - real(r8):: omega_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) SSA of snow+aerosol layer (lyr) [frc] - real(r8):: g_star(-nlevsno+1:0) ! transformed (i.e. Delta-Eddington) asymmetry paramater of snow+aerosol layer - ! (lyr) [frc] - - integer :: nstep ! current timestep [nbr] (debugging only) - integer :: g_idx, c_idx, l_idx ! gridcell, column, and landunit indices [idx] - integer :: bnd_idx ! spectral band index (1 <= bnd_idx <= numrad_snw) [idx] - integer :: rds_idx ! snow effective radius index for retrieving - ! Mie parameters from lookup table [idx] - integer :: snl_btm ! index of bottom snow layer (0) [idx] - integer :: snl_top ! index of top snow layer (-4 to 0) [idx] - integer :: fc ! column filter index - integer :: i ! layer index [idx] - integer :: j ! aerosol number index [idx] - integer :: n ! tridiagonal matrix index [idx] - integer :: m ! secondary layer index [idx] - - real(r8):: F_direct(-nlevsno+1:0) ! direct-beam radiation at bottom of layer interface (lyr) [W/m^2] - real(r8):: F_net(-nlevsno+1:0) ! net radiative flux at bottom of layer interface (lyr) [W/m^2] - real(r8):: F_abs(-nlevsno+1:0) ! net absorbed radiative energy (lyr) [W/m^2] - real(r8):: F_abs_sum ! total absorbed energy in column [W/m^2] - real(r8):: F_sfc_pls ! upward radiative flux at snowpack top [W/m^2] - real(r8):: F_btm_net ! net flux at bottom of snowpack [W/m^2] - real(r8):: F_sfc_net ! net flux at top of snowpack [W/m^2] - real(r8):: energy_sum ! sum of all energy terms; should be 0.0 [W/m^2] - real(r8):: F_direct_btm ! direct-beam radiation at bottom of snowpack [W/m^2] - real(r8):: mu_not ! cosine of solar zenith angle (used locally) [frc] - - integer :: err_idx ! counter for number of times through error loop [nbr] - real(r8):: lat_coord ! gridcell latitude (debugging only) - real(r8):: lon_coord ! gridcell longitude (debugging only) - integer :: sfctype ! underlying surface type (debugging only) - real(r8):: pi ! 3.1415... - - - ! intermediate variables for radiative transfer approximation: - real(r8):: gamma1(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma2(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma3(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: gamma4(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: lambda(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: GAMMA(-nlevsno+1:0) ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: mu_one ! two-stream coefficient from Toon et al. (lyr) [unitless] - real(r8):: e1(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e2(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e3(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: e4(-nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (lyr) - real(r8):: C_pls_btm(-nlevsno+1:0) ! intermediate variable: upward flux at bottom interface (lyr) [W/m2] - real(r8):: C_mns_btm(-nlevsno+1:0) ! intermediate variable: downward flux at bottom interface (lyr) [W/m2] - real(r8):: C_pls_top(-nlevsno+1:0) ! intermediate variable: upward flux at top interface (lyr) [W/m2] - real(r8):: C_mns_top(-nlevsno+1:0) ! intermediate variable: downward flux at top interface (lyr) [W/m2] - real(r8):: A(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: B(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: D(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: E(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: AS(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: DS(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: X(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - real(r8):: Y(-2*nlevsno+1:0) ! tri-diag intermediate variable from Toon et al. (2*lyr) - - - ! Assign local pointers to derived subtypes components (column-level) - ! (CLM-specific) - if (flg_snw_ice == 1) then - snl => cps%snl - h2osno => cws%h2osno - clandunit => col%landunit ! (debug only) - cgridcell => col%gridcell ! (debug only) - ltype => lun%itype ! (debug only) - londeg => grc%londeg ! (debug only) - latdeg => grc%latdeg ! (debug only) - endif - - - ! Define constants - pi = SHR_CONST_PI - - ! always use Delta approximation for snow - DELTA = 1 - - ! Get current timestep - nstep = get_nstep() - - ! Loop over all non-urban columns - ! (when called from CSIM, there is only one column) - do fc = 1,num_nourbanc - c_idx = filter_nourbanc(fc) - - - ! Zero absorbed radiative fluxes: - do i=-nlevsno+1,1,1 - flx_abs_lcl(:,:) = 0._r8 - flx_abs(c_idx,i,:) = 0._r8 - enddo - - ! set snow/ice mass to be used for RT: - if (flg_snw_ice == 1) then - h2osno_lcl = h2osno(c_idx) - else - h2osno_lcl = h2osno_ice(c_idx,0) - endif - - - ! Qualifier for computing snow RT: - ! 1) sunlight from atmosphere model - ! 2) minimum amount of snow on ground. - ! Otherwise, set snow albedo to zero - if ((coszen(c_idx) > 0._r8) .and. (h2osno_lcl > min_snw)) then - - ! Set variables specific to CLM - if (flg_snw_ice == 1) then - ! Assign local (single-column) variables to global values - ! If there is snow, but zero snow layers, we must create a layer locally. - ! This layer is presumed to have the fresh snow effective radius. - if (snl(c_idx) > -1) then - flg_nosnl = 1 - snl_lcl = -1 - h2osno_ice_lcl(0) = h2osno_lcl - h2osno_liq_lcl(0) = 0._r8 - snw_rds_lcl(0) = nint(snw_rds_min) - else - flg_nosnl = 0 - snl_lcl = snl(c_idx) - h2osno_liq_lcl(:) = h2osno_liq(c_idx,:) - h2osno_ice_lcl(:) = h2osno_ice(c_idx,:) - snw_rds_lcl(:) = snw_rds(c_idx,:) - endif - - snl_btm = 0 - snl_top = snl_lcl+1 - - ! for debugging only - l_idx = clandunit(c_idx) - g_idx = cgridcell(c_idx) - sfctype = ltype(l_idx) - lat_coord = latdeg(g_idx) - lon_coord = londeg(g_idx) - - - ! Set variables specific to CSIM - else - flg_nosnl = 0 - snl_lcl = -1 - h2osno_liq_lcl(:) = h2osno_liq(c_idx,:) - h2osno_ice_lcl(:) = h2osno_ice(c_idx,:) - snw_rds_lcl(:) = snw_rds(c_idx,:) - snl_btm = 0 - snl_top = 0 - sfctype = -1 - lat_coord = -90 - lon_coord = 0 - endif - - ! Set local aerosol array - do j=1,sno_nbr_aer - mss_cnc_aer_lcl(:,j) = mss_cnc_aer_in(c_idx,:,j) - enddo - - - ! Set spectral underlying surface albedos to their corresponding VIS or NIR albedos - albsfc_lcl(1) = albsfc(c_idx,1) - albsfc_lcl(nir_bnd_bgn:nir_bnd_end) = albsfc(c_idx,2) - - - ! Error check for snow grain size: - do i=snl_top,snl_btm,1 - if ((snw_rds_lcl(i) < snw_rds_min_tbl) .or. (snw_rds_lcl(i) > snw_rds_max_tbl)) then - write (iulog,*) "SNICAR ERROR: snow grain radius of ", snw_rds_lcl(i), " out of bounds." - write (iulog,*) "NSTEP= ", nstep - write (iulog,*) "flg_snw_ice= ", flg_snw_ice - write (iulog,*) "column: ", c_idx, " level: ", i, " snl(c)= ", snl_lcl - write (iulog,*) "lat= ", lat_coord, " lon= ", lon_coord - write (iulog,*) "h2osno(c)= ", h2osno_lcl - call endrun() - endif - enddo - - ! Incident flux weighting parameters - ! - sum of all VIS bands must equal 1 - ! - sum of all NIR bands must equal 1 - ! - ! Spectral bands (5-band case) - ! Band 1: 0.3-0.7um (VIS) - ! Band 2: 0.7-1.0um (NIR) - ! Band 3: 1.0-1.2um (NIR) - ! Band 4: 1.2-1.5um (NIR) - ! Band 5: 1.5-5.0um (NIR) - ! - ! The following weights are appropriate for surface-incident flux in a mid-latitude winter atmosphere - ! - ! 3-band weights - if (numrad_snw==3) then - ! Direct: - if (flg_slr_in == 1) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.66628670195247_r8 - flx_wgt(3) = 0.33371329804753_r8 - ! Diffuse: - elseif (flg_slr_in == 2) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.77887652162877_r8 - flx_wgt(3) = 0.22112347837123_r8 - endif - - ! 5-band weights - elseif(numrad_snw==5) then - ! Direct: - if (flg_slr_in == 1) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.49352158521175_r8 - flx_wgt(3) = 0.18099494230665_r8 - flx_wgt(4) = 0.12094898498813_r8 - flx_wgt(5) = 0.20453448749347_r8 - ! Diffuse: - elseif (flg_slr_in == 2) then - flx_wgt(1) = 1._r8 - flx_wgt(2) = 0.58581507618433_r8 - flx_wgt(3) = 0.20156903770812_r8 - flx_wgt(4) = 0.10917889346386_r8 - flx_wgt(5) = 0.10343699264369_r8 - endif - endif - - ! Loop over snow spectral bands - do bnd_idx = 1,numrad_snw - - mu_not = coszen(c_idx) ! must set here, because of error handling - flg_dover = 1 ! default is to redo - err_idx = 0 ! number of times through loop - - do while (flg_dover > 0) - - ! DEFAULT APPROXIMATIONS: - ! VIS: Delta-Eddington - ! NIR (all): Delta-Hemispheric Mean - ! WARNING: DO NOT USE DELTA-EDDINGTON FOR NIR DIFFUSE - this sometimes results in negative albedo - ! - ! ERROR CONDITIONS: - ! Conditions which cause "trip", resulting in redo of RT approximation: - ! 1. negative absorbed flux - ! 2. total absorbed flux greater than incident flux - ! 3. negative albedo - ! NOTE: These errors have only been encountered in spectral bands 4 and 5 - ! - ! ERROR HANDLING - ! 1st error (flg_dover=2): switch approximation (Edd->HM or HM->Edd) - ! 2nd error (flg_dover=3): change zenith angle by 0.02 (this happens about 1 in 10^6 cases) - ! 3rd error (flg_dover=4): switch approximation with new zenith - ! Subsequent errors: repeatedly change zenith and approximations... - - if (bnd_idx == 1) then - if (flg_dover == 2) then - APRX_TYP = 3 - elseif (flg_dover == 3) then - APRX_TYP = 1 - if (coszen(c_idx) > 0.5_r8) then - mu_not = mu_not - 0.02_r8 - else - mu_not = mu_not + 0.02_r8 - endif - elseif (flg_dover == 4) then - APRX_TYP = 3 - else - APRX_TYP = 1 - endif - - else - if (flg_dover == 2) then - APRX_TYP = 1 - elseif (flg_dover == 3) then - APRX_TYP = 3 - if (coszen(c_idx) > 0.5_r8) then - mu_not = mu_not - 0.02_r8 - else - mu_not = mu_not + 0.02_r8 - endif - elseif (flg_dover == 4) then - APRX_TYP = 1 - else - APRX_TYP = 3 - endif - - endif - - ! Set direct or diffuse incident irradiance to 1 - ! (This has to be within the bnd loop because mu_not is adjusted in rare cases) - if (flg_slr_in == 1) then - flx_slrd_lcl(bnd_idx) = 1._r8/(mu_not*pi) ! this corresponds to incident irradiance of 1.0 - flx_slri_lcl(bnd_idx) = 0._r8 - else - flx_slrd_lcl(bnd_idx) = 0._r8 - flx_slri_lcl(bnd_idx) = 1._r8 - endif - - ! Pre-emptive error handling: aerosols can reap havoc on these absorptive bands. - ! Since extremely high soot concentrations have a negligible effect on these bands, zero them. - if ( (numrad_snw == 5).and.((bnd_idx == 5).or.(bnd_idx == 4)) ) then - mss_cnc_aer_lcl(:,:) = 0._r8 - endif - - if ( (numrad_snw == 3).and.(bnd_idx == 3) ) then - mss_cnc_aer_lcl(:,:) = 0._r8 - endif - - ! Define local Mie parameters based on snow grain size and aerosol species, - ! retrieved from a lookup table. - if (flg_slr_in == 1) then - do i=snl_top,snl_btm,1 - rds_idx = snw_rds_lcl(i) - snw_rds_min_tbl + 1 - ! snow optical properties (direct radiation) - ss_alb_snw_lcl(i) = ss_alb_snw_drc(rds_idx,bnd_idx) - asm_prm_snw_lcl(i) = asm_prm_snw_drc(rds_idx,bnd_idx) - ext_cff_mss_snw_lcl(i) = ext_cff_mss_snw_drc(rds_idx,bnd_idx) - enddo - elseif (flg_slr_in == 2) then - do i=snl_top,snl_btm,1 - rds_idx = snw_rds_lcl(i) - snw_rds_min_tbl + 1 - ! snow optical properties (diffuse radiation) - ss_alb_snw_lcl(i) = ss_alb_snw_dfs(rds_idx,bnd_idx) - asm_prm_snw_lcl(i) = asm_prm_snw_dfs(rds_idx,bnd_idx) - ext_cff_mss_snw_lcl(i) = ext_cff_mss_snw_dfs(rds_idx,bnd_idx) - enddo - endif - - ! aerosol species 1 optical properties - ss_alb_aer_lcl(1) = ss_alb_bc1(bnd_idx) - asm_prm_aer_lcl(1) = asm_prm_bc1(bnd_idx) - ext_cff_mss_aer_lcl(1) = ext_cff_mss_bc1(bnd_idx) - - ! aerosol species 2 optical properties - ss_alb_aer_lcl(2) = ss_alb_bc2(bnd_idx) - asm_prm_aer_lcl(2) = asm_prm_bc2(bnd_idx) - ext_cff_mss_aer_lcl(2) = ext_cff_mss_bc2(bnd_idx) - - ! aerosol species 3 optical properties - ss_alb_aer_lcl(3) = ss_alb_oc1(bnd_idx) - asm_prm_aer_lcl(3) = asm_prm_oc1(bnd_idx) - ext_cff_mss_aer_lcl(3) = ext_cff_mss_oc1(bnd_idx) - - ! aerosol species 4 optical properties - ss_alb_aer_lcl(4) = ss_alb_oc2(bnd_idx) - asm_prm_aer_lcl(4) = asm_prm_oc2(bnd_idx) - ext_cff_mss_aer_lcl(4) = ext_cff_mss_oc2(bnd_idx) - - ! aerosol species 5 optical properties - ss_alb_aer_lcl(5) = ss_alb_dst1(bnd_idx) - asm_prm_aer_lcl(5) = asm_prm_dst1(bnd_idx) - ext_cff_mss_aer_lcl(5) = ext_cff_mss_dst1(bnd_idx) - - ! aerosol species 6 optical properties - ss_alb_aer_lcl(6) = ss_alb_dst2(bnd_idx) - asm_prm_aer_lcl(6) = asm_prm_dst2(bnd_idx) - ext_cff_mss_aer_lcl(6) = ext_cff_mss_dst2(bnd_idx) - - ! aerosol species 7 optical properties - ss_alb_aer_lcl(7) = ss_alb_dst3(bnd_idx) - asm_prm_aer_lcl(7) = asm_prm_dst3(bnd_idx) - ext_cff_mss_aer_lcl(7) = ext_cff_mss_dst3(bnd_idx) - - ! aerosol species 8 optical properties - ss_alb_aer_lcl(8) = ss_alb_dst4(bnd_idx) - asm_prm_aer_lcl(8) = asm_prm_dst4(bnd_idx) - ext_cff_mss_aer_lcl(8) = ext_cff_mss_dst4(bnd_idx) - - - ! 1. snow and aerosol layer column mass (L_snw, L_aer [kg/m^2]) - ! 2. optical Depths (tau_snw, tau_aer) - ! 3. weighted Mie properties (tau, omega, g) - - ! Weighted Mie parameters of each layer - do i=snl_top,snl_btm,1 - L_snw(i) = h2osno_ice_lcl(i)+h2osno_liq_lcl(i) - tau_snw(i) = L_snw(i)*ext_cff_mss_snw_lcl(i) - - do j=1,sno_nbr_aer - L_aer(i,j) = L_snw(i)*mss_cnc_aer_lcl(i,j) - tau_aer(i,j) = L_aer(i,j)*ext_cff_mss_aer_lcl(j) - enddo - - tau_sum = 0._r8 - omega_sum = 0._r8 - g_sum = 0._r8 - - do j=1,sno_nbr_aer - tau_sum = tau_sum + tau_aer(i,j) - omega_sum = omega_sum + (tau_aer(i,j)*ss_alb_aer_lcl(j)) - g_sum = g_sum + (tau_aer(i,j)*ss_alb_aer_lcl(j)*asm_prm_aer_lcl(j)) - enddo - - tau(i) = tau_sum + tau_snw(i) - omega(i) = (1/tau(i))*(omega_sum+(ss_alb_snw_lcl(i)*tau_snw(i))) - g(i) = (1/(tau(i)*omega(i)))*(g_sum+ (asm_prm_snw_lcl(i)*ss_alb_snw_lcl(i)*tau_snw(i))) - enddo - - ! DELTA transformations, if requested - if (DELTA == 1) then - do i=snl_top,snl_btm,1 - g_star(i) = g(i)/(1+g(i)) - omega_star(i) = ((1-(g(i)**2))*omega(i)) / (1-(omega(i)*(g(i)**2))) - tau_star(i) = (1-(omega(i)*(g(i)**2)))*tau(i) - enddo - else - do i=snl_top,snl_btm,1 - g_star(i) = g(i) - omega_star(i) = omega(i) - tau_star(i) = tau(i) - enddo - endif - - ! Total column optical depth: - ! tau_clm(i) = total optical depth above the bottom of layer i - tau_clm(snl_top) = 0._r8 - do i=snl_top+1,snl_btm,1 - tau_clm(i) = tau_clm(i-1)+tau_star(i-1) - enddo - - ! Direct radiation at bottom of snowpack: - F_direct_btm = albsfc_lcl(bnd_idx)*mu_not*exp(-(tau_clm(snl_btm)+tau_star(snl_btm))/mu_not)*pi*flx_slrd_lcl(bnd_idx) - - ! Intermediates - ! Gamma values are approximation-specific. - - ! Eddington - if (APRX_TYP==1) then - do i=snl_top,snl_btm,1 - gamma1(i) = (7-(omega_star(i)*(4+(3*g_star(i)))))/4 - gamma2(i) = -(1-(omega_star(i)*(4-(3*g_star(i)))))/4 - gamma3(i) = (2-(3*g_star(i)*mu_not))/4 - gamma4(i) = 1-gamma3(i) - mu_one = 0.5 - enddo - - ! Quadrature - elseif (APRX_TYP==2) then - do i=snl_top,snl_btm,1 - gamma1(i) = (3**0.5)*(2-(omega_star(i)*(1+g_star(i))))/2 - gamma2(i) = omega_star(i)*(3**0.5)*(1-g_star(i))/2 - gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2 - gamma4(i) = 1-gamma3(i) - mu_one = 1/(3**0.5) - enddo - - ! Hemispheric Mean - elseif (APRX_TYP==3) then - do i=snl_top,snl_btm,1 - gamma1(i) = 2 - (omega_star(i)*(1+g_star(i))) - gamma2(i) = omega_star(i)*(1-g_star(i)) - gamma3(i) = (1-((3**0.5)*g_star(i)*mu_not))/2 - gamma4(i) = 1-gamma3(i) - mu_one = 0.5 - enddo - endif - - ! Intermediates for tri-diagonal solution - do i=snl_top,snl_btm,1 - lambda(i) = sqrt(abs((gamma1(i)**2) - (gamma2(i)**2))) - GAMMA(i) = gamma2(i)/(gamma1(i)+lambda(i)) - - e1(i) = 1+(GAMMA(i)*exp(-lambda(i)*tau_star(i))) - e2(i) = 1-(GAMMA(i)*exp(-lambda(i)*tau_star(i))) - e3(i) = GAMMA(i) + exp(-lambda(i)*tau_star(i)) - e4(i) = GAMMA(i) - exp(-lambda(i)*tau_star(i)) - enddo !enddo over snow layers - - - ! Intermediates for tri-diagonal solution - do i=snl_top,snl_btm,1 - if (flg_slr_in == 1) then - - C_pls_btm(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-(tau_clm(i)+tau_star(i))/mu_not)* & - (((gamma1(i)-(1/mu_not))*gamma3(i))+ & - (gamma4(i)*gamma2(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_mns_btm(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-(tau_clm(i)+tau_star(i))/mu_not)* & - (((gamma1(i)+(1/mu_not))*gamma4(i))+ & - (gamma2(i)*gamma3(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_pls_top(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-tau_clm(i)/mu_not)*(((gamma1(i)-(1/mu_not))* & - gamma3(i))+(gamma4(i)*gamma2(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - C_mns_top(i) = (omega_star(i)*pi*flx_slrd_lcl(bnd_idx)* & - exp(-tau_clm(i)/mu_not)*(((gamma1(i)+(1/mu_not))* & - gamma4(i))+(gamma2(i)*gamma3(i))))/((lambda(i)**2)-(1/(mu_not**2))) - - else - C_pls_btm(i) = 0._r8 - C_mns_btm(i) = 0._r8 - C_pls_top(i) = 0._r8 - C_mns_top(i) = 0._r8 - endif - enddo - - ! Coefficients for tridiaganol matrix solution - do i=2*snl_lcl+1,0,1 - - !Boundary values for i=1 and i=2*snl_lcl, specifics for i=odd and i=even - if (i==(2*snl_lcl+1)) then - A(i) = 0 - B(i) = e1(snl_top) - D(i) = -e2(snl_top) - E(i) = flx_slri_lcl(bnd_idx)-C_mns_top(snl_top) - - elseif(i==0) then - A(i) = e1(snl_btm)-(albsfc_lcl(bnd_idx)*e3(snl_btm)) - B(i) = e2(snl_btm)-(albsfc_lcl(bnd_idx)*e4(snl_btm)) - D(i) = 0 - E(i) = F_direct_btm-C_pls_btm(snl_btm)+(albsfc_lcl(bnd_idx)*C_mns_btm(snl_btm)) - - elseif(mod(i,2)==-1) then ! If odd and i>=3 (n=1 for i=3) - n=floor(i/2.0) - A(i) = (e2(n)*e3(n))-(e4(n)*e1(n)) - B(i) = (e1(n)*e1(n+1))-(e3(n)*e3(n+1)) - D(i) = (e3(n)*e4(n+1))-(e1(n)*e2(n+1)) - E(i) = (e3(n)*(C_pls_top(n+1)-C_pls_btm(n)))+(e1(n)*(C_mns_btm(n)-C_mns_top(n+1))) - - elseif(mod(i,2)==0) then ! If even and i<=2*snl_lcl - n=(i/2) - A(i) = (e2(n+1)*e1(n))-(e3(n)*e4(n+1)) - B(i) = (e2(n)*e2(n+1))-(e4(n)*e4(n+1)) - D(i) = (e1(n+1)*e4(n+1))-(e2(n+1)*e3(n+1)) - E(i) = (e2(n+1)*(C_pls_top(n+1)-C_pls_btm(n)))+(e4(n+1)*(C_mns_top(n+1)-C_mns_btm(n))) - endif - enddo - - AS(0) = A(0)/B(0) - DS(0) = E(0)/B(0) - - do i=-1,(2*snl_lcl+1),-1 - X(i) = 1/(B(i)-(D(i)*AS(i+1))) - AS(i) = A(i)*X(i) - DS(i) = (E(i)-(D(i)*DS(i+1)))*X(i) - enddo - - Y(2*snl_lcl+1) = DS(2*snl_lcl+1) - do i=(2*snl_lcl+2),0,1 - Y(i) = DS(i)-(AS(i)*Y(i-1)) - enddo - - ! Downward direct-beam and net flux (F_net) at the base of each layer: - do i=snl_top,snl_btm,1 - F_direct(i) = mu_not*pi*flx_slrd_lcl(bnd_idx)*exp(-(tau_clm(i)+tau_star(i))/mu_not) - F_net(i) = (Y(2*i-1)*(e1(i)-e3(i))) + (Y(2*i)*(e2(i)-e4(i))) + & - C_pls_btm(i) - C_mns_btm(i) - F_direct(i) - enddo - - ! Upward flux at snowpack top: - F_sfc_pls = (Y(2*snl_lcl+1)*(exp(-lambda(snl_top)*tau_star(snl_top))+ & - GAMMA(snl_top))) + (Y(2*snl_lcl+2)*(exp(-lambda(snl_top)* & - tau_star(snl_top))-GAMMA(snl_top))) + C_pls_top(snl_top) - - ! Net flux at bottom = absorbed radiation by underlying surface: - F_btm_net = -F_net(snl_btm) - - - ! Bulk column albedo and surface net flux - albedo = F_sfc_pls/((mu_not*pi*flx_slrd_lcl(bnd_idx))+flx_slri_lcl(bnd_idx)) - F_sfc_net = F_sfc_pls - ((mu_not*pi*flx_slrd_lcl(bnd_idx))+flx_slri_lcl(bnd_idx)) - - trip = 0 - ! Absorbed flux in each layer - do i=snl_top,snl_btm,1 - if(i==snl_top) then - F_abs(i) = F_net(i)-F_sfc_net - else - F_abs(i) = F_net(i)-F_net(i-1) - endif - flx_abs_lcl(i,bnd_idx) = F_abs(i) - - - ! ERROR check: negative absorption - if (flx_abs_lcl(i,bnd_idx) < -0.00001) then - trip = 1 - endif - enddo - - flx_abs_lcl(1,bnd_idx) = F_btm_net - - if (flg_nosnl == 1) then - ! If there are no snow layers (but still snow), all absorbed energy must be in top soil layer - !flx_abs_lcl(:,bnd_idx) = 0._r8 - !flx_abs_lcl(1,bnd_idx) = F_abs(0) + F_btm_net - - ! changed on 20070408: - ! OK to put absorbed energy in the fictitous snow layer because routine SurfaceRadiation - ! handles the case of no snow layers. Then, if a snow layer is addded between now and - ! SurfaceRadiation (called in Hydrology1), absorbed energy will be properly distributed. - flx_abs_lcl(0,bnd_idx) = F_abs(0) - flx_abs_lcl(1,bnd_idx) = F_btm_net - endif - - !Underflow check (we've already tripped the error condition above) - do i=snl_top,1,1 - if (flx_abs_lcl(i,bnd_idx) < 0._r8) then - flx_abs_lcl(i,bnd_idx) = 0._r8 - endif - enddo - - F_abs_sum = 0._r8 - do i=snl_top,snl_btm,1 - F_abs_sum = F_abs_sum + F_abs(i) - enddo - - - !ERROR check: absorption greater than incident flux - ! (should make condition more generic than "1._r8") - if (F_abs_sum > 1._r8) then - trip = 1 - endif - - !ERROR check: - if ((albedo < 0._r8).and.(trip==0)) then - trip = 1 - endif - - ! Set conditions for redoing RT calculation - if ((trip == 1).and.(flg_dover == 1)) then - flg_dover = 2 - elseif ((trip == 1).and.(flg_dover == 2)) then - flg_dover = 3 - elseif ((trip == 1).and.(flg_dover == 3)) then - flg_dover = 4 - elseif((trip == 1).and.(flg_dover == 4).and.(err_idx < 20)) then - flg_dover = 3 - err_idx = err_idx + 1 - elseif((trip == 1).and.(flg_dover == 4).and.(err_idx >= 20)) then - flg_dover = 0 - write(iulog,*) "SNICAR ERROR: FOUND A WORMHOLE. STUCK IN INFINITE LOOP! Called from: ", flg_snw_ice - write(iulog,*) "SNICAR STATS: snw_rds(0)= ", snw_rds(c_idx,0) - write(iulog,*) "SNICAR STATS: L_snw(0)= ", L_snw(0) - write(iulog,*) "SNICAR STATS: h2osno= ", h2osno_lcl, " snl= ", snl_lcl - write(iulog,*) "SNICAR STATS: soot1(0)= ", mss_cnc_aer_lcl(0,1) - write(iulog,*) "SNICAR STATS: soot2(0)= ", mss_cnc_aer_lcl(0,2) - write(iulog,*) "SNICAR STATS: dust1(0)= ", mss_cnc_aer_lcl(0,3) - write(iulog,*) "SNICAR STATS: dust2(0)= ", mss_cnc_aer_lcl(0,4) - write(iulog,*) "SNICAR STATS: dust3(0)= ", mss_cnc_aer_lcl(0,5) - write(iulog,*) "SNICAR STATS: dust4(0)= ", mss_cnc_aer_lcl(0,6) - - call endrun() - else - flg_dover = 0 - endif - - enddo !enddo while (flg_dover > 0) - - ! Energy conservation check: - ! Incident direct+diffuse radiation equals (absorbed+bulk_transmitted+bulk_reflected) - energy_sum = (mu_not*pi*flx_slrd_lcl(bnd_idx)) + flx_slri_lcl(bnd_idx) - (F_abs_sum + F_btm_net + F_sfc_pls) - if (abs(energy_sum) > 0.00001_r8) then - write (iulog,"(a,e12.6,a,i6,a,i6)") "SNICAR ERROR: Energy conservation error of : ", energy_sum, & - " at timestep: ", nstep, " at column: ", c_idx - call endrun() - endif - - albout_lcl(bnd_idx) = albedo - - - ! Check that albedo is less than 1 - if (albout_lcl(bnd_idx) > 1.0) then - - write (iulog,*) "SNICAR ERROR: Albedo > 1.0 at c: ", c_idx, " NSTEP= ",nstep - write (iulog,*) "SNICAR STATS: bnd_idx= ",bnd_idx - write (iulog,*) "SNICAR STATS: albout_lcl(bnd)= ",albout_lcl(bnd_idx), " albsfc_lcl(bnd_idx)= ",albsfc_lcl(bnd_idx) - write (iulog,*) "SNICAR STATS: landtype= ", sfctype - write (iulog,*) "SNICAR STATS: h2osno= ", h2osno_lcl, " snl= ", snl_lcl - write (iulog,*) "SNICAR STATS: coszen= ", coszen(c_idx), " flg_slr= ", flg_slr_in - - write (iulog,*) "SNICAR STATS: soot(-4)= ", mss_cnc_aer_lcl(-4,1) - write (iulog,*) "SNICAR STATS: soot(-3)= ", mss_cnc_aer_lcl(-3,1) - write (iulog,*) "SNICAR STATS: soot(-2)= ", mss_cnc_aer_lcl(-2,1) - write (iulog,*) "SNICAR STATS: soot(-1)= ", mss_cnc_aer_lcl(-1,1) - write (iulog,*) "SNICAR STATS: soot(0)= ", mss_cnc_aer_lcl(0,1) - - write (iulog,*) "SNICAR STATS: L_snw(-4)= ", L_snw(-4) - write (iulog,*) "SNICAR STATS: L_snw(-3)= ", L_snw(-3) - write (iulog,*) "SNICAR STATS: L_snw(-2)= ", L_snw(-2) - write (iulog,*) "SNICAR STATS: L_snw(-1)= ", L_snw(-1) - write (iulog,*) "SNICAR STATS: L_snw(0)= ", L_snw(0) - - write (iulog,*) "SNICAR STATS: snw_rds(-4)= ", snw_rds(c_idx,-4) - write (iulog,*) "SNICAR STATS: snw_rds(-3)= ", snw_rds(c_idx,-3) - write (iulog,*) "SNICAR STATS: snw_rds(-2)= ", snw_rds(c_idx,-2) - write (iulog,*) "SNICAR STATS: snw_rds(-1)= ", snw_rds(c_idx,-1) - write (iulog,*) "SNICAR STATS: snw_rds(0)= ", snw_rds(c_idx,0) - - call endrun() - endif - - enddo ! loop over wvl bands - - - ! Weight output NIR albedo appropriately - albout(c_idx,1) = albout_lcl(1) - flx_sum = 0._r8 - do bnd_idx= nir_bnd_bgn,nir_bnd_end - flx_sum = flx_sum + flx_wgt(bnd_idx)*albout_lcl(bnd_idx) - end do - albout(c_idx,2) = flx_sum / sum(flx_wgt(nir_bnd_bgn:nir_bnd_end)) - - ! Weight output NIR absorbed layer fluxes (flx_abs) appropriately - flx_abs(c_idx,:,1) = flx_abs_lcl(:,1) - do i=snl_top,1,1 - flx_sum = 0._r8 - do bnd_idx= nir_bnd_bgn,nir_bnd_end - flx_sum = flx_sum + flx_wgt(bnd_idx)*flx_abs_lcl(i,bnd_idx) - enddo - flx_abs(c_idx,i,2) = flx_sum / sum(flx_wgt(nir_bnd_bgn:nir_bnd_end)) - end do - - ! If snow < minimum_snow, but > 0, and there is sun, set albedo to underlying surface albedo - elseif ( (coszen(c_idx) > 0._r8) .and. (h2osno_lcl < min_snw) .and. (h2osno_lcl > 0._r8) ) then - albout(c_idx,1) = albsfc(c_idx,1) - albout(c_idx,2) = albsfc(c_idx,2) - - ! There is either zero snow, or no sun - else - albout(c_idx,1) = 0._r8 - albout(c_idx,2) = 0._r8 - endif ! if column has snow and coszen > 0 - - enddo ! loop over all columns - - - end subroutine SNICAR_RT - - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SnowAge_grain -! -! !INTERFACE: - subroutine SnowAge_grain(lbc, ubc, num_snowc, filter_snowc, num_nosnowc, filter_nosnowc) - ! - ! !DESCRIPTION: - ! Updates the snow effective grain size (radius). - ! Contributions to grain size evolution are from: - ! 1. vapor redistribution (dry snow) - ! 2. liquid water redistribution (wet snow) - ! 3. re-freezing of liquid water - ! - ! Vapor redistribution: Method is to retrieve 3 best-bit parameters that - ! depend on snow temperature, temperature gradient, and density, - ! that are derived from the microphysical model described in: - ! Flanner and Zender (2006), Linking snowpack microphysics and albedo - ! evolution, J. Geophys. Res., 111, D12208, doi:10.1029/2005JD006834. - ! The parametric equation has the form: - ! dr/dt = drdt_0*(tau/(dr_fresh+tau))^(1/kappa), where: - ! r is the effective radius, - ! tau and kappa are best-fit parameters, - ! drdt_0 is the initial rate of change of effective radius, and - ! dr_fresh is the difference between the current and fresh snow states - ! (r_current - r_fresh). - ! - ! Liquid water redistribution: Apply the grain growth function from: - ! Brun, E. (1989), Investigation of wet-snow metamorphism in respect of - ! liquid-water content, Annals of Glaciology, 13, 22-26. - ! There are two parameters that describe the grain growth rate as - ! a function of snow liquid water content (LWC). The "LWC=0" parameter - ! is zeroed here because we are accounting for dry snowing with a - ! different representation - ! - ! Re-freezing of liquid water: Assume that re-frozen liquid water clumps - ! into an arbitrarily large effective grain size (snw_rds_refrz). - ! The phenomenon is observed (Grenfell), but so far unquantified, as far as - ! I am aware. - ! - ! - ! !USES: - use clmtype - use clm_time_manager , only : get_step_size, get_nstep - use clm_varpar , only : nlevsno - use clm_varcon , only : spval - use abortutils , only : endrun - use shr_const_mod , only : SHR_CONST_RHOICE, SHR_CONST_PI - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_snowc ! number of column snow points in column filter - integer, intent(in) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(in) :: num_nosnowc ! number of column non-snow points in column filter - integer, intent(in) :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points - ! - ! - ! !CALLED FROM: clm_driver1 - ! - - ! !LOCAL VARIABLES: - ! - ! local pointers to implicit arguments - ! - - real(r8), pointer :: t_soisno(:,:) ! soil and snow temperature (col,lyr) [K] - integer, pointer :: snl(:) ! negative number of snow layers (col) [nbr] - real(r8), pointer :: t_grnd(:) ! ground temperature (col) [K] - real(r8), pointer :: dz(:,:) ! layer thickness (col,lyr) [m] - real(r8), pointer :: h2osno(:) ! snow water (col) [mm H2O] - real(r8), pointer :: snw_rds(:,:) ! effective grain radius (col,lyr) [microns, m-6] - real(r8), pointer :: snw_rds_top(:) ! effective grain radius, top layer (col) [microns, m-6] - real(r8), pointer :: sno_liq_top(:) ! liquid water fraction (mass) in top snow layer (col) [frc] - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water content (col,lyr) [kg m-2] - real(r8), pointer :: h2osoi_ice(:,:) ! ice content (col,lyr) [kg m-2] - real(r8), pointer :: snot_top(:) ! snow temperature in top layer (col) [K] - real(r8), pointer :: dTdz_top(:) ! temperature gradient in top layer (col) [K m-1] - real(r8), pointer :: qflx_snow_grnd_col(:) ! snow on ground after interception (col) [kg m-2 s-1] - real(r8), pointer :: qflx_snwcp_ice(:) ! excess precipitation due to snow capping [kg m-2 s-1] - real(r8), pointer :: qflx_snofrz_lyr(:,:) ! snow freezing rate (col,lyr) [kg m-2 s-1] - logical , pointer :: do_capsnow(:) ! true => do snow capping - - ! - ! !OTHER LOCAL VARIABLES: - ! - integer :: snl_top ! top snow layer index [idx] - integer :: snl_btm ! bottom snow layer index [idx] - integer :: i ! layer index [idx] - integer :: c_idx ! column index [idx] - integer :: fc ! snow column filter index [idx] - integer :: T_idx ! snow aging lookup table temperature index [idx] - integer :: Tgrd_idx ! snow aging lookup table temperature gradient index [idx] - integer :: rhos_idx ! snow aging lookup table snow density index [idx] - real(r8) :: t_snotop ! temperature at upper layer boundary [K] - real(r8) :: t_snobtm ! temperature at lower layer boundary [K] - real(r8) :: dTdz(lbc:ubc,-nlevsno:0) ! snow temperature gradient (col,lyr) [K m-1] - real(r8) :: bst_tau ! snow aging parameter retrieved from lookup table [hour] - real(r8) :: bst_kappa ! snow aging parameter retrieved from lookup table [unitless] - real(r8) :: bst_drdt0 ! snow aging parameter retrieved from lookup table [um hr-1] - real(r8) :: dr ! incremental change in snow effective radius [um] - real(r8) :: dr_wet ! incremental change in snow effective radius from wet growth [um] - real(r8) :: dr_fresh ! difference between fresh snow r_e and current r_e [um] - real(r8) :: newsnow ! fresh snowfall [kg m-2] - real(r8) :: refrzsnow ! re-frozen snow [kg m-2] - real(r8) :: frc_newsnow ! fraction of layer mass that is new snow [frc] - real(r8) :: frc_oldsnow ! fraction of layer mass that is old snow [frc] - real(r8) :: frc_refrz ! fraction of layer mass that is re-frozen snow [frc] - real(r8) :: frc_liq ! fraction of layer mass that is liquid water[frc] - real(r8) :: dtime ! land model time step [sec] - real(r8) :: rhos ! snow density [kg m-3] - real(r8) :: h2osno_lyr ! liquid + solid H2O in snow layer [kg m-2] - - - ! Assign local pointers to derived subtypes components (column-level) - t_soisno => ces%t_soisno - snl => cps%snl - t_grnd => ces%t_grnd - dz => cps%dz - h2osno => cws%h2osno - snw_rds => cps%snw_rds - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - snot_top => cps%snot_top - dTdz_top => cps%dTdz_top - snw_rds_top => cps%snw_rds_top - sno_liq_top => cps%sno_liq_top - qflx_snow_grnd_col => pwf_a%qflx_snow_grnd - qflx_snwcp_ice => pwf_a%qflx_snwcp_ice - qflx_snofrz_lyr => cwf%qflx_snofrz_lyr - do_capsnow => cps%do_capsnow - - - ! set timestep and step interval - dtime = get_step_size() - - ! loop over columns that have at least one snow layer - do fc = 1, num_snowc - c_idx = filter_snowc(fc) - - snl_btm = 0 - snl_top = snl(c_idx) + 1 - - ! loop over snow layers - do i=snl_top,snl_btm,1 - ! - !********** 1. DRY SNOW AGING *********** - ! - h2osno_lyr = h2osoi_liq(c_idx,i) + h2osoi_ice(c_idx,i) - - ! temperature gradient - if (i == snl_top) then - ! top layer - t_snotop = t_grnd(c_idx) - t_snobtm = (t_soisno(c_idx,i+1)*dz(c_idx,i) + t_soisno(c_idx,i)*dz(c_idx,i+1)) / (dz(c_idx,i)+dz(c_idx,i+1)) - else - t_snotop = (t_soisno(c_idx,i-1)*dz(c_idx,i) + t_soisno(c_idx,i)*dz(c_idx,i-1)) / (dz(c_idx,i)+dz(c_idx,i-1)) - t_snobtm = (t_soisno(c_idx,i+1)*dz(c_idx,i) + t_soisno(c_idx,i)*dz(c_idx,i+1)) / (dz(c_idx,i)+dz(c_idx,i+1)) - endif - - dTdz(c_idx,i) = abs((t_snotop - t_snobtm) / dz(c_idx,i)) - - ! snow density - rhos = (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)) / dz(c_idx,i) - - ! best-fit table indecies - T_idx = nint((t_soisno(c_idx,i)-223) / 5) + 1 - Tgrd_idx = nint(dTdz(c_idx,i) / 10) + 1 - rhos_idx = nint((rhos-50) / 50) + 1 - - ! boundary check: - if (T_idx < idx_T_min) then - T_idx = idx_T_min - endif - if (T_idx > idx_T_max) then - T_idx = idx_T_max - endif - if (Tgrd_idx < idx_Tgrd_min) then - Tgrd_idx = idx_Tgrd_min - endif - if (Tgrd_idx > idx_Tgrd_max) then - Tgrd_idx = idx_Tgrd_max - endif - if (rhos_idx < idx_rhos_min) then - rhos_idx = idx_rhos_min - endif - if (rhos_idx > idx_rhos_max) then - rhos_idx = idx_rhos_max - endif - - ! best-fit parameters - bst_tau = snowage_tau(rhos_idx,Tgrd_idx,T_idx) - bst_kappa = snowage_kappa(rhos_idx,Tgrd_idx,T_idx) - bst_drdt0 = snowage_drdt0(rhos_idx,Tgrd_idx,T_idx) - - - ! change in snow effective radius, using best-fit parameters - dr_fresh = snw_rds(c_idx,i)-snw_rds_min - dr = (bst_drdt0*(bst_tau/(dr_fresh+bst_tau))**(1/bst_kappa)) * (dtime/3600) - - - ! - !********** 2. WET SNOW AGING *********** - ! - ! We are assuming wet and dry evolution occur simultaneously, and - ! the contributions from both can be summed. - ! This is justified by setting the linear offset constant C1_liq_Brun89 to zero [Brun, 1989] - - ! liquid water faction - frc_liq = min(0.1_r8, (h2osoi_liq(c_idx,i) / (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)))) - - !dr_wet = 1E6_r8*(dtime*(C1_liq_Brun89 + C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*(snw_rds(c_idx,i)/1E6)**(2))) - !simplified, units of microns: - dr_wet = 1E18_r8*(dtime*(C2_liq_Brun89*(frc_liq**(3))) / (4*SHR_CONST_PI*snw_rds(c_idx,i)**(2))) - - dr = dr + dr_wet - - ! - !********** 3. SNOWAGE SCALING (TURNED OFF BY DEFAULT) ************* - ! - ! Multiply rate of change of effective radius by some constant, xdrdt - if (flg_snoage_scl) then - dr = dr*xdrdt - endif - - - ! - !********** 4. INCREMENT EFFECTIVE RADIUS, ACCOUNTING FOR: *********** - ! DRY AGING - ! WET AGING - ! FRESH SNOW - ! RE-FREEZING - ! - ! new snowfall [kg/m2] - if (do_capsnow(c_idx)) then - newsnow = max(0._r8, (qflx_snwcp_ice(c_idx)*dtime)) - else - newsnow = max(0._r8, (qflx_snow_grnd_col(c_idx)*dtime)) - endif - - ! snow that has re-frozen [kg/m2] - refrzsnow = max(0._r8, (qflx_snofrz_lyr(c_idx,i)*dtime)) - - ! fraction of layer mass that is re-frozen - frc_refrz = refrzsnow / h2osno_lyr - - ! fraction of layer mass that is new snow - if (i == snl_top) then - frc_newsnow = newsnow / h2osno_lyr - else - frc_newsnow = 0._r8 - endif - - if ((frc_refrz + frc_newsnow) > 1._r8) then - frc_refrz = frc_refrz / (frc_refrz + frc_newsnow) - frc_newsnow = 1._r8 - frc_refrz - frc_oldsnow = 0._r8 - else - frc_oldsnow = 1._r8 - frc_refrz - frc_newsnow - endif - - ! mass-weighted mean of fresh snow, old snow, and re-frozen snow effective radius - snw_rds(c_idx,i) = (snw_rds(c_idx,i)+dr)*frc_oldsnow + snw_rds_min*frc_newsnow + snw_rds_refrz*frc_refrz - - - ! - !********** 5. CHECK BOUNDARIES *********** - ! - ! boundary check - if (snw_rds(c_idx,i) < snw_rds_min) then - snw_rds(c_idx,i) = snw_rds_min - endif - - if (snw_rds(c_idx,i) > snw_rds_max) then - snw_rds(c_idx,i) = snw_rds_max - end if - - ! set top layer variables for history files - if (i == snl_top) then - snot_top(c_idx) = t_soisno(c_idx,i) - dTdz_top(c_idx) = dTdz(c_idx,i) - snw_rds_top(c_idx) = snw_rds(c_idx,i) - sno_liq_top(c_idx) = h2osoi_liq(c_idx,i) / (h2osoi_liq(c_idx,i)+h2osoi_ice(c_idx,i)) - endif - - enddo - enddo - - ! Special case: snow on ground, but not enough to have defined a snow layer: - ! set snw_rds to fresh snow grain size: - do fc = 1, num_nosnowc - c_idx = filter_nosnowc(fc) - if (h2osno(c_idx) > 0._r8) then - snw_rds(c_idx,0) = snw_rds_min - endif - enddo - - end subroutine SnowAge_grain - - subroutine SnowOptics_init( ) - use fileutils , only : getfil - use CLM_varctl , only : fsnowoptics - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - - type(file_desc_t) :: ncid ! netCDF file id - character(len=256) :: locfn ! local filename - character(len= 32) :: subname = 'SnowOptics_init' ! subroutine name - integer :: ier ! error status - - - ! - ! Open optics file: - if(masterproc) write(iulog,*) 'Attempting to read snow optical properties .....' - call getfil (fsnowoptics, locfn, 0) - call ncd_pio_openfile(ncid, locfn, 0) - if(masterproc) write(iulog,*) subname,trim(fsnowoptics) - - ! direct-beam snow Mie parameters: - call ncd_io('ss_alb_ice_drc', ss_alb_snw_drc, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ice_drc',asm_prm_snw_drc, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ice_drc', ext_cff_mss_snw_drc, 'read', ncid, posNOTonfile=.true.) - - ! diffuse snow Mie parameters - call ncd_io( 'ss_alb_ice_dfs', ss_alb_snw_dfs, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ice_dfs', asm_prm_snw_dfs, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ice_dfs', ext_cff_mss_snw_dfs, 'read', ncid, posNOTonfile=.true.) - - ! BC species 1 Mie parameters - call ncd_io( 'ss_alb_bcphil', ss_alb_bc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_bcphil', asm_prm_bc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_bcphil', ext_cff_mss_bc1, 'read', ncid, posNOTonfile=.true.) - - ! BC species 2 Mie parameters - call ncd_io( 'ss_alb_bcphob', ss_alb_bc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_bcphob', asm_prm_bc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_bcphob', ext_cff_mss_bc2, 'read', ncid, posNOTonfile=.true.) - - ! OC species 1 Mie parameters - call ncd_io( 'ss_alb_ocphil', ss_alb_oc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ocphil', asm_prm_oc1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ocphil', ext_cff_mss_oc1, 'read', ncid, posNOTonfile=.true.) - - ! OC species 2 Mie parameters - call ncd_io( 'ss_alb_ocphob', ss_alb_oc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_ocphob', asm_prm_oc2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_ocphob', ext_cff_mss_oc2, 'read', ncid, posNOTonfile=.true.) - - ! dust species 1 Mie parameters - call ncd_io( 'ss_alb_dust01', ss_alb_dst1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust01', asm_prm_dst1, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust01', ext_cff_mss_dst1, 'read', ncid, posNOTonfile=.true.) - - ! dust species 2 Mie parameters - call ncd_io( 'ss_alb_dust02', ss_alb_dst2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust02', asm_prm_dst2, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust02', ext_cff_mss_dst2, 'read', ncid, posNOTonfile=.true.) - - ! dust species 3 Mie parameters - call ncd_io( 'ss_alb_dust03', ss_alb_dst3, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust03', asm_prm_dst3, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust03', ext_cff_mss_dst3, 'read', ncid, posNOTonfile=.true.) - - ! dust species 4 Mie parameters - call ncd_io( 'ss_alb_dust04', ss_alb_dst4, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'asm_prm_dust04', asm_prm_dst4, 'read', ncid, posNOTonfile=.true.) - call ncd_io( 'ext_cff_mss_dust04', ext_cff_mss_dst4, 'read', ncid, posNOTonfile=.true.) - - - call ncd_pio_closefile(ncid) - if (masterproc) then - - write(iulog,*) 'Successfully read snow optical properties' - ! print some diagnostics: - write (iulog,*) 'SNICAR: Mie single scatter albedos for direct-beam ice, rds=100um: ', & - ss_alb_snw_drc(71,1), ss_alb_snw_drc(71,2), ss_alb_snw_drc(71,3), & - ss_alb_snw_drc(71,4), ss_alb_snw_drc(71,5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for diffuse ice, rds=100um: ', & - ss_alb_snw_dfs(71,1), ss_alb_snw_dfs(71,2), ss_alb_snw_dfs(71,3), & - ss_alb_snw_dfs(71,4), ss_alb_snw_dfs(71,5) - if (DO_SNO_OC) then - write (iulog,*) 'SNICAR: Including OC aerosols from snow radiative transfer calculations' - else - write (iulog,*) 'SNICAR: Excluding OC aerosols from snow radiative transfer calculations' - endif - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophillic BC: ', & - ss_alb_bc1(1), ss_alb_bc1(2), ss_alb_bc1(3), ss_alb_bc1(4), ss_alb_bc1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophobic BC: ', & - ss_alb_bc2(1), ss_alb_bc2(2), ss_alb_bc2(3), ss_alb_bc2(4), ss_alb_bc2(5) - if (DO_SNO_OC) then - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophillic OC: ', & - ss_alb_oc1(1), ss_alb_oc1(2), ss_alb_oc1(3), ss_alb_oc1(4), ss_alb_oc1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for hydrophobic OC: ', & - ss_alb_oc2(1), ss_alb_oc2(2), ss_alb_oc2(3), ss_alb_oc2(4), ss_alb_oc2(5) - endif - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 1: ', & - ss_alb_dst1(1), ss_alb_dst1(2), ss_alb_dst1(3), ss_alb_dst1(4), ss_alb_dst1(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 2: ', & - ss_alb_dst2(1), ss_alb_dst2(2), ss_alb_dst2(3), ss_alb_dst2(4), ss_alb_dst2(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 3: ', & - ss_alb_dst3(1), ss_alb_dst3(2), ss_alb_dst3(3), ss_alb_dst3(4), ss_alb_dst3(5) - write (iulog,*) 'SNICAR: Mie single scatter albedos for dust species 4: ', & - ss_alb_dst4(1), ss_alb_dst4(2), ss_alb_dst4(3), ss_alb_dst4(4), ss_alb_dst4(5) - write(iulog,*) - end if - - end subroutine SnowOptics_init - - subroutine SnowAge_init( ) - use CLM_varctl , only : fsnowaging - use fileutils , only : getfil - use spmdMod , only : masterproc - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - - type(file_desc_t) :: ncid ! netCDF file id - character(len=256) :: locfn ! local filename - character(len= 32) :: subname = 'SnowOptics_init' ! subroutine name - integer :: varid ! netCDF id's - integer :: ier ! error status - - ! Open snow aging (effective radius evolution) file: - allocate(snowage_tau(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - allocate(snowage_kappa(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - allocate(snowage_drdt0(idx_rhos_max,idx_Tgrd_max,idx_T_max)) - - if(masterproc) write(iulog,*) 'Attempting to read snow aging parameters .....' - call getfil (fsnowaging, locfn, 0) - call ncd_pio_openfile(ncid, locfn, 0) - if(masterproc) write(iulog,*) subname,trim(fsnowaging) - - ! snow aging parameters - - call ncd_io('tau', snowage_tau, 'read', ncid, posNOTonfile=.true.) - call ncd_io('kappa', snowage_kappa, 'read', ncid, posNOTonfile=.true.) - call ncd_io('drdsdt0', snowage_drdt0, 'read', ncid, posNOTonfile=.true.) - - call ncd_pio_closefile(ncid) - if (masterproc) then - - write(iulog,*) 'Successfully read snow aging properties' - - ! print some diagnostics: - write (iulog,*) 'SNICAR: snowage tau for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_tau(3,11,9) - write (iulog,*) 'SNICAR: snowage kappa for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_kappa(3,11,9) - write (iulog,*) 'SNICAR: snowage dr/dt_0 for T=263K, dTdz = 100 K/m, rhos = 150 kg/m3: ', snowage_drdt0(3,11,9) - endif - - end subroutine SnowAge_init - - -end module SNICARMod diff --git a/src_clm40/biogeophys/SnowHydrologyMod.F90 b/src_clm40/biogeophys/SnowHydrologyMod.F90 deleted file mode 100644 index ecd92bc640..0000000000 --- a/src_clm40/biogeophys/SnowHydrologyMod.F90 +++ /dev/null @@ -1,1650 +0,0 @@ -module SnowHydrologyMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: SnowHydrologyMod -! -! !DESCRIPTION: -! Calculate snow hydrology. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varpar , only : nlevsno -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SnowWater ! Change of snow mass and the snow water onto soil - public :: SnowCompaction ! Change in snow layer thickness due to compaction - public :: CombineSnowLayers ! Combine snow layers less than a min thickness - public :: DivideSnowLayers ! Subdivide snow layers if they exceed maximum thickness - public :: BuildSnowFilter ! Construct snow/no-snow filters -! -! !PRIVATE MEMBER FUNCTIONS: - private :: Combo ! Returns the combined variables: dz, t, wliq, wice. -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SnowWater -! -! !INTERFACE: - subroutine SnowWater(lbc, ubc, num_snowc, filter_snowc, & - num_nosnowc, filter_nosnowc) -! -! !DESCRIPTION: -! Evaluate the change of snow mass and the snow water onto soil. -! Water flow within snow is computed by an explicit and non-physical -! based scheme, which permits a part of liquid water over the holding -! capacity (a tentative value is used, i.e. equal to 0.033*porosity) to -! percolate into the underlying layer. Except for cases where the -! porosity of one of the two neighboring layers is less than 0.05, zero -! flow is assumed. The water flow out of the bottom of the snow pack will -! participate as the input of the soil water and runoff. This subroutine -! uses a filter for columns containing snow which must be constructed prior -! to being called. -! -! !USES: - use clmtype - use clm_varcon , only : denh2o, denice, wimp, ssi - use clm_time_manager, only : get_step_size - use clm_atmlnd , only : clm_a2l - use SNICARMod , only : scvng_fct_mlt_bcphi, scvng_fct_mlt_bcpho, & - scvng_fct_mlt_ocphi, scvng_fct_mlt_ocpho, & - scvng_fct_mlt_dst1, scvng_fct_mlt_dst2, & - scvng_fct_mlt_dst3, scvng_fct_mlt_dst4 -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_snowc ! number of snow points in column filter - integer, intent(in) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(in) :: num_nosnowc ! number of non-snow points in column filter - integer, intent(in) :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 15 November 2000: Mariana Vertenstein -! 2/26/02, Peter Thornton: Migrated to new data structures. -! 03/28/08, Mark Flanner: Added aerosol deposition and flushing with meltwater -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: snl(:) !number of snow layers - logical , pointer :: do_capsnow(:) !true => do snow capping - real(r8), pointer :: qflx_snow_melt(:) !net snow melt - real(r8), pointer :: qflx_snomelt(:) !snow melt (mm H2O /s) - real(r8), pointer :: qflx_rain_grnd(:) !rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_sub_snow(:) !sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_evap_grnd(:) !ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_dew_snow(:) !surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd(:) !ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: dz(:,:) !layer depth (m) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: qflx_top_soil(:) !net water input into soil from top (mm/s) -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) - integer , pointer :: cgridcell(:) ! columns's gridcell (col) - real(r8), pointer :: mss_bcphi(:,:) ! hydrophillic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcpho(:,:) ! hydrophobic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! hydrophillic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocpho(:,:) ! hydrophobic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst1(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer :: flx_bc_dep_dry(:) ! dry BC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_bc_dep_wet(:) ! wet BC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_bc_dep(:) ! total BC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_bc_dep_pho(:) ! hydrophobic BC deposition (col) [kg m-1 s-1] - real(r8), pointer :: flx_bc_dep_phi(:) ! hydrophillic BC deposition (col) [kg m-1 s-1] - real(r8), pointer :: flx_oc_dep_dry(:) ! dry OC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_oc_dep_wet(:) ! wet OC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_oc_dep(:) ! total OC deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_oc_dep_pho(:) ! hydrophobic OC deposition (col) [kg m-1 s-1] - real(r8), pointer :: flx_oc_dep_phi(:) ! hydrophillic OC deposition (col) [kg m-1 s-1] - real(r8), pointer :: flx_dst_dep_dry1(:) ! dry dust (species 1) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_wet1(:) ! wet dust (species 1) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_dry2(:) ! dry dust (species 2) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_wet2(:) ! wet dust (species 2) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_dry3(:) ! dry dust (species 3) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_wet3(:) ! wet dust (species 3) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_dry4(:) ! dry dust (species 4) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep_wet4(:) ! wet dust (species 4) deposition (col) [kg m-2 s-1] - real(r8), pointer :: flx_dst_dep(:) ! total dust deposition (col) [kg m-2 s-1] - real(r8), pointer :: forc_aer(:,:) ! aerosol deposition from atmosphere model (grd,aer) [kg m-1 s-1] -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: c, j, fc !do loop/array indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: qin(lbc:ubc) !water flow into the elmement (mm/s) - real(r8) :: qout(lbc:ubc) !water flow out of the elmement (mm/s) - real(r8) :: wgdif !ice mass after minus sublimation - real(r8) :: vol_liq(lbc:ubc,-nlevsno+1:0) !partial volume of liquid water in layer - real(r8) :: vol_ice(lbc:ubc,-nlevsno+1:0) !partial volume of ice lens in layer - real(r8) :: eff_porosity(lbc:ubc,-nlevsno+1:0) !effective porosity = porosity - vol_ice - integer :: g ! gridcell loop index - real(r8) :: qin_bc_phi(lbc:ubc) ! flux of hydrophilic BC into layer [kg] - real(r8) :: qout_bc_phi(lbc:ubc) ! flux of hydrophilic BC out of layer [kg] - real(r8) :: qin_bc_pho(lbc:ubc) ! flux of hydrophobic BC into layer [kg] - real(r8) :: qout_bc_pho(lbc:ubc) ! flux of hydrophobic BC out of layer [kg] - real(r8) :: qin_oc_phi(lbc:ubc) ! flux of hydrophilic OC into layer [kg] - real(r8) :: qout_oc_phi(lbc:ubc) ! flux of hydrophilic OC out of layer [kg] - real(r8) :: qin_oc_pho(lbc:ubc) ! flux of hydrophobic OC into layer [kg] - real(r8) :: qout_oc_pho(lbc:ubc) ! flux of hydrophobic OC out of layer [kg] - real(r8) :: qin_dst1(lbc:ubc) ! flux of dust species 1 into layer [kg] - real(r8) :: qout_dst1(lbc:ubc) ! flux of dust species 1 out of layer [kg] - real(r8) :: qin_dst2(lbc:ubc) ! flux of dust species 2 into layer [kg] - real(r8) :: qout_dst2(lbc:ubc) ! flux of dust species 2 out of layer [kg] - real(r8) :: qin_dst3(lbc:ubc) ! flux of dust species 3 into layer [kg] - real(r8) :: qout_dst3(lbc:ubc) ! flux of dust species 3 out of layer [kg] - real(r8) :: qin_dst4(lbc:ubc) ! flux of dust species 4 into layer [kg] - real(r8) :: qout_dst4(lbc:ubc) ! flux of dust species 4 out of layer [kg] - real(r8) :: mss_liqice ! mass of liquid+ice in a layer - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtype components (column-level) - - snl => cps%snl - do_capsnow => cps%do_capsnow - qflx_snow_melt => cwf%qflx_snow_melt - qflx_snomelt => cwf%qflx_snomelt - qflx_rain_grnd => pwf_a%qflx_rain_grnd - qflx_sub_snow => pwf_a%qflx_sub_snow - qflx_evap_grnd => pwf_a%qflx_evap_grnd - qflx_dew_snow => pwf_a%qflx_dew_snow - qflx_dew_grnd => pwf_a%qflx_dew_grnd - qflx_top_soil => cwf%qflx_top_soil - dz => cps%dz - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - cgridcell => col%gridcell - mss_bcphi => cps%mss_bcphi - mss_bcpho => cps%mss_bcpho - mss_ocphi => cps%mss_ocphi - mss_ocpho => cps%mss_ocpho - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - flx_bc_dep => cwf%flx_bc_dep - flx_bc_dep_wet => cwf%flx_bc_dep_wet - flx_bc_dep_dry => cwf%flx_bc_dep_dry - flx_bc_dep_phi => cwf%flx_bc_dep_phi - flx_bc_dep_pho => cwf%flx_bc_dep_pho - flx_oc_dep => cwf%flx_oc_dep - flx_oc_dep_wet => cwf%flx_oc_dep_wet - flx_oc_dep_dry => cwf%flx_oc_dep_dry - flx_oc_dep_phi => cwf%flx_oc_dep_phi - flx_oc_dep_pho => cwf%flx_oc_dep_pho - flx_dst_dep => cwf%flx_dst_dep - flx_dst_dep_wet1 => cwf%flx_dst_dep_wet1 - flx_dst_dep_dry1 => cwf%flx_dst_dep_dry1 - flx_dst_dep_wet2 => cwf%flx_dst_dep_wet2 - flx_dst_dep_dry2 => cwf%flx_dst_dep_dry2 - flx_dst_dep_wet3 => cwf%flx_dst_dep_wet3 - flx_dst_dep_dry3 => cwf%flx_dst_dep_dry3 - flx_dst_dep_wet4 => cwf%flx_dst_dep_wet4 - flx_dst_dep_dry4 => cwf%flx_dst_dep_dry4 - forc_aer => clm_a2l%forc_aer - - ! Determine model time step - - dtime = get_step_size() - - ! Renew the mass of ice lens (h2osoi_ice) and liquid (h2osoi_liq) in the - ! surface snow layer resulting from sublimation (frost) / evaporation (condense) - - do fc = 1,num_snowc - c = filter_snowc(fc) - if (do_capsnow(c)) then - wgdif = h2osoi_ice(c,snl(c)+1) - qflx_sub_snow(c)*dtime - h2osoi_ice(c,snl(c)+1) = wgdif - if (wgdif < 0._r8) then - h2osoi_ice(c,snl(c)+1) = 0._r8 - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + wgdif - end if - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) - qflx_evap_grnd(c) * dtime - else - wgdif = h2osoi_ice(c,snl(c)+1) + (qflx_dew_snow(c) - qflx_sub_snow(c)) * dtime - h2osoi_ice(c,snl(c)+1) = wgdif - if (wgdif < 0._r8) then - h2osoi_ice(c,snl(c)+1) = 0._r8 - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + wgdif - end if - h2osoi_liq(c,snl(c)+1) = h2osoi_liq(c,snl(c)+1) + & - (qflx_rain_grnd(c) + qflx_dew_grnd(c) - qflx_evap_grnd(c)) * dtime - end if - h2osoi_liq(c,snl(c)+1) = max(0._r8, h2osoi_liq(c,snl(c)+1)) - end do - - ! Porosity and partial volume - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - vol_ice(c,j) = min(1._r8, h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity(c,j) = 1._r8 - vol_ice(c,j) - vol_liq(c,j) = min(eff_porosity(c,j),h2osoi_liq(c,j)/(dz(c,j)*denh2o)) - end if - end do - end do - - ! Capillary forces within snow are usually two or more orders of magnitude - ! less than those of gravity. Only gravity terms are considered. - ! the genernal expression for water flow is "K * ss**3", however, - ! no effective parameterization for "K". Thus, a very simple consideration - ! (not physically based) is introduced: - ! when the liquid water of layer exceeds the layer's holding - ! capacity, the excess meltwater adds to the underlying neighbor layer. - - ! Also compute aerosol fluxes through snowpack in this loop: - ! 1) compute aerosol mass in each layer - ! 2) add aerosol mass flux from above layer to mass of this layer - ! 3) qout_xxx is mass flux of aerosol species xxx out bottom of - ! layer in water flow, proportional to (current) concentration - ! of aerosol in layer multiplied by a scavenging ratio. - ! 4) update mass of aerosol in top layer, accordingly - ! 5) update mass concentration of aerosol accordingly - - qin(:) = 0._r8 - qin_bc_phi(:) = 0._r8 - qin_bc_pho(:) = 0._r8 - qin_oc_phi(:) = 0._r8 - qin_oc_pho(:) = 0._r8 - qin_dst1(:) = 0._r8 - qin_dst2(:) = 0._r8 - qin_dst3(:) = 0._r8 - qin_dst4(:) = 0._r8 - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - h2osoi_liq(c,j) = h2osoi_liq(c,j) + qin(c) - - mss_bcphi(c,j) = mss_bcphi(c,j) + qin_bc_phi(c) - mss_bcpho(c,j) = mss_bcpho(c,j) + qin_bc_pho(c) - mss_ocphi(c,j) = mss_ocphi(c,j) + qin_oc_phi(c) - mss_ocpho(c,j) = mss_ocpho(c,j) + qin_oc_pho(c) - mss_dst1(c,j) = mss_dst1(c,j) + qin_dst1(c) - mss_dst2(c,j) = mss_dst2(c,j) + qin_dst2(c) - mss_dst3(c,j) = mss_dst3(c,j) + qin_dst3(c) - mss_dst4(c,j) = mss_dst4(c,j) + qin_dst4(c) - - if (j <= -1) then - ! No runoff over snow surface, just ponding on surface - if (eff_porosity(c,j) < wimp .OR. eff_porosity(c,j+1) < wimp) then - qout(c) = 0._r8 - else - qout(c) = max(0._r8,(vol_liq(c,j)-ssi*eff_porosity(c,j))*dz(c,j)) - qout(c) = min(qout(c),(1._r8-vol_ice(c,j+1)-vol_liq(c,j+1))*dz(c,j+1)) - end if - else - qout(c) = max(0._r8,(vol_liq(c,j) - ssi*eff_porosity(c,j))*dz(c,j)) - end if - qout(c) = qout(c)*1000._r8 - h2osoi_liq(c,j) = h2osoi_liq(c,j) - qout(c) - qin(c) = qout(c) - - ! mass of ice+water: in extremely rare circumstances, this can - ! be zero, even though there is a snow layer defined. In - ! this case, set the mass to a very small value to - ! prevent division by zero. - mss_liqice = h2osoi_liq(c,j)+h2osoi_ice(c,j) - if (mss_liqice < 1E-30_r8) then - mss_liqice = 1E-30_r8 - endif - - ! BCPHI: - ! 1. flux with meltwater: - qout_bc_phi(c) = qout(c)*scvng_fct_mlt_bcphi*(mss_bcphi(c,j)/mss_liqice) - if (qout_bc_phi(c) > mss_bcphi(c,j)) then - qout_bc_phi(c) = mss_bcphi(c,j) - endif - mss_bcphi(c,j) = mss_bcphi(c,j) - qout_bc_phi(c) - qin_bc_phi(c) = qout_bc_phi(c) - - ! BCPHO: - ! 1. flux with meltwater: - qout_bc_pho(c) = qout(c)*scvng_fct_mlt_bcpho*(mss_bcpho(c,j)/mss_liqice) - if (qout_bc_pho(c) > mss_bcpho(c,j)) then - qout_bc_pho(c) = mss_bcpho(c,j) - endif - mss_bcpho(c,j) = mss_bcpho(c,j) - qout_bc_pho(c) - qin_bc_pho(c) = qout_bc_pho(c) - - ! OCPHI: - ! 1. flux with meltwater: - qout_oc_phi(c) = qout(c)*scvng_fct_mlt_ocphi*(mss_ocphi(c,j)/mss_liqice) - if (qout_oc_phi(c) > mss_ocphi(c,j)) then - qout_oc_phi(c) = mss_ocphi(c,j) - endif - mss_ocphi(c,j) = mss_ocphi(c,j) - qout_oc_phi(c) - qin_oc_phi(c) = qout_oc_phi(c) - - ! OCPHO: - ! 1. flux with meltwater: - qout_oc_pho(c) = qout(c)*scvng_fct_mlt_ocpho*(mss_ocpho(c,j)/mss_liqice) - if (qout_oc_pho(c) > mss_ocpho(c,j)) then - qout_oc_pho(c) = mss_ocpho(c,j) - endif - mss_ocpho(c,j) = mss_ocpho(c,j) - qout_oc_pho(c) - qin_oc_pho(c) = qout_oc_pho(c) - - ! DUST 1: - ! 1. flux with meltwater: - qout_dst1(c) = qout(c)*scvng_fct_mlt_dst1*(mss_dst1(c,j)/mss_liqice) - if (qout_dst1(c) > mss_dst1(c,j)) then - qout_dst1(c) = mss_dst1(c,j) - endif - mss_dst1(c,j) = mss_dst1(c,j) - qout_dst1(c) - qin_dst1(c) = qout_dst1(c) - - ! DUST 2: - ! 1. flux with meltwater: - qout_dst2(c) = qout(c)*scvng_fct_mlt_dst2*(mss_dst2(c,j)/mss_liqice) - if (qout_dst2(c) > mss_dst2(c,j)) then - qout_dst2(c) = mss_dst2(c,j) - endif - mss_dst2(c,j) = mss_dst2(c,j) - qout_dst2(c) - qin_dst2(c) = qout_dst2(c) - - ! DUST 3: - ! 1. flux with meltwater: - qout_dst3(c) = qout(c)*scvng_fct_mlt_dst3*(mss_dst3(c,j)/mss_liqice) - if (qout_dst3(c) > mss_dst3(c,j)) then - qout_dst3(c) = mss_dst3(c,j) - endif - mss_dst3(c,j) = mss_dst3(c,j) - qout_dst3(c) - qin_dst3(c) = qout_dst3(c) - - ! DUST 4: - ! 1. flux with meltwater: - qout_dst4(c) = qout(c)*scvng_fct_mlt_dst4*(mss_dst4(c,j)/mss_liqice) - if (qout_dst4(c) > mss_dst4(c,j)) then - qout_dst4(c) = mss_dst4(c,j) - endif - mss_dst4(c,j) = mss_dst4(c,j) - qout_dst4(c) - qin_dst4(c) = qout_dst4(c) - - end if - end do - end do - - ! Adjust layer thickness for any water+ice content changes in excess of previous - ! layer thickness. Strictly speaking, only necessary for top snow layer, but doing - ! it for all snow layers will catch problems with older initial files. - ! Layer interfaces (zi) and node depths (z) do not need adjustment here because they - ! are adjusted in CombineSnowLayers and are not used up to that point. - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - dz(c,j) = max(dz(c,j),h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice) - end if - end do - end do - - do fc = 1, num_snowc - c = filter_snowc(fc) - ! Qout from snow bottom - qflx_top_soil(c) = qout(c) / dtime - qflx_snow_melt(c) = qflx_snow_melt(c) + (qout(c) / dtime) - end do - - do fc = 1, num_nosnowc - c = filter_nosnowc(fc) - qflx_top_soil(c) = qflx_rain_grnd(c) + qflx_snomelt(c) - qflx_snow_melt(c) = qflx_snomelt(c) - end do - - ! set aerosol deposition fluxes from forcing array - ! The forcing array is either set from an external file - ! or from fluxes received from the atmosphere model - do c = lbc,ubc - g = cgridcell(c) - - flx_bc_dep_dry(c) = forc_aer(g,1) + forc_aer(g,2) - flx_bc_dep_wet(c) = forc_aer(g,3) - flx_bc_dep_phi(c) = forc_aer(g,1) + forc_aer(g,3) - flx_bc_dep_pho(c) = forc_aer(g,2) - flx_bc_dep(c) = forc_aer(g,1) + forc_aer(g,2) + forc_aer(g,3) - - flx_oc_dep_dry(c) = forc_aer(g,4) + forc_aer(g,5) - flx_oc_dep_wet(c) = forc_aer(g,6) - flx_oc_dep_phi(c) = forc_aer(g,4) + forc_aer(g,6) - flx_oc_dep_pho(c) = forc_aer(g,5) - flx_oc_dep(c) = forc_aer(g,4) + forc_aer(g,5) + forc_aer(g,6) - - flx_dst_dep_wet1(c) = forc_aer(g,7) - flx_dst_dep_dry1(c) = forc_aer(g,8) - flx_dst_dep_wet2(c) = forc_aer(g,9) - flx_dst_dep_dry2(c) = forc_aer(g,10) - flx_dst_dep_wet3(c) = forc_aer(g,11) - flx_dst_dep_dry3(c) = forc_aer(g,12) - flx_dst_dep_wet4(c) = forc_aer(g,13) - flx_dst_dep_dry4(c) = forc_aer(g,14) - flx_dst_dep(c) = forc_aer(g,7) + forc_aer(g,8) + forc_aer(g,9) + & - forc_aer(g,10) + forc_aer(g,11) + forc_aer(g,12) + & - forc_aer(g,13) + forc_aer(g,14) - - end do - - ! aerosol deposition fluxes into top layer - ! This is done after the inter-layer fluxes so that some aerosol - ! is in the top layer after deposition, and is not immediately - ! washed out before radiative calculations are done - do fc = 1, num_snowc - c = filter_snowc(fc) - mss_bcphi(c,snl(c)+1) = mss_bcphi(c,snl(c)+1) + (flx_bc_dep_phi(c)*dtime) - mss_bcpho(c,snl(c)+1) = mss_bcpho(c,snl(c)+1) + (flx_bc_dep_pho(c)*dtime) - mss_ocphi(c,snl(c)+1) = mss_ocphi(c,snl(c)+1) + (flx_oc_dep_phi(c)*dtime) - mss_ocpho(c,snl(c)+1) = mss_ocpho(c,snl(c)+1) + (flx_oc_dep_pho(c)*dtime) - - mss_dst1(c,snl(c)+1) = mss_dst1(c,snl(c)+1) + (flx_dst_dep_dry1(c) + flx_dst_dep_wet1(c))*dtime - mss_dst2(c,snl(c)+1) = mss_dst2(c,snl(c)+1) + (flx_dst_dep_dry2(c) + flx_dst_dep_wet2(c))*dtime - mss_dst3(c,snl(c)+1) = mss_dst3(c,snl(c)+1) + (flx_dst_dep_dry3(c) + flx_dst_dep_wet3(c))*dtime - mss_dst4(c,snl(c)+1) = mss_dst4(c,snl(c)+1) + (flx_dst_dep_dry4(c) + flx_dst_dep_wet4(c))*dtime - end do - - end subroutine SnowWater - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SnowCompaction -! -! !INTERFACE: - subroutine SnowCompaction(lbc, ubc, num_snowc, filter_snowc) -! -! !DESCRIPTION: -! Determine the change in snow layer thickness due to compaction and -! settling. -! Three metamorphisms of changing snow characteristics are implemented, -! i.e., destructive, overburden, and melt. The treatments of the former -! two are from SNTHERM.89 and SNTHERM.99 (1991, 1999). The contribution -! due to melt metamorphism is simply taken as a ratio of snow ice -! fraction after the melting versus before the melting. -! -! !USES: - use clmtype - use clm_time_manager, only : get_step_size - use clm_varcon , only : denice, denh2o, tfrz, istice_mec -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_snowc ! number of column snow points in column filter - integer, intent(in) :: filter_snowc(ubc-lbc+1) ! column filter for snow points -! -! !CALLED FROM: -! subroutine Hydrology2 in module Hydrology2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/28/02, Peter Thornton: Migrated to new data structures -! 2/29/08, David Lawrence: Revised snow overburden to be include 0.5 weight of current layer -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars -! - integer, pointer :: snl(:) !number of snow layers -! -! local pointers to implicit in arguments -! - integer, pointer :: imelt(:,:) !flag for melting (=1), freezing (=2), Not=0 - real(r8), pointer :: frac_iceold(:,:) !fraction of ice relative to the tot water - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) -! -! local pointers to implicit inout arguments -! - real(r8), pointer :: dz(:,:) !layer depth (m) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: j, l, c, fc ! indices - real(r8):: dtime ! land model time step (sec) - real(r8), parameter :: c2 = 23.e-3_r8 ! [m3/kg] - real(r8), parameter :: c3 = 2.777e-6_r8 ! [1/s] - real(r8), parameter :: c4 = 0.04_r8 ! [1/K] - real(r8), parameter :: c5 = 2.0_r8 ! - real(r8), parameter :: dm = 100.0_r8 ! Upper Limit on Destructive Metamorphism Compaction [kg/m3] - real(r8), parameter :: eta0 = 9.e+5_r8 ! The Viscosity Coefficient Eta0 [kg-s/m2] - real(r8) :: burden(lbc:ubc) ! pressure of overlying snow [kg/m2] - real(r8) :: ddz1 ! Rate of settling of snowpack due to destructive metamorphism. - real(r8) :: ddz2 ! Rate of compaction of snowpack due to overburden. - real(r8) :: ddz3 ! Rate of compaction of snowpack due to melt [1/s] - real(r8) :: dexpf ! expf=exp(-c4*(273.15-t_soisno)). - real(r8) :: fi ! Fraction of ice relative to the total water content at current time step - real(r8) :: td ! t_soisno - tfrz [K] - real(r8) :: pdzdtc ! Nodal rate of change in fractional-thickness due to compaction [fraction/s] - real(r8) :: void ! void (1 - vol_ice - vol_liq) - real(r8) :: wx ! water mass (ice+liquid) [kg/m2] - real(r8) :: bi ! partial density of ice [kg/m3] - - integer, pointer :: clandunit(:) !landunit index for each column - integer, pointer :: ltype(:) !landunit type - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes (column-level) - - snl => cps%snl - dz => cps%dz - imelt => cps%imelt - frac_iceold => cps%frac_iceold - t_soisno => ces%t_soisno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - clandunit => col%landunit - ltype => lun%itype - - ! Get time step - - dtime = get_step_size() - - ! Begin calculation - note that the following column loops are only invoked if snl(c) < 0 - - burden(:) = 0._r8 - - do j = -nlevsno+1, 0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - - wx = h2osoi_ice(c,j) + h2osoi_liq(c,j) - void = 1._r8 - (h2osoi_ice(c,j)/denice + h2osoi_liq(c,j)/denh2o) / dz(c,j) - - ! If void is negative, then increase dz such that void = 0. - ! This should be done for any landunit, but for now is done only for glacier_mec 1andunits. - l = clandunit(c) - if (ltype(l)==istice_mec .and. void < 0._r8) then - dz(c,j) = h2osoi_ice(c,j)/denice + h2osoi_liq(c,j)/denh2o - void = 0._r8 - endif - - ! Allow compaction only for non-saturated node and higher ice lens node. - if (void > 0.001_r8 .and. h2osoi_ice(c,j) > .1_r8) then - bi = h2osoi_ice(c,j) / dz(c,j) - fi = h2osoi_ice(c,j) / wx - td = tfrz-t_soisno(c,j) - dexpf = exp(-c4*td) - - ! Settling as a result of destructive metamorphism - - ddz1 = -c3*dexpf - if (bi > dm) ddz1 = ddz1*exp(-46.0e-3_r8*(bi-dm)) - - ! Liquid water term - - if (h2osoi_liq(c,j) > 0.01_r8*dz(c,j)) ddz1=ddz1*c5 - - ! Compaction due to overburden - - ddz2 = -(burden(c)+wx/2._r8)*exp(-0.08_r8*td - c2*bi)/eta0 - - ! Compaction occurring during melt - - if (imelt(c,j) == 1) then - ddz3 = - 1._r8/dtime * max(0._r8,(frac_iceold(c,j) - fi)/frac_iceold(c,j)) - else - ddz3 = 0._r8 - end if - - ! Time rate of fractional change in dz (units of s-1) - - pdzdtc = ddz1 + ddz2 + ddz3 - - ! The change in dz due to compaction - ! Limit compaction to no less than fully saturated layer thickness - - dz(c,j) = max(dz(c,j) * (1._r8+pdzdtc*dtime),h2osoi_ice(c,j)/denice & - + h2osoi_liq(c,j)/denh2o) - - end if - - ! Pressure of overlying snow - - burden(c) = burden(c) + wx - - end if - end do - end do - - end subroutine SnowCompaction - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CombineSnowLayers -! -! !INTERFACE: - subroutine CombineSnowLayers(lbc, ubc, num_snowc, filter_snowc) -! -! !DESCRIPTION: -! Combine snow layers that are less than a minimum thickness or mass -! If the snow element thickness or mass is less than a prescribed minimum, -! then it is combined with a neighboring element. The subroutine -! clm\_combo.f90 then executes the combination of mass and energy. -! -! !USES: - use clmtype - use clm_varcon, only : istsoil, isturb - use clm_varcon, only : istcrop - use clm_time_manager, only : get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(inout) :: num_snowc ! number of column snow points in column filter - integer, intent(inout) :: filter_snowc(ubc-lbc+1) ! column filter for snow points -! -! !CALLED FROM: -! subroutine Hydrology2 in module Hydrology2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/28/02, Peter Thornton: Migrated to new data structures. -! 03/28/08, Mark Flanner: Added aerosol masses and snow grain radius -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer, pointer :: clandunit(:) !landunit index for each column - integer, pointer :: ltype(:) !landunit type -! -! local pointers to implicit inout arguments -! - integer , pointer :: snl(:) !number of snow layers - real(r8), pointer :: h2osno(:) !snow water (mm H2O) - real(r8), pointer :: snowdp(:) !snow height (m) - real(r8), pointer :: dz(:,:) !layer depth (m) - real(r8), pointer :: zi(:,:) !interface level below a "z" level (m) - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: z(:,:) ! layer thickness (m) - real(r8), pointer :: mss_bcphi(:,:) ! hydrophilic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcpho(:,:) ! hydrophobic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! hydrophilic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocpho(:,:) ! hydrophobic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst1(:,:) ! dust species 1 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! dust species 2 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! dust species 3 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! dust species 4 mass in snow (col,lyr) [kg] - real(r8), pointer :: snw_rds(:,:) ! effective snow grain radius (col,lyr) [microns, m^-6] - real(r8), pointer :: qflx_sl_top_soil(:) ! liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: c, fc ! column indices - integer :: i,k ! loop indices - integer :: j,l ! node indices - integer :: msn_old(lbc:ubc) ! number of top snow layer - integer :: mssi(lbc:ubc) ! node index - integer :: neibor ! adjacent node selected for combination - real(r8):: zwice(lbc:ubc) ! total ice mass in snow - real(r8):: zwliq (lbc:ubc) ! total liquid water in snow - real(r8):: dzmin(5) ! minimum of top snow layer - real(r8) :: dtime !land model time step (sec) - - data dzmin /0.010_r8, 0.015_r8, 0.025_r8, 0.055_r8, 0.115_r8/ -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes (landunit-level) - - ltype => lun%itype - - ! Assign local pointers to derived subtypes (column-level) - - clandunit => col%landunit - snl => cps%snl - snowdp => cps%snowdp - h2osno => cws%h2osno - dz => cps%dz - zi => cps%zi - z => cps%z - t_soisno => ces%t_soisno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - mss_bcphi => cps%mss_bcphi - mss_bcpho => cps%mss_bcpho - mss_ocphi => cps%mss_ocphi - mss_ocpho => cps%mss_ocpho - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - snw_rds => cps%snw_rds - qflx_sl_top_soil => cwf%qflx_sl_top_soil - - ! Determine model time step - - dtime = get_step_size() - - - ! Check the mass of ice lens of snow, when the total is less than a small value, - ! combine it with the underlying neighbor. - - do fc = 1, num_snowc - c = filter_snowc(fc) - msn_old(c) = snl(c) - qflx_sl_top_soil(c) = 0._r8 - end do - - ! The following loop is NOT VECTORIZED - - do fc = 1, num_snowc - c = filter_snowc(fc) - l = clandunit(c) - do j = msn_old(c)+1,0 - if (h2osoi_ice(c,j) <= .1_r8) then - if (ltype(l) == istsoil .or. ltype(l)==isturb .or. ltype(l) == istcrop) then - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) + h2osoi_liq(c,j) - h2osoi_ice(c,j+1) = h2osoi_ice(c,j+1) + h2osoi_ice(c,j) - - if (j == 0) then - qflx_sl_top_soil(c) = (h2osoi_liq(c,j) + h2osoi_ice(c,j))/dtime - end if - - if (j /= 0) dz(c,j+1) = dz(c,j+1) + dz(c,j) - - ! NOTE: Temperature, and similarly snw_rds, of the - ! underlying snow layer are NOT adjusted in this case. - ! Because the layer being eliminated has a small mass, - ! this should not make a large difference, but it - ! would be more thorough to do so. - if (j /= 0) then - mss_bcphi(c,j+1) = mss_bcphi(c,j+1) + mss_bcphi(c,j) - mss_bcpho(c,j+1) = mss_bcpho(c,j+1) + mss_bcpho(c,j) - mss_ocphi(c,j+1) = mss_ocphi(c,j+1) + mss_ocphi(c,j) - mss_ocpho(c,j+1) = mss_ocpho(c,j+1) + mss_ocpho(c,j) - mss_dst1(c,j+1) = mss_dst1(c,j+1) + mss_dst1(c,j) - mss_dst2(c,j+1) = mss_dst2(c,j+1) + mss_dst2(c,j) - mss_dst3(c,j+1) = mss_dst3(c,j+1) + mss_dst3(c,j) - mss_dst4(c,j+1) = mss_dst4(c,j+1) + mss_dst4(c,j) - end if - - else if (ltype(l) /= istsoil .and. ltype(l) /= isturb .and. ltype(l) /= istcrop .and. j /= 0) then - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) + h2osoi_liq(c,j) - h2osoi_ice(c,j+1) = h2osoi_ice(c,j+1) + h2osoi_ice(c,j) - dz(c,j+1) = dz(c,j+1) + dz(c,j) - - mss_bcphi(c,j+1) = mss_bcphi(c,j+1) + mss_bcphi(c,j) - mss_bcpho(c,j+1) = mss_bcpho(c,j+1) + mss_bcpho(c,j) - mss_ocphi(c,j+1) = mss_ocphi(c,j+1) + mss_ocphi(c,j) - mss_ocpho(c,j+1) = mss_ocpho(c,j+1) + mss_ocpho(c,j) - mss_dst1(c,j+1) = mss_dst1(c,j+1) + mss_dst1(c,j) - mss_dst2(c,j+1) = mss_dst2(c,j+1) + mss_dst2(c,j) - mss_dst3(c,j+1) = mss_dst3(c,j+1) + mss_dst3(c,j) - mss_dst4(c,j+1) = mss_dst4(c,j+1) + mss_dst4(c,j) - - end if - - ! shift all elements above this down one. - if (j > snl(c)+1 .and. snl(c) < -1) then - do i = j, snl(c)+2, -1 - ! If the layer closest to the surface is less than 0.1 mm and the ltype is not - ! urban, soil or crop, the h2osoi_liq and h2osoi_ice associated with this layer is sent - ! to qflx_qrgwl later on in the code. To keep track of this for the snow balance - ! error check, we add this to qflx_sl_top_soil here - if (ltype(l) /= istsoil .and. ltype(l) /= istcrop .and. ltype(l) /= isturb .and. i == 0) then - qflx_sl_top_soil(c) = (h2osoi_liq(c,i) + h2osoi_ice(c,i))/dtime - end if - - t_soisno(c,i) = t_soisno(c,i-1) - h2osoi_liq(c,i) = h2osoi_liq(c,i-1) - h2osoi_ice(c,i) = h2osoi_ice(c,i-1) - - mss_bcphi(c,i) = mss_bcphi(c,i-1) - mss_bcpho(c,i) = mss_bcpho(c,i-1) - mss_ocphi(c,i) = mss_ocphi(c,i-1) - mss_ocpho(c,i) = mss_ocpho(c,i-1) - mss_dst1(c,i) = mss_dst1(c,i-1) - mss_dst2(c,i) = mss_dst2(c,i-1) - mss_dst3(c,i) = mss_dst3(c,i-1) - mss_dst4(c,i) = mss_dst4(c,i-1) - snw_rds(c,i) = snw_rds(c,i-1) - - dz(c,i) = dz(c,i-1) - end do - end if - snl(c) = snl(c) + 1 - end if - end do - end do - - do fc = 1, num_snowc - c = filter_snowc(fc) - h2osno(c) = 0._r8 - snowdp(c) = 0._r8 - zwice(c) = 0._r8 - zwliq(c) = 0._r8 - end do - - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - h2osno(c) = h2osno(c) + h2osoi_ice(c,j) + h2osoi_liq(c,j) - snowdp(c) = snowdp(c) + dz(c,j) - zwice(c) = zwice(c) + h2osoi_ice(c,j) - zwliq(c) = zwliq(c) + h2osoi_liq(c,j) - end if - end do - end do - - ! Check the snow depth - all snow gone - ! The liquid water assumes ponding on soil surface. - - do fc = 1, num_snowc - c = filter_snowc(fc) - l = clandunit(c) - if (snowdp(c) < 0.01_r8 .and. snowdp(c) > 0._r8) then - snl(c) = 0 - h2osno(c) = zwice(c) - - mss_bcphi(c,:) = 0._r8 - mss_bcpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_ocpho(c,:) = 0._r8 - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - - if (h2osno(c) <= 0._r8) snowdp(c) = 0._r8 - if (ltype(l) == istsoil .or. ltype(l) == isturb .or. ltype(l) == istcrop) then - h2osoi_liq(c,1) = h2osoi_liq(c,1) + zwliq(c) - end if - end if - end do - - ! Check the snow depth - snow layers combined - ! The following loop IS NOT VECTORIZED - - do fc = 1, num_snowc - c = filter_snowc(fc) - - ! Two or more layers - - if (snl(c) < -1) then - - msn_old(c) = snl(c) - mssi(c) = 1 - - do i = msn_old(c)+1,0 - if (dz(c,i) < dzmin(mssi(c))) then - - if (i == snl(c)+1) then - ! If top node is removed, combine with bottom neighbor. - neibor = i + 1 - else if (i == 0) then - ! If the bottom neighbor is not snow, combine with the top neighbor. - neibor = i - 1 - else - ! If none of the above special cases apply, combine with the thinnest neighbor - neibor = i + 1 - if ((dz(c,i-1)+dz(c,i)) < (dz(c,i+1)+dz(c,i))) neibor = i-1 - end if - - ! Node l and j are combined and stored as node j. - if (neibor > i) then - j = neibor - l = i - else - j = i - l = neibor - end if - - ! this should be included in 'Combo' for consistency, - ! but functionally it is the same to do it here - mss_bcphi(c,j)=mss_bcphi(c,j)+mss_bcphi(c,l) - mss_bcpho(c,j)=mss_bcpho(c,j)+mss_bcpho(c,l) - mss_ocphi(c,j)=mss_ocphi(c,j)+mss_ocphi(c,l) - mss_ocpho(c,j)=mss_ocpho(c,j)+mss_ocpho(c,l) - mss_dst1(c,j)=mss_dst1(c,j)+mss_dst1(c,l) - mss_dst2(c,j)=mss_dst2(c,j)+mss_dst2(c,l) - mss_dst3(c,j)=mss_dst3(c,j)+mss_dst3(c,l) - mss_dst4(c,j)=mss_dst4(c,j)+mss_dst4(c,l) - ! mass-weighted combination of effective grain size: - snw_rds(c,j) = (snw_rds(c,j)*(h2osoi_liq(c,j)+h2osoi_ice(c,j)) + & - snw_rds(c,l)*(h2osoi_liq(c,l)+h2osoi_ice(c,l))) / & - (h2osoi_liq(c,j)+h2osoi_ice(c,j)+h2osoi_liq(c,l)+h2osoi_ice(c,l)) - - call Combo (dz(c,j), h2osoi_liq(c,j), h2osoi_ice(c,j), & - t_soisno(c,j), dz(c,l), h2osoi_liq(c,l), h2osoi_ice(c,l), t_soisno(c,l) ) - - ! Now shift all elements above this down one. - if (j-1 > snl(c)+1) then - do k = j-1, snl(c)+2, -1 - t_soisno(c,k) = t_soisno(c,k-1) - h2osoi_ice(c,k) = h2osoi_ice(c,k-1) - h2osoi_liq(c,k) = h2osoi_liq(c,k-1) - - mss_bcphi(c,k) = mss_bcphi(c,k-1) - mss_bcpho(c,k) = mss_bcpho(c,k-1) - mss_ocphi(c,k) = mss_ocphi(c,k-1) - mss_ocpho(c,k) = mss_ocpho(c,k-1) - mss_dst1(c,k) = mss_dst1(c,k-1) - mss_dst2(c,k) = mss_dst2(c,k-1) - mss_dst3(c,k) = mss_dst3(c,k-1) - mss_dst4(c,k) = mss_dst4(c,k-1) - snw_rds(c,k) = snw_rds(c,k-1) - - dz(c,k) = dz(c,k-1) - end do - end if - - ! Decrease the number of snow layers - snl(c) = snl(c) + 1 - if (snl(c) >= -1) EXIT - - else - - ! The layer thickness is greater than the prescribed minimum value - mssi(c) = mssi(c) + 1 - - end if - end do - - end if - - end do - - ! Reset the node depth and the depth of layer interface - - do j = 0, -nlevsno+1, -1 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c) + 1) then - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end if - end do - end do - - end subroutine CombineSnowLayers - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: DivideSnowLayers -! -! !INTERFACE: - subroutine DivideSnowLayers(lbc, ubc, num_snowc, filter_snowc) -! -! !DESCRIPTION: -! Subdivides snow layers if they exceed their prescribed maximum thickness. -! -! !USES: - use clmtype - use clm_varcon, only : tfrz -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(inout) :: num_snowc ! number of column snow points in column filter - integer, intent(inout) :: filter_snowc(ubc-lbc+1) ! column filter for snow points -! -! !CALLED FROM: -! subroutine Hydrology2 in module Hydrology2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/28/02, Peter Thornton: Migrated to new data structures. -! 2/29/08, David Lawrence: Snowpack T profile maintained during layer splitting -! 03/28/08, Mark Flanner: Added aerosol masses and snow grain radius -! -! !LOCAL VARIABLES: -! -! local pointers to implicit inout arguments -! - integer , pointer :: snl(:) !number of snow layers - real(r8), pointer :: dz(:,:) !layer depth (m) - real(r8), pointer :: zi(:,:) !interface level below a "z" level (m) - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: z(:,:) ! layer thickness (m) - real(r8), pointer :: mss_bcphi(:,:) ! hydrophilic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcpho(:,:) ! hydrophobic BC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! hydrophilic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocpho(:,:) ! hydrophobic OC mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst1(:,:) ! dust species 1 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! dust species 2 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! dust species 3 mass in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! dust species 4 mass in snow (col,lyr) [kg] - real(r8), pointer :: snw_rds(:,:) ! effective snow grain radius (col,lyr) [microns, m^-6] -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: j, c, fc ! indices - real(r8) :: drr ! thickness of the combined [m] - integer :: msno ! number of snow layer 1 (top) to msno (bottom) - real(r8) :: dzsno(lbc:ubc,nlevsno) ! Snow layer thickness [m] - real(r8) :: swice(lbc:ubc,nlevsno) ! Partial volume of ice [m3/m3] - real(r8) :: swliq(lbc:ubc,nlevsno) ! Partial volume of liquid water [m3/m3] - real(r8) :: tsno(lbc:ubc ,nlevsno) ! Nodel temperature [K] - real(r8) :: zwice ! temporary - real(r8) :: zwliq ! temporary - real(r8) :: propor ! temporary - real(r8) :: dtdz ! temporary - - ! temporary variables mimicking the structure of other layer division variables - real(r8) :: mbc_phi(lbc:ubc,nlevsno) ! mass of BC in each snow layer - real(r8) :: zmbc_phi ! temporary - real(r8) :: mbc_pho(lbc:ubc,nlevsno) ! mass of BC in each snow layer - real(r8) :: zmbc_pho ! temporary - real(r8) :: moc_phi(lbc:ubc,nlevsno) ! mass of OC in each snow layer - real(r8) :: zmoc_phi ! temporary - real(r8) :: moc_pho(lbc:ubc,nlevsno) ! mass of OC in each snow layer - real(r8) :: zmoc_pho ! temporary - real(r8) :: mdst1(lbc:ubc,nlevsno) ! mass of dust 1 in each snow layer - real(r8) :: zmdst1 ! temporary - real(r8) :: mdst2(lbc:ubc,nlevsno) ! mass of dust 2 in each snow layer - real(r8) :: zmdst2 ! temporary - real(r8) :: mdst3(lbc:ubc,nlevsno) ! mass of dust 3 in each snow layer - real(r8) :: zmdst3 ! temporary - real(r8) :: mdst4(lbc:ubc,nlevsno) ! mass of dust 4 in each snow layer - real(r8) :: zmdst4 ! temporary - real(r8) :: rds(lbc:ubc,nlevsno) - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtype components (column-level) - - snl => cps%snl - dz => cps%dz - zi => cps%zi - z => cps%z - t_soisno => ces%t_soisno - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - mss_bcphi => cps%mss_bcphi - mss_bcpho => cps%mss_bcpho - mss_ocphi => cps%mss_ocphi - mss_ocpho => cps%mss_ocpho - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - snw_rds => cps%snw_rds - - - ! Begin calculation - note that the following column loops are only invoked - ! for snow-covered columns - - do j = 1,nlevsno - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j <= abs(snl(c))) then - dzsno(c,j) = dz(c,j+snl(c)) - swice(c,j) = h2osoi_ice(c,j+snl(c)) - swliq(c,j) = h2osoi_liq(c,j+snl(c)) - tsno(c,j) = t_soisno(c,j+snl(c)) - - mbc_phi(c,j) = mss_bcphi(c,j+snl(c)) - mbc_pho(c,j) = mss_bcpho(c,j+snl(c)) - moc_phi(c,j) = mss_ocphi(c,j+snl(c)) - moc_pho(c,j) = mss_ocpho(c,j+snl(c)) - mdst1(c,j) = mss_dst1(c,j+snl(c)) - mdst2(c,j) = mss_dst2(c,j+snl(c)) - mdst3(c,j) = mss_dst3(c,j+snl(c)) - mdst4(c,j) = mss_dst4(c,j+snl(c)) - rds(c,j) = snw_rds(c,j+snl(c)) - - end if - end do - end do - - do fc = 1, num_snowc - c = filter_snowc(fc) - - msno = abs(snl(c)) - - if (msno == 1) then - ! Specify a new snow layer - if (dzsno(c,1) > 0.03_r8) then - msno = 2 - dzsno(c,1) = dzsno(c,1)/2._r8 - swice(c,1) = swice(c,1)/2._r8 - swliq(c,1) = swliq(c,1)/2._r8 - dzsno(c,2) = dzsno(c,1) - swice(c,2) = swice(c,1) - swliq(c,2) = swliq(c,1) - tsno(c,2) = tsno(c,1) - - mbc_phi(c,1) = mbc_phi(c,1)/2._r8 - mbc_phi(c,2) = mbc_phi(c,1) - mbc_pho(c,1) = mbc_pho(c,1)/2._r8 - mbc_pho(c,2) = mbc_pho(c,1) - moc_phi(c,1) = moc_phi(c,1)/2._r8 - moc_phi(c,2) = moc_phi(c,1) - moc_pho(c,1) = moc_pho(c,1)/2._r8 - moc_pho(c,2) = moc_pho(c,1) - mdst1(c,1) = mdst1(c,1)/2._r8 - mdst1(c,2) = mdst1(c,1) - mdst2(c,1) = mdst2(c,1)/2._r8 - mdst2(c,2) = mdst2(c,1) - mdst3(c,1) = mdst3(c,1)/2._r8 - mdst3(c,2) = mdst3(c,1) - mdst4(c,1) = mdst4(c,1)/2._r8 - mdst4(c,2) = mdst4(c,1) - rds(c,2) = rds(c,1) - - end if - end if - - if (msno > 1) then - if (dzsno(c,1) > 0.02_r8) then - drr = dzsno(c,1) - 0.02_r8 - propor = drr/dzsno(c,1) - zwice = propor*swice(c,1) - zwliq = propor*swliq(c,1) - - zmbc_phi = propor*mbc_phi(c,1) - zmbc_pho = propor*mbc_pho(c,1) - zmoc_phi = propor*moc_phi(c,1) - zmoc_pho = propor*moc_pho(c,1) - zmdst1 = propor*mdst1(c,1) - zmdst2 = propor*mdst2(c,1) - zmdst3 = propor*mdst3(c,1) - zmdst4 = propor*mdst4(c,1) - - propor = 0.02_r8/dzsno(c,1) - swice(c,1) = propor*swice(c,1) - swliq(c,1) = propor*swliq(c,1) - - mbc_phi(c,1) = propor*mbc_phi(c,1) - mbc_pho(c,1) = propor*mbc_pho(c,1) - moc_phi(c,1) = propor*moc_phi(c,1) - moc_pho(c,1) = propor*moc_pho(c,1) - mdst1(c,1) = propor*mdst1(c,1) - mdst2(c,1) = propor*mdst2(c,1) - mdst3(c,1) = propor*mdst3(c,1) - mdst4(c,1) = propor*mdst4(c,1) - - dzsno(c,1) = 0.02_r8 - - mbc_phi(c,2) = mbc_phi(c,2)+zmbc_phi ! (combo) - mbc_pho(c,2) = mbc_pho(c,2)+zmbc_pho ! (combo) - moc_phi(c,2) = moc_phi(c,2)+zmoc_phi ! (combo) - moc_pho(c,2) = moc_pho(c,2)+zmoc_pho ! (combo) - mdst1(c,2) = mdst1(c,2)+zmdst1 ! (combo) - mdst2(c,2) = mdst2(c,2)+zmdst2 ! (combo) - mdst3(c,2) = mdst3(c,2)+zmdst3 ! (combo) - mdst4(c,2) = mdst4(c,2)+zmdst4 ! (combo) - rds(c,2) = rds(c,1) ! (combo) - - call Combo (dzsno(c,2), swliq(c,2), swice(c,2), tsno(c,2), drr, & - zwliq, zwice, tsno(c,1)) - - ! Subdivide a new layer - if (msno <= 2 .and. dzsno(c,2) > 0.07_r8) then - msno = 3 - dtdz = (tsno(c,1) - tsno(c,2))/((dzsno(c,1)+dzsno(c,2))/2._r8) - dzsno(c,2) = dzsno(c,2)/2._r8 - swice(c,2) = swice(c,2)/2._r8 - swliq(c,2) = swliq(c,2)/2._r8 - dzsno(c,3) = dzsno(c,2) - swice(c,3) = swice(c,2) - swliq(c,3) = swliq(c,2) - tsno(c,3) = tsno(c,2) - dtdz*dzsno(c,2)/2._r8 - if (tsno(c,3) >= tfrz) then - tsno(c,3) = tsno(c,2) - else - tsno(c,2) = tsno(c,2) + dtdz*dzsno(c,2)/2._r8 - endif - - mbc_phi(c,2) = mbc_phi(c,2)/2._r8 - mbc_phi(c,3) = mbc_phi(c,2) - mbc_pho(c,2) = mbc_pho(c,2)/2._r8 - mbc_pho(c,3) = mbc_pho(c,2) - moc_phi(c,2) = moc_phi(c,2)/2._r8 - moc_phi(c,3) = moc_phi(c,2) - moc_pho(c,2) = moc_pho(c,2)/2._r8 - moc_pho(c,3) = moc_pho(c,2) - mdst1(c,2) = mdst1(c,2)/2._r8 - mdst1(c,3) = mdst1(c,2) - mdst2(c,2) = mdst2(c,2)/2._r8 - mdst2(c,3) = mdst2(c,2) - mdst3(c,2) = mdst3(c,2)/2._r8 - mdst3(c,3) = mdst3(c,2) - mdst4(c,2) = mdst4(c,2)/2._r8 - mdst4(c,3) = mdst4(c,2) - rds(c,3) = rds(c,2) - - end if - end if - end if - - if (msno > 2) then - if (dzsno(c,2) > 0.05_r8) then - drr = dzsno(c,2) - 0.05_r8 - propor = drr/dzsno(c,2) - zwice = propor*swice(c,2) - zwliq = propor*swliq(c,2) - - zmbc_phi = propor*mbc_phi(c,2) - zmbc_pho = propor*mbc_pho(c,2) - zmoc_phi = propor*moc_phi(c,2) - zmoc_pho = propor*moc_pho(c,2) - zmdst1 = propor*mdst1(c,2) - zmdst2 = propor*mdst2(c,2) - zmdst3 = propor*mdst3(c,2) - zmdst4 = propor*mdst4(c,2) - - propor = 0.05_r8/dzsno(c,2) - swice(c,2) = propor*swice(c,2) - swliq(c,2) = propor*swliq(c,2) - - mbc_phi(c,2) = propor*mbc_phi(c,2) - mbc_pho(c,2) = propor*mbc_pho(c,2) - moc_phi(c,2) = propor*moc_phi(c,2) - moc_pho(c,2) = propor*moc_pho(c,2) - mdst1(c,2) = propor*mdst1(c,2) - mdst2(c,2) = propor*mdst2(c,2) - mdst3(c,2) = propor*mdst3(c,2) - mdst4(c,2) = propor*mdst4(c,2) - - dzsno(c,2) = 0.05_r8 - - mbc_phi(c,3) = mbc_phi(c,3)+zmbc_phi ! (combo) - mbc_pho(c,3) = mbc_pho(c,3)+zmbc_pho ! (combo) - moc_phi(c,3) = moc_phi(c,3)+zmoc_phi ! (combo) - moc_pho(c,3) = moc_pho(c,3)+zmoc_pho ! (combo) - mdst1(c,3) = mdst1(c,3)+zmdst1 ! (combo) - mdst2(c,3) = mdst2(c,3)+zmdst2 ! (combo) - mdst3(c,3) = mdst3(c,3)+zmdst3 ! (combo) - mdst4(c,3) = mdst4(c,3)+zmdst4 ! (combo) - rds(c,3) = rds(c,2) ! (combo) - - call Combo (dzsno(c,3), swliq(c,3), swice(c,3), tsno(c,3), drr, & - zwliq, zwice, tsno(c,2)) - - ! Subdivided a new layer - if (msno <= 3 .and. dzsno(c,3) > 0.18_r8) then - msno = 4 - dtdz = (tsno(c,2) - tsno(c,3))/((dzsno(c,2)+dzsno(c,3))/2._r8) - dzsno(c,3) = dzsno(c,3)/2._r8 - swice(c,3) = swice(c,3)/2._r8 - swliq(c,3) = swliq(c,3)/2._r8 - dzsno(c,4) = dzsno(c,3) - swice(c,4) = swice(c,3) - swliq(c,4) = swliq(c,3) - tsno(c,4) = tsno(c,3) - dtdz*dzsno(c,3)/2._r8 - if (tsno(c,4) >= tfrz) then - tsno(c,4) = tsno(c,3) - else - tsno(c,3) = tsno(c,3) + dtdz*dzsno(c,3)/2._r8 - endif - - mbc_phi(c,3) = mbc_phi(c,3)/2._r8 - mbc_phi(c,4) = mbc_phi(c,3) - mbc_pho(c,3) = mbc_pho(c,3)/2._r8 - mbc_pho(c,4) = mbc_pho(c,3) - moc_phi(c,3) = moc_phi(c,3)/2._r8 - moc_phi(c,4) = moc_phi(c,3) - moc_pho(c,3) = moc_pho(c,3)/2._r8 - moc_pho(c,4) = moc_pho(c,3) - mdst1(c,3) = mdst1(c,3)/2._r8 - mdst1(c,4) = mdst1(c,3) - mdst2(c,3) = mdst2(c,3)/2._r8 - mdst2(c,4) = mdst2(c,3) - mdst3(c,3) = mdst3(c,3)/2._r8 - mdst3(c,4) = mdst3(c,3) - mdst4(c,3) = mdst4(c,3)/2._r8 - mdst4(c,4) = mdst4(c,3) - rds(c,4) = rds(c,3) - - end if - end if - end if - - if (msno > 3) then - if (dzsno(c,3) > 0.11_r8) then - drr = dzsno(c,3) - 0.11_r8 - propor = drr/dzsno(c,3) - zwice = propor*swice(c,3) - zwliq = propor*swliq(c,3) - - zmbc_phi = propor*mbc_phi(c,3) - zmbc_pho = propor*mbc_pho(c,3) - zmoc_phi = propor*moc_phi(c,3) - zmoc_pho = propor*moc_pho(c,3) - zmdst1 = propor*mdst1(c,3) - zmdst2 = propor*mdst2(c,3) - zmdst3 = propor*mdst3(c,3) - zmdst4 = propor*mdst4(c,3) - - propor = 0.11_r8/dzsno(c,3) - swice(c,3) = propor*swice(c,3) - swliq(c,3) = propor*swliq(c,3) - - mbc_phi(c,3) = propor*mbc_phi(c,3) - mbc_pho(c,3) = propor*mbc_pho(c,3) - moc_phi(c,3) = propor*moc_phi(c,3) - moc_pho(c,3) = propor*moc_pho(c,3) - mdst1(c,3) = propor*mdst1(c,3) - mdst2(c,3) = propor*mdst2(c,3) - mdst3(c,3) = propor*mdst3(c,3) - mdst4(c,3) = propor*mdst4(c,3) - - dzsno(c,3) = 0.11_r8 - - mbc_phi(c,4) = mbc_phi(c,4)+zmbc_phi ! (combo) - mbc_pho(c,4) = mbc_pho(c,4)+zmbc_pho ! (combo) - moc_phi(c,4) = moc_phi(c,4)+zmoc_phi ! (combo) - moc_pho(c,4) = moc_pho(c,4)+zmoc_pho ! (combo) - mdst1(c,4) = mdst1(c,4)+zmdst1 ! (combo) - mdst2(c,4) = mdst2(c,4)+zmdst2 ! (combo) - mdst3(c,4) = mdst3(c,4)+zmdst3 ! (combo) - mdst4(c,4) = mdst4(c,4)+zmdst4 ! (combo) - rds(c,4) = rds(c,3) ! (combo) - - call Combo (dzsno(c,4), swliq(c,4), swice(c,4), tsno(c,4), drr, & - zwliq, zwice, tsno(c,3)) - - ! Subdivided a new layer - if (msno <= 4 .and. dzsno(c,4) > 0.41_r8) then - msno = 5 - dtdz = (tsno(c,3) - tsno(c,4))/((dzsno(c,3)+dzsno(c,4))/2._r8) - dzsno(c,4) = dzsno(c,4)/2._r8 - swice(c,4) = swice(c,4)/2._r8 - swliq(c,4) = swliq(c,4)/2._r8 - dzsno(c,5) = dzsno(c,4) - swice(c,5) = swice(c,4) - swliq(c,5) = swliq(c,4) - tsno(c,5) = tsno(c,4) - dtdz*dzsno(c,4)/2._r8 - if (tsno(c,5) >= tfrz) then - tsno(c,5) = tsno(c,4) - else - tsno(c,4) = tsno(c,4) + dtdz*dzsno(c,4)/2._r8 - endif - - mbc_phi(c,4) = mbc_phi(c,4)/2._r8 - mbc_phi(c,5) = mbc_phi(c,4) - mbc_pho(c,4) = mbc_pho(c,4)/2._r8 - mbc_pho(c,5) = mbc_pho(c,4) - moc_phi(c,4) = moc_phi(c,4)/2._r8 - moc_phi(c,5) = moc_phi(c,4) - moc_pho(c,4) = moc_pho(c,4)/2._r8 - moc_pho(c,5) = moc_pho(c,4) - mdst1(c,4) = mdst1(c,4)/2._r8 - mdst1(c,5) = mdst1(c,4) - mdst2(c,4) = mdst2(c,4)/2._r8 - mdst2(c,5) = mdst2(c,4) - mdst3(c,4) = mdst3(c,4)/2._r8 - mdst3(c,5) = mdst3(c,4) - mdst4(c,4) = mdst4(c,4)/2._r8 - mdst4(c,5) = mdst4(c,4) - rds(c,5) = rds(c,4) - - end if - end if - end if - - if (msno > 4) then - if (dzsno(c,4) > 0.23_r8) then - drr = dzsno(c,4) - 0.23_r8 - propor = drr/dzsno(c,4) - zwice = propor*swice(c,4) - zwliq = propor*swliq(c,4) - - zmbc_phi = propor*mbc_phi(c,4) - zmbc_pho = propor*mbc_pho(c,4) - zmoc_phi = propor*moc_phi(c,4) - zmoc_pho = propor*moc_pho(c,4) - zmdst1 = propor*mdst1(c,4) - zmdst2 = propor*mdst2(c,4) - zmdst3 = propor*mdst3(c,4) - zmdst4 = propor*mdst4(c,4) - - propor = 0.23_r8/dzsno(c,4) - swice(c,4) = propor*swice(c,4) - swliq(c,4) = propor*swliq(c,4) - - mbc_phi(c,4) = propor*mbc_phi(c,4) - mbc_pho(c,4) = propor*mbc_pho(c,4) - moc_phi(c,4) = propor*moc_phi(c,4) - moc_pho(c,4) = propor*moc_pho(c,4) - mdst1(c,4) = propor*mdst1(c,4) - mdst2(c,4) = propor*mdst2(c,4) - mdst3(c,4) = propor*mdst3(c,4) - mdst4(c,4) = propor*mdst4(c,4) - - dzsno(c,4) = 0.23_r8 - - mbc_phi(c,5) = mbc_phi(c,5)+zmbc_phi ! (combo) - mbc_pho(c,5) = mbc_pho(c,5)+zmbc_pho ! (combo) - moc_phi(c,5) = moc_phi(c,5)+zmoc_phi ! (combo) - moc_pho(c,5) = moc_pho(c,5)+zmoc_pho ! (combo) - mdst1(c,5) = mdst1(c,5)+zmdst1 ! (combo) - mdst2(c,5) = mdst2(c,5)+zmdst2 ! (combo) - mdst3(c,5) = mdst3(c,5)+zmdst3 ! (combo) - mdst4(c,5) = mdst4(c,5)+zmdst4 ! (combo) - rds(c,5) = rds(c,4) ! (combo) - - call Combo (dzsno(c,5), swliq(c,5), swice(c,5), tsno(c,5), drr, & - zwliq, zwice, tsno(c,4)) - end if - end if - - snl(c) = -msno - - end do - - do j = -nlevsno+1,0 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - dz(c,j) = dzsno(c,j-snl(c)) - h2osoi_ice(c,j) = swice(c,j-snl(c)) - h2osoi_liq(c,j) = swliq(c,j-snl(c)) - t_soisno(c,j) = tsno(c,j-snl(c)) - - mss_bcphi(c,j) = mbc_phi(c,j-snl(c)) - mss_bcpho(c,j) = mbc_pho(c,j-snl(c)) - mss_ocphi(c,j) = moc_phi(c,j-snl(c)) - mss_ocpho(c,j) = moc_pho(c,j-snl(c)) - mss_dst1(c,j) = mdst1(c,j-snl(c)) - mss_dst2(c,j) = mdst2(c,j-snl(c)) - mss_dst3(c,j) = mdst3(c,j-snl(c)) - mss_dst4(c,j) = mdst4(c,j-snl(c)) - snw_rds(c,j) = rds(c,j-snl(c)) - - end if - end do - end do - - do j = 0, -nlevsno+1, -1 - do fc = 1, num_snowc - c = filter_snowc(fc) - if (j >= snl(c)+1) then - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end if - end do - end do - - end subroutine DivideSnowLayers - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Combo -! -! !INTERFACE: - subroutine Combo(dz, wliq, wice, t, dz2, wliq2, wice2, t2) -! -! !DESCRIPTION: -! Combines two elements and returns the following combined -! variables: dz, t, wliq, wice. -! The combined temperature is based on the equation: -! the sum of the enthalpies of the two elements = -! that of the combined element. -! -! !USES: - use clm_varcon, only : cpice, cpliq, tfrz, hfus -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: dz2 ! nodal thickness of 2 elements being combined [m] - real(r8), intent(in) :: wliq2 ! liquid water of element 2 [kg/m2] - real(r8), intent(in) :: wice2 ! ice of element 2 [kg/m2] - real(r8), intent(in) :: t2 ! nodal temperature of element 2 [K] - real(r8), intent(inout) :: dz ! nodal thickness of 1 elements being combined [m] - real(r8), intent(inout) :: wliq ! liquid water of element 1 - real(r8), intent(inout) :: wice ! ice of element 1 [kg/m2] - real(r8), intent(inout) :: t ! nodel temperature of elment 1 [K] -! -! !CALLED FROM: -! subroutine CombineSnowLayers in this module -! subroutine DivideSnowLayers in this module -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! -! -! !LOCAL VARIABLES: -!EOP -! - real(r8) :: dzc ! Total thickness of nodes 1 and 2 (dzc=dz+dz2). - real(r8) :: wliqc ! Combined liquid water [kg/m2] - real(r8) :: wicec ! Combined ice [kg/m2] - real(r8) :: tc ! Combined node temperature [K] - real(r8) :: h ! enthalpy of element 1 [J/m2] - real(r8) :: h2 ! enthalpy of element 2 [J/m2] - real(r8) :: hc ! temporary -!----------------------------------------------------------------------- - - dzc = dz+dz2 - wicec = (wice+wice2) - wliqc = (wliq+wliq2) - h = (cpice*wice+cpliq*wliq) * (t-tfrz)+hfus*wliq - h2= (cpice*wice2+cpliq*wliq2) * (t2-tfrz)+hfus*wliq2 - - hc = h + h2 - tc = tfrz + (hc - hfus*wliqc) / (cpice*wicec + cpliq*wliqc) - - dz = dzc - wice = wicec - wliq = wliqc - t = tc - - end subroutine Combo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: BuildSnowFilter -! -! !INTERFACE: - subroutine BuildSnowFilter(lbc, ubc, num_nolakec, filter_nolakec, & - num_snowc, filter_snowc, & - num_nosnowc, filter_nosnowc) -! -! !DESCRIPTION: -! Constructs snow filter for use in vectorized loops for snow hydrology. -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(out) :: num_snowc ! number of column snow points in column filter - integer, intent(out) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(out) :: num_nosnowc ! number of column non-snow points in column filter - integer, intent(out) :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points -! -! !CALLED FROM: -! subroutine Hydrology2 in Hydrology2Mod -! subroutine CombineSnowLayers in this module -! -! !REVISION HISTORY: -! 2003 July 31: Forrest Hoffman -! -! !LOCAL VARIABLES: -! local pointers to implicit in arguments - integer , pointer :: snl(:) ! number of snow layers -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: fc, c -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtype components (column-level) - - snl => cps%snl - - ! Build snow/no-snow filters for other subroutines - - num_snowc = 0 - num_nosnowc = 0 - do fc = 1, num_nolakec - c = filter_nolakec(fc) - if (snl(c) < 0) then - num_snowc = num_snowc + 1 - filter_snowc(num_snowc) = c - else - num_nosnowc = num_nosnowc + 1 - filter_nosnowc(num_nosnowc) = c - end if - end do - - end subroutine BuildSnowFilter - -end module SnowHydrologyMod diff --git a/src_clm40/biogeophys/SoilHydrologyMod.F90 b/src_clm40/biogeophys/SoilHydrologyMod.F90 deleted file mode 100644 index e490e13542..0000000000 --- a/src_clm40/biogeophys/SoilHydrologyMod.F90 +++ /dev/null @@ -1,1243 +0,0 @@ -module SoilHydrologyMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: SoilHydrologyMod -! -! !DESCRIPTION: -! Calculate soil hydrology -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SurfaceRunoff ! Calculate surface runoff - public :: Infiltration ! Calculate infiltration into surface soil layer - public :: SoilWater ! Calculate soil hydrology - public :: Drainage ! Calculate subsurface drainage -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 04/25/07 Keith Oleson: CLM3.5 hydrology -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SurfaceRunoff -! -! !INTERFACE: - subroutine SurfaceRunoff (lbc, ubc, lbp, ubp, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, vol_liq, icefrac) -! -! !DESCRIPTION: -! Calculate surface runoff -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_varcon , only : denice, denh2o, wimp, pondmx_urban, & - icol_roof, icol_sunwall, icol_shadewall, & - icol_road_imperv, icol_road_perv - - use clm_varpar , only : nlevsoi, maxpatch_pft - use clm_time_manager, only : get_step_size -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: lbp, ubp ! pft bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(ubc-lbc+1) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! column filter for urban points - real(r8), intent(out) :: vol_liq(lbc:ubc,1:nlevsoi) ! partial volume of liquid water in layer - real(r8), intent(out) :: icefrac(lbc:ubc,1:nlevsoi) ! fraction of ice in layer (-) -! -! !CALLED FROM: -! subroutine Hydrology2 in module Hydrology2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 12 November 1999: Z.-L. Yang and G.-Y. Niu -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/26/02, Peter Thornton: Migrated to new data structures. -! 4/26/05, David Lawrence: Made surface runoff for dry soils a function -! of rooting fraction in top three soil layers. -! 04/25/07 Keith Oleson: Completely new routine for CLM3.5 hydrology -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! -!rtm_flood - real(r8), pointer :: qflx_floodc(:) ! column flux of flood water from RTM -!rtm_flood - integer , pointer :: cgridcell(:) ! gridcell index for each column - integer , pointer :: ctype(:) ! column type index - real(r8), pointer :: qflx_top_soil(:) !net water input into soil from top (mm/s) - real(r8), pointer :: watsat(:,:) !volumetric soil water at saturation (porosity) - real(r8), pointer :: hkdepth(:) !decay factor (m) - real(r8), pointer :: zwt(:) !water table depth (m) - real(r8), pointer :: fcov(:) !fractional impermeable area - real(r8), pointer :: fsat(:) !fractional area with water table at surface - real(r8), pointer :: dz(:,:) !layer depth (m) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) - real(r8), pointer :: wtfact(:) !maximum saturated fraction for a gridcell - real(r8), pointer :: hksat(:,:) ! hydraulic conductivity at saturation (mm H2O /s) - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) - integer , pointer :: snl(:) ! minus number of snow layers - real(r8), pointer :: qflx_evap_grnd(:) ! ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: qflx_surf(:) ! surface runoff (mm H2O /s) - real(r8), pointer :: eff_porosity(:,:) ! effective porosity = porosity - vol_ice - real(r8), pointer :: fracice(:,:) !fractional impermeability (-) -! -!EOP -! -! !OTHER LOCAL VARIABLES: -! - integer :: c,j,fc,g !indices - real(r8) :: dtime ! land model time step (sec) - real(r8) :: xs(lbc:ubc) ! excess soil water above urban ponding limit - real(r8) :: vol_ice(lbc:ubc,1:nlevsoi) !partial volume of ice lens in layer - real(r8) :: fff(lbc:ubc) !decay factor (m-1) - real(r8) :: s1 !variable to calculate qinmax - real(r8) :: su !variable to calculate qinmax - real(r8) :: v !variable to calculate qinmax - real(r8) :: qinmax !maximum infiltration capacity (mm/s) - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtype components (column-level) - -!rtm_flood - qflx_floodc => cwf%qflx_floodc -!rtm_flood - ctype => col%itype - qflx_top_soil => cwf%qflx_top_soil - qflx_surf => cwf%qflx_surf - watsat => cps%watsat - hkdepth => cps%hkdepth - dz => cps%dz - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - fcov => cws%fcov - fsat => cws%fsat - eff_porosity => cps%eff_porosity - wtfact => cps%wtfact - zwt => cws%zwt - fracice => cps%fracice - hksat => cps%hksat - bsw => cps%bsw - sucsat => cps%sucsat - snl => cps%snl - qflx_evap_grnd => pwf_a%qflx_evap_grnd - zi => cps%zi - - ! Get time step - - dtime = get_step_size() - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Porosity of soil, partial volume of ice and liquid, fraction of ice in each layer, - ! fractional impermeability - - vol_ice(c,j) = min(watsat(c,j), h2osoi_ice(c,j)/(dz(c,j)*denice)) - eff_porosity(c,j) = max(0.01_r8,watsat(c,j)-vol_ice(c,j)) - vol_liq(c,j) = min(eff_porosity(c,j), h2osoi_liq(c,j)/(dz(c,j)*denh2o)) - - icefrac(c,j) = min(1._r8,h2osoi_ice(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j))) - - fracice(c,j) = max(0._r8,exp(-3._r8*(1._r8-icefrac(c,j)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) - end do - end do - - ! Saturated fraction - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - fff(c) = 0.5_r8 - fsat(c) = wtfact(c) * exp(-0.5_r8*fff(c)*zwt(c)) - fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1) - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Maximum infiltration capacity - s1 = max(0.01_r8,vol_liq(c,1)/max(wimp,eff_porosity(c,1))) - su = max(0._r8,(s1-fcov(c)) / (max(0.01_r8,1._r8-fcov(c)))) - v = -bsw(c,1)*sucsat(c,1)/(0.5_r8*dz(c,1)*1000._r8) - qinmax = (1._r8+v*(su-1._r8))*hksat(c,1) - - ! Surface runoff - qflx_surf(c) = fcov(c) * qflx_top_soil(c) + & - (1._r8-fcov(c)) * max(0._r8, qflx_top_soil(c)-qinmax) - - end do - - ! Determine water in excess of ponding limit for urban roof and impervious road. - ! Excess goes to surface runoff. No surface runoff for sunwall and shadewall. - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (ctype(c) == icol_roof .or. ctype(c) == icol_road_imperv) then - - ! If there are snow layers then all qflx_top_soil goes to surface runoff - if (snl(c) < 0) then - qflx_surf(c) = max(0._r8,qflx_top_soil(c)) - else - xs(c) = max(0._r8, & - h2osoi_liq(c,1)/dtime + qflx_top_soil(c) - qflx_evap_grnd(c) - & - pondmx_urban/dtime) - if (xs(c) > 0.) then - h2osoi_liq(c,1) = pondmx_urban - else - h2osoi_liq(c,1) = max(0._r8,h2osoi_liq(c,1)+ & - (qflx_top_soil(c)-qflx_evap_grnd(c))*dtime) - end if - qflx_surf(c) = xs(c) - end if - else if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall) then - qflx_surf(c) = 0._r8 - end if -!rtm_flood: send flood water flux to runoff for all urban columns - qflx_surf(c) = qflx_surf(c) + qflx_floodc(c) -!rtm_flood - end do - -!rtm_flood: add qflx_flood to qflx_top_soil -!dir$ concurrent -!cdir nodep - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_top_soil(c) = qflx_top_soil(c) + qflx_floodc(c) - end do - end subroutine SurfaceRunoff - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Infiltration -! -! !INTERFACE: - subroutine Infiltration(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc) -! -! !DESCRIPTION: -! Calculate infiltration into surface soil layer (minus the evaporation) -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varcon , only : icol_roof, icol_road_imperv, icol_sunwall, icol_shadewall, & - icol_road_perv - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer, intent(in) :: filter_hydrologyc(ubc-lbc+1) ! column filter for soil points - integer, intent(in) :: num_urbanc ! number of column urban points in column filter - integer, intent(in) :: filter_urbanc(ubc-lbc+1) ! column filter for urban points -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 12 November 1999: Z.-L. Yang and G.-Y. Niu -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/27/02, Peter Thornton: Migrated to new data structures. -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: ctype(:) ! column type index - integer , pointer :: snl(:) ! minus number of snow layers - real(r8), pointer :: qflx_top_soil(:) ! net water input into soil from top (mm/s) - real(r8), pointer :: qflx_surf(:) ! surface runoff (mm H2O /s) - real(r8), pointer :: qflx_evap_grnd(:)! ground surface evaporation rate (mm H2O/s) [+] -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: qflx_infl(:) !infiltration (mm H2O /s) -! -!EOP -! -! !OTHER LOCAL VARIABLES: -! - integer :: c, fc !indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (column-level) - - ctype => col%itype - snl => cps%snl - qflx_top_soil => cwf%qflx_top_soil - qflx_surf => cwf%qflx_surf - qflx_infl => cwf%qflx_infl - qflx_evap_grnd => pwf_a%qflx_evap_grnd - - ! Infiltration into surface soil layer (minus the evaporation) - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (snl(c) >= 0) then - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) - qflx_evap_grnd(c) - else - qflx_infl(c) = qflx_top_soil(c) - qflx_surf(c) - end if - end do - - ! No infiltration for impervious urban surfaces - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (ctype(c) /= icol_road_perv) then - qflx_infl(c) = 0._r8 - end if - end do - - end subroutine Infiltration - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SoilWater -! -! !INTERFACE: - subroutine SoilWater(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, & - vol_liq, dwat, hk, dhkdw) -! -! !DESCRIPTION: -! Soil hydrology -! Soil moisture is predicted from a 10-layer model (as with soil -! temperature), in which the vertical soil moisture transport is governed -! by infiltration, runoff, gradient diffusion, gravity, and root -! extraction through canopy transpiration. The net water applied to the -! surface layer is the snowmelt plus precipitation plus the throughfall -! of canopy dew minus surface runoff and evaporation. -! CLM3.5 uses a zero-flow bottom boundary condition. -! -! The vertical water flow in an unsaturated porous media is described by -! Darcy's law, and the hydraulic conductivity and the soil negative -! potential vary with soil water content and soil texture based on the work -! of Clapp and Hornberger (1978) and Cosby et al. (1984). The equation is -! integrated over the layer thickness, in which the time rate of change in -! water mass must equal the net flow across the bounding interface, plus the -! rate of internal source or sink. The terms of water flow across the layer -! interfaces are linearly expanded by using first-order Taylor expansion. -! The equations result in a tridiagonal system equation. -! -! Note: length units here are all millimeter -! (in temperature subroutine uses same soil layer -! structure required but lengths are m) -! -! Richards equation: -! -! d wat d d wat d psi -! ----- = - -- [ k(----- ----- - 1) ] + S -! dt dz dz d wat -! -! where: wat = volume of water per volume of soil (mm**3/mm**3) -! psi = soil matrix potential (mm) -! dt = time step (s) -! z = depth (mm) -! dz = thickness (mm) -! qin = inflow at top (mm h2o /s) -! qout= outflow at bottom (mm h2o /s) -! s = source/sink flux (mm h2o /s) -! k = hydraulic conductivity (mm h2o /s) -! -! d qin d qin -! qin[n+1] = qin[n] + -------- d wat(j-1) + --------- d wat(j) -! d wat(j-1) d wat(j) -! ==================|================= -! < qin -! -! d wat(j)/dt * dz = qin[n+1] - qout[n+1] + S(j) -! -! > qout -! ==================|================= -! d qout d qout -! qout[n+1] = qout[n] + --------- d wat(j) + --------- d wat(j+1) -! d wat(j) d wat(j+1) -! -! -! Solution: linearize k and psi about d wat and use tridiagonal -! system of equations to solve for d wat, -! where for layer j -! -! -! r_j = a_j [d wat_j-1] + b_j [d wat_j] + c_j [d wat_j+1] -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_varcon , only : wimp, icol_roof, icol_road_imperv - use clm_varpar , only : nlevsoi, max_pft_per_col - use clm_varctl , only : iulog - use shr_const_mod , only : SHR_CONST_TKFRZ, SHR_CONST_LATICE, SHR_CONST_G - use TridiagonalMod, only : Tridiagonal - use clm_time_manager , only : get_step_size -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: filter_hydrologyc(ubc-lbc+1) ! column filter for soil points - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! column filter for urban points - real(r8), intent(in) :: vol_liq(lbc:ubc,1:nlevsoi) ! soil water per unit volume [mm/mm] - real(r8), intent(out) :: dwat(lbc:ubc,1:nlevsoi) ! change of soil water [m3/m3] - real(r8), intent(out) :: hk(lbc:ubc,1:nlevsoi) ! hydraulic conductivity [mm h2o/s] - real(r8), intent(out) :: dhkdw(lbc:ubc,1:nlevsoi) ! d(hk)/d(vol_liq) -! -! !CALLED FROM: -! subroutine Hydrology2 in module Hydrology2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/27/02, Peter Thornton: Migrated to new data structures. Includes -! treatment of multiple PFTs on a single soil column. -! 04/25/07 Keith Oleson: CLM3.5 hydrology -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: ctype(:) ! column type index - integer , pointer :: npfts(:) ! column's number of pfts - ADD - real(r8), pointer :: pwtcol(:) ! weight relative to column for each pft - real(r8), pointer :: pwtgcell(:) ! weight relative to gridcell for each pft - real(r8), pointer :: z(:,:) ! layer depth (m) - real(r8), pointer :: dz(:,:) ! layer thickness (m) - real(r8), pointer :: smpmin(:) ! restriction for min of soil potential (mm) - real(r8), pointer :: qflx_infl(:) ! infiltration (mm H2O /s) - real(r8), pointer :: qflx_tran_veg_pft(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg_col(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: eff_porosity(:,:) ! effective porosity = porosity - vol_ice - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: hksat(:,:) ! hydraulic conductivity at saturation (mm H2O /s) - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: rootr_pft(:,:) ! effective fraction of roots in each soil layer - integer , pointer :: pfti(:) ! beginning pft index for each column - real(r8), pointer :: fracice(:,:) ! fractional impermeability (-) - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), pointer :: qcharge(:) ! aquifer recharge rate (mm/s) - real(r8), pointer :: hkdepth(:) ! decay factor (m) - real(r8), pointer :: zwt(:) ! water table depth (m) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) -! -! local pointers to original implicit inout arguments -! - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) -! -! local pointer s to original implicit out arguments -! - real(r8), pointer :: rootr_col(:,:) ! effective fraction of roots in each soil layer - real(r8), pointer :: smp_l(:,:) ! soil matrix potential [mm] - real(r8), pointer :: hk_l(:,:) ! hydraulic conductivity (mm/s) -! -!EOP -! -! !OTHER LOCAL VARIABLES: -! - integer :: p,c,fc,j ! do loop indices - integer :: jtop(lbc:ubc) ! top level at each column - real(r8) :: dtime ! land model time step (sec) - real(r8) :: amx(lbc:ubc,1:nlevsoi+1) ! "a" left off diagonal of tridiagonal matrix - real(r8) :: bmx(lbc:ubc,1:nlevsoi+1) ! "b" diagonal column for tridiagonal matrix - real(r8) :: cmx(lbc:ubc,1:nlevsoi+1) ! "c" right off diagonal tridiagonal matrix - real(r8) :: rmx(lbc:ubc,1:nlevsoi+1) ! "r" forcing term of tridiagonal matrix - real(r8) :: zmm(lbc:ubc,1:nlevsoi+1) ! layer depth [mm] - real(r8) :: dzmm(lbc:ubc,1:nlevsoi+1) ! layer thickness [mm] - real(r8) :: den ! used in calculating qin, qout - real(r8) :: dqidw0(lbc:ubc,1:nlevsoi+1) ! d(qin)/d(vol_liq(i-1)) - real(r8) :: dqidw1(lbc:ubc,1:nlevsoi+1) ! d(qin)/d(vol_liq(i)) - real(r8) :: dqodw1(lbc:ubc,1:nlevsoi+1) ! d(qout)/d(vol_liq(i)) - real(r8) :: dqodw2(lbc:ubc,1:nlevsoi+1) ! d(qout)/d(vol_liq(i+1)) - real(r8) :: dsmpdw(lbc:ubc,1:nlevsoi+1) ! d(smp)/d(vol_liq) - real(r8) :: num ! used in calculating qin, qout - real(r8) :: qin(lbc:ubc,1:nlevsoi+1) ! flux of water into soil layer [mm h2o/s] - real(r8) :: qout(lbc:ubc,1:nlevsoi+1) ! flux of water out of soil layer [mm h2o/s] - real(r8) :: s_node ! soil wetness - real(r8) :: s1 ! "s" at interface of layer - real(r8) :: s2 ! k*s**(2b+2) - real(r8) :: smp(lbc:ubc,1:nlevsoi) ! soil matrix potential [mm] - real(r8) :: sdamp ! extrapolates soiwat dependence of evaporation - integer :: pi ! pft index - real(r8) :: temp(lbc:ubc) ! accumulator for rootr weighting - integer :: jwt(lbc:ubc) ! index of the soil layer right above the water table (-) - real(r8) :: smp1,dsmpdw1,wh,wh_zwt,ka - real(r8) :: dwat2(lbc:ubc,1:nlevsoi+1) - real(r8) :: dzq ! used in calculating qin, qout (difference in equilbirium matric potential) - real(r8) :: zimm(lbc:ubc,0:nlevsoi) ! layer interface depth [mm] - real(r8) :: zq(lbc:ubc,1:nlevsoi+1) ! equilibrium matric potential for each layer [mm] - real(r8) :: vol_eq(lbc:ubc,1:nlevsoi+1) ! equilibrium volumetric water content - real(r8) :: tempi ! temp variable for calculating vol_eq - real(r8) :: temp0 ! temp variable for calculating vol_eq - real(r8) :: voleq1 ! temp variable for calculating vol_eq - real(r8) :: zwtmm(lbc:ubc) ! water table depth [mm] -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (column-level) - - qcharge => cws%qcharge - hkdepth => cps%hkdepth - zi => cps%zi - zwt => cws%zwt - ctype => col%itype - npfts => col%npfts - z => cps%z - dz => cps%dz - smpmin => cps%smpmin - watsat => cps%watsat - hksat => cps%hksat - bsw => cps%bsw - sucsat => cps%sucsat - eff_porosity => cps%eff_porosity - rootr_col => cps%rootr_column - t_soisno => ces%t_soisno - h2osoi_liq => cws%h2osoi_liq - h2osoi_vol => cws%h2osoi_vol - qflx_infl => cwf%qflx_infl - fracice => cps%fracice - qflx_tran_veg_col => pwf_a%qflx_tran_veg - pfti => col%pfti - smp_l => cws%smp_l - hk_l => cws%hk_l - - ! Assign local pointers to derived type members (pft-level) - - qflx_tran_veg_pft => pwf%qflx_tran_veg - rootr_pft => pps%rootr - pwtcol => pft%wtcol - pwtgcell => pft%wtgcell - - ! Get time step - - dtime = get_step_size() - - ! Because the depths in this routine are in mm, use local - ! variable arrays instead of pointers - - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zmm(c,j) = z(c,j)*1.e3_r8 - dzmm(c,j) = dz(c,j)*1.e3_r8 - zimm(c,j) = zi(c,j)*1.e3_r8 - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zimm(c,0) = 0.0_r8 - zwtmm(c) = zwt(c)*1.e3_r8 - end do - - ! First step is to calculate the column-level effective rooting - ! fraction in each soil layer. This is done outside the usual - ! PFT-to-column averaging routines because it is not a simple - ! weighted average of the PFT level rootr arrays. Instead, the - ! weighting depends on both the per-unit-area transpiration - ! of the PFT and the PFTs area relative to all PFTs. - - temp(:) = 0._r8 - - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - rootr_col(c,j) = 0._r8 - end do - end do - - do pi = 1,max_pft_per_col - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - if (pwtgcell(p)>0._r8) then - rootr_col(c,j) = rootr_col(c,j) + rootr_pft(p,j) * qflx_tran_veg_pft(p) * pwtcol(p) - end if - end if - end do - end do - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - if (pwtgcell(p)>0._r8) then - temp(c) = temp(c) + qflx_tran_veg_pft(p) * pwtcol(p) - end if - end if - end do - end do - - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (temp(c) /= 0._r8) then - rootr_col(c,j) = rootr_col(c,j)/temp(c) - end if - end do - end do - - !compute jwt index - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - do j = 2,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end do - - ! calculate the equilibrium water content based on the water table depth - - do j=1,nlevsoi - do fc=1, num_hydrologyc - c = filter_hydrologyc(fc) - if ((zwtmm(c) .lt. zimm(c,j-1))) then !fully saturated when wtd is less than the layer top - vol_eq(c,j) = watsat(c,j) - - ! use the weighted average from the saturated part (depth > wtd) and the equilibrium solution for the - ! rest of the layer - - else if ((zwtmm(c) .lt. zimm(c,j)) .and. (zwtmm(c) .gt. zimm(c,j-1))) then - tempi = 1.0_r8 - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j-1))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - voleq1 = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zwtmm(c)-zimm(c,j-1))*(tempi-temp0) - vol_eq(c,j) = (voleq1*(zwtmm(c)-zimm(c,j-1)) + watsat(c,j)*(zimm(c,j)-zwtmm(c)))/(zimm(c,j)-zimm(c,j-1)) - vol_eq(c,j) = min(watsat(c,j),vol_eq(c,j)) - vol_eq(c,j) = max(vol_eq(c,j),0.0_r8) - else - tempi = (((sucsat(c,j)+zwtmm(c)-zimm(c,j))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j-1))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - vol_eq(c,j) = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zimm(c,j)-zimm(c,j-1))*(tempi-temp0) - vol_eq(c,j) = max(vol_eq(c,j),0.0_r8) - vol_eq(c,j) = min(watsat(c,j),vol_eq(c,j)) - endif - zq(c,j) = -sucsat(c,j)*(max(vol_eq(c,j)/watsat(c,j),0.01_r8))**(-bsw(c,j)) - zq(c,j) = max(smpmin(c), zq(c,j)) - end do - end do - - ! If water table is below soil column calculate zq for the 11th layer - j = nlevsoi - do fc=1, num_hydrologyc - c = filter_hydrologyc(fc) - if(jwt(c) == nlevsoi) then - tempi = 1._r8 - temp0 = (((sucsat(c,j)+zwtmm(c)-zimm(c,j))/sucsat(c,j)))**(1._r8-1._r8/bsw(c,j)) - vol_eq(c,j+1) = -sucsat(c,j)*watsat(c,j)/(1._r8-1._r8/bsw(c,j))/(zwtmm(c)-zimm(c,j))*(tempi-temp0) - vol_eq(c,j+1) = max(vol_eq(c,j+1),0.0_r8) - vol_eq(c,j+1) = min(watsat(c,j),vol_eq(c,j+1)) - zq(c,j+1) = -sucsat(c,j)*(max(vol_eq(c,j+1)/watsat(c,j),0.01_r8))**(-bsw(c,j)) - zq(c,j+1) = max(smpmin(c), zq(c,j+1)) - end if - end do - - ! Hydraulic conductivity and soil matric potential and their derivatives - - sdamp = 0._r8 - do j = 1, nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - s1 = 0.5_r8*(h2osoi_vol(c,j) + h2osoi_vol(c,min(nlevsoi, j+1))) / & - (0.5_r8*(watsat(c,j)+watsat(c,min(nlevsoi, j+1)))) - s1 = min(1._r8, s1) - s2 = hksat(c,j)*s1**(2._r8*bsw(c,j)+2._r8) - - hk(c,j) = (1._r8-0.5_r8*(fracice(c,j)+fracice(c,min(nlevsoi, j+1))))*s1*s2 - - dhkdw(c,j) = (1._r8-0.5_r8*(fracice(c,j)+fracice(c,min(nlevsoi, j+1))))* & - (2._r8*bsw(c,j)+3._r8)*s2*0.5_r8/watsat(c,j) - - s_node = max(h2osoi_vol(c,j)/watsat(c,j), 0.01_r8) - s_node = min(1.0_r8, s_node) - - smp(c,j) = -sucsat(c,j)*s_node**(-bsw(c,j)) - smp(c,j) = max(smpmin(c), smp(c,j)) - - dsmpdw(c,j) = -bsw(c,j)*smp(c,j)/(s_node*watsat(c,j)) - - smp_l(c,j) = smp(c,j) - hk_l(c,j) = hk(c,j) - - end do - end do - - ! aquifer (11th) layer - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - zmm(c,nlevsoi+1) = 0.5*(1.e3_r8*zwt(c) + zmm(c,nlevsoi)) - if(jwt(c) < nlevsoi) then - dzmm(c,nlevsoi+1) = dzmm(c,nlevsoi) - else - dzmm(c,nlevsoi+1) = (1.e3_r8*zwt(c) - zmm(c,nlevsoi)) - end if - end do - - ! Set up r, a, b, and c vectors for tridiagonal solution - - ! Node j=1 (top) - - j = 1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qin(c,j) = qflx_infl(c) - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp(c,j+1)-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw(c,j+1) + num*dhkdw(c,j))/den - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_tran_veg_col(c) * rootr_col(c,j) - amx(c,j) = 0._r8 - bmx(c,j) = dzmm(c,j)*(sdamp+1._r8/dtime) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - end do - - ! Nodes j=2 to j=nlevsoi-1 - - do j = 2, nlevsoi - 1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp(c,j+1)-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw(c,j+1) + num*dhkdw(c,j))/den - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_tran_veg_col(c)*rootr_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - end do - end do - - ! Node j=nlevsoi (bottom) - - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if(j > jwt(c)) then !water table is in soil column - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - qout(c,j) = 0._r8 - dqodw1(c,j) = 0._r8 - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_tran_veg_col(c)*rootr_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = 0._r8 - - !scs: next set up aquifer layer; hydrologically inactive - rmx(c,j+1) = 0._r8 - amx(c,j+1) = 0._r8 - bmx(c,j+1) = dzmm(c,j+1)/dtime - cmx(c,j+1) = 0._r8 - else ! water table is below soil column - - !scs: compute aquifer soil moisture as average of layer 10 and saturation - s_node = max(0.5*(1.0_r8+h2osoi_vol(c,j)/watsat(c,j)), 0.01_r8) - s_node = min(1.0_r8, s_node) - - !scs: compute smp for aquifer layer - smp1 = -sucsat(c,j)*s_node**(-bsw(c,j)) - smp1 = max(smpmin(c), smp1) - - !scs: compute dsmpdw for aquifer layer - dsmpdw1 = -bsw(c,j)*smp1/(s_node*watsat(c,j)) - - !scs: first set up bottom layer of soil column - den = (zmm(c,j) - zmm(c,j-1)) - dzq = (zq(c,j)-zq(c,j-1)) - num = (smp(c,j)-smp(c,j-1)) - dzq - qin(c,j) = -hk(c,j-1)*num/den - dqidw0(c,j) = -(-hk(c,j-1)*dsmpdw(c,j-1) + num*dhkdw(c,j-1))/den - dqidw1(c,j) = -( hk(c,j-1)*dsmpdw(c,j) + num*dhkdw(c,j-1))/den - den = (zmm(c,j+1)-zmm(c,j)) - dzq = (zq(c,j+1)-zq(c,j)) - num = (smp1-smp(c,j)) - dzq - qout(c,j) = -hk(c,j)*num/den - dqodw1(c,j) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqodw2(c,j) = -( hk(c,j)*dsmpdw1 + num*dhkdw(c,j))/den - - rmx(c,j) = qin(c,j) - qout(c,j) - qflx_tran_veg_col(c)*rootr_col(c,j) - amx(c,j) = -dqidw0(c,j) - bmx(c,j) = dzmm(c,j)/dtime - dqidw1(c,j) + dqodw1(c,j) - cmx(c,j) = dqodw2(c,j) - - !scs: next set up aquifer layer; den/num unchanged, qin=qout - qin(c,j+1) = qout(c,j) - dqidw0(c,j+1) = -(-hk(c,j)*dsmpdw(c,j) + num*dhkdw(c,j))/den - dqidw1(c,j+1) = -( hk(c,j)*dsmpdw1 + num*dhkdw(c,j))/den - qout(c,j+1) = 0._r8 ! zero-flow bottom boundary condition - dqodw1(c,j+1) = 0._r8 ! zero-flow bottom boundary condition - rmx(c,j+1) = qin(c,j+1) - qout(c,j+1) - amx(c,j+1) = -dqidw0(c,j+1) - bmx(c,j+1) = dzmm(c,j+1)/dtime - dqidw1(c,j+1) + dqodw1(c,j+1) - cmx(c,j+1) = 0._r8 - endif - end do - - ! Solve for dwat - - jtop(:) = 1 - call Tridiagonal(lbc, ubc, 1, nlevsoi+1, jtop, num_hydrologyc, filter_hydrologyc, & - amx, bmx, cmx, rmx, dwat2 ) - !scs: set dwat - do fc = 1,num_hydrologyc - c = filter_hydrologyc(fc) - do j = 1, nlevsoi - dwat(c,j)=dwat2(c,j) - end do - end do - - ! Renew the mass of liquid water - !scs: also compute qcharge from dwat in aquifer layer - !scs: update in drainage for case jwt < nlevsoi - - do fc = 1,num_hydrologyc - c = filter_hydrologyc(fc) - do j = 1, nlevsoi - h2osoi_liq(c,j) = h2osoi_liq(c,j) + dwat2(c,j)*dzmm(c,j) - end do - - !scs: calculate qcharge for case jwt < nlevsoi - if(jwt(c) < nlevsoi) then - wh_zwt = 0._r8 !since wh_zwt = -sucsat - zq_zwt, where zq_zwt = -sucsat - - s_node = max(h2osoi_vol(c,jwt(c))/watsat(c,jwt(c)), 0.01_r8) - s_node = min(1.0_r8, s_node) - - !scs: use average moisture between water table and layer jwt - s1 = 0.5_r8*(1.0+s_node) - s1 = min(1._r8, s1) - - !scs: this is the expression for unsaturated hk - ka = hksat(c,jwt(c))*s1**(2._r8*bsw(c,jwt(c))+3._r8) - - ! Recharge rate qcharge to groundwater (positive to aquifer) - smp1 = -sucsat(c,jwt(c))*s_node**(-bsw(c,jwt(c))) - smp1 = max(smpmin(c), smp(c,jwt(c))) - wh = smp1 - zq(c,jwt(c)) - qcharge(c) = -ka * (wh_zwt-wh) /((zwt(c)-z(c,jwt(c)))*1000._r8) - - ! To limit qcharge (for the first several timesteps) - qcharge(c) = max(-10.0_r8/dtime,qcharge(c)) - qcharge(c) = min( 10.0_r8/dtime,qcharge(c)) - else - !scs: if water table is below soil column, compute qcharge from dwat2(11) - qcharge(c) = dwat2(c,nlevsoi+1)*dzmm(c,nlevsoi+1)/dtime - endif - end do - - end subroutine SoilWater - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Drainage -! -! !INTERFACE: - subroutine Drainage(lbc, ubc, num_hydrologyc, filter_hydrologyc, & - num_urbanc, filter_urbanc, vol_liq, hk, & - icefrac) -! -! !DESCRIPTION: -! Calculate subsurface drainage -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use clm_time_manager, only : get_step_size - use clm_varcon , only : pondmx, tfrz, icol_roof, icol_road_imperv, icol_road_perv, watmin - use clm_varpar , only : nlevsoi -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_hydrologyc ! number of column soil points in column filter - integer , intent(in) :: num_urbanc ! number of column urban points in column filter - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! column filter for urban points - integer , intent(in) :: filter_hydrologyc(ubc-lbc+1) ! column filter for soil points - real(r8), intent(in) :: vol_liq(lbc:ubc,1:nlevsoi) ! partial volume of liquid water in layer - real(r8), intent(in) :: hk(lbc:ubc,1:nlevsoi) ! hydraulic conductivity (mm h2o/s) - real(r8), intent(in) :: icefrac(lbc:ubc,1:nlevsoi) ! fraction of ice in layer -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 12 November 1999: Z.-L. Yang and G.-Y. Niu -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 4/26/05, Peter Thornton and David Lawrence: Turned off drainage from -! middle soil layers for both wet and dry fractions. -! 04/25/07 Keith Oleson: Completely new routine for CLM3.5 hydrology -! 27 February 2008: Keith Oleson; Saturation excess modification -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: ctype(:) !column type index - integer , pointer :: snl(:) !number of snow layers - real(r8), pointer :: qflx_snwcp_liq(:) !excess rainfall due to snow capping (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_grnd(:) !ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow(:) !surface dew added to snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_sub_snow(:) !sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: dz(:,:) !layer depth (m) - real(r8), pointer :: bsw(:,:) !Clapp and Hornberger "b" - real(r8), pointer :: eff_porosity(:,:) !effective porosity = porosity - vol_ice - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) - real(r8), pointer :: hksat(:,:) !hydraulic conductivity at saturation (mm H2O /s) - real(r8), pointer :: sucsat(:,:) !minimum soil suction (mm) - real(r8), pointer :: z(:,:) !layer depth (m) - real(r8), pointer :: zi(:,:) !interface level below a "z" level (m) - real(r8), pointer :: watsat(:,:) !volumetric soil water at saturation (porosity) - real(r8), pointer :: hkdepth(:) !decay factor (m) - real(r8), pointer :: zwt(:) !water table depth (m) - real(r8), pointer :: wa(:) !water in the unconfined aquifer (mm) - real(r8), pointer :: wt(:) !total water storage (unsaturated soil water + groundwater) (mm) - real(r8), pointer :: qcharge(:) !aquifer recharge rate (mm/s) -! -! local pointers to original implicit inout arguments -! - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: qflx_drain(:) !sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_irrig(:) !irrigation flux (mm H2O /s) - real(r8), pointer :: qflx_qrgwl(:) !qflx_surf at glaciers, wetlands, lakes (mm H2O /s) - real(r8), pointer :: eflx_impsoil(:) !implicit evaporation for soil temperature equation - real(r8), pointer :: qflx_rsub_sat(:) !soil saturation excess [mm h2o/s] -! -!EOP -! -! !OTHER LOCAL VARIABLES: -! - integer :: c,j,fc,i !indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: xs(lbc:ubc) !water needed to bring soil moisture to watmin (mm) - real(r8) :: dzmm(lbc:ubc,1:nlevsoi) !layer thickness (mm) - integer :: jwt(lbc:ubc) !index of the soil layer right above the water table (-) - real(r8) :: rsub_bot(lbc:ubc) !subsurface runoff - bottom drainage (mm/s) - real(r8) :: rsub_top(lbc:ubc) !subsurface runoff - topographic control (mm/s) - real(r8) :: fff(lbc:ubc) !decay factor (m-1) - real(r8) :: xsi(lbc:ubc) !excess soil water above saturation at layer i (mm) - real(r8) :: xsia(lbc:ubc) !available pore space at layer i (mm) - real(r8) :: xs1(lbc:ubc) !excess soil water above saturation at layer 1 (mm) - real(r8) :: smpfz(1:nlevsoi) !matric potential of layer right above water table (mm) - real(r8) :: wtsub !summation of hk*dzmm for layers below water table (mm**2/s) - real(r8) :: rous !aquifer yield (-) - real(r8) :: wh !smpfz(jwt)-z(jwt) (mm) - real(r8) :: wh_zwt !water head at the water table depth (mm) - real(r8) :: ws !summation of pore space of layers below water table (mm) - real(r8) :: s_node !soil wetness (-) - real(r8) :: dzsum !summation of dzmm of layers below water table (mm) - real(r8) :: icefracsum !summation of icefrac*dzmm of layers below water table (-) - real(r8) :: fracice_rsub(lbc:ubc) !fractional impermeability of soil layers (-) - real(r8) :: ka !hydraulic conductivity of the aquifer (mm/s) - real(r8) :: dza !fff*(zwt-z(jwt)) (-) - real(r8) :: available_h2osoi_liq !available soil liquid water in a layer -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype -! cgridcell => col%gridcell - - snl => cps%snl - dz => cps%dz - bsw => cps%bsw - t_soisno => ces%t_soisno - hksat => cps%hksat - sucsat => cps%sucsat - z => cps%z - zi => cps%zi - watsat => cps%watsat - hkdepth => cps%hkdepth - zwt => cws%zwt - wa => cws%wa - wt => cws%wt - qcharge => cws%qcharge - eff_porosity => cps%eff_porosity - qflx_snwcp_liq => pwf_a%qflx_snwcp_liq - qflx_dew_grnd => pwf_a%qflx_dew_grnd - qflx_dew_snow => pwf_a%qflx_dew_snow - qflx_sub_snow => pwf_a%qflx_sub_snow - qflx_drain => cwf%qflx_drain - qflx_irrig => cwf%qflx_irrig - qflx_qrgwl => cwf%qflx_qrgwl - qflx_rsub_sat => cwf%qflx_rsub_sat - eflx_impsoil => cef%eflx_impsoil - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - - ! Get time step - - dtime = get_step_size() - - ! Convert layer thicknesses from m to mm - - do j = 1,nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - dzmm(c,j) = dz(c,j)*1.e3_r8 - end do - end do - - ! Initial set - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - qflx_drain(c) = 0._r8 - rsub_bot(c) = 0._r8 - qflx_rsub_sat(c) = 0._r8 - rsub_top(c) = 0._r8 - fracice_rsub(c) = 0._r8 - end do - - ! The layer index of the first unsaturated layer, i.e., the layer right above - ! the water table - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - jwt(c) = nlevsoi - do j = 2,nlevsoi - if(zwt(c) <= zi(c,j)) then - jwt(c) = j-1 - exit - end if - enddo - end do - - ! Topographic runoff - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - fff(c) = 1._r8/ hkdepth(c) - dzsum = 0._r8 - icefracsum = 0._r8 - do j = jwt(c), nlevsoi - dzsum = dzsum + dzmm(c,j) - icefracsum = icefracsum + icefrac(c,j) * dzmm(c,j) - end do - fracice_rsub(c) = max(0._r8,exp(-3._r8*(1._r8-(icefracsum/dzsum)))- exp(-3._r8))/(1.0_r8-exp(-3._r8)) - rsub_top(c) = (1._r8 - fracice_rsub(c)) * 5.5e-3_r8 * exp(-fff(c)*zwt(c)) - end do - - rous = 0.2_r8 - - ! Water table calculation - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Water storage in aquifer + soil - wt(c) = wt(c) + (qcharge(c) - rsub_top(c)) * dtime - - if(jwt(c) == nlevsoi) then ! water table is below the soil column - wa(c) = wa(c) + (qcharge(c) -rsub_top(c)) * dtime - wt(c) = wa(c) - zwt(c) = (zi(c,nlevsoi) + 25._r8) - wa(c)/1000._r8/rous - h2osoi_liq(c,nlevsoi) = h2osoi_liq(c,nlevsoi) + max(0._r8,(wa(c)-5000._r8)) - wa(c) = min(wa(c), 5000._r8) - else ! water table within soil layers - if (jwt(c) == nlevsoi-1) then ! water table within bottom soil layer - - zwt(c) = zi(c,nlevsoi)- (wt(c)-rous*1000._r8*25._r8) /eff_porosity(c,nlevsoi)/1000._r8 - - else ! water table within soil layers 1-9 - ws = 0._r8 ! water used to fill soil air pores regardless of water content - do j = jwt(c)+2,nlevsoi - ws = ws + eff_porosity(c,j) * 1000._r8 * dz(c,j) - enddo - zwt(c) = zi(c,jwt(c)+1)-(wt(c)-rous*1000_r8*25._r8-ws) /eff_porosity(c,jwt(c)+1)/1000._r8 - endif - - wtsub = 0._r8 - do j = jwt(c)+1, nlevsoi - wtsub = wtsub + hk(c,j)*dzmm(c,j) - end do - - ! Remove subsurface runoff - do j = jwt(c)+1, nlevsoi - h2osoi_liq(c,j) = h2osoi_liq(c,j) - rsub_top(c)*dtime*hk(c,j)*dzmm(c,j)/wtsub - end do - end if - - zwt(c) = max(0.05_r8,zwt(c)) - zwt(c) = min(80._r8,zwt(c)) - - end do - - ! excessive water above saturation added to the above unsaturated layer like a bucket - ! if column fully saturated, excess water goes to runoff - - do j = nlevsoi,2,-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - xsi(c) = max(h2osoi_liq(c,j)-eff_porosity(c,j)*dzmm(c,j),0._r8) - h2osoi_liq(c,j) = min(eff_porosity(c,j)*dzmm(c,j), h2osoi_liq(c,j)) - h2osoi_liq(c,j-1) = h2osoi_liq(c,j-1) + xsi(c) - end do - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - xs1(c) = max(max(h2osoi_liq(c,1),0._r8)-max(0._r8,(pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1))),0._r8) - h2osoi_liq(c,1) = min(max(0._r8,pondmx+watsat(c,1)*dzmm(c,1)-h2osoi_ice(c,1)), h2osoi_liq(c,1)) - qflx_rsub_sat(c) = xs1(c) / dtime - end do - - ! Limit h2osoi_liq to be greater than or equal to watmin. - ! Get water needed to bring h2osoi_liq equal watmin from lower layer. - ! If insufficient water in soil layers, get from aquifer water - - do j = 1, nlevsoi-1 - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin - h2osoi_liq(c,j) - else - xs(c) = 0._r8 - end if - h2osoi_liq(c,j ) = h2osoi_liq(c,j ) + xs(c) - h2osoi_liq(c,j+1) = h2osoi_liq(c,j+1) - xs(c) - end do - end do - -! Get water for bottom layer from layers above if possible - j = nlevsoi - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - if (h2osoi_liq(c,j) < watmin) then - xs(c) = watmin-h2osoi_liq(c,j) - searchforwater: do i = nlevsoi-1, 1, -1 - available_h2osoi_liq = max(h2osoi_liq(c,i)-watmin-xs(c),0._r8) - if (available_h2osoi_liq .ge. xs(c)) then - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - h2osoi_liq(c,i) = h2osoi_liq(c,i) - xs(c) - xs(c) = 0._r8 - exit searchforwater - else - h2osoi_liq(c,j) = h2osoi_liq(c,j) + available_h2osoi_liq - h2osoi_liq(c,i) = h2osoi_liq(c,i) - available_h2osoi_liq - xs(c) = xs(c) - available_h2osoi_liq - end if - end do searchforwater - else - xs(c) = 0._r8 - end if -! Needed in case there is no water to be found - h2osoi_liq(c,j) = h2osoi_liq(c,j) + xs(c) - wt(c) = wt(c) - xs(c) -! Instead of removing water from aquifer where it eventually -! shows up as excess drainage to the ocean, take it back out of -! drainage - rsub_top(c) = rsub_top(c) - xs(c)/dtime - end do - - do fc = 1, num_hydrologyc - c = filter_hydrologyc(fc) - - ! Sub-surface runoff and drainage - - qflx_drain(c) = qflx_rsub_sat(c) + rsub_top(c) - - ! Set imbalance for snow capping - - qflx_qrgwl(c) = qflx_snwcp_liq(c) - - ! Implicit evaporation term is now zero - - eflx_impsoil(c) = 0._r8 - - ! Renew the ice and liquid mass due to condensation - - if (snl(c)+1 >= 1) then - h2osoi_liq(c,1) = h2osoi_liq(c,1) + qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (qflx_dew_snow(c) * dtime) - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (qflx_sub_snow(c) * dtime) - end if - end if - end do - - ! No drainage for urban columns (except for pervious road as computed above) - - do fc = 1, num_urbanc - c = filter_urbanc(fc) - if (ctype(c) /= icol_road_perv) then - qflx_drain(c) = 0._r8 - qflx_irrig(c) = 0._r8 - ! This must be done for roofs and impervious road (walls will be zero) - qflx_qrgwl(c) = qflx_snwcp_liq(c) - eflx_impsoil(c) = 0._r8 - end if - - ! Renew the ice and liquid mass due to condensation for urban roof and impervious road - - if (ctype(c) == icol_roof .or. ctype(c) == icol_road_imperv) then - if (snl(c)+1 >= 1) then - h2osoi_liq(c,1) = h2osoi_liq(c,1) + qflx_dew_grnd(c) * dtime - h2osoi_ice(c,1) = h2osoi_ice(c,1) + (qflx_dew_snow(c) * dtime) - if (qflx_sub_snow(c)*dtime > h2osoi_ice(c,1)) then - qflx_sub_snow(c) = h2osoi_ice(c,1)/dtime - h2osoi_ice(c,1) = 0._r8 - else - h2osoi_ice(c,1) = h2osoi_ice(c,1) - (qflx_sub_snow(c) * dtime) - end if - end if - end if - - end do - - end subroutine Drainage - -end module SoilHydrologyMod diff --git a/src_clm40/biogeophys/SoilTemperatureMod.F90 b/src_clm40/biogeophys/SoilTemperatureMod.F90 deleted file mode 100644 index 9e81a79cd0..0000000000 --- a/src_clm40/biogeophys/SoilTemperatureMod.F90 +++ /dev/null @@ -1,1225 +0,0 @@ -module SoilTemperatureMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: SoilTemperatureMod -! -! !DESCRIPTION: -! Calculates snow and soil temperatures including phase change -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SoilTemperature ! Snow and soil temperatures including phase change -! -! !PRIVATE MEMBER FUNCTIONS: - private :: SoilThermProp ! Set therm conductivities and heat cap of snow/soil layers - private :: PhaseChange ! Calculation of the phase change within snow and soil layers -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SoilTemperature -! -! !INTERFACE: - subroutine SoilTemperature(lbl, ubl, lbc, ubc, num_urbanl, filter_urbanl, & - num_nolakec, filter_nolakec, xmf, fact) -! -! !DESCRIPTION: -! Snow and soil temperatures including phase change -! o The volumetric heat capacity is calculated as a linear combination -! in terms of the volumetric fraction of the constituent phases. -! o The thermal conductivity of soil is computed from -! the algorithm of Johansen (as reported by Farouki 1981), and the -! conductivity of snow is from the formulation used in -! SNTHERM (Jordan 1991). -! o Boundary conditions: -! F = Rnet - Hg - LEg (top), F= 0 (base of the soil column). -! o Soil / snow temperature is predicted from heat conduction -! in 10 soil layers and up to 5 snow layers. -! The thermal conductivities at the interfaces between two -! neighboring layers (j, j+1) are derived from an assumption that -! the flux across the interface is equal to that from the node j -! to the interface and the flux from the interface to the node j+1. -! The equation is solved using the Crank-Nicholson method and -! results in a tridiagonal system equation. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_time_manager , only : get_step_size - use clm_varctl , only : iulog - use clm_varcon , only : sb, capr, cnfac, hvap, istice_mec, isturb, & - icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv, istwet - use clm_varpar , only : nlevsno, nlevgrnd, max_pft_per_col, nlevurb - use TridiagonalMod, only : Tridiagonal - -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer , intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - real(r8), intent(out) :: xmf(lbc:ubc) ! total latent heat of phase change of ground water - real(r8), intent(out) :: fact(lbc:ubc, -nlevsno+1:nlevgrnd) ! used in computing tridiagonal matrix -! -! !CALLED FROM: -! subroutine Biogeophysics2 in module Biogeophysics2Mod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 12/19/01, Peter Thornton -! Changed references for tg to t_grnd, for consistency with the -! rest of the code (tg eliminated as redundant) -! 2/14/02, Peter Thornton: Migrated to new data structures. Added pft loop -! in calculation of net ground heat flux. -! 3/18/08, David Lawrence: Change nlevsoi to nlevgrnd for deep soil -! 03/28/08, Mark Flanner: Changes to allow solar radiative absorption in all snow layers and top soil layer -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: pgridcell(:) ! pft's gridcell index - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: clandunit(:) ! column's landunit - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: ctype(:) ! column type - integer , pointer :: npfts(:) ! column's number of pfts - integer , pointer :: pfti(:) ! column's beginning pft index - real(r8), pointer :: pwtcol(:) ! weight of pft relative to column - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: htvp(:) ! latent heat of vapor of water (or sublimation) [j/kg] - real(r8), pointer :: emg(:) ! ground emissivity - real(r8), pointer :: cgrnd(:) ! deriv. of soil energy flux wrt to soil temp [w/m2/k] - real(r8), pointer :: dlrad(:) ! downward longwave radiation blow the canopy [W/m2] - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - integer , pointer :: frac_veg_nosno(:) ! fraction of vegetation not covered by snow (0 OR 1 now) [-] (new) - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: z(:,:) ! layer thickness (m) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: eflx_lwrad_net(:) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: tssbef(:,:) ! temperature at previous time step [K] - real(r8), pointer :: t_building(:) ! internal building temperature (K) - real(r8), pointer :: t_building_max(:) ! maximum internal building temperature (K) - real(r8), pointer :: t_building_min(:) ! minimum internal building temperature (K) - real(r8), pointer :: hc_soi(:) ! soil heat content (MJ/m2) - real(r8), pointer :: hc_soisno(:) ! soil plus snow plus lake heat content (MJ/m2) - real(r8), pointer :: eflx_fgr12(:) ! heat flux between soil layer 1 and 2 (W/m2) - real(r8), pointer :: eflx_traffic(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_wasteheat_pft(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac(:) !sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_pft(:) !sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_traffic_pft(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_anthro(:) ! total anthropogenic heat flux (W/m**2) - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio - real(r8), pointer :: wtlunit_roof(:) ! weight of roof with respect to landunit - real(r8), pointer :: eflx_bot(:) ! heat flux from beneath column (W/m**2) [+ = upward] -! -! local pointers to original implicit inout arguments -! - real(r8), pointer :: t_grnd(:) ! ground surface temperature [K] -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: eflx_gnet(:) ! net ground heat flux into the surface (W/m**2) - real(r8), pointer :: dgnetdT(:) ! temperature derivative of ground net heat flux - real(r8), pointer :: eflx_building_heat(:) ! heat flux from urban building interior to walls, roof (W/m**2) - -! variables needed for SNICAR - real(r8), pointer :: sabg_lyr(:,:) ! absorbed solar radiation (pft,lyr) [W/m2] - real(r8), pointer :: h2osno(:) ! total snow water (col) [kg/m2] - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (col,lyr) [kg/m2] - real(r8), pointer :: h2osoi_ice(:,:) ! ice content (col,lyr) [kg/m2] - -! Urban building HAC fluxes - real(r8), pointer :: eflx_urban_ac(:) ! urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat(:) ! urban heating flux (W/m**2) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: j,c,p,l,g,pi ! indices - integer :: fc ! lake filtered column indices - integer :: fl ! urban filtered landunit indices - integer :: jtop(lbc:ubc) ! top level at each column - real(r8) :: dtime ! land model time step (sec) - real(r8) :: at (lbc:ubc,-nlevsno+1:nlevgrnd) ! "a" vector for tridiagonal matrix - real(r8) :: bt (lbc:ubc,-nlevsno+1:nlevgrnd) ! "b" vector for tridiagonal matrix - real(r8) :: ct (lbc:ubc,-nlevsno+1:nlevgrnd) ! "c" vector for tridiagonal matrix - real(r8) :: rt (lbc:ubc,-nlevsno+1:nlevgrnd) ! "r" vector for tridiagonal solution - real(r8) :: cv (lbc:ubc,-nlevsno+1:nlevgrnd) ! heat capacity [J/(m2 K)] - real(r8) :: tk (lbc:ubc,-nlevsno+1:nlevgrnd) ! thermal conductivity [W/(m K)] - real(r8) :: fn (lbc:ubc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] - real(r8) :: fn1(lbc:ubc,-nlevsno+1:nlevgrnd) ! heat diffusion through the layer interface [W/m2] - real(r8) :: brr(lbc:ubc,-nlevsno+1:nlevgrnd) ! temporary - real(r8) :: dzm ! used in computing tridiagonal matrix - real(r8) :: dzp ! used in computing tridiagonal matrix - real(r8) :: hs(lbc:ubc) ! net energy flux into the surface (w/m2) - real(r8) :: dhsdT(lbc:ubc) ! d(hs)/dT - real(r8) :: lwrad_emit(lbc:ubc) ! emitted longwave radiation - real(r8) :: dlwrad_emit(lbc:ubc) ! time derivative of emitted longwave radiation - integer :: lyr_top ! index of top layer of snowpack (-4 to 0) [idx] - real(r8) :: sabg_lyr_col(lbc:ubc,-nlevsno+1:1) ! absorbed solar radiation (col,lyr) [W/m2] - real(r8) :: eflx_gnet_top ! net energy flux into surface layer, pft-level [W/m2] - real(r8) :: hs_top(lbc:ubc) ! net energy flux into surface layer (col) [W/m2] - logical :: cool_on(lbl:ubl) ! is urban air conditioning on? - logical :: heat_on(lbl:ubl) ! is urban heating on? -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (gridcell-level) - - forc_lwrad => clm_a2l%forc_lwrad - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - t_building => lps%t_building - t_building_max => lps%t_building_max - t_building_min => lps%t_building_min - eflx_traffic => lef%eflx_traffic - canyon_hwr => lun%canyon_hwr - eflx_wasteheat => lef%eflx_wasteheat - eflx_heat_from_ac => lef%eflx_heat_from_ac - wtlunit_roof => lun%wtlunit_roof - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - clandunit => col%landunit - npfts => col%npfts - pfti => col%pfti - snl => cps%snl - htvp => cps%htvp - emg => cps%emg - t_grnd => ces%t_grnd - hc_soi => ces%hc_soi - hc_soisno => ces%hc_soisno - eflx_fgr12 => cef%eflx_fgr12 - zi => cps%zi - dz => cps%dz - z => cps%z - t_soisno => ces%t_soisno - eflx_building_heat => cef%eflx_building_heat - tssbef => ces%tssbef - eflx_urban_ac => cef%eflx_urban_ac - eflx_urban_heat => cef%eflx_urban_heat - eflx_bot => cef%eflx_bot - - ! Assign local pointers to derived subtypes components (pft-level) - - pgridcell => pft%gridcell - plandunit => pft%landunit - pwtcol => pft%wtcol - pwtgcell => pft%wtgcell - frac_veg_nosno => pps%frac_veg_nosno - cgrnd => pef%cgrnd - dlrad => pef%dlrad - sabg => pef%sabg - eflx_sh_grnd => pef%eflx_sh_grnd - qflx_evap_soi => pwf%qflx_evap_soi - qflx_tran_veg => pwf%qflx_tran_veg - eflx_gnet => pef%eflx_gnet - dgnetdT => pef%dgnetdT - eflx_lwrad_net => pef%eflx_lwrad_net - eflx_wasteheat_pft => pef%eflx_wasteheat_pft - eflx_heat_from_ac_pft => pef%eflx_heat_from_ac_pft - eflx_traffic_pft => pef%eflx_traffic_pft - eflx_anthro => pef%eflx_anthro - - sabg_lyr => pef%sabg_lyr - h2osno => cws%h2osno - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - - ! Get step size - - dtime = get_step_size() - - ! Compute ground surface and soil temperatures - - ! Thermal conductivity and Heat capacity - - call SoilThermProp(lbc, ubc, num_nolakec, filter_nolakec, tk, cv) - - ! Net ground heat flux into the surface and its temperature derivative - ! Added a pfts loop here to get the average of hs and dhsdT over - ! all PFTs on the column. Precalculate the terms that do not depend on PFT. - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - lwrad_emit(c) = emg(c) * sb * t_grnd(c)**4 - dlwrad_emit(c) = 4._r8*emg(c) * sb * t_grnd(c)**3 - end do - - hs(lbc:ubc) = 0._r8 - dhsdT(lbc:ubc) = 0._r8 - do pi = 1,max_pft_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if ( pi <= npfts(c) ) then - p = pfti(c) + pi - 1 - l = plandunit(p) - g = pgridcell(p) - - ! Note: Some glacier_mec pfts may have zero weight - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - if (ltype(l) /= isturb) then - eflx_gnet(p) = sabg(p) + dlrad(p) & - + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(g) - lwrad_emit(c) & - - (eflx_sh_grnd(p)+qflx_evap_soi(p)*htvp(c)) - else - ! For urban columns we use the net longwave radiation (eflx_lwrad_net) because of - ! interactions between urban columns. - - ! All wasteheat and traffic flux goes into canyon floor - if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - eflx_wasteheat_pft(p) = eflx_wasteheat(l)/(1._r8-wtlunit_roof(l)) - eflx_heat_from_ac_pft(p) = eflx_heat_from_ac(l)/(1._r8-wtlunit_roof(l)) - eflx_traffic_pft(p) = eflx_traffic(l)/(1._r8-wtlunit_roof(l)) - else - eflx_wasteheat_pft(p) = 0._r8 - eflx_heat_from_ac_pft(p) = 0._r8 - eflx_traffic_pft(p) = 0._r8 - end if - ! Include transpiration term because needed for previous road - ! and include wasteheat and traffic flux - eflx_gnet(p) = sabg(p) + dlrad(p) & - - eflx_lwrad_net(p) & - - (eflx_sh_grnd(p) + qflx_evap_soi(p)*htvp(c) + qflx_tran_veg(p)*hvap) & - + eflx_wasteheat_pft(p) + eflx_heat_from_ac_pft(p) + eflx_traffic_pft(p) - eflx_anthro(p) = eflx_wasteheat_pft(p) + eflx_traffic_pft(p) - end if - dgnetdT(p) = - cgrnd(p) - dlwrad_emit(c) - hs(c) = hs(c) + eflx_gnet(p) * pwtcol(p) - dhsdT(c) = dhsdT(c) + dgnetdT(p) * pwtcol(p) - end if - - end if - end do - end do - - ! Additional calculations with SNICAR: - ! Set up tridiagonal matrix in a new manner. There is now - ! absorbed solar radiation in each snow layer, instead of - ! only the surface. Following the current implementation, - ! absorbed solar flux should be: S + ((delS/delT)*dT), - ! where S is absorbed radiation, and T is temperature. Now, - ! assume delS/delT is zero, then it is OK to just add S - ! to each layer - - ! Initialize: - sabg_lyr_col(lbc:ubc,-nlevsno+1:1) = 0._r8 - hs_top(lbc:ubc) = 0._r8 - - do pi = 1,max_pft_per_col - do fc = 1,num_nolakec - c = filter_nolakec(fc) - lyr_top = snl(c) + 1 - if ( pi <= npfts(c) ) then - p = pfti(c) + pi - 1 - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ltype(l)==istice_mec) then - g = pgridcell(p) - if (ltype(l) /= isturb )then - - eflx_gnet_top = sabg_lyr(p,lyr_top) + dlrad(p) + (1-frac_veg_nosno(p))*emg(c)*forc_lwrad(g) & - - lwrad_emit(c) - (eflx_sh_grnd(p)+qflx_evap_soi(p)*htvp(c)) - - hs_top(c) = hs_top(c) + eflx_gnet_top*pwtcol(p) - - do j = lyr_top,1,1 - sabg_lyr_col(c,j) = sabg_lyr_col(c,j) + sabg_lyr(p,j) * pwtcol(p) - enddo - else - - hs_top(c) = hs_top(c) + eflx_gnet(p)*pwtcol(p) - - sabg_lyr_col(c,lyr_top) = sabg_lyr_col(c,lyr_top) + sabg(p) * pwtcol(p) - - endif - endif - - endif - enddo - enddo - - ! Restrict internal building temperature to between min and max - ! and determine if heating or air conditioning is on - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (ltype(l) == isturb) then - cool_on(l) = .false. - heat_on(l) = .false. - if (t_building(l) > t_building_max(l)) then - t_building(l) = t_building_max(l) - cool_on(l) = .true. - heat_on(l) = .false. - else if (t_building(l) < t_building_min(l)) then - t_building(l) = t_building_min(l) - cool_on(l) = .false. - heat_on(l) = .true. - end if - end if - end do - - ! Determine heat diffusion through the layer interface and factor used in computing - ! tridiagonal matrix and set up vector r and vectors a, b, c that define tridiagonal - ! matrix and solve system - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (j >= snl(c)+1) then - if (j == snl(c)+1) then - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall .or. ctype(c)==icol_roof) then - fact(c,j) = dtime/cv(c,j) - else - fact(c,j) = dtime/cv(c,j) * dz(c,j) / (0.5_r8*(z(c,j)-zi(c,j-1)+capr*(z(c,j+1)-zi(c,j-1)))) - end if - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j <= nlevgrnd-1) then - fact(c,j) = dtime/cv(c,j) - fn(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - dzm = (z(c,j)-z(c,j-1)) - else if (j == nlevgrnd) then - fact(c,j) = dtime/cv(c,j) - - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall .or. ctype(c)==icol_roof) then - fn(c,j) = tk(c,j) * (t_building(l) - cnfac*t_soisno(c,j))/(zi(c,j) - z(c,j)) - else - fn(c,j) = eflx_bot(c) - end if - end if - end if - enddo - end do - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (j >= snl(c)+1) then - if (j == snl(c)+1) then - dzp = z(c,j+1)-z(c,j) - at(c,j) = 0._r8 - bt(c,j) = 1+(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp-fact(c,j)*dhsdT(c) - ct(c,j) = -(1._r8-cnfac)*fact(c,j)*tk(c,j)/dzp - ! changed hs to hs_top - rt(c,j) = t_soisno(c,j) + fact(c,j)*( hs_top(c) - dhsdT(c)*t_soisno(c,j) + cnfac*fn(c,j) ) - else if (j <= nlevgrnd-1) then - dzm = (z(c,j)-z(c,j-1)) - dzp = (z(c,j+1)-z(c,j)) - at(c,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j-1)/dzm - bt(c,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j)/dzp + tk(c,j-1)/dzm) - ct(c,j) = - (1._r8-cnfac)*fact(c,j)* tk(c,j)/dzp - - ! if this is a snow layer or the top soil layer, - ! add absorbed solar flux to factor 'rt' - if (j <= 1) then - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) + (fact(c,j)*sabg_lyr_col(c,j)) - else - rt(c,j) = t_soisno(c,j) + cnfac*fact(c,j)*( fn(c,j) - fn(c,j-1) ) - endif - - else if (j == nlevgrnd) then - - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall .or. ctype(c)==icol_roof) then - dzm = ( z(c,j)-z(c,j-1)) - dzp = (zi(c,j)-z(c,j)) - at(c,j) = - (1._r8-cnfac)*fact(c,j)*(tk(c,j-1)/dzm) - bt(c,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*(tk(c,j-1)/dzm + tk(c,j)/dzp) - ct(c,j) = 0._r8 - rt(c,j) = t_soisno(c,j) + fact(c,j)*( fn(c,j) - cnfac*fn(c,j-1) ) - else - dzm = (z(c,j)-z(c,j-1)) - at(c,j) = - (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - bt(c,j) = 1._r8+ (1._r8-cnfac)*fact(c,j)*tk(c,j-1)/dzm - ct(c,j) = 0._r8 - rt(c,j) = t_soisno(c,j) - cnfac*fact(c,j)*fn(c,j-1) + fact(c,j)*fn(c,j) - end if - end if - - end if - enddo - end do - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - jtop(c) = snl(c) + 1 - end do - call Tridiagonal(lbc, ubc, -nlevsno+1, nlevgrnd, jtop, num_nolakec, filter_nolakec, & - at, bt, ct, rt, t_soisno(lbc:ubc,-nlevsno+1:nlevgrnd)) - - ! Melting or Freezing - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (j >= snl(c)+1) then - if (j <= nlevgrnd-1) then - fn1(c,j) = tk(c,j)*(t_soisno(c,j+1)-t_soisno(c,j))/(z(c,j+1)-z(c,j)) - else if (j == nlevgrnd) then - - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - ! Note new formulation for fn, this will be used below in brr computation - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall .or. ctype(c)==icol_roof) then - fn1(c,j) = tk(c,j) * (t_building(l) - t_soisno(c,j))/(zi(c,j) - z(c,j)) - fn(c,j) = tk(c,j) * (t_building(l) - tssbef(c,j))/(zi(c,j) - z(c,j)) - else - fn1(c,j) = 0._r8 - end if - end if - end if - end do - end do - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (ltype(l) == isturb) then - eflx_building_heat(c) = cnfac*fn(c,nlevurb) + (1-cnfac)*fn1(c,nlevurb) - if (cool_on(l)) then - eflx_urban_ac(c) = abs(eflx_building_heat(c)) - eflx_urban_heat(c) = 0._r8 - else if (heat_on(l)) then - eflx_urban_ac(c) = 0._r8 - eflx_urban_heat(c) = abs(eflx_building_heat(c)) - else - eflx_urban_ac(c) = 0._r8 - eflx_urban_heat(c) = 0._r8 - end if - end if - end do - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (j >= snl(c)+1) then - if (j == snl(c)+1) then - brr(c,j) = cnfac*fn(c,j) + (1._r8-cnfac)*fn1(c,j) - else - brr(c,j) = cnfac*(fn(c,j)-fn(c,j-1)) + (1._r8-cnfac)*(fn1(c,j)-fn1(c,j-1)) - end if - end if - end do - end do - - call PhaseChange (lbc, ubc, num_nolakec, filter_nolakec, fact, brr, hs, dhsdT, xmf, hs_top, sabg_lyr_col) - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - t_grnd(c) = t_soisno(c,snl(c)+1) - end do - - -! Initialize soil heat content - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (ltype(l) /= isturb) then - hc_soisno(c) = 0._r8 - hc_soi(c) = 0._r8 - end if - eflx_fgr12(c)= 0._r8 - end do - -! Calculate soil heat content and soil plus snow heat content - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - eflx_fgr12(c) = -cnfac*fn(c,1) - (1._r8-cnfac)*fn1(c,1) - if (ltype(l) /= isturb) then - if (j >= snl(c)+1) then - hc_soisno(c) = hc_soisno(c) + cv(c,j)*t_soisno(c,j) / 1.e6_r8 - endif - if (j >= 1) then - hc_soi(c) = hc_soi(c) + cv(c,j)*t_soisno(c,j) / 1.e6_r8 - end if - end if - end do - end do - - end subroutine SoilTemperature - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SoilThermProp -! -! !INTERFACE: - subroutine SoilThermProp (lbc, ubc, num_nolakec, filter_nolakec, tk, cv) -! -! !DESCRIPTION: -! Calculation of thermal conductivities and heat capacities of -! snow/soil layers -! (1) The volumetric heat capacity is calculated as a linear combination -! in terms of the volumetric fraction of the constituent phases. -! -! (2) The thermal conductivity of soil is computed from the algorithm of -! Johansen (as reported by Farouki 1981), and of snow is from the -! formulation used in SNTHERM (Jordan 1991). -! The thermal conductivities at the interfaces between two neighboring -! layers (j, j+1) are derived from an assumption that the flux across -! the interface is equal to that from the node j to the interface and the -! flux from the interface to the node j+1. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use clm_varcon , only : denh2o, denice, tfrz, tkwat, tkice, tkair, & - cpice, cpliq, istice, istice_mec, istwet, & - icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv - use clm_varpar , only : nlevsno, nlevgrnd, nlevurb, nlevsoi -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - real(r8), intent(out) :: cv(lbc:ubc,-nlevsno+1:nlevgrnd)! heat capacity [J/(m2 K)] - real(r8), intent(out) :: tk(lbc:ubc,-nlevsno+1:nlevgrnd)! thermal conductivity [W/(m K)] -! -! !CALLED FROM: -! subroutine SoilTemperature in this module -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/13/02, Peter Thornton: migrated to new data structures -! 7/01/03, Mariana Vertenstein: migrated to vector code -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in scalars -! - integer , pointer :: ctype(:) ! column type - integer , pointer :: clandunit(:) ! column's landunit - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) -! -! local pointers to original implicit in arrays -! - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: tksatu(:,:) ! thermal conductivity, saturated soil [W/m-K] - real(r8), pointer :: tkmg(:,:) ! thermal conductivity, soil minerals [W/m-K] - real(r8), pointer :: tkdry(:,:) ! thermal conductivity, dry soil (W/m/Kelvin) - real(r8), pointer :: csol(:,:) ! heat capacity, soil solids (J/m**3/Kelvin) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) - real(r8), pointer :: z(:,:) ! layer thickness (m) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: tk_wall(:,:) ! thermal conductivity of urban wall - real(r8), pointer :: tk_roof(:,:) ! thermal conductivity of urban roof - real(r8), pointer :: tk_improad(:,:) ! thermal conductivity of urban impervious road - real(r8), pointer :: cv_wall(:,:) ! thermal conductivity of urban wall - real(r8), pointer :: cv_roof(:,:) ! thermal conductivity of urban roof - real(r8), pointer :: cv_improad(:,:) ! thermal conductivity of urban impervious road - integer, pointer :: nlev_improad(:) ! number of impervious road layers - -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: l,c,j ! indices - integer :: fc ! lake filtered column indices - real(r8) :: bw ! partial density of water (ice + liquid) - real(r8) :: dksat ! thermal conductivity for saturated soil (j/(k s m)) - real(r8) :: dke ! kersten number - real(r8) :: fl ! fraction of liquid or unfrozen water to total water - real(r8) :: satw ! relative total water content of soil. - real(r8) :: thk(lbc:ubc,-nlevsno+1:nlevgrnd) ! thermal conductivity of layer - real(r8) :: thk_bedrock = 3.0_r8 ! thermal conductivity of 'typical' saturated granitic rock - ! (Clauser and Huenges, 1995)(W/m/K) -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - clandunit => col%landunit - snl => cps%snl - h2osno => cws%h2osno - watsat => cps%watsat - tksatu => cps%tksatu - tkmg => cps%tkmg - tkdry => cps%tkdry - csol => cps%csol - dz => cps%dz - zi => cps%zi - z => cps%z - t_soisno => ces%t_soisno - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - tk_wall => lps%tk_wall - tk_roof => lps%tk_roof - tk_improad => lps%tk_improad - cv_wall => lps%cv_wall - cv_roof => lps%cv_roof - cv_improad => lps%cv_improad - nlev_improad => lps%nlev_improad - - ! Thermal conductivity of soil from Farouki (1981) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. - - do j = -nlevsno+1,nlevgrnd - do fc = 1, num_nolakec - c = filter_nolakec(fc) - - ! Only examine levels from 1->nlevgrnd - if (j >= 1) then - l = clandunit(c) - if (ctype(c) == icol_sunwall .OR. ctype(c) == icol_shadewall) then - thk(c,j) = tk_wall(l,j) - else if (ctype(c) == icol_roof) then - thk(c,j) = tk_roof(l,j) - else if (ctype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - thk(c,j) = tk_improad(l,j) - elseif (ltype(l) /= istwet .AND. ltype(l) /= istice & - .AND. ltype(l) /= istice_mec) then - satw = (h2osoi_liq(c,j)/denh2o + h2osoi_ice(c,j)/denice)/(dz(c,j)*watsat(c,j)) - satw = min(1._r8, satw) - if (satw > .1e-6_r8) then - fl = h2osoi_liq(c,j)/(h2osoi_ice(c,j)+h2osoi_liq(c,j)) - if (t_soisno(c,j) >= tfrz) then ! Unfrozen soil - dke = max(0._r8, log10(satw) + 1.0_r8) - dksat = tksatu(c,j) - else ! Frozen soil - dke = satw - dksat = tkmg(c,j)*0.249_r8**(fl*watsat(c,j))*2.29_r8**watsat(c,j) - endif - thk(c,j) = dke*dksat + (1._r8-dke)*tkdry(c,j) - else - thk(c,j) = tkdry(c,j) - endif - if (j > nlevsoi) thk(c,j) = thk_bedrock - else if (ltype(l) == istice .OR. ltype(l) == istice_mec) then - thk(c,j) = tkwat - if (t_soisno(c,j) < tfrz) thk(c,j) = tkice - else if (ltype(l) == istwet) then - if (j > nlevsoi) then - thk(c,j) = thk_bedrock - else - thk(c,j) = tkwat - if (t_soisno(c,j) < tfrz) thk(c,j) = tkice - endif - endif - endif - - ! Thermal conductivity of snow, which from Jordan (1991) pp. 18 - ! Only examine levels from snl(c)+1 -> 0 where snl(c) < 1 - if (snl(c)+1 < 1 .AND. (j >= snl(c)+1) .AND. (j <= 0)) then - bw = (h2osoi_ice(c,j)+h2osoi_liq(c,j))/dz(c,j) - thk(c,j) = tkair + (7.75e-5_r8 *bw + 1.105e-6_r8*bw*bw)*(tkice-tkair) - end if - - end do - end do - - ! Thermal conductivity at the layer interface - - do j = -nlevsno+1,nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (j >= snl(c)+1 .AND. j <= nlevgrnd-1) then - tk(c,j) = thk(c,j)*thk(c,j+1)*(z(c,j+1)-z(c,j)) & - /(thk(c,j)*(z(c,j+1)-zi(c,j))+thk(c,j+1)*(zi(c,j)-z(c,j))) - else if (j == nlevgrnd) then - - ! For urban sunwall, shadewall, and roof columns, there is a non-zero heat flux across - ! the bottom "soil" layer and the equations are derived assuming a prescribed internal - ! building temperature. (See Oleson urban notes of 6/18/03). - if (ctype(c)==icol_sunwall .OR. ctype(c)==icol_shadewall .OR. ctype(c)==icol_roof) then - tk(c,j) = thk(c,j) - else - tk(c,j) = 0._r8 - end if - end if - end do - end do - - ! Soil heat capacity, from de Vires (1963) - ! Urban values are from Masson et al. 2002, Evaluation of the Town Energy Balance (TEB) - ! scheme with direct measurements from dry districts in two cities, J. Appl. Meteorol., - ! 41, 1011-1026. - - do j = 1, nlevgrnd - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (ctype(c)==icol_sunwall .OR. ctype(c)==icol_shadewall) then - cv(c,j) = cv_wall(l,j) * dz(c,j) - else if (ctype(c) == icol_roof) then - cv(c,j) = cv_roof(l,j) * dz(c,j) - else if (ctype(c) == icol_road_imperv .and. j >= 1 .and. j <= nlev_improad(l)) then - cv(c,j) = cv_improad(l,j) * dz(c,j) - elseif (ltype(l) /= istwet .AND. ltype(l) /= istice & - .AND. ltype(l) /= istice_mec) then - cv(c,j) = csol(c,j)*(1-watsat(c,j))*dz(c,j) + (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - else if (ltype(l) == istwet) then - cv(c,j) = (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - if (j > nlevsoi) cv(c,j) = csol(c,j)*dz(c,j) - else if (ltype(l) == istice .OR. ltype(l) == istice_mec) then - cv(c,j) = (h2osoi_ice(c,j)*cpice + h2osoi_liq(c,j)*cpliq) - endif - if (j == 1) then - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8) then - cv(c,j) = cv(c,j) + cpice*h2osno(c) - end if - end if - enddo - end do - - ! Snow heat capacity - - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (snl(c)+1 < 1 .and. j >= snl(c)+1) then - cv(c,j) = cpliq*h2osoi_liq(c,j) + cpice*h2osoi_ice(c,j) - end if - end do - end do - - end subroutine SoilThermProp - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: PhaseChange -! -! !INTERFACE: - subroutine PhaseChange (lbc, ubc, num_nolakec, filter_nolakec, fact, & - brr, hs, dhsdT, xmf, hs_top, sabg_lyr_col) -! -! !DESCRIPTION: -! Calculation of the phase change within snow and soil layers: -! (1) Check the conditions for which the phase change may take place, -! i.e., the layer temperature is great than the freezing point -! and the ice mass is not equal to zero (i.e. melting), -! or the layer temperature is less than the freezing point -! and the liquid water mass is greater than the allowable supercooled -! liquid water calculated from freezing point depression (i.e. freezing). -! (2) Assess the rate of phase change from the energy excess (or deficit) -! after setting the layer temperature to freezing point. -! (3) Re-adjust the ice and liquid mass, and the layer temperature -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_time_manager, only : get_step_size - use clm_varcon , only : tfrz, hfus, grav, istsoil, istice_mec, isturb, icol_road_perv - use clm_varcon , only : istcrop - use clm_varpar , only : nlevsno, nlevgrnd - -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer , intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - real(r8), intent(in) :: brr (lbc:ubc, -nlevsno+1:nlevgrnd) ! temporary - real(r8), intent(in) :: fact (lbc:ubc, -nlevsno+1:nlevgrnd) ! temporary - real(r8), intent(in) :: hs (lbc:ubc) ! net ground heat flux into the surface - real(r8), intent(in) :: dhsdT (lbc:ubc) ! temperature derivative of "hs" - real(r8), intent(out):: xmf (lbc:ubc) ! total latent heat of phase change - real(r8), intent(in) :: hs_top(lbc:ubc) ! net heat flux into the top snow layer [W/m2] - real(r8), intent(in) :: sabg_lyr_col(lbc:ubc,-nlevsno+1:1) ! absorbed solar radiation (col,lyr) [W/m2] - -! -! !CALLED FROM: -! subroutine SoilTemperature in this module -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 2/14/02, Peter Thornton: Migrated to new data structures. -! 7/01/03, Mariana Vertenstein: Migrated to vector code -! 04/25/07 Keith Oleson: CLM3.5 Hydrology -! 03/28/08 Mark Flanner: accept new arguments and calculate freezing rate of h2o in snow -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in scalars -! - real(r8), pointer :: qflx_snow_melt(:) ! net snow melt - integer , pointer :: snl(:) !number of snow layers - real(r8), pointer :: h2osno(:) !snow water (mm H2O) - integer , pointer :: ltype(:) !landunit type - integer , pointer :: clandunit(:) !column's landunit - integer , pointer :: ctype(:) !column type -! -! local pointers to original implicit inout scalars -! - real(r8), pointer :: snowdp(:) !snow height (m) -! -! local pointers to original implicit out scalars -! - real(r8), pointer :: qflx_snomelt(:) !snow melt (mm H2O /s) - real(r8), pointer :: eflx_snomelt(:) !snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_u(:)!urban snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_r(:)!rural snow melt heat flux (W/m**2) - real(r8), pointer :: qflx_snofrz_lyr(:,:) !snow freezing rate (positive definite) (col,lyr) [kg m-2 s-1] - real(r8), pointer :: qflx_snofrz_col(:) !column-integrated snow freezing rate (positive definite) [kg m-2 s-1] - real(r8), pointer :: qflx_glcice(:) !flux of new glacier ice (mm H2O/s) [+ = ice grows] - real(r8), pointer :: qflx_glcice_melt(:) !ice melt (positive definite) (mm H2O/s) -! -! local pointers to original implicit in arrays -! - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) (new) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) (new) - real(r8), pointer :: tssbef(:,:) !temperature at previous time step [K] - real(r8), pointer :: sucsat(:,:) !minimum soil suction (mm) - real(r8), pointer :: watsat(:,:) !volumetric soil water at saturation (porosity) - real(r8), pointer :: bsw(:,:) !Clapp and Hornberger "b" - real(r8), pointer :: dz(:,:) !layer thickness (m) -! -! local pointers to original implicit inout arrays -! - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) -! -! local pointers to original implicit out arrays -! - integer, pointer :: imelt(:,:) !flag for melting (=1), freezing (=2), Not=0 (new) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: j,c,g,l !do loop index - integer :: fc !lake filtered column indices - real(r8) :: dtime !land model time step (sec) - real(r8) :: heatr !energy residual or loss after melting or freezing - real(r8) :: temp1 !temporary variables [kg/m2] - real(r8) :: hm(lbc:ubc,-nlevsno+1:nlevgrnd) !energy residual [W/m2] - real(r8) :: xm(lbc:ubc,-nlevsno+1:nlevgrnd) !melting or freezing within a time step [kg/m2] - real(r8) :: wmass0(lbc:ubc,-nlevsno+1:nlevgrnd)!initial mass of ice and liquid (kg/m2) - real(r8) :: wice0 (lbc:ubc,-nlevsno+1:nlevgrnd)!initial mass of ice (kg/m2) - real(r8) :: wliq0 (lbc:ubc,-nlevsno+1:nlevgrnd)!initial mass of liquid (kg/m2) - real(r8) :: supercool(lbc:ubc,nlevgrnd) !supercooled water in soil (kg/m2) - real(r8) :: propor !proportionality constant (-) - real(r8) :: tinc !t(n+1)-t(n) (K) - real(r8) :: smp !frozen water potential (mm) -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (column-level) - - snl => cps%snl - h2osno => cws%h2osno - snowdp => cps%snowdp - qflx_snow_melt => cwf%qflx_snow_melt - qflx_snomelt => cwf%qflx_snomelt - eflx_snomelt => cef%eflx_snomelt - eflx_snomelt_u => cef%eflx_snomelt_u - eflx_snomelt_r => cef%eflx_snomelt_r - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - imelt => cps%imelt - t_soisno => ces%t_soisno - tssbef => ces%tssbef - bsw => cps%bsw - sucsat => cps%sucsat - watsat => cps%watsat - dz => cps%dz - ctype => col%itype - clandunit => col%landunit - ltype => lun%itype - qflx_snofrz_lyr => cwf%qflx_snofrz_lyr - qflx_snofrz_col => cwf%qflx_snofrz_col - qflx_glcice => cwf%qflx_glcice - qflx_glcice_melt => cwf%qflx_glcice_melt - - ! Get step size - - dtime = get_step_size() - - ! Initialization - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - - qflx_snomelt(c) = 0._r8 - qflx_snow_melt(c) = 0._r8 - xmf(c) = 0._r8 - qflx_snofrz_lyr(c,-nlevsno+1:0) = 0._r8 - qflx_snofrz_col(c) = 0._r8 - if (ltype(l)==istice_mec) then - ! only need to initialize qflx_glcice_melt over ice_mec landunits, because - ! those are the only places where it is computed - qflx_glcice_melt(c) = 0._r8 - end if - end do - - do j = -nlevsno+1,nlevgrnd ! all layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (j >= snl(c)+1) then - - ! Initialization - imelt(c,j) = 0 - hm(c,j) = 0._r8 - xm(c,j) = 0._r8 - wice0(c,j) = h2osoi_ice(c,j) - wliq0(c,j) = h2osoi_liq(c,j) - wmass0(c,j) = h2osoi_ice(c,j) + h2osoi_liq(c,j) - endif ! end of snow layer if-block - end do ! end of column-loop - enddo ! end of level-loop - - do j = -nlevsno+1,0 ! snow layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - if (j >= snl(c)+1) then - - ! Melting identification - ! If ice exists above melt point, melt some to liquid. - if (h2osoi_ice(c,j) > 0._r8 .AND. t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - t_soisno(c,j) = tfrz - endif - - ! Freezing identification - ! If liquid exists below melt point, freeze some to ice. - if (h2osoi_liq(c,j) > 0._r8 .AND. t_soisno(c,j) < tfrz) then - imelt(c,j) = 2 - t_soisno(c,j) = tfrz - endif - endif ! end of snow layer if-block - end do ! end of column-loop - enddo ! end of level-loop - - do j = 1,nlevgrnd ! soil layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - l = clandunit(c) - if (h2osoi_ice(c,j) > 0. .AND. t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - t_soisno(c,j) = tfrz - endif - - ! from Zhao (1997) and Koren (1999) - supercool(c,j) = 0.0_r8 - if (ltype(l) == istsoil .or. ltype(l) == istcrop .or. ctype(c) == icol_road_perv) then - if(t_soisno(c,j) < tfrz) then - smp = hfus*(tfrz-t_soisno(c,j))/(grav*t_soisno(c,j)) * 1000._r8 !(mm) - supercool(c,j) = watsat(c,j)*(smp/sucsat(c,j))**(-1._r8/bsw(c,j)) - supercool(c,j) = supercool(c,j)*dz(c,j)*1000._r8 ! (mm) - endif - endif - - if (h2osoi_liq(c,j) > supercool(c,j) .AND. t_soisno(c,j) < tfrz) then - imelt(c,j) = 2 - t_soisno(c,j) = tfrz - endif - - ! If snow exists, but its thickness is less than the critical value (0.01 m) - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8 .AND. j == 1) then - if (t_soisno(c,j) > tfrz) then - imelt(c,j) = 1 - t_soisno(c,j) = tfrz - endif - endif - end do - enddo - - do j = -nlevsno+1,nlevgrnd ! all layers - do fc = 1,num_nolakec - c = filter_nolakec(fc) - - if (j >= snl(c)+1) then - - ! Calculate the energy surplus and loss for melting and freezing - if (imelt(c,j) > 0) then - tinc = t_soisno(c,j)-tssbef(c,j) - - ! added unique cases for this calculation, - ! to account for absorbed solar radiation in each layer - if (j == snl(c)+1) then - ! top layer - hm(c,j) = hs_top(c) + dhsdT(c)*tinc + brr(c,j) - tinc/fact(c,j) - elseif (j <= 1) then - ! snow layer or top soil layer (where sabg_lyr_col is defined) - hm(c,j) = brr(c,j) - tinc/fact(c,j) + sabg_lyr_col(c,j) - else - ! soil layer - hm(c,j) = brr(c,j) - tinc/fact(c,j) - endif - - endif - - ! These two errors were checked carefully (Y. Dai). They result from the - ! computed error of "Tridiagonal-Matrix" in subroutine "thermal". - if (imelt(c,j) == 1 .AND. hm(c,j) < 0._r8) then - hm(c,j) = 0._r8 - imelt(c,j) = 0 - endif - if (imelt(c,j) == 2 .AND. hm(c,j) > 0._r8) then - hm(c,j) = 0._r8 - imelt(c,j) = 0 - endif - - ! The rate of melting and freezing - - if (imelt(c,j) > 0 .and. abs(hm(c,j)) > 0._r8) then - xm(c,j) = hm(c,j)*dtime/hfus ! kg/m2 - - ! If snow exists, but its thickness is less than the critical value - ! (1 cm). Note: more work is needed to determine how to tune the - ! snow depth for this case - if (j == 1) then - if (snl(c)+1 == 1 .AND. h2osno(c) > 0._r8 .AND. xm(c,j) > 0._r8) then - temp1 = h2osno(c) ! kg/m2 - h2osno(c) = max(0._r8,temp1-xm(c,j)) - propor = h2osno(c)/temp1 - snowdp(c) = propor * snowdp(c) - heatr = hm(c,j) - hfus*(temp1-h2osno(c))/dtime ! W/m2 - if (heatr > 0._r8) then - xm(c,j) = heatr*dtime/hfus ! kg/m2 - hm(c,j) = heatr ! W/m2 - else - xm(c,j) = 0._r8 - hm(c,j) = 0._r8 - endif - qflx_snomelt(c) = max(0._r8,(temp1-h2osno(c)))/dtime ! kg/(m2 s) - xmf(c) = hfus*qflx_snomelt(c) - qflx_snow_melt(c) = qflx_snomelt(c) - endif - endif - - heatr = 0._r8 - if (xm(c,j) > 0._r8) then - h2osoi_ice(c,j) = max(0._r8, wice0(c,j)-xm(c,j)) - heatr = hm(c,j) - hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - else if (xm(c,j) < 0._r8) then - if (j <= 0) then - h2osoi_ice(c,j) = min(wmass0(c,j), wice0(c,j)-xm(c,j)) ! snow - else - if (wmass0(c,j) < supercool(c,j)) then - h2osoi_ice(c,j) = 0._r8 - else - h2osoi_ice(c,j) = min(wmass0(c,j) - supercool(c,j),wice0(c,j)-xm(c,j)) - endif - endif - heatr = hm(c,j) - hfus*(wice0(c,j)-h2osoi_ice(c,j))/dtime - endif - - h2osoi_liq(c,j) = max(0._r8,wmass0(c,j)-h2osoi_ice(c,j)) - - if (abs(heatr) > 0._r8) then - if (j > snl(c)+1) then - t_soisno(c,j) = t_soisno(c,j) + fact(c,j)*heatr - else - t_soisno(c,j) = t_soisno(c,j) + fact(c,j)*heatr/(1._r8-fact(c,j)*dhsdT(c)) - endif - if (j <= 0) then ! snow - if (h2osoi_liq(c,j)*h2osoi_ice(c,j)>0._r8) t_soisno(c,j) = tfrz - end if - endif - - xmf(c) = xmf(c) + hfus * (wice0(c,j)-h2osoi_ice(c,j))/dtime - - if (imelt(c,j) == 1 .AND. j < 1) then - qflx_snomelt(c) = qflx_snomelt(c) + max(0._r8,(wice0(c,j)-h2osoi_ice(c,j)))/dtime - endif - - ! layer freezing mass flux (positive): - if (imelt(c,j) == 2 .AND. j < 1) then - qflx_snofrz_lyr(c,j) = max(0._r8,(h2osoi_ice(c,j)-wice0(c,j)))/dtime - endif - - endif - endif ! end of snow layer if-block - - ! For glacier_mec columns, compute negative ice flux from melted ice. - ! Note that qflx_glcice can also include a positive component from excess snow, - ! as computed in Hydrology2Mod.F90. - - l = clandunit(c) - if (ltype(l)==istice_mec) then - - if (j>=1 .and. h2osoi_liq(c,j) > 0._r8) then ! ice layer with meltwater - ! melting corresponds to a negative ice flux - qflx_glcice_melt(c) = qflx_glcice_melt(c) + h2osoi_liq(c,j)/dtime - qflx_glcice(c) = qflx_glcice(c) - h2osoi_liq(c,j)/dtime - - ! convert layer back to pure ice by "borrowing" ice from below the column - h2osoi_ice(c,j) = h2osoi_ice(c,j) + h2osoi_liq(c,j) - h2osoi_liq(c,j) = 0._r8 - - endif ! liquid water is present - endif ! istice_mec - - end do ! end of column-loop - enddo ! end of level-loop - - ! Needed for history file output - - do fc = 1,num_nolakec - c = filter_nolakec(fc) - eflx_snomelt(c) = qflx_snomelt(c) * hfus - l = clandunit(c) - if (ltype(l) == isturb) then - eflx_snomelt_u(c) = eflx_snomelt(c) - else if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - eflx_snomelt_r(c) = eflx_snomelt(c) - end if - end do - - do j = -nlevsno+1,0 - do fc = 1,num_nolakec - c = filter_nolakec(fc) - qflx_snofrz_col(c) = qflx_snofrz_col(c) + qflx_snofrz_lyr(c,j) - end do - end do - - end subroutine PhaseChange - - -end module SoilTemperatureMod diff --git a/src_clm40/biogeophys/SurfaceAlbedoMod.F90 b/src_clm40/biogeophys/SurfaceAlbedoMod.F90 deleted file mode 100644 index 1fa9e12055..0000000000 --- a/src_clm40/biogeophys/SurfaceAlbedoMod.F90 +++ /dev/null @@ -1,1045 +0,0 @@ -module SurfaceAlbedoMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: SurfaceAlbedoMod -! -! !DESCRIPTION: -! Performs surface albedo calculations -! -! !PUBLIC TYPES: - use clm_varcon , only : istsoil - use clm_varpar , only : numrad - use clm_varcon , only : istcrop - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varpar , only : nlevsno - use SNICARMod , only : sno_nbr_aer, SNICAR_RT, DO_SNO_AER, DO_SNO_OC - use clm_varctl , only : use_snicar_frc - - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SurfaceAlbedo ! Surface albedo and two-stream fluxes -! -! !PUBLIC DATA MEMBERS: -! The CLM default albice values are too high. -! Full-spectral albedo for land ice is ~0.5 (Paterson, Physics of Glaciers, 1994, p. 59) -! This is the value used in CAM3 by Pritchard et al., GRL, 35, 2008. - - real(r8), public :: albice(numrad) = & ! albedo land ice by waveband (1=vis, 2=nir) - (/ 0.80_r8, 0.55_r8 /) -! -! !PRIVATE MEMBER FUNCTIONS: - private :: SoilAlbedo ! Determine ground surface albedo - private :: TwoStream ! Two-stream fluxes for canopy radiative transfer - -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SurfaceAlbedo -! -! !INTERFACE: - subroutine SurfaceAlbedo(lbg, ubg, lbc, ubc, lbp, ubp, & - num_nourbanc, filter_nourbanc, & - num_nourbanp, filter_nourbanp, & - nextsw_cday, declinp1) -! -! !DESCRIPTION: -! Surface albedo and two-stream fluxes -! Surface albedos. Also fluxes (per unit incoming direct and diffuse -! radiation) reflected, transmitted, and absorbed by vegetation. -! Also sunlit fraction of the canopy. -! The calling sequence is: -! -> SurfaceAlbedo: albedos for next time step -! -> SoilAlbedo: soil/lake/glacier/wetland albedos -! -> SNICAR_RT: snow albedos: direct beam (SNICAR) -! -> SNICAR_RT: snow albedos: diffuse (SNICAR) -! -> TwoStream: absorbed, reflected, transmitted solar fluxes (vis dir,vis dif, nir dir, nir dif) -! - -! !USES: - use clmtype - use shr_orb_mod - use clm_time_manager, only : get_nstep - -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbg, ubg ! gridcell bounds - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: lbp, ubp ! pft bounds - integer , intent(in) :: num_nourbanc ! number of columns in non-urban filter - integer , intent(in) :: filter_nourbanc(ubc-lbc+1) ! column filter for non-urban points - integer , intent(in) :: num_nourbanp ! number of pfts in non-urban filter - integer , intent(in) :: filter_nourbanp(ubp-lbp+1) ! pft filter for non-urban points - real(r8), intent(in) :: nextsw_cday ! calendar day at Greenwich (1.00, ..., days/year) - real(r8), intent(in) :: declinp1 ! declination angle (radians) for next time step -! -! !CALLED FROM: -! subroutine clm_driver1 -! subroutine iniTimeVar -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 2/1/02, Peter Thornton: Migrate to new data structures -! 8/20/03, Mariana Vertenstein: Vectorized routine -! 11/3/03, Peter Thornton: added decl(c) output for use in CN code. -! 03/28/08, Mark Flanner: added SNICAR, which required reversing the -! order of calls to SNICAR_RT and SoilAlbedo and the location where -! ground albedo is calculated -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: plandunit(:) ! index into landunit level quantities - integer , pointer :: itypelun(:) ! landunit type - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: cgridcell(:) ! gridcell of corresponding column - real(r8), pointer :: pwtgcell(:) ! weight of pft wrt corresponding gridcell - real(r8), pointer :: lat(:) ! gridcell latitude (radians) - real(r8), pointer :: lon(:) ! gridcell longitude (radians) - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: rhol(:,:) ! leaf reflectance: 1=vis, 2=nir - real(r8), pointer :: rhos(:,:) ! stem reflectance: 1=vis, 2=nir - real(r8), pointer :: taul(:,:) ! leaf transmittance: 1=vis, 2=nir - real(r8), pointer :: taus(:,:) ! stem transmittance: 1=vis, 2=nir - integer , pointer :: ivt(:) ! pft vegetation type -! -! local pointers toimplicit out arguments -! - real(r8), pointer :: coszen(:) ! cosine of solar zenith angle - real(r8), pointer :: fsun(:) ! sunlit fraction of canopy - real(r8), pointer :: albgrd(:,:) ! ground albedo (direct) - real(r8), pointer :: albgri(:,:) ! ground albedo (diffuse) - real(r8), pointer :: albd(:,:) ! surface albedo (direct) - real(r8), pointer :: albi(:,:) ! surface albedo (diffuse) - real(r8), pointer :: fabd(:,:) ! flux absorbed by veg per unit direct flux - real(r8), pointer :: fabi(:,:) ! flux absorbed by veg per unit diffuse flux - real(r8), pointer :: ftdd(:,:) ! down direct flux below veg per unit dir flx - real(r8), pointer :: ftid(:,:) ! down diffuse flux below veg per unit dir flx - real(r8), pointer :: ftii(:,:) ! down diffuse flux below veg per unit dif flx - real(r8), pointer :: decl(:) ! solar declination angle (radians) - real(r8), pointer :: gdir(:) ! leaf projection in solar direction (0 to 1) - real(r8), pointer :: omega(:,:) ! fraction of intercepted radiation that is scattered (0 to 1) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water content (col,lyr) [kg/m2] - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens content (col,lyr) [kg/m2] - real(r8), pointer :: mss_cnc_bcphi(:,:) ! mass concentration of hydrophilic BC (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_bcpho(:,:) ! mass concentration of hydrophobic BC (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocphi(:,:) ! mass concentration of hydrophilic OC (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocpho(:,:) ! mass concentration of hydrophobic OC (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst1(:,:) ! mass concentration of dust aerosol species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst2(:,:) ! mass concentration of dust aerosol species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst3(:,:) ! mass concentration of dust aerosol species 3 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst4(:,:) ! mass concentration of dust aerosol species 4 (col,lyr) [kg/kg] - real(r8), pointer :: albsod(:,:) ! direct-beam soil albedo (col,bnd) [frc] - real(r8), pointer :: albsoi(:,:) ! diffuse soil albedo (col,bnd) [frc] - real(r8), pointer :: flx_absdv(:,:) ! direct flux absorption factor (col,lyr): VIS [frc] - real(r8), pointer :: flx_absdn(:,:) ! direct flux absorption factor (col,lyr): NIR [frc] - real(r8), pointer :: flx_absiv(:,:) ! diffuse flux absorption factor (col,lyr): VIS [frc] - real(r8), pointer :: flx_absin(:,:) ! diffuse flux absorption factor (col,lyr): NIR [frc] - real(r8), pointer :: snw_rds(:,:) ! snow grain radius (col,lyr) [microns] - real(r8), pointer :: albgrd_pur(:,:) ! pure snow ground albedo (direct) - real(r8), pointer :: albgri_pur(:,:) ! pure snow ground albedo (diffuse) - real(r8), pointer :: albgrd_bc(:,:) ! ground albedo without BC (direct) - real(r8), pointer :: albgri_bc(:,:) ! ground albedo without BC (diffuse) - real(r8), pointer :: albgrd_oc(:,:) ! ground albedo without OC (direct) - real(r8), pointer :: albgri_oc(:,:) ! ground albedo without OC (diffuse) - real(r8), pointer :: albgrd_dst(:,:) ! ground albedo without dust (direct) - real(r8), pointer :: albgri_dst(:,:) ! ground albedo without dust (diffuse) - real(r8), pointer :: albsnd_hst(:,:) ! snow albedo, direct, for history files (col,bnd) [frc] - real(r8), pointer :: albsni_hst(:,:) ! snow ground albedo, diffuse, for history files (col,bnd) [frc] -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - integer :: fp,fc,g,c,p ! indices - integer :: ib ! band index - integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - real(r8) :: wl(lbp:ubp) ! fraction of LAI+SAI that is LAI - real(r8) :: ws(lbp:ubp) ! fraction of LAI+SAI that is SAI - real(r8) :: vai(lbp:ubp) ! elai+esai - real(r8) :: rho(lbp:ubp,numrad) ! leaf/stem refl weighted by fraction LAI and SAI - real(r8) :: tau(lbp:ubp,numrad) ! leaf/stem tran weighted by fraction LAI and SAI - real(r8) :: ftdi(lbp:ubp,numrad) ! down direct flux below veg per unit dif flux = 0 - real(r8) :: albsnd(lbc:ubc,numrad) ! snow albedo (direct) - real(r8) :: albsni(lbc:ubc,numrad) ! snow albedo (diffuse) - real(r8) :: ext(lbp:ubp) ! optical depth direct beam per unit LAI+SAI - real(r8) :: coszen_gcell(lbg:ubg) ! cosine solar zenith angle for next time step (gridcell level) - real(r8) :: coszen_col(lbc:ubc) ! cosine solar zenith angle for next time step (pft level) - real(r8) :: coszen_pft(lbp:ubp) ! cosine solar zenith angle for next time step (pft level) - integer :: num_vegsol ! number of vegetated pfts where coszen>0 - integer :: filter_vegsol(ubp-lbp+1) ! pft filter where vegetated and coszen>0 - integer :: num_novegsol ! number of vegetated pfts where coszen>0 - integer :: filter_novegsol(ubp-lbp+1) ! pft filter where vegetated and coszen>0 - integer, parameter :: nband =numrad ! number of solar radiation waveband classes - integer :: flg_slr ! flag for SNICAR (=1 if direct, =2 if diffuse) - integer :: flg_snw_ice ! flag for SNICAR (=1 when called from CLM, =2 when called from sea-ice) - real(r8) :: albsnd_pur(lbc:ubc,numrad) ! direct pure snow albedo (radiative forcing) - real(r8) :: albsni_pur(lbc:ubc,numrad) ! diffuse pure snow albedo (radiative forcing) - real(r8) :: albsnd_bc(lbc:ubc,numrad) ! direct snow albedo without BC (radiative forcing) - real(r8) :: albsni_bc(lbc:ubc,numrad) ! diffuse snow albedo without BC (radiative forcing) - real(r8) :: albsnd_oc(lbc:ubc,numrad) ! direct snow albedo without OC (radiative forcing) - real(r8) :: albsni_oc(lbc:ubc,numrad) ! diffuse snow albedo without OC (radiative forcing) - real(r8) :: albsnd_dst(lbc:ubc,numrad) ! direct snow albedo without dust (radiative forcing) - real(r8) :: albsni_dst(lbc:ubc,numrad) ! diffuse snow albedo without dust (radiative forcing) - integer :: i ! index for layers [idx] - real(r8) :: flx_absd_snw(lbc:ubc,-nlevsno+1:1,numrad) ! flux absorption factor for just snow (direct) [frc] - real(r8) :: flx_absi_snw(lbc:ubc,-nlevsno+1:1,numrad) ! flux absorption factor for just snow (diffuse) [frc] - real(r8) :: foo_snw(lbc:ubc,-nlevsno+1:1,numrad) ! dummy array for forcing calls - real(r8) :: albsfc(lbc:ubc,numrad) ! albedo of surface underneath snow (col,bnd) - real(r8) :: h2osno_liq(lbc:ubc,-nlevsno+1:0) ! liquid snow content (col,lyr) [kg m-2] - real(r8) :: h2osno_ice(lbc:ubc,-nlevsno+1:0) ! ice content in snow (col,lyr) [kg m-2] - integer :: snw_rds_in(lbc:ubc,-nlevsno+1:0) ! snow grain size sent to SNICAR (col,lyr) [microns] - real(r8) :: mss_cnc_aer_in_frc_pur(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for forcing calculation (zero) (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_bc(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for BC forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_oc(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for OC forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_frc_dst(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of aerosol species for dust forcing (col,lyr,aer) [kg kg-1] - real(r8) :: mss_cnc_aer_in_fdb(lbc:ubc,-nlevsno+1:0,sno_nbr_aer) ! mass concentration of all aerosol species for feedback calculation (col,lyr,aer) [kg kg-1] - !----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (gridcell-level) - - lat => grc%lat - lon => grc%lon - - ! Assign local pointers to derived subtypes components (landunit level) - - itypelun => lun%itype - - ! Assign local pointers to derived subtypes components (column-level) - - cgridcell => col%gridcell - h2osno => cws%h2osno - albgrd => cps%albgrd - albgri => cps%albgri - decl => cps%decl - coszen => cps%coszen - albsod => cps%albsod - albsoi => cps%albsoi - frac_sno => cps%frac_sno - flx_absdv => cps%flx_absdv - flx_absdn => cps%flx_absdn - flx_absiv => cps%flx_absiv - flx_absin => cps%flx_absin - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - snw_rds => cps%snw_rds - albgrd_pur => cps%albgrd_pur - albgri_pur => cps%albgri_pur - albgrd_bc => cps%albgrd_bc - albgri_bc => cps%albgri_bc - albgrd_oc => cps%albgrd_oc - albgri_oc => cps%albgri_oc - albgrd_dst => cps%albgrd_dst - albgri_dst => cps%albgri_dst - mss_cnc_bcphi => cps%mss_cnc_bcphi - mss_cnc_bcpho => cps%mss_cnc_bcpho - mss_cnc_ocphi => cps%mss_cnc_ocphi - mss_cnc_ocpho => cps%mss_cnc_ocpho - mss_cnc_dst1 => cps%mss_cnc_dst1 - mss_cnc_dst2 => cps%mss_cnc_dst2 - mss_cnc_dst3 => cps%mss_cnc_dst3 - mss_cnc_dst4 => cps%mss_cnc_dst4 - albsnd_hst => cps%albsnd_hst - albsni_hst => cps%albsni_hst - - ! Assign local pointers to derived subtypes components (pft-level) - - plandunit => pft%landunit - pgridcell => pft%gridcell - pcolumn => pft%column - pwtgcell => pft%wtgcell - albd => pps%albd - albi => pps%albi - fabd => pps%fabd - fabi => pps%fabi - ftdd => pps%ftdd - ftid => pps%ftid - ftii => pps%ftii - fsun => pps%fsun - elai => pps%elai - esai => pps%esai - gdir => pps%gdir - omega => pps%omega - ivt => pft%itype - rhol => pftcon%rhol - rhos => pftcon%rhos - taul => pftcon%taul - taus => pftcon%taus - - - ! Cosine solar zenith angle for next time step - - do g = lbg, ubg - coszen_gcell(g) = shr_orb_cosz (nextsw_cday, lat(g), lon(g), declinp1) - end do - - ! Save coszen and declination values to clm3 data structures for - ! use in other places in the CN and urban code - - do c = lbc,ubc - g = cgridcell(c) - coszen_col(c) = coszen_gcell(g) - coszen(c) = coszen_col(c) - decl(c) = declinp1 - end do - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) -! if (pwtgcell(p)>0._r8) then ! "if" added due to chg in filter definition - g = pgridcell(p) - coszen_pft(p) = coszen_gcell(g) -! end if ! then removed for CNDV (and dyn. landuse?) cases to work - end do - - ! Initialize output because solar radiation only done if coszen > 0 - - do ib = 1, numrad - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - albgrd(c,ib) = 0._r8 - albgri(c,ib) = 0._r8 - albgrd_pur(c,ib) = 0._r8 - albgri_pur(c,ib) = 0._r8 - albgrd_bc(c,ib) = 0._r8 - albgri_bc(c,ib) = 0._r8 - albgrd_oc(c,ib) = 0._r8 - albgri_oc(c,ib) = 0._r8 - albgrd_dst(c,ib) = 0._r8 - albgri_dst(c,ib) = 0._r8 - do i=-nlevsno+1,1,1 - flx_absdv(c,i) = 0._r8 - flx_absdn(c,i) = 0._r8 - flx_absiv(c,i) = 0._r8 - flx_absin(c,i) = 0._r8 - enddo - end do - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) -! if (pwtgcell(p)>0._r8) then ! "if" added due to chg in filter definition - albd(p,ib) = 1._r8 - albi(p,ib) = 1._r8 - fabd(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - ftdd(p,ib) = 0._r8 - ftid(p,ib) = 0._r8 - ftii(p,ib) = 0._r8 - omega(p,ib)= 0._r8 - if (ib==1) then - gdir(p) = 0._r8 - end if -! end if ! then removed for CNDV (and dyn. landuse?) cases to work - end do - end do - - ! SoilAlbedo called before SNICAR_RT - ! so that reflectance of soil beneath snow column is known - ! ahead of time for snow RT calculation. - - ! Snow albedos - ! Note that snow albedo routine will only compute nonzero snow albedos - ! where h2osno> 0 and coszen > 0 - - ! Ground surface albedos - ! Note that ground albedo routine will only compute nonzero snow albedos - ! where coszen > 0 - - call SoilAlbedo(lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, albsnd, albsni) - - ! set variables to pass to SNICAR. - - flg_snw_ice = 1 ! calling from CLM, not CSIM - do c=lbc,ubc - albsfc(c,:) = albsoi(c,:) - h2osno_liq(c,:) = h2osoi_liq(c,-nlevsno+1:0) - h2osno_ice(c,:) = h2osoi_ice(c,-nlevsno+1:0) - snw_rds_in(c,:) = nint(snw_rds(c,:)) - - ! zero aerosol input arrays - mss_cnc_aer_in_frc_pur(c,:,:) = 0._r8 - mss_cnc_aer_in_frc_bc(c,:,:) = 0._r8 - mss_cnc_aer_in_frc_oc(c,:,:) = 0._r8 - mss_cnc_aer_in_frc_dst(c,:,:) = 0._r8 - mss_cnc_aer_in_fdb(c,:,:) = 0._r8 - end do - - ! Set aerosol input arrays - ! feedback input arrays have been zeroed - ! set soot and dust aerosol concentrations: - if (DO_SNO_AER) then - mss_cnc_aer_in_fdb(lbc:ubc,:,1) = mss_cnc_bcphi(lbc:ubc,:) - mss_cnc_aer_in_fdb(lbc:ubc,:,2) = mss_cnc_bcpho(lbc:ubc,:) - - ! DO_SNO_OC is set in SNICAR_varpar. Default case is to ignore OC concentrations because: - ! 1) Knowledge of their optical properties is primitive - ! 2) When 'water-soluble' OPAC optical properties are applied to OC in snow, - ! it has a negligible darkening effect. - if (DO_SNO_OC) then - mss_cnc_aer_in_fdb(lbc:ubc,:,3) = mss_cnc_ocphi(lbc:ubc,:) - mss_cnc_aer_in_fdb(lbc:ubc,:,4) = mss_cnc_ocpho(lbc:ubc,:) - endif - - mss_cnc_aer_in_fdb(lbc:ubc,:,5) = mss_cnc_dst1(lbc:ubc,:) - mss_cnc_aer_in_fdb(lbc:ubc,:,6) = mss_cnc_dst2(lbc:ubc,:) - mss_cnc_aer_in_fdb(lbc:ubc,:,7) = mss_cnc_dst3(lbc:ubc,:) - mss_cnc_aer_in_fdb(lbc:ubc,:,8) = mss_cnc_dst4(lbc:ubc,:) - endif - - -! If radiative forcing is being calculated, first estimate clean-snow albedo - - if (use_snicar_frc) then - - ! 1. BC input array: - ! set dust and (optionally) OC concentrations, so BC_FRC=[(BC+OC+dust)-(OC+dust)] - mss_cnc_aer_in_frc_bc(lbc:ubc,:,5) = mss_cnc_dst1(lbc:ubc,:) - mss_cnc_aer_in_frc_bc(lbc:ubc,:,6) = mss_cnc_dst2(lbc:ubc,:) - mss_cnc_aer_in_frc_bc(lbc:ubc,:,7) = mss_cnc_dst3(lbc:ubc,:) - mss_cnc_aer_in_frc_bc(lbc:ubc,:,8) = mss_cnc_dst4(lbc:ubc,:) - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_bc(lbc:ubc,:,3) = mss_cnc_ocphi(lbc:ubc,:) - mss_cnc_aer_in_frc_bc(lbc:ubc,:,4) = mss_cnc_ocpho(lbc:ubc,:) - endif - - ! BC FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_bc, albsfc, albsnd_bc, foo_snw) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_bc, albsfc, albsni_bc, foo_snw) - - - ! 2. OC input array: - ! set BC and dust concentrations, so OC_FRC=[(BC+OC+dust)-(BC+dust)] - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_oc(lbc:ubc,:,1) = mss_cnc_bcphi(lbc:ubc,:) - mss_cnc_aer_in_frc_oc(lbc:ubc,:,2) = mss_cnc_bcpho(lbc:ubc,:) - mss_cnc_aer_in_frc_oc(lbc:ubc,:,5) = mss_cnc_dst1(lbc:ubc,:) - mss_cnc_aer_in_frc_oc(lbc:ubc,:,6) = mss_cnc_dst2(lbc:ubc,:) - mss_cnc_aer_in_frc_oc(lbc:ubc,:,7) = mss_cnc_dst3(lbc:ubc,:) - mss_cnc_aer_in_frc_oc(lbc:ubc,:,8) = mss_cnc_dst4(lbc:ubc,:) - - ! OC FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_oc, albsfc, albsnd_oc, foo_snw) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_oc, albsfc, albsni_oc, foo_snw) - endif - - ! 3. DUST input array: - ! set BC and OC concentrations, so DST_FRC=[(BC+OC+dust)-(BC+OC)] - mss_cnc_aer_in_frc_dst(lbc:ubc,:,1) = mss_cnc_bcphi(lbc:ubc,:) - mss_cnc_aer_in_frc_dst(lbc:ubc,:,2) = mss_cnc_bcpho(lbc:ubc,:) - if (DO_SNO_OC) then - mss_cnc_aer_in_frc_dst(lbc:ubc,:,3) = mss_cnc_ocphi(lbc:ubc,:) - mss_cnc_aer_in_frc_dst(lbc:ubc,:,4) = mss_cnc_ocpho(lbc:ubc,:) - endif - - ! DUST FORCING CALCULATIONS - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_dst, albsfc, albsnd_dst, foo_snw) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_dst, albsfc, albsni_dst, foo_snw) - - - ! 4. ALL AEROSOL FORCING CALCULATION - ! (pure snow albedo) - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_pur, albsfc, albsnd_pur, foo_snw) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_frc_pur, albsfc, albsni_pur, foo_snw) - - end if - - ! CLIMATE FEEDBACK CALCULATIONS, ALL AEROSOLS: - flg_slr = 1; ! direct-beam - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_fdb, albsfc, albsnd, flx_absd_snw) - - flg_slr = 2; ! diffuse - call SNICAR_RT(flg_snw_ice, lbc, ubc, num_nourbanc, filter_nourbanc, & - coszen_col, flg_slr, h2osno_liq, h2osno_ice, snw_rds_in, & - mss_cnc_aer_in_fdb, albsfc, albsni, flx_absi_snw) - - ! ground albedos and snow-fraction weighting of snow absorption factors - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if (coszen(c) > 0._r8) then - ! ground albedo was originally computed in SoilAlbedo, but is now computed here - ! because the order of SoilAlbedo and SNICAR_RT was switched for SNICAR. - albgrd(c,ib) = albsod(c,ib)*(1._r8-frac_sno(c)) + albsnd(c,ib)*frac_sno(c) - albgri(c,ib) = albsoi(c,ib)*(1._r8-frac_sno(c)) + albsni(c,ib)*frac_sno(c) - - ! albedos for radiative forcing calculations: - if (use_snicar_frc) then - - ! BC forcing albedo - albgrd_bc(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_bc(c,ib)*frac_sno(c) - albgri_bc(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_bc(c,ib)*frac_sno(c) - - if (DO_SNO_OC) then - ! OC forcing albedo - albgrd_oc(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_oc(c,ib)*frac_sno(c) - albgri_oc(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_oc(c,ib)*frac_sno(c) - endif - - ! dust forcing albedo - albgrd_dst(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_dst(c,ib)*frac_sno(c) - albgri_dst(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_dst(c,ib)*frac_sno(c) - - ! pure snow albedo for all-aerosol radiative forcing - albgrd_pur(c,ib) = albsod(c,ib)*(1.-frac_sno(c)) + albsnd_pur(c,ib)*frac_sno(c) - albgri_pur(c,ib) = albsoi(c,ib)*(1.-frac_sno(c)) + albsni_pur(c,ib)*frac_sno(c) - - end if - - ! also in this loop (but optionally in a different loop for vectorized code) - ! weight snow layer radiative absorption factors based on snow fraction and soil albedo - ! (NEEDED FOR ENERGY CONSERVATION) - do i = -nlevsno+1,1,1 - if (ib == 1) then - flx_absdv(c,i) = flx_absd_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsod(c,ib))*(flx_absd_snw(c,i,ib)/(1.-albsnd(c,ib)))) - flx_absiv(c,i) = flx_absi_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsoi(c,ib))*(flx_absi_snw(c,i,ib)/(1.-albsni(c,ib)))) - elseif (ib == 2) then - flx_absdn(c,i) = flx_absd_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsod(c,ib))*(flx_absd_snw(c,i,ib)/(1.-albsnd(c,ib)))) - flx_absin(c,i) = flx_absi_snw(c,i,ib)*frac_sno(c) + & - ((1.-frac_sno(c))*(1-albsoi(c,ib))*(flx_absi_snw(c,i,ib)/(1.-albsni(c,ib)))) - endif - enddo - endif - enddo - enddo - - ! for diagnostics, set snow albedo to spval over non-snow points - ! so that it is not averaged in history buffer - ! (OPTIONAL) - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if ((coszen(c) > 0._r8) .and. (h2osno(c) > 0._r8)) then - albsnd_hst(c,ib) = albsnd(c,ib) - albsni_hst(c,ib) = albsni(c,ib) - else - albsnd_hst(c,ib) = 0._r8 - albsni_hst(c,ib) = 0._r8 - endif - enddo - enddo - - ! Create solar-vegetated filter for the following calculations - - num_vegsol = 0 - num_novegsol = 0 - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - if (coszen_pft(p) > 0._r8) then - if ((itypelun(plandunit(p)) == istsoil .or. & - itypelun(plandunit(p)) == istcrop ) & - .and. (elai(p) + esai(p)) > 0._r8 & - .and. pwtgcell(p) > 0._r8) then - num_vegsol = num_vegsol + 1 - filter_vegsol(num_vegsol) = p - else - num_novegsol = num_novegsol + 1 - filter_novegsol(num_novegsol) = p - end if - end if - end do - - ! Weight reflectance/transmittance by lai and sai - ! Only perform on vegetated pfts where coszen > 0 - - do fp = 1,num_vegsol - p = filter_vegsol(fp) - vai(p) = elai(p) + esai(p) - wl(p) = elai(p) / max( vai(p), mpe ) - ws(p) = esai(p) / max( vai(p), mpe ) - end do - - do ib = 1, numrad - do fp = 1,num_vegsol - p = filter_vegsol(fp) - rho(p,ib) = max( rhol(ivt(p),ib)*wl(p) + rhos(ivt(p),ib)*ws(p), mpe ) - tau(p,ib) = max( taul(ivt(p),ib)*wl(p) + taus(ivt(p),ib)*ws(p), mpe ) - end do - end do - - ! Calculate surface albedos and fluxes - ! Only perform on vegetated pfts where coszen > 0 - - call TwoStream (lbc, ubc, lbp, ubp, filter_vegsol, num_vegsol, & - coszen_pft, vai, rho, tau) - - ! Determine values for non-vegetated pfts where coszen > 0 - - do ib = 1,numrad - do fp = 1,num_novegsol - p = filter_novegsol(fp) - c = pcolumn(p) - fabd(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - ftdd(p,ib) = 1._r8 - ftid(p,ib) = 0._r8 - ftii(p,ib) = 1._r8 - albd(p,ib) = albgrd(c,ib) - albi(p,ib) = albgri(c,ib) - gdir(p) = 0._r8 - end do - end do - - end subroutine SurfaceAlbedo - - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: SoilAlbedo -! -! !INTERFACE: - subroutine SoilAlbedo (lbc, ubc, num_nourbanc, filter_nourbanc, coszen, albsnd, albsni) -! -! !DESCRIPTION: -! Determine ground surface albedo, accounting for snow -! -! !USES: - use clmtype - use clm_varpar, only : numrad - use clm_varcon, only : albsat, albdry, alblak, tfrz, istice, istice_mec -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: num_nourbanc ! number of columns in non-urban points in column filter - integer , intent(in) :: filter_nourbanc(ubc-lbc+1) ! column filter for non-urban points - real(r8), intent(in) :: coszen(lbc:ubc) ! cos solar zenith angle next time step (column-level) - real(r8), intent(in) :: albsnd(lbc:ubc,numrad) ! snow albedo (direct) - real(r8), intent(in) :: albsni(lbc:ubc,numrad) ! snow albedo (diffuse) -! -! !CALLED FROM: -! subroutine SurfaceAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 2/5/02, Peter Thornton: Migrated to new data structures. -! 8/20/03, Mariana Vertenstein: Vectorized routine -! 03/28/08, Mark Flanner: changes for SNICAR -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: isoicol(:) ! soil color class - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water [m3/m3] -! -! local pointers to original implicit out arguments -! - real(r8), pointer:: albgrd(:,:) ! ground albedo (direct) - real(r8), pointer:: albgri(:,:) ! ground albedo (diffuse) - ! albsod and albsoi are now clm_type variables so they can be used by SNICAR. - real(r8), pointer :: albsod(:,:) ! soil albedo (direct) - real(r8), pointer :: albsoi(:,:) ! soil albedo (diffuse) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer, parameter :: nband =numrad ! number of solar radiation waveband classes - integer :: fc ! non-urban filter column index - integer :: c,l ! indices - integer :: ib ! waveband number (1=vis, 2=nir) - real(r8) :: inc ! soil water correction factor for soil albedo - ! albsod and albsoi are now clm_type variables so they can be used by SNICAR. - !real(r8) :: albsod ! soil albedo (direct) - !real(r8) :: albsoi ! soil albedo (diffuse) - integer :: soilcol ! soilcolor -!----------------------------------------------------------------------- -!dir$ inlinenever SoilAlbedo - - ! Assign local pointers to derived subtypes components (column-level) - - clandunit => col%landunit - isoicol => cps%isoicol - t_grnd => ces%t_grnd - frac_sno => cps%frac_sno - h2osoi_vol => cws%h2osoi_vol - albgrd => cps%albgrd - albgri => cps%albgri - albsod => cps%albsod - albsoi => cps%albsoi - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - - ! Compute soil albedos - - do ib = 1, nband - do fc = 1,num_nourbanc - c = filter_nourbanc(fc) - if (coszen(c) > 0._r8) then - l = clandunit(c) - - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then ! soil - inc = max(0.11_r8-0.40_r8*h2osoi_vol(c,1), 0._r8) - soilcol = isoicol(c) - ! changed from local variable to clm_type: - !albsod = min(albsat(soilcol,ib)+inc, albdry(soilcol,ib)) - !albsoi = albsod - albsod(c,ib) = min(albsat(soilcol,ib)+inc, albdry(soilcol,ib)) - albsoi(c,ib) = albsod(c,ib) - else if (ltype(l) == istice .or. ltype(l) == istice_mec) then ! land ice - ! changed from local variable to clm_type: - !albsod = albice(ib) - !albsoi = albsod - albsod(c,ib) = albice(ib) - albsoi(c,ib) = albsod(c,ib) - else if (t_grnd(c) > tfrz) then ! unfrozen lake, wetland - ! changed from local variable to clm_type: - !albsod = 0.05_r8/(max(0.001_r8,coszen(c)) + 0.15_r8) - !albsoi = albsod - albsod(c,ib) = 0.05_r8/(max(0.001_r8,coszen(c)) + 0.15_r8) - albsoi(c,ib) = albsod(c,ib) - else ! frozen lake, wetland - ! changed from local variable to clm_type: - !albsod = alblak(ib) - !albsoi = albsod - albsod(c,ib) = alblak(ib) - albsoi(c,ib) = albsod(c,ib) - end if - - ! Weighting is done in SurfaceAlbedo, after the call to SNICAR_RT - ! This had to be done, because SoilAlbedo is called before SNICAR_RT, so at - ! this point, snow albedo is not yet known. - end if - end do - end do - - end subroutine SoilAlbedo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: TwoStream -! -! !INTERFACE: - subroutine TwoStream (lbc, ubc, lbp, ubp, filter_vegsol, num_vegsol, & - coszen, vai, rho, tau) -! -! !DESCRIPTION: -! Two-stream fluxes for canopy radiative transfer -! Use two-stream approximation of Dickinson (1983) Adv Geophysics -! 25:305-353 and Sellers (1985) Int J Remote Sensing 6:1335-1372 -! to calculate fluxes absorbed by vegetation, reflected by vegetation, -! and transmitted through vegetation for unit incoming direct or diffuse -! flux given an underlying surface with known albedo. -! -! !USES: - use clmtype - use clm_varpar, only : numrad - use clm_varcon, only : omegas, tfrz, betads, betais -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! column bounds - integer , intent(in) :: lbp, ubp ! pft bounds - integer , intent(in) :: filter_vegsol(ubp-lbp+1) ! filter for vegetated pfts with coszen>0 - integer , intent(in) :: num_vegsol ! number of vegetated pfts where coszen>0 - real(r8), intent(in) :: coszen(lbp:ubp) ! cosine solar zenith angle for next time step - real(r8), intent(in) :: vai(lbp:ubp) ! elai+esai - real(r8), intent(in) :: rho(lbp:ubp,numrad) ! leaf/stem refl weighted by fraction LAI and SAI - real(r8), intent(in) :: tau(lbp:ubp,numrad) ! leaf/stem tran weighted by fraction LAI and SAI -! -! !CALLED FROM: -! subroutine SurfaceAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! Modified for speedup: Mariana Vertenstein, 8/26/02 -! Vectorized routine: Mariana Vertenstein: 8/20/03 -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars -! - integer , pointer :: pcolumn(:) ! column of corresponding pft - real(r8), pointer :: albgrd(:,:) ! ground albedo (direct) (column-level) - real(r8), pointer :: albgri(:,:) ! ground albedo (diffuse)(column-level) - real(r8), pointer :: t_veg(:) ! vegetation temperature (Kelvin) - real(r8), pointer :: fwet(:) ! fraction of canopy that is wet (0 to 1) - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: xl(:) ! ecophys const - leaf/stem orientation index -! -! local pointers to implicit out scalars -! - real(r8), pointer :: albd(:,:) ! surface albedo (direct) - real(r8), pointer :: albi(:,:) ! surface albedo (diffuse) - real(r8), pointer :: fabd(:,:) ! flux absorbed by veg per unit direct flux - real(r8), pointer :: fabi(:,:) ! flux absorbed by veg per unit diffuse flux - real(r8), pointer :: ftdd(:,:) ! down direct flux below veg per unit dir flx - real(r8), pointer :: ftid(:,:) ! down diffuse flux below veg per unit dir flx - real(r8), pointer :: ftii(:,:) ! down diffuse flux below veg per unit dif flx - real(r8), pointer :: gdir(:) ! leaf projection in solar direction (0 to 1) - real(r8), pointer :: omega(:,:) ! fraction of intercepted radiation that is scattered (0 to 1) -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: fp,p,c ! array indices - !integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - integer :: ib ! waveband number - real(r8) :: cosz ! 0.001 <= coszen <= 1.000 - real(r8) :: asu ! single scattering albedo - real(r8) :: chil(lbp:ubp) ! -0.4 <= xl <= 0.6 - real(r8) :: twostext(lbp:ubp)! optical depth of direct beam per unit leaf area - real(r8) :: avmu(lbp:ubp) ! average diffuse optical depth - real(r8) :: omegal ! omega for leaves - real(r8) :: betai ! upscatter parameter for diffuse radiation - real(r8) :: betail ! betai for leaves - real(r8) :: betad ! upscatter parameter for direct beam radiation - real(r8) :: betadl ! betad for leaves - real(r8) :: tmp0,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8,tmp9 ! temporary - real(r8) :: p1,p2,p3,p4,s1,s2,u1,u2,u3 ! temporary - real(r8) :: b,c1,d,d1,d2,f,h,h1,h2,h3,h4,h5,h6,h7,h8,h9,h10 ! temporary - real(r8) :: phi1,phi2,sigma ! temporary - real(r8) :: temp0(lbp:ubp),temp1,temp2(lbp:ubp) ! temporary - real(r8) :: t1 -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (column-level) - - albgrd => cps%albgrd - albgri => cps%albgri - - ! Assign local pointers to derived subtypes components (pft-level) - - pcolumn => pft%column - fwet => pps%fwet - t_veg => pes%t_veg - ivt => pft%itype - albd => pps%albd - albi => pps%albi - fabd => pps%fabd - fabi => pps%fabi - ftdd => pps%ftdd - ftid => pps%ftid - ftii => pps%ftii - gdir => pps%gdir - omega => pps%omega - xl => pftcon%xl - - ! Calculate two-stream parameters omega, betad, betai, avmu, gdir, twostext. - ! Omega, betad, betai are adjusted for snow. Values for omega*betad - ! and omega*betai are calculated and then divided by the new omega - ! because the product omega*betai, omega*betad is used in solution. - ! Also, the transmittances and reflectances (tau, rho) are linear - ! weights of leaf and stem values. - - do fp = 1,num_vegsol - p = filter_vegsol(fp) - - ! note that the following limit only acts on cosz values > 0 and less than - ! 0.001, not on values cosz = 0, since these zero have already been filtered - ! out in filter_vegsol - cosz = max(0.001_r8, coszen(p)) - - chil(p) = min( max(xl(ivt(p)), -0.4_r8), 0.6_r8 ) - if (abs(chil(p)) <= 0.01_r8) chil(p) = 0.01_r8 - phi1 = 0.5_r8 - 0.633_r8*chil(p) - 0.330_r8*chil(p)*chil(p) - phi2 = 0.877_r8 * (1._r8-2._r8*phi1) - gdir(p) = phi1 + phi2*cosz - twostext(p) = gdir(p)/cosz - avmu(p) = ( 1._r8 - phi1/phi2 * log((phi1+phi2)/phi1) ) / phi2 - temp0(p) = gdir(p) + phi2*cosz - temp1 = phi1*cosz - temp2(p) = ( 1._r8 - temp1/temp0(p) * log((temp1+temp0(p))/temp1) ) - end do - - do ib = 1, numrad - do fp = 1,num_vegsol - p = filter_vegsol(fp) - c = pcolumn(p) - - omegal = rho(p,ib) + tau(p,ib) - asu = 0.5_r8*omegal*gdir(p)/temp0(p) *temp2(p) - betadl = (1._r8+avmu(p)*twostext(p))/(omegal*avmu(p)*twostext(p))*asu - betail = 0.5_r8 * ((rho(p,ib)+tau(p,ib)) + (rho(p,ib)-tau(p,ib)) & - * ((1._r8+chil(p))/2._r8)**2) / omegal - - ! Adjust omega, betad, and betai for intercepted snow - - if (t_veg(p) > tfrz) then !no snow - tmp0 = omegal - tmp1 = betadl - tmp2 = betail - else - tmp0 = (1._r8-fwet(p))*omegal + fwet(p)*omegas(ib) - tmp1 = ( (1._r8-fwet(p))*omegal*betadl + fwet(p)*omegas(ib)*betads ) / tmp0 - tmp2 = ( (1._r8-fwet(p))*omegal*betail + fwet(p)*omegas(ib)*betais ) / tmp0 - end if - omega(p,ib) = tmp0 - betad = tmp1 - betai = tmp2 - - ! Absorbed, reflected, transmitted fluxes per unit incoming radiation - - b = 1._r8 - omega(p,ib) + omega(p,ib)*betai - c1 = omega(p,ib)*betai - tmp0 = avmu(p)*twostext(p) - d = tmp0 * omega(p,ib)*betad - f = tmp0 * omega(p,ib)*(1._r8-betad) - tmp1 = b*b - c1*c1 - h = sqrt(tmp1) / avmu(p) - sigma = tmp0*tmp0 - tmp1 - p1 = b + avmu(p)*h - p2 = b - avmu(p)*h - p3 = b + tmp0 - p4 = b - tmp0 - - ! PET, 03/01/04: added this test to avoid floating point errors in exp() - ! EBK, 04/15/08: always do this for all modes -- not just CN - - t1 = min(h*vai(p), 40._r8) - s1 = exp(-t1) - t1 = min(twostext(p)*vai(p), 40._r8) - s2 = exp(-t1) - - ! Determine fluxes for vegetated pft for unit incoming direct - ! Loop over incoming direct and incoming diffuse - ! 0=unit incoming direct; 1=unit incoming diffuse - - ! ic = 0 unit incoming direct flux - ! ======================================== - - u1 = b - c1/albgrd(c,ib) - u2 = b - c1*albgrd(c,ib) - u3 = f + c1*albgrd(c,ib) - - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h1 = -d*p4 - c1*f - tmp6 = d - h1*p3/sigma - tmp7 = ( d - c1 - h1/sigma*(u1+tmp0) ) * s2 - h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1 - h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1 - h4 = -f*p3 - c1*d - tmp8 = h4/sigma - tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2 - h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2 - h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2 - h7 = (c1*tmp2) / (d1*s1) - h8 = (-c1*tmp3*s1) / d1 - h9 = tmp4 / (d2*s1) - h10 = (-tmp5*s1) / d2 - - ! Downward direct and diffuse fluxes below vegetation (ic = 0) - - ftdd(p,ib) = s2 - ftid(p,ib) = h4*s2/sigma + h5*s1 + h6/s1 - - ! Flux reflected by vegetation (ic = 0) - - albd(p,ib) = h1/sigma + h2 + h3 - - ! Flux absorbed by vegetation (ic = 0) - - fabd(p,ib) = 1._r8 - albd(p,ib) & - - (1._r8-albgrd(c,ib))*ftdd(p,ib) - (1._r8-albgri(c,ib))*ftid(p,ib) - - ! ic = 1 unit incoming diffuse - ! ======================================== - - u1 = b - c1/albgri(c,ib) - u2 = b - c1*albgri(c,ib) - u3 = f + c1*albgri(c,ib) - - tmp2 = u1 - avmu(p)*h - tmp3 = u1 + avmu(p)*h - d1 = p1*tmp2/s1 - p2*tmp3*s1 - tmp4 = u2 + avmu(p)*h - tmp5 = u2 - avmu(p)*h - d2 = tmp4/s1 - tmp5*s1 - h1 = -d*p4 - c1*f - tmp6 = d - h1*p3/sigma - tmp7 = ( d - c1 - h1/sigma*(u1+tmp0) ) * s2 - h2 = ( tmp6*tmp2/s1 - p2*tmp7 ) / d1 - h3 = - ( tmp6*tmp3*s1 - p1*tmp7 ) / d1 - h4 = -f*p3 - c1*d - tmp8 = h4/sigma - tmp9 = ( u3 - tmp8*(u2-tmp0) ) * s2 - h5 = - ( tmp8*tmp4/s1 + tmp9 ) / d2 - h6 = ( tmp8*tmp5*s1 + tmp9 ) / d2 - h7 = (c1*tmp2) / (d1*s1) - h8 = (-c1*tmp3*s1) / d1 - h9 = tmp4 / (d2*s1) - h10 = (-tmp5*s1) / d2 - - ! Downward direct and diffuse fluxes below vegetation - - ftii(p,ib) = h9*s1 + h10/s1 - - ! Flux reflected by vegetation - - albi(p,ib) = h7 + h8 - - ! Flux absorbed by vegetation - - fabi(p,ib) = 1._r8 - albi(p,ib) - (1._r8-albgri(c,ib))*ftii(p,ib) - - end do ! end of pft loop - end do ! end of radiation band loop - - end subroutine TwoStream - -end module SurfaceAlbedoMod diff --git a/src_clm40/biogeophys/SurfaceRadiationMod.F90 b/src_clm40/biogeophys/SurfaceRadiationMod.F90 deleted file mode 100644 index d8e87f78c1..0000000000 --- a/src_clm40/biogeophys/SurfaceRadiationMod.F90 +++ /dev/null @@ -1,801 +0,0 @@ -module SurfaceRadiationMod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: SurfaceRadiationMod -! -! !DESCRIPTION: -! Calculate solar fluxes absorbed by vegetation and ground surface -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varctl , only: iulog - -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: SurfaceRadiation ! Solar fluxes absorbed by veg and ground surface -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 11/26/03, Peter Thornton: Added new routine for improved treatment of -! sunlit/shaded canopy radiation. -! 4/26/05, Peter Thornton: Adopted the sun/shade algorithm as the default, -! removed the old SurfaceRadiation(), and renamed SurfaceRadiationSunShade() -! as SurfaceRadiation(). -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: SurfaceRadiation -! -! !INTERFACE: - subroutine SurfaceRadiation(lbp, ubp, num_nourbanp, filter_nourbanp) -! -! !DESCRIPTION: -! Solar fluxes absorbed by vegetation and ground surface -! Note possible problem when land is on different grid than atmosphere. -! Land may have sun above the horizon (coszen > 0) but atmosphere may -! have sun below the horizon (forc_solad = 0 and forc_solai = 0). This is okay -! because all fluxes (absorbed, reflected, transmitted) are multiplied -! by the incoming flux and all will equal zero. -! Atmosphere may have sun above horizon (forc_solad > 0 and forc_solai > 0) but -! land may have sun below horizon. This is okay because fabd, fabi, -! ftdd, ftid, and ftii all equal zero so that sabv=sabg=fsa=0. Also, -! albd and albi equal one so that fsr=forc_solad+forc_solai. In other words, all -! the radiation is reflected. NDVI should equal zero in this case. -! However, the way the code is currently implemented this is only true -! if (forc_solad+forc_solai)|vis = (forc_solad+forc_solai)|nir. -! Output variables are parsun,parsha,sabv,sabg,fsa,fsr,ndvi -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use clm_varpar , only : numrad - use clm_varcon , only : spval, istsoil, degpsec, isecspday - use clm_varcon , only : istice_mec - use clm_varcon , only : istcrop - use clm_time_manager, only : get_curr_date, get_step_size - use clm_varpar , only : nlevsno - use SNICARMod , only : DO_SNO_OC - use abortutils , only : endrun - use clm_varctl , only : use_snicar_frc -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbp, ubp ! pft upper and lower bounds - integer, intent(in) :: num_nourbanp ! number of pfts in non-urban points in pft filter - integer, intent(in) :: filter_nourbanp(ubp-lbp+1) ! pft filter for non-urban points -! -! !CALLED FROM: -! subroutine Biogeophysics1 in module Biogeophysics1Mod -! subroutine BiogeophysicsLake in module BiogeophysicsLakeMod -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 2/18/02, Peter Thornton: Migrated to new data structures. Added a pft loop. -! 6/05/03, Peter Thornton: Modified sunlit/shaded canopy treatment. Original code -! had all radiation being absorbed in the sunlit canopy, and now the sunlit and shaded -! canopies are each given the appropriate fluxes. There was also an inconsistency in -! the original code, where parsun was not being scaled by leaf area, and so represented -! the entire canopy flux. This goes into Stomata (in CanopyFluxes) where it is assumed -! to be a flux per unit leaf area. In addition, the fpsn flux coming out of Stomata was -! being scaled back up to the canopy by multiplying by lai, but the input radiation flux was -! for the entire canopy to begin with. Corrected this inconsistency in this version, so that -! the parsun and parsha fluxes going into canopy fluxes are per unit lai in the sunlit and -! shaded canopies. -! 6/9/03, Peter Thornton: Moved coszen from gps to c%cps to avoid problem -! with OpenMP threading over columns, where different columns hit the radiation -! time step at different times during execution. -! 6/10/03, Peter Thornton: Added constraint on negative tot_aid, instead of -! exiting with error. Appears to be happening only at roundoff level. -! 6/11/03, Peter Thornton: Moved calculation of ext inside if (coszen), -! and added check on laisun = 0 and laisha = 0 in calculation of sun_aperlai -! and sha_aperlai. -! 11/26/03, Peter Thornton: During migration to new vector code, created -! this as a new routine to handle sunlit/shaded canopy calculations. -! 03/28/08, Mark Flanner: Incorporated SNICAR, including absorbed solar radiation -! in each snow layer and top soil layer, and optional radiative forcing calculation -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: ivt(:) ! pft vegetation type - integer , pointer :: pcolumn(:) ! pft's column index - integer , pointer :: pgridcell(:) ! pft's gridcell index - real(r8), pointer :: pwtgcell(:) ! pft's weight relative to corresponding gridcell - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow - real(r8), pointer :: londeg(:) ! longitude (degrees) - real(r8), pointer :: latdeg(:) ! latitude (degrees) - real(r8), pointer :: slasun(:) ! specific leaf area for sunlit canopy, projected area basis (m^2/gC) - real(r8), pointer :: slasha(:) ! specific leaf area for shaded canopy, projected area basis (m^2/gC) - real(r8), pointer :: gdir(:) ! leaf projection in solar direction (0 to 1) - real(r8), pointer :: omega(:,:) ! fraction of intercepted radiation that is scattered (0 to 1) - real(r8), pointer :: coszen(:) ! cosine of solar zenith angle - real(r8), pointer :: forc_solad(:,:) ! direct beam radiation (W/m**2) - real(r8), pointer :: forc_solai(:,:) ! diffuse radiation (W/m**2) - real(r8), pointer :: fabd(:,:) ! flux absorbed by veg per unit direct flux - real(r8), pointer :: fabi(:,:) ! flux absorbed by veg per unit diffuse flux - real(r8), pointer :: ftdd(:,:) ! down direct flux below veg per unit dir flx - real(r8), pointer :: ftid(:,:) ! down diffuse flux below veg per unit dir flx - real(r8), pointer :: ftii(:,:) ! down diffuse flux below veg per unit dif flx - real(r8), pointer :: albgrd(:,:) ! ground albedo (direct) - real(r8), pointer :: albgri(:,:) ! ground albedo (diffuse) - real(r8), pointer :: albd(:,:) ! surface albedo (direct) - real(r8), pointer :: albi(:,:) ! surface albedo (diffuse) - real(r8), pointer :: slatop(:) ! specific leaf area at top of canopy, projected area basis [m^2/gC] - real(r8), pointer :: dsladlai(:) ! dSLA/dLAI, projected area basis [m^2/gC] -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: fsun(:) ! sunlit fraction of canopy - real(r8), pointer :: laisun(:) ! sunlit leaf area - real(r8), pointer :: laisha(:) ! shaded leaf area - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: sabv(:) ! solar radiation absorbed by vegetation (W/m**2) - real(r8), pointer :: fsa(:) ! solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_r(:) ! rural solar radiation absorbed (total) (W/m**2) - integer , pointer :: ityplun(:) ! landunit type - integer , pointer :: plandunit(:) ! index into landunit level quantities - real(r8), pointer :: parsun(:) ! average absorbed PAR for sunlit leaves (W/m**2) - real(r8), pointer :: parsha(:) ! average absorbed PAR for shaded leaves (W/m**2) - real(r8), pointer :: fsr(:) ! solar radiation reflected (W/m**2) - real(r8), pointer :: fsds_vis_d(:) ! incident direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_d(:) ! incident direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_i(:) ! incident diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_i(:) ! incident diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_d(:) ! reflected direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_d(:) ! reflected direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_i(:) ! reflected diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_i(:) ! reflected diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_d_ln(:) ! incident direct beam vis solar rad at local noon (W/m**2) - real(r8), pointer :: fsds_nir_d_ln(:) ! incident direct beam nir solar rad at local noon (W/m**2) - real(r8), pointer :: fsr_vis_d_ln(:) ! reflected direct beam vis solar rad at local noon (W/m**2) - real(r8), pointer :: fsr_nir_d_ln(:) ! reflected direct beam nir solar rad at local noon (W/m**2) - real(r8), pointer :: eff_kid(:,:) ! effective extinction coefficient for indirect from direct - real(r8), pointer :: eff_kii(:,:) ! effective extinction coefficient for indirect from indirect - real(r8), pointer :: sun_faid(:,:) ! fraction sun canopy absorbed indirect from direct - real(r8), pointer :: sun_faii(:,:) ! fraction sun canopy absorbed indirect from indirect - real(r8), pointer :: sha_faid(:,:) ! fraction shade canopy absorbed indirect from direct - real(r8), pointer :: sha_faii(:,:) ! fraction shade canopy absorbed indirect from indirect - real(r8), pointer :: sun_add(:,:) ! sun canopy absorbed direct from direct (W/m**2) - real(r8), pointer :: tot_aid(:,:) ! total canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sun_aid(:,:) ! sun canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sun_aii(:,:) ! sun canopy absorbed indirect from indirect (W/m**2) - real(r8), pointer :: sha_aid(:,:) ! shade canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sha_aii(:,:) ! shade canopy absorbed indirect from indirect (W/m**2) - real(r8), pointer :: sun_atot(:,:) ! sun canopy total absorbed (W/m**2) - real(r8), pointer :: sha_atot(:,:) ! shade canopy total absorbed (W/m**2) - real(r8), pointer :: sun_alf(:,:) ! sun canopy total absorbed by leaves (W/m**2) - real(r8), pointer :: sha_alf(:,:) ! shade canopy total absored by leaves (W/m**2) - real(r8), pointer :: sun_aperlai(:,:) ! sun canopy total absorbed per unit LAI (W/m**2) - real(r8), pointer :: sha_aperlai(:,:) ! shade canopy total absorbed per unit LAI (W/m**2) - real(r8), pointer :: flx_absdv(:,:) ! direct flux absorption factor (col,lyr): VIS [frc] - real(r8), pointer :: flx_absdn(:,:) ! direct flux absorption factor (col,lyr): NIR [frc] - real(r8), pointer :: flx_absiv(:,:) ! diffuse flux absorption factor (col,lyr): VIS [frc] - real(r8), pointer :: flx_absin(:,:) ! diffuse flux absorption factor (col,lyr): NIR [frc] - integer , pointer :: snl(:) ! negative number of snow layers [nbr] - real(r8), pointer :: albgrd_pur(:,:) ! pure snow ground albedo (direct) - real(r8), pointer :: albgri_pur(:,:) ! pure snow ground albedo (diffuse) - real(r8), pointer :: albgrd_bc(:,:) ! ground albedo without BC (direct) (col,bnd) - real(r8), pointer :: albgri_bc(:,:) ! ground albedo without BC (diffuse) (col,bnd) - real(r8), pointer :: albgrd_oc(:,:) ! ground albedo without OC (direct) (col,bnd) - real(r8), pointer :: albgri_oc(:,:) ! ground albedo without OC (diffuse) (col,bnd) - real(r8), pointer :: albgrd_dst(:,:) ! ground albedo without dust (direct) (col,bnd) - real(r8), pointer :: albgri_dst(:,:) ! ground albedo without dust (diffuse) (col,bnd) - real(r8), pointer :: albsnd_hst(:,:) ! snow albedo, direct, for history files (col,bnd) [frc] - real(r8), pointer :: albsni_hst(:,:) ! snow ground albedo, diffuse, for history files (col,bnd - real(r8), pointer :: sabg_lyr(:,:) ! absorbed radiative flux (pft,lyr) [W/m2] - real(r8), pointer :: sfc_frc_aer(:) ! surface forcing of snow with all aerosols (pft) [W/m2] - real(r8), pointer :: sfc_frc_bc(:) ! surface forcing of snow with BC (pft) [W/m2] - real(r8), pointer :: sfc_frc_oc(:) ! surface forcing of snow with OC (pft) [W/m2] - real(r8), pointer :: sfc_frc_dst(:) ! surface forcing of snow with dust (pft) [W/m2] - real(r8), pointer :: sfc_frc_aer_sno(:) ! surface forcing of snow with all aerosols, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_bc_sno(:) ! surface forcing of snow with BC, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_oc_sno(:) ! surface forcing of snow with OC, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_dst_sno(:) ! surface forcing of snow with dust, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: fsr_sno_vd(:) ! reflected visible, direct radiation from snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsr_sno_nd(:) ! reflected near-IR, direct radiation from snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsr_sno_vi(:) ! reflected visible, diffuse radiation from snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsr_sno_ni(:) ! reflected near-IR, diffuse radiation from snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsds_sno_vd(:) ! incident visible, direct radiation on snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsds_sno_nd(:) ! incident near-IR, direct radiation on snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsds_sno_vi(:) ! incident visible, diffuse radiation on snow (for history files) (pft) [W/m2] - real(r8), pointer :: fsds_sno_ni(:) ! incident near-IR, diffuse radiation on snow (for history files) (pft) [W/m2] - real(r8), pointer :: snowdp(:) ! snow height (m) - -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer , parameter :: nband = numrad ! number of solar radiation waveband classes - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - integer :: fp ! non-urban filter pft index - integer :: p ! pft index - integer :: c ! column index - integer :: l ! landunit index - integer :: g ! grid cell index - integer :: ib ! waveband number (1=vis, 2=nir) - real(r8) :: absrad ! absorbed solar radiation (W/m**2) - real(r8) :: rnir ! reflected solar radiation [nir] (W/m**2) - real(r8) :: rvis ! reflected solar radiation [vis] (W/m**2) - real(r8) :: laifra ! leaf area fraction of canopy - real(r8) :: trd(lbp:ubp,numrad) ! transmitted solar radiation: direct (W/m**2) - real(r8) :: tri(lbp:ubp,numrad) ! transmitted solar radiation: diffuse (W/m**2) - real(r8) :: cad(lbp:ubp,numrad) ! direct beam absorbed by canopy (W/m**2) - real(r8) :: cai(lbp:ubp,numrad) ! diffuse radiation absorbed by canopy (W/m**2) - real(r8) :: vai(lbp:ubp) ! total leaf area index + stem area index, one sided - real(r8) :: ext ! optical depth direct beam per unit LAI+SAI - real(r8) :: t1, t2 ! temporary variables - real(r8) :: cosz - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - integer :: i ! layer index [idx] - real(r8) :: sabg_snl_sum ! temporary, absorbed energy in all active snow layers [W/m2] - real(r8) :: absrad_pur ! temp: absorbed solar radiation by pure snow [W/m2] - real(r8) :: absrad_bc ! temp: absorbed solar radiation without BC [W/m2] - real(r8) :: absrad_oc ! temp: absorbed solar radiation without OC [W/m2] - real(r8) :: absrad_dst ! temp: absorbed solar radiation without dust [W/m2] - real(r8) :: sabg_pur(lbp:ubp) ! solar radiation absorbed by ground with pure snow [W/m2] - real(r8) :: sabg_bc(lbp:ubp) ! solar radiation absorbed by ground without BC [W/m2] - real(r8) :: sabg_oc(lbp:ubp) ! solar radiation absorbed by ground without OC [W/m2] - real(r8) :: sabg_dst(lbp:ubp) ! solar radiation absorbed by ground without dust [W/m2] -!------------------------------------------------------------------------------ - - ! Assign local pointers to multi-level derived type members (gridcell level) - - londeg => grc%londeg - latdeg => grc%latdeg - forc_solad => clm_a2l%forc_solad - forc_solai => clm_a2l%forc_solai - - ! Assign local pointers to multi-level derived type members (landunit level) - - ityplun => lun%itype - - ! Assign local pointers to multi-level derived type members (column level) - - albgrd => cps%albgrd - albgri => cps%albgri - coszen => cps%coszen - - ! Assign local pointers to derived type members (pft-level) - - plandunit => pft%landunit - ivt => pft%itype - pcolumn => pft%column - pgridcell => pft%gridcell - pwtgcell => pft%wtgcell - elai => pps%elai - esai => pps%esai - slasun => pps%slasun - slasha => pps%slasha - gdir => pps%gdir - omega => pps%omega - laisun => pps%laisun - laisha => pps%laisha - fabd => pps%fabd - fabi => pps%fabi - ftdd => pps%ftdd - ftid => pps%ftid - ftii => pps%ftii - albd => pps%albd - albi => pps%albi - fsun => pps%fsun - sabg => pef%sabg - sabv => pef%sabv - snowdp => cps%snowdp - fsa => pef%fsa - fsa_r => pef%fsa_r - fsr => pef%fsr - parsun => pef%parsun - parsha => pef%parsha - fsds_vis_d => pef%fsds_vis_d - fsds_nir_d => pef%fsds_nir_d - fsds_vis_i => pef%fsds_vis_i - fsds_nir_i => pef%fsds_nir_i - fsr_vis_d => pef%fsr_vis_d - fsr_nir_d => pef%fsr_nir_d - fsr_vis_i => pef%fsr_vis_i - fsr_nir_i => pef%fsr_nir_i - fsds_vis_d_ln => pef%fsds_vis_d_ln - fsds_nir_d_ln => pef%fsds_nir_d_ln - fsr_vis_d_ln => pef%fsr_vis_d_ln - fsr_nir_d_ln => pef%fsr_nir_d_ln - eff_kid => pps%eff_kid - eff_kii => pps%eff_kii - sun_faid => pps%sun_faid - sun_faii => pps%sun_faii - sha_faid => pps%sha_faid - sha_faii => pps%sha_faii - sun_add => pef%sun_add - tot_aid => pef%tot_aid - sun_aid => pef%sun_aid - sun_aii => pef%sun_aii - sha_aid => pef%sha_aid - sha_aii => pef%sha_aii - sun_atot => pef%sun_atot - sha_atot => pef%sha_atot - sun_alf => pef%sun_alf - sha_alf => pef%sha_alf - sun_aperlai => pef%sun_aperlai - sha_aperlai => pef%sha_aperlai - - ! Assign local pointers to derived type members (ecophysiological) - - slatop => pftcon%slatop - dsladlai => pftcon%dsladlai - frac_sno => cps%frac_sno - flx_absdv => cps%flx_absdv - flx_absdn => cps%flx_absdn - flx_absiv => cps%flx_absiv - flx_absin => cps%flx_absin - sabg_lyr => pef%sabg_lyr - snl => cps%snl - sfc_frc_aer => pef%sfc_frc_aer - sfc_frc_aer_sno => pef%sfc_frc_aer_sno - albgrd_pur => cps%albgrd_pur - albgri_pur => cps%albgri_pur - sfc_frc_bc => pef%sfc_frc_bc - sfc_frc_bc_sno => pef%sfc_frc_bc_sno - albgrd_bc => cps%albgrd_bc - albgri_bc => cps%albgri_bc - sfc_frc_oc => pef%sfc_frc_oc - sfc_frc_oc_sno => pef%sfc_frc_oc_sno - albgrd_oc => cps%albgrd_oc - albgri_oc => cps%albgri_oc - sfc_frc_dst => pef%sfc_frc_dst - sfc_frc_dst_sno => pef%sfc_frc_dst_sno - albgrd_dst => cps%albgrd_dst - albgri_dst => cps%albgri_dst - albsnd_hst => cps%albsnd_hst - albsni_hst => cps%albsni_hst - fsr_sno_vd => pef%fsr_sno_vd - fsr_sno_nd => pef%fsr_sno_nd - fsr_sno_vi => pef%fsr_sno_vi - fsr_sno_ni => pef%fsr_sno_ni - fsds_sno_vd => pef%fsds_sno_vd - fsds_sno_nd => pef%fsds_sno_nd - fsds_sno_vi => pef%fsds_sno_vi - fsds_sno_ni => pef%fsds_sno_ni - - ! Determine seconds off current time step - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Determine fluxes - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - ! was redundant b/c filter already included wt>0; - ! not redundant anymore with chg in filter definition - l = plandunit(p) - !Note: Some glacier_mec pfts may have zero weight - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - sabg(p) = 0._r8 - sabv(p) = 0._r8 - fsa(p) = 0._r8 - l = plandunit(p) - if (ityplun(l)==istsoil .or. ityplun(l)==istcrop) then - fsa_r(p) = 0._r8 - end if - sabg_lyr(p,:) = 0._r8 - sabg_pur(p) = 0._r8 - sabg_bc(p) = 0._r8 - sabg_oc(p) = 0._r8 - sabg_dst(p) = 0._r8 - end if - end do - - ! Loop over pfts to calculate fsun, etc - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - c = pcolumn(p) - g = pgridcell(p) - - vai(p) = elai(p) + esai(p) - if (coszen(c) > 0._r8 .and. elai(p) > 0._r8 .and. gdir(p) > 0._r8) then - cosz = max(0.001_r8, coszen(c)) - ext = gdir(p)/cosz - t1 = min(ext*elai(p), 40.0_r8) - t2 = exp(-t1) - fsun(p) = (1._r8-t2)/t1 - - ! new control on low lai, to avoid numerical problems in - ! calculation of slasun, slasha - ! PET: 2/29/04 - - if (elai(p) > 0.01_r8) then - laisun(p) = elai(p)*fsun(p) - laisha(p) = elai(p)*(1._r8-fsun(p)) - - ! calculate the average specific leaf area for sunlit and shaded - ! canopies, when effective LAI > 0 - slasun(p) = (t2*dsladlai(ivt(p))*ext*elai(p) + & - t2*dsladlai(ivt(p)) + & - t2*slatop(ivt(p))*ext - & - dsladlai(ivt(p)) - & - slatop(ivt(p))*ext) / & - (ext*(t2-1._r8)) - slasha(p) = ((slatop(ivt(p)) + & - (dsladlai(ivt(p)) * elai(p)/2.0_r8)) * elai(p) - & - laisun(p)*slasun(p)) / laisha(p) - else - ! special case for low elai - fsun(p) = 1._r8 - laisun(p) = elai(p) - laisha(p) = 0._r8 - slasun(p) = slatop(ivt(p)) - slasha(p) = 0._r8 - end if - else - fsun(p) = 0._r8 - laisun(p) = 0._r8 - laisha(p) = elai(p) - slasun(p) = 0._r8 - slasha(p) = 0._r8 - end if - end if - end do - - ! Loop over nband wavebands - do ib = 1, nband - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - c = pcolumn(p) - g = pgridcell(p) - - ! Absorbed by canopy - - cad(p,ib) = forc_solad(g,ib)*fabd(p,ib) - cai(p,ib) = forc_solai(g,ib)*fabi(p,ib) - sabv(p) = sabv(p) + cad(p,ib) + cai(p,ib) - fsa(p) = fsa(p) + cad(p,ib) + cai(p,ib) - l = plandunit(p) - if (ityplun(l)==istsoil .or. ityplun(l)==istcrop) then - fsa_r(p) = fsa_r(p) + cad(p,ib) + cai(p,ib) - end if - - ! Transmitted = solar fluxes incident on ground - - trd(p,ib) = forc_solad(g,ib)*ftdd(p,ib) - tri(p,ib) = forc_solad(g,ib)*ftid(p,ib) + forc_solai(g,ib)*ftii(p,ib) - - ! Solar radiation absorbed by ground surface - - absrad = trd(p,ib)*(1._r8-albgrd(c,ib)) + tri(p,ib)*(1._r8-albgri(c,ib)) - sabg(p) = sabg(p) + absrad - fsa(p) = fsa(p) + absrad - if (ityplun(l)==istsoil .or. ityplun(l)==istcrop) then - fsa_r(p) = fsa_r(p) + absrad - end if - - if (use_snicar_frc) then - ! Solar radiation absorbed by ground surface without BC - absrad_bc = trd(p,ib)*(1._r8-albgrd_bc(c,ib)) + tri(p,ib)*(1._r8-albgri_bc(c,ib)) - sabg_bc(p) = sabg_bc(p) + absrad_bc - - ! Solar radiation absorbed by ground surface without OC - absrad_oc = trd(p,ib)*(1._r8-albgrd_oc(c,ib)) + tri(p,ib)*(1._r8-albgri_oc(c,ib)) - sabg_oc(p) = sabg_oc(p) + absrad_oc - - ! Solar radiation absorbed by ground surface without dust - absrad_dst = trd(p,ib)*(1._r8-albgrd_dst(c,ib)) + tri(p,ib)*(1._r8-albgri_dst(c,ib)) - sabg_dst(p) = sabg_dst(p) + absrad_dst - - ! Solar radiation absorbed by ground surface without any aerosols - absrad_pur = trd(p,ib)*(1._r8-albgrd_pur(c,ib)) + tri(p,ib)*(1._r8-albgri_pur(c,ib)) - sabg_pur(p) = sabg_pur(p) + absrad_pur - end if - - - ! New sunlit.shaded canopy algorithm - - if (coszen(c) > 0._r8 .and. elai(p) > 0._r8 .and. gdir(p) > 0._r8 ) then - - ! 1. calculate flux of direct beam radiation absorbed in the - ! sunlit canopy as direct (sun_add), and the flux of direct - ! beam radiation absorbed in the total canopy as indirect - - sun_add(p,ib) = forc_solad(g,ib) * (1._r8-ftdd(p,ib)) * (1._r8-omega(p,ib)) - tot_aid(p,ib) = (forc_solad(g,ib) * fabd(p,ib)) - sun_add(p,ib) - - ! the following constraint set to catch round-off level errors - ! that can cause negative tot_aid - - tot_aid(p,ib) = max(tot_aid(p,ib), 0._r8) - - ! 2. calculate the effective extinction coefficients for indirect - ! transmission originating from direct and indirect streams, - ! using ftid and ftii - - !eff_kid(p,ib) = -(log(ftid(p,ib)))/vai(p) - !eff_kii(p,ib) = -(log(ftii(p,ib)))/vai(p) - - ! 3. calculate the fraction of indirect radiation being absorbed - ! in the sunlit and shaded canopy fraction. Some of this indirect originates in - ! the direct beam and some originates in the indirect beam. - - !sun_faid(p,ib) = 1.-exp(-eff_kid(p,ib) * vaisun(p)) - !sun_faii(p,ib) = 1.-exp(-eff_kii(p,ib) * vaisun(p)) - sun_faid(p,ib) = fsun(p) - sun_faii(p,ib) = fsun(p) - sha_faid(p,ib) = 1._r8-sun_faid(p,ib) - sha_faii(p,ib) = 1._r8-sun_faii(p,ib) - - ! 4. calculate the total indirect flux absorbed by the sunlit - ! and shaded canopy based on these fractions and the fabd and - ! fabi from surface albedo calculations - - sun_aid(p,ib) = tot_aid(p,ib) * sun_faid(p,ib) - sun_aii(p,ib) = forc_solai(g,ib)*fabi(p,ib)*sun_faii(p,ib) - sha_aid(p,ib) = tot_aid(p,ib) * sha_faid(p,ib) - sha_aii(p,ib) = forc_solai(g,ib)*fabi(p,ib)*sha_faii(p,ib) - - ! 5. calculate the total flux absorbed in the sunlit and shaded - ! canopy as the sum of these terms - - sun_atot(p,ib) = sun_add(p,ib) + sun_aid(p,ib) + sun_aii(p,ib) - sha_atot(p,ib) = sha_aid(p,ib) + sha_aii(p,ib) - - ! 6. calculate the total flux absorbed by leaves in the sunlit - ! and shaded canopies - - laifra = elai(p)/vai(p) - sun_alf(p,ib) = sun_atot(p,ib) * laifra - sha_alf(p,ib) = sha_atot(p,ib) * laifra - - ! 7. calculate the fluxes per unit lai in the sunlit and shaded - ! canopies - - if (laisun(p) > 0._r8) then - sun_aperlai(p,ib) = sun_alf(p,ib)/laisun(p) - else - sun_aperlai(p,ib) = 0._r8 - endif - if (laisha(p) > 0._r8) then - sha_aperlai(p,ib) = sha_alf(p,ib)/laisha(p) - else - sha_aperlai(p,ib) = 0._r8 - endif - - else ! coszen = 0 or elai = 0 - - sun_add(p,ib) = 0._r8 - tot_aid(p,ib) = 0._r8 - eff_kid(p,ib) = 0._r8 - eff_kii(p,ib) = 0._r8 - sun_faid(p,ib) = 0._r8 - sun_faii(p,ib) = 0._r8 - sha_faid(p,ib) = 0._r8 - sha_faii(p,ib) = 0._r8 - sun_aid(p,ib) = 0._r8 - sun_aii(p,ib) = 0._r8 - sha_aid(p,ib) = 0._r8 - sha_aii(p,ib) = 0._r8 - sun_atot(p,ib) = 0._r8 - sha_atot(p,ib) = 0._r8 - sun_alf(p,ib) = 0._r8 - sha_alf(p,ib) = 0._r8 - sun_aperlai(p,ib) = 0._r8 - sha_aperlai(p,ib) = 0._r8 - - end if - end if - end do ! end of pft loop - end do ! end nbands loop - - - ! compute absorbed flux in each snow layer and top soil layer, - ! based on flux factors computed in the radiative transfer portion of SNICAR. - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - c = pcolumn(p) - sabg_snl_sum = 0._r8 - - ! CASE1: No snow layers: all energy is absorbed in top soil layer - if (snl(c) == 0) then - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,1) = sabg(p) - sabg_snl_sum = sabg_lyr(p,1) - - ! CASE 2: Snow layers present: absorbed radiation is scaled according to - ! flux factors computed by SNICAR - else - do i = -nlevsno+1,1,1 - sabg_lyr(p,i) = flx_absdv(c,i)*trd(p,1) + flx_absdn(c,i)*trd(p,2) + & - flx_absiv(c,i)*tri(p,1) + flx_absin(c,i)*tri(p,2) - ! summed radiation in active snow layers: - if (i >= snl(c)+1) then - sabg_snl_sum = sabg_snl_sum + sabg_lyr(p,i) - endif - enddo - - ! Error handling: The situation below can occur when solar radiation is - ! NOT computed every timestep. - ! When the number of snow layers has changed in between computations of the - ! absorbed solar energy in each layer, we must redistribute the absorbed energy - ! to avoid physically unrealistic conditions. The assumptions made below are - ! somewhat arbitrary, but this situation does not arise very frequently. - ! This error handling is implemented to accomodate any value of the - ! radiation frequency. - if (abs(sabg_snl_sum-sabg(p)) > 0.00001_r8) then - if (snl(c) == 0) then - sabg_lyr(p,-4:0) = 0._r8 - sabg_lyr(p,1) = sabg(p) - elseif (snl(c) == -1) then - sabg_lyr(p,-4:-1) = 0._r8 - sabg_lyr(p,0) = sabg(p)*0.6_r8 - sabg_lyr(p,1) = sabg(p)*0.4_r8 - else - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,snl(c)+1) = sabg(p)*0.75_r8 - sabg_lyr(p,snl(c)+2) = sabg(p)*0.25_r8 - endif - endif - - ! If shallow snow depth, all solar radiation absorbed in top or top two snow layers - ! to prevent unrealistic timestep soil warming - if (snowdp(c) < 0.10_r8) then - if (snl(c) == 0) then - sabg_lyr(p,-4:0) = 0._r8 - sabg_lyr(p,1) = sabg(p) - elseif (snl(c) == -1) then - sabg_lyr(p,-4:-1) = 0._r8 - sabg_lyr(p,0) = sabg(p) - sabg_lyr(p,1) = 0._r8 - else - sabg_lyr(p,:) = 0._r8 - sabg_lyr(p,snl(c)+1) = sabg(p)*0.75_r8 - sabg_lyr(p,snl(c)+2) = sabg(p)*0.25_r8 - endif - endif - - endif - - ! This situation should not happen: - if (abs(sum(sabg_lyr(p,:))-sabg(p)) > 0.00001_r8) then - write(iulog,*) "SNICAR ERROR: Absorbed ground radiation not equal to summed snow layer radiation. pft = ", & - p," Col= ", c, " Diff= ",sum(sabg_lyr(p,:))-sabg(p), " sabg(p)= ", sabg(p), " sabg_sum(p)= ", & - sum(sabg_lyr(p,:)), " snl(c)= ", snl(c) - write(iulog,*) "flx_absdv1= ", trd(p,1)*(1.-albgrd(c,1)), "flx_absdv2= ", sum(flx_absdv(c,:))*trd(p,1) - write(iulog,*) "flx_absiv1= ", tri(p,1)*(1.-albgri(c,1))," flx_absiv2= ", sum(flx_absiv(c,:))*tri(p,1) - write(iulog,*) "flx_absdn1= ", trd(p,2)*(1.-albgrd(c,2))," flx_absdn2= ", sum(flx_absdn(c,:))*trd(p,2) - write(iulog,*) "flx_absin1= ", tri(p,2)*(1.-albgri(c,2))," flx_absin2= ", sum(flx_absin(c,:))*tri(p,2) - - write(iulog,*) "albgrd_nir= ", albgrd(c,2) - write(iulog,*) "coszen= ", coszen(c) - call endrun() - endif - - - if (use_snicar_frc) then - - ! BC aerosol forcing (pft-level): - sfc_frc_bc(p) = sabg(p) - sabg_bc(p) - - ! OC aerosol forcing (pft-level): - if (DO_SNO_OC) then - sfc_frc_oc(p) = sabg(p) - sabg_oc(p) - else - sfc_frc_oc(p) = 0._r8 - endif - - ! dust aerosol forcing (pft-level): - sfc_frc_dst(p) = sabg(p) - sabg_dst(p) - - ! all-aerosol forcing (pft-level): - sfc_frc_aer(p) = sabg(p) - sabg_pur(p) - - ! forcings averaged only over snow: - if (frac_sno(c) > 0._r8) then - sfc_frc_bc_sno(p) = sfc_frc_bc(p)/frac_sno(c) - sfc_frc_oc_sno(p) = sfc_frc_oc(p)/frac_sno(c) - sfc_frc_dst_sno(p) = sfc_frc_dst(p)/frac_sno(c) - sfc_frc_aer_sno(p) = sfc_frc_aer(p)/frac_sno(c) - else - sfc_frc_bc_sno(p) = spval - sfc_frc_oc_sno(p) = spval - sfc_frc_dst_sno(p) = spval - sfc_frc_aer_sno(p) = spval - endif - - end if - endif - enddo - - - do fp = 1,num_nourbanp - p = filter_nourbanp(fp) - l = plandunit(p) - if (pwtgcell(p)>0._r8 .or. ityplun(l)==istice_mec) then - g = pgridcell(p) - - ! Final step of new sunlit/shaded canopy algorithm - ! 8. calculate the total and per-unit-lai fluxes for PAR in the - ! sunlit and shaded canopy leaf fractions - - parsun(p) = sun_aperlai(p,1) - parsha(p) = sha_aperlai(p,1) - - ! The following code is duplicated from SurfaceRadiation - ! NDVI and reflected solar radiation - - rvis = albd(p,1)*forc_solad(g,1) + albi(p,1)*forc_solai(g,1) - rnir = albd(p,2)*forc_solad(g,2) + albi(p,2)*forc_solai(g,2) - fsr(p) = rvis + rnir - - fsds_vis_d(p) = forc_solad(g,1) - fsds_nir_d(p) = forc_solad(g,2) - fsds_vis_i(p) = forc_solai(g,1) - fsds_nir_i(p) = forc_solai(g,2) - fsr_vis_d(p) = albd(p,1)*forc_solad(g,1) - fsr_nir_d(p) = albd(p,2)*forc_solad(g,2) - fsr_vis_i(p) = albi(p,1)*forc_solai(g,1) - fsr_nir_i(p) = albi(p,2)*forc_solai(g,2) - - local_secp1 = secs + nint((londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - if (local_secp1 == isecspday/2) then - fsds_vis_d_ln(p) = forc_solad(g,1) - fsds_nir_d_ln(p) = forc_solad(g,2) - fsr_vis_d_ln(p) = albd(p,1)*forc_solad(g,1) - fsr_nir_d_ln(p) = albd(p,2)*forc_solad(g,2) - else - fsds_vis_d_ln(p) = spval - fsds_nir_d_ln(p) = spval - fsr_vis_d_ln(p) = spval - fsr_nir_d_ln(p) = spval - end if - - ! diagnostic variables (downwelling and absorbed radiation partitioning) for history files - ! (OPTIONAL) - c = pcolumn(p) - if (snl(c) < 0) then - fsds_sno_vd(p) = forc_solad(g,1) - fsds_sno_nd(p) = forc_solad(g,2) - fsds_sno_vi(p) = forc_solai(g,1) - fsds_sno_ni(p) = forc_solai(g,2) - - fsr_sno_vd(p) = fsds_vis_d(p)*albsnd_hst(c,1) - fsr_sno_nd(p) = fsds_nir_d(p)*albsnd_hst(c,2) - fsr_sno_vi(p) = fsds_vis_i(p)*albsni_hst(c,1) - fsr_sno_ni(p) = fsds_nir_i(p)*albsni_hst(c,2) - else - fsds_sno_vd(p) = spval - fsds_sno_nd(p) = spval - fsds_sno_vi(p) = spval - fsds_sno_ni(p) = spval - - fsr_sno_vd(p) = spval - fsr_sno_nd(p) = spval - fsr_sno_vi(p) = spval - fsr_sno_ni(p) = spval - endif - - end if - end do - - end subroutine SurfaceRadiation - -end module SurfaceRadiationMod diff --git a/src_clm40/biogeophys/TridiagonalMod.F90 b/src_clm40/biogeophys/TridiagonalMod.F90 deleted file mode 100644 index a5e8d7d1ab..0000000000 --- a/src_clm40/biogeophys/TridiagonalMod.F90 +++ /dev/null @@ -1,106 +0,0 @@ -module TridiagonalMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: TridiagonalMod -! -! !DESCRIPTION: -! Tridiagonal matrix solution -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: Tridiagonal -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: Tridiagonal -! -! !INTERFACE: - subroutine Tridiagonal (lbc, ubc, lbj, ubj, jtop, numf, filter, & - a, b, c, r, u) -! -! !DESCRIPTION: -! Tridiagonal matrix solution -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! lbinning and ubing column indices - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: jtop(lbc:ubc) ! top level for each column - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(1:numf) ! filter - real(r8), intent(in) :: a(lbc:ubc, lbj:ubj) ! "a" left off diagonal of tridiagonal matrix - real(r8), intent(in) :: b(lbc:ubc, lbj:ubj) ! "b" diagonal column for tridiagonal matrix - real(r8), intent(in) :: c(lbc:ubc, lbj:ubj) ! "c" right off diagonal tridiagonal matrix - real(r8), intent(in) :: r(lbc:ubc, lbj:ubj) ! "r" forcing term of tridiagonal matrix - real(r8), intent(inout) :: u(lbc:ubc, lbj:ubj) ! solution -! -! !CALLED FROM: -! subroutine BiogeophysicsLake in module BiogeophysicsLakeMod -! subroutine SoilTemperature in module SoilTemperatureMod -! subroutine SoilWater in module HydrologyMod -! -! !REVISION HISTORY: -! 15 September 1999: Yongjiu Dai; Initial code -! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision -! 1 July 2003: Mariana Vertenstein; modified for vectorization -! -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: j,ci,fc !indices - real(r8) :: gam(lbc:ubc,lbj:ubj) !temporary - real(r8) :: bet(lbc:ubc) !temporary -!----------------------------------------------------------------------- - - ! Solve the matrix - - do fc = 1,numf - ci = filter(fc) - bet(ci) = b(ci,jtop(ci)) - end do - - do j = lbj, ubj - do fc = 1,numf - ci = filter(fc) - if (j >= jtop(ci)) then - if (j == jtop(ci)) then - u(ci,j) = r(ci,j) / bet(ci) - else - gam(ci,j) = c(ci,j-1) / bet(ci) - bet(ci) = b(ci,j) - a(ci,j) * gam(ci,j) - u(ci,j) = (r(ci,j) - a(ci,j)*u(ci,j-1)) / bet(ci) - end if - end if - end do - end do - - do j = ubj-1,lbj,-1 - do fc = 1,numf - ci = filter(fc) - if (j >= jtop(ci)) then - u(ci,j) = u(ci,j) - gam(ci,j+1) * u(ci,j+1) - end if - end do - end do - - end subroutine Tridiagonal - -end module TridiagonalMod diff --git a/src_clm40/biogeophys/UrbanInitMod.F90 b/src_clm40/biogeophys/UrbanInitMod.F90 deleted file mode 100644 index ad48b350ce..0000000000 --- a/src_clm40/biogeophys/UrbanInitMod.F90 +++ /dev/null @@ -1,477 +0,0 @@ -module UrbanInitMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: UrbanInitMod -! -! !DESCRIPTION: -! Initialize urban data -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use shr_sys_mod , only : shr_sys_flush - use clm_varctl , only : iulog, use_vancouver, use_mexicocity - use UrbanMod, only : urban_traffic, urban_hac, urban_hac_off -! -! !PUBLIC TYPES: - implicit none - save - - private -! -! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanInitTimeVar ! Initialize urban time varying variables - public :: UrbanInitTimeConst ! Initialize urban time constant variables - public :: UrbanInitAero ! Calculate urban landunit aerodynamic constants -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanInitAero -! -! !INTERFACE: - subroutine UrbanInitAero( ) -! -! !DESCRIPTION: -! Calculate urban land unit aerodynamic constants using Macdonald (1998) as used in -! Grimmond and Oke (1999) -! -! !USES: - use clmtype - use clm_varcon, only : isturb, vkc - use decompMod , only : get_proc_bounds -! -! !ARGUMENTS: - implicit none -! -! local pointers to original implicit in arguments (urban clump) -! - real(r8), pointer :: ht_roof(:) ! height of urban roof (m) - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width (-) - integer , pointer :: ltype(:) ! landunit type -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: z_0_town(:) ! urban landunit momentum roughness length (m) - real(r8), pointer :: z_d_town(:) ! urban landunit displacement height (m) -! -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! Created by Keith Oleson January 2005 -! -! -! !LOCAL VARIABLES: -!EOP - real(r8), parameter :: alpha = 4.43_r8 ! coefficient used to calculate z_d_town - real(r8), parameter :: beta = 1.0_r8 ! coefficient used to calculate z_d_town - real(r8), parameter :: C_d = 1.2_r8 ! drag coefficient as used in Grimmond and Oke (1999) - real(r8) :: plan_ai ! plan area index - ratio building area to plan area (-) - real(r8) :: frontal_ai ! frontal area index of buildings (-) - real(r8) :: build_lw_ratio ! building short/long side ratio (-) - integer :: l,g ! indices - integer :: begp, endp ! clump beginning and ending pft indices - integer :: begc, endc ! clump beginning and ending column indices - integer :: begl, endl ! clump beginning and ending landunit indices - integer :: begg, endg ! clump beginning and ending gridcell indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (landunit level) - - ltype => lun%itype - z_0_town => lun%z_0_town - z_d_town => lun%z_d_town - ht_roof => lun%ht_roof - canyon_hwr => lun%canyon_hwr - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - do l = begl, endl - if (ltype(l) == isturb) then - - ! Calculate plan area index - plan_ai = canyon_hwr(l)/(canyon_hwr(l) + 1._r8) - - ! Building shape shortside/longside ratio (e.g. 1 = square ) - ! This assumes the building occupies the entire canyon length - build_lw_ratio = plan_ai - - ! Calculate frontal area index - frontal_ai = (1._r8 - plan_ai) * canyon_hwr(l) - - ! Adjust frontal area index for different building configuration - frontal_ai = frontal_ai * sqrt(1/build_lw_ratio) * sqrt(plan_ai) - - ! Calculate displacement height - - if (use_vancouver) then - z_d_town(l) = 3.5_r8 - else if (use_mexicocity) then - z_d_town(l) = 10.9_r8 - else - z_d_town(l) = (1._r8 + alpha**(-plan_ai) * (plan_ai - 1._r8)) * ht_roof(l) - end if - - ! Calculate the roughness length - - if (use_vancouver) then - z_0_town(l) = 0.35_r8 - else if (use_mexicocity) then - z_0_town(l) = 2.2_r8 - else - z_0_town(l) = ht_roof(l) * (1._r8 - z_d_town(l) / ht_roof(l)) * & - exp(-1.0_r8 * (0.5_r8 * beta * C_d / vkc**2 * & - (1 - z_d_town(l) / ht_roof(l)) * frontal_ai)**(-0.5_r8)) - end if - end if - end do - - end subroutine UrbanInitAero - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanInitTimeConst -! -! !INTERFACE: - subroutine UrbanInitTimeConst() -! -! !DESCRIPTION: -! Initialize urban time-constant variables -! -! !USES: - use clmtype - use clm_varcon , only : isturb, icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv, spval - use decompMod , only : get_proc_bounds, ldecomp - use UrbanInputMod, only : urbinp -! -! !ARGUMENTS: - implicit none -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: gdc(:) ! grid index for landunit - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type index - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio - real(r8), pointer :: emg(:) ! ground emissivity - real(r8), pointer :: wtroad_perv(:) ! weight of pervious column to total road - real(r8), pointer :: ht_roof(:) ! height of urban roof (m) - real(r8), pointer :: wtlunit_roof(:) ! weight of roof with respect to landunit - real(r8), pointer :: wind_hgt_canyon(:) ! height above road at which wind in canyon is to be computed (m) - real(r8), pointer :: eflx_traffic_factor(:) ! multiplicative factor for sensible heat flux from urban traffic - real(r8), pointer :: t_building_max(:) ! maximum internal building temperature (K) - real(r8), pointer :: t_building_min(:) ! minimum internal building temperature (K) - real(r8), pointer :: tk_wall(:,:) ! thermal conductivity of urban wall (W/m/K) - real(r8), pointer :: tk_roof(:,:) ! thermal conductivity of urban roof (W/m/K) - real(r8), pointer :: tk_improad(:,:) ! thermal conductivity of urban impervious road (W/m/K) - real(r8), pointer :: cv_wall(:,:) ! thermal conductivity of urban wall (J/m^3/K) - real(r8), pointer :: cv_roof(:,:) ! thermal conductivity of urban roof (J/m^3/K) - real(r8), pointer :: cv_improad(:,:) ! thermal conductivity of urban impervious road (J/m^3/K) - real(r8), pointer :: thick_wall(:) ! thickness of urban wall (m) - real(r8), pointer :: thick_roof(:) ! thickness of urban roof (m) - integer, pointer :: nlev_improad(:) ! number of impervious road layers (-) -! -! -! !OTHER LOCAL VARIABLES -!EOP - integer :: nc,fl,ib,l,c,p,g ! indices - integer :: ier ! error status - integer :: begp, endp ! clump beginning and ending pft indices - integer :: begc, endc ! clump beginning and ending column indices - integer :: begl, endl ! clump beginning and ending landunit indices - integer :: begg, endg ! clump beginning and ending gridcell indices - - ! Assign local pointers to derived type members (landunit-level) - - ltype => lun%itype - lgridcell => lun%gridcell - coli => lun%coli - colf => lun%colf - canyon_hwr => lun%canyon_hwr - wtroad_perv => lun%wtroad_perv - ht_roof => lun%ht_roof - wtlunit_roof => lun%wtlunit_roof - wind_hgt_canyon => lun%wind_hgt_canyon - eflx_traffic_factor => lef%eflx_traffic_factor - t_building_max => lps%t_building_max - t_building_min => lps%t_building_min - canyon_hwr => lun%canyon_hwr - tk_wall => lps%tk_wall - tk_roof => lps%tk_roof - tk_improad => lps%tk_improad - cv_wall => lps%cv_wall - cv_roof => lps%cv_roof - cv_improad => lps%cv_improad - thick_wall => lps%thick_wall - thick_roof => lps%thick_roof - nlev_improad => lps%nlev_improad - - ! Assign local pointers to derived type members (column-level) - - ctype => col%itype - emg => cps%emg - - ! Initialize time constant urban variables - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - do l = begl, endl - if (ltype(l) == isturb) then - g = lun%gridcell(l) - canyon_hwr(l) = urbinp%canyon_hwr(g) - wtroad_perv(l) = urbinp%wtroad_perv(g) - ht_roof(l) = urbinp%ht_roof(g) - wtlunit_roof(l) = urbinp%wtlunit_roof(g) - wind_hgt_canyon(l) = urbinp%wind_hgt_canyon(g) - tk_wall(l,:) = urbinp%tk_wall(g,:) - tk_roof(l,:) = urbinp%tk_roof(g,:) - tk_improad(l,:) = urbinp%tk_improad(g,:) - cv_wall(l,:) = urbinp%cv_wall(g,:) - cv_roof(l,:) = urbinp%cv_roof(g,:) - cv_improad(l,:) = urbinp%cv_improad(g,:) - thick_wall(l) = urbinp%thick_wall(g) - thick_roof(l) = urbinp%thick_roof(g) - nlev_improad(l) = urbinp%nlev_improad(g) - t_building_min(l) = urbinp%t_building_min(g) - t_building_max(l) = urbinp%t_building_max(g) - - do c = coli(l),colf(l) - if (ctype(c) == icol_roof ) emg(c) = urbinp%em_roof(g) - if (ctype(c) == icol_sunwall ) emg(c) = urbinp%em_wall(g) - if (ctype(c) == icol_shadewall ) emg(c) = urbinp%em_wall(g) - if (ctype(c) == icol_road_imperv) emg(c) = urbinp%em_improad(g) - if (ctype(c) == icol_road_perv ) emg(c) = urbinp%em_perroad(g) - end do - - ! Inferred from Sailor and Lu 2004 - if (urban_traffic) then - eflx_traffic_factor(l) = 3.6_r8 * (canyon_hwr(l)-0.5_r8) + 1.0_r8 - else - eflx_traffic_factor(l) = 0.0_r8 - end if - - if (use_vancouver .or. use_mexicocity) then - ! Freely evolving - t_building_max(l) = 380.00_r8 - t_building_min(l) = 200.00_r8 - else - if (urban_hac == urban_hac_off) then - ! Overwrite values read in from urbinp by freely evolving values - t_building_max(l) = 380.00_r8 - t_building_min(l) = 200.00_r8 - end if - end if - else - eflx_traffic_factor(l) = 0.0_r8 - t_building_max(l) = 0.0_r8 - t_building_min(l) = 0.0_r8 - end if - end do - - end subroutine UrbanInitTimeConst - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanInitTimeVar -! -! !INTERFACE: - subroutine UrbanInitTimeVar( ) -! -! !DESCRIPTION: -! Initialize urban time-varying variables -! -! !USES: - use clmtype - use clm_varcon, only : isturb, spval, icol_road_perv - use decompMod , only : get_proc_bounds -! -! !ARGUMENTS: - implicit none -! -! local pointers to original implicit in arguments (urban clump) -! - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: clandunit(:) ! landunit index of corresponding column - integer , pointer :: plandunit(:) ! landunit index of corresponding pft - integer , pointer :: ctype(:) ! column type -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: taf(:) ! urban canopy air temperature (K) - real(r8), pointer :: qaf(:) ! urban canopy air specific humidity (kg/kg) - real(r8), pointer :: eflx_building_heat(:) ! heat flux from urban building interior to walls, roof (W/m**2) - real(r8), pointer :: eflx_urban_ac(:) ! urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat(:) ! urban heating flux (W/m**2) - real(r8), pointer :: fcov(:) ! fractional impermeable area - real(r8), pointer :: fsat(:) ! fractional area with water table at surface - real(r8), pointer :: qcharge(:) ! aquifer recharge rate (mm/s) - real(r8), pointer :: t_building(:) ! internal building temperature (K) - real(r8), pointer :: eflx_traffic(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_wasteheat_pft(:) ! sensible heat flux from urban heating/cooling sources of waste heat at pft level (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_pft(:) ! sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_traffic_pft(:) ! sensible heat flux from traffic (W/m**2) - real(r8), pointer :: eflx_anthro(:) ! total anthropogenic heat flux (W/m**2) - real(r8), pointer :: t_ref2m_u(:) ! Urban 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_min_u(:) ! Urban daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_u(:) ! Urban daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: rh_ref2m_u(:) ! Urban 2 m height surface relative humidity (%) - real(r8), pointer :: t_grnd_u(:) ! Urban ground temperature (Kelvin) - real(r8), pointer :: qflx_runoff_u(:) ! Urban total runoff (qflx_drain+qflx_surf) (mm H2O /s) - real(r8), pointer :: fsa_u(:) ! Urban absorbed solar radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net_u(:) ! Urban net longwave radiation (W/m**2) - real(r8), pointer :: eflx_lh_tot_u(:) ! Urban latent heat flux (W/m**2) - real(r8), pointer :: eflx_sh_tot_u(:) ! Urban sensible heat flux (W/m**2) - real(r8), pointer :: eflx_soil_grnd_u(:) ! Urban ground heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_u(:) ! Urban snow melt heat flux (W/m**2) -! -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! Created by Keith Oleson February 2005 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: l,g,c,p ! indices - integer :: begp, endp ! clump beginning and ending pft indices - integer :: begc, endc ! clump beginning and ending column indices - integer :: begl, endl ! clump beginning and ending landunit indices - integer :: begg, endg ! clump beginning and ending gridcell indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (landunit level) - - taf => lps%taf - qaf => lps%qaf - ltype => lun%itype - lgridcell => lun%gridcell - t_building => lps%t_building - eflx_traffic => lef%eflx_traffic - eflx_wasteheat => lef%eflx_wasteheat - - ! Assign local pointers to derived type members (column level) - - clandunit => col%landunit - eflx_building_heat => cef%eflx_building_heat - eflx_urban_ac => cef%eflx_urban_ac - eflx_urban_heat => cef%eflx_urban_heat - fcov => cws%fcov - fsat => cws%fsat - qcharge => cws%qcharge - ctype => col%itype - t_grnd_u => ces%t_grnd_u - qflx_runoff_u => cwf%qflx_runoff_u - eflx_snomelt_u => cef%eflx_snomelt_u - - ! Assign local pointers to derived type members (pft level) - - t_ref2m_u => pes%t_ref2m_u - t_ref2m_min_u => pes%t_ref2m_min_u - t_ref2m_max_u => pes%t_ref2m_max_u - rh_ref2m_u => pes%rh_ref2m_u - plandunit => pft%landunit - eflx_wasteheat_pft => pef%eflx_wasteheat_pft - eflx_heat_from_ac_pft => pef%eflx_heat_from_ac_pft - eflx_traffic_pft => pef%eflx_traffic_pft - eflx_anthro => pef%eflx_anthro - fsa_u => pef%fsa_u - eflx_lwrad_net_u => pef%eflx_lwrad_net_u - eflx_lh_tot_u => pef%eflx_lh_tot_u - eflx_sh_tot_u => pef%eflx_sh_tot_u - eflx_soil_grnd_u => pef%eflx_soil_grnd_u - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - do l = begl, endl - g = lgridcell(l) - if (ltype(l) == isturb) then - if (use_vancouver) then - taf(l) = 297.56_r8 - qaf(l) = 0.0111_r8 - else if (use_mexicocity) then - taf(l) = 289.46_r8 - qaf(l) = 0.00248_r8 - else - taf(l) = 283._r8 - ! Arbitrary set since forc_q is not yet available - qaf(l) = 1.e-4_r8 - end if - else - t_building(l) = 0.0_r8 - eflx_traffic(l) = 0.0_r8 - eflx_wasteheat(l) = 0.0_r8 - end if - end do - - do c = begc, endc - l = clandunit(c) - if (ltype(l) == isturb) then - eflx_building_heat(c) = 0._r8 - eflx_urban_ac(c) = 0._r8 - eflx_urban_heat(c) = 0._r8 - ! - ! Set hydrology variables for urban to spvalue -- as only valid for pervious road - ! - if (ctype(c) /= icol_road_perv )then - fcov(c) = spval - fsat(c) = spval - qcharge(c) = spval - end if - else - eflx_building_heat(c) = 0._r8 - eflx_urban_ac(c) = 0._r8 - eflx_urban_heat(c) = 0.0_r8 - t_grnd_u(c) = 0.0_r8 - qflx_runoff_u(c) = 0.0_r8 - eflx_snomelt_u(c) = 0.0_r8 - end if - end do - - do p = begp, endp - l = plandunit(p) - if (ltype(l) /= isturb) then - t_ref2m_u(p) = 0.0_r8 - t_ref2m_min_u(p) = 0.0_r8 - t_ref2m_max_u(p) = 0.0_r8 - rh_ref2m_u(p) = 0.0_r8 - eflx_wasteheat_pft(p) = 0.0_r8 - eflx_heat_from_ac_pft(p) = 0.0_r8 - eflx_traffic_pft(p) = 0.0_r8 - eflx_anthro(p) = 0.0_r8 - fsa_u(p) = 0.0_r8 - eflx_lwrad_net_u(p) = 0.0_r8 - eflx_lh_tot_u(p) = 0.0_r8 - eflx_sh_tot_u(p) = 0.0_r8 - eflx_soil_grnd_u(p) = 0.0_r8 - else - eflx_wasteheat_pft(p) = 0.0_r8 - eflx_heat_from_ac_pft(p) = 0.0_r8 - eflx_traffic_pft(p) = 0.0_r8 - end if - end do - - end subroutine UrbanInitTimeVar - -end module UrbanInitMod diff --git a/src_clm40/biogeophys/UrbanInputMod.F90 b/src_clm40/biogeophys/UrbanInputMod.F90 deleted file mode 100644 index dd73156fca..0000000000 --- a/src_clm40/biogeophys/UrbanInputMod.F90 +++ /dev/null @@ -1,355 +0,0 @@ -module UrbanInputMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: UrbanInputMod -! -! !DESCRIPTION: -! Read in input urban data - fill in data structure urbinp -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use shr_sys_mod , only : shr_sys_flush -! -! !PUBLIC TYPES: - implicit none - save - - private -! -! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanInput ! Read in urban input data - - type urbinp_t - real(r8), pointer :: canyon_hwr(:) - real(r8), pointer :: wtlunit_roof(:) - real(r8), pointer :: wtroad_perv(:) - real(r8), pointer :: em_roof(:) - real(r8), pointer :: em_improad(:) - real(r8), pointer :: em_perroad(:) - real(r8), pointer :: em_wall(:) - real(r8), pointer :: alb_roof_dir(:,:) - real(r8), pointer :: alb_roof_dif(:,:) - real(r8), pointer :: alb_improad_dir(:,:) - real(r8), pointer :: alb_improad_dif(:,:) - real(r8), pointer :: alb_perroad_dir(:,:) - real(r8), pointer :: alb_perroad_dif(:,:) - real(r8), pointer :: alb_wall_dir(:,:) - real(r8), pointer :: alb_wall_dif(:,:) - real(r8), pointer :: ht_roof(:) - real(r8), pointer :: wind_hgt_canyon(:) - real(r8), pointer :: tk_wall(:,:) - real(r8), pointer :: tk_roof(:,:) - real(r8), pointer :: tk_improad(:,:) - real(r8), pointer :: cv_wall(:,:) - real(r8), pointer :: cv_roof(:,:) - real(r8), pointer :: cv_improad(:,:) - real(r8), pointer :: thick_wall(:) - real(r8), pointer :: thick_roof(:) - integer, pointer :: nlev_improad(:) - real(r8), pointer :: t_building_min(:) - real(r8), pointer :: t_building_max(:) - end type urbinp_t - public urbinp_t - - type (urbinp_t) , public :: urbinp ! urban input derived type -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanInput -! -! !INTERFACE: - subroutine UrbanInput(mode) -! -! !DESCRIPTION: -! Allocate memory and read in urban input data -! -! !USES: - use clm_varpar, only : numrad, nlevurb, numsolar - use clm_varctl, only : iulog, fsurdat, single_column - use fileutils , only : getavu, relavu, getfil, opnfil - use spmdMod , only : masterproc - use clmtype - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_io, ncd_inqfdims, ncd_pio_closefile, ncd_inqdid, ncd_inqdlen -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: mode -! -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein July 2004 -! Revised by Keith Oleson for netcdf input Jan 2008 -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: dimid,varid ! netCDF id's - integer :: begg,endg ! start/stop gridcells - integer :: nw,n,k,i,j,ni,nj,ns ! indices - integer :: nlevurb_i ! input grid: number of urban vertical levels - integer :: numsolar_i ! input grid: number of solar type (DIR/DIF) - integer :: numrad_i ! input grid: number of solar bands (VIS/NIR) - integer :: ier,ret ! error status - logical :: isgrid2d ! true => file is 2d - logical :: readvar ! true => variable is on dataset - real(r8), pointer :: arrayl3d(:,:,:) ! generic global array - character(len=32) :: subname = 'UrbanInput' ! subroutine name -!----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg) - - if (mode == 'initialize') then - - ! Allocate dynamic memory - allocate(urbinp%canyon_hwr(begg:endg), & - urbinp%wtlunit_roof(begg:endg), & - urbinp%wtroad_perv(begg:endg), & - urbinp%em_roof(begg:endg), & - urbinp%em_improad(begg:endg), & - urbinp%em_perroad(begg:endg), & - urbinp%em_wall(begg:endg), & - urbinp%alb_roof_dir(begg:endg,numrad), & - urbinp%alb_roof_dif(begg:endg,numrad), & - urbinp%alb_improad_dir(begg:endg,numrad), & - urbinp%alb_perroad_dir(begg:endg,numrad), & - urbinp%alb_improad_dif(begg:endg,numrad), & - urbinp%alb_perroad_dif(begg:endg,numrad), & - urbinp%alb_wall_dir(begg:endg,numrad), & - urbinp%alb_wall_dif(begg:endg,numrad), & - urbinp%ht_roof(begg:endg), & - urbinp%wind_hgt_canyon(begg:endg), & - urbinp%tk_wall(begg:endg,nlevurb), & - urbinp%tk_roof(begg:endg,nlevurb), & - urbinp%tk_improad(begg:endg,nlevurb), & - urbinp%cv_wall(begg:endg,nlevurb), & - urbinp%cv_roof(begg:endg,nlevurb), & - urbinp%cv_improad(begg:endg,nlevurb), & - urbinp%thick_wall(begg:endg), & - urbinp%thick_roof(begg:endg), & - urbinp%nlev_improad(begg:endg), & - urbinp%t_building_min(begg:endg), & - urbinp%t_building_max(begg:endg), & - stat=ier) - if (ier /= 0) then - write(iulog,*)'initUrbanInput: allocation error '; call endrun() - endif - - ! Read urban data - - if (masterproc) then - write(iulog,*)' Reading in urban input data from fsurdat file ...' - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - if (masterproc) then - write(iulog,*) subname,trim(fsurdat) - end if - - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun() - end if - - call ncd_inqdid(ncid, 'nlevurb', dimid) - call ncd_inqdlen(ncid, dimid, nlevurb_i) - if (nlevurb_i /= nlevurb) then - write(iulog,*)trim(subname)// ': parameter nlevurb= ',nlevurb, & - 'does not equal input dataset nlevurb= ',nlevurb_i - call endrun - endif - - call ncd_inqdid(ncid, 'numsolar', dimid) - call ncd_inqdlen(ncid, dimid, numsolar_i) - if (numsolar_i /= numsolar) then - write(iulog,*)trim(subname)// ': parameter numsolar= ',numsolar, & - 'does not equal input dataset numsolar= ',numsolar_i - call endrun - endif - - call ncd_inqdid(ncid, 'numrad', dimid) - call ncd_inqdlen(ncid, dimid, numrad_i) - if (numrad_i /= numrad) then - write(iulog,*)trim(subname)// ': parameter numrad= ',numrad, & - 'does not equal input dataset numrad= ',numrad_i - call endrun - endif - - call ncd_io(ncid=ncid, varname='CANYON_HWR', flag='read', data=urbinp%canyon_hwr,& - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: CANYON_HWR NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='WTLUNIT_ROOF', flag='read', data=urbinp%wtlunit_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: WTLUNIT_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='WTROAD_PERV', flag='read', data=urbinp%wtroad_perv, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: WTROAD_PERV NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='EM_ROOF', flag='read', data=urbinp%em_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: EM_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='EM_IMPROAD', flag='read', data=urbinp%em_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: EM_IMPROAD NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='EM_PERROAD', flag='read', data=urbinp%em_perroad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: EM_PERROAD NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='EM_WALL', flag='read', data=urbinp%em_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: EM_WALL NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='HT_ROOF', flag='read', data=urbinp%ht_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HT_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='WIND_HGT_CANYON', flag='read', data=urbinp%wind_hgt_canyon, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: WIND_HGT_CANYON NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='THICK_WALL', flag='read', data=urbinp%thick_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: THICK_WALL NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='THICK_ROOF', flag='read', data=urbinp%thick_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: THICK_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='NLEV_IMPROAD', flag='read', data=urbinp%nlev_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: NLEV_IMPROAD NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='T_BUILDING_MIN', flag='read', data=urbinp%t_building_min, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: T_BUILDING_MIN NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='T_BUILDING_MAX', flag='read', data=urbinp%t_building_max, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: T_BUILDING_MAX NOT on fsurdat file' ) - - allocate(arrayl3d(begg:endg,numrad,numsolar)) - - call ncd_io(ncid=ncid, varname='ALB_IMPROAD', flag='read', data=arrayl3d, & - dim1name=grlnd, readvar=readvar) - if (.not.readvar) call endrun( trim(subname)//' ERROR: ALB_IMPROAD NOT on fsurdat file' ) - urbinp%alb_improad_dir(begg:endg,:) = arrayl3d(begg:endg,:,1) - urbinp%alb_improad_dif(begg:endg,:) = arrayl3d(begg:endg,:,2) - - call ncd_io(ncid=ncid, varname='ALB_PERROAD', flag='read',data=arrayl3d, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: ALB_PERROAD NOT on fsurdat file' ) - urbinp%alb_perroad_dir(begg:endg,:) = arrayl3d(begg:endg,:,1) - urbinp%alb_perroad_dif(begg:endg,:) = arrayl3d(begg:endg,:,2) - - call ncd_io(ncid=ncid, varname='ALB_ROOF', flag='read', data=arrayl3d, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: ALB_ROOF NOT on fsurdat file' ) - urbinp%alb_roof_dir(begg:endg,:) = arrayl3d(begg:endg,:,1) - urbinp%alb_roof_dif(begg:endg,:) = arrayl3d(begg:endg,:,2 ) - - call ncd_io(ncid=ncid, varname='ALB_WALL', flag='read', data=arrayl3d, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: ALB_WALL NOT on fsurdat file' ) - urbinp%alb_wall_dir(begg:endg,:) = arrayl3d(begg:endg,:,1) - urbinp%alb_wall_dif(begg:endg,:) = arrayl3d(begg:endg,:,2) - - deallocate (arrayl3d) - - call ncd_io(ncid=ncid, varname='TK_IMPROAD', flag='read', data=urbinp%tk_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: TK_IMPROAD NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='TK_ROOF', flag='read', data=urbinp%tk_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: TK_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='TK_WALL', flag='read', data=urbinp%tk_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: TK_WALL NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='CV_IMPROAD', flag='read', data=urbinp%cv_improad, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: CV_IMPROAD NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='CV_ROOF', flag='read', data=urbinp%cv_roof, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: CV_ROOF NOT on fsurdat file' ) - - call ncd_io(ncid=ncid, varname='CV_WALL', flag='read', data=urbinp%cv_wall, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: CV_WALL NOT on fsurdat file' ) - - call ncd_pio_closefile(ncid) - if (masterproc) then - write(iulog,*)' Sucessfully read urban input data' - write(iulog,*) - end if - - else if (mode == 'finalize') then - - deallocate(urbinp%canyon_hwr, & - urbinp%wtlunit_roof, & - urbinp%wtroad_perv, & - urbinp%em_roof, & - urbinp%em_improad, & - urbinp%em_perroad, & - urbinp%em_wall, & - urbinp%alb_roof_dir, & - urbinp%alb_roof_dif, & - urbinp%alb_improad_dir, & - urbinp%alb_perroad_dir, & - urbinp%alb_improad_dif, & - urbinp%alb_perroad_dif, & - urbinp%alb_wall_dir, & - urbinp%alb_wall_dif, & - urbinp%ht_roof, & - urbinp%wind_hgt_canyon, & - urbinp%tk_wall, & - urbinp%tk_roof, & - urbinp%tk_improad, & - urbinp%cv_wall, & - urbinp%cv_roof, & - urbinp%cv_improad, & - urbinp%thick_wall, & - urbinp%thick_roof, & - urbinp%nlev_improad, & - urbinp%t_building_min, & - urbinp%t_building_max, & - stat=ier) - if (ier /= 0) then - write(iulog,*)'initUrbanInput: deallocation error '; call endrun() - endif - - else - write(iulog,*)'initUrbanInput error: mode ',trim(mode),' not supported ' - call endrun() - end if - - end subroutine UrbanInput - -end module UrbanInputMod - diff --git a/src_clm40/biogeophys/UrbanMod.F90 b/src_clm40/biogeophys/UrbanMod.F90 deleted file mode 100644 index 01896678f5..0000000000 --- a/src_clm40/biogeophys/UrbanMod.F90 +++ /dev/null @@ -1,3464 +0,0 @@ -module UrbanMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: UrbanMod -! -! !DESCRIPTION: -! Calculate solar and longwave radiation, and turbulent fluxes for urban landunit -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_varpar , only : numrad - use clm_varcon , only : isecspday, degpsec - use clm_varctl , only : iulog - use abortutils , only : endrun - use shr_sys_mod , only : shr_sys_flush -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: UrbanClumpInit ! Initialization of urban clump data structure - public :: UrbanRadiation ! Urban radiative fluxes - public :: UrbanAlbedo ! Urban albedos - public :: UrbanSnowAlbedo ! Urban snow albedos - public :: UrbanFluxes ! Urban turbulent fluxes - -! !Urban control variables - character(len= *), parameter, public :: urban_hac_off = 'OFF' ! - character(len= *), parameter, public :: urban_hac_on = 'ON' ! - character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' ! - character(len= 16), public :: urban_hac = urban_hac_off - logical, public :: urban_traffic = .false. ! urban traffic fluxes -! -! !REVISION HISTORY: -! Created by Gordon Bonan and Mariana Vertenstein and Keith Oleson 04/2003 -! -!EOP -! -! PRIVATE MEMBER FUNCTIONS - private :: view_factor ! View factors for road and one wall - private :: incident_direct ! Direct beam solar rad incident on walls and road in urban canyon - private :: incident_diffuse ! Diffuse solar rad incident on walls and road in urban canyon - private :: net_solar ! Solar radiation absorbed by road and both walls in urban canyon - private :: net_longwave ! Net longwave radiation for road and both walls in urban canyon - -! PRIVATE TYPES - private - type urban_clump_t - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width - real(r8), pointer :: wtroad_perv(:) ! weight of pervious road wrt total road - real(r8), pointer :: ht_roof(:) ! height of urban roof (m) - real(r8), pointer :: wtlunit_roof(:) ! weight of roof with respect to landunit - real(r8), pointer :: wind_hgt_canyon(:) ! height above road at which wind in canyon is to be computed (m) - real(r8), pointer :: em_roof(:) ! roof emissivity - real(r8), pointer :: em_improad(:) ! impervious road emissivity - real(r8), pointer :: em_perroad(:) ! pervious road emissivity - real(r8), pointer :: em_wall(:) ! wall emissivity - real(r8), pointer :: alb_roof_dir(:,:) ! direct roof albedo - real(r8), pointer :: alb_roof_dif(:,:) ! diffuse roof albedo - real(r8), pointer :: alb_improad_dir(:,:) ! direct impervious road albedo - real(r8), pointer :: alb_improad_dif(:,:) ! diffuse impervious road albedo - real(r8), pointer :: alb_perroad_dir(:,:) ! direct pervious road albedo - real(r8), pointer :: alb_perroad_dif(:,:) ! diffuse pervious road albedo - real(r8), pointer :: alb_wall_dir(:,:) ! direct wall albedo - real(r8), pointer :: alb_wall_dif(:,:) ! diffuse wall albedo - end type urban_clump_t - - type (urban_clump_t), private, pointer :: urban_clump(:) ! array of urban clumps for this processor - - integer, private, parameter :: noonsec = isecspday / 2 ! seconds at local noon -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanAlbedo -! -! !INTERFACE: - subroutine UrbanAlbedo (nc, lbl, ubl, lbc, ubc, lbp, ubp, & - num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, & - num_urbanp, filter_urbanp) -! -! !DESCRIPTION: -! Determine urban landunit component albedos -! -! !USES: - use clmtype - use shr_orb_mod , only : shr_orb_decl, shr_orb_cosz - use clm_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv, & - sb -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: nc ! clump index - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban pfts in clump - integer , intent(in) :: filter_urbanp(ubp-lbp+1) ! urban pft filter -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 03/2003, Mariana Vertenstein: Migrated to clm2.2 -! 01/2008, Erik Kluzek: Migrated to clm3.5.15 -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: clandunit(:) ! column's landunit - integer , pointer :: cgridcell(:) ! gridcell of corresponding column - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - integer , pointer :: ctype(:) ! column type - integer , pointer :: pcolumn(:) ! column of corresponding pft - real(r8), pointer :: czen(:) ! cosine of solar zenith angle for each column - real(r8), pointer :: lat(:) ! latitude (radians) - real(r8), pointer :: lon(:) ! longitude (radians) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: albgrd(:,:) ! ground albedo (direct) - real(r8), pointer :: albgri(:,:) ! ground albedo (diffuse) - real(r8), pointer :: albd(:,:) ! surface albedo (direct) - real(r8), pointer :: albi(:,:) ! surface albedo (diffuse) - real(r8), pointer :: fabd(:,:) ! flux absorbed by veg per unit direct flux - real(r8), pointer :: fabi(:,:) ! flux absorbed by veg per unit diffuse flux - real(r8), pointer :: ftdd(:,:) ! down direct flux below veg per unit dir flx - real(r8), pointer :: ftid(:,:) ! down diffuse flux below veg per unit dir flx - real(r8), pointer :: ftii(:,:) ! down diffuse flux below veg per unit dif flx - real(r8), pointer :: fsun(:) ! sunlit fraction of canopy - real(r8), pointer :: gdir(:) ! leaf projection in solar direction (0 to 1) - real(r8), pointer :: omega(:,:) ! fraction of intercepted radiation that is scattered (0 to 1) - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall - real(r8), pointer :: sabs_roof_dir(:,:) ! direct solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_roof_dif(:,:) ! diffuse solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_sunwall_dir(:,:) ! direct solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_sunwall_dif(:,:) ! diffuse solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dir(:,:) ! direct solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dif(:,:) ! diffuse solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_improad_dir(:,:) ! direct solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_improad_dif(:,:) ! diffuse solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dir(:,:) ! direct solar absorbed by pervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dif(:,:) ! diffuse solar absorbed by pervious road per unit ground area per unit incident flux -! -! -! !OTHER LOCAL VARIABLES -!EOP -! - real(r8) :: coszen(num_urbanl) ! cosine solar zenith angle - real(r8) :: coszen_pft(num_urbanp) ! cosine solar zenith angle for next time step (pft level) - real(r8) :: zen(num_urbanl) ! solar zenith angle (radians) - real(r8) :: sdir(num_urbanl, numrad) ! direct beam solar radiation on horizontal surface - real(r8) :: sdif(num_urbanl, numrad) ! diffuse solar radiation on horizontal surface - - real(r8) :: sdir_road(num_urbanl, numrad) ! direct beam solar radiation incident on road - real(r8) :: sdif_road(num_urbanl, numrad) ! diffuse solar radiation incident on road - real(r8) :: sdir_sunwall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8) :: sdif_sunwall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8) :: sdir_shadewall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8) :: sdif_shadewall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8) :: albsnd_roof(num_urbanl,numrad) ! snow albedo for roof (direct) - real(r8) :: albsni_roof(num_urbanl,numrad) ! snow albedo for roof (diffuse) - real(r8) :: albsnd_improad(num_urbanl,numrad) ! snow albedo for impervious road (direct) - real(r8) :: albsni_improad(num_urbanl,numrad) ! snow albedo for impervious road (diffuse) - real(r8) :: albsnd_perroad(num_urbanl,numrad) ! snow albedo for pervious road (direct) - real(r8) :: albsni_perroad(num_urbanl,numrad) ! snow albedo for pervious road (diffuse) - - integer :: fl,fp,fc,g,l,p,c,ib ! indices - integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - integer :: num_solar ! counter - real(r8) :: alb_roof_dir_s(num_urbanl,numrad) ! direct roof albedo with snow effects - real(r8) :: alb_roof_dif_s(num_urbanl,numrad) ! diffuse roof albedo with snow effects - real(r8) :: alb_improad_dir_s(num_urbanl,numrad) ! direct impervious road albedo with snow effects - real(r8) :: alb_perroad_dir_s(num_urbanl,numrad) ! direct pervious road albedo with snow effects - real(r8) :: alb_improad_dif_s(num_urbanl,numrad) ! diffuse impervious road albedo with snow effects - real(r8) :: alb_perroad_dif_s(num_urbanl,numrad) ! diffuse pervious road albedo with snow effects - real(r8) :: sref_roof_dir(num_urbanl,numrad) ! direct solar reflected by roof per unit ground area per unit incident flux - real(r8) :: sref_roof_dif(num_urbanl,numrad) ! diffuse solar reflected by roof per unit ground area per unit incident flux - real(r8) :: sref_sunwall_dir(num_urbanl,numrad) ! direct solar reflected by sunwall per unit wall area per unit incident flux - real(r8) :: sref_sunwall_dif(num_urbanl,numrad) ! diffuse solar reflected by sunwall per unit wall area per unit incident flux - real(r8) :: sref_shadewall_dir(num_urbanl,numrad) ! direct solar reflected by shadewall per unit wall area per unit incident flux - real(r8) :: sref_shadewall_dif(num_urbanl,numrad) ! diffuse solar reflected by shadewall per unit wall area per unit incident flux - real(r8) :: sref_improad_dir(num_urbanl,numrad) ! direct solar reflected by impervious road per unit ground area per unit incident flux - real(r8) :: sref_improad_dif(num_urbanl,numrad) ! diffuse solar reflected by impervious road per unit ground area per unit incident flux - real(r8) :: sref_perroad_dir(num_urbanl,numrad) ! direct solar reflected by pervious road per unit ground area per unit incident flux - real(r8) :: sref_perroad_dif(num_urbanl,numrad) ! diffuse solar reflected by pervious road per unit ground area per unit incident flux - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width - real(r8), pointer :: wtroad_perv(:) ! weight of pervious road wrt total road - real(r8), pointer :: alb_roof_dir(:,:) ! direct roof albedo - real(r8), pointer :: alb_roof_dif(:,:) ! diffuse roof albedo - real(r8), pointer :: alb_improad_dir(:,:) ! direct impervious road albedo - real(r8), pointer :: alb_perroad_dir(:,:) ! direct pervious road albedo - real(r8), pointer :: alb_improad_dif(:,:) ! diffuse imprevious road albedo - real(r8), pointer :: alb_perroad_dif(:,:) ! diffuse pervious road albedo - real(r8), pointer :: alb_wall_dir(:,:) ! direct wall albedo - real(r8), pointer :: alb_wall_dif(:,:) ! diffuse wall albedo -!----------------------------------------------------------------------- - - ! Assign pointers into module urban clumps - - canyon_hwr => urban_clump(nc)%canyon_hwr - wtroad_perv => urban_clump(nc)%wtroad_perv - alb_roof_dir => urban_clump(nc)%alb_roof_dir - alb_roof_dif => urban_clump(nc)%alb_roof_dif - alb_improad_dir => urban_clump(nc)%alb_improad_dir - alb_improad_dif => urban_clump(nc)%alb_improad_dif - alb_perroad_dir => urban_clump(nc)%alb_perroad_dir - alb_perroad_dif => urban_clump(nc)%alb_perroad_dif - alb_wall_dir => urban_clump(nc)%alb_wall_dir - alb_wall_dif => urban_clump(nc)%alb_wall_dif - - ! Assign gridcell level pointers - - lat => grc%lat - lon => grc%lon - - ! Assign landunit level pointer - - lgridcell => lun%gridcell - coli => lun%coli - colf => lun%colf - vf_sr => lps%vf_sr - vf_wr => lps%vf_wr - vf_sw => lps%vf_sw - vf_rw => lps%vf_rw - vf_ww => lps%vf_ww - sabs_roof_dir => lps%sabs_roof_dir - sabs_roof_dif => lps%sabs_roof_dif - sabs_sunwall_dir => lps%sabs_sunwall_dir - sabs_sunwall_dif => lps%sabs_sunwall_dif - sabs_shadewall_dir => lps%sabs_shadewall_dir - sabs_shadewall_dif => lps%sabs_shadewall_dif - sabs_improad_dir => lps%sabs_improad_dir - sabs_improad_dif => lps%sabs_improad_dif - sabs_perroad_dir => lps%sabs_perroad_dir - sabs_perroad_dif => lps%sabs_perroad_dif - - ! Assign column level pointers - - ctype => col%itype - albgrd => cps%albgrd - albgri => cps%albgri - frac_sno => cps%frac_sno - clandunit => col%landunit - cgridcell => col%gridcell - czen => cps%coszen - - ! Assign pft level pointers - - pgridcell => pft%gridcell - pcolumn => pft%column - albd => pps%albd - albi => pps%albi - fabd => pps%fabd - fabi => pps%fabi - ftdd => pps%ftdd - ftid => pps%ftid - ftii => pps%ftii - fsun => pps%fsun - gdir => pps%gdir - omega => pps%omega - - ! ---------------------------------------------------------------------------- - ! Solar declination and cosine solar zenith angle and zenith angle for - ! next time step - ! ---------------------------------------------------------------------------- - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - coszen(fl) = czen(coli(l)) ! Assumes coszen for each column are the same - zen(fl) = acos(coszen(fl)) - end do - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - g = pgridcell(p) - c = pcolumn(p) - coszen_pft(fp) = czen(c) - end do - - ! ---------------------------------------------------------------------------- - ! Initialize clmtype output since solar radiation is only done if coszen > 0 - ! ---------------------------------------------------------------------------- - - do ib = 1,numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) - - albgrd(c,ib) = 0._r8 - albgri(c,ib) = 0._r8 - end do - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - g = pgridcell(p) - albd(p,ib) = 1._r8 - albi(p,ib) = 1._r8 - fabd(p,ib) = 0._r8 - fabi(p,ib) = 0._r8 - if (coszen_pft(fp) > 0._r8) then - ftdd(p,ib) = 1._r8 - else - ftdd(p,ib) = 0._r8 - end if - ftid(p,ib) = 0._r8 - if (coszen_pft(fp) > 0._r8) then - ftii(p,ib) = 1._r8 - else - ftii(p,ib) = 0._r8 - end if - omega(p,ib) = 0._r8 - if (ib == 1) then - gdir(p) = 0._r8 - fsun(p) = 0._r8 - end if - end do - end do - - ! ---------------------------------------------------------------------------- - ! Urban Code - ! ---------------------------------------------------------------------------- - - num_solar = 0 - do fl = 1,num_urbanl - if (coszen(fl) > 0._r8) num_solar = num_solar + 1 - end do - - ! Initialize urban clump components - - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - sabs_roof_dir(l,ib) = 0._r8 - sabs_roof_dif(l,ib) = 0._r8 - sabs_sunwall_dir(l,ib) = 0._r8 - sabs_sunwall_dif(l,ib) = 0._r8 - sabs_shadewall_dir(l,ib) = 0._r8 - sabs_shadewall_dif(l,ib) = 0._r8 - sabs_improad_dir(l,ib) = 0._r8 - sabs_improad_dif(l,ib) = 0._r8 - sabs_perroad_dir(l,ib) = 0._r8 - sabs_perroad_dif(l,ib) = 0._r8 - sref_roof_dir(fl,ib) = 1._r8 - sref_roof_dif(fl,ib) = 1._r8 - sref_sunwall_dir(fl,ib) = 1._r8 - sref_sunwall_dif(fl,ib) = 1._r8 - sref_shadewall_dir(fl,ib) = 1._r8 - sref_shadewall_dif(fl,ib) = 1._r8 - sref_improad_dir(fl,ib) = 1._r8 - sref_improad_dif(fl,ib) = 1._r8 - sref_perroad_dir(fl,ib) = 1._r8 - sref_perroad_dif(fl,ib) = 1._r8 - end do - end do - - ! View factors for road and one wall in urban canyon (depends only on canyon_hwr) - - if (num_urbanl .gt. 0) then - call view_factor (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr) - end if - - ! ---------------------------------------------------------------------------- - ! Only do the rest if all coszen are positive - ! ---------------------------------------------------------------------------- - - if (num_solar > 0)then - - ! Set constants - solar fluxes are per unit incoming flux - - do ib = 1,numrad - do fl = 1,num_urbanl - sdir(fl,ib) = 1._r8 - sdif(fl,ib) = 1._r8 - end do - end do - - ! Incident direct beam radiation for - ! (a) roof and (b) road and both walls in urban canyon - - if (num_urbanl .gt. 0) then - call incident_direct (lbl, ubl, num_urbanl, canyon_hwr, coszen, zen, sdir, sdir_road, sdir_sunwall, sdir_shadewall) - end if - - ! Incident diffuse radiation for - ! (a) roof and (b) road and both walls in urban canyon. - - if (num_urbanl .gt. 0) then - call incident_diffuse (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr, sdif, sdif_road, & - sdif_sunwall, sdif_shadewall) - end if - - ! Get snow albedos for roof and impervious and pervious road - if (num_urbanl .gt. 0) then - ic = 0; call UrbanSnowAlbedo(lbl, ubl, num_urbanl, filter_urbanl, coszen, ic, albsnd_roof, albsnd_improad, albsnd_perroad) - ic = 1; call UrbanSnowAlbedo(lbl, ubl, num_urbanl, filter_urbanl, coszen, ic, albsni_roof, albsni_improad, albsni_perroad) - end if - - ! Combine snow-free and snow albedos - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - do c = coli(l),colf(l) - if (ctype(c) == icol_roof) then - alb_roof_dir_s(fl,ib) = alb_roof_dir(fl,ib)*(1._r8-frac_sno(c)) & - + albsnd_roof(fl,ib)*frac_sno(c) - alb_roof_dif_s(fl,ib) = alb_roof_dif(fl,ib)*(1._r8-frac_sno(c)) & - + albsni_roof(fl,ib)*frac_sno(c) - else if (ctype(c) == icol_road_imperv) then - alb_improad_dir_s(fl,ib) = alb_improad_dir(fl,ib)*(1._r8-frac_sno(c)) & - + albsnd_improad(fl,ib)*frac_sno(c) - alb_improad_dif_s(fl,ib) = alb_improad_dif(fl,ib)*(1._r8-frac_sno(c)) & - + albsni_improad(fl,ib)*frac_sno(c) - else if (ctype(c) == icol_road_perv) then - alb_perroad_dir_s(fl,ib) = alb_perroad_dir(fl,ib)*(1._r8-frac_sno(c)) & - + albsnd_perroad(fl,ib)*frac_sno(c) - alb_perroad_dif_s(fl,ib) = alb_perroad_dif(fl,ib)*(1._r8-frac_sno(c)) & - + albsni_perroad(fl,ib)*frac_sno(c) - end if - end do - end do - end do - - ! Reflected and absorbed solar radiation per unit incident radiation - ! for road and both walls in urban canyon allowing for multiple reflection - ! Reflected and absorbed solar radiation per unit incident radiation for roof - - if (num_urbanl .gt. 0) then - call net_solar (lbl, ubl, num_urbanl, filter_urbanl, coszen, canyon_hwr, wtroad_perv, sdir, sdif, & - alb_improad_dir_s, alb_perroad_dir_s, alb_wall_dir, alb_roof_dir_s, & - alb_improad_dif_s, alb_perroad_dif_s, alb_wall_dif, alb_roof_dif_s, & - sdir_road, sdir_sunwall, sdir_shadewall, & - sdif_road, sdif_sunwall, sdif_shadewall, & - sref_improad_dir, sref_perroad_dir, sref_sunwall_dir, sref_shadewall_dir, sref_roof_dir, & - sref_improad_dif, sref_perroad_dif, sref_sunwall_dif, sref_shadewall_dif, sref_roof_dif) - end if - - ! ---------------------------------------------------------------------------- - ! Map urban output to clmtype components - ! ---------------------------------------------------------------------------- - - ! Set albgrd and albgri (ground albedos) and albd and albi (surface albedos) - - do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - do c = coli(l),colf(l) - if (ctype(c) == icol_roof) then - albgrd(c,ib) = sref_roof_dir(fl,ib) - albgri(c,ib) = sref_roof_dif(fl,ib) - else if (ctype(c) == icol_sunwall) then - albgrd(c,ib) = sref_sunwall_dir(fl,ib) - albgri(c,ib) = sref_sunwall_dif(fl,ib) - else if (ctype(c) == icol_shadewall) then - albgrd(c,ib) = sref_shadewall_dir(fl,ib) - albgri(c,ib) = sref_shadewall_dif(fl,ib) - else if (ctype(c) == icol_road_perv) then - albgrd(c,ib) = sref_perroad_dir(fl,ib) - albgri(c,ib) = sref_perroad_dif(fl,ib) - else if (ctype(c) == icol_road_imperv) then - albgrd(c,ib) = sref_improad_dir(fl,ib) - albgri(c,ib) = sref_improad_dif(fl,ib) - endif - end do - end do - do fp = 1,num_urbanp - p = filter_urbanp(fp) - c = pcolumn(p) - albd(p,ib) = albgrd(c,ib) - albi(p,ib) = albgri(c,ib) - end do - end do - end if - - end subroutine UrbanAlbedo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanSnowAlbedo -! -! !INTERFACE: - subroutine UrbanSnowAlbedo (lbl, ubl, num_urbanl, filter_urbanl, coszen, ind, & - albsn_roof, albsn_improad, albsn_perroad) -! -! !DESCRIPTION: -! Determine urban snow albedos -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_varcon , only : icol_roof, icol_road_perv, icol_road_imperv -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - integer , intent(in) :: ind ! 0=direct beam, 1=diffuse radiation - real(r8), intent(in) :: coszen(num_urbanl) ! cosine solar zenith angle - real(r8), intent(out):: albsn_roof(num_urbanl,2) ! roof snow albedo by waveband (assume 2 wavebands) - real(r8), intent(out):: albsn_improad(num_urbanl,2) ! impervious road snow albedo by waveband (assume 2 wavebands) - real(r8), intent(out):: albsn_perroad(num_urbanl,2) ! pervious road snow albedo by waveband (assume 2 wavebands) -! -! !CALLED FROM: -! subroutine UrbanAlbedo in this module -! -! !REVISION HISTORY: -! Author: Keith Oleson 9/2005 -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - integer , pointer :: ctype(:) ! column type -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: fl,c,l ! indices -! -! variables and constants for snow albedo calculation -! -! These values are derived from Marshall (1989) assuming soot content of 1.5e-5 -! (three times what LSM uses globally). Note that snow age effects are ignored here. - real(r8), parameter :: snal0 = 0.66_r8 ! vis albedo of urban snow - real(r8), parameter :: snal1 = 0.56_r8 ! nir albedo of urban snow -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (landunit level) - - coli => lun%coli - colf => lun%colf - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - h2osno => cws%h2osno - - ! this code assumes that numrad = 2 , with the following - ! index values: 1 = visible, 2 = NIR - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - do c = coli(l),colf(l) - if (coszen(fl) > 0._r8 .and. h2osno(c) > 0._r8) then - if (ctype(c) == icol_roof) then - albsn_roof(fl,1) = snal0 - albsn_roof(fl,2) = snal1 - else if (ctype(c) == icol_road_imperv) then - albsn_improad(fl,1) = snal0 - albsn_improad(fl,2) = snal1 - else if (ctype(c) == icol_road_perv) then - albsn_perroad(fl,1) = snal0 - albsn_perroad(fl,2) = snal1 - end if - else - if (ctype(c) == icol_roof) then - albsn_roof(fl,1) = 0._r8 - albsn_roof(fl,2) = 0._r8 - else if (ctype(c) == icol_road_imperv) then - albsn_improad(fl,1) = 0._r8 - albsn_improad(fl,2) = 0._r8 - else if (ctype(c) == icol_road_perv) then - albsn_perroad(fl,1) = 0._r8 - albsn_perroad(fl,2) = 0._r8 - end if - end if - end do - end do - - end subroutine UrbanSnowAlbedo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanRadiation -! -! !INTERFACE: - subroutine UrbanRadiation (nc, lbl, ubl, lbc, ubc, lbp, ubp, & - num_nourbanl, filter_nourbanl, & - num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, & - num_urbanp, filter_urbanp) -! -! !DESCRIPTION: -! Solar fluxes absorbed and reflected by roof and canyon (walls, road). -! Also net and upward longwave fluxes. - -! !USES: - use clmtype - use clm_varcon , only : spval, icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv, sb - use clm_varcon , only : tfrz ! To use new constant.. - use clm_time_manager , only : get_curr_date, get_step_size - use clm_atmlnd , only : clm_a2l -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: nc ! clump index - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer , intent(in) :: num_nourbanl ! number of non-urban landunits in clump - integer , intent(in) :: filter_nourbanl(ubl-lbl+1) ! non-urban landunit filter - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban pfts in clump - integer , intent(in) :: filter_urbanp(ubp-lbp+1) ! urban pft filter -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 03/2003, Mariana Vertenstein: Migrated to clm2.2 -! 07/2004, Mariana Vertenstein: Migrated to clm3.0 -! 01/2008, Erik Kluzek: Migrated to clm3.5.15 -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments (urban clump) -! - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width - real(r8), pointer :: wtroad_perv(:) ! weight of pervious road wrt total road - real(r8), pointer :: em_roof(:) ! roof emissivity - real(r8), pointer :: em_improad(:) ! impervious road emissivity - real(r8), pointer :: em_perroad(:) ! pervious road emissivity - real(r8), pointer :: em_wall(:) ! wall emissivity -! -! local pointers to original implicit in arguments (clmtype) -! - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: ctype(:) ! column type - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - integer , pointer :: pfti(:) ! beginning pfti index for landunit - integer , pointer :: pftf(:) ! ending pftf index for landunit - real(r8), pointer :: londeg(:) ! longitude (degrees) - real(r8), pointer :: forc_lwrad(:) ! downward infrared (longwave) radiation (W/m**2) - real(r8), pointer :: forc_solad(:,:) ! direct beam radiation (vis=forc_sols , nir=forc_soll ) (W/m**2) - real(r8), pointer :: forc_solai(:,:) ! diffuse beam radiation (vis=forc_sols , nir=forc_soll ) (W/m**2) - real(r8), pointer :: forc_solar(:) ! incident solar radiation (W/m**2) - real(r8), pointer :: albd(:,:) ! surface albedo (direct) - real(r8), pointer :: albi(:,:) ! surface albedo (diffuse) - real(r8), pointer :: t_grnd(:) ! ground temperature (K) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (K) - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall - real(r8), pointer :: sabs_roof_dir(:,:) ! direct solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_roof_dif(:,:) ! diffuse solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_sunwall_dir(:,:) ! direct solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_sunwall_dif(:,:) ! diffuse solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dir(:,:) ! direct solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dif(:,:) ! diffuse solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_improad_dir(:,:) ! direct solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_improad_dif(:,:) ! diffuse solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dir(:,:) ! direct solar absorbed by pervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dif(:,:) ! diffuse solar absorbed by pervious road per unit ground area per unit incident flux -! -! local pointers to original implicit out arguments (clmtype) -! - real(r8), pointer :: parsun(:) ! average absorbed PAR for sunlit leaves (W/m**2) - real(r8), pointer :: parsha(:) ! average absorbed PAR for shaded leaves (W/m**2) - real(r8), pointer :: sabg(:) ! solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: sabv(:) ! solar radiation absorbed by vegetation (W/m**2) - real(r8), pointer :: fsa(:) ! solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_u(:) ! urban solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsr(:) ! solar radiation reflected (total) (W/m**2) - real(r8), pointer :: fsds_vis_d(:) ! incident direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_d(:) ! incident direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_i(:) ! incident diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_i(:) ! incident diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_d(:) ! reflected direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_d(:) ! reflected direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_i(:) ! reflected diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_i(:) ! reflected diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_d_ln(:) ! incident direct beam vis solar rad at local noon (W/m**2) - real(r8), pointer :: fsds_nir_d_ln(:) ! incident direct beam nir solar rad at local noon (W/m**2) - real(r8), pointer :: fsr_vis_d_ln(:) ! reflected direct beam vis solar rad at local noon (W/m**2) - real(r8), pointer :: fsr_nir_d_ln(:) ! reflected direct beam nir solar rad at local noon (W/m**2) - real(r8), pointer :: eflx_lwrad_out(:) ! emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net(:) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_u(:) ! urban net infrared (longwave) rad (W/m**2) [+ = to atm] -! -! -! !OTHER LOCAL VARIABLES -!EOP -! - integer :: fp,fl,p,c,l,g ! indices - integer :: local_secp1 ! seconds into current date in local time - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day ! temporaries (not used) - integer :: secs ! seconds into current date - - real(r8), parameter :: mpe = 1.e-06_r8 ! prevents overflow for division by zero - real(r8), parameter :: snoem = 0.97_r8 ! snow emissivity (should use value from Biogeophysics1) - - real(r8) :: lwnet_roof(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit ground area), roof (W/m**2) - real(r8) :: lwnet_improad(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit ground area), impervious road (W/m**2) - real(r8) :: lwnet_perroad(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit ground area), pervious road (W/m**2) - real(r8) :: lwnet_sunwall(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit wall area), sunlit wall (W/m**2) - real(r8) :: lwnet_shadewall(num_urbanl)! net (outgoing-incoming) longwave radiation (per unit wall area), shaded wall (W/m**2) - real(r8) :: lwnet_canyon(num_urbanl) ! net (outgoing-incoming) longwave radiation for canyon, per unit ground area (W/m**2) - real(r8) :: lwup_roof(num_urbanl) ! upward longwave radiation (per unit ground area), roof (W/m**2) - real(r8) :: lwup_improad(num_urbanl) ! upward longwave radiation (per unit ground area), impervious road (W/m**2) - real(r8) :: lwup_perroad(num_urbanl) ! upward longwave radiation (per unit ground area), pervious road (W/m**2) - real(r8) :: lwup_sunwall(num_urbanl) ! upward longwave radiation, (per unit wall area), sunlit wall (W/m**2) - real(r8) :: lwup_shadewall(num_urbanl) ! upward longwave radiation, (per unit wall area), shaded wall (W/m**2) - real(r8) :: lwup_canyon(num_urbanl) ! upward longwave radiation for canyon, per unit ground area (W/m**2) - real(r8) :: t_roof(num_urbanl) ! roof temperature (K) - real(r8) :: t_improad(num_urbanl) ! imppervious road temperature (K) - real(r8) :: t_perroad(num_urbanl) ! pervious road temperature (K) - real(r8) :: t_sunwall(num_urbanl) ! sunlit wall temperature (K) - real(r8) :: t_shadewall(num_urbanl) ! shaded wall temperature (K) - real(r8) :: lwdown(num_urbanl) ! atmospheric downward longwave radiation (W/m**2) - real(r8) :: em_roof_s(num_urbanl) ! roof emissivity with snow effects - real(r8) :: em_improad_s(num_urbanl) ! impervious road emissivity with snow effects - real(r8) :: em_perroad_s(num_urbanl) ! pervious road emissivity with snow effects -!----------------------------------------------------------------------- - - ! Assign pointers into module urban clumps - - if( num_urbanl > 0 )then - canyon_hwr => urban_clump(nc)%canyon_hwr - wtroad_perv => urban_clump(nc)%wtroad_perv - em_roof => urban_clump(nc)%em_roof - em_improad => urban_clump(nc)%em_improad - em_perroad => urban_clump(nc)%em_perroad - em_wall => urban_clump(nc)%em_wall - end if - - ! Assign local pointers to multi-level derived type members (gridcell level) - - londeg => grc%londeg - forc_solad => clm_a2l%forc_solad - forc_solai => clm_a2l%forc_solai - forc_solar => clm_a2l%forc_solar - forc_lwrad => clm_a2l%forc_lwrad - - ! Assign local pointers to derived type members (landunit level) - - pfti => lun%pfti - pftf => lun%pftf - coli => lun%coli - colf => lun%colf - lgridcell => lun%gridcell - vf_sr => lps%vf_sr - vf_wr => lps%vf_wr - vf_sw => lps%vf_sw - vf_rw => lps%vf_rw - vf_ww => lps%vf_ww - sabs_roof_dir => lps%sabs_roof_dir - sabs_roof_dif => lps%sabs_roof_dif - sabs_sunwall_dir => lps%sabs_sunwall_dir - sabs_sunwall_dif => lps%sabs_sunwall_dif - sabs_shadewall_dir => lps%sabs_shadewall_dir - sabs_shadewall_dif => lps%sabs_shadewall_dif - sabs_improad_dir => lps%sabs_improad_dir - sabs_improad_dif => lps%sabs_improad_dif - sabs_perroad_dir => lps%sabs_perroad_dir - sabs_perroad_dif => lps%sabs_perroad_dif - - ! Assign local pointers to derived type members (column level) - - ctype => col%itype - t_grnd => ces%t_grnd - frac_sno => cps%frac_sno - - ! Assign local pointers to derived type members (pft level) - - pgridcell => pft%gridcell - pcolumn => pft%column - albd => pps%albd - albi => pps%albi - sabg => pef%sabg - sabv => pef%sabv - fsa => pef%fsa - fsa_u => pef%fsa_u - fsr => pef%fsr - fsds_vis_d => pef%fsds_vis_d - fsds_nir_d => pef%fsds_nir_d - fsds_vis_i => pef%fsds_vis_i - fsds_nir_i => pef%fsds_nir_i - fsr_vis_d => pef%fsr_vis_d - fsr_nir_d => pef%fsr_nir_d - fsr_vis_i => pef%fsr_vis_i - fsr_nir_i => pef%fsr_nir_i - fsds_vis_d_ln => pef%fsds_vis_d_ln - fsds_nir_d_ln => pef%fsds_nir_d_ln - fsr_vis_d_ln => pef%fsr_vis_d_ln - fsr_nir_d_ln => pef%fsr_nir_d_ln - eflx_lwrad_out => pef%eflx_lwrad_out - eflx_lwrad_net => pef%eflx_lwrad_net - eflx_lwrad_net_u => pef%eflx_lwrad_net_u - parsun => pef%parsun - parsha => pef%parsha - t_ref2m => pes%t_ref2m - - ! Define fields that appear on the restart file for non-urban landunits - - do fl = 1,num_nourbanl - l = filter_nourbanl(fl) - sabs_roof_dir(l,:) = spval - sabs_roof_dif(l,:) = spval - sabs_sunwall_dir(l,:) = spval - sabs_sunwall_dif(l,:) = spval - sabs_shadewall_dir(l,:) = spval - sabs_shadewall_dif(l,:) = spval - sabs_improad_dir(l,:) = spval - sabs_improad_dif(l,:) = spval - sabs_perroad_dir(l,:) = spval - sabs_perroad_dif(l,:) = spval - vf_sr(l) = spval - vf_wr(l) = spval - vf_sw(l) = spval - vf_rw(l) = spval - vf_ww(l) = spval - end do - - ! Set input forcing fields - do fl = 1,num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - ! Need to set the following temperatures to some defined value even if it - ! does not appear in the urban landunit for the net_longwave computation - - t_roof(fl) = 19._r8 + tfrz - t_sunwall(fl) = 19._r8 + tfrz - t_shadewall(fl) = 19._r8 + tfrz - t_improad(fl) = 19._r8 + tfrz - t_perroad(fl) = 19._r8 + tfrz - - ! Initial assignment of emissivity - em_roof_s(fl) = em_roof(fl) - em_improad_s(fl) = em_improad(fl) - em_perroad_s(fl) = em_perroad(fl) - - ! Set urban temperatures and emissivity including snow effects. - do c = coli(l),colf(l) - if (ctype(c) == icol_roof ) then - t_roof(fl) = t_grnd(c) - em_roof_s(fl) = em_roof(fl)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_road_imperv) then - t_improad(fl) = t_grnd(c) - em_improad_s(fl) = em_improad(fl)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_road_perv ) then - t_perroad(fl) = t_grnd(c) - em_perroad_s(fl) = em_perroad(fl)*(1._r8-frac_sno(c)) + snoem*frac_sno(c) - else if (ctype(c) == icol_sunwall ) then - t_sunwall(fl) = t_grnd(c) - else if (ctype(c) == icol_shadewall ) then - t_shadewall(fl) = t_grnd(c) - end if - end do - lwdown(fl) = forc_lwrad(g) - end do - - ! Net longwave radiation for road and both walls in urban canyon allowing for multiple re-emission - - if (num_urbanl .gt. 0) then - call net_longwave (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr, wtroad_perv, & - lwdown, em_roof_s, em_improad_s, em_perroad_s, em_wall, & - t_roof, t_improad, t_perroad, t_sunwall, t_shadewall, & - lwnet_roof, lwnet_improad, lwnet_perroad, lwnet_sunwall, lwnet_shadewall, lwnet_canyon, & - lwup_roof, lwup_improad, lwup_perroad, lwup_sunwall, lwup_shadewall, lwup_canyon) - end if - - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Determine clmtype variables needed for history output and communication with atm - ! Loop over urban pfts in clump - - do fp = 1,num_urbanp - p = filter_urbanp(fp) - g = pgridcell(p) - - local_secp1 = secs + nint((londeg(g)/degpsec)/dtime)*dtime - local_secp1 = mod(local_secp1,isecspday) - - ! Solar incident - - fsds_vis_d(p) = forc_solad(g,1) - fsds_nir_d(p) = forc_solad(g,2) - fsds_vis_i(p) = forc_solai(g,1) - fsds_nir_i(p) = forc_solai(g,2) - ! Determine local noon incident solar - if (local_secp1 == noonsec) then - fsds_vis_d_ln(p) = forc_solad(g,1) - fsds_nir_d_ln(p) = forc_solad(g,2) - else - fsds_vis_d_ln(p) = spval - fsds_nir_d_ln(p) = spval - endif - - ! Solar reflected - ! per unit ground area (roof, road) and per unit wall area (sunwall, shadewall) - - fsr_vis_d(p) = albd(p,1) * forc_solad(g,1) - fsr_nir_d(p) = albd(p,2) * forc_solad(g,2) - fsr_vis_i(p) = albi(p,1) * forc_solai(g,1) - fsr_nir_i(p) = albi(p,2) * forc_solai(g,2) - - ! Determine local noon reflected solar - if (local_secp1 == noonsec) then - fsr_vis_d_ln(p) = fsr_vis_d(p) - fsr_nir_d_ln(p) = fsr_nir_d(p) - else - fsr_vis_d_ln(p) = spval - fsr_nir_d_ln(p) = spval - endif - fsr(p) = fsr_vis_d(p) + fsr_nir_d(p) + fsr_vis_i(p) + fsr_nir_i(p) - - end do - - ! Loop over urban landunits in clump - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - ! Solar absorbed and longwave out and net - ! per unit ground area (roof, road) and per unit wall area (sunwall, shadewall) - ! Each urban pft has its own column - this is used in the logic below - - do p = pfti(l), pftf(l) - c = pcolumn(p) - if (ctype(c) == icol_roof) then - eflx_lwrad_out(p) = lwup_roof(fl) - eflx_lwrad_net(p) = lwnet_roof(fl) - eflx_lwrad_net_u(p) = lwnet_roof(fl) - sabg(p) = sabs_roof_dir(l,1)*forc_solad(g,1) + & - sabs_roof_dif(l,1)*forc_solai(g,1) + & - sabs_roof_dir(l,2)*forc_solad(g,2) + & - sabs_roof_dif(l,2)*forc_solai(g,2) - else if (ctype(c) == icol_sunwall) then - eflx_lwrad_out(p) = lwup_sunwall(fl) - eflx_lwrad_net(p) = lwnet_sunwall(fl) - eflx_lwrad_net_u(p) = lwnet_sunwall(fl) - sabg(p) = sabs_sunwall_dir(l,1)*forc_solad(g,1) + & - sabs_sunwall_dif(l,1)*forc_solai(g,1) + & - sabs_sunwall_dir(l,2)*forc_solad(g,2) + & - sabs_sunwall_dif(l,2)*forc_solai(g,2) - else if (ctype(c) == icol_shadewall) then - eflx_lwrad_out(p) = lwup_shadewall(fl) - eflx_lwrad_net(p) = lwnet_shadewall(fl) - eflx_lwrad_net_u(p) = lwnet_shadewall(fl) - sabg(p) = sabs_shadewall_dir(l,1)*forc_solad(g,1) + & - sabs_shadewall_dif(l,1)*forc_solai(g,1) + & - sabs_shadewall_dir(l,2)*forc_solad(g,2) + & - sabs_shadewall_dif(l,2)*forc_solai(g,2) - else if (ctype(c) == icol_road_perv) then - eflx_lwrad_out(p) = lwup_perroad(fl) - eflx_lwrad_net(p) = lwnet_perroad(fl) - eflx_lwrad_net_u(p) = lwnet_perroad(fl) - sabg(p) = sabs_perroad_dir(l,1)*forc_solad(g,1) + & - sabs_perroad_dif(l,1)*forc_solai(g,1) + & - sabs_perroad_dir(l,2)*forc_solad(g,2) + & - sabs_perroad_dif(l,2)*forc_solai(g,2) - else if (ctype(c) == icol_road_imperv) then - eflx_lwrad_out(p) = lwup_improad(fl) - eflx_lwrad_net(p) = lwnet_improad(fl) - eflx_lwrad_net_u(p) = lwnet_improad(fl) - sabg(p) = sabs_improad_dir(l,1)*forc_solad(g,1) + & - sabs_improad_dif(l,1)*forc_solai(g,1) + & - sabs_improad_dir(l,2)*forc_solad(g,2) + & - sabs_improad_dif(l,2)*forc_solai(g,2) - end if - sabv(p) = 0._r8 - fsa(p) = sabv(p) + sabg(p) - fsa_u(p) = fsa(p) - parsun(p) = 0._r8 - parsha(p) = 0._r8 - - end do ! end loop over urban pfts - - end do ! end loop over urban landunits - - end subroutine UrbanRadiation - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: view_factor -! -! !INTERFACE: - subroutine view_factor (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr) - -! -! !DESCRIPTION: -! View factors for road and one wall -! WALL | -! ROAD | -! wall | -! -----\ /----- - - |\----------/ -! | \ vsr / | | r | | \ vww / s -! | \ / | h o w | \ / k -! wall | \ / | wall | a | | \ / y -! |vwr \ / vwr| | d | |vrw \ / vsw -! ------\/------ - - |-----\/----- -! road wall | -! <----- w ----> | -! <---- h --->| -! -! vsr = view factor of sky for road vrw = view factor of road for wall -! vwr = view factor of one wall for road vww = view factor of opposing wall for wall -! vsw = view factor of sky for wall -! vsr + vwr + vwr = 1 vrw + vww + vsw = 1 -! -! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in -! atmospheric models. Boundary-Layer Meteorology 94:357-397 -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - real(r8), intent(in) :: canyon_hwr(num_urbanl) ! ratio of building height to street width -! -! local pointers to original implicit out arguments (clmtype) -! - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall -! -! !CALLED FROM: -! subroutine UrbanAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! 03/2003, Mariana Vertenstein: Migrated to clm2.2 -! 01/2008, Erik Kluzek: Migrated to clm3.5.15 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: l, fl ! indices - real(r8) :: sum ! sum of view factors for wall or road -!----------------------------------------------------------------------- - - ! Assign landunit level pointer - - vf_sr => lps%vf_sr - vf_wr => lps%vf_wr - vf_sw => lps%vf_sw - vf_rw => lps%vf_rw - vf_ww => lps%vf_ww - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - ! road -- sky view factor -> 1 as building height -> 0 - ! and -> 0 as building height -> infinity - - vf_sr(l) = sqrt(canyon_hwr(fl)**2 + 1._r8) - canyon_hwr(fl) - vf_wr(l) = 0.5_r8 * (1._r8 - vf_sr(l)) - - ! one wall -- sky view factor -> 0.5 as building height -> 0 - ! and -> 0 as building height -> infinity - - vf_sw(l) = 0.5_r8 * (canyon_hwr(fl) + 1._r8 - sqrt(canyon_hwr(fl)**2+1._r8)) / canyon_hwr(fl) - vf_rw(l) = vf_sw(l) - vf_ww(l) = 1._r8 - vf_sw(l) - vf_rw(l) - - end do - - - ! error check -- make sure view factor sums to one for road and wall - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - sum = vf_sr(l) + 2._r8*vf_wr(l) - if (abs(sum-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban road view factor error',sum - write (iulog,*) 'clm model is stopping' - call endrun() - endif - sum = vf_sw(l) + vf_rw(l) + vf_ww(l) - if (abs(sum-1._r8) > 1.e-06_r8 ) then - write (iulog,*) 'urban wall view factor error',sum - write (iulog,*) 'clm model is stopping' - call endrun() - endif - - end do - - end subroutine view_factor - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: incident_direct -! -! !INTERFACE: - subroutine incident_direct (lbl, ubl, num_urbanl, canyon_hwr, coszen, zen, sdir, sdir_road, sdir_sunwall, sdir_shadewall) -! -! !DESCRIPTION: -! Direct beam solar radiation incident on walls and road in urban canyon -! -! Sun -! / -! roof / -! ------ /--- - -! | / | | -! sunlit wall | / | shaded wall h -! | / | | -! -----/----- - -! road -! <--- w ---> -! -! Method: -! Road = Horizontal surface. Account for shading by wall. Integrate over all canyon orientations -! Wall (sunlit) = Adjust horizontal radiation for 90 degree surface. Account for shading by opposing wall. -! Integrate over all canyon orientations -! Wall (shaded) = 0 -! -! Conservation check: Total incoming direct beam (sdir) = sdir_road + (sdir_shadewall + sdir_sunwall)*canyon_hwr -! Multiplication by canyon_hwr scales wall fluxes (per unit wall area) to per unit ground area -! -! Source: Masson, V. (2000) A physically-based scheme for the urban energy budget in -! atmospheric models. Boundary-Layer Meteorology 94:357-397 -! -! This analytical solution from Masson (2000) agrees with the numerical solution to -! within 0.6 W/m**2 for sdir = 1000 W/m**2 and for all H/W from 0.1 to 10 by 0.1 -! and all solar zenith angles from 1 to 90 deg by 1 -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon , only : rpi - implicit none -! -! !ARGUMENTS: - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - real(r8), intent(in) :: canyon_hwr(num_urbanl) ! ratio of building height to street width - real(r8), intent(in) :: coszen(num_urbanl) ! cosine solar zenith angle - real(r8), intent(in) :: zen(num_urbanl) ! solar zenith angle (radians) - real(r8), intent(in) :: sdir(num_urbanl, numrad) ! direct beam solar radiation incident on horizontal surface - real(r8), intent(out) :: sdir_road(num_urbanl, numrad) ! direct beam solar radiation incident on road per unit incident flux - real(r8), intent(out) :: sdir_sunwall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8), intent(out) :: sdir_shadewall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux -! -! !CALLED FROM: -! subroutine UrbanAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - integer :: l,i,ib ! indices -!KO logical :: numchk = .true. ! true => perform numerical check of analytical solution - logical :: numchk = .false. ! true => perform numerical check of analytical solution - real(r8) :: theta0(num_urbanl) ! critical canyon orientation for which road is no longer illuminated - real(r8) :: tanzen(num_urbanl) ! tan(zenith angle) - real(r8) :: swall_projected ! direct beam solar radiation (per unit ground area) incident on wall - real(r8) :: err1(num_urbanl) ! energy conservation error - real(r8) :: err2(num_urbanl) ! energy conservation error - real(r8) :: err3(num_urbanl) ! energy conservation error - real(r8) :: sumr ! sum of sroad for each orientation (0 <= theta <= pi/2) - real(r8) :: sumw ! sum of swall for each orientation (0 <= theta <= pi/2) - real(r8) :: num ! number of orientations - real(r8) :: theta ! canyon orientation relative to sun (0 <= theta <= pi/2) - real(r8) :: zen0 ! critical solar zenith angle for which sun begins to illuminate road -!----------------------------------------------------------------------- - - do l = 1,num_urbanl - if (coszen(l) > 0._r8) then - theta0(l) = asin(min( (1._r8/(canyon_hwr(l)*tan(max(zen(l),0.000001_r8)))), 1._r8 )) - tanzen(l) = tan(zen(l)) - end if - end do - - do ib = 1,numrad - - do l = 1,num_urbanl - if (coszen(l) > 0._r8) then - sdir_shadewall(l,ib) = 0._r8 - - ! incident solar radiation on wall and road integrated over all canyon orientations (0 <= theta <= pi/2) - - sdir_road(l,ib) = sdir(l,ib) * & - (2._r8*theta0(l)/rpi - 2./rpi*canyon_hwr(l)*tanzen(l)*(1._r8-cos(theta0(l)))) - sdir_sunwall(l,ib) = 2._r8 * sdir(l,ib) * ((1._r8/canyon_hwr(l))* & - (0.5_r8-theta0(l)/rpi) + (1._r8/rpi)*tanzen(l)*(1._r8-cos(theta0(l)))) - - ! conservation check for road and wall. need to use wall fluxes converted to ground area - - swall_projected = (sdir_shadewall(l,ib) + sdir_sunwall(l,ib)) * canyon_hwr(l) - err1(l) = sdir(l,ib) - (sdir_road(l,ib) + swall_projected) - else - sdir_road(l,ib) = 0._r8 - sdir_sunwall(l,ib) = 0._r8 - sdir_shadewall(l,ib) = 0._r8 - endif - end do - - do l = 1,num_urbanl - if (coszen(l) > 0._r8) then - if (abs(err1(l)) > 0.001_r8) then - write (iulog,*) 'urban direct beam solar radiation balance error',err1(l) - write (iulog,*) 'clm model is stopping' - call endrun() - endif - endif - end do - - ! numerical check of analytical solution - ! sum sroad and swall over all canyon orientations (0 <= theta <= pi/2) - - if (numchk) then - do l = 1,num_urbanl - if (coszen(l) > 0._r8) then - sumr = 0._r8 - sumw = 0._r8 - num = 0._r8 - do i = 1, 9000 - theta = i/100._r8 * rpi/180._r8 - zen0 = atan(1._r8/(canyon_hwr(l)*sin(theta))) - if (zen(l) >= zen0) then - sumr = sumr + 0._r8 - sumw = sumw + sdir(l,ib) / canyon_hwr(l) - else - sumr = sumr + sdir(l,ib) * (1._r8-canyon_hwr(l)*sin(theta)*tanzen(l)) - sumw = sumw + sdir(l,ib) * sin(theta)*tanzen(l) - end if - num = num + 1._r8 - end do - err2(l) = sumr/num - sdir_road(l,ib) - err3(l) = sumw/num - sdir_sunwall(l,ib) - endif - end do - do l = 1,num_urbanl - if (coszen(l) > 0._r8) then - if (abs(err2(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) - write (iulog,*) 'clm model is stopping' - call endrun - endif - if (abs(err3(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban wall incident direct beam solar radiation error',err3(l) - write (iulog,*) 'clm model is stopping' - call endrun - end if - end if - end do - end if - - end do - - end subroutine incident_direct - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: incident_diffuse -! -! !INTERFACE: - subroutine incident_diffuse (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr, sdif, sdif_road, sdif_sunwall, sdif_shadewall) -! -! !DESCRIPTION: -! Diffuse solar radiation incident on walls and road in urban canyon -! Conservation check: Total incoming diffuse -! (sdif) = sdif_road + (sdif_shadewall + sdif_sunwall)*canyon_hwr -! Multiplication by canyon_hwr scales wall fluxes (per unit wall area) to per unit ground area -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype -! -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - real(r8), intent(in) :: canyon_hwr(num_urbanl) ! ratio of building height to street width - real(r8), intent(in) :: sdif(num_urbanl, numrad) ! diffuse solar radiation incident on horizontal surface - real(r8), intent(out) :: sdif_road(num_urbanl, numrad) ! diffuse solar radiation incident on road - real(r8), intent(out) :: sdif_sunwall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on sunlit wall - real(r8), intent(out) :: sdif_shadewall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on shaded wall -! -! local pointers to original implicit in arguments (clmtype) -! - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall -! -! !CALLED FROM: -! subroutine UrbanAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - integer :: l, fl, ib ! indices - real(r8) :: err(num_urbanl) ! energy conservation error (W/m**2) - real(r8) :: swall_projected ! diffuse solar radiation (per unit ground area) incident on wall (W/m**2) -!----------------------------------------------------------------------- - - ! Assign landunit level pointer - - vf_sr => lps%vf_sr - vf_sw => lps%vf_sw - - do ib = 1, numrad - - ! diffuse solar and conservation check. need to convert wall fluxes to ground area - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - sdif_road(fl,ib) = sdif(fl,ib) * vf_sr(l) - sdif_sunwall(fl,ib) = sdif(fl,ib) * vf_sw(l) - sdif_shadewall(fl,ib) = sdif(fl,ib) * vf_sw(l) - - swall_projected = (sdif_shadewall(fl,ib) + sdif_sunwall(fl,ib)) * canyon_hwr(fl) - err(fl) = sdif(fl,ib) - (sdif_road(fl,ib) + swall_projected) - end do - - ! error check - - do l = 1, num_urbanl - if (abs(err(l)) > 0.001_r8) then - write (iulog,*) 'urban diffuse solar radiation balance error',err(l) - write (iulog,*) 'clm model is stopping' - call endrun - endif - end do - - end do - - end subroutine incident_diffuse - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: net_solar -! -! !INTERFACE: - subroutine net_solar (lbl, ubl, num_urbanl, filter_urbanl, coszen, canyon_hwr, wtroad_perv, sdir, sdif, & - alb_improad_dir, alb_perroad_dir, alb_wall_dir, alb_roof_dir, & - alb_improad_dif, alb_perroad_dif, alb_wall_dif, alb_roof_dif, & - sdir_road, sdir_sunwall, sdir_shadewall, & - sdif_road, sdif_sunwall, sdif_shadewall, & - sref_improad_dir, sref_perroad_dir, sref_sunwall_dir, sref_shadewall_dir, sref_roof_dir, & - sref_improad_dif, sref_perroad_dif, sref_sunwall_dif, sref_shadewall_dif, sref_roof_dif) -! -! !DESCRIPTION: -! Solar radiation absorbed by road and both walls in urban canyon allowing -! for multiple reflection. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype -! -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - real(r8), intent(in) :: coszen(num_urbanl) ! cosine solar zenith angle - real(r8), intent(in) :: canyon_hwr(num_urbanl) ! ratio of building height to street width - real(r8), intent(in) :: wtroad_perv(num_urbanl) ! weight of pervious road wrt total road - real(r8), intent(in) :: sdir(num_urbanl, numrad) ! direct beam solar radiation incident on horizontal surface - real(r8), intent(in) :: sdif(num_urbanl, numrad) ! diffuse solar radiation on horizontal surface - real(r8), intent(in) :: alb_improad_dir(num_urbanl, numrad) ! direct impervious road albedo - real(r8), intent(in) :: alb_perroad_dir(num_urbanl, numrad) ! direct pervious road albedo - real(r8), intent(in) :: alb_wall_dir(num_urbanl, numrad) ! direct wall albedo - real(r8), intent(in) :: alb_roof_dir(num_urbanl, numrad) ! direct roof albedo - real(r8), intent(in) :: alb_improad_dif(num_urbanl, numrad) ! diffuse impervious road albedo - real(r8), intent(in) :: alb_perroad_dif(num_urbanl, numrad) ! diffuse pervious road albedo - real(r8), intent(in) :: alb_wall_dif(num_urbanl, numrad) ! diffuse wall albedo - real(r8), intent(in) :: alb_roof_dif(num_urbanl, numrad) ! diffuse roof albedo - real(r8), intent(in) :: sdir_road(num_urbanl, numrad) ! direct beam solar radiation incident on road per unit incident flux - real(r8), intent(in) :: sdir_sunwall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8), intent(in) :: sdir_shadewall(num_urbanl, numrad) ! direct beam solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8), intent(in) :: sdif_road(num_urbanl, numrad) ! diffuse solar radiation incident on road per unit incident flux - real(r8), intent(in) :: sdif_sunwall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on sunlit wall per unit incident flux - real(r8), intent(in) :: sdif_shadewall(num_urbanl, numrad) ! diffuse solar radiation (per unit wall area) incident on shaded wall per unit incident flux - real(r8), intent(inout) :: sref_improad_dir(num_urbanl, numrad) ! direct solar rad reflected by impervious road (per unit ground area) per unit incident flux - real(r8), intent(inout) :: sref_perroad_dir(num_urbanl, numrad) ! direct solar rad reflected by pervious road (per unit ground area) per unit incident flux - real(r8), intent(inout) :: sref_improad_dif(num_urbanl, numrad) ! diffuse solar rad reflected by impervious road (per unit ground area) per unit incident flux - real(r8), intent(inout) :: sref_perroad_dif(num_urbanl, numrad) ! diffuse solar rad reflected by pervious road (per unit ground area) per unit incident flux - real(r8), intent(inout) :: sref_sunwall_dir(num_urbanl, numrad) ! direct solar rad reflected by sunwall (per unit wall area) per unit incident flux - real(r8), intent(inout) :: sref_sunwall_dif(num_urbanl, numrad) ! diffuse solar rad reflected by sunwall (per unit wall area) per unit incident flux - real(r8), intent(inout) :: sref_shadewall_dir(num_urbanl, numrad) ! direct solar rad reflected by shadewall (per unit wall area) per unit incident flux - real(r8), intent(inout) :: sref_shadewall_dif(num_urbanl, numrad) ! diffuse solar rad reflected by shadewall (per unit wall area) per unit incident flux - real(r8), intent(inout) :: sref_roof_dir(num_urbanl, numrad) ! direct solar rad reflected by roof (per unit ground area) per unit incident flux - real(r8), intent(inout) :: sref_roof_dif(num_urbanl, numrad) ! diffuse solar rad reflected by roof (per unit ground area) per unit incident flux -! -! local pointers to original implicit in arguments (clmtype) -! - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall - real(r8), pointer :: sabs_roof_dir(:,:) ! direct solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_roof_dif(:,:) ! diffuse solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_sunwall_dir(:,:) ! direct solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_sunwall_dif(:,:) ! diffuse solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dir(:,:) ! direct solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dif(:,:) ! diffuse solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_improad_dir(:,:) ! direct solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_improad_dif(:,:) ! diffuse solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dir(:,:) ! direct solar absorbed by pervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dif(:,:) ! diffuse solar absorbed by pervious road per unit ground area per unit incident flux -! -! !CALLED FROM: -! subroutine UrbanAlbedo in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! -! -! !LOCAL VARIABLES -!EOP -! - real(r8) :: wtroad_imperv(num_urbanl) ! weight of impervious road wrt total road - real(r8) :: sabs_canyon_dir(num_urbanl) ! direct solar rad absorbed by canyon per unit incident flux - real(r8) :: sabs_canyon_dif(num_urbanl) ! diffuse solar rad absorbed by canyon per unit incident flux - real(r8) :: sref_canyon_dir(num_urbanl) ! direct solar reflected by canyon per unit incident flux - real(r8) :: sref_canyon_dif(num_urbanl) ! diffuse solar reflected by canyon per unit incident flux - - real(r8) :: improad_a_dir(num_urbanl) ! absorbed direct solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_a_dif(num_urbanl) ! absorbed diffuse solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_dir(num_urbanl) ! reflected direct solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_dif(num_urbanl) ! reflected diffuse solar for impervious road after "n" reflections per unit incident flux - real(r8) :: improad_r_sky_dir(num_urbanl) ! improad_r_dir to sky per unit incident flux - real(r8) :: improad_r_sunwall_dir(num_urbanl) ! improad_r_dir to sunlit wall per unit incident flux - real(r8) :: improad_r_shadewall_dir(num_urbanl) ! improad_r_dir to shaded wall per unit incident flux - real(r8) :: improad_r_sky_dif(num_urbanl) ! improad_r_dif to sky per unit incident flux - real(r8) :: improad_r_sunwall_dif(num_urbanl) ! improad_r_dif to sunlit wall per unit incident flux - real(r8) :: improad_r_shadewall_dif(num_urbanl) ! improad_r_dif to shaded wall per unit incident flux - - real(r8) :: perroad_a_dir(num_urbanl) ! absorbed direct solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_a_dif(num_urbanl) ! absorbed diffuse solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_dir(num_urbanl) ! reflected direct solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_dif(num_urbanl) ! reflected diffuse solar for pervious road after "n" reflections per unit incident flux - real(r8) :: perroad_r_sky_dir(num_urbanl) ! perroad_r_dir to sky per unit incident flux - real(r8) :: perroad_r_sunwall_dir(num_urbanl) ! perroad_r_dir to sunlit wall per unit incident flux - real(r8) :: perroad_r_shadewall_dir(num_urbanl) ! perroad_r_dir to shaded wall per unit incident flux - real(r8) :: perroad_r_sky_dif(num_urbanl) ! perroad_r_dif to sky per unit incident flux - real(r8) :: perroad_r_sunwall_dif(num_urbanl) ! perroad_r_dif to sunlit wall per unit incident flux - real(r8) :: perroad_r_shadewall_dif(num_urbanl) ! perroad_r_dif to shaded wall per unit incident flux - - real(r8) :: road_a_dir(num_urbanl) ! absorbed direct solar for total road after "n" reflections per unit incident flux - real(r8) :: road_a_dif(num_urbanl) ! absorbed diffuse solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_dir(num_urbanl) ! reflected direct solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_dif(num_urbanl) ! reflected diffuse solar for total road after "n" reflections per unit incident flux - real(r8) :: road_r_sky_dir(num_urbanl) ! road_r_dir to sky per unit incident flux - real(r8) :: road_r_sunwall_dir(num_urbanl) ! road_r_dir to sunlit wall per unit incident flux - real(r8) :: road_r_shadewall_dir(num_urbanl) ! road_r_dir to shaded wall per unit incident flux - real(r8) :: road_r_sky_dif(num_urbanl) ! road_r_dif to sky per unit incident flux - real(r8) :: road_r_sunwall_dif(num_urbanl) ! road_r_dif to sunlit wall per unit incident flux - real(r8) :: road_r_shadewall_dif(num_urbanl) ! road_r_dif to shaded wall per unit incident flux - - real(r8) :: sunwall_a_dir(num_urbanl) ! absorbed direct solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_a_dif(num_urbanl) ! absorbed diffuse solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_dir(num_urbanl) ! reflected direct solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_dif(num_urbanl) ! reflected diffuse solar for sunlit wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: sunwall_r_sky_dir(num_urbanl) ! sunwall_r_dir to sky per unit incident flux - real(r8) :: sunwall_r_road_dir(num_urbanl) ! sunwall_r_dir to road per unit incident flux - real(r8) :: sunwall_r_shadewall_dir(num_urbanl) ! sunwall_r_dir to opposing (shaded) wall per unit incident flux - real(r8) :: sunwall_r_sky_dif(num_urbanl) ! sunwall_r_dif to sky per unit incident flux - real(r8) :: sunwall_r_road_dif(num_urbanl) ! sunwall_r_dif to road per unit incident flux - real(r8) :: sunwall_r_shadewall_dif(num_urbanl) ! sunwall_r_dif to opposing (shaded) wall per unit incident flux - - real(r8) :: shadewall_a_dir(num_urbanl) ! absorbed direct solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_a_dif(num_urbanl) ! absorbed diffuse solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_dir(num_urbanl) ! reflected direct solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_dif(num_urbanl) ! reflected diffuse solar for shaded wall (per unit wall area) after "n" reflections per unit incident flux - real(r8) :: shadewall_r_sky_dir(num_urbanl) ! shadewall_r_dir to sky per unit incident flux - real(r8) :: shadewall_r_road_dir(num_urbanl) ! shadewall_r_dir to road per unit incident flux - real(r8) :: shadewall_r_sunwall_dir(num_urbanl) ! shadewall_r_dir to opposing (sunlit) wall per unit incident flux - real(r8) :: shadewall_r_sky_dif(num_urbanl) ! shadewall_r_dif to sky per unit incident flux - real(r8) :: shadewall_r_road_dif(num_urbanl) ! shadewall_r_dif to road per unit incident flux - real(r8) :: shadewall_r_sunwall_dif(num_urbanl) ! shadewall_r_dif to opposing (sunlit) wall per unit incident flux - - real(r8) :: canyon_alb_dir(num_urbanl) ! direct canyon albedo - real(r8) :: canyon_alb_dif(num_urbanl) ! diffuse canyon albedo - - real(r8) :: stot(num_urbanl) ! sum of radiative terms - real(r8) :: stot_dir(num_urbanl) ! sum of direct radiative terms - real(r8) :: stot_dif(num_urbanl) ! sum of diffuse radiative terms - - integer :: l,fl,ib ! indices - integer :: iter_dir,iter_dif ! iteration counter - real(r8) :: crit ! convergence criterion - real(r8) :: err ! energy conservation error - integer :: pass - integer, parameter :: n = 50 ! number of interations - real(r8) :: sabs_road ! temporary for absorption over road - real(r8) :: sref_road ! temporary for reflected over road - real(r8), parameter :: errcrit = .00001_r8 ! error criteria -!----------------------------------------------------------------------- - - ! Assign landunit level pointer - - vf_sr => lps%vf_sr - vf_wr => lps%vf_wr - vf_sw => lps%vf_sw - vf_rw => lps%vf_rw - vf_ww => lps%vf_ww - sabs_roof_dir => lps%sabs_roof_dir - sabs_roof_dif => lps%sabs_roof_dif - sabs_sunwall_dir => lps%sabs_sunwall_dir - sabs_sunwall_dif => lps%sabs_sunwall_dif - sabs_shadewall_dir => lps%sabs_shadewall_dir - sabs_shadewall_dif => lps%sabs_shadewall_dif - sabs_improad_dir => lps%sabs_improad_dir - sabs_improad_dif => lps%sabs_improad_dif - sabs_perroad_dir => lps%sabs_perroad_dir - sabs_perroad_dif => lps%sabs_perroad_dif - - ! Calculate impervious road - - do l = 1,num_urbanl - wtroad_imperv(l) = 1._r8 - wtroad_perv(l) - end do - - do ib = 1,numrad - do fl = 1,num_urbanl - if (coszen(fl) .gt. 0._r8) then - l = filter_urbanl(fl) - - ! initial absorption and reflection for road and both walls. - ! distribute reflected radiation to sky, road, and walls - ! according to appropriate view factor. radiation reflected to - ! road and walls will undergo multiple reflections within the canyon. - ! do separately for direct beam and diffuse radiation. - - ! direct beam - - road_a_dir(fl) = 0.0_r8 - road_r_dir(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_a_dir(fl) = (1._r8-alb_improad_dir(fl,ib)) * sdir_road(fl,ib) - improad_r_dir(fl) = alb_improad_dir(fl,ib) * sdir_road(fl,ib) - improad_r_sky_dir(fl) = improad_r_dir(fl) * vf_sr(l) - improad_r_sunwall_dir(fl) = improad_r_dir(fl) * vf_wr(l) - improad_r_shadewall_dir(fl) = improad_r_dir(fl) * vf_wr(l) - road_a_dir(fl) = road_a_dir(fl) + improad_a_dir(fl)*wtroad_imperv(fl) - road_r_dir(fl) = road_r_dir(fl) + improad_r_dir(fl)*wtroad_imperv(fl) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_a_dir(fl) = (1._r8-alb_perroad_dir(fl,ib)) * sdir_road(fl,ib) - perroad_r_dir(fl) = alb_perroad_dir(fl,ib) * sdir_road(fl,ib) - perroad_r_sky_dir(fl) = perroad_r_dir(fl) * vf_sr(l) - perroad_r_sunwall_dir(fl) = perroad_r_dir(fl) * vf_wr(l) - perroad_r_shadewall_dir(fl) = perroad_r_dir(fl) * vf_wr(l) - road_a_dir(fl) = road_a_dir(fl) + perroad_a_dir(fl)*wtroad_perv(fl) - road_r_dir(fl) = road_r_dir(fl) + perroad_r_dir(fl)*wtroad_perv(fl) - end if - - road_r_sky_dir(fl) = road_r_dir(fl) * vf_sr(l) - road_r_sunwall_dir(fl) = road_r_dir(fl) * vf_wr(l) - road_r_shadewall_dir(fl) = road_r_dir(fl) * vf_wr(l) - - sunwall_a_dir(fl) = (1._r8-alb_wall_dir(fl,ib)) * sdir_sunwall(fl,ib) - sunwall_r_dir(fl) = alb_wall_dir(fl,ib) * sdir_sunwall(fl,ib) - sunwall_r_sky_dir(fl) = sunwall_r_dir(fl) * vf_sw(l) - sunwall_r_road_dir(fl) = sunwall_r_dir(fl) * vf_rw(l) - sunwall_r_shadewall_dir(fl) = sunwall_r_dir(fl) * vf_ww(l) - - shadewall_a_dir(fl) = (1._r8-alb_wall_dir(fl,ib)) * sdir_shadewall(fl,ib) - shadewall_r_dir(fl) = alb_wall_dir(fl,ib) * sdir_shadewall(fl,ib) - shadewall_r_sky_dir(fl) = shadewall_r_dir(fl) * vf_sw(l) - shadewall_r_road_dir(fl) = shadewall_r_dir(fl) * vf_rw(l) - shadewall_r_sunwall_dir(fl) = shadewall_r_dir(fl) * vf_ww(l) - - ! diffuse - - road_a_dif(fl) = 0.0_r8 - road_r_dif(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_a_dif(fl) = (1._r8-alb_improad_dif(fl,ib)) * sdif_road(fl,ib) - improad_r_dif(fl) = alb_improad_dif(fl,ib) * sdif_road(fl,ib) - improad_r_sky_dif(fl) = improad_r_dif(fl) * vf_sr(l) - improad_r_sunwall_dif(fl) = improad_r_dif(fl) * vf_wr(l) - improad_r_shadewall_dif(fl) = improad_r_dif(fl) * vf_wr(l) - road_a_dif(fl) = road_a_dif(fl) + improad_a_dif(fl)*wtroad_imperv(fl) - road_r_dif(fl) = road_r_dif(fl) + improad_r_dif(fl)*wtroad_imperv(fl) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_a_dif(fl) = (1._r8-alb_perroad_dif(fl,ib)) * sdif_road(fl,ib) - perroad_r_dif(fl) = alb_perroad_dif(fl,ib) * sdif_road(fl,ib) - perroad_r_sky_dif(fl) = perroad_r_dif(fl) * vf_sr(l) - perroad_r_sunwall_dif(fl) = perroad_r_dif(fl) * vf_wr(l) - perroad_r_shadewall_dif(fl) = perroad_r_dif(fl) * vf_wr(l) - road_a_dif(fl) = road_a_dif(fl) + perroad_a_dif(fl)*wtroad_perv(fl) - road_r_dif(fl) = road_r_dif(fl) + perroad_r_dif(fl)*wtroad_perv(fl) - end if - - road_r_sky_dif(fl) = road_r_dif(fl) * vf_sr(l) - road_r_sunwall_dif(fl) = road_r_dif(fl) * vf_wr(l) - road_r_shadewall_dif(fl) = road_r_dif(fl) * vf_wr(l) - - sunwall_a_dif(fl) = (1._r8-alb_wall_dif(fl,ib)) * sdif_sunwall(fl,ib) - sunwall_r_dif(fl) = alb_wall_dif(fl,ib) * sdif_sunwall(fl,ib) - sunwall_r_sky_dif(fl) = sunwall_r_dif(fl) * vf_sw(l) - sunwall_r_road_dif(fl) = sunwall_r_dif(fl) * vf_rw(l) - sunwall_r_shadewall_dif(fl) = sunwall_r_dif(fl) * vf_ww(l) - - shadewall_a_dif(fl) = (1._r8-alb_wall_dif(fl,ib)) * sdif_shadewall(fl,ib) - shadewall_r_dif(fl) = alb_wall_dif(fl,ib) * sdif_shadewall(fl,ib) - shadewall_r_sky_dif(fl) = shadewall_r_dif(fl) * vf_sw(l) - shadewall_r_road_dif(fl) = shadewall_r_dif(fl) * vf_rw(l) - shadewall_r_sunwall_dif(fl) = shadewall_r_dif(fl) * vf_ww(l) - - ! initialize sum of direct and diffuse solar absorption and reflection for road and both walls - - if ( wtroad_imperv(fl) > 0.0_r8 ) sabs_improad_dir(l,ib) = improad_a_dir(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sabs_perroad_dir(l,ib) = perroad_a_dir(fl) - sabs_sunwall_dir(l,ib) = sunwall_a_dir(fl) - sabs_shadewall_dir(l,ib) = shadewall_a_dir(fl) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sabs_improad_dif(l,ib) = improad_a_dif(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sabs_perroad_dif(l,ib) = perroad_a_dif(fl) - sabs_sunwall_dif(l,ib) = sunwall_a_dif(fl) - sabs_shadewall_dif(l,ib) = shadewall_a_dif(fl) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sref_improad_dir(fl,ib) = improad_r_sky_dir(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sref_perroad_dir(fl,ib) = perroad_r_sky_dir(fl) - sref_sunwall_dir(fl,ib) = sunwall_r_sky_dir(fl) - sref_shadewall_dir(fl,ib) = shadewall_r_sky_dir(fl) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sref_improad_dif(fl,ib) = improad_r_sky_dif(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sref_perroad_dif(fl,ib) = perroad_r_sky_dif(fl) - sref_sunwall_dif(fl,ib) = sunwall_r_sky_dif(fl) - sref_shadewall_dif(fl,ib) = shadewall_r_sky_dif(fl) - endif - - end do - - ! absorption and reflection for walls and road with multiple reflections - ! (i.e., absorb and reflect initial reflection in canyon and allow for - ! subsequent scattering) - ! - ! (1) absorption and reflection of scattered solar radiation - ! road: reflected fluxes from walls need to be projected to ground area - ! wall: reflected flux from road needs to be projected to wall area - ! - ! (2) add absorbed radiation for ith reflection to total absorbed - ! - ! (3) distribute reflected radiation to sky, road, and walls according to view factors - ! - ! (4) add solar reflection to sky for ith reflection to total reflection - ! - ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. - ! small convergence criteria is required to ensure solar radiation is conserved - ! - ! do separately for direct beam and diffuse - - do fl = 1,num_urbanl - if (coszen(fl) .gt. 0._r8) then - l = filter_urbanl(fl) - - ! reflected direct beam - - do iter_dir = 1, n - ! step (1) - - stot(fl) = (sunwall_r_road_dir(fl) + shadewall_r_road_dir(fl))*canyon_hwr(fl) - - road_a_dir(fl) = 0.0_r8 - road_r_dir(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_a_dir(fl) = (1._r8-alb_improad_dir(fl,ib)) * stot(fl) - improad_r_dir(fl) = alb_improad_dir(fl,ib) * stot(fl) - road_a_dir(fl) = road_a_dir(fl) + improad_a_dir(fl)*wtroad_imperv(fl) - road_r_dir(fl) = road_r_dir(fl) + improad_r_dir(fl)*wtroad_imperv(fl) - end if - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_a_dir(fl) = (1._r8-alb_perroad_dir(fl,ib)) * stot(fl) - perroad_r_dir(fl) = alb_perroad_dir(fl,ib) * stot(fl) - road_a_dir(fl) = road_a_dir(fl) + perroad_a_dir(fl)*wtroad_perv(fl) - road_r_dir(fl) = road_r_dir(fl) + perroad_r_dir(fl)*wtroad_perv(fl) - end if - - stot(fl) = road_r_sunwall_dir(fl)/canyon_hwr(fl) + shadewall_r_sunwall_dir(fl) - sunwall_a_dir(fl) = (1._r8-alb_wall_dir(fl,ib)) * stot(fl) - sunwall_r_dir(fl) = alb_wall_dir(fl,ib) * stot(fl) - - stot(fl) = road_r_shadewall_dir(fl)/canyon_hwr(fl) + sunwall_r_shadewall_dir(fl) - shadewall_a_dir(fl) = (1._r8-alb_wall_dir(fl,ib)) * stot(fl) - shadewall_r_dir(fl) = alb_wall_dir(fl,ib) * stot(fl) - - ! step (2) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sabs_improad_dir(l,ib) = sabs_improad_dir(l,ib) + improad_a_dir(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sabs_perroad_dir(l,ib) = sabs_perroad_dir(l,ib) + perroad_a_dir(fl) - sabs_sunwall_dir(l,ib) = sabs_sunwall_dir(l,ib) + sunwall_a_dir(fl) - sabs_shadewall_dir(l,ib) = sabs_shadewall_dir(l,ib) + shadewall_a_dir(fl) - - ! step (3) - - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_r_sky_dir(fl) = improad_r_dir(fl) * vf_sr(l) - improad_r_sunwall_dir(fl) = improad_r_dir(fl) * vf_wr(l) - improad_r_shadewall_dir(fl) = improad_r_dir(fl) * vf_wr(l) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_r_sky_dir(fl) = perroad_r_dir(fl) * vf_sr(l) - perroad_r_sunwall_dir(fl) = perroad_r_dir(fl) * vf_wr(l) - perroad_r_shadewall_dir(fl) = perroad_r_dir(fl) * vf_wr(l) - end if - - road_r_sky_dir(fl) = road_r_dir(fl) * vf_sr(l) - road_r_sunwall_dir(fl) = road_r_dir(fl) * vf_wr(l) - road_r_shadewall_dir(fl) = road_r_dir(fl) * vf_wr(l) - - sunwall_r_sky_dir(fl) = sunwall_r_dir(fl) * vf_sw(l) - sunwall_r_road_dir(fl) = sunwall_r_dir(fl) * vf_rw(l) - sunwall_r_shadewall_dir(fl) = sunwall_r_dir(fl) * vf_ww(l) - - shadewall_r_sky_dir(fl) = shadewall_r_dir(fl) * vf_sw(l) - shadewall_r_road_dir(fl) = shadewall_r_dir(fl) * vf_rw(l) - shadewall_r_sunwall_dir(fl) = shadewall_r_dir(fl) * vf_ww(l) - - ! step (4) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sref_improad_dir(fl,ib) = sref_improad_dir(fl,ib) + improad_r_sky_dir(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sref_perroad_dir(fl,ib) = sref_perroad_dir(fl,ib) + perroad_r_sky_dir(fl) - sref_sunwall_dir(fl,ib) = sref_sunwall_dir(fl,ib) + sunwall_r_sky_dir(fl) - sref_shadewall_dir(fl,ib) = sref_shadewall_dir(fl,ib) + shadewall_r_sky_dir(fl) - - ! step (5) - - crit = max(road_a_dir(fl), sunwall_a_dir(fl), shadewall_a_dir(fl)) - if (crit < errcrit) exit - end do - if (iter_dir >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, direct beam' - write (iulog,*) 'clm model is stopping' - call endrun - endif - - ! reflected diffuse - - do iter_dif = 1, n - ! step (1) - - stot(fl) = (sunwall_r_road_dif(fl) + shadewall_r_road_dif(fl))*canyon_hwr(fl) - road_a_dif(fl) = 0.0_r8 - road_r_dif(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_a_dif(fl) = (1._r8-alb_improad_dif(fl,ib)) * stot(fl) - improad_r_dif(fl) = alb_improad_dif(fl,ib) * stot(fl) - road_a_dif(fl) = road_a_dif(fl) + improad_a_dif(fl)*wtroad_imperv(fl) - road_r_dif(fl) = road_r_dif(fl) + improad_r_dif(fl)*wtroad_imperv(fl) - end if - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_a_dif(fl) = (1._r8-alb_perroad_dif(fl,ib)) * stot(fl) - perroad_r_dif(fl) = alb_perroad_dif(fl,ib) * stot(fl) - road_a_dif(fl) = road_a_dif(fl) + perroad_a_dif(fl)*wtroad_perv(fl) - road_r_dif(fl) = road_r_dif(fl) + perroad_r_dif(fl)*wtroad_perv(fl) - end if - - stot(fl) = road_r_sunwall_dif(fl)/canyon_hwr(fl) + shadewall_r_sunwall_dif(fl) - sunwall_a_dif(fl) = (1._r8-alb_wall_dif(fl,ib)) * stot(fl) - sunwall_r_dif(fl) = alb_wall_dif(fl,ib) * stot(fl) - - stot(fl) = road_r_shadewall_dif(fl)/canyon_hwr(fl) + sunwall_r_shadewall_dif(fl) - shadewall_a_dif(fl) = (1._r8-alb_wall_dif(fl,ib)) * stot(fl) - shadewall_r_dif(fl) = alb_wall_dif(fl,ib) * stot(fl) - - ! step (2) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sabs_improad_dif(l,ib) = sabs_improad_dif(l,ib) + improad_a_dif(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sabs_perroad_dif(l,ib) = sabs_perroad_dif(l,ib) + perroad_a_dif(fl) - sabs_sunwall_dif(l,ib) = sabs_sunwall_dif(l,ib) + sunwall_a_dif(fl) - sabs_shadewall_dif(l,ib) = sabs_shadewall_dif(l,ib) + shadewall_a_dif(fl) - - ! step (3) - - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_r_sky_dif(fl) = improad_r_dif(fl) * vf_sr(l) - improad_r_sunwall_dif(fl) = improad_r_dif(fl) * vf_wr(l) - improad_r_shadewall_dif(fl) = improad_r_dif(fl) * vf_wr(l) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_r_sky_dif(fl) = perroad_r_dif(fl) * vf_sr(l) - perroad_r_sunwall_dif(fl) = perroad_r_dif(fl) * vf_wr(l) - perroad_r_shadewall_dif(fl) = perroad_r_dif(fl) * vf_wr(l) - end if - - road_r_sky_dif(fl) = road_r_dif(fl) * vf_sr(l) - road_r_sunwall_dif(fl) = road_r_dif(fl) * vf_wr(l) - road_r_shadewall_dif(fl) = road_r_dif(fl) * vf_wr(l) - - sunwall_r_sky_dif(fl) = sunwall_r_dif(fl) * vf_sw(l) - sunwall_r_road_dif(fl) = sunwall_r_dif(fl) * vf_rw(l) - sunwall_r_shadewall_dif(fl) = sunwall_r_dif(fl) * vf_ww(l) - - shadewall_r_sky_dif(fl) = shadewall_r_dif(fl) * vf_sw(l) - shadewall_r_road_dif(fl) = shadewall_r_dif(fl) * vf_rw(l) - shadewall_r_sunwall_dif(fl) = shadewall_r_dif(fl) * vf_ww(l) - - ! step (4) - - if ( wtroad_imperv(fl) > 0.0_r8 ) sref_improad_dif(fl,ib) = sref_improad_dif(fl,ib) + improad_r_sky_dif(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) sref_perroad_dif(fl,ib) = sref_perroad_dif(fl,ib) + perroad_r_sky_dif(fl) - sref_sunwall_dif(fl,ib) = sref_sunwall_dif(fl,ib) + sunwall_r_sky_dif(fl) - sref_shadewall_dif(fl,ib) = sref_shadewall_dif(fl,ib) + shadewall_r_sky_dif(fl) - - ! step (5) - - crit = max(road_a_dif(fl), sunwall_a_dif(fl), shadewall_a_dif(fl)) - if (crit < errcrit) exit - end do - if (iter_dif >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, diffuse' - write (iulog,*) 'clm model is stopping' - call endrun() - endif - - ! total reflected by canyon - sum of solar reflection to sky from canyon. - ! project wall fluxes to horizontal surface - - sref_canyon_dir(fl) = 0.0_r8 - sref_canyon_dif(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - sref_canyon_dir(fl) = sref_canyon_dir(fl) + sref_improad_dir(fl,ib)*wtroad_imperv(fl) - sref_canyon_dif(fl) = sref_canyon_dif(fl) + sref_improad_dif(fl,ib)*wtroad_imperv(fl) - end if - if ( wtroad_perv(fl) > 0.0_r8 ) then - sref_canyon_dir(fl) = sref_canyon_dir(fl) + sref_perroad_dir(fl,ib)*wtroad_perv(fl) - sref_canyon_dif(fl) = sref_canyon_dif(fl) + sref_perroad_dif(fl,ib)*wtroad_perv(fl) - end if - sref_canyon_dir(fl) = sref_canyon_dir(fl) + (sref_sunwall_dir(fl,ib) + sref_shadewall_dir(fl,ib))*canyon_hwr(fl) - sref_canyon_dif(fl) = sref_canyon_dif(fl) + (sref_sunwall_dif(fl,ib) + sref_shadewall_dif(fl,ib))*canyon_hwr(fl) - - ! total absorbed by canyon. project wall fluxes to horizontal surface - - sabs_canyon_dir(fl) = 0.0_r8 - sabs_canyon_dif(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - sabs_canyon_dir(fl) = sabs_canyon_dir(fl) + sabs_improad_dir(l,ib)*wtroad_imperv(fl) - sabs_canyon_dif(fl) = sabs_canyon_dif(fl) + sabs_improad_dif(l,ib)*wtroad_imperv(fl) - end if - if ( wtroad_perv(fl) > 0.0_r8 ) then - sabs_canyon_dir(fl) = sabs_canyon_dir(fl) + sabs_perroad_dir(l,ib)*wtroad_perv(fl) - sabs_canyon_dif(fl) = sabs_canyon_dif(fl) + sabs_perroad_dif(l,ib)*wtroad_perv(fl) - end if - sabs_canyon_dir(fl) = sabs_canyon_dir(fl) + (sabs_sunwall_dir(l,ib) + sabs_shadewall_dir(l,ib))*canyon_hwr(fl) - sabs_canyon_dif(fl) = sabs_canyon_dif(fl) + (sabs_sunwall_dif(l,ib) + sabs_shadewall_dif(l,ib))*canyon_hwr(fl) - - ! conservation check. note: previous conservation checks confirm partioning of total direct - ! beam and diffuse radiation from atmosphere to road and walls is conserved as - ! sdir (from atmosphere) = sdir_road + (sdir_sunwall + sdir_shadewall)*canyon_hwr - ! sdif (from atmosphere) = sdif_road + (sdif_sunwall + sdif_shadewall)*canyon_hwr - - stot_dir(fl) = sdir_road(fl,ib) + (sdir_sunwall(fl,ib) + sdir_shadewall(fl,ib))*canyon_hwr(fl) - stot_dif(fl) = sdif_road(fl,ib) + (sdif_sunwall(fl,ib) + sdif_shadewall(fl,ib))*canyon_hwr(fl) - - err = stot_dir(fl) + stot_dif(fl) & - - (sabs_canyon_dir(fl) + sabs_canyon_dif(fl) + sref_canyon_dir(fl) + sref_canyon_dif(fl)) - if (abs(err) > 0.001_r8 ) then - write(iulog,*)'urban net solar radiation balance error for ib=',ib,' err= ',err - write(iulog,*)' l= ',l,' ib= ',ib - write(iulog,*)' stot_dir = ',stot_dir(fl) - write(iulog,*)' stot_dif = ',stot_dif(fl) - write(iulog,*)' sabs_canyon_dir = ',sabs_canyon_dir(fl) - write(iulog,*)' sabs_canyon_dif = ',sabs_canyon_dif(fl) - write(iulog,*)' sref_canyon_dir = ',sref_canyon_dir(fl) - write(iulog,*)' sref_canyon_dif = ',sref_canyon_dir(fl) - write(iulog,*) 'clm model is stopping' - call endrun() - endif - - ! canyon albedo - - canyon_alb_dif(fl) = sref_canyon_dif(fl) / max(stot_dif(fl), 1.e-06_r8) - canyon_alb_dir(fl) = sref_canyon_dir(fl) / max(stot_dir(fl), 1.e-06_r8) - end if - - end do ! end of landunit loop - - ! Refected and absorbed solar radiation per unit incident radiation for roof - - do fl = 1,num_urbanl - if (coszen(fl) .gt. 0._r8) then - l = filter_urbanl(fl) - sref_roof_dir(fl,ib) = alb_roof_dir(fl,ib) * sdir(fl,ib) - sref_roof_dif(fl,ib) = alb_roof_dif(fl,ib) * sdif(fl,ib) - sabs_roof_dir(l,ib) = sdir(fl,ib) - sref_roof_dir(fl,ib) - sabs_roof_dif(l,ib) = sdif(fl,ib) - sref_roof_dif(fl,ib) - end if - end do - - end do ! end of radiation band loop - - end subroutine net_solar - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: net_longwave -! -! !INTERFACE: - subroutine net_longwave (lbl, ubl, num_urbanl, filter_urbanl, canyon_hwr, wtroad_perv, & - lwdown, em_roof, em_improad, em_perroad, em_wall, & - t_roof, t_improad, t_perroad, t_sunwall, t_shadewall, & - lwnet_roof, lwnet_improad, lwnet_perroad, lwnet_sunwall, lwnet_shadewall, lwnet_canyon, & - lwup_roof, lwup_improad, lwup_perroad, lwup_sunwall, lwup_shadewall, lwup_canyon) -! -! !DESCRIPTION: -! Net longwave radiation for road and both walls in urban canyon allowing for -! multiple reflection. Also net longwave radiation for urban roof. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varcon , only : sb - use clmtype -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: num_urbanl ! number of urban landunits - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - real(r8), intent(in) :: canyon_hwr(num_urbanl) ! ratio of building height to street width - real(r8), intent(in) :: wtroad_perv(num_urbanl) ! weight of pervious road wrt total road - - real(r8), intent(in) :: lwdown(num_urbanl) ! atmospheric longwave radiation (W/m**2) - real(r8), intent(in) :: em_roof(num_urbanl) ! roof emissivity - real(r8), intent(in) :: em_improad(num_urbanl) ! impervious road emissivity - real(r8), intent(in) :: em_perroad(num_urbanl) ! pervious road emissivity - real(r8), intent(in) :: em_wall(num_urbanl) ! wall emissivity - - real(r8), intent(in) :: t_roof(num_urbanl) ! roof temperature (K) - real(r8), intent(in) :: t_improad(num_urbanl) ! impervious road temperature (K) - real(r8), intent(in) :: t_perroad(num_urbanl) ! ervious road temperature (K) - real(r8), intent(in) :: t_sunwall(num_urbanl) ! sunlit wall temperature (K) - real(r8), intent(in) :: t_shadewall(num_urbanl) ! shaded wall temperature (K) - - real(r8), intent(out) :: lwnet_roof(num_urbanl) ! net (outgoing-incoming) longwave radiation, roof (W/m**2) - real(r8), intent(out) :: lwnet_improad(num_urbanl) ! net (outgoing-incoming) longwave radiation, impervious road (W/m**2) - real(r8), intent(out) :: lwnet_perroad(num_urbanl) ! net (outgoing-incoming) longwave radiation, pervious road (W/m**2) - real(r8), intent(out) :: lwnet_sunwall(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit wall area), sunlit wall (W/m**2) - real(r8), intent(out) :: lwnet_shadewall(num_urbanl) ! net (outgoing-incoming) longwave radiation (per unit wall area), shaded wall (W/m**2) - real(r8), intent(out) :: lwnet_canyon(num_urbanl) ! net (outgoing-incoming) longwave radiation for canyon, per unit ground area (W/m**2) - - real(r8), intent(out) :: lwup_roof(num_urbanl) ! upward longwave radiation, roof (W/m**2) - real(r8), intent(out) :: lwup_improad(num_urbanl) ! upward longwave radiation, impervious road (W/m**2) - real(r8), intent(out) :: lwup_perroad(num_urbanl) ! upward longwave radiation, pervious road (W/m**2) - real(r8), intent(out) :: lwup_sunwall(num_urbanl) ! upward longwave radiation (per unit wall area), sunlit wall (W/m**2) - real(r8), intent(out) :: lwup_shadewall(num_urbanl) ! upward longwave radiation (per unit wall area), shaded wall (W/m**2) - real(r8), intent(out) :: lwup_canyon(num_urbanl) ! upward longwave radiation for canyon, per unit ground area (W/m**2) -! -! local pointers to original implicit in arguments (clmtype) -! - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall -! -! !CALLED FROM: -! subroutine UrbanRadiation in this module -! -! !REVISION HISTORY: -! Author: Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: lwdown_road(num_urbanl) ! atmospheric longwave radiation for total road (W/m**2) - real(r8) :: lwdown_sunwall(num_urbanl) ! atmospheric longwave radiation (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: lwdown_shadewall(num_urbanl) ! atmospheric longwave radiation (per unit wall area) for shaded wall (W/m**2) - real(r8) :: lwtot(num_urbanl) ! incoming longwave radiation (W/m**2) - - real(r8) :: improad_a(num_urbanl) ! absorbed longwave for improad (W/m**2) - real(r8) :: improad_r(num_urbanl) ! reflected longwave for improad (W/m**2) - real(r8) :: improad_r_sky(num_urbanl) ! improad_r to sky (W/m**2) - real(r8) :: improad_r_sunwall(num_urbanl) ! improad_r to sunlit wall (W/m**2) - real(r8) :: improad_r_shadewall(num_urbanl) ! improad_r to shaded wall (W/m**2) - real(r8) :: improad_e(num_urbanl) ! emitted longwave for improad (W/m**2) - real(r8) :: improad_e_sky(num_urbanl) ! improad_e to sky (W/m**2) - real(r8) :: improad_e_sunwall(num_urbanl) ! improad_e to sunlit wall (W/m**2) - real(r8) :: improad_e_shadewall(num_urbanl) ! improad_e to shaded wall (W/m**2) - - real(r8) :: perroad_a(num_urbanl) ! absorbed longwave for perroad (W/m**2) - real(r8) :: perroad_r(num_urbanl) ! reflected longwave for perroad (W/m**2) - real(r8) :: perroad_r_sky(num_urbanl) ! perroad_r to sky (W/m**2) - real(r8) :: perroad_r_sunwall(num_urbanl) ! perroad_r to sunlit wall (W/m**2) - real(r8) :: perroad_r_shadewall(num_urbanl) ! perroad_r to shaded wall (W/m**2) - real(r8) :: perroad_e(num_urbanl) ! emitted longwave for perroad (W/m**2) - real(r8) :: perroad_e_sky(num_urbanl) ! perroad_e to sky (W/m**2) - real(r8) :: perroad_e_sunwall(num_urbanl) ! perroad_e to sunlit wall (W/m**2) - real(r8) :: perroad_e_shadewall(num_urbanl) ! perroad_e to shaded wall (W/m**2) - - real(r8) :: road_a(num_urbanl) ! absorbed longwave for total road (W/m**2) - real(r8) :: road_r(num_urbanl) ! reflected longwave for total road (W/m**2) - real(r8) :: road_r_sky(num_urbanl) ! total road_r to sky (W/m**2) - real(r8) :: road_r_sunwall(num_urbanl) ! total road_r to sunlit wall (W/m**2) - real(r8) :: road_r_shadewall(num_urbanl) ! total road_r to shaded wall (W/m**2) - real(r8) :: road_e(num_urbanl) ! emitted longwave for total road (W/m**2) - real(r8) :: road_e_sky(num_urbanl) ! total road_e to sky (W/m**2) - real(r8) :: road_e_sunwall(num_urbanl) ! total road_e to sunlit wall (W/m**2) - real(r8) :: road_e_shadewall(num_urbanl) ! total road_e to shaded wall (W/m**2) - - real(r8) :: sunwall_a(num_urbanl) ! absorbed longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_r(num_urbanl) ! reflected longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_r_sky(num_urbanl) ! sunwall_r to sky (W/m**2) - real(r8) :: sunwall_r_road(num_urbanl) ! sunwall_r to road (W/m**2) - real(r8) :: sunwall_r_shadewall(num_urbanl) ! sunwall_r to opposing (shaded) wall (W/m**2) - real(r8) :: sunwall_e(num_urbanl) ! emitted longwave (per unit wall area) for sunlit wall (W/m**2) - real(r8) :: sunwall_e_sky(num_urbanl) ! sunwall_e to sky (W/m**2) - real(r8) :: sunwall_e_road(num_urbanl) ! sunwall_e to road (W/m**2) - real(r8) :: sunwall_e_shadewall(num_urbanl) ! sunwall_e to opposing (shaded) wall (W/m**2) - - real(r8) :: shadewall_a(num_urbanl) ! absorbed longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_r(num_urbanl) ! reflected longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_r_sky(num_urbanl) ! shadewall_r to sky (W/m**2) - real(r8) :: shadewall_r_road(num_urbanl) ! shadewall_r to road (W/m**2) - real(r8) :: shadewall_r_sunwall(num_urbanl) ! shadewall_r to opposing (sunlit) wall (W/m**2) - real(r8) :: shadewall_e(num_urbanl) ! emitted longwave (per unit wall area) for shaded wall (W/m**2) - real(r8) :: shadewall_e_sky(num_urbanl) ! shadewall_e to sky (W/m**2) - real(r8) :: shadewall_e_road(num_urbanl) ! shadewall_e to road (W/m**2) - real(r8) :: shadewall_e_sunwall(num_urbanl) ! shadewall_e to opposing (sunlit) wall (W/m**2) - integer :: l,fl,iter ! indices - integer, parameter :: n = 50 ! number of interations - real(r8) :: crit ! convergence criterion (W/m**2) - real(r8) :: err ! energy conservation error (W/m**2) - real(r8) :: wtroad_imperv(num_urbanl) ! weight of impervious road wrt total road -!----------------------------------------------------------------------- - - ! Assign landunit level pointer - - vf_sr => lps%vf_sr - vf_wr => lps%vf_wr - vf_sw => lps%vf_sw - vf_rw => lps%vf_rw - vf_ww => lps%vf_ww - - ! Calculate impervious road - - do l = 1,num_urbanl - wtroad_imperv(l) = 1._r8 - wtroad_perv(l) - end do - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - ! atmospheric longwave radiation incident on walls and road in urban canyon. - ! check for conservation (need to convert wall fluxes to ground area). - ! lwdown (from atmosphere) = lwdown_road + (lwdown_sunwall + lwdown_shadewall)*canyon_hwr - - lwdown_road(fl) = lwdown(fl) * vf_sr(l) - lwdown_sunwall(fl) = lwdown(fl) * vf_sw(l) - lwdown_shadewall(fl) = lwdown(fl) * vf_sw(l) - - err = lwdown(fl) - (lwdown_road(fl) + (lwdown_shadewall(fl) + lwdown_sunwall(fl))*canyon_hwr(fl)) - if (abs(err) > 0.10_r8 ) then - write (iulog,*) 'urban incident atmospheric longwave radiation balance error',err - write (iulog,*) 'clm model is stopping' - call endrun - endif - end do - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - ! initial absorption, reflection, and emission for road and both walls. - ! distribute reflected and emitted radiation to sky, road, and walls according - ! to appropriate view factor. radiation reflected to road and walls will - ! undergo multiple reflections within the canyon. - - road_a(fl) = 0.0_r8 - road_r(fl) = 0.0_r8 - road_e(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_a(fl) = em_improad(fl) * lwdown_road(fl) - improad_r(fl) = (1._r8-em_improad(fl)) * lwdown_road(fl) - improad_r_sky(fl) = improad_r(fl) * vf_sr(l) - improad_r_sunwall(fl) = improad_r(fl) * vf_wr(l) - improad_r_shadewall(fl) = improad_r(fl) * vf_wr(l) - improad_e(fl) = em_improad(fl) * sb * (t_improad(fl)**4) - improad_e_sky(fl) = improad_e(fl) * vf_sr(l) - improad_e_sunwall(fl) = improad_e(fl) * vf_wr(l) - improad_e_shadewall(fl) = improad_e(fl) * vf_wr(l) - road_a(fl) = road_a(fl) + improad_a(fl)*wtroad_imperv(fl) - road_r(fl) = road_r(fl) + improad_r(fl)*wtroad_imperv(fl) - road_e(fl) = road_e(fl) + improad_e(fl)*wtroad_imperv(fl) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_a(fl) = em_perroad(fl) * lwdown_road(fl) - perroad_r(fl) = (1._r8-em_perroad(fl)) * lwdown_road(fl) - perroad_r_sky(fl) = perroad_r(fl) * vf_sr(l) - perroad_r_sunwall(fl) = perroad_r(fl) * vf_wr(l) - perroad_r_shadewall(fl) = perroad_r(fl) * vf_wr(l) - perroad_e(fl) = em_perroad(fl) * sb * (t_perroad(fl)**4) - perroad_e_sky(fl) = perroad_e(fl) * vf_sr(l) - perroad_e_sunwall(fl) = perroad_e(fl) * vf_wr(l) - perroad_e_shadewall(fl) = perroad_e(fl) * vf_wr(l) - road_a(fl) = road_a(fl) + perroad_a(fl)*wtroad_perv(fl) - road_r(fl) = road_r(fl) + perroad_r(fl)*wtroad_perv(fl) - road_e(fl) = road_e(fl) + perroad_e(fl)*wtroad_perv(fl) - end if - - road_r_sky(fl) = road_r(fl) * vf_sr(l) - road_r_sunwall(fl) = road_r(fl) * vf_wr(l) - road_r_shadewall(fl) = road_r(fl) * vf_wr(l) - road_e_sky(fl) = road_e(fl) * vf_sr(l) - road_e_sunwall(fl) = road_e(fl) * vf_wr(l) - road_e_shadewall(fl) = road_e(fl) * vf_wr(l) - - sunwall_a(fl) = em_wall(fl) * lwdown_sunwall(fl) - sunwall_r(fl) = (1._r8-em_wall(fl)) * lwdown_sunwall(fl) - sunwall_r_sky(fl) = sunwall_r(fl) * vf_sw(l) - sunwall_r_road(fl) = sunwall_r(fl) * vf_rw(l) - sunwall_r_shadewall(fl) = sunwall_r(fl) * vf_ww(l) - sunwall_e(fl) = em_wall(fl) * sb * (t_sunwall(fl)**4) - sunwall_e_sky(fl) = sunwall_e(fl) * vf_sw(l) - sunwall_e_road(fl) = sunwall_e(fl) * vf_rw(l) - sunwall_e_shadewall(fl) = sunwall_e(fl) * vf_ww(l) - - shadewall_a(fl) = em_wall(fl) * lwdown_shadewall(fl) - shadewall_r(fl) = (1._r8-em_wall(fl)) * lwdown_shadewall(fl) - shadewall_r_sky(fl) = shadewall_r(fl) * vf_sw(l) - shadewall_r_road(fl) = shadewall_r(fl) * vf_rw(l) - shadewall_r_sunwall(fl) = shadewall_r(fl) * vf_ww(l) - shadewall_e(fl) = em_wall(fl) * sb * (t_shadewall(fl)**4) - shadewall_e_sky(fl) = shadewall_e(fl) * vf_sw(l) - shadewall_e_road(fl) = shadewall_e(fl) * vf_rw(l) - shadewall_e_sunwall(fl) = shadewall_e(fl) * vf_ww(l) - - ! initialize sum of net and upward longwave radiation for road and both walls - - if ( wtroad_imperv(fl) > 0.0_r8 ) lwnet_improad(fl) = improad_e(fl) - improad_a(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) lwnet_perroad(fl) = perroad_e(fl) - perroad_a(fl) - lwnet_sunwall(fl) = sunwall_e(fl) - sunwall_a(fl) - lwnet_shadewall(fl) = shadewall_e(fl) - shadewall_a(fl) - - if ( wtroad_imperv(fl) > 0.0_r8 ) lwup_improad(fl) = improad_r_sky(fl) + improad_e_sky(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) lwup_perroad(fl) = perroad_r_sky(fl) + perroad_e_sky(fl) - lwup_sunwall(fl) = sunwall_r_sky(fl) + sunwall_e_sky(fl) - lwup_shadewall(fl) = shadewall_r_sky(fl) + shadewall_e_sky(fl) - - end do - - ! now account for absorption and reflection within canyon of fluxes from road and walls - ! allowing for multiple reflections - ! - ! (1) absorption and reflection. note: emission from road and walls absorbed by walls and roads - ! only occurs in first iteration. zero out for later iterations. - ! - ! road: fluxes from walls need to be projected to ground area - ! wall: fluxes from road need to be projected to wall area - ! - ! (2) add net longwave for ith reflection to total net longwave - ! - ! (3) distribute reflected radiation to sky, road, and walls according to view factors - ! - ! (4) add upward longwave radiation to sky from road and walls for ith reflection to total - ! - ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. - ! small convergence criteria is required to ensure radiation is conserved - - do fl = 1,num_urbanl - l = filter_urbanl(fl) - - do iter = 1, n - ! step (1) - - lwtot(fl) = (sunwall_r_road(fl) + sunwall_e_road(fl) & - + shadewall_r_road(fl) + shadewall_e_road(fl))*canyon_hwr(fl) - road_a(fl) = 0.0_r8 - road_r(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_r(fl) = (1._r8-em_improad(fl)) * lwtot(fl) - improad_a(fl) = em_improad(fl) * lwtot(fl) - road_a(fl) = road_a(fl) + improad_a(fl)*wtroad_imperv(fl) - road_r(fl) = road_r(fl) + improad_r(fl)*wtroad_imperv(fl) - end if - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_r(fl) = (1._r8-em_perroad(fl)) * lwtot(fl) - perroad_a(fl) = em_perroad(fl) * lwtot(fl) - road_a(fl) = road_a(fl) + perroad_a(fl)*wtroad_perv(fl) - road_r(fl) = road_r(fl) + perroad_r(fl)*wtroad_perv(fl) - end if - - lwtot(fl) = (road_r_sunwall(fl) + road_e_sunwall(fl))/canyon_hwr(fl) & - + (shadewall_r_sunwall(fl) + shadewall_e_sunwall(fl)) - sunwall_a(fl) = em_wall(fl) * lwtot(fl) - sunwall_r(fl) = (1._r8-em_wall(fl)) * lwtot(fl) - - lwtot(fl) = (road_r_shadewall(fl) + road_e_shadewall(fl))/canyon_hwr(fl) & - + (sunwall_r_shadewall(fl) + sunwall_e_shadewall(fl)) - shadewall_a(fl) = em_wall(fl) * lwtot(fl) - shadewall_r(fl) = (1._r8-em_wall(fl)) * lwtot(fl) - - sunwall_e_road(fl) = 0._r8 - shadewall_e_road(fl) = 0._r8 - road_e_sunwall(fl) = 0._r8 - shadewall_e_sunwall(fl) = 0._r8 - road_e_shadewall(fl) = 0._r8 - sunwall_e_shadewall(fl) = 0._r8 - - ! step (2) - - if ( wtroad_imperv(fl) > 0.0_r8 ) lwnet_improad(fl) = lwnet_improad(fl) - improad_a(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) lwnet_perroad(fl) = lwnet_perroad(fl) - perroad_a(fl) - lwnet_sunwall(fl) = lwnet_sunwall(fl) - sunwall_a(fl) - lwnet_shadewall(fl) = lwnet_shadewall(fl) - shadewall_a(fl) - - ! step (3) - - if ( wtroad_imperv(fl) > 0.0_r8 ) then - improad_r_sky(fl) = improad_r(fl) * vf_sr(l) - improad_r_sunwall(fl) = improad_r(fl) * vf_wr(l) - improad_r_shadewall(fl) = improad_r(fl) * vf_wr(l) - end if - - if ( wtroad_perv(fl) > 0.0_r8 ) then - perroad_r_sky(fl) = perroad_r(fl) * vf_sr(l) - perroad_r_sunwall(fl) = perroad_r(fl) * vf_wr(l) - perroad_r_shadewall(fl) = perroad_r(fl) * vf_wr(l) - end if - - road_r_sky(fl) = road_r(fl) * vf_sr(l) - road_r_sunwall(fl) = road_r(fl) * vf_wr(l) - road_r_shadewall(fl) = road_r(fl) * vf_wr(l) - - sunwall_r_sky(fl) = sunwall_r(fl) * vf_sw(l) - sunwall_r_road(fl) = sunwall_r(fl) * vf_rw(l) - sunwall_r_shadewall(fl) = sunwall_r(fl) * vf_ww(l) - - shadewall_r_sky(fl) = shadewall_r(fl) * vf_sw(l) - shadewall_r_road(fl) = shadewall_r(fl) * vf_rw(l) - shadewall_r_sunwall(fl) = shadewall_r(fl) * vf_ww(l) - - ! step (4) - - if ( wtroad_imperv(fl) > 0.0_r8 ) lwup_improad(fl) = lwup_improad(fl) + improad_r_sky(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) lwup_perroad(fl) = lwup_perroad(fl) + perroad_r_sky(fl) - lwup_sunwall(fl) = lwup_sunwall(fl) + sunwall_r_sky(fl) - lwup_shadewall(fl) = lwup_shadewall(fl) + shadewall_r_sky(fl) - - ! step (5) - - crit = max(road_a(fl), sunwall_a(fl), shadewall_a(fl)) - if (crit < .001_r8) exit - end do - if (iter >= n) then - write (iulog,*) 'urban net longwave radiation error: no convergence' - write (iulog,*) 'clm model is stopping' - call endrun - endif - - ! total net longwave radiation for canyon. project wall fluxes to horizontal surface - - lwnet_canyon(fl) = 0.0_r8 - if ( wtroad_imperv(fl) > 0.0_r8 ) lwnet_canyon(fl) = lwnet_canyon(fl) + lwnet_improad(fl)*wtroad_imperv(fl) - if ( wtroad_perv(fl) > 0.0_r8 ) lwnet_canyon(fl) = lwnet_canyon(fl) + lwnet_perroad(fl)*wtroad_perv(fl) - lwnet_canyon(fl) = lwnet_canyon(fl) + (lwnet_sunwall(fl) + lwnet_shadewall(fl))*canyon_hwr(fl) - - ! total emitted longwave for canyon. project wall fluxes to horizontal - - lwup_canyon(fl) = 0.0_r8 - if( wtroad_imperv(fl) > 0.0_r8 ) lwup_canyon(fl) = lwup_canyon(fl) + lwup_improad(fl)*wtroad_imperv(fl) - if( wtroad_perv(fl) > 0.0_r8 ) lwup_canyon(fl) = lwup_canyon(fl) + lwup_perroad(fl)*wtroad_perv(fl) - lwup_canyon(fl) = lwup_canyon(fl) + (lwup_sunwall(fl) + lwup_shadewall(fl))*canyon_hwr(fl) - - ! conservation check. note: previous conservation check confirms partioning of incident - ! atmospheric longwave radiation to road and walls is conserved as - ! lwdown (from atmosphere) = lwdown_improad + lwdown_perroad + (lwdown_sunwall + lwdown_shadewall)*canyon_hwr - - err = lwnet_canyon(fl) - (lwup_canyon(fl) - lwdown(fl)) - if (abs(err) > .10_r8 ) then - write (iulog,*) 'urban net longwave radiation balance error',err - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - end do - - ! Net longwave radiation for roof - - do l = 1,num_urbanl - lwup_roof(l) = em_roof(l)*sb*(t_roof(l)**4) + (1._r8-em_roof(l))*lwdown(l) - lwnet_roof(l) = lwup_roof(l) - lwdown(l) - end do - - end subroutine net_longwave - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanClumpInit -! -! !INTERFACE: - subroutine UrbanClumpInit() -! -! !DESCRIPTION: -! Initialize urban radiation module -! -! !USES: - use clmtype - use clm_varcon , only : spval, icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv - use decompMod , only : get_proc_clumps, ldecomp - use filterMod , only : filter - use UrbanInputMod, only : urbinp -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein 04/2003 -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments -! - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: ctype(:) ! column type -! -! -! !OTHER LOCAL VARIABLES -!EOP -! - integer :: nc,fl,ib,l,c,p,g ! indices - integer :: nclumps ! number of clumps on processor - integer :: num_urbanl ! number of per-clump urban landunits - integer :: ier ! error status -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (landunit-level) - - coli => lun%coli - colf => lun%colf - lgridcell => lun%gridcell - - ! Assign local pointers to derived type members (column-level) - - ctype => col%itype - - ! Allocate memory - - nclumps = get_proc_clumps() - allocate(urban_clump(nclumps), stat=ier) - if (ier /= 0) then - write (iulog,*) 'UrbanInit: allocation error for urban clumps'; call endrun() - end if - - ! Loop over all clumps on this processor - - do nc = 1, nclumps - - ! Determine number of unrban landunits in clump - - num_urbanl = filter(nc)%num_urbanl - - ! Consistency check for urban columns - - do fl = 1,num_urbanl - l = filter(nc)%urbanl(fl) - do c = coli(l),colf(l) - if ( ctype(c) /= icol_roof .and. & - ctype(c) /= icol_sunwall .and. ctype(c) /= icol_shadewall .and. & - ctype(c) /= icol_road_perv .and. ctype(c) /= icol_road_imperv) then - write(iulog,*)'error in urban column types for landunit = ',l - write(iulog,*)'ctype= ',ctype(c) - call endrun() - endif - end do - end do - - ! Allocate memory for urban clump clumponents - - if (num_urbanl > 0) then - allocate( urban_clump(nc)%canyon_hwr (num_urbanl), & - urban_clump(nc)%wtroad_perv (num_urbanl), & - urban_clump(nc)%ht_roof (num_urbanl), & - urban_clump(nc)%wtlunit_roof (num_urbanl), & - urban_clump(nc)%wind_hgt_canyon (num_urbanl), & - urban_clump(nc)%em_roof (num_urbanl), & - urban_clump(nc)%em_improad (num_urbanl), & - urban_clump(nc)%em_perroad (num_urbanl), & - urban_clump(nc)%em_wall (num_urbanl), & - urban_clump(nc)%alb_roof_dir (num_urbanl,numrad), & - urban_clump(nc)%alb_roof_dif (num_urbanl,numrad), & - urban_clump(nc)%alb_improad_dir (num_urbanl,numrad), & - urban_clump(nc)%alb_perroad_dir (num_urbanl,numrad), & - urban_clump(nc)%alb_improad_dif (num_urbanl,numrad), & - urban_clump(nc)%alb_perroad_dif (num_urbanl,numrad), & - urban_clump(nc)%alb_wall_dir (num_urbanl,numrad), & - urban_clump(nc)%alb_wall_dif (num_urbanl,numrad), stat=ier ) - if (ier /= 0) then - write(iulog,*)'UrbanRadInit: allocation error for urban derived type'; call endrun() - endif - end if - - ! Set constants in derived type values for urban clump - - do fl = 1,num_urbanl - l = filter(nc)%urbanl(fl) - g = lun%gridcell(l) - urban_clump(nc)%canyon_hwr (fl) = urbinp%canyon_hwr (g) - urban_clump(nc)%wtroad_perv (fl) = urbinp%wtroad_perv (g) - urban_clump(nc)%ht_roof (fl) = urbinp%ht_roof (g) - urban_clump(nc)%wtlunit_roof (fl) = urbinp%wtlunit_roof (g) - urban_clump(nc)%wind_hgt_canyon(fl) = urbinp%wind_hgt_canyon(g) - do ib = 1,numrad - urban_clump(nc)%alb_roof_dir (fl,ib) = urbinp%alb_roof_dir (g,ib) - urban_clump(nc)%alb_roof_dif (fl,ib) = urbinp%alb_roof_dif (g,ib) - urban_clump(nc)%alb_improad_dir(fl,ib) = urbinp%alb_improad_dir(g,ib) - urban_clump(nc)%alb_perroad_dir(fl,ib) = urbinp%alb_perroad_dir(g,ib) - urban_clump(nc)%alb_improad_dif(fl,ib) = urbinp%alb_improad_dif(g,ib) - urban_clump(nc)%alb_perroad_dif(fl,ib) = urbinp%alb_perroad_dif(g,ib) - urban_clump(nc)%alb_wall_dir (fl,ib) = urbinp%alb_wall_dir (g,ib) - urban_clump(nc)%alb_wall_dif (fl,ib) = urbinp%alb_wall_dif (g,ib) - end do - urban_clump(nc)%em_roof (fl) = urbinp%em_roof (g) - urban_clump(nc)%em_improad(fl) = urbinp%em_improad(g) - urban_clump(nc)%em_perroad(fl) = urbinp%em_perroad(g) - urban_clump(nc)%em_wall (fl) = urbinp%em_wall (g) -! write(iulog,*)'g: ',g -! write(iulog,*)'l: ',l -! write(iulog,*)'fl: ',fl -! write(iulog,*)'urban_clump(nc)%canyon_hwr: ',urban_clump(nc)%canyon_hwr(fl) -! write(iulog,*)'urban_clump(nc)%wtroad_perv: ',urban_clump(nc)%wtroad_perv(fl) -! write(iulog,*)'urban_clump(nc)%ht_roof: ',urban_clump(nc)%ht_roof(fl) -! write(iulog,*)'urban_clump(nc)%wtlunit_roof: ',urban_clump(nc)%wtlunit_roof(fl) -! write(iulog,*)'urban_clump(nc)%wind_hgt_canyon: ',urban_clump(nc)%wind_hgt_canyon(fl) -! write(iulog,*)'urban_clump(nc)%alb_roof_dir: ',urban_clump(nc)%alb_roof_dir(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_roof_dif: ',urban_clump(nc)%alb_roof_dif(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_improad_dir: ',urban_clump(nc)%alb_improad_dir(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_improad_dif: ',urban_clump(nc)%alb_improad_dif(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_perroad_dir: ',urban_clump(nc)%alb_perroad_dir(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_perroad_dif: ',urban_clump(nc)%alb_perroad_dif(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_wall_dir: ',urban_clump(nc)%alb_wall_dir(fl,:) -! write(iulog,*)'urban_clump(nc)%alb_wall_dif: ',urban_clump(nc)%alb_wall_dif(fl,:) -! write(iulog,*)'urban_clump(nc)%em_roof: ',urban_clump(nc)%em_roof(fl) -! write(iulog,*)'urban_clump(nc)%em_improad: ',urban_clump(nc)%em_improad(fl) -! write(iulog,*)'urban_clump(nc)%em_perroad: ',urban_clump(nc)%em_perroad(fl) -! write(iulog,*)'urban_clump(nc)%em_wall: ',urban_clump(nc)%em_wall(fl) - end do - end do ! end of loop over clumps - - end subroutine UrbanClumpInit - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: UrbanFluxes -! -! !INTERFACE: - subroutine UrbanFluxes (nc, lbp, ubp, lbl, ubl, lbc, ubc, & - num_nourbanl, filter_nourbanl, & - num_urbanl, filter_urbanl, & - num_urbanc, filter_urbanc, & - num_urbanp, filter_urbanp) -! -! !DESCRIPTION: -! Turbulent and momentum fluxes from urban canyon (consisting of roof, sunwall, -! shadewall, pervious and impervious road). - -! !USES: - use clmtype - use clm_varcon , only : cpair, vkc, spval, icol_roof, icol_sunwall, & - icol_shadewall, icol_road_perv, icol_road_imperv, & - grav, pondmx_urban, rpi, rgas, & - ht_wasteheat_factor, ac_wasteheat_factor, & - wasteheat_limit - use filterMod , only : filter - use FrictionVelocityMod, only : FrictionVelocity, MoninObukIni - use QSatMod , only : QSat - use clm_varpar , only : maxpatch_urb, nlevurb - use clm_time_manager , only : get_curr_date, get_step_size, get_nstep - use clm_atmlnd , only : clm_a2l - -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: nc ! clump index - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: lbl, ubl ! landunit-index bounds - integer, intent(in) :: lbc, ubc ! column-index bounds - integer , intent(in) :: num_nourbanl ! number of non-urban landunits in clump - integer , intent(in) :: filter_nourbanl(ubl-lbl+1) ! non-urban landunit filter - integer , intent(in) :: num_urbanl ! number of urban landunits in clump - integer , intent(in) :: filter_urbanl(ubl-lbl+1) ! urban landunit filter - integer , intent(in) :: num_urbanc ! number of urban columns in clump - integer , intent(in) :: filter_urbanc(ubc-lbc+1) ! urban column filter - integer , intent(in) :: num_urbanp ! number of urban pfts in clump - integer , intent(in) :: filter_urbanp(ubp-lbp+1) ! urban pft filter -! -! !CALLED FROM: -! subroutine clm_driver1 -! -! !REVISION HISTORY: -! Author: Keith Oleson 10/2005 -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in arguments (urban clump) -! - real(r8), pointer :: ht_roof(:) ! height of urban roof (m) - real(r8), pointer :: wtlunit_roof(:) ! weight of roof with respect to landunit - real(r8), pointer :: canyon_hwr(:) ! ratio of building height to street width - real(r8), pointer :: wtroad_perv(:) ! weight of pervious road wrt total road - real(r8), pointer :: wind_hgt_canyon(:) ! height above road at which wind in canyon is to be computed (m) -! -! local pointers to original implicit in arguments (clmtype) -! - real(r8), pointer :: forc_u(:) ! atmospheric wind speed in east direction (m/s) - real(r8), pointer :: forc_v(:) ! atmospheric wind speed in north direction (m/s) - real(r8), pointer :: forc_rho(:) ! density (kg/m**3) - real(r8), pointer :: forc_hgt_u_pft(:) ! observational height of wind at pft-level (m) - real(r8), pointer :: forc_hgt_t_pft(:) ! observational height of temperature at pft-level (m) - real(r8), pointer :: forc_q(:) ! atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_t(:) ! atmospheric temperature (K) - real(r8), pointer :: forc_th(:) ! atmospheric potential temperature (K) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - - real(r8), pointer :: z_0_town(:) ! momentum roughness length of urban landunit (m) - real(r8), pointer :: z_d_town(:) ! displacement height of urban landunit (m) - - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: plandunit(:) ! pft's landunit index - integer , pointer :: ctype(:) ! column type - integer , pointer :: coli(:) ! beginning column index for landunit - integer , pointer :: colf(:) ! ending column index for landunit - integer , pointer :: pfti(:) ! beginning pft index for landunit - integer , pointer :: pftf(:) ! ending pft index for landunit - - real(r8), pointer :: taf(:) ! urban canopy air temperature (K) - real(r8), pointer :: qaf(:) ! urban canopy air specific humidity (kg/kg) - integer , pointer :: npfts(:) ! landunit's number of pfts (columns) - real(r8), pointer :: t_grnd(:) ! ground surface temperature (K) - real(r8), pointer :: qg(:) ! specific humidity at ground surface (kg/kg) - real(r8), pointer :: htvp(:) ! latent heat of evaporation (/sublimation) (J/kg) - real(r8), pointer :: dqgdT(:) ! temperature derivative of "qg" - real(r8), pointer :: eflx_traffic(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_traffic_factor(:) ! multiplicative urban traffic factor for sensible heat flux - real(r8), pointer :: eflx_wasteheat(:) ! sensible heat flux from urban heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac(:) ! sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: t_soisno(:,:) ! soil temperature (K) - real(r8), pointer :: eflx_urban_ac(:) ! urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat(:) ! urban heating flux (W/m**2) - real(r8), pointer :: londeg(:) ! longitude (degrees) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: rootr_road_perv(:,:) ! effective fraction of roots in each soil layer for urban pervious road - real(r8), pointer :: soilalpha_u(:) ! Urban factor that reduces ground saturated specific humidity (-) -! -! local pointers to original implicit out arguments -! - real(r8), pointer :: dlrad(:) ! downward longwave radiation below the canopy (W/m**2) - real(r8), pointer :: ulrad(:) ! upward longwave radiation above the canopy (W/m**2) - real(r8), pointer :: cgrnds(:) ! deriv, of soil sensible heat flux wrt soil temp (W/m**2/K) - real(r8), pointer :: cgrndl(:) ! deriv of soil latent heat flux wrt soil temp (W/m**2/K) - real(r8), pointer :: cgrnd(:) ! deriv. of soil energy flux wrt to soil temp (W/m**2/K) - real(r8), pointer :: taux(:) ! wind (shear) stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy(:) ! wind (shear) stress: n-s (kg/m/s**2) - real(r8), pointer :: eflx_sh_grnd(:) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot(:) ! total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_u(:) ! urban total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: qflx_evap_soi(:) ! soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg(:) ! vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_veg(:) ! vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot(:) ! qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (K) - real(r8), pointer :: q_ref2m(:) ! 2 m height surface specific humidity (kg/kg) - real(r8), pointer :: t_ref2m_u(:) ! Urban 2 m height surface air temperature (K) - real(r8), pointer :: t_veg(:) ! vegetation temperature (K) - real(r8), pointer :: ram1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: rootr(:,:) ! effective fraction of roots in each soil layer - real(r8), pointer :: psnsun(:) ! sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) ! shaded leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: t_building(:) ! internal building temperature (K) - real(r8), pointer :: rh_ref2m(:) ! 2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m_u(:) ! Urban 2 m height surface relative humidity (%) -! -! -! !OTHER LOCAL VARIABLES -!EOP -! - character(len=*), parameter :: sub="UrbanFluxes" - integer :: fp,fc,fl,f,p,c,l,g,j,pi,i ! indices - - real(r8) :: canyontop_wind(num_urbanl) ! wind at canyon top (m/s) - real(r8) :: canyon_u_wind(num_urbanl) ! u-component of wind speed inside canyon (m/s) - real(r8) :: canyon_wind(num_urbanl) ! net wind speed inside canyon (m/s) - real(r8) :: canyon_resistance(num_urbanl) ! resistance to heat and moisture transfer from canyon road/walls to canyon air (s/m) - - real(r8) :: ur(lbl:ubl) ! wind speed at reference height (m/s) - real(r8) :: ustar(lbl:ubl) ! friction velocity (m/s) - real(r8) :: ramu(lbl:ubl) ! aerodynamic resistance (s/m) - real(r8) :: rahu(lbl:ubl) ! thermal resistance (s/m) - real(r8) :: rawu(lbl:ubl) ! moisture resistance (s/m) - real(r8) :: temp1(lbl:ubl) ! relation for potential temperature profile - real(r8) :: temp12m(lbl:ubl) ! relation for potential temperature profile applied at 2-m - real(r8) :: temp2(lbl:ubl) ! relation for specific humidity profile - real(r8) :: temp22m(lbl:ubl) ! relation for specific humidity profile applied at 2-m - real(r8) :: thm_g(lbl:ubl) ! intermediate variable (forc_t+0.0098*forc_hgt_t) - real(r8) :: thv_g(lbl:ubl) ! virtual potential temperature (K) - real(r8) :: dth(lbl:ubl) ! diff of virtual temp. between ref. height and surface - real(r8) :: dqh(lbl:ubl) ! diff of humidity between ref. height and surface - real(r8) :: zldis(lbl:ubl) ! reference height "minus" zero displacement height (m) - real(r8) :: um(lbl:ubl) ! wind speed including the stablity effect (m/s) - real(r8) :: obu(lbl:ubl) ! Monin-Obukhov length (m) - real(r8) :: taf_numer(lbl:ubl) ! numerator of taf equation (K m/s) - real(r8) :: taf_denom(lbl:ubl) ! denominator of taf equation (m/s) - real(r8) :: qaf_numer(lbl:ubl) ! numerator of qaf equation (kg m/kg s) - real(r8) :: qaf_denom(lbl:ubl) ! denominator of qaf equation (m/s) - real(r8) :: wtas(lbl:ubl) ! sensible heat conductance for urban air to atmospheric air (m/s) - real(r8) :: wtaq(lbl:ubl) ! latent heat conductance for urban air to atmospheric air (m/s) - real(r8) :: wts_sum(lbl:ubl) ! sum of wtas, wtus_roof, wtus_road_perv, wtus_road_imperv, wtus_sunwall, wtus_shadewall - real(r8) :: wtq_sum(lbl:ubl) ! sum of wtaq, wtuq_roof, wtuq_road_perv, wtuq_road_imperv, wtuq_sunwall, wtuq_shadewall - real(r8) :: beta(lbl:ubl) ! coefficient of convective velocity - real(r8) :: zii(lbl:ubl) ! convective boundary layer height (m) - - real(r8) :: fm(lbl:ubl) ! needed for BGC only to diagnose 10m wind speed - - real(r8) :: wtus(lbc:ubc) ! sensible heat conductance for urban columns (m/s) - real(r8) :: wtuq(lbc:ubc) ! latent heat conductance for urban columns (m/s) - - integer :: iter ! iteration index - real(r8) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(r8) :: tstar ! temperature scaling parameter - real(r8) :: qstar ! moisture scaling parameter - real(r8) :: thvstar ! virtual potential temperature scaling parameter - real(r8) :: wtus_roof(lbl:ubl) ! sensible heat conductance for roof (not scaled) (m/s) - real(r8) :: wtuq_roof(lbl:ubl) ! latent heat conductance for roof (not scaled) (m/s) - real(r8) :: wtus_road_perv(lbl:ubl) ! sensible heat conductance for pervious road (not scaled) (m/s) - real(r8) :: wtuq_road_perv(lbl:ubl) ! latent heat conductance for pervious road (not scaled) (m/s) - real(r8) :: wtus_road_imperv(lbl:ubl) ! sensible heat conductance for impervious road (not scaled) (m/s) - real(r8) :: wtuq_road_imperv(lbl:ubl) ! latent heat conductance for impervious road (not scaled) (m/s) - real(r8) :: wtus_sunwall(lbl:ubl) ! sensible heat conductance for sunwall (not scaled) (m/s) - real(r8) :: wtuq_sunwall(lbl:ubl) ! latent heat conductance for sunwall (not scaled) (m/s) - real(r8) :: wtus_shadewall(lbl:ubl) ! sensible heat conductance for shadewall (not scaled) (m/s) - real(r8) :: wtuq_shadewall(lbl:ubl) ! latent heat conductance for shadewall (not scaled) (m/s) - real(r8) :: t_sunwall_innerl(lbl:ubl) ! temperature of inner layer of sunwall (K) - real(r8) :: t_shadewall_innerl(lbl:ubl) ! temperature of inner layer of shadewall (K) - real(r8) :: t_roof_innerl(lbl:ubl) ! temperature of inner layer of roof (K) - real(r8) :: lngth_roof ! length of roof (m) - real(r8) :: wc ! convective velocity (m/s) - real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory - real(r8) :: eflx_sh_grnd_scale(lbp:ubp) ! scaled sensible heat flux from ground (W/m**2) [+ to atm] - real(r8) :: qflx_evap_soi_scale(lbp:ubp) ! scaled soil evaporation (mm H2O/s) (+ = to atm) - real(r8) :: eflx_wasteheat_roof(lbl:ubl) ! sensible heat flux from urban heating/cooling sources of waste heat for roof (W/m**2) - real(r8) :: eflx_wasteheat_sunwall(lbl:ubl) ! sensible heat flux from urban heating/cooling sources of waste heat for sunwall (W/m**2) - real(r8) :: eflx_wasteheat_shadewall(lbl:ubl) ! sensible heat flux from urban heating/cooling sources of waste heat for shadewall (W/m**2) - real(r8) :: eflx_heat_from_ac_roof(lbl:ubl) ! sensible heat flux put back into canyon due to heat removal by AC for roof (W/m**2) - real(r8) :: eflx_heat_from_ac_sunwall(lbl:ubl) ! sensible heat flux put back into canyon due to heat removal by AC for sunwall (W/m**2) - real(r8) :: eflx_heat_from_ac_shadewall(lbl:ubl) ! sensible heat flux put back into canyon due to heat removal by AC for shadewall (W/m**2) - real(r8) :: eflx(lbl:ubl) ! total sensible heat flux for error check (W/m**2) - real(r8) :: qflx(lbl:ubl) ! total water vapor flux for error check (kg/m**2/s) - real(r8) :: eflx_scale(lbl:ubl) ! sum of scaled sensible heat fluxes for urban columns for error check (W/m**2) - real(r8) :: qflx_scale(lbl:ubl) ! sum of scaled water vapor fluxes for urban columns for error check (kg/m**2/s) - real(r8) :: eflx_err(lbl:ubl) ! sensible heat flux error (W/m**2) - real(r8) :: qflx_err(lbl:ubl) ! water vapor flux error (kg/m**2/s) - real(r8) :: fwet_roof ! fraction of roof surface that is wet (-) - real(r8) :: fwet_road_imperv ! fraction of impervious road surface that is wet (-) - - integer, parameter :: niters = 3 ! maximum number of iterations for surface temperature - integer :: local_secp1(lbl:ubl) ! seconds into current date in local time (sec) - real(r8) :: dtime ! land model time step (sec) - integer :: year,month,day,secs ! calendar info for current time step - logical :: found ! flag in search loop - integer :: indexl ! index of first found in search loop - integer :: nstep ! time step number - real(r8) :: z_d_town_loc(lbl:ubl) ! temporary copy - real(r8) :: z_0_town_loc(lbl:ubl) ! temporary copy - real(r8), parameter :: lapse_rate = 0.0098_r8 ! Dry adiabatic lapse rate (K/m) - real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa] - real(r8) :: de2mdT ! derivative of 2 m height surface saturated vapor pressure on t_ref2m - real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg] - real(r8) :: dqsat2mdT ! derivative of 2 m height surface saturated specific humidity on t_ref2m - -!----------------------------------------------------------------------- - - ! Assign pointers into module urban clumps - - if ( num_urbanl > 0 )then - ht_roof => urban_clump(nc)%ht_roof - wtlunit_roof => urban_clump(nc)%wtlunit_roof - canyon_hwr => urban_clump(nc)%canyon_hwr - wtroad_perv => urban_clump(nc)%wtroad_perv - wind_hgt_canyon => urban_clump(nc)%wind_hgt_canyon - end if - - ! Assign local pointers to multi-level derived type members (gridcell level) - - forc_t => clm_a2l%forc_t - forc_th => clm_a2l%forc_th - forc_u => clm_a2l%forc_u - forc_v => clm_a2l%forc_v - forc_rho => clm_a2l%forc_rho - forc_q => clm_a2l%forc_q - forc_pbot => clm_a2l%forc_pbot - londeg => grc%londeg - - ! Assign local pointers to derived type members (landunit level) - - pfti => lun%pfti - pftf => lun%pftf - coli => lun%coli - colf => lun%colf - lgridcell => lun%gridcell - z_0_town => lun%z_0_town - z_d_town => lun%z_d_town - taf => lps%taf - qaf => lps%qaf - npfts => lun%npfts - eflx_traffic => lef%eflx_traffic - eflx_traffic_factor => lef%eflx_traffic_factor - eflx_wasteheat => lef%eflx_wasteheat - eflx_heat_from_ac => lef%eflx_heat_from_ac - t_building => lps%t_building - - ! Assign local pointers to derived type members (column level) - - ctype => col%itype - t_grnd => ces%t_grnd - qg => cws%qg - htvp => cps%htvp - dqgdT => cws%dqgdT - t_soisno => ces%t_soisno - eflx_urban_ac => cef%eflx_urban_ac - eflx_urban_heat => cef%eflx_urban_heat - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - frac_sno => cps%frac_sno - snowdp => cps%snowdp - h2osno => cws%h2osno - snl => cps%snl - rootr_road_perv => cps%rootr_road_perv - soilalpha_u => cws%soilalpha_u - - ! Assign local pointers to derived type members (pft level) - - pgridcell => pft%gridcell - pcolumn => pft%column - plandunit => pft%landunit - ram1 => pps%ram1 - dlrad => pef%dlrad - ulrad => pef%ulrad - cgrnds => pef%cgrnds - cgrndl => pef%cgrndl - cgrnd => pef%cgrnd - taux => pmf%taux - tauy => pmf%tauy - eflx_sh_grnd => pef%eflx_sh_grnd - eflx_sh_tot => pef%eflx_sh_tot - eflx_sh_tot_u => pef%eflx_sh_tot_u - qflx_evap_soi => pwf%qflx_evap_soi - qflx_tran_veg => pwf%qflx_tran_veg - qflx_evap_veg => pwf%qflx_evap_veg - qflx_evap_tot => pwf%qflx_evap_tot - t_ref2m => pes%t_ref2m - q_ref2m => pes%q_ref2m - t_ref2m_u => pes%t_ref2m_u - t_veg => pes%t_veg - rootr => pps%rootr - psnsun => pcf%psnsun - psnsha => pcf%psnsha - forc_hgt_u_pft => pps%forc_hgt_u_pft - forc_hgt_t_pft => pps%forc_hgt_t_pft - forc_hgt_u_pft => pps%forc_hgt_u_pft - forc_hgt_t_pft => pps%forc_hgt_t_pft - rh_ref2m => pes%rh_ref2m - rh_ref2m_u => pes%rh_ref2m_u - - ! Define fields that appear on the restart file for non-urban landunits - - do fl = 1,num_nourbanl - l = filter_nourbanl(fl) - taf(l) = spval - qaf(l) = spval - end do - - ! Get time step - nstep = get_nstep() - - ! Set constants (same as in Biogeophysics1Mod) - beta(:) = 1._r8 ! Should be set to the same values as in Biogeophysics1Mod - zii(:) = 1000._r8 ! Should be set to the same values as in Biogeophysics1Mod - - ! Get current date - dtime = get_step_size() - call get_curr_date (year, month, day, secs) - - ! Compute canyontop wind using Masson (2000) - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - local_secp1(l) = secs + nint((londeg(g)/degpsec)/dtime)*dtime - local_secp1(l) = mod(local_secp1(l),isecspday) - - ! Error checks - - if (ht_roof(fl) - z_d_town(l) <= z_0_town(l)) then - write (iulog,*) 'aerodynamic parameter error in UrbanFluxes' - write (iulog,*) 'h_r - z_d <= z_0' - write (iulog,*) 'ht_roof, z_d_town, z_0_town: ', ht_roof(fl), z_d_town(l), & - z_0_town(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - if (forc_hgt_u_pft(pfti(l)) - z_d_town(l) <= z_0_town(l)) then - write (iulog,*) 'aerodynamic parameter error in UrbanFluxes' - write (iulog,*) 'h_u - z_d <= z_0' - write (iulog,*) 'forc_hgt_u_pft, z_d_town, z_0_town: ', forc_hgt_u_pft(pfti(l)), z_d_town(l), & - z_0_town(l) - write (iulog,*) 'clm model is stopping' - call endrun() - end if - - ! Magnitude of atmospheric wind - - ur(l) = max(1.0_r8,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g))) - - ! Canyon top wind - - canyontop_wind(fl) = ur(l) * & - log( (ht_roof(fl)-z_d_town(l)) / z_0_town(l) ) / & - log( (forc_hgt_u_pft(pfti(l))-z_d_town(l)) / z_0_town(l) ) - - ! U component of canyon wind - - if (canyon_hwr(fl) < 0.5_r8) then ! isolated roughness flow - canyon_u_wind(fl) = canyontop_wind(fl) * exp( -0.5_r8*canyon_hwr(fl)* & - (1._r8-(wind_hgt_canyon(fl)/ht_roof(fl))) ) - else if (canyon_hwr(fl) < 1.0_r8) then ! wake interference flow - canyon_u_wind(fl) = canyontop_wind(fl) * (1._r8+2._r8*(2._r8/rpi - 1._r8)* & - (ht_roof(fl)/(ht_roof(fl)/canyon_hwr(fl)) - 0.5_r8)) * & - exp(-0.5_r8*canyon_hwr(fl)*(1._r8-(wind_hgt_canyon(fl)/ht_roof(fl)))) - else ! skimming flow - canyon_u_wind(fl) = canyontop_wind(fl) * (2._r8/rpi) * & - exp(-0.5_r8*canyon_hwr(fl)*(1._r8-(wind_hgt_canyon(fl)/ht_roof(fl)))) - end if - - end do - -! Compute fluxes - Follows CLM approach for bare soils (Oleson et al 2004) - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - thm_g(l) = forc_t(g) + lapse_rate*forc_hgt_t_pft(pfti(l)) - thv_g(l) = forc_th(g)*(1._r8+0.61_r8*forc_q(g)) - dth(l) = thm_g(l)-taf(l) - dqh(l) = forc_q(g)-qaf(l) - dthv = dth(l)*(1._r8+0.61_r8*forc_q(g))+0.61_r8*forc_th(g)*dqh(l) - zldis(l) = forc_hgt_u_pft(pfti(l)) - z_d_town(l) - - ! Initialize Monin-Obukhov length and wind speed including convective velocity - - call MoninObukIni(ur(l), thv_g(l), dthv, zldis(l), z_0_town(l), um(l), obu(l)) - - end do - - ! Initialize conductances - wtus_roof(:) = 0._r8 - wtus_road_perv(:) = 0._r8 - wtus_road_imperv(:) = 0._r8 - wtus_sunwall(:) = 0._r8 - wtus_shadewall(:) = 0._r8 - wtuq_roof(:) = 0._r8 - wtuq_road_perv(:) = 0._r8 - wtuq_road_imperv(:) = 0._r8 - wtuq_sunwall(:) = 0._r8 - wtuq_shadewall(:) = 0._r8 - - ! Make copies so that array sections are not passed in function calls to friction velocity - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - z_d_town_loc(l) = z_d_town(l) - z_0_town_loc(l) = z_0_town(l) - end do - - ! Start stability iteration - - do iter = 1,niters - - ! Get friction velocity, relation for potential - ! temperature and humidity profiles of surface boundary layer. - - if (num_urbanl .gt. 0) then - call FrictionVelocity(lbl, ubl, num_urbanl, filter_urbanl, & - z_d_town_loc, z_0_town_loc, z_0_town_loc, z_0_town_loc, & - obu, iter, ur, um, ustar, & - temp1, temp2, temp12m, temp22m, fm, landunit_index=.true.) - end if - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - ! Determine aerodynamic resistance to fluxes from urban canopy air to - ! atmosphere - - ramu(l) = 1._r8/(ustar(l)*ustar(l)/um(l)) - rahu(l) = 1._r8/(temp1(l)*ustar(l)) - rawu(l) = 1._r8/(temp2(l)*ustar(l)) - - ! Determine magnitude of canyon wind by using horizontal wind determined - ! previously and vertical wind from friction velocity (Masson 2000) - - canyon_wind(fl) = sqrt(canyon_u_wind(fl)**2._r8 + ustar(l)**2._r8) - - ! Determine canyon_resistance (currently this single resistance determines the - ! resistance from urban surfaces (roof, pervious and impervious road, sunlit and - ! shaded walls) to urban canopy air, since it is only dependent on wind speed - ! Also from Masson 2000. - - canyon_resistance(fl) = cpair * forc_rho(g) / (11.8_r8 + 4.2_r8*canyon_wind(fl)) - - end do - - ! This is the first term in the equation solutions for urban canopy air temperature - ! and specific humidity (numerator) and is a landunit quantity - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - taf_numer(l) = thm_g(l)/rahu(l) - taf_denom(l) = 1._r8/rahu(l) - qaf_numer(l) = forc_q(g)/rawu(l) - qaf_denom(l) = 1._r8/rawu(l) - - ! First term needed for derivative of heat fluxes - wtas(l) = 1._r8/rahu(l) - wtaq(l) = 1._r8/rawu(l) - - end do - - - ! Gather other terms for other urban columns for numerator and denominator of - ! equations for urban canopy air temperature and specific humidity - - do pi = 1,maxpatch_urb - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if ( pi <= npfts(l) ) then - c = coli(l) + pi - 1 - - if (ctype(c) == icol_roof) then - - ! scaled sensible heat conductance - wtus(c) = wtlunit_roof(fl)/canyon_resistance(fl) - ! unscaled sensible heat conductance - wtus_roof(l) = 1._r8/canyon_resistance(fl) - - if (snowdp(c) > 0._r8) then - fwet_roof = min(snowdp(c)/0.05_r8, 1._r8) - else - fwet_roof = (max(0._r8, h2osoi_liq(c,1)+h2osoi_ice(c,1))/pondmx_urban)**0.666666666666_r8 - fwet_roof = min(fwet_roof,1._r8) - end if - if (qaf(l) > qg(c)) then - fwet_roof = 1._r8 - end if - ! scaled latent heat conductance - wtuq(c) = fwet_roof*(wtlunit_roof(fl)/canyon_resistance(fl)) - ! unscaled latent heat conductance - wtuq_roof(l) = fwet_roof*(1._r8/canyon_resistance(fl)) - - ! wasteheat from heating/cooling - if (trim(urban_hac) == urban_wasteheat_on) then - eflx_wasteheat_roof(l) = ac_wasteheat_factor * eflx_urban_ac(c) + & - ht_wasteheat_factor * eflx_urban_heat(c) - else - eflx_wasteheat_roof(l) = 0._r8 - end if - - ! If air conditioning on, always replace heat removed with heat into canyon - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - eflx_heat_from_ac_roof(l) = abs(eflx_urban_ac(c)) - else - eflx_heat_from_ac_roof(l) = 0._r8 - end if - - else if (ctype(c) == icol_road_perv) then - - ! scaled sensible heat conductance - wtus(c) = wtroad_perv(fl)*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled sensible heat conductance - if (wtroad_perv(fl) > 0._r8) then - wtus_road_perv(l) = 1._r8/canyon_resistance(fl) - else - wtus_road_perv(l) = 0._r8 - end if - - ! scaled latent heat conductance - wtuq(c) = wtroad_perv(fl)*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled latent heat conductance - if (wtroad_perv(fl) > 0._r8) then - wtuq_road_perv(l) = 1._r8/canyon_resistance(fl) - else - wtuq_road_perv(l) = 0._r8 - end if - - else if (ctype(c) == icol_road_imperv) then - - ! scaled sensible heat conductance - wtus(c) = (1._r8-wtroad_perv(fl))*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled sensible heat conductance - if ((1._r8-wtroad_perv(fl)) > 0._r8) then - wtus_road_imperv(l) = 1._r8/canyon_resistance(fl) - else - wtus_road_imperv(l) = 0._r8 - end if - - if (snowdp(c) > 0._r8) then - fwet_road_imperv = min(snowdp(c)/0.05_r8, 1._r8) - else - fwet_road_imperv = (max(0._r8, h2osoi_liq(c,1)+h2osoi_ice(c,1))/pondmx_urban)**0.666666666666_r8 - fwet_road_imperv = min(fwet_road_imperv,1._r8) - end if - if (qaf(l) > qg(c)) then - fwet_road_imperv = 1._r8 - end if - ! scaled latent heat conductance - wtuq(c) = fwet_road_imperv*(1._r8-wtroad_perv(fl))*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled latent heat conductance - if ((1._r8-wtroad_perv(fl)) > 0._r8) then - wtuq_road_imperv(l) = fwet_road_imperv*(1._r8/canyon_resistance(fl)) - else - wtuq_road_imperv(l) = 0._r8 - end if - - else if (ctype(c) == icol_sunwall) then - - ! scaled sensible heat conductance - wtus(c) = canyon_hwr(fl)*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled sensible heat conductance - wtus_sunwall(l) = 1._r8/canyon_resistance(fl) - - ! scaled latent heat conductance - wtuq(c) = 0._r8 - ! unscaled latent heat conductance - wtuq_sunwall(l) = 0._r8 - - ! wasteheat from heating/cooling - if (trim(urban_hac) == urban_wasteheat_on) then - eflx_wasteheat_sunwall(l) = ac_wasteheat_factor * eflx_urban_ac(c) + & - ht_wasteheat_factor * eflx_urban_heat(c) - else - eflx_wasteheat_sunwall(l) = 0._r8 - end if - - ! If air conditioning on, always replace heat removed with heat into canyon - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - eflx_heat_from_ac_sunwall(l) = abs(eflx_urban_ac(c)) - else - eflx_heat_from_ac_sunwall(l) = 0._r8 - end if - - else if (ctype(c) == icol_shadewall) then - - ! scaled sensible heat conductance - wtus(c) = canyon_hwr(fl)*(1._r8-wtlunit_roof(fl))/canyon_resistance(fl) - ! unscaled sensible heat conductance - wtus_shadewall(l) = 1._r8/canyon_resistance(fl) - - ! scaled latent heat conductance - wtuq(c) = 0._r8 - ! unscaled latent heat conductance - wtuq_shadewall(l) = 0._r8 - - ! wasteheat from heating/cooling - if (trim(urban_hac) == urban_wasteheat_on) then - eflx_wasteheat_shadewall(l) = ac_wasteheat_factor * eflx_urban_ac(c) + & - ht_wasteheat_factor * eflx_urban_heat(c) - else - eflx_wasteheat_shadewall(l) = 0._r8 - end if - - ! If air conditioning on, always replace heat removed with heat into canyon - if (trim(urban_hac) == urban_hac_on .or. trim(urban_hac) == urban_wasteheat_on) then - eflx_heat_from_ac_shadewall(l) = abs(eflx_urban_ac(c)) - else - eflx_heat_from_ac_shadewall(l) = 0._r8 - end if - else - write(iulog,*) 'c, ctype, pi = ', c, ctype(c), pi - write(iulog,*) 'Column indices for: shadewall, sunwall, road_imperv, road_perv, roof: ' - write(iulog,*) icol_shadewall, icol_sunwall, icol_road_imperv, icol_road_perv, icol_roof - call endrun( sub//':: ERROR, ctype out of range' ) - end if - - taf_numer(l) = taf_numer(l) + t_grnd(c)*wtus(c) - taf_denom(l) = taf_denom(l) + wtus(c) - qaf_numer(l) = qaf_numer(l) + qg(c)*wtuq(c) - qaf_denom(l) = qaf_denom(l) + wtuq(c) - - end if - end do - end do - - ! Calculate new urban canopy air temperature and specific humidity - - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - ! Total waste heat and heat from AC is sum of heat for walls and roofs - ! accounting for different surface areas - eflx_wasteheat(l) = wtlunit_roof(fl)*eflx_wasteheat_roof(l) + & - (1._r8-wtlunit_roof(fl))*(canyon_hwr(fl)*(eflx_wasteheat_sunwall(l) + & - eflx_wasteheat_shadewall(l))) - - ! Limit wasteheat to ensure that we don't get any unrealistically strong - ! positive feedbacks due to AC in a warmer climate - eflx_wasteheat(l) = min(eflx_wasteheat(l),wasteheat_limit) - - eflx_heat_from_ac(l) = wtlunit_roof(fl)*eflx_heat_from_ac_roof(l) + & - (1._r8-wtlunit_roof(fl))*(canyon_hwr(fl)*(eflx_heat_from_ac_sunwall(l) + & - eflx_heat_from_ac_shadewall(l))) - - ! Calculate traffic heat flux - ! Only comes from impervious road - eflx_traffic(l) = (1._r8-wtlunit_roof(fl))*(1._r8-wtroad_perv(fl))* & - eflx_traffic_factor(l) - - taf(l) = taf_numer(l)/taf_denom(l) - qaf(l) = qaf_numer(l)/qaf_denom(l) - - wts_sum(l) = wtas(l) + wtus_roof(l) + wtus_road_perv(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l) - - wtq_sum(l) = wtaq(l) + wtuq_roof(l) + wtuq_road_perv(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l) - - end do - - ! This section of code is not required if niters = 1 - ! Determine stability using new taf and qaf - ! TODO: Some of these constants replicate what is in FrictionVelocity and BareGround fluxes should consildate. EBK - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - - dth(l) = thm_g(l)-taf(l) - dqh(l) = forc_q(g)-qaf(l) - tstar = temp1(l)*dth(l) - qstar = temp2(l)*dqh(l) - thvstar = tstar*(1._r8+0.61_r8*forc_q(g)) + 0.61_r8*forc_th(g)*qstar - zeta = zldis(l)*vkc*grav*thvstar/(ustar(l)**2*thv_g(l)) - - if (zeta >= 0._r8) then !stable - zeta = min(2._r8,max(zeta,0.01_r8)) - um(l) = max(ur(l),0.1_r8) - else !unstable - zeta = max(-100._r8,min(zeta,-0.01_r8)) - wc = beta(l)*(-grav*ustar(l)*thvstar*zii(l)/thv_g(l))**0.333_r8 - um(l) = sqrt(ur(l)*ur(l) + wc*wc) - end if - - obu(l) = zldis(l)/zeta - end do - - end do ! end iteration - -! Determine fluxes from canyon surfaces - - do f = 1, num_urbanp - - p = filter_urbanp(f) - c = pcolumn(p) - g = pgridcell(p) - l = plandunit(p) - - ram1(p) = ramu(l) !pass value to global variable - - ! Upward and downward canopy longwave are zero - - ulrad(p) = 0._r8 - dlrad(p) = 0._r8 - - ! Derivative of sensible and latent heat fluxes with respect to - ! ground temperature - - if (ctype(c) == icol_roof) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_road_perv(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_roof(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_road_perv(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_roof(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_road_perv) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_imperv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_road_perv(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_roof(l) + & - wtuq_road_imperv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_road_perv(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_road_imperv) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_sunwall(l) + wtus_shadewall(l)) * & - (wtus_road_imperv(l)/wts_sum(l)) - cgrndl(p) = forc_rho(g) * (wtaq(l) + wtuq_roof(l) + & - wtuq_road_perv(l) + wtuq_sunwall(l) + wtuq_shadewall(l)) * & - (wtuq_road_imperv(l)/wtq_sum(l))*dqgdT(c) - else if (ctype(c) == icol_sunwall) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_road_imperv(l) + wtus_shadewall(l)) * & - (wtus_sunwall(l)/wts_sum(l)) - cgrndl(p) = 0._r8 - else if (ctype(c) == icol_shadewall) then - cgrnds(p) = forc_rho(g) * cpair * (wtas(l) + wtus_roof(l) + & - wtus_road_perv(l) + wtus_road_imperv(l) + wtus_sunwall(l)) * & - (wtus_shadewall(l)/wts_sum(l)) - cgrndl(p) = 0._r8 - end if - cgrnd(p) = cgrnds(p) + cgrndl(p)*htvp(c) - - ! Surface fluxes of momentum, sensible and latent heat - - taux(p) = -forc_rho(g)*forc_u(g)/ramu(l) - tauy(p) = -forc_rho(g)*forc_v(g)/ramu(l) - - ! Use new canopy air temperature - dth(l) = taf(l) - t_grnd(c) - - if (ctype(c) == icol_roof) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_roof(l)*dth(l) - else if (ctype(c) == icol_road_perv) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_road_perv(l)*dth(l) - else if (ctype(c) == icol_road_imperv) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_road_imperv(l)*dth(l) - else if (ctype(c) == icol_sunwall) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_sunwall(l)*dth(l) - else if (ctype(c) == icol_shadewall) then - eflx_sh_grnd(p) = -forc_rho(g)*cpair*wtus_shadewall(l)*dth(l) - end if - - eflx_sh_tot(p) = eflx_sh_grnd(p) - eflx_sh_tot_u(p) = eflx_sh_tot(p) - - dqh(l) = qaf(l) - qg(c) - - if (ctype(c) == icol_roof) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_roof(l)*dqh(l) - else if (ctype(c) == icol_road_perv) then - ! Evaporation assigned to soil term if dew or snow - ! or if no liquid water available in soil column - if (dqh(l) > 0._r8 .or. frac_sno(c) > 0._r8 .or. soilalpha_u(c) .le. 0._r8) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_road_perv(l)*dqh(l) - qflx_tran_veg(p) = 0._r8 - ! Otherwise, evaporation assigned to transpiration term - else - qflx_evap_soi(p) = 0._r8 - qflx_tran_veg(p) = -forc_rho(g)*wtuq_road_perv(l)*dqh(l) - end if - qflx_evap_veg(p) = qflx_tran_veg(p) - else if (ctype(c) == icol_road_imperv) then - qflx_evap_soi(p) = -forc_rho(g)*wtuq_road_imperv(l)*dqh(l) - else if (ctype(c) == icol_sunwall) then - qflx_evap_soi(p) = 0._r8 - else if (ctype(c) == icol_shadewall) then - qflx_evap_soi(p) = 0._r8 - end if - - ! SCALED sensible and latent heat flux for error check - eflx_sh_grnd_scale(p) = -forc_rho(g)*cpair*wtus(c)*dth(l) - qflx_evap_soi_scale(p) = -forc_rho(g)*wtuq(c)*dqh(l) - - end do - - ! Check to see that total sensible and latent heat equal the sum of - ! the scaled heat fluxes above - do fl = 1, num_urbanl - l = filter_urbanl(fl) - g = lgridcell(l) - eflx(l) = -(forc_rho(g)*cpair/rahu(l))*(thm_g(l) - taf(l)) - qflx(l) = -(forc_rho(g)/rawu(l))*(forc_q(g) - qaf(l)) - eflx_scale(l) = sum(eflx_sh_grnd_scale(pfti(l):pftf(l))) - qflx_scale(l) = sum(qflx_evap_soi_scale(pfti(l):pftf(l))) - eflx_err(l) = eflx_scale(l) - eflx(l) - qflx_err(l) = qflx_scale(l) - qflx(l) - end do - - found = .false. - do fl = 1, num_urbanl - l = filter_urbanl(fl) - if (abs(eflx_err(l)) > 0.01_r8) then - found = .true. - indexl = l - exit - end if - end do - if ( found ) then - write(iulog,*)'WARNING: Total sensible heat does not equal sum of scaled heat fluxes for urban columns ',& - ' nstep = ',nstep,' indexl= ',indexl,' eflx_err= ',eflx_err(indexl) - if (abs(eflx_err(indexl)) > .01_r8) then - write(iulog,*)'clm model is stopping - error is greater than .01 W/m**2' - write(iulog,*)'eflx_scale = ',eflx_scale(indexl) - write(iulog,*)'eflx_sh_grnd_scale: ',eflx_sh_grnd_scale(pfti(indexl):pftf(indexl)) - write(iulog,*)'eflx = ',eflx(indexl) - call endrun - end if - end if - - found = .false. - do fl = 1, num_urbanl - l = filter_urbanl(fl) - ! 4.e-9 kg/m**2/s = 0.01 W/m**2 - if (abs(qflx_err(l)) > 4.e-9_r8) then - found = .true. - indexl = l - exit - end if - end do - if ( found ) then - write(iulog,*)'WARNING: Total water vapor flux does not equal sum of scaled water vapor fluxes for urban columns ',& - ' nstep = ',nstep,' indexl= ',indexl,' qflx_err= ',qflx_err(indexl) - if (abs(qflx_err(indexl)) > 4.e-9_r8) then - write(iulog,*)'clm model is stopping - error is greater than 4.e-9 kg/m**2/s' - write(iulog,*)'qflx_scale = ',qflx_scale(indexl) - write(iulog,*)'qflx = ',qflx(indexl) - call endrun - end if - end if - - ! Gather terms required to determine internal building temperature - - do pi = 1,maxpatch_urb - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if ( pi <= npfts(l) ) then - c = coli(l) + pi - 1 - - if (ctype(c) == icol_roof) then - t_roof_innerl(l) = t_soisno(c,nlevurb) - else if (ctype(c) == icol_sunwall) then - t_sunwall_innerl(l) = t_soisno(c,nlevurb) - else if (ctype(c) == icol_shadewall) then - t_shadewall_innerl(l) = t_soisno(c,nlevurb) - end if - - end if - end do - end do - - ! Calculate internal building temperature - do fl = 1, num_urbanl - l = filter_urbanl(fl) - - lngth_roof = (ht_roof(fl)/canyon_hwr(fl))*wtlunit_roof(fl)/(1._r8-wtlunit_roof(fl)) - t_building(l) = (ht_roof(fl)*(t_shadewall_innerl(l) + t_sunwall_innerl(l)) & - +lngth_roof*t_roof_innerl(l))/(2._r8*ht_roof(fl)+lngth_roof) - end do - - ! No roots for urban except for pervious road - - do j = 1, nlevurb - do f = 1, num_urbanp - p = filter_urbanp(f) - c = pcolumn(p) - if (ctype(c) == icol_road_perv) then - rootr(p,j) = rootr_road_perv(c,j) - else - rootr(p,j) = 0._r8 - end if - end do - end do - - do f = 1, num_urbanp - - p = filter_urbanp(f) - c = pcolumn(p) - g = pgridcell(p) - l = plandunit(p) - - ! Use urban canopy air temperature and specific humidity to represent - ! 2-m temperature and humidity - - t_ref2m(p) = taf(l) - q_ref2m(p) = qaf(l) - t_ref2m_u(p) = taf(l) - - ! 2 m height relative humidity - - call QSat(t_ref2m(p), forc_pbot(g), e_ref2m, de2mdT, qsat_ref2m, dqsat2mdT) - rh_ref2m(p) = min(100._r8, q_ref2m(p) / qsat_ref2m * 100._r8) - rh_ref2m_u(p) = rh_ref2m(p) - - ! Variables needed by history tape - - t_veg(p) = forc_t(g) - - ! Add the following to avoid NaN - - psnsun(p) = 0._r8 - psnsha(p) = 0._r8 - pps%lncsun(p) = 0._r8 - pps%lncsha(p) = 0._r8 - pps%vcmxsun(p) = 0._r8 - pps%vcmxsha(p) = 0._r8 - - end do - - end subroutine UrbanFluxes - -end module UrbanMod diff --git a/src_clm40/biogeophys/clm_driverInitMod.F90 b/src_clm40/biogeophys/clm_driverInitMod.F90 deleted file mode 100644 index ac28ed9558..0000000000 --- a/src_clm40/biogeophys/clm_driverInitMod.F90 +++ /dev/null @@ -1,247 +0,0 @@ - -module clm_driverInitMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_driverInitMod -! -! !DESCRIPTION: -! Initialization of clm driver variables needed from previous timestep -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: clm_driverInit -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: clm_driverInit -! -! !INTERFACE: - subroutine clm_driverInit(lbc, ubc, lbp, ubp, & - num_nolakec, filter_nolakec, num_lakec, filter_lakec) -! -! !DESCRIPTION: -! Initialization of clm driver variables needed from previous timestep -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_varpar , only : nlevsno - use subgridAveMod, only : p2c - use clm_varcon, only : h2osno_max, rair, cpair, grav, istice_mec, lapse_glcmec - use clm_atmlnd, only : clm_a2l - use domainMod, only : ldomain - use clmtype - use QsatMod, only : Qsat - -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column-index bounds - integer, intent(in) :: lbp, ubp ! pft-index bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: num_lakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_lakec(ubc-lbc+1) ! column filter for non-lake points -! -! !CALLED FROM: -! subroutine driver1 -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -! -! local pointers to original implicit in variables -! - real(r8), pointer :: pwtgcell(:) ! weight of pft wrt corresponding gridcell - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - integer , pointer :: frac_veg_nosno_alb(:) ! fraction of vegetation not covered by snow (0 OR 1) [-] - integer , pointer :: frac_veg_nosno(:) ! fraction of vegetation not covered by snow (0 OR 1 now) [-] (pft-level) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) -! -! local pointers to original implicit out variables -! - logical , pointer :: do_capsnow(:) ! true => do snow capping - real(r8), pointer :: h2osno_old(:) ! snow water (mm H2O) at previous time step - real(r8), pointer :: frac_iceold(:,:) ! fraction of ice relative to the tot water -! -! !OTHER LOCAL VARIABLES: -!EOP -! - integer :: g, l, c, p, f, j, fc ! indices - - real(r8), pointer :: qflx_glcice(:) ! flux of new glacier ice (mm H2O/s) [+ = ice grows] - real(r8), pointer :: eflx_bot(:) ! heat flux from beneath soil/ice column (W/m**2) - real(r8), pointer :: glc_topo(:) ! sfc elevation for glacier_mec column (m) - real(r8), pointer :: forc_t(:) ! atmospheric temperature (Kelvin) - real(r8), pointer :: forc_th(:) ! atmospheric potential temperature (Kelvin) - real(r8), pointer :: forc_q(:) ! atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_pbot(:) ! atmospheric pressure (Pa) - real(r8), pointer :: forc_rho(:) ! atmospheric density (kg/m**3) - integer , pointer :: cgridcell(:) ! column's gridcell - integer , pointer :: clandunit(:) ! column's landunit - integer , pointer :: plandunit(:) ! pft's landunit - integer , pointer :: ityplun(:) ! landunit type - - ! temporaries for topo downscaling - real(r8) :: hsurf_g,hsurf_c,Hbot - real(r8) :: zbot_g, tbot_g, pbot_g, thbot_g, qbot_g, qs_g, es_g - real(r8) :: zbot_c, tbot_c, pbot_c, thbot_c, qbot_c, qs_c, es_c - real(r8) :: egcm_c, rhos_c - real(r8) :: dum1, dum2 - -!----------------------------------------------------------------------- - - ! Assign local pointers to derived type members (landunit-level) - - ityplun => lun%itype - - ! Assign local pointers to derived type members (column-level) - - snl => cps%snl - h2osno => cws%h2osno - h2osno_old => cws%h2osno_old - do_capsnow => cps%do_capsnow - frac_iceold => cps%frac_iceold - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - frac_veg_nosno_alb => pps%frac_veg_nosno_alb - frac_veg_nosno => pps%frac_veg_nosno - qflx_glcice => cwf%qflx_glcice - eflx_bot => cef%eflx_bot - glc_topo => cps%glc_topo - forc_t => ces%forc_t - forc_th => ces%forc_th - forc_q => cws%forc_q - forc_pbot => cps%forc_pbot - forc_rho => cps%forc_rho - clandunit => col%landunit - cgridcell => col%gridcell - - ! Assign local pointers to derived type members (pft-level) - - pwtgcell => pft%wtgcell - plandunit => pft%landunit - - do c = lbc, ubc - - l = clandunit(c) - g = cgridcell(c) - - ! Initialize column forcing - - forc_t(c) = clm_a2l%forc_t(g) - forc_th(c) = clm_a2l%forc_th(g) - forc_q(c) = clm_a2l%forc_q(g) - forc_pbot(c) = clm_a2l%forc_pbot(g) - forc_rho(c) = clm_a2l%forc_rho(g) - - ! Save snow mass at previous time step - h2osno_old(c) = h2osno(c) - - ! Decide whether to cap snow - if (h2osno(c) > h2osno_max) then - do_capsnow(c) = .true. - else - do_capsnow(c) = .false. - end if - eflx_bot(c) = 0._r8 - - ! Initialize qflx_glcice, but only over ice_mec landunits (elsewhere, it is spval) - if (ityplun(l) == istice_mec) then - qflx_glcice(c) = 0._r8 - end if - - end do - - ! Initialize fraction of vegetation not covered by snow (pft-level) - - do p = lbp,ubp - l = plandunit(p) - ! Note: Some glacier_mec points may have zero weight - if (pwtgcell(p)>0._r8 .or. ityplun(l) == istice_mec) then - frac_veg_nosno(p) = frac_veg_nosno_alb(p) - else - frac_veg_nosno(p) = 0._r8 - end if - end do - - ! Initialize set of previous time-step variables - ! Ice fraction of snow at previous time step - - do j = -nlevsno+1,0 - do f = 1, num_nolakec - c = filter_nolakec(f) - if (j >= snl(c) + 1) then - frac_iceold(c,j) = h2osoi_ice(c,j)/(h2osoi_liq(c,j)+h2osoi_ice(c,j)) - end if - end do - end do - - ! Downscale forc_t, forc_th, forc_q, forc_pbot, and forc_rho to columns. - ! For glacier_mec columns the downscaling is based on surface elevation. - ! For other columns the downscaling is a simple copy. - - do f = 1, num_nolakec - c = filter_nolakec(f) - l = clandunit(c) - g = cgridcell(c) - - if (ityplun(l) == istice_mec) then ! downscale to elevation classes - - ! This is a simple downscaling procedure taken from subroutine clm_mapa2l. - ! Note that forc_hgt, forc_u, and forc_v are not downscaled. - - hsurf_g = ldomain%topo(g) ! gridcell sfc elevation - hsurf_c = glc_topo(c) ! column sfc elevation - - tbot_g = clm_a2l%forc_t(g) ! atm sfc temp - thbot_g = clm_a2l%forc_th(g) ! atm sfc pot temp - qbot_g = clm_a2l%forc_q(g) ! atm sfc spec humid - pbot_g = clm_a2l%forc_pbot(g) ! atm sfc pressure - zbot_g = clm_a2l%forc_hgt(g) ! atm ref height - - zbot_c = zbot_g - tbot_c = tbot_g-lapse_glcmec*(hsurf_c-hsurf_g) ! sfc temp for column - - Hbot = rair*0.5_r8*(tbot_g+tbot_c)/grav ! scale ht at avg temp - pbot_c = pbot_g*exp(-(hsurf_c-hsurf_g)/Hbot) ! column sfc press - thbot_c= tbot_c*exp((zbot_c/Hbot)*(rair/cpair)) ! pot temp calc - - call Qsat(tbot_g,pbot_g,es_g,dum1,qs_g,dum2) - call Qsat(tbot_c,pbot_c,es_c,dum1,qs_c,dum2) - - qbot_c = qbot_g*(qs_c/qs_g) - egcm_c = qbot_c*pbot_c/(0.622+0.378*qbot_c) - rhos_c = (pbot_c-0.378*egcm_c) / (rair*tbot_c) - - forc_t(c) = tbot_c - forc_th(c) = thbot_c - forc_q(c) = qbot_c - forc_pbot(c) = pbot_c - forc_rho(c) = rhos_c - - endif - - enddo ! num_nolakec - - end subroutine clm_driverInit - -end module clm_driverInitMod diff --git a/src_clm40/main/CMakeLists.txt b/src_clm40/main/CMakeLists.txt deleted file mode 100644 index f5594094fd..0000000000 --- a/src_clm40/main/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Note that this is just used for unit testing; hence, we only need to add -# source files that are currently used in unit tests - -list(APPEND clm_sources domainMod.F90) - -sourcelist_to_parent(clm_sources) diff --git a/src_clm40/main/CNiniSpecial.F90 b/src_clm40/main/CNiniSpecial.F90 deleted file mode 100644 index 91677c0dbb..0000000000 --- a/src_clm40/main/CNiniSpecial.F90 +++ /dev/null @@ -1,223 +0,0 @@ -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNiniSpecial -! -! !INTERFACE: -subroutine CNiniSpecial () -! -! !DESCRIPTION: -! One-time initialization of CN variables for special landunits -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use pftvarcon , only: noveg - use decompMod , only: get_proc_bounds - use clm_varcon , only: spval - use clm_varctl , only: iulog, use_c13, use_cn - use clmtype - use CNSetValueMod -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine iniTimeConst in file iniTimeConst.F90 -! -! !REVISION HISTORY: -! 11/13/03: Created by Peter Thornton -! -! -! local pointers to implicit in arguments -! - integer , pointer :: clandunit(:) ! landunit index of corresponding column - integer , pointer :: plandunit(:) ! landunit index of corresponding pft - logical , pointer :: ifspecial(:) ! BOOL: true=>landunit is wetland,ice,lake, or urban -! -! local pointers to implicit out arguments -! -! !LOCAL VARIABLES: -!EOP - integer :: fc,fp,l,c,p ! indices - integer :: begp, endp ! per-clump/proc beginning and ending pft indices - integer :: begc, endc ! per-clump/proc beginning and ending column indices - integer :: begl, endl ! per-clump/proc beginning and ending landunit indices - integer :: begg, endg ! per-clump/proc gridcell ending gridcell indices - integer :: num_specialc ! number of good values in specialc filter - integer :: num_specialp ! number of good values in specialp filter - integer, allocatable :: specialc(:) ! special landunit filter - columns - integer, allocatable :: specialp(:) ! special landunit filter - pfts -!----------------------------------------------------------------------- - ! assign local pointers at the landunit level - ifspecial => lun%ifspecial - - ! assign local pointers at the column level - clandunit => col%landunit - - ! assign local pointers at the pft level - plandunit => pft%landunit - - ! Determine subgrid bounds on this processor - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! allocate special landunit filters - allocate(specialc(endc-begc+1)) - allocate(specialp(endp-begp+1)) - - ! fill special landunit filters - num_specialc = 0 - do c = begc, endc - l = clandunit(c) - if (ifspecial(l)) then - num_specialc = num_specialc + 1 - specialc(num_specialc) = c - end if - end do - - num_specialp = 0 - do p = begp, endp - l = plandunit(p) - if (ifspecial(l)) then - num_specialp = num_specialp + 1 - specialp(num_specialp) = p - end if - end do - - ! initialize column-level fields - call CNSetCps(num_specialc, specialc, spval, cps) - call CNSetCcs(num_specialc, specialc, 0._r8, ccs) - call CNSetCns(num_specialc, specialc, 0._r8, cns) - call CNSetCcf(num_specialc, specialc, 0._r8, ccf) - call CNSetCnf(num_specialc, specialc, 0._r8, cnf) - if (use_c13) then - ! 4/14/05: PET - ! adding isotope code - call CNSetCcs(num_specialc, specialc, 0._r8, cc13s) - call CNSetCcf(num_specialc, specialc, 0._r8, cc13f) - endif - - ! initialize column-average pft fields - call CNSetPps(num_specialc, specialc, spval, pps_a) - call CNSetPcs(num_specialc, specialc, 0._r8, pcs_a) - call CNSetPns(num_specialc, specialc, 0._r8, pns_a) - call CNSetPcf(num_specialc, specialc, 0._r8, pcf_a) - call CNSetPnf(num_specialc, specialc, 0._r8, pnf_a) - - ! initialize pft-level fields - call CNSetPepv(num_specialp, specialp, spval, pepv) - call CNSetPps(num_specialp, specialp, spval, pps) - call CNSetPcs(num_specialp, specialp, 0._r8, pcs) - call CNSetPns(num_specialp, specialp, 0._r8, pns) - call CNSetPcf(num_specialp, specialp, 0._r8, pcf) - call CNSetPnf(num_specialp, specialp, 0._r8, pnf) - if (use_c13) then - ! 4/14/05: PET - ! adding isotope code - call CNSetPcs(num_specialp, specialp, 0._r8, pc13s) - call CNSetPcf(num_specialp, specialp, 0._r8, pc13f) - endif - - ! now loop through special filters and explicitly set the variables that - ! have to be in place for SurfaceAlbedo and biogeophysics - ! also set pcf%psnsun and pcf%psnsha to 0 (not included in CNSetPcf()) - - do fp = 1,num_specialp - p = specialp(fp) - pps%tlai(p) = 0._r8 - pps%tsai(p) = 0._r8 - pps%elai(p) = 0._r8 - pps%esai(p) = 0._r8 - pps%htop(p) = 0._r8 - pps%hbot(p) = 0._r8 - pps%fwet(p) = 0._r8 - pps%fdry(p) = 0._r8 - pps%frac_veg_nosno_alb(p) = 0._r8 - pps%frac_veg_nosno(p) = 0._r8 - pcf%psnsun(p) = 0._r8 - pcf%psnsha(p) = 0._r8 - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - pc13f%psnsun(p) = 0._r8 - pc13f%psnsha(p) = 0._r8 - endif - - end do - - do fc = 1,num_specialc - c = specialc(fc) - pcf_a%psnsun(c) = 0._r8 - pcf_a%psnsha(c) = 0._r8 - if (use_c13) then - ! 8/17/05: PET - ! Adding isotope code - pcf_a%psnsun(c) = 0._r8 - pcf_a%psnsha(c) = 0._r8 - endif - - ! adding dynpft code - ccs%seedc(c) = 0._r8 - ccs%prod10c(c) = 0._r8 - ccs%prod100c(c) = 0._r8 - ccs%totprodc(c) = 0._r8 - if (use_c13) then - cc13s%seedc(c) = 0._r8 - cc13s%prod10c(c) = 0._r8 - cc13s%prod100c(c) = 0._r8 - cc13s%totprodc(c) = 0._r8 - endif - cns%seedn(c) = 0._r8 - cns%prod10n(c) = 0._r8 - cns%prod100n(c) = 0._r8 - cns%totprodn(c) = 0._r8 - ccf%dwt_seedc_to_leaf(c) = 0._r8 - ccf%dwt_seedc_to_deadstem(c) = 0._r8 - ccf%dwt_conv_cflux(c) = 0._r8 - ccf%dwt_prod10c_gain(c) = 0._r8 - ccf%prod10c_loss(c) = 0._r8 - ccf%dwt_prod100c_gain(c) = 0._r8 - ccf%prod100c_loss(c) = 0._r8 - ccf%dwt_frootc_to_litr1c(c) = 0._r8 - ccf%dwt_frootc_to_litr2c(c) = 0._r8 - ccf%dwt_frootc_to_litr3c(c) = 0._r8 - ccf%dwt_livecrootc_to_cwdc(c) = 0._r8 - ccf%dwt_deadcrootc_to_cwdc(c) = 0._r8 - ccf%dwt_closs(c) = 0._r8 - ccf%landuseflux(c) = 0._r8 - ccf%landuptake(c) = 0._r8 - if (use_c13) then - cc13f%dwt_seedc_to_leaf(c) = 0._r8 - cc13f%dwt_seedc_to_deadstem(c) = 0._r8 - cc13f%dwt_conv_cflux(c) = 0._r8 - cc13f%dwt_prod10c_gain(c) = 0._r8 - cc13f%prod10c_loss(c) = 0._r8 - cc13f%dwt_prod100c_gain(c) = 0._r8 - cc13f%prod100c_loss(c) = 0._r8 - cc13f%dwt_frootc_to_litr1c(c) = 0._r8 - cc13f%dwt_frootc_to_litr2c(c) = 0._r8 - cc13f%dwt_frootc_to_litr3c(c) = 0._r8 - cc13f%dwt_livecrootc_to_cwdc(c) = 0._r8 - cc13f%dwt_deadcrootc_to_cwdc(c) = 0._r8 - cc13f%dwt_closs(c) = 0._r8 - endif - cnf%dwt_seedn_to_leaf(c) = 0._r8 - cnf%dwt_seedn_to_deadstem(c) = 0._r8 - cnf%dwt_conv_nflux(c) = 0._r8 - cnf%dwt_prod10n_gain(c) = 0._r8 - cnf%prod10n_loss(c) = 0._r8 - cnf%dwt_prod100n_gain(c) = 0._r8 - cnf%prod100n_loss(c) = 0._r8 - cnf%dwt_frootn_to_litr1n(c) = 0._r8 - cnf%dwt_frootn_to_litr2n(c) = 0._r8 - cnf%dwt_frootn_to_litr3n(c) = 0._r8 - cnf%dwt_livecrootn_to_cwdn(c) = 0._r8 - cnf%dwt_deadcrootn_to_cwdn(c) = 0._r8 - cnf%dwt_nloss(c) = 0._r8 - - end do - - ! deallocate special landunit filters - deallocate(specialc) - deallocate(specialp) - -end subroutine CNiniSpecial diff --git a/src_clm40/main/CNiniTimeVar.F90 b/src_clm40/main/CNiniTimeVar.F90 deleted file mode 100644 index 9f48a5ef65..0000000000 --- a/src_clm40/main/CNiniTimeVar.F90 +++ /dev/null @@ -1,875 +0,0 @@ -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNiniTimeVar -! -! !INTERFACE: -subroutine CNiniTimeVar() -! -! !DESCRIPTION: -! Initializes time varying variables used only in -! coupled carbon-nitrogen mode (CN): -! -! !USES: - use clmtype - use clm_atmlnd , only: clm_a2l - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varcon , only: istsoil - use clm_varcon , only: istcrop - use clm_varcon , only: c13ratio - use clm_varctl , only: use_c13, use_cndv - use pftvarcon , only: noveg - use pftvarcon , only: npcropmin - use decompMod , only: get_proc_bounds - use surfrdMod , only: crop_prog -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine iniTimeVar in file iniTimeVar.F90 -! -! !REVISION HISTORY: -! 10/21/03: Created by Peter Thornton -! -! -! local pointers to implicit in arguments -! - real(r8), pointer :: evergreen(:) ! binary flag for evergreen leaf habit (0 or 1) - real(r8), pointer :: woody(:) ! binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: leafcn(:) ! leaf C:N (gC/gN) - real(r8), pointer :: deadwdcn(:) ! dead wood (xylem and heartwood) C:N (gC/gN) - integer , pointer :: ivt(:) ! pft vegetation type - logical , pointer :: lakpoi(:) ! true => landunit is a lake point - integer , pointer :: plandunit(:) ! landunit index associated with each pft - integer , pointer :: clandunit(:) ! landunit index associated with each column - integer , pointer :: itypelun(:) ! landunit type -! -! local pointers to implicit out arguments -! - real(r8), pointer :: forc_hgt_u_pft(:) !observational height of wind at pft-level [m] - real(r8), pointer :: annsum_counter(:) ! seconds since last annual accumulator turnover - real(r8), pointer :: cannsum_npp(:) ! annual sum of NPP, averaged from pft-level (gC/m2/yr) - real(r8), pointer :: cannavg_t2m(:) !annual average of 2m air temperature, averaged from pft-level (K) - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: soil1n(:) ! (gN/m2) soil organic matter N (fast pool) - real(r8), pointer :: soil2n(:) ! (gN/m2) soil organic matter N (medium pool) - real(r8), pointer :: soil3n(:) ! (gN/m2) soil orgainc matter N (slow pool) - real(r8), pointer :: soil4n(:) ! (gN/m2) soil orgainc matter N (slowest pool) - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: grainc(:) ! (gC/m2) grain C - real(r8), pointer :: grainc_storage(:) ! (gC/m2) grain C storage - real(r8), pointer :: grainc_xfer(:) ! (gC/m2) grain C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) abstract C pool to meet excess MR demand - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: grainn(:) ! (gN/m2) grain N - real(r8), pointer :: grainn_storage(:) ! (gN/m2) grain N storage - real(r8), pointer :: grainn_xfer(:) ! (gN/m2) grain N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: npool(:) ! (gN/m2) temporary plant N pool - real(r8), pointer :: psnsun(:) ! sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) ! shaded leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: c13_psnsun(:) ! sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: c13_psnsha(:) ! shaded leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: laisun(:) ! sunlit projected leaf area index - real(r8), pointer :: laisha(:) ! shaded projected leaf area index - real(r8), pointer :: dormant_flag(:) ! dormancy flag - real(r8), pointer :: days_active(:) ! number of days since last dormancy - real(r8), pointer :: onset_flag(:) ! onset flag - real(r8), pointer :: onset_counter(:) ! onset days counter - real(r8), pointer :: onset_gddflag(:) ! onset flag for growing degree day sum - real(r8), pointer :: onset_fdd(:) ! onset freezing degree days counter - real(r8), pointer :: onset_gdd(:) ! onset growing degree days - real(r8), pointer :: onset_swi(:) ! onset soil water index - real(r8), pointer :: offset_flag(:) ! offset flag - real(r8), pointer :: offset_counter(:) ! offset days counter - real(r8), pointer :: offset_fdd(:) ! offset freezing degree days counter - real(r8), pointer :: offset_swi(:) ! offset soil water index - real(r8), pointer :: lgsf(:) ! long growing season factor [0-1] - real(r8), pointer :: bglfr(:) ! background litterfall rate (1/s) - real(r8), pointer :: bgtr(:) ! background transfer rate (1/s) - real(r8), pointer :: dayl(:) ! daylength (seconds) - real(r8), pointer :: prev_dayl(:) ! daylength from previous timestep (seconds) - real(r8), pointer :: annavg_t2m(:) ! annual average 2m air temperature (K) - real(r8), pointer :: tempavg_t2m(:) ! temporary average 2m air temperature (K) - real(r8), pointer :: gpp(:) ! GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: availc(:) ! C flux available for allocation (gC/m2/s) - real(r8), pointer :: xsmrpool_recover(:) ! C flux assigned to recovery of negative cpool (gC/m2/s) - real(r8), pointer :: xsmrpool_c13ratio(:) ! C flux assigned to recovery of negative cpool (gC/m2/s) - real(r8), pointer :: alloc_pnow(:) ! fraction of current allocation to display as new growth (DIM) - real(r8), pointer :: c_allometry(:) ! C allocation index (DIM) - real(r8), pointer :: n_allometry(:) ! N allocation index (DIM) - real(r8), pointer :: plant_ndemand(:) ! N flux required to support initial GPP (gN/m2/s) - real(r8), pointer :: tempsum_potential_gpp(:) ! temporary annual sum of plant_ndemand - real(r8), pointer :: annsum_potential_gpp(:) ! annual sum of plant_ndemand - real(r8), pointer :: tempmax_retransn(:) ! temporary max of retranslocated N pool (gN/m2) - real(r8), pointer :: annmax_retransn(:) ! annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: avail_retransn(:) ! N flux available from retranslocation pool (gN/m2/s) - real(r8), pointer :: plant_nalloc(:) ! total allocated N flux (gN/m2/s) - real(r8), pointer :: plant_calloc(:) ! total allocated C flux (gC/m2/s) - real(r8), pointer :: excess_cflux(:) ! C flux not allocated due to downregulation (gC/m2/s) - real(r8), pointer :: downreg(:) ! fractional reduction in GPP due to N limitation (DIM) - real(r8), pointer :: tempsum_npp(:) ! temporary annual sum of NPP - real(r8), pointer :: annsum_npp(:) ! annual sum of NPP - real(r8), pointer :: tempsum_litfall(:) ! temporary annual sum of litfall - real(r8), pointer :: annsum_litfall(:) ! annual sum of litfall - real(r8), pointer :: rc13_canair(:) !C13O2/C12O2 in canopy air - real(r8), pointer :: rc13_psnsun(:) !C13O2/C12O2 in sunlit canopy psn flux - real(r8), pointer :: rc13_psnsha(:) !C13O2/C12O2 in shaded canopy psn flux - real(r8), pointer :: alphapsnsun(:) !sunlit 13c fractionation ([]) - real(r8), pointer :: alphapsnsha(:) !shaded 13c fractionation ([]) - real(r8), pointer :: qflx_drain(:) ! sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_irrig(:) !irrigation flux (mm H2O/s) - ! new variables for fire - real(r8), pointer :: wf(:) ! soil moisture in top 0.5 m - real(r8), pointer :: me(:) ! moisture of extinction (proportion) - real(r8), pointer :: fire_prob(:) ! daily fire probability (0-1) - real(r8), pointer :: mean_fire_prob(:) ! e-folding mean of daily fire probability (0-1) - real(r8), pointer :: fireseasonl(:) ! annual fire season length (days, <= days/year) - real(r8), pointer :: farea_burned(:) ! timestep fractional area burned (proportion) - real(r8), pointer :: ann_farea_burned(:) ! annual total fractional area burned (proportion) - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool - real(r8), pointer :: totecosysc(:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - real(r8), pointer :: totlitc(:) ! (gC/m2) total litter carbon - real(r8), pointer :: totsomc(:) ! (gC/m2) total soil organic matter carbon - - real(r8), pointer :: woodc(:) ! (gC/m2) pft-level wood C - real(r8), pointer :: col_ntrunc(:) ! (gN/m2) column-level sink for N truncation - real(r8), pointer :: totcoln(:) ! (gN/m2) total column nitrogen, incl veg - real(r8), pointer :: totecosysn(:) ! (gN/m2) total ecosystem nitrogen, incl veg - real(r8), pointer :: totlitn(:) ! (gN/m2) total litter nitrogen - real(r8), pointer :: totsomn(:) ! (gN/m2) total soil organic matter nitrogen - real(r8), pointer :: dispvegc(:) ! (gC/m2) displayed veg carbon, excluding storage and cpool - real(r8), pointer :: pft_ctrunc(:) ! (gC/m2) pft-level sink for C truncation - real(r8), pointer :: storvegc(:) ! (gC/m2) stored vegetation carbon, excluding cpool - real(r8), pointer :: totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: prev_frootc_to_litter(:)!previous timestep froot C litterfall flux (gC/m2/s) - real(r8), pointer :: prev_leafc_to_litter(:) !previous timestep leaf C litterfall flux (gC/m2/s) - real(r8), pointer :: dispvegn(:) ! (gN/m2) displayed veg nitrogen, excluding storage - real(r8), pointer :: pft_ntrunc(:) ! (gN/m2) pft-level sink for N truncation - real(r8), pointer :: storvegn(:) ! (gN/m2) stored vegetation nitrogen - real(r8), pointer :: totpftn(:) ! (gN/m2) total pft-level nitrogen - real(r8), pointer :: totvegn(:) ! (gN/m2) total vegetation nitrogen - real(r8), pointer :: lncsha(:) ! leaf N concentration per unit projected LAI (gN leaf/m^2) - real(r8), pointer :: lncsun(:) ! leaf N concentration per unit projected LAI (gN leaf/m^2) - real(r8), pointer :: vcmxsha(:) ! shaded leaf Vcmax (umolCO2/m^2/s) - real(r8), pointer :: vcmxsun(:) ! sunlit leaf Vcmax (umolCO2/m^2/s) - ! 4/14/05: PET - ! Adding isotope code - real(r8), pointer :: cwdc13(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c13(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c13(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c13(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c13(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c13(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c13(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c13(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: c13_col_ctrunc(:) ! (gC/m2) C truncation term - real(r8), pointer :: leafc13(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc13_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc13_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc13(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc13_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc13_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc13(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc13_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc13_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc13(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc13_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc13_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc13(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc13_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc13_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc13(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc13_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc13_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: c13_gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: c13_gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: c13pool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: c13xsmrpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: c13_pft_ctrunc(:) ! (gC/m2) C truncation term - real(r8), pointer :: totvegc13(:) ! (gC/m2) total vegetation carbon, excluding cpool - ! dynamic landuse variables - real(r8), pointer :: seedc(:) ! (gC/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10c(:) ! (gC/m2) wood product C pool, 10-year lifespan - real(r8), pointer :: prod100c(:) ! (gC/m2) wood product C pool, 100-year lifespan - real(r8), pointer :: totprodc(:) ! (gC/m2) total wood product C - real(r8), pointer :: seedc13(:) ! (gC/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10c13(:) ! (gC/m2) wood product C13 pool, 10-year lifespan - real(r8), pointer :: prod100c13(:) ! (gC/m2) wood product C13 pool, 100-year lifespan - real(r8), pointer :: totprodc13(:) ! (gC/m2) total wood product C13 - real(r8), pointer :: seedn(:) ! (gN/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10n(:) ! (gN/m2) wood product N pool, 10-year lifespan - real(r8), pointer :: prod100n(:) ! (gN/m2) wood product N pool, 100-year lifespan - real(r8), pointer :: totprodn(:) ! (gN/m2) total wood product N -! -! !LOCAL VARIABLES: - integer :: g,l,c,p ! indices - integer :: begp, endp ! per-clump/proc beginning and ending pft indices - integer :: begc, endc ! per-clump/proc beginning and ending column indices - integer :: begl, endl ! per-clump/proc beginning and ending landunit indices - integer :: begg, endg ! per-clump/proc gridcell ending gridcell indices -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers at the gridcell level - - ! assign local pointers at the landunit level - lakpoi => lun%lakpoi - itypelun => lun%itype - - ! assign local pointers at the column level - clandunit => col%landunit - annsum_counter => cps%annsum_counter - cannsum_npp => cps%cannsum_npp - cannavg_t2m => cps%cannavg_t2m - wf => cps%wf - me => cps%me - fire_prob => cps%fire_prob - mean_fire_prob => cps%mean_fire_prob - fireseasonl => cps%fireseasonl - farea_burned => cps%farea_burned - ann_farea_burned => cps%ann_farea_burned - qflx_drain => cwf%qflx_drain - qflx_irrig => cwf%qflx_irrig - cwdc => ccs%cwdc - litr1c => ccs%litr1c - litr2c => ccs%litr2c - litr3c => ccs%litr3c - soil1c => ccs%soil1c - soil2c => ccs%soil2c - soil3c => ccs%soil3c - soil4c => ccs%soil4c - - ! dynamic landuse variables - seedc => ccs%seedc - prod10c => ccs%prod10c - prod100c => ccs%prod100c - totprodc => ccs%totprodc - seedc13 => cc13s%seedc - prod10c13 => cc13s%prod10c - prod100c13 => cc13s%prod100c - totprodc13 => cc13s%totprodc - seedn => cns%seedn - prod10n => cns%prod10n - prod100n => cns%prod100n - totprodn => cns%totprodn - - cwdn => cns%cwdn - litr1n => cns%litr1n - litr2n => cns%litr2n - litr3n => cns%litr3n - soil1n => cns%soil1n - soil2n => cns%soil2n - soil3n => cns%soil3n - soil4n => cns%soil4n - sminn => cns%sminn - col_ctrunc => ccs%col_ctrunc - totcolc => ccs%totcolc - totecosysc => ccs%totecosysc - totlitc => ccs%totlitc - totsomc => ccs%totsomc - - col_ntrunc => cns%col_ntrunc - totcoln => cns%totcoln - totecosysn => cns%totecosysn - totlitn => cns%totlitn - totsomn => cns%totsomn - - ! 4/14/05: PET - ! Adding isotope code - cwdc13 => cc13s%cwdc - litr1c13 => cc13s%litr1c - litr2c13 => cc13s%litr2c - litr3c13 => cc13s%litr3c - soil1c13 => cc13s%soil1c - soil2c13 => cc13s%soil2c - soil3c13 => cc13s%soil3c - soil4c13 => cc13s%soil4c - c13_col_ctrunc => cc13s%col_ctrunc - - ! assign local pointers at the pft level - ivt => pft%itype - plandunit => pft%landunit - leafc => pcs%leafc - leafc_storage => pcs%leafc_storage - leafc_xfer => pcs%leafc_xfer - grainc => pcs%grainc - grainc_storage => pcs%grainc_storage - grainc_xfer => pcs%grainc_xfer - frootc => pcs%frootc - frootc_storage => pcs%frootc_storage - frootc_xfer => pcs%frootc_xfer - livestemc => pcs%livestemc - livestemc_storage => pcs%livestemc_storage - livestemc_xfer => pcs%livestemc_xfer - deadstemc => pcs%deadstemc - deadstemc_storage => pcs%deadstemc_storage - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc => pcs%livecrootc - livecrootc_storage => pcs%livecrootc_storage - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc => pcs%deadcrootc - deadcrootc_storage => pcs%deadcrootc_storage - deadcrootc_xfer => pcs%deadcrootc_xfer - gresp_storage => pcs%gresp_storage - gresp_xfer => pcs%gresp_xfer - cpool => pcs%cpool - xsmrpool => pcs%xsmrpool - forc_hgt_u_pft => pps%forc_hgt_u_pft - woodc => pcs%woodc - leafn => pns%leafn - leafn_storage => pns%leafn_storage - leafn_xfer => pns%leafn_xfer - grainn => pns%grainn - grainn_storage => pns%grainn_storage - grainn_xfer => pns%grainn_xfer - frootn => pns%frootn - frootn_storage => pns%frootn_storage - frootn_xfer => pns%frootn_xfer - livestemn => pns%livestemn - livestemn_storage => pns%livestemn_storage - livestemn_xfer => pns%livestemn_xfer - deadstemn => pns%deadstemn - deadstemn_storage => pns%deadstemn_storage - deadstemn_xfer => pns%deadstemn_xfer - livecrootn => pns%livecrootn - livecrootn_storage => pns%livecrootn_storage - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn => pns%deadcrootn - deadcrootn_storage => pns%deadcrootn_storage - deadcrootn_xfer => pns%deadcrootn_xfer - retransn => pns%retransn - npool => pns%npool - psnsun => pcf%psnsun - psnsha => pcf%psnsha - - c13_psnsun => pc13f%psnsun - c13_psnsha => pc13f%psnsha - - laisun => pps%laisun - laisha => pps%laisha - dormant_flag => pepv%dormant_flag - days_active => pepv%days_active - onset_flag => pepv%onset_flag - onset_counter => pepv%onset_counter - onset_gddflag => pepv%onset_gddflag - onset_fdd => pepv%onset_fdd - onset_gdd => pepv%onset_gdd - onset_swi => pepv%onset_swi - offset_flag => pepv%offset_flag - offset_counter => pepv%offset_counter - offset_fdd => pepv%offset_fdd - offset_swi => pepv%offset_swi - lgsf => pepv%lgsf - bglfr => pepv%bglfr - bgtr => pepv%bgtr - dayl => pepv%dayl - prev_dayl => pepv%prev_dayl - annavg_t2m => pepv%annavg_t2m - tempavg_t2m => pepv%tempavg_t2m - gpp => pepv%gpp - availc => pepv%availc - xsmrpool_recover => pepv%xsmrpool_recover - - xsmrpool_c13ratio => pepv%xsmrpool_c13ratio - - alloc_pnow => pepv%alloc_pnow - c_allometry => pepv%c_allometry - n_allometry => pepv%n_allometry - plant_ndemand => pepv%plant_ndemand - tempsum_potential_gpp => pepv%tempsum_potential_gpp - annsum_potential_gpp => pepv%annsum_potential_gpp - tempmax_retransn => pepv%tempmax_retransn - annmax_retransn => pepv%annmax_retransn - avail_retransn => pepv%avail_retransn - plant_nalloc => pepv%plant_nalloc - plant_calloc => pepv%plant_calloc - excess_cflux => pepv%excess_cflux - downreg => pepv%downreg - tempsum_npp => pepv%tempsum_npp - annsum_npp => pepv%annsum_npp - tempsum_litfall => pepv%tempsum_litfall - annsum_litfall => pepv%annsum_litfall - dispvegc => pcs%dispvegc - pft_ctrunc => pcs%pft_ctrunc - storvegc => pcs%storvegc - totpftc => pcs%totpftc - totvegc => pcs%totvegc - prev_frootc_to_litter => pepv%prev_frootc_to_litter - prev_leafc_to_litter => pepv%prev_leafc_to_litter - dispvegn => pns%dispvegn - pft_ntrunc => pns%pft_ntrunc - storvegn => pns%storvegn - totpftn => pns%totpftn - totvegn => pns%totvegn - lncsha => pps%lncsha - lncsun => pps%lncsun - vcmxsha => pps%vcmxsha - vcmxsun => pps%vcmxsun - - ! 4/14/05: PET - ! Adding isotope code - alphapsnsun => pps%alphapsnsun - alphapsnsha => pps%alphapsnsha - leafc13 => pc13s%leafc - leafc13_storage => pc13s%leafc_storage - leafc13_xfer => pc13s%leafc_xfer - frootc13 => pc13s%frootc - frootc13_storage => pc13s%frootc_storage - frootc13_xfer => pc13s%frootc_xfer - livestemc13 => pc13s%livestemc - livestemc13_storage => pc13s%livestemc_storage - livestemc13_xfer => pc13s%livestemc_xfer - deadstemc13 => pc13s%deadstemc - deadstemc13_storage => pc13s%deadstemc_storage - deadstemc13_xfer => pc13s%deadstemc_xfer - livecrootc13 => pc13s%livecrootc - livecrootc13_storage => pc13s%livecrootc_storage - livecrootc13_xfer => pc13s%livecrootc_xfer - deadcrootc13 => pc13s%deadcrootc - deadcrootc13_storage => pc13s%deadcrootc_storage - deadcrootc13_xfer => pc13s%deadcrootc_xfer - c13_gresp_storage => pc13s%gresp_storage - c13_gresp_xfer => pc13s%gresp_xfer - c13pool => pc13s%cpool - c13xsmrpool => pc13s%xsmrpool - c13_pft_ctrunc => pc13s%pft_ctrunc - totvegc13 => pc13s%totvegc - rc13_canair => pepv%rc13_canair - rc13_psnsun => pepv%rc13_psnsun - rc13_psnsha => pepv%rc13_psnsha - - ! assign local pointers for ecophysiological constants - evergreen => pftcon%evergreen - woody => pftcon%woody - leafcn => pftcon%leafcn - deadwdcn => pftcon%deadwdcn - - ! Determine subgrid bounds on this processor - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Added 5/4/04, PET: initialize forc_hgt_u (gridcell-level), - ! since this is not initialized before first call to CNVegStructUpdate, - ! and it is required to set the upper bound for canopy top height. - ! Changed 3/21/08, KO: still needed but don't have sufficient information - ! to set this properly (e.g., pft-level displacement height and roughness - ! length). So leave at 30m. - do p = begp, endp - forc_hgt_u_pft(p) = 30._r8 - end do - - ! initialize column-level variables - do c = begc, endc - l = clandunit(c) - if (itypelun(l) == istsoil .or. itypelun(l) == istcrop) then - - ! column physical state variables - annsum_counter(c) = 0._r8 - cannsum_npp(c) = 0._r8 - cannavg_t2m(c) = 280._r8 - wf(c) = 1.0_r8 ! it needs to be non zero so the first time step has no fires - me(c) = 0._r8 - fire_prob(c) = 0._r8 - mean_fire_prob(c) = 0._r8 - fireseasonl(c) = 0._r8 - farea_burned(c) = 0._r8 - ann_farea_burned(c) = 0._r8 - - ! needed for CNNLeaching - qflx_drain(c) = 0._r8 - - qflx_irrig(c) = 0._r8 - - ! column carbon state variable initialization - cwdc(c) = 0._r8 - litr1c(c) = 0._r8 - litr2c(c) = 0._r8 - litr3c(c) = 0._r8 - soil1c(c) = 0._r8 - soil2c(c) = 0._r8 - soil3c(c) = 0._r8 - soil4c(c) = 10._r8 - col_ctrunc(c) = 0._r8 - totlitc(c) = 0._r8 - totsomc(c) = 0._r8 - totecosysc(c) = 0._r8 - totcolc(c) = 0._r8 - - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - cwdc13(c) = cwdc(c) * c13ratio - litr1c13(c) = litr1c(c) * c13ratio - litr2c13(c) = litr2c(c) * c13ratio - litr3c13(c) = litr3c(c) * c13ratio - soil1c13(c) = soil1c(c) * c13ratio - soil2c13(c) = soil2c(c) * c13ratio - soil3c13(c) = soil3c(c) * c13ratio - soil4c13(c) = soil4c(c) * c13ratio - c13_col_ctrunc(c) = col_ctrunc(c) * c13ratio - end if - - ! column nitrogen state variables - cwdn(c) = cwdc(c) / 500._r8 - litr1n(c) = litr1c(c) / 90._r8 - litr2n(c) = litr2c(c) / 90._r8 - litr3n(c) = litr3c(c) / 90._r8 - soil1n(c) = soil1c(c) / 12._r8 - soil2n(c) = soil2c(c) / 12._r8 - soil3n(c) = soil3c(c) / 10._r8 - soil4n(c) = soil4c(c) / 10._r8 - sminn(c) = 0._r8 - col_ntrunc(c) = 0._r8 - totlitn(c) = 0._r8 - totsomn(c) = 0._r8 - totecosysn(c) = 0._r8 - totcoln(c) = 0._r8 - - ! dynamic landcover state variables - seedc(c) = 0._r8 - prod10c(c) = 0._r8 - prod100c(c) = 0._r8 - totprodc(c) = 0._r8 - if (use_c13) then - seedc13(c) = 0._r8 - prod10c13(c) = 0._r8 - prod100c13(c) = 0._r8 - totprodc13(c) = 0._r8 - endif - seedn(c) = 0._r8 - prod10n(c) = 0._r8 - prod100n(c) = 0._r8 - totprodn(c) = 0._r8 - - ! also initialize dynamic landcover fluxes so that they have - ! real values on first timestep, prior to calling pftdyn_cnbal - ccf%dwt_seedc_to_leaf(c) = 0._r8 - ccf%dwt_seedc_to_deadstem(c) = 0._r8 - ccf%dwt_conv_cflux(c) = 0._r8 - ccf%dwt_prod10c_gain(c) = 0._r8 - ccf%prod10c_loss(c) = 0._r8 - ccf%dwt_prod100c_gain(c) = 0._r8 - ccf%prod100c_loss(c) = 0._r8 - ccf%dwt_frootc_to_litr1c(c) = 0._r8 - ccf%dwt_frootc_to_litr2c(c) = 0._r8 - ccf%dwt_frootc_to_litr3c(c) = 0._r8 - ccf%dwt_livecrootc_to_cwdc(c) = 0._r8 - ccf%dwt_deadcrootc_to_cwdc(c) = 0._r8 - ccf%dwt_closs(c) = 0._r8 - if (use_c13) then - cc13f%dwt_seedc_to_leaf(c) = 0._r8 - cc13f%dwt_seedc_to_deadstem(c) = 0._r8 - cc13f%dwt_conv_cflux(c) = 0._r8 - cc13f%dwt_prod10c_gain(c) = 0._r8 - cc13f%prod10c_loss(c) = 0._r8 - cc13f%dwt_prod100c_gain(c) = 0._r8 - cc13f%prod100c_loss(c) = 0._r8 - cc13f%dwt_frootc_to_litr1c(c) = 0._r8 - cc13f%dwt_frootc_to_litr2c(c) = 0._r8 - cc13f%dwt_frootc_to_litr3c(c) = 0._r8 - cc13f%dwt_livecrootc_to_cwdc(c) = 0._r8 - cc13f%dwt_deadcrootc_to_cwdc(c) = 0._r8 - cc13f%dwt_closs(c) = 0._r8 - endif - cnf%dwt_seedn_to_leaf(c) = 0._r8 - cnf%dwt_seedn_to_deadstem(c) = 0._r8 - cnf%dwt_conv_nflux(c) = 0._r8 - cnf%dwt_prod10n_gain(c) = 0._r8 - cnf%prod10n_loss(c) = 0._r8 - cnf%dwt_prod100n_gain(c) = 0._r8 - cnf%prod100n_loss(c) = 0._r8 - cnf%dwt_frootn_to_litr1n(c) = 0._r8 - cnf%dwt_frootn_to_litr2n(c) = 0._r8 - cnf%dwt_frootn_to_litr3n(c) = 0._r8 - cnf%dwt_livecrootn_to_cwdn(c) = 0._r8 - cnf%dwt_deadcrootn_to_cwdn(c) = 0._r8 - cnf%dwt_nloss(c) = 0._r8 - end if - end do - - ! initialize pft-level variables - do p = begp, endp - l = plandunit(p) - if (itypelun(l) == istsoil .or. itypelun(l) == istcrop) then - - ! carbon state variables - if (ivt(p) == noveg) then - leafc(p) = 0._r8 - leafc_storage(p) = 0._r8 - else - if (evergreen(ivt(p)) == 1._r8) then - leafc(p) = 1._r8 - leafc_storage(p) = 0._r8 - else if (ivt(p) >= npcropmin) then ! prognostic crop types - leafc(p) = 0._r8 - leafc_storage(p) = 0._r8 - else - leafc(p) = 0._r8 - leafc_storage(p) = 1._r8 - end if - end if - - leafc_xfer(p) = 0._r8 - if ( crop_prog )then - grainc(p) = 0._r8 - grainc_storage(p) = 0._r8 - grainc_xfer(p) = 0._r8 - end if - frootc(p) = 0._r8 - frootc_storage(p) = 0._r8 - frootc_xfer(p) = 0._r8 - livestemc(p) = 0._r8 - livestemc_storage(p) = 0._r8 - livestemc_xfer(p) = 0._r8 - - ! tree types need to be initialized with some stem mass so that - ! roughness length is not zero in canopy flux calculation - - if (woody(ivt(p)) == 1._r8) then - deadstemc(p) = 0.1_r8 - else - deadstemc(p) = 0._r8 - end if - - deadstemc_storage(p) = 0._r8 - deadstemc_xfer(p) = 0._r8 - livecrootc(p) = 0._r8 - livecrootc_storage(p) = 0._r8 - livecrootc_xfer(p) = 0._r8 - deadcrootc(p) = 0._r8 - deadcrootc_storage(p) = 0._r8 - deadcrootc_xfer(p) = 0._r8 - gresp_storage(p) = 0._r8 - gresp_xfer(p) = 0._r8 - cpool(p) = 0._r8 - xsmrpool(p) = 0._r8 - pft_ctrunc(p) = 0._r8 - dispvegc(p) = 0._r8 - storvegc(p) = 0._r8 - totpftc(p) = 0._r8 - ! calculate totvegc explicitly so that it is available for the isotope - ! code on the first time step. - totvegc(p) = leafc(p) + leafc_storage(p) + leafc_xfer(p) + frootc(p) + & - frootc_storage(p) + frootc_xfer(p) + livestemc(p) + livestemc_storage(p) + & - livestemc_xfer(p) + deadstemc(p) + deadstemc_storage(p) + deadstemc_xfer(p) + & - livecrootc(p) + livecrootc_storage(p) + livecrootc_xfer(p) + deadcrootc(p) + & - deadcrootc_storage(p) + deadcrootc_xfer(p) + gresp_storage(p) + & - gresp_xfer(p) + cpool(p) - - woodc(p) = 0._r8 - - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - leafc13(p) = leafc(p) * c13ratio - leafc13_storage(p) = leafc_storage(p) * c13ratio - leafc13_xfer(p) = leafc_xfer(p) * c13ratio - frootc13(p) = frootc(p) * c13ratio - frootc13_storage(p) = frootc_storage(p) * c13ratio - frootc13_xfer(p) = frootc_xfer(p) * c13ratio - livestemc13(p) = livestemc(p) * c13ratio - livestemc13_storage(p) = livestemc_storage(p) * c13ratio - livestemc13_xfer(p) = livestemc_xfer(p) * c13ratio - deadstemc13(p) = deadstemc(p) * c13ratio - deadstemc13_storage(p) = deadstemc_storage(p) * c13ratio - deadstemc13_xfer(p) = deadstemc_xfer(p) * c13ratio - livecrootc13(p) = livecrootc(p) * c13ratio - livecrootc13_storage(p) = livecrootc_storage(p) * c13ratio - livecrootc13_xfer(p) = livecrootc_xfer(p) * c13ratio - deadcrootc13(p) = deadcrootc(p) * c13ratio - deadcrootc13_storage(p) = deadcrootc_storage(p) * c13ratio - deadcrootc13_xfer(p) = deadcrootc_xfer(p) * c13ratio - c13_gresp_storage(p) = gresp_storage(p) * c13ratio - c13_gresp_xfer(p) = gresp_xfer(p) * c13ratio - c13pool(p) = cpool(p) * c13ratio - c13xsmrpool(p) = xsmrpool(p) * c13ratio - c13_pft_ctrunc(p) = pft_ctrunc(p) * c13ratio - - ! calculate totvegc explicitly so that it is available for the isotope - ! code on the first time step. - totvegc13(p) = leafc13(p) + leafc13_storage(p) + leafc13_xfer(p) + frootc13(p) + & - frootc13_storage(p) + frootc13_xfer(p) + livestemc13(p) + livestemc13_storage(p) + & - livestemc13_xfer(p) + deadstemc13(p) + deadstemc13_storage(p) + deadstemc13_xfer(p) + & - livecrootc13(p) + livecrootc13_storage(p) + livecrootc13_xfer(p) + deadcrootc13(p) + & - deadcrootc13_storage(p) + deadcrootc13_xfer(p) + c13_gresp_storage(p) + & - c13_gresp_xfer(p) + c13pool(p) - endif - - ! nitrogen state variables - if (ivt(p) == noveg) then - leafn(p) = 0._r8 - leafn_storage(p) = 0._r8 - else - leafn(p) = leafc(p) / leafcn(ivt(p)) - leafn_storage(p) = leafc_storage(p) / leafcn(ivt(p)) - end if - - leafn_xfer(p) = 0._r8 - if ( crop_prog )then - grainn(p) = 0._r8 - grainn_storage(p) = 0._r8 - grainn_xfer(p) = 0._r8 - end if - frootn(p) = 0._r8 - frootn_storage(p) = 0._r8 - frootn_xfer(p) = 0._r8 - livestemn(p) = 0._r8 - livestemn_storage(p) = 0._r8 - livestemn_xfer(p) = 0._r8 - - ! tree types need to be initialized with some stem mass so that - ! roughness length is not zero in canopy flux calculation - - if (woody(ivt(p)) == 1._r8) then - deadstemn(p) = deadstemc(p) / deadwdcn(ivt(p)) - else - deadstemn(p) = 0._r8 - end if - - deadstemn_storage(p) = 0._r8 - deadstemn_xfer(p) = 0._r8 - livecrootn(p) = 0._r8 - livecrootn_storage(p) = 0._r8 - livecrootn_xfer(p) = 0._r8 - deadcrootn(p) = 0._r8 - deadcrootn_storage(p) = 0._r8 - deadcrootn_xfer(p) = 0._r8 - retransn(p) = 0._r8 - npool(p) = 0._r8 - pft_ntrunc(p) = 0._r8 - dispvegn(p) = 0._r8 - storvegn(p) = 0._r8 - totvegn(p) = 0._r8 - totpftn(p) = 0._r8 - - ! initialization for psnsun and psnsha required for - ! proper arbitrary initialization of allocation routine - ! in initial ecosysdyn call - - psnsun(p) = 0._r8 - psnsha(p) = 0._r8 - if (use_c13) then - c13_psnsun(p) = 0._r8 - c13_psnsha(p) = 0._r8 - endif - laisun(p) = 0._r8 - laisha(p) = 0._r8 - lncsun(p) = 0._r8 - lncsha(p) = 0._r8 - vcmxsun(p) = 0._r8 - vcmxsha(p) = 0._r8 - - ! ecophysiological variables - ! phenology variables - dormant_flag(p) = 1._r8 - days_active(p) = 0._r8 - onset_flag(p) = 0._r8 - onset_counter(p) = 0._r8 - onset_gddflag(p) = 0._r8 - onset_fdd(p) = 0._r8 - onset_gdd(p) = 0._r8 - onset_swi(p) = 0.0_r8 - offset_flag(p) = 0._r8 - offset_counter(p) = 0._r8 - offset_fdd(p) = 0._r8 - offset_swi(p) = 0._r8 - lgsf(p) = 0._r8 - bglfr(p) = 0._r8 - bgtr(p) = 0._r8 - annavg_t2m(p) = 280._r8 - tempavg_t2m(p) = 0._r8 - - ! non-phenology variables - gpp(p) = 0._r8 - availc(p) = 0._r8 - xsmrpool_recover(p) = 0._r8 - if (use_c13) then - xsmrpool_c13ratio(p) = c13ratio - endif - alloc_pnow(p) = 1._r8 - c_allometry(p) = 0._r8 - n_allometry(p) = 0._r8 - plant_ndemand(p) = 0._r8 - tempsum_potential_gpp(p) = 0._r8 - annsum_potential_gpp(p) = 0._r8 - tempmax_retransn(p) = 0._r8 - annmax_retransn(p) = 0._r8 - avail_retransn(p) = 0._r8 - plant_nalloc(p) = 0._r8 - plant_calloc(p) = 0._r8 - excess_cflux(p) = 0._r8 - downreg(p) = 0._r8 - prev_leafc_to_litter(p) = 0._r8 - prev_frootc_to_litter(p) = 0._r8 - tempsum_npp(p) = 0._r8 - annsum_npp(p) = 0._r8 - if (use_cndv) then - tempsum_litfall(p) = 0._r8 - annsum_litfall(p) = 0._r8 - end if - if (use_c13) then - rc13_canair(p) = 0._r8 - rc13_psnsun(p) = 0._r8 - rc13_psnsha(p) = 0._r8 - alphapsnsun(p) = 0._r8 - alphapsnsha(p) = 0._r8 - endif - - - - end if ! end of if-istsoil block - end do ! end of loop over pfts - -end subroutine CNiniTimeVar diff --git a/src_clm40/main/GetGlobalValuesMod.F90 b/src_clm40/main/GetGlobalValuesMod.F90 deleted file mode 100644 index bfe99b3361..0000000000 --- a/src_clm40/main/GetGlobalValuesMod.F90 +++ /dev/null @@ -1,145 +0,0 @@ -module GetGlobalValuesMod - - !----------------------------------------------------------------------- - ! Obtain and Write Global Index information - !----------------------------------------------------------------------- - implicit none - private - - ! PUBLIC MEMBER FUNCTIONS: - - public :: GetGlobalIndex - public :: GetGlobalWrite - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - integer function GetGlobalIndex(decomp_index, clmlevel) - - !---------------------------------------------------------------- - ! Description - ! Determine global index space value for target point at given clmlevel - ! - ! Uses: - use clmtype , only: nameg, namel, namec, namep - use decompMod , only: bounds_type, get_clmlevel_gsmap, get_proc_bounds - use spmdMod , only: iam - use clm_varctl , only: iulog - use shr_log_mod, only: errMsg => shr_log_errMsg - use mct_mod - ! - ! Arguments - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - type(bounds_type) :: bounds_proc ! processor bounds - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmap_ordered ! gsmap ordered points - integer :: beg_index ! beginning proc index for clmlevel - !---------------------------------------------------------------- - - call get_proc_bounds(bounds_proc) - - if (trim(clmlevel) == nameg) then - beg_index = bounds_proc%begg - else if (trim(clmlevel) == namel) then - beg_index = bounds_proc%begl - else if (trim(clmlevel) == namec) then - beg_index = bounds_proc%begc - else if (trim(clmlevel) == namep) then - beg_index = bounds_proc%begp - else - call shr_sys_abort('clmlevel of '//trim(clmlevel)//' not supported' // & - errmsg(__FILE__, __LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel=trim(clmlevel), gsmap=gsmap) - call mct_gsmap_orderedPoints(gsmap, iam, gsmap_ordered) - GetGlobalIndex = gsmap_ordered(decomp_index - beg_index + 1) - deallocate(gsmap_ordered) - - end function GetGlobalIndex - - !----------------------------------------------------------------------- - subroutine GetGlobalWrite(decomp_index, clmlevel) - - !----------------------------------------------------------------------- - ! Description: - ! Write global index information for input local indices - ! - use clmtype - use shr_sys_mod , only: shr_sys_flush - use shr_sys_mod , only: shr_sys_abort - use shr_log_mod , only: errMsg => shr_log_errMsg - use clm_varctl , only: iulog - ! - ! Arguments: - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - ! - ! Local Variables: - integer :: igrc, ilun, icol, ipft - !----------------------------------------------------------------------- - - if (trim(clmlevel) == nameg) then - - igrc = decomp_index - write(iulog,*)'local gridcell index = ',igrc - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - - else if (trim(clmlevel) == namel) then - - ilun = decomp_index - igrc = lun%gridcell(ilun) - write(iulog,*)'local landunit index = ',ilun - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'landunit type = ',lun%itype(decomp_index) - - else if (trim(clmlevel) == namec) then - - icol = decomp_index - ilun = col%landunit(icol) - igrc = col%gridcell(icol) - write(iulog,*)'local column index = ',icol - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else if (trim(clmlevel) == namep) then - - ipft = decomp_index - icol = pft%column(ipft) - ilun = pft%landunit(ipft) - igrc = pft%gridcell(ipft) - write(iulog,*)'local pft index = ',ipft - write(iulog,*)'global pft index = ',GetGlobalIndex(decomp_index=ipft, clmlevel=namep) - write(iulog,*)'global column index = ',GetGlobalIndex(decomp_index=icol, clmlevel=namec) - write(iulog,*)'global landunit index = ',GetGlobalIndex(decomp_index=ilun, clmlevel=namel) - write(iulog,*)'global gridcell index = ',GetGlobalIndex(decomp_index=igrc, clmlevel=nameg) - write(iulog,*)'gridcell longitude = ',grc%londeg(igrc) - write(iulog,*)'gridcell latitude = ',grc%latdeg(igrc) - write(iulog,*)'pft type = ',pft%itype(ipft) - write(iulog,*)'column type = ',col%itype(icol) - write(iulog,*)'landunit type = ',lun%itype(ilun) - - else - call shr_sys_abort('clmlevel '//trim(clmlevel)//'not supported '//errmsg(__FILE__, __LINE__)) - - end if - - call shr_sys_flush(iulog) - - end subroutine GetGlobalWrite - -end module GetGlobalValuesMod diff --git a/src_clm40/main/SimpleMathMod.F90 b/src_clm40/main/SimpleMathMod.F90 deleted file mode 100644 index 5649a54263..0000000000 --- a/src_clm40/main/SimpleMathMod.F90 +++ /dev/null @@ -1,226 +0,0 @@ -module SimpleMathMod - -#include "shr_assert.h" - !------------------------------------------------------------------------------ - ! - ! DESCRIPTIONS: - ! module contains simple mathematical functions for arrays - ! Created by Jinyun Tang, Feb., 2014 - -implicit none - - interface array_normalization - module procedure array_normalization_2d, array_normalization_2d_filter - end interface array_normalization - - interface array_div_vector - module procedure array_div_vector_filter, array_div_vector_nofilter - end interface array_div_vector -contains -!-------------------------------------------------------------------------------- - subroutine array_normalization_2d(which_dim, arr2d_inout) - ! - !DESCRIPTIONS - !do normalization for the input array along dimension which_dim - ! - !USES - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none - - integer, intent(in) :: which_dim !do normalization along which dimension? - real(r8), intent(inout) :: arr2d_inout(:,:) !input 2d array - - - !local variables - integer :: sz1, sz2 !array size - integer :: j1, j2 !indices - real(r8) :: arr_sum - - sz1 = size(arr2d_inout,1) - sz2 = size(arr2d_inout,2) - - if(which_dim==1)then - !normalize along dimension 1, so loop along dimension 2 - do j2 = 1, sz2 - !obtain the total - arr_sum=0._r8 - do j1 = 1, sz1 - arr_sum=arr_sum+arr2d_inout(j1,j2) - enddo - !normalize with the total if arr_sum is non-zero - if(arr_sum/=0._r8)then - do j1 = 1, sz1 - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr_sum - enddo - endif - enddo - elseif(which_dim==2)then - !normalize along dimension 2, so loop along dimension 1 - do j1 = 1, sz1 - !obtain the total - arr_sum=0._r8 - do j2 = 1, sz2 - arr_sum=arr_sum+arr2d_inout(j1,j2) - enddo - !normalize with the total if arr_sum is non-zero - !I think there should be a safer mask for this to screen off spval values - !Jinyun Tang, May 30, 2014 - if(arr_sum>0._r8 .or. arr_sum < 0._r8)then - do j2 = 1, sz2 - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr_sum - enddo - endif - enddo - endif - return - end subroutine array_normalization_2d - -!-------------------------------------------------------------------------------- - subroutine array_normalization_2d_filter(lbj1, ubj1, lbj2, ubj2, numf, filter, arr2d_inout) - ! - !DESCRIPTIONS - !do normalization with filter for the input array along dimension 2 - - ! - !USES - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - integer, intent(in) :: lbj1 !left bound of dim 1 - integer, intent(in) :: lbj2 !left bound of dim 2 - integer, intent(in) :: ubj1 !right bound of dim 1 - integer, intent(in) :: ubj2 !right bound of dim 2 - integer, intent(in) :: numf !filter size - integer, intent(in) :: filter(:) !filter - real(r8), intent(inout) :: arr2d_inout(lbj1: , lbj2: ) !input 2d array - - - !local variables - integer :: sz1, sz2 !array size - integer :: j2 !indices - integer :: f, p !indices - real(r8) :: arr_sum(lbj1:ubj1) - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(arr2d_inout) == (/ubj1, ubj2/)), errMsg(__FILE__, __LINE__)) - - - arr_sum(:) = 0._r8 - do j2 = lbj2, ubj2 - do f = 1, numf - p = filter(f) - !obtain the total - arr_sum(p)=arr_sum(p)+arr2d_inout(p,j2) - enddo - enddo - - !normalize with the total if arr_sum is non-zero - do j2 = lbj2, ubj2 - do f = 1, numf - p = filter(f) - !I found I have to ensure >0._r8 because of some unknown reason, jyt May 23, 2014 - !I will test this later with arr_sum(p)/=0._r8 - if(arr_sum(p)>0._r8 .or. arr_sum(p)<0._r8)then - arr2d_inout(p,j2) = arr2d_inout(p,j2)/arr_sum(p) - endif - enddo - enddo - return - end subroutine array_normalization_2d_filter -!-------------------------------------------------------------------------------- - - subroutine array_div_vector_filter(lbj1, ubj1, lbj2, ubj2, & - arr1d_in, fn, filter, arr2d_inout) - ! - !DESCRIPTIONS - !array divided by a vector, arr2d_in is divided by one - !element in arr1d_in - !It always assumes the filter is along with dimenion 1 - ! - ! USES - ! - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - integer, intent(in) :: lbj1 !left bound of dim 1 - integer, intent(in) :: lbj2 !left bound of dim 2 - integer, intent(in) :: ubj1 !right bound of dim 1 - integer, intent(in) :: ubj2 !right bound of dim 2 - real(r8), intent(in) :: arr1d_in(lbj1: ) !1d scaling factor - integer , intent(in) :: fn - integer , intent(in) :: filter(:) !filter - real(r8), intent(inout) :: arr2d_inout(lbj1: ,lbj2: ) !2d array to be scaled - - integer :: sz - integer :: j, f, p - - ! Enforce expected array sizes - SHR_ASSERT_ALL((ubound(arr2d_inout) == (/ubj1, ubj2/)), errMsg(__FILE__, __LINE__)) - SHR_ASSERT_ALL((ubound(arr1d_in) == (/ubj1/)), errMsg(__FILE__, __LINE__)) - - - do j = lbj2, ubj2 - do f = 1, fn - p = filter(f) - if (arr1d_in(p) > 0._r8 .or. arr1d_in(p) < 0._r8) then - arr2d_inout(p,j) = arr2d_inout(p,j)/arr1d_in(p) - else - arr2d_inout(p,j) = 0._r8 - end if - end do - end do - return - end subroutine array_div_vector_filter - -!-------------------------------------------------------------------------------- - - subroutine array_div_vector_nofilter(arr1d_in, which_dim, arr2d_inout) - ! - !DESCRIPTIONS - !array divided by a vector, each row in arr2d_in is divided by one - !element in arr1d_in - ! - !USES - ! - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_assert_mod , only : shr_assert - use shr_log_mod , only : errMsg => shr_log_errMsg - implicit none - real(r8), intent(in) :: arr1d_in(:) !scaling factor - integer, intent(in) :: which_dim !which dimension is scaled - real(r8), intent(inout) :: arr2d_inout(:,:) !2d array to be scaled - - integer :: sz1, sz2 - integer :: j1, j2 - - sz1=size(arr2d_inout,1) - sz2=size(arr2d_inout,2) - - if(which_dim==1)then - ! Enforce expected array sizes - call shr_assert(sz1 == size(arr1d_in), errMsg(__FILE__, __LINE__)) - - do j2 = 1, sz2 - do j1 = 1, sz1 - if(arr1d_in(j1)>0._r8)then - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr1d_in(j1) - endif - enddo - enddo - else - ! Enforce expected array sizes - call shr_assert(sz2 == size(arr1d_in), errMsg(__FILE__, __LINE__)) - - do j2 = 1, sz2 - do j1 = 1, sz1 - if(arr1d_in(j2)>0._r8 .or. arr1d_in(j2)<0._r8)then - arr2d_inout(j1,j2) = arr2d_inout(j1,j2)/arr1d_in(j2) - endif - enddo - enddo - - endif - return - end subroutine array_div_vector_nofilter - -end module SimpleMathMod diff --git a/src_clm40/main/abortutils.F90 b/src_clm40/main/abortutils.F90 deleted file mode 100644 index 8718f0af04..0000000000 --- a/src_clm40/main/abortutils.F90 +++ /dev/null @@ -1,82 +0,0 @@ -module abortutils - - !----------------------------------------------------------------------- - ! !MODULE: abortutils - ! - ! !DESCRIPTION: - ! Abort the model for abnormal termination - !----------------------------------------------------------------------- - - private - save - - public :: endrun - - interface endrun - module procedure endrun_vanilla - module procedure endrun_globalindex - end interface - -CONTAINS - - !----------------------------------------------------------------------- - subroutine endrun_vanilla(msg) - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Abort the model for abnormal termination - ! - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in), optional :: msg ! string to be printed - !----------------------------------------------------------------------- - - if (present (msg)) then - write(iulog,*)'ENDRUN:', msg - else - write(iulog,*)'ENDRUN: called without a message string' - end if - - call shr_sys_abort() - - end subroutine endrun_vanilla - - !----------------------------------------------------------------------- - subroutine endrun_globalindex(decomp_index, clmlevel, msg) - - !----------------------------------------------------------------------- - ! Description: - ! Abort the model for abnormal termination - ! - use clmtype - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - use GetGlobalValuesMod, only: GetGlobalWrite - ! - ! Arguments: - implicit none - integer , intent(in) :: decomp_index - character(len=*) , intent(in) :: clmlevel - character(len=*) , intent(in), optional :: msg ! string to be printed - ! - ! Local Variables: - integer :: igrc, ilun, icol - !----------------------------------------------------------------------- - - write(6,*)'calling getglobalwrite with decomp_index= ',decomp_index,' and clmlevel= ',trim(clmlevel) - call GetGlobalWrite(decomp_index, clmlevel) - - if (present (msg)) then - write(iulog,*)'ENDRUN:', msg - else - write(iulog,*)'ENDRUN: called without a message string' - end if - - call shr_sys_abort() - - end subroutine endrun_globalindex - -end module abortutils diff --git a/src_clm40/main/accFldsMod.F90 b/src_clm40/main/accFldsMod.F90 deleted file mode 100644 index 5e8853857c..0000000000 --- a/src_clm40/main/accFldsMod.F90 +++ /dev/null @@ -1,1044 +0,0 @@ -module accFldsMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: accFldsMod -! -! !DESCRIPTION: -! This module contains subroutines that initialize, update and extract -! the user-specified fields over user-defined intervals. Each interval -! and accumulation type is unique to each field processed. -! Subroutine [initAccumFlds] defines the fields to be processed -! and the type of accumulation. Subroutine [updateAccumFlds] does -! the actual accumulation for a given field. Fields are accumulated -! by calls to subroutine [update_accum_field]. To accumulate a field, -! it must first be defined in subroutine [initAccumFlds] and then -! accumulated by calls to [updateAccumFlds]. -! Four types of accumulations are possible: -! o average over time interval -! o running mean over time interval -! o running accumulation over time interval -! Time average fields are only valid at the end of the averaging interval. -! Running means are valid once the length of the simulation exceeds the -! averaging interval. Accumulated fields are continuously accumulated. -! The trigger value "-99999." resets the accumulation to zero. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils, only: endrun - use clm_varctl, only: iulog, use_cndv, use_cn, use_crop - use surfrdMod, only: crop_prog -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: initAccFlds ! Initialization accumulator fields - public :: initAccClmtype ! Initialize clmtype variables obtained from accum fields - public :: updateAccFlds ! Update accumulator fields -! -! !REVISION HISTORY: -! Created by M. Vertenstein 03/2003 -! -!EOP - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: initAccFlds() -! -! !INTERFACE: - subroutine initAccFlds() -! -! !DESCRIPTION: -! Initializes accumulator and sets up array of accumulated fields -! -! !USES: - use accumulMod , only : init_accum_field, print_accum_fields - use clm_time_manager , only : get_step_size - use shr_const_mod, only : SHR_CONST_CDAY, SHR_CONST_TKFRZ -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY:: -! Created by M. Vertenstein 03/2003 -! -! -! !LOCAL VARIABLES: -!EOP -! - integer :: dtime !time step size - integer, parameter :: not_used = huge(1) -!------------------------------------------------------------------------ - - ! Hourly average of 2m temperature. - - dtime = get_step_size() - call init_accum_field(name='TREFAV', units='K', & - desc='average over an hour of 2-m temperature', & - accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! Hourly average of Urban 2m temperature. - - call init_accum_field(name='TREFAV_U', units='K', & - desc='average over an hour of urban 2-m temperature', & - accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! Hourly average of Rural 2m temperature. - - call init_accum_field(name='TREFAV_R', units='K', & - desc='average over an hour of rural 2-m temperature', & - accum_type='timeavg', accum_period=nint(3600._r8/dtime), & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 24hr average of vegetation temperature (heald, 04/06) - call init_accum_field (name='T_VEG24', units='K', & - desc='24hr average of vegetation temperature', & - accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 240hr average of vegetation temperature (heald, 04/06) - call init_accum_field (name='T_VEG240', units='K', & - desc='240hr average of vegetation temperature', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 24hr average of direct solar radiation (heald, 04/06) - call init_accum_field (name='FSD24', units='W/m2', & - desc='24hr average of direct solar radiation', & - accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 240hr average of direct solar radiation (heald, 04/06) - call init_accum_field (name='FSD240', units='W/m2', & - desc='240hr average of direct solar radiation', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 24hr average of diffuse solar radiation (heald, 04/06) - call init_accum_field (name='FSI24', units='W/m2', & - desc='24hr average of diffuse solar radiation', & - accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 240hr average of diffuse solar radiation (heald, 04/06) - call init_accum_field (name='FSI240', units='W/m2', & - desc='240hr average of diffuse solar radiation', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 24hr average of fraction of canopy that is sunlit (heald, 04/06) - call init_accum_field (name='FSUN24', units='fraction', & - desc='24hr average of diffuse solar radiation', & - accum_type='runmean', accum_period=-1, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! 240hr average of fraction of canopy that is sunlit (heald, 04/06) - call init_accum_field (name='FSUN240', units='fraction', & - desc='240hr average of diffuse solar radiation', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! Average of LAI from previous and current timestep (heald, 04/06) - ! corrected to be 10-day average (LKE, 2014-12-5) - call init_accum_field (name='LAIP', units='m2/m2', & - desc='leaf area index average over timestep', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - if (use_cndv .or. use_crop) then - ! The following is a running mean. - ! The accumulation period is set to -10 for a 10-day running mean. - - call init_accum_field (name='T10', units='K', & - desc='10-day running mean of 2-m temperature', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1,init_value=SHR_CONST_TKFRZ+20._r8) - - end if - - if (use_cndv) then - ! 30-day average of 2m temperature. - - call init_accum_field (name='TDA', units='K', & - desc='30-day average of 2-m temperature', & - accum_type='timeavg', accum_period=-30, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! The following are running means. - ! The accumulation period is set to -365 for a 365-day running mean. - - call init_accum_field (name='PREC365', units='MM H2O/S', & - desc='365-day running mean of total precipitation', & - accum_type='runmean', accum_period=-365, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - ! The following are accumulated fields. - ! These types of fields are accumulated until a trigger value resets - ! the accumulation to zero (see subroutine update_accum_field). - ! Hence, [accper] is not valid. - - call init_accum_field (name='AGDDTW', units='K', & - desc='growing degree-days base twmax', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='AGDD', units='K', & - desc='growing degree-days base 5C', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - end if - - if ( crop_prog )then - ! 10-day average of min 2m temperature. - - call init_accum_field (name='TDM10', units='K', & - desc='10-day running mean of min 2-m temperature', & - accum_type='runmean', accum_period=-10, & - subgrid_type='pft', numlev=1, init_value=SHR_CONST_TKFRZ) - - ! 5-day average of min 2m temperature. - - call init_accum_field (name='TDM5', units='K', & - desc='5-day running mean of min 2-m temperature', & - accum_type='runmean', accum_period=-5, & - subgrid_type='pft', numlev=1, init_value=SHR_CONST_TKFRZ) - - ! All GDD summations are relative to the planting date - ! (Kucharik & Brye 2003) - - call init_accum_field (name='GDD0', units='K', & - desc='growing degree-days base 0C from planting', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDD8', units='K', & - desc='growing degree-days base 8C from planting', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDD10', units='K', & - desc='growing degree-days base 10C from planting', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDDPLANT', units='K', & - desc='growing degree-days from planting', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - - call init_accum_field (name='GDDTSOI', units='K', & - desc='growing degree-days from planting (top two soil layers)', & - accum_type='runaccum', accum_period=not_used, & - subgrid_type='pft', numlev=1, init_value=0._r8) - end if - - ! Print output of accumulated fields - - call print_accum_fields() - - end subroutine initAccFlds - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: updateAccFlds -! -! !INTERFACE: - subroutine updateAccFlds() -! -! !DESCRIPTION: -! Update and/or extract accumulated fields -! -! !USES: - use clmtype - use clm_atmlnd , only : clm_a2l - use decompMod , only : get_proc_bounds - use clm_varcon , only : spval - use shr_const_mod, only : SHR_CONST_CDAY, SHR_CONST_TKFRZ - use clm_time_manager , only : get_step_size, get_nstep, is_end_curr_day, get_curr_date - use accumulMod , only : update_accum_field, extract_accum_field - use pftvarcon , only : nwcereal, mxtmp, baset - use clm_time_manager , only : get_start_date - use pftvarcon , only : ndllf_dcd_brl_tree -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by M. Vertenstein 03/2003 -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: itype(:) ! pft vegetation - integer , pointer :: pgridcell(:) ! index into gridcell level quantities - real(r8), pointer :: forc_t(:) ! atmospheric temperature (Kelvin) - real(r8), pointer :: forc_rain(:) ! rain rate [mm/s] - real(r8), pointer :: forc_snow(:) ! snow rate [mm/s] - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_u(:) ! Urban 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_r(:) ! Rural 2 m height surface air temperature (Kelvin) - logical , pointer :: urbpoi(:) ! true => landunit is an urban point - logical , pointer :: ifspecial(:) ! true => landunit is not vegetated - integer , pointer :: plandunit(:) ! landunit index associated with each pft - real(r8), pointer :: vf(:) ! vernalization factor - real(r8), pointer :: t_soisno(:,:) ! soil temperature (K) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) (nlevgrnd) - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) - real(r8), pointer :: latdeg(:) ! latitude (radians) - logical , pointer :: croplive(:) ! Flag, true if planted, not harvested - integer , pointer :: pcolumn(:) ! index into column level quantities -! -! local pointers to implicit out arguments -! - ! heald (04/06): variables to be accumulated for VOC emissions - real(r8), pointer :: t_veg(:) ! pft vegetation temperature (Kelvin) - real(r8), pointer :: forc_solad(:,:) ! direct beam radiation (visible only) - real(r8), pointer :: forc_solai(:,:) ! diffuse radiation (visible only) - real(r8), pointer :: fsun(:) ! sunlit fraction of canopy - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - ! heald (04/06): accumulated variables for VOC emissions - real(r8), pointer :: t_veg24(:) ! 24hr average vegetation temperature (K) - real(r8), pointer :: t_veg240(:) ! 240hr average vegetation temperature (Kelvin) - real(r8), pointer :: fsd24(:) ! 24hr average of direct beam radiation - real(r8), pointer :: fsd240(:) ! 240hr average of direct beam radiation - real(r8), pointer :: fsi24(:) ! 24hr average of diffuse beam radiation - real(r8), pointer :: fsi240(:) ! 240hr average of diffuse beam radiation - real(r8), pointer :: fsun24(:) ! 24hr average of sunlit fraction of canopy - real(r8), pointer :: fsun240(:) ! 240hr average of sunlit fraction of canopy - real(r8), pointer :: elai_p(:) ! leaf area index average over timestep - - real(r8), pointer :: t_ref2m_min(:) ! daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max(:) ! daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst(:) ! instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst(:) ! instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_u(:) ! Urban daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_r(:) ! Rural daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_u(:) ! Urban daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_r(:) ! Rural daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst_u(:) ! Urban instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_inst_r(:) ! Rural instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_u(:) ! Urban instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_r(:) ! Rural instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t10(:) ! 10-day running mean of the 2 m temperature (K) - real(r8), pointer :: t_mo(:) ! 30-day average temperature (Kelvin) - real(r8), pointer :: t_mo_min(:) ! annual min of t_mo (Kelvin) - real(r8), pointer :: prec365(:) ! 365-day running mean of tot. precipitation - real(r8), pointer :: agddtw(:) ! accumulated growing degree days above twmax - real(r8), pointer :: agdd(:) ! accumulated growing degree days above 5 - real(r8), pointer :: twmax(:) ! upper limit of temperature of the warmest month - real(r8), pointer :: gdd0(:) ! growing degree-days base 0C' - real(r8), pointer :: gdd8(:) ! growing degree-days base 8C from planting - real(r8), pointer :: gdd10(:) ! growing degree-days base 10C from planting - real(r8), pointer :: gddplant(:) ! growing degree-days from planting - real(r8), pointer :: gddtsoi(:) ! growing degree-days from planting (top two soil layers) - real(r8), pointer :: a10tmin(:) ! 10-day running mean of min 2-m temperature - real(r8), pointer :: a5tmin(:) ! 5-day running mean of min 2-m temperature -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: g,l,c,p ! indices - integer :: itypveg ! vegetation type - integer :: dtime ! timestep size [seconds] - integer :: nstep ! timestep number - integer :: year ! year (0, ...) for nstep - integer :: month ! month (1, ..., 12) for nstep - integer :: day ! day of month (1, ..., 31) for nstep - integer :: secs ! seconds into current date for nstep - logical :: end_cd ! temporary for is_end_curr_day() value - integer :: ier ! error status - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - real(r8), pointer :: rbufslp(:) ! temporary single level - pft level -!------------------------------------------------------------------------ - - ! Determine necessary indices - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Assign local pointers to derived subtypes components (gridcell-level) - - forc_t => clm_a2l%forc_t - forc_rain => clm_a2l%forc_rain - forc_snow => clm_a2l%forc_snow - forc_solad => clm_a2l%forc_solad ! (heald 04/06) - forc_solai => clm_a2l%forc_solai ! (heald 04/06) - - ! Assign local pointers to derived subtypes components (landunit-level) - ifspecial => lun%ifspecial - urbpoi => lun%urbpoi - - ! Assign local pointers to derived subtypes components (pft-level) - - itype => pft%itype - pgridcell => pft%gridcell - t_ref2m => pes%t_ref2m - t_ref2m_max_inst => pes%t_ref2m_max_inst - t_ref2m_min_inst => pes%t_ref2m_min_inst - t_ref2m_max => pes%t_ref2m_max - t_ref2m_min => pes%t_ref2m_min - t_ref2m_u => pes%t_ref2m_u - t_ref2m_r => pes%t_ref2m_r - t_ref2m_max_u => pes%t_ref2m_max_u - t_ref2m_max_r => pes%t_ref2m_max_r - t_ref2m_min_u => pes%t_ref2m_min_u - t_ref2m_min_r => pes%t_ref2m_min_r - t_ref2m_max_inst_u => pes%t_ref2m_max_inst_u - t_ref2m_max_inst_r => pes%t_ref2m_max_inst_r - t_ref2m_min_inst_u => pes%t_ref2m_min_inst_u - t_ref2m_min_inst_r => pes%t_ref2m_min_inst_r - plandunit => pft%landunit - t10 => pes%t10 - a10tmin => pes%a10tmin - a5tmin => pes%a5tmin - t_mo => pdgvs%t_mo - t_mo_min => pdgvs%t_mo_min - prec365 => pdgvs%prec365 - agddtw => pdgvs%agddtw - agdd => pdgvs%agdd - twmax => dgv_pftcon%twmax - gdd0 => pps%gdd0 - gdd8 => pps%gdd8 - gdd10 => pps%gdd10 - gddplant => pps%gddplant - gddtsoi => pps%gddtsoi - vf => pps%vf - t_soisno => ces%t_soisno - h2osoi_liq => cws%h2osoi_liq - watsat => cps%watsat - dz => cps%dz - latdeg => grc%latdeg - croplive => pps%croplive - pcolumn => pft%column - t_veg24 => pvs%t_veg24 ! (heald 04/06) - t_veg240 => pvs%t_veg240 ! (heald 04/06) - fsd24 => pvs%fsd24 ! (heald 04/06) - fsd240 => pvs%fsd240 ! (heald 04/06) - fsi24 => pvs%fsi24 ! (heald 04/06) - fsi240 => pvs%fsi240 ! (heald 04/06) - fsun24 => pvs%fsun24 ! (heald 04/06) - fsun240 => pvs%fsun240 ! (heald 04/06) - elai_p => pvs%elai_p ! (heald 04/06) - t_veg => pes%t_veg ! (heald 04/06) - fsun => pps%fsun ! (heald 04/06) - elai => pps%elai ! (heald 04/06) - - ! Determine calendar information - - dtime = get_step_size() - nstep = get_nstep() - call get_curr_date (year, month, day, secs) - - ! Don't do any accumulation if nstep is zero - ! (only applies to coupled or cam mode) - - if (nstep == 0) return - - ! NOTE: currently only single level pft fields are used below - ! Variables are declared above that should make it easy to incorporate - ! multi-level or single-level fields of any subgrid type - - ! Allocate needed dynamic memory for single level pft field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'update_accum_hist allocation error for rbuf1dp' - call endrun - endif - - ! Accumulate and extract TREFAV - hourly average 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV', t_ref2m, nstep) - call extract_accum_field ('TREFAV', rbufslp, nstep) - end_cd = is_end_curr_day() - do p = begp,endp - if (rbufslp(p) /= spval) then - t_ref2m_max_inst(p) = max(rbufslp(p), t_ref2m_max_inst(p)) - t_ref2m_min_inst(p) = min(rbufslp(p), t_ref2m_min_inst(p)) - endif - if (end_cd) then - t_ref2m_max(p) = t_ref2m_max_inst(p) - t_ref2m_min(p) = t_ref2m_min_inst(p) - t_ref2m_max_inst(p) = -spval - t_ref2m_min_inst(p) = spval - else if (secs == int(dtime)) then - t_ref2m_max(p) = spval - t_ref2m_min(p) = spval - endif - end do - - ! Accumulate and extract TREFAV_U - hourly average urban 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV_U', t_ref2m_u, nstep) - call extract_accum_field ('TREFAV_U', rbufslp, nstep) - do p = begp,endp - l = plandunit(p) - if (rbufslp(p) /= spval) then - t_ref2m_max_inst_u(p) = max(rbufslp(p), t_ref2m_max_inst_u(p)) - t_ref2m_min_inst_u(p) = min(rbufslp(p), t_ref2m_min_inst_u(p)) - endif - if (end_cd) then - if (urbpoi(l)) then - t_ref2m_max_u(p) = t_ref2m_max_inst_u(p) - t_ref2m_min_u(p) = t_ref2m_min_inst_u(p) - t_ref2m_max_inst_u(p) = -spval - t_ref2m_min_inst_u(p) = spval - end if - else if (secs == int(dtime)) then - t_ref2m_max_u(p) = spval - t_ref2m_min_u(p) = spval - endif - end do - - ! Accumulate and extract TREFAV_R - hourly average rural 2m air temperature - ! Used to compute maximum and minimum of hourly averaged 2m reference - ! temperature over a day. Note that "spval" is returned by the call to - ! accext if the time step does not correspond to the end of an - ! accumulation interval. First, initialize the necessary values for - ! an initial run at the first time step the accumulator is called - - call update_accum_field ('TREFAV_R', t_ref2m_r, nstep) - call extract_accum_field ('TREFAV_R', rbufslp, nstep) - do p = begp,endp - l = plandunit(p) - if (rbufslp(p) /= spval) then - t_ref2m_max_inst_r(p) = max(rbufslp(p), t_ref2m_max_inst_r(p)) - t_ref2m_min_inst_r(p) = min(rbufslp(p), t_ref2m_min_inst_r(p)) - endif - if (end_cd) then - if (.not.(ifspecial(l))) then - t_ref2m_max_r(p) = t_ref2m_max_inst_r(p) - t_ref2m_min_r(p) = t_ref2m_min_inst_r(p) - t_ref2m_max_inst_r(p) = -spval - t_ref2m_min_inst_r(p) = spval - end if - else if (secs == int(dtime)) then - t_ref2m_max_r(p) = spval - t_ref2m_min_r(p) = spval - endif - end do - - ! Accumulate and extract T_VEG24 & T_VEG240 (heald 04/06) - do p = begp,endp - rbufslp(p) = t_veg(p) - end do - call update_accum_field ('T_VEG24', rbufslp, nstep) - call extract_accum_field ('T_VEG24', t_veg24, nstep) - call update_accum_field ('T_VEG240', rbufslp, nstep) - call extract_accum_field ('T_VEG240', t_veg240, nstep) - - ! Accumulate and extract forc_solad24 & forc_solad240 (heald 04/06) - do p = begp,endp - g = pgridcell(p) - rbufslp(p) = forc_solad(g,1) - end do - call update_accum_field ('FSD240', rbufslp, nstep) - call extract_accum_field ('FSD240', fsd240, nstep) - call update_accum_field ('FSD24', rbufslp, nstep) - call extract_accum_field ('FSD24', fsd24, nstep) - - ! Accumulate and extract forc_solai24 & forc_solai240 (heald 04/06) - do p = begp,endp - g = pgridcell(p) - rbufslp(p) = forc_solai(g,1) - end do - call update_accum_field ('FSI24', rbufslp, nstep) - call extract_accum_field ('FSI24', fsi24, nstep) - call update_accum_field ('FSI240', rbufslp, nstep) - call extract_accum_field ('FSI240', fsi240, nstep) - - ! Accumulate and extract fsun24 & fsun240 (heald 04/06) - do p = begp,endp - rbufslp(p) = fsun(p) - end do - call update_accum_field ('FSUN24', rbufslp, nstep) - call extract_accum_field ('FSUN24', fsun24, nstep) - call update_accum_field ('FSUN240', rbufslp, nstep) - call extract_accum_field ('FSUN240', fsun240, nstep) - - ! Accumulate and extract elai_p (heald 04/06) - do p = begp,endp - rbufslp(p) = elai(p) - end do - call update_accum_field ('LAIP', rbufslp, nstep) - call extract_accum_field ('LAIP', elai_p, nstep) - - if (use_cndv .or. use_crop) then - ! Accumulate and extract T10 - !(acumulates TSA as 10-day running mean) - - call update_accum_field ('T10', t_ref2m, nstep) - call extract_accum_field ('T10', t10, nstep) - end if - - if (use_cndv) then - ! Accumulate and extract TDA - ! (accumulates TBOT as 30-day average) - ! Also determine t_mo_min - - do p = begp,endp - g = pgridcell(p) - rbufslp(p) = forc_t(g) - end do - call update_accum_field ('TDA', rbufslp, nstep) - call extract_accum_field ('TDA', rbufslp, nstep) - do p = begp,endp - t_mo(p) = rbufslp(p) - t_mo_min(p) = min(t_mo_min(p), rbufslp(p)) - end do - - ! Accumulate and extract PREC365 - ! (accumulates total precipitation as 365-day running mean) - - do p = begp,endp - g = pgridcell(p) - rbufslp(p) = forc_rain(g) + forc_snow(g) - end do - call update_accum_field ('PREC365', rbufslp, nstep) - call extract_accum_field ('PREC365', prec365, nstep) - - ! Accumulate growing degree days based on 10-day running mean temperature. - ! The trigger to reset the accumulated values to zero is -99999. - - ! Accumulate and extract AGDDTW (gdd base twmax, which is 23 deg C - ! for boreal woody pfts) - - do p = begp,endp - rbufslp(p) = max(0._r8, (t10(p) - SHR_CONST_TKFRZ - twmax(ndllf_dcd_brl_tree)) & - * dtime/SHR_CONST_CDAY) - if (month==1 .and. day==1 .and. secs==int(dtime)) rbufslp(p) = -99999._r8 - end do - call update_accum_field ('AGDDTW', rbufslp, nstep) - call extract_accum_field ('AGDDTW', agddtw, nstep) - - ! Accumulate and extract AGDD - - do p = begp,endp - rbufslp(p) = max(0.0_r8, (t_ref2m(p) - (SHR_CONST_TKFRZ + 5.0_r8)) & - * dtime/SHR_CONST_CDAY) - end do - call update_accum_field ('AGDD', rbufslp, nstep) - call extract_accum_field ('AGDD', agdd, nstep) - end if - - if ( crop_prog )then - ! Accumulate and extract TDM10 - - do p = begp,endp - rbufslp(p) = min(t_ref2m_min(p),t_ref2m_min_inst(p)) !slevis: ok choice? - if (rbufslp(p) > 1.e30_r8) rbufslp(p) = SHR_CONST_TKFRZ !and were 'min'& - end do !'min_inst' not initialized? - call update_accum_field ('TDM10', rbufslp, nstep) - call extract_accum_field ('TDM10', a10tmin, nstep) - - ! Accumulate and extract TDM5 - - do p = begp,endp - rbufslp(p) = min(t_ref2m_min(p),t_ref2m_min_inst(p)) !slevis: ok choice? - if (rbufslp(p) > 1.e30_r8) rbufslp(p) = SHR_CONST_TKFRZ !and were 'min'& - end do !'min_inst' not initialized? - call update_accum_field ('TDM5', rbufslp, nstep) - call extract_accum_field ('TDM5', a5tmin, nstep) - - ! Accumulate and extract GDD0 - - do p = begp,endp - itypveg = itype(p) - g = pgridcell(p) - if (month==1 .and. day==1 .and. secs==int(dtime)) then - rbufslp(p) = -99999._r8 ! reset gdd - else if (( month > 3 .and. month < 10 .and. latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(26._r8, t_ref2m(p)-SHR_CONST_TKFRZ)) & - * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end do - call update_accum_field ('GDD0', rbufslp, nstep) - call extract_accum_field ('GDD0', gdd0, nstep) - - ! Accumulate and extract GDD8 - - do p = begp,endp - itypveg = itype(p) - g = pgridcell(p) - if (month==1 .and. day==1 .and. secs==int(dtime)) then - rbufslp(p) = -99999._r8 ! reset gdd - else if (( month > 3 .and. month < 10 .and. latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - t_ref2m(p)-(SHR_CONST_TKFRZ + 8._r8))) & - * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end do - call update_accum_field ('GDD8', rbufslp, nstep) - call extract_accum_field ('GDD8', gdd8, nstep) - - ! Accumulate and extract GDD10 - - do p = begp,endp - itypveg = itype(p) - g = pgridcell(p) - if (month==1 .and. day==1 .and. secs==int(dtime)) then - rbufslp(p) = -99999._r8 ! reset gdd - else if (( month > 3 .and. month < 10 .and. latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - t_ref2m(p)-(SHR_CONST_TKFRZ + 10._r8))) & - * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end do - call update_accum_field ('GDD10', rbufslp, nstep) - call extract_accum_field ('GDD10', gdd10, nstep) - - ! Accumulate and extract GDDPLANT - - do p = begp,endp - if (croplive(p)) then ! relative to planting date - itypveg = itype(p) - rbufslp(p) = max(0._r8, min(mxtmp(itypveg), & - t_ref2m(p)-(SHR_CONST_TKFRZ + baset(itypveg)))) & - * dtime/SHR_CONST_CDAY - if (itypveg == nwcereal) rbufslp(p) = rbufslp(p)*vf(p) - else - rbufslp(p) = -99999._r8 - end if - end do - call update_accum_field ('GDDPLANT', rbufslp, nstep) - call extract_accum_field ('GDDPLANT', gddplant, nstep) - - ! Accumulate and extract GDDTSOI - ! In agroibis this variable is calculated - ! to 0.05 m, so here we use the top two soil layers - - do p = begp,endp - if (croplive(p)) then ! relative to planting date - itypveg = itype(p) - c = pcolumn(p) - rbufslp(p) = max(0._r8, min(mxtmp(itypveg), & - ((t_soisno(c,1)*dz(c,1)+t_soisno(c,2)*dz(c,2))/(dz(c,1)+dz(c,2))) - & - (SHR_CONST_TKFRZ + baset(itypveg)))) * dtime/SHR_CONST_CDAY - if (itypveg == nwcereal) rbufslp(p) = rbufslp(p)*vf(p) - else - rbufslp(p) = -99999._r8 - end if - end do - call update_accum_field ('GDDTSOI', rbufslp, nstep) - call extract_accum_field ('GDDTSOI', gddtsoi, nstep) - - end if - - ! Deallocate dynamic memory - - deallocate(rbufslp) - - end subroutine updateAccFlds - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: initAccClmtype -! -! !INTERFACE: - subroutine initAccClmtype -! -! !DESCRIPTION: -! Initialize clmtype variables that are associated with -! time accumulated fields. This routine is called in an initial run -! at nstep=0 for cam and csm mode. -! This routine is also always called for a restart run and -! therefore must be called after the restart file is read in -! and the accumulated fields are obtained. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use decompMod , only : get_proc_bounds, get_proc_global - use accumulMod , only : extract_accum_field - use clm_time_manager, only : get_nstep - use clm_varctl , only : nsrest, nsrStartup - use clm_varcon , only : spval -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit out arguments -! - real(r8), pointer :: t_ref2m_min(:) ! daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max(:) ! daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst(:) ! instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst(:) ! instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_u(:) ! Urban daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_r(:) ! Rural daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_u(:) ! Urban daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_r(:) ! Rural daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst_u(:) ! Urban instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_inst_r(:) ! Rural instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_u(:) ! Urban instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_r(:) ! Rural instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t10(:) ! 10-day running mean of the 2 m temperature (K) - real(r8), pointer :: t_mo(:) ! 30-day average temperature (Kelvin) - real(r8), pointer :: prec365(:) ! 365-day running mean of tot. precipitation - real(r8), pointer :: agddtw(:) ! accumulated growing degree days above twmax - real(r8), pointer :: agdd(:) ! accumulated growing degree days above 5 - real(r8), pointer :: gdd0(:) ! growing degree-days base 0C' - real(r8), pointer :: gdd8(:) ! growing degree-days base 8C from planting - real(r8), pointer :: gdd10(:) ! growing degree-days base 10C from planting - real(r8), pointer :: gddplant(:) ! growing degree-days from planting - real(r8), pointer :: gddtsoi(:) ! growing degree-days from planting (top two soil layers) - real(r8), pointer :: a10tmin(:) ! 10-day running mean of min 2-m temperature - real(r8), pointer :: a5tmin(:) ! 5-day running mean of min 2-m temperature - ! heald (04/06): accumulated variables for VOC emissions - real(r8), pointer :: t_veg24(:) ! 24hr average vegetation temperature (K) - real(r8), pointer :: t_veg240(:) ! 240hr average vegetation temperature (Kelvin) - real(r8), pointer :: fsd24(:) ! 24hr average of direct beam radiation - real(r8), pointer :: fsd240(:) ! 240hr average of direct beam radiation - real(r8), pointer :: fsi24(:) ! 24hr average of diffuse beam radiation - real(r8), pointer :: fsi240(:) ! 240hr average of diffuse beam radiation - real(r8), pointer :: fsun24(:) ! 24hr average of sunlit fraction of canopy - real(r8), pointer :: fsun240(:) ! 240hr average of sunlit fraction of canopy - real(r8), pointer :: elai_p(:) ! leaf area index average over timestep -! -! !LOCAL VARIABLES: -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: p ! indices - integer :: nstep ! time step - integer :: ier ! error status - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - real(r8), pointer :: rbufslp(:) ! temporary - character(len=32) :: subname = 'initAccClmtype' ! subroutine name -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (pft-level) - - t_ref2m_max_inst => pes%t_ref2m_max_inst - t_ref2m_min_inst => pes%t_ref2m_min_inst - t_ref2m_max => pes%t_ref2m_max - t_ref2m_min => pes%t_ref2m_min - t_ref2m_max_inst_u => pes%t_ref2m_max_inst_u - t_ref2m_max_inst_r => pes%t_ref2m_max_inst_r - t_ref2m_min_inst_u => pes%t_ref2m_min_inst_u - t_ref2m_min_inst_r => pes%t_ref2m_min_inst_r - t_ref2m_max_u => pes%t_ref2m_max_u - t_ref2m_max_r => pes%t_ref2m_max_r - t_ref2m_min_u => pes%t_ref2m_min_u - t_ref2m_min_r => pes%t_ref2m_min_r - t10 => pes%t10 - a10tmin => pes%a10tmin - a5tmin => pes%a5tmin - t_mo => pdgvs%t_mo - prec365 => pdgvs%prec365 - agddtw => pdgvs%agddtw - agdd => pdgvs%agdd - gdd0 => pps%gdd0 - gdd8 => pps%gdd8 - gdd10 => pps%gdd10 - gddplant => pps%gddplant - gddtsoi => pps%gddtsoi - ! heald (04/06): accumulated variables for VOC emissions - t_veg24 => pvs%t_veg24 - t_veg240 => pvs%t_veg240 - fsd24 => pvs%fsd24 - fsd240 => pvs%fsd240 - fsi24 => pvs%fsi24 - fsi240 => pvs%fsi240 - fsun24 => pvs%fsun24 - fsun240 => pvs%fsun240 - elai_p => pvs%elai_p - - ! Determine necessary indices - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Determine time step - - nstep = get_nstep() - - ! Initialize 2m ref temperature max and min values - - if (nsrest == nsrStartup) then ! Why not restart&branch? These vars are not in clmr. - do p = begp,endp - t_ref2m_max(p) = spval - t_ref2m_min(p) = spval - t_ref2m_max_inst(p) = -spval - t_ref2m_min_inst(p) = spval - t_ref2m_max_u(p) = spval - t_ref2m_max_r(p) = spval - t_ref2m_min_u(p) = spval - t_ref2m_min_r(p) = spval - t_ref2m_max_inst_u(p) = -spval - t_ref2m_max_inst_r(p) = -spval - t_ref2m_min_inst_u(p) = spval - t_ref2m_min_inst_r(p) = spval - end do - end if - - ! Allocate needed dynamic memory for single level pft field - - allocate(rbufslp(begp:endp), stat=ier) - if (ier/=0) then - write(iulog,*)'extract_accum_hist allocation error for rbufslp in '//subname - call endrun - endif - - ! Initialize clmtype variables that are to be time accumulated - - call extract_accum_field ('T_VEG24', rbufslp, nstep) - do p = begp,endp - t_veg24(p) = rbufslp(p) - end do - - call extract_accum_field ('T_VEG240', rbufslp, nstep) - do p = begp,endp - t_veg240(p) = rbufslp(p) - end do - - call extract_accum_field ('FSD24', rbufslp, nstep) - do p = begp,endp - fsd24(p) = rbufslp(p) - end do - - call extract_accum_field ('FSD240', rbufslp, nstep) - do p = begp,endp - fsd240(p) = rbufslp(p) - end do - - call extract_accum_field ('FSI24', rbufslp, nstep) - do p = begp,endp - fsi24(p) = rbufslp(p) - end do - - call extract_accum_field ('FSI240', rbufslp, nstep) - do p = begp,endp - fsi240(p) = rbufslp(p) - end do - - call extract_accum_field ('FSUN24', rbufslp, nstep) - do p = begp,endp - fsun24(p) = rbufslp(p) - end do - - call extract_accum_field ('FSUN240', rbufslp, nstep) - do p = begp,endp - fsun240(p) = rbufslp(p) - end do - - call extract_accum_field ('LAIP', rbufslp, nstep) - do p = begp,endp - elai_p(p) = rbufslp(p) - end do - - if ( crop_prog )then - - call extract_accum_field ('GDD0', rbufslp, nstep) - do p = begp,endp - gdd0(p) = rbufslp(p) - end do - - call extract_accum_field ('GDD8', rbufslp, nstep) - do p = begp,endp - gdd8(p) = rbufslp(p) - end do - - call extract_accum_field ('GDD10', rbufslp, nstep) - do p = begp,endp - gdd10(p) = rbufslp(p) - end do - - call extract_accum_field ('GDDPLANT', rbufslp, nstep) - do p = begp,endp - gddplant(p) = rbufslp(p) - end do - - call extract_accum_field ('GDDTSOI', rbufslp, nstep) - do p = begp,endp - gddtsoi(p) = rbufslp(p) - end do - - call extract_accum_field ('TDM10', rbufslp, nstep) - do p = begp,endp - a10tmin(p) = rbufslp(p) - end do - - call extract_accum_field ('TDM5', rbufslp, nstep) - do p = begp,endp - a5tmin(p) = rbufslp(p) - end do - - end if - - if (use_cndv .or. use_crop) then - call extract_accum_field ('T10', rbufslp, nstep) - do p = begp,endp - t10(p) = rbufslp(p) - end do - end if - - if (use_cndv) then - call extract_accum_field ('TDA', rbufslp, nstep) - do p = begp,endp - t_mo(p) = rbufslp(p) - end do - - call extract_accum_field ('PREC365', rbufslp, nstep) - do p = begp,endp - prec365(p) = rbufslp(p) - end do - - call extract_accum_field ('AGDDTW', rbufslp, nstep) - do p = begp,endp - agddtw(p) = rbufslp(p) - end do - - call extract_accum_field ('AGDD', rbufslp, nstep) - do p = begp,endp - agdd(p) = rbufslp(p) - end do - end if - - deallocate(rbufslp) - - end subroutine initAccClmtype - -end module accFldsMod diff --git a/src_clm40/main/accumulMod.F90 b/src_clm40/main/accumulMod.F90 deleted file mode 100644 index f78723f975..0000000000 --- a/src_clm40/main/accumulMod.F90 +++ /dev/null @@ -1,656 +0,0 @@ -module accumulMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! This module contains generic subroutines that can be used to - ! define, accumulate and extract user-specified fields over - ! user-defined intervals. Each interval and accumulation type is - ! unique to each field processed. - ! Subroutine [init_accumulator] defines the values of the accumulated - ! field data structure. Subroutine [update_accum_field] does - ! the actual accumulation for a given field. - ! Four types of accumulations are possible: - ! - Average over time interval. Time average fields are only - ! valid at the end of the averaging interval. - ! - Running mean over time interval. Running means are valid once the - ! length of the simulation exceeds the - ! - Running accumulation over time interval. Accumulated fields are - ! continuously accumulated. The trigger value "-99999." resets - ! the accumulation to zero. - ! - ! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_sys_mod , only: shr_sys_abort - use clm_varctl , only: iulog - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: accumulRest ! Write/read restart of accumulation fields - public :: init_accum_field ! Initialize an accumulator field - public :: print_accum_fields ! Print info about accumulator fields - public :: extract_accum_field ! Extracts the current value of an accumulator field - public :: update_accum_field ! Update the current value of an accumulator field - - interface extract_accum_field - module procedure extract_accum_field_sl ! Extract current val of single-level accumulator field - module procedure extract_accum_field_ml ! Extract current val of multi-level accumulator field - end interface - interface update_accum_field ! Updates the current value of an accumulator field - module procedure update_accum_field_sl ! Update single-level accumulator field - module procedure update_accum_field_ml ! Update multi-level accumulator field - end interface - private - ! - ! !PRIVATE TYPES: - type accum_field - character(len= 8) :: name !field name - character(len=128) :: desc !field description - character(len= 8) :: units !field units - character(len= 8) :: acctype !accumulation type: ["timeavg","runmean","runaccum"] - character(len= 8) :: type1d !subgrid type: ["gridcell","landunit","column" or "pft"] - character(len= 8) :: type2d !type2d ('','levsoi','numrad',..etc. ) - integer :: beg1d !subgrid type beginning index - integer :: end1d !subgrid type ending index - integer :: num1d !total subgrid points - integer :: numlev !number of vertical levels in field - real(r8) :: initval !initial value of accumulated field - real(r8), pointer :: val(:,:) !accumulated field - integer :: period !field accumulation period (in model time steps) - end type accum_field - - real(r8), parameter, public :: accumResetVal = -99999._r8 ! used to do an annual reset ( put in for bug 1858) - - integer, parameter :: max_accum = 100 !maximum number of accumulated fields - type (accum_field) :: accum(max_accum) !array accumulated fields - integer :: naccflds = 0 !accumulator field counter - - integer :: iflag_interp = 1 - integer :: iflag_copy = 2 - integer :: iflag_skip = 3 - !------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------ - subroutine init_accum_field (name, units, desc, & - accum_type, accum_period, numlev, subgrid_type, init_value, type2d) - ! - ! !DESCRIPTION: - ! Initialize accumulation fields. This subroutine sets: - ! o name of accumulated field - ! o units of accumulated field - ! o accumulation type of accumulated field - ! o description of accumulated fields: accdes - ! o accumulation period for accumulated field (in iterations) - ! o initial value of accumulated field - ! - ! !USES: - use shr_const_mod, only: SHR_CONST_CDAY - use clm_time_manager, only : get_step_size - use decompMod, only : get_proc_bounds, get_proc_global - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - character(len=*), intent(in) :: units !field units - character(len=*), intent(in) :: desc !field description - character(len=*), intent(in) :: accum_type !field type: tavg, runm, runa, ins - integer , intent(in) :: accum_period !field accumulation period - character(len=*), intent(in) :: subgrid_type !["gridcell","landunit","column" or "pft"] - integer , intent(in) :: numlev !number of vertical levels - real(r8), intent(in) :: init_value !field initial or reset value - character(len=*), intent(in), optional :: type2d !level type (optional) - needed if numlev > 1 - ! - ! !LOCAL VARIABLES: - integer :: nf ! field index - integer :: beg1d,end1d ! beggining and end subgrid indices - integer :: num1d ! total number subgrid indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: begCohort, endCohort ! per-proc beg end cohort indices - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: numCohort ! total number of cohorts across all processors - !------------------------------------------------------------------------ - - ! Determine necessary indices - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort ) - call get_proc_global(numg, numl, numc, nump, numCohort) - - ! update field index - ! Consistency check that number of accumulated does not exceed maximum. - - naccflds = naccflds + 1 - if (naccflds > max_accum) then - write(iulog,*) 'ACCUMULINIT error: user-defined accumulation fields ', & - 'equal to ',naccflds,' exceeds max_accum' - call shr_sys_abort() - end if - nf = naccflds - - ! Note accumulation period must be converted from days - ! to number of iterations - - accum(nf)%name = trim(name) - accum(nf)%units = trim(units) - accum(nf)%desc = trim(desc) - accum(nf)%acctype = trim(accum_type) - accum(nf)%initval = init_value - accum(nf)%period = accum_period - if (accum(nf)%period < 0) then - accum(nf)%period = -accum(nf)%period * nint(SHR_CONST_CDAY) / get_step_size() - end if - - select case (trim(subgrid_type)) - case ('gridcell') - beg1d = begg - end1d = endg - num1d = numg - case ('landunit') - beg1d = begl - end1d = endl - num1d = numl - case ('column') - beg1d = begc - end1d = endc - num1d = numc - case ('pft') - beg1d = begp - end1d = endp - num1d = nump - case default - write(iulog,*)'ACCUMULINIT: unknown subgrid type ',subgrid_type - call shr_sys_abort () - end select - - accum(nf)%type1d = trim(subgrid_type) - accum(nf)%beg1d = beg1d - accum(nf)%end1d = end1d - accum(nf)%num1d = num1d - accum(nf)%numlev = numlev - - if (present(type2d)) then - accum(nf)%type2d = type2d - else - accum(nf)%type2d = ' ' - end if - - ! Allocate and initialize accumulation field - - allocate(accum(nf)%val(beg1d:end1d,numlev)) - accum(nf)%val(beg1d:end1d,numlev) = init_value - - end subroutine init_accum_field - - !------------------------------------------------------------------------ - subroutine print_accum_fields() - ! - ! !DESCRIPTION: - ! Diagnostic printout of accumulated fields - ! - ! !USES: - use spmdMod, only : masterproc - ! - ! !ARGUMENTS: - implicit none - ! - integer :: i,nf !indices - !------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*) - write(iulog,*) 'Initializing variables for time accumulation .....' - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Accumulated fields' - write(iulog,1002) - write(iulog,'(72a1)') ("_",i=1,71) - do nf = 1, naccflds - if (accum(nf)%period /= huge(1)) then - write(iulog,1003) nf,accum(nf)%name,accum(nf)%units,& - accum(nf)%acctype, accum(nf)%period, accum(nf)%initval, & - accum(nf)%desc - else - write(iulog,1004) nf,accum(nf)%name,accum(nf)%units,& - accum(nf)%acctype, accum(nf)%initval, accum(nf)%desc - endif - end do - write(iulog,'(72a1)') ("_",i=1,71) - write(iulog,*) - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Successfully initialized variables for accumulation' - write(iulog,*) - endif - -1002 format(' No',' Name ',' Units ',' Type ','Period',' Inival',' Description') -1003 format((1x,i2),(1x,a8),(1x,a8),(1x,a8), (1x,i5),(1x,f4.0),(1x,a40)) -1004 format((1x,i2),(1x,a8),(1x,a8),(1x,a8),' N.A.',(1x,f4.0),(1x,a40)) - - end subroutine print_accum_fields - - !------------------------------------------------------------------------ - subroutine extract_accum_field_sl (name, field, nstep) - ! - ! !DESCRIPTION: - ! Extract single-level accumulated field. - ! This routine extracts the field values from the multi-level - ! accumulation field. It extracts the current value except if - ! the field type is a time average. In this case, an absurd value - ! is assigned to indicate the time average is not yet valid. - ! - ! !USES: - use clm_varcon, only : spval, ispval - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:) :: field !field values for current time step - integer , intent(in) :: nstep !timestep index - ! - ! !LOCAL VARIABLES: - integer :: i,k,nf !indices - integer :: beg,end !subgrid beginning,ending indices - !------------------------------------------------------------------------ - - ! find field index. return if "name" is not on list - - nf = 0 - do i = 1, naccflds - if (name == accum(i)%name) nf = i - end do - if (nf == 0) then - write(iulog,*) 'EXTRACT_ACCUM_FIELD_SL error: field name ',name,' not found' - call shr_sys_abort - endif - - ! error check - - beg = accum(nf)%beg1d - end = accum(nf)%end1d - if (size(field,dim=1) /= end-beg+1) then - write(iulog,*)'ERROR in extract_accum_field for field ',accum(nf)%name - write(iulog,*)'size of first dimension of field is ',& - size(field,dim=1),' and should be ',end-beg+1 - call shr_sys_abort - endif - - ! extract field - - if (accum(nf)%acctype == 'timeavg' .and. & - mod(nstep,accum(nf)%period) /= 0) then - do k = beg,end - field(k) = spval !assign absurd value when avg not ready - end do - else - do k = beg,end - field(k) = accum(nf)%val(k,1) - end do - end if - - end subroutine extract_accum_field_sl - - !------------------------------------------------------------------------ - subroutine extract_accum_field_ml (name, field, nstep) - ! - ! !DESCRIPTION: - ! Extract mutli-level accumulated field. - ! This routine extracts the field values from the multi-level - ! accumulation field. It extracts the current value except if - ! the field type is a time average. In this case, an absurd value - ! is assigned to indicate the time average is not yet valid. - ! - ! !USES: - use clm_varcon, only : spval - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:,:) :: field !field values for current time step - integer, intent(in) :: nstep !timestep index - ! - ! !LOCAL VARIABLES: - integer :: i,j,k,nf !indices - integer :: beg,end !subgrid beginning,ending indices - integer :: numlev !number of vertical levels - !------------------------------------------------------------------------ - - ! find field index. return if "name" is not on list - - nf = 0 - do i = 1, naccflds - if (name == accum(i)%name) nf = i - end do - if (nf == 0) then - write(iulog,*) 'EXTRACT_ACCUM_FIELD_ML error: field name ',name,' not found' - call shr_sys_abort - endif - - ! error check - - numlev = accum(nf)%numlev - beg = accum(nf)%beg1d - end = accum(nf)%end1d - if (size(field,dim=1) /= end-beg+1) then - write(iulog,*)'ERROR in extract_accum_field for field ',accum(nf)%name - write(iulog,*)'size of first dimension of field is ',& - size(field,dim=1),' and should be ',end-beg+1 - call shr_sys_abort - else if (size(field,dim=2) /= numlev) then - write(iulog,*)'ERROR in extract_accum_field for field ',accum(nf)%name - write(iulog,*)'size of second dimension of field iis ',& - size(field,dim=2),' and should be ',numlev - call shr_sys_abort - endif - - !extract field - - if (accum(nf)%acctype == 'timeavg' .and. & - mod(nstep,accum(nf)%period) /= 0) then - do j = 1,numlev - do k = beg,end - field(k,j) = spval !assign absurd value when avg not ready - end do - end do - else - do j = 1,numlev - do k = beg,end - field(k,j) = accum(nf)%val(k,j) - end do - end do - end if - - end subroutine extract_accum_field_ml - - !------------------------------------------------------------------------ - subroutine update_accum_field_sl (name, field, nstep) - ! - ! !DESCRIPTION: - ! Accumulate single level field over specified time interval. - ! The appropriate field is accumulated in the array [accval]. - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:) :: field !field values for current time step - integer , intent(in) :: nstep !time step index - ! - ! !LOCAL VARIABLES: - integer :: i,k,nf !indices - integer :: accper !temporary accumulation period - integer :: beg,end !subgrid beginning,ending indices - !------------------------------------------------------------------------ - - ! find field index. return if "name" is not on list - - nf = 0 - do i = 1, naccflds - if (name == accum(i)%name) nf = i - end do - if (nf == 0) then - write(iulog,*) 'UPDATE_ACCUM_FIELD_SL error: field name ',name,' not found' - call shr_sys_abort - endif - - ! error check - - beg = accum(nf)%beg1d - end = accum(nf)%end1d - if (size(field,dim=1) /= end-beg+1) then - write(iulog,*)'ERROR in UPDATE_ACCUM_FIELD_SL for field ',accum(nf)%name - write(iulog,*)'size of first dimension of field is ',size(field,dim=1),& - ' and should be ',end-beg+1 - call shr_sys_abort - endif - - ! accumulate field - - if (accum(nf)%acctype /= 'timeavg' .AND. & - accum(nf)%acctype /= 'runmean' .AND. & - accum(nf)%acctype /= 'runaccum') then - write(iulog,*) 'UPDATE_ACCUM_FIELD_SL error: incorrect accumulation type' - write(iulog,*) ' was specified for field ',name - write(iulog,*)' accumulation type specified is ',accum(nf)%acctype - write(iulog,*)' only [timeavg, runmean, runaccum] are currently acceptable' - call shr_sys_abort() - end if - - - ! reset accumulated field value if necessary and update - ! accumulation field - ! running mean never reset - - if (accum(nf)%acctype == 'timeavg') then - - !time average field reset every accumulation period - !normalize at end of accumulation period - - if ((mod(nstep,accum(nf)%period) == 1 .or. accum(nf)%period == 1) .and. (nstep /= 0))then - accum(nf)%val(beg:end,1) = 0._r8 - end if - accum(nf)%val(beg:end,1) = accum(nf)%val(beg:end,1) + field(beg:end) - if (mod(nstep,accum(nf)%period) == 0) then - accum(nf)%val(beg:end,1) = accum(nf)%val(beg:end,1) / accum(nf)%period - endif - - else if (accum(nf)%acctype == 'runmean') then - - !running mean - reset accumulation period until greater than nstep - - accper = min (nstep,accum(nf)%period) - accum(nf)%val(beg:end,1) = ((accper-1)*accum(nf)%val(beg:end,1) + field(beg:end)) / accper - - else if (accum(nf)%acctype == 'runaccum') then - - !running accumulation field reset at trigger -99999 - - do k = beg,end - if (nint(field(k)) == -99999) then - accum(nf)%val(k,1) = 0._r8 - end if - end do - accum(nf)%val(beg:end,1) = min(max(accum(nf)%val(beg:end,1) + field(beg:end), 0._r8), 99999._r8) - - end if - - end subroutine update_accum_field_sl - - !------------------------------------------------------------------------ - subroutine update_accum_field_ml (name, field, nstep) - ! - ! !DESCRIPTION: - ! Accumulate multi level field over specified time interval. - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name !field name - real(r8), pointer, dimension(:,:) :: field !field values for current time step - integer , intent(in) :: nstep !time step index - ! - ! !LOCAL VARIABLES: - integer :: i,j,k,nf !indices - integer :: accper !temporary accumulation period - integer :: beg,end !subgrid beginning,ending indices - integer :: numlev !number of vertical levels - !------------------------------------------------------------------------ - - ! find field index. return if "name" is not on list - - nf = 0 - do i = 1, naccflds - if (name == accum(i)%name) nf = i - end do - if (nf == 0) then - write(iulog,*) 'UPDATE_ACCUM_FIELD_ML error: field name ',name,' not found' - call shr_sys_abort - endif - - ! error check - - numlev = accum(nf)%numlev - beg = accum(nf)%beg1d - end = accum(nf)%end1d - if (size(field,dim=1) /= end-beg+1) then - write(iulog,*)'ERROR in UPDATE_ACCUM_FIELD_ML for field ',accum(nf)%name - write(iulog,*)'size of first dimension of field is ',size(field,dim=1),& - ' and should be ',end-beg+1 - call shr_sys_abort - else if (size(field,dim=2) /= numlev) then - write(iulog,*)'ERROR in UPDATE_ACCUM_FIELD_ML for field ',accum(nf)%name - write(iulog,*)'size of second dimension of field is ',size(field,dim=2),& - ' and should be ',numlev - call shr_sys_abort - endif - - ! accumulate field - - if (accum(nf)%acctype /= 'timeavg' .AND. & - accum(nf)%acctype /= 'runmean' .AND. & - accum(nf)%acctype /= 'runaccum') then - write(iulog,*) 'UPDATE_ACCUM_FIELD_ML error: incorrect accumulation type' - write(iulog,*) ' was specified for field ',name - write(iulog,*)' accumulation type specified is ',accum(nf)%acctype - write(iulog,*)' only [timeavg, runmean, runaccum] are currently acceptable' - call shr_sys_abort() - end if - - ! accumulate field - - ! reset accumulated field value if necessary and update - ! accumulation field - ! running mean never reset - - if (accum(nf)%acctype == 'timeavg') then - - !time average field reset every accumulation period - !normalize at end of accumulation period - - if ((mod(nstep,accum(nf)%period) == 1 .or. accum(nf)%period == 1) .and. (nstep /= 0))then - accum(nf)%val(beg:end,1:numlev) = 0._r8 - endif - accum(nf)%val(beg:end,1:numlev) = accum(nf)%val(beg:end,1:numlev) + field(beg:end,1:numlev) - if (mod(nstep,accum(nf)%period) == 0) then - accum(nf)%val(beg:end,1:numlev) = accum(nf)%val(beg:end,1:numlev) / accum(nf)%period - endif - - else if (accum(nf)%acctype == 'runmean') then - - !running mean - reset accumulation period until greater than nstep - - accper = min (nstep,accum(nf)%period) - accum(nf)%val(beg:end,1:numlev) = & - ((accper-1)*accum(nf)%val(beg:end,1:numlev) + field(beg:end,1:numlev)) / accper - - else if (accum(nf)%acctype == 'runaccum') then - - !running accumulation field reset at trigger -99999 - - do j = 1,numlev - do k = beg,end - if (nint(field(k,j)) == -99999) then - accum(nf)%val(k,j) = 0._r8 - end if - end do - end do - accum(nf)%val(beg:end,1:numlev) = & - min(max(accum(nf)%val(beg:end,1:numlev) + field(beg:end,1:numlev), 0._r8), 99999._r8) - - end if - - end subroutine update_accum_field_ml - - !------------------------------------------------------------------------ - subroutine accumulRest( ncid, flag ) - ! - ! !DESCRIPTION: - ! Read/write accumulation restart data - ! - ! !USES: - use clm_time_manager, only : is_restart - use clm_varcon , only : ispval - use ncdio_pio - use pio - ! - ! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid !netcdf unit - character(len=*) , intent(in) :: flag !'define','read', or 'write' - ! - ! !LOCAL VARIABLES: - integer :: nf,k,j ! indices - integer :: beg1d, end1d ! buffer bounds - integer :: ier ! error status - logical :: readvar ! determine if variable is on initial file - real(r8), pointer :: rbuf1d(:) ! temporary 1d buffer - type(var_desc_t) :: vardesc ! local vardesc - character(len=128) :: varname ! temporary - character(len= 32) :: subname='AccumRest' ! subroutine name - !------------------------------------------------------------------------ - - do nf = 1,naccflds - - ! Note = below need to allocate rbuf for single level variables, since - ! accum(nf)%val is always 2d - - varname = trim(accum(nf)%name) // '_VALUE' - if (flag == 'define') then - if (accum(nf)%numlev == 1) then - call ncd_defvar(ncid=ncid, varname=varname, xtype=ncd_double, & - dim1name=accum(nf)%type1d, & - long_name=accum(nf)%desc, units=accum(nf)%units) - ier = PIO_inq_varid(ncid, trim(varname), vardesc) - ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_interp) - else - call ncd_defvar(ncid=ncid, varname=varname, xtype=ncd_double, & - dim1name=accum(nf)%type1d, dim2name=accum(nf)%type2d, & - long_name=accum(nf)%desc, units=accum(nf)%units) - end if - else if (flag == 'read' .or. flag == 'write') then - if (accum(nf)%numlev == 1) then - beg1d = accum(nf)%beg1d - end1d = accum(nf)%end1d - allocate(rbuf1d(beg1d:end1d)) - if (flag == 'write') then - rbuf1d(beg1d:end1d) = accum(nf)%val(beg1d:end1d,1) - end if - call ncd_io(varname=varname, data=rbuf1d, & - dim1name=accum(nf)%type1d, ncid=ncid, flag=flag, readvar=readvar) - if (flag == 'read' .and. readvar) then - accum(nf)%val(beg1d:end1d,1) = rbuf1d(beg1d:end1d) - end if - deallocate(rbuf1d) - else - call ncd_io(varname=varname, data=accum(nf)%val, & - dim1name=accum(nf)%type1d, ncid=ncid, flag=flag, readvar=readvar) - end if - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call shr_sys_abort() - end if - end if - - varname = trim(accum(nf)%name) // '_PERIOD' - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname=varname, xtype=ncd_int, & - long_name='', units='time steps', imissing_value=ispval, & - ifill_value=huge(1)) - ier = PIO_inq_varid(ncid, trim(varname), vardesc) - ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_copy) - else if (flag == 'read' .or. flag == 'write') then - call ncd_io(varname=varname, data=accum(nf)%period, ncid=ncid, flag=flag, readvar=readvar) - if (flag=='read' .and. .not. readvar) then - if (is_restart()) call shr_sys_abort() - end if - end if - - end do - - end subroutine accumulRest - -end module accumulMod diff --git a/src_clm40/main/clm_atmlnd.F90 b/src_clm40/main/clm_atmlnd.F90 deleted file mode 100644 index b280aae03d..0000000000 --- a/src_clm40/main/clm_atmlnd.F90 +++ /dev/null @@ -1,551 +0,0 @@ -module clm_atmlnd - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_atmlnd -! -! !DESCRIPTION: -! Handle atm2lnd, lnd2atm mapping -! -! !USES: - use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. - use clm_varcon , only : rair, grav, cpair, hfus, tfrz - use clm_varctl , only : iulog, use_cn - use decompMod , only : get_proc_bounds - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use spmdMod , only : masterproc - use abortutils , only : endrun - use seq_drydep_mod, only : n_drydep, drydep_method, DD_XLND - use shr_megan_mod, only : shr_megan_mechcomps_n -! -! !PUBLIC TYPES: - implicit none - private - save -!---------------------------------------------------- -! atmosphere -> land variables structure -!---------------------------------------------------- - - ! Notes about atm2lnd_downscaled_fields_type, atm2lnd_type, and - ! a2l_not_downscaled_gcell: On the CLM4.5 side, atm2lnd_type has been broken into two - ! types: atm2lnd_type contains a subset of the original type, and - ! atm2lnd_downscaled_fields_type contains the remaining fields. Similarly, there are two - ! variables at the grid cell level: clm_a2l (of type atm2lnd_type) and - ! a2l_not_downscaled_gcell (of type atm2lnd_downscaled_fields_type). Because - ! lnd_import_export accesses these types and the related variables, and because - ! lnd_import_export is shared between the clm4.0 and clm4.5 sides, we needed to make - ! changes on the clm4.0 side for compatibility. Specifically, we needed to introduce a - ! pointer/alias named a2l_not_downscaled_gcell; for simplicity, this is simply another - ! way to access all of the fields in clm_a2l. Getting its type right is a bit tricky: - ! lnd_import_export expects it to be of type atm2lnd_downscaled_fields_type, but it - ! needs to point to a variable of type atm2lnd_type. To accomplish this, we have used - ! inheritance & polymorphism (Fortran 2003 features). - - ! This is really the type definition for atm2lnd_type. However, for compatibility with - ! clm4_5 (particularly in lnd_import_export) we need to call this - ! atm2lnd_downscaled_fields_type, and then define an extended type called atm2lnd_type. - type, public :: atm2lnd_downscaled_fields_type - real(r8), pointer :: forc_t(:) => null() !atmospheric temperature (Kelvin) - real(r8), pointer :: forc_u(:) => null() !atm wind speed, east direction (m/s) - real(r8), pointer :: forc_v(:) => null() !atm wind speed, north direction (m/s) - real(r8), pointer :: forc_wind(:) => null() !atmospheric wind speed - real(r8), pointer :: forc_q(:) => null() !atmospheric specific humidity (kg/kg) - real(r8), pointer :: forc_hgt(:) => null() !atmospheric reference height (m) - real(r8), pointer :: forc_hgt_u(:) => null() !obs height of wind [m] (new) - real(r8), pointer :: forc_hgt_t(:) => null() !obs height of temperature [m] (new) - real(r8), pointer :: forc_hgt_q(:) => null() !obs height of humidity [m] (new) - real(r8), pointer :: forc_pbot(:) => null() !atmospheric pressure (Pa) - real(r8), pointer :: forc_th(:) => null() !atm potential temperature (Kelvin) - real(r8), pointer :: forc_vp(:) => null() !atmospheric vapor pressure (Pa) - real(r8), pointer :: forc_rho(:) => null() !density (kg/m**3) - real(r8), pointer :: forc_rh(:) => null() !atmospheric relative humidity (%) - real(r8), pointer :: forc_psrf(:) => null() !surface pressure (Pa) - real(r8), pointer :: forc_pco2(:) => null() !CO2 partial pressure (Pa) - real(r8), pointer :: forc_lwrad(:) => null() !downward IR longwave radiation (W/m**2) - real(r8), pointer :: forc_solad(:,:) => null() !direct beam radiation (numrad) (vis=forc_sols , nir=forc_soll ) - real(r8), pointer :: forc_solai(:,:) => null() !diffuse radiation (numrad) (vis=forc_solsd, nir=forc_solld) - real(r8), pointer :: forc_solar(:) => null() !incident solar radiation - real(r8), pointer :: forc_rain(:) => null() !rain rate [mm/s] - real(r8), pointer :: forc_snow(:) => null() !snow rate [mm/s] - real(r8), pointer :: forc_ndep(:) => null() !nitrogen deposition rate (gN/m2/s) - real(r8), pointer :: forc_pc13o2(:) => null() !C13O2 partial pressure (Pa) - real(r8), pointer :: forc_po2(:) => null() !O2 partial pressure (Pa) - real(r8), pointer :: forc_flood(:) => null() ! rof flood (mm/s) - real(r8), pointer :: volr(:) => null() ! rof volr total (m3) - real(r8), pointer :: volrmch(:) => null() ! rof volr main channel (m3) - real(r8), pointer :: forc_aer(:,:) => null() ! aerosol deposition array - ! Needed for backwards compatibility with lnd_comp_mct used in clm4_5 - real(r8), pointer :: forc_pch4(:) => null() !CH4 partial pressure (Pa) - ! anomaly forcing - only define and only used in clm4_5. This is a hack - ! since lnd_import_export doesn't have a way to deal with the 45/40 - ! distinction - real(r8), pointer ::af_precip(:) => null() ! anomaly forcing - real(r8), pointer ::af_uwind(:) => null() ! anomaly forcing - real(r8), pointer ::af_vwind(:) => null() ! anomaly forcing - real(r8), pointer ::af_tbot(:) => null() ! anomaly forcing - real(r8), pointer ::af_pbot(:) => null() ! anomaly forcing - real(r8), pointer ::af_shum(:) => null() ! anomaly forcing - real(r8), pointer ::af_swdn(:) => null() ! anomaly forcing - real(r8), pointer ::af_lwdn(:) => null() ! anomaly forcing - real(r8), pointer :: bc_precip(:) => null() ! anomaly forcing - add bias correction - end type atm2lnd_downscaled_fields_type - - ! The following type extension is needed just so that lnd_import_export can remain - ! consistent between the clm4_0 code and clm4_5 code. - type, public, extends(atm2lnd_downscaled_fields_type) :: atm2lnd_type - end type atm2lnd_type - -!---------------------------------------------------- -! land -> atmosphere variables structure -!---------------------------------------------------- - - type, public :: lnd2atm_type - real(r8), pointer :: t_rad(:) => null() !radiative temperature (Kelvin) - real(r8), pointer :: t_ref2m(:) => null() !2m surface air temperature (Kelvin) - real(r8), pointer :: q_ref2m(:) => null() !2m surface specific humidity (kg/kg) - real(r8), pointer :: u_ref10m(:) => null() !10m surface wind speed (m/sec) - real(r8), pointer :: h2osno(:) => null() !snow water (mm H2O) - real(r8), pointer :: albd(:,:) => null() !(numrad) surface albedo (direct) - real(r8), pointer :: albi(:,:) => null() !(numrad) surface albedo (diffuse) - real(r8), pointer :: taux(:) => null() !wind stress: e-w (kg/m/s**2) - real(r8), pointer :: tauy(:) => null() !wind stress: n-s (kg/m/s**2) - real(r8), pointer :: eflx_lh_tot(:) => null() !total latent HF (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot(:) => null() !total sensible HF (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lwrad_out(:) => null() !IR (longwave) radiation (W/m**2) - real(r8), pointer :: qflx_evap_tot(:) => null() !qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: fsa(:) => null() !solar rad absorbed (total) (W/m**2) - real(r8), pointer :: nee(:) => null() !net CO2 flux (kg CO2/m**2/s) [+ to atm] - real(r8), pointer :: ram1(:) => null() !aerodynamical resistance (s/m) - real(r8), pointer :: fv(:) => null() !friction velocity (m/s) (for dust model) - real(r8), pointer :: h2osoi_vol(:,:) => null() !volumetric soil water (0~watsat, m3/m3, nlevgrnd) (for dust model) - real(r8), pointer :: rofliq(:) => null() ! rof liq forcing - real(r8), pointer :: rofice(:) => null() ! rof ice forcing - real(r8), pointer :: flxdst(:,:) => null() !dust flux (size bins) - real(r8), pointer :: ddvel(:,:) => null() !dry deposition velocities - real(r8), pointer :: flxvoc(:,:) => null() ! VOC flux (size bins) - ! Needed for backwards compatibility with lnd_comp_mct used in clm4_5 - real(r8), pointer :: flux_ch4(:) => null() !net CH4 flux (kg C/m**2/s) [+ to atm] - end type lnd2atm_type - - type(atm2lnd_type),public,target :: clm_a2l ! a2l fields on clm grid - type(lnd2atm_type),public,target :: clm_l2a ! l2a fields on clm grid - - ! The following alias is needed just so that lnd_import_export can remain consistent - ! between the clm4_0 code and clm4_5 code. - class(atm2lnd_downscaled_fields_type),public,pointer :: a2l_not_downscaled_gcell - -! !PUBLIC MEMBER FUNCTIONS: - public :: init_atm2lnd_type - public :: init_lnd2atm_type - public :: clm_map2gcell_minimal - public :: clm_map2gcell -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein and Tony Craig, 2006-01-10 -! -! !PRIVATE MEMBER FUNCTIONS: - -!EOP -!---------------------------------------------------- - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_atm2lnd_type -! -! !INTERFACE: - subroutine init_atm2lnd_type(beg, end, a2l) -! -! !DESCRIPTION: -! Initialize atmospheric variables required by the land -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (atm2lnd_type), intent(inout):: a2l -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! Modified by T Craig, 11/01/05 for finemesh project -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: ival ! initial value -!------------------------------------------------------------------------ - - allocate(a2l%forc_t(beg:end)) - allocate(a2l%forc_u(beg:end)) - allocate(a2l%forc_v(beg:end)) - allocate(a2l%forc_wind(beg:end)) - allocate(a2l%forc_q(beg:end)) - allocate(a2l%forc_rh(beg:end)) - allocate(a2l%forc_hgt(beg:end)) - allocate(a2l%forc_hgt_u(beg:end)) - allocate(a2l%forc_hgt_t(beg:end)) - allocate(a2l%forc_hgt_q(beg:end)) - allocate(a2l%forc_pbot(beg:end)) - allocate(a2l%forc_th(beg:end)) - allocate(a2l%forc_vp(beg:end)) - allocate(a2l%forc_rho(beg:end)) - allocate(a2l%forc_psrf(beg:end)) - allocate(a2l%forc_pco2(beg:end)) - allocate(a2l%forc_lwrad(beg:end)) - allocate(a2l%forc_solad(beg:end,numrad)) - allocate(a2l%forc_solai(beg:end,numrad)) - allocate(a2l%forc_solar(beg:end)) - allocate(a2l%forc_rain(beg:end)) - allocate(a2l%forc_snow(beg:end)) - allocate(a2l%forc_ndep(beg:end)) - allocate(a2l%forc_pc13o2(beg:end)) - allocate(a2l%forc_po2(beg:end)) - allocate(a2l%forc_flood(beg:end)) - allocate(a2l%volr(beg:end)) - allocate(a2l%volrmch(beg:end)) - allocate(a2l%forc_aer(beg:end,14)) - - ! ival = nan ! causes core dump in map_maparray, tcx fix - ival = 0.0_r8 - - a2l%forc_t(beg:end) = ival - a2l%forc_u(beg:end) = ival - a2l%forc_v(beg:end) = ival - a2l%forc_wind(beg:end) = ival - a2l%forc_q(beg:end) = ival - a2l%forc_rh(beg:end) = ival - a2l%forc_hgt(beg:end) = ival - a2l%forc_hgt_u(beg:end) = ival - a2l%forc_hgt_t(beg:end) = ival - a2l%forc_hgt_q(beg:end) = ival - a2l%forc_pbot(beg:end) = ival - a2l%forc_th(beg:end) = ival - a2l%forc_vp(beg:end) = ival - a2l%forc_rho(beg:end) = ival - a2l%forc_psrf(beg:end) = ival - a2l%forc_pco2(beg:end) = ival - a2l%forc_lwrad(beg:end) = ival - a2l%forc_solad(beg:end,1:numrad) = ival - a2l%forc_solai(beg:end,1:numrad) = ival - a2l%forc_solar(beg:end) = ival - a2l%forc_rain(beg:end) = ival - a2l%forc_snow(beg:end) = ival - a2l%forc_ndep(beg:end) = ival - a2l%forc_pc13o2(beg:end) = ival - a2l%forc_po2(beg:end) = ival - a2l%forc_flood(beg:end) = ival - a2l%volr(beg:end) = ival - a2l%volrmch(beg:end) = ival - a2l%forc_aer(beg:end,:) = ival - - ! The following alias is needed just so that lnd_import_export can remain consistent - ! between the clm4_0 code and clm4_5 code. - a2l_not_downscaled_gcell => clm_a2l - -end subroutine init_atm2lnd_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_lnd2atm_type -! -! !INTERFACE: - subroutine init_lnd2atm_type(beg, end, l2a) -! -! !DESCRIPTION: -! Initialize land variables required by the atmosphere -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (lnd2atm_type), intent(inout):: l2a -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! Modified by T Craig, 11/01/05 for finemesh project -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: ival ! initial value -!------------------------------------------------------------------------ - - allocate(l2a%t_rad(beg:end)) - allocate(l2a%t_ref2m(beg:end)) - allocate(l2a%q_ref2m(beg:end)) - allocate(l2a%u_ref10m(beg:end)) - allocate(l2a%h2osno(beg:end)) - allocate(l2a%albd(beg:end,1:numrad)) - allocate(l2a%albi(beg:end,1:numrad)) - allocate(l2a%taux(beg:end)) - allocate(l2a%tauy(beg:end)) - allocate(l2a%eflx_lwrad_out(beg:end)) - allocate(l2a%eflx_sh_tot(beg:end)) - allocate(l2a%eflx_lh_tot(beg:end)) - allocate(l2a%qflx_evap_tot(beg:end)) - allocate(l2a%fsa(beg:end)) - allocate(l2a%nee(beg:end)) - allocate(l2a%ram1(beg:end)) - allocate(l2a%fv(beg:end)) - allocate(l2a%h2osoi_vol(beg:end,1:nlevgrnd)) - allocate(l2a%rofliq(beg:end)) - allocate(l2a%rofice(beg:end)) - allocate(l2a%flxdst(beg:end,1:ndst)) - if (shr_megan_mechcomps_n>0) then - allocate(l2a%flxvoc(beg:end,1:shr_megan_mechcomps_n)) - endif - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - allocate(l2a%ddvel(beg:end,1:n_drydep)) - end if - - ! ival = nan ! causes core dump in map_maparray, tcx fix - ival = 0.0_r8 - - l2a%t_rad(beg:end) = ival - l2a%t_ref2m(beg:end) = ival - l2a%q_ref2m(beg:end) = ival - l2a%u_ref10m(beg:end) = ival - l2a%h2osno(beg:end) = ival - l2a%albd(beg:end,1:numrad) = ival - l2a%albi(beg:end,1:numrad) = ival - l2a%taux(beg:end) = ival - l2a%tauy(beg:end) = ival - l2a%eflx_lwrad_out(beg:end) = ival - l2a%eflx_sh_tot(beg:end) = ival - l2a%eflx_lh_tot(beg:end) = ival - l2a%qflx_evap_tot(beg:end) = ival - l2a%fsa(beg:end) = ival - l2a%nee(beg:end) = ival - l2a%ram1(beg:end) = ival - l2a%fv(beg:end) = ival - l2a%h2osoi_vol(beg:end,1:nlevgrnd) = ival - l2a%rofliq(beg:end) = ival - l2a%rofice(beg:end) = ival - l2a%flxdst(beg:end,1:ndst) = ival - if (shr_megan_mechcomps_n>0) then - l2a%flxvoc(beg:end,1:shr_megan_mechcomps_n) = ival - endif - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - l2a%ddvel(beg:end, : ) = ival - end if - -end subroutine init_lnd2atm_type - -!------------------------------------------------------------------------ -! -! !IROUTINE: clm_map2gcell_minimal -! -! !INTERFACE: subroutine clm_map2gcell_minimal(init) -subroutine clm_map2gcell_minimal() -! -! !DESCRIPTION: -! Compute l2a component of gridcell derived type. This routine computes the -! bare minimum of components necessary to get the first step of a run -! started. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use subgridAveMod - use clm_varcon , only : sb - use clm_varpar , only : numrad -! -! !REVISION HISTORY: -! Sean Santos: Extracted from clm_map2gcell 2013/08/27 -! -! -! !LOCAL VARIABLES: - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - - integer :: g ! indices - real(r8), parameter :: amC = 12.0_r8 ! Atomic mass number for Carbon - real(r8), parameter :: amO = 16.0_r8 ! Atomic mass number for Oxygen - real(r8), parameter :: amCO2 = amC + 2.0_r8*amO ! Atomic mass number for CO2 - ! The following converts g of C to kg of CO2 - real(r8), parameter :: convertgC2kgCO2 = 1.0e-3_r8 * (amCO2/amC) - -!------------------------------------------------------------------------ - - ! Determine processor bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Compute gridcell averages. - - call c2g(begc, endc, begl, endl, begg, endg, & - cws%h2osno, clm_l2a%h2osno, & - c2l_scale_type= 'urbanf', l2g_scale_type='unity') - do g = begg,endg - clm_l2a%h2osno(g) = clm_l2a%h2osno(g)/1000._r8 - end do - - call c2g(begc, endc, begl, endl, begg, endg, nlevgrnd, & - cws%h2osoi_vol, clm_l2a%h2osoi_vol, & - c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, numrad, & - pps%albd, clm_l2a%albd,& - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, numrad, & - pps%albi, clm_l2a%albi,& - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pef%eflx_lwrad_out, clm_l2a%eflx_lwrad_out,& - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - do g = begg,endg - clm_l2a%t_rad(g) = sqrt(sqrt(clm_l2a%eflx_lwrad_out(g)/sb)) - end do - -end subroutine clm_map2gcell_minimal - -!------------------------------------------------------------------------ -! -! !IROUTINE: clm_map2gcell -! -! !INTERFACE: subroutine clm_map2gcell() -subroutine clm_map2gcell() -! -! !DESCRIPTION: -! Compute l2a component of gridcell derived type -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use subgridAveMod - use clm_varcon , only : sb - use clm_varpar , only : numrad -! -! !REVISION HISTORY: -! Mariana Vertenstein: created 03/10-25 -! 03-04-27 : Created by Mariana Vertenstein -! 03-08-25 : Updated to vector data structure (Mariana Vertenstein) -! -! -! !LOCAL VARIABLES: - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - - integer :: g ! indices - real(r8), parameter :: amC = 12.0_r8 ! Atomic mass number for Carbon - real(r8), parameter :: amO = 16.0_r8 ! Atomic mass number for Oxygen - real(r8), parameter :: amCO2 = amC + 2.0_r8*amO ! Atomic mass number for CO2 - ! The following converts g of C to kg of CO2 - real(r8), parameter :: convertgC2kgCO2 = 1.0e-3_r8 * (amCO2/amC) - -!------------------------------------------------------------------------ - - ! First, compute the "minimal" set of fields. - call clm_map2gcell_minimal() - - ! Determine processor bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Compute remaining gridcell averages. - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pes%t_ref2m, clm_l2a%t_ref2m, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pes%q_ref2m, clm_l2a%q_ref2m, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pps%u10_clm, clm_l2a%u_ref10m, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pmf%taux, clm_l2a%taux, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pmf%tauy, clm_l2a%tauy, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pef%eflx_lh_tot, clm_l2a%eflx_lh_tot, & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - -!DML note: use new array: gef%eflx_sh_totg -! call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & -! pef%eflx_sh_tot, clm_l2a%eflx_sh_tot, & -! p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - do g = begg,endg - clm_l2a%eflx_sh_tot(g) = gef%eflx_sh_totg(g) - end do - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pwf%qflx_evap_tot, clm_l2a%qflx_evap_tot, & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pef%fsa, clm_l2a%fsa, & - p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') - - if (use_cn) then - call c2g(begc, endc, begl, endl, begg, endg, & - ccf%nee, clm_l2a%nee, & - c2l_scale_type= 'unity', l2g_scale_type='unity') - else - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pcf%fco2, clm_l2a%nee, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - ! Note that fco2 in is umolC/m2/sec so units need to be changed to gC/m2/sec - do g = begg,endg - clm_l2a%nee(g) = clm_l2a%nee(g)*12.011e-6_r8 - end do - end if - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pps%fv, clm_l2a%fv, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, & - pps%ram1, clm_l2a%ram1, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - do g = begg,endg - clm_l2a%rofliq(g) = gwf%qflx_runoffg(g) - clm_l2a%rofice(g) = gwf%qflx_snwcp_iceg(g) - end do - - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, ndst, & - pdf%flx_mss_vrt_dst, clm_l2a%flxdst, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - - if (shr_megan_mechcomps_n>0) then - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, shr_megan_mechcomps_n, & - pvf%vocflx, clm_l2a%flxvoc, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - endif - - if ( n_drydep > 0 .and. drydep_method == DD_XLND ) then - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, n_drydep, & - pdd%drydepvel, clm_l2a%ddvel, & - p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity') - endif - - ! Convert from gC/m2/s to kgCO2/m2/s - do g = begg,endg - clm_l2a%nee(g) = clm_l2a%nee(g)*convertgC2kgCO2 - end do - -end subroutine clm_map2gcell - -!------------------------------------------------------------------------ -!------------------------------------------------------------------------ -end module clm_atmlnd - diff --git a/src_clm40/main/clm_cpl_indices.F90 b/src_clm40/main/clm_cpl_indices.F90 deleted file mode 100644 index b2a17229df..0000000000 --- a/src_clm40/main/clm_cpl_indices.F90 +++ /dev/null @@ -1,311 +0,0 @@ -module clm_cpl_indices - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing the indices for the fields passed between CLM and - ! the driver. Includes the River Transport Model fields (RTM) and the - ! fields needed by the land-ice component (sno). - ! - ! !USES: - - use shr_sys_mod, only : shr_sys_abort - implicit none - - SAVE - private ! By default make data private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_cpl_indices_set ! Set the coupler indices - ! - ! !PUBLIC DATA MEMBERS: - ! - integer , public :: glc_nec ! number of elevation classes for glacier_mec landunits - ! (from coupler) - must equal maxpatch_glcmec from namelist - integer , parameter, private:: glc_nec_max = 100 - - ! lnd -> drv (required) - - integer, public ::index_l2x_Flrl_rofsur ! lnd->rtm input surface liquid fluxes - integer, public ::index_l2x_Flrl_rofgwl ! lnd->rtm input gwl liquid fluxes - integer, public ::index_l2x_Flrl_rofsub ! lnd->rtm input subsurface liquid fluxes - integer, public ::index_l2x_Flrl_rofdto ! lnd->rtm input direct to ocean liquid fluxes - integer, public ::index_l2x_Flrl_rofi ! lnd->rtm input frozen fluxes - - integer, public ::index_l2x_Sl_t ! temperature - integer, public ::index_l2x_Sl_tref ! 2m reference temperature - integer, public ::index_l2x_Sl_qref ! 2m reference specific humidity - integer, public ::index_l2x_Sl_avsdr ! albedo: direct , visible - integer, public ::index_l2x_Sl_anidr ! albedo: direct , near-ir - integer, public ::index_l2x_Sl_avsdf ! albedo: diffuse, visible - integer, public ::index_l2x_Sl_anidf ! albedo: diffuse, near-ir - integer, public ::index_l2x_Sl_snowh ! snow height - integer, public ::index_l2x_Sl_u10 ! 10m wind - integer, public ::index_l2x_Sl_ddvel ! dry deposition velocities (optional) - integer, public ::index_l2x_Sl_fv ! friction velocity - integer, public ::index_l2x_Sl_ram1 ! aerodynamical resistance - integer, public ::index_l2x_Sl_soilw ! volumetric soil water - integer, public ::index_l2x_Fall_taux ! wind stress, zonal - integer, public ::index_l2x_Fall_tauy ! wind stress, meridional - integer, public ::index_l2x_Fall_lat ! latent heat flux - integer, public ::index_l2x_Fall_sen ! sensible heat flux - integer, public ::index_l2x_Fall_lwup ! upward longwave heat flux - integer, public ::index_l2x_Fall_evap ! evaporation water flux - integer, public ::index_l2x_Fall_swnet ! heat flux shortwave net - integer, public ::index_l2x_Fall_fco2_lnd ! co2 flux **For testing set to 0 - integer, public ::index_l2x_Fall_flxdst1 ! dust flux size bin 1 - integer, public ::index_l2x_Fall_flxdst2 ! dust flux size bin 2 - integer, public ::index_l2x_Fall_flxdst3 ! dust flux size bin 3 - integer, public ::index_l2x_Fall_flxdst4 ! dust flux size bin 4 - integer, public ::index_l2x_Fall_flxvoc ! MEGAN fluxes - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, public ::index_l2x_Sl_tsrf(0:glc_nec_max) = 0 ! glc MEC temperature - integer, public ::index_l2x_Sl_topo(0:glc_nec_max) = 0 ! glc MEC topo height - integer, public ::index_l2x_Flgl_qice(0:glc_nec_max) = 0 ! glc MEC ice flux - - integer, public ::index_x2l_Sa_methane - integer, public ::index_l2x_Fall_methane - - integer, public :: nflds_l2x = 0 - - ! drv -> lnd (required) - - integer, public ::index_x2l_Sa_z ! bottom atm level height - integer, public ::index_x2l_Sa_u ! bottom atm level zon wind - integer, public ::index_x2l_Sa_v ! bottom atm level mer wind - integer, public ::index_x2l_Sa_ptem ! bottom atm level pot temp - integer, public ::index_x2l_Sa_shum ! bottom atm level spec hum - integer, public ::index_x2l_Sa_pbot ! bottom atm level pressure - integer, public ::index_x2l_Sa_tbot ! bottom atm level temp - integer, public ::index_x2l_Faxa_lwdn ! downward lw heat flux - integer, public ::index_x2l_Faxa_rainc ! prec: liquid "convective" - integer, public ::index_x2l_Faxa_rainl ! prec: liquid "large scale" - integer, public ::index_x2l_Faxa_snowc ! prec: frozen "convective" - integer, public ::index_x2l_Faxa_snowl ! prec: frozen "large scale" - integer, public ::index_x2l_Faxa_swndr ! sw: nir direct downward - integer, public ::index_x2l_Faxa_swvdr ! sw: vis direct downward - integer, public ::index_x2l_Faxa_swndf ! sw: nir diffuse downward - integer, public ::index_x2l_Faxa_swvdf ! sw: vis diffuse downward - integer, public ::index_x2l_Sa_co2prog ! bottom atm level prognostic co2 - integer, public ::index_x2l_Sa_co2diag ! bottom atm level diagnostic co2 - integer, public ::index_x2l_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition - integer, public ::index_x2l_Faxa_ocphidry ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_ocphodry ! flux: Organic Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_ocphiwet ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_dstwet1 ! flux: Size 1 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet2 ! flux: Size 2 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet3 ! flux: Size 3 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet4 ! flux: Size 4 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstdry1 ! flux: Size 1 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition - - integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof (flood) flux - integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr total volume - integer, public ::index_x2l_Flrr_volrmch ! rtm->lnd rof volr main channel volume - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, public ::index_x2l_Sg_ice_covered(0:glc_nec_max) = 0 ! Fraction of glacier from glc model - integer, public ::index_x2l_Sg_topo(0:glc_nec_max) = 0 ! Topo height from glc model - integer, public ::index_x2l_Flgg_hflx(0:glc_nec_max) = 0 ! Heat flux from glc model - - integer, public ::index_x2l_Sg_icemask - - integer, public :: nflds_x2l = 0 - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_cpl_indices_set( ) - ! - ! !DESCRIPTION: - ! Set the coupler indices needed by the land model coupler - ! interface. - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields, seq_flds_l2x_fields - use mct_mod , only: mct_aVect, mct_aVect_init, mct_avect_indexra - use mct_mod , only: mct_aVect_clean, mct_avect_nRattr - use seq_drydep_mod , only: drydep_fields_token, lnd_drydep - use shr_megan_mod , only: shr_megan_fields_token, shr_megan_mechcomps_n - use clm_varctl , only: use_voc - ! - ! !ARGUMENTS: - implicit none - ! - ! !REVISION HISTORY: - ! Author: Mariana Vertenstein - ! 01/2011, Erik Kluzek: Added protex headers - ! - ! !LOCAL VARIABLES: - type(mct_aVect) :: l2x ! temporary, land to coupler - type(mct_aVect) :: x2l ! temporary, coupler to land - integer :: num - character(len= 2) :: cnum - character(len=64) :: name - character(len=32) :: subname = 'clm_cpl_indices_set' ! subroutine name - !----------------------------------------------------------------------- - - ! Determine attribute vector indices - - ! create temporary attribute vectors - call mct_aVect_init(x2l, rList=seq_flds_x2l_fields, lsize=1) - nflds_x2l = mct_avect_nRattr(x2l) - - call mct_aVect_init(l2x, rList=seq_flds_l2x_fields, lsize=1) - nflds_l2x = mct_avect_nRattr(l2x) - - !------------------------------------------------------------- - ! clm -> drv - !------------------------------------------------------------- - - index_l2x_Flrl_rofsur = mct_avect_indexra(l2x,'Flrl_rofsur') - index_l2x_Flrl_rofgwl = mct_avect_indexra(l2x,'Flrl_rofgwl') - index_l2x_Flrl_rofsub = mct_avect_indexra(l2x,'Flrl_rofsub') - index_l2x_Flrl_rofdto = mct_avect_indexra(l2x,'Flrl_rofdto') - index_l2x_Flrl_rofi = mct_avect_indexra(l2x,'Flrl_rofi') - - index_l2x_Sl_t = mct_avect_indexra(l2x,'Sl_t') - index_l2x_Sl_snowh = mct_avect_indexra(l2x,'Sl_snowh') - index_l2x_Sl_avsdr = mct_avect_indexra(l2x,'Sl_avsdr') - index_l2x_Sl_anidr = mct_avect_indexra(l2x,'Sl_anidr') - index_l2x_Sl_avsdf = mct_avect_indexra(l2x,'Sl_avsdf') - index_l2x_Sl_anidf = mct_avect_indexra(l2x,'Sl_anidf') - index_l2x_Sl_tref = mct_avect_indexra(l2x,'Sl_tref') - index_l2x_Sl_qref = mct_avect_indexra(l2x,'Sl_qref') - index_l2x_Sl_u10 = mct_avect_indexra(l2x,'Sl_u10') - index_l2x_Sl_ram1 = mct_avect_indexra(l2x,'Sl_ram1') - index_l2x_Sl_fv = mct_avect_indexra(l2x,'Sl_fv') - index_l2x_Sl_soilw = mct_avect_indexra(l2x,'Sl_soilw',perrwith='quiet') - if ( lnd_drydep )then - index_l2x_Sl_ddvel = mct_avect_indexra(l2x, trim(drydep_fields_token)) - else - index_l2x_Sl_ddvel = 0 - end if - - index_l2x_Fall_taux = mct_avect_indexra(l2x,'Fall_taux') - index_l2x_Fall_tauy = mct_avect_indexra(l2x,'Fall_tauy') - index_l2x_Fall_lat = mct_avect_indexra(l2x,'Fall_lat') - index_l2x_Fall_sen = mct_avect_indexra(l2x,'Fall_sen') - index_l2x_Fall_lwup = mct_avect_indexra(l2x,'Fall_lwup') - index_l2x_Fall_evap = mct_avect_indexra(l2x,'Fall_evap') - index_l2x_Fall_swnet = mct_avect_indexra(l2x,'Fall_swnet') - index_l2x_Fall_flxdst1 = mct_avect_indexra(l2x,'Fall_flxdst1') - index_l2x_Fall_flxdst2 = mct_avect_indexra(l2x,'Fall_flxdst2') - index_l2x_Fall_flxdst3 = mct_avect_indexra(l2x,'Fall_flxdst3') - index_l2x_Fall_flxdst4 = mct_avect_indexra(l2x,'Fall_flxdst4') - - index_l2x_Fall_fco2_lnd = mct_avect_indexra(l2x,'Fall_fco2_lnd',perrwith='quiet') - - index_l2x_Fall_methane = mct_avect_indexra(l2x,'Fall_methane',perrWith='quiet') - - ! MEGAN fluxes - ! use_voc is a temporary logic to enable turning off MEGAN fluxes when prognostic crop - ! is used - if (shr_megan_mechcomps_n>0 .and. use_voc) then - index_l2x_Fall_flxvoc = mct_avect_indexra(l2x,trim(shr_megan_fields_token)) - else - index_l2x_Fall_flxvoc = 0 - endif - - !------------------------------------------------------------- - ! drv -> clm - !------------------------------------------------------------- - - index_x2l_Sa_z = mct_avect_indexra(x2l,'Sa_z') - index_x2l_Sa_u = mct_avect_indexra(x2l,'Sa_u') - index_x2l_Sa_v = mct_avect_indexra(x2l,'Sa_v') - index_x2l_Sa_ptem = mct_avect_indexra(x2l,'Sa_ptem') - index_x2l_Sa_pbot = mct_avect_indexra(x2l,'Sa_pbot') - index_x2l_Sa_tbot = mct_avect_indexra(x2l,'Sa_tbot') - index_x2l_Sa_shum = mct_avect_indexra(x2l,'Sa_shum') - index_x2l_Sa_co2prog = mct_avect_indexra(x2l,'Sa_co2prog',perrwith='quiet') - index_x2l_Sa_co2diag = mct_avect_indexra(x2l,'Sa_co2diag',perrwith='quiet') - - index_x2l_Sa_methane = mct_avect_indexra(x2l,'Sa_methane',perrWith='quiet') - - index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr') - index_x2l_Flrr_volrmch = mct_avect_indexra(x2l,'Flrr_volrmch') - - index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn') - index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc') - index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl') - index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc') - index_x2l_Faxa_snowl = mct_avect_indexra(x2l,'Faxa_snowl') - index_x2l_Faxa_swndr = mct_avect_indexra(x2l,'Faxa_swndr') - index_x2l_Faxa_swvdr = mct_avect_indexra(x2l,'Faxa_swvdr') - index_x2l_Faxa_swndf = mct_avect_indexra(x2l,'Faxa_swndf') - index_x2l_Faxa_swvdf = mct_avect_indexra(x2l,'Faxa_swvdf') - index_x2l_Faxa_bcphidry = mct_avect_indexra(x2l,'Faxa_bcphidry') - index_x2l_Faxa_bcphodry = mct_avect_indexra(x2l,'Faxa_bcphodry') - index_x2l_Faxa_bcphiwet = mct_avect_indexra(x2l,'Faxa_bcphiwet') - index_x2l_Faxa_ocphidry = mct_avect_indexra(x2l,'Faxa_ocphidry') - index_x2l_Faxa_ocphodry = mct_avect_indexra(x2l,'Faxa_ocphodry') - index_x2l_Faxa_ocphiwet = mct_avect_indexra(x2l,'Faxa_ocphiwet') - index_x2l_Faxa_dstdry1 = mct_avect_indexra(x2l,'Faxa_dstdry1') - index_x2l_Faxa_dstdry2 = mct_avect_indexra(x2l,'Faxa_dstdry2') - index_x2l_Faxa_dstdry3 = mct_avect_indexra(x2l,'Faxa_dstdry3') - index_x2l_Faxa_dstdry4 = mct_avect_indexra(x2l,'Faxa_dstdry4') - index_x2l_Faxa_dstwet1 = mct_avect_indexra(x2l,'Faxa_dstwet1') - index_x2l_Faxa_dstwet2 = mct_avect_indexra(x2l,'Faxa_dstwet2') - index_x2l_Faxa_dstwet3 = mct_avect_indexra(x2l,'Faxa_dstwet3') - index_x2l_Faxa_dstwet4 = mct_avect_indexra(x2l,'Faxa_dstwet4') - - index_x2l_Flrr_flood = mct_avect_indexra(x2l,'Flrr_flood') - - !------------------------------------------------------------- - ! glc coupling - !------------------------------------------------------------- - - glc_nec = 0 - - do num = 0,glc_nec_max - - write(cnum,'(i2.2)') num - name = 'Sg_ice_covered' // cnum - index_x2l_Sg_ice_covered(num) = mct_avect_indexra(x2l,trim(name),perrwith='quiet') - name = 'Sg_topo' // cnum - index_x2l_Sg_topo(num) = mct_avect_indexra(x2l,trim(name),perrwith='quiet') - name = 'Flgg_hflx' // cnum - index_x2l_Flgg_hflx(num) = mct_avect_indexra(x2l,trim(name),perrwith='quiet') - if ( index_x2l_Sg_ice_covered(num) == 0 .and. & - index_x2l_Sg_topo(num) == 0 .and. & - index_x2l_Flgg_hflx(num) == 0 ) then - exit - end if - glc_nec = num - end do - - index_x2l_Sg_icemask = mct_avect_indexra(x2l,'Sg_icemask',perrwith='quiet') - - if (glc_nec == glc_nec_max) then - call shr_sys_abort (subname // 'error: glc_nec_cpl cannot equal glc_nec_max') - end if - - ! If glc_nec > 0, then create coupling fields for all glc elevation classes - ! (1:glc_nec) plus bare land (index 0). Note that, if glc_nec = 0, then we don't - ! even need the bare land (0) index. - if (glc_nec > 0) then - do num = 0,glc_nec - write(cnum,'(i2.2)') num - name = 'Sl_tsrf' // cnum - index_l2x_Sl_tsrf(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Sl_topo' // cnum - index_l2x_Sl_topo(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Flgl_qice' // cnum - index_l2x_Flgl_qice(num) = mct_avect_indexra(l2x,trim(name)) - end do - end if - - call mct_aVect_clean(x2l) - call mct_aVect_clean(l2x) - - end subroutine clm_cpl_indices_set - -!======================================================================= - -end module clm_cpl_indices diff --git a/src_clm40/main/clm_driver.F90 b/src_clm40/main/clm_driver.F90 deleted file mode 100644 index c7a5b28507..0000000000 --- a/src_clm40/main/clm_driver.F90 +++ /dev/null @@ -1,903 +0,0 @@ -module clm_driver - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_driver -! -! !DESCRIPTION: -! This module provides the main CLM driver physics calling sequence. Most -! computations occurs over ``clumps'' of gridcells (and associated subgrid -! scale entities) assigned to each MPI process. Computation is further -! parallelized by looping over clumps on each process using shared memory OpenMP. -! -! The main CLM driver physics calling sequence for clm_driver1 is as follows: -! \begin{verbatim} -! -! + interpMonthlyVeg interpolate monthly vegetation data [! CN or ! CNDV] -! + readMonthlyVegetation read vegetation data for two months [! CN or ! CNDV] -! -! ==== Begin Loop over clumps ==== -! -> dynland_hwcontent Get initial heat, water content -! + pftdyn_interp [pftdyn] -! + dynland_hwcontent Get new heat, water content [pftdyn] -! ==== End Loop over clumps ==== -! -! ==== Begin Loop over clumps ==== -! -> clm_driverInit save of variables from previous time step -! -> Hydrology1 canopy interception and precip on ground -! -> FracWet fraction of wet vegetated surface and dry elai -! -> SurfaceRadiation surface solar radiation -! -> UrbanRadiation surface solar and longwave radiation for Urban landunits -! -> Biogeophysics1 leaf temperature and surface fluxes -! -> BareGroundFluxes surface fluxes for bare soil or snow-covered -! vegetation patches -! -> UrbanFluxes surface fluxes for urban landunits -! -> MoninObukIni first-guess Monin-Obukhov length and wind speed -! -> FrictionVelocity friction velocity and potential temperature and -! humidity profiles -! -> CanopyFluxes leaf temperature and surface fluxes for vegetated -! patches -! -> QSat saturated vapor pressure, specific humidity, & -! derivatives at leaf surface -! -> MoninObukIni first-guess Monin-Obukhov length and wind speed -! -> FrictionVelocity friction velocity and potential temperature and -! humidity profiles -! -> Stomata stomatal resistance and photosynthesis for -! sunlit leaves -! -> Stomata stomatal resistance and photosynthesis for -! shaded leaves -! -> QSat recalculation of saturated vapor pressure, -! specific humidity, & derivatives at leaf surface -! + DustEmission Dust mobilization -! + DustDryDep Dust dry deposition -! -> Biogeophysics_Lake lake temperature and surface fluxes -! + VOCEmission compute VOC emission [VOC] -! -> Biogeophysics2 soil/snow & ground temp and update surface fluxes -! -> pft2col Average from PFT level to column level -! -> Hydrology2 surface and soil hydrology -! -> Hydrology_Lake lake hydrology -! -> SnowAge_grain update snow effective grain size for snow radiative transfer -! + CNEcosystemDyn Carbon Nitrogen model ecosystem dynamics: [CN] -! vegetation phenology and soil carbon -! + EcosystemDyn "static" ecosystem dynamics: [! CN ] -! vegetation phenology and soil carbon -! -> BalanceCheck check for errors in energy and water balances -! -> SurfaceAlbedo albedos for next time step -! -> UrbanAlbedo Urban landunit albedos for next time step -! ==== End Loop over clumps ==== -! -! Second phase of the clm main driver, for handling history and restart file output. -! -! -> write_diagnostic output diagnostic if appropriate -! -> updateAccFlds update accumulated fields -! -> hist_update_hbuf accumulate history fields for time interval -! -> htapes_wrapup write history tapes if appropriate -! -> restFile_write write restart file if appropriate -! \end{verbatim} -! -! Optional subroutines are denoted by an plus (+) with the associated -! CPP token or variable in brackets at the end of the line. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use clm_varctl , only : wrtdia, flanduse_timeseries, iulog, create_glacier_mec_landunit, & - use_cn, use_cndv, use_exit_spinup - use spmdMod , only : masterproc,mpicom - use decompMod , only : get_proc_clumps, get_clump_bounds, get_proc_bounds - use filterMod , only : filter, setFilters - use CNDVMod , only : dv, histCNDV - use pftdynMod , only : pftwt_interp - use pftdynMod , only : pftdyn_interp, pftdyn_wbal_init, pftdyn_wbal - use pftdynMod , only : pftdyn_cnbal - use dynlandMod , only : dynland_hwcontent - use clm_varcon , only : zlnd, isturb - use clm_time_manager , only : get_step_size,get_curr_date,get_ref_date,get_nstep - use CropRestMod , only : CropRestIncYear - use histFileMod , only : hist_update_hbuf, hist_htapes_wrapup - use restFileMod , only : restFile_write, restFile_filename - use accFldsMod , only : updateAccFlds - use clm_driverInitMod , only : clm_driverInit - use BalanceCheckMod , only : BeginWaterBalance, BalanceCheck - use SurfaceRadiationMod , only : SurfaceRadiation - use Hydrology1Mod , only : Hydrology1 - use Hydrology2Mod , only : Hydrology2 - use HydrologyLakeMod , only : HydrologyLake - use Biogeophysics1Mod , only : Biogeophysics1 - use BareGroundFluxesMod , only : BareGroundFluxes - use CanopyFluxesMod , only : CanopyFluxes - use Biogeophysics2Mod , only : Biogeophysics2 - use BiogeophysicsLakeMod, only : BiogeophysicsLake - use SurfaceAlbedoMod , only : SurfaceAlbedo - use pft2colMod , only : pft2col - use CNSetValueMod , only : CNZeroFluxes_dwt - use CNEcosystemDynMod , only : CNEcosystemDyn - use CNAnnualUpdateMod , only : CNAnnualUpdate - use CNBalanceCheckMod , only : BeginCBalance, BeginNBalance, & - CBalanceCheck, NBalanceCheck - use ndepStreamMod , only : ndep_interp - use STATICEcosysDynMod , only : EcosystemDyn - use DUSTMod , only : DustDryDep, DustEmission - use VOCEmissionMod , only : VOCEmission - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - use STATICEcosysDynMod , only : interpMonthlyVeg - use DryDepVelocity , only : depvel_compute - use abortutils , only : endrun - use UrbanMod , only : UrbanAlbedo, UrbanRadiation, UrbanFluxes - use SNICARMod , only : SnowAge_grain - use clm_atmlnd , only : clm_map2gcell - use clm_glclnd , only : update_clm_s2x - use perf_mod -! -! !PUBLIC TYPES: - implicit none -! -! !PUBLIC MEMBER FUNCTIONS: - public :: clm_drv ! clm physics,history, restart writes -! -! !PRIVATE MEMBER FUNCTIONS: - private :: write_diagnostic ! Write diagnostic information to log file -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: clm_drv -! -! !INTERFACE: -subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate) -! -! !DESCRIPTION: -! -! First phase of the clm driver calling the clm physics. An outline of -! the calling tree is given in the description of this module. -! -! !USES: - -! !ARGUMENTS: - implicit none - logical, intent(in) :: doalb ! true if time for surface albedo calc - real(r8), intent(in) :: nextsw_cday ! calendar day for nstep+1 - real(r8), intent(in) :: declinp1 ! declination angle for next time step - real(r8), intent(in) :: declin ! declination angle for current time step - logical, intent(in) :: rstwr ! true => write restart file this step - logical, intent(in) :: nlend ! true => end of run on this step - character(len=*),intent(in) :: rdate ! restart file time stamp for name -! -! !REVISION HISTORY: -! 2002.10.01 Mariana Vertenstein latest update to new data structures -! 11/26/03, Peter Thornton: Added new call for SurfaceRadiationSunShade when -! cpp directive SUNSHA is set, for sunlit/shaded canopy radiation. -! 4/25/05, Peter Thornton: Made the sun/shade routine the default, no longer -! need to have SUNSHA defined. -! Oct/05 & Jul/07 Sam Levis: Starting dates of CNDV and crop model work -! 2/29/08, Dave Lawrence: Revised snow cover fraction according to Niu and Yang, 2007 -! 3/6/09, Peter Thornton: Added declin as new argument, for daylength control on Vcmax -! 2008.11.12 B. Kauffman: morph routine casa() in casa_ecosytemDyn(), so casa -! is more similar to CN & DGVM -! 2/25/2012 M. Vertenstein: Removed CASA references -! -!EOP -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: clandunit(:) ! landunit index associated with each column - integer , pointer :: itypelun(:) ! landunit type -! -! !OTHER LOCAL VARIABLES: - integer :: nstep ! time step number - real(r8) :: dtime ! land model time step (sec) - real(r8) :: t1, t2, t3 ! temporary for mass balance checks - integer :: nc, fc, c, fp, p, l, g ! indices - integer :: nclumps ! number of clumps on this processor - integer :: begg, endg ! clump beginning and ending gridcell indices - integer :: begl, endl ! clump beginning and ending landunit indices - integer :: begc, endc ! clump beginning and ending column indices - integer :: begp, endp ! clump beginning and ending pft indices - integer :: begg_proc, endg_proc ! proc beginning and ending gridcell indices - integer :: begl_proc, endl_proc ! proc beginning and ending landunit indices - integer :: begc_proc, endc_proc ! proc beginning and ending column indices - integer :: begp_proc, endp_proc ! proc beginning and ending pft indices - type(column_type), pointer :: cptr ! pointer to column derived subtype - integer :: yrp1 ! year (0, ...) for nstep+1 - integer :: monp1 ! month (1, ..., 12) for nstep+1 - integer :: dayp1 ! day of month (1, ..., 31) for nstep+1 - integer :: secp1 ! seconds into current date for nstep+1 - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - integer :: ncdate ! current date - integer :: nbdate ! base date (reference date) - integer :: kyr ! thousand years, equals 2 at end of first year - character(len=256) :: filer ! restart file name - integer :: ier ! error code -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (landunit-level) - - itypelun => lun%itype - - ! Assign local pointers to derived subtypes components (column-level) - - clandunit => col%landunit - - ! Set pointers into derived type - - cptr => col - - ! Update time-related info - - call CropRestIncYear() - - - if (use_cn) then - ! For dry-deposition need to call CLMSP so that mlaidiff is obtained - if ( n_drydep > 0 .and. drydep_method == DD_XLND ) then - call t_startf('interpMonthlyVeg') - call interpMonthlyVeg() - call t_stopf('interpMonthlyVeg') - endif - else - ! Determine weights for time interpolation of monthly vegetation data. - ! This also determines whether it is time to read new monthly vegetation and - ! obtain updated leaf area index [mlai1,mlai2], stem area index [msai1,msai2], - ! vegetation top [mhvt1,mhvt2] and vegetation bottom [mhvb1,mhvb2]. The - ! weights obtained here are used in subroutine ecosystemdyn to obtain time - ! interpolated values. - if (doalb .or. ( n_drydep > 0 .and. drydep_method == DD_XLND )) then - call t_startf('interpMonthlyVeg') - call interpMonthlyVeg() - call t_stopf('interpMonthlyVeg') - end if - end if - - ! ============================================================================ - ! Loop over clumps - ! ============================================================================ - - nclumps = get_proc_clumps() - - !$OMP PARALLEL DO PRIVATE (nc,g,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - - ! ============================================================================ - ! Determine clump boundaries - ! ============================================================================ - - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - ! ============================================================================ - ! change pft weights and compute associated heat & water fluxes - ! ============================================================================ - - ! initialize heat and water content and dynamic balance fields to zero - do g = begg,endg - gwf%qflx_liq_dynbal(g) = 0._r8 - gws%gc_liq2(g) = 0._r8 - gws%gc_liq1(g) = 0._r8 - gwf%qflx_ice_dynbal(g) = 0._r8 - gws%gc_ice2(g) = 0._r8 - gws%gc_ice1(g) = 0._r8 - gef%eflx_dynbal(g) = 0._r8 - ges%gc_heat2(g) = 0._r8 - ges%gc_heat1(g) = 0._r8 - enddo - - !--- get initial heat,water content --- - call dynland_hwcontent( begg, endg, gws%gc_liq1(begg:endg), & - gws%gc_ice1(begg:endg), ges%gc_heat1(begg:endg) ) - end do - !$OMP END PARALLEL DO - - if (.not. use_cndv) then - if (flanduse_timeseries /= ' ') then - call pftdyn_interp ! change the pft weights - - !$OMP PARALLEL DO PRIVATE (nc,g,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - !--- get new heat,water content: (new-old)/dt = flux into lnd model --- - call dynland_hwcontent( begg, endg, gws%gc_liq2(begg:endg), & - gws%gc_ice2(begg:endg), ges%gc_heat2(begg:endg) ) - dtime = get_step_size() - do g = begg,endg - gwf%qflx_liq_dynbal(g) = (gws%gc_liq2 (g) - gws%gc_liq1 (g))/dtime - gwf%qflx_ice_dynbal(g) = (gws%gc_ice2 (g) - gws%gc_ice1 (g))/dtime - gef%eflx_dynbal (g) = (ges%gc_heat2(g) - ges%gc_heat1(g))/dtime - enddo - end do - !$OMP END PARALLEL DO - end if - end if - - !$OMP PARALLEL DO PRIVATE (nc,g,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - ! ============================================================================ - ! Initialize the mass balance checks: water, carbon, and nitrogen - ! ============================================================================ - - call t_startf('begwbal') - call BeginWaterBalance(begc, endc, begp, endp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_hydrologyc, filter(nc)%hydrologyc) - call t_stopf('begwbal') - - if (use_cn) then - call t_startf('begcnbal') - call BeginCBalance(begc, endc, filter(nc)%num_soilc, filter(nc)%soilc) - call BeginNBalance(begc, endc, filter(nc)%num_soilc, filter(nc)%soilc) - call t_stopf('begcnbal') - end if - - end do - !$OMP END PARALLEL DO - - ! ============================================================================ - ! Initialize h2ocan_loss to zero - ! ============================================================================ - - call t_startf('pftdynwts') - - !$OMP PARALLEL DO PRIVATE (nc,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - call pftdyn_wbal_init( begc, endc ) - - if (use_cndv) then - ! NOTE: Currently CNDV and flanduse_timeseries /= ' ' are incompatible - call CNZeroFluxes_dwt( begc, endc, begp, endp ) - call pftwt_interp( begp, endp ) - call pftdyn_wbal( begg, endg, begc, endc, begp, endp ) - call pftdyn_cnbal( begc, endc, begp, endp ) - call setFilters(nc) - else - ! ============================================================================ - ! Update weights and reset filters if dynamic land use - ! This needs to be done outside the clumps loop, but after BeginWaterBalance() - ! The call to CNZeroFluxes_dwt() is needed regardless of flanduse_timeseries - ! ============================================================================ - if (use_cn) then - call CNZeroFluxes_dwt( begc, endc, begp, endp ) - end if - if (flanduse_timeseries /= ' ') then - if (use_cn) then - call pftdyn_cnbal( begc, endc, begp, endp ) - end if - call setFilters(nc) - end if - end if - - end do - !$OMP END PARALLEL DO - - - if (use_cn) then - ! ============================================================================ - ! Update dynamic N deposition field, on albedo timestep - ! currently being done outside clumps loop, but no reason why it couldn't be - ! re-written to go inside. - ! ============================================================================ - ! PET: switching CN timestep - call ndep_interp() - end if - call t_stopf('pftdynwts') - - !$OMP PARALLEL DO PRIVATE (nc,l,c,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - - ! ============================================================================ - ! Determine clump boundaries - ! ============================================================================ - - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - ! ============================================================================ - ! Initialize variables from previous time step and - ! Determine canopy interception and precipitation onto ground surface. - ! Determine the fraction of foliage covered by water and the fraction - ! of foliage that is dry and transpiring. Initialize snow layer if the - ! snow accumulation exceeds 10 mm. - ! ============================================================================ - - ! initialize intracellular CO2 (Pa) parameters each timestep for use in VOCEmission - pps%cisun(begp:endp) = -999._r8 - pps%cisha(begp:endp) = -999._r8 - - ! initialize declination for current timestep - do c = begc,endc - cps%decl(c) = declin - end do - - call t_startf('drvinit') - call clm_driverInit(begc, endc, begp, endp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, filter(nc)%num_lakec, filter(nc)%lakec) - call t_stopf('drvinit') - - ! ============================================================================ - ! Hydrology1 - ! ============================================================================ - - call t_startf('hydro1') - call Hydrology1(begc, endc, begp, endp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep) - call t_stopf('hydro1') - - ! ============================================================================ - ! Surface Radiation - ! ============================================================================ - - call t_startf('surfrad') - - ! Surface Radiation for non-urban columns - - call SurfaceRadiation(begp, endp, & - filter(nc)%num_nourbanp, filter(nc)%nourbanp) - - ! Surface Radiation for urban columns - - call UrbanRadiation(nc, begl, endl, begc, endc, begp, endp, & - filter(nc)%num_nourbanl, filter(nc)%nourbanl, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp) - - call t_stopf('surfrad') - - ! ============================================================================ - ! Determine leaf temperature and surface fluxes based on ground - ! temperature from previous time step. - ! ============================================================================ - - call t_startf('bgp1') - call Biogeophysics1(begg, endg, begc, endc, begp, endp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep) - call t_stopf('bgp1') - - ! ============================================================================ - ! Determine bare soil or snow-covered vegetation surface temperature and fluxes - ! Calculate Ground fluxes (frac_veg_nosno is either 1 or 0) - ! ============================================================================ - - call t_startf('bgflux') - - ! BareGroundFluxes for all pfts except lakes and urban landunits - - call BareGroundFluxes(begp, endp, & - filter(nc)%num_nolakeurbanp, filter(nc)%nolakeurbanp) - call t_stopf('bgflux') - - ! Fluxes for all Urban landunits - - call t_startf('uflux') - call UrbanFluxes(nc, begp, endp, begl, endl, begc, endc, & - filter(nc)%num_nourbanl, filter(nc)%nourbanl, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp) - call t_stopf('uflux') - - ! ============================================================================ - ! Determine non snow-covered vegetation surface temperature and fluxes - ! Calculate canopy temperature, latent and sensible fluxes from the canopy, - ! and leaf water change by evapotranspiration - ! ============================================================================ - - call t_startf('canflux') - call CanopyFluxes(begg, endg, begc, endc, begp, endp, & - filter(nc)%num_nolakep, filter(nc)%nolakep) - call t_stopf('canflux') - - ! ============================================================================ - ! Determine lake temperature and surface fluxes - ! ============================================================================ - - call t_startf('bgplake') - call BiogeophysicsLake(begc, endc, begp, endp, & - filter(nc)%num_lakec, filter(nc)%lakec, & - filter(nc)%num_lakep, filter(nc)%lakep) - call t_stopf('bgplake') - - ! ============================================================================ - ! DUST and VOC emissions - ! ============================================================================ - - call t_startf('bgc') - - ! Dust mobilization (C. Zender's modified codes) - call DustEmission(begp, endp, begc, endc, begl, endl, & - filter(nc)%num_nolakep, filter(nc)%nolakep) - - ! Dust dry deposition (C. Zender's modified codes) - call DustDryDep(begp, endp) - - ! VOC emission (A. Guenther's MEGAN (2006) model) - call VOCEmission(begp, endp, & - filter(nc)%num_soilp, filter(nc)%soilp) - - call t_stopf('bgc') - - ! ============================================================================ - ! Determine soil/snow temperatures including ground temperature and - ! update surface fluxes for new ground temperature. - ! ============================================================================ - - call t_startf('bgp2') - call Biogeophysics2(begl, endl, begc, endc, begp, endp, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_nolakep, filter(nc)%nolakep) - call t_stopf('bgp2') - - ! ============================================================================ - ! Perform averaging from PFT level to column level - ! ============================================================================ - - call t_startf('pft2col') - call pft2col(begc, endc, filter(nc)%num_nolakec, filter(nc)%nolakec) - call t_stopf('pft2col') - - ! ============================================================================ - ! Vertical (column) soil and surface hydrology - ! ============================================================================ - - call t_startf('hydro2') - call Hydrology2(begc, endc, begp, endp, & - filter(nc)%num_nolakec, filter(nc)%nolakec, & - filter(nc)%num_hydrologyc, filter(nc)%hydrologyc, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_snowc, filter(nc)%snowc, & - filter(nc)%num_nosnowc, filter(nc)%nosnowc) - call t_stopf('hydro2') - - ! ============================================================================ - ! Lake hydrology - ! ============================================================================ - - call t_startf('hylake') - call HydrologyLake(begp, endp, & - filter(nc)%num_lakep, filter(nc)%lakep) - call t_stopf('hylake') - - ! ============================================================================ - ! ! Fraction of soil covered by snow (Z.-L. Yang U. Texas) - ! ============================================================================ - - do c = begc,endc - l = clandunit(c) - if (itypelun(l) == isturb) then - ! Urban landunit use Bonan 1996 (LSM Technical Note) - cps%frac_sno(c) = min( cps%snowdp(c)/0.05_r8, 1._r8) - else - ! snow cover fraction in Niu et al. 2007 - cps%frac_sno(c) = 0.0_r8 - if(cps%snowdp(c) .gt. 0.0_r8) then - cps%frac_sno(c) = tanh(cps%snowdp(c)/(2.5_r8*zlnd* & - (min(800._r8,cws%h2osno(c)/cps%snowdp(c))/100._r8)**1._r8) ) - endif - end if - end do - - ! ============================================================================ - ! Snow aging routine based on Flanner and Zender (2006), Linking snowpack - ! microphysics and albedo evolution, JGR, and Brun (1989), Investigation of - ! wet-snow metamorphism in respect of liquid-water content, Ann. Glaciol. - ! ============================================================================ - call SnowAge_grain(begc, endc, & - filter(nc)%num_snowc, filter(nc)%snowc, & - filter(nc)%num_nosnowc, filter(nc)%nosnowc) - - ! ============================================================================ - ! Ecosystem dynamics: Uses CN, CNDV, or static parameterizations - ! ============================================================================ - call t_startf('ecosysdyn') - - if (use_cn) then - ! fully prognostic canopy structure and C-N biogeochemistry - ! - CNDV defined: prognostic biogeography; else prescribed - ! - crop model: crop algorithms called from within CNEcosystemDyn - call CNEcosystemDyn(begc,endc,begp,endp,filter(nc)%num_soilc,& - filter(nc)%soilc, filter(nc)%num_soilp, & - filter(nc)%soilp, filter(nc)%num_pcropp, & - filter(nc)%pcropp, doalb) - call CNAnnualUpdate(begc,endc,begp,endp,filter(nc)%num_soilc,& - filter(nc)%soilc, filter(nc)%num_soilp, & - filter(nc)%soilp) - else - ! Prescribed biogeography, - ! prescribed canopy structure, some prognostic carbon fluxes - call EcosystemDyn(begp, endp, & - filter(nc)%num_nolakep, filter(nc)%nolakep, & - doalb) - end if - call t_stopf('ecosysdyn') - - ! Dry Deposition of chemical tracers (Wesely (1998) parameterizaion) - call depvel_compute(begp,endp) - - ! ============================================================================ - ! Check the energy and water balance, also carbon and nitrogen balance - ! ============================================================================ - - call t_startf('balchk') - call BalanceCheck(begp, endp, begc, endc, begl, endl, begg, endg) - call t_stopf('balchk') - - if (use_exit_spinup) then - ! skip calls to C and N balance checking during EXIT_SPINUP - ! because the system is (intentionally) not conserving mass - ! on the first EXIT_SPINUP doalb timestep - else - if (use_cn) then - nstep = get_nstep() - if (nstep > 2) then - call t_startf('cnbalchk') - call CBalanceCheck(begc, endc, filter(nc)%num_soilc, filter(nc)%soilc) - call NBalanceCheck(begc, endc, filter(nc)%num_soilc, filter(nc)%soilc) - call t_stopf('cnbalchk') - end if - end if - end if - - ! ============================================================================ - ! Determine albedos for next time step - ! ============================================================================ - - if (doalb) then - call t_startf('surfalb') - - ! Albedos for non-urban columns - - call SurfaceAlbedo(begg, endg, begc, endc, begp, endp, & - filter(nc)%num_nourbanc, filter(nc)%nourbanc, & - filter(nc)%num_nourbanp, filter(nc)%nourbanp, & - nextsw_cday, declinp1) - - call t_stopf('surfalb') - - ! Albedos for urban columns - - call t_startf('urbsurfalb') - - if (filter(nc)%num_urbanl > 0) then - call UrbanAlbedo(nc, begl, endl, begc, endc, begp, endp, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp) - end if - - call t_stopf('urbsurfalb') - - end if - - end do - !$OMP END PARALLEL DO - - ! ============================================================================ - ! Determine gridcell averaged properties to send to atm (l2as and l2af derived types) - ! ============================================================================ - - call t_startf('clm_map2gcell') - call clm_map2gcell( ) - call t_stopf('clm_map2gcell') - - ! ============================================================================ - ! Determine fields to send to glc - ! ============================================================================ - - if (create_glacier_mec_landunit) then - call t_startf('create_s2x') - call update_clm_s2x(init=.false.) - call t_stopf('create_s2x') - end if - - ! ============================================================================ - ! Write global average diagnostics to standard output - ! ============================================================================ - - nstep = get_nstep() - if (wrtdia) call mpi_barrier(mpicom,ier) - call t_startf('wrtdiag') - call write_diagnostic(wrtdia, nstep) - call t_stopf('wrtdiag') - - ! ============================================================================ - ! Update accumulators - ! ============================================================================ - - call t_startf('accum') - call updateAccFlds() - call t_stopf('accum') - - ! ============================================================================ - ! Update history buffer - ! ============================================================================ - - call t_startf('hbuf') - call hist_update_hbuf() - call t_stopf('hbuf') - - ! ============================================================================ - ! Call dv (dynamic vegetation) at last time step of year - ! NOTE: monp1, dayp1, and secp1 correspond to nstep+1 - ! ============================================================================ - - if (use_cndv) then - call t_startf('d2dgvm') - dtime = get_step_size() - call get_curr_date(yrp1, monp1, dayp1, secp1, offset=int(dtime)) - if (monp1==1 .and. dayp1==1 .and. secp1==dtime .and. nstep>0) then - - ! Get date info. kyr is used in lpj(). At end of first year, kyr = 2. - call get_curr_date(yr, mon, day, sec) - ncdate = yr*10000 + mon*100 + day - call get_ref_date(yr, mon, day, sec) - nbdate = yr*10000 + mon*100 + day - kyr = ncdate/10000 - nbdate/10000 + 1 - - if (masterproc) write(iulog,*) 'End of year. CNDV called now: ncdate=', & - ncdate,' nbdate=',nbdate,' kyr=',kyr,' nstep=', nstep - - nclumps = get_proc_clumps() - - !$OMP PARALLEL DO PRIVATE (nc,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1,nclumps - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - call dv(begg, endg, begp, endp, & - filter(nc)%num_natvegp, filter(nc)%natvegp, kyr) - end do - !$OMP END PARALLEL DO - end if - call t_stopf('d2dgvm') - end if - - ! ============================================================================ - ! Create history and write history tapes if appropriate - ! ============================================================================ - - call t_startf('clm_drv_io') - - call t_startf('clm_drv_io_htapes') - call hist_htapes_wrapup( rstwr, nlend ) - call t_stopf('clm_drv_io_htapes') - - ! ============================================================================ - ! Write to CNDV history buffer if appropriate - ! ============================================================================ - - if (use_cndv) then - if (monp1==1 .and. dayp1==1 .and. secp1==dtime .and. nstep>0) then - call t_startf('clm_drv_io_hdgvm') - call histCNDV() - if (masterproc) write(iulog,*) 'Annual CNDV calculations are complete' - call t_stopf('clm_drv_io_hdgvm') - end if - end if - - ! ============================================================================ - ! Write restart/initial files if appropriate - ! ============================================================================ - - if (rstwr) then - call t_startf('clm_drv_io_wrest') - filer = restFile_filename(rdate=rdate) - call restFile_write( filer, nlend, rdate=rdate ) - call t_stopf('clm_drv_io_wrest') - end if - - call t_stopf('clm_drv_io') - -end subroutine clm_drv - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: write_diagnostic -! -! !INTERFACE: -subroutine write_diagnostic (wrtdia, nstep) -! -! !DESCRIPTION: -! Write diagnostic surface temperature output each timestep. Written to -! be fast but not bit-for-bit because order of summations can change each -! timestep. -! -! !USES: - use clm_atmlnd , only : clm_l2a - use decompMod , only : get_proc_bounds, get_proc_global - use spmdMod , only : masterproc, npes, MPI_REAL8, MPI_ANY_SOURCE, & - MPI_STATUS_SIZE, mpicom, MPI_SUM - use shr_sys_mod, only : shr_sys_flush - use abortutils , only : endrun -! -! !ARGUMENTS: - implicit none - logical, intent(in) :: wrtdia !true => write diagnostic - integer, intent(in) :: nstep !model time step -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -! -! !LOCAL VARIABLES: - integer :: p ! loop index - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: ier ! error status - real(r8):: psum ! partial sum of ts - real(r8):: tsum ! sum of ts - real(r8):: tsxyav ! average ts for diagnostic output - integer :: status(MPI_STATUS_SIZE) ! mpi status - logical,parameter :: old_sendrecv = .false. ! Flag if should use old send/receive method rather than MPI reduce -!------------------------------------------------------------------------ - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - - if (wrtdia) then - - call t_barrierf('sync_write_diag', mpicom) - psum = sum(clm_l2a%t_rad(begg:endg)) - if (old_sendrecv) then - if (masterproc) then - tsum = psum - do p = 1, npes-1 - call mpi_recv(psum, 1, MPI_REAL8, p, 999, mpicom, status, ier) - if (ier/=0) then - write(iulog,*) 'write_diagnostic: Error in mpi_recv()' - call endrun - end if - tsum = tsum + psum - end do - else - call mpi_send(psum, 1, MPI_REAL8, 0, 999, mpicom, ier) - if (ier/=0) then - write(iulog,*) 'write_diagnostic: Error in mpi_send()' - call endrun - end if - end if - else - call mpi_reduce(psum, tsum, 1, MPI_REAL8, MPI_SUM, 0, mpicom, ier) - if (ier/=0) then - write(iulog,*) 'write_diagnostic: Error in mpi_reduce()' - call endrun - end if - endif - if (masterproc) then - tsxyav = tsum / numg - write(iulog,1000) nstep, tsxyav - call shr_sys_flush(iulog) - end if - - else - - if (masterproc) then - write(iulog,*)'clm2: completed timestep ',nstep - call shr_sys_flush(iulog) - end if - - endif - -1000 format (1x,'nstep = ',i10,' TS = ',f21.15) - -end subroutine write_diagnostic - -end module clm_driver diff --git a/src_clm40/main/clm_glclnd.F90 b/src_clm40/main/clm_glclnd.F90 deleted file mode 100644 index 82231a302b..0000000000 --- a/src_clm40/main/clm_glclnd.F90 +++ /dev/null @@ -1,242 +0,0 @@ -module clm_glclnd - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_glclnd -! -! !DESCRIPTION: -! Handle arrays used for exchanging data between glc and land model. -! Based on clm_atmlnd (but without mapping routines because glc data -! is send and received on the lnd decomposition, at least for now). -! -! The fields sent from the lnd component to the glc component via -! the coupler are labeled 's2x', or sno to coupler. -! The fields received by the lnd component from the glc component -! via the coupler are labeled 'x2s', or coupler to sno. -! 'Sno' is a misnomer in that the exchanged data are related to -! the ice beneath the snow, not the snow itself. But by CESM convention, -! 'ice' refers to sea ice, not land ice. -! -! !USES: - use decompMod , only : get_proc_bounds - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use spmdMod , only : masterproc - use clm_varpar , only : maxpatch_glcmec - use clm_varctl , only : iulog - use abortutils , only : endrun -! -! !REVISION HISTORY: -! Created by William Lipscomb, Dec. 2007, based on clm_atmlnd.F90. -! -! !PUBLIC TYPES: - implicit none - private - save - -!---------------------------------------------------- -! glc -> land variables structure -!---------------------------------------------------- - type, public :: glc2lnd_type - real(r8), pointer :: frac(:,:) => null() - real(r8), pointer :: topo(:,:) => null() - real(r8), pointer :: hflx(:,:) => null() - real(r8), pointer :: icemask(:) => null() - end type glc2lnd_type - -!---------------------------------------------------- -! land -> glc variables structure -!---------------------------------------------------- - type, public :: lnd2glc_type - real(r8), pointer :: tsrf(:,:) => null() - real(r8), pointer :: topo(:,:) => null() - real(r8), pointer :: qice(:,:) => null() - end type lnd2glc_type - - type (lnd2glc_type), public, target :: clm_s2x ! s2x fields on clm grid - type (glc2lnd_type), public, target :: clm_x2s ! x2s fields on clm grid - -! !PUBLIC MEMBER FUNCTIONS: - public :: init_glc2lnd_type - public :: init_lnd2glc_type - public :: update_clm_s2x -! -! !PRIVATE MEMBER FUNCTIONS: - -!EOP -!---------------------------------------------------- - -contains - - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_glc2lnd_type -! -! !INTERFACE: - subroutine init_glc2lnd_type(beg, end, x2s) -! -! !DESCRIPTION: -! Initialize glc variables required by the land -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (glc2lnd_type), intent(inout):: x2s -! -! !REVISION HISTORY: -! Created by William Lipscomb, based on init_atm2lnd_type -!EOP -! -! !LOCAL VARIABLES: - real(r8) :: ival ! initial value -!------------------------------------------------------------------------ - - allocate(x2s%frac(beg:end,0:maxpatch_glcmec)) - allocate(x2s%topo(beg:end,0:maxpatch_glcmec)) - allocate(x2s%hflx(beg:end,0:maxpatch_glcmec)) - allocate(x2s%icemask(beg:end)) - -! ival = nan ! causes core dump in map_maparray, tcx fix - ival = 0.0_r8 - - x2s%frac(beg:end,0:) = ival - x2s%topo(beg:end,0:) = ival - x2s%hflx(beg:end,0:) = ival - x2s%icemask(beg:end)= ival - -end subroutine init_glc2lnd_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_lnd2glc_type -! -! !INTERFACE: - subroutine init_lnd2glc_type(beg, end, s2x) -! -! !DESCRIPTION: -! Initialize land variables required by glc -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (lnd2glc_type), intent(inout):: s2x -! -! !REVISION HISTORY: -! Created by William Lipscomb, based on init_lnd2atm_type -! -!EOP -! -! !LOCAL VARIABLES: - real(r8) :: ival ! initial value -!------------------------------------------------------------------------ - - allocate(s2x%tsrf(beg:end,0:maxpatch_glcmec)) - allocate(s2x%topo(beg:end,0:maxpatch_glcmec)) - allocate(s2x%qice(beg:end,0:maxpatch_glcmec)) - -! ival = nan ! causes core dump in map_maparray, tcx fix - ival = 0.0_r8 - - s2x%tsrf(beg:end,0:) = ival - s2x%topo(beg:end,0:) = ival - s2x%qice(beg:end,0:) = ival - -end subroutine init_lnd2glc_type - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: update_clm_s2x -! -! !INTERFACE: - subroutine update_clm_s2x(init) -! -! !DESCRIPTION: -! Assign values to clm_s2x based on the appropriate derived types -! -! !USES: - use clmtype - use domainMod , only : ldomain - use clm_varcon , only : istice_mec - use clm_atmlnd , only : clm_l2a, clm_a2l - use clm_varcon , only : spval, tfrz -! -! !ARGUMENTS: - implicit none - - logical, intent(in) :: init ! if true=>only set a subset of fields -! -! !REVISION HISTORY: -! Written by William Lipscomb, Feb. 2009 -! - - integer :: begg, endg ! per-proc beginning and ending gridcell indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: c, l, g, n ! indices - integer , pointer :: ityplun(:) ! landunit type - integer , pointer :: clandunit(:) ! column's landunit index - integer , pointer :: cgridcell(:) ! column's gridcell index - - ! Assign local pointers to derived type members - - clandunit => col%landunit - cgridcell => col%gridcell - ityplun => lun%itype - - ! Get processor bounds - call get_proc_bounds(begg, endg, begc=begc, endc=endc) - - ! Initialize qice because otherwise it will remain unset if init=true; - ! note that the value here is the value qice will keep if these - ! conditions hold. Also, need to set a reasonable default for elevation class 0, - ! which is used by the CLM4.5 code, but not by CLM4.0. - - clm_s2x%qice(:,0:) = 0._r8 - - ! and initialize the other variables just to be safe; also need to set a reasonable - ! default for elevation class 0 (for tsrf, note that we initialize other elevation - ! classes to 0, to remain consistent with what was done before, but set elevation - ! class 0 to a reasonable default, because it will remain at its default value). - - clm_s2x%tsrf(:,0) = tfrz - clm_s2x%tsrf(:,1:) = 0._r8 - clm_s2x%topo(:,:) = 0._r8 - - ! Fill the clm_s2x vector on the clm grid - - do c = begc, endc - l = clandunit(c) - g = cgridcell(c) - - ! Following assumes all elevation classes are populated - if (ityplun(l) == istice_mec) then - n = c - lun%coli(l) + 1 ! elevation class index - - ! t_soisno and glc_topo are valid even in initialization, so tsrf and topo - ! are set here regardless of the value of init. But qflx_glcice is not valid - ! until the run loop; thus, in initialization, we will use the default value - ! for qice, as set above. - clm_s2x%tsrf(g,n) = ces%t_soisno(c,1) - clm_s2x%topo(g,n) = cps%glc_topo(c) - if (.not. init) then - clm_s2x%qice(g,n) = cwf%qflx_glcice(c) - - ! Check for bad values of qice - if ( abs(clm_s2x%qice(g,n)) > 1.0_r8 .and. clm_s2x%qice(g,n) /= spval) then - write(iulog,*) 'WARNING: qice out of bounds: g, n, qice =', g, n, clm_s2x%qice(g,n) - endif - end if - - endif ! istice_mec - enddo ! c - -end subroutine update_clm_s2x - -!------------------------------------------------------------------------ - -end module clm_glclnd - diff --git a/src_clm40/main/clm_initializeMod.F90 b/src_clm40/main/clm_initializeMod.F90 deleted file mode 100644 index dc6443bcc1..0000000000 --- a/src_clm40/main/clm_initializeMod.F90 +++ /dev/null @@ -1,684 +0,0 @@ -module clm_initializeMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_initializeMod -! -! !DESCRIPTION: -! Performs land model initialization -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use shr_sys_mod , only : shr_sys_flush - use abortutils , only : endrun - use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch, & - create_glacier_mec_landunit, iulog, & - use_cn, use_cndv - use clm_varsur , only : wtxy, vegxy, topoxy - use perf_mod , only : t_startf, t_stopf - use ncdio_pio , only : file_desc_t - -! !PUBLIC TYPES: - implicit none - save - - private ! By default everything is private - -! !PUBLIC MEMBER FUNCTIONS: - public :: initialize1 ! Phase one initialization - public :: initialize2 ! Phase two initialization -! -! !REVISION HISTORY: -! Created by Gordon Bonan, Sam Levis and Mariana Vertenstein -! -! -! !PRIVATE MEMBER FUNCTIONS: - private header ! echo version numbers - private do_restread ! read a restart file -!----------------------------------------------------------------------- -! !PRIVATE DATA MEMBERS: None - -!EOP -!----------------------------------------------------------------------- -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: initialize1 -! -! !INTERFACE: - subroutine initialize1( ) -! -! !DESCRIPTION: -! Land model initialization. -! o Initializes run control variables via the [clm_inparm] namelist. -! o Reads surface data on model grid. -! o Defines the multiple plant types and fraction areas for each surface type. -! o Builds the appropriate subgrid <-> grid mapping indices and weights. -! o Set up parallel processing. -! o Initializes time constant variables. -! o Reads restart data for a restart or branch run. -! o Reads initial data and initializes the time variant variables for an initial run. -! o Initializes history file output. -! o Initializes river routing model. -! o Initializes accumulation variables. -! -! !USES: - use clmtypeInitMod , only : initClmtype - use clm_varpar , only : maxpatch, clm_varpar_init - use clm_varctl , only : fsurdat, fatmlndfrc, flndtopo, fglcmask, noland - use pftvarcon , only : pftconrd - use decompInitMod , only : decompInit_lnd, decompInit_glcp - use decompMod , only : get_proc_bounds - use domainMod , only : domain_check, ldomain, domain_init - use surfrdMod , only : surfrd_get_globmask, surfrd_get_grid, surfrd_get_topo, & - surfrd_get_data - use controlMod , only : control_init, control_print, nlfilename - use UrbanInputMod , only : UrbanInput - use ncdio_pio , only : ncd_pio_init - use clm_atmlnd , only : init_atm2lnd_type, init_lnd2atm_type, clm_a2l, clm_l2a - use clm_glclnd , only : init_glc2lnd_type, init_lnd2glc_type, clm_x2s, clm_s2x - use initGridCellsMod, only : initGridCells -! -! !ARGUMENTS: -! -! !REVISION HISTORY: -! Created by Gordon Bonan, Sam Levis and Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: ier ! error status - integer :: i,j,n,k ! loop indices - integer :: nl ! gdc and glo lnd indices - integer :: ns, ni, nj ! global grid sizes - logical :: isgrid2d ! true => global grid is regular lat/lon - integer :: begp, endp ! clump beg and ending pft indices - integer :: begc, endc ! clump beg and ending column indices - integer :: begl, endl ! clump beg and ending landunit indices - integer :: begg, endg ! clump beg and ending gridcell indices - integer ,pointer :: amask(:) ! global land mask - character(len=32) :: subname = 'initialize1' ! subroutine name -!----------------------------------------------------------------------- - - call t_startf('clm_init1') - - ! ------------------------------------------------------------------------ - ! Initialize run control variables, timestep - ! ------------------------------------------------------------------------ - - call header() - - if (masterproc) then - write(iulog,*) 'Attempting to initialize the land model .....' - write(iulog,*) - call shr_sys_flush(iulog) - endif - - call control_init() - call clm_varpar_init() - call ncd_pio_init() - - if (masterproc) call control_print() - - ! ------------------------------------------------------------------------ - ! Read in global land grid and land mask (amask)- needed to set decomposition - ! ------------------------------------------------------------------------ - - ! global memory for amask is allocate in surfrd_get_glomask - must be - ! deallocated below - if (masterproc) then - write(iulog,*) 'Attempting to read global land mask from ',trim(fatmlndfrc) - call shr_sys_flush(iulog) - endif - call surfrd_get_globmask(filename=fatmlndfrc, mask=amask, ni=ni, nj=nj) - - ! Exit early if no valid land points - if ( all(amask == 0) )then - if (masterproc) write(iulog,*) trim(subname)//': no valid land points do NOT run clm' - noland = .true. - return - end if - - ! Determine clm decomposition - - call decompInit_lnd(ni, nj, amask) - deallocate(amask) - - ! Get grid and land fraction (set ldomain) - - if (masterproc) then - write(iulog,*) 'Attempting to read ldomain from ',trim(fatmlndfrc) - call shr_sys_flush(iulog) - endif - if (create_glacier_mec_landunit) then - call surfrd_get_grid(ldomain, fatmlndfrc, fglcmask) - else - call surfrd_get_grid(ldomain, fatmlndfrc) - endif - if (masterproc) then - call domain_check(ldomain) - endif - ldomain%mask = 1 !!! TODO - is this needed? - - ! Get topo if appropriate (set ldomain%topo) - - if (flndtopo /= " ") then - if (masterproc) then - write(iulog,*) 'Attempting to read atm topo from ',trim(flndtopo) - call shr_sys_flush(iulog) - endif - call surfrd_get_topo(ldomain, flndtopo) - endif - - ! Initialize urban model input (initialize urbinp data structure) - - call UrbanInput(mode='initialize') - - ! Allocate surface grid dynamic memory (for wtxy and vegxy arrays) - ! Allocate additional dynamic memory for glacier_mec topo and thickness - - call get_proc_bounds(begg, endg) - allocate (vegxy(begg:endg,maxpatch), wtxy(begg:endg,maxpatch), stat=ier) - if (create_glacier_mec_landunit) then - allocate (topoxy(begg:endg,maxpatch), stat=ier) - else - allocate (topoxy(1,1), stat=ier) - endif - if (ier /= 0) then - write(iulog,*)'initialize allocation error'; call endrun() - endif - - ! Read list of PFTs and their corresponding parameter values - ! Independent of model resolution, Needs to stay before surfrd_get_data - - call pftconrd() - - ! Read surface dataset and set up vegetation type [vegxy] and - ! weight [wtxy] arrays for [maxpatch] subgrid patches. - - call surfrd_get_data(ldomain, fsurdat) - - ! Determine decomposition of subgrid scale landunits, columns, pfts - - if (create_glacier_mec_landunit) then - call decompInit_glcp (ns, ni, nj, ldomain%glcmask) - else - call decompInit_glcp (ns, ni, nj) - endif - - ! Allocate memory and initialize values of clmtype data structures - - call initClmtype() - - ! Initialize atm->lnd, lnd->atm, glc->lnd and lnd->glc data structures - - call init_atm2lnd_type(begg, endg, clm_a2l) - call init_lnd2atm_type(begg, endg, clm_l2a) - if (create_glacier_mec_landunit) then - call init_glc2lnd_type(begg, endg, clm_x2s) - call init_lnd2glc_type(begg, endg, clm_s2x) - endif - - ! Build hierarchy and topological info for derived types - - call initGridCells() - - ! Deallocate surface grid dynamic memory (for wtxy and vegxy arrays) - - deallocate (vegxy, wtxy, topoxy) - - call t_stopf('clm_init1') - - end subroutine initialize1 - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: initialize2 -! -! !INTERFACE: - subroutine initialize2( ) -! -! !DESCRIPTION: -! Land model initialization. -! o Initializes run control variables via the [clm_inparm] namelist. -! o Reads surface data on model grid. -! o Defines the multiple plant types and fraction areas for each surface type. -! o Builds the appropriate subgrid <-> grid mapping indices and weights. -! o Set up parallel processing. -! o Initializes time constant variables. -! o Reads restart data for a restart or branch run. -! o Reads initial data and initializes the time variant variables for an initial run. -! o Initializes history file output. -! o Initializes river routing model. -! o Initializes accumulation variables. -! -! !USES: - use clm_atmlnd , only : clm_map2gcell_minimal - use clm_glclnd , only : update_clm_s2x - use clm_varctl , only : finidat, flanduse_timeseries - use decompMod , only : get_proc_clumps, get_proc_bounds - use filterMod , only : allocFilters, setFilters - use histFldsMod , only : hist_initFlds - use histFileMod , only : hist_htapes_build, htapes_fieldlist - use restFileMod , only : restFile_getfile, & - restFile_open, restFile_close, restFile_read - use accFldsMod , only : initAccFlds, initAccClmtype - use mkarbinitMod , only : mkarbinit - use pftdynMod , only : pftdyn_init, pftdyn_interp - use ndepStreamMod , only : ndep_init, ndep_interp - use CNEcosystemDynMod, only : CNEcosystemDynInit - use pftdynMod , only : pftwt_init - use CNDVEcosystemDyniniMod, only : CNDVEcosystemDynini - use STATICEcosysDynMod , only : EcosystemDynini, readAnnualVegetation - use STATICEcosysDynMod , only : interpMonthlyVeg - use DustMod , only : Dustini - use clm_time_manager, only : get_curr_date, get_nstep, advance_timestep, & - timemgr_init, timemgr_restart_io, timemgr_restart - use clm_time_manager, only : get_step_size, get_curr_calday - use fileutils , only : getfil - use UrbanMod , only : UrbanClumpInit - use UrbanInitMod , only : UrbanInitTimeConst, UrbanInitTimeVar, UrbanInitAero - use UrbanInputMod , only : UrbanInput - use seq_drydep_mod , only : n_drydep, drydep_method, DD_XLND - use shr_orb_mod , only : shr_orb_decl - use initSurfAlbMod , only : initSurfAlb, do_initsurfalb - use clm_varorb , only : eccen, mvelpp, lambm0, obliqr - use VOCEmissionMod , only : VOCEmission_init - - -! !Arguments - implicit none -! -! !REVISION HISTORY: -! Created by Gordon Bonan, Sam Levis and Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: nl,na,nag ! indices - integer :: i,j,k ! indices - integer :: yr ! current year (0, ...) - integer :: mon ! current month (1 -> 12) - integer :: day ! current day (1 -> 31) - integer :: ncsec ! current time of day [seconds] - integer :: nc ! clump index - integer :: nclumps ! number of clumps on this processor - integer :: begp, endp ! clump beg and ending pft indices - integer :: begc, endc ! clump beg and ending column indices - integer :: begl, endl ! clump beg and ending landunit indices - integer :: begg, endg ! clump beg and ending gridcell indices - character(len=256) :: fnamer ! name of netcdf restart file - character(len=256) :: pnamer ! full pathname of netcdf restart file - type(file_desc_t) :: ncid ! netcdf id - real(r8) :: dtime ! time step increment (sec) - integer :: nstep ! model time step - real(r8) :: calday ! calendar day for nstep - real(r8) :: caldaym1 ! calendar day for nstep-1 - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinm1 ! solar declination angle in radians for nstep-1 - real(r8) :: eccf ! earth orbit eccentricity factor - character(len=32) :: subname = 'initialize2' ! subroutine name -!---------------------------------------------------------------------- - - call t_startf('clm_init2') - - ! ------------------------------------------------------------------------ - ! Initialize time constant variables - ! ------------------------------------------------------------------------ - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp ) - - ! Initialize Ecosystem Dynamics - - call t_startf('init_ecosys') - if (use_cndv) then - call CNDVEcosystemDynini() - else if (.not. use_cn) then - call EcosystemDynini() - end if - - if (use_cn .or. use_cndv) then - ! -------------------------------------------------------------- - ! Initialize CLMSP ecosystem dynamics when drydeposition is used - ! so that estimates of monthly differences in LAI can be computed - ! -------------------------------------------------------------- - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - call EcosystemDynini() - end if - end if - call t_stopf('init_ecosys') - - ! Initialize dust emissions model - - call t_startf('init_dust') - call Dustini() - call t_stopf('init_dust') - - ! Initialize MEGAN emissions model - - call VOCEmission_init( ) - - ! ------------------------------------------------------------------------ - ! Initialize time constant urban variables - ! ------------------------------------------------------------------------ - - call t_startf('init_io1') - call UrbanInitTimeConst() - call iniTimeConst() - - ! ------------------------------------------------------------------------ - ! Obtain restart file if appropriate - ! ------------------------------------------------------------------------ - - if (do_restread()) then - call restFile_getfile( file=fnamer, path=pnamer ) - end if - - ! ------------------------------------------------------------------------ - ! Initialize master history list. - ! ------------------------------------------------------------------------ - call t_startf('hist_initFlds') - - call hist_initFlds() - ! On restart process the history namelist. Later the namelist from the restart file - ! will be used. But, this allows some basic checking to make sure you didn't - ! try to change the history namelist on restart. - if (nsrest == nsrContinue ) call htapes_fieldlist() - - call t_stopf('hist_initFlds') - ! ------------------------------------------------------------------------ - ! Initialize time manager - ! ------------------------------------------------------------------------ - - if (nsrest == nsrStartup) then - call timemgr_init() - else - call restFile_open( flag='read', file=fnamer, ncid=ncid ) - call timemgr_restart_io( ncid=ncid, flag='read' ) - call restFile_close( ncid=ncid ) - call timemgr_restart() - end if - call t_stopf('init_io1') - - ! ------------------------------------------------------------------------ - ! Initialize CN Ecosystem Dynamics (must be after time-manager initialization) - ! ------------------------------------------------------------------------ - if (use_cn .or. use_cndv) then - call CNEcosystemDynInit( begc, endc, begp, endp ) - end if - - ! ------------------------------------------------------------------------ - ! Initialize accumulated fields - ! ------------------------------------------------------------------------ - - ! Initialize accumulator fields to be time accumulated for various purposes. - ! The time manager needs to be initialized before this called is made, since - ! the step size is needed. - - call t_startf('init_accflds') - call initAccFlds() - call t_stopf('init_accflds') - - ! ------------------------------------------------------------------------ - ! Set arbitrary initial conditions for time varying fields - ! used in coupled carbon-nitrogen code - ! ------------------------------------------------------------------------ - - if (use_cn) then - call t_startf('init_cninitim') - if (nsrest == nsrStartup) then - call CNiniTimeVar() - end if - call t_stopf('init_cninitim') - end if - - ! ------------------------------------------------------------------------ - ! Initialization of dynamic pft weights - ! ------------------------------------------------------------------------ - - ! Determine correct pft weights (interpolate pftdyn dataset if initial run) - ! Otherwise these are read in for a restart run - - if (use_cndv) then - call pftwt_init() - else - if (flanduse_timeseries /= ' ') then - call t_startf('init_pftdyn') - call pftdyn_init() - call pftdyn_interp( ) - call t_stopf('init_pftdyn') - end if - end if - - ! ------------------------------------------------------------------------ - ! Read restart/initial info - ! ------------------------------------------------------------------------ - - ! No weight related information can be contained in the routines, - ! "mkarbinit, inicfile and restFile". - - call t_startf('init_io2') - if (do_restread()) then - call UrbanInitTimeVar( ) - if (masterproc) write(iulog,*)'reading restart file ',fnamer - call restFile_read( fnamer ) - else if (nsrest == nsrStartup .and. finidat == ' ') then - call mkarbinit() - call UrbanInitTimeVar( ) - end if - call t_stopf('init_io2') - - ! ------------------------------------------------------------------------ - ! Initialize nitrogen deposition - ! ------------------------------------------------------------------------ - - if (use_cn) then - call t_startf('init_ndep') - call ndep_init() - call ndep_interp() - call t_stopf('init_ndep') - end if - - ! ------------------------------------------------------------------------ - ! Initialization of model parameterizations that are needed after - ! restart file is read in - ! ------------------------------------------------------------------------ - - ! ------------------------------------------------------------------------ - ! Initialize history and accumator buffers - ! ------------------------------------------------------------------------ - - call t_startf('init_hist1') - - ! Initialize active history fields. This is only done if not a restart run. - ! If a restart run, then this information has already been obtained from the - ! restart data read above. Note that routine hist_htapes_build needs time manager - ! information, so this call must be made after the restart information has been read. - - if (nsrest == nsrStartup .or. nsrest == nsrBranch) call hist_htapes_build() - - ! Initialize clmtype variables that are obtained from accumulated fields. - ! This routine is called in an initial run at nstep=0 - ! This routine is also always called for a restart run and must - ! therefore be called after the restart file is read in - - call initAccClmtype() - - call t_stopf('init_hist1') - - ! -------------------------------------------------------------- - ! Note - everything below this point needs updated weights - ! -------------------------------------------------------------- - - ! Initialize filters - - call t_startf('init_filters') - - call allocFilters() - nclumps = get_proc_clumps() -!$OMP PARALLEL DO PRIVATE (nc) - do nc = 1, nclumps - call setFilters(nc) - end do -!$OMP END PARALLEL DO - - call t_stopf('init_filters') - - ! Calculate urban "town" roughness length and displacement - ! height for urban landunits - - call UrbanInitAero() - - ! Initialize urban radiation model - this uses urbinp data structure - - call UrbanClumpInit() - - ! Finalize urban model initialization - - call UrbanInput(mode='finalize') - - ! - ! Even if CN is on, and dry-deposition is active, read CLMSP annual vegetation to get estimates of monthly LAI - ! - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - call readAnnualVegetation() - end if - - ! End initialization - - call t_startf('init_wlog') - if (masterproc) then - write(iulog,*) 'Successfully initialized the land model' - if (nsrest == nsrStartup) then - write(iulog,*) 'begin initial run at: ' - else - write(iulog,*) 'begin continuation run at:' - end if - call get_curr_date(yr, mon, day, ncsec) - write(iulog,*) ' nstep= ',get_nstep(), ' year= ',yr,' month= ',mon,& - ' day= ',day,' seconds= ',ncsec - write(iulog,*) - write(iulog,'(72a1)') ("*",i=1,60) - write(iulog,*) - endif - call t_stopf('init_wlog') - - if (get_nstep() == 0 .or. nsrest == nsrStartup) then - ! Initialize albedos (correct pft filters are needed) - - if (finidat == ' ' .or. do_initsurfalb) then - call t_startf('init_orb') - calday = get_curr_calday() - call t_startf('init_orbd1') - call shr_orb_decl( calday, eccen, mvelpp, lambm0, obliqr, declin, eccf ) - call t_stopf('init_orbd1') - - dtime = get_step_size() - caldaym1 = get_curr_calday(offset=-int(dtime)) - call t_startf('init_orbd2') - call shr_orb_decl( caldaym1, eccen, mvelpp, lambm0, obliqr, declinm1, eccf ) - call t_stopf('init_orbd2') - - call t_startf('init_orbSA') - call initSurfAlb( calday, declin, declinm1 ) - call t_stopf('init_orbSA') - call t_stopf('init_orb') - else if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - ! Call interpMonthlyVeg for dry-deposition so that mlaidiff will be calculated - ! This needs to be done even if CN or CNDV is on! - call interpMonthlyVeg() - end if - - ! Determine gridcell averaged properties to send to atm - - call t_startf('init_map2gc') - call clm_map2gcell_minimal() - call t_stopf('init_map2gc') - - end if - - ! Initialize sno export state - if (create_glacier_mec_landunit) then - call t_startf('init_create_s2x') - call update_clm_s2x(init=.true.) - call t_stopf('init_create_s2x') - end if - - call t_stopf('clm_init2') - - end subroutine initialize2 - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: header -! -! !INTERFACE: - subroutine header() -! -! !DESCRIPTION: -! Echo and save model version number -! -! !USES: - use clm_varctl , only : version -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize in this module -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! -!EOP -!----------------------------------------------------------------------- - - if ( masterproc )then - write(iulog,*) trim(version) - write(iulog,*) - end if - - end subroutine header - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: do_restread -! -! !INTERFACE: - logical function do_restread( ) -! -! !DESCRIPTION: -! Determine if restart file will be read -! -! !USES: - use clm_varctl, only : finidat -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - - do_restread = .false. - if (nsrest == nsrStartup .and. finidat /= ' ') then - do_restread = .true. - end if - if (nsrest == nsrContinue .or. nsrest == nsrBranch) then - do_restread = .true. - end if - end function do_restread - -end module clm_initializeMod diff --git a/src_clm40/main/clm_nlUtilsMod.F90 b/src_clm40/main/clm_nlUtilsMod.F90 deleted file mode 100644 index 68536bd1fb..0000000000 --- a/src_clm40/main/clm_nlUtilsMod.F90 +++ /dev/null @@ -1,116 +0,0 @@ -module clm_nlUtilsMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_nltUtilsMod -! -! !DESCRIPTION: -! Utilities to handle namelists. -! -! !USES: - -! !PUBLIC TYPES: - implicit none - save - - private ! By default everything is private - -! !PUBLIC MEMBER FUNCTIONS: - public :: find_nlgroup_name ! find a specified namelist group in a file -! -! !REVISION HISTORY: -! Created by B. Eaton -! Move to CLM by E. Kluzek -! -! !PRIVATE MEMBER FUNCTIONS: None -!----------------------------------------------------------------------- -! !PRIVATE DATA MEMBERS: None - -!EOP -!----------------------------------------------------------------------- -contains - -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: find_nlgroup_name -! -! !INTERFACE: - subroutine find_nlgroup_name(unit, group, status) -! -! !DESCRIPTION: -! Search a file that contains namelist input for the specified namelist group name. -! Leave the file positioned so that the current record is the first record of the -! input for the specified group. -! -! METHOD: -! Read the file line by line. Each line is searched for an '&' which may only -! be preceded by blanks, immediately followed by the group name which is case -! insensitive. If found then backspace the file so the current record is the -! one containing the group name and return success. Otherwise return -1. -! -! !USES: - use shr_kind_mod , only : CS => shr_kind_cs - use shr_string_mod, only : shr_string_toLower -! -! !ARGUMENTS: - integer, intent(in) :: unit ! fortran unit attached to file - character(len=*), intent(in) :: group ! namelist group name - integer, intent(out) :: status ! 0 for success, -1 if group name not found -! -! !REVISION HISTORY: -! Created by B. Eaton, August 2007 -! Move to CLM E. Kluzek, August 2012 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: len_grp ! length of the groupname - integer :: ios ! io status - character(len=CS) :: inrec ! first shr_kind_CS characters of input record - character(len=CS) :: inrec2 ! left adjusted input record - character(len=len(group)) :: lc_group ! lower-case group name - character(len=32) :: subname = 'find_nlgroup_name' ! subroutine name -!----------------------------------------------------------------------- - len_grp = len_trim(group) - lc_group = shr_string_toLower(group) - - ios = 0 - do while (ios <= 0) - - read(unit, '(a)', iostat=ios, end=100) inrec - - if (ios <= 0) then ! ios < 0 indicates an end of record condition - - ! look for group name in this record - - ! remove leading blanks - inrec2 = adjustl(inrec) - - ! check for leading '&' - if (inrec2(1:1) == '&') then - - ! check for case insensitive group name - if (trim(lc_group) == shr_string_toLower(inrec2(2:len_grp+1))) then - - ! found group name. backspace to leave file position at this record - backspace(unit) - status = 0 - return - - end if - end if - end if - - end do - - 100 continue ! end of file processing - status = -1 - -end subroutine find_nlgroup_name - -!----------------------------------------------------------------------- - -end module clm_nlUtilsMod diff --git a/src_clm40/main/clm_time_manager.F90 b/src_clm40/main/clm_time_manager.F90 deleted file mode 100644 index 3057294bc3..0000000000 --- a/src_clm40/main/clm_time_manager.F90 +++ /dev/null @@ -1,1625 +0,0 @@ -module clm_time_manager - - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_sys_mod , only: shr_sys_abort - use spmdMod , only: masterproc - use clm_varctl , only: iulog - use clm_varcon , only: isecspday - use ESMF - - implicit none - private - - ! Public methods - - public ::& - get_timemgr_defaults, &! get startup default values - set_timemgr_init, &! setup startup values - timemgr_init, &! time manager initialization - timemgr_restart_io, &! read/write time manager restart info and restart time manager - timemgr_restart, &! restart the time manager using info from timemgr_restart - timemgr_datediff, &! calculate difference between two time instants - advance_timestep, &! increment timestep number - get_clock, &! get the clock from the time-manager - get_curr_ESMF_Time, &! get current time in terms of the ESMF_Time - get_step_size, &! return step size in seconds - get_rad_step_size, &! return radiation step size in seconds - get_nstep, &! return timestep number - get_curr_date, &! return date components at end of current timestep - get_prev_date, &! return date components at beginning of current timestep - get_start_date, &! return components of the start date - get_driver_start_ymd, &! return year/month/day (as integer in YYYYMMDD format) of driver start date - get_ref_date, &! return components of the reference date - get_perp_date, &! return components of the perpetual date, and current time of day - get_curr_time, &! return components of elapsed time since reference date at end of current timestep - get_prev_time, &! return components of elapsed time since reference date at beg of current timestep - get_curr_calday, &! return calendar day at end of current timestep - get_calday, &! return calendar day from input date - get_calendar, &! return calendar - get_days_per_year, &! return the days per year for current year - get_curr_yearfrac, &! return the fractional position in the current year - get_rest_date, &! return the date from the restart file - set_nextsw_cday, &! set the next radiation calendar day - is_first_step, &! return true on first step of initial run - is_first_restart_step, &! return true on first step of restart or branch run - is_beg_curr_day, &! return true on first timestep in current day - is_end_curr_day, &! return true on last timestep in current day - is_end_curr_month, &! return true on last timestep in current month - is_last_step, &! return true on last timestep - is_perpetual, &! return true if perpetual calendar is in use - is_restart, &! return true if this is a restart run - update_rad_dtime ! track radiation interval via nstep - - ! Public parameter data - character(len=*), public, parameter :: NO_LEAP_C = 'NO_LEAP' - character(len=*), public, parameter :: GREGORIAN_C = 'GREGORIAN' - - ! Private module data - - ! Private data for input - - character(len=ESMF_MAXSTR), save ::& - calendar = NO_LEAP_C ! Calendar to use in date calculations. - integer, parameter :: uninit_int = -999999999 - real(r8), parameter :: uninit_r8 = -999999999.0 - - ! Input - integer, save ::& - dtime = uninit_int, &! timestep in seconds - dtime_rad = uninit_int, &! radiation interval in seconds - nstep_rad_prev = uninit_int ! radiation interval in seconds - - ! Input from CESM driver - integer, save ::& - nelapse = uninit_int, &! number of timesteps (or days if negative) to extend a run - start_ymd = uninit_int, &! starting date for run in yearmmdd format - start_tod = 0, &! starting time of day for run in seconds - stop_ymd = uninit_int, &! stopping date for run in yearmmdd format - stop_tod = 0, &! stopping time of day for run in seconds - ref_ymd = uninit_int, &! reference date for time coordinate in yearmmdd format - ref_tod = 0 ! reference time of day for time coordinate in seconds - type(ESMF_Calendar), target, save :: tm_cal ! calendar - type(ESMF_Clock), save :: tm_clock ! model clock - type(ESMF_Time), save :: tm_perp_date ! perpetual date - - ! Data required to restart time manager: - integer, save :: rst_step_sec = uninit_int ! timestep size seconds - integer, save :: rst_start_ymd = uninit_int ! start date - integer, save :: rst_start_tod = uninit_int ! start time of day - integer, save :: rst_ref_ymd = uninit_int ! reference date - integer, save :: rst_ref_tod = uninit_int ! reference time of day - integer, save :: rst_curr_ymd = uninit_int ! current date - integer, save :: rst_curr_tod = uninit_int ! current time of day - - integer, save :: rst_nstep_rad_prev ! nstep of previous radiation call - integer, save :: perpetual_ymd = uninit_int ! Perpetual calendar date (YYYYMMDD) - logical, save :: tm_first_restart_step = .false. ! true for first step of a restart or branch run - logical, save :: tm_perp_calendar = .false. ! true when using perpetual calendar - logical, save :: timemgr_set = .false. ! true when timemgr initialized - integer, save :: nestep = uninit_int ! ending time-step - ! - ! Next short-wave radiation calendar day - ! - real(r8) :: nextsw_cday = uninit_r8 ! calday from clock of next radiation computation - - ! Private module methods - - private :: timemgr_spmdbcast - private :: init_calendar - private :: init_clock - private :: calc_nestep - private :: timemgr_print - private :: TimeGetymd - - !========================================================================================= -contains - !========================================================================================= - - subroutine get_timemgr_defaults( calendar_out, start_ymd_out, start_tod_out, ref_ymd_out, & - ref_tod_out, stop_ymd_out, stop_tod_out, nelapse_out, & - dtime_out ) - - !--------------------------------------------------------------------------------- - ! get time manager startup default values - ! - ! Arguments - character(len=*), optional, intent(OUT) :: calendar_out ! Calendar type - integer , optional, intent(OUT) :: nelapse_out ! Number of step (or days) to advance - integer , optional, intent(OUT) :: start_ymd_out ! Start date (YYYYMMDD) - integer , optional, intent(OUT) :: start_tod_out ! Start time of day (sec) - integer , optional, intent(OUT) :: ref_ymd_out ! Reference date (YYYYMMDD) - integer , optional, intent(OUT) :: ref_tod_out ! Reference time of day (sec) - integer , optional, intent(OUT) :: stop_ymd_out ! Stop date (YYYYMMDD) - integer , optional, intent(OUT) :: stop_tod_out ! Stop time of day (sec) - integer , optional, intent(OUT) :: dtime_out ! Time-step (sec) - ! - character(len=*), parameter :: sub = 'clm::get_timemgr_defaults' - - if ( timemgr_set ) call shr_sys_abort( sub//":: timemgr_init or timemgr_restart already called" ) - if (present(calendar_out) ) calendar_out = trim(calendar) - if (present(start_ymd_out) ) start_ymd_out = start_ymd - if (present(start_tod_out) ) start_tod_out = start_tod - if (present(ref_ymd_out) ) ref_ymd_out = ref_ymd - if (present(ref_tod_out) ) ref_tod_out = ref_tod - if (present(stop_ymd_out) ) stop_ymd_out = stop_ymd - if (present(stop_tod_out) ) stop_tod_out = stop_tod - if (present(nelapse_out) ) nelapse_out = nelapse - if (present(dtime_out) ) dtime_out = dtime - - end subroutine get_timemgr_defaults - - !========================================================================================= - - subroutine set_timemgr_init( calendar_in, start_ymd_in, start_tod_in, ref_ymd_in, & - ref_tod_in, stop_ymd_in, stop_tod_in, perpetual_run_in, & - perpetual_ymd_in, nelapse_in, dtime_in ) - - !--------------------------------------------------------------------------------- - ! set time manager startup values - ! - ! Arguments - character(len=*), optional, intent(IN) :: calendar_in ! Calendar type - integer , optional, intent(IN) :: nelapse_in ! Number of step (or days) to advance - integer , optional, intent(IN) :: start_ymd_in ! Start date (YYYYMMDD) - integer , optional, intent(IN) :: start_tod_in ! Start time of day (sec) - integer , optional, intent(IN) :: ref_ymd_in ! Reference date (YYYYMMDD) - integer , optional, intent(IN) :: ref_tod_in ! Reference time of day (sec) - integer , optional, intent(IN) :: stop_ymd_in ! Stop date (YYYYMMDD) - integer , optional, intent(IN) :: stop_tod_in ! Stop time of day (sec) - logical , optional, intent(IN) :: perpetual_run_in ! If in perpetual mode or not - integer , optional, intent(IN) :: perpetual_ymd_in ! Perpetual date (YYYYMMDD) - integer , optional, intent(IN) :: dtime_in ! Time-step (sec) - ! - character(len=*), parameter :: sub = 'clm::set_timemgr_init' - - if ( timemgr_set ) call shr_sys_abort( sub//":: timemgr_init or timemgr_restart already called" ) - if (present(calendar_in) ) calendar = trim(calendar_in) - if (present(start_ymd_in) ) start_ymd = start_ymd_in - if (present(start_tod_in) ) start_tod = start_tod_in - if (present(ref_ymd_in) ) ref_ymd = ref_ymd_in - if (present(ref_tod_in) ) ref_tod = ref_tod_in - if (present(stop_ymd_in) ) stop_ymd = stop_ymd_in - if (present(stop_tod_in) ) stop_tod = stop_tod_in - if (present(perpetual_run_in) )then - tm_perp_calendar = perpetual_run_in - if ( tm_perp_calendar ) then - if ( .not. present(perpetual_ymd_in) .or. perpetual_ymd == uninit_int) & - call shr_sys_abort( sub//":: perpetual_run set but NOT perpetual_ymd" ) - perpetual_ymd = perpetual_ymd_in - end if - end if - if (present(nelapse_in) ) nelapse = nelapse_in - if (present(dtime_in) ) dtime = dtime_in - - end subroutine set_timemgr_init - - !========================================================================================= - - subroutine timemgr_init( ) - - !--------------------------------------------------------------------------------- - ! Initialize the ESMF time manager from the sync clock - ! - ! Arguments - ! - character(len=*), parameter :: sub = 'clm::timemgr_init' - integer :: rc ! return code - integer :: yr, mon, day, tod ! Year, month, day, and second as integers - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: curr_date ! temporary date used in logic - type(ESMF_Time) :: ref_date ! reference date for time coordinate - logical :: run_length_specified = .false. - type(ESMF_Time) :: current ! current date (from clock) - type(ESMF_TimeInterval) :: day_step_size ! day step size - type(ESMF_TimeInterval) :: step_size ! timestep size - !--------------------------------------------------------------------------------- - call timemgr_spmdbcast( ) - - ! Initalize calendar - - call init_calendar() - - ! Initalize start date. - - if ( start_ymd == uninit_int ) then - write(iulog,*)sub,': start_ymd must be specified ' - call shr_sys_abort - end if - if ( start_tod == uninit_int ) then - write(iulog,*)sub,': start_tod must be specified ' - call shr_sys_abort - end if - start_date = TimeSetymd( start_ymd, start_tod, "start_date" ) - - ! Initialize current date - - curr_date = start_date - - ! Initalize stop date. - - stop_date = TimeSetymd( 99991231, stop_tod, "stop_date" ) - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - call ESMF_TimeIntervalSet( day_step_size, d=1, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting day_step_size') - - if ( stop_ymd /= uninit_int ) then - current = TimeSetymd( stop_ymd, stop_tod, "stop_date" ) - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( nelapse /= uninit_int ) then - if ( nelapse >= 0 ) then - current = curr_date + step_size*nelapse - else - current = curr_date - day_step_size*nelapse - end if - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( .not. run_length_specified ) then - call shr_sys_abort (sub//': Must specify stop_ymd or nelapse') - end if - - ! Error check - - if ( stop_date <= start_date ) then - write(iulog,*)sub, ': stop date must be specified later than start date: ' - call ESMF_TimeGet( start_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Start date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - if ( curr_date >= stop_date ) then - write(iulog,*)sub, ': stop date must be specified later than current date: ' - call ESMF_TimeGet( curr_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Current date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - - ! Initalize reference date for time coordinate. - - if ( ref_ymd /= uninit_int ) then - ref_date = TimeSetymd( ref_ymd, ref_tod, "ref_date" ) - else - ref_date = start_date - end if - - ! Initialize clock - - call init_clock( start_date, ref_date, curr_date, stop_date ) - - ! Initialize date used for perpetual calendar day calculation. - - if (tm_perp_calendar) then - tm_perp_date = TimeSetymd( perpetual_ymd, 0, "tm_perp_date" ) - end if - - ! Print configuration summary to log file (stdout). - - if (masterproc) call timemgr_print() - - timemgr_set = .true. - - end subroutine timemgr_init - - !========================================================================================= - - subroutine init_clock( start_date, ref_date, curr_date, stop_date ) - - !--------------------------------------------------------------------------------- - ! Purpose: Initialize the clock based on the start_date, ref_date, and curr_date - ! as well as the settings from the namelist specifying the time to stop - ! - type(ESMF_Time), intent(in) :: start_date ! start date for run - type(ESMF_Time), intent(in) :: ref_date ! reference date for time coordinate - type(ESMF_Time), intent(in) :: curr_date ! current date (equal to start_date) - type(ESMF_Time), intent(in) :: stop_date ! stop date for run - ! - character(len=*), parameter :: sub = 'clm::init_clock' - type(ESMF_TimeInterval) :: step_size ! timestep size - type(ESMF_Time) :: current ! current date (from clock) - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - ! Initialize the clock - - tm_clock = ESMF_ClockCreate(name="CLM Time-manager clock", timeStep=step_size, startTime=start_date, & - stopTime=stop_date, refTime=ref_date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockSetup') - - ! Advance clock to the current time (in case of a restart) - - call ESMF_ClockGet(tm_clock, currTime=current, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - do while( curr_date > current ) - call ESMF_ClockAdvance( tm_clock, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockAdvance') - call ESMF_ClockGet(tm_clock, currTime=current ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - end do - end subroutine init_clock - - !========================================================================================= - - function TimeSetymd( ymd, tod, desc ) - !--------------------------------------------------------------------------------- - ! - ! Set the time by an integer as YYYYMMDD and integer seconds in the day - ! - integer, intent(in) :: ymd ! Year, month, day YYYYMMDD - integer, intent(in) :: tod ! Time of day in seconds - character(len=*), intent(in) :: desc ! Description of time to set - - type(ESMF_Time) :: TimeSetymd ! Return value - - character(len=*), parameter :: sub = 'clm::TimeSetymd' - integer :: yr, mon, day ! Year, month, day as integers - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - if ( (ymd < 0) .or. (tod < 0) .or. (tod > isecspday) )then - write(iulog,*) sub//': error yymmdd is a negative number or time-of-day out of bounds', & - ymd, tod - call shr_sys_abort - end if - yr = ymd / 10000 - mon = (ymd - yr*10000) / 100 - day = ymd - yr*10000 - mon*100 - call ESMF_TimeSet( TimeSetymd, yy=yr, mm=mon, dd=day, s=tod, & - calendar=tm_cal, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeSet: setting '//trim(desc)) - end function TimeSetymd - - !========================================================================================= - - integer function TimeGetymd( date, tod ) - ! - ! Get the date and time of day in ymd from ESMF Time. - ! - type(ESMF_Time), intent(inout) :: date ! Input date to convert to ymd - integer, intent(out), optional :: tod ! Time of day in seconds - - character(len=*), parameter :: sub = 'clm::TimeGetymd' - integer :: yr, mon, day - integer :: rc ! return code - - call ESMF_TimeGet( date, yy=yr, mm=mon, dd=day, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - TimeGetymd = yr*10000 + mon*100 + day - if ( present( tod ) )then - call ESMF_TimeGet( date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - end if - if ( yr < 0 )then - write(iulog,*) sub//': error year is less than zero', yr - call shr_sys_abort - end if - end function TimeGetymd - - !========================================================================================= - - subroutine timemgr_restart_io( ncid, flag ) - - !--------------------------------------------------------------------------------- - ! Read/Write information needed on restart to a netcdf file. - use ncdio_pio, only: ncd_int - use pio, only: var_desc_t, file_desc_t - use restUtilMod - ! - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf id - character(len=*), intent(in) :: flag ! 'read' or 'write' - ! - ! Local variables - character(len=*), parameter :: sub = 'clm::timemgr_restart' - integer :: rc ! return code - logical :: readvar ! determine if variable is on initial file - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: ref_date ! reference date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - integer :: rst_caltype ! calendar type - integer, parameter :: noleap = 1 - integer, parameter :: gregorian = 2 - character(len=len(calendar)) :: cal - !--------------------------------------------------------------------------------- - - if (flag == 'write') then - rst_nstep_rad_prev = nstep_rad_prev - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_nstep_rad_prev', xtype=ncd_int, & - long_name='previous_radiation_nstep', units='unitless positive integer', & - ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_nstep_rad_prev) - if (flag == 'read') then - nstep_rad_prev = rst_nstep_rad_prev - end if - - if (flag == 'write') then - cal = to_upper(calendar) - if ( trim(cal) == NO_LEAP_C ) then - rst_caltype = noleap - else if ( trim(cal) == GREGORIAN_C ) then - rst_caltype = gregorian - else - call shr_sys_abort(sub//'ERROR: unrecognized calendar specified= '//trim(calendar)) - end if - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_type', xtype=ncd_int, & - long_name='calendar type', units='unitless', flag_meanings=(/ "NO_LEAP_C", "GREGORIAN" /), & - flag_values=(/ noleap, gregorian /), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_caltype) - if (flag == 'read') then - if ( rst_caltype == noleap ) then - calendar = NO_LEAP_C - else if ( rst_caltype == gregorian ) then - calendar = GREGORIAN_C - else - write(iulog,*)sub,': unrecognized calendar type in restart file: ',rst_caltype - call shr_sys_abort( sub//'ERROR: bad calendar type in restart file') - end if - end if - - if (flag == 'write') then - call ESMF_ClockGet( tm_clock, startTime=start_date, currTime=curr_date, refTime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - rst_step_sec = dtime - rst_start_ymd = TimeGetymd( start_date, tod=rst_start_tod ) - rst_ref_ymd = TimeGetymd( ref_date, tod=rst_ref_tod ) - rst_curr_ymd = TimeGetymd( curr_date, tod=rst_curr_tod ) - end if - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_step_sec', xtype=ncd_int, & - long_name='seconds component of timestep size', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_step_sec) - if ((flag == 'read') .and. ( rst_step_sec < 0 .or. rst_step_sec > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_step_sec out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_start_ymd', xtype=ncd_int, & - long_name='start date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_start_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_start_tod', xtype=ncd_int, & - long_name='start time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_start_tod) - if ((flag == 'read') .and. ( rst_start_tod < 0 .or. rst_start_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_strart_tod out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_ref_ymd', xtype=ncd_int, & - long_name='reference date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_ref_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_ref_tod', xtype=ncd_int, & - long_name='reference time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_ref_tod) - if ((flag == 'read') .and. ( rst_start_tod < 0 .or. rst_start_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_ref_tod out of range') - end if - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_curr_ymd', xtype=ncd_int, & - long_name='current date', units='YYYYMMDD', ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_curr_ymd) - - call restartvar(ncid=ncid, flag=flag, varname='timemgr_rst_curr_tod', xtype=ncd_int, & - long_name='current time of day', units='sec', & - nvalid_range=(/0,isecspday/), ifill_value=uninit_int, & - interpinic_flag='skip', readvar=readvar, data=rst_curr_tod) - if ((flag == 'read') .and. ( rst_curr_tod < 0 .or. rst_curr_tod > isecspday )) then - call shr_sys_abort( sub//'ERROR: timemgr_rst_ref_ymd out of range') - end if - - end subroutine timemgr_restart_io - - !========================================================================================= - - subroutine timemgr_restart( ) - - !--------------------------------------------------------------------------------- - ! Restart the ESMF time manager using the synclock for ending date. - ! - character(len=*), parameter :: sub = 'clm::timemgr_restart' - integer :: rc ! return code - integer :: yr, mon, day, tod ! Year, month, day, and second as integers - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: ref_date ! reference date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: current ! current date (from clock) - type(ESMF_TimeInterval) :: day_step_size ! day step size - type(ESMF_TimeInterval) :: step_size ! timestep size - logical :: run_length_specified = .false. - !--------------------------------------------------------------------------------- - call timemgr_spmdbcast( ) - - ! Initialize calendar from restart info - - call init_calendar() - - ! Initialize the timestep from restart info - - dtime = rst_step_sec - - ! Initialize start date from restart info - - start_date = TimeSetymd( rst_start_ymd, rst_start_tod, "start_date" ) - - ! Initialize current date from restart info - - curr_date = TimeSetymd( rst_curr_ymd, rst_curr_tod, "curr_date" ) - - ! Initialize stop date from sync clock or namelist input - - stop_date = TimeSetymd( 99991231, stop_tod, "stop_date" ) - - call ESMF_TimeIntervalSet( step_size, s=dtime, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting step_size') - - call ESMF_TimeIntervalSet( day_step_size, d=1, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet: setting day_step_size') - - if ( stop_ymd /= uninit_int ) then - current = TimeSetymd( stop_ymd, stop_tod, "stop_date" ) - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - else if ( nelapse /= uninit_int ) then - if ( nelapse >= 0 ) then - current = curr_date + step_size*nelapse - else - current = curr_date - day_step_size*nelapse - end if - if ( current < stop_date ) stop_date = current - run_length_specified = .true. - end if - if ( .not. run_length_specified ) then - call shr_sys_abort (sub//': Must specify stop_ymd or nelapse') - end if - - ! Error check - - if ( stop_date <= start_date ) then - write(iulog,*)sub, ': stop date must be specified later than start date: ' - call ESMF_TimeGet( start_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Start date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - if ( curr_date >= stop_date ) then - write(iulog,*)sub, ': stop date must be specified later than current date: ' - call ESMF_TimeGet( curr_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Current date (yr, mon, day, tod): ', yr, mon, day, tod - call ESMF_TimeGet( stop_date, yy=yr, mm=mon, dd=day, s=tod ) - write(iulog,*) ' Stop date (yr, mon, day, tod): ', yr, mon, day, tod - call shr_sys_abort - end if - - ! Initialize nstep_rad_prev from restart info - - nstep_rad_prev = rst_nstep_rad_prev - - ! Initialize ref date from restart info - - ref_date = TimeSetymd( rst_ref_ymd, rst_ref_tod, "ref_date" ) - - ! Initialize clock - - call init_clock( start_date, ref_date, curr_date, stop_date ) - - ! Advance the timestep. - ! Data from the restart file corresponds to the last timestep of the previous run. - - call advance_timestep() - - ! Set flag that this is the first timestep of the restart run. - - tm_first_restart_step = .true. - - ! Calculate ending time step - - call calc_nestep( ) - - ! Print configuration summary to log file (stdout). - - if (masterproc) call timemgr_print() - - timemgr_set = .true. - - end subroutine timemgr_restart - - !========================================================================================= - - subroutine calc_nestep() - !--------------------------------------------------------------------------------- - ! - ! Calculate ending timestep number - ! Calculation of ending timestep number (nestep) assumes a constant stepsize. - ! - character(len=*), parameter :: sub = 'clm::calc_nestep' - integer :: ntspday ! Number of time-steps per day - type(ESMF_TimeInterval) :: diff ! - type(ESMF_Time) :: start_date ! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - integer :: ndays, nsecs ! Number of days, seconds to ending time - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, stopTime=stop_date, startTime=start_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - ntspday = isecspday/dtime - diff = stop_date - start_date - call ESMF_TimeIntervalGet( diff, d=ndays, s=nsecs, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet calculating nestep') - nestep = ntspday*ndays + nsecs/dtime - if ( mod(nsecs,dtime) /= 0 ) nestep = nestep + 1 - end subroutine calc_nestep - - !========================================================================================= - - subroutine init_calendar( ) - - !--------------------------------------------------------------------------------- - ! Initialize calendar - ! - ! Local variables - ! - character(len=*), parameter :: sub = 'clm::init_calendar' - type(ESMF_CalKind_Flag) :: cal_type ! calendar type - character(len=len(calendar)) :: caltmp - integer :: rc ! return code - !--------------------------------------------------------------------------------- - - caltmp = to_upper(calendar) - if ( trim(caltmp) == NO_LEAP_C ) then - cal_type = ESMF_CALKIND_NOLEAP - else if ( trim(caltmp) == GREGORIAN_C ) then - cal_type = ESMF_CALKIND_GREGORIAN - else - write(iulog,*)sub,': unrecognized calendar specified: ',calendar - call shr_sys_abort - end if - tm_cal = ESMF_CalendarCreate( name=caltmp, calkindflag=cal_type, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_CalendarSet') - end subroutine init_calendar - - !========================================================================================= - - subroutine timemgr_print() - - !--------------------------------------------------------------------------------- - character(len=*), parameter :: sub = 'clm::timemgr_print' - integer :: rc - integer :: yr, mon, day - integer :: & ! Data required to restart time manager: - nstep = uninit_int, &! current step number - step_sec = uninit_int, &! timestep size seconds - start_yr = uninit_int, &! start year - start_mon = uninit_int, &! start month - start_day = uninit_int, &! start day of month - start_tod = uninit_int, &! start time of day - stop_yr = uninit_int, &! stop year - stop_mon = uninit_int, &! stop month - stop_day = uninit_int, &! stop day of month - stop_tod = uninit_int, &! stop time of day - ref_yr = uninit_int, &! reference year - ref_mon = uninit_int, &! reference month - ref_day = uninit_int, &! reference day of month - ref_tod = uninit_int, &! reference time of day - curr_yr = uninit_int, &! current year - curr_mon = uninit_int, &! current month - curr_day = uninit_int, &! current day of month - curr_tod = uninit_int ! current time of day - integer(ESMF_KIND_I8) :: step_no - type(ESMF_Time) :: start_date! start date for run - type(ESMF_Time) :: stop_date ! stop date for run - type(ESMF_Time) :: curr_date ! date of data in restart file - type(ESMF_Time) :: ref_date ! reference date - type(ESMF_TimeInterval) :: step ! Time-step - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, startTime=start_date, currTime=curr_date, & - refTime=ref_date, stopTime=stop_date, timeStep=step, & - advanceCount=step_no, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - nstep = step_no - - write(iulog,*)' ******** CLM Time Manager Configuration ********' - - call ESMF_TimeIntervalGet( step, s=step_sec, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - - call ESMF_TimeGet( start_date, yy=start_yr, mm=start_mon, dd=start_day, & - s=start_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( stop_date, yy=stop_yr, mm=stop_mon, dd=stop_day, & - s=stop_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( ref_date, yy=ref_yr, mm=ref_mon, dd=ref_day, s=ref_tod, & - rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeGet( curr_date, yy=curr_yr, mm=curr_mon, dd=curr_day, & - s=curr_tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - write(iulog,*)' Calendar type: ',trim(calendar) - write(iulog,*)' Timestep size (seconds): ', step_sec - write(iulog,*)' Start date (yr mon day tod): ', start_yr, start_mon, & - start_day, start_tod - write(iulog,*)' Stop date (yr mon day tod): ', stop_yr, stop_mon, & - stop_day, stop_tod - write(iulog,*)' Reference date (yr mon day tod): ', ref_yr, ref_mon, & - ref_day, ref_tod - write(iulog,*)' Current step number: ', nstep - write(iulog,*)' Ending step number: ', nestep - write(iulog,*)' Current date (yr mon day tod): ', curr_yr, curr_mon, & - curr_day, curr_tod - - if ( tm_perp_calendar ) then - call ESMF_TimeGet( tm_perp_date, yy=yr, mm=mon, dd=day, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - write(iulog,*)' Use perpetual diurnal cycle date (yr mon day): ', & - yr, mon, day - end if - - write(iulog,*)' ************************************************' - - end subroutine timemgr_print - - !========================================================================================= - - subroutine advance_timestep() - - ! Increment the timestep number. - - character(len=*), parameter :: sub = 'clm::advance_timestep' - integer :: rc - - call ESMF_ClockAdvance( tm_clock, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockAdvance') - - tm_first_restart_step = .false. - - end subroutine advance_timestep - - !========================================================================================= - - subroutine get_clock( clock ) - - ! Return the ESMF clock - - type(ESMF_Clock), intent(inout) :: clock - - character(len=*), parameter :: sub = 'clm::get_clock' - type(ESMF_TimeInterval) :: step_size - type(ESMF_Time) :: start_date, stop_date, ref_date - integer :: rc - - call ESMF_ClockGet( tm_clock, timeStep=step_size, startTime=start_date, & - stoptime=stop_date, reftime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - call ESMF_ClockSet(clock, timeStep=step_size, startTime=start_date, & - stoptime=stop_date, reftime=ref_date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockSet') - - end subroutine get_clock - - !========================================================================================= - - function get_curr_ESMF_Time( ) - - ! Return the current time as ESMF_Time - - type(ESMF_Time) :: get_curr_ESMF_Time - character(len=*), parameter :: sub = 'clm::get_curr_ESMF_Time' - integer :: rc - - call ESMF_ClockGet( tm_clock, currTime=get_curr_ESMF_Time, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - end function get_curr_ESMF_Time - - !========================================================================================= - - integer function get_step_size() - - ! Return the step size in seconds. - - character(len=*), parameter :: sub = 'clm::get_step_size' - type(ESMF_TimeInterval) :: step_size ! timestep size - integer :: rc - - call ESMF_ClockGet(tm_clock, timeStep=step_size, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeIntervalGet(step_size, s=get_step_size, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockTimeIntervalGet') - - end function get_step_size - - !========================================================================================= - - subroutine update_rad_dtime(doalb) - !--------------------------------------------------------------------------------- - ! called only on doalb timesteps to save off radiation nsteps - ! - ! Local Arguments - logical,intent(in) :: doalb - integer :: dtime,nstep - - if (doalb) then - - dtime=get_step_size() - nstep = get_nstep() - - if (nstep_rad_prev == uninit_int ) then - dtime_rad = dtime - nstep_rad_prev = nstep - else - dtime_rad = (nstep - nstep_rad_prev) * dtime - nstep_rad_prev = nstep - endif - end if - end subroutine update_rad_dtime - - !========================================================================================= - - integer function get_rad_step_size() - - if (nstep_rad_prev == uninit_int ) then - get_rad_step_size=get_step_size() - else - get_rad_step_size=dtime_rad - end if - - end function get_rad_step_size - - !========================================================================================= - - integer function get_nstep() - - ! Return the timestep number. - - character(len=*), parameter :: sub = 'clm::get_nstep' - integer :: rc - integer(ESMF_KIND_I8) :: step_no - - call ESMF_ClockGet(tm_clock, advanceCount=step_no, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - get_nstep = step_no - - end function get_nstep - - !========================================================================================= - - subroutine get_curr_date(yr, mon, day, tod, offset) - - !----------------------------------------------------------------------------------------- - ! Return date components valid at end of current timestep with an optional - ! offset (positive or negative) in seconds. - - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_curr_date' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: off - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - if (present(offset)) then - if (offset > 0) then - call ESMF_TimeIntervalSet( off, s=offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + off - else if (offset < 0) then - call ESMF_TimeIntervalSet( off, s=-offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date - off - end if - end if - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_curr_date - - !========================================================================================= - - subroutine get_perp_date(yr, mon, day, tod, offset) - - !----------------------------------------------------------------------------------------- - ! Return time of day valid at end of current timestep and the components - ! of the perpetual date (with an optional offset (positive or negative) in seconds. - - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_perp_date' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: DelTime - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - ! Get time of day add it to perpetual date - ! Get year, month, day so that seconds are time-of-day rather than since start time - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeIntervalSet(DelTime, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = tm_perp_date + DelTime - if ( present(offset) )then - call ESMF_TimeIntervalSet(DelTime, s=offset, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + DelTime - end if - ! Get time of day from the result - ! Get year, month, day so that seconds are time-of-day rather than since start time - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - - ! Get the date from the fixed perpetual date (in case it overflows to next day) - call ESMF_TimeGet(tm_perp_date, yy=yr, mm=mon, dd=day, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_perp_date - - !========================================================================================= - - subroutine get_prev_date(yr, mon, day, tod) - - ! Return date components valid at beginning of current timestep. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_prev_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet(tm_clock, prevTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_prev_date - - !========================================================================================= - - subroutine get_start_date(yr, mon, day, tod) - - ! Return date components valid at beginning of initial run. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_start_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet(tm_clock, startTime=date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_start_date - - !========================================================================================= - - integer function get_driver_start_ymd( tod ) - - ! Return date of start of simulation from driver (i.e. NOT from restart file) - ! Note: get_start_date gets you the date from the beginning of the simulation - ! on the restart file. - - ! Arguments - integer, optional, intent(out) ::& - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_driver_start_ymd' - !----------------------------------------------------------------------------------------- - - if ( start_ymd == uninit_int )then - call shr_sys_abort( sub//': error driver start date is NOT set yet' ) - end if - if ( start_ymd < 101 .or. start_ymd > 99991231 )then - call shr_sys_abort( sub//': error driver start date is invalid' ) - end if - if ( present(tod) )then - tod = start_tod - if ( (tod < 0) .or. (tod > isecspday) )then - call shr_sys_abort( sub//': error driver start tod is invalid' ) - end if - end if - get_driver_start_ymd = start_ymd - - end function get_driver_start_ymd - - !========================================================================================= - - subroutine get_ref_date(yr, mon, day, tod) - - ! Return date components of the reference date. - - ! Arguments - integer, intent(out) ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_ref_date' - integer :: rc - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet(tm_clock, refTime=date, rc=rc) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_TimeGet(date, yy=yr, mm=mon, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end subroutine get_ref_date - - !========================================================================================= - - subroutine get_curr_time(days, seconds) - - ! Return time components valid at end of current timestep. - ! Current time is the time interval between the current date and the reference date. - - ! Arguments - integer, intent(out) ::& - days, &! number of whole days in time interval - seconds ! remaining seconds in time interval - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_curr_time' - integer :: rc - type(ESMF_Time) :: cdate, rdate - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, currTime=cdate, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - call ESMF_ClockGet( tm_clock, refTime=rdate, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - diff = cdate - rdate - - call ESMF_TimeIntervalGet(diff, d=days, s=seconds, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - - end subroutine get_curr_time - - !========================================================================================= - - subroutine get_prev_time(days, seconds) - - ! Return time components valid at beg of current timestep. - ! prev time is the time interval between the prev date and the reference date. - - ! Arguments - integer, intent(out) ::& - days, &! number of whole days in time interval - seconds ! remaining seconds in time interval - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_prev_time' - integer :: rc - type(ESMF_Time) :: date, ref_date - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet(tm_clock, prevTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet for prevTime') - call ESMF_ClockGet(tm_clock, refTime=ref_date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet for refTime') - diff = date - ref_date - call ESMF_TimeIntervalGet( diff, d=days, s=seconds, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeintervalGet') - - end subroutine get_prev_time - - !========================================================================================= - - function get_curr_calday(offset) - - ! Return calendar day at end of current timestep with optional offset. - ! Calendar day 1.0 = 0Z on Jan 1. - - ! Arguments - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - ! Return value - real(r8) :: get_curr_calday - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_curr_calday' - integer :: rc - type(ESMF_Time) :: date - type(ESMF_TimeInterval) :: off, diurnal - integer :: year, month, day, tod - !----------------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, currTime=date, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - - if (present(offset)) then - if (offset > 0) then - call ESMF_TimeIntervalSet( off, s=offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date + off - else if (offset < 0) then - call ESMF_TimeIntervalSet( off, s=-offset, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = date - off - end if - end if - - if ( tm_perp_calendar ) then - call ESMF_TimeGet(date, yy=year, mm=month, dd=day, s=tod, rc=rc) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - call ESMF_TimeIntervalSet( diurnal, s=tod, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalSet') - date = tm_perp_date + diurnal - end if - - call ESMF_TimeGet( date, dayOfYear_r8=get_curr_calday, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - !----------------------------------------------------------------------------------------! - !!!!!!!!!!!!!! WARNING HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!! - !!!! The following hack fakes day 366 by reusing day 365. This is just because the !!!!!! - !!!! current shr_orb_decl calculation can't handle days > 366. !!!!!! - !!!! Dani Bundy-Coleman and Erik Kluzek Aug/2008 !!!!!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if ( (get_curr_calday > 366.0) .and. (get_curr_calday <= 367.0) .and. & - (trim(calendar) == GREGORIAN_C) )then - get_curr_calday = get_curr_calday - 1.0_r8 - end if - !!!!!!!!!!!!!! END HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!!!!!! - !----------------------------------------------------------------------------------------! - if ( (get_curr_calday < 1.0) .or. (get_curr_calday > 366.0) )then - write(iulog,*) sub, ' = ', get_curr_calday - if ( present(offset) ) write(iulog,*) 'offset = ', offset - call shr_sys_abort( sub//': error get_curr_calday out of bounds' ) - end if - - end function get_curr_calday - - !========================================================================================= - - function get_calday(ymd, tod) - - ! Return calendar day corresponding to specified time instant. - ! Calendar day 1.0 = 0Z on Jan 1. - - ! Arguments - integer, intent(in) :: & - ymd, &! date in yearmmdd format - tod ! time of day (seconds past 0Z) - - ! Return value - real(r8) :: get_calday - - ! Local variables - character(len=*), parameter :: sub = 'clm::get_calday' - integer :: rc ! return code - type(ESMF_Time) :: date - !----------------------------------------------------------------------------------------- - - date = TimeSetymd( ymd, tod, "get_calday" ) - call ESMF_TimeGet( date, dayOfYear_r8=get_calday, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - !----------------------------------------------------------------------------------------! -!!!!!!!!!!!!!! WARNING HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!! -!!!! The following hack fakes day 366 by reusing day 365. This is just because the !!!!!! -!!!! current shr_orb_decl calculation can't handle days > 366. !!!!!! -!!!! Dani Bundy-Coleman and Erik Kluzek Aug/2008 !!!!!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - if ( (get_calday > 366.0) .and. (get_calday <= 367.0) .and. & - (trim(calendar) == GREGORIAN_C) )then - get_calday = get_calday - 1.0_r8 - end if -!!!!!!!!!!!!!! END HACK TO ENABLE Gregorian CALENDAR WITH SHR_ORB !!!!!!!!!!!!!!!!!!!!!!!! - !----------------------------------------------------------------------------------------! - if ( (get_calday < 1.0) .or. (get_calday > 366.0) )then - write(iulog,*) sub, ' = ', get_calday - call shr_sys_abort( sub//': error calday out of range' ) - end if - - end function get_calday - - !========================================================================================= - - function get_calendar() - - ! Return calendar - - ! Return value - character(len=ESMF_MAXSTR) :: get_calendar - - get_calendar = calendar - - end function get_calendar - - !========================================================================================= - - integer function get_days_per_year( offset ) - - !--------------------------------------------------------------------------------- - ! Get the number of days per year for currrent year - - ! - ! Arguments - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_days_per_year' - integer :: yr, mon, day, tod ! current date year, month, day and time-of-day - type(ESMF_Time) :: eDate ! ESMF date - integer :: rc ! ESMF return code - !--------------------------------------------------------------------------------- - - if ( present(offset) )then - call get_curr_date(yr, mon, day, tod, offset ) - else - call get_curr_date(yr, mon, day, tod ) - end if - eDate = TimeSetymd( ymd=yr*10000+1231, tod=0, desc="end of year" ) - call ESMF_TimeGet( eDate, dayOfYear=get_days_per_year, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeGet') - - end function get_days_per_year - - !========================================================================================= - - function get_curr_yearfrac( offset ) - - !--------------------------------------------------------------------------------- - ! Get the fractional position in the current year. This is 0 at midnight on Jan 1, - ! and 1 at the end of Dec 31. - - ! - ! Arguments - real(r8) :: get_curr_yearfrac ! function result - - integer, optional, intent(in) :: offset ! Offset from current time in seconds. - ! Positive for future times, negative - ! for previous times. - - character(len=*), parameter :: sub = 'clm::get_curr_yearfrac' - real(r8) :: cday ! current calendar day (1.0 = 0Z on Jan 1) - real(r8) :: days_per_year ! days per year - - cday = get_curr_calday(offset=offset) - days_per_year = get_days_per_year() - - get_curr_yearfrac = (cday - 1._r8)/days_per_year - - end function get_curr_yearfrac - - !========================================================================================= - - subroutine get_rest_date(ncid, yr) - - !--------------------------------------------------------------------------------- - ! Get the date from the restart file. - ! - ! Currently just returns the year (because the month & day are harder to extract, and - ! currently aren't needed). - use pio, only: file_desc_t - use ncdio_pio, only: ncd_io - ! - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf id for the restart file - integer , intent(out) :: yr ! year from restart file - - integer :: ymd ! yyyymmdd from the restart file - logical :: readvar ! whether the variable was read from the file - - integer, parameter :: year_mask = 10000 ! divide by this to get year from ymd - - character(len=*), parameter :: subname = 'get_rest_date' - !----------------------------------------------------------------------- - - ! Get the date (yyyymmdd) from restart file. - ! Note that we cannot simply use the rst_curr_ymd module variable, because that isn't - ! set under some circumstances - call ncd_io(varname='timemgr_rst_curr_ymd', data=ymd, & - ncid=ncid, flag='read', readvar=readvar) - if (.not. readvar) then - call shr_sys_abort(subname//' ERROR: timemgr_rst_curr_ymd not found on restart file') - end if - - ! Extract the year - yr = ymd / year_mask - end subroutine get_rest_date - - !========================================================================================= - - subroutine set_nextsw_cday( nextsw_cday_in ) - - ! Set the next radiation calendar day, so that radiation step can be calculated - ! - ! Arguments - real(r8), intent(IN) :: nextsw_cday_in ! input calday of next radiation computation - - character(len=*), parameter :: sub = 'clm::set_nextsw_cday' - - nextsw_cday = nextsw_cday_in - - end subroutine set_nextsw_cday - - !========================================================================================= - - function is_beg_curr_day() - - ! Return true if current timestep is first timestep in current day. - - ! Return value - logical :: is_beg_curr_day - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - - call get_curr_date(yr, mon, day, tod) - is_beg_curr_day = ( tod == dtime ) - - end function is_beg_curr_day - - !========================================================================================= - - function is_end_curr_day() - - !--------------------------------------------------------------------------------- - ! Return true if current timestep is last timestep in current day. - - ! Return value - logical :: is_end_curr_day - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - !--------------------------------------------------------------------------------- - - call get_curr_date(yr, mon, day, tod) - is_end_curr_day = (tod == 0) - - end function is_end_curr_day - - !========================================================================================= - - logical function is_end_curr_month() - - !--------------------------------------------------------------------------------- - ! Return true if current timestep is last timestep in current month. - - ! Local variables - integer ::& - yr, &! year - mon, &! month - day, &! day of month - tod ! time of day (seconds past 0Z) - !--------------------------------------------------------------------------------- - - call get_curr_date(yr, mon, day, tod) - is_end_curr_month = (day == 1 .and. tod == 0) - - end function is_end_curr_month - - !========================================================================================= - - logical function is_first_step() - - !--------------------------------------------------------------------------------- - ! Return true on first step of initial run only. - - ! Local variables - character(len=*), parameter :: sub = 'clm::is_first_step' - integer :: rc - integer :: nstep - integer(ESMF_KIND_I8) :: step_no - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, advanceCount=step_no, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - nstep = step_no - is_first_step = (nstep == 0) - - end function is_first_step - !========================================================================================= - - logical function is_first_restart_step() - - ! Return true on first step of restart run only. - - is_first_restart_step = tm_first_restart_step - - end function is_first_restart_step - - !========================================================================================= - - logical function is_last_step() - - !--------------------------------------------------------------------------------- - ! Return true on last timestep. - - ! Local variables - character(len=*), parameter :: sub = 'clm::is_last_step' - type(ESMF_Time) :: stop_date - type(ESMF_Time) :: curr_date - type(ESMF_TimeInterval) :: time_step - integer :: rc - !--------------------------------------------------------------------------------- - - call ESMF_ClockGet( tm_clock, stopTime=stop_date, & - currTime=curr_date, TimeStep=time_step, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_ClockGet') - if ( curr_date+time_step > stop_date ) then - is_last_step = .true. - else - is_last_step = .false. - end if - - end function is_last_step - - !========================================================================================= - - logical function is_perpetual() - - ! Return true on last timestep. - - is_perpetual = tm_perp_calendar - - end function is_perpetual - - !========================================================================================= - - subroutine timemgr_datediff(ymd1, tod1, ymd2, tod2, days) - - ! Calculate the difference (ymd2,tod2) - (ymd1,tod1) and return the result in days. - ! Arguments - integer, intent(in) ::& - ymd1, &! date1 in yyyymmdd format - tod1, &! time of day relative to date1 (seconds past 0Z) - ymd2, &! date2 in yyyymmdd format - tod2 ! time of day relative to date2 (seconds past 0Z) - - real(r8) :: days ! (ymd2,tod2)-(ymd1,tod1) in days - - ! Local variables - character(len=*), parameter :: sub = 'clm::timemgr_datediff' - integer :: rc ! return code - - type(ESMF_Time) :: date1 - type(ESMF_Time) :: date2 - type(ESMF_TimeInterval) :: diff - !----------------------------------------------------------------------------------------- - - date1 = TimeSetymd( ymd1, tod1, "date1" ) - date2 = TimeSetymd( ymd2, tod2, "date2" ) - diff = date2 - date1 - call ESMF_TimeIntervalGet( diff, d_r8=days, rc=rc ) - call chkrc(rc, sub//': error return from ESMF_TimeIntervalGet') - days = days + 1.0_r8 - - end subroutine timemgr_datediff - - !========================================================================================= - - subroutine chkrc(rc, mes) - integer, intent(in) :: rc ! return code from time management library - character(len=*), intent(in) :: mes ! error message - if ( rc == ESMF_SUCCESS ) return - write(iulog,*) mes - call shr_sys_abort ('CHKRC') - end subroutine chkrc - - !========================================================================================= - - function to_upper(str) - - !--------------------------------------------------------------------------------- - ! Convert character string to upper case. Use achar and iachar intrinsics - ! to ensure use of ascii collating sequence. - ! - ! !INPUT PARAMETERS: - character(len=*), intent(in) :: str ! String to convert to upper case - ! !RETURN VALUE: - character(len=len(str)) :: to_upper - ! !LOCAL VARIABLES: - integer :: i ! Index - integer :: aseq ! ascii collating sequence - character(len=1) :: ctmp ! Character temporary - !--------------------------------------------------------------------------------- - - do i = 1, len(str) - ctmp = str(i:i) - aseq = iachar(ctmp) - if ( aseq >= 97 .and. aseq <= 122 ) ctmp = achar(aseq - 32) - to_upper(i:i) = ctmp - end do - - end function to_upper - - !========================================================================================= - - logical function is_restart( ) - ! Determine if restart run - use clm_varctl, only : nsrest, nsrContinue - if (nsrest == nsrContinue) then - is_restart = .true. - else - is_restart = .false. - end if - end function is_restart - - !========================================================================================= - - subroutine timemgr_spmdbcast( ) - - use spmdMod, only : mpicom, MPI_INTEGER - - integer :: ier - - call mpi_bcast (dtime , 1, MPI_INTEGER , 0, mpicom, ier) - - end subroutine timemgr_spmdbcast - -end module clm_time_manager diff --git a/src_clm40/main/clm_varcon.F90 b/src_clm40/main/clm_varcon.F90 deleted file mode 100644 index b3b076ac5c..0000000000 --- a/src_clm40/main/clm_varcon.F90 +++ /dev/null @@ -1,167 +0,0 @@ -module clm_varcon - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_varcon -! -! !DESCRIPTION: -! Module containing various model constants -! -! !USES: - use shr_kind_mod , only: r8 => shr_kind_r8 - use shr_const_mod, only: SHR_CONST_G,SHR_CONST_STEBOL,SHR_CONST_KARMAN, & - SHR_CONST_RWV,SHR_CONST_RDAIR,SHR_CONST_CPFW, & - SHR_CONST_CPICE,SHR_CONST_CPDAIR,SHR_CONST_LATVAP, & - SHR_CONST_LATSUB,SHR_CONST_LATICE,SHR_CONST_RHOFW, & - SHR_CONST_RHOICE,SHR_CONST_TKFRZ,SHR_CONST_REARTH, & - SHR_CONST_PDB, SHR_CONST_PI, SHR_CONST_CDAY, & - SHR_CONST_RGAS - use clm_varpar , only: numrad, nlevgrnd, nlevlak -! -! !PUBLIC TYPES: - implicit none - save -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 27 February 2008: Keith Oleson; Add forcing height and aerodynamic parameters -! -!EOP -!----------------------------------------------------------------------- - - !------------------------------------------------------------------ - ! Initialize mathmatical constants - !------------------------------------------------------------------ - - real(r8) :: rpi = SHR_CONST_PI - - !------------------------------------------------------------------ - ! Initialize physical constants - !------------------------------------------------------------------ - - real(r8) :: grav = SHR_CONST_G !gravity constant [m/s2] - real(r8) :: sb = SHR_CONST_STEBOL !stefan-boltzmann constant [W/m2/K4] - real(r8) :: vkc = SHR_CONST_KARMAN !von Karman constant [-] - real(r8) :: rwat = SHR_CONST_RWV !gas constant for water vapor [J/(kg K)] - real(r8) :: rair = SHR_CONST_RDAIR !gas constant for dry air [J/kg/K] - real(r8) :: roverg = SHR_CONST_RWV/SHR_CONST_G*1000._r8 !Rw/g constant = (8.3144/0.018)/(9.80616)*1000. mm/K - real(r8) :: cpliq = SHR_CONST_CPFW !Specific heat of water [J/kg-K] - real(r8) :: cpice = SHR_CONST_CPICE !Specific heat of ice [J/kg-K] - real(r8) :: cpair = SHR_CONST_CPDAIR !specific heat of dry air [J/kg/K] - real(r8) :: hvap = SHR_CONST_LATVAP !Latent heat of evap for water [J/kg] - real(r8) :: hsub = SHR_CONST_LATSUB !Latent heat of sublimation [J/kg] - real(r8) :: hfus = SHR_CONST_LATICE !Latent heat of fusion for ice [J/kg] - real(r8) :: denh2o = SHR_CONST_RHOFW !density of liquid water [kg/m3] - real(r8) :: denice = SHR_CONST_RHOICE !density of ice [kg/m3] - real(r8) :: rgas = SHR_CONST_RGAS !universal gas constant [J/K/kmole] - real(r8) :: tkair = 0.023_r8 !thermal conductivity of air [W/m/K] - real(r8) :: tkice = 2.290_r8 !thermal conductivity of ice [W/m/K] - real(r8) :: tkwat = 0.6_r8 !thermal conductivity of water [W/m/K] - real(r8) :: tfrz = SHR_CONST_TKFRZ !freezing temperature [K] - real(r8) :: tcrit = 2.5_r8 !critical temperature to determine rain or snow - real(r8) :: o2_molar_const = 0.209_r8 !constant atmospheric O2 molar ratio (mol/mol) - - real(r8) :: bdsno = 250._r8 !bulk density snow (kg/m**3) - real(r8) :: alpha_aero = 1.0_r8 !constant for aerodynamic parameter weighting - real(r8) :: tlsai_crit = 2.0_r8 !critical value of elai+esai for which aerodynamic parameters are maximum - real(r8) :: watmin = 0.01_r8 !minimum soil moisture (mm) - - real(r8) :: re = SHR_CONST_REARTH*0.001_r8 !radius of earth (km) - - real(r8), public, parameter :: degpsec = 15._r8/3600.0_r8 ! Degree's earth rotates per second - - real(r8), public, parameter :: secspday= SHR_CONST_CDAY ! Seconds per day - integer, public, parameter :: isecspday= secspday ! Integer seconds per day - real(r8), public, parameter :: spval = 1.e36_r8 ! special value for real data - integer , public, parameter :: ispval = -9999 ! special value for int data - - ! These are tunable constants from clm2_3 - - real(r8) :: zlnd = 0.01_r8 !Roughness length for soil [m] - real(r8) :: zsno = 0.0024_r8 !Roughness length for snow [m] - real(r8) :: csoilc = 0.004_r8 !Drag coefficient for soil under canopy [-] - real(r8) :: capr = 0.34_r8 !Tuning factor to turn first layer T into surface T - real(r8) :: cnfac = 0.5_r8 !Crank Nicholson factor between 0 and 1 - real(r8) :: ssi = 0.033_r8 !Irreducible water saturation of snow - real(r8) :: wimp = 0.05_r8 !Water impremeable if porosity less than wimp - real(r8) :: pondmx = 10.0_r8 !Ponding depth (mm) - real(r8) :: pondmx_urban = 1.0_r8 !Ponding depth for urban roof and impervious road (mm) - ! 4/14/05: PET - ! Adding isotope code - real(r8), parameter :: preind_atm_del13c = -6.0 ! preindustrial value for atmospheric del13C - real(r8), parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0 ! 13C/12C - real(r8) :: c13ratio = preind_atm_ratio/(1.0+preind_atm_ratio) ! 13C/(12+13)C preind atmosphere - - real(r8), parameter :: ht_efficiency_factor = 0.75_r8 !efficiency factor for urban heating (-) - real(r8), parameter :: ac_efficiency_factor = 0.25_r8 !efficiency factor for urban air conditioning (-) - real(r8) :: ht_wasteheat_factor = 1.0_r8/ht_efficiency_factor !wasteheat factor for urban heating (-) - real(r8) :: ac_wasteheat_factor = 1.0_r8/ac_efficiency_factor !wasteheat factor for urban air conditioning (-) - real(r8) :: wasteheat_limit = 100._r8 !limit on wasteheat (W/m2) - - real(r8), parameter :: h2osno_max = 1000._r8 ! max allowed snow thickness (mm H2O) - real(r8), parameter :: lapse_glcmec = 0.006_r8 ! surface temperature lapse rate (deg m-1) - ! Pritchard et al. (GRL, 35, 2008) use 0.006 - - !------------------------------------------------------------------ - ! Initialize water type constants - !------------------------------------------------------------------ - - ! "land unit " types - ! 1 soil (includes vegetated landunits) - ! 2 land ice (glacier) - ! 3 deep lake - ! 4 shallow lake - ! 5 wetland (swamp, marsh, etc.) - ! 6 urban - ! 7 land ice (glacier) with multiple elevation classes - ! 8 crop - - integer :: istsoil = 1 !soil landunit type - integer :: istice = 2 !land ice landunit type - integer :: istdlak = 3 !deep lake landunit type - integer :: istslak = 4 !shallow lake landunit type - integer :: istwet = 5 !wetland landunit type - integer :: isturb = 6 !urban landunit type - integer :: istice_mec = 7 !land ice (multiple elevation classes) landunit type - integer :: istcrop = 8 !crop landunit type - integer :: max_lunit = 8 !maximum value that lun%itype can have - !(i.e., largest value in the above list) - - ! urban column types - - integer :: icol_roof = 61 - integer :: icol_sunwall = 62 - integer :: icol_shadewall = 63 - integer :: icol_road_imperv = 64 - integer :: icol_road_perv = 65 - - !------------------------------------------------------------------ - ! Initialize miscellaneous radiation constants - !------------------------------------------------------------------ - - integer, private :: i ! loop index - - real(r8), allocatable :: albsat(:,:) ! wet soil albedo by color class and waveband (1=vis,2=nir) - real(r8), allocatable :: albdry(:,:) ! dry soil albedo by color class and waveband (1=vis,2=nir) - - real(r8) :: alblak(numrad) ! albedo frozen lakes by waveband (1=vis, 2=nir) - data (alblak(i),i=1,numrad) /0.60_r8, 0.40_r8/ - - real(r8) :: betads = 0.5_r8 ! two-stream parameter betad for snow - real(r8) :: betais = 0.5_r8 ! two-stream parameter betai for snow - real(r8) :: omegas(numrad) ! two-stream parameter omega for snow by band - data (omegas(i),i=1,numrad) /0.8_r8, 0.4_r8/ - - !------------------------------------------------------------------ - ! Soil and Lake depths are constants for now - ! The values for the following arrays are set in routine iniTimeConst - !------------------------------------------------------------------ - - real(r8) :: zlak(1:nlevlak) !lake z (layers) - real(r8) :: dzlak(1:nlevlak) !lake dz (thickness) - real(r8) :: zsoi(1:nlevgrnd) !soil z (layers) - real(r8) :: dzsoi(1:nlevgrnd) !soil dz (thickness) - real(r8) :: zisoi(0:nlevgrnd) !soil zi (interfaces) - -end module clm_varcon diff --git a/src_clm40/main/clm_varctl.F90 b/src_clm40/main/clm_varctl.F90 deleted file mode 100644 index ec8466201b..0000000000 --- a/src_clm40/main/clm_varctl.F90 +++ /dev/null @@ -1,318 +0,0 @@ -module clm_varctl - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_varctl -! -! !DESCRIPTION: -! Module containing run control variables -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC MEMBER FUNCTIONS: - implicit none - public :: clm_varctl_set ! Set variables - public :: clmvarctl_init ! Initialize and check values after namelist input - - private - save -! -! !PUBLIC TYPES: -! - integer, parameter, private :: iundef = -9999999 - integer, parameter, private :: rundef = -9999999._r8 -! -! Run control variables -! - character(len=256), public :: caseid = ' ' ! case id - character(len=256), public :: ctitle = ' ' ! case title - integer, public :: nsrest = iundef ! Type of run - integer, public, parameter :: nsrStartup = 0 ! Startup from initial conditions - integer, public, parameter :: nsrContinue = 1 ! Continue from restart files - integer, public, parameter :: nsrBranch = 2 ! Branch from restart files - logical, public :: brnch_retain_casename = .false. ! true => allow case name to remain the same for branch run - ! by default this is not allowed - logical, public :: noland = .false. ! true => no valid land points -- do NOT run - character(len=256), public :: hostname = ' ' ! Hostname of machine running on - character(len=256), public :: username = ' ' ! username of user running program - character(len=256), public :: source = "Community Land Model CLM4.0" ! description of this source - character(len=256), public :: version = " " ! version of program - character(len=256), public :: conventions = "CF-1.0" ! dataset conventions -! -! Unit Numbers -! - integer, public :: iulog = 6 ! "stdout" log file unit number, default is 6 -! -! Output NetCDF files -! - logical, public :: outnc_large_files = .true. ! large file support for output NetCDF files -! -! Run input files -! - character(len=256), public :: finidat = ' ' ! initial conditions file name - character(len=256), public :: fsurdat = ' ' ! surface data file name - character(len=256), public :: fatmgrid = ' ' ! atm grid file name - character(len=256), public :: fatmlndfrc = ' ' ! lnd frac file on atm grid - character(len=256), public :: fatmtopo = ' ' ! topography on atm grid - character(len=256), public :: flndtopo = ' ' ! topography on lnd grid - character(len=256), public :: flanduse_timeseries = ' ' ! dynamic landuse dataset - character(len=256), public :: fpftcon = ' ' ! ASCII data file with PFT physiological constants - character(len=256), public :: nrevsn = ' ' ! restart data file name for branch run - character(len=256), public :: fsnowoptics = ' ' ! snow optical properties file name - character(len=256), public :: fsnowaging = ' ' ! snow aging parameters file name - -! -! Landunit logic -! - logical, public :: create_crop_landunit = .false. ! true => separate crop landunit is not created by default - logical, public :: allocate_all_vegpfts = .false. ! true => allocate memory for all possible vegetated pfts on - ! vegetated landunit if at least one pft has nonzero weight -! -! BGC logic and datasets -! - character(len=16), public :: co2_type = 'constant' ! values of 'prognostic','diagnostic','constant' -! -! Physics -! - logical, public :: wrtdia = .false. ! true => write global average diagnostics to std out - real(r8), public :: co2_ppmv = 355._r8 ! atmospheric CO2 molar ratio (by volume) (umol/mol) - - ! C isotopes - logical, public :: use_c13 = .false. ! true => use C-13 model - logical, public :: use_c14 = .false. ! true => use C-14 model - -! glacier_mec control variables: default values (may be overwritten by namelist) - - logical , public :: create_glacier_mec_landunit = .false. ! glacier_mec landunit is not created (set in controlMod) - logical , public :: glc_dyntopo = .false. ! true => CLM glacier topography changes dynamically - real(r8), public, allocatable :: glc_topomax(:) ! upper limit of each class (m) (set in surfrd) - character(len=256), public :: fglcmask = ' ' ! glacier mask file name -! -! single column control variables -! - logical, public :: single_column = .false. ! true => single column mode - real(r8), public :: scmlat = rundef ! single column lat - real(r8), public :: scmlon = rundef ! single column lon -! -! instance control -! - integer, public :: inst_index - character(len=16), public :: inst_name - character(len=16), public :: inst_suffix -! -! Decomp control variables -! - integer, public :: nsegspc = 20 ! number of segments per clump for decomp -! -! Derived variables (run, history and restart file) -! - character(len=256), public :: rpntdir = '.' ! directory name for local restart pointer file - character(len=256), public :: rpntfil = 'rpointer.lnd' ! file name for local restart pointer file -! -! Migration of CPP variables -! -#if (defined CN) - logical, public :: use_cn = .true. -#else - logical, public :: use_cn = .false. -#endif -#if (defined CNDV) - logical, public :: use_cndv = .true. -#else - logical, public :: use_cndv = .false. -#endif -#if (defined CROP) - logical, public :: use_crop = .true. -#else - logical, public :: use_crop = .false. -#endif -#if (defined SNICAR_FRC) - logical, public :: use_snicar_frc = .true. -#else - logical, public :: use_snicar_frc = .false. -#endif -#if (defined NOFIRE) - logical, public :: use_nofire = .true. -#else - logical, public :: use_nofire = .false. -#endif -#if (defined VANCOUVER) - logical, public :: use_vancouver = .true. -#else - logical, public :: use_vancouver = .false. -#endif -#if (defined MEXICOCITY) - logical, public :: use_mexicocity = .true. -#else - logical, public :: use_mexicocity = .false. -#endif -#if (defined AD_SPINUP) - logical, public :: use_ad_spinup = .true. -#else - logical, public :: use_ad_spinup = .false. -#endif -#if (defined EXIT_SPINUP) - logical, public :: use_exit_spinup = .true. -#else - logical, public :: use_exit_spinup = .false. -#endif - !needed for compatibility with changes in clm4_5 and reference dy lnd_comp_mct - !however use_voc is not used anywhere inside the clm4_0 code - logical, public :: use_voc = .true. -! -! !PRIVATE DATA MEMBERS: -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein and Gordon Bonan -! 1 June 2004, Peter Thornton: added fnedpdat for nitrogen deposition data -! -!EOP -!----------------------------------------------------------------------- - logical, private :: clmvarctl_isset = .false. - -!=============================================================== -contains -!=============================================================== - -!--------------------------------------------------------------------------- -!BOP -! -! !IROUTINE: clm_varctl_set -! -! !INTERFACE: - subroutine clm_varctl_set( caseid_in, ctitle_in, brnch_retain_casename_in, & - single_column_in, scmlat_in, scmlon_in, nsrest_in, & - version_in, hostname_in, username_in) -! -! !DESCRIPTION: -! Set input control variables. -! -! !USES: - use shr_sys_mod, only : shr_sys_abort -! -! !ARGUMENTS: - character(len=256), optional, intent(IN) :: caseid_in ! case id - character(len=256), optional, intent(IN) :: ctitle_in ! case title - logical, optional, intent(IN) :: brnch_retain_casename_in ! true => allow case name to remain the same for branch run - logical, optional, intent(IN) :: single_column_in ! true => single column mode - real(r8), optional, intent(IN) :: scmlat_in ! single column lat - real(r8), optional, intent(IN) :: scmlon_in ! single column lon - integer, optional, intent(IN) :: nsrest_in ! 0: initial run. 1: restart: 3: branch - character(len=256), optional, intent(IN) :: version_in ! model version - character(len=256), optional, intent(IN) :: hostname_in ! hostname running on - character(len=256), optional, intent(IN) :: username_in ! username running job - -! -! !LOCAL VARIABLES: - character(len=32) :: subname = 'clm_varctl_set' ! subroutine name -! -! !REVISION HISTORY: -! Author: Erik Kluzek -! -!EOP -!----------------------------------------------------------------------- - if ( clmvarctl_isset )then - call shr_sys_abort( subname//' ERROR:: control variables already set -- can not call this subroutine' ) - end if - if ( present(caseid_in ) ) caseid = caseid_in - if ( present(ctitle_in ) ) ctitle = ctitle_in - if ( present(single_column_in) ) single_column = single_column_in - if ( present(scmlat_in ) ) scmlat = scmlat_in - if ( present(scmlon_in ) ) scmlon = scmlon_in - if ( present(nsrest_in ) ) nsrest = nsrest_in - if ( present(brnch_retain_casename_in) ) brnch_retain_casename = brnch_retain_casename_in - if ( present(version_in ) ) version = version_in - if ( present(username_in ) ) username = username_in - if ( present(hostname_in ) ) hostname = hostname_in - - end subroutine clm_varctl_set - -!--------------------------------------------------------------------------- -!BOP -! -! !IROUTINE: clmvarctl_init -! -! !INTERFACE: - subroutine clmvarctl_init( masterproc, dtime ) -! -! !DESCRIPTION: -! Check that values are correct, and finish setting variables based on other variables. -! -! !USES: - use shr_sys_mod , only : shr_sys_abort - use clm_varpar , only : maxpatch_pft, numpft -! -! !ARGUMENTS: - logical, intent(IN) :: masterproc ! proc 0 logical for printing msgs - integer, intent(IN) :: dtime ! timestep in seconds -! -! !LOCAL VARIABLES: - character(len=32) :: subname = 'clmvarctl_init' ! subroutine name -! -! !REVISION HISTORY: -! Author: Erik Kluzek -! -!EOP -!----------------------------------------------------------------------- - - ! landunit generation - - if (maxpatch_pft == numpft+1) then - allocate_all_vegpfts = .true. - else - allocate_all_vegpfts = .false. - if (use_crop) then - write(iulog,*)'maxpatch_pft = ',maxpatch_pft,& - ' does NOT equal numpft+1 = ',numpft+1 - call shr_sys_abort( subname//' ERROR:: Can NOT turn CROP on without all PFTs' ) - end if - end if - - if (masterproc) then - - ! Consistency settings for co2 type - - if (co2_type /= 'constant' .and. co2_type /= 'prognostic' .and. co2_type /= 'diagnostic') then - write(iulog,*)'co2_type = ',co2_type,' is not supported' - call shr_sys_abort( subname//' ERROR:: choices are constant, prognostic or diagnostic' ) - end if - - ! Consistency settings for dynamic land use, etc. - - if (flanduse_timeseries /= ' ' .and. create_crop_landunit) & - call shr_sys_abort( subname//' ERROR:: dynamic landuse is currently not supported with create_crop_landunit option' ) - if (create_crop_landunit .and. .not.allocate_all_vegpfts) & - call shr_sys_abort( subname//' ERROR:: maxpft 3000.0_r8) ) & - call shr_sys_abort( subname//' ERROR: co2_ppmv is out of a reasonable range' ) - - if (nsrest == nsrStartup ) nrevsn = ' ' - if (nsrest == nsrContinue) nrevsn = 'set by restart pointer file file' - if (nsrest /= nsrStartup .and. nsrest /= nsrContinue .and. nsrest /= nsrBranch ) & - call shr_sys_abort( subname//' ERROR: nsrest NOT set to a valid value' ) - - if ( single_column .and. (scmlat == rundef .or. scmlon == rundef ) ) & - call shr_sys_abort( subname//' ERROR:: single column mode on -- but scmlat and scmlon are NOT set' ) - - endif ! end of if-masterproc if-block - - clmvarctl_isset = .true. - - end subroutine clmvarctl_init - -end module clm_varctl diff --git a/src_clm40/main/clm_varorb.F90 b/src_clm40/main/clm_varorb.F90 deleted file mode 100644 index 47bf51e576..0000000000 --- a/src_clm40/main/clm_varorb.F90 +++ /dev/null @@ -1,17 +0,0 @@ - -module clm_varorb - - use shr_kind_mod , only: r8 => shr_kind_r8 - implicit none - - ! Orbital information needed as input to orbit_parms - - real(r8) :: eccen ! Earth's eccentricity factor (unitless) (typically 0 to 0.1) - - ! Orbital information after processed by orbit_params - - real(r8) :: obliqr ! Earth's obliquity in radians - real(r8) :: lambm0 ! Mean longitude of perihelion at the vernal equinox (radians) - real(r8) :: mvelpp ! Earth's moving vernal equinox longitude of perihelion plus pi (radians) - -end module clm_varorb diff --git a/src_clm40/main/clm_varpar.F90 b/src_clm40/main/clm_varpar.F90 deleted file mode 100644 index 252569e385..0000000000 --- a/src_clm40/main/clm_varpar.F90 +++ /dev/null @@ -1,118 +0,0 @@ -module clm_varpar - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_varpar -! -! !DESCRIPTION: -! Module containing CLM parameters -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! ------------------------------------------------------- -! Module Parameters -! ------------------------------------------------------- - -! Note - model resolution is read in from the surface dataset - - integer, parameter :: nlevsoi = 10 ! number of hydrologically active soil layers - integer, parameter :: nlevgrnd = 15 ! number of ground layers (includes lower layers that are hydrologically inactive) - integer, parameter :: nlevurb = nlevgrnd! number of urban layers (must equal nlevgrnd right now) - integer, parameter :: nlevlak = 10 ! number of lake layers - integer, parameter :: nlevsno = 5 ! maximum number of snow layers - integer, parameter :: numwat = 5 ! number of water types (soil, ice, 2 lakes, wetland) - integer, parameter :: numrad = 2 ! number of solar radiation bands: vis, nir - integer, parameter :: ivis = 1 ! index for visible band - integer, parameter :: inir = 2 ! index for near-infrared band - integer, parameter :: numsolar = 2 ! number of solar type bands: direct, diffuse - integer, parameter :: ndst = 4 ! number of dust size classes (BGC only) - integer, parameter :: dst_src_nbr = 3 ! number of size distns in src soil (BGC only) - integer, parameter :: sz_nbr = 200 ! number of sub-grid bins in large bin of dust size distribution (BGC only) - integer, parameter :: mxpft = 20 ! maximum number of PFT's for any mode - integer, parameter :: numveg = 16 ! number of veg types (without specific crop) -#if (defined CROP) - integer, parameter :: numpft = mxpft ! actual # of pfts (without bare) - integer, parameter :: numcft = 6 ! actual # of crops -#else - integer, parameter :: numpft = numveg ! actual # of pfts (without bare) - integer, parameter :: numcft = 2 ! actual # of crops -#endif - integer, parameter :: maxpatch_pft= MAXPATCH_PFT ! max number of plant functional types in naturally vegetated landunit - -! ------------------------------------------------------- -! Module Varaibles (initialized in clm_varpar_init) -! ------------------------------------------------------- - -! Indices used in surface file read and set in clm_varpar_init - - integer :: maxpatch ! max number of patches - integer :: maxpatch_glcmec ! max number of elevation classes - integer :: maxpatch_urb ! max number of urban pfts (columns) in urban landunit - integer :: npatch_urban ! number of urban pfts (columns) in urban landunit - integer :: npatch_lake ! number of lake pfts (columns) in lake landunit - integer :: npatch_wet ! number of wetland pfts (columns) in wetland landunit - integer :: npatch_glacier ! number of glacier pfts (columns) in glacier landunit - integer :: npatch_glacier_mec ! number of glacier_mec pfts (columns) in glacier_mec landunit - integer :: max_pft_per_gcell - integer :: max_pft_per_lu - integer :: max_pft_per_col - -! !PUBLIC MEMBER FUNCTIONS: - public clm_varpar_init ! set parameters - -! !REVISION HISTORY: -! Created by Mariana Vertenstein - -!EOP -!----------------------------------------------------------------------- -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: clm_varpar_init -! -! !INTERFACE: - subroutine clm_varpar_init() -! -! !DESCRIPTION: -! This subroutine initializes parameters in clm_varpar -! -! !USES: -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by T Craig -! -! !LOCAL VARIABLES: -! -!EOP -!------------------------------------------------------------------------------ - - maxpatch_urb = 5 - npatch_urban = maxpatch_pft + 1 - npatch_lake = npatch_urban + maxpatch_urb - npatch_wet = npatch_lake + 1 - npatch_glacier = npatch_wet + 1 - npatch_glacier_mec = npatch_glacier + maxpatch_glcmec - maxpatch = npatch_glacier_mec - - max_pft_per_gcell = numpft+1 + 3 + maxpatch_urb + maxpatch_glcmec -#if (defined CROP) - max_pft_per_gcell = max_pft_per_gcell + numcft -#endif - max_pft_per_lu = max(numpft+1, numcft, maxpatch_urb) - max_pft_per_col = max(numpft+1, numcft, maxpatch_urb) - - end subroutine clm_varpar_init - -!------------------------------------------------------------------------------ -end module clm_varpar diff --git a/src_clm40/main/clm_varsur.F90 b/src_clm40/main/clm_varsur.F90 deleted file mode 100644 index 3ff2162c14..0000000000 --- a/src_clm40/main/clm_varsur.F90 +++ /dev/null @@ -1,37 +0,0 @@ - -module clm_varsur - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clm_varsur -! -! !DESCRIPTION: -! Module containing 2-d surface boundary data information -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - save -! -! land model grid - moved to domainMod -! -! surface boundary data, these are all "gdc" local -! - integer , allocatable :: vegxy(:,:) ! vegetation type - real(r8), allocatable,target :: wtxy(:,:) ! subgrid weights - - real(r8),allocatable :: pctspec(:) ! percent of spec lunits wrt gcell - - real(r8), allocatable,target :: topoxy(:,:) ! subgrid glacier_mec sfc elevation -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 2005-11-01 Moved grid to domainMod, T Craig -! -!EOP -!----------------------------------------------------------------------- - -end module clm_varsur diff --git a/src_clm40/main/clmtype.F90 b/src_clm40/main/clmtype.F90 deleted file mode 100644 index 0498100222..0000000000 --- a/src_clm40/main/clmtype.F90 +++ /dev/null @@ -1,1991 +0,0 @@ -module clmtype - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clmtype -! -! !DESCRIPTION: -! Define derived type hierarchy. Includes declaration of -! the clm derived type and 1d mapping arrays. -! -! -------------------------------------------------------- -! gridcell types can have values of -! -------------------------------------------------------- -! 1 => default -! -------------------------------------------------------- -! landunits types can have values of (see clm_varcon.F90) -! -------------------------------------------------------- -! 1 => (istsoil) soil (vegetated or bare soil landunit) -! 2 => (istice) land ice -! 3 => (istdlak) deep lake -! 4 => (istslak) shallow lake (not currently implemented) -! 5 => (istwet) wetland -! 6 => (isturb) urban -! 7 => (istice_mec) land ice (multiple elevation classes) -! 8 => (istcrop) crop (only for crop configuration) -! -------------------------------------------------------- -! column types can have values of -! -------------------------------------------------------- -! 1 => (istsoil) soil (vegetated or bare soil) -! 2 => (istice) land ice -! 3 => (istdlak) deep lake -! 4 => (istslak) shallow lake -! 5 => (istwet) wetland -! 7 => (istice_mec) land ice (multiple elevation classes) -! 61 => (icol_roof) urban roof -! 62 => (icol_sunwall) urban sunwall -! 63 => (icol_shadewall) urban shadewall -! 64 => (icol_road_imperv) urban impervious road -! 65 => (icol_road_perv) urban pervious road -! -------------------------------------------------------- -! pft types can have values of -! -------------------------------------------------------- -! 0 => not vegetated -! 1 => needleleaf evergreen temperate tree -! 2 => needleleaf evergreen boreal tree -! 3 => needleleaf deciduous boreal tree -! 4 => broadleaf evergreen tropical tree -! 5 => broadleaf evergreen temperate tree -! 6 => broadleaf deciduous tropical tree -! 7 => broadleaf deciduous temperate tree -! 8 => broadleaf deciduous boreal tree -! 9 => broadleaf evergreen shrub -! 10 => broadleaf deciduous temperate shrub -! 11 => broadleaf deciduous boreal shrub -! 12 => c3 arctic grass -! 13 => c3 non-arctic grass -! 14 => c4 grass -! 15 => c3_crop -! 16 => c3_irrigated -! 17 => corn -! 18 => spring temperate cereal -! 19 => winter temperate cereal -! 20 => soybean -! -------------------------------------------------------- -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use domainMod , only: domain_type -! -! !PUBLIC TYPES: - implicit none - - public -! -! !REVISION HISTORY: -! Created by Peter Thornton and Mariana Vertenstein -! -!******************************************************************************* -!---------------------------------------------------- -! Begin definition of conservation check structures -!---------------------------------------------------- -! energy balance structure -!---------------------------------------------------- -type, public :: energy_balance_type - real(r8), pointer :: errsoi(:) !soil/lake energy conservation error (W/m**2) - real(r8), pointer :: errseb(:) !surface energy conservation error (W/m**2) - real(r8), pointer :: errsol(:) !solar radiation conservation error (W/m**2) - real(r8), pointer :: errlon(:) !longwave radiation conservation error (W/m**2) -end type energy_balance_type - -type(energy_balance_type) :: pebal !energy balance structure -type(energy_balance_type) :: cebal !energy balance structure - -!---------------------------------------------------- -! water balance structure -!---------------------------------------------------- -type, public :: water_balance_type - real(r8), pointer :: begwb(:) !water mass begining of the time step - real(r8), pointer :: endwb(:) !water mass end of the time step - real(r8), pointer :: errh2o(:) !water conservation error (mm H2O) -end type water_balance_type - -type(water_balance_type) :: pwbal !water balance structure -type(water_balance_type) :: cwbal !water balance structure - -!---------------------------------------------------- -! carbon balance structure -!---------------------------------------------------- -type, public :: carbon_balance_type - real(r8), pointer :: begcb(:) !carbon mass, beginning of time step (gC/m**2) - real(r8), pointer :: endcb(:) !carbon mass, end of time step (gC/m**2) - real(r8), pointer :: errcb(:) !carbon balance error for the timestep (gC/m**2) -end type carbon_balance_type - -type(carbon_balance_type) :: pcbal !carbon balance structure -type(carbon_balance_type) :: ccbal !carbon balance structure - -!---------------------------------------------------- -! nitrogen balance structure -!---------------------------------------------------- -type, public :: nitrogen_balance_type - real(r8), pointer :: begnb(:) !nitrogen mass, beginning of time step (gN/m**2) - real(r8), pointer :: endnb(:) !nitrogen mass, end of time step (gN/m**2) - real(r8), pointer :: errnb(:) !nitrogen balance error for the timestep (gN/m**2) -end type nitrogen_balance_type - -type(nitrogen_balance_type) :: pnbal !nitrogen balance structure -type(nitrogen_balance_type) :: cnbal !nitrogen balance structure - -!---------------------------------------------------- -! End definition of conservation check structures -!---------------------------------------------------- -!******************************************************************************* - -!******************************************************************************* -!---------------------------------------------------- -! Begin definition of structures defined at the pft_type level -!---------------------------------------------------- -! pft physical state variables structure -!---------------------------------------------------- -type, public :: pft_pstate_type - integer , pointer :: frac_veg_nosno(:) !fraction of vegetation not covered by snow (0 OR 1) [-] - integer , pointer :: frac_veg_nosno_alb(:) !fraction of vegetation not covered by snow (0 OR 1) [-] - real(r8), pointer :: emv(:) !vegetation emissivity - real(r8), pointer :: z0mv(:) !roughness length over vegetation, momentum [m] - real(r8), pointer :: z0hv(:) !roughness length over vegetation, sensible heat [m] - real(r8), pointer :: z0qv(:) !roughness length over vegetation, latent heat [m] - real(r8), pointer :: rootfr(:,:) !fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rootr(:,:) !effective fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rresis(:,:) !root resistance by layer (0-1) (nlevgrnd) - real(r8), pointer :: dewmx(:) !Maximum allowed dew [mm] - real(r8), pointer :: rssun(:) !sunlit stomatal resistance (s/m) - real(r8), pointer :: rssha(:) !shaded stomatal resistance (s/m) - real(r8), pointer :: laisun(:) !sunlit projected leaf area index - real(r8), pointer :: laisha(:) !shaded projected leaf area index - real(r8), pointer :: btran(:) !transpiration wetness factor (0 to 1) - real(r8), pointer :: fsun(:) !sunlit fraction of canopy - real(r8), pointer :: tlai(:) !one-sided leaf area index, no burying by snow - real(r8), pointer :: tsai(:) !one-sided stem area index, no burying by snow - real(r8), pointer :: elai(:) !one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) !one-sided stem area index with burying by snow - real(r8), pointer :: fwet(:) !fraction of canopy that is wet (0 to 1) - real(r8), pointer :: fdry(:) !fraction of foliage that is green and dry [-] (new) - real(r8), pointer :: dt_veg(:) !change in t_veg, last iteration (Kelvin) - real(r8), pointer :: htop(:) !canopy top (m) - real(r8), pointer :: hbot(:) !canopy bottom (m) - real(r8), pointer :: z0m(:) !momentum roughness length (m) - real(r8), pointer :: displa(:) !displacement height (m) - real(r8), pointer :: albd(:,:) !surface albedo (direct) (numrad) - real(r8), pointer :: albi(:,:) !surface albedo (indirect) (numrad) - real(r8), pointer :: fabd(:,:) !flux absorbed by veg per unit direct flux (numrad) - real(r8), pointer :: fabi(:,:) !flux absorbed by veg per unit diffuse flux (numrad) - real(r8), pointer :: ftdd(:,:) !down direct flux below veg per unit dir flx (numrad) - real(r8), pointer :: ftid(:,:) !down diffuse flux below veg per unit dir flx (numrad) - real(r8), pointer :: ftii(:,:) !down diffuse flux below veg per unit dif flx (numrad) - real(r8), pointer :: u10(:) !10-m wind (m/s) (for dust model) - real(r8), pointer :: u10_clm(:) !10-m wind (m/s) - real(r8), pointer :: va(:) !atmospheric wind speed plus convective velocity (m/s) - real(r8), pointer :: ram1(:) !aerodynamical resistance (s/m) - real(r8), pointer :: fv(:) !friction velocity (m/s) (for dust model) - real(r8), pointer :: forc_hgt_u_pft(:) !wind forcing height (10m+z0m+d) (m) - real(r8), pointer :: forc_hgt_t_pft(:) !temperature forcing height (10m+z0m+d) (m) - real(r8), pointer :: forc_hgt_q_pft(:) !specific humidity forcing height (10m+z0m+d) (m) - ! Variables for prognostic crop model - real(r8), pointer :: hdidx(:) ! cold hardening index? - real(r8), pointer :: cumvd(:) ! cumulative vernalization d?ependence? - real(r8), pointer :: htmx(:) ! max hgt attained by a crop during yr (m) - real(r8), pointer :: vf(:) ! vernalization factor for cereal - real(r8), pointer :: gddmaturity(:) ! growing degree days (gdd) needed to harvest (ddays) - real(r8), pointer :: gdd0(:) ! growing degree-days base 0C from planting (ddays) - real(r8), pointer :: gdd8(:) ! growing degree-days base 8C from planting (ddays) - real(r8), pointer :: gdd10(:) ! growing degree-days base 10C from planting (ddays) - real(r8), pointer :: gdd020(:) ! 20-year average of gdd0 (ddays) - real(r8), pointer :: gdd820(:) ! 20-year average of gdd8 (ddays) - real(r8), pointer :: gdd1020(:) ! 20-year average of gdd10 (ddays) - real(r8), pointer :: gddplant(:) ! accum gdd past planting date for crop (ddays) - real(r8), pointer :: gddtsoi(:) ! growing degree-days from planting (top two soil layers) (ddays) - real(r8), pointer :: huileaf(:) ! heat unit index needed from planting to leaf emergence - real(r8), pointer :: huigrain(:) ! heat unit index needed to reach vegetative maturity - real(r8), pointer :: aleafi(:) ! saved leaf allocation coefficient from phase 2 - real(r8), pointer :: astemi(:) ! saved stem allocation coefficient from phase 2 - real(r8), pointer :: aleaf(:) ! leaf allocation coefficient - real(r8), pointer :: astem(:) ! stem allocation coefficient - logical , pointer :: croplive(:) ! Flag, true if planted, not harvested - logical , pointer :: cropplant(:) ! Flag, true if planted - integer , pointer :: harvdate(:) ! harvest date - ! cropplant and harvdate could be 2D to facilitate rotation - integer , pointer :: idop(:) ! date of planting - integer , pointer :: peaklai(:) ! 1: max allowed lai; 0: not at max - real(r8), pointer :: vds(:) !deposition velocity term (m/s) (for dry dep SO4, NH4NO3) - ! new variables for CN code - real(r8), pointer :: slasun(:) !specific leaf area for sunlit canopy, projected area basis (m^2/gC) - real(r8), pointer :: slasha(:) !specific leaf area for shaded canopy, projected area basis (m^2/gC) - real(r8), pointer :: lncsun(:) !leaf N concentration per unit projected LAI (gN leaf/m^2) - real(r8), pointer :: lncsha(:) !leaf N concentration per unit projected LAI (gN leaf/m^2) - real(r8), pointer :: vcmxsun(:) !sunlit leaf Vcmax (umolCO2/m^2/s) - real(r8), pointer :: vcmxsha(:) !shaded leaf Vcmax (umolCO2/m^2/s) - real(r8), pointer :: gdir(:) !leaf projection in solar direction (0 to 1) - real(r8), pointer :: omega(:,:) !fraction of intercepted radiation that is scattered (0 to 1) - real(r8), pointer :: eff_kid(:,:) !effective extinction coefficient for indirect from direct - real(r8), pointer :: eff_kii(:,:) !effective extinction coefficient for indirect from indirect - real(r8), pointer :: sun_faid(:,:) !fraction sun canopy absorbed indirect from direct - real(r8), pointer :: sun_faii(:,:) !fraction sun canopy absorbed indirect from indirect - real(r8), pointer :: sha_faid(:,:) !fraction shade canopy absorbed indirect from direct - real(r8), pointer :: sha_faii(:,:) !fraction shade canopy absorbed indirect from indirect - real(r8), pointer :: cisun(:) !sunlit intracellular CO2 (Pa) - real(r8), pointer :: cisha(:) !shaded intracellular CO2 (Pa) - real(r8), pointer :: alphapsnsun(:) !sunlit 13c fractionation ([]) - real(r8), pointer :: alphapsnsha(:) !shaded 13c fractionation ([]) - real(r8), pointer :: sandfrac(:) ! sand fraction - real(r8), pointer :: clayfrac(:) ! clay fraction - ! for dry deposition of chemical tracers - real(r8), pointer :: mlaidiff(:) ! difference between lai month one and month two - real(r8), pointer :: rb1(:) ! aerodynamical resistance (s/m) - real(r8), pointer :: annlai(:,:) ! 12 months of monthly lai from input data set -end type pft_pstate_type - -type(pft_pstate_type) :: pps !physical state variables -type(pft_pstate_type) :: pps_a !pft-level pstate variables averaged to the column - -!---------------------------------------------------- -! pft ecophysiological constants structure -!---------------------------------------------------- -type, public :: pft_epc_type - integer , pointer :: noveg(:) !value for not vegetated - integer , pointer :: tree(:) !tree or not? - real(r8), pointer :: smpso(:) !soil water potential at full stomatal opening (mm) - real(r8), pointer :: smpsc(:) !soil water potential at full stomatal closure (mm) - real(r8), pointer :: fnitr(:) !foliage nitrogen limitation factor (-) - real(r8), pointer :: foln(:) !foliage nitrogen (%) - real(r8), pointer :: dleaf(:) !characteristic leaf dimension (m) - real(r8), pointer :: c3psn(:) !photosynthetic pathway: 0. = c4, 1. = c3 - real(r8), pointer :: mp(:) !slope of conductance-to-photosynthesis relationship - real(r8), pointer :: qe25(:) !quantum efficiency at 25C (umol CO2 / umol photon) - real(r8), pointer :: xl(:) !leaf/stem orientation index - real(r8), pointer :: rhol(:,:) !leaf reflectance: 1=vis, 2=nir (numrad) - real(r8), pointer :: rhos(:,:) !stem reflectance: 1=vis, 2=nir (numrad) - real(r8), pointer :: taul(:,:) !leaf transmittance: 1=vis, 2=nir (numrad) - real(r8), pointer :: taus(:,:) !stem transmittance: 1=vis, 2=nir (numrad) - real(r8), pointer :: z0mr(:) !ratio of momentum roughness length to canopy top height (-) - real(r8), pointer :: displar(:) !ratio of displacement height to canopy top height (-) - real(r8), pointer :: roota_par(:) !CLM rooting distribution parameter [1/m] - real(r8), pointer :: rootb_par(:) !CLM rooting distribution parameter [1/m] - real(r8), pointer :: sla(:) !specific leaf area [m2 leaf g-1 carbon] - ! new variables for CN code - real(r8), pointer :: dwood(:) !wood density (gC/m3) - real(r8), pointer :: slatop(:) !specific leaf area at top of canopy, projected area basis [m^2/gC] - real(r8), pointer :: dsladlai(:) !dSLA/dLAI, projected area basis [m^2/gC] - real(r8), pointer :: leafcn(:) !leaf C:N (gC/gN) - real(r8), pointer :: flnr(:) !fraction of leaf N in the Rubisco enzyme (gN Rubisco / gN leaf) - real(r8), pointer :: woody(:) !binary flag for woody lifeform (1=woody, 0=not woody) - real(r8), pointer :: lflitcn(:) !leaf litter C:N (gC/gN) - real(r8), pointer :: frootcn(:) !fine root C:N (gC/gN) - real(r8), pointer :: livewdcn(:) !live wood (phloem and ray parenchyma) C:N (gC/gN) - real(r8), pointer :: deadwdcn(:) !dead wood (xylem and heartwood) C:N (gC/gN) - real(r8), pointer :: graincn(:) !grain C:N (gC/gN) for prognostic crop model - real(r8), pointer :: froot_leaf(:) !allocation parameter: new fine root C per new leaf C (gC/gC) - real(r8), pointer :: stem_leaf(:) !allocation parameter: new stem c per new leaf C (gC/gC) - real(r8), pointer :: croot_stem(:) !allocation parameter: new coarse root C per new stem C (gC/gC) - real(r8), pointer :: flivewd(:) !allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - real(r8), pointer :: fcur(:) !allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - real(r8), pointer :: lf_flab(:) !leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) !leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) !leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) !fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) !fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) !fine root litter lignin fraction - real(r8), pointer :: leaf_long(:) !leaf longevity (yrs) - real(r8), pointer :: evergreen(:) !binary flag for evergreen leaf habit (0 or 1) - real(r8), pointer :: stress_decid(:) !binary flag for stress-deciduous leaf habit (0 or 1) - real(r8), pointer :: season_decid(:) !binary flag for seasonal-deciduous leaf habit (0 or 1) - ! new variables for fire code - real(r8), pointer :: resist(:) !resistance to fire (no units) -end type pft_epc_type - -type(pft_epc_type), public, target, save :: pftcon - -!---------------------------------------------------- -! pft DGVM-specific ecophysiological constants structure -!---------------------------------------------------- -type, public :: pft_dgvepc_type - real(r8), pointer :: crownarea_max(:) !tree maximum crown area [m2] - real(r8), pointer :: tcmin(:) !minimum coldest monthly mean temperature [units?] - real(r8), pointer :: tcmax(:) !maximum coldest monthly mean temperature [units?] - real(r8), pointer :: gddmin(:) !minimum growing degree days (at or above 5 C) - real(r8), pointer :: twmax(:) !upper limit of temperature of the warmest month [units?] - real(r8), pointer :: reinickerp(:) !parameter in allometric equation - real(r8), pointer :: allom1(:) !parameter in allometric - real(r8), pointer :: allom2(:) !parameter in allometric - real(r8), pointer :: allom3(:) !parameter in allometric -end type pft_dgvepc_type - -type(pft_dgvepc_type), public, target, save :: dgv_pftcon - -!---------------------------------------------------- -! pft ecophysiological variables structure -!---------------------------------------------------- -type, public :: pft_epv_type - real(r8), pointer :: dormant_flag(:) !dormancy flag - real(r8), pointer :: days_active(:) !number of days since last dormancy - real(r8), pointer :: onset_flag(:) !onset flag - real(r8), pointer :: onset_counter(:) !onset days counter - real(r8), pointer :: onset_gddflag(:) !onset flag for growing degree day sum - real(r8), pointer :: onset_fdd(:) !onset freezing degree days counter - real(r8), pointer :: onset_gdd(:) !onset growing degree days - real(r8), pointer :: onset_swi(:) !onset soil water index - real(r8), pointer :: offset_flag(:) !offset flag - real(r8), pointer :: offset_counter(:) !offset days counter - real(r8), pointer :: offset_fdd(:) !offset freezing degree days counter - real(r8), pointer :: offset_swi(:) !offset soil water index - real(r8), pointer :: lgsf(:) !long growing season factor [0-1] - real(r8), pointer :: bglfr(:) !background litterfall rate (1/s) - real(r8), pointer :: bgtr(:) !background transfer growth rate (1/s) - real(r8), pointer :: dayl(:) !daylength (seconds) - real(r8), pointer :: prev_dayl(:) !daylength from previous timestep (seconds) - real(r8), pointer :: annavg_t2m(:) !annual average 2m air temperature (K) - real(r8), pointer :: tempavg_t2m(:) !temporary average 2m air temperature (K) - real(r8), pointer :: gpp(:) !GPP flux before downregulation (gC/m2/s) - real(r8), pointer :: availc(:) !C flux available for allocation (gC/m2/s) - real(r8), pointer :: xsmrpool_recover(:) !C flux assigned to recovery of negative cpool (gC/m2/s) - real(r8), pointer :: xsmrpool_c13ratio(:) !C13/C(12+13) ratio for xsmrpool (proportion) - real(r8), pointer :: alloc_pnow(:) !fraction of current allocation to display as new growth (DIM) - real(r8), pointer :: c_allometry(:) !C allocation index (DIM) - real(r8), pointer :: n_allometry(:) !N allocation index (DIM) - real(r8), pointer :: plant_ndemand(:) !N flux required to support initial GPP (gN/m2/s) - real(r8), pointer :: tempsum_potential_gpp(:)!temporary annual sum of potential GPP - real(r8), pointer :: annsum_potential_gpp(:) !annual sum of potential GPP - real(r8), pointer :: tempmax_retransn(:) !temporary annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: annmax_retransn(:) !annual max of retranslocated N pool (gN/m2) - real(r8), pointer :: avail_retransn(:) !N flux available from retranslocation pool (gN/m2/s) - real(r8), pointer :: plant_nalloc(:) !total allocated N flux (gN/m2/s) - real(r8), pointer :: plant_calloc(:) !total allocated C flux (gC/m2/s) - real(r8), pointer :: excess_cflux(:) !C flux not allocated due to downregulation (gC/m2/s) - real(r8), pointer :: downreg(:) !fractional reduction in GPP due to N limitation (DIM) - real(r8), pointer :: prev_leafc_to_litter(:) !previous timestep leaf C litterfall flux (gC/m2/s) - real(r8), pointer :: prev_frootc_to_litter(:)!previous timestep froot C litterfall flux (gC/m2/s) - real(r8), pointer :: tempsum_npp(:) !temporary annual sum of NPP (gC/m2/yr) - real(r8), pointer :: annsum_npp(:) !annual sum of NPP (gC/m2/yr) - real(r8), pointer :: tempsum_litfall(:) !temporary annual sum of litfall (gC/m2/yr) - real(r8), pointer :: annsum_litfall(:) !annual sum of litfall (gC/m2/yr) - real(r8), pointer :: rc13_canair(:) !C13O2/C12O2 in canopy air - real(r8), pointer :: rc13_psnsun(:) !C13O2/C12O2 in sunlit canopy psn flux - real(r8), pointer :: rc13_psnsha(:) !C13O2/C12O2 in shaded canopy psn flux -end type pft_epv_type - -type(pft_epv_type) :: pepv !pft ecophysiological variables - -!---------------------------------------------------- -! pft energy state variables structure -!---------------------------------------------------- -type, public :: pft_estate_type - real(r8), pointer :: t_ref2m(:) !2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_min(:) !daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max(:) !daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst(:) !instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst(:) !instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: q_ref2m(:) !2 m height surface specific humidity (kg/kg) - real(r8), pointer :: t_ref2m_u(:) !Urban 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_r(:) !Rural 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_min_u(:) !Urban daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_r(:) !Rural daily minimum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_u(:) !Urban daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_max_r(:) !Rural daily maximum of average 2 m height surface air temperature (K) - real(r8), pointer :: t_ref2m_min_inst_u(:) !Urban instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_min_inst_r(:) !Rural instantaneous daily min of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_u(:) !Urban instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: t_ref2m_max_inst_r(:) !Rural instantaneous daily max of average 2 m height surface air temp (K) - real(r8), pointer :: a10tmin(:) ! 10-day running mean of min 2-m temperature - real(r8), pointer :: a5tmin(:) ! 5-day running mean of min 2-m temperature - real(r8), pointer :: t10(:) !10-day running mean of the 2 m temperature (K) - real(r8), pointer :: rh_ref2m(:) !2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m_u(:) !Urban 2 m height surface relative humidity (%) - real(r8), pointer :: rh_ref2m_r(:) !Rural 2 m height surface relative humidity (%) - real(r8), pointer :: t_veg(:) !vegetation temperature (Kelvin) - real(r8), pointer :: thm(:) !intermediate variable (forc_t+0.0098*forc_hgt_t_pft) -end type pft_estate_type - -type(pft_estate_type) :: pes !pft energy state - -!---------------------------------------------------- -! pft water state variables structure -!---------------------------------------------------- -type, public :: pft_wstate_type - real(r8), pointer :: h2ocan(:) !canopy water (mm H2O) -end type pft_wstate_type - -type(pft_wstate_type) :: pws !pft water state - -!---------------------------------------------------- -! pft carbon state variables structure -!---------------------------------------------------- -type, public :: pft_cstate_type - real(r8), pointer :: leafcmax(:) ! (gC/m2) ann max leaf C - ! variables for prognostic crop model - real(r8), pointer :: grainc(:) ! (gC/m2) grain C - real(r8), pointer :: grainc_storage(:) ! (gC/m2) grain C storage - real(r8), pointer :: grainc_xfer(:) ! (gC/m2) grain C transfer - ! - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: cpool(:) ! (gC/m2) temporary photosynthate C pool - real(r8), pointer :: xsmrpool(:) ! (gC/m2) abstract C pool to meet excess MR demand - real(r8), pointer :: pft_ctrunc(:) ! (gC/m2) pft-level sink for C truncation - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: dispvegc(:) ! (gC/m2) displayed veg carbon, excluding storage and cpool - real(r8), pointer :: storvegc(:) ! (gC/m2) stored vegetation carbon, excluding cpool - real(r8), pointer :: totvegc(:) ! (gC/m2) total vegetation carbon, excluding cpool - real(r8), pointer :: totpftc(:) ! (gC/m2) total pft-level carbon, including cpool - real(r8), pointer :: woodc(:) ! (gC/m2) wood C -end type pft_cstate_type - -type(pft_cstate_type) :: pcs !pft carbon state -type(pft_cstate_type) :: pcs_a !pft-level carbon state averaged to the column -type(pft_cstate_type) :: pc13s !pft carbon-13 state -type(pft_cstate_type) :: pc13s_a !pft carbon-13 state averaged to the column - -!---------------------------------------------------- -! pft nitrogen state variables structure -!---------------------------------------------------- -type, public :: pft_nstate_type - ! variables for prognostic crop model - real(r8), pointer :: grainn(:) ! (gN/m2) grain N - real(r8), pointer :: grainn_storage(:) ! (gN/m2) grain N storage - real(r8), pointer :: grainn_xfer(:) ! (gN/m2) grain N transfer - ! - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: npool(:) ! (gN/m2) temporary plant N pool - real(r8), pointer :: pft_ntrunc(:) ! (gN/m2) pft-level sink for N truncation - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: dispvegn(:) ! (gN/m2) displayed veg nitrogen, excluding storage - real(r8), pointer :: storvegn(:) ! (gN/m2) stored vegetation nitrogen - real(r8), pointer :: totvegn(:) ! (gN/m2) total vegetation nitrogen - real(r8), pointer :: totpftn(:) ! (gN/m2) total pft-level nitrogen -end type pft_nstate_type - -type(pft_nstate_type) :: pns !pft nitrogen state - -!---------------------------------------------------- -! pft VOC state variables structure -!---------------------------------------------------- -type, public :: pft_vstate_type - real(r8), pointer :: t_veg24(:) ! 24hr average vegetation temperature (K) - real(r8), pointer :: t_veg240(:) ! 240hr average vegetation temperature (Kelvin) - real(r8), pointer :: fsd24(:) ! 24hr average of direct beam radiation - real(r8), pointer :: fsd240(:) ! 240hr average of direct beam radiation - real(r8), pointer :: fsi24(:) ! 24hr average of diffuse beam radiation - real(r8), pointer :: fsi240(:) ! 240hr average of diffuse beam radiation - real(r8), pointer :: fsun24(:) ! 24hr average of sunlit fraction of canopy - real(r8), pointer :: fsun240(:) ! 240hr average of sunlit fraction of canopy - real(r8), pointer :: elai_p(:) ! leaf area index average over timestep -end type pft_vstate_type - -type(pft_vstate_type) :: pvs !pft VOC state - -!---------------------------------------------------- -! pft DGVM state variables structure -!---------------------------------------------------- -type, public :: pft_dgvstate_type - real(r8), pointer :: agddtw(:) !accumulated growing degree days above twmax - real(r8), pointer :: agdd(:) !accumulated growing degree days above 5 - real(r8), pointer :: t_mo(:) !30-day average temperature (Kelvin) - real(r8), pointer :: t_mo_min(:) !annual min of t_mo (Kelvin) - real(r8), pointer :: prec365(:) !365-day running mean of tot. precipitation - logical , pointer :: present(:) !whether PFT present in patch - logical , pointer :: pftmayexist(:) !if .false. then exclude seasonal decid pfts from tropics - real(r8), pointer :: nind(:) !number of individuals (#/m**2) - real(r8), pointer :: lm_ind(:) !individual leaf mass - real(r8), pointer :: lai_ind(:) !LAI per individual - real(r8), pointer :: fpcinc(:) !foliar projective cover increment (fraction) - real(r8), pointer :: fpcgrid(:) !foliar projective cover on gridcell (fraction) - real(r8), pointer :: fpcgridold(:) !last yr's fpcgrid - real(r8), pointer :: crownarea(:) !area that each individual tree takes up (m^2) - real(r8), pointer :: greffic(:) - real(r8), pointer :: heatstress(:) -end type pft_dgvstate_type - -type(pft_dgvstate_type) :: pdgvs !pft DGVM state variables - -!---------------------------------------------------- -! pft energy flux variables structure -!---------------------------------------------------- -type, public :: pft_eflux_type - real(r8), pointer :: sabg(:) !solar radiation absorbed by ground (W/m**2) - real(r8), pointer :: sabv(:) !solar radiation absorbed by vegetation (W/m**2) - real(r8), pointer :: fsa(:) !solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_u(:) !urban solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsa_r(:) !rural solar radiation absorbed (total) (W/m**2) - real(r8), pointer :: fsr(:) !solar radiation reflected (W/m**2) - real(r8), pointer :: parsun(:) !average absorbed PAR for sunlit leaves (W/m**2) - real(r8), pointer :: parsha(:) !average absorbed PAR for shaded leaves (W/m**2) - real(r8), pointer :: dlrad(:) !downward longwave radiation below the canopy [W/m2] - real(r8), pointer :: ulrad(:) !upward longwave radiation above the canopy [W/m2] - real(r8), pointer :: eflx_lh_tot(:) !total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_u(:) !urban total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_tot_r(:) !rural total latent heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_grnd(:) !ground evaporation heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_soil_grnd(:) !soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_u(:) !urban soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_soil_grnd_r(:) !rural soil heat flux (W/m**2) [+ = into soil] - real(r8), pointer :: eflx_sh_tot(:) !total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_u(:) !urban total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_tot_r(:) !rural total sensible heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_grnd(:) !sensible heat flux from ground (W/m**2) [+ to atm] - real(r8), pointer :: eflx_sh_veg(:) !sensible heat flux from leaves (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_vege(:) !veg evaporation heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_lh_vegt(:) !veg transpiration heat flux (W/m**2) [+ to atm] - real(r8), pointer :: eflx_wasteheat_pft(:) !sensible heat flux from domestic heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac_pft(:) !sensible heat flux put back into canyon due to removal by AC (W/m**2) - real(r8), pointer :: eflx_traffic_pft(:) !traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_anthro(:) !total anthropogenic heat flux (W/m**2) - real(r8), pointer :: cgrnd(:) !deriv. of soil energy flux wrt to soil temp [w/m2/k] - real(r8), pointer :: cgrndl(:) !deriv. of soil latent heat flux wrt soil temp [w/m**2/k] - real(r8), pointer :: cgrnds(:) !deriv. of soil sensible heat flux wrt soil temp [w/m2/k] - real(r8), pointer :: eflx_gnet(:) !net heat flux into ground (W/m**2) - real(r8), pointer :: dgnetdT(:) !derivative of net ground heat flux wrt soil temp (W/m**2 K) - real(r8), pointer :: eflx_lwrad_out(:) !emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: eflx_lwrad_net(:) !net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_u(:) !urban net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: eflx_lwrad_net_r(:) !rural net infrared (longwave) rad (W/m**2) [+ = to atm] - real(r8), pointer :: netrad(:) !net radiation (W/m**2) [+ = to sfc] - real(r8), pointer :: fsds_vis_d(:) !incident direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_d(:) !incident direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_i(:) !incident diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsds_nir_i(:) !incident diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_d(:) !reflected direct beam vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_d(:) !reflected direct beam nir solar radiation (W/m**2) - real(r8), pointer :: fsr_vis_i(:) !reflected diffuse vis solar radiation (W/m**2) - real(r8), pointer :: fsr_nir_i(:) !reflected diffuse nir solar radiation (W/m**2) - real(r8), pointer :: fsds_vis_d_ln(:) !incident direct beam vis solar radiation at local noon (W/m**2) - real(r8), pointer :: fsds_nir_d_ln(:) !incident direct beam nir solar radiation at local noon (W/m**2) - real(r8), pointer :: fsr_vis_d_ln(:) !reflected direct beam vis solar radiation at local noon (W/m**2) - real(r8), pointer :: fsr_nir_d_ln(:) !reflected direct beam nir solar radiation at local noon (W/m**2) - real(r8), pointer :: sun_add(:,:) !sun canopy absorbed direct from direct (W/m**2) - real(r8), pointer :: tot_aid(:,:) !total canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sun_aid(:,:) !sun canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sun_aii(:,:) !sun canopy absorbed indirect from indirect (W/m**2) - real(r8), pointer :: sha_aid(:,:) !shade canopy absorbed indirect from direct (W/m**2) - real(r8), pointer :: sha_aii(:,:) !shade canopy absorbed indirect from indirect (W/m**2) - real(r8), pointer :: sun_atot(:,:) !sun canopy total absorbed (W/m**2) - real(r8), pointer :: sha_atot(:,:) !shade canopy total absorbed (W/m**2) - real(r8), pointer :: sun_alf(:,:) !sun canopy total absorbed by leaves (W/m**2) - real(r8), pointer :: sha_alf(:,:) !shade canopy total absored by leaves (W/m**2) - real(r8), pointer :: sun_aperlai(:,:) !sun canopy total absorbed per unit LAI (W/m**2) - real(r8), pointer :: sha_aperlai(:,:) !shade canopy total absorbed per unit LAI (W/m**2) - real(r8), pointer :: sabg_lyr(:,:) ! absorbed radiation in each snow layer and top soil layer (pft,lyr) [W/m2] - real(r8), pointer :: sfc_frc_aer(:) ! surface forcing of snow with all aerosols (pft) [W/m2] - real(r8), pointer :: sfc_frc_bc(:) ! surface forcing of snow with BC (pft) [W/m2] - real(r8), pointer :: sfc_frc_oc(:) ! surface forcing of snow with OC (pft) [W/m2] - real(r8), pointer :: sfc_frc_dst(:) ! surface forcing of snow with dust (pft) [W/m2] - real(r8), pointer :: sfc_frc_aer_sno(:)! surface forcing of snow with all aerosols, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_bc_sno(:) ! surface forcing of snow with BC, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_oc_sno(:) ! surface forcing of snow with OC, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: sfc_frc_dst_sno(:)! surface forcing of snow with dust, averaged only when snow is present (pft) [W/m2] - real(r8), pointer :: fsr_sno_vd(:) ! reflected direct beam vis solar radiation from snow (W/m**2) - real(r8), pointer :: fsr_sno_nd(:) ! reflected direct beam NIR solar radiation from snow (W/m**2) - real(r8), pointer :: fsr_sno_vi(:) ! reflected diffuse vis solar radiation from snow (W/m**2) - real(r8), pointer :: fsr_sno_ni(:) ! reflected diffuse NIR solar radiation from snow (W/m**2) - real(r8), pointer :: fsds_sno_vd(:) ! incident visible, direct radiation on snow (for history files) [W/m2] - real(r8), pointer :: fsds_sno_nd(:) ! incident near-IR, direct radiation on snow (for history files) [W/m2] - real(r8), pointer :: fsds_sno_vi(:) ! incident visible, diffuse radiation on snow (for history files) [W/m2] - real(r8), pointer :: fsds_sno_ni(:) ! incident near-IR, diffuse radiation on snow (for history files) [W/m2] -end type pft_eflux_type - -type(pft_eflux_type) :: pef !pft energy flux - -!---------------------------------------------------- -! pft momentum flux variables structure -!---------------------------------------------------- -type, public :: pft_mflux_type - real(r8),pointer :: taux(:) !wind (shear) stress: e-w (kg/m/s**2) - real(r8),pointer :: tauy(:) !wind (shear) stress: n-s (kg/m/s**2) -end type pft_mflux_type - -type(pft_mflux_type) :: pmf !pft momentum flux - -!---------------------------------------------------- -! pft water flux variables structure -!---------------------------------------------------- -type, public :: pft_wflux_type - real(r8), pointer :: qflx_prec_intr(:) !interception of precipitation [mm/s] - real(r8), pointer :: qflx_prec_grnd(:) !water onto ground including canopy runoff [kg/(m2 s)] - real(r8), pointer :: qflx_rain_grnd(:) !rain on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snow_grnd(:) !snow on ground after interception (mm H2O/s) [+] - real(r8), pointer :: qflx_snwcp_ice(:) !excess snowfall due to snow capping (mm H2O /s) [+] - real(r8), pointer :: qflx_snwcp_liq(:) !excess rainfall due to snow capping (mm H2O /s) [+] - real(r8), pointer :: qflx_evap_veg(:) !vegetation evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_tran_veg(:) !vegetation transpiration (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_can(:) !evaporation from leaves and stems - real(r8), pointer :: qflx_evap_soi(:) !soil evaporation (mm H2O/s) (+ = to atm) - real(r8), pointer :: qflx_evap_tot(:) !qflx_evap_soi + qflx_evap_can + qflx_tran_veg - real(r8), pointer :: qflx_evap_grnd(:) !ground surface evaporation rate (mm H2O/s) [+] - real(r8), pointer :: qflx_dew_grnd(:) !ground surface dew formation (mm H2O /s) [+] - real(r8), pointer :: qflx_sub_snow(:) !sublimation rate from snow pack (mm H2O /s) [+] - real(r8), pointer :: qflx_dew_snow(:) !surface dew added to snow pack (mm H2O /s) [+] -end type pft_wflux_type - -type(pft_wflux_type) :: pwf !pft water flux - -!---------------------------------------------------- -! pft carbon flux variables structure -!---------------------------------------------------- -type, public :: pft_cflux_type - real(r8), pointer :: psnsun(:) !sunlit leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: psnsha(:) !shaded leaf photosynthesis (umol CO2 /m**2/ s) - real(r8), pointer :: fpsn(:) !photosynthesis (umol CO2 /m**2 /s) - real(r8), pointer :: fco2(:) !net CO2 flux (umol CO2 /m**2 /s) [+ = to atm] - ! new variables for CN code - ! gap mortality fluxes - real(r8), pointer :: m_leafc_to_litter(:) ! leaf C mortality (gC/m2/s) - real(r8), pointer :: m_leafc_storage_to_litter(:) ! leaf C storage mortality (gC/m2/s) - real(r8), pointer :: m_leafc_xfer_to_litter(:) ! leaf C transfer mortality (gC/m2/s) - real(r8), pointer :: m_frootc_to_litter(:) ! fine root C mortality (gC/m2/s) - real(r8), pointer :: m_frootc_storage_to_litter(:) ! fine root C storage mortality (gC/m2/s) - real(r8), pointer :: m_frootc_xfer_to_litter(:) ! fine root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_to_litter(:) ! live stem C mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_storage_to_litter(:) ! live stem C storage mortality (gC/m2/s) - real(r8), pointer :: m_livestemc_xfer_to_litter(:) ! live stem C transfer mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_to_litter(:) ! dead stem C mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_storage_to_litter(:) ! dead stem C storage mortality (gC/m2/s) - real(r8), pointer :: m_deadstemc_xfer_to_litter(:) ! dead stem C transfer mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_to_litter(:) ! live coarse root C mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_storage_to_litter(:) ! live coarse root C storage mortality (gC/m2/s) - real(r8), pointer :: m_livecrootc_xfer_to_litter(:) ! live coarse root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_litter(:) ! dead coarse root C mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_storage_to_litter(:) ! dead coarse root C storage mortality (gC/m2/s) - real(r8), pointer :: m_deadcrootc_xfer_to_litter(:) ! dead coarse root C transfer mortality (gC/m2/s) - real(r8), pointer :: m_gresp_storage_to_litter(:) ! growth respiration storage mortality (gC/m2/s) - real(r8), pointer :: m_gresp_xfer_to_litter(:) ! growth respiration transfer mortality (gC/m2/s) - ! harvest mortality fluxes - real(r8), pointer :: hrv_leafc_to_litter(:) ! leaf C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) ! leaf C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) ! leaf C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_to_litter(:) ! fine root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) ! fine root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) ! fine root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_to_litter(:) ! live stem C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) ! live stem C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) ! live stem C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) ! dead stem C harvest to 10-year product pool (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) ! dead stem C harvest to 100-year product pool (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) ! dead stem C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) ! dead stem C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_to_litter(:) ! live coarse root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) ! live coarse root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) ! live coarse root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) ! dead coarse root C harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) ! dead coarse root C storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) ! dead coarse root C transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) ! growth respiration storage harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) ! growth respiration transfer harvest mortality (gC/m2/s) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) ! excess MR pool harvest mortality (gC/m2/s) - ! PFT-level fire fluxes - real(r8), pointer :: m_leafc_to_fire(:) ! leaf C fire loss (gC/m2/s) - real(r8), pointer :: m_leafc_storage_to_fire(:) ! leaf C storage fire loss (gC/m2/s) - real(r8), pointer :: m_leafc_xfer_to_fire(:) ! leaf C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_frootc_to_fire(:) ! fine root C fire loss (gC/m2/s) - real(r8), pointer :: m_frootc_storage_to_fire(:) ! fine root C storage fire loss (gC/m2/s) - real(r8), pointer :: m_frootc_xfer_to_fire(:) ! fine root C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_livestemc_to_fire(:) ! live stem C fire loss (gC/m2/s) - real(r8), pointer :: m_livestemc_storage_to_fire(:) ! live stem C storage fire loss (gC/m2/s) - real(r8), pointer :: m_livestemc_xfer_to_fire(:) ! live stem C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_deadstemc_to_fire(:) ! dead stem C fire loss (gC/m2/s) - real(r8), pointer :: m_deadstemc_to_litter_fire(:) ! dead stem C fire mortality to litter (gC/m2/s) - real(r8), pointer :: m_deadstemc_storage_to_fire(:) ! dead stem C storage fire loss (gC/m2/s) - real(r8), pointer :: m_deadstemc_xfer_to_fire(:) ! dead stem C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_livecrootc_to_fire(:) ! live coarse root C fire loss (gC/m2/s) - real(r8), pointer :: m_livecrootc_storage_to_fire(:) ! live coarse root C storage fire loss (gC/m2/s) - real(r8), pointer :: m_livecrootc_xfer_to_fire(:) ! live coarse root C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_fire(:) ! dead coarse root C fire loss (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_litter_fire(:) ! dead coarse root C fire mortality to litter (gC/m2/s) - real(r8), pointer :: m_deadcrootc_storage_to_fire(:) ! dead coarse root C storage fire loss (gC/m2/s) - real(r8), pointer :: m_deadcrootc_xfer_to_fire(:) ! dead coarse root C transfer fire loss (gC/m2/s) - real(r8), pointer :: m_gresp_storage_to_fire(:) ! growth respiration storage fire loss (gC/m2/s) - real(r8), pointer :: m_gresp_xfer_to_fire(:) ! growth respiration transfer fire loss (gC/m2/s) - ! phenology fluxes from transfer pools - real(r8), pointer :: grainc_xfer_to_grainc(:) ! grain C growth from storage for prognostic crop(gC/m2/s) - real(r8), pointer :: leafc_xfer_to_leafc(:) ! leaf C growth from storage (gC/m2/s) - real(r8), pointer :: frootc_xfer_to_frootc(:) ! fine root C growth from storage (gC/m2/s) - real(r8), pointer :: livestemc_xfer_to_livestemc(:) ! live stem C growth from storage (gC/m2/s) - real(r8), pointer :: deadstemc_xfer_to_deadstemc(:) ! dead stem C growth from storage (gC/m2/s) - real(r8), pointer :: livecrootc_xfer_to_livecrootc(:) ! live coarse root C growth from storage (gC/m2/s) - real(r8), pointer :: deadcrootc_xfer_to_deadcrootc(:) ! dead coarse root C growth from storage (gC/m2/s) - ! leaf and fine root litterfall - real(r8), pointer :: leafc_to_litter(:) ! leaf C litterfall (gC/m2/s) - real(r8), pointer :: frootc_to_litter(:) ! fine root C litterfall (gC/m2/s) - real(r8), pointer :: livestemc_to_litter(:) ! live stem C litterfall (gC/m2/s) - real(r8), pointer :: grainc_to_food(:) ! grain C to food for prognostic crop(gC/m2/s) - ! maintenance respiration fluxes - real(r8), pointer :: leaf_mr(:) ! leaf maintenance respiration (gC/m2/s) - real(r8), pointer :: froot_mr(:) ! fine root maintenance respiration (gC/m2/s) - real(r8), pointer :: livestem_mr(:) ! live stem maintenance respiration (gC/m2/s) - real(r8), pointer :: livecroot_mr(:) ! live coarse root maintenance respiration (gC/m2/s) - real(r8), pointer :: leaf_curmr(:) ! leaf maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: froot_curmr(:) ! fine root maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: livestem_curmr(:) ! live stem maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: livecroot_curmr(:) ! live coarse root maintenance respiration from current GPP (gC/m2/s) - real(r8), pointer :: leaf_xsmr(:) ! leaf maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: froot_xsmr(:) ! fine root maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: livestem_xsmr(:) ! live stem maintenance respiration from storage (gC/m2/s) - real(r8), pointer :: livecroot_xsmr(:) ! live coarse root maintenance respiration from storage (gC/m2/s) - ! photosynthesis fluxes - real(r8), pointer :: psnsun_to_cpool(:) ! C fixation from sunlit canopy (gC/m2/s) - real(r8), pointer :: psnshade_to_cpool(:) ! C fixation from shaded canopy (gC/m2/s) - ! allocation fluxes, from current GPP - real(r8), pointer :: cpool_to_xsmrpool(:) ! allocation to maintenance respiration storage pool (gC/m2/s) - real(r8), pointer :: cpool_to_grainc(:) ! allocation to grain C for prognostic crop(gC/m2/s) - real(r8), pointer :: cpool_to_grainc_storage(:) ! allocation to grain C storage for prognostic crop(gC/m2/s) - real(r8), pointer :: cpool_to_leafc(:) ! allocation to leaf C (gC/m2/s) - real(r8), pointer :: cpool_to_leafc_storage(:) ! allocation to leaf C storage (gC/m2/s) - real(r8), pointer :: cpool_to_frootc(:) ! allocation to fine root C (gC/m2/s) - real(r8), pointer :: cpool_to_frootc_storage(:) ! allocation to fine root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc(:) ! allocation to live stem C (gC/m2/s) - real(r8), pointer :: cpool_to_livestemc_storage(:) ! allocation to live stem C storage (gC/m2/s) - real(r8), pointer :: cpool_to_deadstemc(:) ! allocation to dead stem C (gC/m2/s) - real(r8), pointer :: cpool_to_deadstemc_storage(:) ! allocation to dead stem C storage (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc(:) ! allocation to live coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_livecrootc_storage(:) ! allocation to live coarse root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc(:) ! allocation to dead coarse root C (gC/m2/s) - real(r8), pointer :: cpool_to_deadcrootc_storage(:) ! allocation to dead coarse root C storage (gC/m2/s) - real(r8), pointer :: cpool_to_gresp_storage(:) ! allocation to growth respiration storage (gC/m2/s) - ! growth respiration fluxes - real(r8), pointer :: xsmrpool_to_atm(:) ! excess MR pool harvest mortality (gC/m2/s) - real(r8), pointer :: cpool_leaf_gr(:) ! leaf growth respiration (gC/m2/s) - real(r8), pointer :: cpool_leaf_storage_gr(:) ! leaf growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_leaf_gr(:) ! leaf growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_froot_gr(:) ! fine root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_froot_storage_gr(:) ! fine root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_froot_gr(:) ! fine root growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_livestem_gr(:) ! live stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livestem_storage_gr(:) ! live stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_livestem_gr(:) ! live stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_deadstem_gr(:) ! dead stem growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadstem_storage_gr(:) ! dead stem growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_deadstem_gr(:) ! dead stem growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_livecroot_gr(:) ! live coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_livecroot_storage_gr(:) ! live coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_livecroot_gr(:) ! live coarse root growth respiration from storage (gC/m2/s) - real(r8), pointer :: cpool_deadcroot_gr(:) ! dead coarse root growth respiration (gC/m2/s) - real(r8), pointer :: cpool_deadcroot_storage_gr(:) ! dead coarse root growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_deadcroot_gr(:) ! dead coarse root growth respiration from storage (gC/m2/s) - ! growth respiration for prognostic crop model - real(r8), pointer :: cpool_grain_gr(:) ! grain growth respiration (gC/m2/s) - real(r8), pointer :: cpool_grain_storage_gr(:) ! grain growth respiration to storage (gC/m2/s) - real(r8), pointer :: transfer_grain_gr(:) ! grain growth respiration from storage (gC/m2/s) - ! annual turnover of storage to transfer pools - real(r8), pointer :: grainc_storage_to_xfer(:) ! grain C shift storage to transfer for prognostic crop model (gC/m2/s) - real(r8), pointer :: leafc_storage_to_xfer(:) ! leaf C shift storage to transfer (gC/m2/s) - real(r8), pointer :: frootc_storage_to_xfer(:) ! fine root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: livestemc_storage_to_xfer(:) ! live stem C shift storage to transfer (gC/m2/s) - real(r8), pointer :: deadstemc_storage_to_xfer(:) ! dead stem C shift storage to transfer (gC/m2/s) - real(r8), pointer :: livecrootc_storage_to_xfer(:) ! live coarse root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: deadcrootc_storage_to_xfer(:) ! dead coarse root C shift storage to transfer (gC/m2/s) - real(r8), pointer :: gresp_storage_to_xfer(:) ! growth respiration shift storage to transfer (gC/m2/s) - ! turnover of livewood to deadwood - real(r8), pointer :: livestemc_to_deadstemc(:) ! live stem C turnover (gC/m2/s) - real(r8), pointer :: livecrootc_to_deadcrootc(:) ! live coarse root C turnover (gC/m2/s) - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: gpp(:) ! (gC/m2/s) gross primary production - real(r8), pointer :: mr(:) ! (gC/m2/s) maintenance respiration - real(r8), pointer :: current_gr(:) ! (gC/m2/s) growth resp for new growth displayed in this timestep - real(r8), pointer :: transfer_gr(:) ! (gC/m2/s) growth resp for transfer growth displayed in this timestep - real(r8), pointer :: storage_gr(:) ! (gC/m2/s) growth resp for growth sent to storage for later display - real(r8), pointer :: gr(:) ! (gC/m2/s) total growth respiration - real(r8), pointer :: ar(:) ! (gC/m2/s) autotrophic respiration (MR + GR) - real(r8), pointer :: rr(:) ! (gC/m2/s) root respiration (fine root MR + total root GR) - real(r8), pointer :: npp(:) ! (gC/m2/s) net primary production - real(r8), pointer :: agnpp(:) ! (gC/m2/s) aboveground NPP - real(r8), pointer :: bgnpp(:) ! (gC/m2/s) belowground NPP - real(r8), pointer :: litfall(:) ! (gC/m2/s) litterfall (leaves and fine roots) - real(r8), pointer :: vegfire(:) ! (gC/m2/s) pft-level fire loss (obsolete, mark for removal) - real(r8), pointer :: wood_harvestc(:) ! (gC/m2/s) pft-level wood harvest (to product pools) - real(r8), pointer :: pft_cinputs(:) ! (gC/m2/s) pft-level carbon inputs (for balance checking) - real(r8), pointer :: pft_coutputs(:) ! (gC/m2/s) pft-level carbon outputs (for balance checking) - ! CLAMP summary (diagnostic) variables, not involved in mass balance - real(r8), pointer :: frootc_alloc(:) ! (gC/m2/s) pft-level fine root C alloc - real(r8), pointer :: frootc_loss(:) ! (gC/m2/s) pft-level fine root C loss - real(r8), pointer :: leafc_alloc(:) ! (gC/m2/s) pft-level leaf C alloc - real(r8), pointer :: leafc_loss(:) ! (gC/m2/s) pft-level leaf C loss - real(r8), pointer :: woodc_alloc(:) ! (gC/m2/s) pft-level wood C alloc - real(r8), pointer :: woodc_loss(:) ! (gC/m2/s) pft-level wood C loss - ! new variables for fire code - real(r8), pointer :: pft_fire_closs(:) ! (gC/m2/s) total pft-level fire C loss -end type pft_cflux_type - -type(pft_cflux_type) :: pcf !pft carbon flux -type(pft_cflux_type) :: pcf_a !pft carbon flux averaged to the column -type(pft_cflux_type) :: pc13f !pft carbon-13 flux -type(pft_cflux_type) :: pc13f_a !pft carbon-13 flux averaged to the column - -!---------------------------------------------------- -! pft nitrogen flux variables structure -!---------------------------------------------------- -type, public :: pft_nflux_type - ! new variables for CN code - ! gap mortality fluxes - real(r8), pointer :: m_leafn_to_litter(:) ! leaf N mortality (gN/m2/s) - real(r8), pointer :: m_frootn_to_litter(:) ! fine root N mortality (gN/m2/s) - real(r8), pointer :: m_leafn_storage_to_litter(:) ! leaf N storage mortality (gN/m2/s) - real(r8), pointer :: m_frootn_storage_to_litter(:) ! fine root N storage mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_storage_to_litter(:) ! live stem N storage mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_storage_to_litter(:) ! dead stem N storage mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_storage_to_litter(:) ! live coarse root N storage mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_storage_to_litter(:) ! dead coarse root N storage mortality (gN/m2/s) - real(r8), pointer :: m_leafn_xfer_to_litter(:) ! leaf N transfer mortality (gN/m2/s) - real(r8), pointer :: m_frootn_xfer_to_litter(:) ! fine root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_xfer_to_litter(:) ! live stem N transfer mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_xfer_to_litter(:) ! dead stem N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_xfer_to_litter(:) ! live coarse root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_xfer_to_litter(:) ! dead coarse root N transfer mortality (gN/m2/s) - real(r8), pointer :: m_livestemn_to_litter(:) ! live stem N mortality (gN/m2/s) - real(r8), pointer :: m_deadstemn_to_litter(:) ! dead stem N mortality (gN/m2/s) - real(r8), pointer :: m_livecrootn_to_litter(:) ! live coarse root N mortality (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_litter(:) ! dead coarse root N mortality (gN/m2/s) - real(r8), pointer :: m_retransn_to_litter(:) ! retranslocated N pool mortality (gN/m2/s) - ! harvest mortality fluxes - real(r8), pointer :: hrv_leafn_to_litter(:) ! leaf N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_to_litter(:) ! fine root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_leafn_storage_to_litter(:) ! leaf N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_storage_to_litter(:) ! fine root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_storage_to_litter(:) ! live stem N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_storage_to_litter(:) ! dead stem N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_storage_to_litter(:) ! live coarse root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_storage_to_litter(:) ! dead coarse root N storage harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_leafn_xfer_to_litter(:) ! leaf N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_frootn_xfer_to_litter(:) ! fine root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_xfer_to_litter(:) ! live stem N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_xfer_to_litter(:) ! dead stem N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_xfer_to_litter(:) ! live coarse root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litter(:) ! dead coarse root N transfer harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_livestemn_to_litter(:) ! live stem N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_to_prod10n(:) ! dead stem N harvest to 10-year product pool (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_to_prod100n(:) ! dead stem N harvest to 100-year product pool (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_to_litter(:) ! live coarse root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_to_litter(:) ! dead coarse root N harvest mortality (gN/m2/s) - real(r8), pointer :: hrv_retransn_to_litter(:) ! retranslocated N pool harvest mortality (gN/m2/s) - ! fire mortality fluxes - real(r8), pointer :: m_leafn_to_fire(:) ! leaf N fire loss (gN/m2/s) - real(r8), pointer :: m_leafn_storage_to_fire(:) ! leaf N storage fire loss (gN/m2/s) - real(r8), pointer :: m_leafn_xfer_to_fire(:) ! leaf N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_frootn_to_fire(:) ! fine root N fire loss (gN/m2/s) - real(r8), pointer :: m_frootn_storage_to_fire(:) ! fine root N storage fire loss (gN/m2/s) - real(r8), pointer :: m_frootn_xfer_to_fire(:) ! fine root N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_livestemn_to_fire(:) ! live stem N fire loss (gN/m2/s) - real(r8), pointer :: m_livestemn_storage_to_fire(:) ! live stem N storage fire loss (gN/m2/s) - real(r8), pointer :: m_livestemn_xfer_to_fire(:) ! live stem N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_deadstemn_to_fire(:) ! dead stem N fire loss (gN/m2/s) - real(r8), pointer :: m_deadstemn_to_litter_fire(:) ! dead stem N fire mortality to litter (gN/m2/s) - real(r8), pointer :: m_deadstemn_storage_to_fire(:) ! dead stem N storage fire loss (gN/m2/s) - real(r8), pointer :: m_deadstemn_xfer_to_fire(:) ! dead stem N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_livecrootn_to_fire(:) ! live coarse root N fire loss (gN/m2/s) - real(r8), pointer :: m_livecrootn_storage_to_fire(:) ! live coarse root N storage fire loss (gN/m2/s) - real(r8), pointer :: m_livecrootn_xfer_to_fire(:) ! live coarse root N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_fire(:) ! dead coarse root N fire loss (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_litter_fire(:) ! dead coarse root N fire mortality to litter (gN/m2/s) - real(r8), pointer :: m_deadcrootn_storage_to_fire(:) ! dead coarse root N storage fire loss (gN/m2/s) - real(r8), pointer :: m_deadcrootn_xfer_to_fire(:) ! dead coarse root N transfer fire loss (gN/m2/s) - real(r8), pointer :: m_retransn_to_fire(:) ! retranslocated N pool fire loss (gN/m2/s) - ! phenology fluxes from transfer pool - real(r8), pointer :: grainn_xfer_to_grainn(:) ! grain N growth from storage for prognostic crop model (gN/m2/s) - real(r8), pointer :: leafn_xfer_to_leafn(:) ! leaf N growth from storage (gN/m2/s) - real(r8), pointer :: frootn_xfer_to_frootn(:) ! fine root N growth from storage (gN/m2/s) - real(r8), pointer :: livestemn_xfer_to_livestemn(:) ! live stem N growth from storage (gN/m2/s) - real(r8), pointer :: deadstemn_xfer_to_deadstemn(:) ! dead stem N growth from storage (gN/m2/s) - real(r8), pointer :: livecrootn_xfer_to_livecrootn(:) ! live coarse root N growth from storage (gN/m2/s) - real(r8), pointer :: deadcrootn_xfer_to_deadcrootn(:) ! dead coarse root N growth from storage (gN/m2/s) - ! litterfall fluxes - real(r8), pointer :: livestemn_to_litter(:) ! livestem N to litter (gN/m2/s) - real(r8), pointer :: grainn_to_food(:) ! grain N to food for prognostic crop (gN/m2/s) - real(r8), pointer :: leafn_to_litter(:) ! leaf N litterfall (gN/m2/s) - real(r8), pointer :: leafn_to_retransn(:) ! leaf N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: frootn_to_litter(:) ! fine root N litterfall (gN/m2/s) - ! allocation fluxes - real(r8), pointer :: retransn_to_npool(:) ! deployment of retranslocated N (gN/m2/s) - real(r8), pointer :: sminn_to_npool(:) ! deployment of soil mineral N uptake (gN/m2/s) - real(r8), pointer :: npool_to_grainn(:) ! allocation to grain N for prognostic crop (gN/m2/s) - real(r8), pointer :: npool_to_grainn_storage(:) ! allocation to grain N storage for prognostic crop (gN/m2/s) - real(r8), pointer :: npool_to_leafn(:) ! allocation to leaf N (gN/m2/s) - real(r8), pointer :: npool_to_leafn_storage(:) ! allocation to leaf N storage (gN/m2/s) - real(r8), pointer :: npool_to_frootn(:) ! allocation to fine root N (gN/m2/s) - real(r8), pointer :: npool_to_frootn_storage(:) ! allocation to fine root N storage (gN/m2/s) - real(r8), pointer :: npool_to_livestemn(:) ! allocation to live stem N (gN/m2/s) - real(r8), pointer :: npool_to_livestemn_storage(:) ! allocation to live stem N storage (gN/m2/s) - real(r8), pointer :: npool_to_deadstemn(:) ! allocation to dead stem N (gN/m2/s) - real(r8), pointer :: npool_to_deadstemn_storage(:) ! allocation to dead stem N storage (gN/m2/s) - real(r8), pointer :: npool_to_livecrootn(:) ! allocation to live coarse root N (gN/m2/s) - real(r8), pointer :: npool_to_livecrootn_storage(:) ! allocation to live coarse root N storage (gN/m2/s) - real(r8), pointer :: npool_to_deadcrootn(:) ! allocation to dead coarse root N (gN/m2/s) - real(r8), pointer :: npool_to_deadcrootn_storage(:) ! allocation to dead coarse root N storage (gN/m2/s) - ! annual turnover of storage to transfer pools - real(r8), pointer :: grainn_storage_to_xfer(:) ! grain N shift storage to transfer for prognostic crop (gN/m2/s) - real(r8), pointer :: leafn_storage_to_xfer(:) ! leaf N shift storage to transfer (gN/m2/s) - real(r8), pointer :: frootn_storage_to_xfer(:) ! fine root N shift storage to transfer (gN/m2/s) - real(r8), pointer :: livestemn_storage_to_xfer(:) ! live stem N shift storage to transfer (gN/m2/s) - real(r8), pointer :: deadstemn_storage_to_xfer(:) ! dead stem N shift storage to transfer (gN/m2/s) - real(r8), pointer :: livecrootn_storage_to_xfer(:) ! live coarse root N shift storage to transfer (gN/m2/s) - real(r8), pointer :: deadcrootn_storage_to_xfer(:) ! dead coarse root N shift storage to transfer (gN/m2/s) - ! turnover of livewood to deadwood, with retranslocation - real(r8), pointer :: livestemn_to_deadstemn(:) ! live stem N turnover (gN/m2/s) - real(r8), pointer :: livestemn_to_retransn(:) ! live stem N to retranslocated N pool (gN/m2/s) - real(r8), pointer :: livecrootn_to_deadcrootn(:) ! live coarse root N turnover (gN/m2/s) - real(r8), pointer :: livecrootn_to_retransn(:) ! live coarse root N to retranslocated N pool (gN/m2/s) - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: ndeploy(:) ! total N deployed to growth and storage (gN/m2/s) - real(r8), pointer :: pft_ninputs(:) ! total N inputs to pft-level (gN/m2/s) - real(r8), pointer :: pft_noutputs(:) ! total N outputs from pft-level (gN/m2/s) - real(r8), pointer :: wood_harvestn(:) ! total N losses to wood product pools (gN/m2/s) - ! new variables for fire code - real(r8), pointer :: pft_fire_nloss(:) ! total pft-level fire N loss (gN/m2/s) -end type pft_nflux_type - -type(pft_nflux_type) :: pnf !pft nitrogen flux -type(pft_nflux_type) :: pnf_a !pft-level nitrogen flux variables averaged to the column - -!---------------------------------------------------- -! pft VOC fluxes structure for history output -!---------------------------------------------------- -type, public :: megan_out_type - real(r8), pointer :: flux_out(:) !(n_megan_comps) MEGAN flux [ug C m-2 h-1] -endtype megan_out_type - -!---------------------------------------------------- -! pft VOC flux variables structure -!---------------------------------------------------- -type, public :: pft_vflux_type - real(r8), pointer :: vocflx_tot(:) !total VOC flux into atmosphere [moles/m2/sec] - real(r8), pointer :: vocflx(:,:) !(num_mech_comps) MEGAN flux [moles/m2/sec] - real(r8), pointer :: Eopt_out(:) !Eopt coefficient - real(r8), pointer :: topt_out(:) !topt coefficient - real(r8), pointer :: alpha_out(:) !alpha coefficient - real(r8), pointer :: cp_out(:) !cp coefficient - real(r8), pointer :: paru_out(:) - real(r8), pointer :: par24u_out(:) - real(r8), pointer :: par240u_out(:) - real(r8), pointer :: para_out(:) - real(r8), pointer :: par24a_out(:) - real(r8), pointer :: par240a_out(:) - real(r8), pointer :: gamma_out(:) - real(r8), pointer :: gammaL_out(:) - real(r8), pointer :: gammaT_out(:) - real(r8), pointer :: gammaP_out(:) - real(r8), pointer :: gammaA_out(:) - real(r8), pointer :: gammaS_out(:) - real(r8), pointer :: gammaC_out(:) - type(megan_out_type), pointer :: meg(:) ! points to output fluxes -end type pft_vflux_type - -type(pft_vflux_type) :: pvf !pft VOC flux - -!---------------------------------------------------- -! pft dry dep velocity variables structure -!---------------------------------------------------- -type, public :: pft_depvd_type - real(r8), pointer :: drydepvel(:,:) -end type pft_depvd_type - -type(pft_depvd_type) :: pdd !dry dep velocity - -!---------------------------------------------------- -! pft dust flux variables structure -!---------------------------------------------------- -type, public :: pft_dflux_type - real(r8), pointer :: flx_mss_vrt_dst(:,:) !(ndst) !surface dust emission (kg/m**2/s) [ + = to atm] - real(r8), pointer :: flx_mss_vrt_dst_tot(:) !total dust flux into atmosphere - real(r8), pointer :: vlc_trb(:,:) !(ndst) turbulent deposition velocity (m/s) - real(r8), pointer :: vlc_trb_1(:) !turbulent deposition velocity 1(m/s) - real(r8), pointer :: vlc_trb_2(:) !turbulent deposition velocity 2(m/s) - real(r8), pointer :: vlc_trb_3(:) !turbulent deposition velocity 3(m/s) - real(r8), pointer :: vlc_trb_4(:) !turbulent deposition velocity 4(m/s) -end type pft_dflux_type - -type(pft_dflux_type) :: pdf !pft dust flux - -!---------------------------------------------------- -! End definition of structures defined at the pft_type level -!---------------------------------------------------- -!******************************************************************************* - - -!******************************************************************************* -!---------------------------------------------------- -! Begin definition of structures defined at the column_type level -!---------------------------------------------------- -! column physical state variables structure -!---------------------------------------------------- -type, public :: column_pstate_type - integer , pointer :: snl(:) !number of snow layers - integer , pointer :: isoicol(:) !soil color class - real(r8), pointer :: bsw(:,:) !Clapp and Hornberger "b" (nlevgrnd) - real(r8), pointer :: watsat(:,:) !volumetric soil water at saturation (porosity) (nlevgrnd) - real(r8), pointer :: watdry(:,:) !btran parameter for btran=0 - real(r8), pointer :: watopt(:,:) !btran parameter for btran = 1 - real(r8), pointer :: hksat(:,:) !hydraulic conductivity at saturation (mm H2O /s) (nlevgrnd) - real(r8), pointer :: sucsat(:,:) !minimum soil suction (mm) (nlevgrnd) - real(r8), pointer :: hkdepth(:) !decay factor (m) - real(r8), pointer :: wtfact(:) !maximum saturated fraction for a gridcell - real(r8), pointer :: fracice(:,:) !fractional impermeability (-) - real(r8), pointer :: csol(:,:) !heat capacity, soil solids (J/m**3/Kelvin) (nlevgrnd) - real(r8), pointer :: tkmg(:,:) !thermal conductivity, soil minerals [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: tkdry(:,:) !thermal conductivity, dry soil (W/m/Kelvin) (nlevgrnd) - real(r8), pointer :: tksatu(:,:) !thermal conductivity, saturated soil [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: smpmin(:) !restriction for min of soil potential (mm) (new) - real(r8), pointer :: gwc_thr(:) !threshold soil moisture based on clay content - real(r8), pointer :: mss_frc_cly_vld(:) ![frc] Mass fraction clay limited to 0.20 - real(r8), pointer :: mbl_bsn_fct(:) !basin factor - logical , pointer :: do_capsnow(:) !true => do snow capping - real(r8), pointer :: snowdp(:) !snow height (m) - real(r8), pointer :: frac_sno(:) !fraction of ground covered by snow (0 to 1) - !real(r8), pointer :: res_sno(:) !residual snow when snl -> 0 - !real(r8), pointer :: topo_ndx(:) !gridcell topographic index - !real(r8), pointer :: topo_slope(:) !gridcell topographic slope - !real(r8), pointer :: var_track(:) !generic variable to track... - !real(r8), pointer :: var_track2(:) !generic variable to track... - real(r8), pointer :: zi(:,:) !interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) - real(r8), pointer :: dz(:,:) !layer thickness (m) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: z(:,:) !layer depth (m) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: frac_iceold(:,:) !fraction of ice relative to the tot water (new) (-nlevsno+1:nlevgrnd) - integer , pointer :: imelt(:,:) !flag for melting (=1), freezing (=2), Not=0 (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: eff_porosity(:,:) !effective porosity = porosity - vol_ice (nlevgrnd) - real(r8), pointer :: emg(:) !ground emissivity - real(r8), pointer :: z0mg(:) !roughness length over ground, momentum [m] - real(r8), pointer :: z0hg(:) !roughness length over ground, sensible heat [m] - real(r8), pointer :: z0qg(:) !roughness length over ground, latent heat [m] - real(r8), pointer :: htvp(:) !latent heat of vapor of water (or sublimation) [j/kg] - real(r8), pointer :: beta(:) !coefficient of convective velocity [-] - real(r8), pointer :: zii(:) !convective boundary height [m] - real(r8), pointer :: albgrd(:,:) !ground albedo (direct) (numrad) - real(r8), pointer :: albgri(:,:) !ground albedo (diffuse) (numrad) - real(r8), pointer :: rootr_column(:,:) !effective fraction of roots in each soil layer (nlevgrnd) - real(r8), pointer :: rootfr_road_perv(:,:) !fraction of roots in each soil layer for urban pervious road - real(r8), pointer :: rootr_road_perv(:,:) !effective fraction of roots in each soil layer of urban pervious road - real(r8), pointer :: wf(:) !soil water as frac. of whc for top 0.5 m -! real(r8), pointer :: xirrig(:) !irrigation rate - real(r8), pointer :: max_dayl(:) !maximum daylength for this column (s) - ! new variables for CN code - real(r8), pointer :: bsw2(:,:) !Clapp and Hornberger "b" for CN code - real(r8), pointer :: psisat(:,:) !soil water potential at saturation for CN code (MPa) - real(r8), pointer :: vwcsat(:,:) !volumetric water content at saturation for CN code (m3/m3) - real(r8), pointer :: decl(:) ! solar declination angle (radians) - real(r8), pointer :: coszen(:) !cosine of solar zenith angle - real(r8), pointer :: soilpsi(:,:) !soil water potential in each soil layer (MPa) - real(r8), pointer :: fpi(:) !fraction of potential immobilization (no units) - real(r8), pointer :: fpg(:) !fraction of potential gpp (no units) - real(r8), pointer :: annsum_counter(:) !seconds since last annual accumulator turnover - real(r8), pointer :: cannsum_npp(:) !annual sum of NPP, averaged from pft-level (gC/m2/yr) - real(r8), pointer :: cannavg_t2m(:) !annual average of 2m air temperature, averaged from pft-level (K) - real(r8), pointer :: watfc(:,:) !volumetric soil water at field capacity (nlevsoi) - ! new variables for fire code - real(r8), pointer :: me(:) !moisture of extinction (proportion) - real(r8), pointer :: fire_prob(:) !daily fire probability (0-1) - real(r8), pointer :: mean_fire_prob(:) !e-folding mean of daily fire probability (0-1) - real(r8), pointer :: fireseasonl(:) !annual fire season length (days, <= days/year) - real(r8), pointer :: farea_burned(:) !timestep fractional area burned (proportion) - real(r8), pointer :: ann_farea_burned(:) !annual total fractional area burned (proportion) - real(r8), pointer :: albsnd_hst(:,:) ! snow albedo, direct, for history files (col,bnd) [frc] - real(r8), pointer :: albsni_hst(:,:) ! snow albedo, diffuse, for history files (col,bnd) [frc] - real(r8), pointer :: albsod(:,:) ! soil albedo: direct (col,bnd) [frc] - real(r8), pointer :: albsoi(:,:) ! soil albedo: diffuse (col,bnd) [frc] - real(r8), pointer :: flx_absdv(:,:) ! absorbed flux per unit incident direct flux: VIS (col,lyr) [frc] - real(r8), pointer :: flx_absdn(:,:) ! absorbed flux per unit incident direct flux: NIR (col,lyr) [frc] - real(r8), pointer :: flx_absiv(:,:) ! absorbed flux per unit incident diffuse flux: VIS (col,lyr) [frc] - real(r8), pointer :: flx_absin(:,:) ! absorbed flux per unit incident diffuse flux: NIR (col,lyr) [frc] - real(r8), pointer :: snw_rds(:,:) ! snow grain radius (col,lyr) [m^-6, microns] - real(r8), pointer :: snw_rds_top(:) ! snow grain radius, top layer (col) [m^-6, microns] - real(r8), pointer :: sno_liq_top(:) ! snow liquid water fraction (mass), top layer (col) [fraction] - real(r8), pointer :: mss_bcpho(:,:) ! mass of hydrophobic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcphi(:,:) ! mass of hydrophillic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bctot(:,:) ! total mass of BC in snow (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_bc_col(:) ! column-integrated mass of total BC (col) [kg] - real(r8), pointer :: mss_bc_top(:) ! top-layer mass of total BC (col) [kg] - real(r8), pointer :: mss_ocpho(:,:) ! mass of hydrophobic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! mass of hydrophillic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_octot(:,:) ! total mass of OC in snow (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_oc_col(:) ! column-integrated mass of total OC (col) [kg] - real(r8), pointer :: mss_oc_top(:) ! top-layer mass of total OC (col) [kg] - real(r8), pointer :: mss_dst1(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dsttot(:,:) ! total mass of dust in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst_col(:) ! column-integrated mass of dust in snow (col) [kg] - real(r8), pointer :: mss_dst_top(:) ! top-layer mass of dust in snow (col) [kg] - real(r8), pointer :: h2osno_top(:) ! top-layer mass of snow (col) [kg] - real(r8), pointer :: mss_cnc_bcphi(:,:) ! mass concentration of hydrophilic BC in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_bcpho(:,:) ! mass concentration of hydrophilic BC in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocphi(:,:) ! mass concentration of hydrophilic OC in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocpho(:,:) ! mass concentration of hydrophilic OC in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst1(:,:) ! mass concentration of dust species 1 in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst2(:,:) ! mass concentration of dust species 2 in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst3(:,:) ! mass concentration of dust species 3 in snow (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst4(:,:) ! mass concentration of dust species 4 in snow (col,lyr) [kg/kg] - real(r8), pointer :: albgrd_pur(:,:) ! pure snow ground direct albedo (numrad) - real(r8), pointer :: albgri_pur(:,:) ! pure snow ground diffuse albedo (numrad) - real(r8), pointer :: albgrd_bc(:,:) ! ground direct albedo without BC (numrad) - real(r8), pointer :: albgri_bc(:,:) ! ground diffuse albedo without BC (numrad) - real(r8), pointer :: albgrd_oc(:,:) ! ground direct albedo without OC (numrad) - real(r8), pointer :: albgri_oc(:,:) ! ground diffuse albedo without OC (numrad) - real(r8), pointer :: albgrd_dst(:,:) ! ground direct albedo without dust (numrad) - real(r8), pointer :: albgri_dst(:,:) ! ground diffuse albedo without dust (numrad) - real(r8), pointer :: dTdz_top(:) ! temperature gradient in top layer [K m-1] - real(r8), pointer :: snot_top(:) ! temperature of top snow layer [K] - real(r8), pointer :: irrig_rate(:) ! current irrigation rate [mm/s] - integer, pointer :: n_irrig_steps_left(:) ! number of time steps for which we still need to irrigate today (if 0, ignore irrig_rate) - real(r8), pointer :: forc_pbot(:) ! surface atm pressure, downscaled to column (Pa) - real(r8), pointer :: forc_rho(:) ! surface air density, downscaled to column (kg/m^3) - real(r8), pointer :: glc_frac(:) ! ice fractional area - real(r8), pointer :: glc_topo(:) ! surface elevation (m) -end type column_pstate_type - -type(column_pstate_type) :: cps !column physical state variables - -!---------------------------------------------------- -! column energy state variables structure -!---------------------------------------------------- -type, public :: column_estate_type - real(r8), pointer :: t_grnd(:) !ground temperature (Kelvin) - real(r8), pointer :: t_grnd_u(:) !Urban ground temperature (Kelvin) - real(r8), pointer :: t_grnd_r(:) !Rural ground temperature (Kelvin) - real(r8), pointer :: dt_grnd(:) !change in t_grnd, last iteration (Kelvin) - real(r8), pointer :: t_soisno(:,:) !soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: t_soi_10cm(:) !soil temperature in top 10cm of soil (Kelvin) - real(r8), pointer :: t_lake(:,:) !lake temperature (Kelvin) (1:nlevlak) - real(r8), pointer :: tssbef(:,:) !soil/snow temperature before update (-nlevsno+1:nlevgrnd) - real(r8), pointer :: thv(:) !virtual potential temperature (kelvin) - real(r8), pointer :: hc_soi(:) !soil heat content (MJ/m2) - real(r8), pointer :: hc_soisno(:) !soil plus snow heat content (MJ/m2) - real(r8), pointer :: forc_t(:) !atm temperature, downscaled to column (Kelvin) - real(r8), pointer :: forc_th(:) !atm potl temperature, downscaled to column (Kelvin) -end type column_estate_type - -type(column_estate_type) :: ces !column energy state - -!---------------------------------------------------- -! column water state variables structure -!---------------------------------------------------- -type, public :: column_wstate_type - real(r8), pointer :: h2osno(:) !snow water (mm H2O) - real(r8), pointer :: errh2osno(:) !imbalance in snow water (mm H2O) - real(r8), pointer :: snow_sources(:) !snow sources (mm H2O/s) - real(r8), pointer :: snow_sinks(:) !snow sinks (mm H2O/s) - real(r8), pointer :: h2osoi_liq(:,:) !liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_ice(:,:) !ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: h2osoi_liqice_10cm(:) !liquid water + ice lens in top 10cm of soil (kg/m2) - real(r8), pointer :: h2osoi_vol(:,:) !volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] (nlevgrnd) - real(r8), pointer :: h2osno_old(:) !snow mass for previous time step (kg/m2) (new) - real(r8), pointer :: qg(:) !ground specific humidity [kg/kg] - real(r8), pointer :: dqgdT(:) !d(qg)/dT - real(r8), pointer :: snowice(:) !average snow ice lens - real(r8), pointer :: snowliq(:) !average snow liquid water - real(r8) ,pointer :: soilalpha(:) !factor that reduces ground saturated specific humidity (-) - real(r8), pointer :: soilbeta(:) !factor that reduces ground evaporation L&P1992(-) - real(r8) ,pointer :: soilalpha_u(:) !urban factor that reduces ground saturated specific humidity (-) - real(r8), pointer :: zwt(:) !water table depth - !real(r8), pointer :: frost_table(:) !frost table depth - !real(r8), pointer :: zwt_perched(:) !perched water table depth - real(r8), pointer :: fcov(:) !fractional impermeable area - real(r8), pointer :: wa(:) !water in the unconfined aquifer (mm) - real(r8), pointer :: wt(:) !total water storage (unsaturated soil water + groundwater) (mm) - real(r8), pointer :: qcharge(:) !aquifer recharge rate (mm/s) - real(r8), pointer :: smp_l(:,:) !soil matric potential (mm) - real(r8), pointer :: hk_l(:,:) !hydraulic conductivity (mm/s) - real(r8), pointer :: fsat(:) !fractional area with water table at surface - real(r8), pointer :: forc_q(:) !atm specific humidity, downscaled to column (kg/kg) -end type column_wstate_type - -type(column_wstate_type) :: cws !column water state -type(pft_wstate_type) :: pws_a !pft-level water state variables averaged to the column - -!---------------------------------------------------- -! column carbon state variables structure -!---------------------------------------------------- -type, public :: column_cstate_type - ! NOTE: the soilc variable is used by the original CLM C-cycle code, - ! and is not used by the CN code - real(r8), pointer :: soilc(:) !soil carbon (kg C /m**2) - ! BGC variables - real(r8), pointer :: cwdc(:) ! (gC/m2) coarse woody debris C - real(r8), pointer :: litr1c(:) ! (gC/m2) litter labile C - real(r8), pointer :: litr2c(:) ! (gC/m2) litter cellulose C - real(r8), pointer :: litr3c(:) ! (gC/m2) litter lignin C - real(r8), pointer :: soil1c(:) ! (gC/m2) soil organic matter C (fast pool) - real(r8), pointer :: soil2c(:) ! (gC/m2) soil organic matter C (medium pool) - real(r8), pointer :: soil3c(:) ! (gC/m2) soil organic matter C (slow pool) - real(r8), pointer :: soil4c(:) ! (gC/m2) soil organic matter C (slowest pool) - real(r8), pointer :: col_ctrunc(:) ! (gC/m2) column-level sink for C truncation - ! pools for dynamic landcover - real(r8), pointer :: seedc(:) ! (gC/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10c(:) ! (gC/m2) wood product C pool, 10-year lifespan - real(r8), pointer :: prod100c(:) ! (gC/m2) wood product C pool, 100-year lifespan - real(r8), pointer :: totprodc(:) ! (gC/m2) total wood product C - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: totlitc(:) ! (gC/m2) total litter carbon - real(r8), pointer :: totsomc(:) ! (gC/m2) total soil organic matter carbon - real(r8), pointer :: totecosysc(:) ! (gC/m2) total ecosystem carbon, incl veg but excl cpool - real(r8), pointer :: totcolc(:) ! (gC/m2) total column carbon, incl veg and cpool -end type column_cstate_type - -type(column_cstate_type) :: ccs !column carbon state -type(column_cstate_type) :: cc13s !column carbon-13 state - -!---------------------------------------------------- -! column nitrogen state variables structure -!---------------------------------------------------- -type, public :: column_nstate_type - ! BGC variables - real(r8), pointer :: cwdn(:) ! (gN/m2) coarse woody debris N - real(r8), pointer :: litr1n(:) ! (gN/m2) litter labile N - real(r8), pointer :: litr2n(:) ! (gN/m2) litter cellulose N - real(r8), pointer :: litr3n(:) ! (gN/m2) litter lignin N - real(r8), pointer :: soil1n(:) ! (gN/m2) soil organic matter N (fast pool) - real(r8), pointer :: soil2n(:) ! (gN/m2) soil organic matter N (medium pool) - real(r8), pointer :: soil3n(:) ! (gN/m2) soil orgainc matter N (slow pool) - real(r8), pointer :: soil4n(:) ! (gN/m2) soil orgainc matter N (slowest pool) - real(r8), pointer :: sminn(:) ! (gN/m2) soil mineral N - real(r8), pointer :: col_ntrunc(:) ! (gN/m2) column-level sink for N truncation - ! wood product pools, for dynamic landcover - real(r8), pointer :: seedn(:) ! (gN/m2) column-level pool for seeding new PFTs - real(r8), pointer :: prod10n(:) ! (gN/m2) wood product N pool, 10-year lifespan - real(r8), pointer :: prod100n(:) ! (gN/m2) wood product N pool, 100-year lifespan - real(r8), pointer :: totprodn(:) ! (gN/m2) total wood product N - ! summary (diagnostic) state variables, not involved in mass balance - real(r8), pointer :: totlitn(:) ! (gN/m2) total litter nitrogen - real(r8), pointer :: totsomn(:) ! (gN/m2) total soil organic matter nitrogen - real(r8), pointer :: totecosysn(:) ! (gN/m2) total ecosystem nitrogen, incl veg - real(r8), pointer :: totcoln(:) ! (gN/m2) total column nitrogen, incl veg -end type column_nstate_type - -type(column_nstate_type) :: cns !column nitrogen state -type(pft_nstate_type) :: pns_a !pft-level nitrogen state variables averaged to the column - -!---------------------------------------------------- -! column VOC state variables structure -!---------------------------------------------------- -type, public :: column_vstate_type - real(r8), pointer :: dummy_entry(:) -end type column_vstate_type - -!---------------------------------------------------- -! column DGVM state variables structure -!---------------------------------------------------- -type, public :: column_dgvstate_type - real(r8), pointer :: dummy_entry(:) -end type column_dgvstate_type - -!---------------------------------------------------- -! column dust state variables structure -!---------------------------------------------------- -type, public :: column_dstate_type - real(r8), pointer :: dummy_entry(:) -end type column_dstate_type - -!---------------------------------------------------- -! column energy flux variables structure -!---------------------------------------------------- -type, public :: column_eflux_type - real(r8), pointer :: eflx_snomelt(:) ! snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_u(:) ! urban snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_snomelt_r(:) ! rural snow melt heat flux (W/m**2) - real(r8), pointer :: eflx_impsoil(:) ! implicit evaporation for soil temperature equation - real(r8), pointer :: eflx_fgr12(:) ! ground heat flux between soil layers 1 and 2 (W/m2) - ! Urban variable - real(r8), pointer :: eflx_building_heat(:) ! heat flux from urban building interior to urban walls, roof (W/m**2) - real(r8), pointer :: eflx_urban_ac(:) ! urban air conditioning flux (W/m**2) - real(r8), pointer :: eflx_urban_heat(:) ! urban heating flux (W/m**2) - real(r8), pointer :: eflx_bot(:) ! heat flux from beneath the soil or ice column (W/m**2) - ! positive upward; usually eflx_bot >= 0 -end type column_eflux_type - -type(column_eflux_type) :: cef ! column energy flux -type(pft_eflux_type) :: pef_a ! pft-level energy flux variables averaged to the column - -!---------------------------------------------------- -! column momentum flux variables structure -!---------------------------------------------------- -type, public :: column_mflux_type - real(r8), pointer :: dummy_entry(:) -end type column_mflux_type - -type(column_mflux_type) :: cmf ! column momentum flux -type(pft_mflux_type) :: pmf_a ! pft-level momentum flux variables averaged to the column - -!---------------------------------------------------- -! column water flux variables structure -!---------------------------------------------------- -type, public :: column_wflux_type - real(r8), pointer :: qflx_infl(:) ! infiltration (mm H2O /s) - real(r8), pointer :: qflx_surf(:) ! surface runoff (mm H2O /s) - real(r8), pointer :: qflx_drain(:) ! sub-surface runoff (mm H2O /s) - real(r8), pointer :: qflx_top_soil(:)! net water input into soil from top (mm/s) - real(r8), pointer :: qflx_sl_top_soil(:) ! liquid water + ice from layer above soil to top soil layer or sent to qflx_qrgwl (mm H2O/s) - !real(r8), pointer :: qflx_snow_out(:) ! net water output from snow column - !real(r8), pointer :: qflx_drain_perched(:) ! sub-surface runoff from perched wt (mm H2O /s) - ! - real(r8), pointer :: qflx_h2osfc_surf(:) ! surface water runoff - real(r8), pointer :: qflx_snow_h2osfc(:) ! snow falling on surface water - real(r8), pointer :: qflx_drain_perched(:) ! sub-surface runoff from perched wt (mm H2O /s) - real(r8), pointer :: qflx_floodc(:) ! flood water flux at column level - real(r8), pointer :: qflx_snow_melt(:) ! snow melt (net) - ! - real(r8), pointer :: qflx_snomelt(:) ! snow melt (mm H2O /s) - real(r8), pointer :: qflx_qrgwl(:) ! qflx_surf at glaciers, wetlands, lakes - real(r8), pointer :: qflx_runoff(:) ! total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qflx_runoff_u(:)! Urban total runoff (qflx_drain+qflx_surf) (mm H2O /s) - real(r8), pointer :: qflx_runoff_r(:)! Rural total runoff (qflx_drain+qflx_surf+qflx_qrgwl) (mm H2O /s) - real(r8), pointer :: qmelt(:) ! snow melt [mm/s] - real(r8), pointer :: h2ocan_loss(:) ! mass balance correction term for dynamic weights - real(r8), pointer :: qflx_rsub_sat(:) ! soil saturation excess [mm/s] - real(r8), pointer :: flx_bc_dep_dry(:) ! dry (BCPHO+BCPHI) BC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_bc_dep_wet(:) ! wet (BCPHI) BC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_bc_dep_pho(:) ! hydrophobic BC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_bc_dep_phi(:) ! hydrophillic BC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_bc_dep(:) ! total (dry+wet) BC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_oc_dep_dry(:) ! dry (OCPHO+OCPHI) OC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_oc_dep_wet(:) ! wet (OCPHI) OC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_oc_dep_pho(:) ! hydrophobic OC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_oc_dep_phi(:) ! hydrophillic OC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_oc_dep(:) ! total (dry+wet) OC deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_dry1(:) ! dust species 1 dry deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_wet1(:) ! dust species 1 wet deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_dry2(:) ! dust species 2 dry deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_wet2(:) ! dust species 2 wet deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_dry3(:) ! dust species 3 dry deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_wet3(:) ! dust species 3 wet deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_dry4(:) ! dust species 4 dry deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep_wet4(:) ! dust species 4 wet deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: flx_dst_dep(:) ! total (dry+wet) dust deposition on ground (positive definite) (col) [kg/s] - real(r8), pointer :: qflx_snofrz_lyr(:,:)! snow freezing rate (positive definite) (col,lyr) [kg m-2 s-1] - real(r8), pointer :: qflx_snofrz_col(:) ! column-integrated snow freezing rate (positive definite) (col) [kg m-2 s-1] - real(r8), pointer :: qflx_irrig(:) ! irrigation flux (mm H2O/s) - real(r8), pointer :: qflx_glcice(:) ! net flux of new glacial ice (growth - melt) (mm H2O/s), passed to GLC - real(r8), pointer :: qflx_glcice_frz(:) ! ice growth (positive definite) (mm H2O/s) - real(r8), pointer :: qflx_glcice_melt(:) ! ice melt (positive definite) (mm H2O/s) - real(r8), pointer :: glc_rofi(:) ! ice runoff passed from GLC to CLM (mm H2O /s) - real(r8), pointer :: glc_rofl(:) ! liquid runoff passed from GLC to CLM (mm H2O /s) -end type column_wflux_type - -type(column_wflux_type) :: cwf ! column water flux -type(pft_wflux_type) :: pwf_a ! pft-level water flux variables averaged to the column - -!---------------------------------------------------- -! column carbon flux variables structure -!---------------------------------------------------- -type, public :: column_cflux_type - ! new variables for CN code - ! column-level gap mortality fluxes - real(r8), pointer :: m_leafc_to_litr1c(:) ! leaf C mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_leafc_to_litr2c(:) ! leaf C mortality to litter 2 C (gC/m2/s) - real(r8), pointer :: m_leafc_to_litr3c(:) ! leaf C mortality to litter 3 C (gC/m2/s) - real(r8), pointer :: m_frootc_to_litr1c(:) ! fine root C mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_frootc_to_litr2c(:) ! fine root C mortality to litter 2 C (gC/m2/s) - real(r8), pointer :: m_frootc_to_litr3c(:) ! fine root C mortality to litter 3 C (gC/m2/s) - real(r8), pointer :: m_livestemc_to_cwdc(:) ! live stem C mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: m_deadstemc_to_cwdc(:) ! dead stem C mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: m_livecrootc_to_cwdc(:) ! live coarse root C mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_cwdc(:) ! dead coarse root C mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: m_leafc_storage_to_litr1c(:) ! leaf C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_frootc_storage_to_litr1c(:) ! fine root C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_livestemc_storage_to_litr1c(:) ! live stem C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_deadstemc_storage_to_litr1c(:) ! dead stem C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_livecrootc_storage_to_litr1c(:) ! live coarse root C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_deadcrootc_storage_to_litr1c(:) ! dead coarse root C storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_gresp_storage_to_litr1c(:) ! growth respiration storage mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_leafc_xfer_to_litr1c(:) ! leaf C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_frootc_xfer_to_litr1c(:) ! fine root C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_livestemc_xfer_to_litr1c(:) ! live stem C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_deadstemc_xfer_to_litr1c(:) ! dead stem C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_livecrootc_xfer_to_litr1c(:) ! live coarse root C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_deadcrootc_xfer_to_litr1c(:) ! dead coarse root C transfer mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: m_gresp_xfer_to_litr1c(:) ! growth respiration transfer mortality to litter 1 C (gC/m2/s) - ! column-level harvest mortality fluxes - real(r8), pointer :: hrv_leafc_to_litr1c(:) ! leaf C harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_leafc_to_litr2c(:) ! leaf C harvest mortality to litter 2 C (gC/m2/s) - real(r8), pointer :: hrv_leafc_to_litr3c(:) ! leaf C harvest mortality to litter 3 C (gC/m2/s) - real(r8), pointer :: hrv_frootc_to_litr1c(:) ! fine root C harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_frootc_to_litr2c(:) ! fine root C harvest mortality to litter 2 C (gC/m2/s) - real(r8), pointer :: hrv_frootc_to_litr3c(:) ! fine root C harvest mortality to litter 3 C (gC/m2/s) - real(r8), pointer :: hrv_livestemc_to_cwdc(:) ! live stem C harvest mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) ! dead stem C harvest mortality to 10-year product pool (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) ! dead stem C harvest mortality to 100-year product pool (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_to_cwdc(:) ! live coarse root C harvest mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_to_cwdc(:) ! dead coarse root C harvest mortality to coarse woody debris C (gC/m2/s) - real(r8), pointer :: hrv_leafc_storage_to_litr1c(:) ! leaf C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_frootc_storage_to_litr1c(:) ! fine root C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_livestemc_storage_to_litr1c(:) ! live stem C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_storage_to_litr1c(:) ! dead stem C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_storage_to_litr1c(:) ! live coarse root C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_storage_to_litr1c(:) ! dead coarse root C storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_gresp_storage_to_litr1c(:) ! growth respiration storage harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_leafc_xfer_to_litr1c(:) ! leaf C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_frootc_xfer_to_litr1c(:) ! fine root C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_livestemc_xfer_to_litr1c(:) ! live stem C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_deadstemc_xfer_to_litr1c(:) ! dead stem C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_livecrootc_xfer_to_litr1c(:) ! live coarse root C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litr1c(:) ! dead coarse root C transfer harvest mortality to litter 1 C (gC/m2/s) - real(r8), pointer :: hrv_gresp_xfer_to_litr1c(:) ! growth respiration transfer harvest mortality to litter 1 C (gC/m2/s) - ! column-level fire fluxes - real(r8), pointer :: m_deadstemc_to_cwdc_fire(:) ! dead stem C to coarse woody debris C by fire (gC/m2/s) - real(r8), pointer :: m_deadcrootc_to_cwdc_fire(:) ! dead coarse root C to to woody debris C by fire (gC/m2/s) - real(r8), pointer :: m_litr1c_to_fire(:) ! litter 1 C fire loss (gC/m2/s) - real(r8), pointer :: m_litr2c_to_fire(:) ! litter 2 C fire loss (gC/m2/s) - real(r8), pointer :: m_litr3c_to_fire(:) ! litter 3 C fire loss (gC/m2/s) - real(r8), pointer :: m_cwdc_to_fire(:) ! coarse woody debris C fire loss (gC/m2/s) - ! litterfall fluxes - real(r8), pointer :: livestemc_to_litr1c(:) ! livestem C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr2c(:) ! livestem C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: livestemc_to_litr3c(:) ! livestem C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr1c(:) ! leaf C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr2c(:) ! leaf C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: leafc_to_litr3c(:) ! leaf C litterfall to litter 3 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr1c(:) ! fine root C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr2c(:) ! fine root C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: frootc_to_litr3c(:) ! fine root C litterfall to litter 3 C (gC/m2/s) - ! litterfall fluxes for prognostic crop model - real(r8), pointer :: grainc_to_litr1c(:) ! grain C litterfall to litter 1 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr2c(:) ! grain C litterfall to litter 2 C (gC/m2/s) - real(r8), pointer :: grainc_to_litr3c(:) ! grain C litterfall to litter 3 C (gC/m2/s) - ! decomposition fluxes - real(r8), pointer :: cwdc_to_litr2c(:) ! decomp. of coarse woody debris C to litter 2 C (gC/m2/s) - real(r8), pointer :: cwdc_to_litr3c(:) ! decomp. of coarse woody debris C to litter 3 C (gC/m2/s) - real(r8), pointer :: litr1_hr(:) ! het. resp. from litter 1 C (gC/m2/s) - real(r8), pointer :: litr1c_to_soil1c(:) ! decomp. of litter 1 C to SOM 1 C (gC/m2/s) - real(r8), pointer :: litr2_hr(:) ! het. resp. from litter 2 C (gC/m2/s) - real(r8), pointer :: litr2c_to_soil2c(:) ! decomp. of litter 2 C to SOM 2 C (gC/m2/s) - real(r8), pointer :: litr3_hr(:) ! het. resp. from litter 3 C (gC/m2/s) - real(r8), pointer :: litr3c_to_soil3c(:) ! decomp. of litter 3 C to SOM 3 C (gC/m2/s) - real(r8), pointer :: soil1_hr(:) ! het. resp. from SOM 1 C (gC/m2/s) - real(r8), pointer :: soil1c_to_soil2c(:) ! decomp. of SOM 1 C to SOM 2 C (gC/m2/s) - real(r8), pointer :: soil2_hr(:) ! het. resp. from SOM 2 C (gC/m2/s) - real(r8), pointer :: soil2c_to_soil3c(:) ! decomp. of SOM 2 C to SOM 3 C (gC/m2/s) - real(r8), pointer :: soil3_hr(:) ! het. resp. from SOM 3 C (gC/m2/s) - real(r8), pointer :: soil3c_to_soil4c(:) ! decomp. of SOM 3 C to SOM 4 C (gC/m2/s) - real(r8), pointer :: soil4_hr(:) ! het. resp. from SOM 4 C (gC/m2/s) - ! dynamic landcover fluxes - real(r8), pointer :: dwt_seedc_to_leaf(:) ! (gC/m2/s) seed source to PFT-level - real(r8), pointer :: dwt_seedc_to_deadstem(:) ! (gC/m2/s) seed source to PFT-level - real(r8), pointer :: dwt_conv_cflux(:) ! (gC/m2/s) conversion C flux (immediate loss to atm) - real(r8), pointer :: dwt_prod10c_gain(:) ! (gC/m2/s) addition to 10-yr wood product pool - real(r8), pointer :: dwt_prod100c_gain(:) ! (gC/m2/s) addition to 100-yr wood product pool - real(r8), pointer :: dwt_frootc_to_litr1c(:) ! (gC/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootc_to_litr2c(:) ! (gC/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootc_to_litr3c(:) ! (gC/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_livecrootc_to_cwdc(:) ! (gC/m2/s) live coarse root to CWD due to landcover change - real(r8), pointer :: dwt_deadcrootc_to_cwdc(:) ! (gC/m2/s) dead coarse root to CWD due to landcover change - real(r8), pointer :: dwt_closs(:) ! (gC/m2/s) total carbon loss from product pools and conversion - real(r8), pointer :: landuseflux(:) ! (gC/m2/s) dwt_closs+product_closs - real(r8), pointer :: landuptake(:) ! (gC/m2/s) nee-landuseflux - ! wood product pool loss fluxes - real(r8), pointer :: prod10c_loss(:) ! (gC/m2/s) decomposition loss from 10-yr wood product pool - real(r8), pointer :: prod100c_loss(:) ! (gC/m2/s) decomposition loss from 100-yr wood product pool - real(r8), pointer :: product_closs(:) ! (gC/m2/s) total wood product carbon loss - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: lithr(:) ! (gC/m2/s) litter heterotrophic respiration - real(r8), pointer :: somhr(:) ! (gC/m2/s) soil organic matter heterotrophic respiration - real(r8), pointer :: hr(:) ! (gC/m2/s) total heterotrophic respiration - real(r8), pointer :: sr(:) ! (gC/m2/s) total soil respiration (HR + root resp) - real(r8), pointer :: er(:) ! (gC/m2/s) total ecosystem respiration, autotrophic + heterotrophic - real(r8), pointer :: litfire(:) ! (gC/m2/s) litter fire losses - real(r8), pointer :: somfire(:) ! (gC/m2/s) soil organic matter fire losses - real(r8), pointer :: totfire(:) ! (gC/m2/s) total ecosystem fire losses - real(r8), pointer :: nep(:) ! (gC/m2/s) net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink - real(r8), pointer :: nbp(:) ! (gC/m2/s) net biome production, includes fire, landuse, and harvest flux, positive for sink - real(r8), pointer :: nee(:) ! (gC/m2/s) net ecosystem exchange of carbon, includes fire, landuse, harvest, and hrv_xsmrpool flux, positive for source - real(r8), pointer :: col_cinputs(:) ! (gC/m2/s) total column-level carbon inputs (for balance check) - real(r8), pointer :: col_coutputs(:) ! (gC/m2/s) total column-level carbon outputs (for balance check) - ! CLAMP summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: cwdc_hr(:) ! (gC/m2/s) col-level coarse woody debris C heterotrophic respiration - real(r8), pointer :: cwdc_loss(:) ! (gC/m2/s) col-level coarse woody debris C loss - real(r8), pointer :: litterc_loss(:) ! (gC/m2/s) col-level litter C loss - ! new variables for fire - real(r8), pointer :: col_fire_closs(:) ! (gC/m2/s) total column-level fire C loss -end type column_cflux_type - -type(column_cflux_type) :: ccf ! column carbon flux -type(column_cflux_type) :: cc13f ! column carbon-13 flux - -!---------------------------------------------------- -! column nitrogen flux variables structure -!---------------------------------------------------- -type, public :: column_nflux_type - ! new variables for CN code - ! deposition fluxes - real(r8), pointer :: ndep_to_sminn(:) ! atmospheric N deposition to soil mineral N (gN/m2/s) - real(r8), pointer :: nfix_to_sminn(:) ! symbiotic/asymbiotic N fixation to soil mineral N (gN/m2/s) - ! column-level gap mortality fluxes - real(r8), pointer :: m_leafn_to_litr1n(:) ! leaf N mortality to litter 1 N (gC/m2/s) - real(r8), pointer :: m_leafn_to_litr2n(:) ! leaf N mortality to litter 2 N (gC/m2/s) - real(r8), pointer :: m_leafn_to_litr3n(:) ! leaf N mortality to litter 3 N (gC/m2/s) - real(r8), pointer :: m_frootn_to_litr1n(:) ! fine root N mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_frootn_to_litr2n(:) ! fine root N mortality to litter 2 N (gN/m2/s) - real(r8), pointer :: m_frootn_to_litr3n(:) ! fine root N mortality to litter 3 N (gN/m2/s) - real(r8), pointer :: m_livestemn_to_cwdn(:) ! live stem N mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: m_deadstemn_to_cwdn(:) ! dead stem N mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: m_livecrootn_to_cwdn(:) ! live coarse root N mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_cwdn(:) ! dead coarse root N mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: m_retransn_to_litr1n(:) ! retranslocated N pool mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_leafn_storage_to_litr1n(:) ! leaf N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_frootn_storage_to_litr1n(:) ! fine root N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_livestemn_storage_to_litr1n(:) ! live stem N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_deadstemn_storage_to_litr1n(:) ! dead stem N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_livecrootn_storage_to_litr1n(:) ! live coarse root N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_deadcrootn_storage_to_litr1n(:) ! dead coarse root N storage mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_leafn_xfer_to_litr1n(:) ! leaf N transfer mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_frootn_xfer_to_litr1n(:) ! fine root N transfer mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_livestemn_xfer_to_litr1n(:) ! live stem N transfer mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_deadstemn_xfer_to_litr1n(:) ! dead stem N transfer mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_livecrootn_xfer_to_litr1n(:) ! live coarse root N transfer mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: m_deadcrootn_xfer_to_litr1n(:) ! dead coarse root N transfer mortality to litter 1 N (gN/m2/s) - ! column-level harvest fluxes - real(r8), pointer :: hrv_leafn_to_litr1n(:) ! leaf N harvest mortality to litter 1 N (gC/m2/s) - real(r8), pointer :: hrv_leafn_to_litr2n(:) ! leaf N harvest mortality to litter 2 N (gC/m2/s) - real(r8), pointer :: hrv_leafn_to_litr3n(:) ! leaf N harvest mortality to litter 3 N (gC/m2/s) - real(r8), pointer :: hrv_frootn_to_litr1n(:) ! fine root N harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_frootn_to_litr2n(:) ! fine root N harvest mortality to litter 2 N (gN/m2/s) - real(r8), pointer :: hrv_frootn_to_litr3n(:) ! fine root N harvest mortality to litter 3 N (gN/m2/s) - real(r8), pointer :: hrv_livestemn_to_cwdn(:) ! live stem N harvest mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_to_prod10n(:) ! dead stem N harvest mortality to 10-year product pool (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_to_prod100n(:) ! dead stem N harvest mortality to 100-year product pool (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_to_cwdn(:) ! live coarse root N harvest mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_to_cwdn(:) ! dead coarse root N harvest mortality to coarse woody debris N (gN/m2/s) - real(r8), pointer :: hrv_retransn_to_litr1n(:) ! retranslocated N pool harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_leafn_storage_to_litr1n(:) ! leaf N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_frootn_storage_to_litr1n(:) ! fine root N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_livestemn_storage_to_litr1n(:) ! live stem N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_storage_to_litr1n(:) ! dead stem N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_storage_to_litr1n(:) ! live coarse root N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_storage_to_litr1n(:) ! dead coarse root N storage harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_leafn_xfer_to_litr1n(:) ! leaf N transfer harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_frootn_xfer_to_litr1n(:) ! fine root N transfer harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_livestemn_xfer_to_litr1n(:) ! live stem N transfer harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_deadstemn_xfer_to_litr1n(:) ! dead stem N transfer harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_livecrootn_xfer_to_litr1n(:) ! live coarse root N transfer harvest mortality to litter 1 N (gN/m2/s) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litr1n(:) ! dead coarse root N transfer harvest mortality to litter 1 N (gN/m2/s) - ! column-level fire fluxes - real(r8), pointer :: m_deadstemn_to_cwdn_fire(:) ! dead stem N to coarse woody debris N by fire (gN/m2/s) - real(r8), pointer :: m_deadcrootn_to_cwdn_fire(:) ! dead coarse root N to to woody debris N by fire (gN/m2/s) - real(r8), pointer :: m_litr1n_to_fire(:) ! litter 1 N fire loss (gN/m2/s) - real(r8), pointer :: m_litr2n_to_fire(:) ! litter 2 N fire loss (gN/m2/s) - real(r8), pointer :: m_litr3n_to_fire(:) ! litter 3 N fire loss (gN/m2/s) - real(r8), pointer :: m_cwdn_to_fire(:) ! coarse woody debris N fire loss (gN/m2/s) - ! litterfall fluxes - real(r8), pointer :: livestemn_to_litr1n(:) ! livestem N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr2n(:) ! livestem N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: livestemn_to_litr3n(:) ! livestem N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr1n(:) ! leaf N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr2n(:) ! leaf N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: leafn_to_litr3n(:) ! leaf N litterfall to litter 3 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr1n(:) ! fine root N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr2n(:) ! fine root N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: frootn_to_litr3n(:) ! fine root N litterfall to litter 3 N (gN/m2/s) - ! litterfall fluxes for prognostic crop model - real(r8), pointer :: grainn_to_litr1n(:) ! grain N litterfall to litter 1 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr2n(:) ! grain N litterfall to litter 2 N (gN/m2/s) - real(r8), pointer :: grainn_to_litr3n(:) ! grain N litterfall to litter 3 N (gN/m2/s) - ! decomposition fluxes - real(r8), pointer :: cwdn_to_litr2n(:) ! decomp. of coarse woody debris N to litter 2 N (gN/m2/s) - real(r8), pointer :: cwdn_to_litr3n(:) ! decomp. of coarse woody debris N to litter 3 N (gN/m2/s) - real(r8), pointer :: litr1n_to_soil1n(:) ! decomp. of litter 1 N to SOM 1 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil1n_l1(:) ! mineral N flux for decomp. of litter 1 to SOM 1 (gN/m2/s) - real(r8), pointer :: litr2n_to_soil2n(:) ! decomp. of litter 2 N to SOM 2 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil2n_l2(:) ! mineral N flux for decomp. of litter 2 to SOM 2 (gN/m2/s) - real(r8), pointer :: litr3n_to_soil3n(:) ! decomp. of litter 3 N to SOM 3 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil3n_l3(:) ! mineral N flux for decomp. of litter 3 to SOM 3 (gN/m2/s) - real(r8), pointer :: soil1n_to_soil2n(:) ! decomp. of SOM 1 N to SOM 2 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil2n_s1(:) ! mineral N flux for decomp. of SOM 1 to SOM 2 (gN/m2/s) - real(r8), pointer :: soil2n_to_soil3n(:) ! decomp. of SOM 2 N to SOM 3 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil3n_s2(:) ! mineral N flux for decomp. of SOM 2 to SOM 3 (gN/m2/s) - real(r8), pointer :: soil3n_to_soil4n(:) ! decomp. of SOM 3 N to SOM 4 N (gN/m2/s) - real(r8), pointer :: sminn_to_soil4n_s3(:) ! mineral N flux for decomp. of SOM 3 to SOM 4 (gN/m2/s) - real(r8), pointer :: soil4n_to_sminn(:) ! N mineralization for decomp. of SOM 4 (gN/m2/s) - ! denitrification fluxes - real(r8), pointer :: sminn_to_denit_l1s1(:) ! denitrification for decomp. of litter 1 to SOM 1 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_l2s2(:) ! denitrification for decomp. of litter 2 to SOM 2 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_l3s3(:) ! denitrification for decomp. of litter 3 to SOM 3 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_s1s2(:) ! denitrification for decomp. of SOM 1 to SOM 2 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_s2s3(:) ! denitrification for decomp. of SOM 2 to SOM 3 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_s3s4(:) ! denitrification for decomp. of SOM 3 to SOM 4 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_s4(:) ! denitrification for decomp. of SOM 4 (gN/m2/s) - real(r8), pointer :: sminn_to_denit_excess(:) ! denitrification from excess mineral N pool (gN/m2/s) - ! leaching fluxes - real(r8), pointer :: sminn_leached(:) ! soil mineral N pool loss to leaching (gN/m2/s) - ! dynamic landcover fluxes - real(r8), pointer :: dwt_seedn_to_leaf(:) ! (gN/m2/s) seed source to PFT-level - real(r8), pointer :: dwt_seedn_to_deadstem(:) ! (gN/m2/s) seed source to PFT-level - real(r8), pointer :: dwt_conv_nflux(:) ! (gN/m2/s) conversion N flux (immediate loss to atm) - real(r8), pointer :: dwt_prod10n_gain(:) ! (gN/m2/s) addition to 10-yr wood product pool - real(r8), pointer :: dwt_prod100n_gain(:) ! (gN/m2/s) addition to 100-yr wood product pool - real(r8), pointer :: dwt_frootn_to_litr1n(:) ! (gN/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootn_to_litr2n(:) ! (gN/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_frootn_to_litr3n(:) ! (gN/m2/s) fine root to litter due to landcover change - real(r8), pointer :: dwt_livecrootn_to_cwdn(:) ! (gN/m2/s) live coarse root to CWD due to landcover change - real(r8), pointer :: dwt_deadcrootn_to_cwdn(:) ! (gN/m2/s) dead coarse root to CWD due to landcover change - real(r8), pointer :: dwt_nloss(:) ! (gN/m2/s) total nitrogen loss from product pools and conversion - ! wood product pool loss fluxes - real(r8), pointer :: prod10n_loss(:) ! (gN/m2/s) decomposition loss from 10-yr wood product pool - real(r8), pointer :: prod100n_loss(:) ! (gN/m2/s) decomposition loss from 100-yr wood product pool - real(r8), pointer :: product_nloss(:) ! (gN/m2/s) total wood product nitrogen loss - ! summary (diagnostic) flux variables, not involved in mass balance - real(r8), pointer :: potential_immob(:) ! potential N immobilization (gN/m2/s) - real(r8), pointer :: actual_immob(:) ! actual N immobilization (gN/m2/s) - real(r8), pointer :: sminn_to_plant(:) ! plant uptake of soil mineral N (gN/m2/s) - real(r8), pointer :: supplement_to_sminn(:) ! supplemental N supply (gN/m2/s) - real(r8), pointer :: gross_nmin(:) ! gross rate of N mineralization (gN/m2/s) - real(r8), pointer :: net_nmin(:) ! net rate of N mineralization (gN/m2/s) - real(r8), pointer :: denit(:) ! total rate of denitrification (gN/m2/s) - real(r8), pointer :: col_ninputs(:) ! column-level N inputs (gN/m2/s) - real(r8), pointer :: col_noutputs(:) ! column-level N outputs (gN/m2/s) - ! new variables for fire - real(r8), pointer :: col_fire_nloss(:) ! total column-level fire N loss (gN/m2/s) -end type column_nflux_type - -type(column_nflux_type) :: cnf !column nitrogen flux - -!---------------------------------------------------- -! column dust flux variables structure -!---------------------------------------------------- -type, public :: column_dflux_type - real(r8), pointer :: dummy_entry(:) -end type column_dflux_type - -!---------------------------------------------------- -! End definition of structures defined at the column_type level -!---------------------------------------------------- -!******************************************************************************* - - -!******************************************************************************* -!---------------------------------------------------- -! Begin definition of structures defined at the landunit_type level -!---------------------------------------------------- -!---------------------------------------------------- -! landunit physical state variables structure -!---------------------------------------------------- -! note - landunit type can be vegetated (includes bare soil), deep lake, -! shallow lake, wetland, glacier or urban -type, public :: landunit_pstate_type - ! Urban variables - real(r8), pointer :: t_building(:) ! internal building temperature (K) - real(r8), pointer :: t_building_max(:) ! maximum internal building temperature (K) - real(r8), pointer :: t_building_min(:) ! minimum internal building temperature (K) - real(r8), pointer :: tk_wall(:,:) ! thermal conductivity of urban wall (W/m/K) - real(r8), pointer :: tk_roof(:,:) ! thermal conductivity of urban roof (W/m/K) - real(r8), pointer :: tk_improad(:,:) ! thermal conductivity of urban impervious road (W/m/K) - real(r8), pointer :: cv_wall(:,:) ! heat capacity of urban wall (J/m^3/K) - real(r8), pointer :: cv_roof(:,:) ! heat capacity of urban roof (J/m^3/K) - real(r8), pointer :: cv_improad(:,:) ! heat capacity of urban impervious road (J/m^3/K) - real(r8), pointer :: thick_wall(:) ! total thickness of urban wall (m) - real(r8), pointer :: thick_roof(:) ! total thickness of urban roof (m) - integer , pointer :: nlev_improad(:) ! number of impervious road layers (-) - real(r8), pointer :: vf_sr(:) ! view factor of sky for road - real(r8), pointer :: vf_wr(:) ! view factor of one wall for road - real(r8), pointer :: vf_sw(:) ! view factor of sky for one wall - real(r8), pointer :: vf_rw(:) ! view factor of road for one wall - real(r8), pointer :: vf_ww(:) ! view factor of opposing wall for one wall - real(r8), pointer :: taf(:) ! urban canopy air temperature (K) - real(r8), pointer :: qaf(:) ! urban canopy air specific humidity (kg/kg) - real(r8), pointer :: sabs_roof_dir(:,:) ! direct solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_roof_dif(:,:) ! diffuse solar absorbed by roof per unit ground area per unit incident flux - real(r8), pointer :: sabs_sunwall_dir(:,:) ! direct solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_sunwall_dif(:,:) ! diffuse solar absorbed by sunwall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dir(:,:) ! direct solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_shadewall_dif(:,:) ! diffuse solar absorbed by shadewall per unit wall area per unit incident flux - real(r8), pointer :: sabs_improad_dir(:,:) ! direct solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_improad_dif(:,:) ! diffuse solar absorbed by impervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dir(:,:) ! direct solar absorbed by pervious road per unit ground area per unit incident flux - real(r8), pointer :: sabs_perroad_dif(:,:) ! diffuse solar absorbed by pervious road per unit ground area per unit incident flux -end type landunit_pstate_type - -type(landunit_pstate_type) :: lps !land unit physical state variables - -!---------------------------------------------------- -! landunit energy flux variables structure -!---------------------------------------------------- -type, public :: landunit_eflux_type - ! Urban variables - real(r8), pointer :: eflx_traffic_factor(:) ! multiplicative traffic factor for sensible heat flux from urban traffic (-) - real(r8), pointer :: eflx_traffic(:) ! traffic sensible heat flux (W/m**2) - real(r8), pointer :: eflx_wasteheat(:) ! sensible heat flux from domestic heating/cooling sources of waste heat (W/m**2) - real(r8), pointer :: eflx_heat_from_ac(:) ! sensible heat flux to be put back into canyon due to removal by AC (W/m**2) -end type landunit_eflux_type - -type(landunit_eflux_type) :: lef ! average of energy fluxes all columns - -!---------------------------------------------------- -! End definition of structures defined at the landunit_type level -!---------------------------------------------------- -!******************************************************************************* - -!******************************************************************************* -!---------------------------------------------------- -! Begin definition of structures defined at the gridcell_type level -!---------------------------------------------------- -! gridcell physical state variables structure -!---------------------------------------------------- -type, public :: gridcell_pstate_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_pstate_type - -!---------------------------------------------------- -! gridcell energy state variables structure -!---------------------------------------------------- -type, public :: gridcell_estate_type - real(r8), pointer :: gc_heat1(:) ! initial gridcell total heat content - real(r8), pointer :: gc_heat2(:) ! post land cover change total heat content -end type gridcell_estate_type - -type(gridcell_estate_type) :: ges !average of energy states all landunits - -!---------------------------------------------------- -! gridcell water state variables structure -!---------------------------------------------------- -type, public :: gridcell_wstate_type - real(r8), pointer :: gc_liq1(:) ! initial gridcell total h2o liq content - real(r8), pointer :: gc_liq2(:) ! post land cover change total liq content - real(r8), pointer :: gc_ice1(:) ! initial gridcell total h2o liq content - real(r8), pointer :: gc_ice2(:) ! post land cover change total ice content -end type gridcell_wstate_type - -type(gridcell_wstate_type) :: gws !average of water states all landunits - -!---------------------------------------------------- -! gridcell carbon state variables structure -!---------------------------------------------------- -type, public :: gridcell_cstate_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_cstate_type - -type(column_cstate_type):: ccs_a !column-level carbon state variables averaged to gridcell - -!---------------------------------------------------- -! gridcell nitrogen state variables structure -!---------------------------------------------------- -type, public :: gridcell_nstate_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_nstate_type - -type(column_nstate_type):: cns_a !column-level nitrogen state variables averaged to gridcell - -!---------------------------------------------------- -! gridcell VOC state variables structure -!---------------------------------------------------- -type, public :: gridcell_vstate_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_vstate_type - -type(column_vstate_type):: cvs_a !column-level VOC state variables averaged to gridcell - -!---------------------------------------------------- -! gridcell VOC emission factor variables structure (heald) -!---------------------------------------------------- -type, public :: gridcell_efstate_type - real(r8), pointer :: efisop(:,:) ! isoprene emission factors -end type gridcell_efstate_type -type(gridcell_efstate_type):: gve !gridcell VOC emission factors - -!---------------------------------------------------- -! gridcell dust state variables structure -!---------------------------------------------------- -type, public :: gridcell_dstate_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_dstate_type - -!---------------------------------------------------- -! gridcell DGVM state variables structure -!---------------------------------------------------- -type, public :: gridcell_dgvstate_type - real(r8), pointer :: agdd20(:) !20-yr running mean of agdd - real(r8), pointer :: tmomin20(:) !20-yr running mean of tmomin - real(r8), pointer :: t10min(:) !ann minimum of 10-day running mean (K) -end type gridcell_dgvstate_type - -type(gridcell_dgvstate_type):: gdgvs !gridcell DGVM structure - -!---------------------------------------------------- -! gridcell energy flux variables structure -!---------------------------------------------------- -type, public :: gridcell_eflux_type - real(r8), pointer :: eflx_sh_totg(:) ! total grid-level sensible heat flux - real(r8), pointer :: eflx_dynbal(:) ! dynamic land cover change conversion energy flux -end type gridcell_eflux_type - -type(gridcell_eflux_type) :: gef !average of energy fluxes all landunits - -!---------------------------------------------------- -! gridcell momentum flux variables structure -!-- ------------------------------------------------- -type, public :: gridcell_mflux_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_mflux_type - -!---------------------------------------------------- -! gridcell water flux variables structure -!---------------------------------------------------- -type, public :: gridcell_wflux_type - real(r8), pointer :: qflx_runoffg(:) ! total grid-level liq runoff - real(r8), pointer :: qflx_snwcp_iceg(:) ! total grid-level ice runoff - real(r8), pointer :: qflx_liq_dynbal(:) ! liq dynamic land cover change conversion runoff flux - real(r8), pointer :: qflx_ice_dynbal(:) ! ice dynamic land cover change conversion runoff flux - real(r8), pointer :: qflx_floodg(:) ! total grid-level flood water flux -end type gridcell_wflux_type - -type(gridcell_wflux_type) :: gwf !average of water fluxes all landunits - -!---------------------------------------------------- -! gridcell carbon flux variables structure -!---------------------------------------------------- -type, public :: gridcell_cflux_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_cflux_type - -!---------------------------------------------------- -! gridcell nitrogen flux variables structure -!---------------------------------------------------- -type, public :: gridcell_nflux_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_nflux_type - -!---------------------------------------------------- -! gridcell dust flux variables structure -!---------------------------------------------------- -type, public :: gridcell_dflux_type - real(r8), pointer :: dummy_entry(:) -end type gridcell_dflux_type - -!---------------------------------------------------- -! End definition of structures defined at the gridcell_type level -!---------------------------------------------------- -!******************************************************************************* - -!******************************************************************************* -!---------------------------------------------------- -! define the pft structure -!---------------------------------------------------- -type, public :: pft_type - integer , pointer :: column(:) !index into column level quantities - real(r8), pointer :: wtcol(:) !weight (relative to column) - integer , pointer :: landunit(:) !index into landunit level quantities - real(r8), pointer :: wtlunit(:) !weight (relative to landunit) - integer , pointer :: gridcell(:) !index into gridcell level quantities - real(r8), pointer :: wtgcell(:) !weight (relative to gridcell) - integer , pointer :: itype(:) !pft vegetation - integer , pointer :: mxy(:) !m index for laixy(i,j,m),etc. -end type pft_type - -type(pft_type), target :: pft !plant functional type (pft) data structure - -!---------------------------------------------------- -! define the column structure -!---------------------------------------------------- -type, public :: column_type - integer , pointer :: landunit(:) !index into landunit level quantities - real(r8), pointer :: wtlunit(:) !weight (relative to landunit) - integer , pointer :: gridcell(:) !index into gridcell level quantities - real(r8), pointer :: wtgcell(:) !weight (relative to gridcell) - integer , pointer :: pfti(:) !beginning pft index for each column - integer , pointer :: pftf(:) !ending pft index for each column - integer , pointer :: npfts(:) !number of pfts for each column - integer , pointer :: itype(:) !column type -end type column_type - -type(column_type), target :: col !column data structure (soil/snow/canopy columns) - -!---------------------------------------------------- -! define the geomorphological land unit structure -!---------------------------------------------------- -type, public :: landunit_type - integer , pointer :: gridcell(:) !index into gridcell level quantities - real(r8), pointer :: wtgcell(:) !weight (relative to gridcell) - integer , pointer :: coli(:) !beginning column index per landunit - integer , pointer :: colf(:) !ending column index for each landunit - integer , pointer :: ncolumns(:) !number of columns for each landunit - integer , pointer :: pfti(:) !beginning pft index for each landunit - integer , pointer :: pftf(:) !ending pft index for each landunit - integer , pointer :: npfts(:) !number of pfts for each landunit - integer , pointer :: itype(:) !landunit type - logical , pointer :: ifspecial(:) !BOOL: true=>landunit is not vegetated - logical , pointer :: lakpoi(:) !BOOL: true=>lake point - logical , pointer :: urbpoi(:) !BOOL: true=>urban point - logical , pointer :: glcmecpoi(:) !BOOL: true=>glacier_mec point - - ! Urban canyon related properties - real(r8), pointer :: canyon_hwr(:) ! urban landunit canyon height to width ratio (-) - real(r8), pointer :: wtroad_perv(:) ! urban landunit weight of pervious road column to total road (-) - real(r8), pointer :: wtlunit_roof(:) ! weight of roof with respect to urban landunit (-) - - ! Urban related info MV - this should be moved to land physical state - MV - real(r8), pointer :: ht_roof(:) ! height of urban roof (m) - real(r8), pointer :: wind_hgt_canyon(:)! height above road at which wind in canyon is to be computed (m) - real(r8), pointer :: z_0_town(:) ! urban landunit momentum roughness length (m) - real(r8), pointer :: z_d_town(:) ! urban landunit displacement height (m) -end type landunit_type - -type(landunit_type), target :: lun !geomorphological landunits - -!---------------------------------------------------- -! define the gridcell structure -!---------------------------------------------------- -type, public :: gridcell_type - integer , pointer :: luni(:) !beginning landunit index - integer , pointer :: lunf(:) !ending landunit index - integer , pointer :: nlandunits(:) !number of landunit for each gridcell - integer , pointer :: coli(:) !beginning column index - integer , pointer :: colf(:) !ending column index - integer , pointer :: ncolumns(:) !number of columns for each gridcell - integer , pointer :: pfti(:) !beginning pft index - integer , pointer :: pftf(:) !ending pft index - integer , pointer :: npfts(:) !number of pfts for each gridcell - integer , pointer :: gindex(:) !global index - real(r8), pointer :: area(:) !total land area, gridcell (km^2) - real(r8), pointer :: lat(:) !latitude (radians) - real(r8), pointer :: lon(:) !longitude (radians) - real(r8), pointer :: latdeg(:) !latitude (degrees) - real(r8), pointer :: londeg(:) !longitude (degrees) - real(r8), pointer :: gris_mask(:) !Greenland ice sheet mask - real(r8), pointer :: gris_area(:) !Greenland ice-covered area per gridcell (km^2) - real(r8), pointer :: aais_mask(:) !Antarctic ice sheet mask - real(r8), pointer :: aais_area(:) !Antarctic ice-covered area per gridcell (km^2) -end type gridcell_type - -type(gridcell_type), target :: grc !gridcell data structure - -!---------------------------------------------------- -! End definition of spatial scaling hierarchy -!---------------------------------------------------- - -character(len=16), parameter, public :: grlnd = 'lndgrid' ! name of lndgrid -character(len=16), parameter, public :: namea = 'gridcellatm' ! name of atmgrid -character(len=16), parameter, public :: nameg = 'gridcell' ! name of gridcells -character(len=16), parameter, public :: namel = 'landunit' ! name of landunits -character(len=16), parameter, public :: namec = 'column' ! name of columns -character(len=16), parameter, public :: namep = 'pft' ! name of pfts - -! -!EOP -!----------------------------------------------------------------------- -end module clmtype diff --git a/src_clm40/main/clmtypeInitMod.F90 b/src_clm40/main/clmtypeInitMod.F90 deleted file mode 100644 index f31c1dec28..0000000000 --- a/src_clm40/main/clmtypeInitMod.F90 +++ /dev/null @@ -1,4116 +0,0 @@ -module clmtypeInitMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: clmtypeInitMod -! -! !DESCRIPTION: -! Allocate clmtype components and initialize them to signaling NaN. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) - use clmtype - use clm_varpar , only : maxpatch_pft, nlevsno, nlevgrnd, numrad, nlevlak, & - numpft, ndst, nlevurb, nlevsoi - use clm_varctl , only : use_c13, use_cn, use_cndv, use_crop -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: initClmtype -! -! !REVISION HISTORY: -! Created by Peter Thornton and Mariana Vertenstein -! Modified by Colette L. Heald (05/06) for VOC emission factors -! 3/17/08 David Lawrence, changed nlevsoi to nlevgrnd where appropriate -! -! !PRIVATE MEMBER FUNCTIONS: - private :: init_pft_type - private :: init_column_type - private :: init_landunit_type - private :: init_gridcell_type - private :: init_energy_balance_type - private :: init_water_balance_type - private :: init_pft_ecophys_constants - private :: init_pft_DGVMecophys_constants - private :: init_pft_pstate_type - private :: init_pft_epv_type - private :: init_pft_pdgvstate_type - private :: init_pft_vstate_type - private :: init_pft_estate_type - private :: init_pft_wstate_type - private :: init_pft_cstate_type - private :: init_pft_nstate_type - private :: init_pft_eflux_type - private :: init_pft_mflux_type - private :: init_pft_wflux_type - private :: init_pft_cflux_type - private :: init_pft_nflux_type - private :: init_pft_vflux_type - private :: init_pft_dflux_type - private :: init_pft_depvd_type - private :: init_column_pstate_type - private :: init_column_estate_type - private :: init_column_wstate_type - private :: init_column_cstate_type - private :: init_column_nstate_type - private :: init_column_eflux_type - private :: init_column_wflux_type - private :: init_column_cflux_type - private :: init_column_nflux_type - private :: init_landunit_pstate_type - private :: init_landunit_eflux_type - private :: init_gridcell_pstate_type - private :: init_gridcell_efstate_type - private :: init_gridcell_wflux_type -!EOP -!---------------------------------------------------- - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: initClmtype -! -! !INTERFACE: - subroutine initClmtype() -! -! !DESCRIPTION: -! Initialize clmtype components to signaling nan -! The following clmtype components should NOT be initialized here -! since they are set in routine clm_map which is called before this -! routine is invoked -! *%area, *%wt, *%wtlnd, *%wtxy, *%ixy, *%jxy, *%mxy, %snindex -! *%ifspecial, *%ityplun, *%itype -! *%pfti, *%pftf, *%pftn -! *%coli, *%colf, *%coln -! *%luni, *%lunf, *%lunn -! -! !USES: - use abortutils, only : endrun - use decompMod , only : get_proc_bounds, get_proc_global -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -! -! LOCAL VARAIBLES: - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - character(len=32), parameter :: subname = "initClmtype" -!------------------------------------------------------------------------ - - ! Determine necessary indices - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - - call init_pft_type (begp, endp, pft) - call init_column_type (begc, endc, col) - call init_landunit_type(begl, endl, lun) - call init_gridcell_type(begg, endg, grc) - - ! pft ecophysiological constants - - call init_pft_ecophys_constants() - - ! pft DGVM-specific ecophysiological constants - - if (use_cndv) then - call init_pft_DGVMecophys_constants() - end if - - ! energy balance structures (all levels) - - call init_energy_balance_type(begp, endp, pebal) - call init_energy_balance_type(begc, endc, cebal) - - ! water balance structures (all levels) - - call init_water_balance_type(begp, endp, pwbal) - call init_water_balance_type(begc, endc, cwbal) - - ! carbon balance structures (pft and column levels) - - call init_carbon_balance_type(begp, endp, pcbal) - call init_carbon_balance_type(begc, endc, ccbal) - - ! nitrogen balance structures (pft and column levels) - - call init_nitrogen_balance_type(begp, endp, pnbal) - call init_nitrogen_balance_type(begc, endc, cnbal) - - ! pft physical state variables at pft level and averaged to the column - - call init_pft_pstate_type(begp, endp, pps) - call init_pft_pstate_type(begc, endc, pps_a) - - ! pft ecophysiological variables (only at the pft level for now) - call init_pft_epv_type(begp, endp, pepv) - - ! pft DGVM state variables at pft level - - if (use_cndv) then - call init_pft_pdgvstate_type(begp, endp, pdgvs) - end if - call init_pft_vstate_type(begp, endp, pvs) - - ! pft energy state variables at the pft level - - call init_pft_estate_type(begp, endp, pes) - - ! pft water state variables at the pft level and averaged to the column - - call init_pft_wstate_type(begp, endp, pws) - call init_pft_wstate_type(begc, endc, pws_a) - - ! pft carbon state variables at the pft level and averaged to the column - - call init_pft_cstate_type(begp, endp, pcs) - call init_pft_cstate_type(begc, endc, pcs_a) - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - call init_pft_cstate_type(begp, endp, pc13s) - call init_pft_cstate_type(begc, endc, pc13s_a) - if (use_crop) then - call endrun( trim(subname)//" ERROR:: CROP and C13 can NOT be on at the same time" ) - end if - endif - - ! pft nitrogen state variables at the pft level and averaged to the column - - call init_pft_nstate_type(begp, endp, pns) - call init_pft_nstate_type(begc, endc, pns_a) - - ! pft energy flux variables at pft level - - call init_pft_eflux_type(begp, endp, pef) - - ! pft momentum flux variables at pft level - - call init_pft_mflux_type(begp, endp, pmf) - - ! pft water flux variables - - call init_pft_wflux_type(begp, endp, pwf) - call init_pft_wflux_type(begc, endc, pwf_a) - - ! pft carbon flux variables at pft level and averaged to column - - call init_pft_cflux_type(begp, endp, pcf) - call init_pft_cflux_type(begc, endc, pcf_a) - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - call init_pft_cflux_type(begp, endp, pc13f) - call init_pft_cflux_type(begc, endc, pc13f_a) - endif - - ! pft nitrogen flux variables at pft level and averaged to column - - call init_pft_nflux_type(begp, endp, pnf) - call init_pft_nflux_type(begc, endc, pnf_a) - - ! pft VOC flux variables at pft level - - call init_pft_vflux_type(begp, endp, pvf) - - ! gridcell VOC emission factors (heald, 05/06) - - call init_gridcell_efstate_type(begg, endg, gve) - - ! pft dust flux variables at pft level - - call init_pft_dflux_type(begp, endp, pdf) - - ! pft dry dep velocity variables at pft level - - call init_pft_depvd_type(begp, endp, pdd) - - ! column physical state variables at column level - - call init_column_pstate_type(begc, endc, cps) - - ! column energy state variables at column level - - - call init_column_estate_type(begc, endc, ces) - - ! column water state variables at column level - - call init_column_wstate_type(begc, endc, cws) - - ! column carbon state variables at column level - - call init_column_cstate_type(begc, endc, ccs) - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - call init_column_cstate_type(begc, endc, cc13s) - endif - - ! column nitrogen state variables at column level - - call init_column_nstate_type(begc, endc, cns) - - ! column energy flux variables at column level - - call init_column_eflux_type(begc, endc, cef) - - ! column water flux variables at column level - - call init_column_wflux_type(begc, endc, cwf) - - ! column carbon flux variables at column level - - call init_column_cflux_type(begc, endc, ccf) - if (use_c13) then - ! 4/14/05: PET - ! Adding isotope code - call init_column_cflux_type(begc, endc, cc13f) - endif - - ! column nitrogen flux variables at column level - - call init_column_nflux_type(begc, endc, cnf) - - ! land unit physical state variables - - call init_landunit_pstate_type(begl, endl, lps) - - ! land unit energy flux variables - - call init_landunit_eflux_type(begl, endl, lef) - - ! gridcell DGVM variables - - if (use_cndv) then - call init_gridcell_dgvstate_type(begg, endg, gdgvs) - end if - - ! gridcell physical state variables - - - ! gridcell: water flux variables - - call init_gridcell_wflux_type(begg, endg, gwf) - - ! gridcell: energy flux variables - - call init_gridcell_eflux_type(begg, endg, gef) - - ! gridcell: water state variables - - call init_gridcell_wstate_type(begg, endg, gws) - - ! gridcell: energy state variables - - call init_gridcell_estate_type(begg, endg, ges) - - end subroutine initClmtype - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_type -! -! !INTERFACE: - subroutine init_pft_type (beg, end, p) -! -! !DESCRIPTION: -! Initialize components of pft_type structure -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(pft_type), intent(inout):: p -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pft%gridcell(beg:end),& - pft%wtgcell(beg:end), & - pft%landunit(beg:end),& - pft%wtlunit(beg:end), & - pft%column(beg:end), & - pft%wtcol(beg:end), & - pft%itype(beg:end), & - pft%mxy(beg:end)) - - end subroutine init_pft_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_type -! -! !INTERFACE: - subroutine init_column_type (beg, end, c) -! -! !DESCRIPTION: -! Initialize components of column_type structure -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(column_type), intent(inout):: c -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(col%gridcell(beg:end),& - col%wtgcell(beg:end), & - col%landunit(beg:end),& - col%wtlunit(beg:end), & - col%pfti(beg:end), & - col%pftf(beg:end), & - col%npfts(beg:end), & - col%itype(beg:end)) - - end subroutine init_column_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_landunit_type -! -! !INTERFACE: - subroutine init_landunit_type (beg, end,l) -! -! !DESCRIPTION: -! Initialize components of landunit_type structure -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(landunit_type), intent(inout):: l -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(lun%gridcell(beg:end), & - lun%wtgcell(beg:end), & - lun%coli(beg:end), & - lun%colf(beg:end), & - lun%ncolumns(beg:end), & - lun%pfti(beg:end), & - lun%pftf(beg:end), & - lun%npfts(beg:end), & - lun%itype(beg:end), & - lun%ifspecial(beg:end),& - lun%lakpoi(beg:end), & - lun%urbpoi(beg:end), & - lun%glcmecpoi(beg:end)) - - ! These should be moved to landunit physical state - allocate(lun%canyon_hwr(beg:end), & - lun%wtroad_perv(beg:end), & - lun%ht_roof(beg:end), & - lun%wtlunit_roof(beg:end), & - lun%wind_hgt_canyon(beg:end),& - lun%z_0_town(beg:end), & - lun%z_d_town(beg:end)) - - lun%canyon_hwr(beg:end) = nan - lun%wtroad_perv(beg:end) = nan - lun%ht_roof(beg:end) = nan - lun%wtlunit_roof(beg:end) = nan - lun%wind_hgt_canyon(beg:end)= nan - lun%z_0_town(beg:end) = nan - lun%z_d_town(beg:end) = nan - - lun%glcmecpoi(beg:end) = .false. - - end subroutine init_landunit_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_type -! -! !INTERFACE: - subroutine init_gridcell_type (beg, end,g) -! -! !DESCRIPTION: -! Initialize components of gridcell_type structure -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(gridcell_type), intent(inout):: g -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(grc%luni(beg:end), & - grc%lunf(beg:end), & - grc%nlandunits(beg:end),& - grc%coli(beg:end), & - grc%colf(beg:end), & - grc%ncolumns(beg:end), & - grc%pfti(beg:end), & - grc%pftf(beg:end), & - grc%npfts(beg:end), & - grc%gindex(beg:end), & - grc%area(beg:end), & - grc%lat(beg:end), & - grc%lon(beg:end), & - grc%latdeg(beg:end), & - grc%londeg(beg:end), & - grc%gris_mask(beg:end), & - grc%gris_area(beg:end), & - grc%aais_mask(beg:end), & - grc%aais_area(beg:end)) - - grc%gris_mask(beg:end) = nan - grc%gris_area(beg:end) = nan - grc%aais_mask(beg:end) = nan - grc%aais_area(beg:end) = nan - - end subroutine init_gridcell_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_energy_balance_type -! -! !INTERFACE: - subroutine init_energy_balance_type(beg, end, ebal) -! -! !DESCRIPTION: -! Initialize energy balance variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(energy_balance_type), intent(inout):: ebal -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(ebal%errsoi(beg:end)) - allocate(ebal%errseb(beg:end)) - allocate(ebal%errsol(beg:end)) - allocate(ebal%errlon(beg:end)) - - ebal%errsoi(beg:end) = nan - ebal%errseb(beg:end) = nan - ebal%errsol(beg:end) = nan - ebal%errlon(beg:end) = nan - - end subroutine init_energy_balance_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_water_balance_type -! -! !INTERFACE: - subroutine init_water_balance_type(beg, end, wbal) -! -! !DESCRIPTION: -! Initialize water balance variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(water_balance_type), intent(inout):: wbal -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(wbal%begwb(beg:end)) - allocate(wbal%endwb(beg:end)) - allocate(wbal%errh2o(beg:end)) - - wbal%begwb(beg:end) = nan - wbal%endwb(beg:end) = nan - wbal%errh2o(beg:end) = nan - - end subroutine init_water_balance_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_carbon_balance_type -! -! !INTERFACE: - subroutine init_carbon_balance_type(beg, end, cbal) -! -! !DESCRIPTION: -! Initialize carbon balance variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(carbon_balance_type), intent(inout):: cbal -! -! !REVISION HISTORY: -! Created by Peter Thornton, 12/11/2003 -! -!EOP -!------------------------------------------------------------------------ - - allocate(cbal%begcb(beg:end)) - allocate(cbal%endcb(beg:end)) - allocate(cbal%errcb(beg:end)) - - cbal%begcb(beg:end) = nan - cbal%endcb(beg:end) = nan - cbal%errcb(beg:end) = nan - - end subroutine init_carbon_balance_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_nitrogen_balance_type -! -! !INTERFACE: - subroutine init_nitrogen_balance_type(beg, end, nbal) -! -! !DESCRIPTION: -! Initialize nitrogen balance variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type(nitrogen_balance_type), intent(inout):: nbal -! -! !REVISION HISTORY: -! Created by Peter Thornton, 12/11/2003 -! -!EOP -!------------------------------------------------------------------------ - - allocate(nbal%begnb(beg:end)) - allocate(nbal%endnb(beg:end)) - allocate(nbal%errnb(beg:end)) - - nbal%begnb(beg:end) = nan - nbal%endnb(beg:end) = nan - nbal%errnb(beg:end) = nan - - end subroutine init_nitrogen_balance_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_ecophys_constants -! -! !INTERFACE: - subroutine init_pft_ecophys_constants() -! -! !DESCRIPTION: -! Initialize pft physical state -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pftcon%noveg(0:numpft)) - allocate(pftcon%tree(0:numpft)) - allocate(pftcon%smpso(0:numpft)) - allocate(pftcon%smpsc(0:numpft)) - allocate(pftcon%fnitr(0:numpft)) - allocate(pftcon%foln(0:numpft)) - allocate(pftcon%dleaf(0:numpft)) - allocate(pftcon%c3psn(0:numpft)) - allocate(pftcon%mp(0:numpft)) - allocate(pftcon%qe25(0:numpft)) - allocate(pftcon%xl(0:numpft)) - allocate(pftcon%rhol(0:numpft,numrad)) - allocate(pftcon%rhos(0:numpft,numrad)) - allocate(pftcon%taul(0:numpft,numrad)) - allocate(pftcon%taus(0:numpft,numrad)) - allocate(pftcon%z0mr(0:numpft)) - allocate(pftcon%displar(0:numpft)) - allocate(pftcon%roota_par(0:numpft)) - allocate(pftcon%rootb_par(0:numpft)) - allocate(pftcon%sla(0:numpft)) - allocate(pftcon%slatop(0:numpft)) - allocate(pftcon%dsladlai(0:numpft)) - allocate(pftcon%leafcn(0:numpft)) - allocate(pftcon%flnr(0:numpft)) - allocate(pftcon%woody(0:numpft)) - allocate(pftcon%lflitcn(0:numpft)) - allocate(pftcon%frootcn(0:numpft)) - allocate(pftcon%livewdcn(0:numpft)) - allocate(pftcon%deadwdcn(0:numpft)) - allocate(pftcon%graincn(0:numpft)) - allocate(pftcon%froot_leaf(0:numpft)) - allocate(pftcon%stem_leaf(0:numpft)) - allocate(pftcon%croot_stem(0:numpft)) - allocate(pftcon%flivewd(0:numpft)) - allocate(pftcon%fcur(0:numpft)) - allocate(pftcon%lf_flab(0:numpft)) - allocate(pftcon%lf_fcel(0:numpft)) - allocate(pftcon%lf_flig(0:numpft)) - allocate(pftcon%fr_flab(0:numpft)) - allocate(pftcon%fr_fcel(0:numpft)) - allocate(pftcon%fr_flig(0:numpft)) - allocate(pftcon%leaf_long(0:numpft)) - allocate(pftcon%evergreen(0:numpft)) - allocate(pftcon%stress_decid(0:numpft)) - allocate(pftcon%season_decid(0:numpft)) - allocate(pftcon%resist(0:numpft)) - allocate(pftcon%dwood(0:numpft)) - - pftcon%noveg(:) = huge(1) - pftcon%tree(:) = huge(1) - pftcon%smpso(:) = nan - pftcon%smpsc(:) = nan - pftcon%fnitr(:) = nan - pftcon%foln(:) = nan - pftcon%dleaf(:) = nan - pftcon%c3psn(:) = nan - pftcon%mp(:) = nan - pftcon%qe25(:) = nan - pftcon%xl(:) = nan - pftcon%rhol(:,:numrad) = nan - pftcon%rhos(:,:numrad) = nan - pftcon%taul(:,:numrad) = nan - pftcon%taus(:,:numrad) = nan - pftcon%z0mr(:) = nan - pftcon%displar(:) = nan - pftcon%roota_par(:) = nan - pftcon%rootb_par(:) = nan - pftcon%sla(:) = nan - pftcon%slatop(:) = nan - pftcon%dsladlai(:) = nan - pftcon%leafcn(:) = nan - pftcon%flnr(:) = nan - pftcon%woody(:) = nan - pftcon%lflitcn(:) = nan - pftcon%frootcn(:) = nan - pftcon%livewdcn(:) = nan - pftcon%deadwdcn(:) = nan - pftcon%graincn(:) = nan - pftcon%froot_leaf(:) = nan - pftcon%stem_leaf(:) = nan - pftcon%croot_stem(:) = nan - pftcon%flivewd(:) = nan - pftcon%fcur(:) = nan - pftcon%lf_flab(:) = nan - pftcon%lf_fcel(:) = nan - pftcon%lf_flig(:) = nan - pftcon%fr_flab(:) = nan - pftcon%fr_fcel(:) = nan - pftcon%fr_flig(:) = nan - pftcon%leaf_long(:) = nan - pftcon%evergreen(:) = nan - pftcon%stress_decid(:) = nan - pftcon%season_decid(:) = nan - pftcon%resist(:) = nan - pftcon%dwood(:) = nan - - end subroutine init_pft_ecophys_constants - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_DGVMecophys_constants -! -! !INTERFACE: - subroutine init_pft_DGVMecophys_constants() -! -! !DESCRIPTION: -! Initialize pft physical state -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(dgv_pftcon%crownarea_max(0:numpft)) - allocate(dgv_pftcon%tcmin(0:numpft)) - allocate(dgv_pftcon%tcmax(0:numpft)) - allocate(dgv_pftcon%gddmin(0:numpft)) - allocate(dgv_pftcon%twmax(0:numpft)) - allocate(dgv_pftcon%reinickerp(0:numpft)) - allocate(dgv_pftcon%allom1(0:numpft)) - allocate(dgv_pftcon%allom2(0:numpft)) - allocate(dgv_pftcon%allom3(0:numpft)) - - dgv_pftcon%crownarea_max(:) = nan - dgv_pftcon%tcmin(:) = nan - dgv_pftcon%tcmax(:) = nan - dgv_pftcon%gddmin(:) = nan - dgv_pftcon%twmax(:) = nan - dgv_pftcon%reinickerp(:) = nan - dgv_pftcon%allom1(:) = nan - dgv_pftcon%allom2(:) = nan - dgv_pftcon%allom3(:) = nan - - end subroutine init_pft_DGVMecophys_constants - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_pstate_type -! -! !INTERFACE: - subroutine init_pft_pstate_type(beg, end, pps) -! -! !DESCRIPTION: -! Initialize pft physical state -! -! !USES: - use clm_varcon, only : spval - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_pstate_type), intent(inout):: pps -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pps%frac_veg_nosno(beg:end)) - allocate(pps%frac_veg_nosno_alb(beg:end)) - allocate(pps%emv(beg:end)) - allocate(pps%z0mv(beg:end)) - allocate(pps%z0hv(beg:end)) - allocate(pps%z0qv(beg:end)) - allocate(pps%rootfr(beg:end,1:nlevgrnd)) - allocate(pps%rootr(beg:end,1:nlevgrnd)) - allocate(pps%rresis(beg:end,1:nlevgrnd)) - allocate(pps%dewmx(beg:end)) - allocate(pps%rssun(beg:end)) - allocate(pps%rssha(beg:end)) - allocate(pps%laisun(beg:end)) - allocate(pps%laisha(beg:end)) - allocate(pps%btran(beg:end)) - allocate(pps%fsun(beg:end)) - allocate(pps%tlai(beg:end)) - allocate(pps%tsai(beg:end)) - allocate(pps%elai(beg:end)) - allocate(pps%esai(beg:end)) - allocate(pps%fwet(beg:end)) - allocate(pps%fdry(beg:end)) - allocate(pps%dt_veg(beg:end)) - allocate(pps%htop(beg:end)) - allocate(pps%hbot(beg:end)) - allocate(pps%z0m(beg:end)) - allocate(pps%displa(beg:end)) - allocate(pps%albd(beg:end,1:numrad)) - allocate(pps%albi(beg:end,1:numrad)) - allocate(pps%fabd(beg:end,1:numrad)) - allocate(pps%fabi(beg:end,1:numrad)) - allocate(pps%ftdd(beg:end,1:numrad)) - allocate(pps%ftid(beg:end,1:numrad)) - allocate(pps%ftii(beg:end,1:numrad)) - allocate(pps%u10(beg:end)) - allocate(pps%u10_clm(beg:end)) - allocate(pps%va(beg:end)) - allocate(pps%fv(beg:end)) - allocate(pps%ram1(beg:end)) - if ( crop_prog )then - allocate(pps%hdidx(beg:end)) - allocate(pps%cumvd(beg:end)) - allocate(pps%htmx(beg:end)) - allocate(pps%vf(beg:end)) - allocate(pps%gddmaturity(beg:end)) - allocate(pps%gdd0(beg:end)) - allocate(pps%gdd8(beg:end)) - allocate(pps%gdd10(beg:end)) - allocate(pps%gdd020(beg:end)) - allocate(pps%gdd820(beg:end)) - allocate(pps%gdd1020(beg:end)) - allocate(pps%gddplant(beg:end)) - allocate(pps%gddtsoi(beg:end)) - allocate(pps%huileaf(beg:end)) - allocate(pps%huigrain(beg:end)) - allocate(pps%aleafi(beg:end)) - allocate(pps%astemi(beg:end)) - allocate(pps%aleaf(beg:end)) - allocate(pps%astem(beg:end)) - allocate(pps%croplive(beg:end)) - allocate(pps%cropplant(beg:end)) !,numpft)) ! make 2-D if using - allocate(pps%harvdate(beg:end)) !,numpft)) ! crop rotation - allocate(pps%idop(beg:end)) - allocate(pps%peaklai(beg:end)) - end if - allocate(pps%vds(beg:end)) - allocate(pps%slasun(beg:end)) - allocate(pps%slasha(beg:end)) - allocate(pps%lncsun(beg:end)) - allocate(pps%lncsha(beg:end)) - allocate(pps%vcmxsun(beg:end)) - allocate(pps%vcmxsha(beg:end)) - allocate(pps%gdir(beg:end)) - allocate(pps%omega(beg:end,1:numrad)) - allocate(pps%eff_kid(beg:end,1:numrad)) - allocate(pps%eff_kii(beg:end,1:numrad)) - allocate(pps%sun_faid(beg:end,1:numrad)) - allocate(pps%sun_faii(beg:end,1:numrad)) - allocate(pps%sha_faid(beg:end,1:numrad)) - allocate(pps%sha_faii(beg:end,1:numrad)) - allocate(pps%forc_hgt_u_pft(beg:end)) - allocate(pps%forc_hgt_t_pft(beg:end)) - allocate(pps%forc_hgt_q_pft(beg:end)) - ! 4/14/05: PET - ! Adding isotope code - allocate(pps%cisun(beg:end)) - allocate(pps%cisha(beg:end)) - allocate(pps%alphapsnsun(beg:end)) - allocate(pps%alphapsnsha(beg:end)) - - allocate(pps%sandfrac(beg:end)) - allocate(pps%clayfrac(beg:end)) - pps%sandfrac(beg:end) = nan - pps%clayfrac(beg:end) = nan - allocate(pps%mlaidiff(beg:end)) - allocate(pps%rb1(beg:end)) - allocate(pps%annlai(12,beg:end)) - pps%mlaidiff(beg:end) = nan - pps%rb1(beg:end) = nan - pps%annlai(:,:) = nan - - pps%frac_veg_nosno(beg:end) = huge(1) - pps%frac_veg_nosno_alb(beg:end) = 0 - pps%emv(beg:end) = nan - pps%z0mv(beg:end) = nan - pps%z0hv(beg:end) = nan - pps%z0qv(beg:end) = nan - pps%rootfr(beg:end,:nlevgrnd) = spval - pps%rootr (beg:end,:nlevgrnd) = spval - pps%rresis(beg:end,:nlevgrnd) = spval - pps%dewmx(beg:end) = nan - pps%rssun(beg:end) = nan - pps%rssha(beg:end) = nan - pps%laisun(beg:end) = nan - pps%laisha(beg:end) = nan - pps%btran(beg:end) = spval - pps%fsun(beg:end) = spval - pps%tlai(beg:end) = 0._r8 - pps%tsai(beg:end) = 0._r8 - pps%elai(beg:end) = 0._r8 - pps%esai(beg:end) = 0._r8 - pps%fwet(beg:end) = nan - pps%fdry(beg:end) = nan - pps%dt_veg(beg:end) = nan - pps%htop(beg:end) = 0._r8 - pps%hbot(beg:end) = 0._r8 - pps%z0m(beg:end) = nan - pps%displa(beg:end) = nan - pps%albd(beg:end,:numrad) = nan - pps%albi(beg:end,:numrad) = nan - pps%fabd(beg:end,:numrad) = nan - pps%fabi(beg:end,:numrad) = nan - pps%ftdd(beg:end,:numrad) = nan - pps%ftid(beg:end,:numrad) = nan - pps%ftii(beg:end,:numrad) = nan - pps%u10(beg:end) = nan - pps%u10_clm(beg:end) = nan - pps%va(beg:end) = nan - pps%fv(beg:end) = nan - pps%ram1(beg:end) = nan - if ( crop_prog )then - pps%hdidx(beg:end) = nan - pps%cumvd(beg:end) = nan - pps%htmx(beg:end) = 0.0_r8 - pps%vf(beg:end) = 0.0_r8 - pps%gddmaturity(beg:end) = spval - pps%gdd0(beg:end) = spval - pps%gdd8(beg:end) = spval - pps%gdd10(beg:end) = spval - pps%gdd020(beg:end) = spval - pps%gdd820(beg:end) = spval - pps%gdd1020(beg:end) = spval - pps%gddplant(beg:end) = spval - pps%gddtsoi(beg:end) = spval - pps%huileaf(beg:end) = nan - pps%huigrain(beg:end) = nan - pps%aleafi(beg:end) = nan - pps%astemi(beg:end) = nan - pps%aleaf(beg:end) = nan - pps%astem(beg:end) = nan - pps%croplive(beg:end) = .false. - pps%cropplant(beg:end) = .false. - pps%harvdate(beg:end) = huge(1) - pps%idop(beg:end) = huge(1) - pps%peaklai(beg:end) = 0 - end if - pps%vds(beg:end) = nan - pps%slasun(beg:end) = nan - pps%slasha(beg:end) = nan - pps%lncsun(beg:end) = nan - pps%lncsha(beg:end) = nan - pps%vcmxsun(beg:end) = nan - pps%vcmxsha(beg:end) = nan - pps%gdir(beg:end) = nan - pps%omega(beg:end,1:numrad) = nan - pps%eff_kid(beg:end,1:numrad) = nan - pps%eff_kii(beg:end,1:numrad) = nan - pps%sun_faid(beg:end,1:numrad) = nan - pps%sun_faii(beg:end,1:numrad) = nan - pps%sha_faid(beg:end,1:numrad) = nan - pps%sha_faii(beg:end,1:numrad) = nan - pps%forc_hgt_u_pft(beg:end) = nan - pps%forc_hgt_t_pft(beg:end) = nan - pps%forc_hgt_q_pft(beg:end) = nan - ! 4/14/05: PET - ! Adding isotope code - pps%cisun(beg:end) = nan - pps%cisha(beg:end) = nan - if (use_c13) then - pps%alphapsnsun(beg:end) = nan - pps%alphapsnsha(beg:end) = nan - endif - - end subroutine init_pft_pstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_epv_type -! -! !INTERFACE: - subroutine init_pft_epv_type(beg, end, pepv) -! -! !DESCRIPTION: -! Initialize pft ecophysiological variables -! -! !USES: -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_epv_type), intent(inout):: pepv -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - allocate(pepv%dormant_flag(beg:end)) - allocate(pepv%days_active(beg:end)) - allocate(pepv%onset_flag(beg:end)) - allocate(pepv%onset_counter(beg:end)) - allocate(pepv%onset_gddflag(beg:end)) - allocate(pepv%onset_fdd(beg:end)) - allocate(pepv%onset_gdd(beg:end)) - allocate(pepv%onset_swi(beg:end)) - allocate(pepv%offset_flag(beg:end)) - allocate(pepv%offset_counter(beg:end)) - allocate(pepv%offset_fdd(beg:end)) - allocate(pepv%offset_swi(beg:end)) - allocate(pepv%lgsf(beg:end)) - allocate(pepv%bglfr(beg:end)) - allocate(pepv%bgtr(beg:end)) - allocate(pepv%dayl(beg:end)) - allocate(pepv%prev_dayl(beg:end)) - allocate(pepv%annavg_t2m(beg:end)) - allocate(pepv%tempavg_t2m(beg:end)) - allocate(pepv%gpp(beg:end)) - allocate(pepv%availc(beg:end)) - allocate(pepv%xsmrpool_recover(beg:end)) - allocate(pepv%xsmrpool_c13ratio(beg:end)) - allocate(pepv%alloc_pnow(beg:end)) - allocate(pepv%c_allometry(beg:end)) - allocate(pepv%n_allometry(beg:end)) - allocate(pepv%plant_ndemand(beg:end)) - allocate(pepv%tempsum_potential_gpp(beg:end)) - allocate(pepv%annsum_potential_gpp(beg:end)) - allocate(pepv%tempmax_retransn(beg:end)) - allocate(pepv%annmax_retransn(beg:end)) - allocate(pepv%avail_retransn(beg:end)) - allocate(pepv%plant_nalloc(beg:end)) - allocate(pepv%plant_calloc(beg:end)) - allocate(pepv%excess_cflux(beg:end)) - allocate(pepv%downreg(beg:end)) - allocate(pepv%prev_leafc_to_litter(beg:end)) - allocate(pepv%prev_frootc_to_litter(beg:end)) - allocate(pepv%tempsum_npp(beg:end)) - allocate(pepv%annsum_npp(beg:end)) - allocate(pepv%tempsum_litfall(beg:end)) - allocate(pepv%annsum_litfall(beg:end)) - ! 4/21/05, PET - ! Adding isotope code - allocate(pepv%rc13_canair(beg:end)) - allocate(pepv%rc13_psnsun(beg:end)) - allocate(pepv%rc13_psnsha(beg:end)) - - pepv%dormant_flag(beg:end) = nan - pepv%days_active(beg:end) = nan - pepv%onset_flag(beg:end) = nan - pepv%onset_counter(beg:end) = nan - pepv%onset_gddflag(beg:end) = nan - pepv%onset_fdd(beg:end) = nan - pepv%onset_gdd(beg:end) = nan - pepv%onset_swi(beg:end) = nan - pepv%offset_flag(beg:end) = nan - pepv%offset_counter(beg:end) = nan - pepv%offset_fdd(beg:end) = nan - pepv%offset_swi(beg:end) = nan - pepv%lgsf(beg:end) = nan - pepv%bglfr(beg:end) = nan - pepv%bgtr(beg:end) = nan - pepv%dayl(beg:end) = nan - pepv%prev_dayl(beg:end) = nan - pepv%annavg_t2m(beg:end) = nan - pepv%tempavg_t2m(beg:end) = nan - pepv%gpp(beg:end) = nan - pepv%availc(beg:end) = nan - pepv%xsmrpool_recover(beg:end) = nan - if (use_c13) then - pepv%xsmrpool_c13ratio(beg:end) = nan - endif - pepv%alloc_pnow(beg:end) = nan - pepv%c_allometry(beg:end) = nan - pepv%n_allometry(beg:end) = nan - pepv%plant_ndemand(beg:end) = nan - pepv%tempsum_potential_gpp(beg:end) = nan - pepv%annsum_potential_gpp(beg:end) = nan - pepv%tempmax_retransn(beg:end) = nan - pepv%annmax_retransn(beg:end) = nan - pepv%avail_retransn(beg:end) = nan - pepv%plant_nalloc(beg:end) = nan - pepv%plant_calloc(beg:end) = nan - pepv%excess_cflux(beg:end) = nan - pepv%downreg(beg:end) = nan - pepv%prev_leafc_to_litter(beg:end) = nan - pepv%prev_frootc_to_litter(beg:end) = nan - pepv%tempsum_npp(beg:end) = nan - pepv%annsum_npp(beg:end) = nan - pepv%tempsum_litfall(beg:end) = nan - pepv%annsum_litfall(beg:end) = nan - if (use_c13) then - ! 4/21/05, PET - ! Adding isotope code - pepv%rc13_canair(beg:end) = nan - pepv%rc13_psnsun(beg:end) = nan - pepv%rc13_psnsha(beg:end) = nan - endif - - end subroutine init_pft_epv_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_pdgvstate_type -! -! !INTERFACE: - subroutine init_pft_pdgvstate_type(beg, end, pdgvs) -! -! !DESCRIPTION: -! Initialize pft DGVM state variables -! -! !USES: -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_dgvstate_type), intent(inout):: pdgvs -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pdgvs%agddtw(beg:end)) - allocate(pdgvs%agdd(beg:end)) - allocate(pdgvs%t_mo(beg:end)) - allocate(pdgvs%t_mo_min(beg:end)) - allocate(pdgvs%prec365(beg:end)) - allocate(pdgvs%present(beg:end)) - allocate(pdgvs%pftmayexist(beg:end)) - allocate(pdgvs%nind(beg:end)) - allocate(pdgvs%lm_ind(beg:end)) - allocate(pdgvs%lai_ind(beg:end)) - allocate(pdgvs%fpcinc(beg:end)) - allocate(pdgvs%fpcgrid(beg:end)) - allocate(pdgvs%fpcgridold(beg:end)) - allocate(pdgvs%crownarea(beg:end)) - allocate(pdgvs%greffic(beg:end)) - allocate(pdgvs%heatstress(beg:end)) - - pdgvs%agddtw(beg:end) = nan - pdgvs%agdd(beg:end) = nan - pdgvs%t_mo(beg:end) = nan - pdgvs%t_mo_min(beg:end) = nan - pdgvs%prec365(beg:end) = nan - pdgvs%present(beg:end) = .false. - pdgvs%pftmayexist(beg:end) = .true. - pdgvs%nind(beg:end) = nan - pdgvs%lm_ind(beg:end) = nan - pdgvs%lai_ind(beg:end) = nan - pdgvs%fpcinc(beg:end) = nan - pdgvs%fpcgrid(beg:end) = nan - pdgvs%fpcgridold(beg:end) = nan - pdgvs%crownarea(beg:end) = nan - pdgvs%greffic(beg:end) = nan - pdgvs%heatstress(beg:end) = nan - - end subroutine init_pft_pdgvstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_vstate_type -! -! !INTERFACE: - subroutine init_pft_vstate_type(beg, end, pvs) -! -! !DESCRIPTION: -! Initialize pft VOC variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_vstate_type), intent(inout):: pvs -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -!EOP -!------------------------------------------------------------------------ - - allocate(pvs%t_veg24 (beg:end)) - allocate(pvs%t_veg240(beg:end)) - allocate(pvs%fsd24 (beg:end)) - allocate(pvs%fsd240 (beg:end)) - allocate(pvs%fsi24 (beg:end)) - allocate(pvs%fsi240 (beg:end)) - allocate(pvs%fsun24 (beg:end)) - allocate(pvs%fsun240 (beg:end)) - allocate(pvs%elai_p (beg:end)) - - pvs%t_veg24 (beg:end) = spval - pvs%t_veg240(beg:end) = spval - pvs%fsd24 (beg:end) = spval - pvs%fsd240 (beg:end) = spval - pvs%fsi24 (beg:end) = spval - pvs%fsi240 (beg:end) = spval - pvs%fsun24 (beg:end) = spval - pvs%fsun240 (beg:end) = spval - pvs%elai_p (beg:end) = spval - end subroutine init_pft_vstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_estate_type -! -! !INTERFACE: - subroutine init_pft_estate_type(beg, end, pes) -! -! !DESCRIPTION: -! Initialize pft energy state -! -! !USES: - use clm_varcon, only : spval - use surfrdMod, only : crop_prog -! !AGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_estate_type), intent(inout):: pes -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - - allocate(pes%t_ref2m(beg:end)) - allocate(pes%t_ref2m_min(beg:end)) - allocate(pes%t_ref2m_max(beg:end)) - allocate(pes%t_ref2m_min_inst(beg:end)) - allocate(pes%t_ref2m_max_inst(beg:end)) - allocate(pes%q_ref2m(beg:end)) - allocate(pes%t_ref2m_u(beg:end)) - allocate(pes%t_ref2m_r(beg:end)) - allocate(pes%t_ref2m_min_u(beg:end)) - allocate(pes%t_ref2m_min_r(beg:end)) - allocate(pes%t_ref2m_max_u(beg:end)) - allocate(pes%t_ref2m_max_r(beg:end)) - allocate(pes%t_ref2m_min_inst_u(beg:end)) - allocate(pes%t_ref2m_min_inst_r(beg:end)) - allocate(pes%t_ref2m_max_inst_u(beg:end)) - allocate(pes%t_ref2m_max_inst_r(beg:end)) - allocate(pes%t10(beg:end)) - if ( crop_prog )then - allocate(pes%a10tmin(beg:end)) - allocate(pes%a5tmin(beg:end)) - end if - allocate(pes%rh_ref2m(beg:end)) - allocate(pes%rh_ref2m_u(beg:end)) - allocate(pes%rh_ref2m_r(beg:end)) - allocate(pes%t_veg(beg:end)) - allocate(pes%thm(beg:end)) - - pes%t_ref2m(beg:end) = nan - pes%t_ref2m_min(beg:end) = nan - pes%t_ref2m_max(beg:end) = nan - pes%t_ref2m_min_inst(beg:end) = nan - pes%t_ref2m_max_inst(beg:end) = nan - pes%q_ref2m(beg:end) = nan - pes%t_ref2m_u(beg:end) = nan - pes%t_ref2m_r(beg:end) = nan - pes%t_ref2m_min_u(beg:end) = nan - pes%t_ref2m_min_r(beg:end) = nan - pes%t_ref2m_max_u(beg:end) = nan - pes%t_ref2m_max_r(beg:end) = nan - pes%t_ref2m_min_inst_u(beg:end) = nan - pes%t_ref2m_min_inst_r(beg:end) = nan - pes%t_ref2m_max_inst_u(beg:end) = nan - pes%t_ref2m_max_inst_r(beg:end) = nan - pes%t10(beg:end) = spval - if ( crop_prog )then - pes%a10tmin(beg:end) = spval - pes%a5tmin(beg:end) = spval - end if - pes%rh_ref2m(beg:end) = nan - pes%rh_ref2m_u(beg:end) = nan - pes%rh_ref2m_r(beg:end) = nan - pes%t_veg(beg:end) = nan - pes%thm(beg:end) = nan - - end subroutine init_pft_estate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_wstate_type -! -! !INTERFACE: - subroutine init_pft_wstate_type(beg, end, pws) -! -! !DESCRIPTION: -! Initialize pft water state -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_wstate_type), intent(inout):: pws !pft water state -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pws%h2ocan(beg:end)) - pws%h2ocan(beg:end) = nan - - end subroutine init_pft_wstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_cstate_type -! -! !INTERFACE: - subroutine init_pft_cstate_type(beg, end, pcs) -! -! !DESCRIPTION: -! Initialize pft carbon state -! -! !USES: - use surfrdMod, only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_cstate_type), intent(inout):: pcs !pft carbon state -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - allocate(pcs%leafc(beg:end)) - allocate(pcs%leafc_storage(beg:end)) - allocate(pcs%leafc_xfer(beg:end)) - allocate(pcs%frootc(beg:end)) - allocate(pcs%frootc_storage(beg:end)) - allocate(pcs%frootc_xfer(beg:end)) - allocate(pcs%livestemc(beg:end)) - allocate(pcs%livestemc_storage(beg:end)) - allocate(pcs%livestemc_xfer(beg:end)) - allocate(pcs%deadstemc(beg:end)) - allocate(pcs%deadstemc_storage(beg:end)) - allocate(pcs%deadstemc_xfer(beg:end)) - allocate(pcs%livecrootc(beg:end)) - allocate(pcs%livecrootc_storage(beg:end)) - allocate(pcs%livecrootc_xfer(beg:end)) - allocate(pcs%deadcrootc(beg:end)) - allocate(pcs%deadcrootc_storage(beg:end)) - allocate(pcs%deadcrootc_xfer(beg:end)) - allocate(pcs%gresp_storage(beg:end)) - allocate(pcs%gresp_xfer(beg:end)) - allocate(pcs%cpool(beg:end)) - allocate(pcs%xsmrpool(beg:end)) - allocate(pcs%pft_ctrunc(beg:end)) - allocate(pcs%dispvegc(beg:end)) - allocate(pcs%storvegc(beg:end)) - allocate(pcs%totvegc(beg:end)) - allocate(pcs%totpftc(beg:end)) - allocate(pcs%leafcmax(beg:end)) - if ( crop_prog )then - allocate(pcs%grainc(beg:end)) - allocate(pcs%grainc_storage(beg:end)) - allocate(pcs%grainc_xfer(beg:end)) - end if - allocate(pcs%woodc(beg:end)) - - pcs%leafc(beg:end) = nan - pcs%leafc_storage(beg:end) = nan - pcs%leafc_xfer(beg:end) = nan - pcs%frootc(beg:end) = nan - pcs%frootc_storage(beg:end) = nan - pcs%frootc_xfer(beg:end) = nan - pcs%livestemc(beg:end) = nan - pcs%livestemc_storage(beg:end) = nan - pcs%livestemc_xfer(beg:end) = nan - pcs%deadstemc(beg:end) = nan - pcs%deadstemc_storage(beg:end) = nan - pcs%deadstemc_xfer(beg:end) = nan - pcs%livecrootc(beg:end) = nan - pcs%livecrootc_storage(beg:end) = nan - pcs%livecrootc_xfer(beg:end) = nan - pcs%deadcrootc(beg:end) = nan - pcs%deadcrootc_storage(beg:end) = nan - pcs%deadcrootc_xfer(beg:end) = nan - pcs%gresp_storage(beg:end) = nan - pcs%gresp_xfer(beg:end) = nan - pcs%cpool(beg:end) = nan - pcs%xsmrpool(beg:end) = nan - pcs%pft_ctrunc(beg:end) = nan - pcs%dispvegc(beg:end) = nan - pcs%storvegc(beg:end) = nan - pcs%totvegc(beg:end) = nan - pcs%totpftc(beg:end) = nan - pcs%leafcmax(beg:end) = nan - if ( crop_prog )then - pcs%grainc(beg:end) = nan - pcs%grainc_storage(beg:end) = nan - pcs%grainc_xfer(beg:end) = nan - end if - pcs%woodc(beg:end) = nan - - end subroutine init_pft_cstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_nstate_type -! -! !INTERFACE: - subroutine init_pft_nstate_type(beg, end, pns) -! -! !DESCRIPTION: -! Initialize pft nitrogen state -! -! !USES: - use surfrdMod, only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_nstate_type), intent(inout):: pns !pft nitrogen state -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - if ( crop_prog )then - allocate(pns%grainn(beg:end)) - allocate(pns%grainn_storage(beg:end)) - allocate(pns%grainn_xfer(beg:end)) - end if - allocate(pns%leafn(beg:end)) - allocate(pns%leafn_storage(beg:end)) - allocate(pns%leafn_xfer(beg:end)) - allocate(pns%frootn(beg:end)) - allocate(pns%frootn_storage(beg:end)) - allocate(pns%frootn_xfer(beg:end)) - allocate(pns%livestemn(beg:end)) - allocate(pns%livestemn_storage(beg:end)) - allocate(pns%livestemn_xfer(beg:end)) - allocate(pns%deadstemn(beg:end)) - allocate(pns%deadstemn_storage(beg:end)) - allocate(pns%deadstemn_xfer(beg:end)) - allocate(pns%livecrootn(beg:end)) - allocate(pns%livecrootn_storage(beg:end)) - allocate(pns%livecrootn_xfer(beg:end)) - allocate(pns%deadcrootn(beg:end)) - allocate(pns%deadcrootn_storage(beg:end)) - allocate(pns%deadcrootn_xfer(beg:end)) - allocate(pns%retransn(beg:end)) - allocate(pns%npool(beg:end)) - allocate(pns%pft_ntrunc(beg:end)) - allocate(pns%dispvegn(beg:end)) - allocate(pns%storvegn(beg:end)) - allocate(pns%totvegn(beg:end)) - allocate(pns%totpftn(beg:end)) - - if ( crop_prog )then - pns%grainn(beg:end) = nan - pns%grainn_storage(beg:end) = nan - pns%grainn_xfer(beg:end) = nan - end if - pns%leafn(beg:end) = nan - pns%leafn_storage(beg:end) = nan - pns%leafn_xfer(beg:end) = nan - pns%frootn(beg:end) = nan - pns%frootn_storage(beg:end) = nan - pns%frootn_xfer(beg:end) = nan - pns%livestemn(beg:end) = nan - pns%livestemn_storage(beg:end) = nan - pns%livestemn_xfer(beg:end) = nan - pns%deadstemn(beg:end) = nan - pns%deadstemn_storage(beg:end) = nan - pns%deadstemn_xfer(beg:end) = nan - pns%livecrootn(beg:end) = nan - pns%livecrootn_storage(beg:end) = nan - pns%livecrootn_xfer(beg:end) = nan - pns%deadcrootn(beg:end) = nan - pns%deadcrootn_storage(beg:end) = nan - pns%deadcrootn_xfer(beg:end) = nan - pns%retransn(beg:end) = nan - pns%npool(beg:end) = nan - pns%pft_ntrunc(beg:end) = nan - pns%dispvegn(beg:end) = nan - pns%storvegn(beg:end) = nan - pns%totvegn(beg:end) = nan - pns%totpftn(beg:end) = nan - - end subroutine init_pft_nstate_type -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_eflux_type -! -! !INTERFACE: - subroutine init_pft_eflux_type(beg, end, pef) -! -! !DESCRIPTION: -! Initialize pft energy flux variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_eflux_type), intent(inout):: pef -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pef%sabg(beg:end)) - allocate(pef%sabv(beg:end)) - allocate(pef%fsa(beg:end)) - allocate(pef%fsa_u(beg:end)) - allocate(pef%fsa_r(beg:end)) - allocate(pef%fsr(beg:end)) - allocate(pef%parsun(beg:end)) - allocate(pef%parsha(beg:end)) - allocate(pef%dlrad(beg:end)) - allocate(pef%ulrad(beg:end)) - allocate(pef%eflx_lh_tot(beg:end)) - allocate(pef%eflx_lh_tot_u(beg:end)) - allocate(pef%eflx_lh_tot_r(beg:end)) - allocate(pef%eflx_lh_grnd(beg:end)) - allocate(pef%eflx_soil_grnd(beg:end)) - allocate(pef%eflx_soil_grnd_u(beg:end)) - allocate(pef%eflx_soil_grnd_r(beg:end)) - allocate(pef%eflx_sh_tot(beg:end)) - allocate(pef%eflx_sh_tot_u(beg:end)) - allocate(pef%eflx_sh_tot_r(beg:end)) - allocate(pef%eflx_sh_grnd(beg:end)) - allocate(pef%eflx_sh_veg(beg:end)) - allocate(pef%eflx_lh_vege(beg:end)) - allocate(pef%eflx_lh_vegt(beg:end)) - allocate(pef%eflx_wasteheat_pft(beg:end)) - allocate(pef%eflx_heat_from_ac_pft(beg:end)) - allocate(pef%eflx_traffic_pft(beg:end)) - allocate(pef%eflx_anthro(beg:end)) - allocate(pef%cgrnd(beg:end)) - allocate(pef%cgrndl(beg:end)) - allocate(pef%cgrnds(beg:end)) - allocate(pef%eflx_gnet(beg:end)) - allocate(pef%dgnetdT(beg:end)) - allocate(pef%eflx_lwrad_out(beg:end)) - allocate(pef%eflx_lwrad_net(beg:end)) - allocate(pef%eflx_lwrad_net_u(beg:end)) - allocate(pef%eflx_lwrad_net_r(beg:end)) - allocate(pef%netrad(beg:end)) - allocate(pef%fsds_vis_d(beg:end)) - allocate(pef%fsds_nir_d(beg:end)) - allocate(pef%fsds_vis_i(beg:end)) - allocate(pef%fsds_nir_i(beg:end)) - allocate(pef%fsr_vis_d(beg:end)) - allocate(pef%fsr_nir_d(beg:end)) - allocate(pef%fsr_vis_i(beg:end)) - allocate(pef%fsr_nir_i(beg:end)) - allocate(pef%fsds_vis_d_ln(beg:end)) - allocate(pef%fsds_nir_d_ln(beg:end)) - allocate(pef%fsr_vis_d_ln(beg:end)) - allocate(pef%fsr_nir_d_ln(beg:end)) - allocate(pef%sun_add(beg:end,1:numrad)) - allocate(pef%tot_aid(beg:end,1:numrad)) - allocate(pef%sun_aid(beg:end,1:numrad)) - allocate(pef%sun_aii(beg:end,1:numrad)) - allocate(pef%sha_aid(beg:end,1:numrad)) - allocate(pef%sha_aii(beg:end,1:numrad)) - allocate(pef%sun_atot(beg:end,1:numrad)) - allocate(pef%sha_atot(beg:end,1:numrad)) - allocate(pef%sun_alf(beg:end,1:numrad)) - allocate(pef%sha_alf(beg:end,1:numrad)) - allocate(pef%sun_aperlai(beg:end,1:numrad)) - allocate(pef%sha_aperlai(beg:end,1:numrad)) - allocate(pef%sabg_lyr(beg:end,-nlevsno+1:1)) - allocate(pef%sfc_frc_aer(beg:end)) - allocate(pef%sfc_frc_bc(beg:end)) - allocate(pef%sfc_frc_oc(beg:end)) - allocate(pef%sfc_frc_dst(beg:end)) - allocate(pef%sfc_frc_aer_sno(beg:end)) - allocate(pef%sfc_frc_bc_sno(beg:end)) - allocate(pef%sfc_frc_oc_sno(beg:end)) - allocate(pef%sfc_frc_dst_sno(beg:end)) - allocate(pef%fsr_sno_vd(beg:end)) - allocate(pef%fsr_sno_nd(beg:end)) - allocate(pef%fsr_sno_vi(beg:end)) - allocate(pef%fsr_sno_ni(beg:end)) - allocate(pef%fsds_sno_vd(beg:end)) - allocate(pef%fsds_sno_nd(beg:end)) - allocate(pef%fsds_sno_vi(beg:end)) - allocate(pef%fsds_sno_ni(beg:end)) - - pef%sabg(beg:end) = nan - pef%sabv(beg:end) = nan - pef%fsa(beg:end) = nan - pef%fsa_u(beg:end) = nan - pef%fsa_r(beg:end) = nan - pef%fsr(beg:end) = nan - pef%parsun(beg:end) = nan - pef%parsha(beg:end) = nan - pef%dlrad(beg:end) = nan - pef%ulrad(beg:end) = nan - pef%eflx_lh_tot(beg:end) = nan - pef%eflx_lh_tot_u(beg:end) = nan - pef%eflx_lh_tot_r(beg:end) = nan - pef%eflx_lh_grnd(beg:end) = nan - pef%eflx_soil_grnd(beg:end) = nan - pef%eflx_soil_grnd_u(beg:end) = nan - pef%eflx_soil_grnd_r(beg:end) = nan - pef%eflx_sh_tot(beg:end) = nan - pef%eflx_sh_tot_u(beg:end) = nan - pef%eflx_sh_tot_r(beg:end) = nan - pef%eflx_sh_grnd(beg:end) = nan - pef%eflx_sh_veg(beg:end) = nan - pef%eflx_lh_vege(beg:end) = nan - pef%eflx_lh_vegt(beg:end) = nan - pef%eflx_wasteheat_pft(beg:end) = spval - pef%eflx_heat_from_ac_pft(beg:end) = spval - pef%eflx_traffic_pft(beg:end) = spval - pef%eflx_anthro(beg:end) = nan - pef%cgrnd(beg:end) = nan - pef%cgrndl(beg:end) = nan - pef%cgrnds(beg:end) = nan - pef%eflx_gnet(beg:end) = nan - pef%dgnetdT(beg:end) = nan - pef%eflx_lwrad_out(beg:end) = nan - pef%eflx_lwrad_net(beg:end) = nan - pef%eflx_lwrad_net_u(beg:end) = nan - pef%eflx_lwrad_net_r(beg:end) = nan - pef%netrad(beg:end) = nan - pef%fsds_vis_d(beg:end) = nan - pef%fsds_nir_d(beg:end) = nan - pef%fsds_vis_i(beg:end) = nan - pef%fsds_nir_i(beg:end) = nan - pef%fsr_vis_d(beg:end) = nan - pef%fsr_nir_d(beg:end) = nan - pef%fsr_vis_i(beg:end) = nan - pef%fsr_nir_i(beg:end) = nan - pef%fsds_vis_d_ln(beg:end) = nan - pef%fsds_nir_d_ln(beg:end) = nan - pef%fsr_vis_d_ln(beg:end) = nan - pef%fsr_nir_d_ln(beg:end) = nan - pef%sun_add(beg:end,1:numrad) = nan - pef%tot_aid(beg:end,1:numrad) = nan - pef%sun_aid(beg:end,1:numrad) = nan - pef%sun_aii(beg:end,1:numrad) = nan - pef%sha_aid(beg:end,1:numrad) = nan - pef%sha_aii(beg:end,1:numrad) = nan - pef%sun_atot(beg:end,1:numrad) = nan - pef%sha_atot(beg:end,1:numrad) = nan - pef%sun_alf(beg:end,1:numrad) = nan - pef%sha_alf(beg:end,1:numrad) = nan - pef%sun_aperlai(beg:end,1:numrad) = nan - pef%sha_aperlai(beg:end,1:numrad) = nan - pef%sabg_lyr(beg:end,-nlevsno+1:1) = nan - pef%sfc_frc_aer(beg:end) = nan - pef%sfc_frc_bc(beg:end) = nan - pef%sfc_frc_oc(beg:end) = nan - pef%sfc_frc_dst(beg:end) = nan - pef%sfc_frc_aer_sno(beg:end) = nan - pef%sfc_frc_bc_sno(beg:end) = nan - pef%sfc_frc_oc_sno(beg:end) = nan - pef%sfc_frc_dst_sno(beg:end) = nan - pef%fsr_sno_vd(beg:end) = nan - pef%fsr_sno_nd(beg:end) = nan - pef%fsr_sno_vi(beg:end) = nan - pef%fsr_sno_ni(beg:end) = nan - pef%fsds_sno_vd(beg:end) = nan - pef%fsds_sno_nd(beg:end) = nan - pef%fsds_sno_vi(beg:end) = nan - pef%fsds_sno_ni(beg:end) = nan - end subroutine init_pft_eflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_mflux_type -! -! !INTERFACE: - subroutine init_pft_mflux_type(beg, end, pmf) -! -! !DESCRIPTION: -! Initialize pft momentum flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_mflux_type), intent(inout) :: pmf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pmf%taux(beg:end)) - allocate(pmf%tauy(beg:end)) - - pmf%taux(beg:end) = nan - pmf%tauy(beg:end) = nan - - end subroutine init_pft_mflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_wflux_type -! -! !INTERFACE: - subroutine init_pft_wflux_type(beg, end, pwf) -! -! !DESCRIPTION: -! Initialize pft water flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_wflux_type), intent(inout) :: pwf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pwf%qflx_prec_intr(beg:end)) - allocate(pwf%qflx_prec_grnd(beg:end)) - allocate(pwf%qflx_rain_grnd(beg:end)) - allocate(pwf%qflx_snow_grnd(beg:end)) - allocate(pwf%qflx_snwcp_liq(beg:end)) - allocate(pwf%qflx_snwcp_ice(beg:end)) - allocate(pwf%qflx_evap_veg(beg:end)) - allocate(pwf%qflx_tran_veg(beg:end)) - allocate(pwf%qflx_evap_can(beg:end)) - allocate(pwf%qflx_evap_soi(beg:end)) - allocate(pwf%qflx_evap_tot(beg:end)) - allocate(pwf%qflx_evap_grnd(beg:end)) - allocate(pwf%qflx_dew_grnd(beg:end)) - allocate(pwf%qflx_sub_snow(beg:end)) - allocate(pwf%qflx_dew_snow(beg:end)) - - pwf%qflx_prec_intr(beg:end) = nan - pwf%qflx_prec_grnd(beg:end) = nan - pwf%qflx_rain_grnd(beg:end) = nan - pwf%qflx_snow_grnd(beg:end) = nan - pwf%qflx_snwcp_liq(beg:end) = nan - pwf%qflx_snwcp_ice(beg:end) = nan - pwf%qflx_evap_veg(beg:end) = nan - pwf%qflx_tran_veg(beg:end) = nan - pwf%qflx_evap_can(beg:end) = nan - pwf%qflx_evap_soi(beg:end) = nan - pwf%qflx_evap_tot(beg:end) = nan - pwf%qflx_evap_grnd(beg:end) = nan - pwf%qflx_dew_grnd(beg:end) = nan - pwf%qflx_sub_snow(beg:end) = nan - pwf%qflx_dew_snow(beg:end) = nan - - end subroutine init_pft_wflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_cflux_type -! -! !INTERFACE: - subroutine init_pft_cflux_type(beg, end, pcf) -! -! !DESCRIPTION: -! Initialize pft carbon flux variables -! -! !USES: - use clm_varcon, only : spval - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_cflux_type), intent(inout) :: pcf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pcf%psnsun(beg:end)) - allocate(pcf%psnsha(beg:end)) - allocate(pcf%fpsn(beg:end)) - allocate(pcf%fco2(beg:end)) - - allocate(pcf%m_leafc_to_litter(beg:end)) - allocate(pcf%m_frootc_to_litter(beg:end)) - allocate(pcf%m_leafc_storage_to_litter(beg:end)) - allocate(pcf%m_frootc_storage_to_litter(beg:end)) - allocate(pcf%m_livestemc_storage_to_litter(beg:end)) - allocate(pcf%m_deadstemc_storage_to_litter(beg:end)) - allocate(pcf%m_livecrootc_storage_to_litter(beg:end)) - allocate(pcf%m_deadcrootc_storage_to_litter(beg:end)) - allocate(pcf%m_leafc_xfer_to_litter(beg:end)) - allocate(pcf%m_frootc_xfer_to_litter(beg:end)) - allocate(pcf%m_livestemc_xfer_to_litter(beg:end)) - allocate(pcf%m_deadstemc_xfer_to_litter(beg:end)) - allocate(pcf%m_livecrootc_xfer_to_litter(beg:end)) - allocate(pcf%m_deadcrootc_xfer_to_litter(beg:end)) - allocate(pcf%m_livestemc_to_litter(beg:end)) - allocate(pcf%m_deadstemc_to_litter(beg:end)) - allocate(pcf%m_livecrootc_to_litter(beg:end)) - allocate(pcf%m_deadcrootc_to_litter(beg:end)) - allocate(pcf%m_gresp_storage_to_litter(beg:end)) - allocate(pcf%m_gresp_xfer_to_litter(beg:end)) - allocate(pcf%hrv_leafc_to_litter(beg:end)) - allocate(pcf%hrv_leafc_storage_to_litter(beg:end)) - allocate(pcf%hrv_leafc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_frootc_to_litter(beg:end)) - allocate(pcf%hrv_frootc_storage_to_litter(beg:end)) - allocate(pcf%hrv_frootc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_livestemc_to_litter(beg:end)) - allocate(pcf%hrv_livestemc_storage_to_litter(beg:end)) - allocate(pcf%hrv_livestemc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_deadstemc_to_prod10c(beg:end)) - allocate(pcf%hrv_deadstemc_to_prod100c(beg:end)) - allocate(pcf%hrv_deadstemc_storage_to_litter(beg:end)) - allocate(pcf%hrv_deadstemc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_livecrootc_to_litter(beg:end)) - allocate(pcf%hrv_livecrootc_storage_to_litter(beg:end)) - allocate(pcf%hrv_livecrootc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_deadcrootc_to_litter(beg:end)) - allocate(pcf%hrv_deadcrootc_storage_to_litter(beg:end)) - allocate(pcf%hrv_deadcrootc_xfer_to_litter(beg:end)) - allocate(pcf%hrv_gresp_storage_to_litter(beg:end)) - allocate(pcf%hrv_gresp_xfer_to_litter(beg:end)) - allocate(pcf%hrv_xsmrpool_to_atm(beg:end)) - allocate(pcf%m_leafc_to_fire(beg:end)) - allocate(pcf%m_frootc_to_fire(beg:end)) - allocate(pcf%m_leafc_storage_to_fire(beg:end)) - allocate(pcf%m_frootc_storage_to_fire(beg:end)) - allocate(pcf%m_livestemc_storage_to_fire(beg:end)) - allocate(pcf%m_deadstemc_storage_to_fire(beg:end)) - allocate(pcf%m_livecrootc_storage_to_fire(beg:end)) - allocate(pcf%m_deadcrootc_storage_to_fire(beg:end)) - allocate(pcf%m_leafc_xfer_to_fire(beg:end)) - allocate(pcf%m_frootc_xfer_to_fire(beg:end)) - allocate(pcf%m_livestemc_xfer_to_fire(beg:end)) - allocate(pcf%m_deadstemc_xfer_to_fire(beg:end)) - allocate(pcf%m_livecrootc_xfer_to_fire(beg:end)) - allocate(pcf%m_deadcrootc_xfer_to_fire(beg:end)) - allocate(pcf%m_livestemc_to_fire(beg:end)) - allocate(pcf%m_deadstemc_to_fire(beg:end)) - allocate(pcf%m_deadstemc_to_litter_fire(beg:end)) - allocate(pcf%m_livecrootc_to_fire(beg:end)) - allocate(pcf%m_deadcrootc_to_fire(beg:end)) - allocate(pcf%m_deadcrootc_to_litter_fire(beg:end)) - allocate(pcf%m_gresp_storage_to_fire(beg:end)) - allocate(pcf%m_gresp_xfer_to_fire(beg:end)) - allocate(pcf%leafc_xfer_to_leafc(beg:end)) - allocate(pcf%frootc_xfer_to_frootc(beg:end)) - allocate(pcf%livestemc_xfer_to_livestemc(beg:end)) - allocate(pcf%deadstemc_xfer_to_deadstemc(beg:end)) - allocate(pcf%livecrootc_xfer_to_livecrootc(beg:end)) - allocate(pcf%deadcrootc_xfer_to_deadcrootc(beg:end)) - allocate(pcf%leafc_to_litter(beg:end)) - allocate(pcf%frootc_to_litter(beg:end)) - allocate(pcf%leaf_mr(beg:end)) - allocate(pcf%froot_mr(beg:end)) - allocate(pcf%livestem_mr(beg:end)) - allocate(pcf%livecroot_mr(beg:end)) - allocate(pcf%leaf_curmr(beg:end)) - allocate(pcf%froot_curmr(beg:end)) - allocate(pcf%livestem_curmr(beg:end)) - allocate(pcf%livecroot_curmr(beg:end)) - allocate(pcf%leaf_xsmr(beg:end)) - allocate(pcf%froot_xsmr(beg:end)) - allocate(pcf%livestem_xsmr(beg:end)) - allocate(pcf%livecroot_xsmr(beg:end)) - allocate(pcf%psnsun_to_cpool(beg:end)) - allocate(pcf%psnshade_to_cpool(beg:end)) - allocate(pcf%cpool_to_xsmrpool(beg:end)) - allocate(pcf%cpool_to_leafc(beg:end)) - allocate(pcf%cpool_to_leafc_storage(beg:end)) - allocate(pcf%cpool_to_frootc(beg:end)) - allocate(pcf%cpool_to_frootc_storage(beg:end)) - allocate(pcf%cpool_to_livestemc(beg:end)) - allocate(pcf%cpool_to_livestemc_storage(beg:end)) - allocate(pcf%cpool_to_deadstemc(beg:end)) - allocate(pcf%cpool_to_deadstemc_storage(beg:end)) - allocate(pcf%cpool_to_livecrootc(beg:end)) - allocate(pcf%cpool_to_livecrootc_storage(beg:end)) - allocate(pcf%cpool_to_deadcrootc(beg:end)) - allocate(pcf%cpool_to_deadcrootc_storage(beg:end)) - allocate(pcf%cpool_to_gresp_storage(beg:end)) - allocate(pcf%cpool_leaf_gr(beg:end)) - allocate(pcf%cpool_leaf_storage_gr(beg:end)) - allocate(pcf%transfer_leaf_gr(beg:end)) - allocate(pcf%cpool_froot_gr(beg:end)) - allocate(pcf%cpool_froot_storage_gr(beg:end)) - allocate(pcf%transfer_froot_gr(beg:end)) - allocate(pcf%cpool_livestem_gr(beg:end)) - allocate(pcf%cpool_livestem_storage_gr(beg:end)) - allocate(pcf%transfer_livestem_gr(beg:end)) - allocate(pcf%cpool_deadstem_gr(beg:end)) - allocate(pcf%cpool_deadstem_storage_gr(beg:end)) - allocate(pcf%transfer_deadstem_gr(beg:end)) - allocate(pcf%cpool_livecroot_gr(beg:end)) - allocate(pcf%cpool_livecroot_storage_gr(beg:end)) - allocate(pcf%transfer_livecroot_gr(beg:end)) - allocate(pcf%cpool_deadcroot_gr(beg:end)) - allocate(pcf%cpool_deadcroot_storage_gr(beg:end)) - allocate(pcf%transfer_deadcroot_gr(beg:end)) - allocate(pcf%leafc_storage_to_xfer(beg:end)) - allocate(pcf%frootc_storage_to_xfer(beg:end)) - allocate(pcf%livestemc_storage_to_xfer(beg:end)) - allocate(pcf%deadstemc_storage_to_xfer(beg:end)) - allocate(pcf%livecrootc_storage_to_xfer(beg:end)) - allocate(pcf%deadcrootc_storage_to_xfer(beg:end)) - allocate(pcf%gresp_storage_to_xfer(beg:end)) - allocate(pcf%livestemc_to_deadstemc(beg:end)) - allocate(pcf%livecrootc_to_deadcrootc(beg:end)) - allocate(pcf%gpp(beg:end)) - allocate(pcf%mr(beg:end)) - allocate(pcf%current_gr(beg:end)) - allocate(pcf%transfer_gr(beg:end)) - allocate(pcf%storage_gr(beg:end)) - allocate(pcf%gr(beg:end)) - allocate(pcf%ar(beg:end)) - allocate(pcf%rr(beg:end)) - allocate(pcf%npp(beg:end)) - allocate(pcf%agnpp(beg:end)) - allocate(pcf%bgnpp(beg:end)) - allocate(pcf%litfall(beg:end)) - allocate(pcf%vegfire(beg:end)) - allocate(pcf%wood_harvestc(beg:end)) - allocate(pcf%pft_cinputs(beg:end)) - allocate(pcf%pft_coutputs(beg:end)) - allocate(pcf%pft_fire_closs(beg:end)) - if ( crop_prog )then - allocate(pcf%xsmrpool_to_atm(beg:end)) - allocate(pcf%grainc_xfer_to_grainc(beg:end)) - allocate(pcf%livestemc_to_litter(beg:end)) - allocate(pcf%grainc_to_food(beg:end)) - allocate(pcf%cpool_to_grainc(beg:end)) - allocate(pcf%cpool_to_grainc_storage(beg:end)) - allocate(pcf%cpool_grain_gr(beg:end)) - allocate(pcf%cpool_grain_storage_gr(beg:end)) - allocate(pcf%transfer_grain_gr(beg:end)) - allocate(pcf%grainc_storage_to_xfer(beg:end)) - end if - if (use_cn) then - allocate(pcf%frootc_alloc(beg:end)) - allocate(pcf%frootc_loss(beg:end)) - allocate(pcf%leafc_alloc(beg:end)) - allocate(pcf%leafc_loss(beg:end)) - allocate(pcf%woodc_alloc(beg:end)) - allocate(pcf%woodc_loss(beg:end)) - end if - - pcf%psnsun(beg:end) = nan - pcf%psnsha(beg:end) = nan - pcf%fpsn(beg:end) = spval - pcf%fco2(beg:end) = 0._r8 - - pcf%m_leafc_to_litter(beg:end) = nan - pcf%m_frootc_to_litter(beg:end) = nan - pcf%m_leafc_storage_to_litter(beg:end) = nan - pcf%m_frootc_storage_to_litter(beg:end) = nan - pcf%m_livestemc_storage_to_litter(beg:end) = nan - pcf%m_deadstemc_storage_to_litter(beg:end) = nan - pcf%m_livecrootc_storage_to_litter(beg:end) = nan - pcf%m_deadcrootc_storage_to_litter(beg:end) = nan - pcf%m_leafc_xfer_to_litter(beg:end) = nan - pcf%m_frootc_xfer_to_litter(beg:end) = nan - pcf%m_livestemc_xfer_to_litter(beg:end) = nan - pcf%m_deadstemc_xfer_to_litter(beg:end) = nan - pcf%m_livecrootc_xfer_to_litter(beg:end) = nan - pcf%m_deadcrootc_xfer_to_litter(beg:end) = nan - pcf%m_livestemc_to_litter(beg:end) = nan - pcf%m_deadstemc_to_litter(beg:end) = nan - pcf%m_livecrootc_to_litter(beg:end) = nan - pcf%m_deadcrootc_to_litter(beg:end) = nan - pcf%m_gresp_storage_to_litter(beg:end) = nan - pcf%m_gresp_xfer_to_litter(beg:end) = nan - pcf%hrv_leafc_to_litter(beg:end) = nan - pcf%hrv_leafc_storage_to_litter(beg:end) = nan - pcf%hrv_leafc_xfer_to_litter(beg:end) = nan - pcf%hrv_frootc_to_litter(beg:end) = nan - pcf%hrv_frootc_storage_to_litter(beg:end) = nan - pcf%hrv_frootc_xfer_to_litter(beg:end) = nan - pcf%hrv_livestemc_to_litter(beg:end) = nan - pcf%hrv_livestemc_storage_to_litter(beg:end) = nan - pcf%hrv_livestemc_xfer_to_litter(beg:end) = nan - pcf%hrv_deadstemc_to_prod10c(beg:end) = nan - pcf%hrv_deadstemc_to_prod100c(beg:end) = nan - pcf%hrv_deadstemc_storage_to_litter(beg:end) = nan - pcf%hrv_deadstemc_xfer_to_litter(beg:end) = nan - pcf%hrv_livecrootc_to_litter(beg:end) = nan - pcf%hrv_livecrootc_storage_to_litter(beg:end) = nan - pcf%hrv_livecrootc_xfer_to_litter(beg:end) = nan - pcf%hrv_deadcrootc_to_litter(beg:end) = nan - pcf%hrv_deadcrootc_storage_to_litter(beg:end) = nan - pcf%hrv_deadcrootc_xfer_to_litter(beg:end) = nan - pcf%hrv_gresp_storage_to_litter(beg:end) = nan - pcf%hrv_gresp_xfer_to_litter(beg:end) = nan - pcf%hrv_xsmrpool_to_atm(beg:end) = nan - pcf%m_leafc_to_fire(beg:end) = nan - pcf%m_frootc_to_fire(beg:end) = nan - pcf%m_leafc_storage_to_fire(beg:end) = nan - pcf%m_frootc_storage_to_fire(beg:end) = nan - pcf%m_livestemc_storage_to_fire(beg:end) = nan - pcf%m_deadstemc_storage_to_fire(beg:end) = nan - pcf%m_livecrootc_storage_to_fire(beg:end) = nan - pcf%m_deadcrootc_storage_to_fire(beg:end) = nan - pcf%m_leafc_xfer_to_fire(beg:end) = nan - pcf%m_frootc_xfer_to_fire(beg:end) = nan - pcf%m_livestemc_xfer_to_fire(beg:end) = nan - pcf%m_deadstemc_xfer_to_fire(beg:end) = nan - pcf%m_livecrootc_xfer_to_fire(beg:end) = nan - pcf%m_deadcrootc_xfer_to_fire(beg:end) = nan - pcf%m_livestemc_to_fire(beg:end) = nan - pcf%m_deadstemc_to_fire(beg:end) = nan - pcf%m_deadstemc_to_litter_fire(beg:end) = nan - pcf%m_livecrootc_to_fire(beg:end) = nan - pcf%m_deadcrootc_to_fire(beg:end) = nan - pcf%m_deadcrootc_to_litter_fire(beg:end) = nan - pcf%m_gresp_storage_to_fire(beg:end) = nan - pcf%m_gresp_xfer_to_fire(beg:end) = nan - pcf%leafc_xfer_to_leafc(beg:end) = nan - pcf%frootc_xfer_to_frootc(beg:end) = nan - pcf%livestemc_xfer_to_livestemc(beg:end) = nan - pcf%deadstemc_xfer_to_deadstemc(beg:end) = nan - pcf%livecrootc_xfer_to_livecrootc(beg:end) = nan - pcf%deadcrootc_xfer_to_deadcrootc(beg:end) = nan - pcf%leafc_to_litter(beg:end) = nan - pcf%frootc_to_litter(beg:end) = nan - pcf%leaf_mr(beg:end) = nan - pcf%froot_mr(beg:end) = nan - pcf%livestem_mr(beg:end) = nan - pcf%livecroot_mr(beg:end) = nan - pcf%leaf_curmr(beg:end) = nan - pcf%froot_curmr(beg:end) = nan - pcf%livestem_curmr(beg:end) = nan - pcf%livecroot_curmr(beg:end) = nan - pcf%leaf_xsmr(beg:end) = nan - pcf%froot_xsmr(beg:end) = nan - pcf%livestem_xsmr(beg:end) = nan - pcf%livecroot_xsmr(beg:end) = nan - pcf%psnsun_to_cpool(beg:end) = nan - pcf%psnshade_to_cpool(beg:end) = nan - pcf%cpool_to_xsmrpool(beg:end) = nan - pcf%cpool_to_leafc(beg:end) = nan - pcf%cpool_to_leafc_storage(beg:end) = nan - pcf%cpool_to_frootc(beg:end) = nan - pcf%cpool_to_frootc_storage(beg:end) = nan - pcf%cpool_to_livestemc(beg:end) = nan - pcf%cpool_to_livestemc_storage(beg:end) = nan - pcf%cpool_to_deadstemc(beg:end) = nan - pcf%cpool_to_deadstemc_storage(beg:end) = nan - pcf%cpool_to_livecrootc(beg:end) = nan - pcf%cpool_to_livecrootc_storage(beg:end) = nan - pcf%cpool_to_deadcrootc(beg:end) = nan - pcf%cpool_to_deadcrootc_storage(beg:end) = nan - pcf%cpool_to_gresp_storage(beg:end) = nan - pcf%cpool_leaf_gr(beg:end) = nan - pcf%cpool_leaf_storage_gr(beg:end) = nan - pcf%transfer_leaf_gr(beg:end) = nan - pcf%cpool_froot_gr(beg:end) = nan - pcf%cpool_froot_storage_gr(beg:end) = nan - pcf%transfer_froot_gr(beg:end) = nan - pcf%cpool_livestem_gr(beg:end) = nan - pcf%cpool_livestem_storage_gr(beg:end) = nan - pcf%transfer_livestem_gr(beg:end) = nan - pcf%cpool_deadstem_gr(beg:end) = nan - pcf%cpool_deadstem_storage_gr(beg:end) = nan - pcf%transfer_deadstem_gr(beg:end) = nan - pcf%cpool_livecroot_gr(beg:end) = nan - pcf%cpool_livecroot_storage_gr(beg:end) = nan - pcf%transfer_livecroot_gr(beg:end) = nan - pcf%cpool_deadcroot_gr(beg:end) = nan - pcf%cpool_deadcroot_storage_gr(beg:end) = nan - pcf%transfer_deadcroot_gr(beg:end) = nan - pcf%leafc_storage_to_xfer(beg:end) = nan - pcf%frootc_storage_to_xfer(beg:end) = nan - pcf%livestemc_storage_to_xfer(beg:end) = nan - pcf%deadstemc_storage_to_xfer(beg:end) = nan - pcf%livecrootc_storage_to_xfer(beg:end) = nan - pcf%deadcrootc_storage_to_xfer(beg:end) = nan - pcf%gresp_storage_to_xfer(beg:end) = nan - pcf%livestemc_to_deadstemc(beg:end) = nan - pcf%livecrootc_to_deadcrootc(beg:end) = nan - pcf%gpp(beg:end) = nan - pcf%mr(beg:end) = nan - pcf%current_gr(beg:end) = nan - pcf%transfer_gr(beg:end) = nan - pcf%storage_gr(beg:end) = nan - pcf%gr(beg:end) = nan - pcf%ar(beg:end) = nan - pcf%rr(beg:end) = nan - pcf%npp(beg:end) = nan - pcf%agnpp(beg:end) = nan - pcf%bgnpp(beg:end) = nan - pcf%litfall(beg:end) = nan - pcf%vegfire(beg:end) = nan - pcf%wood_harvestc(beg:end) = nan - pcf%pft_cinputs(beg:end) = nan - pcf%pft_coutputs(beg:end) = nan - pcf%pft_fire_closs(beg:end) = nan - if ( crop_prog )then - pcf%xsmrpool_to_atm(beg:end) = nan - pcf%grainc_xfer_to_grainc(beg:end) = nan - pcf%livestemc_to_litter(beg:end) = nan - pcf%grainc_to_food(beg:end) = nan - pcf%cpool_to_grainc(beg:end) = nan - pcf%cpool_to_grainc_storage(beg:end) = nan - pcf%cpool_grain_gr(beg:end) = nan - pcf%cpool_grain_storage_gr(beg:end) = nan - pcf%transfer_grain_gr(beg:end) = nan - pcf%grainc_storage_to_xfer(beg:end) = nan - end if - if (use_cn) then - pcf%frootc_alloc(beg:end) = nan - pcf%frootc_loss(beg:end) = nan - pcf%leafc_alloc(beg:end) = nan - pcf%leafc_loss(beg:end) = nan - pcf%woodc_alloc(beg:end) = nan - pcf%woodc_loss(beg:end) = nan - end if - - end subroutine init_pft_cflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_nflux_type -! -! !INTERFACE: - subroutine init_pft_nflux_type(beg, end, pnf) -! -! !DESCRIPTION: -! Initialize pft nitrogen flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_nflux_type), intent(inout) :: pnf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pnf%m_leafn_to_litter(beg:end)) - allocate(pnf%m_frootn_to_litter(beg:end)) - allocate(pnf%m_leafn_storage_to_litter(beg:end)) - allocate(pnf%m_frootn_storage_to_litter(beg:end)) - allocate(pnf%m_livestemn_storage_to_litter(beg:end)) - allocate(pnf%m_deadstemn_storage_to_litter(beg:end)) - allocate(pnf%m_livecrootn_storage_to_litter(beg:end)) - allocate(pnf%m_deadcrootn_storage_to_litter(beg:end)) - allocate(pnf%m_leafn_xfer_to_litter(beg:end)) - allocate(pnf%m_frootn_xfer_to_litter(beg:end)) - allocate(pnf%m_livestemn_xfer_to_litter(beg:end)) - allocate(pnf%m_deadstemn_xfer_to_litter(beg:end)) - allocate(pnf%m_livecrootn_xfer_to_litter(beg:end)) - allocate(pnf%m_deadcrootn_xfer_to_litter(beg:end)) - allocate(pnf%m_livestemn_to_litter(beg:end)) - allocate(pnf%m_deadstemn_to_litter(beg:end)) - allocate(pnf%m_livecrootn_to_litter(beg:end)) - allocate(pnf%m_deadcrootn_to_litter(beg:end)) - allocate(pnf%m_retransn_to_litter(beg:end)) - allocate(pnf%hrv_leafn_to_litter(beg:end)) - allocate(pnf%hrv_frootn_to_litter(beg:end)) - allocate(pnf%hrv_leafn_storage_to_litter(beg:end)) - allocate(pnf%hrv_frootn_storage_to_litter(beg:end)) - allocate(pnf%hrv_livestemn_storage_to_litter(beg:end)) - allocate(pnf%hrv_deadstemn_storage_to_litter(beg:end)) - allocate(pnf%hrv_livecrootn_storage_to_litter(beg:end)) - allocate(pnf%hrv_deadcrootn_storage_to_litter(beg:end)) - allocate(pnf%hrv_leafn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_frootn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_livestemn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_deadstemn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_livecrootn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_deadcrootn_xfer_to_litter(beg:end)) - allocate(pnf%hrv_livestemn_to_litter(beg:end)) - allocate(pnf%hrv_deadstemn_to_prod10n(beg:end)) - allocate(pnf%hrv_deadstemn_to_prod100n(beg:end)) - allocate(pnf%hrv_livecrootn_to_litter(beg:end)) - allocate(pnf%hrv_deadcrootn_to_litter(beg:end)) - allocate(pnf%hrv_retransn_to_litter(beg:end)) - allocate(pnf%m_leafn_to_fire(beg:end)) - allocate(pnf%m_frootn_to_fire(beg:end)) - allocate(pnf%m_leafn_storage_to_fire(beg:end)) - allocate(pnf%m_frootn_storage_to_fire(beg:end)) - allocate(pnf%m_livestemn_storage_to_fire(beg:end)) - allocate(pnf%m_deadstemn_storage_to_fire(beg:end)) - allocate(pnf%m_livecrootn_storage_to_fire(beg:end)) - allocate(pnf%m_deadcrootn_storage_to_fire(beg:end)) - allocate(pnf%m_leafn_xfer_to_fire(beg:end)) - allocate(pnf%m_frootn_xfer_to_fire(beg:end)) - allocate(pnf%m_livestemn_xfer_to_fire(beg:end)) - allocate(pnf%m_deadstemn_xfer_to_fire(beg:end)) - allocate(pnf%m_livecrootn_xfer_to_fire(beg:end)) - allocate(pnf%m_deadcrootn_xfer_to_fire(beg:end)) - allocate(pnf%m_livestemn_to_fire(beg:end)) - allocate(pnf%m_deadstemn_to_fire(beg:end)) - allocate(pnf%m_deadstemn_to_litter_fire(beg:end)) - allocate(pnf%m_livecrootn_to_fire(beg:end)) - allocate(pnf%m_deadcrootn_to_fire(beg:end)) - allocate(pnf%m_deadcrootn_to_litter_fire(beg:end)) - allocate(pnf%m_retransn_to_fire(beg:end)) - allocate(pnf%leafn_xfer_to_leafn(beg:end)) - allocate(pnf%frootn_xfer_to_frootn(beg:end)) - allocate(pnf%livestemn_xfer_to_livestemn(beg:end)) - allocate(pnf%deadstemn_xfer_to_deadstemn(beg:end)) - allocate(pnf%livecrootn_xfer_to_livecrootn(beg:end)) - allocate(pnf%deadcrootn_xfer_to_deadcrootn(beg:end)) - allocate(pnf%leafn_to_litter(beg:end)) - allocate(pnf%leafn_to_retransn(beg:end)) - allocate(pnf%frootn_to_litter(beg:end)) - allocate(pnf%retransn_to_npool(beg:end)) - allocate(pnf%sminn_to_npool(beg:end)) - allocate(pnf%npool_to_leafn(beg:end)) - allocate(pnf%npool_to_leafn_storage(beg:end)) - allocate(pnf%npool_to_frootn(beg:end)) - allocate(pnf%npool_to_frootn_storage(beg:end)) - allocate(pnf%npool_to_livestemn(beg:end)) - allocate(pnf%npool_to_livestemn_storage(beg:end)) - allocate(pnf%npool_to_deadstemn(beg:end)) - allocate(pnf%npool_to_deadstemn_storage(beg:end)) - allocate(pnf%npool_to_livecrootn(beg:end)) - allocate(pnf%npool_to_livecrootn_storage(beg:end)) - allocate(pnf%npool_to_deadcrootn(beg:end)) - allocate(pnf%npool_to_deadcrootn_storage(beg:end)) - allocate(pnf%leafn_storage_to_xfer(beg:end)) - allocate(pnf%frootn_storage_to_xfer(beg:end)) - allocate(pnf%livestemn_storage_to_xfer(beg:end)) - allocate(pnf%deadstemn_storage_to_xfer(beg:end)) - allocate(pnf%livecrootn_storage_to_xfer(beg:end)) - allocate(pnf%deadcrootn_storage_to_xfer(beg:end)) - allocate(pnf%livestemn_to_deadstemn(beg:end)) - allocate(pnf%livestemn_to_retransn(beg:end)) - allocate(pnf%livecrootn_to_deadcrootn(beg:end)) - allocate(pnf%livecrootn_to_retransn(beg:end)) - allocate(pnf%ndeploy(beg:end)) - allocate(pnf%pft_ninputs(beg:end)) - allocate(pnf%pft_noutputs(beg:end)) - allocate(pnf%wood_harvestn(beg:end)) - allocate(pnf%pft_fire_nloss(beg:end)) - if ( crop_prog )then - allocate(pnf%grainn_xfer_to_grainn(beg:end)) - allocate(pnf%livestemn_to_litter(beg:end)) - allocate(pnf%grainn_to_food(beg:end)) - allocate(pnf%npool_to_grainn(beg:end)) - allocate(pnf%npool_to_grainn_storage(beg:end)) - allocate(pnf%grainn_storage_to_xfer(beg:end)) - end if - - pnf%m_leafn_to_litter(beg:end) = nan - pnf%m_frootn_to_litter(beg:end) = nan - pnf%m_leafn_storage_to_litter(beg:end) = nan - pnf%m_frootn_storage_to_litter(beg:end) = nan - pnf%m_livestemn_storage_to_litter(beg:end) = nan - pnf%m_deadstemn_storage_to_litter(beg:end) = nan - pnf%m_livecrootn_storage_to_litter(beg:end) = nan - pnf%m_deadcrootn_storage_to_litter(beg:end) = nan - pnf%m_leafn_xfer_to_litter(beg:end) = nan - pnf%m_frootn_xfer_to_litter(beg:end) = nan - pnf%m_livestemn_xfer_to_litter(beg:end) = nan - pnf%m_deadstemn_xfer_to_litter(beg:end) = nan - pnf%m_livecrootn_xfer_to_litter(beg:end) = nan - pnf%m_deadcrootn_xfer_to_litter(beg:end) = nan - pnf%m_livestemn_to_litter(beg:end) = nan - pnf%m_deadstemn_to_litter(beg:end) = nan - pnf%m_livecrootn_to_litter(beg:end) = nan - pnf%m_deadcrootn_to_litter(beg:end) = nan - pnf%m_retransn_to_litter(beg:end) = nan - pnf%hrv_leafn_to_litter(beg:end) = nan - pnf%hrv_frootn_to_litter(beg:end) = nan - pnf%hrv_leafn_storage_to_litter(beg:end) = nan - pnf%hrv_frootn_storage_to_litter(beg:end) = nan - pnf%hrv_livestemn_storage_to_litter(beg:end) = nan - pnf%hrv_deadstemn_storage_to_litter(beg:end) = nan - pnf%hrv_livecrootn_storage_to_litter(beg:end) = nan - pnf%hrv_deadcrootn_storage_to_litter(beg:end) = nan - pnf%hrv_leafn_xfer_to_litter(beg:end) = nan - pnf%hrv_frootn_xfer_to_litter(beg:end) = nan - pnf%hrv_livestemn_xfer_to_litter(beg:end) = nan - pnf%hrv_deadstemn_xfer_to_litter(beg:end) = nan - pnf%hrv_livecrootn_xfer_to_litter(beg:end) = nan - pnf%hrv_deadcrootn_xfer_to_litter(beg:end) = nan - pnf%hrv_livestemn_to_litter(beg:end) = nan - pnf%hrv_deadstemn_to_prod10n(beg:end) = nan - pnf%hrv_deadstemn_to_prod100n(beg:end) = nan - pnf%hrv_livecrootn_to_litter(beg:end) = nan - pnf%hrv_deadcrootn_to_litter(beg:end) = nan - pnf%hrv_retransn_to_litter(beg:end) = nan - pnf%m_leafn_to_fire(beg:end) = nan - pnf%m_frootn_to_fire(beg:end) = nan - pnf%m_leafn_storage_to_fire(beg:end) = nan - pnf%m_frootn_storage_to_fire(beg:end) = nan - pnf%m_livestemn_storage_to_fire(beg:end) = nan - pnf%m_deadstemn_storage_to_fire(beg:end) = nan - pnf%m_livecrootn_storage_to_fire(beg:end) = nan - pnf%m_deadcrootn_storage_to_fire(beg:end) = nan - pnf%m_leafn_xfer_to_fire(beg:end) = nan - pnf%m_frootn_xfer_to_fire(beg:end) = nan - pnf%m_livestemn_xfer_to_fire(beg:end) = nan - pnf%m_deadstemn_xfer_to_fire(beg:end) = nan - pnf%m_livecrootn_xfer_to_fire(beg:end) = nan - pnf%m_deadcrootn_xfer_to_fire(beg:end) = nan - pnf%m_livestemn_to_fire(beg:end) = nan - pnf%m_deadstemn_to_fire(beg:end) = nan - pnf%m_deadstemn_to_litter_fire(beg:end) = nan - pnf%m_livecrootn_to_fire(beg:end) = nan - pnf%m_deadcrootn_to_fire(beg:end) = nan - pnf%m_deadcrootn_to_litter_fire(beg:end) = nan - pnf%m_retransn_to_fire(beg:end) = nan - pnf%leafn_xfer_to_leafn(beg:end) = nan - pnf%frootn_xfer_to_frootn(beg:end) = nan - pnf%livestemn_xfer_to_livestemn(beg:end) = nan - pnf%deadstemn_xfer_to_deadstemn(beg:end) = nan - pnf%livecrootn_xfer_to_livecrootn(beg:end) = nan - pnf%deadcrootn_xfer_to_deadcrootn(beg:end) = nan - pnf%leafn_to_litter(beg:end) = nan - pnf%leafn_to_retransn(beg:end) = nan - pnf%frootn_to_litter(beg:end) = nan - pnf%retransn_to_npool(beg:end) = nan - pnf%sminn_to_npool(beg:end) = nan - pnf%npool_to_leafn(beg:end) = nan - pnf%npool_to_leafn_storage(beg:end) = nan - pnf%npool_to_frootn(beg:end) = nan - pnf%npool_to_frootn_storage(beg:end) = nan - pnf%npool_to_livestemn(beg:end) = nan - pnf%npool_to_livestemn_storage(beg:end) = nan - pnf%npool_to_deadstemn(beg:end) = nan - pnf%npool_to_deadstemn_storage(beg:end) = nan - pnf%npool_to_livecrootn(beg:end) = nan - pnf%npool_to_livecrootn_storage(beg:end) = nan - pnf%npool_to_deadcrootn(beg:end) = nan - pnf%npool_to_deadcrootn_storage(beg:end) = nan - pnf%leafn_storage_to_xfer(beg:end) = nan - pnf%frootn_storage_to_xfer(beg:end) = nan - pnf%livestemn_storage_to_xfer(beg:end) = nan - pnf%deadstemn_storage_to_xfer(beg:end) = nan - pnf%livecrootn_storage_to_xfer(beg:end) = nan - pnf%deadcrootn_storage_to_xfer(beg:end) = nan - pnf%livestemn_to_deadstemn(beg:end) = nan - pnf%livestemn_to_retransn(beg:end) = nan - pnf%livecrootn_to_deadcrootn(beg:end) = nan - pnf%livecrootn_to_retransn(beg:end) = nan - pnf%ndeploy(beg:end) = nan - pnf%pft_ninputs(beg:end) = nan - pnf%pft_noutputs(beg:end) = nan - pnf%wood_harvestn(beg:end) = nan - pnf%pft_fire_nloss(beg:end) = nan - if ( crop_prog )then - pnf%grainn_xfer_to_grainn(beg:end) = nan - pnf%livestemn_to_litter(beg:end) = nan - pnf%grainn_to_food(beg:end) = nan - pnf%npool_to_grainn(beg:end) = nan - pnf%npool_to_grainn_storage(beg:end) = nan - pnf%grainn_storage_to_xfer(beg:end) = nan - end if - - end subroutine init_pft_nflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_vflux_type -! -! !INTERFACE: - subroutine init_pft_vflux_type(beg, end, pvf) -! -! !DESCRIPTION: -! Initialize pft VOC flux variables -! - use clm_varcon, only : spval - use shr_megan_mod, only: shr_megan_megcomps_n, shr_megan_mechcomps_n -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_vflux_type), intent(inout) :: pvf - - integer :: i -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! (heald, 08/06) -! -!EOP -!------------------------------------------------------------------------ - - if (shr_megan_mechcomps_n<1) return - - allocate(pvf%vocflx_tot(beg:end)) - allocate(pvf%vocflx(beg:end,1:shr_megan_mechcomps_n)) - allocate(pvf%Eopt_out(beg:end)) - allocate(pvf%topt_out(beg:end)) - allocate(pvf%alpha_out(beg:end)) - allocate(pvf%cp_out(beg:end)) - allocate(pvf%para_out(beg:end)) - allocate(pvf%par24a_out(beg:end)) - allocate(pvf%par240a_out(beg:end)) - allocate(pvf%paru_out(beg:end)) - allocate(pvf%par24u_out(beg:end)) - allocate(pvf%par240u_out(beg:end)) - allocate(pvf%gamma_out(beg:end)) - allocate(pvf%gammaL_out(beg:end)) - allocate(pvf%gammaT_out(beg:end)) - allocate(pvf%gammaP_out(beg:end)) - allocate(pvf%gammaA_out(beg:end)) - allocate(pvf%gammaS_out(beg:end)) - allocate(pvf%gammaC_out(beg:end)) - - pvf%vocflx_tot(beg:end) = nan - pvf%vocflx(beg:end,1:shr_megan_mechcomps_n) = nan - pvf%Eopt_out(beg:end) = nan - pvf%topt_out(beg:end) = nan - pvf%alpha_out(beg:end) = nan - pvf%cp_out(beg:end) = nan - pvf%para_out(beg:end) = nan - pvf%par24a_out(beg:end) = nan - pvf%par240a_out(beg:end) = nan - pvf%paru_out(beg:end) = nan - pvf%par24u_out(beg:end) = nan - pvf%par240u_out(beg:end) = nan - pvf%gamma_out(beg:end) = nan - pvf%gammaL_out(beg:end) = nan - pvf%gammaT_out(beg:end) = nan - pvf%gammaP_out(beg:end) = nan - pvf%gammaA_out(beg:end) = nan - pvf%gammaS_out(beg:end) = nan - pvf%gammaC_out(beg:end) = nan - - allocate(pvf%meg(shr_megan_megcomps_n)) - - do i=1,shr_megan_megcomps_n - allocate(pvf%meg(i)%flux_out(beg:end)) - pvf%meg(i)%flux_out(beg:end) = nan - enddo - - end subroutine init_pft_vflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_dflux_type -! -! !INTERFACE: - subroutine init_pft_dflux_type(beg, end, pdf) -! -! !DESCRIPTION: -! Initialize pft dust flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_dflux_type), intent(inout):: pdf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(pdf%flx_mss_vrt_dst(beg:end,1:ndst)) - allocate(pdf%flx_mss_vrt_dst_tot(beg:end)) - allocate(pdf%vlc_trb(beg:end,1:ndst)) - allocate(pdf%vlc_trb_1(beg:end)) - allocate(pdf%vlc_trb_2(beg:end)) - allocate(pdf%vlc_trb_3(beg:end)) - allocate(pdf%vlc_trb_4(beg:end)) - - pdf%flx_mss_vrt_dst(beg:end,1:ndst) = nan - pdf%flx_mss_vrt_dst_tot(beg:end) = nan - pdf%vlc_trb(beg:end,1:ndst) = nan - pdf%vlc_trb_1(beg:end) = nan - pdf%vlc_trb_2(beg:end) = nan - pdf%vlc_trb_3(beg:end) = nan - pdf%vlc_trb_4(beg:end) = nan - - end subroutine init_pft_dflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_pft_depvd_type -! -! !INTERFACE: - subroutine init_pft_depvd_type(beg, end, pdd) - - use seq_drydep_mod, only: n_drydep, drydep_method, DD_XLND -! -! !DESCRIPTION: -! Initialize pft dep velocity variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (pft_depvd_type), intent(inout):: pdd - integer :: i -! -! !REVISION HISTORY: -! Created by James Sulzman 541-929-6183 -! -!EOP -!------------------------------------------------------------------------ - - if ( n_drydep > 0 .and. drydep_method == DD_XLND )then - allocate(pdd%drydepvel(beg:end,n_drydep)) - pdd%drydepvel = nan - end if - - end subroutine init_pft_depvd_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_pstate_type -! -! !INTERFACE: - subroutine init_column_pstate_type(beg, end, cps) -! -! !DESCRIPTION: -! Initialize column physical state variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_pstate_type), intent(inout):: cps -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(cps%snl(beg:end)) !* cannot be averaged up - allocate(cps%isoicol(beg:end)) !* cannot be averaged up - allocate(cps%bsw(beg:end,nlevgrnd)) - allocate(cps%watsat(beg:end,nlevgrnd)) - allocate(cps%watfc(beg:end,nlevgrnd)) - allocate(cps%watdry(beg:end,nlevgrnd)) - allocate(cps%watopt(beg:end,nlevgrnd)) - allocate(cps%hksat(beg:end,nlevgrnd)) - allocate(cps%sucsat(beg:end,nlevgrnd)) - allocate(cps%csol(beg:end,nlevgrnd)) - allocate(cps%tkmg(beg:end,nlevgrnd)) - allocate(cps%tkdry(beg:end,nlevgrnd)) - allocate(cps%tksatu(beg:end,nlevgrnd)) - allocate(cps%smpmin(beg:end)) - allocate(cps%hkdepth(beg:end)) - allocate(cps%wtfact(beg:end)) - allocate(cps%fracice(beg:end,nlevgrnd)) - allocate(cps%gwc_thr(beg:end)) - allocate(cps%mss_frc_cly_vld(beg:end)) - allocate(cps%mbl_bsn_fct(beg:end)) - allocate(cps%do_capsnow(beg:end)) - allocate(cps%snowdp(beg:end)) - allocate(cps%frac_sno (beg:end)) - allocate(cps%zi(beg:end,-nlevsno+0:nlevgrnd)) - allocate(cps%dz(beg:end,-nlevsno+1:nlevgrnd)) - allocate(cps%z (beg:end,-nlevsno+1:nlevgrnd)) - allocate(cps%frac_iceold(beg:end,-nlevsno+1:nlevgrnd)) - allocate(cps%imelt(beg:end,-nlevsno+1:nlevgrnd)) - allocate(cps%eff_porosity(beg:end,nlevgrnd)) - allocate(cps%emg(beg:end)) - allocate(cps%z0mg(beg:end)) - allocate(cps%z0hg(beg:end)) - allocate(cps%z0qg(beg:end)) - allocate(cps%htvp(beg:end)) - allocate(cps%beta(beg:end)) - allocate(cps%zii(beg:end)) - allocate(cps%albgrd(beg:end,numrad)) - allocate(cps%albgri(beg:end,numrad)) - allocate(cps%rootr_column(beg:end,nlevgrnd)) - allocate(cps%rootfr_road_perv(beg:end,nlevgrnd)) - allocate(cps%rootr_road_perv(beg:end,nlevgrnd)) - allocate(cps%wf(beg:end)) -! allocate(cps%xirrig(beg:end)) - allocate(cps%max_dayl(beg:end)) - allocate(cps%bsw2(beg:end,nlevgrnd)) - allocate(cps%psisat(beg:end,nlevgrnd)) - allocate(cps%vwcsat(beg:end,nlevgrnd)) - allocate(cps%soilpsi(beg:end,nlevgrnd)) - allocate(cps%decl(beg:end)) - allocate(cps%coszen(beg:end)) - allocate(cps%fpi(beg:end)) - allocate(cps%fpg(beg:end)) - allocate(cps%annsum_counter(beg:end)) - allocate(cps%cannsum_npp(beg:end)) - allocate(cps%cannavg_t2m(beg:end)) - allocate(cps%me(beg:end)) - allocate(cps%fire_prob(beg:end)) - allocate(cps%mean_fire_prob(beg:end)) - allocate(cps%fireseasonl(beg:end)) - allocate(cps%farea_burned(beg:end)) - allocate(cps%ann_farea_burned(beg:end)) - allocate(cps%albsnd_hst(beg:end,numrad)) - allocate(cps%albsni_hst(beg:end,numrad)) - allocate(cps%albsod(beg:end,numrad)) - allocate(cps%albsoi(beg:end,numrad)) - allocate(cps%flx_absdv(beg:end,-nlevsno+1:1)) - allocate(cps%flx_absdn(beg:end,-nlevsno+1:1)) - allocate(cps%flx_absiv(beg:end,-nlevsno+1:1)) - allocate(cps%flx_absin(beg:end,-nlevsno+1:1)) - allocate(cps%snw_rds(beg:end,-nlevsno+1:0)) - allocate(cps%snw_rds_top(beg:end)) - allocate(cps%sno_liq_top(beg:end)) - allocate(cps%mss_bcpho(beg:end,-nlevsno+1:0)) - allocate(cps%mss_bcphi(beg:end,-nlevsno+1:0)) - allocate(cps%mss_bctot(beg:end,-nlevsno+1:0)) - allocate(cps%mss_bc_col(beg:end)) - allocate(cps%mss_bc_top(beg:end)) - allocate(cps%mss_ocpho(beg:end,-nlevsno+1:0)) - allocate(cps%mss_ocphi(beg:end,-nlevsno+1:0)) - allocate(cps%mss_octot(beg:end,-nlevsno+1:0)) - allocate(cps%mss_oc_col(beg:end)) - allocate(cps%mss_oc_top(beg:end)) - allocate(cps%mss_dst1(beg:end,-nlevsno+1:0)) - allocate(cps%mss_dst2(beg:end,-nlevsno+1:0)) - allocate(cps%mss_dst3(beg:end,-nlevsno+1:0)) - allocate(cps%mss_dst4(beg:end,-nlevsno+1:0)) - allocate(cps%mss_dsttot(beg:end,-nlevsno+1:0)) - allocate(cps%mss_dst_col(beg:end)) - allocate(cps%mss_dst_top(beg:end)) - allocate(cps%h2osno_top(beg:end)) - allocate(cps%mss_cnc_bcphi(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_bcpho(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_ocphi(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_ocpho(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_dst1(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_dst2(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_dst3(beg:end,-nlevsno+1:0)) - allocate(cps%mss_cnc_dst4(beg:end,-nlevsno+1:0)) - allocate(cps%albgrd_pur(beg:end,numrad)) - allocate(cps%albgri_pur(beg:end,numrad)) - allocate(cps%albgrd_bc(beg:end,numrad)) - allocate(cps%albgri_bc(beg:end,numrad)) - allocate(cps%albgrd_oc(beg:end,numrad)) - allocate(cps%albgri_oc(beg:end,numrad)) - allocate(cps%albgrd_dst(beg:end,numrad)) - allocate(cps%albgri_dst(beg:end,numrad)) - allocate(cps%dTdz_top(beg:end)) - allocate(cps%snot_top(beg:end)) - allocate(cps%irrig_rate(beg:end)) - allocate(cps%n_irrig_steps_left(beg:end)) - allocate(cps%forc_pbot(beg:end)) - allocate(cps%forc_rho(beg:end)) - allocate(cps%glc_topo(beg:end)) - cps%isoicol(beg:end) = huge(1) - cps%bsw(beg:end,1:nlevgrnd) = nan - cps%watsat(beg:end,1:nlevgrnd) = nan - cps%watfc(beg:end,1:nlevgrnd) = nan - cps%watdry(beg:end,1:nlevgrnd) = nan - cps%watopt(beg:end,1:nlevgrnd) = nan - cps%hksat(beg:end,1:nlevgrnd) = nan - cps%sucsat(beg:end,1:nlevgrnd) = nan - cps%csol(beg:end,1:nlevgrnd) = nan - cps%tkmg(beg:end,1:nlevgrnd) = nan - cps%tkdry(beg:end,1:nlevgrnd) = nan - cps%tksatu(beg:end,1:nlevgrnd) = nan - cps%smpmin(beg:end) = nan - cps%hkdepth(beg:end) = nan - cps%wtfact(beg:end) = nan - cps%fracice(beg:end,1:nlevgrnd) = nan - cps%gwc_thr(beg:end) = nan - cps%mss_frc_cly_vld(beg:end) = nan - cps%mbl_bsn_fct(beg:end) = nan - cps%do_capsnow (beg:end)= .false. - cps%snowdp(beg:end) = nan - cps%frac_sno(beg:end) = nan - cps%zi(beg:end,-nlevsno+0:nlevgrnd) = nan - cps%dz(beg:end,-nlevsno+1:nlevgrnd) = nan - cps%z (beg:end,-nlevsno+1:nlevgrnd) = nan - cps%frac_iceold(beg:end,-nlevsno+1:nlevgrnd) = spval - cps%imelt(beg:end,-nlevsno+1:nlevgrnd) = huge(1) - cps%eff_porosity(beg:end,1:nlevgrnd) = spval - cps%emg(beg:end) = nan - cps%z0mg(beg:end) = nan - cps%z0hg(beg:end) = nan - cps%z0qg(beg:end) = nan - cps%htvp(beg:end) = nan - cps%beta(beg:end) = nan - cps%zii(beg:end) = nan - cps%albgrd(beg:end,:numrad) = nan - cps%albgri(beg:end,:numrad) = nan - cps%rootr_column(beg:end,1:nlevgrnd) = spval - cps%rootfr_road_perv(beg:end,1:nlevurb) = nan - cps%rootr_road_perv(beg:end,1:nlevurb) = nan - cps%wf(beg:end) = nan -! cps%xirrig(beg:end) = 0._r8 - cps%bsw2(beg:end,1:nlevgrnd) = nan - cps%psisat(beg:end,1:nlevgrnd) = nan - cps%vwcsat(beg:end,1:nlevgrnd) = nan - cps%soilpsi(beg:end,1:nlevgrnd) = spval - cps%decl(beg:end) = nan - cps%coszen(beg:end) = nan - cps%fpi(beg:end) = nan - cps%fpg(beg:end) = nan - cps%annsum_counter(beg:end) = nan - cps%cannsum_npp(beg:end) = nan - cps%cannavg_t2m(beg:end) = nan - cps%me(beg:end) = nan - cps%fire_prob(beg:end) = nan - cps%mean_fire_prob(beg:end) = nan - cps%fireseasonl(beg:end) = nan - cps%farea_burned(beg:end) = nan - cps%ann_farea_burned(beg:end) = nan - cps%albsnd_hst(beg:end,:numrad) = spval - cps%albsni_hst(beg:end,:numrad) = spval - cps%albsod(beg:end,:numrad) = nan - cps%albsoi(beg:end,:numrad) = nan - cps%flx_absdv(beg:end,-nlevsno+1:1) = spval - cps%flx_absdn(beg:end,-nlevsno+1:1) = spval - cps%flx_absiv(beg:end,-nlevsno+1:1) = spval - cps%flx_absin(beg:end,-nlevsno+1:1) = spval - cps%snw_rds(beg:end,-nlevsno+1:0) = nan - cps%snw_rds_top(beg:end) = nan - cps%sno_liq_top(beg:end) = nan - cps%mss_bcpho(beg:end,-nlevsno+1:0) = nan - cps%mss_bcphi(beg:end,-nlevsno+1:0) = nan - cps%mss_bctot(beg:end,-nlevsno+1:0) = nan - cps%mss_bc_col(beg:end) = nan - cps%mss_bc_top(beg:end) = nan - cps%mss_ocpho(beg:end,-nlevsno+1:0) = nan - cps%mss_ocphi(beg:end,-nlevsno+1:0) = nan - cps%mss_octot(beg:end,-nlevsno+1:0) = nan - cps%mss_oc_col(beg:end) = nan - cps%mss_oc_top(beg:end) = nan - cps%mss_dst1(beg:end,-nlevsno+1:0) = nan - cps%mss_dst2(beg:end,-nlevsno+1:0) = nan - cps%mss_dst3(beg:end,-nlevsno+1:0) = nan - cps%mss_dst4(beg:end,-nlevsno+1:0) = nan - cps%mss_dsttot(beg:end,-nlevsno+1:0) = nan - cps%mss_dst_col(beg:end) = nan - cps%mss_dst_top(beg:end) = nan - cps%h2osno_top(beg:end) = nan - cps%mss_cnc_bcphi(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_bcpho(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_ocphi(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_ocpho(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_dst1(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_dst2(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_dst3(beg:end,-nlevsno+1:0) = nan - cps%mss_cnc_dst4(beg:end,-nlevsno+1:0) = nan - cps%albgrd_pur(beg:end,:numrad) = nan - cps%albgri_pur(beg:end,:numrad) = nan - cps%albgrd_bc(beg:end,:numrad) = nan - cps%albgri_bc(beg:end,:numrad) = nan - cps%albgrd_oc(beg:end,:numrad) = nan - cps%albgri_oc(beg:end,:numrad) = nan - cps%albgrd_dst(beg:end,:numrad) = nan - cps%albgri_dst(beg:end,:numrad) = nan - cps%dTdz_top(beg:end) = nan - cps%snot_top(beg:end) = nan - cps%irrig_rate(beg:end) = nan - cps%n_irrig_steps_left(beg:end) = 0 - cps%forc_pbot(beg:end) = nan - cps%forc_rho(beg:end) = nan - cps%glc_topo(beg:end) = nan - - end subroutine init_column_pstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_estate_type -! -! !INTERFACE: - subroutine init_column_estate_type(beg, end, ces) -! -! !DESCRIPTION: -! Initialize column energy state variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_estate_type), intent(inout):: ces -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - allocate(ces%t_grnd(beg:end)) - allocate(ces%t_grnd_u(beg:end)) - allocate(ces%t_grnd_r(beg:end)) - allocate(ces%dt_grnd(beg:end)) - allocate(ces%t_soisno(beg:end,-nlevsno+1:nlevgrnd)) - allocate(ces%t_soi_10cm(beg:end)) - allocate(ces%t_lake(beg:end,1:nlevlak)) - allocate(ces%tssbef(beg:end,-nlevsno+1:nlevgrnd)) - allocate(ces%thv(beg:end)) - allocate(ces%hc_soi(beg:end)) - allocate(ces%hc_soisno(beg:end)) - allocate(ces%forc_t(beg:end)) - allocate(ces%forc_th(beg:end)) - - ces%t_grnd(beg:end) = nan - ces%t_grnd_u(beg:end) = nan - ces%t_grnd_r(beg:end) = nan - ces%dt_grnd(beg:end) = nan - ces%t_soisno(beg:end,-nlevsno+1:nlevgrnd) = spval - ces%t_soi_10cm(beg:end) = spval - ces%t_lake(beg:end,1:nlevlak) = nan - ces%tssbef(beg:end,-nlevsno+1:nlevgrnd) = nan - ces%thv(beg:end) = nan - ces%hc_soi(beg:end) = nan - ces%hc_soisno(beg:end) = nan - ces%forc_t(beg:end) = nan - ces%forc_th(beg:end) = nan - - end subroutine init_column_estate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_wstate_type -! -! !INTERFACE: - subroutine init_column_wstate_type(beg, end, cws) -! -! !DESCRIPTION: -! Initialize column water state variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_wstate_type), intent(inout):: cws !column water state -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(cws%h2osno(beg:end)) - allocate(cws%errh2osno(beg:end)) - allocate(cws%snow_sources(beg:end)) - allocate(cws%snow_sinks(beg:end)) - allocate(cws%h2osoi_liq(beg:end,-nlevsno+1:nlevgrnd)) - allocate(cws%h2osoi_ice(beg:end,-nlevsno+1:nlevgrnd)) - allocate(cws%h2osoi_liqice_10cm(beg:end)) - allocate(cws%h2osoi_vol(beg:end,1:nlevgrnd)) - allocate(cws%h2osno_old(beg:end)) - allocate(cws%qg(beg:end)) - allocate(cws%dqgdT(beg:end)) - allocate(cws%snowice(beg:end)) - allocate(cws%snowliq(beg:end)) - allocate(cws%soilalpha(beg:end)) - allocate(cws%soilbeta(beg:end)) - allocate(cws%soilalpha_u(beg:end)) - allocate(cws%zwt(beg:end)) - allocate(cws%fcov(beg:end)) - allocate(cws%fsat(beg:end)) - allocate(cws%wa(beg:end)) - allocate(cws%wt(beg:end)) - allocate(cws%qcharge(beg:end)) - allocate(cws%smp_l(beg:end,1:nlevgrnd)) - allocate(cws%hk_l(beg:end,1:nlevgrnd)) - allocate(cws%forc_q(beg:end)) - - cws%h2osno(beg:end) = nan - cws%errh2osno(beg:end) = nan - cws%snow_sources(beg:end) = nan - cws%snow_sinks(beg:end) = nan - cws%h2osoi_liq(beg:end,-nlevsno+1:nlevgrnd)= spval - cws%h2osoi_ice(beg:end,-nlevsno+1:nlevgrnd) = spval - cws%h2osoi_liqice_10cm(beg:end) = spval - cws%h2osoi_vol(beg:end,1:nlevgrnd) = spval - cws%h2osno_old(beg:end) = nan - cws%qg(beg:end) = nan - cws%dqgdT(beg:end) = nan - cws%snowice(beg:end) = nan - cws%snowliq(beg:end) = nan - cws%soilalpha(beg:end) = nan - cws%soilbeta(beg:end) = nan - cws%soilalpha_u(beg:end) = nan - cws%zwt(beg:end) = nan - cws%fcov(beg:end) = nan - cws%fsat(beg:end) = nan - cws%wa(beg:end) = nan - cws%wt(beg:end) = nan - cws%qcharge(beg:end) = nan - cws%smp_l(beg:end,1:nlevgrnd) = spval - cws%hk_l(beg:end,1:nlevgrnd) = spval - cws%forc_q(beg:end) = nan - - end subroutine init_column_wstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_cstate_type -! -! !INTERFACE: - subroutine init_column_cstate_type(beg, end, ccs) -! -! !DESCRIPTION: -! Initialize column carbon state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_cstate_type), intent(inout):: ccs -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(ccs%soilc(beg:end)) - allocate(ccs%cwdc(beg:end)) - allocate(ccs%litr1c(beg:end)) - allocate(ccs%litr2c(beg:end)) - allocate(ccs%litr3c(beg:end)) - allocate(ccs%soil1c(beg:end)) - allocate(ccs%soil2c(beg:end)) - allocate(ccs%soil3c(beg:end)) - allocate(ccs%soil4c(beg:end)) - allocate(ccs%seedc(beg:end)) - allocate(ccs%col_ctrunc(beg:end)) - allocate(ccs%prod10c(beg:end)) - allocate(ccs%prod100c(beg:end)) - allocate(ccs%totprodc(beg:end)) - allocate(ccs%totlitc(beg:end)) - allocate(ccs%totsomc(beg:end)) - allocate(ccs%totecosysc(beg:end)) - allocate(ccs%totcolc(beg:end)) - - ccs%soilc(beg:end) = nan - ccs%cwdc(beg:end) = nan - ccs%litr1c(beg:end) = nan - ccs%litr2c(beg:end) = nan - ccs%litr3c(beg:end) = nan - ccs%soil1c(beg:end) = nan - ccs%soil2c(beg:end) = nan - ccs%soil3c(beg:end) = nan - ccs%soil4c(beg:end) = nan - ccs%seedc(beg:end) = nan - ccs%col_ctrunc(beg:end) = nan - ccs%prod10c(beg:end) = nan - ccs%prod100c(beg:end) = nan - ccs%totprodc(beg:end) = nan - ccs%totlitc(beg:end) = nan - ccs%totsomc(beg:end) = nan - ccs%totecosysc(beg:end) = nan - ccs%totcolc(beg:end) = nan - - end subroutine init_column_cstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_nstate_type -! -! !INTERFACE: - subroutine init_column_nstate_type(beg, end, cns) -! -! !DESCRIPTION: -! Initialize column nitrogen state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_nstate_type), intent(inout):: cns -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - allocate(cns%cwdn(beg:end)) - allocate(cns%litr1n(beg:end)) - allocate(cns%litr2n(beg:end)) - allocate(cns%litr3n(beg:end)) - allocate(cns%soil1n(beg:end)) - allocate(cns%soil2n(beg:end)) - allocate(cns%soil3n(beg:end)) - allocate(cns%soil4n(beg:end)) - allocate(cns%sminn(beg:end)) - allocate(cns%col_ntrunc(beg:end)) - allocate(cns%seedn(beg:end)) - allocate(cns%prod10n(beg:end)) - allocate(cns%prod100n(beg:end)) - allocate(cns%totprodn(beg:end)) - allocate(cns%totlitn(beg:end)) - allocate(cns%totsomn(beg:end)) - allocate(cns%totecosysn(beg:end)) - allocate(cns%totcoln(beg:end)) - - cns%cwdn(beg:end) = nan - cns%litr1n(beg:end) = nan - cns%litr2n(beg:end) = nan - cns%litr3n(beg:end) = nan - cns%soil1n(beg:end) = nan - cns%soil2n(beg:end) = nan - cns%soil3n(beg:end) = nan - cns%soil4n(beg:end) = nan - cns%sminn(beg:end) = nan - cns%col_ntrunc(beg:end) = nan - cns%seedn(beg:end) = nan - cns%prod10n(beg:end) = nan - cns%prod100n(beg:end) = nan - cns%totprodn(beg:end) = nan - cns%totlitn(beg:end) = nan - cns%totsomn(beg:end) = nan - cns%totecosysn(beg:end) = nan - cns%totcoln(beg:end) = nan - - end subroutine init_column_nstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_eflux_type -! -! !INTERFACE: - subroutine init_column_eflux_type(beg, end, cef) -! -! !DESCRIPTION: -! Initialize column energy flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_eflux_type), intent(inout):: cef -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(cef%eflx_snomelt(beg:end)) - allocate(cef%eflx_snomelt_u(beg:end)) - allocate(cef%eflx_snomelt_r(beg:end)) - allocate(cef%eflx_impsoil(beg:end)) - allocate(cef%eflx_fgr12(beg:end)) - allocate(cef%eflx_building_heat(beg:end)) - allocate(cef%eflx_urban_ac(beg:end)) - allocate(cef%eflx_urban_heat(beg:end)) - allocate(cef%eflx_bot(beg:end)) - - cef%eflx_snomelt(beg:end) = nan - cef%eflx_snomelt_u(beg:end) = nan - cef%eflx_snomelt_r(beg:end) = nan - cef%eflx_impsoil(beg:end) = nan - cef%eflx_fgr12(beg:end) = nan - cef%eflx_building_heat(beg:end) = nan - cef%eflx_urban_ac(beg:end) = nan - cef%eflx_urban_heat(beg:end) = nan - cef%eflx_bot(beg:end) = nan - - end subroutine init_column_eflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_wflux_type -! -! !INTERFACE: - subroutine init_column_wflux_type(beg, end, cwf) -! -! !DESCRIPTION: -! Initialize column water flux variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_wflux_type), intent(inout):: cwf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(cwf%qflx_infl(beg:end)) - allocate(cwf%qflx_surf(beg:end)) - allocate(cwf%qflx_drain(beg:end)) - allocate(cwf%qflx_top_soil(beg:end)) - allocate(cwf%qflx_sl_top_soil(beg:end)) - allocate(cwf%qflx_snomelt(beg:end)) - allocate(cwf%qflx_qrgwl(beg:end)) - allocate(cwf%qflx_runoff(beg:end)) - allocate(cwf%qflx_runoff_u(beg:end)) - allocate(cwf%qflx_runoff_r(beg:end)) - allocate(cwf%qmelt(beg:end)) - allocate(cwf%h2ocan_loss(beg:end)) - allocate(cwf%qflx_rsub_sat(beg:end)) - allocate(cwf%flx_bc_dep_dry(beg:end)) - allocate(cwf%flx_bc_dep_wet(beg:end)) - allocate(cwf%flx_bc_dep_pho(beg:end)) - allocate(cwf%flx_bc_dep_phi(beg:end)) - allocate(cwf%flx_bc_dep(beg:end)) - allocate(cwf%flx_oc_dep_dry(beg:end)) - allocate(cwf%flx_oc_dep_wet(beg:end)) - allocate(cwf%flx_oc_dep_pho(beg:end)) - allocate(cwf%flx_oc_dep_phi(beg:end)) - allocate(cwf%flx_oc_dep(beg:end)) - allocate(cwf%flx_dst_dep_dry1(beg:end)) - allocate(cwf%flx_dst_dep_wet1(beg:end)) - allocate(cwf%flx_dst_dep_dry2(beg:end)) - allocate(cwf%flx_dst_dep_wet2(beg:end)) - allocate(cwf%flx_dst_dep_dry3(beg:end)) - allocate(cwf%flx_dst_dep_wet3(beg:end)) - allocate(cwf%flx_dst_dep_dry4(beg:end)) - allocate(cwf%flx_dst_dep_wet4(beg:end)) - allocate(cwf%flx_dst_dep(beg:end)) - allocate(cwf%qflx_snofrz_lyr(beg:end,-nlevsno+1:0)) - allocate(cwf%qflx_snofrz_col(beg:end)) - allocate(cwf%qflx_irrig(beg:end)) - allocate(cwf%qflx_glcice(beg:end)) - allocate(cwf%qflx_glcice_frz(beg:end)) - allocate(cwf%qflx_glcice_melt(beg:end)) - allocate(cwf%glc_rofi(beg:end)) - allocate(cwf%glc_rofl(beg:end)) - allocate(cwf%qflx_floodc(beg:end)) - allocate(cwf%qflx_snow_melt(beg:end)) - - cwf%qflx_infl(beg:end) = nan - cwf%qflx_surf(beg:end) = nan - cwf%qflx_drain(beg:end) = nan - cwf%qflx_top_soil(beg:end) = spval - cwf%qflx_sl_top_soil(beg:end) = nan - cwf%qflx_snomelt(beg:end) = nan - cwf%qflx_qrgwl(beg:end) = nan - cwf%qflx_runoff(beg:end) = nan - cwf%qflx_runoff_u(beg:end) = nan - cwf%qflx_runoff_r(beg:end) = nan - cwf%qmelt(beg:end) = nan - cwf%h2ocan_loss(beg:end) = nan - cwf%qflx_rsub_sat(beg:end) = nan - cwf%flx_bc_dep_dry(beg:end) = nan - cwf%flx_bc_dep_wet(beg:end) = nan - cwf%flx_bc_dep_pho(beg:end) = nan - cwf%flx_bc_dep_phi(beg:end) = nan - cwf%flx_bc_dep(beg:end) = nan - cwf%flx_oc_dep_dry(beg:end) = nan - cwf%flx_oc_dep_wet(beg:end) = nan - cwf%flx_oc_dep_pho(beg:end) = nan - cwf%flx_oc_dep_phi(beg:end) = nan - cwf%flx_oc_dep(beg:end) = nan - cwf%flx_dst_dep_dry1(beg:end) = nan - cwf%flx_dst_dep_wet1(beg:end) = nan - cwf%flx_dst_dep_dry2(beg:end) = nan - cwf%flx_dst_dep_wet2(beg:end) = nan - cwf%flx_dst_dep_dry3(beg:end) = nan - cwf%flx_dst_dep_wet3(beg:end) = nan - cwf%flx_dst_dep_dry4(beg:end) = nan - cwf%flx_dst_dep_wet4(beg:end) = nan - cwf%flx_dst_dep(beg:end) = nan - cwf%qflx_snofrz_lyr(beg:end,-nlevsno+1:0) = spval - cwf%qflx_snofrz_col(beg:end) = nan - cwf%qflx_irrig(beg:end) = nan - cwf%qflx_glcice(beg:end) = nan - cwf%qflx_glcice_frz(beg:end) = nan - cwf%qflx_glcice_melt(beg:end) = nan - cwf%glc_rofi(beg:end) = nan - cwf%glc_rofl(beg:end) = nan - cwf%qflx_floodc(beg:end) = spval - cwf%qflx_snow_melt(beg:end) = spval - - end subroutine init_column_wflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_cflux_type -! -! !INTERFACE: - subroutine init_column_cflux_type(beg, end, ccf) -! -! !DESCRIPTION: -! Initialize column carbon flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_cflux_type), intent(inout):: ccf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - allocate(ccf%m_leafc_to_litr1c(beg:end)) - allocate(ccf%m_leafc_to_litr2c(beg:end)) - allocate(ccf%m_leafc_to_litr3c(beg:end)) - allocate(ccf%m_frootc_to_litr1c(beg:end)) - allocate(ccf%m_frootc_to_litr2c(beg:end)) - allocate(ccf%m_frootc_to_litr3c(beg:end)) - allocate(ccf%m_leafc_storage_to_litr1c(beg:end)) - allocate(ccf%m_frootc_storage_to_litr1c(beg:end)) - allocate(ccf%m_livestemc_storage_to_litr1c(beg:end)) - allocate(ccf%m_deadstemc_storage_to_litr1c(beg:end)) - allocate(ccf%m_livecrootc_storage_to_litr1c(beg:end)) - allocate(ccf%m_deadcrootc_storage_to_litr1c(beg:end)) - allocate(ccf%m_leafc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_frootc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_livestemc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_deadstemc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_livecrootc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_deadcrootc_xfer_to_litr1c(beg:end)) - allocate(ccf%m_livestemc_to_cwdc(beg:end)) - allocate(ccf%m_deadstemc_to_cwdc(beg:end)) - allocate(ccf%m_livecrootc_to_cwdc(beg:end)) - allocate(ccf%m_deadcrootc_to_cwdc(beg:end)) - allocate(ccf%m_gresp_storage_to_litr1c(beg:end)) - allocate(ccf%m_gresp_xfer_to_litr1c(beg:end)) - allocate(ccf%m_deadstemc_to_cwdc_fire(beg:end)) - allocate(ccf%m_deadcrootc_to_cwdc_fire(beg:end)) - allocate(ccf%hrv_leafc_to_litr1c(beg:end)) - allocate(ccf%hrv_leafc_to_litr2c(beg:end)) - allocate(ccf%hrv_leafc_to_litr3c(beg:end)) - allocate(ccf%hrv_frootc_to_litr1c(beg:end)) - allocate(ccf%hrv_frootc_to_litr2c(beg:end)) - allocate(ccf%hrv_frootc_to_litr3c(beg:end)) - allocate(ccf%hrv_livestemc_to_cwdc(beg:end)) - allocate(ccf%hrv_deadstemc_to_prod10c(beg:end)) - allocate(ccf%hrv_deadstemc_to_prod100c(beg:end)) - allocate(ccf%hrv_livecrootc_to_cwdc(beg:end)) - allocate(ccf%hrv_deadcrootc_to_cwdc(beg:end)) - allocate(ccf%hrv_leafc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_frootc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_livestemc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_deadstemc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_livecrootc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_deadcrootc_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_gresp_storage_to_litr1c(beg:end)) - allocate(ccf%hrv_leafc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_frootc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_livestemc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_deadstemc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_livecrootc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_deadcrootc_xfer_to_litr1c(beg:end)) - allocate(ccf%hrv_gresp_xfer_to_litr1c(beg:end)) - allocate(ccf%m_litr1c_to_fire(beg:end)) - allocate(ccf%m_litr2c_to_fire(beg:end)) - allocate(ccf%m_litr3c_to_fire(beg:end)) - allocate(ccf%m_cwdc_to_fire(beg:end)) - if ( crop_prog )then - allocate(ccf%grainc_to_litr1c(beg:end)) - allocate(ccf%grainc_to_litr2c(beg:end)) - allocate(ccf%grainc_to_litr3c(beg:end)) - allocate(ccf%livestemc_to_litr1c(beg:end)) - allocate(ccf%livestemc_to_litr2c(beg:end)) - allocate(ccf%livestemc_to_litr3c(beg:end)) - end if - allocate(ccf%leafc_to_litr1c(beg:end)) - allocate(ccf%leafc_to_litr2c(beg:end)) - allocate(ccf%leafc_to_litr3c(beg:end)) - allocate(ccf%frootc_to_litr1c(beg:end)) - allocate(ccf%frootc_to_litr2c(beg:end)) - allocate(ccf%frootc_to_litr3c(beg:end)) - allocate(ccf%cwdc_to_litr2c(beg:end)) - allocate(ccf%cwdc_to_litr3c(beg:end)) - allocate(ccf%litr1_hr(beg:end)) - allocate(ccf%litr1c_to_soil1c(beg:end)) - allocate(ccf%litr2_hr(beg:end)) - allocate(ccf%litr2c_to_soil2c(beg:end)) - allocate(ccf%litr3_hr(beg:end)) - allocate(ccf%litr3c_to_soil3c(beg:end)) - allocate(ccf%soil1_hr(beg:end)) - allocate(ccf%soil1c_to_soil2c(beg:end)) - allocate(ccf%soil2_hr(beg:end)) - allocate(ccf%soil2c_to_soil3c(beg:end)) - allocate(ccf%soil3_hr(beg:end)) - allocate(ccf%soil3c_to_soil4c(beg:end)) - allocate(ccf%soil4_hr(beg:end)) - if (use_cn) then - allocate(ccf%dwt_seedc_to_leaf(beg:end)) - allocate(ccf%dwt_seedc_to_deadstem(beg:end)) - allocate(ccf%dwt_conv_cflux(beg:end)) - allocate(ccf%dwt_prod10c_gain(beg:end)) - allocate(ccf%dwt_prod100c_gain(beg:end)) - allocate(ccf%dwt_frootc_to_litr1c(beg:end)) - allocate(ccf%dwt_frootc_to_litr2c(beg:end)) - allocate(ccf%dwt_frootc_to_litr3c(beg:end)) - allocate(ccf%dwt_livecrootc_to_cwdc(beg:end)) - allocate(ccf%dwt_deadcrootc_to_cwdc(beg:end)) - allocate(ccf%dwt_closs(beg:end)) - allocate(ccf%landuseflux(beg:end)) - allocate(ccf%landuptake(beg:end)) - allocate(ccf%prod10c_loss(beg:end)) - allocate(ccf%prod100c_loss(beg:end)) - allocate(ccf%product_closs(beg:end)) - end if - allocate(ccf%lithr(beg:end)) - allocate(ccf%somhr(beg:end)) - allocate(ccf%hr(beg:end)) - allocate(ccf%sr(beg:end)) - allocate(ccf%er(beg:end)) - allocate(ccf%litfire(beg:end)) - allocate(ccf%somfire(beg:end)) - allocate(ccf%totfire(beg:end)) - allocate(ccf%nep(beg:end)) - allocate(ccf%nbp(beg:end)) - allocate(ccf%nee(beg:end)) - allocate(ccf%col_cinputs(beg:end)) - allocate(ccf%col_coutputs(beg:end)) - allocate(ccf%col_fire_closs(beg:end)) - - if (use_cn) then - allocate(ccf%cwdc_hr(beg:end)) - allocate(ccf%cwdc_loss(beg:end)) - allocate(ccf%litterc_loss(beg:end)) - end if - - ccf%m_leafc_to_litr1c(beg:end) = nan - ccf%m_leafc_to_litr2c(beg:end) = nan - ccf%m_leafc_to_litr3c(beg:end) = nan - ccf%m_frootc_to_litr1c(beg:end) = nan - ccf%m_frootc_to_litr2c(beg:end) = nan - ccf%m_frootc_to_litr3c(beg:end) = nan - ccf%m_leafc_storage_to_litr1c(beg:end) = nan - ccf%m_frootc_storage_to_litr1c(beg:end) = nan - ccf%m_livestemc_storage_to_litr1c(beg:end) = nan - ccf%m_deadstemc_storage_to_litr1c(beg:end) = nan - ccf%m_livecrootc_storage_to_litr1c(beg:end) = nan - ccf%m_deadcrootc_storage_to_litr1c(beg:end) = nan - ccf%m_leafc_xfer_to_litr1c(beg:end) = nan - ccf%m_frootc_xfer_to_litr1c(beg:end) = nan - ccf%m_livestemc_xfer_to_litr1c(beg:end) = nan - ccf%m_deadstemc_xfer_to_litr1c(beg:end) = nan - ccf%m_livecrootc_xfer_to_litr1c(beg:end) = nan - ccf%m_deadcrootc_xfer_to_litr1c(beg:end) = nan - ccf%m_livestemc_to_cwdc(beg:end) = nan - ccf%m_deadstemc_to_cwdc(beg:end) = nan - ccf%m_livecrootc_to_cwdc(beg:end) = nan - ccf%m_deadcrootc_to_cwdc(beg:end) = nan - ccf%m_gresp_storage_to_litr1c(beg:end) = nan - ccf%m_gresp_xfer_to_litr1c(beg:end) = nan - ccf%m_deadstemc_to_cwdc_fire(beg:end) = nan - ccf%m_deadcrootc_to_cwdc_fire(beg:end) = nan - ccf%hrv_leafc_to_litr1c(beg:end) = nan - ccf%hrv_leafc_to_litr2c(beg:end) = nan - ccf%hrv_leafc_to_litr3c(beg:end) = nan - ccf%hrv_frootc_to_litr1c(beg:end) = nan - ccf%hrv_frootc_to_litr2c(beg:end) = nan - ccf%hrv_frootc_to_litr3c(beg:end) = nan - ccf%hrv_livestemc_to_cwdc(beg:end) = nan - ccf%hrv_deadstemc_to_prod10c(beg:end) = nan - ccf%hrv_deadstemc_to_prod100c(beg:end) = nan - ccf%hrv_livecrootc_to_cwdc(beg:end) = nan - ccf%hrv_deadcrootc_to_cwdc(beg:end) = nan - ccf%hrv_leafc_storage_to_litr1c(beg:end) = nan - ccf%hrv_frootc_storage_to_litr1c(beg:end) = nan - ccf%hrv_livestemc_storage_to_litr1c(beg:end) = nan - ccf%hrv_deadstemc_storage_to_litr1c(beg:end) = nan - ccf%hrv_livecrootc_storage_to_litr1c(beg:end) = nan - ccf%hrv_deadcrootc_storage_to_litr1c(beg:end) = nan - if ( crop_prog )then - ccf%grainc_to_litr1c(beg:end) = nan - ccf%grainc_to_litr2c(beg:end) = nan - ccf%grainc_to_litr3c(beg:end) = nan - ccf%livestemc_to_litr1c(beg:end) = nan - ccf%livestemc_to_litr2c(beg:end) = nan - ccf%livestemc_to_litr3c(beg:end) = nan - end if - ccf%hrv_gresp_storage_to_litr1c(beg:end) = nan - ccf%hrv_leafc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_frootc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_livestemc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_deadstemc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_livecrootc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_deadcrootc_xfer_to_litr1c(beg:end) = nan - ccf%hrv_gresp_xfer_to_litr1c(beg:end) = nan - ccf%m_litr1c_to_fire(beg:end) = nan - ccf%m_litr2c_to_fire(beg:end) = nan - ccf%m_litr3c_to_fire(beg:end) = nan - ccf%m_cwdc_to_fire(beg:end) = nan - ccf%leafc_to_litr1c(beg:end) = nan - ccf%leafc_to_litr2c(beg:end) = nan - ccf%leafc_to_litr3c(beg:end) = nan - ccf%frootc_to_litr1c(beg:end) = nan - ccf%frootc_to_litr2c(beg:end) = nan - ccf%frootc_to_litr3c(beg:end) = nan - ccf%cwdc_to_litr2c(beg:end) = nan - ccf%cwdc_to_litr3c(beg:end) = nan - ccf%litr1_hr(beg:end) = nan - ccf%litr1c_to_soil1c(beg:end) = nan - ccf%litr2_hr(beg:end) = nan - ccf%litr2c_to_soil2c(beg:end) = nan - ccf%litr3_hr(beg:end) = nan - ccf%litr3c_to_soil3c(beg:end) = nan - ccf%soil1_hr(beg:end) = nan - ccf%soil1c_to_soil2c(beg:end) = nan - ccf%soil2_hr(beg:end) = nan - ccf%soil2c_to_soil3c(beg:end) = nan - ccf%soil3_hr(beg:end) = nan - ccf%soil3c_to_soil4c(beg:end) = nan - ccf%soil4_hr(beg:end) = nan - if (use_cn) then - ccf%dwt_seedc_to_leaf(beg:end) = nan - ccf%dwt_seedc_to_deadstem(beg:end) = nan - ccf%dwt_conv_cflux(beg:end) = nan - ccf%dwt_prod10c_gain(beg:end) = nan - ccf%dwt_prod100c_gain(beg:end) = nan - ccf%dwt_frootc_to_litr1c(beg:end) = nan - ccf%dwt_frootc_to_litr2c(beg:end) = nan - ccf%dwt_frootc_to_litr3c(beg:end) = nan - ccf%dwt_livecrootc_to_cwdc(beg:end) = nan - ccf%dwt_deadcrootc_to_cwdc(beg:end) = nan - ccf%dwt_closs(beg:end) = nan - ccf%landuseflux(beg:end) = nan - ccf%landuptake(beg:end) = nan - ccf%prod10c_loss(beg:end) = nan - ccf%prod100c_loss(beg:end) = nan - ccf%product_closs(beg:end) = nan - end if - ccf%lithr(beg:end) = nan - ccf%somhr(beg:end) = nan - ccf%hr(beg:end) = nan - ccf%sr(beg:end) = nan - ccf%er(beg:end) = nan - ccf%litfire(beg:end) = nan - ccf%somfire(beg:end) = nan - ccf%totfire(beg:end) = nan - ccf%nep(beg:end) = nan - ccf%nbp(beg:end) = nan - ccf%nee(beg:end) = nan - ccf%col_cinputs(beg:end) = nan - ccf%col_coutputs(beg:end) = nan - ccf%col_fire_closs(beg:end) = nan - - if (use_cn) then - ccf%cwdc_hr(beg:end) = nan - ccf%cwdc_loss(beg:end) = nan - ccf%litterc_loss(beg:end) = nan - end if - - end subroutine init_column_cflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_column_nflux_type -! -! !INTERFACE: - subroutine init_column_nflux_type(beg, end, cnf) -! -! !DESCRIPTION: -! Initialize column nitrogen flux variables -! -! !USES: - use surfrdMod , only : crop_prog -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (column_nflux_type), intent(inout):: cnf -! -! !REVISION HISTORY: -! Created by Peter Thornton -! -!EOP -!------------------------------------------------------------------------ - - allocate(cnf%ndep_to_sminn(beg:end)) - allocate(cnf%nfix_to_sminn(beg:end)) - allocate(cnf%m_leafn_to_litr1n(beg:end)) - allocate(cnf%m_leafn_to_litr2n(beg:end)) - allocate(cnf%m_leafn_to_litr3n(beg:end)) - allocate(cnf%m_frootn_to_litr1n(beg:end)) - allocate(cnf%m_frootn_to_litr2n(beg:end)) - allocate(cnf%m_frootn_to_litr3n(beg:end)) - allocate(cnf%m_leafn_storage_to_litr1n(beg:end)) - allocate(cnf%m_frootn_storage_to_litr1n(beg:end)) - allocate(cnf%m_livestemn_storage_to_litr1n(beg:end)) - allocate(cnf%m_deadstemn_storage_to_litr1n(beg:end)) - allocate(cnf%m_livecrootn_storage_to_litr1n(beg:end)) - allocate(cnf%m_deadcrootn_storage_to_litr1n(beg:end)) - allocate(cnf%m_leafn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_frootn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_livestemn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_deadstemn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_livecrootn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_deadcrootn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_livestemn_to_cwdn(beg:end)) - allocate(cnf%m_deadstemn_to_cwdn(beg:end)) - allocate(cnf%m_livecrootn_to_cwdn(beg:end)) - allocate(cnf%m_deadcrootn_to_cwdn(beg:end)) - allocate(cnf%m_retransn_to_litr1n(beg:end)) - allocate(cnf%hrv_leafn_to_litr1n(beg:end)) - allocate(cnf%hrv_leafn_to_litr2n(beg:end)) - allocate(cnf%hrv_leafn_to_litr3n(beg:end)) - allocate(cnf%hrv_frootn_to_litr1n(beg:end)) - allocate(cnf%hrv_frootn_to_litr2n(beg:end)) - allocate(cnf%hrv_frootn_to_litr3n(beg:end)) - allocate(cnf%hrv_livestemn_to_cwdn(beg:end)) - allocate(cnf%hrv_deadstemn_to_prod10n(beg:end)) - allocate(cnf%hrv_deadstemn_to_prod100n(beg:end)) - allocate(cnf%hrv_livecrootn_to_cwdn(beg:end)) - allocate(cnf%hrv_deadcrootn_to_cwdn(beg:end)) - allocate(cnf%hrv_retransn_to_litr1n(beg:end)) - allocate(cnf%hrv_leafn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_frootn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_livestemn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_deadstemn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_livecrootn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_deadcrootn_storage_to_litr1n(beg:end)) - allocate(cnf%hrv_leafn_xfer_to_litr1n(beg:end)) - allocate(cnf%hrv_frootn_xfer_to_litr1n(beg:end)) - allocate(cnf%hrv_livestemn_xfer_to_litr1n(beg:end)) - allocate(cnf%hrv_deadstemn_xfer_to_litr1n(beg:end)) - allocate(cnf%hrv_livecrootn_xfer_to_litr1n(beg:end)) - allocate(cnf%hrv_deadcrootn_xfer_to_litr1n(beg:end)) - allocate(cnf%m_deadstemn_to_cwdn_fire(beg:end)) - allocate(cnf%m_deadcrootn_to_cwdn_fire(beg:end)) - allocate(cnf%m_litr1n_to_fire(beg:end)) - allocate(cnf%m_litr2n_to_fire(beg:end)) - allocate(cnf%m_litr3n_to_fire(beg:end)) - allocate(cnf%m_cwdn_to_fire(beg:end)) - if ( crop_prog )then - allocate(cnf%grainn_to_litr1n(beg:end)) - allocate(cnf%grainn_to_litr2n(beg:end)) - allocate(cnf%grainn_to_litr3n(beg:end)) - allocate(cnf%livestemn_to_litr1n(beg:end)) - allocate(cnf%livestemn_to_litr2n(beg:end)) - allocate(cnf%livestemn_to_litr3n(beg:end)) - end if - allocate(cnf%leafn_to_litr1n(beg:end)) - allocate(cnf%leafn_to_litr2n(beg:end)) - allocate(cnf%leafn_to_litr3n(beg:end)) - allocate(cnf%frootn_to_litr1n(beg:end)) - allocate(cnf%frootn_to_litr2n(beg:end)) - allocate(cnf%frootn_to_litr3n(beg:end)) - allocate(cnf%cwdn_to_litr2n(beg:end)) - allocate(cnf%cwdn_to_litr3n(beg:end)) - allocate(cnf%litr1n_to_soil1n(beg:end)) - allocate(cnf%sminn_to_soil1n_l1(beg:end)) - allocate(cnf%litr2n_to_soil2n(beg:end)) - allocate(cnf%sminn_to_soil2n_l2(beg:end)) - allocate(cnf%litr3n_to_soil3n(beg:end)) - allocate(cnf%sminn_to_soil3n_l3(beg:end)) - allocate(cnf%soil1n_to_soil2n(beg:end)) - allocate(cnf%sminn_to_soil2n_s1(beg:end)) - allocate(cnf%soil2n_to_soil3n(beg:end)) - allocate(cnf%sminn_to_soil3n_s2(beg:end)) - allocate(cnf%soil3n_to_soil4n(beg:end)) - allocate(cnf%sminn_to_soil4n_s3(beg:end)) - allocate(cnf%soil4n_to_sminn(beg:end)) - allocate(cnf%sminn_to_denit_l1s1(beg:end)) - allocate(cnf%sminn_to_denit_l2s2(beg:end)) - allocate(cnf%sminn_to_denit_l3s3(beg:end)) - allocate(cnf%sminn_to_denit_s1s2(beg:end)) - allocate(cnf%sminn_to_denit_s2s3(beg:end)) - allocate(cnf%sminn_to_denit_s3s4(beg:end)) - allocate(cnf%sminn_to_denit_s4(beg:end)) - allocate(cnf%sminn_to_denit_excess(beg:end)) - allocate(cnf%sminn_leached(beg:end)) - allocate(cnf%dwt_seedn_to_leaf(beg:end)) - allocate(cnf%dwt_seedn_to_deadstem(beg:end)) - allocate(cnf%dwt_conv_nflux(beg:end)) - allocate(cnf%dwt_prod10n_gain(beg:end)) - allocate(cnf%dwt_prod100n_gain(beg:end)) - allocate(cnf%dwt_frootn_to_litr1n(beg:end)) - allocate(cnf%dwt_frootn_to_litr2n(beg:end)) - allocate(cnf%dwt_frootn_to_litr3n(beg:end)) - allocate(cnf%dwt_livecrootn_to_cwdn(beg:end)) - allocate(cnf%dwt_deadcrootn_to_cwdn(beg:end)) - allocate(cnf%dwt_nloss(beg:end)) - allocate(cnf%prod10n_loss(beg:end)) - allocate(cnf%prod100n_loss(beg:end)) - allocate(cnf%product_nloss(beg:end)) - allocate(cnf%potential_immob(beg:end)) - allocate(cnf%actual_immob(beg:end)) - allocate(cnf%sminn_to_plant(beg:end)) - allocate(cnf%supplement_to_sminn(beg:end)) - allocate(cnf%gross_nmin(beg:end)) - allocate(cnf%net_nmin(beg:end)) - allocate(cnf%denit(beg:end)) - allocate(cnf%col_ninputs(beg:end)) - allocate(cnf%col_noutputs(beg:end)) - allocate(cnf%col_fire_nloss(beg:end)) - - cnf%ndep_to_sminn(beg:end) = nan - cnf%nfix_to_sminn(beg:end) = nan - cnf%m_leafn_to_litr1n(beg:end) = nan - cnf%m_leafn_to_litr2n(beg:end) = nan - cnf%m_leafn_to_litr3n(beg:end) = nan - cnf%m_frootn_to_litr1n(beg:end) = nan - cnf%m_frootn_to_litr2n(beg:end) = nan - cnf%m_frootn_to_litr3n(beg:end) = nan - cnf%m_leafn_storage_to_litr1n(beg:end) = nan - cnf%m_frootn_storage_to_litr1n(beg:end) = nan - cnf%m_livestemn_storage_to_litr1n(beg:end) = nan - cnf%m_deadstemn_storage_to_litr1n(beg:end) = nan - cnf%m_livecrootn_storage_to_litr1n(beg:end) = nan - cnf%m_deadcrootn_storage_to_litr1n(beg:end) = nan - cnf%m_leafn_xfer_to_litr1n(beg:end) = nan - cnf%m_frootn_xfer_to_litr1n(beg:end) = nan - cnf%m_livestemn_xfer_to_litr1n(beg:end) = nan - cnf%m_deadstemn_xfer_to_litr1n(beg:end) = nan - cnf%m_livecrootn_xfer_to_litr1n(beg:end) = nan - cnf%m_deadcrootn_xfer_to_litr1n(beg:end) = nan - cnf%m_livestemn_to_cwdn(beg:end) = nan - cnf%m_deadstemn_to_cwdn(beg:end) = nan - cnf%m_livecrootn_to_cwdn(beg:end) = nan - cnf%m_deadcrootn_to_cwdn(beg:end) = nan - cnf%m_retransn_to_litr1n(beg:end) = nan - cnf%hrv_leafn_to_litr1n(beg:end) = nan - cnf%hrv_leafn_to_litr2n(beg:end) = nan - cnf%hrv_leafn_to_litr3n(beg:end) = nan - cnf%hrv_frootn_to_litr1n(beg:end) = nan - cnf%hrv_frootn_to_litr2n(beg:end) = nan - cnf%hrv_frootn_to_litr3n(beg:end) = nan - cnf%hrv_livestemn_to_cwdn(beg:end) = nan - cnf%hrv_deadstemn_to_prod10n(beg:end) = nan - cnf%hrv_deadstemn_to_prod100n(beg:end) = nan - cnf%hrv_livecrootn_to_cwdn(beg:end) = nan - cnf%hrv_deadcrootn_to_cwdn(beg:end) = nan - cnf%hrv_retransn_to_litr1n(beg:end) = nan - cnf%hrv_leafn_storage_to_litr1n(beg:end) = nan - cnf%hrv_frootn_storage_to_litr1n(beg:end) = nan - cnf%hrv_livestemn_storage_to_litr1n(beg:end) = nan - cnf%hrv_deadstemn_storage_to_litr1n(beg:end) = nan - cnf%hrv_livecrootn_storage_to_litr1n(beg:end) = nan - cnf%hrv_deadcrootn_storage_to_litr1n(beg:end) = nan - cnf%hrv_leafn_xfer_to_litr1n(beg:end) = nan - cnf%hrv_frootn_xfer_to_litr1n(beg:end) = nan - cnf%hrv_livestemn_xfer_to_litr1n(beg:end) = nan - cnf%hrv_deadstemn_xfer_to_litr1n(beg:end) = nan - cnf%hrv_livecrootn_xfer_to_litr1n(beg:end) = nan - cnf%hrv_deadcrootn_xfer_to_litr1n(beg:end) = nan - cnf%m_deadstemn_to_cwdn_fire(beg:end) = nan - cnf%m_deadcrootn_to_cwdn_fire(beg:end) = nan - cnf%m_litr1n_to_fire(beg:end) = nan - cnf%m_litr2n_to_fire(beg:end) = nan - cnf%m_litr3n_to_fire(beg:end) = nan - cnf%m_cwdn_to_fire(beg:end) = nan - if ( crop_prog )then - cnf%grainn_to_litr1n(beg:end) = nan - cnf%grainn_to_litr2n(beg:end) = nan - cnf%grainn_to_litr3n(beg:end) = nan - cnf%livestemn_to_litr1n(beg:end) = nan - cnf%livestemn_to_litr2n(beg:end) = nan - cnf%livestemn_to_litr3n(beg:end) = nan - end if - cnf%leafn_to_litr1n(beg:end) = nan - cnf%leafn_to_litr2n(beg:end) = nan - cnf%leafn_to_litr3n(beg:end) = nan - cnf%frootn_to_litr1n(beg:end) = nan - cnf%frootn_to_litr2n(beg:end) = nan - cnf%frootn_to_litr3n(beg:end) = nan - cnf%cwdn_to_litr2n(beg:end) = nan - cnf%cwdn_to_litr3n(beg:end) = nan - cnf%litr1n_to_soil1n(beg:end) = nan - cnf%sminn_to_soil1n_l1(beg:end) = nan - cnf%litr2n_to_soil2n(beg:end) = nan - cnf%sminn_to_soil2n_l2(beg:end) = nan - cnf%litr3n_to_soil3n(beg:end) = nan - cnf%sminn_to_soil3n_l3(beg:end) = nan - cnf%soil1n_to_soil2n(beg:end) = nan - cnf%sminn_to_soil2n_s1(beg:end) = nan - cnf%soil2n_to_soil3n(beg:end) = nan - cnf%sminn_to_soil3n_s2(beg:end) = nan - cnf%soil3n_to_soil4n(beg:end) = nan - cnf%sminn_to_soil4n_s3(beg:end) = nan - cnf%soil4n_to_sminn(beg:end) = nan - cnf%sminn_to_denit_l1s1(beg:end) = nan - cnf%sminn_to_denit_l2s2(beg:end) = nan - cnf%sminn_to_denit_l3s3(beg:end) = nan - cnf%sminn_to_denit_s1s2(beg:end) = nan - cnf%sminn_to_denit_s2s3(beg:end) = nan - cnf%sminn_to_denit_s3s4(beg:end) = nan - cnf%sminn_to_denit_s4(beg:end) = nan - cnf%sminn_to_denit_excess(beg:end) = nan - cnf%sminn_leached(beg:end) = nan - cnf%dwt_seedn_to_leaf(beg:end) = nan - cnf%dwt_seedn_to_deadstem(beg:end) = nan - cnf%dwt_conv_nflux(beg:end) = nan - cnf%dwt_prod10n_gain(beg:end) = nan - cnf%dwt_prod100n_gain(beg:end) = nan - cnf%dwt_frootn_to_litr1n(beg:end) = nan - cnf%dwt_frootn_to_litr2n(beg:end) = nan - cnf%dwt_frootn_to_litr3n(beg:end) = nan - cnf%dwt_livecrootn_to_cwdn(beg:end) = nan - cnf%dwt_deadcrootn_to_cwdn(beg:end) = nan - cnf%dwt_nloss(beg:end) = nan - cnf%prod10n_loss(beg:end) = nan - cnf%prod100n_loss(beg:end) = nan - cnf%product_nloss(beg:end) = nan - cnf%potential_immob(beg:end) = nan - cnf%actual_immob(beg:end) = nan - cnf%sminn_to_plant(beg:end) = nan - cnf%supplement_to_sminn(beg:end) = nan - cnf%gross_nmin(beg:end) = nan - cnf%net_nmin(beg:end) = nan - cnf%denit(beg:end) = nan - cnf%col_ninputs(beg:end) = nan - cnf%col_noutputs(beg:end) = nan - cnf%col_fire_nloss(beg:end) = nan - - end subroutine init_column_nflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_landunit_pstate_type -! -! !INTERFACE: - subroutine init_landunit_pstate_type(beg, end, lps) -! -! !DESCRIPTION: -! Initialize landunit physical state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (landunit_pstate_type), intent(inout):: lps -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(lps%t_building(beg:end)) - allocate(lps%t_building_max(beg:end)) - allocate(lps%t_building_min(beg:end)) - allocate(lps%tk_wall(beg:end,nlevurb)) - allocate(lps%tk_roof(beg:end,nlevurb)) - allocate(lps%tk_improad(beg:end,nlevgrnd)) - allocate(lps%cv_wall(beg:end,nlevurb)) - allocate(lps%cv_roof(beg:end,nlevurb)) - allocate(lps%cv_improad(beg:end,nlevgrnd)) - allocate(lps%thick_wall(beg:end)) - allocate(lps%thick_roof(beg:end)) - allocate(lps%nlev_improad(beg:end)) - allocate(lps%vf_sr(beg:end)) - allocate(lps%vf_wr(beg:end)) - allocate(lps%vf_sw(beg:end)) - allocate(lps%vf_rw(beg:end)) - allocate(lps%vf_ww(beg:end)) - allocate(lps%taf(beg:end)) - allocate(lps%qaf(beg:end)) - allocate(lps%sabs_roof_dir(beg:end,1:numrad)) - allocate(lps%sabs_roof_dif(beg:end,1:numrad)) - allocate(lps%sabs_sunwall_dir(beg:end,1:numrad)) - allocate(lps%sabs_sunwall_dif(beg:end,1:numrad)) - allocate(lps%sabs_shadewall_dir(beg:end,1:numrad)) - allocate(lps%sabs_shadewall_dif(beg:end,1:numrad)) - allocate(lps%sabs_improad_dir(beg:end,1:numrad)) - allocate(lps%sabs_improad_dif(beg:end,1:numrad)) - allocate(lps%sabs_perroad_dir(beg:end,1:numrad)) - allocate(lps%sabs_perroad_dif(beg:end,1:numrad)) - - lps%t_building(beg:end) = nan - lps%t_building_max(beg:end) = nan - lps%t_building_min(beg:end) = nan - lps%tk_wall(beg:end,1:nlevurb) = nan - lps%tk_roof(beg:end,1:nlevurb) = nan - lps%tk_improad(beg:end,1:nlevgrnd) = nan - lps%cv_wall(beg:end,1:nlevurb) = nan - lps%cv_roof(beg:end,1:nlevurb) = nan - lps%cv_improad(beg:end,1:nlevgrnd) = nan - lps%cv_improad(beg:end,1:5) = nan - lps%thick_wall(beg:end) = nan - lps%thick_roof(beg:end) = nan - lps%nlev_improad(beg:end) = huge(1) - lps%vf_sr(beg:end) = nan - lps%vf_wr(beg:end) = nan - lps%vf_sw(beg:end) = nan - lps%vf_rw(beg:end) = nan - lps%vf_ww(beg:end) = nan - lps%taf(beg:end) = nan - lps%qaf(beg:end) = nan - lps%sabs_roof_dir(beg:end,1:numrad) = nan - lps%sabs_roof_dif(beg:end,1:numrad) = nan - lps%sabs_sunwall_dir(beg:end,1:numrad) = nan - lps%sabs_sunwall_dif(beg:end,1:numrad) = nan - lps%sabs_shadewall_dir(beg:end,1:numrad) = nan - lps%sabs_shadewall_dif(beg:end,1:numrad) = nan - lps%sabs_improad_dir(beg:end,1:numrad) = nan - lps%sabs_improad_dif(beg:end,1:numrad) = nan - lps%sabs_perroad_dir(beg:end,1:numrad) = nan - lps%sabs_perroad_dif(beg:end,1:numrad) = nan - - end subroutine init_landunit_pstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_landunit_eflux_type -! -! !INTERFACE: - subroutine init_landunit_eflux_type(beg, end, lef) -! -! !DESCRIPTION: -! Initialize landunit energy flux variables -! -! !USES: - use clm_varcon, only : spval -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (landunit_eflux_type), intent(inout):: lef -! -! !REVISION HISTORY: -! Created by Keith Oleson -! -!EOP -!------------------------------------------------------------------------ - - allocate(lef%eflx_traffic(beg:end)) - allocate(lef%eflx_traffic_factor(beg:end)) - allocate(lef%eflx_wasteheat(beg:end)) - allocate(lef%eflx_heat_from_ac(beg:end)) - - lef%eflx_traffic(beg:end) = spval - lef%eflx_traffic_factor(beg:end) = nan - lef%eflx_wasteheat(beg:end) = spval - lef%eflx_heat_from_ac(beg:end) = spval - - end subroutine init_landunit_eflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_dgvstate_type -! -! !INTERFACE: - subroutine init_gridcell_dgvstate_type(beg, end, gps) -! -! !DESCRIPTION: -! Initialize gridcell DGVM variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_dgvstate_type), intent(inout):: gps -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(gps%agdd20(beg:end)) - allocate(gps%tmomin20(beg:end)) - allocate(gps%t10min(beg:end)) - - gps%agdd20(beg:end) = nan - gps%tmomin20(beg:end) = nan - gps%t10min(beg:end) = nan - - end subroutine init_gridcell_dgvstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_pstate_type -! -! !INTERFACE: - subroutine init_gridcell_pstate_type(beg, end, gps) -! -! !DESCRIPTION: -! Initialize gridcell physical state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_pstate_type), intent(inout):: gps -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - - !allocate(gps%bcphiwet2t(beg:end,1:2)) - !allocate(gps%bcphidry2t(beg:end,1:2)) - !allocate(gps%bcphodry2t(beg:end,1:2)) - !allocate(gps%ocphiwet2t(beg:end,1:2)) - !allocate(gps%ocphidry2t(beg:end,1:2)) - !allocate(gps%ocphodry2t(beg:end,1:2)) - !allocate(gps%dstx01wd2t(beg:end,1:2)) - !allocate(gps%dstx01dd2t(beg:end,1:2)) - !allocate(gps%dstx02wd2t(beg:end,1:2)) - !allocate(gps%dstx02dd2t(beg:end,1:2)) - !allocate(gps%dstx03wd2t(beg:end,1:2)) - !allocate(gps%dstx03dd2t(beg:end,1:2)) - !allocate(gps%dstx04wd2t(beg:end,1:2)) - !allocate(gps%dstx04dd2t(beg:end,1:2)) - - !gps%bcphiwet2t(beg:end,1:2) = nan - !gps%bcphidry2t(beg:end,1:2) = nan - !gps%bcphodry2t(beg:end,1:2) = nan - !gps%ocphiwet2t(beg:end,1:2) = nan - !gps%ocphidry2t(beg:end,1:2) = nan - !gps%ocphodry2t(beg:end,1:2) = nan - !gps%dstx01wd2t(beg:end,1:2) = nan - !gps%dstx01dd2t(beg:end,1:2) = nan - !gps%dstx02wd2t(beg:end,1:2) = nan - !gps%dstx02dd2t(beg:end,1:2) = nan - !gps%dstx03wd2t(beg:end,1:2) = nan - !gps%dstx03dd2t(beg:end,1:2) = nan - !gps%dstx04wd2t(beg:end,1:2) = nan - !gps%dstx04dd2t(beg:end,1:2) = nan - - end subroutine init_gridcell_pstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_efstate_type -! -! !INTERFACE: - subroutine init_gridcell_efstate_type(beg, end, gve) -! -! !DESCRIPTION: -! Initialize gridcell isoprene emission factor variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_efstate_type), intent(inout) :: gve -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein (heald) -! -!EOP -!------------------------------------------------------------------------ - - allocate(gve%efisop(6,beg:end)) - gve%efisop(:,beg:end) = nan - - end subroutine init_gridcell_efstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_wflux_type -! -! !INTERFACE: - subroutine init_gridcell_wflux_type(beg, end, gwf) -! -! !DESCRIPTION: -! Initialize gridcell water flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_wflux_type), intent(inout):: gwf -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP -!------------------------------------------------------------------------ - - allocate(gwf%qflx_runoffg(beg:end)) - allocate(gwf%qflx_snwcp_iceg(beg:end)) - allocate(gwf%qflx_liq_dynbal(beg:end)) - allocate(gwf%qflx_ice_dynbal(beg:end)) - allocate(gwf%qflx_floodg(beg:end)) - - gwf%qflx_runoffg(beg:end) = 0._r8 - gwf%qflx_snwcp_iceg(beg:end) = 0._r8 - gwf%qflx_liq_dynbal(beg:end) = nan - gwf%qflx_ice_dynbal(beg:end) = nan - gwf%qflx_floodg(beg:end) = 0._r8 !rtm_flood: initialize to zero for 1st time step instead of nan - - end subroutine init_gridcell_wflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_eflux_type -! -! !INTERFACE: - subroutine init_gridcell_eflux_type(beg, end, gef) -! -! !DESCRIPTION: -! Initialize gridcell energy flux variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_eflux_type), intent(inout):: gef -! -! !REVISION HISTORY: -! Created by David Lawrence -! -!EOP -!------------------------------------------------------------------------ - allocate(gef%eflx_sh_totg(beg:end)) - allocate(gef%eflx_dynbal(beg:end)) - - gef%eflx_sh_totg(beg:end) = nan - gef%eflx_dynbal(beg:end) = nan - - end subroutine init_gridcell_eflux_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_wstate_type -! -! !INTERFACE: - subroutine init_gridcell_wstate_type(beg, end, gws) -! -! !DESCRIPTION: -! Initialize gridcell water state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_wstate_type), intent(inout):: gws -! -! !REVISION HISTORY: -! Created by David Lawrence -! -!EOP -!------------------------------------------------------------------------ - allocate(gws%gc_liq1(beg:end)) - allocate(gws%gc_liq2(beg:end)) - allocate(gws%gc_ice1(beg:end)) - allocate(gws%gc_ice2(beg:end)) - - gws%gc_liq1(beg:end) = nan - gws%gc_liq2(beg:end) = nan - gws%gc_ice1(beg:end) = nan - gws%gc_ice2(beg:end) = nan - - end subroutine init_gridcell_wstate_type - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: init_gridcell_estate_type -! -! !INTERFACE: - subroutine init_gridcell_estate_type(beg, end, ges) -! -! !DESCRIPTION: -! Initialize gridcell energy state variables -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: beg, end - type (gridcell_estate_type), intent(inout):: ges -! -! !REVISION HISTORY: -! Created by David Lawrence -! -!EOP -!------------------------------------------------------------------------ - allocate(ges%gc_heat1(beg:end)) - allocate(ges%gc_heat2(beg:end)) - - ges%gc_heat1(beg:end) = nan - ges%gc_heat2(beg:end) = nan - - end subroutine init_gridcell_estate_type - -end module clmtypeInitMod diff --git a/src_clm40/main/controlMod.F90 b/src_clm40/main/controlMod.F90 deleted file mode 100644 index 164939da95..0000000000 --- a/src_clm40/main/controlMod.F90 +++ /dev/null @@ -1,556 +0,0 @@ -module controlMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: controlMod -! -! !DESCRIPTION: -! Module which initializes run control variables. The following possible -! namelist variables are set default values and possibly read in on startup -! -! Note: For definitions of namelist variables see -! ../../bld/namelist_files/namelist_definition.xml -! Display the file in a browser to see it neatly formatted in html. -! - -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, SHR_KIND_CL - use clm_varpar , only : maxpatch_pft, maxpatch_glcmec - use clm_varctl , only : caseid, ctitle, nsrest, brnch_retain_casename, hostname, & - model_version=>version, & - iulog, finidat, fsurdat, fatmlndfrc, & - fatmtopo, flndtopo, flanduse_timeseries, fpftcon, nrevsn, & - create_crop_landunit, allocate_all_vegpfts, & - co2_type, wrtdia, co2_ppmv, nsegspc, & - username, fsnowaging, fsnowoptics, fglcmask, & - create_glacier_mec_landunit, glc_dyntopo, & - use_c13, use_c14, use_cn, use_cndv, use_crop - use spmdMod , only : masterproc - use decompMod , only : clump_pproc - use histFileMod , only : max_tapes, max_namlen, & - hist_empty_htapes, hist_dov2xy, & - hist_avgflag_pertape, hist_type1d_pertape, & - hist_nhtfrq, hist_ndens, hist_mfilt, & - hist_fincl1, hist_fincl2, hist_fincl3, & - hist_fincl4, hist_fincl5, hist_fincl6, & - hist_fexcl1, hist_fexcl2, hist_fexcl3, & - hist_fexcl4, hist_fexcl5, hist_fexcl6 - use shr_const_mod, only : SHR_CONST_CDAY - use abortutils , only : endrun - use UrbanMod , only : urban_hac, urban_traffic - use SurfaceAlbedoMod, only : albice - use CNAllocationMod , only : suplnitro - -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: control_setNL ! Set namelist filename - public :: control_init ! initial run control information - public :: control_print ! print run control information -! -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE TYPES: -! Namelist variables only used locally - character(len= 7) :: runtyp(4) ! run type - character(len=SHR_KIND_CL) :: NLFilename = 'lnd.stdin' ! Namelist filename -#if (defined _OPENMP) - integer, external :: omp_get_max_threads ! max number of threads that can execute - ! concurrently in a single parallel region -#endif -!EOP -!----------------------------------------------------------------------- - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: control_setNL -! -! !INTERFACE: - subroutine control_setNL( NLfile ) - - implicit none -! -! !DESCRIPTION: -! Set the namelist filename to use -! -! -! !ARGUMENTS: - character(len=*), intent(IN) :: NLFile ! Namelist filename -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -! -! !LOCAL VARIABLES: -!EOP - character(len=32) :: subname = 'control_setNL' ! subroutine name - logical :: lexist ! File exists - - ! Error checking... - if ( len_trim(NLFile) == 0 )then - call endrun( subname//' error: nlfilename entered is not set' ) - end if - inquire (file = trim(NLFile), exist = lexist) - if ( .not. lexist )then - call endrun( subname//' error: NLfilename entered does NOT exist:'//trim(NLFile) ) - end if - if ( len_trim(NLFile) > len(NLFilename) )then - call endrun( subname//' error: entered NLFile is too long' ) - end if - ! Set the filename - NLFilename = NLFile - end subroutine control_setNL - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: control_init -! -! !INTERFACE: - subroutine control_init( ) -! -! !DESCRIPTION: -! Initialize CLM run control information -! -! !USES: - use clm_time_manager , only : set_timemgr_init, get_timemgr_defaults - use fileutils , only : getavu, relavu - use shr_string_mod , only : shr_string_getParentDir - use clm_varctl , only : clmvarctl_init, clm_varctl_set, nsrBranch, nsrStartup, & - nsrContinue - use clm_cpl_indices , only : glc_nec - - implicit none -! -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=32) :: starttype ! infodata start type - integer :: i,j,n ! loop indices - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - integer :: dtime ! Integer time-step - integer :: override_nsrest ! If want to override the startup type sent from driver - character(len=32) :: subname = 'control_init' ! subroutine name -!------------------------------------------------------------------------ - - ! ---------------------------------------------------------------------- - ! Namelist Variables - ! ---------------------------------------------------------------------- - - ! Time step - namelist / clm_inparm/ & - dtime - - ! CLM namelist settings - - namelist /clm_inparm / & - fatmlndfrc, finidat, nrevsn - - ! Input datasets - - namelist /clm_inparm/ & - fsurdat, fatmtopo, flndtopo, & - fpftcon, flanduse_timeseries, fsnowoptics, fsnowaging - - ! History, restart options - - namelist /clm_inparm/ & - hist_empty_htapes, hist_dov2xy, & - hist_avgflag_pertape, hist_type1d_pertape, & - hist_nhtfrq, hist_ndens, hist_mfilt, & - hist_fincl1, hist_fincl2, hist_fincl3, & - hist_fincl4, hist_fincl5, hist_fincl6, & - hist_fexcl1, hist_fexcl2, hist_fexcl3, & - hist_fexcl4, hist_fexcl5, hist_fexcl6 - - ! BGC info - - namelist /clm_inparm/ & - suplnitro - - namelist /clm_inparm / use_c13, use_c14 - - namelist /clm_inparm / & - co2_type - - ! Glacier_mec info - namelist /clm_inparm / & - maxpatch_glcmec, glc_dyntopo, fglcmask - - ! Other options - - namelist /clm_inparm/ & - clump_pproc, wrtdia, & - create_crop_landunit, nsegspc, co2_ppmv, override_nsrest, & - albice - ! Urban options - - namelist /clm_inparm/ & - urban_hac, urban_traffic - - ! ---------------------------------------------------------------------- - ! Default values - ! ---------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to initialize run control settings .....' - endif - - runtyp(:) = 'missing' - runtyp(nsrStartup + 1) = 'initial' - runtyp(nsrContinue + 1) = 'restart' - runtyp(nsrBranch + 1) = 'branch ' - - ! Set clumps per procoessor - -#if (defined _OPENMP) - clump_pproc = omp_get_max_threads() -#else - clump_pproc = 1 -#endif - - override_nsrest = nsrest - - if (masterproc) then - - ! ---------------------------------------------------------------------- - ! Read namelist from standard input. - ! ---------------------------------------------------------------------- - - if ( len_trim(NLFilename) == 0 )then - call endrun( subname//' error: nlfilename not set' ) - end if - unitn = getavu() - write(iulog,*) 'Read in clm_inparm namelist from: ', trim(NLFilename) - open( unitn, file=trim(NLFilename), status='old' ) - ierr = 1 - do while ( ierr /= 0 ) - read(unitn, clm_inparm, iostat=ierr) - if (ierr < 0) then - call endrun( subname//' encountered end-of-file on clm_inparm read' ) - endif - end do - call relavu( unitn ) - - ! ---------------------------------------------------------------------- - ! Consistency checks on input namelist. - ! ---------------------------------------------------------------------- - - call set_timemgr_init( dtime_in=dtime ) - - if (urban_traffic) then - write(iulog,*)'Urban traffic fluxes are not implemented currently' - call endrun() - end if - - ! History and restart files - - do i = 1, max_tapes - if (hist_nhtfrq(i) == 0) then - hist_mfilt(i) = 1 - else if (hist_nhtfrq(i) < 0) then - hist_nhtfrq(i) = nint(-hist_nhtfrq(i)*SHR_CONST_CDAY/(24._r8*dtime)) - endif - end do - - ! Override start-type (can only override to branch (3) and only - ! if the driver is a startup type - if ( override_nsrest /= nsrest )then - if ( override_nsrest /= nsrBranch .and. nsrest /= nsrStartup )then - call endrun( subname//' ERROR: can ONLY override clm start-type ' // & - 'to branch type and ONLY if driver is a startup type' ) - end if - call clm_varctl_set( nsrest_in=override_nsrest ) - end if - - ! Consistency of elevation classes on namelist to what's sent by the coupler - if (glc_nec /= maxpatch_glcmec ) then - write(iulog,*)'glc_nec, maxpatch_glcmec=',glc_nec, maxpatch_glcmec - write(iulog,*)'Number of glacier elevation classes from clm namelist and' // & - ' sent by the coupler MUST be equal' - call endrun( subname //' ERROR: glc_nec and maxpatch_glcmec must be equal') - end if - if (maxpatch_glcmec > 0) then - create_glacier_mec_landunit = .true. - else - create_glacier_mec_landunit = .false. - end if - - endif ! end of if-masterproc if-block - - call clmvarctl_init( masterproc, dtime ) - - ! ---------------------------------------------------------------------- - ! Broadcast all control information if appropriate - ! ---------------------------------------------------------------------- - - call control_spmd() - - if (masterproc) then - write(iulog,*) 'Successfully initialized run control settings' - write(iulog,*) - endif - - end subroutine control_init - - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: control_spmd -! -! !INTERFACE: - subroutine control_spmd() -! -! !DESCRIPTION: -! Distribute namelist data all processors. All program i/o is -! funnelled through the master processor. Processor 0 either -! reads restart/history data from the disk and distributes -! it to all processors, or collects data from -! all processors and writes it to disk. -! -! !USES: -! - use spmdMod, only : mpicom, MPI_CHARACTER, MPI_INTEGER, MPI_LOGICAL, MPI_REAL8 - use clm_varctl, only : single_column, scmlat, scmlon, rpntfil -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer ier !error code -!----------------------------------------------------------------------- - - ! run control variables - - call mpi_bcast (caseid, len(caseid), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (ctitle, len(ctitle), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (model_version, len(model_version), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hostname, len(hostname), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (username, len(username), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (nsrest, 1, MPI_INTEGER , 0, mpicom, ier) - - ! initial file variables - - call mpi_bcast (nrevsn , len(nrevsn) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (finidat , len(finidat) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsurdat , len(fsurdat) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fatmlndfrc,len(fatmlndfrc),MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fatmtopo, len(fatmtopo) ,MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (flndtopo, len(flndtopo) ,MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fpftcon , len(fpftcon) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (flanduse_timeseries , len(flanduse_timeseries) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fsnowaging, len(fsnowaging), MPI_CHARACTER, 0, mpicom, ier) - - ! Landunit generation - - call mpi_bcast(create_crop_landunit, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast(allocate_all_vegpfts, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! BGC - - call mpi_bcast (co2_type, len(co2_type), MPI_CHARACTER, 0, mpicom, ier) - if (use_cn) then - call mpi_bcast (suplnitro, len(suplnitro), MPI_CHARACTER, 0, mpicom, ier) - end if - - ! isotopes - - call mpi_bcast (use_c13, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_c14, 1, MPI_LOGICAL, 0, mpicom, ier) - - ! physics variables - - call mpi_bcast (urban_hac , len(urban_hac), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (urban_traffic , 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (nsegspc , 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (wrtdia , 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (single_column,1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (scmlat, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (scmlon, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (co2_ppmv , 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (albice , 2, MPI_REAL8, 0, mpicom, ier) - - ! glacier_mec variables - - call mpi_bcast (create_glacier_mec_landunit, 1, MPI_LOGICAL , 0, mpicom, ier) - call mpi_bcast (maxpatch_glcmec ,1, MPI_INTEGER , 0, mpicom, ier) - call mpi_bcast (glc_dyntopo, 1, MPI_LOGICAL , 0, mpicom, ier) - call mpi_bcast (fglcmask, len(fglcmask), MPI_CHARACTER, 0, mpicom, ier) - - ! history file variables - - call mpi_bcast (hist_empty_htapes, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (hist_dov2xy, size(hist_dov2xy), MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (hist_nhtfrq, size(hist_nhtfrq), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_mfilt, size(hist_mfilt), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_ndens, size(hist_ndens), MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (hist_avgflag_pertape, size(hist_avgflag_pertape), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_type1d_pertape, max_namlen*size(hist_type1d_pertape), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl1, max_namlen*size(hist_fexcl1), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl2, max_namlen*size(hist_fexcl2), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl3, max_namlen*size(hist_fexcl3), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl4, max_namlen*size(hist_fexcl4), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl5, max_namlen*size(hist_fexcl5), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fexcl6, max_namlen*size(hist_fexcl6), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl1, (max_namlen+2)*size(hist_fincl1), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl2, (max_namlen+2)*size(hist_fincl2), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl3, (max_namlen+2)*size(hist_fincl3), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl4, (max_namlen+2)*size(hist_fincl4), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl5, (max_namlen+2)*size(hist_fincl5), MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (hist_fincl6, (max_namlen+2)*size(hist_fincl6), MPI_CHARACTER, 0, mpicom, ier) - - ! restart file variables - - call mpi_bcast (rpntfil, len(rpntfil), MPI_CHARACTER, 0, mpicom, ier) - - ! clump decomposition variables - - call mpi_bcast (clump_pproc, 1, MPI_INTEGER, 0, mpicom, ier) - - end subroutine control_spmd - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: control_print -! -! !INTERFACE: - subroutine control_print () -! -! !DESCRIPTION: -! Write out the clm namelist run control variables -! -! !USES: -! - use clm_varctl, only : source, rpntdir, rpntfil, nsrStartup, nsrBranch, & - nsrContinue - use CNAllocationMod, only : suplnitro, suplnNon -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer i !loop index - character(len=32) :: subname = 'control_print' ! subroutine name -!------------------------------------------------------------------------ - - write(iulog,*) 'define run:' - write(iulog,*) ' source = ',trim(source) - write(iulog,*) ' model_version = ',trim(model_version) - write(iulog,*) ' run type = ',runtyp(nsrest+1) - write(iulog,*) ' case title = ',trim(ctitle) - write(iulog,*) ' username = ',trim(username) - write(iulog,*) ' hostname = ',trim(hostname) - write(iulog,*) 'input data files:' - write(iulog,*) ' PFT physiology = ',trim(fpftcon) - if (fsurdat == ' ') then - write(iulog,*) ' fsurdat, surface dataset not set' - else - write(iulog,*) ' surface data = ',trim(fsurdat) - end if - if (fatmlndfrc == ' ') then - write(iulog,*) ' fatmlndfrc not set, setting frac/mask to 1' - else - write(iulog,*) ' land frac data = ',trim(fatmlndfrc) - end if - if (flndtopo == ' ') then - write(iulog,*) ' flndtopo not set' - else - write(iulog,*) ' land topographic data = ',trim(flndtopo) - end if - if (fatmtopo == ' ') then - write(iulog,*) ' fatmtopo not set' - else - write(iulog,*) ' atm topographic data = ',trim(fatmtopo) - end if - if (use_cn) then - if (suplnitro /= suplnNon)then - write(iulog,*) ' Supplemental Nitrogen mode is set to run over PFTs: ', & - trim(suplnitro) - end if - write(iulog, *) ' use_c13: ', use_c13 - write(iulog, *) ' use_c14: ', use_c14 - end if - if (fsnowoptics == ' ') then - write(iulog,*) ' snow optical properties file NOT set' - else - write(iulog,*) ' snow optical properties file = ',trim(fsnowoptics) - endif - if (fsnowaging == ' ') then - write(iulog,*) ' snow aging parameters file NOT set' - else - write(iulog,*) ' snow aging parameters file = ',trim(fsnowaging) - endif - - if (create_glacier_mec_landunit) then - write(iulog,*) ' glc number of elevation classes =', maxpatch_glcmec - write(iulog,*) ' glc glacier mask file = ',trim(fglcmask) - if (glc_dyntopo) then - write(iulog,*) ' glc CLM glacier topography will evolve dynamically' - else - write(iulog,*) ' glc CLM glacier topography will NOT evolve dynamically' - endif - endif - - if (nsrest == nsrStartup .and. finidat == ' ') write(iulog,*) ' initial data created by model' - if (nsrest == nsrStartup .and. finidat /= ' ') write(iulog,*) ' initial data = ',trim(finidat) - if (nsrest /= nsrStartup) write(iulog,*) ' restart data = ',trim(nrevsn) - write(iulog,*) ' atmospheric forcing data is from cesm atm model' - write(iulog,*) 'Restart parameters:' - write(iulog,*)' restart pointer file directory = ',trim(rpntdir) - write(iulog,*)' restart pointer file name = ',trim(rpntfil) - write(iulog,*) 'model physics parameters:' - - if ( trim(co2_type) == 'constant' )then - write(iulog,*) ' CO2 volume mixing ratio (umol/mol) = ', co2_ppmv - else - write(iulog,*) ' CO2 volume mixing ratio = ', co2_type - end if - - write(iulog,*) ' land-ice albedos (unitless 0-1) = ', albice - write(iulog,*) ' urban air conditioning/heating and wasteheat = ', urban_hac - write(iulog,*) ' urban traffic flux = ', urban_traffic - if (nsrest == nsrContinue) then - write(iulog,*) 'restart warning:' - write(iulog,*) ' Namelist not checked for agreement with initial run.' - write(iulog,*) ' Namelist should not differ except for ending time step and run type' - end if - if (nsrest == nsrBranch) then - write(iulog,*) 'branch warning:' - write(iulog,*) ' Namelist not checked for agreement with initial run.' - write(iulog,*) ' Surface data set and reference date should not differ from initial run' - end if - write(iulog,*) ' maxpatch_pft = ',maxpatch_pft - write(iulog,*) ' allocate_all_vegpfts = ',allocate_all_vegpfts - write(iulog,*) ' nsegspc = ',nsegspc - - end subroutine control_print - -end module controlMod diff --git a/src_clm40/main/decompInitMod.F90 b/src_clm40/main/decompInitMod.F90 deleted file mode 100644 index 031275f1ab..0000000000 --- a/src_clm40/main/decompInitMod.F90 +++ /dev/null @@ -1,762 +0,0 @@ -module decompInitMod - -!------------------------------------------------------------------------------ -!BOP -! -! !MODULE: decompInitMod -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc, iam, npes, mpicom, comp_id - use shr_sys_mod , only : shr_sys_flush - use abortutils , only : endrun - use clm_varctl , only : iulog - use mct_mod - use decompMod -! -! !PUBLIC TYPES: - implicit none -! -! !PUBLIC MEMBER FUNCTIONS: - public decompInit_lnd ! initializes atm grid decomposition into clumps and processors - public decompInit_glcp ! initializes g,l,c,p decomp info - -! -! !DESCRIPTION: -! Module provides a descomposition into a clumped data structure which can -! be mapped back to atmosphere physics chunks. -! -! !REVISION HISTORY: -! 2002.09.11 Forrest Hoffman Creation. -! 2005.11.01 T Craig Rewrite -! 2006.06.06 T Craig Reduce memory, cleanup -! -! -! !PRIVATE TYPES: - private - - integer, pointer :: lcid(:) ! temporary for setting ldecomp - -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: decompInit_lnd -! -! !INTERFACE: - subroutine decompInit_lnd(lni,lnj,amask) -! -! !DESCRIPTION: -! This subroutine initializes the land surface decomposition into a clump -! data structure. This assumes each pe has the same number of clumps -! set by clump_pproc -! -! !USES: - use clm_varctl, only : nsegspc -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: amask(:) - integer , intent(in) :: lni,lnj ! domain global size -! -! !LOCAL VARIABLES: - integer :: lns ! global domain size - integer :: ln,lj ! indices - integer :: ag,an,ai,aj ! indices - integer :: numg ! number of land gridcells - logical :: seglen1 ! is segment length one - real(r8):: seglen ! average segment length - real(r8):: rcid ! real value of cid - integer :: cid,pid ! indices - integer :: n,m,ng ! indices - integer :: ier ! error code - integer :: beg,end,lsize,gsize ! used for gsmap init - integer, pointer :: gindex(:) ! global index for gsmap init - integer, pointer :: clumpcnt(:) ! clump index counter - integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max - -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! 2002.09.11 Forrest Hoffman Creation. -! 2005.12.15 T Craig Updated for finemesh -! 2006.08.18 P Worley Performance optimizations -! 2007.01.24 T Craig Created decompInit_atm from decomp_init -! -!EOP -!------------------------------------------------------------------------------ - - lns = lni * lnj - - !--- set and verify nclumps --- - if (clump_pproc > 0) then - nclumps = clump_pproc * npes - if (nclumps < npes) then - write(iulog,*) 'decompInit_lnd(): Number of gridcell clumps= ',nclumps, & - ' is less than the number of processes = ', npes - call endrun() - end if - else - write(iulog,*)'clump_pproc= ',clump_pproc,' must be greater than 0' - call endrun() - end if - - !--- allocate and initialize procinfo and clumps --- - !--- beg and end indices initialized for simple addition of cells later --- - - allocate(procinfo%cid(clump_pproc), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error for procinfo%cid' - call endrun() - endif - procinfo%nclumps = clump_pproc - procinfo%cid(:) = -1 - procinfo%ncells = 0 - procinfo%nlunits = 0 - procinfo%ncols = 0 - procinfo%npfts = 0 - procinfo%begg = 1 - procinfo%begl = 1 - procinfo%begc = 1 - procinfo%begp = 1 - procinfo%endg = 0 - procinfo%endl = 0 - procinfo%endc = 0 - procinfo%endp = 0 - - allocate(clumps(nclumps), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error for clumps' - call endrun() - end if - clumps(:)%owner = -1 - clumps(:)%ncells = 0 - clumps(:)%nlunits = 0 - clumps(:)%ncols = 0 - clumps(:)%npfts = 0 - clumps(:)%begg = 1 - clumps(:)%begl = 1 - clumps(:)%begc = 1 - clumps(:)%begp = 1 - clumps(:)%endg = 0 - clumps(:)%endl = 0 - clumps(:)%endc = 0 - clumps(:)%endp = 0 - - !--- assign clumps to proc round robin --- - cid = 0 - do n = 1,nclumps - pid = mod(n-1,npes) - if (pid < 0 .or. pid > npes-1) then - write(iulog,*) 'decompInit_lnd(): round robin pid error ',n,pid,npes - call endrun() - endif - clumps(n)%owner = pid - if (iam == pid) then - cid = cid + 1 - if (cid < 1 .or. cid > clump_pproc) then - write(iulog,*) 'decompInit_lnd(): round robin pid error ',n,pid,npes - call endrun() - endif - procinfo%cid(cid) = n - endif - enddo - - !--- count total land gridcells - numg = 0 - do ln = 1,lns - if (amask(ln) == 1) then - numg = numg + 1 - endif - enddo - - if (npes > numg) then - write(iulog,*) 'decompInit_lnd(): Number of processes exceeds number ', & - 'of land grid cells',npes,numg - call endrun() - end if - if (nclumps > numg) then - write(iulog,*) 'decompInit_lnd(): Number of clumps exceeds number ', & - 'of land grid cells',nclumps,numg - call endrun() - end if - - if (float(numg)/float(nclumps) < float(nsegspc)) then - seglen1 = .true. - seglen = 1.0_r8 - else - seglen1 = .false. - seglen = dble(numg)/(dble(nsegspc)*dble(nclumps)) - endif - - if (masterproc) then - write(iulog,*) ' decomp precompute numg,nclumps,seglen1,avg_seglen,nsegspc=', & - numg,nclumps,seglen1,& - sngl(seglen),sngl(dble(numg)/(seglen*dble(nclumps))) - end if - - ! Assign gridcells to clumps (and thus pes) --- - - allocate(lcid(lns)) - lcid(:) = 0 - ng = 0 - do ln = 1,lns - if (amask(ln) == 1) then - ng = ng + 1 - - !--- give to clumps in order based on nsegspc - if (seglen1) then - cid = mod(ng-1,nclumps) + 1 - else - rcid = (dble(ng-1)/dble(numg))*dble(nsegspc)*dble(nclumps) - cid = mod(int(rcid),nclumps) + 1 - endif - lcid(ln) = cid - - !--- give gridcell cell to pe that owns cid --- - !--- this needs to be done to subsequently use function - !--- get_proc_bounds(begg,endg) - if (iam == clumps(cid)%owner) then - procinfo%ncells = procinfo%ncells + 1 - endif - if (iam > clumps(cid)%owner) then - procinfo%begg = procinfo%begg + 1 - endif - if (iam >= clumps(cid)%owner) then - procinfo%endg = procinfo%endg + 1 - endif - - !--- give gridcell to cid --- - !--- increment the beg and end indices --- - clumps(cid)%ncells = clumps(cid)%ncells + 1 - do m = 1,nclumps - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m > cid)) then - clumps(m)%begg = clumps(m)%begg + 1 - endif - - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m >= cid)) then - clumps(m)%endg = clumps(m)%endg + 1 - endif - enddo - - end if - enddo - - ! Set ldecomp - - allocate(ldecomp%gdc2glo(numg), ldecomp%glo2gdc(lns), stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error1 for ldecomp, etc' - call endrun() - end if - allocate(clumpcnt(nclumps),stat=ier) - if (ier /= 0) then - write(iulog,*) 'decompInit_lnd(): allocation error1 for clumpcnt' - call endrun() - end if - - ldecomp%gdc2glo(:) = 0 - ldecomp%glo2gdc(:) = 0 - - ! clumpcnt is the start gdc index of each clump - - clumpcnt = 0 - ag = 1 - do pid = 0,npes-1 - do cid = 1,nclumps - if (clumps(cid)%owner == pid) then - clumpcnt(cid) = ag - ag = ag + clumps(cid)%ncells - endif - enddo - enddo - - ! now go through gridcells one at a time and increment clumpcnt - ! in order to set gdc2glo and glo2gdc - - do aj = 1,lnj - do ai = 1,lni - an = (aj-1)*lni + ai - cid = lcid(an) - if (cid > 0) then - ag = clumpcnt(cid) - ldecomp%gdc2glo(ag) = an - ldecomp%glo2gdc(an) = ag - clumpcnt(cid) = clumpcnt(cid) + 1 - end if - enddo - enddo - - deallocate(clumpcnt) - - ! Set gsMap_lnd_gdc2glo - - call get_proc_bounds(beg, end) - allocate(gindex(beg:end)) - do n = beg,end - gindex(n) = ldecomp%gdc2glo(n) - enddo - lsize = end-beg+1 - gsize = lni * lnj - call mct_gsMap_init(gsMap_lnd_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) - deallocate(gindex) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' Surface Grid Characteristics' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' total number of land gridcells = ',numg - write(iulog,*)' Decomposition Characteristics' - write(iulog,*)' clumps per process = ',clump_pproc - write(iulog,*)' gsMap Characteristics' - write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo) - write(iulog,*) - end if - - call shr_sys_flush(iulog) - - end subroutine decompInit_lnd - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: decompInit_glcp -! -! !INTERFACE: - subroutine decompInit_glcp(lns,lni,lnj,glcmask) -! -! !DESCRIPTION: -! This subroutine initializes the land surface decomposition into a clump -! data structure. This assumes each pe has the same number of clumps -! set by clump_pproc -! -! !USES: - use clmtype , only : grlnd, nameg, namel, namec, namep - use spmdMod - use spmdGathScatMod - use subgridMod, only : subgrid_get_gcellinfo -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lns,lni,lnj ! land domain global size - integer , pointer, optional :: glcmask(:) ! glc mask -! -! !LOCAL VARIABLES: - integer :: ln,an ! indices - integer :: i,g,l,k ! indices - integer :: cid,pid ! indices - integer :: n,m,np ! indices - integer :: anumg ! lnd num gridcells - integer :: begg,endg ! beg,end gridcells - integer :: begl,endl ! beg,end landunits - integer :: begc,endc ! beg,end columns - integer :: begp,endp ! beg,end pfts - integer :: icells ! temporary - integer :: ilunits ! temporary - integer :: icols ! temporary - integer :: ipfts ! temporary - integer :: ier ! error code - integer :: npmin,npmax,npint ! do loop values for printing - integer :: clmin,clmax ! do loop values for printing - integer :: lsize,gsize ! used for gsmap init - integer :: ng ! number of gridcells in gsmap - integer :: beg,end,num ! temporaries - integer :: val1, val2 ! temporaries - integer, pointer :: gindex(:) ! global index for gsmap init - integer, pointer :: arrayg(:) - integer, pointer :: gstart(:),gcount(:) - integer, pointer :: lstart(:),lcount(:) - integer, pointer :: cstart(:),ccount(:) - integer, pointer :: pstart(:),pcount(:) - integer, pointer :: start(:),count(:) - integer, pointer :: tarr1(:),tarr2(:) - integer, allocatable :: allvecg(:,:) ! temporary vector "global" - integer, allocatable :: allvecl(:,:) ! temporary vector "local" - type(mct_gsmap),pointer :: gsmap - character(len=8) :: clmlevel - integer :: ntest - integer, parameter :: dbug=1 ! 0 = min, 1=normal, 2=much, 3=max - character(len=32), parameter :: subname = 'decompInit_glcp' - -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! 2002.09.11 Forrest Hoffman Creation. -! 2005.12.15 T Craig Updated for finemesh -! 2006.08.18 P Worley Performance optimizations -! -!EOP -!------------------------------------------------------------------------------ - - !--- assign gridcells to clumps (and thus pes) --- - call get_proc_bounds(begg, endg) - - allocate(gstart(begg:endg),lstart(begg:endg),cstart(begg:endg),pstart(begg:endg)) - allocate(gcount(begg:endg),lcount(begg:endg),ccount(begg:endg),pcount(begg:endg)) - allocate(allvecg(nclumps,4),allvecl(nclumps,4)) ! 3 = gcells,lunit,cols,pfts - - allvecg= 0 - allvecl= 0 - gcount = 0 - lcount = 0 - ccount = 0 - pcount = 0 - do anumg = begg,endg - an = ldecomp%gdc2glo(anumg) - cid = lcid(an) - ln = anumg - if (present(glcmask)) then - call subgrid_get_gcellinfo (ln, nlunits=ilunits, & - ncols=icols, npfts=ipfts, glcmask=glcmask(ln)) - else - call subgrid_get_gcellinfo (ln, nlunits=ilunits, & - ncols=icols, npfts=ipfts) - endif - allvecl(cid,1) = allvecl(cid,1) + 1 - allvecl(cid,2) = allvecl(cid,2) + ilunits - allvecl(cid,3) = allvecl(cid,3) + icols - allvecl(cid,4) = allvecl(cid,4) + ipfts - gcount(ln) = 1 - lcount(ln) = ilunits - ccount(ln) = icols - pcount(ln) = ipfts - enddo - call mpi_allreduce(allvecl,allvecg,size(allvecg),MPI_INTEGER,MPI_SUM,mpicom,ier) - - numg = 0 - numl = 0 - numc = 0 - nump = 0 - do cid = 1,nclumps - icells = allvecg(cid,1) - ilunits = allvecg(cid,2) - icols = allvecg(cid,3) - ipfts = allvecg(cid,4) - - !--- overall total --- - numg = numg + icells - numl = numl + ilunits - numc = numc + icols - nump = nump + ipfts - - !--- give gridcell to cid --- - !--- increment the beg and end indices --- - clumps(cid)%nlunits = clumps(cid)%nlunits + ilunits - clumps(cid)%ncols = clumps(cid)%ncols + icols - clumps(cid)%npfts = clumps(cid)%npfts + ipfts - - do m = 1,nclumps - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m > cid)) then - clumps(m)%begl = clumps(m)%begl + ilunits - clumps(m)%begc = clumps(m)%begc + icols - clumps(m)%begp = clumps(m)%begp + ipfts - endif - - if ((clumps(m)%owner > clumps(cid)%owner) .or. & - (clumps(m)%owner == clumps(cid)%owner .and. m >= cid)) then - clumps(m)%endl = clumps(m)%endl + ilunits - clumps(m)%endc = clumps(m)%endc + icols - clumps(m)%endp = clumps(m)%endp + ipfts - endif - enddo - - !--- give gridcell to the proc that owns the cid --- - !--- increment the beg and end indices --- - if (iam == clumps(cid)%owner) then - procinfo%nlunits = procinfo%nlunits + ilunits - procinfo%ncols = procinfo%ncols + icols - procinfo%npfts = procinfo%npfts + ipfts - endif - - if (iam > clumps(cid)%owner) then - procinfo%begl = procinfo%begl + ilunits - procinfo%begc = procinfo%begc + icols - procinfo%begp = procinfo%begp + ipfts - endif - - if (iam >= clumps(cid)%owner) then - procinfo%endl = procinfo%endl + ilunits - procinfo%endc = procinfo%endc + icols - procinfo%endp = procinfo%endp + ipfts - endif - enddo - - do n = 1,nclumps - if (clumps(n)%ncells /= allvecg(n,1) .or. & - clumps(n)%nlunits /= allvecg(n,2) .or. & - clumps(n)%ncols /= allvecg(n,3) .or. & - clumps(n)%npfts /= allvecg(n,4)) then - write(iulog,*) 'decompInit_glcp(): allvecg error ncells ',iam,n,clumps(n)%ncells ,allvecg(n,1) - write(iulog,*) 'decompInit_glcp(): allvecg error lunits ',iam,n,clumps(n)%nlunits,allvecg(n,2) - write(iulog,*) 'decompInit_glcp(): allvecg error ncols ',iam,n,clumps(n)%ncols ,allvecg(n,3) - write(iulog,*) 'decompInit_glcp(): allvecg error pfts ',iam,n,clumps(n)%npfts ,allvecg(n,4) - call endrun() - endif - enddo - - deallocate(allvecg,allvecl) - deallocate(lcid) - - ! set gsMaps, perms for lun, col, pft - - ! this was just "set" above in procinfo, be careful not to move it up - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ng = mct_gsmap_gsize(gsmap_lnd_gdc2glo) - allocate(arrayg(ng)) - - ! for each subgrid gsmap (l, c, p) - ! gather the gdc subgrid counts to masterproc in glo order - ! compute glo ordered start indices from the counts - ! scatter the subgrid start indices back out to the gdc gridcells - ! set the local gindex array for the subgrid from the subgrid start and count arrays - - do k = 1,4 - if (k == 1) then - clmlevel = nameg - beg = begg - end = endg - num = numg - gsmap => gsmap_gce_gdc2glo - start => gstart - count => gcount - elseif (k == 2) then - clmlevel = namel - beg = begl - end = endl - num = numl - gsmap => gsmap_lun_gdc2glo - start => lstart - count => lcount - elseif (k == 3) then - clmlevel = namec - beg = begc - end = endc - num = numc - gsmap => gsmap_col_gdc2glo - start => cstart - count => ccount - elseif (k == 4) then - clmlevel = namep - beg = begp - end = endp - num = nump - gsmap => gsmap_pft_gdc2glo - start => pstart - count => pcount - else - write(iulog,*) 'decompInit_glcp error in k ',k - call endrun() - endif - - arrayg = 0 - call gather_data_to_master(count,arrayg,grlnd) - if (masterproc) then - gsize = arrayg(1) - val1 = arrayg(1) - arrayg(1) = 1 - do n = 2,ng - gsize = gsize + arrayg(n) - val2 = arrayg(n) - arrayg(n) = arrayg(n-1) + val1 - val1 = val2 - enddo - endif - call scatter_data_from_master(start,arrayg,grlnd) - - allocate(gindex(beg:end)) - - i = beg-1 - do g = begg,endg - if (count(g) < 1) then - write(iulog,*) 'decompInit_glcp warning count g ',k,iam,g,count(g) - endif - do l = 1,count(g) - i = i + 1 - if (i < beg .or. i > end) then - write(iulog,*) 'decompInit_glcp error i ',i,beg,end - call endrun() - endif - gindex(i) = start(g) + l - 1 - enddo - enddo - if (i /= end) then - write(iulog,*) 'decompInit_glcp error size ',i,beg,end - call endrun() - endif - lsize = end-beg+1 - gsize = num - call mct_gsMap_init(gsMap, gindex, mpicom, comp_id, lsize, gsize) - - if (dbug > 1) then - !--- test gsmap --- - ntest = mct_gsMap_gsize(gsMap) - allocate(tarr1(ntest),tarr2(beg:end)) - call gather_data_to_master(gindex,tarr1,clmlevel) - call scatter_data_from_master(tarr2,tarr1,clmlevel) - !--- verify gather/scatter produces same result - do l = beg,end - if (tarr2(l) /= gindex(l)) then - write(iulog,*) 'decompInit_glcp error tarr2 ',k,l,gindex(l),tarr2(l) - call endrun() - endif - enddo - !--- verify gather of gindex on new gsmap produces ordered indices - if (masterproc) then - if (tarr1(1) /= 1) then - write(iulog,*) 'decompInit_glcp error tarr1 ',k,1,tarr1(1) - call endrun() - endif - do l = 2,ntest - if (tarr1(l)-tarr1(l-1) /= 1) then - write(iulog,*) 'decompInit_glcp error tarr1 ',k,l,tarr1(l-1),tarr1(l) - call endrun() - endif - enddo - endif - deallocate(tarr1,tarr2) - if (masterproc) then - write(iulog,*) 'decompInit_glcp gsmap [l,c,p] test passes for ',k - endif - !--- end test section - end if - deallocate(gindex) - - enddo - - deallocate(gstart,lstart,cstart,pstart) - deallocate(gcount,lcount,ccount,pcount) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' Surface Grid Characteristics' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' total number of gridcells = ',numg - write(iulog,*)' total number of landunits = ',numl - write(iulog,*)' total number of columns = ',numc - write(iulog,*)' total number of pfts = ',nump - write(iulog,*)' Decomposition Characteristics' - write(iulog,*)' clumps per process = ',clump_pproc - write(iulog,*)' gsMap Characteristics' - write(iulog,*) ' lnd gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo) - write(iulog,*) ' gce gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo) - write(iulog,*) ' lun gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo) - write(iulog,*) ' col gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_col_gdc2glo) - write(iulog,*) ' pft gsmap glo num of segs = ',mct_gsMap_ngseg(gsMap_pft_gdc2glo) - write(iulog,*) - end if - - ! Write out clump and proc info, one pe at a time, - ! barrier to control pes overwriting each other on stdout - - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - npmin = 0 - npmax = npes-1 - npint = 1 - if (dbug == 0) then - npmax = 0 - elseif (dbug == 1) then - npmax = min(npes-1,4) - elseif (dbug == 2) then - npint = npes/8 - endif - do np = npmin,npmax,npint - pid = np - if (dbug == 1) then - if (np == 2) pid=npes/2-1 - if (np == 3) pid=npes-2 - if (np == 4) pid=npes-1 - endif - pid = max(pid,0) - pid = min(pid,npes-1) - - if (iam == pid) then - write(iulog,*) - write(iulog,*)'proc= ',pid,& - ' beg gridcell= ',procinfo%begg, & - ' end gridcell= ',procinfo%endg, & - ' total gridcells per proc= ',procinfo%ncells - write(iulog,*)'proc= ',pid,& - ' beg landunit= ',procinfo%begl, & - ' end landunit= ',procinfo%endl, & - ' total landunits per proc= ',procinfo%nlunits - write(iulog,*)'proc= ',pid,& - ' beg column = ',procinfo%begc, & - ' end column = ',procinfo%endc, & - ' total columns per proc = ',procinfo%ncols - write(iulog,*)'proc= ',pid,& - ' beg pft = ',procinfo%begp, & - ' end pft = ',procinfo%endp, & - ' total pfts per proc = ',procinfo%npfts - write(iulog,*)'proc= ',pid,& - ' lnd ngseg = ',mct_gsMap_ngseg(gsMap_lnd_gdc2glo), & - ' lnd nlseg = ',mct_gsMap_nlseg(gsMap_lnd_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' gce ngseg = ',mct_gsMap_ngseg(gsMap_gce_gdc2glo), & - ' gce nlseg = ',mct_gsMap_nlseg(gsMap_gce_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' lun ngseg = ',mct_gsMap_ngseg(gsMap_lun_gdc2glo), & - ' lun nlseg = ',mct_gsMap_nlseg(gsMap_lun_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' col ngseg = ',mct_gsMap_ngseg(gsMap_col_gdc2glo), & - ' col nlseg = ',mct_gsMap_nlseg(gsMap_col_gdc2glo,iam) - write(iulog,*)'proc= ',pid,& - ' pft ngseg = ',mct_gsMap_ngseg(gsMap_pft_gdc2glo), & - ' pft nlseg = ',mct_gsMap_nlseg(gsMap_pft_gdc2glo,iam) - write(iulog,*)'proc= ',pid,' nclumps = ',procinfo%nclumps - - clmin = 1 - clmax = procinfo%nclumps - if (dbug == 1) then - clmax = 1 - elseif (dbug == 0) then - clmax = -1 - endif - do n = clmin,clmax - cid = procinfo%cid(n) - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg gridcell= ',clumps(cid)%begg, & - ' end gridcell= ',clumps(cid)%endg, & - ' total gridcells per clump= ',clumps(cid)%ncells - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg landunit= ',clumps(cid)%begl, & - ' end landunit= ',clumps(cid)%endl, & - ' total landunits per clump = ',clumps(cid)%nlunits - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg column = ',clumps(cid)%begc, & - ' end column = ',clumps(cid)%endc, & - ' total columns per clump = ',clumps(cid)%ncols - write(iulog,*)'proc= ',pid,' clump no = ',n, & - ' clump id= ',procinfo%cid(n), & - ' beg pft = ',clumps(cid)%begp, & - ' end pft = ',clumps(cid)%endp, & - ' total pfts per clump = ',clumps(cid)%npfts - end do - end if - call shr_sys_flush(iulog) - call mpi_barrier(mpicom,ier) - end do - call shr_sys_flush(iulog) - - end subroutine decompInit_glcp - -!------------------------------------------------------------------------------ - -end module decompInitMod diff --git a/src_clm40/main/decompMod.F90 b/src_clm40/main/decompMod.F90 deleted file mode 100644 index 74f35c3de9..0000000000 --- a/src_clm40/main/decompMod.F90 +++ /dev/null @@ -1,359 +0,0 @@ -module decompMod - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Module provides a descomposition into a clumped data structure which can - ! be mapped back to atmosphere physics chunks. - ! - ! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_abort - use spmdMod , only : masterproc, iam, npes, mpicom, comp_id - use clm_varctl , only : iulog - use mct_mod - ! - ! !PUBLIC TYPES: - implicit none - integer, public :: clump_pproc ! number of clumps per MPI process - ! - ! !PUBLIC MEMBER FUNCTIONS: - - public get_proc_clumps ! number of clumps for this processor - public get_proc_total ! total no. of gridcells, landunits, columns and pfts for any processor - public get_proc_global ! total gridcells, landunits, columns, pfts across all processors - public get_clmlevel_gsize ! get global size associated with clmlevel - public get_clmlevel_gsmap ! get gsmap associated with clmlevel - - interface get_clump_bounds - module procedure get_clump_bounds_old - module procedure get_clump_bounds_new - end interface - public get_clump_bounds ! clump beg and end gridcell,landunit,column,pft - - interface get_proc_bounds - module procedure get_proc_bounds_old - module procedure get_proc_bounds_new - end interface - public get_proc_bounds ! this processor beg and end gridcell,landunit,column,pft - - ! - ! !PRIVATE TYPES: - private ! (now mostly public for decompinitmod) - - integer,public :: nclumps ! total number of clumps across all processors - integer,public :: numg ! total number of gridcells on all procs - integer,public :: numl ! total number of landunits on all procs - integer,public :: numc ! total number of columns on all procs - integer,public :: nump ! total number of pfts on all procs - - type bounds_type - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending pft index - end type bounds_type - public bounds_type - - !---global information on each pe - type processor_type - integer :: nclumps ! number of clumps for processor_type iam - integer,pointer :: cid(:) ! clump indices - integer :: ncells ! number of gridcells in proc - integer :: nlunits ! number of landunits in proc - integer :: ncols ! number of columns in proc - integer :: npfts ! number of pfts in proc - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending pft index - end type processor_type - public processor_type - type(processor_type),public :: procinfo - - !---global information on each pe - type clump_type - integer :: owner ! process id owning clump - integer :: ncells ! number of gridcells in clump - integer :: nlunits ! number of landunits in clump - integer :: ncols ! number of columns in clump - integer :: npfts ! number of pfts in clump - integer :: begg, endg ! beginning and ending gridcell index - integer :: begl, endl ! beginning and ending landunit index - integer :: begc, endc ! beginning and ending column index - integer :: begp, endp ! beginning and ending pft index - end type clump_type - public clump_type - type(clump_type),public, allocatable :: clumps(:) - - !---global information on each pe - !--- i,j = 2d global - !--- glo = 1d global sn ordered - !--- gsn = 1d global sn ordered compressed - !--- gdc = 1d global dc ordered compressed - type decomp_type - integer,pointer :: glo2gdc(:) ! 1d glo to 1d gdc - integer,pointer :: gdc2glo(:) ! 1d gdc to 1d glo - end type decomp_type - public decomp_type - type(decomp_type),public,target :: ldecomp - - type(mct_gsMap) ,public,target :: gsMap_lnd_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_gce_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_lun_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_col_gdc2glo - type(mct_gsMap) ,public,target :: gsMap_pft_gdc2glo - !------------------------------------------------------------------------------ - -contains - - !------------------------------------------------------------------------------ - subroutine get_clump_bounds_new (n, bounds) - ! - ! !DESCRIPTION: - ! Determine clump bounds - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: n ! processor clump index - type(bounds_type), intent(out) :: bounds ! clump bounds - ! - ! !LOCAL VARIABLES: - character(len=32), parameter :: subname = 'get_clump_bounds' ! Subroutine name - integer :: cid ! clump id -#ifdef _OPENMP - integer, external :: OMP_GET_MAX_THREADS - integer, external :: OMP_GET_NUM_THREADS -#endif - !------------------------------------------------------------------------------ - ! Make sure this IS being called from a threaded region -#ifdef _OPENMP - if ( OMP_GET_NUM_THREADS() == 1 .and. OMP_GET_MAX_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a non-threaded region)') - end if -#endif - - cid = procinfo%cid(n) - bounds%begp = clumps(cid)%begp - bounds%endp = clumps(cid)%endp - bounds%begc = clumps(cid)%begc - bounds%endc = clumps(cid)%endc - bounds%begl = clumps(cid)%begl - bounds%endl = clumps(cid)%endl - bounds%begg = clumps(cid)%begg - bounds%endg = clumps(cid)%endg - end subroutine get_clump_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_clump_bounds_old (n, begg, endg, begl, endl, begc, endc, begp, endp) - implicit none - integer, intent(in) :: n ! proc clump index - integer, intent(out) :: begp, endp ! clump beg and end pft indices - integer, intent(out) :: begc, endc ! clump beg and end column indices - integer, intent(out) :: begl, endl ! clump beg and end landunit indices - integer, intent(out) :: begg, endg ! clump beg and end gridcell indices - integer :: cid ! clump id - !------------------------------------------------------------------------------ - - cid = procinfo%cid(n) - begp = clumps(cid)%begp - endp = clumps(cid)%endp - begc = clumps(cid)%begc - endc = clumps(cid)%endc - begl = clumps(cid)%begl - endl = clumps(cid)%endl - begg = clumps(cid)%begg - endg = clumps(cid)%endg - end subroutine get_clump_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_new (bounds) - ! - ! !DESCRIPTION: - ! Retrieve processor bounds - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(out) :: bounds ! processor bounds bounds - ! - ! !LOCAL VARIABLES: -#ifdef _OPENMP - integer, external :: OMP_GET_NUM_THREADS -#endif - character(len=32), parameter :: subname = 'get_proc_bounds' ! Subroutine name - !------------------------------------------------------------------------------ - ! Make sure this is NOT being called from a threaded region -#ifdef _OPENMP - if ( OMP_GET_NUM_THREADS() > 1 )then - call shr_sys_abort( trim(subname)//' ERROR: Calling from inside a threaded region') - end if -#endif - - bounds%begp = procinfo%begp - bounds%endp = procinfo%endp - bounds%begc = procinfo%begc - bounds%endc = procinfo%endc - bounds%begl = procinfo%begl - bounds%endl = procinfo%endl - bounds%begg = procinfo%begg - bounds%endg = procinfo%endg - - end subroutine get_proc_bounds_new - - !------------------------------------------------------------------------------ - subroutine get_proc_bounds_old (begg, endg, begl, endl, begc, endc, begp, endp, & - begCohort, endCohort) - implicit none - integer, optional, intent(out) :: begp, endp ! proc beg and end pft indices - integer, optional, intent(out) :: begc, endc ! proc beg and end column indices - integer, optional, intent(out) :: begl, endl ! proc beg and end landunit indices - integer, optional, intent(out) :: begg, endg ! proc beg and end gridcell indices - ! these are dummy arguments for backwards compatibility with 4_5 in - ! util_share/accumulMod.F90. 4_0 will never have a cohort dimension - integer, optional, intent(out) :: begCohort, endCohort ! cohort beg and end gridcell indices - !------------------------------------------------------------------------------ - - if (present(begp)) begp = procinfo%begp - if (present(endp)) endp = procinfo%endp - if (present(begc)) begc = procinfo%begc - if (present(endc)) endc = procinfo%endc - if (present(begl)) begl = procinfo%begl - if (present(endl)) endl = procinfo%endl - if (present(begg)) begg = procinfo%begg - if (present(endg)) endg = procinfo%endg - end subroutine get_proc_bounds_old - - !------------------------------------------------------------------------------ - subroutine get_proc_total(pid, ncells, nlunits, ncols, npfts) - ! - ! !DESCRIPTION: - ! Count up gridcells, landunits, columns, and pfts on process. - ! - ! !ARGUMENTS: - implicit none - integer, intent(in) :: pid ! proc id - integer, intent(out) :: ncells ! total number of gridcells on the processor - integer, intent(out) :: nlunits ! total number of landunits on the processor - integer, intent(out) :: ncols ! total number of columns on the processor - integer, intent(out) :: npfts ! total number of pfts on the processor - ! - ! !LOCAL VARIABLES: - integer :: cid ! clump index - !------------------------------------------------------------------------------ - - npfts = 0 - nlunits = 0 - ncols = 0 - ncells = 0 - do cid = 1,nclumps - if (clumps(cid)%owner == pid) then - ncells = ncells + clumps(cid)%ncells - nlunits = nlunits + clumps(cid)%nlunits - ncols = ncols + clumps(cid)%ncols - npfts = npfts + clumps(cid)%npfts - end if - end do - end subroutine get_proc_total - - !------------------------------------------------------------------------------ - subroutine get_proc_global(ng, nl, nc, np, nCohorts) - ! - ! !DESCRIPTION: - ! Return number of gridcells, landunits, columns, and pfts across all processes. - ! - ! !ARGUMENTS: - implicit none - integer, intent(out) :: ng ! total number of gridcells across all processors - integer, intent(out) :: nl ! total number of landunits across all processors - integer, intent(out) :: nc ! total number of columns across all processors - integer, intent(out) :: np ! total number of pfts across all processors - ! this is a dummy argument for backwards compatibility with 4_5 in - ! util_share/accumulMod.F90. 4_0 will never have a cohort dimension - integer, optional, intent(out) :: nCohorts ! total number ED cohorts - !------------------------------------------------------------------------------ - - np = nump - nc = numc - nl = numl - ng = numg - end subroutine get_proc_global - - !------------------------------------------------------------------------------ - integer function get_proc_clumps() - ! - ! !DESCRIPTION: - ! Return the number of clumps. - ! - ! !ARGUMENTS: - implicit none - !------------------------------------------------------------------------------ - - get_proc_clumps = procinfo%nclumps - - end function get_proc_clumps - - !----------------------------------------------------------------------- - integer function get_clmlevel_gsize (clmlevel) - ! - ! !DESCRIPTION: - ! Determine 1d size from clmlevel - ! - ! !USES: - use clmtype , only : grlnd, nameg, namel, namec, namep - use domainMod, only : ldomain - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: clmlevel !type of clm 1d array - !----------------------------------------------------------------------- - - select case (clmlevel) - case(grlnd) - get_clmlevel_gsize = ldomain%ns - case(nameg) - get_clmlevel_gsize = numg - case(namel) - get_clmlevel_gsize = numl - case(namec) - get_clmlevel_gsize = numc - case(namep) - get_clmlevel_gsize = nump - case default - write(iulog,*) 'get_clmlevel_gsize does not match clmlevel type: ', trim(clmlevel) - call shr_sys_abort() - end select - - end function get_clmlevel_gsize - - !----------------------------------------------------------------------- - subroutine get_clmlevel_gsmap (clmlevel, gsmap) - ! - ! !DESCRIPTION: - ! Compute arguments for gatherv, scatterv for vectors - ! - ! !USES: - use clmtype, only : grlnd, nameg, namel, namec, namep - ! - ! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: clmlevel ! type of input data - type(mct_gsmap) , pointer :: gsmap - !---------------------------------------------------------------------- - - select case (clmlevel) - case(grlnd) - gsmap => gsmap_lnd_gdc2glo - case(nameg) - gsmap => gsmap_gce_gdc2glo - case(namel) - gsmap => gsmap_lun_gdc2glo - case(namec) - gsmap => gsmap_col_gdc2glo - case(namep) - gsmap => gsmap_pft_gdc2glo - case default - write(iulog,*) 'get_clmlevel_gsmap: Invalid expansion character: ',trim(clmlevel) - call shr_sys_abort() - end select - end subroutine get_clmlevel_gsmap - -end module decompMod diff --git a/src_clm40/main/domainMod.F90 b/src_clm40/main/domainMod.F90 deleted file mode 100644 index 310131ee31..0000000000 --- a/src_clm40/main/domainMod.F90 +++ /dev/null @@ -1,241 +0,0 @@ -module domainMod -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: domainMod -! -! !DESCRIPTION: -! Module containing 2-d global surface boundary data information -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_abort - use spmdMod , only : masterproc - use clm_varctl , only : iulog -! -! !PUBLIC TYPES: - implicit none - private -! - public :: domain_type - - !--- this typically contains local domain info with arrays dim begg:endg --- - type domain_type - integer :: ns ! global size of domain - integer :: ni,nj ! global axis if 2d (nj=1 if unstructured) - logical :: isgrid2d ! true => global grid is lat/lon - integer :: nbeg,nend ! local beg/end indices - character(len=8) :: clmlevel ! grid type - integer ,pointer :: mask(:) ! land mask: 1 = land, 0 = ocean - real(r8),pointer :: frac(:) ! fractional land - real(r8),pointer :: topo(:) ! topography - real(r8),pointer :: latc(:) ! latitude of grid cell (deg) - real(r8),pointer :: lonc(:) ! longitude of grid cell (deg) - real(r8),pointer :: area(:) ! grid cell area (km**2) - integer ,pointer :: pftm(:) ! pft mask: 1=real, 0=fake, -1=notset - integer ,pointer :: glcmask(:) ! glc mask: 1=sfc mass balance required by GLC component - ! 0=SMB not required (default) - ! (glcmask is just a guess at the appropriate mask, known at initialization - in contrast to icemask, which is the true mask obtained from glc) - character*16 :: set ! flag to check if domain is set - logical :: decomped ! decomposed locally or global copy - end type domain_type - - type(domain_type) , public :: ldomain - real(r8), allocatable, public :: lon1d(:), lat1d(:) ! 1d lat/lons for 2d grids -! -! !PUBLIC MEMBER FUNCTIONS: - public domain_init ! allocates/nans domain types - public domain_clean ! deallocates domain types - public domain_check ! write out domain info -! -! !REVISION HISTORY: -! Originally clm_varsur by Mariana Vertenstein -! Migrated from clm_varsur to domainMod by T Craig -! - character*16,parameter :: set = 'domain_set ' - character*16,parameter :: unset = 'NOdomain_unsetNO' -! -!EOP -!------------------------------------------------------------------------------ - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_init -! -! !INTERFACE: - subroutine domain_init(domain,isgrid2d,ni,nj,nbeg,nend,clmlevel) - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) -! -! !DESCRIPTION: -! This subroutine allocates and nans the domain type -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(domain_type) :: domain ! domain datatype - logical, intent(in) :: isgrid2d ! true => global grid is lat/lon - integer, intent(in) :: ni,nj ! grid size, 2d - integer , intent(in), optional :: nbeg,nend ! beg/end indices - character(len=*), intent(in), optional :: clmlevel ! grid type -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer ier - integer nb,ne -! -!------------------------------------------------------------------------------ - - nb = 1 - ne = ni*nj - if (present(nbeg)) then - if (present(nend)) then - nb = nbeg - ne = nend - endif - endif - - if (domain%set == set) then - call domain_clean(domain) - endif - allocate(domain%mask(nb:ne),domain%frac(nb:ne),domain%latc(nb:ne), & - domain%pftm(nb:ne),domain%area(nb:ne),domain%lonc(nb:ne), & - domain%topo(nb:ne),domain%glcmask(nb:ne),stat=ier) - if (ier /= 0) then - call shr_sys_abort('domain_init ERROR: allocate mask, frac, lat, lon, area ') - endif - - if (present(clmlevel)) then - domain%clmlevel = clmlevel - endif - - domain%isgrid2d = isgrid2d - domain%ns = ni*nj - domain%ni = ni - domain%nj = nj - domain%nbeg = nb - domain%nend = ne - domain%mask = -9999 - domain%frac = -1.0e36 - domain%topo = 0._r8 - domain%latc = nan - domain%lonc = nan - domain%area = nan - - domain%set = set - if (domain%nbeg == 1 .and. domain%nend == domain%ns) then - domain%decomped = .false. - else - domain%decomped = .true. - endif - - domain%pftm = -9999 - domain%glcmask = 0 - -end subroutine domain_init -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_clean -! -! !INTERFACE: - subroutine domain_clean(domain) -! -! !DESCRIPTION: -! This subroutine deallocates the domain type -! -! !ARGUMENTS: - implicit none - type(domain_type) :: domain ! domain datatype -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer ier -! -!------------------------------------------------------------------------------ - if (domain%set == set) then - if (masterproc) then - write(iulog,*) 'domain_clean: cleaning ',domain%ni,domain%nj - endif - deallocate(domain%mask,domain%frac,domain%latc, & - domain%lonc,domain%area,domain%pftm, & - domain%topo,domain%glcmask,stat=ier) - if (ier /= 0) then - call shr_sys_abort('domain_clean ERROR: deallocate mask, frac, lat, lon, area ') - endif - else - if (masterproc) then - write(iulog,*) 'domain_clean WARN: clean domain unecessary ' - endif - endif - - domain%clmlevel = unset - domain%ns = huge(1) - domain%ni = huge(1) - domain%nj = huge(1) - domain%nbeg = huge(1) - domain%nend = huge(1) - domain%set = unset - domain%decomped = .true. - -end subroutine domain_clean -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: domain_check -! -! !INTERFACE: - subroutine domain_check(domain) -! -! !DESCRIPTION: -! This subroutine write domain info -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(domain_type),intent(in) :: domain ! domain datatype -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -! -!EOP -!------------------------------------------------------------------------------ - - if (masterproc) then - write(iulog,*) ' domain_check set = ',trim(domain%set) - write(iulog,*) ' domain_check decomped = ',domain%decomped - write(iulog,*) ' domain_check ns = ',domain%ns - write(iulog,*) ' domain_check ni,nj = ',domain%ni,domain%nj - write(iulog,*) ' domain_check clmlevel = ',trim(domain%clmlevel) - write(iulog,*) ' domain_check nbeg,nend = ',domain%nbeg,domain%nend - write(iulog,*) ' domain_check lonc = ',minval(domain%lonc),maxval(domain%lonc) - write(iulog,*) ' domain_check latc = ',minval(domain%latc),maxval(domain%latc) - write(iulog,*) ' domain_check mask = ',minval(domain%mask),maxval(domain%mask) - write(iulog,*) ' domain_check frac = ',minval(domain%frac),maxval(domain%frac) - write(iulog,*) ' domain_check topo = ',minval(domain%topo),maxval(domain%topo) - write(iulog,*) ' domain_check area = ',minval(domain%area),maxval(domain%area) - write(iulog,*) ' domain_check pftm = ',minval(domain%pftm),maxval(domain%pftm) - write(iulog,*) ' domain_check glcmask = ',minval(domain%glcmask),maxval(domain%glcmask) - write(iulog,*) ' ' - endif - -end subroutine domain_check - -!------------------------------------------------------------------------------ - -end module domainMod diff --git a/src_clm40/main/dtypes.h b/src_clm40/main/dtypes.h deleted file mode 100644 index 977e95ad75..0000000000 --- a/src_clm40/main/dtypes.h +++ /dev/null @@ -1,6 +0,0 @@ -#define TYPEDOUBLE 102 -#define TYPEINT 103 -#define TYPETEXT 100 -#define TYPELONG 104 -#define TYPEREAL 101 -#define TYPELOGICAL 105 diff --git a/src_clm40/main/dynlandMod.F90 b/src_clm40/main/dynlandMod.F90 deleted file mode 100644 index b4fe770c19..0000000000 --- a/src_clm40/main/dynlandMod.F90 +++ /dev/null @@ -1,255 +0,0 @@ -module dynlandMod - -!--------------------------------------------------------------------------- -!BOP -! -! !MODULE: dynlandMod -! -! !USES: - use spmdMod - use clmtype - use decompMod , only : get_proc_bounds - use clm_varctl , only : iulog - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun -! -! !DESCRIPTION: -! Compute heat and water content to track conservation wrt dynamic land use -! -! !PUBLIC TYPES: - implicit none - private - save - public :: dynland_hwcontent -! -! !REVISION HISTORY: -! 2009-feb-20 B. Kauffman, created by -! -!EOP -! -! ! PRIVATE TYPES - -!=============================================================================== - -contains - -!=============================================================================== -!BOP -! -! !ROUTINE: dynland_hwcontent -! -! !INTERFACE: - - subroutine dynland_hwcontent(begg,endg,gcell_liq,gcell_ice,gcell_heat) - -! !DESCRIPTION: -! Compute grid-level heat and water content -! -! !REVISION HISTORY: -! 2009-feb-20 B. Kauffman, created by -! -! !USES: - - use clm_varcon, only : istsoil,istice,istwet,istdlak,istslak,isturb,istice_mec - use clm_varcon, only : istcrop - use clm_varcon, only : icol_road_perv,icol_road_imperv,icol_roof - use clm_varcon, only : icol_sunwall,icol_shadewall - use clm_varcon, only : cpice, cpliq - use clm_varpar, only : nlevsno, nlevgrnd - - implicit none - -! !ARGUMENTS: - - integer , intent(in) :: begg, endg ! proc beg & end gridcell indices - real(r8), intent(out) :: gcell_liq(begg:endg) - real(r8), intent(out) :: gcell_ice (begg:endg) - real(r8), intent(out) :: gcell_heat (begg:endg) - -! !LOCAL VARIABLES: -!EOP - - integer :: li,lf ! loop initial/final indicies - integer :: ci,cf ! loop initial/final indicies - integer :: pi,pf ! loop initial/final indicies - - integer :: g,l,c,p,k ! loop indicies (grid,lunit,column,pft,vertical level) - - real(r8) :: wtgcell ! weight relative to grid cell - real(r8) :: wtcol ! weight relative to column - real(r8) :: liq ! sum of liquid water at column level - real(r8) :: ice ! sum of frozen water at column level - real(r8) :: heat ! sum of heat content at column level - real(r8) :: cv ! heat capacity [J/(m^2 K)] - - integer ,pointer :: ltype(:) ! landunit type index - integer ,pointer :: ctype(:) ! column type index - integer ,pointer :: ptype(:) ! pft type index - - integer, pointer :: nlev_improad(:) ! number of impervious road layers - real(r8), pointer :: cv_wall(:,:) ! thermal conductivity of urban wall - real(r8), pointer :: cv_roof(:,:) ! thermal conductivity of urban roof - real(r8), pointer :: cv_improad(:,:) ! thermal conductivity of urban impervious road - - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: h2osoi_ice(:,:) ! frozen water (kg/m2) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) - real(r8), pointer :: csol(:,:) ! heat capacity, soil solids (J/m**3/Kelvin) - real(r8), pointer :: dz(:,:) ! layer depth (m) - real(r8), pointer :: wa(:,:) ! h2o in underground aquifer - - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - -!------------------------------------------------------------------------------- -! Note: this routine does not compute heat or water content of lakes. -! -!------------------------------------------------------------------------------- - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ltype => lun%itype - ctype => col%itype - ptype => pft%itype - - nlev_improad => lps%nlev_improad - cv_wall => lps%cv_wall - cv_roof => lps%cv_roof - cv_improad => lps%cv_improad - - snl => cps%snl - watsat => cps%watsat - csol => cps%csol - dz => cps%dz - t_soisno => ces%t_soisno - h2osoi_liq => cws%h2osoi_liq - h2osoi_ice => cws%h2osoi_ice - h2osno => cws%h2osno - - ! Get relevant sizes - - do g = begg,endg ! loop over grid cells - - gcell_liq (g) = 0.0_r8 ! sum for one grid cell - gcell_ice (g) = 0.0_r8 ! sum for one grid cell - gcell_heat (g) = 0.0_r8 ! sum for one grid cell - - li = gptr%luni(g) - lf = gptr%lunf(g) - do l = li,lf ! loop over land units - - ci = lptr%coli(l) - cf = lptr%colf(l) - do c = ci,cf ! loop over columns - - liq = 0.0_r8 ! sum for one column - ice = 0.0_r8 - heat = 0.0_r8 - - !--- water & ice, above ground only --- - if ( (ltype(l) == istsoil .or. ltype(l) == istcrop ) & - .or. (ltype(l) == istwet ) & - .or. (ltype(l) == istice ) & - .or. (ltype(l) == istice_mec ) & - .or. (ltype(l) == isturb .and. ctype(c) == icol_roof ) & - .or. (ltype(l) == isturb .and. ctype(c) == icol_road_imperv) & - .or. (ltype(l) == isturb .and. ctype(c) == icol_road_perv )) then - - if ( snl(c) < 0 ) then - do k = snl(c)+1,0 ! loop over snow layers - liq = liq + cws%h2osoi_liq(c,k) - ice = ice + cws%h2osoi_ice(c,k) - end do - else ! no snow layers exist - ice = ice + cws%h2osno(c) - end if - end if - - !--- water & ice, below ground only --- - if ( (ltype(l) == istsoil .or. ltype(l) == istcrop ) & - .or. (ltype(l) == istwet ) & - .or. (ltype(l) == istice ) & - .or. (ltype(l) == istice_mec ) & - .or. (ltype(l) == isturb .and. ctype(c) == icol_road_perv )) then - do k = 1,nlevgrnd - liq = liq + cws%h2osoi_liq(c,k) - ice = ice + cws%h2osoi_ice(c,k) - end do - end if - - !--- water in aquifer --- - if ( (ltype(l) == istsoil .or. ltype(l) == istcrop ) & - .or. (ltype(l) == istwet ) & - .or. (ltype(l) == istice ) & - .or. (ltype(l) == istice_mec ) & - .or. (ltype(l) == isturb .and. ctype(c) == icol_road_perv )) then - liq = liq + cws%wa(c) - end if - - !--- water in canopy (at pft level) --- - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then ! note: soil specified at LU level - pi = cptr%pfti(c) - pf = cptr%pftf(c) - do p = pi,pf ! loop over pfts - wtcol = pptr%wtcol(p) - liq = liq + pws%h2ocan(p) * wtcol - end do - end if - - if ( (ltype(l) /= istslak) .and. ltype(l) /= istdlak) then - - !--- heat content, below ground only --- - do k = 1,nlevgrnd - if (ctype(c)==icol_sunwall .OR. ctype(c)==icol_shadewall) then - cv = cv_wall(l,k) * dz(c,k) - else if (ctype(c) == icol_roof) then - cv = cv_roof(l,k) * dz(c,k) - else if (ctype(c) == icol_road_imperv .and. k >= 1 .and. k <= nlev_improad(l)) then - cv = cv_improad(l,k) * dz(c,k) - else if (ltype(l) /= istwet .AND. ltype(l) /= istice .AND. ltype(l) /= istice_mec) then - cv = csol(c,k)*(1-watsat(c,k))*dz(c,k) + (h2osoi_ice(c,k)*cpice + h2osoi_liq(c,k)*cpliq) - else - cv = (h2osoi_ice(c,k)*cpice + h2osoi_liq(c,k)*cpliq) - endif - heat = heat + cv*t_soisno(c,k) / 1.e6_r8 - end do - - !--- heat content, above ground only --- - if ( snl(c) < 0 ) then - do k = snl(c)+1,0 ! loop over snow layers - cv = cpliq*h2osoi_liq(c,k) + cpice*h2osoi_ice(c,k) - heat = heat + cv*t_soisno(c,k) / 1.e6_r8 - end do - else if ( h2osno(c) > 0.0_r8) then - k = 1 - cv = cpice*h2osno(c) - heat = heat + cv*t_soisno(c,k) / 1.e6_r8 - end if - - end if - - !--- scale x/m^2 column-level values into x/m^2 gridcell-level values --- - wtgcell = cptr%wtgcell(c) - gcell_liq (g) = gcell_liq (g) + liq * wtgcell - gcell_ice (g) = gcell_ice (g) + ice * wtgcell - gcell_heat (g) = gcell_heat (g) + heat * wtgcell - - end do ! column loop - end do ! landunit loop - end do ! grid cell loop - - end subroutine dynland_hwcontent - -!=============================================================================== - -end module dynlandMod diff --git a/src_clm40/main/fileutils.F90 b/src_clm40/main/fileutils.F90 deleted file mode 100644 index b74af42426..0000000000 --- a/src_clm40/main/fileutils.F90 +++ /dev/null @@ -1,179 +0,0 @@ -module fileutils - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing file I/O utilities - ! - ! !USES: - use shr_sys_mod , only : shr_sys_abort - use clm_varctl , only : iulog - use spmdMod , only : masterproc - ! - ! !PUBLIC TYPES: - implicit none - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: get_filename !Returns filename given full pathname - public :: opnfil !Open local unformatted or formatted file - public :: getfil !Obtain local copy of file - public :: relavu !Close and release Fortran unit no longer in use - public :: getavu !Get next available Fortran unit number - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - character(len=256) function get_filename (fulpath) - ! - ! !DESCRIPTION: - ! Returns filename given full pathname - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fulpath !full pathname - ! - ! !LOCAL VARIABLES: - integer i !loop index - integer klen !length of fulpath character string - !------------------------------------------------------------------------ - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i) == '/') go to 10 - end do - i = 0 -10 get_filename = fulpath(i+1:klen) - - return - end function get_filename - - !------------------------------------------------------------------------ - subroutine getfil (fulpath, locfn, iflag) - ! - ! !DESCRIPTION: - ! Obtain local copy of file - ! First check current working directory - ! Next check full pathname[fulpath] on disk - ! - ! !USES: - use shr_file_mod, only: shr_file_get - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: fulpath !Archival or permanent disk full pathname - character(len=*), intent(out) :: locfn !output local file name - integer, intent(in) :: iflag !0=>abort if file not found 1=>do not abort - ! - ! !LOCAL VARIABLES: - integer i !loop index - integer klen !length of fulpath character string - logical lexist !true if local file exists - !------------------------------------------------------------------------ - - ! get local file name from full name - - locfn = get_filename( fulpath ) - if (len_trim(locfn) == 0) then - if (masterproc) write(iulog,*)'(GETFIL): local filename has zero length' - call shr_sys_abort - else - if (masterproc) write(iulog,*)'(GETFIL): attempting to find local file ', & - trim(locfn) - endif - - ! first check if file is in current working directory. - - inquire (file=locfn,exist=lexist) - if (lexist) then - if (masterproc) write(iulog,*) '(GETFIL): using ',trim(locfn), & - ' in current working directory' - RETURN - endif - - ! second check for full pathname on disk - locfn = fulpath - - inquire (file=fulpath,exist=lexist) - if (lexist) then - if (masterproc) write(iulog,*) '(GETFIL): using ',trim(fulpath) - RETURN - else - if (masterproc) write(iulog,*)'(GETFIL): failed getting file from full path: ', fulpath - if (iflag==0) then - call shr_sys_abort ('GETFIL: FAILED to get '//trim(fulpath)) - else - RETURN - endif - endif - - end subroutine getfil - - !------------------------------------------------------------------------ - subroutine opnfil (locfn, iun, form) - ! - ! !DESCRIPTION: - ! Open file locfn in unformatted or formatted form on unit iun - ! - ! !ARGUMENTS: - character(len=*), intent(in):: locfn !file name - integer, intent(in):: iun !fortran unit number - character(len=1), intent(in):: form !file format: u = unformatted, f = formatted - ! - ! !LOCAL VARIABLES: - integer ioe !error return from fortran open - character(len=11) ft !format type: formatted. unformatted - !------------------------------------------------------------------------ - - if (len_trim(locfn) == 0) then - write(iulog,*)'(OPNFIL): local filename has zero length' - call shr_sys_abort - endif - if (form=='u' .or. form=='U') then - ft = 'unformatted' - else - ft = 'formatted ' - end if - open (unit=iun,file=locfn,status='unknown',form=ft,iostat=ioe) - if (ioe /= 0) then - write(iulog,*)'(OPNFIL): failed to open file ',trim(locfn), & - & ' on unit ',iun,' ierr=',ioe - call shr_sys_abort - else if ( masterproc )then - write(iulog,*)'(OPNFIL): Successfully opened file ',trim(locfn), & - & ' on unit= ',iun - end if - - end subroutine opnfil - - !------------------------------------------------------------------------ - integer function getavu() - ! - ! !DESCRIPTION: - ! Get next available Fortran unit number. - ! - ! !USES: - use shr_file_mod, only : shr_file_getUnit - !------------------------------------------------------------------------ - - getavu = shr_file_getunit() - - end function getavu - - !------------------------------------------------------------------------ - subroutine relavu (iunit) - ! - ! !DESCRIPTION: - ! Close and release Fortran unit no longer in use! - ! - ! !USES: - use shr_file_mod, only : shr_file_freeUnit - ! - ! !ARGUMENTS: - integer, intent(in) :: iunit !Fortran unit number - !------------------------------------------------------------------------ - - close(iunit) - call shr_file_freeUnit(iunit) - - end subroutine relavu - -end module fileutils diff --git a/src_clm40/main/filterMod.F90 b/src_clm40/main/filterMod.F90 deleted file mode 100644 index e3151548a9..0000000000 --- a/src_clm40/main/filterMod.F90 +++ /dev/null @@ -1,390 +0,0 @@ -module filterMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: filterMod -! -! !DESCRIPTION: -! Module of filters used for processing columns and pfts of particular -! types, including lake, non-lake, urban, soil, snow, non-snow, and -! naturally-vegetated patches. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : iulog, use_cndv -! -! !PUBLIC TYPES: - implicit none - save - - private - - type clumpfilter - integer, pointer :: natvegp(:) ! CNDV nat-vegetated (present) filter (pfts) - integer :: num_natvegp ! number of pfts in nat-vegetated filter - - integer, pointer :: pcropp(:) ! prognostic crop filter (pfts) - integer :: num_pcropp ! number of pfts in prognostic crop filter - integer, pointer :: soilnopcropp(:) ! soil w/o prog. crops (pfts) - integer :: num_soilnopcropp ! number of pfts in soil w/o prog crops - - integer, pointer :: lakep(:) ! lake filter (pfts) - integer :: num_lakep ! number of pfts in lake filter - integer, pointer :: nolakep(:) ! non-lake filter (pfts) - integer :: num_nolakep ! number of pfts in non-lake filter - integer, pointer :: lakec(:) ! lake filter (columns) - integer :: num_lakec ! number of columns in lake filter - integer, pointer :: nolakec(:) ! non-lake filter (columns) - integer :: num_nolakec ! number of columns in non-lake filter - - integer, pointer :: soilc(:) ! soil filter (columns) - integer :: num_soilc ! number of columns in soil filter - integer, pointer :: soilp(:) ! soil filter (pfts) - integer :: num_soilp ! number of pfts in soil filter - - integer, pointer :: snowc(:) ! snow filter (columns) - integer :: num_snowc ! number of columns in snow filter - integer, pointer :: nosnowc(:) ! non-snow filter (columns) - integer :: num_nosnowc ! number of columns in non-snow filter - - integer, pointer :: hydrologyc(:) ! hydrology filter (columns) - integer :: num_hydrologyc ! number of columns in hydrology filter - - integer, pointer :: urbanl(:) ! urban filter (landunits) - integer :: num_urbanl ! number of landunits in urban filter - integer, pointer :: nourbanl(:) ! non-urban filter (landunits) - integer :: num_nourbanl ! number of landunits in non-urban filter - - integer, pointer :: urbanc(:) ! urban filter (columns) - integer :: num_urbanc ! number of columns in urban filter - integer, pointer :: nourbanc(:) ! non-urban filter (columns) - integer :: num_nourbanc ! number of columns in non-urban filter - - integer, pointer :: urbanp(:) ! urban filter (pfts) - integer :: num_urbanp ! number of pfts in urban filter - integer, pointer :: nourbanp(:) ! non-urban filter (pfts) - integer :: num_nourbanp ! number of pfts in non-urban filter - - integer, pointer :: nolakeurbanp(:) ! non-lake, non-urban filter (pfts) - integer :: num_nolakeurbanp ! number of pfts in non-lake, non-urban filter - - end type clumpfilter - public clumpfilter - - type(clumpfilter), allocatable, public :: filter(:) -! - public allocFilters ! allocate memory for filters - public setFilters ! set filters -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 11/13/03, Peter Thornton: Added soilp and num_soilp -! Jan/08, S. Levis: Added crop-related filters -! -!EOP -!----------------------------------------------------------------------- - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: allocFilters -! -! !INTERFACE: - subroutine allocFilters() -! -! !DESCRIPTION: -! Allocate CLM filters. -! -! !USES: - use clmtype - use decompMod , only : get_proc_clumps, get_clump_bounds -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 2004.04.27 DGVM naturally-vegetated filter added by Forrest Hoffman -! -!EOP -! -! LOCAL VARAIBLES: - integer :: nc ! clump index - integer :: nclumps ! total number of clumps on this processor - integer :: begp, endp ! per-clump beginning and ending pft indices - integer :: begc, endc ! per-clump beginning and ending column indices - integer :: begl, endl ! per-clump beginning and ending landunit indices - integer :: begg, endg ! per-clump beginning and ending gridcell indices - integer :: ier ! error status -!------------------------------------------------------------------------ - - ! Determine clump variables for this processor - - nclumps = get_proc_clumps() - ier = 0 - if( .not. allocated(filter)) then - allocate(filter(nclumps), stat=ier) - end if - if (ier /= 0) then - write(iulog,*) 'allocFilters(): allocation error for clumpsfilters' - call endrun - end if - - ! Loop over clumps on this processor - - !$OMP PARALLEL DO PRIVATE (nc,begg,endg,begl,endl,begc,endc,begp,endp) - do nc = 1, nclumps - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - allocate(filter(nc)%lakep(endp-begp+1)) - allocate(filter(nc)%nolakep(endp-begp+1)) - allocate(filter(nc)%nolakeurbanp(endp-begp+1)) - - allocate(filter(nc)%lakec(endc-begc+1)) - allocate(filter(nc)%nolakec(endc-begc+1)) - - allocate(filter(nc)%soilc(endc-begc+1)) - allocate(filter(nc)%soilp(endp-begp+1)) - - allocate(filter(nc)%snowc(endc-begc+1)) - allocate(filter(nc)%nosnowc(endc-begc+1)) - - if (use_cndv) then - allocate(filter(nc)%natvegp(endp-begp+1)) - end if - - allocate(filter(nc)%hydrologyc(endc-begc+1)) - - allocate(filter(nc)%urbanp(endp-begp+1)) - allocate(filter(nc)%nourbanp(endp-begp+1)) - - allocate(filter(nc)%urbanc(endc-begc+1)) - allocate(filter(nc)%nourbanc(endc-begc+1)) - - allocate(filter(nc)%urbanl(endl-begl+1)) - allocate(filter(nc)%nourbanl(endl-begl+1)) - - allocate(filter(nc)%pcropp(endp-begp+1)) - allocate(filter(nc)%soilnopcropp(endp-begp+1)) - end do - !$OMP END PARALLEL DO - - end subroutine allocFilters - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: setFilters -! -! !INTERFACE: - subroutine setFilters( nc ) -! -! !DESCRIPTION: -! Set CLM filters. -! -! !USES: - use clmtype - use decompMod , only : get_clump_bounds - use pftvarcon , only : npcropmin - use clm_varcon, only : istsoil, isturb, icol_road_perv, istice_mec - use clm_varcon, only : istcrop -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: nc ! clump index -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 2004.04.27 DGVM naturally-vegetated filter added by Forrest Hoffman -! 2005.09.12 Urban related filters added by Mariana Vertenstein -! -!EOP -! -! LOCAL VARAIBLES: - integer , pointer :: ctype(:) ! column type - integer :: c,l,p ! column, landunit, pft indices - integer :: fl ! lake filter index - integer :: fnl,fnlu ! non-lake filter index - integer :: fs ! soil filter index - integer :: f, fn ! general indices - integer :: begp, endp ! per-clump beginning and ending pft indices - integer :: begc, endc ! per-clump beginning and ending column indices - integer :: begl, endl ! per-clump beginning and ending landunit indices - integer :: begg, endg ! per-clump beginning and ending gridcell indices -!------------------------------------------------------------------------ - - ctype => col%itype - - ! Determine clump boundaries - - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - ! Create lake and non-lake filters at column-level - - fl = 0 - fnl = 0 - do c = begc,endc - l = col%landunit(c) - if (lun%lakpoi(l)) then - fl = fl + 1 - filter(nc)%lakec(fl) = c - else - fnl = fnl + 1 - filter(nc)%nolakec(fnl) = c - end if - end do - filter(nc)%num_lakec = fl - filter(nc)%num_nolakec = fnl - - ! Create lake and non-lake filters at pft-level - ! Filter will only be active if weight of pft wrt gcell is nonzero - - fl = 0 - fnl = 0 - fnlu = 0 - do p = begp,endp - l = pft%landunit(p) - if (pft%wtgcell(p) > 0._r8 & - .or. & - lun%itype(l)==istice_mec) then ! some glacier_mec columns have zero weight - - l = pft%landunit(p) - if (lun%lakpoi(l) ) then - fl = fl + 1 - filter(nc)%lakep(fl) = p - else - fnl = fnl + 1 - filter(nc)%nolakep(fnl) = p - if (lun%itype(l) /= isturb) then - fnlu = fnlu + 1 - filter(nc)%nolakeurbanp(fnlu) = p - end if - end if - end if - end do - filter(nc)%num_lakep = fl - filter(nc)%num_nolakep = fnl - filter(nc)%num_nolakeurbanp = fnlu - - ! Create soil filter at column-level - - fs = 0 - do c = begc,endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fs = fs + 1 - filter(nc)%soilc(fs) = c - end if - end do - filter(nc)%num_soilc = fs - - ! Create soil filter at pft-level - ! Filter will only be active if weight of pft wrt gcell is nonzero - - fs = 0 - do p = begp,endp - if (pft%wtgcell(p) > 0._r8) then - l = pft%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fs = fs + 1 - filter(nc)%soilp(fs) = p - end if - end if - end do - filter(nc)%num_soilp = fs - - ! Create column-level hydrology filter (soil and Urban pervious road cols) - - f = 0 - do c = begc,endc - l = col%landunit(c) - if (lun%itype(l) == istsoil .or. ctype(c) == icol_road_perv .or. & - lun%itype(l) == istcrop) then - f = f + 1 - filter(nc)%hydrologyc(f) = c - end if - end do - filter(nc)%num_hydrologyc = f - - ! Create prognostic crop and soil w/o prog. crop filters at pft-level - ! according to where the crop model should be used - - fl = 0 - fnl = 0 - do p = begp,endp - if (pft%wtgcell(p) > 0._r8) then - if (pft%itype(p) >= npcropmin) then !skips 2 generic crop types - fl = fl + 1 - filter(nc)%pcropp(fl) = p - else - l = pft%landunit(p) - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - fnl = fnl + 1 - filter(nc)%soilnopcropp(fnl) = p - end if - end if - end if - end do - filter(nc)%num_pcropp = fl - filter(nc)%soilnopcropp = fnl ! This wasn't being set before... - - ! Create landunit-level urban and non-urban filters - - f = 0 - fn = 0 - do l = begl,endl - if (lun%itype(l) == isturb) then - f = f + 1 - filter(nc)%urbanl(f) = l - else - fn = fn + 1 - filter(nc)%nourbanl(fn) = l - end if - end do - filter(nc)%num_urbanl = f - filter(nc)%num_nourbanl = fn - - ! Create column-level urban and non-urban filters - - f = 0 - fn = 0 - do c = begc,endc - l = col%landunit(c) - if (lun%itype(l) == isturb) then - f = f + 1 - filter(nc)%urbanc(f) = c - else - fn = fn + 1 - filter(nc)%nourbanc(fn) = c - end if - end do - filter(nc)%num_urbanc = f - filter(nc)%num_nourbanc = fn - - ! Create pft-level urban and non-urban filters - - f = 0 - fn = 0 - do p = begp,endp - l = pft%landunit(p) - if (lun%itype(l) == isturb .and. pft%wtgcell(p) > 0._r8) then - f = f + 1 - filter(nc)%urbanp(f) = p - else - fn = fn + 1 - filter(nc)%nourbanp(fn) = p - end if - end do - filter(nc)%num_urbanp = f - filter(nc)%num_nourbanp = fn - - ! Note: snow filters are reconstructed each time step in Hydrology2 - ! Note: CNDV "pft present" filter is reconstructed each time CNDV is run - - end subroutine setFilters - -end module filterMod diff --git a/src_clm40/main/findHistFields.pl b/src_clm40/main/findHistFields.pl deleted file mode 100755 index d9e39946e5..0000000000 --- a/src_clm40/main/findHistFields.pl +++ /dev/null @@ -1,265 +0,0 @@ -#!/usr/bin/env perl -# -# This perl script reads in the histFldsMod.F90 file to find the total list of history -# fields that can be added for this model version, regardless of namelist options, or -# CPP processing. -# -use strict; -#use warnings; -#use diagnostics; - -use Cwd; -use English; -use Getopt::Long; -use IO::File; -use File::Glob ':glob'; - -# Set the directory that contains the CLM configuration scripts. If the command was -# issued using a relative or absolute path, that path is in $ProgDir. Otherwise assume -# the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $cmdline = "@ARGV"; # Command line arguments to script -my $cwd = getcwd(); # current working directory -my $cfgdir; # absolute pathname of directory that contains this script -my $nm = "${ProgName}::"; # name to use if script dies -if ($ProgDir) { - $cfgdir = $ProgDir; -} else { - $cfgdir = $cwd; -} -# The namelist definition file contains entries for all namelist variables that -# can be output by build-namelist. -my $nl_definition_file = "$cfgdir/../../bld/namelist_files/namelist_definition_clm4_0.xml"; -(-f "$nl_definition_file") or die <<"EOF"; -** $ProgName - Cannot find namelist definition file \"$nl_definition_file\" ** -EOF -print "Using namelist definition file $nl_definition_file\n"; - -# The Build::NamelistDefinition module provides utilities to get the list of -# megan compounds - -#The root directory to cesm utils Tools -my $cesm_tools = "$cfgdir/../../../../cime/utils"; - -(-f "$cesm_tools/perl5lib/Build/NamelistDefinition.pm") or die <<"EOF"; -** $ProgName - Cannot find perl module \"Build/NamelistDefinition.pm\" in directory - \"$cesm_tools/perl5lib\" ** -EOF -# Add $cfgdir/perl5lib to the list of paths that Perl searches for modules -my @dirs = ( $cfgdir, "$cesm_tools/perl5lib"); -unshift @INC, @dirs; -require Build::NamelistDefinition; -# Create a namelist definition object. This object provides a method for verifying that -# the -# output namelist variables are in the definition file, and are output in the correct -# namelist groups. -my $definition = Build::NamelistDefinition->new($nl_definition_file); - - -my $mxname = 0; -my $mxlongn = 0; -my %fields; -my $fldnamevar = "fieldname_var"; - -sub matchKeyword { -# -# Match a keyword -# - my $keyword = shift; - my $line = shift; - my $fh = shift; - - my $match = undef; - if ( $line =~ /$keyword/ ) { - if ( $line =~ /$keyword\s*=\s*['"]([^'"]+)['"]/ ) { - $match = $1; - } elsif ( $line =~ /$keyword\s*=\s*&\s*$/ ) { - $line = <$fh>; - if ( $line =~ /^\s*['"]([^'"]+)['"]/ ) { - $match = $1; - } else { - die "ERROR: Trouble getting keyword string\n Line: $line"; - } - } else { - if ( $line =~ /fname\s*=\s*fieldname/ ) { - print STDERR "Found variable used for fieldname = $line\n"; - $match = $fldnamevar; - } elsif ( $line =~ /fname\s*=\s*trim\(fname\)/ ) { - $match = undef; - } elsif ( $line =~ /units\s*=\s*units/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*long_name/ ) { - $match = undef; - } elsif ( $line =~ /long_name\s*=\s*longname/ ) { - print STDERR "Found variable used for longname = $line\n"; - $match = "longname_var"; - } else { - die "ERROR: Still have a match on $keyword\n Line: $line"; - } - } - } - return( $match ); -} - -sub getFieldInfo { -# -# Get field Information -# - my $fh = shift; - my $line = shift; - - my $fname = undef; - my $units = undef; - my $longn = undef; - my $endin = undef; - do { - if ( $line =~ /MEG_/ ) { - $line =~ s|'//'_'|_'|g; - $line =~ s|'//trim\(meg_cmp\%name\)|megancmpd'|gi; - if ( $line =~ /meg_cmp\%name/ ) { - die "ERROR: Still have meg_cmp in a line\n"; - } - } - if ( ! defined($fname) ) { - $fname = &matchKeyword( "fname", $line, $fh ); - } - if ( ! defined($units) ) { - $units = &matchKeyword( "units", $line, $fh ); - } - if ( ! defined($longn) ) { - $longn = &matchKeyword( "long_name", $line, $fh ); - } - if ( $line =~ /\)\s*$/ ) { - $endin = 1; - } - if ( ! defined($endin) ) { $line = <$fh>; } - - } until( (defined($fname) && defined($units) && defined($longn)) || - ! defined($line) || defined($endin) ); - if ( ! defined($fname) ) { - die "ERROR: name undefined for field ending with: $line\n"; - } - return( $fname, $longn, $units ); -} - -sub setField { -# -# Set the field -# - my $name = shift; - my $longn = shift; - my $units = shift; - - if ( defined($name) && $name ne $fldnamevar ) { - if ( length($name) > $mxname ) { $mxname = length($name); } - if ( length($longn) > $mxlongn ) { $mxlongn = length($longn); } - my $len; - if ( length($longn) > 90 ) { - $len = 110; - } elsif ( length($longn) > 60 ) { - $len = 90; - } else { - $len = 60; - } - $fields{$name} = sprintf( "%-${len}s\t(%s)", $longn, $units ); - } -} - -sub XML_Header { -# -# Write out header to history fields file -# - my $outfh = shift; - my $outfilename = shift; - my $filename = shift; - - print STDERR " Write out header to history fields file to: $outfilename\n"; - my $svnurl = '$URL$'; - my $svnid = '$Id$'; - print $outfh <<"EOF"; - - -\<\?xml-stylesheet type="text\/xsl" href="history_fields.xsl"\?\> - -\<\!-- - List of history file field names, long-names and units for all the fields output - by CLM. This was created by reading in the file: $filename - SVN version information: - $svnurl - $svnid ---\> - -\ -EOF -} - -sub XML_Footer { -# -# Write out footer to history fields file -# - my $outfh = shift; - - print STDERR " Write out footer to history fields file\n"; - print $outfh "\n\n"; -} - -my $pwd = `pwd`; -chomp( $pwd ); -my $filename = "$pwd/histFldsMod.F90"; - -my $fh = IO::File->new($filename, '<') or die "** $ProgName - can't open history Fields file: $filename\n"; -my @megcmpds = $definition->get_valid_values( "megan_cmpds", 'noquotes'=>1 ); -# -# Read in the list of fields from the source file -# And output to an XML file -# -my $outfilename = "$pwd/../../bld/namelist_files/history_fields_clm4_0.xml"; - -my $outfh = IO::File->new($outfilename, '>') or die "** $ProgName - can't open output history Fields XML file: $outfilename\n"; -&XML_Header( $outfh, $outfilename, $filename ); -while (my $line = <$fh>) { - - # Comments - if ($line =~ /(.*)\!/) { - $line = $1; - } - my $format = "\n\n"; - if ($line =~ /call\s*hist_addfld/i ) { - (my $name, my $longn, my $units) = &getFieldInfo( $fh, $line ); - if ( $name ne "MEG_megancmpd" ) { - &setField( $name, $longn, $units ); - printf( $outfh $format, $name, $units, $longn ); - } else { - foreach my $megcmpd ( @megcmpds ) { - my $name = "MEG_${megcmpd}"; - &setField( $name, $longn, $units ); - printf( $outfh $format, $name, $units, $longn ); - } - } - } -} -close( $fh ); -&XML_Footer( $outfh ); -close( $outfh ); -print STDERR " mxname = $mxname\n"; -print STDERR " mxlongn = $mxlongn\n"; - -# -# List the fields in a neatly ordered list -# -foreach my $name ( sort(keys(%fields)) ) { - my $len; - if ( length($name) > 20 ) { - $len = 40; - } else { - $len = 20; - } - printf( "%-${len}s = %s\n", $name, $fields{$name} ); -} - diff --git a/src_clm40/main/getdatetime.F90 b/src_clm40/main/getdatetime.F90 deleted file mode 100644 index 4126d807e4..0000000000 --- a/src_clm40/main/getdatetime.F90 +++ /dev/null @@ -1,53 +0,0 @@ -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: getdatetime -! -! !INTERFACE: -subroutine getdatetime (cdate, ctime) -! -! !DESCRIPTION: -! A generic Date and Time routine -! -! !USES: - use spmdMod , only : mpicom, masterproc, MPI_CHARACTER -! !ARGUMENTS: - implicit none - character(len=8), intent(out) :: cdate !current date - character(len=8), intent(out) :: ctime !current time -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=8) :: date !current date - character(len=10) :: time !current time - character(len=5) :: zone !zone - integer, dimension(8) :: values !temporary - integer :: ier !MPI error code -!----------------------------------------------------------------------- - if (masterproc) then - - call date_and_time (date, time, zone, values) - - cdate(1:2) = date(5:6) - cdate(3:3) = '/' - cdate(4:5) = date(7:8) - cdate(6:6) = '/' - cdate(7:8) = date(3:4) - - ctime(1:2) = time(1:2) - ctime(3:3) = ':' - ctime(4:5) = time(3:4) - ctime(6:6) = ':' - ctime(7:8) = time(5:6) - - endif - - call mpi_bcast (cdate,len(cdate),MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (ctime,len(ctime),MPI_CHARACTER, 0, mpicom, ier) - - return -end subroutine getdatetime diff --git a/src_clm40/main/histFileMod.F90 b/src_clm40/main/histFileMod.F90 deleted file mode 100644 index e73972cbc5..0000000000 --- a/src_clm40/main/histFileMod.F90 +++ /dev/null @@ -1,4497 +0,0 @@ -module histFileMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: histFileMod -! -! !DESCRIPTION: -! Module containing methods to for CLM history file handling. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use shr_sys_mod , only : shr_sys_flush - use abortutils , only : endrun - use clm_varcon , only : spval,ispval - use clm_varctl , only : iulog - use clmtype - use decompMod , only : get_proc_bounds, get_proc_global - use ncdio_pio - implicit none - save - private - -! -! !PUBLIC TYPES: -! -! Constants -! - integer , public, parameter :: max_tapes = 6 ! max number of history tapes - integer , public, parameter :: max_flds = 1500 ! max number of history fields - integer , public, parameter :: max_namlen = 32 ! maximum number of characters for field name -! -! Counters -! - integer , public :: ntapes = 0 ! index of max history file requested -! -! Namelist -! - integer :: ni ! implicit index below - logical, public :: & - hist_empty_htapes = .false. ! namelist: flag indicates no default history fields - integer, public :: & - hist_ndens(max_tapes) = 2 ! namelist: output density of netcdf history files - integer, public :: & - hist_mfilt(max_tapes) = 30 ! namelist: number of time samples per tape - logical, public :: & - hist_dov2xy(max_tapes) = (/.true.,(.true.,ni=2,max_tapes)/) ! namelist: true=> do grid averaging - integer, public :: & - hist_nhtfrq(max_tapes) = (/0, (-24, ni=2,max_tapes)/) ! namelist: history write freq(0=monthly) - character(len=1), public :: & - hist_avgflag_pertape(max_tapes) = (/(' ',ni=1,max_tapes)/) ! namelist: per tape averaging flag - character(len=max_namlen), public :: & - hist_type1d_pertape(max_tapes) = (/(' ',ni=1,max_tapes)/) ! namelist: per tape type1d - - character(len=max_namlen+2), public :: & - fincl(max_flds,max_tapes) ! namelist-equivalence list of fields to add - - character(len=max_namlen+2), public :: & - hist_fincl1(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl2(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl3(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl4(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl5(max_flds) = ' ' ! namelist: list of fields to add - character(len=max_namlen+2), public :: & - hist_fincl6(max_flds) = ' ' ! namelist: list of fields to add - - character(len=max_namlen+2), public :: & - fexcl(max_flds,max_tapes) ! namelist-equivalence list of fields to remove - - character(len=max_namlen+2), public :: & - hist_fexcl1(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl2(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl3(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl4(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl5(max_flds) = ' ' ! namelist: list of fields to remove - character(len=max_namlen+2), public :: & - hist_fexcl6(max_flds) = ' ' ! namelist: list of fields to remove -! -! Restart -! - logical, private :: if_disphist(max_tapes) ! true => save history file -! -! !PUBLIC MEMBER FUNCTIONS: - public :: hist_addfld1d ! Add a 1d single-level field to the master field list - public :: hist_addfld2d ! Add a 2d multi-level field to the master field list - public :: hist_add_subscript ! Add a 2d subscript dimension - public :: hist_printflds ! Print summary of master field list - public :: hist_htapes_build ! Initialize history file handler for initial or continue run - public :: hist_update_hbuf ! Updates history buffer for all fields and tapes - public :: hist_htapes_wrapup ! Write history tape(s) - public :: hist_restart_ncd ! Read/write history file restart data - public :: htapes_fieldlist ! Define the contents of each history file based on namelist -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE MEMBER FUNCTIONS: - private :: masterlist_make_active ! Add a field to a history file default "on" list - private :: masterlist_addfld ! Add a field to the master field list - private :: masterlist_change_timeavg ! Override default history tape contents for specific tape - private :: htape_addfld ! Add a field to the active list for a history tape - private :: htape_create ! Define contents of history file t - private :: htape_timeconst ! Write time constant values to history tape - private :: htape_timeconst3D ! Write time constant 3D values to primary history tape - private :: hfields_normalize ! Normalize history file fields by number of accumulations - private :: hfields_zero ! Zero out accumulation and hsitory buffers for a tape - private :: hfields_write ! Write a variable to a history tape - private :: hfields_1dinfo ! Define/output 1d subgrid info if appropriate - private :: hist_update_hbuf_field_1d ! Updates history buffer for specific field and tape - private :: hist_update_hbuf_field_2d ! Updates history buffer for specific field and tape - private :: list_index ! Find index of field in exclude list - private :: set_hist_filename ! Determine history dataset filenames - private :: getname ! Retrieve name portion of input "inname" - private :: getflag ! Retrieve flag - private :: pointer_index ! Track data pointer indices - private :: max_nFields ! The max number of fields on any tape - -! !PRIVATE TYPES: -! Constants -! - integer, parameter :: max_chars = 128 ! max chars for char variables -! -! Subscript dimensions -! - integer, parameter :: max_subs = 100 ! max number of subscripts - integer :: num_subs = 0 ! actual number of subscripts - character(len=32) :: subs_name(max_subs) ! name of subscript - integer :: subs_dim(max_subs) ! dimension of subscript -! -! Derived types -! - type field_info - character(len=max_namlen) :: name ! field name - character(len=max_chars) :: long_name ! long name - character(len=max_chars) :: units ! units - character(len=8) :: type1d ! clm pointer first dimension type - ! from clmtype (nameg, etc) - character(len=8) :: type1d_out ! hbuf first dimension type - ! from clmtype (nameg, etc) - character(len=8) :: type2d ! hbuf second dimension type - ! ["levgrnd","levlak","numrad","glc_nec","subname(n)"] - integer :: beg1d ! on-node 1d clm pointer start index - integer :: end1d ! on-node 1d clm pointer end index - integer :: num1d ! size of clm pointer first dimension (all nodes) - integer :: beg1d_out ! on-node 1d hbuf pointer start index - integer :: end1d_out ! on-node 1d hbuf pointer end index - integer :: num1d_out ! size of hbuf first dimension (all nodes) - integer :: num2d ! size of hbuf second dimension (e.g. number of vertical levels) - integer :: hpindex ! history pointer index - character(len=8) :: p2c_scale_type ! scale factor when averaging pft to column - character(len=8) :: c2l_scale_type ! scale factor when averaging column to landunit - character(len=8) :: l2g_scale_type ! scale factor when averaging landunit to gridcell - end type field_info - - type master_entry - type (field_info) :: field ! field information - logical :: actflag(max_tapes) ! active/inactive flag - character(len=1) :: avgflag(max_tapes) ! time averaging flag ("X","A","M" or "I",) - end type master_entry - - type history_entry - type (field_info) :: field ! field information - character(len=1) :: avgflag ! time averaging flag - real(r8), pointer :: hbuf(:,:) ! history buffer (dimensions: dim1d x num2d) - integer , pointer :: nacs(:,:) ! accumulation counter (dimensions: dim1d x num2d) - end type history_entry - - type history_tape - integer :: nflds ! number of active fields on tape - integer :: ntimes ! current number of time samples on tape - integer :: mfilt ! maximum number of time samples per tape - integer :: nhtfrq ! number of time samples per tape - integer :: ncprec ! netcdf output precision - logical :: dov2xy ! true => do xy average for all fields - logical :: is_endhist ! true => current time step is end of history interval - real(r8) :: begtime ! time at beginning of history averaging interval - type (history_entry) :: hlist(max_flds) ! array of active history tape entries - end type history_tape - - type clmpoint_rs ! Pointer to real scalar data (1D) - real(r8), pointer :: ptr(:) - end type clmpoint_rs - type clmpoint_ra ! Pointer to real array data (2D) - real(r8), pointer :: ptr(:,:) - end type clmpoint_ra -!EOP -! -! Pointers into clmtype arrays -! - integer, parameter :: max_mapflds = 1500 ! Maximum number of fields to track - type (clmpoint_rs) :: clmptr_rs(max_mapflds) ! Real scalar data (1D) - type (clmpoint_ra) :: clmptr_ra(max_mapflds) ! Real array data (2D) -! -! Master list: an array of master_entry entities -! - type (master_entry) :: masterlist(max_flds) ! master field list -! -! History tape: an array of history_tape entities (only active fields) -! - type (history_tape) :: tape(max_tapes) ! array history tapes -! -! Namelist input -! -! Counters -! - integer :: nfmaster = 0 ! number of fields in master field list -! -! Other variables -! - character(len=max_chars) :: locfnh(max_tapes) ! local history file names - character(len=max_chars) :: locfnhr(max_tapes) ! local history restart file names - logical :: htapes_defined = .false. ! flag indicates history contents have been defined -! -! NetCDF Id's -! - type(file_desc_t) :: nfid(max_tapes) ! file ids - type(file_desc_t) :: ncid_hist(max_tapes) ! file ids for history restart files - integer :: time_dimid ! time dimension id - integer :: hist_interval_dimid ! time bounds dimension id - integer :: strlen_dimid ! string dimension id - -! -! Time Constant variable names and filename -! - character(len=max_chars) :: TimeConst3DVars_Filename = ' ' - character(len=max_chars) :: TimeConst3DVars = ' ' -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_printflds -! -! !INTERFACE: - subroutine hist_printflds() -! -! !DESCRIPTION: -! Print summary of master field list. -! -! !USES: -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 03/2003 -! -! -! !LOCAL VARIABLES: -!EOP - integer nf - character(len=*),parameter :: subname = 'CLM_hist_printflds' -!----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) trim(subname),' : number of master fields = ',nfmaster - write(iulog,*)' ******* MASTER FIELD LIST *******' - do nf = 1,nfmaster - write(iulog,9000)nf, masterlist(nf)%field%name, masterlist(nf)%field%units -9000 format (i5,1x,a32,1x,a16) - end do - call shr_sys_flush(iulog) - end if - - end subroutine hist_printflds - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: masterlist_addfld -! -! !INTERFACE: - subroutine masterlist_addfld (fname, type1d, type1d_out, & - type2d, num2d, units, avgflag, long_name, hpindex, & - p2c_scale_type, c2l_scale_type, l2g_scale_type) -! -! !DESCRIPTION: -! Add a field to the master field list. Put input arguments of -! field name, units, number of levels, averaging flag, and long name -! into a type entry in the global master field list (masterlist). -! -! !USES: -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type1d ! 1d data type - character(len=*), intent(in) :: type1d_out ! 1d output type - character(len=*), intent(in) :: type2d ! 2d output type - integer , intent(in) :: num2d ! size of second dimension (e.g. number of vertical levels) - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - integer , intent(in) :: hpindex ! clmtype index for history buffer output - character(len=*), intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n ! loop index - integer :: f ! masterlist index - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - character(len=*),parameter :: subname = 'masterlist_addfld' -!------------------------------------------------------------------------ - - ! Determine bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - ! Ensure that new field is not all blanks - - if (fname == ' ') then - write(iulog,*) trim(subname),' ERROR: blank field name not allowed' - call endrun() - end if - - ! Ensure that new field doesn't already exist - - do n = 1,nfmaster - if (masterlist(n)%field%name == fname) then - write(iulog,*) trim(subname),' ERROR:', fname, ' already on list' - call endrun() - end if - end do - - ! Increase number of fields on master field list - - nfmaster = nfmaster + 1 - f = nfmaster - - ! Check number of fields in master list against maximum number for master list - - if (nfmaster > max_flds) then - write(iulog,*) trim(subname),' ERROR: too many fields for primary history file ', & - '-- max_flds,nfmaster=', max_flds, nfmaster - call endrun() - end if - - ! Add field to master list - - masterlist(f)%field%name = fname - masterlist(f)%field%long_name = long_name - masterlist(f)%field%units = units - masterlist(f)%field%type1d = type1d - masterlist(f)%field%type1d_out = type1d_out - masterlist(f)%field%type2d = type2d - masterlist(f)%field%num2d = num2d - masterlist(f)%field%hpindex = hpindex - masterlist(f)%field%p2c_scale_type = p2c_scale_type - masterlist(f)%field%c2l_scale_type = c2l_scale_type - masterlist(f)%field%l2g_scale_type = l2g_scale_type - - select case (type1d) - case (grlnd) - masterlist(f)%field%beg1d = begg - masterlist(f)%field%end1d = endg - masterlist(f)%field%num1d = numg - case (nameg) - masterlist(f)%field%beg1d = begg - masterlist(f)%field%end1d = endg - masterlist(f)%field%num1d = numg - case (namel) - masterlist(f)%field%beg1d = begl - masterlist(f)%field%end1d = endl - masterlist(f)%field%num1d = numl - case (namec) - masterlist(f)%field%beg1d = begc - masterlist(f)%field%end1d = endc - masterlist(f)%field%num1d = numc - case (namep) - masterlist(f)%field%beg1d = begp - masterlist(f)%field%end1d = endp - masterlist(f)%field%num1d = nump - case default - write(iulog,*) trim(subname),' ERROR: unknown 1d output type= ',type1d - call endrun() - end select - - ! The following two fields are used only in master field list, - ! NOT in the runtime active field list - ! ALL FIELDS IN THE MASTER LIST ARE INITIALIZED WITH THE ACTIVE - ! FLAG SET TO FALSE - - masterlist(f)%avgflag(:) = avgflag - masterlist(f)%actflag(:) = .false. - - end subroutine masterlist_addfld - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_htapes_build -! -! !INTERFACE: - subroutine hist_htapes_build () -! -! !DESCRIPTION: -! Initialize history file for initial or continuation run. For example, -! on an initial run, this routine initializes ``ntapes'' history files. -! On a restart run, this routine only initializes history files declared -! beyond what existed on the previous run. Files which already existed on -! the previous run have already been initialized (i.e. named and opened) -! in routine restart\_history. Loop over tapes and fields per tape setting -! appropriate variables and calling appropriate routines -! -! !USES: - use clm_time_manager, only: get_prev_time - use clm_varcon , only: secspday -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i ! index - integer :: ier ! error code - integer :: t, f ! tape, field indices - integer :: day, sec ! day and seconds from base date - character(len=*),parameter :: subname = 'hist_htapes_build' -!----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) trim(subname),' Initializing clm2 history files' - write(iulog,'(72a1)') ("-",i=1,60) - call shr_sys_flush(iulog) - endif - - ! Define field list information for all history files. - ! Update ntapes to reflect number of active history files - ! Note - branch runs can have additional auxiliary history files - ! declared). - - call htapes_fieldlist() - - ! Determine if gridcell (xy) averaging is done for all fields on tape - - do t=1,ntapes - tape(t)%dov2xy = hist_dov2xy(t) - write(iulog,*)trim(subname),' hist tape = ',t,& - ' written with dov2xy= ',tape(t)%dov2xy - end do - - ! Set number of time samples in each history file and - ! Note - the following entries will be overwritten by history restart - ! Note - with netcdf, only 1 (ncd_double) and 2 (ncd_float) are allowed - - do t=1,ntapes - tape(t)%ntimes = 0 - tape(t)%dov2xy = hist_dov2xy(t) - tape(t)%nhtfrq = hist_nhtfrq(t) - tape(t)%mfilt = hist_mfilt(t) - if (hist_ndens(t) == 1) then - tape(t)%ncprec = ncd_double - else - tape(t)%ncprec = ncd_float - endif - end do - - ! Set time of beginning of current averaging interval - ! First etermine elapased time since reference date - - call get_prev_time(day, sec) - do t=1,ntapes - tape(t)%begtime = day + sec/secspday - end do - - if (masterproc) then - write(iulog,*) trim(subname),' Successfully initialized clm2 history files' - write(iulog,'(72a1)') ("-",i=1,60) - call shr_sys_flush(iulog) - endif - - end subroutine hist_htapes_build - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: masterlist_make_active -! -! !INTERFACE: - subroutine masterlist_make_active (name, tape_index, avgflag) -! -! !DESCRIPTION: -! Add a field to the default ``on'' list for a given history file. -! Also change the default time averaging flag if requested. -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name ! field name - integer, intent(in) :: tape_index ! history tape index - character(len=1), intent(in), optional :: avgflag ! time averaging flag -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - logical :: found ! flag indicates field found in masterlist - character(len=*),parameter :: subname = 'masterlist_make_active' -!----------------------------------------------------------------------- - - ! Check validity of input arguments - - if (tape_index > max_tapes) then - write(iulog,*) trim(subname),' ERROR: tape index=', tape_index, ' is too big' - call endrun() - end if - - if (present(avgflag)) then - if ( avgflag /= ' ' .and. & - avgflag /= 'A' .and. avgflag /= 'I' .and. & - avgflag /= 'X' .and. avgflag /= 'M') then - write(iulog,*) trim(subname),' ERROR: unknown averaging flag=', avgflag - call endrun() - endif - end if - - ! Look through master list for input field name. - ! When found, set active flag for that tape to true. - ! Also reset averaging flag if told to use other than default. - - found = .false. - do f = 1,nfmaster - if (trim(name) == trim(masterlist(f)%field%name)) then - masterlist(f)%actflag(tape_index) = .true. - if (present(avgflag)) then - if (avgflag/= ' ') masterlist(f)%avgflag(tape_index) = avgflag - end if - found = .true. - exit - end if - end do - if (.not. found) then - write(iulog,*) trim(subname),' ERROR: field=', name, ' not found' - call endrun() - end if - - end subroutine masterlist_make_active - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: masterlist_change_timeavg -! -! !INTERFACE: - subroutine masterlist_change_timeavg (t) -! -! !DESCRIPTION: -! Override default history tape contents for a specific tape. -! Copy the flag into the master field list. -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! history tape index -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - character(len=1) :: avgflag ! lcl equiv of hist_avgflag_pertape(t) - character(len=*),parameter :: subname = 'masterlist_change_timeavg' -!----------------------------------------------------------------------- - - avgflag = hist_avgflag_pertape(t) - - do f = 1,nfmaster - select case (avgflag) - case ('A') - masterlist(f)%avgflag(t) = avgflag - case ('I') - masterlist(f)%avgflag(t) = avgflag - case ('X') - masterlist(f)%avgflag(t) = avgflag - case ('M') - masterlist(f)%avgflag(t) = avgflag - case default - write(iulog,*) trim(subname),' ERROR: unknown avgflag=',avgflag - call endrun () - end select - end do - - end subroutine masterlist_change_timeavg - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: htapes_fieldlist -! -! !INTERFACE: - subroutine htapes_fieldlist() -! -! !DESCRIPTION: -! Define the contents of each history file based on namelist -! input for initial or branch run, and restart data if a restart run. -! Use arrays fincl and fexcl to modify default history tape contents. -! Then sort the result alphanumerically. -! -! !USES: -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: t, f ! tape, field indices - integer :: ff ! index into include, exclude and fprec list - character(len=max_namlen) :: name ! field name portion of fincl (i.e. no avgflag separator) - character(len=max_namlen) :: mastername ! name from masterlist field - character(len=1) :: avgflag ! averaging flag - character(len=1) :: prec_acc ! history buffer precision flag - character(len=1) :: prec_wrt ! history buffer write precision flag - type (history_entry) :: tmp ! temporary used for swapping - character(len=*),parameter :: subname = 'htapes_fieldlist' -!----------------------------------------------------------------------- - - ! Override averaging flag for all fields on a particular tape - ! if namelist input so specifies - - do t=1,max_tapes - if (hist_avgflag_pertape(t) /= ' ') then - call masterlist_change_timeavg (t) - end if - end do - - fincl(:,1) = hist_fincl1(:) - fincl(:,2) = hist_fincl2(:) - fincl(:,3) = hist_fincl3(:) - fincl(:,4) = hist_fincl4(:) - fincl(:,5) = hist_fincl5(:) - fincl(:,6) = hist_fincl6(:) - - fexcl(:,1) = hist_fexcl1(:) - fexcl(:,2) = hist_fexcl2(:) - fexcl(:,3) = hist_fexcl3(:) - fexcl(:,4) = hist_fexcl4(:) - fexcl(:,5) = hist_fexcl5(:) - fexcl(:,6) = hist_fexcl6(:) - - - ! First ensure contents of fincl and fexcl are valid names - - do t = 1,max_tapes - f = 1 - do while (f < max_flds .and. fincl(f,t) /= ' ') - name = getname (fincl(f,t)) - do ff = 1,nfmaster - mastername = masterlist(ff)%field%name - if (name == mastername) exit - end do - if (name /= mastername) then - write(iulog,*) trim(subname),' ERROR: ', trim(name), ' in fincl(', f, ') ',& - 'for history tape ',t,' not found' - call endrun() - end if - f = f + 1 - end do - - f = 1 - do while (f < max_flds .and. fexcl(f,t) /= ' ') - do ff = 1,nfmaster - mastername = masterlist(ff)%field%name - if (fexcl(f,t) == mastername) exit - end do - if (fexcl(f,t) /= mastername) then - write(iulog,*) trim(subname),' ERROR: ', fexcl(f,t), ' in fexcl(', f, ') ', & - 'for history tape ',t,' not found' - call endrun() - end if - f = f + 1 - end do - end do - - tape(:)%nflds = 0 - do t = 1,max_tapes - - ! Loop through the masterlist set of field names and determine if any of those - ! are in the FINCL or FEXCL arrays - ! The call to list_index determines the index in the FINCL or FEXCL arrays - ! that the masterlist field corresponds to - ! Add the field to the tape if specified via namelist (FINCL[1-max_tapes]), - ! or if it is on by default and was not excluded via namelist (FEXCL[1-max_tapes]). - - do f = 1,nfmaster - mastername = masterlist(f)%field%name - call list_index (fincl(1,t), mastername, ff) - - if (ff > 0) then - - ! if field is in include list, ff > 0 and htape_addfld - ! will not be called for field - - avgflag = getflag (fincl(ff,t)) - call htape_addfld (t, f, avgflag) - - else if (.not. hist_empty_htapes) then - - ! find index of field in exclude list - - call list_index (fexcl(1,t), mastername, ff) - - ! if field is in exclude list, ff > 0 and htape_addfld - ! will not be called for field - ! if field is not in exclude list, ff =0 and htape_addfld - ! will be called for field (note that htape_addfld will be - ! called below only if field is not in exclude list OR in - ! include list - - if (ff == 0 .and. masterlist(f)%actflag(t)) then - call htape_addfld (t, f, ' ') - end if - - end if - end do - - ! Specification of tape contents now complete. - ! Sort each list of active entries - - do f = tape(t)%nflds-1,1,-1 - do ff = 1,f - if (tape(t)%hlist(ff)%field%name > tape(t)%hlist(ff+1)%field%name) then - - tmp = tape(t)%hlist(ff) - tape(t)%hlist(ff ) = tape(t)%hlist(ff+1) - tape(t)%hlist(ff+1) = tmp - - else if (tape(t)%hlist(ff)%field%name == tape(t)%hlist(ff+1)%field%name) then - - write(iulog,*) trim(subname),' ERROR: Duplicate field ', & - tape(t)%hlist(ff)%field%name, & - 't,ff,name=',t,ff,tape(t)%hlist(ff+1)%field%name - call endrun() - - end if - end do - end do - - if (masterproc) then - if (tape(t)%nflds > 0) then - write(iulog,*) trim(subname),' : Included fields tape ',t,'=',tape(t)%nflds - end if - do f = 1,tape(t)%nflds - write(iulog,*) f,' ',tape(t)%hlist(f)%field%name, & - tape(t)%hlist(f)%field%num2d,' ',tape(t)%hlist(f)%avgflag - end do - call shr_sys_flush(iulog) - end if - end do - - ! Determine total number of active history tapes - - ntapes = 0 - do t = max_tapes,1,-1 - if (tape(t)%nflds > 0) then - ntapes = t - exit - end if - end do - - ! Ensure there are no "holes" in tape specification, i.e. empty tapes. - ! Enabling holes should not be difficult if necessary. - - do t = 1,ntapes - if (tape(t)%nflds == 0) then - write(iulog,*) trim(subname),' ERROR: Tape ',t,' is empty' - call endrun() - end if - end do - - ! Check that the number of history files declared does not exceed - ! the maximum allowed. - - if (ntapes > max_tapes) then - write(iulog,*) trim(subname),' ERROR: Too many history files declared, max_tapes=',max_tapes - call endrun() - end if - - ! Change 1d output per tape output flag if requested - only for history - ! tapes where 2d xy averaging is not enabled - - do t = 1,ntapes - if (hist_type1d_pertape(t) /= ' ' .and. (.not. hist_dov2xy(t))) then - select case (trim(hist_type1d_pertape(t))) - case ('PFTS','COLS', 'LAND', 'GRID') - if ( masterproc ) & - write(iulog,*)'history tape ',t,' will have 1d output type of ',hist_type1d_pertape(t) - case default - write(iulog,*) trim(subname),' ERROR: unknown namelist type1d per tape=',hist_type1d_pertape(t) - call endrun() - end select - end if - end do - - if (masterproc) then - write(iulog,*) 'There will be a total of ',ntapes,' history tapes' - do t=1,ntapes - write(iulog,*) - if (hist_nhtfrq(t) == 0) then - write(iulog,*)'History tape ',t,' write frequency is MONTHLY' - else - write(iulog,*)'History tape ',t,' write frequency = ',hist_nhtfrq(t) - endif - if (hist_dov2xy(t)) then - write(iulog,*)'All fields on history tape ',t,' are grid averaged' - else - write(iulog,*)'All fields on history tape ',t,' are not grid averaged' - end if - write(iulog,*)'Number of time samples on history tape ',t,' is ',hist_mfilt(t) - write(iulog,*)'Output precision on history tape ',t,'=',hist_ndens(t) - write(iulog,*) - end do - call shr_sys_flush(iulog) - end if - - ! Set flag indicating h-tape contents are now defined (needed by masterlist_addfld) - - htapes_defined = .true. - - end subroutine htapes_fieldlist - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: htape_addfld -! -! !INTERFACE: - subroutine htape_addfld (t, f, avgflag) -! -! !DESCRIPTION: -! Add a field to the active list for a history tape. Copy the data from -! the master field list to the active list for the tape. -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! history tape index - integer, intent(in) :: f ! field index from master field list - character(len=1), intent(in) :: avgflag ! time averaging flag -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n ! field index on defined tape - character(len=8) :: type1d ! clm pointer 1d type - character(len=8) :: type1d_out ! history buffer 1d type - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: num2d ! size of second dimension (e.g. .number of vertical levels) - integer :: beg1d_out,end1d_out ! history output per-proc 1d beginning and ending indices - integer :: num1d_out ! history output 1d size - character(len=*),parameter :: subname = 'htape_addfld' -!----------------------------------------------------------------------- - - ! Ensure that it is not to late to add a field to the history tape - - if (htapes_defined) then - write(iulog,*) trim(subname),' ERROR: attempt to add field ', & - masterlist(f)%field%name, ' after history files are set' - call endrun() - end if - - tape(t)%nflds = tape(t)%nflds + 1 - n = tape(t)%nflds - - ! Copy field information - - tape(t)%hlist(n)%field = masterlist(f)%field - - ! Determine bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - - ! Modify type1d_out if necessary - - if (hist_dov2xy(t)) then - - ! If xy output averaging is requested, set output 1d type to grlnd - ! ***NOTE- the following logic is what permits non lat/lon grids to - ! be written to clm history file - - type1d = tape(t)%hlist(n)%field%type1d - - if (type1d == nameg .or. & - type1d == namel .or. & - type1d == namec .or. & - type1d == namep) then - tape(t)%hlist(n)%field%type1d_out = grlnd - end if - if (type1d == grlnd) then - tape(t)%hlist(n)%field%type1d_out = grlnd - end if - - else if (hist_type1d_pertape(t) /= ' ') then - - ! Set output 1d type based on namelist setting of hist_type1d_pertape - ! Only applies to tapes when xy output is not required - - type1d = tape(t)%hlist(n)%field%type1d - - select case (trim(hist_type1d_pertape(t))) - case('GRID') - tape(t)%hlist(n)%field%type1d_out = nameg - case('LAND') - tape(t)%hlist(n)%field%type1d_out = namel - case('COLS') - tape(t)%hlist(n)%field%type1d_out = namec - case ('PFTS') - tape(t)%hlist(n)%field%type1d_out = namep - case default - write(iulog,*) trim(subname),' ERROR: unknown input hist_type1d_pertape= ', hist_type1d_pertape(t) - call endrun() - end select - - endif - - ! Determine output 1d dimensions - - type1d_out = tape(t)%hlist(n)%field%type1d_out - if (type1d_out == grlnd) then - beg1d_out = begg - end1d_out = endg - num1d_out = numg - else if (type1d_out == nameg) then - beg1d_out = begg - end1d_out = endg - num1d_out = numg - else if (type1d_out == namel) then - beg1d_out = begl - end1d_out = endl - num1d_out = numl - else if (type1d_out == namec) then - beg1d_out = begc - end1d_out = endc - num1d_out = numc - else if (type1d_out == namep) then - beg1d_out = begp - end1d_out = endp - num1d_out = nump - else - write(iulog,*) trim(subname),' ERROR: incorrect value of type1d_out= ',type1d_out - call endrun() - end if - - tape(t)%hlist(n)%field%beg1d_out = beg1d_out - tape(t)%hlist(n)%field%end1d_out = end1d_out - tape(t)%hlist(n)%field%num1d_out = num1d_out - - ! Alloccate and initialize history buffer and related info - - num2d = tape(t)%hlist(n)%field%num2d - allocate (tape(t)%hlist(n)%hbuf(beg1d_out:end1d_out,num2d)) - allocate (tape(t)%hlist(n)%nacs(beg1d_out:end1d_out,num2d)) - tape(t)%hlist(n)%hbuf(:,:) = 0._r8 - tape(t)%hlist(n)%nacs(:,:) = 0 - - ! Set time averaging flag based on masterlist setting or - ! override the default averaging flag with namelist setting - - select case (avgflag) - case (' ') - tape(t)%hlist(n)%avgflag = masterlist(f)%avgflag(t) - case ('A','I','X','M') - tape(t)%hlist(n)%avgflag = avgflag - case default - write(iulog,*) trim(subname),' ERROR: unknown avgflag=', avgflag - call endrun() - end select - - end subroutine htape_addfld - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_update_hbuf -! -! !INTERFACE: - subroutine hist_update_hbuf() -! -! !DESCRIPTION: -! Accumulate (or take min, max, etc. as appropriate) input field -! into its history buffer for appropriate tapes. -! -! !USES: -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: t ! tape index - integer :: f ! field index - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - character(len=*),parameter :: subname = 'hist_update_hbuf' -!----------------------------------------------------------------------- - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - do t = 1,ntapes -!$OMP PARALLEL DO PRIVATE (f, num2d) - do f = 1,tape(t)%nflds - num2d = tape(t)%hlist(f)%field%num2d - if ( num2d == 1) then - call hist_update_hbuf_field_1d (t, f, begp, endp, begc, endc, begl, endl, begg, endg) - else - call hist_update_hbuf_field_2d (t, f, begp, endp, begc, endc, begl, endl, begg, endg, num2d) - end if - end do -!$OMP END PARALLEL DO - end do - - end subroutine hist_update_hbuf - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_update_hbuf_field_1d -! -! !INTERFACE: - subroutine hist_update_hbuf_field_1d (t, f, begp, endp, begc, endc, begl, endl, begg, endg) -! -! !DESCRIPTION: -! Accumulate (or take min, max, etc. as appropriate) input field -! into its history buffer for appropriate tapes. -! -! !USES: - use clmtype - use subgridAveMod, only : p2g, c2g, l2g - use clm_varcon , only : istice_mec -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - integer, intent(in) :: f ! field index - integer, intent(in) :: begp, endp ! per-proc beginning and ending pft indices - integer, intent(in) :: begc, endc ! per-proc beginning and ending column indices - integer, intent(in) :: begl, endl ! per-proc beginning and ending landunit indices - integer, intent(in) :: begg, endg ! per-proc gridcell ending gridcell indices -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: hpindex ! history pointer index - integer :: k ! gridcell, landunit, column or pft index - integer :: l ! landunit index - integer :: beg1d,end1d ! beginning and ending indices - logical :: checkwt ! true => check weight of pft relative to gridcell - logical :: valid ! true => history operation is valid - logical :: map2gcell ! true => map clm pointer field to gridcell - character(len=8) :: type1d ! 1d clm pointerr type ["gridcell","landunit","column","pft"] - character(len=8) :: type1d_out ! 1d history buffer type ["gridcell","landunit","column","pft"] - character(len=1) :: avgflag ! time averaging flag - character(len=8) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=8) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=8) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: plandunit(:) ! pft's landunit index - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: field(:) ! clm 1d pointer field - real(r8) :: field_gcell(begg:endg) ! gricell level field (used if mapping to gridcell is done) - integer j - character(len=*),parameter :: subname = 'hist_update_hbuf_field_1d' -!----------------------------------------------------------------------- - - avgflag = tape(t)%hlist(f)%avgflag - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - type1d = tape(t)%hlist(f)%field%type1d - type1d_out = tape(t)%hlist(f)%field%type1d_out - p2c_scale_type = tape(t)%hlist(f)%field%p2c_scale_type - c2l_scale_type = tape(t)%hlist(f)%field%c2l_scale_type - l2g_scale_type = tape(t)%hlist(f)%field%l2g_scale_type - hpindex = tape(t)%hlist(f)%field%hpindex - field => clmptr_rs(hpindex)%ptr - - ! set variables to check weights when allocate all pfts - - map2gcell = .false. - if (type1d_out == nameg .or. type1d_out == grlnd) then - if (type1d == namep) then - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, field, field_gcell, & - p2c_scale_type, c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namec) then - call c2g(begc, endc, begl, endl, begg, endg, field, field_gcell, & - c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namel) then - call l2g(begl, endl, begg, endg, field, field_gcell, & - l2g_scale_type) - map2gcell = .true. - end if - end if - - if (map2gcell) then ! Map to gridcell - - ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) - case ('I') ! Instantaneous - do k = begg,endg - if (field_gcell(k) /= spval) then - hbuf(k,1) = field_gcell(k) - else - hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('A') ! Time average - do k = begg,endg - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 - hbuf(k,1) = hbuf(k,1) + field_gcell(k) - nacs(k,1) = nacs(k,1) + 1 - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - end do - case ('X') ! Maximum over time - do k = begg,endg - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = -1.e50_r8 - hbuf(k,1) = max( hbuf(k,1), field_gcell(k) ) - else - hbuf(k,1) = spval - endif - nacs(k,1) = 1 - end do - case ('M') ! Minimum over time - do k = begg,endg - if (field_gcell(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = +1.e50_r8 - hbuf(k,1) = min( hbuf(k,1), field_gcell(k) ) - else - hbuf(k,1) = spval - endif - nacs(k,1) = 1 - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun() - end select - - else ! Do not map to gridcell - - pwtgcell => pft%wtgcell - plandunit => pft%landunit - ltype => lun%itype - - checkwt = .false. - if (type1d == namep) checkwt = .true. - - select case (avgflag) - case ('I') ! Instantaneous - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - ! Note: some glacier_mec pfts may have zero weight and still be considered valid - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - hbuf(k,1) = field(k) - else - hbuf(k,1) = spval - end if - else - hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('A') ! Time average - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = 0._r8 - hbuf(k,1) = hbuf(k,1) + field(k) - nacs(k,1) = nacs(k,1) + 1 - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - end do - case ('X') ! Maximum over time - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = -1.e50_r8 - hbuf(k,1) = max( hbuf(k,1), field(k) ) - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case ('M') ! Minimum over time - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k) /= spval) then - if (nacs(k,1) == 0) hbuf(k,1) = +1.e50_r8 - hbuf(k,1) = min( hbuf(k,1), field(k) ) - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - else - if (nacs(k,1) == 0) hbuf(k,1) = spval - end if - nacs(k,1) = 1 - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun() - end select - end if - - end subroutine hist_update_hbuf_field_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_update_hbuf_field_2d -! -! !INTERFACE: - subroutine hist_update_hbuf_field_2d (t, f, begp, endp, begc, endc, begl, endl, begg, endg, num2d) -! -! !DESCRIPTION: -! Accumulate (or take min, max, etc. as appropriate) input field -! into its history buffer for appropriate tapes. -! -! !USES: - use clmtype - use subgridAveMod, only : p2g, c2g, l2g - use clm_varcon , only : istice_mec -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - integer, intent(in) :: f ! field index - integer, intent(in) :: begp, endp ! per-proc beginning and ending pft indices - integer, intent(in) :: begc, endc ! per-proc beginning and ending column indices - integer, intent(in) :: begl, endl ! per-proc beginning and ending landunit indices - integer, intent(in) :: begg, endg ! per-proc gridcell ending gridcell indices - integer, intent(in) :: num2d ! size of second dimension -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: hpindex ! history pointer index - integer :: k ! gridcell, landunit, column or pft index - integer :: l ! landunit index - integer :: j ! level index - integer :: beg1d,end1d ! beginning and ending indices - logical :: checkwt ! true => check weight of pft relative to gridcell - logical :: valid ! true => history operation is valid - logical :: map2gcell ! true => map clm pointer field to gridcell - character(len=8) :: type1d ! 1d clm pointerr type ["gridcell","landunit","column","pft"] - character(len=8) :: type1d_out ! 1d history buffer type ["gridcell","landunit","column","pft"] - character(len=1) :: avgflag ! time averaging flag - character(len=8) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=8) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=8) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - integer , pointer :: ltype(:) ! landunit type - integer , pointer :: plandunit(:) ! pft's landunit index - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: field(:,:) ! clm 2d pointer field - real(r8) :: field_gcell(begg:endg,num2d) ! gricell level field (used if mapping to gridcell is done) - character(len=*),parameter :: subname = 'hist_update_hbuf_field_2d' -!----------------------------------------------------------------------- - - avgflag = tape(t)%hlist(f)%avgflag - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - beg1d = tape(t)%hlist(f)%field%beg1d - end1d = tape(t)%hlist(f)%field%end1d - type1d = tape(t)%hlist(f)%field%type1d - type1d_out = tape(t)%hlist(f)%field%type1d_out - p2c_scale_type = tape(t)%hlist(f)%field%p2c_scale_type - c2l_scale_type = tape(t)%hlist(f)%field%c2l_scale_type - l2g_scale_type = tape(t)%hlist(f)%field%l2g_scale_type - hpindex = tape(t)%hlist(f)%field%hpindex - field => clmptr_ra(hpindex)%ptr(:,1:num2d) - - ! set variables to check weights when allocate all pfts - - map2gcell = .false. - if (type1d_out == nameg .or. type1d_out == grlnd) then - if (type1d == namep) then - call p2g(begp, endp, begc, endc, begl, endl, begg, endg, num2d, field, field_gcell, & - p2c_scale_type, c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namec) then - call c2g(begc, endc, begl, endl, begg, endg, num2d, field, field_gcell, & - c2l_scale_type, l2g_scale_type) - map2gcell = .true. - else if (type1d == namel) then - call l2g(begl, endl, begg, endg, num2d, field, field_gcell, & - l2g_scale_type) - map2gcell = .true. - end if - end if - - if (map2gcell) then ! Map to gridcell - - ! note that in this case beg1d = begg and end1d=endg - select case (avgflag) - case ('I') ! Instantaneous - do j = 1,num2d - do k = begg,endg - if (field_gcell(k,j) /= spval) then - hbuf(k,j) = field_gcell(k,j) - else - hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('A') ! Time average - do j = 1,num2d - do k = begg,endg - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 - hbuf(k,j) = hbuf(k,j) + field_gcell(k,j) - nacs(k,j) = nacs(k,j) + 1 - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - endif - end do - end do - case ('X') ! Maximum over time - do j = 1,num2d - do k = begg,endg - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = -1.e50_r8 - hbuf(k,j) = max( hbuf(k,j), field_gcell(k,j) ) - else - hbuf(k,j) = spval - endif - nacs(k,j) = 1 - end do - end do - case ('M') ! Minimum over time - do j = 1,num2d - do k = begg,endg - if (field_gcell(k,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = +1.e50_r8 - hbuf(k,j) = min( hbuf(k,j), field_gcell(k,j) ) - else - hbuf(k,j) = spval - endif - nacs(k,j) = 1 - end do - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun() - end select - - else ! Do not map to gridcell - - ! Note that since field points to an array section the - ! bounds are field(1:end1d-beg1d+1, num2d) - therefore - ! need to do the shifting below - - pwtgcell => pft%wtgcell - plandunit => pft%landunit - ltype => lun%itype - - checkwt = .false. - if (type1d == namep) checkwt = .true. - - select case (avgflag) - case ('I') ! Instantaneous - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - hbuf(k,j) = field(k-beg1d+1,j) - else - hbuf(k,j) = spval - end if - else - hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('A') ! Time average - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = 0._r8 - hbuf(k,j) = hbuf(k,j) + field(k-beg1d+1,j) - nacs(k,j) = nacs(k,j) + 1 - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - end do - end do - case ('X') ! Maximum over time - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = -1.e50_r8 - hbuf(k,j) = max( hbuf(k,j), field(k-beg1d+1,j) ) - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case ('M') ! Minimum over time - do j = 1,num2d - do k = beg1d,end1d - valid = .true. - if (checkwt) then - l = plandunit(k) - if (pwtgcell(k) == 0._r8 .and. ltype(l)/=istice_mec) valid = .false. - end if - if (valid) then - if (field(k-beg1d+1,j) /= spval) then - if (nacs(k,j) == 0) hbuf(k,j) = +1.e50_r8 - hbuf(k,j) = min( hbuf(k,j), field(k-beg1d+1,j)) - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - else - if (nacs(k,j) == 0) hbuf(k,j) = spval - end if - nacs(k,j) = 1 - end do - end do - case default - write(iulog,*) trim(subname),' ERROR: invalid time averaging flag ', avgflag - call endrun() - end select - end if - - end subroutine hist_update_hbuf_field_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hfields_normalize -! -! !INTERFACE: - subroutine hfields_normalize (t) -! -! !DESCRIPTION: -! Normalize fields on a history file by the number of accumulations. -! Loop over fields on the tape. Need averaging flag and number of -! accumulations to perform normalization. -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - integer :: k ! 1d index - integer :: j ! 2d index - logical :: aflag ! averaging flag - integer :: beg1d_out,end1d_out ! hbuf 1d beginning and ending indices - integer :: num2d ! hbuf size of second dimension (e.g. number of vertical levels) - character(len=1) :: avgflag ! averaging flag - real(r8), pointer :: hbuf(:,:) ! history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - character(len=*),parameter :: subname = 'hfields_normalize' -!----------------------------------------------------------------------- -!dir$ inlinenever hfields_normalize - - ! Normalize by number of accumulations for time averaged case - - do f = 1,tape(t)%nflds - avgflag = tape(t)%hlist(f)%avgflag - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - num2d = tape(t)%hlist(f)%field%num2d - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (avgflag == 'A') then - aflag = .true. - else - aflag = .false. - end if - - do j = 1, num2d - do k = beg1d_out, end1d_out - if (aflag .and. nacs(k,j) /= 0) then - hbuf(k,j) = hbuf(k,j) / float(nacs(k,j)) - end if - end do - end do - end do - - end subroutine hfields_normalize - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hfields_zero -! -! !INTERFACE: - subroutine hfields_zero (t) -! -! !DESCRIPTION: -! Zero out accumulation and history buffers for a given history tape. -! Loop through fields on the tape. -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - character(len=*),parameter :: subname = 'hfields_zero' -!----------------------------------------------------------------------- - - do f = 1,tape(t)%nflds - tape(t)%hlist(f)%hbuf(:,:) = 0._r8 - tape(t)%hlist(f)%nacs(:,:) = 0 - end do - - end subroutine hfields_zero - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: htape_create -! -! !INTERFACE: - subroutine htape_create (t, histrest) -! -! !DESCRIPTION: -! Define contents of history file t. Issue the required netcdf -! wrapper calls to define the history file contents. -! -! !USES: - use clmtype - use clm_varpar , only : nlevgrnd, nlevlak, numrad, maxpatch_glcmec - use clm_varctl , only : caseid, ctitle, fsurdat, finidat, fpftcon, & - version, hostname, username, conventions, source - use domainMod , only : ldomain - use fileutils , only : get_filename -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - logical, intent(in), optional :: histrest ! if creating the history restart file -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - integer :: p,c,l,n ! indices - integer :: ier ! error code - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - integer :: dimid ! dimension id temporary - integer :: dim1id(1) ! netCDF dimension id - integer :: dim2id(2) ! netCDF dimension id - integer :: ndims ! dimension counter - integer :: omode ! returned mode from netCDF call - integer :: ncprec ! output netCDF write precision - integer :: ret ! netCDF error status - integer :: nump ! total number of pfts across all processors - integer :: numc ! total number of columns across all processors - integer :: numl ! total number of landunits across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numa ! total number of atm cells across all processors - logical :: avoid_pnetcdf ! whether we should avoid using pnetcdf - logical :: lhistrest ! local history restart flag - type(file_desc_t) :: lnfid ! local file id - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len=256) :: name ! name of attribute - character(len=256) :: units ! units of attribute - character(len=256) :: str ! global attribute string - character(len= 1) :: avgflag ! time averaging flag - character(len=*),parameter :: subname = 'htape_create' -!----------------------------------------------------------------------- - - if ( present(histrest) )then - lhistrest = histrest - else - lhistrest = .false. - end if - - ! Determine necessary indices - - call get_proc_global(numg, numl, numc, nump) - - ! define output write precsion for tape - - ncprec = tape(t)%ncprec - - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - ! - 1-d hist files have problems with pnetcdf. A better workaround in terms of - ! performance is to keep pnetcdf, but set PIO_BUFFER_SIZE_LIMIT=0, but that can't be - ! done on a per-file basis. - if (.not. tape(t)%dov2xy) then - avoid_pnetcdf = .true. - else - avoid_pnetcdf = .false. - end if - - ! Create new netCDF file. It will be in define mode - - if ( .not. lhistrest )then - if (masterproc) then - write(iulog,*) trim(subname),' : Opening netcdf htape ', & - trim(locfnh(t)) - call shr_sys_flush(iulog) - end if - call ncd_pio_createfile(lnfid, trim(locfnh(t)), avoid_pnetcdf=avoid_pnetcdf) - call ncd_putatt(lnfid, ncd_global, 'title', 'CLM History file information' ) - call ncd_putatt(lnfid, ncd_global, 'comment', & - "NOTE: None of the variables are weighted by land fraction!" ) - else - if (masterproc) then - write(iulog,*) trim(subname),' : Opening netcdf rhtape ', & - trim(locfnhr(t)) - call shr_sys_flush(iulog) - end if - call ncd_pio_createfile(lnfid, trim(locfnhr(t)), avoid_pnetcdf=avoid_pnetcdf) - call ncd_putatt(lnfid, ncd_global, 'title', & - 'CLM Restart History information, required to continue a simulation' ) - call ncd_putatt(lnfid, ncd_global, 'comment', & - "This entire file NOT needed for startup or branch simulations") - end if - - ! Create global attributes. Attributes are used to store information - ! about the data set. Global attributes are information about the - ! data set as a whole, as opposed to a single variable - - call ncd_putatt(lnfid, ncd_global, 'Conventions', trim(conventions)) - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(lnfid, ncd_global, 'history' , trim(str)) - call ncd_putatt(lnfid, ncd_global, 'source' , trim(source)) - call ncd_putatt(lnfid, ncd_global, 'hostname', trim(hostname)) - call ncd_putatt(lnfid, ncd_global, 'username', trim(username)) - call ncd_putatt(lnfid, ncd_global, 'version' , trim(version)) - - str = & - '$Id$' - call ncd_putatt(lnfid, ncd_global, 'revision_id', trim(str)) - call ncd_putatt(lnfid, ncd_global, 'case_title', trim(ctitle)) - call ncd_putatt(lnfid, ncd_global, 'case_id', trim(caseid)) - str = get_filename(fsurdat) - call ncd_putatt(lnfid, ncd_global, 'Surface_dataset', trim(str)) - if (finidat == ' ') then - str = 'arbitrary initialization' - else - str = get_filename(finidat) - endif - call ncd_putatt(lnfid, ncd_global, 'Initial_conditions_dataset', trim(str)) - str = get_filename(fpftcon) - call ncd_putatt(lnfid, ncd_global, 'PFT_physiological_constants_dataset', trim(str)) - - ! Define dimensions. - ! Time is an unlimited dimension. Character string is treated as an array of characters. - - ! Global uncompressed dimensions (including non-land points) - if (ldomain%isgrid2d) then - call ncd_defdim(lnfid, 'lon' , ldomain%ni, dimid) - call ncd_defdim(lnfid, 'lat' , ldomain%nj, dimid) - else - call ncd_defdim(lnfid, trim(grlnd), ldomain%ns, dimid) - end if - - ! Global compressed dimensions (not including non-land points) - call ncd_defdim(lnfid, trim(nameg), numg, dimid) - call ncd_defdim(lnfid, trim(namel), numl, dimid) - call ncd_defdim(lnfid, trim(namec), numc, dimid) - call ncd_defdim(lnfid, trim(namep), nump, dimid) - - ! "level" dimensions - call ncd_defdim(lnfid, 'levgrnd', nlevgrnd, dimid) - call ncd_defdim(lnfid, 'levlak' , nlevlak, dimid) - call ncd_defdim(lnfid, 'numrad' , numrad , dimid) - if (maxpatch_glcmec > 0) then - call ncd_defdim(lnfid, 'glc_nec' , maxpatch_glcmec , dimid) - end if - - do n = 1,num_subs - call ncd_defdim(lnfid, subs_name(n), subs_dim(n), dimid) - end do - call ncd_defdim(lnfid, 'string_length', 8, strlen_dimid) - - if ( .not. lhistrest )then - call ncd_defdim(lnfid, 'hist_interval', 2, hist_interval_dimid) - call ncd_defdim(lnfid, 'time', ncd_unlimited, time_dimid) - nfid(t) = lnfid - if (masterproc)then - write(iulog,*) trim(subname), & - ' : Successfully defined netcdf history file ',t - call shr_sys_flush(iulog) - end if - else - ncid_hist(t) = lnfid - if (masterproc)then - write(iulog,*) trim(subname), & - ' : Successfully defined netcdf restart history file ',t - call shr_sys_flush(iulog) - end if - end if - - end subroutine htape_create - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: htape_timeconst3D -! -! !INTERFACE: - subroutine htape_timeconst3D(t, mode) -! -! !DESCRIPTION: -! Write time constant 3D variables to history tapes. -! Only write out when this subroutine is called (normally only for -! primary history files at very first time-step, nstep=0). -! Issue the required netcdf wrapper calls to define the history file -! contents. -! -! !USES: - use clmtype - use subgridAveMod , only : c2g - use clm_varpar , only : nlevgrnd - use shr_string_mod, only : shr_string_listAppend - use domainMod , only : ldomain -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: c,l,lev,ifld ! indices - integer :: ier ! error status - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - character(len=max_chars) :: long_name ! variable long name - character(len=max_namlen):: varname ! variable name - character(len=max_namlen):: units ! variable units - character(len=8) :: l2g_scale_type ! scale type for subgrid averaging of landunits to grid cells - real(r8), pointer :: histi(:,:) ! temporary - real(r8), pointer :: histo(:,:) ! temporary - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - integer, parameter :: nflds = 6 ! Number of 3D time-constant fields - character(len=*),parameter :: subname = 'htape_timeconst3D' - character(len=*),parameter :: varnames(nflds) = (/ & - 'ZSOI ', & - 'DZSOI ', & - 'WATSAT', & - 'SUCSAT', & - 'BSW ', & - 'HKSAT ' & - /) -!----------------------------------------------------------------------- - -!------------------------------------------------------------------------------- -!*** Non-time varying 3D fields *** -!*** Only write out when this subroutine is called *** -!*** Normally only called once for primary tapes *** -!------------------------------------------------------------------------------- - - if (mode == 'define') then - - do ifld = 1,nflds - ! Field indices MUST match varnames array order above! - if (ifld == 1) then - long_name='soil depth'; units = 'm' - else if (ifld == 2) then - long_name='soil thickness'; units = 'm' - else if (ifld == 3) then - long_name='saturated soil water content (porosity)'; units = 'mm3/mm3' - else if (ifld == 4) then - long_name='saturated soil matric potential'; units = 'mm' - else if (ifld == 5) then - long_name='slope of soil water retention curve'; units = 'unitless' - else if (ifld == 6) then - long_name='saturated hydraulic conductivity'; units = 'unitless' - else - call endrun( subname//' ERROR: bad 3D time-constant field index' ) - end if - if (tape(t)%dov2xy) then - if (ldomain%isgrid2d) then - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec,& - dim1name='lon', dim2name='lat', dim3name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec, & - dim1name=grlnd, dim2name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - else - call ncd_defvar(ncid=nfid(t), varname=trim(varnames(ifld)), xtype=tape(t)%ncprec, & - dim1name=namec, dim2name='levgrnd', & - long_name=long_name, units=units, missing_value=spval, fill_value=spval) - end if - call shr_string_listAppend(TimeConst3DVars,varnames(ifld)) - end do - - else if (mode == 'write') then - - ! Set pointers into derived type and get necessary bounds - - lptr => lun - cptr => col - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - allocate(histi(begc:endc,nlevgrnd), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histi'; call endrun() - end if - - ! Write time constant fields - - if (tape(t)%dov2xy) then - allocate(histo(begg:endg,nlevgrnd), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for histo'; call endrun() - end if - end if - - do ifld = 1,nflds - - ! WJS (10-25-11): Note about l2g_scale_type in the following: ZSOI & DZSOI are - ! currently constant in space, except for urban points, so their scale type - ! doesn't matter at the moment as long as it excludes urban points. I am using - ! 'nonurb' so that the values are output everywhere where the fields are - ! constant (i.e., everywhere except urban points). For the other fields, I am - ! using 'veg' to be consistent with the l2g_scale_type that is now used for many - ! of the 3-d time-variant fields; in theory, though, one might want versions of - ! these variables output for different landunits. - - ! Field indices MUST match varnames array order above! - if (ifld == 1) then ! ZSOI - l2g_scale_type = 'nonurb' - else if (ifld == 2) then ! DZSOI - l2g_scale_type = 'nonurb' - else if (ifld == 3) then ! WATSAT - l2g_scale_type = 'veg' - else if (ifld == 4) then ! SUCSAT - l2g_scale_type = 'veg' - else if (ifld == 5) then ! BSW - l2g_scale_type = 'veg' - else if (ifld == 6) then ! HKSAT - l2g_scale_type = 'veg' - end if - - histi(:,:) = spval - do lev = 1,nlevgrnd - do c = begc, endc - l = cptr%landunit(c) - if (.not. lptr%lakpoi(l)) then - ! Field indices MUST match varnames array order above! - if (ifld ==1) histi(c,lev) = cps%z(c,lev) - if (ifld ==2) histi(c,lev) = cps%dz(c,lev) - if (ifld ==3) histi(c,lev) = cps%watsat(c,lev) - if (ifld ==4) histi(c,lev) = cps%sucsat(c,lev) - if (ifld ==5) histi(c,lev) = cps%bsw(c,lev) - if (ifld ==6) histi(c,lev) = cps%hksat(c,lev) - end if - end do - end do - if (tape(t)%dov2xy) then - histo(:,:) = spval - call c2g(begc, endc, begl, endl, begg, endg, nlevgrnd, histi, histo, & - c2l_scale_type='unity', l2g_scale_type=l2g_scale_type) - - if (ldomain%isgrid2d) then - call ncd_io(varname=trim(varnames(ifld)), dim1name=grlnd, & - data=histo, ncid=nfid(t), flag='write') - else - call ncd_io(varname=trim(varnames(ifld)), dim1name=grlnd, & - data=histo, ncid=nfid(t), flag='write') - end if - else - call ncd_io(varname=trim(varnames(ifld)), dim1name=namec, & - data=histi, ncid=nfid(t), flag='write') - end if - end do - - if (tape(t)%dov2xy) deallocate(histo) - deallocate(histi) - - end if ! (define/write mode - - end subroutine htape_timeconst3D - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: htape_timeconst -! -! !INTERFACE: - subroutine htape_timeconst(t, mode) -! -! !DESCRIPTION: -! Write time constant values to primary history tape. -! Issue the required netcdf wrapper calls to define the history file -! contents. -! -! !USES: - use clmtype - use clm_varcon , only : zsoi, zlak, secspday - use domainMod , only : ldomain, lon1d, lat1d - use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time - use clm_time_manager, only : get_ref_date, get_calendar, NO_LEAP_C, GREGORIAN_C -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: vid,n,i,j,m ! indices - integer :: nstep ! current step - integer :: mcsec ! seconds of current date - integer :: mdcur ! current day - integer :: mscur ! seconds of current day - integer :: mcdate ! current date - integer :: yr,mon,day,nbsec ! year,month,day,seconds components of a date - integer :: hours,minutes,secs ! hours,minutes,seconds of hh:mm:ss - character(len= 10) :: basedate ! base date (yyyymmdd) - character(len= 8) :: basesec ! base seconds - character(len= 8) :: cdate ! system date - character(len= 8) :: ctime ! system time - real(r8):: time ! current time - real(r8):: timedata(2) ! time interval boundaries - integer :: dim1id(1) ! netCDF dimension id - integer :: dim2id(2) ! netCDF dimension id - integer :: varid ! netCDF variable id - type(Var_desc_t) :: vardesc ! netCDF variable description - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - character(len=max_chars) :: long_name ! variable long name - character(len=max_namlen):: varname ! variable name - character(len=max_namlen):: units ! variable units - character(len=max_namlen):: cal ! calendar from the time-manager - character(len=max_namlen):: caldesc ! calendar description to put on file - character(len=256):: str ! global attribute string - real(r8), pointer :: histo(:,:) ! temporary - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - integer :: status - - character(len=*),parameter :: subname = 'htape_timeconst' -!----------------------------------------------------------------------- - - !------------------------------------------------------------------------------- - !*** Time constant grid variables only on first time-sample of file *** - !------------------------------------------------------------------------------- - if (tape(t)%ntimes == 1) then - if (mode == 'define') then - call ncd_defvar(varname='levgrnd', xtype=tape(t)%ncprec, & - dim1name='levgrnd', & - long_name='coordinate soil levels', units='m', ncid=nfid(t)) - call ncd_defvar(varname='levlak', xtype=tape(t)%ncprec, & - dim1name='levlak', & - long_name='coordinate lake levels', units='m', ncid=nfid(t)) - elseif (mode == 'write') then - call ncd_io(varname='levgrnd', data=zsoi , ncid=nfid(t), flag='write') - call ncd_io(varname='levlak' , data=zlak , ncid=nfid(t), flag='write') - endif - endif - - !------------------------------------------------------------------------------- - !*** Time definition variables *** - !------------------------------------------------------------------------------- - - ! For define mode -- only do this for first time-sample - if (mode == 'define' .and. tape(t)%ntimes == 1) then - call get_ref_date(yr, mon, day, nbsec) - nstep = get_nstep() - hours = nbsec / 3600 - minutes = (nbsec - hours*3600) / 60 - secs = (nbsec - hours*3600 - minutes*60) - write(basedate,80) yr,mon,day -80 format(i4.4,'-',i2.2,'-',i2.2) - write(basesec ,90) hours, minutes, secs -90 format(i2.2,':',i2.2,':',i2.2) - - dim1id(1) = time_dimid - str = 'days since ' // basedate // " " // basesec - call ncd_defvar(nfid(t), 'time', tape(t)%ncprec, 1, dim1id, varid, & - long_name='time',units=str) - cal = get_calendar() - if ( trim(cal) == NO_LEAP_C )then - caldesc = "noleap" - else if ( trim(cal) == GREGORIAN_C )then - caldesc = "gregorian" - end if - call ncd_putatt(nfid(t), varid, 'calendar', caldesc) - call ncd_putatt(nfid(t), varid, 'bounds', 'time_bounds') - - dim1id(1) = time_dimid - call ncd_defvar(nfid(t) , 'mcdate', ncd_int, 1, dim1id , varid, & - long_name = 'current date (YYYYMMDD)') - call ncd_defvar(nfid(t) , 'mcsec' , ncd_int, 1, dim1id , varid, & - long_name = 'current seconds of current date', units='s') - call ncd_defvar(nfid(t) , 'mdcur' , ncd_int, 1, dim1id , varid, & - long_name = 'current day (from base day)') - call ncd_defvar(nfid(t) , 'mscur' , ncd_int, 1, dim1id , varid, & - long_name = 'current seconds of current day') - call ncd_defvar(nfid(t) , 'nstep' , ncd_int, 1, dim1id , varid, & - long_name = 'time step') - - dim2id(1) = hist_interval_dimid; dim2id(2) = time_dimid - call ncd_defvar(nfid(t), 'time_bounds', ncd_double, 2, dim2id, varid, & - long_name = 'history time interval endpoints') - - dim2id(1) = strlen_dimid; dim2id(2) = time_dimid - call ncd_defvar(nfid(t), 'date_written', ncd_char, 2, dim2id, varid) - call ncd_defvar(nfid(t), 'time_written', ncd_char, 2, dim2id, varid) - - if ( len_trim(TimeConst3DVars_Filename) > 0 )then - call ncd_putatt(nfid(t), ncd_global, 'Time_constant_3Dvars_filename', & - trim(TimeConst3DVars_Filename)) - end if - if ( len_trim(TimeConst3DVars) > 0 )then - call ncd_putatt(nfid(t), ncd_global, 'Time_constant_3Dvars', & - trim(TimeConst3DVars)) - end if - - elseif (mode == 'write') then - - call get_curr_time (mdcur, mscur) - call get_curr_date (yr, mon, day, mcsec) - mcdate = yr*10000 + mon*100 + day - nstep = get_nstep() - - call ncd_io('mcdate', mcdate, 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mcsec' , mcsec , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mdcur' , mdcur , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('mscur' , mscur , 'write', nfid(t), nt=tape(t)%ntimes) - call ncd_io('nstep' , nstep , 'write', nfid(t), nt=tape(t)%ntimes) - - time = mdcur + mscur/secspday - call ncd_io('time' , time , 'write', nfid(t), nt=tape(t)%ntimes) - - timedata(1) = tape(t)%begtime - timedata(2) = time - call ncd_io('time_bounds', timedata, 'write', nfid(t), nt=tape(t)%ntimes) - - call getdatetime (cdate, ctime) - call ncd_io('date_written', cdate, 'write', nfid(t), nt=tape(t)%ntimes) - - call ncd_io('time_written', ctime, 'write', nfid(t), nt=tape(t)%ntimes) - - endif - - !------------------------------------------------------------------------------- - !*** Grid definition variables *** - !------------------------------------------------------------------------------- - ! For define mode -- only do this for first time-sample - if (mode == 'define' .and. tape(t)%ntimes == 1) then - - if (ldomain%isgrid2d) then - call ncd_defvar(varname='lon', xtype=tape(t)%ncprec, dim1name='lon', & - long_name='coordinate longitude', units='degrees_east', & - ncid=nfid(t), missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='lon', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='coordinate longitude', units='degrees_east', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='lat', xtype=tape(t)%ncprec, dim1name='lat', & - long_name='coordinate latitude', units='degrees_north', & - ncid=nfid(t), missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='lat', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='coordinate latitude', units='degrees_north', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='area', xtype=tape(t)%ncprec, & - dim1name='lon', dim2name='lat',& - long_name='grid cell areas', units='km^2', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='area', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='grid cell areas', units='km^2', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='landfrac', xtype=tape(t)%ncprec, & - dim1name='lon', dim2name='lat', & - long_name='land fraction', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(varname='landfrac', xtype=tape(t)%ncprec, & - dim1name=grlnd, & - long_name='land fraction', ncid=nfid(t), & - missing_value=spval, fill_value=spval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='landmask', xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='land/ocean mask (0.=ocean and 1.=land)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - else - call ncd_defvar(varname='landmask', xtype=ncd_int, & - dim1name=grlnd, & - long_name='land/ocean mask (0.=ocean and 1.=land)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - end if - if (ldomain%isgrid2d) then - call ncd_defvar(varname='pftmask' , xtype=ncd_int, & - dim1name='lon', dim2name='lat', & - long_name='pft real/fake mask (0.=fake and 1.=real)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - else - call ncd_defvar(varname='pftmask' , xtype=ncd_int, & - dim1name=grlnd, & - long_name='pft real/fake mask (0.=fake and 1.=real)', ncid=nfid(t), & - imissing_value=ispval, ifill_value=ispval) - end if - else if (mode == 'write') then - - ! Most of this is constant and only needs to be done on tape(t)%ntimes=1 - ! But, some may change for dynamic PFT mode for example - ! Set pointers into derived type and get necessary bounds - - lptr => lun - cptr => col - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - if (ldomain%isgrid2d) then - call ncd_io(varname='lon', data=lon1d, ncid=nfid(t), flag='write') - call ncd_io(varname='lat', data=lat1d, ncid=nfid(t), flag='write') - else - call ncd_io(varname='lon', data=ldomain%lonc, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='lat', data=ldomain%latc, dim1name=grlnd, ncid=nfid(t), flag='write') - end if - call ncd_io(varname='area' , data=ldomain%area, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='landfrac', data=ldomain%frac, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='landmask', data=ldomain%mask, dim1name=grlnd, ncid=nfid(t), flag='write') - call ncd_io(varname='pftmask' , data=ldomain%pftm, dim1name=grlnd, ncid=nfid(t), flag='write') - end if ! (define/write mode - - end subroutine htape_timeconst - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hfields_write -! -! !INTERFACE: - subroutine hfields_write(t, mode) -! -! !DESCRIPTION: -! Write history tape. Issue the call to write the variable. -! -! !USES: - use clmtype - use domainMod , only : ldomain -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - integer :: k ! 1d index - integer :: c,l,p ! indices - integer :: beg1d_out ! on-node 1d hbuf pointer start index - integer :: end1d_out ! on-node 1d hbuf pointer end index - integer :: num1d_out ! size of hbuf first dimension (overall all nodes) - integer :: num2d ! hbuf second dimension size - integer :: nt ! time index - integer :: ier ! error status - character(len=1) :: avgflag ! time averaging flag - character(len=max_chars) :: long_name! long name - character(len=max_chars) :: units ! units - character(len=max_namlen):: varname ! variable name - character(len=32) :: avgstr ! time averaging type - character(len=8) :: type1d_out ! history output 1d type - character(len=8) :: type2d ! history output 2d type - character(len=32) :: dim1name ! temporary - character(len=32) :: dim2name ! temporary - real(r8), pointer :: histo(:,:) ! temporary - real(r8), pointer :: hist1do(:) ! temporary - character(len=*),parameter :: subname = 'hfields_write' -!----------------------------------------------------------------------- - - ! Write/define 1d topological info - - if (.not. tape(t)%dov2xy) then - if (mode == 'define') then - call hfields_1dinfo(t, mode='define') - else if (mode == 'write') then - call hfields_1dinfo(t, mode='write') - end if - end if - - ! Define time-dependent variables create variables and attributes for field list - - do f = 1,tape(t)%nflds - - ! Set history field variables - - varname = tape(t)%hlist(f)%field%name - long_name = tape(t)%hlist(f)%field%long_name - units = tape(t)%hlist(f)%field%units - avgflag = tape(t)%hlist(f)%avgflag - type1d_out = tape(t)%hlist(f)%field%type1d_out - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - num1d_out = tape(t)%hlist(f)%field%num1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - nt = tape(t)%ntimes - - if (mode == 'define') then - - select case (avgflag) - case ('A') - avgstr = 'mean' - case ('I') - avgstr = 'instantaneous' - case ('X') - avgstr = 'maximum' - case ('M') - avgstr = 'minimum' - case default - write(iulog,*) trim(subname),' ERROR: unknown time averaging flag (avgflag)=',avgflag; call endrun() - end select - - if (type1d_out == grlnd) then - if (ldomain%isgrid2d) then - dim1name = 'lon' ; dim2name = 'lat' - else - dim1name = trim(grlnd); dim2name = 'undefined' - end if - else - dim1name = type1d_out ; dim2name = 'undefined' - endif - - if (dim2name == 'undefined') then - if (num2d == 1) then - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=type2d, dim3name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - end if - else - if (num2d == 1) then - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=dim2name, dim3name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - else - call ncd_defvar(ncid=nfid(t), varname=varname, xtype=tape(t)%ncprec, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, dim4name='time', & - long_name=long_name, units=units, cell_method=avgstr, & - missing_value=spval, fill_value=spval) - end if - endif - - else if (mode == 'write') then - - ! Determine output buffer - - histo => tape(t)%hlist(f)%hbuf - - ! Allocate dynamic memory - - if (num2d == 1) then - allocate(hist1do(beg1d_out:end1d_out), stat=ier) - if (ier /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation'; call endrun() - end if - hist1do(beg1d_out:end1d_out) = histo(beg1d_out:end1d_out,1) - end if - - ! Write history output. Always output land and ocean runoff on xy grid. - - if (num2d == 1) then - call ncd_io(flag='write', varname=varname, & - dim1name=type1d_out, data=hist1do, ncid=nfid(t), nt=nt) - else - call ncd_io(flag='write', varname=varname, & - dim1name=type1d_out, data=histo, ncid=nfid(t), nt=nt) - end if - - - ! Deallocate dynamic memory - - if (num2d == 1) then - deallocate(hist1do) - end if - - end if - - end do - - end subroutine hfields_write - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hfields_1dinfo -! -! !INTERFACE: - subroutine hfields_1dinfo(t, mode) -! -! !DESCRIPTION: -! Write/define 1d info for history tape. -! -! !USES: - use clmtype - use decompMod , only : ldecomp - use domainMod , only : ldomain, ldomain -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: t ! tape index - character(len=*), intent(in) :: mode ! 'define' or 'write' -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: f ! field index - integer :: k ! 1d index - integer :: g,c,l,p ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: ier ! errir status - real(r8), pointer :: rgarr(:) ! temporary - real(r8), pointer :: rcarr(:) ! temporary - real(r8), pointer :: rlarr(:) ! temporary - real(r8), pointer :: rparr(:) ! temporary - integer , pointer :: igarr(:) ! temporary - integer , pointer :: icarr(:) ! temporary - integer , pointer :: ilarr(:) ! temporary - integer , pointer :: iparr(:) ! temporary - type(file_desc_t) :: ncid ! netcdf file - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - character(len=*),parameter :: subname = 'hfields_1dinfo' -!----------------------------------------------------------------------- - - ncid = nfid(t) - - if (mode == 'define') then - - ! Define gridcell info - - call ncd_defvar(varname='grid1d_lon', xtype=ncd_double, dim1name=nameg, & - long_name='gridcell longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='grid1d_lat', xtype=ncd_double, dim1name=nameg, & - long_name='gridcell latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='grid1d_ixy', xtype=ncd_int, dim1name=nameg, & - long_name='2d longitude index of corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='grid1d_jxy', xtype=ncd_int, dim1name=nameg, & - long_name='2d latitude index of corresponding gridcell', ncid=ncid) - - ! Define landunit info - - call ncd_defvar(varname='land1d_lon', xtype=ncd_double, dim1name=namel, & - long_name='landunit longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='land1d_lat', xtype=ncd_double, dim1name=namel, & - long_name='landunit latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='land1d_ixy', xtype=ncd_int, dim1name=namel, & - long_name='2d longitude index of corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='land1d_jxy', xtype=ncd_int, dim1name=namel, & - long_name='2d latitude index of corresponding landunit', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='land1d_gi', xtype=ncd_int, dim1name='landunit', & - ! long_name='1d grid index of corresponding landunit', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='land1d_wtgcell', xtype=ncd_double, dim1name=namel, & - long_name='landunit weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='land1d_ityplunit', xtype=ncd_int, dim1name=namel, & - long_name='landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - ! Define column info - - call ncd_defvar(varname='cols1d_lon', xtype=ncd_double, dim1name=namec, & - long_name='column longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='cols1d_lat', xtype=ncd_double, dim1name=namec, & - long_name='column latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='cols1d_ixy', xtype=ncd_int, dim1name=namec, & - long_name='2d longitude index of corresponding column', ncid=ncid) - - call ncd_defvar(varname='cols1d_jxy', xtype=ncd_int, dim1name=namec, & - long_name='2d latitude index of corresponding column', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='cols1d_gi', xtype=ncd_int, dim1name='column', & - ! long_name='1d grid index of corresponding column', ncid=ncid) - - !call ncd_defvar(varname='cols1d_li', xtype=ncd_int, dim1name='column', & - ! long_name='1d landunit index of corresponding column', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='cols1d_wtgcell', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='cols1d_wtlunit', xtype=ncd_double, dim1name=namec, & - long_name='column weight relative to corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='cols1d_itype_lunit', xtype=ncd_int, dim1name=namec, & - long_name='column landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - ! Define pft info - - call ncd_defvar(varname='pfts1d_lon', xtype=ncd_double, dim1name=namep, & - long_name='pft longitude', units='degrees_east', ncid=ncid) - - call ncd_defvar(varname='pfts1d_lat', xtype=ncd_double, dim1name=namep, & - long_name='pft latitude', units='degrees_north', ncid=ncid) - - call ncd_defvar(varname='pfts1d_ixy', xtype=ncd_int, dim1name=namep, & - long_name='2d longitude index of corresponding pft', ncid=ncid) - - call ncd_defvar(varname='pfts1d_jxy', xtype=ncd_int, dim1name=namep, & - long_name='2d latitude index of corresponding pft', ncid=ncid) - - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(varname='pfts1d_gi', xtype=ncd_int, dim1name='pft', & - ! long_name='1d grid index of corresponding pft', ncid=ncid) - - !call ncd_defvar(varname='pfts1d_li', xtype=ncd_int, dim1name='pft', & - ! long_name='1d landunit index of corresponding pft', ncid=ncid) - - !call ncd_defvar(varname='pfts1d_ci', xtype=ncd_int, dim1name='pft', & - ! long_name='1d column index of corresponding pft', ncid=ncid) - ! ---------------------------------------------------------------- - - call ncd_defvar(varname='pfts1d_wtgcell', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding gridcell', ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtlunit', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding landunit', ncid=ncid) - - call ncd_defvar(varname='pfts1d_wtcol', xtype=ncd_double, dim1name=namep, & - long_name='pft weight relative to corresponding column', ncid=ncid) - - call ncd_defvar(varname='pfts1d_itype_veg', xtype=ncd_int, dim1name=namep, & - long_name='pft vegetation type', ncid=ncid) - - call ncd_defvar(varname='pfts1d_itype_lunit', xtype=ncd_int, dim1name=namep, & - long_name='pft landunit type (vegetated,urban,lake,wetland,glacier or glacier_mec)', & - ncid=ncid) - - else if (mode == 'write') then - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ! Determine bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - allocate(rgarr(begg:endg),rlarr(begl:endl),rcarr(begc:endc),rparr(begp:endp),stat=ier) - if (ier /= 0) call endrun('hfields_1dinfo allocation error of rarrs') - - allocate(igarr(begg:endg),ilarr(begl:endl),icarr(begc:endc),iparr(begp:endp),stat=ier) - if (ier /= 0) call endrun('hfields_1dinfo allocation error of iarrs') - - ! Write gridcell info - - call ncd_io(varname='grid1d_lon', data=gptr%londeg, dim1name=nameg, ncid=ncid, flag='write') - call ncd_io(varname='grid1d_lat', data=gptr%latdeg, dim1name=nameg, ncid=ncid, flag='write') - do g=begg,endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='grid1d_ixy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') - do g=begg,endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 - enddo - call ncd_io(varname='grid1d_jxy', data=igarr , dim1name=nameg, ncid=ncid, flag='write') - - ! Write landunit info - - do l=begl,endl - rlarr(l) = gptr%londeg(lptr%gridcell(l)) - enddo - call ncd_io(varname='land1d_lon', data=rlarr, dim1name=namel, ncid=ncid, flag='write') - do l=begl,endl - rlarr(l) = gptr%latdeg(lptr%gridcell(l)) - enddo - call ncd_io(varname='land1d_lat', data=rlarr, dim1name=namel, ncid=ncid, flag='write') - do l=begl,endl - ilarr(l) = mod(ldecomp%gdc2glo(lptr%gridcell(l))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='land1d_ixy', data=ilarr, dim1name=namel, ncid=ncid, flag='write') - do l=begl,endl - ilarr(l) = (ldecomp%gdc2glo(lptr%gridcell(l))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='land1d_jxy' , data=ilarr , dim1name=namel, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 Bug 1310 - !call ncd_io(varname='land1d_gi' , data=lptr%gridcell, dim1name=namel, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='land1d_wtgcell' , data=lptr%wtgcell , dim1name=namel, ncid=ncid, flag='write') - call ncd_io(varname='land1d_ityplunit', data=lptr%itype , dim1name=namel, ncid=ncid, flag='write') - - ! Write column info - - do c=begc,endc - rcarr(c) = gptr%londeg(cptr%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lon', data=rcarr, dim1name=namec, ncid=ncid, flag='write') - do c=begc,endc - rcarr(c) = gptr%latdeg(cptr%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lat', data=rcarr, dim1name=namec, ncid=ncid, flag='write') - do c=begc,endc - icarr(c) = mod(ldecomp%gdc2glo(cptr%gridcell(c))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='cols1d_ixy', data=icarr, dim1name=namec, ncid=ncid, flag='write') - do c=begc,endc - icarr(c) = (ldecomp%gdc2glo(cptr%gridcell(c))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='cols1d_jxy' , data=icarr ,dim1name=namec, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 Bug 1310 - !call ncd_io(varname='cols1d_gi' , data=cptr%gridcell, dim1name=namec, ncid=ncid, flag='write') - !call ncd_io(varname='cols1d_li' , data=cptr%landunit, dim1name=namec, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='cols1d_wtgcell', data=cptr%wtgcell , dim1name=namec, ncid=ncid, flag='write') - call ncd_io(varname='cols1d_wtlunit', data=cptr%wtlunit , dim1name=namec, ncid=ncid, flag='write') - do c=begc,endc - icarr(c) = lptr%itype(cptr%landunit(c)) - enddo - call ncd_io(varname='cols1d_itype_lunit', data=icarr , dim1name=namec, ncid=ncid, flag='write') - - ! Write pft info - - do p=begp,endp - rparr(p) = gptr%londeg(pptr%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lon', data=rparr, dim1name=namep, ncid=ncid, flag='write') - do p=begp,endp - rparr(p) = gptr%latdeg(pptr%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lat', data=rparr, dim1name=namep, ncid=ncid, flag='write') - do p=begp,endp - iparr(p) = mod(ldecomp%gdc2glo(pptr%gridcell(p))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='pfts1d_ixy', data=iparr, dim1name=namep, ncid=ncid, flag='write') - do p=begp,endp - iparr(p) = (ldecomp%gdc2glo(pptr%gridcell(p))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='pfts1d_jxy' , data=iparr , dim1name=namep, ncid=ncid, flag='write') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_io(varname='pfts1d_gi' , data=pptr%gridcell, dim1name=namep, ncid=ncid, flag='write') - !call ncd_io(varname='pfts1d_li' , data=pptr%landunit, dim1name=namep, ncid=ncid, flag='write') - !call ncd_io(varname='pfts1d_ci' , data=pptr%column , dim1name=namep, ncid=ncid, flag='write') - ! ---------------------------------------------------------------- - call ncd_io(varname='pfts1d_wtgcell' , data=pptr%wtgcell , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtlunit' , data=pptr%wtlunit , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_wtcol' , data=pptr%wtcol , dim1name=namep, ncid=ncid, flag='write') - call ncd_io(varname='pfts1d_itype_veg', data=pptr%itype , dim1name=namep, ncid=ncid, flag='write') - - do p=begp,endp - iparr(p) = lptr%itype(pptr%landunit(p)) - enddo - call ncd_io(varname='pfts1d_itype_lunit', data=iparr , dim1name=namep, ncid=ncid, flag='write') - - deallocate(rgarr,rlarr,rcarr,rparr) - deallocate(igarr,ilarr,icarr,iparr) - - end if - - end subroutine hfields_1dinfo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_htapes_wrapup -! -! !INTERFACE: - subroutine hist_htapes_wrapup( rstwr, nlend ) -! -! !DESCRIPTION: -! Write history tape(s) -! Determine if next time step is beginning of history interval and if so: -! increment the current time sample counter, open a new history file -! and if needed (i.e., when ntim = 1), write history data to current -! history file, reset field accumulation counters to zero. -! If primary history file is full or at the last time step of the simulation, -! write restart dataset and close all history fiels. -! If history file is full or at the last time step of the simulation: -! close history file -! and reset time sample counter to zero if file is full. -! Daily-averaged data for the first day in September are written on -! date = 00/09/02 with mscur = 0. -! Daily-averaged data for the first day in month mm are written on -! date = yyyy/mm/02 with mscur = 0. -! Daily-averaged data for the 30th day (last day in September) are written -! on date = 0000/10/01 mscur = 0. -! Daily-averaged data for the last day in month mm are written on -! date = yyyy/mm+1/01 with mscur = 0. -! -! !USES: - use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time, get_prev_date - use clm_varcon , only : secspday - use clmtype -! -! !ARGUMENTS: - implicit none - logical, intent(in) :: rstwr ! true => write restart file this step - logical, intent(in) :: nlend ! true => end of run on this step -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: t ! tape index - integer :: f ! field index - integer :: ier ! error code - integer :: nstep ! current step - integer :: day ! current day (1 -> 31) - integer :: mon ! current month (1 -> 12) - integer :: yr ! current year (0 -> ...) - integer :: mdcur ! current day - integer :: mscur ! seconds of current day - integer :: mcsec ! current time of day [seconds] - integer :: daym1 ! nstep-1 day (1 -> 31) - integer :: monm1 ! nstep-1 month (1 -> 12) - integer :: yrm1 ! nstep-1 year (0 -> ...) - integer :: mcsecm1 ! nstep-1 time of day [seconds] - real(r8):: time ! current time - character(len=256) :: str ! global attribute string - logical :: if_stop ! true => last time step of run - logical, save :: do_3Dtconst = .true. ! true => write out 3D time-constant data - character(len=*),parameter :: subname = 'hist_htapes_wrapup' -!----------------------------------------------------------------------- - - ! get current step - - nstep = get_nstep() - - ! Set calendar for current time step - - call get_curr_date (yr, mon, day, mcsec) - call get_curr_time (mdcur, mscur) - time = mdcur + mscur/secspday - - ! Set calendar for current for previous time step - - call get_prev_date (yrm1, monm1, daym1, mcsecm1) - - ! Loop over active history tapes, create new history files if necessary - ! and write data to history files if end of history interval. - do t = 1, ntapes - - ! Skip nstep=0 if monthly average - - if (nstep==0 .and. tape(t)%nhtfrq==0) cycle - - ! Determine if end of history interval - tape(t)%is_endhist = .false. - if (tape(t)%nhtfrq==0) then !monthly average - if (mon /= monm1) tape(t)%is_endhist = .true. - else - if (mod(nstep,tape(t)%nhtfrq) == 0) tape(t)%is_endhist = .true. - end if - - ! If end of history interval - - if (tape(t)%is_endhist) then - - ! Normalize history buffer if time averaged - - call hfields_normalize(t) - - ! Increment current time sample counter. - - tape(t)%ntimes = tape(t)%ntimes + 1 - - ! Create history file if appropriate and build time comment - - ! If first time sample, generate unique history file name, open file, - ! define dims, vars, etc. - - if (tape(t)%ntimes == 1) then - locfnh(t) = set_hist_filename (hist_freq=tape(t)%nhtfrq, & - hist_mfilt=tape(t)%mfilt, hist_file=t) - if (masterproc) then - write(iulog,*) trim(subname),' : Creating history file ', trim(locfnh(t)), & - ' at nstep = ',get_nstep() - write(iulog,*)'calling htape_create for file t = ',t - endif - call htape_create (t) - - ! Define time-constant field variables - call htape_timeconst(t, mode='define') - - ! Define 3D time-constant field variables only to first primary tape - - if ( do_3Dtconst .and. t == 1 ) then - call htape_timeconst3D(t, mode='define') - TimeConst3DVars_Filename = trim(locfnh(t)) - end if - - ! Define model field variables - - call hfields_write(t, mode='define') - - ! Exit define model - call ncd_enddef(nfid(t)) - - endif - - ! Write time constant history variables - call htape_timeconst(t, mode='write') - - ! Write 3D time constant history variables only to first primary tape - if ( do_3Dtconst .and. t == 1 .and. tape(t)%ntimes == 1 )then - call htape_timeconst3D(t, mode='write') - do_3Dtconst = .false. - end if - - if (masterproc) then - write(iulog,*) - write(iulog,*) trim(subname),' : Writing current time sample to local history file ', & - trim(locfnh(t)),' at nstep = ',get_nstep(), & - ' for history time interval beginning at ', tape(t)%begtime, & - ' and ending at ',time - write(iulog,*) - call shr_sys_flush(iulog) - endif - - ! Update beginning time of next interval - - tape(t)%begtime = time - - ! Write history time samples - - call hfields_write(t, mode='write') - - ! Zero necessary history buffers - - call hfields_zero(t) - - end if - - end do ! end loop over history tapes - - ! Determine if file needs to be closed - - call hist_do_disp (ntapes, tape(:)%ntimes, tape(:)%mfilt, if_stop, if_disphist, rstwr, nlend) - - ! Close open history file - ! Auxilary files may have been closed and saved off without being full, - ! must reopen the files - - do t = 1, ntapes - if (if_disphist(t)) then - if (tape(t)%ntimes /= 0) then - if (masterproc) then - write(iulog,*) - write(iulog,*) trim(subname),' : Closing local history file ',& - trim(locfnh(t)),' at nstep = ', get_nstep() - write(iulog,*) - endif - call ncd_pio_closefile(nfid(t)) - if (.not.if_stop .and. (tape(t)%ntimes/=tape(t)%mfilt)) then - call ncd_pio_openfile (nfid(t), trim(locfnh(t)), ncd_write) - end if - else - if (masterproc) then - write(iulog,*) trim(subname),' : history tape ',t,': no open file to close' - end if - endif - endif - end do - - ! Reset number of time samples to zero if file is full - - do t = 1, ntapes - if (if_disphist(t) .and. tape(t)%ntimes==tape(t)%mfilt) then - tape(t)%ntimes = 0 - end if - end do - - end subroutine hist_htapes_wrapup - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_restart_ncd -! -! !INTERFACE: - subroutine hist_restart_ncd (ncid, flag, rdate) -! -! !DESCRIPTION: -! Read/write history file restart data. -! If the current history file(s) are not full, file(s) are opened -! so that subsequent time samples are added until the file is full. -! A new history file is used on a branch run. -! -! !USES: - use clm_varctl , only : nsrest, caseid, inst_suffix, nsrStartup, nsrBranch - use fileutils , only : getfil - use clmtype - use domainMod , only : ldomain - use clm_varpar , only : nlevgrnd, nlevlak, numrad - use clm_time_manager, only : is_restart -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netcdf file - character(len=*) , intent(in) :: flag !'read' or 'write' - character(len=*) , intent(in), optional :: rdate ! restart file time stamp for name -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: max_nflds ! Max number of fields - integer :: num1d,beg1d,end1d ! 1d size, beginning and ending indices - integer :: num1d_out,beg1d_out,end1d_out ! 1d size, beginning and ending indices - integer :: num2d ! 2d size (e.g. number of vertical levels) - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numa ! total number of atm cells across all processors - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - character(len=max_namlen) :: name ! variable name - character(len=max_namlen) :: name_acc ! accumulator variable name - character(len=max_namlen) :: long_name ! long name of variable - character(len=max_chars) :: long_name_acc ! long name for accumulator - character(len=max_chars) :: units ! units of variable - character(len=max_chars) :: units_acc ! accumulator units - character(len=max_chars) :: fname ! full name of history file - character(len=max_chars) :: locrest(max_tapes) ! local history restart file names - - character(len=max_namlen),allocatable :: tname(:) - character(len=max_chars), allocatable :: tunits(:),tlongname(:) - character(len=8), allocatable :: tmpstr(:,:) - character(len=1), allocatable :: tavgflag(:) - integer :: start(2) - - character(len=1) :: hnum ! history file index - character(len=8) :: type1d ! clm pointer 1d type - character(len=8) :: type1d_out ! history buffer 1d type - character(len=8) :: type2d ! history buffer 2d type - character(len=32) :: dim1name ! temporary - character(len=32) :: dim2name ! temporary - type(var_desc_t) :: name_desc ! variable descriptor for name - type(var_desc_t) :: longname_desc ! variable descriptor for long_name - type(var_desc_t) :: units_desc ! variable descriptor for units - type(var_desc_t) :: type1d_desc ! variable descriptor for type1d - type(var_desc_t) :: type1d_out_desc ! variable descriptor for type1d_out - type(var_desc_t) :: type2d_desc ! variable descriptor for type2d - type(var_desc_t) :: avgflag_desc ! variable descriptor for avgflag - type(var_desc_t) :: p2c_scale_type_desc ! variable descriptor for p2c_scale_type - type(var_desc_t) :: c2l_scale_type_desc ! variable descriptor for c2l_scale_type - type(var_desc_t) :: l2g_scale_type_desc ! variable descriptor for l2g_scale_type - integer :: status ! error status - integer :: dimid ! dimension ID - integer :: k ! 1d index - integer :: ntapes_onfile ! number of history tapes on the restart file - integer :: nflds_onfile ! number of history fields on the restart file - integer :: t ! tape index - integer :: f ! field index - integer :: varid ! variable id - integer, allocatable :: itemp(:) ! temporary - real(r8), pointer :: hbuf(:,:) ! history buffer - real(r8), pointer :: hbuf1d(:) ! 1d history buffer - integer , pointer :: nacs(:,:) ! accumulation counter - integer , pointer :: nacs1d(:) ! 1d accumulation counter - character(len=*),parameter :: subname = 'hist_restart_ncd' -!------------------------------------------------------------------------ - - ! If branch run, initialize file times and return - - if (flag == 'read') then - if (nsrest == nsrBranch) then - do t = 1,ntapes - tape(t)%ntimes = 0 - end do - RETURN - end if - ! If startup run just return - if (nsrest == nsrStartup) then - RETURN - end if - endif - - ! Read history file data only for restart run (not for branch run) - - ! - ! First when writing out and in define mode, create files and define all variables - ! - !================================================ - if (flag == 'define') then - !================================================ - - if (.not. present(rdate)) then - call endrun('variable rdate must be present for writing restart files') - end if - - ! - ! On master restart file add ntapes/max_chars dimension - ! and then add the history and history restart filenames - ! - call ncd_defdim( ncid, 'ntapes' , ntapes , dimid) - call ncd_defdim( ncid, 'max_chars' , max_chars , dimid) - - call ncd_defvar(ncid=ncid, varname='locfnh', xtype=ncd_char, & - long_name="History filename", & - comment="This variable NOT needed for startup or branch simulations", & - dim1name='max_chars', dim2name="ntapes" ) - call ncd_defvar(ncid=ncid, varname='locfnhr', xtype=ncd_char, & - long_name="Restart history filename", & - comment="This variable NOT needed for startup or branch simulations", & - dim1name='max_chars', dim2name="ntapes" ) - - ! max_nflds is the maximum number of fields on any tape - ! max_flds is the maximum number possible number of fields - - max_nflds = max_nFields() - - call get_proc_global(numg, numl, numc, nump) - - ! Loop over tapes - write out namelist information to each restart-history tape - ! only read/write accumulators and counters if needed - - do t = 1,ntapes - - ! - ! Create the restart history filename and open it - ! - write(hnum,'(i1.1)') t-1 - locfnhr(t) = "./" // trim(caseid) //".clm2"// trim(inst_suffix) & - // ".rh" // hnum //"."// trim(rdate) //".nc" - - call htape_create( t, histrest=.true. ) - - ! - ! Add read/write accumultators and counters if needed - ! - if (.not. tape(t)%is_endhist) then - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - long_name = tape(t)%hlist(f)%field%long_name - units = tape(t)%hlist(f)%field%units - name_acc = trim(name) // "_acc" - units_acc = "unitless positive integer" - long_name_acc = trim(long_name) // " accumulator number of samples" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (type1d_out == grlnd) then - if (ldomain%isgrid2d) then - dim1name = 'lon' ; dim2name = 'lat' - else - dim1name = trim(grlnd); dim2name = 'undefined' - end if - else - dim1name = type1d_out ; dim2name = 'undefined' - endif - - if (dim2name == 'undefined') then - if (num2d == 1) then - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, & - long_name=trim(long_name_acc), units=trim(units_acc)) - else - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=type2d, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=type2d, & - long_name=trim(long_name_acc), units=trim(units_acc)) - end if - else - if (num2d == 1) then - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=dim2name, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=dim2name, & - long_name=trim(long_name_acc), units=trim(units_acc)) - else - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name), xtype=ncd_double, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, & - long_name=trim(long_name), units=trim(units)) - call ncd_defvar(ncid=ncid_hist(t), varname=trim(name_acc), xtype=ncd_int, & - dim1name=dim1name, dim2name=dim2name, dim3name=type2d, & - long_name=trim(long_name_acc), units=trim(units_acc)) - end if - endif - end do - endif - - ! - ! Add namelist information to each restart history tape - ! - call ncd_defdim( ncid_hist(t), 'fname_lenp2' , max_namlen+2, dimid) - call ncd_defdim( ncid_hist(t), 'fname_len' , max_namlen , dimid) - call ncd_defdim( ncid_hist(t), 'len1' , 1 , dimid) - call ncd_defdim( ncid_hist(t), 'scalar' , 1 , dimid) - call ncd_defdim( ncid_hist(t), 'max_chars' , max_chars , dimid) - call ncd_defdim( ncid_hist(t), 'max_nflds' , max_nflds , dimid) - call ncd_defdim( ncid_hist(t), 'max_flds' , max_flds , dimid) - - call ncd_defvar(ncid=ncid_hist(t), varname='nhtfrq', xtype=ncd_int, & - long_name="Frequency of history writes", & - comment="Namelist item", & - units="absolute value of negative is in hours, 0=monthly, positive is time-steps", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='mfilt', xtype=ncd_int, & - long_name="Number of history time samples on a file", units="unitless", & - comment="Namelist item", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='ncprec', xtype=ncd_int, & - long_name="Flag for data precision", flag_values=(/1,2/), & - comment="Namelist item", & - nvalid_range=(/1,2/), & - flag_meanings=(/"single-precision", "double-precision"/), & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='dov2xy', xtype=ncd_log, & - long_name="Output on 2D grid format (TRUE) or vector format (FALSE)", & - comment="Namelist item", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='fincl', xtype=ncd_char, & - comment="Namelist item", & - long_name="Fieldnames to include", & - dim1name='fname_lenp2', dim2name='max_flds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='fexcl', xtype=ncd_char, & - comment="Namelist item", & - long_name="Fieldnames to exclude", & - dim1name='fname_lenp2', dim2name='max_flds' ) - - call ncd_defvar(ncid=ncid_hist(t), varname='nflds', xtype=ncd_int, & - long_name="Number of fields on file", units="unitless", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='ntimes', xtype=ncd_int, & - long_name="Number of time steps on file", units="time-step", & - dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='is_endhist', xtype=ncd_log, & - long_name="End of history file", dim1name='scalar') - call ncd_defvar(ncid=ncid_hist(t), varname='begtime', xtype=ncd_double, & - long_name="Beginning time", units="time units", & - dim1name='scalar') - - call ncd_defvar(ncid=ncid_hist(t), varname='num2d', xtype=ncd_int, & - long_name="Size of second dimension", units="unitless", & - dim1name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='hpindex', xtype=ncd_int, & - long_name="History pointer index", units="unitless", & - dim1name='max_nflds' ) - - call ncd_defvar(ncid=ncid_hist(t), varname='avgflag', xtype=ncd_char, & - long_name="Averaging flag", & - units="A=Average, X=Maximum, M=Minimum, I=Instantaneous", & - dim1name='len1', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='name', xtype=ncd_char, & - long_name="Fieldnames", & - dim1name='fname_len', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='long_name', xtype=ncd_char, & - long_name="Long descriptive names for fields", & - dim1name='max_chars', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='units', xtype=ncd_char, & - long_name="Units for each history field output", & - dim1name='max_chars', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type1d', xtype=ncd_char, & - long_name="1st dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type1d_out', xtype=ncd_char, & - long_name="1st output dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='type2d', xtype=ncd_char, & - long_name="2nd dimension type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='p2c_scale_type', xtype=ncd_char, & - long_name="PFT to column scale type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='c2l_scale_type', xtype=ncd_char, & - long_name="column to landunit scale type", & - dim1name='string_length', dim2name='max_nflds' ) - call ncd_defvar(ncid=ncid_hist(t), varname='l2g_scale_type', xtype=ncd_char, & - long_name="landunit to gridpoint scale type", & - dim1name='string_length', dim2name='max_nflds' ) - - call ncd_enddef(ncid_hist(t)) - - end do ! end of ntapes loop - - RETURN - - ! - ! First write out namelist information to each restart history file - ! - !================================================ - else if (flag == 'write') then - !================================================ - - ! Add history filenames to master restart file - do t = 1,ntapes - call ncd_io('locfnh', locfnh(t), 'write', ncid, nt=t) - call ncd_io('locfnhr', locfnhr(t), 'write', ncid, nt=t) - end do - - fincl(:,1) = hist_fincl1(:) - fincl(:,2) = hist_fincl2(:) - fincl(:,3) = hist_fincl3(:) - fincl(:,4) = hist_fincl4(:) - fincl(:,5) = hist_fincl5(:) - fincl(:,6) = hist_fincl6(:) - - fexcl(:,1) = hist_fexcl1(:) - fexcl(:,2) = hist_fexcl2(:) - fexcl(:,3) = hist_fexcl3(:) - fexcl(:,4) = hist_fexcl4(:) - fexcl(:,5) = hist_fexcl5(:) - fexcl(:,6) = hist_fexcl6(:) - - max_nflds = max_nFields() - - start(1)=1 - - - ! - ! Add history namelist data to each history restart tape - ! - allocate(itemp(max_nflds)) - - do t = 1,ntapes - call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='is_endhist', data=tape(t)%is_endhist, ncid=ncid_hist(t), flag='write') - - call ncd_io(varname='dov2xy', data=tape(t)%dov2xy, ncid=ncid_hist(t), flag='write') - - itemp(:) = 0 - do f=1,tape(t)%nflds - itemp(f) = tape(t)%hlist(f)%field%num2d - end do - call ncd_io(varname='num2d', data=itemp(:), ncid=ncid_hist(t), flag='write') - - itemp(:) = 0 - do f=1,tape(t)%nflds - itemp(f) = tape(t)%hlist(f)%field%hpindex - end do - call ncd_io(varname='hpindex', data=itemp(:), ncid=ncid_hist(t), flag='write') - - call ncd_io('nflds', tape(t)%nflds, 'write', ncid_hist(t) ) - call ncd_io('ntimes', tape(t)%ntimes, 'write', ncid_hist(t) ) - call ncd_io('nhtfrq', tape(t)%nhtfrq, 'write', ncid_hist(t) ) - call ncd_io('mfilt', tape(t)%mfilt, 'write', ncid_hist(t) ) - call ncd_io('ncprec', tape(t)%ncprec, 'write', ncid_hist(t) ) - call ncd_io('begtime', tape(t)%begtime, 'write', ncid_hist(t) ) - allocate(tmpstr(tape(t)%nflds,6 ),tname(tape(t)%nflds), & - tavgflag(tape(t)%nflds),tunits(tape(t)%nflds),tlongname(tape(t)%nflds)) - do f=1,tape(t)%nflds - tname(f) = tape(t)%hlist(f)%field%name - tunits(f) = tape(t)%hlist(f)%field%units - tlongname(f) = tape(t)%hlist(f)%field%long_name - tmpstr(f,1) = tape(t)%hlist(f)%field%type1d - tmpstr(f,2) = tape(t)%hlist(f)%field%type1d_out - tmpstr(f,3) = tape(t)%hlist(f)%field%type2d - tavgflag(f) = tape(t)%hlist(f)%avgflag - tmpstr(f,4) = tape(t)%hlist(f)%field%p2c_scale_type - tmpstr(f,5) = tape(t)%hlist(f)%field%c2l_scale_type - tmpstr(f,6) = tape(t)%hlist(f)%field%l2g_scale_type - end do - call ncd_io( 'name', tname, 'write',ncid_hist(t)) - call ncd_io('long_name', tlongname, 'write', ncid_hist(t)) - call ncd_io('units', tunits, 'write',ncid_hist(t)) - call ncd_io('type1d', tmpstr(:,1), 'write', ncid_hist(t)) - call ncd_io('type1d_out', tmpstr(:,2), 'write', ncid_hist(t)) - call ncd_io('type2d', tmpstr(:,3), 'write', ncid_hist(t)) - call ncd_io('avgflag',tavgflag , 'write', ncid_hist(t)) - call ncd_io('p2c_scale_type', tmpstr(:,4), 'write', ncid_hist(t)) - call ncd_io('c2l_scale_type', tmpstr(:,5), 'write', ncid_hist(t)) - call ncd_io('l2g_scale_type', tmpstr(:,6), 'write', ncid_hist(t)) - deallocate(tname,tlongname,tunits,tmpstr,tavgflag) - enddo - deallocate(itemp) - - ! - ! Read in namelist information - ! - !================================================ - else if (flag == 'read') then - !================================================ - - call ncd_inqdlen(ncid,dimid,ntapes_onfile, name='ntapes') - if ( is_restart() .and. ntapes_onfile /= ntapes )then - write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile - call endrun( trim(subname)//' ERROR: number of ntapes different than on restart file!, '// & - ' you can NOT change history options on restart!' ) - end if - if ( is_restart() .and. ntapes > 0 )then - call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid ) - call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid ) - do t = 1,ntapes - call strip_null(locrest(t)) - call strip_null(locfnh(t)) - end do - end if - - ! Determine necessary indices - the following is needed if model decomposition is different on restart - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - - start(1)=1 - - do t = 1,ntapes - - call getfil( locrest(t), locfnhr(t), 0 ) - call ncd_pio_openfile (ncid_hist(t), trim(locfnhr(t)), ncd_nowrite) - - if ( t == 1 )then - - call ncd_inqdlen(ncid_hist(1),dimid,max_nflds,name='max_nflds') - - allocate(itemp(max_nflds)) - end if - - call ncd_inqvid(ncid_hist(t), 'name', varid, name_desc) - call ncd_inqvid(ncid_hist(t), 'long_name', varid, longname_desc) - call ncd_inqvid(ncid_hist(t), 'units', varid, units_desc) - call ncd_inqvid(ncid_hist(t), 'type1d', varid, type1d_desc) - call ncd_inqvid(ncid_hist(t), 'type1d_out', varid, type1d_out_desc) - call ncd_inqvid(ncid_hist(t), 'type2d', varid, type2d_desc) - call ncd_inqvid(ncid_hist(t), 'avgflag', varid, avgflag_desc) - call ncd_inqvid(ncid_hist(t), 'p2c_scale_type', varid, p2c_scale_type_desc) - call ncd_inqvid(ncid_hist(t), 'c2l_scale_type', varid, c2l_scale_type_desc) - call ncd_inqvid(ncid_hist(t), 'l2g_scale_type', varid, l2g_scale_type_desc) - - call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='read') - - call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='read') - - call ncd_io('nflds', tape(t)%nflds, 'read', ncid_hist(t) ) - call ncd_io('ntimes', tape(t)%ntimes, 'read', ncid_hist(t) ) - call ncd_io('nhtfrq', tape(t)%nhtfrq, 'read', ncid_hist(t) ) - call ncd_io('mfilt', tape(t)%mfilt, 'read', ncid_hist(t) ) - call ncd_io('ncprec', tape(t)%ncprec, 'read', ncid_hist(t) ) - call ncd_io('begtime', tape(t)%begtime, 'read', ncid_hist(t) ) - - call ncd_io(varname='is_endhist', data=tape(t)%is_endhist, ncid=ncid_hist(t), flag='read') - call ncd_io(varname='dov2xy', data=tape(t)%dov2xy, ncid=ncid_hist(t), flag='read') - call ncd_io(varname='num2d', data=itemp(:), ncid=ncid_hist(t), flag='read') - do f=1,tape(t)%nflds - tape(t)%hlist(f)%field%num2d = itemp(f) - end do - - call ncd_io(varname='hpindex', data=itemp(:), ncid=ncid_hist(t), flag='read') - do f=1,tape(t)%nflds - tape(t)%hlist(f)%field%hpindex = itemp(f) - end do - - do f=1,tape(t)%nflds - start(2) = f - call ncd_io( name_desc, tape(t)%hlist(f)%field%name, & - 'read', ncid_hist(t), start ) - call ncd_io( longname_desc, tape(t)%hlist(f)%field%long_name, & - 'read', ncid_hist(t), start ) - call ncd_io( units_desc, tape(t)%hlist(f)%field%units, & - 'read', ncid_hist(t), start ) - call ncd_io( type1d_desc, tape(t)%hlist(f)%field%type1d, & - 'read', ncid_hist(t), start ) - call ncd_io( type1d_out_desc, tape(t)%hlist(f)%field%type1d_out, & - 'read', ncid_hist(t), start ) - call ncd_io( type2d_desc, tape(t)%hlist(f)%field%type2d, & - 'read', ncid_hist(t), start ) - call ncd_io( avgflag_desc, tape(t)%hlist(f)%avgflag, & - 'read', ncid_hist(t), start ) - call ncd_io( p2c_scale_type_desc, tape(t)%hlist(f)%field%p2c_scale_type, & - 'read', ncid_hist(t), start ) - call ncd_io( c2l_scale_type_desc, tape(t)%hlist(f)%field%c2l_scale_type, & - 'read', ncid_hist(t), start ) - call ncd_io( l2g_scale_type_desc, tape(t)%hlist(f)%field%l2g_scale_type, & - 'read', ncid_hist(t), start ) - call strip_null(tape(t)%hlist(f)%field%name) - call strip_null(tape(t)%hlist(f)%field%long_name) - call strip_null(tape(t)%hlist(f)%field%units) - call strip_null(tape(t)%hlist(f)%field%type1d) - call strip_null(tape(t)%hlist(f)%field%type1d_out) - call strip_null(tape(t)%hlist(f)%field%type2d) - call strip_null(tape(t)%hlist(f)%field%p2c_scale_type) - call strip_null(tape(t)%hlist(f)%field%c2l_scale_type) - call strip_null(tape(t)%hlist(f)%field%l2g_scale_type) - call strip_null(tape(t)%hlist(f)%avgflag) - - type1d_out = trim(tape(t)%hlist(f)%field%type1d_out) - select case (trim(type1d_out)) - case (grlnd) - num1d_out = numg - beg1d_out = begg - end1d_out = endg - case (nameg) - num1d_out = numg - beg1d_out = begg - end1d_out = endg - case (namel) - num1d_out = numl - beg1d_out = begl - end1d_out = endl - case (namec) - num1d_out = numc - beg1d_out = begc - end1d_out = endc - case (namep) - num1d_out = nump - beg1d_out = begp - end1d_out = endp - case default - write(iulog,*) trim(subname),' ERROR: read unknown 1d output type=',trim(type1d_out) - call endrun () - end select - - tape(t)%hlist(f)%field%num1d_out = num1d_out - tape(t)%hlist(f)%field%beg1d_out = beg1d_out - tape(t)%hlist(f)%field%end1d_out = end1d_out - - num2d = tape(t)%hlist(f)%field%num2d - allocate (tape(t)%hlist(f)%hbuf(beg1d_out:end1d_out,num2d), & - tape(t)%hlist(f)%nacs(beg1d_out:end1d_out,num2d), & - stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation error for hbuf,nacs at t,f=',t,f,beg1d_out,end1d_out,num2d - call endrun() - endif - tape(t)%hlist(f)%hbuf(:,:) = 0._r8 - tape(t)%hlist(f)%nacs(:,:) = 0 - - type1d = tape(t)%hlist(f)%field%type1d - select case (type1d) - case (grlnd) - num1d = numg - beg1d = begg - end1d = endg - case (nameg) - num1d = numg - beg1d = begg - end1d = endg - case (namel) - num1d = numl - beg1d = begl - end1d = endl - case (namec) - num1d = numc - beg1d = begc - end1d = endc - case (namep) - num1d = nump - beg1d = begp - end1d = endp - case default - write(iulog,*) trim(subname),' ERROR: read unknown 1d type=',type1d - call endrun () - end select - - tape(t)%hlist(f)%field%num1d = num1d - tape(t)%hlist(f)%field%beg1d = beg1d - tape(t)%hlist(f)%field%end1d = end1d - - end do ! end of flds loop - - ! If history file is not full, open it - - if (tape(t)%ntimes /= 0) then - call ncd_pio_openfile (nfid(t), trim(locfnh(t)), ncd_write) - end if - - end do ! end of tapes loop - - hist_fincl1(:) = fincl(:,1) - hist_fincl2(:) = fincl(:,2) - hist_fincl3(:) = fincl(:,3) - hist_fincl4(:) = fincl(:,4) - hist_fincl5(:) = fincl(:,5) - hist_fincl6(:) = fincl(:,6) - - hist_fexcl1(:) = fexcl(:,1) - hist_fexcl2(:) = fexcl(:,2) - hist_fexcl3(:) = fexcl(:,3) - hist_fexcl4(:) = fexcl(:,4) - hist_fexcl5(:) = fexcl(:,5) - hist_fexcl6(:) = fexcl(:,6) - - if ( allocated(itemp) ) deallocate(itemp) - - end if - - !====================================================================== - ! Read/write history file restart data. - ! If the current history file(s) are not full, file(s) are opened - ! so that subsequent time samples are added until the file is full. - ! A new history file is used on a branch run. - !====================================================================== - - if (flag == 'write') then - - do t = 1,ntapes - if (.not. tape(t)%is_endhist) then - - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - name_acc = trim(name) // "_acc" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (num2d == 1) then - allocate(hbuf1d(beg1d_out:end1d_out), & - nacs1d(beg1d_out:end1d_out), stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation'; call endrun() - end if - - hbuf1d(beg1d_out:end1d_out) = hbuf(beg1d_out:end1d_out,1) - nacs1d(beg1d_out:end1d_out) = nacs(beg1d_out:end1d_out,1) - - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name), & - dim1name=type1d_out, data=hbuf1d) - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs1d) - - deallocate(hbuf1d) - deallocate(nacs1d) - else - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name), & - dim1name=type1d_out, data=hbuf) - call ncd_io(ncid=ncid_hist(t), flag='write', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs) - end if - - end do - - end if ! end of is_endhist block - - call ncd_pio_closefile(ncid_hist(t)) - - end do ! end of ntapes loop - - else if (flag == 'read') then - - ! Read history restart information if history files are not full - - do t = 1,ntapes - - if (.not. tape(t)%is_endhist) then - - do f = 1,tape(t)%nflds - name = tape(t)%hlist(f)%field%name - name_acc = trim(name) // "_acc" - type1d_out = tape(t)%hlist(f)%field%type1d_out - type2d = tape(t)%hlist(f)%field%type2d - num2d = tape(t)%hlist(f)%field%num2d - beg1d_out = tape(t)%hlist(f)%field%beg1d_out - end1d_out = tape(t)%hlist(f)%field%end1d_out - nacs => tape(t)%hlist(f)%nacs - hbuf => tape(t)%hlist(f)%hbuf - - if (num2d == 1) then - allocate(hbuf1d(beg1d_out:end1d_out), & - nacs1d(beg1d_out:end1d_out), stat=status) - if (status /= 0) then - write(iulog,*) trim(subname),' ERROR: allocation'; call endrun() - end if - - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf1d) - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs1d) - - hbuf(beg1d_out:end1d_out,1) = hbuf1d(beg1d_out:end1d_out) - nacs(beg1d_out:end1d_out,1) = nacs1d(beg1d_out:end1d_out) - - deallocate(hbuf1d) - deallocate(nacs1d) - else - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name), & - dim1name=type1d_out, data=hbuf) - call ncd_io(ncid=ncid_hist(t), flag='read', varname=trim(name_acc), & - dim1name=type1d_out, data=nacs) - end if - end do - - end if - - call ncd_pio_closefile(ncid_hist(t)) - - end do - - end if - - end subroutine hist_restart_ncd - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: max_nFields -! -! !INTERFACE: -integer function max_nFields() -! -! !DESCRIPTION: -! Get the maximum number of fields on all tapes. -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Erik Kluzek -! -! -! !LOCAL VARIABLES: -!EOP - integer :: t ! index - character(len=*),parameter :: subname = 'max_nFields' -!----------------------------------------------------------------------- - max_nFields = 0 - do t = 1,ntapes - max_nFields = max(max_nFields, tape(t)%nflds) - end do - - return - -end function max_nFields - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: getname -! -! !INTERFACE: - character(len=max_namlen) function getname (inname) -! -! !DESCRIPTION: -! Retrieve name portion of inname. If an averaging flag separater character -! is present (:) in inname, lop it off. -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: inname -! -! !REVISION HISTORY: -! Created by Jim Rosinski -! -! -! !LOCAL VARIABLES: -!EOP - integer :: length - integer :: i - character(len=*),parameter :: subname = 'getname' -!----------------------------------------------------------------------- - - length = len (inname) - - if (length < max_namlen .or. length > max_namlen+2) then - write(iulog,*) trim(subname),' ERROR: bad length=',length - call endrun() - end if - - getname = ' ' - do i = 1,max_namlen - if (inname(i:i) == ':') exit - getname(i:i) = inname(i:i) - end do - - end function getname - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: getflag -! -! !INTERFACE: - character(len=1) function getflag (inname) -! -! !DESCRIPTION: -! Retrieve flag portion of inname. If an averaging flag separater character -! is present (:) in inname, return the character after it as the flag -! -! !ARGUMENTS: - implicit none - character(len=*) inname ! character string -! -! !REVISION HISTORY: -! Created by Jim Rosinski -! -! -! !LOCAL VARIABLES: -!EOP - integer :: length ! length of inname - integer :: i ! loop index - character(len=*),parameter :: subname = 'getflag' -!----------------------------------------------------------------------- - - length = len (inname) - - if (length < max_namlen .or. length > max_namlen+2) then - write(iulog,*) trim(subname),' ERROR: bad length=',length - call endrun() - end if - - getflag = ' ' - do i = 1,length - if (inname(i:i) == ':') then - getflag = inname(i+1:i+1) - exit - end if - end do - - end function getflag - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: list_index -! -! !INTERFACE: - subroutine list_index (list, name, index) -! -! !DESCRIPTION: -! -! !USES: -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: list(max_flds) ! input list of names, possibly ":" delimited - character(len=max_namlen), intent(in) :: name ! name to be searched for - integer, intent(out) :: index ! index of "name" in "list" -! -! !REVISION HISTORY: -! Created by Jim Rosinski -! -! -! !LOCAL VARIABLES: -!EOP - character(len=max_namlen) :: listname ! input name with ":" stripped off. - integer f ! field index - character(len=*),parameter :: subname = 'list_index' -!----------------------------------------------------------------------- - - ! Only list items - - index = 0 - do f=1,max_flds - listname = getname (list(f)) - if (listname == ' ') exit - if (listname == name) then - index = f - exit - end if - end do - - end subroutine list_index - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: set_hist_filename -! -! !INTERFACE: - character(len=256) function set_hist_filename (hist_freq, hist_mfilt, hist_file) -! -! !DESCRIPTION: -! Determine history dataset filenames. -! -! !USES: - use clm_varctl, only : caseid, inst_suffix - use clm_time_manager, only : get_curr_date, get_prev_date -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: hist_freq !history file frequency - integer, intent(in) :: hist_mfilt !history file number of time-samples - integer, intent(in) :: hist_file !history file index -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: cdate !date char string - character(len= 1) :: hist_index !p,1 or 2 (currently) - integer :: day !day (1 -> 31) - integer :: mon !month (1 -> 12) - integer :: yr !year (0 -> ...) - integer :: sec !seconds into current day - character(len=*),parameter :: subname = 'set_hist_filename' -!----------------------------------------------------------------------- - - if (hist_freq == 0 .and. hist_mfilt == 1) then !monthly - call get_prev_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2)') yr,mon - else !other - call get_curr_date (yr, mon, day, sec) - write(cdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr,mon,day,sec - endif - write(hist_index,'(i1.1)') hist_file - 1 - set_hist_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".h"//hist_index//"."//trim(cdate)//".nc" - - end function set_hist_filename - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_addfld1d -! -! !INTERFACE: - subroutine hist_addfld1d (fname, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_pft, ptr_lnd, & - ptr_atm, p2c_scale_type, c2l_scale_type, & - l2g_scale_type, set_lake, set_urb, set_nourb, & - set_noglcmec, set_spec, default) -! -! !DESCRIPTION: -! Initialize a single level history field. The pointer, ptrhist, -! is a pointer to the clmtype array that the history buffer will use. -! The value of type1d passed to masterlist\_add\_fld determines which of the -! 1d type of the output and the beginning and ending indices the history -! buffer field). Default history contents for given field on all tapes -! are set by calling [masterlist\_make\_active] for the appropriate tape. -! After the masterlist is built, routine [htapes\_build] is called for an -! initial or branch run to initialize the actual history tapes. -! -! !USES: - use clmtype -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from clmtype) - real(r8) , optional, pointer :: ptr_gcell(:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:) ! pointer to column array - real(r8) , optional, pointer :: ptr_pft(:) ! pointer to pft array - real(r8) , optional, pointer :: ptr_lnd(:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_atm(:) ! pointer to atm array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_noglcmec ! value to set non-glacier_mec to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: p,c,l,g ! indices - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: hpindex ! history buffer pointer index - character(len=8) :: l_type1d ! 1d data type - character(len=8) :: l_type1d_out ! 1d output type - character(len=8) :: scale_type_p2c ! scale type for subgrid averaging of pfts to column - character(len=8) :: scale_type_c2l ! scale type for subgrid averaging of columns to landunits - character(len=8) :: scale_type_l2g ! scale type for subgrid averaging of landunits to gridcells - character(len=*),parameter :: subname = 'hist_addfld1d' -!------------------------------------------------------------------------ - - ! Determine processor bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! History buffer pointer - - hpindex = pointer_index() - - if (present(ptr_lnd)) then - l_type1d = grlnd - l_type1d_out = grlnd - clmptr_rs(hpindex)%ptr => ptr_lnd - - else if (present(ptr_gcell)) then - l_type1d = nameg - l_type1d_out = nameg - clmptr_rs(hpindex)%ptr => ptr_gcell - - else if (present(ptr_lunit)) then - l_type1d = namel - l_type1d_out = namel - clmptr_rs(hpindex)%ptr => ptr_lunit - if (present(set_lake)) then - do l = begl,endl - if (lun%lakpoi(l)) ptr_lunit(l) = set_lake - end do - end if - if (present(set_urb)) then - do l = begl,endl - if (lun%urbpoi(l)) ptr_lunit(l) = set_urb - end do - end if - if (present(set_nourb)) then - do l = begl,endl - if (.not.(lun%urbpoi(l))) ptr_lunit(l) = set_nourb - end do - end if - if (present(set_spec)) then - do l = begl,endl - if (lun%ifspecial(l)) ptr_lunit(l) = set_spec - end do - end if - - else if (present(ptr_col)) then - l_type1d = namec - l_type1d_out = namec - clmptr_rs(hpindex)%ptr => ptr_col - if (present(set_lake)) then - do c = begc,endc - l = col%landunit(c) - if (lun%lakpoi(l)) ptr_col(c) = set_lake - end do - end if - if (present(set_urb)) then - do c = begc,endc - l = col%landunit(c) - if (lun%urbpoi(l)) ptr_col(c) = set_urb - end do - end if - if (present(set_nourb)) then - do c = begc,endc - l = col%landunit(c) - if (.not.(lun%urbpoi(l))) ptr_col(c) = set_nourb - end do - end if - if (present(set_spec)) then - do c = begc,endc - l = col%landunit(c) - if (lun%ifspecial(l)) ptr_col(c) = set_spec - end do - end if - if (present(set_noglcmec)) then - do c = begc,endc - l = col%landunit(c) - if (.not.(lun%glcmecpoi(l))) ptr_col(c) = set_noglcmec - end do - endif - - else if (present(ptr_pft)) then - l_type1d = namep - l_type1d_out = namep - clmptr_rs(hpindex)%ptr => ptr_pft - if (present(set_lake)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%lakpoi(l)) ptr_pft(p) = set_lake - end do - end if - if (present(set_urb)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%urbpoi(l)) ptr_pft(p) = set_urb - end do - end if - if (present(set_nourb)) then - do p = begp,endp - l = pft%landunit(p) - if (.not.(lun%urbpoi(l))) ptr_pft(p) = set_nourb - end do - end if - if (present(set_spec)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%ifspecial(l)) ptr_pft(p) = set_spec - end do - end if - if (present(set_noglcmec)) then - do p = begp,endp - l = pft%landunit(p) - if (.not.(lun%glcmecpoi(l))) ptr_pft(p) = set_noglcmec - end do - end if - else - write(iulog,*) trim(subname),' ERROR: must specify a valid pointer index,', & - ' choices are [ptr_atm, ptr_lnd, ptr_gcell, ptr_lunit, ptr_col, ptr_pft] ' - call endrun() - - end if - - ! Set scaling factor - - scale_type_p2c = 'unity' - scale_type_c2l = 'unity' - scale_type_l2g = 'unity' - - if (present(p2c_scale_type)) scale_type_p2c = p2c_scale_type - if (present(c2l_scale_type)) scale_type_c2l = c2l_scale_type - if (present(l2g_scale_type)) scale_type_l2g = l2g_scale_type - if (present(type1d_out)) l_type1d_out = type1d_out - - ! Add field to masterlist - - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d='unset', num2d=1, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g) - - if (present(default)) then - if (trim(default) == 'inactive') return - else - call masterlist_make_active (name=trim(fname), tape_index=1) - end if - - end subroutine hist_addfld1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_addfld2d -! -! !INTERFACE: - subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, & - ptr_gcell, ptr_lunit, ptr_col, ptr_pft, ptr_lnd, ptr_atm, & - p2c_scale_type, c2l_scale_type, l2g_scale_type, & - set_lake, set_urb, set_nourb, set_spec, default) -! -! !DESCRIPTION: -! Initialize a single level history field. The pointer, ptrhist, -! is a pointer to the clmtype array that the history buffer will use. -! The value of type1d passed to masterlist\_add\_fld determines which of the -! 1d type of the output and the beginning and ending indices the history -! buffer field). Default history contents for given field on all tapes -! are set by calling [masterlist\_make\_active] for the appropriatae tape. -! After the masterlist is built, routine [htapes\_build] is called for an -! initial or branch run to initialize the actual history tapes. -! -! !USES: - use clmtype - use clm_varpar, only : nlevgrnd, nlevlak, numrad, maxpatch_glcmec -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fname ! field name - character(len=*), intent(in) :: type2d ! 2d output type - character(len=*), intent(in) :: units ! units of field - character(len=1), intent(in) :: avgflag ! time averaging flag - character(len=*), intent(in) :: long_name ! long name of field - character(len=*), optional, intent(in) :: type1d_out ! output type (from clmtype) - real(r8) , optional, pointer :: ptr_atm(:,:) ! pointer to atm array - real(r8) , optional, pointer :: ptr_lnd(:,:) ! pointer to lnd array - real(r8) , optional, pointer :: ptr_gcell(:,:) ! pointer to gridcell array - real(r8) , optional, pointer :: ptr_lunit(:,:) ! pointer to landunit array - real(r8) , optional, pointer :: ptr_col(:,:) ! pointer to column array - real(r8) , optional, pointer :: ptr_pft(:,:) ! pointer to pft array - real(r8) , optional, intent(in) :: set_lake ! value to set lakes to - real(r8) , optional, intent(in) :: set_urb ! value to set urban to - real(r8) , optional, intent(in) :: set_nourb ! value to set non-urban to - real(r8) , optional, intent(in) :: set_spec ! value to set special to - character(len=*), optional, intent(in) :: p2c_scale_type ! scale type for subgrid averaging of pfts to column - character(len=*), optional, intent(in) :: c2l_scale_type ! scale type for subgrid averaging of columns to landunits - character(len=*), optional, intent(in) :: l2g_scale_type ! scale type for subgrid averaging of landunits to gridcells - character(len=*), optional, intent(in) :: default ! if set to 'inactive, field will not appear on primary tape -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: p,c,l,g ! indices - integer :: num2d ! size of second dimension (e.g. number of vertical levels) - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: hpindex ! history buffer index - character(len=8) :: l_type1d ! 1d data type - character(len=8) :: l_type1d_out ! 1d output type - character(len=8) :: scale_type_p2c ! scale type for subgrid averaging of pfts to column - character(len=8) :: scale_type_c2l ! scale type for subgrid averaging of columns to landunits - character(len=8) :: scale_type_l2g ! scale type for subgrid averaging of landunits to gridcells - character(len=*),parameter :: subname = 'hist_addfld2d' -!------------------------------------------------------------------------ - - ! Determine second dimension size - - select case (type2d) - case ('levgrnd') - num2d = nlevgrnd - case ('levlak') - num2d = nlevlak - case ('numrad') - num2d = numrad - case ('glc_nec') - if (maxpatch_glcmec > 0) then - num2d = maxpatch_glcmec - else - write(iulog,*) trim(subname),' ERROR: 2d type =', trim(type2d), & - ' only valid for maxpatch_glcmec > 0' - call endrun() - end if - case default - write(iulog,*) trim(subname),' ERROR: unsupported 2d type ',type2d, & - ' currently supported types for multi level fields are [levgrnd,levlak,numrad,glc_nec]' - call endrun() - end select - - ! Determine processor bounds - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! History buffer pointer - - hpindex = pointer_index() - - if (present(ptr_lnd)) then - l_type1d = grlnd - l_type1d_out = grlnd - clmptr_ra(hpindex)%ptr => ptr_lnd - - else if (present(ptr_gcell)) then - l_type1d = nameg - l_type1d_out = nameg - clmptr_ra(hpindex)%ptr => ptr_gcell - - else if (present(ptr_lunit)) then - l_type1d = namel - l_type1d_out = namel - clmptr_ra(hpindex)%ptr => ptr_lunit - if (present(set_lake)) then - do l = begl,endl - if (lun%lakpoi(l)) ptr_lunit(l,:) = set_lake - end do - end if - if (present(set_urb)) then - do l = begl,endl - if (lun%urbpoi(l)) ptr_lunit(l,:) = set_urb - end do - end if - if (present(set_nourb)) then - do l = begl,endl - if (.not.(lun%urbpoi(l))) ptr_lunit(l,:) = set_nourb - end do - end if - if (present(set_spec)) then - do l = begl,endl - if (lun%ifspecial(l)) ptr_lunit(l,:) = set_spec - end do - end if - - else if (present(ptr_col)) then - l_type1d = namec - l_type1d_out = namec - clmptr_ra(hpindex)%ptr => ptr_col - if (present(set_lake)) then - do c = begc,endc - l = col%landunit(c) - if (lun%lakpoi(l)) ptr_col(c,:) = set_lake - end do - end if - if (present(set_urb)) then - do c = begc,endc - l = col%landunit(c) - if (lun%urbpoi(l)) ptr_col(c,:) = set_urb - end do - end if - if (present(set_nourb)) then - do c = begc,endc - l = col%landunit(c) - if (.not.(lun%urbpoi(l))) ptr_col(c,:) = set_nourb - end do - end if - if (present(set_spec)) then - do c = begc,endc - l = col%landunit(c) - if (lun%ifspecial(l)) ptr_col(c,:) = set_spec - end do - end if - - else if (present(ptr_pft)) then - l_type1d = namep - l_type1d_out = namep - clmptr_ra(hpindex)%ptr => ptr_pft - if (present(set_lake)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%lakpoi(l)) ptr_pft(p,:) = set_lake - end do - end if - if (present(set_urb)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%urbpoi(l)) ptr_pft(p,:) = set_urb - end do - end if - if (present(set_nourb)) then - do p = begp,endp - l = pft%landunit(p) - if (.not.(lun%urbpoi(l))) ptr_pft(p,:) = set_nourb - end do - end if - if (present(set_spec)) then - do p = begp,endp - l = pft%landunit(p) - if (lun%ifspecial(l)) ptr_pft(p,:) = set_spec - end do - end if - - else - write(iulog,*) trim(subname),' ERROR: must specify a valid pointer index,', & - ' choices are ptr_atm, ptr_lnd, ptr_gcell, ptr_lunit, ptr_col, ptr_pft' - call endrun() - - end if - - ! Set scaling factor - - scale_type_p2c = 'unity' - scale_type_c2l = 'unity' - scale_type_l2g = 'unity' - - if (present(p2c_scale_type)) scale_type_p2c = p2c_scale_type - if (present(c2l_scale_type)) scale_type_c2l = c2l_scale_type - if (present(l2g_scale_type)) scale_type_l2g = l2g_scale_type - if (present(type1d_out)) l_type1d_out = type1d_out - - ! Add field to masterlist - - call masterlist_addfld (fname=trim(fname), type1d=l_type1d, type1d_out=l_type1d_out, & - type2d=type2d, num2d=num2d, & - units=units, avgflag=avgflag, long_name=long_name, hpindex=hpindex, & - p2c_scale_type=scale_type_p2c, c2l_scale_type=scale_type_c2l, l2g_scale_type=scale_type_l2g) - - if (present(default)) then - if (trim(default) == 'inactive') return - else - call masterlist_make_active (name=trim(fname), tape_index=1) - end if - - end subroutine hist_addfld2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: pointer_index -! -! !INTERFACE: - integer function pointer_index () -! -! !DESCRIPTION: -! Set the current pointer index and increment the value of the index. -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -!EOP - integer, save :: lastindex = 1 - character(len=*),parameter :: subname = 'pointer_index' -!----------------------------------------------------------------------- - - pointer_index = lastindex - lastindex = lastindex + 1 - if (lastindex > max_mapflds) then - write(iulog,*) trim(subname),' ERROR: ',& - ' lastindex = ',lastindex,' greater than max_mapflds= ',max_mapflds - call endrun() - endif - - end function pointer_index - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_add_subscript -! -! !INTERFACE: - subroutine hist_add_subscript(name, dim) -! -! !DESCRIPTION: -! Add a history variable to the output history tape. -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: name ! name of subscript - integer , intent(in) :: dim ! dimension of subscript -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=*),parameter :: subname = 'hist_add_subscript' -!----------------------------------------------------------------------- - - num_subs = num_subs + 1 - if (num_subs > max_subs) then - write(iulog,*) trim(subname),' ERROR: ',& - ' num_subs = ',num_subs,' greater than max_subs= ',max_subs - call endrun() - endif - subs_name(num_subs) = name - subs_dim(num_subs) = dim - - end subroutine hist_add_subscript - -!----------------------------------------------------------------------- - - subroutine strip_null(str) - character(len=*), intent(inout) :: str - integer :: i - do i=1,len(str) - if(ichar(str(i:i))==0) str(i:i)=' ' - end do - end subroutine strip_null - -!------------------------------------------------------------------------ -!BOP -! -! !ROUTINE: hist_do_disp -! -! !INTERFACE: - subroutine hist_do_disp (ntapes, hist_ntimes, hist_mfilt, if_stop, if_disphist, rstwr, nlend) -! -! !DESCRIPTION: -! Determine logic for closeing and/or disposing history file -! Sets values for if_disphist, if_stop (arguments) -! Remove history files unless this is end of run or -! history file is not full. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_abort - use clm_time_manager, only : is_last_step -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: ntapes !actual number of history tapes - integer, intent(in) :: hist_ntimes(ntapes) !current numbers of time samples on history tape - integer, intent(in) :: hist_mfilt(ntapes) !maximum number of time samples per tape - logical, intent(out) :: if_stop !true => last time step of run - logical, intent(out) :: if_disphist(ntapes) !true => save and dispose history file - logical, intent(in) :: rstwr - logical, intent(in) :: nlend - ! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: t ! history tape index - logical :: rest_now ! temporary - logical :: stop_now ! temporary -!------------------------------------------------------------------------ - - rest_now = .false. - stop_now = .false. - - if (nlend) stop_now = .true. - if (rstwr) rest_now = .true. - - if_stop = stop_now - - if (stop_now) then - ! End of run - dispose all history files - - if_disphist(1:ntapes) = .true. - - else if (rest_now) then - ! Restart - dispose all history files - - do t = 1,ntapes - if_disphist(t) = .true. - end do - else - ! Dispose - - if_disphist(1:ntapes) = .false. - do t = 1,ntapes - if (hist_ntimes(t) == hist_mfilt(t)) then - if_disphist(t) = .true. - endif - end do - endif - - end subroutine hist_do_disp - -end module histFileMod - diff --git a/src_clm40/main/histFldsMod.F90 b/src_clm40/main/histFldsMod.F90 deleted file mode 100644 index 9004215912..0000000000 --- a/src_clm40/main/histFldsMod.F90 +++ /dev/null @@ -1,4599 +0,0 @@ -module histFldsMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: histFldsMod -! -! !DESCRIPTION: -! Module containing initialization of clm history fields and files -! This is the module that the user must modify in order to add new -! history fields or modify defaults associated with existing history -! fields. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - implicit none -! -! !PUBLIC MEMBER FUNCTIONS: - public hist_initFlds ! Build master field list of all possible history - ! file fields -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 03/2003 -! heald (11/28/06) -! -!EOP -!------------------------------------------------------------------------ - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: hist_initFlds -! -! !INTERFACE: - subroutine hist_initFlds() -! -! !DESCRIPTION: -! Build master field list of all possible fields in a history file. -! Each field has associated with it a ``long\_name'' netcdf attribute that -! describes what the field is, and a ``units'' attribute. A subroutine is -! called to add each field to the masterlist. -! -! !USES: - use clmtype - use clm_varcon , only : spval - use clm_varpar , only : maxpatch_glcmec - use clm_atmlnd , only : clm_a2l - use clm_glclnd , only : clm_s2x - use clm_varctl , only : create_glacier_mec_landunit, use_c13, use_cndv, use_cn, use_crop, & - use_snicar_frc - use histFileMod, only : hist_add_subscript, hist_addfld1d, hist_addfld2d, & - hist_printflds - use surfrdMod , only : crop_prog - use shr_megan_mod , only : shr_megan_linkedlist, shr_megan_megcomp_t, shr_megan_megcomps_n - -! -! !ARGUMENTS: - implicit none - - type(shr_megan_megcomp_t), pointer :: meg_cmp - integer :: imeg -! -! !REVISION HISTORY: -! Mariana Vertenstein: Created 03/2003 -! Mariana Vertenstein: Updated interface to create history fields 10/2003 -! -!EOP -!----------------------------------------------------------------------- - - ! Determine what subscripts to add - ! (uncomment the following call and modify it appropriately) - - ! call hist_add_subscript(subname='subscript_name', subdim=subscript_dim) - - ! NOTE: make a field not appear on the primary history tape by default - - ! add the keyword to default='inactive' to the call to addfld_1d or addfld_2d - - ! Snow properties - ! These will be vertically averaged over the snow profile - - call hist_addfld1d (fname='SNOWDP', units='m', & - avgflag='A', long_name='snow height', & - ptr_col=cps%snowdp, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSNO', units='unitless', & - avgflag='A', long_name='fraction of ground covered by snow', & - ptr_col=cps%frac_sno, c2l_scale_type='urbanf') - - ! Temperatures - - call hist_addfld1d (fname='TSA', units='K', & - avgflag='A', long_name='2m air temperature', & - ptr_pft=pes%t_ref2m) - - call hist_addfld1d (fname='TSA_U', units='K', & - avgflag='A', long_name='Urban 2m air temperature', & - ptr_pft=pes%t_ref2m_u, set_nourb=spval) - - call hist_addfld1d (fname='TSA_R', units='K', & - avgflag='A', long_name='Rural 2m air temperature', & - ptr_pft=pes%t_ref2m_r, set_spec=spval) - - call hist_addfld1d(fname='TBUILD', units='K', & - avgflag='A', long_name='internal urban building temperature', & - ptr_lunit=lps%t_building, set_nourb=spval, l2g_scale_type='unity') - - call hist_addfld1d (fname='TREFMNAV', units='K', & - avgflag='A', long_name='daily minimum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_min) - - call hist_addfld1d (fname='TREFMXAV', units='K', & - avgflag='A', long_name='daily maximum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_max) - - call hist_addfld1d (fname='TREFMNAV_U', units='K', & - avgflag='A', long_name='Urban daily minimum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_min_u, set_nourb=spval) - - call hist_addfld1d (fname='TREFMXAV_U', units='K', & - avgflag='A', long_name='Urban daily maximum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_max_u, set_nourb=spval) - - call hist_addfld1d (fname='TREFMNAV_R', units='K', & - avgflag='A', long_name='Rural daily minimum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_min_r, set_spec=spval) - - call hist_addfld1d (fname='TREFMXAV_R', units='K', & - avgflag='A', long_name='Rural daily maximum of average 2-m temperature', & - ptr_pft=pes%t_ref2m_max_r, set_spec=spval) - - call hist_addfld1d (fname='TV', units='K', & - avgflag='A', long_name='vegetation temperature', & - ptr_pft=pes%t_veg) - - call hist_addfld1d (fname='TV24', units='K', & - avgflag='A', long_name='vegetation temperature (last 24hrs)', & - ptr_pft=pvs%t_veg24, default='inactive') - - call hist_addfld1d (fname='TV240', units='K', & - avgflag='A', long_name='vegetation temperature (last 240hrs)', & - ptr_pft=pvs%t_veg240, default='inactive') - - call hist_addfld1d (fname='TG', units='K', & - avgflag='A', long_name='ground temperature', & - ptr_col=ces%t_grnd, c2l_scale_type='urbans') - - call hist_addfld1d (fname='TG_U', units='K', & - avgflag='A', long_name='Urban ground temperature', & - ptr_col=ces%t_grnd_u, set_nourb=spval, c2l_scale_type='urbans') - - call hist_addfld1d (fname='TG_R', units='K', & - avgflag='A', long_name='Rural ground temperature', & - ptr_col=ces%t_grnd_r, set_spec=spval) - - call hist_addfld1d (fname='HCSOI', units='MJ/m2', & - avgflag='A', long_name='soil heat content', & - ptr_col=ces%hc_soi, set_lake=spval, set_urb=spval, l2g_scale_type='veg') - - call hist_addfld1d (fname='HC', units='MJ/m2', & - avgflag='A', long_name='heat content of soil/snow/lake', & - ptr_col=ces%hc_soisno, set_urb=spval) - - call hist_addfld2d (fname='TSOI', units='K', type2d='levgrnd', & - avgflag='A', long_name='soil temperature (vegetated landunits only)', & - ptr_col=ces%t_soisno, l2g_scale_type='veg') - - call hist_addfld2d (fname='TSOI_ICE', units='K', type2d='levgrnd', & - avgflag='A', long_name='soil temperature (ice landunits only)', & - ptr_col=ces%t_soisno, l2g_scale_type='ice') - - call hist_addfld1d (fname='TSOI_10CM', units='K', & - avgflag='A', long_name='soil temperature in top 10cm of soil', & - ptr_col=ces%t_soi_10cm, set_urb=spval) - - call hist_addfld2d (fname='TLAKE', units='K', type2d='levlak', & - avgflag='A', long_name='lake temperature', & - ptr_col=ces%t_lake) - - ! Specific humidity - - call hist_addfld1d (fname='Q2M', units='kg/kg', & - avgflag='A', long_name='2m specific humidity', & - ptr_pft=pes%q_ref2m) - - ! Relative humidity - - call hist_addfld1d (fname='RH2M', units='%', & - avgflag='A', long_name='2m relative humidity', & - ptr_pft=pes%rh_ref2m) - - call hist_addfld1d (fname='RH2M_U', units='%', & - avgflag='A', long_name='Urban 2m relative humidity', & - ptr_pft=pes%rh_ref2m_u, set_nourb=spval) - - call hist_addfld1d (fname='RH2M_R', units='%', & - avgflag='A', long_name='Rural 2m specific humidity', & - ptr_pft=pes%rh_ref2m_r, set_spec=spval) - - ! Wind - - call hist_addfld1d (fname='U10', units='m/s', & - avgflag='A', long_name='10-m wind', & - ptr_pft=pps%u10_clm) - call hist_addfld1d (fname='VA', units='m/s', & - avgflag='A', long_name='atmospheric wind speed plus convective velocity', & - ptr_pft=pps%va, default='inactive') - - ! Surface radiation - - call hist_addfld1d (fname='SABV', units='W/m^2', & - avgflag='A', long_name='solar rad absorbed by veg', & - ptr_pft=pef%sabv, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SABG', units='W/m^2', & - avgflag='A', long_name='solar rad absorbed by ground', & - ptr_pft=pef%sabg, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSDSVD', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation', & - ptr_pft=pef%fsds_vis_d) - - call hist_addfld1d (fname='FSDSND', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation', & - ptr_pft=pef%fsds_nir_d) - - call hist_addfld1d (fname='FSDSVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis incident solar radiation', & - ptr_pft=pef%fsds_vis_i) - - call hist_addfld1d (fname='FSDSNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir incident solar radiation', & - ptr_pft=pef%fsds_nir_i) - - call hist_addfld1d (fname='FSRVD', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation', & - ptr_pft=pef%fsr_vis_d, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSRND', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation', & - ptr_pft=pef%fsr_nir_d, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSRVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis reflected solar radiation', & - ptr_pft=pef%fsr_vis_i, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSRNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir reflected solar radiation', & - ptr_pft=pef%fsr_nir_i, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSDSVDLN', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation at local noon', & - ptr_pft=pef%fsds_vis_d_ln) - - call hist_addfld1d (fname='FSDSNDLN', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation at local noon', & - ptr_pft=pef%fsds_nir_d_ln) - - call hist_addfld1d (fname='FSRVDLN', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation at local noon', & - ptr_pft=pef%fsr_vis_d_ln, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSRNDLN', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation at local noon', & - ptr_pft=pef%fsr_nir_d_ln, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSA', units='W/m^2', & - avgflag='A', long_name='absorbed solar radiation', & - ptr_pft=pef%fsa, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSA_U', units='W/m^2', & - avgflag='A', long_name='Urban absorbed solar radiation', & - ptr_pft=pef%fsa_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='FSA_R', units='W/m^2', & - avgflag='A', long_name='Rural absorbed solar radiation', & - ptr_pft=pef%fsa_r, set_spec=spval) - - call hist_addfld1d (fname='FSR', units='W/m^2', & - avgflag='A', long_name='reflected solar radiation', & - ptr_pft=pef%fsr, c2l_scale_type='urbanf') - - ! Rename of FSR for Urban intercomparision project - call hist_addfld1d (fname='SWup', units='W/m^2', & - avgflag='A', long_name='upwelling shortwave radiation', & - ptr_pft=pef%fsr, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='FIRA', units='W/m^2', & - avgflag='A', long_name='net infrared (longwave) radiation', & - ptr_pft=pef%eflx_lwrad_net, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FIRA_U', units='W/m^2', & - avgflag='A', long_name='Urban net infrared (longwave) radiation', & - ptr_pft=pef%eflx_lwrad_net_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='FIRA_R', units='W/m^2', & - avgflag='A', long_name='Rural net infrared (longwave) radiation', & - ptr_pft=pef%eflx_lwrad_net_r, set_spec=spval) - - call hist_addfld1d (fname='FIRE', units='W/m^2', & - avgflag='A', long_name='emitted infrared (longwave) radiation', & - ptr_pft=pef%eflx_lwrad_out, c2l_scale_type='urbanf') - - ! Rename of FIRE for Urban intercomparision project - call hist_addfld1d (fname='LWup', units='W/m^2', & - avgflag='A', long_name='upwelling longwave radiation', & - ptr_pft=pef%eflx_lwrad_out, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='BUILDHEAT', units='W/m^2', & - avgflag='A', long_name='heat flux from urban building interior to walls and roof', & - ptr_col=cef%eflx_building_heat, set_nourb=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='URBAN_AC', units='W/m^2', & - avgflag='A', long_name='urban air conditioning flux', & - ptr_col=cef%eflx_urban_ac, set_nourb=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='URBAN_HEAT', units='W/m^2', & - avgflag='A', long_name='urban heating flux', & - ptr_col=cef%eflx_urban_heat, set_nourb=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='TRAFFICFLUX', units='W/m^2', & - avgflag='A', long_name='sensible heat flux from urban traffic', & - ptr_pft=pef%eflx_traffic_pft, set_nourb=0._r8, c2l_scale_type='urbanf', & - default='inactive') - - call hist_addfld1d (fname='WASTEHEAT', units='W/m^2', & - avgflag='A', long_name='sensible heat flux from heating/cooling sources of urban waste heat', & - ptr_pft=pef%eflx_wasteheat_pft, set_nourb=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='HEAT_FROM_AC', units='W/m^2', & - avgflag='A', long_name='sensible heat flux put into canyon due to heat removed from air conditioning', & - ptr_pft=pef%eflx_heat_from_ac_pft, set_nourb=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='Qanth', units='W/m^2', & - avgflag='A', long_name='anthropogenic heat flux', & - ptr_pft=pef%eflx_anthro, set_nourb=0._r8, c2l_scale_type='urbanf', & - default='inactive') - - call hist_addfld1d (fname='Rnet', units='W/m^2', & - avgflag='A', long_name='net radiation', & - ptr_pft=pef%netrad, c2l_scale_type='urbanf', & - default='inactive') - - ! Solar zenith angle and solar declination angle - - call hist_addfld1d (fname='COSZEN', units='none', & - avgflag='A', long_name='cosine of solar zenith angle', & - ptr_col=cps%coszen, default='inactive') - - call hist_addfld1d (fname='DECL', units='radians', & - avgflag='A', long_name='solar declination angle', & - ptr_col=cps%decl, default='inactive') - - ! Surface energy fluxes - - call hist_addfld1d (fname='FCTR', units='W/m^2', & - avgflag='A', long_name='canopy transpiration', & - ptr_pft=pef%eflx_lh_vegt, set_lake=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FCEV', units='W/m^2', & - avgflag='A', long_name='canopy evaporation', & - ptr_pft=pef%eflx_lh_vege, set_lake=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FGEV', units='W/m^2', & - avgflag='A', long_name='ground evaporation', & - ptr_pft=pef%eflx_lh_grnd, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSH_NODYNLNDUSE', units='W/m^2', & - avgflag='A', long_name='sensible heat not including correction for land use change', & - ptr_pft=pef%eflx_sh_tot, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSH', units='W/m^2', & - avgflag='A', long_name='sensible heat', & - ptr_lnd=gef%eflx_sh_totg) - - call hist_addfld1d (fname='FSH_U', units='W/m^2', & - avgflag='A', long_name='Urban sensible heat', & - ptr_pft=pef%eflx_sh_tot_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='FSH_R', units='W/m^2', & - avgflag='A', long_name='Rural sensible heat', & - ptr_pft=pef%eflx_sh_tot_r, set_spec=spval) - - call hist_addfld1d (fname='GC_HEAT1', units='J/m^2', & - avgflag='A', long_name='initial gridcell total heat content', & - ptr_lnd=ges%gc_heat1) - - call hist_addfld1d (fname='GC_HEAT2', units='J/m^2', & - avgflag='A', long_name='post land cover change total heat content', & - ptr_lnd=ges%gc_heat2, default='inactive') - - call hist_addfld1d (fname='EFLX_DYNBAL', units='W/m^2', & - avgflag='A', long_name='dynamic land cover change conversion energy flux', & - ptr_lnd=gef%eflx_dynbal) - - call hist_addfld1d (fname='Qh', units='W/m^2', & - avgflag='A', long_name='sensible heat', & - ptr_pft=pef%eflx_sh_tot, c2l_scale_type='urbanf', & - default = 'inactive') - - call hist_addfld1d (fname='Qle', units='W/m^2', & - avgflag='A', long_name='total evaporation', & - ptr_pft=pef%eflx_lh_tot, c2l_scale_type='urbanf', & - default = 'inactive') - - call hist_addfld1d (fname='EFLX_LH_TOT_U', units='W/m^2', & - avgflag='A', long_name='Urban total evaporation', & - ptr_pft=pef%eflx_lh_tot_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='EFLX_LH_TOT_R', units='W/m^2', & - avgflag='A', long_name='Rural total evaporation', & - ptr_pft=pef%eflx_lh_tot_r, set_spec=spval) - - call hist_addfld1d (fname='Qstor', units='W/m^2', & - avgflag='A', long_name='storage heat flux (includes snowmelt)', & - ptr_pft=pef%eflx_soil_grnd, c2l_scale_type='urbanf', & - default = 'inactive') - - call hist_addfld1d (fname='FSH_V', units='W/m^2', & - avgflag='A', long_name='sensible heat from veg', & - ptr_pft=pef%eflx_sh_veg, set_lake=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSH_G', units='W/m^2', & - avgflag='A', long_name='sensible heat from ground', & - ptr_pft=pef%eflx_sh_grnd, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FGR', units='W/m^2', & - avgflag='A', long_name='heat flux into soil/snow including snow melt', & - ptr_pft=pef%eflx_soil_grnd, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FGR_U', units='W/m^2', & - avgflag='A', long_name='Urban heat flux into soil/snow including snow melt', & - ptr_pft=pef%eflx_soil_grnd_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='FGR_R', units='W/m^2', & - avgflag='A', long_name='Rural heat flux into soil/snow including snow melt', & - ptr_pft=pef%eflx_soil_grnd_r, set_spec=spval) - - call hist_addfld1d (fname='FSM', units='W/m^2', & - avgflag='A', long_name='snow melt heat flux', & - ptr_col=cef%eflx_snomelt, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='FSM_U', units='W/m^2', & - avgflag='A', long_name='Urban snow melt heat flux', & - ptr_col=cef%eflx_snomelt_u, c2l_scale_type='urbanf', set_nourb=spval) - - call hist_addfld1d (fname='FSM_R', units='W/m^2', & - avgflag='A', long_name='Rural snow melt heat flux', & - ptr_col=cef%eflx_snomelt_r, set_spec=spval) - - call hist_addfld1d (fname='FGR12', units='W/m^2', & - avgflag='A', long_name='heat flux between soil layers 1 and 2', & - ptr_col=cef%eflx_fgr12, set_lake=spval) - - call hist_addfld1d (fname='TAUX', units='kg/m/s^2', & - avgflag='A', long_name='zonal surface stress', & - ptr_pft=pmf%taux) - - ! Rename of TAUX for Urban intercomparision project (when U=V) - call hist_addfld1d (fname='Qtau', units='kg/m/s^2', & - avgflag='A', long_name='momentum flux', & - ptr_pft=pmf%taux, default='inactive') - - call hist_addfld1d (fname='TAUY', units='kg/m/s^2', & - avgflag='A', long_name='meridional surface stress', & - ptr_pft=pmf%tauy) - - ! Vegetation phenology - - call hist_addfld1d (fname='ELAI', units='m^2/m^2', & - avgflag='A', long_name='exposed one-sided leaf area index', & - ptr_pft=pps%elai) - - call hist_addfld1d (fname='ESAI', units='m^2/m^2', & - avgflag='A', long_name='exposed one-sided stem area index', & - ptr_pft=pps%esai) - - call hist_addfld1d (fname='LAISUN', units='none', & - avgflag='A', long_name='sunlit projected leaf area index', & - ptr_pft=pps%laisun, set_urb=0._r8) - - call hist_addfld1d (fname='LAISHA', units='none', & - avgflag='A', long_name='shaded projected leaf area index', & - ptr_pft=pps%laisha, set_urb=0._r8) - - call hist_addfld1d (fname='TLAI', units='none', & - avgflag='A', long_name='total projected leaf area index', & - ptr_pft=pps%tlai) - - call hist_addfld1d (fname='TSAI', units='none', & - avgflag='A', long_name='total projected stem area index', & - ptr_pft=pps%tsai) - - call hist_addfld1d (fname='SLASUN', units='m^2/gC', & - avgflag='A', long_name='specific leaf area for sunlit canopy, projected area basis', & - ptr_pft=pps%slasun, set_urb=0._r8, default='inactive') - - call hist_addfld1d (fname='SLASHA', units='m^2/gC', & - avgflag='A', long_name='specific leaf area for shaded canopy, projected area basis', & - ptr_pft=pps%slasha, set_urb=0._r8, default='inactive') - - ! Canopy physiology - - call hist_addfld1d (fname='RSSUN', units='s/m', & - avgflag='M', long_name='sunlit leaf stomatal resistance', & - ptr_pft=pps%rssun, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='RSSHA', units='s/m', & - avgflag='M', long_name='shaded leaf stomatal resistance', & - ptr_pft=pps%rssha, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='BTRAN', units='unitless', & - avgflag='A', long_name='transpiration beta factor', & - ptr_pft=pps%btran, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='FPSN', units='umol/m2s', & - avgflag='A', long_name='photosynthesis', & - ptr_pft=pcf%fpsn, set_lake=0._r8, set_urb=0._r8) - - call hist_addfld1d (fname='DSTFLXT', units='kg/m2/s', & - avgflag='A', long_name='total surface dust emission', & - ptr_pft=pdf%flx_mss_vrt_dst_tot, set_lake=0._r8, set_urb=0._r8) - call hist_addfld1d (fname='DPVLTRB1', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 1', & - ptr_pft=pdf%vlc_trb_1, default='inactive') - call hist_addfld1d (fname='DPVLTRB2', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 2', & - ptr_pft=pdf%vlc_trb_2, default='inactive') - call hist_addfld1d (fname='DPVLTRB3', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 3', & - ptr_pft=pdf%vlc_trb_3, default='inactive') - call hist_addfld1d (fname='DPVLTRB4', units='m/s', & - avgflag='A', long_name='turbulent deposition velocity 4', & - ptr_pft=pdf%vlc_trb_4, default='inactive') - - ! for MEGAN emissions diagnositics - if (shr_megan_megcomps_n>0) then - - ! loop over megan compounds - meg_cmp => shr_megan_linkedlist - do while(associated(meg_cmp)) - imeg = meg_cmp%index - - call hist_addfld1d ( fname='MEG_'//trim(meg_cmp%name), units='kg/m2/sec', & - avgflag='A', long_name='MEGAN flux', & - ptr_pft=pvf%meg(imeg)%flux_out, set_lake=0._r8, set_urb=0._r8 ) - - meg_cmp => meg_cmp%next_megcomp - enddo - - call hist_addfld1d (fname='VOCFLXT', units='moles/m2/sec', & - avgflag='A', long_name='total VOC flux into atmosphere', & - ptr_pft=pvf%vocflx_tot, set_lake=0._r8, set_urb=0._r8) - - call hist_addfld1d (fname='GAMMA', units='non', & - avgflag='A', long_name='total gamma for VOC calc', & - ptr_pft=pvf%gamma_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAL', units='non', & - avgflag='A', long_name='gamma L for VOC calc', & - ptr_pft=pvf%gammaL_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAT', units='non', & - avgflag='A', long_name='gamma T for VOC calc', & - ptr_pft=pvf%gammaT_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAP', units='non', & - avgflag='A', long_name='gamma P for VOC calc', & - ptr_pft=pvf%gammaP_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAA', units='non', & - avgflag='A', long_name='gamma A for VOC calc', & - ptr_pft=pvf%gammaA_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAS', units='non', & - avgflag='A', long_name='gamma S for VOC calc', & - ptr_pft=pvf%gammaS_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='GAMMAC', units='non', & - avgflag='A', long_name='gamma C for VOC calc', & - ptr_pft=pvf%gammaC_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='EOPT', units='non', & - avgflag='A', long_name='Eopt coefficient for VOC calc', & - ptr_pft=pvf%Eopt_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='TOPT', units='non', & - avgflag='A', long_name='topt coefficient for VOC calc', & - ptr_pft=pvf%topt_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='ALPHA', units='non', & - avgflag='A', long_name='alpha coefficient for VOC calc', & - ptr_pft=pvf%alpha_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='CP', units='non', & - avgflag='A', long_name='cp coefficient for VOC calc', & - ptr_pft=pvf%cp_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR', & - ptr_pft=pvf%paru_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR24_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR (24 hrs)', & - ptr_pft=pvf%par24u_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR240_sun', units='umol/m2/s', & - avgflag='A', long_name='sunlit PAR (240 hrs)', & - ptr_pft=pvf%par240u_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR', & - ptr_pft=pvf%para_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR24_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR (24 hrs)', & - ptr_pft=pvf%par24a_out, set_lake=0._r8, default='inactive') - - call hist_addfld1d (fname='PAR240_shade', units='umol/m2/s', & - avgflag='A', long_name='shade PAR (240 hrs)', & - ptr_pft=pvf%par240a_out, set_lake=0._r8, default='inactive') - - endif - - call hist_addfld1d (fname='FSUN24', units='K', & - avgflag='A', long_name='fraction sunlit (last 24hrs)', & - ptr_pft=pvs%fsun24, default='inactive') - - call hist_addfld1d (fname='FSUN240', units='K', & - avgflag='A', long_name='fraction sunlit (last 240hrs)', & - ptr_pft=pvs%fsun240, default='inactive') - - call hist_addfld1d (fname='FSI24', units='K', & - avgflag='A', long_name='indirect radiation (last 24hrs)', & - ptr_pft=pvs%fsi24, default='inactive') - - call hist_addfld1d (fname='FSI240', units='K', & - avgflag='A', long_name='indirect radiation (last 240hrs)', & - ptr_pft=pvs%fsi240, default='inactive') - - call hist_addfld1d (fname='FSD24', units='K', & - avgflag='A', long_name='direct radiation (last 24hrs)', & - ptr_pft=pvs%fsd24, default='inactive') - - call hist_addfld1d (fname='FSD240', units='K', & - avgflag='A', long_name='direct radiation (last 240hrs)', & - ptr_pft=pvs%fsd240, default='inactive') - - ! Hydrology - - call hist_addfld1d (fname='SoilAlpha', units='unitless', & - avgflag='A', long_name='factor limiting ground evap', & - ptr_col=cws%soilalpha, set_urb=spval) - - call hist_addfld1d (fname='SoilAlpha_U', units='unitless', & - avgflag='A', long_name='urban factor limiting ground evap', & - ptr_col=cws%soilalpha_u, set_nourb=spval) - - call hist_addfld1d (fname='FCOV', units='unitless', & - avgflag='A', long_name='fractional impermeable area', & - ptr_col=cws%fcov, l2g_scale_type='veg') - call hist_addfld1d (fname='FSAT', units='unitless', & - avgflag='A', long_name='fractional area with water table at surface', & - ptr_col=cws%fsat, l2g_scale_type='veg') - call hist_addfld1d (fname='ZWT', units='m', & - avgflag='A', long_name='water table depth (vegetated landunits only)', & - ptr_col=cws%zwt, l2g_scale_type='veg') - - call hist_addfld1d (fname='WA', units='mm', & - avgflag='A', long_name='water in the unconfined aquifer (vegetated landunits only)', & - ptr_col=cws%wa, l2g_scale_type='veg') - - call hist_addfld1d (fname='WT', units='mm', & - avgflag='A', long_name='total water storage (unsaturated soil water + groundwater, veg landunits)', & - ptr_col=cws%wt, l2g_scale_type='veg') - - call hist_addfld1d (fname='QCHARGE', units='mm/s', & - avgflag='A', long_name='aquifer recharge rate (vegetated landunits only)', & - ptr_col=cws%qcharge, l2g_scale_type='veg') - - call hist_addfld2d (fname='SMP', units='mm', type2d='levgrnd', & - avgflag='A', long_name='soil matric potential (vegetated landunits only)', & - ptr_col=cws%smp_l, set_spec=spval, l2g_scale_type='veg', default='inactive') - - call hist_addfld2d (fname='HK', units='mm/s', type2d='levgrnd', & - avgflag='A', long_name='hydraulic conductivity (vegetated landunits only)', & - ptr_col=cws%hk_l, set_spec=spval, l2g_scale_type='veg', default='inactive') - - call hist_addfld1d (fname='H2OSNO', units='mm', & - avgflag='A', long_name='snow depth (liquid water)', & - ptr_col=cws%h2osno, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='ERRH2OSNO', units='mm', & - avgflag='A', long_name='imbalance in snow depth (liquid water)', & - ptr_col=cws%errh2osno, c2l_scale_type='urbanf') - - ! As defined here, snow_sources - snow_sinks will equal the change in h2osno at - ! any given time step but only if there is at least one snow layer (for all landunits - ! except lakes). h2osno also includes snow that is part of the soil column (an - ! initial snow layer is only created if h2osno > 10mm). Also note that monthly average - ! files of snow_sources and snow sinks must be weighted by number of days in the month to - ! diagnose, for example, an annual value of the change in h2osno. - - call hist_addfld1d (fname='SNOW_SOURCES', units='mm/s', & - avgflag='A', long_name='snow sources (liquid water)', & - ptr_col=cws%snow_sources, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='SNOW_SINKS', units='mm/s', & - avgflag='A', long_name='snow sinks (liquid water)', & - ptr_col=cws%snow_sinks, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='H2OCAN', units='mm', & - avgflag='A', long_name='intercepted water', & - ptr_pft=pws%h2ocan, set_lake=0._r8) - - call hist_addfld2d (fname='H2OSOI', units='mm3/mm3', type2d='levgrnd', & - avgflag='A', long_name='volumetric soil water (vegetated landunits only)', & - ptr_col=cws%h2osoi_vol, l2g_scale_type='veg') - - call hist_addfld2d (fname='SOILLIQ', units='kg/m2', type2d='levgrnd', & - avgflag='A', long_name='soil liquid water (vegetated landunits only)', & - ptr_col=cws%h2osoi_liq, l2g_scale_type='veg') - - call hist_addfld2d (fname='SOILICE', units='kg/m2', type2d='levgrnd', & - avgflag='A', long_name='soil ice (vegetated landunits only)', & - ptr_col=cws%h2osoi_ice, l2g_scale_type='veg') - - call hist_addfld1d (fname='SOILWATER_10CM', units='kg/m2', & - avgflag='A', long_name='soil liquid water + ice in top 10cm of soil (veg landunits only)', & - ptr_col=cws%h2osoi_liqice_10cm, set_urb=spval, l2g_scale_type='veg') - - call hist_addfld1d (fname='SNOWLIQ', units='kg/m2', & - avgflag='A', long_name='snow liquid water', & - ptr_col=cws%snowliq) - - call hist_addfld1d (fname='SNOWICE', units='kg/m2', & - avgflag='A', long_name='snow ice', & - ptr_col=cws%snowice) - - call hist_addfld1d (fname='QTOPSOIL', units='mm/s', & - avgflag='A', long_name='water input to surface', & - ptr_col=cwf%qflx_top_soil, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='QINFL', units='mm/s', & - avgflag='A', long_name='infiltration', & - ptr_col=cwf%qflx_infl, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QOVER', units='mm/s', & - avgflag='A', long_name='surface runoff', & - ptr_col=cwf%qflx_surf, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QRGWL', units='mm/s', & - avgflag='A', long_name='surface runoff at glaciers (liquid only), wetlands, lakes', & - ptr_col=cwf%qflx_qrgwl, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNWCPLIQ', units='mm H2O/s', & - avgflag='A', long_name='excess rainfall due to snow capping', & - ptr_pft=pwf%qflx_snwcp_liq, c2l_scale_type='urbanf', default='inactive') - - call hist_addfld1d (fname='QSNWCPICE_NODYNLNDUSE', units='mm H2O/s', & - avgflag='A', & - long_name='excess snowfall due to snow capping not including correction for land use change', & - ptr_pft=pwf%qflx_snwcp_ice, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNWCPICE', units='mm/s', & - avgflag='A', long_name='excess snowfall due to snow capping', & - ptr_lnd=gwf%qflx_snwcp_iceg) - - call hist_addfld1d (fname='QDRAI', units='mm/s', & - avgflag='A', long_name='sub-surface drainage', & - ptr_col=cwf%qflx_drain, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QRUNOFF_NODYNLNDUSE', units='mm/s', & - avgflag='A', & - long_name='total liquid runoff (does not include QSNWCPICE) not including correction for land use change', & - ptr_col=cwf%qflx_runoff, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QRUNOFF', units='mm/s', & - avgflag='A', long_name='total liquid runoff (does not include QSNWCPICE)', & - ptr_lnd=gwf%qflx_runoffg) - - call hist_addfld1d (fname='GC_LIQ1', units='mm', & - avgflag='A', long_name='initial gridcell total liq content', & - ptr_lnd=gws%gc_liq1) - - call hist_addfld1d (fname='GC_LIQ2', units='mm', & - avgflag='A', long_name='post landuse change gridcell total liq content', & - ptr_lnd=gws%gc_liq2, default='inactive') - - call hist_addfld1d (fname='QFLX_LIQ_DYNBAL', units='mm/s', & - avgflag='A', long_name='liq dynamic land cover change conversion runoff flux', & - ptr_lnd=gwf%qflx_liq_dynbal) - - call hist_addfld1d (fname='GC_ICE1', units='mm', & - avgflag='A', long_name='initial gridcell total ice content', & - ptr_lnd=gws%gc_ice1) - - call hist_addfld1d (fname='GC_ICE2', units='mm', & - avgflag='A', long_name='post land cover change total ice content', & - ptr_lnd=gws%gc_ice2, default='inactive') - - call hist_addfld1d (fname='QFLX_ICE_DYNBAL', units='mm/s', & - avgflag='A', long_name='ice dynamic land cover change conversion runoff flux', & - ptr_lnd=gwf%qflx_ice_dynbal) - - call hist_addfld1d (fname='QRUNOFF_U', units='mm/s', & - avgflag='A', long_name='Urban total runoff', & - ptr_col=cwf%qflx_runoff_u, set_nourb=spval, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QRUNOFF_R', units='mm/s', & - avgflag='A', long_name='Rural total runoff', & - ptr_col=cwf%qflx_runoff_r, set_spec=spval) - - call hist_addfld1d (fname='QINTR', units='mm/s', & - avgflag='A', long_name='interception', & - ptr_pft=pwf%qflx_prec_intr, set_lake=0._r8) - - call hist_addfld1d (fname='QDRIP', units='mm/s', & - avgflag='A', long_name='throughfall', & - ptr_pft=pwf%qflx_prec_grnd, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNOMELT', units='mm/s', & - avgflag='A', long_name='snow melt', & - ptr_col=cwf%qflx_snomelt, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSNOFRZ', units='kg/m2/s', & - avgflag='A', long_name='column-integrated snow freezing rate', & - ptr_col=cwf%qflx_snofrz_col, default='inactive', & - set_lake=spval, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QSOIL', units='mm/s', & - avgflag='A', long_name= & - 'Ground evaporation (soil/snow evaporation + soil/snow sublimation - dew)', & - ptr_pft=pwf%qflx_evap_soi, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QVEGE', units='mm/s', & - avgflag='A', long_name='canopy evaporation', & - ptr_pft=pwf%qflx_evap_can, set_lake=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QVEGT', units='mm/s', & - avgflag='A', long_name='canopy transpiration', & - ptr_pft=pwf%qflx_tran_veg, set_lake=0._r8, c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QIRRIG', units='mm/s', & - avgflag='A', long_name='water added through irrigation', & - ptr_col=cwf%qflx_irrig, set_lake=0._r8) - - if (create_glacier_mec_landunit) then - - call hist_addfld1d (fname='QICE', units='mm/s', & - avgflag='A', long_name='ice growth/melt', & - ptr_col=cwf%qflx_glcice, set_noglcmec=spval) - - call hist_addfld1d (fname='QICE_FRZ', units='mm/s', & - avgflag='A', long_name='ice growth', & - ptr_col=cwf%qflx_glcice_frz, set_noglcmec=spval) - - call hist_addfld1d (fname='QICE_MELT', units='mm/s', & - avgflag='A', long_name='ice melt', & - ptr_col=cwf%qflx_glcice_melt, set_noglcmec=spval) - - call hist_addfld1d (fname='gris_mask', units='unitless', & - avgflag='A', long_name='Greenland mask', & - ptr_gcell=grc%gris_mask) - - call hist_addfld1d (fname='gris_area', units='km^2', & - avgflag='A', long_name='Greenland ice area', & - ptr_gcell=grc%gris_area) - - call hist_addfld1d (fname='aais_mask', units='unitless', & - avgflag='A', long_name='Antarctic mask', & - ptr_gcell=grc%aais_mask) - - call hist_addfld1d (fname='aais_area', units='km^2', & - avgflag='A', long_name='Antarctic ice area', & - ptr_gcell=grc%aais_area) - - endif - - ! Water and energy balance checks - - call hist_addfld1d (fname='ERRSOI', units='W/m^2', & - avgflag='A', long_name='soil/lake energy conservation error', & - ptr_col=cebal%errsoi) - - call hist_addfld1d (fname='ERRSEB', units='W/m^2', & - avgflag='A', long_name='surface energy conservation error', & - ptr_pft=pebal%errseb) - - call hist_addfld1d (fname='ERRSOL', units='W/m^2', & - avgflag='A', long_name='solar radiation conservation error', & - ptr_pft=pebal%errsol, set_urb=spval) - - call hist_addfld1d (fname='ERRH2O', units='mm', & - avgflag='A', long_name='total water conservation error', & - ptr_col=cwbal%errh2o) - - ! Atmospheric forcing - - call hist_addfld1d (fname='RAIN', units='mm/s', & - avgflag='A', long_name='atmospheric rain', & - ptr_lnd=clm_a2l%forc_rain) - - call hist_addfld1d (fname='SNOW', units='mm/s', & - avgflag='A', long_name='atmospheric snow', & - ptr_lnd=clm_a2l%forc_snow) - - call hist_addfld1d (fname='TBOT', units='K', & - avgflag='A', long_name='atmospheric air temperature', & - ptr_lnd=clm_a2l%forc_t) - - call hist_addfld1d (fname='THBOT', units='K', & - avgflag='A', long_name='atmospheric air potential temperature', & - ptr_lnd=clm_a2l%forc_th) - - call hist_addfld1d (fname='WIND', units='m/s', & - avgflag='A', long_name='atmospheric wind velocity magnitude', & - ptr_lnd=clm_a2l%forc_wind) - - ! Rename of WIND for Urban intercomparision project - call hist_addfld1d (fname='Wind', units='m/s', & - avgflag='A', long_name='atmospheric wind velocity magnitude', & - ptr_gcell=clm_a2l%forc_wind, default = 'inactive') - - call hist_addfld1d (fname='Tair', units='K', & - avgflag='A', long_name='atmospheric air temperature', & - ptr_gcell=clm_a2l%forc_t, default='inactive') - - call hist_addfld1d (fname='PSurf', units='Pa', & - avgflag='A', long_name='surface pressure', & - ptr_gcell=clm_a2l%forc_pbot, default='inactive') - - call hist_addfld1d (fname='Rainf', units='mm/s', & - avgflag='A', long_name='atmospheric rain', & - ptr_gcell=clm_a2l%forc_rain, default='inactive') - - call hist_addfld1d (fname='SWdown', units='W/m^2', & - avgflag='A', long_name='atmospheric incident solar radiation', & - ptr_gcell=clm_a2l%forc_solar, default='inactive') - - call hist_addfld1d (fname='LWdown', units='W/m^2', & - avgflag='A', long_name='atmospheric longwave radiation', & - ptr_gcell=clm_a2l%forc_lwrad, default='inactive') - - call hist_addfld1d (fname='RH', units='%', & - avgflag='A', long_name='atmospheric relative humidity', & - ptr_gcell=clm_a2l%forc_rh, default='inactive') - - call hist_addfld1d (fname='QBOT', units='kg/kg', & - avgflag='A', long_name='atmospheric specific humidity', & - ptr_lnd=clm_a2l%forc_q) - - ! Rename of QBOT for Urban intercomparision project - call hist_addfld1d (fname='Qair', units='kg/kg', & - avgflag='A', long_name='atmospheric specific humidity', & - ptr_lnd=clm_a2l%forc_q, default='inactive') - - call hist_addfld1d (fname='ZBOT', units='m', & - avgflag='A', long_name='atmospheric reference height', & - ptr_lnd=clm_a2l%forc_hgt) - - call hist_addfld1d (fname='FLDS', units='W/m^2', & - avgflag='A', long_name='atmospheric longwave radiation', & - ptr_lnd=clm_a2l%forc_lwrad) - - call hist_addfld1d (fname='FSDS', units='W/m^2', & - avgflag='A', long_name='atmospheric incident solar radiation', & - ptr_lnd=clm_a2l%forc_solar) - - call hist_addfld1d (fname='PCO2', units='Pa', & - avgflag='A', long_name='atmospheric partial pressure of CO2', & - ptr_lnd=clm_a2l%forc_pco2) - - call hist_addfld1d (fname='PBOT', units='Pa', & - avgflag='A', long_name='atmospheric pressure', & - ptr_lnd=clm_a2l%forc_pbot) - - if (use_cndv .or. use_crop) then - call hist_addfld1d (fname='T10', units='K', & - avgflag='A', long_name='10-day running mean of 2-m temperature', & - ptr_pft=pes%t10) - end if - - if (use_cndv) then - call hist_addfld1d (fname='TDA', units='K', & - avgflag='A', long_name='daily average 2-m temperature', & - ptr_pft=pdgvs%t_mo) - - call hist_addfld1d (fname='AGDD', units='K', & - avgflag='A', long_name='growing degree-days base 5C', & - ptr_pft=pdgvs%agdd) - end if - - if (use_cn) then - call hist_addfld2d (fname='SOILPSI', units='MPa', type2d='levgrnd', & - avgflag='A', long_name='soil water potential in each soil layer', & - ptr_col=cps%soilpsi) - end if - - if (use_cn) then - ! add history fields for all CN variables, always set as default='inactive' - if ( crop_prog )then - - call hist_addfld1d (fname='A5TMIN', units='K', & - avgflag='A', long_name='5-day running mean of min 2-m temperature', & - ptr_pft=pes%a5tmin, default='inactive') - - call hist_addfld1d (fname='A10TMIN', units='K', & - avgflag='A', long_name='10-day running mean of min 2-m temperature', & - ptr_pft=pes%a10tmin, default='inactive') - - end if - - !------------------------------- - ! C state variables - native to PFT - !------------------------------- - ! add history fields for all CLAMP CN variables - - call hist_addfld1d (fname='WOODC', units='gC/m^2', & - avgflag='A', long_name='wood C', & - ptr_pft=pcs%woodc) - - call hist_addfld1d (fname='LEAFC', units='gC/m^2', & - avgflag='A', long_name='leaf C', & - ptr_pft=pcs%leafc) - - call hist_addfld1d (fname='LEAFC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='leaf C storage', & - ptr_pft=pcs%leafc_storage, default='inactive') - - call hist_addfld1d (fname='LEAFC_XFER', units='gC/m^2', & - avgflag='A', long_name='leaf C transfer', & - ptr_pft=pcs%leafc_xfer, default='inactive') - - call hist_addfld1d (fname='FROOTC', units='gC/m^2', & - avgflag='A', long_name='fine root C', & - ptr_pft=pcs%frootc) - - call hist_addfld1d (fname='FROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='fine root C storage', & - ptr_pft=pcs%frootc_storage, default='inactive') - - call hist_addfld1d (fname='FROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='fine root C transfer', & - ptr_pft=pcs%frootc_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMC', units='gC/m^2', & - avgflag='A', long_name='live stem C', & - ptr_pft=pcs%livestemc) - - call hist_addfld1d (fname='LIVESTEMC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='live stem C storage', & - ptr_pft=pcs%livestemc_storage, default='inactive') - - call hist_addfld1d (fname='LIVESTEMC_XFER', units='gC/m^2', & - avgflag='A', long_name='live stem C transfer', & - ptr_pft=pcs%livestemc_xfer, default='inactive') - - call hist_addfld1d (fname='DEADSTEMC', units='gC/m^2', & - avgflag='A', long_name='dead stem C', & - ptr_pft=pcs%deadstemc) - - call hist_addfld1d (fname='DEADSTEMC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='dead stem C storage', & - ptr_pft=pcs%deadstemc_storage, default='inactive') - - call hist_addfld1d (fname='DEADSTEMC_XFER', units='gC/m^2', & - avgflag='A', long_name='dead stem C transfer', & - ptr_pft=pcs%deadstemc_xfer, default='inactive') - - call hist_addfld1d (fname='LIVECROOTC', units='gC/m^2', & - avgflag='A', long_name='live coarse root C', & - ptr_pft=pcs%livecrootc) - - call hist_addfld1d (fname='LIVECROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='live coarse root C storage', & - ptr_pft=pcs%livecrootc_storage, default='inactive') - - call hist_addfld1d (fname='LIVECROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='live coarse root C transfer', & - ptr_pft=pcs%livecrootc_xfer, default='inactive') - - call hist_addfld1d (fname='DEADCROOTC', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C', & - ptr_pft=pcs%deadcrootc) - - call hist_addfld1d (fname='DEADCROOTC_STORAGE', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C storage', & - ptr_pft=pcs%deadcrootc_storage, default='inactive') - - call hist_addfld1d (fname='DEADCROOTC_XFER', units='gC/m^2', & - avgflag='A', long_name='dead coarse root C transfer', & - ptr_pft=pcs%deadcrootc_xfer, default='inactive') - - call hist_addfld1d (fname='GRESP_STORAGE', units='gC/m^2', & - avgflag='A', long_name='growth respiration storage', & - ptr_pft=pcs%gresp_storage, default='inactive') - - call hist_addfld1d (fname='GRESP_XFER', units='gC/m^2', & - avgflag='A', long_name='growth respiration transfer', & - ptr_pft=pcs%gresp_xfer, default='inactive') - - call hist_addfld1d (fname='CPOOL', units='gC/m^2', & - avgflag='A', long_name='temporary photosynthate C pool', & - ptr_pft=pcs%cpool) - - call hist_addfld1d (fname='XSMRPOOL', units='gC/m^2', & - avgflag='A', long_name='temporary photosynthate C pool', & - ptr_pft=pcs%xsmrpool) - - call hist_addfld1d (fname='PFT_CTRUNC', units='gC/m^2', & - avgflag='A', long_name='pft-level sink for C truncation', & - ptr_pft=pcs%pft_ctrunc) - - call hist_addfld1d (fname='DISPVEGC', units='gC/m^2', & - avgflag='A', long_name='displayed veg carbon, excluding storage and cpool', & - ptr_pft=pcs%dispvegc) - - call hist_addfld1d (fname='STORVEGC', units='gC/m^2', & - avgflag='A', long_name='stored vegetation carbon, excluding cpool', & - ptr_pft=pcs%storvegc) - - call hist_addfld1d (fname='TOTVEGC', units='gC/m^2', & - avgflag='A', long_name='total vegetation carbon, excluding cpool', & - ptr_pft=pcs%totvegc) - - call hist_addfld1d (fname='TOTPFTC', units='gC/m^2', & - avgflag='A', long_name='total pft-level carbon, including cpool', & - ptr_pft=pcs%totpftc) - - if (use_c13) then - !------------------------------- - ! C13 state variables - native to PFT - !------------------------------- - - call hist_addfld1d (fname='C13_LEAFC', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C', & - ptr_pft=pc13s%leafc) - - call hist_addfld1d (fname='C13_LEAFC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C storage', & - ptr_pft=pc13s%leafc_storage, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 leaf C transfer', & - ptr_pft=pc13s%leafc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C', & - ptr_pft=pc13s%frootc) - - call hist_addfld1d (fname='C13_FROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C storage', & - ptr_pft=pc13s%frootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 fine root C transfer', & - ptr_pft=pc13s%frootc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEMC', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C', & - ptr_pft=pc13s%livestemc) - - call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C storage', & - ptr_pft=pc13s%livestemc_storage, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEMC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 live stem C transfer', & - ptr_pft=pc13s%livestemc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_DEADSTEMC', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C', & - ptr_pft=pc13s%deadstemc) - - call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C storage', & - ptr_pft=pc13s%deadstemc_storage, default='inactive') - - call hist_addfld1d (fname='C13_DEADSTEMC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 dead stem C transfer', & - ptr_pft=pc13s%deadstemc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C', & - ptr_pft=pc13s%livecrootc) - - call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C storage', & - ptr_pft=pc13s%livecrootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 live coarse root C transfer', & - ptr_pft=pc13s%livecrootc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_DEADCROOTC', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C', & - ptr_pft=pc13s%deadcrootc) - - call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C storage', & - ptr_pft=pc13s%deadcrootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_DEADCROOTC_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 dead coarse root C transfer', & - ptr_pft=pc13s%deadcrootc_xfer, default='inactive') - - call hist_addfld1d (fname='C13_GRESP_STORAGE', units='gC13/m^2', & - avgflag='A', long_name='C13 growth respiration storage', & - ptr_pft=pc13s%gresp_storage, default='inactive') - - call hist_addfld1d (fname='C13_GRESP_XFER', units='gC13/m^2', & - avgflag='A', long_name='C13 growth respiration transfer', & - ptr_pft=pc13s%gresp_xfer, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL', units='gC13/m^2', & - avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_pft=pc13s%cpool) - - call hist_addfld1d (fname='C13_XSMRPOOL', units='gC13/m^2', & - avgflag='A', long_name='C13 temporary photosynthate C pool', & - ptr_pft=pc13s%xsmrpool) - - call hist_addfld1d (fname='C13_PFT_CTRUNC', units='gC13/m^2', & - avgflag='A', long_name='C13 pft-level sink for C truncation', & - ptr_pft=pc13s%pft_ctrunc) - - call hist_addfld1d (fname='C13_DISPVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 displayed veg carbon, excluding storage and cpool', & - ptr_pft=pc13s%dispvegc) - - call hist_addfld1d (fname='C13_STORVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 stored vegetation carbon, excluding cpool', & - ptr_pft=pc13s%storvegc) - - call hist_addfld1d (fname='C13_TOTVEGC', units='gC13/m^2', & - avgflag='A', long_name='C13 total vegetation carbon, excluding cpool', & - ptr_pft=pc13s%totvegc) - - call hist_addfld1d (fname='C13_TOTPFTC', units='gC13/m^2', & - avgflag='A', long_name='C13 total pft-level carbon, including cpool', & - ptr_pft=pc13s%totpftc) - endif - - !------------------------------- - ! C state variables - native to column - !------------------------------- - ! add history fields for all CLAMP CN variables - call hist_addfld1d (fname='SOILC', units='gC/m^2', & - avgflag='A', long_name='soil C', & - ptr_col=ccs%totsomc) - - call hist_addfld1d (fname='LITTERC', units='gC/m^2', & - avgflag='A', long_name='litter C', & - ptr_col=ccs%totlitc) - - call hist_addfld1d (fname='CWDC', units='gC/m^2', & - avgflag='A', long_name='coarse woody debris C', & - ptr_col=ccs%cwdc) - - call hist_addfld1d (fname='LITR1C', units='gC/m^2', & - avgflag='A', long_name='litter labile C', & - ptr_col=ccs%litr1c) - - call hist_addfld1d (fname='LITR2C', units='gC/m^2', & - avgflag='A', long_name='litter cellulose C', & - ptr_col=ccs%litr2c) - - call hist_addfld1d (fname='LITR3C', units='gC/m^2', & - avgflag='A', long_name='litter lignin C', & - ptr_col=ccs%litr3c) - - call hist_addfld1d (fname='SOIL1C', units='gC/m^2', & - avgflag='A', long_name='soil organic matter C (fast pool)', & - ptr_col=ccs%soil1c) - - call hist_addfld1d (fname='SOIL2C', units='gC/m^2', & - avgflag='A', long_name='soil organic matter C (medium pool)', & - ptr_col=ccs%soil2c) - - call hist_addfld1d (fname='SOIL3C', units='gC/m^2', & - avgflag='A', long_name='soil organic matter C (slow pool)', & - ptr_col=ccs%soil3c) - - call hist_addfld1d (fname='SOIL4C', units='gC/m^2', & - avgflag='A', long_name='soil organic matter C (slowest pool)', & - ptr_col=ccs%soil4c) - - call hist_addfld1d (fname='SEEDC', units='gC/m^2', & - avgflag='A', long_name='pool for seeding new PFTs', & - ptr_col=ccs%seedc) - - call hist_addfld1d (fname='COL_CTRUNC', units='gC/m^2', & - avgflag='A', long_name='column-level sink for C truncation', & - ptr_col=ccs%col_ctrunc) - - call hist_addfld1d (fname='TOTLITC', units='gC/m^2', & - avgflag='A', long_name='total litter carbon', & - ptr_col=ccs%totlitc) - - call hist_addfld1d (fname='TOTSOMC', units='gC/m^2', & - avgflag='A', long_name='total soil organic matter carbon', & - ptr_col=ccs%totsomc) - - call hist_addfld1d (fname='TOTECOSYSC', units='gC/m^2', & - avgflag='A', long_name='total ecosystem carbon, incl veg but excl cpool', & - ptr_col=ccs%totecosysc) - - call hist_addfld1d (fname='TOTCOLC', units='gC/m^2', & - avgflag='A', long_name='total column carbon, incl veg and cpool', & - ptr_col=ccs%totcolc) - - call hist_addfld1d (fname='PROD10C', units='gC/m^2', & - avgflag='A', long_name='10-yr wood product C', & - ptr_col=ccs%prod10c) - - call hist_addfld1d (fname='PROD100C', units='gC/m^2', & - avgflag='A', long_name='100-yr wood product C', & - ptr_col=ccs%prod100c) - - call hist_addfld1d (fname='TOTPRODC', units='gC/m^2', & - avgflag='A', long_name='total wood product C', & - ptr_col=ccs%totprodc) - - - if (use_c13) then - !------------------------------- - ! C13 state variables - native to column - !------------------------------- - - call hist_addfld1d (fname='C13_CWDC', units='gC13/m^2', & - avgflag='A', long_name='C13 coarse woody debris C', & - ptr_col=cc13s%cwdc) - - call hist_addfld1d (fname='C13_LITR1C', units='gC13/m^2', & - avgflag='A', long_name='C13 litter labile C', & - ptr_col=cc13s%litr1c) - - call hist_addfld1d (fname='C13_LITR2C', units='gC13/m^2', & - avgflag='A', long_name='C13 litter cellulose C', & - ptr_col=cc13s%litr2c) - - call hist_addfld1d (fname='C13_LITR3C', units='gC13/m^2', & - avgflag='A', long_name='C13 litter lignin C', & - ptr_col=cc13s%litr3c) - - call hist_addfld1d (fname='C13_SOIL1C', units='gC13/m^2', & - avgflag='A', long_name='C13 soil organic matter C (fast pool)', & - ptr_col=cc13s%soil1c) - - call hist_addfld1d (fname='C13_SOIL2C', units='gC13/m^2', & - avgflag='A', long_name='C13 soil organic matter C (medium pool)', & - ptr_col=cc13s%soil2c) - - call hist_addfld1d (fname='C13_SOIL3C', units='gC13/m^2', & - avgflag='A', long_name='C13 soil organic matter C (slow pool)', & - ptr_col=cc13s%soil3c) - - call hist_addfld1d (fname='C13_SOIL4C', units='gC13/m^2', & - avgflag='A', long_name='C13 soil organic matter C (slowest pool)', & - ptr_col=cc13s%soil4c) - - call hist_addfld1d (fname='C13_SEEDC', units='gC13/m^2', & - avgflag='A', long_name='C13 pool for seeding new PFTs', & - ptr_col=ccs%seedc) - - call hist_addfld1d (fname='C13_COL_CTRUNC', units='gC13/m^2', & - avgflag='A', long_name='C13 column-level sink for C truncation', & - ptr_col=cc13s%col_ctrunc) - - call hist_addfld1d (fname='C13_TOTLITC', units='gC13/m^2', & - avgflag='A', long_name='C13 total litter carbon', & - ptr_col=cc13s%totlitc) - - call hist_addfld1d (fname='C13_TOTSOMC', units='gC13/m^2', & - avgflag='A', long_name='C13 total soil organic matter carbon', & - ptr_col=cc13s%totsomc) - - call hist_addfld1d (fname='C13_TOTECOSYSC', units='gC13/m^2', & - avgflag='A', long_name='C13 total ecosystem carbon, incl veg but excl cpool', & - ptr_col=cc13s%totecosysc) - - call hist_addfld1d (fname='C13_TOTCOLC', units='gC13/m^2', & - avgflag='A', long_name='C13 total column carbon, incl veg and cpool', & - ptr_col=cc13s%totcolc) - - call hist_addfld1d (fname='C13_PROD10C', units='gC13/m^2', & - avgflag='A', long_name='C13 10-yr wood product C', & - ptr_col=cc13s%prod10c) - - call hist_addfld1d (fname='C13_PROD100C', units='gC13/m^2', & - avgflag='A', long_name='C13 100-yr wood product C', & - ptr_col=cc13s%prod100c) - - call hist_addfld1d (fname='C13_TOTPRODC', units='gC13/m^2', & - avgflag='A', long_name='C13 total wood product C', & - ptr_col=cc13s%totprodc) - endif - - !------------------------------- - ! N state variables - native to PFT - !------------------------------- - - call hist_addfld1d (fname='LEAFN', units='gN/m^2', & - avgflag='A', long_name='leaf N', & - ptr_pft=pns%leafn) - - call hist_addfld1d (fname='LEAFN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='leaf N storage', & - ptr_pft=pns%leafn_storage, default='inactive') - - call hist_addfld1d (fname='LEAFN_XFER', units='gN/m^2', & - avgflag='A', long_name='leaf N transfer', & - ptr_pft=pns%leafn_xfer, default='inactive') - - call hist_addfld1d (fname='FROOTN', units='gN/m^2', & - avgflag='A', long_name='fine root N', & - ptr_pft=pns%frootn) - - call hist_addfld1d (fname='FROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='fine root N storage', & - ptr_pft=pns%frootn_storage, default='inactive') - - call hist_addfld1d (fname='FROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='fine root N transfer', & - ptr_pft=pns%frootn_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN', units='gN/m^2', & - avgflag='A', long_name='live stem N', & - ptr_pft=pns%livestemn) - - call hist_addfld1d (fname='LIVESTEMN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='live stem N storage', & - ptr_pft=pns%livestemn_storage, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN_XFER', units='gN/m^2', & - avgflag='A', long_name='live stem N transfer', & - ptr_pft=pns%livestemn_xfer, default='inactive') - - call hist_addfld1d (fname='DEADSTEMN', units='gN/m^2', & - avgflag='A', long_name='dead stem N', & - ptr_pft=pns%deadstemn) - - call hist_addfld1d (fname='DEADSTEMN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='dead stem N storage', & - ptr_pft=pns%deadstemn_storage, default='inactive') - - call hist_addfld1d (fname='DEADSTEMN_XFER', units='gN/m^2', & - avgflag='A', long_name='dead stem N transfer', & - ptr_pft=pns%deadstemn_xfer, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN', units='gN/m^2', & - avgflag='A', long_name='live coarse root N', & - ptr_pft=pns%livecrootn) - - call hist_addfld1d (fname='LIVECROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='live coarse root N storage', & - ptr_pft=pns%livecrootn_storage, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='live coarse root N transfer', & - ptr_pft=pns%livecrootn_xfer, default='inactive') - - call hist_addfld1d (fname='DEADCROOTN', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N', & - ptr_pft=pns%deadcrootn) - - call hist_addfld1d (fname='DEADCROOTN_STORAGE', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N storage', & - ptr_pft=pns%deadcrootn_storage, default='inactive') - - call hist_addfld1d (fname='DEADCROOTN_XFER', units='gN/m^2', & - avgflag='A', long_name='dead coarse root N transfer', & - ptr_pft=pns%deadcrootn_xfer, default='inactive') - - call hist_addfld1d (fname='RETRANSN', units='gN/m^2', & - avgflag='A', long_name='plant pool of retranslocated N', & - ptr_pft=pns%retransn) - - call hist_addfld1d (fname='NPOOL', units='gN/m^2', & - avgflag='A', long_name='temporary plant N pool', & - ptr_pft=pns%npool, default='inactive') - - call hist_addfld1d (fname='PFT_NTRUNC', units='gN/m^2', & - avgflag='A', long_name='pft-level sink for N truncation', & - ptr_pft=pns%pft_ntrunc) - - call hist_addfld1d (fname='DISPVEGN', units='gN/m^2', & - avgflag='A', long_name='displayed vegetation nitrogen', & - ptr_pft=pns%dispvegn) - - call hist_addfld1d (fname='STORVEGN', units='gN/m^2', & - avgflag='A', long_name='stored vegetation nitrogen', & - ptr_pft=pns%storvegn) - - call hist_addfld1d (fname='TOTVEGN', units='gN/m^2', & - avgflag='A', long_name='total vegetation nitrogen', & - ptr_pft=pns%totvegn) - - call hist_addfld1d (fname='TOTPFTN', units='gN/m^2', & - avgflag='A', long_name='total PFT-level nitrogen', & - ptr_pft=pns%totpftn) - - !------------------------------- - ! N state variables - native to column - !------------------------------- - - call hist_addfld1d (fname='CWDN', units='gN/m^2', & - avgflag='A', long_name='coarse woody debris N', & - ptr_col=cns%cwdn) - - call hist_addfld1d (fname='LITR1N', units='gN/m^2', & - avgflag='A', long_name='litter labile N', & - ptr_col=cns%litr1n) - - call hist_addfld1d (fname='LITR2N', units='gN/m^2', & - avgflag='A', long_name='litter cellulose N', & - ptr_col=cns%litr2n) - - call hist_addfld1d (fname='LITR3N', units='gN/m^2', & - avgflag='A', long_name='litter lignin N', & - ptr_col=cns%litr3n) - - call hist_addfld1d (fname='SOIL1N', units='gN/m^2', & - avgflag='A', long_name='soil organic matter N (fast pool)', & - ptr_col=cns%soil1n) - - call hist_addfld1d (fname='SOIL2N', units='gN/m^2', & - avgflag='A', long_name='soil organic matter N (medium pool)', & - ptr_col=cns%soil2n) - - call hist_addfld1d (fname='SOIL3N', units='gN/m^2', & - avgflag='A', long_name='soil orgainc matter N (slow pool)', & - ptr_col=cns%soil3n) - - call hist_addfld1d (fname='SOIL4N', units='gN/m^2', & - avgflag='A', long_name='soil orgainc matter N (slowest pool)', & - ptr_col=cns%soil4n) - - call hist_addfld1d (fname='SMINN', units='gN/m^2', & - avgflag='A', long_name='soil mineral N', & - ptr_col=cns%sminn) - - call hist_addfld1d (fname='COL_NTRUNC', units='gN/m^2', & - avgflag='A', long_name='column-level sink for N truncation', & - ptr_col=cns%col_ntrunc) - - call hist_addfld1d (fname='TOTLITN', units='gN/m^2', & - avgflag='A', long_name='total litter N', & - ptr_col=cns%totlitn) - - call hist_addfld1d (fname='TOTSOMN', units='gN/m^2', & - avgflag='A', long_name='total soil organic matter N', & - ptr_col=cns%totsomn) - - call hist_addfld1d (fname='TOTECOSYSN', units='gN/m^2', & - avgflag='A', long_name='total ecosystem N', & - ptr_col=cns%totecosysn) - - call hist_addfld1d (fname='TOTCOLN', units='gN/m^2', & - avgflag='A', long_name='total column-level N', & - ptr_col=cns%totcoln) - - call hist_addfld1d (fname='SEEDN', units='gN/m^2', & - avgflag='A', long_name='pool for seeding new PFTs ', & - ptr_col=cns%seedn) - - call hist_addfld1d (fname='PROD10N', units='gN/m^2', & - avgflag='A', long_name='10-yr wood product N', & - ptr_col=cns%prod10n) - - call hist_addfld1d (fname='PROD100N', units='gN/m^2', & - avgflag='A', long_name='100-yr wood product N', & - ptr_col=cns%prod100n) - - call hist_addfld1d (fname='TOTPRODN', units='gN/m^2', & - avgflag='A', long_name='total wood product N', & - ptr_col=cns%totprodn) - - !------------------------------- - ! C flux variables - native to PFT - !------------------------------- - - ! add history fields for all CLAMP CN variables - - call hist_addfld1d (fname='WOODC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='wood C allocation', & - ptr_pft=pcf%woodc_alloc) - - call hist_addfld1d (fname='WOODC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='wood C loss', & - ptr_pft=pcf%woodc_loss) - - call hist_addfld1d (fname='LEAFC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='leaf C loss', & - ptr_pft=pcf%leafc_loss) - - call hist_addfld1d (fname='LEAFC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='leaf C allocation', & - ptr_pft=pcf%leafc_alloc) - - call hist_addfld1d (fname='FROOTC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='fine root C loss', & - ptr_pft=pcf%frootc_loss) - - call hist_addfld1d (fname='FROOTC_ALLOC', units='gC/m^2/s', & - avgflag='A', long_name='fine root C allocation', & - ptr_pft=pcf%frootc_alloc) - - call hist_addfld1d (fname='PSNSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='sunlit leaf photosynthesis', & - ptr_pft=pcf%psnsun) - - call hist_addfld1d (fname='PSNSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='shaded leaf photosynthesis', & - ptr_pft=pcf%psnsha) - - call hist_addfld1d (fname='M_LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C mortality', & - ptr_pft=pcf%m_leafc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C mortality', & - ptr_pft=pcf%m_frootc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C storage mortality', & - ptr_pft=pcf%m_leafc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage mortality', & - ptr_pft=pcf%m_frootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage mortality', & - ptr_pft=pcf%m_livestemc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage mortality', & - ptr_pft=pcf%m_deadstemc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C storage mortality', & - ptr_pft=pcf%m_livecrootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C storage mortality', & - ptr_pft=pcf%m_deadcrootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer mortality', & - ptr_pft=pcf%m_leafc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer mortality', & - ptr_pft=pcf%m_frootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer mortality', & - ptr_pft=pcf%m_livestemc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer mortality', & - ptr_pft=pcf%m_deadstemc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C transfer mortality', & - ptr_pft=pcf%m_livecrootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C transfer mortality', & - ptr_pft=pcf%m_deadcrootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C mortality', & - ptr_pft=pcf%m_livestemc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C mortality', & - ptr_pft=pcf%m_deadstemc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C mortality', & - ptr_pft=pcf%m_livecrootc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C mortality', & - ptr_pft=pcf%m_deadcrootc_to_litter, default='inactive') - - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage mortality', & - ptr_pft=pcf%m_gresp_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_GRESP_XFER_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer mortality', & - ptr_pft=pcf%m_gresp_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C fire loss', & - ptr_pft=pcf%m_leafc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C fire loss', & - ptr_pft=pcf%m_frootc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C storage fire loss', & - ptr_pft=pcf%m_leafc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage fire loss', & - ptr_pft=pcf%m_frootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage fire loss', & - ptr_pft=pcf%m_livestemc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage fire loss', & - ptr_pft=pcf%m_deadstemc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C storage fire loss', & - ptr_pft=pcf%m_livecrootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C storage fire loss', & - ptr_pft=pcf%m_deadcrootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer fire loss', & - ptr_pft=pcf%m_leafc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer fire loss', & - ptr_pft=pcf%m_frootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer fire loss', & - ptr_pft=pcf%m_livestemc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer fire loss', & - ptr_pft=pcf%m_deadstemc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C transfer fire loss', & - ptr_pft=pcf%m_livecrootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C transfer fire loss', & - ptr_pft=pcf%m_deadcrootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live stem C fire loss', & - ptr_pft=pcf%m_livestemc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C fire loss', & - ptr_pft=pcf%m_deadstemc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C fire mortality to litter', & - ptr_pft=pcf%m_deadstemc_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C fire loss', & - ptr_pft=pcf%m_livecrootc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C fire loss', & - ptr_pft=pcf%m_deadcrootc_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_TO_LITTER_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C fire mortality to litter', & - ptr_pft=pcf%m_deadcrootc_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage fire loss', & - ptr_pft=pcf%m_gresp_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_GRESP_XFER_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer fire loss', & - ptr_pft=pcf%m_gresp_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='LEAFC_XFER_TO_LEAFC', units='gC/m^2/s', & - avgflag='A', long_name='leaf C growth from storage', & - ptr_pft=pcf%leafc_xfer_to_leafc, default='inactive') - - call hist_addfld1d (fname='FROOTC_XFER_TO_FROOTC', units='gC/m^2/s', & - avgflag='A', long_name='fine root C growth from storage', & - ptr_pft=pcf%frootc_xfer_to_frootc, default='inactive') - - call hist_addfld1d (fname='LIVESTEMC_XFER_TO_LIVESTEMC', units='gC/m^2/s', & - avgflag='A', long_name='live stem C growth from storage', & - ptr_pft=pcf%livestemc_xfer_to_livestemc, default='inactive') - - call hist_addfld1d (fname='DEADSTEMC_XFER_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C growth from storage', & - ptr_pft=pcf%deadstemc_xfer_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='LIVECROOTC_XFER_TO_LIVECROOTC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C growth from storage', & - ptr_pft=pcf%livecrootc_xfer_to_livecrootc, default='inactive') - - call hist_addfld1d (fname='DEADCROOTC_XFER_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C growth from storage', & - ptr_pft=pcf%deadcrootc_xfer_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall', & - ptr_pft=pcf%leafc_to_litter, default='inactive') - - call hist_addfld1d (fname='FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C litterfall', & - ptr_pft=pcf%frootc_to_litter, default='inactive') - - call hist_addfld1d (fname='LEAF_MR', units='gC/m^2/s', & - avgflag='A', long_name='leaf maintenance respiration', & - ptr_pft=pcf%leaf_mr, default='inactive') - - call hist_addfld1d (fname='FROOT_MR', units='gC/m^2/s', & - avgflag='A', long_name='fine root maintenance respiration', & - ptr_pft=pcf%froot_mr, default='inactive') - - call hist_addfld1d (fname='LIVESTEM_MR', units='gC/m^2/s', & - avgflag='A', long_name='live stem maintenance respiration', & - ptr_pft=pcf%livestem_mr, default='inactive') - - call hist_addfld1d (fname='LIVECROOT_MR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root maintenance respiration', & - ptr_pft=pcf%livecroot_mr, default='inactive') - - call hist_addfld1d (fname='PSNSUN_TO_CPOOL', units='gC/m^2/s', & - avgflag='A', long_name='C fixation from sunlit canopy', & - ptr_pft=pcf%psnsun_to_cpool) - - call hist_addfld1d (fname='PSNSHADE_TO_CPOOL', units='gC/m^2/s', & - avgflag='A', long_name='C fixation from shaded canopy', & - ptr_pft=pcf%psnshade_to_cpool) - - call hist_addfld1d (fname='CPOOL_TO_LEAFC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to leaf C', & - ptr_pft=pcf%cpool_to_leafc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_LEAFC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to leaf C storage', & - ptr_pft=pcf%cpool_to_leafc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_FROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to fine root C', & - ptr_pft=pcf%cpool_to_frootc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_FROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to fine root C storage', & - ptr_pft=pcf%cpool_to_frootc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_LIVESTEMC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live stem C', & - ptr_pft=pcf%cpool_to_livestemc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_LIVESTEMC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live stem C storage', & - ptr_pft=pcf%cpool_to_livestemc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead stem C', & - ptr_pft=pcf%cpool_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_DEADSTEMC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead stem C storage', & - ptr_pft=pcf%cpool_to_deadstemc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_LIVECROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live coarse root C', & - ptr_pft=pcf%cpool_to_livecrootc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_LIVECROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to live coarse root C storage', & - ptr_pft=pcf%cpool_to_livecrootc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root C', & - ptr_pft=pcf%cpool_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_DEADCROOTC_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root C storage', & - ptr_pft=pcf%cpool_to_deadcrootc_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_TO_GRESP_STORAGE', units='gC/m^2/s', & - avgflag='A', long_name='allocation to growth respiration storage', & - ptr_pft=pcf%cpool_to_gresp_storage, default='inactive') - - call hist_addfld1d (fname='CPOOL_LEAF_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration', & - ptr_pft=pcf%cpool_leaf_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_LEAF_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration to storage', & - ptr_pft=pcf%cpool_leaf_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_LEAF_GR', units='gC/m^2/s', & - avgflag='A', long_name='leaf growth respiration from storage', & - ptr_pft=pcf%transfer_leaf_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_FROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration', & - ptr_pft=pcf%cpool_froot_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_FROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration to storage', & - ptr_pft=pcf%cpool_froot_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_FROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='fine root growth respiration from storage', & - ptr_pft=pcf%transfer_froot_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_LIVESTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration', & - ptr_pft=pcf%cpool_livestem_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_LIVESTEM_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration to storage', & - ptr_pft=pcf%cpool_livestem_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_LIVESTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='live stem growth respiration from storage', & - ptr_pft=pcf%transfer_livestem_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_DEADSTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration', & - ptr_pft=pcf%cpool_deadstem_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_DEADSTEM_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration to storage', & - ptr_pft=pcf%cpool_deadstem_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_DEADSTEM_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead stem growth respiration from storage', & - ptr_pft=pcf%transfer_deadstem_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_LIVECROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration', & - ptr_pft=pcf%cpool_livecroot_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_LIVECROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration to storage', & - ptr_pft=pcf%cpool_livecroot_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_LIVECROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root growth respiration from storage', & - ptr_pft=pcf%transfer_livecroot_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_DEADCROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration', & - ptr_pft=pcf%cpool_deadcroot_gr, default='inactive') - - call hist_addfld1d (fname='CPOOL_DEADCROOT_STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration to storage', & - ptr_pft=pcf%cpool_deadcroot_storage_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_DEADCROOT_GR', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root growth respiration from storage', & - ptr_pft=pcf%transfer_deadcroot_gr, default='inactive') - - call hist_addfld1d (fname='LEAFC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='leaf C shift storage to transfer', & - ptr_pft=pcf%leafc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='FROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='fine root C shift storage to transfer', & - ptr_pft=pcf%frootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='live stem C shift storage to transfer', & - ptr_pft=pcf%livestemc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='DEADSTEMC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C shift storage to transfer', & - ptr_pft=pcf%deadstemc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVECROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C shift storage to transfer', & - ptr_pft=pcf%livecrootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='DEADCROOTC_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C shift storage to transfer', & - ptr_pft=pcf%deadcrootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='GRESP_STORAGE_TO_XFER', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration shift storage to transfer', & - ptr_pft=pcf%gresp_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMC_TO_DEADSTEMC', units='gC/m^2/s', & - avgflag='A', long_name='live stem C turnover', & - ptr_pft=pcf%livestemc_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='LIVECROOTC_TO_DEADCROOTC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C turnover', & - ptr_pft=pcf%livecrootc_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='GPP', units='gC/m^2/s', & - avgflag='A', long_name='gross primary production', & - ptr_pft=pcf%gpp) - - call hist_addfld1d (fname='MR', units='gC/m^2/s', & - avgflag='A', long_name='maintenance respiration', & - ptr_pft=pcf%mr) - - call hist_addfld1d (fname='CURRENT_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for new growth displayed in this timestep', & - ptr_pft=pcf%current_gr, default='inactive') - - call hist_addfld1d (fname='TRANSFER_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for transfer growth displayed in this timestep', & - ptr_pft=pcf%transfer_gr, default='inactive') - - call hist_addfld1d (fname='STORAGE_GR', units='gC/m^2/s', & - avgflag='A', long_name='growth resp for growth sent to storage for later display', & - ptr_pft=pcf%storage_gr, default='inactive') - - call hist_addfld1d (fname='GR', units='gC/m^2/s', & - avgflag='A', long_name='total growth respiration', & - ptr_pft=pcf%gr) - - call hist_addfld1d (fname='AR', units='gC/m^2/s', & - avgflag='A', long_name='autotrophic respiration (MR + GR)', & - ptr_pft=pcf%ar) - - call hist_addfld1d (fname='RR', units='gC/m^2/s', & - avgflag='A', long_name='root respiration (fine root MR + total root GR)', & - ptr_pft=pcf%rr) - - call hist_addfld1d (fname='NPP', units='gC/m^2/s', & - avgflag='A', long_name='net primary production', & - ptr_pft=pcf%npp) - - call hist_addfld1d (fname='AGNPP', units='gC/m^2/s', & - avgflag='A', long_name='aboveground NPP', & - ptr_pft=pcf%agnpp) - - call hist_addfld1d (fname='BGNPP', units='gC/m^2/s', & - avgflag='A', long_name='belowground NPP', & - ptr_pft=pcf%bgnpp) - - call hist_addfld1d (fname='LITFALL', units='gC/m^2/s', & - avgflag='A', long_name='litterfall (leaves and fine roots)', & - ptr_pft=pcf%litfall) - - call hist_addfld1d (fname='VEGFIRE', units='gC/m^2/s', & - avgflag='A', long_name='pft-level fire loss', & - ptr_pft=pcf%vegfire, default='inactive') - - call hist_addfld1d (fname='WOOD_HARVESTC', units='gC/m^2/s', & - avgflag='A', long_name='wood harvest carbon (to product pools)', & - ptr_pft=pcf%wood_harvestc) - - call hist_addfld1d (fname='PFT_FIRE_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total pft-level fire C loss', & - ptr_pft=pcf%pft_fire_closs) - - if (use_c13) then - !------------------------------- - ! C13 flux variables - native to PFT - !------------------------------- - - call hist_addfld1d (fname='C13_PSNSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='C13 sunlit leaf photosynthesis', & - ptr_pft=pc13f%psnsun) - - call hist_addfld1d (fname='C13_PSNSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='C13 shaded leaf photosynthesis', & - ptr_pft=pc13f%psnsha) - - call hist_addfld1d (fname='C13_M_LEAFC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C mortality', & - ptr_pft=pc13f%m_leafc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C mortality', & - ptr_pft=pc13f%m_frootc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C storage mortality', & - ptr_pft=pc13f%m_leafc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C storage mortality', & - ptr_pft=pc13f%m_frootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C storage mortality', & - ptr_pft=pc13f%m_livestemc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C storage mortality', & - ptr_pft=pc13f%m_deadstemc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C storage mortality', & - ptr_pft=pc13f%m_livecrootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C storage mortality', & - ptr_pft=pc13f%m_deadcrootc_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C transfer mortality', & - ptr_pft=pc13f%m_leafc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C transfer mortality', & - ptr_pft=pc13f%m_frootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C transfer mortality', & - ptr_pft=pc13f%m_livestemc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C transfer mortality', & - ptr_pft=pc13f%m_deadstemc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C transfer mortality', & - ptr_pft=pc13f%m_livecrootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C transfer mortality', & - ptr_pft=pc13f%m_deadcrootc_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C mortality', & - ptr_pft=pc13f%m_livestemc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C mortality', & - ptr_pft=pc13f%m_deadstemc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C mortality', & - ptr_pft=pc13f%m_livecrootc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C mortality', & - ptr_pft=pc13f%m_deadcrootc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_STORAGE_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration storage mortality', & - ptr_pft=pc13f%m_gresp_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_XFER_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration transfer mortality', & - ptr_pft=pc13f%m_gresp_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C fire loss', & - ptr_pft=pc13f%m_leafc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C fire loss', & - ptr_pft=pc13f%m_frootc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C storage fire loss', & - ptr_pft=pc13f%m_leafc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C storage fire loss', & - ptr_pft=pc13f%m_frootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C storage fire loss', & - ptr_pft=pc13f%m_livestemc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C storage fire loss', & - ptr_pft=pc13f%m_deadstemc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C storage fire loss', & - ptr_pft=pc13f%m_livecrootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C storage fire loss', & - ptr_pft=pc13f%m_deadcrootc_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C transfer fire loss', & - ptr_pft=pc13f%m_leafc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C transfer fire loss', & - ptr_pft=pc13f%m_frootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C transfer fire loss', & - ptr_pft=pc13f%m_livestemc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C transfer fire loss', & - ptr_pft=pc13f%m_deadstemc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C transfer fire loss', & - ptr_pft=pc13f%m_livecrootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C transfer fire loss', & - ptr_pft=pc13f%m_deadcrootc_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C fire loss', & - ptr_pft=pc13f%m_livestemc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C fire loss', & - ptr_pft=pc13f%m_deadstemc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_LITTER_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C fire mortality to litter', & - ptr_pft=pc13f%m_deadstemc_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C fire loss', & - ptr_pft=pc13f%m_livecrootc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C fire loss', & - ptr_pft=pc13f%m_deadcrootc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_LITTER_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C fire mortality to litter', & - ptr_pft=pc13f%m_deadcrootc_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_STORAGE_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration storage fire loss', & - ptr_pft=pc13f%m_gresp_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_XFER_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration transfer fire loss', & - ptr_pft=pc13f%m_gresp_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_XFER_TO_LEAFC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C growth from storage', & - ptr_pft=pc13f%leafc_xfer_to_leafc, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_XFER_TO_FROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C growth from storage', & - ptr_pft=pc13f%frootc_xfer_to_frootc, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEMC_XFER_TO_LIVESTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C growth from storage', & - ptr_pft=pc13f%livestemc_xfer_to_livestemc, default='inactive') - - call hist_addfld1d (fname='C13_DEADSTEMC_XFER_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C growth from storage', & - ptr_pft=pc13f%deadstemc_xfer_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOTC_XFER_TO_LIVECROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C growth from storage', & - ptr_pft=pc13f%livecrootc_xfer_to_livecrootc, default='inactive') - - call hist_addfld1d (fname='C13_DEADCROOTC_XFER_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C growth from storage', & - ptr_pft=pc13f%deadcrootc_xfer_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C litterfall', & - ptr_pft=pc13f%leafc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_TO_LITTER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall', & - ptr_pft=pc13f%frootc_to_litter, default='inactive') - - call hist_addfld1d (fname='C13_LEAF_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf maintenance respiration', & - ptr_pft=pc13f%leaf_mr, default='inactive') - - call hist_addfld1d (fname='C13_FROOT_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root maintenance respiration', & - ptr_pft=pc13f%froot_mr, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEM_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem maintenance respiration', & - ptr_pft=pc13f%livestem_mr, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOT_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root maintenance respiration', & - ptr_pft=pc13f%livecroot_mr, default='inactive') - - call hist_addfld1d (fname='C13_PSNSUN_TO_CPOOL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 C fixation from sunlit canopy', & - ptr_pft=pc13f%psnsun_to_cpool) - - call hist_addfld1d (fname='C13_PSNSHADE_TO_CPOOL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 C fixation from shaded canopy', & - ptr_pft=pc13f%psnshade_to_cpool) - - call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to leaf C', & - ptr_pft=pc13f%cpool_to_leafc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to leaf C storage', & - ptr_pft=pc13f%cpool_to_leafc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_FROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to fine root C', & - ptr_pft=pc13f%cpool_to_frootc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_FROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to fine root C storage', & - ptr_pft=pc13f%cpool_to_frootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_LIVESTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live stem C', & - ptr_pft=pc13f%cpool_to_livestemc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_LIVESTEMC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live stem C storage', & - ptr_pft=pc13f%cpool_to_livestemc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead stem C', & - ptr_pft=pc13f%cpool_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_DEADSTEMC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead stem C storage', & - ptr_pft=pc13f%cpool_to_deadstemc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_LIVECROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live coarse root C', & - ptr_pft=pc13f%cpool_to_livecrootc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_LIVECROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to live coarse root C storage', & - ptr_pft=pc13f%cpool_to_livecrootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead coarse root C', & - ptr_pft=pc13f%cpool_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_DEADCROOTC_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to dead coarse root C storage', & - ptr_pft=pc13f%cpool_to_deadcrootc_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_TO_GRESP_STORAGE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 allocation to growth respiration storage', & - ptr_pft=pc13f%cpool_to_gresp_storage, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LEAF_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration', & - ptr_pft=pc13f%cpool_leaf_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LEAF_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration to storage', & - ptr_pft=pc13f%cpool_leaf_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_LEAF_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf growth respiration from storage', & - ptr_pft=pc13f%transfer_leaf_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_FROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration', & - ptr_pft=pc13f%cpool_froot_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_FROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration to storage', & - ptr_pft=pc13f%cpool_froot_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_FROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root growth respiration from storage', & - ptr_pft=pc13f%transfer_froot_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LIVESTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration', & - ptr_pft=pc13f%cpool_livestem_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LIVESTEM_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration to storage', & - ptr_pft=pc13f%cpool_livestem_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_LIVESTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem growth respiration from storage', & - ptr_pft=pc13f%transfer_livestem_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_DEADSTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration', & - ptr_pft=pc13f%cpool_deadstem_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_DEADSTEM_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration to storage', & - ptr_pft=pc13f%cpool_deadstem_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_DEADSTEM_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem growth respiration from storage', & - ptr_pft=pc13f%transfer_deadstem_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LIVECROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration', & - ptr_pft=pc13f%cpool_livecroot_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_LIVECROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration to storage', & - ptr_pft=pc13f%cpool_livecroot_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_LIVECROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root growth respiration from storage', & - ptr_pft=pc13f%transfer_livecroot_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_DEADCROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration', & - ptr_pft=pc13f%cpool_deadcroot_gr, default='inactive') - - call hist_addfld1d (fname='C13_CPOOL_DEADCROOT_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration to storage', & - ptr_pft=pc13f%cpool_deadcroot_storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_DEADCROOT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root growth respiration from storage', & - ptr_pft=pc13f%transfer_deadcroot_gr, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C shift storage to transfer', & - ptr_pft=pc13f%leafc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C shift storage to transfer', & - ptr_pft=pc13f%frootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C shift storage to transfer', & - ptr_pft=pc13f%livestemc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C shift storage to transfer', & - ptr_pft=pc13f%deadstemc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C shift storage to transfer', & - ptr_pft=pc13f%livecrootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C shift storage to transfer', & - ptr_pft=pc13f%deadcrootc_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_GRESP_STORAGE_TO_XFER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration shift storage to transfer', & - ptr_pft=pc13f%gresp_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='C13_LIVESTEMC_TO_DEADSTEMC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C turnover', & - ptr_pft=pc13f%livestemc_to_deadstemc, default='inactive') - - call hist_addfld1d (fname='C13_LIVECROOTC_TO_DEADCROOTC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C turnover', & - ptr_pft=pc13f%livecrootc_to_deadcrootc, default='inactive') - - call hist_addfld1d (fname='C13_GPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 gross primary production', & - ptr_pft=pc13f%gpp) - - call hist_addfld1d (fname='C13_MR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 maintenance respiration', & - ptr_pft=pc13f%mr) - - call hist_addfld1d (fname='C13_CURRENT_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for new growth displayed in this timestep', & - ptr_pft=pc13f%current_gr, default='inactive') - - call hist_addfld1d (fname='C13_TRANSFER_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for transfer growth displayed in this timestep', & - ptr_pft=pc13f%transfer_gr, default='inactive') - - call hist_addfld1d (fname='C13_STORAGE_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth resp for growth sent to storage for later display', & - ptr_pft=pc13f%storage_gr, default='inactive') - - call hist_addfld1d (fname='C13_GR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total growth respiration', & - ptr_pft=pc13f%gr) - - call hist_addfld1d (fname='C13_AR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 autotrophic respiration (MR + GR)', & - ptr_pft=pc13f%ar) - - call hist_addfld1d (fname='C13_RR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 root respiration (fine root MR + total root GR)', & - ptr_pft=pc13f%rr) - - call hist_addfld1d (fname='C13_NPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net primary production', & - ptr_pft=pc13f%npp) - - call hist_addfld1d (fname='C13_AGNPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 aboveground NPP', & - ptr_pft=pc13f%agnpp) - - call hist_addfld1d (fname='C13_BGNPP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 belowground NPP', & - ptr_pft=pc13f%bgnpp) - - call hist_addfld1d (fname='C13_LITFALL', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litterfall (leaves and fine roots)', & - ptr_pft=pc13f%litfall, default='inactive') - - call hist_addfld1d (fname='C13_VEGFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 pft-level fire loss', & - ptr_pft=pc13f%vegfire, default='inactive') - - call hist_addfld1d (fname='C13_PFT_FIRE_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total pft-level fire C loss', & - ptr_pft=pc13f%pft_fire_closs) - endif - - !------------------------------- - ! C flux variables - native to column - !------------------------------- - ! add history fields for all CLAMP CN variables - - call hist_addfld1d (fname='CWDC_HR', units='gC/m^2/s', & - avgflag='A', long_name='coarse woody debris C heterotrophic respiration', & - ptr_col=ccf%cwdc_hr) - - call hist_addfld1d (fname='CWDC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='coarse woody debris C loss', & - ptr_col=ccf%cwdc_loss) - - call hist_addfld1d (fname='LITTERC_HR', units='gC/m^2/s', & - avgflag='A', long_name='litter C heterotrophic respiration', & - ptr_col=ccf%lithr) - - call hist_addfld1d (fname='LITTERC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='litter C loss', & - ptr_col=ccf%litterc_loss) - - call hist_addfld1d (fname='SOILC_HR', units='gC/m^2/s', & - avgflag='A', long_name='soil C heterotrophic respiration', & - ptr_col=ccf%somhr) - - call hist_addfld1d (fname='SOILC_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='soil C loss', & - ptr_col=ccf%somhr) - - call hist_addfld1d (fname='M_LEAFC_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C mortality to litter 1 C', & - ptr_col=ccf%m_leafc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C mortality to litter 2 C', & - ptr_col=ccf%m_leafc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C mortality to litter 3 C', & - ptr_col=ccf%m_leafc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C mortality to litter 1 C', & - ptr_col=ccf%m_frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C mortality to litter 2 C', & - ptr_col=ccf%m_frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C mortality to litter 3 C', & - ptr_col=ccf%m_frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C storage mortality to litter 1 C', & - ptr_col=ccf%m_leafc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C storage mortality to litter 1 C', & - ptr_col=ccf%m_frootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='live stem C storage mortality to litter 1 C', & - ptr_col=ccf%m_livestemc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C storage mortality to litter 1 C', & - ptr_col=ccf%m_deadstemc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C storage mortality to litter 1 C', & - ptr_col=ccf%m_livecrootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C storage mortality to litter 1 C', & - ptr_col=ccf%m_deadcrootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LEAFC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C transfer mortality to litter 1 C', & - ptr_col=ccf%m_leafc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_FROOTC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C transfer mortality to litter 1 C', & - ptr_col=ccf%m_frootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='live stem C transfer mortality to litter 1 C', & - ptr_col=ccf%m_livestemc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C transfer mortality to litter 1 C', & - ptr_col=ccf%m_deadstemc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C transfer mortality to litter 1 C', & - ptr_col=ccf%m_livecrootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C transfer mortality to litter 1 C', & - ptr_col=ccf%m_deadcrootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='live stem C mortality to coarse woody debris C', & - ptr_col=ccf%m_livestemc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C mortality to coarse woody debris C', & - ptr_col=ccf%m_deadstemc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root C mortality to coarse woody debris C', & - ptr_col=ccf%m_livecrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C mortality to coarse woody debris C', & - ptr_col=ccf%m_deadcrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='M_GRESP_STORAGE_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration storage mortality to litter 1 C', & - ptr_col=ccf%m_gresp_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_GRESP_XFER_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='growth respiration transfer mortality to litter 1 C', & - ptr_col=ccf%m_gresp_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMC_TO_CWDC_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead stem C to coarse woody debris C by fire', & - ptr_col=ccf%m_deadstemc_to_cwdc_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTC_TO_CWDC_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root C to to woody debris C by fire', & - ptr_col=ccf%m_deadcrootc_to_cwdc_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR1C_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='litter 1 C fire loss', & - ptr_col=ccf%m_litr1c_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR2C_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='litter 2 C fire loss', & - ptr_col=ccf%m_litr2c_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR3C_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='litter 3 C fire loss', & - ptr_col=ccf%m_litr3c_to_fire, default='inactive') - - call hist_addfld1d (fname='M_CWDC_TO_FIRE', units='gC/m^2/s', & - avgflag='A', long_name='coarse woody debris C fire loss', & - ptr_col=ccf%m_cwdc_to_fire, default='inactive') - - call hist_addfld1d (fname='LEAFC_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall to litter 1 C', & - ptr_col=ccf%leafc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='LEAFC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall to litter 2 C', & - ptr_col=ccf%leafc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='LEAFC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='leaf C litterfall to litter 3 C', & - ptr_col=ccf%leafc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='FROOTC_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C litterfall to litter 1 C', & - ptr_col=ccf%frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='FROOTC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C litterfall to litter 2 C', & - ptr_col=ccf%frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='FROOTC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='fine root C litterfall to litter 3 C', & - ptr_col=ccf%frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='CWDC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of coarse woody debris C to litter 2 C', & - ptr_col=ccf%cwdc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='CWDC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of coarse woody debris C to litter 3 C', & - ptr_col=ccf%cwdc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='LITR1_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from litter 1 C', & - ptr_col=ccf%litr1_hr, default='inactive') - - call hist_addfld1d (fname='LITR1C_TO_SOIL1C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of litter 1 C to SOM 1 C', & - ptr_col=ccf%litr1c_to_soil1c) - - call hist_addfld1d (fname='LITR2_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from litter 2 C', & - ptr_col=ccf%litr2_hr, default='inactive') - - call hist_addfld1d (fname='LITR2C_TO_SOIL2C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of litter 2 C to SOM 2 C', & - ptr_col=ccf%litr2c_to_soil2c) - - call hist_addfld1d (fname='LITR3_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from litter 3 C', & - ptr_col=ccf%litr3_hr, default='inactive') - - call hist_addfld1d (fname='LITR3C_TO_SOIL3C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of litter 3 C to SOM 3 C', & - ptr_col=ccf%litr3c_to_soil3c) - - call hist_addfld1d (fname='SOIL1_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from SOM 1 C', & - ptr_col=ccf%soil1_hr, default='inactive') - - call hist_addfld1d (fname='SOIL1C_TO_SOIL2C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of SOM 1 C to SOM 2 C', & - ptr_col=ccf%soil1c_to_soil2c, default='inactive') - - call hist_addfld1d (fname='SOIL2_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from SOM 2 C', & - ptr_col=ccf%soil2_hr, default='inactive') - - call hist_addfld1d (fname='SOIL2C_TO_SOIL3C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of SOM 2 C to SOM 3 C', & - ptr_col=ccf%soil2c_to_soil3c, default='inactive') - - call hist_addfld1d (fname='SOIL3_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from SOM 3 C', & - ptr_col=ccf%soil3_hr, default='inactive') - - call hist_addfld1d (fname='SOIL3C_TO_SOIL4C', units='gC/m^2/s', & - avgflag='A', long_name='decomp. of SOM 3 C to SOM 4 C', & - ptr_col=ccf%soil3c_to_soil4c, default='inactive') - - call hist_addfld1d (fname='SOIL4_HR', units='gC/m^2/s', & - avgflag='A', long_name='het. resp. from SOM 4 C', & - ptr_col=ccf%soil4_hr, default='inactive') - - call hist_addfld1d (fname='LITHR', units='gC/m^2/s', & - avgflag='A', long_name='litter heterotrophic respiration', & - ptr_col=ccf%lithr) - - call hist_addfld1d (fname='SOMHR', units='gC/m^2/s', & - avgflag='A', long_name='soil organic matter heterotrophic respiration', & - ptr_col=ccf%somhr) - - call hist_addfld1d (fname='HR', units='gC/m^2/s', & - avgflag='A', long_name='total heterotrophic respiration', & - ptr_col=ccf%hr) - - call hist_addfld1d (fname='SR', units='gC/m^2/s', & - avgflag='A', long_name='total soil respiration (HR + root resp)', & - ptr_col=ccf%sr) - - call hist_addfld1d (fname='ER', units='gC/m^2/s', & - avgflag='A', long_name='total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=ccf%er) - - call hist_addfld1d (fname='LITFIRE', units='gC/m^2/s', & - avgflag='A', long_name='litter fire losses', & - ptr_col=ccf%litfire, default='inactive') - - call hist_addfld1d (fname='SOMFIRE', units='gC/m^2/s', & - avgflag='A', long_name='soil organic matter fire losses', & - ptr_col=ccf%somfire, default='inactive') - - call hist_addfld1d (fname='TOTFIRE', units='gC/m^2/s', & - avgflag='A', long_name='total ecosystem fire losses', & - ptr_col=ccf%totfire, default='inactive') - - call hist_addfld1d (fname='NEP', units='gC/m^2/s', & - avgflag='A', long_name='net ecosystem production, excludes fire, landuse, and harvest flux, positive for sink', & - ptr_col=ccf%nep) - - call hist_addfld1d (fname='NBP', units='gC/m^2/s', & - avgflag='A', long_name='net biome production, includes fire, landuse, and harvest flux, positive for sink', & - ptr_col=ccf%nbp) - - call hist_addfld1d (fname='NEE', units='gC/m^2/s', & - avgflag='A', long_name=& - 'net ecosystem exchange of carbon, includes fire, landuse, harvest, and hrv_xsmrpool flux, positive for source', & - ptr_col=ccf%nee) - - call hist_addfld1d (fname='COL_FIRE_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total column-level fire C loss', & - ptr_col=ccf%col_fire_closs) - - call hist_addfld1d (fname='DWT_SEEDC_TO_LEAF', units='gC/m^2/s', & - avgflag='A', long_name='seed source to PFT-level leaf', & - ptr_col=ccf%dwt_seedc_to_leaf) - - call hist_addfld1d (fname='DWT_SEEDC_TO_DEADSTEM', units='gC/m^2/s', & - avgflag='A', long_name='seed source to PFT-level deadstem', & - ptr_col=ccf%dwt_seedc_to_deadstem) - - call hist_addfld1d (fname='DWT_CONV_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='conversion C flux (immediate loss to atm)', & - ptr_col=ccf%dwt_conv_cflux) - - call hist_addfld1d (fname='DWT_PROD10C_GAIN', units='gC/m^2/s', & - avgflag='A', long_name='landcover change-driven addition to 10-yr wood product pool', & - ptr_col=ccf%dwt_prod10c_gain) - - call hist_addfld1d (fname='PROD10C_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='loss from 10-yr wood product pool', & - ptr_col=ccf%prod10c_loss) - - call hist_addfld1d (fname='DWT_PROD100C_GAIN', units='gC/m^2/s', & - avgflag='A', long_name='landcover change-driven addition to 100-yr wood product pool', & - ptr_col=ccf%dwt_prod100c_gain) - - call hist_addfld1d (fname='PROD100C_LOSS', units='gC/m^2/s', & - avgflag='A', long_name='loss from 100-yr wood product pool', & - ptr_col=ccf%prod100c_loss) - - call hist_addfld1d (fname='DWT_FROOTC_TO_LITR1C', units='gC/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=ccf%dwt_frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='DWT_FROOTC_TO_LITR2C', units='gC/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=ccf%dwt_frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='DWT_FROOTC_TO_LITR3C', units='gC/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=ccf%dwt_frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='DWT_LIVECROOTC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='live coarse root to CWD due to landcover change', & - ptr_col=ccf%dwt_livecrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='DWT_DEADCROOTC_TO_CWDC', units='gC/m^2/s', & - avgflag='A', long_name='dead coarse root to CWD due to landcover change', & - ptr_col=ccf%dwt_deadcrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='DWT_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total carbon loss from land cover conversion', & - ptr_col=ccf%dwt_closs) - - call hist_addfld1d (fname='PRODUCT_CLOSS', units='gC/m^2/s', & - avgflag='A', long_name='total carbon loss from wood product pools', & - ptr_col=ccf%product_closs) - - call hist_addfld1d (fname='LAND_USE_FLUX', units='gC/m^2/s', & - avgflag='A', long_name='total C emitted from land cover conversion and wood product pools', & - ptr_col=ccf%landuseflux) - - call hist_addfld1d (fname='LAND_UPTAKE', units='gC/m^2/s', & - avgflag='A', long_name='NEE minus LAND_USE_FLUX, negative for update', & - ptr_col=ccf%landuptake) - - if (use_c13) then - !------------------------------- - ! C13 flux variables - native to column - !------------------------------- - - call hist_addfld1d (fname='C13_M_LEAFC_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C mortality to litter 1 C', & - ptr_col=cc13f%m_leafc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C mortality to litter 2 C', & - ptr_col=cc13f%m_leafc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C mortality to litter 3 C', & - ptr_col=cc13f%m_leafc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C mortality to litter 1 C', & - ptr_col=cc13f%m_frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C mortality to litter 2 C', & - ptr_col=cc13f%m_frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C mortality to litter 3 C', & - ptr_col=cc13f%m_frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C storage mortality to litter 1 C', & - ptr_col=cc13f%m_leafc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C storage mortality to litter 1 C', & - ptr_col=cc13f%m_frootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C storage mortality to litter 1 C', & - ptr_col=cc13f%m_livestemc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C storage mortality to litter 1 C', & - ptr_col=cc13f%m_deadstemc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C storage mortality to litter 1 C', & - ptr_col=cc13f%m_livecrootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C storage mortality to litter 1 C', & - ptr_col=cc13f%m_deadcrootc_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LEAFC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_leafc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_FROOTC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_frootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_livestemc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_deadstemc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_livecrootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C transfer mortality to litter 1 C', & - ptr_col=cc13f%m_deadcrootc_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVESTEMC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live stem C mortality to coarse woody debris C', & - ptr_col=cc13f%m_livestemc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C mortality to coarse woody debris C', & - ptr_col=cc13f%m_deadstemc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_M_LIVECROOTC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root C mortality to coarse woody debris C', & - ptr_col=cc13f%m_livecrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C mortality to coarse woody debris C', & - ptr_col=cc13f%m_deadcrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_STORAGE_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration storage mortality to litter 1 C', & - ptr_col=cc13f%m_gresp_storage_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_GRESP_XFER_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 growth respiration transfer mortality to litter 1 C', & - ptr_col=cc13f%m_gresp_xfer_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADSTEMC_TO_CWDC_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead stem C to coarse woody debris C by fire', & - ptr_col=cc13f%m_deadstemc_to_cwdc_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_DEADCROOTC_TO_CWDC_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root C to to woody debris C by fire', & - ptr_col=cc13f%m_deadcrootc_to_cwdc_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LITR1C_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter 1 C fire loss', & - ptr_col=cc13f%m_litr1c_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LITR2C_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter 2 C fire loss', & - ptr_col=cc13f%m_litr2c_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_LITR3C_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter 3 C fire loss', & - ptr_col=cc13f%m_litr3c_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_M_CWDC_TO_FIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 coarse woody debris C fire loss', & - ptr_col=cc13f%m_cwdc_to_fire, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C litterfall to litter 1 C', & - ptr_col=cc13f%leafc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C litterfall to litter 2 C', & - ptr_col=cc13f%leafc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_LEAFC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 leaf C litterfall to litter 3 C', & - ptr_col=cc13f%leafc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall to litter 1 C', & - ptr_col=cc13f%frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall to litter 2 C', & - ptr_col=cc13f%frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_FROOTC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root C litterfall to litter 3 C', & - ptr_col=cc13f%frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_CWDC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of coarse woody debris C to litter 2 C', & - ptr_col=cc13f%cwdc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_CWDC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of coarse woody debris C to litter 3 C', & - ptr_col=cc13f%cwdc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_LITR1_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from litter 1 C', & - ptr_col=cc13f%litr1_hr, default='inactive') - - call hist_addfld1d (fname='C13_LITR1C_TO_SOIL1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of litter 1 C to SOM 1 C', & - ptr_col=cc13f%litr1c_to_soil1c, default='inactive') - - call hist_addfld1d (fname='C13_LITR2_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from litter 2 C', & - ptr_col=cc13f%litr2_hr, default='inactive') - - call hist_addfld1d (fname='C13_LITR2C_TO_SOIL2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of litter 2 C to SOM 2 C', & - ptr_col=cc13f%litr2c_to_soil2c, default='inactive') - - call hist_addfld1d (fname='C13_LITR3_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from litter 3 C', & - ptr_col=cc13f%litr3_hr, default='inactive') - - call hist_addfld1d (fname='C13_LITR3C_TO_SOIL3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of litter 3 C to SOM 3 C', & - ptr_col=cc13f%litr3c_to_soil3c, default='inactive') - - call hist_addfld1d (fname='C13_SOIL1_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from SOM 1 C', & - ptr_col=cc13f%soil1_hr, default='inactive') - - call hist_addfld1d (fname='C13_SOIL1C_TO_SOIL2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of SOM 1 C to SOM 2 C', & - ptr_col=cc13f%soil1c_to_soil2c, default='inactive') - - call hist_addfld1d (fname='C13_SOIL2_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from SOM 2 C', & - ptr_col=cc13f%soil2_hr, default='inactive') - - call hist_addfld1d (fname='C13_SOIL2C_TO_SOIL3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of SOM 2 C to SOM 3 C', & - ptr_col=cc13f%soil2c_to_soil3c, default='inactive') - - call hist_addfld1d (fname='C13_SOIL3_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from SOM 3 C', & - ptr_col=cc13f%soil3_hr, default='inactive') - - call hist_addfld1d (fname='C13_SOIL3C_TO_SOIL4C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 decomp. of SOM 3 C to SOM 4 C', & - ptr_col=cc13f%soil3c_to_soil4c, default='inactive') - - call hist_addfld1d (fname='C13_SOIL4_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 het. resp. from SOM 4 C', & - ptr_col=cc13f%soil4_hr, default='inactive') - - call hist_addfld1d (fname='C13_LITHR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter heterotrophic respiration', & - ptr_col=cc13f%lithr) - - call hist_addfld1d (fname='C13_SOMHR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 soil organic matter heterotrophic respiration', & - ptr_col=cc13f%somhr) - - call hist_addfld1d (fname='C13_HR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total heterotrophic respiration', & - ptr_col=cc13f%hr) - - call hist_addfld1d (fname='C13_SR', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total soil respiration (HR + root resp)', & - ptr_col=cc13f%sr) - - call hist_addfld1d (fname='C13_ER', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total ecosystem respiration, autotrophic + heterotrophic', & - ptr_col=cc13f%er) - - call hist_addfld1d (fname='C13_LITFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 litter fire losses', & - ptr_col=cc13f%litfire, default='inactive') - - call hist_addfld1d (fname='C13_SOMFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 soil organic matter fire losses', & - ptr_col=cc13f%somfire, default='inactive') - - call hist_addfld1d (fname='C13_TOTFIRE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total ecosystem fire losses', & - ptr_col=cc13f%totfire, default='inactive') - - call hist_addfld1d (fname='C13_NEP', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net ecosystem production, excludes fire flux, positive for sink', & - ptr_col=cc13f%nep) - - call hist_addfld1d (fname='C13_NEE', units='gC13/m^2/s', & - avgflag='A', long_name='C13 net ecosystem exchange of carbon, includes fire flux, positive for source', & - ptr_col=cc13f%nee) - - call hist_addfld1d (fname='C13_COL_FIRE_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total column-level fire C loss', & - ptr_col=cc13f%col_fire_closs) - - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_LEAF', units='gC13/m^2/s', & - avgflag='A', long_name='C13 seed source to PFT-level leaf', & - ptr_col=cc13f%dwt_seedc_to_leaf) - - call hist_addfld1d (fname='C13_DWT_SEEDC_TO_DEADSTEM', units='gC13/m^2/s', & - avgflag='A', long_name='C13 seed source to PFT-level deadstem', & - ptr_col=cc13f%dwt_seedc_to_deadstem) - - call hist_addfld1d (fname='C13_DWT_CONV_CFLUX', units='gC13/m^2/s', & - avgflag='A', long_name='C13 conversion C flux (immediate loss to atm)', & - ptr_col=cc13f%dwt_conv_cflux) - - call hist_addfld1d (fname='C13_DWT_PROD10C_GAIN', units='gC13/m^2/s', & - avgflag='A', long_name='C13 addition to 10-yr wood product pool', & - ptr_col=cc13f%dwt_prod10c_gain) - - call hist_addfld1d (fname='C13_PROD10C_LOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 loss from 10-yr wood product pool', & - ptr_col=cc13f%prod10c_loss) - - call hist_addfld1d (fname='C13_DWT_PROD100C_GAIN', units='gC13/m^2/s', & - avgflag='A', long_name='C13 addition to 100-yr wood product pool', & - ptr_col=cc13f%dwt_prod100c_gain) - - call hist_addfld1d (fname='C13_PROD100C_LOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 loss from 100-yr wood product pool', & - ptr_col=cc13f%prod100c_loss) - - call hist_addfld1d (fname='C13_DWT_FROOTC_TO_LITR1C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=cc13f%dwt_frootc_to_litr1c, default='inactive') - - call hist_addfld1d (fname='C13_DWT_FROOTC_TO_LITR2C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=cc13f%dwt_frootc_to_litr2c, default='inactive') - - call hist_addfld1d (fname='C13_DWT_FROOTC_TO_LITR3C', units='gC13/m^2/s', & - avgflag='A', long_name='C13 fine root to litter due to landcover change', & - ptr_col=cc13f%dwt_frootc_to_litr3c, default='inactive') - - call hist_addfld1d (fname='C13_DWT_LIVECROOTC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 live coarse root to CWD due to landcover change', & - ptr_col=cc13f%dwt_livecrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_DWT_DEADCROOTC_TO_CWDC', units='gC13/m^2/s', & - avgflag='A', long_name='C13 dead coarse root to CWD due to landcover change', & - ptr_col=cc13f%dwt_deadcrootc_to_cwdc, default='inactive') - - call hist_addfld1d (fname='C13_DWT_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total carbon loss from land cover conversion', & - ptr_col=cc13f%dwt_closs) - - call hist_addfld1d (fname='C13_PRODUCT_CLOSS', units='gC13/m^2/s', & - avgflag='A', long_name='C13 total carbon loss from wood product pools', & - ptr_col=cc13f%product_closs) - endif - - !------------------------------- - ! N flux variables - native to PFT - !------------------------------- - - call hist_addfld1d (fname='M_LEAFN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N mortality', & - ptr_pft=pnf%m_leafn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N mortality', & - ptr_pft=pnf%m_frootn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N storage mortality', & - ptr_pft=pnf%m_leafn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N storage mortality', & - ptr_pft=pnf%m_frootn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N storage mortality', & - ptr_pft=pnf%m_livestemn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N storage mortality', & - ptr_pft=pnf%m_deadstemn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N storage mortality', & - ptr_pft=pnf%m_livecrootn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_STORAGE_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N storage mortality', & - ptr_pft=pnf%m_deadcrootn_storage_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N transfer mortality', & - ptr_pft=pnf%m_leafn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N transfer mortality', & - ptr_pft=pnf%m_frootn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N transfer mortality', & - ptr_pft=pnf%m_livestemn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N transfer mortality', & - ptr_pft=pnf%m_deadstemn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N transfer mortality', & - ptr_pft=pnf%m_livecrootn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_XFER_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N transfer mortality', & - ptr_pft=pnf%m_deadcrootn_xfer_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N mortality', & - ptr_pft=pnf%m_livestemn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N mortality', & - ptr_pft=pnf%m_deadstemn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N mortality', & - ptr_pft=pnf%m_livecrootn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N mortality', & - ptr_pft=pnf%m_deadcrootn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_RETRANSN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='retranslocated N pool mortality', & - ptr_pft=pnf%m_retransn_to_litter, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N fire loss', & - ptr_pft=pnf%m_leafn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N fire loss ', & - ptr_pft=pnf%m_frootn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N storage fire loss', & - ptr_pft=pnf%m_leafn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N storage fire loss', & - ptr_pft=pnf%m_frootn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N storage fire loss', & - ptr_pft=pnf%m_livestemn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N storage fire loss', & - ptr_pft=pnf%m_deadstemn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N storage fire loss', & - ptr_pft=pnf%m_livecrootn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_STORAGE_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N storage fire loss', & - ptr_pft=pnf%m_deadcrootn_storage_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='leaf N transfer fire loss', & - ptr_pft=pnf%m_leafn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='fine root N transfer fire loss', & - ptr_pft=pnf%m_frootn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N transfer fire loss', & - ptr_pft=pnf%m_livestemn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N transfer fire loss', & - ptr_pft=pnf%m_deadstemn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N transfer fire loss', & - ptr_pft=pnf%m_livecrootn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_XFER_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N transfer fire loss', & - ptr_pft=pnf%m_deadcrootn_xfer_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live stem N fire loss', & - ptr_pft=pnf%m_livestemn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N fire loss', & - ptr_pft=pnf%m_deadstemn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_TO_LITTER_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N fire mortality to litter', & - ptr_pft=pnf%m_deadstemn_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N fire loss', & - ptr_pft=pnf%m_livecrootn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N fire loss', & - ptr_pft=pnf%m_deadcrootn_to_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_TO_LITTER_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N fire mortality to litter', & - ptr_pft=pnf%m_deadcrootn_to_litter_fire, default='inactive') - - call hist_addfld1d (fname='M_RETRANSN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='retranslocated N pool fire loss', & - ptr_pft=pnf%m_retransn_to_fire, default='inactive') - - call hist_addfld1d (fname='LEAFN_XFER_TO_LEAFN', units='gN/m^2/s', & - avgflag='A', long_name='leaf N growth from storage', & - ptr_pft=pnf%leafn_xfer_to_leafn, default='inactive') - - call hist_addfld1d (fname='FROOTN_XFER_TO_FROOTN', units='gN/m^2/s', & - avgflag='A', long_name='fine root N growth from storage', & - ptr_pft=pnf%frootn_xfer_to_frootn, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN_XFER_TO_LIVESTEMN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N growth from storage', & - ptr_pft=pnf%livestemn_xfer_to_livestemn, default='inactive') - - call hist_addfld1d (fname='DEADSTEMN_XFER_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N growth from storage', & - ptr_pft=pnf%deadstemn_xfer_to_deadstemn, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN_XFER_TO_LIVECROOTN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N growth from storage', & - ptr_pft=pnf%livecrootn_xfer_to_livecrootn, default='inactive') - - call hist_addfld1d (fname='DEADCROOTN_XFER_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N growth from storage', & - ptr_pft=pnf%deadcrootn_xfer_to_deadcrootn, default='inactive') - - call hist_addfld1d (fname='LEAFN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N litterfall', & - ptr_pft=pnf%leafn_to_litter, default='inactive') - - call hist_addfld1d (fname='LEAFN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='leaf N to retranslocated N pool', & - ptr_pft=pnf%leafn_to_retransn, default='inactive') - - call hist_addfld1d (fname='FROOTN_TO_LITTER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N litterfall', & - ptr_pft=pnf%frootn_to_litter, default='inactive') - - call hist_addfld1d (fname='RETRANSN_TO_NPOOL', units='gN/m^2/s', & - avgflag='A', long_name='deployment of retranslocated N', & - ptr_pft=pnf%retransn_to_npool) - - call hist_addfld1d (fname='SMINN_TO_NPOOL', units='gN/m^2/s', & - avgflag='A', long_name='deployment of soil mineral N uptake', & - ptr_pft=pnf%sminn_to_npool) - - call hist_addfld1d (fname='NPOOL_TO_LEAFN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to leaf N', & - ptr_pft=pnf%npool_to_leafn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_LEAFN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to leaf N storage', & - ptr_pft=pnf%npool_to_leafn_storage, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_FROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to fine root N', & - ptr_pft=pnf%npool_to_frootn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_FROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to fine root N storage', & - ptr_pft=pnf%npool_to_frootn_storage, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_LIVESTEMN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live stem N', & - ptr_pft=pnf%npool_to_livestemn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_LIVESTEMN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live stem N storage', & - ptr_pft=pnf%npool_to_livestemn_storage, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead stem N', & - ptr_pft=pnf%npool_to_deadstemn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_DEADSTEMN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead stem N storage', & - ptr_pft=pnf%npool_to_deadstemn_storage, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_LIVECROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live coarse root N', & - ptr_pft=pnf%npool_to_livecrootn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_LIVECROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to live coarse root N storage', & - ptr_pft=pnf%npool_to_livecrootn_storage, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root N', & - ptr_pft=pnf%npool_to_deadcrootn, default='inactive') - - call hist_addfld1d (fname='NPOOL_TO_DEADCROOTN_STORAGE', units='gN/m^2/s', & - avgflag='A', long_name='allocation to dead coarse root N storage', & - ptr_pft=pnf%npool_to_deadcrootn_storage, default='inactive') - - call hist_addfld1d (fname='LEAFN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='leaf N shift storage to transfer', & - ptr_pft=pnf%leafn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='FROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='fine root N shift storage to transfer', & - ptr_pft=pnf%frootn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='live stem N shift storage to transfer', & - ptr_pft=pnf%livestemn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='DEADSTEMN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N shift storage to transfer', & - ptr_pft=pnf%deadstemn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N shift storage to transfer', & - ptr_pft=pnf%livecrootn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='DEADCROOTN_STORAGE_TO_XFER', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N shift storage to transfer', & - ptr_pft=pnf%deadcrootn_storage_to_xfer, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN_TO_DEADSTEMN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N turnover', & - ptr_pft=pnf%livestemn_to_deadstemn, default='inactive') - - call hist_addfld1d (fname='LIVESTEMN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N to retranslocated N pool', & - ptr_pft=pnf%livestemn_to_retransn, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN_TO_DEADCROOTN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N turnover', & - ptr_pft=pnf%livecrootn_to_deadcrootn, default='inactive') - - call hist_addfld1d (fname='LIVECROOTN_TO_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N to retranslocated N pool', & - ptr_pft=pnf%livecrootn_to_retransn, default='inactive') - - call hist_addfld1d (fname='NDEPLOY', units='gN/m^2/s', & - avgflag='A', long_name='total N deployed in new growth', & - ptr_pft=pnf%ndeploy) - - call hist_addfld1d (fname='WOOD_HARVESTN', units='gN/m^2/s', & - avgflag='A', long_name='wood harvest N (to product pools)', & - ptr_pft=pnf%wood_harvestn) - - call hist_addfld1d (fname='PFT_FIRE_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total pft-level fire N loss', & - ptr_pft=pnf%pft_fire_nloss) - - !------------------------------- - ! N flux variables - native to column - !------------------------------- - - call hist_addfld1d (fname='NDEP_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='atmospheric N deposition to soil mineral N', & - ptr_col=cnf%ndep_to_sminn) - - call hist_addfld1d (fname='NFIX_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='symbiotic/asymbiotic N fixation to soil mineral N', & - ptr_col=cnf%nfix_to_sminn) - - call hist_addfld1d (fname='M_LEAFN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N mortality to litter 1 N', & - ptr_col=cnf%m_leafn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N mortality to litter 2 N', & - ptr_col=cnf%m_leafn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N mortality to litter 3 N', & - ptr_col=cnf%m_leafn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N mortality to litter 1 N', & - ptr_col=cnf%m_frootn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N mortality to litter 2 N', & - ptr_col=cnf%m_frootn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N mortality to litter 3 N', & - ptr_col=cnf%m_frootn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N storage mortality to litter 1 N', & - ptr_col=cnf%m_leafn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N storage mortality to litter 1 N', & - ptr_col=cnf%m_frootn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='live stem N storage mortality to litter 1 N', & - ptr_col=cnf%m_livestemn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N storage mortality to litter 1 N', & - ptr_col=cnf%m_deadstemn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N storage mortality to litter 1 N', & - ptr_col=cnf%m_livecrootn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_STORAGE_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N storage mortality to litter 1 N', & - ptr_col=cnf%m_deadcrootn_storage_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LEAFN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N transfer mortality to litter 1 N', & - ptr_col=cnf%m_leafn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_FROOTN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N transfer mortality to litter 1 N', & - ptr_col=cnf%m_frootn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='live stem N transfer mortality to litter 1 N', & - ptr_col=cnf%m_livestemn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N transfer mortality to litter 1 N', & - ptr_col=cnf%m_deadstemn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N transfer mortality to litter 1 N', & - ptr_col=cnf%m_livecrootn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_XFER_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N transfer mortality to litter 1 N', & - ptr_col=cnf%m_deadcrootn_xfer_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_LIVESTEMN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='live stem N mortality to coarse woody debris N', & - ptr_col=cnf%m_livestemn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N mortality to coarse woody debris N', & - ptr_col=cnf%m_deadstemn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='M_LIVECROOTN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root N mortality to coarse woody debris N', & - ptr_col=cnf%m_livecrootn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N mortality to coarse woody debris N', & - ptr_col=cnf%m_deadcrootn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='M_RETRANSN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='retranslocated N pool mortality to litter 1 N', & - ptr_col=cnf%m_retransn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='M_DEADSTEMN_TO_CWDN_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead stem N to coarse woody debris N by fire', & - ptr_col=cnf%m_deadstemn_to_cwdn_fire, default='inactive') - - call hist_addfld1d (fname='M_DEADCROOTN_TO_CWDN_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root N to to woody debris N by fire', & - ptr_col=cnf%m_deadcrootn_to_cwdn_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR1N_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='litter 1 N fire loss', & - ptr_col=cnf%m_litr1n_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR2N_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='litter 2 N fire loss', & - ptr_col=cnf%m_litr2n_to_fire, default='inactive') - - call hist_addfld1d (fname='M_LITR3N_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='litter 3 N fire loss', & - ptr_col=cnf%m_litr3n_to_fire, default='inactive') - - call hist_addfld1d (fname='M_CWDN_TO_FIRE', units='gN/m^2/s', & - avgflag='A', long_name='coarse woody debris N fire loss', & - ptr_col=cnf%m_cwdn_to_fire, default='inactive') - - call hist_addfld1d (fname='LEAFN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N litterfall to litter 1 N', & - ptr_col=cnf%leafn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='LEAFN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N litterfall to litter 2 N', & - ptr_col=cnf%leafn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='LEAFN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='leaf N litterfall to litter 3 N', & - ptr_col=cnf%leafn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='FROOTN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N litterfall to litter 1 N', & - ptr_col=cnf%frootn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='FROOTN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N litterfall to litter 2 N', & - ptr_col=cnf%frootn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='FROOTN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='fine root N litterfall to litter 3 N ', & - ptr_col=cnf%frootn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='CWDN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of coarse woody debris N to litter 2 N', & - ptr_col=cnf%cwdn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='CWDN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of coarse woody debris N to litter 3 N', & - ptr_col=cnf%cwdn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='LITR1N_TO_SOIL1N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of litter 1 N to SOM 1 N', & - ptr_col=cnf%litr1n_to_soil1n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL1N_L1', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of litter 1 to SOM 1', & - ptr_col=cnf%sminn_to_soil1n_l1, default='inactive') - - call hist_addfld1d (fname='LITR2N_TO_SOIL2N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of litter 2 N to SOM 2 N', & - ptr_col=cnf%litr2n_to_soil2n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL2N_L2', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of litter 2 to SOM 2', & - ptr_col=cnf%sminn_to_soil2n_l2, default='inactive') - - call hist_addfld1d (fname='LITR3N_TO_SOIL3N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of litter 3 N to SOM 3 N', & - ptr_col=cnf%litr3n_to_soil3n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL3N_L3', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of litter 3 to SOM 3', & - ptr_col=cnf%sminn_to_soil3n_l3, default='inactive') - - call hist_addfld1d (fname='SOIL1N_TO_SOIL2n', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of SOM 1 N to SOM 2 N', & - ptr_col=cnf%soil1n_to_soil2n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL2N_S1', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of SOM 1 to SOM 2', & - ptr_col=cnf%sminn_to_soil2n_s1, default='inactive') - - call hist_addfld1d (fname='SOIL2N_TO_SOIL3N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of SOM 2 N to SOM 3 N', & - ptr_col=cnf%soil2n_to_soil3n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL3N_S2', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of SOM 2 to SOM 3', & - ptr_col=cnf%sminn_to_soil3n_s2, default='inactive') - - call hist_addfld1d (fname='SOIL3N_TO_SOIL4N', units='gN/m^2/s', & - avgflag='A', long_name='decomp. of SOM 3 N to SOM 4 N', & - ptr_col=cnf%soil3n_to_soil4n, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_SOIL4N_S3', units='gN/m^2/s', & - avgflag='A', long_name='mineral N flux for decomp. of SOM 3 to SOM 4', & - ptr_col=cnf%sminn_to_soil4n_s3, default='inactive') - - call hist_addfld1d (fname='SOIL4N_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='N mineralization for decomp. of SOM 4', & - ptr_col=cnf%soil4n_to_sminn, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_L1S1', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of litter 1 to SOM 1', & - ptr_col=cnf%sminn_to_denit_l1s1, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_L2S2', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of litter 2 to SOM 2', & - ptr_col=cnf%sminn_to_denit_l2s2, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_L3S3', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of litter 3 to SOM 3', & - ptr_col=cnf%sminn_to_denit_l3s3, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_S1S2', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of SOM 1 to SOM 2', & - ptr_col=cnf%sminn_to_denit_s1s2, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_S2S3', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of SOM 2 to SOM 3', & - ptr_col=cnf%sminn_to_denit_s2s3, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_S3S4', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of SOM 3 to SOM 4', & - ptr_col=cnf%sminn_to_denit_s3s4, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_S4', units='gN/m^2/s', & - avgflag='A', long_name='denitrification for decomp. of SOM 4', & - ptr_col=cnf%sminn_to_denit_s4, default='inactive') - - call hist_addfld1d (fname='SMINN_TO_DENIT_EXCESS', units='gN/m^2/s', & - avgflag='A', long_name='denitrification from excess mineral N pool', & - ptr_col=cnf%sminn_to_denit_excess, default='inactive') - - call hist_addfld1d (fname='SMINN_LEACHED', units='gN/m^2/s', & - avgflag='A', long_name='soil mineral N pool loss to leaching', & - ptr_col=cnf%sminn_leached) - - call hist_addfld1d (fname='POTENTIAL_IMMOB', units='gN/m^2/s', & - avgflag='A', long_name='potential N immobilization', & - ptr_col=cnf%potential_immob) - - call hist_addfld1d (fname='ACTUAL_IMMOB', units='gN/m^2/s', & - avgflag='A', long_name='actual N immobilization', & - ptr_col=cnf%actual_immob) - - call hist_addfld1d (fname='SMINN_TO_PLANT', units='gN/m^2/s', & - avgflag='A', long_name='plant uptake of soil mineral N', & - ptr_col=cnf%sminn_to_plant) - - call hist_addfld1d (fname='SUPPLEMENT_TO_SMINN', units='gN/m^2/s', & - avgflag='A', long_name='supplemental N supply', & - ptr_col=cnf%supplement_to_sminn) - - call hist_addfld1d (fname='GROSS_NMIN', units='gN/m^2/s', & - avgflag='A', long_name='gross rate of N mineralization', & - ptr_col=cnf%gross_nmin) - - call hist_addfld1d (fname='NET_NMIN', units='gN/m^2/s', & - avgflag='A', long_name='net rate of N mineralization', & - ptr_col=cnf%net_nmin) - - call hist_addfld1d (fname='DENIT', units='gN/m^2/s', & - avgflag='A', long_name='total rate of denitrification', & - ptr_col=cnf%denit) - - call hist_addfld1d (fname='COL_FIRE_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total column-level fire N loss', & - ptr_col=cnf%col_fire_nloss) - - call hist_addfld1d (fname='DWT_SEEDN_TO_LEAF', units='gN/m^2/s', & - avgflag='A', long_name='seed source to PFT-level leaf', & - ptr_col=cnf%dwt_seedn_to_leaf) - - call hist_addfld1d (fname='DWT_SEEDN_TO_DEADSTEM', units='gN/m^2/s', & - avgflag='A', long_name='seed source to PFT-level deadstem', & - ptr_col=cnf%dwt_seedn_to_deadstem) - - call hist_addfld1d (fname='DWT_CONV_NFLUX', units='gN/m^2/s', & - avgflag='A', long_name='conversion N flux (immediate loss to atm)', & - ptr_col=cnf%dwt_conv_nflux) - - call hist_addfld1d (fname='DWT_PROD10N_GAIN', units='gN/m^2/s', & - avgflag='A', long_name='addition to 10-yr wood product pool', & - ptr_col=cnf%dwt_prod10n_gain) - - call hist_addfld1d (fname='PROD10N_LOSS', units='gN/m^2/s', & - avgflag='A', long_name='loss from 10-yr wood product pool', & - ptr_col=cnf%prod10n_loss) - - call hist_addfld1d (fname='DWT_PROD100N_GAIN', units='gN/m^2/s', & - avgflag='A', long_name='addition to 100-yr wood product pool', & - ptr_col=cnf%dwt_prod100n_gain) - - call hist_addfld1d (fname='PROD100N_LOSS', units='gN/m^2/s', & - avgflag='A', long_name='loss from 100-yr wood product pool', & - ptr_col=cnf%prod100n_loss) - - call hist_addfld1d (fname='PRODUCT_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total N loss from wood product pools', & - ptr_col=cnf%product_nloss) - - call hist_addfld1d (fname='DWT_FROOTN_TO_LITR1N', units='gN/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=cnf%dwt_frootn_to_litr1n, default='inactive') - - call hist_addfld1d (fname='DWT_FROOTN_TO_LITR2N', units='gN/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=cnf%dwt_frootn_to_litr2n, default='inactive') - - call hist_addfld1d (fname='DWT_FROOTN_TO_LITR3N', units='gN/m^2/s', & - avgflag='A', long_name='fine root to litter due to landcover change', & - ptr_col=cnf%dwt_frootn_to_litr3n, default='inactive') - - call hist_addfld1d (fname='DWT_LIVECROOTN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='live coarse root to CWD due to landcover change', & - ptr_col=cnf%dwt_livecrootn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='DWT_DEADCROOTN_TO_CWDN', units='gN/m^2/s', & - avgflag='A', long_name='dead coarse root to CWD due to landcover change', & - ptr_col=cnf%dwt_deadcrootn_to_cwdn, default='inactive') - - call hist_addfld1d (fname='DWT_NLOSS', units='gN/m^2/s', & - avgflag='A', long_name='total nitrogen loss from landcover conversion', & - ptr_col=cnf%dwt_nloss) - - !------------------------------- - ! PFT ecophysiological variables (pepv) - !------------------------------- - - call hist_addfld1d (fname='DORMANT_FLAG', units='none', & - avgflag='A', long_name='dormancy flag', & - ptr_pft=pepv%dormant_flag, default='inactive') - - call hist_addfld1d (fname='DAYS_ACTIVE', units='days', & - avgflag='A', long_name='number of days since last dormancy', & - ptr_pft=pepv%days_active, default='inactive') - - call hist_addfld1d (fname='ONSET_FLAG', units='none', & - avgflag='A', long_name='onset flag', & - ptr_pft=pepv%onset_flag, default='inactive') - - call hist_addfld1d (fname='ONSET_COUNTER', units='days', & - avgflag='A', long_name='onset days counter', & - ptr_pft=pepv%onset_counter, default='inactive') - - call hist_addfld1d (fname='ONSET_GDDFLAG', units='none', & - avgflag='A', long_name='onset flag for growing degree day sum', & - ptr_pft=pepv%onset_gddflag, default='inactive') - - call hist_addfld1d (fname='ONSET_FDD', units='C degree-days', & - avgflag='A', long_name='onset freezing degree days counter', & - ptr_pft=pepv%onset_fdd, default='inactive') - - call hist_addfld1d (fname='ONSET_GDD', units='C degree-days', & - avgflag='A', long_name='onset growing degree days', & - ptr_pft=pepv%onset_gdd, default='inactive') - - call hist_addfld1d (fname='ONSET_SWI', units='none', & - avgflag='A', long_name='onset soil water index', & - ptr_pft=pepv%onset_swi, default='inactive') - - call hist_addfld1d (fname='OFFSET_FLAG', units='none', & - avgflag='A', long_name='offset flag', & - ptr_pft=pepv%offset_flag, default='inactive') - - call hist_addfld1d (fname='OFFSET_COUNTER', units='days', & - avgflag='A', long_name='offset days counter', & - ptr_pft=pepv%offset_counter, default='inactive') - - call hist_addfld1d (fname='OFFSET_FDD', units='C degree-days', & - avgflag='A', long_name='offset freezing degree days counter', & - ptr_pft=pepv%offset_fdd, default='inactive') - - call hist_addfld1d (fname='OFFSET_SWI', units='none', & - avgflag='A', long_name='offset soil water index', & - ptr_pft=pepv%offset_swi, default='inactive') - - call hist_addfld1d (fname='LGSF', units='proportion', & - avgflag='A', long_name='long growing season factor', & - ptr_pft=pepv%lgsf, default='inactive') - - call hist_addfld1d (fname='BGLFR', units='1/s', & - avgflag='A', long_name='background litterfall rate', & - ptr_pft=pepv%bglfr, default='inactive') - - call hist_addfld1d (fname='BGTR', units='1/s', & - avgflag='A', long_name='background transfer growth rate', & - ptr_pft=pepv%bgtr, default='inactive') - - call hist_addfld1d (fname='DAYL', units='s', & - avgflag='A', long_name='daylength', & - ptr_pft=pepv%dayl, default='inactive') - - call hist_addfld1d (fname='PREV_DAYL', units='s', & - avgflag='A', long_name='daylength from previous timestep', & - ptr_pft=pepv%prev_dayl, default='inactive') - - call hist_addfld1d (fname='ANNAVG_T2M', units='K', & - avgflag='A', long_name='annual average 2m air temperature', & - ptr_pft=pepv%annavg_t2m, default='inactive') - - call hist_addfld1d (fname='TEMPAVG_T2M', units='K', & - avgflag='A', long_name='temporary average 2m air temperature', & - ptr_pft=pepv%tempavg_t2m, default='inactive') - - call hist_addfld1d (fname='INIT_GPP', units='gC/m^2/s', & - avgflag='A', long_name='GPP flux before downregulation', & - ptr_pft=pepv%gpp, default='inactive') - - call hist_addfld1d (fname='AVAILC', units='gC/m^2/s', & - avgflag='A', long_name='C flux available for allocation', & - ptr_pft=pepv%availc, default='inactive') - - call hist_addfld1d (fname='XSMRPOOL_RECOVER', units='gC/m^2/s', & - avgflag='A', long_name='C flux assigned to recovery of negative xsmrpool', & - ptr_pft=pepv%xsmrpool_recover) - - if (use_c13) then - call hist_addfld1d (fname='XSMRPOOL_C13RATIO', units='proportion', & - avgflag='A', long_name='C13/C(12+13) ratio for xsmrpool', & - ptr_pft=pepv%xsmrpool_c13ratio, default='inactive') - endif - - call hist_addfld1d (fname='ALLOC_PNOW', units='proportion', & - avgflag='A', long_name='fraction of current allocation to display as new growth', & - ptr_pft=pepv%alloc_pnow, default='inactive') - - call hist_addfld1d (fname='C_ALLOMETRY', units='none', & - avgflag='A', long_name='C allocation index', & - ptr_pft=pepv%c_allometry, default='inactive') - - call hist_addfld1d (fname='N_ALLOMETRY', units='none', & - avgflag='A', long_name='N allocation index', & - ptr_pft=pepv%n_allometry, default='inactive') - - call hist_addfld1d (fname='PLANT_NDEMAND', units='gN/m^2/s', & - avgflag='A', long_name='N flux required to support initial GPP', & - ptr_pft=pepv%plant_ndemand) - - call hist_addfld1d (fname='TEMPSUM_POTENTIAL_GPP', units='gC/m^2/yr', & - avgflag='A', long_name='temporary annual sum of potential GPP', & - ptr_pft=pepv%tempsum_potential_gpp, default='inactive') - - call hist_addfld1d (fname='ANNSUM_POTENTIAL_GPP', units='gN/m^2/yr', & - avgflag='A', long_name='annual sum of potential GPP', & - ptr_pft=pepv%annsum_potential_gpp, default='inactive') - - call hist_addfld1d (fname='TEMPMAX_RETRANSN', units='gN/m^2', & - avgflag='A', long_name='temporary annual max of retranslocated N pool', & - ptr_pft=pepv%tempmax_retransn, default='inactive') - - call hist_addfld1d (fname='ANNMAX_RETRANSN', units='gN/m^2', & - avgflag='A', long_name='annual max of retranslocated N pool', & - ptr_pft=pepv%annmax_retransn, default='inactive') - - call hist_addfld1d (fname='AVAIL_RETRANSN', units='gN/m^2/s', & - avgflag='A', long_name='N flux available from retranslocation pool', & - ptr_pft=pepv%avail_retransn, default='inactive') - - call hist_addfld1d (fname='PLANT_NALLOC', units='gN/m^2/s', & - avgflag='A', long_name='total allocated N flux', & - ptr_pft=pepv%plant_nalloc, default='inactive') - - call hist_addfld1d (fname='PLANT_CALLOC', units='gC/m^2/s', & - avgflag='A', long_name='total allocated C flux', & - ptr_pft=pepv%plant_calloc, default='inactive') - - call hist_addfld1d (fname='EXCESS_CFLUX', units='gC/m^2/s', & - avgflag='A', long_name='C flux not allocated due to downregulation', & - ptr_pft=pepv%excess_cflux, default='inactive') - - call hist_addfld1d (fname='DOWNREG', units='proportion', & - avgflag='A', long_name='fractional reduction in GPP due to N limitation', & - ptr_pft=pepv%downreg, default='inactive') - - call hist_addfld1d (fname='PREV_LEAFC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='previous timestep leaf C litterfall flux', & - ptr_pft=pepv%prev_leafc_to_litter, default='inactive') - - call hist_addfld1d (fname='PREV_FROOTC_TO_LITTER', units='gC/m^2/s', & - avgflag='A', long_name='previous timestep froot C litterfall flux', & - ptr_pft=pepv%prev_frootc_to_litter, default='inactive') - - call hist_addfld1d (fname='ANNSUM_NPP', units='gC/m^2/yr', & - avgflag='A', long_name='annual sum of NPP', & - ptr_pft=pepv%annsum_npp, default='inactive') - - if (use_c13) then - call hist_addfld1d (fname='RC13_CANAIR', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for canopy air', & - ptr_pft=pepv%rc13_canair, default='inactive') - - call hist_addfld1d (fname='RC13_PSNSUN', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for sunlit photosynthesis', & - ptr_pft=pepv%rc13_psnsun, default='inactive') - - call hist_addfld1d (fname='RC13_PSNSHA', units='proportion', & - avgflag='A', long_name='C13/C(12+13) for shaded photosynthesis', & - ptr_pft=pepv%rc13_psnsha, default='inactive') - endif - - !------------------------------- - ! PFT physical state variables not already defined by default - !------------------------------- - - call hist_addfld1d (fname='EMV', units='proportion', & - avgflag='A', long_name='vegetation emissivity', & - ptr_pft=pps%emv, default='inactive') - - call hist_addfld1d (fname='Z0MV', units='m', & - avgflag='A', long_name='roughness length over vegetation, momentum', & - ptr_pft=pps%z0mv, default='inactive') - - call hist_addfld1d (fname='Z0HV', units='m', & - avgflag='A', long_name='roughness length over vegetation, sensible heat', & - ptr_pft=pps%z0hv, default='inactive') - - call hist_addfld1d (fname='Z0QV', units='m', & - avgflag='A', long_name='roughness length over vegetation, latent heat', & - ptr_pft=pps%z0qv, default='inactive') - - call hist_addfld1d (fname='DEWMX', units='mm', & - avgflag='A', long_name='Maximum allowed dew', & - ptr_pft=pps%dewmx, default='inactive') - - call hist_addfld1d (fname='LNCSUN', units='gN/m^2', & - avgflag='A', long_name='leaf N concentration per unit projected LAI', & - ptr_pft=pps%lncsun, default='inactive') - - call hist_addfld1d (fname='LNCSHA', units='gN/m^2', & - avgflag='A', long_name='leaf N concentration per unit projected LAI', & - ptr_pft=pps%lncsha, default='inactive') - - call hist_addfld1d (fname='VCMXSUN', units='umolCO2/m^2/s', & - avgflag='A', long_name='sunlit leaf Vcmax', & - ptr_pft=pps%vcmxsun, default='inactive') - - call hist_addfld1d (fname='VCMXSHA', units='umolCO2/m^2/s', & - avgflag='A', long_name='shaded leaf Vcmax', & - ptr_pft=pps%vcmxsha, default='inactive') - - call hist_addfld1d (fname='FSUN', units='proportion', & - avgflag='A', long_name='sunlit fraction of canopy', & - ptr_pft=pps%fsun, default='inactive') - - call hist_addfld1d (fname='GDIR', units='proportion', & - avgflag='A', long_name='leaf projection in solar direction', & - ptr_pft=pps%gdir, default='inactive') - - call hist_addfld1d (fname='CISUN', units='Pa', & - avgflag='A', long_name='sunlit intracellular CO2', & - ptr_pft=pps%cisun, default='inactive') - - call hist_addfld1d (fname='CISHA', units='Pa', & - avgflag='A', long_name='shaded intracellular CO2', & - ptr_pft=pps%cisha, default='inactive') - - if (use_c13) then - call hist_addfld1d (fname='ALPHAPSNSUN', units='proportion', & - avgflag='A', long_name='sunlit c13 fractionation', & - ptr_pft=pps%alphapsnsun, default='inactive') - - call hist_addfld1d (fname='ALPHAPSNSHA', units='proportion', & - avgflag='A', long_name='shaded c13 fractionation', & - ptr_pft=pps%alphapsnsha, default='inactive') - endif - - call hist_addfld1d (fname='FWET', units='proportion', & - avgflag='A', long_name='fraction of canopy that is wet', & - ptr_pft=pps%fwet, default='inactive') - - call hist_addfld1d (fname='FDRY', units='proportion', & - avgflag='A', long_name='fraction of foliage that is green and dry', & - ptr_pft=pps%fdry, default='inactive') - - call hist_addfld1d (fname='DT_VEG', units='K', & - avgflag='A', long_name='change in t_veg, last iteration', & - ptr_pft=pps%dt_veg, default='inactive') - - call hist_addfld1d (fname='HTOP', units='m', & - avgflag='A', long_name='canopy top', & - ptr_pft=pps%htop) - - call hist_addfld1d (fname='HBOT', units='m', & - avgflag='A', long_name='canopy bottom', & - ptr_pft=pps%hbot, default='inactive') - - call hist_addfld1d (fname='Z0M', units='m', & - avgflag='A', long_name='momentum roughness length', & - ptr_pft=pps%z0m, default='inactive') - - call hist_addfld1d (fname='DISPLA', units='m', & - avgflag='A', long_name='displacement height', & - ptr_pft=pps%displa, default='inactive') - - call hist_addfld1d (fname='U10_DUST', units='m/s', & - avgflag='A', long_name='10-m wind for dust model', & - ptr_pft=pps%u10, default='inactive') - - call hist_addfld1d (fname='RAM1', units='s/m', & - avgflag='A', long_name='aerodynamical resistance ', & - ptr_pft=pps%ram1, default='inactive') - - call hist_addfld1d (fname='FV', units='m/s', & - avgflag='A', long_name='friction velocity for dust model', & - ptr_pft=pps%fv, default='inactive') - - call hist_addfld2d (fname='ROOTFR', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='fraction of roots in each soil layer', & - ptr_pft=pps%rootfr, default='inactive') - - call hist_addfld2d (fname='ROOTR', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective fraction of roots in each soil layer', & - ptr_pft=pps%rootr, default='inactive') - - call hist_addfld2d (fname='RRESIS', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='root resistance in each soil layer', & - ptr_pft=pps%rresis, default='inactive') - - call hist_addfld2d (fname='ALBD', units='proportion', type2d='numrad', & - avgflag='A', long_name='surface albedo (direct)', & - ptr_pft=pps%albd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld2d (fname='ALBI', units='proportion', type2d='numrad', & - avgflag='A', long_name='surface albedo (indirect)', & - ptr_pft=pps%albi, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld2d (fname='FABD', units='proportion', type2d='numrad', & - avgflag='A', long_name='flux absorbed by veg per unit direct flux', & - ptr_pft=pps%fabd, default='inactive') - - call hist_addfld2d (fname='FABI', units='proportion', type2d='numrad', & - avgflag='A', long_name='flux absorbed by veg per unit indirect flux', & - ptr_pft=pps%fabi, default='inactive') - - call hist_addfld2d (fname='FTDD', units='proportion', type2d='numrad', & - avgflag='A', long_name='down direct flux below veg per unit dir flx', & - ptr_pft=pps%ftdd, default='inactive') - - call hist_addfld2d (fname='FTID', units='proportion', type2d='numrad', & - avgflag='A', long_name='down indirect flux below veg per unit dir flx', & - ptr_pft=pps%ftid, default='inactive') - - call hist_addfld2d (fname='FTII', units='proportion', type2d='numrad', & - avgflag='A', long_name='down indirect flux below veg per unit indirect flx', & - ptr_pft=pps%ftii, default='inactive') - - call hist_addfld2d (fname='OMEGA', units='proportion', type2d='numrad', & - avgflag='A', long_name='fraction of intercepted radiation that is scattered', & - ptr_pft=pps%omega, default='inactive') - - call hist_addfld2d (fname='EFF_KID', units='none', type2d='numrad', & - avgflag='A', long_name='effective extinction coefficient for indirect from direct', & - ptr_pft=pps%eff_kid, default='inactive') - - call hist_addfld2d (fname='EFF_KII', units='none', type2d='numrad', & - avgflag='A', long_name='effective extinction coefficient for indirect from indirect', & - ptr_pft=pps%eff_kii, default='inactive') - - call hist_addfld2d (fname='SUN_FAID', units='proportion', type2d='numrad', & - avgflag='A', long_name='fraction sun canopy absorbed indirect from direct', & - ptr_pft=pps%sun_faid, default='inactive') - - call hist_addfld2d (fname='SUN_FAII', units='proportion', type2d='numrad', & - avgflag='A', long_name='fraction sun canopy absorbed indirect from indirect', & - ptr_pft=pps%sun_faii, default='inactive') - - call hist_addfld2d (fname='SHA_FAID', units='proportion', type2d='numrad', & - avgflag='A', long_name='fraction shade canopy absorbed indirect from direct', & - ptr_pft=pps%sha_faid, default='inactive') - - call hist_addfld2d (fname='SHA_FAII', units='proportion', type2d='numrad', & - avgflag='A', long_name='fraction shade canopy absorbed indirect from indirect', & - ptr_pft=pps%sha_faii, default='inactive') - - if ( crop_prog )then - - call hist_addfld1d (fname='GDD0', units='ddays', & - avgflag='A', long_name='Growing degree days base 0C from planting', & - ptr_pft=pps%gdd0, default='inactive') - - call hist_addfld1d (fname='GDD8', units='ddays', & - avgflag='A', long_name='Growing degree days base 8C from planting', & - ptr_pft=pps%gdd8, default='inactive') - - call hist_addfld1d (fname='GDD10', units='ddays', & - avgflag='A', long_name='Growing degree days base 10C from planting', & - ptr_pft=pps%gdd10, default='inactive') - - call hist_addfld1d (fname='GDD020', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 0C from planting', & - ptr_pft=pps%gdd020, default='inactive') - - call hist_addfld1d (fname='GDD820', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 8C from planting', & - ptr_pft=pps%gdd820, default='inactive') - - call hist_addfld1d (fname='GDD1020', units='ddays', & - avgflag='A', long_name='Twenty year average of growing degree days base 10C from planting', & - ptr_pft=pps%gdd1020, default='inactive') - - call hist_addfld1d (fname='GDDPLANT', units='ddays', & - avgflag='A', long_name='Accumulated growing degree days past planting date for crop', & - ptr_pft=pps%gddplant, default='inactive') - - call hist_addfld1d (fname='GDDHARV', units='ddays', & - avgflag='A', long_name='Growing degree days (gdd) needed to harvest', & - ptr_pft=pps%gddmaturity, default='inactive') - - call hist_addfld1d (fname='GDDTSOI', units='ddays', & - avgflag='A', long_name='Growing degree-days from planting (top two soil layers)', & - ptr_pft=pps%gddtsoi, default='inactive') - - end if - - !------------------------------- - ! Column physical state variables not already defined by default - !------------------------------- - - call hist_addfld1d (fname='EMG', units='proportion', & - avgflag='A', long_name='ground emissivity', & - ptr_col=cps%emg, default='inactive') - - call hist_addfld1d (fname='Z0MG', units='m', & - avgflag='A', long_name='roughness length over ground, momentum', & - ptr_col=cps%z0mg, default='inactive') - - call hist_addfld1d (fname='Z0HG', units='m', & - avgflag='A', long_name='roughness length over ground, sensible heat', & - ptr_col=cps%z0hg, default='inactive') - - call hist_addfld1d (fname='Z0QG', units='m', & - avgflag='A', long_name='roughness length over ground, latent heat', & - ptr_col=cps%z0qg, default='inactive') - - call hist_addfld1d (fname='BETA', units='none', & - avgflag='A', long_name='coefficient of convective velocity', & - ptr_col=cps%beta, default='inactive') - - call hist_addfld1d (fname='ZII', units='m', & - avgflag='A', long_name='convective boundary height', & - ptr_col=cps%zii, default='inactive') - - call hist_addfld1d (fname='WF', units='proportion', & - avgflag='A', long_name='soil water as frac. of whc for top 0.5 m', & - ptr_col=cps%wf, default='inactive') - - call hist_addfld1d (fname='FPI', units='proportion', & - avgflag='A', long_name='fraction of potential immobilization', & - ptr_col=cps%fpi) - - call hist_addfld1d (fname='FPG', units='proportion', & - avgflag='A', long_name='fraction of potential gpp', & - ptr_col=cps%fpg) - - call hist_addfld1d (fname='ANNSUM_COUNTER', units='s', & - avgflag='A', long_name='seconds since last annual accumulator turnover', & - ptr_col=cps%annsum_counter, default='inactive') - - call hist_addfld1d (fname='CANNSUM_NPP', units='gC/m^2/s', & - avgflag='A', long_name='annual sum of column-level NPP', & - ptr_col=cps%cannsum_npp, default='inactive') - - call hist_addfld1d (fname='CANNAVG_T2M', units='K', & - avgflag='A', long_name='annual average of 2m air temperature', & - ptr_col=cps%cannavg_t2m, default='inactive') - - call hist_addfld2d (fname='FRAC_ICEOLD', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='fraction of ice relative to the tot water', & - ptr_col=cps%frac_iceold, default='inactive') - - call hist_addfld2d (fname='EFF_POROSITY', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective porosity = porosity - vol_ice', & - ptr_col=cps%eff_porosity, default='inactive') - - call hist_addfld2d (fname='ROOTR_COLUMN', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='effective fraction of roots in each soil layer', & - ptr_col=cps%rootr_column, default='inactive') - - call hist_addfld2d (fname='ALBGRD', units='proportion', type2d='numrad', & - avgflag='A', long_name='ground albedo (direct)', & - ptr_col=cps%albgrd, default='inactive') - - call hist_addfld2d (fname='ALBGRI', units='proportion', type2d='numrad', & - avgflag='A', long_name='ground albedo (indirect)', & - ptr_col=cps%albgri, default='inactive') - - call hist_addfld1d (fname='ME', units='proportion', & - avgflag='A', long_name='moisture of extinction', & - ptr_col=cps%me, default='inactive') - - call hist_addfld1d (fname='FIRE_PROB', units='0-1', & - avgflag='A', long_name='daily fire probability', & - ptr_col=cps%fire_prob, default='inactive') - - call hist_addfld1d (fname='MEAN_FIRE_PROB', units='0-1', & - avgflag='A', long_name='e-folding mean of daily fire probability', & - ptr_col=cps%mean_fire_prob) - - call hist_addfld1d (fname='FIRESEASONL', units='days', & - avgflag='A', long_name='annual fire season length', & - ptr_col=cps%fireseasonl) - - call hist_addfld1d (fname='FAREA_BURNED', units='proportion', & - avgflag='A', long_name='timestep fractional area burned', & - ptr_col=cps%farea_burned, default='inactive') - - call hist_addfld1d (fname='ANN_FAREA_BURNED', units='proportion', & - avgflag='A', long_name='annual total fractional area burned', & - ptr_col=cps%ann_farea_burned) - - !------------------------------- - ! Energy flux variables not already defined by default - native PFT - !------------------------------- - - call hist_addfld1d (fname='PARSUN', units='W/m^2', & - avgflag='A', long_name='average absorbed PAR for sunlit leaves', & - ptr_pft=pef%parsun, default='inactive') - - call hist_addfld1d (fname='PARSHA', units='W/m^2', & - avgflag='A', long_name='average absorbed PAR for shaded leaves', & - ptr_pft=pef%parsha, default='inactive') - - call hist_addfld1d (fname='DLRAD', units='W/m^2', & - avgflag='A', long_name='downward longwave radiation below the canopy', & - ptr_pft=pef%dlrad, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='ULRAD', units='W/m^2', & - avgflag='A', long_name='upward longwave radiation above the canopy', & - ptr_pft=pef%ulrad, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='EFLX_LH_TOT', units='W/m^2', & - avgflag='A', long_name='total latent heat flux [+ to atm]', & - ptr_pft=pef%eflx_lh_tot, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='EFLX_SOIL_GRND', units='W/m^2', & - avgflag='A', long_name='soil heat flux [+ into soil]', & - ptr_pft=pef%eflx_soil_grnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='CGRND', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil energy flux wrt to soil temp', & - ptr_pft=pef%cgrnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='CGRNDL', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil latent heat flux wrt soil temp', & - ptr_pft=pef%cgrndl, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='CGRNDS', units='W/m^2/K', & - avgflag='A', long_name='deriv. of soil sensible heat flux wrt soil temp', & - ptr_pft=pef%cgrnds, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='EFLX_GNET', units='W/m^2', & - avgflag='A', long_name='net heat flux into ground', & - ptr_pft=pef%eflx_gnet, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='DGNETDT', units='W/m^2/K', & - avgflag='A', long_name='derivative of net ground heat flux wrt soil temp', & - ptr_pft=pef%dgnetdT, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld2d (fname='SUN_ADD', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy absorbed direct from direct', & - ptr_pft=pef%sun_add, default='inactive') - - call hist_addfld2d (fname='TOT_AID', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='total canopy absorbed indirect from direct', & - ptr_pft=pef%tot_aid, default='inactive') - - call hist_addfld2d (fname='SUN_AID', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy absorbed indirect from direct', & - ptr_pft=pef%sun_aid, default='inactive') - - call hist_addfld2d (fname='SUN_AII', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy absorbed indirect from indirect', & - ptr_pft=pef%sun_aii, default='inactive') - - call hist_addfld2d (fname='SHA_AID', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='shade canopy absorbed indirect from direct', & - ptr_pft=pef%sha_aid, default='inactive') - - call hist_addfld2d (fname='SHA_AII', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='shade canopy absorbed indirect from indirect', & - ptr_pft=pef%sha_aii, default='inactive') - - call hist_addfld2d (fname='SUN_ATOT', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy total absorbed', & - ptr_pft=pef%sun_atot, default='inactive') - - call hist_addfld2d (fname='SHA_ATOT', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='shade canopy total absorbed', & - ptr_pft=pef%sha_atot, default='inactive') - - call hist_addfld2d (fname='SUN_ALF', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy total absorbed by leaves', & - ptr_pft=pef%sun_alf, default='inactive') - - call hist_addfld2d (fname='SHA_ALF', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='shade canopy total absored by leaves', & - ptr_pft=pef%sha_alf, default='inactive') - - call hist_addfld2d (fname='SUN_APERLAI', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='sun canopy total absorbed per unit LAI', & - ptr_pft=pef%sun_aperlai, default='inactive') - - call hist_addfld2d (fname='SHA_APERLAI', units='W/m^2', type2d='numrad', & - avgflag='A', long_name='shade canopy total absorbed per unit LAI', & - ptr_pft=pef%sha_aperlai, default='inactive') - - !------------------------------- - ! Water flux variables not already defined by default - native PFT - !------------------------------- - - call hist_addfld1d (fname='QFLX_RAIN_GRND', units='mm H2O/s', & - avgflag='A', long_name='rain on ground after interception', & - ptr_pft=pwf%qflx_rain_grnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_SNOW_GRND', units='mm H2O/s', & - avgflag='A', long_name='snow on ground after interception', & - ptr_pft=pwf%qflx_snow_grnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_EVAP_GRND', units='mm H2O/s', & - avgflag='A', long_name='ground surface evaporation', & - ptr_pft=pwf%qflx_evap_grnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_EVAP_VEG', units='mm H2O/s', & - avgflag='A', long_name='vegetation evaporation', & - ptr_pft=pwf%qflx_evap_veg, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_EVAP_TOT', units='mm H2O/s', & - avgflag='A', long_name='qflx_evap_soi + qflx_evap_can + qflx_tran_veg', & - ptr_pft=pwf%qflx_evap_tot, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_DEW_GRND', units='mm H2O/s', & - avgflag='A', long_name='ground surface dew formation', & - ptr_pft=pwf%qflx_dew_grnd, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_SUB_SNOW', units='mm H2O/s', & - avgflag='A', long_name='sublimation rate from snow pack', & - ptr_pft=pwf%qflx_sub_snow, default='inactive', c2l_scale_type='urbanf') - - call hist_addfld1d (fname='QFLX_DEW_SNOW', units='mm H2O/s', & - avgflag='A', long_name='surface dew added to snow pacK', & - ptr_pft=pwf%qflx_dew_snow, default='inactive', c2l_scale_type='urbanf') - - end if - - call hist_addfld1d (fname='SNORDSL', units='m^-6', & - avgflag='A', long_name='top snow layer effective grain radius', & - ptr_col=cps%snw_rds_top, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='SNOTTOPL', units='K/m', & - avgflag='A', long_name='snow temperature (top layer)', & - ptr_col=cps%snot_top, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='SNOdTdzL', units='K/m', & - avgflag='A', long_name='top snow layer temperature gradient (land)', & - ptr_col=cps%dTdz_top, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='SNOLIQFL', units='fraction', & - avgflag='A', long_name='top snow layer liquid water fraction (land)', & - ptr_col=cps%sno_liq_top, set_lake=spval, set_urb=spval, & - default='inactive') - - call hist_addfld1d (fname='SNOFSRVD', units='W/m^2', & - avgflag='A', long_name='direct vis reflected solar radiation from snow', & - ptr_pft=pef%fsr_sno_vd, & - default='inactive') - - call hist_addfld1d (fname='SNOFSRND', units='W/m^2', & - avgflag='A', long_name='direct nir reflected solar radiation from snow', & - ptr_pft=pef%fsr_sno_nd, & - default='inactive') - - call hist_addfld1d (fname='SNOFSRVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis reflected solar radiation from snow', & - ptr_pft=pef%fsr_sno_vi, & - default='inactive') - - call hist_addfld1d (fname='SNOFSRNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir reflected solar radiation from snow', & - ptr_pft=pef%fsr_sno_ni, & - default='inactive') - - call hist_addfld1d (fname='SNOFSDSVD', units='W/m^2', & - avgflag='A', long_name='direct vis incident solar radiation on snow', & - ptr_pft=pef%fsds_sno_vd, & - default='inactive') - - call hist_addfld1d (fname='SNOFSDSND', units='W/m^2', & - avgflag='A', long_name='direct nir incident solar radiation on snow', & - ptr_pft=pef%fsds_sno_nd, & - default='inactive') - - call hist_addfld1d (fname='SNOFSDSVI', units='W/m^2', & - avgflag='A', long_name='diffuse vis incident solar radiation on snow', & - ptr_pft=pef%fsds_sno_vi, & - default='inactive') - - call hist_addfld1d (fname='SNOFSDSNI', units='W/m^2', & - avgflag='A', long_name='diffuse nir incident solar radiation on snow', & - ptr_pft=pef%fsds_sno_ni, & - default='inactive') - - call hist_addfld1d (fname='H2OSNO_TOP', units='kg/m2', & - avgflag='A', long_name='mass of snow in top snow layer', & - ptr_col=cps%h2osno_top, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOBCMCL', units='kg/m2', & - avgflag='A', long_name='mass of BC in snow column', & - ptr_col=cps%mss_bc_col, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOBCMSL', units='kg/m2', & - avgflag='A', long_name='mass of BC in top snow layer', & - ptr_col=cps%mss_bc_top, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOOCMCL', units='kg/m2', & - avgflag='A', long_name='mass of OC in snow column', & - ptr_col=cps%mss_oc_col, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOOCMSL', units='kg/m2', & - avgflag='A', long_name='mass of OC in top snow layer', & - ptr_col=cps%mss_oc_top, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNODSTMCL', units='kg/m2', & - avgflag='A', long_name='mass of dust in snow column', & - ptr_col=cps%mss_dst_col, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNODSTMSL', units='kg/m2', & - avgflag='A', long_name='mass of dust in top snow layer', & - ptr_col=cps%mss_dst_top, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='DSTDEP', units='kg/m^2/s', & - avgflag='A', long_name='total dust deposition (dry+wet) from atmosphere', & - ptr_col=cwf%flx_dst_dep, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='BCDEP', units='kg/m^2/s', & - avgflag='A', long_name='total BC deposition (dry+wet) from atmosphere', & - ptr_col=cwf%flx_bc_dep, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='OCDEP', units='kg/m^2/s', & - avgflag='A', long_name='total OC deposition (dry+wet) from atmosphere', & - ptr_col=cwf%flx_oc_dep, set_lake=spval, set_urb=spval) - - if (use_snicar_frc) then - call hist_addfld1d (fname='SNOAERFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of all aerosols in snow (land) ', & - ptr_pft=pef%sfc_frc_aer, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOAERFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of all aerosols in snow, averaged only when snow is present (land)', & - ptr_pft=pef%sfc_frc_aer_sno, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOBCFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of BC in snow (land) ', & - ptr_pft=pef%sfc_frc_bc, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOBCFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of BC in snow, averaged only when snow is present (land)', & - ptr_pft=pef%sfc_frc_bc_sno, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOOCFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of OC in snow (land) ', & - ptr_pft=pef%sfc_frc_oc, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNOOCFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of OC in snow, averaged only when snow is present (land)', & - ptr_pft=pef%sfc_frc_oc_sno, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNODSTFRCL', units='W/m^2', & - avgflag='A', long_name='surface forcing of dust in snow (land) ', & - ptr_pft=pef%sfc_frc_dst, set_lake=spval, set_urb=spval) - - call hist_addfld1d (fname='SNODSTFRC2L', units='W/m^2', & - avgflag='A', long_name='surface forcing of dust in snow, averaged only when snow is present (land)', & - ptr_pft=pef%sfc_frc_dst_sno, set_lake=spval, set_urb=spval) - end if - - !------------------------------- - ! Forcings sent to GLC - !------------------------------- - - if (maxpatch_glcmec > 0) then - - call hist_addfld2d (fname='QICE_FORC', units='mm/s', type2d='glc_nec', & - avgflag='A', long_name='qice forcing sent to GLC', & - ptr_lnd=clm_s2x%qice, default='inactive') - - call hist_addfld2d (fname='TSRF_FORC', units='K', type2d='glc_nec', & - avgflag='A', long_name='surface temperature sent to GLC', & - ptr_lnd=clm_s2x%tsrf, default='inactive') - - call hist_addfld2d (fname='TOPO_FORC', units='m', type2d='glc_nec', & - avgflag='A', long_name='topographic height sent to GLC', & - ptr_lnd=clm_s2x%topo, default='inactive') - - end if - - ! Print masterlist of history fields - - call hist_printflds() - - end subroutine hist_initFlds - -end module histFldsMod diff --git a/src_clm40/main/iniTimeConst.F90 b/src_clm40/main/iniTimeConst.F90 deleted file mode 100644 index 73f2f170d5..0000000000 --- a/src_clm40/main/iniTimeConst.F90 +++ /dev/null @@ -1,828 +0,0 @@ -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: iniTimeConst -! -! !INTERFACE: -subroutine iniTimeConst -! -! !DESCRIPTION: -! Initialize time invariant clm variables -! 1) removed references to shallow lake - since it is not used -! 2) ***Make z, zi and dz allocatable depending on if you -! have lake or soil -! 3) rootfr only initialized for soil points -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use decompMod , only : get_proc_bounds, get_proc_global - use decompMod , only : gsMap_lnd_gdc2glo - use clm_atmlnd , only : clm_a2l - use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, numpft, numrad, nlevurb - use clm_varcon , only : istice, istdlak, istwet, isturb, istice_mec, & - icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv, & - zlak, dzlak, zsoi, dzsoi, zisoi, spval, & - albsat, albdry, secspday - use clm_varctl , only : fsurdat,scmlon,scmlat,single_column, iulog, use_cn, use_cndv - use pftvarcon , only : noveg, ntree, roota_par, rootb_par, & - smpso, smpsc, fnitr, nbrdlf_dcd_brl_shrub, & - z0mr, displar, dleaf, rhol, rhos, taul, taus, xl, & - qe25, mp, c3psn, slatop, dsladlai, leafcn, flnr, woody, & - lflitcn, frootcn, livewdcn, deadwdcn, froot_leaf, stem_leaf, croot_stem, & - flivewd, fcur, lf_flab, lf_fcel, lf_flig, fr_flab, fr_fcel, fr_flig, & - leaf_long, evergreen, stress_decid, season_decid, & - resist, pftpar20, pftpar28, pftpar29, pftpar30, pftpar31, & - allom1s, allom2s, & - allom1 , allom2 , allom3 , reinickerp, dwood - use pftvarcon , only : graincn - use clm_time_manager, only : get_step_size - use abortutils , only : endrun - use fileutils , only : getfil - use organicFileMod , only : organicrd - use spmdMod , only : mpicom, MPI_INTEGER, masterproc - use clm_varctl , only : fsnowoptics, fsnowaging - use SNICARMod , only : SnowAge_init, SnowOptics_init - use shr_scam_mod , only : shr_scam_getCloseLatLon - use ncdio_pio , only : file_desc_t, ncd_io, ncd_pio_openfile, ncd_pio_closefile - -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize in module initializeMod. -! -! !REVISION HISTORY: -! Created by Gordon Bonan. -! Updated to clm2.1 data structrues by Mariana Vertenstein -! 4/26/05, Peter Thornton: Eliminated exponential decrease in saturated hydraulic -! conductivity (hksat) with depth. -! Updated: Colette L. Heald (05/06) reading in VOC emission factors -! 27 February 2008: Keith Oleson; Qing Liu (2004) saturated hydraulic conductivity -! and matric potential -! 29 February 2008: David Lawrence; modified soil thermal and hydraulic properties to -! account for organic matter -! 18 March 2008: David Lawrence; nlevgrnd changes -! 03/28/08 Mark Flanner, read in netcdf files for SNICAR parameters -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: ivt(:) ! vegetation type index - integer , pointer :: pcolumn(:) ! column index of corresponding pft - integer , pointer :: pgridcell(:) ! gridcell index of corresponding pft - integer , pointer :: clandunit(:) ! landunit index of column - integer , pointer :: cgridcell(:) ! gridcell index of column - integer , pointer :: ctype(:) ! column type index - integer , pointer :: ltype(:) ! landunit type index - real(r8), pointer :: thick_wall(:) ! total thickness of urban wall - real(r8), pointer :: thick_roof(:) ! total thickness of urban roof - real(r8), pointer :: lat(:) ! gridcell latitude (radians) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: z(:,:) ! layer depth (m) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) - real(r8), pointer :: rootfr(:,:) ! fraction of roots in each soil layer - real(r8), pointer :: rootfr_road_perv(:,:) ! fraction of roots in each soil layer for urban pervious road - real(r8), pointer :: rresis(:,:) !root resistance by layer (0-1) (nlevgrnd) - real(r8), pointer :: dewmx(:) ! maximum allowed dew [mm] - real(r8), pointer :: bsw(:,:) ! Clapp and Hornberger "b" (nlevgrnd) - real(r8), pointer :: bsw2(:,:) ! Clapp and Hornberger "b" for CN code - real(r8), pointer :: psisat(:,:) ! soil water potential at saturation for CN code (MPa) - real(r8), pointer :: vwcsat(:,:) ! volumetric water content at saturation for CN code (m3/m3) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) (nlevgrnd) - real(r8), pointer :: watfc(:,:) ! volumetric soil water at field capacity (nlevsoi) - real(r8), pointer :: watdry(:,:) ! btran parameter for btran=0 - real(r8), pointer :: watopt(:,:) ! btran parameter for btran = 1 - real(r8), pointer :: hksat(:,:) ! hydraulic conductivity at saturation (mm H2O /s) (nlevgrnd) - real(r8), pointer :: sucsat(:,:) ! minimum soil suction (mm) (nlevgrnd) - real(r8), pointer :: csol(:,:) ! heat capacity, soil solids (J/m**3/Kelvin) (nlevgrnd) - real(r8), pointer :: tkmg(:,:) ! thermal conductivity, soil minerals [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: tkdry(:,:) ! thermal conductivity, dry soil (W/m/Kelvin) (nlevgrnd) - real(r8), pointer :: tksatu(:,:) ! thermal conductivity, saturated soil [W/m-K] (new) (nlevgrnd) - real(r8), pointer :: wtfact(:) ! maximum saturated fraction for a gridcell - real(r8), pointer :: smpmin(:) ! restriction for min of soil potential (mm) (new) - real(r8), pointer :: hkdepth(:) ! decay factor (m) - integer , pointer :: isoicol(:) ! soil color class - real(r8), pointer :: gwc_thr(:) ! threshold soil moisture based on clay content - real(r8), pointer :: mss_frc_cly_vld(:) ! [frc] Mass fraction clay limited to 0.20 - real(r8), pointer :: efisop(:,:) ! emission factors for isoprene (ug isoprene m-2 h-1) - real(r8), pointer :: max_dayl(:) ! maximum daylength (s) - real(r8), pointer :: sandfrac(:) - real(r8), pointer :: clayfrac(:) -! -! -! !OTHER LOCAL VARIABLES: -!EOP - type(file_desc_t) :: ncid ! netcdf id - integer :: n,j,ib,lev,bottom! indices - integer :: g,l,c,p ! indices - integer :: m ! vegetation type index - real(r8) :: bd ! bulk density of dry soil material [kg/m^3] - real(r8) :: tkm ! mineral conductivity - real(r8) :: xksat ! maximum hydraulic conductivity of soil [mm/s] - real(r8) :: scalez = 0.025_r8 ! Soil layer thickness discretization (m) - real(r8) :: clay,sand ! temporaries - real(r8) :: slope,intercept ! temporary, for rooting distribution - real(r8) :: temp, max_decl ! temporary, for calculation of max_dayl - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - - real(r8),pointer :: temp_ef(:) ! read in - temporary EFs - real(r8),pointer :: efisop2d(:,:) ! read in - isoprene emission factors - - real(r8),pointer :: arrayl(:) ! generic global array - integer ,pointer :: irrayg(:) ! generic global array - integer ,pointer :: soic2d(:) ! read in - soil color - real(r8),pointer :: sand3d(:,:) ! read in - soil texture: percent sand - real(r8),pointer :: clay3d(:,:) ! read in - soil texture: percent clay - real(r8),pointer :: organic3d(:,:) ! read in - organic matter: kg/m3 - real(r8),pointer :: gti(:) ! read in - fmax - real(r8) :: om_frac ! organic matter fraction - real(r8) :: om_watsat = 0.9_r8 ! porosity of organic soil - real(r8) :: om_hksat = 0.1_r8 ! saturated hydraulic conductivity of organic soil [mm/s] - real(r8) :: om_tkm = 0.25_r8 ! thermal conductivity of organic soil (Farouki, 1986) [W/m/K] - real(r8) :: om_sucsat = 10.3_r8 ! saturated suction for organic matter (Letts, 2000) - real(r8) :: om_csol = 2.5_r8 ! heat capacity of peat soil *10^6 (J/K m3) (Farouki, 1986) - real(r8) :: om_tkd = 0.05_r8 ! thermal conductivity of dry organic soil (Farouki, 1981) - real(r8) :: om_b = 2.7_r8 ! Clapp Hornberger paramater for oragnic soil (Letts, 2000) - real(r8) :: organic_max = 130._r8 ! organic matter (kg/m3) where soil is assumed to act like peat - real(r8) :: csol_bedrock = 2.0e6_r8 ! vol. heat capacity of granite/sandstone J/(m3 K)(Shabbir, 2000) - real(r8) :: pc = 0.5_r8 ! percolation threshold - real(r8) :: pcbeta = 0.139_r8 ! percolation exponent - real(r8) :: perc_frac ! "percolating" fraction of organic soil - real(r8) :: perc_norm ! normalize to 1 when 100% organic soil - real(r8) :: uncon_hksat ! series conductivity of mineral/organic soil - real(r8) :: uncon_frac ! fraction of "unconnected" soil - integer :: varid ! netCDF id's - integer :: ret - - integer :: ier ! error status - character(len=256) :: locfn ! local filename - character(len= 32) :: subname = 'iniTimeConst' ! subroutine name - integer :: mxsoil_color ! maximum number of soil color classes - real(r8), allocatable :: zurb_wall(:,:) ! wall (layer node depth) - real(r8), allocatable :: zurb_roof(:,:) ! roof (layer node depth) - real(r8), allocatable :: dzurb_wall(:,:) ! wall (layer thickness) - real(r8), allocatable :: dzurb_roof(:,:) ! roof (layer thickness) - real(r8), allocatable :: ziurb_wall(:,:) ! wall (layer interface) - real(r8), allocatable :: ziurb_roof(:,:) ! roof (layer interface) - logical :: readvar -!------------------------------------------------------------------------ - - integer :: closelatidx,closelonidx - real(r8):: closelat,closelon - integer :: iostat - -!------------------------------------------------------------------------ - - if (masterproc) write(iulog,*) 'Attempting to initialize time invariant variables' - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - call get_proc_global(numg, numl, numc, nump) - - allocate(soic2d(begg:endg), gti(begg:endg)) - allocate(sand3d(begg:endg,nlevsoi), clay3d(begg:endg,nlevsoi)) - allocate(organic3d(begg:endg,nlevsoi)) - - allocate(temp_ef(begg:endg),efisop2d(6,begg:endg)) - - efisop => gve%efisop - - ! Assign local pointers to derived subtypes components (gridcell-level) - lat => grc%lat - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - thick_wall => lps%thick_wall - thick_roof => lps%thick_roof - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - clandunit => col%landunit - cgridcell => col%gridcell - z => cps%z - dz => cps%dz - zi => cps%zi - bsw => cps%bsw - bsw2 => cps%bsw2 - psisat => cps%psisat - vwcsat => cps%vwcsat - watsat => cps%watsat - watfc => cps%watfc - watdry => cps%watdry - watopt => cps%watopt - rootfr_road_perv => cps%rootfr_road_perv - hksat => cps%hksat - sucsat => cps%sucsat - tkmg => cps%tkmg - tksatu => cps%tksatu - tkdry => cps%tkdry - csol => cps%csol - smpmin => cps%smpmin - hkdepth => cps%hkdepth - wtfact => cps%wtfact - isoicol => cps%isoicol - gwc_thr => cps%gwc_thr - mss_frc_cly_vld => cps%mss_frc_cly_vld - max_dayl => cps%max_dayl - - ! Assign local pointers to derived subtypes components (pft-level) - - ivt => pft%itype - pgridcell => pft%gridcell - pcolumn => pft%column - dewmx => pps%dewmx - rootfr => pps%rootfr - rresis => pps%rresis - sandfrac => pps%sandfrac - clayfrac => pps%clayfrac - - allocate(zurb_wall(begl:endl,nlevurb), & - zurb_roof(begl:endl,nlevurb), & - dzurb_wall(begl:endl,nlevurb), & - dzurb_roof(begl:endl,nlevurb), & - ziurb_wall(begl:endl,0:nlevurb), & - ziurb_roof(begl:endl,0:nlevurb), & - stat=ier) - if (ier /= 0) then - call endrun( 'iniTimeConst: allocation error for zurb_wall,zurb_roof,dzurb_wall,dzurb_roof,ziurb_wall,ziurb_roof' ) - end if - - ! -------------------------------------------------------------------- - ! Read soil color, sand and clay from surface dataset - ! -------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to read soil color, sand and clay boundary data .....' - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! Determine number of soil color classes - if number of soil color classes is not - ! on input dataset set it to 8 - - if (single_column) then - call shr_scam_getCloseLatLon(locfn,scmlat,scmlon,closelat,closelon,closelatidx,closelonidx) - end if - call ncd_io(ncid=ncid, varname='mxsoil_color', flag='read', data=mxsoil_color, & - readvar=readvar) - if ( .not. readvar ) mxsoil_color = 8 - - ! Read fmax - - call ncd_io(ncid=ncid, varname='FMAX', flag='read', data=gti, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: FMAX NOT on surfdata file') - - ! Read in soil color, sand and clay fraction - - call ncd_io(ncid=ncid, varname='SOIL_COLOR', flag='read', data=soic2d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: SOIL_COLOR NOT on surfdata file' ) - - ! Read in emission factors - - call ncd_io(ncid=ncid, varname='EF1_BTR', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_BTR') - efisop2d(1,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='EF1_FET', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_FET') - efisop2d(2,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='EF1_FDT', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_FDT') - efisop2d(3,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='EF1_SHR', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_SHR') - efisop2d(4,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='EF1_GRS', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_GRS') - efisop2d(5,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='EF1_CRP', flag='read', data=temp_ef, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('iniTimeConst: errror reading EF1_CRP') - efisop2d(6,:)=temp_ef(:) - - call ncd_io(ncid=ncid, varname='PCT_SAND', flag='read', data=sand3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_SAND NOT on surfdata file' ) - - call ncd_io(ncid=ncid, varname='PCT_CLAY', flag='read', data=clay3d, dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_CLAY NOT on surfdata file' ) - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' - write(iulog,*) - endif - - ! Determine saturated and dry soil albedos for n color classes and - ! numrad wavebands (1=vis, 2=nir) - - allocate(albsat(mxsoil_color,numrad), albdry(mxsoil_color,numrad), stat=ier) - if (ier /= 0) then - write(iulog,*)'iniTimeConst: allocation error for albsat, albdry' - call endrun() - end if - - if (mxsoil_color == 8) then - albsat(1:8,1) = (/0.12_r8,0.11_r8,0.10_r8,0.09_r8,0.08_r8,0.07_r8,0.06_r8,0.05_r8/) - albsat(1:8,2) = (/0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8/) - albdry(1:8,1) = (/0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8/) - albdry(1:8,2) = (/0.48_r8,0.44_r8,0.40_r8,0.36_r8,0.32_r8,0.28_r8,0.24_r8,0.20_r8/) - else if (mxsoil_color == 20) then - albsat(1:20,1) = (/0.25_r8,0.23_r8,0.21_r8,0.20_r8,0.19_r8,0.18_r8,0.17_r8,0.16_r8,& - 0.15_r8,0.14_r8,0.13_r8,0.12_r8,0.11_r8,0.10_r8,0.09_r8,0.08_r8,0.07_r8,0.06_r8,0.05_r8,0.04_r8/) - albsat(1:20,2) = (/0.50_r8,0.46_r8,0.42_r8,0.40_r8,0.38_r8,0.36_r8,0.34_r8,0.32_r8,& - 0.30_r8,0.28_r8,0.26_r8,0.24_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8,0.08_r8/) - albdry(1:20,1) = (/0.36_r8,0.34_r8,0.32_r8,0.31_r8,0.30_r8,0.29_r8,0.28_r8,0.27_r8,& - 0.26_r8,0.25_r8,0.24_r8,0.23_r8,0.22_r8,0.20_r8,0.18_r8,0.16_r8,0.14_r8,0.12_r8,0.10_r8,0.08_r8/) - albdry(1:20,2) = (/0.61_r8,0.57_r8,0.53_r8,0.51_r8,0.49_r8,0.48_r8,0.45_r8,0.43_r8,& - 0.41_r8,0.39_r8,0.37_r8,0.35_r8,0.33_r8,0.31_r8,0.29_r8,0.27_r8,0.25_r8,0.23_r8,0.21_r8,0.16_r8/) - else - write(iulog,*)'maximum color class = ',mxsoil_color,' is not supported' - call endrun - end if - - do p = begp,endp - g = pgridcell(p) - sandfrac(p) = sand3d(g,1)/100.0_r8 - clayfrac(p) = clay3d(g,1)/100.0_r8 - end do - - ! -------------------------------------------------------------------- - ! If a organic matter dataset has been specified, read it - ! -------------------------------------------------------------------- - - call organicrd(organic3d) - - ! -------------------------------------------------------------------- - ! Initialize time constant arrays of ecophysiological constants and - ! arrays of dgvm ecophysiological constants - ! -------------------------------------------------------------------- - - do m = 0,numpft - if (m <= ntree) then - pftcon%tree(m) = 1 - else - pftcon%tree(m) = 0 - end if - pftcon%z0mr(m) = z0mr(m) - pftcon%displar(m) = displar(m) - pftcon%dleaf(m) = dleaf(m) - pftcon%xl(m) = xl(m) - do ib = 1,numrad - pftcon%rhol(m,ib) = rhol(m,ib) - pftcon%rhos(m,ib) = rhos(m,ib) - pftcon%taul(m,ib) = taul(m,ib) - pftcon%taus(m,ib) = taus(m,ib) - end do - pftcon%qe25(m) = qe25(m) - pftcon%mp(m) = mp(m) - pftcon%c3psn(m) = c3psn(m) - pftcon%slatop(m) = slatop(m) - pftcon%dsladlai(m) = dsladlai(m) - pftcon%leafcn(m) = leafcn(m) - pftcon%flnr(m) = flnr(m) - pftcon%smpso(m) = smpso(m) - pftcon%smpsc(m) = smpsc(m) - pftcon%fnitr(m) = fnitr(m) - pftcon%woody(m) = woody(m) - pftcon%lflitcn(m) = lflitcn(m) - pftcon%frootcn(m) = frootcn(m) - pftcon%livewdcn(m) = livewdcn(m) - pftcon%deadwdcn(m) = deadwdcn(m) - pftcon%graincn(m) = graincn(m) - pftcon%froot_leaf(m) = froot_leaf(m) - pftcon%stem_leaf(m) = stem_leaf(m) - pftcon%croot_stem(m) = croot_stem(m) - pftcon%flivewd(m) = flivewd(m) - pftcon%fcur(m) = fcur(m) - pftcon%lf_flab(m) = lf_flab(m) - pftcon%lf_fcel(m) = lf_fcel(m) - pftcon%lf_flig(m) = lf_flig(m) - pftcon%fr_flab(m) = fr_flab(m) - pftcon%fr_fcel(m) = fr_fcel(m) - pftcon%fr_flig(m) = fr_flig(m) - pftcon%leaf_long(m) = leaf_long(m) - pftcon%evergreen(m) = evergreen(m) - pftcon%stress_decid(m) = stress_decid(m) - pftcon%season_decid(m) = season_decid(m) - pftcon%resist(m) = resist(m) - pftcon%dwood(m) = dwood - end do - - if (use_cndv) then - do m = 0,numpft - dgv_pftcon%crownarea_max(m) = pftpar20(m) - dgv_pftcon%tcmin(m) = pftpar28(m) - dgv_pftcon%tcmax(m) = pftpar29(m) - dgv_pftcon%gddmin(m) = pftpar30(m) - dgv_pftcon%twmax(m) = pftpar31(m) - dgv_pftcon%reinickerp(m) = reinickerp - dgv_pftcon%allom1(m) = allom1 - dgv_pftcon%allom2(m) = allom2 - dgv_pftcon%allom3(m) = allom3 - ! modification for shrubs by X.D.Z - if (m > ntree .and. m <= nbrdlf_dcd_brl_shrub ) then - dgv_pftcon%allom1(m) = allom1s - dgv_pftcon%allom2(m) = allom2s - end if - end do - end if - - ! -------------------------------------------------------------------- - ! Define layer structure for soil, lakes, urban walls and roof - ! Vertical profile of snow is not initialized here - ! -------------------------------------------------------------------- - - ! Lake layers (assumed same for all lake patches) - - dzlak(1) = 0.1_r8 - dzlak(2) = 1._r8 - dzlak(3) = 2._r8 - dzlak(4) = 3._r8 - dzlak(5) = 4._r8 - dzlak(6) = 5._r8 - dzlak(7) = 7._r8 - dzlak(8) = 7._r8 - dzlak(9) = 10.45_r8 - dzlak(10)= 10.45_r8 - - zlak(1) = 0.05_r8 - zlak(2) = 0.6_r8 - zlak(3) = 2.1_r8 - zlak(4) = 4.6_r8 - zlak(5) = 8.1_r8 - zlak(6) = 12.6_r8 - zlak(7) = 18.6_r8 - zlak(8) = 25.6_r8 - zlak(9) = 34.325_r8 - zlak(10)= 44.775_r8 - - ! Soil layers and interfaces (assumed same for all non-lake patches) - ! "0" refers to soil surface and "nlevsoi" refers to the bottom of model soil - - do j = 1, nlevgrnd - zsoi(j) = scalez*(exp(0.5_r8*(j-0.5_r8))-1._r8) !node depths - enddo - - dzsoi(1) = 0.5_r8*(zsoi(1)+zsoi(2)) !thickness b/n two interfaces - do j = 2,nlevgrnd-1 - dzsoi(j)= 0.5_r8*(zsoi(j+1)-zsoi(j-1)) - enddo - dzsoi(nlevgrnd) = zsoi(nlevgrnd)-zsoi(nlevgrnd-1) - - zisoi(0) = 0._r8 - do j = 1, nlevgrnd-1 - zisoi(j) = 0.5_r8*(zsoi(j)+zsoi(j+1)) !interface depths - enddo - zisoi(nlevgrnd) = zsoi(nlevgrnd) + 0.5_r8*dzsoi(nlevgrnd) - - ! Column level initialization for urban wall and roof layers and interfaces - do l = begl, endl - - ! "0" refers to urban wall/roof surface and "nlevsoi" refers to urban wall/roof bottom - if (ltype(l)==isturb) then - - do j = 1, nlevurb - zurb_wall(l,j) = (j-0.5)*(thick_wall(l)/float(nlevurb)) !node depths - end do - do j = 1, nlevurb - zurb_roof(l,j) = (j-0.5)*(thick_roof(l)/float(nlevurb)) !node depths - end do - - dzurb_wall(l,1) = 0.5*(zurb_wall(l,1)+zurb_wall(l,2)) !thickness b/n two interfaces - do j = 2,nlevurb-1 - dzurb_wall(l,j)= 0.5*(zurb_wall(l,j+1)-zurb_wall(l,j-1)) - enddo - dzurb_wall(l,nlevurb) = zurb_wall(l,nlevurb)-zurb_wall(l,nlevurb-1) - - dzurb_roof(l,1) = 0.5*(zurb_roof(l,1)+zurb_roof(l,2)) !thickness b/n two interfaces - do j = 2,nlevurb-1 - dzurb_roof(l,j)= 0.5*(zurb_roof(l,j+1)-zurb_roof(l,j-1)) - enddo - dzurb_roof(l,nlevurb) = zurb_roof(l,nlevurb)-zurb_roof(l,nlevurb-1) - - ziurb_wall(l,0) = 0. - do j = 1, nlevurb-1 - ziurb_wall(l,j) = 0.5*(zurb_wall(l,j)+zurb_wall(l,j+1)) !interface depths - enddo - ziurb_wall(l,nlevurb) = zurb_wall(l,nlevurb) + 0.5*dzurb_wall(l,nlevurb) - - ziurb_roof(l,0) = 0. - do j = 1, nlevurb-1 - ziurb_roof(l,j) = 0.5*(zurb_roof(l,j)+zurb_roof(l,j+1)) !interface depths - enddo - ziurb_roof(l,nlevurb) = zurb_roof(l,nlevurb) + 0.5*dzurb_roof(l,nlevurb) - end if - end do - - ! Grid level initialization - do g = begg, endg - - ! VOC emission factors - ! Set gridcell and landunit indices - efisop(:,g)=efisop2d(:,g) - - end do - - - ! -------------------------------------------------------------------- - ! Initialize soil and lake levels - ! Initialize soil color, thermal and hydraulic properties - ! -------------------------------------------------------------------- - - ! Column level initialization - do c = begc, endc - - ! Set gridcell and landunit indices - g = cgridcell(c) - l = clandunit(c) - - ! initialize maximum daylength, based on latitude and maximum declination - ! maximum declination hardwired for present-day orbital parameters, - ! +/- 23.4667 degrees = +/- 0.409571 radians, use negative value for S. Hem - max_decl = 0.409571 - if (lat(g) .lt. 0._r8) max_decl = -max_decl - temp = -(sin(lat(g))*sin(max_decl))/(cos(lat(g)) * cos(max_decl)) - temp = min(1._r8,max(-1._r8,temp)) - max_dayl(c) = 2.0_r8 * 13750.9871_r8 * acos(temp) - - ! Initialize restriction for min of soil potential (mm) - smpmin(c) = -1.e8_r8 - - ! Decay factor (m) - hkdepth(c) = 1._r8/2.5_r8 - - ! Maximum saturated fraction - wtfact(c) = gti(g) - - ! Soil color - isoicol(c) = soic2d(g) - - ! Soil hydraulic and thermal properties - ! Note that urban roof, sunwall and shadewall thermal properties used to - ! derive thermal conductivity and heat capacity are set to special - ! value because thermal conductivity and heat capacity for urban - ! roof, sunwall and shadewall are prescribed in SoilThermProp.F90 in - ! SoilTemperatureMod.F90 - if (ltype(l)==istdlak .or. ltype(l)==istwet .or. ltype(l)==istice .or. ltype(l)==istice_mec) then - do lev = 1,nlevgrnd - bsw(c,lev) = spval - bsw2(c,lev) = spval - psisat(c,lev) = spval - vwcsat(c,lev) = spval - watsat(c,lev) = spval - watfc(c,lev) = spval - hksat(c,lev) = spval - sucsat(c,lev) = spval - tkmg(c,lev) = spval - tksatu(c,lev) = spval - tkdry(c,lev) = spval - if (ltype(l)==istwet .and. lev > nlevsoi) then - csol(c,lev) = csol_bedrock - else - csol(c,lev)= spval - endif - watdry(c,lev) = spval - watopt(c,lev) = spval - end do - else if (ltype(l)==isturb .and. (ctype(c) /= icol_road_perv) .and. (ctype(c) /= icol_road_imperv) )then - ! Urban Roof, sunwall, shadewall properties set to special value - do lev = 1,nlevurb - watsat(c,lev) = spval - watfc(c,lev) = spval - bsw(c,lev) = spval - bsw2(c,lev) = spval - psisat(c,lev) = spval - vwcsat(c,lev) = spval - hksat(c,lev) = spval - sucsat(c,lev) = spval - tkmg(c,lev) = spval - tksatu(c,lev) = spval - tkdry(c,lev) = spval - csol(c,lev) = spval - watdry(c,lev) = spval - watopt(c,lev) = spval - end do - else ! soil columns of both urban and non-urban types - do lev = 1,nlevgrnd - ! duplicate clay and sand values from 10th soil layer - if (lev .le. nlevsoi) then - clay = clay3d(g,lev) - sand = sand3d(g,lev) - om_frac = (organic3d(g,lev)/organic_max)**2._r8 - else - clay = clay3d(g,nlevsoi) - sand = sand3d(g,nlevsoi) - om_frac = 0._r8 - endif - ! No organic matter for urban - if (ltype(l)==isturb) then - om_frac = 0._r8 - end if - ! Note that the following properties are overwritten for urban impervious road - ! layers that are not soil in SoilThermProp.F90 within SoilTemperatureMod.F90 - watsat(c,lev) = 0.489_r8 - 0.00126_r8*sand - bsw(c,lev) = 2.91 + 0.159*clay - sucsat(c,lev) = 10._r8 * ( 10._r8**(1.88_r8-0.0131_r8*sand) ) - bd = (1._r8-watsat(c,lev))*2.7e3_r8 - watsat(c,lev) = (1._r8 - om_frac)*watsat(c,lev) + om_watsat*om_frac - tkm = (1._r8-om_frac)*(8.80_r8*sand+2.92_r8*clay)/(sand+clay)+om_tkm*om_frac ! W/(m K) - bsw(c,lev) = (1._r8-om_frac)*(2.91_r8 + 0.159_r8*clay) + om_frac*om_b - bsw2(c,lev) = -(3.10_r8 + 0.157_r8*clay - 0.003_r8*sand) - psisat(c,lev) = -(exp((1.54_r8 - 0.0095_r8*sand + 0.0063_r8*(100.0_r8-sand-clay))*log(10.0_r8))*9.8e-5_r8) - vwcsat(c,lev) = (50.5_r8 - 0.142_r8*sand - 0.037_r8*clay)/100.0_r8 - sucsat(c,lev) = (1._r8-om_frac)*sucsat(c,lev) + om_sucsat*om_frac - xksat = 0.0070556 *( 10.**(-0.884+0.0153*sand) ) ! mm/s - - ! perc_frac is zero unless perf_frac greater than percolation threshold - if (om_frac > pc) then - perc_norm=(1._r8 - pc)**(-pcbeta) - perc_frac=perc_norm*(om_frac - pc)**pcbeta - else - perc_frac=0._r8 - endif - ! uncon_frac is fraction of mineral soil plus fraction of "nonpercolating" organic soil - uncon_frac=(1._r8-om_frac)+(1._r8-perc_frac)*om_frac - ! uncon_hksat is series addition of mineral/organic conductivites - if (om_frac .lt. 1._r8) then - uncon_hksat=uncon_frac/((1._r8-om_frac)/xksat & - +((1._r8-perc_frac)*om_frac)/om_hksat) - else - uncon_hksat = 0._r8 - end if - hksat(c,lev) = uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat - - tkmg(c,lev) = tkm ** (1._r8- watsat(c,lev)) - tksatu(c,lev) = tkmg(c,lev)*0.57_r8**watsat(c,lev) - tkdry(c,lev) = ((0.135_r8*bd + 64.7_r8) / (2.7e3_r8 - 0.947_r8*bd))*(1._r8-om_frac) + & - om_tkd*om_frac - csol(c,lev) = ((1._r8-om_frac)*(2.128_r8*sand+2.385_r8*clay) / (sand+clay) + & - om_csol*om_frac)*1.e6_r8 ! J/(m3 K) - if (lev .gt. nlevsoi) then - csol(c,lev) = csol_bedrock - endif - watdry(c,lev) = watsat(c,lev) * (316230._r8/sucsat(c,lev)) ** (-1._r8/bsw(c,lev)) - watopt(c,lev) = watsat(c,lev) * (158490._r8/sucsat(c,lev)) ** (-1._r8/bsw(c,lev)) - !! added by K.Sakaguchi for beta from Lee and Pielke, 1992 - ! water content at field capacity, defined as hk = 0.1 mm/day - ! used eqn (7.70) in CLM3 technote with k = 0.1 (mm/day) / secspday (day/sec) - watfc(c,lev) = watsat(c,lev) * (0.1_r8 / (hksat(c,lev)*secspday))**(1._r8/(2._r8*bsw(c,lev)+3._r8)) - end do - ! - ! Urban pervious and impervious road - ! - ! Impervious road layers -- same as above except set watdry and watopt as missing - if (ctype(c) == icol_road_imperv) then - do lev = 1,nlevgrnd - watdry(c,lev) = spval - watopt(c,lev) = spval - end do - ! pervious road layers -- same as above except also set rootfr_road_perv - ! Currently, pervious road has same properties as soil - else if (ctype(c) == icol_road_perv) then - do lev = 1, nlevgrnd - rootfr_road_perv(c,lev) = 0._r8 - enddo - do lev = 1,nlevsoi - rootfr_road_perv(c,lev) = 0.1_r8 ! uniform profile - end do - end if - endif - - ! Define lake or non-lake levels, layers and interfaces - if (ltype(l) == istdlak) then - z(c,1:nlevlak) = zlak(1:nlevlak) - dz(c,1:nlevlak) = dzlak(1:nlevlak) - else if (ltype(l) == isturb) then - if (ctype(c)==icol_sunwall .or. ctype(c)==icol_shadewall) then - z(c,1:nlevurb) = zurb_wall(l,1:nlevurb) - zi(c,0:nlevurb) = ziurb_wall(l,0:nlevurb) - dz(c,1:nlevurb) = dzurb_wall(l,1:nlevurb) - else if (ctype(c)==icol_roof) then - z(c,1:nlevurb) = zurb_roof(l,1:nlevurb) - zi(c,0:nlevurb) = ziurb_roof(l,0:nlevurb) - dz(c,1:nlevurb) = dzurb_roof(l,1:nlevurb) - else - z(c,1:nlevurb) = zsoi(1:nlevurb) - zi(c,0:nlevurb) = zisoi(0:nlevurb) - dz(c,1:nlevurb) = dzsoi(1:nlevurb) - end if - else - z(c,1:nlevgrnd) = zsoi(1:nlevgrnd) - zi(c,0:nlevgrnd) = zisoi(0:nlevgrnd) - dz(c,1:nlevgrnd) = dzsoi(1:nlevgrnd) - end if - - ! Initialize terms needed for dust model - clay = clay3d(g,1) - gwc_thr(c) = 0.17_r8 + 0.14_r8*clay*0.01_r8 - mss_frc_cly_vld(c) = min(clay*0.01_r8, 0.20_r8) - - end do - - ! pft level initialization - do p = begp, endp - - ! Initialize maximum allowed dew - - dewmx(p) = 0.1_r8 - - ! Initialize root fraction (computing from surface, d is depth in meter): - ! Y = 1 -1/2 (exp(-ad)+exp(-bd) under the constraint that - ! Y(d =0.1m) = 1-beta^(10 cm) and Y(d=d_obs)=0.99 with - ! beta & d_obs given in Zeng et al. (1998). - - c = pcolumn(p) - if (ivt(p) /= noveg) then - do lev = 1, nlevgrnd - rootfr(p,lev) = 0._r8 - enddo - do lev = 1, nlevsoi-1 - rootfr(p,lev) = .5_r8*( exp(-roota_par(ivt(p)) * zi(c,lev-1)) & - + exp(-rootb_par(ivt(p)) * zi(c,lev-1)) & - - exp(-roota_par(ivt(p)) * zi(c,lev )) & - - exp(-rootb_par(ivt(p)) * zi(c,lev )) ) - end do - rootfr(p,nlevsoi) = .5_r8*( exp(-roota_par(ivt(p)) * zi(c,nlevsoi-1)) & - + exp(-rootb_par(ivt(p)) * zi(c,nlevsoi-1)) ) - rootfr(p,nlevsoi+1:nlevgrnd) = 0.0_r8 - -!if (use_cn) then -! ! replacing the exponential rooting distribution -! ! with a linear decrease, going to zero at the bottom of the lowest -! ! soil layer for woody pfts, but going to zero at the bottom of -! ! layer 8 for non-woody pfts. This corresponds to 3.43 m for woody -! ! bottom, vs 1.38 m for non-woody bottom. -! if (woody(ivt(p)) == 1) then -! bottom = nlevsoi -! slope = -2._r8/(zi(c,bottom)*zi(c,bottom)) -! intercept = 2._r8/zi(c,bottom) -! do lev = 1, bottom -! rootfr(p,lev) = dz(c,lev) * 0.5_r8 * ((intercept+slope*zi(c,lev-1)) + (intercept+slope*zi(c,lev))) -! end do -! if (bottom < nlevsoi) then -! do lev=bottom+1,nlevgrnd -! rootfr(p,lev) = 0._r8 -! end do -! end if -! else -! bottom = 8 -! slope = -2._r8/(zi(c,bottom)*zi(c,bottom)) -! intercept = 2._r8/zi(c,bottom) -! do lev=1,bottom -! rootfr(p,lev) = dz(c,lev) * 0.5_r8 * ((intercept+slope*zi(c,lev-1)) + (intercept+slope*zi(c,lev))) -! end do -! if (bottom < nlevsoi) then -! do lev=bottom+1,nlevgrnd -! rootfr(p,lev) = 0._r8 -! end do -! end if -! end if -! endif - else - rootfr(p,1:nlevsoi) = 0._r8 - endif - - ! initialize rresis, for use in ecosystemdyn - do lev = 1,nlevgrnd - rresis(p,lev) = 0._r8 - end do - - end do ! end pft level initialization - - if (use_cn) then - ! initialize the CN variables for special landunits, including lake points - call CNiniSpecial() - end if - - deallocate(soic2d,sand3d,clay3d,gti,organic3d) - deallocate(temp_ef,efisop2d) - deallocate(zurb_wall, zurb_roof, dzurb_wall, dzurb_roof, ziurb_wall, ziurb_roof) - - - ! Initialize SNICAR optical and aging parameters: - call SnowOptics_init( ) - - call SnowAge_init( ) - - if (masterproc) write(iulog,*) 'Successfully initialized time invariant variables' - -end subroutine iniTimeConst diff --git a/src_clm40/main/initGridCellsMod.F90 b/src_clm40/main/initGridCellsMod.F90 deleted file mode 100644 index 02e048cf7b..0000000000 --- a/src_clm40/main/initGridCellsMod.F90 +++ /dev/null @@ -1,1187 +0,0 @@ -module initGridCellsMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: initGridCellsMod -! -! !DESCRIPTION: -! Initializes sub-grid mapping for each land grid cell -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc,iam,mpicom - use abortutils , only : endrun - use clm_varsur , only : wtxy, vegxy - use clm_varsur , only : topoxy - use clm_varctl , only : iulog - -! -! !PUBLIC TYPES: - implicit none - private - save -! -! !PUBLIC MEMBER FUNCTIONS: - public initGridcells ! initialize sub-grid gridcell mapping -! -! !PRIVATE MEMBER FUNCTIONS: - private clm_ptrs_compdown - private clm_ptrs_check - private set_landunit_veg_compete - private set_landunit_wet_ice_lake - private set_landunit_crop_noncompete -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE DATA MEMBERS: None -!EOP -!----------------------------------------------------------------------- - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: initGridcells -! -! !INTERFACE: - subroutine initGridcells () -! -! !DESCRIPTION: -! Initialize sub-grid mapping and allocates space for derived type hierarchy. -! For each land gridcell determine landunit, column and pft properties. -! -! !USES - use clmtype - use domainMod , only : ldomain - use decompMod , only : ldecomp, get_proc_global, get_proc_bounds - use clm_varcon , only : istsoil, istice, istwet, istdlak, isturb, istice_mec - use clm_varctl , only : create_glacier_mec_landunit - use clm_varcon , only : istcrop - use subgridMod , only : subgrid_get_gcellinfo - use shr_const_mod,only : SHR_CONST_PI - use surfrdMod , only : crop_prog -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Peter Thornton and Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: li,ci,pi,m,na,gdc,gsn,glo ! indices - integer :: nveg ! number of pfts in naturally vegetated landunit - integer :: ltype ! landunit type - real(r8):: wtveg ! weight (gridcell) of naturally veg landunit - integer :: ncrop ! number of crop pfts in crop landunit - real(r8):: wtcrop ! weight (gridcell) of crop landunit - integer :: nlake ! number of pfts (columns) in lake landunit - real(r8):: wtlake ! weight (gridcell) of lake landunit - integer :: nwetland ! number of pfts (columns) in wetland landunit - real(r8):: wtwetland ! weight (gridcell) of wetland landunit - integer :: nglacier ! number of pfts (columns) in glacier landunit - real(r8):: wtglacier ! weight (gridcell) of glacier landunit - integer :: nglacier_mec ! number of pfts (columns) in glacier landunit - real(r8):: wtglacier_mec ! weight (gridcell) of glacier_mec landunit - integer :: ier ! error status - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: begg,endg ! local beg/end gridcells gdc - integer :: begl,endl ! local beg/end landunits - integer :: begc,endc ! local beg/end columns - integer :: begp,endp ! local beg/end pfts - logical :: my_gcell ! is gdc gridcell on my pe - integer :: nwtxy ! wtxy cell index - - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - !------------------------------------------------------------------------ - - ! Set pointers into derived types for this module - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ! Get total global number of grid cells, landunits, columns and pfts - - call get_proc_global(numg,numl,numc,nump) - call get_proc_bounds(begg,endg,begl,endl,begc,endc,begp,endp) - - ! For each land gridcell on global grid determine landunit, column and pft properties - - li = begl-1 - ci = begc-1 - pi = begp-1 - - if ( crop_prog )then - ltype = istcrop - else - ltype = istsoil - end if - - !----- Set clm3 variables ----- - do gdc = begg,endg - - glo = ldecomp%gdc2glo(gdc) - nwtxy = gdc - - my_gcell = .false. - if (gdc >= begg .and. gdc <= endg) then - my_gcell = .true. - endif - - ! Determine naturally vegetated landunit - - call set_landunit_veg_compete( & - ltype=istsoil, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - ! Determine crop landunit - - call set_landunit_crop_noncompete( & - ltype=ltype, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - ! Determine urban landunit - - call set_landunit_urban( & -! ltype=isturb, wtxy=wtxy, vegxy=vegxy, & - ltype=isturb, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - ! Determine lake, wetland and glacier landunits - - call set_landunit_wet_ice_lake( & - ltype=istdlak, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - call set_landunit_wet_ice_lake( & - ltype=istwet, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - call set_landunit_wet_ice_lake( & - ltype=istice, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell) - - if (create_glacier_mec_landunit) then - call set_landunit_wet_ice_lake( & - ltype=istice_mec, & - nw=nwtxy, gi=gdc, li=li, ci=ci, pi=pi, setdata=my_gcell, & - glcmask = ldomain%glcmask(gdc)) - endif - - ! Make ice sheet masks - - gptr%gris_mask(gdc) = 0._r8 - gptr%gris_area(gdc) = 0._r8 - gptr%aais_mask(gdc) = 0._r8 - gptr%aais_area(gdc) = 0._r8 - - ! Greenland mask - if ( (ldomain%latc(gdc) > 58. .and. ldomain%latc(gdc) <= 67. .and. & - ldomain%lonc(gdc) > 302. .and. ldomain%lonc(gdc) < 330.) & - .or. & - (ldomain%latc(gdc) > 67. .and. ldomain%latc(gdc) <= 70. .and. & - ldomain%lonc(gdc) > 300. .and. ldomain%lonc(gdc) < 345.) & - .or. & - (ldomain%latc(gdc) > 70. .and. ldomain%latc(gdc) <= 75. .and. & - ldomain%lonc(gdc) > 295. .and. ldomain%lonc(gdc) < 350.) & - .or. & - (ldomain%latc(gdc) > 75. .and. ldomain%latc(gdc) <= 79. .and. & - ldomain%lonc(gdc) > 285. .and. ldomain%lonc(gdc) < 350.) & - .or. & - (ldomain%latc(gdc) > 79. .and. ldomain%latc(gdc) < 85. .and. & - ldomain%lonc(gdc) > 290. .and. ldomain%lonc(gdc) < 355.) ) then - - gptr%gris_mask(gdc) = 1.0_r8 - - elseif (ldomain%latc(gdc) < -60.) then - - gptr%aais_mask(gdc) = 1.0_r8 - - endif ! Greenland or Antarctic grid cell - - ! Set clm3 lats/lons - - if (my_gcell) then - gptr%gindex(gdc) = glo - gptr%latdeg(gdc) = ldomain%latc(gdc) - gptr%londeg(gdc) = ldomain%lonc(gdc) - gptr%lat(gdc) = gptr%latdeg(gdc) * SHR_CONST_PI/180._r8 - gptr%lon(gdc) = gptr%londeg(gdc) * SHR_CONST_PI/180._r8 - gptr%area(gdc) = ldomain%area(gdc) - endif - - enddo - - ! Fill in subgrid datatypes - - call clm_ptrs_compdown() - call clm_ptrs_check() - - end subroutine initGridcells - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: clm_ptrs_compdown -! -! !INTERFACE: - subroutine clm_ptrs_compdown() -! -! !DESCRIPTION: -! Assumes the part of the subgrid pointing up has been set. Fills -! in the data pointing down. Up is p_c, p_l, p_g, c_l, c_g, and l_g. -! -! This algorithm assumes all indices are monotonically increasing. -! -! Algorithm works as follows. The p, c, and l loops march through -! the full arrays (nump, numc, and numl) checking the "up" indexes. -! As soon as the "up" index of the current (p,c,l) cell changes relative -! to the previous (p,c,l) cell, the *i array will be set to point down -! to that cell. The *f array follows the same logic, so it's always the -! last "up" index from the previous cell when an "up" index changes. -! -! For example, a case where p_c(1:4) = 1 and p_c(5:12) = 2. This -! subroutine will set c_pi(1) = 1, c_pf(1) = 4, c_pi(2) = 5, c_pf(2) = 12. -! -! !USES - use clmtype - use decompMod , only : get_proc_bounds - -! !ARGUMENTS - implicit none -! -! !CALLED FROM: -! subroutines initGridCellsMod -! -! !REVISION HISTORY: -! 2005.11.15 T Craig Creation -! -! -! !LOCAL VARIABLES: - integer :: begg,endg,begl,endl,begc,endc,begp,endp ! beg/end glcp - integer :: g,l,c,p ! loop counters - integer :: curg,curl,curc,curp ! tracks g,l,c,p indexes in arrays - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype -!EOP -!------------------------------------------------------------------------------ - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - call get_proc_bounds(begg,endg,begl,endl,begc,endc,begp,endp) - - !--- Set the current c,l,g (curc, curl, curg) to zero for initialization, - !--- these indices track the current "up" index. - !--- Take advantage of locality of g/l/c/p cells - !--- Loop p through full local begp:endp length - !--- Separately check the p_c, p_l, and p_g indexes for a change in - !--- the "up" index. - !--- If there is a change, verify that the current c,l,g is within the - !--- valid range, and set c_pi, l_pi, or g_pi to that current c,l,g - !--- Constantly update the c_pf, l_pf, and g_pf array. When the - !--- g, l, c index changes, the *_pf array will be set correctly - !--- Do the same for cols setting c_li, c_gi, c_lf, c_gf and - !--- lunits setting l_gi, l_gf. - - curc = 0 - curl = 0 - curg = 0 - do p = begp,endp - if (pptr%column(p) /= curc) then - curc = pptr%column(p) - if (curc < begc .or. curc > endc) then - write(iulog,*) 'clm_ptrs_compdown ERROR: pcolumn ',p,curc,begc,endc - call endrun() - endif - cptr%pfti(curc) = p - endif - cptr%pftf(curc) = p - cptr%npfts(curc) = cptr%pftf(curc) - cptr%pfti(curc) + 1 - if (pptr%landunit(p) /= curl) then - curl = pptr%landunit(p) - if (curl < begl .or. curl > endl) then - write(iulog,*) 'clm_ptrs_compdown ERROR: plandunit ',p,curl,begl,endl - call endrun() - endif - lptr%pfti(curl) = p - endif - lptr%pftf(curl) = p - lptr%npfts(curl) = lptr%pftf(curl) - lptr%pfti(curl) + 1 - if (pptr%gridcell(p) /= curg) then - curg = pptr%gridcell(p) - if (curg < begg .or. curg > endg) then - write(iulog,*) 'clm_ptrs_compdown ERROR: pgridcell ',p,curg,begg,endg - call endrun() - endif - gptr%pfti(curg) = p - endif - gptr%pftf(curg) = p - gptr%npfts(curg) = gptr%pftf(curg) - gptr%pfti(curg) + 1 - enddo - - curg = 0 - curl = 0 - do c = begc,endc - if (cptr%landunit(c) /= curl) then - curl = cptr%landunit(c) - if (curl < begl .or. curl > endl) then - write(iulog,*) 'clm_ptrs_compdown ERROR: clandunit ',c,curl,begl,endl - call endrun() - endif - lptr%coli(curl) = c - endif - lptr%colf(curl) = c - lptr%ncolumns(curl) = lptr%colf(curl) - lptr%coli(curl) + 1 - if (cptr%gridcell(c) /= curg) then - curg = cptr%gridcell(c) - if (curg < begg .or. curg > endg) then - write(iulog,*) 'clm_ptrs_compdown ERROR: cgridcell ',c,curg,begg,endg - call endrun() - endif - gptr%coli(curg) = c - endif - gptr%colf(curg) = c - gptr%ncolumns(curg) = gptr%colf(curg) - gptr%coli(curg) + 1 - enddo - - curg = 0 - do l = begl,endl - if (lptr%gridcell(l) /= curg) then - curg = lptr%gridcell(l) - if (curg < begg .or. curg > endg) then - write(iulog,*) 'clm_ptrs_compdown ERROR: lgridcell ',l,curg,begg,endg - call endrun() - endif - gptr%luni(curg) = l - endif - gptr%lunf(curg) = l - gptr%nlandunits(curg) = gptr%lunf(curg) - gptr%luni(curg) + 1 - enddo - - end subroutine clm_ptrs_compdown -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: clm_ptrs_check -! -! !INTERFACE: - subroutine clm_ptrs_check() -! -! !DESCRIPTION: -! Checks and writes out a summary of subgrid data -! -! !USES - use clmtype - use decompMod , only : get_proc_bounds - -! !ARGUMENTS - implicit none -! -! !CALLED FROM: -! -! !REVISION HISTORY: -! 2005.11.15 T Craig Creation -! -! -! !LOCAL VARIABLES: - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - integer :: begg,endg,begl,endl,begc,endc,begp,endp ! beg/end indices - integer :: g,l,c,p ! loop counters - logical :: error ! error flag -!EOP -!------------------------------------------------------------------------------ - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - if (masterproc) write(iulog,*) ' ' - if (masterproc) write(iulog,*) '---clm_ptrs_check:' - call get_proc_bounds(begg,endg,begl,endl,begc,endc,begp,endp) - - !--- check index ranges --- - error = .false. - if (minval(gptr%luni) < begl .or. maxval(gptr%luni) > endl) error=.true. - if (minval(gptr%lunf) < begl .or. maxval(gptr%lunf) > endl) error=.true. - if (minval(gptr%coli) < begc .or. maxval(gptr%coli) > endc) error=.true. - if (minval(gptr%colf) < begc .or. maxval(gptr%colf) > endc) error=.true. - if (minval(gptr%pfti) < begp .or. maxval(gptr%pfti) > endp) error=.true. - if (minval(gptr%pftf) < begp .or. maxval(gptr%pftf) > endp) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: g index ranges - ERROR' - write(iulog,*)'minval,beg,maxval,end' - write(iulog,*) minval(gptr%luni),begl,maxval(gptr%luni),endl - write(iulog,*) minval(gptr%lunf),begl,maxval(gptr%lunf),endl - write(iulog,*) minval(gptr%coli),begc,maxval(gptr%coli),endc - write(iulog,*) minval(gptr%colf),begc,maxval(gptr%colf),endc - write(iulog,*) minval(gptr%pfti),begp,maxval(gptr%pfti),endp - write(iulog,*) minval(gptr%pftf),begp,maxval(gptr%pftf),endp - call endrun() - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: g index ranges - OK' - - error = .false. - if (minval(lptr%gridcell) < begg .or. maxval(lptr%gridcell) > endg) error=.true. - if (minval(lptr%coli) < begc .or. maxval(lptr%coli) > endc) error=.true. - if (minval(lptr%colf) < begc .or. maxval(lptr%colf) > endc) error=.true. - if (minval(lptr%pfti) < begp .or. maxval(lptr%pfti) > endp) error=.true. - if (minval(lptr%pftf) < begp .or. maxval(lptr%pftf) > endp) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: l index ranges - ERROR' - call endrun() - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: l index ranges - OK' - - error = .false. - if (minval(cptr%gridcell) < begg .or. maxval(cptr%gridcell) > endg) error=.true. - if (minval(cptr%landunit) < begl .or. maxval(cptr%landunit) > endl) error=.true. - if (minval(cptr%pfti) < begp .or. maxval(cptr%pfti) > endp) error=.true. - if (minval(cptr%pftf) < begp .or. maxval(cptr%pftf) > endp) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: c index ranges - ERROR' - call endrun() - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: c index ranges - OK' - - error = .false. - if (minval(pptr%gridcell) < begg .or. maxval(pptr%gridcell) > endg) error=.true. - if (minval(pptr%landunit) < begl .or. maxval(pptr%landunit) > endl) error=.true. - if (minval(pptr%column) < begc .or. maxval(pptr%column) > endc) error=.true. - if (error) then - write(iulog,*) ' clm_ptrs_check: p index ranges - ERROR' - call endrun() - endif - if (masterproc) write(iulog,*) ' clm_ptrs_check: p index ranges - OK' - - !--- check that indices in arrays are monotonically increasing --- - error = .false. - do g=begg+1,endg - if (gptr%luni(g) < gptr%luni(g-1)) error = .true. - if (gptr%lunf(g) < gptr%lunf(g-1)) error = .true. - if (gptr%coli(g) < gptr%coli(g-1)) error = .true. - if (gptr%colf(g) < gptr%colf(g-1)) error = .true. - if (gptr%pfti(g) < gptr%pfti(g-1)) error = .true. - if (gptr%pftf(g) < gptr%pftf(g-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: g mono increasing - ERROR' - call endrun() - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: g mono increasing - OK' - - error = .false. - do l=begl+1,endl - if (lptr%gridcell(l) < lptr%gridcell(l-1)) error = .true. - if (lptr%coli(l) < lptr%coli(l-1)) error = .true. - if (lptr%colf(l) < lptr%colf(l-1)) error = .true. - if (lptr%pfti(l) < lptr%pfti(l-1)) error = .true. - if (lptr%pftf(l) < lptr%pftf(l-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: l mono increasing - ERROR' - call endrun() - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: l mono increasing - OK' - - error = .false. - do c=begc+1,endc - if (cptr%gridcell(c) < cptr%gridcell(c-1)) error = .true. - if (cptr%landunit(c) < cptr%landunit(c-1)) error = .true. - if (cptr%pfti(c) < cptr%pfti(c-1)) error = .true. - if (cptr%pftf(c) < cptr%pftf(c-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: c mono increasing - ERROR' - call endrun() - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: c mono increasing - OK' - - error = .false. - do p=begp+1,endp - if (pptr%gridcell(p) < pptr%gridcell(p-1)) error = .true. - if (pptr%landunit(p) < pptr%landunit(p-1)) error = .true. - if (pptr%column (p) < pptr%column (p-1)) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: p mono increasing - ERROR' - call endrun() - endif - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: p mono increasing - OK' - - !--- check that the tree is internally consistent --- - error = .false. - do g = begg, endg - do l = gptr%luni(g),gptr%lunf(g) - if (lptr%gridcell(l) /= g) error = .true. - do c = lptr%coli(l),lptr%colf(l) - if (cptr%gridcell(c) /= g) error = .true. - if (cptr%landunit(c) /= l) error = .true. - do p = cptr%pfti(c),cptr%pftf(c) - if (pptr%gridcell(p) /= g) error = .true. - if (pptr%landunit(p) /= l) error = .true. - if (pptr%column(p) /= c) error = .true. - if (error) then - write(iulog,*) ' clm_ptrs_check: tree consistent - ERROR' - call endrun() - endif - enddo - enddo - enddo - enddo - if (masterproc) write(iulog,*) ' clm_ptrs_check: tree consistent - OK' - if (masterproc) write(iulog,*) ' ' - -end subroutine clm_ptrs_check -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_landunit_veg_compete -! -! !INTERFACE: -! subroutine set_landunit_veg_compete (ltype, wtxy, vegxy, & - subroutine set_landunit_veg_compete (ltype, & - nw, gi, li, ci, pi, setdata) -! -! !DESCRIPTION: -! Initialize vegetated landunit with competition -! -! !USES - use clmtype - use subgridMod, only : subgrid_get_gcellinfo - use clm_varpar, only : numpft, maxpatch_pft, numcft - use clm_varctl, only : allocate_all_vegpfts, create_crop_landunit -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ltype ! landunit type -! real(r8), intent(in) :: wtxy(:,:) ! subgrid patch weights -! integer , intent(in) :: vegxy(:,:) ! PFT types - integer , intent(in) :: nw ! cell index - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! pft index - logical , intent(in) :: setdata ! set info or just compute -! -! !REVISION HISTORY: -! Created by ? -! 2005.11.25 Updated by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m ! m index in wtxy(nw,m) - integer :: n ! loop index - integer :: npfts ! number of pfts in landunit - integer :: ncols ! number of columns in landu - integer :: pitype ! pft itype - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - type(landunit_type), pointer :: lptr ! pointer to landunit - type(column_type) , pointer :: cptr ! pointer to column - type(pft_type) , pointer :: pptr ! pointer to pft - -!------------------------------------------------------------------------ - - ! Set decomposition properties - -! call subgrid_get_gcellinfo(nw, wtxy, nveg=npfts, wtveg=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nveg=npfts, wtveg=wtlunit2gcell) - - if (npfts > 0) then - - ! Set pointers into derived types for this module - - lptr => lun - cptr => col - pptr => pft - - ncols = 1 - - li = li + 1 - ci = ci + 1 - - if (setdata) then - ! Set landunit properties - lptr%ifspecial(li) = .false. - lptr%lakpoi(li) = .false. - lptr%urbpoi(li) = .false. - lptr%itype(li) = ltype - - lptr%gridcell (li) = gi - lptr%wtgcell(li) = wtlunit2gcell - - ! Set column properties for this landunit (only one column on landunit) - cptr%itype(ci) = 1 - - cptr%gridcell (ci) = gi - cptr%wtgcell(ci) = wtlunit2gcell - cptr%landunit (ci) = li - cptr%wtlunit(ci) = 1.0_r8 - endif ! setdata - - ! Set pft properties for this landunit - - if (create_crop_landunit) then - do n = 1,numpft+1-numcft - pi = pi + 1 - pitype = n-1 - if (setdata) then - pptr%mxy(pi) = n - pptr%itype(pi) = pitype - pptr%gridcell(pi) = gi - pptr%landunit(pi) = li - pptr%column (pi) = ci - pptr%wtgcell(pi) = 0.0_r8 - pptr%wtlunit(pi) = 0.0_r8 - pptr%wtcol(pi) = 0.0_r8 - do m = 1,maxpatch_pft - if (vegxy(nw,m) == pitype .and. wtxy(nw,m) > 0._r8) then - pptr%wtgcell(pi) = pptr%wtgcell(pi) + wtxy(nw,m) - pptr%wtlunit(pi) = pptr%wtlunit(pi) + wtxy(nw,m) / wtlunit2gcell - pptr%wtcol(pi) = pptr%wtcol(pi) + wtxy(nw,m) / wtlunit2gcell - end if - end do - endif ! setdata - end do - else if (allocate_all_vegpfts) then - do n = 1,numpft+1 - pi = pi + 1 - pitype = n-1 - if (setdata) then - pptr%mxy(pi) = n - pptr%itype(pi) = pitype - pptr%gridcell(pi) = gi - pptr%landunit(pi) = li - pptr%column (pi) = ci - pptr%wtgcell(pi) = 0.0_r8 - pptr%wtlunit(pi) = 0.0_r8 - pptr%wtcol(pi) = 0.0_r8 - do m = 1,maxpatch_pft - if (vegxy(nw,m) == pitype .and. wtxy(nw,m) > 0._r8) then - pptr%wtgcell(pi) = pptr%wtgcell(pi) + wtxy(nw,m) - pptr%wtlunit(pi) = pptr%wtlunit(pi) + wtxy(nw,m) / wtlunit2gcell - pptr%wtcol(pi) = pptr%wtcol(pi) + wtxy(nw,m) / wtlunit2gcell - end if - end do - endif ! setdata - end do - else - do m = 1,maxpatch_pft - if (wtxy(nw,m) > 0._r8) then - pi = pi + 1 - if (setdata) then - pptr%mxy(pi) = m - pptr%itype(pi) = vegxy(nw,m) - pptr%gridcell(pi) = gi - pptr%wtgcell(pi) = wtxy(nw,m) - pptr%landunit(pi) = li - pptr%wtlunit(pi) = wtxy(nw,m) / wtlunit2gcell - pptr%column (pi) = ci - pptr%wtcol(pi) = wtxy(nw,m) / wtlunit2gcell - endif ! setdata - end if - end do - end if - - end if - - end subroutine set_landunit_veg_compete - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_landunit_wet_ice_lake -! -! !INTERFACE: -! subroutine set_landunit_wet_ice_lake (ltype, wtxy, vegxy, & - subroutine set_landunit_wet_ice_lake (ltype, & - nw, gi, li, ci, pi, setdata, glcmask) -! -! !DESCRIPTION: -! Initialize wet_ice_lake landunits that are non-urban (lake, wetland, glacier, glacier_mec) -! -! !USES - use clmtype - use subgridMod, only : subgrid_get_gcellinfo - use clm_varcon, only : istice, istwet, istdlak, istice_mec - use clm_varpar, only : npatch_lake, npatch_glacier, npatch_wet - use clm_varpar, only : npatch_glacier_mec - -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ltype ! landunit type -! real(r8), intent(in) :: wtxy(:,:) ! subgrid patch weights -! integer , intent(in) :: vegxy(:,:) ! PFT types - integer , intent(in) :: nw ! cell index - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! pft index - logical , intent(in) :: setdata ! set info or just compute - integer , intent(in), optional :: glcmask ! = 1 where glc requires sfc mass balance - ! = 0 otherwise -! -! !REVISION HISTORY: -! Created by Sam Levis -! 2005.11.25 Updated by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m ! m index in wtxy(nw,m) - integer :: c ! column loop index - integer :: ctype ! column type - integer :: ier ! error status - integer :: npfts ! number of pfts in landunit - integer :: ncols ! number of columns in landu - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - real(r8) :: wtcol2lunit ! col weight in landunit - type(landunit_type), pointer :: lptr ! pointer to landunit - type(column_type) , pointer :: cptr ! pointer to column - type(pft_type) , pointer :: pptr ! pointer to pft - -!------------------------------------------------------------------------ - - ! Set decomposition properties - - if (ltype == istwet) then -! call subgrid_get_gcellinfo(nw, wtxy, nwetland=npfts, wtwetland=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nwetland=npfts, wtwetland=wtlunit2gcell) - m = npatch_wet - else if (ltype == istdlak) then -! call subgrid_get_gcellinfo(nw, wtxy, nlake=npfts, wtlake=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nlake=npfts, wtlake=wtlunit2gcell) - m = npatch_lake - else if (ltype == istice) then -! call subgrid_get_gcellinfo(nw, wtxy, nglacier=npfts, wtglacier=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nglacier=npfts, wtglacier=wtlunit2gcell) - m = npatch_glacier - else if (ltype == istice_mec) then -! call subgrid_get_gcellinfo(nw, wtxy, nglacier_mec=npfts, wtglacier_mec=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nglacier_mec=npfts, wtglacier_mec=wtlunit2gcell, & - glcmask = glcmask) - ! NOTE: multiple columns per landunit, so m is not set here - - else - write(iulog,*)' set_landunit_wet_ice_lake: ltype of ',ltype,' not valid' - write(iulog,*)' only istwet, istdlak, istice and istice_mec ltypes are valid' - call endrun() - end if - - if (npfts > 0) then - - ! Set pointers into derived types for this module - - lptr => lun - cptr => col - pptr => pft - - if (npfts /=1 .and. ltype /= istice_mec) then - write(iulog,*)' set_landunit_wet_ice_lake: compete landunit must'// & - ' have one column and one pft ' - write(iulog,*)' current values of ncols, pfts=',ncols,npfts - call endrun() - end if - - if (ltype==istice_mec) then ! multiple columns per landunit - - ! Assume that columns are of type 1 and that each column has its own pft - - ctype = 1 - li = li + 1 - - if (setdata) then - - ! Determine landunit properties - - lptr%itype (li) = ltype - lptr%ifspecial(li) = .true. - lptr%glcmecpoi(li) = .true. - lptr%lakpoi (li) = .false. - lptr%urbpoi (li) = .false. - lptr%gridcell (li) = gi - lptr%wtgcell (li) = wtlunit2gcell - - ! Determine column and properties - ! (Each column has its own pft) - ! - ! For grid cells with glcmask = 1, make sure all the elevations classes - ! are populated, even if some have zero fractional area. This ensures that the - ! ice sheet component, glc, will receive a surface mass balance in each elevation - ! class wherever the SMB is needed. - ! Columns with zero weight are referred to as "virtual" columns. - - do m = npatch_glacier+1, npatch_glacier_mec - - if (wtxy(nw,m) > 0._r8 .or. glcmask == 1) then - - ci = ci + 1 - pi = pi + 1 - if (wtlunit2gcell > 0._r8) then - wtcol2lunit = wtxy(nw,m)/wtlunit2gcell - else ! virtual landunit - wtcol2lunit = 0._r8 - endif - - cptr%itype (ci) = ctype - cptr%gridcell (ci) = gi - cptr%wtgcell (ci) = wtcol2lunit * wtlunit2gcell - cptr%landunit (ci) = li - cptr%wtlunit (ci) = wtcol2lunit - - ! Set sfc elevation too - - cps%glc_topo(ci) = topoxy(nw,m) - - ! Set pft properties - - pptr%mxy (pi) = m - pptr%itype (pi) = vegxy(nw,m) - pptr%gridcell (pi) = gi - pptr%wtgcell (pi) = wtcol2lunit * wtlunit2gcell - pptr%landunit (pi) = li - pptr%wtlunit (pi) = wtcol2lunit - pptr%column (pi) = ci - pptr%wtcol (pi) = 1.0_r8 - - endif ! wtxy > 0 or glcmask = 1 - enddo ! loop over columns - endif ! setdata - - else - - ncols = 1 - - ! Currently assume that each landunit only has only one column - ! (of type 1) and that each column has its own pft - - wtcol2lunit = 1.0_r8/ncols - ctype = 1 - - li = li + 1 - ci = ci + 1 - pi = pi + 1 - - if (setdata) then - - ! Determine landunit properties - - lptr%itype (li) = ltype - lptr%ifspecial(li) = .true. - lptr%urbpoi (li) = .false. - if (ltype == istdlak) then - lptr%lakpoi(li) = .true. - else - lptr%lakpoi(li) = .false. - end if - - lptr%gridcell (li) = gi - lptr%wtgcell(li) = wtlunit2gcell - - ! Determine column and properties - ! For the wet, ice or lake landunits it is assumed that each - ! column has its own pft - - cptr%itype(ci) = ctype - - cptr%gridcell (ci) = gi - cptr%wtgcell(ci) = wtcol2lunit * wtlunit2gcell - cptr%landunit (ci) = li - cptr%wtlunit(ci) = wtcol2lunit - - ! Set pft properties - - pptr%mxy(pi) = m - pptr%itype(pi) = vegxy(nw,m) - - pptr%gridcell (pi) = gi - pptr%wtgcell(pi) = wtcol2lunit * wtlunit2gcell - pptr%landunit (pi) = li - pptr%wtlunit(pi) = wtcol2lunit - pptr%column (pi) = ci - pptr%wtcol(pi) = 1.0_r8 - endif ! setdata - end if ! ltype = istice_mec - endif ! npfts > 0 - - end subroutine set_landunit_wet_ice_lake - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_landunit_crop_noncompete -! -! !INTERFACE: -! subroutine set_landunit_crop_noncompete (ltype, wtxy, vegxy, & - subroutine set_landunit_crop_noncompete (ltype, & - nw, gi, li, ci, pi, setdata) -! -! !DESCRIPTION: -! Initialize crop landunit without competition -! -! !USES - use clmtype - use subgridMod, only : subgrid_get_gcellinfo - use clm_varctl, only : create_crop_landunit - use clm_varpar, only : maxpatch_pft, numcft, npatch_glacier_mec -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ltype ! landunit type -! real(r8), intent(in) :: wtxy(:,:) ! subgrid patch weights -! integer , intent(in) :: vegxy(:,:) ! PFT types - integer , intent(in) :: nw ! cell index - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! pft index - logical , intent(in) :: setdata ! set info or just compute -! -! !REVISION HISTORY: -! Created by Sam Levis -! 2005.11.25 Updated by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m ! m index in wtxy(nw,m) - integer :: npfts ! number of pfts in landunit - integer :: ncols ! number of columns in landu - real(r8) :: wtlunit2gcell ! landunit weight in gridcell - type(landunit_type), pointer :: lptr ! pointer to landunit - type(column_type) , pointer :: cptr ! pointer to column - type(pft_type) , pointer :: pptr ! pointer to pft -!------------------------------------------------------------------------ - - ! Set decomposition properties - -! call subgrid_get_gcellinfo(nw, wtxy, ncrop=npfts, wtcrop=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, ncrop=npfts, wtcrop=wtlunit2gcell) - - if (npfts > 0) then - - ! Set pointers into derived types for this module - - lptr => lun - cptr => col - pptr => pft - - ! Set landunit properties - each column has its own pft - - ncols = npfts - - li = li + 1 - - if (setdata) then - lptr%itype(li) = ltype - lptr%ifspecial(li) = .false. - lptr%lakpoi(li) = .false. - lptr%urbpoi(li) = .false. - lptr%gridcell (li) = gi - lptr%wtgcell(li) = wtlunit2gcell - endif ! setdata - - ! Set column and pft properties for this landunit - ! (each column has its own pft) - - if (create_crop_landunit) then - do m = maxpatch_pft-numcft+1, maxpatch_pft - ci = ci + 1 - pi = pi + 1 - - if (setdata) then - cptr%itype(ci) = 1 - pptr%itype(pi) = m - 1 - pptr%mxy(pi) = m - - cptr%gridcell (ci) = gi - cptr%wtgcell(ci) = wtxy(nw,m) - cptr%landunit (ci) = li - - pptr%gridcell (pi) = gi - pptr%wtgcell(pi) = wtxy(nw,m) - pptr%landunit (pi) = li - pptr%column (pi) = ci - if (wtxy(nw,m) > 0._r8) then - cptr%wtlunit(ci) = wtxy(nw,m) / wtlunit2gcell - pptr%wtlunit(pi) = wtxy(nw,m) / wtlunit2gcell - pptr%wtcol(pi) = 1._r8 - else - cptr%wtlunit(ci) = 0._r8 - pptr%wtlunit(pi) = 0._r8 - pptr%wtcol(pi) = 0._r8 - end if - endif ! setdata - end do - end if - - end if - - end subroutine set_landunit_crop_noncompete - -!------------------------------------------------------------------------------ - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_landunit_urban -! -! !INTERFACE: -! subroutine set_landunit_urban (ltype, wtxy, vegxy, & - subroutine set_landunit_urban (ltype, & - nw, gi, li, ci, pi, setdata) -! -! !DESCRIPTION: -! Initialize urban landunits -! -! !USES - use clm_varcon , only : isturb, icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv - use clm_varpar , only : npatch_urban, maxpatch_urb - use clmtype - use subgridMod , only : subgrid_get_gcellinfo - use UrbanInputMod, only : urbinp - use decompMod , only : ldecomp -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ltype ! landunit type -! real(r8), intent(in) :: wtxy(:,:) ! subgrid patch weights -! integer , intent(in) :: vegxy(:,:) ! PFT types - integer , intent(in) :: nw ! cell index - integer , intent(in) :: gi ! gridcell index - integer , intent(inout) :: li ! landunit index - integer , intent(inout) :: ci ! column index - integer , intent(inout) :: pi ! pft index - logical , intent(in) :: setdata ! set info or just compute -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: c ! column loop index - integer :: m ! m index in wtxy(nw,m) - integer :: ctype ! column type - integer :: npfts ! number of pfts in landunit - integer :: ncols ! number of columns in landunit - real(r8) :: wtlunit2gcell ! weight relative to gridcell of landunit - real(r8) :: wtcol2lunit ! weight of column with respect to landunit - real(r8) :: wtlunit_roof ! weight of roof with respect to landunit - real(r8) :: wtroad_perv ! weight of pervious road column with respect to total road - integer :: ier ! error status - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype -!------------------------------------------------------------------------ - - ! Set decomposition properties - -! call subgrid_get_gcellinfo(nw, wtxy, nurban=npfts, wturban=wtlunit2gcell) - call subgrid_get_gcellinfo(nw, nurban=npfts, wturban=wtlunit2gcell) - - if (npfts > 0) then - - ! Set pointers into derived types for this module - - lptr => lun - cptr => col - pptr => pft - - ! Determine landunit properties - each columns has its own pft - - ncols = npfts - - li = li + 1 - if (setdata) then - lptr%itype (li) = ltype - lptr%ifspecial(li) = .true. - lptr%lakpoi (li) = .false. - lptr%urbpoi (li) = .true. - - lptr%gridcell (li) = gi - lptr%wtgcell (li) = wtlunit2gcell - endif - - ! Loop through columns for this landunit and set the column and pft properties - ! For the urban landunits it is assumed that each column has its own pft - - do m = npatch_urban, npatch_urban + maxpatch_urb - 1 - if (wtxy(nw,m) > 0._r8) then - - wtlunit_roof = urbinp%wtlunit_roof(nw) - wtroad_perv = urbinp%wtroad_perv(nw) - - if (m == npatch_urban ) then - ctype = icol_roof - wtcol2lunit = wtlunit_roof - else if (m == npatch_urban+1) then - ctype = icol_sunwall - wtcol2lunit = (1. - wtlunit_roof)/3 - else if (m == npatch_urban+2) then - ctype = icol_shadewall - wtcol2lunit = (1. - wtlunit_roof)/3 - else if (m == npatch_urban+3) then - ctype = icol_road_imperv - wtcol2lunit = ((1. - wtlunit_roof)/3) * (1.-wtroad_perv) - else if (m == npatch_urban+4) then - ctype = icol_road_perv - wtcol2lunit = ((1. - wtlunit_roof)/3) * (wtroad_perv) - end if - - ci = ci + 1 - pi = pi + 1 - - if (setdata) then - cptr%itype(ci) = ctype - - cptr%gridcell (ci) = gi - cptr%wtgcell (ci) = wtcol2lunit * wtlunit2gcell - cptr%landunit (ci) = li - cptr%wtlunit (ci) = wtcol2lunit - - pptr%mxy (pi) = m - pptr%itype (pi) = vegxy(nw,m) - - pptr%gridcell(pi) = gi - pptr%wtgcell (pi) = wtcol2lunit * wtlunit2gcell - pptr%landunit(pi) = li - pptr%wtlunit (pi) = wtcol2lunit - pptr%column (pi) = ci - pptr%wtcol (pi) = 1.0_r8 - end if - - end if - end do ! end of loop through urban columns-pfts - - end if - - end subroutine set_landunit_urban - -!------------------------------------------------------------------------------ - -end module initGridCellsMod diff --git a/src_clm40/main/initSurfAlbMod.F90 b/src_clm40/main/initSurfAlbMod.F90 deleted file mode 100644 index 8314905ba1..0000000000 --- a/src_clm40/main/initSurfAlbMod.F90 +++ /dev/null @@ -1,344 +0,0 @@ -module initSurfalbMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: initSurfalbMod -! -! !DESCRIPTION: -! Computes initial surface albedo calculation - -! Initialization of ecosystem dynamics is needed for this -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils, only : endrun - use clm_varctl, only : iulog, use_cn, use_cndv -! -! !PUBLIC TYPES: - implicit none - logical, public :: do_initsurfalb -! save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: InitSurfAlb -! -! !REVISION HISTORY: -! 2005-06-12: Created by Mariana Vertenstein -! 2008-02-29: Revised snow cover fraction from Niu and Yang, 2007 -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: initSurfalb -! -! !INTERFACE: - subroutine initSurfalb( calday, declin, declinm1 ) -! -! !DESCRIPTION: -! The variable, h2osoi_vol, is needed by the soil albedo routine - this is not needed -! on restart since it is computed before the soil albedo computation is called. -! The remaining variables are initialized by calls to ecosystem dynamics and -! albedo subroutines. -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_orb_mod , only : shr_orb_decl - use shr_const_mod , only : SHR_CONST_PI - use clmtype - use spmdMod , only : masterproc,iam - use decompMod , only : get_proc_clumps, get_clump_bounds - use filterMod , only : filter - use clm_varpar , only : nlevsoi, nlevsno, nlevlak, nlevgrnd - use clm_varcon , only : zlnd, istsoil, isturb, denice, denh2o, & - icol_roof, icol_road_imperv, & - icol_road_perv - use clm_varcon , only : istcrop - use clm_time_manager , only : get_step_size - use FracWetMod , only : FracWet - use SurfaceAlbedoMod , only : SurfaceAlbedo - use CNEcosystemDynMod , only : CNEcosystemDyn - use CNVegStructUpdateMod, only : CNVegStructUpdate - use STATICEcosysDynMod , only : EcosystemDyn, interpMonthlyVeg - use UrbanMod , only : UrbanAlbedo - use abortutils , only : endrun -! -! !ARGUMENTS: - implicit none - real(r8), intent(in) :: calday ! calendar day for declin - real(r8), intent(in) :: declin ! declination angle (radians) for calday - real(r8), intent(in), optional :: declinm1 ! declination angle (radians) for caldaym1 -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: plandunit(:) ! landunit index associated with each pft - integer , pointer :: ctype(:) ! column type - integer , pointer :: clandunit(:) ! landunit index associated with each column - integer, pointer :: pgridcell(:) ! gridcell associated with each pft - integer , pointer :: itypelun(:) ! landunit type - logical , pointer :: lakpoi(:) ! true => landunit is a lake point - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - integer , pointer :: frac_veg_nosno_alb(:) ! fraction of vegetation not covered by snow (0 OR 1) [-] - real(r8), pointer :: dayl(:) ! daylength (seconds) - real(r8), pointer :: latdeg(:) ! latitude (degrees) - integer , pointer :: pcolumn(:) ! index into column level quantities - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) -! -! local pointers to implicit out arguments -! - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: frac_sno(:) ! fraction of ground covered by snow (0 to 1) - integer , pointer :: frac_veg_nosno(:) ! fraction of vegetation not covered by snow (0 OR 1) [-] - real(r8), pointer :: fwet(:) ! fraction of canopy that is wet (0 to 1) (pft-level) - real(r8), pointer :: decl(:) ! solar declination angle (radians) -! -! local pointers to implicit out arguments (lake points only) -! - real(r8), pointer :: fdry(:) ! fraction of foliage that is green and dry [-] (new) - real(r8), pointer :: tlai(:) ! one-sided leaf area index, no burying by snow - real(r8), pointer :: tsai(:) ! one-sided stem area index, no burying by snow - real(r8), pointer :: htop(:) ! canopy top (m) - real(r8), pointer :: hbot(:) ! canopy bottom (m) - real(r8), pointer :: elai(:) ! one-sided leaf area index with burying by snow - real(r8), pointer :: esai(:) ! one-sided stem area index with burying by snow -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: nc,j,l,c,p,fc ! indices - integer :: nclumps ! number of clumps on this processor - integer :: begp, endp ! per-clump beginning and ending pft indices - integer :: begc, endc ! per-clump beginning and ending column indices - integer :: begl, endl ! per-clump beginning and ending landunit indices - integer :: begg, endg ! per-clump gridcell ending gridcell indices - integer :: ier ! MPI return code - real(r8):: lat ! latitude (radians) for daylength calculation - real(r8):: temp ! temporary variable for daylength - real(r8):: snowbd ! temporary calculation of snow bulk density (kg/m3) - real(r8):: fmelt ! snowbd/100 -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (landunit-level) - - lakpoi => lun%lakpoi - itypelun => lun%itype - - ! Assign local pointers to derived subtypes components (column-level) - - dz => cps%dz - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - h2osoi_vol => cws%h2osoi_vol - snowdp => cps%snowdp - h2osno => cws%h2osno - frac_sno => cps%frac_sno - ctype => col%itype - clandunit => col%landunit - soilpsi => cps%soilpsi - - ! Assign local pointers to derived subtypes components (pft-level) - - plandunit => pft%landunit - frac_veg_nosno_alb => pps%frac_veg_nosno_alb - frac_veg_nosno => pps%frac_veg_nosno - fwet => pps%fwet - - ! Assign local pointers to derived subtypes components (pft-level) - ! The folowing pointers will only be used for lake points in this routine - - htop => pps%htop - hbot => pps%hbot - tlai => pps%tlai - tsai => pps%tsai - elai => pps%elai - esai => pps%esai - fdry => pps%fdry - - decl => cps%decl - dayl => pepv%dayl - pcolumn => pft%column - pgridcell => pft%gridcell - latdeg => grc%latdeg - - ! ======================================================================== - ! Determine surface albedo - initialized by calls to ecosystem dynamics and - ! albedo subroutines. Note: elai, esai, frac_veg_nosno_alb are computed in - ! Ecosysdyn and needed by routines FracWet and SurfaceAlbedo and - ! frac_veg_nosno is needed by FracWet - ! fwet is needed in routine TwoStream (called by SurfaceAlbedo) - ! frac_sno is needed by SoilAlbedo (called by SurfaceAlbedo) - ! ======================================================================== - - if (.not. use_cn) then - ! the default mode uses prescribed vegetation structure - ! Read monthly vegetation data for interpolation to daily values - - call interpMonthlyVeg() - end if - - ! Determine clump bounds for this processor - - nclumps = get_proc_clumps() - - ! Loop over clumps on this processor -!$OMP PARALLEL DO PRIVATE (nc,p,j,l,c,fc,begg,endg,begl,endl,begc,endc,begp,endp,lat,temp,snowbd,fmelt) - do nc = 1,nclumps - - ! Determine clump bounds - - call get_clump_bounds(nc, begg, endg, begl, endl, begc, endc, begp, endp) - - ! Determine variables needed by SurfaceAlbedo for lake points - - do p = begp,endp - l = plandunit(p) - if (lakpoi(l)) then - fwet(p) = 0._r8 - fdry(p) = 0._r8 - elai(p) = 0._r8 - esai(p) = 0._r8 - htop(p) = 0._r8 - hbot(p) = 0._r8 - tlai(p) = 0._r8 - tsai(p) = 0._r8 - frac_veg_nosno_alb(p) = 0._r8 - frac_veg_nosno(p) = 0._r8 - end if - end do - - ! ============================================================================ - ! Ecosystem dynamics: Uses CN, or static parameterizations - ! ============================================================================ - - if (use_cn) then - do j = 1, nlevgrnd - do fc = 1, filter(nc)%num_soilc - c = filter(nc)%soilc(fc) - soilpsi(c,j) = -15.0_r8 - end do - end do - end if - - ! Determine variables needed for SurfaceAlbedo for non-lake points - - if (use_cn) then - ! CN initialization is done only on the soil landunits. - - if (.not. present(declinm1)) then - write(iulog,*)'declination for the previous timestep (declinm1) must be ',& - ' present as argument in CN mode' - call endrun() - end if - - ! it is necessary to initialize the solar declination for the previous - ! timestep (caldaym1) so that the CNphenology routines know if this is - ! before or after the summer solstice. - - ! declination for previous timestep - do c = begc, endc - l = clandunit(c) - if (itypelun(l) == istsoil .or. itypelun(l) == istcrop) then - decl(c) = declinm1 - end if - end do - - ! daylength for previous timestep - do p = begp, endp - c = pcolumn(p) - l = plandunit(p) - if (itypelun(l) == istsoil .or. itypelun(l) == istcrop) then - lat = latdeg(pgridcell(p)) * SHR_CONST_PI / 180._r8 - temp = -(sin(lat)*sin(decl(c)))/(cos(lat) * cos(decl(c))) - temp = min(1._r8,max(-1._r8,temp)) - dayl(p) = 2.0_r8 * 13750.9871_r8 * acos(temp) - end if - end do - - ! declination for current timestep - do c = begc, endc - l = clandunit(c) - if (itypelun(l) == istsoil .or. itypelun(l) == istcrop) then - decl(c) = declin - end if - end do - - call CNEcosystemDyn(begc, endc, begp, endp, filter(nc)%num_soilc, filter(nc)%soilc, & - filter(nc)%num_soilp, filter(nc)%soilp, & - filter(nc)%num_pcropp, filter(nc)%pcropp, doalb=.true.) - - else - - ! this is the default call if CN not set - - call EcosystemDyn(begp, endp, filter(nc)%num_nolakep, filter(nc)%nolakep, & - doalb=.true.) - end if - - do p = begp, endp - l = plandunit(p) - if (.not. lakpoi(l)) then - frac_veg_nosno(p) = frac_veg_nosno_alb(p) - fwet(p) = 0._r8 - end if - end do - - call FracWet(filter(nc)%num_nolakep, filter(nc)%nolakep) - - ! Compute Surface Albedo - all land points (including lake) other than urban - ! Needs as input fracion of soil covered by snow (Z.-L. Yang U. Texas) - - do c = begc, endc - l = clandunit(c) - if (itypelun(l) == isturb) then - ! From Bonan 1996 (LSM technical note) - frac_sno(c) = min( snowdp(c)/0.05_r8, 1._r8) - else - frac_sno(c) = 0._r8 - ! snow cover fraction as in Niu and Yang 2007 - if(snowdp(c) .gt. 0.0) then - snowbd = min(800._r8,h2osno(c)/snowdp(c)) !bulk density of snow (kg/m3) - fmelt = (snowbd/100.)**1. - ! 100 is the assumed fresh snow density; 1 is a melting factor that could be - ! reconsidered, optimal value of 1.5 in Niu et al., 2007 - frac_sno(c) = tanh( snowdp(c) /(2.5 * zlnd * fmelt) ) - endif - end if - end do - call SurfaceAlbedo(begg, endg, begc, endc, begp, endp, & - filter(nc)%num_nourbanc, filter(nc)%nourbanc, & - filter(nc)%num_nourbanp, filter(nc)%nourbanp, & - calday, declin) - - - ! Determine albedos for urban landunits - - if (filter(nc)%num_urbanl > 0) then - call UrbanAlbedo(nc, begl, endl, begc, endc, begp, endp, & - filter(nc)%num_urbanl, filter(nc)%urbanl, & - filter(nc)%num_urbanc, filter(nc)%urbanc, & - filter(nc)%num_urbanp, filter(nc)%urbanp ) - - end if - - end do ! end of loop over clumps -!$OMP END PARALLEL DO - - end subroutine initSurfalb - -end module initSurfalbMod diff --git a/src_clm40/main/lnd_comp_mct.F90 b/src_clm40/main/lnd_comp_mct.F90 deleted file mode 100644 index 80a46ba1f4..0000000000 --- a/src_clm40/main/lnd_comp_mct.F90 +++ /dev/null @@ -1,649 +0,0 @@ -module lnd_comp_mct - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Interface of the active land model component of CESM the CLM (Community Land Model) - ! with the main CESM driver. This is a thin interface taking CESM driver information - ! in MCT (Model Coupling Toolkit) format and converting it to use by CLM. - ! - ! !uses: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid - use decompmod , only : bounds_type, ldecomp - use lnd_import_export - ! - ! !public member functions: - implicit none - save - private ! by default make data private - ! - ! !public member functions: - public :: lnd_init_mct ! clm initialization - public :: lnd_run_mct ! clm run phase - public :: lnd_final_mct ! clm finalization/cleanup - ! - ! !private member functions: - private :: lnd_setgsmap_mct ! set the land model mct gs map - private :: lnd_domain_mct ! set the land model domain information - !--------------------------------------------------------------------------- - -contains - - !==================================================================================== - - subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize land surface model and obtain relevant atmospheric model arrays - ! back from (i.e. albedos, surface temperature and snow cover over land). - ! - ! !USES: - use shr_kind_mod , only : shr_kind_cl - use abortutils , only : endrun - use clm_time_manager , only : get_nstep, get_step_size, set_timemgr_init, & - set_nextsw_cday - use clm_atmlnd , only : clm_l2a - use clm_glclnd , only : clm_s2x - use clm_initializeMod, only : initialize1, initialize2 - use clm_varctl , only : finidat,single_column, clm_varctl_set, iulog, noland, & - inst_index, inst_suffix, inst_name - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use controlMod , only : control_setNL - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel, & - shr_file_getLogUnit, shr_file_getLogLevel, & - shr_file_getUnit, shr_file_setIO - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData - use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData, seq_infodata_PutData, & - seq_infodata_start_type_start, seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch - use seq_comm_mct , only : seq_comm_suffix, seq_comm_inst, seq_comm_name - use seq_flds_mod , only : seq_flds_x2l_fields, seq_flds_l2x_fields - use spmdMod , only : masterproc, spmd_init - use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch - use clm_cpl_indices , only : clm_cpl_indices_set - use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap_lsize - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock), intent(inout) :: EClock ! Input synchronization clock - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - type(mct_aVect), intent(inout) :: x2l_l, l2x_l ! land model import and export states - character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read - ! - ! !LOCAL VARIABLES: - integer :: LNDID ! Land identifyer - integer :: mpicom_lnd ! MPI communicator - type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map - type(mct_gGrid), pointer :: dom_l ! Land model domain - type(seq_infodata_type), pointer :: infodata ! CESM driver level info data - integer :: lsize ! size of attribute vector - integer :: g,i,j ! indices - integer :: dtime_sync ! coupling time-step from the input synchronization clock - integer :: dtime_clm ! clm time-step - logical :: exists ! true if file exists - logical :: atm_aero ! Flag if aerosol data sent from atm model - real(r8) :: scmlat ! single-column latitude - real(r8) :: scmlon ! single-column longitude - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - character(len=SHR_KIND_CL) :: caseid ! case identifier name - character(len=SHR_KIND_CL) :: ctitle ! case description title - character(len=SHR_KIND_CL) :: starttype ! start-type (startup, continue, branch, hybrid) - character(len=SHR_KIND_CL) :: calendar ! calendar type name - character(len=SHR_KIND_CL) :: hostname ! hostname of machine running on - character(len=SHR_KIND_CL) :: version ! Model version - character(len=SHR_KIND_CL) :: username ! user running the model - integer :: nsrest ! clm restart type - integer :: ref_ymd ! reference date (YYYYMMDD) - integer :: ref_tod ! reference time of day (sec) - integer :: start_ymd ! start date (YYYYMMDD) - integer :: start_tod ! start time of day (sec) - integer :: stop_ymd ! stop date (YYYYMMDD) - integer :: stop_tod ! stop time of day (sec) - logical :: brnch_retain_casename ! flag if should retain the case name on a branch start type - integer :: lbnum ! input to memory diagnostic - integer :: shrlogunit,shrloglev ! old values for log unit and log level - type(bounds_type) :: bounds ! bounds - character(len=32), parameter :: sub = 'lnd_init_mct' - character(len=*), parameter :: format = "('("//trim(sub)//") :',A)" - !----------------------------------------------------------------------- - - ! Set cdata data - - call seq_cdata_setptrs(cdata_l, ID=LNDID, mpicom=mpicom_lnd, & - gsMap=GSMap_lnd, dom=dom_l, infodata=infodata) - - ! Determine attriute vector indices - - call clm_cpl_indices_set() - - ! Initialize clm MPI communicator - - call spmd_init( mpicom_lnd, LNDID ) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_init_mct:start::',lbnum) - endif -#endif - - inst_name = seq_comm_name(LNDID) - inst_index = seq_comm_inst(LNDID) - inst_suffix = seq_comm_suffix(LNDID) - - ! Initialize io log unit - - call shr_file_getLogUnit (shrlogunit) - if (masterproc) then - inquire(file='lnd_modelio.nml'//trim(inst_suffix),exist=exists) - if (exists) then - iulog = shr_file_getUnit() - call shr_file_setIO('lnd_modelio.nml'//trim(inst_suffix),iulog) - end if - write(iulog,format) "CLM land model initialization" - else - iulog = shrlogunit - end if - - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Use infodata to set orbital values - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Consistency check on namelist filename - - call control_setNL("lnd_in"//trim(inst_suffix)) - - ! Initialize clm - ! initialize1 reads namelist, grid and surface data (need this to initialize gsmap) - ! initialize2 performs rest of initialization - - call seq_timemgr_EClockGetData(EClock, & - start_ymd=start_ymd, & - start_tod=start_tod, ref_ymd=ref_ymd, & - ref_tod=ref_tod, stop_ymd=stop_ymd, & - stop_tod=stop_tod, & - calendar=calendar ) - call seq_infodata_GetData(infodata, case_name=caseid, & - case_desc=ctitle, single_column=single_column, & - scmlat=scmlat, scmlon=scmlon, & - brnch_retain_casename=brnch_retain_casename, & - start_type=starttype, model_version=version, & - hostname=hostname, username=username ) - call set_timemgr_init( calendar_in=calendar, start_ymd_in=start_ymd, start_tod_in=start_tod, & - ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, stop_ymd_in=stop_ymd, & - stop_tod_in=stop_tod) - if ( trim(starttype) == trim(seq_infodata_start_type_start)) then - nsrest = nsrStartup - else if (trim(starttype) == trim(seq_infodata_start_type_cont) ) then - nsrest = nsrContinue - else if (trim(starttype) == trim(seq_infodata_start_type_brnch)) then - nsrest = nsrBranch - else - call endrun( sub//' ERROR: unknown starttype' ) - end if - - call clm_varctl_set(caseid_in=caseid, ctitle_in=ctitle, & - brnch_retain_casename_in=brnch_retain_casename, & - single_column_in=single_column, scmlat_in=scmlat, & - scmlon_in=scmlon, nsrest_in=nsrest, version_in=version, & - hostname_in=hostname, username_in=username) - - ! Read namelist, grid and surface data - - call initialize1( ) - - ! If no land then exit out of initialization - - if ( noland ) then - call seq_infodata_PutData( infodata, lnd_present =.false.) - call seq_infodata_PutData( infodata, lnd_prognostic=.false.) - return - end if - - ! Determine if aerosol and dust deposition come from atmosphere component - - call seq_infodata_GetData(infodata, atm_aero=atm_aero ) - if ( .not. atm_aero )then - call endrun( sub//' ERROR: atmosphere model MUST send aerosols to CLM' ) - end if - - ! Initialize clm gsMap, clm domain and clm attribute vectors - - call get_proc_bounds( bounds ) - - call lnd_SetgsMap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - lsize = mct_gsMap_lsize(gsMap_lnd, mpicom_lnd) - - call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) - - call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) - call mct_aVect_zero(x2l_l) - - call mct_aVect_init(l2x_l, rList=seq_flds_l2x_fields, lsize=lsize) - call mct_aVect_zero(l2x_l) - - ! Finish initializing clm - - call initialize2() - - ! Check that clm internal dtime aligns with clm coupling interval - - call seq_timemgr_EClockGetData(EClock, dtime=dtime_sync ) - dtime_clm = get_step_size() - if (masterproc) then - write(iulog,*)'dtime_sync= ',dtime_sync,& - ' dtime_clm= ',dtime_clm,' mod = ',mod(dtime_sync,dtime_clm) - end if - if (mod(dtime_sync,dtime_clm) /= 0) then - write(iulog,*)'clm dtime ',dtime_clm,' and Eclock dtime ',& - dtime_sync,' never align' - call endrun( sub//' ERROR: time out of sync' ) - end if - - ! Create land export state - - call lnd_export(bounds, clm_l2a, clm_s2x, l2x_l%rattr) - - ! Fill in infodata settings - - call seq_infodata_PutData(infodata, lnd_prognostic=.true.) - call seq_infodata_PutData(infodata, lnd_nx=ldomain%ni, lnd_ny=ldomain%nj) - - ! Get infodata info - - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - call set_nextsw_cday(nextsw_cday) - - ! Reset shr logging to original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - write(iulog,*) TRIM(Sub) // ':end::' - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_int_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - end subroutine lnd_init_mct - - !==================================================================================== - - subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Run clm model - ! - ! !USES: - use shr_kind_mod ,only : r8 => shr_kind_r8 - use clmtype - use clm_atmlnd ,only : clm_l2a, clm_a2l, a2l_not_downscaled_gcell - use clm_glclnd ,only : clm_s2x, clm_x2s - use clm_driver ,only : clm_drv - use clm_time_manager,only : get_curr_date, get_nstep, get_curr_calday, get_step_size, & - advance_timestep, set_nextsw_cday,update_rad_dtime - use decompMod ,only : get_proc_bounds - use abortutils ,only : endrun - use clm_varctl ,only : iulog - use clm_varorb ,only : eccen, obliqr, lambm0, mvelpp - use shr_file_mod ,only : shr_file_setLogUnit, shr_file_setLogLevel, & - shr_file_getLogUnit, shr_file_getLogLevel - use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn, & - seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use seq_infodata_mod,only : seq_infodata_type, seq_infodata_GetData - use spmdMod ,only : masterproc, mpicom - use perf_mod ,only : t_startf, t_stopf, t_barrierf - use shr_orb_mod ,only : shr_orb_decl - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - ! - ! !LOCAL VARIABLES: - integer :: ymd_sync ! Sync date (YYYYMMDD) - integer :: yr_sync ! Sync current year - integer :: mon_sync ! Sync current month - integer :: day_sync ! Sync current day - integer :: tod_sync ! Sync current time of day (sec) - integer :: ymd ! CLM current date (YYYYMMDD) - integer :: yr ! CLM current year - integer :: mon ! CLM current month - integer :: day ! CLM current day - integer :: tod ! CLM current time of day (sec) - integer :: dtime ! time step increment (sec) - integer :: nstep ! time step index - logical :: rstwr_sync ! .true. ==> write restart file before returning - logical :: rstwr ! .true. ==> write restart file before returning - logical :: nlend_sync ! Flag signaling last time-step - logical :: nlend ! .true. ==> last time-step - logical :: dosend ! true => send data back to driver - logical :: doalb ! .true. ==> do albedo calculation on this time step - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - real(r8) :: caldayp1 ! clm calday plus dtime offset - integer :: shrlogunit,shrloglev ! old values for share log unit and log level - integer :: lbnum ! input to memory diagnostic - integer :: g,i,lsize ! counters - real(r8) :: calday ! calendar day for nstep - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinp1 ! solar declination angle in radians for nstep+1 - real(r8) :: eccf ! earth orbit eccentricity factor - real(r8) :: recip ! reciprical - logical,save :: first_call = .true. ! first call work - type(seq_infodata_type),pointer :: infodata ! CESM information from the driver - type(mct_gGrid), pointer :: dom_l ! Land model domain data - type(bounds_type) :: bounds ! bounds - character(len=32) :: rdate ! date char string for restart file names - character(len=32), parameter :: sub = "lnd_run_mct" - !--------------------------------------------------------------------------- - - ! Determine processor bounds - - call get_proc_bounds(bounds) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:start::',lbnum) - endif -#endif - - ! Reset shr logging to my log file - call shr_file_getLogUnit (shrlogunit) - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Determine time of next atmospheric shortwave calculation - call seq_cdata_setptrs(cdata_l, infodata=infodata, dom=dom_l) - call seq_timemgr_EClockGetData(EClock, & - curr_ymd=ymd, curr_tod=tod_sync, & - curr_yr=yr_sync, curr_mon=mon_sync, curr_day=day_sync) - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - - call set_nextsw_cday( nextsw_cday ) - dtime = get_step_size() - - write(rdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr_sync,mon_sync,day_sync,tod_sync - nlend_sync = seq_timemgr_StopAlarmIsOn( EClock ) - rstwr_sync = seq_timemgr_RestartAlarmIsOn( EClock ) - - ! Map MCT to land data type - ! Perform downscaling if appropriate - - - ! Map to clm (only when state and/or fluxes need to be updated) - - call t_startf ('lc_lnd_import') - call lnd_import( bounds, x2l_l%rattr, clm_a2l, a2l_not_downscaled_gcell, clm_x2s) - call t_stopf ('lc_lnd_import') - - ! Use infodata to set orbital values if updated mid-run - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Loop over time steps in coupling interval - - dosend = .false. - do while(.not. dosend) - - ! Determine if dosend - ! When time is not updated at the beginning of the loop - then return only if - ! are in sync with clock before time is updated - - call get_curr_date( yr, mon, day, tod ) - ymd = yr*10000 + mon*100 + day - tod = tod - dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) - - ! Determine doalb based on nextsw_cday sent from atm model - - nstep = get_nstep() - caldayp1 = get_curr_calday(offset=dtime) - if (nstep == 0) then - doalb = .false. - else if (nstep == 1) then - doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) - else - doalb = (nextsw_cday >= -0.5_r8) - end if - call update_rad_dtime(doalb) - - ! Determine if time to write cam restart and stop - - rstwr = .false. - if (rstwr_sync .and. dosend) rstwr = .true. - nlend = .false. - if (nlend_sync .and. dosend) nlend = .true. - - ! Run clm - - call t_barrierf('sync_clm_run1', mpicom) - call t_startf ('clm_run') - call t_startf ('shr_orb_decl') - calday = get_curr_calday() - call shr_orb_decl( calday , eccen, mvelpp, lambm0, obliqr, declin , eccf ) - call shr_orb_decl( nextsw_cday, eccen, mvelpp, lambm0, obliqr, declinp1, eccf ) - call t_stopf ('shr_orb_decl') - call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate) - call t_stopf ('clm_run') - - ! Create l2x_l export state - add river runoff input to l2x_l if appropriate - - call t_startf ('lc_lnd_export') - call lnd_export(bounds, clm_l2a, clm_s2x, l2x_l%rattr) - call t_stopf ('lc_lnd_export') - - ! Advance clm time step - - call t_startf ('lc_clm2_adv_timestep') - call advance_timestep() - call t_stopf ('lc_clm2_adv_timestep') - - end do - - ! Check that internal clock is in sync with master clock - - call get_curr_date( yr, mon, day, tod, offset=-dtime ) - ymd = yr*10000 + mon*100 + day - tod = tod - if ( .not. seq_timemgr_EClockDateInSync( EClock, ymd, tod ) )then - call seq_timemgr_EclockGetData( EClock, curr_ymd=ymd_sync, curr_tod=tod_sync ) - write(iulog,*)' clm ymd=',ymd ,' clm tod= ',tod - write(iulog,*)'sync ymd=',ymd_sync,' sync tod= ',tod_sync - call endrun( sub//":: CLM clock not in sync with Master Sync clock" ) - end if - - ! Reset shr logging to my original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - first_call = .false. - - end subroutine lnd_run_mct - - !==================================================================================== - - subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Finalize land surface model - - use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn, & - seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use mct_mod - use esmf - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - !--------------------------------------------------------------------------- - - ! fill this in - end subroutine lnd_final_mct - - !==================================================================================== - - subroutine lnd_setgsmap_mct( bounds, mpicom_lnd, LNDID, gsMap_lnd ) - ! - ! !DESCRIPTION: - ! Set the MCT GS map for the land model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use domainMod , only : ldomain - use mct_mod , only : mct_gsMap, mct_gsMap_init - implicit none - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - integer , intent(in) :: mpicom_lnd ! MPI communicator for the clm land model - integer , intent(in) :: LNDID ! Land model identifyer number - type(mct_gsMap) , intent(out) :: gsMap_lnd ! Resulting MCT GS map for the land model - ! - ! !LOCAL VARIABLES: - integer,allocatable :: gindex(:) ! Number the local grid points - integer :: i, j, n, gi ! Indices - integer :: lsize,gsize ! GS Map size - integer :: ier ! Error code - !--------------------------------------------------------------------------- - - ! Build the land grid numbering for MCT - ! NOTE: Numbering scheme is: West to East and South to North - ! starting at south pole. Should be the same as what's used in SCRIP - - allocate(gindex(bounds%begg:bounds%endg),stat=ier) - - ! number the local grid - - do n = bounds%begg, bounds%endg - gindex(n) = ldecomp%gdc2glo(n) - end do - lsize = bounds%endg - bounds%begg + 1 - gsize = ldomain%ni * ldomain%nj - - call mct_gsMap_init( gsMap_lnd, gindex, mpicom_lnd, LNDID, lsize, gsize ) - - deallocate(gindex) - - end subroutine lnd_SetgsMap_mct - - !==================================================================================== - - subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) - ! - ! !DESCRIPTION: - ! Send the land model domain information to the coupler - ! - ! !USES: - use clm_varcon , only: re - use domainMod , only: ldomain - use spmdMod , only: iam - use mct_mod , only: mct_gGrid_importIAttr - use mct_mod , only: mct_gGrid_importRAttr, mct_gGrid_init, mct_gsMap_orderedPoints - use seq_flds_mod, only: seq_flds_dom_coord, seq_flds_dom_other - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: lsize ! land model domain data size - type(mct_gsMap), intent(inout) :: gsMap_l ! Output land model MCT GS map - type(mct_ggrid), intent(out) :: dom_l ! Output domain information for land model - ! - ! Local Variables - integer :: g,i,j ! index - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !--------------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - call mct_gGrid_init( GGrid=dom_l, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsMap_l, iam, idata) - call mct_gGrid_importIAttr(dom_l,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_l,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_l,"mask" ,data,lsize) - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_l,"lon",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_l,"lat",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_l,"area",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"mask",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine lnd_domain_mct - -end module lnd_comp_mct diff --git a/src_clm40/main/lnd_import_export.F90 b/src_clm40/main/lnd_import_export.F90 deleted file mode 100644 index 569e2ac51b..0000000000 --- a/src_clm40/main/lnd_import_export.F90 +++ /dev/null @@ -1,334 +0,0 @@ -module lnd_import_export - - use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl - use abortutils , only: endrun - use clm_atmlnd , only: lnd2atm_type - use clm_glclnd , only: lnd2glc_type - use decompmod , only: bounds_type - use clm_cpl_indices - use clmtype - implicit none - -contains - - !=============================================================================== - - subroutine lnd_import( bounds, x2l, a2l, a2l_not_downscaled_gcell, x2s) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the input data from the coupler to the land model - ! - ! !USES: - use clm_atmlnd , only: atm2lnd_type, atm2lnd_downscaled_fields_type - use clm_glclnd , only: glc2lnd_type - use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13, create_glacier_mec_landunit - use clm_varcon , only: rair, o2_molar_const, c13ratio - use shr_const_mod , only: SHR_CONST_TKFRZ - use domainMod , only: ldomain - implicit none - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - real(r8) , intent(in) :: x2l(:,:) ! driver import state to land model - type(atm2lnd_type) , intent(inout) :: a2l ! clm internal input data type - type(atm2lnd_downscaled_fields_type) , intent(inout) :: a2l_not_downscaled_gcell ! clm internal input data type - type(glc2lnd_type) , intent(inout) :: x2s ! clm internal input data type - ! - ! !LOCAL VARIABLES: - integer :: g,i,nstep,ier ! indices, number of steps, and error code - real(r8) :: forc_rainc ! rainxy Atm flux mm/s - real(r8) :: e ! vapor pressure (Pa) - real(r8) :: qsat ! saturation specific humidity (kg/kg) - real(r8) :: forc_t ! atmospheric temperature (Kelvin) - real(r8) :: forc_q ! atmospheric specific humidity (kg/kg) - real(r8) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) :: forc_rainl ! rainxy Atm flux mm/s - real(r8) :: forc_snowc ! snowfxy Atm flux mm/s - real(r8) :: forc_snowl ! snowfxl Atm flux mm/s - real(r8) :: co2_ppmv_diag ! temporary - real(r8) :: co2_ppmv_prog ! temporary - real(r8) :: co2_ppmv_val ! temporary - integer :: co2_type_idx ! integer flag for co2_type options - real(r8) :: esatw ! saturation vapor pressure over water (Pa) - real(r8) :: esati ! saturation vapor pressure over ice (Pa) - real(r8) :: a0,a1,a2,a3,a4,a5,a6 ! coefficients for esat over water - real(r8) :: b0,b1,b2,b3,b4,b5,b6 ! coefficients for esat over ice - real(r8) :: tdc, t ! Kelvins to Celcius function and its input - integer :: num ! counter - character(len=32), parameter :: sub = 'lnd_import_mct' - - ! Constants to compute vapor pressure - parameter (a0=6.107799961_r8 , a1=4.436518521e-01_r8, & - a2=1.428945805e-02_r8, a3=2.650648471e-04_r8, & - a4=3.031240396e-06_r8, a5=2.034080948e-08_r8, & - a6=6.136820929e-11_r8) - - parameter (b0=6.109177956_r8 , b1=5.034698970e-01_r8, & - b2=1.886013408e-02_r8, b3=4.176223716e-04_r8, & - b4=5.824720280e-06_r8, b5=4.838803174e-08_r8, & - b6=1.838826904e-10_r8) - ! - ! function declarations - ! - tdc(t) = min( 50._r8, max(-50._r8,(t-SHR_CONST_TKFRZ)) ) - esatw(t) = 100._r8*(a0+t*(a1+t*(a2+t*(a3+t*(a4+t*(a5+t*a6)))))) - esati(t) = 100._r8*(b0+t*(b1+t*(b2+t*(b3+t*(b4+t*(b5+t*b6)))))) - !--------------------------------------------------------------------------- - - co2_type_idx = 0 - if (co2_type == 'prognostic') then - co2_type_idx = 1 - else if (co2_type == 'diagnostic') then - co2_type_idx = 2 - end if - if (co2_type == 'prognostic' .and. index_x2l_Sa_co2prog == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2prog for co2_type equal to prognostic' ) - else if (co2_type == 'diagnostic' .and. index_x2l_Sa_co2diag == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2diag for co2_type equal to diagnostic' ) - end if - - ! Note that the precipitation fluxes received from the coupler - ! are in units of kg/s/m^2. To convert these precipitation rates - ! in units of mm/sec, one must divide by 1000 kg/m^3 and multiply - ! by 1000 mm/m resulting in an overall factor of unity. - ! Below the units are therefore given in mm/s. - - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - - ! Determine flooding input, sign convention is positive downward and - ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, - ! change the sign to indicate addition of water to system. - - a2l%forc_flood(g) = -x2l(index_x2l_Flrr_flood,i) - - a2l%volr(g) = x2l(index_x2l_Flrr_volr,i) * (ldomain%area(g) * 1.e6_r8) - a2l%volrmch(g)= x2l(index_x2l_Flrr_volrmch,i) * (ldomain%area(g) * 1.e6_r8) - - ! Determine required receive fields - - a2l%forc_hgt(g) = x2l(index_x2l_Sa_z,i) ! zgcmxy Atm state m - a2l%forc_u(g) = x2l(index_x2l_Sa_u,i) ! forc_uxy Atm state m/s - a2l%forc_v(g) = x2l(index_x2l_Sa_v,i) ! forc_vxy Atm state m/s - a2l%forc_solad(g,2) = x2l(index_x2l_Faxa_swndr,i) ! forc_sollxy Atm flux W/m^2 - a2l%forc_solad(g,1) = x2l(index_x2l_Faxa_swvdr,i) ! forc_solsxy Atm flux W/m^2 - a2l%forc_solai(g,2) = x2l(index_x2l_Faxa_swndf,i) ! forc_solldxy Atm flux W/m^2 - a2l%forc_solai(g,1) = x2l(index_x2l_Faxa_swvdf,i) ! forc_solsdxy Atm flux W/m^2 - - a2l_not_downscaled_gcell%forc_th(g) = x2l(index_x2l_Sa_ptem,i) ! forc_thxy Atm state K - a2l_not_downscaled_gcell%forc_q(g) = x2l(index_x2l_Sa_shum,i) ! forc_qxy Atm state kg/kg - a2l_not_downscaled_gcell%forc_pbot(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa - a2l_not_downscaled_gcell%forc_t(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K - a2l_not_downscaled_gcell%forc_lwrad(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 - - forc_rainc = x2l(index_x2l_Faxa_rainc,i) ! mm/s - forc_rainl = x2l(index_x2l_Faxa_rainl,i) ! mm/s - forc_snowc = x2l(index_x2l_Faxa_snowc,i) ! mm/s - forc_snowl = x2l(index_x2l_Faxa_snowl,i) ! mm/s - - ! atmosphere coupling, for prognostic/prescribed aerosols - a2l%forc_aer(g,1) = x2l(index_x2l_Faxa_bcphidry,i) - a2l%forc_aer(g,2) = x2l(index_x2l_Faxa_bcphodry,i) - a2l%forc_aer(g,3) = x2l(index_x2l_Faxa_bcphiwet,i) - a2l%forc_aer(g,4) = x2l(index_x2l_Faxa_ocphidry,i) - a2l%forc_aer(g,5) = x2l(index_x2l_Faxa_ocphodry,i) - a2l%forc_aer(g,6) = x2l(index_x2l_Faxa_ocphiwet,i) - a2l%forc_aer(g,7) = x2l(index_x2l_Faxa_dstwet1,i) - a2l%forc_aer(g,8) = x2l(index_x2l_Faxa_dstdry1,i) - a2l%forc_aer(g,9) = x2l(index_x2l_Faxa_dstwet2,i) - a2l%forc_aer(g,10) = x2l(index_x2l_Faxa_dstdry2,i) - a2l%forc_aer(g,11) = x2l(index_x2l_Faxa_dstwet3,i) - a2l%forc_aer(g,12) = x2l(index_x2l_Faxa_dstdry3,i) - a2l%forc_aer(g,13) = x2l(index_x2l_Faxa_dstwet4,i) - a2l%forc_aer(g,14) = x2l(index_x2l_Faxa_dstdry4,i) - - ! Determine optional receive fields - - if (index_x2l_Sa_co2prog /= 0) then - co2_ppmv_prog = x2l(index_x2l_Sa_co2prog,i) ! co2 atm state prognostic - else - co2_ppmv_prog = co2_ppmv - end if - - if (index_x2l_Sa_co2diag /= 0) then - co2_ppmv_diag = x2l(index_x2l_Sa_co2diag,i) ! co2 atm state diagnostic - else - co2_ppmv_diag = co2_ppmv - end if - - if (index_x2l_Sa_methane /= 0) then - a2l%forc_pch4(g) = x2l(index_x2l_Sa_methane,i) - endif - - ! Determine derived quantities for required fields - - forc_t = a2l_not_downscaled_gcell%forc_t(g) - forc_q = a2l_not_downscaled_gcell%forc_q(g) - forc_pbot = a2l_not_downscaled_gcell%forc_pbot(g) - - a2l%forc_hgt_u(g) = a2l%forc_hgt(g) !observational height of wind [m] - a2l%forc_hgt_t(g) = a2l%forc_hgt(g) !observational height of temperature [m] - a2l%forc_hgt_q(g) = a2l%forc_hgt(g) !observational height of humidity [m] - a2l%forc_vp(g) = forc_q * forc_pbot & - / (0.622_r8 + 0.378_r8 * forc_q) - a2l_not_downscaled_gcell%forc_rho(g) = (forc_pbot - 0.378_r8 * a2l%forc_vp(g)) & - / (rair * forc_t) - a2l%forc_po2(g) = o2_molar_const * forc_pbot - a2l%forc_wind(g) = sqrt(a2l%forc_u(g)**2 + a2l%forc_v(g)**2) - a2l%forc_solar(g) = a2l%forc_solad(g,1) + a2l%forc_solai(g,1) + & - a2l%forc_solad(g,2) + a2l%forc_solai(g,2) - - a2l_not_downscaled_gcell%forc_rain(g) = forc_rainc + forc_rainl - a2l_not_downscaled_gcell%forc_snow(g) = forc_snowc + forc_snowl - - if (forc_t > SHR_CONST_TKFRZ) then - e = esatw(tdc(forc_t)) - else - e = esati(tdc(forc_t)) - end if - qsat = 0.622_r8*e / (forc_pbot - 0.378_r8*e) - a2l%forc_rh(g) = 100.0_r8*(forc_q / qsat) - ! Make sure relative humidity is properly bounded - ! a2l%forc_rh(g) = min( 100.0_r8, a2l%forc_rh(g) ) - ! a2l%forc_rh(g) = max( 0.0_r8, a2l%forc_rh(g) ) - - ! Determine derived quantities for optional fields - ! Note that the following does unit conversions from ppmv to partial pressures (Pa) - ! Note that forc_pbot is in Pa - - if (co2_type_idx == 1) then - co2_ppmv_val = co2_ppmv_prog - else if (co2_type_idx == 2) then - co2_ppmv_val = co2_ppmv_diag - else - co2_ppmv_val = co2_ppmv - end if - a2l%forc_pco2(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot - if (use_c13) then - a2l%forc_pc13o2(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot - end if - - ! glc coupling - - if (create_glacier_mec_landunit) then - do num = 0,glc_nec - x2s%frac(g,num) = x2l(index_x2l_Sg_ice_covered(num),i) - x2s%topo(g,num) = x2l(index_x2l_Sg_topo(num),i) - x2s%hflx(g,num) = x2l(index_x2l_Flgg_hflx(num),i) - end do - x2s%icemask(g) = x2l(index_x2l_Sg_icemask,i) - end if - - end do - - end subroutine lnd_import - - !=============================================================================== - - subroutine lnd_export( bounds, clm_l2a, clm_s2x, l2x) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the data to be sent from the clm model to the coupler - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : iulog, create_glacier_mec_landunit - use clm_time_manager , only : get_nstep, get_step_size - use seq_drydep_mod , only : n_drydep - use shr_megan_mod , only : shr_megan_mechcomps_n - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - type(lnd2atm_type), intent(inout) :: clm_l2a ! clm land to atmosphere exchange data type - type(lnd2glc_type), intent(inout) :: clm_s2x ! clm land to atmosphere exchange data type - real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid - ! - ! !LOCAL VARIABLES: - integer :: g,i ! indices - integer :: ier ! error status - integer :: nstep ! time step index - integer :: dtime ! time step - integer :: num ! counter - !--------------------------------------------------------------------------- - - ! cesm sign convention is that fluxes are positive downward - - l2x(:,:) = 0.0_r8 - - do g = bounds%begg,bounds%endg - i = 1 + (g-bounds%begg) - l2x(index_l2x_Sl_t,i) = clm_l2a%t_rad(g) - l2x(index_l2x_Sl_snowh,i) = clm_l2a%h2osno(g) - l2x(index_l2x_Sl_avsdr,i) = clm_l2a%albd(g,1) - l2x(index_l2x_Sl_anidr,i) = clm_l2a%albd(g,2) - l2x(index_l2x_Sl_avsdf,i) = clm_l2a%albi(g,1) - l2x(index_l2x_Sl_anidf,i) = clm_l2a%albi(g,2) - l2x(index_l2x_Sl_tref,i) = clm_l2a%t_ref2m(g) - l2x(index_l2x_Sl_qref,i) = clm_l2a%q_ref2m(g) - l2x(index_l2x_Sl_u10,i) = clm_l2a%u_ref10m(g) - l2x(index_l2x_Fall_taux,i) = -clm_l2a%taux(g) - l2x(index_l2x_Fall_tauy,i) = -clm_l2a%tauy(g) - l2x(index_l2x_Fall_lat,i) = -clm_l2a%eflx_lh_tot(g) - l2x(index_l2x_Fall_sen,i) = -clm_l2a%eflx_sh_tot(g) - l2x(index_l2x_Fall_lwup,i) = -clm_l2a%eflx_lwrad_out(g) - l2x(index_l2x_Fall_evap,i) = -clm_l2a%qflx_evap_tot(g) - l2x(index_l2x_Fall_swnet,i) = clm_l2a%fsa(g) - if (index_l2x_Fall_fco2_lnd /= 0) then - l2x(index_l2x_Fall_fco2_lnd,i) = -clm_l2a%nee(g) - end if - - ! Additional fields for DUST, PROGSSLT, dry-deposition and VOC - ! These are now standard fields, but the check on the index makes sure the driver handles them - if (index_l2x_Sl_ram1 /= 0 ) l2x(index_l2x_Sl_ram1,i) = clm_l2a%ram1(g) - if (index_l2x_Sl_fv /= 0 ) l2x(index_l2x_Sl_fv,i) = clm_l2a%fv(g) - if (index_l2x_Sl_soilw /= 0 ) l2x(index_l2x_Sl_soilw,i) = clm_l2a%h2osoi_vol(g,1) - if (index_l2x_Fall_flxdst1 /= 0 ) l2x(index_l2x_Fall_flxdst1,i)= -clm_l2a%flxdst(g,1) - if (index_l2x_Fall_flxdst2 /= 0 ) l2x(index_l2x_Fall_flxdst2,i)= -clm_l2a%flxdst(g,2) - if (index_l2x_Fall_flxdst3 /= 0 ) l2x(index_l2x_Fall_flxdst3,i)= -clm_l2a%flxdst(g,3) - if (index_l2x_Fall_flxdst4 /= 0 ) l2x(index_l2x_Fall_flxdst4,i)= -clm_l2a%flxdst(g,4) - - - ! for dry dep velocities - if (index_l2x_Sl_ddvel /= 0 ) then - l2x(index_l2x_Sl_ddvel:index_l2x_Sl_ddvel+n_drydep-1,i) = & - clm_l2a%ddvel(g,:n_drydep) - end if - - ! for MEGAN VOC emis fluxes - if (index_l2x_Fall_flxvoc /= 0 ) then - l2x(index_l2x_Fall_flxvoc:index_l2x_Fall_flxvoc+shr_megan_mechcomps_n-1,i) = & - -clm_l2a%flxvoc(g,:shr_megan_mechcomps_n) - end if - - if (index_l2x_Fall_methane /= 0) then - l2x(index_l2x_Fall_methane,i) = -clm_l2a%flux_ch4(g) - endif - - ! sign convention is positive downward with - ! hierarchy of atm/glc/lnd/rof/ice/ocn. so water sent from land to rof is positive - - l2x(index_l2x_Flrl_rofsur,i) = clm_l2a%rofliq(g) - l2x(index_l2x_Flrl_rofgwl,i) = 0.0_r8 - l2x(index_l2x_Flrl_rofsub,i) = 0.0_r8 - l2x(index_l2x_Flrl_rofdto,i) = 0.0_r8 - l2x(index_l2x_Flrl_rofi,i) = clm_l2a%rofice(g) - - ! glc coupling - - if (create_glacier_mec_landunit) then - do num = 0,glc_nec - l2x(index_l2x_Sl_tsrf(num),i) = clm_s2x%tsrf(g,num) - l2x(index_l2x_Sl_topo(num),i) = clm_s2x%topo(g,num) - l2x(index_l2x_Flgl_qice(num),i) = clm_s2x%qice(g,num) - end do - end if - - end do - - end subroutine lnd_export - -end module lnd_import_export diff --git a/src_clm40/main/mkarbinitMod.F90 b/src_clm40/main/mkarbinitMod.F90 deleted file mode 100644 index 6df966a2b9..0000000000 --- a/src_clm40/main/mkarbinitMod.F90 +++ /dev/null @@ -1,762 +0,0 @@ -module mkarbinitMod -!--------------------------------------------------------------------------- -!BOP -! -! !MODULE: mkarbinitMod -! -! !DESCRIPTION: -! -! -!--------------------------------------------------------------------------- - -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : iulog, use_cn, use_cndv, & - use_vancouver, use_mexicocity - use shr_sys_mod , only : shr_sys_flush - use spmdMod , only : masterproc - - implicit none - - SAVE - private ! By default make data private - -! !PUBLIC MEMBER FUNCTIONS: - - public mkarbinit ! Make arbitrary initial conditions - -!EOP -!----------------------------------------------------------------------- -contains -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: mkarbinit -! -! !INTERFACE: - subroutine mkarbinit() -! -! !DESCRIPTION: -! Initializes the following time varying variables: -! water : h2osno, h2ocan, h2osoi_liq, h2osoi_ice, h2osoi_vol -! snow : snowdp, snl, dz, z, zi -! temperature: t_soisno, t_veg, t_grnd -! -! !USES: - use shr_const_mod, only : SHR_CONST_TKFRZ - use clmtype - use clm_varpar , only : nlevsoi, nlevgrnd, nlevsno, nlevlak, nlevurb - use clm_varcon , only : bdsno, istice, istwet, istsoil, isturb, & - denice, denh2o, spval, sb, icol_road_perv, & - icol_road_imperv, icol_roof, icol_sunwall, & - icol_shadewall - use clm_varcon , only : istcrop - use clm_varcon , only : istice_mec, h2osno_max - use clm_varctl , only : iulog - use spmdMod , only : masterproc - use decompMod , only : get_proc_bounds - use SNICARMod , only : snw_rds_min - -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! 3/07/08 Keith Oleson: initialize h2osoi_vol for all soil layers to 0.3 -! 3/18/08 David Lawrence, initialize deep layers -! 03/28/08 Mark Flanner, initialize snow aerosols and grain size -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: pcolumn(:) ! column index associated with each pft - integer , pointer :: ctype(:) ! column type - integer , pointer :: clandunit(:) ! landunit index associated with each column - integer , pointer :: ltype(:) ! landunit type - logical , pointer :: lakpoi(:) ! true => landunit is a lake point - integer , pointer :: plandunit(:) ! landunit index associated with each pft - logical , pointer :: urbpoi(:) ! true => landunit is an urban point - logical , pointer :: ifspecial(:) ! true => landunit is not vegetated - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) - real(r8), pointer :: watsat(:,:) ! volumetric soil water at saturation (porosity) (nlevgrnd) - real(r8), pointer :: h2osoi_ice(:,:) ! ice lens (kg/m2) - real(r8), pointer :: h2osoi_liq(:,:) ! liquid water (kg/m2) - real(r8), pointer :: bsw2(:,:) ! Clapp and Hornberger "b" for CN code - real(r8), pointer :: psisat(:,:) ! soil water potential at saturation for CN code (MPa) - real(r8), pointer :: vwcsat(:,:) ! volumetric water content at saturation for CN code (m3/m3) - real(r8), pointer :: zi(:,:) ! interface level below a "z" level (m) - real(r8), pointer :: wa(:) ! water in the unconfined aquifer (mm) - real(r8), pointer :: wt(:) ! total water storage (unsaturated soil water + groundwater) (mm) - real(r8), pointer :: zwt(:) ! water table depth (m) - real(r8), pointer :: qflx_snow_melt(:) ! snow melt (net) -! -! local pointers to implicit out arguments -! - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: t_soisno(:,:) ! soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) - real(r8), pointer :: t_lake(:,:) ! lake temperature (Kelvin) (1:nlevlak) - real(r8), pointer :: t_grnd(:) ! ground temperature (Kelvin) - real(r8), pointer :: t_veg(:) ! vegetation temperature (Kelvin) - real(r8), pointer :: t_ref2m(:) ! 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_u(:) ! Urban 2 m height surface air temperature (Kelvin) - real(r8), pointer :: t_ref2m_r(:) ! Rural 2 m height surface air temperature (Kelvin) - real(r8), pointer :: h2osoi_vol(:,:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), pointer :: h2ocan_col(:) ! canopy water (mm H2O) (column-level) - real(r8), pointer :: h2ocan_pft(:) ! canopy water (mm H2O) (pft-level) - real(r8), pointer :: h2osno(:) ! snow water (mm H2O) - real(r8), pointer :: snowdp(:) ! snow height (m) - real(r8), pointer :: qflx_irrig(:) ! irrigation flux (mm H2O/s) - real(r8), pointer :: eflx_lwrad_out(:) ! emitted infrared (longwave) radiation (W/m**2) - real(r8), pointer :: soilpsi(:,:) ! soil water potential in each soil layer (MPa) - real(r8), pointer :: snw_rds(:,:) ! effective snow grain radius (col,lyr) [microns, m^-6] - real(r8), pointer :: snw_rds_top(:) ! snow grain size, top (col) [microns] - real(r8), pointer :: sno_liq_top(:) ! liquid water fraction (mass) in top snow layer (col) [frc] - real(r8), pointer :: mss_bcpho(:,:) ! mass of hydrophobic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bcphi(:,:) ! mass of hydrophillic BC in snow (col,lyr) [kg] - real(r8), pointer :: mss_bctot(:,:) ! total mass of BC (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_bc_col(:) ! total mass of BC in snow column (col) [kg] - real(r8), pointer :: mss_bc_top(:) ! total mass of BC in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_bcphi(:,:) ! mass concentration of BC species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_bcpho(:,:) ! mass concentration of BC species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_ocpho(:,:) ! mass of hydrophobic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_ocphi(:,:) ! mass of hydrophillic OC in snow (col,lyr) [kg] - real(r8), pointer :: mss_octot(:,:) ! total mass of OC (pho+phi) (col,lyr) [kg] - real(r8), pointer :: mss_oc_col(:) ! total mass of OC in snow column (col) [kg] - real(r8), pointer :: mss_oc_top(:) ! total mass of OC in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_ocphi(:,:) ! mass concentration of OC species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_ocpho(:,:) ! mass concentration of OC species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_dst1(:,:) ! mass of dust species 1 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst2(:,:) ! mass of dust species 2 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst3(:,:) ! mass of dust species 3 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst4(:,:) ! mass of dust species 4 in snow (col,lyr) [kg] - real(r8), pointer :: mss_dsttot(:,:) ! total mass of dust in snow (col,lyr) [kg] - real(r8), pointer :: mss_dst_col(:) ! total mass of dust in snow column (col) [kg] - real(r8), pointer :: mss_dst_top(:) ! total mass of dust in top snow layer (col) [kg] - real(r8), pointer :: mss_cnc_dst1(:,:) ! mass concentration of dust species 1 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst2(:,:) ! mass concentration of dust species 2 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst3(:,:) ! mass concentration of dust species 3 (col,lyr) [kg/kg] - real(r8), pointer :: mss_cnc_dst4(:,:) ! mass concentration of dust species 4 (col,lyr) [kg/kg] - real(r8), pointer :: irrig_rate(:) ! current irrigation rate [mm/s] - integer, pointer :: n_irrig_steps_left(:) ! number of time steps for which we still need to irrigate today (if 0, ignore irrig_rate) - -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: j,l,c,p ! indices - integer :: nlevs ! number of levels - integer :: begp, endp ! per-proc beginning and ending pft indices - integer :: begc, endc ! per-proc beginning and ending column indices - integer :: begl, endl ! per-proc beginning and ending landunit indices - integer :: begg, endg ! per-proc gridcell ending gridcell indices - real(r8):: vwc,psi ! for calculating soilpsi -!----------------------------------------------------------------------- - - if ( masterproc )then - write(iulog,*) 'Setting initial data to non-spun up values' - end if - - ! Assign local pointers to derived subtypes components (landunit-level) - - ltype => lun%itype - lakpoi => lun%lakpoi - ifspecial => lun%ifspecial - urbpoi => lun%urbpoi - - ! Assign local pointers to derived subtypes components (column-level) - - ctype => col%itype - clandunit => col%landunit - snl => cps%snl - dz => cps%dz - watsat => cps%watsat - bsw2 => cps%bsw2 - vwcsat => cps%vwcsat - psisat => cps%psisat - soilpsi => cps%soilpsi - h2osoi_ice => cws%h2osoi_ice - h2osoi_liq => cws%h2osoi_liq - h2osoi_vol => cws%h2osoi_vol - h2ocan_col => pws_a%h2ocan - qflx_irrig => cwf%qflx_irrig - qflx_snow_melt => cwf%qflx_snow_melt - snowdp => cps%snowdp - h2osno => cws%h2osno - t_soisno => ces%t_soisno - t_lake => ces%t_lake - t_grnd => ces%t_grnd - zi => cps%zi - wa => cws%wa - wt => cws%wt - zwt => cws%zwt - snw_rds => cps%snw_rds - snw_rds_top => cps%snw_rds_top - sno_liq_top => cps%sno_liq_top - mss_bcpho => cps%mss_bcpho - mss_bcphi => cps%mss_bcphi - mss_bctot => cps%mss_bctot - mss_bc_col => cps%mss_bc_col - mss_bc_top => cps%mss_bc_top - mss_cnc_bcphi => cps%mss_cnc_bcphi - mss_cnc_bcpho => cps%mss_cnc_bcpho - mss_ocpho => cps%mss_ocpho - mss_ocphi => cps%mss_ocphi - mss_octot => cps%mss_octot - mss_oc_col => cps%mss_oc_col - mss_oc_top => cps%mss_oc_top - mss_cnc_ocphi => cps%mss_cnc_ocphi - mss_cnc_ocpho => cps%mss_cnc_ocpho - mss_dst1 => cps%mss_dst1 - mss_dst2 => cps%mss_dst2 - mss_dst3 => cps%mss_dst3 - mss_dst4 => cps%mss_dst4 - mss_dsttot => cps%mss_dsttot - mss_dst_col => cps%mss_dst_col - mss_dst_top => cps%mss_dst_top - mss_cnc_dst1 => cps%mss_cnc_dst1 - mss_cnc_dst2 => cps%mss_cnc_dst2 - mss_cnc_dst3 => cps%mss_cnc_dst3 - mss_cnc_dst4 => cps%mss_cnc_dst4 - n_irrig_steps_left => cps%n_irrig_steps_left - irrig_rate => cps%irrig_rate - - ! Assign local pointers to derived subtypes components (pft-level) - - pcolumn => pft%column - h2ocan_pft => pws%h2ocan - t_veg => pes%t_veg - t_ref2m => pes%t_ref2m - t_ref2m_u => pes%t_ref2m_u - t_ref2m_r => pes%t_ref2m_r - plandunit => pft%landunit - eflx_lwrad_out => pef%eflx_lwrad_out - - ! Determine subgrid bounds on this processor - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! NOTE: h2ocan, h2osno, and snowdp has valid values everywhere - ! canopy water (pft level) - - do p = begp, endp - h2ocan_pft(p) = 0._r8 - - ! added for canopy water mass balance under dynamic pft weights - !pps%tlai(p) = 0._r8 - !pps%tsai(p) = 0._r8 - !pps%elai(p) = 0._r8 - !pps%esai(p) = 0._r8 - !pps%htop(p) = 0._r8 - !pps%hbot(p) = 0._r8 - !pps%frac_veg_nosno_alb(p) = 0._r8 - end do - - do c = begc,endc - - ! canopy water (column level) - - h2ocan_col(c) = 0._r8 - qflx_snow_melt(c) = 0._r8 - - ! snow water - - l = clandunit(c) - - ! Note: Glacier_mec columns are initialized with half the maximum snow cover. - ! This gives more realistic values of qflx_glcice sooner in the simulation - ! for columns with net ablation, at the cost of delaying ice formation - ! in columns with net accumulation. - if (ltype(l)==istice) then - h2osno(c) = h2osno_max - elseif (ltype(l)==istice_mec) then - h2osno(c) = 0.5_r8 * h2osno_max ! 50 cm if h2osno_max = 1 m - else - h2osno(c) = 0._r8 - endif - - ! snow depth - - snowdp(c) = h2osno(c) / bdsno - - ! Initialize Irrigation to zero - if (ltype(l)==istsoil) then - n_irrig_steps_left(c) = 0 - irrig_rate(c) = 0.0_r8 - end if - - end do - - ! Set snow layer number, depth and thickiness - - call snowdp2lev(begc, endc) - - ! Set snow/soil temperature, note: - ! t_soisno only has valid values over non-lake - ! t_lake only has valid values over lake - ! t_grnd has valid values over all land - ! t_veg has valid values over all land - - ! NOTE: THESE MEMORY COPIES ARE INEFFICIENT -- SINCE nlev LOOP IS NESTED FIRST!!!! - do c = begc,endc - - t_soisno(c,-nlevsno+1:nlevgrnd) = spval - t_lake(c,1:nlevlak) = spval - - l = clandunit(c) - if (.not. lakpoi(l)) then !not lake - t_soisno(c,-nlevsno+1:0) = spval - if (snl(c) < 0) then !snow layer temperatures - do j = snl(c)+1, 0 - t_soisno(c,j) = 250._r8 - enddo - endif - if (ltype(l)==istice .or. ltype(l)==istice_mec) then - do j = 1, nlevgrnd - t_soisno(c,j) = 250._r8 - - end do - else if (ltype(l) == istwet) then - do j = 1, nlevgrnd - t_soisno(c,j) = 277._r8 - end do - else if (ltype(l) == isturb) then - if (use_vancouver) then - if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - ! Set road top layer to initial air temperature and interpolate other - ! layers down to 20C in bottom layer - do j = 1, nlevurb - t_soisno(c,j) = 297.56 - (j-1) * ((297.56-293.16)/(nlevurb-1)) - end do - ! Set wall and roof layers to initial air temperature - else if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall .or. ctype(c) == icol_roof) then - do j = 1, nlevurb - t_soisno(c,j) = 297.56 - end do - else - do j = 1, nlevurb - t_soisno(c,j) = 283._r8 - end do - end if - else if (use_mexicocity) then - if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - ! Set road top layer to initial air temperature and interpolate other - ! layers down to 22C in bottom layer - do j = 1, nlevurb - t_soisno(c,j) = 289.46 - (j-1) * ((289.46-295.16)/(nlevurb-1)) - end do - else if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall .or. ctype(c) == icol_roof) then - ! Set wall and roof layers to initial air temperature - do j = 1, nlevurb - t_soisno(c,j) = 289.46 - end do - else - do j = 1, nlevurb - t_soisno(c,j) = 283._r8 - end do - end if - else - if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - do j = 1, nlevurb - t_soisno(c,j) = 274._r8 - end do - else if (ctype(c) == icol_sunwall .or. ctype(c) == icol_shadewall .or. ctype(c) == icol_roof) then - ! Set sunwall, shadewall, roof to fairly high temperature to avoid initialization - ! shock from large heating/air conditioning flux - do j = 1, nlevurb - t_soisno(c,j) = 292._r8 - end do - end if - end if - else - do j = 1, nlevgrnd - t_soisno(c,j) = 274._r8 - end do - endif - t_grnd(c) = t_soisno(c,snl(c)+1) - else !lake - t_lake(c,1:nlevlak) = 277._r8 - t_grnd(c) = t_lake(c,1) - endif - - end do - - do p = begp, endp - c = pcolumn(p) - l = plandunit(p) - - ! Initialize Irrigation to zero - if (ltype(l)==istsoil) then - qflx_irrig(c) = 0.0_r8 - end if - - if (use_vancouver) then - t_veg(p) = 297.56 - t_ref2m(p) = 297.56 - if (urbpoi(l)) then - t_ref2m_u(p) = 297.56 - else - t_ref2m_u(p) = spval - end if - if (ifspecial(l)) then - t_ref2m_r(p) = spval - else - t_ref2m_r(p) = 297.56 - end if - else if (use_mexicocity) then - t_veg(p) = 289.46 - t_ref2m(p) = 289.46 - if (urbpoi(l)) then - t_ref2m_u(p) = 289.46 - else - t_ref2m_u(p) = spval - end if - if (ifspecial(l)) then - t_ref2m_r(p) = spval - else - t_ref2m_r(p) = 289.46 - end if - else - t_veg(p) = 283._r8 - t_ref2m(p) = 283._r8 - if (urbpoi(l)) then - t_ref2m_u(p) = 283._r8 - else - t_ref2m_u(p) = spval - end if - if (ifspecial(l)) then - t_ref2m_r(p) = spval - else - t_ref2m_r(p) = 283._r8 - end if - end if - eflx_lwrad_out(p) = sb * (t_grnd(c))**4 - end do - - ! Set snow/soil ice and liquid mass - - ! volumetric water is set first and liquid content and ice lens are obtained - ! NOTE: h2osoi_vol, h2osoi_liq and h2osoi_ice only have valid values over soil - ! and urban pervious road (other urban columns have zero soil water) - - h2osoi_vol(begc:endc, 1:) = spval - h2osoi_liq(begc:endc,-nlevsno+1:) = spval - h2osoi_ice(begc:endc,-nlevsno+1:) = spval - - wa(begc:endc) = 5000._r8 - wt(begc:endc) = 5000._r8 - zwt(begc:endc) = 0._r8 - - do c = begc,endc - l = clandunit(c) - if (.not. lakpoi(l)) then !not lake - if (ltype(l) == isturb) then - if (ctype(c) == icol_road_perv) then - wa(c) = 4800._r8 - wt(c) = wa(c) - zwt(c) = (25._r8 + zi(c,nlevsoi)) - wa(c)/0.2_r8 /1000._r8 ! One meter below soil column - else - wa(c) = spval - wt(c) = spval - zwt(c) = spval - end if - else - wa(c) = 4800._r8 - wt(c) = wa(c) - zwt(c) = (25._r8 + zi(c,nlevsoi)) - wa(c)/0.2_r8 /1000._r8 ! One meter below soil column - end if - end if - end do - - do c = begc,endc - l = clandunit(c) - if (.not. lakpoi(l)) then !not lake - - ! volumetric water - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - nlevs = nlevgrnd - do j = 1, nlevs - if (j > nlevsoi) then - h2osoi_vol(c,j) = 0.0_r8 - else - h2osoi_vol(c,j) = 0.3_r8 - endif - end do - else if (ltype(l) == isturb) then - nlevs = nlevurb - do j = 1, nlevs - if (ctype(c) == icol_road_perv .and. j <= nlevsoi) then - h2osoi_vol(c,j) = 0.3_r8 - else - h2osoi_vol(c,j) = 0.0_r8 - end if - end do - else if (ltype(l) == istwet) then - nlevs = nlevgrnd - do j = 1, nlevs - if (j > nlevsoi) then - h2osoi_vol(c,j) = 0.0_r8 - else - h2osoi_vol(c,j) = 1.0_r8 - endif - end do - else if (ltype(l) == istice .or. ltype(l) == istice_mec) then - nlevs = nlevgrnd - do j = 1, nlevs - h2osoi_vol(c,j) = 1.0_r8 - end do - endif - do j = 1, nlevs - h2osoi_vol(c,j) = min(h2osoi_vol(c,j),watsat(c,j)) - - ! soil layers - if (t_soisno(c,j) <= SHR_CONST_TKFRZ) then - h2osoi_ice(c,j) = dz(c,j)*denice*h2osoi_vol(c,j) - h2osoi_liq(c,j) = 0._r8 - else - h2osoi_ice(c,j) = 0._r8 - h2osoi_liq(c,j) = dz(c,j)*denh2o*h2osoi_vol(c,j) - endif - end do - - if (use_cn) then - ! soil water potential (added 10/21/03, PET) - ! required for CN code - if (ltype(l) == istsoil .or. ltype(l) == istcrop) then - nlevs = nlevgrnd - do j = 1, nlevs - if (h2osoi_liq(c,j) > 0._r8) then - vwc = h2osoi_liq(c,j)/(dz(c,j)*denh2o) - psi = psisat(c,j) * (vwc/vwcsat(c,j))**bsw2(c,j) - soilpsi(c,j) = max(psi, -15.0_r8) - soilpsi(c,j) = min(soilpsi(c,j),0.0_r8) - end if - end do - end if - end if - end if - end do - - ! Set snow - - do j = -nlevsno+1, 0 - do c = begc,endc - l = clandunit(c) - if (.not. lakpoi(l)) then !not lake - if (j > snl(c)) then - h2osoi_ice(c,j) = dz(c,j)*250._r8 - h2osoi_liq(c,j) = 0._r8 - end if - end if - end do - end do - - - ! initialize SNICAR fields: - do c = begc,endc - mss_bctot(c,:) = 0._r8 - mss_bcpho(c,:) = 0._r8 - mss_bcphi(c,:) = 0._r8 - mss_cnc_bcphi(c,:)=0._r8 - mss_cnc_bcpho(c,:)=0._r8 - - mss_octot(c,:) = 0._r8 - mss_ocpho(c,:) = 0._r8 - mss_ocphi(c,:) = 0._r8 - mss_cnc_ocphi(c,:)=0._r8 - mss_cnc_ocpho(c,:)=0._r8 - - mss_dst1(c,:) = 0._r8 - mss_dst2(c,:) = 0._r8 - mss_dst3(c,:) = 0._r8 - mss_dst4(c,:) = 0._r8 - mss_dsttot(c,:) = 0._r8 - mss_cnc_dst1(c,:)=0._r8 - mss_cnc_dst2(c,:)=0._r8 - mss_cnc_dst3(c,:)=0._r8 - mss_cnc_dst4(c,:)=0._r8 - - if (snl(c) < 0) then - snw_rds(c,snl(c)+1:0) = snw_rds_min - snw_rds(c,-nlevsno+1:snl(c)) = 0._r8 - snw_rds_top(c) = snw_rds_min - sno_liq_top(c) = h2osoi_liq(c,snl(c)+1) / (h2osoi_liq(c,snl(c)+1)+h2osoi_ice(c,snl(c)+1)) - elseif (h2osno(c) > 0._r8) then - snw_rds(c,0) = snw_rds_min - snw_rds(c,-nlevsno+1:-1) = 0._r8 - snw_rds_top(c) = spval - sno_liq_top(c) = spval - else - snw_rds(c,:) = 0._r8 - snw_rds_top(c) = spval - sno_liq_top(c) = spval - endif - enddo - - - end subroutine mkarbinit - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: snowdp2lev -! -! !INTERFACE: - subroutine snowdp2lev(lbc, ubc) -! -! !DESCRIPTION: -! Create snow layers and interfaces given snow depth. -! Note that cps%zi(0) is set in routine iniTimeConst. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clmtype - use clm_varpar , only : nlevsno -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arguments -! - integer , pointer :: clandunit(:) ! landunit index associated with each column - real(r8), pointer :: snowdp(:) ! snow height (m) - logical , pointer :: lakpoi(:) ! true => landunit is a lake point -! -! local pointers to implicit out arguments -! - integer , pointer :: snl(:) ! number of snow layers - real(r8), pointer :: z(:,:) ! layer depth (m) over snow only - real(r8), pointer :: dz(:,:) ! layer thickness depth (m) over snow only - real(r8), pointer :: zi(:,:) ! interface depth (m) over snow only -! -! -! !LOCAL VARIABLES: -!EOP - integer :: c,l,j !indices -!----------------------------------------------------------------------- - - ! Assign local pointers to derived subtypes components (landunit-level) - - lakpoi => lun%lakpoi - - ! Assign local pointers to derived type members (column-level) - - clandunit => col%landunit - snowdp => cps%snowdp - snl => cps%snl - zi => cps%zi - dz => cps%dz - z => cps%z - - ! Initialize snow levels and interfaces (lake and non-lake points) - - do c = lbc, ubc - dz(c,-nlevsno+1: 0) = 1.e36_r8 - z (c,-nlevsno+1: 0) = 1.e36_r8 - zi(c,-nlevsno :-1) = 1.e36_r8 - end do - - ! Determine snow levels and interfaces for non-lake points - - do c = lbc,ubc - l = clandunit(c) - if (.not. lakpoi(l)) then - if (snowdp(c) < 0.01_r8) then - snl(c) = 0 - dz(c,-nlevsno+1:0) = 0._r8 - z (c,-nlevsno+1:0) = 0._r8 - zi(c,-nlevsno+0:0) = 0._r8 - else - if ((snowdp(c) >= 0.01_r8) .and. (snowdp(c) <= 0.03_r8)) then - snl(c) = -1 - dz(c,0) = snowdp(c) - else if ((snowdp(c) > 0.03_r8) .and. (snowdp(c) <= 0.04_r8)) then - snl(c) = -2 - dz(c,-1) = snowdp(c)/2._r8 - dz(c, 0) = dz(c,-1) - else if ((snowdp(c) > 0.04_r8) .and. (snowdp(c) <= 0.07_r8)) then - snl(c) = -2 - dz(c,-1) = 0.02_r8 - dz(c, 0) = snowdp(c) - dz(c,-1) - else if ((snowdp(c) > 0.07_r8) .and. (snowdp(c) <= 0.12_r8)) then - snl(c) = -3 - dz(c,-2) = 0.02_r8 - dz(c,-1) = (snowdp(c) - 0.02_r8)/2._r8 - dz(c, 0) = dz(c,-1) - else if ((snowdp(c) > 0.12_r8) .and. (snowdp(c) <= 0.18_r8)) then - snl(c) = -3 - dz(c,-2) = 0.02_r8 - dz(c,-1) = 0.05_r8 - dz(c, 0) = snowdp(c) - dz(c,-2) - dz(c,-1) - else if ((snowdp(c) > 0.18_r8) .and. (snowdp(c) <= 0.29_r8)) then - snl(c) = -4 - dz(c,-3) = 0.02_r8 - dz(c,-2) = 0.05_r8 - dz(c,-1) = (snowdp(c) - dz(c,-3) - dz(c,-2))/2._r8 - dz(c, 0) = dz(c,-1) - else if ((snowdp(c) > 0.29_r8) .and. (snowdp(c) <= 0.41_r8)) then - snl(c) = -4 - dz(c,-3) = 0.02_r8 - dz(c,-2) = 0.05_r8 - dz(c,-1) = 0.11_r8 - dz(c, 0) = snowdp(c) - dz(c,-3) - dz(c,-2) - dz(c,-1) - else if ((snowdp(c) > 0.41_r8) .and. (snowdp(c) <= 0.64_r8)) then - snl(c) = -5 - dz(c,-4) = 0.02_r8 - dz(c,-3) = 0.05_r8 - dz(c,-2) = 0.11_r8 - dz(c,-1) = (snowdp(c) - dz(c,-4) - dz(c,-3) - dz(c,-2))/2._r8 - dz(c, 0) = dz(c,-1) - else if (snowdp(c) > 0.64_r8) then - snl(c) = -5 - dz(c,-4) = 0.02_r8 - dz(c,-3) = 0.05_r8 - dz(c,-2) = 0.11_r8 - dz(c,-1) = 0.23_r8 - dz(c, 0)=snowdp(c)-dz(c,-4)-dz(c,-3)-dz(c,-2)-dz(c,-1) - endif - end if - end if - end do - - ! The following loop is currently not vectorized - - do c = lbc,ubc - l = clandunit(c) - if (.not. lakpoi(l)) then - do j = 0, snl(c)+1, -1 - z(c,j) = zi(c,j) - 0.5_r8*dz(c,j) - zi(c,j-1) = zi(c,j) - dz(c,j) - end do - end if - end do - - ! Determine snow levels and interfaces for lake points - - do c = lbc,ubc - l = clandunit(c) - if (lakpoi(l)) then - snl(c) = 0 - dz(c,-nlevsno+1:0) = 0._r8 - z (c,-nlevsno+1:0) = 0._r8 - zi(c,-nlevsno+0:0) = 0._r8 - end if - end do - - end subroutine snowdp2lev - -!----------------------------------------------------------------------- - -end module mkarbinitMod diff --git a/src_clm40/main/ncdio_pio.F90.in b/src_clm40/main/ncdio_pio.F90.in deleted file mode 100644 index de38171f6c..0000000000 --- a/src_clm40/main/ncdio_pio.F90.in +++ /dev/null @@ -1,2285 +0,0 @@ -module ncdio_pio - - !----------------------------------------------------------------------- - !BOP - ! - ! !MODULE: ncdio_pioMod - ! - ! !DESCRIPTION: - ! Generic interfaces to write fields to netcdf files for CLM - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, i4=>shr_kind_i4, shr_kind_cl - use shr_infnan_mod , only : nan => shr_infnan_nan, isnan => shr_infnan_isnan, assignment(=) - use shr_sys_mod , only : shr_sys_abort - use shr_file_mod , only : shr_file_getunit, shr_file_freeunit - use shr_string_mod , only : shr_string_toUpper - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : masterproc, mpicom, iam, npes - use spmdMod , only : MPI_REAL8, MPI_INTEGER, MPI_LOGICAL - use clmtype , only : grlnd, nameg, namel, namec, namep - use clm_varcon , only : spval,ispval - use clm_varctl , only : single_column, iulog - use shr_sys_mod , only : shr_sys_flush - use decompMod , only : get_clmlevel_gsize,get_clmlevel_gsmap - use perf_mod , only : t_startf, t_stopf - use fileutils , only : getavu, relavu - use mct_mod , only : mct_gsMap, mct_gsMap_lsize, mct_gsMap_gsize, mct_gsMap_orderedPoints - use pio , only : file_desc_t, io_desc_t, iosystem_desc_t, pio_64bit_offset - use pio , only : pio_bcast_error, pio_char, pio_clobber, pio_closefile, pio_createfile, pio_def_dim - use pio , only : pio_def_var, pio_double, pio_enddef, pio_get_att, pio_get_var, pio_global, pio_initdecomp - use pio , only : pio_inq_att, pio_inq_dimid, pio_inq_dimlen, pio_inq_dimname, pio_inq_vardimid, pio_inq_varid - use pio , only : pio_inq_varname, pio_inq_varndims, pio_inquire, pio_int, pio_internal_error - use pio , only : pio_noclobber, pio_noerr, pio_nofill, pio_nowrite, pio_offset_kind, pio_openfile - use pio , only : pio_put_att, pio_put_var, pio_read_darray, pio_real, pio_seterrorhandling - use pio , only : pio_setframe, pio_unlimited, pio_write, pio_write_darray, var_desc_t - use pio , only : pio_iotask_rank, PIO_REARR_SUBSET, PIO_REARR_BOX - ! - ! !PUBLIC TYPES: - implicit none - private - save - ! - ! !PUBLIC MEMBER FUNCTIONS: - ! - public :: check_var ! determine if variable is on netcdf file - public :: check_att ! check if attribute is on file - public :: check_dim ! validity check on dimension - public :: ncd_pio_openfile ! open a file - public :: ncd_pio_createfile ! create a new file - public :: ncd_pio_closefile ! close a file - public :: ncd_pio_init ! called from clm_comp - public :: ncd_enddef ! end define mode - public :: ncd_putatt ! put attribute - public :: ncd_getatt ! get attribute - public :: ncd_defdim ! define dimension - public :: ncd_inqdid ! inquire dimension id - public :: ncd_inqdname ! inquire dimension name - public :: ncd_inqdlen ! inquire dimension length - public :: ncd_inqfdims ! inquire file dimnesions - public :: ncd_defvar ! define variables - public :: ncd_inqvid ! inquire variable id - public :: ncd_inqvname ! inquire variable name - public :: ncd_inqvdims ! inquire variable ndims - public :: ncd_inqvdids ! inquire variable dimids - public :: ncd_inqvdlen ! inquire variable dimension size - public :: ncd_io ! write local data - - integer,parameter,public :: ncd_int = pio_int - integer,parameter,public :: ncd_log =-pio_int - integer,parameter,public :: ncd_float = pio_real - integer,parameter,public :: ncd_double = pio_double - integer,parameter,public :: ncd_char = pio_char - integer,parameter,public :: ncd_global = pio_global - integer,parameter,public :: ncd_write = pio_write - integer,parameter,public :: ncd_nowrite = pio_nowrite - integer,parameter,public :: ncd_clobber = pio_clobber - integer,parameter,public :: ncd_noclobber = pio_noclobber - integer,parameter,public :: ncd_nofill = pio_nofill - integer,parameter,public :: ncd_unlimited = pio_unlimited - - ! PIO types needed for ncdio_pio interface calls - public file_desc_t - public var_desc_t - - ! - ! !PRIVATE MEMBER FUNCTIONS: - ! - interface ncd_defvar - module procedure ncd_defvar_bynf - module procedure ncd_defvar_bygrid - end interface - - interface ncd_putatt - module procedure ncd_putatt_int - module procedure ncd_putatt_real - module procedure ncd_putatt_char - end interface - - interface ncd_getatt - module procedure ncd_getatt_char - end interface ncd_getatt - - interface ncd_io - module procedure ncd_io_char_var0_start_glob - - !DIMS 0,1 - module procedure ncd_io_{DIMS}d_log_glob - - !DIMS 0,1,2,3 - !TYPE int,double - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - !DIMS 0,1,2 - !TYPE text - module procedure ncd_io_{DIMS}d_{TYPE}_glob - - !TYPE int,double - !DIMS 1,2,3 - module procedure ncd_io_{DIMS}d_{TYPE} - - !TYPE logical - !DIMS 1 - module procedure ncd_io_{DIMS}d_{TYPE} - end interface - - interface ncd_inqvdlen - module procedure ncd_inqvdlen_byDesc - module procedure ncd_inqvdlen_byName - end interface - - private :: ncd_getiodesc ! obtain iodesc - private :: scam_field_offsets ! get offset to proper lat/lon gridcell for SCAM - - integer,parameter,private :: debug = 0 ! local debug level - - integer , parameter , public :: max_string_len = 256 ! length of strings - real(r8), parameter , public :: fillvalue = 1.e36_r8 ! fill value for netcdf fields - - integer, public :: io_type - - type(iosystem_desc_t), pointer, public :: pio_subsystem - - type iodesc_plus_type - character(len=64) :: name - type(IO_desc_t) :: iodesc - integer :: type - integer :: ndims - integer :: dims(4) - integer :: dimids(4) - end type iodesc_plus_type - integer,parameter ,private :: max_iodesc = 100 - integer ,private :: num_iodesc = 0 - type(iodesc_plus_type) ,private, target :: iodesc_list(max_iodesc) - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine ncd_pio_init() - ! - ! !DESCRIPTION: - ! Initial PIO - ! - ! !USES: - use shr_pio_mod , only : shr_pio_getiosys, shr_pio_getiotype - use clm_varctl , only : inst_name - !----------------------------------------------------------------------- - - PIO_subsystem => shr_pio_getiosys(inst_name) - io_type = shr_pio_getiotype(inst_name) - - end subroutine ncd_pio_init - - !----------------------------------------------------------------------- - subroutine ncd_pio_openfile(file, fname, mode) - ! - ! !DESCRIPTION: - ! Open a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: file ! Output PIO file handle - character(len=*) , intent(in) :: fname ! Input filename to open - integer , intent(in) :: mode ! file mode - ! - ! !LOCAL VARIABLES: - integer :: ierr - !----------------------------------------------------------------------- - - ierr = pio_openfile(pio_subsystem, file, io_type, fname, mode) - - if(ierr/= PIO_NOERR) then - call shr_sys_abort('ncd_pio_openfile ERROR: Failed to open file') - else if(pio_iotask_rank(pio_subsystem)==0) then - write(iulog,*) 'Opened existing file ', trim(fname), file%fh - end if - - end subroutine ncd_pio_openfile - - !----------------------------------------------------------------------- - subroutine ncd_pio_closefile(file) - ! - ! !DESCRIPTION: - ! Close a NetCDF PIO file - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: file ! PIO file handle to close - !----------------------------------------------------------------------- - - call pio_closefile(file) - - end subroutine ncd_pio_closefile - - !----------------------------------------------------------------------- - subroutine ncd_pio_createfile(file, fname, avoid_pnetcdf) - ! - ! !DESCRIPTION: - ! Create a new NetCDF file with PIO - ! - ! !USES: - use pio, only : pio_iotype_pnetcdf, pio_iotype_netcdf - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: file ! PIO file descriptor - character(len=*) , intent(in) :: fname ! File name to create - - ! BUG(wjs, 2014-10-20, bugz 1730) Workaround for - ! http://bugs.cgd.ucar.edu/show_bug.cgi?id=1730 - logical, intent(in), optional :: avoid_pnetcdf - ! - ! !LOCAL VARIABLES: - logical :: l_avoid_pnetcdf ! local version of avoid_pnetcdf - integer :: my_io_type - integer :: ierr - !----------------------------------------------------------------------- - - l_avoid_pnetcdf = .false. - if (present(avoid_pnetcdf)) then - l_avoid_pnetcdf = avoid_pnetcdf - end if - - my_io_type = io_type - if (l_avoid_pnetcdf) then - if (my_io_type == pio_iotype_pnetcdf) then - my_io_type = pio_iotype_netcdf - if(pio_iotask_rank(pio_subsystem)==0) then - write(iulog,*) 'Workaround for bugz 1730: creating' - write(iulog,*) trim(fname) - write(iulog,*) 'with type netcdf instead of pnetcdf' - end if - end if - end if - - ierr = pio_createfile(pio_subsystem, file, my_io_type, fname, ior(PIO_CLOBBER,PIO_64BIT_OFFSET)) - - if(ierr/= PIO_NOERR) then - call shr_sys_abort( ' ncd_pio_createfile ERROR: Failed to open file to write: '//trim(fname)) - else if(pio_iotask_rank(pio_subsystem)==0) then - write(iulog,*) 'Opened file ', trim(fname), ' to write', file%fh - end if - - end subroutine ncd_pio_createfile - - !----------------------------------------------------------------------- - subroutine check_var(ncid, varname, vardesc, readvar, print_err ) - ! - ! !DESCRIPTION: - ! Check if variable is on netcdf file - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=*) , intent(in) :: varname ! Varible name to check - type(Var_desc_t) , intent(out) :: vardesc ! Output variable descriptor - logical , intent(out) :: readvar ! If variable exists or not - logical, optional , intent(in) :: print_err ! If should print about error - ! - ! !LOCAL VARIABLES: - integer :: ret ! return value - logical :: log_err ! if should log error - character(len=*),parameter :: subname='check_var' ! subroutine name - !----------------------------------------------------------------------- - - - if ( present(print_err) )then - log_err = print_err - else - log_err = .true. - end if - readvar = .true. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ret = PIO_inq_varid (ncid, varname, vardesc) - if (ret /= PIO_noerr) then - readvar = .false. - if (masterproc .and. log_err) & - write(iulog,*) subname//': variable ',trim(varname),' is not on dataset' - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - end subroutine check_var - - !----------------------------------------------------------------------- - subroutine check_att(ncid, varid, attrib, att_found) - ! - ! !DESCRIPTION: - ! Check if attribute is on file - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - logical ,intent(out) :: att_found ! true if the attribute was found - ! - ! !LOCAL VARIABLES: - integer :: att_type ! attribute type - integer(pio_offset_kind) :: att_len ! attribute length - integer :: status - - character(len=*), parameter :: subname = 'check_att' - !----------------------------------------------------------------------- - - att_found = .true. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - status = PIO_inq_att(ncid, varid, trim(attrib), att_type, att_len) - if (status /= PIO_noerr) then - att_found = .false. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - end subroutine check_att - - !----------------------------------------------------------------------- - subroutine check_dim(ncid, dimname, value) - ! - ! !DESCRIPTION: - ! Validity check on dimension - ! - ! !ARGUMENTS: - class(file_desc_t),intent(in) :: ncid ! PIO file handle - character(len=*) , intent(in) :: dimname ! Dimension name - integer, intent(in) :: value ! Expected dimension size - ! - ! !LOCAL VARIABLES: - integer :: dimid, dimlen ! temporaries - integer :: status ! error code - character(len=*),parameter :: subname='check_dim' ! subroutine name - !----------------------------------------------------------------------- - - status = pio_inq_dimid (ncid, trim(dimname), dimid) - status = pio_inq_dimlen (ncid, dimid, dimlen) - if (dimlen /= value) then - write(iulog,*) subname//' ERROR: mismatch of input dimension ',dimlen, & - ' with expected value ',value,' for variable ',trim(dimname) - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - - end subroutine check_dim - - !----------------------------------------------------------------------- - subroutine ncd_enddef(ncid) - ! - ! !DESCRIPTION: - ! enddef netcdf file - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - ! - ! !LOCAL VARIABLES: - integer :: status ! error status - !----------------------------------------------------------------------- - - status = PIO_enddef(ncid) - - end subroutine ncd_enddef - - !----------------------------------------------------------------------- - subroutine ncd_inqdid(ncid,name,dimid,dimexist) - ! - ! !DESCRIPTION: - ! inquire on a dimension id - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! dimension name - integer , intent(out):: dimid ! dimension id - logical,optional , intent(out):: dimexist ! if this dimension exists or not - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - if ( present(dimexist) )then - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - end if - status = PIO_inq_dimid(ncid,name,dimid) - if ( present(dimexist) )then - if ( status == PIO_NOERR)then - dimexist = .true. - else - dimexist = .false. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - end if - - end subroutine ncd_inqdid - - !----------------------------------------------------------------------- - subroutine ncd_inqdlen(ncid,dimid,len,name) - ! - ! !DESCRIPTION: - ! enddef netcdf file - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - integer , intent(inout) :: dimid ! dimension id - integer , intent(out) :: len ! dimension len - character(len=*), optional, intent(in) :: name ! dimension name - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - if ( present(name) )then - call ncd_inqdid(ncid,name,dimid) - end if - len = -1 - status = PIO_inq_dimlen(ncid,dimid,len) - - end subroutine ncd_inqdlen - - !----------------------------------------------------------------------- - subroutine ncd_inqdname(ncid,dimid,dname) - ! - ! !DESCRIPTION: - ! inquire dim name - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(in) :: dimid ! dimension id - character(len=*) , intent(out):: dname ! dimension name - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_inq_dimname(ncid,dimid,dname) - - end subroutine ncd_inqdname - - !----------------------------------------------------------------------- - subroutine ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout):: ncid - logical , intent(out) :: isgrid2d - integer , intent(out) :: ni - integer , intent(out) :: nj - integer , intent(out) :: ns - ! - ! !LOCAL VARIABLES: - integer :: dimid ! netCDF id - integer :: ier ! error status - character(len=32) :: subname = 'ncd_inqfdims' ! subroutine name - !----------------------------------------------------------------------- - - if (single_column) then - ni = 1 - nj = 1 - ns = 1 - isgrid2d = .true. - RETURN - end if - - ni = 0 - nj = 0 - - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ier = pio_inq_dimid (ncid, 'lon', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'lat', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'lsmlon', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'lsmlat', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'ni', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, ni) - ier = pio_inq_dimid (ncid, 'nj', dimid) - if (ier == PIO_NOERR) ier = pio_inq_dimlen(ncid, dimid, nj) - - ier = pio_inq_dimid (ncid, 'gridcell', dimid) - if (ier == PIO_NOERR) then - ier = pio_inq_dimlen(ncid, dimid, ni) - if (ier == PIO_NOERR) nj = 1 - end if - - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - - if (ni == 0 .or. nj == 0) then - write(iulog,*) trim(subname),' ERROR: ni,nj = ',ni,nj,' cannot be zero ' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - - if (nj == 1) then - isgrid2d = .false. - else - isgrid2d = .true. - end if - - ns = ni*nj - - end subroutine ncd_inqfdims - - !----------------------------------------------------------------------- - subroutine ncd_inqvid(ncid,name,varid,vardesc,readvar) - ! - ! !DESCRIPTION: - ! Inquire on a variable ID - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: name ! variable name - integer , intent(out) :: varid ! variable id - type(Var_desc_t) , intent(out) :: vardesc ! variable descriptor - logical, optional , intent(out) :: readvar ! does variable exist - ! - ! !LOCAL VARIABLES: - integer :: ret ! return code - character(len=*),parameter :: subname='ncd_inqvid' ! subroutine name - !----------------------------------------------------------------------- - - if (present(readvar)) then - readvar = .false. - call pio_seterrorhandling(ncid, PIO_BCAST_ERROR) - ret = PIO_inq_varid(ncid,name,vardesc) - if (ret /= PIO_noerr) then - if (masterproc) write(iulog,*) subname//': variable ',trim(name),' is not on dataset' - readvar = .false. - else - readvar = .true. - end if - call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR) - else - ret = PIO_inq_varid(ncid,name,vardesc) - endif - varid = vardesc%varid - - end subroutine ncd_inqvid - - !----------------------------------------------------------------------- - subroutine ncd_inqvdims(ncid,ndims,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable dimensions - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(out) :: ndims ! variable ndims - type(Var_desc_t) , intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - ndims = -1 - status = PIO_inq_varndims(ncid,vardesc,ndims) - - end subroutine ncd_inqvdims - - !----------------------------------------------------------------------- - subroutine ncd_inqvname(ncid,varid,vname,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable name - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - integer , intent(in) :: varid ! variable id - character(len=*) , intent(out) :: vname ! variable vname - type(Var_desc_t) , intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - vname = '' - status = PIO_inq_varname(ncid,vardesc,vname) - - end subroutine ncd_inqvname - - !----------------------------------------------------------------------- - subroutine ncd_inqvdids(ncid,dids,vardesc) - ! - ! !DESCRIPTION: - ! inquire variable dimension ids - ! - ! !ARGUMENTS: - class(file_desc_t),intent(in) :: ncid ! netcdf file id - integer ,intent(out) :: dids(:) ! variable dids - type(Var_desc_t) ,intent(inout):: vardesc ! variable descriptor - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - dids = -1 - status = PIO_inq_vardimid(ncid,vardesc,dids) - - end subroutine ncd_inqvdids - - !----------------------------------------------------------------------- - subroutine ncd_inqvdlen_byDesc(ncid,vardesc,dimnum,dlen,err_code) - ! - ! !DESCRIPTION: - ! inquire size of one of a variable's dimensions, given a vardesc - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this routine - ! returns the size of the dimnum'th dimension. - ! - ! If there is an error condition, dlen will be -1, and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - type(Var_desc_t) ,intent(inout) :: vardesc ! variable descriptor - integer ,intent(in) :: dimnum ! dimension number to query - integer ,intent(out) :: dlen ! length of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - integer :: ndims ! number of dimensions - integer, allocatable :: dimids(:) ! dimension IDs - - integer, parameter :: dlen_invalid = -1 - integer, parameter :: error_none = 0 - integer, parameter :: error_dimnum_out_of_range = 1 - !----------------------------------------------------------------------- - - err_code = error_none - - call ncd_inqvdims(ncid, ndims, vardesc) - - if (dimnum > 0 .and. dimnum <= ndims) then - allocate(dimids(ndims)) - call ncd_inqvdids(ncid, dimids, vardesc) - call ncd_inqdlen(ncid, dimids(dimnum), dlen) - deallocate(dimids) - else - dlen = dlen_invalid - err_code = error_dimnum_out_of_range - end if - - end subroutine ncd_inqvdlen_byDesc - - - !----------------------------------------------------------------------- - subroutine ncd_inqvdlen_byName(ncid,varname,dimnum,dlen,err_code) - ! - ! !DESCRIPTION: - ! inquire size of one of a variable's dimensions, given a variable name - ! - ! If the variable has n dimensions, then dimnum should be between 1 and n; this routine - ! returns the size of the dimnum'th dimension. - ! - ! If there is an error condition, dlen will be -1, and err_code will hold the error - ! code; possible error codes are: - ! 0: no error - ! 1: dimnum out of range - ! 11: variable not found - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) ,intent(in) :: varname ! variable name - integer ,intent(in) :: dimnum ! dimension number to query - integer ,intent(out) :: dlen ! length of the dimension - integer ,intent(out) :: err_code ! error code (0 means no error) - ! - ! !LOCAL VARIABLES: - type(Var_desc_t) :: vardesc ! variable descriptor - logical :: readvar ! whether the variable was found - integer, parameter :: dlen_invalid = -1 - integer, parameter :: error_variable_not_found = 11 - !----------------------------------------------------------------------- - - call check_var(ncid, varname, vardesc, readvar) - if (readvar) then - call ncd_inqvdlen_byDesc(ncid, vardesc, dimnum, dlen, err_code) - else - dlen = dlen_invalid - err_code = error_variable_not_found - end if - - end subroutine ncd_inqvdlen_byName - - - !----------------------------------------------------------------------- - subroutine ncd_putatt_int(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put integer attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - integer ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_put_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_putatt_int - - !----------------------------------------------------------------------- - subroutine ncd_putatt_char(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put character attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(in) :: value ! netcdf attrib value - integer,optional ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = PIO_put_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_putatt_char - - !----------------------------------------------------------------------- - subroutine ncd_putatt_real(ncid,varid,attrib,value,xtype) - ! - ! !DESCRIPTION: - ! put real attributes - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - real(r8) ,intent(in) :: value ! netcdf attrib value - integer ,intent(in) :: xtype ! netcdf data type - ! - ! !LOCAL VARIABLES: - integer :: status - real*4 :: value4 - !----------------------------------------------------------------------- - - value4 = value - - if (xtype == pio_double) then - status = PIO_put_att(ncid,varid,trim(attrib),value) - else - status = PIO_put_att(ncid,varid,trim(attrib),value4) - endif - - end subroutine ncd_putatt_real - - !----------------------------------------------------------------------- - subroutine ncd_getatt_char(ncid,varid,attrib,value) - ! - ! !DESCRIPTION: - ! get a character attribute - ! - ! !USES: - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - integer ,intent(in) :: varid ! netcdf var id - character(len=*) ,intent(in) :: attrib ! netcdf attrib - character(len=*) ,intent(out) :: value ! netcdf attrib value - ! - ! !LOCAL VARIABLES: - integer :: status - - character(len=*), parameter :: subname = 'ncd_getatt_char' - !----------------------------------------------------------------------- - - status = PIO_get_att(ncid,varid,trim(attrib),value) - - end subroutine ncd_getatt_char - - - !----------------------------------------------------------------------- - subroutine ncd_defdim(ncid,attrib,value,dimid) - ! - ! !DESCRIPTION: - ! define dimension - ! - ! !ARGUMENTS: - class(file_desc_t), intent(in) :: ncid ! netcdf file id - character(len=*) , intent(in) :: attrib ! netcdf attrib - integer , intent(in) :: value ! netcdf attrib value - integer , intent(out):: dimid ! netcdf dimension id - ! - ! !LOCAL VARIABLES: - integer :: status - !----------------------------------------------------------------------- - - status = pio_def_dim(ncid,attrib,value,dimid) - - end subroutine ncd_defdim - - !----------------------------------------------------------------------- - subroutine ncd_defvar_bynf(ncid, varname, xtype, ndims, dimid, varid, & - long_name, units, cell_method, missing_value, fill_value, & - imissing_value, ifill_value, comment, flag_meanings, & - flag_values, nvalid_range ) - ! - ! !DESCRIPTION: - ! Define a netcdf variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! external type - integer , intent(in) :: ndims ! number of dims - integer , intent(inout) :: varid ! returned var id - integer , intent(in), optional :: dimid(:) ! dimids - character(len=*) , intent(in), optional :: long_name ! attribute - character(len=*) , intent(in), optional :: units ! attribute - character(len=*) , intent(in), optional :: cell_method ! attribute - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! !LOCAL VARIABLES: - integer :: n ! indices - integer :: ldimid(4) ! local dimid - integer :: dimid0(1) ! local dimid - integer :: status ! error status - integer :: lxtype ! local external type (in case logical variable) - type(var_desc_t) :: vardesc ! local vardesc - character(len=128) :: dimname ! temporary - character(len=256) :: str ! temporary - character(len=*),parameter :: subname='ncd_defvar_bynf' ! subroutine name - !----------------------------------------------------------------------- - - varid = -1 - - dimid0 = 0 - ldimid = 0 - if (present(dimid)) then - ldimid(1:ndims) = dimid(1:ndims) - else ! ndims must be zero if dimid not present - if (ndims /= 0) then - write(iulog,*) subname//' ERROR: dimid not supplied and ndims ne 0 ',trim(varname),ndims - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - endif - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - if (masterproc .and. debug > 1) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - write(iulog,*) subname//' ',trim(varname),lxtype,ndims,ldimid(1:ndims) - endif - - if (ndims > 0) then - status = pio_inq_dimname(ncid,ldimid(ndims),dimname) - end if - - ! Define variable - if (present(dimid)) then - status = PIO_def_var(ncid,trim(varname),lxtype,dimid(1:ndims),vardesc) - else - status = PIO_def_var(ncid,trim(varname),lxtype,dimid0 ,vardesc) - endif - varid = vardesc%varid - - ! - ! Add attributes - ! - if (present(long_name)) then - call ncd_putatt(ncid, varid, 'long_name', trim(long_name)) - end if - if (present(flag_values)) then - status = PIO_put_att(ncid,varid,'flag_values',flag_values) - if ( .not. present(flag_meanings)) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_values set -- but not flag_meanings"//errMsg(__FILE__, __LINE__)) - end if - end if - if (present(flag_meanings)) then - if ( .not. present(flag_values)) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings set -- but not flag_values"//errMsg(__FILE__, __LINE__) ) - end if - if ( size(flag_values) /= size(flag_meanings) ) then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings and flag_values dimension different"//errMsg(__FILE__, __LINE__)) - end if - str = flag_meanings(1) - do n = 1, size(flag_meanings) - if ( index(flag_meanings(n), ' ') /= 0 )then - write(iulog,*) 'Error in defining variable = ', trim(varname) - call shr_sys_abort(" ERROR:: flag_meanings has an invalid space in it"//errMsg(__FILE__, __LINE__) ) - end if - if ( n > 1 ) str = trim(str)//" "//flag_meanings(n) - end do - status = PIO_put_att(ncid,varid,'flag_meanings', trim(str) ) - end if - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(cell_method)) then - str = 'time: ' // trim(cell_method) - call ncd_putatt(ncid, varid, 'cell_methods', trim(str)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - end subroutine ncd_defvar_bynf - - !----------------------------------------------------------------------- - subroutine ncd_defvar_bygrid(ncid, varname, xtype, & - dim1name, dim2name, dim3name, dim4name, dim5name, & - long_name, units, cell_method, missing_value, fill_value, & - imissing_value, ifill_value, switchdim, comment, & - flag_meanings, flag_values, nvalid_range ) - ! - ! !DESCRIPTION: - ! Define a netcdf variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! external type - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: dim3name ! dimension name - character(len=*) , intent(in), optional :: dim4name ! dimension name - character(len=*) , intent(in), optional :: dim5name ! dimension name - character(len=*) , intent(in), optional :: long_name ! attribute - character(len=*) , intent(in), optional :: units ! attribute - character(len=*) , intent(in), optional :: cell_method ! attribute - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - logical , intent(in), optional :: switchdim ! true=> permute dim1 and dim2 for output - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! !LOCAL VARIABLES: - integer :: n ! indices - integer :: ndims ! dimension counter - integer :: dimid(5) ! dimension ids - integer :: varid ! variable id - integer :: itmp ! temporary - character(len=256) :: str ! temporary - character(len=*),parameter :: subname='ncd_defvar_bygrid' ! subroutine name - !----------------------------------------------------------------------- - - dimid(:) = 0 - - ! Determine dimension ids for variable - - if (present(dim1name)) call ncd_inqdid(ncid, dim1name, dimid(1)) - if (present(dim2name)) call ncd_inqdid(ncid, dim2name, dimid(2)) - if (present(dim3name)) call ncd_inqdid(ncid, dim3name, dimid(3)) - if (present(dim4name)) call ncd_inqdid(ncid, dim4name, dimid(4)) - if (present(dim5name)) call ncd_inqdid(ncid, dim5name, dimid(5)) - - ! Permute dim1 and dim2 if necessary - - if (present(switchdim)) then - itmp = dimid(2) - dimid(2) = dimid(1) - dimid(1) = itmp - end if - - ! Define variable - - ndims = 0 - if (present(dim1name)) then - do n = 1, size(dimid) - if (dimid(n) /= 0) ndims = ndims + 1 - end do - end if - - call ncd_defvar_bynf(ncid,varname,xtype,ndims,dimid,varid, & - long_name=long_name, units=units, cell_method=cell_method, & - missing_value=missing_value, fill_value=fill_value, & - imissing_value=imissing_value, ifill_value=ifill_value, & - comment=comment, flag_meanings=flag_meanings, & - flag_values=flag_values, nvalid_range=nvalid_range ) - - end subroutine ncd_defvar_bygrid - - !------------------------------------------------------------------------ - subroutine ncd_io_char_var0_start_glob(vardesc, data, flag, ncid, start ) - ! - ! !DESCRIPTION: - ! netcdf I/O of global character array with start indices input - ! - ! !ARGUMENTS: - class(file_desc_t),intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - type(var_desc_t) , intent(in) :: vardesc ! local vardesc pointer - character(len=*) , intent(inout) :: data ! raw data for this index - integer , intent(in) :: start(:) ! output bounds - ! - ! !LOCAL VARIABLES: - integer :: status ! error code - character(len=*),parameter :: subname='ncd_io_char_var0_start_glob' - !----------------------------------------------------------------------- - - if (flag == 'read') then - - status = pio_get_var(ncid, vardesc, start, data ) - - elseif (flag == 'write') then - - status = pio_put_var(ncid, vardesc, start, data ) - - endif - - end subroutine ncd_io_char_var0_start_glob - - !------------------------------------------------------------------------ - !DIMS 0,1 - subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global integer variable - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - logical , intent(inout) :: data{DIMSTR} ! raw data - logical, optional , intent(out) :: readvar ! was var read? - integer, optional , intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: varid ! netCDF variable id - integer :: start(2), count(2) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - integer :: idata - integer, pointer :: idata1d(:) ! Temporary integer data to send to file - character(len=32) :: vname ! variable error checking - type(var_desc_t) :: vardesc ! local vardesc pointer - character(len=*),parameter :: subname='ncd_io_{DIMS}d_log_glob' - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column .and. present(posNOTonfile) ) then - if ( .not. posNOTonfile )then - call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//& - errMsg(__FILE__, __LINE__)) - end if - endif -#if ({DIMS}==0) - status = pio_get_var(ncid, varid, idata) - if ( idata == 0 )then - data = .false. - else if ( idata == 1 )then - data = .true. - else - call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(__FILE__, __LINE__)) - end if -#else - allocate(idata1d(size(data))) - data = (idata1d == 1) - if ( any(idata1d /= 0 .and. idata1d /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(__FILE__, __LINE__)) - end if - deallocate(idata1d) -#endif - endif - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - -#if ({DIMS}==0) - start(1) = 1 ; count(1) = 1 - if (present(nt)) start(1) = nt - call ncd_inqvid (ncid, varname, varid, vardesc) - allocate(idata1d(1)) - if ( data )then - idata1d(1) = 1 - else - idata1d(1) = 0 - end if - status = pio_put_var(ncid, varid, start, count, idata1d) - deallocate(idata1d) -#else - start(1) = 1 ; count(1) = size(data) - start(2) = 1 ; count(2) = 1 - if (present(nt)) start(2) = nt - allocate(idata1d(size(data))) - where( data ) - idata1d = 1 - elsewhere - idata1d = 0 - end where - call ncd_inqvid (ncid, varname, varid, vardesc) - status = pio_put_var(ncid, varid, start, count, idata1d) - deallocate( idata1d ) -#endif - - endif ! flag - - end subroutine ncd_io_{DIMS}d_log_glob - - !------------------------------------------------------------------------ - !DIMS 0,1,2,3 - !TYPE int,double - subroutine ncd_io_{DIMS}d_{TYPE}_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - {VTYPE} , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: m - integer :: varid ! netCDF variable id - integer :: start({DIMS}+1), count({DIMS}+1) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - logical :: found ! if true, found lat/lon dims on file - character(len=32) :: vname ! variable error checking - character(len=1) :: tmpString(128) ! temp for manipulating output string - type(var_desc_t) :: vardesc ! local vardesc pointer - {VTYPE} :: temp(1) - character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob' - integer :: ndims - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - -#if ({DIMS}==0) - if (varpresent) then - status = pio_get_var(ncid, vardesc, data) - if (single_column .and. present(posNOTonfile) ) then - if ( .not. posNOTonfile )then - call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//& - errMsg(__FILE__, __LINE__)) - end if - endif - end if -#else - if (varpresent) then - if (single_column) then - call scam_field_offsets(ncid,'undefined', vardesc,& - start, count, found=found, posNOTonfile=posNOTonfile) - if ( found )then - status = pio_get_var(ncid, varid, start, count, data) - else - status = pio_get_var(ncid, varid, data) - end if - else - status = pio_get_var(ncid, varid, data) - endif - endif -#endif - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - ndims = {DIMS} - if(present(nt)) ndims=ndims+1 - call ncd_inqvid (ncid, varname, varid, vardesc) -#if ({DIMS}==0) - start(1) = 1 ; count(1) = 1 - if (present(nt)) start(1) = nt ; count(1) = 1 - temp(1) = data - status = pio_put_var(ncid, varid, start(1:1), count(1:1), temp) -#elif ({DIMS}==1) - start(1) = 1 ; count(1) = size(data) - start(2) = 1 ; count(2) = 1 - if (present(nt)) start(2) = nt - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) -#elif ({DIMS}==2) - start(1) = 1 ; count(1) = size(data, dim=1) - start(2) = 1 ; count(2) = size(data, dim=2) - start(3) = 1 ; count(3) = 1 - if (present(nt)) start(3) = nt - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) -#elif ({DIMS}==3) - if (present(nt)) then - start(1) = 1 ; count(1) = size(data,dim=1) - start(2) = 1 ; count(2) = size(data,dim=2) - start(3) = 1 ; count(3) = size(data,dim=3) - start(4) = nt ; count(4) = 1 - status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), data) - else - status = pio_put_var(ncid, varid, data) - end if -#endif - - endif - - end subroutine ncd_io_{DIMS}d_{TYPE}_glob - - !------------------------------------------------------------------------ - !DIMS 0,1,2 - !TYPE text - subroutine ncd_io_{DIMS}d_{TYPE}_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile) - ! - ! !DESCRIPTION: - ! netcdf I/O of global variable - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*), intent(in) :: flag ! 'read' or 'write' - character(len=*), intent(in) :: varname ! variable name - {VTYPE} , intent(inout) :: data{DIMSTR} ! raw data - logical , optional, intent(out) :: readvar ! was var read? - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: m - integer :: varid ! netCDF variable id - integer :: start(4), count(4) ! output bounds - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - character(len=1) :: tmpString(128) ! temp for manipulating output string - type(var_desc_t) :: vardesc ! local vardesc pointer - character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob' - integer :: ndims - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - - if (varpresent) then - data = ' ' - status = pio_get_var(ncid, varid, data) - end if - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - ndims = {DIMS} - if(present(nt)) ndims=ndims+1 - call ncd_inqvid (ncid, varname, varid, vardesc) - -#if ({DIMS}==0) - if (present(nt)) then - do m = 1,len(data) - tmpString(m:m) = data(m:m) - end do - start(1) = 1 ; count(1) = len(data) - start(2) = nt; count(2) = 1 - if ( count(1) > size(tmpString) )then - write(iulog,*) subname//' ERROR: input string size is too large:' - end if - status = pio_put_var(ncid, varid, start, count, ival=tmpString(1:count(1))) - else - status = pio_put_var(ncid, varid, data ) - end if -#elif ({DIMS}==1) - if (present(nt)) then - start(1) = 1 ; count(1) = len(data) - start(2) = 1 ; count(2) = size(data) - start(3) = nt; count(3) = 1 - status = pio_put_var(ncid, varid, start, count, data) - else - status = pio_put_var(ncid, varid, data) - end if -#elif ({DIMS}==2) - if (present(nt)) then - start(1) = 1 ; count(1) = len(data) - start(2) = 1 ; count(2) = size(data,dim=1) - start(3) = 1 ; count(3) = size(data,dim=2) - start(4) = nt ; count(4) = 1 - status = pio_put_var(ncid, varid, start, count, data) - else - status = pio_put_var(ncid, varid, data) - end if -#endif - - endif - - end subroutine ncd_io_{DIMS}d_{TYPE}_glob - - !----------------------------------------------------------------------- - - !TYPE int,double,logical - subroutine ncd_io_1d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! netcdf I/O for 1d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:) ! local decomposition data - character(len=*) , intent(in) :: dim1name ! dimension name - integer , optional, intent(in) :: nt ! time sample index - logical , optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical , optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - ! - ! Local Variables - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: n ! index - integer :: iodnum ! iodesc num in list - integer :: varid ! varid - integer :: ndims ! ndims for var - integer :: ndims_iod ! ndims iodesc for var - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: start(3) ! netcdf start index - integer :: count(3) ! netcdf count index - integer :: status ! error code - logical :: varpresent ! if true, variable is on tape - integer , pointer :: idata(:) ! Temporary integer data to send to file - integer , pointer :: compDOF(:) - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_1d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - start(:) = 0 - count(:) = 0 - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) subname//' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - -#if ({ITYPE}==TYPEDOUBLE) - if ( present(cnvrtnan2fill) )then - if (.not. cnvrtnan2fill) then - call shr_sys_abort(' ERROR: cnvrtnan2fill present but NOT set to true -- MUST set it to TRUE if used'//& - errMsg(__FILE__, __LINE__)) - endif - end if -#endif - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column) then - start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid,clmlevel,vardesc,start,count) - if (trim(clmlevel) == grlnd) then - n=2 - if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 - end if - else - n=1 - if (present(nt)) then - n=2 - start(2) = nt ; count(2) = 1 - end if - end if -#if ({ITYPE}==TYPELOGICAL) - allocate(idata(size(data))) - status = pio_get_var(ncid, varid, start(1:n), count(1:n), idata) - data = (idata == 1) - if ( any(idata /= 0 .and. idata /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(__FILE__, __LINE__)) - end if - deallocate( idata ) -#else - status = pio_get_var(ncid, varid, start(1:n), count(1:n), data) -#endif - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo -#if ({ITYPE}==TYPELOGICAL) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_INT, iodnum) -#else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) -#endif - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if -#if ({ITYPE}==TYPELOGICAL) - allocate(idata(size(data))) - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, idata, status) - data = (idata == 1) - if ( any(idata /= 0 .and. idata /= 1) )then - call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(__FILE__, __LINE__)) - end if - deallocate( idata ) -#else - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) -#endif - end if - end if - if (present(readvar)) readvar = varpresent - - elseif (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo -#if ({ITYPE}==TYPELOGICAL) - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_INT, iodnum) -#else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) -#endif - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if -#if ({ITYPE}==TYPELOGICAL) - allocate( idata(size(data)) ) - where( data ) - idata = 1 - elsewhere - idata = 0 - end where - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, idata, status, fillval=0) - deallocate( idata ) -#elif ({ITYPE}==TYPEINT) - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=0) -#elif ({ITYPE}==TYPEDOUBLE) - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=spval) -#endif - else - - if (masterproc) then - write(iulog,*) subname//' ERROR: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - - endif - - end subroutine ncd_io_1d_{TYPE} - - !----------------------------------------------------------------------- - - !TYPE int,double - subroutine ncd_io_2d_{TYPE}(varname, data, dim1name, lowerb2, upperb2, & - flag, ncid, nt, readvar, switchdim, cnvrtnan2fill) - ! - ! !DESCRIPTION: - ! Netcdf i/o of 2d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - integer, optional, intent(in) :: lowerb2,upperb2 ! lower and upper bounds of second dimension - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - logical, optional, intent(in) :: switchdim ! true=> permute dim1 and dim2 for output - logical, optional, intent(in) :: cnvrtnan2fill ! true => convert any NaN's to _FillValue (spval) - ! - ! !LOCAL VARIABLES: -#if ({ITYPE}==TYPEINT) - integer , pointer :: temp(:,:) -#else - real(r8), pointer :: temp(:,:) -#endif - integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: status ! error status - integer :: ndims ! ndims total for var - integer :: ndims_iod ! ndims iodesc for var - integer :: varid ! varid - integer :: n,i,j ! indices - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: iodnum ! iodesc num in list - integer :: start(4) ! netcdf start index - integer :: count(4) ! netcdf count index - logical :: varpresent ! if true, variable is on tape - integer :: lb1,lb2 - integer :: ub1,ub2 - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_2d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - start(:)=0 - count(:)=0 - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - -#if ({ITYPE}==TYPEDOUBLE) - if ( present(cnvrtnan2fill) )then - if (.not. cnvrtnan2fill) then - call shr_sys_abort( ' ERROR: cnvrtnan2fill present but NOT set to true -- MUST set it to TRUE if used'//& - errMsg(__FILE__, __LINE__)) - endif - end if -#endif - - lb1 = lbound(data, dim=1) - ub1 = ubound(data, dim=1) - lb2 = lbound(data, dim=2) - ub2 = ubound(data, dim=2) - - if (present(switchdim)) then - if (present(lowerb2)) lb2 = lowerb2 - if (present(upperb2)) ub2 = upperb2 - allocate(temp(lb2:ub2,lb1:ub1)) - end if - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column) then - start(:) = 1 ; count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then - count(3) = size(data,dim=2) - n=3 - if (present(nt)) then - start(4) = nt; count(4) = 1 - n=4 - end if - else - count(2) = size(data,dim=2) - n=2 - if (present(nt)) then - start(3) = nt ; count(3) = 1 - n=3 - end if - end if - if (present(switchdim)) then - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), temp) - do j = lb2,ub2 - do i = lb1,ub1 - data(i,j) = temp(j,i) - end do - end do - else - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), data) - endif - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid,vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid, dids(ndims), dimname) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum, switchdim=.true.) - else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - end if - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - if (present(switchdim)) then - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status) - do j = lb2,ub2 - do i = lb1,ub1 - data(i,j) = temp(j,i) - end do - end do - else - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - end if - end if -#if ({ITYPE}!=TYPEINT) - if ( present(cnvrtnan2fill) )then - do j = lb2,ub2 - do i = lb1,ub1 - if ( data(i,j) == spval )then - data(i,j) = nan - end if - end do - end do - end if -#endif - end if - if (present(readvar)) readvar = varpresent - - else if (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc , dids(1:ndims)) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - if (present(switchdim)) then - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum, switchdim=.true.) - else - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - end if - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - if (present(switchdim)) then - do j = lb2,ub2 - do i = lb1,ub1 - temp(j,i) = data(i,j) - end do - end do - end if -#if ({ITYPE}==TYPEINT) - if (present(switchdim)) then - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status, fillval=0) - else - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=0) - end if -#else - if (present(switchdim)) then - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, temp, status, fillval=spval) - else - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status, fillval=spval) - end if - if ( present(cnvrtnan2fill) )then - do j = lb2,ub2 - do i = lb1,ub1 - if ( isnan(data(i,j)) )then - data(i,j) = spval - end if - end do - end do - end if -#endif - - else - - if (masterproc) then - write(iulog,*) subname,' error: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - - endif - - if (present(switchdim)) then - deallocate(temp) - end if - - end subroutine ncd_io_2d_{TYPE} - - !----------------------------------------------------------------------- - - !TYPE int,double - subroutine ncd_io_3d_{TYPE}(varname, data, dim1name, flag, ncid, nt, readvar) - ! - ! !DESCRIPTION: - ! Netcdf i/o of 3d - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - {VTYPE} , pointer :: data(:,:,:) ! local decomposition input data - character(len=*) , intent(in) :: dim1name ! dimension 1 name - integer, optional, intent(in) :: nt ! time sample index - logical, optional, intent(out) :: readvar ! true => variable is on initial dataset (read only) - ! - ! !LOCAL VARIABLES: - integer :: ndim1,ndim2 - character(len=8) :: clmlevel ! clmlevel - character(len=32) :: dimname ! temporary - integer :: status ! error status - integer :: ndims ! ndims total for var - integer :: ndims_iod ! ndims iodesc for var - integer :: varid ! varid - integer :: n ! index - integer :: dims(4) ! dim sizes - integer :: dids(4) ! dim ids - integer :: iodnum ! iodesc num in list - integer :: start(5) ! netcdf start index - integer :: count(5) ! netcdf count index - logical :: varpresent ! if true, variable is on tape - type(iodesc_plus_type) , pointer :: iodesc_plus - type(var_desc_t) :: vardesc - character(len=*),parameter :: subname='ncd_io_3d_{TYPE}' ! subroutine name - !----------------------------------------------------------------------- - - clmlevel = dim1name - - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' ',trim(flag),' ',trim(varname),' ',trim(clmlevel) - end if - - if (flag == 'read') then - - call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent) - if (varpresent) then - if (single_column) then - start(:) = 1 - count(:) = 1 - call scam_field_offsets(ncid, clmlevel, vardesc, start, count) - if (trim(clmlevel) == grlnd) then - count(3) = size(data,dim=2); - count(4) = size(data,dim=3) - n=4 - if (present(nt)) then - start(5) = nt - count(5) = 1 - n=5 - end if - else - count(2) = size(data,dim=2) - count(3) = size(data,dim=3) - n=3 - if (present(nt)) then - start(4) = nt - count(4) = 1 - n=4 - end if - end if - status = pio_get_var(ncid, vardesc, start(1:n), count(1:n), data) - else - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid,vardesc, dids(1:ndims)) - status = pio_inq_dimname(ncid, dids(ndims), dimname) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - call pio_read_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - end if - end if - if (present(readvar)) readvar = varpresent - - else if (flag == 'write') then - - call ncd_inqvid(ncid, varname ,varid, vardesc) - status = pio_inq_varndims(ncid, vardesc, ndims) - status = pio_inq_vardimid(ncid, vardesc , dids(1:ndims)) - if (ndims == 0) then - write(iulog,*) trim(subname),' ERROR: ndims must be greater than 0' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - status = pio_inq_dimname(ncid,dids(ndims),dimname) - if ('time' == trim(dimname)) then - ndims_iod = ndims - 1 - else - ndims_iod = ndims - end if - do n = 1,ndims_iod - status = pio_inq_dimlen(ncid,dids(n),dims(n)) - enddo - call ncd_getiodesc(ncid, clmlevel, ndims_iod, dims(1:ndims_iod), dids(1:ndims_iod), & - PIO_{TYPE}, iodnum) - iodesc_plus => iodesc_list(iodnum) - if (present(nt)) then - call pio_setframe(ncid, vardesc, int(nt,kind=Pio_Offset_Kind)) - end if - call pio_write_darray(ncid, vardesc, iodesc_plus%iodesc, data, status) - - else - - if (masterproc) then - write(iulog,*) subname,' error: unsupported flag ',trim(flag) - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - - endif - - end subroutine ncd_io_3d_{TYPE} - - !------------------------------------------------------------------------ - - subroutine scam_field_offsets( ncid, dim1name, vardesc, start, count, & - found, posNOTonfile) - ! - ! !DESCRIPTION: - ! Read/Write initial data from/to netCDF instantaneous initial data file - ! - ! !USES: - use clm_varctl, only: scmlon,scmlat,single_column - use shr_scam_mod, only: shr_scam_getCloseLatLon - use shr_string_mod, only: shr_string_toLower - ! - ! !ARGUMENTS: - class(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: dim1name ! dimension 1 name - type(Var_desc_t) , intent(inout) :: vardesc ! variable descriptor - integer , intent(out) :: start(:) ! start index - integer , intent(out) :: count(:) ! count to retrieve - logical, optional , intent(out) :: found ! if present return true if found - ! dimensions on file else false if NOT present abort if can't find - logical, optional , intent(in) :: posNOTonfile ! Position is NOT on this file - ! - ! !LOCAL VARIABLES: - integer :: cc,i,ii ! index variable - integer :: data_offset ! offset into land array 1st column - integer :: ndata ! number of column (or pft points to read) - real(r8) , pointer :: cols1dlon(:) ! holds cols1d_ixy var - real(r8) , pointer :: cols1dlat(:) ! holds cols1d_jxy var - real(r8) , pointer :: pfts1dlon(:) ! holds pfts1d_ixy var - real(r8) , pointer :: pfts1dlat(:) ! holds pfts1d_jxy var - real(r8) , pointer :: land1dlon(:) ! holds land1d_ixy var - real(r8) , pointer :: land1dlat(:) ! holds land1d_jxy var - integer, allocatable :: cols(:) ! grid cell columns for scam - integer, allocatable :: pfts(:) ! grid cell pfts for scam - integer, allocatable :: landunits(:) ! grid cell landunits for scam - integer, allocatable :: dids(:) ! dim ids - integer :: varid ! netCDF variable id - integer :: status ! return code - integer :: latidx,lonidx ! latitude/longitude indices - real(r8) :: closelat,closelon ! closest latitude and longitude indices - integer :: ndims,dimlen ! number of dimensions in desired variable - character(len=32) :: dimname ! dimension name - character(len=32) :: subname = 'scam_field_offsets' - !------------------------------------------------------------------------ - - start(:)=1 - count(:)=1 - - if ( present(posNOTonfile) )then - if ( posNOTonfile )then - if ( .not. present(found) )then - call shr_sys_abort('ERROR: Bad subroutine calling structure posNOTonfile sent, but found was NOT!'//& - errMsg(__FILE__, __LINE__)) - end if - found = .false. - return - end if - end if - - ! find closest land grid cell for this point - - if ( present(found) )then - call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx,found) - if ( .not. found ) return - else - call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx) - end if - - call ncd_inqvdims(ncid,ndims,vardesc) - - allocate(dids(ndims)) - status = pio_inq_vardimid(ncid, vardesc, dids) - do i = 1,ndims - status = pio_inq_dimname(ncid,dids(i),dimname) - dimname=shr_string_toLower(dimname) - status = pio_inq_dimlen(ncid,dids(i),dimlen) - if ( trim(dimname)=='nj'.or. trim(dimname)=='lat'.or. trim(dimname)=='lsmlat') then - start(i)=latidx - count(i)=1 - else if ( trim(dimname)=='ni'.or. trim(dimname)=='lon'.or. trim(dimname)=='lsmlon') then - start(i)=lonidx - count(i)=1 - else if ( trim(dimname)=='column') then - - allocate (cols1dlon(dimlen)) - allocate (cols1dlat(dimlen)) - allocate (cols(dimlen)) - - status = pio_inq_varid(ncid, 'cols1d_lon', varid) - status = pio_get_var(ncid, varid, cols1dlon) - status = pio_inq_varid(ncid, 'cols1d_lat', varid) - status = pio_get_var(ncid, varid, cols1dlat) - - cols(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (cols1dlon(cc) == closelon.and.cols1dlat(cc) == closelat) then - cols(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any columns for this latitude ',latidx,' and longitude ',lonidx - call shr_sys_abort('ERROR:: no columns for this position'//errMsg(__FILE__, __LINE__)) - else - data_offset=cols(1) - end if - - deallocate (cols1dlon) - deallocate (cols1dlat) - deallocate (cols) - - start(i) = data_offset - count(i) = ndata - else if ( trim(dimname)=='pft') then - - allocate (pfts1dlon(dimlen)) - allocate (pfts1dlat(dimlen)) - allocate (pfts(dimlen)) - - status = pio_inq_varid(ncid, 'pfts1d_lon', varid) - status = pio_get_var(ncid, varid, pfts1dlon) - - status = pio_inq_varid(ncid, 'pfts1d_lat', varid) - status = pio_get_var(ncid, varid, pfts1dlat) - - pfts(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (pfts1dlon(cc) == closelon.and.pfts1dlat(cc) == closelat) then - pfts(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any pfts for this latitude ',closelat,' and longitude ',closelon - call shr_sys_abort('ERROR:: no PFTs for this position'//errMsg(__FILE__, __LINE__)) - else - data_offset=pfts(1) - end if - - deallocate (pfts1dlon) - deallocate (pfts1dlat) - deallocate (pfts) - - start(i) = data_offset - count(i) = ndata - else if ( trim(dimname)=='landunit') then - - allocate (land1dlon(dimlen)) - allocate (land1dlat(dimlen)) - allocate (landunits(dimlen)) - - status = pio_inq_varid(ncid, 'land1d_lon', varid) - status = pio_get_var(ncid, varid, land1dlon) - - status = pio_inq_varid(ncid, 'land1d_lat', varid) - status = pio_get_var(ncid, varid, land1dlat) - - landunits(:) = huge(1) - data_offset = huge(1) - ii = 1 - ndata = 0 - do cc = 1, dimlen - if (land1dlon(cc) == closelon.and.land1dlat(cc) == closelat) then - landunits(ii)=cc - ndata =ii - ii=ii+1 - end if - end do - if (ndata == 0) then - write(iulog,*)'couldnt find any landunits for this latitude ',closelat,' and longitude ',closelon - call shr_sys_abort('ERROR:: no landunits for this position'//errMsg(__FILE__, __LINE__)) - else - data_offset=landunits(1) - end if - - deallocate (land1dlon) - deallocate (land1dlat) - deallocate (landunits) - - start(i) = data_offset - count(i) = ndata - else - start(i)=1 - count(i)=dimlen - end if - enddo - deallocate(dids) - - end subroutine scam_field_offsets - - !------------------------------------------------------------------------ - - subroutine ncd_getiodesc(ncid, clmlevel, ndims, dims, dimids, & - xtype, iodnum, switchdim) - ! - ! !DESCRIPTION: - ! Returns an index to an io descriptor - ! - ! !ARGUMENTS: - class(file_desc_t) , intent(inout) :: ncid ! PIO file descriptor - character(len=8) , intent(in) :: clmlevel ! clmlevel - integer , intent(in) :: ndims ! ndims for var - integer , intent(in) :: dims(:) ! dim sizes - integer , intent(in) :: dimids(:) ! dim ids - integer , intent(in) :: xtype ! file external type - integer , intent(out) :: iodnum ! iodesc num in list - logical,optional , intent(in) :: switchdim ! switch level dimension and first dim - ! - ! !LOCAL VARIABLES: - integer :: k,m,n,cnt ! indices - integer :: basetype ! pio basetype - integer :: gsmap_lsize ! local size of gsmap - integer :: gsmap_gsize ! global size of gsmap - integer :: fullsize ! size of entire array on cdf - integer :: gsize ! global size of clmlevel - integer :: vsize ! other dimensions - integer :: vsize1, vsize2 ! other dimensions - integer :: status ! error status - logical :: found ! true => found created iodescriptor - integer :: ndims_file ! temporary - character(len=64) dimname_file ! dimension name on file - character(len=64) dimname_iodesc ! dimension name from io descriptor - type(mct_gsMap),pointer :: gsmap ! global seg map - integer, pointer,dimension(:) :: gsmOP ! gsmap ordered points - integer(pio_offset_kind), pointer :: compDOF(:) - character(len=32) :: subname = 'ncd_getiodesc' - !------------------------------------------------------------------------ - - ! Determining if need to create a new io descriptor - n = 1 - found = .false. - do while (n <= num_iodesc .and. .not.found) - if (ndims == iodesc_list(n)%ndims .and. xtype == iodesc_list(n)%type) then - found = .true. - ! First found implies that dimension sizes are the same - do m = 1,ndims - if (dims(m) /= iodesc_list(n)%dims(m)) then - found = .false. - endif - enddo - ! If found - then also check that dimension names are equal - - ! dimension ids in iodescriptor are only used to query dimension - ! names associated with that iodescriptor - if (found) then - status = PIO_inquire(ncid, ndimensions=ndims_file) - do m = 1,ndims - status = PIO_inq_dimname(ncid,dimids(m),dimname_file) - if (iodesc_list(n)%dimids(m) > ndims_file) then - found = .false. - exit - else - status = PIO_inq_dimname(ncid,iodesc_list(n)%dimids(m),dimname_iodesc) - if (trim(dimname_file) /= trim(dimname_iodesc)) then - found = .false. - exit - end if - end if - end do - end if - if (found) then - iodnum = n - if (iodnum > num_iodesc) then - write(iulog,*) trim(subname),' ERROR: iodnum out of range ',iodnum,num_iodesc - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - RETURN - endif - endif - n = n + 1 - enddo - - ! Creating a new io descriptor - - if (ndims > 0) then - num_iodesc = num_iodesc + 1 - if (num_iodesc > max_iodesc) then - write(iulog,*) trim(subname),' ERROR num_iodesc gt max_iodesc ',max_iodesc - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - iodnum = num_iodesc - if (masterproc .and. debug > 1) then - write(iulog,*) trim(subname),' creating iodesc at iodnum,ndims,dims(1:ndims),xtype',& - iodnum,ndims,dims(1:ndims),xtype - endif - end if - - if (xtype == pio_double ) then - basetype = PIO_DOUBLE - else if (xtype == pio_real) then - basetype = PIO_DOUBLE - else if (xtype == pio_int) then - basetype = PIO_INT - else - write(iulog,*) trim(subname),'ERROR: no match for xtype = ',xtype - call shr_sys_abort(errMsg(__FILE__,__LINE__)) - end if - - call get_clmlevel_gsmap(clmlevel,gsmap) - gsize = get_clmlevel_gsize(clmlevel) - gsmap_lsize = mct_gsmap_lsize(gsmap,mpicom) - gsmap_gsize = mct_gsmap_gsize(gsmap) - - call mct_gsmap_orderedPoints(gsmap,iam,gsmOP) - - fullsize = 1 - do n = 1,ndims - fullsize = fullsize*dims(n) - enddo - - vsize = fullsize / gsize - if (mod(fullsize,gsize) /= 0) then - write(iulog,*) subname,' ERROR in vsize ',fullsize,gsize,vsize - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - endif - - allocate(compDOF(gsmap_lsize*vsize)) - - if (present(switchdim)) then - if (switchdim) then - cnt = 0 - do m = 1,gsmap_lsize - do n = 1,vsize - cnt = cnt + 1 - compDOF(cnt) = (gsmOP(m)-1)*vsize + n - enddo - enddo - else - write(iulog,*) subname,' ERROR switch dims present must have switchdim true' - call shr_sys_abort(errMsg(__FILE__, __LINE__)) - end if - else ! currently allow for up to two vertical dimensions - if (vsize /= 1 .and. vsize /= dims(ndims)) then - vsize1 = vsize/dims(ndims) - vsize2 = dims(ndims) - if (vsize1*vsize2 /= vsize) then - write(iulog,*)'vsize1= ',vsize1,' vsize2= ',vsize2,' vsize= ',vsize - call shr_sys_abort('error in vsize1 and vsize2 computation'//errMsg(__FILE__, __LINE__)) - end if - cnt = 0 - do k = 1,vsize2 - do n = 1,vsize1 - do m = 1,gsmap_lsize - cnt = cnt + 1 - compDOF(cnt) = (k-1)*vsize1*gsmap_gsize + (n-1)*gsmap_gsize + gsmOP(m) - enddo - enddo - end do - else - cnt = 0 - do n = 1,vsize - do m = 1,gsmap_lsize - cnt = cnt + 1 - compDOF(cnt) = (n-1)*gsmap_gsize + gsmOP(m) - enddo - enddo - end if - end if - - if (debug > 1) then - do m = 0,npes-1 - if (iam == m) then - write(iulog,*) trim(subname),' sizes1 = ',iam,gsize,gsmap_gsize,gsmap_lsize - write(iulog,*) trim(subname),' sizes2 = ',iam,fullsize,npes,vsize - write(iulog,*) trim(subname),' compDOF = ',iam,size(compDOF),minval(compDOF),maxval(compDOF) - call shr_sys_flush(iulog) - endif - call mpi_barrier(mpicom,status) - enddo - endif - - deallocate(gsmOP) - - call pio_initdecomp(pio_subsystem, baseTYPE, dims(1:ndims), compDOF, iodesc_list(iodnum)%iodesc ) - - - deallocate(compDOF) - - iodesc_list(iodnum)%type = xtype - iodesc_list(iodnum)%ndims = ndims - iodesc_list(iodnum)%dims = 0 - iodesc_list(iodnum)%dims(1:ndims) = dims(1:ndims) - iodesc_list(iodnum)%dimids(1:ndims) = dimids(1:ndims) - - end subroutine ncd_getiodesc - -end module ncdio_pio diff --git a/src_clm40/main/ndepStreamMod.F90 b/src_clm40/main/ndepStreamMod.F90 deleted file mode 100644 index 1baebdbf37..0000000000 --- a/src_clm40/main/ndepStreamMod.F90 +++ /dev/null @@ -1,284 +0,0 @@ -module ndepStreamMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: ndepStreamMod -! -! !DESCRIPTION: -! Contains methods for reading in nitrogen deposition data file -! Also includes functions for dynamic ndep file handling and -! interpolation. -! -! !USES - use shr_kind_mod, only: r8 => shr_kind_r8, CL => shr_kind_cl - use shr_strdata_mod - use shr_stream_mod - use shr_string_mod - use shr_sys_mod - use shr_mct_mod - use mct_mod - - use spmdMod , only: mpicom, masterproc, comp_id, iam - use clm_varctl , only: iulog - use controlMod , only: NLFilename - use abortutils , only: endrun - use fileutils , only: getavu, relavu - use decompMod , only: get_proc_bounds, ldecomp, gsmap_lnd_gdc2glo - use domainMod , only: ldomain - -! !PUBLIC TYPES: - implicit none - private - save - -! !PUBLIC MEMBER FUNCTIONS: - public :: ndep_init ! position datasets for dynamic ndep - public :: ndep_interp ! interpolates between two years of ndep file data - public :: clm_domain_mct ! Sets up MCT domain for this resolution -! -!EOP - -! ! PRIVATE TYPES - - type(shr_strdata_type) :: sdat ! input data stream - integer :: stream_year_first_ndep ! first year in stream to use - integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with - -!======================================================================= -contains -!======================================================================= - - subroutine ndep_init( ) - - !----------------------------------------------------------------------- - ! Initialize data stream information. - !----------------------------------------------------------------------- - ! Uses: - use clm_varctl , only : inst_name - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - ! arguments - implicit none - - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: ndepmapalgo = 'bilinear' - character(*), parameter :: shr_strdata_unset = 'NOT_SET' - character(*), parameter :: subName = "('ndepdyn_init')" - character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, & - stream_fldFileName_ndep - - ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' - - ! Read ndepdyn_nml namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading ndepdyn_nml namelist') - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_ndep, mpicom) - call shr_mpi_bcast(stream_year_last_ndep, mpicom) - call shr_mpi_bcast(model_year_align_ndep, mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'ndepdyn stream settings:' - write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep - write(iulog,*) ' ' - endif - - call clm_domain_mct (dom_clm) - - call shr_strdata_create(sdat,name="clmndep", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_lnd_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_ndep, & - yearLast=stream_year_last_ndep, & - yearAlign=model_year_align_ndep, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_ndep), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_ndep)/),& - fldListFile='NDEP_year', & - fldListModel='NDEP_year', & - fillalgo='none', & - mapalgo=ndepmapalgo, & - calendar=get_calendar(), & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(sdat,'CLMNDEP data') - endif - - end subroutine ndep_init - -!================================================================ - - subroutine ndep_interp( ) - - !----------------------------------------------------------------------- - use decompMod , only : get_proc_bounds - use clm_time_manager, only : get_curr_date, get_days_per_year - use clm_varcon , only : secspday - use clm_atmlnd , only : clm_a2l - - ! Local variables - implicit none - integer :: g, ig, begg, endg - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: mcdate ! Current model date (yyyymmdd) - integer :: dayspyr ! days per year - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ndepdyn') - - call get_proc_bounds(begg, endg) - ig = 0 - dayspyr = get_days_per_year( ) - do g = begg,endg - ig = ig+1 - clm_a2l%forc_ndep(g) = sdat%avs(1)%rAttr(1,ig) / (secspday * dayspyr) - end do - - end subroutine ndep_interp - -!============================================================================== - - subroutine clm_domain_mct( dom_clm ) - - !------------------------------------------------------------------- - ! Set domain data type for internal clm grid - use clm_varcon , only : re - use domainMod , only : ldomain - use seq_flds_mod - implicit none - ! - ! arguments - type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model - ! - ! local variables - integer :: g,i,j ! index - integer :: begg, endg ! beginning and ending gridcell indices - integer :: lsize ! land model domain data size - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - lsize = mct_gsMap_lsize(gsmap_lnd_gdc2glo, mpicom) - call mct_gGrid_init( GGrid=dom_clm, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsmap_lnd_gdc2glo, iam, idata) - call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_clm,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_clm,"mask" ,data,lsize) - ! - ! Determine bounds - ! - call get_proc_bounds(begg, endg) - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = begg,endg - i = 1 + (g - begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) - - do g = begg,endg - i = 1 + (g - begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) - - do g = begg,endg - i = 1 + (g - begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_clm,"area",data,lsize) - - do g = begg,endg - i = 1 + (g - begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) - - do g = begg,endg - i = 1 + (g - begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine clm_domain_mct - -end module ndepStreamMod - diff --git a/src_clm40/main/organicFileMod.F90 b/src_clm40/main/organicFileMod.F90 deleted file mode 100644 index 0e7ff0888f..0000000000 --- a/src_clm40/main/organicFileMod.F90 +++ /dev/null @@ -1,113 +0,0 @@ -module organicFileMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: organicFileMod -! -! !DESCRIPTION: -! Contains methods for reading in organic matter data file which has -! organic matter density for each grid point and soil level -! -! !USES - use abortutils , only : endrun - use clm_varctl , only : iulog - use shr_kind_mod , only : r8 => shr_kind_r8 -! -! !PUBLIC TYPES: - implicit none - private - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: organicrd ! Read organic matter dataset -! -! !REVISION HISTORY: -! Created by David Lawrence, 4 May 2006 -! Revised by David Lawrence, 21 September 2007 -! Revised by David Lawrence, 14 October 2008 -! -!EOP -! -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: organicrd -! -! !INTERFACE: - subroutine organicrd(organic) -! -! !DESCRIPTION: -! Read the organic matter dataset. -! -! !USES: - use clm_varctl , only : fsurdat, single_column - use fileutils , only : getfil - use spmdMod , only : masterproc - use clmtype , only : grlnd - use domainMod , only : ldomain - use ncdio_pio -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: organic(:,:) ! organic matter density (kg/m3) -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by David Lawrence, 4 May 2006 -! Revised by David Lawrence, 21 September 2007 -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: locfn ! local file name - type(file_desc_t) :: ncid ! netcdf id - integer :: ni,nj,ns ! dimension sizes - logical :: isgrid2d ! true => file is 2d - logical :: readvar ! true => variable is on dataset - character(len=32) :: subname = 'organicrd' ! subroutine name -!----------------------------------------------------------------------- - - ! Initialize data to zero - no organic matter dataset - - organic(:,:) = 0._r8 - - ! Read data if file was specified in namelist - - if (fsurdat /= ' ') then - if (masterproc) then - write(iulog,*) 'Attempting to read organic matter data .....' - write(iulog,*) subname,trim(fsurdat) - end if - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - call ncd_inqfdims (ncid, isgrid2d, ni, nj, ns) - if (ldomain%ns /= ns .or. ldomain%ni /= ni .or. ldomain%nj /= nj) then - write(iulog,*)trim(subname), 'ldomain and input file do not match dims ' - write(iulog,*)trim(subname), 'ldomain%ni,ni,= ',ldomain%ni,ni - write(iulog,*)trim(subname), 'ldomain%nj,nj,= ',ldomain%nj,nj - write(iulog,*)trim(subname), 'ldomain%ns,ns,= ',ldomain%ns,ns - call endrun() - end if - - call ncd_io(ncid=ncid, varname='ORGANIC', flag='read', data=organic, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun('organicrd: errror reading ORGANIC') - - if ( masterproc )then - write(iulog,*) 'Successfully read organic matter data' - write(iulog,*) - end if - endif - - end subroutine organicrd - -end module organicFileMod diff --git a/src_clm40/main/pft2colMod.F90 b/src_clm40/main/pft2colMod.F90 deleted file mode 100644 index 6927cffa9c..0000000000 --- a/src_clm40/main/pft2colMod.F90 +++ /dev/null @@ -1,143 +0,0 @@ - -module pft2colMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: pft2colMod -! -! !DESCRIPTION: -! Contains calls to methods to perfom averages over from pfts to columns -! for model variables. -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use subgridAveMod - use clmtype -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: p2c ! obtain column properties from average over column pfts -! -! !REVISION HISTORY: -! 03/09/08: Created by Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: pft2col -! -! !INTERFACE: - subroutine pft2col (lbc, ubc, num_nolakec, filter_nolakec) -! -! !DESCRIPTION: -! Averages over all pfts for variables defined over both soil and lake -! to provide the column-level averages of state and flux variables -! defined at the pft level. -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points -! -! !REVISION HISTORY: -! 03/09/08: Created by Mariana Vertenstein -! -! -! !OTHER LOCAL VARIABLES: -!EOP - integer :: c,fc ! indices - integer :: num_allc ! number of total column points - integer :: filter_allc(ubc-lbc+1) ! filter for all column points - real(r8), pointer :: ptrp(:) ! pointer to input pft array - real(r8), pointer :: ptrc(:) ! pointer to output column array -! ----------------------------------------------------------------- - - ! Set up a filter for all column points - - num_allc = ubc-lbc+1 - fc = 0 - do c = lbc,ubc - fc = fc + 1 - filter_allc(fc) = c - end do - - ! Note: lake points are excluded from many of the following averages. For some fields, - ! this is because the field doesn't apply over lakes. However, for many others, this - ! is because the field is computed in HydrologyLake, which is called after this - ! routine; thus, for lakes, the column-level values of these fields are explicitly set - ! in HydrologyLakeMod. (The fields that are included here for lakes are computed - ! elsewhere, e.g., in BiogeophysicsLake.) - - ! Averaging for pft water state variables - - ptrp => pws%h2ocan - ptrc => pws_a%h2ocan - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ! Averaging for pft water flux variables - - ptrp => pwf%qflx_evap_tot - ptrc => pwf_a%qflx_evap_tot - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_rain_grnd - ptrc => pwf_a%qflx_rain_grnd - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_snow_grnd - ptrc => pwf_a%qflx_snow_grnd - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_snwcp_liq - ptrc => pwf_a%qflx_snwcp_liq - call p2c (num_allc, filter_allc, ptrp, ptrc) - - ptrp => pwf%qflx_snwcp_ice - ptrc => pwf_a%qflx_snwcp_ice - ! For lakes, this field is initially set in BiogeophysicsLake (which is called before - ! this routine; hence it is appropriate to include lake columns in this p2c call). - ! However, it is later overwritten in HydrologyLake, both on the pft and the column - ! level. - call p2c (num_allc, filter_allc, ptrp, ptrc) - - ptrp => pwf%qflx_tran_veg - ptrc => pwf_a%qflx_tran_veg - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_evap_grnd - ptrc => pwf_a%qflx_evap_grnd - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_evap_soi - ptrc => pwf_a%qflx_evap_soi - call p2c (num_allc, filter_allc, ptrp, ptrc) - - ptrp => pwf%qflx_prec_grnd - ptrc => pwf_a%qflx_prec_grnd - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_dew_grnd - ptrc => pwf_a%qflx_dew_grnd - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_sub_snow - ptrc => pwf_a%qflx_sub_snow - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - ptrp => pwf%qflx_dew_snow - ptrc => pwf_a%qflx_dew_snow - call p2c (num_nolakec, filter_nolakec, ptrp, ptrc) - - end subroutine pft2col - -end module pft2colMod diff --git a/src_clm40/main/pftdynMod.F90 b/src_clm40/main/pftdynMod.F90 deleted file mode 100644 index 42784bd835..0000000000 --- a/src_clm40/main/pftdynMod.F90 +++ /dev/null @@ -1,3224 +0,0 @@ -module pftdynMod - -!--------------------------------------------------------------------------- -!BOP -! -! !MODULE: pftdynMod -! -! !USES: - use spmdMod - use clmtype - use decompMod , only : get_proc_bounds - use clm_varsur , only : pctspec - use clm_varpar , only : max_pft_per_col - use clm_varctl , only : iulog, use_c13, use_cn, use_cndv - use shr_sys_mod , only : shr_sys_flush - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_inqdid, ncd_inqdlen, ncd_io, check_dim -! -! !DESCRIPTION: -! Determine pft weights at current time using dynamic landuse datasets. -! ASSUMES that only have one dynamic landuse dataset. -! -! !PUBLIC TYPES: - implicit none - private - save - public :: pftdyn_init - public :: pftdyn_interp - public :: pftdyn_wbal_init - public :: pftdyn_wbal - public :: pftdyn_cnbal - public :: pftwt_init - public :: pftwt_interp - public :: CNHarvest - public :: CNHarvestPftToColumn -! -! !REVISION HISTORY: -! Created by Peter Thornton -! slevis modified to handle CNDV and crop model -! 19 May 2009: PET - modified to handle harvest fluxes -! -!EOP -! -! ! PRIVATE TYPES - integer , pointer :: yearspft(:) - real(r8), pointer :: wtpft1(:,:) - real(r8), pointer :: wtpft2(:,:) - real(r8), pointer :: harvest(:) - real(r8), pointer :: wtcol_old(:) - integer :: nt1 - integer :: nt2 - integer :: ntimes - logical :: do_harvest - type(file_desc_t) :: ncid ! netcdf id -!--------------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_init -! -! !INTERFACE: - subroutine pftdyn_init() -! -! !DESCRIPTION: -! Initialize dynamic landuse dataset (position it to the right time samples -! that bound the initial model date) -! -! !USES: - use clm_time_manager, only : get_curr_date - use clm_varctl , only : flanduse_timeseries - use clm_varpar , only : numpft, maxpatch_pft - use fileutils , only : getfil -! -! !ARGUMENTS: - implicit none -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i,j,m,n,g ! indices - real(r8) :: sumpct ! sum for error check - integer :: varid ! netcdf ids - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - integer :: ier, ret ! error status - logical :: found ! true => input dataset bounding dates found - logical :: readvar ! true => variable is on input dataset - integer :: begg,endg ! beg/end indices for land gridcells - integer :: begl,endl ! beg/end indices for land landunits - integer :: begc,endc ! beg/end indices for land columns - integer :: begp,endp ! beg/end indices for land pfts - real(r8), pointer :: pctgla(:) ! percent of gcell is glacier - real(r8), pointer :: pctlak(:) ! percent of gcell is lake - real(r8), pointer :: pctwet(:) ! percent of gcell is wetland - real(r8), pointer :: pcturb(:) ! percent of gcell is urbanized - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - character(len=256) :: locfn ! local file name - character(len= 32) :: subname='pftdyn_init' ! subroutine name - !----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg,begl,endl,begc,endc,begp,endp) - - ! Error check - - if ( maxpatch_pft /= numpft+1 )then - call endrun( subname//' maxpatch_pft does NOT equal numpft+1 -- this is invalid for dynamic PFT case' ) - end if - - allocate(pctgla(begg:endg),pctlak(begg:endg)) - allocate(pctwet(begg:endg),pcturb(begg:endg)) - - ! Set pointers into derived type - - gptr => grc - - ! pctspec must be saved between time samples - ! position to first time sample - assume that first time sample must match starting date - ! check consistency - special landunits, grid, frac and mask - ! only do this once - - ! read data PCT_PFT corresponding to correct year - - allocate(wtpft1(begg:endg,0:numpft), wtpft2(begg:endg,0:numpft), stat=ier) - if (ier /= 0) then - call endrun( subname//' allocation error for wtpft1, wtpft2' ) - end if - - allocate(harvest(begg:endg),stat=ier) - if (ier /= 0) then - call endrun( subname//' allocation error for harvest') - end if - - allocate(wtcol_old(begp:endp),stat=ier) - if (ier /= 0) then - call endrun( subname//' allocation error for wtcol_old' ) - end if - - if (masterproc) then - write(iulog,*) 'Attempting to read pft dynamic landuse data .....' - end if - - ! Obtain file - call getfil (flanduse_timeseries, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! Obtain pft years from dynamic landuse file - - call ncd_inqdid(ncid, 'time', varid) - call ncd_inqdlen(ncid, varid, ntimes) - - ! Consistency check - - call check_dim(ncid, 'lsmpft', numpft+1) - - allocate (yearspft(ntimes), stat=ier) - if (ier /= 0) then - write(iulog,*) subname//' allocation error for yearspft'; call endrun() - end if - - call ncd_io(ncid=ncid, varname='YEAR', flag='read', data=yearspft) - - call ncd_io(ncid=ncid, varname='PCT_WETLAND', flag='read', data=pctwet, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_WETLAND NOT on landuse_timeseries file' ) - - call ncd_io(ncid=ncid, varname= 'PCT_LAKE', flag='read', data=pctlak, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_LAKE NOT on landuse_timeseries file' ) - - call ncd_io(ncid=ncid, varname= 'PCT_GLACIER', flag='read', data=pctgla, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_GLACIER NOT on landuse_timeseries file' ) - - call ncd_io(ncid=ncid, varname= 'PCT_URBAN' , flag='read', data=pcturb, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_URBAN NOT on landuse_timeseries file' ) - - ! Consistency check - do g = begg,endg - ! this was causing a fail, even though values are the same to within 1e-15 - ! if (pctlak(g)+pctwet(g)+pcturb(g)+pctgla(g) /= pctspec(g)) then - if (abs((pctlak(g)+pctwet(g)+pcturb(g)+pctgla(g))-pctspec(g)) > 1e-13_r8) then - write(iulog,*) subname//'mismatch between input pctspec = ',& - pctlak(g)+pctwet(g)+pcturb(g)+pctgla(g),& - ' and that obtained from surface dataset ', pctspec(g),' at g= ',g - call endrun() - end if - end do - - ! Determine if current date spans the years - ! If current year is less than first dynamic PFT timeseries year, - ! then use the first year from dynamic pft file for both nt1 and nt2, - ! forcing constant weights until the model year enters the dynamic - ! pft dataset timeseries range. - ! If current year is equal to or greater than the last dynamic pft - ! timeseries year, then use the last year for both nt1 and nt2, - ! forcing constant weights for the remainder of the simulation. - ! This mechanism permits the introduction of a dynamic pft period in the middle - ! of a simulation, with constant weights before and after the dynamic period. - ! PET: harvest - since harvest is specified as a rate for each year, this - ! approach will not work. Instead, need to seta flag that indicates harvest is - ! zero for the period before the beginning and after the end of the dynpft timeseries. - - call get_curr_date(year, mon, day, sec) - - if (year < yearspft(1)) then - nt1 = 1 - nt2 = 1 - do_harvest = .false. - else if (year >= yearspft(ntimes)) then - nt1 = ntimes - nt2 = ntimes - do_harvest = .false. - else - found = .false. - do n = 1,ntimes-1 - if (year == yearspft(n)) then - nt1 = n - nt2 = nt1 + 1 - found = .true. - do_harvest = .true. - end if - end do - if (.not. found) then - write(iulog,*) subname//' error: model year not found in landuse_timeseries file' - write(iulog,*)'model year = ',year - call endrun() - end if - end if - - ! Get pctpft time samples bracketing the current time - - if (masterproc) then - write(iulog,*) 'Get PFTDYN data for year: ', yearspft(nt1) - end if - call pftdyn_getdata(nt1, wtpft1, begg,endg,0,numpft) - if (masterproc) then - write(iulog,*) 'Get PFTDYN data for year: ', yearspft(nt2) - end if - call pftdyn_getdata(nt2, wtpft2, begg,endg,0,numpft) - - if (use_cn) then - ! Get harvest rate at the nt1 time - call pftdyn_getharvest(nt1,begg,endg) - end if - - ! convert weights from percent to proportion - do m = 0,numpft - do g = begg,endg - wtpft1(g,m) = wtpft1(g,m)/100._r8 - wtpft2(g,m) = wtpft2(g,m)/100._r8 - end do - end do - - deallocate(pctgla,pctlak,pctwet,pcturb) - - end subroutine pftdyn_init - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_interp -! -! !INTERFACE: - subroutine pftdyn_interp() -! -! !DESCRIPTION: -! Time interpolate dynamic landuse data to get pft weights for model time -! Note that harvest data are stored as rates (not weights) and so time interpolation is -! not necessary - the harvest rate is held constant through the year. This is consistent with -! the treatment of changing PFT weights, where interpolation of the annual endpoint weights leads to -! a constant rate of change in PFT weight through the year, with abrupt changes in the rate at -! annual boundaries. This routine is still used to get the next harvest time slice, when needed. -! This routine is also used to turn off the harvest switch when the model year runs past the end of -! the dynpft time series. -! -! !USES: - use clm_time_manager, only : get_curr_date, get_curr_calday, & - get_days_per_year - use clm_varcon , only : istsoil - use clm_varcon , only : istcrop - use clm_varpar , only : numpft - implicit none -! -! -! !LOCAL VARIABLES: -!EOP -! -! !ARGUMENTS: - integer :: begg,endg ! beg/end indices for land gridcells - integer :: begl,endl ! beg/end indices for land landunits - integer :: begc,endc ! beg/end indices for land columns - integer :: begp,endp ! beg/end indices for land pfts - integer :: i,j,m,p,l,g,c ! indices - integer :: year ! year (0, ...) for nstep+1 - integer :: mon ! month (1, ..., 12) for nstep+1 - integer :: day ! day of month (1, ..., 31) for nstep+1 - integer :: sec ! seconds into current date for nstep+1 - real(r8) :: cday ! current calendar day (1.0 = 0Z on Jan 1) - real(r8) :: days_per_year ! days per year - integer :: ier ! error status - integer :: lbc,ubc - real(r8) :: wt1 ! time interpolation weights - real(r8), pointer :: wtpfttot1(:) ! summation of pft weights for renormalization - real(r8), pointer :: wtpfttot2(:) ! summation of pft weights for renormalization - real(r8), parameter :: wtpfttol = 1.e-10 ! tolerance for pft weight renormalization - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - character(len=32) :: subname='pftdyn_interp' ! subroutine name -!----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg,begl,endl,begc,endc,begp,endp) - - ! Set pointers into derived type - - gptr => grc - lptr => lun - pptr => pft - - allocate(wtpfttot1(begc:endc),wtpfttot2(begc:endc)) - wtpfttot1(:) = 0._r8 - wtpfttot2(:) = 0._r8 - - ! Interpolat pctpft to current time step - output in pctpft_intp - ! Map interpolated pctpft to subgrid weights - ! assumes that maxpatch_pft = numpft + 1, that each landunit has only 1 column, - ! SCAM and CNDV have not been defined, and create_croplandunit = .false. - - ! If necessary, obtain new time sample - - ! Get current date - - call get_curr_date(year, mon, day, sec) - - ! Obtain new time sample if necessary. - ! The first condition is the regular crossing of a year boundary - ! when within the dynpft timeseries range. The second condition is - ! the case of the first entry into the dynpft timeseries range from - ! an earlier period of constant weights. - - if (year > yearspft(nt1) .or. (nt1 == 1 .and. nt2 == 1 .and. year == yearspft(1))) then - - if (year >= yearspft(ntimes)) then - nt1 = ntimes - nt2 = ntimes - else - nt1 = nt2 - nt2 = nt2 + 1 - do_harvest = .true. - end if - - if (year > yearspft(ntimes)) then - do_harvest = .false. - endif - - if (nt2 > ntimes .and. masterproc) then - write(iulog,*)subname,' error - current year is past input data boundary' - end if - - do m = 0,numpft - do g = begg,endg - wtpft1(g,m) = wtpft2(g,m) - end do - end do - - if (masterproc) then - write(iulog,*) 'Get PFTDYN data for year: ', yearspft(nt2) - end if - call pftdyn_getdata(nt2, wtpft2, begg,endg,0,numpft) - if (use_cn) then - call pftdyn_getharvest(nt1,begg,endg) - end if - - do m = 0,numpft - do g = begg,endg - wtpft2(g,m) = wtpft2(g,m)/100._r8 - end do - end do - - end if ! end of need new data if-block - - ! Interpolate pft weight to current time - - cday = get_curr_calday() - days_per_year = get_days_per_year() - - wt1 = ((days_per_year + 1._r8) - cday)/days_per_year - - do p = begp,endp - c = pptr%column(p) - g = pptr%gridcell(p) - l = pptr%landunit(p) - if (lptr%itype(l) == istsoil .or. lptr%itype(l) == istcrop) then - m = pptr%itype(p) - wtcol_old(p) = pptr%wtcol(p) -! --- recoded for roundoff performance, tcraig 3/07 from k.lindsay -! pptr%wtgcell(p) = wtpft1(g,m)*wt1 + wtpft2(g,m)*wt2 - wtpfttot1(c) = wtpfttot1(c)+pptr%wtgcell(p) - pptr%wtgcell(p) = wtpft2(g,m) + wt1*(wtpft1(g,m)-wtpft2(g,m)) - pptr%wtlunit(p) = pptr%wtgcell(p) / lptr%wtgcell(l) - pptr%wtcol(p) = pptr%wtgcell(p) / lptr%wtgcell(l) - wtpfttot2(c) = wtpfttot2(c)+pptr%wtgcell(p) - end if - - end do - -! Renormalize pft weights so that sum of pft weights relative to grid cell -! remain constant even as land cover changes. Doing this eliminates -! soil balance error warnings. (DML, 4/8/2009) - do p = begp,endp - c = pptr%column(p) - g = pptr%gridcell(p) - l = pptr%landunit(p) - if (lptr%itype(l) == istsoil .or. lptr%itype(l) == istcrop) then - if (wtpfttot2(c) /= 0 .and. & - abs(wtpfttot1(c)-wtpfttot2(c)) > wtpfttol) then - pptr%wtgcell(p) = (wtpfttot1(c)/wtpfttot2(c))*pptr%wtgcell(p) - pptr%wtlunit(p) = pptr%wtgcell(p) / lptr%wtgcell(l) - pptr%wtcol(p) = pptr%wtgcell(p) / lptr%wtgcell(l) - end if - end if - - end do - - deallocate(wtpfttot1,wtpfttot2) - - end subroutine pftdyn_interp - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_getdata -! -! !INTERFACE: - subroutine pftdyn_getdata(ntime, pctpft, begg, endg, pft0, maxpft) -! -! !DESCRIPTION: -! Obtain dynamic landuse data (pctpft) and make sure that -! percentage of PFTs sum to 100% cover for vegetated landunit -! -! !USES: - use clm_varpar , only : numpft -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ntime - integer , intent(in) :: begg,endg,pft0,maxpft - real(r8), intent(out) :: pctpft(begg:endg,pft0:maxpft) -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i,j,m,n - integer :: err, ierr, ret - real(r8) :: sumpct,sumerr ! temporary - real(r8), pointer :: arrayl(:,:) ! temporary array - logical :: readvar - - character(len=32) :: subname='pftdyn_getdata' ! subroutine name -!----------------------------------------------------------------------- - - allocate(arrayl(begg:endg,pft0:maxpft)) - call ncd_io(ncid=ncid, varname= 'PCT_PFT', flag='read', data=arrayl, & - dim1name=grlnd, nt=ntime, readvar=readvar) - pctpft(begg:endg,pft0:maxpft) = arrayl(begg:endg,pft0:maxpft) - deallocate(arrayl) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_PFT NOT on pftdyn file' ) - - err = 0 - do n = begg,endg - if (pctspec(n) < 100._r8) then - sumpct = 0._r8 - do m = 0, numpft - sumpct = sumpct + pctpft(n,m) * 100._r8/(100._r8-pctspec(n)) - end do - if (abs(sumpct - 100._r8) > 0.1_r8) then - err = 1; ierr = n; sumerr = sumpct - end if - if (sumpct < -0.000001_r8) then - err = 2; ierr = n; sumerr = sumpct - end if - end if - end do - if (err == 1) then - write(iulog,*) subname,' error: sum(pct) over numpft+1 is not = 100.',sumerr,ierr,pctspec(ierr),pctpft(ierr,:) - call endrun() - else if (err == 2) then - write(iulog,*)subname,' error: sum(pct) over numpft+1 is < 0.',sumerr,ierr,pctspec(ierr),pctpft(ierr,:) - call endrun() - end if - - end subroutine pftdyn_getdata - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_getharvest -! -! !INTERFACE: - subroutine pftdyn_getharvest(ntime, begg, endg) -! -! !DESCRIPTION: -! Obtain harvest data -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: ntime - integer , intent(IN) :: begg ! beg indices for land gridcells - integer , intent(IN) :: endg ! end indices for land gridcells -! -! -! !LOCAL VARIABLES: -!EOP - real(r8), pointer :: arrayl(:) ! temporary array - logical :: readvar - character(len=32) :: subname='pftdyn_getharvest' ! subroutine name -!----------------------------------------------------------------------- - - allocate(arrayl(begg:endg)) - - call ncd_io(ncid=ncid, varname= 'HARVEST_VH1', flag='read', data=arrayl, dim1name=grlnd, & - nt=ntime, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HARVEST_VH1 not on landuse_timeseries file' ) - harvest(begg:endg) = arrayl(begg:endg) - - call ncd_io(ncid=ncid, varname= 'HARVEST_VH2', flag='read', data=arrayl, dim1name=grlnd, & - nt=ntime, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HARVEST_VH2 not on landuse_timeseries file' ) - harvest(begg:endg) = harvest(begg:endg) + arrayl(begg:endg) - - call ncd_io(ncid=ncid, varname= 'HARVEST_SH1', flag='read', data=arrayl, dim1name=grlnd, & - nt=ntime, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HARVEST_SH1 not on landuse_timeseries file' ) - harvest(begg:endg) = harvest(begg:endg) + arrayl(begg:endg) - - call ncd_io(ncid=ncid, varname= 'HARVEST_SH2', flag='read', data=arrayl, dim1name=grlnd, & - nt=ntime, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HARVEST_SH2 not on landuse_timeseries file' ) - harvest(begg:endg) = harvest(begg:endg) + arrayl(begg:endg) - - call ncd_io(ncid=ncid, varname= 'HARVEST_SH3', flag='read', data=arrayl, dim1name=grlnd, & - nt=ntime, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: HARVEST_SH3 not on landuse_timeseries file' ) - harvest(begg:endg) = harvest(begg:endg) + arrayl(begg:endg) - - deallocate(arrayl) - - end subroutine pftdyn_getharvest - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_wbal_init -! -! !INTERFACE: - subroutine pftdyn_wbal_init( begc, endc ) -! -! !DESCRIPTION: -! initialize the column-level mass-balance correction term. -! Called in every timestep. -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begc, endc ! proc beginning and ending column indices -! -! -! !LOCAL VARIABLES: -!EOP - integer :: c ! indices - type(column_type), pointer :: cptr ! pointer to column derived subtype -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - cptr => col - - ! set column-level canopy water mass balance correction flux - ! term to 0 at the beginning of every timestep - - do c = begc,endc - cwf%h2ocan_loss(c) = 0._r8 - end do - - end subroutine pftdyn_wbal_init - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_wbal -! -! !INTERFACE: - subroutine pftdyn_wbal( begg, endg, begc, endc, begp, endp ) -! -! !DESCRIPTION: -! modify pft-level state and flux variables to maintain water balance with -! dynamic pft-weights. -! Canopy water balance does not need to consider harvest fluxes, since pft weights are -! not affected by harvest. -! -! !USES: - use clm_varcon , only : istsoil - use clm_varcon , only : istcrop - use clm_time_manager, only : get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begg ! beg indices for land gridcells - integer, intent(IN) :: endg ! end indices for land gridcells - integer, intent(IN) :: begc ! beg indices for land columns - integer, intent(IN) :: endc ! end indices for land columns - integer, intent(IN) :: begp ! beg indices for land plant function types - integer, intent(IN) :: endp ! end indices for land plant function types -! -! -! !LOCAL VARIABLES: -!EOP - integer :: pi,p,c,l,g ! indices - integer :: ier ! error code - real(r8) :: dtime ! land model time step (sec) - real(r8) :: dwt ! change in pft weight (relative to column) - real(r8) :: init_h2ocan ! initial canopy water mass - real(r8) :: new_h2ocan ! canopy water mass after weight shift - real(r8), allocatable :: loss_h2ocan(:) ! canopy water mass loss due to weight shift - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type), pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - character(len=32) :: subname='pftdyn_wbal' ! subroutine name -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - lptr => lun - cptr => col - pptr => pft - - ! Allocate loss_h2ocan - allocate(loss_h2ocan(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for loss_h2ocan'; call endrun() - end if - - ! Get time step - - dtime = get_step_size() - - ! set column-level canopy water mass balance correction flux - ! term to 0 at the beginning of every weight-shifting timestep - - do c = begc,endc - cwf%h2ocan_loss(c) = 0._r8 ! is this OR pftdyn_wbal_init redundant? - end do - - do p = begp,endp - l = pptr%landunit(p) - loss_h2ocan(p) = 0._r8 - - if (lptr%itype(l) == istsoil .or. lptr%itype(l) == istcrop) then - - ! calculate the change in weight for the timestep - dwt = pptr%wtcol(p)-wtcol_old(p) - - if (dwt > 0._r8) then - - ! if the pft gained weight, then the - ! initial canopy water state is redistributed over the - ! new (larger) area, conserving mass. - - pws%h2ocan(p) = pws%h2ocan(p) * (wtcol_old(p)/pptr%wtcol(p)) - - else if (dwt < 0._r8) then - - ! if the pft lost weight on the timestep, then the canopy water - ! mass associated with the lost weight is directed to a - ! column-level flux term that gets added to the precip flux - ! for every pft calculation in Hydrology1() - - init_h2ocan = pws%h2ocan(p) * wtcol_old(p) - loss_h2ocan(p) = pws%h2ocan(p) * (-dwt) - new_h2ocan = init_h2ocan - loss_h2ocan(p) - if (abs(new_h2ocan) < 1e-8_r8) then - new_h2ocan = 0._r8 - loss_h2ocan(p) = init_h2ocan - end if - if (pptr%wtcol(p) /= 0._r8) then - pws%h2ocan(p) = new_h2ocan/pptr%wtcol(p) - else - pws%h2ocan(p) = 0._r8 - loss_h2ocan(p) = init_h2ocan - end if - - - end if - - end if - end do - - do pi = 1,max_pft_per_col - do c = begc,endc - if (pi <= cptr%npfts(c)) then - p = cptr%pfti(c) + pi - 1 - cwf%h2ocan_loss(c) = cwf%h2ocan_loss(c) + loss_h2ocan(p)/dtime - end if - end do - end do - - ! Deallocate loss_h2ocan - deallocate(loss_h2ocan) - - end subroutine pftdyn_wbal - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftdyn_cnbal -! -! !INTERFACE: - subroutine pftdyn_cnbal( begc, endc, begp, endp ) -! -! !DESCRIPTION: -! modify pft-level state and flux variables to maintain carbon and nitrogen balance with -! dynamic pft-weights. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use shr_const_mod,only : SHR_CONST_PDB - use decompMod , only : get_proc_bounds - use clm_varcon , only : istsoil - use clm_varcon , only : istcrop - use clm_varpar , only : numveg, numpft - use pftvarcon , only : pconv, pprod10, pprod100 - use clm_varcon , only : c13ratio - use clm_time_manager, only : get_step_size -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begp, endp ! proc beginning and ending pft indices - integer, intent(IN) :: begc, endc ! proc beginning and ending column indices -! -! -! !LOCAL VARIABLES: -!EOP - integer :: pi,p,c,l,g ! indices - integer :: ier ! error code - real(r8) :: dwt ! change in pft weight (relative to column) - real(r8) :: dt ! land model time step (sec) - real(r8) :: init_h2ocan ! initial canopy water mass - real(r8) :: new_h2ocan ! canopy water mass after weight shift - real(r8), allocatable :: dwt_leafc_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_leafn_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_leafc13_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemc_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemn_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_deadstemc13_seed(:) ! pft-level mass gain due to seeding of new area - real(r8), allocatable :: dwt_frootc_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable :: dwt_livecrootc_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable :: dwt_deadcrootc_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_frootc13_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_livecrootc13_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_deadcrootc13_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_frootn_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_livecrootn_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: dwt_deadcrootn_to_litter(:) ! pft-level mass loss due to weight shift - real(r8), allocatable :: conv_cflux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable :: prod10_cflux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable :: prod100_cflux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: conv_c13flux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: prod10_c13flux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: prod100_c13flux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: conv_nflux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: prod10_nflux(:) ! pft-level mass loss due to weight shift - real(r8), allocatable, target :: prod100_nflux(:) ! pft-level mass loss due to weight shift - real(r8) :: c3_del13c ! typical del13C for C3 photosynthesis (permil, relative to PDB) - real(r8) :: c4_del13c ! typical del13C for C4 photosynthesis (permil, relative to PDB) - real(r8) :: c3_r1 ! isotope ratio (13c/12c) for C3 photosynthesis - real(r8) :: c4_r1 ! isotope ratio (13c/12c) for C4 photosynthesis - real(r8) :: c3_r2 ! isotope ratio (13c/[12c+13c]) for C3 photosynthesis - real(r8) :: c4_r2 ! isotope ratio (13c/[12c+13c]) for C4 photosynthesis - real(r8) :: t1,t2,wt_new,wt_old - real(r8) :: init_state, change_state, new_state - real(r8) :: tot_leaf, pleaf, pstor, pxfer - real(r8) :: leafc_seed, leafn_seed - real(r8) :: deadstemc_seed, deadstemn_seed - real(r8) :: leafc13_seed, deadstemc13_seed - real(r8), pointer :: dwt_ptr0, dwt_ptr1, dwt_ptr2, dwt_ptr3, ptr - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type), pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - integer , pointer :: pcolumn(:) ! column of corresponding pft - character(len=32) :: subname='pftdyn_cbal' ! subroutine name -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - lptr => lun - cptr => col - pptr => pft - pcolumn => pptr%column - - ! Allocate pft-level mass loss arrays - allocate(dwt_leafc_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafc_seed'; call endrun() - end if - allocate(dwt_leafn_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafn_seed'; call endrun() - end if - if (use_c13) then - allocate(dwt_leafc13_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_leafc13_seed'; call endrun() - end if - endif - allocate(dwt_deadstemc_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemc_seed'; call endrun() - end if - allocate(dwt_deadstemn_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemn_seed'; call endrun() - end if - if (use_c13) then - allocate(dwt_deadstemc13_seed(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadstemc13_seed'; call endrun() - end if - endif - allocate(dwt_frootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootc_to_litter'; call endrun() - end if - allocate(dwt_livecrootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootc_to_litter'; call endrun() - end if - allocate(dwt_deadcrootc_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootc_to_litter'; call endrun() - end if - if (use_c13) then - allocate(dwt_frootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootc13_to_litter'; call endrun() - end if - allocate(dwt_livecrootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootc13_to_litter'; call endrun() - end if - allocate(dwt_deadcrootc13_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootc13_to_litter'; call endrun() - end if - endif - allocate(dwt_frootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_frootn_to_litter'; call endrun() - end if - allocate(dwt_livecrootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_livecrootn_to_litter'; call endrun() - end if - allocate(dwt_deadcrootn_to_litter(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for dwt_deadcrootn_to_litter'; call endrun() - end if - allocate(conv_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_cflux'; call endrun() - end if - allocate(prod10_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod10_cflux'; call endrun() - end if - allocate(prod100_cflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod100_cflux'; call endrun() - end if - if (use_c13) then - allocate(conv_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_c13flux'; call endrun() - end if - allocate(prod10_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod10_c13flux'; call endrun() - end if - allocate(prod100_c13flux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod100_c13flux'; call endrun() - end if - endif - allocate(conv_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for conv_nflux'; call endrun() - end if - allocate(prod10_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod10_nflux'; call endrun() - end if - allocate(prod100_nflux(begp:endp), stat=ier) - if (ier /= 0) then - write(iulog,*)subname,' allocation error for prod100_nflux'; call endrun() - end if - - ! Get time step - dt = real( get_step_size(), r8 ) - - do p = begp,endp - c = pcolumn(p) - ! initialize all the pft-level local flux arrays - dwt_leafc_seed(p) = 0._r8 - dwt_leafn_seed(p) = 0._r8 - if (use_c13) then - dwt_leafc13_seed(p) = 0._r8 - endif - dwt_deadstemc_seed(p) = 0._r8 - dwt_deadstemn_seed(p) = 0._r8 - if (use_c13) then - dwt_deadstemc13_seed(p) = 0._r8 - endif - dwt_frootc_to_litter(p) = 0._r8 - dwt_livecrootc_to_litter(p) = 0._r8 - dwt_deadcrootc_to_litter(p) = 0._r8 - if (use_c13) then - dwt_frootc13_to_litter(p) = 0._r8 - dwt_livecrootc13_to_litter(p) = 0._r8 - dwt_deadcrootc13_to_litter(p) = 0._r8 - endif - dwt_frootn_to_litter(p) = 0._r8 - dwt_livecrootn_to_litter(p) = 0._r8 - dwt_deadcrootn_to_litter(p) = 0._r8 - conv_cflux(p) = 0._r8 - prod10_cflux(p) = 0._r8 - prod100_cflux(p) = 0._r8 - if (use_c13) then - conv_c13flux(p) = 0._r8 - prod10_c13flux(p) = 0._r8 - prod100_c13flux(p) = 0._r8 - endif - conv_nflux(p) = 0._r8 - prod10_nflux(p) = 0._r8 - prod100_nflux(p) = 0._r8 - - l = pptr%landunit(p) - if (lptr%itype(l) == istsoil .or. lptr%itype(l) == istcrop) then - - ! calculate the change in weight for the timestep - dwt = pptr%wtcol(p)-wtcol_old(p) - - ! PFTs for which weight increases on this timestep - if (dwt > 0._r8) then - - ! first identify PFTs that are initiating on this timestep - ! and set all the necessary state and flux variables - if (wtcol_old(p) == 0._r8) then - - ! set initial conditions for PFT that is being initiated - ! in this time step. Based on the settings in cnIniTimeVar. - - ! pft-level carbon state variables - pcs%leafc(p) = 0._r8 - pcs%leafc_storage(p) = 0._r8 - pcs%leafc_xfer(p) = 0._r8 - pcs%frootc(p) = 0._r8 - pcs%frootc_storage(p) = 0._r8 - pcs%frootc_xfer(p) = 0._r8 - pcs%livestemc(p) = 0._r8 - pcs%livestemc_storage(p) = 0._r8 - pcs%livestemc_xfer(p) = 0._r8 - pcs%deadstemc(p) = 0._r8 - pcs%deadstemc_storage(p) = 0._r8 - pcs%deadstemc_xfer(p) = 0._r8 - pcs%livecrootc(p) = 0._r8 - pcs%livecrootc_storage(p) = 0._r8 - pcs%livecrootc_xfer(p) = 0._r8 - pcs%deadcrootc(p) = 0._r8 - pcs%deadcrootc_storage(p) = 0._r8 - pcs%deadcrootc_xfer(p) = 0._r8 - pcs%gresp_storage(p) = 0._r8 - pcs%gresp_xfer(p) = 0._r8 - pcs%cpool(p) = 0._r8 - pcs%xsmrpool(p) = 0._r8 - pcs%pft_ctrunc(p) = 0._r8 - pcs%dispvegc(p) = 0._r8 - pcs%storvegc(p) = 0._r8 - pcs%totvegc(p) = 0._r8 - pcs%totpftc(p) = 0._r8 - - ! pft-level carbon-13 state variables - if (use_c13) then - pc13s%leafc(p) = 0._r8 - pc13s%leafc_storage(p) = 0._r8 - pc13s%leafc_xfer(p) = 0._r8 - pc13s%frootc(p) = 0._r8 - pc13s%frootc_storage(p) = 0._r8 - pc13s%frootc_xfer(p) = 0._r8 - pc13s%livestemc(p) = 0._r8 - pc13s%livestemc_storage(p) = 0._r8 - pc13s%livestemc_xfer(p) = 0._r8 - pc13s%deadstemc(p) = 0._r8 - pc13s%deadstemc_storage(p) = 0._r8 - pc13s%deadstemc_xfer(p) = 0._r8 - pc13s%livecrootc(p) = 0._r8 - pc13s%livecrootc_storage(p) = 0._r8 - pc13s%livecrootc_xfer(p) = 0._r8 - pc13s%deadcrootc(p) = 0._r8 - pc13s%deadcrootc_storage(p) = 0._r8 - pc13s%deadcrootc_xfer(p) = 0._r8 - pc13s%gresp_storage(p) = 0._r8 - pc13s%gresp_xfer(p) = 0._r8 - pc13s%cpool(p) = 0._r8 - pc13s%xsmrpool(p) = 0._r8 - pc13s%pft_ctrunc(p) = 0._r8 - pc13s%dispvegc(p) = 0._r8 - pc13s%storvegc(p) = 0._r8 - pc13s%totvegc(p) = 0._r8 - pc13s%totpftc(p) = 0._r8 - endif - - ! pft-level nitrogen state variables - pns%leafn(p) = 0._r8 - pns%leafn_storage(p) = 0._r8 - pns%leafn_xfer(p) = 0._r8 - pns%frootn(p) = 0._r8 - pns%frootn_storage(p) = 0._r8 - pns%frootn_xfer(p) = 0._r8 - pns%livestemn(p) = 0._r8 - pns%livestemn_storage(p) = 0._r8 - pns%livestemn_xfer(p) = 0._r8 - pns%deadstemn(p) = 0._r8 - pns%deadstemn_storage(p) = 0._r8 - pns%deadstemn_xfer(p) = 0._r8 - pns%livecrootn(p) = 0._r8 - pns%livecrootn_storage(p) = 0._r8 - pns%livecrootn_xfer(p) = 0._r8 - pns%deadcrootn(p) = 0._r8 - pns%deadcrootn_storage(p) = 0._r8 - pns%deadcrootn_xfer(p) = 0._r8 - pns%retransn(p) = 0._r8 - pns%npool(p) = 0._r8 - pns%pft_ntrunc(p) = 0._r8 - pns%dispvegn(p) = 0._r8 - pns%storvegn(p) = 0._r8 - pns%totvegn(p) = 0._r8 - pns%totpftn (p) = 0._r8 - - ! initialize same flux and epv variables that are set - ! in CNiniTimeVar - pcf%psnsun(p) = 0._r8 - pcf%psnsha(p) = 0._r8 - if (use_c13) then - pc13f%psnsun(p) = 0._r8 - pc13f%psnsha(p) = 0._r8 - endif - pps%laisun(p) = 0._r8 - pps%laisha(p) = 0._r8 - pps%lncsun(p) = 0._r8 - pps%lncsha(p) = 0._r8 - pps%vcmxsun(p) = 0._r8 - pps%vcmxsha(p) = 0._r8 - if (use_c13) then - pps%alphapsnsun(p) = 0._r8 - pps%alphapsnsha(p) = 0._r8 - endif - - pepv%dormant_flag(p) = 1._r8 - pepv%days_active(p) = 0._r8 - pepv%onset_flag(p) = 0._r8 - pepv%onset_counter(p) = 0._r8 - pepv%onset_gddflag(p) = 0._r8 - pepv%onset_fdd(p) = 0._r8 - pepv%onset_gdd(p) = 0._r8 - pepv%onset_swi(p) = 0.0_r8 - pepv%offset_flag(p) = 0._r8 - pepv%offset_counter(p) = 0._r8 - pepv%offset_fdd(p) = 0._r8 - pepv%offset_swi(p) = 0._r8 - pepv%lgsf(p) = 0._r8 - pepv%bglfr(p) = 0._r8 - pepv%bgtr(p) = 0._r8 - ! difference from CNiniTimeVar: using column-level - ! information to initialize annavg_t2m. - pepv%annavg_t2m(p) = cps%cannavg_t2m(c) - pepv%tempavg_t2m(p) = 0._r8 - pepv%gpp(p) = 0._r8 - pepv%availc(p) = 0._r8 - pepv%xsmrpool_recover(p) = 0._r8 - if (use_c13) then - pepv%xsmrpool_c13ratio(p) = c13ratio - endif - pepv%alloc_pnow(p) = 1._r8 - pepv%c_allometry(p) = 0._r8 - pepv%n_allometry(p) = 0._r8 - pepv%plant_ndemand(p) = 0._r8 - pepv%tempsum_potential_gpp(p) = 0._r8 - pepv%annsum_potential_gpp(p) = 0._r8 - pepv%tempmax_retransn(p) = 0._r8 - pepv%annmax_retransn(p) = 0._r8 - pepv%avail_retransn(p) = 0._r8 - pepv%plant_nalloc(p) = 0._r8 - pepv%plant_calloc(p) = 0._r8 - pepv%excess_cflux(p) = 0._r8 - pepv%downreg(p) = 0._r8 - pepv%prev_leafc_to_litter(p) = 0._r8 - pepv%prev_frootc_to_litter(p) = 0._r8 - pepv%tempsum_npp(p) = 0._r8 - pepv%annsum_npp(p) = 0._r8 - if (use_c13) then - pepv%rc13_canair(p) = 0._r8 - pepv%rc13_psnsun(p) = 0._r8 - pepv%rc13_psnsha(p) = 0._r8 - endif - - end if ! end initialization of new pft - - ! (still in dwt > 0 block) - - ! set the seed sources for leaf and deadstem - ! leaf source is split later between leaf, leaf_storage, leaf_xfer - leafc_seed = 0._r8 - leafn_seed = 0._r8 - if (use_c13) then - leafc13_seed = 0._r8 - endif - deadstemc_seed = 0._r8 - deadstemn_seed = 0._r8 - if (use_c13) then - deadstemc13_seed = 0._r8 - endif - if (pptr%itype(p) /= 0) then - leafc_seed = 1._r8 - leafn_seed = leafc_seed / pftcon%leafcn(pptr%itype(p)) - if (pftcon%woody(pptr%itype(p)) == 1._r8) then - deadstemc_seed = 0.1_r8 - deadstemn_seed = deadstemc_seed / pftcon%deadwdcn(pptr%itype(p)) - end if - - if (use_c13) then - ! 13c state is initialized assuming del13c = -28 permil for C3, and -13 permil for C4. - ! That translates to ratios of (13c/(12c+13c)) of 0.01080455 for C3, and 0.01096945 for C4 - ! based on the following formulae: - ! r1 (13/12) = PDB + (del13c * PDB)/1000.0 - ! r2 (13/(13+12)) = r1/(1+r1) - ! PDB = 0.0112372_R8 (ratio of 13C/12C in Pee Dee Belemnite, C isotope standard) - c3_del13c = -28._r8 - c4_del13c = -13._r8 - c3_r1 = SHR_CONST_PDB + ((c3_del13c*SHR_CONST_PDB)/1000._r8) - c3_r2 = c3_r1/(1._r8 + c3_r1) - c4_r1 = SHR_CONST_PDB + ((c4_del13c*SHR_CONST_PDB)/1000._r8) - c4_r2 = c4_r1/(1._r8 + c4_r1) - - if (pftcon%c3psn(pptr%itype(p)) == 1._r8) then - leafc13_seed = leafc_seed * c3_r2 - deadstemc13_seed = deadstemc_seed * c3_r2 - else - leafc13_seed = leafc_seed * c4_r2 - deadstemc13_seed = deadstemc_seed * c4_r2 - end if - endif - end if - - ! When PFT area expands (dwt > 0), the pft-level mass density - ! is modified to conserve the original pft mass distributed - ! over the new (larger) area, plus a term to account for the - ! introduction of new seed source for leaf and deadstem - t1 = wtcol_old(p)/pptr%wtcol(p) - t2 = dwt/pptr%wtcol(p) - - tot_leaf = pcs%leafc(p) + pcs%leafc_storage(p) + pcs%leafc_xfer(p) - pleaf = 0._r8 - pstor = 0._r8 - pxfer = 0._r8 - if (tot_leaf /= 0._r8) then - ! when adding seed source to non-zero leaf state, use current proportions - pleaf = pcs%leafc(p)/tot_leaf - pstor = pcs%leafc_storage(p)/tot_leaf - pxfer = pcs%leafc_xfer(p)/tot_leaf - else - ! when initiating from zero leaf state, use evergreen flag to set proportions - if (pftcon%evergreen(pptr%itype(p)) == 1._r8) then - pleaf = 1._r8 - else - pstor = 1._r8 - end if - end if - pcs%leafc(p) = pcs%leafc(p)*t1 + leafc_seed*pleaf*t2 - pcs%leafc_storage(p) = pcs%leafc_storage(p)*t1 + leafc_seed*pstor*t2 - pcs%leafc_xfer(p) = pcs%leafc_xfer(p)*t1 + leafc_seed*pxfer*t2 - pcs%frootc(p) = pcs%frootc(p) * t1 - pcs%frootc_storage(p) = pcs%frootc_storage(p) * t1 - pcs%frootc_xfer(p) = pcs%frootc_xfer(p) * t1 - pcs%livestemc(p) = pcs%livestemc(p) * t1 - pcs%livestemc_storage(p) = pcs%livestemc_storage(p) * t1 - pcs%livestemc_xfer(p) = pcs%livestemc_xfer(p) * t1 - pcs%deadstemc(p) = pcs%deadstemc(p)*t1 + deadstemc_seed*t2 - pcs%deadstemc_storage(p) = pcs%deadstemc_storage(p) * t1 - pcs%deadstemc_xfer(p) = pcs%deadstemc_xfer(p) * t1 - pcs%livecrootc(p) = pcs%livecrootc(p) * t1 - pcs%livecrootc_storage(p) = pcs%livecrootc_storage(p) * t1 - pcs%livecrootc_xfer(p) = pcs%livecrootc_xfer(p) * t1 - pcs%deadcrootc(p) = pcs%deadcrootc(p) * t1 - pcs%deadcrootc_storage(p) = pcs%deadcrootc_storage(p) * t1 - pcs%deadcrootc_xfer(p) = pcs%deadcrootc_xfer(p) * t1 - pcs%gresp_storage(p) = pcs%gresp_storage(p) * t1 - pcs%gresp_xfer(p) = pcs%gresp_xfer(p) * t1 - pcs%cpool(p) = pcs%cpool(p) * t1 - pcs%xsmrpool(p) = pcs%xsmrpool(p) * t1 - pcs%pft_ctrunc(p) = pcs%pft_ctrunc(p) * t1 - pcs%dispvegc(p) = pcs%dispvegc(p) * t1 - pcs%storvegc(p) = pcs%storvegc(p) * t1 - pcs%totvegc(p) = pcs%totvegc(p) * t1 - pcs%totpftc(p) = pcs%totpftc(p) * t1 - - ! pft-level carbon-13 state variables - if (use_c13) then - tot_leaf = pc13s%leafc(p) + pc13s%leafc_storage(p) + pc13s%leafc_xfer(p) - pleaf = 0._r8 - pstor = 0._r8 - pxfer = 0._r8 - if (tot_leaf /= 0._r8) then - pleaf = pc13s%leafc(p)/tot_leaf - pstor = pc13s%leafc_storage(p)/tot_leaf - pxfer = pc13s%leafc_xfer(p)/tot_leaf - else - ! when initiating from zero leaf state, use evergreen flag to set proportions - if (pftcon%evergreen(pptr%itype(p)) == 1._r8) then - pleaf = 1._r8 - else - pstor = 1._r8 - end if - end if - pc13s%leafc(p) = pc13s%leafc(p)*t1 + leafc13_seed*pleaf*t2 - pc13s%leafc_storage(p) = pc13s%leafc_storage(p)*t1 + leafc13_seed*pstor*t2 - pc13s%leafc_xfer(p) = pc13s%leafc_xfer(p)*t1 + leafc13_seed*pxfer*t2 - pc13s%frootc(p) = pc13s%frootc(p) * t1 - pc13s%frootc_storage(p) = pc13s%frootc_storage(p) * t1 - pc13s%frootc_xfer(p) = pc13s%frootc_xfer(p) * t1 - pc13s%livestemc(p) = pc13s%livestemc(p) * t1 - pc13s%livestemc_storage(p) = pc13s%livestemc_storage(p) * t1 - pc13s%livestemc_xfer(p) = pc13s%livestemc_xfer(p) * t1 - pc13s%deadstemc(p) = pc13s%deadstemc(p)*t1 + deadstemc13_seed*t2 - pc13s%deadstemc_storage(p) = pc13s%deadstemc_storage(p) * t1 - pc13s%deadstemc_xfer(p) = pc13s%deadstemc_xfer(p) * t1 - pc13s%livecrootc(p) = pc13s%livecrootc(p) * t1 - pc13s%livecrootc_storage(p) = pc13s%livecrootc_storage(p) * t1 - pc13s%livecrootc_xfer(p) = pc13s%livecrootc_xfer(p) * t1 - pc13s%deadcrootc(p) = pc13s%deadcrootc(p) * t1 - pc13s%deadcrootc_storage(p) = pc13s%deadcrootc_storage(p) * t1 - pc13s%deadcrootc_xfer(p) = pc13s%deadcrootc_xfer(p) * t1 - pc13s%gresp_storage(p) = pc13s%gresp_storage(p) * t1 - pc13s%gresp_xfer(p) = pc13s%gresp_xfer(p) * t1 - pc13s%cpool(p) = pc13s%cpool(p) * t1 - pc13s%xsmrpool(p) = pc13s%xsmrpool(p) * t1 - pc13s%pft_ctrunc(p) = pc13s%pft_ctrunc(p) * t1 - pc13s%dispvegc(p) = pc13s%dispvegc(p) * t1 - pc13s%storvegc(p) = pc13s%storvegc(p) * t1 - pc13s%totvegc(p) = pc13s%totvegc(p) * t1 - pc13s%totpftc(p) = pc13s%totpftc(p) * t1 - endif - - tot_leaf = pns%leafn(p) + pns%leafn_storage(p) + pns%leafn_xfer(p) - pleaf = 0._r8 - pstor = 0._r8 - pxfer = 0._r8 - if (tot_leaf /= 0._r8) then - pleaf = pns%leafn(p)/tot_leaf - pstor = pns%leafn_storage(p)/tot_leaf - pxfer = pns%leafn_xfer(p)/tot_leaf - else - ! when initiating from zero leaf state, use evergreen flag to set proportions - if (pftcon%evergreen(pptr%itype(p)) == 1._r8) then - pleaf = 1._r8 - else - pstor = 1._r8 - end if - end if - ! pft-level nitrogen state variables - pns%leafn(p) = pns%leafn(p)*t1 + leafn_seed*pleaf*t2 - pns%leafn_storage(p) = pns%leafn_storage(p)*t1 + leafn_seed*pstor*t2 - pns%leafn_xfer(p) = pns%leafn_xfer(p)*t1 + leafn_seed*pxfer*t2 - pns%frootn(p) = pns%frootn(p) * t1 - pns%frootn_storage(p) = pns%frootn_storage(p) * t1 - pns%frootn_xfer(p) = pns%frootn_xfer(p) * t1 - pns%livestemn(p) = pns%livestemn(p) * t1 - pns%livestemn_storage(p) = pns%livestemn_storage(p) * t1 - pns%livestemn_xfer(p) = pns%livestemn_xfer(p) * t1 - pns%deadstemn(p) = pns%deadstemn(p)*t1 + deadstemn_seed*t2 - pns%deadstemn_storage(p) = pns%deadstemn_storage(p) * t1 - pns%deadstemn_xfer(p) = pns%deadstemn_xfer(p) * t1 - pns%livecrootn(p) = pns%livecrootn(p) * t1 - pns%livecrootn_storage(p) = pns%livecrootn_storage(p) * t1 - pns%livecrootn_xfer(p) = pns%livecrootn_xfer(p) * t1 - pns%deadcrootn(p) = pns%deadcrootn(p) * t1 - pns%deadcrootn_storage(p) = pns%deadcrootn_storage(p) * t1 - pns%deadcrootn_xfer(p) = pns%deadcrootn_xfer(p) * t1 - pns%retransn(p) = pns%retransn(p) * t1 - pns%npool(p) = pns%npool(p) * t1 - pns%pft_ntrunc(p) = pns%pft_ntrunc(p) * t1 - pns%dispvegn(p) = pns%dispvegn(p) * t1 - pns%storvegn(p) = pns%storvegn(p) * t1 - pns%totvegn(p) = pns%totvegn(p) * t1 - pns%totpftn(p) = pns%totpftn(p) * t1 - - ! update temporary seed source arrays - ! These are calculated in terms of the required contributions from - ! column-level seed source - dwt_leafc_seed(p) = leafc_seed * dwt - if (use_c13) then - dwt_leafc13_seed(p) = leafc13_seed * dwt - endif - dwt_leafn_seed(p) = leafn_seed * dwt - dwt_deadstemc_seed(p) = deadstemc_seed * dwt - if (use_c13) then - dwt_deadstemc13_seed(p) = deadstemc13_seed * dwt - endif - dwt_deadstemn_seed(p) = deadstemn_seed * dwt - - else if (dwt < 0._r8) then - - ! if the pft lost weight on the timestep, then the carbon and nitrogen state - ! variables are directed to litter, CWD, and wood product pools. - - ! N.B. : the conv_cflux, prod10_cflux, and prod100_cflux fluxes are accumulated - ! as negative values, but the fluxes for pft-to-litter are accumulated as - ! positive values - - ! set local weight variables for this pft - wt_new = pptr%wtcol(p) - wt_old = wtcol_old(p) - - !--------------- - ! C state update - !--------------- - - ! leafc - ptr => pcs%leafc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! leafc_storage - ptr => pcs%leafc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! leafc_xfer - ptr => pcs%leafc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! frootc - ptr => pcs%frootc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_frootc_to_litter(p) = dwt_frootc_to_litter(p) - change_state - else - ptr = 0._r8 - dwt_frootc_to_litter(p) = dwt_frootc_to_litter(p) + init_state - end if - - ! frootc_storage - ptr => pcs%frootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! frootc_xfer - ptr => pcs%frootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! livestemc - ptr => pcs%livestemc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! livestemc_storage - ptr => pcs%livestemc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! livestemc_xfer - ptr => pcs%livestemc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! deadstemc - ptr => pcs%deadstemc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state*pconv(pptr%itype(p)) - prod10_cflux(p) = prod10_cflux(p) + change_state*pprod10(pptr%itype(p)) - prod100_cflux(p) = prod100_cflux(p) + change_state*pprod100(pptr%itype(p)) - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state*pconv(pptr%itype(p)) - prod10_cflux(p) = prod10_cflux(p) - init_state*pprod10(pptr%itype(p)) - prod100_cflux(p) = prod100_cflux(p) - init_state*pprod100(pptr%itype(p)) - end if - - ! deadstemc_storage - ptr => pcs%deadstemc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! deadstemc_xfer - ptr => pcs%deadstemc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! livecrootc - ptr => pcs%livecrootc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_livecrootc_to_litter(p) = dwt_livecrootc_to_litter(p) - change_state - else - ptr = 0._r8 - dwt_livecrootc_to_litter(p) = dwt_livecrootc_to_litter(p) + init_state - end if - - ! livecrootc_storage - ptr => pcs%livecrootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! livecrootc_xfer - ptr => pcs%livecrootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! deadcrootc - ptr => pcs%deadcrootc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_deadcrootc_to_litter(p) = dwt_deadcrootc_to_litter(p) - change_state - else - ptr = 0._r8 - dwt_deadcrootc_to_litter(p) = dwt_deadcrootc_to_litter(p) + init_state - end if - - ! deadcrootc_storage - ptr => pcs%deadcrootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! deadcrootc_xfer - ptr => pcs%deadcrootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! gresp_storage - ptr => pcs%gresp_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! gresp_xfer - ptr => pcs%gresp_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! cpool - ptr => pcs%cpool(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! xsmrpool - ptr => pcs%xsmrpool(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - ! pft_ctrunc - ptr => pcs%pft_ctrunc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - conv_cflux(p) = conv_cflux(p) + change_state - else - ptr = 0._r8 - conv_cflux(p) = conv_cflux(p) - init_state - end if - - if (use_c13) then - !----------------- - ! C13 state update - !----------------- - - ! set pointers to the conversion and product pool fluxes for this pft - ! dwt_ptr0 is reserved for local assignment to dwt_xxx_to_litter fluxes - dwt_ptr1 => conv_c13flux(p) - dwt_ptr2 => prod10_c13flux(p) - dwt_ptr3 => prod100_c13flux(p) - - ! leafc - ptr => pc13s%leafc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! leafc_storage - ptr => pc13s%leafc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! leafc_xfer - ptr => pc13s%leafc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! frootc - ptr => pc13s%frootc(p) - dwt_ptr0 => dwt_frootc13_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! frootc_storage - ptr => pc13s%frootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! frootc_xfer - ptr => pc13s%frootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemc - ptr => pc13s%livestemc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemc_storage - ptr => pc13s%livestemc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemc_xfer - ptr => pc13s%livestemc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadstemc - ptr => pc13s%deadstemc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state*pconv(pptr%itype(p)) - dwt_ptr2 = dwt_ptr2 + change_state*pprod10(pptr%itype(p)) - dwt_ptr3 = dwt_ptr3 + change_state*pprod100(pptr%itype(p)) - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state*pconv(pptr%itype(p)) - dwt_ptr2 = dwt_ptr2 - init_state*pprod10(pptr%itype(p)) - dwt_ptr3 = dwt_ptr3 - init_state*pprod100(pptr%itype(p)) - end if - - ! deadstemc_storage - ptr => pc13s%deadstemc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadstemc_xfer - ptr => pc13s%deadstemc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livecrootc - ptr => pc13s%livecrootc(p) - dwt_ptr0 => dwt_livecrootc13_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! livecrootc_storage - ptr => pc13s%livecrootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livecrootc_xfer - ptr => pc13s%livecrootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadcrootc - ptr => pc13s%deadcrootc(p) - dwt_ptr0 => dwt_deadcrootc13_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! deadcrootc_storage - ptr => pc13s%deadcrootc_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadcrootc_xfer - ptr => pc13s%deadcrootc_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! gresp_storage - ptr => pc13s%gresp_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! gresp_xfer - ptr => pc13s%gresp_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! cpool - ptr => pc13s%cpool(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! pft_ctrunc - ptr => pc13s%pft_ctrunc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - endif - - !--------------- - ! N state update - !--------------- - - ! set pointers to the conversion and product pool fluxes for this pft - ! dwt_ptr0 is reserved for local assignment to dwt_xxx_to_litter fluxes - dwt_ptr1 => conv_nflux(p) - dwt_ptr2 => prod10_nflux(p) - dwt_ptr3 => prod100_nflux(p) - - ! leafn - ptr => pns%leafn(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! leafn_storage - ptr => pns%leafn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! leafn_xfer - ptr => pns%leafn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! frootn - ptr => pns%frootn(p) - dwt_ptr0 => dwt_frootn_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! frootn_storage - ptr => pns%frootn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! frootn_xfer - ptr => pns%frootn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemn - ptr => pns%livestemn(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemn_storage - ptr => pns%livestemn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livestemn_xfer - ptr => pns%livestemn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadstemn - ptr => pns%deadstemn(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state*pconv(pptr%itype(p)) - dwt_ptr2 = dwt_ptr2 + change_state*pprod10(pptr%itype(p)) - dwt_ptr3 = dwt_ptr3 + change_state*pprod100(pptr%itype(p)) - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state*pconv(pptr%itype(p)) - dwt_ptr2 = dwt_ptr2 - init_state*pprod10(pptr%itype(p)) - dwt_ptr3 = dwt_ptr3 - init_state*pprod100(pptr%itype(p)) - end if - - ! deadstemn_storage - ptr => pns%deadstemn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadstemn_xfer - ptr => pns%deadstemn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livecrootn - ptr => pns%livecrootn(p) - dwt_ptr0 => dwt_livecrootn_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! livecrootn_storage - ptr => pns%livecrootn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! livecrootn_xfer - ptr => pns%livecrootn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadcrootn - ptr => pns%deadcrootn(p) - dwt_ptr0 => dwt_deadcrootn_to_litter(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr0 = dwt_ptr0 - change_state - else - ptr = 0._r8 - dwt_ptr0 = dwt_ptr0 + init_state - end if - - ! deadcrootn_storage - ptr => pns%deadcrootn_storage(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! deadcrootn_xfer - ptr => pns%deadcrootn_xfer(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! retransn - ptr => pns%retransn(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! npool - ptr => pns%npool(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - ! pft_ntrunc - ptr => pns%pft_ntrunc(p) - init_state = ptr*wt_old - change_state = ptr*dwt - new_state = init_state+change_state - if (wt_new /= 0._r8) then - ptr = new_state/wt_new - dwt_ptr1 = dwt_ptr1 + change_state - else - ptr = 0._r8 - dwt_ptr1 = dwt_ptr1 - init_state - end if - - end if ! weight decreasing - end if ! is soil - end do ! pft loop - - ! calculate column-level seeding fluxes - do pi = 1,max_pft_per_col - do c = begc, endc - if ( pi <= cptr%npfts(c) ) then - p = cptr%pfti(c) + pi - 1 - - ! C fluxes - ccf%dwt_seedc_to_leaf(c) = ccf%dwt_seedc_to_leaf(c) + dwt_leafc_seed(p)/dt - ccf%dwt_seedc_to_deadstem(c) = ccf%dwt_seedc_to_deadstem(c) & - + dwt_deadstemc_seed(p)/dt - - ! C13 fluxes - if (use_c13) then - cc13f%dwt_seedc_to_leaf(c) = cc13f%dwt_seedc_to_leaf(c) + dwt_leafc13_seed(p)/dt - cc13f%dwt_seedc_to_deadstem(c) = cc13f%dwt_seedc_to_deadstem(c) & - + dwt_deadstemc13_seed(p)/dt - endif - - ! N fluxes - cnf%dwt_seedn_to_leaf(c) = cnf%dwt_seedn_to_leaf(c) + dwt_leafn_seed(p)/dt - cnf%dwt_seedn_to_deadstem(c) = cnf%dwt_seedn_to_deadstem(c) & - + dwt_deadstemn_seed(p)/dt - end if - end do - end do - - - ! calculate pft-to-column for fluxes into litter and CWD pools - do pi = 1,max_pft_per_col - do c = begc, endc - if ( pi <= cptr%npfts(c) ) then - p = cptr%pfti(c) + pi - 1 - - ! fine root litter carbon fluxes - ccf%dwt_frootc_to_litr1c(c) = ccf%dwt_frootc_to_litr1c(c) + & - (dwt_frootc_to_litter(p)*pftcon%fr_flab(pptr%itype(p)))/dt - ccf%dwt_frootc_to_litr2c(c) = ccf%dwt_frootc_to_litr2c(c) + & - (dwt_frootc_to_litter(p)*pftcon%fr_fcel(pptr%itype(p)))/dt - ccf%dwt_frootc_to_litr3c(c) = ccf%dwt_frootc_to_litr3c(c) + & - (dwt_frootc_to_litter(p)*pftcon%fr_flig(pptr%itype(p)))/dt - - ! fine root litter C13 fluxes - if (use_c13) then - cc13f%dwt_frootc_to_litr1c(c) = cc13f%dwt_frootc_to_litr1c(c) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_flab(pptr%itype(p)))/dt - cc13f%dwt_frootc_to_litr2c(c) = cc13f%dwt_frootc_to_litr2c(c) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_fcel(pptr%itype(p)))/dt - cc13f%dwt_frootc_to_litr3c(c) = cc13f%dwt_frootc_to_litr3c(c) + & - (dwt_frootc13_to_litter(p)*pftcon%fr_flig(pptr%itype(p)))/dt - endif - - ! fine root litter nitrogen fluxes - cnf%dwt_frootn_to_litr1n(c) = cnf%dwt_frootn_to_litr1n(c) + & - (dwt_frootn_to_litter(p)*pftcon%fr_flab(pptr%itype(p)))/dt - cnf%dwt_frootn_to_litr2n(c) = cnf%dwt_frootn_to_litr2n(c) + & - (dwt_frootn_to_litter(p)*pftcon%fr_fcel(pptr%itype(p)))/dt - cnf%dwt_frootn_to_litr3n(c) = cnf%dwt_frootn_to_litr3n(c) + & - (dwt_frootn_to_litter(p)*pftcon%fr_flig(pptr%itype(p)))/dt - - ! livecroot fluxes to cwd - ccf%dwt_livecrootc_to_cwdc(c) = ccf%dwt_livecrootc_to_cwdc(c) + & - (dwt_livecrootc_to_litter(p))/dt - if (use_c13) then - cc13f%dwt_livecrootc_to_cwdc(c) = cc13f%dwt_livecrootc_to_cwdc(c) + & - (dwt_livecrootc13_to_litter(p))/dt - endif - cnf%dwt_livecrootn_to_cwdn(c) = cnf%dwt_livecrootn_to_cwdn(c) + & - (dwt_livecrootn_to_litter(p))/dt - - ! deadcroot fluxes to cwd - ccf%dwt_deadcrootc_to_cwdc(c) = ccf%dwt_deadcrootc_to_cwdc(c) + & - (dwt_deadcrootc_to_litter(p))/dt - if (use_c13) then - cc13f%dwt_deadcrootc_to_cwdc(c) = cc13f%dwt_deadcrootc_to_cwdc(c) + & - (dwt_deadcrootc13_to_litter(p))/dt - endif - cnf%dwt_deadcrootn_to_cwdn(c) = cnf%dwt_deadcrootn_to_cwdn(c) + & - (dwt_deadcrootn_to_litter(p))/dt - end if - end do - end do - - ! calculate pft-to-column for fluxes into product pools and conversion flux - do pi = 1,max_pft_per_col - do c = begc,endc - if (pi <= cptr%npfts(c)) then - p = cptr%pfti(c) + pi - 1 - - ! column-level fluxes are accumulated as positive fluxes. - ! column-level C flux updates - ccf%dwt_conv_cflux(c) = ccf%dwt_conv_cflux(c) - conv_cflux(p)/dt - ccf%dwt_prod10c_gain(c) = ccf%dwt_prod10c_gain(c) - prod10_cflux(p)/dt - ccf%dwt_prod100c_gain(c) = ccf%dwt_prod100c_gain(c) - prod100_cflux(p)/dt - - ! column-level C13 flux updates - if (use_c13) then - cc13f%dwt_conv_cflux(c) = cc13f%dwt_conv_cflux(c) - conv_c13flux(p)/dt - cc13f%dwt_prod10c_gain(c) = cc13f%dwt_prod10c_gain(c) - prod10_c13flux(p)/dt - cc13f%dwt_prod100c_gain(c) = cc13f%dwt_prod100c_gain(c) - prod100_c13flux(p)/dt - endif - - ! column-level N flux updates - cnf%dwt_conv_nflux(c) = cnf%dwt_conv_nflux(c) - conv_nflux(p)/dt - cnf%dwt_prod10n_gain(c) = cnf%dwt_prod10n_gain(c) - prod10_nflux(p)/dt - cnf%dwt_prod100n_gain(c) = cnf%dwt_prod100n_gain(c) - prod100_nflux(p)/dt - - end if - end do - end do - - ! Deallocate pft-level flux arrays - deallocate(dwt_leafc_seed) - deallocate(dwt_leafn_seed) - if (use_c13) then - deallocate(dwt_leafc13_seed) - endif - deallocate(dwt_deadstemc_seed) - deallocate(dwt_deadstemn_seed) - if (use_c13) then - deallocate(dwt_deadstemc13_seed) - endif - deallocate(dwt_frootc_to_litter) - deallocate(dwt_livecrootc_to_litter) - deallocate(dwt_deadcrootc_to_litter) - if (use_c13) then - deallocate(dwt_frootc13_to_litter) - deallocate(dwt_livecrootc13_to_litter) - deallocate(dwt_deadcrootc13_to_litter) - endif - deallocate(dwt_frootn_to_litter) - deallocate(dwt_livecrootn_to_litter) - deallocate(dwt_deadcrootn_to_litter) - deallocate(conv_cflux) - deallocate(prod10_cflux) - deallocate(prod100_cflux) - if (use_c13) then - deallocate(conv_c13flux) - deallocate(prod10_c13flux) - deallocate(prod100_c13flux) - endif - deallocate(conv_nflux) - deallocate(prod10_nflux) - deallocate(prod100_nflux) - -end subroutine pftdyn_cnbal - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftwt_init -! -! !INTERFACE: - subroutine pftwt_init() -! -! !DESCRIPTION: -! Initialize time interpolation of cndv pft weights from annual to time step -! -! !USES: - use clm_varctl, only : nsrest, nsrStartup -! -! !ARGUMENTS: - implicit none -! -!EOP -! -! !LOCAL VARIABLES: - integer :: ier, p ! error status, do-loop index - integer :: begp,endp ! beg/end indices for land pfts - character(len=32) :: subname='pftwt_init' ! subroutine name - type(pft_type), pointer :: pptr ! ponter to pft derived subtype -!----------------------------------------------------------------------- - - pptr => pft - - call get_proc_bounds(begp=begp,endp=endp) - - allocate(wtcol_old(begp:endp),stat=ier) - if (ier /= 0) then - call endrun( subname//'::ERROR: pftwt_init allocation error for wtcol_old') - end if - - if (nsrest == nsrStartup) then - do p = begp,endp - pdgvs%fpcgrid(p) = pptr%wtcol(p) - pdgvs%fpcgridold(p) = pptr%wtcol(p) - wtcol_old(p) = pptr%wtcol(p) - end do - else - do p = begp,endp - wtcol_old(p) = pptr%wtcol(p) - end do - end if - - end subroutine pftwt_init - -!----------------------------------------------------------------------- -!BOP -! -! !ROUTINE: pftwt_interp -! -! !INTERFACE: - subroutine pftwt_interp( begp, endp ) -! -! !DESCRIPTION: -! Time interpolate cndv pft weights from annual to time step -! -! !USES: - use clm_time_manager, only : get_curr_calday, get_curr_date, & - get_days_per_year - use clm_time_manager, only : get_step_size, get_nstep - use clm_varcon , only : istsoil ! CNDV incompatible with dynLU - use clm_varctl , only : finidat -! -! !ARGUMENTS: - implicit none - integer, intent(IN) :: begp,endp ! beg/end indices for land pfts -! -!EOP -! -! !LOCAL VARIABLES: - integer :: c,g,l,p ! indices - real(r8) :: cday ! current calendar day (1.0 = 0Z on Jan 1) - real(r8) :: wt1 ! time interpolation weights - real(r8) :: dtime ! model time step - real(r8) :: days_per_year ! days per year - integer :: nstep ! time step number - integer :: year ! year (0, ...) at nstep + 1 - integer :: mon ! month (1, ..., 12) at nstep + 1 - integer :: day ! day of month (1, ..., 31) at nstep + 1 - integer :: sec ! seconds into current date at nstep + 1 - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(pft_type) , pointer :: pptr ! ... to pft derived subtype - character(len=32) :: subname='pftwt_interp' ! subroutine name - -! !CALLED FROM: -! subr. driver -!----------------------------------------------------------------------- - - ! Set pointers into derived type - - lptr => lun - pptr => pft - - ! Interpolate pft weight to current time step - ! Map interpolated pctpft to subgrid weights - ! assumes maxpatch_pft = numpft + 1, each landunit has 1 column, - ! SCAM not defined and create_croplandunit = .false. - - nstep = get_nstep() - dtime = get_step_size() - cday = get_curr_calday(offset=-int(dtime)) - days_per_year = get_days_per_year() - - wt1 = ((days_per_year + 1._r8) - cday)/days_per_year - - call get_curr_date(year, mon, day, sec, offset=int(dtime)) - - do p = begp,endp - g = pptr%gridcell(p) - l = pptr%landunit(p) - - if (lptr%itype(l) == istsoil .and. lptr%wtgcell(l) > 0._r8) then ! CNDV incompatible with dynLU - wtcol_old(p) = pptr%wtcol(p) - pptr%wtcol(p) = pdgvs%fpcgrid(p) + & - wt1 * (pdgvs%fpcgridold(p) - pdgvs%fpcgrid(p)) - pptr%wtlunit(p) = pptr%wtcol(p) - pptr%wtgcell(p) = pptr%wtcol(p) * lptr%wtgcell(l) - - if (mon==1 .and. day==1 .and. sec==dtime .and. nstep>0) then - pdgvs%fpcgridold(p) = pdgvs%fpcgrid(p) - end if - end if - end do - - end subroutine pftwt_interp - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNHarvest -! -! !INTERFACE: -subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp) -! -! !DESCRIPTION: -! Harvest mortality routine for coupled carbon-nitrogen code (CN) -! -! !USES: - use clmtype - use pftvarcon , only : noveg, nbrdlf_evr_shrub, pprodharv10 - use clm_varcon , only : secspday - use clm_time_manager, only : get_days_per_year -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! column filter for soil points - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! pft filter for soil points -! -! !CALLED FROM: -! subroutine CNEcosystemDyn -! -! !REVISION HISTORY: -! 3/29/04: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in arrays - integer , pointer :: pgridcell(:) ! pft-level index into gridcell-level quantities - integer , pointer :: ivt(:) ! pft vegetation type - - real(r8), pointer :: leafc(:) ! (gC/m2) leaf C - real(r8), pointer :: frootc(:) ! (gC/m2) fine root C - real(r8), pointer :: livestemc(:) ! (gC/m2) live stem C - real(r8), pointer :: deadstemc(:) ! (gC/m2) dead stem C - real(r8), pointer :: livecrootc(:) ! (gC/m2) live coarse root C - real(r8), pointer :: deadcrootc(:) ! (gC/m2) dead coarse root C - real(r8), pointer :: xsmrpool(:) ! (gC/m2) abstract C pool to meet excess MR demand - real(r8), pointer :: leafc_storage(:) ! (gC/m2) leaf C storage - real(r8), pointer :: frootc_storage(:) ! (gC/m2) fine root C storage - real(r8), pointer :: livestemc_storage(:) ! (gC/m2) live stem C storage - real(r8), pointer :: deadstemc_storage(:) ! (gC/m2) dead stem C storage - real(r8), pointer :: livecrootc_storage(:) ! (gC/m2) live coarse root C storage - real(r8), pointer :: deadcrootc_storage(:) ! (gC/m2) dead coarse root C storage - real(r8), pointer :: gresp_storage(:) ! (gC/m2) growth respiration storage - real(r8), pointer :: leafc_xfer(:) ! (gC/m2) leaf C transfer - real(r8), pointer :: frootc_xfer(:) ! (gC/m2) fine root C transfer - real(r8), pointer :: livestemc_xfer(:) ! (gC/m2) live stem C transfer - real(r8), pointer :: deadstemc_xfer(:) ! (gC/m2) dead stem C transfer - real(r8), pointer :: livecrootc_xfer(:) ! (gC/m2) live coarse root C transfer - real(r8), pointer :: deadcrootc_xfer(:) ! (gC/m2) dead coarse root C transfer - real(r8), pointer :: gresp_xfer(:) ! (gC/m2) growth respiration transfer - real(r8), pointer :: leafn(:) ! (gN/m2) leaf N - real(r8), pointer :: frootn(:) ! (gN/m2) fine root N - real(r8), pointer :: livestemn(:) ! (gN/m2) live stem N - real(r8), pointer :: deadstemn(:) ! (gN/m2) dead stem N - real(r8), pointer :: livecrootn(:) ! (gN/m2) live coarse root N - real(r8), pointer :: deadcrootn(:) ! (gN/m2) dead coarse root N - real(r8), pointer :: retransn(:) ! (gN/m2) plant pool of retranslocated N - real(r8), pointer :: leafn_storage(:) ! (gN/m2) leaf N storage - real(r8), pointer :: frootn_storage(:) ! (gN/m2) fine root N storage - real(r8), pointer :: livestemn_storage(:) ! (gN/m2) live stem N storage - real(r8), pointer :: deadstemn_storage(:) ! (gN/m2) dead stem N storage - real(r8), pointer :: livecrootn_storage(:) ! (gN/m2) live coarse root N storage - real(r8), pointer :: deadcrootn_storage(:) ! (gN/m2) dead coarse root N storage - real(r8), pointer :: leafn_xfer(:) ! (gN/m2) leaf N transfer - real(r8), pointer :: frootn_xfer(:) ! (gN/m2) fine root N transfer - real(r8), pointer :: livestemn_xfer(:) ! (gN/m2) live stem N transfer - real(r8), pointer :: deadstemn_xfer(:) ! (gN/m2) dead stem N transfer - real(r8), pointer :: livecrootn_xfer(:) ! (gN/m2) live coarse root N transfer - real(r8), pointer :: deadcrootn_xfer(:) ! (gN/m2) dead coarse root N transfer -! -! local pointers to implicit in/out arrays -! -! local pointers to implicit out arrays - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: hrv_deadstemc_to_prod10c(:) - real(r8), pointer :: hrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_xsmrpool_to_atm(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_leafn_to_litter(:) - real(r8), pointer :: hrv_frootn_to_litter(:) - real(r8), pointer :: hrv_livestemn_to_litter(:) - real(r8), pointer :: hrv_deadstemn_to_prod10n(:) - real(r8), pointer :: hrv_deadstemn_to_prod100n(:) - real(r8), pointer :: hrv_livecrootn_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_to_litter(:) - real(r8), pointer :: hrv_retransn_to_litter(:) - real(r8), pointer :: hrv_leafn_storage_to_litter(:) - real(r8), pointer :: hrv_frootn_storage_to_litter(:) - real(r8), pointer :: hrv_livestemn_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemn_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootn_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_storage_to_litter(:) - real(r8), pointer :: hrv_leafn_xfer_to_litter(:) - real(r8), pointer :: hrv_frootn_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemn_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemn_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootn_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litter(:) -! -! !OTHER LOCAL VARIABLES: - integer :: p ! pft index - integer :: g ! gridcell index - integer :: fp ! pft filter index - real(r8):: am ! rate for fractional harvest mortality (1/yr) - real(r8):: m ! rate for fractional harvest mortality (1/s) - real(r8):: days_per_year ! days per year -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers to pft-level arrays - pgridcell => pft%gridcell - - ivt => pft%itype - leafc => pcs%leafc - frootc => pcs%frootc - livestemc => pcs%livestemc - deadstemc => pcs%deadstemc - livecrootc => pcs%livecrootc - deadcrootc => pcs%deadcrootc - xsmrpool => pcs%xsmrpool - leafc_storage => pcs%leafc_storage - frootc_storage => pcs%frootc_storage - livestemc_storage => pcs%livestemc_storage - deadstemc_storage => pcs%deadstemc_storage - livecrootc_storage => pcs%livecrootc_storage - deadcrootc_storage => pcs%deadcrootc_storage - gresp_storage => pcs%gresp_storage - leafc_xfer => pcs%leafc_xfer - frootc_xfer => pcs%frootc_xfer - livestemc_xfer => pcs%livestemc_xfer - deadstemc_xfer => pcs%deadstemc_xfer - livecrootc_xfer => pcs%livecrootc_xfer - deadcrootc_xfer => pcs%deadcrootc_xfer - gresp_xfer => pcs%gresp_xfer - leafn => pns%leafn - frootn => pns%frootn - livestemn => pns%livestemn - deadstemn => pns%deadstemn - livecrootn => pns%livecrootn - deadcrootn => pns%deadcrootn - retransn => pns%retransn - leafn_storage => pns%leafn_storage - frootn_storage => pns%frootn_storage - livestemn_storage => pns%livestemn_storage - deadstemn_storage => pns%deadstemn_storage - livecrootn_storage => pns%livecrootn_storage - deadcrootn_storage => pns%deadcrootn_storage - leafn_xfer => pns%leafn_xfer - frootn_xfer => pns%frootn_xfer - livestemn_xfer => pns%livestemn_xfer - deadstemn_xfer => pns%deadstemn_xfer - livecrootn_xfer => pns%livecrootn_xfer - deadcrootn_xfer => pns%deadcrootn_xfer - hrv_leafc_to_litter => pcf%hrv_leafc_to_litter - hrv_frootc_to_litter => pcf%hrv_frootc_to_litter - hrv_livestemc_to_litter => pcf%hrv_livestemc_to_litter - hrv_deadstemc_to_prod10c => pcf%hrv_deadstemc_to_prod10c - hrv_deadstemc_to_prod100c => pcf%hrv_deadstemc_to_prod100c - hrv_livecrootc_to_litter => pcf%hrv_livecrootc_to_litter - hrv_deadcrootc_to_litter => pcf%hrv_deadcrootc_to_litter - hrv_xsmrpool_to_atm => pcf%hrv_xsmrpool_to_atm - hrv_leafc_storage_to_litter => pcf%hrv_leafc_storage_to_litter - hrv_frootc_storage_to_litter => pcf%hrv_frootc_storage_to_litter - hrv_livestemc_storage_to_litter => pcf%hrv_livestemc_storage_to_litter - hrv_deadstemc_storage_to_litter => pcf%hrv_deadstemc_storage_to_litter - hrv_livecrootc_storage_to_litter => pcf%hrv_livecrootc_storage_to_litter - hrv_deadcrootc_storage_to_litter => pcf%hrv_deadcrootc_storage_to_litter - hrv_gresp_storage_to_litter => pcf%hrv_gresp_storage_to_litter - hrv_leafc_xfer_to_litter => pcf%hrv_leafc_xfer_to_litter - hrv_frootc_xfer_to_litter => pcf%hrv_frootc_xfer_to_litter - hrv_livestemc_xfer_to_litter => pcf%hrv_livestemc_xfer_to_litter - hrv_deadstemc_xfer_to_litter => pcf%hrv_deadstemc_xfer_to_litter - hrv_livecrootc_xfer_to_litter => pcf%hrv_livecrootc_xfer_to_litter - hrv_deadcrootc_xfer_to_litter => pcf%hrv_deadcrootc_xfer_to_litter - hrv_gresp_xfer_to_litter => pcf%hrv_gresp_xfer_to_litter - hrv_leafn_to_litter => pnf%hrv_leafn_to_litter - hrv_frootn_to_litter => pnf%hrv_frootn_to_litter - hrv_livestemn_to_litter => pnf%hrv_livestemn_to_litter - hrv_deadstemn_to_prod10n => pnf%hrv_deadstemn_to_prod10n - hrv_deadstemn_to_prod100n => pnf%hrv_deadstemn_to_prod100n - hrv_livecrootn_to_litter => pnf%hrv_livecrootn_to_litter - hrv_deadcrootn_to_litter => pnf%hrv_deadcrootn_to_litter - hrv_retransn_to_litter => pnf%hrv_retransn_to_litter - hrv_leafn_storage_to_litter => pnf%hrv_leafn_storage_to_litter - hrv_frootn_storage_to_litter => pnf%hrv_frootn_storage_to_litter - hrv_livestemn_storage_to_litter => pnf%hrv_livestemn_storage_to_litter - hrv_deadstemn_storage_to_litter => pnf%hrv_deadstemn_storage_to_litter - hrv_livecrootn_storage_to_litter => pnf%hrv_livecrootn_storage_to_litter - hrv_deadcrootn_storage_to_litter => pnf%hrv_deadcrootn_storage_to_litter - hrv_leafn_xfer_to_litter => pnf%hrv_leafn_xfer_to_litter - hrv_frootn_xfer_to_litter => pnf%hrv_frootn_xfer_to_litter - hrv_livestemn_xfer_to_litter => pnf%hrv_livestemn_xfer_to_litter - hrv_deadstemn_xfer_to_litter => pnf%hrv_deadstemn_xfer_to_litter - hrv_livecrootn_xfer_to_litter => pnf%hrv_livecrootn_xfer_to_litter - hrv_deadcrootn_xfer_to_litter => pnf%hrv_deadcrootn_xfer_to_litter - - - days_per_year = get_days_per_year() - - ! pft loop - do fp = 1,num_soilp - p = filter_soilp(fp) - g = pgridcell(p) - - ! If this is a tree pft, then - ! get the annual harvest "mortality" rate (am) from harvest array - ! and convert to rate per second - if (ivt(p) > noveg .and. ivt(p) < nbrdlf_evr_shrub) then - - if (do_harvest) then - am = harvest(g) - m = am/(days_per_year * secspday) - else - m = 0._r8 - end if - - ! pft-level harvest carbon fluxes - ! displayed pools - hrv_leafc_to_litter(p) = leafc(p) * m - hrv_frootc_to_litter(p) = frootc(p) * m - hrv_livestemc_to_litter(p) = livestemc(p) * m - hrv_deadstemc_to_prod10c(p) = deadstemc(p) * m * & - pprodharv10(ivt(p)) - hrv_deadstemc_to_prod100c(p) = deadstemc(p) * m * & - (1.0_r8 - pprodharv10(ivt(p))) - hrv_livecrootc_to_litter(p) = livecrootc(p) * m - hrv_deadcrootc_to_litter(p) = deadcrootc(p) * m - hrv_xsmrpool_to_atm(p) = xsmrpool(p) * m - - ! storage pools - hrv_leafc_storage_to_litter(p) = leafc_storage(p) * m - hrv_frootc_storage_to_litter(p) = frootc_storage(p) * m - hrv_livestemc_storage_to_litter(p) = livestemc_storage(p) * m - hrv_deadstemc_storage_to_litter(p) = deadstemc_storage(p) * m - hrv_livecrootc_storage_to_litter(p) = livecrootc_storage(p) * m - hrv_deadcrootc_storage_to_litter(p) = deadcrootc_storage(p) * m - hrv_gresp_storage_to_litter(p) = gresp_storage(p) * m - - ! transfer pools - hrv_leafc_xfer_to_litter(p) = leafc_xfer(p) * m - hrv_frootc_xfer_to_litter(p) = frootc_xfer(p) * m - hrv_livestemc_xfer_to_litter(p) = livestemc_xfer(p) * m - hrv_deadstemc_xfer_to_litter(p) = deadstemc_xfer(p) * m - hrv_livecrootc_xfer_to_litter(p) = livecrootc_xfer(p) * m - hrv_deadcrootc_xfer_to_litter(p) = deadcrootc_xfer(p) * m - hrv_gresp_xfer_to_litter(p) = gresp_xfer(p) * m - - ! pft-level harvest mortality nitrogen fluxes - ! displayed pools - hrv_leafn_to_litter(p) = leafn(p) * m - hrv_frootn_to_litter(p) = frootn(p) * m - hrv_livestemn_to_litter(p) = livestemn(p) * m - hrv_deadstemn_to_prod10n(p) = deadstemn(p) * m * & - pprodharv10(ivt(p)) - hrv_deadstemn_to_prod100n(p) = deadstemn(p) * m * & - (1.0_r8 - pprodharv10(ivt(p))) - hrv_livecrootn_to_litter(p) = livecrootn(p) * m - hrv_deadcrootn_to_litter(p) = deadcrootn(p) * m - hrv_retransn_to_litter(p) = retransn(p) * m - - ! storage pools - hrv_leafn_storage_to_litter(p) = leafn_storage(p) * m - hrv_frootn_storage_to_litter(p) = frootn_storage(p) * m - hrv_livestemn_storage_to_litter(p) = livestemn_storage(p) * m - hrv_deadstemn_storage_to_litter(p) = deadstemn_storage(p) * m - hrv_livecrootn_storage_to_litter(p) = livecrootn_storage(p) * m - hrv_deadcrootn_storage_to_litter(p) = deadcrootn_storage(p) * m - - ! transfer pools - hrv_leafn_xfer_to_litter(p) = leafn_xfer(p) * m - hrv_frootn_xfer_to_litter(p) = frootn_xfer(p) * m - hrv_livestemn_xfer_to_litter(p) = livestemn_xfer(p) * m - hrv_deadstemn_xfer_to_litter(p) = deadstemn_xfer(p) * m - hrv_livecrootn_xfer_to_litter(p) = livecrootn_xfer(p) * m - hrv_deadcrootn_xfer_to_litter(p) = deadcrootn_xfer(p) * m - - end if ! end tree block - - end do ! end of pft loop - - ! gather all pft-level litterfall fluxes from harvest to the column - ! for litter C and N inputs - - call CNHarvestPftToColumn(num_soilc, filter_soilc) - -end subroutine CNHarvest -!----------------------------------------------------------------------- - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: CNHarvestPftToColumn -! -! !INTERFACE: -subroutine CNHarvestPftToColumn (num_soilc, filter_soilc) -! -! !DESCRIPTION: -! called at the end of CNHarvest to gather all pft-level harvest litterfall fluxes -! to the column level and assign them to the three litter pools -! -! !USES: - use clmtype - use clm_varpar, only : max_pft_per_col, maxpatch_pft -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: num_soilc ! number of soil columns in filter - integer, intent(in) :: filter_soilc(:) ! soil column filter -! -! !CALLED FROM: -! subroutine CNphenology -! -! !REVISION HISTORY: -! 9/8/03: Created by Peter Thornton -! -! !LOCAL VARIABLES: -! -! local pointers to implicit in scalars - integer , pointer :: ivt(:) ! pft vegetation type - real(r8), pointer :: wtcol(:) ! pft weight relative to column (0-1) - real(r8), pointer :: pwtgcell(:) ! weight of pft relative to corresponding gridcell - real(r8), pointer :: lf_flab(:) ! leaf litter labile fraction - real(r8), pointer :: lf_fcel(:) ! leaf litter cellulose fraction - real(r8), pointer :: lf_flig(:) ! leaf litter lignin fraction - real(r8), pointer :: fr_flab(:) ! fine root litter labile fraction - real(r8), pointer :: fr_fcel(:) ! fine root litter cellulose fraction - real(r8), pointer :: fr_flig(:) ! fine root litter lignin fraction - integer , pointer :: npfts(:) ! number of pfts for each column - integer , pointer :: pfti(:) ! beginning pft index for each column - real(r8), pointer :: hrv_leafc_to_litter(:) - real(r8), pointer :: hrv_frootc_to_litter(:) - real(r8), pointer :: hrv_livestemc_to_litter(:) - real(r8), pointer :: phrv_deadstemc_to_prod10c(:) - real(r8), pointer :: phrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_livecrootc_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_to_litter(:) - real(r8), pointer :: hrv_leafc_storage_to_litter(:) - real(r8), pointer :: hrv_frootc_storage_to_litter(:) - real(r8), pointer :: hrv_livestemc_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litter(:) - real(r8), pointer :: hrv_gresp_storage_to_litter(:) - real(r8), pointer :: hrv_leafc_xfer_to_litter(:) - real(r8), pointer :: hrv_frootc_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litter(:) - real(r8), pointer :: hrv_gresp_xfer_to_litter(:) - real(r8), pointer :: hrv_leafn_to_litter(:) - real(r8), pointer :: hrv_frootn_to_litter(:) - real(r8), pointer :: hrv_livestemn_to_litter(:) - real(r8), pointer :: phrv_deadstemn_to_prod10n(:) - real(r8), pointer :: phrv_deadstemn_to_prod100n(:) - real(r8), pointer :: hrv_livecrootn_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_to_litter(:) - real(r8), pointer :: hrv_retransn_to_litter(:) - real(r8), pointer :: hrv_leafn_storage_to_litter(:) - real(r8), pointer :: hrv_frootn_storage_to_litter(:) - real(r8), pointer :: hrv_livestemn_storage_to_litter(:) - real(r8), pointer :: hrv_deadstemn_storage_to_litter(:) - real(r8), pointer :: hrv_livecrootn_storage_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_storage_to_litter(:) - real(r8), pointer :: hrv_leafn_xfer_to_litter(:) - real(r8), pointer :: hrv_frootn_xfer_to_litter(:) - real(r8), pointer :: hrv_livestemn_xfer_to_litter(:) - real(r8), pointer :: hrv_deadstemn_xfer_to_litter(:) - real(r8), pointer :: hrv_livecrootn_xfer_to_litter(:) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litter(:) -! -! local pointers to implicit in/out arrays - real(r8), pointer :: hrv_leafc_to_litr1c(:) - real(r8), pointer :: hrv_leafc_to_litr2c(:) - real(r8), pointer :: hrv_leafc_to_litr3c(:) - real(r8), pointer :: hrv_frootc_to_litr1c(:) - real(r8), pointer :: hrv_frootc_to_litr2c(:) - real(r8), pointer :: hrv_frootc_to_litr3c(:) - real(r8), pointer :: hrv_livestemc_to_cwdc(:) - real(r8), pointer :: chrv_deadstemc_to_prod10c(:) - real(r8), pointer :: chrv_deadstemc_to_prod100c(:) - real(r8), pointer :: hrv_livecrootc_to_cwdc(:) - real(r8), pointer :: hrv_deadcrootc_to_cwdc(:) - real(r8), pointer :: hrv_leafc_storage_to_litr1c(:) - real(r8), pointer :: hrv_frootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_storage_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_storage_to_litr1c(:) - real(r8), pointer :: hrv_gresp_storage_to_litr1c(:) - real(r8), pointer :: hrv_leafc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_frootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livestemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadstemc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_livecrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_deadcrootc_xfer_to_litr1c(:) - real(r8), pointer :: hrv_gresp_xfer_to_litr1c(:) - real(r8), pointer :: hrv_leafn_to_litr1n(:) - real(r8), pointer :: hrv_leafn_to_litr2n(:) - real(r8), pointer :: hrv_leafn_to_litr3n(:) - real(r8), pointer :: hrv_frootn_to_litr1n(:) - real(r8), pointer :: hrv_frootn_to_litr2n(:) - real(r8), pointer :: hrv_frootn_to_litr3n(:) - real(r8), pointer :: hrv_livestemn_to_cwdn(:) - real(r8), pointer :: chrv_deadstemn_to_prod10n(:) - real(r8), pointer :: chrv_deadstemn_to_prod100n(:) - real(r8), pointer :: hrv_livecrootn_to_cwdn(:) - real(r8), pointer :: hrv_deadcrootn_to_cwdn(:) - real(r8), pointer :: hrv_retransn_to_litr1n(:) - real(r8), pointer :: hrv_leafn_storage_to_litr1n(:) - real(r8), pointer :: hrv_frootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_livestemn_storage_to_litr1n(:) - real(r8), pointer :: hrv_deadstemn_storage_to_litr1n(:) - real(r8), pointer :: hrv_livecrootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_deadcrootn_storage_to_litr1n(:) - real(r8), pointer :: hrv_leafn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_frootn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_livestemn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_deadstemn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_livecrootn_xfer_to_litr1n(:) - real(r8), pointer :: hrv_deadcrootn_xfer_to_litr1n(:) -! -! local pointers to implicit out arrays -! -! -! !OTHER LOCAL VARIABLES: - integer :: fc,c,pi,p ! indices -!EOP -!----------------------------------------------------------------------- - - ! assign local pointers - lf_flab => pftcon%lf_flab - lf_fcel => pftcon%lf_fcel - lf_flig => pftcon%lf_flig - fr_flab => pftcon%fr_flab - fr_fcel => pftcon%fr_fcel - fr_flig => pftcon%fr_flig - - ! assign local pointers to column-level arrays - npfts => col%npfts - pfti => col%pfti - hrv_leafc_to_litr1c => ccf%hrv_leafc_to_litr1c - hrv_leafc_to_litr2c => ccf%hrv_leafc_to_litr2c - hrv_leafc_to_litr3c => ccf%hrv_leafc_to_litr3c - hrv_frootc_to_litr1c => ccf%hrv_frootc_to_litr1c - hrv_frootc_to_litr2c => ccf%hrv_frootc_to_litr2c - hrv_frootc_to_litr3c => ccf%hrv_frootc_to_litr3c - hrv_livestemc_to_cwdc => ccf%hrv_livestemc_to_cwdc - chrv_deadstemc_to_prod10c => ccf%hrv_deadstemc_to_prod10c - chrv_deadstemc_to_prod100c => ccf%hrv_deadstemc_to_prod100c - hrv_livecrootc_to_cwdc => ccf%hrv_livecrootc_to_cwdc - hrv_deadcrootc_to_cwdc => ccf%hrv_deadcrootc_to_cwdc - hrv_leafc_storage_to_litr1c => ccf%hrv_leafc_storage_to_litr1c - hrv_frootc_storage_to_litr1c => ccf%hrv_frootc_storage_to_litr1c - hrv_livestemc_storage_to_litr1c => ccf%hrv_livestemc_storage_to_litr1c - hrv_deadstemc_storage_to_litr1c => ccf%hrv_deadstemc_storage_to_litr1c - hrv_livecrootc_storage_to_litr1c => ccf%hrv_livecrootc_storage_to_litr1c - hrv_deadcrootc_storage_to_litr1c => ccf%hrv_deadcrootc_storage_to_litr1c - hrv_gresp_storage_to_litr1c => ccf%hrv_gresp_storage_to_litr1c - hrv_leafc_xfer_to_litr1c => ccf%hrv_leafc_xfer_to_litr1c - hrv_frootc_xfer_to_litr1c => ccf%hrv_frootc_xfer_to_litr1c - hrv_livestemc_xfer_to_litr1c => ccf%hrv_livestemc_xfer_to_litr1c - hrv_deadstemc_xfer_to_litr1c => ccf%hrv_deadstemc_xfer_to_litr1c - hrv_livecrootc_xfer_to_litr1c => ccf%hrv_livecrootc_xfer_to_litr1c - hrv_deadcrootc_xfer_to_litr1c => ccf%hrv_deadcrootc_xfer_to_litr1c - hrv_gresp_xfer_to_litr1c => ccf%hrv_gresp_xfer_to_litr1c - hrv_leafn_to_litr1n => cnf%hrv_leafn_to_litr1n - hrv_leafn_to_litr2n => cnf%hrv_leafn_to_litr2n - hrv_leafn_to_litr3n => cnf%hrv_leafn_to_litr3n - hrv_frootn_to_litr1n => cnf%hrv_frootn_to_litr1n - hrv_frootn_to_litr2n => cnf%hrv_frootn_to_litr2n - hrv_frootn_to_litr3n => cnf%hrv_frootn_to_litr3n - hrv_livestemn_to_cwdn => cnf%hrv_livestemn_to_cwdn - chrv_deadstemn_to_prod10n => cnf%hrv_deadstemn_to_prod10n - chrv_deadstemn_to_prod100n => cnf%hrv_deadstemn_to_prod100n - hrv_livecrootn_to_cwdn => cnf%hrv_livecrootn_to_cwdn - hrv_deadcrootn_to_cwdn => cnf%hrv_deadcrootn_to_cwdn - hrv_retransn_to_litr1n => cnf%hrv_retransn_to_litr1n - hrv_leafn_storage_to_litr1n => cnf%hrv_leafn_storage_to_litr1n - hrv_frootn_storage_to_litr1n => cnf%hrv_frootn_storage_to_litr1n - hrv_livestemn_storage_to_litr1n => cnf%hrv_livestemn_storage_to_litr1n - hrv_deadstemn_storage_to_litr1n => cnf%hrv_deadstemn_storage_to_litr1n - hrv_livecrootn_storage_to_litr1n => cnf%hrv_livecrootn_storage_to_litr1n - hrv_deadcrootn_storage_to_litr1n => cnf%hrv_deadcrootn_storage_to_litr1n - hrv_leafn_xfer_to_litr1n => cnf%hrv_leafn_xfer_to_litr1n - hrv_frootn_xfer_to_litr1n => cnf%hrv_frootn_xfer_to_litr1n - hrv_livestemn_xfer_to_litr1n => cnf%hrv_livestemn_xfer_to_litr1n - hrv_deadstemn_xfer_to_litr1n => cnf%hrv_deadstemn_xfer_to_litr1n - hrv_livecrootn_xfer_to_litr1n => cnf%hrv_livecrootn_xfer_to_litr1n - hrv_deadcrootn_xfer_to_litr1n => cnf%hrv_deadcrootn_xfer_to_litr1n - - ! assign local pointers to pft-level arrays - ivt => pft%itype - wtcol => pft%wtcol - pwtgcell => pft%wtgcell - hrv_leafc_to_litter => pcf%hrv_leafc_to_litter - hrv_frootc_to_litter => pcf%hrv_frootc_to_litter - hrv_livestemc_to_litter => pcf%hrv_livestemc_to_litter - phrv_deadstemc_to_prod10c => pcf%hrv_deadstemc_to_prod10c - phrv_deadstemc_to_prod100c => pcf%hrv_deadstemc_to_prod100c - hrv_livecrootc_to_litter => pcf%hrv_livecrootc_to_litter - hrv_deadcrootc_to_litter => pcf%hrv_deadcrootc_to_litter - hrv_leafc_storage_to_litter => pcf%hrv_leafc_storage_to_litter - hrv_frootc_storage_to_litter => pcf%hrv_frootc_storage_to_litter - hrv_livestemc_storage_to_litter => pcf%hrv_livestemc_storage_to_litter - hrv_deadstemc_storage_to_litter => pcf%hrv_deadstemc_storage_to_litter - hrv_livecrootc_storage_to_litter => pcf%hrv_livecrootc_storage_to_litter - hrv_deadcrootc_storage_to_litter => pcf%hrv_deadcrootc_storage_to_litter - hrv_gresp_storage_to_litter => pcf%hrv_gresp_storage_to_litter - hrv_leafc_xfer_to_litter => pcf%hrv_leafc_xfer_to_litter - hrv_frootc_xfer_to_litter => pcf%hrv_frootc_xfer_to_litter - hrv_livestemc_xfer_to_litter => pcf%hrv_livestemc_xfer_to_litter - hrv_deadstemc_xfer_to_litter => pcf%hrv_deadstemc_xfer_to_litter - hrv_livecrootc_xfer_to_litter => pcf%hrv_livecrootc_xfer_to_litter - hrv_deadcrootc_xfer_to_litter => pcf%hrv_deadcrootc_xfer_to_litter - hrv_gresp_xfer_to_litter => pcf%hrv_gresp_xfer_to_litter - hrv_leafn_to_litter => pnf%hrv_leafn_to_litter - hrv_frootn_to_litter => pnf%hrv_frootn_to_litter - hrv_livestemn_to_litter => pnf%hrv_livestemn_to_litter - phrv_deadstemn_to_prod10n => pnf%hrv_deadstemn_to_prod10n - phrv_deadstemn_to_prod100n => pnf%hrv_deadstemn_to_prod100n - hrv_livecrootn_to_litter => pnf%hrv_livecrootn_to_litter - hrv_deadcrootn_to_litter => pnf%hrv_deadcrootn_to_litter - hrv_retransn_to_litter => pnf%hrv_retransn_to_litter - hrv_leafn_storage_to_litter => pnf%hrv_leafn_storage_to_litter - hrv_frootn_storage_to_litter => pnf%hrv_frootn_storage_to_litter - hrv_livestemn_storage_to_litter => pnf%hrv_livestemn_storage_to_litter - hrv_deadstemn_storage_to_litter => pnf%hrv_deadstemn_storage_to_litter - hrv_livecrootn_storage_to_litter => pnf%hrv_livecrootn_storage_to_litter - hrv_deadcrootn_storage_to_litter => pnf%hrv_deadcrootn_storage_to_litter - hrv_leafn_xfer_to_litter => pnf%hrv_leafn_xfer_to_litter - hrv_frootn_xfer_to_litter => pnf%hrv_frootn_xfer_to_litter - hrv_livestemn_xfer_to_litter => pnf%hrv_livestemn_xfer_to_litter - hrv_deadstemn_xfer_to_litter => pnf%hrv_deadstemn_xfer_to_litter - hrv_livecrootn_xfer_to_litter => pnf%hrv_livecrootn_xfer_to_litter - hrv_deadcrootn_xfer_to_litter => pnf%hrv_deadcrootn_xfer_to_litter - - do pi = 1,maxpatch_pft - do fc = 1,num_soilc - c = filter_soilc(fc) - - if (pi <= npfts(c)) then - p = pfti(c) + pi - 1 - - if (pwtgcell(p)>0._r8) then - - ! leaf harvest mortality carbon fluxes - hrv_leafc_to_litr1c(c) = hrv_leafc_to_litr1c(c) + & - hrv_leafc_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - hrv_leafc_to_litr2c(c) = hrv_leafc_to_litr2c(c) + & - hrv_leafc_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - hrv_leafc_to_litr3c(c) = hrv_leafc_to_litr3c(c) + & - hrv_leafc_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root harvest mortality carbon fluxes - hrv_frootc_to_litr1c(c) = hrv_frootc_to_litr1c(c) + & - hrv_frootc_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - hrv_frootc_to_litr2c(c) = hrv_frootc_to_litr2c(c) + & - hrv_frootc_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - hrv_frootc_to_litr3c(c) = hrv_frootc_to_litr3c(c) + & - hrv_frootc_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood harvest mortality carbon fluxes - hrv_livestemc_to_cwdc(c) = hrv_livestemc_to_cwdc(c) + & - hrv_livestemc_to_litter(p) * wtcol(p) - chrv_deadstemc_to_prod10c(c) = chrv_deadstemc_to_prod10c(c) + & - phrv_deadstemc_to_prod10c(p) * wtcol(p) - chrv_deadstemc_to_prod100c(c) = chrv_deadstemc_to_prod100c(c) + & - phrv_deadstemc_to_prod100c(p) * wtcol(p) - hrv_livecrootc_to_cwdc(c) = hrv_livecrootc_to_cwdc(c) + & - hrv_livecrootc_to_litter(p) * wtcol(p) - hrv_deadcrootc_to_cwdc(c) = hrv_deadcrootc_to_cwdc(c) + & - hrv_deadcrootc_to_litter(p) * wtcol(p) - - ! storage harvest mortality carbon fluxes - hrv_leafc_storage_to_litr1c(c) = hrv_leafc_storage_to_litr1c(c) + & - hrv_leafc_storage_to_litter(p) * wtcol(p) - hrv_frootc_storage_to_litr1c(c) = hrv_frootc_storage_to_litr1c(c) + & - hrv_frootc_storage_to_litter(p) * wtcol(p) - hrv_livestemc_storage_to_litr1c(c) = hrv_livestemc_storage_to_litr1c(c) + & - hrv_livestemc_storage_to_litter(p) * wtcol(p) - hrv_deadstemc_storage_to_litr1c(c) = hrv_deadstemc_storage_to_litr1c(c) + & - hrv_deadstemc_storage_to_litter(p) * wtcol(p) - hrv_livecrootc_storage_to_litr1c(c) = hrv_livecrootc_storage_to_litr1c(c) + & - hrv_livecrootc_storage_to_litter(p) * wtcol(p) - hrv_deadcrootc_storage_to_litr1c(c) = hrv_deadcrootc_storage_to_litr1c(c) + & - hrv_deadcrootc_storage_to_litter(p) * wtcol(p) - hrv_gresp_storage_to_litr1c(c) = hrv_gresp_storage_to_litr1c(c) + & - hrv_gresp_storage_to_litter(p) * wtcol(p) - - ! transfer harvest mortality carbon fluxes - hrv_leafc_xfer_to_litr1c(c) = hrv_leafc_xfer_to_litr1c(c) + & - hrv_leafc_xfer_to_litter(p) * wtcol(p) - hrv_frootc_xfer_to_litr1c(c) = hrv_frootc_xfer_to_litr1c(c) + & - hrv_frootc_xfer_to_litter(p) * wtcol(p) - hrv_livestemc_xfer_to_litr1c(c) = hrv_livestemc_xfer_to_litr1c(c) + & - hrv_livestemc_xfer_to_litter(p) * wtcol(p) - hrv_deadstemc_xfer_to_litr1c(c) = hrv_deadstemc_xfer_to_litr1c(c) + & - hrv_deadstemc_xfer_to_litter(p) * wtcol(p) - hrv_livecrootc_xfer_to_litr1c(c) = hrv_livecrootc_xfer_to_litr1c(c) + & - hrv_livecrootc_xfer_to_litter(p) * wtcol(p) - hrv_deadcrootc_xfer_to_litr1c(c) = hrv_deadcrootc_xfer_to_litr1c(c) + & - hrv_deadcrootc_xfer_to_litter(p) * wtcol(p) - hrv_gresp_xfer_to_litr1c(c) = hrv_gresp_xfer_to_litr1c(c) + & - hrv_gresp_xfer_to_litter(p) * wtcol(p) - - ! leaf harvest mortality nitrogen fluxes - hrv_leafn_to_litr1n(c) = hrv_leafn_to_litr1n(c) + & - hrv_leafn_to_litter(p) * lf_flab(ivt(p)) * wtcol(p) - hrv_leafn_to_litr2n(c) = hrv_leafn_to_litr2n(c) + & - hrv_leafn_to_litter(p) * lf_fcel(ivt(p)) * wtcol(p) - hrv_leafn_to_litr3n(c) = hrv_leafn_to_litr3n(c) + & - hrv_leafn_to_litter(p) * lf_flig(ivt(p)) * wtcol(p) - - ! fine root litter nitrogen fluxes - hrv_frootn_to_litr1n(c) = hrv_frootn_to_litr1n(c) + & - hrv_frootn_to_litter(p) * fr_flab(ivt(p)) * wtcol(p) - hrv_frootn_to_litr2n(c) = hrv_frootn_to_litr2n(c) + & - hrv_frootn_to_litter(p) * fr_fcel(ivt(p)) * wtcol(p) - hrv_frootn_to_litr3n(c) = hrv_frootn_to_litr3n(c) + & - hrv_frootn_to_litter(p) * fr_flig(ivt(p)) * wtcol(p) - - ! wood harvest mortality nitrogen fluxes - hrv_livestemn_to_cwdn(c) = hrv_livestemn_to_cwdn(c) + & - hrv_livestemn_to_litter(p) * wtcol(p) - chrv_deadstemn_to_prod10n(c) = chrv_deadstemn_to_prod10n(c) + & - phrv_deadstemn_to_prod10n(p) * wtcol(p) - chrv_deadstemn_to_prod100n(c) = chrv_deadstemn_to_prod100n(c) + & - phrv_deadstemn_to_prod100n(p) * wtcol(p) - hrv_livecrootn_to_cwdn(c) = hrv_livecrootn_to_cwdn(c) + & - hrv_livecrootn_to_litter(p) * wtcol(p) - hrv_deadcrootn_to_cwdn(c) = hrv_deadcrootn_to_cwdn(c) + & - hrv_deadcrootn_to_litter(p) * wtcol(p) - - ! retranslocated N pool harvest mortality fluxes - hrv_retransn_to_litr1n(c) = hrv_retransn_to_litr1n(c) + & - hrv_retransn_to_litter(p) * wtcol(p) - - ! storage harvest mortality nitrogen fluxes - hrv_leafn_storage_to_litr1n(c) = hrv_leafn_storage_to_litr1n(c) + & - hrv_leafn_storage_to_litter(p) * wtcol(p) - hrv_frootn_storage_to_litr1n(c) = hrv_frootn_storage_to_litr1n(c) + & - hrv_frootn_storage_to_litter(p) * wtcol(p) - hrv_livestemn_storage_to_litr1n(c) = hrv_livestemn_storage_to_litr1n(c) + & - hrv_livestemn_storage_to_litter(p) * wtcol(p) - hrv_deadstemn_storage_to_litr1n(c) = hrv_deadstemn_storage_to_litr1n(c) + & - hrv_deadstemn_storage_to_litter(p) * wtcol(p) - hrv_livecrootn_storage_to_litr1n(c) = hrv_livecrootn_storage_to_litr1n(c) + & - hrv_livecrootn_storage_to_litter(p) * wtcol(p) - hrv_deadcrootn_storage_to_litr1n(c) = hrv_deadcrootn_storage_to_litr1n(c) + & - hrv_deadcrootn_storage_to_litter(p) * wtcol(p) - - ! transfer harvest mortality nitrogen fluxes - hrv_leafn_xfer_to_litr1n(c) = hrv_leafn_xfer_to_litr1n(c) + & - hrv_leafn_xfer_to_litter(p) * wtcol(p) - hrv_frootn_xfer_to_litr1n(c) = hrv_frootn_xfer_to_litr1n(c) + & - hrv_frootn_xfer_to_litter(p) * wtcol(p) - hrv_livestemn_xfer_to_litr1n(c) = hrv_livestemn_xfer_to_litr1n(c) + & - hrv_livestemn_xfer_to_litter(p) * wtcol(p) - hrv_deadstemn_xfer_to_litr1n(c) = hrv_deadstemn_xfer_to_litr1n(c) + & - hrv_deadstemn_xfer_to_litter(p) * wtcol(p) - hrv_livecrootn_xfer_to_litr1n(c) = hrv_livecrootn_xfer_to_litr1n(c) + & - hrv_livecrootn_xfer_to_litter(p) * wtcol(p) - hrv_deadcrootn_xfer_to_litr1n(c) = hrv_deadcrootn_xfer_to_litr1n(c) + & - hrv_deadcrootn_xfer_to_litter(p) * wtcol(p) - - end if - end if - - end do - - end do - -end subroutine CNHarvestPftToColumn -!----------------------------------------------------------------------- - -end module pftdynMod diff --git a/src_clm40/main/pftvarcon.F90 b/src_clm40/main/pftvarcon.F90 deleted file mode 100644 index 07882a1464..0000000000 --- a/src_clm40/main/pftvarcon.F90 +++ /dev/null @@ -1,489 +0,0 @@ -module pftvarcon - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: pftvarcon -! -! !DESCRIPTION: -! Module containing vegetation constants and method to -! read and initialize vegetation (PFT) constants. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use clm_varpar , only : mxpft, numpft, numrad, ivis, inir - use clm_varctl , only : iulog, use_cn, use_cndv -! -! !PUBLIC TYPES: - implicit none - save -! -! Vegetation type constants -! - character(len=40) pftname(0:mxpft) !PFT description - - integer :: noveg !value for not vegetated - integer :: ndllf_evr_tmp_tree !value for Needleleaf evergreen temperate tree - integer :: ndllf_evr_brl_tree !value for Needleleaf evergreen boreal tree - integer :: ndllf_dcd_brl_tree !value for Needleleaf deciduous boreal tree - integer :: nbrdlf_evr_trp_tree !value for Broadleaf evergreen tropical tree - integer :: nbrdlf_evr_tmp_tree !value for Broadleaf evergreen temperate tree - integer :: nbrdlf_dcd_trp_tree !value for Broadleaf deciduous tropical tree - integer :: nbrdlf_dcd_tmp_tree !value for Broadleaf deciduous temperate tree - integer :: nbrdlf_dcd_brl_tree !value for Broadleaf deciduous boreal tree - integer :: ntree !value for last type of tree - integer :: nbrdlf_evr_shrub !value for Broadleaf evergreen shrub - integer :: nbrdlf_dcd_tmp_shrub !value for Broadleaf deciduous temperate shrub - integer :: nbrdlf_dcd_brl_shrub !value for Broadleaf deciduous boreal shrub - integer :: nc3_arctic_grass !value for C3 arctic grass - integer :: nc3_nonarctic_grass !value for C3 non-arctic grass - integer :: nc4_grass !value for C4 grass - integer :: npcropmin !value for first crop - integer :: ncorn !value for corn - integer :: nscereal !value for spring temperate cereal - integer :: nwcereal !value for winter temperate cereal - integer :: nsoybean !value for soybean - integer :: npcropmax !value for last prognostic crop in list - integer :: nc3crop !value for generic crop - integer :: nirrig !value for irrigated generic crop - - real(r8):: dleaf(0:mxpft) !characteristic leaf dimension (m) - real(r8):: c3psn(0:mxpft) !photosynthetic pathway: 0. = c4, 1. = c3 - real(r8):: mp(0:mxpft) !slope of conductance-to-photosynthesis relationship - real(r8):: qe25(0:mxpft) !quantum efficiency at 25C (umol CO2 / umol photon) - real(r8):: xl(0:mxpft) !leaf/stem orientation index - real(r8):: rhol(0:mxpft,numrad) !leaf reflectance: 1=vis, 2=nir - real(r8):: rhos(0:mxpft,numrad) !stem reflectance: 1=vis, 2=nir - real(r8):: taul(0:mxpft,numrad) !leaf transmittance: 1=vis, 2=nir - real(r8):: taus(0:mxpft,numrad) !stem transmittance: 1=vis, 2=nir - real(r8):: z0mr(0:mxpft) !ratio of momentum roughness length to canopy top height (-) - real(r8):: displar(0:mxpft) !ratio of displacement height to canopy top height (-) - real(r8):: roota_par(0:mxpft) !CLM rooting distribution parameter [1/m] - real(r8):: rootb_par(0:mxpft) !CLM rooting distribution parameter [1/m] - real(r8):: crop(0:mxpft) ! crop pft: 0. = not crop, 1. = crop pft - real(r8):: irrigated(0:mxpft) ! irrigated pft: 0. = not, 1. = irrigated - real(r8):: smpso(0:mxpft) !soil water potential at full stomatal opening (mm) - real(r8):: smpsc(0:mxpft) !soil water potential at full stomatal closure (mm) - real(r8):: fnitr(0:mxpft) !foliage nitrogen limitation factor (-) - ! begin new pft parameters for CN code - real(r8):: slatop(0:mxpft) !SLA at top of canopy [m^2/gC] - real(r8):: dsladlai(0:mxpft) !dSLA/dLAI [m^2/gC] - real(r8):: leafcn(0:mxpft) !leaf C:N [gC/gN] - real(r8):: flnr(0:mxpft) !fraction of leaf N in Rubisco [no units] - real(r8):: woody(0:mxpft) !woody lifeform flag (0 or 1) - real(r8):: lflitcn(0:mxpft) !leaf litter C:N (gC/gN) - real(r8):: frootcn(0:mxpft) !fine root C:N (gC/gN) - real(r8):: livewdcn(0:mxpft) !live wood (phloem and ray parenchyma) C:N (gC/gN) - real(r8):: deadwdcn(0:mxpft) !dead wood (xylem and heartwood) C:N (gC/gN) - real(r8):: grperc(0:mxpft) !growth respiration parameter - real(r8):: grpnow(0:mxpft) !growth respiration parameter - -! for crop - real(r8):: graincn(0:mxpft) !grain C:N (gC/gN) - real(r8):: mxtmp(0:mxpft) !parameter used in accFlds - real(r8):: baset(0:mxpft) !parameter used in accFlds - real(r8):: declfact(0:mxpft) !parameter used in CNAllocation - real(r8):: bfact(0:mxpft) !parameter used in CNAllocation - real(r8):: aleaff(0:mxpft) !parameter used in CNAllocation - real(r8):: arootf(0:mxpft) !parameter used in CNAllocation - real(r8):: astemf(0:mxpft) !parameter used in CNAllocation - real(r8):: arooti(0:mxpft) !parameter used in CNAllocation - real(r8):: fleafi(0:mxpft) !parameter used in CNAllocation - real(r8):: allconsl(0:mxpft) !parameter used in CNAllocation - real(r8):: allconss(0:mxpft) !parameter used in CNAllocation - real(r8):: ztopmx(0:mxpft) !parameter used in CNVegStructUpdate - real(r8):: laimx(0:mxpft) !parameter used in CNVegStructUpdate - real(r8):: gddmin(0:mxpft) !parameter used in CNPhenology - real(r8):: hybgdd(0:mxpft) !parameter used in CNPhenology - real(r8):: lfemerg(0:mxpft) !parameter used in CNPhenology - real(r8):: grnfill(0:mxpft) !parameter used in CNPhenology - integer :: mxmat(0:mxpft) !parameter used in CNPhenology - integer :: mnNHplantdate(0:mxpft)!minimum planting date for NorthHemisphere (YYYYMMDD) - integer :: mxNHplantdate(0:mxpft)!maximum planting date for NorthHemisphere (YYYYMMDD) - integer :: mnSHplantdate(0:mxpft)!minimum planting date for SouthHemisphere (YYYYMMDD) - integer :: mxSHplantdate(0:mxpft)!maximum planting date for SouthHemisphere (YYYYMMDD) - real(r8):: planttemp(0:mxpft) !planting temperature used in CNPhenology (K) - real(r8):: minplanttemp(0:mxpft) !mininum planting temperature used in CNPhenology (K) - real(r8):: froot_leaf(0:mxpft) !allocation parameter: new fine root C per new leaf C (gC/gC) - real(r8):: stem_leaf(0:mxpft) !allocation parameter: new stem c per new leaf C (gC/gC) - real(r8):: croot_stem(0:mxpft) !allocation parameter: new coarse root C per new stem C (gC/gC) - real(r8):: flivewd(0:mxpft) !allocation parameter: fraction of new wood that is live (phloem and ray parenchyma) (no units) - real(r8):: fcur(0:mxpft) !allocation parameter: fraction of allocation that goes to currently displayed growth, remainder to storage - real(r8):: fcurdv(0:mxpft) !alternate fcur for use with cndv - real(r8):: lf_flab(0:mxpft) !leaf litter labile fraction - real(r8):: lf_fcel(0:mxpft) !leaf litter cellulose fraction - real(r8):: lf_flig(0:mxpft) !leaf litter lignin fraction - real(r8):: fr_flab(0:mxpft) !fine root litter labile fraction - real(r8):: fr_fcel(0:mxpft) !fine root litter cellulose fraction - real(r8):: fr_flig(0:mxpft) !fine root litter lignin fraction - real(r8):: leaf_long(0:mxpft) !leaf longevity (yrs) - real(r8):: evergreen(0:mxpft) !binary flag for evergreen leaf habit (0 or 1) - real(r8):: stress_decid(0:mxpft) !binary flag for stress-deciduous leaf habit (0 or 1) - real(r8):: season_decid(0:mxpft) !binary flag for seasonal-deciduous leaf habit (0 or 1) - real(r8):: pconv(0:mxpft) !proportion of deadstem to conversion flux - real(r8):: pprod10(0:mxpft) !proportion of deadstem to 10-yr product pool - real(r8):: pprod100(0:mxpft) !proportion of deadstem to 100-yr product pool - real(r8):: pprodharv10(0:mxpft) !harvest mortality proportion of deadstem to 10-yr pool - - ! new pft parameters for CN-fire code - real(r8):: resist(0:mxpft) !resistance to fire (no units) - - ! pft parameters for CNDV code - ! from LPJ subroutine pftparameters - real(r8) pftpar20(0:mxpft) !tree maximum crown area (m2) - real(r8) pftpar28(0:mxpft) !min coldest monthly mean temperature - real(r8) pftpar29(0:mxpft) !max coldest monthly mean temperature - real(r8) pftpar30(0:mxpft) !min growing degree days (>= 5 deg C) - real(r8) pftpar31(0:mxpft) !upper limit of temperature of the warmest month (twmax) - real(r8), parameter :: reinickerp = 1.6_r8 !parameter in allometric equation - real(r8), parameter :: dwood = 2.5e5_r8 !cn wood density (gC/m3); lpj:2.0e5 - real(r8), parameter :: allom1 = 100.0_r8 !parameters in - real(r8), parameter :: allom2 = 40.0_r8 !...allometric - real(r8), parameter :: allom3 = 0.5_r8 !...equations - real(r8), parameter :: allom1s = 250.0_r8 !modified for shrubs by - real(r8), parameter :: allom2s = 8.0_r8 !X.D.Z -! -! !PUBLIC MEMBER FUNCTIONS: - public :: pftconrd ! Read and initialize vegetation (PFT) constants -! -! !REVISION HISTORY: -! Created by Sam Levis (put into module form by Mariana Vertenstein) -! 10/21/03, Peter Thornton: Added new variables for CN code -! 06/24/09, Erik Kluzek: Add indices for all pft types, and add expected_pftnames array and comparision -! 09/17/10, David Lawrence: Modified code to read in netCDF pft physiology file -! -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: pftconrd -! -! !INTERFACE: - subroutine pftconrd -! -! !DESCRIPTION: -! Read and initialize vegetation (PFT) constants -! -! !USES: - use fileutils , only : getfil - use ncdio_pio , only : ncd_io, ncd_pio_closefile, ncd_pio_openfile, file_desc_t, & - ncd_inqdid, ncd_inqdlen - use clm_varctl, only : fpftcon - use clm_varcon, only : tfrz - use spmdMod , only : masterproc -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! routine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - character(len=256) :: locfn ! local file name - integer :: i,n ! loop indices - integer :: ier ! error code - type(file_desc_t) :: ncid ! pio netCDF file id - integer :: dimid ! netCDF dimension id - integer :: npft ! number of pfts on pft-physiology file - logical :: readv ! read variable in or not - character(len=32) :: subname = 'pftconrd' ! subroutine name - ! - ! Expected PFT names: The names expected on the fpftcon file and the order they are expected to be in. - ! NOTE: similar types are assumed to be together, first trees (ending with broadleaf_deciduous_boreal_tree - ! then shrubs, ending with broadleaf_deciduous_boreal_shrub, then grasses starting with c3_arctic_grass - ! and finally crops, ending with soybean - ! DO NOT CHANGE THE ORDER -- WITHOUT MODIFYING OTHER PARTS OF THE CODE WHERE THE ORDER MATTERS! - ! - character(len=40), parameter :: expected_pftnames(0:mxpft) = (/ & - 'not_vegetated ' & - , 'needleleaf_evergreen_temperate_tree' & - , 'needleleaf_evergreen_boreal_tree ' & - , 'needleleaf_deciduous_boreal_tree ' & - , 'broadleaf_evergreen_tropical_tree ' & - , 'broadleaf_evergreen_temperate_tree ' & - , 'broadleaf_deciduous_tropical_tree ' & - , 'broadleaf_deciduous_temperate_tree ' & - , 'broadleaf_deciduous_boreal_tree ' & - , 'broadleaf_evergreen_shrub ' & - , 'broadleaf_deciduous_temperate_shrub' & - , 'broadleaf_deciduous_boreal_shrub ' & - , 'c3_arctic_grass ' & - , 'c3_non-arctic_grass ' & - , 'c4_grass ' & - , 'c3_crop ' & - , 'c3_irrigated ' & - , 'corn ' & - , 'spring_temperate_cereal ' & - , 'winter_temperate_cereal ' & - , 'soybean ' & - /) -!----------------------------------------------------------------------- - - ! Set specific vegetation type values - - if (masterproc) then - write(iulog,*) 'Attempting to read PFT physiological data .....' - end if - call getfil (fpftcon, locfn, 0) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqdid(ncid,'pft',dimid) - call ncd_inqdlen(ncid,dimid,npft) - - call ncd_io('pftname',pftname, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('z0mr',z0mr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('displar',displar, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('dleaf',dleaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('c3psn',c3psn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('mp',mp, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('qe25',qe25, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('rholvis',rhol(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('rholnir',rhol(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('rhosvis',rhos(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('rhosnir', rhos(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('taulvis',taul(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('taulnir',taul(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('tausvis',taus(:,ivis), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('tausnir',taus(:,inir), 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('xl',xl, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('roota_par',roota_par, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('rootb_par',rootb_par, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('slatop',slatop, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('dsladlai',dsladlai, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('leafcn',leafcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('flnr',flnr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('smpso',smpso, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('smpsc',smpsc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fnitr',fnitr, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('woody',woody, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('lflitcn',lflitcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('frootcn',frootcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('livewdcn',livewdcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('deadwdcn',deadwdcn, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('grperc',grperc, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('grpnow',grpnow, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('froot_leaf',froot_leaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('stem_leaf',stem_leaf, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('croot_stem',croot_stem, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('flivewd',flivewd, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fcur',fcur, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fcurdv',fcurdv, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('lf_flab',lf_flab, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('lf_fcel',lf_fcel, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('lf_flig',lf_flig, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fr_flab',fr_flab, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fr_fcel',fr_fcel, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fr_flig',fr_flig, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('leaf_long',leaf_long, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('evergreen',evergreen, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('stress_decid',stress_decid, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('season_decid',season_decid, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('resist',resist, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pftpar20',pftpar20, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pftpar28',pftpar28, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pftpar29',pftpar29, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pftpar30',pftpar30, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pftpar31',pftpar31, 'read', ncid, readvar=readv, posNOTonfile=.true.) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pconv',pconv, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pprod10',pprod10, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pprodharv10',pprodharv10, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('pprod100',pprod100, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('graincn',graincn, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('mxtmp',mxtmp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('baset',baset, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('declfact',declfact, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('bfact',bfact, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('aleaff',aleaff, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('arootf',arootf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('astemf',astemf, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('arooti',arooti, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('fleafi',fleafi, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('allconsl',allconsl, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('allconss',allconss, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('crop',crop, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('irrigated',irrigated, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('ztopmx',ztopmx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('laimx',laimx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('gddmin',gddmin, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('hybgdd',hybgdd, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('lfemerg',lfemerg, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('grnfill',grnfill, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('mxmat',mxmat, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('planting_temp',planttemp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('min_planting_temp',minplanttemp, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('min_NH_planting_date',mnNHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('min_SH_planting_date',mnSHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('max_NH_planting_date',mxNHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_io('max_SH_planting_date',mxSHplantdate, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun( trim(subname)//' ERROR: error in reading in pft data' ) - call ncd_pio_closefile(ncid) - - do i = 0, mxpft - if ( trim(adjustl(pftname(i))) /= trim(expected_pftnames(i)) )then - write(iulog,*)'pftconrd: pftname is NOT what is expected, name = ', & - trim(pftname(i)), ', expected name = ', trim(expected_pftnames(i)) - call endrun( 'pftconrd: bad name for pft on fpftcon dataset' ) - end if - if ( trim(pftname(i)) == 'not_vegetated' ) noveg = i - if ( trim(pftname(i)) == 'needleleaf_evergreen_temperate_tree' ) ndllf_evr_tmp_tree = i - if ( trim(pftname(i)) == 'needleleaf_evergreen_boreal_tree' ) ndllf_evr_brl_tree = i - if ( trim(pftname(i)) == 'needleleaf_deciduous_boreal_tree' ) ndllf_dcd_brl_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_tropical_tree' ) nbrdlf_evr_trp_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_temperate_tree' ) nbrdlf_evr_tmp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_tropical_tree' ) nbrdlf_dcd_trp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_temperate_tree' ) nbrdlf_dcd_tmp_tree = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_boreal_tree' ) nbrdlf_dcd_brl_tree = i - if ( trim(pftname(i)) == 'broadleaf_evergreen_shrub' ) nbrdlf_evr_shrub = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_temperate_shrub' ) nbrdlf_dcd_tmp_shrub = i - if ( trim(pftname(i)) == 'broadleaf_deciduous_boreal_shrub' ) nbrdlf_dcd_brl_shrub = i - if ( trim(pftname(i)) == 'c3_arctic_grass' ) nc3_arctic_grass = i - if ( trim(pftname(i)) == 'c3_non-arctic_grass' ) nc3_nonarctic_grass = i - if ( trim(pftname(i)) == 'c4_grass' ) nc4_grass = i - if ( trim(pftname(i)) == 'c3_crop' ) nc3crop = i - if ( trim(pftname(i)) == 'c3_irrigated' ) nirrig = i - if ( trim(pftname(i)) == 'corn' ) ncorn = i - if ( trim(pftname(i)) == 'spring_temperate_cereal' ) nscereal = i - if ( trim(pftname(i)) == 'winter_temperate_cereal' ) nwcereal = i - if ( trim(pftname(i)) == 'soybean' ) nsoybean = i - end do - - ntree = nbrdlf_dcd_brl_tree ! value for last type of tree - npcropmin = ncorn ! first prognostic crop - npcropmax = nsoybean ! last prognostic crop in list - - if (use_cndv) then - fcur(:) = fcurdv(:) - end if - - ! - ! Do some error checking - ! - if ( npcropmax /= mxpft )then - call endrun( trim(subname)//' ERROR: npcropmax is NOT the last value' ) - end if - do i = 0, mxpft - if ( (irrigated(i) == 1.0_r8) .and. i == nirrig )then - ! correct - else if ( irrigated(i) == 0.0_r8 )then - ! correct - else - call endrun( trim(subname)//' ERROR: irrigated has wrong values' ) - end if - if ( crop(i) == 1.0_r8 .and. (i >= nc3crop .and. i <= npcropmax) )then - ! correct - else if ( crop(i) == 0.0_r8 )then - ! correct - else - call endrun( trim(subname)//' ERROR: crop has wrong values' ) - end if - if ( (i /= noveg) .and. (i < npcropmin) .and. & - abs(pconv(i)+pprod10(i)+pprod100(i) - 1.0_r8) > 1.e-7_r8 )then - call endrun( trim(subname)//' ERROR: pconv+pprod10+pprod100 do NOT sum to one.' ) - end if - if ( pprodharv10(i) > 1.0_r8 .or. pprodharv10(i) < 0.0_r8 )then - call endrun( trim(subname)//' ERROR: pprodharv10 outside of range.' ) - end if - end do - - if (masterproc) then - write(iulog,*) 'Successfully read PFT physiological data' - write(iulog,*) - end if - - end subroutine pftconrd - -end module pftvarcon - diff --git a/src_clm40/main/quadraticMod.F90 b/src_clm40/main/quadraticMod.F90 deleted file mode 100644 index ef3e561bb7..0000000000 --- a/src_clm40/main/quadraticMod.F90 +++ /dev/null @@ -1,57 +0,0 @@ -module quadraticMod - - use abortutils , only: endrun - use shr_kind_mod, only: r8 => shr_kind_r8 - use shr_log_mod , only: errMsg => shr_log_errMsg - use clm_varctl , only: iulog - - implicit none - - public :: quadratic - -contains - - subroutine quadratic (a, b, c, r1, r2) - ! - ! !DESCRIPTION: - !==============================================================================! - !----------------- Solve quadratic equation for its two roots -----------------! - !==============================================================================! - ! Solution from Press et al (1986) Numerical Recipes: The Art of Scientific - ! Computing (Cambridge University Press, Cambridge), pp. 145. - ! - ! !REVISION HISTORY: - ! 4/5/10: Adapted from /home/bonan/ecm/psn/An_gs_iterative.f90 by Keith Oleson - ! - ! !USES: - implicit none - ! - ! !ARGUMENTS: - real(r8), intent(in) :: a,b,c ! Terms for quadratic equation - real(r8), intent(out) :: r1,r2 ! Roots of quadratic equation - ! - ! !LOCAL VARIABLES: - real(r8) :: q ! Temporary term for quadratic solution - !------------------------------------------------------------------------------ - - if (a == 0._r8) then - write (iulog,*) 'Quadratic solution error: a = ',a - call endrun(msg=errmsg(__FILE__, __LINE__)) - end if - - if (b >= 0._r8) then - q = -0.5_r8 * (b + sqrt(b*b - 4._r8*a*c)) - else - q = -0.5_r8 * (b - sqrt(b*b - 4._r8*a*c)) - end if - - r1 = q / a - if (q /= 0._r8) then - r2 = c / q - else - r2 = 1.e36_r8 - end if - - end subroutine quadratic - -end module quadraticMod diff --git a/src_clm40/main/restFileMod.F90 b/src_clm40/main/restFileMod.F90 deleted file mode 100644 index 82e47b7d7e..0000000000 --- a/src_clm40/main/restFileMod.F90 +++ /dev/null @@ -1,729 +0,0 @@ -module restFileMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: restFileMod -! -! !DESCRIPTION: -! Reads from or writes to/ the CLM restart file. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use abortutils , only : endrun - use clm_varctl , only : iulog, use_cn - use surfrdMod , only : crop_prog - use ncdio_pio , only : file_desc_t, ncd_pio_createfile, ncd_pio_openfile, ncd_global, & - ncd_pio_closefile, ncd_defdim, ncd_putatt, ncd_enddef, check_dim -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: restFile_read - public :: restFile_write - public :: restFile_open - public :: restFile_close - public :: restFile_getfile - public :: restFile_filename ! Sets restart filename -! -! !PRIVATE MEMBER FUNCTIONS: - private :: restFile_read_pfile - private :: restFile_write_pfile ! Writes restart pointer file - private :: restFile_closeRestart ! Close restart file and write restart pointer file - private :: restFile_dimset - private :: restFile_dimcheck - private :: restFile_enddef -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !PRIVATE TYPES: None - private -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_write -! -! !INTERFACE: - subroutine restFile_write( file, nlend, noptr, rdate ) -! -! !DESCRIPTION: -! Read/write CLM restart file. -! -! !USES: - use clm_time_manager , only : timemgr_restart_io, get_nstep - use subgridRestMod , only : SubgridRest - use BiogeophysRestMod, only : BiogeophysRest - use CNRestMod , only : CNRest - use CropRestMod , only : CropRest - use accumulMod , only : accumulRest - use histFileMod , only : hist_restart_ncd -! -! !ARGUMENTS: - implicit none - character(len=*) , intent(in) :: file ! output netcdf restart file - logical, intent(in) :: nlend ! if at the end of the simulation - character(len=*) , intent(in) :: rdate ! restart file time stamp for name - logical, intent(in), optional :: noptr ! if should NOT write to the restart pointer file -! -! !CALLED FROM: -! subroutine clm_driver2 -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - type(file_desc_t) :: ncid ! netcdf id - integer :: i ! index - logical :: ptrfile ! write out the restart pointer file -!----------------------------------------------------------------------- - - if ( present(noptr) )then - ptrfile = .not. noptr - else - ptrfile = .true. - end if - - ! -------------------------------------------- - ! Open restart file - ! -------------------------------------------- - - call restFile_open( flag='write', file=file, ncid=ncid ) - - ! -------------------------------------------- - ! Define dimensions and variables - ! -------------------------------------------- - - call restFile_dimset ( ncid ) - - ! Define restart file variables - - call timemgr_restart_io( ncid, flag='define' ) - - call SubgridRest( ncid, flag='define' ) - - call BiogeophysRest( ncid, flag='define' ) - - if (use_cn) then - call CNRest( ncid, flag='define' ) - if ( crop_prog ) call CropRest( ncid, flag='define' ) - end if - - call accumulRest( ncid, flag='define' ) - - call hist_restart_ncd ( ncid, flag='define', rdate=rdate ) - - call restFile_enddef( ncid ) - - ! -------------------------------------------- - ! Write restart file variables - ! -------------------------------------------- - - call timemgr_restart_io( ncid, flag='write' ) - - call SubgridRest( ncid, flag='write' ) - - call BiogeophysRest( ncid, flag='write' ) - - if (use_cn) then - call CNRest( ncid, flag='write' ) - if ( crop_prog ) call CropRest( ncid, flag='write' ) - end if - - call accumulRest( ncid, flag='write' ) - - call hist_restart_ncd (ncid, flag='write' ) - - ! -------------------------------------------- - ! Close restart file and write restart pointer file - ! -------------------------------------------- - - call restFile_close( ncid ) - call restFile_closeRestart( file, nlend ) - - ! Write restart pointer file - - if ( ptrfile ) call restFile_write_pfile( file ) - - ! Write out diagnostic info - - if (masterproc) then - write(iulog,*) 'Successfully wrote out restart data at nstep = ',get_nstep() - write(iulog,'(72a1)') ("-",i=1,60) - end if - - end subroutine restFile_write - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_read -! -! !INTERFACE: - subroutine restFile_read( file ) -! -! !DESCRIPTION: -! Read a CLM restart file. -! -! !USES: - use BiogeophysRestMod, only : BiogeophysRest - use CNRestMod , only : CNRest - use CropRestMod , only : CropRest - use accumulMod , only : accumulRest - use histFileMod , only : hist_restart_ncd -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: file ! output netcdf restart file -! -! !CALLED FROM: -! subroutine initialize2 -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - type(file_desc_t) :: ncid ! netcdf id - integer :: i ! index -!----------------------------------------------------------------------- - - ! Open file - - call restFile_open( flag='read', file=file, ncid=ncid ) - - ! Read file - - call restFile_dimcheck( ncid ) - - call BiogeophysRest( ncid, flag='read' ) - - if (use_cn) then - call CNRest( ncid, flag='read' ) - if ( crop_prog ) call CropRest( ncid, flag='read' ) - end if - - call accumulRest( ncid, flag='read' ) - - call hist_restart_ncd (ncid, flag='read') - - ! Close file - - call restFile_close( ncid ) - - ! Write out diagnostic info - - if (masterproc) then - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) 'Successfully read restart data for restart run' - write(iulog,*) - end if - - end subroutine restFile_read - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_getfile -! -! !INTERFACE: - subroutine restFile_getfile( file, path ) -! -! !DESCRIPTION: -! Determine and obtain netcdf restart file -! -! !USES: - use clm_varctl, only : caseid, finidat, nrevsn, nsrest, brnch_retain_casename, & - nsrContinue, nsrBranch, nsrStartup - use fileutils , only : getfil -! -! !ARGUMENTS: - implicit none - character(len=*), intent(out) :: file ! name of netcdf restart file - character(len=*), intent(out) :: path ! full pathname of netcdf restart file -! -! !CALLED FROM: -! subroutine initialize2 -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: status ! return status - integer :: length ! temporary - character(len=256) :: ftest,ctest ! temporaries -!----------------------------------------------------------------------- - - ! Continue run: - ! Restart file pathname is read restart pointer file - - if (nsrest==nsrContinue) then - call restFile_read_pfile( path ) - call getfil( path, file, 0 ) - end if - - ! Branch run: - ! Restart file pathname is obtained from namelist "nrevsn" - ! Check case name consistency (case name must be different for branch run, - ! unless namelist specification states otherwise) - - if (nsrest==nsrBranch) then - length = len_trim(nrevsn) - if (nrevsn(length-2:length) == '.nc') then - path = trim(nrevsn) - else - path = trim(nrevsn) // '.nc' - end if - call getfil( path, file, 0 ) - - ! tcraig, adding xx. and .clm2 makes this more robust - ctest = 'xx.'//trim(caseid)//'.clm2' - ftest = 'xx.'//trim(file) - status = index(trim(ftest),trim(ctest)) - if (status /= 0 .and. .not.(brnch_retain_casename)) then - write(iulog,*) 'Must change case name on branch run if ',& - 'brnch_retain_casename namelist is not set' - write(iulog,*) 'previous case filename= ',trim(file),& - ' current case = ',trim(caseid), ' ctest = ',trim(ctest), & - ' ftest = ',trim(ftest) - call endrun() - end if - end if - - ! Initial run: - ! Restart file pathname is obtained from namelist "finidat" - - if (nsrest==nsrStartup) then - call getfil( finidat, file, 0 ) - end if - - end subroutine restFile_getfile - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_read_pfile -! -! !INTERFACE: - subroutine restFile_read_pfile( pnamer ) -! -! !DESCRIPTION: -! Setup restart file and perform necessary consistency checks -! -! !USES: - use fileutils , only : opnfil, getavu, relavu - use clm_varctl, only : rpntfil, rpntdir, inst_suffix -! -! !ARGUMENTS: - implicit none - character(len=*), intent(out) :: pnamer ! full path of restart file -! -! !CALLED FROM: -! subroutine restart in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i ! indices - integer :: nio ! restart unit - integer :: status ! substring check status - character(len=256) :: locfn ! Restart pointer file name -!----------------------------------------------------------------------- - - ! Obtain the restart file from the restart pointer file. - ! For restart runs, the restart pointer file contains the full pathname - ! of the restart file. For branch runs, the namelist variable - ! [nrevsn] contains the full pathname of the restart file. - ! New history files are always created for branch runs. - - if (masterproc) then - write(iulog,*) 'Reading restart pointer file....' - endif - - nio = getavu() - locfn = trim(rpntdir) //'/'// trim(rpntfil)//trim(inst_suffix) - call opnfil (locfn, nio, 'f') - read (nio,'(a256)') pnamer - call relavu (nio) - - if (masterproc) then - write(iulog,*) 'Reading restart data.....' - write(iulog,'(72a1)') ("-",i=1,60) - end if - - end subroutine restFile_read_pfile - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_closeRestart -! -! !INTERFACE: - subroutine restFile_closeRestart( file, nlend ) -! -! !DESCRIPTION: -! Close restart file and write restart pointer file if -! in write mode, otherwise just close restart file if in read mode -! -! !USES: - use clm_time_manager, only : is_last_step -! -! !ARGUMENTS: - implicit none - character(len=*) , intent(in) :: file ! local output filename - logical, intent(in) :: nlend -! -! !CALLED FROM: -! subroutine restart in this module -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i !index -!----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Successfully wrote local restart file ',trim(file) - write(iulog,'(72a1)') ("-",i=1,60) - write(iulog,*) - end if - - end subroutine restFile_closeRestart - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_write_pfile -! -! !INTERFACE: - subroutine restFile_write_pfile( fnamer ) -! -! !DESCRIPTION: -! Open restart pointer file. Write names of current netcdf restart file. -! -! !USES: - use clm_varctl, only : rpntdir, rpntfil, inst_suffix - use fileutils , only : relavu - use fileutils , only : getavu, opnfil -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fnamer -! -! !CALLED FROM: -! subroutine restart in this module -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m ! index - integer :: nio ! restart pointer file - character(len=256) :: filename ! local file name -!----------------------------------------------------------------------- - - if (masterproc) then - nio = getavu() - filename= trim(rpntdir) //'/'// trim(rpntfil)//trim(inst_suffix) - call opnfil( filename, nio, 'f' ) - - write(nio,'(a)') fnamer - call relavu( nio ) - write(iulog,*)'Successfully wrote local restart pointer file' - end if - - end subroutine restFile_write_pfile - -!----------------------------------------------------------------------- - subroutine restFile_open( flag, file, ncid ) - - use clm_time_manager, only : get_nstep - - implicit none - character(len=*), intent(in) :: flag ! flag to specify read or write - character(len=*), intent(in) :: file ! filename - type(file_desc_t), intent(out):: ncid ! netcdf id - - integer :: omode ! netCDF dummy variable - character(len= 32) :: subname='restFile_open' ! subroutine name - - if (flag == 'write') then - - ! Create new netCDF file (in define mode) and set fill mode - ! to "no fill" to optimize performance - - if (masterproc) then - write(iulog,*) - write(iulog,*)'restFile_open: writing restart dataset at ',& - trim(file), ' at nstep = ',get_nstep() - write(iulog,*) - end if - call ncd_pio_createfile(ncid, trim(file)) - - else if (flag == 'read') then - - ! Open netcdf restart file - - if (masterproc) then - write(iulog,*) 'Reading restart dataset' - end if - call ncd_pio_openfile (ncid, trim(file), 0) - - end if - - end subroutine restFile_open - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_filename -! -! !INTERFACE: - character(len=256) function restFile_filename( rdate ) -! -! !DESCRIPTION: -! -! !USES: - use clm_varctl, only : caseid, inst_suffix -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: rdate ! input date for restart file name -! -! !CALLED FROM: -! subroutine restart in this module -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - - restFile_filename = "./"//trim(caseid)//".clm2"//trim(inst_suffix)//& - ".r."//trim(rdate)//".nc" - if (masterproc) then - write(iulog,*)'writing restart file ',trim(restFile_filename),' for model date = ',rdate - end if - - end function restFile_filename - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: restFile_dimset -! -! !INTERFACE: - subroutine restFile_dimset( ncid ) -! -! !DESCRIPTION: -! Read/Write initial data from/to netCDF instantaneous initial data file -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use clm_time_manager, only : get_nstep, get_curr_date - use spmdMod , only : mpicom, MPI_LOGICAL - use clm_varctl , only : caseid, ctitle, version, username, hostname, fsurdat, & - conventions, source - use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd - use decompMod , only : get_proc_bounds, get_proc_global -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid -! -! !REVISION HISTORY: -! -! -! !LOCAL VARIABLES: -!EOP - integer :: yr ! current year (0 -> ...) - integer :: mon ! current month (1 -> 12) - integer :: day ! current day (1 -> 31) - integer :: mcsec ! seconds of current date - integer :: mcdate ! current date - integer :: dimid ! netCDF dimension id - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - integer :: ier ! error status - integer :: strlen_dimid ! string dimension id - character(len= 8) :: curdate ! current date - character(len= 8) :: curtime ! current time - character(len=256) :: str - character(len= 32) :: subname='restFile_dimset' ! subroutine name -!------------------------------------------------------------------------ - - call get_proc_global(numg, numl, numc, nump) - - ! Define dimensions - - call ncd_defdim(ncid, 'gridcell', numg , dimid) - call ncd_defdim(ncid, 'landunit', numl , dimid) - call ncd_defdim(ncid, 'column' , numc , dimid) - call ncd_defdim(ncid, 'pft' , nump , dimid) - - call ncd_defdim(ncid, 'levgrnd' , nlevgrnd , dimid) - call ncd_defdim(ncid, 'levlak' , nlevlak , dimid) - call ncd_defdim(ncid, 'levsno' , nlevsno , dimid) - call ncd_defdim(ncid, 'levsno1' , nlevsno+1 , dimid) - call ncd_defdim(ncid, 'levtot' , nlevsno+nlevgrnd, dimid) - call ncd_defdim(ncid, 'numrad' , numrad , dimid) - call ncd_defdim(ncid, 'string_length', 64 , dimid) - - ! Define global attributes - - call ncd_putatt(ncid, NCD_GLOBAL, 'Conventions', trim(conventions)) - call getdatetime(curdate, curtime) - str = 'created on ' // curdate // ' ' // curtime - call ncd_putatt(ncid, NCD_GLOBAL, 'history' , trim(str)) - call ncd_putatt(ncid, NCD_GLOBAL, 'username', trim(username)) - call ncd_putatt(ncid, NCD_GLOBAL, 'host' , trim(hostname)) - call ncd_putatt(ncid, NCD_GLOBAL, 'version' , trim(version)) - call ncd_putatt(ncid, NCD_GLOBAL, 'source' , trim(source)) - str = '$Id$' - call ncd_putatt(ncid, NCD_GLOBAL, 'revision_id' , trim(str)) - call ncd_putatt(ncid, NCD_GLOBAL, 'case_title' , trim(ctitle)) - call ncd_putatt(ncid, NCD_GLOBAL, 'case_id' , trim(caseid)) - call ncd_putatt(ncid, NCD_GLOBAL, 'surface_dataset', trim(fsurdat)) - call ncd_putatt(ncid, NCD_GLOBAL, 'title', & - 'CLM Restart information, required to continue a simulation' ) - - - end subroutine restFile_dimset - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_dimcheck -! -! !INTERFACE: - subroutine restFile_dimcheck( ncid ) -! -! !DESCRIPTION: -! Check dimensions of restart file -! -! !USES: - use decompMod, only : get_proc_bounds, get_proc_global - use clm_varpar, only : nlevsno, nlevlak, nlevgrnd - use clm_varctl, only : single_column, nsrest, nsrStartup - implicit none -! -! !ARGUMENTS: - type(file_desc_t), intent(inout) :: ncid -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: numg ! total number of gridcells across all processors - integer :: numl ! total number of landunits across all processors - integer :: numc ! total number of columns across all processors - integer :: nump ! total number of pfts across all processors - character(len=32) :: subname='restFile_dimcheck' ! subroutine name -!----------------------------------------------------------------------- - - ! Get relevant sizes - - if ( .not. single_column .or. nsrest /= nsrStartup )then - call get_proc_global(numg, numl, numc, nump) - call check_dim(ncid, 'gridcell', numg) - call check_dim(ncid, 'landunit', numl) - call check_dim(ncid, 'column' , numc) - call check_dim(ncid, 'pft' , nump) - end if - call check_dim(ncid, 'levsno' , nlevsno) - call check_dim(ncid, 'levgrnd' , nlevgrnd) - call check_dim(ncid, 'levlak' , nlevlak) - - end subroutine restFile_dimcheck - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_enddef -! -! !INTERFACE: - subroutine restFile_enddef( ncid ) -! -! !DESCRIPTION: -! Read a CLM restart file. -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP -!----------------------------------------------------------------------- - - call ncd_enddef(ncid) - - end subroutine restFile_enddef - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: restFile_close -! -! !INTERFACE: - subroutine restFile_close( ncid ) -! -! !DESCRIPTION: -! Read a CLM restart file. -! -! !USES: -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - character(len=32) :: subname='restFile_close' ! subroutine name -!----------------------------------------------------------------------- - - call ncd_pio_closefile(ncid) - - end subroutine restFile_close - -end module restFileMod - - - diff --git a/src_clm40/main/restUtilMod.F90 b/src_clm40/main/restUtilMod.F90 deleted file mode 100644 index 2e2533e881..0000000000 --- a/src_clm40/main/restUtilMod.F90 +++ /dev/null @@ -1,1319 +0,0 @@ -#include "dtypes.h" -!=================================================== -! DO NOT EDIT THIS FILE, it was generated using ../../../../../tools/cprnc/genf90/genf90.pl -! Any changes you make to this file may be lost -!=================================================== -module restUtilMod - - !----------------------------------------------------------------------- - ! provies generic routines and types for use with restart files - ! - use shr_kind_mod, only: r8=>shr_kind_r8, r4 => shr_kind_r4, i4=>shr_kind_i4 - use shr_sys_mod, only: shr_sys_abort - use spmdMod, only: masterproc - use clm_varctl, only: iulog - use clm_varcon, only: spval, ispval - use ncdio_pio - use pio - ! - implicit none - save - private - ! save - ! - !----------------------------------------------------------------------- - -# 21 "restUtilMod.F90.in" - interface restartvar - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_0d_text - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_1d_text - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_2d_text - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_0d_int - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_1d_int - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_2d_int - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_0d_double - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_1d_double - !TYPE text,int,double - !DIMS 0,1,2 - module procedure restartvar_2d_double - module procedure restartvar_2d_double_bounds - end interface restartvar - - integer,parameter, public :: iflag_interp = 1 - integer,parameter, public :: iflag_copy = 2 - integer,parameter, public :: iflag_skip = 3 - integer,parameter, public :: iflag_noswitchdim = 0 - integer,parameter, public :: iflag_switchdim = 1 - - public :: restartvar - - private :: is_restart - -# 38 "restUtilMod.F90.in" -contains - - !----------------------------------------------------------------------- - !DIMS 0 - !TYPE text,int,double -# 43 "restUtilMod.F90.in" - subroutine restartvar_0d_text(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - character(len=*) , intent(inout) :: data - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (100!=TYPETEXT) - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 145 "restUtilMod.F90.in" - end subroutine restartvar_0d_text - !DIMS 0 - !TYPE text,int,double -# 43 "restUtilMod.F90.in" - subroutine restartvar_0d_int(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - integer(i4) , intent(inout) :: data - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (103!=TYPETEXT) - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 145 "restUtilMod.F90.in" - end subroutine restartvar_0d_int - !DIMS 0 - !TYPE text,int,double -# 43 "restUtilMod.F90.in" - subroutine restartvar_0d_double(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , intent(inout) :: data - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (102!=TYPETEXT) - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 145 "restUtilMod.F90.in" - end subroutine restartvar_0d_double - - !----------------------------------------------------------------------- - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_1d_text(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - character(len=*) , pointer :: data(:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (100!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_1d_text - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_2d_text(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - character(len=*) , pointer :: data(:,:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (100!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_2d_text - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_1d_int(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - integer(i4) , pointer :: data(:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (103!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_1d_int - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_2d_int(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - integer(i4) , pointer :: data(:,:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (103!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_2d_int - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_1d_double(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , pointer :: data(:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (102!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_1d_double - !DIMS 1,2 - !TYPE text,int,double -# 150 "restUtilMod.F90.in" - subroutine restartvar_2d_double(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , pointer :: data(:,:) - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if (102!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 273 "restUtilMod.F90.in" - end subroutine restartvar_2d_double - - !----------------------------------------------------------------------- - -# 277 "restUtilMod.F90.in" - subroutine restartvar_2d_double_bounds(ncid, flag, varname, xtype, & - dim1name, dim2name, switchdim, lowerb2, upperb2, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: dim1name ! dimension name - character(len=*) , intent(in) :: dim2name ! dimension name - logical , intent(in) :: switchdim - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , pointer :: data(:,:) ! raw data - logical , intent(out) :: readvar ! was var read? - integer , intent(in), optional :: lowerb2 - integer , intent(in), optional :: upperb2 - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid ! returned var id - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (switchdim) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim2name), dim2name=trim(dim1name), & - long_name=trim(long_name), units=units) - else - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - status = PIO_inq_varid(ncid, trim(varname), vardesc) - - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=>nearest_neighbor 2=>copy 3=>skip") - - if (switchdim) then - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 1) - else - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 0) - end if - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_values', (/0,1/)) - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_0', & - "1st and 2nd dims are same as model representation") - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_1', & - "1st and 2nd dims are switched from model representation") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else - - if (present(lowerb2) .and. present(upperb2)) then - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - lowerb2=lowerb2, upperb2=upperb2, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - ncid=ncid, flag=flag, readvar=readvar) - end if - - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - -# 412 "restUtilMod.F90.in" - end subroutine restartvar_2d_double_bounds - - - !----------------------------------------------------------------------- -# 416 "restUtilMod.F90.in" - logical function is_restart( ) - ! Determine if restart run - use clm_varctl, only : nsrest, nsrContinue - if (nsrest == nsrContinue) then - is_restart = .true. - else - is_restart = .false. - end if -# 424 "restUtilMod.F90.in" - end function is_restart - -end module restUtilMod diff --git a/src_clm40/main/restUtilMod.F90.in b/src_clm40/main/restUtilMod.F90.in deleted file mode 100644 index 07a6c82cd6..0000000000 --- a/src_clm40/main/restUtilMod.F90.in +++ /dev/null @@ -1,426 +0,0 @@ -module restUtilMod - - !----------------------------------------------------------------------- - ! provies generic routines and types for use with restart files - ! - use shr_kind_mod, only: r8=>shr_kind_r8, r4 => shr_kind_r4, i4=>shr_kind_i4 - use shr_sys_mod, only: shr_sys_abort - use spmdMod, only: masterproc - use clm_varctl, only: iulog - use clm_varcon, only: spval, ispval - use ncdio_pio - use pio - ! - implicit none - save - private - ! save - ! - !----------------------------------------------------------------------- - - interface restartvar - !DIMS 0,1,2 - !TYPE text,int,double - module procedure restartvar_{DIMS}d_{TYPE} - module procedure restartvar_2d_double_bounds - end interface restartvar - - integer,parameter, public :: iflag_interp = 1 - integer,parameter, public :: iflag_copy = 2 - integer,parameter, public :: iflag_skip = 3 - integer,parameter, public :: iflag_noswitchdim = 0 - integer,parameter, public :: iflag_switchdim = 1 - - public :: restartvar - - private :: is_restart - -contains - - !----------------------------------------------------------------------- - !DIMS 0 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - {VTYPE} , intent(inout) :: data{DIMSTR} - logical , intent(out) :: readvar ! was var read? - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if ({ITYPE}!=TYPETEXT) - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - !DIMS 1,2 - !TYPE text,int,double - subroutine restartvar_{DIMS}d_{TYPE}(& - ncid, flag, varname, xtype, dim1name, dim2name, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t) , intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - {VTYPE} , pointer :: data{DIMSTR} - logical , intent(inout) :: readvar ! was var read? - character(len=*) , intent(in), optional :: dim1name ! dimension name - character(len=*) , intent(in), optional :: dim2name ! dimension name - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (.not. present(dim1name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - long_name=trim(long_name), units=units) - else if (.not. present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), & - long_name=trim(long_name), units=units) - else if (present(dim2name)) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - - status = PIO_inq_varid(ncid, trim(varname), vardesc) - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=nearest neighbor, 2=copy directly, 3=skip") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else if (flag == 'read' .or. flag == 'write') then - -#if ({ITYPE}!=TYPETEXT) - if (.not. present(dim1name)) then - call ncd_io(varname=trim(varname), data=data, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), ncid=ncid, flag=flag, readvar=readvar) - end if -#endif - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - - end subroutine restartvar_{DIMS}d_{TYPE} - - !----------------------------------------------------------------------- - - subroutine restartvar_2d_double_bounds(ncid, flag, varname, xtype, & - dim1name, dim2name, switchdim, lowerb2, upperb2, & - long_name, units, interpinic_flag, data, readvar, & - comment, flag_meanings, missing_value, fill_value, & - imissing_value, ifill_value, flag_values, nvalid_range ) - - !---------------------------------------------------- - ! Arguments - type(file_desc_t), intent(inout) :: ncid ! netcdf file id - character(len=*) , intent(in) :: flag ! 'read' or 'write' - character(len=*) , intent(in) :: varname ! variable name - integer , intent(in) :: xtype ! netcdf data type - character(len=*) , intent(in) :: dim1name ! dimension name - character(len=*) , intent(in) :: dim2name ! dimension name - logical , intent(in) :: switchdim - character(len=*) , intent(in) :: long_name ! long name for variable - character(len=*) , intent(in) :: interpinic_flag ! interpolate variable using interpinic - real(r8) , pointer :: data(:,:) ! raw data - logical , intent(out) :: readvar ! was var read? - integer , intent(in), optional :: lowerb2 - integer , intent(in), optional :: upperb2 - character(len=*) , intent(in), optional :: units ! long name for variable - character(len=*) , intent(in), optional :: comment ! attribute - character(len=*) , intent(in), optional :: flag_meanings(:) ! attribute - real(r8) , intent(in), optional :: missing_value ! attribute for real - real(r8) , intent(in), optional :: fill_value ! attribute for real - integer , intent(in), optional :: imissing_value ! attribute for int - integer , intent(in), optional :: ifill_value ! attribute for int - integer , intent(in), optional :: flag_values(:) ! attribute for int - integer , intent(in), optional :: nvalid_range(2) ! attribute for int - ! - ! Local variables - integer :: ivalue - type(var_desc_t) :: vardesc ! local vardesc - integer :: status ! return error code - integer :: varid ! returned var id - integer :: lxtype ! local external type (in case logical variable) - !---------------------------------------------------- - - if (flag == 'define') then - - if ( xtype == ncd_log )then - lxtype = ncd_int - else - lxtype = xtype - end if - - if (switchdim) then - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim2name), dim2name=trim(dim1name), & - long_name=trim(long_name), units=units) - else - call ncd_defvar(ncid=ncid, varname=trim(varname), xtype=lxtype, & - dim1name=trim(dim1name), dim2name=trim(dim2name), & - long_name=trim(long_name), units=units) - end if - status = PIO_inq_varid(ncid, trim(varname), vardesc) - - varid = vardesc%varid - - if (trim(interpinic_flag) == 'interp') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_interp) - else if (trim(interpinic_flag) == 'copy') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_copy) - else if (trim(interpinic_flag) == 'skip') then - status = PIO_put_att(ncid, varid, 'interpinic_flag', iflag_skip) - end if - status = PIO_put_att(ncid, varid, 'interpinic_flag_meanings', & - "1=>nearest_neighbor 2=>copy 3=>skip") - - if (switchdim) then - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 1) - else - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag', 0) - end if - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_values', (/0,1/)) - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_0', & - "1st and 2nd dims are same as model representation") - status = PIO_put_att(ncid, vardesc%varid, 'switchdim_flag_is_1', & - "1st and 2nd dims are switched from model representation") - - if (present(comment)) then - call ncd_putatt(ncid, varid, 'comment', trim(comment)) - end if - if (present(units)) then - call ncd_putatt(ncid, varid, 'units', trim(units)) - end if - if (present(fill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', fill_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, '_FillValue', spval, lxtype) - end if - if (present(missing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', missing_value, lxtype) - else if (lxtype == ncd_double) then - call ncd_putatt(ncid, varid, 'missing_value', spval, lxtype) - end if - if (present(ifill_value)) then - call ncd_putatt(ncid, varid, '_FillValue', ifill_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, '_FillValue', ispval, lxtype) - end if - if (present(imissing_value)) then - call ncd_putatt(ncid, varid, 'missing_value', imissing_value, lxtype) - else if (lxtype == ncd_int) then - call ncd_putatt(ncid, varid, 'missing_value', ispval, lxtype) - end if - if (present(nvalid_range)) then - status = PIO_put_att(ncid,varid,'valid_range', nvalid_range ) - end if - if ( xtype == ncd_log )then - status = PIO_put_att(ncid,varid,'flag_values', (/0, 1/) ) - status = PIO_put_att(ncid,varid,'flag_meanings', "FALSE TRUE" ) - status = PIO_put_att(ncid,varid,'valid_range', (/0, 1/) ) - end if - - else - - if (present(lowerb2) .and. present(upperb2)) then - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - lowerb2=lowerb2, upperb2=upperb2, & - ncid=ncid, flag=flag, readvar=readvar) - else - call ncd_io(varname=trim(varname), data=data, & - dim1name=trim(dim1name), switchdim=switchdim, & - ncid=ncid, flag=flag, readvar=readvar) - end if - - end if - - if (flag == 'read') then - if (.not. readvar .and. is_restart()) call shr_sys_abort() - end if - - end subroutine restartvar_2d_double_bounds - - - !----------------------------------------------------------------------- - logical function is_restart( ) - ! Determine if restart run - use clm_varctl, only : nsrest, nsrContinue - if (nsrest == nsrContinue) then - is_restart = .true. - else - is_restart = .false. - end if - end function is_restart - -end module restUtilMod diff --git a/src_clm40/main/spmdGathScatMod.F90 b/src_clm40/main/spmdGathScatMod.F90 deleted file mode 100644 index 3aab333d63..0000000000 --- a/src_clm40/main/spmdGathScatMod.F90 +++ /dev/null @@ -1,537 +0,0 @@ -module spmdGathScatMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: spmdGathScatMod -! -! !DESCRIPTION: -! Perform SPMD gather and scatter operations. -! -! !USES: - use clm_varcon, only: spval, ispval - use decompMod, only : get_clmlevel_gsmap - use shr_kind_mod, only: r8 => shr_kind_r8 - use spmdMod - use mct_mod - use abortutils, only : endrun - use clm_varctl, only : iulog - use perf_mod -! -! !PUBLIC TYPES: - implicit none - private -! -! !PUBLIC MEMBER FUNCTIONS: - public scatter_data_from_master, gather_data_to_master - - interface scatter_data_from_master - module procedure scatter_1darray_int - module procedure scatter_1darray_real - end interface - - interface gather_data_to_master - module procedure gather_1darray_int - module procedure gather_1darray_real - end interface -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -! - integer,private,parameter :: debug = 0 - -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_int -! -! !INTERFACE: - subroutine scatter_1darray_int (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_int -! -! !INTERFACE: - subroutine gather_1darray_int (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather int 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - integer , pointer :: alocal(:) ! local data (output) - integer , pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - integer ,optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - integer ,pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_int' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(istring) == 0) then - istring = trim(fname) - else - istring = trim(istring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importIattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportIattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_int - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: scatter_1darray_real -! -! !INTERFACE: - subroutine scatter_1darray_real (alocal, aglobal, clmlevel) -! -! !DESCRIPTION: -! Wrapper routine to scatter real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! local data array - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'scatter_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - if (debug > 1) call t_startf(trim(subname)//'_pack') - - if (masterproc) then - lsize = size(aglobal,dim=1) - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - allocate(adata(lsize)) - do n2 = lb2,ub2 - adata(1:lsize) = aglobal(1:lsize) - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_scat') - - call mct_aVect_scatter(AVi, AVo, gsmap, 0, mpicom) - - if (debug > 1) call t_stopf(trim(subname)//'_scat') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - lsize = size(alocal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - do n1 = lb1,ub1 - alocal(n1) = adata(n1-lb1+1) - enddo - enddo - deallocate(adata) - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVi) - endif - call mct_aVect_clean(AVo) - - call t_stopf(trim(subname)//'_total') - - end subroutine scatter_1darray_real - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: gather_1darray_real -! -! !INTERFACE: - subroutine gather_1darray_real (alocal, aglobal, clmlevel, missing) -! -! !DESCRIPTION: -! Wrapper routine to gather real 1d array -! -! !USES: -! -! !ARGUMENTS: - implicit none - real(r8), pointer :: alocal(:) ! local data (output) - real(r8), pointer :: aglobal(:) ! global data (input) - character(len=*) ,intent(in) :: clmlevel ! type of input grid - real(r8),optional,intent(in) :: missing ! missing value -! -! !REVISION HISTORY: -! Author: T Craig -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n1,n2,lb1,ub1,lb2,ub2 ! indices - integer :: lsize ! size of local array - type(mct_aVect) :: AVi, AVo ! attribute vectors - real(r8),pointer :: adata(:) ! temporary data array - integer ,pointer :: mvect(:) ! local array for mask - character(len=256) :: rstring ! real field list string - character(len=256) :: istring ! int field list string - character(len=8) :: fname ! arbitrary field name - type(mct_gsMap),pointer :: gsmap ! global seg map - character(len=*),parameter :: subname = 'gather_1darray_real' - -!----------------------------------------------------------------------- - - call t_startf(trim(subname)//'_total') - call get_clmlevel_gsmap(clmlevel,gsmap) - - lsize = size(alocal,dim=1) - lb1 = lbound(alocal,dim=1) - ub1 = ubound(alocal,dim=1) - lb2 = 1 - ub2 = 1 - - rstring = "" - istring = "" - - if (present(missing)) then - istring = "mask" - endif - - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - if (len_trim(rstring) == 0) then - rstring = trim(fname) - else - rstring = trim(rstring)//":"//trim(fname) - endif - enddo - - if (masterproc .and. debug > 2) then - write(iulog,*) trim(subname),' strings:',trim(rstring),' ',trim(istring) - endif - - call mct_aVect_init(AVi,rList=trim(rstring),iList=trim(istring),lsize=lsize) - - if (debug > 1) call t_startf(trim(subname)//'_pack') - allocate(adata(lsize)) - do n2 = lb2,ub2 - do n1 = lb1,ub1 - adata(n1-lb1+1) = alocal(n1) - enddo - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_importRattr(AVi,trim(fname),adata,lsize) - enddo - deallocate(adata) - - if (present(missing)) then - allocate(mvect(lsize)) - do n1 = lb1,ub1 - mvect(n1-lb1+1) = 1 - enddo - call mct_aVect_importIattr(AVi,"mask",mvect,lsize) - deallocate(mvect) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_pack') - if (debug > 1) call t_startf(trim(subname)//'_gath') - - if (present(missing)) then -! tcx wait for update in mct, then get rid of "mask" -! call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom, missing = missing) - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - else - call mct_aVect_gather(AVi, AVo, gsmap, 0, mpicom) - endif - - if (debug > 1) call t_stopf(trim(subname)//'_gath') - if (debug > 1) call t_startf(trim(subname)//'_upck') - - if (masterproc) then - lsize = size(aglobal,dim=1) - allocate(adata(lsize)) - do n2 = lb2,ub2 - write(fname,'(a1,i3.3)') 'f',n2-lb2+1 - call mct_aVect_exportRattr(AVo,trim(fname),adata,lsize) - aglobal(1:lsize) = adata(1:lsize) - enddo - deallocate(adata) - if (present(missing)) then - allocate(mvect(lsize)) - call mct_aVect_exportIattr(AVo,"mask",mvect,lsize) - do n1 = 1,lsize - if (mvect(n1) == 0) then - do n2 = lb2,ub2 - aglobal(n1) = missing - enddo - endif - enddo - deallocate(mvect) - endif - endif - - if (debug > 1) call t_stopf(trim(subname)//'_upck') - - if (masterproc) then - call mct_aVect_clean(AVo) - endif - - call mct_aVect_clean(AVi) - - call t_stopf(trim(subname)//'_total') - - end subroutine gather_1darray_real - -end module spmdGathScatMod diff --git a/src_clm40/main/spmdMod.F90 b/src_clm40/main/spmdMod.F90 deleted file mode 100644 index 6983b96281..0000000000 --- a/src_clm40/main/spmdMod.F90 +++ /dev/null @@ -1,142 +0,0 @@ - -module spmdMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: spmdMod -! -! !DESCRIPTION: -! SPMD initialization -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -!EOP -!----------------------------------------------------------------------- - - use shr_kind_mod, only: r8 => shr_kind_r8 - use clm_varctl , only: iulog - implicit none - - private - -#include - - save - - ! Default settings valid even if there is no spmd - - logical, public :: masterproc ! proc 0 logical for printing msgs - integer, public :: iam ! processor number - integer, public :: npes ! number of processors for clm - integer, public :: mpicom ! communicator group for clm - integer, public :: comp_id ! component id - - ! - ! Public methods - ! - public :: spmd_init ! Initialization - - ! - ! Values from mpif.h that can be used - ! - public :: MPI_INTEGER - public :: MPI_REAL8 - public :: MPI_LOGICAL - public :: MPI_SUM - public :: MPI_MIN - public :: MPI_MAX - public :: MPI_LOR - public :: MPI_STATUS_SIZE - public :: MPI_ANY_SOURCE - public :: MPI_CHARACTER - public :: MPI_COMM_WORLD - public :: MPI_MAX_PROCESSOR_NAME - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: spmd_init( clm_mpicom ) -! -! !INTERFACE: - subroutine spmd_init( clm_mpicom, LNDID ) -! -! !DESCRIPTION: -! MPI initialization (number of cpus, processes, tids, etc) -! -! !USES -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: clm_mpicom - integer, intent(in) :: LNDID -! -! !REVISION HISTORY: -! Author: Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i,j ! indices - integer :: ier ! return error status - integer :: mylength ! my processor length - logical :: mpi_running ! temporary - integer, allocatable :: length(:) - integer, allocatable :: displ(:) - character*(MPI_MAX_PROCESSOR_NAME), allocatable :: procname(:) - character*(MPI_MAX_PROCESSOR_NAME) :: myprocname -!----------------------------------------------------------------------- - - ! Initialize mpi communicator group - - mpicom = clm_mpicom - - comp_id = LNDID - - ! Get my processor id - - call mpi_comm_rank(mpicom, iam, ier) - if (iam==0) then - masterproc = .true. - else - masterproc = .false. - end if - - ! Get number of processors - - call mpi_comm_size(mpicom, npes, ier) - - ! Get my processor names - - allocate (length(0:npes-1), displ(0:npes-1), procname(0:npes-1)) - - call mpi_get_processor_name (myprocname, mylength, ier) - call mpi_allgather(mylength,1,MPI_INTEGER,length,1,MPI_INTEGER,mpicom,ier) - - do i = 0,npes-1 - displ(i)=i*MPI_MAX_PROCESSOR_NAME - end do - call mpi_gatherv (myprocname,mylength,MPI_CHARACTER, & - procname,length,displ,MPI_CHARACTER,0,mpicom,ier) - if (masterproc) then - write(iulog,100)npes - write(iulog,200) - write(iulog,220) - do i=0,npes-1 - write(iulog,250)i,(procname((i))(j:j),j=1,length(i)) - end do - endif - - deallocate (length, displ, procname) - -100 format(//,i3," pes participating in computation for CLM") -200 format(/,35('-')) -220 format(/,"NODE#",2x,"NAME") -250 format("(",i5,")",2x,100a1,//) - - end subroutine spmd_init - -end module spmdMod diff --git a/src_clm40/main/subgridAveMod.F90 b/src_clm40/main/subgridAveMod.F90 deleted file mode 100644 index 426beb1a60..0000000000 --- a/src_clm40/main/subgridAveMod.F90 +++ /dev/null @@ -1,1695 +0,0 @@ -module subgridAveMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: subgridAveMod -! -! !DESCRIPTION: -! Utilities to perfrom subgrid averaging -! -! !USES: - use shr_kind_mod, only: r8 => shr_kind_r8 - use clmtype - use clm_varcon, only : spval, isturb, icol_roof, icol_sunwall, icol_shadewall, & - icol_road_perv, icol_road_imperv - use clm_varctl, only : iulog - use abortutils, only : endrun - -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: p2c ! Perfrom an average from pfts to columns - public :: p2l ! Perfrom an average from pfts to landunits - public :: p2g ! Perfrom an average from pfts to gridcells - public :: c2l ! Perfrom an average from columns to landunits - public :: c2g ! Perfrom an average from columns to gridcells - public :: l2g ! Perfrom an average from landunits to gridcells - - interface p2c - module procedure p2c_1d - module procedure p2c_2d - module procedure p2c_1d_filter - module procedure p2c_2d_filter - end interface - interface p2l - module procedure p2l_1d - module procedure p2l_2d - end interface - interface p2g - module procedure p2g_1d - module procedure p2g_2d - end interface - interface c2l - module procedure c2l_1d - module procedure c2l_2d - end interface - interface c2g - module procedure c2g_1d - module procedure c2g_2d - end interface - interface l2g - module procedure l2g_1d - module procedure l2g_2d - end interface -! -! !PRIVATE MEMBER FUNCTIONS: - private :: build_scale_l2g - private :: create_scale_l2g_lookup -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -!EOP - -! WJS (10-14-11): TODO: -! -! - I believe that scale_p2c, scale_c2l and scale_l2g should be included in the sumwt -! accumulations (e.g., sumwt = sumwt + wtgcell * scale_p2c * scale_c2l * scale_l2g), but -! that requires some more thought to (1) make sure that is correct, and (2) make sure it -! doesn't break the urban scaling. (See also my notes in create_scale_l2g_lookup.) -! - Once that is done, you could use a scale of 0, avoiding the need for the use of -! spval and the special checks that requires. -! -! - Currently, there is a lot of repeated code to calculate scale_c2l. This should be -! cleaned up. -! - At a minimum, should collect the repeated code into a subroutine to eliminate this -! repitition -! - The best thing might be to use a lookup array, as is done for scale_l2g -! ----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2c_1d -! -! !INTERFACE: - subroutine p2c_1d (lbp, ubp, lbc, ubc, parr, carr, p2c_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from pfts to columns. -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_col -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft - integer , intent(in) :: lbc, ubc ! beginning and ending column - real(r8), intent(in) :: parr(lbp:ubp) ! pft array - real(r8), intent(out) :: carr(lbc:ubc) ! column array - character(len=*), intent(in) :: p2c_scale_type ! scale type -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: pi,p,c,index ! indices - real(r8) :: scale_p2c(lbp:ubp) ! scale factor for column->landunit mapping - logical :: found ! temporary for error check - real(r8) :: sumwt(lbc:ubc) ! sum of weights - real(r8), pointer :: wtcol(:) ! weight of pft relative to column - integer , pointer :: pcolumn(:) ! column index of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in column - integer , pointer :: pfti(:) ! initial pft index in column -!------------------------------------------------------------------------ - - wtcol => pft%wtcol - pcolumn => pft%column - npfts => col%npfts - pfti => col%pfti - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2c_1d error: scale type ',p2c_scale_type,' not supported' - call endrun() - end if - - carr(lbc:ubc) = spval - sumwt(lbc:ubc) = 0._r8 - do p = lbp,ubp - if (wtcol(p) /= 0._r8) then - if (parr(p) /= spval) then - c = pcolumn(p) - if (sumwt(c) == 0._r8) carr(c) = 0._r8 - carr(c) = carr(c) + parr(p) * scale_p2c(p) * wtcol(p) - sumwt(c) = sumwt(c) + wtcol(p) - end if - end if - end do - found = .false. - do c = lbc,ubc - if (sumwt(c) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = c - else if (sumwt(c) /= 0._r8) then - carr(c) = carr(c)/sumwt(c) - end if - end do - if (found) then - write(iulog,*)'p2c error: sumwt is greater than 1.0 at c= ',index - call endrun() - end if - - end subroutine p2c_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2c_2d -! -! !INTERFACE: - subroutine p2c_2d (lbp, ubp, lbc, ubc, num2d, parr, carr, p2c_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from landunits to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_col -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft - integer , intent(in) :: lbc, ubc ! beginning and ending column - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: parr(lbp:ubp,num2d) ! pft array - real(r8), intent(out) :: carr(lbc:ubc,num2d) ! column array - character(len=*), intent(in) :: p2c_scale_type ! scale type -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,pi,p,c,index ! indices - real(r8) :: scale_p2c(lbp:ubp) ! scale factor for column->landunit mapping - logical :: found ! temporary for error check - real(r8) :: sumwt(lbc:ubc) ! sum of weights - real(r8), pointer :: wtcol(:) ! weight of pft relative to column - integer , pointer :: pcolumn(:) ! column index of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in column - integer , pointer :: pfti(:) ! initial pft index in column -!------------------------------------------------------------------------ - - wtcol => pft%wtcol - pcolumn => pft%column - npfts => col%npfts - pfti => col%pfti - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2c_2d error: scale type ',p2c_scale_type,' not supported' - call endrun() - end if - - carr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do p = lbp,ubp - if (wtcol(p) /= 0._r8) then - if (parr(p,j) /= spval) then - c = pcolumn(p) - if (sumwt(c) == 0._r8) carr(c,j) = 0._r8 - carr(c,j) = carr(c,j) + parr(p,j) * scale_p2c(p) * wtcol(p) - sumwt(c) = sumwt(c) + wtcol(p) - end if - end if - end do - found = .false. - do c = lbc,ubc - if (sumwt(c) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = c - else if (sumwt(c) /= 0._r8) then - carr(c,j) = carr(c,j)/sumwt(c) - end if - end do - if (found) then - write(iulog,*)'p2c_2d error: sumwt is greater than 1.0 at c= ',index,' lev= ',j - call endrun() - end if - end do - end subroutine p2c_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2c_1d_filter -! -! !INTERFACE: - subroutine p2c_1d_filter (numfc, filterc, pftarr, colarr) -! -! !DESCRIPTION: -! perform pft to column averaging for single level pft arrays -! -! !USES: - use clm_varpar, only : max_pft_per_col - use clm_varcon, only : istice_mec -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: numfc - integer , intent(in) :: filterc(numfc) - real(r8), pointer :: pftarr(:) - real(r8), pointer :: colarr(:) -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: fc,c,pi,p,l ! indices - integer , pointer :: npfts(:) - integer , pointer :: pfti(:) - integer , pointer :: pftf(:) - integer , pointer :: clandunit(:) - integer , pointer :: ltype(:) - real(r8), pointer :: wtcol(:) - real(r8), pointer :: wtgcell(:) -!----------------------------------------------------------------------- - - npfts => col%npfts - pfti => col%pfti - pftf => col%pftf - clandunit => col%landunit - ltype => lun%itype - wtcol => pft%wtcol - wtgcell => pft%wtgcell - - do fc = 1,numfc - c = filterc(fc) - l = clandunit(c) - colarr(c) = 0._r8 - do p = pfti(c), pftf(c) - ! Note: some glacier_mec pfts may have zero weight - if (wtgcell(p) > 0._r8 .or. ltype(l)==istice_mec) colarr(c) = colarr(c) + pftarr(p) * wtcol(p) - end do - end do - - end subroutine p2c_1d_filter - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2c_2d_filter -! -! !INTERFACE: - subroutine p2c_2d_filter (lev, numfc, filterc, pftarr, colarr) -! -! !DESCRIPTION: -! perform pft to column averaging for multi level pft arrays -! -! !USES: - use clm_varpar, only : max_pft_per_col - -! !ARGUMENTS: - implicit none - integer , intent(in) :: lev - integer , intent(in) :: numfc - integer , intent(in) :: filterc(numfc) - real(r8), pointer :: pftarr(:,:) - real(r8), pointer :: colarr(:,:) -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: fc,c,pi,p,j ! indices - integer , pointer :: npfts(:) - integer , pointer :: pfti(:) - integer , pointer :: pftf(:) - real(r8), pointer :: wtcol(:) -!----------------------------------------------------------------------- - - npfts => col%npfts - pfti => col%pfti - pftf => col%pftf - wtcol => pft%wtcol - - do j = 1,lev - do fc = 1,numfc - c = filterc(fc) - colarr(c,j) = 0._r8 - do p = pfti(c), pftf(c) - colarr(c,j) = colarr(c,j) + pftarr(p,j) * wtcol(p) - end do - end do - end do - - end subroutine p2c_2d_filter - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2l_1d -! -! !INTERFACE: - subroutine p2l_1d (lbp, ubp, lbc, ubc, lbl, ubl, parr, larr, & - p2c_scale_type, c2l_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from pfts to landunits -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_lu -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft indices - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - real(r8), intent(in) :: parr(lbp:ubp) ! input column array - real(r8), intent(out) :: larr(lbl:ubl) ! output landunit array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: pi,p,c,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: sumwt(lbl:ubl) ! sum of weights - real(r8) :: scale_p2c(lbc:ubc) ! scale factor for pft->column mapping - real(r8) :: scale_c2l(lbc:ubc) ! scale factor for column->landunit mapping - real(r8), pointer :: wtlunit(:) ! weight of pft relative to landunit - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: plandunit(:) ! landunit of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in landunit - integer , pointer :: pfti(:) ! initial pft index in landunit - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - canyon_hwr => lun%canyon_hwr - ltype => lun%itype - ctype => col%itype - clandunit => col%landunit - wtlunit => pft%wtlunit - pcolumn => pft%column - plandunit => pft%landunit - npfts => lun%npfts - pfti => lun%pfti - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2l_1d error: scale type ',p2c_scale_type,' not supported' - call endrun() - end if - - larr(:) = spval - sumwt(:) = 0._r8 - do p = lbp,ubp - if (wtlunit(p) /= 0._r8) then - c = pcolumn(p) - if (parr(p) /= spval .and. scale_c2l(c) /= spval) then - l = plandunit(p) - if (sumwt(l) == 0._r8) larr(l) = 0._r8 - larr(l) = larr(l) + parr(p) * scale_p2c(p) * scale_c2l(c) * wtlunit(p) - sumwt(l) = sumwt(l) + wtlunit(p) - end if - end if - end do - found = .false. - do l = lbl,ubl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l) = larr(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'p2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun() - end if - - end subroutine p2l_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2l_2d -! -! !INTERFACE: - subroutine p2l_2d(lbp, ubp, lbc, ubc, lbl, ubl, num2d, parr, larr, & - p2c_scale_type, c2l_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from pfts to landunits -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_lu -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft indices - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: parr(lbp:ubp,num2d) ! input pft array - real(r8), intent(out) :: larr(lbl:ubl,num2d) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,pi,p,c,l,index ! indices - logical :: found ! temporary for error check - real(r8) :: sumwt(lbl:ubl) ! sum of weights - real(r8) :: scale_p2c(lbc:ubc) ! scale factor for pft->column mapping - real(r8) :: scale_c2l(lbc:ubc) ! scale factor for column->landunit mapping - real(r8), pointer :: wtlunit(:) ! weight of pft relative to landunit - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: plandunit(:) ! landunit of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in landunit - integer , pointer :: pfti(:) ! initial pft index in landunit - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - canyon_hwr => lun%canyon_hwr - ltype => lun%itype - clandunit => col%landunit - ctype => col%itype - wtlunit => pft%wtlunit - pcolumn => pft%column - plandunit => pft%landunit - npfts => lun%npfts - pfti => lun%pfti - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2l_2d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2l_2d error: scale type ',p2c_scale_type,' not supported' - call endrun() - end if - - larr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do p = lbp,ubp - if (wtlunit(p) /= 0._r8) then - c = pcolumn(p) - if (parr(p,j) /= spval .and. scale_c2l(c) /= spval) then - l = plandunit(p) - if (sumwt(l) == 0._r8) larr(l,j) = 0._r8 - larr(l,j) = larr(l,j) + parr(p,j) * scale_p2c(p) * scale_c2l(c) * wtlunit(p) - sumwt(l) = sumwt(l) + wtlunit(p) - end if - end if - end do - found = .false. - do l = lbl,ubl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l,j) = larr(l,j)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'p2l_2d error: sumwt is greater than 1.0 at l= ',index,' j= ',j - call endrun() - end if - end do - - end subroutine p2l_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2g_1d -! -! !INTERFACE: - subroutine p2g_1d(lbp, ubp, lbc, ubc, lbl, ubl, lbg, ubg, parr, garr, & - p2c_scale_type, c2l_scale_type, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from pfts to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_gcell -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft indices - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: lbg, ubg ! beginning and ending gridcell indices - real(r8), intent(in) :: parr(lbp:ubp) ! input pft array - real(r8), intent(out) :: garr(lbg:ubg) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! !LOCAL VARIABLES: -!EOP - integer :: pi,p,c,l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_p2c(lbp:ubp) ! scale factor - real(r8) :: scale_c2l(lbc:ubc) ! scale factor - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of pfts relative to gridcells - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: plandunit(:) ! landunit of corresponding pft - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in gridcell - integer , pointer :: pfti(:) ! initial pft index in gridcell - integer , pointer :: ctype(:) ! column type - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - canyon_hwr => lun%canyon_hwr - ltype => lun%itype - clandunit => col%landunit - ctype => col%itype - wtgcell => pft%wtgcell - pcolumn => pft%column - pgridcell => pft%gridcell - plandunit => pft%landunit - npfts => grc%npfts - pfti => grc%pfti - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2g_1d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2g_1d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - garr(:) = spval - sumwt(:) = 0._r8 - do p = lbp,ubp - if (wtgcell(p) /= 0._r8) then - c = pcolumn(p) - l = plandunit(p) - if (parr(p) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = pgridcell(p) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + parr(p) * scale_p2c(p) * scale_c2l(c) * scale_l2g(l) * wtgcell(p) - sumwt(g) = sumwt(g) + wtgcell(p) - end if - end if - end do - found = .false. - do g = lbg, ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'p2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun() - end if - - end subroutine p2g_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: p2g_2d -! -! !INTERFACE: - subroutine p2g_2d(lbp, ubp, lbc, ubc, lbl, ubl, lbg, ubg, num2d, & - parr, garr, p2c_scale_type, c2l_scale_type, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from pfts to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !USES: - use clm_varpar, only : max_pft_per_gcell -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbp, ubp ! beginning and ending pft indices - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: lbg, ubg ! beginning and ending gridcell indices - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: parr(lbp:ubp,num2d) ! input pft array - real(r8), intent(out) :: garr(lbg:ubg,num2d) ! output gridcell array - character(len=*), intent(in) :: p2c_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,pi,p,c,l,g,index ! indices - logical :: found ! temporary for error check - real(r8) :: scale_p2c(lbp:ubp) ! scale factor - real(r8) :: scale_c2l(lbc:ubc) ! scale factor - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of pfts relative to gridcells - integer , pointer :: pcolumn(:) ! column of corresponding pft - integer , pointer :: plandunit(:) ! landunit of corresponding pft - integer , pointer :: pgridcell(:) ! gridcell of corresponding pft - integer , pointer :: npfts(:) ! number of pfts in gridcell - integer , pointer :: pfti(:) ! initial pft index in gridcell - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - canyon_hwr => lun%canyon_hwr - ltype => lun%itype - clandunit => col%landunit - ctype => col%itype - wtgcell => pft%wtgcell - pcolumn => pft%column - pgridcell => pft%gridcell - plandunit => pft%landunit - npfts => grc%npfts - pfti => grc%pfti - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'p2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - if (p2c_scale_type == 'unity') then - do p = lbp,ubp - scale_p2c(p) = 1.0_r8 - end do - else - write(iulog,*)'p2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - garr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do p = lbp,ubp - if (wtgcell(p) /= 0._r8) then - c = pcolumn(p) - l = plandunit(p) - if (parr(p,j) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = pgridcell(p) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + parr(p,j) * scale_p2c(p) * scale_c2l(c) * scale_l2g(l) * wtgcell(p) - sumwt(g) = sumwt(g) + wtgcell(p) - end if - end if - end do - found = .false. - do g = lbg, ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'p2g_2d error: sumwt gt 1.0 at g/sumwt = ',index,sumwt(index) - call endrun() - end if - end do - - end subroutine p2g_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: c2l_1d -! -! !INTERFACE: - subroutine c2l_1d (lbc, ubc, lbl, ubl, carr, larr, c2l_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from columns to landunits -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - real(r8), intent(in) :: carr(lbc:ubc) ! input column array - real(r8), intent(out) :: larr(lbl:ubl) ! output landunit array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: ci,c,l,index ! indices - integer :: max_col_per_lu ! max columns per landunit; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_c2l(lbc:ubc) ! scale factor for column->landunit mapping - real(r8) :: sumwt(lbl:ubl) ! sum of weights - real(r8), pointer :: wtlunit(:) ! weight of landunits relative to gridcells - integer , pointer :: clandunit(:) ! gridcell of corresponding column - integer , pointer :: ncolumns(:) ! number of columns in landunit - integer , pointer :: coli(:) ! initial column index in landunit - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - ctype => col%itype - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - wtlunit => col%wtlunit - clandunit => col%landunit - ncolumns => lun%ncolumns - coli => lun%coli - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - larr(:) = spval - sumwt(:) = 0._r8 - do c = lbc,ubc - if (wtlunit(c) /= 0._r8) then - if (carr(c) /= spval .and. scale_c2l(c) /= spval) then - l = clandunit(c) - if (sumwt(l) == 0._r8) larr(l) = 0._r8 - larr(l) = larr(l) + carr(c) * scale_c2l(c) * wtlunit(c) - sumwt(l) = sumwt(l) + wtlunit(c) - end if - end if - end do - found = .false. - do l = lbl,ubl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l) = larr(l)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'c2l_1d error: sumwt is greater than 1.0 at l= ',index - call endrun() - end if - - end subroutine c2l_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: c2l_2d -! -! !INTERFACE: - subroutine c2l_2d (lbc, ubc, lbl, ubl, num2d, carr, larr, c2l_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from columns to landunits -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: carr(lbc:ubc,num2d) ! input column array - real(r8), intent(out) :: larr(lbl:ubl,num2d) ! output landunit array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,l,ci,c,index ! indices - integer :: max_col_per_lu ! max columns per landunit; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_c2l(lbc:ubc) ! scale factor for column->landunit mapping - real(r8) :: sumwt(lbl:ubl) ! sum of weights - real(r8), pointer :: wtlunit(:) ! weight of column relative to landunit - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: ncolumns(:) ! number of columns in landunit - integer , pointer :: coli(:) ! initial column index in landunit - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - ctype => col%itype - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - wtlunit => col%wtlunit - clandunit => col%landunit - ncolumns => lun%ncolumns - coli => lun%coli - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_2d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - larr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do c = lbc,ubc - if (wtlunit(c) /= 0._r8) then - if (carr(c,j) /= spval .and. scale_c2l(c) /= spval) then - l = clandunit(c) - if (sumwt(l) == 0._r8) larr(l,j) = 0._r8 - larr(l,j) = larr(l,j) + carr(c,j) * scale_c2l(c) * wtlunit(c) - sumwt(l) = sumwt(l) + wtlunit(c) - end if - end if - end do - found = .false. - do l = lbl,ubl - if (sumwt(l) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = l - else if (sumwt(l) /= 0._r8) then - larr(l,j) = larr(l,j)/sumwt(l) - end if - end do - if (found) then - write(iulog,*)'c2l_2d error: sumwt is greater than 1.0 at l= ',index,' lev= ',j - call endrun() - end if - end do - - end subroutine c2l_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: c2g_1d -! -! !INTERFACE: - subroutine c2g_1d(lbc, ubc, lbl, ubl, lbg, ubg, carr, garr, & - c2l_scale_type, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from columns to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: lbg, ubg ! beginning and ending landunit indices - real(r8), intent(in) :: carr(lbc:ubc) ! input column array - real(r8), intent(out) :: garr(lbg:ubg) ! output gridcell array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: ci,c,l,g,index ! indices - integer :: max_col_per_gcell ! max columns per gridcell; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_c2l(lbc:ubc) ! scale factor - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of columns relative to gridcells - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: cgridcell(:) ! gridcell of corresponding column - integer , pointer :: ncolumns(:) ! number of columns in gridcell - integer , pointer :: coli(:) ! initial column index in gridcell - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - ctype => col%itype - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - wtgcell => col%wtgcell - clandunit => col%landunit - cgridcell => col%gridcell - ncolumns => grc%ncolumns - coli => grc%coli - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2l_1d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - garr(:) = spval - sumwt(:) = 0._r8 - do c = lbc,ubc - if ( wtgcell(c) /= 0._r8) then - l = clandunit(c) - if (carr(c) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = cgridcell(c) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + carr(c) * scale_c2l(c) * scale_l2g(l) * wtgcell(c) - sumwt(g) = sumwt(g) + wtgcell(c) - end if - end if - end do - found = .false. - do g = lbg, ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'c2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun() - end if - - end subroutine c2g_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: c2g_2d -! -! !INTERFACE: - subroutine c2g_2d(lbc, ubc, lbl, ubl, lbg, ubg, num2d, carr, garr, & - c2l_scale_type, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from columns to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbc, ubc ! beginning and ending column indices - integer , intent(in) :: lbl, ubl ! beginning and ending landunit indices - integer , intent(in) :: lbg, ubg ! beginning and ending gridcell indices - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: carr(lbc:ubc,num2d) ! input column array - real(r8), intent(out) :: garr(lbg:ubg,num2d) ! output gridcell array - character(len=*), intent(in) :: c2l_scale_type ! scale factor type for averaging - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,ci,c,g,l,index ! indices - integer :: max_col_per_gcell ! max columns per gridcell; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_c2l(lbc:ubc) ! scale factor - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of columns relative to gridcells - integer , pointer :: clandunit(:) ! landunit of corresponding column - integer , pointer :: cgridcell(:) ! gridcell of corresponding column - integer , pointer :: ncolumns(:) ! number of columns in gridcell - integer , pointer :: coli(:) ! initial column index in gridcell - integer , pointer :: ctype(:) ! column type - integer , pointer :: ltype(:) ! landunit type - real(r8), pointer :: canyon_hwr(:) ! urban canyon height to width ratio -!------------------------------------------------------------------------ - - ctype => col%itype - ltype => lun%itype - canyon_hwr => lun%canyon_hwr - wtgcell => col%wtgcell - clandunit => col%landunit - cgridcell => col%gridcell - ncolumns => grc%ncolumns - coli => grc%coli - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - if (c2l_scale_type == 'unity') then - do c = lbc,ubc - scale_c2l(c) = 1.0_r8 - end do - else if (c2l_scale_type == 'urbanf') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = 3.0 * canyon_hwr(l) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0_r8 - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else if (c2l_scale_type == 'urbans') then - do c = lbc,ubc - l = clandunit(c) - if (ltype(l) == isturb) then - if (ctype(c) == icol_sunwall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_shadewall) then - scale_c2l(c) = (3.0 * canyon_hwr(l)) / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_road_perv .or. ctype(c) == icol_road_imperv) then - scale_c2l(c) = 3.0 / (2.*canyon_hwr(l) + 1.) - else if (ctype(c) == icol_roof) then - scale_c2l(c) = 1.0_r8 - end if - else - scale_c2l(c) = 1.0_r8 - end if - end do - else - write(iulog,*)'c2g_2d error: scale type ',c2l_scale_type,' not supported' - call endrun() - end if - - garr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do c = lbc,ubc - if (wtgcell(c) /= 0._r8) then - l = clandunit(c) - if (carr(c,j) /= spval .and. scale_c2l(c) /= spval .and. scale_l2g(l) /= spval) then - g = cgridcell(c) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + carr(c,j) * scale_c2l(c) * scale_l2g(l) * wtgcell(c) - sumwt(g) = sumwt(g) + wtgcell(c) - end if - end if - end do - found = .false. - do g = lbg, ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'c2g_2d error: sumwt is greater than 1.0 at g= ',index - call endrun() - end if - end do - - end subroutine c2g_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: l2g_1d -! -! !INTERFACE: - subroutine l2g_1d(lbl, ubl, lbg, ubg, larr, garr, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from landunits to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbl, ubl ! beginning and ending sub landunit indices - integer , intent(in) :: lbg, ubg ! beginning and ending gridcell indices - real(r8), intent(in) :: larr(lbl:ubl) ! input landunit array - real(r8), intent(out) :: garr(lbg:ubg) ! output gridcell array - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: li,l,g,index ! indices - integer :: max_lu_per_gcell ! max landunits per gridcell; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of landunits relative to gridcells - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: nlandunits(:) ! number of landunits in gridcell - integer , pointer :: luni(:) ! initial landunit index in gridcell -!------------------------------------------------------------------------ - - wtgcell => lun%wtgcell - lgridcell => lun%gridcell - nlandunits => grc%nlandunits - luni => grc%luni - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - garr(:) = spval - sumwt(:) = 0._r8 - do l = lbl,ubl - if (wtgcell(l) /= 0._r8) then - if (larr(l) /= spval .and. scale_l2g(l) /= spval) then - g = lgridcell(l) - if (sumwt(g) == 0._r8) garr(g) = 0._r8 - garr(g) = garr(g) + larr(l) * scale_l2g(l) * wtgcell(l) - sumwt(g) = sumwt(g) + wtgcell(l) - end if - end if - end do - found = .false. - do g = lbg, ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index = g - else if (sumwt(g) /= 0._r8) then - garr(g) = garr(g)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'l2g_1d error: sumwt is greater than 1.0 at g= ',index - call endrun() - end if - - end subroutine l2g_1d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: l2g_2d -! -! !INTERFACE: - subroutine l2g_2d(lbl, ubl, lbg, ubg, num2d, larr, garr, l2g_scale_type) -! -! !DESCRIPTION: -! Perfrom subgrid-average from landunits to gridcells. -! Averaging is only done for points that are not equal to "spval". -! -! !ARGUMENTS: - implicit none - integer , intent(in) :: lbl, ubl ! beginning and ending column indices - integer , intent(in) :: lbg, ubg ! beginning and ending gridcell indices - integer , intent(in) :: num2d ! size of second dimension - real(r8), intent(in) :: larr(lbl:ubl,num2d) ! input landunit array - real(r8), intent(out) :: garr(lbg:ubg,num2d) ! output gridcell array - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/03 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: j,g,li,l,index ! indices - integer :: max_lu_per_gcell ! max landunits per gridcell; on the fly - logical :: found ! temporary for error check - real(r8) :: scale_l2g(lbl:ubl) ! scale factor - real(r8) :: sumwt(lbg:ubg) ! sum of weights - real(r8), pointer :: wtgcell(:) ! weight of landunits relative to gridcells - integer , pointer :: lgridcell(:) ! gridcell of corresponding landunit - integer , pointer :: nlandunits(:) ! number of landunits in gridcell - integer , pointer :: luni(:) ! initial landunit index in gridcell -!------------------------------------------------------------------------ - - wtgcell => lun%wtgcell - lgridcell => lun%gridcell - nlandunits => grc%nlandunits - luni => grc%luni - - call build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) - - garr(:,:) = spval - do j = 1,num2d - sumwt(:) = 0._r8 - do l = lbl,ubl - if (wtgcell(l) /= 0._r8) then - if (larr(l,j) /= spval .and. scale_l2g(l) /= spval) then - g = lgridcell(l) - if (sumwt(g) == 0._r8) garr(g,j) = 0._r8 - garr(g,j) = garr(g,j) + larr(l,j) * scale_l2g(l) * wtgcell(l) - sumwt(g) = sumwt(g) + wtgcell(l) - end if - end if - end do - found = .false. - do g = lbg,ubg - if (sumwt(g) > 1.0_r8 + 1.e-6_r8) then - found = .true. - index= g - else if (sumwt(g) /= 0._r8) then - garr(g,j) = garr(g,j)/sumwt(g) - end if - end do - if (found) then - write(iulog,*)'l2g_2d error: sumwt is greater than 1.0 at g= ',index,' lev= ',j - call endrun() - end if - end do - - end subroutine l2g_2d - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: build_scale_l2g -! -! !INTERFACE: - subroutine build_scale_l2g(l2g_scale_type, lbl, ubl, scale_l2g) -! -! !DESCRIPTION: -! Fill the scale_l2g(lbl:ubl) array with appropriate values for the given l2g_scale_type. -! This array can later be used to scale each landunit in forming grid cell averages. -! -! !USES: - use clm_varcon, only : max_lunit -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - integer , intent(in) :: lbl, ubl ! beginning and ending column indices - real(r8) , intent(out) :: scale_l2g(lbl:ubl) ! scale factor -! -! !REVISION HISTORY: -! Created by Bill Sacks 10/11 -! -! -! !LOCAL VARIABLES: -!EOP - real(r8) :: scale_lookup(max_lunit) ! scale factor for each landunit type - integer :: l ! index - integer , pointer :: ltype(:) ! landunit type -!----------------------------------------------------------------------- - - ltype => lun%itype - - call create_scale_l2g_lookup(l2g_scale_type, scale_lookup) - - do l = lbl,ubl - scale_l2g(l) = scale_lookup(ltype(l)) - end do - - end subroutine build_scale_l2g - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: create_scale_l2g_lookup -! -! !INTERFACE: - subroutine create_scale_l2g_lookup(l2g_scale_type, scale_lookup) -! -! DESCRIPTION: -! Create a lookup array, scale_lookup(1..max_lunit), which gives the scale factor for -! each landunit type depending on l2g_scale_type -! -! !USES: - use clm_varcon, only : istsoil, istice, istdlak, istslak, istwet, isturb, istice_mec,& - istcrop, max_lunit, spval -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: l2g_scale_type ! scale factor type for averaging - real(r8) , intent(out) :: scale_lookup(max_lunit) ! scale factor for each landunit type -! -! !REVISION HISTORY: -! Created by Bill Sacks 10/11 -! -!EOP -!----------------------------------------------------------------------- - - ! ------------ WJS (10-14-11): IMPORTANT GENERAL NOTES ------------ - ! - ! Since scale_l2g is not currently included in the sumwt accumulations, you need to - ! be careful about the scale values you use. Values of 1 and spval are safe - ! (including having multiple landunits with value 1), but only use other values if - ! you know what you are doing! For example, using a value of 0 is NOT the correct way - ! to exclude a landunit from the average, because the normalization will be done - ! incorrectly in this case: instead, use spval to exclude a landunit from the - ! average. Similarly, using a value of 2 is NOT the correct way to give a landunit - ! double relative weight in general, because the normalization won't be done - ! correctly in this case, either. - ! - ! In the longer-term, I believe that the correct solution to this problem is to - ! include scale_l2g (and the other scale factors) in the sumwt accumulations - ! (e.g., sumwt = sumwt + wtgcell * scale_p2c * scale_c2l * scale_l2g), but that - ! requires some more thought to (1) make sure that is correct, and (2) make sure it - ! doesn't break the urban scaling. - ! - ! ----------------------------------------------------------------- - - - ! Initialize scale_lookup to spval for all landunits. Thus, any landunit that keeps - ! the default value will be excluded from grid cell averages. - scale_lookup(:) = spval - - if (l2g_scale_type == 'unity') then - scale_lookup(:) = 1.0_r8 - else if (l2g_scale_type == 'veg') then - scale_lookup(istsoil) = 1.0_r8 - scale_lookup(istcrop) = 1.0_r8 - else if (l2g_scale_type == 'ice') then - scale_lookup(istice) = 1.0_r8 - scale_lookup(istice_mec) = 1.0_r8 - else if (l2g_scale_type == 'nonurb') then - scale_lookup(:) = 1.0_r8 - scale_lookup(isturb) = spval - else - write(iulog,*)'scale_l2g_lookup_array error: scale type ',l2g_scale_type,' not supported' - call endrun() - end if - - end subroutine create_scale_l2g_lookup - -end module subgridAveMod diff --git a/src_clm40/main/subgridMod.F90 b/src_clm40/main/subgridMod.F90 deleted file mode 100644 index 8fdb19a1ea..0000000000 --- a/src_clm40/main/subgridMod.F90 +++ /dev/null @@ -1,282 +0,0 @@ -module subgridMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: subgridMod -! -! !DESCRIPTION: -! sub-grid data and mapping types and modules -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use abortutils , only : endrun - - implicit none - private - save - -! !PUBLIC MEMBER FUNCTIONS: - public subgrid_get_gcellinfo ! Returns g,l,c,p properties from wtxy - - -! !REVISION HISTORY: -! 2006.07.04 T Craig, rename initSubgridMod -! -! -! !PRIVATE MEMBER FUNCTIONS: None -! -! !PRIVATE DATA MEMBERS: None -!EOP -!----------------------------------------------------------------------- - -contains - -!------------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: subgrid_get_gcellinfo -! -! !INTERFACE: - subroutine subgrid_get_gcellinfo (nw, & - nlunits, ncols, npfts, & - nveg, wtveg, & - ncrop, wtcrop, & - nurban, wturban, & - nlake, wtlake, & - nwetland, wtwetland, & - nglacier, wtglacier, & - nglacier_mec, wtglacier_mec, & - glcmask) -! -! !DESCRIPTION: -! Obtain gridcell properties -! -! !USES - use clm_varpar , only : numpft, maxpatch_pft, numcft, & - npatch_lake, npatch_glacier, npatch_wet, npatch_urban - use clm_varpar , only : npatch_glacier_mec - use clm_varctl , only : allocate_all_vegpfts, create_crop_landunit - use clm_varctl , only : create_glacier_mec_landunit, glc_topomax - use clm_varsur , only : wtxy - use clm_varsur , only : topoxy - -! !ARGUMENTS - implicit none - integer , intent(in) :: nw ! wtxy cell index - integer , optional, intent(out) :: nlunits ! number of landunits - integer , optional, intent(out) :: ncols ! number of columns - integer , optional, intent(out) :: npfts ! number of pfts - integer , optional, intent(out) :: nveg ! number of vegetated pfts in naturally vegetated landunit - real(r8), optional, intent(out) :: wtveg ! weight (relative to gridcell) of naturally vegetated landunit - integer , optional, intent(out) :: ncrop ! number of crop pfts in crop landunit - real(r8), optional, intent(out) :: wtcrop ! weight (relative to gridcell) of crop landunit - integer , optional, intent(out) :: nurban ! number of urban pfts (columns) in urban landunit - real(r8), optional, intent(out) :: wturban ! weight (relative to gridcell) of urban pfts (columns) in urban la - integer , optional, intent(out) :: nlake ! number of lake pfts (columns) in lake landunit - real(r8), optional, intent(out) :: wtlake ! weight (relative to gridcell) of lake landunitof lake pfts (columns) in lake landunit - integer , optional, intent(out) :: nwetland ! number of wetland pfts (columns) in wetland landunit - real(r8), optional, intent(out) :: wtwetland ! weight (relative to gridcell) of wetland landunitof wetland pfts (columns) in wetland landunit - integer , optional, intent(out) :: nglacier ! number of glacier pfts (columns) in glacier landunit - real(r8), optional, intent(out) :: wtglacier ! weight (relative to gridcell) of glacier landunitof glacier pfts (columns) in glacier landunit - integer , optional, intent(out) :: nglacier_mec ! number of glacier_mec pfts (columns) in glacier_mec landunit - real(r8), optional, intent(out) :: wtglacier_mec ! weight (relative to gridcell) of glacier_mec landunitof glacier pfts (columns) in glacier_mec landunit - integer , optional, intent(in) :: glcmask ! = 1 if glc requires surface mass balance in this gridcell -! -! !CALLED FROM: -! subroutines decomp_init, initGridCells -! -! !REVISION HISTORY: -! 2002.09.11 Mariana Vertenstein Creation. -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m ! loop index - integer :: n ! elevation class index - integer :: ipfts ! number of pfts in gridcell - integer :: icols ! number of columns in gridcell - integer :: ilunits ! number of landunits in gridcell - integer :: npfts_per_lunit ! number of pfts in landunit - real(r8) :: wtlunit ! weight (relative to gridcell) of landunit -!------------------------------------------------------------------------------ - - ! Initialize pfts, columns and landunits counters for gridcell - - ipfts = 0 - icols = 0 - ilunits = 0 - - ! Set naturally vegetated landunit - - npfts_per_lunit = 0 - wtlunit = 0._r8 - ! If crop should be on separate land units - if (allocate_all_vegpfts .and. create_crop_landunit) then - do m = 1, maxpatch_pft-numcft - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 ! sum natural pfts - wtlunit = wtlunit + wtxy(nw,m) ! and their wts - end if - end do - do m = maxpatch_pft-numcft+1, maxpatch_pft - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 ! sum crops, too, but not - end if ! their wts for now - end do - ! Assume that the vegetated landunit has one column - else - do m = 1, maxpatch_pft - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,m) - end if - end do - end if - if (npfts_per_lunit > 0) then ! true even when only crops are present - if (allocate_all_vegpfts) npfts_per_lunit = numpft+1 - if (allocate_all_vegpfts .and. create_crop_landunit) npfts_per_lunit = numpft+1-numcft - ilunits = ilunits + 1 - icols = icols + 1 - end if - ipfts = ipfts + npfts_per_lunit - if (present(nveg )) nveg = npfts_per_lunit - if (present(wtveg)) wtveg = wtlunit - - ! Set urban landunit - - npfts_per_lunit = 0 - wtlunit = 0._r8 - do m = npatch_urban, npatch_lake-1 - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,m) - end if - end do - if (npfts_per_lunit > 0) then - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(nurban )) nurban = npfts_per_lunit - if (present(wturban)) wturban = wtlunit - - ! Set lake landunit - - npfts_per_lunit = 0 - wtlunit = 0._r8 - if (wtxy(nw,npatch_lake) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,npatch_lake) - end if - if (npfts_per_lunit > 0) then - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(nlake )) nlake = npfts_per_lunit - if (present(wtlake)) wtlake = wtlunit - - ! Set wetland landunit - - npfts_per_lunit = 0 - wtlunit = 0._r8 - if (wtxy(nw,npatch_wet) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,npatch_wet) - end if - if (npfts_per_lunit > 0) then - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(nwetland )) nwetland = npfts_per_lunit - if (present(wtwetland)) wtwetland = wtlunit - - ! Set glacier landunit - - npfts_per_lunit = 0 - wtlunit = 0._r8 - if (wtxy(nw,npatch_glacier) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,npatch_glacier) - end if - if (npfts_per_lunit > 0) then - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(nglacier )) nglacier = npfts_per_lunit - if (present(wtglacier)) wtglacier = wtlunit - - ! Set glacier_mec landunit - ! If glcmask = 1, we create a column for each elevation class even if wtxy = 0. - - if (create_glacier_mec_landunit) then - npfts_per_lunit = 0 - wtlunit = 0._r8 - do m = npatch_glacier+1, npatch_glacier_mec - if (wtxy(nw,m) > 0._r8) then - npfts_per_lunit = npfts_per_lunit + 1 - wtlunit = wtlunit + wtxy(nw,m) - topoxy(nw,m) = max (topoxy(nw,m), 0._r8) - elseif (present(glcmask)) then - if (glcmask == 1) then ! create a virtual column - npfts_per_lunit = npfts_per_lunit + 1 - n = m - npatch_glacier ! elevation class index - if (m < npatch_glacier_mec) then ! classes 1 to maxpatch_glcmec-1 - topoxy(nw,m) = 0.5_r8 * (glc_topomax(n-1) + glc_topomax(n)) - else ! class maxpatch_glcmec - topoxy(nw,m) = 2.0_r8*glc_topomax(n-1) - glc_topomax(n-2) ! somewhat arbitrary - endif - endif ! glcmask = 1 - endif ! wtxy > 0 - enddo ! npatch_glacier_mec - if (npfts_per_lunit > 0) then - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(nglacier_mec )) nglacier_mec = npfts_per_lunit - if (present(wtglacier_mec)) wtglacier_mec = wtlunit - - endif ! create_glacier_mec_landunit - - ! Set crop landunit if appropriate - - npfts_per_lunit = 0 - wtlunit = 0._r8 - if (allocate_all_vegpfts .and. create_crop_landunit) then - do m = 1, maxpatch_pft-numcft - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 ! sum natural pfts again - end if ! not their wts this time - end do - do m = maxpatch_pft-numcft+1, maxpatch_pft - if (wtxy(nw,m) > 0.0_r8) then - npfts_per_lunit = npfts_per_lunit + 1 ! sum crops - wtlunit = wtlunit + wtxy(nw,m) ! and their wts - end if - end do - end if - if (npfts_per_lunit > 0) then ! true even if only natural veg is present - if (allocate_all_vegpfts .and. create_crop_landunit) npfts_per_lunit = numcft - ilunits = ilunits + 1 - icols = icols + npfts_per_lunit - end if - ipfts = ipfts + npfts_per_lunit - if (present(ncrop )) ncrop = npfts_per_lunit - if (present(wtcrop)) wtcrop = wtlunit - - ! Determine return arguments - - if (present(nlunits)) nlunits = ilunits - if (present(ncols)) ncols = icols - if (present(npfts)) npfts = ipfts - - end subroutine subgrid_get_gcellinfo - -!----------------------------------------------------------------------- - -end module subgridMod diff --git a/src_clm40/main/subgridRestMod.F90 b/src_clm40/main/subgridRestMod.F90 deleted file mode 100644 index e2072e886d..0000000000 --- a/src_clm40/main/subgridRestMod.F90 +++ /dev/null @@ -1,286 +0,0 @@ -module subgridRestMod - -contains - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: subgridRest -! -! !INTERFACE: - subroutine subgridRest( ncid, flag ) - - use shr_kind_mod , only : r8 => shr_kind_r8 - use clmtype - use ncdio_pio , only : file_desc_t, ncd_io, ncd_defvar, ncd_int, ncd_double - use decompMod , only : get_proc_bounds, ldecomp - use domainMod , only : ldomain - use clm_time_manager , only : get_curr_date - use abortutils , only : endrun -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netCDF dataset id - character(len=*) , intent(in) :: flag ! flag to determine if define, write or read data -! -! !REVISION HISTORY: -! -! -! !LOCAL VARIABLES: -!EOP - integer :: g,l,c,p,j,i ! indices - integer :: yr ! current year (0 -> ...) - integer :: mon ! current month (1 -> 12) - integer :: day ! current day (1 -> 31) - integer :: mcsec ! seconds of current date - integer :: mcdate ! current date - integer :: begp, endp ! per-proc beg/end pft indices - integer :: begc, endc ! per-proc beg/end column indices - integer :: begl, endl ! per-proc beg/end landunit indices - integer :: begg, endg ! per-proc beg/end gridcell indices - integer :: ier ! error status - real(r8),pointer :: rgarr(:) ! temporary - real(r8),pointer :: rlarr(:) ! temporary - real(r8),pointer :: rcarr(:) ! temporary - real(r8),pointer :: rparr(:) ! temporary - integer ,pointer :: igarr(:) ! temporary - integer ,pointer :: ilarr(:) ! temporary - integer ,pointer :: icarr(:) ! temporary - integer ,pointer :: iparr(:) ! temporary - type(gridcell_type), pointer :: gptr ! pointer to gridcell derived subtype - type(landunit_type), pointer :: lptr ! pointer to landunit derived subtype - type(column_type) , pointer :: cptr ! pointer to column derived subtype - type(pft_type) , pointer :: pptr ! pointer to pft derived subtype - character(len=32) :: subname='SubgridRest' ! subroutine name -!------------------------------------------------------------------------ - - ! Set pointers into derived type - - gptr => grc - lptr => lun - cptr => col - pptr => pft - - ! Get relevant sizes - - call get_proc_bounds(begg, endg, begl, endl, begc, endc, begp, endp) - - ! Allocate dynamic memory - - if (flag == 'write') then - allocate(rgarr(begg:endg),rlarr(begl:endl),rcarr(begc:endc),rparr(begp:endp),stat=ier) - if (ier /= 0) call endrun('allocation error from inicfile_fields rarrs') - allocate(igarr(begg:endg),ilarr(begl:endl),icarr(begc:endc),iparr(begp:endp),stat=ier) - if (ier /= 0) call endrun('allocation error from inicfile_fields iarrs') - end if - - ! Write output data (first write current date and seconds of current date) - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='mcdate', xtype=ncd_int, & - long_name='current date as 8 digit integer (YYYYMMDD)') - call ncd_defvar(ncid=ncid, varname='mcsec', xtype=ncd_int, & - long_name='current seconds of current date', units='s') - else if (flag == 'write') then - call get_curr_date (yr, mon, day, mcsec) - mcdate = yr*10000 + mon*100 + day - !TODO - add this to the file - get this to work -!DEBUG call ncd_io(varname='mcdate', data=mcdate, ncid=ncid, flag=flag) -!DEBUG call ncd_io(varname='mcsec' , data=mcsec , ncid=ncid, flag=flag) - end if - - ! Write gridcell info - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='grid1d_lon', xtype=ncd_double, & - dim1name='gridcell', long_name='gridcell longitude', units='degrees_east') - call ncd_defvar(ncid=ncid, varname='grid1d_lat', xtype=ncd_double, & - dim1name='gridcell', long_name='gridcell latitude', units='degrees_north') - call ncd_defvar(ncid=ncid, varname='grid1d_ixy', xtype=ncd_int, & - dim1name='gridcell', long_name='2d longitude index of corresponding gridcell') - call ncd_defvar(ncid=ncid, varname='grid1d_jxy', xtype=ncd_int, & - dim1name='gridcell', long_name='2d latitude index of corresponding gridcell') - else if (flag == 'write') then - do g=begg,endg - igarr(g)= mod(ldecomp%gdc2glo(g)-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='grid1d_ixy', data=igarr , dim1name=nameg, ncid=ncid, flag=flag) - do g=begg,endg - igarr(g)= (ldecomp%gdc2glo(g) - 1)/ldomain%ni + 1 - enddo - call ncd_io(varname='grid1d_jxy', data=igarr , dim1name=nameg, ncid=ncid, flag=flag) - call ncd_io(varname='grid1d_lon', data=gptr%londeg, dim1name=nameg, ncid=ncid, flag=flag) - call ncd_io(varname='grid1d_lat', data=gptr%latdeg, dim1name=nameg, ncid=ncid, flag=flag) - end if - - ! Write landunit info - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='land1d_lon', xtype=ncd_double, & - dim1name='landunit', long_name='landunit longitude', units='degrees_east') - call ncd_defvar(ncid=ncid, varname='land1d_lat', xtype=ncd_double, & - dim1name='landunit', long_name='landunit latitude', units='degrees_north') - call ncd_defvar(ncid=ncid, varname='land1d_ixy', xtype=ncd_int, & - dim1name='landunit', long_name='2d longitude index of corresponding landunit') - call ncd_defvar(ncid=ncid, varname='land1d_jxy', xtype=ncd_int, & - dim1name='landunit', long_name='2d latitude index of corresponding landunit') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(ncid=ncid, varname='land1d_gi', xtype=ncd_int, & - ! dim1name='landunit', long_name='1d grid index of corresponding landunit') - ! ---------------------------------------------------------------- - call ncd_defvar(ncid=ncid, varname='land1d_wtxy', xtype=ncd_double, & - dim1name='landunit', long_name='landunit weight relative to corresponding gridcell') - call ncd_defvar(ncid=ncid, varname='land1d_ityplun', xtype=ncd_int, & - dim1name='landunit', long_name='landunit type (vegetated,urban,lake,wetland or glacier)') - else if (flag == 'write') then - do l=begl,endl - rlarr(l) = gptr%londeg(lptr%gridcell(l)) - enddo - call ncd_io(varname='land1d_lon' , data=rlarr , dim1name=namel, ncid=ncid, flag=flag) - do l=begl,endl - rlarr(l) = gptr%latdeg(lptr%gridcell(l)) - enddo - call ncd_io(varname='land1d_lat' , data=rlarr , dim1name=namel, ncid=ncid, flag=flag) - do l=begl,endl - ilarr(l) = mod(ldecomp%gdc2glo(lptr%gridcell(l))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='land1d_ixy' , data=ilarr , dim1name=namel, ncid=ncid, flag=flag) - do l=begl,endl - ilarr(l) = (ldecomp%gdc2glo(lptr%gridcell(l))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='land1d_jxy' , data=ilarr , dim1name=namel, ncid=ncid, flag=flag) - call ncd_io(varname='land1d_wtxy' , data=lptr%wtgcell , dim1name=namel, ncid=ncid, flag=flag) - call ncd_io(varname='land1d_ityplun', data=lptr%itype , dim1name=namel, ncid=ncid, flag=flag) - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_io(varname='land1d_gi' , data=lptr%gridcell, dim1name=namel, ncid=ncid, flag=flag) - ! ---------------------------------------------------------------- - end if - - ! Write column info - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='cols1d_lon', xtype=ncd_double, & - dim1name='column', long_name='column longitude', units='degrees_east') - call ncd_defvar(ncid=ncid, varname='cols1d_lat', xtype=ncd_double, & - dim1name='column', long_name='column latitude', units='degrees_north') - call ncd_defvar(ncid=ncid, varname='cols1d_ixy', xtype=ncd_int, & - dim1name='column', long_name='2d longitude index of corresponding column') - call ncd_defvar(ncid=ncid, varname='cols1d_jxy', xtype=ncd_int, & - dim1name='column', long_name='2d latitude index of corresponding column') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(ncid=ncid, varname='cols1d_gi', xtype=ncd_int, & - ! dim1name='column', long_name='1d grid index of corresponding column') - !call ncd_defvar(ncid=ncid, varname='cols1d_li', xtype=ncd_int, & - ! dim1name='column', long_name='1d landunit index of corresponding column') - ! ---------------------------------------------------------------- - call ncd_defvar(ncid=ncid, varname='cols1d_wtxy', xtype=ncd_double, & - dim1name='column', long_name='column weight relative to corresponding gridcell') - call ncd_defvar(ncid=ncid, varname='cols1d_wtlnd', xtype=ncd_double, & - dim1name='column', long_name='column weight relative to corresponding landunit') - call ncd_defvar(ncid=ncid, varname='cols1d_ityplun', xtype=ncd_int, & - dim1name='column', long_name='column landunit type (vegetated,urban,lake,wetland or glacier)') - call ncd_defvar(ncid=ncid, varname='cols1d_ityp', xtype=ncd_int, & - dim1name='column', long_name=& - 'column type (61-roof,62-sunwall,63-shadewall,64-impervious road,65-pervious road,1-all other columns)') - else if (flag == 'write') then - do c=begc,endc - rcarr(c) = gptr%londeg(cptr%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lon' , data=rcarr , dim1name=namec, ncid=ncid, flag=flag) - do c=begc,endc - rcarr(c) = gptr%latdeg(cptr%gridcell(c)) - enddo - call ncd_io(varname='cols1d_lat' , data=rcarr , dim1name=namec, ncid=ncid, flag=flag) - do c=begc,endc - icarr(c) = mod(ldecomp%gdc2glo(cptr%gridcell(c))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='cols1d_ixy' , data=icarr , dim1name=namec, ncid=ncid, flag=flag) - do c=begc,endc - icarr(c) = (ldecomp%gdc2glo(cptr%gridcell(c))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='cols1d_jxy' , data=icarr , dim1name=namec, ncid=ncid, flag=flag) - call ncd_io(varname='cols1d_wtxy' , data=cptr%wtgcell , dim1name=namec, ncid=ncid, flag=flag) - call ncd_io(varname='cols1d_wtlnd', data=cptr%wtlunit , dim1name=namec, ncid=ncid, flag=flag) - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_io(varname='cols1d_gi' , data=cptr%gridcell, dim1name=namec, ncid=ncid, flag=flag) - !call ncd_io(varname='cols1d_li' , data=cptr%landunit, dim1name=namec, ncid=ncid, flag=flag) - ! ---------------------------------------------------------------- - do c=begc,endc - icarr(c) = lptr%itype(cptr%landunit(c)) - enddo - call ncd_io(varname='cols1d_ityplun', data=icarr , dim1name=namec, ncid=ncid, flag=flag) - do c=begc,endc - icarr(c) = cptr%itype((c)) - enddo - call ncd_io(varname='cols1d_ityp', data=icarr , dim1name=namec, ncid=ncid, flag=flag) - end if - - ! Write pft info - - if (flag == 'define') then - call ncd_defvar(ncid=ncid, varname='pfts1d_lon', xtype=ncd_double, & - dim1name='pft', long_name='pft longitude', units='degrees_east') - call ncd_defvar(ncid=ncid, varname='pfts1d_lat', xtype=ncd_double, & - dim1name='pft', long_name='pft latitude', units='degrees_north') - call ncd_defvar(ncid=ncid, varname='pfts1d_ixy', xtype=ncd_int, & - dim1name='pft', long_name='2d longitude index of corresponding pft') - call ncd_defvar(ncid=ncid, varname='pfts1d_jxy', xtype=ncd_int, & - dim1name='pft', long_name='2d latitude index of corresponding pft') - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_defvar(ncid=ncid, varname='pfts1d_gi', xtype=ncd_int, & - ! dim1name='pft', long_name='1d grid index of corresponding pft') - !call ncd_defvar(ncid=ncid, varname='pfts1d_li', xtype=ncd_int, & - ! dim1name='pft', long_name='1d landunit index of corresponding pft') - ! ---------------------------------------------------------------- - call ncd_defvar(ncid=ncid, varname='pfts1d_ci', xtype=ncd_int, & - dim1name='pft', long_name='1d column index of corresponding pft') - call ncd_defvar(ncid=ncid, varname='pfts1d_wtxy', xtype=ncd_double, & - dim1name='pft', long_name='pft weight relative to corresponding gridcell') - call ncd_defvar(ncid=ncid, varname='pfts1d_wtlnd', xtype=ncd_double, & - dim1name='pft', long_name='pft weight relative to corresponding landunit') - call ncd_defvar(ncid=ncid, varname='pfts1d_wtcol', xtype=ncd_double, & - dim1name='pft', long_name='pft weight relative to corresponding column') - call ncd_defvar(ncid=ncid, varname='pfts1d_itypveg', xtype=ncd_int, & - dim1name='pft', long_name='pft vegetation type') - call ncd_defvar(ncid=ncid, varname='pfts1d_ityplun', xtype=ncd_int, & - dim1name='pft', long_name='pft landunit type (vegetated,urban,lake,wetland or glacier)') - else if (flag == 'write') then - do p=begp,endp - rparr(p) = gptr%londeg(pptr%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lon' , data=rparr , dim1name=namep, ncid=ncid, flag=flag) - do p=begp,endp - rparr(p) = gptr%latdeg(pptr%gridcell(p)) - enddo - call ncd_io(varname='pfts1d_lat' , data=rparr , dim1name=namep, ncid=ncid, flag=flag) - do p=begp,endp - iparr(p) = mod(ldecomp%gdc2glo(pptr%gridcell(p))-1,ldomain%ni) + 1 - enddo - call ncd_io(varname='pfts1d_ixy' , data=iparr , dim1name=namep, ncid=ncid, flag=flag) - do p=begp,endp - iparr(p) = (ldecomp%gdc2glo(pptr%gridcell(p))-1)/ldomain%ni + 1 - enddo - call ncd_io(varname='pfts1d_jxy' , data=iparr , dim1name=namep, ncid=ncid, flag=flag) - call ncd_io(varname='pfts1d_wtxy' , data=pptr%wtgcell , dim1name=namep, ncid=ncid, flag=flag) - call ncd_io(varname='pfts1d_wtlnd' , data=pptr%wtlunit , dim1name=namep, ncid=ncid, flag=flag) - call ncd_io(varname='pfts1d_wtcol' , data=pptr%wtcol , dim1name=namep, ncid=ncid, flag=flag) - call ncd_io(varname='pfts1d_itypveg', data=pptr%itype , dim1name=namep, ncid=ncid, flag=flag) - ! --- EBK Do NOT write out indices that are incorrect 4/1/2011 --- Bug 1310 - !call ncd_io(varname='pfts1d_gi' , data=pptr%gridcell, dim1name=namep, ncid=ncid, flag=flag) - !call ncd_io(varname='pfts1d_li' , data=pptr%landunit, dim1name=namep, ncid=ncid, flag=flag) - !call ncd_io(varname='pfts1d_ci' , data=pptr%column , dim1name=namep, ncid=ncid, flag=flag) - ! ---------------------------------------------------------------- - do p=begp,endp - iparr(p) = lptr%itype(pptr%landunit(p)) - enddo - call ncd_io(varname='pfts1d_ityplun', data=iparr , dim1name=namep, ncid=ncid, flag=flag) - end if - - if (flag == 'write') then - deallocate(rgarr,rlarr,rcarr,rparr) - deallocate(igarr,ilarr,icarr,iparr) - end if - - end subroutine subgridRest - -end module subgridRestMod diff --git a/src_clm40/main/surfrdMod.F90 b/src_clm40/main/surfrdMod.F90 deleted file mode 100644 index 914b21484d..0000000000 --- a/src_clm40/main/surfrdMod.F90 +++ /dev/null @@ -1,1121 +0,0 @@ -module surfrdMod - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: surfrdMod -! -! !DESCRIPTION: -! Contains methods for reading in surface data file and determining -! two-dimensional subgrid weights as well as writing out new surface -! dataset. When reading in the surface dataset, determines array -! which sets the PFT for each of the [maxpatch] patches and -! array which sets the relative abundance of the PFT. -! Also fills in the PFTs for vegetated portion of each grid cell. -! Fractional areas for these points pertain to "vegetated" -! area not to total grid area. Need to adjust them for fraction of grid -! that is vegetated. Also fills in urban, lake, wetland, and glacier patches. -! -! !USES: - use shr_kind_mod, only : r8 => shr_kind_r8 - use abortutils , only : endrun - use clm_varpar , only : nlevsoi, numpft, & - maxpatch_pft, numcft, maxpatch, & - npatch_urban, npatch_lake, npatch_wet, & - npatch_glacier,maxpatch_urb, npatch_glacier_mec, & - maxpatch_glcmec - use clm_varctl , only : glc_topomax, iulog, scmlat, scmlon, single_column, & - create_glacier_mec_landunit, use_cndv - use clm_varsur , only : wtxy, vegxy, topoxy, pctspec - use decompMod , only : get_proc_bounds - use clmtype - use spmdMod - use ncdio_pio , only : file_desc_t, var_desc_t, ncd_pio_openfile, ncd_pio_closefile, & - ncd_io, check_var, ncd_inqfdims, check_dim - use pio -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) - public :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) - public :: surfrd_get_topo ! Read grid topography into domain (after domain decomp) - public :: surfrd_get_data ! Read surface dataset and determine subgrid weights -! -! !PUBLIC DATA MEMBERS: - logical, public :: crop_prog = .false. ! If prognostic crops is turned on -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! Updated by T Craig -! Updated by Mariana Vertenstein Jan 2011 -! -! -! !PRIVATE MEMBER FUNCTIONS: - private :: surfrd_wtxy_special - private :: surfrd_wtxy_veg_all - private :: surfrd_wtxy_veg_dgvm -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_get_globmask -! -! !INTERFACE: - subroutine surfrd_get_globmask(filename, mask, ni, nj) -! -! !DESCRIPTION: -! Read the surface dataset grid related information: -! This is the first routine called by clm_initialize -! NO DOMAIN DECOMPOSITION HAS BEEN SET YET -! -! !USES: - use fileutils , only : getfil -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: filename ! grid filename - integer , pointer :: mask(:) ! grid mask - integer , intent(out) :: ni, nj ! global grid sizes -! -! !CALLED FROM: -! subroutine surfrd in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - logical :: isgrid2d - integer :: dimid,varid ! netCDF id's - integer :: ns ! size of grid on file - integer :: n,i,j ! index - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - type(var_desc_t) :: vardesc ! variable descriptor - character(len=256) :: varname ! variable name - character(len=256) :: locfn ! local file name - logical :: readvar ! read variable in or not - integer , allocatable :: idata2d(:,:) - character(len=32) :: subname = 'surfrd_get_globmask' ! subroutine name -!----------------------------------------------------------------------- - - if (filename == ' ') then - mask(:) = 1 - RETURN - end if - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun() - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions and if grid file is 2d or 1d - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - if (masterproc) then - write(iulog,*)'lat/lon grid flag (isgrid2d) is ',isgrid2d - end if - - allocate(mask(ns)) - mask(:) = 1 - - if (isgrid2d) then - allocate(idata2d(ni,nj)) - idata2d(:,:) = 1 - call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) - end if - if (readvar) then - do j = 1,nj - do i = 1,ni - n = (j-1)*ni + i - mask(n) = idata2d(i,j) - enddo - enddo - end if - deallocate(idata2d) - else - call ncd_io(ncid=ncid, varname='LANDMASK', data=mask, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=mask, flag='read', readvar=readvar) - end if - end if - if (.not. readvar) call endrun( trim(subname)//' ERROR: landmask not on fatmlndfrc file' ) - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_globmask - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_get_grid -! -! !INTERFACE: - subroutine surfrd_get_grid(ldomain, filename, glcfilename) -! -! !DESCRIPTION: -! THIS IS CALLED AFTER THE DOMAIN DECOMPOSITION HAS BEEN CREATED -! Read the surface dataset grid related information: -! o real latitude of grid cell (degrees) -! o real longitude of grid cell (degrees) -! -! !USES: - use clm_varcon, only : spval, re - use domainMod , only : domain_type, domain_init, domain_clean, lon1d, lat1d - use decompMod , only : get_proc_bounds - use fileutils , only : getfil -! -! !ARGUMENTS: - implicit none - type(domain_type),intent(inout) :: ldomain ! domain to init - character(len=*) ,intent(in) :: filename ! grid filename - character(len=*) ,optional, intent(in) :: glcfilename ! glc mask filename -! -! !CALLED FROM: -! subroutine surfrd in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - type(file_desc_t) :: ncid ! netcdf id - type(file_desc_t) :: ncidg ! netCDF id for glcmask - type(var_desc_t) :: vardesc ! variable descriptor - integer :: beg ! local beg index - integer :: end ! local end index - integer :: ni,nj,ns ! size of grid on file - integer :: dimid,varid ! netCDF id's - integer :: start(1), count(1) ! 1d lat/lon array sections - integer :: ier,ret ! error status - logical :: readvar ! true => variable is on input file - logical :: isgrid2d ! true => file is 2d lat/lon - logical :: istype_domain ! true => input file is of type domain - real(r8), allocatable :: rdata2d(:,:) ! temporary - character(len=16) :: vname ! temporary - character(len=256):: locfn ! local file name - integer :: n ! indices - real(r8):: eps = 1.0e-12_r8 ! lat/lon error tolerance - character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name -!----------------------------------------------------------------------- - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun() - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - - ! Determine isgrid2d flag for domain - - call get_proc_bounds(beg, end) - call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=beg, nend=end) - ! Determine type of file - old style grid file or new style domain file - - call check_var(ncid=ncid, varname='LONGXY', vardesc=vardesc, readvar=readvar) - if (readvar) istype_domain = .false. - - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) - if (readvar) istype_domain = .true. - - ! Read in area, lon, lat - - if (istype_domain) then - call ncd_io(ncid=ncid, varname= 'area', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - ! convert from radians**2 to km**2 - ldomain%area = ldomain%area * (re**2) - if (.not. readvar) call endrun( trim(subname)//' ERROR: area NOT on file' ) - - call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: xc NOT on file' ) - - call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: yc NOT on file' ) - else - call ncd_io(ncid=ncid, varname= 'AREA', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: AREA NOT on file' ) - - call ncd_io(ncid=ncid, varname= 'LONGXY', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: LONGXY NOT on file' ) - - call ncd_io(ncid=ncid, varname= 'LATIXY', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: LATIXY NOT on file' ) - end if - - if (isgrid2d) then - allocate(rdata2d(ni,nj), lon1d(ni), lat1d(nj)) - if (istype_domain) then - vname = 'xc' - else - vname = 'LONGXY' - end if - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lon1d(:) = rdata2d(:,1) - if (istype_domain) then - vname = 'yc' - else - vname = 'LATIXY' - end if - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lat1d(:) = rdata2d(1,:) - deallocate(rdata2d) - end if - - ! Check lat limited to -90,90 - - if (minval(ldomain%latc) < -90.0_r8 .or. & - maxval(ldomain%latc) > 90.0_r8) then - write(iulog,*) trim(subname),' WARNING: lat/lon min/max is ', & - minval(ldomain%latc),maxval(ldomain%latc) - ! call endrun( trim(subname)//' ERROR: lat is outside [-90,90]' ) - ! write(iulog,*) trim(subname),' Limiting lat/lon to [-90/90] from ', & - ! minval(domain%latc),maxval(domain%latc) - ! where (ldomain%latc < -90.0_r8) ldomain%latc = -90.0_r8 - ! where (ldomain%latc > 90.0_r8) ldomain%latc = 90.0_r8 - endif - - call ncd_io(ncid=ncid, varname='LANDMASK', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( trim(subname)//' ERROR: LANDMASK NOT on fracdata file' ) - end if - end if - - call ncd_io(ncid=ncid, varname='LANDFRAC', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='frac', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( trim(subname)//' ERROR: LANDFRAC NOT on fracdata file' ) - end if - end if - - call ncd_pio_closefile(ncid) - - if (present(glcfilename)) then - if (masterproc) then - if (glcfilename == ' ') then - write(iulog,*) trim(subname),' ERROR: glc filename must be specified ' - call endrun() - endif - end if - call getfil( glcfilename, locfn, 0 ) - call ncd_pio_openfile (ncidg, trim(locfn), 0) - - ldomain%glcmask(:) = 0 - call ncd_io(ncid=ncidg, varname='GLCMASK', flag='read', data=ldomain%glcmask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: GLCMASK NOT in file' ) - - ! Make sure the glc mask is a subset of the land mask - do n = beg,end - if (ldomain%glcmask(n)==1 .and. ldomain%mask(n)==0) then - write(iulog,*)trim(subname),& - 'initialize1: landmask/glcmask mismatch' - write(iulog,*)trim(subname),& - 'glc requires input where landmask = 0, gridcell index', n - call endrun() - endif - enddo - call ncd_pio_closefile(ncidg) - endif ! present(glcfilename) - - end subroutine surfrd_get_grid - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_get_topo -! -! !INTERFACE: - subroutine surfrd_get_topo(domain,filename) -! -! !DESCRIPTION: -! Read the topo dataset grid related information: -! Assume domain has already been initialized and read -! -! !USES: - use domainMod , only : domain_type - use fileutils , only : getfil -! -! !ARGUMENTS: - implicit none - type(domain_type),intent(inout) :: domain ! domain to init - character(len=*) ,intent(in) :: filename ! grid filename -! -! !CALLED FROM: -! subroutine initialize -! -! !REVISION HISTORY: -! Created by T Craig -! -! -! !LOCAL VARIABLES: -!EOP - type(file_desc_t) :: ncid ! netcdf file id - integer :: n ! indices - integer :: ni,nj,ns ! size of grid on file - integer :: dimid,varid ! netCDF id's - integer :: ier ! error status - real(r8):: eps = 1.0e-12_r8 ! lat/lon error tolerance - integer :: beg,end ! local beg,end indices - logical :: isgrid2d ! true => file is 2d lat/lon - real(r8),pointer :: lonc(:),latc(:) ! local lat/lon - character(len=256) :: locfn ! local file name - logical :: readvar ! is variable on file - character(len=32) :: subname = 'surfrd_get_topo' ! subroutine name -!----------------------------------------------------------------------- - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun() - else - write(iulog,*) 'Attempting to read lnd topo from flndtopo ',trim(filename) - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - - if (domain%ns /= ns) then - write(iulog,*) trim(subname),' ERROR: topo file mismatch ns',& - domain%ns,ns - call endrun() - endif - - beg = domain%nbeg - end = domain%nend - - allocate(latc(beg:end),lonc(beg:end)) - - call ncd_io(ncid=ncid, varname='LONGXY', flag='read', data=lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: LONGXY NOT on topodata file' ) - - call ncd_io(ncid=ncid, varname='LATIXY', flag='read', data=latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: LATIXY NOT on topodata file' ) - - do n = beg,end - if (abs(latc(n)-domain%latc(n)) > eps .or. & - abs(lonc(n)-domain%lonc(n)) > eps) then - write(iulog,*) trim(subname),' ERROR: topo file mismatch lat,lon',latc(n),& - domain%latc(n),lonc(n),domain%lonc(n),eps - call endrun() - endif - enddo - - call ncd_io(ncid=ncid, varname='TOPO', flag='read', data=domain%topo, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: TOPO NOT on topodata file' ) - - deallocate(latc,lonc) - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_topo - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_get_data -! -! !INTERFACE: - subroutine surfrd_get_data (ldomain, lfsurdat) -! -! !DESCRIPTION: -! Read the surface dataset and create subgrid weights. -! The model's surface dataset recognizes 6 basic land cover types within a grid -! cell: lake, wetland, urban, glacier, glacier_mec and vegetated. The vegetated -! portion of the grid cell is comprised of up to [maxpatch_pft] PFTs. These -! subgrid patches are read in explicitly for each grid cell. This is in -! contrast to LSMv1, where the PFTs were built implicitly from biome types. -! o real latitude of grid cell (degrees) -! o real longitude of grid cell (degrees) -! o integer surface type: 0 = ocean or 1 = land -! o integer soil color (1 to 20) for use with soil albedos -! o real soil texture, %sand, for thermal and hydraulic properties -! o real soil texture, %clay, for thermal and hydraulic properties -! o real % of cell covered by lake for use as subgrid patch -! o real % of cell covered by wetland for use as subgrid patch -! o real % of cell that is urban for use as subgrid patch -! o real % of cell that is glacier for use as subgrid patch -! o real % of cell that is glacier_mec for use as subgrid patch -! o integer PFTs -! o real % abundance PFTs (as a percent of vegetated area) -! -! !USES: - use clm_varctl , only : allocate_all_vegpfts, create_crop_landunit - use pftvarcon , only : noveg - use fileutils , only : getfil - use domainMod , only : domain_type, domain_init, domain_clean -! -! !ARGUMENTS: - implicit none - type(domain_type),intent(in) :: ldomain ! land domain associated with wtxy - character(len=*), intent(in) :: lfsurdat ! surface dataset filename -! -! !CALLED FROM: -! subroutine initialize in module initializeMod -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein, Sam Levis and Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - type(var_desc_t) :: vardesc ! pio variable descriptor - type(domain_type) :: surfdata_domain ! local domain associated with surface dataset - character(len=256):: locfn ! local file name - integer :: n ! loop indices - integer :: ni,nj,ns ! domain sizes - character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset - logical :: readvar ! true => variable is on dataset - real(r8) :: rmaxlon,rmaxlat ! local min/max vars - type(file_desc_t) :: ncid ! netcdf id - integer :: begg,endg ! beg,end gridcell indices - logical :: istype_domain ! true => input file is of type domain - logical :: isgrid2d ! true => intut grid is 2d - character(len=32) :: subname = 'surfrd_get_data' ! subroutine name -!----------------------------------------------------------------------- - - if (masterproc) then - write(iulog,*) 'Attempting to read surface boundary data .....' - if (lfsurdat == ' ') then - write(iulog,*)'lfsurdat must be specified'; call endrun() - endif - endif - - call get_proc_bounds(begg,endg) - allocate(pctspec(begg:endg)) - - vegxy(:,:) = noveg - wtxy(:,:) = 0._r8 - pctspec(:) = 0._r8 - if (allocated(topoxy)) topoxy(:,:) = 0._r8 - - ! Read surface data - - call getfil( lfsurdat, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Read in pft mask - this variable is only on the surface dataset - but not - ! on the domain dataset - - call ncd_io(ncid=ncid, varname= 'PFTDATA_MASK', flag='read', data=ldomain%pftm, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: pftm NOT on surface dataset' ) - - ! Check if fsurdat grid is "close" to fatmlndfrc grid, exit if lats/lon > 0.001 - - call check_var(ncid=ncid, varname='xc', vardesc=vardesc, readvar=readvar) - if (readvar) then - istype_domain = .true. - else - call check_var(ncid=ncid, varname='LONGXY', vardesc=vardesc, readvar=readvar) - if (readvar) then - istype_domain = .false. - else - call endrun( trim(subname)//' ERROR: unknown domain type') - end if - end if - if (istype_domain) then - lon_var = 'xc' - lat_var = 'yc' - else - lon_var = 'LONGXY' - lat_var = 'LATIXY' - end if - if ( masterproc )then - write(iulog,*) trim(subname),' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) - end if - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, clmlevel=grlnd) - - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: lon var NOT on surface dataset' ) - - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: lat var NOT on surface dataset' ) - - rmaxlon = 0.0_r8 - rmaxlat = 0.0_r8 - do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) - else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) - endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) - enddo - if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then - write(iulog,*) trim(subname)//': surfdata/fatmgrid lon/lat mismatch error',& - rmaxlon,rmaxlat - call endrun(trim(subname)) - end if - call domain_clean(surfdata_domain) - - ! Obtain special landunit info - - call surfrd_wtxy_special(ncid, ldomain%ns) - - ! Obtain vegetated landunit info - - if (use_cndv) then - if (create_crop_landunit) then ! CNDV means allocate_all_vegpfts = .true. - call surfrd_wtxy_veg_all(ncid, ldomain%ns, ldomain%pftm) - end if - call surfrd_wtxy_veg_dgvm() - else - if (allocate_all_vegpfts) then - call surfrd_wtxy_veg_all(ncid, ldomain%ns, ldomain%pftm) - else - call endrun (trim(subname) // 'only allocate_all_vegpfts is supported') - end if - end if - - call ncd_pio_closefile(ncid) - - if ( masterproc )then - write(iulog,*) 'Successfully read surface boundary data' - write(iulog,*) - end if - - end subroutine surfrd_get_data - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_wtxy_special -! -! !INTERFACE: - subroutine surfrd_wtxy_special(ncid, ns) -! -! !DESCRIPTION: -! Determine weight with respect to gridcell of all special "pfts" as well -! as soil color and percent sand and clay -! -! !USES: - use pftvarcon , only : noveg - use UrbanInputMod , only : urbinp - use clm_varpar , only : maxpatch_glcmec -! -! !ARGUMENTS: - implicit none - type(file_desc_t), intent(inout) :: ncid ! netcdf id - integer , intent(in) :: ns ! domain size -! -! !CALLED FROM: -! subroutine surfrd in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein, Sam Levis and Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - integer :: n,nl,nurb,g ! indices - integer :: begg,endg ! gcell beg/end - integer :: dimid,varid ! netCDF id's - real(r8) :: nlevsoidata(nlevsoi) - logical :: found ! temporary for error check - integer :: nindx ! temporary for error check - integer :: ier ! error status - integer :: nlev ! level - integer :: npatch - logical :: readvar - real(r8),pointer :: pctgla(:) ! percent of grid cell is glacier - real(r8),pointer :: pctlak(:) ! percent of grid cell is lake - real(r8),pointer :: pctwet(:) ! percent of grid cell is wetland - real(r8),pointer :: pcturb(:) ! percent of grid cell is urbanized - real(r8),pointer :: pctglc_mec(:,:) ! percent of grid cell is glacier_mec (in each elev class) - real(r8),pointer :: pctglc_mec_tot(:) ! percent of grid cell is glacier (sum over classes) - real(r8),pointer :: topoglc_mec(:,:) ! surface elevation in each elev class - character(len=32) :: subname = 'surfrd_wtxy_special' ! subroutine name - real(r8) closelat,closelon -!!----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg) - - allocate(pctgla(begg:endg),pctlak(begg:endg)) - allocate(pctwet(begg:endg),pcturb(begg:endg)) - if (create_glacier_mec_landunit) then - allocate(pctglc_mec(begg:endg,maxpatch_glcmec)) - allocate(pctglc_mec_tot(begg:endg)) - allocate(topoglc_mec(begg:endg,maxpatch_glcmec)) - allocate(glc_topomax(0:maxpatch_glcmec)) - endif - - call check_dim(ncid, 'nlevsoi', nlevsoi) - - ! Obtain non-grid surface properties of surface dataset other than percent pft - - call ncd_io(ncid=ncid, varname='PCT_WETLAND', flag='read', data=pctwet, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_WETLAND NOT on surfdata file' ) - - call ncd_io(ncid=ncid, varname='PCT_LAKE' , flag='read', data=pctlak, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_LAKE NOT on surfdata file' ) - - call ncd_io(ncid=ncid, varname='PCT_GLACIER', flag='read', data=pctgla, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_GLACIER NOT on surfdata file' ) - - call ncd_io(ncid=ncid, varname='PCT_URBAN' , flag='read', data=pcturb, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_URBAN NOT on surfdata file' ) - - if (create_glacier_mec_landunit) then ! call ncd_io_gs_int2d - - call check_dim(ncid, 'nglcec', maxpatch_glcmec ) - call check_dim(ncid, 'nglcecp1', maxpatch_glcmec+1 ) - - call ncd_io(ncid=ncid, varname='GLC_MEC', flag='read', data=glc_topomax, & - readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//'ERROR: GLC_MEC was NOT on the input surfdata file' ) - - call ncd_io(ncid=ncid, varname='PCT_GLC_MEC', flag='read', data=pctglc_mec, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_GLC_MEC NOT on surfdata file' ) - - call ncd_io(ncid=ncid, varname='TOPO_GLC_MEC', flag='read', data=topoglc_mec, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: TOPO_GLC_MEC NOT on surfdata file' ) - - pctglc_mec_tot(:) = 0._r8 - do n = 1, maxpatch_glcmec - do nl = begg,endg - pctglc_mec_tot(nl) = pctglc_mec_tot(nl) + pctglc_mec(nl,n) - enddo - enddo - - ! Make sure sum of pctglc_mec = pctgla (approximately), then correct pctglc_mec so - ! that its sum more exactly equals pctgla, then zero out pctgla - ! - ! WJS (9-28-12): The reason for the correction piece of this is: in the surface - ! dataset, pctgla underwent various minor corrections that make it the trusted - ! value (as opposed to sum(pctglc_mec). sum(pctglc_mec) can differ from pctgla by - ! single precision roundoff. This difference can cause problems later (e.g., in the - ! consistency check in pftdynMod), so we do this correction here. It might be - ! better to do this correction in mksurfdata_map, but because of time constraints, - ! which make me unable to recreate surface datasets, I have to do it here instead - ! (and there are arguments for putting it here anyway). - - do nl = begg,endg - ! We need to use a fairly high threshold for equality (2.0e-5) because pctgla - ! and pctglc_mec are computed using single precision inputs. Note that this - ! threshold agrees with the threshold in the error checks in mkglcmecMod: - ! mkglcmec in mksurfdata_map. - if (abs(pctgla(nl) - pctglc_mec_tot(nl)) > 2.0e-5) then - write(iulog,*) ' ' - write(iulog,*) 'surfrd error: pctgla not equal to sum of pctglc_mec for nl=', nl - write(iulog,*) 'pctgla =', pctgla(nl) - write(iulog,*) 'pctglc_mec_tot =', pctglc_mec_tot(nl) - call endrun() - endif - - ! Correct the remaining minor differences in pctglc_mec so sum more exactly - ! equals pctglc (see notes above for justification) - if (pctglc_mec_tot(nl) > 0.0_r8) then - pctglc_mec(nl,:) = pctglc_mec(nl,:) * pctgla(nl)/pctglc_mec_tot(nl) - end if - - ! Now recompute pctglc_mec_tot, and confirm that we are now much closer to pctgla - pctglc_mec_tot(nl) = 0._r8 - do n = 1, maxpatch_glcmec - pctglc_mec_tot(nl) = pctglc_mec_tot(nl) + pctglc_mec(nl,n) - end do - - if (abs(pctgla(nl) - pctglc_mec_tot(nl)) > 1.0e-13) then - write(iulog,*) ' ' - write(iulog,*) 'surfrd error: after correction, pctgla not equal to sum of pctglc_mec for nl=', nl - write(iulog,*) 'pctgla =', pctgla(nl) - write(iulog,*) 'pctglc_mec_tot =', pctglc_mec_tot(nl) - call endrun() - endif - - ! Finally, zero out pctgla - pctgla(nl) = 0._r8 - enddo - - ! If pctglc_mec_tot is very close to 100%, round to 100% - - do nl = begg,endg - ! The inequality here ( <= 2.0e-5 ) is designed to be the complement of the - ! above check that makes sure pctglc_mec_tot is close to pctgla: so if pctglc= - ! 100 (exactly), then exactly one of these conditionals will be triggered. - ! Update 9-28-12: Now that there is a rescaling of pctglc_mec to bring it more - ! in line with pctgla, we could probably decrease this tolerance again (the - ! point about exactly one of these conditionals being triggered no longer holds) - ! - or perhaps even get rid of this whole block of code. But I'm keeping this as - ! is for now because that's how I tested it, and I don't think it will hurt - ! anything to use this larger tolerance. - if (abs(pctglc_mec_tot(nl) - 100._r8) <= 2.0e-5) then - pctglc_mec(nl,:) = pctglc_mec(nl,:) * 100._r8 / pctglc_mec_tot(nl) - pctglc_mec_tot(nl) = 100._r8 - endif - enddo - - pctspec = pctwet + pctlak + pcturb + pctglc_mec_tot - - if ( masterproc ) write(iulog,*) ' elevation limits = ', glc_topomax - - else - - pctspec = pctwet + pctlak + pcturb + pctgla - - endif - - ! Error check: glacier, lake, wetland, urban sum must be less than 100 - - found = .false. - do nl = begg,endg - if (pctspec(nl) > 100._r8+1.e-04_r8) then - found = .true. - nindx = nl - exit - end if - if (found) exit - end do - if ( found ) then - write(iulog,*)'surfrd error: PFT cover>100 for nl=',nindx - call endrun() - end if - - ! Determine veg and wtxy for special landunits - - do nl = begg,endg - - vegxy(nl,npatch_lake) = noveg - wtxy(nl,npatch_lake) = pctlak(nl)/100._r8 - - vegxy(nl,npatch_wet) = noveg - wtxy(nl,npatch_wet) = pctwet(nl)/100._r8 - - vegxy(nl,npatch_glacier)= noveg - wtxy(nl,npatch_glacier) = pctgla(nl)/100._r8 - - ! Initialize urban weights - - do nurb = npatch_urban, npatch_lake-1 - vegxy(nl,nurb) = noveg - wtxy(nl,nurb) = pcturb(nl) / 100._r8 - end do - if ( pcturb(nl) > 0.0_r8 )then - wtxy(nl,npatch_urban) = wtxy(nl,npatch_urban)*urbinp%wtlunit_roof(nl) - wtxy(nl,npatch_urban+1) = wtxy(nl,npatch_urban+1)*(1 - urbinp%wtlunit_roof(nl))/3 - wtxy(nl,npatch_urban+2) = wtxy(nl,npatch_urban+2)*(1 - urbinp%wtlunit_roof(nl))/3 - wtxy(nl,npatch_urban+3) = wtxy(nl,npatch_urban+3)*(1 - urbinp%wtlunit_roof(nl))/3 * (1.-urbinp%wtroad_perv(nl)) - wtxy(nl,npatch_urban+4) = wtxy(nl,npatch_urban+4)*(1 - urbinp%wtlunit_roof(nl))/3 * urbinp%wtroad_perv(nl) - end if - - end do - - ! Check to make sure we have valid urban data for each urban patch - - found = .false. - do nl = begg,endg - if ( pcturb(nl) > 0.0_r8 )then - if (urbinp%canyon_hwr(nl) .le. 0._r8 .or. & - urbinp%em_improad(nl) .le. 0._r8 .or. & - urbinp%em_perroad(nl) .le. 0._r8 .or. & - urbinp%em_roof(nl) .le. 0._r8 .or. & - urbinp%em_wall(nl) .le. 0._r8 .or. & - urbinp%ht_roof(nl) .le. 0._r8 .or. & - urbinp%thick_roof(nl) .le. 0._r8 .or. & - urbinp%thick_wall(nl) .le. 0._r8 .or. & - urbinp%t_building_max(nl) .le. 0._r8 .or. & - urbinp%t_building_min(nl) .le. 0._r8 .or. & - urbinp%wind_hgt_canyon(nl) .le. 0._r8 .or. & - urbinp%wtlunit_roof(nl) .le. 0._r8 .or. & - urbinp%wtroad_perv(nl) .le. 0._r8 .or. & - any(urbinp%alb_improad_dir(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_improad_dif(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_perroad_dir(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_perroad_dif(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_roof_dir(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_roof_dif(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_wall_dir(nl,:) .le. 0._r8) .or. & - any(urbinp%alb_wall_dif(nl,:) .le. 0._r8) .or. & - any(urbinp%tk_roof(nl,:) .le. 0._r8) .or. & - any(urbinp%tk_wall(nl,:) .le. 0._r8) .or. & - any(urbinp%cv_roof(nl,:) .le. 0._r8) .or. & - any(urbinp%cv_wall(nl,:) .le. 0._r8)) then - found = .true. - nindx = nl - exit - else - if (urbinp%nlev_improad(nl) .gt. 0) then - nlev = urbinp%nlev_improad(nl) - if (any(urbinp%tk_improad(nl,1:nlev) .le. 0._r8) .or. & - any(urbinp%cv_improad(nl,1:nlev) .le. 0._r8)) then - found = .true. - nindx = nl - exit - end if - end if - end if - if (found) exit - end if - end do - if ( found ) then - write(iulog,*)'surfrd error: no valid urban data for nl=',nindx - write(iulog,*)'canyon_hwr: ',urbinp%canyon_hwr(nindx) - write(iulog,*)'em_improad: ',urbinp%em_improad(nindx) - write(iulog,*)'em_perroad: ',urbinp%em_perroad(nindx) - write(iulog,*)'em_roof: ',urbinp%em_roof(nindx) - write(iulog,*)'em_wall: ',urbinp%em_wall(nindx) - write(iulog,*)'ht_roof: ',urbinp%ht_roof(nindx) - write(iulog,*)'thick_roof: ',urbinp%thick_roof(nindx) - write(iulog,*)'thick_wall: ',urbinp%thick_wall(nindx) - write(iulog,*)'t_building_max: ',urbinp%t_building_max(nindx) - write(iulog,*)'t_building_min: ',urbinp%t_building_min(nindx) - write(iulog,*)'wind_hgt_canyon: ',urbinp%wind_hgt_canyon(nindx) - write(iulog,*)'wtlunit_roof: ',urbinp%wtlunit_roof(nindx) - write(iulog,*)'wtroad_perv: ',urbinp%wtroad_perv(nindx) - write(iulog,*)'alb_improad_dir: ',urbinp%alb_improad_dir(nindx,:) - write(iulog,*)'alb_improad_dif: ',urbinp%alb_improad_dif(nindx,:) - write(iulog,*)'alb_perroad_dir: ',urbinp%alb_perroad_dir(nindx,:) - write(iulog,*)'alb_perroad_dif: ',urbinp%alb_perroad_dif(nindx,:) - write(iulog,*)'alb_roof_dir: ',urbinp%alb_roof_dir(nindx,:) - write(iulog,*)'alb_roof_dif: ',urbinp%alb_roof_dif(nindx,:) - write(iulog,*)'alb_wall_dir: ',urbinp%alb_wall_dir(nindx,:) - write(iulog,*)'alb_wall_dif: ',urbinp%alb_wall_dif(nindx,:) - write(iulog,*)'tk_roof: ',urbinp%tk_roof(nindx,:) - write(iulog,*)'tk_wall: ',urbinp%tk_wall(nindx,:) - write(iulog,*)'cv_roof: ',urbinp%cv_roof(nindx,:) - write(iulog,*)'cv_wall: ',urbinp%cv_wall(nindx,:) - if (urbinp%nlev_improad(nindx) .gt. 0) then - nlev = urbinp%nlev_improad(nindx) - write(iulog,*)'tk_improad: ',urbinp%tk_improad(nindx,1:nlev) - write(iulog,*)'cv_improad: ',urbinp%cv_improad(nindx,1:nlev) - end if - call endrun() - end if - - ! Initialize glacier_mec weights - - if (create_glacier_mec_landunit) then - do n = 1, maxpatch_glcmec - npatch = npatch_glacier_mec - maxpatch_glcmec + n - do nl = begg, endg - vegxy (nl,npatch) = noveg - wtxy (nl,npatch) = pctglc_mec(nl,n)/100._r8 - topoxy(nl,npatch) = topoglc_mec(nl,n) - enddo ! nl - enddo ! maxpatch_glcmec - deallocate(pctglc_mec, pctglc_mec_tot, topoglc_mec) - endif ! create_glacier_mec_landunit - - deallocate(pctgla,pctlak,pctwet,pcturb) - - end subroutine surfrd_wtxy_special - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_wtxy_veg_all -! -! !INTERFACE: - subroutine surfrd_wtxy_veg_all(ncid, ns, pftm) -! -! !DESCRIPTION: -! Determine wtxy and veg arrays for non-dynamic landuse mode -! -! !USES: - use clm_varctl , only : create_crop_landunit - use pftvarcon , only : nirrig, npcropmin - use spmdMod , only : mpicom, MPI_LOGICAL, MPI_LOR -! -! !ARGUMENTS: - implicit none - type(file_desc_t),intent(inout) :: ncid ! netcdf id - integer ,intent(in) :: ns ! domain size - integer ,pointer :: pftm(:) -! -! !CALLED FROM: -! subroutine surfrd in this module -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein, Sam Levis and Gordon Bonan -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m,mp7,mp8,mp11,n,nl ! indices - integer :: begg,endg ! beg/end gcell index - integer :: dimid,varid ! netCDF id's - integer :: ier ! error status - logical :: readvar ! is variable on dataset - real(r8) :: sumpct ! sum of %pft over maxpatch_pft - real(r8),allocatable :: pctpft(:,:) ! percent of vegetated gridcell area for PFTs - real(r8),pointer :: arrayl(:,:) ! local array - real(r8) :: numpftp1data(0:numpft) - logical :: crop = .false. ! if crop data on this section of file - character(len=32) :: subname = 'surfrd_wtxy_veg_all' ! subroutine name -!----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg) - allocate(pctpft(begg:endg,0:numpft)) - - call check_dim(ncid, 'lsmpft', numpft+1) - - allocate(arrayl(begg:endg,0:numpft)) - call ncd_io(ncid=ncid, varname='PCT_PFT', flag='read', data=arrayl, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( trim(subname)//' ERROR: PCT_PFT NOT on surfdata file' ) - pctpft(begg:endg,0:numpft) = arrayl(begg:endg,0:numpft) - deallocate(arrayl) - - do nl = begg,endg - if (pftm(nl) >= 0) then - - ! Error check: make sure PFTs sum to 100% cover for vegetated landunit - ! (convert pctpft from percent with respect to gridcel to percent with - ! respect to vegetated landunit) - - if (pctspec(nl) < 100._r8) then - sumpct = 0._r8 - do m = 0,numpft - sumpct = sumpct + pctpft(nl,m) * 100._r8/(100._r8-pctspec(nl)) - if (m == nirrig .and. .not. create_crop_landunit) then - if (pctpft(nl,m) > 0._r8) then - call endrun( trim(subname)//' ERROR surfrdMod: irrigated crop'// & - ' PFT requires create_crop_landunit=.true.' ) - end if - end if - end do - if (abs(sumpct - 100._r8) > 0.1e-4_r8) then - write(iulog,*) trim(subname)//' ERROR: sum(pct) over numpft+1 is not = 100.' - write(iulog,*) sumpct, sumpct-100._r8, nl - call endrun() - end if - if (sumpct < -0.000001_r8) then - write(iulog,*) trim(subname)//' ERROR: sum(pct) over numpft+1 is < 0.' - write(iulog,*) sumpct, nl - call endrun() - end if - do m = npcropmin, numpft - if ( pctpft(nl,m) > 0.0_r8 ) crop = .true. - end do - end if - - ! Set weight of each pft wrt gridcell (note that maxpatch_pft = numpft+1 here) - - do m = 1,numpft+1 - vegxy(nl,m) = m - 1 ! 0 (bare ground) to numpft - wtxy(nl,m) = pctpft(nl,m-1) / 100._r8 - end do - - end if - end do - call mpi_allreduce(crop,crop_prog,1,MPI_LOGICAL,MPI_LOR,mpicom,ier) - if (ier /= 0) then - write(iulog,*) trim(subname)//' mpi_allreduce error = ',ier - call endrun( trim(subname)//' ERROR: error in reduce of crop_prog' ) - endif - if (crop_prog .and. .not. create_crop_landunit) then - call endrun( trim(subname)//' ERROR: prognostic crop '// & - 'PFTs requires create_crop_landunit=.true.' ) - end if - - deallocate(pctpft) - - end subroutine surfrd_wtxy_veg_all - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: surfrd_wtxy_veg_dgvm -! -! !INTERFACE: - subroutine surfrd_wtxy_veg_dgvm() -! -! !DESCRIPTION: -! Determine wtxy and vegxy for CNDV mode. -! -! !USES: - use pftvarcon , only : noveg, crop - use clm_varctl, only : create_crop_landunit -! -! !ARGUMENTS: - implicit none -! -! !CALLED FROM: -! subroutine surfrd in this module -! -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein 12/04 -! -! -! !LOCAL VARIABLES: -!EOP - integer :: m,nl ! indices - integer :: begg,endg ! beg/end gcell index -!----------------------------------------------------------------------- - - call get_proc_bounds(begg,endg) - do nl = begg,endg - do m = 1, maxpatch_pft ! CNDV means allocate_all_vegpfts = .true. - if (create_crop_landunit) then ! been through surfrd_wtxy_veg_all - if (crop(m-1) == 0) then ! so update natural vegetation only - wtxy(nl,m) = 0._r8 ! crops should have values >= 0. - end if - else ! not been through surfrd_wtxy_veg_all - wtxy(nl,m) = 0._r8 ! so update all vegetation - vegxy(nl,m) = m - 1 ! 0 (bare ground) to maxpatch_pft-1 (= 16) - end if - end do - ! bare ground weights - wtxy(nl,noveg+1) = max(0._r8, 1._r8 - sum(wtxy(nl,:))) - if (abs(sum(wtxy(nl,:)) - 1._r8) > 1.e-5_r8) then - write(iulog,*) 'all wtxy =', wtxy(nl,:) - call endrun() - end if ! error check - end do - - end subroutine surfrd_wtxy_veg_dgvm - -end module surfrdMod diff --git a/manage_externals/test/.coveragerc b/test/.coveragerc similarity index 100% rename from manage_externals/test/.coveragerc rename to test/.coveragerc diff --git a/manage_externals/test/.gitignore b/test/.gitignore similarity index 100% rename from manage_externals/test/.gitignore rename to test/.gitignore diff --git a/manage_externals/test/.pylint.rc b/test/.pylint.rc similarity index 100% rename from manage_externals/test/.pylint.rc rename to test/.pylint.rc diff --git a/manage_externals/test/Makefile b/test/Makefile similarity index 100% rename from manage_externals/test/Makefile rename to test/Makefile diff --git a/manage_externals/test/README.md b/test/README.md similarity index 100% rename from manage_externals/test/README.md rename to test/README.md diff --git a/manage_externals/test/doc/.gitignore b/test/doc/.gitignore similarity index 100% rename from manage_externals/test/doc/.gitignore rename to test/doc/.gitignore diff --git a/manage_externals/test/doc/Makefile b/test/doc/Makefile similarity index 100% rename from manage_externals/test/doc/Makefile rename to test/doc/Makefile diff --git a/manage_externals/test/doc/conf.py b/test/doc/conf.py similarity index 100% rename from manage_externals/test/doc/conf.py rename to test/doc/conf.py diff --git a/manage_externals/test/doc/develop.rst b/test/doc/develop.rst similarity index 100% rename from manage_externals/test/doc/develop.rst rename to test/doc/develop.rst diff --git a/manage_externals/test/doc/index.rst b/test/doc/index.rst similarity index 100% rename from manage_externals/test/doc/index.rst rename to test/doc/index.rst diff --git a/manage_externals/test/doc/testing.rst b/test/doc/testing.rst similarity index 100% rename from manage_externals/test/doc/testing.rst rename to test/doc/testing.rst diff --git a/manage_externals/test/repos/container.git/HEAD b/test/repos/container.git/HEAD similarity index 100% rename from manage_externals/test/repos/container.git/HEAD rename to test/repos/container.git/HEAD diff --git a/manage_externals/test/repos/container.git/config b/test/repos/container.git/config similarity index 100% rename from manage_externals/test/repos/container.git/config rename to test/repos/container.git/config diff --git a/manage_externals/test/repos/container.git/description b/test/repos/container.git/description similarity index 100% rename from manage_externals/test/repos/container.git/description rename to test/repos/container.git/description diff --git a/manage_externals/test/repos/container.git/info/exclude b/test/repos/container.git/info/exclude similarity index 100% rename from manage_externals/test/repos/container.git/info/exclude rename to test/repos/container.git/info/exclude diff --git a/manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 similarity index 100% rename from manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 rename to test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 diff --git a/manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de b/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de similarity index 100% rename from manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de rename to test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de diff --git a/manage_externals/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b b/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b similarity index 100% rename from manage_externals/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b rename to test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b diff --git a/manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 b/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 similarity index 100% rename from manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 rename to test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 diff --git a/manage_externals/test/repos/container.git/refs/heads/master b/test/repos/container.git/refs/heads/master similarity index 100% rename from manage_externals/test/repos/container.git/refs/heads/master rename to test/repos/container.git/refs/heads/master diff --git a/manage_externals/test/repos/error/readme.txt b/test/repos/error/readme.txt similarity index 100% rename from manage_externals/test/repos/error/readme.txt rename to test/repos/error/readme.txt diff --git a/manage_externals/test/repos/mixed-cont-ext.git/HEAD b/test/repos/mixed-cont-ext.git/HEAD similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/HEAD rename to test/repos/mixed-cont-ext.git/HEAD diff --git a/manage_externals/test/repos/mixed-cont-ext.git/config b/test/repos/mixed-cont-ext.git/config similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/config rename to test/repos/mixed-cont-ext.git/config diff --git a/manage_externals/test/repos/mixed-cont-ext.git/description b/test/repos/mixed-cont-ext.git/description similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/description rename to test/repos/mixed-cont-ext.git/description diff --git a/manage_externals/test/repos/mixed-cont-ext.git/info/exclude b/test/repos/mixed-cont-ext.git/info/exclude similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/info/exclude rename to test/repos/mixed-cont-ext.git/info/exclude diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb b/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb rename to test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 b/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 rename to test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 b/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 rename to test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 b/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 rename to test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 b/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 rename to test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f b/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f rename to test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 b/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 rename to test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c b/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c rename to test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 rename to test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 b/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 rename to test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a b/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a rename to test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 b/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 rename to test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 b/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 rename to test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd b/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd rename to test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 b/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 rename to test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 b/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 rename to test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 diff --git a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master b/test/repos/mixed-cont-ext.git/refs/heads/master similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master rename to test/repos/mixed-cont-ext.git/refs/heads/master diff --git a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature b/test/repos/mixed-cont-ext.git/refs/heads/new-feature similarity index 100% rename from manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature rename to test/repos/mixed-cont-ext.git/refs/heads/new-feature diff --git a/manage_externals/test/repos/simple-ext-fork.git/HEAD b/test/repos/simple-ext-fork.git/HEAD similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/HEAD rename to test/repos/simple-ext-fork.git/HEAD diff --git a/manage_externals/test/repos/simple-ext-fork.git/config b/test/repos/simple-ext-fork.git/config similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/config rename to test/repos/simple-ext-fork.git/config diff --git a/manage_externals/test/repos/simple-ext-fork.git/description b/test/repos/simple-ext-fork.git/description similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/description rename to test/repos/simple-ext-fork.git/description diff --git a/manage_externals/test/repos/simple-ext-fork.git/info/exclude b/test/repos/simple-ext-fork.git/info/exclude similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/info/exclude rename to test/repos/simple-ext-fork.git/info/exclude diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f b/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f rename to test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 b/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 rename to test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 b/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 rename to test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c b/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c rename to test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f b/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f rename to test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 b/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 rename to test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf b/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf rename to test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 b/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 rename to test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 b/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 rename to test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b b/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b rename to test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 rename to test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f b/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f rename to test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a b/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a rename to test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae b/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae rename to test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 b/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 rename to test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 b/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 rename to test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f b/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f rename to test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 b/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 rename to test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 b/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 rename to test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 b/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 rename to test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 b/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 rename to test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 b/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 rename to test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b b/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b rename to test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 b/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 rename to test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca b/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca rename to test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca diff --git a/manage_externals/test/repos/simple-ext-fork.git/packed-refs b/test/repos/simple-ext-fork.git/packed-refs similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/packed-refs rename to test/repos/simple-ext-fork.git/packed-refs diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 b/test/repos/simple-ext-fork.git/refs/heads/feature2 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 rename to test/repos/simple-ext-fork.git/refs/heads/feature2 diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature b/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature rename to test/repos/simple-ext-fork.git/refs/tags/abandoned-feature diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 b/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 similarity index 100% rename from manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 rename to test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 diff --git a/manage_externals/test/repos/simple-ext.git/HEAD b/test/repos/simple-ext.git/HEAD similarity index 100% rename from manage_externals/test/repos/simple-ext.git/HEAD rename to test/repos/simple-ext.git/HEAD diff --git a/manage_externals/test/repos/simple-ext.git/config b/test/repos/simple-ext.git/config similarity index 100% rename from manage_externals/test/repos/simple-ext.git/config rename to test/repos/simple-ext.git/config diff --git a/manage_externals/test/repos/simple-ext.git/description b/test/repos/simple-ext.git/description similarity index 100% rename from manage_externals/test/repos/simple-ext.git/description rename to test/repos/simple-ext.git/description diff --git a/manage_externals/test/repos/simple-ext.git/info/exclude b/test/repos/simple-ext.git/info/exclude similarity index 100% rename from manage_externals/test/repos/simple-ext.git/info/exclude rename to test/repos/simple-ext.git/info/exclude diff --git a/manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f b/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f rename to test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f diff --git a/manage_externals/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 b/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 rename to test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 diff --git a/manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 b/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 rename to test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 diff --git a/manage_externals/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c b/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c rename to test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c diff --git a/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d b/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d new file mode 100644 index 0000000000000000000000000000000000000000..acaf7889b47c54ee0dea121c73d505ca14ad369b GIT binary patch literal 83 zcmV-Z0IdIb0ZYosPg1ZjWC+Q~ELKR%%t=)!&d4v#Nl{3x$Sf{V$jnnnRLILO%1z8s pNX|%2&dx6_QAh$}pz8eG%#xDS6o{JQg2bZYRJa;FE&z4gA7ySEC>H<# literal 0 HcmV?d00001 diff --git a/manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 b/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 rename to test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 diff --git a/manage_externals/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 b/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 rename to test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 diff --git a/manage_externals/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 rename to test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 diff --git a/test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380 b/test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380 new file mode 100644 index 0000000000000000000000000000000000000000..3f6959cc54afd45fa4f64be25ccb3bb8580183c9 GIT binary patch literal 168 zcmV;Z09XHb0hNwR4#F@D1zG15z5poBzY;=l6vuV}(Nff=3vN&02JB|>MsIi;$9n_k z!>-M$Ac)DAYy~^^qUu9WLY{J}xkT>CQ3)XSx>0V^p=O;s>7G-EI{FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3KlvCEtNF?@%PbVOT{Nm)vLb%0Bl_``r7C@umAu6 literal 0 HcmV?d00001 diff --git a/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 b/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 new file mode 100644 index 0000000000000000000000000000000000000000..f08ae820c9c89927f9898c5646134f7c519a6b04 GIT binary patch literal 60 zcmV-C0K@-y0V^p=O;s>4W-v4`Ff%bxC@xJ($t;Rb%gjmDE2$`95K$NWyZdy5$@Np$ Sc0Fs5Xy2&+OcnsW_!K#a0~pW% literal 0 HcmV?d00001 diff --git a/manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff b/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff similarity index 100% rename from manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff rename to test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff diff --git a/manage_externals/test/repos/simple-ext.git/refs/heads/feature2 b/test/repos/simple-ext.git/refs/heads/feature2 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/refs/heads/feature2 rename to test/repos/simple-ext.git/refs/heads/feature2 diff --git a/manage_externals/test/repos/simple-ext.git/refs/heads/feature3 b/test/repos/simple-ext.git/refs/heads/feature3 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/refs/heads/feature3 rename to test/repos/simple-ext.git/refs/heads/feature3 diff --git a/test/repos/simple-ext.git/refs/heads/master b/test/repos/simple-ext.git/refs/heads/master new file mode 100644 index 0000000000..adf1ccb002 --- /dev/null +++ b/test/repos/simple-ext.git/refs/heads/master @@ -0,0 +1 @@ +607ec299c17dd285c029edc41a0109e49d441380 diff --git a/manage_externals/test/repos/simple-ext.git/refs/tags/tag1 b/test/repos/simple-ext.git/refs/tags/tag1 similarity index 100% rename from manage_externals/test/repos/simple-ext.git/refs/tags/tag1 rename to test/repos/simple-ext.git/refs/tags/tag1 diff --git a/test/repos/simple-ext.git/refs/tags/tag2 b/test/repos/simple-ext.git/refs/tags/tag2 new file mode 100644 index 0000000000..4160b6c494 --- /dev/null +++ b/test/repos/simple-ext.git/refs/tags/tag2 @@ -0,0 +1 @@ +b7692b6d391899680da7b9b6fd8af4c413f06fe7 diff --git a/manage_externals/test/requirements.txt b/test/requirements.txt similarity index 100% rename from manage_externals/test/requirements.txt rename to test/requirements.txt diff --git a/manage_externals/test/test_sys_checkout.py b/test/test_sys_checkout.py similarity index 78% rename from manage_externals/test/test_sys_checkout.py rename to test/test_sys_checkout.py index 9ebfb0aeee..df726f2b70 100644 --- a/manage_externals/test/test_sys_checkout.py +++ b/test/test_sys_checkout.py @@ -42,6 +42,7 @@ from manic.externals_description import ExternalsDescription from manic.externals_description import DESCRIPTION_SECTION, VERSION_ITEM +from manic.externals_description import git_submodule_status from manic.externals_status import ExternalStatus from manic.repository_git import GitRepository from manic.utils import printlog, execute_subprocess @@ -87,6 +88,8 @@ SVN_TEST_REPO = 'https://github.com/escomp/cesm' +# Disable too-many-public-methods error +# pylint: disable=R0904 def setUpModule(): # pylint: disable=C0103 """Setup for all tests in this module. It is called once per module! @@ -139,7 +142,7 @@ def container_full(self, dest_dir): self.create_section(MIXED_REPO_NAME, 'mixed_req', branch='master', externals=CFG_SUB_NAME) - self._write_config(dest_dir) + self.write_config(dest_dir) def container_simple_required(self, dest_dir): """Create a container externals file with only simple externals. @@ -155,7 +158,7 @@ def container_simple_required(self, dest_dir): self.create_section(SIMPLE_REPO_NAME, 'simp_hash', ref_hash='60b1cc1a38d63') - self._write_config(dest_dir) + self.write_config(dest_dir) def container_simple_optional(self, dest_dir): """Create a container externals file with optional simple externals @@ -168,7 +171,7 @@ def container_simple_optional(self, dest_dir): self.create_section(SIMPLE_REPO_NAME, 'simp_opt', tag='tag1', required=False) - self._write_config(dest_dir) + self.write_config(dest_dir) def container_simple_svn(self, dest_dir): """Create a container externals file with only simple externals. @@ -180,7 +183,26 @@ def container_simple_svn(self, dest_dir): self.create_svn_external('svn_branch', branch='trunk') self.create_svn_external('svn_tag', tag='tags/cesm2.0.beta07') - self._write_config(dest_dir) + self.write_config(dest_dir) + + def container_sparse(self, dest_dir): + """Create a container with a full external and a sparse external + + """ + # Create a file for a sparse pattern match + sparse_filename = 'sparse_checkout' + with open(os.path.join(dest_dir, sparse_filename), 'w') as sfile: + sfile.write('readme.txt') + + self.create_config() + self.create_section(SIMPLE_REPO_NAME, 'simp_tag', + tag='tag2') + + sparse_relpath = '../../{}'.format(sparse_filename) + self.create_section(SIMPLE_REPO_NAME, 'simp_sparse', + tag='tag2', sparse=sparse_relpath) + + self.write_config(dest_dir) def mixed_simple_base(self, dest_dir): """Create a mixed-use base externals file with only simple externals. @@ -197,7 +219,7 @@ def mixed_simple_base(self, dest_dir): self.create_section(SIMPLE_REPO_NAME, 'simp_hash', ref_hash='60b1cc1a38d63') - self._write_config(dest_dir) + self.write_config(dest_dir) def mixed_simple_sub(self, dest_dir): """Create a mixed-use sub externals file with only simple externals. @@ -211,9 +233,9 @@ def mixed_simple_sub(self, dest_dir): branch=REMOTE_BRANCH_FEATURE2, path=SUB_EXTERNALS_PATH) - self._write_config(dest_dir, filename=CFG_SUB_NAME) + self.write_config(dest_dir, filename=CFG_SUB_NAME) - def _write_config(self, dest_dir, filename=CFG_NAME): + def write_config(self, dest_dir, filename=CFG_NAME): """Write the configuration file to disk """ @@ -237,22 +259,41 @@ def create_metadata(self): self._schema_version) def create_section(self, repo_type, name, tag='', branch='', - ref_hash='', - required=True, path=EXTERNALS_NAME, externals=''): + ref_hash='', required=True, path=EXTERNALS_NAME, + externals='', repo_path=None, from_submodule=False, + sparse=''): + # pylint: disable=too-many-branches """Create a config section with autofilling some items and handling optional items. """ # pylint: disable=R0913 self._config.add_section(name) - self._config.set(name, ExternalsDescription.PATH, - os.path.join(path, name)) + if not from_submodule: + self._config.set(name, ExternalsDescription.PATH, + os.path.join(path, name)) self._config.set(name, ExternalsDescription.PROTOCOL, ExternalsDescription.PROTOCOL_GIT) - repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type) - self._config.set(name, ExternalsDescription.REPO_URL, repo_url) + # from_submodules is incompatible with some other options, turn them off + if (from_submodule and + ((repo_path is not None) or tag or ref_hash or branch)): + printlog('create_section: "from_submodule" is incompatible with ' + '"repo_url", "tag", "hash", and "branch" options;\n' + 'Ignoring those options for {}'.format(name)) + repo_url = None + tag = '' + ref_hash = '' + branch = '' + + if repo_path is not None: + repo_url = repo_path + else: + repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type) + + if not from_submodule: + self._config.set(name, ExternalsDescription.REPO_URL, repo_url) self._config.set(name, ExternalsDescription.REQUIRED, str(required)) @@ -268,6 +309,12 @@ def create_section(self, repo_type, name, tag='', branch='', if externals: self._config.set(name, ExternalsDescription.EXTERNALS, externals) + if sparse: + self._config.set(name, ExternalsDescription.SPARSE, sparse) + + if from_submodule: + self._config.set(name, ExternalsDescription.SUBMODULE, "True") + def create_section_ext_only(self, name, required=True, externals=CFG_SUB_NAME): """Create a config section with autofilling some items and handling @@ -377,7 +424,7 @@ def update_branch(self, dest_dir, name, branch, repo_type=None, except BaseException: pass - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) def update_svn_branch(self, dest_dir, name, branch, filename=CFG_NAME): """Update a repository branch, and potentially the remote. @@ -391,7 +438,7 @@ def update_svn_branch(self, dest_dir, name, branch, filename=CFG_NAME): except BaseException: pass - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) def update_tag(self, dest_dir, name, tag, repo_type=None, filename=CFG_NAME, remove_branch=True): @@ -416,7 +463,7 @@ def update_tag(self, dest_dir, name, tag, repo_type=None, except BaseException: pass - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) def update_underspecify_branch_tag(self, dest_dir, name, filename=CFG_NAME): @@ -435,7 +482,7 @@ def update_underspecify_branch_tag(self, dest_dir, name, except BaseException: pass - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) def update_underspecify_remove_url(self, dest_dir, name, filename=CFG_NAME): @@ -448,7 +495,7 @@ def update_underspecify_remove_url(self, dest_dir, name, except BaseException: pass - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) def update_protocol(self, dest_dir, name, protocol, repo_type=None, filename=CFG_NAME): @@ -461,7 +508,7 @@ def update_protocol(self, dest_dir, name, protocol, repo_type=None, repo_url = os.path.join('${MANIC_TEST_BARE_REPO_ROOT}', repo_type) self._config.set(name, ExternalsDescription.REPO_URL, repo_url) - self._write_config(dest_dir, filename) + self.write_config(dest_dir, filename) class BaseTestSysCheckout(unittest.TestCase): @@ -513,7 +560,7 @@ def tearDown(self): # return to our common starting point os.chdir(self._return_dir) - def setup_test_repo(self, parent_repo_name): + def setup_test_repo(self, parent_repo_name, dest_dir_in=None): """Setup the paths and clone the base test repo """ @@ -522,8 +569,12 @@ def setup_test_repo(self, parent_repo_name): print("Test repository name: {0}".format(test_dir_name)) parent_repo_dir = os.path.join(self._bare_root, parent_repo_name) - dest_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT], - test_dir_name) + if dest_dir_in is None: + dest_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT], + test_dir_name) + else: + dest_dir = dest_dir_in + # pylint: disable=W0212 GitRepository._git_clone(parent_repo_dir, dest_dir, VERBOSITY_DEFAULT) return dest_dir @@ -684,6 +735,14 @@ def _check_mixed_ext_branch_modified(self, tree, directory=EXTERNALS_NAME): name = './{0}/mixed_req'.format(directory) self._check_generic_modified_ok_required(tree, name) + def _check_simple_sparse_empty(self, tree, directory=EXTERNALS_NAME): + name = './{0}/simp_sparse'.format(directory) + self._check_generic_empty_default_required(tree, name) + + def _check_simple_sparse_ok(self, tree, directory=EXTERNALS_NAME): + name = './{0}/simp_sparse'.format(directory) + self._check_generic_ok_clean_required(tree, name) + # ---------------------------------------------------------------- # # Check results for groups of externals under specific conditions @@ -844,6 +903,23 @@ def _check_mixed_cont_simple_required_post_checkout(self, overall, tree): self._check_simple_branch_ok(tree, directory=EXTERNALS_NAME) self._check_simple_branch_ok(tree, directory=SUB_EXTERNALS_PATH) + def _check_container_sparse_pre_checkout(self, overall, tree): + self.assertEqual(overall, 0) + self._check_simple_tag_empty(tree) + self._check_simple_sparse_empty(tree) + + def _check_container_sparse_post_checkout(self, overall, tree): + self.assertEqual(overall, 0) + self._check_simple_tag_ok(tree) + self._check_simple_sparse_ok(tree) + + def _check_file_exists(self, repo_dir, pathname): + "Check that exists in " + self.assertTrue(os.path.exists(os.path.join(repo_dir, pathname))) + + def _check_file_absent(self, repo_dir, pathname): + "Check that does not exist in " + self.assertFalse(os.path.exists(os.path.join(repo_dir, pathname))) class TestSysCheckout(BaseTestSysCheckout): """Run systems level tests of checkout_externals @@ -1208,6 +1284,14 @@ def test_container_full(self): self.status_args) self._check_container_full_post_checkout(overall, tree) + # Check existance of some files + subrepo_path = os.path.join('externals', 'simp_tag') + self._check_file_exists(under_test_dir, + os.path.join(subrepo_path, 'readme.txt')) + self._check_file_absent(under_test_dir, os.path.join(subrepo_path, + 'simple_subdir', + 'subdir_file.txt')) + # update the mixed-use repo to point to different branch self._generator.update_branch(under_test_dir, 'mixed_req', 'new-feature', MIXED_REPO_NAME) @@ -1288,6 +1372,40 @@ def test_mixed_simple(self): self.status_args) self._check_mixed_cont_simple_required_post_checkout(overall, tree) + def test_container_sparse(self): + """Verify that 'full' container with simple subrepo + can run a sparse checkout and generate the correct initial status. + + """ + # create the test repository + under_test_dir = self.setup_test_repo(CONTAINER_REPO_NAME) + + # create the top level externals file + self._generator.container_sparse(under_test_dir) + + # inital checkout + overall, tree = self.execute_cmd_in_dir(under_test_dir, + self.checkout_args) + self._check_container_sparse_pre_checkout(overall, tree) + + overall, tree = self.execute_cmd_in_dir(under_test_dir, + self.status_args) + self._check_container_sparse_post_checkout(overall, tree) + + # Check existance of some files + subrepo_path = os.path.join('externals', 'simp_tag') + self._check_file_exists(under_test_dir, + os.path.join(subrepo_path, 'readme.txt')) + self._check_file_exists(under_test_dir, os.path.join(subrepo_path, + 'simple_subdir', + 'subdir_file.txt')) + subrepo_path = os.path.join('externals', 'simp_sparse') + self._check_file_exists(under_test_dir, + os.path.join(subrepo_path, 'readme.txt')) + self._check_file_absent(under_test_dir, os.path.join(subrepo_path, + 'simple_subdir', + 'subdir_file.txt')) + class TestSysCheckoutSVN(BaseTestSysCheckout): """Run systems level tests of checkout_externals accessing svn repositories @@ -1434,6 +1552,237 @@ def test_container_simple_svn(self): self.verbose_args) self._check_container_simple_svn_post_checkout(overall, tree) +class TestSubrepoCheckout(BaseTestSysCheckout): + # Need to store information at setUp time for checking + # pylint: disable=too-many-instance-attributes + """Run tests to ensure proper handling of repos with submodules. + + By default, submodules in git repositories are checked out. A git + repository checked out as a submodule is treated as if it was + listed in an external with the same properties as in the source + .gitmodules file. + """ + + def setUp(self): + """Setup for all submodule checkout tests + Create a repo with two submodule repositories. + """ + + # Run the basic setup + super(TestSubrepoCheckout, self).setUp() + # create test repo + # We need to do this here (rather than have a static repo) because + # git submodules do not allow for variables in .gitmodules files + self._test_repo_name = 'test_repo_with_submodules' + self._bare_branch_name = 'subrepo_branch' + self._config_branch_name = 'subrepo_config_branch' + self._container_extern_name = 'externals_container.cfg' + self._my_test_dir = os.path.join(os.environ[MANIC_TEST_TMP_REPO_ROOT], + self._test_id) + self._repo_dir = os.path.join(self._my_test_dir, self._test_repo_name) + self._checkout_dir = 'repo_with_submodules' + check_dir = self.setup_test_repo(CONTAINER_REPO_NAME, + dest_dir_in=self._repo_dir) + self.assertTrue(self._repo_dir == check_dir) + # Add the submodules + cwd = os.getcwd() + fork_repo_dir = os.path.join(self._bare_root, SIMPLE_FORK_NAME) + simple_repo_dir = os.path.join(self._bare_root, SIMPLE_REPO_NAME) + self._simple_ext_fork_name = SIMPLE_FORK_NAME.split('.')[0] + self._simple_ext_name = SIMPLE_REPO_NAME.split('.')[0] + os.chdir(self._repo_dir) + # Add a branch with a subrepo + cmd = ['git', 'branch', self._bare_branch_name, 'master'] + execute_subprocess(cmd) + cmd = ['git', 'checkout', self._bare_branch_name] + execute_subprocess(cmd) + cmd = ['git', 'submodule', 'add', fork_repo_dir] + execute_subprocess(cmd) + cmd = ['git', 'commit', '-am', "'Added simple-ext-fork as a submodule'"] + execute_subprocess(cmd) + # Save the fork repo hash for comparison + os.chdir(self._simple_ext_fork_name) + self._fork_hash_check = self.get_git_hash() + os.chdir(self._repo_dir) + # Now, create a branch to test from_sbmodule + cmd = ['git', 'branch', + self._config_branch_name, self._bare_branch_name] + execute_subprocess(cmd) + cmd = ['git', 'checkout', self._config_branch_name] + execute_subprocess(cmd) + cmd = ['git', 'submodule', 'add', simple_repo_dir] + execute_subprocess(cmd) + # Checkout feature2 + os.chdir(self._simple_ext_name) + cmd = ['git', 'branch', 'feature2', 'origin/feature2'] + execute_subprocess(cmd) + cmd = ['git', 'checkout', 'feature2'] + execute_subprocess(cmd) + # Save the fork repo hash for comparison + self._simple_hash_check = self.get_git_hash() + os.chdir(self._repo_dir) + self.create_externals_file(filename=self._container_extern_name, + dest_dir=self._repo_dir, from_submodule=True) + cmd = ['git', 'add', self._container_extern_name] + execute_subprocess(cmd) + cmd = ['git', 'commit', '-am', "'Added simple-ext as a submodule'"] + execute_subprocess(cmd) + # Reset to master + cmd = ['git', 'checkout', 'master'] + execute_subprocess(cmd) + os.chdir(cwd) + + @staticmethod + def get_git_hash(revision="HEAD"): + """Return the hash for """ + cmd = ['git', 'rev-parse', revision] + git_out = execute_subprocess(cmd, output_to_caller=True) + return git_out.strip() + + def create_externals_file(self, name='', filename=CFG_NAME, dest_dir=None, + branch_name=None, sub_externals=None, + from_submodule=False): + # pylint: disable=too-many-arguments + """Create a container externals file with only simple externals. + + """ + self._generator.create_config() + + if dest_dir is None: + dest_dir = self._my_test_dir + + if from_submodule: + self._generator.create_section(SIMPLE_FORK_NAME, + self._simple_ext_fork_name, + from_submodule=True) + self._generator.create_section(SIMPLE_REPO_NAME, + self._simple_ext_name, + branch='feature3', path='', + from_submodule=False) + else: + if branch_name is None: + branch_name = 'master' + + self._generator.create_section(self._test_repo_name, + self._checkout_dir, + branch=branch_name, + path=name, externals=sub_externals, + repo_path=self._repo_dir) + + self._generator.write_config(dest_dir, filename=filename) + + def idempotence_check(self, checkout_dir): + """Verify that calling checkout_externals and + checkout_externals --status does not cause errors""" + cwd = os.getcwd() + os.chdir(checkout_dir) + overall, _ = self.execute_cmd_in_dir(self._my_test_dir, + self.checkout_args) + self.assertTrue(overall == 0) + overall, _ = self.execute_cmd_in_dir(self._my_test_dir, + self.status_args) + self.assertTrue(overall == 0) + os.chdir(cwd) + + def test_submodule_checkout_bare(self): + """Verify that a git repo with submodule is properly checked out + This test if for where there is no 'externals' keyword in the + parent repo. + Correct behavior is that the submodule is checked out using + normal git submodule behavior. + """ + simple_ext_fork_tag = "(tag1)" + simple_ext_fork_status = " " + self.create_externals_file(branch_name=self._bare_branch_name) + overall, _ = self.execute_cmd_in_dir(self._my_test_dir, + self.checkout_args) + self.assertTrue(overall == 0) + cwd = os.getcwd() + checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) + fork_file = os.path.join(checkout_dir, + self._simple_ext_fork_name, "readme.txt") + self.assertTrue(os.path.exists(fork_file)) + os.chdir(checkout_dir) + submods = git_submodule_status(checkout_dir) + self.assertEqual(len(submods.keys()), 1) + self.assertTrue(self._simple_ext_fork_name in submods) + submod = submods[self._simple_ext_fork_name] + self.assertTrue('hash' in submod) + self.assertEqual(submod['hash'], self._fork_hash_check) + self.assertTrue('status' in submod) + self.assertEqual(submod['status'], simple_ext_fork_status) + self.assertTrue('tag' in submod) + self.assertEqual(submod['tag'], simple_ext_fork_tag) + os.chdir(cwd) + self.idempotence_check(checkout_dir) + + def test_submodule_checkout_none(self): + """Verify that a git repo with submodule is properly checked out + This test is for when 'externals=None' is in parent repo's + externals cfg file. + Correct behavior is the submodle is not checked out. + """ + self.create_externals_file(branch_name=self._bare_branch_name, + sub_externals="none") + overall, _ = self.execute_cmd_in_dir(self._my_test_dir, + self.checkout_args) + self.assertTrue(overall == 0) + cwd = os.getcwd() + checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) + fork_file = os.path.join(checkout_dir, + self._simple_ext_fork_name, "readme.txt") + self.assertFalse(os.path.exists(fork_file)) + os.chdir(cwd) + self.idempotence_check(checkout_dir) + + def test_submodule_checkout_config(self): # pylint: disable=too-many-locals + """Verify that a git repo with submodule is properly checked out + This test if for when the 'from_submodule' keyword is used in the + parent repo. + Correct behavior is that the submodule is checked out using + normal git submodule behavior. + """ + tag_check = None # Not checked out as submodule + status_check = "-" # Not checked out as submodule + self.create_externals_file(branch_name=self._config_branch_name, + sub_externals=self._container_extern_name) + overall, _ = self.execute_cmd_in_dir(self._my_test_dir, + self.checkout_args) + self.assertTrue(overall == 0) + cwd = os.getcwd() + checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) + fork_file = os.path.join(checkout_dir, + self._simple_ext_fork_name, "readme.txt") + self.assertTrue(os.path.exists(fork_file)) + os.chdir(checkout_dir) + # Check submodule status + submods = git_submodule_status(checkout_dir) + self.assertEqual(len(submods.keys()), 2) + self.assertTrue(self._simple_ext_fork_name in submods) + submod = submods[self._simple_ext_fork_name] + self.assertTrue('hash' in submod) + self.assertEqual(submod['hash'], self._fork_hash_check) + self.assertTrue('status' in submod) + self.assertEqual(submod['status'], status_check) + self.assertTrue('tag' in submod) + self.assertEqual(submod['tag'], tag_check) + self.assertTrue(self._simple_ext_name in submods) + submod = submods[self._simple_ext_name] + self.assertTrue('hash' in submod) + self.assertEqual(submod['hash'], self._simple_hash_check) + self.assertTrue('status' in submod) + self.assertEqual(submod['status'], status_check) + self.assertTrue('tag' in submod) + self.assertEqual(submod['tag'], tag_check) + # Check fork repo status + os.chdir(self._simple_ext_fork_name) + self.assertEqual(self.get_git_hash(), self._fork_hash_check) + os.chdir(checkout_dir) + os.chdir(self._simple_ext_name) + hash_check = self.get_git_hash('origin/feature3') + self.assertEqual(self.get_git_hash(), hash_check) + os.chdir(cwd) + self.idempotence_check(checkout_dir) class TestSysCheckoutErrors(BaseTestSysCheckout): """Run systems level tests of error conditions in checkout_externals diff --git a/manage_externals/test/test_sys_repository_git.py b/test/test_sys_repository_git.py similarity index 100% rename from manage_externals/test/test_sys_repository_git.py rename to test/test_sys_repository_git.py diff --git a/manage_externals/test/test_unit_externals_description.py b/test/test_unit_externals_description.py similarity index 96% rename from manage_externals/test/test_unit_externals_description.py rename to test/test_unit_externals_description.py index 5de60e4f35..637f760ee5 100644 --- a/manage_externals/test/test_unit_externals_description.py +++ b/test/test_unit_externals_description.py @@ -316,11 +316,13 @@ def setUp(self): """Create config object used as basis for all tests """ self._config = config_parser() + self._gmconfig = config_parser() self.setup_config() def setup_config(self): """Boiler plate construction of xml string for componet 1 """ + # Create a standard externals config with a single external name = 'test' self._config.add_section(name) self._config.set(name, ExternalsDescription.PATH, 'externals') @@ -332,6 +334,14 @@ def setup_config(self): self._config.add_section(DESCRIPTION_SECTION) self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.0') + # Create a .gitmodules test + name = 'submodule "gitmodules_test"' + self._gmconfig.add_section(name) + self._gmconfig.set(name, "path", 'externals/test') + self._gmconfig.set(name, "url", '/path/to/repo') + # NOTE(goldy, 2019-03) Should test other possible keywords such as + # fetchRecurseSubmodules, ignore, and shallow + def test_cfg_v1_ok(self): """Test that a correct cfg v1 object is created by create_externals_description @@ -356,7 +366,7 @@ def test_dict(self): rdata = {ExternalsDescription.PROTOCOL: 'git', ExternalsDescription.REPO_URL: '/path/to/repo', ExternalsDescription.TAG: 'tagv1', - } + } desc = { 'test': { diff --git a/manage_externals/test/test_unit_externals_status.py b/test/test_unit_externals_status.py similarity index 100% rename from manage_externals/test/test_unit_externals_status.py rename to test/test_unit_externals_status.py diff --git a/manage_externals/test/test_unit_repository.py b/test/test_unit_repository.py similarity index 87% rename from manage_externals/test/test_unit_repository.py rename to test/test_unit_repository.py index 2152503c2d..5b9c242fd3 100644 --- a/manage_externals/test/test_unit_repository.py +++ b/test/test_unit_repository.py @@ -36,7 +36,8 @@ def setUp(self): ExternalsDescription.REPO_URL: 'junk_root', ExternalsDescription.TAG: 'junk_tag', ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, } + ExternalsDescription.HASH: EMPTY_STR, + ExternalsDescription.SPARSE: EMPTY_STR, } def test_create_repo_git(self): """Verify that several possible names for the 'git' protocol @@ -95,7 +96,8 @@ def test_tag(self): ExternalsDescription.REPO_URL: url, ExternalsDescription.TAG: tag, ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, } + ExternalsDescription.HASH: EMPTY_STR, + ExternalsDescription.SPARSE: EMPTY_STR, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.tag(), tag) @@ -112,7 +114,8 @@ def test_branch(self): ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: branch, ExternalsDescription.TAG: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, } + ExternalsDescription.HASH: EMPTY_STR, + ExternalsDescription.SPARSE: EMPTY_STR, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.branch(), branch) @@ -125,11 +128,13 @@ def test_hash(self): protocol = 'test_protocol' url = 'test_url' ref = 'deadc0de' + sparse = EMPTY_STR repo_info = {ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: EMPTY_STR, ExternalsDescription.TAG: EMPTY_STR, - ExternalsDescription.HASH: ref, } + ExternalsDescription.HASH: ref, + ExternalsDescription.SPARSE: sparse, } repo = Repository(name, repo_info) print(repo.__dict__) self.assertEqual(repo.hash(), ref) @@ -146,11 +151,13 @@ def test_tag_branch(self): branch = 'test_branch' tag = 'test_tag' ref = EMPTY_STR + sparse = EMPTY_STR repo_info = {ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: branch, ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, } + ExternalsDescription.HASH: ref, + ExternalsDescription.SPARSE: sparse, } with self.assertRaises(RuntimeError): Repository(name, repo_info) @@ -165,11 +172,13 @@ def test_tag_branch_hash(self): branch = 'test_branch' tag = 'test_tag' ref = 'deadc0de' + sparse = EMPTY_STR repo_info = {ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: branch, ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, } + ExternalsDescription.HASH: ref, + ExternalsDescription.SPARSE: sparse, } with self.assertRaises(RuntimeError): Repository(name, repo_info) @@ -184,11 +193,13 @@ def test_no_tag_no_branch(self): branch = EMPTY_STR tag = EMPTY_STR ref = EMPTY_STR + sparse = EMPTY_STR repo_info = {ExternalsDescription.PROTOCOL: protocol, ExternalsDescription.REPO_URL: url, ExternalsDescription.BRANCH: branch, ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, } + ExternalsDescription.HASH: ref, + ExternalsDescription.SPARSE: sparse, } with self.assertRaises(RuntimeError): Repository(name, repo_info) diff --git a/manage_externals/test/test_unit_repository_git.py b/test/test_unit_repository_git.py similarity index 99% rename from manage_externals/test/test_unit_repository_git.py rename to test/test_unit_repository_git.py index b025fbd429..4a0a334bb1 100644 --- a/manage_externals/test/test_unit_repository_git.py +++ b/test/test_unit_repository_git.py @@ -547,7 +547,8 @@ def setUp(self): ExternalsDescription.TAG: 'very_useful_tag', ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, } + ExternalsDescription.HASH: EMPTY_STR, + ExternalsDescription.SPARSE: EMPTY_STR, } self._repo = GitRepository('test', self._rdata) def test_remote_git_proto(self): diff --git a/manage_externals/test/test_unit_repository_svn.py b/test/test_unit_repository_svn.py similarity index 100% rename from manage_externals/test/test_unit_repository_svn.py rename to test/test_unit_repository_svn.py diff --git a/manage_externals/test/test_unit_utils.py b/test/test_unit_utils.py similarity index 100% rename from manage_externals/test/test_unit_utils.py rename to test/test_unit_utils.py diff --git a/test/tools/CLM_compare.sh b/test/tools/CLM_compare.sh deleted file mode 100755 index 38f547c3ab..0000000000 --- a/test/tools/CLM_compare.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "CLM_compare.sh: incorrect number of input arguments" - exit 1 -fi - -echo "CLM_compare.sh: comparing $1 " -echo " with $2" - -##note syntax here as stderr and stdout from cprnc command go -##to separate places! -${CPRNC_EXE} ${CPRNC_OPT} $1 $2 2>&1 > cprnc.out -rc=$? -if [ $rc -ne 0 ]; then - echo "CLM_compare.sh: error doing comparison, cprnc error= $rc" - exit 2 -fi - -result_old=`perl -e 'while (my $ll = <>) \ - { if ($ll =~ /(\d+)[^0-9]+compared[^0-9]+(\d+)/) \ - { print "PASS" if $1>0 && $2==0 }}' cprnc.out` -if grep -c "the two files seem to be IDENTICAL" cprnc.out > /dev/null; then - result=PASS -elif grep -c "the two files seem to be DIFFERENT" cprnc.out > /dev/null; then - result=FAIL -else - result=$result_old -fi - -if [ "$result" = "PASS" ]; then - echo "CLM_compare.sh: files are b4b" -else - echo "CLM_compare.sh: files are NOT b4b" - exit 3 -fi - -exit 0 diff --git a/test/tools/Makefile b/test/tools/Makefile deleted file mode 100644 index b5031abdba..0000000000 --- a/test/tools/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# -# Makefile to build clm testing documentation -# - -# Get list of tests_ files -SOURCES = $(wildcard tests_*) - -all: test_table.html - -test_table.html: $(SOURCES) - gen_test_table.sh - diff --git a/test/tools/README b/test/tools/README deleted file mode 100644 index 4929144b20..0000000000 --- a/test/tools/README +++ /dev/null @@ -1,55 +0,0 @@ -$CTSMROOT/clm/test/tools/README 06/08/2018 - -Scripts for testing the CLM support tools with many different -configurations and run-time options. - -I. MAIN SCRIPTS: - -test_driver.sh - Test the CLM offline tools - -To use... - -./test_driver.sh -i - -on cheyenne - -qcmd -l walltime=06:00:00 -- ./test_driver.sh -i >& run.out & - -Intended for use on NCAR machines cheyenne, geyser (DAV) and hobart. - -II. RUNNING test_driver.sh TOOLS TESTING: - -Basic use: - -./test_driver.sh -i -./test_driver.sh -h # to get help on options - -Important environment variables (just used by test_driver.sh) - -BL_ROOT ---------------- Root directory of CLM baseline code to compare to - (if not set BL test will not be performed) -BL_TESTDIR ------------- Root directory of where to put baseline tests -CLM_INPUT_TESTS -------- Filename of file with list of tests to perform -CLM_TESTDIR ------------ Root directory of where to put most tests -CLM_RETAIN_FILES ------- If set to TRUE -- don't cleanup files after testing -CLM_FC ----------------- Use given compiler -CLM_JOBID -------------- Job identification number to use (rather than process ID) -CLM_THREADS ------------ Number of open-MP threads to use - (by default this is set differently by machine) -CLM_SOFF --------------- If set to TRUE -- stop on first failed test (default FALSE) - -Important files for test_driver tools testing: - -test_driver.sh ------- Main test script for tools -nl_files ------------- Directory with various namelists to test -config_files --------- Directory with various configurations to test -input_tests_master --- Master list of tests -tests_pretag_* ------- Tests for specific machines to do by default before a tag is done -tests_posttag_* ------ Tests for specific machines to do for more extensive testing - after a tag is done -CLM_compare.sh ------- Compares output history files between two cases -T*.sh ---------------- Basic test script to do a specific type of test -gen_test_table.sh ---- Creates HTML table of tests -Makefile ------------- Will build the HTML table of tests - -../../tools/README.testing - Information on how the testing works for the CLM tools diff --git a/test/tools/README.testnames b/test/tools/README.testnames deleted file mode 100644 index b6c18d406b..0000000000 --- a/test/tools/README.testnames +++ /dev/null @@ -1,55 +0,0 @@ -Tests for test_driver are for the CLM tools only. - -Test naming conventions for the test_driver.sh script: - -Test names are: - -xxnmi - -Where: xx is the two-letter test type - sm=smoke, br=branch, er=exact restart, bl=base-line comparision, - cb=configure-build, rp=reproducibility, op=OpenMP threading for tools - -n is the configuration type: - -1 -- unused -2 -- unused -3 -- unused -4 -- unused -5 -- unused -6 -- unused -7 -- unused -8 -- unused -9 -- unused -0 -- unused -a -- unused -b -- unused -c -- mkprocdata_map clm4.5 -d -- mkmapgrids clm4.5 -e -- gen_domain clm4.5 -f -- PTCLM clm4.5 -g -- mksurfdata_map clm4.5 -h -- interpinic clm4.5 -i -- tools scripts clm4.5 - -m is the resolution - -1 -- 48x96 -5 -- 10x15 -7 -- 1x1 brazil -8 -- US-UMB -9 -- 4x5 -c -- US-UMB with cycling on forcing and transient use-case -g -- US-UMB with global forcing and grid PFT and soil -y -- 1.9x2.5 with transient 1850-2100 for rcp=2.6 and glacier-MEC on -Z -- 10x15 with crop on -@ -- ne120np4 -# -- ne30np4 - -i is the specific test (usually this implies...) - -3 -- OpenMP only -4 -- serial -7 -- OpenMP only second test (without DEBUG compiler mode on) - - diff --git a/test/tools/TBLCFGtools.sh b/test/tools/TBLCFGtools.sh deleted file mode 100755 index 6276c885e2..0000000000 --- a/test/tools/TBLCFGtools.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBL.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -tool=$(basename $1) -test_name=TBLCFGtools.$tool.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLCFGtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLCFGtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLCFGtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLCFGtools.sh: calling TSMCFGtools.sh to run $tool executable" -${CLM_SCRIPTDIR}/TSMCFGtools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLCFGtools.sh: error from TSMCFGtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLCFGtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLCFGtools.sh: calling ****baseline**** TSMCFGtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_ROOT=${BL_ROOT} \ - CLM_SCRIPTDIR=$bl_dir \ - $bl_dir/TSMCFGtools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLCFGtools.sh: error from *baseline* TSMCFGtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLCFGtools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMCFGtools.$tool.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLCFGtools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMCFGtools.$tool.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMCFGtools.$tool.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLCFGtools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLCFGtools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details -" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLCFGtools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLCFGtools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLCFGtools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - -exit 0 diff --git a/test/tools/TBLscript_tools.sh b/test/tools/TBLscript_tools.sh deleted file mode 100755 index 284ac710d1..0000000000 --- a/test/tools/TBLscript_tools.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLscript_tools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBLscript_tools.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -test_name=TBLscript_tools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLscript_tools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLscript_tools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLscript_tools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLscript_tools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLscript_tools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLscript_tools.sh: calling TSMscript_tools.sh to run $1 executable" -${CLM_SCRIPTDIR}/TSMscript_tools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLscript_tools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLscript_tools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLscript_tools.sh: calling ****baseline**** TSMtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_SCRIPTDIR=$bl_dir \ - CLM_ROOT=$BL_ROOT \ - CTSM_ROOT=$BL_ROOT \ - CIME_ROOT=$BL_ROOT/cime \ - $bl_dir/TSMscript_tools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLscript_tools.sh: error from *baseline* TSMscript_tools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLscript_tools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLscript_tools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - # For PTCLM, skip comparisons of mapping files, since these aren't really - # necessary, take a lot of time, and cprnc.pl can crash if there are mapping - # files with 0 overlaps - if [[ "$2" == "PTCLM" ]]; then - if [[ "$compare_file" == map* ]]; then - echo "SKIPPING: $compare_file" - continue - fi - fi - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLscript_tools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLscript_tools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details" - all_comparisons_good="FALSE" - fi -done -# Compare text files for PTCLM if they exist -files_to_compare=`cd ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3; ls README*` -for compare_file in ${files_to_compare}; do - - diff \ - ${BL_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} \ - > diff.${compare_file}.out - rc=$? - if [ $rc -eq 0 ]; then - echo "TBLscript_tools.sh: comparison successful; output in ${rundir}/diff.${compare_file}.out" - else - echo "TBLscript_tools.sh: error from CLM_compare.sh= $rc; see ${rundir}/diff.${compare_file}.out for details" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLscript_tools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLscript_tools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLscript_tools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - - - -exit 0 diff --git a/test/tools/TBLtools.sh b/test/tools/TBLtools.sh deleted file mode 100755 index 555ea7d1be..0000000000 --- a/test/tools/TBLtools.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLtools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBL.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -test_name=TBLtools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLtools.sh: calling TSMtools.sh to run $1 executable" -${CLM_SCRIPTDIR}/TSMtools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLtools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLtools.sh: calling ****baseline**** TSMtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_ROOT=${BL_ROOT} \ - CLM_SCRIPTDIR=$bl_dir \ - $bl_dir/TSMtools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLtools.sh: error from *baseline* TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLtools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMtools.$1.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLtools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMtools.$1.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMtools.$1.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLtools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLtools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details -" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLtools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLtools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLtools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - -exit 0 diff --git a/test/tools/TCBCFGtools.sh b/test/tools/TCBCFGtools.sh deleted file mode 100755 index 5c0b015123..0000000000 --- a/test/tools/TCBCFGtools.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "TCBCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -tool=$(basename $1) -test_name=TCBCFGtools.$tool.$2 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBCFGtools.sh: build test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TCBCFGtools.sh: build test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TCBCFGtools.sh: this build test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}` -if [ $? -ne 0 ];then - cfgdir=`ls -1d ${CIME_ROOT}/tools/mapping/${1}*` - echo "use: $cfgdir" -fi -blddir=${CLM_TESTDIR}/${test_name}/src -if [ -d ${blddir} ]; then - rm -r ${blddir} -fi -mkdir -p ${blddir} -if [ $? -ne 0 ]; then - echo "TCBCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${blddir} - -echo "TCBCFGtools.sh: building $tool executable; output in ${blddir}/test.log" -# -# Copy build files over -# -cp $cfgdir/src/Makefile . -cp $cfgdir/src/Filepath . -# -# Add cfgdir path to beginning of each path in Filepath -# -touch Filepath -while read filepath_arg; do - echo "${cfgdir}/src/${filepath_arg}" >> Filepath -done < ${cfgdir}/src/Filepath - -# -# Figure out configuration -# -if [ ! -f ${CLM_SCRIPTDIR}/config_files/$tool ]; then - echo "TCB.sh: configure options file ${CLM_SCRIPTDIR}/config_files/$tool not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -##construct string of args to configure -config_string=" " -while read config_arg; do - config_string="${config_string}${config_arg} " -done < ${CLM_SCRIPTDIR}/config_files/$tool - -if [ "$TOOLSLIBS" != "" ]; then - export SLIBS=$TOOLSLIBS -fi -echo "env CIMEROOT=$CLM_ROOT/cime COMPILER=$CESM_COMP $config_string $CLM_ROOT/cime/tools/configure --macros-format Makefile --machine $CESM_MACH $TOOLS_CONF_STRING" -env CIMEROOT=$CLM_ROOT/cime COMPILER=$CESM_COMP $config_string $CLM_ROOT/cime/tools/configure --macros-format Makefile --machine $CESM_MACH $TOOLS_CONF_STRING >> test.log 2>&1 -rc=$? -if [ $rc -ne 0 ]; then - echo "TCBCFGtools.sh: configure failed, error from configure= $rc" - echo "TCBCFGtools.sh: see ${blddir}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -. $INITMODULES -. ./.env_mach_specific.sh - -attempt=1 -still_compiling="TRUE" -while [ $still_compiling = "TRUE" ]; do - - echo "TCBCFGtools.sh: call to make:" - echo " ${MAKE_CMD} USER_CPPDEFS=-DLINUX" - if [ "$debug" != "YES" ]; then - ${MAKE_CMD} USER_CPPDEFS=-DLINUX >> test.log 2>&1 - status="PASS" - rc=$? - else - status="GEN" - rc=0 - fi - if [ $rc -eq 0 ]; then - echo "TCBCFGtools.sh: make was successful" - echo "TCBCFGtools.sh: configure and build test passed" - echo "$status" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TCBCFGtools.sh: removing some unneeded files to save disc space" - rm *.o - rm *.mod - fi - still_compiling="FALSE" - elif [ $attempt -lt 10 ] && \ - grep -c "LICENSE MANAGER PROBLEM" test.log > /dev/null; then - attempt=`expr $attempt + 1` - echo "TCBCFGtools.sh: encountered License Manager Problem; launching attempt #$attempt" - else - echo "TCBCFGtools.sh: clm build failed, error from make= $rc" - echo "TCBCFGtools.sh: see ${blddir}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 - fi -done -if [ "$TOOLSLIBS" != "" ]; then - export -n SLIBS -fi - -exit 0 diff --git a/test/tools/TCBscripttools.sh b/test/tools/TCBscripttools.sh deleted file mode 100755 index 2605f4b5c4..0000000000 --- a/test/tools/TCBscripttools.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "TCBscripttools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TCBscripttools.$1.$2 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBscripttools.sh: build test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBscripttools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TCBscripttools.sh: build test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TCBscripttools.sh: this build test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -blddir=${CLM_TESTDIR}/${test_name} -if [ -d ${blddir} ]; then - rm -r ${blddir} -fi -mkdir -p ${blddir} -if [ $? -ne 0 ]; then - echo "TCBscripttools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${blddir} - -echo "TCBscripttools.sh: building $1 executables; output in ${blddir}/test.log" -# -# Build script to exercise -# -if [ ! -x ${cfgdir}/$2 ]; then - echo "TCB.sh: build run script file ${cfgdir}/$2 not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -echo "TCBscripttools.sh: run the build scriptmake:" -echo " ${cfgdir}/$2" - -if [ "$debug" != "YES" ]; then - export CTSM_ROOT=${CLM_ROOT} - export CIME_ROOT=${CLM_ROOT}/cime - ${cfgdir}/$2 >> test.log 2>&1 - rc=$(( $rc + $? )) - status="PASS" -else - status="GEN" - rc=0 -fi -if [ $rc -eq 0 ]; then - echo "TCBscripttools.sh: build script was successful" - echo "TCBscripttools.sh: build script test passed" - echo "$status" > TestStatus -else - echo "TCBscripttools.sh: clm build script failed, error from build script= $rc" - echo "TCBscripttools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TCBtools.sh b/test/tools/TCBtools.sh deleted file mode 100755 index b0ea9e4a87..0000000000 --- a/test/tools/TCBtools.sh +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "TCBtools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TCBtools.$1.$2 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBtools.sh: build test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TCBtools.sh: build test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TCBtools.sh: this build test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -blddir=${CLM_TESTDIR}/${test_name}/src -if [ -d ${blddir} ]; then - rm -r ${blddir} -fi -mkdir -p ${blddir} -if [ $? -ne 0 ]; then - echo "TCBtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${blddir} - -echo "TCBtools.sh: building $1 executable; output in ${blddir}/test.log" -# -# Copy build files over -# -cp $cfgdir/src/Makefile . -cp $cfgdir/src/Srcfiles . -cp $cfgdir/src/Mkdepends . -cp $cfgdir/src/Makefile.common . -# -# Add cfgdir path to beginning of each path in Filepath -# -touch Filepath -while read filepath_arg; do - echo "${cfgdir}/src/${filepath_arg}" >> Filepath -done < ${cfgdir}/src/Filepath - -# -# Figure out configuration -# -if [ ! -f ${CLM_SCRIPTDIR}/config_files/$2 ]; then - echo "TCB.sh: configure options file ${CLM_SCRIPTDIR}/config_files/$2 not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -##construct string of args to configure -config_string="$TOOLS_MAKE_STRING TOOLROOT=$cfgdir " -while read config_arg; do - config_string="${config_string}${config_arg} " -done < ${CLM_SCRIPTDIR}/config_files/$2 - -attempt=1 -still_compiling="TRUE" -if [ "$TOOLSLIBS" != "" ]; then - export SLIBS=$TOOLSLIBS -fi -while [ $still_compiling = "TRUE" ]; do - - if [ "$2" = "gen_domain" ]; then - HOSTNAME=`uname -n | cut -c 1-2` - if [ "$HOSTNAME" = "be" ]; then - echo "TCBtools.sh: run configure for gen_domain on bluefire" - env CIMEROOT=${CLM_ROOT}/cime ${CLM_ROOT}/cime/tools/configure -mach bluefire >> test.log 2>&1 - rc=$? - fi - fi - - ln -s Macros.make Macros - - echo "TCBtools.sh: call to make:" - echo " ${MAKE_CMD} ${config_string} " - if [ "$debug" != "YES" ]; then - ${MAKE_CMD} ${config_string} >> test.log 2>&1 - status="PASS" - rc=$(( $rc + $? )) - else - status="GEN" - rc=0 - fi - if [ $rc -eq 0 ]; then - echo "TCBtools.sh: make was successful" - echo "TCBtools.sh: configure and build test passed" - echo "$status" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TCBtools.sh: removing some unneeded files to save disc space" - rm *.o - rm *.mod - fi - still_compiling="FALSE" - elif [ $attempt -lt 10 ] && \ - grep -c "LICENSE MANAGER PROBLEM" test.log > /dev/null; then - attempt=`expr $attempt + 1` - echo "TCBtools.sh: encountered License Manager Problem; launching attempt #$attempt" - else - echo "TCBtools.sh: clm build failed, error from make= $rc" - echo "TCBtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 - fi -done -if [ "$TOOLSLIBS" != "" ]; then - export -n SLIBS -fi - -exit 0 diff --git a/test/tools/TOPtools.sh b/test/tools/TOPtools.sh deleted file mode 100755 index c8efb440a2..0000000000 --- a/test/tools/TOPtools.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TOPtools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TOPtools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TOPtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TOPtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TOPtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TOPtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TOPtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -if [ ${CLM_THREADS} -lt 2 ]; then - echo "TOPtools.sh: error not enough threads are being used to do the comparision" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi -if [ "$2" != "tools__o" ] && [ "$2" != "tools__do" ]; then - echo "TOPtools.sh: error build needs to be done Open-MP" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -echo "TOPtools.sh: calling TSMtools.sh to run $1 executable" -${CLM_SCRIPTDIR}/TSMtools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TOPtools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi -mkdir $rundir/$CLM_THREADS -cp ${CLM_TESTDIR}/TSMtools.$1.$2.$3/*.nc $rundir/$CLM_THREADS - -# Get a list of different threads to run for, powers of 2 from 1 up to the thread count -threads=1 -list="1 " -until [ "$threads" -ge "$CLM_THREADS" ]; do - threads=`perl -e "$CLM_THREADS<$threads*2 ? print $CLM_THREADS : print $threads*2"` - if [ "$threads" -lt "$CLM_THREADS" ]; then list="$list $threads "; fi -done - -all_comparisons_good="TRUE" -for threads in $list -do - echo "TOPtools.sh: calling TSMtools.sh to run $1 executable for $threads threads" - env CLM_THREADS=$threads CLM_RERUN=yes ${CLM_SCRIPTDIR}/TSMtools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TOPtools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 - fi - mkdir $rundir/$threads - cp ${CLM_TESTDIR}/TSMtools.$1.$2.$3/*.nc $rundir/$threads - files_to_compare=`cd $rundir/$threads; ls *.nc` - for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - $rundir/$CLM_THREADS/${compare_file} \ - $rundir/$threads/${compare_file} - rc=$? - cprout="cprnc.${compare_file}.threads${threads}.out" - mv cprnc.out $cprout - if [ $rc -eq 0 ]; then - echo "TOPtools.sh: comparison successful; output in $cprout" - else - echo "TOPtools.sh: error from CLM_compare.sh= $rc; see $cprout for details" - all_comparisons_good="FALSE" - fi - done -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TOPtools.sh: OpenMP comparison test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TOPtools.sh: removing some unneeded files to save disc space" - rm */*.nc - fi -else - echo "TOPtools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - -exit 0 diff --git a/test/tools/TSMCFGtools.sh b/test/tools/TSMCFGtools.sh deleted file mode 100755 index b667a4c6ec..0000000000 --- a/test/tools/TSMCFGtools.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -tool=$(basename $1) -test_name=TSMCFGtools.$tool.$2.$3 - - -if [ -z "$CLM_RERUN" ]; then - CLM_RERUN="no" -fi - -if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMCFGtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMCFGtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMCFGtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}*` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TSMCFGtools.sh: calling TCBCFGtools.sh to prepare $tool executable" -${CLM_SCRIPTDIR}/TCBCFGtools.sh $1 $2 -rc=$? -if [ $rc -ne 0 ]; then - echo "TSMCFGtools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -echo "TSMCFGtools.sh: running $tool output in ${rundir}/test.log" - -if [ "$2" = "CFGtools__o" ] || [ "$2" = "CFGtools__do" ]; then - toolrun="env OMP_NUM_THREADS=${CLM_THREADS} ${CLM_TESTDIR}/TCBCFGtools.$tool.$2/${tool}*" -else - toolrun="${CLM_TESTDIR}/TCBCFGtools.$tool.$2/${tool}*" -fi - -runfile="${CLM_SCRIPTDIR}/nl_files/$tool.$3" -if [ ! -f "${runfile}" ]; then - echo "TSMCFGtools.sh: error ${runfile} input run file not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -echo "Run file type = ${3#*.}" -if [ ${3#*.} == "runoptions" ]; then - runopts=`cat ${runfile} | sed -e "s|CSMDATA|$CSMDATA|g"` - echo "$toolrun $runopts" - cp $cfgdir/*.nc . - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun $runopts >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -else - echo "$toolrun < ${runfile}" - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun < ${runfile} >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully created " test.log > /dev/null; then - echo "TSMCFGtools.sh: smoke test passed" - echo "$status" > TestStatus -else - echo "TSMCFGtools.sh: error running $tool, error= $rc" - echo "TSMCFGtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TSMncl_tools.sh b/test/tools/TSMncl_tools.sh deleted file mode 100755 index eb82142e4d..0000000000 --- a/test/tools/TSMncl_tools.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 1 ]; then - echo "TSMncl_tools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TSMncl_tools.$1 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMncl_tools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMncl_tools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMncl_tools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMncl_tools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1/ncl_scripts` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMncl_tools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TSMncl_tools.sh: running $1 output in ${rundir}/test.log" - -if [ ! -f "${cfgdir}/$1.ncl" ]; then - echo "TSMncl_tools.sh: error ${cfgdir}/$1.ncl input script not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - ncl ${cfgdir}/$1.ncl >> test.log 2>&1 - status="PASS" - rc=$? -else - echo "success" > test.log - status="GEN" - rc=0 -fi - -if [ $rc -eq 0 ] && grep -ci "success" test.log > /dev/null; then - echo "TSMncl_tools.sh: smoke test passed" - echo "$status" > TestStatus -else - echo "TSMncl_tools.sh: error running $1, error= $rc" - echo "TSMncl_tools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TSMscript_tools.sh b/test/tools/TSMscript_tools.sh deleted file mode 100755 index 360ecf86a4..0000000000 --- a/test/tools/TSMscript_tools.sh +++ /dev/null @@ -1,114 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMscript_tools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TSMscript_tools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMscript_tools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMscript_tools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMscript_tools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMscript_tools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMscript_tools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -# Copy any sample files so can use them -cp $cfgdir/sample_* $rundir - -optfile=${3%^*} -cfgfile=${3#*^} - -if [[ "$1" == "PTCLM" ]]; then - echo "TSMscript_tools.sh: calling TCBscripttools.sh to prepare executables for $1" - ${CLM_SCRIPTDIR}/TCBscripttools.sh $1 $cfgfile - rc=$? - if [ $rc -ne 0 ]; then - echo "TSMscript_tools.sh: error from TCBscripttools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 - fi - # Copy map files so we can use them - subdir=1x1pt_US-UMB - mkdir $rundir/$subdir - cp $CSMDATA/lnd/clm2/PTCLMmydatafiles.c171024/$subdir/map_* $rundir/$subdir -elif [ "$optfile" != "$3" ]; then - echo "TSMscript_tools.sh: calling TCBtools.sh to prepare $1 executable" - ${CLM_SCRIPTDIR}/TCBtools.sh $1 $cfgfile - rc=$? - if [ $rc -ne 0 ]; then - echo "TSMscript_tools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 - fi - tcbtools=${CLM_TESTDIR}/TCBtools.$1.$cfgfile -else - tcbtools="." -fi - -scopts=`cat ${CLM_SCRIPTDIR}/nl_files/$optfile | sed -e "s|CSMDATA|$CSMDATA|g" | sed -e "s|EXEDIR|$tcbtools|" | sed -e "s|CFGDIR|$cfgdir|g"` -scopts=`echo $scopts | sed -e "s|CTSM_ROOT|$CTSM_ROOT|g" | sed -e "s|CIME_ROOT|$CIME_ROOT|g"` - -echo "TSMscript_tools.sh: running ${cfgdir}/$2 with $scopts; output in ${rundir}/test.log" - -if [ ! -f "${cfgdir}/$2" ]; then - echo "TSMscript_tools.sh: error ${cfgdir}/$2 input script not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - ${cfgdir}/$2 $scopts >> test.log 2>&1 - rc=$? - status="PASS" -else - echo "success" > test.log - status="GEN" - rc=0 -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully " test.log > /dev/null; then - echo "TSMscript_tools.sh: smoke test passed" - echo "$status" > TestStatus - # Copy files from subdirectories up... - # (use hard links rather than symbolic links because 'ln -s' does funny - # things when there are no matching files) - ln */*.nc */*/*.nc . -else - echo "TSMscript_tools.sh: error running $2, error= $rc" - echo "TSMscript_tools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TSMtools.sh b/test/tools/TSMtools.sh deleted file mode 100755 index 33a2316973..0000000000 --- a/test/tools/TSMtools.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMtools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TSMtools.$1.$2.$3 - -if [ -z "$CLM_RERUN" ]; then - CLM_RERUN="no" -fi - -if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "Copy any text files over" -cp $cfgdir/*.txt $rundir - -echo "TSMtools.sh: calling TCBtools.sh to prepare $1 executable" -${CLM_SCRIPTDIR}/TCBtools.sh $1 $2 -rc=$? -if [ $rc -ne 0 ]; then - echo "TSMtools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -echo "TSMtools.sh: running $1; output in ${rundir}/test.log" - -if [ "$3" = "tools__o" ] || [ "$3" = "tools__do" ]; then - toolrun="env OMP_NUM_THREADS=${CLM_THREADS} ${CLM_TESTDIR}/TCBtools.$1.$2/$1" -else - toolrun="${CLM_TESTDIR}/TCBtools.$1.$2/$1" -fi - -runfile="${cfgdir}/$1.$3" - -if [ ! -f "${runfile}" ]; then - runfile="${CLM_SCRIPTDIR}/nl_files/$1.$3" - if [ ! -f "${runfile}" ]; then - echo "TSMtools.sh: error ${runfile} input run file not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "Run file type = ${3#*.}" -if [ ${3#*.} == "runoptions" ]; then - echo "$toolrun "`cat ${runfile}` - cp $cfgdir/*.nc . - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun `cat ${runfile}` >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -else - echo "$toolrun < ${runfile}" - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun < ${runfile} >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully created " test.log > /dev/null; then - echo "TSMtools.sh: smoke test passed" - echo "$status" > TestStatus -else - echo "TSMtools.sh: error running $1, error= $rc" - echo "TSMtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/config_files/CFGtools__ds b/test/tools/config_files/CFGtools__ds deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/tools/config_files/PTCLM__s b/test/tools/config_files/PTCLM__s deleted file mode 100644 index 8a2155ac49..0000000000 --- a/test/tools/config_files/PTCLM__s +++ /dev/null @@ -1 +0,0 @@ -./buildtools diff --git a/test/tools/config_files/README b/test/tools/config_files/README deleted file mode 100644 index bdfe5e0dd0..0000000000 --- a/test/tools/config_files/README +++ /dev/null @@ -1,9 +0,0 @@ -_do => debug on, omp only on -_ds => debug on, serial mode (neither mpi nor omp) - -_o => debug off, omp only on -_s => debug off, serial mode (neither mpi nor omp) - -tools__ds => options for tools, debug on, serial mode -tools__do => options for tools, debug on, omp only on -tools__o => options for tools, debug off, omp only on diff --git a/test/tools/config_files/gen_domain b/test/tools/config_files/gen_domain deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/tools/config_files/tools__do b/test/tools/config_files/tools__do deleted file mode 100644 index 7f061ed65d..0000000000 --- a/test/tools/config_files/tools__do +++ /dev/null @@ -1 +0,0 @@ -SMP=TRUE OPT=FALSE diff --git a/test/tools/config_files/tools__ds b/test/tools/config_files/tools__ds deleted file mode 100644 index cf2d414b28..0000000000 --- a/test/tools/config_files/tools__ds +++ /dev/null @@ -1 +0,0 @@ -OPT=FALSE diff --git a/test/tools/config_files/tools__o b/test/tools/config_files/tools__o deleted file mode 100644 index 8821e0bc5a..0000000000 --- a/test/tools/config_files/tools__o +++ /dev/null @@ -1 +0,0 @@ -SMP=TRUE OPT=TRUE diff --git a/test/tools/config_files/tools__s b/test/tools/config_files/tools__s deleted file mode 100644 index 507973f8be..0000000000 --- a/test/tools/config_files/tools__s +++ /dev/null @@ -1 +0,0 @@ -OPT=TRUE diff --git a/test/tools/gen_test_table.sh b/test/tools/gen_test_table.sh deleted file mode 100755 index 0791ad0447..0000000000 --- a/test/tools/gen_test_table.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# - -# this script, when executed in the directory containing the test-driver -# scripts (~/test/system) will loop through the default test -# lists for pre and post tag testing of clm and create an html file -# (test_table.html) with the specifics of each test detailed - -outfile="./test_table.html" - -echo '' > $outfile -echo '' >> $outfile -echo '' >> $outfile -echo '' >> $outfile -echo 'CLM Testing Information Page' >> $outfile -echo '' >> $outfile -echo '' >> $outfile - -######################################################################################### -for input_file in `ls tests_*` ; do - echo '' >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - - test_list="" - while read input_line; do - test_list="${test_list}${input_line} " - done < ./${input_file} - - count=0 - ##loop through the tests of input file - for test_id in ${test_list}; do - echo "" >> $outfile - count=`expr $count + 1` - while [ ${#count} -lt 3 ]; do - count="0${count}" - done - echo "" >> $outfile - - master_line=`grep $test_id ./input_tests_master` - dir="" - for arg in ${master_line}; do - arg1=${arg%^*} - arg2=${arg#*^} - if [ -d ../../tools/$arg ]; then - dir=$arg - elif [ -f ./nl_files/$arg ]; then - echo "" >> $outfile - elif [ -f ./config_files/$arg ]; then - echo "" >> $outfile - elif [ -f ./nl_files/$arg1 ] && [ -f ./nl_files/$arg2 ]; then - echo "" >> $outfile - elif [ -f ./nl_files/$arg1 ] && [ -f ./config_files/$arg2 ]; then - echo "" >> $outfile - elif [ -f ../../tools/$dir/$dir.$arg ]; then - echo "" >> $outfile - else - echo "" >> $outfile - fi - done - echo '' >> $outfile - done - echo '
$input_file
test# testid test script arg1 arg2 arg3
$count $arg $arg $arg1^" \ - "$arg2$arg1^" \ - "$arg2$arg $arg
' >> $outfile - echo '
' >> $outfile
-    echo ' ' >> $outfile
-    echo '
' >> $outfile -done -echo '' >> $outfile -echo '' >> $outfile - -exit 0 diff --git a/test/tools/get_cprnc_diffs.sh b/test/tools/get_cprnc_diffs.sh deleted file mode 100755 index 360220cb71..0000000000 --- a/test/tools/get_cprnc_diffs.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# This script extracts lines from the output of cprnc that tell us -# which variables differ between two files -# -# Usage: get_cprnc_diffs filename - -# ---------------------------------------------------------------------- -# SET PARAMETERS HERE -# ---------------------------------------------------------------------- - -# maximum number of differences to extract from the cprnc output -maxdiffs=200 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -# This function gets differences for one prefix (e.g., "RMS") -# Usage: get_diffs prefix -# (also uses $infile and $maxdiffs from the parent script) -function get_diffs { - prefix=$1 - outfile=${infile}.${prefix}.$$ - grep "$prefix" $infile > $outfile - numlines=`wc -l $outfile | awk '{print $1}'` - if [ $numlines -gt $maxdiffs ]; then - echo "WARNING: Too many instances of $prefix - only printing last $maxdiffs" - tail -$maxdiffs $outfile - else - cat $outfile - fi - rm $outfile -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -if [[ $# -ne 1 ]]; then - echo "Usage: get_cprnc_diffs filename" - exit 1 -fi - -infile=$1 - -# ---------------------------------------------------------------------- -# Do the processing -# ---------------------------------------------------------------------- - -get_diffs RMS -get_diffs FILLDIFF diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master deleted file mode 100644 index 84b98883eb..0000000000 --- a/test/tools/input_tests_master +++ /dev/null @@ -1,54 +0,0 @@ - - -smc#4 TSMscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds -blc#4 TBLscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds - -sme14 TSMCFGtools.sh gen_domain CFGtools__ds T31.runoptions -ble14 TBLCFGtools.sh gen_domain CFGtools__ds T31.runoptions -sme@4 TSMCFGtools.sh gen_domain CFGtools__ds ne30.runoptions -ble@4 TBLCFGtools.sh gen_domain CFGtools__ds ne30.runoptions - -smg54 TSMtools.sh mksurfdata_map tools__s namelist -blg54 TBLtools.sh mksurfdata_map tools__s namelist - -smi24 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds -bli24 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_T31_crpglc_2000^tools__ds - -smi53 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__o -bli53 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__o -smi54 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ds -bli54 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__ds -smi57 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__do -bli57 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_1850^tools__do -smi58 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_crp_1850-2000^tools__do -bli58 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_10x15_crp_1850-2000^tools__do - -smi74 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds -bli74 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850-2000^tools__ds -smi78 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds -bli78 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_brazil_1850^tools__ds -smiT4 TSMscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds -bliT4 TBLscript_tools.sh mksurfdata_map mksurfdata.pl mksrfdt_1x1_numaIA_mp24_2000^tools__ds - -smi#2 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 -bli#2 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_ne30np4 -smi59 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 -bli59 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_if10 -smi79 TSMscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_i1x1_brazil -bli79 TBLscript_tools.sh mkmapdata mkmapdata.sh mkmapdata_i1x1_brazil - -smf84 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools -blf84 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_clm4_5^buildtools -smfc4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools -blfc4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Cycle_clm4_5^buildtools -smfg4 TSMscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools -blfg4 TBLscript_tools.sh PTCLM PTCLMmkdata PTCLM_USUMB_Global_clm4_5^buildtools - -smiS4 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional -bliS4 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional -smiS8 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_ndep -bliS8 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_ndep -smiS9 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_T62 -bliS9 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_T62 -smiS0 TSMscript_tools.sh ncl_scripts getregional_datasets.pl getregional_0.5popd -bliS0 TBLscript_tools.sh ncl_scripts getregional_datasets.pl getregional_0.5popd diff --git a/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 b/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 deleted file mode 100644 index f27830a2c4..0000000000 --- a/test/tools/nl_files/PTCLM_USUMB_Cycle_clm4_5 +++ /dev/null @@ -1 +0,0 @@ --s US-UMB -d CSMDATA --mydatadir . --map_gdate 171024 --cycle_forcing --ctsm_root CTSM_ROOT --cime_root CIME_ROOT diff --git a/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 b/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 deleted file mode 100644 index dc4c617dc3..0000000000 --- a/test/tools/nl_files/PTCLM_USUMB_Global_clm4_5 +++ /dev/null @@ -1 +0,0 @@ --s US-UMB -d CSMDATA --mydatadir . --map_gdate 171024 --donot_use_tower_yrs --clmnmlusecase 20thC_transient --pftgrid --soilgrid --ctsm_root CTSM_ROOT --cime_root CIME_ROOT diff --git a/test/tools/nl_files/PTCLM_USUMB_clm4_5 b/test/tools/nl_files/PTCLM_USUMB_clm4_5 deleted file mode 100644 index 5ed93b26bd..0000000000 --- a/test/tools/nl_files/PTCLM_USUMB_clm4_5 +++ /dev/null @@ -1 +0,0 @@ --s US-UMB -d CSMDATA --mydatadir . --map_gdate 171024 --ctsm_root CTSM_ROOT --cime_root CIME_ROOT diff --git a/test/tools/nl_files/gen_domain.T31.runoptions b/test/tools/nl_files/gen_domain.T31.runoptions deleted file mode 100644 index c1fcc07df1..0000000000 --- a/test/tools/nl_files/gen_domain.T31.runoptions +++ /dev/null @@ -1 +0,0 @@ --m CSMDATA/cpl/cpl6/map_gx3v7_to_T31_aave_da_090903.nc -o domain.ocn.gx3v7_test.nc -l domain.lnd.10x15_gx3v7.test.nc diff --git a/test/tools/nl_files/gen_domain.ne30.runoptions b/test/tools/nl_files/gen_domain.ne30.runoptions deleted file mode 100644 index 790969101e..0000000000 --- a/test/tools/nl_files/gen_domain.ne30.runoptions +++ /dev/null @@ -1 +0,0 @@ --m CSMDATA/cpl/cpl6/map_gx1v6_to_ne30np4_aave_da_091227.nc -o domain.ocn.gx1v6_test.nc -l domain.lnd.ne30np4_gx1v6.test.nc diff --git a/test/tools/nl_files/getregional b/test/tools/nl_files/getregional deleted file mode 100644 index 5e5d348e39..0000000000 --- a/test/tools/nl_files/getregional +++ /dev/null @@ -1 +0,0 @@ --SW 52,190 -NE 73,220 -i sample_inlist -o sample_outlist diff --git a/test/tools/nl_files/getregional_05popd b/test/tools/nl_files/getregional_05popd deleted file mode 100644 index 79747ad9cd..0000000000 --- a/test/tools/nl_files/getregional_05popd +++ /dev/null @@ -1 +0,0 @@ --SW 52,190 -NE 73,220 -i sample_inlist_0.5popd -o sample_outlist_0.5popd diff --git a/test/tools/nl_files/getregional_T62 b/test/tools/nl_files/getregional_T62 deleted file mode 100644 index 8288847cf5..0000000000 --- a/test/tools/nl_files/getregional_T62 +++ /dev/null @@ -1 +0,0 @@ --SW 52,190 -NE 73,220 -i sample_inlist_T62 -o sample_outlist_T62 diff --git a/test/tools/nl_files/getregional_ndep b/test/tools/nl_files/getregional_ndep deleted file mode 100644 index 125285f690..0000000000 --- a/test/tools/nl_files/getregional_ndep +++ /dev/null @@ -1 +0,0 @@ --SW 52,190 -NE 73,220 -i sample_inlist_ndep -o sample_outlist_ndep diff --git a/test/tools/nl_files/mkmapdata_if10 b/test/tools/nl_files/mkmapdata_if10 deleted file mode 100644 index 1c30796e2e..0000000000 --- a/test/tools/nl_files/mkmapdata_if10 +++ /dev/null @@ -1 +0,0 @@ --t regional -r 10x15 diff --git a/test/tools/nl_files/mkmapdata_ne30np4 b/test/tools/nl_files/mkmapdata_ne30np4 deleted file mode 100644 index 11066c7b41..0000000000 --- a/test/tools/nl_files/mkmapdata_ne30np4 +++ /dev/null @@ -1 +0,0 @@ --r ne30np4 diff --git a/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 b/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 deleted file mode 100644 index af85dcf226..0000000000 --- a/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 +++ /dev/null @@ -1 +0,0 @@ --i CSMDATA/lnd/clm2/test_mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc -o ne30output_onf19grid.nc -m CSMDATA/lnd/clm2/test_mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc -t CSMDATA/lnd/clm2/test_mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc -e EXEDIR diff --git a/test/tools/nl_files/mksrfdt_10x15_1850 b/test/tools/nl_files/mksrfdt_10x15_1850 deleted file mode 100644 index daa822804c..0000000000 --- a/test/tools/nl_files/mksrfdt_10x15_1850 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 10x15 -no-crop -y 1850 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_10x15_crp_1850-2000 b/test/tools/nl_files/mksrfdt_10x15_crp_1850-2000 deleted file mode 100644 index b42c1deb04..0000000000 --- a/test/tools/nl_files/mksrfdt_10x15_crp_1850-2000 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 10x15 -y 1850-2000 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_1x1_brazil_1850 b/test/tools/nl_files/mksrfdt_1x1_brazil_1850 deleted file mode 100644 index 2330bd082e..0000000000 --- a/test/tools/nl_files/mksrfdt_1x1_brazil_1850 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 1x1_brazil -y 1850-2000 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_1x1_brazil_1850-2000 b/test/tools/nl_files/mksrfdt_1x1_brazil_1850-2000 deleted file mode 100644 index 2330bd082e..0000000000 --- a/test/tools/nl_files/mksrfdt_1x1_brazil_1850-2000 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 1x1_brazil -y 1850-2000 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 b/test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 deleted file mode 100644 index 03304f81eb..0000000000 --- a/test/tools/nl_files/mksrfdt_1x1_numaIA_mp24_2000 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 1x1_numaIA -y 2000 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 b/test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 deleted file mode 100644 index a446e82fcd..0000000000 --- a/test/tools/nl_files/mksrfdt_1x1_vancouverCAN_2000 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 1x1_vancouverCAN -no-crop -y 2000 -exedir EXEDIR diff --git a/test/tools/nl_files/mksrfdt_T31_crpglc_2000 b/test/tools/nl_files/mksrfdt_T31_crpglc_2000 deleted file mode 100644 index ac8ceed1a8..0000000000 --- a/test/tools/nl_files/mksrfdt_T31_crpglc_2000 +++ /dev/null @@ -1 +0,0 @@ --l CSMDATA -r 48x96 -y 2000 -glc_nec 10 -exedir EXEDIR diff --git a/test/tools/show_var_diffs.sh b/test/tools/show_var_diffs.sh deleted file mode 100755 index f462d4ad0c..0000000000 --- a/test/tools/show_var_diffs.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -# This script processes a log file that was output by test_driver, -# giving lists of all variables with differences in values (those with -# RMS errors), and all variables with differences in fill patterns. -# -# This assumes that the log file contains output like: -# RMS foo -# RMS bar -# FILLDIFF foo -# FILLDIFF bar -# Some characteristics of these output lines are: -# - they begin with a leading space, followed by RMS or FILLDIFF -# - the variable name is in the second column of the line -# -# Note that (as of 4-5-12) the log file only contains output from the -# last file that didn't match, so this could potentially miss -# something -- especially if there are both h0 and h1 files in the -# comparison. - -# Usage: show_var_diffs logfile - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -# This function shows the differences for one prefix (e.g., "RMS") -# Usage: show_diffs prefix -# (also uses $logfile from the parent script) -# -# Matches lines that start with the regular expression "^ ${prefix}" -# (note that one leading space is expected before the prefix) -# -# Assumes that the variable name is in the second column of matching lines -function show_diffs { - prefix=$1 - - # first determine if there were warnings relating to this prefix - grep "WARNING: Too many instances of ${prefix}" $logfile > /dev/null - if [ $? -eq 0 ]; then # found a warning - echo "WARNING: Some output was truncated; this may not be a complete list" - fi - - # now make a list of all variables matching this prefix - grep "^ ${prefix}" $logfile > $logfile.tmp.$$ - if [ $? -eq 0 ]; then - awk '{print $2}' $logfile.tmp.$$ | sort | uniq - else - echo "(no differences)" - fi - - rm $logfile.tmp.$$ -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -if [[ $# -ne 1 ]]; then - echo "Usage: show_var_diffs logfile" - exit 1 -fi - -logfile=$1 - -# ---------------------------------------------------------------------- -# Do the processing -# ---------------------------------------------------------------------- - -echo "Variables with differences in values:" -show_diffs "RMS" - -echo "" -echo "Variables with differences in fill patterns:" -show_diffs "FILLDIFF" \ No newline at end of file diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh deleted file mode 100755 index 935b7d2dd2..0000000000 --- a/test/tools/test_driver.sh +++ /dev/null @@ -1,572 +0,0 @@ -#!/bin/sh -# -# test_driver.sh: driver script for the offline testing of CLM of tools -# -# interactive usage on all machines: -# -# env ./test_driver.sh -i -# -# valid arguments: -# -i interactive usage -# -d debug usage -- display tests that will run -- but do NOT actually execute them -# -f force batch submission (avoids user prompt) -# -h displays this help message -# -# -# **pass environment variables by preceding above commands -# with 'env var1=setting var2=setting ' -# **more details in the CLM testing user's guide, accessible -# from the CLM developers web page - - -#will attach timestamp onto end of script name to prevent overwriting -cur_time=`date '+%H:%M:%S'` - -hostname=`hostname` -echo $hostname -case $hostname in - - ##cheyenne - cheyenne* | r*i*n*) - submit_script="test_driver_cheyenne${cur_time}.sh" - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -interactive="YES" -input_file="tests_pretag_cheyenne_nompi" -c_threads=36 - - -export INITMODULES="/glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/sh" -. \$INITMODULES - -module purge -module load ncarenv/1.0 -module load intel/17.0.1 -module load mkl -module load ncarcompilers/0.3.5 -module load netcdf/4.4.1.1 - -module load nco -module load python -module load ncl - - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=\$c_threads -fi - -# Stop on first failed test -if [ -z "\$CLM_SOFF" ]; then #CLM_SOFF NOT set - export CLM_SOFF=FALSE -fi - -export CESM_MACH="cheyenne" -export CESM_COMP="intel" - -export NETCDF_DIR=\$NETCDF -export INC_NETCDF=\$NETCDF/include -export LIB_NETCDF=\$NETCDF/lib -export MAKE_CMD="gmake -j " -export CFG_STRING="" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_LINKER=ifort USER_CPPDEFS=-DLINUX" -export MACH_WORKSPACE="/glade/scratch" -export CPRNC_EXE="$CESMDATAROOT/tools/cime/tools/cprnc/cprnc.cheyenne" -dataroot="$CESMDATAROOT" -export TOOLSLIBS="" -export TOOLS_CONF_STRING="--mpilib mpi-serial" - - -echo_arg="" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ## DAV cluster - geyser* | caldera* | pronghorn*) - submit_script="test_driver_dav${cur_time}.sh" - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -interactive="YES" -input_file="tests_posttag_dav_mpi" -c_threads=36 - - -export INITMODULES="/glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/sh" -. \$INITMODULES - -module purge -module load ncarenv/1.0 -module load intel/12.1.5 -module load mkl -module load ncarcompilers -module load netcdf/4.3.3.1 -module load mpich-slurm/3.2.1 - -module load nco -module load python -module load ncl - - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=\$c_threads -fi - -# Stop on first failed test -if [ -z "\$CLM_SOFF" ]; then #CLM_SOFF NOT set - export CLM_SOFF=FALSE -fi - -export CESM_MACH="cheyenne" -export CESM_COMP="intel" - -export NETCDF_DIR=\$NETCDF -export INC_NETCDF=\$NETCDF/include -export LIB_NETCDF=\$NETCDF/lib -export MAKE_CMD="gmake -j " -export CFG_STRING="" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_LINKER=ifort USER_CPPDEFS=-DLINUX" -export MACH_WORKSPACE="/glade/scratch" -export CPRNC_EXE="$CESMDATAROOT/tools/cime/tools/cprnc/cprnc.cheyenne" -dataroot="$CESMDATAROOT" -export TOOLSLIBS="" -export TOOLS_CONF_STRING="--mpilib mpich" - - -echo_arg="" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ## hobart - hobart* | h*.cgd.ucar.edu) - submit_script="test_driver_hobart_${cur_time}.sh" - export PATH=/cluster/torque/bin:${PATH} - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -# Name of the queue (CHANGE THIS if needed) -#PBS -q long -# Number of nodes (CHANGE THIS if needed) -#PBS -l nodes=1:ppn=24 -# output file base name -#PBS -N test_dr -# Put standard error and standard out in same file -#PBS -j oe -# Export all Environment variables -#PBS -V -# End of options - -if [ -n "\$PBS_JOBID" ]; then #batch job - export JOBID=\`echo \${PBS_JOBID} | cut -f1 -d'.'\` - initdir=\${PBS_O_WORKDIR} -fi - -if [ "\$PBS_ENVIRONMENT" = "PBS_BATCH" ]; then - interactive="NO" - input_file="tests_posttag_hobart" -else - interactive="YES" - input_file="tests_posttag_hobart_nompi" -fi - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=2 -fi -export CLM_RESTART_THREADS=1 - -##mpi tasks -export CLM_TASKS=24 -export CLM_RESTART_TASKS=20 - -export P4_GLOBMEMSIZE=500000000 - - -export CESM_MACH="hobart" - -ulimit -s unlimited -ulimit -c unlimited - -export CESM_COMP="intel" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_CC=icc " -export TOOLS_CONF_STRING=" -mpilib mpi-serial" -export CFG_STRING="" -export INITMODULES="/usr/share/Modules/init/sh" - -. \$INITMODULES -module purge -module load compiler/intel/18.0.3 -module load tool/nco/4.7.5 -module load tool/netcdf/4.6.1/intel - -export NETCDF_DIR=\$NETCDF_PATH -export INC_NETCDF=\${NETCDF_PATH}/include -export LIB_NETCDF=\${NETCDF_PATH}/lib -export MAKE_CMD="gmake -j 5" ##using hyper-threading on hobart -export MACH_WORKSPACE="/scratch/cluster" -export CPRNC_EXE=/fs/cgd/csm/tools/cprnc_hobart/cprnc -export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" -dataroot="/fs/cgd/csm" -export TOOLSSLIBS="" -echo_arg="-e" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - * ) - echo "Only setup to work on: cheyenne and hobart" - exit - - -esac - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat >> ./${submit_script} << EOF - -export CPRNC_OPT="" -if [ -n "\${CLM_JOBID}" ]; then - export JOBID=\${CLM_JOBID} -fi -##check if interactive job - -if [ "\$interactive" = "YES" ]; then - - if [ -z "\${JOBID}" ]; then - export JOBID=\$\$ - fi - echo "test_driver.sh: interactive run - setting JOBID to \$JOBID" - if [ \$0 = "test_driver.sh" ]; then - initdir="." - else - initdir=\${0%/*} - fi -else - echo "ERROR: you *always* need to use the interactive option (-i)" - echo " currently doesn't work without it" - exit 3 -fi - -##establish script dir and clm_root -if [ -f \${initdir}/test_driver.sh ]; then - export CLM_SCRIPTDIR=\`cd \${initdir}; pwd \` - export CLM_ROOT=\`cd \${CLM_SCRIPTDIR}/../..; pwd \` - export CTSM_ROOT=\${CLM_ROOT} - if [ -d \${CLM_ROOT}/cime ]; then - export CIME_ROOT=\${CLM_ROOT}/cime - else - export CIME_ROOT=\${CLM_ROOT}/../../cime - fi - if [ ! -d \${CIME_ROOT} ]; then - echo "ERROR: trouble finding the CIME_ROOT directory: \$CIME_ROOT" - exit 3 - fi -else - if [ -n "\${CLM_ROOT}" ] && [ -f \${CLM_ROOT}/test/tools/test_driver.sh ]; then - export CLM_SCRIPTDIR=\`cd \${CLM_ROOT}/test/tools; pwd \` - else - echo "ERROR: unable to determine script directory " - echo " if initiating batch job from directory other than the one containing test_driver.sh, " - echo " you must set the environment variable CLM_ROOT to the full path of directory containing " - echo " . " - exit 3 - fi -fi - -##output files -clm_log=\${initdir}/td.\${JOBID}.log -if [ -f \$clm_log ]; then - rm \$clm_log -fi -clm_status=\${initdir}/td.\${JOBID}.status -if [ -f \$clm_status ]; then - rm \$clm_status -fi - -##setup test work directory -if [ -z "\$CLM_TESTDIR" ]; then - export CLM_TESTDIR=\${MACH_WORKSPACE}/\$LOGNAME/clmTests/test-driver.\${JOBID} - if [ -d \$CLM_TESTDIR ] && [ \$CLM_RETAIN_FILES != "TRUE" ]; then - rm -r \$CLM_TESTDIR - fi -fi -if [ ! -d \$CLM_TESTDIR ]; then - mkdir -p \$CLM_TESTDIR - if [ \$? -ne 0 ]; then - echo "ERROR: unable to create work directory \$CLM_TESTDIR" - exit 4 - fi -fi - -## MCT and PIO build directorys -export MCT_LIBDIR=\$CLM_TESTDIR/mct -export PIO_LIBDIR=\$CLM_TESTDIR/pio - -##set our own environment vars -export CSMDATA=\${dataroot}/inputdata -export DIN_LOC_ROOT=\${CSMDATA} -export MPI_TYPE_MAX=100000 - -##process other env vars possibly coming in -if [ -z "\$CLM_RETAIN_FILES" ]; then - export CLM_RETAIN_FILES=FALSE -fi -if [ -n "\${CLM_INPUT_TESTS}" ]; then - input_file=\$CLM_INPUT_TESTS -else - input_file=\${CLM_SCRIPTDIR}/\${input_file} -fi -if [ ! -f \${input_file} ]; then - echo "ERROR: unable to locate input file \${input_file}" - exit 5 -fi - -if [ \$interactive = "YES" ]; then - echo "reading tests from \${input_file}" -else - echo "reading tests from \${input_file}" >> \${clm_log} -fi - -num_tests=\`wc -w < \${input_file}\` -echo "STATUS OF CLM TESTING UNDER JOB \${JOBID}; scheduled to run \$num_tests tests from:" >> \${clm_status} -echo "\$input_file" >> \${clm_status} -echo "" >> \${clm_status} -echo " on machine: $hostname" >> \${clm_status} -if [ -n "${BL_ROOT}" ]; then - echo "tests of baseline will use source code from:" >> \${clm_status} - echo "\$BL_ROOT" >> \${clm_status} -fi -if [ \$interactive = "NO" ]; then - echo "see \${clm_log} for more detailed output" >> \${clm_status} -fi -echo "" >> \${clm_status} - -test_list="" -while read input_line; do - test_list="\${test_list}\${input_line} " -done < \${input_file} - - -##initialize flags, counter -skipped_tests="NO" -pending_tests="NO" -count=0 - -##loop through the tests of input file -for test_id in \${test_list}; do - count=\`expr \$count + 1\` - while [ \${#count} -lt 3 ]; do - count="0\${count}" - done - - master_line=\`grep \$test_id \${CLM_SCRIPTDIR}/input_tests_master\` - status_out="" - for arg in \${master_line}; do - status_out="\${status_out}\${arg} " - done - - if [ -z "\$status_out" ]; then - echo "No test matches \$test_id in \${CLM_SCRIPTDIR}/input_tests_master" - exit 3 - fi - - test_cmd=\${status_out#* } - - status_out="\${count} \${status_out}" - - if [ \$interactive = "YES" ]; then - echo "" - echo "***********************************************************************************" - echo "\${status_out}" - echo "***********************************************************************************" - else - echo "" >> \${clm_log} - echo "***********************************************************************************"\ - >> \${clm_log} - echo "\$status_out" >> \${clm_log} - echo "***********************************************************************************"\ - >> \${clm_log} - fi - - if [ \${#status_out} -gt 94 ]; then - status_out=\`echo "\${status_out}" | cut -c1-100\` - fi - while [ \${#status_out} -lt 97 ]; do - status_out="\${status_out}." - done - - echo \$echo_arg "\$status_out\c" >> \${clm_status} - - if [ \$interactive = "YES" ]; then - \${CLM_SCRIPTDIR}/\${test_cmd} - rc=\$? - else - \${CLM_SCRIPTDIR}/\${test_cmd} >> \${clm_log} 2>&1 - rc=\$? - fi - if [ \$rc -eq 0 ]; then - echo "PASS" >> \${clm_status} - elif [ \$rc -eq 255 ]; then - echo "SKIPPED*" >> \${clm_status} - skipped_tests="YES" - elif [ \$rc -eq 254 ]; then - echo "PENDING**" >> \${clm_status} - pending_tests="YES" - else - echo " rc=\$rc FAIL" >> \${clm_status} - if [ "\$CLM_SOFF" = "TRUE" ]; then - echo "stopping on first failure" >> \${clm_status} - echo "stopping on first failure" >> \${clm_log} - exit 6 - fi - fi -done - -echo "end of input" >> \${clm_status} -if [ \$interactive = "YES" ]; then - echo "end of input" -else - echo "end of input" >> \${clm_log} -fi - -if [ \$skipped_tests = "YES" ]; then - echo "* please verify that any skipped tests are not required of your clm commit" >> \${clm_status} -fi -if [ \$pending_tests = "YES" ]; then - echo "** tests that are pending must be checked manually for a successful completion" >> \${clm_status} - if [ \$interactive = "NO" ]; then - echo " see the test's output in \${clm_log} " >> \${clm_status} - echo " for the location of test results" >> \${clm_status} - fi -fi - -if [ "\$interactive" = "YES" ]; then - passInt="test_driver.sh-i" -else - passInt="test_driver.sh" -fi - -../../bld/unit_testers/xFail/wrapClmTests.pl -statusFile "\${clm_status}" -numberOfTests "\${num_tests}" -callingScript "\${passInt}" - -exit 0 - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - - -chmod a+x $submit_script -if [ ! -z "$CLM_RETAIN_FILES" ]; then - export CLM_RETAIN_FILES="FALSE" -fi -arg1=${1##*-} -case $arg1 in - [iI]* ) - debug="NO" - interactive="YES" - compile_only="NO" - export debug - export interactive - export compile_only - ./${submit_script} - exit 0 - ;; - - [cC]* ) - debug="NO" - interactive="YES" - compile_only="YES" - export debug - export CLM_RETAIN_FILES="TRUE" - export interactive - export compile_only - export CLM_RETAIN_FILES="TRUE" - ./${submit_script} - exit 0 - ;; - - [dD]* ) - debug="YES" - interactive="YES" - compile_only="NO" - export debug - export interactive - export compile_only - ./${submit_script} - exit 0 - ;; - - [fF]* ) - debug="NO" - interactive="NO" - compile_only="NO" - export debug - export interactive - export compile_only - ;; - - "" ) - echo "" - echo "**********************" - echo "$submit_script has been created and will be submitted to the batch queue..." - echo "(ret) to continue, (a) to abort" - read ans - case $ans in - [aA]* ) - echo "aborting...type ./test_driver.sh -h for help message" - exit 0 - ;; - esac - debug="NO" - interactive="NO" - compile_only="NO" - export debug - export interactive - export compile_only - ;; - - * ) - echo "" - echo "**********************" - echo "usage on cheyenne and hobart: " - echo "./test_driver.sh -i" - echo "" - echo "valid arguments: " - echo "-i interactive usage" - echo "-c compile-only usage (run configure and compile do not run clm)" - echo "-d debug-only usage (run configure and build-namelist do NOT compile or run clm)" - echo "-f force batch submission (avoids user prompt)" - echo "-h displays this help message" - echo "" - echo "**pass environment variables by preceding above commands " - echo " with 'env var1=setting var2=setting '" - echo "" - echo "**********************" - exit 0 - ;; -esac - -echo "submitting..." -case $hostname in - #default - * ) - echo "no submission capability on this machine use the interactive option: -i" - exit 0 - ;; - -esac -exit 0 diff --git a/test/tools/tests_posttag_dav_mpi b/test/tools/tests_posttag_dav_mpi deleted file mode 100644 index ef42215791..0000000000 --- a/test/tools/tests_posttag_dav_mpi +++ /dev/null @@ -1,2 +0,0 @@ -smi#2 bli#2 -smi59 bli59 diff --git a/test/tools/tests_posttag_hobart_nompi b/test/tools/tests_posttag_hobart_nompi deleted file mode 100644 index 4655f29853..0000000000 --- a/test/tools/tests_posttag_hobart_nompi +++ /dev/null @@ -1,6 +0,0 @@ -smc#4 blc#4 -smi54 bli54 -smi57 bli57 -smiT4 bliT4 -smf84 blf84 -smfc4 blfc4 diff --git a/test/tools/tests_posttag_nompi_regression b/test/tools/tests_posttag_nompi_regression deleted file mode 100644 index f1ebea192d..0000000000 --- a/test/tools/tests_posttag_nompi_regression +++ /dev/null @@ -1,20 +0,0 @@ -smc#4 blc#4 -sme14 ble14 -sm@14 bl@14 -smg54 blg54 -smi24 bli24 -smi53 bli53 -smi54 bli54 -smi57 bli57 -smi58 bli58 -smi74 bli74 -smi78 bli78 -smiT4 bliT4 -smf84 blf84 -smfc4 blfc4 -smfg4 blfg4 -smiS4 bliS4 -smiS8 bliS8 -smiS9 bliS9 -smiS0 bliS0 -smiS0 bliS0 diff --git a/test/tools/tests_pretag_cheyenne_nompi b/test/tools/tests_pretag_cheyenne_nompi deleted file mode 100644 index 1795119813..0000000000 --- a/test/tools/tests_pretag_cheyenne_nompi +++ /dev/null @@ -1,15 +0,0 @@ -smc#4 blc#4 -sme14 ble14 -sme@4 ble@4 -smg54 blg54 -smi24 bli24 -smi53 bli53 -smi54 bli54 -smi57 bli57 -smi58 bli58 -smiS4 bliS4 -smi74 bli74 -smiT4 bliT4 -smf84 blf84 -smfc4 blfc4 -smfg4 blfg4 diff --git a/tools/README b/tools/README deleted file mode 100644 index 006d3ac063..0000000000 --- a/tools/README +++ /dev/null @@ -1,280 +0,0 @@ -$CTSMROOT/tools/README Jun/08/2018 - -CLM tools for analysis of CLM history files -- or for creation or -modification of CLM input files. - -I. General directory structure: - - $CTSMROOT/tools - mksurfdata_map --- Create surface datasets. - (NOTE: interpinic now longer included as now an online capability in CLM) - - mkmapgrids ------- Create regular lat/lon SCRIP grid files needed by mkmapdata - mkmapdata -------- Create SCRIP mapping data from SCRIP grid files (uses ESMF) - mkprocdata_map --- Convert output unstructured grids into a 2D format that - can be plotted easily - ncl_scripts ------ NCL post or pre processing scripts. - - cime-tools ($CIMEROOT/tools/) (CIMEROOT is ../cime for a CTSM checkout and ../../../cime for a CESM checkout) - $CIMEROOT/mapping/gen_domain_files - gen_domain ------- Create data model domain datasets from SCRIP mapping datasets. - -II. Notes on building/running for each of the above tools: - - Each tool that has FORTRAN source code (mksurfdata_map and mkprocdata_map) has the following files: - - README ------- Specific help for using the specific tool and help on specific - files in that directory. - src/Filepath ----- List of directories needed to build the tool - (some files in ../src directories are required). - src/Makefile ----- GNU Makefile to build the tool - (these are identical between tools. - src/Macros.custom Customization of make macros for the particular tool in question - src/Srcfiles ----- List of source files that are needed. - src/Mkdepends ---- Dependency generator program - - mkmapdata, mkmapgrids and ncl_scripts only contain scripts so don't have the above build files. - - Most tools have copies of files from other directories -- see the README.filecopies - file for more information on this. - - Tools may also have files with the directory name followed by namelist to provide sample namelists. - - .namelist ------ Namelist to create a global file. - - These files are also used by the test scripts to test the tools (see the - README.testing) file. - - NOTE: Be sure to change the path of the datasets references by these namelists to - point to where you have exported your CESM inputdata datasets. - - To build: - - cd - setenv INC_NETCDF - setenv LIB_NETCDF - gmake - - The process will create a file called "Depends" which has the dependencies - for the build of each file on other files. - - By default some codes may be compiled non-optimized - so that you can use the debugger, and with bounds-checking, and float trapping on. - To speed up do the following... - - gmake OPT=TRUE (by default already on for interpinic and mksurfdata_map) - - Also some of the tools allow for OpenMP shared memory parallelism - (such as interpinic and mksurfdata) with - - gmake SMP=TRUE - - To run a program with a namelist: - - ./program < namelist - - To get help on running a program with command line options (e.g., interpinic): - - ./program - - To run a program built with SMP=TRUE: - - setenv OMP_NUM_THREADS= - - run normally as above - -III. Process sequence to create input datasets needed to run CLM - - 1.) Create SCRIP grid files (if needed) - - a.) For standard resolutions these files will already be created. (done) - - b.) To create regular lat-lon regional/single-point grids run mknoocnmap.pl - - This will create both SCRIP grid files and a mapping file that will - be valid if the region includes NO ocean whatsoever (so you can skip step 2). - You can also use this script to create SCRIP grid files for a region - (or even a global grid) that DOES include ocean if you use step 2 to - create mapping files for it (simply discard the non-ocean map created by - this script). - - Example, for single-point over Boulder Colorado. - - cd mkmapdata - ./mknoocnmap.pl -p 40,255 -n 1x1_boulderCO - - c.) General case - - You'll need to convert or create SCRIP grid files on your own (using scripts - or other tools) for the general case where you have an unstructured grid, or - a grid that is not regular in latitude and longitude. - - example format - ================== - netcdf fv1.9x2.5_090205 { - dimensions: - grid_size = 13824 ; - grid_corners = 4 ; - grid_rank = 2 ; - variables: - double grid_center_lat(grid_size) ; - grid_center_lat:units = "degrees" ; - double grid_center_lon(grid_size) ; - grid_center_lon:units = "degrees" ; - double grid_corner_lat(grid_size, grid_corners) ; - grid_corner_lat:units = "degrees" ; - double grid_corner_lon(grid_size, grid_corners) ; - grid_corner_lon:units = "degrees" ; - int grid_dims(grid_rank) ; - int grid_imask(grid_size) ; - grid_imask:units = "unitless" ; - - 2.) Create ocean to atmosphere mapping file (if needed) - - a.) Standard resolutions (done) - - If this is a standard resolution with a standard ocean resolution -- this - step is already done, the files already exist. - - b.) Region without Ocean (done in step 1.b) - - IF YOU RAN mknoocnmap.pl FOR A REGION WITHOUT OCEAN THIS STEP IS ALREADY DONE. - - c.) New atmosphere or ocean resolution - - If the region DOES include ocean, use $CIMEROOT/tools/mapping/gen_domain_files/gen_maps.sh to create a - mapping file for it. - - Example: - - cd $CIMEROOT/tools/mapping/gen_domain_files - ./gen_maps.sh -focn -fatm -nocn -natm - - - 3.) Add SCRIP grid file(s) created in (1) into XML database in CLM (optional) - - See the "Adding New Resolutions or New Files to the build-namelist Database" - Chapter in the CLM User's Guide - - http://www.cesm.ucar.edu/models/cesm1.0/clm/models/lnd/clm/doc/UsersGuide/book1.html - - If you don't do this step, you'll need to specify the file to mkmapdata - in step (3) using the "-f" option. - - 4.) Create mapping files for use by mksurfdata_map with mkmapdata - (See mkmapdata/README for more help on doing this) - - - this step uses the results of (1) that were entered into the XML database - by step (3). If you don't enter datasets in, you need to specify the - SCRIP grid file using the "-f" option to mkmapdata.sh. - - Example: to generate all necessary mapping files for the ne30np4 grid - - cd mkmapdata - ./mkmapdata.sh -r ne30np4 - - 5.) Add mapping file(s) created in step (4) into XML database in CLM (optional) - - See notes on doing this in step (3) above. - Edit ../bld/namelist_files/namelist_defaults_clm.xml to incorporate new - mapping files. - - If you don't do this step, you'll need to specify the grid resolution name - and file creation dates to mksurfdata_map in step (5) below. - - 6.) Convert map of ocean to atm for use by DATM and CLM with gen_domain - (See $CIMEROOT/tools/mapping/README for more help on doing this) - - - gen_domain uses the map from step (2) (or previously created CESM maps) - - Example: - - cd $CIMEROOT/tools/mapping/gen_domain_files/src - gmake - cd .. - setenv CDATE 090206 - setenv OCNGRIDNAME gx1v6 - setenv ATMGRIDNAME fv1.9x2.5 - setenv MAPFILE $CSMDATA/cpl/cpl6/map_${OCNGRIDNAME}_to_${ATMGRIDNAME}_aave_da_${CDATE}.nc - ./gen_domain -m $MAPFILE -o $OCNGRIDNAME -l $ATMGRIDNAME - - Normally for I compsets running CLM only you will discard the ocean domain - file, and only use the atmosphere domain file for datm and as the fatmlndfrc - file for CLM. Output domain files will be named according to the input OCN/LND - gridnames. - - 7.) Create surface datasets with mksurfdata_map - (See mksurfdata_map/README for more help on doing this) - - - Run mksurfdata_map/mksurfdata.pl - - This step uses the results of step (4) entered into the XML database - in step (5). - - If datasets were NOT entered into the XML database, set the resolution - to "usrspec" and use the "-usr_gname", and "-usr_gdate" options. - - Example: for 0.9x1.25 resolution - - cd mksurfdata_map/src - gmake - cd .. - ./mksurfdata.pl -r 0.9x1.25 - - NOTE that surface dataset will be used by default for fatmgrid - and it will - contain the lat,lon,edges and area values for the atm grid - ASSUMING that - the atm and land grid are the same - - 8.) Interpolate initial conditions using interpinic (optional) - (See interpinic/README for more help on doing this) - - 9.) Add new files to XML data or using user_nl_clm (optional) - - See notes on doing this in step (3) above. - -IV. Example of creating single-point datasets without entering into XML database. - - Here we apply the process described in III. for a single-point dataset - where we don't enter the datasets into the XML database (thus skipping - steps 3, 5 and 9), but use the needed command line options to specify where the - files are. This also skips step (2) since step 1 creates the needed mapping file. - We also skip step (8) and do NOT create a finidat file. - - 0.) Set name of grid to use and the creation date to be used later... - setenv GRIDNAME 1x1_boulderCO - setenv CDATE `date +%y%m%d` - 1.) SCRIP grid and atm to ocn mapping file - cd mkmapdata - ./mknoocnmap.pl -p 40,255 -n $GRIDNAME - # Set pointer to MAPFILE that will be used in step (6) - setenv MAPFILE `pwd`/map_${GRIDNAME}_noocean_to_${GRIDNAME}_nomask_aave_da_${CDATE}.nc - cd ../.. - 2.) skip - 3.) skip - 4.) Mapping files needed for mksurfdata_map - cd mkmapdata - setenv GRIDFILE ../mkmapgrids/SCRIPgrid_${GRIDNAME}_nomask_${CDATE}.nc - ./mkmapdata.sh -r $GRIDNAME -f $GRIDFILE -t regional - cd ../.. - 5.) skip - 6.) Generate domain file for datm and CLM - cd $CIMEROOT/tools/mapping/gen_domain_files/src - gmake - cd .. - setenv OCNDOM domain.ocn_noocean.nc - setenv ATMDOM domain.lnd.{$GRIDNAME}_noocean.nc - ./gen_domain -m $MAPFILE -o $OCNDOM -l $ATMDOM - 7.) Create surface dataset for CLM - cd mksurfdata_map/src - gmake - cd .. - ./mksurfdata.pl -r usrspec -usr_gname $GRIDNAME -usr_gdate $CDATE - 8.) skip - 9.) skip - -V. Notes on which input datasets are needed for CLM - - global or regional/single-point grids - - need fsurdata and fatmlndfrc - - fsurdata ---- from mksurfdata_map in step (III.7) - fatmlndfrc -- use the domain.lnd file from gen_domain in step (III.6) - diff --git a/tools/README.filecopies b/tools/README.filecopies deleted file mode 100644 index 5ab2bc96d1..0000000000 --- a/tools/README.filecopies +++ /dev/null @@ -1,38 +0,0 @@ -tools/README.filecopies May/26/2011 - -There are several files that are copies of the original files from -either CTSM src/main, cime/src/share/utils, -cime/src/share/unit_test_stubs, or copies from other tool -directories. By having copies the tools can all be made stand-alone, -but any changes to the originals will have to be put into the tool -directories as well. - -I. Files that are IDENTICAL: - - 1. csm_share files copied that should be identical to cime/share/utils: - - shr_kind_mod.F90 - shr_const_mod.F90 - shr_log_mod.F90 - shr_timer_mod.F90 - shr_string_mod.F90 - shr_file_mod.F90 - - 2. csm_share files copied that should be identical to cime/share/csm_share/unit_testers: - - test_mod.F90 - -II. Files with differences - - 1. csm_share files copied with differences: - - shr_sys_mod.F90 - Remove mpi abort and reference to shr_mpi_mod.F90. - - 2. CTSM src/utils files with differences: - - fileutils.F90 --- Remove use of masterproc and spmdMod and endrun in abortutils. - - 3. Files in mksurfdata_map - - mkvarpar.F90 - nanMod.F90 diff --git a/tools/README.testing b/tools/README.testing deleted file mode 100644 index 9c386a3b26..0000000000 --- a/tools/README.testing +++ /dev/null @@ -1,58 +0,0 @@ -tools/README.testing May/23/2011 - -There is automated testing for all of the tools and scripts under this tools directory. -The tests are in the test/tools directory and are any of the scripts -that have "tools" in the name. There are several assumptions made in order for the -testing to work. - - -1.) Executable name is the same as the directory name - -The name of the executable program is the same as the directory name of the tool. - -2.) Build works the same for any Fortran tools - -The build for any Fortran tools should work the same way, with the same options -and required files for it. The files: Makefile, Mkdepends, Filepath and Srcfile -are expected to exist in the tool "src" sub-directory. To make maintaining these files easier -in general the Makefile and Mkdepends files should be kept identical other than -default settings for OPT and SMP and the output executable name. - -Options to the Makefile: - - LIB_NETCDF --- Library directory location of NetCDF. (defaults to /usr/local/lib) - INC_NETCDF --- Include directory location of NetCDF. (defaults to /usr/local/include) - MOD_NETCDF --- Module directory location of NetCDF. (defaults to $LIB_NETCDF) - USER_FC ------ Allow user to override the default Fortran compiler specified in Makefile. - USER_FCTYP --- Allow user to override the default type of Fortran compiler - (Linux and USER_FC=ftn only). - USER_CC ------ Allow user to override the default C compiler specified in Makefile - (Linux only). - USER_LINKER -- Allow user to override the default linker specified in Makefile. - SMP ---------- Shared memory Multi-processing (TRUE or FALSE) [default is FALSE] - OPT ---------- Use optimized options. (TRUE or FALSE) - -3.) Successful completion of the tool ends with "Successfully ..." - -After the tool completes it should have an unique string telling of the -successful completion of the file that is searchable in the log file starting -with "Successfully ". If this string isn't found in the log file, it -will be assumed by the test setup that the test failed. - -4.) NetCDF files are created or modified - -It is assumed that NetCDF files are created and/or modified by the process. And if -NetCDF files are NOT created -- something went wrong. For some scripts that copy files -to other locations this means an "-nomv" option needs to be invoked (and one provided) -so that it leaves the files created in the current directory. - -5.) Namelist examples exist .* namelist files - -To specify options for the running of the tool, sample namelist files -are provided or a sample run options file. These files can EITHER be in the -tool directory OR the ../../test/tools/nl_files directory. - -6.) Specific tests for run scripts - -For tools that have scripts to create namelists and run the tool for you, there -are customized tests to run these tools. diff --git a/tools/mkmapdata/README b/tools/mkmapdata/README deleted file mode 100644 index b865e72f2d..0000000000 --- a/tools/mkmapdata/README +++ /dev/null @@ -1,87 +0,0 @@ -$CTSMROOT/tools/mkmapdata/README Jun/08/2018 - -The routines in this directory create a mapping dataset from -SCRIP grid files to map from one grid to another. These mapping files -are used by either CLM or mksurfdata_map to regrid from one resolution -to another. - -The script uses ESMF and requires that ESMF be built and the path -for ESMF binary files (using the program ESMF_RegridWeightGen) -be given as input to the script. You need to build at least -two versions, one with mpiuni and one with mpi. Both versions -also need to be built with NetCDF rather than the default -IO version. - -Currently uses: ESMF7.0.0 - -Do the following for help with the different options to the script... - - ./mkmapdata.sh -help - -The following steps provide a method to create the executable -and generate the grid map dataset: - -0) Background tasks you only have to do once - - a.) Export the input SCRIP grid files for the resolutions you'll need - - Most of these files are on the Subversion inputdata server at... - - https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata/lnd/clm2/mappingdata/grids/ - - Supported machines also have a copy on the CESM DIN_LOC_ROOT location - for that machine. - - b.) Obtain and build the versions of ESMF required for this script - -The version needs to support ESMF_RegridWeightGen and support the -options passed to it in the mkmapdata.sh script. As such it needs -to be built with NetCDF. You also need to build at least one -version with mpiuni and one with an mpi library. You also need -a version that supports the options: --netcdf4, --64bit_offset -and --src_type UGRID. - - http://www.earthsystemmodeling.org/ - -You may need more than one version to do everything above. On cheyenne -we use ESMF7.0.0. - -The version of NetCDF used with ESMF needs to be version 4.1 or higher -and compiled with the NetCDF4 file format enabled (with HDF5 compression). -That will enable the --netcdf4 and --64bit_offset options to be used. - -1) cd to this directory - -2) Create map dataset(s) - Option A.) Use mkmapdata.sh directly - run script(e.g.): (see header of mkmapdata.sh for other environment that can be set) - - Example for standard resolutions - ./mkmapdata.sh -r 10x15 - Example for non-standard resolutions where you provide an input SCRIP grid file. - ./mkmapdata.sh -f - - Option B.) Alternatively, run regridbatch.sh to run mkmapdata.sh for a bunch of - different resolutions. - - Option C.) Alternatively, run mknoocnmap.pl to create a single-point/regional - map for an area without ocean. - - ./mknoocnmap.pl -help # for help on this script - -3) move (and rename if appropriate) generated map datasets - to $DIN_LOC_ROOT/lnd/clm/mappingdata/maps, etc. - - -Important files: - - regridbatch.sh ------- Script to run mkmapdata.sh for many resolutions on cheyenne - regridgeyser.sh ------ Script to run mkmapdata.sh for many resolutions on geyser - mvNimport.sh --------- Script to copy and import mapping files in for many resolutions - mkmapdata.sh --------- Script to create mapping datasets for a given resolution - - mknoocnmap.pl -------- Script to create unity mapping dataset for single-point - or regional studies over land-only (no ocean). - mkunitymap.ncl ------- NCL script to create a unity map -- ran by above script - rmdups.ncl ----------- NCL script to remove duplicate mapping points - diff --git a/tools/mkmapdata/createXMLEntries.pl b/tools/mkmapdata/createXMLEntries.pl deleted file mode 100755 index c65e6888f7..0000000000 --- a/tools/mkmapdata/createXMLEntries.pl +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env perl - -# Creates a file giving XML entries for all the mapping files in the -# current directory (mapping_entries.txt). Also creates another file -# giving commands to move these files to the inputdata space -# (mv_cmds.sh). -# -# Should be run with no arguments. -# -# See also bld/namelist_files/createMapEntry.pl, and mvNimport.sh in -# the current directory for scripts that share some of the -# functionality of this script. - -# Bill Sacks -# March, 2013 - -use strict; - -# ---------------------------------------------------------------------- -# FUNCTIONS -# ---------------------------------------------------------------------- - -# Given a map filename, returns a hash giving the resolutions and -# masks implicit in that filename. -# Inputs: -# - filename -# Output: -# - hash containing: -# - filename -# - from_res -# - from_mask -# - to_res -# - to_mask -# Or does a bare return if the filename doesn't match the expected pattern -sub get_resolutions_and_masks { - my $filename = shift; - - # The following match assumes that the destination mask is - # "nomask". This match will tolerate underscores in the - # destination grid (e.g., 5x5_amazon), but be careful about - # underscores in the source grid or source mask! - if ($filename =~ m/^map_(.*)_(.*)_to_(.*)_nomask/) { - my $from_res=$1; - my $from_mask=$2; - my $to_res=$3; - my $to_mask="nomask"; - - my %info = (filename => $filename, - from_res => $from_res, - from_mask => $from_mask, - to_res => $to_res, - to_mask => $to_mask); - - return %info; - } - else { - return; - } -} - - -# ---------------------------------------------------------------------- -# PARAMETERS DEFINED HERE -# ---------------------------------------------------------------------- - -my $CSMDATA = "/glade/p/cesm/cseg/inputdata"; -my $maps_dir = "lnd/clm2/mappingdata/maps"; # directory where mapping files are stored within the inputdata directory - -# ---------------------------------------------------------------------- -# BEGIN MAIN PROGRAM -# ---------------------------------------------------------------------- - -my @files = glob "map*.nc"; - -# Make a hash containing all of the files at each destination resolution. -# The keys of the hash are destination resolutions; the values are -# references to arrays of hash references, where these low-level -# hashes are the return values of get_resolutions_and_masks. -my %dest_resols; -foreach my $file (@files) { - my %info = get_resolutions_and_masks($file); - if (%info) { - my $to_res = $info{'to_res'}; - push @{$dest_resols{$to_res}}, \%info; - } - else { - warn "WARNING: $file doesn't match expected mapping filename pattern; skipping\n"; - } -} - -open MAP_ENTRIES, ">", "mapping_entries.txt"; -open MV_CMDS, ">", "mv_cmds.sh"; - -# Output xml entries (and mv commands) grouped by destination resolution -foreach my $to_res (sort keys %dest_resols) { - my $full_maps_dir = "$maps_dir/$to_res"; - - foreach my $info_ref (@{$dest_resols{$to_res}}) { - my $filename = ${$info_ref}{'filename'}; - my $from_res = ${$info_ref}{'from_res'}; - my $from_mask = ${$info_ref}{'from_mask'}; - my $to_res = ${$info_ref}{'to_res'}; - my $to_mask = ${$info_ref}{'to_mask'}; - - print MV_CMDS "mv $filename $CSMDATA/$full_maps_dir/$filename\n"; - print MAP_ENTRIES "$full_maps_dir/$filename\n"; - } - - # Print blank line between destination grids - print MAP_ENTRIES "\n"; -} - -system "chmod", "755", "mv_cmds.sh"; -close MAP_ENTRIES; -close MV_CMDS; diff --git a/tools/mkmapdata/mkmapdata.sh b/tools/mkmapdata/mkmapdata.sh deleted file mode 100755 index 995bde9e63..0000000000 --- a/tools/mkmapdata/mkmapdata.sh +++ /dev/null @@ -1,539 +0,0 @@ -#!/bin/bash -#---------------------------------------------------------------------- -# -# mkmapdata.sh -# -# Create needed mapping files for mksurfdata_map and CLM. -# -# Example to run for an output resolution of 4x5 -# -# mkmapdata.sh -r 4x5 -# -# valid arguments: -# -f Input grid filename -# -t Output type, supported values are [regional, global] -# -r Output resolution -# -b use batch mode (not default) -# -l list mapping files required (so can use check_input_data to get them) -# -d debug usage -- display mkmapdata that will be run but don't execute them -# -v verbose usage -- log more information on what is happening -# -h displays this help message -# -# You can also set the following env variables: -# -# ESMFBIN_PATH - Path to ESMF binaries -# CSMDATA ------ Path to CESM input data -# MPIEXEC ------ Name of mpirun executable -# REGRID_PROC -- Number of MPI processors to use -# -#---------------------------------------------------------------------- -echo $0 -dir=${0%/*} -if [ "$dir" = "$0" ];then - dir="." -fi -outfilelist="clm.input_data_list" -default_res="10x15" - -#---------------------------------------------------------------------- -# SET SOME DEFAULTS -- if not set via env variables outside - -if [ -z "$CSMDATA" ]; then - CSMDATA=/glade/p/cesm/cseg/inputdata -fi -#---------------------------------------------------------------------- -# Usage subroutine -usage() { - echo "" - echo "**********************" - echo "usage:" - echo "./mkmapdata.sh" - echo "" - echo "valid arguments: " - echo "[-f|--gridfile ] " - echo " Full pathname of model SCRIP grid file to use " - echo " This variable should be set if this is not a supported grid" - echo " This variable will override the automatic generation of the" - echo " filename generated from the -res argument " - echo " the filename is generated ASSUMING that this is a supported " - echo " grid that has entries in the file namelist_defaults_clm.xml" - echo " the -r|--res argument MUST be specied if this argument is specified" - echo "[-r|--res ]" - echo " Model output resolution (default is $default_res)" - echo "[-t|--gridtype ]" - echo " Model output grid type" - echo " supported values are [regional,global], (default is global)" - echo "[-b|--batch]" - echo " Toggles batch mode usage (and run with mpi). If you want to run in batch mode" - echo " you need to have a separate batch script for a supported machine" - echo " that calls this script interactively - you cannot submit this" - echo " script directly to the batch system" - echo "[-l|--list]" - echo " List mapping files required (use check_input_data to get them)" - echo " also writes data to $outfilelist" - echo "[-d|--debug]" - echo " Toggles debug-only (don't actually run mkmapdata just echo what would happen)" - echo "[-h|--help] " - echo " Displays this help message" - echo "[-v|--verbose]" - echo " Toggle verbose usage -- log more information on what is happening " - echo "" - echo " You can also set the following env variables:" - echo " ESMFBIN_PATH - Path to ESMF binaries " - echo " (default is determined by machine running on)" - echo " CSMDATA ------ Path to CESM input data" - echo " (default is $CSMDATA)" - echo " MPIEXEC ------ Name of mpirun executable" - echo " (default is determined by machine running on)" - echo " REGRID_PROC -- Number of MPI processors to use" - echo " (default is $REGRID_PROC)" - echo "" - echo "**defaults can be determined on the machines: cheyenne or geyser" - echo "" - echo "**pass environment variables by preceding above commands " - echo " with 'env var1=setting var2=setting '" - echo "**********************" -} -#---------------------------------------------------------------------- -# runcmd subroutine -#---------------------------------------------------------------------- - -runcmd() { - cmd=$@ - if [ -z "$cmd" ]; then - echo "No command given to the runcmd function" - exit 3 - fi - if [ "$verbose" = "YES" ]; then - echo "$cmd" - fi - if [ "$debug" != "YES" ]; then - ${cmd} - rc=$? - else - rc=0 - fi - if [ $rc != 0 ]; then - echo "Error status returned from mkmapdata script" - exit 4 -undo - fi - return 0 -} - -#---------------------------------------------------------------------- -# Process input arguments -#---------------------------------------------------------------------- - -interactive="YES" -debug="no" -res="default" -type="global" -phys="clm4_5" -verbose="no" -list="no" -outgrid="" -gridfile="default" - -while [ $# -gt 0 ]; do - case $1 in - -v|-V) - verbose="YES" - ;; - -b|--batch) - interactive="NO" - ;; - -d|--debug) - debug="YES" - ;; - -l|--list) - debug="YES" - list="YES" - ;; - -r|--res) - res=$2 - shift - ;; - -f|--gridfile) - gridfile=$2 - shift - ;; - -t|--gridtype) - type=$2 - shift - ;; - -h|--help ) - usage - exit 0 - ;; - * ) - echo "ERROR:: invalid argument sent in: $2" - usage - exit 1 - ;; - esac - shift -done - -echo "Script to create mapping files required by mksurfdata_map" - -#---------------------------------------------------------------------- -# Determine output scrip grid file -#---------------------------------------------------------------------- - -# Set general query command used below -QUERY="$dir/../../bld/queryDefaultNamelist.pl -silent -namelist clmexp " -QUERY="$QUERY -justvalue -options sim_year=2000 -csmdata $CSMDATA" -echo "query command is $QUERY" - -echo "" -DST_EXTRA_ARGS="" -if [ "$gridfile" != "default" ]; then - GRIDFILE=$gridfile - echo "Using user specified scrip grid file: $GRIDFILE" - if [ "$res" = "default" ]; then - echo "When user specified grid file is given you MUST set the resolution (as the name of your grid)\n"; - exit 1 - fi - - # For now, make some assumptions about user-specified grids -- - # that they are SCRIP format, and small enough to not require - # large file support for the output mapping file. In the future, - # we may want to provide command-line options to allow the user to - # override these defaults. - DST_LRGFIL="none" - DST_TYPE="SCRIP" -else - if [ "$res" = "default" ]; then - res=$default_res - fi - - QUERYARGS="-res $res -options lmask=nomask" - - # Find the output grid file for this resolution using the XML database - QUERYFIL="$QUERY -var scripgriddata $QUERYARGS -onlyfiles" - if [ "$verbose" = "YES" ]; then - echo $QUERYFIL - fi - GRIDFILE=`$QUERYFIL` - echo "Using default scrip grid file: $GRIDFILE" - - # Determine extra information about the destination grid file - DST_LRGFIL=`$QUERY -var scripgriddata_lrgfile_needed $QUERYARGS` - DST_TYPE=`$QUERY -var scripgriddata_type $QUERYARGS` - if [ "$DST_TYPE" = "UGRID" ]; then - # For UGRID, we need extra information: the meshname variable - dst_meshname=`$QUERY -var scripgriddata_meshname $QUERYARGS` - DST_EXTRA_ARGS="$DST_EXTRA_ARGS --dst_meshname $dst_meshname" - fi -fi - -if [ "$type" = "global" ] && [ `echo "$res" | grep -c "1x1_"` = 1 ]; then - echo "This is a regional resolution and yet it is being run as global, set type with '-t' option\n"; - exit 1 -fi -if [ "$type" = "global" ] && [ `echo "$res" | grep -c "5x5_"` = 1 ]; then - echo "This is a regional resolution and yet it is being run as global, set type with '-t' option\n"; - exit 1 -fi -echo "Output grid resolution is $res" -if [ -z "$GRIDFILE" ]; then - echo "Output grid file was NOT found for this resolution: $res\n"; - exit 1 -fi - -if [ "$list" = "YES" ]; then - echo "outgrid = $GRIDFILE" - echo "outgrid = $GRIDFILE" > $outfilelist -elif [ ! -f "$GRIDFILE" ]; then - echo "Input SCRIP grid file does NOT exist: $GRIDFILE\n"; - echo "Make sure CSMDATA environment variable is set correctly" - exit 1 -fi - -#---------------------------------------------------------------------- -# Determine all input grid files and output file names -#---------------------------------------------------------------------- - -if [ "$phys" = "clm4_5" ]; then - grids=( \ - "0.5x0.5_AVHRR" \ - "0.25x0.25_MODIS" \ - "0.5x0.5_MODIS" \ - "3x3min_LandScan2004" \ - "3x3min_MODIS-wCsp" \ - "3x3min_USGS" \ - "5x5min_nomask" \ - "5x5min_IGBP-GSDP" \ - "5x5min_ISRIC-WISE" \ - "5x5min_ORNL-Soil" \ - "10x10min_nomask" \ - "10x10min_IGBPmergeICESatGIS" \ - "3x3min_GLOBE-Gardner" \ - "3x3min_GLOBE-Gardner-mergeGIS" \ - "0.9x1.25_GRDC" \ - "360x720cru_cruncep" \ - "1km-merge-10min_HYDRO1K-merge-nomask" \ - ) - -else - echo "ERROR: Unknown value for phys: $phys" - exit 1 -fi - -# Set timestamp for names below -CDATE="c"`date +%y%m%d` - -# Set name of each output mapping file -# First determine the name of the input scrip grid file -# for each of the above grids -declare -i nfile=1 -for gridmask in ${grids[*]} -do - grid=${gridmask%_*} - lmask=${gridmask#*_} - - QUERYARGS="-res $grid -options lmask=$lmask,glc_nec=10 " - - QUERYFIL="$QUERY -var scripgriddata $QUERYARGS -onlyfiles" - if [ "$verbose" = "YES" ]; then - echo $QUERYFIL - fi - INGRID[nfile]=`$QUERYFIL` - if [ "$list" = "YES" ]; then - echo "ingrid = ${INGRID[nfile]}" - echo "ingrid = ${INGRID[nfile]}" >> $outfilelist - fi - - OUTFILE[nfile]=map_${grid}_${lmask}_to_${res}_nomask_aave_da_$CDATE.nc - - # Determine extra information about the source grid file - SRC_EXTRA_ARGS[nfile]="" - SRC_LRGFIL[nfile]=`$QUERY -var scripgriddata_lrgfile_needed $QUERYARGS` - SRC_TYPE[nfile]=`$QUERY -var scripgriddata_type $QUERYARGS` - if [ "${SRC_TYPE[nfile]}" = "UGRID" ]; then - # For UGRID, we need extra information: the meshname variable - src_meshname=`$QUERY -var scripgriddata_meshname $QUERYARGS` - SRC_EXTRA_ARGS[nfile]="${SRC_EXTRA_ARGS[nfile]} --src_meshname $src_meshname" - fi - - nfile=nfile+1 -done - -#---------------------------------------------------------------------- -# Determine supported machine specific stuff -#---------------------------------------------------------------------- - -hostname=`hostname` -if [ -n "$NERSC_HOST" ]; then - hostname=$NERSC_HOST -fi -echo "Hostname = $hostname" -case $hostname in - ##cheyenne - cheyenne* | r* ) - . /glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/bash - if [ -z "$REGRID_PROC" ]; then - REGRID_PROC=36 - fi - esmfvers=7.0.0 - intelvers=17.0.1 - module load esmf_libs/$esmfvers - module load intel/$intelvers - module load ncl - module load nco - - if [ "$interactive" = "NO" ]; then - mpi=mpi - mpitype="mpich2" - else - mpi=uni - mpitype="mpiuni" - fi - module load esmf-${esmfvers}-ncdfio-${mpi}-O - if [ -z "$ESMFBIN_PATH" ]; then - ESMFBIN_PATH=`grep ESMF_APPSDIR $ESMFMKFILE | awk -F= '{print $2}'` - fi - if [ -z "$MPIEXEC" ]; then - MPIEXEC="mpiexec_mpt -np $REGRID_PROC" - fi - ;; - - ## DAV - pronghorn* | caldera* | geyser* ) - . /glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/bash - if [ -z "$REGRID_PROC" ]; then - REGRID_PROC=8 - fi - esmfvers=7.0.0 - intelvers=15.0.0 - #intelvers=12.1.5 - module purge - module load intel/$intelvers - module load ncl - module load nco - #module load impi - module load mpich-slurm - module load netcdf/4.3.3.1 - #module load netcdf/4.3.0 - module load ncarcompilers - - module load esmf - - if [ "$interactive" = "NO" ]; then - mpi=mpi - mpitype="mpich2" - else - mpi=uni - mpitype="mpiuni" - fi - export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/lib64:/glade/apps/opt/usr/lib:/usr/lib:/glade/u/ssg/ys/opt/intel/12.1.0.233/composer_xe_2011_sp1.11.339/compiler/lib/intel64:/lib:/lib64" - module load esmf-${esmfvers}-ncdfio-${mpi}-O - if [ -z "$ESMFBIN_PATH" ]; then - ESMFBIN_PATH=`grep ESMF_APPSDIR $ESMFMKFILE | awk -F= '{print $2}'` - fi - echo "ESMFMKFILE: $ESMFMKFILE" - echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - - if [ -z "$MPIEXEC" ]; then - MPIEXEC="mpiexec -n $REGRID_PROC" - fi - echo "ERROR: Currently can NOT run on the DAV cluster, because ESMF is not configured correctly" - exit 1 - ;; - - ##no other machine currently supported - *) - echo "Machine $hostname NOT recognized" - ;; - -esac - -# Error checks -if [ ! -d "$ESMFBIN_PATH" ]; then - echo "Path to ESMF binary directory does NOT exist: $ESMFBIN_PATH" - echo "Set the environment variable: ESMFBIN_PATH" - exit 1 -fi - -#---------------------------------------------------------------------- -# Generate the mapping files needed for surface dataset generation -#---------------------------------------------------------------------- - -# Resolve interactive or batch mode command -# NOTE - if you want to run in batch mode - you need to have a separate -# batch file that calls this script interactively - you cannot submit -# this script to the batch system - -if [ "$interactive" = "NO" ]; then - echo "Running in batch mode using MPI" - if [ -z "$MPIEXEC" ]; then - echo "Name of MPI exec to use was NOT set" - echo "Set the environment variable: MPIEXEC" - exit 1 - fi - if [ ! -x `which ${MPIEXEC%% *}` ]; then - echo "The MPIEXEC pathname given is NOT an executable: ${MPIEXEC%% *}" - echo "Set the environment variable: MPIEXEC or run in interactive mode without MPI" - exit 1 - fi - mpirun=$MPIEXEC - echo "Running in batch mode" -else - mpirun="" -fi - -ESMF_REGRID="$ESMFBIN_PATH/ESMF_RegridWeightGen" -if [ ! -x "$ESMF_REGRID" ]; then - echo "ESMF_RegridWeightGen does NOT exist in ESMF binary directory: $ESMFBIN_PATH\n" - echo "Upgrade to a newer version of ESMF with this utility included" - echo "Set the environment variable: ESMFBIN_PATH" - exit 1 -fi - -# Remove previous log files -rm PET*.Log - -# -# Now run the mapping for each file, checking that input files exist -# and then afterwards that the output mapping file exists -# -declare -i nfile=1 -until ((nfile>${#INGRID[*]})); do - echo "Creating mapping file: ${OUTFILE[nfile]}" - echo "From input grid: ${INGRID[nfile]}" - echo "For output grid: $GRIDFILE" - echo " " - if [ -z "${INGRID[nfile]}" ] || [ -z "$GRIDFILE" ] || [ -z "${OUTFILE[nfile]}" ]; then - echo "Either input or output grid or output mapping file is NOT set" - exit 3 - fi - if [ ! -f "${INGRID[nfile]}" ]; then - echo "Input grid file does NOT exist: ${INGRID[nfile]}" - if [ ! "$list" = "YES" ]; then - exit 2 - fi - fi - if [ ! -f "$GRIDFILE" ]; then - echo "Output grid file does NOT exist: $GRIDFILE" - exit 3 - fi - - # Determine what (if any) large file support is needed. Use the - # most extreme large file support needed by either the source file - # or the destination file. - if [ "$DST_LRGFIL" = "netcdf4" ] || [ "${SRC_LRGFIL[nfile]}" = "netcdf4" ]; then - lrgfil="--netcdf4" - elif [ "$DST_LRGFIL" = "64bit_offset" ] || [ "${SRC_LRGFIL[nfile]}" = "64bit_offset" ]; then - lrgfil="--64bit_offset" - elif [ "$DST_LRGFIL" = "none" ] && [ "${SRC_LRGFIL[nfile]}" = "none" ]; then - lrgfil="" - else - echo "Unknown LRGFIL type:" - echo "DST_LRGFIL = $DST_LRGFIL" - echo "SRC_LRGFIL = ${SRC_LRGFIL[nfile]}" - exit 4 - fi - - # Skip if file already exists - if [ -f "${OUTFILE[nfile]}" ]; then - echo "Skipping creation of ${OUTFILE[nfile]} as already exists" - else - - cmd="$mpirun $ESMF_REGRID --ignore_unmapped -s ${INGRID[nfile]} " - cmd="$cmd -d $GRIDFILE -m conserve -w ${OUTFILE[nfile]}" - if [ $type = "regional" ]; then - cmd="$cmd --dst_regional" - fi - - cmd="$cmd --src_type ${SRC_TYPE[nfile]} ${SRC_EXTRA_ARGS[nfile]} --dst_type $DST_TYPE $DST_EXTRA_ARGS" - cmd="$cmd $lrgfil" - - runcmd $cmd - - if [ "$debug" != "YES" ] && [ ! -f "${OUTFILE[nfile]}" ]; then - echo "Output mapping file was NOT created: ${OUTFILE[nfile]}" - exit 6 - fi - # add some metadata to the file - HOST=`hostname` - history="$ESMF_REGRID" - runcmd "ncatted -a history,global,a,c,"$history" ${OUTFILE[nfile]}" - runcmd "ncatted -a hostname,global,a,c,$HOST -h ${OUTFILE[nfile]}" - runcmd "ncatted -a logname,global,a,c,$LOGNAME -h ${OUTFILE[nfile]}" - - # check for duplicate mapping weights - newfile="rmdups_${OUTFILE[nfile]}" - runcmd "rm -f $newfile" - runcmd "env MAPFILE=${OUTFILE[nfile]} NEWMAPFILE=$newfile ncl $dir/rmdups.ncl" - if [ -f "$newfile" ]; then - runcmd "mv $newfile ${OUTFILE[nfile]}" - fi - fi - - nfile=nfile+1 -done - -echo "Successffully created needed mapping files for $res" - -exit 0 diff --git a/tools/mkmapdata/mknoocnmap.pl b/tools/mkmapdata/mknoocnmap.pl deleted file mode 100755 index 67e65e6a70..0000000000 --- a/tools/mkmapdata/mknoocnmap.pl +++ /dev/null @@ -1,297 +0,0 @@ -#!/usr/bin/env perl -# -# mknoocnmap.pl Erik Kluzek -# Dec/07/2011 -# -# Create SCRIP grid and mapping files for a single-point or region -# that is assumed to be a land land-only region. -# -use Cwd; -use strict; -use English; -use IO::File; -use Getopt::Long; - -# -# Global constants -# -my $degsiz = 0.1; - -#----------------------------------------------------------------------------------------------- -# Set the directory that contains this scripts. If the command was issued using a -# relative or absolute path, that path is in $ProgDir. Otherwise assume the -# command was issued from the current working directory. - -(my $ProgName = $0) =~ s!(.*)/!!; # name of this script -my $ProgDir = $1; # name of directory containing this script -- may be a - # relative or absolute path, or null if the script - # is in - # the user's PATH -my $cmdline = "@ARGV"; # Command line arguments to script -my $cwd = getcwd(); # current working directory -my $scrdir; # absolute pathname of directory that contains this script -my $nm = "${ProgName}::"; # name to use if script dies -if ($ProgDir) { - $scrdir = absolute_path($ProgDir); -} else { - $scrdir = $cwd; -} - - -#----------------------------------------------------------------------------------------------- - -sub usage { - die < Center latitude,longitude of the grid to create. - -name [-or -n] Name to use to describe point - -OPTIONS - -dx Size of total grid in degrees in longitude direction - (default is $degsiz) - -dy Size of total grid in degrees in latitude direction - (default is $degsiz) - -silent [or -s] Make output silent - -help [or -h] Print usage to STDOUT. - -verbose [or -v] Make output more verbose. - -nx Number of longitudes (default is 1) - -ny Number of latitudes (default is 1) -EOF -} - -#----------------------------------------------------------------------------------------------- - -sub get_latlon { -# -# Return the latitude and longitude of the input string and validate it -# - my $string = shift; - my $desc = shift; - my $dx = shift; - my $dy = shift; - - my $lat = undef; - my $lon = undef; - my $valreal1 = "[+-]?[0-9]*\.?[0-9]*[EedDqQ]?[0-9+-]*"; - - if ( $string =~ /^($valreal1)\s*,\s*($valreal1)$/ ) { - $lat = $1; - $lon = $2; - } else { - die <<"EOF"; -** $ProgName - Error in entering latitude/longitude for $desc ** -EOF - } - if ( $dx <= 0.0 || $dx > 360. ) { - die <<"EOF"; -** $ProgName - Bad value for dx (=$dx) for $desc ** - } - if ( $dy <= 0.0 || $dy > 180. ) { - die <<"EOF"; -** $ProgName - Bad value for dy (=$dy) for $desc ** - } - if ( ($lat < -90.+$dy/2.0) || ($lat > 90.0-$dy/2.0) ) { - die <<"EOF"; -** $ProgName - Bad value for latitude (=$lat) for $desc ** -EOF - } - if ( ($lon < $dx/2.0) || ($lon > 360.0-$dx/2.0) ) { - die <<"EOF"; -** $ProgName - Bad value for longitude (=$lat) for $desc ** -EOF - } - return( $lat, $lon ); - -} - -#------------------------------------------------------------------------------- - -sub absolute_path { -# -# Convert a pathname into an absolute pathname, expanding any . or .. characters. -# Assumes pathnames refer to a local filesystem. -# Assumes the directory separator is "/". -# - my $path = shift; - my $cwd = getcwd(); # current working directory - my $abspath; # resulting absolute pathname - -# Strip off any leading or trailing whitespace. (This pattern won't match if -# there's embedded whitespace. - $path =~ s!^\s*(\S*)\s*$!$1!; - -# Convert relative to absolute path. - - if ($path =~ m!^\.$!) { # path is "." - return $cwd; - } elsif ($path =~ m!^\./!) { # path starts with "./" - $path =~ s!^\.!$cwd!; - } elsif ($path =~ m!^\.\.$!) { # path is ".." - $path = "$cwd/.."; - } elsif ($path =~ m!^\.\./!) { # path starts with "../" - $path = "$cwd/$path"; - } elsif ($path =~ m!^[^/]!) { # path starts with non-slash character - $path = "$cwd/$path"; - } - - my ($dir, @dirs2); - my @dirs = split "/", $path, -1; # The -1 prevents split from stripping trailing nulls - # This enables correct processing of the input "/". - - # Remove any "" that are not leading. - for (my $i=0; $i<=$#dirs; ++$i) { - if ($i == 0 or $dirs[$i] ne "") { - push @dirs2, $dirs[$i]; - } - } - @dirs = (); - - # Remove any "." - foreach $dir (@dirs2) { - unless ($dir eq ".") { - push @dirs, $dir; - } - } - @dirs2 = (); - - # Remove the "subdir/.." parts. - foreach $dir (@dirs) { - if ( $dir !~ /^\.\.$/ ) { - push @dirs2, $dir; - } else { - pop @dirs2; # remove previous dir when current dir is .. - } - } - if ($#dirs2 == 0 and $dirs2[0] eq "") { return "/"; } - $abspath = join '/', @dirs2; - return( $abspath ); -} - -#------------------------------------------------------------------------------- - -# Process command-line options - -my %opts = ( - ctr => undef, - help => undef, - name => undef, - nx => 1, - ny => 1, - dx => $degsiz, - dy => $degsiz, - silent => 0, - verbose => 0, - ); - -GetOptions( - "p|centerpoint=s" => \$opts{'ctr'}, - "n|name=s" => \$opts{'name'}, - "nx=i" => \$opts{'nx'}, - "ny=i" => \$opts{'ny'}, - "dx=f" => \$opts{'dx'}, - "dy=f" => \$opts{'dy'}, - "h|help" => \$opts{'help'}, - "s|silent" => \$opts{'silent'}, - "v|verbose" => \$opts{'verbose'}, -) or usage(); - -# Check for unparsed arguments -if (@ARGV) { - print "ERROR: unrecognized arguments: @ARGV\n"; - usage(); -} - -if ( $opts{'verbose'} && $opts{'silent'} ) { - print "ERROR: Can NOT set both silent and verbose at once!\n"; - usage(); -} -my $printlev; -if ( $opts{'verbose'} ) { - $printlev = 2; -} elsif ( $opts{'silent'} ) { - $printlev = 0; -} else { - $printlev = 1; -} - -if ( ! defined($opts{'ctr'}) ) { - print "ERROR: MUST set the center point\n"; - usage(); -} -if ( ! defined($opts{'name'}) ) { - print "ERROR: MUST set the name of the point\n"; - usage(); -} -my $name = $opts{'name'}; - -my ($lat,$lon) = get_latlon( $opts{'ctr'}, $name, $opts{'dx'}, $opts{'dy'} ); -my $S_lat = $lat - $opts{'dy'}/2.0; -my $N_lat = $lat + $opts{'dy'}/2.0; -my $W_lon = $lon - $opts{'dx'}/2.0; -my $E_lon = $lon + $opts{'dx'}/2.0; - -my $nx = $opts{'nx'}; -my $ny = $opts{'ny'}; -if ( $opts{'nx'} < 1 ) { - print "ERROR: nx MUST be greater than or equal to 1\n"; - usage(); -} -if ( $opts{'ny'} < 1 ) { - print "ERROR: ny MUST be greater than or equal to 1\n"; - usage(); -} - -#----------------------------------------------------------------------------------------------- -my $print; -if ( $printlev > 1 ) { - $print = "PRINT=TRUE"; -} - -# Creation date -my $cdate = `date +%y%m%d`; chomp( $cdate ); - -if ( $printlev > 0 ) { - print "\n\nCreate SCRIP grid and mapping files for a single-point\n"; -} -# land grid... -my $grddir = absolute_path( "$scrdir/../mkmapgrids" ); -my $grid1 = "$grddir/SCRIPgrid_${name}_nomask_c${cdate}.nc"; -my $cmdenv = "env S_LAT=$S_lat W_LON=$W_lon N_LAT=$N_lat E_LON=$E_lon " . - "NX=$nx NY=$ny PTNAME=$name $print "; - -chdir( "$grddir" ); -my $cmd = "$cmdenv GRIDFILE=$grid1 ncl mkscripgrid.ncl"; -if ( $printlev > 0 ) { - print "Create land SCRIP gridfile\n"; - print "Execute: $cmd\n"; -} -system( $cmd ); - -# ocean grid... -my $grid2 = "$grddir/SCRIPgrid_${name}_noocean_c${cdate}.nc"; -my $cmd = "$cmdenv GRIDFILE=$grid2 IMASK=0 ncl mkscripgrid.ncl"; -if ( $printlev > 0 ) { - print "Create ocean SCRIP gridfile\n"; - print "Execute: $cmd\n"; -} -system( $cmd ); - -# Now create a unity mapping between the two... -# Note reversal of grid1 & grid2, because we want an ocean -> land -# mapping file -chdir( "$scrdir" ); -my $mapfile = "map_${name}_noocean_to_${name}_nomask_aave_da_${cdate}.nc"; -my $cmd = "env GRIDFILE1=$grid2 GRIDFILE2=$grid1 MAPFILE=$mapfile " . - "$print ncl $scrdir/mkunitymap.ncl"; - -if ( $printlev > 0 ) { - print "Create unity mapping file between the two gridfile\n"; - print "Execute: $cmd\n"; -} -system( $cmd ); - -if ( $printlev > 0 ) { - print "\n\nSuccessfully created grid/mapping files for single-point\n"; -} diff --git a/tools/mkmapdata/mkunitymap.ncl b/tools/mkmapdata/mkunitymap.ncl deleted file mode 100644 index ce0c17f988..0000000000 --- a/tools/mkmapdata/mkunitymap.ncl +++ /dev/null @@ -1,160 +0,0 @@ -; -; mkunitymap.ncl -; -; Create a unity map file either between two identical grids or between two -; grids that do NOT intersect at all. -; -; Erik Kluzek -; Dec/07/2011 -; -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" -begin - ; Set a few constants needed later - cdate = systemfunc( "date +%y%m%d" ); - ldate = systemfunc( "date" ); - ; =========================================================================================================== - ; - ; IMPORTANT NOTE: EDIT THE FOLLOWING TO CUSTOMIZE or use ENV VARIABLE SETTINGS - ; Edit the following as needed to interpolate to a new resolution. - gridfile1 = getenv("GRIDFILE1"); ; Get name of the first SCRIP grid file - gridfile2 = getenv("GRIDFILE2"); ; Get name of the second SCRIP grid file - - outfilename = getenv("MAPFILE"); ; Get name of the output mapping file - - print_str = getenv("PRINT"); ; Do Extra printing for debugging - - if ( ismissing(gridfile1) )then - print( "ERROR: GRIDFILE1 is missing!" ); - exit - end if - if ( ismissing(gridfile2) )then - print( "ERROR: GRIDFILE2 is missing!" ); - exit - end if - if ( ismissing(outfilename) )then - print( "ERROR: MAPFILE is missing!" ); - exit - end if - if ( ismissing(print_str) )then - printn = False; - else - if ( print_str .eq. "TRUE" )then - printn = True; - else - printn = False; - end if - end if - - ; - ; Open up the input grid files - ; - nca = addfile( gridfile1, "r" ); - ncb = addfile( gridfile2, "r" ); - - system( "/bin/rm -f "+outfilename ); - if ( printn )then - print( "output mapping file to create: "+outfilename ); - end if - nc = addfile( outfilename, "c" ); - ; - ; Define dimensions - ; - n_a = dimsizes( nca->grid_center_lat ); - n_b = dimsizes( ncb->grid_center_lat ); - if ( n_a .ne. n_b )then - print( "ERROR: dimensions of input SCRIP grid files is NOT the same!" ); - exit - end if - if ( any(ncb->grid_imask .ne. 1.0d00) )then - print( "ERROR: the mask of the second file isn't identically 1!" ); - print( "(second file should be land grid file)"); - exit - end if - chkvars = (/ "grid_center_lat", "grid_center_lon", "grid_corner_lat", "grid_corner_lon" /); - do i = 1, dimsizes(chkvars)-1 - if ( any(nca->$chkvars(i)$ .ne. ncb->$chkvars(i)$) )then - print( "ERROR: the grid variables are different between the two files!: "+chkvars(i) ); - exit - end if - end do - n_s = n_a; - dimnames = (/ "n_a", "n_b", "n_s", "nv_a", "nv_b", "num_wgts", "src_grid_rank", "dst_grid_rank" /); - dsizes = (/ n_a, n_b, n_a, 4, 4, 1, 2, 2/); - is_unlim = (/ False, False, False, False, False, False, False, False /); - filedimdef( nc, dimnames, dsizes, is_unlim ); - - ; - ; Define grid dimensions - ; - filevardef( nc, "src_grid_dims", "integer", (/ "src_grid_rank" /)) - nc->src_grid_dims = (/nca->grid_dims/) - filevardef( nc, "dst_grid_dims", "integer", (/ "dst_grid_rank" /)) - nc->dst_grid_dims = (/ncb->grid_dims/) - - ; - ; Define variables - ; - cvars = (/ "yc", "xc", "yv", "xv", "mask" /); - gvars = (/ "grid_center_lat", "grid_center_lon", "grid_corner_lat", "grid_corner_lon", "grid_imask" /); - - do i = 0, dimsizes(cvars)-1 - var = cvars(i)+"_a"; - if ( cvars(i) .eq. "yv" .or. cvars(i) .eq. "xv" )then - dnamesa = (/ "n_a", "nv_a" /); - dnamesb = (/ "n_b", "nv_b" /); - else - dnamesa = (/ "n_a" /); - dnamesb = (/ "n_b" /); - end if - filevardef ( nc, var, typeof(nca->$gvars(i)$), dnamesa ); - filevarattdef ( nc, var, nca->$gvars(i)$ ); - nc->$var$ = (/ nca->$gvars(i)$ /); - var = cvars(i)+"_b"; - filevardef ( nc, var, typeof(nca->$gvars(i)$), dnamesb ); - filevarattdef ( nc, var, ncb->$gvars(i)$ ); - nc->$var$ = (/ ncb->$gvars(i)$ /); - delete( dnamesa ); - delete( dnamesb ); - end do - filevardef ( nc, "area_a", "double", (/ "n_a" /) ); - filevardef ( nc, "area_b", "double", (/ "n_b" /) ); - filevardef ( nc, "frac_a", "double", (/ "n_a" /) ); - filevardef ( nc, "frac_b", "double", (/ "n_b" /) ); - ; - ; Attributes - ; - nc->area_a@units = "square radians"; - nc->frac_a@units = "unitless"; - nc->area_b@units = nc->area_a@units; - nc->frac_b@units = nc->frac_a@units; - nc@conventions = "NCAR-CESM"; - nc@domain_a = gridfile1; - nc@domain_b = gridfile2; - nc@grid_file_src = gridfile1; - nc@grid_file_dst = gridfile2; - nc@title = "SCRIP mapping file between identical grids without ocean"; - nc@history = ldate+": create using mkunitymap.ncl"; - nc@Version = systemfunc( "git describe" ); - - ; - ; Fraction - ; - nc->frac_a = int2dble( (/nc->mask_a/) ); - nc->frac_b = int2dble( (/nc->mask_b/) ); - ; - ; Area - ; - nc->area_a = gc_qarea( nc->yv_a(:,:), nc->xv_a(:,:) ); - nc->area_b = gc_qarea( nc->yv_b(:,:), nc->xv_b(:,:) ); - ; - ; Weights - ; - filevardef ( nc, "col", "integer", (/ "n_s" /) ); - filevardef ( nc, "row", "integer", (/ "n_s" /) ); - filevardef ( nc, "S", "double", (/ "n_s" /) ); - - nc->col = ispan( 1, n_s, 1 ); - nc->row = nc->col; - nc->S = 1.0d00; - -end diff --git a/tools/mkmapdata/mvNimport.sh b/tools/mkmapdata/mvNimport.sh deleted file mode 100755 index 184a3fac25..0000000000 --- a/tools/mkmapdata/mvNimport.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# -# -# Batch script to move and import mapping files to inputdata -# for several resolutions. -# - -#---------------------------------------------------------------------- - -if [ -z "$CSMDATA" ]; then - CSMDATA=/fis/cgd/cseg/csm/inputdata -fi - -if [ ! -d "$CSMDATA" ]; then - echo "Environment variable CSMDATA is not set to a valid directory!" - exit 1 -fi - -mapdir="lnd/clm2/mappingdata/maps" -if [ ! -d "$CSMDATA/$mapdir" ]; then - echo "Environment variable CSMDATA is not set to a valid inputdata directory!" - exit 1 -fi - -if [ -z "$SVN_INP_DIR" ]; then - SVN_INP_DIR=https://svn-ccsm-inputdata.cgd.ucar.edu/trunk/inputdata -fi - -if [ $# -gt 0 ]; then - resols="" - for arg in $@; do - resols="$resols $arg" - done -else - echo "Run for all valid resolutions" - resols=`../bld/queryDefaultNamelist.pl -res list -silent` -fi -echo "Move and import mapping files for this list of resolutions: $resols" - -#---------------------------------------------------------------------- - -for res in $resols; do - echo "Move and import mapping files for: $res" - dir=$mapdir/$res - #---------------------------------------------------------------------- - files=(map_*${res}*_aave_da_c??????.nc) - if [ ${#files[*]} -lt 2 ]; then - echo "No mappingfiles found for $res" - exit 2 - else - if [ ! -d "$CSMDATA/$dir" ]; then - echo "Create mapping directory: $CSMDATA/$dir" - mkdir $CSMDATA/$dir - svn mkdir $SVN_INP_URL/$dir -m "Create mapping directory for $res" - fi - for file in ${files[*]}; do - echo "Copy and import file $file" - cp -p $file $CSMDATA/$dir - if [ $? -ne 0 ]; then - echo "Problem copying file: $file" - exit 3 - fi - chmod 0444 $CSMDATA/$dir/$file - if [ $? -ne 0 ]; then - echo "Problem chmod on file: $file" - exit 4 - fi - svn import $CSMDATA/$dir/$file $SVN_INP_DIR/$dir/$file -m "Mapping file for $res" - if [ $? -ne 0 ]; then - echo "Problem doing svn import on file: $file" - exit 4 - fi - done - fi -done diff --git a/tools/mkmapdata/regridbatch.sh b/tools/mkmapdata/regridbatch.sh deleted file mode 100755 index af31db30de..0000000000 --- a/tools/mkmapdata/regridbatch.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# -# -# Batch script to submit to create mapping files for all standard -# resolutions. If you provide a single resolution via "$RES", only -# that resolution will be used. In that case: If it is a regional or -# single point resolution, you should set '#PBS -n' to 1, and be sure -# that '-t regional' is specified in cmdargs. -# -# cheyenne specific batch commands: -#PBS -A P93300606 -#PBS -N regrid -#PBS -q regular -#PBS -l select=4:ncpus=2:mpiprocs=2:mem=109GB -#PBS -l walltime=2:00:00 -#PBS -j oe -#PBS -me -#PBS -V -#PBS -S /bin/bash - -#---------------------------------------------------------------------- -# Set parameters -#---------------------------------------------------------------------- - -#---------------------------------------------------------------------- -# Begin main script -#---------------------------------------------------------------------- - -if [ -z "$RES" ]; then - echo "Run for all valid resolutions" - resols=`../../bld/queryDefaultNamelist.pl -res list -silent` -else - resols="$RES" -fi -echo "Create mapping files for this list of resolutions: $resols" - -#---------------------------------------------------------------------- - -for res in $resols; do - echo "Create mapping files for: $res" -#---------------------------------------------------------------------- - cmdargs="-r $res" - - # For single-point and regional resolutions, tell mkmapdata that - # output type is regional - if [[ `echo "$res" | grep -c "1x1_"` -gt 0 || `echo "$res" | grep -c "5x5_"` -gt 0 ]]; then - res_type="regional" - else - res_type="global" - fi - - cmdargs="$cmdargs -t $res_type" - - echo "$res_type" - if [ "$res_type" = "regional" ]; then - echo "regional" - # For regional and (especially) single-point grids, we can get - # errors when trying to use multiple processors - so just use 1. - # We also do NOT set batch mode in this case, because some - # machines (e.g., yellowstone) do not listen to REGRID_PROC, so to - # get a single processor, we need to run mkmapdata.sh in - # interactive mode. - regrid_num_proc=1 - else - echo "global" - regrid_num_proc=8 - if [ ! -z "$LSFUSER" ]; then - echo "batch" - cmdargs="$cmdargs -b" - fi - if [ ! -z "$PBS_O_WORKDIR" ]; then - cd $PBS_O_WORKDIR - cmdargs="$cmdargs -b" - fi - fi - - echo "args: $cmdargs" - echo "time env REGRID_PROC=$regrid_num_proc ./mkmapdata.sh $cmdargs\n" - time env REGRID_PROC=$regrid_num_proc ./mkmapdata.sh $cmdargs -done diff --git a/tools/mkmapdata/regridgeyser.sh b/tools/mkmapdata/regridgeyser.sh deleted file mode 100755 index 82a4615dcd..0000000000 --- a/tools/mkmapdata/regridgeyser.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash -# -# -# Batch script to submit to create mapping files for all standard -# resolutions. If you provide a single resolution via "$RES", only -# that resolution will be used. In that case: If it is a regional or -# single point resolution, you should set '#SBATCH -n' to 1, and be sure -# that '-t regional' is specified in cmdargs. -# -# geyser specific batch commands: -#SBATCH -J regrid # job name -#SBATCH -n 8 -#SBATCH --ntasks-per-node=8 -#SBATCH --mem=450G -#SBATCH -t 03:00:00 -#SBATCH -A P93300606 -#SBATCH -p dav -#SBATCH -e regrid.%J.out # output filename -#SBATCH -o regrid.%J.err # error filename -# -# To submit this script: -# -# sbatch regridgeyser.sh -# -## IMPORTANT NOTE: -# -# environment variables can NOT be passed into DAV -# queues. Hence, this script MUST be edited to select -# what resolution to run for. - -#---------------------------------------------------------------------- -# Set parameters -#---------------------------------------------------------------------- -export RES=1x1_brazil - -#---------------------------------------------------------------------- -# Begin main script -#---------------------------------------------------------------------- - -if [ -z "$RES" ]; then - echo "Run for all valid resolutions" - resols=`../../bld/queryDefaultNamelist.pl -res list -silent` -else - resols="$RES" -fi -echo "Create mapping files for this list of resolutions: $resols" - -#---------------------------------------------------------------------- - -for res in $resols; do - echo "Create mapping files for: $res" -#---------------------------------------------------------------------- - cmdargs="-r $res" - - # For single-point and regional resolutions, tell mkmapdata that - # output type is regional - if [[ `echo "$res" | grep -c "1x1_"` -gt 0 || `echo "$res" | grep -c "5x5_"` -gt 0 ]]; then - res_type="regional" - else - res_type="global" - fi - - cmdargs="$cmdargs -t $res_type" - - echo "$res_type" - if [ "$res_type" = "regional" ]; then - echo "regional" - # For regional and (especially) single-point grids, we can get - # errors when trying to use multiple processors - so just use 1. - # We also do NOT set batch mode in this case, because some - # machines (e.g., yellowstone) do not listen to REGRID_PROC, so to - # get a single processor, we need to run mkmapdata.sh in - # interactive mode. - regrid_num_proc=1 - else - echo "global" - regrid_num_proc=$SLURM_NTASKS - if [ ! -z "$SLURM_JOB_ACCOUNT" ]; then - echo "batch" - cmdargs="$cmdargs -b" - fi - fi - - echo "args: $cmdargs" - echo "time env REGRID_PROC=$regrid_num_proc ./mkmapdata.sh $cmdargs\n" - time env REGRID_PROC=$regrid_num_proc ./mkmapdata.sh $cmdargs -done diff --git a/tools/mkmapdata/rmdups.ncl b/tools/mkmapdata/rmdups.ncl deleted file mode 100644 index d5fff40d53..0000000000 --- a/tools/mkmapdata/rmdups.ncl +++ /dev/null @@ -1,131 +0,0 @@ -; -; Remove duplicate weights from a mapping file. -; -; Mark Taylor (converted for use by CLM mkmapdata by Erik Kluzek) -; Sep/01/2011 -; -load "$NCARG_NCARG/nclscripts/csm/gsn_code.ncl" -load "$NCARG_NCARG/nclscripts/csm/gsn_csm.ncl" -load "$NCARG_NCARG/nclscripts/csm/contributed.ncl" -begin - ; =========================================================================================================== - ; - ; IMPORTANT NOTE: EDIT THE FOLLOWING TO CUSTOMIZE or use ENV VARIABLE SETTINGS - ; Edit the following as needed - ; - ; Input mapping file to remove duplicate weights from a mapping file - ; - mapfile = getenv("MAPFILE") ; Get the mapping file - newmapfile = getenv("NEWMAPFILE") ; The new mapping file to create - logname = getenv("LOGNAME") ; Logname of user running the script - - if ( ismissing(mapfile) )then - print( "You did NOT enter an input mapping file to convert" ) - status_exit( -1 ) - end if - if ( ismissing(newmapfile) )then - sdate = systemfunc( "date +%y%m%d" ); - newmapfile = mapfile+"_c"+sdate+".nc"; - end if - ; =========================================================================================================== - - if ( systemfunc("test -f "+mapfile+"; echo $?" ) .ne. 0 )then - print( "Input file does not exist or not found: "+mapfile ); - status_exit( -1 ) - end if - print("map file: "+mapfile) - f = addfile(mapfile,"r") ; Open netCDF files. - - - n_s = dimsizes(f->col) - if ( n_s .eq. 0 )then - print( "n_s is size zero, so no overlap points just return: " ); - exit - end if - - n_b = dimsizes(f->area_b) - n_a = dimsizes(f->area_a) - print("n_s = "+n_s+" max(row)="+max(f->row)+" max(col)="+max(f->col)) - - - - row = f->row - col = f->col - - - print("checking for dups, sorting...") - hash = new( n_s, double ) - hash = col - hash= hash + row*n_b - index1d=dim_pqsort(hash,1) - row2=row(index1d) - col2=col(index1d) - S=f->S - print("zeroing out any dups...") - ndups=0 - i0=0 - do i=1,n_s-1 - if ( (col2(i) .eq. col2(i0)) .and. (row2(i) .eq. row2(i0))) then - iorig1 = index1d(i0) - iorig2 = index1d(i) - ;print("dup row: "+row2(i)+" "+row2(i0)+" "+row(iorig1)+" "+row(iorig2)) - ;print("dup col: "+col2(i)+" "+col2(i0)+" "+col(iorig1)+" "+col(iorig2)) - ;print("removing "+iorig2+" keeping "+iorig1) - S(iorig1)=S(iorig1)+S(iorig2) - S(iorig2)=0 - ndups=ndups+1 - ; dont increment i0 - else - i0=i - end if - end do - delete(row2) - delete(col2) - if ( ndups .gt. 0) then - print("ndups = "+ndups) - print("compacting S...") - ns2 = n_s-ndups - S2 = new( ns2, double) - row2= new( ns2, integer) - col2 = new( ns2, integer) - ns2=0 - do i=0,n_s-1 - if (S(i) .ne. 0) then - S2(ns2)=S(i) - row2(ns2)=row(i) - col2(ns2)=col(i) - ns2=ns2+1 - end if - end do - print("removed "+ndups+" dups") - delete(S) - delete(row) - delete(col) - S=S2 - row=row2 - col=col2 - n_s = ns2 - print("writing new netcdf file") - cmdout = systemfunc("ncks -O -x -v S,row,col "+mapfile+" "+newmapfile) - nco = addfile(newmapfile,"rw") ; Open netCDF files. - nco->S = S - nco->row = row - nco->col = col - ldate = systemfunc( "date" ); - nco@history = nco@history + ":"+ldate + ": "; - nco@history = nco@history + " Removed duplicate weights from mapping file with: rmdups.ncl " - nco@rmdups_Logname = logname; - nco@rmdups_mod_date = ldate; - nco@rmdups_version = systemfunc( "git describe" ); - - print("Successfully removed duplicate weights from mapping file" ); - - else - - print("No duplicate weights to remove from mapping file" ); - - end if - - - -end diff --git a/tools/mkmapgrids/README b/tools/mkmapgrids/README deleted file mode 100644 index cc6d2cb644..0000000000 --- a/tools/mkmapgrids/README +++ /dev/null @@ -1,22 +0,0 @@ -$CTSMROOT/tools/mkmapgrids/README June08/2018 - -NCL script to create a SCRIP grid file for a regular lat/lon grid. - -To use the script, set the following environment variables - -Required (or defaults to a single point over Boulder Colorado) - -PTNAME ! name of your grid -S_LAT ! Southern latitude corner -N_LAT ! Northern latitude corner -E_LON ! Eastern longitude corner -W_LON ! Western longitude corner - -Optional: - -NX ! Number of grid points along longitude (default 1) -NY ! Number of grid points along latitude (default 1) -IMASK ! 0 or 1, mask to use if all points are active or not (default active) -PRINT ! TRUE/FALSE do extra verbose printing or not (default FALSE) -GRIDFILE ! Output filename - diff --git a/tools/mkmapgrids/mkscripgrid.ncl b/tools/mkmapgrids/mkscripgrid.ncl deleted file mode 100644 index 0bfb26671c..0000000000 --- a/tools/mkmapgrids/mkscripgrid.ncl +++ /dev/null @@ -1,167 +0,0 @@ -; -; mkscripgrid.ncl -; -; Create SCRIP grid and mapping file for a land-only point or region. -; Requires NCL 6.1.0 or later for the ESMF regridding functions -; -; Erik Kluzek -; Dec/07/2011 -; -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl" -begin - ; =========================================================================================================== - ; Set a few constants needed later - cdate = systemfunc( "date +%y%m%d" ); - ldate = systemfunc( "date" ); - ; - ; IMPORTANT NOTE: EDIT THE FOLLOWING TO CUSTOMIZE or use ENV VARIABLE SETTINGS - ; Edit the following as needed to interpolate to a new resolution. - ; - ; Input resolution and position - ; - name = getenv("PTNAME"); ; Get name of this point - - latS = stringtodouble( getenv("S_LAT") ); ; Get south latitude from env variable - latN = stringtodouble( getenv("N_LAT") ); ; Get north latitude from env variable - lonE = stringtodouble( getenv("E_LON") ); ; Get east longitude from env variable - lonW = stringtodouble( getenv("W_LON") ); ; Get west longitude from env variable - - nx = stringtointeger( getenv("NX" ) ); ; Get number of grids along longitude lines - ny = stringtointeger( getenv("NY" ) ); ; Get number of grids along latitude lines - - imask = stringtointeger( getenv("IMASK") ); ; Get imask to use from env variable - - print_str = getenv("PRINT"); ; Do Extra printing for debugging - - outfilename = getenv("GRIDFILE"); ; Get filename from env variable - - if ( ismissing(nx) )then - nx = 1; - end if - if ( ismissing(ny) )then - ny = 1; - end if - if ( ismissing(imask) )then - imask = 1; - end if - if ( ismissing(name) )then - name = nx+"x"+ny+"pt_US-UMB"; - end if - if ( ismissing(latS) )then - latS = 45.5098; - end if - if ( ismissing(latN) )then - latN = 45.6098; - end if - if ( ismissing(lonW) )then - lonW = 275.2362; - end if - if ( ismissing(lonE) )then - lonE = 275.3362; - end if - if ( ismissing(print_str) )then - printn = False; - else - if ( print_str .eq. "TRUE" )then - printn = True; - else - printn = False; - end if - end if - - if ( ismissing(outfilename) )then - if ( imask .eq. 1 )then - outfilename = "SCRIPgrid_"+name+"_nomask_c"+cdate+".nc"; - else - if ( imask .eq. 0 )then - outfilename = "SCRIPgrid_"+name+"_noocean_c"+cdate+".nc"; - else - outfilename = "SCRIPgrid_"+name+"_mask_c"+cdate+".nc"; - end if - end if - end if - - system( "/bin/rm -f "+outfilename ); - if ( printn )then - print( "output file: "+outfilename ); - end if - -function fspan1up( fbegin [*]:double, fend [*]:double, number:integer ) -; -; An "fspan" that can handle size of 1 and up. -; Do fspan for arrays of two or more, or average of end points for array of one. -; -local farray; -begin - if ( number .eq. 1) then - farray = (/ (fbegin + fend) / 2.0d00 /); - else - farray = fspan( fbegin, fend, number ); - end if - return( farray ); -end - - ; - ; Compute derived quantities - ; - - delX = (lonE - lonW) / int2dble(nx); - delY = (latN - latS) / int2dble(ny); - - lonCenters = fspan1up( (lonW + delX/2.d0), (lonE - delX/2.d0), nx) - latCenters = fspan1up( (latS + delY/2.d0), (latN - delY/2.d0), ny) - lon = new( (/ny, nx/), "double" ); - lat = new( (/ny, nx/), "double" ); - lonCorners = new( (/ny, nx, 4/), "double" ); - latCorners = new( (/ny, nx, 4/), "double" ); - do i = 0, nx-1 - lat(:,i) = latCenters; - latCorners(:,i,0) = latCenters - delY/2.d0; - latCorners(:,i,1) = latCenters + delY/2.d0; - latCorners(:,i,2) = latCenters + delY/2.d0; - latCorners(:,i,3) = latCenters - delY/2.d0; - end do - do j = 0, ny-1 - lon(j,:) = lonCenters; - lonCorners(j,:,0) = lonCenters - delX/2.d0; - lonCorners(j,:,1) = lonCenters - delX/2.d0; - lonCorners(j,:,2) = lonCenters + delX/2.d0; - lonCorners(j,:,3) = lonCenters + delX/2.d0; - end do - - ; for some reason, "No_FillValue" isn't working in the case where imask=1 - Mask2D = new( (/ny,nx/), "integer", "No_FillValue" ) - Mask2D(:,:) = imask - gridSize = delX+"x"+delY - - ; - ; Create SCRIP grid file - ; - - Opt = True - Opt@Mask2D = Mask2D - Opt@GridCornerLat = latCorners - Opt@GridCornerLon = lonCorners - Opt@Title = "SCRIP grid file for "+name - if (printn) then - Opt@Debug = True - end if - curvilinear_to_SCRIP(outfilename, lat, lon, Opt) - - ; - ; Add global attributes to file - ; - - nc = addfile( outfilename, "w" ); - nc@history = ldate+": create using mkscripgrid.ncl"; - nc@comment = "Ocean is assumed to non-existant at this point"; - nc@Version = systemfunc( "git describe" ); - if ( printn )then - print( "================================================================================================" ); - print( "Successfully created SCRIP grid file: "+outfilename); - end if - - ; =========================================================================================================== - -end diff --git a/tools/mkprocdata_map/README b/tools/mkprocdata_map/README deleted file mode 100644 index f5ac71b1ff..0000000000 --- a/tools/mkprocdata_map/README +++ /dev/null @@ -1,152 +0,0 @@ -$CTSMROOT/tools/mkprocdata_map/clm/README Oct 30, 2012 - -This directory contains scripts for regridding CLM output from an -unstructured grid (1-d output using the lndgrid dimension) to a 2-d -(lat/lon) grid. The regridding method is area-conservative. - -The following steps provide a method to create the necessary inputs to -this script, produce an executable, and regrid output: - -In the following instructions, the "original" resolution is the -resolution of the run on an unstructured grid, and the "target" -resolution is the regular lat/lon resolution to which you will regrid -the output. - -(0) Install prerequisites: - - (a) If you do not already have a mapping file from the original - resolution to the target resolution, you will need the - ESMF_RegridWeightGen tool installed on your system. - - (b) The wrapper scripts describe below require the netCDF operators - (NCO). These nco tools (ncks, ncap2, etc.) must be in your path. - -(1) Determine the target resolution. This resolution must be a regular - lat/lon resolution. Generally, this should be a resolution close - to the resolution of the CLM run. For example, when running CLM at - ne30_np4 resolution, a good target resolution is 0.9x1.25 (i.e., - finite volume 1 degree: f09); when running CLM at ne120_np4 - resolution, a good target resolution is 0.23x0.31 (i.e., finitev - volume 1/4 degree: f02). - -(2) Perform a short CLM run at the target resolution, producing at - least one history file. After this run completes, set the - environment variable $TEMPLATE_FILE to point to one of the history - files created by this run. - -(3) Create a conservative mapping file from the original resolution to - the target resolution using the ESMF regrid weight generator. The - basic method for doing this is: - - $ESMF_PATH/bin/ESMF_RegridWeightGen -s $INGRID -d $OUTGRID -m conserve -w $MAP_FILE -i - - where $INGRID gives the path to a SCRIP grid file at the original - resolution, $OUTGRID gives the path to a SCRIP grid file at the - template resolution, and $MAP_FILE gives the name of the mapping - file that will be generated. - - However, you may want to wrap this in a job script to run it on - multiple processors (using mpirun), and you may have to set other - machine-specific environment variables. You can follow the method - used in tools/mkmapdata/mkmapdata.sh. - -(4) Build the mkprocdata_map tool. From the current directory, do the - following: - - > cd src - > gmake - > cd .. - - By default code compiles optimized so it's reasonably fast. If you want - to use the debugger, with bounds-checking, and float trapping on do the - following: - gmake OPT=FALSE - See Also: See the components/clm/tools/README file for notes about setting - the path for NetCDF. - - This builds the mkprocdata_map executable. However, you generally - will not want to run this executable directly: instead, you should - use one of the wrapper scripts described below. - -(5) Do the regridding using one of the wrapper scripts in this - directory. To determine which script is most appropriate: Do you - need to regrid just one or a few output files, or most/all of the - output files in a directory? - - (a) If you are regridding just one or a few output files, you can - use mkprocdata_map_wrap. Its usage is: - - > mkprocdata_map_wrap -i input_file -o output_file -m $MAP_FILE -t $TEMPLATE_FILE - - where: - - input_file is the CLM history file you want to regrid - - output_file is the name of the regridded file that will be - created - - $MAP_FILE is the ESMF conservative mapping file created in - step (3) - - $TEMPLATE_FILE is a CLM history file at the target resolution, - created in step (2) - - You may also specify the '-l' option to this script. This option - determines whether to determine landfrac and related variables - by regridding the input file (when you don't give the '-l' - option), or by copying these variables from the template file - (when you give the '-l' option). These variables are important - for computing regional and global averages, e.g., as is done in - the land diagnostics package. Each method may be reasonable, - depending on the purposes of the regridding. For example, if you - want regional/global integrals to be as true as possible to the - original run, you should run withOUT the '-l' option; but if you - want to compare regional/global integrals between the original - run and a run at the target resolution, then you may want to run - WITH the '-l' option. - - Run 'mkprocdata_map_wrap -h' for full usage - - (b) If you need to regrid most or all of the output files in a - directory, you can use the convenience script - mkprocdata_map_all. This script runs mkprocdata_map_wrap on all - files matching a given pattern within a directory. Its basic - usage is the following, done from a directory containing many - CLM history files: - - > /path/to/mkprocdata_map_all -p $CASE -m $MAP_FILE -t $TEMPLATE_FILE - - where: - - $CASE is the case name of the original run (this -p argument - is actually more general: it provides the prefix of files on - which mkprocdata_map_wrap should be run; run - 'mkprocdata_map_all -h' for details) - - $MAP_FILE is the ESMF conservative mapping file created in - step (3) - - $TEMPLATE_FILE is a CLM history file at the target resolution, - created in step (2) - - There are a number of additional optional arguments to this - script, including the '-l' option described in (a), above. Run - 'mkprocdata_map_all -h' for full usage. - - ------------------------------------------------------------------------- -Some miscellaneous notes on the scripts contained here ------------------------------------------------------------------------- - -- area vs. area_regridded in the output of mkprocdata_map_wrap and - mkprocdata_map_all: The 'area' variable gives the actual grid cell - area on the destination grid. The 'area_regridded' variable is the - result of performing the regridding procedure on the 'area' variable - in the original source data. This seems to be the wrong way to - regrid areas (e.g., it leads to global totals that do not make - sense). However, area_regridded is left in the regridded files as a - diagnostic. BUT PLEASE USE CAUTION IF USING THIS AREA_REGRIDDED - VALUE, UNLESS YOU KNOW WHAT IT REALLY REPRESENTS! - -- At least as of this writing (Oct 29, 2012), there is insufficient - metadata on the CLM history files to regrid all variables - perfectly. In particular, note that many CLM history variables apply - only over a subset of the grid cell (e.g., over the non-lake portion - of the grid cell). Thus, to regrid these variables appropriately, we - would need to weight each grid cell's value by the portion of the - grid cell over which the field applies. However, doing this would - require metadata about each field that is not currently - available. diff --git a/tools/mkprocdata_map/README.filedescriptions b/tools/mkprocdata_map/README.filedescriptions deleted file mode 100644 index e657e7c7d9..0000000000 --- a/tools/mkprocdata_map/README.filedescriptions +++ /dev/null @@ -1,25 +0,0 @@ -$CTSMROOT/tools/mkprocdata_map/README.filedescriptions Erik Kluzek - 06/08/2018 - -mkprocdata_map_all ------------ Script to run over a list of files -mkprocdata_map_wrap ----------- Main script to actually use -mkprocdata_map_functions.bash - Bash shell functions to use in other scripts -README ------------------------ Description and how to run -src --------------------------- Directory with FORTRAN source code - -Also there are some sample files that can be used for testing under inputdata in - -$DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map - -See how this is done by looking at the file for testing mkprocdata_map: - -../../test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 - -Which does something like the following: - -./mkprocdata_map_wrap \ --i $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc \ --o ne30output_onf19grid.nc \ --m $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc \ --t $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc - diff --git a/tools/mkprocdata_map/mkprocdata_map_all b/tools/mkprocdata_map/mkprocdata_map_all deleted file mode 100755 index 73e8abedf1..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_all +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash - -# This script runs mkprocdata_map_wrap on all files matching a given -# pattern within a directory. - -# Created by Bill Sacks, 5-26-11 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -function Usage { - script_name=`basename $0` - echo "Usage: $script_name -p prefix -m map_file -t template_file [-d] [-e executable-path] [-h] [-i] [-l] [-o output_suffix] [-r diRectory] [-s suffix]" - echo "" - echo "This script runs mkprocdata_map_wrap on all files matching a" - echo "given pattern within a directory." - echo "" - echo "'prefix' gives the prefix of the files on which" - echo "mkprocdata_map_wrap should be run; 'prefix' should NOT contain" - echo "wildcard characters. The prefix is also used to translate" - echo "from input to output file names (see examples below)" - echo "" - echo "'map_file' gives the name (and full path if not in the current" - echo "directory) of the mapping file" - echo "" - echo "'template_file' gives the name (and full path if not in the" - echo "current directory) of the template file, from which we read" - echo "lats, lons and some other variables" - echo "" - echo "The following are optional arguments:" - echo "" - echo "[-d]: Do a test (Dry run): do all error-checking on" - echo " arguments and print commands that would be run, but" - echo " don't actually run commands" - echo "" - echo "[-e executable-path]: Gives the path of the mkprocdata_map executable." - echo " If not specified, the path is determined by the" - echo " default value in mkprocdata_map_wrap." - echo "" - echo "[-h]: Print this help message and exit" - echo "" - echo "[-i]: Ignore (skip) existing output files; if this option is" - echo " not specified, then the script dies with an error if" - echo " any of the desired output files already exist" - echo "" - echo "[-l]: Option passed to mkprocdata_map_wrap: rather than computing" - echo " landfrac and related variables by regridding the input file," - echo " instead copy these variables directly from the template file." - echo "" - echo "[-o output_suffix]: suffix to append to the end of the prefix" - echo " on the output files" - echo " If not specified, '_2d' is used" - echo "" - echo "[-r diRectory]: Do the processing in the given directory." - echo " If not specified, processing is done in the" - echo " current working directory." - echo "" - echo "[-s suffix]: Run mkprocdata_map_wrap on all files matching the" - echo " pattern '\${prefix}\${suffix}'. The suffix can -" - echo " and often will - contain wildcards; but" - echo " remember to enclose 'suffix' in quotes to" - echo " prevent shell expansion." - echo " If not specified, run mkprocdata_map_wrap on all" - echo " files matching '\${prefix}*'" - echo "" - echo "" - echo "Example: $script_name -p Ib14_ne30np4_gx1v6 -m map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc -t Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "This will run mkprocdata_map_wrap on all files whose names begin" - echo "with 'Ib14_ne30np4_gx1v6' in the current directory, using the" - echo "mapping file named 'map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc'" - echo "and the template file named 'Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc'" - echo "For an input file named:" - echo " Ib14_ne30np4_gx1v6.clm2.h0.0001-01-06-00000.nc" - echo "The output file will be named:" - echo " Ib14_ne30np4_gx1v6_2d.clm2.h0.0001-01-06-00000.nc" - echo "" - echo "Example: $script_name -o '_remap' -s '*.h0.0001*.nc' -p Ib14_ne30np4_gx1v6 -m map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc -t Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "This will run mkprocdata_map_wrap on all files whose names match" - echo "the pattern 'Ib14_ne30np4_gx1v6*.h0.0001*.nc', in the" - echo "current directory, using the mapping file named" - echo "'map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc' and the" - echo "template file named Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "For an input file named:" - echo " Ib14_ne30np4_gx1v6.clm2.h0.0001-01-06-00000.nc" - echo "The output file will be named:" - echo " Ib14_ne30np4_gx1v6_remap.clm2.h0.0001-01-06-00000.nc" - echo "" -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -script_dir=`dirname $0` -source $script_dir/mkprocdata_map_functions.bash - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -# define default values: -# required arguments: -prefix="" -map_file="" -template_file="" -# optional arguments: -directory="." -ignore_existing=0 -output_suffix="_2d" -suffix="*" -dryrun=0 -extra_args="" - -while getopts de:hilm:o:p:r:s:t: opt; do - case $opt in - d) dryrun=1;; - e) extra_args="$extra_args -e $OPTARG";; - h) Usage; exit;; - i) ignore_existing=1;; - l) extra_args="$extra_args -l";; - m) map_file=$OPTARG;; - o) output_suffix=$OPTARG;; - p) prefix=$OPTARG;; - r) directory=$OPTARG;; - s) suffix=$OPTARG;; - t) template_file=$OPTARG;; - \?) Usage; exit 1 - esac -done - -# ---------------------------------------------------------------------- -# Error checking on arguments -# ---------------------------------------------------------------------- - -if [ -z "$prefix" ]; then - echo "Must specify a prefix" - Usage - exit 1 -fi - -check_file_arg "$map_file" "map" -check_file_arg "$template_file" "template" - -# Make sure directory is really a directory -if [ ! -d $directory ]; then - echo "ERROR: $directory is not a directory" - echo "" - Usage - exit 1 -fi - - -# ---------------------------------------------------------------------- -# Change to desired directory -# ---------------------------------------------------------------------- - -olddir=`pwd` -cd $directory - -# ---------------------------------------------------------------------- -# Get list of files matching the given pattern; make sure there really -# are some matching files -# ---------------------------------------------------------------------- - -files=`ls ${prefix}${suffix}` -if [ $? -ne 0 ]; then - echo "ERROR trying to find files matching: ${prefix}${suffix}" - echo "" - Usage - exit 1 -fi - -# ---------------------------------------------------------------------- -# Loop through files matching the given pattern; run mkprocdata_map_wrap for each -# ---------------------------------------------------------------------- - -for infile in $files; do - outfile=${infile/$prefix/${prefix}${output_suffix}} - if [ -e $outfile ]; then - if [ $ignore_existing -eq 0 ]; then - echo "" - echo "ERROR: output file $outfile already exists" - exit 1 - else - echo "" - echo "WARNING: output file $outfile already exists: skipping" - echo "" - fi - - else # outfile does not exist - echo "" - do_cmd "${script_dir}/mkprocdata_map_wrap -i $infile -o $outfile -m $map_file -t $template_file $extra_args" $dryrun - fi -done - -# ---------------------------------------------------------------------- -# Clean up -# ---------------------------------------------------------------------- - -cd $olddir - diff --git a/tools/mkprocdata_map/mkprocdata_map_functions.bash b/tools/mkprocdata_map/mkprocdata_map_functions.bash deleted file mode 100644 index bbc359fb89..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_functions.bash +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# This file contains functions used by other bash scripts in this directory. - -# This function echoes the command given by $1 (cmd), then executes it. -# However, if $2 (dryrun) is non-zero, then it only does the echo, not the execution. -# Usage: do_cmd cmd dryrun -# Returns 0 on success, non-zero on failure; if there is an error, the error string is echoed. -function do_cmd { - if [[ $# -ne 2 ]]; then - echo "ERROR in do_cmd: wrong number of arguments: expected 2, received $#" - exit 1 - fi - - local cmd=$1 - local dryrun=$2 - - echo $cmd - if [ $dryrun -eq 0 ]; then - # We use 'eval $cmd' rather than just '$cmd', because the - # latter doesn't work right if the command contains any quoted - # strings (e.g., svn ci -m "this is my message") - eval $cmd - if [ $? -ne 0 ]; then - echo "ERROR in do_cmd: error executing command" - exit 2 - fi - fi - - return 0 -} - -# make sure that the given file name argument was provided, and that -# the file exists; exit the script with a usage message if either of -# these is not true -# -# Usage: check_file_arg filename_arg description -# (description is echoed if there is an error) -# Example: check_file_arg "$input_file" "input" -# (note that $input_file must be in quotes) -function check_file_arg { - local filename=$1 - local description=$2 - - if [ -z "$filename" ]; then - echo "ERROR: Must specify $description file" - Usage - exit 1 - fi - - if [ ! -f $filename ]; then - echo "ERROR: Can't find $description file: $filename" - Usage - exit 1 - fi -} - diff --git a/tools/mkprocdata_map/mkprocdata_map_wrap b/tools/mkprocdata_map/mkprocdata_map_wrap deleted file mode 100755 index 4744b0eacc..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_wrap +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/bash - -# This script is a wrapper around mkprocdata_map that runs that -# program and then copies some additional variables from the template -# file to the output file. It also does some additional pre and -# post-processing in order to create some additional variables. - -# Created by Bill Sacks, 5-25-11 - -# ---------------------------------------------------------------------- -# SET PARAMETERS HERE -# ---------------------------------------------------------------------- - -# comma-delimited list of extra variables to copy directly from -# template file; note that these variables should not be written out -# by mkprocdata_map (i.e., everything in this list should be listed in -# the 'ignore_var' function in mkprocdata_map.F90); however, there may -# be some variables in the 'ignore_var' function that are not listed -# here - e.g., variables that we treat specially. -copy_vars="lon,lat" - -# comma-delimited list of extra variables to copy from the template -# file if the -l option is specified -- this option says to copy -# landfrac and related variables. Note that some of these variables -# may be written out by mkprocdata_map, in which case they will be -# overwritten afterwards (slighly less efficient, but that keeps -# things simpler). -landfrac_copy_vars="landfrac,landmask,pftmask" - -# name of the executable; -# expected to be in the same directory as this script unless -e option is given -executable="mkprocdata_map" - -# minimum value for regridded pftmask variable for the output variable to be 1 -pftmask_min="1.e-6" - -# fill value for landmask -landmask_fill=-9999 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -function Usage { - script_name=`basename $0` - echo "Usage: $script_name -i input_file -o output_file -m map_file -t template_file [-e executable-path] [-h] [-l]" - echo "" - echo "This script runs mkprocdata_map with the given arguments (-i, -o, -m and -t)," - echo "then copies some additional variables from the template file" - echo "to the output file. It also does some additional pre and" - echo "post-processing in order to create some additional variables." - echo "" - echo "Additional optional arguments:" - echo "" - echo "[-e executable-path]: Gives the path of the mkprocdata_map executable." - echo " If not specified, the executable is assumed to be" - echo " in the same directory as this script." - echo "" - echo "[-h]: Print this help message and exit" - echo "" - echo "[-l]: Rather than computing landfrac and related variables" - echo "by regridding the input file, instead copy these variables" - echo "directly from the template file. The variables this pertains" - echo "to are:" - echo $landfrac_copy_vars -} - -# This function operates on a single variable in a file, changing all -# places where that variable is missing to some new (non-missing) -# value. The _FillValue attribute remains unchanged. -# Usage: change_missing_to_value varname newval infile outfile -# - varname: the name of the variable to change -# - newval: all instances of the missing value will be replaced with -# this new value -# - infile: input file name -# - outfile: output file name (can be the same as infile) -function change_missing_to_value { - if [[ $# -ne 4 ]]; then - echo "ERROR in change_missing_to_value: wrong number of arguments: expected 2, received $#" - exit 1 - fi - - varname=$1 - newval=$2 - infile=$3 - outfile=$4 - - varname_tmp=${varname}_tmp_$$ - - cat > cmds.nco.tmp.$$ <= $pftmask_min)' $output_file $output_file" 0 - do_cmd "ncks -O -x -v pftmask_float $output_file $output_file" 0 - - # --- Calculate landmask from landfrac --- - echo "" - - cat > cmds.nco.tmp.$$ < 0); -landmask_float.change_miss($landmask_fill); -landmask=int(landmask_float); -EOF - - do_cmd "ncap2 -O -S cmds.nco.tmp.$$ $output_file $output_file" 0 - rm cmds.nco.tmp.$$ - - change_missing_to_value landmask 0 $output_file $output_file - - # in the following, note that we need to manually set missing_value, because it doesn't get changed through the .set_miss call in nco: - do_cmd "ncatted -a long_name,landmask,o,c,'land/ocean mask (0.=ocean and 1.=land)' -a missing_value,landmask,o,i,$landmask_fill $output_file" 0 -fi - -echo "Successfully regridded data" diff --git a/tools/mkprocdata_map/src/Filepath b/tools/mkprocdata_map/src/Filepath deleted file mode 100644 index 9c558e357c..0000000000 --- a/tools/mkprocdata_map/src/Filepath +++ /dev/null @@ -1 +0,0 @@ -. diff --git a/tools/mkprocdata_map/src/Makefile b/tools/mkprocdata_map/src/Makefile deleted file mode 100644 index 6f07deb741..0000000000 --- a/tools/mkprocdata_map/src/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile for mksurfdata_map - -EXENAME = ../mkprocdata_map - -# Set optimization on by default -ifeq ($(OPT),$(null)) - OPT := TRUE -endif - -include Makefile.common \ No newline at end of file diff --git a/tools/mkprocdata_map/src/Makefile.common b/tools/mkprocdata_map/src/Makefile.common deleted file mode 100644 index ab79f94144..0000000000 --- a/tools/mkprocdata_map/src/Makefile.common +++ /dev/null @@ -1,360 +0,0 @@ -#----------------------------------------------------------------------- -# This Makefile is for building clm tools on AIX, Linux (with pgf90 or -# lf95 compiler), Darwin or IRIX platforms. -# -# These macros can be changed by setting environment variables: -# -# LIB_NETCDF --- Library directory location of netcdf. (defaults to /usr/local/lib) -# INC_NETCDF --- Include directory location of netcdf. (defaults to /usr/local/include) -# MOD_NETCDF --- Module directory location of netcdf. (defaults to $LIB_NETCDF) -# USER_FC ------ Allow user to override the default Fortran compiler specified in Makefile. -# USER_FCTYP --- Allow user to override the default type of Fortran compiler (linux and USER_FC=ftn only). -# USER_CC ------ Allow user to override the default C compiler specified in Makefile (linux only). -# USER_LINKER -- Allow user to override the default linker specified in Makefile. -# USER_CPPDEFS - Additional CPP defines. -# USER_CFLAGS -- Additional C compiler flags that the user wishes to set. -# USER_FFLAGS -- Additional Fortran compiler flags that the user wishes to set. -# USER_LDLAGS -- Additional load flags that the user wishes to set. -# SMP ---------- Shared memory Multi-processing (TRUE or FALSE) [default is FALSE] -# OPT ---------- Use optimized options. -# -#------------------------------------------------------------------------ - -# Set up special characters -null := - -# Newer makes set the CURDIR variable. -CURDIR := $(shell pwd) - -RM = rm - -# Check for the netcdf library and include directories -ifeq ($(LIB_NETCDF),$(null)) - LIB_NETCDF := /usr/local/lib -endif - -ifeq ($(INC_NETCDF),$(null)) - INC_NETCDF := /usr/local/include -endif - -ifeq ($(MOD_NETCDF),$(null)) - MOD_NETCDF := $(LIB_NETCDF) -endif - -# Set user specified Fortran compiler -ifneq ($(USER_FC),$(null)) - FC := $(USER_FC) -endif - -# Set user specified C compiler -ifneq ($(USER_CC),$(null)) - CC := $(USER_CC) -endif - -# Set if Shared memory multi-processing will be used -ifeq ($(SMP),$(null)) - SMP := FALSE -endif - -CPPDEF := $(USER_CPPDEFS) - -# Set optimization on by default -ifeq ($(OPT),$(null)) - OPT := TRUE -endif - -ifeq ($(OPT),TRUE) - CPPDEF := -DOPT -endif - -# Determine platform -UNAMES := $(shell uname -s) - -# Load dependency search path. -dirs := . $(shell cat Filepath) - -# Set cpp search path, include netcdf -cpp_dirs := $(dirs) $(INC_NETCDF) $(MOD_NETCDF) -cpp_path := $(foreach dir,$(cpp_dirs),-I$(dir)) # format for command line - -# Expand any tildes in directory names. Change spaces to colons. -# (the vpath itself is set elsewhere, based on this variable) -vpath_dirs := $(foreach dir,$(cpp_dirs),$(wildcard $(dir))) -vpath_dirs := $(subst $(space),:,$(vpath_dirs)) - -#Primary Target: build the tool -all: $(EXENAME) - -# Get list of files and build dependency file for all .o files -# using perl scripts mkSrcfiles and mkDepends - -SOURCES := $(shell cat Srcfiles) - -OBJS := $(addsuffix .o, $(basename $(SOURCES))) - -# Set path to Mkdepends script; assumes that any Makefile including -# this file is in a sibling of the src directory, in which Mkdepends -# resides -Mkdepends := ../src/Mkdepends - -$(CURDIR)/Depends: $(CURDIR)/Srcfiles $(CURDIR)/Filepath - $(Mkdepends) Filepath Srcfiles > $@ - - -# Architecture-specific flags and rules -#------------------------------------------------------------------------ -# AIX -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),AIX) -CPPDEF += -DAIX -cpre = $(null)-WF,-D$(null) -FPPFLAGS := $(patsubst -D%,$(cpre)%,$(CPPDEF)) -FFLAGS = -c -I$(INC_NETCDF) -q64 -qsuffix=f=f90 -qsuffix=f=f90:cpp=F90 \ - $(FPPFLAGS) -g -qfullpath -qarch=auto -qtune=auto -qsigtrap=xl__trcedump -qsclk=micro - -LDFLAGS = -L$(LIB_NETCDF) -q64 -lnetcdff -lnetcdf -ifneq ($(OPT),TRUE) - FFLAGS += -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en -qspillsize=4000 -C -else - FFLAGS += -O2 -qmaxmem=-1 -Q - LDFLAGS += -Q -endif -CFLAGS := -q64 -g $(CPPDEF) -O2 -FFLAGS += $(cpp_path) -CFLAGS += $(cpp_path) - -ifeq ($(SMP),TRUE) - FC = xlf90_r - FFLAGS += -qsmp=omp - LDFLAGS += -qsmp=omp -else - FC = xlf90 -endif - -endif - -#------------------------------------------------------------------------ -# Darwin -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),Darwin) - -# Set the default Fortran compiler -ifeq ($(USER_FC),$(null)) - FC := g95 -endif -ifeq ($(USER_CC),$(null)) - CC := gcc -endif - -CFLAGS := -g -O2 -CPPDEF += -DSYSDARWIN -DDarwin -DLINUX -LDFLAGS := - -ifeq ($(FC),g95) - - CPPDEF += -DG95 - FFLAGS := -c -fno-second-underscore $(CPPDEF) $(cpp_path) -I$(MOD_NETCDF) - ifeq ($(OPT),TRUE) - FFLAGS += -O2 - else - FFLAGS += -g -fbounds-check - endif - -endif - -ifeq ($(FC),gfortran) - - CPPDEF += -DG95 - FFLAGS := -c -fno-second-underscore $(CPPDEF) $(cpp_path) -I$(MOD_NETCDF) \ - -fno-range-check - ifeq ($(OPT),TRUE) - FFLAGS += -O2 - else - FFLAGS += -g -fbounds-check - endif - -endif - -ifeq ($(FC),ifort) - - CPPDEF += -DFORTRANUNDERSCORE - FFLAGS += -c -ftz -g -fp-model precise $(CPPDEF) $(cpp_path) \ - -convert big_endian -assume byterecl -traceback -FR - LDFLAGS += -m64 - - ifneq ($(OPT),TRUE) - FFLAGS += -CB -O0 - else - FFLAGS += -O2 - endif - ifeq ($(SMP),TRUE) - FFLAGS += -qopenmp - LDFLAGS += -qopenmp - endif -endif - -ifeq ($(FC),pgf90) - - CPPDEF += -DFORTRANUNDERSCORE - FFLAGS += -c $(CPPDEF) $(cpp_path) - ifneq ($(OPT),TRUE) - FFLAGS += -g -Ktrap=fp -Mbounds -Kieee - else - FFLAGS += -fast -Kieee - endif - - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - -endif - -ifeq ($(CC),icc) - CFLAGS += -m64 -g - ifeq ($(SMP),TRUE) - CFLAGS += -qopenmp - endif -endif -ifeq ($(CC),pgcc) - CFLAGS += -g -fast -endif - -CFLAGS += $(CPPDEF) $(cpp_path) -LDFLAGS += -L$(LIB_NETCDF) -lnetcdf -lnetcdff - -endif - -#------------------------------------------------------------------------ -# Linux -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),Linux) - ifeq ($(USER_FC),$(null)) - FC := ifort - FCTYP := ifort - else - ifeq ($(USER_FC),ftn) - ifneq ($(USER_FCTYP),$(null)) - FCTYP := $(USER_FCTYP) - else - FCTYP := pgf90 - endif - else - FCTYP := $(USER_FC) - endif - endif - CPPDEF += -DLINUX -DFORTRANUNDERSCORE - CFLAGS := $(CPPDEF) - LDFLAGS := $(shell $(LIB_NETCDF)/../bin/nf-config --flibs) - FFLAGS = - - ifeq ($(FCTYP),pgf90) - CC := pgcc - ifneq ($(OPT),TRUE) - FFLAGS += -g -Ktrap=fp -Mbounds -Kieee - else - FFLAGS += -fast -Kieee - CFLAGS += -fast - endif - - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - - endif - - ifeq ($(FCTYP),lf95) - ifneq ($(OPT),TRUE) - FFLAGS += -g --chk a,e,s,u -O0 - else - FFLAGS += -O - endif - # Threading only works by putting thread memory on the heap rather than the stack - # (--threadheap). - # As of lf95 version 6.2 the thread stacksize limits are (still) too small to run - # even small - # resolution problems (FV at 10x15 res fails). - ifeq ($(SMP),TRUE) - FFLAGS += --openmp --threadheap 4096 - LDFLAGS += --openmp --threadheap 4096 - endif - endif - ifeq ($(FCTYP),pathf90) - FFLAGS += -extend_source -ftpp -fno-second-underscore - ifneq ($(OPT),TRUE) - FFLAGS += -g -O0 - else - FFLAGS += -O - endif - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - endif - ifeq ($(FCTYP),ifort) - - FFLAGS += -ftz -g -fp-model precise -convert big_endian -assume byterecl -traceback -FR - CFLAGS += -m64 -g - LDFLAGS += -m64 - - ifneq ($(OPT),TRUE) - FFLAGS += -CB -O0 - else - FFLAGS += -O2 - endif - ifeq ($(SMP),TRUE) - FFLAGS += -qopenmp - CFLAGS += -qopenmp - LDFLAGS += -qopenmp - endif - endif - FFLAGS += -c -I$(INC_NETCDF) $(CPPDEF) $(cpp_path) - CFLAGS += $(cpp_path) -endif - -#------------------------------------------------------------------------ -# Default rules and macros -#------------------------------------------------------------------------ - -.SUFFIXES: -.SUFFIXES: .F90 .c .o - -# Set the vpath for all file types EXCEPT .o -# We do this for individual file types rather than generally using -# VPATH, because for .o files, we don't want to use files from a -# different build (e.g., in building the unit tester, we don't want to -# use .o files from the main build) -vpath %.F90 $(vpath_dirs) -vpath %.c $(vpath_dirs) -vpath %.h $(vpath_dirs) - -# Append user defined compiler and load flags to Makefile defaults -CFLAGS += $(USER_CFLAGS) -FFLAGS += $(USER_FFLAGS) -LDFLAGS += $(USER_LDFLAGS) - -# Set user specified linker -ifneq ($(USER_LINKER),$(null)) - LINKER := $(USER_LINKER) -else - LINKER := $(FC) -endif - -.F90.o: - $(FC) $(FFLAGS) $< - -.c.o: - $(CC) -c $(CFLAGS) $< - - -$(EXENAME): $(OBJS) - $(LINKER) -o $@ $(OBJS) $(LDFLAGS) - -clean: - $(RM) -f $(OBJS) *.mod Depends - -include $(CURDIR)/Depends diff --git a/tools/mkprocdata_map/src/Mkdepends b/tools/mkprocdata_map/src/Mkdepends deleted file mode 100755 index a75e8fdde0..0000000000 --- a/tools/mkprocdata_map/src/Mkdepends +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/bin/env perl - -# Generate dependencies in a form suitable for inclusion into a Makefile. -# The source filenames are provided in a file, one per line. Directories -# to be searched for the source files and for their dependencies are provided -# in another file, one per line. Output is written to STDOUT. -# -# For CPP type dependencies (lines beginning with #include) the dependency -# search is recursive. Only dependencies that are found in the specified -# directories are included. So, for example, the standard include file -# stdio.h would not be included as a dependency unless /usr/include were -# one of the specified directories to be searched. -# -# For Fortran module USE dependencies (lines beginning with a case -# insensitive "USE", possibly preceded by whitespace) the Fortran compiler -# must be able to access the .mod file associated with the .o file that -# contains the module. In order to correctly generate these dependencies -# two restrictions must be observed. -# 1) All modules must be contained in files that have the same base name as -# the module, in a case insensitive sense. This restriction implies that -# there can only be one module per file. -# 2) All modules that are to be contained in the dependency list must be -# contained in one of the source files in the list provided on the command -# line. -# The reason for the second restriction is that since the makefile doesn't -# contain rules to build .mod files the dependency takes the form of the .o -# file that contains the module. If a module is being used for which the -# source code is not available (e.g., a module from a library), then adding -# a .o dependency for that module is a mistake because make will attempt to -# build that .o file, and will fail if the source code is not available. -# -# Author: B. Eaton -# Climate Modelling Section, NCAR -# Feb 2001 - -use Getopt::Std; -use File::Basename; - -# Check for usage request. -@ARGV >= 2 or usage(); - -# Process command line. -my %opt = (); -getopts( "t:w", \%opt ) or usage(); -my $filepath_arg = shift() or usage(); -my $srcfile_arg = shift() or usage(); -@ARGV == 0 or usage(); # Check that all args were processed. - -my $obj_dir; -if ( defined $opt{'t'} ) { $obj_dir = $opt{'t'}; } - -open(FILEPATH, $filepath_arg) or die "Can't open $filepath_arg: $!\n"; -open(SRCFILES, $srcfile_arg) or die "Can't open $srcfile_arg: $!\n"; - -# Make list of paths to use when looking for files. -# Prepend "." so search starts in current directory. This default is for -# consistency with the way GNU Make searches for dependencies. -my @file_paths = ; -close(FILEPATH); -chomp @file_paths; -unshift(@file_paths,'.'); -foreach $dir (@file_paths) { # (could check that directories exist here) - $dir =~ s!/?\s*$!!; # remove / and any whitespace at end of directory name - ($dir) = glob $dir; # Expand tildes in path names. -} - -# Make list of files containing source code. -my @src = ; -close(SRCFILES); -chomp @src; - -# For each file that may contain a Fortran module (*.[fF]90 *.[fF]) convert the -# file's basename to uppercase and use it as a hash key whose value is the file's -# basename. This allows fast identification of the files that contain modules. -# The only restriction is that the file's basename and the module name must match -# in a case insensitive way. -my %module_files = (); -my ($f, $name, $path, $suffix, $mod); -my @suffixes = ('\.[fF]90', '\.[fF]' ); -foreach $f (@src) { - ($name, $path, $suffix) = fileparse($f, @suffixes); - ($mod = $name) =~ tr/a-z/A-Z/; - $module_files{$mod} = $name; -} - -# Now make a list of .mod files in the file_paths. If a .o source dependency -# can't be found based on the module_files list above, then maybe a .mod -# module dependency can if the mod file is visible. -my %trumod_files = (); -my ($dir); -my ($f, $name, $path, $suffix, $mod); -my @suffixes = ('\.mod' ); -foreach $dir (@file_paths) { - @filenames = (glob("$dir/*.mod")); - foreach $f (@filenames) { - ($name, $path, $suffix) = fileparse($f, @suffixes); - ($mod = $name) =~ tr/a-z/A-Z/; - $trumod_files{$mod} = $name; - } -} - -#print STDERR "\%module_files\n"; -#while ( ($k,$v) = each %module_files ) { -# print STDERR "$k => $v\n"; -#} - -# Find module and include dependencies of the source files. -my ($file_path, $rmods, $rincs); -my %file_modules = (); -my %file_includes = (); -my @check_includes = (); -foreach $f ( @src ) { - - # Find the file in the seach path (@file_paths). - unless ($file_path = find_file($f)) { - if (defined $opt{'w'}) {print STDERR "$f not found\n";} - next; - } - - # Find the module and include dependencies. - ($rmods, $rincs) = find_dependencies( $file_path ); - - # Remove redundancies (a file can contain multiple procedures that have - # the same dependencies). - $file_modules{$f} = rm_duplicates($rmods); - $file_includes{$f} = rm_duplicates($rincs); - - # Make a list of all include files. - push @check_includes, @{$file_includes{$f}}; -} - -#print STDERR "\%file_modules\n"; -#while ( ($k,$v) = each %file_modules ) { -# print STDERR "$k => @$v\n"; -#} -#print STDERR "\%file_includes\n"; -#while ( ($k,$v) = each %file_includes ) { -# print STDERR "$k => @$v\n"; -#} -#print STDERR "\@check_includes\n"; -#print STDERR "@check_includes\n"; - -# Find include file dependencies. -my %include_depends = (); -while (@check_includes) { - $f = shift @check_includes; - if (defined($include_depends{$f})) { next; } - - # Mark files not in path so they can be removed from the dependency list. - unless ($file_path = find_file($f)) { - $include_depends{$f} = -1; - next; - } - - # Find include file dependencies. - ($rmods, $include_depends{$f}) = find_dependencies($file_path); - - # Add included include files to the back of the check_includes list so - # that their dependencies can be found. - push @check_includes, @{$include_depends{$f}}; - - # Add included modules to the include_depends list. - if ( @$rmods ) { push @{$include_depends{$f}}, @$rmods; } -} - -#print STDERR "\%include_depends\n"; -#while ( ($k,$v) = each %include_depends ) { -# print STDERR (ref $v ? "$k => @$v\n" : "$k => $v\n"); -#} - -# Remove include file dependencies that are not in the Filepath. -my $i, $ii; -foreach $f (keys %include_depends) { - - unless (ref $include_depends{$f}) { next; } - $rincs = $include_depends{$f}; - unless (@$rincs) { next; } - $ii = 0; - $num_incs = @$rincs; - for ($i = 0; $i < $num_incs; ++$i) { - if ($include_depends{$$rincs[$ii]} == -1) { - splice @$rincs, $ii, 1; - next; - } - ++$ii; - } -} - -# Substitute the include file dependencies into the %file_includes lists. -foreach $f (keys %file_includes) { - my @expand_incs = (); - - # Initialize the expanded %file_includes list. - my $i; - unless (@{$file_includes{$f}}) { next; } - foreach $i (@{$file_includes{$f}}) { - push @expand_incs, $i unless ($include_depends{$i} == -1); - } - unless (@expand_incs) { - $file_includes{$f} = []; - next; - } - - # Expand - for ($i = 0; $i <= $#expand_incs; ++$i) { - push @expand_incs, @{ $include_depends{$expand_incs[$i]} }; - } - - $file_includes{$f} = rm_duplicates(\@expand_incs); -} - -#print STDERR "expanded \%file_includes\n"; -#while ( ($k,$v) = each %file_includes ) { -# print STDERR "$k => @$v\n"; -#} - -# Print dependencies to STDOUT. -foreach $f (sort keys %file_modules) { - $f =~ /(.+)\./; - $target = "$1.o"; - if ( defined $opt{'t'} ) { $target = "$opt{'t'}/$1.o"; } - print "$target : $f @{$file_modules{$f}} @{$file_includes{$f}}\n"; -} - -#-------------------------------------------------------------------------------------- - -sub find_dependencies { - - # Find dependencies of input file. - # Use'd Fortran 90 modules are returned in \@mods. - # Files that are "#include"d by the cpp preprocessor are returned in \@incs. - - my( $file ) = @_; - my( @mods, @incs ); - - open(FH, $file) or die "Can't open $file: $!\n"; - - while ( ) { - # Search for "#include" and strip filename when found. - if ( /^#include\s+[<"](.*)[>"]/ ) { - push @incs, $1; - } - # Search for Fortran include dependencies. - elsif ( /^\s*include\s+['"](.*)['"]/ ) { #" for emacs fontlock - push @incs, $1; - } - # Search for module dependencies. - elsif ( /^\s*USE\s+(\w+)/i ) { - ($module = $1) =~ tr/a-z/A-Z/; - # Return dependency in the form of a .o version of the file that contains - # the module. this is from the source list. - if ( defined $module_files{$module} ) { - if ( defined $obj_dir ) { - push @mods, "$obj_dir/$module_files{$module}.o"; - } else { - push @mods, "$module_files{$module}.o"; - } - } - # Return dependency in the form of a .mod version of the file that contains - # the module. this is from the .mod list. only if .o version not found - elsif ( defined $trumod_files{$module} ) { - if ( defined $obj_dir ) { - push @mods, "$obj_dir/$trumod_files{$module}.mod"; - } else { - push @mods, "$trumod_files{$module}.mod"; - } - } - } - } - close( FH ); - return (\@mods, \@incs); -} - -#-------------------------------------------------------------------------------------- - -sub find_file { - -# Search for the specified file in the list of directories in the global -# array @file_paths. Return the first occurance found, or the null string if -# the file is not found. - - my($file) = @_; - my($dir, $fname); - - foreach $dir (@file_paths) { - $fname = "$dir/$file"; - if ( -f $fname ) { return $fname; } - } - return ''; # file not found -} - -#-------------------------------------------------------------------------------------- - -sub rm_duplicates { - -# Return a list with duplicates removed. - - my ($in) = @_; # input arrary reference - my @out = (); - my $i; - my %h = (); - foreach $i (@$in) { - $h{$i} = ''; - } - @out = keys %h; - return \@out; -} - -#-------------------------------------------------------------------------------------- - -sub usage { - ($ProgName = $0) =~ s!.*/!!; # name of program - die < shr_kind_r8 - implicit none - save - - real(R8),parameter :: SHR_CONST_REARTH = 6.37122e6_R8 ! radius of earth ~ m - real(r8),parameter :: re_km = SHR_CONST_REARTH*0.001 ! radius of earth (km) - -end module constMod diff --git a/tools/mkprocdata_map/src/fileutils.F90 b/tools/mkprocdata_map/src/fileutils.F90 deleted file mode 100644 index e1f8e633da..0000000000 --- a/tools/mkprocdata_map/src/fileutils.F90 +++ /dev/null @@ -1,282 +0,0 @@ -module fileutils - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: fileutils -! -! !DESCRIPTION: -! Module containing file I/O utilities -! -! !USES: -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: get_filename !Returns filename given full pathname - public :: opnfil !Open local unformatted or formatted file - public :: getfil !Obtain local copy of file - public :: relavu !Close and release Fortran unit no longer in use - public :: getavu !Get next available Fortran unit number -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE MEMBER FUNCTIONS: None -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: get_filename -! -! !INTERFACE: - character(len=256) function get_filename (fulpath) -! -! !DESCRIPTION: -! Returns filename given full pathname -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fulpath !full pathname -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer i !loop index - integer klen !length of fulpath character string -!------------------------------------------------------------------------ - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i) == '/') go to 10 - end do - i = 0 -10 get_filename = fulpath(i+1:klen) - - end function get_filename - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_filename -! -! !INTERFACE: - character(len=256) function set_filename (rem_dir, loc_fn) -! -! !DESCRIPTION: -! -! !ARGUMENTS: -! - implicit none - character(len=*), intent(in) :: rem_dir !remote directory - character(len=*), intent(in) :: loc_fn !local full path filename -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i !integer -!------------------------------------------------------------------------ - - set_filename = ' ' - do i = len_trim(loc_fn), 1, -1 - if (loc_fn(i:i)=='/') go to 10 - end do - i = 0 -10 set_filename = trim(rem_dir) // loc_fn(i+1:len_trim(loc_fn)) - - end function set_filename - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: getfil -! -! !INTERFACE: - subroutine getfil (fulpath, locfn, iflag) -! -! !DESCRIPTION: -! Obtain local copy of file -! First check current working directory -! Next check full pathname[fulpath] on disk -! Finally check full pathname[fulpath] on archival system -! -! !USES: -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fulpath !Archival or permanent disk full pathname - character(len=*), intent(out) :: locfn !output local file name - integer, optional, intent(in) :: iflag !0=>abort if file not found 1=>do not abort -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer i !loop index - integer klen !length of fulpath character string - integer ierr !error status - logical lexist !true if local file exists - character(len=len(fulpath)+5) :: fulpath2 !Archival full pathname -!------------------------------------------------------------------------ - - ! get local file name from full name: start at end. look for first "/" - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i).eq.'/') go to 100 - end do - i = 0 -100 locfn = fulpath(i+1:klen) - if (len_trim(locfn) == 0) then - write(6,*)'(GETFIL): local filename has zero length' - stop 1 - else - write(6,*)'(GETFIL): attempting to find local file ',trim(locfn) - endif - - ! first check if file is in current working directory. - - inquire (file=locfn,exist=lexist) - if (lexist) then - write(6,*) '(GETFIL): using ',trim(locfn),' in current working directory' - RETURN - endif - - ! second check for full pathname on disk - - inquire(file=fulpath, exist=lexist) - if (lexist) then - locfn = trim(fulpath) - write(6,*) '(GETFIL): using ',trim(fulpath) - RETURN - else - write(6,*) 'GETFIL: FAILED to get '//trim(fulpath) - stop 1 - end if - - end subroutine getfil - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: opnfil -! -! !INTERFACE: - subroutine opnfil (locfn, iun, form) -! -! !DESCRIPTION: -! Open file locfn in unformatted or formatted form on unit iun -! -! !ARGUMENTS: -! - implicit none - character(len=*), intent(in):: locfn !file name - integer, intent(in):: iun !fortran unit number - character(len=1), intent(in):: form !file format: u = unformatted, - !f = formatted -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer ioe !error return from fortran open - character(len=11) ft !format type: formatted. unformatted -!------------------------------------------------------------------------ - - if (len_trim(locfn) == 0) then - write(6,*)'OPNFIL: local filename has zero length' - stop 1 - endif - if (form=='u' .or. form=='U') then - ft = 'unformatted' - else - ft = 'formatted ' - end if - open (unit=iun,file=locfn,status='unknown',form=ft,iostat=ioe) - if (ioe /= 0) then - write(6,*)'(OPNFIL): failed to open file ',trim(locfn), & - & ' on unit ',iun,' ierr=',ioe - stop 1 - else - write(6,*)'(OPNFIL): Successfully opened file ',trim(locfn),' on unit= ',iun - end if - - end subroutine opnfil - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: getavu -! -! !INTERFACE: - integer function getavu() -! -! !DESCRIPTION: -! Get next available Fortran unit number. -! -! !USES: - use shr_file_mod, only : shr_file_getUnit -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! Modified for clm2 by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP -!------------------------------------------------------------------------ - - getavu = shr_file_getunit() - - end function getavu - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: relavu -! -! !INTERFACE: - subroutine relavu (iunit) -! -! !DESCRIPTION: -! Close and release Fortran unit no longer in use! -! -! !USES: - use shr_file_mod, only : shr_file_freeUnit -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: iunit !Fortran unit number -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! -!EOP -!------------------------------------------------------------------------ - - close(iunit) - call shr_file_freeUnit(iunit) - - end subroutine relavu - -end module fileutils diff --git a/tools/mkprocdata_map/src/fmain.F90 b/tools/mkprocdata_map/src/fmain.F90 deleted file mode 100644 index ba9e593c1d..0000000000 --- a/tools/mkprocdata_map/src/fmain.F90 +++ /dev/null @@ -1,78 +0,0 @@ -program fmain - - use mkprocdata_map, only : mkmap - implicit none - - character(len= 256) :: arg - integer :: n !index - integer :: nargs !number of arguments - integer, external :: iargc !number of arguments function - character(len=256) :: filei !input file - character(len=256) :: fileo !output mapped file - character(len=256) :: fmap !maping file - character(len=256) :: ftemplate !template file, containing lat & lon arrays desired in output file - character(len=256) :: cmdline !input command line - integer, parameter :: inival = -999 !initial value for command-line integers - !---------------------------------------------------- - - filei = ' ' - fileo = ' ' - fmap = ' ' - ftemplate = ' ' - - cmdline = 'mkprocdata_map' - nargs = iargc() - n = 1 - do while (n <= nargs) - arg = ' ' - call getarg (n, arg) - n = n + 1 - - select case (arg) - case ('-i') - call getarg (n, arg) - n = n + 1 - filei = trim(arg) - cmdline = trim(cmdline) // ' -i ' // trim(arg) - case ('-o') - call getarg (n, arg) - n = n + 1 - fileo = trim(arg) - cmdline = trim(cmdline) // ' -o ' // trim(arg) - case ('-m') - call getarg (n, arg) - n = n + 1 - fmap = trim(arg) - cmdline = trim(cmdline) // ' -m ' // trim(arg) - case ('-t') - call getarg (n, arg) - n = n + 1 - ftemplate = trim(arg) - cmdline = trim(cmdline) // ' -t ' // trim(arg) - case default - write (6,*) 'Argument ', arg,' is not known' - call usage_exit (' ') - cmdline = trim(cmdline) // ' ' // trim(arg) - end select - end do - - if (filei == ' ' .or. fileo == ' ' .or. fmap == ' ' & - .or. ftemplate == ' ') then - call usage_exit ('Must specify all the following arguments') - end if - - call mkmap (filei, fileo, fmap, ftemplate) - -end program fmain - - -subroutine usage_exit (arg) - implicit none - character(len=*) :: arg - if (arg /= ' ') write (6,*) arg - write (6,*) 'Usage: mkprocdata_map -i -o -m -t